diff --git a/.gitignore b/.gitignore index 5a9cce919..708494d09 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,9 @@ ahci_test ascii.bitmaps ascii.h autom4te.cache -build-grub-gen-asciih -build-grub-gen-widthspec -build-grub-mkfont +build-VasEBoot-gen-asciih +build-VasEBoot-gen-widthspec +build-VasEBoot-mkfont cdboot_test cmp_test config.cache @@ -31,7 +31,7 @@ docs/*.info docs/stamp-vti docs/version.texi ehci_test -example_grub_script_test +example_VasEBoot_script_test example_scripted_test example_unit_test *.exec @@ -43,101 +43,101 @@ gentrigtables gentrigtables.exe gettext_strings_test gpt_unit_test -grub-bin2h -/grub-bios-setup -/grub-bios-setup.exe -grub_cmd_date -grub_cmd_echo -grub_cmd_regexp -grub_cmd_set_date -grub_cmd_sleep -/grub-editenv -/grub-editenv.exe -grub-emu -grub-emu-lite -grub-emu.exe -grub-emu-lite.exe -grub_emu_init.c -grub_emu_init.h -/grub-file -/grub-file.exe -grub-fstest -grub-fstest.exe -grub_fstest_init.c -grub_fstest_init.h -grub_func_test -grub-install -grub-install.exe -grub-kbdcomp -/grub-macbless -/grub-macbless.exe -grub-macho2img -/grub-menulst2cfg -/grub-menulst2cfg.exe -/grub-mk* -grub-mount -/grub-ofpathname -/grub-ofpathname.exe -grub-core/build-grub-pe2elf.exe -/grub-probe -/grub-probe.exe -grub_probe_init.c -grub_probe_init.h -/grub-reboot -grub_script_blanklines -grub_script_blockarg -grub_script_break -grub-script-check -grub-script-check.exe -grub_script_check_init.c -grub_script_check_init.h -grub_script_comments -grub_script_continue -grub_script_dollar -grub_script_echo1 -grub_script_echo_keywords -grub_script_escape_comma -grub_script_eval -grub_script_expansion -grub_script_final_semicolon -grub_script_for1 -grub_script_functions -grub_script_gettext -grub_script_if -grub_script_leading_whitespace -grub_script_no_commands -grub_script_not -grub_script_return -grub_script_setparams -grub_script_shift -grub_script_strcmp -grub_script_test -grub_script_vars1 -grub_script_while1 -grub_script.tab.c -grub_script.tab.h -grub_script.yy.c -grub_script.yy.h -grub-set-default -grub_setup_init.c -grub_setup_init.h -grub-shell -grub-shell-tester -grub-sparc64-setup -grub-sparc64-setup.exe -/grub-syslinux2cfg -/grub-syslinux2cfg.exe +VasEBoot-bin2h +/VasEBoot-bios-setup +/VasEBoot-bios-setup.exe +VasEBoot_cmd_date +VasEBoot_cmd_echo +VasEBoot_cmd_regexp +VasEBoot_cmd_set_date +VasEBoot_cmd_sleep +/VasEBoot-editenv +/VasEBoot-editenv.exe +VasEBoot-emu +VasEBoot-emu-lite +VasEBoot-emu.exe +VasEBoot-emu-lite.exe +VasEBoot_emu_init.c +VasEBoot_emu_init.h +/VasEBoot-file +/VasEBoot-file.exe +VasEBoot-fstest +VasEBoot-fstest.exe +VasEBoot_fstest_init.c +VasEBoot_fstest_init.h +VasEBoot_func_test +VasEBoot-install +VasEBoot-install.exe +VasEBoot-kbdcomp +/VasEBoot-macbless +/VasEBoot-macbless.exe +VasEBoot-macho2img +/VasEBoot-menulst2cfg +/VasEBoot-menulst2cfg.exe +/VasEBoot-mk* +VasEBoot-mount +/VasEBoot-ofpathname +/VasEBoot-ofpathname.exe +VasEBoot-core/build-VasEBoot-pe2elf.exe +/VasEBoot-probe +/VasEBoot-probe.exe +VasEBoot_probe_init.c +VasEBoot_probe_init.h +/VasEBoot-reboot +VasEBoot_script_blanklines +VasEBoot_script_blockarg +VasEBoot_script_break +VasEBoot-script-check +VasEBoot-script-check.exe +VasEBoot_script_check_init.c +VasEBoot_script_check_init.h +VasEBoot_script_comments +VasEBoot_script_continue +VasEBoot_script_dollar +VasEBoot_script_echo1 +VasEBoot_script_echo_keywords +VasEBoot_script_escape_comma +VasEBoot_script_eval +VasEBoot_script_expansion +VasEBoot_script_final_semicolon +VasEBoot_script_for1 +VasEBoot_script_functions +VasEBoot_script_gettext +VasEBoot_script_if +VasEBoot_script_leading_whitespace +VasEBoot_script_no_commands +VasEBoot_script_not +VasEBoot_script_return +VasEBoot_script_setparams +VasEBoot_script_shift +VasEBoot_script_strcmp +VasEBoot_script_test +VasEBoot_script_vars1 +VasEBoot_script_while1 +VasEBoot_script.tab.c +VasEBoot_script.tab.h +VasEBoot_script.yy.c +VasEBoot_script.yy.h +VasEBoot-set-default +VasEBoot_setup_init.c +VasEBoot_setup_init.h +VasEBoot-shell +VasEBoot-shell-tester +VasEBoot-sparc64-setup +VasEBoot-sparc64-setup.exe +/VasEBoot-syslinux2cfg +/VasEBoot-syslinux2cfg.exe gzcompress_test hddboot_test help_test *.img *.image *.image.exe -include/grub/cpu -include/grub/machine +include/VasEBoot/cpu +include/VasEBoot/machine install-sh -lib/libgcrypt-grub -libgrub_a_init.c +lib/libgcrypt-VasEBoot +libVasEBoot_a_init.c *.log *.lst lzocompress_test @@ -155,7 +155,7 @@ pata_test *.pf2 *.pp po/*.mo -po/grub.pot +po/VasEBoot.pot po/POTFILES po/stamp-po printf_test @@ -169,7 +169,7 @@ symlist.h trigtables.c *.trs uhci_test -update-grub_lib +update-VasEBoot_lib unidata.c xzcompress_test Makefile.in @@ -181,48 +181,48 @@ compile depcomp mdate-sh texinfo.tex -grub-core/lib/libgcrypt-grub +VasEBoot-core/lib/libgcrypt-VasEBoot .deps .deps-util .deps-core .dirstamp Makefile.util.am contrib -grub-core/bootinfo.txt -grub-core/Makefile.core.am -grub-core/Makefile.gcry.def -grub-core/contrib -grub-core/gdb_grub -grub-core/genmod.sh -grub-core/gensyminfo.sh -grub-core/gmodule.pl -grub-core/grub.chrp -grub-core/modinfo.sh -grub-core/*.module -grub-core/*.module.exe -grub-core/*.pp -grub-core/kernel.img.bin -util/bash-completion.d/grub -grub-core/gnulib/alloca.h -grub-core/gnulib/arg-nonnull.h -grub-core/gnulib/c++defs.h -grub-core/gnulib/charset.alias -grub-core/gnulib/configmake.h -grub-core/gnulib/float.h -grub-core/gnulib/getopt.h -grub-core/gnulib/langinfo.h -grub-core/gnulib/ref-add.sed -grub-core/gnulib/ref-del.sed -grub-core/gnulib/stdio.h -grub-core/gnulib/stdlib.h -grub-core/gnulib/string.h -grub-core/gnulib/strings.h -grub-core/gnulib/sys -grub-core/gnulib/unistd.h -grub-core/gnulib/warn-on-use.h -grub-core/gnulib/wchar.h -grub-core/gnulib/wctype.h -grub-core/rs_decoder.h +VasEBoot-core/bootinfo.txt +VasEBoot-core/Makefile.core.am +VasEBoot-core/Makefile.gcry.def +VasEBoot-core/contrib +VasEBoot-core/gdb_VasEBoot +VasEBoot-core/genmod.sh +VasEBoot-core/gensyminfo.sh +VasEBoot-core/gmodule.pl +VasEBoot-core/VasEBoot.chrp +VasEBoot-core/modinfo.sh +VasEBoot-core/*.module +VasEBoot-core/*.module.exe +VasEBoot-core/*.pp +VasEBoot-core/kernel.img.bin +util/bash-completion.d/VasEBoot +VasEBoot-core/gnulib/alloca.h +VasEBoot-core/gnulib/arg-nonnull.h +VasEBoot-core/gnulib/c++defs.h +VasEBoot-core/gnulib/charset.alias +VasEBoot-core/gnulib/configmake.h +VasEBoot-core/gnulib/float.h +VasEBoot-core/gnulib/getopt.h +VasEBoot-core/gnulib/langinfo.h +VasEBoot-core/gnulib/ref-add.sed +VasEBoot-core/gnulib/ref-del.sed +VasEBoot-core/gnulib/stdio.h +VasEBoot-core/gnulib/stdlib.h +VasEBoot-core/gnulib/string.h +VasEBoot-core/gnulib/strings.h +VasEBoot-core/gnulib/sys +VasEBoot-core/gnulib/unistd.h +VasEBoot-core/gnulib/warn-on-use.h +VasEBoot-core/gnulib/wchar.h +VasEBoot-core/gnulib/wctype.h +VasEBoot-core/rs_decoder.h widthspec.bin widthspec.h docs/stamp-1 @@ -232,19 +232,19 @@ po/*.po po/*.gmo po/LINGUAS po/remove-potcdate.sed -include/grub/gcrypt/gcrypt.h -include/grub/gcrypt/g10lib.h +include/VasEBoot/gcrypt/gcrypt.h +include/VasEBoot/gcrypt/g10lib.h po/POTFILES.in po/POTFILES-shell.in -/grub-glue-efi -/grub-render-label -/grub-glue-efi.exe -/grub-render-label.exe -grub-core/gnulib/locale.h -grub-core/gnulib/unitypes.h -grub-core/gnulib/uniwidth.h +/VasEBoot-glue-efi +/VasEBoot-render-label +/VasEBoot-glue-efi.exe +/VasEBoot-render-label.exe +VasEBoot-core/gnulib/locale.h +VasEBoot-core/gnulib/unitypes.h +VasEBoot-core/gnulib/uniwidth.h build-aux/test-driver /garbage-gen /garbage-gen.exe -/grub-fs-tester -grub-core/build-grub-module-verifier +/VasEBoot-fs-tester +VasEBoot-core/build-VasEBoot-module-verifier diff --git a/AUTHORS b/AUTHORS index 8de5c4d30..77f020ff4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,7 +6,7 @@ Yoshinori K. Okuji designed and implemented the initial version. Jeroen Dekkers added initrd support, Multiboot support, and fixed bugs in ext2fs. -Marco Gerards added ext2fs support, grub-emu, a new command-line +Marco Gerards added ext2fs support, VasEBoot-emu, a new command-line engine, and fixed many bugs. Omniflux added terminfo and serial support. diff --git a/BUGS b/BUGS index 46faa6452..8aae43aab 100644 --- a/BUGS +++ b/BUGS @@ -1,4 +1,4 @@ -GRUB team is aware of following problems: +VasEBoot team is aware of following problems: - Currently search and assembling multidevice abstractions scans all the devices which can be slow. - Cache isn't used correctly for video which results in slowness. diff --git a/ChangeLog-2015 b/ChangeLog-2015 index 869f6bfb8..0d26b915a 100644 --- a/ChangeLog-2015 +++ b/ChangeLog-2015 @@ -4,7 +4,7 @@ 2015-01-23 Andrei Borzenkov - * grub-core/disk/xen/xendisk.c: Accept hdX as disk names on Xen to + * VasEBoot-core/disk/xen/xendisk.c: Accept hdX as disk names on Xen to allow legacy menu.lst processing. 2015-01-22 Felix Janda @@ -17,157 +17,157 @@ 2015-01-20 Vladimir Serbinenko - * grub-core/normal/menu_text.c (grub_menu_init_page): Avoid + * VasEBoot-core/normal/menu_text.c (VasEBoot_menu_init_page): Avoid returning 0 geometry to avoid divisions by 0. 2015-01-20 Vladimir Serbinenko - * grub-core/osdep/unix/cputime.c (grub_util_get_cpu_time_ms): Cache + * VasEBoot-core/osdep/unix/cputime.c (VasEBoot_util_get_cpu_time_ms): Cache sc_clk_tck and check it for sanity. 2015-01-20 Vladimir Serbinenko - * grub-core/kern/efi/mm.c (grub_efi_get_memory_map): Never return a + * VasEBoot-core/kern/efi/mm.c (VasEBoot_efi_get_memory_map): Never return a descriptor_size==0 to avoid potential divisions by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/osdep/haiku/getroot.c (grub_util_find_partition_start_os): + * VasEBoot-core/osdep/haiku/getroot.c (VasEBoot_util_find_partition_start_os): Avoid division by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/kern/generic/rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid + * VasEBoot-core/kern/generic/rtc_get_time_ms.c (VasEBoot_rtc_get_time_ms): Avoid division by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (guessfsb): Avoid division by 0. + * VasEBoot-core/loader/i386/xnu.c (guessfsb): Avoid division by 0. 2015-01-20 Vladimir Serbinenko - * grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure that + * VasEBoot-core/kern/i386/tsc.c (calibrate_tsc): Ensure that no division by 0 occurs. 2015-01-20 Vladimir Serbinenko - * include/grub/misc.h (grub_div_roundup): Remove as it's unused. + * include/VasEBoot/misc.h (VasEBoot_div_roundup): Remove as it's unused. 2015-01-20 Vladimir Serbinenko - * grub-core/term/gfxterm.c: Avoid division by zero. + * VasEBoot-core/term/gfxterm.c: Avoid division by zero. 2015-01-20 Vladimir Serbinenko Avoid division by zero in serial. - * grub-core/term/serial.c (grub_cmd_serial): Ensure speed is not 0. - * grub-core/term/ns8250.c (serial_get_divisor): Exit if speed is 0. + * VasEBoot-core/term/serial.c (VasEBoot_cmd_serial): Ensure speed is not 0. + * VasEBoot-core/term/ns8250.c (serial_get_divisor): Exit if speed is 0. 2015-01-20 Vladimir Serbinenko - * grub-core/video/readers/jpeg.c: Avoid sivision by zero. + * VasEBoot-core/video/readers/jpeg.c: Avoid sivision by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/disk/diskfilter.c: Validate volumes to avoid division + * VasEBoot-core/disk/diskfilter.c: Validate volumes to avoid division by zero. 2015-01-20 Vladimir Serbinenko - * include/grub/term.h: Avoid returining 0-sized terminal + * include/VasEBoot/term.h: Avoid returining 0-sized terminal as it may lead to division by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/zfs.c: Avoid divisions by zero. + * VasEBoot-core/fs/zfs.c: Avoid divisions by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/btrfs.c: Avoid divisions by zero. + * VasEBoot-core/fs/btrfs.c: Avoid divisions by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Check that hash len is not 0. + * VasEBoot-core/lib/pbkdf2.c (VasEBoot_crypto_pbkdf2): Check that hash len is not 0. 2015-01-20 Vladimir Serbinenko - * grub-core/osdep/linux/blocklist.c (grub_install_get_blocklist): Check + * VasEBoot-core/osdep/linux/blocklist.c (VasEBoot_install_get_blocklist): Check blocksize validity. 2015-01-20 Vladimir Serbinenko - * grub-core/disk/i386/pc/biosdisk.c: Check disk size sanity. + * VasEBoot-core/disk/i386/pc/biosdisk.c: Check disk size sanity. 2015-01-20 Vladimir Serbinenko - * grub-core/disk/ieee1275/nand.c (grub_nand_open): Check block size + * VasEBoot-core/disk/ieee1275/nand.c (VasEBoot_nand_open): Check block size validity. 2015-01-20 Vladimir Serbinenko - * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Do not + * VasEBoot-core/disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Do not divide by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_mount): Additional filesystem sanity checks. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/minix.c: Additional filesystem + * VasEBoot-core/fs/minix.c: Additional filesystem sanity checks. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/ext2.c (grub_ext2_mount): Additional + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_mount): Additional checks for superblock validity. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_mount): Check + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_mount): Check that sblock.ino_per_group is not 0. 2015-01-20 Vladimir Serbinenko Reject NILFS2 superblocks with over 1GiB blocks. - * grub-core/fs/nilfs2.c (grub_nilfs2_valid_sb): Check that + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_valid_sb): Check that block size is <= 1GiB. 2015-01-20 Vladimir Serbinenko - * grub-core/disk/ata.c (grub_ata_setaddress): Check that geometry + * VasEBoot-core/disk/ata.c (VasEBoot_ata_setaddress): Check that geometry is sane when using CHS addressing. 2015-01-20 Vladimir Serbinenko - * grub-core/disk/AFSplitter.c (AF_merge): Check that mdlen is not 0. + * VasEBoot-core/disk/AFSplitter.c (AF_merge): Check that mdlen is not 0. 2015-01-20 Vladimir Serbinenko - * grub-core/commands/i386/pc/play.c (grub_cmd_play): Avoid + * VasEBoot-core/commands/i386/pc/play.c (VasEBoot_cmd_play): Avoid division by zero. 2015-01-20 Vladimir Serbinenko - * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_maxpacket): Avoid + * VasEBoot-core/bus/usb/usbtrans.c (VasEBoot_usb_bulk_maxpacket): Avoid potentially returning 0. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past + * VasEBoot-core/fs/minix.c (VasEBoot_minix_read_file): Avoid reading past the end of file. 2015-01-20 Vladimir Serbinenko - * grub-core/fs/fshelp.c (grub_fshelp_read_file): Don't attempt to read + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_read_file): Don't attempt to read past the end of file. 2015-01-20 Vladimir Serbinenko - * grub-core/script/lexer.c (grub_script_lexer_yywrap): Update len + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_yywrap): Update len synchronously with line. 2015-01-20 Vladimir Serbinenko @@ -176,43 +176,43 @@ 2015-01-19 Kris Moore - * grub-core/disk/geli.c: Support GELI v6 and v7. + * VasEBoot-core/disk/geli.c: Support GELI v6 and v7. 2014-12-09 Andrei Borzenkov - * grub-core/term/serial.c (grub_cmd_serial): Fix --rtscts + * VasEBoot-core/term/serial.c (VasEBoot_cmd_serial): Fix --rtscts option processing. 2014-12-07 David Kozub - * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable + * VasEBoot-core/kern/arm/misc.S: fix unaligned 64bit local variable in __aeabi_uidivmod Fixes Savannah bug #43632. 2014-12-07 Peter Nelson - * grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_read_block): Support large sparse chunks. 2014-12-07 Andrei Borzenkov - * util/grub-mkconfig_lib.in (version_test_gt): Remove redundant + * util/VasEBoot-mkconfig_lib.in (version_test_gt): Remove redundant non-portable '-n' echo option. - * util/grub.d/10_kfreebsd.in: Change how list is built to avoid + * util/VasEBoot.d/10_kfreebsd.in: Change how list is built to avoid non-portable 'echo -n. - * util/grub.d/10_linux.in: Likewise (closes 43668). - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Print spaces directly to avoid + * util/VasEBoot.d/10_linux.in: Likewise (closes 43668). + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Print spaces directly to avoid non-portable 'echo -n'. 2014-12-07 Curtis Larsen - * grub-core/net/tcp.c (grub_net_recv_tcp_packet): Fix double + * VasEBoot-core/net/tcp.c (VasEBoot_net_recv_tcp_packet): Fix double free when multiple empty segments were received (closes 42765). 2014-12-05 Andrei Borzenkov - * tests/util/grub-shell.in: Support --files also for netboot. + * tests/util/VasEBoot-shell.in: Support --files also for netboot. * tests/file_filter_test.in: New file with file filters tests. * Makefile.util.def: Add file_filter_test. * conf/Makefile.extra-dist: ... and here. @@ -225,69 +225,69 @@ * tests/file_filter/keys: Likewise. * tests/file_filter/keys.pub: Likewise. * tests/file_filter/test.cfg: Likewise. - * grub-core/commands/verify.c: Fix memory corruption doing + * VasEBoot-core/commands/verify.c: Fix memory corruption doing signature check for network files (closes 43601). 2014-12-01 Andrei Borzenkov - * grub-core/loader/i386/xen_fileXX.c (grub_xen_get_infoXX): Fix + * VasEBoot-core/loader/i386/xen_fileXX.c (VasEBoot_xen_get_infoXX): Fix memory leak (CID 73645, 73782). - * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix memory leak + * VasEBoot-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix memory leak (CID 73635). 2014-11-30 Andrei Borzenkov - * grub-core/lib/syslinux_parse.c (free_menu): Do not free + * VasEBoot-core/lib/syslinux_parse.c (free_menu): Do not free inline array (CID 73610). 2014-11-28 Andrei Borzenkov - * grub-core/io/lzopio.c (test_header): Fix double free (CID 73665) - * grub-core/disk/geli.c (configure_ciphers): Fix memory leaks + * VasEBoot-core/io/lzopio.c (test_header): Fix double free (CID 73665) + * VasEBoot-core/disk/geli.c (configure_ciphers): Fix memory leaks (Coverity CID 73813, 73710) - * grub-core/disk/luks.c (configure_ciphers): Fix memory leaks + * VasEBoot-core/disk/luks.c (configure_ciphers): Fix memory leaks and use after free (Coverity CID 73813, 73710, 73730) - * grub-core/disk/luks.c (luks_recover_key): Fix memory leak (Coverity + * VasEBoot-core/disk/luks.c (luks_recover_key): Fix memory leak (Coverity CID 73854) - * util/grub-install-common.c (grub_install_get_target): Check return - value of grub_util_fd_read (Coverity CID 73819). - * util/grub-mkstandalone.c (add_tar_file): Fix out of bound access + * util/VasEBoot-install-common.c (VasEBoot_install_get_target): Check return + value of VasEBoot_util_fd_read (Coverity CID 73819). + * util/VasEBoot-mkstandalone.c (add_tar_file): Fix out of bound access to hd.magic (Coverity CID 73587, 73888, bug 43690). 2014-11-20 Andrei Borzenkov - * tests/util/grub-fs-tester.in: Consistently print output - of grub ls if test fails. + * tests/util/VasEBoot-fs-tester.in: Consistently print output + of VasEBoot ls if test fails. 2014-11-07 Leif Lindholm - * grub-core/kern/efi/init.c: check value of *path before + * VasEBoot-core/kern/efi/init.c: check value of *path before dereferencing. 2014-11-03 Michael Chang - * grub-core/net/icmp6.c (grub_net_recv_icmp6_packet): Fix size - of neighbor solicitation packet in grub_netbuff_pull. + * VasEBoot-core/net/icmp6.c (VasEBoot_net_recv_icmp6_packet): Fix size + of neighbor solicitation packet in VasEBoot_netbuff_pull. 2014-10-14 Andrei Borzenkov - * grub-core/loader/arm/linux.c: Use full initializer for initrd_ctx to + * VasEBoot-core/loader/arm/linux.c: Use full initializer for initrd_ctx to avoid fatal warnings with older gcc (probably before 4.7). - * grub-core/loader/arm64/linux.c: Likewise. - * grub-core/loader/i386/linux.c: Likewise. - * grub-core/loader/i386/pc/linux.c: Likewise. - * grub-core/loader/ia64/efi/linux.c: Likewise. - * grub-core/loader/mips/linux.c: Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c: Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c: Likewise. + * VasEBoot-core/loader/arm64/linux.c: Likewise. + * VasEBoot-core/loader/i386/linux.c: Likewise. + * VasEBoot-core/loader/i386/pc/linux.c: Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c: Likewise. + * VasEBoot-core/loader/mips/linux.c: Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c: Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c: Likewise. 2014-09-25 Colin Watson Fix in-tree --platform=none - * configure.ac: Only remove include/grub/cpu and - include/grub/machine in the --platform=none case, not all of - include/grub. + * configure.ac: Only remove include/VasEBoot/cpu and + include/VasEBoot/machine in the --platform=none case, not all of + include/VasEBoot. 2014-09-23 Colin Watson @@ -298,14 +298,14 @@ x86_64-none to i386. Define COND_real_platform Automake conditional if the platform is anything other than "none". Don't do any include directory linking for "none". - * Makefile.am: Skip building grub-core and all bootcheck targets if + * Makefile.am: Skip building VasEBoot-core and all bootcheck targets if !COND_real_platform. - * include/grub/time.h: Don't include if GRUB_UTIL + * include/VasEBoot/time.h: Don't include if VasEBoot_UTIL is defined. 2014-09-22 Andrei Borzenkov - Use grub_cpu_to_XXX_compile_time for constants. + Use VasEBoot_cpu_to_XXX_compile_time for constants. 2014-09-21 Valentin Dornauer @@ -314,64 +314,64 @@ the parser (incorrect handling of TermArg data types) would lead to the laptop not turning off (_S5 not found). - * grub-core/commands/acpihalt.c: Support OpAlias in the AML parser; + * VasEBoot-core/commands/acpihalt.c: Support OpAlias in the AML parser; in skip_ext_op(), handle some Type2Opcodes more correctly (TermArgs aren't always simply strings!); Add function to skip TermArgs - * include/grub/acpi.h: Add new opcodes + * include/VasEBoot/acpi.h: Add new opcodes 2014-09-21 Vladimir Serbinenko - * grub-core/normal/main.c: Don't drop to rescue console in + * VasEBoot-core/normal/main.c: Don't drop to rescue console in case of password-protected prompt and no menu entries. 2014-09-21 Vladimir Serbinenko - * grub-core/commands/keylayouts.c: Ignore unknown keys. + * VasEBoot-core/commands/keylayouts.c: Ignore unknown keys. 2014-09-21 Vladimir Serbinenko - * grub-core/gmodule.pl.in: Accept newer binutils which output + * VasEBoot-core/gmodule.pl.in: Accept newer binutils which output empty column rather than 0x0. 2014-09-21 Michael Chang - * grub-core/osdep/unix/config.c: Remove extraneous comma. + * VasEBoot-core/osdep/unix/config.c: Remove extraneous comma. 2014-09-21 Peter Jones - * grub-core/loader/arm/linux.c: Initialized initrd_ctx so + * VasEBoot-core/loader/arm/linux.c: Initialized initrd_ctx so we don't free a random pointer from the stack. - * grub-core/loader/arm64/linux.c: Likewise. - * grub-core/loader/i386/linux.c: Likewise. - * grub-core/loader/i386/pc/linux.c: Likewise. - * grub-core/loader/ia64/efi/linux.c: Likewise. - * grub-core/loader/mips/linux.c: Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c: Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c: Likewise. + * VasEBoot-core/loader/arm64/linux.c: Likewise. + * VasEBoot-core/loader/i386/linux.c: Likewise. + * VasEBoot-core/loader/i386/pc/linux.c: Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c: Likewise. + * VasEBoot-core/loader/mips/linux.c: Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c: Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c: Likewise. 2014-09-15 Khem Raj - * grub-core/kern/emu/hostfs.c: use _DEFAULT_SOURCE in addition to + * VasEBoot-core/kern/emu/hostfs.c: use _DEFAULT_SOURCE in addition to _BSD_SOURCE to avoid warnings under glibc 2.20+. 2014-09-08 Michael Chang - * grub-core/fs/btrfs.c (grub_btrfs_extent_read): Fix extent size + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_extent_read): Fix extent size check; comparing &data->extent against addresses in the region it points to is unpredictable. 2014-09-07 Colin Watson - Support grub-emu on x32 (ILP32 but with x86-64 instruction set) + Support VasEBoot-emu on x32 (ILP32 but with x86-64 instruction set) * configure.ac: Remove -m64 from checks for -mcmodel=large and -mno-red-zone. These are always either unnecessary (x86_64-emu) or already in TARGET_CFLAGS at this point, and they produce incorrect results when building for x32. - * grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Cast - pointers to Elf64_Xword via grub_addr_t, in order to work on x32. - * include/grub/x86_64/types.h (GRUB_TARGET_SIZEOF_VOID_P, - GRUB_TARGET_SIZEOF_LONG): Define to 4 on x32. + * VasEBoot-core/kern/x86_64/dl.c (VasEBoot_arch_dl_relocate_symbols): Cast + pointers to Elf64_Xword via VasEBoot_addr_t, in order to work on x32. + * include/VasEBoot/x86_64/types.h (VasEBoot_TARGET_SIZEOF_VOID_P, + VasEBoot_TARGET_SIZEOF_LONG): Define to 4 on x32. 2014-09-07 Colin Watson @@ -379,95 +379,95 @@ 2014-08-25 Colin Watson - * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation): + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_machine_get_bootlocation): Initialise pend to pacify GCC. 2014-08-14 Andrey Borzenkov - * util/grub-mkconfig.in: Fix typo (gettext_print instead of + * util/VasEBoot-mkconfig.in: Fix typo (gettext_print instead of gettext_printf). 2014-08-13 Vladimir Serbinenko - * grub-core/term/at_keyboard.c: Retry probing keyboard if + * VasEBoot-core/term/at_keyboard.c: Retry probing keyboard if scancode setup failed. 2014-08-10 Vladimir Serbinenko - * grub-core/kern/disk_common.c: Clump disk size to 1EiB. + * VasEBoot-core/kern/disk_common.c: Clump disk size to 1EiB. 2014-08-10 Vladimir Serbinenko - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Add + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_rw): Add safety to avoid triggerring VirtualBox bug. 2014-08-10 Vladimir Serbinenko - * grub-core/fs/cbfs.c: Don't probe disks of unknow size. + * VasEBoot-core/fs/cbfs.c: Don't probe disks of unknow size. Fixes hang on virtualbox. 2014-07-08 Colin Watson - * util/grub.d/10_hurd.in: Make kernel list progression not fail on + * util/VasEBoot.d/10_hurd.in: Make kernel list progression not fail on kernels whose paths contain regex metacharacters. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. Reported by: Heimo Stranner. 2014-06-26 Colin Watson - * docs/grub-dev.texi (Finding your way around): The build system no + * docs/VasEBoot-dev.texi (Finding your way around): The build system no longer uses AutoGen directly. 2014-06-21 Роман Пехов - * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check. + * VasEBoot-core/commands/loadenv.c (check_blocklists): Fix overlap check. 2014-06-21 Glenn Washburn - * util/grub-install.c: Fix handling of --disk-module. + * util/VasEBoot-install.c: Fix handling of --disk-module. 2014-06-21 Stephane Rochoy - * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_netbsd_boot): Pass pointer to EFI system table. 2014-06-21 Stephane Rochoy - * grub-core/commands/efi/lsefisystab.c (grub_cmd_lsefisystab): Show + * VasEBoot-core/commands/efi/lsefisystab.c (VasEBoot_cmd_lsefisystab): Show EFI system table physical address. 2014-06-21 Trevor Woerner - * util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable. + * util/VasEBoot-gen-asciih.c (add_glyph): Fix uninitialised variable. 2014-06-21 Vladimir Serbinenko - * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. + * VasEBoot-core/commands/verify.c (VasEBoot_pubkey_open): Trust procfs. 2014-06-21 Vladimir Serbinenko - * grub-core/commands/verify.c (grub_pubkey_open): Fix memdisk + * VasEBoot-core/commands/verify.c (VasEBoot_pubkey_open): Fix memdisk check. 2014-04-20 Vladimir Serbinenko - * grub-core/kern/misc.c (__bzero): Don't compile in GRUB_UTIL. + * VasEBoot-core/kern/misc.c (__bzero): Don't compile in VasEBoot_UTIL. Reported by: Yves Blusseau . 2014-04-20 Piotr Krysiuk - * grub-core/lib/i386/relocator.c: Allow loading old kernels by placing + * VasEBoot-core/lib/i386/relocator.c: Allow loading old kernels by placing GDT in conventional memory. 2014-04-10 Colin Watson - * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem - UUID. Other parts of grub-mkconfig tolerate these, they were + * util/VasEBoot.d/30_os-prober.in: Tolerate devices with no filesystem + UUID. Other parts of VasEBoot-mkconfig tolerate these, they were previously allowed here up to commit 55e706c918922def17f5012c23cfe88c4c645208, and they can arise in practice when the system has active LVM snapshots. @@ -475,104 +475,104 @@ 2014-04-10 Colin Watson - * grub-core/disk/lvm.c (grub_lvm_detect): Search for + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_detect): Search for "logical_volumes" block a little more accurately. 2014-04-06 Vladimir Serbinenko - * grub-core/lib/syslinux_parse.c: Fix timeout quoting. + * VasEBoot-core/lib/syslinux_parse.c: Fix timeout quoting. 2014-04-04 Vladimir Serbinenko - * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer + * include/VasEBoot/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer pulled from libgcc. 2014-04-04 Vladimir Serbinenko Replace few instances of memcmp/memcpy in the code that should be - grub_memcmp/grub_memcpy. + VasEBoot_memcmp/VasEBoot_memcpy. 2014-04-03 Vladimir Serbinenko - * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe + * VasEBoot-core/osdep/linux/getroot.c (VasEBoot_util_part_to_disk): Support NVMe device names. 2014-03-31 Thomas Falcon btrfs: fix get_root key comparison failures due to endianness - * grub-core/fs/btrfs.c (get_root): Convert - GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian. + * VasEBoot-core/fs/btrfs.c (get_root): Convert + VasEBoot_BTRFS_ROOT_VOL_OBJECTID to little-endian. 2014-03-31 Colin Watson - Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. + Fix partmap, cryptodisk, and abstraction handling in VasEBoot-mkconfig. - Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig - no longer to be forgiving of trailing spaces on grub-probe output - lines, which among other things means that util/grub.d/10_linux.in - no longer detects LVM. To fix this, make grub-probe's output + Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused VasEBoot-mkconfig + no longer to be forgiving of trailing spaces on VasEBoot-probe output + lines, which among other things means that util/VasEBoot.d/10_linux.in + no longer detects LVM. To fix this, make VasEBoot-probe's output delimiting more consistent. As a bonus, this improves the coverage of the -0 option. Fixes Debian bug #735935. - * grub-core/disk/cryptodisk.c - (grub_util_cryptodisk_get_abstraction): Add a user-data argument. - * grub-core/disk/diskfilter.c (grub_diskfilter_get_partmap): + * VasEBoot-core/disk/cryptodisk.c + (VasEBoot_util_cryptodisk_get_abstraction): Add a user-data argument. + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_get_partmap): Likewise. - * include/grub/cryptodisk.h (grub_util_cryptodisk_get_abstraction): + * include/VasEBoot/cryptodisk.h (VasEBoot_util_cryptodisk_get_abstraction): Update prototype. - * include/grub/diskfilter.h (grub_diskfilter_get_partmap): Likewise. - * util/grub-install.c (push_partmap_module, push_cryptodisk_module, + * include/VasEBoot/diskfilter.h (VasEBoot_diskfilter_get_partmap): Likewise. + * util/VasEBoot-install.c (push_partmap_module, push_cryptodisk_module, probe_mods): Adjust for extra user-data arguments. - * util/grub-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid, + * util/VasEBoot-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid, probe_abstraction): Use configured delimiter. Update callers. 2014-03-31 Colin Watson - * util/grub-probe,c (options): Make -0 work again (broken by + * util/VasEBoot-probe,c (options): Make -0 work again (broken by conversion to argp). (main): Simplify logic. 2014-03-26 Vladimir Serbinenko - * grub-core/lib/relocator.c: Fix the case when end of leftover is used. + * VasEBoot-core/lib/relocator.c: Fix the case when end of leftover is used. 2014-03-26 Fu Wei - * grub-core/loader/arm64/linux.c: Remove redundant "0x". + * VasEBoot-core/loader/arm64/linux.c: Remove redundant "0x". 2014-02-28 Vladimir Serbinenko - * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields. - * grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Fill addr field. + * include/VasEBoot/i386/openbsd_bootarg.h: Add addr and frequency fields. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_cmd_openbsd): Fill addr field. Suggested by: Markus Müller. 2014-02-28 Vladimir Serbinenko - * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map + * VasEBoot-core/kern/i386/pc/mmap.c: Fallback to EISA memory map if E820 failed to return any regions. 2014-02-28 Vladimir Serbinenko - * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low + * VasEBoot-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low tables for low memory calculations. 2014-02-28 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_make_mbi): Limit location to 640K. 2014-02-28 Vladimir Serbinenko - * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 + * VasEBoot-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 region. 2014-02-20 Vladimir Serbinenko - * grub-core/disk/ahci.c: Ignore NPORTS field and rely on PI + * VasEBoot-core/disk/ahci.c: Ignore NPORTS field and rely on PI exclusively. 2014-02-04 Paulo Flabiano Smorigo @@ -581,61 +581,61 @@ It enables net boot even when there is no bootp/dhcp server. - * grub-core/net/drivers/ieee1275/ofnet.c: Add grub_ieee1275_parse_bootpath - and call it at grub_ieee1275_net_config_real. - * grub-core/kern/ieee1275/init.c: Add bootpath to - grub_ieee1275_net_config. - * include/grub/ieee1275/ieee1275.h: Likewise. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c: Add VasEBoot_ieee1275_parse_bootpath + and call it at VasEBoot_ieee1275_net_config_real. + * VasEBoot-core/kern/ieee1275/init.c: Add bootpath to + VasEBoot_ieee1275_net_config. + * include/VasEBoot/ieee1275/ieee1275.h: Likewise. 2014-02-04 Paulo Flabiano Smorigo - Add grub_env_set_net_property function. + Add VasEBoot_env_set_net_property function. - * grub-core/net/bootp.c: Remove set_env_limn_ro. - * grub-core/net/net.c: Add grub_env_set_net_property. - * include/grub/net.h: Likewise. + * VasEBoot-core/net/bootp.c: Remove set_env_limn_ro. + * VasEBoot-core/net/net.c: Add VasEBoot_env_set_net_property. + * include/VasEBoot/net.h: Likewise. 2014-02-03 Vladimir Serbinenko - * util/grub-mkrescue.c: Build fix for argp.h with older gcc. + * util/VasEBoot-mkrescue.c: Build fix for argp.h with older gcc. 2014-02-03 Vladimir Serbinenko - * util/grub-mkfont.c: Build fix for argp.h with older gcc. + * util/VasEBoot-mkfont.c: Build fix for argp.h with older gcc. 2014-01-29 Vladimir Serbinenko - * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to + * VasEBoot-core/disk/ahci.c: Increase timeout. Some SSDs take up to 7 seconds to recover if last poweroff was bad. 2014-01-29 Vladimir Serbinenko - * grub-core/disk/ahci.c: Properly handle transactions with no + * VasEBoot-core/disk/ahci.c: Properly handle transactions with no transferred data. 2014-01-29 Vladimir Serbinenko - * grub-core/disk/ahci.c: Add safety cleanups. + * VasEBoot-core/disk/ahci.c: Add safety cleanups. 2014-01-29 Vladimir Serbinenko - * grub-core/disk/ahci.c: Allocate and clean space for all possible 32 + * VasEBoot-core/disk/ahci.c: Allocate and clean space for all possible 32 slots to avoid pointing to uninited area. 2014-01-29 Vladimir Serbinenko - * grub-core/disk/ahci.c: Do not enable I/O decoding and keep + * VasEBoot-core/disk/ahci.c: Do not enable I/O decoding and keep enabling busmaster for the end. 2014-01-29 Vladimir Serbinenko - * util/grub-mkfont.c: Downgrade warnings about unhandled features + * util/VasEBoot-mkfont.c: Downgrade warnings about unhandled features to debug. 2014-01-29 Vladimir Serbinenko - * grub-core/term/at_keyboard.c: Tolerate missing keyboard. + * VasEBoot-core/term/at_keyboard.c: Tolerate missing keyboard. 2014-01-29 Paulo Flabiano Smorigo @@ -643,28 +643,28 @@ 2014-01-26 Mike Gilbert - grub-install: support for partitioned partx loop devices. + VasEBoot-install: support for partitioned partx loop devices. - * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect + * VasEBoot-core/osdep/linux/getroot.c (VasEBoot_util_part_to_disk): Detect /dev/loopX as being the parent of /dev/loopXpY. 2014-01-26 Vladimir Serbinenko - * grub-core/term/serial.c (grub_serial_register): Fix invalid free. + * VasEBoot-core/term/serial.c (VasEBoot_serial_register): Fix invalid free. Ensure that pointers are inited to NULL and that pointers are not accessed after free. 2014-01-25 Andrey Borzenkov - * include/grub/crypto.h: Replace __attribute__ ((format (printf)) with + * include/VasEBoot/crypto.h: Replace __attribute__ ((format (printf)) with __attribute__ ((format (__printf__)) to fix compilation under MinGW-w64. - * include/grub/emu/misc.h: ... and here. - * include/grub/err.h: ... and here. + * include/VasEBoot/emu/misc.h: ... and here. + * include/VasEBoot/err.h: ... and here. * util/import_gcry.py: ... and here (in files g10lib.h). 2014-01-25 Andrey Borzenkov - * util/grub-mkimage.c: Make prefix argument mandatory. + * util/VasEBoot-mkimage.c: Make prefix argument mandatory. 2014-01-24 Vladimir Serbinenko @@ -674,16 +674,16 @@ 2014-01-24 Vladimir Serbinenko - * util/grub-install.c: List available targets. + * util/VasEBoot-install.c: List available targets. 2014-01-23 Colin Watson - * util/grub-install.c (write_to_disk): Add an info message. + * util/VasEBoot-install.c (write_to_disk): Add an info message. 2014-01-21 Andrey Borzenkov * Makefile.am: Allow adding extra files to generated Windows ZIP - archive by setting GRUB_WINDOWS_EXTRA_DIST. + archive by setting VasEBoot_WINDOWS_EXTRA_DIST. 2014-01-21 Andrey Borzenkov @@ -692,52 +692,52 @@ 2014-01-21 Paulo Flabiano Smorigo - * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try + * VasEBoot-core/net/arp.c (VasEBoot_net_arp_send_request): Increase network try interval gradually. - * grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise. - * grub-core/net/net.c (grub_net_fs_read_real): Likewise. - * grub-core/net/tftp.c (tftp_open): Likewise. - * include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define. + * VasEBoot-core/net/icmp6.c (VasEBoot_net_icmp6_send_request): Likewise. + * VasEBoot-core/net/net.c (VasEBoot_net_fs_read_real): Likewise. + * VasEBoot-core/net/tftp.c (tftp_open): Likewise. + * include/VasEBoot/net.h (VasEBoot_NET_INTERVAL_ADDITION): New define. 2014-01-21 Paulo Flabiano Smorigo - * grub-core/net/net.c (receive_packets): Change stop condition to avoid + * VasEBoot-core/net/net.c (receive_packets): Change stop condition to avoid infinite loops. In net/net.c there is a while (1) that only exits if there is a stop condition and more then 10 packages or if there is no package received. - If GRUB is idle and enter in this loop, the only condition to leave is + If VasEBoot is idle and enter in this loop, the only condition to leave is if it doesn't have incoming packages. In a network with heavy traffic this never happens. 2014-01-19 Colin Watson - * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore + * VasEBoot-core/osdep/freebsd/hostdisk.c (VasEBoot_util_fd_open): Ignore EPERM when modifying kern.geom.debugflags. It is only a problem for - such things as installing GRUB to the MBR, in which case there'll be + such things as installing VasEBoot to the MBR, in which case there'll be an error later anyway, not for opening files during tests. 2014-01-18 Andrey Borzenkov - * grub-core/Makefile.am: Build grub_emu_init.[ch] from MODULE_FILES + * VasEBoot-core/Makefile.am: Build VasEBoot_emu_init.[ch] from MODULE_FILES instead of MOD_FILES. - * grub-core/genemuinit.sh: Simplify stripping of suffix so it works + * VasEBoot-core/genemuinit.sh: Simplify stripping of suffix so it works both with and without .exe. - * grub-core/genemuinitheader.sh: Same. + * VasEBoot-core/genemuinitheader.sh: Same. 2014-01-18 Vladimir Serbinenko - * util/grub-install.c: Fix a typo. + * util/VasEBoot-install.c: Fix a typo. 2014-01-18 Vladimir Serbinenko - * grub-core/normal/main.c (read_config_file): Buffer config file. + * VasEBoot-core/normal/main.c (read_config_file): Buffer config file. Reduces boot time. 2014-01-18 Andrey Borzenkov - * acinclude.m4 (grub_CHECK_LINK_DIR): Check that we can also remove + * acinclude.m4 (VasEBoot_CHECK_LINK_DIR): Check that we can also remove symbolic link to directory. It fails in Msys shell on Windows 2003. 2014-01-18 Vladimir Serbinenko @@ -747,59 +747,59 @@ 2014-01-18 Mike Gilbert - * Makefile.util.def: Link grub-ofpathname with zfs libs. + * Makefile.util.def: Link VasEBoot-ofpathname with zfs libs. 2014-01-18 Vladimir Serbinenko - * grub-core/commands/macbless.c: Rename FILE and DIR to avoid + * VasEBoot-core/commands/macbless.c: Rename FILE and DIR to avoid conflicts. Reported by: Andrey Borzenkov. 2014-01-18 Andrey Borzenkov - * include/grub/misc.h: Move macros for compiler features to ... - * include/grub/compiler.h: ... new file. - * include/grub/list.h: Include instead of . - * grub-core/commands/fileXX.c: Include . - * grub-core/efiemu/prepare.c: Include . - * grub-core/loader/i386/xen_file.c: Include . - * grub-core/loader/i386/xen_fileXX.c: Include . - * grub-core/video/capture.c: Include . - * include/grub/command.h: Include . - * include/grub/dl.h: Include . - * include/grub/procfs.h: Include . + * include/VasEBoot/misc.h: Move macros for compiler features to ... + * include/VasEBoot/compiler.h: ... new file. + * include/VasEBoot/list.h: Include instead of . + * VasEBoot-core/commands/fileXX.c: Include . + * VasEBoot-core/efiemu/prepare.c: Include . + * VasEBoot-core/loader/i386/xen_file.c: Include . + * VasEBoot-core/loader/i386/xen_fileXX.c: Include . + * VasEBoot-core/video/capture.c: Include . + * include/VasEBoot/command.h: Include . + * include/VasEBoot/dl.h: Include . + * include/VasEBoot/procfs.h: Include . 2014-01-18 Andrey Borzenkov * configure.ac: Add support for BUILD_EXEEXT and use it ... * Makefile.am: ... here. * Makefile.util.def: ... and here. - * grub-core/Makefile.am: ... and here. + * VasEBoot-core/Makefile.am: ... and here. 2014-01-18 Andrey Borzenkov - * include/grub/osdep/hostfile_windows.h: Use _W64 instead of + * include/VasEBoot/osdep/hostfile_windows.h: Use _W64 instead of FILE_OFFSET_BITS to differentiate between native MinGW and Mingw W64. 2014-01-18 Vladimir Serbinenko - * grub-core/term/terminfo.c: Recognize keys F1-F12. + * VasEBoot-core/term/terminfo.c: Recognize keys F1-F12. 2014-01-18 Andrey Borzenkov * configure.ac: Add support for BUILD_LDFLAGS. * Makefile.am: Use BUILD_LDFLAGS for build time programs here ... - * grub-core/Makefile.am: ... and here. + * VasEBoot-core/Makefile.am: ... and here. * INSTALL: Mention BUILD_LDFLAGS. 2014-01-18 Vladimir Serbinenko - * util/grub-mount.c: Extend GCC warning workaround to grub-mount. + * util/VasEBoot-mount.c: Extend GCC warning workaround to VasEBoot-mount. 2014-01-18 Vladimir Serbinenko - * grub-core/kern/efi/efi.c: Ensure that the result starts with / + * VasEBoot-core/kern/efi/efi.c: Ensure that the result starts with / and has no //. 2014-01-18 Vladimir Serbinenko @@ -808,42 +808,42 @@ 2014-01-17 Colin Watson - * util/grub.d/00_header.in (make_timeout): Use && rather than test + * util/VasEBoot.d/00_header.in (make_timeout): Use && rather than test -a. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/10_netbsd.in (netbsd_load_fs_module): Use || rather + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/10_netbsd.in (netbsd_load_fs_module): Use || rather than test -o. - * util/grub.d/30_os-prober.in: Use && rather than test -a, and || + * util/VasEBoot.d/30_os-prober.in: Use && rather than test -a, and || rather than test -o. 2014-01-17 Colin Watson - * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove + * VasEBoot-core/osdep/freebsd/hostdisk.c (VasEBoot_util_fd_open): Remove redundant preprocessor conditional. 2014-01-08 Colin Watson - * Makefile.util.def (grub-macbless): Change mansection to 8. + * Makefile.util.def (VasEBoot-macbless): Change mansection to 8. 2014-01-07 Leif Lindholm - * grub-core/loader/arm64/linux.c: correctly set device path end length. + * VasEBoot-core/loader/arm64/linux.c: correctly set device path end length. 2014-01-07 Andrey Borzenkov - * util/grub-install.c: Use bootaa64.efi instead of bootaarch64.efi on - arm64 to comply with EFI specification. Also use grubaa64.efi for + * util/VasEBoot-install.c: Use bootaa64.efi instead of bootaarch64.efi on + arm64 to comply with EFI specification. Also use VasEBootaa64.efi for consistency. - * util/grub-mkrescue.c: Change to use bootaa64.efi too. + * util/VasEBoot-mkrescue.c: Change to use bootaa64.efi too. 2014-01-07 Andrey Borzenkov - * include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello + * include/VasEBoot/osdep/hostfile_windows.h: Do not redefine fseeko/ftello on MinGW-64 when compiling for 32 bits. 2013-12-30 Andrey Borzenkov - * grub-core/Makefile.core.def: strip .eh_frame section for arm64-efi. + * VasEBoot-core/Makefile.core.def: strip .eh_frame section for arm64-efi. 2013-12-30 Vladimir Serbinenko @@ -855,7 +855,7 @@ 2013-12-28 Andrey Borzenkov - * grub-core/kern/emu/misc.c: Remove unused error.h; fixes compilation + * VasEBoot-core/kern/emu/misc.c: Remove unused error.h; fixes compilation on mingw. 2013-12-28 Colin Watson @@ -865,7 +865,7 @@ 2013-12-27 Vladimir Serbinenko - * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. + * VasEBoot-core/kern/arm/cache_armv6.S: Remove .arch directive. As these functions are used on pre-ARMv6 CPUs as well we don't want to make assembler assume that architecture is higher than default one. @@ -876,12 +876,12 @@ 2013-12-27 Colin Watson - * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. - * docs/grub.texi (Getting the source code): Likewise. + * INSTALL (Cross-compiling the VasEBoot): Fix some spelling mistakes. + * docs/VasEBoot.texi (Getting the source code): Likewise. 2013-12-25 Andrey Borzenkov - * grub-core/osdep/windows/platform.c (get_platform): Fix EFI + * VasEBoot-core/osdep/windows/platform.c (get_platform): Fix EFI detection. 2013-12-24 Vladimir Serbinenko @@ -890,15 +890,15 @@ 2013-12-24 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c (name_devices): Skip Apple ghosts. + * VasEBoot-core/disk/efi/efidisk.c (name_devices): Skip Apple ghosts. 2013-12-24 Andrey Borzenkov - * util/grub-probe.c: Improve help message and simplify list handling. + * util/VasEBoot-probe.c: Improve help message and simplify list handling. 2013-12-24 Vladimir Serbinenko - Fix buffer overflow in grub_efi_print_device_path. + Fix buffer overflow in VasEBoot_efi_print_device_path. 2013-12-24 Vladimir Serbinenko @@ -906,15 +906,15 @@ 2013-12-24 Vladimir Serbinenko - Revert grub-file usage in grub-mkconfig. + Revert VasEBoot-file usage in VasEBoot-mkconfig. 2013-12-24 Vladimir Serbinenko - Make newly-created files other than grub.cfg world-readable. + Make newly-created files other than VasEBoot.cfg world-readable. 2013-12-24 Andrey Borzenkov - * util/grub.d/00_header.in: Improve compatibility with old config. + * util/VasEBoot.d/00_header.in: Improve compatibility with old config. 2013-12-24 Vladimir Serbinenko @@ -924,7 +924,7 @@ 2013-12-24 Vladimir Serbinenko - Make grub_util_device_is_mapped_stat available in grub-emu core. + Make VasEBoot_util_device_is_mapped_stat available in VasEBoot-emu core. 2013-12-24 Vladimir Serbinenko @@ -942,13 +942,13 @@ 2013-12-24 Vladimir Serbinenko - Make grub_util_devmapper_part_to_disk and grub_util_find_partition_start + Make VasEBoot_util_devmapper_part_to_disk and VasEBoot_util_find_partition_start follow the same algorithm to avoid method mismatch. Don't assume DMRAID- UUID to mean full disk but instead check that mapping is linear. 2013-12-24 Vladimir Serbinenko - Declare GRUB_EFI_VENDOR_APPLE_GUID. + Declare VasEBoot_EFI_VENDOR_APPLE_GUID. 2013-12-24 Vladimir Serbinenko @@ -958,7 +958,7 @@ Update some documentation to refer to Git rather than Bazaar. - * docs/grub.texi (Obtaining and Building GRUB): Refer to Git rather + * docs/VasEBoot.texi (Obtaining and Building VasEBoot): Refer to Git rather than Bazaar. * po/README: Likewise. Fix spelling mistake. @@ -973,13 +973,13 @@ 2013-12-23 Colin Watson * configure.ac: Fix spelling. - * grub-core/commands/parttool.c: Fix grammar. - * grub-core/disk/ldm.c: Use consistent capitalisation for "LDM + * VasEBoot-core/commands/parttool.c: Fix grammar. + * VasEBoot-core/disk/ldm.c: Use consistent capitalisation for "LDM Embedding Partition". 2013-12-23 Vladimir Serbinenko - ARM64 support for grub-mkrescue. + ARM64 support for VasEBoot-mkrescue. 2013-12-23 Vladimir Serbinenko @@ -987,11 +987,11 @@ 2013-12-23 Vladimir Serbinenko - * grub-core/modinfo.sh.in: Add build config information. + * VasEBoot-core/modinfo.sh.in: Add build config information. 2013-12-23 Vladimir Serbinenko - ARM64 grub-file and grub-mkconfig support. + ARM64 VasEBoot-file and VasEBoot-mkconfig support. 2013-12-23 Vladimir Serbinenko @@ -999,23 +999,23 @@ 2013-12-23 Vladimir Serbinenko - * include/grub/arm64/linux.h: Remove leftovers. Add missing prefixes. + * include/VasEBoot/arm64/linux.h: Remove leftovers. Add missing prefixes. 2013-12-23 Vladimir Serbinenko - * grub-core/loader/arm64/linux.c: Add missing bracket. + * VasEBoot-core/loader/arm64/linux.c: Add missing bracket. 2013-12-23 Vladimir Serbinenko - Add arm64-efi recognition to grub-file. + Add arm64-efi recognition to VasEBoot-file. 2013-12-23 Vladimir Serbinenko - Fix ia64-efi recognition in grub-file. + Fix ia64-efi recognition in VasEBoot-file. 2013-12-23 Vladimir Serbinenko - Recognize raspberry pi kernel in grub-file. + Recognize raspberry pi kernel in VasEBoot-file. 2013-12-23 Vladimir Serbinenko @@ -1031,18 +1031,18 @@ 2013-12-22 Vladimir Serbinenko - * grub-core/kern/arm/cache.c (grub_arm_disable_caches_mmu): Use v6 + * VasEBoot-core/kern/arm/cache.c (VasEBoot_arm_disable_caches_mmu): Use v6 algorithm on v5. Suggested by: Leif Lindholm. 2013-12-22 Andrey Borzenkov - * util/grub-mkconfig.in: Fix Xen platform conditions. + * util/VasEBoot-mkconfig.in: Fix Xen platform conditions. 2013-12-22 Andrey Borzenkov - * util/grub-mkrescue.c: Split single help message string in several + * util/VasEBoot-mkrescue.c: Split single help message string in several strings used in previous shell version. 2013-12-22 Leif Lindholm @@ -1051,7 +1051,7 @@ 2013-12-22 Leif Lindholm - Add grub_fdt_create_empty_tree() and grub_fdt_set_prop64(). + Add VasEBoot_fdt_create_empty_tree() and VasEBoot_fdt_set_prop64(). 2013-12-22 Vladimir Serbinenko @@ -1059,12 +1059,12 @@ 2013-12-22 Vladimir Serbinenko - * grub-core/loader/arm/linux.c: Pass arguments through on ATAG + * VasEBoot-core/loader/arm/linux.c: Pass arguments through on ATAG platforms. 2013-12-22 Lars Wendler - * util/grub-mkconfig.in: Skip non-executable files. + * util/VasEBoot-mkconfig.in: Skip non-executable files. 2013-12-22 Vladimir Serbinenko @@ -1073,7 +1073,7 @@ 2013-12-22 Vladimir Serbinenko - * include/grub/arm/uboot/kernel.h (GRUB_KERNEL_MACHINE_HEAP_SIZE): + * include/VasEBoot/arm/uboot/kernel.h (VasEBoot_KERNEL_MACHINE_HEAP_SIZE): Increase to 16 MiB to allow loading the whole memdisk. 2013-12-22 Vladimir Serbinenko @@ -1086,11 +1086,11 @@ 2013-12-21 Vladimir Serbinenko - * grub-core/osdep/unix/getroot.c: Non-unix build fix. + * VasEBoot-core/osdep/unix/getroot.c: Non-unix build fix. 2013-12-21 Vladimir Serbinenko - * grub-core/kern/emu/main.c: Build fix for emu. + * VasEBoot-core/kern/emu/main.c: Build fix for emu. 2013-12-21 Vladimir Serbinenko @@ -1098,14 +1098,14 @@ 2013-12-21 Vladimir Serbinenko - * util/grub-glue-efi.c: Use "universal binary" rather "fat binary" + * util/VasEBoot-glue-efi.c: Use "universal binary" rather "fat binary" in strings. Suggested by: David Prévot. 2013-12-21 Vladimir Serbinenko - * include/grub/crypto.h (grub_crypto_xor): Fix cast-align warning. + * include/VasEBoot/crypto.h (VasEBoot_crypto_xor): Fix cast-align warning. 2013-12-21 Vladimir Serbinenko @@ -1118,35 +1118,35 @@ 2013-12-21 Vladimir Serbinenko - * grub-core/commands/macbless.c (grub_mac_bless_inode): Pass inode as + * VasEBoot-core/commands/macbless.c (VasEBoot_mac_bless_inode): Pass inode as u32 as both HFS and HFS+ have 32-bit inodes. 2013-12-21 Vladimir Serbinenko - * include/grub/misc.h (grub_strtol): Fix overflow. + * include/VasEBoot/misc.h (VasEBoot_strtol): Fix overflow. 2013-12-21 Vladimir Serbinenko - * include/grub/term.h (grub_unicode_estimate_width): Use grub_size_t + * include/VasEBoot/term.h (VasEBoot_unicode_estimate_width): Use VasEBoot_size_t as return type in both conditionals. 2013-12-21 Vladimir Serbinenko - * include/grub/video.h (grub_video_rgba_color_rgb): Fix prototype + * include/VasEBoot/video.h (VasEBoot_video_rgba_color_rgb): Fix prototype to use uint8_t for color. 2013-12-21 Vladimir Serbinenko - * util/misc.c (grub_util_get_image_size): Check for overflow. + * util/misc.c (VasEBoot_util_get_image_size): Check for overflow. 2013-12-21 Vladimir Serbinenko - * grub-core/disk/raid6_recover.c (grub_raid_block_mulx): Use grub_size_t + * VasEBoot-core/disk/raid6_recover.c (VasEBoot_raid_block_mulx): Use VasEBoot_size_t for size. 2013-12-21 Vladimir Serbinenko - * grub-core/disk/lvm.c: Use grub_size_t for sizes and grub_ssize_t + * VasEBoot-core/disk/lvm.c: Use VasEBoot_size_t for sizes and VasEBoot_ssize_t for pointer difference. 2013-12-21 Vladimir Serbinenko @@ -1155,7 +1155,7 @@ 2013-12-21 Vladimir Serbinenko - * util/misc.c (grub_qsort_strcmp): Don't discard const attribute. + * util/misc.c (VasEBoot_qsort_strcmp): Don't discard const attribute. 2013-12-21 Vladimir Serbinenko @@ -1175,37 +1175,37 @@ 2013-12-21 Vladimir Serbinenko - * include/grub/crypto.h: Don't discard const attribute. + * include/VasEBoot/crypto.h: Don't discard const attribute. 2013-12-21 Vladimir Serbinenko - * grub-core/net/bootp.c (grub_cmd_dhcpopt): Use snprintf where it + * VasEBoot-core/net/bootp.c (VasEBoot_cmd_dhcpopt): Use snprintf where it was intended. 2013-12-21 Vladimir Serbinenko - * grub-core/lib/crypto.c: Don't discard const attribute. + * VasEBoot-core/lib/crypto.c: Don't discard const attribute. 2013-12-21 Vladimir Serbinenko - * grub-core/lib/disk.c: Fix potential overflow. + * VasEBoot-core/lib/disk.c: Fix potential overflow. 2013-12-21 Vladimir Serbinenko - * grub-core/lib/arg.c: Don't discard const attribute. + * VasEBoot-core/lib/arg.c: Don't discard const attribute. 2013-12-21 Vladimir Serbinenko - * grub-core/kern/dl.c: Don't discard const attribute. + * VasEBoot-core/kern/dl.c: Don't discard const attribute. 2013-12-21 Vladimir Serbinenko - * grub-core/kern/disk.c: Fix potential overflow. + * VasEBoot-core/kern/disk.c: Fix potential overflow. 2013-12-21 Vladimir Serbinenko * conf/Makefile.common: Don't include non-existing directory - grub-core/lib/libgcrypt-grub/include. + VasEBoot-core/lib/libgcrypt-VasEBoot/include. 2013-12-21 Vladimir Serbinenko @@ -1217,7 +1217,7 @@ 2013-12-21 Colin Watson - * util/grub-mkrescue.c: Rephrase mkrescue description. + * util/VasEBoot-mkrescue.c: Rephrase mkrescue description. 2013-12-21 Vladimir Serbinenko 2013-12-21 Colin Watson @@ -1232,17 +1232,17 @@ Fix various build problems on GNU/Hurd. - * grub-core/osdep/unix/getroot.c (strip_extra_slashes): Move inside + * VasEBoot-core/osdep/unix/getroot.c (strip_extra_slashes): Move inside !defined (__GNU__). (xgetcwd): Likewise. - * include/grub/emu/hostdisk.h (grub_util_hurd_get_disk_info) + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_hurd_get_disk_info) [__GNU__]: Add prototype. - * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__GNU__]: Format + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__GNU__]: Format long int using %ld rather than %d. 2013-12-18 Vladimir Serbinenko - * util/grub-install.c: Inform user about install platform. + * util/VasEBoot-install.c: Inform user about install platform. 2013-12-18 Vladimir Serbinenko @@ -1251,27 +1251,27 @@ 2013-12-18 Allen Pais 2013-12-18 Bob Picco - * grub-core/boot/sparc64/ieee1275/boot.S: Fix order of fields. + * VasEBoot-core/boot/sparc64/ieee1275/boot.S: Fix order of fields. 2013-12-18 Vladimir Serbinenko - Make grub_zlib_decompress handle incomplete chunks. + Make VasEBoot_zlib_decompress handle incomplete chunks. Fixes squash4. 2013-12-18 Vladimir Serbinenko - * grub-core/Makefile.am: Don't attempt to export grub_bios_interrupt + * VasEBoot-core/Makefile.am: Don't attempt to export VasEBoot_bios_interrupt on i386-multiboot. 2013-12-18 Aleš Nesrsta - * grub-core/disk/usbms.c: Retry on unknown errors. + * VasEBoot-core/disk/usbms.c: Retry on unknown errors. Reuse the same tag on retries. 2013-12-18 Aleš Nesrsta - * grub-core/bus/usb/ehci.c: Fix handling of newborn transfers. + * VasEBoot-core/bus/usb/ehci.c: Fix handling of newborn transfers. Avoid confusing them with already completed transfers. @@ -1307,7 +1307,7 @@ 2013-12-18 Vladimir Serbinenko - * grub-core/lib/syslinux_parse.c: Declare timeout unsigned. + * VasEBoot-core/lib/syslinux_parse.c: Declare timeout unsigned. 2013-12-18 Vladimir Serbinenko @@ -1318,25 +1318,25 @@ 2013-12-18 Vladimir Serbinenko - Make grub_util_get_windows_path_real static. + Make VasEBoot_util_get_windows_path_real static. 2013-12-18 Vladimir Serbinenko - * grub-core/commands/fileXX.c: Silence cast-align. - * grub-core/loader/i386/xen_fileXX.c: Likewise. + * VasEBoot-core/commands/fileXX.c: Silence cast-align. + * VasEBoot-core/loader/i386/xen_fileXX.c: Likewise. 2013-12-18 Vladimir Serbinenko - * include/grub/efi/api.h (GRUB_EFI_ERROR_CODE): Use explicit cast + * include/VasEBoot/efi/api.h (VasEBoot_EFI_ERROR_CODE): Use explicit cast rather than LL suffix. 2013-12-18 Vladimir Serbinenko - * include/grub/efi/api.h (PRIxGRUB_EFI_UINTN_T): Remove leftover. + * include/VasEBoot/efi/api.h (PRIxVasEBoot_EFI_UINTN_T): Remove leftover. 2013-12-18 Vladimir Serbinenko - * grub-core/loader/arm/linux.c: Use common initrd functions. + * VasEBoot-core/loader/arm/linux.c: Use common initrd functions. 2013-12-18 Vladimir Serbinenko @@ -1344,7 +1344,7 @@ 2013-12-18 Vladimir Serbinenko - * grub-core/kern/arm/dl.c: Remove unnecessarry execution mode check. + * VasEBoot-core/kern/arm/dl.c: Remove unnecessarry execution mode check. 2013-12-18 Vladimir Serbinenko @@ -1352,7 +1352,7 @@ 2013-12-18 Vladimir Serbinenko - * util/grub-file.c (main): Fix sizeof usage. + * util/VasEBoot-file.c (main): Fix sizeof usage. 2013-12-18 Vladimir Serbinenko @@ -1372,7 +1372,7 @@ 2013-12-17 Vladimir Serbinenko - * grub-core/commands/legacycfg.c: Use 32-bit Linux protocol on non-BIOS. + * VasEBoot-core/commands/legacycfg.c: Use 32-bit Linux protocol on non-BIOS. 2013-12-17 Vladimir Serbinenko @@ -1396,15 +1396,15 @@ 2013-12-17 Vladimir Serbinenko - * grub-core/loader/machoXX.c: Fix compilation on non-i386. + * VasEBoot-core/loader/machoXX.c: Fix compilation on non-i386. 2013-12-17 Vladimir Serbinenko - * grub-core/loader/i386/xen_fileXX.c: Silence cast-align. + * VasEBoot-core/loader/i386/xen_fileXX.c: Silence cast-align. 2013-12-17 Vladimir Serbinenko - * grub-core/loader/macho.c: Fix compilation on non-i386. + * VasEBoot-core/loader/macho.c: Fix compilation on non-i386. 2013-12-17 Vladimir Serbinenko @@ -1413,7 +1413,7 @@ 2013-12-17 Vladimir Serbinenko - Use grub_xasprintf to format translated error messages containing + Use VasEBoot_xasprintf to format translated error messages containing 64-bit quantity. 2013-12-17 Jon McCune @@ -1442,7 +1442,7 @@ 2013-12-17 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c: Implement special value for + * VasEBoot-core/loader/multiboot_mbi2.c: Implement special value for load_addr. 2013-12-17 Vladimir Serbinenko @@ -1461,11 +1461,11 @@ 2013-12-17 Vladimir Serbinenko - * grub-core/lib/arg.c: Ensure at least a single space between commands. + * VasEBoot-core/lib/arg.c: Ensure at least a single space between commands. 2013-12-17 Vladimir Serbinenko - Implement grub_file tool and use it to implement generating of config + Implement VasEBoot_file tool and use it to implement generating of config in separate root. 2013-12-17 Vladimir Serbinenko @@ -1474,15 +1474,15 @@ 2013-12-17 Vladimir Serbinenko - * grub-core/lib/i386/xen/relocator.S: Fix hypercall ABI violation. + * VasEBoot-core/lib/i386/xen/relocator.S: Fix hypercall ABI violation. - GRUB relied on %ebx being preserved across hypercall which isn't true. + VasEBoot relied on %ebx being preserved across hypercall which isn't true. 2013-12-17 Vladimir Serbinenko - * grub-core/lib/x86_64/xen/relocator.S: Fix hypercall ABI violation. + * VasEBoot-core/lib/x86_64/xen/relocator.S: Fix hypercall ABI violation. - GRUB relied on %rdi being preserved across hypercall which isn't true. + VasEBoot relied on %rdi being preserved across hypercall which isn't true. 2013-12-17 Vladimir Serbinenko @@ -1490,7 +1490,7 @@ 2013-12-17 Vladimir Serbinenko - Remove grub_bios_interrupt on coreboot. + Remove VasEBoot_bios_interrupt on coreboot. It's not used currently and cannot be used safely currently. @@ -1500,38 +1500,38 @@ 2013-12-16 Vladimir Serbinenko - * util/grub-mkrescue.c: Fix incorrect file usage in fallback code. + * util/VasEBoot-mkrescue.c: Fix incorrect file usage in fallback code. Reported by: Jon McCune 2013-12-16 Andrey Borzenkov - * grub-core/osdep/linux/platform.c (grub_install_get_default_x86_platform): + * VasEBoot-core/osdep/linux/platform.c (VasEBoot_install_get_default_x86_platform): Add verbose information which firmware directories were tried. 2013-12-16 Andrey Borzenkov - * grub-core/osdep/unix/exec.c (grub_util_exec_redirect_all): New + * VasEBoot-core/osdep/unix/exec.c (VasEBoot_util_exec_redirect_all): New function to optionally redirect all three standard descriptors. - Redefine grub_util_exec, grub_util_exec_redirect and - grub_util_exec_redirect_null to use it. - * include/grub/emu/exec.h: Define it. - * include/grub/osdep/exec_unix.h: Delete, it is unused. - * grub-core/osdep/linux/platform.c (grub_install_get_default_x86_platform): - Use grub_util_exec_redirect_all to redirect error to NULL. + Redefine VasEBoot_util_exec, VasEBoot_util_exec_redirect and + VasEBoot_util_exec_redirect_null to use it. + * include/VasEBoot/emu/exec.h: Define it. + * include/VasEBoot/osdep/exec_unix.h: Delete, it is unused. + * VasEBoot-core/osdep/linux/platform.c (VasEBoot_install_get_default_x86_platform): + Use VasEBoot_util_exec_redirect_all to redirect error to NULL. 2013-12-16 Vladimir Serbinenko - * grub-core/tests/sleep_test.c: Silence spurious warning. + * VasEBoot-core/tests/sleep_test.c: Silence spurious warning. 2013-12-16 Vladimir Serbinenko - Make grub_xen_hypercall on i386 cdecl rather than stdcall to avoid + Make VasEBoot_xen_hypercall on i386 cdecl rather than stdcall to avoid linker trying to "fixup" the code. 2013-12-16 Vladimir Serbinenko - * grub-core/kern/x86_64/xen/startup.S: Align stack. + * VasEBoot-core/kern/x86_64/xen/startup.S: Align stack. 2013-12-16 Vladimir Serbinenko @@ -1539,7 +1539,7 @@ 2013-12-16 Vladimir Serbinenko - * grub-core/commands/minicmd.c (grub_mini_cmd_dump): Handle LLP case. + * VasEBoot-core/commands/minicmd.c (VasEBoot_mini_cmd_dump): Handle LLP case. 2013-12-16 Vladimir Serbinenko @@ -1549,21 +1549,21 @@ 2013-12-16 Vladimir Serbinenko - * include/grub/x86_64/types.h: Define sizeof (long) as 4 when compiling + * include/VasEBoot/x86_64/types.h: Define sizeof (long) as 4 when compiling with mingw. 2013-12-16 Vladimir Serbinenko - * include/grub/efi/api.h: Don't use call wrappers when compiled with + * include/VasEBoot/efi/api.h: Don't use call wrappers when compiled with mingw or cygwin as API already matches. 2013-12-16 Vladimir Serbinenko - * grub-core/lib/posix_wrap/errno.h: Undefine errno before redefining. + * VasEBoot-core/lib/posix_wrap/errno.h: Undefine errno before redefining. 2013-12-16 Vladimir Serbinenko - * include/grub/efi/api.h: Define (u)intn_t based on pointer size and + * include/VasEBoot/efi/api.h: Define (u)intn_t based on pointer size and not on long. 2013-12-16 Vladimir Serbinenko @@ -1579,7 +1579,7 @@ 2013-12-16 Vladimir Serbinenko - * grub-core/genmod.sh.in: Strip before converting to ELF as strip + * VasEBoot-core/genmod.sh.in: Strip before converting to ELF as strip may not work with ELF. 2013-12-16 Vladimir Serbinenko @@ -1593,17 +1593,17 @@ 2013-12-16 Vladimir Serbinenko - * grub-core/genmoddep.awk: Remove explicit getline < /dev/stdin. + * VasEBoot-core/genmoddep.awk: Remove explicit getline < /dev/stdin. 2013-12-15 Andrey Borzenkov - * grub-core/osdep/windows/platform.c (grub_install_register_efi): Handle + * VasEBoot-core/osdep/windows/platform.c (VasEBoot_install_register_efi): Handle unlikely errors when getting EFI variables and make exhaustive search for all BootNNNN variables to find matching one. 2013-12-15 Ian Campbell - * grub-core/kern/uboot/init.c: Fix units of uboot timer. + * VasEBoot-core/kern/uboot/init.c: Fix units of uboot timer. 2013-12-15 Vladimir Serbinenko @@ -1619,52 +1619,52 @@ 2013-12-15 Vladimir Serbinenko - * grub-core/commands/efi/lsefisystab.c: Use %lld to show + * VasEBoot-core/commands/efi/lsefisystab.c: Use %lld to show num_table_entries. 2013-12-15 Vladimir Serbinenko - * include/grub/test.h: Use gnu_printf rather than printf on GRUB + * include/VasEBoot/test.h: Use gnu_printf rather than printf on VasEBoot functions. 2013-12-15 Vladimir Serbinenko - * grub-core/loader/i386/linux.c: Use grub_addr_t rather than long when + * VasEBoot-core/loader/i386/linux.c: Use VasEBoot_addr_t rather than long when appropriate. 2013-12-15 Vladimir Serbinenko - * grub-core/loader/i386/linux.c: Use %p rather than %lx for pointers. + * VasEBoot-core/loader/i386/linux.c: Use %p rather than %lx for pointers. 2013-12-15 Vladimir Serbinenko - * grub-core/kern/elfXX.c: Use grub_addr_t rather than long when + * VasEBoot-core/kern/elfXX.c: Use VasEBoot_addr_t rather than long when appropriate. 2013-12-15 Vladimir Serbinenko - * grub-core/disk/loopback.c: Use sequential IDs rather than pointer. + * VasEBoot-core/disk/loopback.c: Use sequential IDs rather than pointer. In case of quick removal of loopback and adding another one it may get same ID, confusing the cache system. 2013-12-15 Vladimir Serbinenko - * grub-core/commands/acpi.c: Use grub_addr_t rather than long when + * VasEBoot-core/commands/acpi.c: Use VasEBoot_addr_t rather than long when appropriate. 2013-12-15 Vladimir Serbinenko - * grub-core/kern/i386/coreboot/cbtable.c: Use char * arithmetic rather + * VasEBoot-core/kern/i386/coreboot/cbtable.c: Use char * arithmetic rather than converting to long. 2013-12-15 Vladimir Serbinenko - * grub-core/disk/cryptodisk.c: Rename "n" to "last_cryptodisk_id". + * VasEBoot-core/disk/cryptodisk.c: Rename "n" to "last_cryptodisk_id". 2013-12-15 Vladimir Serbinenko - * util/grub-mkimagexx.c (relocate_addresses): Display offset rather + * util/VasEBoot-mkimagexx.c (relocate_addresses): Display offset rather than almost useless pointer. 2013-12-15 Vladimir Serbinenko @@ -1675,11 +1675,11 @@ 2013-12-14 Vladimir Serbinenko - * include/grub/i386/coreboot/lbio.h: Add missing attribute (packed). + * include/VasEBoot/i386/coreboot/lbio.h: Add missing attribute (packed). 2013-12-14 Vladimir Serbinenko - * util/grub-pe2elf.c: Fix handling of .bss. + * util/VasEBoot-pe2elf.c: Fix handling of .bss. 2013-12-14 Vladimir Serbinenko @@ -1691,9 +1691,9 @@ 2013-12-14 Vladimir Serbinenko - Change grub_install_register_efi interface to pass GRUB device. + Change VasEBoot_install_register_efi interface to pass VasEBoot device. - This allows grub_install_register_efi to request partition info + This allows VasEBoot_install_register_efi to request partition info directly. 2013-12-14 Vladimir Serbinenko @@ -1710,12 +1710,12 @@ 2013-12-14 Vladimir Serbinenko - * grub-core/kern/i386/qemu/init.c (resource): Decrease struct size + * VasEBoot-core/kern/i386/qemu/init.c (resource): Decrease struct size by using bitfields. 2013-12-14 Vladimir Serbinenko - * grub-core/boot/i386/qemu/boot.S: Add missing EXT_C. + * VasEBoot-core/boot/i386/qemu/boot.S: Add missing EXT_C. 2013-12-14 Vladimir Serbinenko @@ -1723,17 +1723,17 @@ 2013-12-14 Vladimir Serbinenko - Fix definition of grub_efi_hard_drive_device_path. Take care that + Fix definition of VasEBoot_efi_hard_drive_device_path. Take care that existing code would work even if by some reason bogus definition is used by EFI implementations. 2013-12-14 Vladimir Serbinenko - * grub-core/osdep/windows/hostdisk.c: Fix cygwin compilation. + * VasEBoot-core/osdep/windows/hostdisk.c: Fix cygwin compilation. 2013-12-14 Vladimir Serbinenko - * grub-core/osdep/windows/blocklist.c: Add missing cast in printf + * VasEBoot-core/osdep/windows/blocklist.c: Add missing cast in printf invocation. 2013-12-14 Vladimir Serbinenko @@ -1743,7 +1743,7 @@ 2013-12-14 Vladimir Serbinenko - * include/grub/efi/api.h: Rename protocol and interface to avoid + * include/VasEBoot/efi/api.h: Rename protocol and interface to avoid conflict. 2013-12-14 Vladimir Serbinenko @@ -1753,7 +1753,7 @@ 2013-12-14 Vladimir Serbinenko - * grub-core/osdep/exec.c: Use unix version on cygwin. + * VasEBoot-core/osdep/exec.c: Use unix version on cygwin. 2013-12-13 Vladimir Serbinenko @@ -1761,13 +1761,13 @@ 2013-12-11 Vladimir Serbinenko - * grub-core/normal/charset.c: Fix premature line wrap and crash. + * VasEBoot-core/normal/charset.c: Fix premature line wrap and crash. Crash happened only in some cases like a string starting at the half of the screen of same length. 2013-12-11 Vladimir Serbinenko - * include/grub/efiemu/efiemu.h: Sync configuration table declaration + * include/VasEBoot/efiemu/efiemu.h: Sync configuration table declaration with EFI counterpart. 2013-12-11 Vladimir Serbinenko @@ -1776,42 +1776,42 @@ 2013-12-11 Vladimir Serbinenko - * grub-core/commands/efi/lssal.c: Fix terminating condition. + * VasEBoot-core/commands/efi/lssal.c: Fix terminating condition. 2013-12-11 Vladimir Serbinenko - Introduce grub_efi_packed_guid and use it where alignment is not + Introduce VasEBoot_efi_packed_guid and use it where alignment is not guaranteed. 2013-12-11 Vladimir Serbinenko - * include/grub/efi/api.h (grub_efi_device_path): Define length as + * include/VasEBoot/efi/api.h (VasEBoot_efi_device_path): Define length as unaligned u16 rather than u8[2]. 2013-12-11 Vladimir Serbinenko - * grub-core/kern/ia64/dl.c (grub_arch_dl_relocate_symbols): Add checks + * VasEBoot-core/kern/ia64/dl.c (VasEBoot_arch_dl_relocate_symbols): Add checks for relocation range. 2013-12-11 Vladimir Serbinenko - * grub-core/kern/ia64/dl.c (grub_arch_dl_relocate_symbols): Handle + * VasEBoot-core/kern/ia64/dl.c (VasEBoot_arch_dl_relocate_symbols): Handle non-function pcrel21b relocation. It happens with .text.unlikely section. 2013-12-10 Leif Lindholm * make MAX_USABLE_ADDRESS platform-specific - * grub-core/kern/efi/mm.c: add Vladimir's new BYTES_TO_PAGES_DOWN macro. + * VasEBoot-core/kern/efi/mm.c: add Vladimir's new BYTES_TO_PAGES_DOWN macro. 2013-12-10 Leif Lindholm - * grub-core/lib/fdt.c: change memcpy => grub_memcpy + * VasEBoot-core/lib/fdt.c: change memcpy => VasEBoot_memcpy 2013-12-09 Jon McCune * Add --no-rs-codes flag to optionally disable reed-solomon codes - in grub-install and grub-bios-setup for x86 BIOS targets. + in VasEBoot-install and VasEBoot-bios-setup for x86 BIOS targets. 2013-12-09 Vladimir Serbinenko @@ -1823,68 +1823,68 @@ 2013-12-09 Vladimir Serbinenko - * grub-core/kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Check + * VasEBoot-core/kern/sparc64/dl.c (VasEBoot_arch_dl_relocate_symbols): Check range of R_SPARC_HI22. Implement R_SPARC_LM22. 2013-12-09 Vladimir Serbinenko - * grub-core/kern/powerpc/dl_helper.c (grub_arch_dl_get_tramp_got_size): + * VasEBoot-core/kern/powerpc/dl_helper.c (VasEBoot_arch_dl_get_tramp_got_size): Do not explicitly check for symbol table as it's already checked in platform-independent layer. 2013-12-09 Vladimir Serbinenko - * grub-core/kern/emu/cache.c [__ia64__]: Use our cache cleaning routine + * VasEBoot-core/kern/emu/cache.c [__ia64__]: Use our cache cleaning routine on ia64 as __clear_cache is a dummy on ia64. 2013-12-09 Vladimir Serbinenko - * grub-core/kern/ia64/dl_helper.c (grub_ia64_dl_get_tramp_got_size): + * VasEBoot-core/kern/ia64/dl_helper.c (VasEBoot_ia64_dl_get_tramp_got_size): Do not explicitly check for symbol table as it's already checked in platform-independent layer. 2013-12-09 Colin Watson - * util/grub-mkconfig.in: Add missing newline to output. + * util/VasEBoot-mkconfig.in: Add missing newline to output. 2013-12-08 Vladimir Serbinenko - * grub-core/kern/ia64/efi/init.c (grub_arch_sync_caches): Move to ... - * grub-core/kern/ia64/cache.c (grub_arch_sync_caches): ... here. + * VasEBoot-core/kern/ia64/efi/init.c (VasEBoot_arch_sync_caches): Move to ... + * VasEBoot-core/kern/ia64/cache.c (VasEBoot_arch_sync_caches): ... here. 2013-12-08 Vladimir Serbinenko - * grub-core/kern/emu/main.c: Silence missing prototypes to allow emu + * VasEBoot-core/kern/emu/main.c: Silence missing prototypes to allow emu compilation with GCC <= 4.2. - * grub-core/kern/emu/argp_common.c: Likewise. + * VasEBoot-core/kern/emu/argp_common.c: Likewise. 2013-12-08 Vladimir Serbinenko - * include/grub/kernel.h [__sparc__]: Restrict sparc64-ieee1275 to + * include/VasEBoot/kernel.h [__sparc__]: Restrict sparc64-ieee1275 to right platform rather than leaking to sparc64-emu. 2013-12-08 Vladimir Serbinenko - * grub-core/osdep/windows/emuconsole.c: Remove unsigned comparison >= 0. + * VasEBoot-core/osdep/windows/emuconsole.c: Remove unsigned comparison >= 0. But ensure that the variables in question are indeed unsigned. 2013-12-08 Vladimir Serbinenko - * grub-core/kern/emu/lite.c: Add missing include of ../ia64/dl_helper.c. + * VasEBoot-core/kern/emu/lite.c: Add missing include of ../ia64/dl_helper.c. 2013-12-08 Vladimir Serbinenko - Remove grub_memalign on emu. + Remove VasEBoot_memalign on emu. 2013-12-08 Vladimir Serbinenko - * grub-core/kern/ia64/efi/init.c: Fix alignment code so it doesn't + * VasEBoot-core/kern/ia64/efi/init.c: Fix alignment code so it doesn't truncate incomplete lines but instead flushes them. 2013-12-08 Vladimir Serbinenko - Move OS-dependent mprotect for module loading to grub-core/osdep/*/dl.c + Move OS-dependent mprotect for module loading to VasEBoot-core/osdep/*/dl.c and implement windows variant. 2013-12-08 Vladimir Serbinenko @@ -1901,37 +1901,37 @@ 2013-12-07 Vladimir Serbinenko - * util/grub-mkfont.c: Replace stpcpy with grub_stpcpy. + * util/VasEBoot-mkfont.c: Replace stpcpy with VasEBoot_stpcpy. 2013-12-07 Andrey Borzenkov - * docs/grub.texi (Environment): Update color_normal and color_highlight + * docs/VasEBoot.texi (Environment): Update color_normal and color_highlight defaults (light-gray instead of white). 2013-12-07 Andrey Borzenkov - * grub-core/normal/main.c (INIT): Set default color to light-gray - to match GRUB_TERM_DEFAULT_NORMAL_COLOR (i.e. rescue mode), Linux + * VasEBoot-core/normal/main.c (INIT): Set default color to light-gray + to match VasEBoot_TERM_DEFAULT_NORMAL_COLOR (i.e. rescue mode), Linux and apparently BIOS defaults. 2013-12-07 Vladimir Serbinenko - Transform -C option to grub-mkstandalone to --core-compress available - in all grub-install flavours. + Transform -C option to VasEBoot-mkstandalone to --core-compress available + in all VasEBoot-install flavours. 2013-12-07 Vladimir Serbinenko - Merge GRUBFS and GRUB_FS variables. + Merge VasEBootFS and VasEBoot_FS variables. 2013-12-07 Andrey Borzenkov Revert commit 69ca97c820, it caused failures when using OS device name - in grub-install. Instead just strip off parenthesis in grub-install + in VasEBoot-install. Instead just strip off parenthesis in VasEBoot-install if (hdX) was passed. 2013-12-07 Andrey Borzenkov - * util/grub-install.c (push_partmap_module): Add helper to convert + * util/VasEBoot-install.c (push_partmap_module): Add helper to convert partmap names to module names and use it in probe_mods(). Fixes failure to find partmap modules in diskfilter case. @@ -1949,15 +1949,15 @@ 2013-12-07 Andrey Borzenkov - * util/misc.c (grub_qsort_strcmp): Add qsort helper function to sort + * util/misc.c (VasEBoot_qsort_strcmp): Add qsort helper function to sort strings. - * include/grub/util/misc.h: Define it ... - * util/grub-install.c (device_map_check_duplicates): ... and use it. + * include/VasEBoot/util/misc.h: Define it ... + * util/VasEBoot-install.c (device_map_check_duplicates): ... and use it. 2013-12-07 Andrey Borzenkov - * util/grub.d/30_os-prober.in: Fix use of grub-probe instead of - ${grub_probe}. + * util/VasEBoot.d/30_os-prober.in: Fix use of VasEBoot-probe instead of + ${VasEBoot_probe}. 2013-12-06 Vladimir Serbinenko @@ -1976,7 +1976,7 @@ 2013-12-05 Vladimir Serbinenko - * util/grub-mkimagexx.c: Fix reloc section generation for ia64. + * util/VasEBoot-mkimagexx.c: Fix reloc section generation for ia64. 2013-12-05 Mike Gilbert @@ -1985,12 +1985,12 @@ 2013-12-05 Vladimir Serbinenko - * util/grub-install.c: Mention Boot* variable. + * util/VasEBoot-install.c: Mention Boot* variable. 2013-12-05 Colin Watson - * grub-core/osdep/linux/hostdisk.c - (grub_util_find_partition_start_os): Initialise start to avoid + * VasEBoot-core/osdep/linux/hostdisk.c + (VasEBoot_util_find_partition_start_os): Initialise start to avoid spurious compiler warning. 2013-12-05 Colin Watson @@ -1999,15 +1999,15 @@ cope with block device drivers that don't implement HDIO_GETGEO. Fixes Ubuntu bug #1237519. - * grub-core/osdep/linux/hostdisk.c (sysfs_partition_path): New + * VasEBoot-core/osdep/linux/hostdisk.c (sysfs_partition_path): New function. (sysfs_partition_start): Likewise. - (grub_util_find_partition_start_os): Try sysfs_partition_start + (VasEBoot_util_find_partition_start_os): Try sysfs_partition_start before HDIO_GETGEO. 2013-12-05 Leif Lindholm - * grub-core/kern/fdt.c: Update struct size when adding node. + * VasEBoot-core/kern/fdt.c: Update struct size when adding node. 2013-12-05 Vladimir Serbinenko @@ -2019,7 +2019,7 @@ 2013-12-04 Vladimir Serbinenko - * grub-core/boot/sparc64/ieee1275/boot.S [CDBOOT]: Move scratchpad + * VasEBoot-core/boot/sparc64/ieee1275/boot.S [CDBOOT]: Move scratchpad so it doesn't land in the middle of loaded image. 2013-12-04 Vladimir Serbinenko @@ -2032,11 +2032,11 @@ 2013-12-04 Colin Watson - Copying the themes directory in grub-shell isn't + Copying the themes directory in VasEBoot-shell isn't parallel-test-friendly and breaks on the second test when the source directory is read-only (as in "make distcheck"). Instead, add a - hidden --themes-directory option to grub-mkrescue et al, and use it - in grub-shell. + hidden --themes-directory option to VasEBoot-mkrescue et al, and use it + in VasEBoot-shell. 2013-12-04 Vladimir Serbinenko @@ -2050,12 +2050,12 @@ 2013-12-04 Vladimir Serbinenko * configure.ac: Add -no-integrated-as if {addme|ame} isn't supported. - * INSTALL: Note that GRUBwas successfully compiled with clang 3.2 for + * INSTALL: Note that VasEBootwas successfully compiled with clang 3.2 for ppc. 2013-12-04 Vladimir Serbinenko - * grub-core/kern/emu/main.c: Ignore missing prototype for main. + * VasEBoot-core/kern/emu/main.c: Ignore missing prototype for main. 2013-12-04 Vladimir Serbinenko @@ -2069,17 +2069,17 @@ 2013-12-04 Vladimir Serbinenko - * grub-core/osdep/windows/emuconsole.c (grub_console_putchar): + * VasEBoot-core/osdep/windows/emuconsole.c (VasEBoot_console_putchar): Remove variable length arrays. - * grub-core/term/efi/console.c (grub_console_putchar): Likewise. + * VasEBoot-core/term/efi/console.c (VasEBoot_console_putchar): Likewise. 2013-12-04 Vladimir Serbinenko - * grub-core/kern/i386/qemu/init.c: Remove variable length arrays. + * VasEBoot-core/kern/i386/qemu/init.c: Remove variable length arrays. 2013-12-04 Vladimir Serbinenko - * include/grub/types.h: Declare all byteswaps as inline functions + * include/VasEBoot/types.h: Declare all byteswaps as inline functions except compile-time ones. Solves variable shadowing in constructions like @@ -2087,33 +2087,33 @@ 2013-12-04 Vladimir Serbinenko - * grub-core/kern/efi/efi.c: Remove variable length arrays. + * VasEBoot-core/kern/efi/efi.c: Remove variable length arrays. 2013-12-04 Vladimir Serbinenko - * grub-core/kern/uboot/init.c (uboot_timer_ms): Fix overflow after 71 + * VasEBoot-core/kern/uboot/init.c (uboot_timer_ms): Fix overflow after 71 minutes. 2013-12-04 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c: Remove variable length arrays. - * grub-core/net/drivers/ieee1275/ofnet.c: Likewise. + * VasEBoot-core/disk/ieee1275/ofdisk.c: Remove variable length arrays. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c: Likewise. 2013-12-03 Colin Watson - * grub-core/Makefile.core.def (setjmp): Distribute + * VasEBoot-core/Makefile.core.def (setjmp): Distribute lib/arm64/setjmp.S. 2013-12-03 Colin Watson Add a new timeout_style environment variable and a corresponding - GRUB_TIMEOUT_STYLE configuration key for grub-mkconfig. This + VasEBoot_TIMEOUT_STYLE configuration key for VasEBoot-mkconfig. This controls hidden-timeout handling more simply than the previous arrangements, and pressing any hotkeys associated with menu entries during the hidden timeout will now boot the corresponding menu entry immediately. - GRUB_HIDDEN_TIMEOUT= + GRUB_TIMEOUT= now + VasEBoot_HIDDEN_TIMEOUT= + VasEBoot_TIMEOUT= now generates a warning, and if it shows the menu it will do so as if the second timeout were not present. Other combinations are translated into reasonable equivalents. @@ -2127,8 +2127,8 @@ 2013-11-30 Andrey Borzenkov - * grub-core/kern/arm64/dl_helper.c: Include grub/arm64/reloc.h - directly, not via `cpu' link, to fix libgrub.pp generation. + * VasEBoot-core/kern/arm64/dl_helper.c: Include VasEBoot/arm64/reloc.h + directly, not via `cpu' link, to fix libVasEBoot.pp generation. 2013-11-30 Leif Lindholm @@ -2136,7 +2136,7 @@ 2013-11-30 Andrey Borzenkov - * docs/grub.texi (sleep): Document exit codes. + * docs/VasEBoot.texi (sleep): Document exit codes. 2013-11-30 Vladimir Serbinenko @@ -2144,59 +2144,59 @@ 2013-11-30 Vladimir Serbinenko - * grub-core/lib/libgcrypt/mpi/longlong.h: Fix compilation error with + * VasEBoot-core/lib/libgcrypt/mpi/longlong.h: Fix compilation error with -march=armv3. 2013-11-30 Vladimir Serbinenko - Remove leftover GRUB_IA64_DL_TRAMP_SIZE. + Remove leftover VasEBoot_IA64_DL_TRAMP_SIZE. 2013-11-29 Colin Watson - * docs/grub-dev.texi (Font Metrics): Exclude @image command from DVI + * docs/VasEBoot-dev.texi (Font Metrics): Exclude @image command from DVI builds, since we don't have an EPS version of font_char_metrics.png. Add leading dot to image extension per the Texinfo documentation. 2013-11-29 Colin Watson - * util/grub-gen-asciih.c: Include FT_SYNTHESIS_H rather than + * util/VasEBoot-gen-asciih.c: Include FT_SYNTHESIS_H rather than , fixing build with FreeType 2.5.1. - * util/grub-gen-widthspec.c: Likewise. - * util/grub-mkfont.c: Likewise. + * util/VasEBoot-gen-widthspec.c: Likewise. + * util/VasEBoot-mkfont.c: Likewise. 2013-11-29 Andrey Borzenkov - * util/grub-setup.c (main): Move parsing of (hdX) syntax to ... - * util/setup.c (SETUP): ... here. Fixes regression: grub-install + * util/VasEBoot-setup.c (main): Move parsing of (hdX) syntax to ... + * util/setup.c (SETUP): ... here. Fixes regression: VasEBoot-install failed to install on (hdX). - * util/grub-setup.c (get_device_name): Remove, not needed after + * util/VasEBoot-setup.c (get_device_name): Remove, not needed after above change. 2013-11-29 Vladimir Serbinenko - * grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays. + * VasEBoot-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays. 2013-11-29 Vladimir Serbinenko - * util/grub-fstest.c: Remove variable length arrays. + * util/VasEBoot-fstest.c: Remove variable length arrays. 2013-11-29 Vladimir Serbinenko - * grub-core/osdep/linux/ofpath.c: Check return value of read. + * VasEBoot-core/osdep/linux/ofpath.c: Check return value of read. 2013-11-29 Vladimir Serbinenko - * util/mkimage.c (grub_install_generate_image): Use grub_crypto_hash for + * util/mkimage.c (VasEBoot_install_generate_image): Use VasEBoot_crypto_hash for computing crc32 rather than handling with md fundtions directly. 2013-11-29 Vladimir Serbinenko - * util/mkimage.c (grub_install_generate_image): Use grub_crypto_hash for + * util/mkimage.c (VasEBoot_install_generate_image): Use VasEBoot_crypto_hash for checking fwstart.img rather than md fundtions directly. 2013-11-29 Vladimir Serbinenko - * util/grub-mkrescue.c (main): Check that fread succeeded. + * util/VasEBoot-mkrescue.c (main): Check that fread succeeded. 2013-11-29 Vladimir Serbinenko @@ -2211,7 +2211,7 @@ 2013-11-29 Vladimir Serbinenko - * grub-core/Makefile.core.def: Remove libgnulib.a and use its + * VasEBoot-core/Makefile.core.def: Remove libgnulib.a and use its sources in dependencies directly. This was the only instance of "library" in core config. A bug was @@ -2221,17 +2221,17 @@ 2013-11-29 Vladimir Serbinenko - * grub-core/osdep/unix/password.c (grub_password_get): Check that + * VasEBoot-core/osdep/unix/password.c (VasEBoot_password_get): Check that fgets succeeded. 2013-11-27 Francesco Lavra - * docs/grub.texi (ls): Fix command description in case of a device name + * docs/VasEBoot.texi (ls): Fix command description in case of a device name passed as argument. 2013-11-27 Vladimir Serbinenko - Eliminate variable length arrays in grub_vsnprintf_real. + Eliminate variable length arrays in VasEBoot_vsnprintf_real. A bit tricky because this function has to continue to work without heap for short strings. Fixing prealloc to 32 arguments is reasonable @@ -2241,7 +2241,7 @@ 2013-11-27 Vladimir Serbinenko - Introduce grub_util_file_sync and use it instead of fsync(fileno(f)). + Introduce VasEBoot_util_file_sync and use it instead of fsync(fileno(f)). Fixes build for windows. 2013-11-27 Vladimir Serbinenko @@ -2251,11 +2251,11 @@ 2013-11-27 Colin Watson - * grub-core/osdep/unix/exec.c (grub_util_exec_redirect): Remove + * VasEBoot-core/osdep/unix/exec.c (VasEBoot_util_exec_redirect): Remove references to mdadm from otherwise generic code. - (grub_util_exec_pipe): Likewise. - (grub_util_exec_pipe_stderr): Likewise. - * grub-core/osdep/unix/getroot.c (grub_util_pull_lvm_by_command): + (VasEBoot_util_exec_pipe): Likewise. + (VasEBoot_util_exec_pipe_stderr): Likewise. + * VasEBoot-core/osdep/unix/getroot.c (VasEBoot_util_pull_lvm_by_command): This function calls vgs, not mdadm; adjust variable names accordingly. @@ -2267,14 +2267,14 @@ 2013-11-27 Colin Watson - Add grub_util_disable_fd_syncs call to turn grub_util_fd_sync calls + Add VasEBoot_util_disable_fd_syncs call to turn VasEBoot_util_fd_sync calls into no-ops, and use it in programs that copy files but do not need - to take special care to sync writes (grub-mknetdir, grub-rescue, - grub-mkstandalone). + to take special care to sync writes (VasEBoot-mknetdir, VasEBoot-rescue, + VasEBoot-mkstandalone). 2013-11-26 Colin Watson - * tests/util/grub-fs-tester.in: Execute xorriso from $PATH rather + * tests/util/VasEBoot-fs-tester.in: Execute xorriso from $PATH rather than hardcoding /usr/local/bin/xorriso. 2013-11-26 Vladimir Serbinenko @@ -2284,51 +2284,51 @@ 2013-11-26 Vladimir Serbinenko - * grub-core/Makefile.am: Reduce gratuituous differences between Apple + * VasEBoot-core/Makefile.am: Reduce gratuituous differences between Apple and non-Apple variants of efiemu compile. 2013-11-25 Andrey Borzenkov * configure.ac: Add explicit check for linking format of efiemu64; save it as EFIEMU64_LINK_FORMAT. - * grub-core/Makefile.am: Use EFIEMU64_LINK_FORMAT instead of + * VasEBoot-core/Makefile.am: Use EFIEMU64_LINK_FORMAT instead of hardcoding linking format. 2013-11-25 Vladimir Serbinenko - * util/grub-mknetdir.c: Look for platform directories under pkglibdir + * util/VasEBoot-mknetdir.c: Look for platform directories under pkglibdir and not pkgdatadir. 2013-11-25 Colin Watson 2013-11-25 Vladimir Serbinenko - Add a --locale-directory option to grub-install and related tools. + Add a --locale-directory option to VasEBoot-install and related tools. - * include/grub/util/install.h (GRUB_INSTALL_OPTIONS): Add + * include/VasEBoot/util/install.h (VasEBoot_INSTALL_OPTIONS): Add --locale-directory option. - (enum grub_install_options): Add - GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY. - * util/grub-install-common.c (grub_install_help_filter): Handle - GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY. - (grub_install_parse): Likewise. + (enum VasEBoot_install_options): Add + VasEBoot_INSTALL_OPTIONS_LOCALE_DIRECTORY. + * util/VasEBoot-install-common.c (VasEBoot_install_help_filter): Handle + VasEBoot_INSTALL_OPTIONS_LOCALE_DIRECTORY. + (VasEBoot_install_parse): Likewise. (get_localedir): New function to check for a user-provided option - before trying grub_util_get_localedir. + before trying VasEBoot_util_get_localedir. (copy_locales): Use get_localedir rather than - grub_util_get_localedir. Handle differing locale directory layouts. - (grub_install_copy_files): Likewise. + VasEBoot_util_get_localedir. Handle differing locale directory layouts. + (VasEBoot_install_copy_files): Likewise. 2013-11-25 Vladimir Serbinenko - * grub-core/osdep/unix/platform.c (get_ofpathname): Trim ending newline. + * VasEBoot-core/osdep/unix/platform.c (get_ofpathname): Trim ending newline. Don't rely on PATH_MAX. 2013-11-25 Vladimir Serbinenko - * grub-core/genmoddep.awk: Use more portable && rather than and. + * VasEBoot-core/genmoddep.awk: Use more portable && rather than and. 2013-11-24 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S [__APPLE__]: Create _edata by placing + * VasEBoot-core/kern/i386/pc/startup.S [__APPLE__]: Create _edata by placing an object after data. While it doesn't seem right solution, it works well enough and OSX isn't main compilation platform. @@ -2362,38 +2362,38 @@ 2013-11-24 Vladimir Serbinenko - * grub-core/Makefile.am: Use correct TARGET_OBJCONV rather than + * VasEBoot-core/Makefile.am: Use correct TARGET_OBJCONV rather than OBJCONV. 2013-11-24 Vladimir Serbinenko - * grub-core/gdb/i386/machdep.S: Use xorl %eax, %eax on both Apple + * VasEBoot-core/gdb/i386/machdep.S: Use xorl %eax, %eax on both Apple and non-Apple. This instruction is shorter and faster, so no reason not to use it on both. 2013-11-24 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c: Use section _text, _text rather than + * VasEBoot-core/lib/reed_solomon.c: Use section _text, _text rather than .text when compiling for Apple. 2013-11-24 Vladimir Serbinenko - * grub-core/term/arc/console.c: Add missing cast to silence warning. + * VasEBoot-core/term/arc/console.c: Add missing cast to silence warning. 2013-11-24 Vladimir Serbinenko - * grub-core/boot/i386/pc/boot.S: Fix floppy probe. Due to missing + * VasEBoot-core/boot/i386/pc/boot.S: Fix floppy probe. Due to missing %dx restore the probe worked on non-existant drive. Reorganize the code a little bit to free 2 bytes necessary for push/pop. 2013-11-23 Vladimir Serbinenko - * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation): + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_machine_get_bootlocation): Add missing cast to silence warning. 2013-11-23 Keshav Padram Amburay - * util/grub-install.c (update_nvram): Support --no-nvram flag + * util/VasEBoot-install.c (update_nvram): Support --no-nvram flag for EFI targets. 2013-11-23 Vladimir Serbinenko @@ -2411,7 +2411,7 @@ 2013-11-23 Vladimir Serbinenko Move common BIOS/coreboot memory map declarations to - include/grub/i386/memory_raw.h and eliminate duplicate declarations. + include/VasEBoot/i386/memory_raw.h and eliminate duplicate declarations. 2013-11-22 Andrey Borzenkov @@ -2427,12 +2427,12 @@ 2013-11-22 Vladimir Serbinenko - * grub-core/lib/libgcrypt/mpi/longlong.h: Use C version with mips + * VasEBoot-core/lib/libgcrypt/mpi/longlong.h: Use C version with mips clang. 2013-11-22 Vladimir Serbinenko - Add *-xen to the list of grub-install-common platforms. + Add *-xen to the list of VasEBoot-install-common platforms. 2013-11-22 Vladimir Serbinenko @@ -2441,16 +2441,16 @@ 2013-11-22 Vladimir Serbinenko - * grub-core/kern/xen/init.c: Do not map more pages than we can address. + * VasEBoot-core/kern/xen/init.c: Do not map more pages than we can address. 2013-11-22 Vladimir Serbinenko - * grub-core/kern/efi/mm.c: Limit allocations to 2GiB when not compiling + * VasEBoot-core/kern/efi/mm.c: Limit allocations to 2GiB when not compiling with -mcmodel=large. 2013-11-22 Vladimir Serbinenko - * grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Add + * VasEBoot-core/kern/x86_64/dl.c (VasEBoot_arch_dl_relocate_symbols): Add range-checking for 32-bit quantities. 2013-11-22 Vladimir Serbinenko @@ -2470,24 +2470,24 @@ 2013-11-22 Vladimir Serbinenko - * docs/grub-dev.texi: Document stack and heap sizes. + * docs/VasEBoot-dev.texi: Document stack and heap sizes. 2013-11-22 Vladimir Serbinenko - * include/grub/i386/pc/memory.h: Decrease - GRUB_MEMORY_MACHINE_SCRATCH_SIZE and increase - GRUB_MEMORY_MACHINE_PROT_STACK_SIZE. + * include/VasEBoot/i386/pc/memory.h: Decrease + VasEBoot_MEMORY_MACHINE_SCRATCH_SIZE and increase + VasEBoot_MEMORY_MACHINE_PROT_STACK_SIZE. The binary doesn't change (checked). It's more to better reflect actual usage. 2013-11-22 Vladimir Serbinenko - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Ensure + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Ensure at compile time that enough of scratch size is available. 2013-11-22 Vladimir Serbinenko - * grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment. + * VasEBoot-core/kern/x86_64/efi/callwrap.S: Fix stack alignment. Previously we misaligned stack by 8 in startup.S and compensated for it in callwrap.S. According to ABI docs (EFI and sysv amd64) right behaviour is to align stack in startup.S and keep it aligned @@ -2497,7 +2497,7 @@ 2013-11-22 Vladimir Serbinenko - * grub-core/boot/mips/startup_raw.S: Handle the case of gap between + * VasEBoot-core/boot/mips/startup_raw.S: Handle the case of gap between .data and .bss. May happen if compiler and assembly use different alignment. @@ -2518,7 +2518,7 @@ 2013-11-22 Vladimir Serbinenko Remove -march=mips3 from TARGET_CCASFLAGS as it creates linking problem - when rest of GRUB is compiled for hisher stepping. Instead use + when rest of VasEBoot is compiled for hisher stepping. Instead use .set mips3/.set mips1 around cache and sync opcodes. 2013-11-21 Vladimir Serbinenko @@ -2528,23 +2528,23 @@ 2013-11-21 Colin Watson - * util/grub-mkrescue.c (main): If a source directory is not + * util/VasEBoot-mkrescue.c (main): If a source directory is not specified, read platform-specific files from subdirectories of pkglibdir, not pkgdatadir. 2013-11-21 Colin Watson - * grub-core/normal/progress.c: Remove unused file. + * VasEBoot-core/normal/progress.c: Remove unused file. 2013-11-20 Vladimir Serbinenko - * grub-core/lib/crypto.c (grub_crypto_hash): Remove variable length + * VasEBoot-core/lib/crypto.c (VasEBoot_crypto_hash): Remove variable length array. 2013-11-20 Vladimir Serbinenko - * util/grub-mkconfig.in: Say explicit "grub configuration" rather - than grub.cfg. + * util/VasEBoot-mkconfig.in: Say explicit "VasEBoot configuration" rather + than VasEBoot.cfg. 2013-11-20 Vladimir Serbinenko @@ -2556,17 +2556,17 @@ 2013-11-19 Axel Kellermann - * util/grub.d/30_os-prober.in: Add GRUB_OS_PROBER_SKIP_LIST to + * util/VasEBoot.d/30_os-prober.in: Add VasEBoot_OS_PROBER_SKIP_LIST to selectively skipping systems. 2013-11-19 Colin Watson - * Makefile.util.def (grub-mkimage): Add - grub-core/osdep/aros/config.c to extra_dist. + * Makefile.util.def (VasEBoot-mkimage): Add + VasEBoot-core/osdep/aros/config.c to extra_dist. * conf/Makefile.extra-dist (EXTRA_DIST): Add docs/autoiso.cfg, - docs/osdetect.cfg, grub-core/gnulib-fix-null-deref.diff, - grub-core/gnulib-fix-width.diff, grub-core/gnulib-no-abort.diff, and - grub-core/gnulib-no-gets.diff. + docs/osdetect.cfg, VasEBoot-core/gnulib-fix-null-deref.diff, + VasEBoot-core/gnulib-fix-width.diff, VasEBoot-core/gnulib-no-abort.diff, and + VasEBoot-core/gnulib-no-gets.diff. 2013-11-19 Vladimir Serbinenko @@ -2576,45 +2576,45 @@ 2013-11-19 Colin Watson - * util/grub-install.c (main): Adjust info messages to match - installed paths of grub-bios-setup and grub-sparc64-setup. + * util/VasEBoot-install.c (main): Adjust info messages to match + installed paths of VasEBoot-bios-setup and VasEBoot-sparc64-setup. 2013-11-19 Colin Watson - * util/grub-install-common.c (copy_locales): Consistently use - grub_util_get_localedir () rather than LOCALEDIR. - (grub_install_copy_files): Likewise. + * util/VasEBoot-install-common.c (copy_locales): Consistently use + VasEBoot_util_get_localedir () rather than LOCALEDIR. + (VasEBoot_install_copy_files): Likewise. 2013-11-19 Josh Triplett - * grub-core/kern/x86_64/efi/startup.S (_start): Align the stack to a + * VasEBoot-core/kern/x86_64/efi/startup.S (_start): Align the stack to a 16-byte boundary, as required by the x86-64 ABI, before calling - grub_main. In some cases, GCC emits code that assumes this + VasEBoot_main. In some cases, GCC emits code that assumes this alignment, which crashes if not aligned. The EFI firmware is also entitled to assume that stack alignment without checking. 2013-11-18 Josh Triplett - * grub-core/mmap/efi/mmap.c (grub_mmap_register): Round up/down to + * VasEBoot-core/mmap/efi/mmap.c (VasEBoot_mmap_register): Round up/down to 4k page boundaries as expected by firmware rather than 1k boundaries. - (grub_mmap_malign_and_register): Likewise. + (VasEBoot_mmap_malign_and_register): Likewise. 2013-11-18 Vladimir Serbinenko - * tests/grub_func_test.in: Decrease RAM size to 512M. With less + * tests/VasEBoot_func_test.in: Decrease RAM size to 512M. With less fragmentation 512M is enough. 2013-11-18 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off of moving the + * VasEBoot-core/kern/mm.c (VasEBoot_real_malloc): Decrease cut-off of moving the pointer to 32K. This is the size of cache element which is the most common allocation >1K. This way the pointer is always around blocks of 32K and so we keep performance while decreasing fragmentation. 2013-11-18 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_real_malloc): Don't update the pointer to + * VasEBoot-core/kern/mm.c (VasEBoot_real_malloc): Don't update the pointer to current memory when allocating large chunks. This significantly decreases memory fragmentation. @@ -2627,73 +2627,73 @@ 2013-11-18 Colin Watson - * util/grub-mkrescue.c (main): Fix typo. + * util/VasEBoot-mkrescue.c (main): Fix typo. 2013-11-18 Vladimir Serbinenko - * grub-core/kern/mips/qemu_mips/init.c (grub_machine_init): Update + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_machine_init): Update clock frequency to 200 MHz, 2013-11-18 Vladimir Serbinenko - * tests/util/grub-shell.in: Increase console size to 1024x1024. + * tests/util/VasEBoot-shell.in: Increase console size to 1024x1024. 2013-11-18 Vladimir Serbinenko * Makefile.am (default_payload.elf): Add pata to loaded modules. - Load config file from (cbfsdisk)/etc/grub.cfg. + Load config file from (cbfsdisk)/etc/VasEBoot.cfg. 2013-11-18 Vladimir Serbinenko - * util/grub-install-common.c (grub_install_copy_files): Fix module + * util/VasEBoot-install-common.c (VasEBoot_install_copy_files): Fix module destination directory. 2013-11-18 Colin Watson - * tests/util/grub-shell.in: Don't fail on emu platform if po/*.gmo + * tests/util/VasEBoot-shell.in: Don't fail on emu platform if po/*.gmo files have not been built. 2013-11-18 Colin Watson - * grub-core/osdep/unix/hostdisk.c (grub_util_make_temporary_file): + * VasEBoot-core/osdep/unix/hostdisk.c (VasEBoot_util_make_temporary_file): Handle errors from mkstemp. - (grub_util_make_temporary_dir): Handle errors from mkdtemp. + (VasEBoot_util_make_temporary_dir): Handle errors from mkdtemp. 2013-11-18 Vladimir Serbinenko - * tests/util/grub-shell.in: Use -cdrom and don't force cdrom + * tests/util/VasEBoot-shell.in: Use -cdrom and don't force cdrom on primary master on pseries. 2013-11-18 Vladimir Serbinenko - * grub-core/tests/videotest_checksum.c: Don't reload unifont if it's + * VasEBoot-core/tests/videotest_checksum.c: Don't reload unifont if it's already loaded. This saves memory needed for tests, 2013-11-18 Vladimir Serbinenko - * util/grub-mkrescue.c (main): Fix a typo to make yeeloong part + * util/VasEBoot-mkrescue.c (main): Fix a typo to make yeeloong part work again. 2013-11-18 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_cmd_terminfo): Fix a typo to make -g + * VasEBoot-core/term/terminfo.c (VasEBoot_cmd_terminfo): Fix a typo to make -g work again. 2013-11-18 Vladimir Serbinenko - * tests/util/grub-shell.in: For powerpc tests put the CD-ROM as primary + * tests/util/VasEBoot-shell.in: For powerpc tests put the CD-ROM as primary master since with some combinations of qemu and firmware only primary IDE channel is available. 2013-11-18 Vladimir Serbinenko - * grub-core/tests/gfxterm_menu.c: Skip high-resolution tests on + * VasEBoot-core/tests/gfxterm_menu.c: Skip high-resolution tests on low-memory platforms where we don't have enough memory for them. - * grub-core/tests/videotest_checksum.c: Likewise. + * VasEBoot-core/tests/videotest_checksum.c: Likewise. 2013-11-18 Vladimir Serbinenko - * grub-core/tests/cmdline_cat_test.c: Don't reload unifont if it's + * VasEBoot-core/tests/cmdline_cat_test.c: Don't reload unifont if it's already loaded. This saves memory needed for tests, 2013-11-18 Vladimir Serbinenko @@ -2702,7 +2702,7 @@ 2013-11-18 Vladimir Serbinenko - * grub-core/lib/sparc64/setjmp.S: Force spilling of current window. + * VasEBoot-core/lib/sparc64/setjmp.S: Force spilling of current window. 2013-11-18 Vladimir Serbinenko @@ -2711,126 +2711,126 @@ 2013-11-18 Vladimir Serbinenko - * grub-core/lib/relocator.c (grub_mm_check_real): Accept const char * + * VasEBoot-core/lib/relocator.c (VasEBoot_mm_check_real): Accept const char * as file argument. 2013-11-18 Vladimir Serbinenko - * grub-core/normal/cmdline.c (grub_cmdline_get): Plug memory leak. + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Plug memory leak. 2013-11-18 Vladimir Serbinenko - * grub-core/kern/file.c (grub_file_open): Free file->name on failure. - (grub_file_close): Free file->name. + * VasEBoot-core/kern/file.c (VasEBoot_file_open): Free file->name on failure. + (VasEBoot_file_close): Free file->name. 2013-11-18 Vladimir Serbinenko - * grub-core/commands/verify.c (free_pk): Plug memory leak. - (grub_load_public_key): Likewise. - (grub_verify_signature_real): Likewise. - (grub_cmd_verify_signature): Likewise. + * VasEBoot-core/commands/verify.c (free_pk): Plug memory leak. + (VasEBoot_load_public_key): Likewise. + (VasEBoot_verify_signature_real): Likewise. + (VasEBoot_cmd_verify_signature): Likewise. 2013-11-18 Vladimir Serbinenko - * grub-core/commands/legacycfg.c (grub_legacy_check_md5_password): Plug + * VasEBoot-core/commands/legacycfg.c (VasEBoot_legacy_check_md5_password): Plug memory leak. 2013-11-18 Vladimir Serbinenko - * grub-core/lib/powerpc/setjmp.S (grub_setjmp): Save r31. - (grub_longjmp): Restore r31. - * include/grub/powerpc/setjmp.h (grub_jmp_buf): Reserve space for r31. + * VasEBoot-core/lib/powerpc/setjmp.S (VasEBoot_setjmp): Save r31. + (VasEBoot_longjmp): Restore r31. + * include/VasEBoot/powerpc/setjmp.h (VasEBoot_jmp_buf): Reserve space for r31. 2013-11-18 Vladimir Serbinenko - * util/grub-mkrescue.c (make_image_fwdisk_abs): Insert all partmap + * util/VasEBoot-mkrescue.c (make_image_fwdisk_abs): Insert all partmap modules to be in line with make_image_abs. 2013-11-18 Vladimir Serbinenko - * include/grub/mips/setjmp.h (grub_jmp_buf): Fix buffer size. + * include/VasEBoot/mips/setjmp.h (VasEBoot_jmp_buf): Fix buffer size. setjmp.S uses 12 entries but buffer is declared with only 11 entries. 2013-11-17 Ian Campbell - * grub-core/disk/uboot/ubootdisk.c: Include SCSI disks. + * VasEBoot-core/disk/uboot/ubootdisk.c: Include SCSI disks. 2013-11-17 Vladimir Serbinenko - * tests/grub_func_test.in: Increase memory reservation as on EFI we need + * tests/VasEBoot_func_test.in: Increase memory reservation as on EFI we need to leave some memory to firmware. 2013-11-17 Vladimir Serbinenko - * grub-core/tests/cmdline_cat_test.c (cmdline_cat_test): Ignore errors + * VasEBoot-core/tests/cmdline_cat_test.c (cmdline_cat_test): Ignore errors of loading gfxterm as gfxterm is embed in kernel on some platforms. - * grub-core/tests/gfxterm_menu.c (gfxterm_menu): Likewise. + * VasEBoot-core/tests/gfxterm_menu.c (gfxterm_menu): Likewise. Load gfxmenu. 2013-11-17 Vladimir Serbinenko - * tests/core_compress_test.in: Use full arguments as grub-mkimage-extra + * tests/core_compress_test.in: Use full arguments as VasEBoot-mkimage-extra now needs full arguments. 2013-11-17 Vladimir Serbinenko - * util/grub-mkrescue.c (main): Add trailing \n in + * util/VasEBoot-mkrescue.c (main): Add trailing \n in .disk_label.contentDetails to be in line with previous shell script. 2013-11-17 Vladimir Serbinenko - * util/grub-mkrescue.c (main): Use right source file for bootinfo.txt. + * util/VasEBoot-mkrescue.c (main): Use right source file for bootinfo.txt. 2013-11-17 Vladimir Serbinenko - * util/grub-install-common.c (grub_install_parse): Recognize + * util/VasEBoot-install-common.c (VasEBoot_install_parse): Recognize --compress=none like shell script did. 2013-11-17 Vladimir Serbinenko - * include/grub/misc.h: Replace check for __sparc64__ with one for + * include/VasEBoot/misc.h: Replace check for __sparc64__ with one for __sparc__ as __sparc64__ isn't actually defined. 2013-11-17 Vladimir Serbinenko - * tests/util/grub-shell.in: Use escc-ch-b on powerpc. This is missing + * tests/util/VasEBoot-shell.in: Use escc-ch-b on powerpc. This is missing counterpart of fixing the naming of escc ports. 2013-11-17 Vladimir Serbinenko - * util/grub-install-common.c (platforms): Fix the order of entries and + * util/VasEBoot-install-common.c (platforms): Fix the order of entries and remove useless field val. 2013-11-16 Vladimir Serbinenko - * util/grub-install.c: Add new option --no-bootsector to skip - installing of bootsector. Accept --grub-setup=/bin/true as + * util/VasEBoot-install.c: Add new option --no-bootsector to skip + installing of bootsector. Accept --VasEBoot-setup=/bin/true as backwards-compatible synonym. 2013-11-16 Andrey Borzenkov - * util/grub-install.c (device_map_check_duplicates): Fix incorrect + * util/VasEBoot-install.c (device_map_check_duplicates): Fix incorrect order of qsort arguments (number of elements vs. element size). 2013-11-16 Vladimir Serbinenko - Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir + Rewrite VasEBoot-install, VasEBoot-mkrescue, VasEBoot-mkstandalone and VasEBoot-mknetdir the function of these files exceeds what can be sanely handled in shell in posix-comaptible way. Also writing it in C extends the functionality to non-UNIX-like OS and minimal environments. 2013-11-16 Vladimir Serbinenko - * grub-core/kern/arm/cache.S: Don't switch back to ARM mode when + * VasEBoot-core/kern/arm/cache.S: Don't switch back to ARM mode when compiling to thumb2. - * grub-core/kern/arm/cache_armv7.S: Likewise. - * grub-core/lib/arm/setjmp.S: Likewise. + * VasEBoot-core/kern/arm/cache_armv7.S: Likewise. + * VasEBoot-core/lib/arm/setjmp.S: Likewise. 2013-11-16 Leif Lindholm - * grub-core/kern/arm/uboot/startup.S: delete superflouous save of r8 - in grub_uboot_syscall + * VasEBoot-core/kern/arm/uboot/startup.S: delete superflouous save of r8 + in VasEBoot_uboot_syscall 2013-11-16 Vladimir Serbinenko @@ -2838,7 +2838,7 @@ We have only 92K of stack and using over 4K per frame is wasteful - * grub-core/script/yylex.l (yyalloc), (yyfree), (yyrealloc): Declare + * VasEBoot-core/script/yylex.l (yyalloc), (yyfree), (yyrealloc): Declare as macros so that compiler would remove useless structure on stack. Better solution would be to fix flex not to put this structure on the stack but flex is external program. @@ -2849,9 +2849,9 @@ We have only 92K of stack and using over 4K per frame is wasteful - * grub-core/commands/verify.c (grub_load_public_key): Allocate on heap + * VasEBoot-core/commands/verify.c (VasEBoot_load_public_key): Allocate on heap rather than stack. - (grub_verify_signature_real): Likewise. + (VasEBoot_verify_signature_real): Likewise. 2013-11-16 Vladimir Serbinenko @@ -2859,7 +2859,7 @@ We have only 92K of stack and using over 4K per frame is wasteful - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Allocate on heap + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Allocate on heap rather than stack. 2013-11-16 Vladimir Serbinenko @@ -2868,7 +2868,7 @@ We have only 92K of stack and using over 4K per frame is wasteful - * grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Allocate on heap + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_lzo_decompress): Allocate on heap rather than stack. 2013-11-16 Vladimir Serbinenko @@ -2877,13 +2877,13 @@ We have only 92K of stack and using over 4K per frame is wasteful - * grub-core/fs/jfs.c (getblk): Allocate on heap rather than on + * VasEBoot-core/fs/jfs.c (getblk): Allocate on heap rather than on stack. Note: this function is recursive. - (grub_jfs_read_inode): Read only part we care about. + (VasEBoot_jfs_read_inode): Read only part we care about. 2013-11-16 Leif Lindholm - * grub-core/kern/arm/uboot/startup.S: fix grub_uboot_syscall va_arg + * VasEBoot-core/kern/arm/uboot/startup.S: fix VasEBoot_uboot_syscall va_arg handling 2013-11-16 Andrey Borzenkov @@ -2892,20 +2892,20 @@ 2013-11-16 Andrey Borzenkov - * docs/grub.texi (Environment): Document cmdpath. + * docs/VasEBoot.texi (Environment): Document cmdpath. 2013-11-16 Andrey Borzenkov - * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation): + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_machine_get_bootlocation): Remove "unused" attribute from arguments, they are used. 2013-11-15 Colin Watson - * .gitignore: Only ignore grub-mk* at the top level. + * .gitignore: Only ignore VasEBoot-mk* at the top level. 2013-11-15 Colin Watson - * util/grub-reboot.in (usage): Fix a typo. + * util/VasEBoot-reboot.in (usage): Fix a typo. 2013-11-15 Vladimir Serbinenko @@ -2922,21 +2922,21 @@ 2013-11-14 Vladimir Serbinenko - * grub-core/disk/xen/xendisk.c (grub_xendisk_fini): Set state to + * VasEBoot-core/disk/xen/xendisk.c (VasEBoot_xendisk_fini): Set state to "1" prior to handoff. Reported by: M A Young. 2013-11-14 Vladimir Serbinenko - * grub-core/kern/xen/init.c (grub_xenstore_write_file): Don't add + * VasEBoot-core/kern/xen/init.c (VasEBoot_xenstore_write_file): Don't add \0 to all files. Reported by: M A Young. 2013-11-14 Vladimir Serbinenko - * grub-core/osdep/bsd/hostdisk.c (grub_util_get_fd_size_os): Fix + * VasEBoot-core/osdep/bsd/hostdisk.c (VasEBoot_util_get_fd_size_os): Fix compilation on NetBSD. 2013-11-14 Vladimir Serbinenko @@ -2948,15 +2948,15 @@ 2013-11-15 Andrey Borzenkov - * grub-core/Makefile.core.def (signature_test): Add missing + * VasEBoot-core/Makefile.core.def (signature_test): Add missing tests/signatures.h. 2013-11-14 Colin Watson - * util/grub-install_header: Set localedir here, since this file is + * util/VasEBoot-install_header: Set localedir here, since this file is where it's used. - * util/grub-install.in: Remove setting of localedir. - * util/grub-mkrescue.in: Likewise. + * util/VasEBoot-install.in: Remove setting of localedir. + * util/VasEBoot-mkrescue.in: Likewise. 2013-11-14 Vladimir Serbinenko @@ -2965,28 +2965,28 @@ 2013-11-14 Vladimir Serbinenko * configure.ac: Move nm checks to the end. - Call grub_PROG_NM_WORKS. - * acinclude.m4: New check grub_PROG_NM_WORKS. + Call VasEBoot_PROG_NM_WORKS. + * acinclude.m4: New check VasEBoot_PROG_NM_WORKS. Use $TARGET_CFLAGS -c when compiling test binary. 2013-11-14 Colin Watson - * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__GNU__]: Remove + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__GNU__]: Remove unused variables. 2013-11-14 Matthew Garrett - * grub-core/kern/main.c (grub_set_prefix_and_root): Set variable + * VasEBoot-core/kern/main.c (VasEBoot_set_prefix_and_root): Set variable cmdpath to firmware directory. 2013-11-14 Vladimir Serbinenko - * grub-core/kern/efi/efi.c (grub_efi_get_filename): Reset the pointer + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_get_filename): Reset the pointer at the start of second iteration. 2013-11-14 Vladimir Serbinenko - * grub-core/Makefile.am (efiemu64.o): Explicitly set link format. + * VasEBoot-core/Makefile.am (efiemu64.o): Explicitly set link format. 2013-11-14 Vladimir Serbinenko @@ -2995,9 +2995,9 @@ 2013-11-14 Vladimir Serbinenko - * grub-core/kern/arm/cache_armv6.S: Remove special handling for + * VasEBoot-core/kern/arm/cache_armv6.S: Remove special handling for clang (not necessarry with -no-integrated-as). - * include/grub/symbol.h [__arm__]: Likewise. + * include/VasEBoot/symbol.h [__arm__]: Likewise. 2013-11-14 Vladimir Serbinenko @@ -3011,7 +3011,7 @@ 2013-11-14 Colin Watson - * grub-core/fs/ext2.c (grub_ext2_read_block): Factor out common + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_read_block): Factor out common code for indirect block handling. Saves 185 bytes on compressed image. @@ -3020,18 +3020,18 @@ Fix make clean. - * Makefile.am: Remove build-grub-* in make clean. + * Makefile.am: Remove build-VasEBoot-* in make clean. 2013-11-13 Paulo Flabiano Smorigo New files to gitignore. - * .gitignore: Add build-grub-gen-asciih, build-grub-gen-widthspec, - build-grub-mkfont, and grub-emu-lite. Remove .bzrignore. + * .gitignore: Add build-VasEBoot-gen-asciih, build-VasEBoot-gen-widthspec, + build-VasEBoot-mkfont, and VasEBoot-emu-lite. Remove .bzrignore. 2013-11-13 Leif Lindholm - * grub-core/kern/arm/misc.S: Make thumb2-compatible. + * VasEBoot-core/kern/arm/misc.S: Make thumb2-compatible. 2013-11-13 Leif Lindholm @@ -3044,18 +3044,18 @@ 2013-11-13 Colin Watson - * grub-core/kern/misc.c: Don't redirect divisions in the - GRUB_UTIL case. - * include/grub/misc.h: Likewise. + * VasEBoot-core/kern/misc.c: Don't redirect divisions in the + VasEBoot_UTIL case. + * include/VasEBoot/misc.h: Likewise. 2013-11-13 Colin Watson - * grub-core/osdep/unix/emuconsole.c (put): Pacify the compiler on + * VasEBoot-core/osdep/unix/emuconsole.c (put): Pacify the compiler on systems that require checking the return value of write. 2013-11-13 Colin Watson - * util/grub-install.in (efi_quiet): Fix inverted logic: make + * util/VasEBoot-install.in (efi_quiet): Fix inverted logic: make efibootmgr quiet when --debug is not used, rather than when it is. 2013-11-13 Colin Watson @@ -3066,88 +3066,88 @@ 2013-11-13 Colin Watson - * acinclude.m4 (grub_apple_cc): Remove; since the removal of nested + * acinclude.m4 (VasEBoot_apple_cc): Remove; since the removal of nested functions, we only need to check this for the target, not the host. - * configure.ac (grub_apple_cc): Likewise. + * configure.ac (VasEBoot_apple_cc): Likewise. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/arm/cache.c (probe_caches): Move asm part to ... - * grub-core/kern/arm/cache_armv6.S: ... here. This allows this + * VasEBoot-core/kern/arm/cache.c (probe_caches): Move asm part to ... + * VasEBoot-core/kern/arm/cache_armv6.S: ... here. This allows this asm to stay in arm even if surrounding is thumb. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/arm/misc.S: Add __muldi3 and __aeabi_lmul. Those + * VasEBoot-core/kern/arm/misc.S: Add __muldi3 and __aeabi_lmul. Those helper functions are needed for thumb. 2013-11-13 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Make + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_make_raid): Make level / 3 division explicitly unsigned. Saves few bytes. 2013-11-13 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (ZAP_LEAF_NUMCHUNKS): Use unsigned arithmetics. + * VasEBoot-core/fs/zfs/zfs.c (ZAP_LEAF_NUMCHUNKS): Use unsigned arithmetics. 2013-11-13 Vladimir Serbinenko - * grub-core/normal/datetime.c (grub_get_weekday): Use if rather than + * VasEBoot-core/normal/datetime.c (VasEBoot_get_weekday): Use if rather than division. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/uboot/init.c: Move grub_uboot_machine_type and - grub_uboot_boot_data to asm part. + * VasEBoot-core/kern/uboot/init.c: Move VasEBoot_uboot_machine_type and + VasEBoot_uboot_boot_data to asm part. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/arm/uboot/startup.S: Remove = by replacing with + * VasEBoot-core/kern/arm/uboot/startup.S: Remove = by replacing with literal load. - (grub_uboot_syscall): Save/restore r9 and align stack. + (VasEBoot_uboot_syscall): Save/restore r9 and align stack. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/arm/cache.S: Replace = with explicit litteral load. + * VasEBoot-core/kern/arm/cache.S: Replace = with explicit litteral load. 2013-11-13 Vladimir Serbinenko - * include/grub/symbol.h (END) [__arm__]: New macros. Replace all .end + * include/VasEBoot/symbol.h (END) [__arm__]: New macros. Replace all .end occurencies with END. 2013-11-13 Colin Watson - * util/grub-editenv.c (help_filter, argp): Document how to delete + * util/VasEBoot-editenv.c (help_filter, argp): Document how to delete the whole environment block. Reported by Dan Jacobson. Fixes Debian bug #726265. 2013-11-13 Colin Watson - * docs/grub.texi (Internationalisation, Supported kernels): Fix + * docs/VasEBoot.texi (Internationalisation, Supported kernels): Fix sectioning. 2013-11-13 Josh Triplett - * grub-core/normal/term.c (grub_set_more): Use bool logic rather than + * VasEBoot-core/normal/term.c (VasEBoot_set_more): Use bool logic rather than increment/decrement. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/arm/cache_armv6.S [__clang__]: Don't add .armv6 when + * VasEBoot-core/kern/arm/cache_armv6.S [__clang__]: Don't add .armv6 when compiling with clang. 2013-11-13 Vladimir Serbinenko - * grub-core/kern/arm/uboot/startup.S: Use .org rather than assigning + * VasEBoot-core/kern/arm/uboot/startup.S: Use .org rather than assigning ".". 2013-11-13 Vladimir Serbinenko - Redirect all divisions to grub_divmod64. + Redirect all divisions to VasEBoot_divmod64. 2013-11-12 Vladimir Serbinenko - * grub-core/term/tparm.c (tparam_internal): Use unsigned divisions. + * VasEBoot-core/term/tparm.c (tparam_internal): Use unsigned divisions. 2013-11-12 Vladimir Serbinenko @@ -3159,169 +3159,169 @@ 2013-11-12 Lukas Schwaighofer - * util/grub.d/20_linux_xen.in: Don't decompress initrd. + * util/VasEBoot.d/20_linux_xen.in: Don't decompress initrd. 2013-11-12 Vladimir Serbinenko - * grub-core/term/at_keyboard.c: Don't poll non-functional AT controller + * VasEBoot-core/term/at_keyboard.c: Don't poll non-functional AT controller until it becomes operational. 2013-11-12 Vladimir Serbinenko - * grub-core/Makefile.core.def (legacy_password_test): Disable + * VasEBoot-core/Makefile.core.def (legacy_password_test): Disable on platforms where no legacycfg is compiled. - * grub-core/tests/lib/functional_test.c: Tolerate failure to + * VasEBoot-core/tests/lib/functional_test.c: Tolerate failure to load legacy_password_test. 2013-11-12 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c: Remove variable length arrays. + * VasEBoot-core/loader/i386/bsd.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/efiemu/prepare.c: Remove variable length arrays. + * VasEBoot-core/efiemu/prepare.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/osdep/windows/hostdisk.c (grub_util_fd_strerror): Silence + * VasEBoot-core/osdep/windows/hostdisk.c (VasEBoot_util_fd_strerror): Silence strict-aliasing warning. (fsync): Silence cast warning. 2013-11-12 Vladimir Serbinenko - * grub-core/commands/verify.c: Remove variable length arrays. + * VasEBoot-core/commands/verify.c: Remove variable length arrays. Load gcry_dsa/gcry_rsa automatically. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/signature_test.c: New test. + * VasEBoot-core/tests/signature_test.c: New test. 2013-11-12 Vladimir Serbinenko - * grub-core/disk/cryptodisk.c (luks_script_get): Adapt to new procfs + * VasEBoot-core/disk/cryptodisk.c (luks_script_get): Adapt to new procfs API. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/legacy_password_test.c (vectors): Make static. - * grub-core/tests/pbkdf2_test.c (vectors): Likewise. + * VasEBoot-core/tests/legacy_password_test.c (vectors): Make static. + * VasEBoot-core/tests/pbkdf2_test.c (vectors): Likewise. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/setjmp_test.c: Reset counter to 0 before starting. + * VasEBoot-core/tests/setjmp_test.c: Reset counter to 0 before starting. 2013-11-12 Vladimir Serbinenko - * grub-core/fs/proc.c: Allow \0 in proc files. + * VasEBoot-core/fs/proc.c: Allow \0 in proc files. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/xnu_uuid_test.c: Fix assert message. + * VasEBoot-core/tests/xnu_uuid_test.c: Fix assert message. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/xnu_uuid_test.c: Fix copyright year. + * VasEBoot-core/tests/xnu_uuid_test.c: Fix copyright year. 2013-11-12 Vladimir Serbinenko - * grub-core/fs/ext2.c: Remove variable length arrays. + * VasEBoot-core/fs/ext2.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/lib/crypto.c (grub_crypto_cbc_decrypt): Remove variable + * VasEBoot-core/lib/crypto.c (VasEBoot_crypto_cbc_decrypt): Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/disk/AFSplitter.c: Remove variable length arrays. - * grub-core/disk/cryptodisk.c: Likewise. - * grub-core/disk/geli.c: Likewise. - * grub-core/disk/luks.c: Likewise. + * VasEBoot-core/disk/AFSplitter.c: Remove variable length arrays. + * VasEBoot-core/disk/cryptodisk.c: Likewise. + * VasEBoot-core/disk/geli.c: Likewise. + * VasEBoot-core/disk/luks.c: Likewise. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/legacy_password_test.c: New test. - * grub-core/commands/legacycfg.c: Remove variable length arrays. + * VasEBoot-core/tests/legacy_password_test.c: New test. + * VasEBoot-core/commands/legacycfg.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/lib/pbkdf2.c: Remove variable length arrays. + * VasEBoot-core/lib/pbkdf2.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/pbkdf2_test.c: New test. + * VasEBoot-core/tests/pbkdf2_test.c: New test. 2013-11-12 Vladimir Serbinenko - * grub-core/lib/xzembed/xz_dec_stream.c: Remove variable length arrays. + * VasEBoot-core/lib/xzembed/xz_dec_stream.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/io/lzopio.c: Remove variable length arrays. + * VasEBoot-core/io/lzopio.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * include/grub/crypto.h: Add maximums on hash size and cipher block + * include/VasEBoot/crypto.h: Add maximums on hash size and cipher block size. 2013-11-12 Vladimir Serbinenko - * grub-core/commands/xnu_uuid.c: Remove variable length arrays. + * VasEBoot-core/commands/xnu_uuid.c: Remove variable length arrays. 2013-11-12 Vladimir Serbinenko - * grub-core/tests/xnu_uuid_test.c: New test. + * VasEBoot-core/tests/xnu_uuid_test.c: New test. 2013-11-12 Vladimir Serbinenko - * grub-core/commands/hashsum.c: Remove unneeded memset (zalloc already + * VasEBoot-core/commands/hashsum.c: Remove unneeded memset (zalloc already covers it). 2013-11-12 Vladimir Serbinenko - * grub-core/commands/hashsum.c: Remove variable length arrays. + * VasEBoot-core/commands/hashsum.c: Remove variable length arrays. 2013-11-11 Vladimir Serbinenko - * grub-core/tests/gfxterm_menu.c (gfxterm_menu): Handle out-of-memory + * VasEBoot-core/tests/gfxterm_menu.c (gfxterm_menu): Handle out-of-memory condition. - * tests/grub_func_test.in: Increase memory allocation. + * tests/VasEBoot_func_test.in: Increase memory allocation. 2013-11-11 Vladimir Serbinenko - * grub-core/osdep/unix/getroot.c [HAVE_STRUCT_STATFS_F_FSTYPENAME + * VasEBoot-core/osdep/unix/getroot.c [HAVE_STRUCT_STATFS_F_FSTYPENAME && HAVE_STRUCT_STATFS_F_MNTFROMNAME]: Include sys/param.h and sys/mount.h. 2013-11-11 Vladimir Serbinenko - * grub-core/osdep/apple/hostdisk.c (grub_util_get_fd_size): Rename to .. - (grub_util_get_fd_size_os): ...this. - (grub_hostdisk_flush_initial_buffer): New empty function. + * VasEBoot-core/osdep/apple/hostdisk.c (VasEBoot_util_get_fd_size): Rename to .. + (VasEBoot_util_get_fd_size_os): ...this. + (VasEBoot_hostdisk_flush_initial_buffer): New empty function. 2013-11-11 Vladimir Serbinenko - * grub-core/gensyminfo.sh.in: Handle the case of portable output + * VasEBoot-core/gensyminfo.sh.in: Handle the case of portable output without --defined-only. 2013-11-11 Vladimir Serbinenko - * grub-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use + * VasEBoot-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use rip-relative addressing in prologue. 2013-11-11 Vladimir Serbinenko - * include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64. - * grub-core/kern/misc.c (__bzero) [__APPLE__]: New function. + * include/VasEBoot/misc.h [__APPLE__]: Do not add regparm(0) on x86_64. + * VasEBoot-core/kern/misc.c (__bzero) [__APPLE__]: New function. 2013-11-11 Vladimir Serbinenko - * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__APPLE__]: + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__APPLE__]: Add missing semicolon. 2013-11-11 Vladimir Serbinenko - * util/grub-macho2img.c: Use plain fopen rather than grub_util_fopen. + * util/VasEBoot-macho2img.c: Use plain fopen rather than VasEBoot_util_fopen. 2013-11-11 Vladimir Serbinenko @@ -3334,48 +3334,48 @@ 2013-11-11 Fam Zheng - * util/grub.d/30_os-prober.in: Add minix entry. + * util/VasEBoot.d/30_os-prober.in: Add minix entry. 2013-11-10 Vladimir Serbinenko - * grub-core/loader/i386/coreboot/chainloader.c (load_segment): Use + * VasEBoot-core/loader/i386/coreboot/chainloader.c (load_segment): Use right buffer for temporary load. 2013-11-10 Vladimir Serbinenko - * grub-core/loader/i386/coreboot/chainloader.c: Support tianocore. + * VasEBoot-core/loader/i386/coreboot/chainloader.c: Support tianocore. 2013-11-10 Vladimir Serbinenko - * grub-core/loader/i386/coreboot/chainloader.c: Support lzma-compressed + * VasEBoot-core/loader/i386/coreboot/chainloader.c: Support lzma-compressed payload. 2013-11-10 Vladimir Serbinenko - * include/grub/lib/LzmaDec.h: Fix to include LzmaTypes.h and + * include/VasEBoot/lib/LzmaDec.h: Fix to include LzmaTypes.h and not Types.h. - * grub-core/lib/LzmaDec.c: Fix prologue to make it compileable in GRUB + * VasEBoot-core/lib/LzmaDec.c: Fix prologue to make it compileable in VasEBoot environment. (LzmaDec_InitDicAndState): Make static. 2013-11-10 Vladimir Serbinenko - * util/grub-mkimagexx.c (generate_elf): Fix module address on coreboot. + * util/VasEBoot-mkimagexx.c (generate_elf): Fix module address on coreboot. 2013-11-10 Vladimir Serbinenko - * grub-core/term/ieee1275/escc.c (GRUB_MOD_INIT): Fix order of channels. + * VasEBoot-core/term/ieee1275/escc.c (VasEBoot_MOD_INIT): Fix order of channels. Reported by: Aaro Koskinen 2013-11-10 Vladimir Serbinenko - * docs/grub-dev.texi: Replace bzr references with git ones. + * docs/VasEBoot-dev.texi: Replace bzr references with git ones. 2013-11-10 Andrey Borzenkov - * docs/grub.texi (Simple configuration): Remove reference to - grub-reboot from saved default entry description - grub-default + * docs/VasEBoot.texi (Simple configuration): Remove reference to + VasEBoot-reboot from saved default entry description - VasEBoot-default does not use it anymore. 2013-11-10 Vladimir Serbinenko @@ -3385,11 +3385,11 @@ 2013-11-10 Andrey Borzenkov - * docs/grub.texi (Simple configuration): Document GRUB_DISABLE_SUBMENU. + * docs/VasEBoot.texi (Simple configuration): Document VasEBoot_DISABLE_SUBMENU. 2013-11-10 Vladimir Serbinenko - Fix grub_machine_fini bitrot. + Fix VasEBoot_machine_fini bitrot. Reported by: Glenn Washburn. @@ -3399,9 +3399,9 @@ 2013-11-10 Vladimir Serbinenko - * grub-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and + * VasEBoot-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and -DELF. - * grub-core/efiemu/runtime/config.h: Use __i386__ and __x86_64__ + * VasEBoot-core/efiemu/runtime/config.h: Use __i386__ and __x86_64__ instead of ELF*. 2013-11-10 Vladimir Serbinenko @@ -3413,70 +3413,70 @@ 2013-11-09 Vladimir Serbinenko - Add new ports: i386-xen and x86_64-xen. This allows running GRUB in + Add new ports: i386-xen and x86_64-xen. This allows running VasEBoot in XEN PV environment and load kernels. 2013-11-09 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c: Handle space in command line. - * grub-core/loader/multiboot_mbi2.c: Likewise. + * VasEBoot-core/loader/i386/multiboot_mbi.c: Handle space in command line. + * VasEBoot-core/loader/multiboot_mbi2.c: Likewise. 2013-11-09 Vladimir Serbinenko - * grub-core/lib/cmdline.c (grub_loader_cmdline_size): Fix empty cmdline + * VasEBoot-core/lib/cmdline.c (VasEBoot_loader_cmdline_size): Fix empty cmdline handling. 2013-11-09 Vladimir Serbinenko - * grub-core/commands/i386/cmostest.c: Add new command "cmosset". + * VasEBoot-core/commands/i386/cmostest.c: Add new command "cmosset". Tested by: Denis 'GNUtoo' Carikli. 2013-11-08 Vladimir Serbinenko - * grub-core/normal/datetime.c (grub_get_weekday): Use unsigned types. + * VasEBoot-core/normal/datetime.c (VasEBoot_get_weekday): Use unsigned types. 2013-11-08 Vladimir Serbinenko - * grub-core/gfxmenu/gui_circular_progress.c (parse_angle): + * VasEBoot-core/gfxmenu/gui_circular_progress.c (parse_angle): Use to get rounded angle rather than truncated. 2013-11-08 Vladimir Serbinenko - * grub-core/term/serial.c: Add option for enabling/disabling + * VasEBoot-core/term/serial.c: Add option for enabling/disabling RTS/CTS flow control. 2013-11-08 Vladimir Serbinenko - * grub-core/lib/libgcrypt/cipher/idea.c (mul_inv): Remove signed + * VasEBoot-core/lib/libgcrypt/cipher/idea.c (mul_inv): Remove signed divisions. 2013-11-08 Vladimir Serbinenko - * grub-core/lib/libgcrypt/mpi/mpih-div.c (_gcry_mpih_divrem): - Use grub_fatal rather than divide by zero. - * grub-core/lib/libgcrypt/mpi/mpi-pow.c (gcry_mpi_powm): Likewise. + * VasEBoot-core/lib/libgcrypt/mpi/mpih-div.c (_gcry_mpih_divrem): + Use VasEBoot_fatal rather than divide by zero. + * VasEBoot-core/lib/libgcrypt/mpi/mpi-pow.c (gcry_mpi_powm): Likewise. 2013-11-08 Vladimir Serbinenko - * include/grub/gui.h (grub_fixed_sfs_divide): Round rather than + * include/VasEBoot/gui.h (VasEBoot_fixed_sfs_divide): Round rather than truncate. - (grub_fixed_fsf_divide): Likewise. + (VasEBoot_fixed_fsf_divide): Likewise. 2013-11-08 Vladimir Serbinenko - * grub-core/gfxmenu/gui_list.c (draw_scrollbar): Avoid + * VasEBoot-core/gfxmenu/gui_list.c (draw_scrollbar): Avoid division by-zero and senseless negative divisions. 2013-11-08 Vladimir Serbinenko - * grub-core/gfxmenu/gui_circular_progress.c (circprog_paint): Avoid + * VasEBoot-core/gfxmenu/gui_circular_progress.c (circprog_paint): Avoid division by-zero and senseless negative divisions. (circprog_set_property): Don't accept negative num_ticks. 2013-11-08 Vladimir Serbinenko - * grub-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Avoid + * VasEBoot-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Avoid division by-zero and senseless negative divisions. 2013-11-08 Vladimir Serbinenko @@ -3485,67 +3485,67 @@ 2013-11-08 Vladimir Serbinenko - * grub-core/tests/div_test.c: New test. + * VasEBoot-core/tests/div_test.c: New test. 2013-11-08 Vladimir Testov - * grub-core/gfxmenu/gui_box.c: Updated to work with area status. - * grub-core/gfxmenu/gui_canvas.c: Likewise. - * grub-core/gfxmenu/view.c: Likewise. - * grub-core/video/fb/video_fb.c: Introduce new functions: - grub_video_set_area_status, grub_video_get_area_status, - grub_video_set_region, grub_video_get_region. - * grub-core/video/bochs.c: Likewise. - * grub-core/video/capture.c: Likewise. - * grub-core/video/video.c: Likewise. - * grub-core/video/cirrus.c: Likewise. - * grub-core/video/efi_gop.c: Likewise. - * grub-core/video/efi_uga.c: Likewise. - * grub-core/video/emu/sdl.c: Likewise. - * grub-core/video/radeon_fuloong2e.c: Likewise. - * grub-core/video/sis315pro.c: Likewise. - * grub-core/video/sm712.c: Likewise. - * grub-core/video/i386/pc/vbe.c: Likewise. - * grub-core/video/i386/pc/vga.c: Likewise. - * grub-core/video/ieee1275.c: Likewise. - * grub-core/video/i386/coreboot/cbfb.c: Likewise. - * include/grub/video.h: Likewise. - * include/grub/video_fb.h: Likewise. - * include/grub/fbfill.h: Updated render_target structure. - grub_video_rect_t viewport, region, area + * VasEBoot-core/gfxmenu/gui_box.c: Updated to work with area status. + * VasEBoot-core/gfxmenu/gui_canvas.c: Likewise. + * VasEBoot-core/gfxmenu/view.c: Likewise. + * VasEBoot-core/video/fb/video_fb.c: Introduce new functions: + VasEBoot_video_set_area_status, VasEBoot_video_get_area_status, + VasEBoot_video_set_region, VasEBoot_video_get_region. + * VasEBoot-core/video/bochs.c: Likewise. + * VasEBoot-core/video/capture.c: Likewise. + * VasEBoot-core/video/video.c: Likewise. + * VasEBoot-core/video/cirrus.c: Likewise. + * VasEBoot-core/video/efi_gop.c: Likewise. + * VasEBoot-core/video/efi_uga.c: Likewise. + * VasEBoot-core/video/emu/sdl.c: Likewise. + * VasEBoot-core/video/radeon_fuloong2e.c: Likewise. + * VasEBoot-core/video/sis315pro.c: Likewise. + * VasEBoot-core/video/sm712.c: Likewise. + * VasEBoot-core/video/i386/pc/vbe.c: Likewise. + * VasEBoot-core/video/i386/pc/vga.c: Likewise. + * VasEBoot-core/video/ieee1275.c: Likewise. + * VasEBoot-core/video/i386/coreboot/cbfb.c: Likewise. + * include/VasEBoot/video.h: Likewise. + * include/VasEBoot/video_fb.h: Likewise. + * include/VasEBoot/fbfill.h: Updated render_target structure. + VasEBoot_video_rect_t viewport, region, area int area_offset_x, area_offset_y, area_enabled - * include/grub/gui.h: New helper function - grub_video_bounds_inside_region. - * docs/grub-dev.texi: Added information about new functions. + * include/VasEBoot/gui.h: New helper function + VasEBoot_video_bounds_inside_region. + * docs/VasEBoot-dev.texi: Added information about new functions. 2013-11-08 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_real_malloc): Use AND rather than MOD + * VasEBoot-core/kern/mm.c (VasEBoot_real_malloc): Use AND rather than MOD for alignment. 2013-11-08 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (grub_reed_solomon_recover): Add + * VasEBoot-core/lib/reed_solomon.c (VasEBoot_reed_solomon_recover): Add missing attribute. - * grub-core/gdb/cstub.c (grub_gdb_trap): Likewise. + * VasEBoot-core/gdb/cstub.c (VasEBoot_gdb_trap): Likewise. 2013-11-08 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_divmod64): Don't fallback to + * VasEBoot-core/kern/misc.c (VasEBoot_divmod64): Don't fallback to simple division on arm and ia64. 2013-11-08 Vladimir Serbinenko - * grub-core/kern/arm/misc.S (__aeabi_unwind_cpp_pr0): Add dummy to + * VasEBoot-core/kern/arm/misc.S (__aeabi_unwind_cpp_pr0): Add dummy to link with libgcc. 2013-11-08 Vladimir Serbinenko - * include/grub/symbol.h (FUNCTION), (VARIABLE): Fix precedence logic. + * include/VasEBoot/symbol.h (FUNCTION), (VARIABLE): Fix precedence logic. 2013-11-08 Vladimir Serbinenko - * include/grub/symbol.h (FUNCTION), (VARIABLE) [__arm__]: Use % as + * include/VasEBoot/symbol.h (FUNCTION), (VARIABLE) [__arm__]: Use % as prefix symbol, not @. 2013-11-08 Vladimir Serbinenko @@ -3554,29 +3554,29 @@ 2013-11-08 Vladimir Serbinenko - * tests/util/grub-shell.in: Boot as hdd on ppc by default. + * tests/util/VasEBoot-shell.in: Boot as hdd on ppc by default. 2013-11-08 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_add_module): Fix + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_add_module): Fix NULL pointer dereference. 2013-11-07 Vladimir Serbinenko - * grub-core/Makefile.am: Do not include libgcc.h when compiling with + * VasEBoot-core/Makefile.am: Do not include libgcc.h when compiling with clang. 2013-11-07 Vladimir Serbinenko - * grub-core/kern/powerpc/dl.c: Add missing pragma to silence cast-align + * VasEBoot-core/kern/powerpc/dl.c: Add missing pragma to silence cast-align warnings. 2013-11-07 Vladimir Serbinenko - * grub-core/net/net.c (grub_net_route_unregister): Remove unused + * VasEBoot-core/net/net.c (VasEBoot_net_route_unregister): Remove unused function. - * grub-core/loader/i386/xnu.c (hextoval): Likewise. - * grub-core/disk/geli.c (ascii2hex): Likewise. + * VasEBoot-core/loader/i386/xnu.c (hextoval): Likewise. + * VasEBoot-core/disk/geli.c (ascii2hex): Likewise. 2013-11-07 Vladimir Serbinenko @@ -3597,17 +3597,17 @@ unconditionally. * configure.ac: Add -no-integrated-as when using clangfor asm files. Add -mrtd -mregparm=3 on i386 when not using clang. - * grub-core/kern/misc.c (grub_memset): Add volatile when on clang. + * VasEBoot-core/kern/misc.c (VasEBoot_memset): Add volatile when on clang. 2013-11-07 Vladimir Serbinenko - * grub-core/kern/ieee1275/cmain.c: Add explicit attribute on asm + * VasEBoot-core/kern/ieee1275/cmain.c: Add explicit attribute on asm bindings. - * grub-core/lib/reed_solomon.c: Likewise. - * include/grub/i386/gdb.h: Likewise. - * include/grub/i386/pc/int.h: Likewise. - * include/grub/i386/pc/pxe.h: Likewise. - * include/grub/ieee1275/ieee1275.h: Likewise. + * VasEBoot-core/lib/reed_solomon.c: Likewise. + * include/VasEBoot/i386/gdb.h: Likewise. + * include/VasEBoot/i386/pc/int.h: Likewise. + * include/VasEBoot/i386/pc/pxe.h: Likewise. + * include/VasEBoot/ieee1275/ieee1275.h: Likewise. 2013-11-07 Vladimir Serbinenko @@ -3647,20 +3647,20 @@ 2013-11-07 Vladimir Serbinenko - * grub-core/kern/parser.c (grub_parser_split_cmdline): Remove nested + * VasEBoot-core/kern/parser.c (VasEBoot_parser_split_cmdline): Remove nested function. 2013-11-07 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Remove nested functions. + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Remove nested functions. 2013-11-07 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_parse): Remove nested function. + * VasEBoot-core/lib/arg.c (VasEBoot_arg_parse): Remove nested function. 2013-11-07 Vladimir Serbinenko - * grub-core/normal/cmdline.c (grub_cmdline_get): + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Remove nested functions. 2013-11-07 Vladimir Serbinenko @@ -3669,9 +3669,9 @@ 2013-11-07 Vladimir Serbinenko - * grub-core/normal/charset.c (bidi_line_wrap): Eliminate nested + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Eliminate nested functions. - (grub_bidi_line_logical_to_visual): Likewise. + (VasEBoot_bidi_line_logical_to_visual): Likewise. 2013-11-07 Vladimir Serbinenko @@ -3679,93 +3679,93 @@ * conf/Makefile.common (CFLAGS_GNULIB): Remove -Wno-unsafe-loop-optimisations. - * grub-core/commands/legacycfg.c: Remove -Wunsafe-loop-optimisations + * VasEBoot-core/commands/legacycfg.c: Remove -Wunsafe-loop-optimisations pragma. - * grub-core/io/gzio.c: Likewise. - * grub-core/script/parser.y: Likewise. - * grub-core/script/yylex.l: Likewise. - * util/grub-mkfont.c: Likewise. + * VasEBoot-core/io/gzio.c: Likewise. + * VasEBoot-core/script/parser.y: Likewise. + * VasEBoot-core/script/yylex.l: Likewise. + * util/VasEBoot-mkfont.c: Likewise. 2013-11-07 Vladimir Serbinenko - * util/grub-mkfont.c (process_cursive): Remove nested function. + * util/VasEBoot-mkfont.c (process_cursive): Remove nested function. 2013-11-07 Vladimir Serbinenko - * include/grub/misc.h (grub_dprintf): Use unnamed vararg. - (grub_boot_time): Likewise. + * include/VasEBoot/misc.h (VasEBoot_dprintf): Use unnamed vararg. + (VasEBoot_boot_time): Likewise. 2013-11-07 Vladimir Serbinenko - * include/grub/symbol.h (FUNCTION): Use @function rather than + * include/VasEBoot/symbol.h (FUNCTION): Use @function rather than "function". (VARIABLE): Likewise. 2013-11-07 Vladimir Serbinenko - * grub-core/net/bootp.c (OFFSET_OF): Explicitly cast to grub_size_t. + * VasEBoot-core/net/bootp.c (OFFSET_OF): Explicitly cast to VasEBoot_size_t. 2013-11-07 Vladimir Serbinenko - * grub-core/net/bootp.c (set_env_limn_ro): Make pointer const. + * VasEBoot-core/net/bootp.c (set_env_limn_ro): Make pointer const. (parse_dhcp_vendor): Likewise. 2013-11-07 Vladimir Serbinenko - * util/grub-mkimagexx.c (relocate_symbols): Remove unneeded brackets. + * util/VasEBoot-mkimagexx.c (relocate_symbols): Remove unneeded brackets. 2013-11-07 Vladimir Serbinenko - * grub-core/gettext/gettext.c (main_context), (secondary_context): + * VasEBoot-core/gettext/gettext.c (main_context), (secondary_context): Define after defining type and not before. 2013-11-07 Vladimir Serbinenko - * grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Return right error + * VasEBoot-core/fs/zfs/zfscrypt.c (VasEBoot_ccm_decrypt): Return right error type. - (grub_gcm_decrypt): Likewise. + (VasEBoot_gcm_decrypt): Likewise. (algo_decrypt): Likewise. - (grub_zfs_decrypt_real): Transform error type. + (VasEBoot_zfs_decrypt_real): Transform error type. 2013-11-07 Vladimir Serbinenko - * grub-core/disk/geli.c (geli_rekey): Fix error return type. + * VasEBoot-core/disk/geli.c (geli_rekey): Fix error return type. 2013-11-07 Vladimir Serbinenko - * grub-core/disk/usbms.c (grub_usbms_cbi_cmd): Fix error type. - (grub_usbms_cbi_reset): Likewise. - (grub_usbms_bo_reset): Likewise. - (grub_usbms_reset): Likewise. - (grub_usbms_attach): Likewise. - (grub_usbms_transfer_cbi): Likewise. + * VasEBoot-core/disk/usbms.c (VasEBoot_usbms_cbi_cmd): Fix error type. + (VasEBoot_usbms_cbi_reset): Likewise. + (VasEBoot_usbms_bo_reset): Likewise. + (VasEBoot_usbms_reset): Likewise. + (VasEBoot_usbms_attach): Likewise. + (VasEBoot_usbms_transfer_cbi): Likewise. 2013-11-07 Vladimir Serbinenko - * grub-core/io/lzopio.c (test_header): Simplify code and remove useless + * VasEBoot-core/io/lzopio.c (test_header): Simplify code and remove useless "checksum = checksum;". 2013-11-07 Vladimir Serbinenko - * grub-core/fs/reiserfs.c (grub_reiserfs_iterate_dir): Fix type of + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_iterate_dir): Fix type of entry_type. 2013-11-07 Vladimir Serbinenko - * grub-core/commands/legacycfg.c (grub_cmd_legacy_kernel): Fix + * VasEBoot-core/commands/legacycfg.c (VasEBoot_cmd_legacy_kernel): Fix BIOS disk check. 2013-11-07 Vladimir Serbinenko - * grub-core/bus/usb/ehci.c (grub_ehci_restore_hw): Return right enum + * VasEBoot-core/bus/usb/ehci.c (VasEBoot_ehci_restore_hw): Return right enum type. - (grub_ehci_fini_hw): Likewise. - * grub-core/bus/usb/usbhub.c (grub_usb_add_hub): Likewise. + (VasEBoot_ehci_fini_hw): Likewise. + * VasEBoot-core/bus/usb/usbhub.c (VasEBoot_usb_add_hub): Likewise. 2013-11-07 Vladimir Serbinenko - * include/grub/usb.h (grub_usb_controller_dev): Make portstatus - return grub_usb_err_t for cosistency. All users updated. + * include/VasEBoot/usb.h (VasEBoot_usb_controller_dev): Make portstatus + return VasEBoot_usb_err_t for cosistency. All users updated. 2013-11-07 Vladimir Serbinenko @@ -3783,90 +3783,90 @@ Fixes: https://savannah.gnu.org/bugs/?39710 - * grub-core/net/bootp.c (parse_dhcp_vendor): Add DNS option. - * grub-core/net/dns.c (grub_dns_qtype_id): New enum. - * (grub_net_dns_lookup): Now using separated dns packages. - * (grub_cmd_nslookup): Add error condition. - * (grub_cmd_list_dns): Print DNS option. - * (grub_cmd_add_dns): Add four parameters: --only-ipv4, --only-ipv6, + * VasEBoot-core/net/bootp.c (parse_dhcp_vendor): Add DNS option. + * VasEBoot-core/net/dns.c (VasEBoot_dns_qtype_id): New enum. + * (VasEBoot_net_dns_lookup): Now using separated dns packages. + * (VasEBoot_cmd_nslookup): Add error condition. + * (VasEBoot_cmd_list_dns): Print DNS option. + * (VasEBoot_cmd_add_dns): Add four parameters: --only-ipv4, --only-ipv6, --prefer-ipv4, and --prefer-ipv6. - * include/grub/net.h (grub_dns_option_t): New enum. - * (grub_net_network_level_address): option added. + * include/VasEBoot/net.h (VasEBoot_dns_option_t): New enum. + * (VasEBoot_net_network_level_address): option added. 2013-11-05 Vladimir Testov - * grub-core/video/fb/video_fb.c: Merge two blit functions + * VasEBoot-core/video/fb/video_fb.c: Merge two blit functions into one. 2013-11-05 Vladimir Serbinenko - * grub-core/term/terminfo.c: Add sequences for home and end. + * VasEBoot-core/term/terminfo.c: Add sequences for home and end. 2013-11-05 Vladimir Serbinenko - * grub-core/lib/legacy_parse.c: Fix handling of hercules and add + * VasEBoot-core/lib/legacy_parse.c: Fix handling of hercules and add graphics console. 2013-11-05 Vladimir Serbinenko - * grub-core/video/i386/pc/vga.c: Fix double bufferring and + * VasEBoot-core/video/i386/pc/vga.c: Fix double bufferring and add mode 0x12. 2013-11-04 Vladimir Serbinenko - * docs/grub.texi (Vendor power-on keys): Add XPS M1330M based on old + * docs/VasEBoot.texi (Vendor power-on keys): Add XPS M1330M based on old e-mail by Per Öberg. 2013-11-04 Vladimir Serbinenko - * grub-core/commands/i386/nthibr.c (GRUB_MOD_INIT): Fix typo in command + * VasEBoot-core/commands/i386/nthibr.c (VasEBoot_MOD_INIT): Fix typo in command name. 2013-11-04 Andrey Borzenkov * configure.ac: Explicitly disable emusdl, emuusb and emupci on non- emu platforms. - * grub-core/Makefile.core.def: Enable emupci and emuucb only for emu. + * VasEBoot-core/Makefile.core.def: Enable emupci and emuucb only for emu. 2013-11-04 Vladimir Serbinenko - * docs/grub.texi: Document usage of menuentry id. + * docs/VasEBoot.texi: Document usage of menuentry id. 2013-11-04 Vladimir Serbinenko - * docs/grub.texi: Add few mentions about EFI, debug and videoinfo. + * docs/VasEBoot.texi: Add few mentions about EFI, debug and videoinfo. 2013-11-04 Peter Lustig - * grub-core/commands/i386/nthibr.c: New command. + * VasEBoot-core/commands/i386/nthibr.c: New command. 2013-11-04 Vladimir Serbinenko - * grub-core/tests/video_checksum.c: Add 2560x1440 mode to testing. + * VasEBoot-core/tests/video_checksum.c: Add 2560x1440 mode to testing. 2013-11-04 Vladimir Serbinenko - * include/grub/term.h (grub_term_coordinate): Extend to 16-bit per + * include/VasEBoot/term.h (VasEBoot_term_coordinate): Extend to 16-bit per coordinate. 2013-11-04 Vladimir Serbinenko - Support GRUB_DISABLE_SUBMENU config. + Support VasEBoot_DISABLE_SUBMENU config. Inspired by patch from Prarit Bhargava. 2013-11-03 Vladimir Serbinenko - * docs/grub.texi: Mention RSA support. + * docs/VasEBoot.texi: Mention RSA support. 2013-11-03 Vladimir Serbinenko - * grub-core/commands/verify.c: Add RSA support. + * VasEBoot-core/commands/verify.c: Add RSA support. 2013-11-03 Vladimir Serbinenko - * grub-core/disk/ahci.c (grub_ahci_pciinit): Detect ATAPI devices. - * grub-core/disk/ata.c (grub_ata_identify): Use atapi_identify if + * VasEBoot-core/disk/ahci.c (VasEBoot_ahci_pciinit): Detect ATAPI devices. + * VasEBoot-core/disk/ata.c (VasEBoot_ata_identify): Use atapi_identify if device is known to be ATAPI. 2013-11-03 Mike Frysinger @@ -3875,17 +3875,17 @@ 2013-11-03 Vladimir Serbinenko - * grub-core/commands/loadenv.c (grub_cmd_save_env): Remove unset + * VasEBoot-core/commands/loadenv.c (VasEBoot_cmd_save_env): Remove unset variables. 2013-11-03 Vladimir Serbinenko - * grub-core/gettext/gettext.c (grub_gettext_init_ext): Ignore errors + * VasEBoot-core/gettext/gettext.c (VasEBoot_gettext_init_ext): Ignore errors if language is English. 2013-11-03 Vladimir Serbinenko - * grub-core/osdep/linux/getroot.c: Fix cast-align problems. + * VasEBoot-core/osdep/linux/getroot.c: Fix cast-align problems. 2013-11-02 Vladimir Serbinenko @@ -3893,34 +3893,34 @@ 2013-11-02 neil - * grub-core/osdep/linux/blocklist.c: Include linux/types.h for some + * VasEBoot-core/osdep/linux/blocklist.c: Include linux/types.h for some broken linux headers. 2013-11-02 Vladimir Serbinenko - * util/grub.d/30_os-prober.in: Add unhiding of partition if on msdos. + * util/VasEBoot.d/30_os-prober.in: Add unhiding of partition if on msdos. 2013-11-02 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (grub_reed_solomon_recover): Don't do + * VasEBoot-core/lib/reed_solomon.c (VasEBoot_reed_solomon_recover): Don't do Reed-Solomon recovery if more than half of redundancy info is 0. 2013-11-02 Vladimir Serbinenko - * util/grub-mount.c: Handle symlinks to directories. + * util/VasEBoot-mount.c: Handle symlinks to directories. 2013-11-02 Vladimir Serbinenko - * grub-core/fs/fshelp.c (find_file): Save ctx->next when calling + * VasEBoot-core/fs/fshelp.c (find_file): Save ctx->next when calling find_file recursively for symlink. 2013-11-02 Vladimir Serbinenko - * tests/util/grub-shell.in: Copy themes. + * tests/util/VasEBoot-shell.in: Copy themes. 2013-11-02 Vladimir Serbinenko - * util/grub-mkimagexx.c (locate_sections): Reject mislinked images. + * util/VasEBoot-mkimagexx.c (locate_sections): Reject mislinked images. 2013-11-02 Vladimir Serbinenko @@ -3928,12 +3928,12 @@ 2013-11-02 Vladimir Serbinenko - * grub-core/loader/sparc64/ieee1275/linux.c (get_physbase): Fix + * VasEBoot-core/loader/sparc64/ieee1275/linux.c (get_physbase): Fix signature. 2013-11-02 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c (grub_efidisk_readwrite): Remove unused + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_readwrite): Remove unused variable. 2013-11-02 Vladimir Serbinenko @@ -3942,9 +3942,9 @@ 2013-11-02 Vladimir Serbinenko - * grub-core/fs/hfspluscomp.c (hfsplus_read_compressed_real): Call + * VasEBoot-core/fs/hfspluscomp.c (hfsplus_read_compressed_real): Call file_progress_read_hook. - * grub-core/fs/ntfscomp.c (hfsplus_read_compressed_real): Likewise. + * VasEBoot-core/fs/ntfscomp.c (hfsplus_read_compressed_real): Likewise. 2013-11-02 Vladimir Serbinenko @@ -3953,7 +3953,7 @@ 2013-11-01 Vladimir Serbinenko - * grub-core/fs/tar.c (grub_cpio_read): Add read_hook. + * VasEBoot-core/fs/tar.c (VasEBoot_cpio_read): Add read_hook. 2013-11-01 Vladimir Serbinenko @@ -3962,7 +3962,7 @@ 2013-11-01 Vladimir Serbinenko - * grub-core/term/serial.c (options), (grub_cmd_serial): Fix handling + * VasEBoot-core/term/serial.c (options), (VasEBoot_cmd_serial): Fix handling of SI suffixes. 2013-11-01 Vladimir Serbinenko @@ -3972,102 +3972,102 @@ 2013-11-01 Vladimir Serbinenko - * grub-core/fs/ext2.c (grub_ext2_read_symlink): Use memcpy rather + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_read_symlink): Use memcpy rather strncpy. - * grub-core/fs/jfs.c (grub_jfs_lookup_symlink): Likewise. - * grub-core/kern/misc.c (grub_strncpy): Move from here ... - * include/grub/misc.h (grub_strncpy): ... to here. Make inline. - * grub-core/net/net.c (grub_net_addr_to_str): Use COMPILE_TIME_ASSERT + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_lookup_symlink): Likewise. + * VasEBoot-core/kern/misc.c (VasEBoot_strncpy): Move from here ... + * include/VasEBoot/misc.h (VasEBoot_strncpy): ... to here. Make inline. + * VasEBoot-core/net/net.c (VasEBoot_net_addr_to_str): Use COMPILE_TIME_ASSERT + strcpy rather than strncpy. 2013-11-01 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (nvpair_name): Use correct type for size. + * VasEBoot-core/fs/zfs/zfs.c (nvpair_name): Use correct type for size. (check_pool_label): Likewise. Fixes overflow. (nvlist_find_value): Fix comparison. 2013-11-01 Vladimir Serbinenko - * include/grub/misc.h (grub_strcat): Removed. All users changed to + * include/VasEBoot/misc.h (VasEBoot_strcat): Removed. All users changed to more appropriate functions. 2013-11-01 Vladimir Serbinenko - * grub-core/kern/efi/efi.c (grub_efi_get_filename): Avoid inefficient + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_get_filename): Avoid inefficient realloc. 2013-11-01 Vladimir Serbinenko - * util/grub-mkrescue.in: Do not use UUID search on EFI. + * util/VasEBoot-mkrescue.in: Do not use UUID search on EFI. 2013-11-01 Vladimir Serbinenko - * grub-core/kern/dl.c: Unify section-finding algorithm. Saves 30 bytes + * VasEBoot-core/kern/dl.c: Unify section-finding algorithm. Saves 30 bytes on core size. 2013-10-30 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_realloc): Don't copy more data than we have. + * VasEBoot-core/kern/mm.c (VasEBoot_realloc): Don't copy more data than we have. 2013-10-30 Vladimir Serbinenko - * grub-core/io/gzio.c (huft_build): Use zalloc for safety. + * VasEBoot-core/io/gzio.c (huft_build): Use zalloc for safety. (initialize_tables): reset tl and td to NULL after freeing. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c: Implement network tag. + * VasEBoot-core/loader/multiboot_mbi2.c: Implement network tag. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c: Add EFI memory map to the list + * VasEBoot-core/loader/multiboot_mbi2.c: Add EFI memory map to the list of supported tags. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c: Implement EFI memory map. + * VasEBoot-core/loader/multiboot_mbi2.c: Implement EFI memory map. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/multiboot.c: Add support for multiboot kernels + * VasEBoot-core/loader/multiboot.c: Add support for multiboot kernels quirks. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (allocate_pages): Allocate at least + * VasEBoot-core/loader/i386/linux.c (allocate_pages): Allocate at least a page in protected space. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/multiboot.c (grub_cmd_module): Don't attempt to + * VasEBoot-core/loader/multiboot.c (VasEBoot_cmd_module): Don't attempt to allocate space for zero-sized modules. 2013-10-28 Vladimir Serbinenko - * grub-core/loader/xnu_resume.c (grub_xnu_resume): Reject empty images. + * VasEBoot-core/loader/xnu_resume.c (VasEBoot_xnu_resume): Reject empty images. 2013-10-28 Francesco Lavra - * grub-core/lib/fdt.c: Fix miscellaneous bugs. + * VasEBoot-core/lib/fdt.c: Fix miscellaneous bugs. 2013-10-28 Vladimir Serbinenko - * grub-core/lib/progress.c (grub_file_progress_hook_real): Add missing + * VasEBoot-core/lib/progress.c (VasEBoot_file_progress_hook_real): Add missing safeguards. Fixes a crash with i386/pc/console.c. 2013-10-28 Vladimir Serbinenko - * include/grub/emu/hostdisk.h: Add proper declaration for grub_host_init - and grub_hostfs_init. + * include/VasEBoot/emu/hostdisk.h: Add proper declaration for VasEBoot_host_init + and VasEBoot_hostfs_init. 2013-10-28 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_check_file_presence): Use + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_check_file_presence): Use windows method on other platforms without good stat as well. 2013-10-28 Vladimir Serbinenko - * grub-core/osdep/linux/getroot.c: Add new btrfs defines. + * VasEBoot-core/osdep/linux/getroot.c: Add new btrfs defines. 2013-10-28 Vladimir Serbinenko @@ -4076,14 +4076,14 @@ 2013-10-28 Andrey Borzenkov - * Makefile.util.def: Add grub-core/kern/disk_common.c to library + * Makefile.util.def: Add VasEBoot-core/kern/disk_common.c to library extra_dist. - * grub-core/Makefile.core.def: Add kern/disk_common.c to disk module + * VasEBoot-core/Makefile.core.def: Add kern/disk_common.c to disk module extra_dist. 2013-10-27 Vladimir Serbinenko - * util/grub-mkfont.c (main): Show error message when FT_Set_Pixel_Sizes + * util/VasEBoot-mkfont.c (main): Show error message when FT_Set_Pixel_Sizes fails. 2013-10-27 BVK Chaitanya @@ -4092,40 +4092,40 @@ 2013-10-27 Vladimir Serbinenko - * configure.ac: Remove leftover COND_BUILD_GRUB_MKFONT and - COND_GRUB_PE2ELF conditions. + * configure.ac: Remove leftover COND_BUILD_VasEBoot_MKFONT and + COND_VasEBoot_PE2ELF conditions. 2013-10-27 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Accept "sd", "cd", + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_cmd_openbsd): Accept "sd", "cd", "vnd", "rd" and "fd" disks. 2013-10-27 Vladimir Serbinenko - Move grub_disk_write out of kernel into disk.mod. + Move VasEBoot_disk_write out of kernel into disk.mod. 2013-10-27 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Unify int and wchar + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Unify int and wchar handling. 2013-10-27 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_abort): Make static + * VasEBoot-core/kern/misc.c (VasEBoot_abort): Make static 2013-10-27 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Don't attempt to + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Don't attempt to transform invalid unicode codepoints. 2013-10-27 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Remove needless explicit \0 checking. 2013-10-27 Vladimir Serbinenko - * grub-core/lib/legacy_parse.c: Add support for "nd" disk. + * VasEBoot-core/lib/legacy_parse.c: Add support for "nd" disk. 2013-10-26 Vladimir Serbinenko @@ -4137,13 +4137,13 @@ 2013-10-26 Grégoire Sutre - * util/grub.d/00_header.in: Don't use LANG if it's not set. + * util/VasEBoot.d/00_header.in: Don't use LANG if it's not set. 2013-10-26 Grégoire Sutre - * util/grub-mkconfig.in: Replace $0 with $self. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. + * util/VasEBoot-mkconfig.in: Replace $0 with $self. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. 2013-10-26 BVK Chaitanya @@ -4151,7 +4151,7 @@ 2013-10-26 BVK Chaitanya - * tests/util/grub-shell.in: Add new --debug option. + * tests/util/VasEBoot-shell.in: Add new --debug option. 2013-10-26 BVK Chaitanya @@ -4163,13 +4163,13 @@ 2013-10-26 Vladimir Serbinenko - * grub-core/fs/iso9660.c: Replace strncat with memcpy. - * include/grub/misc.h: Remove strncat. - * grub-core/lib/posix_wrap/string.h: Likewise. + * VasEBoot-core/fs/iso9660.c: Replace strncat with memcpy. + * include/VasEBoot/misc.h: Remove strncat. + * VasEBoot-core/lib/posix_wrap/string.h: Likewise. 2013-10-26 Vladimir Serbinenko - * grub-core/net/tftp.c: Retransmit ack when rereceiving old packet. + * VasEBoot-core/net/tftp.c: Retransmit ack when rereceiving old packet. Try to handle more than 0xFFFF packets. Reported by: Bernhard Übelacker . He also spotted few overflows in first version of this patch. @@ -4180,122 +4180,122 @@ 2013-10-26 Vladimir Serbinenko - * grub-core/normal/datetime.c (grub_unixtime2datetime): Fix mishandling + * VasEBoot-core/normal/datetime.c (VasEBoot_unixtime2datetime): Fix mishandling of first three years after start of validity of unixtime. 2013-10-26 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (get_logical_num_lines): Use unsigned + * VasEBoot-core/normal/menu_entry.c (get_logical_num_lines): Use unsigned division as the one making more sense. (update_screen): Likewise. (complete): Likewise. 2013-10-25 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (complete): Make sure that width is >0. + * VasEBoot-core/normal/menu_entry.c (complete): Make sure that width is >0. 2013-10-25 Vladimir Serbinenko - Make char and string width grub_size_t rather than grub_ssize_t. + Make char and string width VasEBoot_size_t rather than VasEBoot_ssize_t. 2013-10-25 Vladimir Serbinenko - * grub-core/normal/cmdline.c (grub_history_get): Make argument into + * VasEBoot-core/normal/cmdline.c (VasEBoot_history_get): Make argument into unsigned. - (grub_history_replace): Likewise. + (VasEBoot_history_replace): Likewise. 2013-10-25 Vladimir Serbinenko - * grub-core/disk/raid6_recover.c: Use unsigned arithmetics when + * VasEBoot-core/disk/raid6_recover.c: Use unsigned arithmetics when appropriate. 2013-10-25 Vladimir Serbinenko - * grub-core/video/bitmap_scale.c: Use unsigned arithmetics when + * VasEBoot-core/video/bitmap_scale.c: Use unsigned arithmetics when appropriate. 2013-10-25 Vladimir Serbinenko - * grub-core/video/fb/fbblit.c: Use (255 ^ x) rather than (255 - x). + * VasEBoot-core/video/fb/fbblit.c: Use (255 ^ x) rather than (255 - x). Use unsigned divisions rather than signed variants. 2013-10-25 Vladimir Serbinenko - * grub-core/video/readers/png.c (grub_png_convert_image): Use + * VasEBoot-core/video/readers/png.c (VasEBoot_png_convert_image): Use unsigned arithmetics. Add missing break. 2013-10-25 Vladimir Serbinenko - * grub-core/video/readers/jpeg.c: Use unsigned where appropriate. + * VasEBoot-core/video/readers/jpeg.c: Use unsigned where appropriate. 2013-10-25 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (xor_out): Use unsigned modular arithmetics + * VasEBoot-core/fs/zfs/zfs.c (xor_out): Use unsigned modular arithmetics rather than signed one. (recovery): Likewise. 2013-10-25 Vladimir Serbinenko - * grub-core/net/dns.c (hash): Use unsigned arithmetic. + * VasEBoot-core/net/dns.c (hash): Use unsigned arithmetic. 2013-10-25 Vladimir Serbinenko - * grub-core/io/gzio.c (test_zlib_header): Use undigned modulo rather + * VasEBoot-core/io/gzio.c (test_zlib_header): Use undigned modulo rather than signed. 2013-10-25 Jon McCune - * docs/grub.texi: Cleanup security documentation around signatures. + * docs/VasEBoot.texi: Cleanup security documentation around signatures. 2013-10-25 Vladimir Serbinenko - * grub-core/fs/ext2.c (EXT2_BLOCK_SIZE): Make unsigned. + * VasEBoot-core/fs/ext2.c (EXT2_BLOCK_SIZE): Make unsigned. 2013-10-25 Vladimir Serbinenko - * grub-core/commands/gptsync.c (lba_to_chs): Use proper types rather + * VasEBoot-core/commands/gptsync.c (lba_to_chs): Use proper types rather than int. 2013-10-25 Vladimir Serbinenko - * conf/Makefile.common (CPPFLAGS_KERNEL): Add -DGRUB_KERNEL=1. - * include/grub/dl.h (GRUB_MOD_INIT), (GRUB_MOD_FINI): Define + * conf/Makefile.common (CPPFLAGS_KERNEL): Add -DVasEBoot_KERNEL=1. + * include/VasEBoot/dl.h (VasEBoot_MOD_INIT), (VasEBoot_MOD_FINI): Define functions when compiling for kernel. 2013-10-25 Vladimir Serbinenko - * grub-core/lib/progress.c (grub_file_progress_hook_real): Cast to + * VasEBoot-core/lib/progress.c (VasEBoot_file_progress_hook_real): Cast to unsigned long long when using %llu. 2013-10-25 Vladimir Serbinenko - * grub-core/lib/progress.c (grub_file_progress_hook_real): Refresh + * VasEBoot-core/lib/progress.c (VasEBoot_file_progress_hook_real): Refresh terminal after updating progress. 2013-10-25 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S (grub_gate_a20): Remove + * VasEBoot-core/boot/i386/pc/startup_raw.S (VasEBoot_gate_a20): Remove argument. We don't disable Gate A20 in this code. 2013-10-25 Vladimir Serbinenko - * grub-core/boot/i386/qemu/boot.S: Ensure that A20 is enabled. + * VasEBoot-core/boot/i386/qemu/boot.S: Ensure that A20 is enabled. Conceptually based on change in branch "vbe-on-coreboot". 2013-10-24 Robert Millan - * grub-core/video/i386/pc/vbe.c (grub_video_vbe_setup): Replace + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_video_vbe_setup): Replace numeric constants with their symbolic equivalent. Taken from branch "vbe-on-coreboot". 2013-10-22 Vladimir Serbinenko - * docs/grub.texi: Fix ordering and use pxref rather than xref. + * docs/VasEBoot.texi: Fix ordering and use pxref rather than xref. 2013-10-22 Vladimir Serbinenko - * grub-core/lib/progress.c (grub_file_progress_hook_real): Use + * VasEBoot-core/lib/progress.c (VasEBoot_file_progress_hook_real): Use divmod64 for offset division. 2013-10-22 Paulo Flabiano Smorigo @@ -4309,29 +4309,29 @@ Add new progress module that displays the load progress of files. - * grub-core/lib/progress.c: New file. - * grub-core/Makefile.core.def (progress): New module. - * grub-core/kern/file.c (grub_file_open): File name added. - * (grub_file_read): Progress hook added. - * grub-core/fs/cbfs.c (grub_cbfs_read): Likewise. - * grub-core/fs/cpio_common.c (grub_cpio_read): Likewise. - * grub-core/net/net.c (grub_net_fs_read_real): Likewise. - * include/grub/file.h (struct grub_file): Add progress module members. - * include/grub/term.h (struct grub_term_output): Likewise. - * grub-core/osdep/unix/emuconsole.c (grub_console_term_output): + * VasEBoot-core/lib/progress.c: New file. + * VasEBoot-core/Makefile.core.def (progress): New module. + * VasEBoot-core/kern/file.c (VasEBoot_file_open): File name added. + * (VasEBoot_file_read): Progress hook added. + * VasEBoot-core/fs/cbfs.c (VasEBoot_cbfs_read): Likewise. + * VasEBoot-core/fs/cpio_common.c (VasEBoot_cpio_read): Likewise. + * VasEBoot-core/net/net.c (VasEBoot_net_fs_read_real): Likewise. + * include/VasEBoot/file.h (struct VasEBoot_file): Add progress module members. + * include/VasEBoot/term.h (struct VasEBoot_term_output): Likewise. + * VasEBoot-core/osdep/unix/emuconsole.c (VasEBoot_console_term_output): Terminal velocity added. - * grub-core/osdep/windows/emuconsole.c (grub_console_term_output): Likewise. - * grub-core/term/arc/console.c (grub_console_term_output): Likewise. - * grub-core/term/efi/console.c (grub_console_term_output): Likewise. - * grub-core/term/gfxterm.c (grub_video_term): Likewise. - * grub-core/term/i386/coreboot/cbmemc.c (grub_cbmemc_term_output): Likewise. - * grub-core/term/i386/pc/console.c (grub_console_term_output): Likewise. - * grub-core/term/i386/pc/vga_text.c (grub_vga_text_term): Likewise. - * grub-core/term/ieee1275/console.c (grub_console_term_output): Likewise. - * grub-core/term/morse.c (grub_audio_term_output): Likewise. - * grub-core/term/serial.c (grub_serial_term_output): Likewise. - * grub-core/term/spkmodem.c (grub_spkmodem_term_output): Likewise. - * grub-core/term/uboot/console.c (uboot_console_term_output): Likewise. + * VasEBoot-core/osdep/windows/emuconsole.c (VasEBoot_console_term_output): Likewise. + * VasEBoot-core/term/arc/console.c (VasEBoot_console_term_output): Likewise. + * VasEBoot-core/term/efi/console.c (VasEBoot_console_term_output): Likewise. + * VasEBoot-core/term/gfxterm.c (VasEBoot_video_term): Likewise. + * VasEBoot-core/term/i386/coreboot/cbmemc.c (VasEBoot_cbmemc_term_output): Likewise. + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_term_output): Likewise. + * VasEBoot-core/term/i386/pc/vga_text.c (VasEBoot_vga_text_term): Likewise. + * VasEBoot-core/term/ieee1275/console.c (VasEBoot_console_term_output): Likewise. + * VasEBoot-core/term/morse.c (VasEBoot_audio_term_output): Likewise. + * VasEBoot-core/term/serial.c (VasEBoot_serial_term_output): Likewise. + * VasEBoot-core/term/spkmodem.c (VasEBoot_spkmodem_term_output): Likewise. + * VasEBoot-core/term/uboot/console.c (uboot_console_term_output): Likewise. 2013-10-22 Vladimir Serbinenko @@ -4339,159 +4339,159 @@ 2013-10-21 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Remove needless explicit \0 checking. Saves 70 bytes on compressed image. 2013-10-21 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_strtoull): Remove needless *ptr != 0 + * VasEBoot-core/kern/misc.c (VasEBoot_strtoull): Remove needless *ptr != 0 check. Saves 10 bytes on compressed image. 2013-10-21 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_isprint): Move to ... - * include/grub/misc.h (grub_isprint): ... here. Make inline. + * VasEBoot-core/kern/misc.c (VasEBoot_isprint): Move to ... + * include/VasEBoot/misc.h (VasEBoot_isprint): ... here. Make inline. Saves 20 bytes on compressed image due to remving exporting. 2013-10-21 Vladimir Serbinenko - * grub-core/fs/ntfs.c (grub_ntfs_mount): Remove redundant check. + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_mount): Remove redundant check. Saves 5 bytes on compressed image. 2013-10-21 Vladimir Serbinenko - * grub-core/fs/ntfs.c: Move common UTF-16 handling to a separate + * VasEBoot-core/fs/ntfs.c: Move common UTF-16 handling to a separate function get_utf8. Saves 379 bytes on compressed image. 2013-10-21 Vladimir Serbinenko - * grub-core/fs/ntfs.c: Handle 48-bit MFT no. + * VasEBoot-core/fs/ntfs.c: Handle 48-bit MFT no. 2013-10-21 Vladimir Serbinenko - * grub-core/fs/ntfs.c (read_run_data): Rewrite using bitfields. + * VasEBoot-core/fs/ntfs.c (read_run_data): Rewrite using bitfields. Saves 40 bytes on compressed image. 2013-10-21 Vladimir Serbinenko - * grub-core/fs/ntfs.c (grub_ntfs_iterate_dir): Use grub_uint8_t for + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_iterate_dir): Use VasEBoot_uint8_t for mask rather than 64-bit type. Saves 20 bytes on compressed image. 2013-10-21 Vladimir Serbinenko - * grub-core/fs/ntfs.c (read_data): Move code for compressed data to ... - * grub-core/fs/ntfscomp.c (ntfscomp): ... here. + * VasEBoot-core/fs/ntfs.c (read_data): Move code for compressed data to ... + * VasEBoot-core/fs/ntfscomp.c (ntfscomp): ... here. Saves 273 bytes on compressed image. 2013-10-20 Vladimir Serbinenko - * grub-core/kern/disk.c (grub_disk_write): Use malloc/free instead of + * VasEBoot-core/kern/disk.c (VasEBoot_disk_write): Use malloc/free instead of variable length arrays. Saves 50 bytes on compressed image. 2013-10-20 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c: Remove variable length arrays. + * VasEBoot-core/loader/i386/bsd.c: Remove variable length arrays. 2013-10-20 Vladimir Serbinenko - * grub-core/fs/ufs.c: Remove variable length arrays. + * VasEBoot-core/fs/ufs.c: Remove variable length arrays. 2013-10-20 Vladimir Serbinenko - * grub-core/fs/ntfs.c: Add comment about fixed allocation size. + * VasEBoot-core/fs/ntfs.c: Add comment about fixed allocation size. 2013-10-20 Vladimir Serbinenko - * grub-core/fs/zfs.c: Remove variable length arrays. + * VasEBoot-core/fs/zfs.c: Remove variable length arrays. Reduces zfs.mod by 160 bytes (208 compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (check_pool_label): Fix memory leak. + * VasEBoot-core/fs/zfs/zfs.c (check_pool_label): Fix memory leak. 2013-10-20 Vladimir Serbinenko - * grub-core/net/arp.c: Remove variable length arrays. - * grub-core/net/bootp.c: Likewise. - * grub-core/net/dns.c: Likewise. - * grub-core/net/icmp6.c: Likewise. - * grub-core/net/net.c: Likewise. + * VasEBoot-core/net/arp.c: Remove variable length arrays. + * VasEBoot-core/net/bootp.c: Likewise. + * VasEBoot-core/net/dns.c: Likewise. + * VasEBoot-core/net/icmp6.c: Likewise. + * VasEBoot-core/net/net.c: Likewise. 2013-10-20 Vladimir Serbinenko - * grub-core/fs/ntfs.c: Remove variable length arrays. + * VasEBoot-core/fs/ntfs.c: Remove variable length arrays. Increases ntfs.mod by 64 bytes (but decreases by 3 when compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/hfs.c: Remove variable length arrays. + * VasEBoot-core/fs/hfs.c: Remove variable length arrays. Reduces hfs.mod by 8 bytes (52 compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/udf.c: Remove variable length arrays. + * VasEBoot-core/fs/udf.c: Remove variable length arrays. Increases udf.mod by 128 bytes (but decreases by 13 when compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/iso9660.c: Remove variable length arrays. + * VasEBoot-core/fs/iso9660.c: Remove variable length arrays. Increases iso9660.mod by 200 bytes (but decreases by 79 when compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/nilfs2.c: Remove variable length arrays. + * VasEBoot-core/fs/nilfs2.c: Remove variable length arrays. Increases nilfs2.mod by 24 bytes (but decreases by 115 when compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/xfs.c: Remove variable length arrays. + * VasEBoot-core/fs/xfs.c: Remove variable length arrays. Reduces xfs.mod by 40 bytes (43 compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/fshelp.c: Remove variable length arrays. + * VasEBoot-core/fs/fshelp.c: Remove variable length arrays. Reduces fshelp.mod by 116 bytes (23 compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/normal/completion.c: Remove variable length arrays. - * grub-core/normal/menu_entry.c: Likewise. + * VasEBoot-core/normal/completion.c: Remove variable length arrays. + * VasEBoot-core/normal/menu_entry.c: Likewise. Reduces normal.mod by 496 bytes. 2013-10-20 Vladimir Serbinenko - * grub-core/fs/minix.c: Remove variable length arrays. Reduces jfs.mod + * VasEBoot-core/fs/minix.c: Remove variable length arrays. Reduces jfs.mod by 356 bytes (158 compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/jfs.c: Remove variable length arrays. Reduces jfs.mod + * VasEBoot-core/fs/jfs.c: Remove variable length arrays. Reduces jfs.mod by 364 bytes (169 compressed). 2013-10-20 Vladimir Serbinenko - * grub-core/fs/bfs.c: Remove variable length arrays. Reduces afs.mod and + * VasEBoot-core/fs/bfs.c: Remove variable length arrays. Reduces afs.mod and bfs.mod size by 556 resp 740 bytes (288 resp 334 compressed). - * include/grub/types.h (grub_unaligned_uint64_t): New type. + * include/VasEBoot/types.h (VasEBoot_unaligned_uint64_t): New type. 2013-10-19 Vladimir Serbinenko @@ -4505,19 +4505,19 @@ 2013-10-19 Vladimir Serbinenko - * grub-core/osdep/unix/exec.c: Fix compilation error on emu. + * VasEBoot-core/osdep/unix/exec.c: Fix compilation error on emu. 2013-10-19 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Fix formatting of + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Fix formatting of "(null)" string. Simplify expressions to save around 256 bytes in kernel.img. * tests/printf_unit_test.c (printf_test): Add "(null)" tests. 2013-10-19 Vladimir Serbinenko - * grub-core/tests/video_checksum.c (grub_video_capture_write_bmp): - Use GRUB_UTIL_FD_O_* rather than O_*. + * VasEBoot-core/tests/video_checksum.c (VasEBoot_video_capture_write_bmp): + Use VasEBoot_UTIL_FD_O_* rather than O_*. 2013-10-19 Vladimir Serbinenko @@ -4525,7 +4525,7 @@ 2013-10-19 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c: Remove few leftover includes. + * VasEBoot-core/kern/emu/hostdisk.c: Remove few leftover includes. 2013-10-19 Vladimir Serbinenko @@ -4540,42 +4540,42 @@ 2013-10-19 Vladimir Serbinenko - * grub-core/osdep/aros/hostdisk.c (grub_util_is_directory): + * VasEBoot-core/osdep/aros/hostdisk.c (VasEBoot_util_is_directory): New function. - (grub_util_is_special_file): Likewise. + (VasEBoot_util_is_special_file): Likewise. 2013-10-19 Vladimir Serbinenko - * grub-core/osdep/unix/getroot.c: Move exec functions to ... + * VasEBoot-core/osdep/unix/getroot.c: Move exec functions to ... * osdep/unix/exec.c: ... here. Add few additional exec_* variants. 2013-10-19 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h: Define size_t to - grub_size_t. This fixes the case when size_t mismatches grub_size_t. + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h: Define size_t to + VasEBoot_size_t. This fixes the case when size_t mismatches VasEBoot_size_t. 2013-10-19 Vladimir Serbinenko - * util/grub-mkimagexx.c (make_reloc_section): Fix memory leak. + * util/VasEBoot-mkimagexx.c (make_reloc_section): Fix memory leak. (load_image): Likewise. 2013-10-19 Vladimir Serbinenko - * util/grub-render-label.c: Move backend part to ... + * util/VasEBoot-render-label.c: Move backend part to ... * util/render-label.c: ... here. 2013-10-18 Vladimir Serbinenko - * grub-core/osdep/random.c: Use unix/random.c on haiku. Haiku uses + * VasEBoot-core/osdep/random.c: Use unix/random.c on haiku. Haiku uses yarrow (by B. Schneier et al) for its /dev/urandom (similar to FreeBSD). 2013-10-18 Vladimir Serbinenko - * grub-core/osdep/generic/blocklist.c: Add missing include to string.h. + * VasEBoot-core/osdep/generic/blocklist.c: Add missing include to string.h. 2013-10-18 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Handle + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Handle CD-ROM in case when it's declared as having subpartitions. 2013-10-18 Vladimir Serbinenko @@ -4584,7 +4584,7 @@ * configure.ac: Define BUILD_LIBM to -lm on most platforms and empty on haiku. - * grub-core/Makefile.am (gentrigtables): Use $(BUILD_LIBM) rather than + * VasEBoot-core/Makefile.am (gentrigtables): Use $(BUILD_LIBM) rather than -lm. 2013-10-18 Vladimir Serbinenko @@ -4597,116 +4597,116 @@ 2013-10-18 Vladimir Serbinenko - * grub-core/kern/i386/pc/mmap.c (grub_machine_mmap_iterate): Pass + * VasEBoot-core/kern/i386/pc/mmap.c (VasEBoot_machine_mmap_iterate): Pass unknown types through. 2013-10-18 Vladimir Serbinenko - * grub-core/osdep/unix/getroot.c (grub_util_check_block_device): Remove. - (grub_util_check_char_device): Likewise. - * include/grub/emu/getroot.h: Likewise. + * VasEBoot-core/osdep/unix/getroot.c (VasEBoot_util_check_block_device): Remove. + (VasEBoot_util_check_char_device): Likewise. + * include/VasEBoot/emu/getroot.h: Likewise. 2013-10-18 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h: Use define for defining + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h: Use define for defining memset rather than inline static function. 2013-10-18 Vladimir Serbinenko - * grub-core/lib/xzembed/xz_config.h: Enable all bcj filters when + * VasEBoot-core/lib/xzembed/xz_config.h: Enable all bcj filters when not doing embedded decompressor. 2013-10-18 Vladimir Serbinenko - * grub-core/disk/ldm.c: Rename variables and arguments to prevent + * VasEBoot-core/disk/ldm.c: Rename variables and arguments to prevent shadowing. - * grub-core/kern/disk.c: Likewise. - * grub-core/kern/misc.c: Likewise. - * include/grub/parser.h: Likewise. - * include/grub/script_sh.h: Likewise. - * include/grub/zfs/zfs.h: Likewise. + * VasEBoot-core/kern/disk.c: Likewise. + * VasEBoot-core/kern/misc.c: Likewise. + * include/VasEBoot/parser.h: Likewise. + * include/VasEBoot/script_sh.h: Likewise. + * include/VasEBoot/zfs/zfs.h: Likewise. 2013-10-18 Vladimir Serbinenko - * grub-core/disk/luks.c (configure_ciphers): Fix spurious warning. + * VasEBoot-core/disk/luks.c (configure_ciphers): Fix spurious warning. 2013-10-18 Vladimir Serbinenko - * grub-core/fs/zfs/zfs_lz4.c: Check that __INTEL_COMPILER is + * VasEBoot-core/fs/zfs/zfs_lz4.c: Check that __INTEL_COMPILER is defined before trying to use it. 2013-10-18 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_create_node): Fix uninited value + * VasEBoot-core/fs/affs.c (VasEBoot_affs_create_node): Fix uninited value warning. 2013-10-18 Vladimir Serbinenko - * include/grub/dl.h: Remove double declaration of GRUB_MOD_DEP. + * include/VasEBoot/dl.h: Remove double declaration of VasEBoot_MOD_DEP. Use __unused__ rather than __used__ on gcc < 3.2. 2013-10-18 Vladimir Serbinenko - * include/grub/setjmp.h: Define RETURNS_TWICE. Keep it empty for + * include/VasEBoot/setjmp.h: Define RETURNS_TWICE. Keep it empty for gcc < 4.0. - * include/grub/*/setjmp.h: USe RETURNS_TWICE. + * include/VasEBoot/*/setjmp.h: USe RETURNS_TWICE. 2013-10-18 Vladimir Serbinenko - * grub-core/disk/dmraid_nvidia.c: Fix potentially uninited "layout". + * VasEBoot-core/disk/dmraid_nvidia.c: Fix potentially uninited "layout". 2013-10-18 Vladimir Serbinenko - * include/grub/misc.h: Don't use warn_unused_result on gcc < 3.4. - * include/grub/emu/misc.h: Likewise. + * include/VasEBoot/misc.h: Don't use warn_unused_result on gcc < 3.4. + * include/VasEBoot/emu/misc.h: Likewise. 2013-10-18 Vladimir Serbinenko - * grub-core/term/i386/pc/vga_text.c: Remove extra declaration of + * VasEBoot-core/term/i386/pc/vga_text.c: Remove extra declaration of cur_color. 2013-10-18 Vladimir Testov - * grub-core/tests/checksums.h: Regenerated due to progress bar + * VasEBoot-core/tests/checksums.h: Regenerated due to progress bar get_minimal_size changes. 2013-10-17 BVK Chaitanya Added `tr' command support. - * grub-core/commands/tr.c: New file. - * grub-core/Makefile.core.def: Build rules for new module. + * VasEBoot-core/commands/tr.c: New file. + * VasEBoot-core/Makefile.core.def: Build rules for new module. - * tests/grub_cmd_tr.in: New test. + * tests/VasEBoot_cmd_tr.in: New test. * Makefile.util.def: Build rules for new test. 2013-10-17 Vladimir Testov - * grub-core/gfxmenu/gui_progress_bar.c: Sanity checks added. + * VasEBoot-core/gfxmenu/gui_progress_bar.c: Sanity checks added. 2013-10-17 Vladimir Testov - * grub-core/gfxmenu/gui_progress_bar.c: New option ``highlight_overlay`` + * VasEBoot-core/gfxmenu/gui_progress_bar.c: New option ``highlight_overlay`` * docs/gurb.texi: Likewise. 2013-10-17 Vladimir Testov - * grub-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Fixed bug. + * VasEBoot-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Fixed bug. Pixmap highlighted section with east and west slices was displayed incorrectly due to negative width of the central slice. 2013-10-17 Vladimir Testov - * docs/grub.texi: Graphical options information update. + * docs/VasEBoot.texi: Graphical options information update. Removed outdated. Updated current. Inserted missed. 2013-10-17 Vladimir Serbinenko - * docs/grub.texi: Mention few new platform-specific commands. + * docs/VasEBoot.texi: Mention few new platform-specific commands. 2013-10-17 Vladimir Serbinenko - * grub-core/script/yylex.l: Fix LSQBR2 and RSQBR2. It's not + * VasEBoot-core/script/yylex.l: Fix LSQBR2 and RSQBR2. It's not currently used so this doesn't really have any effect. Reported by: Douglas Ray @@ -4725,46 +4725,46 @@ 2013-10-16 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: Scrollbar sanity checks added. + * VasEBoot-core/gfxmenu/gui_list.c: Scrollbar sanity checks added. 2013-10-16 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: New option `item_pixmap_style`. - * docs/grub.texi: Likewise. + * VasEBoot-core/gfxmenu/gui_list.c: New option `item_pixmap_style`. + * docs/VasEBoot.texi: Likewise. 2013-10-16 Vladimir Serbinenko - * grub-core/osdep/unix/hostdisk.c (grub_util_fd_read): Return correct + * VasEBoot-core/osdep/unix/hostdisk.c (VasEBoot_util_fd_read): Return correct value in case of incomplete read. - (grub_util_fd_write): Likewise. + (VasEBoot_util_fd_write): Likewise. 2013-10-15 Vladimir Serbinenko - * util/editenv.c (grub_util_create_envblk_file): Use grub_util_rename. + * util/editenv.c (VasEBoot_util_create_envblk_file): Use VasEBoot_util_rename. 2013-10-15 Vladimir Serbinenko - * util/grub-editenv.c (create_envblk_file): More from here ... - * util/editenv.c (grub_util_create_envblk_file): ... to here. + * util/VasEBoot-editenv.c (create_envblk_file): More from here ... + * util/editenv.c (VasEBoot_util_create_envblk_file): ... to here. 2013-10-15 Vladimir Serbinenko - * grub-core/osdep/unix/getroot.c (grub_guess_root_devices): + * VasEBoot-core/osdep/unix/getroot.c (VasEBoot_guess_root_devices): canonicalize file name before doing the rest. 2013-10-15 Vladimir Serbinenko - * include/grub/osdep/hostfile_windows.h: Add missing ftello for + * include/VasEBoot/osdep/hostfile_windows.h: Add missing ftello for mingw32. 2013-10-15 Vladimir Serbinenko - Define grub_util_is_directory/regular/special_file and + Define VasEBoot_util_is_directory/regular/special_file and use OS-dependent versions rather than to rely on stat(). 2013-10-15 Vladimir Serbinenko - * util/grub-mkimage.c: Move backend part to ... + * util/VasEBoot-mkimage.c: Move backend part to ... * util/mkimage.c: ... here. 2013-10-15 Vladimir Serbinenko @@ -4772,12 +4772,12 @@ Allow compilation with mingw64 albeit with warnings due to lack of %llx/%llu. - * grub-core/gnulib/msvc-inval.c: Use __cdecl rather than cdecl. - * grub-core/lib/posix_wrap/wchar.h: Define wint_t. - * grub-core/lib/posix_wrap/wctype.h: Define wctype_t. - * include/grub/osdep/hostfile_windows.h: Don't define fseeko/ftello + * VasEBoot-core/gnulib/msvc-inval.c: Use __cdecl rather than cdecl. + * VasEBoot-core/lib/posix_wrap/wchar.h: Define wint_t. + * VasEBoot-core/lib/posix_wrap/wctype.h: Define wctype_t. + * include/VasEBoot/osdep/hostfile_windows.h: Don't define fseeko/ftello on mingw64. - * include/grub/types.h: Allow sizeof (long) != sizeof (void *). + * include/VasEBoot/types.h: Allow sizeof (long) != sizeof (void *). 2013-10-15 Vladimir Serbinenko @@ -4785,41 +4785,41 @@ 2013-10-15 Vladimir Serbinenko - * grub-core/disk/geli.c (grub_util_get_geli_uuid): Close handle after + * VasEBoot-core/disk/geli.c (VasEBoot_util_get_geli_uuid): Close handle after read. 2013-10-15 Vladimir Serbinenko - * grub-core/disk/cryptodisk.c: Use grub_util_fd_strerror instead + * VasEBoot-core/disk/cryptodisk.c: Use VasEBoot_util_fd_strerror instead of strerror. 2013-10-15 Vladimir Serbinenko Split out blocklist retrieving from setup.c to - grub-core/osdep/blocklist.c and add windows implementation since + VasEBoot-core/osdep/blocklist.c and add windows implementation since generic version doesn't work on NTFS on Windows due to aggressive unflushable cache. 2013-10-15 Vladimir Serbinenko - Split grub-setup.c into frontend (grub-setup.c) and backend (setup.c) + Split VasEBoot-setup.c into frontend (VasEBoot-setup.c) and backend (setup.c) files. 2013-10-15 Vladimir Serbinenko - * grub-core/osdep/windows/hostdisk.c (grub_util_fd_strerror): + * VasEBoot-core/osdep/windows/hostdisk.c (VasEBoot_util_fd_strerror): Cut tailing newline. Remove arbitrary limitation. Always use - grub_util_tchar_to_utf8. + VasEBoot_util_tchar_to_utf8. 2013-10-15 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Handle %% properly. + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Handle %% properly. * tests/printf_unit_test.c (printf_test): Add %% tests. Reported by: Paulo Flabiano Smorigo. 2013-10-15 Vladimir Serbinenko - * grub-core/osdep/windows/hostdisk.c (fsync) [__MINGW32__]: Really + * VasEBoot-core/osdep/windows/hostdisk.c (fsync) [__MINGW32__]: Really implement fsync. 2013-10-15 Vladimir Serbinenko @@ -4834,47 +4834,47 @@ 2013-10-15 Vladimir Serbinenko - * include/grub/emu/hostdisk.h: Move file operations to - * include/grub/emu/hostfile.h: ... here. + * include/VasEBoot/emu/hostdisk.h: Move file operations to + * include/VasEBoot/emu/hostfile.h: ... here. 2013-10-15 Vladimir Serbinenko - * grub-core/osdep/windows/hostdisk.c (canonicalize_file_name): Handle + * VasEBoot-core/osdep/windows/hostdisk.c (canonicalize_file_name): Handle unicode path. 2013-10-15 Vladimir Serbinenko - * grub-core/tests/checksums.h: Regenerate due to swiss.sed change. + * VasEBoot-core/tests/checksums.h: Regenerate due to swiss.sed change. 2013-10-15 Vladimir Serbinenko - Move cpu time retrieval to separate grub_util_get_cpu_time_ms + Move cpu time retrieval to separate VasEBoot_util_get_cpu_time_ms and remove export.h. 2013-10-15 Vladimir Serbinenko - * grub-core/kern/emu/error.c: Removed. - * grub-core/Makefile.core.def (kernel): Don't add error.c and progname.c + * VasEBoot-core/kern/emu/error.c: Removed. + * VasEBoot-core/Makefile.core.def (kernel): Don't add error.c and progname.c explicitly as it's already in libgnu.a. 2013-10-15 Vladimir Serbinenko - * grub-core/osdep/windows/emuconsole.c: Add missing config.h and + * VasEBoot-core/osdep/windows/emuconsole.c: Add missing config.h and config-util.h include. 2013-10-15 Vladimir Serbinenko - Split emunet into platform-dependent and GRUB-binding parts. Keep + Split emunet into platform-dependent and VasEBoot-binding parts. Keep platform-dependent part in kernel for easy access to OS functions. 2013-10-15 Vladimir Serbinenko - * grub-core/tests/video_checksum.c: Use grub_util_fd_* rather than + * VasEBoot-core/tests/video_checksum.c: Use VasEBoot_util_fd_* rather than open/read/write. 2013-10-14 Vladimir Serbinenko - * grub-core/osdep/windows/emuconsole.c: New file. + * VasEBoot-core/osdep/windows/emuconsole.c: New file. 2013-10-14 Andrey Borzenkov @@ -4886,13 +4886,13 @@ 2013-10-14 Vladimir Serbinenko - * util/grub-probe.c (probe): Separate different drives in hint-str + * util/VasEBoot-probe.c (probe): Separate different drives in hint-str by spaces and not newlines. - * util/grub-mkconfig_lib.in: Handle multidevice filesystem. + * util/VasEBoot-mkconfig_lib.in: Handle multidevice filesystem. 2013-10-14 Andrey Borzenkov - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Handle CD-ROMs. 2013-10-14 Vladimir Serbinenko @@ -4902,52 +4902,52 @@ 2013-10-14 Andrey Borzenkov - * Makefile.util.def: Add osdep/init.c to grub-mount files. + * Makefile.util.def: Add osdep/init.c to VasEBoot-mount files. 2013-10-14 Vladimir Serbinenko - Make grub_util_fd_seek match behaviour of other grub_util_fd_* and + Make VasEBoot_util_fd_seek match behaviour of other VasEBoot_util_fd_* and fseeko. 2013-10-14 qwertial - * grub-core/gdb_grub.in: Fix overflow and wrong field. + * VasEBoot-core/gdb_VasEBoot.in: Fix overflow and wrong field. 2013-10-14 Jon McCune - * docs/grub.texi: Document new signatures possibility. + * docs/VasEBoot.texi: Document new signatures possibility. 2013-10-14 Vladimir Serbinenko - Define GRUB_UTIL_FD_O_* and always use them with grub_util_fd_open. + Define VasEBoot_UTIL_FD_O_* and always use them with VasEBoot_util_fd_open. 2013-10-14 Vladimir Serbinenko - * include/grub/osdep/hostfile_windows.h (grub_util_utf8_to_tchar): Add + * include/VasEBoot/osdep/hostfile_windows.h (VasEBoot_util_utf8_to_tchar): Add missing prototype. - (grub_util_tchar_to_utf8): Likewise. + (VasEBoot_util_tchar_to_utf8): Likewise. 2013-10-14 Vladimir Serbinenko - * grub-core/Makefile.core.def: Add osdep/init.c on emu. - * grub-core/kern/emu/main.c: Add missing include. - * grub-core/osdep/basic/init.c (grub_util_host_init) [!GRUB_UTIL]: - Don't call grub_util_init_nls. - * grub-core/osdep/windows/init.c (grub_util_host_init) [!GRUB_UTIL]: + * VasEBoot-core/Makefile.core.def: Add osdep/init.c on emu. + * VasEBoot-core/kern/emu/main.c: Add missing include. + * VasEBoot-core/osdep/basic/init.c (VasEBoot_util_host_init) [!VasEBoot_UTIL]: + Don't call VasEBoot_util_init_nls. + * VasEBoot-core/osdep/windows/init.c (VasEBoot_util_host_init) [!VasEBoot_UTIL]: Likewise. 2013-10-13 Vladimir Serbinenko - * util/misc.c (grub_util_get_image_size): Use FILE functions rather than + * util/misc.c (VasEBoot_util_get_image_size): Use FILE functions rather than stat. 2013-10-13 Vladimir Serbinenko - * util/grub-editenv.c: Remove leftover set_program_name and init_nls. + * util/VasEBoot-editenv.c: Remove leftover set_program_name and init_nls. 2013-10-13 Vladimir Serbinenko - * include/grub/misc.h: Use gnu_printf only on gcc 4.4 or later. + * include/VasEBoot/misc.h: Use gnu_printf only on gcc 4.4 or later. 2013-10-13 Vladimir Serbinenko @@ -4961,20 +4961,20 @@ 2013-10-12 Andrey Borzenkov - Fix inconsistent use of GRUB_CRYPTODISK_ENABLE and - GRUB_ENABLE_CRYPTODISK. + Fix inconsistent use of VasEBoot_CRYPTODISK_ENABLE and + VasEBoot_ENABLE_CRYPTODISK. - * util/grub-install.in: Rename all GRUB_CRYPTODISK_ENABLE to - GRUB_ENABLE_CRYPTODISK. - * util/grub-mkconfig_lib.in: Likewise. + * util/VasEBoot-install.in: Rename all VasEBoot_CRYPTODISK_ENABLE to + VasEBoot_ENABLE_CRYPTODISK. + * util/VasEBoot-mkconfig_lib.in: Likewise. 2013-10-12 Christian Cier-Zniewski - * docs/grub.texi (Vendor power-on keys): Add Dell Latitude E4300. + * docs/VasEBoot.texi (Vendor power-on keys): Add Dell Latitude E4300. 2013-10-12 Melki Christian - * grub-core/term/at_keyboard.c [DEBUG_AT_KEYBOARD]: Fix compilation + * VasEBoot-core/term/at_keyboard.c [DEBUG_AT_KEYBOARD]: Fix compilation error when enabling debug. 2013-10-12 Ilya Bakulin @@ -4983,26 +4983,26 @@ 2013-10-12 Vladimir Serbinenko - * grub-core/kern/arm/dl_helper.c: Use more proper %p for pointer. + * VasEBoot-core/kern/arm/dl_helper.c: Use more proper %p for pointer. 2013-10-12 Vladimir Serbinenko - * include/grub/misc.h: Use gnu_printf rather than printf as format + * include/VasEBoot/misc.h: Use gnu_printf rather than printf as format template since our functions are independent of libc. 2013-10-11 Vladimir Serbinenko - * util/grub-setup.c (setup): Move copying of partition table as + * util/VasEBoot-setup.c (setup): Move copying of partition table as futher up as possible to avoid possible overwrite by floppy routines. 2013-10-11 Vladimir Serbinenko - * grub-core/fs/fat.c: Fix handling of exfat contiguous files. + * VasEBoot-core/fs/fat.c: Fix handling of exfat contiguous files. 2013-10-10 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: New option `scrollbar_thumb_overlay`. - * docs/grub.texi: Likewise. + * VasEBoot-core/gfxmenu/gui_list.c: New option `scrollbar_thumb_overlay`. + * docs/VasEBoot.texi: Likewise. 2013-10-10 Vladimir Serbinenko @@ -5011,27 +5011,27 @@ 2013-10-10 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c: Remove temporary buffers for hex - version of salt and hash. Use grub_snprintf rather than snprintf. + * util/VasEBoot-mkpasswd-pbkdf2.c: Remove temporary buffers for hex + version of salt and hash. Use VasEBoot_snprintf rather than snprintf. 2013-10-10 Vladimir Serbinenko - * docs/grub.texi: Fix problem with braces. + * docs/VasEBoot.texi: Fix problem with braces. 2013-10-10 Vladimir Serbinenko * conf/Makefile.extra-dist: Fix extra-dist list. - * grub-core/Makefile.core.def: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. 2013-10-10 Vladimir Serbinenko - * docs/grub.texi: Document disk names used on Windows and AROS. + * docs/VasEBoot.texi: Document disk names used on Windows and AROS. 2013-10-10 Vladimir Serbinenko - * grub-core/osdep/aros/getroot.c: Change to //: prefix as discussed + * VasEBoot-core/osdep/aros/getroot.c: Change to //: prefix as discussed with AROS devs. - * grub-core/osdep/aros/hostdisk.c: Likewise. + * VasEBoot-core/osdep/aros/hostdisk.c: Likewise. 2013-10-10 Vladimir Serbinenko @@ -5041,104 +5041,104 @@ 2013-10-09 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: New options for scrollbar padding: + * VasEBoot-core/gfxmenu/gui_list.c: New options for scrollbar padding: scrollbar_left_pad, scrollbar_right_pad, scrollbar_top_pad, scrollbar_bottom_pad - * docs/grub.texi: Likewise. + * docs/VasEBoot.texi: Likewise. 2013-10-09 Vladimir Testov - * grub-core/gfxmenu/gui_list.c (list_destroy): Fixed memory leak. + * VasEBoot-core/gfxmenu/gui_list.c (list_destroy): Fixed memory leak. 2013-10-09 Vladimir Serbinenko - Move OS-dependent file definitions to include/grub/osdep/hostfile*.h. + Move OS-dependent file definitions to include/VasEBoot/osdep/hostfile*.h. 2013-10-09 Vladimir Serbinenko - * include/grub/emu/hostdisk.h (grub_hostdisk_linux_find_partition): + * include/VasEBoot/emu/hostdisk.h (VasEBoot_hostdisk_linux_find_partition): Removed. - * grub-core/osdep/linux/hostdisk.c (grub_hostdisk_linux_find_partition): + * VasEBoot-core/osdep/linux/hostdisk.c (VasEBoot_hostdisk_linux_find_partition): Made static. 2013-10-09 Vladimir Serbinenko - * include/grub/emu/getroot.h (grub_util_find_hurd_root_device): Remove + * include/VasEBoot/emu/getroot.h (VasEBoot_util_find_hurd_root_device): Remove leftover. 2013-10-09 Vladimir Serbinenko - Move OS-specific driver configuration to grub_util_fd_open. This + Move OS-specific driver configuration to VasEBoot_util_fd_open. This moves OS-dependent parts from kern/emu/hostdisk.c to - grub-core/osdep/*/hostdisk.c. + VasEBoot-core/osdep/*/hostdisk.c. 2013-10-09 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Use size_t instead of - grub_size_t. - * util/grub-mkimagexx.c (locate_sections): Likewise. + * util/VasEBoot-mkimage.c (generate_image): Use size_t instead of + VasEBoot_size_t. + * util/VasEBoot-mkimagexx.c (locate_sections): Likewise. (load_image): Likewise. 2013-10-09 Vladimir Serbinenko - * util/misc.c (grub_util_write_image_at): Don't use PRIxGRUB_SIZE for + * util/misc.c (VasEBoot_util_write_image_at): Don't use PRIxVasEBoot_SIZE for size_t. - (grub_util_write_image): Likewise. + (VasEBoot_util_write_image): Likewise. 2013-10-08 Vladimir Serbinenko - * grub-core/osdep/basic/random.c: New file. Abort on an attempt to + * VasEBoot-core/osdep/basic/random.c: New file. Abort on an attempt to get random when no RNG is available. - * grub-core/osdep/random.c: Use basic/random.c on OS out of whitelist. + * VasEBoot-core/osdep/random.c: Use basic/random.c on OS out of whitelist. 2013-10-08 Vladimir Serbinenko - * include/grub/util/lvm.h: Removed. + * include/VasEBoot/util/lvm.h: Removed. 2013-10-08 Vladimir Serbinenko - * grub-core/kern/emu/misc.c (fsync) [__MINGW32__]: Move to ... - * grub-core/osdep/windows/hostdisk.c (fsync) [__MINGW32__]: ... here. + * VasEBoot-core/kern/emu/misc.c (fsync) [__MINGW32__]: Move to ... + * VasEBoot-core/osdep/windows/hostdisk.c (fsync) [__MINGW32__]: ... here. 2013-10-08 Vladimir Serbinenko - * grub-core/osdep/windows/sleep.c: Add missing config.h. + * VasEBoot-core/osdep/windows/sleep.c: Add missing config.h. 2013-10-08 Vladimir Serbinenko - * grub-core/kern/emu/misc.c (grub_get_rtc): Remove (it's a leftover). + * VasEBoot-core/kern/emu/misc.c (VasEBoot_get_rtc): Remove (it's a leftover). 2013-10-08 Vladimir Serbinenko - * grub-core/net/drivers/emu/emunet.c: Move to .. - * grub-core/osdep/linux/emunet.c: ..here. + * VasEBoot-core/net/drivers/emu/emunet.c: Move to .. + * VasEBoot-core/osdep/linux/emunet.c: ..here. 2013-10-08 Vladimir Serbinenko * util/ieee1275/ofpath.c: Move to ... - * grub-core/osdep/linux/ofpath.c: ..here, split stub into ... - * grub-core/osdep/basic/ofpath.c: ..here. + * VasEBoot-core/osdep/linux/ofpath.c: ..here, split stub into ... + * VasEBoot-core/osdep/basic/ofpath.c: ..here. 2013-10-08 Vladimir Serbinenko - Move password-querying (util-version) routines to grub-core/osdep. + Move password-querying (util-version) routines to VasEBoot-core/osdep. 2013-10-08 Vladimir Serbinenko - Move sleep routines to grub-core/osdep. + Move sleep routines to VasEBoot-core/osdep. 2013-10-08 Vladimir Serbinenko - Move OS-dependent files to grub-core/osdep and document it. + Move OS-dependent files to VasEBoot-core/osdep and document it. 2013-10-08 Vladimir Serbinenko - * grub-core/kern/emu/misc.c (canonicalize_file_name): Move to ... - * grub-core/kern/emu/hostdisk_*.c (canonicalize_file_name): ... here. + * VasEBoot-core/kern/emu/misc.c (canonicalize_file_name): Move to ... + * VasEBoot-core/kern/emu/hostdisk_*.c (canonicalize_file_name): ... here. 2013-10-08 Vladimir Serbinenko - * grub-core/kern/arm/misc.S: Remove leftover ARM and THUMB. + * VasEBoot-core/kern/arm/misc.S: Remove leftover ARM and THUMB. 2013-10-08 Vladimir Serbinenko @@ -5146,7 +5146,7 @@ 2013-10-08 Vladimir Serbinenko - * include/grub/setjmp.h: Remove leftover GRUBOF. + * include/VasEBoot/setjmp.h: Remove leftover VasEBootOF. 2013-10-08 Vladimir Serbinenko @@ -5155,12 +5155,12 @@ 2013-10-08 Vladimir Serbinenko - * grub-core/fs/zfs/zfs_lz4.c: Switch from ad-hoc endiannes and width - macros to GRUB ones. + * VasEBoot-core/fs/zfs/zfs_lz4.c: Switch from ad-hoc endiannes and width + macros to VasEBoot ones. 2013-10-08 Vladimir Testov - * grub-core/gfxmenu/gui_list.c (draw_scrollbar): Fixed rare + * VasEBoot-core/gfxmenu/gui_list.c (draw_scrollbar): Fixed rare occasional bug. If there are too many boot entries or too low scrollbar height then we need to use another formula to calculate the position and size of the scrollbar thumb. @@ -5171,40 +5171,40 @@ 2013-10-08 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: New option `scrollbar-slice`. - * docs/grub.texi: Likewise. + * VasEBoot-core/gfxmenu/gui_list.c: New option `scrollbar-slice`. + * docs/VasEBoot.texi: Likewise. 2013-10-08 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: Draw the scrollbar in a separate + * VasEBoot-core/gfxmenu/gui_list.c: Draw the scrollbar in a separate viewport. 2013-10-08 Vladimir Testov - * grub-core/gfxmenu/gui_list.c (list_get_minimal_size): Corrected + * VasEBoot-core/gfxmenu/gui_list.c (list_get_minimal_size): Corrected minimal width calculations. 2013-10-07 Vladimir Serbinenko - * docs/grub.texi: Update note on colors on emu console. + * docs/VasEBoot.texi: Update note on colors on emu console. 2013-10-07 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_get_file_block): Give GRUB_ERR_BAD_FS - for quadruple indirect rather than GRUB_ERR_NOT_IMPLEMENTED_YET as - it's FS and not GRUB limitation. + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_get_file_block): Give VasEBoot_ERR_BAD_FS + for quadruple indirect rather than VasEBoot_ERR_NOT_IMPLEMENTED_YET as + it's FS and not VasEBoot limitation. 2013-10-07 Vladimir Serbinenko - * grub-core/kern/arm/efi/startup.S: Remove thumb leftover. + * VasEBoot-core/kern/arm/efi/startup.S: Remove thumb leftover. 2013-10-07 Vladimir Serbinenko - * grub-core/kern/arm/efi/init.c: Rewrite timer fucntion. + * VasEBoot-core/kern/arm/efi/init.c: Rewrite timer fucntion. 2013-10-04 Samuel Thibault - * util/grub.d/10_hurd.in: Use `version_find_latest` to sort gnumach + * util/VasEBoot.d/10_hurd.in: Use `version_find_latest` to sort gnumach kernels by version order. 2013-10-04 Vladimir Serbinenko @@ -5226,29 +5226,29 @@ 2013-10-03 Vladimir Serbinenko - * grub-core/kern/arm/dl.c (do_relocations): Accept and ignore + * VasEBoot-core/kern/arm/dl.c (do_relocations): Accept and ignore R_ARM_V4BX. 2013-10-03 Vladimir Serbinenko - * grub-core/tests/video_checksum.c: Increase robustness to out of memory + * VasEBoot-core/tests/video_checksum.c: Increase robustness to out of memory condition. - * grub-core/tests/fake_input.c: Likewise. - * grub-core/tests/cmdline_cat_test.c: Likewise. + * VasEBoot-core/tests/fake_input.c: Likewise. + * VasEBoot-core/tests/cmdline_cat_test.c: Likewise. 2013-10-03 Vladimir Serbinenko - * grub-core/video/capture.c: Do not do finalization when .fini + * VasEBoot-core/video/capture.c: Do not do finalization when .fini is called as there is explicit capture_end. 2013-10-03 Vladimir Serbinenko - * grub-core/term/gfxterm.c: Add flag "functional" to skip input when + * VasEBoot-core/term/gfxterm.c: Add flag "functional" to skip input when changing windows to avoid crash. 2013-10-03 Vladimir Serbinenko - * grub-core/kern/arm/cache.c: Add v5 write-through cache support. + * VasEBoot-core/kern/arm/cache.c: Add v5 write-through cache support. 2013-10-03 Vladimir Serbinenko @@ -5260,22 +5260,22 @@ 2013-10-03 Vladimir Serbinenko - * autogen.sh: Add ./util/grub-gen-widthspec.c and - ./util/grub-gen-asciih.c to exclude list. + * autogen.sh: Add ./util/VasEBoot-gen-widthspec.c and + ./util/VasEBoot-gen-asciih.c to exclude list. 2013-10-03 Vladimir Serbinenko - * grub-core/gfxmenu/theme_loader.c (theme_set_string): Fix memory leak + * VasEBoot-core/gfxmenu/theme_loader.c (theme_set_string): Fix memory leak and don't mark error strings for translation. 2013-10-03 Vladimir Serbinenko - * grub-core/disk/uboot/ubootdisk.c (uboot_disk_open): Use grub_error + * VasEBoot-core/disk/uboot/ubootdisk.c (uboot_disk_open): Use VasEBoot_error properly in case of missing block size. 2013-10-03 Vladimir Serbinenko - * grub-core/lib/arm/setjmp.S: Add missing license section. + * VasEBoot-core/lib/arm/setjmp.S: Add missing license section. 2013-10-03 Vladimir Serbinenko @@ -5283,184 +5283,184 @@ 2013-10-02 Vladimir Testov - * grub-core/gfxmenu/theme_loader.c: New global options for the + * VasEBoot-core/gfxmenu/theme_loader.c: New global options for the theme background image handling. desktop-image-scale-method, desktop-image-h-align, desktop-image-v-align. - * grub-core/gfxmenu/view.c: Likewise. + * VasEBoot-core/gfxmenu/view.c: Likewise. * include/gfxmenu_view.h: Likewise. * include/bitmap_scale.h: Proportional scale functions introduced. - * grub-core/video/bitmap_scale.c: Likewise. Verification checks are - put in a separate functions. GRUB_ERR_BUG is set for grub_error in + * VasEBoot-core/video/bitmap_scale.c: Likewise. Verification checks are + put in a separate functions. VasEBoot_ERR_BUG is set for VasEBoot_error in cases of unexpected input variables for scale functions. - * docs/grub.texi: Updated documentation for new options. + * docs/VasEBoot.texi: Updated documentation for new options. 2013-10-02 Vladimir Serbinenko - * grub-core/video/readers/png.c: Support narrow (4-/2-/1-bpp) PNG. + * VasEBoot-core/video/readers/png.c: Support narrow (4-/2-/1-bpp) PNG. 2013-10-01 Vladimir Testov - * grub-core/tests/checksums.h: Corrected due to changes in + * VasEBoot-core/tests/checksums.h: Corrected due to changes in bilinear interpolation function. 2013-10-01 Vladimir Testov - * grub-core/video/bitmap_scale.c (scale_bilinear): Increased precision + * VasEBoot-core/video/bitmap_scale.c (scale_bilinear): Increased precision to eliminate artefacts in bilinear interpolation. 2013-09-28 Vladimir Serbinenko - * grub-core/video/readers/tga.c: Support paletted tga. + * VasEBoot-core/video/readers/tga.c: Support paletted tga. 2013-09-28 Vladimir Serbinenko - * grub-core/video/readers/jpeg.c (grub_jpeg_decode_data): Remove + * VasEBoot-core/video/readers/jpeg.c (VasEBoot_jpeg_decode_data): Remove incorrect cbcr setting when in color mode. 2013-09-28 Vladimir Serbinenko - * grub-core/video/readers/png.c: Support paletted images and clean up + * VasEBoot-core/video/readers/png.c: Support paletted images and clean up greyscale support. 2013-09-28 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_terminfo_readkey): Fix + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_readkey): Fix usage of wrong table which resulted in mishandling of 4-byte sequences. 2013-09-28 Vladimir Serbinenko - * grub-core/term/terminfo.c: Add Home and End key sequences. + * VasEBoot-core/term/terminfo.c: Add Home and End key sequences. 2013-09-27 Vladimir Serbinenko - * grub-core/video/readers/png.c (grub_png_decode_image_header): + * VasEBoot-core/video/readers/png.c (VasEBoot_png_decode_image_header): Fix formula for computing total number of bytes. 2013-09-27 Vladimir Serbinenko - * grub-core/video/readers/tga.c: Reorganize to separate RLE and + * VasEBoot-core/video/readers/tga.c: Reorganize to separate RLE and image processing, fix big-endian and support grayscale. 2013-09-27 Vladimir Serbinenko - * grub-core/video/fb/video_fb.c (grub_video_fb_create_render_target): + * VasEBoot-core/video/fb/video_fb.c (VasEBoot_video_fb_create_render_target): Correctly will with maximum transparency when using index color. 2013-09-27 Vladimir Serbinenko - * grub-core/video/readers/png.c: Support grayscale + * VasEBoot-core/video/readers/png.c: Support grayscale 2013-09-27 Vladimir Serbinenko - * grub-core/video/readers/jpeg.c: Support grayscale. + * VasEBoot-core/video/readers/jpeg.c: Support grayscale. 2013-09-26 Jon McCune - * grub-core/commands/loadenv.c: Support skipping signature check + * VasEBoot-core/commands/loadenv.c: Support skipping signature check and variable names filtering. 2013-09-24 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk_unix.c: Declare AROS as non-unix. - * grub-core/kern/emu/hostfs.c: Likewise. + * VasEBoot-core/kern/emu/hostdisk_unix.c: Declare AROS as non-unix. + * VasEBoot-core/kern/emu/hostfs.c: Likewise. * util/getroot_unix.c: Likewise. 2013-09-24 Vladimir Serbinenko - * include/grub/emu/hostdisk.h (GRUB_FD_STAT_IS_FUNTIONAL): New define. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_FD_STAT_IS_FUNTIONAL): New define. Migrate all explicit defines to this new one. 2013-09-24 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Use - grub_util_fd_strerror when using grub_util_fd_*. - (grub_util_fd_open_device): Likewise. - (grub_util_biosdisk_read): Likewise. - (grub_util_biosdisk_write): Likewise. - * grub-core/kern/emu/hostdisk_unix.c (grub_util_fd_open): New function. - (grub_util_fd_strerror): Likewise. - (grub_util_fd_sync): Likewise. - (grub_util_fd_close): Likewise. - * grub-core/kern/emu/hostdisk_windows.c (grub_util_fd_sync): Likewise. - (grub_util_fd_close): Likewise. - (grub_util_fd_strerror): Likewise. - * include/grub/emu/hostdisk.h (grub_util_fd_close): Make into real + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_open): Use + VasEBoot_util_fd_strerror when using VasEBoot_util_fd_*. + (VasEBoot_util_fd_open_device): Likewise. + (VasEBoot_util_biosdisk_read): Likewise. + (VasEBoot_util_biosdisk_write): Likewise. + * VasEBoot-core/kern/emu/hostdisk_unix.c (VasEBoot_util_fd_open): New function. + (VasEBoot_util_fd_strerror): Likewise. + (VasEBoot_util_fd_sync): Likewise. + (VasEBoot_util_fd_close): Likewise. + * VasEBoot-core/kern/emu/hostdisk_windows.c (VasEBoot_util_fd_sync): Likewise. + (VasEBoot_util_fd_close): Likewise. + (VasEBoot_util_fd_strerror): Likewise. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_fd_close): Make into real function proto rather than macro. - (grub_util_fd_sync): Likewise. - (grub_util_fd_open): Likewise. - (grub_util_fd_strerror): New proto. + (VasEBoot_util_fd_sync): Likewise. + (VasEBoot_util_fd_open): Likewise. + (VasEBoot_util_fd_strerror): New proto. 2013-09-24 Vladimir Serbinenko - * util/getroot.c (grub_util_biosdisk_is_present): Don't do stat on + * util/getroot.c (VasEBoot_util_biosdisk_is_present): Don't do stat on platforms on which it doesn't work. 2013-09-24 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Move struct + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_open): Move struct stat immediately to where it's used. 2013-09-24 Vladimir Serbinenko - * util/getroot.c (grub_util_check_block_device): Move to ... - * util/getroot_unix.c (grub_util_check_block_device): ... here. - * util/getroot.c (grub_util_check_char_device): Move to ... - * util/getroot_unix.c (grub_util_check_char_device): ... here. + * util/getroot.c (VasEBoot_util_check_block_device): Move to ... + * util/getroot_unix.c (VasEBoot_util_check_block_device): ... here. + * util/getroot.c (VasEBoot_util_check_char_device): Move to ... + * util/getroot_unix.c (VasEBoot_util_check_char_device): ... here. 2013-09-24 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_close): Fix + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_close): Fix disk closing logic. 2013-09-24 Andrey Borzenkov - * docs/grub.texi (Simple configuration): Document GRUB_ENABLE_CRYPTODISK. + * docs/VasEBoot.texi (Simple configuration): Document VasEBoot_ENABLE_CRYPTODISK. 2013-09-24 Andrey Borzenkov - * docs/grub.texi (File name syntax): Document ZFS filenames + * docs/VasEBoot.texi (File name syntax): Document ZFS filenames (/volume@snapshot/...). 2013-09-23 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk_windows.c (grub_util_get_windows_path): + * VasEBoot-core/kern/emu/hostdisk_windows.c (VasEBoot_util_get_windows_path): Always return full path. Fixes a problem with mkrelpath. 2013-09-23 Paulo Flabiano Smorigo - * util/grub-install.in: Add GPT PReP support. - * util/grub-probe.c (probe): Support GPT partition type. + * util/VasEBoot-install.in: Add GPT PReP support. + * util/VasEBoot-probe.c (probe): Support GPT partition type. (main): Support -t gpt_parttype. 2013-09-23 Aleš Nesrsta - * grub-core/bus/usb/ehci.c: SMI disabled in all cases + * VasEBoot-core/bus/usb/ehci.c: SMI disabled in all cases 2013-09-23 Massimo Maggi - * grub-core/fs/zfs/zfs.c (check_pool_label): Check nvlist. + * VasEBoot-core/fs/zfs/zfs.c (check_pool_label): Check nvlist. 2013-09-23 Tim Hardeck - * util/grub.d/10_hurd.in: Filter out character for the class. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Filter out character for the class. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2013-09-23 Melki Christian - * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Fix the type of + * VasEBoot-core/bus/usb/usbhub.c (poll_nonroot_hub): Fix the type of "changed". 2013-09-23 Josh Triplett - * grub-core/boot/i386/pc/lnxboot.S: Re-add support for recording the + * VasEBoot-core/boot/i386/pc/lnxboot.S: Re-add support for recording the boot partition. 2013-09-23 Vladimir Serbinenko - * Makefile.util.def (libgrubmods.a): Remove CFLAGS_POSIX as this lib + * Makefile.util.def (libVasEBootmods.a): Remove CFLAGS_POSIX as this lib doesn't use posix_wrap. Keep literal -fno-builtin however. 2013-09-23 Vladimir Serbinenko @@ -5482,13 +5482,13 @@ 2013-09-23 Vladimir Serbinenko - * grub-core/video/efi_gop.c (grub_video_gop_setup): Fix a typo which + * VasEBoot-core/video/efi_gop.c (VasEBoot_video_gop_setup): Fix a typo which desactivated use of EDID at all. 2013-09-23 Vladimir Serbinenko 2013-09-23 neil - * grub-core/loader/multiboot.c (grub_multiboot_set_console): Always use + * VasEBoot-core/loader/multiboot.c (VasEBoot_multiboot_set_console): Always use video if no text is available. 2013-09-23 Vladimir Serbinenko @@ -5499,14 +5499,14 @@ 2013-09-23 Vladimir Serbinenko 2013-09-23 neil - * grub-core/genmod.sh.in: Remove ./ from TARGET_OBJ2ELF. Add quotes. + * VasEBoot-core/genmod.sh.in: Remove ./ from TARGET_OBJ2ELF. Add quotes. Based on patches from AROS. 2013-09-23 Vladimir Serbinenko 2013-09-23 neil - * grub-core/Makefile.am: Override STRIP and RANLIB. + * VasEBoot-core/Makefile.am: Override STRIP and RANLIB. * configure.ac: compute TARGET_RANLIB. * INSTALL: Document TARGET_RANLIB @@ -5514,37 +5514,37 @@ 2013-09-23 Vladimir Serbinenko - * util/getroot.c (grub_util_biosdisk_get_grub_dev): Do not assume + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Do not assume that floppies are unpartitioned. 2013-09-23 Vladimir Serbinenko * util/getroot_unix.c [__MINGW32__ || __CYGWIN__]: - Define dummy grub_util_pull_lvm_by_command to decrease number of #if's. + Define dummy VasEBoot_util_pull_lvm_by_command to decrease number of #if's. 2013-09-23 Vladimir Serbinenko - * grub-core/lib/posix_wrap/sys/types.h: Use OpenBSD approach: it's + * VasEBoot-core/lib/posix_wrap/sys/types.h: Use OpenBSD approach: it's less nice but more portable. - * grub-core/lib/posix_wrap/wchar.h: Likewise. + * VasEBoot-core/lib/posix_wrap/wchar.h: Likewise. 2013-09-23 Vladimir Serbinenko - * include/grub/cryptodisk.h (grub_cryptodisk): Use grub_util_fd_t + * include/VasEBoot/cryptodisk.h (VasEBoot_cryptodisk): Use VasEBoot_util_fd_t for cheat_fd. - * grub-core/disk/cryptodisk.c (grub_cryptodisk_open): Use grub_util_* + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_cryptodisk_open): Use VasEBoot_util_* functions. - (grub_cryptodisk_cheat_insert): Likewise. - (grub_cryptodisk_close): Likewise. + (VasEBoot_cryptodisk_cheat_insert): Likewise. + (VasEBoot_cryptodisk_close): Likewise. 2013-09-23 Vladimir Serbinenko - * include/grub/emu/misc.h: Remove leftover cygwin definitions. + * include/VasEBoot/emu/misc.h: Remove leftover cygwin definitions. Use windows path for DEFAULT_DIRECTORY. 2013-09-23 Vladimir Serbinenko - * include/grub/i386/setjmp.h: Remove useless #if MINGW where original + * include/VasEBoot/i386/setjmp.h: Remove useless #if MINGW where original difference was likely just gcc version, not anything mingw-related. 2013-09-23 Vladimir Serbinenko @@ -5553,30 +5553,30 @@ 2013-09-22 Andrey Borzenkov - * util/grub-install.in: Add --grub-editenv option. - * util/grub-install_header (grub_compress_file): Explicitly check for + * util/VasEBoot-install.in: Add --VasEBoot-editenv option. + * util/VasEBoot-install_header (VasEBoot_compress_file): Explicitly check for plain file to avoid cp error. 2013-09-22 Andrey Borzenkov - * docs/grub.texi (Device syntax): Document new LVM UUID based device + * docs/VasEBoot.texi (Device syntax): Document new LVM UUID based device names; fix LVM driver name (lvm, not lv). - * util/grub-probe.c (probe_abstraction): Support lvmid/xxx device + * util/VasEBoot-probe.c (probe_abstraction): Support lvmid/xxx device names. 2013-09-22 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c: Disentagle into a series of OS-specific + * VasEBoot-core/kern/emu/hostdisk.c: Disentagle into a series of OS-specific files rather than one file with loads of #if's. * util/getroot.c: Likewise. 2013-09-22 Vladimir Serbinenko - * grub-core/lib/posix_wrap/sys/types.h: Use stddef on *BSD. + * VasEBoot-core/lib/posix_wrap/sys/types.h: Use stddef on *BSD. 2013-09-22 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c (grub_get_random): Add windows and + * util/VasEBoot-mkpasswd-pbkdf2.c (VasEBoot_get_random): Add windows and GNU/Hurd to the list of checked PRNG. 2013-09-22 Vladimir Serbinenko @@ -5585,26 +5585,26 @@ 2013-09-21 Ales Nesrsta - * grub-core/bus/usb/ehci.c: Corrected EHCI QH handling (async./sync.) + * VasEBoot-core/bus/usb/ehci.c: Corrected EHCI QH handling (async./sync.) 2013-09-20 Vladimir Serbinenko - * grub-core/disk/diskfilter.c: Handle non-md UUIDs. - * grub-core/disk/lvm.c: Add LVM UUIDs. + * VasEBoot-core/disk/diskfilter.c: Handle non-md UUIDs. + * VasEBoot-core/disk/lvm.c: Add LVM UUIDs. * util/getroot.c: Use LVM UUIDs whenever possible. 2013-09-19 Andrey Borzenkov - * docs/grub.texi (Networking commands): Add documentation for + * docs/VasEBoot.texi (Networking commands): Add documentation for network related commands. 2013-09-19 Vladimir Serbinenko - * util/getroot.c (grub_util_open_dm): Check major rather than the name + * util/getroot.c (VasEBoot_util_open_dm): Check major rather than the name to determine if device is handled by devmapper. (convert_system_partition_to_system_disk): Likewise. (get_dm_uuid): Don't check explicitly if device is mapped, it's - already done in grub_util_open_dm. + already done in VasEBoot_util_open_dm. 2013-09-19 Leif Lindholm @@ -5619,67 +5619,67 @@ Handle the case of partitioned LVM properly. - * grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_dm_node_linear_info): Stop on meeting LVM, mpath or DMRAID. - (grub_hostdisk_os_dev_to_grub_drive): Canonicalize os device. + (VasEBoot_hostdisk_os_dev_to_VasEBoot_drive): Canonicalize os device. (read_device_map): Likewise. * util/getroot.c (convert_system_partition_to_system_disk): Assume that device is full disk rather than erroring out on LVM and similar cases. 2013-09-18 Vladimir Serbinenko - * util/grub-mkconfig_lib.in: Keep supplied pkgdatadir if any. + * util/VasEBoot-mkconfig_lib.in: Keep supplied pkgdatadir if any. 2013-09-18 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_mm_init_region): Skip regions less than + * VasEBoot-core/kern/mm.c (VasEBoot_mm_init_region): Skip regions less than 4K before the end. Reported by: Leif Lindholm 2013-09-18 Pawel Wojtalczyk 2013-09-18 Vladimir Serbinenko - * grub-core/term/efi/console.c (grub_console_getkey): Accept VT100-style + * VasEBoot-core/term/efi/console.c (VasEBoot_console_getkey): Accept VT100-style codes. 2013-09-18 Colin Watson - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name_iter): + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name_iter): Remove no-longer-true __attribute__ ((unused)) on disk parameter. 2013-09-18 Douglas Ray - * util/grub-mkpasswd-pbkdf2.c (grub_get_random): Declare OpenBSD PRNG + * util/VasEBoot-mkpasswd-pbkdf2.c (VasEBoot_get_random): Declare OpenBSD PRNG as secure. 2013-09-18 Aleš Nesrsta - * docs/grub.texi: Fix broken link. + * docs/VasEBoot.texi: Fix broken link. 2013-09-18 Melki Christian - * grub-core/bus/usb/usb.c (grub_usb_device_initialize): Add condition + * VasEBoot-core/bus/usb/usb.c (VasEBoot_usb_device_initialize): Add condition to break endless loop. 2013-08-23 Vladimir Serbinenko - * util/grub-fstest.c: Fix several printf formats. - * util/grub-mkimage.c: Likewise. - * util/grub-mkimagexx.c: Likewise. - * util/grub-script-check.c: Likewise. + * util/VasEBoot-fstest.c: Fix several printf formats. + * util/VasEBoot-mkimage.c: Likewise. + * util/VasEBoot-mkimagexx.c: Likewise. + * util/VasEBoot-script-check.c: Likewise. 2013-08-23 Vladimir Serbinenko - * grub-core/lib/xzembed/xz_dec_lzma2.c: Make -Wattributes not cause + * VasEBoot-core/lib/xzembed/xz_dec_lzma2.c: Make -Wattributes not cause error. 2013-08-23 Vladimir Serbinenko - * config.h.in [GRUB_BUILD]: Explicitly undefine ENABLE_NLS. + * config.h.in [VasEBoot_BUILD]: Explicitly undefine ENABLE_NLS. 2013-08-23 Vladimir Serbinenko - * util/getroot.c (grub_find_device): Use cygwin_conv_path ratherthan + * util/getroot.c (VasEBoot_find_device): Use cygwin_conv_path ratherthan removed in current versions cygwin_conv_*. 2013-08-23 Vladimir Serbinenko @@ -5688,19 +5688,19 @@ 2013-08-23 Vladimir Serbinenko - * conf/Makefile.extra-dist: Add missing util/grub-gen-asciih.c, - util/grub-gen-widthspec.c and util/grub-pe2elf.c. + * conf/Makefile.extra-dist: Add missing util/VasEBoot-gen-asciih.c, + util/VasEBoot-gen-widthspec.c and util/VasEBoot-pe2elf.c. 2013-08-22 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c (grub_password_get): Remove extraneous + * util/VasEBoot-mkpasswd-pbkdf2.c (VasEBoot_password_get): Remove extraneous error message. 2013-08-22 Vladimir Serbinenko - * grub-core/lib/crypto.c (grub_password_get) [GRUB_UTIL]: Add + * VasEBoot-core/lib/crypto.c (VasEBoot_password_get) [VasEBoot_UTIL]: Add windows variant. - * util/grub-mkpasswd-pbkdf2.c: Add windows flavour for retrieving random + * util/VasEBoot-mkpasswd-pbkdf2.c: Add windows flavour for retrieving random data. 2013-08-22 Vladimir Serbinenko @@ -5717,12 +5717,12 @@ 2013-08-22 Vladimir Serbinenko - * util/grub-mkfont.c [!GRUB_BUILD]: Define my_argp_state. - [!GRUB_BUILD]: Remove has_argument. + * util/VasEBoot-mkfont.c [!VasEBoot_BUILD]: Define my_argp_state. + [!VasEBoot_BUILD]: Remove has_argument. 2013-08-22 Vladimir Serbinenko - * util/ieee1275/ofpath.c (grub_util_devname_to_ofpath) [_WIN32]: + * util/ieee1275/ofpath.c (VasEBoot_util_devname_to_ofpath) [_WIN32]: Replace with a dummy. 2013-08-22 Vladimir Serbinenko @@ -5735,40 +5735,40 @@ 2013-08-22 Vladimir Serbinenko - Handle grub-pe2elf and grub-mkfont for cases when build != host. + Handle VasEBoot-pe2elf and VasEBoot-mkfont for cases when build != host. - * Makefile.am (build-grub-mkfont): Don't include gnulib. - (build-grub-gen-asciih): Likewise. - (build-grub-gen-widthspec): Likewise. - * Makefile.util.def (grub-pe2elf): Remove. - * config.h.in [GRUB_BUILD]: Use build rather than host constants. + * Makefile.am (build-VasEBoot-mkfont): Don't include gnulib. + (build-VasEBoot-gen-asciih): Likewise. + (build-VasEBoot-gen-widthspec): Likewise. + * Makefile.util.def (VasEBoot-pe2elf): Remove. + * config.h.in [VasEBoot_BUILD]: Use build rather than host constants. * configure.ac: Separate tests for build. - Move ./build-grub-pe2elf to grub-core. + Move ./build-VasEBoot-pe2elf to VasEBoot-core. Fix typo. - * grub-core/Makefile.am (build-grub-pe2elf): New target. - * grub-core/kern/emu/misc.c (xasprintf): Don't compile if GRUB_BUILD is + * VasEBoot-core/Makefile.am (build-VasEBoot-pe2elf): New target. + * VasEBoot-core/kern/emu/misc.c (xasprintf): Don't compile if VasEBoot_BUILD is defined. - * include/grub/types.h [GRUB_BUILD]: Use build rather than host + * include/VasEBoot/types.h [VasEBoot_BUILD]: Use build rather than host constants. - * util/grub-mkfont.c [GRUB_BUILD]: Simplify not to rely on argp. - * util/grub-pe2elf.c: Simplify not to rely on getopt. - * util/misc.c (program_name) [GRUB_BUILD]: Define to static string. + * util/VasEBoot-mkfont.c [VasEBoot_BUILD]: Simplify not to rely on argp. + * util/VasEBoot-pe2elf.c: Simplify not to rely on getopt. + * util/misc.c (program_name) [VasEBoot_BUILD]: Define to static string. 2013-08-22 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_size): Adapt for - mingw32 as well based on grub_util_get_disk_size. - * util/misc.c (grub_util_get_disk_size): Removed. all users switched to - grub_util_get_fd_size. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_size): Adapt for + mingw32 as well based on VasEBoot_util_get_disk_size. + * util/misc.c (VasEBoot_util_get_disk_size): Removed. all users switched to + VasEBoot_util_get_fd_size. (sync): Removed. (fsync): Moved to ... - * grub-core/kern/emu/misc.c (fsync): ... here. + * VasEBoot-core/kern/emu/misc.c (fsync): ... here. 2013-08-22 Vladimir Serbinenko - * include/grub/mm.h (grub_extend_alloc): Remove. - * grub-core/loader/i386/pc/plan9.c: Use own version of - grub_extend_alloc with appropriate types. + * include/VasEBoot/mm.h (VasEBoot_extend_alloc): Remove. + * VasEBoot-core/loader/i386/pc/plan9.c: Use own version of + VasEBoot_extend_alloc with appropriate types. 2013-08-22 Vladimir Serbinenko @@ -5784,22 +5784,22 @@ * gentpl.py: Support variable dependencies. Add $TARGET_OBJ2ELF to dependencies when used and defined. - * grub-core/Makefile.core.def (regexp): Add dependency on libgnulib.a. + * VasEBoot-core/Makefile.core.def (regexp): Add dependency on libgnulib.a. 2013-08-22 Vladimir Serbinenko - * include/grub/zfs/spa.h (zio_cksum): Add explicit members for mac. - * grub-core/fs/zfs/zfs.c (zio_read): Don't use casts to retrieve mac. + * include/VasEBoot/zfs/spa.h (zio_cksum): Add explicit members for mac. + * VasEBoot-core/fs/zfs/zfs.c (zio_read): Don't use casts to retrieve mac. 2013-08-22 Vladimir Serbinenko - * grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no + * VasEBoot-core/kern/emu/mm.c (VasEBoot_memalign): Don't define if there is no implementation available to cause compile-time rather than runtime error. 2013-08-22 Vladimir Serbinenko - * util/grub-fstest.c: Don't check for symlinks on windows. + * util/VasEBoot-fstest.c: Don't check for symlinks on windows. 2013-08-22 Vladimir Serbinenko @@ -5807,9 +5807,9 @@ 2013-08-22 Vladimir Serbinenko - * include/grub/crypto.h: Don't declare gcry_log_bug, gcry_log_printf + * include/VasEBoot/crypto.h: Don't declare gcry_log_bug, gcry_log_printf and gcry_log_bug. - * grub-core/lib/libgcrypt_wrap/mem.c: Include g10lib.h + * VasEBoot-core/lib/libgcrypt_wrap/mem.c: Include g10lib.h 2013-08-21 Vladimir Serbinenko @@ -5818,9 +5818,9 @@ * configure.ac: Add TARGET_ to all variables pertaining to target that don't have it yet. * gentpl.py: Likewise. - * grub-core/Makefile.am: Likewise. - * grub-core/genmod.sh.in: Likewise. - * grub-core/gensyminfo.sh.in: Handle OpenBSD and other non-GNU nm + * VasEBoot-core/Makefile.am: Likewise. + * VasEBoot-core/genmod.sh.in: Likewise. + * VasEBoot-core/gensyminfo.sh.in: Handle OpenBSD and other non-GNU nm as well. 2013-08-21 Ilya Bakulin @@ -5830,20 +5830,20 @@ 2013-08-21 Ilya Bakulin - * grub-core/kern/emu/hostdisk.c: Add conditionals for OpenBSD. + * VasEBoot-core/kern/emu/hostdisk.c: Add conditionals for OpenBSD. * util/getroot.c: Likewise. 2013-08-21 Vladimir Serbinenko - * grub-core/disk/ahci.c: Add needed explicit cast. - * grub-core/lib/backtrace.c: Likewise. - * grub-core/net/ip.c: Likewise. - * grub-core/net/tcp.c: Likewise. - * grub-core/net/udp.c: Likewise. + * VasEBoot-core/disk/ahci.c: Add needed explicit cast. + * VasEBoot-core/lib/backtrace.c: Likewise. + * VasEBoot-core/net/ip.c: Likewise. + * VasEBoot-core/net/tcp.c: Likewise. + * VasEBoot-core/net/udp.c: Likewise. 2013-08-21 Vladimir Serbinenko - * grub-core/lib/posix_wrap/wchar.h: Fix typo. + * VasEBoot-core/lib/posix_wrap/wchar.h: Fix typo. 2013-08-21 Vladimir Serbinenko @@ -5855,12 +5855,12 @@ 2013-08-21 Vladimir Serbinenko - * Makefile.util.def (grub-mkfont): Add missing libgnu.a. + * Makefile.util.def (VasEBoot-mkfont): Add missing libgnu.a. 2013-08-21 Vladimir Serbinenko * Makefile.am (widthspec.h): Fix typo. - * util/grub-gen-widthspec.c: Likewise. + * util/VasEBoot-gen-widthspec.c: Likewise. 2013-08-21 Vladimir Serbinenko @@ -5869,7 +5869,7 @@ 2013-08-16 Grégoire Sutre - * grub-core/loader/i386/bsd.c (grub_netbsd_add_boot_disk_and_wedge): + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_netbsd_add_boot_disk_and_wedge): Always fill bootdisk info and improve check for NetBSD disklabel. 2013-08-16 Vladimir Serbinenko @@ -5887,44 +5887,44 @@ 2013-08-16 Vladimir Serbinenko - * grub-core/lib/posix_wrap/wchar.h: Fix wchar_t and mbstate_t conflict + * VasEBoot-core/lib/posix_wrap/wchar.h: Fix wchar_t and mbstate_t conflict on NetBSD and OpenBSD. 2013-08-15 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: Baseline misplacement fixed. + * VasEBoot-core/gfxmenu/gui_list.c: Baseline misplacement fixed. 2013-08-15 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: The number of color mappings is + * VasEBoot-core/gfxmenu/gui_list.c: The number of color mappings is reduced. Inheritant options are processed during the theme loading. 2013-08-15 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: Minimal width fixed. + * VasEBoot-core/gfxmenu/gui_list.c: Minimal width fixed. 2013-08-14 Avik Sil - * grub-core/net/tftp.c: Send tftp ack packet before closing the socket. + * VasEBoot-core/net/tftp.c: Send tftp ack packet before closing the socket. 2013-08-14 Avik Sil - * grub-core/net/drivers/ieee1275/ofnet.c: Get proper mac address when + * VasEBoot-core/net/drivers/ieee1275/ofnet.c: Get proper mac address when using qemu. 2013-08-14 Paulo Flabiano Smorigo - * .bzrignore: Add bootinfo.txt, grub.chrp, gnulib/float.h, and + * .bzrignore: Add bootinfo.txt, VasEBoot.chrp, gnulib/float.h, and remove-potcdate.sed. 2013-08-14 Andrey Borzenkov - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Remove + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_iterate): Remove unused attribute from pull argument. 2013-08-14 Andrey Borzenkov - * util/getroot.c (grub_util_is_imsm): Fix descriptor and + * util/getroot.c (VasEBoot_util_is_imsm): Fix descriptor and memory leak. 2013-08-14 Andrey Borzenkov @@ -5934,19 +5934,19 @@ 2013-08-14 Vladimir Serbinenko - * grub-core/kern/emu/misc.c (grub_device_mapper_supported): Move from + * VasEBoot-core/kern/emu/misc.c (VasEBoot_device_mapper_supported): Move from here ... - * grub-core/kern/emu/hostdisk.c (grub_device_mapper_supported): ... to + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_device_mapper_supported): ... to here. 2013-08-14 Vladimir Serbinenko - * include/grub/i386/pc/biosdisk.h (grub_biosdisk_drp): Fix device_path + * include/VasEBoot/i386/pc/biosdisk.h (VasEBoot_biosdisk_drp): Fix device_path length. 2013-08-14 Vladimir Serbinenko - Fix handling of build-time grub-bin2h and grub-mkfont when doing + Fix handling of build-time VasEBoot-bin2h and VasEBoot-mkfont when doing full Canadian cross. Tested with build=x86_64, host=arm, target=ppc-ieee1275. @@ -5957,18 +5957,18 @@ 2013-08-14 Vladimir Serbinenko - * grub-core/kern/i386/coreboot/init.c: Fix compilation on + * VasEBoot-core/kern/i386/coreboot/init.c: Fix compilation on i386-multiboot. 2013-08-14 Vladimir Serbinenko - * grub-core/kern/vga_init.c: Fix compilation on qemu-mips. - * grub-core/kern/mips/qemu_mips/init.c: Likewise. + * VasEBoot-core/kern/vga_init.c: Fix compilation on qemu-mips. + * VasEBoot-core/kern/mips/qemu_mips/init.c: Likewise. 2013-08-13 Colin Watson - * util/getroot.c (grub_util_biosdisk_get_grub_dev): Zero out - grub_errno in the case where we handle GRUB_ERR_UNKNOWN_DEVICE by + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Zero out + VasEBoot_errno in the case where we handle VasEBoot_ERR_UNKNOWN_DEVICE by falling back to the partition device, otherwise a later call to this function may fail spuriously. Reported by Axel Beckert. Fixes Debian bug #708614. @@ -5981,33 +5981,33 @@ Prevent shadowing of stdlib's devname(3) on BSD. - * grub-core/disk/cryptodisk.c (grub_cmd_cryptomount): Rename devname + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_cmd_cryptomount): Rename devname and devlast to diskname and disklast, respectively. 2013-08-11 Colin Watson - * util/grub-mkconfig.in: Fix detection of Emacs autosave files. + * util/VasEBoot-mkconfig.in: Fix detection of Emacs autosave files. 2013-08-08 Vladimir Testov - * docs/grub.texi: Introduce terminal window position options: + * docs/VasEBoot.texi: Introduce terminal window position options: terminal-left: terminal window's left position terminal-top: terminal window's top position terminal-width: terminal window's width terminal-height: terminal window's height terminal-border: terminal window's border width - * grub-core/gfxmenu/theme-loader.c: Likewise. - * include/grub/gfxmenu_view.h: Likewise. + * VasEBoot-core/gfxmenu/theme-loader.c: Likewise. + * include/VasEBoot/gfxmenu_view.h: Likewise. * po/exlude.pot: Likewise. - * grub-core/gfxmenu/view.c: Likewise. + * VasEBoot-core/gfxmenu/view.c: Likewise. Also updated minimal window size. Also terminal_sanity_check function has been introduced. - * grub-core/tests/checksums.h: Update (terminal window height + * VasEBoot-core/tests/checksums.h: Update (terminal window height is adjusted now for low resolution screen) 2013-08-02 Vladimir Serbinenko - * grub-core/tests/checksums.h: Update (1-pixel difference in marker + * VasEBoot-core/tests/checksums.h: Update (1-pixel difference in marker position). 2013-08-02 Vladimir Serbinenko @@ -6016,54 +6016,54 @@ 2013-08-02 Vladimir Serbinenko - * tests/grub_func_test.in: Add unicode.pf2. + * tests/VasEBoot_func_test.in: Add unicode.pf2. 2013-08-02 Vladimir Serbinenko - * grub-core/term/gfxterm.c (grub_virtual_screen_setup): Start with + * VasEBoot-core/term/gfxterm.c (VasEBoot_virtual_screen_setup): Start with standard rather than noral color, in line with other terminals. 2013-08-02 Vladimir Serbinenko - * grub-core/partmap/dfly.c: Simplify dprintfs for easier gettext + * VasEBoot-core/partmap/dfly.c: Simplify dprintfs for easier gettext analysis. 2013-08-02 Vladimir Serbinenko - * grub-core/loader/arm/linux.c: Change printf to dprintf. + * VasEBoot-core/loader/arm/linux.c: Change printf to dprintf. 2013-08-02 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (check_feature): Cleanup and remove + * VasEBoot-core/fs/zfs/zfs.c (check_feature): Cleanup and remove inappropriate printf. 2013-07-25 Andrey Borzenkov - * .bzrignore: Remove grub-core/lib/dtc-grub, - grub-core/Makefile.libfdt.def - * conf/Makefile.extra-dist: Remove grub-core/Makefile.libfdt.def. + * .bzrignore: Remove VasEBoot-core/lib/dtc-VasEBoot, + VasEBoot-core/Makefile.libfdt.def + * conf/Makefile.extra-dist: Remove VasEBoot-core/Makefile.libfdt.def. 2013-07-25 Vladimir Serbinenko - * include/grub/video.h (grub_video_register): Keep double-linked as + * include/VasEBoot/video.h (VasEBoot_video_register): Keep double-linked as well as single-linked invariants. Reported by: qwertial. 2013-07-25 Vladimir Serbinenko - * grub-core/commands/nativedisk.c (get_uuid): Handle - GRUB_DISK_DEVICE_UBOOTDISK_ID. + * VasEBoot-core/commands/nativedisk.c (get_uuid): Handle + VasEBoot_DISK_DEVICE_UBOOTDISK_ID. 2013-07-25 Vladimir Testov - * grub-core/gfxmenu/widget-box.c: Fixed draw function. Now it takes + * VasEBoot-core/gfxmenu/widget-box.c: Fixed draw function. Now it takes maximum of NW, N, NE heights instead of N's height and maximum of NW, W, SW widths instead of W's width. (So the box will be always correctly drawn) 2013-07-20 Grégoire Sutre - * grub-core/partmap/bsdlabel.c (netopenbsdlabel_partition_map_iterate): + * VasEBoot-core/partmap/bsdlabel.c (netopenbsdlabel_partition_map_iterate): Fix misuse of variable count. 2013-07-18 Leif Lindholm @@ -6076,89 +6076,89 @@ 2013-07-16 Vladimir Serbinenko - * grub-core/loader/multiboot_elfxx.c: Check eip after v2p translation + * VasEBoot-core/loader/multiboot_elfxx.c: Check eip after v2p translation and not before. Reported by: Leon Drugi. 2013-07-16 Vladimir Serbinenko - * grub-core/kern/powerpc/ieee1275/startup.S: Handle unaligned bss. + * VasEBoot-core/kern/powerpc/ieee1275/startup.S: Handle unaligned bss. Reported by: Paulo Flabiano Smorigo. 2013-07-14 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: USe viewport when drawing strings. + * VasEBoot-core/gfxmenu/gui_list.c: USe viewport when drawing strings. 2013-07-14 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: Fix height calculation. + * VasEBoot-core/gfxmenu/gui_list.c: Fix height calculation. 2013-07-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c: Stylistic fixes. + * VasEBoot-core/fs/zfs/zfs.c: Stylistic fixes. 2013-07-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c: Run emacs indent on file. + * VasEBoot-core/fs/zfs/zfs.c: Run emacs indent on file. 2013-07-14 Andrey Borzenkov - * grub-core/net/bootp.c: Export net_* variables. - * grub-core/net/net.c: Likewise. + * VasEBoot-core/net/bootp.c: Export net_* variables. + * VasEBoot-core/net/net.c: Likewise. 2013-07-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c: Remove brackets around return value. + * VasEBoot-core/fs/zfs/zfs.c: Remove brackets around return value. 2013-07-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs_lz4.c: Add missing packed attribute. + * VasEBoot-core/fs/zfs/zfs_lz4.c: Add missing packed attribute. 2013-07-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (nvlist_next_nvpair): Fix improper cast. + * VasEBoot-core/fs/zfs/zfs.c (nvlist_next_nvpair): Fix improper cast. 2013-07-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs_lz4.c: Remove restrict keyword. + * VasEBoot-core/fs/zfs/zfs_lz4.c: Remove restrict keyword. 2013-07-14 Massimo Maggi - * grub-core/fs/zfs/zfs.c (nvlist_next_nvpair): Error is encode_size + * VasEBoot-core/fs/zfs/zfs.c (nvlist_next_nvpair): Error is encode_size <= 0. 2013-07-14 Massimo Maggi - * grub-core/fs/zfs/zfs.c: Split nvpair iterators into separate + * VasEBoot-core/fs/zfs/zfs.c: Split nvpair iterators into separate functions. 2013-07-14 Massimo Maggi - * grub-core/fs/zfs/zfs_lz4.c: New file. - * grub-core/fs/zfs/zfs.c: Tie up lz4 decompression. + * VasEBoot-core/fs/zfs/zfs_lz4.c: New file. + * VasEBoot-core/fs/zfs/zfs.c: Tie up lz4 decompression. 2013-07-14 Massimo Maggi - * grub-core/fs/zfs/zfs.c: Check for feature compatibility. + * VasEBoot-core/fs/zfs/zfs.c: Check for feature compatibility. 2013-07-14 Massimo Maggi - * grub-core/fs/zfs/zfs.c (uberblock_verify): Accept version 5000. + * VasEBoot-core/fs/zfs/zfs.c (uberblock_verify): Accept version 5000. (check_pool_label): Likewise. - * include/grub/zfs/zfs.h: Rewrite SPA_VERSION_* macros. + * include/VasEBoot/zfs/zfs.h: Rewrite SPA_VERSION_* macros. 2013-07-14 Massimo Maggi - * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix RAIDZ reporting. + * VasEBoot-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix RAIDZ reporting. 2013-07-13 Andrey Borzenkov - * docs/grub.texi (Commands): Document postition parameters + * docs/VasEBoot.texi (Commands): Document postition parameters for menuentry command. 2013-07-13 Andrey Borzenkov - * util/grub-mknetdir.in: Remove stray line from help output. + * util/VasEBoot-mknetdir.in: Remove stray line from help output. 2013-07-11 Vladimir Serbinenko @@ -6167,11 +6167,11 @@ 2013-07-11 Vladimir Serbinenko - * grub-core/commands/pcidump.c: Remove static variables. + * VasEBoot-core/commands/pcidump.c: Remove static variables. 2013-07-11 Vladimir Serbinenko - * grub-core/commands/sleep.c: Refresh screen before sleeping. + * VasEBoot-core/commands/sleep.c: Refresh screen before sleeping. 2013-07-11 Vladimir Serbinenko @@ -6179,16 +6179,16 @@ 2013-07-11 Vladimir Serbinenko - * grub-core/bus/usb/usbhub.c: Fix recheck logic. + * VasEBoot-core/bus/usb/usbhub.c: Fix recheck logic. 2013-07-11 Vladimir Serbinenko - * util/grub-mkfont.c (write_font_ascii_bitmap): Fix handling of glyphs + * util/VasEBoot-mkfont.c (write_font_ascii_bitmap): Fix handling of glyphs not filling whole 8x16 space. 2013-07-11 Vladimir Serbinenko - * grub-core/normal/charset.c (bidi_line_wrap): Fix spurios warning. + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Fix spurios warning. 2013-07-11 Vladimir Serbinenko @@ -6197,7 +6197,7 @@ 2013-06-21 Paul Wise 2013-06-21 Craig Sanders - * util/grub-reboot.in: Document submenu usage. + * util/VasEBoot-reboot.in: Document submenu usage. 2013-06-25 Colin Watson @@ -6205,30 +6205,30 @@ 2013-06-25 Colin Watson - * util/grub-script-check.c: Fail on scripts containing no - commands, to guard against corrupted grub-mkconfig setups that + * util/VasEBoot-script-check.c: Fail on scripts containing no + commands, to guard against corrupted VasEBoot-mkconfig setups that produce no useful output. - * tests/grub_script_no_commands.in: New test. - * Makefile.util.def (grub_script_no_commands): Add. + * tests/VasEBoot_script_no_commands.in: New test. + * Makefile.util.def (VasEBoot_script_no_commands): Add. Reported by Hans Putter. Fixes Debian bug #713886. 2013-06-16 Andrey Borzenkov - * grub-core/disk/diskfilter.c: Forgot to remove comment + * VasEBoot-core/disk/diskfilter.c: Forgot to remove comment from previous commit. 2013-06-16 Andrey Borzenkov - * grub-core/term/gfxterm.c (grub_virtual_screen_setup): Use - grub_term_normal_color, do not hardcode GRUB_TERM_DEFAULT_NORMAL_COLOR. + * VasEBoot-core/term/gfxterm.c (VasEBoot_virtual_screen_setup): Use + VasEBoot_term_normal_color, do not hardcode VasEBoot_TERM_DEFAULT_NORMAL_COLOR. 2013-06-16 Andrey Borzenkov - * conf/Makefile.extra-dist: Add grub-core/fs/cpio_common.c. + * conf/Makefile.extra-dist: Add VasEBoot-core/fs/cpio_common.c. 2013-06-16 Andrey Borzenkov - * grub-core/disk/diskfilter.c (scan_devices): Iteratively + * VasEBoot-core/disk/diskfilter.c (scan_devices): Iteratively rescan diskfilter devices until nothing new is found. 2013-06-16 Vladimir Serbinenko @@ -6241,7 +6241,7 @@ 2013-06-16 Vladimir Serbinenko - * grub-core/term/gfxterm.c: USe right background color when scrolling. + * VasEBoot-core/term/gfxterm.c: USe right background color when scrolling. 2013-06-16 Vladimir Serbinenko @@ -6266,7 +6266,7 @@ 2013-06-15 Vladimir Serbinenko - * tests/grub_script_eval.in: Really add the eval test. + * tests/VasEBoot_script_eval.in: Really add the eval test. 2013-06-14 Vladimir Serbinenko @@ -6275,15 +6275,15 @@ 2013-06-07 Andrey Borzenkov - * grub-core/script/execute.c (grub_script_execute_sourcecode): Split - off new function grub_script_execute_new_scope. Change callers to use + * VasEBoot-core/script/execute.c (VasEBoot_script_execute_sourcecode): Split + off new function VasEBoot_script_execute_new_scope. Change callers to use either of them as appropriate. - * grub-core/commands/eval.c: New command eval. - * docs/grub.texi (Commands): Document it. + * VasEBoot-core/commands/eval.c: New command eval. + * docs/VasEBoot.texi (Commands): Document it. 2013-06-07 Andrey Borzenkov - * grub-core/kern/corecmd.c (grub_core_cmd_set): Use grub_env_get + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_set): Use VasEBoot_env_get to fetch values when listing. 2013-06-07 Andrey Borzenkov @@ -6292,7 +6292,7 @@ 2013-06-07 Francesco Lavra - * grub-core/kern/corecmd.c (grub_core_cmd_ls): Fix handling of paths + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_ls): Fix handling of paths without a device name. 2013-06-07 Vladimir Serbinenko @@ -6302,7 +6302,7 @@ 2013-06-07 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (insert_array): Fix order to discover + * VasEBoot-core/disk/diskfilter.c (insert_array): Fix order to discover ambigouos RAID before discovering RAIDs on top of it. Reported by: bodom. @@ -6312,7 +6312,7 @@ 2013-05-31 Andrey Borzenkov - * util/grub.d/30_os-prober.in: Add support for probing EFI + * util/VasEBoot.d/30_os-prober.in: Add support for probing EFI System Partition (as of os-prober 1.58). 2013-05-31 Vladimir Serbinenko @@ -6321,9 +6321,9 @@ 2013-05-30 Josh Triplett - * grub-core/normal/cmdline.c (grub_cmdline_get): Fix Ctrl-u + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Fix Ctrl-u handling to copy the killed characters to the kill buffer as - UCS4 stored as grub_uint32_t rather than as 8-bit characters + UCS4 stored as VasEBoot_uint32_t rather than as 8-bit characters stored as char. Eliminates UCS4 truncation and corruption observed when killing characters with Ctrl-u and yanking them back with Ctrl-y. @@ -6339,12 +6339,12 @@ 2013-05-30 Vladimir Serbinenko - * grub-core/font/font.c, include/grub/font.h: Inline simple font + * VasEBoot-core/font/font.c, include/VasEBoot/font.h: Inline simple font functions. 2013-05-30 Vladimir Serbinenko - * grub-core/Makefile.am: Fix compilation problem with some + * VasEBoot-core/Makefile.am: Fix compilation problem with some automake versions. 2013-05-30 Vladimir Serbinenko @@ -6358,16 +6358,16 @@ 2013-05-30 Vladimir Serbinenko - * grub-core/commands/acpihalt.c: Fix handling of DSDT in presence of + * VasEBoot-core/commands/acpihalt.c: Fix handling of DSDT in presence of SSDT. 2013-05-15 Radosław Szymczyszyn - * grub-core/partmap/dfly.c: New partition map. + * VasEBoot-core/partmap/dfly.c: New partition map. 2013-05-15 Vladimir Serbinenko - * grub-core/kern/corecmd.c (grub_core_cmd_ls): Fix empty path + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_ls): Fix empty path checking. Reported by: Francesco Lavra. @@ -6376,7 +6376,7 @@ * gentpl.py: Replace EXTRA_DIST with dist_noinst_DATA or dist__DATA. EXTRA_DIST is ignored by automake inside false conditions. - * conf/Makefile.common: define dist_grubconf_DATA + * conf/Makefile.common: define dist_VasEBootconf_DATA 2013-05-14 Vladimir Serbinenko @@ -6385,7 +6385,7 @@ 2013-05-14 Vladimir Serbinenko - * grub-core/normal/cmdline.c (grub_cmdline_get): Fix off-by-one error + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Fix off-by-one error to avoid losing last column. 2013-05-14 Vladimir Serbinenko @@ -6394,12 +6394,12 @@ 2013-05-14 Vladimir Serbinenko - * tests/util/grub-shell.in: Remove the temporary directory on grub-emu + * tests/util/VasEBoot-shell.in: Remove the temporary directory on VasEBoot-emu after the test. 2013-05-11 Vladimir Serbinenko - * util/grub-install.in: Gettextize "Not found" message. + * util/VasEBoot-install.in: Gettextize "Not found" message. 2013-05-11 Vladimir Serbinenko @@ -6408,42 +6408,42 @@ 2013-05-11 Paulo Flabiano Smorigo - * grub-core/net/bootp.c (grub_cmd_bootp): Check if there is any card + * VasEBoot-core/net/bootp.c (VasEBoot_cmd_bootp): Check if there is any card present. - * include/grub/err.h (grub_err_t): New enum value GRUB_ERR_NET_NO_CARD. + * include/VasEBoot/err.h (VasEBoot_err_t): New enum value VasEBoot_ERR_NET_NO_CARD. 2013-05-11 Vladimir Serbinenko - * grub-core/tests/setjmp_test.c: Ignore missing noreturn. + * VasEBoot-core/tests/setjmp_test.c: Ignore missing noreturn. 2013-05-11 Vladimir Serbinenko - * grub-core/fs/hfspluscomp.c (grub_hfsplus_compress_attr): Add packed + * VasEBoot-core/fs/hfspluscomp.c (VasEBoot_hfsplus_compress_attr): Add packed attribute since structure is not necessarily aligned. 2013-05-11 Andrey Borzenkov - * docs/grub.texi (Device syntax): Clarify description of network + * docs/VasEBoot.texi (Device syntax): Clarify description of network drives. 2013-05-10 Vladimir Serbinenko - Redirect xasprintf to grub_xvasprintf rather than having #ifdef's + Redirect xasprintf to VasEBoot_xvasprintf rather than having #ifdef's for vasprintf presence. 2013-05-10 Vladimir Serbinenko - * util/grub-install.in: Handle efibootmgr presence check. + * util/VasEBoot-install.in: Handle efibootmgr presence check. Reported by: Leif Lindholm. 2013-05-10 Vladimir Serbinenko - * grub-core/commands/testspeed.c: Reuse formatting string to decrease + * VasEBoot-core/commands/testspeed.c: Reuse formatting string to decrease new strings to translate. 2013-05-10 Vladimir Serbinenko - * util/grub-mkrescue.in: Replace `STR' with `STRING' to avoid adding + * util/VasEBoot-mkrescue.in: Replace `STR' with `STRING' to avoid adding yet another string (pun intended) to translate. 2013-05-10 Vladimir Serbinenko @@ -6452,16 +6452,16 @@ 2013-05-10 Vladimir Serbinenko - * grub-core/net/net.c (grub_net_open_real): Autoload network modules. + * VasEBoot-core/net/net.c (VasEBoot_net_open_real): Autoload network modules. 2013-05-10 Vladimir Serbinenko - * grub-core/term/terminfo.c: Rename ANSI_C0 to ANSI_CSI to avoid + * VasEBoot-core/term/terminfo.c: Rename ANSI_C0 to ANSI_CSI to avoid misnomer. 2013-05-08 Andrey Borzenkov - * docs/grub.texi (Network): Add description of net_default_interface, + * docs/VasEBoot.texi (Network): Add description of net_default_interface, net_default_ip and net_default_mac. Rewrite variables description to emphasize that they are per-interface. @@ -6471,7 +6471,7 @@ 2013-05-08 Vladimir Serbinenko - * grub-core/commands/cat.c: Show UTF-8 characters. + * VasEBoot-core/commands/cat.c: Show UTF-8 characters. 2013-05-08 Vladimir Serbinenko @@ -6488,7 +6488,7 @@ 2013-05-07 Vladimir Serbinenko - * grub-core/term/efi/console.c: Fix compile error. + * VasEBoot-core/term/efi/console.c: Fix compile error. 2013-05-07 Vladimir Serbinenko @@ -6496,7 +6496,7 @@ 2013-05-07 Vladimir Serbinenko - * grub-core/commands/videoinfo.c: Use "paletted" rather than "packed + * VasEBoot-core/commands/videoinfo.c: Use "paletted" rather than "packed pixel". 2013-05-07 Vladimir Serbinenko @@ -6505,7 +6505,7 @@ 2013-05-07 Vladimir Serbinenko - * grub-core/tests/setjmp_test.c: New test. + * VasEBoot-core/tests/setjmp_test.c: New test. 2013-05-07 Vladimir Serbinenko @@ -6530,14 +6530,14 @@ 2013-05-07 Vladimir Serbinenko - * grub-core/loader/linux.c: Use grub_dprintf for debug statements + * VasEBoot-core/loader/linux.c: Use VasEBoot_dprintf for debug statements rather than printf. 2013-05-07 Vladimir Serbinenko - * grub-core/video/readers/jpeg.c: Use grub_dprintf for debug statements + * VasEBoot-core/video/readers/jpeg.c: Use VasEBoot_dprintf for debug statements rather than printf. - * grub-core/video/readers/tga.c: Likewise. + * VasEBoot-core/video/readers/tga.c: Likewise. 2013-05-07 Vladimir Serbinenko @@ -6545,17 +6545,17 @@ 2013-05-07 Vladimir Serbinenko - * grub-core/font/font.c: Use grub_dprintf for debug statements rather + * VasEBoot-core/font/font.c: Use VasEBoot_dprintf for debug statements rather than printf. 2013-05-06 Andrey Borzenkov - Reimplement grub-reboot to not depend on saved_entry. Use next_entry + Reimplement VasEBoot-reboot to not depend on saved_entry. Use next_entry variable for one time boot menu entry. 2013-05-05 Bean - * grub-core/commands/testspeed.c: New command testspeed. + * VasEBoot-core/commands/testspeed.c: New command testspeed. 2013-05-05 Vladimir Serbinenko @@ -6580,17 +6580,17 @@ 2013-05-04 Vladimir Serbinenko - * grub-core/tests/lib/functional_test.c: Don't stop on first failed + * VasEBoot-core/tests/lib/functional_test.c: Don't stop on first failed test. 2013-05-04 Vladimir Serbinenko - * grub-core/normal/menu_text.c (menu_clear_timeout): Clear second + * VasEBoot-core/normal/menu_text.c (menu_clear_timeout): Clear second line of timeout as it may contain the rest of long line. 2013-05-04 Vladimir Serbinenko - * grub-core/normal/main.c: Fix freed memory dereference. + * VasEBoot-core/normal/main.c: Fix freed memory dereference. 2013-05-04 Vladimir Serbinenko @@ -6598,11 +6598,11 @@ 2013-05-04 Vladimir Serbinenko - * grub-core/normal/menu.c (run_menu): Fix timeout reference point. + * VasEBoot-core/normal/menu.c (run_menu): Fix timeout reference point. 2013-05-04 Vladimir Serbinenko - * grub-core/gettext/gettext.c: Try $lang.gmo as well. + * VasEBoot-core/gettext/gettext.c: Try $lang.gmo as well. 2013-05-04 Vladimir Serbinenko @@ -6611,16 +6611,16 @@ 2013-05-04 Vladimir Serbinenko - * grub-core/font/font.c (grub_font_construct_glyph): Fix memory leak. + * VasEBoot-core/font/font.c (VasEBoot_font_construct_glyph): Fix memory leak. 2013-05-03 Andrey Borzenkov - Rename grub-core/tests/checksums.c into grub-core/tests/checksums.h + Rename VasEBoot-core/tests/checksums.c into VasEBoot-core/tests/checksums.h and add it as source to functional_test module. 2013-05-03 Vladimir Serbinenko - * grub-core/tests/video_checksum.c: Don't set GENERATE_MODE. + * VasEBoot-core/tests/video_checksum.c: Don't set GENERATE_MODE. 2013-05-03 Vladimir Serbinenko @@ -6628,29 +6628,29 @@ 2013-05-03 Vladimir Serbinenko - * grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Allow specifying + * VasEBoot-core/gfxmenu/gfxmenu.c (VasEBoot_gfxmenu_try): Allow specifying the theme path relative to $prefix/themes. 2013-05-03 Vladimir Serbinenko - * grub-core/video/fb/fbblit.c (grub_video_fbblit_blend_BGR888_RGBA8888): + * VasEBoot-core/video/fb/fbblit.c (VasEBoot_video_fbblit_blend_BGR888_RGBA8888): Fix order bug. - (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. + (VasEBoot_video_fbblit_blend_RGB888_RGBA8888): Likewise. 2013-05-03 Vladimir Serbinenko - * include/grub/gui.h (grub_gfxmenu_timeout_unregister): Free cb + * include/VasEBoot/gui.h (VasEBoot_gfxmenu_timeout_unregister): Free cb descriptor. 2013-05-03 Vladimir Serbinenko - * grub-core/gfxmenu/view.c (grub_gfxmenu_view_new): Clear - grub_gfxmenu_timeout_notifications. - (grub_gfxmenu_view_destroy): Likewise. + * VasEBoot-core/gfxmenu/view.c (VasEBoot_gfxmenu_view_new): Clear + VasEBoot_gfxmenu_timeout_notifications. + (VasEBoot_gfxmenu_view_destroy): Likewise. 2013-05-03 Vladimir Serbinenko - * grub-core/normal/term.c (print_ucs4_real): Fix startwidth in dry run. + * VasEBoot-core/normal/term.c (print_ucs4_real): Fix startwidth in dry run. 2013-05-02 Vladimir Serbinenko @@ -6662,14 +6662,14 @@ 2013-05-02 Vladimir Serbinenko - * grub-core/tests/videotest_checksum.c (videotest_checksum): Error out + * VasEBoot-core/tests/videotest_checksum.c (videotest_checksum): Error out if no unifont is found. Restore original keyboard. 2013-05-02 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_linux_setup_video): Add - GRUB_VIDEO_ADAPTER_CAPTURE: to handled drived ids. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_setup_video): Add + VasEBoot_VIDEO_ADAPTER_CAPTURE: to handled drived ids. 2013-05-02 Vladimir Serbinenko @@ -6677,7 +6677,7 @@ 2013-05-02 Vladimir Serbinenko - * grub-core/commands/videotest.c: Reduce flickering and draw 6 squares + * VasEBoot-core/commands/videotest.c: Reduce flickering and draw 6 squares instead of 2 to have full RGB/CMY test pattern. 2013-04-30 Vladimir Serbinenko @@ -6686,16 +6686,16 @@ 2013-04-30 Vladimir Serbinenko - * include/grub/arc/arc.h: Account for missing "other" peripheral on + * include/VasEBoot/arc/arc.h: Account for missing "other" peripheral on ARCS. All users updated. 2013-04-30 Vladimir Serbinenko - * grub-core/kern/mips/loongson/init.c: Support halt for loongson 2E. + * VasEBoot-core/kern/mips/loongson/init.c: Support halt for loongson 2E. 2013-04-30 Vladimir Serbinenko - * grub-core/partmap/amiga.c: Fix size of checksummed block. + * VasEBoot-core/partmap/amiga.c: Fix size of checksummed block. 2013-04-29 Vladimir Serbinenko @@ -6704,7 +6704,7 @@ 2013-04-29 Vladimir Testov - * grub-core/gfxmenu/circular_progress.c: Set start_angle in degrees + * VasEBoot-core/gfxmenu/circular_progress.c: Set start_angle in degrees with syntax "XXX deg"/"XXX °". 2013-04-29 Vladimir Serbinenko @@ -6713,14 +6713,14 @@ 2013-04-29 Vladimir Testov - * grub-core/gfxmenu/gui_list.c: Refresh first_shown_entry value when + * VasEBoot-core/gfxmenu/gui_list.c: Refresh first_shown_entry value when cached view is reused. - * grub-core/gfxmenu/view.c: Call the refresh procedure for all + * VasEBoot-core/gfxmenu/view.c: Call the refresh procedure for all open boot menus. 2013-04-29 Vladimir Serbinenko - Unify more code in grub-install_header. + Unify more code in VasEBoot-install_header. 2013-04-29 Vladimir Serbinenko @@ -6732,42 +6732,42 @@ 2013-04-29 Vladimir Serbinenko - * grub-core/commands/nativedisk.c: Customize the list of modules on + * VasEBoot-core/commands/nativedisk.c: Customize the list of modules on platform. Don't try to search for disks already using native drivers. 2013-04-29 Vladimir Serbinenko - * grub-core/bus/usb/uhci.c: Fix DMA handling and enable on all PCI + * VasEBoot-core/bus/usb/uhci.c: Fix DMA handling and enable on all PCI platforms. 2013-04-29 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_arglist_to_argv): Fix + * VasEBoot-core/script/execute.c (VasEBoot_script_arglist_to_argv): Fix handling of variables containing backslash. 2013-04-29 Vladimir Serbinenko - * include/grub/list.h (FOR_LIST_ELEMENTS_SAFE):Fix a NULL pointer + * include/VasEBoot/list.h (FOR_LIST_ELEMENTS_SAFE):Fix a NULL pointer dereference. Reported by: qwertial. 2013-04-29 Vladimir Serbinenko - * grub-core/kern/mips/arc/init.c: Fix prefix detection. + * VasEBoot-core/kern/mips/arc/init.c: Fix prefix detection. 2013-04-29 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_show_help): Fix a NULL pointer + * VasEBoot-core/lib/arg.c (VasEBoot_arg_show_help): Fix a NULL pointer dereference. Reported by: qwertial. 2013-04-28 Vladimir Serbinenko - * docs/grub.texi: Add a comment about usefullness of nativedisk. + * docs/VasEBoot.texi: Add a comment about usefullness of nativedisk. 2013-04-28 Vladimir Serbinenko - * grub-core/commands/nativedisk.c: Ignore unknown filesystem error. + * VasEBoot-core/commands/nativedisk.c: Ignore unknown filesystem error. 2013-04-28 Vladimir Serbinenko @@ -6775,26 +6775,26 @@ 2013-04-28 Vladimir Serbinenko - * grub-core/io/lzopio.c: Use GRUB_PROPERLY_ALIGNED_ARRAY. - * grub-core/loader/i386/bsd.c: Likewise. + * VasEBoot-core/io/lzopio.c: Use VasEBoot_PROPERLY_ALIGNED_ARRAY. + * VasEBoot-core/loader/i386/bsd.c: Likewise. 2013-04-28 Vladimir Serbinenko - * grub-core/disk/ahci.c: Fix compilation for amd64 (format warnings). + * VasEBoot-core/disk/ahci.c: Fix compilation for amd64 (format warnings). 2013-04-28 Vladimir Serbinenko - * include/grub/efi/api.h (GRUB_EFI_DEVICE_PATH_LENGTH): Use - grub_get_unaligned16 rather than shifts. + * include/VasEBoot/efi/api.h (VasEBoot_EFI_DEVICE_PATH_LENGTH): Use + VasEBoot_get_unaligned16 rather than shifts. 2013-04-28 Vladimir Serbinenko - * grub-core/kern/file.c: Use const char * rather than casting to + * VasEBoot-core/kern/file.c: Use const char * rather than casting to non-const. 2013-04-28 Vladimir Serbinenko - * grub-core/commands/probe.c: Add missing grub_device_close. + * VasEBoot-core/commands/probe.c: Add missing VasEBoot_device_close. 2013-04-28 Vladimir Serbinenko @@ -6806,19 +6806,19 @@ 2013-04-28 Vladimir Serbinenko - Move --directory/--override-directorry to grub-install_header and unify. + Move --directory/--override-directorry to VasEBoot-install_header and unify. 2013-04-28 Vladimir Serbinenko - * grub-core/term/morse.c: Macroify dih and dah. + * VasEBoot-core/term/morse.c: Macroify dih and dah. 2013-04-27 Paulo Flabiano Smorigo - * include/grub/macho.h: Set GRUB_MACHO_FAT_EFI_MAGIC as unsigned. + * include/VasEBoot/macho.h: Set VasEBoot_MACHO_FAT_EFI_MAGIC as unsigned. 2013-04-27 Vladimir Serbinenko - * grub-core/term/ns8250.c: Systematically probe ports by writing + * VasEBoot-core/term/ns8250.c: Systematically probe ports by writing to SR before using them. 2013-04-27 Paulo Flabiano Smorigo @@ -6829,12 +6829,12 @@ 2013-04-27 Vladimir Serbinenko - * grub-core/disk/ahci.c (grub_ahci_pciinit): Fix handling of empty + * VasEBoot-core/disk/ahci.c (VasEBoot_ahci_pciinit): Fix handling of empty ports. 2013-04-27 Leon Drugi - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_load): Fix cast in + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_load): Fix cast in BSS clearing. 2013-04-27 Vladimir Serbinenko @@ -6843,7 +6843,7 @@ 2013-04-27 Vladimir Serbinenko - Implement grub_machine_get_bootlocation for ARC. + Implement VasEBoot_machine_get_bootlocation for ARC. 2013-04-27 Vladimir Serbinenko @@ -6864,7 +6864,7 @@ 2013-04-26 Vladimir Serbinenko - * grub-core/Makefile.core.def: Fix grub-emu and grub-emu-lite sources. + * VasEBoot-core/Makefile.core.def: Fix VasEBoot-emu and VasEBoot-emu-lite sources. 2013-04-26 Vladimir Serbinenko @@ -6881,7 +6881,7 @@ 2013-04-26 Vladimir Serbinenko - * util/grub-mkrescue.in: Rename i386-ieee1275 core image due to + * util/VasEBoot-mkrescue.in: Rename i386-ieee1275 core image due to ofw limited ISO support. 2013-04-26 Vladimir Serbinenko @@ -6898,7 +6898,7 @@ 2013-04-25 Vladimir Serbinenko - * grub-core/boot/powerpc/bootinfo.txt.in: Missing update from previous + * VasEBoot-core/boot/powerpc/bootinfo.txt.in: Missing update from previous commit. 2013-04-25 Vladimir Serbinenko @@ -6907,17 +6907,17 @@ 2013-04-25 Vladimir Serbinenko - * util/grub-mkrescue.in: Fix loongson filename. + * util/VasEBoot-mkrescue.in: Fix loongson filename. 2013-04-25 Vladimir Serbinenko - * util/grub-mkrescue.in: Move all files that don't have a location - set in stone under /boot/grub. Use ISO hard links rather than copies + * util/VasEBoot-mkrescue.in: Move all files that don't have a location + set in stone under /boot/VasEBoot. Use ISO hard links rather than copies to save some space. 2013-04-24 Vladimir Serbinenko - * grub-core/term/ieee1275/console.c (grub_console_dimensions): Ignore + * VasEBoot-core/term/ieee1275/console.c (VasEBoot_console_dimensions): Ignore bogus SLOF values. 2013-04-24 Vladimir Serbinenko @@ -6926,31 +6926,31 @@ 2013-04-24 Vladimir Serbinenko - * util/grub-mkrescue.in: Alias sashARCS as sash. + * util/VasEBoot-mkrescue.in: Alias sashARCS as sash. 2013-04-24 Vladimir Serbinenko - * grub-core/term/arc/console.c: Assume that console is 80x24 vt100 if + * VasEBoot-core/term/arc/console.c: Assume that console is 80x24 vt100 if it's serial. 2013-04-24 Vladimir Serbinenko - * util/grub-install.in: Fix target fo qemu_mips. + * util/VasEBoot-install.in: Fix target fo qemu_mips. Fix extension on EFI. 2013-04-24 Vladimir Serbinenko - * grub-core/normal/menu_text.c (print_entry): Put an asterisk + * VasEBoot-core/normal/menu_text.c (print_entry): Put an asterisk in front of chosen entry to mark it even if highlighting is lost. 2013-04-24 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_linux_boot): Default to + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Default to gfxpayload=keep if cbfb is active. 2013-04-24 Vladimir Serbinenko - * grub-core/disk/ata.c (grub_ata_real_open): Use grub_error properly. + * VasEBoot-core/disk/ata.c (VasEBoot_ata_real_open): Use VasEBoot_error properly. 2013-04-24 Vladimir Serbinenko @@ -6958,11 +6958,11 @@ 2013-04-24 Vladimir Serbinenko - * util/grub-mkrescue.in: Add mips-arc support. + * util/VasEBoot-mkrescue.in: Add mips-arc support. 2013-04-24 Vladimir Serbinenko - * grub-core/kern/dl.c (grub_dl_resolve_symbols): Handle malloc failure. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_resolve_symbols): Handle malloc failure. 2013-04-24 Vladimir Serbinenko @@ -6972,75 +6972,75 @@ 2013-04-21 Vladimir Serbinenko - * grub-core/disk/arc/arcdisk.c (grub_arcdisk_iterate_iter): + * VasEBoot-core/disk/arc/arcdisk.c (VasEBoot_arcdisk_iterate_iter): Fix a type which prevented CD-ROM and floppy boot. 2013-04-21 Vladimir Serbinenko Support coreboot framebuffer. - * grub-core/video/i386/coreboot/cbfb.c: New file. + * VasEBoot-core/video/i386/coreboot/cbfb.c: New file. 2013-04-20 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_mm_init_region): Fix condition for + * VasEBoot-core/kern/mm.c (VasEBoot_mm_init_region): Fix condition for detecting too small regions. 2013-04-20 Vladimir Serbinenko - * grub-core/Makefile.core.def (legacycfg): Enable on EFI. + * VasEBoot-core/Makefile.core.def (legacycfg): Enable on EFI. 2013-04-20 Vladimir Serbinenko - * grub-core/lib/efi/relocator.c (grub_relocator_firmware_alloc_region): + * VasEBoot-core/lib/efi/relocator.c (VasEBoot_relocator_firmware_alloc_region): Remove dprintf. - * grub-core/lib/relocator.c (malloc_in_range): Likewise. + * VasEBoot-core/lib/relocator.c (malloc_in_range): Likewise. 2013-04-19 Vladimir Serbinenko - * grub-core/kern/ieee1275/init.c (grub_claim_heap): Improve handling - of GRUB_IEEE1275_FLAG_FORCE_CLAIM. - * grub-core/loader/powerpc/ieee1275/linux.c - (grub_linux_claimmap_iterate): Handle GRUB_IEEE1275_FLAG_FORCE_CLAIM. + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_claim_heap): Improve handling + of VasEBoot_IEEE1275_FLAG_FORCE_CLAIM. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c + (VasEBoot_linux_claimmap_iterate): Handle VasEBoot_IEEE1275_FLAG_FORCE_CLAIM. 2013-04-19 Vladimir Serbinenko - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Look for /boot-rom as well as /rom/boot-rom. 2013-04-19 Vladimir Serbinenko - * grub-core/commands/videotest.c (grub_cmd_videotest): Fix error + * VasEBoot-core/commands/videotest.c (VasEBoot_cmd_videotest): Fix error handling when creating text_layer failed. - * grub-core/video/video.c (grub_video_create_render_target): + * VasEBoot-core/video/video.c (VasEBoot_video_create_render_target): Set result to 0 on error. - (grub_video_delete_render_target): Do not dereference NULL. + (VasEBoot_video_delete_render_target): Do not dereference NULL. 2013-04-19 Vladimir Serbinenko - * grub-core/kern/elfXX.c (grub_elfXX_load): Handle - GRUB_ELF_LOAD_FLAGS_30BITS and GRUB_ELF_LOAD_FLAGS_62BITS. - * grub-core/loader/powerpc/ieee1275/linux.c (grub_linux_load32), - (grub_linux_load64): Mask out 2 high bits. + * VasEBoot-core/kern/elfXX.c (VasEBoot_elfXX_load): Handle + VasEBoot_ELF_LOAD_FLAGS_30BITS and VasEBoot_ELF_LOAD_FLAGS_62BITS. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_linux_load32), + (VasEBoot_linux_load64): Mask out 2 high bits. 2013-04-19 Andrey Borzenkov - * util/grub.d/30_os-prober.in: Add onstr to linux entries in one + * util/VasEBoot.d/30_os-prober.in: Add onstr to linux entries in one more place. 2013-04-19 Vladimir Serbinenko - Add support for pseries and other bootinfo machines to grub-mkrescue. + Add support for pseries and other bootinfo machines to VasEBoot-mkrescue. Tested by: Paulo Flabiano Smorigo. 2013-04-17 Vladimir Serbinenko - * util/grub-mkrescue.in: Add GPT for EFI boot. + * util/VasEBoot-mkrescue.in: Add GPT for EFI boot. 2013-04-17 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c: Detect floppies by ACPI ID. + * VasEBoot-core/disk/efi/efidisk.c: Detect floppies by ACPI ID. It improves performance in qemu. 2013-04-17 Vladimir Serbinenko @@ -7049,7 +7049,7 @@ 2013-04-16 Andrey Borzenkov - * grub-core/disk/efi/efidisk.c: Really limit transfer chunk size. + * VasEBoot-core/disk/efi/efidisk.c: Really limit transfer chunk size. 2013-04-16 Andrey Borzenkov @@ -7058,7 +7058,7 @@ 2013-04-15 Vladimir Serbinenko 2013-04-15 Peter Jones - * grub-core/disk/efi/efidisk.c: Limit disk read or write chunk to 0x500 + * VasEBoot-core/disk/efi/efidisk.c: Limit disk read or write chunk to 0x500 sectors. Based on patch by Peter Jones. @@ -7068,26 +7068,26 @@ 2013-04-15 Vladimir Serbinenko - * tests/grub_cmd_date.in: Skip on sparc64. + * tests/VasEBoot_cmd_date.in: Skip on sparc64. 2013-04-15 Vladimir Serbinenko - * tests/grub_script_expansion.in: Use fixed-string grep to skip over + * tests/VasEBoot_script_expansion.in: Use fixed-string grep to skip over firmware error messages. 2013-04-15 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_devalias_next): Make + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_devalias_next): Make source and destination differ. 2013-04-15 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c: Fix CD-ROM and boot device + * VasEBoot-core/disk/ieee1275/ofdisk.c: Fix CD-ROM and boot device detection. 2013-04-14 Vladimir Serbinenko - * grub-core/lib/posix_wrap/sys/types.h: Make WORDS_BIGENDIAN definition + * VasEBoot-core/lib/posix_wrap/sys/types.h: Make WORDS_BIGENDIAN definition match config-util.h to avoid warnings and increase compatibility. 2013-04-14 Szymon Janc @@ -7097,20 +7097,20 @@ 2013-04-14 Vladimir Serbinenko - * docs/grub-dev.texi: Rearrange menu to match the section order. + * docs/VasEBoot-dev.texi: Rearrange menu to match the section order. Reported by: Bryan Hundven. 2013-04-14 Vladimir Serbinenko - * grub-core/loader/i386/linux.c: Remove useless leftover pointer. + * VasEBoot-core/loader/i386/linux.c: Remove useless leftover pointer. 2013-04-14 Vladimir Serbinenko - Move GRUB out of system area when using xorriso 1.2.9 or later. + Move VasEBoot out of system area when using xorriso 1.2.9 or later. 2013-04-14 Vladimir Serbinenko - * tests/grub_cmd_date.in: Add missing exit 1. + * tests/VasEBoot_cmd_date.in: Add missing exit 1. 2013-04-14 Vladimir Serbinenko @@ -7118,7 +7118,7 @@ 2013-04-14 Vladimir Serbinenko - Support grub-shell on sparc64. + Support VasEBoot-shell on sparc64. 2013-04-14 Vladimir Serbinenko @@ -7131,12 +7131,12 @@ 2013-04-14 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c: Iterate over bootpath even if it + * VasEBoot-core/disk/ieee1275/ofdisk.c: Iterate over bootpath even if it would be otherwise excluded. 2013-04-14 Vladimir Serbinenko - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Inline name defines used only once. 2013-04-13 Vladimir Serbinenko @@ -7146,11 +7146,11 @@ 2013-04-12 Vladimir Serbinenko - * docs/man/grub-glue-efi.h2m: Add missing file. + * docs/man/VasEBoot-glue-efi.h2m: Add missing file. 2013-04-12 Vladimir Serbinenko - * util/grub-mkrescue.in: Fix wrong architecture for ppc dir. + * util/VasEBoot-mkrescue.in: Fix wrong architecture for ppc dir. 2013-04-12 Vladimir Serbinenko @@ -7158,7 +7158,7 @@ 2013-04-12 Vladimir Serbinenko - Replace stpcpy with grub_stpcpy in tools. + Replace stpcpy with VasEBoot_stpcpy in tools. 2013-04-12 Vladimir Serbinenko @@ -7168,11 +7168,11 @@ 2013-04-12 Vladimir Serbinenko - * util/grub-mkimage.c: Document memdisk implying --prefix. + * util/VasEBoot-mkimage.c: Document memdisk implying --prefix. 2013-04-12 Vladimir Serbinenko - * grub-core/bus/usb/ehci.c (grub_ehci_fini_hw): Ignore errors, not + * VasEBoot-core/bus/usb/ehci.c (VasEBoot_ehci_fini_hw): Ignore errors, not much we can do about it anyway. 2013-04-12 Aleš Nesrsta @@ -7181,11 +7181,11 @@ 2013-04-12 Vladimir Serbinenko - * grub-core/net/http.c: Fix bad free. + * VasEBoot-core/net/http.c: Fix bad free. 2013-04-12 Vladimir Serbinenko - * grub-core/net/drivers/ieee1275/ofnet.c: Don't attempt to send more + * VasEBoot-core/net/drivers/ieee1275/ofnet.c: Don't attempt to send more than buffer size. 2013-04-12 Vladimir Serbinenko @@ -7194,7 +7194,7 @@ 2013-04-12 Vladimir Serbinenko - * tests/util/grub-shell.in: Fix it on powerpc. + * tests/util/VasEBoot-shell.in: Fix it on powerpc. 2013-04-12 Vladimir Serbinenko @@ -7203,11 +7203,11 @@ 2013-04-12 Vladimir Serbinenko - * docs/grub.texi: Update coreboot status info. + * docs/VasEBoot.texi: Update coreboot status info. 2013-04-12 Vladimir Serbinenko - * tests/grub_cmd_date.in: New test for datetime. + * tests/VasEBoot_cmd_date.in: New test for datetime. 2013-04-12 Vladimir Serbinenko @@ -7215,17 +7215,17 @@ 2013-04-11 Vladimir Serbinenko - Support i386-ieee1275 grub-mkrescue and make check on it. + Support i386-ieee1275 VasEBoot-mkrescue and make check on it. 2013-04-11 Vladimir Serbinenko - Merge powerpc grub-mkrescue flavour with common. Use xorriso HFS+ + Merge powerpc VasEBoot-mkrescue flavour with common. Use xorriso HFS+ feature for it. 2013-04-11 Vladimir Serbinenko - * docs/grub.texi: Fix description of GRUB_CMDLINE_XEN and - GRUB_CMDLINE_XEN_DEFAULT. + * docs/VasEBoot.texi: Fix description of VasEBoot_CMDLINE_XEN and + VasEBoot_CMDLINE_XEN_DEFAULT. Reported by: Marc Warne (GigaTux) 2013-04-11 Vladimir Serbinenko @@ -7238,7 +7238,7 @@ 2013-04-11 Andrey Borzenkov - * util/grub.d/30_os-prober.in: Add onstr to entries for visual + * util/VasEBoot.d/30_os-prober.in: Add onstr to entries for visual distinction. 2013-04-11 Vladimir Serbinenko @@ -7249,7 +7249,7 @@ 2013-04-09 Andrey Borzenkov * autogen.sh: Use "-h", not "-f", to test for existence of symbolic - links under grub-core/lib/libgcrypt-grub/mpi. + links under VasEBoot-core/lib/libgcrypt-VasEBoot/mpi. 2013-04-08 Vladimir Serbinenko @@ -7259,88 +7259,88 @@ 2013-04-08 Andrey Borzenkov - * grub-core/Makefile.core.def: Add kern/elfXX.c to elf module + * VasEBoot-core/Makefile.core.def: Add kern/elfXX.c to elf module as extra_dist. 2013-04-08 Andrey Borzenkov - * grub-core/term/i386/pc/console.c: Fix cursor moving algorithm. + * VasEBoot-core/term/i386/pc/console.c: Fix cursor moving algorithm. 2013-04-08 Bryan Hundven - * docs/grub-dev.texi: Move @itemize after @subsection to satisfy + * docs/VasEBoot-dev.texi: Move @itemize after @subsection to satisfy texinfo-5.1. 2013-04-08 Vladimir Serbinenko - * grub-core/normal/term.c: Few more fixes for menu entry editor + * VasEBoot-core/normal/term.c: Few more fixes for menu entry editor rendering. Reported by: Andrey Borzenkov 2013-04-07 Vladimir Serbinenko - * grub-core/normal/term.c: Few more fixes for menu entry editor + * VasEBoot-core/normal/term.c: Few more fixes for menu entry editor rendering. Reported by: Andrey Borzenkov 2013-04-06 Andrey Borzenkov * conf/Makefile.extra-dist (EXTRA_DIST): Add - grub-core/lib/libgcrypt/src/gcrypt.h.in and util/import_gcrypth.sed. + VasEBoot-core/lib/libgcrypt/src/gcrypt.h.in and util/import_gcrypth.sed. 2013-04-06 Andrey Borzenkov - * util/grub-install_header: Use @PACKAGE@.mo in message catalog name - instead of hardcoding grub.mo. + * util/VasEBoot-install_header: Use @PACKAGE@.mo in message catalog name + instead of hardcoding VasEBoot.mo. -2013-04-05 Fedora Ninjas +2013-04-05 Fedora Ninjas - * util/grub.d/30_os-prober.in: Support btrrfs linux-prober extensions. + * util/VasEBoot.d/30_os-prober.in: Support btrrfs linux-prober extensions. 2013-04-05 Vladimir Serbinenko - Use GRUB_PROPERLY_ALIGNED_ARRAY in grub-core/disk/cryptodisk.c and - grub-core/disk/geli.c. + Use VasEBoot_PROPERLY_ALIGNED_ARRAY in VasEBoot-core/disk/cryptodisk.c and + VasEBoot-core/disk/geli.c. 2013-04-05 Vladimir Serbinenko - * util/grub-mkfont.c: Prefer enum to #define. + * util/VasEBoot-mkfont.c: Prefer enum to #define. 2013-04-05 Vladimir Serbinenko - * grub-core/commands/acpi.c: Use sizeof rather than hardcoding the size. + * VasEBoot-core/commands/acpi.c: Use sizeof rather than hardcoding the size. 2013-04-05 Vladimir Serbinenko - Replace 8 with GRUB_CHAR_BIT in several places when appropriate. + Replace 8 with VasEBoot_CHAR_BIT in several places when appropriate. 2013-04-05 Vladimir Serbinenko - Add new defines GRUB_RSDP_SIGNATURE_SIZE and GRUB_RSDP_SIGNATURE. + Add new defines VasEBoot_RSDP_SIGNATURE_SIZE and VasEBoot_RSDP_SIGNATURE. 2013-04-05 Vladimir Serbinenko - * grub-core/commands/verify.c: Use GRUB_CHAR_BIT. + * VasEBoot-core/commands/verify.c: Use VasEBoot_CHAR_BIT. 2013-04-05 Vladimir Serbinenko - * include/grub/bsdlabel.h: Use enums. + * include/VasEBoot/bsdlabel.h: Use enums. 2013-04-05 Vladimir Serbinenko - Move GRUB_CHAR_BIT to types.h. + Move VasEBoot_CHAR_BIT to types.h. 2013-04-04 Andrey Borzenkov - * docs/grub.texi: Document more user commands. + * docs/VasEBoot.texi: Document more user commands. 2013-04-04 Andrey Borzenkov - * docs/grub.texi: Document menuentry --id option. + * docs/VasEBoot.texi: Document menuentry --id option. 2013-04-04 Francesco Lavra - * util/grub-mkimage.c: Introduce new define EFI32_HEADER_SIZE. + * util/VasEBoot-mkimage.c: Introduce new define EFI32_HEADER_SIZE. 2013-04-04 Vladimir Serbinenko @@ -7350,7 +7350,7 @@ 2013-04-04 Vladimir Serbinenko 2013-04-04 Peter Jones - * grub-core/disk/efi/efidisk.c: Handle partitions on non-512B disks. + * VasEBoot-core/disk/efi/efidisk.c: Handle partitions on non-512B disks. 2013-04-04 Vladimir Serbinenko @@ -7358,25 +7358,25 @@ 2013-04-04 Vladimir Serbinenko - * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_readwrite_packetize): + * VasEBoot-core/bus/usb/usbtrans.c (VasEBoot_usb_bulk_readwrite_packetize): Init err. 2013-04-04 Vladimir Serbinenko - * util/grub-setup.c (setup): Handle some corner cases. + * util/VasEBoot-setup.c (setup): Handle some corner cases. 2013-04-04 Vladimir Serbinenko - * grub-core/lib/posix_wrap/locale.h [GRUB_UTIL]: Include host locale.h. + * VasEBoot-core/lib/posix_wrap/locale.h [VasEBoot_UTIL]: Include host locale.h. 2013-04-03 Vladimir Serbinenko - * grub-core/commands/verify.c: Save verified file to avoid it being + * VasEBoot-core/commands/verify.c: Save verified file to avoid it being tampered with after verification was done. 2013-04-03 Vladimir Serbinenko - * grub-core/term/i386/pc/console.c (grub_console_getwh): Decrease + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_getwh): Decrease reported width by one to compensate for curesor algorithm problem. 2013-04-03 Vladimir Serbinenko @@ -7386,35 +7386,35 @@ 2013-04-03 Andrey Borzenkov - * util/grub-mount.c (fuse_init): Return error if fuse_main + * util/VasEBoot-mount.c (fuse_init): Return error if fuse_main failed. 2013-04-03 Francesco Lavra - * include/grub/elf.h: Add missing ARM relocation codes and fix + * include/VasEBoot/elf.h: Add missing ARM relocation codes and fix existing ones. 2013-04-03 Vladimir Testov - * grub-core/gfxmenu/gui_progress_bar.c: Handle padding sizes. + * VasEBoot-core/gfxmenu/gui_progress_bar.c: Handle padding sizes. 2013-04-03 Vladimir Testov 2013-04-03 Vladimir Serbinenko - * grub-core/gfxmenu/gui_circular_progress.c: Take both width and height + * VasEBoot-core/gfxmenu/gui_circular_progress.c: Take both width and height into account when calculating radius. 2013-04-03 Vladimir Testov - * grub-core/gfxmenu/view.c: Fix off-by-one error. + * VasEBoot-core/gfxmenu/view.c: Fix off-by-one error. 2013-04-03 Vladimir Testov - * grub-core/gfxmenu/gui_circular_progress.c: Fix off-by-one error. + * VasEBoot-core/gfxmenu/gui_circular_progress.c: Fix off-by-one error. 2013-04-01 Radosław Szymczyszyn - * grub-core/partmap/apple.c (apple_partition_map_iterate): Add + * VasEBoot-core/partmap/apple.c (apple_partition_map_iterate): Add missing closing bracket. 2013-04-01 Radosław Szymczyszyn @@ -7423,38 +7423,38 @@ 2013-03-31 Andrey Borzenkov - * grub-core/commands/verify.c: Fix hash algorithms values for + * VasEBoot-core/commands/verify.c: Fix hash algorithms values for the first three hashes - they start with 1, not with 0. 2013-03-26 Vladimir Serbinenko - * grub-core/kern/efi/mm.c (grub_efi_finish_boot_services): + * VasEBoot-core/kern/efi/mm.c (VasEBoot_efi_finish_boot_services): Try terminating EFI services several times due to quirks in some implementations. 2013-03-26 Colin Watson - * grub-core/commands/acpihalt.c (skip_ext_op): Add support for + * VasEBoot-core/commands/acpihalt.c (skip_ext_op): Add support for skipping Event, Device, Processor, PowerRes, ThermalZone, and BankField extended opcodes. (get_sleep_type): Add minimal scope handling (just enough to handle setting the scope to the root path). - (grub_acpi_halt): Parse any SSDTs as well as the DSDT. - * include/grub/acpi.h: Add enumeration values for Event, Device, + (VasEBoot_acpi_halt): Parse any SSDTs as well as the DSDT. + * include/VasEBoot/acpi.h: Add enumeration values for Event, Device, Processor, PowerRes, ThermalZone, and BankField extended opcodes. 2013-03-26 Vladimir Testov - * grub-core/gfxmenu/font.c (grub_font_get_string_width): Fix + * VasEBoot-core/gfxmenu/font.c (VasEBoot_font_get_string_width): Fix memory leak. 2013-03-25 Vladimir Serbinenko - * grub-core/disk/ahci.c: Give more time for AHCI request. + * VasEBoot-core/disk/ahci.c: Give more time for AHCI request. 2013-03-25 Vladimir Serbinenko - * grub-core/normal/menu.c: Wait if there were errors shown at "boot" + * VasEBoot-core/normal/menu.c: Wait if there were errors shown at "boot" command. 2013-03-25 Vladimir Serbinenko @@ -7464,22 +7464,22 @@ 2013-03-24 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Automatically add no-real-mode edd=off on + * util/VasEBoot.d/20_linux_xen.in: Automatically add no-real-mode edd=off on non-BIOS platforms. 2013-03-24 Vladimir Serbinenko - * grub-core/Makefile.core.def (vga): Disable on coreboot and multiboot + * VasEBoot-core/Makefile.core.def (vga): Disable on coreboot and multiboot platforms. 2013-03-24 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Fix handling of multi-device filesystems. 2013-03-24 Vladimir Serbinenko - * grub-core/Makefile.core.def (vbe): Disable on coreboot and multiboot + * VasEBoot-core/Makefile.core.def (vbe): Disable on coreboot and multiboot platforms. 2013-03-24 Vladimir Serbinenko @@ -7488,12 +7488,12 @@ 2013-03-23 Vladimir Serbinenko - * grub-core/term/at_keyboard.c: Increase robustness on coreboot + * VasEBoot-core/term/at_keyboard.c: Increase robustness on coreboot and qemu. 2013-03-22 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c: Fix incorrect handling of special volumes. + * VasEBoot-core/fs/zfs/zfs.c: Fix incorrect handling of special volumes. 2013-03-22 Vladimir Serbinenko @@ -7501,7 +7501,7 @@ 2013-03-22 Vladimir Serbinenko - * grub-core/commands/i386/coreboot/cbls.c: Fix typos and wrong + * VasEBoot-core/commands/i386/coreboot/cbls.c: Fix typos and wrong description. 2013-03-21 Vladimir Serbinenko @@ -7510,7 +7510,7 @@ 2013-03-20 Vladimir Serbinenko - * grub-core/commands/verify.c (hashes): Add several hashes + * VasEBoot-core/commands/verify.c (hashes): Add several hashes from the spec. 2013-03-20 Vladimir Serbinenko @@ -7519,7 +7519,7 @@ 2013-03-20 Vladimir Serbinenko - * grub-core/commands/boottime.c: Fix copyright header. + * VasEBoot-core/commands/boottime.c: Fix copyright header. 2013-03-20 Vladimir Serbinenko @@ -7533,7 +7533,7 @@ 2013-03-20 Vladimir Serbinenko - * include/grub/boottime.h: Add missing file. + * include/VasEBoot/boottime.h: Add missing file. 2013-03-19 Vladimir Serbinenko @@ -7564,34 +7564,34 @@ 2013-03-10 Vladimir Serbinenko - * grub-core/loader/i386/bsdXX.c (grub_openbsd_find_ramdisk): Use + * VasEBoot-core/loader/i386/bsdXX.c (VasEBoot_openbsd_find_ramdisk): Use multiplication rather than division. 2013-03-10 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_list_alloc): Use shifts rather + * VasEBoot-core/lib/arg.c (VasEBoot_arg_list_alloc): Use shifts rather than divisions. 2013-03-10 Vladimir Serbinenko - * grub-core/commands/verify.c (grub_verify_signature): Use unsigned + * VasEBoot-core/commands/verify.c (VasEBoot_verify_signature): Use unsigned operations to have intended shifts and not divisions. 2013-03-10 Vladimir Serbinenko - * grub-core/loader/i386/pc/plan9.c (fill_disk): Fix types to use + * VasEBoot-core/loader/i386/pc/plan9.c (fill_disk): Fix types to use intended shifts rather than division. 2013-03-10 Vladimir Serbinenko - * include/grub/datetime.h (grub_datetime2unixtime): Fix unixtime + * include/VasEBoot/datetime.h (VasEBoot_datetime2unixtime): Fix unixtime computation for some years before epoch. Avode confusing division while on it. 2013-03-10 Vladimir Serbinenko - * grub-core/video/i386/pc/vbe.c - (grub_video_vbe_print_adapter_specific_info): Replace division by + * VasEBoot-core/video/i386/pc/vbe.c + (VasEBoot_video_vbe_print_adapter_specific_info): Replace division by shifts. 2013-03-10 Vladimir Serbinenko @@ -7601,34 +7601,34 @@ 2013-03-10 Vladimir Serbinenko - * grub-core/fs/hfs.c (grub_hfs_read_file): Avoid divmod64 since the + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_read_file): Avoid divmod64 since the maximum size is 4G - 1 on hfs 2013-03-10 Vladimir Serbinenko - Avoid costly 64-bit division in grub_get_time_ms on most platforms. + Avoid costly 64-bit division in VasEBoot_get_time_ms on most platforms. 2013-03-10 Vladimir Serbinenko - * grub-core/fs/fshelp.c (grub_fshelp_log2blksize): Remove now unused + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_log2blksize): Remove now unused function. 2013-03-07 Andrey Borzenkov - * grub-core/fs/iso9660.c (add_part): Remove always_inline attribute + * VasEBoot-core/fs/iso9660.c (add_part): Remove always_inline attribute causing gcc error with gcc 4.7.1. 2013-03-07 Nickolai Zeldovich - * grub-core/commands/acpi.c (grub_acpi_create_ebda): Don't + * VasEBoot-core/commands/acpi.c (VasEBoot_acpi_create_ebda): Don't dereference null pointer. While the code is technically correct, gcc may eliminate a null check if pointer is already dereferenced. 2013-03-07 Nickolai Zeldovich - * grub-core/normal/crypto.c (read_crypto_list): Fix incorrect + * VasEBoot-core/normal/crypto.c (read_crypto_list): Fix incorrect OOM check. - * grub-core/normal/term.c (read_terminal_list): Likewise. + * VasEBoot-core/normal/term.c (read_terminal_list): Likewise. 2013-03-07 Vladimir Serbinenko @@ -7638,7 +7638,7 @@ 2013-03-05 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_terminfo_cls): Issue an explicit + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_cls): Issue an explicit gotoxy to 0,0. 2013-03-03 Vladimir Serbinenko @@ -7649,31 +7649,31 @@ 2013-03-03 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_arglist_to_argv): Move + * VasEBoot-core/script/execute.c (VasEBoot_script_arglist_to_argv): Move append out of its parent. 2013-03-03 Vladimir Serbinenko - * grub-core/commands/regexp.c (set_matches): Move setvar out of its + * VasEBoot-core/commands/regexp.c (set_matches): Move setvar out of its parent. 2013-03-03 Vladimir Serbinenko - * grub-core/kern/env.c, include/grub/env.h: Change iterator through + * VasEBoot-core/kern/env.c, include/VasEBoot/env.h: Change iterator through all vars to a macro. All users updated. 2013-03-03 Vladimir Serbinenko - * grub-core/disk/ieee1275/nand.c: Fix compilation on + * VasEBoot-core/disk/ieee1275/nand.c: Fix compilation on i386-ieee1275. 2013-03-02 Vladimir Serbinenko - * include/grub/cmos.h: Handle high CMOS addresses on sparc64. + * include/VasEBoot/cmos.h: Handle high CMOS addresses on sparc64. 2013-03-02 Vladimir Serbinenko - * include/grub/mips/loongson/cmos.h: Fix high CMOS addresses. + * include/VasEBoot/mips/loongson/cmos.h: Fix high CMOS addresses. 2013-03-02 Vladimir Serbinenko @@ -7681,8 +7681,8 @@ 2013-03-02 Vladimir Serbinenko - * grub-core/kern/term.c (grub_term_normal_color), - (grub_term_highlight_color): Add back lost defaults. + * VasEBoot-core/kern/term.c (VasEBoot_term_normal_color), + (VasEBoot_term_highlight_color): Add back lost defaults. 2013-03-02 Vladimir Serbinenko @@ -7690,46 +7690,46 @@ 2013-03-02 Vladimir Serbinenko - * grub-core/lib/ia64/longjmp.S: Fix the name of longjmp function. - * grub-core/lib/ia64/setjmp.S: Fix the name of setjmp function. + * VasEBoot-core/lib/ia64/longjmp.S: Fix the name of longjmp function. + * VasEBoot-core/lib/ia64/setjmp.S: Fix the name of setjmp function. 2013-03-02 Vladimir Serbinenko - * grub-core/script/execute.c (gettext_append): Remove nested functions. + * VasEBoot-core/script/execute.c (gettext_append): Remove nested functions. 2013-03-02 Vladimir Serbinenko - * grub-core/normal/charset.c (grub_bidi_logical_to_visual): Add + * VasEBoot-core/normal/charset.c (VasEBoot_bidi_logical_to_visual): Add hook pass-through parameter. All users updated and unnested. 2013-03-02 Vladimir Serbinenko - * grub-core/commands/loadenv.c (grub_cmd_list_env): Move print_var + * VasEBoot-core/commands/loadenv.c (VasEBoot_cmd_list_env): Move print_var out of its parent. 2013-03-02 Vladimir Serbinenko - * grub-core/fs/hfs.c: Remove nested functions. + * VasEBoot-core/fs/hfs.c: Remove nested functions. 2013-03-01 Vladimir Serbinenko - * grub-core/fs/hfsplus.c (grub_hfsplus_btree_iterate_node): Pass + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_btree_iterate_node): Pass the context through. - (grub_hfsplus_iterate_dir): Move nested function out of its parent. + (VasEBoot_hfsplus_iterate_dir): Move nested function out of its parent. 2013-03-01 Vladimir Serbinenko - * util/grub-editenv.c (list_variables): Move print_var out of its + * util/VasEBoot-editenv.c (list_variables): Move print_var out of its parent. 2013-03-01 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (read_device_map): Remove nested + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Remove nested function. 2013-03-01 Vladimir Serbinenko - * grub-core/gentrigtables.c: Make tables const. + * VasEBoot-core/gentrigtables.c: Make tables const. 2013-03-01 Vladimir Serbinenko @@ -7737,104 +7737,104 @@ 2013-03-01 Vladimir Serbinenko - * grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Fix compilation + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_linux): Fix compilation for 64-bit platforms. 2013-03-01 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c: Transform iterate_child_devices into + * VasEBoot-core/disk/efi/efidisk.c: Transform iterate_child_devices into a FOR_CHILDREN macro. 2013-03-01 Vladimir Serbinenko - * grub-core/kern/main.c (grub_set_prefix_and_root): Strip trailing + * VasEBoot-core/kern/main.c (VasEBoot_set_prefix_and_root): Strip trailing platform from firmware path. 2013-02-28 Vladimir Serbinenko Enable linux16 on non-BIOS systems for i.a. memtest. - * grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Handle hole at 0 + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_linux): Handle hole at 0 correctly. - * grub-core/Makefile.core.def (linux16): Enable on all x86 flavours. + * VasEBoot-core/Makefile.core.def (linux16): Enable on all x86 flavours. 2013-02-28 Vladimir Serbinenko - * grub-core/kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): + * VasEBoot-core/kern/i386/coreboot/mmap.c (VasEBoot_linuxbios_table_iterate): Fix end of table condition. 2013-02-28 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_show_help): Move showargs + * VasEBoot-core/lib/arg.c (VasEBoot_arg_show_help): Move showargs out of its parent. 2013-02-28 Vladimir Serbinenko - * grub-core/fs/jfs.c: Remove nested functions. + * VasEBoot-core/fs/jfs.c: Remove nested functions. 2013-02-28 Vladimir Serbinenko - * grub-core/fs/minix.c: Remove nested functions. + * VasEBoot-core/fs/minix.c: Remove nested functions. 2013-02-28 Vladimir Serbinenko - * grub-core/fs/iso9660.c: Remove nested functions. + * VasEBoot-core/fs/iso9660.c: Remove nested functions. 2013-02-28 Vladimir Serbinenko - * grub-core/commands/parttool.c (grub_cmd_parttool): Move show_help out + * VasEBoot-core/commands/parttool.c (VasEBoot_cmd_parttool): Move show_help out of parent function. 2013-02-28 Vladimir Serbinenko - * util/grub-fstest.c: Remove nested functions. + * util/VasEBoot-fstest.c: Remove nested functions. 2013-02-27 Vladimir Serbinenko - * grub-core/loader/machoXX.c: Remove nested functions. + * VasEBoot-core/loader/machoXX.c: Remove nested functions. 2013-02-27 Colin Watson Remove nested functions from disk and file read hooks. - * include/grub/disk.h (grub_disk_read_hook_t): New type. - (struct grub_disk): Add read_hook_data member. - * include/grub/file.h (struct grub_file): Likewise. - * include/grub/fshelp.h (grub_fshelp_read_file): Add read_hook_data + * include/VasEBoot/disk.h (VasEBoot_disk_read_hook_t): New type. + (struct VasEBoot_disk): Add read_hook_data member. + * include/VasEBoot/file.h (struct VasEBoot_file): Likewise. + * include/VasEBoot/fshelp.h (VasEBoot_fshelp_read_file): Add read_hook_data argument. Update all callers. 2012-02-27 Andrey Borzenkov - * grub-core/partmap/msdos.c (grub_partition_msdos_iterate): + * VasEBoot-core/partmap/msdos.c (VasEBoot_partition_msdos_iterate): Fix off by one error in enumerating extended partitions. 2013-02-26 Andrey Borzenkov - * grub-core/disk/efi/efidisk.c(grub_efidisk_get_device_name): Fix + * VasEBoot-core/disk/efi/efidisk.c(VasEBoot_efidisk_get_device_name): Fix memory leak if device name is not found. 2013-02-25 Andrey Borzenkov - * grub-core/normal/menu_entry.c (update_screen): remove + * VasEBoot-core/normal/menu_entry.c (update_screen): remove unused variable `off' which caused scroll down arrow to be always shown. 2013-02-25 Andrey Borzenkov - * grub-core/normal/menu_entry.c (insert_string): fix off by one + * VasEBoot-core/normal/menu_entry.c (insert_string): fix off by one access to unallocated memory. 2013-02-25 Andrey Borzenkov * Makefile.util.def: Add partmap/msdos.c to common library. - * include/grub/msdos_partition.h: Add GRUB_PC_PARTITION_TYPE_LDM - * grub-core/disk/ldm.c: Check for existence of - GRUB_PC_PARTITION_TYPE_LDM. + * include/VasEBoot/msdos_partition.h: Add VasEBoot_PC_PARTITION_TYPE_LDM + * VasEBoot-core/disk/ldm.c: Check for existence of + VasEBoot_PC_PARTITION_TYPE_LDM. 2013-02-25 Vladimir Serbinenko - * grub-core/normal/misc.c (grub_normal_print_device_info): Use KiB to display + * VasEBoot-core/normal/misc.c (VasEBoot_normal_print_device_info): Use KiB to display sizes and display sector size. 2013-02-24 Vladimir Serbinenko @@ -7845,27 +7845,27 @@ Support Openfirmware disks with non-512B sectors. - * grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_open): Get the block + * VasEBoot-core/disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Get the block size of the disk. - * (grub_ofdisk_get_block_size): New function. - * (grub_ofdisk_prepare): Use the correct block size. - * (grub_ofdisk_read): Likewise. - * (grub_ofdisk_write): Likewise. - * include/grub/ieee1275/ofdisk.h (grub_ofdisk_get_block_size): + * (VasEBoot_ofdisk_get_block_size): New function. + * (VasEBoot_ofdisk_prepare): Use the correct block size. + * (VasEBoot_ofdisk_read): Likewise. + * (VasEBoot_ofdisk_write): Likewise. + * include/VasEBoot/ieee1275/ofdisk.h (VasEBoot_ofdisk_get_block_size): New proto. 2013-02-06 Vladimir Serbinenko - * grub-core/commands/lsacpi.c: Fix types on 64-bit platform. + * VasEBoot-core/commands/lsacpi.c: Fix types on 64-bit platform. 2013-02-04 Vladimir Serbinenko - * grub-core/disk/cryptodisk.c (grub_cryptodisk_scan_device): Don't stop + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_cryptodisk_scan_device): Don't stop on first error. 2013-02-01 Vladimir Serbinenko - * grub-core/fs/fshelp.c (find_file): Set oldnode to zero after + * VasEBoot-core/fs/fshelp.c (find_file): Set oldnode to zero after freeing it. 2013-02-01 Vladimir Serbinenko @@ -7874,69 +7874,69 @@ 2013-02-01 Vladimir Serbinenko - * grub-core/commands/lsacpi.c: Show more info. Hide some boring parts + * VasEBoot-core/commands/lsacpi.c: Show more info. Hide some boring parts unless they have unexpected values. 2013-02-01 Vladimir Serbinenko - * grub-core/bus/usb/usb.c (grub_usb_device_attach): Add missing - grub_print_error. + * VasEBoot-core/bus/usb/usb.c (VasEBoot_usb_device_attach): Add missing + VasEBoot_print_error. 2013-02-01 Vladimir Serbinenko - * grub-core/bus/usb/serial/common.c (grub_usbserial_attach): Fix missing + * VasEBoot-core/bus/usb/serial/common.c (VasEBoot_usbserial_attach): Fix missing zero-out of port structure. 2013-01-30 Vladimir Serbinenko - * grub-core/fs/xfs.c (grub_xfs_read_block): Fix computation in presence + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_read_block): Fix computation in presence of extended attributes. 2013-01-27 Andrey Borzenkov - * util/grub-install.in: change misleading comment about + * util/VasEBoot-install.in: change misleading comment about device.map creation 2013-01-27 Vladimir Serbinenko - * grub-core/normal/menu_text.c (grub_menu_init_page): Fix behaviour + * VasEBoot-core/normal/menu_text.c (VasEBoot_menu_init_page): Fix behaviour when menu highlight color isn't set. 2013-01-27 C. Masloch Improve FreeDOS direct loading support compatibility. - * include/grub/i386/relocator.h (grub_relocator16_state): + * include/VasEBoot/i386/relocator.h (VasEBoot_relocator16_state): New member ebp. - * grub-core/lib/i386/relocator.c (grub_relocator16_ebp): New extern + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator16_ebp): New extern variable. - (grub_relocator16_boot): Handle %ebp. - * grub-core/lib/i386/relocator16.S: Likewise. - * grub-core/loader/i386/pc/freedos.c: + (VasEBoot_relocator16_boot): Handle %ebp. + * VasEBoot-core/lib/i386/relocator16.S: Likewise. + * VasEBoot-core/loader/i386/pc/freedos.c: Load BPB to pass kernel which partition to load from. Check that kernel file is not too large. Set register dl to BIOS unit number as well. 2013-01-22 Colin Watson - * util/grub-reboot.in (usage): Document the need for - GRUB_DEFAULT=saved. - * util/grub-set-default.in (usage): Likewise. + * util/VasEBoot-reboot.in (usage): Document the need for + VasEBoot_DEFAULT=saved. + * util/VasEBoot-set-default.in (usage): Likewise. Reported by: Brian Candler. Fixes Ubuntu bug #1102925. 2013-01-21 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h: Include sys/types.h rather + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h: Include sys/types.h rather than defining WORDS_BIGENDIAN manually. 2013-01-21 Vladimir Serbinenko - * include/grub/kernel.h (FOR_MODULES): Adjust to preserve alignment + * include/VasEBoot/kernel.h (FOR_MODULES): Adjust to preserve alignment invariants. 2013-01-21 Colin Watson - * grub-core/font/font.c (blit_comb: do_blit): Make static instead of + * VasEBoot-core/font/font.c (blit_comb: do_blit): Make static instead of nested. (blit_comb: add_device_width): Likewise. @@ -7944,17 +7944,17 @@ Remove nested functions from USB iterators. - * include/grub/usb.h (grub_usb_iterate_hook_t): New type. - (grub_usb_controller_iterate_hook_t): Likewise. - (grub_usb_iterate): Add hook_data argument. - (grub_usb_controller_iterate): Likewise. - (struct grub_usb_controller_dev.iterate): Likewise. + * include/VasEBoot/usb.h (VasEBoot_usb_iterate_hook_t): New type. + (VasEBoot_usb_controller_iterate_hook_t): Likewise. + (VasEBoot_usb_iterate): Add hook_data argument. + (VasEBoot_usb_controller_iterate): Likewise. + (struct VasEBoot_usb_controller_dev.iterate): Likewise. Update all implementations and callers. 2013-01-21 Vladimir Serbinenko - * grub-core/normal/term.c (print_ucs4_terminal): Don't output right + * VasEBoot-core/normal/term.c (print_ucs4_terminal): Don't output right margin when not needed. 2013-01-21 Vladimir Serbinenko @@ -7963,7 +7963,7 @@ 2013-01-21 Vladimir Serbinenko - * grub-core/commands/ls.c (grub_ls_print_devices): Add missing + * VasEBoot-core/commands/ls.c (VasEBoot_ls_print_devices): Add missing asterisk. 2013-01-21 Colin Watson @@ -7973,12 +7973,12 @@ 2013-01-21 Colin Watson - * grub-core/disk/arc/arcdisk.c (grub_arcdisk_iterate): Fix + * VasEBoot-core/disk/arc/arcdisk.c (VasEBoot_arcdisk_iterate): Fix parameter declarations. 2013-01-21 Vladimir Serbinenko - * grub-core/commands/lsmmap.c: Fix unused variable on emu. + * VasEBoot-core/commands/lsmmap.c: Fix unused variable on emu. 2013-01-21 Vladimir Serbinenko @@ -7986,7 +7986,7 @@ 2013-01-21 Colin Watson - * grub-core/partmap/msdos.c (embed_signatures): Add the signature of + * VasEBoot-core/partmap/msdos.c (embed_signatures): Add the signature of an Acer registration utility with several sightings in the wild. Reported by: Rickard Westman. Fixes Ubuntu bug #987022. @@ -7994,24 +7994,24 @@ Remove nested functions from filesystem directory iterators. - * include/grub/fs.h (grub_fs_dir_hook_t): New type. - (struct grub_fs.dir): Add hook_data argument. + * include/VasEBoot/fs.h (VasEBoot_fs_dir_hook_t): New type. + (struct VasEBoot_fs.dir): Add hook_data argument. Update all implementations and callers. 2013-01-21 Colin Watson - * docs/grub.texi (Multi-boot manual config): Fix typo for + * docs/VasEBoot.texi (Multi-boot manual config): Fix typo for "recommended". 2013-01-20 Leif Lindholm - * util/grub-mkimage.c (main): Postpone freeing arguments.output + * util/VasEBoot-mkimage.c (main): Postpone freeing arguments.output until after its use in generate_image. 2013-01-20 Colin Watson - * grub-core/loader/i386/linux.c (grub_cmd_initrd): Don't add the + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_initrd): Don't add the initrd size to addr_min, since the initrd will be allocated after this address. @@ -8022,7 +8022,7 @@ 2013-01-20 Leif Lindholm - * include/grub/elf.h: Update ARM definitions based on binutils. + * include/VasEBoot/elf.h: Update ARM definitions based on binutils. 2013-01-20 Aleš Nesrsta @@ -8030,12 +8030,12 @@ 2013-01-20 Andrey Borzenkov - * docs/grub.texi (Simple configuration): Clarify GRUB_HIDDEN_TIMEOUT + * docs/VasEBoot.texi (Simple configuration): Clarify VasEBoot_HIDDEN_TIMEOUT is interrupted by ESC. 2013-01-20 Vladimir Serbinenko - * util/grub-script-check.c (main): Uniform the error message. + * util/VasEBoot-script-check.c (main): Uniform the error message. 2013-01-20 Colin Watson @@ -8045,25 +8045,25 @@ Remove nested functions from device iterators. - * include/grub/arc/arc.h (grub_arc_iterate_devs_hook_t): New type. - (grub_arc_iterate_devs): Add hook_data argument. - * include/grub/ata.h (grub_ata_dev_iterate_hook_t): New type. - (struct grub_ata_dev.iterate): Add hook_data argument. - * include/grub/device.h (grub_device_iterate_hook_t): New type. - (grub_device_iterate): Add hook_data argument. - * include/grub/disk.h (grub_disk_dev_iterate_hook_t): New type. - (struct grub_disk_dev.iterate): Add hook_data argument. - (grub_disk_dev_iterate): Likewise. - * include/grub/gpt_partition.h (grub_gpt_partition_map_iterate): + * include/VasEBoot/arc/arc.h (VasEBoot_arc_iterate_devs_hook_t): New type. + (VasEBoot_arc_iterate_devs): Add hook_data argument. + * include/VasEBoot/ata.h (VasEBoot_ata_dev_iterate_hook_t): New type. + (struct VasEBoot_ata_dev.iterate): Add hook_data argument. + * include/VasEBoot/device.h (VasEBoot_device_iterate_hook_t): New type. + (VasEBoot_device_iterate): Add hook_data argument. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_iterate_hook_t): New type. + (struct VasEBoot_disk_dev.iterate): Add hook_data argument. + (VasEBoot_disk_dev_iterate): Likewise. + * include/VasEBoot/gpt_partition.h (VasEBoot_gpt_partition_map_iterate): Likewise. - * include/grub/msdos_partition.h (grub_partition_msdos_iterate): + * include/VasEBoot/msdos_partition.h (VasEBoot_partition_msdos_iterate): Likewise. - * include/grub/partition.h (grub_partition_iterate_hook_t): New + * include/VasEBoot/partition.h (VasEBoot_partition_iterate_hook_t): New type. - (struct grub_partition_map.iterate): Add hook_data argument. - (grub_partition_iterate): Likewise. - * include/grub/scsi.h (grub_scsi_dev_iterate_hook_t): New type. - (struct grub_scsi_dev.iterate): Add hook_data argument. + (struct VasEBoot_partition_map.iterate): Add hook_data argument. + (VasEBoot_partition_iterate): Likewise. + * include/VasEBoot/scsi.h (VasEBoot_scsi_dev_iterate_hook_t): New type. + (struct VasEBoot_scsi_dev.iterate): Add hook_data argument. Update all callers. @@ -8093,172 +8093,172 @@ 2013-01-16 Vladimir Serbinenko - * grub-core/script/lexer.c (grub_script_lexer_init): Rename getline + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_init): Rename getline argument to prevent name collision. 2013-01-15 Colin Watson Remove nested functions from script reading and parsing. - * grub-core/kern/parser.c (grub_parser_split_cmdline): Add + * VasEBoot-core/kern/parser.c (VasEBoot_parser_split_cmdline): Add getline_data argument, passed to getline. - * grub-core/kern/rescue_parser.c (grub_rescue_parse_line): Add - getline_data argument, passed to grub_parser_split_cmdline. - * grub-core/script/lexer.c (grub_script_lexer_yywrap): Pass + * VasEBoot-core/kern/rescue_parser.c (VasEBoot_rescue_parse_line): Add + getline_data argument, passed to VasEBoot_parser_split_cmdline. + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_yywrap): Pass lexerstate->getline_data to lexerstate->getline. - (grub_script_lexer_init): Add getline_data argument, saved in + (VasEBoot_script_lexer_init): Add getline_data argument, saved in lexerstate->getline_data. - * grub-core/script/main.c (grub_normal_parse_line): Add getline_data - argument, passed to grub_script_parse. - * grub-core/script/script.c (grub_script_parse): Add getline_data - argument, passed to grub_script_lexer_init. - * include/grub/parser.h (grub_parser_split_cmdline): Update + * VasEBoot-core/script/main.c (VasEBoot_normal_parse_line): Add getline_data + argument, passed to VasEBoot_script_parse. + * VasEBoot-core/script/script.c (VasEBoot_script_parse): Add getline_data + argument, passed to VasEBoot_script_lexer_init. + * include/VasEBoot/parser.h (VasEBoot_parser_split_cmdline): Update prototype. Update all callers to pass appropriate getline data. - (struct grub_parser.parse_line): Likewise. - (grub_rescue_parse_line): Likewise. - * include/grub/reader.h (grub_reader_getline_t): Add void * + (struct VasEBoot_parser.parse_line): Likewise. + (VasEBoot_rescue_parse_line): Likewise. + * include/VasEBoot/reader.h (VasEBoot_reader_getline_t): Add void * argument. - * include/grub/script_sh.h (struct grub_lexer_param): Add + * include/VasEBoot/script_sh.h (struct VasEBoot_lexer_param): Add getline_data member. - (grub_script_parse): Update prototype. Update all callers to pass + (VasEBoot_script_parse): Update prototype. Update all callers to pass appropriate getline data. - (grub_script_lexer_init): Likewise. - (grub_normal_parse_line): Likewise. + (VasEBoot_script_lexer_init): Likewise. + (VasEBoot_normal_parse_line): Likewise. - * grub-core/commands/legacycfg.c (legacy_file_getline): Add unused + * VasEBoot-core/commands/legacycfg.c (legacy_file_getline): Add unused data argument. - * grub-core/kern/parser.c (grub_parser_execute: getline): Make + * VasEBoot-core/kern/parser.c (VasEBoot_parser_execute: getline): Make static instead of nested. Rename to ... - (grub_parser_execute_getline): ... this. - * grub-core/kern/rescue_reader.c (grub_rescue_read_line): Add unused + (VasEBoot_parser_execute_getline): ... this. + * VasEBoot-core/kern/rescue_reader.c (VasEBoot_rescue_read_line): Add unused data argument. - * grub-core/normal/main.c (read_config_file: getline): Make static + * VasEBoot-core/normal/main.c (read_config_file: getline): Make static instead of nested. Rename to ... (read_config_file_getline): ... this. - (grub_normal_read_line): Add unused data argument. - * grub-core/script/execute.c (grub_script_execute_sourcecode: + (VasEBoot_normal_read_line): Add unused data argument. + * VasEBoot-core/script/execute.c (VasEBoot_script_execute_sourcecode: getline): Make static instead of nested. Rename to ... - (grub_script_execute_sourcecode_getline): ... this. - * util/grub-script-check.c (main: get_config_line): Make static + (VasEBoot_script_execute_sourcecode_getline): ... this. + * util/VasEBoot-script-check.c (main: get_config_line): Make static instead of nested. 2013-01-15 Colin Watson Remove nested functions from memory map iterators. - * grub-core/efiemu/mm.c (grub_efiemu_mmap_iterate): Add hook_data + * VasEBoot-core/efiemu/mm.c (VasEBoot_efiemu_mmap_iterate): Add hook_data argument, passed to hook. - * grub-core/kern/i386/coreboot/mmap.c - (grub_linuxbios_table_iterate): Likewise. - (grub_machine_mmap_iterate: iterate_linuxbios_table): Make static + * VasEBoot-core/kern/i386/coreboot/mmap.c + (VasEBoot_linuxbios_table_iterate): Likewise. + (VasEBoot_machine_mmap_iterate: iterate_linuxbios_table): Make static instead of nested. - (grub_machine_mmap_iterate): Add hook_data argument. - * grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_iterate): + (VasEBoot_machine_mmap_iterate): Add hook_data argument. + * VasEBoot-core/kern/i386/multiboot_mmap.c (VasEBoot_machine_mmap_iterate): Add hook_data argument, passed to hook. - * grub-core/kern/i386/pc/mmap.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/i386/pc/mmap.c (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/i386/qemu/mmap.c (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/kern/ieee1275/mmap.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/ieee1275/mmap.c (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/kern/mips/arc/init.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/kern/mips/loongson/init.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/kern/mips/qemu_mips/init.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/mmap/efi/mmap.c (grub_efi_mmap_iterate): Likewise. - (grub_machine_mmap_iterate): Likewise. - * grub-core/mmap/mmap.c (grub_mmap_iterate): Likewise. - * include/grub/efiemu/efiemu.h (grub_efiemu_mmap_iterate): Update + * VasEBoot-core/mmap/efi/mmap.c (VasEBoot_efi_mmap_iterate): Likewise. + (VasEBoot_machine_mmap_iterate): Likewise. + * VasEBoot-core/mmap/mmap.c (VasEBoot_mmap_iterate): Likewise. + * include/VasEBoot/efiemu/efiemu.h (VasEBoot_efiemu_mmap_iterate): Update prototype. - * include/grub/memory.h (grub_memory_hook_t): Add data argument. + * include/VasEBoot/memory.h (VasEBoot_memory_hook_t): Add data argument. Remove NESTED_FUNC_ATTR from here and from all users. - (grub_mmap_iterate): Update prototype. - (grub_efi_mmap_iterate): Update prototype. Update all callers to + (VasEBoot_mmap_iterate): Update prototype. + (VasEBoot_efi_mmap_iterate): Update prototype. Update all callers to pass appropriate hook data. - (grub_machine_mmap_iterate): Likewise. + (VasEBoot_machine_mmap_iterate): Likewise. - * grub-core/commands/acpi.c (grub_acpi_create_ebda: find_hook): Make + * VasEBoot-core/commands/acpi.c (VasEBoot_acpi_create_ebda: find_hook): Make static instead of nested. - * grub-core/commands/lsmmap.c (grub_cmd_lsmmap: hook): Likewise. + * VasEBoot-core/commands/lsmmap.c (VasEBoot_cmd_lsmmap: hook): Likewise. Rename to ... (lsmmap_hook): ... this. - * grub-core/efiemu/mm.c (grub_efiemu_mmap_init: bounds_hook): + * VasEBoot-core/efiemu/mm.c (VasEBoot_efiemu_mmap_init: bounds_hook): Likewise. - (grub_efiemu_mmap_fill: fill_hook): Likewise. - * grub-core/kern/i386/coreboot/init.c (grub_machine_init: + (VasEBoot_efiemu_mmap_fill: fill_hook): Likewise. + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_machine_init: heap_init): Likewise. - * grub-core/kern/i386/pc/init.c (grub_machine_init: hook): Likewise. + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_machine_init: hook): Likewise. Rename to ... (mmap_iterate_hook): ... this. - * grub-core/kern/ieee1275/init.c (grub_claim_heap: heap_init): + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_claim_heap: heap_init): Likewise. - * grub-core/lib/ieee1275/relocator.c - (grub_relocator_firmware_get_max_events: count): Likewise. - (grub_relocator_firmware_fill_events: fill): Likewise. Rename + * VasEBoot-core/lib/ieee1275/relocator.c + (VasEBoot_relocator_firmware_get_max_events: count): Likewise. + (VasEBoot_relocator_firmware_fill_events: fill): Likewise. Rename to ... - (grub_relocator_firmware_fill_events_iter): ... this. - * grub-core/lib/relocator.c (grub_relocator_alloc_chunk_align: + (VasEBoot_relocator_firmware_fill_events_iter): ... this. + * VasEBoot-core/lib/relocator.c (VasEBoot_relocator_alloc_chunk_align: hook): Likewise. Rename to ... - (grub_relocator_alloc_chunk_align_iter): ... this. - * grub-core/loader/i386/bsd.c (generate_e820_mmap: hook): Likewise. + (VasEBoot_relocator_alloc_chunk_align_iter): ... this. + * VasEBoot-core/loader/i386/bsd.c (generate_e820_mmap: hook): Likewise. Rename to ... (generate_e820_mmap_iter): ... this. - * grub-core/loader/i386/linux.c (find_mmap_size: hook): Likewise. + * VasEBoot-core/loader/i386/linux.c (find_mmap_size: hook): Likewise. Rename to ... (count_hook): ... this. - (grub_linux_boot: hook): Likewise. Rename to ... - (grub_linux_boot_mmap_find): ... this. - (grub_linux_boot: hook_fill): Likewise. Rename to ... - (grub_linux_boot_mmap_fill): ... this. - * grub-core/loader/i386/multiboot_mbi.c (grub_fill_multiboot_mmap: + (VasEBoot_linux_boot: hook): Likewise. Rename to ... + (VasEBoot_linux_boot_mmap_find): ... this. + (VasEBoot_linux_boot: hook_fill): Likewise. Rename to ... + (VasEBoot_linux_boot_mmap_fill): ... this. + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_fill_multiboot_mmap: hook): Likewise. Rename to ... - (grub_fill_multiboot_mmap_iter): ... this. - * grub-core/loader/multiboot.c (grub_get_multiboot_mmap_count: + (VasEBoot_fill_multiboot_mmap_iter): ... this. + * VasEBoot-core/loader/multiboot.c (VasEBoot_get_multiboot_mmap_count: hook): Likewise. Rename to ... (count_hook): ... this. - * grub-core/loader/multiboot_mbi2.c (grub_fill_multiboot_mmap: + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_fill_multiboot_mmap: hook): Likewise. Rename to ... - (grub_fill_multiboot_mmap_iter): ... this. - * grub-core/loader/powerpc/ieee1275/linux.c - (grub_linux_claimmap_iterate: alloc_mem): Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c (alloc_phys: choose): + (VasEBoot_fill_multiboot_mmap_iter): ... this. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c + (VasEBoot_linux_claimmap_iterate: alloc_mem): Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c (alloc_phys: choose): Likewise. Rename to ... (alloc_phys_choose): ... this. (determine_phys_base: get_physbase): Likewise. - * grub-core/mmap/i386/mmap.c (grub_mmap_malign_and_register: + * VasEBoot-core/mmap/i386/mmap.c (VasEBoot_mmap_malign_and_register: find_hook): Likewise. - * grub-core/mmap/i386/pc/mmap.c (preboot: fill_hook): Likewise. + * VasEBoot-core/mmap/i386/pc/mmap.c (preboot: fill_hook): Likewise. (malloc_hook: count_hook): Likewise. - * grub-core/mmap/i386/uppermem.c (grub_mmap_get_lower: hook): + * VasEBoot-core/mmap/i386/uppermem.c (VasEBoot_mmap_get_lower: hook): Likewise. Rename to ... (lower_hook): ... this. - (grub_mmap_get_upper: hook): Likewise. Rename to ... + (VasEBoot_mmap_get_upper: hook): Likewise. Rename to ... (upper_hook): ... this. - (grub_mmap_get_post64: hook): Likewise. Rename to ... + (VasEBoot_mmap_get_post64: hook): Likewise. Rename to ... (post64_hook): ... this. - * grub-core/mmap/mips/uppermem.c (grub_mmap_get_lower: hook): + * VasEBoot-core/mmap/mips/uppermem.c (VasEBoot_mmap_get_lower: hook): Likewise. Rename to ... (lower_hook): ... this. - (grub_mmap_get_upper: hook): Likewise. Rename to ... + (VasEBoot_mmap_get_upper: hook): Likewise. Rename to ... (upper_hook): ... this. - * grub-core/mmap/mmap.c (grub_mmap_iterate: count_hook): Likewise. - (grub_mmap_iterate: fill_hook): Likewise. + * VasEBoot-core/mmap/mmap.c (VasEBoot_mmap_iterate: count_hook): Likewise. + (VasEBoot_mmap_iterate: fill_hook): Likewise. (fill_mask): Pass addr and mask within a single struct. - (grub_cmd_badram: hook): Make static instead of nested. Rename + (VasEBoot_cmd_badram: hook): Make static instead of nested. Rename to ... (badram_iter): ... this. - (grub_cmd_cutmem: hook): Likewise. Rename to ... + (VasEBoot_cmd_cutmem: hook): Likewise. Rename to ... (cutmem_iter): ... this. 2013-01-13 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (read_device_map): Explicitly + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Explicitly delimit path in strings using quotes. - * util/getroot.c (grub_guess_root_devices): Likewise. - (grub_make_system_path_relative_to_its_root): Likewise. - * util/grub-probe.c (probe): Likewise. + * util/getroot.c (VasEBoot_guess_root_devices): Likewise. + (VasEBoot_make_system_path_relative_to_its_root): Likewise. + * util/VasEBoot-probe.c (probe): Likewise. * util/ieee1275/ofpath.c (find_obppath): Likewise. (xrealpath): Likewise. @@ -8266,70 +8266,70 @@ Fix compilation with older compilers. - * grub-core/Makefile.core.def (mpi): Add mpi-inline.c. - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h: Remove redundant + * VasEBoot-core/Makefile.core.def (mpi): Add mpi-inline.c. + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h: Remove redundant declarations. - * grub-core/lib/posix_wrap/string.h: Include sys/types.h. - * grub-core/lib/posix_wrap/sys/types.h: Add common types. - * grub-core/lib/xzembed/xz_dec_lzma2.c (dict_put): Replace byte + * VasEBoot-core/lib/posix_wrap/string.h: Include sys/types.h. + * VasEBoot-core/lib/posix_wrap/sys/types.h: Add common types. + * VasEBoot-core/lib/xzembed/xz_dec_lzma2.c (dict_put): Replace byte identifier with b. - * grub-core/lib/xzembed/xz_dec_stream.c (dec_vli): Likewise. - * include/grub/crypto.h: Add type defines. + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (dec_vli): Likewise. + * include/VasEBoot/crypto.h: Add type defines. * util/import_gcrypth.sed: Remove duplicate type defines. 2013-01-13 Vladimir Serbinenko New command list_trusted. - * grub-core/commands/verify.c (grub_cmd_list): New function. + * VasEBoot-core/commands/verify.c (VasEBoot_cmd_list): New function. 2013-01-13 Colin Watson - * util/grub-mkimage.c (generate_image): Fix "size of public key" + * util/VasEBoot-mkimage.c (generate_image): Fix "size of public key" info message. 2013-01-13 Colin Watson Remove nested functions from PCI iterators. - * grub-core/bus/pci.c (grub_pci_iterate): Add hook_data argument, + * VasEBoot-core/bus/pci.c (VasEBoot_pci_iterate): Add hook_data argument, passed to hook. Update all callers to pass appropriate hook data. - * grub-core/bus/emu/pci.c (grub_pci_iterate): Likewise. - * include/grub/pci.h (grub_pci_iteratefunc_t): Add data argument. + * VasEBoot-core/bus/emu/pci.c (VasEBoot_pci_iterate): Likewise. + * include/VasEBoot/pci.h (VasEBoot_pci_iteratefunc_t): Add data argument. Remove NESTED_FUNC_ATTR from here and from all users. - (grub_pci_iterate): Update prototype. - * grub-core/bus/cs5536.c (grub_cs5536_find: hook): Make static + (VasEBoot_pci_iterate): Update prototype. + * VasEBoot-core/bus/cs5536.c (VasEBoot_cs5536_find: hook): Make static instead of nested. Rename to ... - (grub_cs5536_find_iter): ... this. - * grub-core/kern/efi/mm.c (stop_broadcom: find_card): Likewise. - * grub-core/kern/mips/loongson/init.c (init_pci: set_card): + (VasEBoot_cs5536_find_iter): ... this. + * VasEBoot-core/kern/efi/mm.c (stop_broadcom: find_card): Likewise. + * VasEBoot-core/kern/mips/loongson/init.c (init_pci: set_card): Likewise. - * grub-core/kern/vga_init.c (grub_qemu_init_cirrus: find_card): + * VasEBoot-core/kern/vga_init.c (VasEBoot_qemu_init_cirrus: find_card): Likewise. - * grub-core/video/bochs.c (grub_video_bochs_setup: find_card): + * VasEBoot-core/video/bochs.c (VasEBoot_video_bochs_setup: find_card): Likewise. - * grub-core/video/cirrus.c (grub_video_cirrus_setup: find_card): + * VasEBoot-core/video/cirrus.c (VasEBoot_video_cirrus_setup: find_card): Likewise. - * grub-core/video/efi_uga.c (find_framebuf: find_card): Likewise. - * grub-core/video/radeon_fuloong2e.c - (grub_video_radeon_fuloong2e_setup: find_card): Likewise. - * grub-core/video/sis315pro.c (grub_video_sis315pro_setup: + * VasEBoot-core/video/efi_uga.c (find_framebuf: find_card): Likewise. + * VasEBoot-core/video/radeon_fuloong2e.c + (VasEBoot_video_radeon_fuloong2e_setup: find_card): Likewise. + * VasEBoot-core/video/sis315pro.c (VasEBoot_video_sis315pro_setup: find_card): Likewise. - * grub-core/video/sm712.c (grub_video_sm712_setup: find_card): + * VasEBoot-core/video/sm712.c (VasEBoot_video_sm712_setup: find_card): Likewise. 2013-01-12 Vladimir Serbinenko - * grub-core/commands/verify.c: Mark messages for translating. + * VasEBoot-core/commands/verify.c: Mark messages for translating. 2013-01-12 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/mem.c (gcry_x*alloc): Make out of memory + * VasEBoot-core/lib/libgcrypt_wrap/mem.c (gcry_x*alloc): Make out of memory fatal. 2013-01-12 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/mem.c (_gcry_log_bug): Make gcrypt bugs + * VasEBoot-core/lib/libgcrypt_wrap/mem.c (_gcry_log_bug): Make gcrypt bugs fatal. 2013-01-12 Vladimir Serbinenko @@ -8339,28 +8339,28 @@ 2013-01-12 Colin Watson - Clean up dangling references to grub-setup. + Clean up dangling references to VasEBoot-setup. Fixes Ubuntu bug #1082045. - * docs/grub.texi (Images): Refer generally to grub-install rather - than directly to grub-setup. - (Installing GRUB using grub-install): Remove direct reference to - grub-setup. + * docs/VasEBoot.texi (Images): Refer generally to VasEBoot-install rather + than directly to VasEBoot-setup. + (Installing VasEBoot using VasEBoot-install): Remove direct reference to + VasEBoot-setup. (Device map) Likewise. - (Invoking grub-install): Likewise. - * docs/man/grub-install.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkimage.h2m (SEE ALSO): Likewise. - * util/grub-install.in (usage): Likewise. + (Invoking VasEBoot-install): Likewise. + * docs/man/VasEBoot-install.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkimage.h2m (SEE ALSO): Likewise. + * util/VasEBoot-install.in (usage): Likewise. - * util/bash-completion.d/grub-completion.bash.in (_grub_setup): - Apply to grub-bios-setup and grub-sparc64-setup rather than to - grub-setup. - * configure.ac: Remove grub_setup output variable. + * util/bash-completion.d/VasEBoot-completion.bash.in (_VasEBoot_setup): + Apply to VasEBoot-bios-setup and VasEBoot-sparc64-setup rather than to + VasEBoot-setup. + * configure.ac: Remove VasEBoot_setup output variable. - * docs/man/grub-bios-setup.h2m (NAME): Change name from grub-setup - to grub-bios-setup. - * docs/man/grub-sparc64-setup.h2m (NAME): Change name from - grub-setup to grub-sparc64-setup. + * docs/man/VasEBoot-bios-setup.h2m (NAME): Change name from VasEBoot-setup + to VasEBoot-bios-setup. + * docs/man/VasEBoot-sparc64-setup.h2m (NAME): Change name from + VasEBoot-setup to VasEBoot-sparc64-setup. 2013-01-11 Vladimir Serbinenko @@ -8368,79 +8368,79 @@ 2013-01-10 Vladimir Serbinenko - * grub-core/fs/ntfs.c: Ue more appropriate types. - * grub-core/fs/ntfscomp.c: Likewise. - * include/grub/ntfs.h: Likewise. + * VasEBoot-core/fs/ntfs.c: Ue more appropriate types. + * VasEBoot-core/fs/ntfscomp.c: Likewise. + * include/VasEBoot/ntfs.h: Likewise. 2013-01-10 Vladimir Serbinenko Support Apple FAT binaries on non-Apple platforms. - * include/grub/macho.h (GRUB_MACHO_FAT_EFI_MAGIC): New define. - * include/grub/i386/macho.h (GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT): + * include/VasEBoot/macho.h (VasEBoot_MACHO_FAT_EFI_MAGIC): New define. + * include/VasEBoot/i386/macho.h (VasEBoot_MACHO_CPUTYPE_IS_HOST_CURRENT): Likewise. - * grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Parse + * VasEBoot-core/loader/efi/chainloader.c (VasEBoot_cmd_chainloader): Parse Apple FAT binaries. 2013-01-10 Vladimir Serbinenko - * grub-core/kern/disk.c (grub_disk_write): Fix sector number on 4K + * VasEBoot-core/kern/disk.c (VasEBoot_disk_write): Fix sector number on 4K sector devices. 2013-01-07 Colin Watson - * grub-core/io/bufio.c (grub_bufio_open): Use grub_zalloc instead of + * VasEBoot-core/io/bufio.c (VasEBoot_bufio_open): Use VasEBoot_zalloc instead of explicitly zeroing elements. - * grub-core/io/gzio.c (grub_gzio_open): Likewise. - * grub-core/io/lzopio.c (grub_lzopio_open): Remove explicit zeroing - of elements in a structure already allocated using grub_zalloc. - * grub-core/io/xzio.c (grub_xzio_open): Likewise. + * VasEBoot-core/io/gzio.c (VasEBoot_gzio_open): Likewise. + * VasEBoot-core/io/lzopio.c (VasEBoot_lzopio_open): Remove explicit zeroing + of elements in a structure already allocated using VasEBoot_zalloc. + * VasEBoot-core/io/xzio.c (VasEBoot_xzio_open): Likewise. 2013-01-07 Colin Watson - * docs/grub.texi (grub_cpu): New subsection. - (grub_platform): Likewise. + * docs/VasEBoot.texi (VasEBoot_cpu): New subsection. + (VasEBoot_platform): Likewise. 2013-01-07 Vladimir Serbinenko - * grub-core/fs/minix.c (grub_minix_read_file): Simplify arithmetics. + * VasEBoot-core/fs/minix.c (VasEBoot_minix_read_file): Simplify arithmetics. 2013-01-05 Vladimir Serbinenko - * grub-core/fs/ext2.c (grub_ext2_read_block): Use shifts rather than + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_read_block): Use shifts rather than divisions. 2013-01-05 Vladimir Serbinenko - * grub-core/fs/ntfs.c: Eliminate useless divisions in favor of shifts. - * grub-core/fs/ntfscomp.c: Likewise. - * include/grub/ntfs.h (grub_ntfs_data): Replace spc with log_spc. - (grub_ntfs_comp): Likewise. + * VasEBoot-core/fs/ntfs.c: Eliminate useless divisions in favor of shifts. + * VasEBoot-core/fs/ntfscomp.c: Likewise. + * include/VasEBoot/ntfs.h (VasEBoot_ntfs_data): Replace spc with log_spc. + (VasEBoot_ntfs_comp): Likewise. 2013-01-05 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (-grub_nilfs2_palloc_groups_per_desc_block): + * VasEBoot-core/fs/nilfs2.c (-VasEBoot_nilfs2_palloc_groups_per_desc_block): Rename to ... - (grub_nilfs2_palloc_log_groups_per_desc_block): ... this. Return log + (VasEBoot_nilfs2_palloc_log_groups_per_desc_block): ... this. Return log of groups_per_block. All users updated. 2013-01-05 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_write): Call - grub_error properly. - * grub-core/disk/ieee1275/nand.c (grub_nand_write): Likewise. - * grub-core/disk/loopback.c (grub_loopback_write): Likewise. + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_write): Call + VasEBoot_error properly. + * VasEBoot-core/disk/ieee1275/nand.c (VasEBoot_nand_write): Likewise. + * VasEBoot-core/disk/loopback.c (VasEBoot_loopback_write): Likewise. 2013-01-03 Vladimir Serbinenko - * util/grub.d/10_kfreebsd.in: Correct the patch to zpool.cache as it's + * util/VasEBoot.d/10_kfreebsd.in: Correct the patch to zpool.cache as it's always in /boot/zfs. Reported by: Yuta Satoh. 2013-01-03 Yuta Satoh - * util/grub.d/10_kfreebsd.in: Fix improper references to grub-probe by - ${grub_probe} + * util/VasEBoot.d/10_kfreebsd.in: Fix improper references to VasEBoot-probe by + ${VasEBoot_probe} 2013-01-03 Vladimir Serbinenko @@ -8448,22 +8448,22 @@ 2013-01-03 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_susp_iterate): Avoid hang if + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_susp_iterate): Avoid hang if entry->len = 0. 2013-01-03 Colin Watson - * docs/grub.texi (Invoking grub-mkrelpath): New section. - (Invoking grub-script-check): Likewise. + * docs/VasEBoot.texi (Invoking VasEBoot-mkrelpath): New section. + (Invoking VasEBoot-script-check): Likewise. 2013-01-03 Colin Watson - * docs/grub.texi (Invoking grub-mount): New section. + * docs/VasEBoot.texi (Invoking VasEBoot-mount): New section. Reported by: Filipus Klutiero. Fixes Debian bug #666427. 2013-01-02 Colin Watson - * grub-core/tests/lib/test.c (grub_test_run): Return non-zero on + * VasEBoot-core/tests/lib/test.c (VasEBoot_test_run): Return non-zero on test failures, so that a failing unit test correctly causes 'make check' to fail. @@ -8471,12 +8471,12 @@ Fix failing printf test. - * grub-core/kern/misc.c (grub_vsnprintf_real): Parse '-', '.', and + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Parse '-', '.', and '$' in the correct order when collecting type information. 2013-01-02 Colin Watson - * docs/grub.texi (configfile): Explain environment variable + * docs/VasEBoot.texi (configfile): Explain environment variable handling. (source): New section. Reported by: Arbiel Perlacremaz. Fixes Savannah bug #35564. @@ -8485,51 +8485,51 @@ Remove several trivially-unnecessary uses of nested functions. - * grub-core/commands/i386/pc/sendkey.c - (grub_cmd_sendkey: find_key_code, find_ascii_code): Make static + * VasEBoot-core/commands/i386/pc/sendkey.c + (VasEBoot_cmd_sendkey: find_key_code, find_ascii_code): Make static instead of nested. - * grub-core/commands/legacycfg.c (legacy_file: getline): Likewise. + * VasEBoot-core/commands/legacycfg.c (legacy_file: getline): Likewise. Rename to ... (legacy_file_getline): ... this. - * grub-core/commands/loadenv.c (grub_cmd_load_env: set_var): + * VasEBoot-core/commands/loadenv.c (VasEBoot_cmd_load_env: set_var): Likewise. - * grub-core/kern/corecmd.c (grub_core_cmd_set: print_env): Likewise. - * grub-core/kern/fs.c (grub_fs_probe: dummy_func): Likewise. Rename + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_set: print_env): Likewise. + * VasEBoot-core/kern/fs.c (VasEBoot_fs_probe: dummy_func): Likewise. Rename to ... (probe_dummy_iter): ... this. - * grub-core/kern/i386/coreboot/mmap.c - (grub_linuxbios_table_iterate: check_signature): Likewise. - * grub-core/kern/parser.c (grub_parser_split_cmdline: + * VasEBoot-core/kern/i386/coreboot/mmap.c + (VasEBoot_linuxbios_table_iterate: check_signature): Likewise. + * VasEBoot-core/kern/parser.c (VasEBoot_parser_split_cmdline: check_varstate): Likewise. Mark inline. - * grub-core/lib/arg.c (find_short: fnd_short): Likewise. Pass + * VasEBoot-core/lib/arg.c (find_short: fnd_short): Likewise. Pass an additional parameter. (find_long: fnd_long): Likewise. Pass two additional parameters. - * grub-core/lib/crc.c (init_crc32c_table: reflect): Likewise. - * grub-core/lib/crc64.c (init_crc64_table: reflect): Likewise. - * grub-core/lib/ieee1275/cmos.c (grub_cmos_find_port: hook): + * VasEBoot-core/lib/crc.c (init_crc32c_table: reflect): Likewise. + * VasEBoot-core/lib/crc64.c (init_crc64_table: reflect): Likewise. + * VasEBoot-core/lib/ieee1275/cmos.c (VasEBoot_cmos_find_port: hook): Likewise. Rename to ... - (grub_cmos_find_port_iter): ... this. - * grub-core/lib/ieee1275/datetime.c (find_rtc: hook): Likewise. + (VasEBoot_cmos_find_port_iter): ... this. + * VasEBoot-core/lib/ieee1275/datetime.c (find_rtc: hook): Likewise. Rename to ... (find_rtc_iter): ... this. - * grub-core/normal/menu_entry.c (run): Fold nested editor_getsource + * VasEBoot-core/normal/menu_entry.c (run): Fold nested editor_getsource function directly into the function body, since it is only called once. 2012-12-30 Colin Watson - * grub-core/bus/usb/ehci.c (grub_ehci_pci_iter): Remove incorrect + * VasEBoot-core/bus/usb/ehci.c (VasEBoot_ehci_pci_iter): Remove incorrect __attribute__ ((unused)). - * grub-core/video/bochs.c (find_card): Likewise. - * grub-core/video/cirrus.c (find_card): Likewise. - * grub-core/video/radeon_fuloong2e.c (find_card): Likewise. - * grub-core/video/sis315pro.c (find_card): Likewise. - * grub-core/video/sm712.c (find_card): Likewise. + * VasEBoot-core/video/bochs.c (find_card): Likewise. + * VasEBoot-core/video/cirrus.c (find_card): Likewise. + * VasEBoot-core/video/radeon_fuloong2e.c (find_card): Likewise. + * VasEBoot-core/video/sis315pro.c (find_card): Likewise. + * VasEBoot-core/video/sm712.c (find_card): Likewise. 2012-12-28 Colin Watson - * util/grub-mkconfig.in: Accept GRUB_TERMINAL_OUTPUT=vga_text. + * util/VasEBoot-mkconfig.in: Accept VasEBoot_TERMINAL_OUTPUT=vga_text. Fixes Savannah bug #37821. 2012-12-28 Colin Watson @@ -8537,76 +8537,76 @@ Apply program name transformations at build-time rather than at run-time. Fixes Debian bug #696465. - * acinclude.m4 (grub_TRANSFORM): New macro. + * acinclude.m4 (VasEBoot_TRANSFORM): New macro. * configure.ac: Create output variables with transformed names for most programs. - * util/bash-completion.d/grub-completion.bash.in: Use + * util/bash-completion.d/VasEBoot-completion.bash.in: Use pre-transformed variables for program names. - * util/grub-install.in: Likewise. - * util/grub-kbdcomp.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mkconfig_lib.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. - * tests/util/grub-shell-tester.in: Remove unused assignment. - * tests/util/grub-shell.in: Likewise. - * util/grub.d/00_header.in: Likewise. + * util/VasEBoot-install.in: Likewise. + * util/VasEBoot-kbdcomp.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mkconfig_lib.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. + * tests/util/VasEBoot-shell-tester.in: Remove unused assignment. + * tests/util/VasEBoot-shell.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. 2012-12-28 Colin Watson Backport gnulib fixes for C11. Fixes Savannah bug #37738. - * grub-core/gnulib/stdio.in.h (gets): Warn on use only if + * VasEBoot-core/gnulib/stdio.in.h (gets): Warn on use only if HAVE_RAW_DECL_GETS. * m4/stdio_h.m4 (gl_STDIO_H): Check for gets. 2012-12-11 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Addmissing assignment to machine. + * util/VasEBoot.d/20_linux_xen.in: Addmissing assignment to machine. Reported by: Eriks Latosheks . 2012-12-10 Vladimir Serbinenko - * docs/grub.texi (Network): Update instructions on generating netboot + * docs/VasEBoot.texi (Network): Update instructions on generating netboot image. 2012-12-10 Vladimir Serbinenko - * grub-core/disk/cryptodisk.c (grub_cmd_cryptomount): Strip brackets + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_cmd_cryptomount): Strip brackets around device name if necessarry. 2012-12-10 Paulo Flabiano Smorigo - * util/grub-install.in: Follow the symbolic link parameter added + * util/VasEBoot-install.in: Follow the symbolic link parameter added to the file command. 2012-12-10 Andrey Borzenkov - * util/grub-install.in: Remove stale TODO. + * util/VasEBoot-install.in: Remove stale TODO. 2012-12-10 Paulo Flabiano Smorigo - * grub-core/kern/ieee1275/init.c (grub_machine_get_bootlocation): Use + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_machine_get_bootlocation): Use dynamic allocation for the bootpath buffer. 2012-12-10 Dr. Tilmann Bubeck - * grub-core/gfxmenu/view.c (init_terminal): Avoid making terminal + * VasEBoot-core/gfxmenu/view.c (init_terminal): Avoid making terminal window too small. 2012-12-10 Vladimir Serbinenko - * grub-core/term/gfxterm.c (grub_virtual_screen_setup): Get font as + * VasEBoot-core/term/gfxterm.c (VasEBoot_virtual_screen_setup): Get font as argument rather than font name. All users updated. - (grub_gfxterm_set_window): Likewise. + (VasEBoot_gfxterm_set_window): Likewise. 2012-12-10 Vladimir Testov - * util/grub-mkfont.c (argp_parser): Fix a typo which prevented --asce + * util/VasEBoot-mkfont.c (argp_parser): Fix a typo which prevented --asce from working. 2012-12-10 Vladimir Serbinenko @@ -8616,87 +8616,87 @@ 2012-12-10 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_dir): Stop if direntlen is 0 to avoid + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_dir): Stop if direntlen is 0 to avoid infinite loop on corrupted FS. 2012-12-08 Vladimir Serbinenko Fix big-endian mtime. - * grub-core/fs/ufs.c (grub_ufs_inode): Split improperly attached + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_inode): Split improperly attached together sec and usec. - (grub_ufs_dir): Use correct byteswapping for UFS time. + (VasEBoot_ufs_dir): Use correct byteswapping for UFS time. 2012-12-08 Vladimir Serbinenko Support big-endian UFS1. - * Makefile.util.def (libgrubmods): Add ufs_be.c - * grub-core/Makefile.core.def (ufs1_be): New module. - * grub-core/fs/ufs_be.c: New file. - * grub-core/fs/ufs.c: Declare grub_ufs_to_le* and use them throughout + * Makefile.util.def (libVasEBootmods): Add ufs_be.c + * VasEBoot-core/Makefile.core.def (ufs1_be): New module. + * VasEBoot-core/fs/ufs_be.c: New file. + * VasEBoot-core/fs/ufs.c: Declare VasEBoot_ufs_to_le* and use them throughout the file. 2012-11-28 Leif Lindholm - * include/grub/types.h: Fix functionality unaffecting typo in - GRUB_TARGET_WORDSIZE conditional macro. + * include/VasEBoot/types.h: Fix functionality unaffecting typo in + VasEBoot_TARGET_WORDSIZE conditional macro. 2012-11-28 Paulo Flabiano Smorigo - * grub-core/net/bootp.c (parse_dhcp_vendor): Fix double increment. + * VasEBoot-core/net/bootp.c (parse_dhcp_vendor): Fix double increment. 2012-10-28 Grégoire Sutre - * util/grub.d/10_netbsd.in: Fix tab indentation and make sure + * util/VasEBoot.d/10_netbsd.in: Fix tab indentation and make sure that /netbsd appears first (when it exists). 2012-10-12 Christoph Junghans - * grub-core/Makefile.am (moddep.lst): Use $(AWK) rather than awk. + * VasEBoot-core/Makefile.am (moddep.lst): Use $(AWK) rather than awk. Fixes Savannah bug #37558. 2012-10-12 Colin Watson - * grub-core/commands/configfile.c (GRUB_MOD_INIT): Correct + * VasEBoot-core/commands/configfile.c (VasEBoot_MOD_INIT): Correct description of extract_entries_configfile. 2012-10-05 Colin Watson - * grub-core/loader/i386/linux.c (allocate_pages): Fix spelling of + * VasEBoot-core/loader/i386/linux.c (allocate_pages): Fix spelling of preferred_address. - (grub_cmd_linux): Likewise. - * grub-core/net/icmp6.c (struct prefix_option): Fix spelling of + (VasEBoot_cmd_linux): Likewise. + * VasEBoot-core/net/icmp6.c (struct prefix_option): Fix spelling of preferred_lifetime. Update all users. 2012-09-26 Colin Watson - * Makefile.util.def (grub-mknetdir): Move to $prefix/bin. + * Makefile.util.def (VasEBoot-mknetdir): Move to $prefix/bin. Reported by: Daniel Kahn Gillmor. Fixes Debian bug #688799. 2012-09-26 Colin Watson - * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Redirect - errors from grub-probe to /dev/null, not stdout. + * util/VasEBoot-mkconfig_lib.in (is_path_readable_by_VasEBoot): Redirect + errors from VasEBoot-probe to /dev/null, not stdout. 2012-09-26 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_mount): Support AFFS bootblock in + * VasEBoot-core/fs/affs.c (VasEBoot_affs_mount): Support AFFS bootblock in sector 1. 2012-09-24 Colin Watson - * util/grub-install.in: Make the error message if $source_dir + * util/VasEBoot-install.in: Make the error message if $source_dir doesn't exist more useful. 2012-09-22 Colin Watson - Fix grub-emu build on FreeBSD. + Fix VasEBoot-emu build on FreeBSD. - * Makefile.util.def (grub-mount): Add LIBGEOM to ldadd. - * grub-core/net/drivers/emu/emunet.c: Only include Linux-specific + * Makefile.util.def (VasEBoot-mount): Add LIBGEOM to ldadd. + * VasEBoot-core/net/drivers/emu/emunet.c: Only include Linux-specific headers on Linux. - (GRUB_MOD_INIT): Return immediately on non-Linux platforms; this + (VasEBoot_MOD_INIT): Return immediately on non-Linux platforms; this implementation is currently Linux-specific. * util/getroot.c (exec_pipe): Define only on Linux or when either libzfs or libnvpair is unavailable. @@ -8704,99 +8704,99 @@ 2012-09-19 Colin Watson - * grub-core/partmap/msdos.c (pc_partition_map_embed): Revert + * VasEBoot-core/partmap/msdos.c (pc_partition_map_embed): Revert incorrect off-by-one fix from 2011-02-12. A 62-sector core image should fit before end == 63. 2012-09-19 Colin Watson - * util/grub-setup.c (write_rootdev): Remove unused core_img + * util/VasEBoot-setup.c (write_rootdev): Remove unused core_img parameter. Update all callers. - (setup): Define core_sectors only if GRUB_SETUP_BIOS, to appease + (setup): Define core_sectors only if VasEBoot_SETUP_BIOS, to appease 'gcc -Wunused-but-set-variable'. Remove unnecessary nested #ifdef - GRUB_SETUP_BIOS. + VasEBoot_SETUP_BIOS. 2012-09-18 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (grub_tab): New variable. - (grub_add_tab): New function. - * util/grub.d/10_hurd.in: Replace \t with $grub_tab orgrub_add_tab. - * util/grub.d/10_illumos.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/10_xnu.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. + * util/VasEBoot-mkconfig_lib.in (VasEBoot_tab): New variable. + (VasEBoot_add_tab): New function. + * util/VasEBoot.d/10_hurd.in: Replace \t with $VasEBoot_tab orVasEBoot_add_tab. + * util/VasEBoot.d/10_illumos.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/10_xnu.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. 2012-09-18 Vladimir Serbinenko - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN on mac. - * grub-core/term/ieee1275/console.c (grub_console_init_lately): Use - ieee1275-nocursor if GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN is set. - * grub-core/term/terminfo.c (grub_terminfo_set_current): Add new type + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN on mac. + * VasEBoot-core/term/ieee1275/console.c (VasEBoot_console_init_lately): Use + ieee1275-nocursor if VasEBoot_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN is set. + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_set_current): Add new type ieee1275-nocursor. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New value - GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New value + VasEBoot_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN. 2012-09-18 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_cmd_linux): Fix incorrect + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Fix incorrect le-conversion. Reported by: BURETTE, Bernard. 2012-09-17 Colin Watson - * util/grub-mkconfig_lib.in (grub_quote): Remove outdated sentence + * util/VasEBoot-mkconfig_lib.in (VasEBoot_quote): Remove outdated sentence from comment. 2012-09-14 Colin Watson - * grub-core/term/terminfo.c: Only fix up powerpc key repeat on + * VasEBoot-core/term/terminfo.c: Only fix up powerpc key repeat on IEEE1275 machines. Fixes powerpc-emu compilation. - * include/grub/terminfo.h: Likewise. + * include/VasEBoot/terminfo.h: Likewise. 2012-09-12 Vladimir Serbinenko - * include/grub/efi/api.h (grub_efi_runtime_services): Make vendor_guid + * include/VasEBoot/efi/api.h (VasEBoot_efi_runtime_services): Make vendor_guid a const pointer. - * grub-core/efiemu/runtime/efiemu.c (efiemu_memcpy): Make from a + * VasEBoot-core/efiemu/runtime/efiemu.c (efiemu_memcpy): Make from a const pointer. (efiemu_set_variable): Make vendor_guid a const pointer. 2012-09-12 Vladimir Serbinenko - Don't require grub-mkconfig_lib to generate manpages for programs. + Don't require VasEBoot-mkconfig_lib to generate manpages for programs. * gentpl.py (manpage): Additional argument adddeps. Add adddeps to - dependencies, don't add grub-mkconfig_lib. + dependencies, don't add VasEBoot-mkconfig_lib. (program): Pass empty adddeps. - (script): Pass grub-mkconfig_lib as adddeps. + (script): Pass VasEBoot-mkconfig_lib as adddeps. 2012-09-11 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (free_array) [GRUB_UTIL]: Fix memory leak. - * util/getroot.c (grub_find_device): Likewise. + * VasEBoot-core/disk/diskfilter.c (free_array) [VasEBoot_UTIL]: Fix memory leak. + * util/getroot.c (VasEBoot_find_device): Likewise. (get_mdadm_uuid): Likewise. - (grub_util_is_imsm): Likewise. - (grub_util_pull_device): Likewise. - * util/grub-probe.c (probe): Likewise. + (VasEBoot_util_is_imsm): Likewise. + (VasEBoot_util_pull_device): Likewise. + * util/VasEBoot-probe.c (probe): Likewise. 2012-09-10 Benoit Gschwind - * grub-core/loader/efi/appleloader.c (devpath_8): New var. + * VasEBoot-core/loader/efi/appleloader.c (devpath_8): New var. (devs): Add devpath_8. 2012-09-08 Peter Jones - * grub-core/Makefile.core.def (efifwsetup): New module. - * grub-core/commands/efi/efifwsetup.c: New file. - * grub-core/kern/efi/efi.c (grub_efi_set_variable): New function - * include/grub/efi/api.h (GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI): + * VasEBoot-core/Makefile.core.def (efifwsetup): New module. + * VasEBoot-core/commands/efi/efifwsetup.c: New file. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_set_variable): New function + * include/VasEBoot/efi/api.h (VasEBoot_EFI_OS_INDICATIONS_BOOT_TO_FW_UI): New define. - * include/grub/efi/efi.h (grub_efi_set_variable): New proto. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_set_variable): New proto. 2012-09-05 Jiri Slaby @@ -8813,22 +8813,22 @@ 2012-09-05 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (scan): Check function return value. - * grub-core/lib/ieee1275/datetime.c (grub_get_datetime): Likewise. - (grub_set_datetime): Likewise. + * VasEBoot-core/disk/ieee1275/ofdisk.c (scan): Check function return value. + * VasEBoot-core/lib/ieee1275/datetime.c (VasEBoot_get_datetime): Likewise. + (VasEBoot_set_datetime): Likewise. 2012-09-05 Vladimir Serbinenko - * grub-core/script/yylex.l: Ignore unused-function and sign-compare + * VasEBoot-core/script/yylex.l: Ignore unused-function and sign-compare warnings. 2012-09-05 Vladimir Serbinenko - * grub-core/partmap/dvh.c (grub_dvh_is_valid): Add missing byteswap. + * VasEBoot-core/partmap/dvh.c (VasEBoot_dvh_is_valid): Add missing byteswap. 2012-09-05 Vladimir Serbinenko - * grub-core/fs/xfs.c (grub_xfs_read_block): Make keys a const pointer. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_read_block): Make keys a const pointer. 2012-09-04 Colin Watson @@ -8841,23 +8841,23 @@ 2012-09-04 Colin Watson * Makefile.am (EXTRA_DIST): Add - grub-core/tests/boot/linux.init-mips.S, - grub-core/tests/boot/linux.init-ppc.S, and - grub-core/tests/boot/linux-ppc.cfg. + VasEBoot-core/tests/boot/linux.init-mips.S, + VasEBoot-core/tests/boot/linux.init-ppc.S, and + VasEBoot-core/tests/boot/linux-ppc.cfg. 2012-09-04 Colin Watson - * grub-core/mmap/mips/loongson: Remove empty directory. + * VasEBoot-core/mmap/mips/loongson: Remove empty directory. 2012-09-04 Colin Watson - * docs/man/grub-mkdevicemap.h2m: Remove, since grub-mkdevicemap is + * docs/man/VasEBoot-mkdevicemap.h2m: Remove, since VasEBoot-mkdevicemap is gone. 2012-09-04 Colin Watson - * .bzrignore: Add grub-bios-setup, grub-ofpathname, and - grub-sparc64-setup. + * .bzrignore: Add VasEBoot-bios-setup, VasEBoot-ofpathname, and + VasEBoot-sparc64-setup. 2012-08-05 Grégoire Sutre @@ -8869,132 +8869,132 @@ 2012-07-31 Grégoire Sutre - * docs/grub.texi: Note that NetBSD/i386 is Multiboot-compliant. + * docs/VasEBoot.texi: Note that NetBSD/i386 is Multiboot-compliant. (NetBSD): New subsection. 2012-07-22 Ales Nesrsta - * grub-core/bus/usb/ehci.c: PCI iter. - added PCI bus master setting. - * grub-core/bus/usb/ohci.c: PCI iter. - added PCI bus master setting. + * VasEBoot-core/bus/usb/ehci.c: PCI iter. - added PCI bus master setting. + * VasEBoot-core/bus/usb/ohci.c: PCI iter. - added PCI bus master setting. 2012-07-22 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (grub_quote): Remove extra layer of escape. - * util/grub.d/10_hurd.in: Add missing quoting. - * util/grub.d/10_illumos.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot-mkconfig_lib.in (VasEBoot_quote): Remove extra layer of escape. + * util/VasEBoot.d/10_hurd.in: Add missing quoting. + * util/VasEBoot.d/10_illumos.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2012-07-22 Vladimir Serbinenko New command `lsefi'. - * grub-core/Makefile.core.def (lsefi): New module. - * grub-core/commands/efi/lsefi.c: New file. - * include/grub/efi/api.h: Add more GUIDs. + * VasEBoot-core/Makefile.core.def (lsefi): New module. + * VasEBoot-core/commands/efi/lsefi.c: New file. + * include/VasEBoot/efi/api.h: Add more GUIDs. 2012-07-22 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c (grub_bsd_elf32_size_hook): Fix mask. - (grub_bsd_elf32_hook): Likewise. - (grub_bsd_elf64_size_hook): Likewise. - (grub_bsd_elf64_hook): Likewise. - (grub_bsd_load_elf): Likewise. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_bsd_elf32_size_hook): Fix mask. + (VasEBoot_bsd_elf32_hook): Likewise. + (VasEBoot_bsd_elf64_size_hook): Likewise. + (VasEBoot_bsd_elf64_hook): Likewise. + (VasEBoot_bsd_load_elf): Likewise. 2012-07-22 Vladimir Serbinenko - * grub-core/lib/xzembed/xz_dec_stream.c (hash_validate): Fix behaviour + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (hash_validate): Fix behaviour if hash function is unavailable. (dec_stream_header): Likewise. 2012-07-22 Vladimir Serbinenko - * grub-core/normal/autofs.c (autoload_fs_module): Save and restore + * VasEBoot-core/normal/autofs.c (autoload_fs_module): Save and restore filter state. 2012-07-22 Vladimir Serbinenko Fix coreboot compilation. - * grub-core/term/i386/pc/vga_text.c (grub_vga_text_init): Rename to ... - (grub_vga_text_init_real): ... this. - (grub_vga_text_fini): Rename to ... - (grub_vga_text_fini_real): ... this. + * VasEBoot-core/term/i386/pc/vga_text.c (VasEBoot_vga_text_init): Rename to ... + (VasEBoot_vga_text_init_real): ... this. + (VasEBoot_vga_text_fini): Rename to ... + (VasEBoot_vga_text_fini_real): ... this. 2012-07-07 Vladimir Serbinenko - * grub-core/Makefile.am: Fix path to boot/i386/pc/startup_raw.S. + * VasEBoot-core/Makefile.am: Fix path to boot/i386/pc/startup_raw.S. 2012-07-02 Vladimir Serbinenko - * grub-core/lib/legacy_parse.c: Support clear and testload. + * VasEBoot-core/lib/legacy_parse.c: Support clear and testload. 2012-07-02 Vladimir Serbinenko - * grub-core/term/efi/serial.c: Support 1.5 stop bits. + * VasEBoot-core/term/efi/serial.c: Support 1.5 stop bits. 2012-07-02 Vladimir Serbinenko - * grub-core/fs/ext2.c: Experimental support for 64-bit. + * VasEBoot-core/fs/ext2.c: Experimental support for 64-bit. 2012-07-02 Vladimir Serbinenko - * grub-core/net/tftp.c (ack): Fix endianness problem. + * VasEBoot-core/net/tftp.c (ack): Fix endianness problem. (tftp_receive): Likewise. Reported by: Michael Davidsaver. 2012-07-02 Vladimir Serbinenko - * gentpl.py: Make mans depend on grub-mkconfig_lib. + * gentpl.py: Make mans depend on VasEBoot-mkconfig_lib. 2012-07-02 Vladimir Serbinenko - * include/grub/list.h (FOR_LIST_ELEMENTS_SAFE): New macro. - * include/grub/command.h (FOR_COMMANDS_SAFE): Likewise. - * grub-core/commands/help.c (grub_cmd_help): Use FOR_COMMANDS_SAFE. + * include/VasEBoot/list.h (FOR_LIST_ELEMENTS_SAFE): New macro. + * include/VasEBoot/command.h (FOR_COMMANDS_SAFE): Likewise. + * VasEBoot-core/commands/help.c (VasEBoot_cmd_help): Use FOR_COMMANDS_SAFE. 2012-07-02 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (find_efi_mmap_size): Don't decrease + * VasEBoot-core/loader/i386/linux.c (find_efi_mmap_size): Don't decrease efi_mmap_size. Reported by: Stuart Hayes. 2012-06-28 Vladimir Serbinenko - Add monochrome text support (mda_text, aka `hercules' in grub-legacy). + Add monochrome text support (mda_text, aka `hercules' in VasEBoot-legacy). - * grub-core/Makefile.core.def (mda_text): New module. - * grub-core/lib/legacy_parse.c (grub_legacy_parse): Support `hercules'. - * grub-core/term/i386/vga_common.c (grub_console_cur_color): Moved to .. - * grub-core/term/i386/pc/vga_text.c (cur_color): ... here - * grub-core/term/i386/pc/console.c (grub_console_cur_color): ... and + * VasEBoot-core/Makefile.core.def (mda_text): New module. + * VasEBoot-core/lib/legacy_parse.c (VasEBoot_legacy_parse): Support `hercules'. + * VasEBoot-core/term/i386/vga_common.c (VasEBoot_console_cur_color): Moved to .. + * VasEBoot-core/term/i386/pc/vga_text.c (cur_color): ... here + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_cur_color): ... and here. - * grub-core/term/i386/vga_common.c (grub_console_getwh): Moved to .. - * grub-core/term/i386/pc/vga_text.c (grub_console_getwh): ... here - * grub-core/term/i386/pc/console.c (grub_console_getwh): ... and + * VasEBoot-core/term/i386/vga_common.c (VasEBoot_console_getwh): Moved to .. + * VasEBoot-core/term/i386/pc/vga_text.c (VasEBoot_console_getwh): ... here + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_getwh): ... and here. - * grub-core/term/i386/vga_common.c (grub_console_setcolorstate): Moved + * VasEBoot-core/term/i386/vga_common.c (VasEBoot_console_setcolorstate): Moved to .. - * grub-core/term/i386/pc/vga_text.c (grub_console_setcolorstate): + * VasEBoot-core/term/i386/pc/vga_text.c (VasEBoot_console_setcolorstate): ... here - * grub-core/term/i386/pc/console.c (grub_console_setcolorstate): ... and + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_setcolorstate): ... and here. - * grub-core/term/i386/vga_common.c: Removed. - * include/grub/i386/vga_common.h: Likewise. - * include/grub/vga.h (grub_vga_cr_bw_write): New function. - (grub_vga_cr_bw_read): Likewise. - * include/grub/vgaregs.h (GRUB_VGA_IO_CR_BW_INDEX): New enum value. - (GRUB_VGA_IO_CR_BW_DATA): Likewise. - * grub-core/term/i386/pc/vga_text.c [MODE_MDA]: Call - grub_vga_cr_bw_read/grub_vga_cr_bw_write instead of - grub_vga_cr_read/grub_vga_cr_write. - (grub_vga_text_setcolorstate) [MODE_MDA]: Ignore color. + * VasEBoot-core/term/i386/vga_common.c: Removed. + * include/VasEBoot/i386/vga_common.h: Likewise. + * include/VasEBoot/vga.h (VasEBoot_vga_cr_bw_write): New function. + (VasEBoot_vga_cr_bw_read): Likewise. + * include/VasEBoot/vgaregs.h (VasEBoot_VGA_IO_CR_BW_INDEX): New enum value. + (VasEBoot_VGA_IO_CR_BW_DATA): Likewise. + * VasEBoot-core/term/i386/pc/vga_text.c [MODE_MDA]: Call + VasEBoot_vga_cr_bw_read/VasEBoot_vga_cr_bw_write instead of + VasEBoot_vga_cr_read/VasEBoot_vga_cr_write. + (VasEBoot_vga_text_setcolorstate) [MODE_MDA]: Ignore color. 2012-06-27 Vladimir Serbinenko * configure.ac: Bump version to 2.00. - * grub-core/normal/main.c (features): Add feature_200_final. + * VasEBoot-core/normal/main.c (features): Add feature_200_final. 2012-06-27 Vladimir Serbinenko 2012-06-27 Jordan Uggla @@ -9003,7 +9003,7 @@ 2012-06-27 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (find_efi_mmap_size): Increase + * VasEBoot-core/loader/i386/linux.c (find_efi_mmap_size): Increase additional size to 3 pages. Reported by: Stuart Hayes. @@ -9013,124 +9013,124 @@ 2012-06-27 Vladimir Serbinenko - * grub-core/commands/wildcard.c (check_file): Fix bad logic. + * VasEBoot-core/commands/wildcard.c (check_file): Fix bad logic. put explicit "/" for empty path. (wildcard_expand): Improve dprintf. 2012-06-27 Vladimir Serbinenko - * grub-core/fs/fshelp.c (grub_fshelp_find_file): Don't free oldnode if + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_find_file): Don't free oldnode if it's equal to currnode. This can happen with "" symlink. 2012-06-27 Yves Blusseau - * util/grub-mkconfig_lib.in: Fix print messages replacing builtin + * util/VasEBoot-mkconfig_lib.in: Fix print messages replacing builtin echo shell command by printf command. 2012-06-26 Vladimir Serbinenko - * grub-core/term/arc/console.c (grub_console_init_output): Add one since + * VasEBoot-core/term/arc/console.c (VasEBoot_console_init_output): Add one since the value returned by firmware is the maximal position, not diumension. - (grub_terminfo_output_state): Use a more sane fallback. + (VasEBoot_terminfo_output_state): Use a more sane fallback. 2012-06-26 Vladimir Serbinenko - * grub-core/term/terminfo.c (print_terminfo): Print terminal dimensions. + * VasEBoot-core/term/terminfo.c (print_terminfo): Print terminal dimensions. 2012-06-26 Vladimir Serbinenko - * grub-core/kern/mips/arc/init.c (grub_machine_init): Set clock + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_machine_init): Set clock frequency to 150 MHz. 2012-06-26 Vladimir Serbinenko Apple fixes. - * grub-core/lib/i386/relocator16.S: Use correct __APPLE__ and not + * VasEBoot-core/lib/i386/relocator16.S: Use correct __APPLE__ and not __APPLE_ - * grub-core/lib/i386/relocator_common.S [__APPLE__]: Fix gdtdesc + * VasEBoot-core/lib/i386/relocator_common.S [__APPLE__]: Fix gdtdesc definition. - * grub-core/lib/i386/relocator64.S [__APPLE__]: Assemble jmp manually. + * VasEBoot-core/lib/i386/relocator64.S [__APPLE__]: Assemble jmp manually. 2012-06-26 Vladimir Serbinenko Handle slash in HFS label. - * grub-core/fs/hfs.c (macroman_to_utf8): New argument slash_translate. - (grub_hfs_dir): Tanslate slash. - (grub_hfs_label): Don't translate slash. + * VasEBoot-core/fs/hfs.c (macroman_to_utf8): New argument slash_translate. + (VasEBoot_hfs_dir): Tanslate slash. + (VasEBoot_hfs_label): Don't translate slash. 2012-06-26 Vladimir Serbinenko - * grub-core/commands/ls.c (grub_ls_list_devices): Disable + * VasEBoot-core/commands/ls.c (VasEBoot_ls_list_devices): Disable network protocol listing since it introduces problematic dependency on net module. 2012-06-26 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Add Yeeloong verified hash. + * util/VasEBoot-mkimage.c (generate_image): Add Yeeloong verified hash. 2012-06-26 Vladimir Serbinenko Init video early on yeeloong to avoid being rebooted by watchdog. - * grub-core/Makefile.am (gensm712): New target. + * VasEBoot-core/Makefile.am (gensm712): New target. (sm712_start.S): Likewise. (boot/mips/loongson/fwstart.S): Depend on sm712_start.S - * grub-core/boot/mips/loongson/fwstart.S [!FULOONG2F]: Init SM712. - * grub-core/video/sm712.c [GENINIT]: Generate compact init procedure + * VasEBoot-core/boot/mips/loongson/fwstart.S [!FULOONG2F]: Init SM712. + * VasEBoot-core/video/sm712.c [GENINIT]: Generate compact init procedure description. - * include/grub/vga.h: Move registry definitions to... - * include/grub/vgaregs.h: ... here. + * include/VasEBoot/vga.h: Move registry definitions to... + * include/VasEBoot/vgaregs.h: ... here. 2012-06-26 Vladimir Serbinenko - * grub-core/boot/decompressor/minilib.c (grub_memcmp): Fix the compare + * VasEBoot-core/boot/decompressor/minilib.c (VasEBoot_memcmp): Fix the compare signedness. 2012-06-25 Vladimir Serbinenko - * util/grub-install.in: Fix dvhtool invocation. Add arc to the list of + * util/VasEBoot-install.in: Fix dvhtool invocation. Add arc to the list of platforms with firmware disk drivers in the core. 2012-06-25 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (scan_disk) [GRUB_UTIL]: Put more + * VasEBoot-core/disk/diskfilter.c (scan_disk) [VasEBoot_UTIL]: Put more informative verbose message. (read_lv): Handle 64-bit segment size. 2012-06-25 Vladimir Serbinenko - * grub-core/disk/lvm.c (grub_lvm_getvalue): Handle 64-bit values. + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_getvalue): Handle 64-bit values. 2012-06-25 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_iterate_dir_next): Don't stop on a space + * VasEBoot-core/fs/fat.c (VasEBoot_fat_iterate_dir_next): Don't stop on a space character but still remove trainling spaces. - (grub_fat_label): Ignore archive flag. + (VasEBoot_fat_label): Ignore archive flag. 2012-06-25 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_cmd_initrd): Avoid unnecessarry + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_initrd): Avoid unnecessarry cast between linux_kernel_header and linux_kernel_params. 2012-06-25 Vladimir Serbinenko - * include/grub/diskfilter.h (grub_raid5_recover_func_t): Use proper + * include/VasEBoot/diskfilter.h (VasEBoot_raid5_recover_func_t): Use proper type for size. - (grub_raid6_recover_func_t): Likewise. - * grub-core/disk/raid5_recover.c (grub_raid5_recover): Likewise. - * grub-core/disk/raid6_recover.c (grub_raid6_recover): Likewise. + (VasEBoot_raid6_recover_func_t): Likewise. + * VasEBoot-core/disk/raid5_recover.c (VasEBoot_raid5_recover): Likewise. + * VasEBoot-core/disk/raid6_recover.c (VasEBoot_raid6_recover): Likewise. 2012-06-25 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Add Fuloong2F verified hash. + * util/VasEBoot-mkimage.c (generate_image): Add Fuloong2F verified hash. 2012-06-25 Grégoire Sutre Fix overflow. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_size) + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_size) [__NetBSD__]: Add explicit cast before bitshift. 2012-06-23 Vladimir Serbinenko @@ -9139,197 +9139,197 @@ 2012-06-23 Vladimir Serbinenko - * grub-core/boot/mips/loongson/fwstart.S: Add missing setting of high + * VasEBoot-core/boot/mips/loongson/fwstart.S: Add missing setting of high half of $a0. 2012-06-23 Vladimir Serbinenko 2012-06-23 Jordan Uggla - * docs/grub.texi: Fix search syntax. + * docs/VasEBoot.texi: Fix search syntax. (Multi-boot manual config): Put msdos rather than GPT example. Grammar corrections. 2012-06-23 Vladimir Serbinenko - * docs/grub.texi (Multi-boot manual config): Use --set. Improve remark. + * docs/VasEBoot.texi (Multi-boot manual config): Use --set. Improve remark. 2012-06-22 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_free): Fix agglomerating of free regions. + * VasEBoot-core/kern/mm.c (VasEBoot_free): Fix agglomerating of free regions. 2012-06-22 Vladimir Serbinenko - * grub-core/kern/mm.c (get_header_from_pointer): Put a more informative + * VasEBoot-core/kern/mm.c (get_header_from_pointer): Put a more informative message on double free. Put the value of magic in case of mismatch. 2012-06-22 Vladimir Serbinenko Speed-up video on yeeloong. - * grub-core/video/sm712.c (framebuffer): Remove render_target and + * VasEBoot-core/video/sm712.c (framebuffer): Remove render_target and add cached_ptr. - (grub_video_sm712_video_fini): Unmap cached_ptr. - (grub_video_sm712_setup): Use cache address and grub_video_fb_setup. - (grub_video_sm712_set_active_render_target): Removed. - (grub_video_adapter): Use grub_video_fb_set_active_render_target. - (grub_video_sm712_swap_buffers): Call grub_video_fb_swap_buffers and + (VasEBoot_video_sm712_video_fini): Unmap cached_ptr. + (VasEBoot_video_sm712_setup): Use cache address and VasEBoot_video_fb_setup. + (VasEBoot_video_sm712_set_active_render_target): Removed. + (VasEBoot_video_adapter): Use VasEBoot_video_fb_set_active_render_target. + (VasEBoot_video_sm712_swap_buffers): Call VasEBoot_video_fb_swap_buffers and sync caches. 2012-06-22 Vladimir Serbinenko Avoid flushing the same line multiple times on loongson. - * grub-core/kern/mips/cache.S [GRUB_MACHINE_MIPS_LOONGSON]: + * VasEBoot-core/kern/mips/cache.S [VasEBoot_MACHINE_MIPS_LOONGSON]: Step in 32 bytes and not 1 byte. - * grub-core/kern/mips/cache_flush.S [GRUB_MACHINE_MIPS_LOONGSON]: + * VasEBoot-core/kern/mips/cache_flush.S [VasEBoot_MACHINE_MIPS_LOONGSON]: Likewise. 2012-06-22 Vladimir Serbinenko - * util/getroot.c (grub_find_root_devices_from_mountinfo): Handle btrfs + * util/getroot.c (VasEBoot_find_root_devices_from_mountinfo): Handle btrfs subvolumes. 2012-06-22 Vladimir Serbinenko Implement flow control for http. - * grub-core/net/http.c (parse_line): Handle response 206. + * VasEBoot-core/net/http.c (parse_line): Handle response 206. (http_receive): Stall if too many packets are in the queue. (http_establish): Fix range header. (http_seek): Fix double free. (http_close): Likewise. (http_packets_pulled): New function. - (grub_http_protocol): Set http_seek - * grub-core/net/tcp.c (grub_net_tcp_socket): New field `i_stall'. + (VasEBoot_http_protocol): Set http_seek + * VasEBoot-core/net/tcp.c (VasEBoot_net_tcp_socket): New field `i_stall'. (ack_real): Set window depending on i_stall. - (grub_net_send_tcp_packet): Likewise. - (grub_net_tcp_stall): New function. - (grub_net_tcp_unstall): Likewise. - * include/grub/net/tcp.h (grub_net_tcp_stall): New proto. - (grub_net_tcp_unstall): Likewise. + (VasEBoot_net_send_tcp_packet): Likewise. + (VasEBoot_net_tcp_stall): New function. + (VasEBoot_net_tcp_unstall): Likewise. + * include/VasEBoot/net/tcp.h (VasEBoot_net_tcp_stall): New proto. + (VasEBoot_net_tcp_unstall): Likewise. 2012-06-22 Vladimir Serbinenko - * grub-core/net/tftp.c: Decrease stall to 50 packets. + * VasEBoot-core/net/tftp.c: Decrease stall to 50 packets. 2012-06-22 Vladimir Serbinenko - * grub-core/net/net.c (grub_net_fs_open): Free resources on failed open. + * VasEBoot-core/net/net.c (VasEBoot_net_fs_open): Free resources on failed open. 2012-06-22 Vladimir Serbinenko - * tests/util/grub-shell.in: Fix a typo. + * tests/util/VasEBoot-shell.in: Fix a typo. 2012-06-22 Vladimir Serbinenko Implement flow control for tftp. - * grub-core/net/net.c (receive_packets): Decrease the stop to 10 + * VasEBoot-core/net/net.c (receive_packets): Decrease the stop to 10 packets but stop only if stop condition is satisfied. - (grub_net_fs_read_real): Call packets_pulled after real read. Use + (VasEBoot_net_fs_read_real): Call packets_pulled after real read. Use `stall' instead of `eof' as stop condition. - * grub-core/net/http.c (parse_line): Set `stall' on EOF. + * VasEBoot-core/net/http.c (parse_line): Set `stall' on EOF. (http_err): Likewise. - * grub-core/net/tftp.c (ack): Replace the first argument with data + * VasEBoot-core/net/tftp.c (ack): Replace the first argument with data instead of socket. (tftp_receive): Stall if too many packets are in wait queue. (tftp_packets_pulled): New function. - (grub_tftp_protocol): Set packets_pulled. - * include/grub/net.h (grub_net_packets): New field count. - (grub_net_put_packet): Increment count. - (grub_net_remove_packet): Likewise. - (grub_net_app_protocol): New field `packets_pulled'. - (grub_net): New field `stall'. + (VasEBoot_tftp_protocol): Set packets_pulled. + * include/VasEBoot/net.h (VasEBoot_net_packets): New field count. + (VasEBoot_net_put_packet): Increment count. + (VasEBoot_net_remove_packet): Likewise. + (VasEBoot_net_app_protocol): New field `packets_pulled'. + (VasEBoot_net): New field `stall'. 2012-06-22 Vladimir Serbinenko - * grub-core/net/net.c (receive_packets): Stop after 100 packets to let + * VasEBoot-core/net/net.c (receive_packets): Stop after 100 packets to let sync part to handle them. 2012-06-21 Vladimir Serbinenko - * grub-core/kern/main.c (grub_set_prefix_and_root): Fix memory leak. - * grub-core/net/drivers/ieee1275/ofnet.c - (grub_ieee1275_net_config_real): Likewise. + * VasEBoot-core/kern/main.c (VasEBoot_set_prefix_and_root): Fix memory leak. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c + (VasEBoot_ieee1275_net_config_real): Likewise. 2012-06-21 Vladimir Serbinenko - * grub-core/net/bootp.c (grub_net_configure_by_dhcp_ack): Don't create + * VasEBoot-core/net/bootp.c (VasEBoot_net_configure_by_dhcp_ack): Don't create the direct route for server/gateway. 2012-06-21 Vladimir Serbinenko - * grub-core/net/bootp.c (grub_net_configure_by_dhcp_ack): Prefer + * VasEBoot-core/net/bootp.c (VasEBoot_net_configure_by_dhcp_ack): Prefer IP address to server name since we may not hame the DNS. 2012-06-21 Vladimir Serbinenko - * grub-core/net/dns.c (grub_cmd_nslookup): Init addresses to 0 to avoid + * VasEBoot-core/net/dns.c (VasEBoot_cmd_nslookup): Init addresses to 0 to avoid freeing random buffer on failure. - * grub-core/net/net.c (grub_net_resolve_address): Likewise. + * VasEBoot-core/net/net.c (VasEBoot_net_resolve_address): Likewise. 2012-06-21 Vladimir Serbinenko - * grub-core/net/bootp.c (grub_cmd_bootp): Fix packet allocation size. + * VasEBoot-core/net/bootp.c (VasEBoot_cmd_bootp): Fix packet allocation size. 2012-06-21 Vladimir Serbinenko - * grub-core/net/drivers/emu/emunet.c (get_card_packet): Allocate the + * VasEBoot-core/net/drivers/emu/emunet.c (get_card_packet): Allocate the reserved bytes. - * grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_recv): Likewise. - * grub-core/net/drivers/ieee1275/ofnet.c (get_card_packet): Likewise. + * VasEBoot-core/net/drivers/i386/pc/pxe.c (VasEBoot_pxe_recv): Likewise. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (get_card_packet): Likewise. Handle malloc error correctly. 2012-06-21 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_arglist_to_argv): Escape + * VasEBoot-core/script/execute.c (VasEBoot_script_arglist_to_argv): Escape blocks. 2012-06-21 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Fix double + * VasEBoot-core/disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Fix double increment. 2012-06-20 Vladimir Serbinenko - * grub-core/net/dns.c (grub_cmd_nslookup): Use configured DNS servers if + * VasEBoot-core/net/dns.c (VasEBoot_cmd_nslookup): Use configured DNS servers if none is explicitly specified. 2012-06-20 Vladimir Serbinenko - * grub-core/net/dns.c (grub_net_add_dns_server): Don't erase old servers + * VasEBoot-core/net/dns.c (VasEBoot_net_add_dns_server): Don't erase old servers while reallocating. 2012-06-20 Vladimir Serbinenko Respect netmask from bootp/dhcp. - * grub-core/net/bootp.c (parse_dhcp_vendor): Parse mask. - (grub_net_configure_by_dhcp_ack): Use mask and grub_net_add_ipv4_local. - * grub-core/net/net.c (grub_net_add_addr): Split creating local route + * VasEBoot-core/net/bootp.c (parse_dhcp_vendor): Parse mask. + (VasEBoot_net_configure_by_dhcp_ack): Use mask and VasEBoot_net_add_ipv4_local. + * VasEBoot-core/net/net.c (VasEBoot_net_add_addr): Split creating local route into ... - (grub_net_add_ipv4_local): ... this. - (grub_cmd_addaddr): Use grub_net_add_ipv4_local. - * include/grub/net.h (GRUB_NET_BOOTP_NETMASK): New enum value. - (grub_net_add_ipv4_local): New proto. + (VasEBoot_net_add_ipv4_local): ... this. + (VasEBoot_cmd_addaddr): Use VasEBoot_net_add_ipv4_local. + * include/VasEBoot/net.h (VasEBoot_NET_BOOTP_NETMASK): New enum value. + (VasEBoot_net_add_ipv4_local): New proto. 2012-06-20 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_linux_boot): Setup video before + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Setup video before determining EFI memory map size. 2012-06-20 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Escape commas. + * VasEBoot-core/disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Escape commas. 2012-06-20 Vladimir Serbinenko - * grub-core/kern/main.c (grub_set_prefix_and_root): Skip escaped commas + * VasEBoot-core/kern/main.c (VasEBoot_set_prefix_and_root): Skip escaped commas when looking for partition separator. 2012-06-20 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): Escape commas. 2012-06-20 Vladimir Serbinenko @@ -9337,43 +9337,43 @@ Restructure FAT driver to avoid hook in label reading as it hits a GCC bug. - * include/grub/err.h (grub_err_t): New enum value GRUB_ERR_EOF. - * grub-core/fs/fat.c (grub_fat_iterate_context): New struct. - (grub_fat_iterate_dir): Split into ... - (grub_fat_iterate_init): ... this, ... - (grub_fat_iterate_fini): ... this, ... - (grub_fat_iterate_dir_next): ... and this. All users updated. + * include/VasEBoot/err.h (VasEBoot_err_t): New enum value VasEBoot_ERR_EOF. + * VasEBoot-core/fs/fat.c (VasEBoot_fat_iterate_context): New struct. + (VasEBoot_fat_iterate_dir): Split into ... + (VasEBoot_fat_iterate_init): ... this, ... + (VasEBoot_fat_iterate_fini): ... this, ... + (VasEBoot_fat_iterate_dir_next): ... and this. All users updated. 2012-06-20 Vladimir Serbinenko - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New enum value - GRUB_IEEE1275_FLAG_BROKEN_REPEAT. - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_BROKEN_REPEAT on PowerBook3,3. - * include/grub/terminfo.h (grub_terminfo_input_state) [__powerpc__]: + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New enum value + VasEBoot_IEEE1275_FLAG_BROKEN_REPEAT. + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_BROKEN_REPEAT on PowerBook3,3. + * include/VasEBoot/terminfo.h (VasEBoot_terminfo_input_state) [__powerpc__]: New fields last_key and last_key_time. - * grub-core/term/terminfo.c (grub_terminfo_getkey): Transform + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_getkey): Transform extended key-esc into extended key-extended key. 2012-06-19 Vladimir Serbinenko Avoid unnecessary memcpy of whole video buffer. - * grub-core/video/fb/video_fb.c (dirty): New struct. + * VasEBoot-core/video/fb/video_fb.c (dirty): New struct. (framebuffer): Add members current_dirty and previous_dirty. (dirty): New function. - (grub_video_fb_fill_rect): Update dirty. + (VasEBoot_video_fb_fill_rect): Update dirty. (common_blitter): Likewise. - (grub_video_fb_scroll): Likewise. + (VasEBoot_video_fb_scroll): Likewise. (doublebuf_blit_update_screen): Copy only dirty part. (doublebuf_pageflipping_update_screen): Likewise. - (grub_video_fb_doublebuf_blit_init): Init dirty. + (VasEBoot_video_fb_doublebuf_blit_init): Init dirty. (doublebuf_pageflipping_init): Likewise. - (grub_video_fb_setup): Likewise. + (VasEBoot_video_fb_setup): Likewise. 2012-06-19 Vladimir Serbinenko - * grub-core/net/drivers/ieee1275/ofnet.c (search_net_devices): Decrease + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (search_net_devices): Decrease poll rate. 2012-06-19 Vladimir Serbinenko @@ -9381,55 +9381,55 @@ Fix wildcard regexp dot and other special characters handling. Reported by: Robert Mabee. - * grub-core/commands/wildcard.c (isregexop): Add "|+{}[]?". + * VasEBoot-core/commands/wildcard.c (isregexop): Add "|+{}[]?". (make_regex): Escape "|+{}[]". Transform '?' to '.?'. (split_path): Trigger expansion on '?'. (unescape): New function. (wildcard_expand): Unescape parts copied without globbing. - * grub-core/script/execute.c (wildcard_escape): Escape '?'. - (grub_script_arglist_to_argv): Don't unescape expansions. + * VasEBoot-core/script/execute.c (wildcard_escape): Escape '?'. + (VasEBoot_script_arglist_to_argv): Don't unescape expansions. 2012-06-19 Vladimir Serbinenko - * include/grub/net.h (grub_net_card): New member txbufsize. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New enum values - GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX and - GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN. - * grub-core/net/drivers/efi/efinet.c (grub_efinet_findcards): Use + * include/VasEBoot/net.h (VasEBoot_net_card): New member txbufsize. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New enum values + VasEBoot_IEEE1275_FLAG_NO_OFNET_SUFFIX and + VasEBoot_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN. + * VasEBoot-core/net/drivers/efi/efinet.c (VasEBoot_efinet_findcards): Use txbufsize. - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Use + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Use compatible property to check for macs. Set - GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX and - GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN on macs. - * grub-core/net/drivers/ieee1275/ofnet.c (card_open): Don't add suffix - if GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX is set. + VasEBoot_IEEE1275_FLAG_NO_OFNET_SUFFIX and + VasEBoot_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN on macs. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (card_open): Don't add suffix + if VasEBoot_IEEE1275_FLAG_NO_OFNET_SUFFIX is set. (send_card_buffer): Use txbuf. - (grub_ofnet_findcards): Allocate txbuf. Simplify code flow and move + (VasEBoot_ofnet_findcards): Allocate txbuf. Simplify code flow and move nested function out of the parent while on it. 2012-06-19 Vladimir Serbinenko - * grub-core/net/drivers/ieee1275/ofnet.c (get_card_packet): Fix packet + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (get_card_packet): Fix packet presence check. - (grub_ieee1275_net_config_real): Fix config pointer. + (VasEBoot_ieee1275_net_config_real): Fix config pointer. 2012-06-19 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args): Extend + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_parse_args): Extend filename parsing to non-block devices. 2012-06-19 Vladimir Serbinenko - * grub-core/kern/device.c (grub_device_open): Remove dead code. + * VasEBoot-core/kern/device.c (VasEBoot_device_open): Remove dead code. 2012-06-18 Vladimir Serbinenko - * include/grub/elf.h: Rename R_PPC to GRUB_R_PPC to avoid collisions. + * include/VasEBoot/elf.h: Rename R_PPC to VasEBoot_R_PPC to avoid collisions. All users updated. 2012-06-18 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Generate + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Generate UUID search command even if hints probing failed. 2012-06-18 Vladimir Serbinenko @@ -9440,86 +9440,86 @@ Speed-up video on fuloong. - * grub-core/bus/bonito.c (grub_pci_device_map_range_cached): + * VasEBoot-core/bus/bonito.c (VasEBoot_pci_device_map_range_cached): New function. - (grub_pci_device_unmap_range): Handle non-cached address. - * grub-core/video/sis315pro.c (framebuffer): Remove render_target and + (VasEBoot_pci_device_unmap_range): Handle non-cached address. + * VasEBoot-core/video/sis315pro.c (framebuffer): Remove render_target and add direct_ptr. - (grub_video_sis315pro_video_fini): Unmap direct_ptr. - (grub_video_sis315pro_setup): Use cache address and grub_video_fb_setup. - (grub_video_sis315pro_set_active_render_target): Removed. - (grub_video_sis315pro_get_info_and_fini): Use uncached address. - (grub_video_adapter): Use grub_video_fb_set_active_render_target. - (grub_video_sis315pro_swap_buffers): Call grub_video_fb_swap_buffers and + (VasEBoot_video_sis315pro_video_fini): Unmap direct_ptr. + (VasEBoot_video_sis315pro_setup): Use cache address and VasEBoot_video_fb_setup. + (VasEBoot_video_sis315pro_set_active_render_target): Removed. + (VasEBoot_video_sis315pro_get_info_and_fini): Use uncached address. + (VasEBoot_video_adapter): Use VasEBoot_video_fb_set_active_render_target. + (VasEBoot_video_sis315pro_swap_buffers): Call VasEBoot_video_fb_swap_buffers and sync caches. - * include/grub/mips/loongson/pci.h (grub_pci_device_map_range_cached): + * include/VasEBoot/mips/loongson/pci.h (VasEBoot_pci_device_map_range_cached): New proto. 2012-06-16 Vladimir Serbinenko - * docs/grub.texi (Multi-boot manual config): New section. + * docs/VasEBoot.texi (Multi-boot manual config): New section. 2012-06-15 Vladimir Serbinenko Avoid slow read-back from VRAM. - * include/grub/video_fb.h (grub_video_fb_doublebuf_update_screen_t): + * include/VasEBoot/video_fb.h (VasEBoot_video_fb_doublebuf_update_screen_t): Move from here ... - * grub-core/video/fb/video_fb.c - (grub_video_fb_doublebuf_update_screen_t): ... here. Remove arguments. - * grub-core/video/fb/video_fb.c (framebuf_t): New type. + * VasEBoot-core/video/fb/video_fb.c + (VasEBoot_video_fb_doublebuf_update_screen_t): ... here. Remove arguments. + * VasEBoot-core/video/fb/video_fb.c (framebuf_t): New type. (front_target): Remove front_target. Add pages. - (grub_video_fb_init): Skip setting front_pages. - (grub_video_fb_fini): Likewise. + (VasEBoot_video_fb_init): Skip setting front_pages. + (VasEBoot_video_fb_fini): Likewise. (doublebuf_blit_update_screen): Use pages. - (grub_video_fb_doublebuf_blit_init): Likewise. + (VasEBoot_video_fb_doublebuf_blit_init): Likewise. (doublebuf_pageflipping_init): Allocate offscreen buffer. (doublebuf_pageflipping_update_screen): Use offscreen buffer. - (grub_video_fb_setup): Prefer doublebuffing. + (VasEBoot_video_fb_setup): Prefer doublebuffing. 2012-06-15 Vladimir Serbinenko - * grub-core/normal/main.c (GRUB_MOD_INIT): Ignore errors when loading + * VasEBoot-core/normal/main.c (VasEBoot_MOD_INIT): Ignore errors when loading gzio. 2012-06-15 Vladimir Serbinenko Add loongson tests. - * tests/util/grub-shell.in: Handle loongson. + * tests/util/VasEBoot-shell.in: Handle loongson. * tests/partmap_test.in: Add loongson to the list of platform using ATA drivers. - * grub-core/tests/boot/linux.init-mips.S (SHUTDOWN_MAGIC3) [REBOOT]: + * VasEBoot-core/tests/boot/linux.init-mips.S (SHUTDOWN_MAGIC3) [REBOOT]: Reboot instead of shutdown if REBOOT is defined. 2012-06-15 Vladimir Serbinenko - * grub-core/lib/mips/loongson/reboot.c (grub_reboot): Use 32-bit + * VasEBoot-core/lib/mips/loongson/reboot.c (VasEBoot_reboot): Use 32-bit sized ports since unlike on real hardware qemu supports only 32-bit regs. 2012-06-15 Vladimir Serbinenko - * Makefile.util.def (grub-mkrescue): Enable on loongson. - * util/grub-mkrescue.in: Handle loongson. + * Makefile.util.def (VasEBoot-mkrescue): Enable on loongson. + * util/VasEBoot-mkrescue.in: Handle loongson. 2012-06-14 Vladimir Serbinenko * util/getroot.c (convert_system_partition_to_system_disk) [__APPLE__]: Set is_part appropriately. - (grub_util_biosdisk_get_grub_dev): Use is_part rather than comparing + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Use is_part rather than comparing names. Canonicalize partition without full disk. 2012-06-13 Vladimir Serbinenko Revert usb-quiesce since it's wrong. - * grub-core/disk/ieee1275/ofdisk.c (quiesce): Removed. - (grub_ofdisk_init): Don't do quiesce. + * VasEBoot-core/disk/ieee1275/ofdisk.c (quiesce): Removed. + (VasEBoot_ofdisk_init): Don't do quiesce. 2012-06-13 Vladimir Serbinenko - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Apply + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Apply PowerMac workaround to Xserves as well. Information supplied by: Benjamin Herrenschmidt. @@ -9527,124 +9527,124 @@ Don't assume that beginning address is also the entry point on ppc. - * grub-core/loader/powerpc/ieee1275/linux.c (linux_entry): New variable. - (grub_linux_boot): Use linux_entry. - (grub_linux_load32): Fill linux_entry. Fix setting linux_addr. - (grub_linux_load64): Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (linux_entry): New variable. + (VasEBoot_linux_boot): Use linux_entry. + (VasEBoot_linux_load32): Fill linux_entry. Fix setting linux_addr. + (VasEBoot_linux_load64): Likewise. 2012-06-13 Vladimir Serbinenko - * util/grub-install.in: Fix cross-disk check on non-PreP machines. + * util/VasEBoot-install.in: Fix cross-disk check on non-PreP machines. 2012-06-13 Vladimir Serbinenko - * grub-core/term/ieee1275/console.c (grub_console_fini): Don't + * VasEBoot-core/term/ieee1275/console.c (VasEBoot_console_fini): Don't needlessly lose the console. 2012-06-13 Vladimir Serbinenko - * grub-core/normal/dyncmd.c (read_command_list): Don't access freed + * VasEBoot-core/normal/dyncmd.c (read_command_list): Don't access freed space. 2012-06-11 Vladimir Serbinenko - Remove non-functional EFI grub_get_rtc. Put a better fatal message - than current grub_get_rtc() not implemented when booted with + Remove non-functional EFI VasEBoot_get_rtc. Put a better fatal message + than current VasEBoot_get_rtc() not implemented when booted with coreboot without TSC. - * grub-core/Makefile.am: Exclude efi/time.h from kernel headers. + * VasEBoot-core/Makefile.am: Exclude efi/time.h from kernel headers. Add machine/time.h to kernel headers on loongson. - * grub-core/Makefile.core.def (kernel): Remove + * VasEBoot-core/Makefile.core.def (kernel): Remove kern/generic/rtc_get_time_ms.c on qemu-multiboot-coreboot. - * grub-core/kern/efi/efi.c (grub_rtc_get_time_ms): Removed. - (grub_get_rtc): Likewise. - * grub-core/kern/generic/rtc_get_time_ms.c: Include grub/machine/time.h. - * grub-core/kern/i386/coreboot/init.c (grub_get_rtc): Removed. - * grub-core/kern/i386/pc/init.c: Include grub/machine/init.h. - * grub-core/kern/i386/tsc.c (grub_tsc_init) - [!GRUB_MACHINE_PCBIOS && !GRUB_MACHINE_IEEE1275]: Call grub_fatal + * VasEBoot-core/kern/efi/efi.c (VasEBoot_rtc_get_time_ms): Removed. + (VasEBoot_get_rtc): Likewise. + * VasEBoot-core/kern/generic/rtc_get_time_ms.c: Include VasEBoot/machine/time.h. + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_get_rtc): Removed. + * VasEBoot-core/kern/i386/pc/init.c: Include VasEBoot/machine/init.h. + * VasEBoot-core/kern/i386/tsc.c (VasEBoot_tsc_init) + [!VasEBoot_MACHINE_PCBIOS && !VasEBoot_MACHINE_IEEE1275]: Call VasEBoot_fatal rather than installing known non-working time source. - * grub-core/kern/ieee1275/init.c (grub_get_rtc): Removed. - * grub-core/kern/mips/loongson/init.c: Include grub/machine/time.h. - * include/grub/time.h: Don't include machine/time.h. - * include/grub/efi/time.h: Removed. - * include/grub/i386/efi/time.h: Likewise. - * include/grub/i386/ieee1275/time.h: Likewise. - * include/grub/powerpc/ieee1275/time.h: Likewise. - * include/grub/sparc64/ieee1275/time.h: Likewise. - * include/grub/x86_64/efi/time.h: Likewise. + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_get_rtc): Removed. + * VasEBoot-core/kern/mips/loongson/init.c: Include VasEBoot/machine/time.h. + * include/VasEBoot/time.h: Don't include machine/time.h. + * include/VasEBoot/efi/time.h: Removed. + * include/VasEBoot/i386/efi/time.h: Likewise. + * include/VasEBoot/i386/ieee1275/time.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/time.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/time.h: Likewise. + * include/VasEBoot/x86_64/efi/time.h: Likewise. 2012-06-11 Vladimir Serbinenko Remove dot on i and j when combining with above diacritics. - * include/grub/unicode.h (GRUB_UNICODE_DOTLESS_LOWERCASE_I): New enum + * include/VasEBoot/unicode.h (VasEBoot_UNICODE_DOTLESS_LOWERCASE_I): New enum value. - (GRUB_UNICODE_DOTLESS_LOWERCASE_J): Likewise. - * grub-core/font/font.c (grub_font_construct_dry_run): Replace i and j + (VasEBoot_UNICODE_DOTLESS_LOWERCASE_J): Likewise. + * VasEBoot-core/font/font.c (VasEBoot_font_construct_dry_run): Replace i and j with dotless variants when any combining above is present. 2012-06-09 Vladimir Serbinenko - * tests/grub_script_expansion.in: Explicitly tell grep that we handle + * tests/VasEBoot_script_expansion.in: Explicitly tell grep that we handle text and not binary. 2012-06-09 Vladimir Serbinenko Stop polling as soon as we have the packet we were waiting for. - * include/grub/net.h (grub_net_poll_cards): New argument stop_condition. + * include/VasEBoot/net.h (VasEBoot_net_poll_cards): New argument stop_condition. All users updated. - * grub-core/net/arp.c (have_pending): New var. + * VasEBoot-core/net/arp.c (have_pending): New var. (pending_req): Likewise. - (grub_net_arp_send_request): Fill pending_req and use have_pending as + (VasEBoot_net_arp_send_request): Fill pending_req and use have_pending as stop indicator. - (grub_net_arp_receive): Set have_pending. - * grub-core/net/dns.c (recv_data): New field stop. + (VasEBoot_net_arp_receive): Set have_pending. + * VasEBoot-core/net/dns.c (recv_data): New field stop. (recv_hook): Set stop. - (grub_net_dns_lookup): Init stop and use as stop condition. - * grub-core/net/http.c (http_establish): Use headers_recv as stop + (VasEBoot_net_dns_lookup): Init stop and use as stop condition. + * VasEBoot-core/net/http.c (http_establish): Use headers_recv as stop condition. - * grub-core/net/net.c (grub_net_poll_cards): New argument + * VasEBoot-core/net/net.c (VasEBoot_net_poll_cards): New argument stop_condition. Stop when it goes true. - * grub-core/net/tcp.c (grub_net_tcp_open): Use `established' as stop + * VasEBoot-core/net/tcp.c (VasEBoot_net_tcp_open): Use `established' as stop indicator. - * grub-core/net/tftp.c (tftp_open): Use `have_oack' as stop indicator. + * VasEBoot-core/net/tftp.c (tftp_open): Use `have_oack' as stop indicator. 2012-06-09 Vladimir Serbinenko Keep TX and RX buffers on EFI rather than always allocate new ones. - * include/grub/net.h (grub_net_card_driver): Allow driver to modify + * include/VasEBoot/net.h (VasEBoot_net_card_driver): Allow driver to modify card. All users updated. - (grub_net_card): New members txbuf, rcvbuf, rcvbufsize and txbusy. - * grub-core/net/drivers/efi/efinet.c (send_card_buffer): Reuse buffer. + (VasEBoot_net_card): New members txbuf, rcvbuf, rcvbufsize and txbusy. + * VasEBoot-core/net/drivers/efi/efinet.c (send_card_buffer): Reuse buffer. (get_card_packet): Likewise. - (grub_efinet_findcards): Init new fields. + (VasEBoot_efinet_findcards): Init new fields. 2012-06-09 Vladimir Serbinenko - * grub-core/term/ieee1275/serial.c (do_real_config): Fix cast to fix + * VasEBoot-core/term/ieee1275/serial.c (do_real_config): Fix cast to fix compilation error on sparc64. 2012-06-09 Vladimir Serbinenko Use ITC on IA64 rather than broken routine based on daytime. - * grub-core/kern/efi/efi.c (grub_rtc_get_time_ms) [__ia64__]: Remove on + * VasEBoot-core/kern/efi/efi.c (VasEBoot_rtc_get_time_ms) [__ia64__]: Remove on ia64. - (grub_get_rtc) [__ia64__]: Likewise. - * grub-core/kern/ia64/efi/init.c (divisor): New variable. + (VasEBoot_get_rtc) [__ia64__]: Likewise. + * VasEBoot-core/kern/ia64/efi/init.c (divisor): New variable. (get_itc): New function. - (grub_rtc_get_time_ms): Likewise. - (grub_machine_init): Calibrate ITC. - * include/grub/efi/time.h (grub_get_rtc), (GRUB_TICKS_PER_SECOND): + (VasEBoot_rtc_get_time_ms): Likewise. + (VasEBoot_machine_init): Calibrate ITC. + * include/VasEBoot/efi/time.h (VasEBoot_get_rtc), (VasEBoot_TICKS_PER_SECOND): Keep only on non-ia64. Don't export since it's broken and used only if TSC is unavailable. 2012-06-09 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c (find_parent_device): Return the parent + * VasEBoot-core/disk/efi/efidisk.c (find_parent_device): Return the parent even if it's used. (name_devices): Replace #if 0 with #ifdef DEBUG_NAMES. Skip if parent is unused. @@ -9657,22 +9657,22 @@ Fix wildcard escaping. - * grub-core/commands/wildcard.c (wildcard_escape): Moved from here ... - * grub-core/script/execute.c (wildcard_escape): .. to here. + * VasEBoot-core/commands/wildcard.c (wildcard_escape): Moved from here ... + * VasEBoot-core/script/execute.c (wildcard_escape): .. to here. Don't escape dot. - * grub-core/commands/wildcard.c (wildcard_unescape): Moved from here ... - * grub-core/script/execute.c (wildcard_unescape): .. to here. + * VasEBoot-core/commands/wildcard.c (wildcard_unescape): Moved from here ... + * VasEBoot-core/script/execute.c (wildcard_unescape): .. to here. Don't escape dot. - * grub-core/script/execute.c (gettext_append): Always escape. - (grub_script_arglist_to_argv): Always handle escaping/unescaping. - * grub-core/script/yylex.l: Don't cut away the escaping. - * tests/grub_script_echo1.in: Add tests with wildcard. + * VasEBoot-core/script/execute.c (gettext_append): Always escape. + (VasEBoot_script_arglist_to_argv): Always handle escaping/unescaping. + * VasEBoot-core/script/yylex.l: Don't cut away the escaping. + * tests/VasEBoot_script_echo1.in: Add tests with wildcard. 2012-06-08 Vladimir Serbinenko - * grub-core/bus/usb/serial/ftdi.c (real_config): Handle 1.5 stop bits. + * VasEBoot-core/bus/usb/serial/ftdi.c (real_config): Handle 1.5 stop bits. (ftdi_hw_configure): Likewise. - * grub-core/bus/usb/serial/pl2303.c (GRUB_PL2303_STOP_BITS_1_5): New + * VasEBoot-core/bus/usb/serial/pl2303.c (VasEBoot_PL2303_STOP_BITS_1_5): New define. (real_config): Handle 1.5 stop bits. (pl2303_hw_configure): Likewise. @@ -9680,20 +9680,20 @@ 2012-06-08 Vladimir Serbinenko * Makefile.am: Add ppc linux bootcheck. - * grub-core/tests/boot/linux-ppc.cfg: New file. - * grub-core/tests/boot/linux.init-ppc.S: Likewise. + * VasEBoot-core/tests/boot/linux-ppc.cfg: New file. + * VasEBoot-core/tests/boot/linux.init-ppc.S: Likewise. 2012-06-08 Vladimir Serbinenko - * tests/grub_script_expansion.in: Skip network protocols. + * tests/VasEBoot_script_expansion.in: Skip network protocols. 2012-06-08 Vladimir Serbinenko - * tests/util/grub-shell.in: Use escc-ch-a port on ppc. + * tests/util/VasEBoot-shell.in: Use escc-ch-a port on ppc. 2012-06-08 Vladimir Serbinenko - * util/powerpc/ieee1275/grub-mkrescue.in: Handle (and ignore) + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Handle (and ignore) --rom-directory. Add -graft-points. @@ -9702,13 +9702,13 @@ ESCC serial driver for conducting sautomated tests in qemu. Not tested on real hardware. - * include/grub/serial.h (grub_serial_port): New field escc_desc. - * grub-core/term/ieee1275/escc.c: New file. - * grub-core/Makefile.core.def (escc): New module. + * include/VasEBoot/serial.h (VasEBoot_serial_port): New field escc_desc. + * VasEBoot-core/term/ieee1275/escc.c: New file. + * VasEBoot-core/Makefile.core.def (escc): New module. 2012-06-08 Vladimir Serbinenko - * grub-core/term/ieee1275/serial.c (do_real_config): Set handle to + * VasEBoot-core/term/ieee1275/serial.c (do_real_config): Set handle to invalid on error. (serial_hw_fetch): Don't read invalid handle. (serial_hw_put): Don't write into invalid handle. @@ -9717,92 +9717,92 @@ Add a 1.5 stop bits value. - * grub-core/term/serial.c (grub_cmd_serial): Handle 1.5. - * include/grub/serial.h (grub_serial_stop_bits_t): Add - GRUB_SERIAL_STOP_BITS_1_5. + * VasEBoot-core/term/serial.c (VasEBoot_cmd_serial): Handle 1.5. + * include/VasEBoot/serial.h (VasEBoot_serial_stop_bits_t): Add + VasEBoot_SERIAL_STOP_BITS_1_5. 2012-06-08 Vladimir Serbinenko - * grub-core/commands/wildcard.c (wildcard_expand): Set default return + * VasEBoot-core/commands/wildcard.c (wildcard_expand): Set default return value rather than let it uninited. 2012-06-07 Vladimir Serbinenko - * grub-core/commands/wildcard.c (+check_file): New function. + * VasEBoot-core/commands/wildcard.c (+check_file): New function. (wildcard_expand): Don't expand to non-existing files, expand with suffix and not attempt to expand if not needed. 2012-06-07 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c (name_devices): Don't make disks + * VasEBoot-core/disk/efi/efidisk.c (name_devices): Don't make disks out of partitions containing other partitions. 2012-06-07 Vladimir Serbinenko Pass PCIINFO on BIOS to OpenBSD since otherwise it fails to boot - on some qemu versions with GRUB. + on some qemu versions with VasEBoot. - * include/grub/i386/openbsd_bootarg.h (OPENBSD_BOOTARG_PCIBIOS): New + * include/VasEBoot/i386/openbsd_bootarg.h (OPENBSD_BOOTARG_PCIBIOS): New define. - (grub_openbsd_bootarg_pcibios): New struct. - * grub-core/loader/i386/bsd.c (grub_openbsd_boot) [GRUB_MACHINE_PCBIOS]: + (VasEBoot_openbsd_bootarg_pcibios): New struct. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_openbsd_boot) [VasEBoot_MACHINE_PCBIOS]: Add PCIINFO. 2012-06-07 Vladimir Serbinenko - * tests/util/grub-shell.in: Trim firmware output on EFI. + * tests/util/VasEBoot-shell.in: Trim firmware output on EFI. 2012-06-07 Vladimir Serbinenko - * grub-core/Makefile.core.def (vga_text): Disable on muliboot + * VasEBoot-core/Makefile.core.def (vga_text): Disable on muliboot and coreboot since it's already in kernel. 2012-06-07 Vladimir Serbinenko - * util/getroot.c (grub_util_get_dm_node_linear_info): Moved from here... - * grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info): + * util/getroot.c (VasEBoot_util_get_dm_node_linear_info): Moved from here... + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_dm_node_linear_info): to here. New return value start. All users updated. Recursively scan linear mappings. - * include/grub/emu/hostdisk.h (grub_util_get_dm_node_linear_info): New + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_get_dm_node_linear_info): New proto. - * grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start): - Use grub_util_get_dm_node_linear_info. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_hostdisk_find_partition_start): + Use VasEBoot_util_get_dm_node_linear_info. * util/getroot.c (convert_system_partition_to_system_disk): Use - grub_util_info rather than grub_dprintf. - (grub_util_biosdisk_get_grub_dev): Add a new grub_util_info. + VasEBoot_util_info rather than VasEBoot_dprintf. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Add a new VasEBoot_util_info. 2012-06-07 Vladimir Serbinenko - Move handling of GRUB_QEMU_OPTS to grub-shell so that make check works. + Move handling of VasEBoot_QEMU_OPTS to VasEBoot-shell so that make check works. - * Makefile.am: Remove GRUB_QEMU_OPTS handling. - * tests/util/grub-shell.in: Add GRUB_QEMU_OPTS handling. + * Makefile.am: Remove VasEBoot_QEMU_OPTS handling. + * tests/util/VasEBoot-shell.in: Add VasEBoot_QEMU_OPTS handling. 2012-06-07 Vladimir Serbinenko - * include/grub/types.h (grub_set_unaligned64): New function. - * util/grub-setup.c (write_rootdev): Use unaligned access functions. + * include/VasEBoot/types.h (VasEBoot_set_unaligned64): New function. + * util/VasEBoot-setup.c (write_rootdev): Use unaligned access functions. (setup): Likewise. 2012-06-06 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (quiesce): New function. - (grub_ofdisk_fini): Quiesce USB devices. + * VasEBoot-core/disk/ieee1275/ofdisk.c (quiesce): New function. + (VasEBoot_ofdisk_fini): Quiesce USB devices. 2012-06-06 Vladimir Serbinenko - * grub-core/loader/powerpc/ieee1275/linux.c (grub_linux_boot): Sync + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_linux_boot): Sync caches. 2012-06-06 Vladimir Serbinenko - * util/grub-fstest.c (cmd_crc): Use grub_get_unaligned32 for safety. + * util/VasEBoot-fstest.c (cmd_crc): Use VasEBoot_get_unaligned32 for safety. 2012-06-06 Vladimir Serbinenko - * grub-core/disk/pata.c (grub_pata_pio_read) - [GRUB_MACHINE_MIPS_QEMU_MIPS]: Don't byteswap even on mipseb. - (grub_pata_pio_write) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Likewise. + * VasEBoot-core/disk/pata.c (VasEBoot_pata_pio_read) + [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Don't byteswap even on mipseb. + (VasEBoot_pata_pio_write) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Likewise. 2012-06-06 Vladimir Serbinenko @@ -9810,52 +9810,52 @@ * Makefile.am: reorganise tests and enable qemu-mips. * configure.ac (COND_mipseb), (COND_mipsel): New conditions. - * grub-core/tests/boot/linux.init-mips.S: New file. + * VasEBoot-core/tests/boot/linux.init-mips.S: New file. * tests/partmap_test.in: Handle ata0 disks. - * tests/util/grub-shell.in: Handle qemu-mips. Make defaults work on + * tests/util/VasEBoot-shell.in: Handle qemu-mips. Make defaults work on non-pc i386. 2012-06-06 Vladimir Serbinenko - * Makefile.util.def (grub-mkrescue) Anable on mips_qemu_mips and + * Makefile.util.def (VasEBoot-mkrescue) Anable on mips_qemu_mips and ia64. - * util/grub-mkrescue.in: Handle qemu-mips and ia64. Add missing + * util/VasEBoot-mkrescue.in: Handle qemu-mips and ia64. Add missing quotes while on it. 2012-06-06 Vladimir Serbinenko - * grub-core/kern/mips/qemu_mips/init.c (grub_exit): Implement. - (grub_halt): Likewise. - * grub-core/lib/mips/qemu_mips/reboot.c (grub_reboot): Likewise. + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_exit): Implement. + (VasEBoot_halt): Likewise. + * VasEBoot-core/lib/mips/qemu_mips/reboot.c (VasEBoot_reboot): Likewise. 2012-06-06 Vladimir Serbinenko - * grub-core/term/serial.c (grub_serial_register) - [GRUB_MACHINE_MIPS_QEMU_MIPS]: Don't autostart console in order to bring + * VasEBoot-core/term/serial.c (VasEBoot_serial_register) + [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Don't autostart console in order to bring the behaviour in line with x86 platforms. 2012-06-06 Vladimir Serbinenko - * grub-core/commands/hdparm.c (le16_to_char): Always byte-swap strings. - (grub_ata_strncpy): Likewise. - (grub_ata_identify): Add missing byteswaps. + * VasEBoot-core/commands/hdparm.c (le16_to_char): Always byte-swap strings. + (VasEBoot_ata_strncpy): Likewise. + (VasEBoot_ata_identify): Add missing byteswaps. 2012-06-06 Vladimir Serbinenko - * grub-core/term/i386/pc/vga_text.c (screen_write_char): Add missing + * VasEBoot-core/term/i386/pc/vga_text.c (screen_write_char): Add missing byte-swap. (screen_read_char): Likewise. - (grub_vga_text_cls): Likewise. + (VasEBoot_vga_text_cls): Likewise. 2012-06-06 Vladimir Serbinenko - * grub-core/loader/efi/chainloader.c (copy_file_path): Handle non-ASCII + * VasEBoot-core/loader/efi/chainloader.c (copy_file_path): Handle non-ASCII filenames. (make_file_path): Likewise. 2012-06-06 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (scan): Support vscsi on IBM + * VasEBoot-core/disk/ieee1275/ofdisk.c (scan): Support vscsi on IBM machines. Tested by: Paulo Flabiano Smorigo. Crucial information about API supplied by: Coleen . @@ -9863,32 +9863,32 @@ 2012-06-05 Vladimir Serbinenko - * util/grub-mkimage.c: Disable -Wcast-align. + * util/VasEBoot-mkimage.c: Disable -Wcast-align. 2012-06-05 Vladimir Serbinenko - * grub-core/genmod.sh.in: Enable objconv errors 2030, 2050 and 2031 + * VasEBoot-core/genmod.sh.in: Enable objconv errors 2030, 2050 and 2031 as they are fatal. 2012-06-05 Vladimir Serbinenko - * grub-core/Makefile.am (rs_decoder.S): Add missing -ffreestanding. + * VasEBoot-core/Makefile.am (rs_decoder.S): Add missing -ffreestanding. 2012-06-05 Vladimir Serbinenko - * util/grub-probe.c (escape_of_path): Fix double free. + * util/VasEBoot-probe.c (escape_of_path): Fix double free. 2012-06-05 Vladimir Serbinenko - * grub-core/commands/videoinfo.c (hook): Show pitch. + * VasEBoot-core/commands/videoinfo.c (hook): Show pitch. 2012-06-05 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Skip xen-syms. + * util/VasEBoot.d/20_linux_xen.in: Skip xen-syms. 2012-06-05 Vladimir Serbinenko - * util/grub-probe.c (escape_of_path): Don't add ieee1275/. + * util/VasEBoot-probe.c (escape_of_path): Don't add ieee1275/. (probe): Add ieee1275 to OFW devices. 2012-06-04 Vladimir Serbinenko @@ -9905,23 +9905,23 @@ 2012-06-03 Vladimir Serbinenko - * grub-core/mmap/i386/pc/mmap.c (malloc_hook): + * VasEBoot-core/mmap/i386/pc/mmap.c (malloc_hook): Allocate in multiples of 16 to avoid adding a few bytes free region the windows bugs upon. 2012-06-03 Vladimir Serbinenko - * grub-core/commands/i386/pc/drivemap.c (install_int13_handler): + * VasEBoot-core/commands/i386/pc/drivemap.c (install_int13_handler): Allocate in multiples of 16 to avoid adding a few bytes free region the windows bugs upon. - * grub-core/mmap/i386/pc/mmap.c (malloc_hook): Likewise. + * VasEBoot-core/mmap/i386/pc/mmap.c (malloc_hook): Likewise. 2012-06-02 Vladimir Serbinenko - * grub-core/video/efi_gop.c (grub_video_gop_setup): Reject invalid + * VasEBoot-core/video/efi_gop.c (VasEBoot_video_gop_setup): Reject invalid resolutions. - * grub-core/video/i386/pc/vbe.c (grub_vbe_get_preferred_mode): Likewise. - * grub-core/video/video.c (grub_video_edid_preferred_mode): Likewise. + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_get_preferred_mode): Likewise. + * VasEBoot-core/video/video.c (VasEBoot_video_edid_preferred_mode): Likewise. 2012-06-02 Isao Shimizu @@ -9929,39 +9929,39 @@ 2012-06-02 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (print_line): Fix off-by-one error which + * VasEBoot-core/normal/menu_entry.c (print_line): Fix off-by-one error which resulted in \\ at the end of the line. 2012-06-02 Vladimir Serbinenko - * grub-core/kern/parser.c (grub_parser_state_transitions): Handle \t. - (grub_parser_cmdline_state): Likewise. - (grub_parser_split_cmdline): Likewise. + * VasEBoot-core/kern/parser.c (VasEBoot_parser_state_transitions): Handle \t. + (VasEBoot_parser_cmdline_state): Likewise. + (VasEBoot_parser_split_cmdline): Likewise. 2012-06-02 Vladimir Serbinenko - * util/getroot.c (grub_guess_root_devices): Don't canonicalise + * util/getroot.c (VasEBoot_guess_root_devices): Don't canonicalise /dev/root and /dev/dm-*. 2012-06-02 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (update_screen): Fix loop condition to + * VasEBoot-core/normal/menu_entry.c (update_screen): Fix loop condition to fix partially stale display. 2012-06-02 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (backward_char): Use right line for + * VasEBoot-core/normal/menu_entry.c (backward_char): Use right line for substraction. 2012-06-02 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_write) [__linux__]: + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_write) [__linux__]: Fix MBR remapping workaround. - (grub_util_biosdisk_read) [__linux__]: Likewise. + (VasEBoot_util_biosdisk_read) [__linux__]: Likewise. 2012-06-01 Vladimir Serbinenko - * util/grub-install.in: Check for ieee1275 and not ieee1276. + * util/VasEBoot-install.in: Check for ieee1275 and not ieee1276. 2012-05-31 Vladimir Serbinenko @@ -9969,54 +9969,54 @@ 2012-05-31 Christer Weinigel - * grub-core/normal/main.c (grub_file_getline): Fix off-by-one error. + * VasEBoot-core/normal/main.c (VasEBoot_file_getline): Fix off-by-one error. 2012-05-31 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_linux_boot): Use right version. - (grub_cmd_linux): Likewise. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Use right version. + (VasEBoot_cmd_linux): Likewise. 2012-05-31 Christer Weinigel Fix EHCI low-speed. - * grub-core/bus/usb/ehci.c (GRUB_EHCI_MULT_ONE): Fix the value. - (GRUB_EHCI_MULT_TWO): Likewise. - (GRUB_EHCI_MULT_THREE): Likewise. - (GRUB_EHCI_CMASK_MASK): New enum value. - (GRUB_EHCI_SMASK_MASK): Likewise. - (GRUB_EHCI_CMASK_OFF): Likewise. - (GRUB_EHCI_SMASK_OFF): Likewise. - (grub_ehci_pci_iter): Enable periodic schedule. - (grub_ehci_parse_notrun): Likewise. - (grub_ehci_restore_hw): Likewise. - (grub_ehci_setup_qh): Set flags for low speed transfers. - (grub_ehci_find_qh): Use periodic list for low speed. - (grub_ehci_setup_transfer): Check periodic queue as well. - (grub_ehci_check_transfer): Likewise. - (grub_ehci_cancel_transfer): Cancel periodic transfer. + * VasEBoot-core/bus/usb/ehci.c (VasEBoot_EHCI_MULT_ONE): Fix the value. + (VasEBoot_EHCI_MULT_TWO): Likewise. + (VasEBoot_EHCI_MULT_THREE): Likewise. + (VasEBoot_EHCI_CMASK_MASK): New enum value. + (VasEBoot_EHCI_SMASK_MASK): Likewise. + (VasEBoot_EHCI_CMASK_OFF): Likewise. + (VasEBoot_EHCI_SMASK_OFF): Likewise. + (VasEBoot_ehci_pci_iter): Enable periodic schedule. + (VasEBoot_ehci_parse_notrun): Likewise. + (VasEBoot_ehci_restore_hw): Likewise. + (VasEBoot_ehci_setup_qh): Set flags for low speed transfers. + (VasEBoot_ehci_find_qh): Use periodic list for low speed. + (VasEBoot_ehci_setup_transfer): Check periodic queue as well. + (VasEBoot_ehci_check_transfer): Likewise. + (VasEBoot_ehci_cancel_transfer): Cancel periodic transfer. 2012-05-31 Paulo Flabiano Smorigo - * util/grub-install.in: Write core.elf in PReP even if the --no-nvram + * util/VasEBoot-install.in: Write core.elf in PReP even if the --no-nvram parameter is used. 2012-05-31 Peter Jones - * include/grub/i386/linux.h (linux_kernel_params): Add v206. - * grub-core/loader/i386/linux.c (grub_linux_boot): Use v206. - (grub_cmd_linux) [__x86_64__]: Validate grub_efi_system_table. + * include/VasEBoot/i386/linux.h (linux_kernel_params): Add v206. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Use v206. + (VasEBoot_cmd_linux) [__x86_64__]: Validate VasEBoot_efi_system_table. 2012-05-31 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_linux_boot): Fix overflow and + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Fix overflow and uninited variable. Allocate at least setup_sects. 2012-05-30 Vladimir Serbinenko Fix handling of EFI with big memory maps. - * grub-core/loader/i386/linux.c (GRUB_LINUX_CL_OFFSET): Removed. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_LINUX_CL_OFFSET): Removed. (real_mode_mem): Likewise. (real_mode_target): Likewise. (real_mode_pages): Likewise. @@ -10025,18 +10025,18 @@ (linux_cmdline): Likewise. (free_pages): Don't set real mode variables. (allocate_pages): Don't allocate real mode memory. - (grub_e820_add_region): Remove the limit. - (grub_linux_boot): Allocate and copy real mode memory. - (grub_linux_unload): Free linux_cmdline. - (grub_cmd_linux): Use temporary storage for parameters. - (grub_cmd_initrd): Likewise. - * include/grub/i386/linux.h (GRUB_E820_MAX_ENTRY): Removed. + (VasEBoot_e820_add_region): Remove the limit. + (VasEBoot_linux_boot): Allocate and copy real mode memory. + (VasEBoot_linux_unload): Free linux_cmdline. + (VasEBoot_cmd_linux): Use temporary storage for parameters. + (VasEBoot_cmd_initrd): Likewise. + * include/VasEBoot/i386/linux.h (VasEBoot_E820_MAX_ENTRY): Removed. (linux_kernel_params): Make it 1K big. 2012-05-30 Vladimir Serbinenko * Makefile.util.def: Remove -Wno-format. - * grub-core/Makefile.core.def: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. 2012-05-30 Vladimir Serbinenko @@ -10046,23 +10046,23 @@ 2012-05-30 Vladimir Serbinenko - * grub-core/commands/gptsync.c (grub_cmd_gptsync): Propagate the + * VasEBoot-core/commands/gptsync.c (VasEBoot_cmd_gptsync): Propagate the relaxation of protective MBR requirements. 2012-05-29 Vladimir Serbinenko * configure.ac: Add condition for COND_HOST_XNU. * Makefile.util.def (10_xnu): New script. - * util/grub.d/10_xnu.in: New file, extracted from 30_os_prober.in. + * util/VasEBoot.d/10_xnu.in: New file, extracted from 30_os_prober.in. 2012-05-29 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S [__APPLE__]: Add a workaround for + * VasEBoot-core/kern/i386/pc/startup.S [__APPLE__]: Add a workaround for objconv bug. 2012-05-29 Vladimir Serbinenko - * grub-core/gdb/i386/machdep.S: Make usable with Apple assembler. + * VasEBoot-core/gdb/i386/machdep.S: Make usable with Apple assembler. Binary on other platforms stays identical. 2012-05-28 Vladimir Serbinenko @@ -10076,85 +10076,85 @@ 2012-05-28 Vladimir Serbinenko - * grub-core/lib/posix_wrap/sys/types.h [__APPLE__]: Include stddef + * VasEBoot-core/lib/posix_wrap/sys/types.h [__APPLE__]: Include stddef rather than defining size_t ourselves to avoid conflict. 2012-05-28 Vladimir Serbinenko - * grub-core/fs/hfs.c (grub_hfs_dir): Use memset instead of + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_dir): Use memset instead of initialisation to avoid __bzero reference. 2012-05-28 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S [__APPLE__]: Add Apple assembly + * VasEBoot-core/boot/i386/pc/startup_raw.S [__APPLE__]: Add Apple assembly version. - * grub-core/commands/i386/pc/drivemap_int13h.S [__APPLE__]: Likewise. - * grub-core/kern/i386/pc/startup.S [__APPLE__]: Likewise. - * grub-core/lib/i386/relocator16.S [__APPLE__]: Likewise. - * grub-core/lib/i386/relocator_common.S [__APPLE__]: Likewise. - * grub-core/mmap/i386/pc/mmap_helper.S [__APPLE__]: Likewise. + * VasEBoot-core/commands/i386/pc/drivemap_int13h.S [__APPLE__]: Likewise. + * VasEBoot-core/kern/i386/pc/startup.S [__APPLE__]: Likewise. + * VasEBoot-core/lib/i386/relocator16.S [__APPLE__]: Likewise. + * VasEBoot-core/lib/i386/relocator_common.S [__APPLE__]: Likewise. + * VasEBoot-core/mmap/i386/pc/mmap_helper.S [__APPLE__]: Likewise. 2012-05-28 Vladimir Serbinenko - * grub-core/efiemu/runtime/efiemu.c: Replace APPLE_CC with __APPLE__. - * grub-core/kern/misc.c: Likewise. - * grub-core/loader/i386/xnu.c: Likewise. - * include/grub/i386/tsc.h: Likewise. - * include/grub/symbol.h: Likewise. + * VasEBoot-core/efiemu/runtime/efiemu.c: Replace APPLE_CC with __APPLE__. + * VasEBoot-core/kern/misc.c: Likewise. + * VasEBoot-core/loader/i386/xnu.c: Likewise. + * include/VasEBoot/i386/tsc.h: Likewise. + * include/VasEBoot/symbol.h: Likewise. 2012-05-28 Vladimir Serbinenko - * include/grub/list.h (grub_bad_type_cast_real): Remove return. - * include/grub/misc.h (ATTRIBUTE_ERROR): Make into noreturn attribute + * include/VasEBoot/list.h (VasEBoot_bad_type_cast_real): Remove return. + * include/VasEBoot/misc.h (ATTRIBUTE_ERROR): Make into noreturn attribute on older compiler. 2012-05-28 Vladimir Serbinenko - * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__APPLE__]: + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__APPLE__]: Implement Apple flavour. (convert_system_partition_to_system_disk) [__APPLE__]: Likewise. 2012-05-28 Vladimir Serbinenko - * include/grub/misc.h (memcmp) [__APPLE__]: Mark as regparm 0. + * include/VasEBoot/misc.h (memcmp) [__APPLE__]: Mark as regparm 0. (memmove) [__APPLE__]: Likewise. (memcpy) [__APPLE__]: Likewise. (memset) [__APPLE__]: Likewise. - * grub-core/kern/misc.c (memcmp) [__APPLE__]: Likewise. + * VasEBoot-core/kern/misc.c (memcmp) [__APPLE__]: Likewise. (memmove) [__APPLE__]: Likewise. (memcpy) [__APPLE__]: Likewise. (memset) [__APPLE__]: Likewise. 2012-05-28 Vladimir Serbinenko - * grub-core/genmod.sh.in: Fix a bug in Apple part which caused + * VasEBoot-core/genmod.sh.in: Fix a bug in Apple part which caused dependency discard. 2012-05-27 Vladimir Serbinenko - * grub-core/normal/main.c (read_config_file): Provide config_file and + * VasEBoot-core/normal/main.c (read_config_file): Provide config_file and config_directory. - * util/grub.d/41_custom.in: Use config_directoy when available. + * util/VasEBoot.d/41_custom.in: Use config_directoy when available. 2012-05-27 Vladimir Serbinenko - * grub-core/fs/bfs.c (iterate_in_b_tree): Add missing NESTED_FUNC_ATTR. - (grub_bfs_dir): Likewise. + * VasEBoot-core/fs/bfs.c (iterate_in_b_tree): Add missing NESTED_FUNC_ATTR. + (VasEBoot_bfs_dir): Likewise. 2012-05-27 Peter Jones The old code gives arguments to a printf function which can't work correctly, and the compiler complains. - * grub-core/tests/example_functional_test.c (example_test): Add + * VasEBoot-core/tests/example_functional_test.c (example_test): Add missing text. - * grub-core/tests/lib/test.c (add_failure): Rewrite. - * include/grub/test.h (grub_test_assert_helper): New declaration. - (grub_test_assert): Use grub_test_assert_helper. + * VasEBoot-core/tests/lib/test.c (add_failure): Rewrite. + * include/VasEBoot/test.h (VasEBoot_test_assert_helper): New declaration. + (VasEBoot_test_assert): Use VasEBoot_test_assert_helper. 2012-05-27 Vladimir Serbinenko - * grub-core/Makefile.core.def (example_functional_test): Rename to ... + * VasEBoot-core/Makefile.core.def (example_functional_test): Rename to ... (exfctest): ... this to avoid overlong filenames. All users updated. @@ -10162,73 +10162,73 @@ Handle "." and ".." on squashfs. - * grub-core/fs/squash4.c (grub_fshelp_node): New field stsize. + * VasEBoot-core/fs/squash4.c (VasEBoot_fshelp_node): New field stsize. Make inode numbers into stack. - (grub_squash_read_symlink): Use stack. - (grub_squash_iterate_dir): Use stack. Create "." and ".." nodes. + (VasEBoot_squash_read_symlink): Use stack. + (VasEBoot_squash_iterate_dir): Use stack. Create "." and ".." nodes. (make_root_node): Fill stack. - (grub_squash_open): Use stack. + (VasEBoot_squash_open): Use stack. 2012-05-27 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (open_device): Set dest->dev to 0 after + * VasEBoot-core/kern/emu/hostdisk.c (open_device): Set dest->dev to 0 after freeing. 2012-05-27 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (print_option_help): Properly redirect + * util/VasEBoot-mkconfig_lib.in (print_option_help): Properly redirect stderr on test calls. 2012-05-27 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_find_file): Handle "." and "..". + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_find_file): Handle "." and "..". 2012-05-27 Vladimir Serbinenko - * grub-core/fs/ntfs.c (list_file): Set mtime to correct value. + * VasEBoot-core/fs/ntfs.c (list_file): Set mtime to correct value. 2012-05-27 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Don't skip "." and + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Don't skip "." and "..". 2012-05-27 Vladimir Serbinenko - * grub-core/fs/hfsplus.c (grub_hfsplus_catfile): New field parentid. - (grub_hfsplus_iterate_dir): Add "." and "..". + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_catfile): New field parentid. + (VasEBoot_hfsplus_iterate_dir): Add "." and "..". 2012-05-27 Vladimir Serbinenko - * grub-core/fs/cpio.c (canonicalize): Handle "..". - (grub_cpio_find_file) [MODE_USTAR]: Handle hardlinks. + * VasEBoot-core/fs/cpio.c (canonicalize): Handle "..". + (VasEBoot_cpio_find_file) [MODE_USTAR]: Handle hardlinks. 2012-05-27 Vladimir Serbinenko - * grub-core/fs/btrfs.c (GRUB_BTRFS_ITEM_TYPE_INODE_REF): New enum value. + * VasEBoot-core/fs/btrfs.c (VasEBoot_BTRFS_ITEM_TYPE_INODE_REF): New enum value. (find_path): Handle "." and "..". 2012-05-27 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_file): New field hardlink. - (GRUB_AFFS_FILETYPE_HARDLINK): New enum value. - (grub_affs_iterate_dir): Handle hardlinks. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_file): New field hardlink. + (VasEBoot_AFFS_FILETYPE_HARDLINK): New enum value. + (VasEBoot_affs_iterate_dir): Handle hardlinks. 2012-05-26 Matthew Garrett - * grub-core/term/efi/console.c (grub_efi_console_init): Set text mode. - (grub_efi_console_fini): Likewise. - * grub-core/video/efi_gop.c (framebuffer): New field offscreen. - (grub_video_gop_fill_mode_info): Rename to ... - (grub_video_gop_fill_real_mode_info): ... this. - (grub_video_gop_fill_mode_info): New function. - (grub_video_gop_setup): Setup double framebuffer. - (grub_video_gop_get_info_and_fini): Use original framebuffer. + * VasEBoot-core/term/efi/console.c (VasEBoot_efi_console_init): Set text mode. + (VasEBoot_efi_console_fini): Likewise. + * VasEBoot-core/video/efi_gop.c (framebuffer): New field offscreen. + (VasEBoot_video_gop_fill_mode_info): Rename to ... + (VasEBoot_video_gop_fill_real_mode_info): ... this. + (VasEBoot_video_gop_fill_mode_info): New function. + (VasEBoot_video_gop_setup): Setup double framebuffer. + (VasEBoot_video_gop_get_info_and_fini): Use original framebuffer. Free offscreen. - (grub_video_gop_swap_buffers): Copy framebuffer. - (grub_video_gop_fini): Free offscreen buffer. - * include/grub/efi/graphics_output.h (grub_efi_gop_blt_operation_t): + (VasEBoot_video_gop_swap_buffers): Copy framebuffer. + (VasEBoot_video_gop_fini): Free offscreen buffer. + * include/VasEBoot/efi/graphics_output.h (VasEBoot_efi_gop_blt_operation_t): New enum. - (grub_efi_gop_blt_pixel): New struct. + (VasEBoot_efi_gop_blt_pixel): New struct. 2012-05-26 Vladimir Serbinenko @@ -10243,17 +10243,17 @@ Fix extent overflow comparator. - * grub-core/fs/hfsplus.c (grub_hfsplus_extkey_internal): Add type. - (grub_hfsplus_read_block): Set type. - (grub_hfsplus_cmp_extkey): Compare type. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_extkey_internal): Add type. + (VasEBoot_hfsplus_read_block): Set type. + (VasEBoot_hfsplus_cmp_extkey): Compare type. 2012-05-25 Vladimir Serbinenko - * util/grub-fstest.c (cmd_cmp): Fix stat'ing of wrong file. + * util/VasEBoot-fstest.c (cmd_cmp): Fix stat'ing of wrong file. 2012-05-24 Vladimir Serbinenko - * grub-core/fs/hfsplus.c (grub_hfsplus_label): Use found ptr rather + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_label): Use found ptr rather than 0. 2012-05-24 Vladimir Serbinenko @@ -10267,23 +10267,23 @@ 2012-05-23 Vladimir Serbinenko - * grub-core/normal/misc.c (grub_normal_print_device_info): Dsiplay + * VasEBoot-core/normal/misc.c (VasEBoot_normal_print_device_info): Dsiplay ext* instead of ext2. 2012-05-23 Vladimir Serbinenko - * grub-core/normal/term.c (read_terminal_list): Terminate the terminal + * VasEBoot-core/normal/term.c (read_terminal_list): Terminate the terminal name with \0. 2012-05-22 Jordan Uggla - * docs/grub-dev.texi: Remove dot from .png. + * docs/VasEBoot-dev.texi: Remove dot from .png. 2012-05-22 Vladimir Serbinenko - * grub-core/partmap/gpt.c (grub_gpt_partition_map_iterate): Accept + * VasEBoot-core/partmap/gpt.c (VasEBoot_gpt_partition_map_iterate): Accept protective entry in any slot. - * grub-core/partmap/msdos.c (grub_partition_msdos_iterate): Reject + * VasEBoot-core/partmap/msdos.c (VasEBoot_partition_msdos_iterate): Reject if protective entry is found in any slot. Protective entry in non-first slot make no sense but is a widespread @@ -10291,92 +10291,92 @@ 2012-05-22 Vladimir Serbinenko - * grub-core/fs/squash4.c (grub_squash_read_data): Add missing byte-swap. + * VasEBoot-core/fs/squash4.c (VasEBoot_squash_read_data): Add missing byte-swap. 2012-05-22 Vladimir Serbinenko - * grub-core/fs/reiserfs.c (grub_reiserfs_iterate_dir): Fix size byteswap + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_iterate_dir): Fix size byteswap with old reiserfs. - (grub_reiserfs_open): Don't free root. + (VasEBoot_reiserfs_open): Don't free root. 2012-05-22 Vladimir Serbinenko - * grub-core/fs/fshelp.c (grub_fshelp_find_file): Set currnode to 0 + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_find_file): Set currnode to 0 after freeing for safety. 2012-05-21 Vladimir Serbinenko - * grub-core/commands/sleep.c (do_print): Add missing grub_refresh. + * VasEBoot-core/commands/sleep.c (do_print): Add missing VasEBoot_refresh. Reported by: Jordan Uggla. 2012-05-21 Jordan Uggla - * docs/grub.texi Fix documentation of GRUB_HIDDEN_TIMOUNT to match the - actual implementation. Specifically, clarify that the grub menu will - be displayed for GRUB_TIMOUT seconds after the hidden timeout has + * docs/VasEBoot.texi Fix documentation of VasEBoot_HIDDEN_TIMOUNT to match the + actual implementation. Specifically, clarify that the VasEBoot menu will + be displayed for VasEBoot_TIMOUT seconds after the hidden timeout has passed. 2012-05-21 Benjamin Herrenschmidt - * grub-core/kern/powerpc/dl.c (trampoline_template): Use r12 instead + * VasEBoot-core/kern/powerpc/dl.c (trampoline_template): Use r12 instead of r0. 2012-05-21 Vladimir Serbinenko Remove unjustified hard dependency of normal.mod on gfxterm. - * include/grub/term.h (grub_term_output): New member fullscreen. - * include/grub/gfxterm.h (grub_gfxterm_fullscreen): Removed. - * grub-core/term/gfxterm.c (grub_gfxterm_fullscreen): Make static. - (grub_gfxterm): Set .fullscreen. - * grub-core/normal/menu.c (menu_init): Use fullscreen. - * grub-core/gfxmenu/gfxmenu.c (GRUB_MOD_INIT): Likewise. + * include/VasEBoot/term.h (VasEBoot_term_output): New member fullscreen. + * include/VasEBoot/gfxterm.h (VasEBoot_gfxterm_fullscreen): Removed. + * VasEBoot-core/term/gfxterm.c (VasEBoot_gfxterm_fullscreen): Make static. + (VasEBoot_gfxterm): Set .fullscreen. + * VasEBoot-core/normal/menu.c (menu_init): Use fullscreen. + * VasEBoot-core/gfxmenu/gfxmenu.c (VasEBoot_MOD_INIT): Likewise. 2012-05-21 Vladimir Serbinenko - * docs/grub.texi (Internationalisation/Filesystems): Add precisions + * docs/VasEBoot.texi (Internationalisation/Filesystems): Add precisions mentioning possible problems with non-ASCII (non-compliant) ISOs. Mention case-insensitive AFFS, SFS and JFS. 2012-05-21 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_mtime): Add missing grub_dl_ref. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_mtime): Add missing VasEBoot_dl_ref. 2012-05-21 Vladimir Serbinenko - * grub-core/kern/fs.c (grub_fs_probe): Handle GRUB_ERR_OUT_OF_RANGE as + * VasEBoot-core/kern/fs.c (VasEBoot_fs_probe): Handle VasEBoot_ERR_OUT_OF_RANGE as a bad FS. 2012-05-18 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Mark plain + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Mark plain ISO9660 names as case-insensitive, lowercase it and remove trailing dot. 2012-05-17 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_data): New field caseins. - (grub_jfs_mount): Fill caseins. - (grub_jfs_find_file): Respect caseins. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_data): New field caseins. + (VasEBoot_jfs_mount): Fill caseins. + (VasEBoot_jfs_find_file): Respect caseins. 2012-05-17 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Don't strrchr + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Don't strrchr through UTF-16. 2012-05-17 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_find_dir): Fix error message. + * VasEBoot-core/fs/fat.c (VasEBoot_fat_find_dir): Fix error message. New argument origpath. All users updated. 2012-05-15 Vladimir Serbinenko - * grub-core/fs/ntfs.c (read_data): Prevent overflow. + * VasEBoot-core/fs/ntfs.c (read_data): Prevent overflow. (read_attr): Ensure that we read start of possibly compressed block. 2012-05-15 Vladimir Serbinenko - * include/grub/ntfs.h (grub_ntfs_comp_table_element): New struct. - (grub_ntfs_comp): Use grub_ntfs_comp_table_element for comp_table. + * include/VasEBoot/ntfs.h (VasEBoot_ntfs_comp_table_element): New struct. + (VasEBoot_ntfs_comp): Use VasEBoot_ntfs_comp_table_element for comp_table. All users updated. 2012-05-14 Vladimir Serbinenko @@ -10389,81 +10389,81 @@ 2012-05-14 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Add missing line. + * util/VasEBoot.d/20_linux_xen.in: Add missing line. 2012-05-14 Vladimir Serbinenko - * include/grub/charset.h (GRUB_UTF16_UPPER_SURROGATE): Fix mask sizes. - (GRUB_UTF16_LOWER_SURROGATE): Likewise. - (grub_utf16_to_utf8): Likewise. + * include/VasEBoot/charset.h (VasEBoot_UTF16_UPPER_SURROGATE): Fix mask sizes. + (VasEBoot_UTF16_LOWER_SURROGATE): Likewise. + (VasEBoot_utf16_to_utf8): Likewise. 2012-05-13 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (scan): Don't scan device tree if - GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS is set. - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS on IBM hardware. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New enum value - GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS. + * VasEBoot-core/disk/ieee1275/ofdisk.c (scan): Don't scan device tree if + VasEBoot_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS is set. + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS on IBM hardware. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New enum value + VasEBoot_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS. 2012-05-13 Vladimir Serbinenko - * grub-core/kern/fs.c (grub_fs_probe): Handle GRUB_ERR_OUT_OF_RANGE as + * VasEBoot-core/kern/fs.c (VasEBoot_fs_probe): Handle VasEBoot_ERR_OUT_OF_RANGE as a bad FS. 2012-05-13 Vladimir Serbinenko - * grub-core/fs/udf.c (read_string): Bail out on size=0. - (grub_udf_read_symlink): Handle read_string failure. + * VasEBoot-core/fs/udf.c (read_string): Bail out on size=0. + (VasEBoot_udf_read_symlink): Handle read_string failure. 2012-05-12 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (read_device_map): Improve TRANSLATORS + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Improve TRANSLATORS comment. 2012-05-12 Vladimir Serbinenko Fix handling of UDF symlinks. - * grub-core/fs/udf.c (read_string): New argument outbuf. + * VasEBoot-core/fs/udf.c (read_string): New argument outbuf. All users updated. - (grub_ufs_read_symlink): Rename to ... - (grub_udf_read_symlink): ... this. All users updated. + (VasEBoot_ufs_read_symlink): Rename to ... + (VasEBoot_udf_read_symlink): ... this. All users updated. Handle symlinks with more than one component. 2012-05-12 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_read_symlink): Fix handling of long + * VasEBoot-core/fs/affs.c (VasEBoot_affs_read_symlink): Fix handling of long symlinks. Replace leading colon with a slash. 2012-05-12 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_find_file): Handle multiple slashes in + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_find_file): Handle multiple slashes in filename. 2012-05-12 Vladimir Serbinenko - * grub-core/fs/bfs.c (find_in_b_tree) [MODE_AFS]: Fix handling of exact + * VasEBoot-core/fs/bfs.c (find_in_b_tree) [MODE_AFS]: Fix handling of exact match in inner node. 2012-05-12 Vladimir Serbinenko - * grub-core/fs/bfs.c (mount): Improve filesystem detection reliability. - * grub-core/fs/ext2.c (grub_ext2_mount): Likewise. - * grub-core/fs/hfs.c (grub_hfs_mount): Likewise. - * grub-core/fs/hfsplus.c (grub_hfsplus_mount): Likewise. - * grub-core/fs/jfs.c (grub_jfs_mount): Likewise. - * grub-core/fs/minix.c (grub_minix_mount): Likewise. - * grub-core/fs/ntfs.c (grub_ntfs_mount): Likewise. - * grub-core/fs/romfs.c (grub_romfs_mount): Likewise. - * grub-core/fs/xfs.c (grub_xfs_mount): Likewise. + * VasEBoot-core/fs/bfs.c (mount): Improve filesystem detection reliability. + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_mount): Likewise. + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_mount): Likewise. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_mount): Likewise. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_mount): Likewise. + * VasEBoot-core/fs/minix.c (VasEBoot_minix_mount): Likewise. + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_mount): Likewise. + * VasEBoot-core/fs/romfs.c (VasEBoot_romfs_mount): Likewise. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_mount): Likewise. 2012-05-11 Vladimir Serbinenko - Use grub-probe and not cmp to check that disk is empty. + Use VasEBoot-probe and not cmp to check that disk is empty. - * util/grub-install.in: Use grub-probe for zero-check. - * util/grub-probe.c (PRINT_ZERO_CHECK): New enum value. + * util/VasEBoot-install.in: Use VasEBoot-probe for zero-check. + * util/VasEBoot-probe.c (PRINT_ZERO_CHECK): New enum value. (probe): Handle PRINT_ZERO_CHECK. (argp_parser): Handle -t zero_check. @@ -10471,62 +10471,62 @@ Flush block cache on adding disk to device map. - * grub-core/kern/emu/hostdisk.c (flush_initial_buffer): New function. - (grub_hostdisk_os_dev_to_grub_drive): Call flush_initial_buffer on + * VasEBoot-core/kern/emu/hostdisk.c (flush_initial_buffer): New function. + (VasEBoot_hostdisk_os_dev_to_VasEBoot_drive): Call flush_initial_buffer on adding. (read_device_map): Likewise. (open_device): Flush on opening. 2012-05-10 Vladimir Serbinenko - * grub-core/fs/cpio.c (grub_cpio_find_file): Handle prefix. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_find_file): Handle prefix. (handle_symlink): Fix off-by-one error. Canonicalize the target. - (grub_cpio_dir): Canonicalize the name. + (VasEBoot_cpio_dir): Canonicalize the name. Fix memory leak. Set directory. - (grub_cpio_open): Canonicalize the name. + (VasEBoot_cpio_open): Canonicalize the name. 2012-05-10 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix symlink + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Fix symlink handling. 2012-05-10 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_find_file): Fix handling of double slash. - * grub-core/fs/minix.c (grub_minix_find_file): Likewise. + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_find_file): Fix handling of double slash. + * VasEBoot-core/fs/minix.c (VasEBoot_minix_find_file): Likewise. 2012-05-10 Vladimir Serbinenko - * util/grub-menulst2cfg.c (main): Check return value of fwrite. - * util/grub-mklayout.c (write_file): Likewise. New argument fname. + * util/VasEBoot-menulst2cfg.c (main): Check return value of fwrite. + * util/VasEBoot-mklayout.c (write_file): Likewise. New argument fname. All users updated. 2012-05-10 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Update initrd list based on 10_linux.in + * util/VasEBoot.d/20_linux_xen.in: Update initrd list based on 10_linux.in counterpart. 2012-05-10 Vladimir Serbinenko Fix UFS1 big file support. - * grub-core/fs/ufs.c (INODE): Removed. + * VasEBoot-core/fs/ufs.c (INODE): Removed. (INODE_SIZE): Always use 64-bit byte-swap since size field is always 64-bit. (INODE_MODE): Simplify. - (grub_ufs_inode): Use uint64_t for size and not int64_t. - (grub_ufs_lookup_symlink): Don't use INODE. + (VasEBoot_ufs_inode): Use uint64_t for size and not int64_t. + (VasEBoot_ufs_lookup_symlink): Don't use INODE. 2012-05-09 Vladimir Serbinenko Fix minixfs with non-power-of-two blocks since it's supported by minix. - * grub-core/fs/minix.c (GRUB_MINIX_ZONESZ): Use block_size. - (grub_minix_data): Replace log_block_size with block_size. - (grub_minix_read_file): Use block_size but avoid 64-bit division. - (grub_minix_mount): Fill block_size. + * VasEBoot-core/fs/minix.c (VasEBoot_MINIX_ZONESZ): Use block_size. + (VasEBoot_minix_data): Replace log_block_size with block_size. + (VasEBoot_minix_read_file): Use block_size but avoid 64-bit division. + (VasEBoot_minix_mount): Fill block_size. 2012-05-09 Vladimir Serbinenko @@ -10536,191 +10536,191 @@ Fix wrapped HFS+ handling. - * grub-core/fs/fshelp.c (grub_fshelp_read_file): New argument + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_read_file): New argument blocks_start. All users updated. - * grub-core/fs/hfsplus.c (grub_hfsplus_read_block): Don't add + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_read_block): Don't add wrapping offset. - (grub_hfsplus_read_file): Pass embedding offset to fshelp_read_file. + (VasEBoot_hfsplus_read_file): Pass embedding offset to fshelp_read_file. 2012-05-09 Vladimir Serbinenko Fix long symlinks on reiserfs. - * grub-core/fs/reiserfs.c (grub_fshelp_node): New field size. - (grub_reiserfs_read_symlink): Use grub_reiserfs_read_real. - (grub_reiserfs_iterate_dir): Save size for non-directories. - (grub_reiserfs_open): Don't reread stat block as we already know the + * VasEBoot-core/fs/reiserfs.c (VasEBoot_fshelp_node): New field size. + (VasEBoot_reiserfs_read_symlink): Use VasEBoot_reiserfs_read_real. + (VasEBoot_reiserfs_iterate_dir): Save size for non-directories. + (VasEBoot_reiserfs_open): Don't reread stat block as we already know the size. - (grub_reiserfs_read): Split into... - (grub_reiserfs_read_real): ... and ... - (grub_reiserfs_read): ...this. + (VasEBoot_reiserfs_read): Split into... + (VasEBoot_reiserfs_read_real): ... and ... + (VasEBoot_reiserfs_read): ...this. 2012-05-09 Vladimir Serbinenko Fix non-indexed JFS. - * grub-core/fs/jfs.c (grub_jfs_sblock): New field flags. - (grub_jfs_data): New field namecomponentlen. - (grub_jfs_mount): Fill namecomponentlen. - (grub_jfs_getent): Use namecomponentlen rather than hardcoded 11. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_sblock): New field flags. + (VasEBoot_jfs_data): New field namecomponentlen. + (VasEBoot_jfs_mount): Fill namecomponentlen. + (VasEBoot_jfs_getent): Use namecomponentlen rather than hardcoded 11. 2012-05-08 Vladimir Serbinenko - * grub-core/script/yylex.l: Ugly fix for "\\\n ". - * tests/grub_script_echo1.in: Add tests. + * VasEBoot-core/script/yylex.l: Ugly fix for "\\\n ". + * tests/VasEBoot_script_echo1.in: Add tests. 2012-05-08 Vladimir Serbinenko - * util/grub-install.in: Ignore empty devicetree directory. + * util/VasEBoot-install.in: Ignore empty devicetree directory. 2012-05-08 Bean - * grub-core/net/ip.c (reassemble): Make asm_buffer into asm_netbuff. + * VasEBoot-core/net/ip.c (reassemble): Make asm_buffer into asm_netbuff. All users updated. (free_rsm): Free header as well. (free_old_fragments): Fix memory leak. - * grub-core/net/netbuff.c (grub_netbuff_free): Make return void. - * grub-core/net/tftp.c (tftp_receive): Fix memory leak. + * VasEBoot-core/net/netbuff.c (VasEBoot_netbuff_free): Make return void. + * VasEBoot-core/net/tftp.c (tftp_receive): Fix memory leak. (destroy_pq): Likewise. - * include/grub/net/netbuff.h (grub_netbuff_free): Make return void. + * include/VasEBoot/net/netbuff.h (VasEBoot_netbuff_free): Make return void. 2012-05-08 Vladimir Serbinenko - * grub-core/commands/hashsum.c (grub_cmd_hashsum): Align space for + * VasEBoot-core/commands/hashsum.c (VasEBoot_cmd_hashsum): Align space for resulting hash as a precaution. 2012-05-08 Vladimir Serbinenko - * grub-core/net/bootp.c (set_env_limn_ro): Replace reserved ':' with + * VasEBoot-core/net/bootp.c (set_env_limn_ro): Replace reserved ':' with '_' in variable names. - * grub-core/net/net.c (grub_net_network_level_interface_register): + * VasEBoot-core/net/net.c (VasEBoot_net_network_level_interface_register): Likewise. 2012-05-08 Vladimir Serbinenko Fix AFFS with non-512B blocks. - * grub-core/fs/affs.c (grub_affs_rblock): Make type uint32_t. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_rblock): Make type uint32_t. (AFFS_MAX_LOG_BLOCK_SIZE): New definition. - (grub_affs_data): Replace blocksize with log_blocksize. - (grub_affs_read_block): Fix non-512B blocks. - (grub_affs_read_symlink): Likewise. - (grub_affs_iterate_dir): Likewise. Fix freeing corruption. - (grub_affs_read): Fix non-512B blocks. - (grub_affs_label): Likewise. - (grub_affs_mtime): Likewise. - (grub_affs_mount): Fix block detection routine. + (VasEBoot_affs_data): Replace blocksize with log_blocksize. + (VasEBoot_affs_read_block): Fix non-512B blocks. + (VasEBoot_affs_read_symlink): Likewise. + (VasEBoot_affs_iterate_dir): Likewise. Fix freeing corruption. + (VasEBoot_affs_read): Fix non-512B blocks. + (VasEBoot_affs_label): Likewise. + (VasEBoot_affs_mtime): Likewise. + (VasEBoot_affs_mount): Fix block detection routine. 2012-05-08 Vladimir Serbinenko Add filesystem mtime to AFFS. - * grub-core/fs/affs.c (grub_affs_file): Make type unsigned. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_file): Make type unsigned. (aftime2ctime): New function. - (grub_affs_dir): Use aftime2ctime. - (grub_affs_label): Fix return value. - (grub_affs_mtime): New function. - (grub_affs_fs): Add mtime. + (VasEBoot_affs_dir): Use aftime2ctime. + (VasEBoot_affs_label): Fix return value. + (VasEBoot_affs_mtime): New function. + (VasEBoot_affs_fs): Add mtime. 2012-05-07 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_read_symlink): Convert latin1 into + * VasEBoot-core/fs/affs.c (VasEBoot_affs_read_symlink): Convert latin1 into UTF-8. 2012-05-07 Vladimir Serbinenko - * grub-core/fs/sfs.c (grub_sfs_read_symlink): Convert latin1 into + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_read_symlink): Convert latin1 into UTF-8. 2012-05-07 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_iterate_dir): Mark as case insensitive. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_iterate_dir): Mark as case insensitive. 2012-05-07 Vladimir Serbinenko - * grub-core/fs/sfs.c (grub_sfs_rblock): New fields createtime and + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_rblock): New fields createtime and flags. (FLAGS_CASE_SENSITIVE): New enum value. (cache_entry): New struct. - (grub_fshelp_node): Add fields cache_off, next_extent, cache_allocated, + (VasEBoot_fshelp_node): Add fields cache_off, next_extent, cache_allocated, cache_size and cache. - (grub_sfs_data): Remove blocksize. All users switched to log_blocksize. + (VasEBoot_sfs_data): Remove blocksize. All users switched to log_blocksize. Add log_blocksize and fshelp_flags. - (grub_sfs_read_extent): Handle non-512 blocks. - (grub_sfs_read_block): Add cаche and handle non-512 blocks. - (grub_sfs_read_file): Handle non-512 blocks. - (grub_sfs_mount): Handle non-512 blocks. Fill log_blocksize and + (VasEBoot_sfs_read_extent): Handle non-512 blocks. + (VasEBoot_sfs_read_block): Add cаche and handle non-512 blocks. + (VasEBoot_sfs_read_file): Handle non-512 blocks. + (VasEBoot_sfs_mount): Handle non-512 blocks. Fill log_blocksize and fshelp_flags. - (grub_sfs_read_symlink): Handle non-512 blocks. - (grub_sfs_iterate_dir): Init new fields. Mark as case-insensitive. - (grub_sfs_dir): Free cache. - (grub_sfs_close): Likewise. + (VasEBoot_sfs_read_symlink): Handle non-512 blocks. + (VasEBoot_sfs_iterate_dir): Init new fields. Mark as case-insensitive. + (VasEBoot_sfs_dir): Free cache. + (VasEBoot_sfs_close): Likewise. 2012-05-06 Vladimir Serbinenko - * grub-core/fs/bfs.c (read_bfs_file): Fix overflow with over 2TiB + * VasEBoot-core/fs/bfs.c (read_bfs_file): Fix overflow with over 2TiB filesystems. 2012-05-06 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_read_block): Fix theoretical overflow. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_read_block): Fix theoretical overflow. 2012-05-06 Vladimir Serbinenko - * grub-core/commands/ls.c (grub_ls_list_files): Fix overflow. + * VasEBoot-core/commands/ls.c (VasEBoot_ls_list_files): Fix overflow. 2012-05-06 Vladimir Serbinenko - * grub-core/fs/sfs.c (grub_fshelp_node): Fix types. - (grub_sfs_read_extent): Likewise. - (grub_sfs_read_block): Likewise. - (grub_sfs_mount): Likewise. - (grub_sfs_iterate_dir): Likewise. - (grub_sfs_read_symlink): Use strncpy instead of strcpy. - (grub_sfs_read): Remove unnecessarry and wrong temporary variable. + * VasEBoot-core/fs/sfs.c (VasEBoot_fshelp_node): Fix types. + (VasEBoot_sfs_read_extent): Likewise. + (VasEBoot_sfs_read_block): Likewise. + (VasEBoot_sfs_mount): Likewise. + (VasEBoot_sfs_iterate_dir): Likewise. + (VasEBoot_sfs_read_symlink): Use strncpy instead of strcpy. + (VasEBoot_sfs_read): Remove unnecessarry and wrong temporary variable. 2012-05-04 Vladimir Serbinenko Fix errors on compressed NTFS with 512B clusters. - * include/grub/ntfs.h (grub_ntfscomp_func_t): Use appropriately sized + * include/VasEBoot/ntfs.h (VasEBoot_ntfscomp_func_t): Use appropriately sized types. - * grub-core/fs/ntfs.c (grub_ntfs_read): Return correct -1 on error and + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_read): Return correct -1 on error and not 0. - * grub-core/fs/ntfscomp.c (read_block): Use appropriately-sized types. + * VasEBoot-core/fs/ntfscomp.c (read_block): Use appropriately-sized types. Relax check for inline extents. (ntfscomp): Return correct -1 on error and not 0. 2012-05-04 Vladimir Serbinenko - * util/grub-install.in: Fix handling of prefix containing spaces. + * util/VasEBoot-install.in: Fix handling of prefix containing spaces. 2012-05-04 Vladimir Serbinenko - * grub-core/fs/squash4.c (grub_squash_inode): Fix offset field. - (grub_squash_read_data): Fix offset byte-swapping. + * VasEBoot-core/fs/squash4.c (VasEBoot_squash_inode): Fix offset field. + (VasEBoot_squash_read_data): Fix offset byte-swapping. 2012-05-04 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_strcmp): Use unsigned comparison as + * VasEBoot-core/kern/misc.c (VasEBoot_strcmp): Use unsigned comparison as per common usage and preffered in several parts of code. - (grub_memcmp): Likewise. - (grub_strncmp): Likewise. - * include/grub/misc.h (grub_strcasecmp): Likewise. - (grub_strncasecmp): Likewise. + (VasEBoot_memcmp): Likewise. + (VasEBoot_strncmp): Likewise. + * include/VasEBoot/misc.h (VasEBoot_strcasecmp): Likewise. + (VasEBoot_strncasecmp): Likewise. * Makefile.util.def (cmp_test): New test. - (grub_script_strcmp): Likewise. + (VasEBoot_script_strcmp): Likewise. * tests/cmp_unit_test.c: New file. - * tests/grub_script_strcmp.in: Likewise. - * grub-core/fs/hfsplus.c (grub_hfsplus_cmp_catkey): Add a comment. + * tests/VasEBoot_script_strcmp.in: Likewise. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_cmp_catkey): Add a comment. 2012-05-04 Vladimir Serbinenko - * include/grub/pci.h: Move enums into no-asm part. + * include/VasEBoot/pci.h: Move enums into no-asm part. 2012-05-04 Vladimir Serbinenko - * grub-core/fs/bfs.c (bfs_strcmp) [MODE_AFS]: Use signed comparison. + * VasEBoot-core/fs/bfs.c (bfs_strcmp) [MODE_AFS]: Use signed comparison. 2012-05-04 Samuel Thibault @@ -10729,43 +10729,43 @@ 2012-05-04 Vladimir Serbinenko - * grub-core/commands/menuentry.c: Fix typo in TRANSLATORS comments. + * VasEBoot-core/commands/menuentry.c: Fix typo in TRANSLATORS comments. 2012-05-04 Vladimir Serbinenko - * grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for + * VasEBoot-core/kern/fs.c (VasEBoot_fs_probe) [VasEBoot_UTIL]: Add workaround for btrfs. 2012-05-04 Vladimir Serbinenko - * docs/grub.cfg: Update. + * docs/VasEBoot.cfg: Update. 2012-05-04 Vladimir Serbinenko - * docs/grub.texi (PXE): Remove not present variables. + * docs/VasEBoot.texi (PXE): Remove not present variables. 2012-05-04 Vladimir Serbinenko - * grub-core/net/net.c (defserver_set_env): New function. + * VasEBoot-core/net/net.c (defserver_set_env): New function. (defserver_get_env): Likewise. - (GRUB_MOD_INIT): Register net_default_server and pxe_default_server. + (VasEBoot_MOD_INIT): Register net_default_server and pxe_default_server. 2012-05-03 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (read_device_map): Skip invalid Fedora + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Skip invalid Fedora entries. 2012-05-03 Vladimir Serbinenko - * grub-core/commands/menuentry.c: Add TRANSLATORS comments. - * grub-core/kern/emu/hostdisk.c: Likewise. + * VasEBoot-core/commands/menuentry.c: Add TRANSLATORS comments. + * VasEBoot-core/kern/emu/hostdisk.c: Likewise. 2012-05-03 Samuel Thibault Handle hurd userspace partitions. * util/getroot.c (find_hurd_root_device): New function. - (grub_guess_root_devices): Use find_hurd_root_device on Hurd. + (VasEBoot_guess_root_devices): Use find_hurd_root_device on Hurd. 2012-05-03 Vladimir Serbinenko @@ -10775,7 +10775,7 @@ 2012-05-03 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Fix offset when + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_lzo_decompress): Fix offset when crossing page boundary. 2012-05-03 Vladimir Serbinenko @@ -10783,12 +10783,12 @@ Fix B-tree search in BFS, especially in presence of non-ASCII characters. - * grub-core/fs/bfs.c (bfs_strcmp): New function. + * VasEBoot-core/fs/bfs.c (bfs_strcmp): New function. (find_in_b_tree): Use standard bsearch + btree algorithm. 2012-05-03 Vladimir Serbinenko - * util/grub-fstest.c (cmd_cmp): Avoid comparing devices, pipes + * util/VasEBoot-fstest.c (cmd_cmp): Avoid comparing devices, pipes and so on. 2012-05-03 Matthew Garrett @@ -10796,36 +10796,36 @@ Suspend broadcom cards in order to stop their DMA. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Add pci.h on x86 EFI. - * grub-core/Makefile.core.def (kernel): Add pci.c on x86 EFI. + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Add pci.h on x86 EFI. + * VasEBoot-core/Makefile.core.def (kernel): Add pci.c on x86 EFI. (pci): Don't build on x86 EFI. - * grub-core/bus/pci.c (grub_pci_find_capability): New function. - * grub-core/kern/efi/mm.c (stop_broadcom) [__i386__ || __x86_64__]: + * VasEBoot-core/bus/pci.c (VasEBoot_pci_find_capability): New function. + * VasEBoot-core/kern/efi/mm.c (stop_broadcom) [__i386__ || __x86_64__]: New function. - (grub_efi_finish_boot_services) [__i386__ || __x86_64__]: Call + (VasEBoot_efi_finish_boot_services) [__i386__ || __x86_64__]: Call stop_broadcom if running on EFI. - * include/grub/pci.h (GRUB_PCI_CLASS_NETWORK): New enum value. - (GRUB_PCI_CAP_POWER_MANAGEMENT): Likewise. - (GRUB_PCI_VENDOR_BROADCOM): Likewise. - (grub_pci_find_capability): New proto. + * include/VasEBoot/pci.h (VasEBoot_PCI_CLASS_NETWORK): New enum value. + (VasEBoot_PCI_CAP_POWER_MANAGEMENT): Likewise. + (VasEBoot_PCI_VENDOR_BROADCOM): Likewise. + (VasEBoot_pci_find_capability): New proto. 2012-05-03 Vladimir Serbinenko - * docs/grub.texi: Remove dot from the extension as it apparently + * docs/VasEBoot.texi: Remove dot from the extension as it apparently doesn't work with some makeinfo versions. 2012-05-03 Vladimir Serbinenko * po/Makefile.in.in: Make msgfmt output in little-endian in accordance - with GRUB expectance. + with VasEBoot expectance. 2012-05-03 Vladimir Serbinenko - * util/grub-fstest.c (cmd_cmp): Compare directories recursively. + * util/VasEBoot-fstest.c (cmd_cmp): Compare directories recursively. 2012-05-03 Vladimir Serbinenko - * grub-core/fs/reiserfs.c (grub_reiserfs_iterate_dir): Put a trailing + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_iterate_dir): Put a trailing zero after directory block since last entry may be not 0-terminated if it ends on block boundary. Use continue instead of if spanning whole loop. @@ -10834,56 +10834,56 @@ Support 4K sectors UDF inline files. - * grub-core/fs/udf.c (grub_udf_file_entry): Don't specify padding size. - (grub_udf_extended_file_entry): Likewise. - (grub_fshelp_node): Name the anonymous union. Put block at the end. + * VasEBoot-core/fs/udf.c (VasEBoot_udf_file_entry): Don't specify padding size. + (VasEBoot_udf_extended_file_entry): Likewise. + (VasEBoot_fshelp_node): Name the anonymous union. Put block at the end. All users updated. (get_fshelp_size): New function. - (grub_udf_read_icb): Read whole block. - (grub_udf_iterate_dir): Likewise. - (grub_udf_dir): Likewise. - (grub_udf_open): Likewise. + (VasEBoot_udf_read_icb): Read whole block. + (VasEBoot_udf_iterate_dir): Likewise. + (VasEBoot_udf_dir): Likewise. + (VasEBoot_udf_open): Likewise. 2012-05-03 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_get_file_block): Support triple indirect. + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_get_file_block): Support triple indirect. 2012-05-03 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_lookup_symlink): Use proper check for + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_lookup_symlink): Use proper check for inline symlinks in addition to workaround. 2012-05-03 Vladimir Serbinenko - * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Handle read_inode errors. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_iterate_dir): Handle read_inode errors. 2012-05-03 Vladimir Serbinenko - * grub-core/fs/xfs.c (GRUB_XFS_EXTENT_BLOCK): Fix bitmask. + * VasEBoot-core/fs/xfs.c (VasEBoot_XFS_EXTENT_BLOCK): Fix bitmask. 2012-05-03 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (nvlist_find_value): Fix return value. + * VasEBoot-core/fs/zfs/zfs.c (nvlist_find_value): Fix return value. 2012-05-02 Vladimir Serbinenko Fix reiserfs big seek times. - * grub-core/fs/reiserfs.c (grub_reiserfs_get_item): New argument + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_get_item): New argument exact. All users updated. - (grub_reiserfs_read): Use nearest btree search for seeking. + (VasEBoot_reiserfs_read): Use nearest btree search for seeking. Fix return value on error. 2012-05-02 Vladimir Serbinenko - * grub-core/commands/legacycfg.c (legacy_file): Default to restricted + * VasEBoot-core/commands/legacycfg.c (legacy_file): Default to restricted entries. - * grub-core/commands/menuentry.c (grub_cmd_menuentry): Likewise. - * docs/grub.texi: Update menuentry description. + * VasEBoot-core/commands/menuentry.c (VasEBoot_cmd_menuentry): Likewise. + * docs/VasEBoot.texi: Update menuentry description. 2012-05-02 Vladimir Serbinenko - * util/grub-setup.c (setup): Remove duplicate call to embed. Fixes + * util/VasEBoot-setup.c (setup): Remove duplicate call to embed. Fixes crash when embedding onto filesystem. 2012-05-02 Vladimir Serbinenko @@ -10893,59 +10893,59 @@ 2012-05-01 Vladimir Serbinenko - * grub-core/net/ip.c (handle_dgram): Fix undeclared variable. + * VasEBoot-core/net/ip.c (handle_dgram): Fix undeclared variable. 2012-05-01 Vladimir Serbinenko - * grub-core/normal/autofs.c (read_fs_list): Revert accidental wrong + * VasEBoot-core/normal/autofs.c (read_fs_list): Revert accidental wrong commit. 2012-05-01 Vladimir Serbinenko 2012-05-01 Bean - * grub-core/net/ip.c (handle_dgram): Fix DHCP mac comparison. + * VasEBoot-core/net/ip.c (handle_dgram): Fix DHCP mac comparison. 2012-05-01 Vladimir Serbinenko - * grub-core/kern/file.c (grub_file_read): Read nothing if len = 0. + * VasEBoot-core/kern/file.c (VasEBoot_file_read): Read nothing if len = 0. Special behaviour for len = 0 to read whole file isn't used anywhere and can cause buffer ovewrflows in several places. 2012-05-01 Vladimir Serbinenko - * grub-core/normal/autofs.c (read_fs_list): Fix memory leak. + * VasEBoot-core/normal/autofs.c (read_fs_list): Fix memory leak. 2012-05-01 Vladimir Serbinenko Handle RAIDZ on non-512B sectors. - * grub-core/fs/zfs/zfs.c (grub_zfs_device_desc): New member + * VasEBoot-core/fs/zfs/zfs.c (VasEBoot_zfs_device_desc): New member max_children_ashift. (fill_vdev_info_real): Fill max_children_ashift. (read_device): Use max_children_ashift. 2012-05-01 Vladimir Serbinenko - * grub-core/fs/fshelp.c (grub_fshelp_find_file): Fix memory leak. + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_find_file): Fix memory leak. 2012-05-01 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (read_device_map): Reject non-standard + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Reject non-standard disk names. - * docs/grub.texi: Update device.map parts. + * docs/VasEBoot.texi: Update device.map parts. 2012-05-01 Vladimir Serbinenko Don't scan into non-diskfilter devices having diskfilter names. - * grub-core/disk/diskfilter.c (is_valid_diskfilter_name): New function. + * VasEBoot-core/disk/diskfilter.c (is_valid_diskfilter_name): New function. (scan_disk): New argument accept_diskfilter. Fix recursion depth handling. (scan_disk_hook): New function. 2012-04-29 Bean - * grub-core/net/drivers/efi/efinet.c (get_card_packet): Fix buffer + * VasEBoot-core/net/drivers/efi/efinet.c (get_card_packet): Fix buffer allocation. 2012-04-29 Mads Kiilerich (tiny) @@ -10955,80 +10955,80 @@ 2012-04-26 Vladimir Serbinenko - * grub-core/term/ieee1275/console.c (grub_console_dimensions): Use 80x24 + * VasEBoot-core/term/ieee1275/console.c (VasEBoot_console_dimensions): Use 80x24 geometry on serial consoles. 2012-04-26 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_terminfo_readkey): Increase timeout + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_readkey): Increase timeout because of network consoles. 2012-04-26 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_terminfo_getkey): Fix incorrect queue + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_getkey): Fix incorrect queue handling. 2012-04-26 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (read_segment): Fix the case when disknr + * VasEBoot-core/disk/diskfilter.c (read_segment): Fix the case when disknr falls on Q syndrom. 2012-04-26 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_palloc_entry_offset_log): - Fix argument to grub_nilfs2_palloc_bitmap_block_offset. + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_palloc_entry_offset_log): + Fix argument to VasEBoot_nilfs2_palloc_bitmap_block_offset. 2012-04-25 Vladimir Serbinenko - * grub-core/fs/squash4.c (lzo_decompress): Set grub_errno on error. + * VasEBoot-core/fs/squash4.c (lzo_decompress): Set VasEBoot_errno on error. Allocate at lest 8192 for temporary buffer as required for lzo. 2012-04-25 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_mount): Don't add logical_sector_bits + * VasEBoot-core/fs/fat.c (VasEBoot_fat_mount): Don't add logical_sector_bits to cluster_bits, since it's already added in. - (grub_fat_read_data): Likewise. + (VasEBoot_fat_read_data): Likewise. 2012-04-25 Vladimir Serbinenko - * grub-core/fs/ntfs.c (grub_ntfs_mount): Support 256-byte sectors, + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_mount): Support 256-byte sectors, as long as cluster size is multiple of 512 bytes. 2012-04-23 Vladimir Serbinenko - * util/grub-mkrescue.in: Fix locale directory. + * util/VasEBoot-mkrescue.in: Fix locale directory. 2012-04-23 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (map): Make static. + * VasEBoot-core/kern/emu/hostdisk.c (map): Make static. 2012-04-23 Bean - * util/grub-fstest.c (fstest): Add missing break. + * util/VasEBoot-fstest.c (fstest): Add missing break. 2012-04-22 Samuel Thibault Fix hurd build. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_size) [__GNU__]: Do + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_size) [__GNU__]: Do not define nr variable. * util/getroot.c [__GNU__] (strip_extra_slashes, xgetcwd, exec_pipe, find_root_devices_from_poolname, find_root_devices_from_libzfs, - grub_find_device): Do not define. + VasEBoot_find_device): Do not define. 2012-04-21 Vladimir Serbinenko Fix kfreebsd compile and behaviour. - * grub-core/kern/emu/hostdisk.c (grub_util_follow_gpart_up): Fix + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_follow_gpart_up): Fix format-security. * util/getroot.c: Fix wait.h include. - (grub_guess_root_devices): Error if grub_find_device fails. - (grub_util_get_geom_abstraction): Fix shadowing and format-security. - (grub_util_get_dev_abstraction): Likewise. - (grub_util_pull_device): Likewise. - (grub_util_get_grub_dev): Likewise. - * util/lvm.c (grub_util_lvm_isvolume): Likewise. + (VasEBoot_guess_root_devices): Error if VasEBoot_find_device fails. + (VasEBoot_util_get_geom_abstraction): Fix shadowing and format-security. + (VasEBoot_util_get_dev_abstraction): Likewise. + (VasEBoot_util_pull_device): Likewise. + (VasEBoot_util_get_VasEBoot_dev): Likewise. + * util/lvm.c (VasEBoot_util_lvm_isvolume): Likewise. 2012-04-21 Vladimir Serbinenko @@ -11037,11 +11037,11 @@ * util/getroot.c (convert_system_partition_to_system_disk): New argument is_part. All users updated. (device_is_wholedisk): Removed. - (grub_util_biosdisk_get_grub_dev): Use is_part. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Use is_part. 2012-04-18 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_write): Fix opening + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_write): Fix opening mode. 2012-04-18 Vladimir Serbinenko @@ -11050,12 +11050,12 @@ 2012-04-18 Vladimir Serbinenko - * grub-core/commands/search_wrap.c (grub_cmd_search): Handle old + * VasEBoot-core/commands/search_wrap.c (VasEBoot_cmd_search): Handle old --fs-uuid --set UUID syntax. 2012-04-18 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_write): Fix message + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_write): Fix message disunification. 2012-04-18 Vladimir Serbinenko @@ -11064,83 +11064,83 @@ 2012-04-18 Mads Kiilerich - * grub-mkconfig_lib.in: Ignore *.rpmnew and *.rpmsave. + * VasEBoot-mkconfig_lib.in: Ignore *.rpmnew and *.rpmsave. 2012-04-18 Mike Gilbert - * util/grub.d/10_linux.in: Fix detection of genkernel initramfs. + * util/VasEBoot.d/10_linux.in: Fix detection of genkernel initramfs. 2012-04-18 Bean - * grub-core/disk/ata.c (grub_ata_strncpy): Put terminating zero at right + * VasEBoot-core/disk/ata.c (VasEBoot_ata_strncpy): Put terminating zero at right place. 2012-04-18 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (open_device): New argument max. All + * VasEBoot-core/kern/emu/hostdisk.c (open_device): New argument max. All users updated. - (grub_util_biosdisk_read): Handle Linux partitions not exactly - corresponding to GRUB partitions. - (grub_util_biosdisk_write): Likewise. + (VasEBoot_util_biosdisk_read): Handle Linux partitions not exactly + corresponding to VasEBoot partitions. + (VasEBoot_util_biosdisk_write): Likewise. 2012-04-18 Vladimir Serbinenko Scan mdraid before LVM. - * include/grub/diskfilter.h (grub_diskfilter_register): Renamed to .. - (grub_diskfilter_register_front): ... this. - (grub_diskfilter_register_back): New function. - All users of grub_diskfilter_register updated. + * include/VasEBoot/diskfilter.h (VasEBoot_diskfilter_register): Renamed to .. + (VasEBoot_diskfilter_register_front): ... this. + (VasEBoot_diskfilter_register_back): New function. + All users of VasEBoot_diskfilter_register updated. 2012-04-18 Vladimir Serbinenko - * util/grub-install.in: Fix an automatic target detection bug. + * util/VasEBoot-install.in: Fix an automatic target detection bug. 2012-04-18 Vladimir Serbinenko - * util/grub-install.in: New option --efi-directory. + * util/VasEBoot-install.in: New option --efi-directory. 2012-04-17 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (allocate_pages): Overwrite low memory + * VasEBoot-core/loader/i386/linux.c (allocate_pages): Overwrite low memory boot services if we have no other choice. 2012-04-14 Vladimir Serbinenko - * util/grub-mknetdir.in: Rename --override-directory to --directory and + * util/VasEBoot-mknetdir.in: Rename --override-directory to --directory and document it. - * tests/util/grub-shell.in: Update to --directory. + * tests/util/VasEBoot-shell.in: Update to --directory. 2012-04-13 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c: Disable -Wstrict-aliasing. + * VasEBoot-core/fs/zfs/zfs.c: Disable -Wstrict-aliasing. 2012-04-13 Vladimir Serbinenko - * grub-core/fs/minix.c (grub_minix_data): Fix ino type. - (grub_minix_read_file): Likewise. - (grub_minix_read_inode): Likewise. - (grub_minix_find_file): Likewise. - (grub_minix_dir): Likewise. + * VasEBoot-core/fs/minix.c (VasEBoot_minix_data): Fix ino type. + (VasEBoot_minix_read_file): Likewise. + (VasEBoot_minix_read_inode): Likewise. + (VasEBoot_minix_find_file): Likewise. + (VasEBoot_minix_dir): Likewise. 2012-04-13 Vladimir Serbinenko - * util/grub-setup.c (setup): Fix partition handling and blocklist + * util/VasEBoot-setup.c (setup): Fix partition handling and blocklist check. 2012-04-13 Vladimir Serbinenko - * grub-core/lib/relocator.c (grub_relocator_alloc_chunk_align): Remove + * VasEBoot-core/lib/relocator.c (VasEBoot_relocator_alloc_chunk_align): Remove redundant buggy overlap check. 2012-04-11 Vladimir Serbinenko - * tests/util/grub-shell.in: Set pkgdatadir when calling grub-mkrescue - and grub-mknetdir. + * tests/util/VasEBoot-shell.in: Set pkgdatadir when calling VasEBoot-mkrescue + and VasEBoot-mknetdir. 2012-04-11 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_cmd_linux): Avoid accessing + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Avoid accessing kh.loadflags on pre-2.00 kernels. 2012-04-11 Vladimir Serbinenko @@ -11148,63 +11148,63 @@ Terminate UNDI and PXE before launching the payload to avoid problems with DMA. - * grub-core/commands/boot.c (grub_loader_noreturn): Rename to ... - (grub_loader_flags): ... this. All users updated. - (grub_loader_boot): Check for GRUB_LOADER_FLAG_NORETURN. - * grub-core/loader/i386/pc/pxechainloader.c (grub_cmd_pxechain): Mark - loader as GRUB_LOADER_FLAG_PXE_NOT_UNLOAD. - * grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_shutdown): New + * VasEBoot-core/commands/boot.c (VasEBoot_loader_noreturn): Rename to ... + (VasEBoot_loader_flags): ... this. All users updated. + (VasEBoot_loader_boot): Check for VasEBoot_LOADER_FLAG_NORETURN. + * VasEBoot-core/loader/i386/pc/pxechainloader.c (VasEBoot_cmd_pxechain): Mark + loader as VasEBoot_LOADER_FLAG_PXE_NOT_UNLOAD. + * VasEBoot-core/net/drivers/i386/pc/pxe.c (VasEBoot_pxe_shutdown): New function. - (grub_pxe_restore): Likewise. + (VasEBoot_pxe_restore): Likewise. (fini_hnd): New var. - (GRUB_MOD_INIT): Register shutdown hook. - (GRUB_MOD_FINI): Shutdown and unregister shutdown hook. - * include/grub/loader.h (GRUB_LOADER_FLAG_NORETURN): New const. - (GRUB_LOADER_FLAG_PXE_NOT_UNLOAD): Likewise. - (grub_loader_set): Rename second argument to flags. + (VasEBoot_MOD_INIT): Register shutdown hook. + (VasEBoot_MOD_FINI): Shutdown and unregister shutdown hook. + * include/VasEBoot/loader.h (VasEBoot_LOADER_FLAG_NORETURN): New const. + (VasEBoot_LOADER_FLAG_PXE_NOT_UNLOAD): Likewise. + (VasEBoot_loader_set): Rename second argument to flags. 2012-04-07 Vladimir Serbinenko - * grub-core/normal/charset.c (grub_ucs4_to_utf8): Return number of + * VasEBoot-core/normal/charset.c (VasEBoot_ucs4_to_utf8): Return number of written bytes. - (grub_get_num_of_utf8_bytes): New function. - (grub_ucs4_to_utf8_alloc): Use grub_get_num_of_utf8_bytes. - * grub-core/normal/menu_entry.c (run): Convert entry to UTF-8 before + (VasEBoot_get_num_of_utf8_bytes): New function. + (VasEBoot_ucs4_to_utf8_alloc): Use VasEBoot_get_num_of_utf8_bytes. + * VasEBoot-core/normal/menu_entry.c (run): Convert entry to UTF-8 before executing it. - * include/grub/charset.h (grub_get_num_of_utf8_bytes): New proto. - (grub_ucs4_to_utf8): Change return type. + * include/VasEBoot/charset.h (VasEBoot_get_num_of_utf8_bytes): New proto. + (VasEBoot_ucs4_to_utf8): Change return type. 2012-04-07 Vladimir Serbinenko - * grub-core/commands/usbtest.c (usb_print_str): Silence spurious + * VasEBoot-core/commands/usbtest.c (usb_print_str): Silence spurious warning. - * grub-core/fs/bfs.c (hop_level): Likewise. - * grub-core/net/bootp.c (grub_cmd_bootp): Likewise. + * VasEBoot-core/fs/bfs.c (hop_level): Likewise. + * VasEBoot-core/net/bootp.c (VasEBoot_cmd_bootp): Likewise. 2012-04-07 Vladimir Serbinenko - * grub-core/lib/adler32.c: Recode due to license unclearness. + * VasEBoot-core/lib/adler32.c: Recode due to license unclearness. 2012-04-07 Vladimir Serbinenko - * grub-core/io/lzopio.c (read_block_header): Fix incorrect byte swapping + * VasEBoot-core/io/lzopio.c (read_block_header): Fix incorrect byte swapping (test_header): Likewise. 2012-04-07 Vladimir Serbinenko Fix --help formatting. - * util/grub-mkconfig_lib.in (print_option_help): New function. - (grub_fmt): Likewise. - * util/grub-install.in: Use print_option_help and grub_fmt. - * util/grub-kbdcomp.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-mkconfig_lib.in (print_option_help): New function. + (VasEBoot_fmt): Likewise. + * util/VasEBoot-install.in: Use print_option_help and VasEBoot_fmt. + * util/VasEBoot-kbdcomp.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2012-04-07 Vladimir Serbinenko @@ -11222,23 +11222,23 @@ 2012-04-04 Vladimir Serbinenko - * grub-core/gettext/gettext.c (grub_gettext_pread): Fix the case when + * VasEBoot-core/gettext/gettext.c (VasEBoot_gettext_pread): Fix the case when len = 0. - (grub_gettext_translate_real): Handle 0th string. - (grub_gettext_translate): Ensure that "" isn't translated. + (VasEBoot_gettext_translate_real): Handle 0th string. + (VasEBoot_gettext_translate): Ensure that "" isn't translated. 2012-04-04 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_memberlist): Add + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_memberlist): Add TRANSLATORS comment. - (grub_diskfilter_print_partmap): Propagate changing of error into + (VasEBoot_diskfilter_print_partmap): Propagate changing of error into warning. 2012-04-04 Vladimir Serbinenko - * include/grub/diskfilter.h (grub_diskfilter_vg): Increase extent_size + * include/VasEBoot/diskfilter.h (VasEBoot_diskfilter_vg): Increase extent_size to uint64_t to prevent overflow. - (grub_diskfilter_lv): Increase start_extent and extent_count + (VasEBoot_diskfilter_lv): Increase start_extent and extent_count to uint64_t to prevent overflow. 2012-04-01 Vladimir Serbinenko @@ -11261,66 +11261,66 @@ Handle big-endian minixfs (fixes minixfs tests on bigendian). - * grub-core/fs/minix.c: Replace le with minix. Add necessary defines, + * VasEBoot-core/fs/minix.c: Replace le with minix. Add necessary defines, modify names. Introduce MODE_BIGENDIAN. - * grub-core/fs/minix_be.c: New file. - * grub-core/fs/minix2_be.c: Likewise - * grub-core/fs/minix3_be.c: Likewise. - * Makefile.util.def (libgrubmods): Add minix_be, minix2_be and + * VasEBoot-core/fs/minix_be.c: New file. + * VasEBoot-core/fs/minix2_be.c: Likewise + * VasEBoot-core/fs/minix3_be.c: Likewise. + * Makefile.util.def (libVasEBootmods): Add minix_be, minix2_be and minix3_be. - * grub-core/Makefile.core.def (minix_be): New module. + * VasEBoot-core/Makefile.core.def (minix_be): New module. (minix2_be): Likewise. (minix3_be): Likewise. 2012-04-01 Felix - * grub-core/loader/efi/appleloader.c (devpath_7): New var. + * VasEBoot-core/loader/efi/appleloader.c (devpath_7): New var. (devs): Add MBP 2011. 2012-04-01 Vladimir Serbinenko - * grub-core/font/font.c (blit_comb): Handle dagesh somewhat. + * VasEBoot-core/font/font.c (blit_comb): Handle dagesh somewhat. 2012-04-01 Vladimir Serbinenko - * grub-core/normal/cmdline.c (print_completion): New field + * VasEBoot-core/normal/cmdline.c (print_completion): New field prompt_len. - (grub_cmdline_get): Handle width properly. + (VasEBoot_cmdline_get): Handle width properly. 2012-04-01 Vladimir Serbinenko - * grub-core/commands/lsacpi.c (options): Add missing terminator. + * VasEBoot-core/commands/lsacpi.c (options): Add missing terminator. 2012-03-31 Vladimir Serbinenko - * include/grub/datetime.h (grub_datetime2unixtime): Fix handling of days + * include/VasEBoot/datetime.h (VasEBoot_datetime2unixtime): Fix handling of days after 29th of February. 2012-03-31 Vladimir Serbinenko Fix exfat endianness handling. - * grub-core/fs/fat.c (grub_fat_data): Make fat_sector 32-bit. - (grub_fat_mount) [MODE_EXFAT]: Fix bpb.num_reserved_sectors byte-swap. - (grub_fat_iterate_dir) [MODE_EXFAT]: Fix attr byte-swap. + * VasEBoot-core/fs/fat.c (VasEBoot_fat_data): Make fat_sector 32-bit. + (VasEBoot_fat_mount) [MODE_EXFAT]: Fix bpb.num_reserved_sectors byte-swap. + (VasEBoot_fat_iterate_dir) [MODE_EXFAT]: Fix attr byte-swap. Byte-swap utf16 when necessary. - (grub_fat_label) [MODE_EXFAT]: Byte-swap utf16 when necessary. + (VasEBoot_fat_label) [MODE_EXFAT]: Byte-swap utf16 when necessary. 2012-03-31 Anton Blanchard 2012-03-31 Vladimir Serbinenko Fix btrfs endianness handling. - * grub-core/fs/btrfs.c (key_cmp): Use grub_le_to_cpu for clarity. + * VasEBoot-core/fs/btrfs.c (key_cmp): Use VasEBoot_le_to_cpu for clarity. (lower_bound): Make root uint64_t. Use root in le. - (grub_btrfs_read_logical): Fix template key init. Fix address byteswap. + (VasEBoot_btrfs_read_logical): Fix template key init. Fix address byteswap. (find_path): Fix template key init. - (grub_btrfs_dir): Fix mtime byteswap. - * include/grub/types.h (grub_cpu_to_le64_compile_time): New macro. + (VasEBoot_btrfs_dir): Fix mtime byteswap. + * include/VasEBoot/types.h (VasEBoot_cpu_to_le64_compile_time): New macro. 2012-03-31 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_read_logical): New argument + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_read_logical): New argument recursion_depth. Break infinite resursions. All users updated. 2012-03-31 Vladimir Serbinenko @@ -11331,138 +11331,138 @@ 2012-03-31 Anton Blanchard - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Do not byteswap + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Do not byteswap 8 bit values. 2012-03-28 Vladimir Serbinenko - * util/grub-install.in: Fix nvram call for PreP. + * util/VasEBoot-install.in: Fix nvram call for PreP. 2012-03-28 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_memberlist): Degrade + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_memberlist): Degrade the error when some elements are missing into a warning. 2012-03-28 Vladimir Serbinenko - * grub-core/normal/charset.c (bidi_line_wrap): Fix out-of-range swap. + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Fix out-of-range swap. 2012-03-28 Colin Watson - * docs/grub.texi (Invoking grub-probe): New section. + * docs/VasEBoot.texi (Invoking VasEBoot-probe): New section. Reported by: Filipus Klutiero. Fixes Debian bug #666031. 2012-03-27 Vladimir Serbinenko Fix tab and wide character handling in editor and menu. - * grub-core/normal/charset.c (grub_unicode_aglomerate_comb): Don't + * VasEBoot-core/normal/charset.c (VasEBoot_unicode_aglomerate_comb): Don't agglomerate control characters with combining marks. (bidi_line_wrap): Allow break on tab. - (grub_unicode_get_comb_start): New function. - * grub-core/normal/menu_entry.c: Restructure to handle wide characters + (VasEBoot_unicode_get_comb_start): New function. + * VasEBoot-core/normal/menu_entry.c: Restructure to handle wide characters and tab correctly. - * grub-core/normal/menu_text.c (print_entry): Replace \n, \r, \b and \e + * VasEBoot-core/normal/menu_text.c (print_entry): Replace \n, \r, \b and \e with a space. - * grub-core/normal/term.c (print_ucs4_terminal): New argument + * VasEBoot-core/normal/term.c (print_ucs4_terminal): New argument fixed_tab_size. All users updated. - * include/grub/term.h (GRUB_TERM_TAB_WIDTH): New const. - (grub_term_getcharwidth): Handle \t. - * include/grub/unicode.h (grub_unicode_glyph_dup): Fix allocation + * include/VasEBoot/term.h (VasEBoot_TERM_TAB_WIDTH): New const. + (VasEBoot_term_getcharwidth): Handle \t. + * include/VasEBoot/unicode.h (VasEBoot_unicode_glyph_dup): Fix allocation and copy. 2012-03-26 Vladimir Serbinenko Handle big-endian mdraid. - * Makefile.util.def (libgrubkern): Add mdraid_linux_be.c. - * grub-core/Makefile.core.def (mdraid09_be): New module. - * grub-core/disk/mdraid_linux.c: Use grub_md_to_cpu* and grub_cpu_to_md* - rather than grub_le_to_cpu* and grub_cpu_to_le*. - * grub-core/disk/mdraid_linux_be.c: New file. + * Makefile.util.def (libVasEBootkern): Add mdraid_linux_be.c. + * VasEBoot-core/Makefile.core.def (mdraid09_be): New module. + * VasEBoot-core/disk/mdraid_linux.c: Use VasEBoot_md_to_cpu* and VasEBoot_cpu_to_md* + rather than VasEBoot_le_to_cpu* and VasEBoot_cpu_to_le*. + * VasEBoot-core/disk/mdraid_linux_be.c: New file. 2012-03-26 Vladimir Serbinenko - * grub-core/gettext/gettext.c (GRUB_MOD_INIT): Handle errors. + * VasEBoot-core/gettext/gettext.c (VasEBoot_MOD_INIT): Handle errors. 2012-03-19 Vladimir Serbinenko - * util/getroot.c (grub_make_system_path_relative_to_its_root): Fix + * util/getroot.c (VasEBoot_make_system_path_relative_to_its_root): Fix missing quotes which caused confusion among translators. 2012-03-19 Vladimir Serbinenko - * util/grub-mkconfig_lib.in: Fix typo. + * util/VasEBoot-mkconfig_lib.in: Fix typo. 2012-03-19 Vladimir Serbinenko - * grub-core/script/argv.c (grub_script_argv_split_append): Skip leading + * VasEBoot-core/script/argv.c (VasEBoot_script_argv_split_append): Skip leading spaces. - * tests/grub_script_leading_whitespace.in: New file. - * Makefile.util.def (grub_script_leading_whitespace): New test. + * tests/VasEBoot_script_leading_whitespace.in: New file. + * Makefile.util.def (VasEBoot_script_leading_whitespace): New test. 2012-03-19 Vladimir Serbinenko - * grub-core/kern/dl.c (grub_dl_add): Make global in order for gdb_grub + * VasEBoot-core/kern/dl.c (VasEBoot_dl_add): Make global in order for gdb_VasEBoot to work. 2012-03-19 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_label): Use first label if second one + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_label): Use first label if second one starts with control character. 2012-03-19 Vladimir Serbinenko - * grub-core/gdb/cstub.c (grub_gdb_inbuf): Increase the size to avoid + * VasEBoot-core/gdb/cstub.c (VasEBoot_gdb_inbuf): Increase the size to avoid overflow. - (grub_gdb_outbuf): Likewise. + (VasEBoot_gdb_outbuf): Likewise. 2012-03-19 Vladimir Serbinenko - * grub-core/commands/menuentry.c (grub_normal_add_menu_entry): Add + * VasEBoot-core/commands/menuentry.c (VasEBoot_normal_add_menu_entry): Add zero terminator. Fixes a crash. 2012-03-11 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (allocate_pages): Don't allocate + * VasEBoot-core/loader/i386/linux.c (allocate_pages): Don't allocate beyond 4 GiB. - (grub_cmd_linux): Use GRUB_LINUX_BZIMAGE_ADDR for non-relocatable + (VasEBoot_cmd_linux): Use VasEBoot_LINUX_BZIMAGE_ADDR for non-relocatable images independently of preffered adderss field. 2012-03-11 Vladimir Serbinenko - * grub-core/commands/i386/pc/play.c: Improve TRANSLATORS comments. - * grub-core/commands/regexp.c: Likewise. - * grub-core/loader/i386/linux.c: Likewise. - * grub-core/partmap/msdos.c: Likewise. - * grub-core/script/execute.c: Likewise. - * grub-core/term/gfxterm.c: Likewise. + * VasEBoot-core/commands/i386/pc/play.c: Improve TRANSLATORS comments. + * VasEBoot-core/commands/regexp.c: Likewise. + * VasEBoot-core/loader/i386/linux.c: Likewise. + * VasEBoot-core/partmap/msdos.c: Likewise. + * VasEBoot-core/script/execute.c: Likewise. + * VasEBoot-core/term/gfxterm.c: Likewise. 2012-03-11 Vladimir Serbinenko Add variable parsing in $"..." and fix several mismatches with bash. - * Makefile.util.def (grub_script_gettext): New test. - * grub-core/script/execute.c (parse_string): New function. + * Makefile.util.def (VasEBoot_script_gettext): New test. + * VasEBoot-core/script/execute.c (parse_string): New function. (gettext_append): Likewise. - (grub_script_arglist_to_argv): Use gettext_append. - * grub-core/script/yylex.l: Fix slash and newline handling in $"...". - * tests/grub_script_gettext.in: New file. + (VasEBoot_script_arglist_to_argv): Use gettext_append. + * VasEBoot-core/script/yylex.l: Fix slash and newline handling in $"...". + * tests/VasEBoot_script_gettext.in: New file. 2012-03-11 Vladimir Serbinenko Fix handling of leading spaces in scripts. - * grub-core/normal/cmdline.c (grub_cmdline_get): Don't strip leading + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Don't strip leading spaces. - * grub-core/normal/main.c (grub_file_getline): Remove all preprocessing + * VasEBoot-core/normal/main.c (VasEBoot_file_getline): Remove all preprocessing other than skipping \r. All users updated. - * tests/grub_script_echo1.in: Add space-related tests. - * util/grub-menulst2cfg.c (main): Remove useless space skipping. + * tests/VasEBoot_script_echo1.in: Add space-related tests. + * util/VasEBoot-menulst2cfg.c (main): Remove useless space skipping. 2012-03-11 Vladimir Serbinenko - * grub-core/commands/cat.c (grub_cmd_cat): Fix termination key check. + * VasEBoot-core/commands/cat.c (VasEBoot_cmd_cat): Fix termination key check. 2012-03-10 Vladimir Serbinenko @@ -11473,26 +11473,26 @@ Fix gettext reload bugs (e.g. inability to disable gettext once enabled). - * grub-core/gettext/gettext.c: Encapsulate all static variables in + * VasEBoot-core/gettext/gettext.c: Encapsulate all static variables in main_context and secondary_context. All functions updated. - (grub_gettext_translate): Rename to ... - (grub_gettext_translate_real): ... this. Return NULL on failed + (VasEBoot_gettext_translate): Rename to ... + (VasEBoot_gettext_translate_real): ... this. Return NULL on failed translate. - (grub_gettext_translate): Handle secondary context. - (grub_gettext_delete_list): Close file and zero-out the context. - (grub_mofile_open): Don't call grub_gettext_delete_list. + (VasEBoot_gettext_translate): Handle secondary context. + (VasEBoot_gettext_delete_list): Close file and zero-out the context. + (VasEBoot_mofile_open): Don't call VasEBoot_gettext_delete_list. Don't close file. - (grub_gettext_init_ext): Call grub_gettext_init_ext. Skip loading + (VasEBoot_gettext_init_ext): Call VasEBoot_gettext_init_ext. Skip loading if locale="" to avoid pointless error message. - (grub_gettext_env_write_lang): Update lang even if load fails. + (VasEBoot_gettext_env_write_lang): Update lang even if load fails. Handle secondary context. - (grub_gettext_reread_prefix): New function. + (VasEBoot_gettext_reread_prefix): New function. (read_main): Likewise. (read_secondary): Likewise. - (GRUB_MOD_INIT): Handle secondary context. Hook and export variables. - (GRUB_MOD_FINI): Handle secondary context. Don't close file. - * grub-core/normal/main.c (read_lists): Call grub_gettext_reread_prefix. - * include/grub/normal.h (grub_gettext_reread_prefix): New proto. + (VasEBoot_MOD_INIT): Handle secondary context. Hook and export variables. + (VasEBoot_MOD_FINI): Handle secondary context. Don't close file. + * VasEBoot-core/normal/main.c (read_lists): Call VasEBoot_gettext_reread_prefix. + * include/VasEBoot/normal.h (VasEBoot_gettext_reread_prefix): New proto. 2012-03-10 Vladimir Serbinenko @@ -11509,48 +11509,48 @@ Fix efi chainloader on network root. - * grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Handle + * VasEBoot-core/loader/efi/chainloader.c (VasEBoot_cmd_chainloader): Handle network devices. - * grub-core/net/drivers/efi/efinet.c (grub_efinet_get_device_handle): + * VasEBoot-core/net/drivers/efi/efinet.c (VasEBoot_efinet_get_device_handle): New function. 2012-03-10 Vladimir Serbinenko - * grub-core/gfxmenu/gui_progress_bar.c (grub_gui_progress_bar): Remove + * VasEBoot-core/gfxmenu/gui_progress_bar.c (VasEBoot_gui_progress_bar): Remove unused show_text member. - * docs/grub.texi: Document "text" property. + * docs/VasEBoot.texi: Document "text" property. 2012-03-10 Vladimir Serbinenko - * grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Fix format + * VasEBoot-core/loader/efi/chainloader.c (VasEBoot_cmd_chainloader): Fix format in dprintf. 2012-03-10 Vladimir Serbinenko Fix IMSM handling on Fedora. - * util/getroot.c (grub_util_is_imsm): New function. - (grub_util_get_dev_abstraction): Treat IMSM as simple device, not RAID. + * util/getroot.c (VasEBoot_util_is_imsm): New function. + (VasEBoot_util_get_dev_abstraction): Treat IMSM as simple device, not RAID. 2012-03-10 Vladimir Serbinenko * Makefile.am: Strip gold section. * conf/Makefile.common: Likewise. * gentpl.py: Likewise. - * grub-core/Makefile.core.def: Likewise. - * grub-core/genmod.sh.in: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. + * VasEBoot-core/genmod.sh.in: Likewise. 2012-03-10 Vladimir Serbinenko - * util/grub.d/10_linux.in: Use stat if grub-probe on root fails. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_linux.in: Use stat if VasEBoot-probe on root fails. + * util/VasEBoot.d/20_linux_xen.in: Likewise. Based on Debian patch. 2012-03-10 Vladimir Serbinenko - * util/grub.d/10_linux.in: Fix syntax error resulting in + * util/VasEBoot.d/10_linux.in: Fix syntax error resulting in Richard Laager's patch. - * util/grub.d/20_linux_xen.in: Propagate Richard Laager's patch. + * util/VasEBoot.d/20_linux_xen.in: Propagate Richard Laager's patch. 2012-03-10 Vladimir Serbinenko @@ -11559,34 +11559,34 @@ 2012-03-10 Richard Laager - * util/grub.d/10_linux.in: Fix ZFS root passing. + * util/VasEBoot.d/10_linux.in: Fix ZFS root passing. 2012-03-10 Vladimir Serbinenko - * grub-core/commands/videoinfo.c: Add TRANSLATORS comments. - * grub-core/commands/xnu_uuid.c: Likewise. - * grub-core/loader/efi/appleloader.c: Likewise. - * grub-core/script/execute.c: Likewise. - * grub-core/script/main.c: Likewise. - * util/grub-mkfont.c: Likewise. + * VasEBoot-core/commands/videoinfo.c: Add TRANSLATORS comments. + * VasEBoot-core/commands/xnu_uuid.c: Likewise. + * VasEBoot-core/loader/efi/appleloader.c: Likewise. + * VasEBoot-core/script/execute.c: Likewise. + * VasEBoot-core/script/main.c: Likewise. + * util/VasEBoot-mkfont.c: Likewise. 2012-03-10 Vladimir Serbinenko - * util/grub-mkfont.c (options): Use more appropriate "select" that + * util/VasEBoot-mkfont.c (options): Use more appropriate "select" that "set" for face index. 2012-03-10 Vladimir Serbinenko - * util/grub-editenv.c (options): Gettextize command summaries. + * util/VasEBoot-editenv.c (options): Gettextize command summaries. 2012-03-10 Vladimir Serbinenko - * grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Use + * VasEBoot-core/loader/efi/chainloader.c (VasEBoot_cmd_chainloader): Use "out of memory" error messagge. 2012-03-10 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_memberlist): Add scanning + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_memberlist): Add scanning of diskfilter for diskfilter on diskfilter support. 2012-03-10 Vladimir Serbinenko @@ -11595,58 +11595,58 @@ 2012-03-10 Vladimir Serbinenko - * util/grub-install.in: Check for themes/starfield/theme.txt and not + * util/VasEBoot-install.in: Check for themes/starfield/theme.txt and not themes/starfield. 2012-03-10 Vladimir Serbinenko - * grub-core/gnulib/regcomp.c (regerror): Fix out-of-range array lookup. + * VasEBoot-core/gnulib/regcomp.c (regerror): Fix out-of-range array lookup. 2012-03-10 Vladimir Serbinenko - * grub-core/gdb/i386/idt.c (grub_gdb_breakpoint): Remove old debug code. + * VasEBoot-core/gdb/i386/idt.c (VasEBoot_gdb_breakpoint): Remove old debug code. 2012-03-10 Vladimir Serbinenko - * grub-core/commands/hashsum.c (grub_cmd_hashsum): Remove dot at the end + * VasEBoot-core/commands/hashsum.c (VasEBoot_cmd_hashsum): Remove dot at the end of error message. 2012-03-09 Vladimir Serbinenko - * util/grub-install.in: Fix install non-PreP IEEE1275 install. + * util/VasEBoot-install.in: Fix install non-PreP IEEE1275 install. 2012-03-09 Vladimir Serbinenko - * grub-core/commands/i386/pc/sendkey.c (GRUB_MOD_INIT): Fix confusing + * VasEBoot-core/commands/i386/pc/sendkey.c (VasEBoot_MOD_INIT): Fix confusing message. - * util/grub-install.in: Fix and gettextize error message. + * util/VasEBoot-install.in: Fix and gettextize error message. 2012-03-08 Vladimir Serbinenko - * util/grub-fstest.c (options): Replace N with NUM and S with STRING. + * util/VasEBoot-fstest.c (options): Replace N with NUM and S with STRING. Gettextize. - * util/grub-mount.c (options): Likewise. + * util/VasEBoot-mount.c (options): Likewise. 2012-03-08 Vladimir Serbinenko - * grub-core/commands/probe.c (options): Replace VAR with VARNAME and + * VasEBoot-core/commands/probe.c (options): Replace VAR with VARNAME and gettextize. - * grub-core/commands/search_wrap.c (options): Likewise. + * VasEBoot-core/commands/search_wrap.c (options): Likewise. 2012-03-08 Vladimir Serbinenko - * grub-core/normal/charset.c (bidi_line_wrap): Fix a spurious warning. + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Fix a spurious warning. 2012-03-08 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S (multiboot_trampoline): Fix + * VasEBoot-core/boot/i386/pc/startup_raw.S (multiboot_trampoline): Fix size calculation. - * grub-core/kern/i386/realmode.S (realidt): Assume default BIOS IDT if + * VasEBoot-core/kern/i386/realmode.S (realidt): Assume default BIOS IDT if none is known. 2012-03-08 Vladimir Serbinenko - * grub-core/net/net.c (grub_net_addr_to_str): Don't translate + * VasEBoot-core/net/net.c (VasEBoot_net_addr_to_str): Don't translate "temporary" since it's used in identifier and is limited in space. 2012-03-08 Vladimir Serbinenko @@ -11656,123 +11656,123 @@ 2012-03-08 Vladimir Serbinenko - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Add missing + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Add missing byte-swap on big-endian. Reported by: Lennart Sorensen 2012-03-07 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (prot_init_space): New variable. + * VasEBoot-core/loader/i386/linux.c (prot_init_space): New variable. (allocate_pages): Improve dprintf. - (grub_cmd_linux): Fill prot_init_space. Fix improper usage of + (VasEBoot_cmd_linux): Fill prot_init_space. Fix improper usage of code32_start. Fill code32_start and kernel_alignment in params. - (grub_cmd_initrd): Use prot_init_space. + (VasEBoot_cmd_initrd): Use prot_init_space. 2012-03-06 Vladimir Serbinenko - * util/grub-mkstandalone.in: Propagate grub-mkimage.c change. + * util/VasEBoot-mkstandalone.in: Propagate VasEBoot-mkimage.c change. 2012-03-06 Vladimir Serbinenko - * util/grub-install.in: Add missing dot at the end of sentence. + * util/VasEBoot-install.in: Add missing dot at the end of sentence. 2012-03-06 Vladimir Serbinenko - * grub-core/commands/videoinfo.c: Add TRANSLATORS comments. - * grub-core/commands/videotest.c: Likewise. - * grub-core/loader/i386/linux.c: Likewise. + * VasEBoot-core/commands/videoinfo.c: Add TRANSLATORS comments. + * VasEBoot-core/commands/videotest.c: Likewise. + * VasEBoot-core/loader/i386/linux.c: Likewise. 2012-03-06 Vladimir Serbinenko - * grub-core/commands/acpi.c (options): Fix a dot in the middle of the + * VasEBoot-core/commands/acpi.c (options): Fix a dot in the middle of the sentence. Reported by: Milo Casagrande. 2012-03-06 Vladimir Serbinenko - * grub-core/commands/acpi.c: Add TRANSLATORS comments. - * grub-core/commands/gptsync.c: Likewise. - * grub-core/commands/hashsum.c: Likewise. - * grub-core/commands/i386/pc/sendkey.c: Likewise. - * grub-core/commands/legacycfg.c: Likewise. - * grub-core/io/gzio.c: Likewise. - * grub-core/net/net.c: Likewise. - * grub-core/term/gfxterm.c: Likewise. - * grub-core/term/terminfo.c: Likewise. - * grub-core/tests/test_blockarg.c: Likewise. - * grub-core/video/video.c: Likewise. - * util/grub-install.in: Likewise. - * util/grub-mkfont.c: Likewise. + * VasEBoot-core/commands/acpi.c: Add TRANSLATORS comments. + * VasEBoot-core/commands/gptsync.c: Likewise. + * VasEBoot-core/commands/hashsum.c: Likewise. + * VasEBoot-core/commands/i386/pc/sendkey.c: Likewise. + * VasEBoot-core/commands/legacycfg.c: Likewise. + * VasEBoot-core/io/gzio.c: Likewise. + * VasEBoot-core/net/net.c: Likewise. + * VasEBoot-core/term/gfxterm.c: Likewise. + * VasEBoot-core/term/terminfo.c: Likewise. + * VasEBoot-core/tests/test_blockarg.c: Likewise. + * VasEBoot-core/video/video.c: Likewise. + * util/VasEBoot-install.in: Likewise. + * util/VasEBoot-mkfont.c: Likewise. 2012-03-06 Vladimir Serbinenko - * util/grub-mkimage.c (help_filter): Add missing capitalisation. + * util/VasEBoot-mkimage.c (help_filter): Add missing capitalisation. 2012-03-06 Vladimir Serbinenko - * grub-core/commands/search_wrap.c (options): Fix a typo. + * VasEBoot-core/commands/search_wrap.c (options): Fix a typo. Reported by: David Prévot. 2012-03-06 Vladimir Serbinenko - * util/grub-kbdcomp.in: Change "layout" to "keyboard layout" in + * util/VasEBoot-kbdcomp.in: Change "layout" to "keyboard layout" in description. 2012-03-06 Vladimir Serbinenko - * util/grub-script-check.c (main): Fix a syntax error message which was + * util/VasEBoot-script-check.c (main): Fix a syntax error message which was unclear. 2012-03-06 Vladimir Serbinenko - * util/grub-mkrescue.in (usage): Fix ROM capitalisation. + * util/VasEBoot-mkrescue.in (usage): Fix ROM capitalisation. 2012-03-06 Vladimir Serbinenko - * grub-core/commands/search_wrap.c (options): Fix wrong copy-paste in + * VasEBoot-core/commands/search_wrap.c (options): Fix wrong copy-paste in messages. 2012-03-06 Vladimir Serbinenko - * util/grub-fstest.c (options): Remove OPTION_ARG_OPTIONAL from options + * util/VasEBoot-fstest.c (options): Remove OPTION_ARG_OPTIONAL from options without argument. - * util/grub-mount.c (options): Likewise. + * util/VasEBoot-mount.c (options): Likewise. 2012-03-05 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Unify diskboot.img size message. + * util/VasEBoot-mkimage.c (generate_image): Unify diskboot.img size message. 2012-03-05 Vladimir Serbinenko - * grub-core/net/http.c: Add TRANSLATORS comments. - * grub-core/normal/cmdline.c: Likewise. - * grub-core/normal/misc.c: Likewise. - * grub-core/partmap/msdos.c: Likewise. - * grub-core/parttool/msdospart.c: Likewise. - * grub-core/script/execute.c: Likewise. - * grub-core/script/main.c: Likewise. - * grub-core/term/terminfo.c: Likewise. - * grub-core/video/bitmap.c: Likewise. - * util/grub-install.in: Likewise. - * util/grub-mkimage.c: Likewise. - * util/grub-mklayout.c: Likewise. - * util/grub-setup.c: Likewise. + * VasEBoot-core/net/http.c: Add TRANSLATORS comments. + * VasEBoot-core/normal/cmdline.c: Likewise. + * VasEBoot-core/normal/misc.c: Likewise. + * VasEBoot-core/partmap/msdos.c: Likewise. + * VasEBoot-core/parttool/msdospart.c: Likewise. + * VasEBoot-core/script/execute.c: Likewise. + * VasEBoot-core/script/main.c: Likewise. + * VasEBoot-core/term/terminfo.c: Likewise. + * VasEBoot-core/video/bitmap.c: Likewise. + * util/VasEBoot-install.in: Likewise. + * util/VasEBoot-mkimage.c: Likewise. + * util/VasEBoot-mklayout.c: Likewise. + * util/VasEBoot-setup.c: Likewise. 2012-03-05 Vladimir Serbinenko - * util/grub-mount.c (fuse_init): Unify cryptomount and loopback messages - with similar messages in grub-fstest. + * util/VasEBoot-mount.c (fuse_init): Unify cryptomount and loopback messages + with similar messages in VasEBoot-fstest. 2012-03-05 Vladimir Serbinenko - * util/grub-install.in: Unify "option requires an argument" message + * util/VasEBoot-install.in: Unify "option requires an argument" message with similar messages in other files. - * util/grub-mkconfig.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. 2012-03-05 Vladimir Serbinenko - * util/grub-set-default.in: Replace printf with gettext_printf (the - string in in question is already translated from grub-reboot) + * util/VasEBoot-set-default.in: Replace printf with gettext_printf (the + string in in question is already translated from VasEBoot-reboot) 2012-03-05 Vladimir Serbinenko @@ -11780,138 +11780,138 @@ 2012-03-04 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (allocate_pages): Fix handling of the + * VasEBoot-core/loader/i386/linux.c (allocate_pages): Fix handling of the case when min_align = 0. 2012-03-04 Vladimir Serbinenko - * grub-core/normal/charset.c (bidi_line_wrap): Fix a spurious warning + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Fix a spurious warning and fix a case when line_start overflows. 2012-03-04 Vladimir Serbinenko - * util/grub-reboot.in (usage): Mention id posibility. - * util/grub-set-default.in (usage): Likewise. + * util/VasEBoot-reboot.in (usage): Mention id posibility. + * util/VasEBoot-set-default.in (usage): Likewise. 2012-03-04 Vladimir Serbinenko - * include/grub/misc.h (ALIGN_UP_OVERHEAD): New define. - * grub-core/loader/i386/linux.c (grub_cmd_initrd): Align initrds at 4. - * grub-core/loader/i386/pc/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/ia64/efi/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/mips/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_initrd): Likewise. + * include/VasEBoot/misc.h (ALIGN_UP_OVERHEAD): New define. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_initrd): Align initrds at 4. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/mips/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c (VasEBoot_cmd_initrd): Likewise. 2012-03-04 Vladimir Serbinenko - * grub-core/commands/menuentry.c (options): Remove - GRUB_ARG_OPTION_REPEATABLE. + * VasEBoot-core/commands/menuentry.c (options): Remove + VasEBoot_ARG_OPTION_REPEATABLE. Reported by: Andreas Vogel 2012-03-04 Andreas Vogel - * grub-core/normal/main.c (grub_normal_free_menu): Fix memory leak. + * VasEBoot-core/normal/main.c (VasEBoot_normal_free_menu): Fix memory leak. 2012-03-04 Hideki EIRAKU - * grub-core/normal/menu_entry.c (kill_line): Fix a crash and off-by-one + * VasEBoot-core/normal/menu_entry.c (kill_line): Fix a crash and off-by-one error. 2012-03-04 Vladimir Serbinenko Use sort -V by the idea of Georgi Georgiev. - * util/grub-mkconfig_lib.in (version_sort): New function. + * util/VasEBoot-mkconfig_lib.in (version_sort): New function. (version_test_numeric): Use version_sort. 2012-03-04 Vladimir Serbinenko - Use submenus in grub-mkconfig. + Use submenus in VasEBoot-mkconfig. - * util/grub-mkconfig.in: Define GRUB_ACTUAL_DEFAULT. - * util/grub-mkconfig_lib.in (grub_quote): New function. + * util/VasEBoot-mkconfig.in: Define VasEBoot_ACTUAL_DEFAULT. + * util/VasEBoot-mkconfig_lib.in (VasEBoot_quote): New function. (gettext_printf): Use gettext and not gettext_quoted to fix several messages. - * util/grub.d/10_hurd.in: Use submenus. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. - * util/grub.d/10_illumos.in: Add missing quoting. - * util/grub.d/10_windows.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Use submenus. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. + * util/VasEBoot.d/10_illumos.in: Add missing quoting. + * util/VasEBoot.d/10_windows.in: Likewise. 2012-03-04 Vladimir Serbinenko Fix menu title instability bug. - * grub-core/commands/menuentry.c (options): New option --id. - (grub_normal_add_menu_entry): New argument id. All users updated. - (grub_cmd_menuentry): Handle --id. - (grub_menu_init): Accept unknown arguments. - * grub-core/normal/main.c (features): Add feature_menuentry_id and + * VasEBoot-core/commands/menuentry.c (options): New option --id. + (VasEBoot_normal_add_menu_entry): New argument id. All users updated. + (VasEBoot_cmd_menuentry): Handle --id. + (VasEBoot_menu_init): Accept unknown arguments. + * VasEBoot-core/normal/main.c (features): Add feature_menuentry_id and feature_menuentry_options. - * grub-core/normal/menu.c (grub_menu_execute_entry): Use id for + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): Use id for saved_entry. (get_entry_number): Match with id as well. - * include/grub/menu.h (grub_menu_entry): New member id. - * util/grub-mkconfig_lib.in (grub_get_device_id): New function. - * util/grub.d/00_header.in: Define menuentry_id_option. - * util/grub.d/10_hurd.in: Define id. - * util/grub.d/10_illumos.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. + * include/VasEBoot/menu.h (VasEBoot_menu_entry): New member id. + * util/VasEBoot-mkconfig_lib.in (VasEBoot_get_device_id): New function. + * util/VasEBoot.d/00_header.in: Define menuentry_id_option. + * util/VasEBoot.d/10_hurd.in: Define id. + * util/VasEBoot.d/10_illumos.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. 2012-03-04 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_return): Replace ambiguous + * VasEBoot-core/script/execute.c (VasEBoot_script_return): Replace ambiguous "scope" with "body". 2012-03-03 Vladimir Serbinenko - * include/grub/i386/linux.h (linux_kernel_header): Fix init_size type. - * grub-core/loader/i386/linux.c (grub_cmd_linux): Differentiate between + * include/VasEBoot/i386/linux.h (linux_kernel_header): Fix init_size type. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Differentiate between prot_size and prot_file_size. 2012-03-03 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (is_lv_readable): New argument "easily". + * VasEBoot-core/disk/diskfilter.c (is_lv_readable): New argument "easily". All users updated. If easily=1 require raid-5/-6 to be full. (is_node_readable): Likewise. (scan_devices): Scan incomplete but readable LVs at the end. - (grub_diskfilter_memberlist): Pull missing devices. + (VasEBoot_diskfilter_memberlist): Pull missing devices. (insert_array): Skip scanning until device is complete or scan is done otherwise. - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Fix wrong + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Fix wrong check. - * include/grub/diskfilter.h (grub_diskfilter_lv): New member scanned. - * util/raid.c (grub_util_raid_getmembers): Handle "removed" disks. + * include/VasEBoot/diskfilter.h (VasEBoot_diskfilter_lv): New member scanned. + * util/raid.c (VasEBoot_util_raid_getmembers): Handle "removed" disks. 2012-03-03 Matthew Garrett 2012-03-03 Vladimir Serbinenko Avoid EFI boot services when loading Linux. - * grub-core/lib/i386/relocator.c (grub_relocator32_boot): New argument + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator32_boot): New argument avoid_efi_bootservices. All users updated. - * grub-core/lib/relocator.c (grub_relocator_alloc_chunk_align): New + * VasEBoot-core/lib/relocator.c (VasEBoot_relocator_alloc_chunk_align): New argument avoid_efi_bootservices. All users updated. - Use grub_efi_mmap_iterate on EFI, grub_mmap_iterate if available. - * grub-core/loader/i386/linux.c (allocate_pages): New arguments + Use VasEBoot_efi_mmap_iterate on EFI, VasEBoot_mmap_iterate if available. + * VasEBoot-core/loader/i386/linux.c (allocate_pages): New arguments align, min_align, relocatable, prefered_address. All users updated. Allocate avoiding boot services if kernel is relocatable. - (grub_cmd_linux): Check if kernel is relocatable. - * grub-core/mmap/efi/mmap.c (grub_machine_mmap_iterate): Move most to .. - (grub_efi_mmap_iterate): ... here. New argument avoid_efi_boot_services. - Skip GRUB_EFI_BOOT_SERVICES_DATA and GRUB_EFI_BOOT_SERVICES_CODE if + (VasEBoot_cmd_linux): Check if kernel is relocatable. + * VasEBoot-core/mmap/efi/mmap.c (VasEBoot_machine_mmap_iterate): Move most to .. + (VasEBoot_efi_mmap_iterate): ... here. New argument avoid_efi_boot_services. + Skip VasEBoot_EFI_BOOT_SERVICES_DATA and VasEBoot_EFI_BOOT_SERVICES_CODE if avoid_efi_boot_services. - (grub_machine_mmap_iterate): Wrap grub_efi_mmap_iterate. - * include/grub/i386/linux.h (linux_kernel_header): Update to 2.10. + (VasEBoot_machine_mmap_iterate): Wrap VasEBoot_efi_mmap_iterate. + * include/VasEBoot/i386/linux.h (linux_kernel_header): Update to 2.10. (linux_kernel_params): Likewise. 2012-03-03 Matthew Garrett @@ -11919,20 +11919,20 @@ Use EDID on EFI. - * grub-core/kern/efi/efi.c (grub_efi_get_variable): New argument + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_get_variable): New argument datasize_out. - * grub-core/video/efi_gop.c (check_protocol): Check that GOP has usable + * VasEBoot-core/video/efi_gop.c (check_protocol): Check that GOP has usable modes. Set gop_handle. - (grub_video_gop_get_edid): New function. - (grub_gop_get_preferred_mode): Likewise. - (grub_video_gop_setup): Use grub_gop_get_preferred_mode. - (grub_video_efi_gop_adapter): Set .get_edid. - * include/grub/efi/edid.h: New file. - * include/grub/efi/efi.h (grub_efi_get_variable): Update proto. + (VasEBoot_video_gop_get_edid): New function. + (VasEBoot_gop_get_preferred_mode): Likewise. + (VasEBoot_video_gop_setup): Use VasEBoot_gop_get_preferred_mode. + (VasEBoot_video_efi_gop_adapter): Set .get_edid. + * include/VasEBoot/efi/edid.h: New file. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_get_variable): Update proto. 2012-03-03 Vladimir Serbinenko - * util/grub-install.in: Load efivars unconditionally. + * util/VasEBoot-install.in: Load efivars unconditionally. 2012-03-03 Vladimir Serbinenko @@ -11950,111 +11950,111 @@ 2012-03-03 Vladimir Serbinenko - * grub-core/commands/date.c (GRUB_MOD_INIT): Remove non-uniform + * VasEBoot-core/commands/date.c (VasEBoot_MOD_INIT): Remove non-uniform "Command for ...". - * grub-core/commands/hdparm.c (options): Use "Display" rather than + * VasEBoot-core/commands/hdparm.c (options): Use "Display" rather than "Check" since we don't check anything. - * grub-core/commands/i386/cpuid.c (options): Clarify that long mode + * VasEBoot-core/commands/i386/cpuid.c (options): Clarify that long mode is 64-bit one. - * grub-core/commands/search_wrap.c (options): Clarify the conditions. - * grub-core/disk/geli.c (grub_md_sha256_real): Fix typo. - (grub_md_sha512_real): Likewise. + * VasEBoot-core/commands/search_wrap.c (options): Clarify the conditions. + * VasEBoot-core/disk/geli.c (VasEBoot_md_sha256_real): Fix typo. + (VasEBoot_md_sha512_real): Likewise. 2012-03-03 Vladimir Serbinenko - * grub-core/commands/gptsync.c: Fix typographic quoting. - * grub-core/commands/ieee1275/suspend.c: Likewise. - * grub-core/commands/parttool.c: Likewise. - * grub-core/commands/search_wrap.c: Likewise. - * grub-core/commands/videoinfo.c: Likewise. - * grub-core/gfxmenu/gui_label.c: Likewise. - * grub-core/hello/hello.c: Likewise. - * grub-core/kern/emu/main.c: Likewise. - * grub-core/net/net.c: Likewise. - * grub-core/normal/menu.c: Likewise. - * grub-core/normal/menu_text.c: Likewise. - * grub-core/normal/misc.c: Likewise. - * util/grub-editenv.c: Likewise. - * util/grub-install.in: Likewise. - * util/grub-kbdcomp.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/grub-setup.c: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * VasEBoot-core/commands/gptsync.c: Fix typographic quoting. + * VasEBoot-core/commands/ieee1275/suspend.c: Likewise. + * VasEBoot-core/commands/parttool.c: Likewise. + * VasEBoot-core/commands/search_wrap.c: Likewise. + * VasEBoot-core/commands/videoinfo.c: Likewise. + * VasEBoot-core/gfxmenu/gui_label.c: Likewise. + * VasEBoot-core/hello/hello.c: Likewise. + * VasEBoot-core/kern/emu/main.c: Likewise. + * VasEBoot-core/net/net.c: Likewise. + * VasEBoot-core/normal/menu.c: Likewise. + * VasEBoot-core/normal/menu_text.c: Likewise. + * VasEBoot-core/normal/misc.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. + * util/VasEBoot-install.in: Likewise. + * util/VasEBoot-kbdcomp.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/VasEBoot-setup.c: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2012-03-02 Vladimir Serbinenko - * grub-core/commands/acpihalt.c: Add TRANSLATORS comments. - * grub-core/commands/keystatus.c: Likewise. - * grub-core/commands/loadenv.c: Likewise. - * grub-core/commands/probe.c: Likewise. - * grub-core/commands/regexp.c: Likewise. - * grub-core/commands/true.c: Likewise. - * grub-core/commands/videoinfo.c: Likewise. - * grub-core/disk/cryptodisk.c: Likewise. - * grub-core/disk/ldm.c: Likewise. - * grub-core/disk/loopback.c: Likewise. - * grub-core/disk/luks.c: Likewise. - * grub-core/fs/zfs/zfsinfo.c: Likewise. - * grub-core/kern/disk.c: Likewise. - * grub-core/kern/emu/hostdisk.c: Likewise. + * VasEBoot-core/commands/acpihalt.c: Add TRANSLATORS comments. + * VasEBoot-core/commands/keystatus.c: Likewise. + * VasEBoot-core/commands/loadenv.c: Likewise. + * VasEBoot-core/commands/probe.c: Likewise. + * VasEBoot-core/commands/regexp.c: Likewise. + * VasEBoot-core/commands/true.c: Likewise. + * VasEBoot-core/commands/videoinfo.c: Likewise. + * VasEBoot-core/disk/cryptodisk.c: Likewise. + * VasEBoot-core/disk/ldm.c: Likewise. + * VasEBoot-core/disk/loopback.c: Likewise. + * VasEBoot-core/disk/luks.c: Likewise. + * VasEBoot-core/fs/zfs/zfsinfo.c: Likewise. + * VasEBoot-core/kern/disk.c: Likewise. + * VasEBoot-core/kern/emu/hostdisk.c: Likewise. 2012-03-02 Vladimir Serbinenko - * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Add TRANSLATORS comment. - * util/grub-install.in: Add missing quote in the comment. + * VasEBoot-core/fs/zfs/zfsinfo.c (print_vdev_info): Add TRANSLATORS comment. + * util/VasEBoot-install.in: Add missing quote in the comment. 2012-03-02 Vladimir Serbinenko - * grub-core/commands/i386/pc/drivemap.c: Add TRANSLATORS comments. - * grub-core/commands/lsmmap.c: Likewise. - * grub-core/commands/minicmd.c: Likewise. - * grub-core/commands/mips/loongson/lsspd.c: Likewise. - * grub-core/commands/regexp.c: Likewise. - * grub-core/gdb/gdb.c: Likewise. - * grub-core/term/gfxterm.c: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mkfont.c: Likewise. - * util/grub-mklayout.c: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. + * VasEBoot-core/commands/i386/pc/drivemap.c: Add TRANSLATORS comments. + * VasEBoot-core/commands/lsmmap.c: Likewise. + * VasEBoot-core/commands/minicmd.c: Likewise. + * VasEBoot-core/commands/mips/loongson/lsspd.c: Likewise. + * VasEBoot-core/commands/regexp.c: Likewise. + * VasEBoot-core/gdb/gdb.c: Likewise. + * VasEBoot-core/term/gfxterm.c: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mkfont.c: Likewise. + * util/VasEBoot-mklayout.c: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. 2012-03-02 Vladimir Serbinenko - * grub-core/commands/videoinfo.c (hook): Replace "Direct" + * VasEBoot-core/commands/videoinfo.c (hook): Replace "Direct" with "Direct color" and "Packed" with "Packed pixel". - (grub_cmd_videoinfo): Simplify legend. + (VasEBoot_cmd_videoinfo): Simplify legend. 2012-03-02 Vladimir Serbinenko - * util/getroot.c (grub_make_system_path_relative_to_its_root): Fix + * util/getroot.c (VasEBoot_make_system_path_relative_to_its_root): Fix absolutely unclear error message. 2012-03-02 Vladimir Serbinenko - * util/grub-mkstandalone.in: Remove confusing leftover print. + * util/VasEBoot-mkstandalone.in: Remove confusing leftover print. 2012-03-02 Vladimir Serbinenko - * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Add TRANSLATORS + * VasEBoot-core/fs/zfs/zfsinfo.c (print_vdev_info): Add TRANSLATORS comments. - * grub-core/gdb/gdb.c (grub_cmd_gdbstub): Likewise. - (GRUB_MOD_INIT): Likewise. - * grub-core/loader/i386/linux.c (grub_cmd_linux): Clarify that it's + * VasEBoot-core/gdb/gdb.c (VasEBoot_cmd_gdbstub): Likewise. + (VasEBoot_MOD_INIT): Likewise. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Clarify that it's VGA mode. - * grub-core/net/net.c (grub_net_route_address): Add TRANSLATORS + * VasEBoot-core/net/net.c (VasEBoot_net_route_address): Add TRANSLATORS comments. - * util/grub-install.in (usage): Likewise. + * util/VasEBoot-install.in (usage): Likewise. Spell ID in whole letters. Add missing ending dot. Quote variables. - * util/grub-reboot.in: Fix capitalisation. - * util/grub-set-default.in: Likewise. + * util/VasEBoot-reboot.in: Fix capitalisation. + * util/VasEBoot-set-default.in: Likewise. 2012-03-02 Vladimir Serbinenko @@ -12063,28 +12063,28 @@ (find_root_devices_from_poolname) [CYGWIN || MINGW32]: Likewise. (find_root_devices_from_libzfs) [CYGWIN || MINGW32]: Likewise. Disable -Werror for -Wdeprecated-declarations. - (grub_guess_root_devices) [CYGWIN || MINGW32]: #ifdef-out. + (VasEBoot_guess_root_devices) [CYGWIN || MINGW32]: #ifdef-out. (get_dm_uuid) [!HAVE_DEVICE_MAPPER]: Likewise. - (grub_util_get_dm_abstraction) [! __linux__]: #ifdef-out. - (grub_util_get_grub_dev): Make luks handling dependent on + (VasEBoot_util_get_dm_abstraction) [! __linux__]: #ifdef-out. + (VasEBoot_util_get_VasEBoot_dev): Make luks handling dependent on HAVE_DEVICE_MAPPER and not __linux__. (get_win32_path): Fix format security. - (grub_find_zpool_from_dir) [CYGWIN || MINGW32]: #ifdef-out. - (grub_make_system_path_relative_to_its_root) [CYGWIN || MINGW32]: - Don't try grub_find_zpool_from_dir. - (grub_make_system_path_relative_to_its_root) [!__linux__]: + (VasEBoot_find_zpool_from_dir) [CYGWIN || MINGW32]: #ifdef-out. + (VasEBoot_make_system_path_relative_to_its_root) [CYGWIN || MINGW32]: + Don't try VasEBoot_find_zpool_from_dir. + (VasEBoot_make_system_path_relative_to_its_root) [!__linux__]: #ifdef-out paresdir. 2012-03-02 Vladimir Serbinenko - * util/grub-pe2elf.c (usage): Add missing noreturn. + * util/VasEBoot-pe2elf.c (usage): Add missing noreturn. (write_section_data): Rename name to shname to avoid shadowing. (write_symbol_table): Rename name to symname to avoid shadowing. Fix write_reloc_section call. 2012-03-02 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S: Move decompressor_end to .bss + * VasEBoot-core/boot/i386/pc/startup_raw.S: Move decompressor_end to .bss to ensure that it's after the last byte of .text. 2012-03-02 Vladimir Serbinenko @@ -12095,12 +12095,12 @@ 2012-03-02 Vladimir Serbinenko - * util/resolve.c (read_dep_list): Use grub_isspace instead of isspace. - * grub-core/kern/emu/hostdisk.c (read_device_map): Likewise. + * util/resolve.c (read_dep_list): Use VasEBoot_isspace instead of isspace. + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Likewise. 2012-03-02 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S: Define __start. + * VasEBoot-core/kern/i386/pc/startup.S: Define __start. 2012-03-02 Vladimir Serbinenko @@ -12113,19 +12113,19 @@ 2012-02-29 Vladimir Serbinenko - * util/grub-install.in: Add missing gettext init. - * util/grub-kbdcomp.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-install.in: Add missing gettext init. + * util/VasEBoot-kbdcomp.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2012-02-29 Vladimir Serbinenko @@ -12133,12 +12133,12 @@ 2012-02-29 Andreas Vogel - * grub-core/kern/misc.c (grub_xvasprintf): Fix an exit path which + * VasEBoot-core/kern/misc.c (VasEBoot_xvasprintf): Fix an exit path which resulted in leak of arguments. 2012-02-29 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S: Use separate + * VasEBoot-core/boot/i386/pc/startup_raw.S: Use separate reed_solomon_size const definition instead of computing it since Apple assembler doesn't support the later. @@ -12148,11 +12148,11 @@ 2012-02-29 Vladimir Serbinenko - * include/grub/kernel.h (FOR_MODULES): Check module magic. + * include/VasEBoot/kernel.h (FOR_MODULES): Check module magic. 2012-02-29 Vladimir Serbinenko - * util/grub-mkimagexx.c (locate_sections): Support non-standard + * util/VasEBoot-mkimagexx.c (locate_sections): Support non-standard ELF section gap. (load_image): Likewise. @@ -12169,31 +12169,31 @@ 2012-02-29 Vladimir Serbinenko - * grub-core/Makefile.core.def (lzma_decompress): Use + * VasEBoot-core/Makefile.core.def (lzma_decompress): Use TARGET_IMG_BASE_LDOPT rather than hardcoding -Wl,-Ttext. 2012-02-29 Vladimir Serbinenko - * grub-core/genmod.sh.in: Rewrite the Apple part. + * VasEBoot-core/genmod.sh.in: Rewrite the Apple part. 2012-02-29 Vladimir Serbinenko - * grub-core/loader/machoXX.c (grub_macho_load): Fix signed vs unsigned + * VasEBoot-core/loader/machoXX.c (VasEBoot_macho_load): Fix signed vs unsigned comparison. 2012-02-29 Vladimir Serbinenko - * acinclude.m4 (grub_CHECK_PIC): New test. + * acinclude.m4 (VasEBoot_CHECK_PIC): New test. * configure.ac: Add -fno-PIC to TARGET_CFLAGS if -fPIC is default. 2012-02-29 Vladimir Serbinenko - * include/grub/libgcc.h (__STDC_VERSION__): Define if it's not yet so + * include/VasEBoot/libgcc.h (__STDC_VERSION__): Define if it's not yet so to avoid the warning. 2012-02-29 Vladimir Serbinenko - * grub-core/boot/i386/pc/diskboot.S (firstlist): Rename to ... + * VasEBoot-core/boot/i386/pc/diskboot.S (firstlist): Rename to ... (LOCAL(firstlist)): ... this. Move it before the firstlist and not after. All users updated. @@ -12201,15 +12201,15 @@ Use the common size routine in hostfs so we can read disks as well. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Rename to .. - (grub_util_get_fd_size): ... this. Return size in bytes. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors): Rename to .. + (VasEBoot_util_get_fd_size): ... this. Return size in bytes. All users updated. - * grub-core/kern/emu/hostfs.c (grub_hostfs_open): Use - grub_util_get_fd_size. + * VasEBoot-core/kern/emu/hostfs.c (VasEBoot_hostfs_open): Use + VasEBoot_util_get_fd_size. 2012-02-29 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__APPLE__]: + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors) [__APPLE__]: Add blocksize retrieval. 2012-02-29 Vladimir Serbinenko @@ -12223,70 +12223,70 @@ 2012-02-29 Vladimir Serbinenko - * grub-core/Makefile.am (MACHO2IMG): Add missing variable. + * VasEBoot-core/Makefile.am (MACHO2IMG): Add missing variable. 2012-02-29 Vladimir Serbinenko - * grub-core/commands/i386/pc/halt.c (grub_halt): Add noreturn attribute. - (grub_cmd_halt): Likewise. + * VasEBoot-core/commands/i386/pc/halt.c (VasEBoot_halt): Add noreturn attribute. + (VasEBoot_cmd_halt): Likewise. 2012-02-29 Vladimir Serbinenko - * grub-core/lib/i386/relocator16.S: Declare LOCAL(relocator16_end) + * VasEBoot-core/lib/i386/relocator16.S: Declare LOCAL(relocator16_end) for local arithmetics. Break %sp init into 2 instructions. Add 0 byte at the end. 2012-02-29 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (read_segment): Initialise err + * VasEBoot-core/disk/diskfilter.c (read_segment): Initialise err before loops. 2012-02-29 Vladimir Serbinenko - * grub-core/lib/xzembed/xz_dec_stream.c (hash_validate): Use void * + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (hash_validate): Use void * for context. 2012-02-29 Vladimir Serbinenko - * grub-core/disk/ldm.c (make_vg): Init part.name. - (grub_ldm_detect): Silence spurious warning. - (grub_util_is_ldm): Likewise. + * VasEBoot-core/disk/ldm.c (make_vg): Init part.name. + (VasEBoot_ldm_detect): Silence spurious warning. + (VasEBoot_util_is_ldm): Likewise. 2012-02-29 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (grub_xnu_boot): Init fsbfreq to + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_xnu_boot): Init fsbfreq to sane value to avoid a spurious warning. 2012-02-29 Vladimir Serbinenko - * include/grub/dl.h: Switch from APPLE_CC to __APPLE__. - (GRUB_MOD_LICENSE) [ASM_FILE]: Make into macro. All users updated. + * include/VasEBoot/dl.h: Switch from APPLE_CC to __APPLE__. + (VasEBoot_MOD_LICENSE) [ASM_FILE]: Make into macro. All users updated. 2012-02-29 Vladimir Serbinenko - * include/grub/symbol.h (EXT_C) [!ASM_FILE]: Redefine with strings. - * grub-core/lib/i386/backtrace.c (grub_backtrace): Use EXT_C. + * include/VasEBoot/symbol.h (EXT_C) [!ASM_FILE]: Redefine with strings. + * VasEBoot-core/lib/i386/backtrace.c (VasEBoot_backtrace): Use EXT_C. 2012-02-29 Vladimir Serbinenko - * grub-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of + * VasEBoot-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of hardcoding the relevant info. 2012-02-29 Vladimir Serbinenko - * grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Add + * VasEBoot-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Add missing const qualifiers. - * grub-core/gnulib/argp-fmtstream.h (__argp_get_display_len): Likewise. + * VasEBoot-core/gnulib/argp-fmtstream.h (__argp_get_display_len): Likewise. 2012-02-29 Vladimir Serbinenko * util/getroot.c [__APPLE__]: Add missing includes. - (grub_util_biosdisk_is_floppy): Fix usage of undefined variable. + (VasEBoot_util_biosdisk_is_floppy): Fix usage of undefined variable. 2012-02-29 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Silence spurious warning. + * util/VasEBoot-mkimage.c (generate_image): Silence spurious warning. 2012-02-29 Vladimir Serbinenko @@ -12295,50 +12295,50 @@ 2012-02-29 Vladimir Serbinenko - * util/ieee1275/grub-ofpathname.c: Add missing config.h include. + * util/ieee1275/VasEBoot-ofpathname.c: Add missing config.h include. 2012-02-29 Vladimir Serbinenko - * util/grub-setup.c (setup) [!__linux__]: Add missing file declaration - and grub_file_close call. + * util/VasEBoot-setup.c (setup) [!__linux__]: Add missing file declaration + and VasEBoot_file_close call. 2012-02-29 Vladimir Serbinenko Add LZSS Mach-O support (needed for new xnu kernelcache). - * grub-core/Makefile.core.def (xnu): Add file lzss.c - * grub-core/loader/lzss.c: New file. - * grub-core/loader/xnu.c (grub_xnu_load_driver): Close binaryfile + * VasEBoot-core/Makefile.core.def (xnu): Add file lzss.c + * VasEBoot-core/loader/lzss.c: New file. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_load_driver): Close binaryfile on Mach-O open failure. - * grub-core/loader/macho.c (grub_macho_close): Free uncompressedXX. + * VasEBoot-core/loader/macho.c (VasEBoot_macho_close): Free uncompressedXX. Don't free cmdsXX in uncompressedXX is set. - (grub_macho_file): Init new fields. + (VasEBoot_macho_file): Init new fields. New argument is_64bit. All users updated. Handle compressed. Error out if no suitable architecture is found. Don't close file. - (grub_macho_open): New argument is_64bit. All users updated. - * grub-core/loader/macho32.c: Add defines for new fields. - * grub-core/loader/macho64.c: Likewise. - * grub-core/loader/machoXX.c (grub_macho_contains_macho): Make static. - (grub_macho_parse): Handle compressed. + (VasEBoot_macho_open): New argument is_64bit. All users updated. + * VasEBoot-core/loader/macho32.c: Add defines for new fields. + * VasEBoot-core/loader/macho64.c: Likewise. + * VasEBoot-core/loader/machoXX.c (VasEBoot_macho_contains_macho): Make static. + (VasEBoot_macho_parse): Handle compressed. Defer actual processing if compressed. - (grub_macho_cmds_iterate): Decompress if compressed. New argument + (VasEBoot_macho_cmds_iterate): Decompress if compressed. New argument "filename". All users updated. - (grub_macho_size): New argument "filename". All users updated. - (grub_macho_get_entry_point): Likewise. - (grub_macho_load): Handle compressed. - * include/grub/macho.h (grub_macho_lzss_header): New struct. - (GRUB_MACHO_LZSS_OFFSET): New define. - (grub_decompress_lzss): New proto. - * include/grub/machoload.h (grub_macho_file): New fields to handle + (VasEBoot_macho_size): New argument "filename". All users updated. + (VasEBoot_macho_get_entry_point): Likewise. + (VasEBoot_macho_load): Handle compressed. + * include/VasEBoot/macho.h (VasEBoot_macho_lzss_header): New struct. + (VasEBoot_MACHO_LZSS_OFFSET): New define. + (VasEBoot_decompress_lzss): New proto. + * include/VasEBoot/machoload.h (VasEBoot_macho_file): New fields to handle compressed. - (grub_macho_contains_macho64): Remove proto. - (grub_macho_contains_macho32): Likewise. - * util/grub.d/30_os-prober.in: Use kernel cache if available. + (VasEBoot_macho_contains_macho64): Remove proto. + (VasEBoot_macho_contains_macho32): Likewise. + * util/VasEBoot.d/30_os-prober.in: Use kernel cache if available. 2012-02-29 Vladimir Serbinenko - * grub-core/disk/pata.c (grub_pata_readwrite): Fix ATAPI protocol error. + * VasEBoot-core/disk/pata.c (VasEBoot_pata_readwrite): Fix ATAPI protocol error. 2012-02-28 Vladimir Serbinenko @@ -12351,31 +12351,31 @@ * conf/Makefile.extra-dist (EXTRA_DIST): Add several missing files. * docs/Makefile.am (EXTRA_DIST): Add font_char_metrics.png and font_char_metrics.txt. - * grub-core/Makefile.core.def (kernel): Update extra_dist. + * VasEBoot-core/Makefile.core.def (kernel): Update extra_dist. (setjmp): Add lib/ia64/longjmp.S. - * po/Makefile.in.in (DISTFILES): Add POTFILES-shell.in and grub.d.sed. + * po/Makefile.in.in (DISTFILES): Add POTFILES-shell.in and VasEBoot.d.sed. * po/POTFILES.in: Regenerate. * po/Rules-swiss: use DISTFILES.common.extra2 and not DISTFILES.common.extra1. * util/devicemap.c: Removed. - * grub-core/lib/i386/relocator_backward.S: Likewise. + * VasEBoot-core/lib/i386/relocator_backward.S: Likewise. * util/import_gcry.py: Remove unused files. Add extra_dist for ChangeLog. 2012-02-28 Vladimir Serbinenko - * grub-core/gettext/gettext.c (grub_mofile_open): Call - grub_gettext_delete_list before changing grub_gettext_max to avoid + * VasEBoot-core/gettext/gettext.c (VasEBoot_mofile_open): Call + VasEBoot_gettext_delete_list before changing VasEBoot_gettext_max to avoid running out of array bounds. 2012-02-28 Vladimir Serbinenko - * grub-core/term/i386/pc/vga_text.c: Add GRUB_MACHINE_MULTIBOOT to - grub_vga_text_init/grub_vga_text_fini. + * VasEBoot-core/term/i386/pc/vga_text.c: Add VasEBoot_MACHINE_MULTIBOOT to + VasEBoot_vga_text_init/VasEBoot_vga_text_fini. 2012-02-28 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (grub_xnu_boot): Fix format specification. + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_xnu_boot): Fix format specification. 2012-02-27 Vladimir Serbinenko @@ -12383,97 +12383,97 @@ 2012-02-27 Vladimir Serbinenko - * util/getroot.c (grub_find_root_devices_from_btrfs): Add + * util/getroot.c (VasEBoot_find_root_devices_from_btrfs): Add missing initialisation. 2012-02-27 Vladimir Serbinenko - * grub-core/partmap/msdos.c (message_warn): Clarify messages. + * VasEBoot-core/partmap/msdos.c (message_warn): Clarify messages. 2012-02-27 Vladimir Serbinenko Support v2 xnu boot arguments. - * grub-core/loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_cpu_xnu_fill_devicetree): New argument fsbfreq_out. - (grub_xnu_set_video): Receive an argument grub_xnu_boot_params_common. - (grub_xnu_boot): Support v2 arguments. Disable PIC so that APIC can + (VasEBoot_xnu_set_video): Receive an argument VasEBoot_xnu_boot_params_common. + (VasEBoot_xnu_boot): Support v2 arguments. Disable PIC so that APIC can be used. - * grub-core/loader/machoXX.c (grub_macho_load): New argument + * VasEBoot-core/loader/machoXX.c (VasEBoot_macho_load): New argument darwin_version. - * grub-core/loader/xnu.c (grub_xnu_darwin_version): New variable. - * include/grub/i386/xnu.h (grub_xnu_boot_params_common): New struct. - (grub_xnu_boot_params): Rename to ... - (grub_xnu_boot_params_v1): ...this. Use grub_xnu_boot_params_common. - (grub_xnu_boot_params_v2): New struct. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_darwin_version): New variable. + * include/VasEBoot/i386/xnu.h (VasEBoot_xnu_boot_params_common): New struct. + (VasEBoot_xnu_boot_params): Rename to ... + (VasEBoot_xnu_boot_params_v1): ...this. Use VasEBoot_xnu_boot_params_common. + (VasEBoot_xnu_boot_params_v2): New struct. 2012-02-27 Vladimir Serbinenko - * grub-core/efiemu/prepare.c (grub_efiemu_crc): Add missing + * VasEBoot-core/efiemu/prepare.c (VasEBoot_efiemu_crc): Add missing zeroing of CRC field before computing CRC. 2012-02-27 Vladimir Serbinenko - * grub-core/lib/relocator.c (malloc_in_range): Fix memory leak. + * VasEBoot-core/lib/relocator.c (malloc_in_range): Fix memory leak. Change order of allocations to decrease fragmentation. 2012-02-27 Vladimir Serbinenko - * Makefile.util.def (grub-ofpathname): Enable on all platforms. + * Makefile.util.def (VasEBoot-ofpathname): Enable on all platforms. 2012-02-27 Colin Watson Use write-combining MTRR to speed up video with buggy BIOSes. - * grub-core/video/i386/pc/vbe.c (framebuffer): New member mtrr. + * VasEBoot-core/video/i386/pc/vbe.c (framebuffer): New member mtrr. (cpuid): New define. (rdmsr): Likewise. (wrmsr): Likewise. (mtrr_base): Likewise. (mtrr_mask): Likewise. - (grub_vbe_enable_mtrr_entry): New function. - (grub_vbe_enable_mtrr): Likewise. - (grub_vbe_disable_mtrr): Likewise. - (grub_vbe_bios_set_display_start): Disable mtrr when handing the + (VasEBoot_vbe_enable_mtrr_entry): New function. + (VasEBoot_vbe_enable_mtrr): Likewise. + (VasEBoot_vbe_disable_mtrr): Likewise. + (VasEBoot_vbe_bios_set_display_start): Disable mtrr when handing the control off to BIOS. - (grub_video_vbe_init): Fill mtrr. - (grub_video_vbe_fini): Disable mtrr. - (grub_video_vbe_get_info_and_fini): Likewise. - (grub_video_vbe_setup): Enable mtrr. + (VasEBoot_video_vbe_init): Fill mtrr. + (VasEBoot_video_vbe_fini): Disable mtrr. + (VasEBoot_video_vbe_get_info_and_fini): Likewise. + (VasEBoot_video_vbe_setup): Enable mtrr. 2012-02-27 Colin Watson - * include/grub/partition.h (grub_partition_map): Change prototype of + * include/VasEBoot/partition.h (VasEBoot_partition_map): Change prototype of embed to take a maximum value for nsectors. - * include/grub/emu/hostdisk.h (grub_util_ldm_embed): Likewise. - * include/grub/fs.h (grub_fs): Likewise. - * grub-core/partmap/msdos.c (embed_signatures): New array. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_ldm_embed): Likewise. + * include/VasEBoot/fs.h (VasEBoot_fs): Likewise. + * VasEBoot-core/partmap/msdos.c (embed_signatures): New array. (pc_partition_map_embed): Check for and avoid sectors matching any of the signatures in embed_signatures, up to max_nsectors. - * grub-core/partmap/gpt.c (gpt_partition_map_embed): Restrict + * VasEBoot-core/partmap/gpt.c (gpt_partition_map_embed): Restrict returned sector map to max_nsectors. - * grub-core/disk/ldm.c (grub_util_ldm_embed): Likewise. - * grub-core/fs/btrfs.c (grub_btrfs_embed): Likewise. - * grub-core/fs/zfs/zfs.c (grub_zfs_embed): Likewise. - * util/grub-setup.c (setup): Allow for the embedding area being + * VasEBoot-core/disk/ldm.c (VasEBoot_util_ldm_embed): Likewise. + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_embed): Likewise. + * VasEBoot-core/fs/zfs/zfs.c (VasEBoot_zfs_embed): Likewise. + * util/VasEBoot-setup.c (setup): Allow for the embedding area being split into multiple blocklists. Tell dest_partmap->embed the maximum number of sectors we care about. 2012-02-27 Vladimir Serbinenko - * include/grub/fs.h (grub_fs) [GRUB_UTIL]: Add blocklist_install field. + * include/VasEBoot/fs.h (VasEBoot_fs) [VasEBoot_UTIL]: Add blocklist_install field. Specify blocklist_install and reserver_first_sector for all fs. - * util/grub-setup.c (setup): Use FIBMAP/FIEMAP on Linux. Check resulting + * util/VasEBoot-setup.c (setup): Use FIBMAP/FIEMAP on Linux. Check resulting blocklists. 2012-02-27 Vladimir Serbinenko - * util/grub-install.in: Clarify strings. + * util/VasEBoot-install.in: Clarify strings. Fix source dir check. 2012-02-27 Richard Laager - * util/getroot.c (grub_find_root_devices_from_mountinfo): Handle + * util/getroot.c (VasEBoot_find_root_devices_from_mountinfo): Handle "zfs" and "fuse.zfs" as synonyms. 2012-02-27 Vladimir Serbinenko @@ -12484,8 +12484,8 @@ 2012-02-27 Richard Laager 2012-02-27 Vladimir Serbinenko - * util/grub.d/10_linux.in: Add ZFS-related arguments. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_linux.in: Add ZFS-related arguments. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2012-02-27 Richard Laager @@ -12494,7 +12494,7 @@ 2012-02-27 Richard Laager - * util/getroot.c (grub_find_root_devices_from_mountinfo): Add missing + * util/getroot.c (VasEBoot_find_root_devices_from_mountinfo): Add missing unescape. 2012-02-27 Vladimir Serbinenko @@ -12510,15 +12510,15 @@ Remove platform and target_cpu replacement. * configure.ac: Remove platform and target_cpu substitutions. - * tests/util/grub-shell.in: Use modinfo. - * util/powerpc/ieee1275/grub-mkrescue.in: Specify powerpc-ieee1275 + * tests/util/VasEBoot-shell.in: Use modinfo. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Specify powerpc-ieee1275 explicitly. 2012-02-27 Vladimir Serbinenko - Autodetect platform in grub-install but allow override. + Autodetect platform in VasEBoot-install but allow override. - * util/grub-install.in: Autodetect platform. Support --target and + * util/VasEBoot-install.in: Autodetect platform. Support --target and --directory. Read platform from modinfo.sh. 2012-02-27 Vladimir Serbinenko @@ -12529,57 +12529,57 @@ (btrfs_ioctl_fs_info_args) [__linux__]: Likewise. (BTRFS_IOC_DEV_INFO) [__linux__]: New define. (BTRFS_IOC_FS_INFO) [__linux__]: Likewise. - (grub_find_root_devices_from_btrfs) [__linux__]: New function. - (grub_find_root_devices_from_mountinfo) [__linux__]: Use - grub_find_root_devices_from_btrfs if on btrfs. + (VasEBoot_find_root_devices_from_btrfs) [__linux__]: New function. + (VasEBoot_find_root_devices_from_mountinfo) [__linux__]: Use + VasEBoot_find_root_devices_from_btrfs if on btrfs. 2012-02-27 Vladimir Serbinenko Remove any awareness of *.c util files about target. - * Makefile.util.def (grub-setup): Split to ... - (grub-bios-setup): ... and this. - (grub-sparc64-setup): ... and this. + * Makefile.util.def (VasEBoot-setup): Split to ... + (VasEBoot-bios-setup): ... and this. + (VasEBoot-sparc64-setup): ... and this. * configure.ac: Don't add machine_CPPFLAGS into HOST_CPPFLAGS. - * docs/man/grub-setup.h2m: Split into ... - * docs/man/grub-sparc64-setup.h2m: ... this. - * docs/man/grub-bios-setup.h2m: ... and this. - * include/grub/dl.h (grub_dl) [GRUB_UTIL]: Remove struct. - * include/grub/elf.h (Elf_*) [GRUB_UTIL]: Remove types. - (GRUB_TARGET_WORDSIZE) [GRUB_UTIL]: Remove. - (grub_target_addr_t): Remove. - (grub_target_size_t): Remove. - (grub_target_ssize_t): Remove. - * util/grub-install.in: Use new grub-*-setup. - * util/grub-mkimagexx.c (Elf_Word): New define. + * docs/man/VasEBoot-setup.h2m: Split into ... + * docs/man/VasEBoot-sparc64-setup.h2m: ... this. + * docs/man/VasEBoot-bios-setup.h2m: ... and this. + * include/VasEBoot/dl.h (VasEBoot_dl) [VasEBoot_UTIL]: Remove struct. + * include/VasEBoot/elf.h (Elf_*) [VasEBoot_UTIL]: Remove types. + (VasEBoot_TARGET_WORDSIZE) [VasEBoot_UTIL]: Remove. + (VasEBoot_target_addr_t): Remove. + (VasEBoot_target_size_t): Remove. + (VasEBoot_target_ssize_t): Remove. + * util/VasEBoot-install.in: Use new VasEBoot-*-setup. + * util/VasEBoot-mkimagexx.c (Elf_Word): New define. (Elf_Half): Likewise. (Elf_Section): Likewise. (ELF_ST_TYPE): Likewise. - * util/grub-setup.c: Switch from GRUB_MACHINE_SPARC64 to - GRUB_SETUP_SPARC64 and from GRUB_MACHINE_PCBIOS to GRUB_SETUP_BIOS. + * util/VasEBoot-setup.c: Switch from VasEBoot_MACHINE_SPARC64 to + VasEBoot_SETUP_SPARC64 and from VasEBoot_MACHINE_PCBIOS to VasEBoot_SETUP_BIOS. 2012-02-27 Vladimir Serbinenko - Replace grub_target_addr with more appropriate types. + Replace VasEBoot_target_addr with more appropriate types. - * grub-core/commands/efi/fixvideo.c (scan_card): Replace - grub_target_addr with grub_addr. - * grub-core/commands/iorw.c (grub_cmd_read): Replace - grub_target_addr with grub_port. - (grub_cmd_write): Likewise. - * grub-core/commands/memrw.c (grub_cmd_read): Replace - grub_target_addr with grub_addr. - (grub_cmd_write): Likewise. - * grub-core/video/efi_uga.c (find_line_len): Likewise. + * VasEBoot-core/commands/efi/fixvideo.c (scan_card): Replace + VasEBoot_target_addr with VasEBoot_addr. + * VasEBoot-core/commands/iorw.c (VasEBoot_cmd_read): Replace + VasEBoot_target_addr with VasEBoot_port. + (VasEBoot_cmd_write): Likewise. + * VasEBoot-core/commands/memrw.c (VasEBoot_cmd_read): Replace + VasEBoot_target_addr with VasEBoot_addr. + (VasEBoot_cmd_write): Likewise. + * VasEBoot-core/video/efi_uga.c (find_line_len): Likewise. 2012-02-27 Vladimir Serbinenko - * include/grub/efi/api.h (grub_efi_runtime_services): Add missing + * include/VasEBoot/efi/api.h (VasEBoot_efi_runtime_services): Add missing const qualifier for vendor_guid. 2012-02-27 Vladimir Serbinenko - * grub-core/efiemu/runtime/efiemu.c (efiemu_get_variable): Add missing + * VasEBoot-core/efiemu/runtime/efiemu.c (efiemu_get_variable): Add missing const qualifier. (efiemu_memequal): Likewise. (find_variable): Likewise. @@ -12588,39 +12588,39 @@ Fix missing console prototype on qemu-mips. - * include/grub/mips/qemu_mips/console.h: New file. + * include/VasEBoot/mips/qemu_mips/console.h: New file. 2012-02-27 Matthew Garrett 2012-02-27 Vladimir Serbinenko - * grub-core/kern/efi/efi.c (grub_efi_get_variable): Add new function. - * include/grub/efi/efi.h: Likewise. - * include/grub/efi/api.h: Add guid for EFI-specified variables. - * include/grub/charset.h (GRUB_MAX_UTF16_PER_UTF8): New definition. - * grub-core/normal/charset.c (grub_utf8_process): Move from here ... - * include/grub/charset.h (grub_utf8_process): ... to here. Inline. - * grub-core/normal/charset.c (grub_utf8_to_utf16): Move from here ... - * include/grub/charset.h (grub_utf8_to_utf16): ... to here. Inline. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_get_variable): Add new function. + * include/VasEBoot/efi/efi.h: Likewise. + * include/VasEBoot/efi/api.h: Add guid for EFI-specified variables. + * include/VasEBoot/charset.h (VasEBoot_MAX_UTF16_PER_UTF8): New definition. + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_process): Move from here ... + * include/VasEBoot/charset.h (VasEBoot_utf8_process): ... to here. Inline. + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_to_utf16): Move from here ... + * include/VasEBoot/charset.h (VasEBoot_utf8_to_utf16): ... to here. Inline. 2012-02-27 Matthew Garrett - * include/grub/efi/pci.h: New file to define EFI PCI protocols. + * include/VasEBoot/efi/pci.h: New file to define EFI PCI protocols. 2012-02-27 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_iterate): Fix off-by-one + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_iterate): Fix off-by-one error. 2012-02-27 Vladimir Serbinenko * configure.ac: Remove inappropriate use of program_transform_name - on grubdir and bootdir but allow explicit specification of those + on VasEBootdir and bootdir but allow explicit specification of those variables. 2012-02-27 Vladimir Serbinenko - * util/grub-mknetdir.in (grub_prefix): Removed. - (subdir): Use @bootdirname@ and @grubdirname@. + * util/VasEBoot-mknetdir.in (VasEBoot_prefix): Removed. + (subdir): Use @bootdirname@ and @VasEBootdirname@. 2012-02-27 Vladimir Serbinenko @@ -12635,25 +12635,25 @@ Remove improper use of program_transform_name on pkglibrootdir. * configure.ac (pkglibrootdir): Removed. - (grub-mkimage): Replace PKGLIBROOTDIR with PKGLIBDIR. - * util/grub-mkimage.c: Likewise. + (VasEBoot-mkimage): Replace PKGLIBROOTDIR with PKGLIBDIR. + * util/VasEBoot-mkimage.c: Likewise. 2012-02-27 Vladimir Serbinenko - * grub-core/normal/menu_text.c (grub_print_message_indented_real): Fix a + * VasEBoot-core/normal/menu_text.c (VasEBoot_print_message_indented_real): Fix a warning. 2012-02-27 Vladimir Serbinenko - * util/grub-install.in: Use file identifier if no UUID is available + * util/VasEBoot-install.in: Use file identifier if no UUID is available or user explicitly prompted for it. 2012-02-27 Navdeep Parhar - * grub-core/loader/i386/bsd.c (freebsd_zfsguid): New variable. + * VasEBoot-core/loader/i386/bsd.c (freebsd_zfsguid): New variable. (freebsd_get_zfs): New function. - (grub_freebsd_boot): Pass zfs UUID. - (grub_cmd_freebsd): Set zfs UUID. + (VasEBoot_freebsd_boot): Pass zfs UUID. + (VasEBoot_cmd_freebsd): Set zfs UUID. 2012-02-27 Vladimir Serbinenko @@ -12668,206 +12668,206 @@ 2012-02-26 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (insert_array): Choose the smallest + * VasEBoot-core/disk/diskfilter.c (insert_array): Choose the smallest device. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Reject too + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Reject too small devices. 2012-02-26 Vladimir Serbinenko - Remove grub_{modname}_init and grub_{modname}_fini. They should never - be used directly if it's really a module and GRUB_MOD_INIT shouldn't + Remove VasEBoot_{modname}_init and VasEBoot_{modname}_fini. They should never + be used directly if it's really a module and VasEBoot_MOD_INIT shouldn't be used on non-modules. - * grub-core/commands/boot.c (GRUB_MOD_INIT) [LOONGSON || QEMU_MIPS]: - Rename to grub_boot_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_boot_fini. - * grub-core/commands/keylayouts.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_fini. - * grub-core/font/font_cmd.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_font_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_font_fini. - * grub-core/kern/mips/loongson/init.c: Replace explicit protos with + * VasEBoot-core/commands/boot.c (VasEBoot_MOD_INIT) [LOONGSON || QEMU_MIPS]: + Rename to VasEBoot_boot_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_boot_fini. + * VasEBoot-core/commands/keylayouts.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_keylayouts_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_keylayouts_fini. + * VasEBoot-core/font/font_cmd.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_font_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_font_fini. + * VasEBoot-core/kern/mips/loongson/init.c: Replace explicit protos with includes. - (grub_machine_init): Remove empty inits. - * grub-core/kern/mips/qemu_mips/init.c: Replace explicit protos with + (VasEBoot_machine_init): Remove empty inits. + * VasEBoot-core/kern/mips/qemu_mips/init.c: Replace explicit protos with includes. - (grub_machine_init): Remove empty inits. - * grub-core/term/arc/console.c: Remove explicit proto. - * grub-core/term/at_keyboard.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_at_keyboard_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to - grub_at_keyboard_fini. - * grub-core/term/gfxterm.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_gfxterm_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to - grub_gfxterm_fini. - * grub-core/term/i386/pc/vga_text.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_vgatext_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to - grub_vgatext_fini. - * grub-core/term/ieee1275/console.c: Remove explicit proto. - * grub-core/term/serial.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_serial_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to - grub_serial_fini. - * grub-core/term/terminfo.c (GRUB_MOD_INIT) - [LOONGSON || QEMU_MIPS]: Rename to grub_terminfo_init. - (GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to - grub_terminfo_fini. - * grub-core/video/bitmap.c (GRUB_MOD_INIT): Removed. - (GRUB_MOD_FINI): Likewise. - * grub-core/video/radeon_fuloong2e.c (GRUB_MOD_INIT) - [LOONGSON]: Rename to grub_video_radeon_fuloong2e_init. - (GRUB_MOD_FINI) [LOONGSON]: Rename to - grub_video_radeon_fuloong2e_fini. - * grub-core/video/sis315pro.c (GRUB_MOD_INIT) - [LOONGSON]: Rename to grub_video_sis315pro_init. - (GRUB_MOD_FINI) [LOONGSON]: Rename to - grub_video_sis315pro_fini. - * grub-core/video/sm712.c (GRUB_MOD_INIT) - [LOONGSON]: Rename to grub_video_sm712_init. - (GRUB_MOD_FINI) [LOONGSON]: Rename to - grub_video_sm712_fini. - * include/grub/at_keyboard.h (grub_at_keyboard_init): New proto. - (grub_at_keyboard_fini): Likewise. - * include/grub/dl.h (GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]: - Don't declare grub_{modname}_init. - (GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]: Don't declare grub_{modname}_fini. - * include/grub/keyboard_layouts.h (grub_keylayouts_init) [!EMU]: + (VasEBoot_machine_init): Remove empty inits. + * VasEBoot-core/term/arc/console.c: Remove explicit proto. + * VasEBoot-core/term/at_keyboard.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_at_keyboard_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to + VasEBoot_at_keyboard_fini. + * VasEBoot-core/term/gfxterm.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_gfxterm_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to + VasEBoot_gfxterm_fini. + * VasEBoot-core/term/i386/pc/vga_text.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_vgatext_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to + VasEBoot_vgatext_fini. + * VasEBoot-core/term/ieee1275/console.c: Remove explicit proto. + * VasEBoot-core/term/serial.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_serial_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to + VasEBoot_serial_fini. + * VasEBoot-core/term/terminfo.c (VasEBoot_MOD_INIT) + [LOONGSON || QEMU_MIPS]: Rename to VasEBoot_terminfo_init. + (VasEBoot_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to + VasEBoot_terminfo_fini. + * VasEBoot-core/video/bitmap.c (VasEBoot_MOD_INIT): Removed. + (VasEBoot_MOD_FINI): Likewise. + * VasEBoot-core/video/radeon_fuloong2e.c (VasEBoot_MOD_INIT) + [LOONGSON]: Rename to VasEBoot_video_radeon_fuloong2e_init. + (VasEBoot_MOD_FINI) [LOONGSON]: Rename to + VasEBoot_video_radeon_fuloong2e_fini. + * VasEBoot-core/video/sis315pro.c (VasEBoot_MOD_INIT) + [LOONGSON]: Rename to VasEBoot_video_sis315pro_init. + (VasEBoot_MOD_FINI) [LOONGSON]: Rename to + VasEBoot_video_sis315pro_fini. + * VasEBoot-core/video/sm712.c (VasEBoot_MOD_INIT) + [LOONGSON]: Rename to VasEBoot_video_sm712_init. + (VasEBoot_MOD_FINI) [LOONGSON]: Rename to + VasEBoot_video_sm712_fini. + * include/VasEBoot/at_keyboard.h (VasEBoot_at_keyboard_init): New proto. + (VasEBoot_at_keyboard_fini): Likewise. + * include/VasEBoot/dl.h (VasEBoot_MOD_INIT) [!VasEBoot_UTIL && !EMU]: + Don't declare VasEBoot_{modname}_init. + (VasEBoot_MOD_INIT) [!VasEBoot_UTIL && !EMU]: Don't declare VasEBoot_{modname}_fini. + * include/VasEBoot/keyboard_layouts.h (VasEBoot_keylayouts_init) [!EMU]: New proto. - (grub_keylayouts_fini) [!EMU]: Likewise. - * include/grub/serial.h (grub_serial_init) [!EMU]: + (VasEBoot_keylayouts_fini) [!EMU]: Likewise. + * include/VasEBoot/serial.h (VasEBoot_serial_init) [!EMU]: New proto. - (grub_serial_fini) [!EMU]: Likewise. - * include/grub/terminfo.h (grub_terminfo_init) [!EMU]: + (VasEBoot_serial_fini) [!EMU]: Likewise. + * include/VasEBoot/terminfo.h (VasEBoot_terminfo_init) [!EMU]: New proto. - (grub_terminfo_fini) [!EMU]: Likewise. - * include/grub/video.h (grub_font_init) [!EMU]: + (VasEBoot_terminfo_fini) [!EMU]: Likewise. + * include/VasEBoot/video.h (VasEBoot_font_init) [!EMU]: New proto. - (grub_font_fini) [!EMU]: Likewise. - (grub_gfxterm_init) [!EMU]: Likewise. - (grub_gfxterm_fini) [!EMU]: Likewise. - (grub_video_sm712_init) [!EMU]: Likewise. - (grub_video_sm712_fini) [!EMU]: Likewise. - (grub_video_sis315pro_init) [!EMU]: Likewise. - (grub_video_sis315pro_fini) [!EMU]: Likewise. - (grub_video_radeon_fuloong2e_init) [!EMU]: Likewise. - (grub_video_radeon_fuloong2e_fini) [!EMU]: Likewise. + (VasEBoot_font_fini) [!EMU]: Likewise. + (VasEBoot_gfxterm_init) [!EMU]: Likewise. + (VasEBoot_gfxterm_fini) [!EMU]: Likewise. + (VasEBoot_video_sm712_init) [!EMU]: Likewise. + (VasEBoot_video_sm712_fini) [!EMU]: Likewise. + (VasEBoot_video_sis315pro_init) [!EMU]: Likewise. + (VasEBoot_video_sis315pro_fini) [!EMU]: Likewise. + (VasEBoot_video_radeon_fuloong2e_init) [!EMU]: Likewise. + (VasEBoot_video_radeon_fuloong2e_fini) [!EMU]: Likewise. 2012-02-26 Vladimir Serbinenko Make nand a prefix for nand devices. - * grub-core/disk/ieee1275/nand.c (grub_nand_open): Use prefix nand. + * VasEBoot-core/disk/ieee1275/nand.c (VasEBoot_nand_open): Use prefix nand. 2012-02-26 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_stpcpy): Move from here ... - * include/grub/misc.h (grub_stpcpy): ... to here. Inlined. + * VasEBoot-core/kern/misc.c (VasEBoot_stpcpy): Move from here ... + * include/VasEBoot/misc.h (VasEBoot_stpcpy): ... to here. Inlined. 2012-02-26 Vladimir Serbinenko - * include/grub/env.h (grub_env_find): Remove prototype. - * grub-core/kern/env.c (grub_env_find): Make static. - (grub_env_set): Remove useless set. + * include/VasEBoot/env.h (VasEBoot_env_find): Remove prototype. + * VasEBoot-core/kern/env.c (VasEBoot_env_find): Make static. + (VasEBoot_env_set): Remove useless set. 2012-02-26 Vladimir Serbinenko - * grub-core/kern/i386/realmode.S: Remove useless align. + * VasEBoot-core/kern/i386/realmode.S: Remove useless align. 2012-02-26 Vladimir Serbinenko - * include/grub/dl.h (grub_dl_load_file): Don't export. + * include/VasEBoot/dl.h (VasEBoot_dl_load_file): Don't export. 2012-02-26 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_open): Remove useless - grub_dprintf. + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_open): Remove useless + VasEBoot_dprintf. 2012-02-26 Vladimir Serbinenko - * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Remove useless - grub_errors. - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Simplify by + * VasEBoot-core/disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Remove useless + VasEBoot_errors. + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Simplify by not reloading whole superblock but only the part which is really needed. - Remove useless grub_errors. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Remove useless - grub_errors. + Remove useless VasEBoot_errors. + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Remove useless + VasEBoot_errors. 2012-02-26 Vladimir Serbinenko - Don't export grub_get_rtc. + Don't export VasEBoot_get_rtc. - * include/grub/i386/pc/time.h (grub_get_rtc): Don't export. - * grub-core/commands/i386/pc/play.c (play): Use grub_get_time_ms. + * include/VasEBoot/i386/pc/time.h (VasEBoot_get_rtc): Don't export. + * VasEBoot-core/commands/i386/pc/play.c (play): Use VasEBoot_get_time_ms. 2012-02-26 Vladimir Serbinenko - * grub-core/genmod.sh.in: Add -R .note.GNU-stack to strip. + * VasEBoot-core/genmod.sh.in: Add -R .note.GNU-stack to strip. 2012-02-26 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (insert_array): Remove scanner_name + * VasEBoot-core/disk/diskfilter.c (insert_array): Remove scanner_name argument since it can be deduced from diskfilter. All users updated. 2012-02-26 Vladimir Serbinenko Remove prio_list. - * include/grub/list.h (grub_prio_list): Removed. - (GRUB_PRIO_LIST_PRIO_MASK): Removed. All users switched to - GRUB_COMMAND_PRIO_MASK. - (GRUB_PRIO_LIST_FLAG_ACTIVE): Removed. All users switched to - GRUB_COMMAND_FLAG_ACTIVE. - (grub_prio_list_insert): Removed. - (grub_prio_list_remove): Likewise. - (GRUB_AS_PRIO_LIST): Likewise. - (GRUB_AS_PRIO_LIST_P): Likewise. - * include/grub/command.h (GRUB_COMMAND_PRIO_MASK): New define. - (GRUB_COMMAND_FLAG_ACTIVE): Likewise. - * grub-core/kern/list.c (grub_prio_list_insert): Remove. - * grub-core/kern/command.c (grub_register_command_prio): Inline + * include/VasEBoot/list.h (VasEBoot_prio_list): Removed. + (VasEBoot_PRIO_LIST_PRIO_MASK): Removed. All users switched to + VasEBoot_COMMAND_PRIO_MASK. + (VasEBoot_PRIO_LIST_FLAG_ACTIVE): Removed. All users switched to + VasEBoot_COMMAND_FLAG_ACTIVE. + (VasEBoot_prio_list_insert): Removed. + (VasEBoot_prio_list_remove): Likewise. + (VasEBoot_AS_PRIO_LIST): Likewise. + (VasEBoot_AS_PRIO_LIST_P): Likewise. + * include/VasEBoot/command.h (VasEBoot_COMMAND_PRIO_MASK): New define. + (VasEBoot_COMMAND_FLAG_ACTIVE): Likewise. + * VasEBoot-core/kern/list.c (VasEBoot_prio_list_insert): Remove. + * VasEBoot-core/kern/command.c (VasEBoot_register_command_prio): Inline the prio_list code. - (grub_unregister_command): Likewise. + (VasEBoot_unregister_command): Likewise. 2012-02-26 Vladimir Serbinenko Fix interrupt mixup from previous commit. - * include/grub/i386/pc/int.h (grub_i386_idt): New struct. - (grub_realidt): New var. - * grub-core/lib/i386/relocator16.S (grub_relocator16_idt): New variable + * include/VasEBoot/i386/pc/int.h (VasEBoot_i386_idt): New struct. + (VasEBoot_realidt): New var. + * VasEBoot-core/lib/i386/relocator16.S (VasEBoot_relocator16_idt): New variable Load idt. - * grub-core/lib/i386/relocator.c (grub_relocator16_idt): + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator16_idt): New declaration. - (grub_relocator16_boot): Set grub_relocator16_idt. - * grub-core/kern/i386/realmode.S (realidt): Renamed to ... + (VasEBoot_relocator16_boot): Set VasEBoot_relocator16_idt. + * VasEBoot-core/kern/i386/realmode.S (realidt): Renamed to ... (LOCAL(realidt)): ... this. - * grub-core/boot/i386/pc/startup_raw.S: Pass pointer to realidt in eax. - * grub-core/kern/i386/pc/startup.S: Save pointer to realidt. - (grub_realidt): New variable. + * VasEBoot-core/boot/i386/pc/startup_raw.S: Pass pointer to realidt in eax. + * VasEBoot-core/kern/i386/pc/startup.S: Save pointer to realidt. + (VasEBoot_realidt): New variable. 2012-02-26 Vladimir Serbinenko - * grub-core/lib/i386/backtrace.c (grub_cmd_backtrace): Move from ... - * grub-core/lib/backtrace.c (grub_cmd_backtrace): ... to here. - * grub-core/lib/i386/backtrace.c (GRUB_MOD_INIT): Move from ... - * grub-core/lib/backtrace.c (GRUB_MOD_INIT): ... to here. + * VasEBoot-core/lib/i386/backtrace.c (VasEBoot_cmd_backtrace): Move from ... + * VasEBoot-core/lib/backtrace.c (VasEBoot_cmd_backtrace): ... to here. + * VasEBoot-core/lib/i386/backtrace.c (VasEBoot_MOD_INIT): Move from ... + * VasEBoot-core/lib/backtrace.c (VasEBoot_MOD_INIT): ... to here. Gettextize. - * grub-core/lib/i386/backtrace.c (GRUB_MOD_FINI): Move from ... - * grub-core/lib/backtrace.c (GRUB_MOD_FINI): ... to here. + * VasEBoot-core/lib/i386/backtrace.c (VasEBoot_MOD_FINI): Move from ... + * VasEBoot-core/lib/backtrace.c (VasEBoot_MOD_FINI): ... to here. * po/POTFILES.in: Regenerate. 2012-02-26 Vladimir Serbinenko - * grub-core/commands/probe.c (grub_cmd_probe): Gettextise UUID and label + * VasEBoot-core/commands/probe.c (VasEBoot_cmd_probe): Gettextise UUID and label errors. 2012-02-26 Vladimir Serbinenko - * grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Stop on + * VasEBoot-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Stop on \0. (add_length): Likewise. @@ -12876,41 +12876,41 @@ GDB serial and backtrace support. - * grub-core/kern/i386/realmode.S (real_to_prot): Reload IDT. + * VasEBoot-core/kern/i386/realmode.S (real_to_prot): Reload IDT. (prot_to_real): Likewise. - * grub-core/kern/i386/int.S (grub_bios_interrupt): Remove IDT reload. - * grub-core/Makefile.core.def (backtrace): New module. + * VasEBoot-core/kern/i386/int.S (VasEBoot_bios_interrupt): Remove IDT reload. + * VasEBoot-core/Makefile.core.def (backtrace): New module. (gdb): Likewise. - * grub-core/gdb/cstub.c: New file. - * grub-core/gdb/gdb.c: Likewise. - * grub-core/gdb/i386/idt.c: Likewise. - * grub-core/gdb/i386/machdep.S: Likewise. - * grub-core/gdb/i386/signal.c: Likewise. - * grub-core/lib/i386/backtrace.c: Likewise. - * grub-core/lib/backtrace.c: Likewise. - * include/grub/backtrace.h: Likewise. - * include/grub/gdb.h: Likewise. - * include/grub/i386/gdb.h: Likewise. + * VasEBoot-core/gdb/cstub.c: New file. + * VasEBoot-core/gdb/gdb.c: Likewise. + * VasEBoot-core/gdb/i386/idt.c: Likewise. + * VasEBoot-core/gdb/i386/machdep.S: Likewise. + * VasEBoot-core/gdb/i386/signal.c: Likewise. + * VasEBoot-core/lib/i386/backtrace.c: Likewise. + * VasEBoot-core/lib/backtrace.c: Likewise. + * include/VasEBoot/backtrace.h: Likewise. + * include/VasEBoot/gdb.h: Likewise. + * include/VasEBoot/i386/gdb.h: Likewise. 2012-02-26 Vladimir Serbinenko - * grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): + * VasEBoot-core/gnulib/argp-fmtstream.c (__argp_get_display_len): New function. (add_length): Likewise. (__argp_fmtstream_update): Handle strings with non-ASCII chars. - * grub-core/gnulib/argp-fmtstream.h (__argp_get_display_len): New + * VasEBoot-core/gnulib/argp-fmtstream.h (__argp_get_display_len): New proto. - * grub-core/gnulib/argp-help.c (argp_args_usage): Use + * VasEBoot-core/gnulib/argp-help.c (argp_args_usage): Use __argp_get_display_len. 2012-02-26 Vladimir Serbinenko $"..." support in scripts. - * grub-core/script/execute.c (grub_script_arglist_to_argv): Handle - GRUB_SCRIPT_ARG_TYPE_GETTEXT. - * grub-core/script/yylex.l: Likewise. - * include/grub/script_sh.h (GRUB_SCRIPT_ARG_TYPE_GETTEXT): New enum + * VasEBoot-core/script/execute.c (VasEBoot_script_arglist_to_argv): Handle + VasEBoot_SCRIPT_ARG_TYPE_GETTEXT. + * VasEBoot-core/script/yylex.l: Likewise. + * include/VasEBoot/script_sh.h (VasEBoot_SCRIPT_ARG_TYPE_GETTEXT): New enum value. 2012-02-26 Vladimir Serbinenko @@ -12922,36 +12922,36 @@ Don't transform PACKAGE_TARNAME following a discussion on autoconf mailing list. - * util/grub-install.in: Don't transform PACKAGE_TARNAME. - * util/grub-kbdcomp.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mkconfig_lib.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-install.in: Don't transform PACKAGE_TARNAME. + * util/VasEBoot-kbdcomp.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mkconfig_lib.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2012-02-26 Vladimir Serbinenko - Remove GRUB_PREFIX. + Remove VasEBoot_PREFIX. - * util/grub-mkconfig.in: Remove GRUB_PREFIX. - * util/grub.d/00_header.in: Compute prefix in the only place it's still + * util/VasEBoot-mkconfig.in: Remove VasEBoot_PREFIX. + * util/VasEBoot.d/00_header.in: Compute prefix in the only place it's still used for backward compatibility. 2012-02-26 Vladimir Serbinenko Add new all_video module. - * grub-core/Makefile.am (moddep.lst): Make dependent on video.lst. - * grub-core/Makefile.core.def (all_video): New module. - * grub-core/genmoddep.awk: Generate dependency of all_video from + * VasEBoot-core/Makefile.am (moddep.lst): Make dependent on video.lst. + * VasEBoot-core/Makefile.core.def (all_video): New module. + * VasEBoot-core/genmoddep.awk: Generate dependency of all_video from video.lst. - * grub-core/lib/fake_module.c: New file. - * grub-core/normal/main.c (features): Add feature_all_video_module. - * util/grub.d/00_header.in: Define locale_dir based on $prefix and + * VasEBoot-core/lib/fake_module.c: New file. + * VasEBoot-core/normal/main.c (features): Add feature_all_video_module. + * util/VasEBoot.d/00_header.in: Define locale_dir based on $prefix and don't do explicit search again. insmod all_video in load_video if available. @@ -12961,86 +12961,86 @@ 2012-02-26 Vladimir Serbinenko - * util/grub-mknetdir.in: Remove erroneous reference to install_device. + * util/VasEBoot-mknetdir.in: Remove erroneous reference to install_device. 2012-02-26 Vladimir Serbinenko - * grub-core/normal/charset.c (grub_utf8_to_ucs4_alloc): Fix return type - to grub_ssize_t. - * grub-core/normal/main.c (grub_normal_init_page): Fix msg_len type. - * include/grub/charset.h (grub_utf8_to_ucs4_alloc): Fix prototype. + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_to_ucs4_alloc): Fix return type + to VasEBoot_ssize_t. + * VasEBoot-core/normal/main.c (VasEBoot_normal_init_page): Fix msg_len type. + * include/VasEBoot/charset.h (VasEBoot_utf8_to_ucs4_alloc): Fix prototype. 2012-02-26 Vladimir Serbinenko - * grub-core/normal/menu_text.c (grub_print_message_indented_real): Add + * VasEBoot-core/normal/menu_text.c (VasEBoot_print_message_indented_real): Add trailing newline implicitly. All users updated. 2012-02-26 Vladimir Serbinenko Implement serial on IEEE1275 and EFI. - * docs/grub.texi (Platform-specific limitations): Fix the columen video + * docs/VasEBoot.texi (Platform-specific limitations): Fix the columen video on emu. Mention arc and emu as the only platforms without serial support. - * grub-core/Makefile.core.def (serial): Enable on all terminfomodule and + * VasEBoot-core/Makefile.core.def (serial): Enable on all terminfomodule and ieee1275 platforms. - * grub-core/term/efi/serial.c: New file. - * grub-core/term/ieee1275/serial.c: Likewise. - * grub-core/term/serial.c (grub_serial_find): Disable direct port + * VasEBoot-core/term/efi/serial.c: New file. + * VasEBoot-core/term/ieee1275/serial.c: Likewise. + * VasEBoot-core/term/serial.c (VasEBoot_serial_find): Disable direct port specification if no ns8250 driver is available. - (grub_cmd_serial): Likewise. - (GRUB_MOD_INIT) [GRUB_MACHINE_IEEE1275]: Init ofserial. - (GRUB_MOD_INIT) [GRUB_MACHINE_EFI]: Init efiserial. - * include/grub/efi/api.h (GRUB_EFI_SERIAL_IO_GUID): New define. - (grub_efi_parity_type_t): New type. - (grub_efi_stop_bits_t): Likewise. - (grub_efi_serial_io_interface): New struct. - * include/grub/serial.h (grub_serial_port): Make 'broken' field + (VasEBoot_cmd_serial): Likewise. + (VasEBoot_MOD_INIT) [VasEBoot_MACHINE_IEEE1275]: Init ofserial. + (VasEBoot_MOD_INIT) [VasEBoot_MACHINE_EFI]: Init efiserial. + * include/VasEBoot/efi/api.h (VasEBoot_EFI_SERIAL_IO_GUID): New define. + (VasEBoot_efi_parity_type_t): New type. + (VasEBoot_efi_stop_bits_t): Likewise. + (VasEBoot_efi_serial_io_interface): New struct. + * include/VasEBoot/serial.h (VasEBoot_serial_port): Make 'broken' field available for all interfaces. Add EFI and IEEE1275 fields. - (grub_ofserial_init): New proto. - (grub_efiserial_init): Likeiwse. - * util/grub.d/00_header.in: Don't check for the presence of serial + (VasEBoot_ofserial_init): New proto. + (VasEBoot_efiserial_init): Likeiwse. + * util/VasEBoot.d/00_header.in: Don't check for the presence of serial module. 2012-02-26 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (scan): Fix improper use of device + * VasEBoot-core/disk/ieee1275/ofdisk.c (scan): Fix improper use of device name as if it was an alias. 2012-02-25 Vladimir Serbinenko - * grub-core/commands/lsacpi.c (options): Fix typo. + * VasEBoot-core/commands/lsacpi.c (options): Fix typo. 2012-02-25 Vladimir Serbinenko - Convert grub-emu to argp. + Convert VasEBoot-emu to argp. - * grub-core/Makefile.core.def (kernel): Add kern/emu/argp_common.c on + * VasEBoot-core/Makefile.core.def (kernel): Add kern/emu/argp_common.c on emu. * util/argp_common.c: Rename to ... - * grub-core/kern/emu/argp_common.c: ... this. All users updated. + * VasEBoot-core/kern/emu/argp_common.c: ... this. All users updated. Add missing includes. - * grub-core/kern/emu/main.c: Convert to argp. + * VasEBoot-core/kern/emu/main.c: Convert to argp. * po/POTFILES.in: Regenerate. - * util/grub-install.in (usage): Make first letter lowcase in messages + * util/VasEBoot-install.in (usage): Make first letter lowcase in messages for uniformity. - * util/grub-setup.c (options): Likewise. + * util/VasEBoot-setup.c (options): Likewise. 2012-02-24 Vladimir Serbinenko - * grub-core/gfxmenu/gui_progress_bar.c (progress_bar_set_property): + * VasEBoot-core/gfxmenu/gui_progress_bar.c (progress_bar_set_property): Put back accidently commented-out code. 2012-02-24 Vladimir Serbinenko - * grub-core/fs/hfsplus.c (grub_hfsplus_btree_iterate_node): Add btree + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_btree_iterate_node): Add btree loop check using Brent algorithm. - (grub_hfsplus_btree_search): Likewise. + (VasEBoot_hfsplus_btree_search): Likewise. 2012-02-24 Vladimir Serbinenko - * util/grub-install.in: Fix usage of wrong device for PreP install. + * util/VasEBoot-install.in: Fix usage of wrong device for PreP install. 2012-02-24 Vladimir Serbinenko @@ -13048,44 +13048,44 @@ -Wno-unsafe-loop-optimizations. * configure.ac: Remove -Wmissing-declarations and -Wmissing-prototypes on tools. - * grub-core/commands/legacycfg.c: Add pragma to skip + * VasEBoot-core/commands/legacycfg.c: Add pragma to skip -Wunsafe-loop-optimizations. (check_password_md5_real): Fix loop counter type. - * grub-core/commands/testload.c (grub_cmd_testload): Fix over the EOF + * VasEBoot-core/commands/testload.c (VasEBoot_cmd_testload): Fix over the EOF reading. - * grub-core/disk/ldm.c (grub_util_get_ldm): Fix logic error. - * grub-core/fs/zfs/zfs_sha256.c (zio_checksum_SHA256): Add safety + * VasEBoot-core/disk/ldm.c (VasEBoot_util_get_ldm): Fix logic error. + * VasEBoot-core/fs/zfs/zfs_sha256.c (zio_checksum_SHA256): Add safety loop condition. - * grub-core/io/gzio.c: Add pragma to skip -Wunsafe-loop-optimizations. - * grub-core/lib/LzmaEnc.c (GetOptimum): Avoid possible infinite loop. - * grub-core/net/net.c (grub_net_route_address): Add safety loop + * VasEBoot-core/io/gzio.c: Add pragma to skip -Wunsafe-loop-optimizations. + * VasEBoot-core/lib/LzmaEnc.c (GetOptimum): Avoid possible infinite loop. + * VasEBoot-core/net/net.c (VasEBoot_net_route_address): Add safety loop condition. - * grub-core/normal/charset.c (bidi_line_wrap): Likewise. - * grub-core/normal/cmdline.c (grub_set_history): Fix loop types and + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Likewise. + * VasEBoot-core/normal/cmdline.c (VasEBoot_set_history): Fix loop types and avoid possible infinite loops. - * grub-core/script/parser.y: Add pragma to skip -Wmissing-declarations + * VasEBoot-core/script/parser.y: Add pragma to skip -Wmissing-declarations and -Wunsafe-loop-optimizations. - * grub-core/script/yylex.l: Likewise. - * util/grub-mkfont.c: Add pragma to skip -Wunsafe-loop-optimizations. + * VasEBoot-core/script/yylex.l: Likewise. + * util/VasEBoot-mkfont.c: Add pragma to skip -Wunsafe-loop-optimizations. (print_glyphs): Avoid infinite loops. - * util/grub-mkimage.c (compress_kernel_xz): Fix format security. + * util/VasEBoot-mkimage.c (compress_kernel_xz): Fix format security. 2012-02-24 Grégoire Sutre - * grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): Fix loop condition + * VasEBoot-core/commands/lsacpi.c (disp_acpi_xsdt_table): Fix loop condition to avoid infinite loop. (disp_acpi_rsdt_table): Likewise. 2012-02-24 Vladimir Serbinenko - * grub-core/font/font.c (grub_font_load): Add support for default + * VasEBoot-core/font/font.c (VasEBoot_font_load): Add support for default path for fonts ($prefix/fonts). - * grub-core/kern/corecmd.c (grub_core_cmd_insmod): Unify condition + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_insmod): Unify condition for checking if string is a path. - * grub-core/normal/main.c (features): Add feature_default_font_path. - * util/grub-mkconfig.in: Skip mangling of GRUB_FONT into GRUB_FONT_PATH. - * util/grub.d/00_header.in: Use default directory if possible. - * util/grub-install.in: Install unicode.pf2. + * VasEBoot-core/normal/main.c (features): Add feature_default_font_path. + * util/VasEBoot-mkconfig.in: Skip mangling of VasEBoot_FONT into VasEBoot_FONT_PATH. + * util/VasEBoot.d/00_header.in: Use default directory if possible. + * util/VasEBoot-install.in: Install unicode.pf2. 2012-02-24 Vladimir Serbinenko @@ -13095,14 +13095,14 @@ 2012-02-23 Vladimir Serbinenko - * grub-core/fs/btrfs.c (find_device): Fix typos. - * grub-core/fs/zfs/zfs.c (read_device): Likewise. - * util/grub-mkrelpath.c (argp_parser): Likewise. + * VasEBoot-core/fs/btrfs.c (find_device): Fix typos. + * VasEBoot-core/fs/zfs/zfs.c (read_device): Likewise. + * util/VasEBoot-mkrelpath.c (argp_parser): Likewise. Reported by: Yuri Chornoivan. 2012-02-23 Dalet Omega - * grub-core/gfxmenu/gui_label.c (label_set_property): Add template + * VasEBoot-core/gfxmenu/gui_label.c (label_set_property): Add template for usual informative messages. 2012-02-23 Dalet Omega @@ -13153,7 +13153,7 @@ 2012-02-23 Vladimir Serbinenko - * util/grub.d/00_header.in: Add missing export theme. + * util/VasEBoot.d/00_header.in: Add missing export theme. 2012-02-22 Vladimir Serbinenko @@ -13163,26 +13163,26 @@ 2012-02-22 Vladimir Serbinenko - * conf/Makefile.common (grubdatadir): Removed. - (Makefile.am): Move eveything grubdata to pkgdata. + * conf/Makefile.common (VasEBootdatadir): Removed. + (Makefile.am): Move eveything VasEBootdata to pkgdata. 2012-02-22 Vladimir Serbinenko - * grub-core/commands/acpihalt.c (get_sleep_type): + * VasEBoot-core/commands/acpihalt.c (get_sleep_type): Remove unused variable. 2012-02-22 Vladimir Serbinenko - * include/grub/acpi.h (GRUB_ASCII_OPCODE): Add - GRUB_ACPI_OPCODE_STRING_CONST, GRUB_ACPI_OPCODE_BUFFER, - GRUB_ACPI_OPCODE_CREATE_WORD_FIELD - and GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD. - * grub-core/commands/acpihalt.c [GRUB_DSDT_TEST]: Replace include of + * include/VasEBoot/acpi.h (VasEBoot_ASCII_OPCODE): Add + VasEBoot_ACPI_OPCODE_STRING_CONST, VasEBoot_ACPI_OPCODE_BUFFER, + VasEBoot_ACPI_OPCODE_CREATE_WORD_FIELD + and VasEBoot_ACPI_OPCODE_CREATE_BYTE_FIELD. + * VasEBoot-core/commands/acpihalt.c [VasEBoot_DSDT_TEST]: Replace include of i18n with gettext no-op. - (skip_data_ref_object): Support GRUB_ACPI_OPCODE_BUFFER and - GRUB_ACPI_OPCODE_STRING_CONST. - (get_sleep_type): Support GRUB_ACPI_OPCODE_CREATE_WORD_FIELD and - GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD. Add handling of unknown opcodes. + (skip_data_ref_object): Support VasEBoot_ACPI_OPCODE_BUFFER and + VasEBoot_ACPI_OPCODE_STRING_CONST. + (get_sleep_type): Support VasEBoot_ACPI_OPCODE_CREATE_WORD_FIELD and + VasEBoot_ACPI_OPCODE_CREATE_BYTE_FIELD. Add handling of unknown opcodes. 2012-02-22 Vladimir Serbinenko @@ -13190,33 +13190,33 @@ 2012-02-22 Vladimir Serbinenko - * Makefile.util.def (libgrubmods.a): Add -Wno-error=logical-op + * Makefile.util.def (libVasEBootmods.a): Add -Wno-error=logical-op -Wno-error=missing-noreturn. 2012-02-22 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_read_block): Avoid <= in loop + * VasEBoot-core/fs/affs.c (VasEBoot_affs_read_block): Avoid <= in loop condition to avoid possibly infinite loops. - * grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Likewise. - * grub-core/lib/xzembed/xz_dec_bcj.c (bcj_powerpc): Likewise. + * VasEBoot-core/lib/pbkdf2.c (VasEBoot_crypto_pbkdf2): Likewise. + * VasEBoot-core/lib/xzembed/xz_dec_bcj.c (bcj_powerpc): Likewise. 2012-02-22 Vladimir Serbinenko - * grub-core/normal/charset.c (bidi_line_wrap): Avoid <= in loop + * VasEBoot-core/normal/charset.c (bidi_line_wrap): Avoid <= in loop condition to avoid possibly infinite loops. 2012-02-22 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (read_device_map): Add missing noreturn + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Add missing noreturn on show_error. 2012-02-22 Vladimir Serbinenko - * grub-core/kern/disk.c (grub_disk_write): Add missing const qualifier. + * VasEBoot-core/kern/disk.c (VasEBoot_disk_write): Add missing const qualifier. 2012-02-22 Vladimir Serbinenko - * grub-core/kern/corecmd.c (grub_core_cmd_ls): Add missing var init. + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_ls): Add missing var init. 2012-02-22 Vladimir Serbinenko @@ -13224,7 +13224,7 @@ 2012-02-22 Vladimir Serbinenko - * grub-core/commands/testload.c (grub_cmd_testload): Fix overflow + * VasEBoot-core/commands/testload.c (VasEBoot_cmd_testload): Fix overflow if the size isn't divisible by 512. 2012-02-22 Vladimir Serbinenko @@ -13232,10 +13232,10 @@ Make list_push and list_remove functions rather than inline functions to decrease size and avoid aliasing violations. - * include/grub/list.h (grub_list_push): Move to ... - * grub-core/kern/list.c (grub_list_push): ... here. Don't inline. - * include/grub/list.h (grub_list_remove): Move to ... - * grub-core/kern/list.c (grub_list_remove): ... here. Don't inline. + * include/VasEBoot/list.h (VasEBoot_list_push): Move to ... + * VasEBoot-core/kern/list.c (VasEBoot_list_push): ... here. Don't inline. + * include/VasEBoot/list.h (VasEBoot_list_remove): Move to ... + * VasEBoot-core/kern/list.c (VasEBoot_list_remove): ... here. Don't inline. 2012-02-22 Vladimir Serbinenko @@ -13244,7 +13244,7 @@ 2012-02-21 Vladimir Serbinenko - * grub-core/net/net.c (grub_cmd_deladdr): Fix index. + * VasEBoot-core/net/net.c (VasEBoot_cmd_deladdr): Fix index. Reported by: Seth Goldberg 2012-02-21 Vladimir Serbinenko @@ -13253,136 +13253,136 @@ 2012-02-19 Samuel Thibault - * util/grub-mkconfig.in (GRUB_CMDLINE_GNUMACH): Export variable. - * util/grub.d/10_hurd.in: Include GRUB_CMDLINE_GNUMACH in gnumach + * util/VasEBoot-mkconfig.in (VasEBoot_CMDLINE_GNUMACH): Export variable. + * util/VasEBoot.d/10_hurd.in: Include VasEBoot_CMDLINE_GNUMACH in gnumach command line. - * docs/grub.texi (Simple configuration): Document - GRUB_CMDLINE_GNUMACH. + * docs/VasEBoot.texi (Simple configuration): Document + VasEBoot_CMDLINE_GNUMACH. 2012-02-18 Vladimir Serbinenko * conf/Makefile.common (platform_SCRIPTS): New variable. (platform_PROGRAMS): Likewise. * gentpl.py: Mark *,module and *.image for install. - * grub-core/gdb_grub.in: Add a notice of expected environment. - * grub-core/Makefile.core.def (gdb_grub): Mark for install. + * VasEBoot-core/gdb_VasEBoot.in: Add a notice of expected environment. + * VasEBoot-core/Makefile.core.def (gdb_VasEBoot): Mark for install. (gmodule.pl): Likewise. 2012-02-18 Vladimir Serbinenko - Replace grub_checkkey with grub_getkey_noblock. + Replace VasEBoot_checkkey with VasEBoot_getkey_noblock. - * grub-core/kern/term.c (grub_checkkey): Replaced with ... - (grub_getkey_noblock): ... this. All users updated. + * VasEBoot-core/kern/term.c (VasEBoot_checkkey): Replaced with ... + (VasEBoot_getkey_noblock): ... this. All users updated. 2012-02-18 Vladimir Serbinenko - * grub-core/kern/emu/console.c: Move to ... - * grub-core/term/emu/console.c: ...here. - (grub_ncurses_getkey): Fix return value if no key is detected. + * VasEBoot-core/kern/emu/console.c: Move to ... + * VasEBoot-core/term/emu/console.c: ...here. + (VasEBoot_ncurses_getkey): Fix return value if no key is detected. 2012-02-12 Vladimir Serbinenko - * include/grub/test.h (grub_unit_test_init): Add missing prototype. - (grub_unit_test_fini): Likewise. + * include/VasEBoot/test.h (VasEBoot_unit_test_init): Add missing prototype. + (VasEBoot_unit_test_fini): Likewise. * tests/lib/unit_test.c (main): Remove extra nested external prototype. 2012-02-12 Vladimir Serbinenko - * include/grub/test.h (GRUB_UNIT_TEST) + * include/VasEBoot/test.h (VasEBoot_UNIT_TEST) 2012-02-12 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_break): Clarify logic. + * VasEBoot-core/script/execute.c (VasEBoot_script_break): Clarify logic. Better error handling. - (grub_script_return): Likewise. - * grub-core/script/lexer.c (grub_script_lexer_yywrap): Likewise. + (VasEBoot_script_return): Likewise. + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_yywrap): Likewise. 2012-02-12 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (__GNU_LIBRARY__): Avoid + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h (__GNU_LIBRARY__): Avoid rimplicit redifinition. 2012-02-12 Vladimir Serbinenko - * docs/grub.texi (Internationalisation): Detail (lack of) collation in - GRUB. + * docs/VasEBoot.texi (Internationalisation): Detail (lack of) collation in + VasEBoot. 2012-02-12 Vladimir Serbinenko - * grub-core/normal/cmdline.c (grub_cmdline_get): Don't gettext prompt. - * grub-core/normal/main.c (grub_normal_read_line_real): Gettext + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Don't gettext prompt. + * VasEBoot-core/normal/main.c (VasEBoot_normal_read_line_real): Gettext prompt here. 2012-02-12 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (zfs_fetch_nvlist): Mark unknown member here - as GRUB_ERR_BUG. Don't malloc if no device is available. + * VasEBoot-core/fs/zfs/zfs.c (zfs_fetch_nvlist): Mark unknown member here + as VasEBoot_ERR_BUG. Don't malloc if no device is available. 2012-02-12 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_terminfo_output_unregister): - Mark calling with invalid term as GRUB_ERR_BUG. + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_output_unregister): + Mark calling with invalid term as VasEBoot_ERR_BUG. 2012-02-12 Vladimir Serbinenko - * grub-core/net/tftp.c (tftp_receive): Silently discard too short + * VasEBoot-core/net/tftp.c (tftp_receive): Silently discard too short packets rather than raising an error. 2012-02-12 Vladimir Serbinenko - * grub-core/loader/xnu.c (grub_xnu_writetree_toheap_real): Avoid set + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_writetree_toheap_real): Avoid set in if. 2012-02-12 Vladimir Serbinenko - * grub-core/loader/efi/appleloader.c (grub_cmd_appleloader): Move + * VasEBoot-core/loader/efi/appleloader.c (VasEBoot_cmd_appleloader): Move diagnostic to dprintf. - * grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Likewise. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_linux): Likewise. 2012-02-12 Vladimir Serbinenko - * grub-core/kern/corecmd.c (grub_core_cmd_ls): Handle error in parsing + * VasEBoot-core/kern/corecmd.c (VasEBoot_core_cmd_ls): Handle error in parsing device name. 2012-02-12 Vladimir Serbinenko - * grub-core/fs/ntfs.c (locate_attr): Avoid set in if. - (grub_ntfs_iterate_dir): Likewise. + * VasEBoot-core/fs/ntfs.c (locate_attr): Avoid set in if. + (VasEBoot_ntfs_iterate_dir): Likewise. 2012-02-12 Vladimir Serbinenko Efiemu stylistic fixes and gettext. - * grub-core/efiemu/i386/loadcore32.c - (grub_arch_efiemu_relocate_symbols32): Avoid set in if. - * grub-core/efiemu/i386/loadcore64.c - (grub_arch_efiemu_relocate_symbols64): Likewise. - * grub-core/efiemu/i386/pc/cfgtables.c - (grub_machine_efiemu_init_tables): Likewise. - * grub-core/efiemu/loadcore.c (grub_efiemu_resolve_symbols): Likewise. - (grub_efiemu_loadcore_initXX): Add a filename argument. + * VasEBoot-core/efiemu/i386/loadcore32.c + (VasEBoot_arch_efiemu_relocate_symbols32): Avoid set in if. + * VasEBoot-core/efiemu/i386/loadcore64.c + (VasEBoot_arch_efiemu_relocate_symbols64): Likewise. + * VasEBoot-core/efiemu/i386/pc/cfgtables.c + (VasEBoot_machine_efiemu_init_tables): Likewise. + * VasEBoot-core/efiemu/loadcore.c (VasEBoot_efiemu_resolve_symbols): Likewise. + (VasEBoot_efiemu_loadcore_initXX): Add a filename argument. All users updated. Improved error message. - * grub-core/efiemu/loadcore_common.c (grub_efiemu_loadcore_init): + * VasEBoot-core/efiemu/loadcore_common.c (VasEBoot_efiemu_loadcore_init): Add a filename argument. All users updated. - * grub-core/efiemu/symbols.c (grub_efiemu_set_virtual_address_map): - Reclassify double relocation as GRUB_ERR_BUG. + * VasEBoot-core/efiemu/symbols.c (VasEBoot_efiemu_set_virtual_address_map): + Reclassify double relocation as VasEBoot_ERR_BUG. 2012-02-12 Vladimir Serbinenko - * grub-core/commands/i386/pc/play.c (grub_cmd_play): Improve error + * VasEBoot-core/commands/i386/pc/play.c (VasEBoot_cmd_play): Improve error handling. 2012-02-12 Vladimir Serbinenko - * grub-core/commands/hdparm.c (grub_cmd_hdparm): Allow running + * VasEBoot-core/commands/hdparm.c (VasEBoot_cmd_hdparm): Allow running on partition. 2012-02-12 Vladimir Serbinenko - * include/grub/misc.h (grub_error_save): Fix cleaning grub_errno. + * include/VasEBoot/misc.h (VasEBoot_error_save): Fix cleaning VasEBoot_errno. 2012-02-12 Vladimir Serbinenko @@ -13396,20 +13396,20 @@ 2012-02-11 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (grub_diskfilter_print_partmap) - [GRUB_UTIL]: New function. - (insert_array) [GRUB_UTIL]: Store partmaps. - * include/grub/diskfilter.h (grub_diskfilter_pv) [GRUB_UTIL]: New member + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_print_partmap) + [VasEBoot_UTIL]: New function. + (insert_array) [VasEBoot_UTIL]: Store partmaps. + * include/VasEBoot/diskfilter.h (VasEBoot_diskfilter_pv) [VasEBoot_UTIL]: New member partmaps. - (grub_diskfilter_print_partmap) [GRUB_UTIL]: New proto. - * util/grub-probe.c (probe_partmap): Call grub_diskfilter_print_partmap. + (VasEBoot_diskfilter_print_partmap) [VasEBoot_UTIL]: New proto. + * util/VasEBoot-probe.c (probe_partmap): Call VasEBoot_diskfilter_print_partmap. (probe_abstraction): Print diskfilter and not raid. Reported by: Lennart Sorensen 2012-02-11 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Explicitly init decompress_size. - * util/grub-mkimagexx.c (MASK3): New define. + * util/VasEBoot-mkimage.c (generate_image): Explicitly init decompress_size. + * util/VasEBoot-mkimagexx.c (MASK3): New define. (add_value_to_slot_20b): Use MASK3. (add_value_to_slot_21): Likewise. (relocate_addresses): Fix format specification. @@ -13417,36 +13417,36 @@ 2012-02-11 Vladimir Serbinenko - * util/getroot.c (grub_find_root_devices_from_mountinfo): Fix types. - (grub_util_biosdisk_get_grub_dev): Fix format specification. + * util/getroot.c (VasEBoot_find_root_devices_from_mountinfo): Fix types. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Fix format specification. 2012-02-11 Vladimir Serbinenko - * grub-core/kern/emu/full.c (grub_arch_dl_get_tramp_got_size): Enable + * VasEBoot-core/kern/emu/full.c (VasEBoot_arch_dl_get_tramp_got_size): Enable on powerpc. Reported by: Lennart Sorensen 2012-02-11 Vladimir Serbinenko * gentpl.py: Add missing license header. - * docs/grub.texi: Update copyright year. + * docs/VasEBoot.texi: Update copyright year. 2012-02-10 Grégoire Sutre - Source grub-mkconfig_lib from the build directory at build time. + Source VasEBoot-mkconfig_lib from the build directory at build time. Suggested by: Vladimir Serbinenko. * gentpl.py (manpage): Set pkgdatadir to $(builddir) on help2man call. - * util/grub-install.in: Define pkgdatadir if not already set, and source - grub-mkconfig_lib from there. - * util/grub-kbdcomp.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-install.in: Define pkgdatadir if not already set, and source + VasEBoot-mkconfig_lib from there. + * util/VasEBoot-kbdcomp.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2012-02-10 Vladimir Serbinenko @@ -13457,86 +13457,86 @@ * configure.ac (HOST_CFLAGS): Add bunch of -W arguments. (TARGET_CFLAGS): Likewise. (HOST_CFLAGS): Add -Werror unless --disable-werror is activated. - * grub-core/Makefile.core.def (decompressor_xz): Add + * VasEBoot-core/Makefile.core.def (decompressor_xz): Add -Wno-unreachable-code. (normal): Add -Wno-redundant-decls. (xzio): Add -Wno-unreachable-code. (lzopio): Add -Wno-redundant-decls -Wno-error. - * grub-core/commands/acpi.c: Add exception to -Wcast-align. - * grub-core/commands/lsacpi.c: Add exception to -Wcast-align. - * grub-core/gensymlist.sh: Add exception to -Wmissing-format-attribute. - * grub-core/kern/dl.c: Add exception to -Wcast-align. - * grub-core/kern/efi/efi.c (grub_efi_modules_addr): Likewise. - * grub-core/kern/i386/coreboot/init.c: Add exception to + * VasEBoot-core/commands/acpi.c: Add exception to -Wcast-align. + * VasEBoot-core/commands/lsacpi.c: Add exception to -Wcast-align. + * VasEBoot-core/gensymlist.sh: Add exception to -Wmissing-format-attribute. + * VasEBoot-core/kern/dl.c: Add exception to -Wcast-align. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_modules_addr): Likewise. + * VasEBoot-core/kern/i386/coreboot/init.c: Add exception to -Wsuggest-attribute=noreturn. - * grub-core/kern/ia64/dl.c: Add exception to -Wcast-align. - * grub-core/kern/ia64/dl_helper.c: Likewise. - * grub-core/kern/mips/dl.c: Likewise. - * grub-core/kern/sparc64/dl.c: Likewise. - * grub-core/lib/LzmaEnc.c: Add exception to -Wshadow. - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise. + * VasEBoot-core/kern/ia64/dl.c: Add exception to -Wcast-align. + * VasEBoot-core/kern/ia64/dl_helper.c: Likewise. + * VasEBoot-core/kern/mips/dl.c: Likewise. + * VasEBoot-core/kern/sparc64/dl.c: Likewise. + * VasEBoot-core/lib/LzmaEnc.c: Add exception to -Wshadow. + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise. (memcmp): Likewise. - * grub-core/lib/pbkdf2.c: Add exception to -Wunreachable-code. - * grub-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align. - * grub-core/loader/mips/linux.c: Likewise. - * grub-core/loader/multiboot_elfxx.c: Likewise. - * grub-core/script/parser.y: Add exception to -Wunreachable-code. - * grub-core/video/sm712.c: Add exception to -Wcast-align. + * VasEBoot-core/lib/pbkdf2.c: Add exception to -Wunreachable-code. + * VasEBoot-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align. + * VasEBoot-core/loader/mips/linux.c: Likewise. + * VasEBoot-core/loader/multiboot_elfxx.c: Likewise. + * VasEBoot-core/script/parser.y: Add exception to -Wunreachable-code. + * VasEBoot-core/video/sm712.c: Add exception to -Wcast-align. * util/import_gcry.py: Add -Wno-cast-align to modules checked by hand. - * grub-core/font/font.c (grub_font_loader_init): Add explicit cast and + * VasEBoot-core/font/font.c (VasEBoot_font_loader_init): Add explicit cast and fixme. - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. - * grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_init): + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Likewise. + * VasEBoot-core/kern/i386/multiboot_mmap.c (VasEBoot_machine_mmap_init): Fix prototype. 2012-02-10 Vladimir Serbinenko - * grub-core/lib/i386/relocator16.S: Fix incorrect use of absolute + * VasEBoot-core/lib/i386/relocator16.S: Fix incorrect use of absolute address. 2012-02-10 Vladimir Serbinenko - * grub-core/commands/legacycfg.c (grub_cmd_legacy_kernel): + * VasEBoot-core/commands/legacycfg.c (VasEBoot_cmd_legacy_kernel): Avoid improper use of strings. - (grub_cmd_legacy_initrdnounzip): Likewise. + (VasEBoot_cmd_legacy_initrdnounzip): Likewise. 2012-02-10 Vladimir Serbinenko - * include/grub/emu/misc.h (grub_util_warn): Add missing format + * include/VasEBoot/emu/misc.h (VasEBoot_util_warn): Add missing format attribute. - (grub_util_info): Likewise. - (grub_util_error): Likewise. + (VasEBoot_util_info): Likewise. + (VasEBoot_util_error): Likewise. 2012-02-10 Vladimir Serbinenko - * util/grub-mount.c (fuse_init): Avoid improper use of strings. - * util/grub-fstest.c (fstest): Likewise. + * util/VasEBoot-mount.c (fuse_init): Avoid improper use of strings. + * util/VasEBoot-fstest.c (fstest): Likewise. 2012-02-10 Vladimir Serbinenko - * grub-core/disk/geli.c (grub_md_sha256_real): Respect format security. - (grub_md_sha512_real): Likewise. - (grub_util_get_geli_uuid): Likewise. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Likewise. - (grub_util_biosdisk_open): Fix format specification. + * VasEBoot-core/disk/geli.c (VasEBoot_md_sha256_real): Respect format security. + (VasEBoot_md_sha512_real): Likewise. + (VasEBoot_util_get_geli_uuid): Likewise. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors): Likewise. + (VasEBoot_util_biosdisk_open): Fix format specification. Respect format security. - * grub-core/kern/emu/misc.c (xmalloc): Respect format security. + * VasEBoot-core/kern/emu/misc.c (xmalloc): Respect format security. (xrealloc): Likewise. (xasprintf): Likewise. 2012-02-10 Vladimir Serbinenko - * util/import_gcry.py: Include grub/crypto.h in init.c. + * util/import_gcry.py: Include VasEBoot/crypto.h in init.c. 2012-02-10 Vladimir Serbinenko - * util/grub-mkimage.c (compress_kernel_lzma): Respect format security. + * util/VasEBoot-mkimage.c (compress_kernel_lzma): Respect format security. (generate_image): Make prefix a const char *. Fix format specifications. Respect format security. Avoid void * arithmetics. Avoid shadowing. (argp_parser): Remove unused variable. Respect format security. - * util/grub-mkimagexx.c (relocate_symbols): Avoid shadowing. + * util/VasEBoot-mkimagexx.c (relocate_symbols): Avoid shadowing. (count_funcs) [!MKIMAGE_ELF64]: #if-out. (count_funcs): Remove unused variable. (relocate_addresses): Fix format specification. @@ -13549,29 +13549,29 @@ 2012-02-10 Vladimir Serbinenko - * util/grub-setup.c (setup): Remove unused variable. Avoid shadowing. + * util/VasEBoot-setup.c (setup): Remove unused variable. Avoid shadowing. Fix format specifications. Respect format security. - Don't translate already translated grub_errmsg. + Don't translate already translated VasEBoot_errmsg. (argp_parser): Remove unused variable 2012-02-10 Vladimir Serbinenko - * util/grub-mkrelpath.c (argp_parser): Remove unused variable. + * util/VasEBoot-mkrelpath.c (argp_parser): Remove unused variable. 2012-02-10 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c (argp_parser): Remove unused variable. + * util/VasEBoot-mkpasswd-pbkdf2.c (argp_parser): Remove unused variable. (main): Likewise. Use xmalloc. Respect format security. 2012-02-10 Vladimir Serbinenko - * util/grub-mklayout.c (console_grub_equivalence): Make "layout" + * util/VasEBoot-mklayout.c (console_VasEBoot_equivalence): Make "layout" a const char *. (argp_parser): Remove unused variable. 2012-02-10 Vladimir Serbinenko - * util/grub-mkfont.c (grub_font_info): Make name a const char *. + * util/VasEBoot-mkfont.c (VasEBoot_font_info): Make name a const char *. (add_pixel): Make static. (add_font): Likewise. (write_string_section): Make name and str a const char *. @@ -13586,7 +13586,7 @@ 2012-02-10 Vladimir Serbinenko - * util/grub-editenv.c (argp_parser): Make static. + * util/VasEBoot-editenv.c (argp_parser): Make static. (create_envblk_file): Use xmalloc. (open_envblk_file): Likewise. Resepect format security. @@ -13594,17 +13594,17 @@ 2012-02-10 Vladimir Serbinenko - * util/getroot.c (grub_find_device): Respect format security. + * util/getroot.c (VasEBoot_find_device): Respect format security. (get_mdadm_uuid): Remove unused variable. - (grub_util_pull_device): Dont call gettext on already translated - grub_errmsg. + (VasEBoot_util_pull_device): Dont call gettext on already translated + VasEBoot_errmsg. (find_system_device): Remove unused variable. - (grub_util_get_grub_dev): Likewise. - (grub_make_system_path_relative_to_its_root): Respect format security. + (VasEBoot_util_get_VasEBoot_dev): Likewise. + (VasEBoot_make_system_path_relative_to_its_root): Respect format security. 2012-02-10 Vladimir Serbinenko - * util/grub-fstest.c (execute_command): Make first argument + * util/VasEBoot-fstest.c (execute_command): Make first argument a const char *. (read_file): Avoid shadowing. Reuse underlying error message if device open fails. @@ -13617,7 +13617,7 @@ 2012-02-10 Vladimir Serbinenko - * util/grub-mount.c (root): Make const char *. + * util/VasEBoot-mount.c (root): Make const char *. (execute_command): Make first argument a const char *. (fuse_init): Respect format security. (argp_parser): Make static. Remove unused variable. @@ -13626,43 +13626,43 @@ 2012-02-10 Vladimir Serbinenko - * util/grub-probe.c (probe): Don't call gettext on already translated - grub_errmsg. + * util/VasEBoot-probe.c (probe): Don't call gettext on already translated + VasEBoot_errmsg. Remove unused variables. (argp_parser): Remove unused variable. 2012-02-10 Vladimir Serbinenko - * util/grub-script-check.c (argp_parser): Remove unused variable. + * util/VasEBoot-script-check.c (argp_parser): Remove unused variable. (main): Rename read to curread to avoid shadowing. 2012-02-10 Vladimir Serbinenko - * util/misc.c (grub_util_write_image_at): Fix format specification. - (grub_util_write_image): Likewise. - (grub_script_execute_argument_to_string): Removed (unused). - (grub_script_execute_menuentry): Likewise. - (grub_putchar): Likewise. + * util/misc.c (VasEBoot_util_write_image_at): Fix format specification. + (VasEBoot_util_write_image): Likewise. + (VasEBoot_script_execute_argument_to_string): Removed (unused). + (VasEBoot_script_execute_menuentry): Likewise. + (VasEBoot_putchar): Likewise. 2012-02-10 Vladimir Serbinenko - * include/grub/symbol.h (EXT_C) [GRUB_UTIL]: Removed. - (FUNCTION) [GRUB_UTIL]: Likewise. - (VARIABLE) [GRUB_UTIL]: Likewise. + * include/VasEBoot/symbol.h (EXT_C) [VasEBoot_UTIL]: Removed. + (FUNCTION) [VasEBoot_UTIL]: Likewise. + (VARIABLE) [VasEBoot_UTIL]: Likewise. 2012-02-10 Vladimir Serbinenko - * include/grub/misc.h: Avoid evaluationg NEED_ENABLE_EXECUTE_STACK and - NEED_REGISTER_FRAME_INFO in GRUB_UTIL. + * include/VasEBoot/misc.h: Avoid evaluationg NEED_ENABLE_EXECUTE_STACK and + NEED_REGISTER_FRAME_INFO in VasEBoot_UTIL. 2012-02-10 Vladimir Serbinenko - * grub-core/partmap/bsdlabel.c (iterate_real): Fix freeing of static + * VasEBoot-core/partmap/bsdlabel.c (iterate_real): Fix freeing of static buffer. 2012-02-10 Vladimir Serbinenko - * grub-core/lib/LzmaEnc.c (LzmaEnc_FastPosInit): Made static. + * VasEBoot-core/lib/LzmaEnc.c (LzmaEnc_FastPosInit): Made static. (LzmaEnc_SaveState): Removed (unused). (LzmaEnc_RestoreState): Likewise. (LzmaEnc_InitPriceTables): Made static. @@ -13680,108 +13680,108 @@ 2012-02-10 Vladimir Serbinenko - * grub-core/disk/ldm.c (grub_util_get_ldm): Remove unused variables. - (grub_util_ldm_embed): Likewise. + * VasEBoot-core/disk/ldm.c (VasEBoot_util_get_ldm): Remove unused variables. + (VasEBoot_util_ldm_embed): Likewise. 2012-02-10 Vladimir Serbinenko - * util/grub-editenv.c (print_var): Rename name to varname to + * util/VasEBoot-editenv.c (print_var): Rename name to varname to avoid shadowing. (main): Rename index to curindex to avoid shadowing. Make filename a const char *. 2012-02-10 Vladimir Serbinenko - * grub-core/script/lexer.c (grub_script_lexer_init): Rename getline + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_init): Rename getline to arg_getline to avoid shadowing. 2012-02-10 Vladimir Serbinenko - * grub-core/partmap/gpt.c (gpt_partition_map_embed): Rename disk to + * VasEBoot-core/partmap/gpt.c (gpt_partition_map_embed): Rename disk to disk_ to avoid shadowing. 2012-02-10 Vladimir Serbinenko - * grub-core/lib/LzFind.c (MatchFinder_GetIndexByte): Rename index to + * VasEBoot-core/lib/LzFind.c (MatchFinder_GetIndexByte): Rename index to curindex to avoid shadowing. Make static. (MatchFinder_GetNumAvailableBytes): Make static. 2012-02-10 Vladimir Serbinenko - * grub-core/fs/squash4.c (direct_read): Rename read to curread to + * VasEBoot-core/fs/squash4.c (direct_read): Rename read to curread to avoid shadowing. 2012-02-10 Vladimir Serbinenko - * grub-core/disk/cryptodisk.c (grub_cryptodisk_endecrypt): Rename + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_cryptodisk_endecrypt): Rename argument from encrypt to do_encrypt to avoid shadowing. 2012-02-09 Vladimir Serbinenko - * grub-core/loader/multiboot_elfxx.c (grub_multiboot_load_elf): Fix + * VasEBoot-core/loader/multiboot_elfxx.c (VasEBoot_multiboot_load_elf): Fix incorrect nesting of #if's. 2012-02-09 Vladimir Serbinenko - * grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): #if'-out the + * VasEBoot-core/commands/lsacpi.c (disp_acpi_xsdt_table): #if'-out the checks which are always false on some platforms. - (grub_cmd_lsacpi): Likewise. - * grub-core/kern/misc.c (grub_strtoul): Likewise. - * grub-core/loader/multiboot.c (grub_multiboot_set_video_mode): + (VasEBoot_cmd_lsacpi): Likewise. + * VasEBoot-core/kern/misc.c (VasEBoot_strtoul): Likewise. + * VasEBoot-core/loader/multiboot.c (VasEBoot_multiboot_set_video_mode): Likewise. 2012-02-09 Vladimir Serbinenko - * grub-core/disk/diskfilter.c (read_segment): Renome unreachable code. - * grub-core/net/ip.c (grub_net_recv_ip4_packets): Likewise. + * VasEBoot-core/disk/diskfilter.c (read_segment): Renome unreachable code. + * VasEBoot-core/net/ip.c (VasEBoot_net_recv_ip4_packets): Likewise. 2012-02-09 Vladimir Serbinenko - * grub-core/gnulib/regex.h (re_pattern_buffer): Declare buffer as + * VasEBoot-core/gnulib/regex.h (re_pattern_buffer): Declare buffer as re_dfa_t to avoid breaking alignment invariants. - * grub-core/gnulib/regex_internal.h (re_dfa_t): Moved to ... - * grub-core/gnulib/regex.h (re_dfa_t): ... here. + * VasEBoot-core/gnulib/regex_internal.h (re_dfa_t): Moved to ... + * VasEBoot-core/gnulib/regex.h (re_dfa_t): ... here. 2012-02-09 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (grub_xnu_boot): Fix printf. - * grub-core/loader/ia64/efi/linux.c (grub_cmd_fpswa): Likewise. + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_xnu_boot): Fix printf. + * VasEBoot-core/loader/ia64/efi/linux.c (VasEBoot_cmd_fpswa): Likewise. 2012-02-09 Vladimir Serbinenko - * grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_init): + * VasEBoot-core/kern/i386/qemu/mmap.c (VasEBoot_machine_mmap_init): Fix declaration. 2012-02-09 Vladimir Serbinenko - * grub-core/bus/usb/ehci.c (grub_ehci_ehcc_read32): Restructure to + * VasEBoot-core/bus/usb/ehci.c (VasEBoot_ehci_ehcc_read32): Restructure to conserve alignment invariants. - (grub_ehci_ehcc_read16): Likewise. - (grub_ehci_oper_read32): Likewise. - (grub_ehci_oper_write32): Likewise. - (grub_ehci_pci_iter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. + (VasEBoot_ehci_ehcc_read16): Likewise. + (VasEBoot_ehci_oper_read32): Likewise. + (VasEBoot_ehci_oper_write32): Likewise. + (VasEBoot_ehci_pci_iter) [!VasEBoot_HAVE_UNALIGNED_ACCESS]: Check alignment. Conserve alignment invariants. 2012-02-09 Vladimir Serbinenko - * grub-core/kern/emu/full.c (grub_emu_post_init): Remove raid reinit. - * include/grub/disk.h [GRUB_MACHINE_EMU]: Remove now useless LVM/RAID + * VasEBoot-core/kern/emu/full.c (VasEBoot_emu_post_init): Remove raid reinit. + * include/VasEBoot/disk.h [VasEBoot_MACHINE_EMU]: Remove now useless LVM/RAID declarations. 2012-02-09 Vladimir Serbinenko - * grub-core/kern/emu/hostfs.c (grub_hostfs_close): + * VasEBoot-core/kern/emu/hostfs.c (VasEBoot_hostfs_close): Remove unused variable. 2012-02-09 Vladimir Serbinenko - * grub-core/efiemu/loadcore_common.c (grub_efiemu_loadcore_load): + * VasEBoot-core/efiemu/loadcore_common.c (VasEBoot_efiemu_loadcore_load): Remove set in if. 2012-02-09 Vladimir Serbinenko - * include/grub/net.h: Remove double declarations. + * include/VasEBoot/net.h: Remove double declarations. 2012-02-09 Vladimir Serbinenko @@ -13789,7 +13789,7 @@ find any evidence of it being used for anything. Replace "relocate" command with an environment variable - * grub-core/loader/ia64/efi/linux.c (ia64_boot_param): Remove extra + * VasEBoot-core/loader/ia64/efi/linux.c (ia64_boot_param): Remove extra fields. (ia64_boot_payload): Removed. (last_payload): Likewise. @@ -13798,41 +13798,41 @@ (RELOCATE_FORCE): Likewise. (relocate): Likewise. (free_pages): Don't free payloads. - (grub_load_elf64): Use common error messages. + (VasEBoot_load_elf64): Use common error messages. Use "linux_relocate" variable. Increase the space after boot_params. - (grub_cmd_payload): Removed. - (grub_cmd_relocate): Likewise. - (grub_cmd_fpswa): Improve messages. + (VasEBoot_cmd_payload): Removed. + (VasEBoot_cmd_relocate): Likewise. + (VasEBoot_cmd_fpswa): Improve messages. (cmd_payload): Removed. (cmd_relocate): Likewise. - (GRUB_MOD_INIT): Don't register "payload" and "relocate". - (GRUB_MOD_FINI): Don't unregister "payload" and "relocate". + (VasEBoot_MOD_INIT): Don't register "payload" and "relocate". + (VasEBoot_MOD_FINI): Don't unregister "payload" and "relocate". 2012-02-09 Vladimir Serbinenko Convert UHCI to DMA framework. - * grub-core/bus/usb/uhci.c (grub_uhci): Add chunk and phys members. - (grub_uhci_pci_iter): Fill new members - (grub_alloc_td): Use P2V and V2P functions. - (grub_free_queue): Likewise. - (grub_alloc_qh): Likewise. - (grub_uhci_setup_transfer): Likewise. - (grub_uhci_check_transfer): Likewise. + * VasEBoot-core/bus/usb/uhci.c (VasEBoot_uhci): Add chunk and phys members. + (VasEBoot_uhci_pci_iter): Fill new members + (VasEBoot_alloc_td): Use P2V and V2P functions. + (VasEBoot_free_queue): Likewise. + (VasEBoot_alloc_qh): Likewise. + (VasEBoot_uhci_setup_transfer): Likewise. + (VasEBoot_uhci_check_transfer): Likewise. 2012-02-09 Vladimir Serbinenko - * grub-core/video/colors.c (grub_video_parse_color): Fix error message. + * VasEBoot-core/video/colors.c (VasEBoot_video_parse_color): Fix error message. Remove assignment in if while on it. 2012-02-09 Vladimir Serbinenko - * util/grub-mkstandalone.in: Fix modules directory. + * util/VasEBoot-mkstandalone.in: Fix modules directory. 2012-02-09 Vladimir Serbinenko - * util/grub-mkimage.c (image_targets): Set default_compression to lzma + * util/VasEBoot-mkimage.c (image_targets): Set default_compression to lzma on i386-pc target. (argp_parser): Accept "auto" as compression specification. @@ -13840,48 +13840,48 @@ Fix `help' with unloaded modules. - * include/grub/normal.h (grub_dyncmd_get_cmd): New proto. - * grub-core/normal/dyncmd.c (grub_dyncmd_get_cmd): New function. - (grub_dyncmd_dispatcher): Small stylistic fix. - * grub-core/commands/help.c (grub_cmd_help): Load missing modules when + * include/VasEBoot/normal.h (VasEBoot_dyncmd_get_cmd): New proto. + * VasEBoot-core/normal/dyncmd.c (VasEBoot_dyncmd_get_cmd): New function. + (VasEBoot_dyncmd_dispatcher): Small stylistic fix. + * VasEBoot-core/commands/help.c (VasEBoot_cmd_help): Load missing modules when explicit help is requested. 2012-02-09 Vladimir Serbinenko - * grub-core/fs/cpio.c (grub_cpio_dir): Fix a bug with multiple listing. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_dir): Fix a bug with multiple listing. Explicitly init restart while on it. 2012-02-09 Vladimir Serbinenko - * grub-core/lib/posix_wrap/wchar.h (mbrtowc): Set pwc to zero to avoid + * VasEBoot-core/lib/posix_wrap/wchar.h (mbrtowc): Set pwc to zero to avoid uninited variable. 2012-02-08 Vladimir Serbinenko - * util/grub-mknetdir.in: Use . rather than source for POSIX + * util/VasEBoot-mknetdir.in: Use . rather than source for POSIX compatibility. 2012-02-08 Vladimir Serbinenko - * util/grub-probe.c (main): Fix trailing space in compatibility hint. + * util/VasEBoot-probe.c (main): Fix trailing space in compatibility hint. 2012-02-08 Vladimir Serbinenko - * grub-core/kern/partition.c (grub_partition_get_name): Fix uninited + * VasEBoot-core/kern/partition.c (VasEBoot_partition_get_name): Fix uninited variable. 2012-02-08 Vladimir Serbinenko - * grub-core/commands/hdparm.c (grub_cmd_hdparm): Accept device name + * VasEBoot-core/commands/hdparm.c (VasEBoot_cmd_hdparm): Accept device name without quotes. 2012-02-08 Vladimir Serbinenko - * grub-core/net/net.c (GRUB_MOD_INIT): Don't register netfs. + * VasEBoot-core/net/net.c (VasEBoot_MOD_INIT): Don't register netfs. 2012-02-08 Vladimir Serbinenko - * grub-core/kern/partition.c (grub_partition_get_name): Fix reverse + * VasEBoot-core/kern/partition.c (VasEBoot_partition_get_name): Fix reverse iteration of partitions. 2012-02-08 Vladimir Serbinenko @@ -13891,48 +13891,48 @@ 2012-02-07 Vladimir Serbinenko - * grub-core/lib/i386/relocator16.S: Revert moving A20 code into PM + * VasEBoot-core/lib/i386/relocator16.S: Revert moving A20 code into PM part. Instead setup the correct stack in RM. - * grub-core/lib/i386/relocator.c (grub_relocator16_boot): Reserve place + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator16_boot): Reserve place for stack. - * include/grub/i386/relocator_private.h: New file. + * include/VasEBoot/i386/relocator_private.h: New file. 2012-02-05 Vladimir Serbinenko - * grub-core/commands/minicmd.c (GRUB_MOD_INIT): Add missing SIZE + * VasEBoot-core/commands/minicmd.c (VasEBoot_MOD_INIT): Add missing SIZE argument. - * util/grub-fstest.c (options): Add missing DEVICE part. + * util/VasEBoot-fstest.c (options): Add missing DEVICE part. 2012-02-05 Vladimir Serbinenko Clarify and unify messages. - * grub-core/commands/hashsum.c (options): Unify messages. - * grub-core/commands/keystatus.c (GRUB_MOD_INIT): Don't mark a + * VasEBoot-core/commands/hashsum.c (options): Unify messages. + * VasEBoot-core/commands/keystatus.c (VasEBoot_MOD_INIT): Don't mark a literal-only message as translatable. - * grub-core/commands/lsacpi.c (GRUB_MOD_INIT): Likewise. - * grub-core/loader/ia64/efi/linux.c (GRUB_MOD_INIT): Likewise. - * grub-core/commands/legacycfg.c (GRUB_MOD_INIT): Add quoting around + * VasEBoot-core/commands/lsacpi.c (VasEBoot_MOD_INIT): Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c (VasEBoot_MOD_INIT): Likewise. + * VasEBoot-core/commands/legacycfg.c (VasEBoot_MOD_INIT): Add quoting around commands. - * grub-core/commands/menuentry.c (options): Clarify that it's a keyboard + * VasEBoot-core/commands/menuentry.c (options): Clarify that it's a keyboard key, not the key used to unlock. Clarify what it's used for. - * grub-core/kern/emu/hostdisk.c (read_device_map): Unify error message. - * grub-core/loader/xnu.c (grub_xnu_load_driver): Remove erroneous colon. - * grub-core/script/main.c (GRUB_MOD_INIT): Clarify [n] to be [NUM]. - * util/grub-editenv.c (options): Unify "verbose" message. - * util/grub-fstest.c (read_file): Unify error message. + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Unify error message. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_load_driver): Remove erroneous colon. + * VasEBoot-core/script/main.c (VasEBoot_MOD_INIT): Clarify [n] to be [NUM]. + * util/VasEBoot-editenv.c (options): Unify "verbose" message. + * util/VasEBoot-fstest.c (read_file): Unify error message. (fstest): Add quotes around commands. (options): Unify "verbose" message. - * util/grub-install.in: Add quotes around variable name. - * util/grub-kbdcomp.in: Unify error message. - * util/grub-mkfont.c (main): Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mklayout.c (options): Unify "verbose" message. - * util/grub-mkstandalone.in: Unify help and verbose messages. - * util/grub-mount.c (options): Unify "verbose" message. - * util/grub-probe.c (options): Likewise. - * util/grub-script-check.c (options): Likewise. - * util/grub-setup.c (setup): Unify no-terminator message. + * util/VasEBoot-install.in: Add quotes around variable name. + * util/VasEBoot-kbdcomp.in: Unify error message. + * util/VasEBoot-mkfont.c (main): Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mklayout.c (options): Unify "verbose" message. + * util/VasEBoot-mkstandalone.in: Unify help and verbose messages. + * util/VasEBoot-mount.c (options): Unify "verbose" message. + * util/VasEBoot-probe.c (options): Likewise. + * util/VasEBoot-script-check.c (options): Likewise. + * util/VasEBoot-setup.c (setup): Unify no-terminator message. (options): Use DEVICE and not DEV. Unify "verbose" message. * util/ieee1275/ofpath.c (xrealpath): Unify error message. @@ -13941,115 +13941,115 @@ Improve and unify messages. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Add argument + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors): Add argument name. All users updated. Print filename in error. (read_device_map): Print filename in error. - * util/getroot.c (grub_guess_root_devices): Print filename in error. - (grub_util_get_os_disk): Likewise. - (grub_util_biosdisk_get_grub_dev): Likewise. - (grub_util_check_block_device): Likewise. - (grub_util_check_char_device): Likewise. - (grub_make_system_path_relative_to_its_root): Likewise. - * util/grub-editenv.c (create_envblk_file): Likewise. + * util/getroot.c (VasEBoot_guess_root_devices): Print filename in error. + (VasEBoot_util_get_os_disk): Likewise. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Likewise. + (VasEBoot_util_check_block_device): Likewise. + (VasEBoot_util_check_char_device): Likewise. + (VasEBoot_make_system_path_relative_to_its_root): Likewise. + * util/VasEBoot-editenv.c (create_envblk_file): Likewise. (open_envblk_file): Likewise. (write_envblk): Likewise. - * util/grub-fstest.c (cmd_cp): Likewise. + * util/VasEBoot-fstest.c (cmd_cp): Likewise. (cmd_cat): Likewise. (cmd_cmp): Likewise. - * util/grub-menulst2cfg.c (main): Likewise. - * util/grub-mkfont.c (write_font_ascii_bitmap): Likewise. + * util/VasEBoot-menulst2cfg.c (main): Likewise. + * util/VasEBoot-mkfont.c (write_font_ascii_bitmap): Likewise. (write_font_width_spec): Likewise. (write_font_pf2): Likewise. - * util/grub-mkimage.c (generate_image): New argument outname. + * util/VasEBoot-mkimage.c (generate_image): New argument outname. All users updated. Remove unreacheable message. (options): Unify messages. (help_filter): Likewise. - * util/grub-mklayout.c (usage): Removed (unused). + * util/VasEBoot-mklayout.c (usage): Removed (unused). (main): Print filename in error. - * util/grub-mkrescue.in: Fix wrong quoting. - * util/grub-setup.c (setup): Print filename in error. + * util/VasEBoot-mkrescue.in: Fix wrong quoting. + * util/VasEBoot-setup.c (setup): Print filename in error. * util/ieee1275/ofpath.c (vendor_is_ATA): Likewise. (check_sas): Likewise. - * util/misc.c (grub_util_get_fp_size): Removed. - (grub_util_get_image_size): Print filename in error. - (grub_util_read_at): Removed. - (grub_util_read_image): Print filename in error. - (grub_util_load_image): Likewise. - (grub_util_write_image_at): New argument filename. All users updated. + * util/misc.c (VasEBoot_util_get_fp_size): Removed. + (VasEBoot_util_get_image_size): Print filename in error. + (VasEBoot_util_read_at): Removed. + (VasEBoot_util_read_image): Print filename in error. + (VasEBoot_util_load_image): Likewise. + (VasEBoot_util_write_image_at): New argument filename. All users updated. Print filename in error. - (grub_util_write_image): New argument filename. All users updated. + (VasEBoot_util_write_image): New argument filename. All users updated. Print filename in error. - * util/raid.c (grub_util_raid_getmembers): Print filename in error. - * util/resolve.c (grub_util_resolve_dependencies): Likewise. + * util/raid.c (VasEBoot_util_raid_getmembers): Print filename in error. + * util/resolve.c (VasEBoot_util_resolve_dependencies): Likewise. 2012-02-05 Vladimir Serbinenko - * grub-core/Makefile.core.def (pxechain): New module. - * grub-core/loader/i386/pc/pxechainloader.c: New file. - * grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_get_cached): New + * VasEBoot-core/Makefile.core.def (pxechain): New module. + * VasEBoot-core/loader/i386/pc/pxechainloader.c: New file. + * VasEBoot-core/net/drivers/i386/pc/pxe.c (VasEBoot_pxe_get_cached): New function. - (grub_pc_net_config_real): Use grub_pxe_get_cached. - * include/grub/i386/pc/pxe.h (grub_pxe_get_cached): New proto. + (VasEBoot_pc_net_config_real): Use VasEBoot_pxe_get_cached. + * include/VasEBoot/i386/pc/pxe.h (VasEBoot_pxe_get_cached): New proto. 2012-02-05 Vladimir Serbinenko - * grub-core/kern/err.c (GRUB_MAX_ERRMSG): Move to ... - * include/grub/err.h (GRUB_MAX_ERRMSG): ... here. - * include/grub/err.h (grub_error_saved): New struct. - (grub_errmsg): Make array size explicit. - * include/grub/misc.h (grub_error_save): New function. - (grub_error_load): Likewise. - * grub-core/kern/err.c (grub_error_stack_items): Use grub_error_saved. - (grub_error_push): Update `errno' member name. - (grub_error_pop): Likewise - * grub-core/net/tftp.c (tftp_data): New member save_err. + * VasEBoot-core/kern/err.c (VasEBoot_MAX_ERRMSG): Move to ... + * include/VasEBoot/err.h (VasEBoot_MAX_ERRMSG): ... here. + * include/VasEBoot/err.h (VasEBoot_error_saved): New struct. + (VasEBoot_errmsg): Make array size explicit. + * include/VasEBoot/misc.h (VasEBoot_error_save): New function. + (VasEBoot_error_load): Likewise. + * VasEBoot-core/kern/err.c (VasEBoot_error_stack_items): Use VasEBoot_error_saved. + (VasEBoot_error_push): Update `errno' member name. + (VasEBoot_error_pop): Likewise + * VasEBoot-core/net/tftp.c (tftp_data): New member save_err. (tftp_receive): Save error. (tftp_open): Restore error. 2012-02-05 Vladimir Serbinenko - * grub-core/lib/i386/relocator16.S (grub_relocator16_start): Move switch + * VasEBoot-core/lib/i386/relocator16.S (VasEBoot_relocator16_start): Move switch to real mode down to execute A20-related code in protected mode as intended. 2012-02-05 Grégoire Sutre - * grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Return + * VasEBoot-core/disk/diskfilter.c (VasEBoot_diskfilter_make_raid): Return NULL when the argument `level' has an unexpected value. 2012-02-04 Vladimir Serbinenko Move platform-dependent files from $prefix to $prefix/$platform. - * config.h.in (GRUB_TARGET_CPU): New definition. - (GRUB_PLATFORM): Likewise. - * configure.ac: Define GRUB_TARGET_CPU and GRUB_PLATFORM. - * grub-core/commands/parttool.c (grub_cmd_parttool): Update dir. - * grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise. - * grub-core/kern/dl.c (grub_dl_load): Likewise. - * grub-core/normal/autofs.c (read_fs_list): Likewise. - * grub-core/normal/crypto.c (read_crypto_list): Likewise. - * grub-core/normal/dyncmd.c (read_command_list): Likewise. - * grub-core/normal/term.c (read_terminal_list): Likewise. - * grub-core/gettext/gettext.c (grub_mofile_open_lang): Use + * config.h.in (VasEBoot_TARGET_CPU): New definition. + (VasEBoot_PLATFORM): Likewise. + * configure.ac: Define VasEBoot_TARGET_CPU and VasEBoot_PLATFORM. + * VasEBoot-core/commands/parttool.c (VasEBoot_cmd_parttool): Update dir. + * VasEBoot-core/efiemu/main.c (VasEBoot_efiemu_autocore): Likewise. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_load): Likewise. + * VasEBoot-core/normal/autofs.c (read_fs_list): Likewise. + * VasEBoot-core/normal/crypto.c (read_crypto_list): Likewise. + * VasEBoot-core/normal/dyncmd.c (read_command_list): Likewise. + * VasEBoot-core/normal/term.c (read_terminal_list): Likewise. + * VasEBoot-core/gettext/gettext.c (VasEBoot_mofile_open_lang): Use $prefix/locale. - (grub_gettext_init_ext): Likewise. - * grub-core/normal/main.c (GRUB_MOD_INIT): Define grub_cpu and - grub_platform. - * util/grub-install.in: Update directories. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. + (VasEBoot_gettext_init_ext): Likewise. + * VasEBoot-core/normal/main.c (VasEBoot_MOD_INIT): Define VasEBoot_cpu and + VasEBoot_platform. + * util/VasEBoot-install.in: Update directories. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. 2012-02-04 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_claimmap): Change to - grub_error framework. All users updated. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_claimmap): Change to + VasEBoot_error framework. All users updated. 2012-02-04 Vladimir Serbinenko - * grub-core/gettext/gettext.c: Mostly rewritten to avoid using + * VasEBoot-core/gettext/gettext.c: Mostly rewritten to avoid using lists (by always binsearching), improve caching (cache strings used for binsearch, not only results), improve maintainability (by using more structured binary search) and correct @@ -14057,203 +14057,203 @@ 2012-02-04 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_return): Fix warning. + * VasEBoot-core/script/execute.c (VasEBoot_script_return): Fix warning. 2012-02-04 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_return): Fix potential + * VasEBoot-core/script/execute.c (VasEBoot_script_return): Fix potential NULL-dereference. Reported by: Jim Meyering. 2012-02-03 Vladimir Serbinenko * po/POTFILES.in: Regenerate. - * util/grub-install.in: Gettextize the strings missed in first pass. + * util/VasEBoot-install.in: Gettextize the strings missed in first pass. 2012-02-03 Vladimir Serbinenko - * Makefile.util.def (grub-mkdevicemap): Removed. - * include/grub/emu/hostdisk.h (grub_util_get_os_disk): New proto. - * include/grub/util/deviceiter.h: Removed. + * Makefile.util.def (VasEBoot-mkdevicemap): Removed. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_get_os_disk): New proto. + * include/VasEBoot/util/deviceiter.h: Removed. * util/deviceiter.c: Likewise. - * util/getroot.c (grub_util_get_os_disk): New function. - * util/grub-install.in: Remove grub-mkdevicemap. Use -t disk as + * util/getroot.c (VasEBoot_util_get_os_disk): New function. + * util/VasEBoot-install.in: Remove VasEBoot-mkdevicemap. Use -t disk as replacement for EFI. - * util/grub-mkdevicemap.c: Removed. - * util/grub-probe.c (probe): Handle PRINT_DISK. + * util/VasEBoot-mkdevicemap.c: Removed. + * util/VasEBoot-probe.c (probe): Handle PRINT_DISK. (argp_parser): Handle -t disk. 2012-02-03 Vladimir Serbinenko - * util/grub-mkfont.c: Migrate to argp. - * util/grub-mklayout.c: Likewise. - * util/grub-mkpasswd-pbkdf2.c: Likewise. - * util/grub-mkrelpath.c: Likewise. - * util/grub-probe.c: Likewise. - * util/grub-script-check.c: Likewise. + * util/VasEBoot-mkfont.c: Migrate to argp. + * util/VasEBoot-mklayout.c: Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c: Likewise. + * util/VasEBoot-mkrelpath.c: Likewise. + * util/VasEBoot-probe.c: Likewise. + * util/VasEBoot-script-check.c: Likewise. 2012-02-03 Vladimir Serbinenko - * util/grub-reboot.in: Add missing datarootdir. + * util/VasEBoot-reboot.in: Add missing datarootdir. Add missing newline. - * util/grub-set-default.in: Add missing datarootdir. - * util/powerpc/ieee1275/grub-mkrescue.in: Add missing newline. - * util/grub-mkrescue.in: Likewise. + * util/VasEBoot-set-default.in: Add missing datarootdir. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Add missing newline. + * util/VasEBoot-mkrescue.in: Likewise. 2012-02-03 Vladimir Serbinenko - * util/grub.d/30_os-prober.in: Fix TRANSLATORS comment. + * util/VasEBoot.d/30_os-prober.in: Fix TRANSLATORS comment. 2012-02-03 Vladimir Serbinenko - * util/grub-kbdcomp.in: Add decent help and gettextize. - * docs/man/grub-kbdcomp.h2m: New file. + * util/VasEBoot-kbdcomp.in: Add decent help and gettextize. + * docs/man/VasEBoot-kbdcomp.h2m: New file. 2012-02-03 Vladimir Serbinenko - Migrate grub-mkimage.c to argp. + Migrate VasEBoot-mkimage.c to argp. - * Makefile.util.def (grub-mkimage): Add util/argp_common.c. - (grub-setup): Likewise. - * util/grub-setup.c (print_version): Move to ... + * Makefile.util.def (VasEBoot-mkimage): Add util/argp_common.c. + (VasEBoot-setup): Likewise. + * util/VasEBoot-setup.c (print_version): Move to ... * util/argp_common.c (print_version): ... here. - * util/grub-setup.c (argp_program_version_hook): Move to ... + * util/VasEBoot-setup.c (argp_program_version_hook): Move to ... * util/argp_common.c (argp_program_version_hook): ... here. - * util/grub-setup.c (argp_parser): Add exit (1) on fatal error for + * util/VasEBoot-setup.c (argp_parser): Add exit (1) on fatal error for safety. - * util/grub-mkimage.c (main): Migrate to argp. + * util/VasEBoot-mkimage.c (main): Migrate to argp. 2012-02-03 Vladimir Serbinenko - * util/grub-mkrescue.in: Use same message as - util/powerpc/ieee1275/grub-mkrescue.in with %s in place of command + * util/VasEBoot-mkrescue.in: Use same message as + util/powerpc/ieee1275/VasEBoot-mkrescue.in with %s in place of command for better translations. 2012-02-03 Vladimir Serbinenko - * util/powerpc/ieee1275/grub-mkrescue.in: Gettextize. Unify the command - options with generic grub-mkrescue.in with the goal of future + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Gettextize. Unify the command + options with generic VasEBoot-mkrescue.in with the goal of future merge. 2012-02-03 Vladimir Serbinenko - * grub-core/kern/mm.c: Add missing include of i18n.h - * grub-core/lib/relocator.c: Likewise. + * VasEBoot-core/kern/mm.c: Add missing include of i18n.h + * VasEBoot-core/lib/relocator.c: Likewise. 2012-02-03 Vladimir Serbinenko - * grub-core/loader/ia64/efi/linux.c (find_mmap_size): Replace fatal with + * VasEBoot-core/loader/ia64/efi/linux.c (find_mmap_size): Replace fatal with error. (allocate_pages): Check return value. Replace fatal with error. - (grub_linux_boot): Replace printf with dprintf. + (VasEBoot_linux_boot): Replace printf with dprintf. Check find_mmap_size return value. Replace fatal with error. - Don't call grub_machine_fini. - (grub_load_elf64): Replace printf with dprintf. - (grub_cmd_linux): Likewise. - (grub_cmd_initrd): Likewise. - (grub_cmd_payload): Likewise. + Don't call VasEBoot_machine_fini. + (VasEBoot_load_elf64): Replace printf with dprintf. + (VasEBoot_cmd_linux): Likewise. + (VasEBoot_cmd_initrd): Likewise. + (VasEBoot_cmd_payload): Likewise. 2012-02-03 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (grub_cmd_devprop_load): Fix error + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_cmd_devprop_load): Fix error message. - * grub-core/video/radeon_fuloong2e.c - (grub_video_radeon_fuloong2e_setup): Likewise. - * grub-core/video/sis315pro.c (grub_video_sis315pro_setup): Likewise. - * grub-core/video/video.c (grub_video_set_mode): Don't override + * VasEBoot-core/video/radeon_fuloong2e.c + (VasEBoot_video_radeon_fuloong2e_setup): Likewise. + * VasEBoot-core/video/sis315pro.c (VasEBoot_video_sis315pro_setup): Likewise. + * VasEBoot-core/video/video.c (VasEBoot_video_set_mode): Don't override standard out of memory message. 2012-02-03 Grégoire Sutre NetBSD disk wedge support. - * grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start) + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_hostdisk_find_partition_start) [__NetBSD__]: Handle NetBSD disk wedges. * util/getroot.c (convert_system_partition_to_system_disk) [__NetBSD__]: Likewise. 2012-02-03 Mark Wooding - * util/grub-mkconfig.in: Use umask rather than chmod to create - grub.cfg.new to avoid insecure grub.cfg. + * util/VasEBoot-mkconfig.in: Use umask rather than chmod to create + VasEBoot.cfg.new to avoid insecure VasEBoot.cfg. 2012-02-03 Vladimir Serbinenko - * grub-core/commands/ls.c: Gettextize. - * grub-core/commands/setpci.c: Likewise. - * grub-core/commands/videotest.c: Likewise. - * grub-core/disk/geli.c: Likewise. - * grub-core/kern/mm.c: Likewise. - * grub-core/lib/relocator.c: Likewise. - * grub-core/loader/efi/appleloader.c: Likewise. - * grub-core/loader/i386/xnu.c: Likewise. - * grub-core/loader/ia64/efi/linux.c: Likewise. - * grub-core/loader/xnu.c: Likewise. - * grub-core/net/dns.c: Likewise. - * grub-core/net/net.c: Likewise. - * grub-core/script/lexer.c: Likewise. - * grub-core/script/parser.y: Likewise. - * grub-core/script/yylex.l: Likewise. + * VasEBoot-core/commands/ls.c: Gettextize. + * VasEBoot-core/commands/setpci.c: Likewise. + * VasEBoot-core/commands/videotest.c: Likewise. + * VasEBoot-core/disk/geli.c: Likewise. + * VasEBoot-core/kern/mm.c: Likewise. + * VasEBoot-core/lib/relocator.c: Likewise. + * VasEBoot-core/loader/efi/appleloader.c: Likewise. + * VasEBoot-core/loader/i386/xnu.c: Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c: Likewise. + * VasEBoot-core/loader/xnu.c: Likewise. + * VasEBoot-core/net/dns.c: Likewise. + * VasEBoot-core/net/net.c: Likewise. + * VasEBoot-core/script/lexer.c: Likewise. + * VasEBoot-core/script/parser.y: Likewise. + * VasEBoot-core/script/yylex.l: Likewise. * util/getroot.c: Likewise. - * util/grub-setup.c: Likewise. + * util/VasEBoot-setup.c: Likewise. 2012-02-03 Vladimir Serbinenko - * grub-core/fs/reiserfs.c (grub_reiserfs_get_item): Use proper error + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_get_item): Use proper error number. 2012-02-03 Vladimir Serbinenko - * grub-core/disk/ldm.c (grub_util_ldm_embed): Correct error message. + * VasEBoot-core/disk/ldm.c (VasEBoot_util_ldm_embed): Correct error message. 2012-02-03 Vladimir Serbinenko - * grub-core/commands/search_file.c (SEARCH_TARGET): Remove obsolete + * VasEBoot-core/commands/search_file.c (SEARCH_TARGET): Remove obsolete macro. - * grub-core/commands/search_label.c (SEARCH_TARGET): Likewise. - * grub-core/commands/search_uuid.c (SEARCH_TARGET): Likewise. + * VasEBoot-core/commands/search_label.c (SEARCH_TARGET): Likewise. + * VasEBoot-core/commands/search_uuid.c (SEARCH_TARGET): Likewise. 2012-02-03 Vladimir Serbinenko - * util/grub-mkstandalone.in: Fix help messages. Gettextize. - * util/grub-install.in: Gettextize. - * util/grub-mkconfig.in: Likewise. - * util/grub-mkconfig_lib.in: Replace gettext with echo -n and not echo + * util/VasEBoot-mkstandalone.in: Fix help messages. Gettextize. + * util/VasEBoot-install.in: Gettextize. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mkconfig_lib.in: Replace gettext with echo -n and not echo if not available. - (grub_warn): Gettextize. - * util/grub-mknetdir.in: Gettextize. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. + (VasEBoot_warn): Gettextize. + * util/VasEBoot-mknetdir.in: Gettextize. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. * po/POTFILES-shell.in: Regenerate. 2012-02-03 Richard Laager - * util/grub-mkimage.c (main): Fix format-security warning. - * util/grub-mkrelpath.c (main): Likewise. - * util/grub-probe.c (main): Likewise. + * util/VasEBoot-mkimage.c (main): Fix format-security warning. + * util/VasEBoot-mkrelpath.c (main): Likewise. + * util/VasEBoot-probe.c (main): Likewise. 2012-02-03 Richard Laager - * util/grub-probe.c (probe): Don't crash on canonicalize_file_name + * util/VasEBoot-probe.c (probe): Don't crash on canonicalize_file_name failure. Put back lost PRINT_DRIVE. 2012-02-03 Richard Laager * util/getroot.c (find_root_devices_from_libzfs): Fix compilation error. - (grub_guess_root_devices): Replace strlen with sizeof. + (VasEBoot_guess_root_devices): Replace strlen with sizeof. Avoid crash. (find_root_devices_from_poolname): Remove unused variable. Handle raidzN. @@ -14262,24 +14262,24 @@ Support install on multi-device filesystems. - * include/grub/emu/getroot.h (grub_guess_root_device): Renamed to ... - (grub_guess_root_devices): ...this. Return char **. All users updated. - * include/grub/emu/misc.h (grub_find_root_device_from_mountinfo): + * include/VasEBoot/emu/getroot.h (VasEBoot_guess_root_device): Renamed to ... + (VasEBoot_guess_root_devices): ...this. Return char **. All users updated. + * include/VasEBoot/emu/misc.h (VasEBoot_find_root_device_from_mountinfo): Removed. * util/getroot.c (find_root_device_from_libzfs): Moved pool logic to ... (find_root_devices_from_poolname): ... here. - (grub_find_root_devices_from_mountinfo): Return char **. Make static. + (VasEBoot_find_root_devices_from_mountinfo): Return char **. Make static. Support zfs-fuse. - (grub_guess_root_device): Rename to ... - (grub_guess_root_devices): ... this. Return char **. All users updated. - * util/grub-install.in: Handle multi-device filesystems. - * util/grub-probe.c (probe). Make device_names a char **. Add delim + (VasEBoot_guess_root_device): Rename to ... + (VasEBoot_guess_root_devices): ... this. Return char **. All users updated. + * util/VasEBoot-install.in: Handle multi-device filesystems. + * util/VasEBoot-probe.c (probe). Make device_names a char **. Add delim argument. All users updated. Handle multi-device filesystems. Use 'delim' as separator. Remove device check to allow filesystems on file. (main): Support -0 argument. Handle multi-device. - * util/grub-setup.c (setup): Remove root argument. Handle multi-device. + * util/VasEBoot-setup.c (setup): Remove root argument. Handle multi-device. Fix a cross-device check while on it. (arguments): Remove root_dev. (argp_parser): Remove -r. @@ -14287,11 +14287,11 @@ 2012-02-01 Vladimir Serbinenko - * grub-core/fs/zfs/zfscrypt.c: Add link to documentation. + * VasEBoot-core/fs/zfs/zfscrypt.c: Add link to documentation. 2012-02-01 Vladimir Serbinenko - * grub-core/commands/videotest.c (grub_cmd_videotest): Fix subset + * VasEBoot-core/commands/videotest.c (VasEBoot_cmd_videotest): Fix subset symbol. Reported by: NODA, Kai . @@ -14299,45 +14299,45 @@ Fix ehci on amd64. - * grub-core/bus/usb/usbhub.c (grub_usb_hub_add_dev): Use %p to print + * VasEBoot-core/bus/usb/usbhub.c (VasEBoot_usb_hub_add_dev): Use %p to print pointers. - * grub-core/bus/usb/ehci.c (grub_ehci_pci_iter): Likewise. - (grub_ehci_setup_qh): Likewise. - (grub_ehci_find_qh): Likewise. - (grub_ehci_transaction): Likewise. - (grub_ehci_setup_transfer): Likewise. - (grub_ehci_check_transfer): Likewise. - (grub_ehci_portstatus): Likewise. - (grub_ehci_detect_dev): Likewise. - (grub_ehci_transfer_controller_data): New field td_last_phys. - (grub_ehci_setup_transfer): Fill td_last_phys. - (grub_ehci_check_transfer): Use td_last_phys. + * VasEBoot-core/bus/usb/ehci.c (VasEBoot_ehci_pci_iter): Likewise. + (VasEBoot_ehci_setup_qh): Likewise. + (VasEBoot_ehci_find_qh): Likewise. + (VasEBoot_ehci_transaction): Likewise. + (VasEBoot_ehci_setup_transfer): Likewise. + (VasEBoot_ehci_check_transfer): Likewise. + (VasEBoot_ehci_portstatus): Likewise. + (VasEBoot_ehci_detect_dev): Likewise. + (VasEBoot_ehci_transfer_controller_data): New field td_last_phys. + (VasEBoot_ehci_setup_transfer): Fill td_last_phys. + (VasEBoot_ehci_check_transfer): Use td_last_phys. 2012-02-01 Seth Goldberg - * grub-core/normal/context.c (grub_env_extractor_close): Don't crash + * VasEBoot-core/normal/context.c (VasEBoot_env_extractor_close): Don't crash if no submenu is present. 2012-02-01 Aleš Nesrsta CBI support. - * include/grub/usb.h (grub_usbms_protocol_t): New values - GRUB_USBMS_PROTOCOL_CB and GRUB_USBMS_PROTOCOL_CBI. - * grub-core/disk/usbms.c (GRUB_USBMS_CBI_CMD_SIZE): New define. - (GRUB_USBMS_CBI_ADSC_REQ): Likewise. - (grub_usbms_dev): Add subclass, protocol and intrpt. + * include/VasEBoot/usb.h (VasEBoot_usbms_protocol_t): New values + VasEBoot_USBMS_PROTOCOL_CB and VasEBoot_USBMS_PROTOCOL_CBI. + * VasEBoot-core/disk/usbms.c (VasEBoot_USBMS_CBI_CMD_SIZE): New define. + (VasEBoot_USBMS_CBI_ADSC_REQ): Likewise. + (VasEBoot_usbms_dev): Add subclass, protocol and intrpt. Remove in_maxsz and out_maxsz. - (grub_usbms_reset): Rename to ... - (grub_usbms_bo_reset): .. this. - (grub_usbms_cbi_cmd): New function. - (grub_usbms_cbi_reset): Likewise. - (grub_usbms_reset): Likewise. - (grub_usbms_attach): Recognize cbi. Same subclass and protocol. - (grub_usbms_transfer): Rename to ... - (grub_usbms_transfer_bo): ... this. - (grub_usbms_transfer_cbi): Likewise. - (grub_usbms_transfer): Likewise. + (VasEBoot_usbms_reset): Rename to ... + (VasEBoot_usbms_bo_reset): .. this. + (VasEBoot_usbms_cbi_cmd): New function. + (VasEBoot_usbms_cbi_reset): Likewise. + (VasEBoot_usbms_reset): Likewise. + (VasEBoot_usbms_attach): Recognize cbi. Same subclass and protocol. + (VasEBoot_usbms_transfer): Rename to ... + (VasEBoot_usbms_transfer_bo): ... this. + (VasEBoot_usbms_transfer_cbi): Likewise. + (VasEBoot_usbms_transfer): Likewise. 2012-02-01 Aleš Nesrsta 2012-02-01 Vladimir Serbinenko @@ -14345,108 +14345,108 @@ EHCI support. All of the credit goes to Aleš Nesrsta. I've just added the support for the CS5536 modification thereos and few bugfixes. - * grub-core/Makefile.core.def (ehci): New module. - * grub-core/bus/usb/ehci.c: New file. - * grub-core/bus/usb/usbhub.c (grub_usb_hub_add_dev): New arguments + * VasEBoot-core/Makefile.core.def (ehci): New module. + * VasEBoot-core/bus/usb/ehci.c: New file. + * VasEBoot-core/bus/usb/usbhub.c (VasEBoot_usb_hub_add_dev): New arguments port and hubaddr. All users updated. Save port and hubaddr into dev structure. - * include/grub/cs5536.h (GRUB_CS5536_MSR_USB_BASE_SMI_ENABLE): New + * include/VasEBoot/cs5536.h (VasEBoot_CS5536_MSR_USB_BASE_SMI_ENABLE): New define. - * include/grub/pci.h (grub_dma_phys2virt): New function. - (grub_dma_virt2phys): Likewise. - * include/grub/usb.h (grub_usb_device): New members port and hubaddr. + * include/VasEBoot/pci.h (VasEBoot_dma_phys2virt): New function. + (VasEBoot_dma_virt2phys): Likewise. + * include/VasEBoot/usb.h (VasEBoot_usb_device): New members port and hubaddr. 2012-01-31 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_mount) [!MODE_EXFAT]: Remove fstype + * VasEBoot-core/fs/fat.c (VasEBoot_fat_mount) [!MODE_EXFAT]: Remove fstype check as some mkfs implementations omit it. 2012-01-31 Vladimir Serbinenko - * docs/grub.texi (Unicode): Mention identifier and space limitations. + * docs/VasEBoot.texi (Unicode): Mention identifier and space limitations. 2012-01-31 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_sblock): Make volname a char array. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_sblock): Make volname a char array. Add new member volname2. - (grub_jfs_label): Use volname2 if available. + (VasEBoot_jfs_label): Use volname2 if available. 2012-01-31 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_super_block): Expand volume_name + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_super_block): Expand volume_name over last_mounted as seen in image generated by mkfs.nilfs2. - (grub_nilfs2_label): Use sizeof for the size of s_volume_name. + (VasEBoot_nilfs2_label): Use sizeof for the size of s_volume_name. 2012-01-31 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_dir_entry) [MODE_EXFAT]: Expand label + * VasEBoot-core/fs/fat.c (VasEBoot_fat_dir_entry) [MODE_EXFAT]: Expand label to 15 UTF-16 characters as seen in FS generated by mkexfatfs. - (grub_fat_label) [MODE_EXFAT]: Use macros for size. + (VasEBoot_fat_label) [MODE_EXFAT]: Use macros for size. 2012-01-31 Vladimir Serbinenko - * grub-core/fs/romfs.c (grub_romfs_mount): Fix a bug with labels going + * VasEBoot-core/fs/romfs.c (VasEBoot_romfs_mount): Fix a bug with labels going over the sector. 2012-01-31 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (get_filesystem_dnode): Support space in + * VasEBoot-core/fs/zfs/zfs.c (get_filesystem_dnode): Support space in subvolume name (by removing a bogus and useless check). 2012-01-31 Vladimir Serbinenko - * grub-core/fs/ext2.c (grub_ext2_label): Fix field size. Change to + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_label): Fix field size. Change to sizeof while on it. 2012-01-30 Vladimir Serbinenko - * grub-core/disk/scsi.c (grub_scsi_read_capacity): Renamed to ... - (grub_scsi_read_capacity10): ... this. - (grub_scsi_read_capacity16): New function. - (grub_scsi_open): Use read_capacity16 if read_capacity10 returned + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_read_capacity): Renamed to ... + (VasEBoot_scsi_read_capacity10): ... this. + (VasEBoot_scsi_read_capacity16): New function. + (VasEBoot_scsi_open): Use read_capacity16 if read_capacity10 returned 0xffffffff. Fix off-by-one error. - * include/grub/scsi.h (grub_scsi): Rename size to last_block and make it + * include/VasEBoot/scsi.h (VasEBoot_scsi): Rename size to last_block and make it 64-bit unsigned. - * include/grub/scsicmd.h (grub_scsi_read_capacity): Rename to ... - (grub_scsi_read_capacity10): ... this. - (grub_scsi_read_capacity_data): Rename to ... - (grub_scsi_read_capacity10_data): ... this. Rename size to last_block. - (grub_scsi_read_capacity16): New struct. - (grub_scsi_read_capacity16_data): Likewise. - (grub_scsi_cmd_t): Rename grub_scsi_cmd_read_capacity to - grub_scsi_cmd_read_capacity10. - New command grub_scsi_cmd_read_capacity16. + * include/VasEBoot/scsicmd.h (VasEBoot_scsi_read_capacity): Rename to ... + (VasEBoot_scsi_read_capacity10): ... this. + (VasEBoot_scsi_read_capacity_data): Rename to ... + (VasEBoot_scsi_read_capacity10_data): ... this. Rename size to last_block. + (VasEBoot_scsi_read_capacity16): New struct. + (VasEBoot_scsi_read_capacity16_data): Likewise. + (VasEBoot_scsi_cmd_t): Rename VasEBoot_scsi_cmd_read_capacity to + VasEBoot_scsi_cmd_read_capacity10. + New command VasEBoot_scsi_cmd_read_capacity16. 2012-01-30 Vladimir Serbinenko SCSI >2TiB support. - * grub-core/disk/scsi.c (grub_scsi_read16): New function. - (grub_scsi_write16): Likewise. - (grub_scsi_read): Use read16 when necessary. - (grub_scsi_write): Likewise. - * include/grub/scsicmd.h (grub_scsi_read16): New struct. - (grub_scsi_write16): Likewise. - (grub_scsi_cmd_t): Add READ16 and WRITE16. + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_read16): New function. + (VasEBoot_scsi_write16): Likewise. + (VasEBoot_scsi_read): Use read16 when necessary. + (VasEBoot_scsi_write): Likewise. + * include/VasEBoot/scsicmd.h (VasEBoot_scsi_read16): New struct. + (VasEBoot_scsi_write16): Likewise. + (VasEBoot_scsi_cmd_t): Add READ16 and WRITE16. 2012-01-30 Vladimir Serbinenko SCSI write support (for usbms mainly). - * grub-core/disk/scsi.c (grub_scsi_write10): Uncomment. Make buffer + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_write10): Uncomment. Make buffer a const pointer. - (grub_scsi_write): Implement. - * include/grub/scsi.h (grub_scsi_dev): Make write buffer a const pointer + (VasEBoot_scsi_write): Implement. + * include/VasEBoot/scsi.h (VasEBoot_scsi_dev): Make write buffer a const pointer 2012-01-30 Vladimir Serbinenko - * grub-core/io/lzopio.c (uncompress_block): Fix use of incorrect + * VasEBoot-core/io/lzopio.c (uncompress_block): Fix use of incorrect variable. 2012-01-29 Vladimir Serbinenko - * grub-core/lib/posix_wrap/string.h (memchr): New function. + * VasEBoot-core/lib/posix_wrap/string.h (memchr): New function. 2012-01-29 Vladimir Serbinenko @@ -14454,16 +14454,16 @@ 2012-01-29 Vladimir Serbinenko - * grub-core/lib/posix_wrap/assert.h (assert_real): Replace grub_fatal - with grub_printf to avoid unnecessary fatal failure. + * VasEBoot-core/lib/posix_wrap/assert.h (assert_real): Replace VasEBoot_fatal + with VasEBoot_printf to avoid unnecessary fatal failure. 2012-01-29 Vladimir Serbinenko - * grub-core/lib/posix_wrap/limits.h (SHRT_MAX): New define. + * VasEBoot-core/lib/posix_wrap/limits.h (SHRT_MAX): New define. (INT_MAX): Likewise. - * grub-core/lib/posix_wrap/stdio.h (snprintf): New function. - * grub-core/lib/posix_wrap/stdlib.h (abs): Likewise. - * grub-core/lib/posix_wrap/string.h (memcmp): Likewise. + * VasEBoot-core/lib/posix_wrap/stdio.h (snprintf): New function. + * VasEBoot-core/lib/posix_wrap/stdlib.h (abs): Likewise. + * VasEBoot-core/lib/posix_wrap/string.h (memcmp): Likewise. (strcpy): Likewise. (strstr): Likewise. (strchr): Likewise. @@ -14471,59 +14471,59 @@ (strcat): Likewise. (strncat): Likewise. (strcoll): Likewise. - * include/grub/types.h (GRUB_SHRT_MAX): New define. - (GRUB_INT_MAX): Likewise. + * include/VasEBoot/types.h (VasEBoot_SHRT_MAX): New define. + (VasEBoot_INT_MAX): Likewise. 2012-01-29 Vladimir Serbinenko - * grub-core/gnulib/regcomp.c (regerror): Don't use abort on + * VasEBoot-core/gnulib/regcomp.c (regerror): Don't use abort on unexpected error. (optimize_utf8): Likewise. - * grub-core/lib/posix_wrap/stdlib.h (abort): Removed. + * VasEBoot-core/lib/posix_wrap/stdlib.h (abort): Removed. 2012-01-29 Vladimir Serbinenko - * grub-core/boot/i386/pc/lnxboot.S: Use - GRUB_DECOMPRESSOR_MAX_DECOMPRESSOR_SIZE. - * grub-core/boot/i386/pc/startup_raw.S: Ensure about boot_dev + * VasEBoot-core/boot/i386/pc/lnxboot.S: Use + VasEBoot_DECOMPRESSOR_MAX_DECOMPRESSOR_SIZE. + * VasEBoot-core/boot/i386/pc/startup_raw.S: Ensure about boot_dev location. - * include/grub/offsets.h (GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE): New + * include/VasEBoot/offsets.h (VasEBoot_DECOMPRESSOR_I386_PC_BOOT_DEVICE): New definition. - (GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE): Likewise. + (VasEBoot_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE): Likewise. 2012-01-29 Vladimir Serbinenko - * util/getroot.c (grub_util_get_dm_node_linear_info): Fix memory leak. - * grub-core/disk/cryptodisk.c (cryptodisk_cleanup): Disable for + * util/getroot.c (VasEBoot_util_get_dm_node_linear_info): Fix memory leak. + * VasEBoot-core/disk/cryptodisk.c (cryptodisk_cleanup): Disable for now to avoid double free. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_dev): Rename to + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_dev): Rename to hostdisk. - * include/grub/disk.h (grub_disk_dev_id): New id HOSTDISK. - * util/grub-probe.c (escape_of_path): Always return a new copy. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): New id HOSTDISK. + * util/VasEBoot-probe.c (escape_of_path): Always return a new copy. (print_full_name): Escape path. - (probe): Don't call grub_util_devname_to_ofpath on NULL. + (probe): Don't call VasEBoot_util_devname_to_ofpath on NULL. Fix hints on abstractions. 2012-01-29 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Don't add "root" line if no compatibility hont is available. Suggested by: Seth Goldberg. 2012-01-29 Vladimir Serbinenko - * include/grub/ata.h (grub_ata): Add a new element maxbuffer. - * grub-core/disk/ata.c (grub_ata_readwrite): Limit to ata->maxbuffer. - * grub-core/disk/pata.c (grub_pata_open): Set ata->maxbuffer. - * grub-core/disk/ahci.c (grub_ahci_open): Likewise. + * include/VasEBoot/ata.h (VasEBoot_ata): Add a new element maxbuffer. + * VasEBoot-core/disk/ata.c (VasEBoot_ata_readwrite): Limit to ata->maxbuffer. + * VasEBoot-core/disk/pata.c (VasEBoot_pata_open): Set ata->maxbuffer. + * VasEBoot-core/disk/ahci.c (VasEBoot_ahci_open): Likewise. 2012-01-29 Vladimir Serbinenko - * include/grub/zfs/dnode.h (DN_MIN_INDBLKSHIFT): Removed. + * include/VasEBoot/zfs/dnode.h (DN_MIN_INDBLKSHIFT): Removed. 2012-01-29 Vladimir Serbinenko - * util/grub-pe2elf.c (ehdr): Make static. + * util/VasEBoot-pe2elf.c (ehdr): Make static. (shdr): Likewise. (num_sections): Likewise. (offset): Likewise. @@ -14532,7 +14532,7 @@ Eliminate ofpath limits and possible overflows. - * util/ieee1275/ofpath.c (grub_util_info) [STANDALONE]: New function. + * util/ieee1275/ofpath.c (VasEBoot_util_info) [STANDALONE]: New function. (OF_PATH_MAX): Removed. (MAX_DISK_CAT): New const. (find_obppath): Use allocated rather than preallocated buffer. @@ -14549,200 +14549,200 @@ 2012-01-29 Vladimir Serbinenko - * grub-core/normal/completion.c (iterate_dev): Close the disk. + * VasEBoot-core/normal/completion.c (iterate_dev): Close the disk. 2012-01-29 Vladimir Serbinenko Cryptodisk write support. - * grub-core/disk/cryptodisk.c (grub_crypto_pcbc_encrypt): New function. - (grub_cryptodisk_decrypt): Moved logic to ... - (grub_cryptodisk_endecrypt): ...this. New argument "encrypt". - (grub_cryptodisk_write): Implement. - * grub-core/kern/emu/hostdisk.c (nwrite): Rename to ... - (grub_util_fd_write): ... this. Make global. - * include/grub/emu/hostdisk.h (grub_util_fd_write): New proto. + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_crypto_pcbc_encrypt): New function. + (VasEBoot_cryptodisk_decrypt): Moved logic to ... + (VasEBoot_cryptodisk_endecrypt): ...this. New argument "encrypt". + (VasEBoot_cryptodisk_write): Implement. + * VasEBoot-core/kern/emu/hostdisk.c (nwrite): Rename to ... + (VasEBoot_util_fd_write): ... this. Make global. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_fd_write): New proto. 2012-01-29 Vladimir Serbinenko - * include/grub/list.h (grub_list_remove): Don't crash if element is + * include/VasEBoot/list.h (VasEBoot_list_remove): Don't crash if element is removed twice. 2012-01-29 Vladimir Serbinenko Rename ofconsole to console. - * grub-core/commands/terminal.c (handle_command): Handle ofconsole + * VasEBoot-core/commands/terminal.c (handle_command): Handle ofconsole as sysnonym to console. - * grub-core/term/ieee1275/ofconsole.c: Renamed to .. - * grub-core/term/ieee1275/console.c: ... this. All users updated. - Rename grub_ofconsole_ to grub_console_. All users updated - (grub_console_term_output): Rename "ofconsole" to "console". - * grub-core/term/terminfo.c (grub_cmd_terminfo): Handle "ofconsole" + * VasEBoot-core/term/ieee1275/ofconsole.c: Renamed to .. + * VasEBoot-core/term/ieee1275/console.c: ... this. All users updated. + Rename VasEBoot_ofconsole_ to VasEBoot_console_. All users updated + (VasEBoot_console_term_output): Rename "ofconsole" to "console". + * VasEBoot-core/term/terminfo.c (VasEBoot_cmd_terminfo): Handle "ofconsole" as "console". 2012-01-29 Vladimir Serbinenko - * grub-core/loader/i386/pc/plan9.c (grub_cmd_plan9): Remove PXE + * VasEBoot-core/loader/i386/pc/plan9.c (VasEBoot_cmd_plan9): Remove PXE handling. - * include/grub/disk.h (grub_disk_dev_id): Remove obsolete - GRUB_DISK_DEVICE_UUID_ID, GRUB_DISK_DEVICE_PXE_ID and - GRUB_DISK_DEVICE_FILE_ID. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Remove obsolete + VasEBoot_DISK_DEVICE_UUID_ID, VasEBoot_DISK_DEVICE_PXE_ID and + VasEBoot_DISK_DEVICE_FILE_ID. 2012-01-29 Vladimir Serbinenko - * grub-core/kern/partition.c (grub_partition_get_name): Simplify logic + * VasEBoot-core/kern/partition.c (VasEBoot_partition_get_name): Simplify logic and improve performance. 2012-01-29 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): Fix + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): Fix missing ieee1275/ prefix on whole disk. 2012-01-29 Vladimir Serbinenko - * include/grub/powerpc/ieee1275/util/biosdisk.h: Remove. - * include/grub/powerpc/ieee1275/biosdisk.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/util/biosdisk.h: Remove. + * include/VasEBoot/powerpc/ieee1275/biosdisk.h: Likewise. 2012-01-29 Vladimir Serbinenko - * grub-core/fs/cpio.c (handle_symlink): Fix a bug. + * VasEBoot-core/fs/cpio.c (handle_symlink): Fix a bug. 2012-01-29 Vladimir Serbinenko Merge common RAID and LVM logic to an abstract diskfilter. Add LDM support using the same framework. - * Makefile.util.def (libgrubkern): Add grub-core/disk/ldm.c, - grub-core/disk/diskfilter.c and grub-core/partmap/gpt.c. - (libgrubmods): Remove grub-core/disk/raid.c and - grub-core/partmap/gpt.c. - * grub-core/Makefile.core.def (ldm): New module. + * Makefile.util.def (libVasEBootkern): Add VasEBoot-core/disk/ldm.c, + VasEBoot-core/disk/diskfilter.c and VasEBoot-core/partmap/gpt.c. + (libVasEBootmods): Remove VasEBoot-core/disk/raid.c and + VasEBoot-core/partmap/gpt.c. + * VasEBoot-core/Makefile.core.def (ldm): New module. (raid): Renamed to diskfilter. All users updated. - * grub-core/disk/raid.c: Moved to ... - * grub-core/disk/diskfilter.c: ... here. - * grub-core/disk/diskfilter.c: Rename grub_raid_ to grub_diskfilter_. + * VasEBoot-core/disk/raid.c: Moved to ... + * VasEBoot-core/disk/diskfilter.c: ... here. + * VasEBoot-core/disk/diskfilter.c: Rename VasEBoot_raid_ to VasEBoot_diskfilter_. (lv_num): New var. (find_array): Renamed to ... (find_lv): ... this. Support multi-LV. Skip nameless LVs - (grub_is_array_readable): Renamed to ... - (grub_is_lv_readable): ... this. Support multinode hierarchy. + (VasEBoot_is_array_readable): Renamed to ... + (VasEBoot_is_lv_readable): ... this. Support multinode hierarchy. (insert_array): New argument id. (is_node_readable): New function. (scan_device): Rename to ... (scan_disk): .. this. Restrict to one disk. (scan_devices): New function. - (grub_diskfilter_iterate): Support multi-LV. + (VasEBoot_diskfilter_iterate): Support multi-LV. Skip invisible and nameless LVs. - (grub_diskfilter_memberlist): Support multi-LV. - (grub_diskfilter_read_node): New function. - (grub_raid_read): Most of logic moved to ... + (VasEBoot_diskfilter_memberlist): Support multi-LV. + (VasEBoot_diskfilter_read_node): New function. + (VasEBoot_raid_read): Most of logic moved to ... (read_segment): ... here (read_lv): New function. - (grub_diskfilter_get_vg_by_uuid): New function. - (grub_diskfilter_make_raid): Likewise. - * grub-core/disk/ldm.c: New file. - * grub-core/disk/lvm.c (vg_list): Removed. + (VasEBoot_diskfilter_get_vg_by_uuid): New function. + (VasEBoot_diskfilter_make_raid): Likewise. + * VasEBoot-core/disk/ldm.c: New file. + * VasEBoot-core/disk/lvm.c (vg_list): Removed. (lv_count): Likewise. (scan_depth): Likewise. (is_lv_readable): Likewise. - (grub_lvm_getvalue): Advance pointer past the number. + (VasEBoot_lvm_getvalue): Advance pointer past the number. (find_lv): Removed. (do_lvm_scan): Refactored into ... - (grub_lvm_detect): ... this. Support raid. - (grub_lvm_iterate): Removed. - (grub_lvm_memberlist): Likewise. - (grub_lvm_open): Likewise. - (grub_lvm_close): Likewise. + (VasEBoot_lvm_detect): ... this. Support raid. + (VasEBoot_lvm_iterate): Removed. + (VasEBoot_lvm_memberlist): Likewise. + (VasEBoot_lvm_open): Likewise. + (VasEBoot_lvm_close): Likewise. (read_lv): Likewise. (read_node): Likewise. (is_node_readable): Likewise. (is_lv_readable): Likewise. - (grub_lvm_read): Likewise. - (grub_lvm_write): Likewise. - (grub_lvm_dev): Use diskfilter - (GRUB_MOD_INIT): Likewise. - (GRUB_MOD_FINI): Likewise. - * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Use + (VasEBoot_lvm_read): Likewise. + (VasEBoot_lvm_write): Likewise. + (VasEBoot_lvm_dev): Use diskfilter + (VasEBoot_MOD_INIT): Likewise. + (VasEBoot_MOD_FINI): Likewise. + * VasEBoot-core/disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Use new interface. - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Likewise. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. - * grub-core/disk/raid5_recover.c (grub_raid5_recover): Use - grub_diskfilter_read_node. + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Likewise. + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Likewise. + * VasEBoot-core/disk/raid5_recover.c (VasEBoot_raid5_recover): Use + VasEBoot_diskfilter_read_node. Fix a bug with xor. - * grub-core/disk/raid6_recover.c (grub_raid6_recover): Use - grub_diskfilter_read_node. - Support GRUB_RAID_LAYOUT_MUL_FROM_POS. - * grub-core/kern/disk.c (grub_disk_dev_list): Make global. - (grub_disk_dev_iterate): Move from here... - * include/grub/disk.h (grub_disk_dev_iterate): ... to here. Inlined. - * grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start): + * VasEBoot-core/disk/raid6_recover.c (VasEBoot_raid6_recover): Use + VasEBoot_diskfilter_read_node. + Support VasEBoot_RAID_LAYOUT_MUL_FROM_POS. + * VasEBoot-core/kern/disk.c (VasEBoot_disk_dev_list): Make global. + (VasEBoot_disk_dev_iterate): Move from here... + * include/VasEBoot/disk.h (VasEBoot_disk_dev_iterate): ... to here. Inlined. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_hostdisk_find_partition_start): Make global. - (grub_hostdisk_find_partition_start): Likewise. - (grub_hostdisk_os_dev_to_grub_drive): New function. - (grub_util_biosdisk_get_osdev): Check that disk is biosdisk. - * grub-core/kern/emu/hostdisk.c (make_device_name): Move to ... + (VasEBoot_hostdisk_find_partition_start): Likewise. + (VasEBoot_hostdisk_os_dev_to_VasEBoot_drive): New function. + (VasEBoot_util_biosdisk_get_osdev): Check that disk is biosdisk. + * VasEBoot-core/kern/emu/hostdisk.c (make_device_name): Move to ... * util/getroot.c (make_device_name): ... here. - * grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_dm_node_linear_info): Move to ... - * util/getroot.c (grub_util_get_dm_node_linear_info): ...here. - * grub-core/kern/emu/hostdisk.c + * util/getroot.c (VasEBoot_util_get_dm_node_linear_info): ...here. + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Move to ... * util/getroot.c (convert_system_partition_to_system_disk): ...here. - * grub-core/kern/emu/hostdisk.c (device_is_wholedisk): Move to ... + * VasEBoot-core/kern/emu/hostdisk.c (device_is_wholedisk): Move to ... * util/getroot.c (device_is_wholedisk): ... here. - * grub-core/kern/emu/hostdisk.c (find_system_device): Move to ... + * VasEBoot-core/kern/emu/hostdisk.c (find_system_device): Move to ... * util/getroot.c (find_system_device): ... here. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_present): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_is_present): Move to ... - * util/getroot.c (grub_util_biosdisk_is_present): ...here. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev): + * util/getroot.c (VasEBoot_util_biosdisk_is_present): ...here. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Move to ... - * util/getroot.c (grub_util_biosdisk_get_grub_dev): ... here. + * util/getroot.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): ... here. Handle LDM. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_is_floppy): Move to ... - * util/getroot.c (grub_util_biosdisk_is_floppy): ... here. - * grub-core/partmap/gpt.c (grub_gpt_partition_map_iterate): Made global. - * include/grub/disk.h (grub_disk_dev_id): Replaced RAID and LVM with + * util/getroot.c (VasEBoot_util_biosdisk_is_floppy): ... here. + * VasEBoot-core/partmap/gpt.c (VasEBoot_gpt_partition_map_iterate): Made global. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Replaced RAID and LVM with DISKFILTER. - * include/grub/raid.h: Renamed to ... - * include/grub/diskfilter.h: ... this. - * include/grub/diskfilter.h: Rename grub_raid_* to grub_diskfilter_* - (GRUB_RAID_LAYOUT_*): Make into array. - (GRUB_RAID_LAYOUT_MUL_FROM_POS): New value. - (grub_diskfilter_vg): New struct. - (grub_diskfilter_pv_id): Likewise. - (grub_raid_member): Removed. - (grub_raid_array): Likewise. - (grub_diskfilter_pv): New struct. - (grub_diskfilter_lv): Likewise. - (grub_diskfilter_segment): Likewise. - (grub_diskfilter_node): Likewise. - (grub_diskfilter_get_vg_by_uuid): New proto. - (grub_raid_register): Inline. - (grub_diskfilter_unregister): Likewise. - (grub_diskfilter_make_raid): New proto. - (grub_diskfilter_vg_register): Likewise. - (grub_diskfilter_read_node): Likewise. - (grub_diskfilter_get_pv_from_disk) [GRUB_UTIL]: Likewise. - * include/grub/emu/hostdisk.h (grub_util_get_ldm): New proto. - (grub_util_is_ldm): Likewise. - (grub_util_ldm_embed) [GRUB_UTIL]: Likewise. - (grub_hostdisk_find_partition_start): Likewise. - (grub_hostdisk_os_dev_to_grub_drive): Likewise. - * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_LDM): + * include/VasEBoot/raid.h: Renamed to ... + * include/VasEBoot/diskfilter.h: ... this. + * include/VasEBoot/diskfilter.h: Rename VasEBoot_raid_* to VasEBoot_diskfilter_* + (VasEBoot_RAID_LAYOUT_*): Make into array. + (VasEBoot_RAID_LAYOUT_MUL_FROM_POS): New value. + (VasEBoot_diskfilter_vg): New struct. + (VasEBoot_diskfilter_pv_id): Likewise. + (VasEBoot_raid_member): Removed. + (VasEBoot_raid_array): Likewise. + (VasEBoot_diskfilter_pv): New struct. + (VasEBoot_diskfilter_lv): Likewise. + (VasEBoot_diskfilter_segment): Likewise. + (VasEBoot_diskfilter_node): Likewise. + (VasEBoot_diskfilter_get_vg_by_uuid): New proto. + (VasEBoot_raid_register): Inline. + (VasEBoot_diskfilter_unregister): Likewise. + (VasEBoot_diskfilter_make_raid): New proto. + (VasEBoot_diskfilter_vg_register): Likewise. + (VasEBoot_diskfilter_read_node): Likewise. + (VasEBoot_diskfilter_get_pv_from_disk) [VasEBoot_UTIL]: Likewise. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_get_ldm): New proto. + (VasEBoot_util_is_ldm): Likewise. + (VasEBoot_util_ldm_embed) [VasEBoot_UTIL]: Likewise. + (VasEBoot_hostdisk_find_partition_start): Likewise. + (VasEBoot_hostdisk_os_dev_to_VasEBoot_drive): Likewise. + * include/VasEBoot/gpt_partition.h (VasEBoot_GPT_PARTITION_TYPE_LDM): New definition. - (grub_gpt_partition_map_iterate): New proto. - * include/grub/lvm.h (grub_lvm_vg): Removed. - (grub_lvm_pv): Likewise. - (grub_lvm_lv): Likewise. - (grub_lvm_segment): Likewise. - (grub_lvm_node): Likewise. + (VasEBoot_gpt_partition_map_iterate): New proto. + * include/VasEBoot/lvm.h (VasEBoot_lvm_vg): Removed. + (VasEBoot_lvm_pv): Likewise. + (VasEBoot_lvm_lv): Likewise. + (VasEBoot_lvm_segment): Likewise. + (VasEBoot_lvm_node): Likewise. * util/getroot.c [...] - * util/grub-probe.c (probe_raid_level): Handle diskfilter. + * util/VasEBoot-probe.c (probe_raid_level): Handle diskfilter. (probe_abstraction): Likewise. - * util/grub-setup.c (setup): Remove must_embed. Support LDM. + * util/VasEBoot-setup.c (setup): Remove must_embed. Support LDM. (main): Remove dead logic. 2012-01-28 Vladimir Serbinenko @@ -14750,74 +14750,74 @@ Simplify root device discover and don't fail when trying to open incorrect devices. - * grub-core/disk/efi/efidisk.c (get_diskname_from_path_real): New + * VasEBoot-core/disk/efi/efidisk.c (get_diskname_from_path_real): New function. (get_diskname_from_path): Likewise. - (grub_efidisk_get_device_name): Use get_diskname_from_path instead + (VasEBoot_efidisk_get_device_name): Use get_diskname_from_path instead of iterating. 2012-01-27 Vladimir Serbinenko - * grub-core/Makefile.core.def (setpci): Enable on all PCI platforms. + * VasEBoot-core/Makefile.core.def (setpci): Enable on all PCI platforms. 2012-01-27 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (nvlist_find_value): Check that we don't go + * VasEBoot-core/fs/zfs/zfs.c (nvlist_find_value): Check that we don't go pastthe end. 2012-01-27 Vladimir Serbinenko - * util/grub-install.in: Add missing \. + * util/VasEBoot-install.in: Add missing \. Reported by: gentoofan 2012-01-26 Vladimir Serbinenko - * grub-core/fs/squash4.c (xz_decompress): Fix return value. + * VasEBoot-core/fs/squash4.c (xz_decompress): Fix return value. (direct_read): Use correct compressed size. - (grub_squash_read_data): Likewise. + (VasEBoot_squash_read_data): Likewise. 2012-01-26 Vladimir Serbinenko - * docs/grub.texi (Platform limitations): New section. + * docs/VasEBoot.texi (Platform limitations): New section. (Platform-specific operations): Likewise. - * docs/grub-dev.texi (Porting): Likewise. + * docs/VasEBoot-dev.texi (Porting): Likewise. 2012-01-25 Vladimir Serbinenko IEEE1275 disk write support. - * grub-core/kern/ieee1275/ieee1275.c (grub_ieee1275_write): Make buffer + * VasEBoot-core/kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_write): Make buffer const void *. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_write): Likewise. - * grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_read): Move open + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_write): Likewise. + * VasEBoot-core/disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_read): Move open and seek loginc to ... - (grub_ofdisk_prepare): ... here. - (grub_ofdisk_write): Implement. + (VasEBoot_ofdisk_prepare): ... here. + (VasEBoot_ofdisk_write): Implement. 2012-01-25 Vladimir Serbinenko ARC disk write support. - * grub-core/disk/arc/arcdisk.c (handle_writable): New var. + * VasEBoot-core/disk/arc/arcdisk.c (handle_writable): New var. (reopen): New argument writable. All users updated. Handle required access mode. - (grub_arcdisk_write): Implement. - * include/grub/arc/arc.h (grub_arc_file_access): New enum. - (grub_arc_firmware_vector): Make buffer to write a const buffer. + (VasEBoot_arcdisk_write): Implement. + * include/VasEBoot/arc/arc.h (VasEBoot_arc_file_access): New enum. + (VasEBoot_arc_firmware_vector): Make buffer to write a const buffer. 2012-01-25 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_device): New field size. + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_device): New field size. (read_sblock): Don't attempt to read superblocks outside the disk size. 2012-01-25 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Use device size from + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_load_sb): Use device size from first superblock to find the second one when possible. 2012-01-25 Vladimir Serbinenko - * util/grub-install.in: Fix an ARC bug. + * util/VasEBoot-install.in: Fix an ARC bug. Print a warning if no platform-specific setup is available. 2012-01-24 Vladimir Serbinenko @@ -14825,7 +14825,7 @@ Use static allocation rather than scratch pointer in reed_solomon. It decreases its size significantly and avoids a variable in .text. - * grub-core/lib/reed_solomon.c (scratch): Removed. + * VasEBoot-core/lib/reed_solomon.c (scratch): Removed. (chosenstat): New const or static array. (sigma): Likewise. (errpot): Likewise. @@ -14840,93 +14840,93 @@ (rs_recover): Likewise. Calculate syndroms directly. (decode_block): Use statically allocated arrays. - (grub_reed_solomon_add_redundancy) [TEST]: Fix -DTEST compilation. + (VasEBoot_reed_solomon_add_redundancy) [TEST]: Fix -DTEST compilation. (main) [TEST]: Allow -DTEST -DSTANDALONE. 2012-01-24 Vladimir Serbinenko Eliminate fixed limit on reed solomon decoder length. - * grub-core/boot/i386/pc/lnxboot.S: Scan for multiboot signature + * VasEBoot-core/boot/i386/pc/lnxboot.S: Scan for multiboot signature rather than hardcoding the address. - * grub-core/boot/i386/pc/startup_raw.S: Add new data field + * VasEBoot-core/boot/i386/pc/startup_raw.S: Add new data field no_reed_solomon_length. Move gate_a20 to no-reed-solomon part. Don't force a particular size of no reed-solomon part. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Removed. - (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH): New define. - * util/grub-setup.c (setup): Read no_rs_length from the image itself. + (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH): New define. + * util/VasEBoot-setup.c (setup): Read no_rs_length from the image itself. 2012-01-24 Vladimir Serbinenko - * grub-core/commands/wildcard.c (match_files): Handle filenames + * VasEBoot-core/commands/wildcard.c (match_files): Handle filenames without explicit device. (wildcard_expand): Don't add explicit device if not already present. - * tests/grub_script_echo1.in: Add a new expansion test. + * tests/VasEBoot_script_echo1.in: Add a new expansion test. 2012-01-24 Vladimir Serbinenko Replace single-linked with double-linked lists. It results in more compact and more efficient code. - * grub-core/kern/list.c (grub_list_push): Moved from here ... - * include/grub/list.h (grub_list_push): ... to here. Set prev. - (grub_list_remove): Moved from here ... - * include/grub/list.h (grub_list_remove): ... here. Use and set prev. - (grub_prio_list_insert): Set prev. - * include/grub/list.h (grub_list): Add prev. All users updated. + * VasEBoot-core/kern/list.c (VasEBoot_list_push): Moved from here ... + * include/VasEBoot/list.h (VasEBoot_list_push): ... to here. Set prev. + (VasEBoot_list_remove): Moved from here ... + * include/VasEBoot/list.h (VasEBoot_list_remove): ... here. Use and set prev. + (VasEBoot_prio_list_insert): Set prev. + * include/VasEBoot/list.h (VasEBoot_list): Add prev. All users updated. 2012-01-24 Vladimir Serbinenko Handle newer autotools. Add some missing quotes while on it. - * Makefile.am (pkglib_DATA): Remove update-grub_lib. - (pkglib_DATA): Move grub-mkconfig_lib from here ... + * Makefile.am (pkglib_DATA): Remove update-VasEBoot_lib. + (pkglib_DATA): Move VasEBoot-mkconfig_lib from here ... (pkgdata_DATA): ... here. - * Makefile.util.def (update-grub_lib): Removed. + * Makefile.util.def (update-VasEBoot_lib): Removed. * conf/Makefile.common (pkglib_DATA): Removed. (pkglib_SCRIPTS): Likewise. (pkgdata_DATA): New variable. - * tests/util/grub-shell-tester.in: Replace pkglib with pkgdata where + * tests/util/VasEBoot-shell-tester.in: Replace pkglib with pkgdata where needed. Add missing quotes. Remove unused variable while on it. - * tests/util/grub-shell.in: Likewise. - * util/grub-install.in: Likewise. - * util/grub-mkconfig.in: Likewise. - * util/grub-mknetdir.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-mkstandalone.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_illumos.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. - * util/update-grub_lib.in: Removed. + * tests/util/VasEBoot-shell.in: Likewise. + * util/VasEBoot-install.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-mkstandalone.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_illumos.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. + * util/update-VasEBoot_lib.in: Removed. 2012-01-24 Seth Goldberg - * grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_recv): Relax checks as + * VasEBoot-core/net/drivers/i386/pc/pxe.c (VasEBoot_pxe_recv): Relax checks as a workaround for intel problem. 2012-01-23 Paulo de Rezende Pinatti 2012-01-23 Vladimir Serbinenko 2012-01-23 pfsmorigo - * util/grub-install.in: Support dd'in into PreP partition. - * util/grub-probe.c (probe): Support discovering partition type. + * util/VasEBoot-install.in: Support dd'in into PreP partition. + * util/VasEBoot-probe.c (probe): Support discovering partition type. (main): Support -t msdos_parttype. 2012-01-23 Vladimir Serbinenko - * grub-core/normal/crypto.c (grub_crypto_autoload): Prevent + * VasEBoot-core/normal/crypto.c (VasEBoot_crypto_autoload): Prevent infinite recursion using counter. - * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32 + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32 init to skip it if the magic check fails. (dec_stream_header): Init s->crc32. @@ -14934,7 +14934,7 @@ 2012-01-22 Zachary Bedell 2012-01-22 Richard Laager - * grub-core/fs/zfs/zfs.c (uberblock_verify): New parameter size. + * VasEBoot-core/fs/zfs/zfs.c (uberblock_verify): New parameter size. All users updated. (find_bestub): Determine correct size. (fill_vdev_info_real): Fill ashift. New argument. All users updated. @@ -14943,7 +14943,7 @@ 2012-01-22 Vladimir Serbinenko - * grub-core/lib/relocator.c (malloc_in_range): Remove couple of + * VasEBoot-core/lib/relocator.c (malloc_in_range): Remove couple of dprintf in no-malloc zone. 2012-01-22 Mario Limonciello @@ -14954,57 +14954,57 @@ Support 4K-sector NTFS. - * include/grub/ntfs.h (GRUB_NTFS_MAX_MFT): Increase to 8. - (grub_ntfs_data): Remove blocksize. - * grub-core/fs/ntfs.c (fixup): Fix size comparison. + * include/VasEBoot/ntfs.h (VasEBoot_NTFS_MAX_MFT): Increase to 8. + (VasEBoot_ntfs_data): Remove blocksize. + * VasEBoot-core/fs/ntfs.c (fixup): Fix size comparison. Remove data argument. All users updated. 2012-01-20 Vladimir Serbinenko - * grub-core/kern/mips/arc/init.c (grub_total_modules_size): Mark as + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_total_modules_size): Mark as being in .text to avoid dprel references. - * include/grub/mips/loongson/kernel.h (grub_arch_machine): Likewise. - * include/grub/mips/loongson/memory.h (grub_arch_memsize): Likewise. - (grub_arch_highmemsize): Likewise. - * include/grub/mips/loongson/time.h (grub_arch_busclock): Likewise. - * include/grub/mips/qemu_mips/memory.h (grub_arch_memsize): Likewise. - * include/grub/mips/time.h (grub_arch_cpuclock): Likewise. + * include/VasEBoot/mips/loongson/kernel.h (VasEBoot_arch_machine): Likewise. + * include/VasEBoot/mips/loongson/memory.h (VasEBoot_arch_memsize): Likewise. + (VasEBoot_arch_highmemsize): Likewise. + * include/VasEBoot/mips/loongson/time.h (VasEBoot_arch_busclock): Likewise. + * include/VasEBoot/mips/qemu_mips/memory.h (VasEBoot_arch_memsize): Likewise. + * include/VasEBoot/mips/time.h (VasEBoot_arch_cpuclock): Likewise. 2012-01-18 Vladimir Serbinenko Support powerpc with GCC that defines __PPC__ but not __powerpc__. * config.h.in (__powerpc__) [__PPC__ && !__powerpc__]: New definition. - * grub-core/lib/setjmp.S: Treat __PPC__ as equivalent to __powerpc__. + * VasEBoot-core/lib/setjmp.S: Treat __PPC__ as equivalent to __powerpc__. 2012-01-18 Vladimir Serbinenko - * include/grub/datetime.h (grub_get_datetime_cmos): Don't define in - GRUB_UTIL. - (grub_set_datetime_cmos): Likewise. + * include/VasEBoot/datetime.h (VasEBoot_get_datetime_cmos): Don't define in + VasEBoot_UTIL. + (VasEBoot_set_datetime_cmos): Likewise. 2012-01-18 Vladimir Serbinenko Make XZ compression parameters dependent on target and not host CPU. - * configure.ac: Define GRUB_TARGET_CPU_XYZ series. - * grub-core/lib/xzembed/xz_config.h: Use GRUB_TARGET_CPU_XYZ. + * configure.ac: Define VasEBoot_TARGET_CPU_XYZ series. + * VasEBoot-core/lib/xzembed/xz_config.h: Use VasEBoot_TARGET_CPU_XYZ. 2012-01-18 Vladimir Serbinenko - * grub-core/kern/powerpc/dl.c (grub_arch_dl_get_tramp_got_size): Remove + * VasEBoot-core/kern/powerpc/dl.c (VasEBoot_arch_dl_get_tramp_got_size): Remove set but not used variable. 2012-01-14 Vladimir Serbinenko - * grub-core/fs/reiserfs.c (grub_reiserfs_uuid): Reject 0-uuid as + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_uuid): Reject 0-uuid as created when no uuid support is compiled into mkfs.reiser. 2012-01-14 Vladimir Serbinenko - * grub-core/fs/hfs.c (macroman_to_utf8): Convert / to :. + * VasEBoot-core/fs/hfs.c (macroman_to_utf8): Convert / to :. (utf8_to_macroman): Do the opposite. - * grub-core/fs/hfsplus.c (grub_hfsplus_iterate_dir): Convert / to :. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_iterate_dir): Convert / to :. 2012-01-14 Vladimir Serbinenko @@ -15012,97 +15012,97 @@ 2012-01-14 Vladimir Serbinenko - Eliminate grub_min/grub_max prone to overflow usage. + Eliminate VasEBoot_min/VasEBoot_max prone to overflow usage. - * grub-core/bus/usb/usbhub.c (grub_usb_add_hub): Eliminate grub_min. + * VasEBoot-core/bus/usb/usbhub.c (VasEBoot_usb_add_hub): Eliminate VasEBoot_min. (poll_nonroot_hub): Likewise. - * grub-core/fs/affs.c (grub_affs_iterate_dir): Likewise. - (grub_affs_label): Likewise. - * grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Likewise. - * grub-core/fs/hfs.c (grub_hfs_dir): Likewise. - (grub_hfs_label): Likewise. - * grub-core/fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise. - * grub-core/fs/zfs/zfs.c (MIN): Remove. - (zap_leaf_array_equal): Use grub_size. Remove MIN. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_iterate_dir): Likewise. + (VasEBoot_affs_label): Likewise. + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_lzo_decompress): Likewise. + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_dir): Likewise. + (VasEBoot_hfs_label): Likewise. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_cmp_catkey): Likewise. + * VasEBoot-core/fs/zfs/zfs.c (MIN): Remove. + (zap_leaf_array_equal): Use VasEBoot_size. Remove MIN. (zap_leaf_array_get): Likewise. (dnode_get_path): Likewise. - * grub-core/io/lzopio.c (grub_lzopio_read): Eliminate grub_min. - * grub-core/io/xzio.c (grub_xzio_read): Likewise. - * grub-core/script/execute.c (grub_script_break): Likewise. - * grub-core/script/lexer.c (grub_script_lexer_record): Eliminate - grub_max. - * grub-core/script/yylex.l (grub_lexer_yyrealloc): Likewise. - * include/grub/misc.h (grub_min): Removed. - (grub_max): Likewise. + * VasEBoot-core/io/lzopio.c (VasEBoot_lzopio_read): Eliminate VasEBoot_min. + * VasEBoot-core/io/xzio.c (VasEBoot_xzio_read): Likewise. + * VasEBoot-core/script/execute.c (VasEBoot_script_break): Likewise. + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_record): Eliminate + VasEBoot_max. + * VasEBoot-core/script/yylex.l (VasEBoot_lexer_yyrealloc): Likewise. + * include/VasEBoot/misc.h (VasEBoot_min): Removed. + (VasEBoot_max): Likewise. 2012-01-14 Samuel Thibault - * grub-core/fs/ext2.c (grub_ext2_iterate_dir): Ignore entries with + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_iterate_dir): Ignore entries with direct.inode = 0. 2012-01-14 Vladimir Serbinenko - * grub-core/lib/posix_wrap/wctype.h (CHARCLASS_NAME_MAX): New define. + * VasEBoot-core/lib/posix_wrap/wctype.h (CHARCLASS_NAME_MAX): New define. 2012-01-14 Vladimir Serbinenko - * include/grub/datetime.h (grub_datetime2unixtime): Fix offset. + * include/VasEBoot/datetime.h (VasEBoot_datetime2unixtime): Fix offset. 2012-01-14 Vladimir Serbinenko - * grub-core/lib/posix_wrap/stdlib.h (MB_CUR_MAX): Moved from here ... - * grub-core/lib/posix_wrap/wchar.h (MB_CUR_MAX): ... here. Value fixed. + * VasEBoot-core/lib/posix_wrap/stdlib.h (MB_CUR_MAX): Moved from here ... + * VasEBoot-core/lib/posix_wrap/wchar.h (MB_CUR_MAX): ... here. Value fixed. 2012-01-14 Vladimir Serbinenko - * grub-core/fs/fshelp.c (grub_fshelp_find_file): Use grub_strcasecmp - rather than a hack for grub_strncasemap. + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_find_file): Use VasEBoot_strcasecmp + rather than a hack for VasEBoot_strncasemap. 2012-01-14 Vladimir Serbinenko Support multiple initrds Note: part of this was accidently committed in r3739. - * grub-core/loader/i386/linux.c (grub_cmd_initrd): Support multiple + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_initrd): Support multiple initrd. - * grub-core/loader/i386/pc/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/ia64/efi/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/mips/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_initrd): Likewise. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/mips/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c (VasEBoot_cmd_initrd): Likewise. 2012-01-14 Vladimir Serbinenko - * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Skip + * VasEBoot-core/disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Skip disks with unknown size. - * grub-core/disk/raid.c (scan_devices): Allow disks with unknown sizes. + * VasEBoot-core/disk/raid.c (scan_devices): Allow disks with unknown sizes. 2012-01-14 Vladimir Serbinenko - Remove defines pertaining to arbitrary limits not affecting GRUB + Remove defines pertaining to arbitrary limits not affecting VasEBoot anymore. - * grub-core/fs/ext2.c (EXT2_PATH_MAX): Removed. + * VasEBoot-core/fs/ext2.c (EXT2_PATH_MAX): Removed. (EXT2_MAX_SYMLINKCNT): Likewise. - * grub-core/fs/nilfs2.c (NILFS_BTREE_LEVEL_MAX): Likewise. - * grub-core/net/tftp.c (TFTP_MAX_PACKET): Likewise. - * include/grub/i386/pc/pxe.h (GRUB_PXE_MIN_BLKSIZE): Likewise. - (GRUB_PXE_MAX_BLKSIZE): Likewise. - * include/grub/normal.h (GRUB_MAX_CMDLINE): Likewise. - * include/grub/zfs/dnode.h (DN_MAX_INDBLKSHIFT): Likewise. + * VasEBoot-core/fs/nilfs2.c (NILFS_BTREE_LEVEL_MAX): Likewise. + * VasEBoot-core/net/tftp.c (TFTP_MAX_PACKET): Likewise. + * include/VasEBoot/i386/pc/pxe.h (VasEBoot_PXE_MIN_BLKSIZE): Likewise. + (VasEBoot_PXE_MAX_BLKSIZE): Likewise. + * include/VasEBoot/normal.h (VasEBoot_MAX_CMDLINE): Likewise. + * include/VasEBoot/zfs/dnode.h (DN_MAX_INDBLKSHIFT): Likewise. (DN_MAX_OBJECT_SHIFT): Likewise. (DN_MAX_OFFSET_SHIFT): Likewise. (DN_MAX_OBJECT): Likewise. (DNODES_PER_LEVEL_SHIFT): Likewise. - * include/grub/zfs/spa.h (SPA_MAXBLOCKSHIFT): Likewise. + * include/VasEBoot/zfs/spa.h (SPA_MAXBLOCKSHIFT): Likewise. (SPA_MAXBLOCKSIZE): Likewise. (SPA_BLOCKSIZES): Likewise. - * include/grub/zfs/zap_impl.h (MZAP_MAX_BLKSHIFT): Likewise. + * include/VasEBoot/zfs/zap_impl.h (MZAP_MAX_BLKSHIFT): Likewise. (MZAP_MAX_BLKSZ): Likewise. 2012-01-14 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (grub_zfs_read): Remove useless alloc and + * VasEBoot-core/fs/zfs/zfs.c (VasEBoot_zfs_read): Remove useless alloc and handle NULL appropriately. Remove MIN. @@ -15110,142 +15110,142 @@ Fix efiemu. - * grub-core/efiemu/runtime/efiemu.c: explicitly include right + * VasEBoot-core/efiemu/runtime/efiemu.c: explicitly include right cpu/types.h. (efiemu_set_virtual_address_map): Remove UINT_TO_PTR. * configure.ac: Fix efiemu check. 2012-01-13 Vladimir Serbinenko - * util/grub.d/30_os-prober.in: Fix occurence of grub-probe instead of - grub_probe. + * util/VasEBoot.d/30_os-prober.in: Fix occurence of VasEBoot-probe instead of + VasEBoot_probe. Reported by: adamwill 2012-01-12 Seth Goldberg - * grub-core/lib/arg.c (grub_arg_parse): Fix NULL pointer dereference. + * VasEBoot-core/lib/arg.c (VasEBoot_arg_parse): Fix NULL pointer dereference. 2012-01-12 Vladimir Serbinenko Fix handling of wide characters in gfxterm. - * grub-core/term/gfxterm.c (grub_colored_char): Remove width and index. + * VasEBoot-core/term/gfxterm.c (VasEBoot_colored_char): Remove width and index. (clear_char): Likewise. (paint_char): Skip code == NULL chars. - (grub_gfxterm_putchar): Set code = NULL on "shadowed" positions. + (VasEBoot_gfxterm_putchar): Set code = NULL on "shadowed" positions. 2012-01-12 Vladimir Serbinenko - * grub-core/normal/charset.c: Move comment to right place. + * VasEBoot-core/normal/charset.c: Move comment to right place. 2012-01-11 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_bblock): Revert flags. - (GRUB_AFFS_FLAG_FFS): Put back where it was. - (grub_affs_mount): Revert the correct version checking. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_bblock): Revert flags. + (VasEBoot_AFFS_FLAG_FFS): Put back where it was. + (VasEBoot_affs_mount): Revert the correct version checking. 2012-01-11 Vladimir Serbinenko - * docs/grub.texi (Unicode): Mention several other unsupported features. + * docs/VasEBoot.texi (Unicode): Mention several other unsupported features. 2011-12-26 Vladimir Serbinenko - * grub-core/fs/squash4.c (squash_mount): Mark endian conversion in + * VasEBoot-core/fs/squash4.c (squash_mount): Mark endian conversion in case statements as compile-time one. (direct_read): Prevent spurious warnings. - (grub_squash_read_data): Likewise. + (VasEBoot_squash_read_data): Likewise. 2011-12-26 Vladimir Serbinenko Various squash4 fixes and LZO and XZ support. - * Makefile.util.def (libgrubmods.a): Add xzembed directory to cppflags. + * Makefile.util.def (libVasEBootmods.a): Add xzembed directory to cppflags. Add xzembed source files. - * grub-core/Makefile.core.def (squash4): Add xzembed and minilzo flags. - * grub-core/fs/squash4.c (grub_squash_super): New field compression. - (grub_squash_inode): New subtype long_dir. + * VasEBoot-core/Makefile.core.def (squash4): Add xzembed and minilzo flags. + * VasEBoot-core/fs/squash4.c (VasEBoot_squash_super): New field compression. + (VasEBoot_squash_inode): New subtype long_dir. (SQUASH_TYPE_LONG_DIR): New inode type. (COMPRESSION): New enum. (XZBUFSIZ): New const. - (grub_squash_data): New fields blksz, decompress, xzdec, xzbuf. + (VasEBoot_squash_data): New fields blksz, decompress, xzdec, xzbuf. (read_chunk): Use data->decompress. (zlib_decompress): New function. (lzo_decompress): Likewise. (xz_decompress): Likewise. (squash_mount): Set new data fields. - (grub_squash_iterate_dir): Handle long dir. + (VasEBoot_squash_iterate_dir): Handle long dir. (squash_unmount): Free xzdec and xzbuf. - (grub_squash_open): Check ino type. + (VasEBoot_squash_open): Check ino type. (direct_read): Stylistic fixes. Use data->decompress. - (grub_squash_read_data): Likewise. - * grub-core/io/gzio.c (grub_gzio): Remove disk_input. + (VasEBoot_squash_read_data): Likewise. + * VasEBoot-core/io/gzio.c (VasEBoot_gzio): Remove disk_input. (get_byte): Likewise. - (grub_zlib_disk_read): Removed. - * grub-core/lib/posix_wrap/sys/types.h (ssize_t): New type. - (GRUB_POSIX_BOOL_DEFINED): New define. - * grub-core/lib/posix_wrap/unistd.h: Include sys/types.h. - * grub-core/lib/xzembed/xz.h: Addmissing includes. - [!GRUB_POSIX_BOOL_DEFINED]: Define bool. - * include/grub/deflate.h (grub_zlib_disk_read): Removed. + (VasEBoot_zlib_disk_read): Removed. + * VasEBoot-core/lib/posix_wrap/sys/types.h (ssize_t): New type. + (VasEBoot_POSIX_BOOL_DEFINED): New define. + * VasEBoot-core/lib/posix_wrap/unistd.h: Include sys/types.h. + * VasEBoot-core/lib/xzembed/xz.h: Addmissing includes. + [!VasEBoot_POSIX_BOOL_DEFINED]: Define bool. + * include/VasEBoot/deflate.h (VasEBoot_zlib_disk_read): Removed. 2011-12-26 Vladimir Serbinenko Don't override more informative errors. - * grub-core/commands/acpi.c (grub_cmd_acpi): Don't override errors. - * grub-core/font/font.c (open_section): Likewise. - * grub-core/loader/i386/bsd.c (grub_bsd_load_aout): New argument + * VasEBoot-core/commands/acpi.c (VasEBoot_cmd_acpi): Don't override errors. + * VasEBoot-core/font/font.c (open_section): Likewise. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_bsd_load_aout): New argument filename. Don't override errors. - (grub_cmd_openbsd_ramdisk): Don't override errors. - * grub-core/loader/i386/linux.c (grub_cmd_linux): Likewise. - (grub_cmd_initrd): Likewise. - * grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Likewise. - (grub_cmd_initrd): Likewise. - * grub-core/loader/ia64/efi/linux.c (grub_load_elf64): Likewise. - (grub_cmd_linux): Likewise. - (grub_cmd_initrd): Likewise. - (grub_cmd_payload): Likewise. - * grub-core/loader/mips/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/multiboot.c (grub_cmd_multiboot): Likewise. - (grub_cmd_module): Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_initrd): Likewise. - * grub-core/loader/xnu.c (grub_xnu_load_driver): Likewise. - (grub_cmd_xnu_mkext): Likewise. - (grub_cmd_xnu_ramdisk): Likewise. - (grub_xnu_check_os_bundle_required): Likewise. - (grub_xnu_load_kext_from_dir): Likewise. - (grub_cmd_xnu_kextdir): Likewise. - * grub-core/loader/xnu_resume.c (grub_xnu_resume): Likewise. + (VasEBoot_cmd_openbsd_ramdisk): Don't override errors. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Likewise. + (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_linux): Likewise. + (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c (VasEBoot_load_elf64): Likewise. + (VasEBoot_cmd_linux): Likewise. + (VasEBoot_cmd_initrd): Likewise. + (VasEBoot_cmd_payload): Likewise. + * VasEBoot-core/loader/mips/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/multiboot.c (VasEBoot_cmd_multiboot): Likewise. + (VasEBoot_cmd_module): Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_load_driver): Likewise. + (VasEBoot_cmd_xnu_mkext): Likewise. + (VasEBoot_cmd_xnu_ramdisk): Likewise. + (VasEBoot_xnu_check_os_bundle_required): Likewise. + (VasEBoot_xnu_load_kext_from_dir): Likewise. + (VasEBoot_cmd_xnu_kextdir): Likewise. + * VasEBoot-core/loader/xnu_resume.c (VasEBoot_xnu_resume): Likewise. 2011-12-25 Vladimir Serbinenko - * grub-core/fs/minix.c (grub_minix_mount) [MODE_MINIX3]: Treat 0xffff + * VasEBoot-core/fs/minix.c (VasEBoot_minix_mount) [MODE_MINIX3]: Treat 0xffff as 1024 in block size field. Found on one of my test images. Small optimisation while on it. 2011-12-25 Vladimir Serbinenko - * docs/grub.texi (Filesystems): Mention SFS as Latin1 filesystem. - * grub-core/fs/sfs.c (grub_sfs_mount): Fix a memory leak while on it. - (grub_sfs_iterate_dir): Convert Latin1 to UTF8. Stylistic and + * docs/VasEBoot.texi (Filesystems): Mention SFS as Latin1 filesystem. + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_mount): Fix a memory leak while on it. + (VasEBoot_sfs_iterate_dir): Convert Latin1 to UTF8. Stylistic and performance fixes while on it. - (grub_sfs_close): Fix memory leak while on it. - (grub_sfs_label): Convert Latin1 to UTF-8. + (VasEBoot_sfs_close): Fix memory leak while on it. + (VasEBoot_sfs_label): Convert Latin1 to UTF-8. 2011-12-25 Vladimir Serbinenko - * grub-core/fs/hfs.c (grub_hfs_dir): Cap keylen to actually available + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_dir): Cap keylen to actually available space to avoid overflows. - (grub_hfs_label): Convert from macroman to UTF-8. + (VasEBoot_hfs_label): Convert from macroman to UTF-8. 2011-12-25 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_label): Interpret label as latin1. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_label): Interpret label as latin1. 2011-12-25 Vladimir Serbinenko - * grub-core/normal/menu.c (menu_init): Don't stop menu init at gfxterm. + * VasEBoot-core/normal/menu.c (menu_init): Don't stop menu init at gfxterm. 2011-12-25 Vladimir Serbinenko @@ -15253,29 +15253,29 @@ 2011-12-25 Vladimir Serbinenko - * grub-core/term/gfxterm.c (grub_gfxterm_putchar): Don't set values + * VasEBoot-core/term/gfxterm.c (VasEBoot_gfxterm_putchar): Don't set values outside of range. 2011-12-25 Vladimir Serbinenko Avoid cutting in the middle of UTF-8 character. - * include/grub/charset.h (grub_getend): New function. - * grub-core/script/function.c (grub_script_function_find): Use - grub_getend. - * grub-core/normal/completion.c (add_completion): Likewise. + * include/VasEBoot/charset.h (VasEBoot_getend): New function. + * VasEBoot-core/script/function.c (VasEBoot_script_function_find): Use + VasEBoot_getend. + * VasEBoot-core/normal/completion.c (add_completion): Likewise. 2011-12-25 Vladimir Serbinenko - * grub-core/normal/charset.c (grub_ucs4_to_utf8): Small stylistic fix. - (grub_bidi_line_logical_to_visual): Skip tags. They are deprecated. - * include/grub/unicode.h (GRUB_UNICODE_TAG_START): New enum value. - (GRUB_UNICODE_TAG_END): Likewise. - (GRUB_UNICODE_LAST_VALID): Likewise. + * VasEBoot-core/normal/charset.c (VasEBoot_ucs4_to_utf8): Small stylistic fix. + (VasEBoot_bidi_line_logical_to_visual): Skip tags. They are deprecated. + * include/VasEBoot/unicode.h (VasEBoot_UNICODE_TAG_START): New enum value. + (VasEBoot_UNICODE_TAG_END): Likewise. + (VasEBoot_UNICODE_LAST_VALID): Likewise. 2011-12-25 Vladimir Serbinenko - * include/grub/unicode.h (grub_unicode_compact_range): Replace end with + * include/VasEBoot/unicode.h (VasEBoot_unicode_compact_range): Replace end with len and make it smaller. All users updated. * util/import_unicode.py: Put length and not end character. Check length. @@ -15284,25 +15284,25 @@ Make better Unicode-compliant and unify some UTF-8 code pathes. - * grub-core/normal/charset.c (grub_utf8_to_utf16): Don't eat possibly + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_to_utf16): Don't eat possibly valid character. - (grub_is_valid_utf8): Use grub_utf8_process. + (VasEBoot_is_valid_utf8): Use VasEBoot_utf8_process. Check resulting code range. - (grub_utf8_to_ucs4): Use grub_utf8_process. - * include/grub/charset.h (grub_utf16_to_utf8): Don't eat up a possibly + (VasEBoot_utf8_to_ucs4): Use VasEBoot_utf8_process. + * include/VasEBoot/charset.h (VasEBoot_utf16_to_utf8): Don't eat up a possibly valid character. 2011-12-25 Vladimir Serbinenko - * grub-core/io/bufio.c (grub_bufio_read): Fix handling of corner cases. + * VasEBoot-core/io/bufio.c (VasEBoot_bufio_read): Fix handling of corner cases. 2011-12-25 Vladimir Serbinenko - * docs/grub.texi (Filesystems): Mention AFS. + * docs/VasEBoot.texi (Filesystems): Mention AFS. 2011-12-25 Vladimir Serbinenko - * docs/grub.texi (Filesystems): Clarify restrictions. + * docs/VasEBoot.texi (Filesystems): Clarify restrictions. (Regexp): Mention non-Unicode regexp behaviour. (Other): Mention non-Unicode matching behaviour. @@ -15310,49 +15310,49 @@ Make HFS implementation use MacRoman. - * grub-core/fs/hfs.c (MAX_UTF8_PER_MAC_ROMAN): New define. + * VasEBoot-core/fs/hfs.c (MAX_UTF8_PER_MAC_ROMAN): New define. (macroman): New const array. (macroman_to_utf8): New function. (utf8_to_macroman): Likewise. - (grub_hfs_find_dir): Use utf8_to_macroman. - (grub_hfs_dir): Use macroman_to_utf8. + (VasEBoot_hfs_find_dir): Use utf8_to_macroman. + (VasEBoot_hfs_dir): Use macroman_to_utf8. Set case_insensitive. 2011-12-24 Vladimir Serbinenko - * docs/grub.texi (Filesystems): Add IEEE1275 full-path example. + * docs/VasEBoot.texi (Filesystems): Add IEEE1275 full-path example. 2011-12-24 Vladimir Serbinenko Integrate hints into autogeneration scripts. - * docs/grub.texi (Filesystems): Add a hostdisk example. - * Makefile.util.def (grub-mkdevicemap): Remove ofpath. - (grub-probe): Add ofpath. + * docs/VasEBoot.texi (Filesystems): Add a hostdisk example. + * Makefile.util.def (VasEBoot-mkdevicemap): Remove ofpath. + (VasEBoot-probe): Add ofpath. * gentpl.py: Remove group nosparc64. - * grub-core/commands/search.c (cache_entry): New struct. + * VasEBoot-core/commands/search.c (cache_entry): New struct. (cache): New var. (FUNC_NAME): Use and save cache. Fix handling of trailing comma. - * grub-core/commands/search_wrap.c (options): Add platform-specific + * VasEBoot-core/commands/search_wrap.c (options): Add platform-specific hint options. - (grub_cmd_search): Handle platform-specific hints. - (GRUB_MOD_INIT): Declare grub_cmd_search as accept_dash. - * grub-core/kern/emu/hostdisk.c (map): New field device_map. - (grub_util_biosdisk_data): Likewise. - (grub_util_biosdisk_open): Set device_map. + (VasEBoot_cmd_search): Handle platform-specific hints. + (VasEBoot_MOD_INIT): Declare VasEBoot_cmd_search as accept_dash. + * VasEBoot-core/kern/emu/hostdisk.c (map): New field device_map. + (VasEBoot_util_biosdisk_data): Likewise. + (VasEBoot_util_biosdisk_open): Set device_map. (read_device_map): Handle "" as indication of no map. Set device_map. (find_system_device): Add hostdisk/ prefix for autogenerated entries. - (grub_util_biosdisk_get_compatibility_hint): New function. - * grub-core/normal/main.c (features): Add feature_platform_search_hint. - * include/grub/emu/hostdisk.h - (grub_util_biosdisk_get_compatibility_hint): New proto. - * util/grub-install.in: Don't call grub-mkdevicemap. + (VasEBoot_util_biosdisk_get_compatibility_hint): New function. + * VasEBoot-core/normal/main.c (features): Add feature_platform_search_hint. + * include/VasEBoot/emu/hostdisk.h + (VasEBoot_util_biosdisk_get_compatibility_hint): New proto. + * util/VasEBoot-install.in: Don't call VasEBoot-mkdevicemap. Add platform-specific hint to load.cfg. - * util/grub-mkconfig.in: Don't call grub-mkdevicemap. - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Add + * util/VasEBoot-mkconfig.in: Don't call VasEBoot-mkdevicemap. + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Add hints. Set root preliminary to compatibility hint, not to OS name. - * util/grub-probe.c (PRINT_*): Add hints. + * util/VasEBoot-probe.c (PRINT_*): Add hints. (print): Make static. (escape_of_path): New function. (guess_bios_drive): Likewise. @@ -15364,30 +15364,30 @@ * util/ieee1275/devicemap.c: Removed. * util/ieee1275/ofpath.c (find_obppath): Allow to fail. All users updated. - (grub_util_devname_to_ofpath): Return NULL on failure. + (VasEBoot_util_devname_to_ofpath): Return NULL on failure. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev): Fix + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Fix resource leak. - * util/getroot.c (grub_util_pull_device): Fix memory leak. + * util/getroot.c (VasEBoot_util_pull_device): Fix memory leak. * po/POTFILES.in: Regenerated. Allow purely long options - * grub-core/lib/arg.c (SHORT_ARG_HELP): Removed. + * VasEBoot-core/lib/arg.c (SHORT_ARG_HELP): Removed. (SHORT_ARG_USAGE): Likewise. - (grub_arg_show_help): Compare opt with help_options. + (VasEBoot_arg_show_help): Compare opt with help_options. (parse_option): Receive opt as argument. If makes big simplificatons. All users updated 2011-12-24 Vladimir Serbinenko - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (WORDS_BIGENDIAN): + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h (WORDS_BIGENDIAN): Restructure to avoid warning. 2011-12-24 Vladimir Serbinenko - * util/grub-install.in: Account for possible escaped comma in device + * util/VasEBoot-install.in: Account for possible escaped comma in device name. 2011-12-24 Vladimir Serbinenko @@ -15397,36 +15397,36 @@ 2011-12-24 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_devalias_iterate): Fix + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_devalias_iterate): Fix allocation and zero-setting. - (grub_ieee1275_get_devname): Check that alias is complete. + (VasEBoot_ieee1275_get_devname): Check that alias is complete. 2011-12-24 Vladimir Serbinenko - * grub-core/kern/disk.c (grub_disk_read): Fix hook calling for + * VasEBoot-core/kern/disk.c (VasEBoot_disk_read): Fix hook calling for unaligned segments. 2011-12-24 Vladimir Serbinenko - * grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Add ieee1275/ + * VasEBoot-core/disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Add ieee1275/ prefix. - (grub_ofdisk_open): Check and discard ieee1275 prefix. - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): + (VasEBoot_ofdisk_open): Check and discard ieee1275 prefix. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): Add ieee1275 prefix. 2011-12-23 Vladimir Serbinenko - * docs/grub.texi (Filesystems): Update. + * docs/VasEBoot.texi (Filesystems): Update. 2011-12-23 Vladimir Serbinenko Support odc, newc and bigendian cpio formats. - * Makefile.util.def (libgrubmods): Add odc.c, newc.c and cpio_be.c. - * grub-core/Makefile.core.def (newc): New module. + * Makefile.util.def (libVasEBootmods): Add odc.c, newc.c and cpio_be.c. + * VasEBoot-core/Makefile.core.def (newc): New module. (odc): Likewise. (cpio_be): Likewise. - * grub-core/fs/cpio.c (ALIGN_CPIO): New macro. + * VasEBoot-core/fs/cpio.c (ALIGN_CPIO): New macro. (MAGIC): Likewise. (MAGIC2): Likewise. (head) [MODE_ODC]: Adapt for the format. @@ -15435,43 +15435,43 @@ (MAGIC_USTAR): Removed. (read_number) [MODE_NEWC]: Change to hex. (read_number) [!MODE_*]: Parse binary arrays. - (grub_cpio_find_file): Factor out the code for better structure and + (VasEBoot_cpio_find_file): Factor out the code for better structure and always use read_number. - (grub_cpio_mount): Use MAGIC and MAGIC2. - (grub_cpio_dir): Exit on first hook non-0 return. - (grub_cpio_fs) [MODE_ODC]: Set name to odc. - (grub_cpio_fs) [MODE_NEWC]: Set name to newc. - (GRUB_MOD_INIT) [MODE_ODC]: Set name to odc. - (GRUB_MOD_INIT) [MODE_NEWC]: Set name to newc. - (GRUB_MOD_FINI) [MODE_ODC]: Set name to odc. - (GRUB_MOD_FINI) [MODE_NEWC]: Set name to newc. - * grub-core/fs/newc.c: New file. - * grub-core/fs/odc.c: Likewise. - * grub-core/fs/cpio_be.c: Likewise. + (VasEBoot_cpio_mount): Use MAGIC and MAGIC2. + (VasEBoot_cpio_dir): Exit on first hook non-0 return. + (VasEBoot_cpio_fs) [MODE_ODC]: Set name to odc. + (VasEBoot_cpio_fs) [MODE_NEWC]: Set name to newc. + (VasEBoot_MOD_INIT) [MODE_ODC]: Set name to odc. + (VasEBoot_MOD_INIT) [MODE_NEWC]: Set name to newc. + (VasEBoot_MOD_FINI) [MODE_ODC]: Set name to odc. + (VasEBoot_MOD_FINI) [MODE_NEWC]: Set name to newc. + * VasEBoot-core/fs/newc.c: New file. + * VasEBoot-core/fs/odc.c: Likewise. + * VasEBoot-core/fs/cpio_be.c: Likewise. 2011-12-23 Vladimir Serbinenko Fix handling of tar numbers occupying the whole field. - * grub-core/fs/cpio.c (read_number): New function. - (grub_cpio_find_file): Use read_number instead of strtoull. + * VasEBoot-core/fs/cpio.c (read_number): New function. + (VasEBoot_cpio_find_file): Use read_number instead of strtoull. 2011-12-23 Vladimir Serbinenko - * grub-core/fs/cpio.c (grub_cpio_find_file): Fix handling of names + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_find_file): Fix handling of names occupying the whole field size. 2011-12-23 Lukas Anzinger - * util/grub-mkconfig_lib.in (version_test_gt): Fix variable names. + * util/VasEBoot-mkconfig_lib.in (version_test_gt): Fix variable names. 2011-12-23 Vladimir Serbinenko - * grub-core/net/net.c (grub_cmd_delroute): Add missing out condition. + * VasEBoot-core/net/net.c (VasEBoot_cmd_delroute): Add missing out condition. 2011-12-23 Seth Goldberg - * grub-core/Makefile.core.def (lzma_decompress): Add missing + * VasEBoot-core/Makefile.core.def (lzma_decompress): Add missing TARGET_IMG_LDFLAGS. 2011-12-23 Vladimir Serbinenko @@ -15484,180 +15484,180 @@ 2011-12-23 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (grub_reed_solomon_add_redundancy): Add + * VasEBoot-core/lib/reed_solomon.c (VasEBoot_reed_solomon_add_redundancy): Add an assert. - * util/grub-setup.c (setup): Likewise. + * util/VasEBoot-setup.c (setup): Likewise. 2011-12-23 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S: Add missing argument for + * VasEBoot-core/boot/i386/pc/startup_raw.S: Add missing argument for _LzmaDecodeA. 2011-12-22 Vladimir Serbinenko - * docs/grub.texi (Internationalisation): New section. + * docs/VasEBoot.texi (Internationalisation): New section. 2011-12-22 Vladimir Serbinenko - * docs/grub.texi (Loopback booting): New section. + * docs/VasEBoot.texi (Loopback booting): New section. 2011-12-22 Keshav P R - * util/grub-mkstandalone.in: Fix minor typo errors. + * util/VasEBoot-mkstandalone.in: Fix minor typo errors. 2011-12-20 Vladimir Serbinenko IPv6, TCP, HTTP, ICMP and DNS support. Several cleanups and bugfixes. - * grub-core/Makefile.core.def (net): Add net/dns.c, net/tcp.c, + * VasEBoot-core/Makefile.core.def (net): Add net/dns.c, net/tcp.c, net/icmp.c and net/icmp6.c. (http): New module. (priority_queue): Likewise. - * grub-core/io/bufio.c: Rewritten. - * grub-core/lib/legacy_parse.c (legacy_command): New argument type + * VasEBoot-core/io/bufio.c: Rewritten. + * VasEBoot-core/lib/legacy_parse.c (legacy_command): New argument type TYPE_WITH_CONFIGFILE_OPTION. (legacy_commands): Add bootp and dhcp. (is_option): Handle TYPE_WITH_CONFIGFILE_OPTION. - (grub_legacy_parse): Likewise. - * grub-core/lib/priority_queue.c: New file. - * grub-core/net/arp.c: Add missing license header. + (VasEBoot_legacy_parse): Likewise. + * VasEBoot-core/lib/priority_queue.c: New file. + * VasEBoot-core/net/arp.c: Add missing license header. (arp_find_entry): Removed. (arp_find_entry): Likewise. - (grub_net_arp_resolve): Rename to ... - (grub_net_arp_send_request): ...this. - (grub_net_arp_receive): New card argument. - * grub-core/net/bootp.c (parse_dhcp_vendor): Clean up. + (VasEBoot_net_arp_resolve): Rename to ... + (VasEBoot_net_arp_send_request): ...this. + (VasEBoot_net_arp_receive): New card argument. + * VasEBoot-core/net/bootp.c (parse_dhcp_vendor): Clean up. Set router and DNS server. - (grub_net_configure_by_dhcp_ack): Handle routing information. - (grub_cmd_bootp): Set checksum. - (grub_bootp_init): Remove net_dhcp. - * grub-core/net/dns.c: New file. - * grub-core/net/drivers/efi/efinet.c (send_card_buffer): Wait for + (VasEBoot_net_configure_by_dhcp_ack): Handle routing information. + (VasEBoot_cmd_bootp): Set checksum. + (VasEBoot_bootp_init): Remove net_dhcp. + * VasEBoot-core/net/dns.c: New file. + * VasEBoot-core/net/drivers/efi/efinet.c (send_card_buffer): Wait for completion. (get_card_packet): Handle allocation. - (grub_efinet_findcards): Set mtu. - * grub-core/net/drivers/emu/emunet.c: Add missing license header. + (VasEBoot_efinet_findcards): Set mtu. + * VasEBoot-core/net/drivers/emu/emunet.c: Add missing license header. (get_card_packet): Handle allocation. (emucard): Set mtu. - * grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_recv): Handle allocation - (GRUB_MOD_INIT): Set mtu. - * grub-core/net/drivers/ieee1275/ofnet.c (grub_ofnetcard_data): Remove + * VasEBoot-core/net/drivers/i386/pc/pxe.c (VasEBoot_pxe_recv): Handle allocation + (VasEBoot_MOD_INIT): Set mtu. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (VasEBoot_ofnetcard_data): Remove mtu. (get_card_packet): Handle allocation. - (grub_ofnet_findcards): Set mtu. - * grub-core/net/ethernet.c (send_ethernet_packet): Add compile time + (VasEBoot_ofnet_findcards): Set mtu. + * VasEBoot-core/net/ethernet.c (send_ethernet_packet): Add compile time assert. - (grub_net_recv_ethernet_packet): Handle IPv6. - * grub-core/net/http.c: New file. - * grub-core/net/icmp.c: Likewise. - * grub-core/net/icmp6.c: Likewise. - * grub-core/net/ip.c (ip6addr): New type. + (VasEBoot_net_recv_ethernet_packet): Handle IPv6. + * VasEBoot-core/net/http.c: New file. + * VasEBoot-core/net/icmp.c: Likewise. + * VasEBoot-core/net/icmp6.c: Likewise. + * VasEBoot-core/net/ip.c (ip6addr): New type. (ip6hdr): Likewise. (reassemble): Likewise. (cmp): New function. (reassembles): New variable. - (grub_net_ip_chksum): Handle 0xffff sum and unaligned buffers. + (VasEBoot_net_ip_chksum): Handle 0xffff sum and unaligned buffers. (id): New variable. (send_fragmented): New function. - (grub_net_send_ip_packet): Rename to ... - (grub_net_send_ip4_packet): ... this. Send fragmented if needed. + (VasEBoot_net_send_ip_packet): Rename to ... + (VasEBoot_net_send_ip4_packet): ... this. Send fragmented if needed. Handle non-UDP. - (grub_net_recv_ip_packets): Rename to ... + (VasEBoot_net_recv_ip_packets): Rename to ... (handle_dgram): ... this. Check checksum. Handle non-UDP. (free_rsm): New function. (free_old_fragments): Likewise. - (grub_net_recv_ip4_packets): New function. - (grub_net_send_ip6_packet): Likewise. - (grub_net_send_ip_packet): Likewise. - (grub_net_recv_ip6_packets): Likewise. - (grub_net_recv_ip_packets): Likewise. - * grub-core/net/net.c (grub_net_link_layer_entry): New struct. + (VasEBoot_net_recv_ip4_packets): New function. + (VasEBoot_net_send_ip6_packet): Likewise. + (VasEBoot_net_send_ip_packet): Likewise. + (VasEBoot_net_recv_ip6_packets): Likewise. + (VasEBoot_net_recv_ip_packets): Likewise. + * VasEBoot-core/net/net.c (VasEBoot_net_link_layer_entry): New struct. (LINK_LAYER_CACHE_SIZE): New const. (link_layer_find_entry): New function. - (grub_net_link_layer_add_address): Likewise. - (grub_net_link_layer_resolve_check): Likewise. - (grub_net_link_layer_resolve): Likewise. - (grub_net_ipv6_get_slaac): Likewise. - (grub_net_ipv6_get_link_local): Likewise. - (grub_cmd_ipv6_autoconf): Likewise. + (VasEBoot_net_link_layer_add_address): Likewise. + (VasEBoot_net_link_layer_resolve_check): Likewise. + (VasEBoot_net_link_layer_resolve): Likewise. + (VasEBoot_net_ipv6_get_slaac): Likewise. + (VasEBoot_net_ipv6_get_link_local): Likewise. + (VasEBoot_cmd_ipv6_autoconf): Likewise. (parse_ip): Handle one number representation. (parse_ip6): New functoion. (match_net): Handle IPv6. - (grub_net_resolve_address): Handle IPv6 and DNS. - (grub_net_resolve_net_address): Handle IPv6. + (VasEBoot_net_resolve_address): Handle IPv6 and DNS. + (VasEBoot_net_resolve_net_address): Handle IPv6. (route_cmp): New function. - (grub_net_route_address): Find best route. - (grub_net_addr_to_str): Handle IPv6. - (grub_net_addr_cmp): New function. - (grub_net_add_addr): Register local route. + (VasEBoot_net_route_address): Find best route. + (VasEBoot_net_addr_to_str): Handle IPv6. + (VasEBoot_net_addr_cmp): New function. + (VasEBoot_net_add_addr): Register local route. (print_net_address): Handle net address. - (grub_net_poll_cards): Retransmit TCP. - (grub_net_poll_cards_idle_real): Likewise. + (VasEBoot_net_poll_cards): Retransmit TCP. + (VasEBoot_net_poll_cards_idle_real): Likewise. (have_ahead): New function. - (grub_net_seek_real): Use underlying seek. - (GRUB_MOD_INIT): Register net_ipv6_autoconf and init dns. - * grub-core/net/tcp.c: New file. - * grub-core/net/tftp.c (tftp_data): Add priority_queue. + (VasEBoot_net_seek_real): Use underlying seek. + (VasEBoot_MOD_INIT): Register net_ipv6_autoconf and init dns. + * VasEBoot-core/net/tcp.c: New file. + * VasEBoot-core/net/tftp.c (tftp_data): Add priority_queue. (cmp): New function. (ack): Likewise. (tftp_receive): Handle unordered input. (destroy_pq): New function. (tftp_close): Close pq. - * grub-core/net/udp.c: Put missing license header. - (grub_net_udp_socket): New function. + * VasEBoot-core/net/udp.c: Put missing license header. + (VasEBoot_net_udp_socket): New function. (udp_socket_register): Likewise. - (grub_net_udp_close): Likewise. - (grub_net_recv_udp_packet): Check checksum. - * include/grub/efi/api.h (grub_efi_simple_network): Add status. - * include/grub/misc.h (grub_memchr): New function. - * include/grub/net.h (GRUB_NET_*_SIZE): New enum. - (grub_net_card_driver): Return buf in recv. - (grub_net_slaac_mac_list): New struct. - (grub_network_level_protocol_id): Add ipv6. - (grub_net_network_level_addr): Likewise. - (grub_net_network_level_net_addr): Likewise. - (grub_net_app_protocol): Add seek. - (grub_net_socket): Removed. - (grub_net_sockets): Likewise. - (grub_net_socket_register): Likewise. - (grub_net_socket_unregister): Likewise. + (VasEBoot_net_udp_close): Likewise. + (VasEBoot_net_recv_udp_packet): Check checksum. + * include/VasEBoot/efi/api.h (VasEBoot_efi_simple_network): Add status. + * include/VasEBoot/misc.h (VasEBoot_memchr): New function. + * include/VasEBoot/net.h (VasEBoot_NET_*_SIZE): New enum. + (VasEBoot_net_card_driver): Return buf in recv. + (VasEBoot_net_slaac_mac_list): New struct. + (VasEBoot_network_level_protocol_id): Add ipv6. + (VasEBoot_net_network_level_addr): Likewise. + (VasEBoot_net_network_level_net_addr): Likewise. + (VasEBoot_net_app_protocol): Add seek. + (VasEBoot_net_socket): Removed. + (VasEBoot_net_sockets): Likewise. + (VasEBoot_net_socket_register): Likewise. + (VasEBoot_net_socket_unregister): Likewise. (FOR_NET_SOCKETS): Likewise. - (grub_net_add_addr): Add const. - (GRUB_NET_BOOTP_*): New enum. - (grub_net_addr_cmp): New proto. - (GRUB_NET_MAX_STR_ADDR_LEN): Take IPV6 into account. - (GRUB_NET_MAX_STR_HWADDR_LEN): New define. - (grub_net_hwaddr_to_str): NEw proto. + (VasEBoot_net_add_addr): Add const. + (VasEBoot_NET_BOOTP_*): New enum. + (VasEBoot_net_addr_cmp): New proto. + (VasEBoot_NET_MAX_STR_ADDR_LEN): Take IPV6 into account. + (VasEBoot_NET_MAX_STR_HWADDR_LEN): New define. + (VasEBoot_net_hwaddr_to_str): NEw proto. (FOR_NET_NETWORK_LEVEL_INTERFACES): New macro. (FOR_NET_NETWORK_LEVEL_INTERFACES_SAFE): Handle NULL. - (grub_dns_init): New proto. - (grub_dns_fini): Likewise. - (grub_net_tcp_retransmit): Likewise. - (grub_net_link_layer_add_address): Likewise. - (grub_net_link_layer_resolve_check): Likewise. - (grub_net_link_layer_resolve): Likewise. - (grub_net_dns_lookup): Likewise. - (grub_net_add_dns_server): Likewise. - (grub_net_remove_dns_server): Likewise. - (GRUB_NET_TRIES): New const. - (GRUB_NET_INTERVAL): Likewise. - * include/grub/net/arp.h: Mostly rewritten. - * include/grub/net/ethernet.h (grub_net_ethertype_t): New enum. - * include/grub/net/ip.h: Mostly rewritten. - * include/grub/net/netbuff.h: Indent. - * include/grub/net/tcp.h: New file. - * include/grub/net/udp.h: Mostly rewritten. - * include/grub/priority_queue.h: New file. - * include/grub/types.h (PRIdGRUB_SSIZE): New define. - (grub_swap_bytes64_compile_time): Likewise. - (grub_cpu_to_be16_compile_time): Likewise. - (grub_cpu_to_be32_compile_time): Likewise. - (grub_cpu_to_be64_compile_time): Likewise. - (grub_be_to_cpu64_compile_time): Likewise. + (VasEBoot_dns_init): New proto. + (VasEBoot_dns_fini): Likewise. + (VasEBoot_net_tcp_retransmit): Likewise. + (VasEBoot_net_link_layer_add_address): Likewise. + (VasEBoot_net_link_layer_resolve_check): Likewise. + (VasEBoot_net_link_layer_resolve): Likewise. + (VasEBoot_net_dns_lookup): Likewise. + (VasEBoot_net_add_dns_server): Likewise. + (VasEBoot_net_remove_dns_server): Likewise. + (VasEBoot_NET_TRIES): New const. + (VasEBoot_NET_INTERVAL): Likewise. + * include/VasEBoot/net/arp.h: Mostly rewritten. + * include/VasEBoot/net/ethernet.h (VasEBoot_net_ethertype_t): New enum. + * include/VasEBoot/net/ip.h: Mostly rewritten. + * include/VasEBoot/net/netbuff.h: Indent. + * include/VasEBoot/net/tcp.h: New file. + * include/VasEBoot/net/udp.h: Mostly rewritten. + * include/VasEBoot/priority_queue.h: New file. + * include/VasEBoot/types.h (PRIdVasEBoot_SSIZE): New define. + (VasEBoot_swap_bytes64_compile_time): Likewise. + (VasEBoot_cpu_to_be16_compile_time): Likewise. + (VasEBoot_cpu_to_be32_compile_time): Likewise. + (VasEBoot_cpu_to_be64_compile_time): Likewise. + (VasEBoot_be_to_cpu64_compile_time): Likewise. 2011-12-16 Vladimir Serbinenko - * grub-core/commands/i386/pc/drivemap.c (int13slot): Replace + * VasEBoot-core/commands/i386/pc/drivemap.c (int13slot): Replace UINT_TO_PTR with cast. 2011-12-15 Vladimir Serbinenko @@ -15672,21 +15672,21 @@ 2011-12-15 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Clean multiboot header to avoid + * util/VasEBoot-mkimage.c (generate_image): Clean multiboot header to avoid confusing ipxe. 2011-12-15 Vladimir Serbinenko - * grub-core/lib/libgcrypt/cipher/md4.c (transform) [WORDS_BIGENDIAN]: + * VasEBoot-core/lib/libgcrypt/cipher/md4.c (transform) [WORDS_BIGENDIAN]: Add missing const attribute. - * grub-core/lib/libgcrypt/cipher/md5.c (transform) [WORDS_BIGENDIAN]: + * VasEBoot-core/lib/libgcrypt/cipher/md5.c (transform) [WORDS_BIGENDIAN]: Likewise. - * grub-core/lib/libgcrypt/cipher/rmd160.c (transform) [WORDS_BIGENDIAN]: + * VasEBoot-core/lib/libgcrypt/cipher/rmd160.c (transform) [WORDS_BIGENDIAN]: Likewise. 2011-12-15 Vladimir Serbinenko - * grub-core/lib/libgcrypt/cipher/serpent.c (serpent_key_prepare): Fix + * VasEBoot-core/lib/libgcrypt/cipher/serpent.c (serpent_key_prepare): Fix misaligned access. (serpent_setkey): Likewise. (serpent_encrypt_internal): Likewise. @@ -15697,76 +15697,76 @@ 2011-12-15 Vladimir Serbinenko - * grub-core/loader/multiboot.c (grub_cmd_module): Fix target address. + * VasEBoot-core/loader/multiboot.c (VasEBoot_cmd_module): Fix target address. 2011-12-15 Vladimir Serbinenko - Replace UINT_TO_PTR and PTR_TO_UINT with explicit grub_addr_t casts. + Replace UINT_TO_PTR and PTR_TO_UINT with explicit VasEBoot_addr_t casts. - * include/grub/types.h (UINT_TO_PTR): Removed. All users switched to - grub_addr_t casts. + * include/VasEBoot/types.h (UINT_TO_PTR): Removed. All users switched to + VasEBoot_addr_t casts. (PTR_TO_UINT64): Likewise. (PTR_TO_UINT32): Likewise. 2011-12-15 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Decrease the higher limit + * util/VasEBoot-mkimage.c (generate_image): Decrease the higher limit because of stack. - * util/grub-setup.c (setup): Don't add redundancy past the higher load + * util/VasEBoot-setup.c (setup): Don't add redundancy past the higher load limit. 2011-12-15 Vladimir Serbinenko - * grub-core/gfxmenu/gui_label.c (label_paint): Handle the case + * VasEBoot-core/gfxmenu/gui_label.c (label_paint): Handle the case text_width > available width a bit more gracefully. 2011-12-15 Vladimir Serbinenko - * grub-core/loader/i386/bsdXX.c (grub_freebsd_load_elfmodule): Fix + * VasEBoot-core/loader/i386/bsdXX.c (VasEBoot_freebsd_load_elfmodule): Fix current address calculation. 2011-12-15 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (decode_block): Allocate on heap and not + * VasEBoot-core/lib/reed_solomon.c (decode_block): Allocate on heap and not stack. (encode_block): Likewise. 2011-12-15 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S: Clear direction flag for + * VasEBoot-core/boot/i386/pc/startup_raw.S: Clear direction flag for certainety. 2011-12-15 Vladimir Serbinenko - * grub-core/boot/i386/pc/startup_raw.S: Move realmode routines to + * VasEBoot-core/boot/i386/pc/startup_raw.S: Move realmode routines to non-RS part to avoid RS messing with GDT. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Increase to suit in realmode routines. 2011-12-15 Vladimir Serbinenko - * grub-core/kern/i386/realmode.S: Increase alignment. - * grub-core/boot/i386/pc/startup_raw.S: Likewise. + * VasEBoot-core/kern/i386/realmode.S: Increase alignment. + * VasEBoot-core/boot/i386/pc/startup_raw.S: Likewise. 2011-12-14 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (init_powx): Set gf_powx_inv[0] just to + * VasEBoot-core/lib/reed_solomon.c (init_powx): Set gf_powx_inv[0] just to be deterministic. (syndroms): Compute 0 syndrom. (rs_recover): Use 0 syndrom. 2011-12-14 Vladimir Serbinenko - * include/grub/kernel.h (FOR_MODULES): Make it a bit faster. + * include/VasEBoot/kernel.h (FOR_MODULES): Make it a bit faster. 2011-12-14 Vladimir Serbinenko - * include/grub/types.h (GRUB_PROPERLY_ALIGNED_ARRAY): Add missing + * include/VasEBoot/types.h (VasEBoot_PROPERLY_ALIGNED_ARRAY): Add missing brackets. 2011-12-14 Vladimir Serbinenko - * grub-core/gfxmenu/widget-box.c (get_left_pad): Take corners into + * VasEBoot-core/gfxmenu/widget-box.c (get_left_pad): Take corners into account. (get_top_pad): Likewise. (get_right_pad): Likewise. @@ -15774,252 +15774,252 @@ 2011-12-14 Vladimir Serbinenko - * grub-core/gfxmenu/gui_list.c (draw_menu): Don't use assignment in if. + * VasEBoot-core/gfxmenu/gui_list.c (draw_menu): Don't use assignment in if. 2011-12-14 Vladimir Serbinenko - * include/grub/efi/api.h (grub_efi_memory_descriptor): Add packed + * include/VasEBoot/efi/api.h (VasEBoot_efi_memory_descriptor): Add packed attribute as the structure isn't guaranteed to be properly aligned. - (grub_efi_pci_device_path): Likewise. - (grub_efi_pccard_device_path): Likewise. - (grub_efi_memory_mapped_device_path): Likewise. Additionaly explicitly + (VasEBoot_efi_pci_device_path): Likewise. + (VasEBoot_efi_pccard_device_path): Likewise. + (VasEBoot_efi_memory_mapped_device_path): Likewise. Additionaly explicitly specify the size of `memory_type'. - (grub_efi_vendor_device_path): Likewise. - (grub_efi_controller_device_path): Likewise. - (grub_efi_acpi_device_path): Likewise. - (grub_efi_expanded_acpi_device_path): Likewise. - (grub_efi_atapi_device_path): Likewise. - (grub_efi_scsi_device_path): Likewise. - (grub_efi_fibre_channel_device_path): Likewise. - (grub_efi_1394_device_path): Likewise. - (grub_efi_usb_device_path): Likewise. - (grub_efi_usb_class_device_path): Likewise. - (grub_efi_i2o_device_path): Likewise. - (grub_efi_mac_address_device_path): Likewise. - (grub_efi_ipv4_device_path): Likewise. - (grub_efi_ipv6_device_path): Likewise. - (grub_efi_infiniband_device_path): Likewise. - (grub_efi_uart_device_path): Likewise. - (grub_efi_vendor_messaging_device_path): Likewise. - (grub_efi_hard_drive_device_path): Likewise. - (grub_efi_cdrom_device_path): Likewise. - (grub_efi_vendor_media_device_path): Likewise. - (grub_efi_file_path_device_path): Likewise. - (grub_efi_protocol_device_path): Likewise. - (grub_efi_piwg_device_path): Likewise. - (grub_efi_bios_device_path): Likewise. + (VasEBoot_efi_vendor_device_path): Likewise. + (VasEBoot_efi_controller_device_path): Likewise. + (VasEBoot_efi_acpi_device_path): Likewise. + (VasEBoot_efi_expanded_acpi_device_path): Likewise. + (VasEBoot_efi_atapi_device_path): Likewise. + (VasEBoot_efi_scsi_device_path): Likewise. + (VasEBoot_efi_fibre_channel_device_path): Likewise. + (VasEBoot_efi_1394_device_path): Likewise. + (VasEBoot_efi_usb_device_path): Likewise. + (VasEBoot_efi_usb_class_device_path): Likewise. + (VasEBoot_efi_i2o_device_path): Likewise. + (VasEBoot_efi_mac_address_device_path): Likewise. + (VasEBoot_efi_ipv4_device_path): Likewise. + (VasEBoot_efi_ipv6_device_path): Likewise. + (VasEBoot_efi_infiniband_device_path): Likewise. + (VasEBoot_efi_uart_device_path): Likewise. + (VasEBoot_efi_vendor_messaging_device_path): Likewise. + (VasEBoot_efi_hard_drive_device_path): Likewise. + (VasEBoot_efi_cdrom_device_path): Likewise. + (VasEBoot_efi_vendor_media_device_path): Likewise. + (VasEBoot_efi_file_path_device_path): Likewise. + (VasEBoot_efi_protocol_device_path): Likewise. + (VasEBoot_efi_piwg_device_path): Likewise. + (VasEBoot_efi_bios_device_path): Likewise. 2011-12-14 Vladimir Serbinenko - * include/grub/charset.h (grub_utf16_to_utf8): Make src a const pointer. - (grub_ucs4_to_utf8_alloc): Likewise. - (grub_ucs4_to_utf8): Likewise. - * grub-core/normal/charset.c (grub_ucs4_to_utf8): Likewise. - (grub_ucs4_to_utf8_alloc): Likewise. + * include/VasEBoot/charset.h (VasEBoot_utf16_to_utf8): Make src a const pointer. + (VasEBoot_ucs4_to_utf8_alloc): Likewise. + (VasEBoot_ucs4_to_utf8): Likewise. + * VasEBoot-core/normal/charset.c (VasEBoot_ucs4_to_utf8): Likewise. + (VasEBoot_ucs4_to_utf8_alloc): Likewise. 2011-12-14 Vladimir Serbinenko AFFS never uses unicode. - * include/grub/charset.h (GRUB_MAX_UTF8_PER_LATIN1): New const. - (grub_latin1_to_utf8): New inline function. - * grub-core/fs/affs.c (grub_affs_iterate_dir): Convert latin1 to UTF8. + * include/VasEBoot/charset.h (VasEBoot_MAX_UTF8_PER_LATIN1): New const. + (VasEBoot_latin1_to_utf8): New inline function. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_iterate_dir): Convert latin1 to UTF8. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/romfs.c (grub_romfs_mount): Fix pointer comparison + * VasEBoot-core/fs/romfs.c (VasEBoot_romfs_mount): Fix pointer comparison overflow. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/squash4.c (grub_squash_inode): Fix field sizes. - (grub_squash_dirent_header): Likewise. + * VasEBoot-core/fs/squash4.c (VasEBoot_squash_inode): Fix field sizes. + (VasEBoot_squash_dirent_header): Likewise. (read_chunk): Don't double swap. - (grub_squash_iterate_dir): Fix swap sizes. + (VasEBoot_squash_iterate_dir): Fix swap sizes. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_getent): Handle UTF16 endianness. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_getent): Handle UTF16 endianness. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/hfs.c (grub_hfs_find_node): Handle unaligned keys. - (grub_hfs_iterate_dir): Likewise. + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_find_node): Handle unaligned keys. + (VasEBoot_hfs_iterate_dir): Likewise. 2011-12-13 Vladimir Serbinenko Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. - * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): - Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. - (grub_video_fbblit_replace_32bit_1bit): Likewise. - (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: + * VasEBoot-core/video/fb/fbblit.c (VasEBoot_video_fbblit_replace_directN): + Optimise and use VasEBoot_VIDEO_FB_ADVANCE_POINTER. + (VasEBoot_video_fbblit_replace_32bit_1bit): Likewise. + (VasEBoot_video_fbblit_replace_24bit_1bit) [!VasEBoot_HAVE_UNALIGNED_ACCESS]: Disable. - (grub_video_fbblit_replace_16bit_1bit): - Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. - (grub_video_fbblit_replace_8bit_1bit): Likewise. - (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. - (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. - (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. - (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. - (grub_video_fbblit_replace_BGR888_RGB888): Likewise. - (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. - (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. - (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. - (grub_video_fbblit_replace_index_RGBX8888): Likewise. - (grub_video_fbblit_replace_index_RGB888): Likewise. - (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. - (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. - (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. - (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. - (grub_video_fbblit_blend_index_RGBA8888): Likewise. - (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. - (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: + (VasEBoot_video_fbblit_replace_16bit_1bit): + Optimise and use VasEBoot_VIDEO_FB_ADVANCE_POINTER. + (VasEBoot_video_fbblit_replace_8bit_1bit): Likewise. + (VasEBoot_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. + (VasEBoot_video_fbblit_replace_BGRX8888_RGB888): Likewise. + (VasEBoot_video_fbblit_replace_BGR888_RGBX8888): Likewise. + (VasEBoot_video_fbblit_replace_BGR888_RGBX8888): Likewise. + (VasEBoot_video_fbblit_replace_BGR888_RGB888): Likewise. + (VasEBoot_video_fbblit_replace_RGBX8888_RGB88): Likewise. + (VasEBoot_video_fbblit_replace_RGB888_RGBX888): Likewise. + (VasEBoot_video_fbblit_replace_RGB888_RGBX8888): Likewise. + (VasEBoot_video_fbblit_replace_index_RGBX8888): Likewise. + (VasEBoot_video_fbblit_replace_index_RGB888): Likewise. + (VasEBoot_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. + (VasEBoot_video_fbblit_blend_BGR888_RGBA8888): Likewise. + (VasEBoot_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. + (VasEBoot_video_fbblit_blend_RGB888_RGBA8888): Likewise. + (VasEBoot_video_fbblit_blend_index_RGBA8888): Likewise. + (VasEBoot_video_fbblit_blend_XXXA8888_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXX888_1bit) [!VasEBoot_HAVE_UNALIGNED_ACCESS]: Disable. - (grub_video_fbblit_blend_XXX565_1bit): - Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. - * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. - * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return + (VasEBoot_video_fbblit_blend_XXX565_1bit): + Optimise and use VasEBoot_VIDEO_FB_ADVANCE_POINTER. + * VasEBoot-core/video/fb/fbfill.c (VasEBoot_video_fbfill_direct32): Likewise. + * VasEBoot-core/video/fb/fbutil.c (VasEBoot_video_fb_get_video_ptr): Return void *. - * grub-core/video/fb/video_fb.c (common_blitter) - [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. - (grub_video_fb_create_render_target_from_pointer) - [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. - * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. - * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New + * VasEBoot-core/video/fb/video_fb.c (common_blitter) + [!VasEBoot_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. + (VasEBoot_video_fb_create_render_target_from_pointer) + [!VasEBoot_HAVE_UNALIGNED_ACCESS]: Check alignment. + * include/VasEBoot/fbutil.h (VasEBoot_video_fb_get_video_ptr): Return void *. + * include/VasEBoot/i386/types.h (VasEBoot_HAVE_UNALIGNED_ACCESS): New definition. - * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise. + * include/VasEBoot/x86_64/types.h (VasEBoot_HAVE_UNALIGNED_ACCESS): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Support + * VasEBoot-core/kern/sparc64/dl.c (VasEBoot_arch_dl_relocate_symbols): Support HH22 and HM10 relocations. 2011-12-13 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vsnprintf_real): Fix fmt2 parsing. + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Fix fmt2 parsing. 2011-12-13 Vladimir Serbinenko - * grub-core/commands/videotest.c (grub_cmd_videotest): Check that + * VasEBoot-core/commands/videotest.c (VasEBoot_cmd_videotest): Check that allocation succeeded. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_convert_string): Make first + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_convert_string): Make first argument a u8 pointer. All users updated. Handle unaligned buffers. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Force inlining of + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Force inlining of add_part to workaround compiler bug. 2011-12-13 Vladimir Serbinenko - * include/grub/kernel.h (FOR_MODULES): Preserve alignment invariants. + * include/VasEBoot/kernel.h (FOR_MODULES): Preserve alignment invariants. 2011-12-13 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_add_elfsyms): + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_add_elfsyms): Reserve alignment invariants. - (grub_multiboot_load): Likewise. + (VasEBoot_multiboot_load): Likewise. (retrieve_video_parameters): Likewise. - (grub_multiboot_make_mbi): Likewise. + (VasEBoot_multiboot_make_mbi): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (grub_xnu_devprop_remove_property): Fix + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_xnu_devprop_remove_property): Fix incorrect pointer. 2011-12-13 Vladimir Serbinenko - * grub-core/disk/pata.c (grub_pata_pio_read): Handle unaligned buffer. - (grub_pata_pio_write): Likewise. + * VasEBoot-core/disk/pata.c (VasEBoot_pata_pio_read): Handle unaligned buffer. + (VasEBoot_pata_pio_write): Likewise. 2011-12-13 Vladimir Serbinenko Add noreturn attributes and remove unreachable code. - * grub-core/bus/cs5536.c (grub_cs5536_smbus_wait): Remove unreachable + * VasEBoot-core/bus/cs5536.c (VasEBoot_cs5536_smbus_wait): Remove unreachable code. - * grub-core/commands/halt.c (grub_cmd_halt): Remove unreachable + * VasEBoot-core/commands/halt.c (VasEBoot_cmd_halt): Remove unreachable code. Mark as noreturn. - * grub-core/commands/minicmd.c (grub_mini_cmd_exit): Likewise. - * grub-core/commands/reboot.c (grub_cmd_reboot): Likewise. - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Remove + * VasEBoot-core/commands/minicmd.c (VasEBoot_mini_cmd_exit): Likewise. + * VasEBoot-core/commands/reboot.c (VasEBoot_cmd_reboot): Likewise. + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Remove unreachable code. - * grub-core/kern/main.c (grub_main): Mark as noreturn. - * grub-core/kern/rescue_reader.c (grub_rescue_run): Likewise. - * grub-core/lib/posix_wrap/stdlib.h (abort): Likewise. - * grub-core/normal/menu.c (run_menu): Remove unreachable code. - * include/grub/kernel.h (grub_main): Mark as noreturn. - * include/grub/reader.h (grub_rescue_run): Likewise. + * VasEBoot-core/kern/main.c (VasEBoot_main): Mark as noreturn. + * VasEBoot-core/kern/rescue_reader.c (VasEBoot_rescue_run): Likewise. + * VasEBoot-core/lib/posix_wrap/stdlib.h (abort): Likewise. + * VasEBoot-core/normal/menu.c (run_menu): Remove unreachable code. + * include/VasEBoot/kernel.h (VasEBoot_main): Mark as noreturn. + * include/VasEBoot/reader.h (VasEBoot_rescue_run): Likewise. 2011-12-13 Vladimir Serbinenko - * include/grub/i386/qemu/memory.h (grub_machine_mmap_init): Remove + * include/VasEBoot/i386/qemu/memory.h (VasEBoot_machine_mmap_init): Remove redundant declaration. 2011-12-13 Vladimir Serbinenko - * include/grub/net.h (grub_net_network_level_interfaces): Remove + * include/VasEBoot/net.h (VasEBoot_net_network_level_interfaces): Remove redundant declaration. (FOR_NET_NETWORK_LEVEL_INTERFACES): Move to appropriate place. 2011-12-13 Vladimir Serbinenko - * grub-core/commands/hdparm.c (le16_to_char): Make src and dest uint16 * + * VasEBoot-core/commands/hdparm.c (le16_to_char): Make src and dest uint16 * to ensure alignment. - (grub_hdparm_print_identify): Make argument uint16 * to ensure + (VasEBoot_hdparm_print_identify): Make argument uint16 * to ensure alignment. Ensure tmp alignment. - (grub_cmd_hdparm): Ensure buf alignment. - * grub-core/disk/ata.c (grub_ata_strncpy): Make src and dest uint16 * + (VasEBoot_cmd_hdparm): Ensure buf alignment. + * VasEBoot-core/disk/ata.c (VasEBoot_ata_strncpy): Make src and dest uint16 * to ensure alignment. - (grub_ata_dumpinfo): Ensure text alignment. - (grub_atapi_identify): Preserve alignment invariant. - (grub_ata_identify): Likewise. Use grub_get_unaligned32 when necessary. + (VasEBoot_ata_dumpinfo): Ensure text alignment. + (VasEBoot_atapi_identify): Preserve alignment invariant. + (VasEBoot_ata_identify): Likewise. Use VasEBoot_get_unaligned32 when necessary. 2011-12-13 Vladimir Serbinenko - * include/grub/emu/misc.h (xasprintf): Add missing format attribute. - * include/grub/mips/kernel.h (grub_halt): Remove redundant declaration. - * include/grub/mips/qemu_mips/kernel.h (grub_halt): Likewise. - * include/grub/misc.h (grub_reboot) - [GRUB_MACHINE_EMU || GRUB_MACHINE_QEMU_MIPS]: Export. - (grub_halt) [__mips__]: Likewise. + * include/VasEBoot/emu/misc.h (xasprintf): Add missing format attribute. + * include/VasEBoot/mips/kernel.h (VasEBoot_halt): Remove redundant declaration. + * include/VasEBoot/mips/qemu_mips/kernel.h (VasEBoot_halt): Likewise. + * include/VasEBoot/misc.h (VasEBoot_reboot) + [VasEBoot_MACHINE_EMU || VasEBoot_MACHINE_QEMU_MIPS]: Export. + (VasEBoot_halt) [__mips__]: Likewise. 2011-12-13 Vladimir Serbinenko - * include/grub/efi/memory.h (grub_machine_mmap_iterate): + * include/VasEBoot/efi/memory.h (VasEBoot_machine_mmap_iterate): Remove redundant declaration. - (grub_mmap_get_post64): Likewise. - (grub_mmap_get_upper): Likewise. - (grub_mmap_get_lower): Likewise. + (VasEBoot_mmap_get_post64): Likewise. + (VasEBoot_mmap_get_upper): Likewise. + (VasEBoot_mmap_get_lower): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/partmap/dvh.c (grub_dvh_is_valid): Make argument + * VasEBoot-core/partmap/dvh.c (VasEBoot_dvh_is_valid): Make argument uint32_t * to ensure alignment. (dvh_partition_map_iterate): Make `block' a union to ensure alignment. 2011-12-13 Vladimir Serbinenko - * grub-core/partmap/sunpc.c (grub_sun_is_valid): Make argument + * VasEBoot-core/partmap/sunpc.c (VasEBoot_sun_is_valid): Make argument uint16_t * to ensure alignment. (sun_pc_partition_map_iterate): Make `block' a union to ensure alignment. 2011-12-13 Vladimir Serbinenko - * grub-core/partmap/sun.c (grub_sun_is_valid): Make argument uint16_t * + * VasEBoot-core/partmap/sun.c (VasEBoot_sun_is_valid): Make argument uint16_t * to ensure alignment. (sun_partition_map_iterate): Make `block' a union to ensure alignment. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/ntfs.c (u16at): Make into inline function. + * VasEBoot-core/fs/ntfs.c (u16at): Make into inline function. Handle unaligned pointers. (u32at): Likewise. (u64at): Likewise. @@ -16027,23 +16027,23 @@ (find_attr): Fix imporper usage of v32at. (read_data): Likewise. (list_file): Handle byte-swapping and unaligned strings. - (grub_ntfs_label): Likewise. + (VasEBoot_ntfs_label): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/udf.c (grub_udf_partmap): Add packed attribute + * VasEBoot-core/fs/udf.c (VasEBoot_udf_partmap): Add packed attribute as it's not necessarily aligned. 2011-12-13 Vladimir Serbinenko - * grub-core/kern/mips/qemu_mips/init.c (grub_at_keyboard_init): Remove + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_at_keyboard_init): Remove redundant declaration. - (grub_serial_init): Likewise. - (grub_terminfo_init): Likewise. + (VasEBoot_serial_init): Likewise. + (VasEBoot_terminfo_init): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (DVA_OFFSET_TO_PHYS_SECTOR): Make into inline + * VasEBoot-core/fs/zfs/zfs.c (DVA_OFFSET_TO_PHYS_SECTOR): Make into inline function. (ZAP_HASH_IDX): Likewise. (ZAP_LEAF_HASH_SHIFT): Likewise. @@ -16055,236 +16055,236 @@ (ZAP_LEAF_ENTRY): Make into inline function. (NBBY): Removed. (xor): LIkewise. - (xor_out): Use grub_crypto_xor. - (dnode_get_path): Use grub_get_unaligned. + (xor_out): Use VasEBoot_crypto_xor. + (dnode_get_path): Use VasEBoot_get_unaligned. (nvlist_find_value): Likewise. - (grub_zfs_nvlist_lookup_uint64): Likewise. - (grub_zfs_nvlist_lookup_string): Likewise. + (VasEBoot_zfs_nvlist_lookup_uint64): Likewise. + (VasEBoot_zfs_nvlist_lookup_string): Likewise. (get_nvlist_size): Likewise. - (grub_zfs_open): Likewise. + (VasEBoot_zfs_open): Likewise. (fill_fs_info): Likewise. - (grub_zfs_dir): Likewise. - * include/grub/zfs/zap_leaf.h (zap_leaf_phys): Adapt to preserve + (VasEBoot_zfs_dir): Likewise. + * include/VasEBoot/zfs/zap_leaf.h (zap_leaf_phys): Adapt to preserve alignment invariants. - * include/grub/zfs/zio.h (zio_eck_t): Mark as packed as it's not + * include/VasEBoot/zfs/zio.h (zio_eck_t): Mark as packed as it's not necessarily aligned. 2011-12-13 Vladimir Serbinenko - * grub-core/net/netbuff.c (grub_netbuff_alloc): Ensure proper alignment. + * VasEBoot-core/net/netbuff.c (VasEBoot_netbuff_alloc): Ensure proper alignment. 2011-12-13 Vladimir Serbinenko - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Change pointer + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Change pointer arithmetic to conserve alignment invariants. 2011-12-13 Vladimir Serbinenko - * include/grub/efiemu/efiemu.h (grub_efiemu_get_memory_map): Remove + * include/VasEBoot/efiemu/efiemu.h (VasEBoot_efiemu_get_memory_map): Remove redundant declaration. - (grub_efiemu_mm_obtain_request): Likewise. - (grub_efiemu_prepare): Likewise. + (VasEBoot_efiemu_mm_obtain_request): Likewise. + (VasEBoot_efiemu_prepare): Likewise. 2011-12-13 Vladimir Serbinenko - * include/grub/list.h: Explicitly cast return of grub_bad_type_cast + * include/VasEBoot/list.h: Explicitly cast return of VasEBoot_bad_type_cast to match types. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/hfsplus.c (grub_hfsplus_btree_recoffset): Handle the + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_btree_recoffset): Handle the case of aunaligned recptr. - (grub_hfsplus_read_block): Declare extoverflow as key to ensure + (VasEBoot_hfsplus_read_block): Declare extoverflow as key to ensure alignment. - (grub_hfsplus_btree_search): Handle unaligned index. + (VasEBoot_hfsplus_btree_search): Handle unaligned index. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Use grub_get_unaligned16 + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_iterate_dir): Use VasEBoot_get_unaligned16 to get freetag and skip. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_btree_node): Add zero-size keys + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_btree_node): Add zero-size keys array. - (grub_nilfs2_btree_node_dkeys): Ensure return pointer alignment. - (grub_nilfs2_btree_lookup): Ensure buffer alignment. + (VasEBoot_nilfs2_btree_node_dkeys): Ensure return pointer alignment. + (VasEBoot_nilfs2_btree_lookup): Ensure buffer alignment. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/romfs.c (grub_romfs_iterate_dir): Properly align + * VasEBoot-core/fs/romfs.c (VasEBoot_romfs_iterate_dir): Properly align name for checksum and fix allocation algorithm. 2011-12-13 Vladimir Serbinenko - * include/grub/types.h (grub_properly_aligned_t): New type. - (GRUB_PROPERLY_ALIGNED_ARRAY): New macro. - (grub_get_unaligned16): Add explicit casts. - (grub_get_unaligned32): Likewise. - (grub_get_unaligned64): Likewise. - (grub_set_unaligned16): New function. - (grub_set_unaligned32): Likewise. + * include/VasEBoot/types.h (VasEBoot_properly_aligned_t): New type. + (VasEBoot_PROPERLY_ALIGNED_ARRAY): New macro. + (VasEBoot_get_unaligned16): Add explicit casts. + (VasEBoot_get_unaligned32): Likewise. + (VasEBoot_get_unaligned64): Likewise. + (VasEBoot_set_unaligned16): New function. + (VasEBoot_set_unaligned32): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/normal/datetime.c (grub_weekday_names): Make const. + * VasEBoot-core/normal/datetime.c (VasEBoot_weekday_names): Make const. 2011-12-13 Vladimir Serbinenko - * grub-core/fs/udf.c (read_string): Macroify GRUB_MAX_UTF8_PER_UTF16. - * grub-core/fs/jfs.c (grub_jfs_diropen): Likewise. - * grub-core/fs/fat.c (grub_fat_iterate_dir): Likewise. + * VasEBoot-core/fs/udf.c (read_string): Macroify VasEBoot_MAX_UTF8_PER_UTF16. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_diropen): Likewise. + * VasEBoot-core/fs/fat.c (VasEBoot_fat_iterate_dir): Likewise. 2011-12-13 Vladimir Serbinenko - * grub-core/term/at_keyboard.c (set_scancodes): Fix preprocessor + * VasEBoot-core/term/at_keyboard.c (set_scancodes): Fix preprocessor conditionals. 2011-12-13 Vladimir Serbinenko - * grub-core/kern/emu/main.c (main): Add missing const qualifier. - * grub-core/loader/efi/appleloader.c (devdata): Likewise. + * VasEBoot-core/kern/emu/main.c (main): Add missing const qualifier. + * VasEBoot-core/loader/efi/appleloader.c (devdata): Likewise. 2011-12-13 Vladimir Serbinenko Unify and improve RAID and crypto xor. - * grub-core/disk/raid.c (grub_raid_block_xor): Removed. All users - changed to grub_crypto_xor - * grub-core/lib/crypto.c (grub_crypto_xor): Moved from here ... - * include/grub/crypto.h (grub_crypto_xor): ... here. Inlined. + * VasEBoot-core/disk/raid.c (VasEBoot_raid_block_xor): Removed. All users + changed to VasEBoot_crypto_xor + * VasEBoot-core/lib/crypto.c (VasEBoot_crypto_xor): Moved from here ... + * include/VasEBoot/crypto.h (VasEBoot_crypto_xor): ... here. Inlined. Use bigger types when possible. 2011-12-13 Vladimir Serbinenko - * grub-core/disk/raid.c (scan_devices): Fix condition. + * VasEBoot-core/disk/raid.c (scan_devices): Fix condition. 2011-12-13 Vladimir Serbinenko - * grub-core/net/drivers/ieee1275/ofnet.c (bootp_response_properties): + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (bootp_response_properties): Make name a const ptr. 2011-12-13 Vladimir Serbinenko - * grub-core/kern/ieee1275/ieee1275.c (grub_ieee1275_finddevice): Make + * VasEBoot-core/kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_finddevice): Make first argument a const pointer. - * grub-core/kern/ieee1275/openfw.c (grub_children_iterate): Likewise. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_finddevice): Update + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_children_iterate): Likewise. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_finddevice): Update proto. - (grub_children_iterate): Likewise. - (grub_machine_mmap_iterate): Remove redundant declaration. + (VasEBoot_children_iterate): Likewise. + (VasEBoot_machine_mmap_iterate): Remove redundant declaration. 2011-12-13 Vladimir Serbinenko - * grub-core/commands/acpi.c (grub_acpi_create_ebda) [!x86]: Disable. - (grub_cmd_acpi) [!x86]: Disable EBDA. + * VasEBoot-core/commands/acpi.c (VasEBoot_acpi_create_ebda) [!x86]: Disable. + (VasEBoot_cmd_acpi) [!x86]: Disable EBDA. 2011-12-13 Vladimir Serbinenko Enable UTF8 in gnulib regexp. - * config.h.in (RE_ENABLE_I18N) [!GRUB_UTIL]: New define. - * grub-core/lib/posix_wrap/ctype.h (islower): Use grub_islower. - (isupper): Use grub_isupper. + * config.h.in (RE_ENABLE_I18N) [!VasEBoot_UTIL]: New define. + * VasEBoot-core/lib/posix_wrap/ctype.h (islower): Use VasEBoot_islower. + (isupper): Use VasEBoot_isupper. (isascii): New inline function. - * grub-core/lib/posix_wrap/wchar.h: Replace dummy with real contents. - * grub-core/lib/posix_wrap/wctype.h: Likewise. - * grub-core/normal/charset.c (grub_utf8_process): New function. - (grub_utf8_to_utf16): Use grub_utf8_process. - (grub_encode_utf8_character): New function. - (grub_ucs4_to_utf8): Use grub_encode_utf8_character. - * include/grub/charset.h (grub_utf8_process): New declaration. - (grub_encode_utf8_character): Likewise. - * include/grub/misc.h (grub_islower): New inline function. - (grub_isupper): Likewise. - (grub_strchrsub): Moved down to fix the definitions. + * VasEBoot-core/lib/posix_wrap/wchar.h: Replace dummy with real contents. + * VasEBoot-core/lib/posix_wrap/wctype.h: Likewise. + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_process): New function. + (VasEBoot_utf8_to_utf16): Use VasEBoot_utf8_process. + (VasEBoot_encode_utf8_character): New function. + (VasEBoot_ucs4_to_utf8): Use VasEBoot_encode_utf8_character. + * include/VasEBoot/charset.h (VasEBoot_utf8_process): New declaration. + (VasEBoot_encode_utf8_character): Likewise. + * include/VasEBoot/misc.h (VasEBoot_islower): New inline function. + (VasEBoot_isupper): Likewise. + (VasEBoot_strchrsub): Moved down to fix the definitions. 2011-12-13 Vladimir Serbinenko - * grub-core/bus/usb/ohci.c (grub_ohci_check_transfer): Add an unsigned + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_ohci_check_transfer): Add an unsigned specification. 2011-12-13 Vladimir Serbinenko - * include/grub/loader.h (grub_loader_register_preboot_hook): + * include/VasEBoot/loader.h (VasEBoot_loader_register_preboot_hook): Use struct preboot * and not void * for handle. All users updated. - (grub_loader_unregister_preboot_hook): Likewise. + (VasEBoot_loader_unregister_preboot_hook): Likewise. 2011-12-12 Vladimir Serbinenko - * include/grub/charset.h (GRUB_MAX_UTF8_PER_UTF16): New const. - * grub-core/fs/hfsplus.c (grub_hfsplus_catkey_internal): Change to + * include/VasEBoot/charset.h (VasEBoot_MAX_UTF8_PER_UTF16): New const. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_catkey_internal): Change to UTF-16-BE. All users updated. - (grub_hfsplus_cmp_catkey): Fix unicode handling. - (grub_hfsplus_iterate_dir): Likewise. - (grub_hfsplus_label): Likewise. + (VasEBoot_hfsplus_cmp_catkey): Fix unicode handling. + (VasEBoot_hfsplus_iterate_dir): Likewise. + (VasEBoot_hfsplus_label): Likewise. 2011-12-12 Vladimir Serbinenko - * grub-core/disk/ahci.c (grub_ahci_pciinit): Fix compat condition. + * VasEBoot-core/disk/ahci.c (VasEBoot_ahci_pciinit): Fix compat condition. 2011-11-30 Vladimir Serbinenko Add missing const qualifiers. - * grub-core/commands/i386/pc/sendkey.c (keysym): Add missing const. - * grub-core/commands/lspci.c (grub_pci_classname): Likewise. - * grub-core/commands/menuentry.c (hotkey_aliases): Likewise. - * grub-core/disk/lvm.c (grub_lvm_getvalue): Likewise. - (grub_lvm_check_flag): Likewise. - * grub-core/efiemu/i386/coredetect.c - (grub_efiemu_get_default_core_name): Likewise - * grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise. - * grub-core/fs/hfsplus.c (grub_hfsplus_catkey_internal): Likewise. - * grub-core/fs/ntfs.c (fixup): Likewise. - * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Likewise. - * grub-core/fs/zfs/zfs.c (decomp_entry): Likewise. + * VasEBoot-core/commands/i386/pc/sendkey.c (keysym): Add missing const. + * VasEBoot-core/commands/lspci.c (VasEBoot_pci_classname): Likewise. + * VasEBoot-core/commands/menuentry.c (hotkey_aliases): Likewise. + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_getvalue): Likewise. + (VasEBoot_lvm_check_flag): Likewise. + * VasEBoot-core/efiemu/i386/coredetect.c + (VasEBoot_efiemu_get_default_core_name): Likewise + * VasEBoot-core/efiemu/main.c (VasEBoot_efiemu_autocore): Likewise. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_catkey_internal): Likewise. + * VasEBoot-core/fs/ntfs.c (fixup): Likewise. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_iterate_dir): Likewise. + * VasEBoot-core/fs/zfs/zfs.c (decomp_entry): Likewise. (fzap_lookup): Likewise. (zap_lookup): Likewise. - * grub-core/gnulib/regcomp.c (init_dfa): Likewise. - * grub-core/lib/legacy_parse.c (check_option): Likewise. - * grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Likewise. - * grub-core/loader/i386/bsd.c (grub_bsd_add_meta): Likewise. - (grub_freebsd_add_meta_module): Likewise. - (grub_cmd_freebsd_module): Likewise. - * grub-core/loader/i386/xnu.c (tbl_alias): Likewise. - * grub-core/loader/xnu.c (grub_xnu_register_memory): Likewise. - (grub_xnu_writetree_get_size): Likewise. - (grub_xnu_writetree_toheap_real): Likewise. - (grub_xnu_find_key): Likewise. - (grub_xnu_create_key): Likewise. - (grub_xnu_create_value): Likewise. - (grub_xnu_register_memory): Likewise. - (grub_xnu_check_os_bundle_required): Likewise. - (grub_xnu_scan_dir_for_kexts): Likewise. - (grub_xnu_load_kext_from_dir): Likewise. - * grub-core/normal/color.c (color_list): Likewise. - * grub-core/normal/completion.c (current_word): Likewise. - * grub-core/normal/menu_entry.c (insert_string): Likewise. - * grub-core/term/serial.c (grub_serial_find): Likewise. - * grub-core/term/tparm.c (grub_terminfo_tparm): Likewise. - * include/grub/efiemu/efiemu.h (grub_efiemu_get_default_core_name): + * VasEBoot-core/gnulib/regcomp.c (init_dfa): Likewise. + * VasEBoot-core/lib/legacy_parse.c (check_option): Likewise. + * VasEBoot-core/lib/posix_wrap/langinfo.h (nl_langinfo): Likewise. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_bsd_add_meta): Likewise. + (VasEBoot_freebsd_add_meta_module): Likewise. + (VasEBoot_cmd_freebsd_module): Likewise. + * VasEBoot-core/loader/i386/xnu.c (tbl_alias): Likewise. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_register_memory): Likewise. + (VasEBoot_xnu_writetree_get_size): Likewise. + (VasEBoot_xnu_writetree_toheap_real): Likewise. + (VasEBoot_xnu_find_key): Likewise. + (VasEBoot_xnu_create_key): Likewise. + (VasEBoot_xnu_create_value): Likewise. + (VasEBoot_xnu_register_memory): Likewise. + (VasEBoot_xnu_check_os_bundle_required): Likewise. + (VasEBoot_xnu_scan_dir_for_kexts): Likewise. + (VasEBoot_xnu_load_kext_from_dir): Likewise. + * VasEBoot-core/normal/color.c (color_list): Likewise. + * VasEBoot-core/normal/completion.c (current_word): Likewise. + * VasEBoot-core/normal/menu_entry.c (insert_string): Likewise. + * VasEBoot-core/term/serial.c (VasEBoot_serial_find): Likewise. + * VasEBoot-core/term/tparm.c (VasEBoot_terminfo_tparm): Likewise. + * include/VasEBoot/efiemu/efiemu.h (VasEBoot_efiemu_get_default_core_name): Likewise. - * include/grub/i386/bsd.h (grub_bsd_add_meta): Likewise. - (grub_freebsd_add_meta_module): Likewise. - * include/grub/lib/arg.h (grub_arg_option): Likewise. - * include/grub/net.h (grub_net_card_driver): Likewise. - (grub_net_card): Likewise. - (grub_net_app_protocol): Likewise. - * include/grub/parttool.h (grub_parttool_argdesc): Likewise. - * include/grub/serial.h (grub_serial_find): Likewise. - * include/grub/tparm.h (grub_terminfo_tparm): Likewise. - * include/grub/xnu.h (grub_xnu_create_key): Likewise. - (grub_xnu_create_value): Likewise. - (grub_xnu_find_key): Likewise. - (grub_xnu_scan_dir_for_kexts): Likewise. - (grub_xnu_load_kext_from_dir): Likewise. + * include/VasEBoot/i386/bsd.h (VasEBoot_bsd_add_meta): Likewise. + (VasEBoot_freebsd_add_meta_module): Likewise. + * include/VasEBoot/lib/arg.h (VasEBoot_arg_option): Likewise. + * include/VasEBoot/net.h (VasEBoot_net_card_driver): Likewise. + (VasEBoot_net_card): Likewise. + (VasEBoot_net_app_protocol): Likewise. + * include/VasEBoot/parttool.h (VasEBoot_parttool_argdesc): Likewise. + * include/VasEBoot/serial.h (VasEBoot_serial_find): Likewise. + * include/VasEBoot/tparm.h (VasEBoot_terminfo_tparm): Likewise. + * include/VasEBoot/xnu.h (VasEBoot_xnu_create_key): Likewise. + (VasEBoot_xnu_create_value): Likewise. + (VasEBoot_xnu_find_key): Likewise. + (VasEBoot_xnu_scan_dir_for_kexts): Likewise. + (VasEBoot_xnu_load_kext_from_dir): Likewise. - * include/grub/zfs/zio_checksum.h (zio_checksum_t): Moved from here ... - * grub-core/fs/zfs/zfs.c (zio_checksum_t): ...here. - * include/grub/zfs/zio_checksum.h (zio_checksum_info): + * include/VasEBoot/zfs/zio_checksum.h (zio_checksum_t): Moved from here ... + * VasEBoot-core/fs/zfs/zfs.c (zio_checksum_t): ...here. + * include/VasEBoot/zfs/zio_checksum.h (zio_checksum_info): Moved from here ... - * grub-core/fs/zfs/zfs.c (zio_checksum_info): ... here. Added missing const. + * VasEBoot-core/fs/zfs/zfs.c (zio_checksum_info): ... here. Added missing const. 2011-11-28 Colin Watson @@ -16292,7 +16292,7 @@ 2011-11-27 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (recovery): Fix spelling. + * VasEBoot-core/fs/zfs/zfs.c (recovery): Fix spelling. (read_device): Fix size calculation. 2011-11-25 Robert Millan @@ -16307,63 +16307,63 @@ 2011-11-25 Vladimir Serbinenko - * grub-core/fs/cpio.c (grub_cpio_dir): Handle subdirs correctly. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_dir): Handle subdirs correctly. 2011-11-16 Vladimir Serbinenko - * grub-core/kern/dl.c (grub_dl_load_segments): Fix alignment handling. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_load_segments): Fix alignment handling. 2011-11-16 Vladimir Serbinenko - * grub-core/kern/dl.c (grub_dl_unload): Fix freeing segments. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_unload): Fix freeing segments. 2011-11-16 Vladimir Serbinenko - * grub-core/kern/x86_64/efi/callwrap.S: Fix the comment. + * VasEBoot-core/kern/x86_64/efi/callwrap.S: Fix the comment. 2011-11-14 Vladimir Serbinenko - * grub-core/lib/adler32.c: Add missing license specification. - * grub-core/lib/crc64.c: Likewise. - * grub-core/loader/i386/pc/plan9.c: Likewise. - * grub-core/partmap/plan.c: Likewise. + * VasEBoot-core/lib/adler32.c: Add missing license specification. + * VasEBoot-core/lib/crc64.c: Likewise. + * VasEBoot-core/loader/i386/pc/plan9.c: Likewise. + * VasEBoot-core/partmap/plan.c: Likewise. 2011-11-13 Lubomir Kundrak - Add facility to debug GRUB with gdb under qemu. + Add facility to debug VasEBoot with gdb under qemu. - * grub-core/gdb_grub.in: New file. - * grub-core/gmodule.pl.in: Likewise. - * grub-core/Makefile.core.def (gmodule.pl): New script. - (gdb_grub): Likewise. + * VasEBoot-core/gdb_VasEBoot.in: New file. + * VasEBoot-core/gmodule.pl.in: Likewise. + * VasEBoot-core/Makefile.core.def (gmodule.pl): New script. + (gdb_VasEBoot): Likewise. 2011-11-13 Vladimir Serbinenko - * util/grub-mount.c (argp_parser): Accept relative pathes. - * util/grub-fstest.c (argp_parser): Likewise. + * util/VasEBoot-mount.c (argp_parser): Accept relative pathes. + * util/VasEBoot-fstest.c (argp_parser): Likewise. 2011-11-13 Vladimir Serbinenko Plan9 support. - * Makefile.util.def (libgrubmods): Add - grub-core/partmap/plan.c. - * docs/grub.texi: Notice Plan9 support. - * grub-core/Makefile.core.def (plan9): New module. + * Makefile.util.def (libVasEBootmods): Add + VasEBoot-core/partmap/plan.c. + * docs/VasEBoot.texi: Notice Plan9 support. + * VasEBoot-core/Makefile.core.def (plan9): New module. (part_plan): Likewise. - * grub-core/loader/i386/pc/plan9.c: New file. - * grub-core/partmap/plan.c: Likewise. - * include/grub/msdos_partition.h (GRUB_PC_PARTITION_TYPE_PLAN9): New + * VasEBoot-core/loader/i386/pc/plan9.c: New file. + * VasEBoot-core/partmap/plan.c: Likewise. + * include/VasEBoot/msdos_partition.h (VasEBoot_PC_PARTITION_TYPE_PLAN9): New define. - (GRUB_PC_PARTITION_TYPE_LINUX_SWAP): Likewise. - * include/grub/mm.h (grub_extend_alloc): New inline function. + (VasEBoot_PC_PARTITION_TYPE_LINUX_SWAP): Likewise. + * include/VasEBoot/mm.h (VasEBoot_extend_alloc): New inline function. 2011-11-13 Vladimir Serbinenko Make Reed-Solomon faster by using power of generator representation of GF(256)*. - * grub-core/lib/reed_solomon.c (grub_uint16_t) [TEST]: Removed. + * VasEBoot-core/lib/reed_solomon.c (VasEBoot_uint16_t) [TEST]: Removed. (gf_double_t): Likewise. (gf_invert): Removed. (gf_powx): New array. @@ -16377,105 +16377,105 @@ (pol_evaluate): Replace multiplications with additions. (rs_encode): Likewise. (gauss_eliminate): Call gf_invert. - (grub_reed_solomon_add_redundancy): Call init_powx. - (grub_reed_solomon_recover): Call init_powx unconditionally. + (VasEBoot_reed_solomon_add_redundancy): Call init_powx. + (VasEBoot_reed_solomon_recover): Call init_powx unconditionally. 2011-11-12 Vladimir Serbinenko - * grub-core/partmap/gpt.c (gpt_partition_map_embed): Fix spelling. + * VasEBoot-core/partmap/gpt.c (gpt_partition_map_embed): Fix spelling. 2011-11-12 Vladimir Serbinenko - * grub-core/partmap/gpt.c (gpt_partition_map_embed): Restore + * VasEBoot-core/partmap/gpt.c (gpt_partition_map_embed): Restore disk->partiton for safety. 2011-11-12 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Fix a memory leak. - (grub_util_biosdisk_get_grub_dev): Add a useful debug info. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Add a useful debug info. 2011-11-12 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak. + * VasEBoot-core/kern/emu/hostdisk.c (find_system_device): Fix a memory leak. 2011-11-12 Vladimir Serbinenko - * include/grub/lvm.h (grub_lvm_pv): Correct start type. + * include/VasEBoot/lvm.h (VasEBoot_lvm_pv): Correct start type. 2011-11-12 Vladimir Serbinenko Fix spaces handling in proc/self/mountinfo. * util/getroot.c (unescape): New function. - (grub_find_root_device_from_mountinfo): Use unescape. + (VasEBoot_find_root_device_from_mountinfo): Use unescape. 2011-11-12 Vladimir Serbinenko Support ZFS embedding. - * grub-core/fs/zfs/zfs.c (grub_zfs_embed): New function. - (grub_zfs_fs): Register grub_zfs_embed. + * VasEBoot-core/fs/zfs/zfs.c (VasEBoot_zfs_embed): New function. + (VasEBoot_zfs_fs): Register VasEBoot_zfs_embed. 2011-11-12 Vladimir Serbinenko Fix MIPS compilation. - * grub-core/boot/mips/startup_raw.S: Use GRUB_DECOMPRESSOR_* - * include/grub/offsets.h: Rename decompressor fields from - GRUB_KERNEL_* to GRUB_DECOMPRESSOR_*. - * util/grub-mkimage.c (image_targets): Use new names. + * VasEBoot-core/boot/mips/startup_raw.S: Use VasEBoot_DECOMPRESSOR_* + * include/VasEBoot/offsets.h: Rename decompressor fields from + VasEBoot_KERNEL_* to VasEBoot_DECOMPRESSOR_*. + * util/VasEBoot-mkimage.c (image_targets): Use new names. 2011-11-12 Vladimir Serbinenko Defer multiboot device parsing until we're in compressed part. - * grub-core/boot/i386/pc/lnxboot.S: Remove setting dos_part and + * VasEBoot-core/boot/i386/pc/lnxboot.S: Remove setting dos_part and bsd_part. setdevice has fallen into disuse. - * grub-core/boot/i386/pc/startup_raw.S (dos_part): Removed. + * VasEBoot-core/boot/i386/pc/startup_raw.S (dos_part): Removed. (bsd_part): Likewise. (boot_dev): New variable. (multiboot_trampoline): Don't parse multiboot device. Pass multiboot device in %edx. - * grub-core/disk/i386/pc/biosdisk.c (GRUB_MOD_INIT): Parse - grub_boot_device. - * grub-core/kern/i386/pc/init.c (grub_machine_get_bootlocation): + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_MOD_INIT): Parse + VasEBoot_boot_device. + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_machine_get_bootlocation): Likewise. - * grub-core/kern/i386/pc/startup.S: Save edx. - (grub_boot_drive): Removed. - (grub_install_dos_part): Likewise. - (grub_install_bsd_part): Likewise. - (grub_boot_device): New variable. - * include/grub/i386/pc/kernel.h (grub_install_dos_part): Removed. - (grub_install_bsd_part): Likewise. - (grub_boot_drive): Likewise. - (grub_boot_device): New variable. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_INSTALL_DOS_PART): + * VasEBoot-core/kern/i386/pc/startup.S: Save edx. + (VasEBoot_boot_drive): Removed. + (VasEBoot_install_dos_part): Likewise. + (VasEBoot_install_bsd_part): Likewise. + (VasEBoot_boot_device): New variable. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_install_dos_part): Removed. + (VasEBoot_install_bsd_part): Likewise. + (VasEBoot_boot_drive): Likewise. + (VasEBoot_boot_device): New variable. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_INSTALL_DOS_PART): Removed. - (GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise. - (GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Moved lower. - (GRUB_KERNEL_MACHINE_INSTALL_BSD_PART): Removed. - (GRUB_KERNEL_MACHINE_INSTALL_DOS_PART): Likewise. - * util/grub-install.in: Remove redundant condition. + (VasEBoot_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise. + (VasEBoot_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Moved lower. + (VasEBoot_KERNEL_MACHINE_INSTALL_BSD_PART): Removed. + (VasEBoot_KERNEL_MACHINE_INSTALL_DOS_PART): Likewise. + * util/VasEBoot-install.in: Remove redundant condition. 2011-11-12 Vladimir Serbinenko Fix bug introduced by previous commit. - * grub-core/boot/i386/pc/startup_raw.S: Compute RS start correctly. + * VasEBoot-core/boot/i386/pc/startup_raw.S: Compute RS start correctly. 2011-11-12 Vladimir Serbinenko Use decompressors framework on i386-pc. It increases core size by 46 bytes but improves compatibility and maintainability. - * grub-core/Makefile.core.def (lzma_decompress): New image. + * VasEBoot-core/Makefile.core.def (lzma_decompress): New image. (kernel): Add i386_pc_ldflags. - * grub-core/kern/i386/pc/startup.S: Move intial part to .. - * grub-core/boot/i386/pc/startup_raw.S: ... here. Pass pointers + * VasEBoot-core/kern/i386/pc/startup.S: Move intial part to .. + * VasEBoot-core/boot/i386/pc/startup_raw.S: ... here. Pass pointers to real_to_prot, prot_to_real and device info. - * include/grub/offsets.h: Renamed decompressor offsets. - * util/grub-mkimage.c (grub_compression_t): New cmpression lzma. + * include/VasEBoot/offsets.h: Renamed decompressor offsets. + * util/VasEBoot-mkimage.c (VasEBoot_compression_t): New cmpression lzma. (image_target_desc): Remove raw_size and rename decompressor fields. (compress_kernel): Handle lzma. (generate_image): Handle decompressors on i386-pc. @@ -16489,160 +16489,160 @@ Move assembly code to C by using intwrap. It increases core size by 88 bytes but improves compatibility and maintainability. - * grub-core/kern/i386/pc/startup.S (grub_console_putchar): Moved to ... - * grub-core/term/i386/pc/console.c (grub_console_putchar_real): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_putchar): Moved to ... + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_putchar_real): ... here. Translated to C. - * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Moved to ... - * grub-core/term/i386/pc/console.c (grub_console_getkey): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_getkey): Moved to ... + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_getkey): ... here. Translated to C. - * grub-core/kern/i386/pc/startup.S (grub_console_getxy): Moved to ... - * grub-core/term/i386/pc/console.c (grub_console_getxy): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_getxy): Moved to ... + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_getxy): ... here. Translated to C. - * grub-core/kern/i386/pc/startup.S (grub_console_gotoxy): Moved to ... - * grub-core/term/i386/pc/console.c (grub_console_gotoxy): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_gotoxy): Moved to ... + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_gotoxy): ... here. Translated to C. - * grub-core/kern/i386/pc/startup.S (grub_console_cls): Moved to ... - * grub-core/term/i386/pc/console.c (grub_console_cls): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_cls): Moved to ... + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_cls): ... here. Translated to C. - * grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Moved to .. - * grub-core/term/i386/pc/console.c (grub_console_setcursor): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_setcursor): Moved to .. + * VasEBoot-core/term/i386/pc/console.c (VasEBoot_console_setcursor): ... here. Translated to C. - * grub-core/kern/i386/pc/startup.S (grub_get_rtc): Moved to .. - * grub-core/kern/i386/pc/init.c (grub_get_rtc): ... here. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_get_rtc): Moved to .. + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_get_rtc): ... here. Translated to C. - * grub-core/term/i386/pc/console.c (int10_9): New function. - (grub_console_putchar): Likewise. - * include/grub/i386/pc/console.h: Removed the not anymore shared + * VasEBoot-core/term/i386/pc/console.c (int10_9): New function. + (VasEBoot_console_putchar): Likewise. + * include/VasEBoot/i386/pc/console.h: Removed the not anymore shared functions. 2011-11-12 Vladimir Serbinenko - Move grub_chainloader_real_boot out of the kernel. + Move VasEBoot_chainloader_real_boot out of the kernel. - * grub-core/Makefile.am: Remove machine/loader.h. - * grub-core/kern/i386/pc/startup.S (grub_chainloader_real_boot): + * VasEBoot-core/Makefile.am: Remove machine/loader.h. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_chainloader_real_boot): Removed. - * grub-core/lib/i386/relocator.c (grub_relocator16_esi): New extern + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator16_esi): New extern variable. - (grub_relocator16_keep_a20_enabled): Likewise. - (grub_relocator16_boot): Fill new variables. - * grub-core/lib/i386/relocator16.S: Add gate a20 handling. - * grub-core/loader/i386/pc/chainloader.c (grub_chainloader_boot): Use + (VasEBoot_relocator16_keep_a20_enabled): Likewise. + (VasEBoot_relocator16_boot): Fill new variables. + * VasEBoot-core/lib/i386/relocator16.S: Add gate a20 handling. + * VasEBoot-core/loader/i386/pc/chainloader.c (VasEBoot_chainloader_boot): Use relocator. - (grub_chainloader_unload): Likewise. - (grub_chainloader_cmd): Likewise. - * include/grub/i386/pc/loader.h: Removed. - * include/grub/i386/relocator.h (grub_relocator16_state): Add a20 + (VasEBoot_chainloader_unload): Likewise. + (VasEBoot_chainloader_cmd): Likewise. + * include/VasEBoot/i386/pc/loader.h: Removed. + * include/VasEBoot/i386/relocator.h (VasEBoot_relocator16_state): Add a20 and esi. All initialisers updated. 2011-11-12 Vladimir Serbinenko 2011-11-12 Colin Watson - * Makefile.util.def (grub-mount): New util. - * .bzrignore: Add grub-mount. - * configure.ac: Check for fuse and enable grub-mount if available. - * docs/man/grub-mount.h2m: New file. - * util/grub-mount.c: Likewise. + * Makefile.util.def (VasEBoot-mount): New util. + * .bzrignore: Add VasEBoot-mount. + * configure.ac: Check for fuse and enable VasEBoot-mount if available. + * docs/man/VasEBoot-mount.h2m: New file. + * util/VasEBoot-mount.c: Likewise. 2011-11-11 Vladimir Serbinenko - * grub-core/commands/efi/fixvideo.c: Gettextize. - * grub-core/commands/hashsum.c: Likewise. - * grub-core/commands/i386/cmostest.c: Likewise. - * grub-core/commands/i386/pc/drivemap.c: Likewise. - * grub-core/commands/i386/pc/lsapm.c: Likewise. - * grub-core/commands/i386/pc/sendkey.c: Likewise. - * grub-core/commands/lsmmap.c: Likewise. - * grub-core/commands/menuentry.c: Likewise. - * grub-core/commands/mips/loongson/lsspd.c: Likewise. - * grub-core/commands/setpci.c: Likewise. - * grub-core/loader/i386/bsd.c: Likewise. - * grub-core/loader/i386/linux.c: Likewise. + * VasEBoot-core/commands/efi/fixvideo.c: Gettextize. + * VasEBoot-core/commands/hashsum.c: Likewise. + * VasEBoot-core/commands/i386/cmostest.c: Likewise. + * VasEBoot-core/commands/i386/pc/drivemap.c: Likewise. + * VasEBoot-core/commands/i386/pc/lsapm.c: Likewise. + * VasEBoot-core/commands/i386/pc/sendkey.c: Likewise. + * VasEBoot-core/commands/lsmmap.c: Likewise. + * VasEBoot-core/commands/menuentry.c: Likewise. + * VasEBoot-core/commands/mips/loongson/lsspd.c: Likewise. + * VasEBoot-core/commands/setpci.c: Likewise. + * VasEBoot-core/loader/i386/bsd.c: Likewise. + * VasEBoot-core/loader/i386/linux.c: Likewise. * util/getroot.c: Likewise. - * util/grub-editenv.c: Likewise. - * util/grub-fstest.c: Likewise. - * util/grub-mkfont.c: Likewise. - * util/grub-mkimage.c: Likewise. - * util/grub-mkpasswd-pbkdf2.c: Likewise. - * util/grub-pe2elf.c: Likewise. - * util/grub-probe.c: Likewise. - * util/grub-setup.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. + * util/VasEBoot-fstest.c: Likewise. + * util/VasEBoot-mkfont.c: Likewise. + * util/VasEBoot-mkimage.c: Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c: Likewise. + * util/VasEBoot-pe2elf.c: Likewise. + * util/VasEBoot-probe.c: Likewise. + * util/VasEBoot-setup.c: Likewise. * util/ieee1275/ofpath.c: Likewise. * util/misc.c: Likewise. * util/raid.c: Likewise. 2011-11-11 Robert Millan - * util/getroot.c (grub_util_get_geom_abstraction): Remove + * util/getroot.c (VasEBoot_util_get_geom_abstraction): Remove __attribute__((unused)) from `os_dev', which *is* being used. 2011-11-11 Vladimir Serbinenko - * include/grub/dl.h (GRUB_ARCH_DL_TRAMP_SIZE) [__ia64__]: Add back + * include/VasEBoot/dl.h (VasEBoot_ARCH_DL_TRAMP_SIZE) [__ia64__]: Add back forgotten define. - (GRUB_ARCH_DL_GOT_ALIGN) [__ia64__]: Redefine in terms of - GRUB_IA64_DL_GOT_ALIGN. - (GRUB_ARCH_DL_TRAMP_ALIGN) [__ia64__]: Redefine in terms of - GRUB_IA64_DL_TRAMP_ALIGN. + (VasEBoot_ARCH_DL_GOT_ALIGN) [__ia64__]: Redefine in terms of + VasEBoot_IA64_DL_GOT_ALIGN. + (VasEBoot_ARCH_DL_TRAMP_ALIGN) [__ia64__]: Redefine in terms of + VasEBoot_IA64_DL_TRAMP_ALIGN. 2011-11-11 Vladimir Serbinenko - Replace grub_fatal with normal errors in i386 linux loader. + Replace VasEBoot_fatal with normal errors in i386 linux loader. - * grub-core/loader/i386/linux.c (find_efi_mmap_size): Return 0 on error. + * VasEBoot-core/loader/i386/linux.c (find_efi_mmap_size): Return 0 on error. (allocate_pages): Check find_efi_mmap_size return value. - (grub_e820_add_region): Return error. - (grub_linux_boot): Check mmap return value. + (VasEBoot_e820_add_region): Return error. + (VasEBoot_linux_boot): Check mmap return value. 2011-11-11 Vladimir Serbinenko - * grub-core/commands/acpihalt.c: Gettextized. - * grub-core/commands/cacheinfo.c: Likewise. - * grub-core/commands/cmp.c: Likewise. - * grub-core/commands/efi/loadbios.c: Likewise. - * grub-core/commands/gptsync.c: Likewise. - * grub-core/commands/ieee1275/suspend.c: Likewise. - * grub-core/commands/legacycfg.c: Likewise. - * grub-core/commands/memrw.c: Likewise. - * grub-core/commands/minicmd.c: Likewise. - * grub-core/commands/parttool.c: Likewise. - * grub-core/commands/time.c: Likewise. - * grub-core/commands/videoinfo.c: Likewise. - * grub-core/disk/geli.c: Likewise. - * grub-core/disk/i386/pc/biosdisk.c: Likewise. - * grub-core/disk/luks.c: Likewise. - * grub-core/disk/lvm.c: Likewise. - * grub-core/font/font_cmd.c: Likewise. - * grub-core/fs/zfs/zfscrypt.c: Likewise. - * grub-core/fs/zfs/zfsinfo.c: Likewise. - * grub-core/gfxmenu/view.c: Likewise. - * grub-core/kern/emu/hostdisk.c: Likewise. - * grub-core/kern/emu/main.c: Likewise. - * grub-core/kern/emu/misc.c: Likewise. - * grub-core/kern/emu/mm.c: Likewise. - * grub-core/kern/mips/arc/init.c: Likewise. - * grub-core/kern/mips/loongson/init.c: Likewise. - * grub-core/kern/partition.c: Likewise. - * grub-core/lib/i386/halt.c: Likewise. - * grub-core/lib/mips/arc/reboot.c: Likewise. - * grub-core/lib/mips/loongson/reboot.c: Likewise. - * grub-core/loader/i386/pc/chainloader.c: Likewise. - * grub-core/loader/i386/xnu.c: Likewise. - * grub-core/loader/multiboot.c: Likewise. - * grub-core/net/bootp.c: Likewise. - * grub-core/net/net.c: Likewise. - * grub-core/normal/term.c: Likewise. - * grub-core/partmap/bsdlabel.c: Likewise. - * grub-core/parttool/msdospart.c: Likewise. - * grub-core/term/gfxterm.c: Likewise. - * grub-core/term/terminfo.c: Likewise. - * grub-core/video/i386/pc/vbe.c: Likewise. - * util/grub-menulst2cfg.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. - * util/grub-mklayout.c: Likewise. - * util/grub-mkrelpath.c: Likewise. - * util/grub-script-check.c: Likewise. - * util/ieee1275/grub-ofpathname.c: Likewise. + * VasEBoot-core/commands/acpihalt.c: Gettextized. + * VasEBoot-core/commands/cacheinfo.c: Likewise. + * VasEBoot-core/commands/cmp.c: Likewise. + * VasEBoot-core/commands/efi/loadbios.c: Likewise. + * VasEBoot-core/commands/gptsync.c: Likewise. + * VasEBoot-core/commands/ieee1275/suspend.c: Likewise. + * VasEBoot-core/commands/legacycfg.c: Likewise. + * VasEBoot-core/commands/memrw.c: Likewise. + * VasEBoot-core/commands/minicmd.c: Likewise. + * VasEBoot-core/commands/parttool.c: Likewise. + * VasEBoot-core/commands/time.c: Likewise. + * VasEBoot-core/commands/videoinfo.c: Likewise. + * VasEBoot-core/disk/geli.c: Likewise. + * VasEBoot-core/disk/i386/pc/biosdisk.c: Likewise. + * VasEBoot-core/disk/luks.c: Likewise. + * VasEBoot-core/disk/lvm.c: Likewise. + * VasEBoot-core/font/font_cmd.c: Likewise. + * VasEBoot-core/fs/zfs/zfscrypt.c: Likewise. + * VasEBoot-core/fs/zfs/zfsinfo.c: Likewise. + * VasEBoot-core/gfxmenu/view.c: Likewise. + * VasEBoot-core/kern/emu/hostdisk.c: Likewise. + * VasEBoot-core/kern/emu/main.c: Likewise. + * VasEBoot-core/kern/emu/misc.c: Likewise. + * VasEBoot-core/kern/emu/mm.c: Likewise. + * VasEBoot-core/kern/mips/arc/init.c: Likewise. + * VasEBoot-core/kern/mips/loongson/init.c: Likewise. + * VasEBoot-core/kern/partition.c: Likewise. + * VasEBoot-core/lib/i386/halt.c: Likewise. + * VasEBoot-core/lib/mips/arc/reboot.c: Likewise. + * VasEBoot-core/lib/mips/loongson/reboot.c: Likewise. + * VasEBoot-core/loader/i386/pc/chainloader.c: Likewise. + * VasEBoot-core/loader/i386/xnu.c: Likewise. + * VasEBoot-core/loader/multiboot.c: Likewise. + * VasEBoot-core/net/bootp.c: Likewise. + * VasEBoot-core/net/net.c: Likewise. + * VasEBoot-core/normal/term.c: Likewise. + * VasEBoot-core/partmap/bsdlabel.c: Likewise. + * VasEBoot-core/parttool/msdospart.c: Likewise. + * VasEBoot-core/term/gfxterm.c: Likewise. + * VasEBoot-core/term/terminfo.c: Likewise. + * VasEBoot-core/video/i386/pc/vbe.c: Likewise. + * util/VasEBoot-menulst2cfg.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/VasEBoot-mklayout.c: Likewise. + * util/VasEBoot-mkrelpath.c: Likewise. + * util/VasEBoot-script-check.c: Likewise. + * util/ieee1275/VasEBoot-ofpathname.c: Likewise. * util/resolve.c: Likewise. 2011-11-11 Vladimir Serbinenko @@ -16651,68 +16651,68 @@ * tests/printf_unit_test.c: New file. * Makefile.util.def (printf_test): New test. - * grub-core/kern/misc.c (grub_vsnprintf_real): Support %1$d syntax. + * VasEBoot-core/kern/misc.c (VasEBoot_vsnprintf_real): Support %1$d syntax. 2011-11-11 Vladimir Serbinenko - * grub-core/hook/datehook.c (grub_read_hook_datetime): Small stylistic + * VasEBoot-core/hook/datehook.c (VasEBoot_read_hook_datetime): Small stylistic fix. 2011-11-11 Vladimir Serbinenko - * grub-core/efiemu/mm.c (grub_efiemu_mmap_fill): Change printf into + * VasEBoot-core/efiemu/mm.c (VasEBoot_efiemu_mmap_fill): Change printf into dprintf. - * grub-core/font/font.c (grub_font_load): Likewise. + * VasEBoot-core/font/font.c (VasEBoot_font_load): Likewise. 2011-11-11 Vladimir Serbinenko - * util/grub-macho2img.c: Add comment concerning gettext. - * grub-core/lib/legacy_parse.c: Likewise. + * util/VasEBoot-macho2img.c: Add comment concerning gettext. + * VasEBoot-core/lib/legacy_parse.c: Likewise. 2011-11-11 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vprintf): Add missing va_end. - (grub_xvasprintf): Likewise. + * VasEBoot-core/kern/misc.c (VasEBoot_vprintf): Add missing va_end. + (VasEBoot_xvasprintf): Likewise. 2011-11-11 Vladimir Serbinenko - Add const keyword to grub_env_get and gettextize week days. + Add const keyword to VasEBoot_env_get and gettextize week days. - * grub-core/hook/datehook.c (grub_datetime_names): Make const. - (grub_read_hook_datetime): Return const char *. - * grub-core/kern/env.c (grub_env_get): Return const char *. All users + * VasEBoot-core/hook/datehook.c (VasEBoot_datetime_names): Make const. + (VasEBoot_read_hook_datetime): Return const char *. + * VasEBoot-core/kern/env.c (VasEBoot_env_get): Return const char *. All users updated. - * grub-core/normal/datetime.c (grub_weekday_names): Make const. + * VasEBoot-core/normal/datetime.c (VasEBoot_weekday_names): Make const. Mark for gettext. - (grub_get_weekday_name): Return const char *. Call gettext. - * grub-core/script/argv.c (grub_script_argv_append): Receive const + (VasEBoot_get_weekday_name): Return const char *. Call gettext. + * VasEBoot-core/script/argv.c (VasEBoot_script_argv_append): Receive const char * and len as the argument. All users updated. - (grub_script_argv_split_append): Receive const char *. - * include/grub/datetime.h (grub_get_weekday_name): Update proto. - * include/grub/env.h (grub_env_get): Likewise. - (grub_env_read_hook_t): Return const char *. - * include/grub/script_sh.h (grub_script_argv_append): Update proto. - (grub_script_argv_split_append): Likewise. + (VasEBoot_script_argv_split_append): Receive const char *. + * include/VasEBoot/datetime.h (VasEBoot_get_weekday_name): Update proto. + * include/VasEBoot/env.h (VasEBoot_env_get): Likewise. + (VasEBoot_env_read_hook_t): Return const char *. + * include/VasEBoot/script_sh.h (VasEBoot_script_argv_append): Update proto. + (VasEBoot_script_argv_split_append): Likewise. 2011-11-11 Vladimir Serbinenko - * grub-core/normal/main.c (grub_normal_execute): Remove leftover call. + * VasEBoot-core/normal/main.c (VasEBoot_normal_execute): Remove leftover call. 2011-11-11 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_strstr): Moved from here ... - * include/grub/misc.h (grub_strstr): ... here. Make static and inline. + * VasEBoot-core/kern/misc.c (VasEBoot_strstr): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_strstr): ... here. Make static and inline. 2011-11-11 Vladimir Serbinenko - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_set_property): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_set_property): Fix prototype. 2011-11-11 Vladimir Serbinenko Fix mips compilation. - * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec): Restrict hash_id to + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (xz_dec): Restrict hash_id to normal decoder. (hashes): Use in embed decoder as well (for sizes). (dec_stream_header): Fix embed decompressor logic. @@ -16720,87 +16720,87 @@ 2011-11-11 Vladimir Serbinenko - * grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Issue + * VasEBoot-core/kern/x86_64/dl.c (VasEBoot_arch_dl_relocate_symbols): Issue an error and not a fatal on unrecognised relocation types. 2011-11-11 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args): + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_parse_args): Issue error rather than printf on unknown arguments. 2011-11-11 Vladimir Serbinenko - * grub-core/kern/ieee1275/ieee1275.c (grub_ieee1275_set_property): + * VasEBoot-core/kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_set_property): Make buf a const. 2011-11-11 Vladimir Serbinenko - * grub-core/fs/zfs/zfscrypt.c (GRUB_MOD_INIT), (GRUB_MOD_FINI): + * VasEBoot-core/fs/zfs/zfscrypt.c (VasEBoot_MOD_INIT), (VasEBoot_MOD_FINI): Fix module name. 2011-11-11 Vladimir Serbinenko - * grub-core/fs/ntfs.c (grub_ntfs_read_symlink): Stylistic fix. Remove + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_read_symlink): Stylistic fix. Remove leftover debug printf. 2011-11-11 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_embed): Spelling fix. + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_embed): Spelling fix. 2011-11-11 Vladimir Serbinenko - * grub-core/efiemu/main.c (grub_efiemu_register_configuration_table): + * VasEBoot-core/efiemu/main.c (VasEBoot_efiemu_register_configuration_table): A stylistic fix. 2011-11-11 Vladimir Serbinenko - * grub-core/commands/probe.c (grub_cmd_probe): Fix error message. + * VasEBoot-core/commands/probe.c (VasEBoot_cmd_probe): Fix error message. 2011-11-10 Shea Levy Allow all modules to perform serial IO - * grub-core/term-serial.c (grub_serial_find): Remove static qualifier - * include/grub/serial.h (grub_serial_port_configure): New inline + * VasEBoot-core/term-serial.c (VasEBoot_serial_find): Remove static qualifier + * include/VasEBoot/serial.h (VasEBoot_serial_port_configure): New inline function. - (grub_serial_port_fetch): Likewise. - (grub_serial_port_put): Likewise. - (grub_serial_port_fini): Likewise. - (grub_serial_find): New proto. + (VasEBoot_serial_port_fetch): Likewise. + (VasEBoot_serial_port_put): Likewise. + (VasEBoot_serial_port_fini): Likewise. + (VasEBoot_serial_find): New proto. 2011-11-10 Vladimir Serbinenko Put symlink at the end of the node and fix a potential memory corruption. - * grub-core/fs/iso9660.c (grub_fshelp_node): New field have_symlink. + * VasEBoot-core/fs/iso9660.c (VasEBoot_fshelp_node): New field have_symlink. Make symlink into an array. (set_rockridge): Set have_symlink and alloc_dirents. - (grub_iso9660_read_symlink): Use new layout. - (grub_iso9660_iterate_dir): Fix memory corruption. + (VasEBoot_iso9660_read_symlink): Use new layout. + (VasEBoot_iso9660_iterate_dir): Fix memory corruption. Use new layout. - (grub_iso9660_dir): Set have_symlink. - (grub_iso9660_open): Likewise. + (VasEBoot_iso9660_dir): Set have_symlink. + (VasEBoot_iso9660_open): Likewise. 2011-11-10 Vladimir Serbinenko Remove local keyword. - * util/grub-mkconfig_lib.in (version_test_numeric): Remove local. + * util/VasEBoot-mkconfig_lib.in (version_test_numeric): Remove local. (version_test_gt): Likewise. (version_find_latest): Likewise. (gettext_printf): Likewise. - * util/grub.d/10_windows.in (get_os_name_from_boot_ini): Likewise. + * util/VasEBoot.d/10_windows.in (get_os_name_from_boot_ini): Likewise. 2011-11-10 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (zfs_mount): Fix spurious warning. + * VasEBoot-core/fs/zfs/zfs.c (zfs_mount): Fix spurious warning. 2011-11-10 Vladimir Serbinenko Fix ZFS memory and resource leaks. - * grub-core/fs/zfs/zfs.c (fill_vdev_info_real): New paramter inserted. + * VasEBoot-core/fs/zfs/zfs.c (fill_vdev_info_real): New paramter inserted. All users updated. Free type on exit. (fill_vdev_info): New parameter inserted. All users updated. @@ -16812,43 +16812,43 @@ 2011-11-10 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix grub_strncat + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Fix VasEBoot_strncat argument (access out of bounds). 2011-11-10 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_read_logical): Fix RAID10 logic for + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_read_logical): Fix RAID10 logic for >= 6 drives. 2011-11-10 Vladimir Serbinenko - * include/grub/i386/netbsd_bootinfo.h (grub_netbsd_btinfo_bootwedge): + * include/VasEBoot/i386/netbsd_bootinfo.h (VasEBoot_netbsd_btinfo_bootwedge): Fix declaration. 2011-11-09 Vladimir Serbinenko Fix several memory leaks. - * grub-core/fs/btrfs.c (grub_btrfs_dir): Fix memory leak. - * grub-core/fs/cpio.c (grub_cpio_find_file): Likewise. - (grub_cpio_dir): Likewise. - * grub-core/fs/fat.c (grub_fat_label): Likewise. - * grub-core/fs/jfs.c (grub_jfs_label): Likewise. - * grub-core/fs/romfs.c (grub_romfs_close): Likewise. - (grub_romfs_label): Likewise. - * grub-core/fs/squash4.c (squash_mount): Use zalloc for safety. + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_dir): Fix memory leak. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_find_file): Likewise. + (VasEBoot_cpio_dir): Likewise. + * VasEBoot-core/fs/fat.c (VasEBoot_fat_label): Likewise. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_label): Likewise. + * VasEBoot-core/fs/romfs.c (VasEBoot_romfs_close): Likewise. + (VasEBoot_romfs_label): Likewise. + * VasEBoot-core/fs/squash4.c (squash_mount): Use zalloc for safety. (squash_unmount): New function. - (grub_squash_dir): Fix memory leak. - (grub_squash_open): Likewise. - (grub_squash_read): Likewise. - (grub_squash_mtime): Likewise. - * grub-core/fs/xfs.c (grub_xfs_open): Likewise. - * grub-core/fs/zfs/zfs.c (check_pool_label): Likewise. - * util/grub-fstest.c (fstest): Likewise. + (VasEBoot_squash_dir): Fix memory leak. + (VasEBoot_squash_open): Likewise. + (VasEBoot_squash_read): Likewise. + (VasEBoot_squash_mtime): Likewise. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_open): Likewise. + * VasEBoot-core/fs/zfs/zfs.c (check_pool_label): Likewise. + * util/VasEBoot-fstest.c (fstest): Likewise. 2011-11-09 Vladimir Serbinenko - * include/grub/misc.h (grub_strncat): Fix the order of conditionals to + * include/VasEBoot/misc.h (VasEBoot_strncat): Fix the order of conditionals to avoid accessing beyond the array. 2011-11-09 Vladimir Serbinenko @@ -16859,60 +16859,60 @@ Several AFFS fixes. - * grub-core/fs/affs.c (grub_affs_bblock): Replace flags with version. - (GRUB_AFFS_FLAG_FFS): Removed. - (GRUB_AFFS_SYMLINK_SIZE): Likewise. - (GRUB_AFFS_FILETYPE_DIR): Make positive and unsigned. - (GRUB_AFFS_FILETYPE_DIR), (GRUB_AFFS_FILETYPE_REG): Fix a mix-up. - (grub_fshelp_node): Make block 32-bit. + * VasEBoot-core/fs/affs.c (VasEBoot_affs_bblock): Replace flags with version. + (VasEBoot_AFFS_FLAG_FFS): Removed. + (VasEBoot_AFFS_SYMLINK_SIZE): Likewise. + (VasEBoot_AFFS_FILETYPE_DIR): Make positive and unsigned. + (VasEBoot_AFFS_FILETYPE_DIR), (VasEBoot_AFFS_FILETYPE_REG): Fix a mix-up. + (VasEBoot_fshelp_node): Make block 32-bit. Add block_cache and last_block_cache. - (grub_affs_read_block): Fill and use block cache. - (grub_affs_read_file): Removed. - (grub_affs_mount): Zero-fill node. Fix version check. Don't reread + (VasEBoot_affs_read_block): Fill and use block cache. + (VasEBoot_affs_read_file): Removed. + (VasEBoot_affs_mount): Zero-fill node. Fix version check. Don't reread boot block. - (grub_affs_read_symlink): Fix symlink size. Add a \0 at the end for + (VasEBoot_affs_read_symlink): Fix symlink size. Add a \0 at the end for safety. - (grub_affs_iterate_dir): Use more appropriate types. Zero-fill allocated + (VasEBoot_affs_iterate_dir): Use more appropriate types. Zero-fill allocated space. - (grub_affs_close): Free block cache. - (grub_affs_read): Use grub_fshelp_read_file directly. + (VasEBoot_affs_close): Free block cache. + (VasEBoot_affs_read): Use VasEBoot_fshelp_read_file directly. 2011-11-08 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (read_dva): Issue an error if read failed + * VasEBoot-core/fs/zfs/zfs.c (read_dva): Issue an error if read failed with no error set. 2011-11-08 Vladimir Serbinenko - * grub-core/lib/LzmaEnc.c (LzmaEnc_CodeOneBlock): Remove set but not + * VasEBoot-core/lib/LzmaEnc.c (LzmaEnc_CodeOneBlock): Remove set but not used variable. - * grub-core/kern/ia64/dl_helper.c (grub_ia64_dl_get_tramp_got_size): + * VasEBoot-core/kern/ia64/dl_helper.c (VasEBoot_ia64_dl_get_tramp_got_size): Likewise. 2011-11-08 Vladimir Serbinenko Fix potential problem with calling zfs_to_cpu and cpu_to_be in a row. - * grub-core/fs/zfs/zfscrypt.c (grub_zfs_decrypt_real): Use explicit + * VasEBoot-core/fs/zfs/zfscrypt.c (VasEBoot_zfs_decrypt_real): Use explicit byteswap when needed. 2011-11-08 Vladimir Serbinenko Fix FreeBSD compilation. - * grub-core/disk/geli.c (GRUB_MD_SHA256) [GRUB_UTIL]: Redefine in a way + * VasEBoot-core/disk/geli.c (VasEBoot_MD_SHA256) [VasEBoot_UTIL]: Redefine in a way to avoid circular dependency. - (GRUB_MD_SHA512) [GRUB_UTIL]: Likewise. - * util/getroot.c (grub_util_follow_gpart_up): Move from here... - * grub-core/kern/emu/hostdisk.c (+grub_util_follow_gpart_up): ... here. + (VasEBoot_MD_SHA512) [VasEBoot_UTIL]: Likewise. + * util/getroot.c (VasEBoot_util_follow_gpart_up): Move from here... + * VasEBoot-core/kern/emu/hostdisk.c (+VasEBoot_util_follow_gpart_up): ... here. 2011-11-08 Vladimir Serbinenko Fix ZFS crypto error types. - * grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Fix return type. - (grub_gcm_decrypt): Likewise. - (grub_zfs_load_key_real): Fix error code type. Handle possible error + * VasEBoot-core/fs/zfs/zfscrypt.c (VasEBoot_ccm_decrypt): Fix return type. + (VasEBoot_gcm_decrypt): Likewise. + (VasEBoot_zfs_load_key_real): Fix error code type. Handle possible error from PBKDF2. 2011-11-08 Vladimir Serbinenko @@ -16921,68 +16921,68 @@ * Makefile.util.def (10_illumos): New script. * configure.ac: Set COND_HOST_ILLUMOS. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__sun__]: + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors) [__sun__]: Support Illumos calls. (find_partition_start) [__sun__]: Likewise. (convert_system_partition_to_system_disk) [__sun__]: Likewise. (device_is_wholedisk) [__sun__]: Handle Illumos naming scheme. - (grub_util_biosdisk_get_grub_dev) [__sun__]: Handle Illumos. + (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__sun__]: Handle Illumos. * util/getroot.c (find_root_device_from_libzfs) [__sun__]: Return raw device. - * util/grub-probe.c (probe) [__sun__]: Do character check. - * util/grub.d/10_illumos.in: New file. + * util/VasEBoot-probe.c (probe) [__sun__]: Do character check. + * util/VasEBoot.d/10_illumos.in: New file. 2011-11-08 Vladimir Serbinenko Support escaped commas in hostdisk. - * grub-core/kern/emu/hostdisk.c (unescape_cmp): New function. - (find_grub_drive): Use unescape_cmp. + * VasEBoot-core/kern/emu/hostdisk.c (unescape_cmp): New function. + (find_VasEBoot_drive): Use unescape_cmp. (make_device_name): Escape commas. 2011-11-08 Vladimir Serbinenko - * util/grub.d/10_kfreebsd.in: Use ${grub_mkrelpath} not grub-mkrelpath. + * util/VasEBoot.d/10_kfreebsd.in: Use ${VasEBoot_mkrelpath} not VasEBoot-mkrelpath. 2011-11-08 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (zap_iterate): Remove set but not used + * VasEBoot-core/fs/zfs/zfs.c (zap_iterate): Remove set but not used variable. 2011-11-08 Vladimir Serbinenko Support trampoline jumps on powerpc. - * grub-core/kern/dl.c (grub_dl_load_segments) [__powerpc__]: Follow + * VasEBoot-core/kern/dl.c (VasEBoot_dl_load_segments) [__powerpc__]: Follow __ia64__ path. - (grub_dl_load_segments): Set mod->sz. - (grub_dl_flush_cache): Flush whole space occupied by module, not just + (VasEBoot_dl_load_segments): Set mod->sz. + (VasEBoot_dl_flush_cache): Flush whole space occupied by module, not just segments. - * grub-core/kern/ia64/dl.c (nopm): Make const while on it. + * VasEBoot-core/kern/ia64/dl.c (nopm): Make const while on it. (jump): Likewise. - * grub-core/kern/powerpc/dl.c (grub_arch_dl_get_tramp_got_size): New + * VasEBoot-core/kern/powerpc/dl.c (VasEBoot_arch_dl_get_tramp_got_size): New function. (trampoline): New struct. (trampoline_template): New const. - (grub_arch_dl_relocate_symbols): Create trampolines on overflow. - * include/grub/dl.h (grub_dl): Add sz element. + (VasEBoot_arch_dl_relocate_symbols): Create trampolines on overflow. + * include/VasEBoot/dl.h (VasEBoot_dl): Add sz element. [__powerpc__]: Follow __ia64__. - (GRUB_ARCH_DL_TRAMP_ALIGN): Define on ppc. - (GRUB_ARCH_DL_GOT_ALIGN): Likewise. - (GRUB_ARCH_DL_TRAMP_SIZE): Likewise. - (grub_arch_dl_get_tramp_got_size) [__powerpc__]: New proto. + (VasEBoot_ARCH_DL_TRAMP_ALIGN): Define on ppc. + (VasEBoot_ARCH_DL_GOT_ALIGN): Likewise. + (VasEBoot_ARCH_DL_TRAMP_SIZE): Likewise. + (VasEBoot_arch_dl_get_tramp_got_size) [__powerpc__]: New proto. 2011-11-06 Vladimir Serbinenko ZFS crypto support. - * Makefile.util.def (libgrubmods): Add grub-core/fs/zfs/zfscrypt.c. - * grub-core/Makefile.core.def (zfscrypt): New module. - * grub-core/fs/zfs/zfs.c (subvolume): New structure. - (grub_zfs_data): Replace mdn with subvol. Put case_insensitivity inside + * Makefile.util.def (libVasEBootmods): Add VasEBoot-core/fs/zfs/zfscrypt.c. + * VasEBoot-core/Makefile.core.def (zfscrypt): New module. + * VasEBoot-core/fs/zfs/zfs.c (subvolume): New structure. + (VasEBoot_zfs_data): Replace mdn with subvol. Put case_insensitivity inside it. All users updated. - (grub_zfs_decrypt): New var. - (grub_zfs_load_key): Likewise. + (VasEBoot_zfs_decrypt): New var. + (VasEBoot_zfs_load_key): Likewise. (zio_checksum_functions): Add SHA256+MAC. (zio_checksum_verify): Handle incomplete comparison due to MAC. (zio_read): Handle encrypted blocks. @@ -16991,51 +16991,51 @@ (zap_iterate): Likewise. (zap_iterate_u64): New function. (dnode_get_fullpath): Load keys. - * grub-core/fs/zfs/zfscrypt.c: New file. - * grub-core/lib/crypto.c (grub_crypto_cipher_close): Removed. - (grub_crypto_ecb_encrypt): Make input const. - * include/grub/crypto.h (grub_crypto_cipher_close): Inline. - (grub_crypto_ecb_encrypt): Make input const. - (GRUB_CIPHER_AES): New macro. - * include/grub/zfs/dmu.h (dmu_object_type): Add DMU_OT_DSL_KEYCHAIN. - * include/grub/zfs/dsl_dir.h (dsl_dir_phys): Add keychain. - * include/grub/zfs/spa.h (grub_zfs_endian): Moved from here ... - * include/grub/zfs/zfs.h (grub_zfs_endian): ... here. Added GURB_ZFS_ + * VasEBoot-core/fs/zfs/zfscrypt.c: New file. + * VasEBoot-core/lib/crypto.c (VasEBoot_crypto_cipher_close): Removed. + (VasEBoot_crypto_ecb_encrypt): Make input const. + * include/VasEBoot/crypto.h (VasEBoot_crypto_cipher_close): Inline. + (VasEBoot_crypto_ecb_encrypt): Make input const. + (VasEBoot_CIPHER_AES): New macro. + * include/VasEBoot/zfs/dmu.h (dmu_object_type): Add DMU_OT_DSL_KEYCHAIN. + * include/VasEBoot/zfs/dsl_dir.h (dsl_dir_phys): Add keychain. + * include/VasEBoot/zfs/spa.h (VasEBoot_zfs_endian): Moved from here ... + * include/VasEBoot/zfs/zfs.h (VasEBoot_zfs_endian): ... here. Added GURB_ZFS_ prefix. All users updated. - (grub_zfs_add_key): New proto. - (grub_zfs_decrypt): Likewise. - (grub_zfs_load_key): Likewise. - * include/grub/zfs/zio.h (zio_checksum): Add SHA256+MAC. - * util/grub-fstest.c (options): Add -K option. + (VasEBoot_zfs_add_key): New proto. + (VasEBoot_zfs_decrypt): Likewise. + (VasEBoot_zfs_load_key): Likewise. + * include/VasEBoot/zfs/zio.h (zio_checksum): Add SHA256+MAC. + * util/VasEBoot-fstest.c (options): Add -K option. (argp_parser): Likewise. 2011-11-05 Vladimir Serbinenko Support zle compression on ZFS. - * grub-core/fs/zfs/zfs.c (zle_decompress): New function. + * VasEBoot-core/fs/zfs/zfs.c (zle_decompress): New function. (decomp_table): Add zle. - * include/grub/zfs/zio.h (zio_compress): Add zle. + * include/VasEBoot/zfs/zio.h (zio_compress): Add zle. 2011-11-05 Vladimir Serbinenko Support BtrFS embedding. - * grub-core/fs/btrfs.c (grub_btrfs_embed) [GRUB_UTIL]: New function. - (grub_btrfs_fs) [GRUB_UTIL]: Set embed. - * include/grub/fs.h (grub_fs) [GRUB_UTIL]: New field embed. - * util/grub-setup.c (setup): Use fs embedding if available. + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_embed) [VasEBoot_UTIL]: New function. + (VasEBoot_btrfs_fs) [VasEBoot_UTIL]: Set embed. + * include/VasEBoot/fs.h (VasEBoot_fs) [VasEBoot_UTIL]: New field embed. + * util/VasEBoot-setup.c (setup): Use fs embedding if available. Add additional sanity check. 2011-11-05 Vladimir Serbinenko - * util/grub-install.in: Fix condition for config_opt. + * util/VasEBoot-install.in: Fix condition for config_opt. 2011-11-04 Vladimir Serbinenko Support third redundancy strip on raidz3. - * grub-core/fs/zfs/zfs.c (recovery): Add Gauss for general case. + * VasEBoot-core/fs/zfs/zfs.c (recovery): Add Gauss for general case. Return error on singularity. All users updated. (read_device): Don't stop on 3rd failure on raidz3. @@ -17043,7 +17043,7 @@ Support case-insensitive ZFS subvolumes. - * grub-core/fs/zfs/zfs.c (mzap_lookup): New parameter case_insensitive. + * VasEBoot-core/fs/zfs/zfs.c (mzap_lookup): New parameter case_insensitive. All users updated. (zap_hash): Likewise. (name_cmp): New function. @@ -17056,13 +17056,13 @@ sensitiviness of a volume. All users updated. (dnode_get_fullpath): New parameter case_insensitive. All users updated. - (grub_zfs_dir): Set info.case_insensitiveness. + (VasEBoot_zfs_dir): Set info.case_insensitiveness. 2011-11-04 Vladimir Serbinenko Support second redundancy strip on raidz(2,3). - * grub-core/fs/zfs/zfs.c (powx): New array. + * VasEBoot-core/fs/zfs/zfs.c (powx): New array. (powx_inv): Likewise. (poly): New const. (xor_out): New function. @@ -17075,65 +17075,65 @@ Use a power of generator representation of GF(256) multiplication group to save space time and complexity. - * grub-core/disk/raid6_recover.c (raid6_table1): Removed. + * VasEBoot-core/disk/raid6_recover.c (raid6_table1): Removed. (raid6_table2): Likewise. (powx): New array. (powx_inv): Likewise. (poly): New const. - (grub_raid_block_mul): Replace with ... - (grub_raid_block_mulx): ...this. - (grub_raid6_init_table): Rewritten. - (grub_raid6_recover): Use power of generator representation. + (VasEBoot_raid_block_mul): Replace with ... + (VasEBoot_raid_block_mulx): ...this. + (VasEBoot_raid6_init_table): Rewritten. + (VasEBoot_raid6_recover): Use power of generator representation. 2011-11-04 Vladimir Serbinenko - * grub-core/disk/raid6_recover.c (grub_raid6_recover): Get start_sector + * VasEBoot-core/disk/raid6_recover.c (VasEBoot_raid6_recover): Get start_sector for the right device. 2011-11-04 Vladimir Serbinenko - * include/grub/kernel.h (grub_module_header): Make type into uint32 as - expected by grub-mkimage and it's more clear since there is no implicit + * include/VasEBoot/kernel.h (VasEBoot_module_header): Make type into uint32 as + expected by VasEBoot-mkimage and it's more clear since there is no implicit padding. 2011-11-04 Vladimir Serbinenko - * grub-core/disk/raid.c (scan_devices): Don't derference NULL on whole + * VasEBoot-core/disk/raid.c (scan_devices): Don't derference NULL on whole disk. - * grub-core/disk/lvm.c (do_lvm_scan): Likewise. + * VasEBoot-core/disk/lvm.c (do_lvm_scan): Likewise. 2011-11-03 Philipp Matthias Hahn - * util/grub-mkrescue.in: Fix handling xorriso option. + * util/VasEBoot-mkrescue.in: Fix handling xorriso option. 2011-11-03 Vladimir Serbinenko - * grub-core/gettext/gettext.c (grub_gettext_init_ext): Exit if local is + * VasEBoot-core/gettext/gettext.c (VasEBoot_gettext_init_ext): Exit if local is NULL. 2011-11-03 crocket - * util/grub.d/10_linux.in: Add Slackware initrd naming. + * util/VasEBoot.d/10_linux.in: Add Slackware initrd naming. 2011-11-03 Vladimir Serbinenko XZ CRC64 and SHA256 support. - * Makefile.util.def (libgrubmods): Add crc64.c. - * grub-core/Makefile.core.def (crc64): New module. - * grub-core/lib/crc64.c: New file. - * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_hash) - [!GRUB_EMBED_DECOMPRESSOR]: Rename crc32_context to hash_context. + * Makefile.util.def (libVasEBootmods): Add crc64.c. + * VasEBoot-core/Makefile.core.def (crc64): New module. + * VasEBoot-core/lib/crc64.c: New file. + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (xz_dec_hash) + [!VasEBoot_EMBED_DECOMPRESSOR]: Rename crc32_context to hash_context. Fix the type. (MAX_HASH_SIZE): New define. - (xz_dec) [!GRUB_EMBED_DECOMPRESSOR]: Add generic hash fields. - (dec_block) [!GRUB_EMBED_DECOMPRESSOR]: Handle non-crc32 hashes. - (index_update) [!GRUB_EMBED_DECOMPRESSOR]: Likewise. - (dec_index) [!GRUB_EMBED_DECOMPRESSOR]: Likewise. - (crc32_validate) [!GRUB_EMBED_DECOMPRESSOR]: Rename to ... - (hash_validate) [!GRUB_EMBED_DECOMPRESSOR]: ... this. + (xz_dec) [!VasEBoot_EMBED_DECOMPRESSOR]: Add generic hash fields. + (dec_block) [!VasEBoot_EMBED_DECOMPRESSOR]: Handle non-crc32 hashes. + (index_update) [!VasEBoot_EMBED_DECOMPRESSOR]: Likewise. + (dec_index) [!VasEBoot_EMBED_DECOMPRESSOR]: Likewise. + (crc32_validate) [!VasEBoot_EMBED_DECOMPRESSOR]: Rename to ... + (hash_validate) [!VasEBoot_EMBED_DECOMPRESSOR]: ... this. Handle non-crc32 hashes. - (hashes) [!GRUB_EMBED_DECOMPRESSOR]: New variable. + (hashes) [!VasEBoot_EMBED_DECOMPRESSOR]: New variable. (dec_stream_header): Handle non-crc32 hashes. (dec_stream_footer): Likewise. (dec_block_header): Likewise. @@ -17145,50 +17145,50 @@ 2011-11-03 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_mtime) [MODE_UFS2]: Check mtime field + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_mtime) [MODE_UFS2]: Check mtime field as well. 2011-11-03 Vladimir Serbinenko Make reiserfs label retrieval similar to other *_label functions. - * grub-core/fs/reiserfs.c (grub_reiserfs_superblock): New field label. + * VasEBoot-core/fs/reiserfs.c (VasEBoot_reiserfs_superblock): New field label. (REISERFS_MAX_LABEL_LENGTH): Removed. (REISERFS_LABEL_OFFSET): Likewise. - (grub_reiserfs_label): Rewritten. + (VasEBoot_reiserfs_label): Rewritten. 2011-11-03 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_mtime): Use correct superblock + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_mtime): Use correct superblock field. 2011-11-03 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (read_device): Support raidz3. + * VasEBoot-core/fs/zfs/zfs.c (read_device): Support raidz3. 2011-11-02 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (read_device): Add ability to sustain a single + * VasEBoot-core/fs/zfs/zfs.c (read_device): Add ability to sustain a single drive failure on both raidz and raidz2. 2011-11-02 Vladimir Serbinenko Fix RAIDZ(2) for >= 5 devices. - * grub-core/fs/zfs/zfs.c (read_device): Fix length formula. Remove + * VasEBoot-core/fs/zfs/zfs.c (read_device): Fix length formula. Remove asize argument. All users updated. 2011-11-01 Vladimir Serbinenko Fix RAIDZ(2). - * grub-core/fs/zfs/zfs.c (grub_zfs_device_desc): New member ashift. + * VasEBoot-core/fs/zfs/zfs.c (VasEBoot_zfs_device_desc): New member ashift. (fill_vdev_info_real): Set ashift. (read_device): Rewrite RAIDZ part based on reverse engineering. 2011-10-31 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_extent_read): Add sanity check and + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_extent_read): Add sanity check and don't report potentially unavialiable fields in debug output. (find_path): Fix double-free and memory leak. @@ -17196,89 +17196,89 @@ Read label on UFS1. - * grub-core/fs/ufs.c (grub_ufs_label): Remove MODE_UFS2 condition. - (grub_ufs_fs): Always set .label. + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_label): Remove MODE_UFS2 condition. + (VasEBoot_ufs_fs): Always set .label. 2011-10-31 Vladimir Serbinenko Use shifts in UFS. - * grub-core/fs/ufs.c (UFS_LOG_BLKSZ): New macro. - (grub_ufs_data): New field log2_blksz. - (grub_ufs_read_file): Use shifts. - (grub_ufs_mount): Check block size and logarithm it. + * VasEBoot-core/fs/ufs.c (UFS_LOG_BLKSZ): New macro. + (VasEBoot_ufs_data): New field log2_blksz. + (VasEBoot_ufs_read_file): Use shifts. + (VasEBoot_ufs_mount): Check block size and logarithm it. 2011-10-31 Vladimir Serbinenko - * grub-core/fs/ufs.c (grub_ufs_lookup_symlink): Fix handling of + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_lookup_symlink): Fix handling of long symlinks. 2011-10-30 Vladimir Serbinenko Handle symlinks and long names on tar and cpio. - * grub-core/fs/cpio.c (ATTR_TYPE): New definition. + * VasEBoot-core/fs/cpio.c (ATTR_TYPE): New definition. (ATTR_FILE): Likewise. (ATTR_DIR): Likewise. (ATTR_LNK): Likewise. - (grub_cpio_data) [MODE_USTAR]: New fields linkname and linkname_alloc. - (grub_cpio_find_file): Fill mode, handle linkname field as well as + (VasEBoot_cpio_data) [MODE_USTAR]: New fields linkname and linkname_alloc. + (VasEBoot_cpio_find_file): Fill mode, handle linkname field as well as L and K entries. - (grub_cpio_mount): Zero-fill data. + (VasEBoot_cpio_mount): Zero-fill data. (handle_symlink): New function. - (grub_cpio_dir): Handle symlinks. - (grub_cpio_open): Likewise. - (grub_cpio_close) [MODE_USTAR]: Free linkname. + (VasEBoot_cpio_dir): Handle symlinks. + (VasEBoot_cpio_open): Likewise. + (VasEBoot_cpio_close) [MODE_USTAR]: Free linkname. 2011-10-30 Vladimir Serbinenko Fix iso9660 filename limitations and fix memory leaks. - * grub-core/fs/iso9660.c (set_rockridge): Free sua at the end. - (grub_iso9660_iterate_dir): Fix slash handling in symlinks. + * VasEBoot-core/fs/iso9660.c (set_rockridge): Free sua at the end. + (VasEBoot_iso9660_iterate_dir): Fix slash handling in symlinks. 2011-10-30 Vladimir Serbinenko Fix JFS file name length limitations. - * grub-core/fs/jfs.c (grub_jfs_inode): Fix in-place symlink length. - (grub_jfs_diropen): Fix maximum filename length. - (grub_jfs_getent): Fix filename length. - (grub_jfs_lookup_symlink): Fix size checks. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_inode): Fix in-place symlink length. + (VasEBoot_jfs_diropen): Fix maximum filename length. + (VasEBoot_jfs_getent): Fix filename length. + (VasEBoot_jfs_lookup_symlink): Fix size checks. 2011-10-30 Vladimir Serbinenko - * grub-core/loader/mips/linux.c (loongson_machtypes): Fix fuloong type + * VasEBoot-core/loader/mips/linux.c (loongson_machtypes): Fix fuloong type string. 2011-10-30 Vladimir Serbinenko Leverage BFS implementation to read AFS. - * Makefile.util.def (libgrubmods): Add afs.c. - * grub-core/Makefile.core.def (afs): New module - * grub-core/fs/afs.c: New file. - * grub-core/fs/bfs.c [MODE_AFS]: Adapt for AFS. + * Makefile.util.def (libVasEBootmods): Add afs.c. + * VasEBoot-core/Makefile.core.def (afs): New module + * VasEBoot-core/fs/afs.c: New file. + * VasEBoot-core/fs/bfs.c [MODE_AFS]: Adapt for AFS. 2011-10-30 Vladimir Serbinenko - * grub-core/fs/bfs.c: Macroify and add some necessary sanity checks. + * VasEBoot-core/fs/bfs.c: Macroify and add some necessary sanity checks. 2011-10-30 Vladimir Serbinenko - * grub-core/fs/bfs.c: Run indent. + * VasEBoot-core/fs/bfs.c: Run indent. 2011-10-30 Vladimir Serbinenko BFS implementation based on the specification. - * grub-core/fs/bfs.c: New file. - * Makefile.util.def (libgrubmods): Add bfs.c. - * grub-core/Makefile.core.def (bfs): New module. + * VasEBoot-core/fs/bfs.c: New file. + * Makefile.util.def (libVasEBootmods): Add bfs.c. + * VasEBoot-core/Makefile.core.def (bfs): New module. 2011-10-30 Vladimir Serbinenko - * util/grub-fstest.c (cmd_cp): Clarify error message. + * util/VasEBoot-fstest.c (cmd_cp): Clarify error message. (cmd_cmp): Likewise. 2011-10-30 Yves Blusseau @@ -17290,12 +17290,12 @@ Remove afs and befs because of copyright problem. - * grub-core/fs/afs.c: Removed. - * grub-core/fs/afs_be.c: Removed. - * grub-core/fs/befs.c: Removed. - * grub-core/fs/befs_be.c: Removed. - * Makefile.util.def (libgrubkern): Remove afs, afs_be, befs and befs_be. - * grub-core/Makefile.core.def (afs): Removed. + * VasEBoot-core/fs/afs.c: Removed. + * VasEBoot-core/fs/afs_be.c: Removed. + * VasEBoot-core/fs/befs.c: Removed. + * VasEBoot-core/fs/befs_be.c: Removed. + * Makefile.util.def (libVasEBootkern): Remove afs, afs_be, befs and befs_be. + * VasEBoot-core/Makefile.core.def (afs): Removed. (afs_be): Likewise. (befs): Likewise. (befs_be): Likewise. @@ -17304,50 +17304,50 @@ Prefer rockridge over Joliet. - * grub-core/fs/iso9660.c (grub_iso9660_mount): Move rockridge detection + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_mount): Move rockridge detection to ... (set_rockridge): ... here. - (grub_iso9660_mount): Check rockridge on the primary label when + (VasEBoot_iso9660_mount): Check rockridge on the primary label when discovering. Ignore Joliet if Rockridge is present. 2011-10-28 Vladimir Serbinenko Use shifts in nilfs2. - * grub-core/fs/nilfs2.c (LOG_INODE_SIZE): New definition. + * VasEBoot-core/fs/nilfs2.c (LOG_INODE_SIZE): New definition. (LOG_NILFS_DAT_ENTRY_SIZE): Likewise. - (grub_nilfs2_palloc_entries_per_group): Replace with ... - (grub_nilfs2_log_palloc_entries_per_group): ... this. - (grub_nilfs2_palloc_group): Use shifts and bitmasks. - (grub_nilfs2_entries_per_block): Replaced with ... - (grub_nilfs2_log_entries_per_block_log): ... this. - (grub_nilfs2_blocks_per_group): Replaced with ... - (grub_nilfs2_blocks_per_group_log): ... this. - (grub_nilfs2_blocks_per_desc_block): Replaced with ... - (grub_nilfs2_blocks_per_desc_block_log): ... this. - (grub_nilfs2_palloc_desc_block_offset): Replaced with ... - (grub_nilfs2_palloc_desc_block_offset_log): ... this. - (grub_nilfs2_palloc_entry_offset): Replaced ... - (grub_nilfs2_palloc_entry_offset_log): ... this. Use shifts. - (grub_nilfs2_dat_translate): Use shifts. - (grub_nilfs2_read_inode): Likewise. - (GRUB_MOD_INIT): Ensure that logs are correct. + (VasEBoot_nilfs2_palloc_entries_per_group): Replace with ... + (VasEBoot_nilfs2_log_palloc_entries_per_group): ... this. + (VasEBoot_nilfs2_palloc_group): Use shifts and bitmasks. + (VasEBoot_nilfs2_entries_per_block): Replaced with ... + (VasEBoot_nilfs2_log_entries_per_block_log): ... this. + (VasEBoot_nilfs2_blocks_per_group): Replaced with ... + (VasEBoot_nilfs2_blocks_per_group_log): ... this. + (VasEBoot_nilfs2_blocks_per_desc_block): Replaced with ... + (VasEBoot_nilfs2_blocks_per_desc_block_log): ... this. + (VasEBoot_nilfs2_palloc_desc_block_offset): Replaced with ... + (VasEBoot_nilfs2_palloc_desc_block_offset_log): ... this. + (VasEBoot_nilfs2_palloc_entry_offset): Replaced ... + (VasEBoot_nilfs2_palloc_entry_offset_log): ... this. Use shifts. + (VasEBoot_nilfs2_dat_translate): Use shifts. + (VasEBoot_nilfs2_read_inode): Likewise. + (VasEBoot_MOD_INIT): Ensure that logs are correct. 2011-10-28 Vladimir Serbinenko Use shifts in minix filesystem. - * grub-core/fs/minix.c (GRUB_MINIX_ZONESZ): Use log_block_size. - (GRUB_MINIX_ZONE2SECT): Likewise. - (grub_minix_data): Replace block_size with log_block_size. - (grub_minix_read_file): Use shifts. - (grub_minix_mount): Check block size and take a logarithm. + * VasEBoot-core/fs/minix.c (VasEBoot_MINIX_ZONESZ): Use log_block_size. + (VasEBoot_MINIX_ZONE2SECT): Likewise. + (VasEBoot_minix_data): Replace block_size with log_block_size. + (VasEBoot_minix_read_file): Use shifts. + (VasEBoot_minix_mount): Check block size and take a logarithm. 2011-10-28 Vladimir Serbinenko Use shifts in squash4. - * grub-core/fs/squash4.c (grub_squash_data): New field log2_blksz. + * VasEBoot-core/fs/squash4.c (VasEBoot_squash_data): New field log2_blksz. (squash_mount): Check block size and take logarithm. (direct_read): Use shifts. @@ -17355,80 +17355,80 @@ Correct befs block counting logic. - * grub-core/fs/afs.c (GRUB_AFS_BLOCKS_PER_DI_RUN): Replaced with... - (GRUB_AFS_LOG_BLOCKS_PER_DI_RUN): ... this. - (GRUB_AFS_BLOCKRUN_LOG_SIZE): New definition. - (grub_afs_read_inode): Use block_shift. + * VasEBoot-core/fs/afs.c (VasEBoot_AFS_BLOCKS_PER_DI_RUN): Replaced with... + (VasEBoot_AFS_LOG_BLOCKS_PER_DI_RUN): ... this. + (VasEBoot_AFS_BLOCKRUN_LOG_SIZE): New definition. + (VasEBoot_afs_read_inode): Use block_shift. (RANGE_SHIFT): New definition. - (grub_afs_read_block): Account for RANGE_SHIFT, emit errors on + (VasEBoot_afs_read_block): Account for RANGE_SHIFT, emit errors on unexpected conditions, use shifts and appropriate types. - (GRUB_MOD_INIT): Check the value of GRUB_AFS_BLOCKRUN_LOG_SIZE. + (VasEBoot_MOD_INIT): Check the value of VasEBoot_AFS_BLOCKRUN_LOG_SIZE. 2011-10-28 Vladimir Serbinenko - * grub-core/disk/raid.c (scan_devices): Check partition. - * grub-core/disk/lvm.c (do_lvm_scan): Likewise. + * VasEBoot-core/disk/raid.c (scan_devices): Check partition. + * VasEBoot-core/disk/lvm.c (do_lvm_scan): Likewise. 2011-10-27 Vladimir Serbinenko Support BFS (befs) UUID. - * grub-core/fs/afs.c (grub_afs_inode): Make small_data zero-size. - (grub_afs_small_data_element_header): New struct. - (grub_afs_read_inode): Read complete inode. Fix ino type while on it. - (grub_afs_read_attribute) [MODE_BFS]: New function. - (grub_afs_iterate_dir): Allocate for complete inode. - (grub_afs_mount): Likewise. - (grub_afs_uuid) [MODE_BFS]: New function. - (grub_afs_fs) [MODE_BFS]: Add .uuid. + * VasEBoot-core/fs/afs.c (VasEBoot_afs_inode): Make small_data zero-size. + (VasEBoot_afs_small_data_element_header): New struct. + (VasEBoot_afs_read_inode): Read complete inode. Fix ino type while on it. + (VasEBoot_afs_read_attribute) [MODE_BFS]: New function. + (VasEBoot_afs_iterate_dir): Allocate for complete inode. + (VasEBoot_afs_mount): Likewise. + (VasEBoot_afs_uuid) [MODE_BFS]: New function. + (VasEBoot_afs_fs) [MODE_BFS]: Add .uuid. 2011-10-27 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (read_device): Silence spurious warning. + * VasEBoot-core/fs/zfs/zfs.c (read_device): Silence spurious warning. (zfs_unmount): Fix memory leak. 2011-10-26 Vladimir Serbinenko Support NTFS reparse points. - * grub-core/fs/ntfs.c (list_file): Set symlink type when appropriate. + * VasEBoot-core/fs/ntfs.c (list_file): Set symlink type when appropriate. (symlink_descriptor): New struct. - (grub_ntfs_read_symlink): New function. - (grub_ntfs_iterate_dir): Use grub_ntfs_read_symlink. - (grub_ntfs_open): Likewise. + (VasEBoot_ntfs_read_symlink): New function. + (VasEBoot_ntfs_iterate_dir): Use VasEBoot_ntfs_read_symlink. + (VasEBoot_ntfs_open): Likewise. 2011-10-26 Vladimir Serbinenko - * include/grub/ntfs.h: Add GRUB_NTFS_ prefix. All users updated. + * include/VasEBoot/ntfs.h: Add VasEBoot_NTFS_ prefix. All users updated. 2011-10-26 Vladimir Serbinenko fstest xnu_uuid subcommand. - * grub-core/commands/xnu_uuid.c (libgrubkrn): Add - grub-core/commands/xnu_uuid.c. - * util/grub-fstest.c (CMD_XNU_UUID): New enum value. + * VasEBoot-core/commands/xnu_uuid.c (libVasEBootkrn): Add + VasEBoot-core/commands/xnu_uuid.c. + * util/VasEBoot-fstest.c (CMD_XNU_UUID): New enum value. (fstest): Handle xnu_uuid. (options): Document xnu_uuid. (argp_parser): Parse xnu_uuid. 2011-10-26 Vladimir Serbinenko - * grub-core/commands/xnu_uuid.c (grub_cmd_xnu_uuid): Support + * VasEBoot-core/commands/xnu_uuid.c (VasEBoot_cmd_xnu_uuid): Support -l argument. Add newline at the end if printing. - (GRUB_MOD_INIT): Document -l. + (VasEBoot_MOD_INIT): Document -l. 2011-10-26 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_uuid): Add missing field length. + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_uuid): Add missing field length. 2011-10-26 Vladimir Serbinenko ZFS multi-device and version 33 support. - * Makefile.util.def (libgrubkern): Add grub-core/fs/zfs/zfsinfo.c. - * grub-core/fs/zfs/zfs.c (grub_zfs_device_desc): New struct. - (grub_zfs_data): Add multidev-ice-related fields. + * Makefile.util.def (libVasEBootkern): Add VasEBoot-core/fs/zfs/zfsinfo.c. + * VasEBoot-core/fs/zfs/zfs.c (VasEBoot_zfs_device_desc): New struct. + (VasEBoot_zfs_data): Add multidev-ice-related fields. (zio_checksum_verify): Zero-pad printed values. Print checksum name. (dva_get_offset): Make dva const. (zfs_fetch_nvlist): New function. @@ -17451,172 +17451,172 @@ (zfs_unmount): Use unmount_device. (zfs_mount): Use scan_disk. (zfs_mtime): New function. - (grub_zfs_open): Handle system attributes. + (VasEBoot_zfs_open): Handle system attributes. (fill_fs_info): Likewise. - (grub_zfs_dir): Likewise. - (grub_zfs_fs): Add mtime. - * grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Add missing return. - * include/grub/zfs/sa_impl.h (SA_TYPE_OFFSET): New definition. + (VasEBoot_zfs_dir): Likewise. + (VasEBoot_zfs_fs): Add mtime. + * VasEBoot-core/fs/zfs/zfsinfo.c (print_vdev_info): Add missing return. + * include/VasEBoot/zfs/sa_impl.h (SA_TYPE_OFFSET): New definition. (SA_MTIME_OFFSET): Likewise. (SA_SYMLINK_OFFSET): Likewise. - * include/grub/zfs/zfs.h (SPA_VERSION): Increase to 33. - * util/grub-fstest.c (CMD_ZFSINFO): New enum value. + * include/VasEBoot/zfs/zfs.h (SPA_VERSION): Increase to 33. + * util/VasEBoot-fstest.c (CMD_ZFSINFO): New enum value. (fstest): Support zfsinfo. (argp_parser): Likewise. 2011-10-26 Vladimir Serbinenko - * include/grub/datetime.h (grub_datetime2unixtime): Fix off-by-one + * include/VasEBoot/datetime.h (VasEBoot_datetime2unixtime): Fix off-by-one error. 2011-10-26 Vladimir Serbinenko ZFS fixes. - * grub-core/fs/zfs/zfs.c (fzap_iterate): Fix handling of indexes + * VasEBoot-core/fs/zfs/zfs.c (fzap_iterate): Fix handling of indexes sharing the same block. Iterate over correct number of indices. (dnode_get_path): Handle symlinks correctly. 2011-10-25 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_sblock): Fix offset to volname. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_sblock): Fix offset to volname. 2011-10-25 Vladimir Serbinenko Read label on HFS+. - * grub-core/fs/hfsplus.c (grub_hfsplus_cmp_catkey_id): New function. - (grub_hfsplus_btree_search): Fix types. - (grub_hfsplus_label): Implement. + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_cmp_catkey_id): New function. + (VasEBoot_hfsplus_btree_search): Fix types. + (VasEBoot_hfsplus_label): Implement. 2011-10-25 Vladimir Serbinenko - * grub-core/fs/ntfs.c (grub_ntfs_uuid): Fix a memory leak. + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_uuid): Fix a memory leak. 2011-10-25 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_uuid): Make uppercase to match Linux. + * VasEBoot-core/fs/fat.c (VasEBoot_fat_uuid): Make uppercase to match Linux. 2011-10-25 Vladimir Serbinenko Fix symlink handling on iso9660. - * grub-core/fs/iso9660.c (grub_fshelp_node): Remove dir_off. Add symlink + * VasEBoot-core/fs/iso9660.c (VasEBoot_fshelp_node): Remove dir_off. Add symlink All users updated. - (grub_iso9660_susp_iterate): Accept zero-size iterate. - (grub_iso9660_read_symlink): Moved most of code ... - (grub_iso9660_iterate_dir): ... here. Fill node->symlink. + (VasEBoot_iso9660_susp_iterate): Accept zero-size iterate. + (VasEBoot_iso9660_read_symlink): Moved most of code ... + (VasEBoot_iso9660_iterate_dir): ... here. Fill node->symlink. 2011-10-25 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c (grub_netbsd_add_boot_disk_and_wedge): + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_netbsd_add_boot_disk_and_wedge): Use union to avoid breaking strict-aliasing rules. 2011-10-25 Vladimir Serbinenko Support multi-extent iso files. - * grub-core/fs/iso9660.c (grub_iso9660_data): Remove first_sector. + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_data): Remove first_sector. Add node. - (grub_fshelp_node): Revamp. All users updated. + (VasEBoot_fshelp_node): Revamp. All users updated. (FLAG_*): New enum. (read_node): New function. - (grub_iso9660_susp_iterate): Use read_node. Receive a node as argument. + (VasEBoot_iso9660_susp_iterate): Use read_node. Receive a node as argument. All users updated. - (grub_iso9660_mount): Don't attempt to read sua when there is none. + (VasEBoot_iso9660_mount): Don't attempt to read sua when there is none. (get_node_size): New function. - (grub_iso9660_iterate_dir): Use read_node. Agglomerate multi-extent + (VasEBoot_iso9660_iterate_dir): Use read_node. Agglomerate multi-extent entries. Fix memory leak on . and .. - (grub_iso9660_read): Use read_node. - (grub_iso9660_close): Free node. + (VasEBoot_iso9660_read): Use read_node. + (VasEBoot_iso9660_close): Free node. 2011-10-25 Vladimir Serbinenko Fix tar 4G limit and handle paths containing dot. - * grub-core/fs/cpio.c (grub_cpio_data): Use grub_off_t for offsets. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_data): Use VasEBoot_off_t for offsets. (canonicalize): New function. - (grub_cpio_find_file): Use canonicalize. Store offs in - grub_disk_addr_t. - (grub_cpio_dir): Use grub_disk_addr_t. - (grub_cpio_open): Likewise. + (VasEBoot_cpio_find_file): Use canonicalize. Store offs in + VasEBoot_disk_addr_t. + (VasEBoot_cpio_dir): Use VasEBoot_disk_addr_t. + (VasEBoot_cpio_open): Likewise. 2011-10-25 Vladimir Serbinenko Fix handling of uncompressed blocks on squashfs and break 4G limit. - * grub-core/fs/squash4.c (grub_squash_super): Add block_size. Remove + * VasEBoot-core/fs/squash4.c (VasEBoot_squash_super): Add block_size. Remove unused flags. - (grub_squash_inode): Add long_file and block_size. - (grub_squash_cache_inode): New struct. - (grub_squash_dirent): Make types into enum. + (VasEBoot_squash_inode): Add long_file and block_size. + (VasEBoot_squash_cache_inode): New struct. + (VasEBoot_squash_dirent): Make types into enum. (SQUASH_TYPE_LONG_REGULAR): New type. - (grub_squash_frag_desc): Add field size. + (VasEBoot_squash_frag_desc): Add field size. (SQUASH_BLOCK_FLAGS): New enum. - (grub_squash_data): Use grub_squash_cache_inode. - (grub_fshelp_node): Make ino_chunk 64-bit. + (VasEBoot_squash_data): Use VasEBoot_squash_cache_inode. + (VasEBoot_fshelp_node): Make ino_chunk 64-bit. (read_chunk): Minor argument change. All users updated. (squash_mount): Use correct le_to_cpu. - (grub_squash_open): Handle LONG_REGULAR. + (VasEBoot_squash_open): Handle LONG_REGULAR. (direct_read): New function. - (grub_squash_read_data): Handle blocks correctly. + (VasEBoot_squash_read_data): Handle blocks correctly. 2011-10-25 Vladimir Serbinenko - * grub-core/kern/disk.c (grub_disk_read_small): Fix memory leak. + * VasEBoot-core/kern/disk.c (VasEBoot_disk_read_small): Fix memory leak. 2011-10-25 Vladimir Serbinenko - * grub-core/fs/romfs.c (grub_romfs_open): Add missing return. + * VasEBoot-core/fs/romfs.c (VasEBoot_romfs_open): Add missing return. 2011-10-24 Vladimir Serbinenko Fix 2G limit on ZFS. - * grub-core/fs/zfs/zfs.c (zio_checksum_verify): Use more appropriate + * VasEBoot-core/fs/zfs/zfs.c (zio_checksum_verify): Use more appropriate types. (uberblock_verify): Likewise. (dmu_read): Likewise. - (grub_zfs_read): Likewise. Remove invalid cast. + (VasEBoot_zfs_read): Likewise. Remove invalid cast. 2011-10-24 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_blkno): Use more appropriate types. - (grub_jfs_blkno): Fix incorrect shift. - (grub_jfs_read_file): Use more appropriate types. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_blkno): Use more appropriate types. + (VasEBoot_jfs_blkno): Fix incorrect shift. + (VasEBoot_jfs_read_file): Use more appropriate types. 2011-10-24 Vladimir Serbinenko Support triple indirect on minix2 and minix3. - * grub-core/fs/minix.c (grub_minix_inode) [MODE_MINIX2 || MODE_MINIX3]: + * VasEBoot-core/fs/minix.c (VasEBoot_minix_inode) [MODE_MINIX2 || MODE_MINIX3]: Declare triple_indir_zone. - (grub_minix_get_file_block) [MODE_MINIX2 || MODE_MINIX3]: Handle triple + (VasEBoot_minix_get_file_block) [MODE_MINIX2 || MODE_MINIX3]: Handle triple indirect. 2011-10-24 Vladimir Serbinenko Minix FS fixes. - * grub-core/fs/minix.c (GRUB_MINIX_INODE_SIZE): Size is always 32-bit. - (grub_minix_inode) [!MODE_MINIX2 && !MODE_MINIX3]: Make size 32-bit. + * VasEBoot-core/fs/minix.c (VasEBoot_MINIX_INODE_SIZE): Size is always 32-bit. + (VasEBoot_minix_inode) [!MODE_MINIX2 && !MODE_MINIX3]: Make size 32-bit. Rename ctime to mtime. All users updated. - (grub_minix_get_file_block): Fix types and double indirect computations. + (VasEBoot_minix_get_file_block): Fix types and double indirect computations. 2011-10-23 Vladimir Serbinenko - * grub-core/fs/fat.c (grub_fat_label) [MODE_EXFAT]: Set *label to 0 + * VasEBoot-core/fs/fat.c (VasEBoot_fat_label) [MODE_EXFAT]: Set *label to 0 if no label is found. - (grub_fat_iterate_dir): Fix file size type. - (grub_fat_iterate_dir): Likewise. + (VasEBoot_fat_iterate_dir): Fix file size type. + (VasEBoot_fat_iterate_dir): Likewise. 2011-10-23 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (gf_invert): Declare as const and + * VasEBoot-core/lib/reed_solomon.c (gf_invert): Declare as const and save some space. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_RAW_SIZE): Decrease. - (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_RAW_SIZE): Decrease. + (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise. 2011-10-23 Vladimir Serbinenko @@ -17628,307 +17628,307 @@ 2011-10-23 Vladimir Serbinenko - * grub-core/lib/setjmp.S [__ia64__]: Include ./ia64/longjmp.S. + * VasEBoot-core/lib/setjmp.S [__ia64__]: Include ./ia64/longjmp.S. 2011-10-23 Vladimir Serbinenko Fine grainely disable warnings on lexer. Remove Wno-error on it. - * grub-core/Makefile.core.def (normal): Remove -Wno-error. - * grub-core/script/lexer.c: Declare yytext_ptr to avoid having + * VasEBoot-core/Makefile.core.def (normal): Remove -Wno-error. + * VasEBoot-core/script/lexer.c: Declare yytext_ptr to avoid having yylex_strncpy. - * grub-core/script/yylex.l: Add fine-grained #pragma. + * VasEBoot-core/script/yylex.l: Add fine-grained #pragma. 2011-10-23 Vladimir Serbinenko - * grub-core/lib/posix_wrap/string.h (memcpy) [GRUB_UTIL]: + * VasEBoot-core/lib/posix_wrap/string.h (memcpy) [VasEBoot_UTIL]: New inline function. - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy) [GRUB_UTIL]: + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy) [VasEBoot_UTIL]: Likewise. - (memset) [GRUB_UTIL]: Likewise. - (memcmp) [GRUB_UTIL]: Likewise. + (memset) [VasEBoot_UTIL]: Likewise. + (memcmp) [VasEBoot_UTIL]: Likewise. 2011-10-23 Vladimir Serbinenko - * include/grub/misc.h (grub_memcpy): Declare grub_memcpy with static + * include/VasEBoot/misc.h (VasEBoot_memcpy): Declare VasEBoot_memcpy with static inline function rather than a define. 2011-10-23 Vladimir Serbinenko - * util/grub-setup.c: Add missing include. + * util/VasEBoot-setup.c: Add missing include. 2011-10-23 Vladimir Serbinenko - * util/ieee1275/grub-ofpathname.c: Add missing include. + * util/ieee1275/VasEBoot-ofpathname.c: Add missing include. 2011-10-23 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S (grub_exit): Add missing zeroing-out. - * grub-core/lib/i386/reboot_trampoline.S (grub_reboot_start): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_exit): Add missing zeroing-out. + * VasEBoot-core/lib/i386/reboot_trampoline.S (VasEBoot_reboot_start): Likewise. 2011-10-23 Vladimir Serbinenko - * grub-core/io/lzopio.c (test_header): Fix incorrect memcmp instead of - grub_memcmp usage. + * VasEBoot-core/io/lzopio.c (test_header): Fix incorrect memcmp instead of + VasEBoot_memcmp usage. 2011-10-23 Vladimir Serbinenko - * util/grub-install.in: Add datarootdir as per automake manual + * util/VasEBoot-install.in: Add datarootdir as per automake manual suggestion. - * util/grub-mknetdir.in: Likewise. + * util/VasEBoot-mknetdir.in: Likewise. 2011-10-23 Vladimir Serbinenko - * util/grub.d/10_hurd.in: Add datarootdir as per automake manual + * util/VasEBoot.d/10_hurd.in: Add datarootdir as per automake manual suggestion. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2011-10-20 Vladimir Serbinenko - Remove redundant grub_kernel_image_size. + Remove redundant VasEBoot_kernel_image_size. - * grub-core/kern/i386/coreboot/init.c (grub_machine_init): Use + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_machine_init): Use _edata and _start. - * grub-core/kern/i386/coreboot/startup.S: Move multiboot header after + * VasEBoot-core/kern/i386/coreboot/startup.S: Move multiboot header after the small code. It moves it only by few bytes but simplifies the code. - * grub-core/kern/i386/pc/init.c (grub_machine_init): Use _edata and + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_machine_init): Use _edata and _start. - * grub-core/kern/i386/pc/startup.S: Use _edata and _start. - (grub_kernel_image_size): Removed. - * grub-core/kern/i386/qemu/startup.S: Use _edata and _start. - (grub_kernel_image_size): Removed. + * VasEBoot-core/kern/i386/pc/startup.S: Use _edata and _start. + (VasEBoot_kernel_image_size): Removed. + * VasEBoot-core/kern/i386/qemu/startup.S: Use _edata and _start. + (VasEBoot_kernel_image_size): Removed. [APPLE_CC]: Remove apple compiler support. i386-qemu port can't be compiled with Apple toolchain. - * grub-core/kern/sparc64/ieee1275/crt0.S: Remove leftover fields. - * include/grub/i386/pc/kernel.h (grub_kernel_image_size): Removed. - * include/grub/i386/qemu/kernel.h (grub_kernel_image_size): Removed. - (grub_total_module_size): Likewise. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE): + * VasEBoot-core/kern/sparc64/ieee1275/crt0.S: Remove leftover fields. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_kernel_image_size): Removed. + * include/VasEBoot/i386/qemu/kernel.h (VasEBoot_kernel_image_size): Removed. + (VasEBoot_total_module_size): Likewise. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_KERNEL_IMAGE_SIZE): Removed. - (GRUB_KERNEL_I386_PC_COMPRESSED_SIZE): Put it lower. - (GRUB_KERNEL_I386_PC_INSTALL_DOS_PART): Likewise. - (GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise. - (GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Likewise. - (GRUB_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE): Removed. - (GRUB_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE): Likewise. - (GRUB_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE): Likewise. - * include/grub/sparc64/ieee1275/kernel.h (grub_kernel_image_size): + (VasEBoot_KERNEL_I386_PC_COMPRESSED_SIZE): Put it lower. + (VasEBoot_KERNEL_I386_PC_INSTALL_DOS_PART): Likewise. + (VasEBoot_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise. + (VasEBoot_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Likewise. + (VasEBoot_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE): Removed. + (VasEBoot_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE): Likewise. + (VasEBoot_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE): Likewise. + * include/VasEBoot/sparc64/ieee1275/kernel.h (VasEBoot_kernel_image_size): Removed. - (grub_total_module_size): Removed. - * util/grub-mkimage.c (image_target_desc): Remove image_size. + (VasEBoot_total_module_size): Removed. + * util/VasEBoot-mkimage.c (image_target_desc): Remove image_size. (image_targets): Likewise. Set .compressed_size to no field on sparc. (generate_image): Remove kernel_image_size handling. 2011-10-19 Szymon Janc - * grub-core/bus/usb/uhci.c (grub_uhci_setup_transfer): Fix possible + * VasEBoot-core/bus/usb/uhci.c (VasEBoot_uhci_setup_transfer): Fix possible NULL pointer dereference. 2011-10-19 Vladimir Serbinenko - Removed unused GRUB_BOOT_VERSION. Check for kernel version is better + Removed unused VasEBoot_BOOT_VERSION. Check for kernel version is better done with a dedicated section. - * grub-core/boot/sparc64/ieee1275/boot.S: Remove GRUB_BOOT_VERSION. + * VasEBoot-core/boot/sparc64/ieee1275/boot.S: Remove VasEBoot_BOOT_VERSION. Ensure the correct position of boot_path. - * grub-core/kern/i386/efi/startup.S: Remove GRUB_BOOT_VERSION. - * grub-core/kern/i386/pc/startup.S: Likewise. Ensure correct position of + * VasEBoot-core/kern/i386/efi/startup.S: Remove VasEBoot_BOOT_VERSION. + * VasEBoot-core/kern/i386/pc/startup.S: Likewise. Ensure correct position of other fields. - * grub-core/kern/x86_64/efi/startup.S: Remove GRUB_BOOT_VERSION. - * include/grub/boot.h: Removed. All references removed. - * include/grub/sparc64/ieee1275/boot.h (GRUB_BOOT_MACHINE_VER_MAJ): + * VasEBoot-core/kern/x86_64/efi/startup.S: Remove VasEBoot_BOOT_VERSION. + * include/VasEBoot/boot.h: Removed. All references removed. + * include/VasEBoot/sparc64/ieee1275/boot.h (VasEBoot_BOOT_MACHINE_VER_MAJ): Removed. - (GRUB_BOOT_MACHINE_BOOT_DEVPATH): Make it lower. + (VasEBoot_BOOT_MACHINE_BOOT_DEVPATH): Make it lower. 2011-10-19 Vladimir Serbinenko - * util/grub-install.in: Declare IEEE1275 as able to find out the disk + * util/VasEBoot-install.in: Declare IEEE1275 as able to find out the disk name. 2011-10-19 Vladimir Serbinenko - * grub-core/kern/main.c (grub_set_prefix_and_root): Init prefix. + * VasEBoot-core/kern/main.c (VasEBoot_set_prefix_and_root): Init prefix. 2011-10-19 Vladimir Serbinenko - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): Don't add the bogus brackets. 2011-10-19 Vladimir Serbinenko ExFAT support. - * Makefile.util.def (libgrubmods.a): Add grub-core/fs/exfat.c. - * grub-core/Makefile.core.def (exfat): New module. - * grub-core/fs/exfat.c: New file. - * grub-core/fs/fat.c (GRUB_FAT_DIR_ENTRY_SIZE): Removed. - (GRUB_FAT_ATTR_*): Make into an enum. - (GRUB_FAT_ATTR_LONG_NAME) [MODE_EXFAT]: Removed. - (GRUB_FAT_ATTR_VALID) [MODE_EXFAT]: Remove GRUB_FAT_ATTR_VOLUME_ID. - (GRUB_FAT_ATTR_VOLUME_ID) [MODE_EXFAT]: Removed. - (GRUB_FAT_MAXFILE): Removed. - (grub_exfat_bpb) [MODE_EXFAT]: New struct. - (grub_current_fat_bpb_t): New type. - (grub_fat_dir_entry) [MODE_EXFAT]: New struct. - (grub_fat_dir_node) [MODE_EXFAT]: New struct. - (grub_fat_dir_node_t): New type. - (grub_fat_data) [MODE_EXFAT]: Remove root_sector and num_root_sectors. + * Makefile.util.def (libVasEBootmods.a): Add VasEBoot-core/fs/exfat.c. + * VasEBoot-core/Makefile.core.def (exfat): New module. + * VasEBoot-core/fs/exfat.c: New file. + * VasEBoot-core/fs/fat.c (VasEBoot_FAT_DIR_ENTRY_SIZE): Removed. + (VasEBoot_FAT_ATTR_*): Make into an enum. + (VasEBoot_FAT_ATTR_LONG_NAME) [MODE_EXFAT]: Removed. + (VasEBoot_FAT_ATTR_VALID) [MODE_EXFAT]: Remove VasEBoot_FAT_ATTR_VOLUME_ID. + (VasEBoot_FAT_ATTR_VOLUME_ID) [MODE_EXFAT]: Removed. + (VasEBoot_FAT_MAXFILE): Removed. + (VasEBoot_exfat_bpb) [MODE_EXFAT]: New struct. + (VasEBoot_current_fat_bpb_t): New type. + (VasEBoot_fat_dir_entry) [MODE_EXFAT]: New struct. + (VasEBoot_fat_dir_node) [MODE_EXFAT]: New struct. + (VasEBoot_fat_dir_node_t): New type. + (VasEBoot_fat_data) [MODE_EXFAT]: Remove root_sector and num_root_sectors. (fat_log2) [MODE_EXFAT]: Removed. - (grub_fat_mount): Use grub_current_fat_bpb_t. Add some sanity checks. - (grub_fat_mount) [MODE_EXFAT]: Handle ExFAT. - (grub_fat_iterate_dir) [MODE_EXFAT]: New function. - (grub_fat_find_dir) [MODE_EXFAT]: Handle ExFAT. - (grub_fat_label) [MODE_EXFAT]: New function. - (grub_fat_fs) [MODE_EXFAT]: Set name to "exfat" and + (VasEBoot_fat_mount): Use VasEBoot_current_fat_bpb_t. Add some sanity checks. + (VasEBoot_fat_mount) [MODE_EXFAT]: Handle ExFAT. + (VasEBoot_fat_iterate_dir) [MODE_EXFAT]: New function. + (VasEBoot_fat_find_dir) [MODE_EXFAT]: Handle ExFAT. + (VasEBoot_fat_label) [MODE_EXFAT]: New function. + (VasEBoot_fat_fs) [MODE_EXFAT]: Set name to "exfat" and reserved_first_sector to 0. 2011-10-19 Vladimir Serbinenko - Move grub_reboot out of the kernel. + Move VasEBoot_reboot out of the kernel. - * grub-core/Makefile.core.def (reboot): Add platform-specific files. - * grub-core/kern/efi/efi.c (grub_reboot): Moved to ... - * grub-core/lib/efi/reboot.c: ... here. - * grub-core/kern/i386/efi/startup.S: Remove including of realmode.S. - * grub-core/kern/i386/ieee1275/startup.S: Likewise. - * grub-core/kern/i386/pc/startup.S (grub_exit): Inline cold_reboot. - * grub-core/kern/i386/realmode.S (grub_reboot): Moved to... - * grub-core/lib/i386/reboot_trampoline.S: ... here. - * grub-core/kern/ieee1275/openfw.c (grub_reboot): Moved to... - * grub-core/lib/ieee1275/reboot.c: ... here. - * grub-core/kern/mips/arc/init.c (grub_reboot): Moved to... - * grub-core/lib/mips/arc/reboot.c: ... here. - * grub-core/kern/mips/loongson/init.c (grub_reboot): Moved to... - * grub-core/lib/mips/loongson/reboot.c: ...here. - * grub-core/kern/mips/qemu_mips/init.c (grub_reboot): Moved to... - * grub-core/lib/mips/qemu_mips/reboot.c: ... here. - * include/grub/emu/misc.h (grub_reboot): New function declaration. - * include/grub/i386/reboot.h: New file. - * include/grub/mips/loongson/ec.h: Fix includes. - * include/grub/mips/qemu_mips/kernel.h (grub_reboot): Removed. - * include/grub/misc.h (grub_reboot): Don't mark as kernel function. - * grub-core/lib/i386/reboot.c: New file. + * VasEBoot-core/Makefile.core.def (reboot): Add platform-specific files. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_reboot): Moved to ... + * VasEBoot-core/lib/efi/reboot.c: ... here. + * VasEBoot-core/kern/i386/efi/startup.S: Remove including of realmode.S. + * VasEBoot-core/kern/i386/ieee1275/startup.S: Likewise. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_exit): Inline cold_reboot. + * VasEBoot-core/kern/i386/realmode.S (VasEBoot_reboot): Moved to... + * VasEBoot-core/lib/i386/reboot_trampoline.S: ... here. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_reboot): Moved to... + * VasEBoot-core/lib/ieee1275/reboot.c: ... here. + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_reboot): Moved to... + * VasEBoot-core/lib/mips/arc/reboot.c: ... here. + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_reboot): Moved to... + * VasEBoot-core/lib/mips/loongson/reboot.c: ...here. + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_reboot): Moved to... + * VasEBoot-core/lib/mips/qemu_mips/reboot.c: ... here. + * include/VasEBoot/emu/misc.h (VasEBoot_reboot): New function declaration. + * include/VasEBoot/i386/reboot.h: New file. + * include/VasEBoot/mips/loongson/ec.h: Fix includes. + * include/VasEBoot/mips/qemu_mips/kernel.h (VasEBoot_reboot): Removed. + * include/VasEBoot/misc.h (VasEBoot_reboot): Don't mark as kernel function. + * VasEBoot-core/lib/i386/reboot.c: New file. 2011-10-18 Vladimir Serbinenko - Make grub_prefix into module to fix the arbitrary limit and save + Make VasEBoot_prefix into module to fix the arbitrary limit and save some space. - * grub-core/kern/emu/main.c (grub_prefix): Removed. - * grub-core/kern/i386/coreboot/startup.S (grub_prefix): Likewise. - * grub-core/kern/i386/efi/startup.S (grub_prefix): Likewise. - * grub-core/kern/i386/ieee1275/startup.S (grub_prefix): Likewise. - * grub-core/kern/i386/pc/startup.S (grub_prefix): Likewise. - * grub-core/kern/i386/qemu/startup.S (grub_prefix): Likewise. - * grub-core/kern/ia64/efi/startup.S (grub_prefix): Likewise. - * grub-core/kern/mips/startup.S (grub_prefix): Likewise. - * grub-core/kern/powerpc/ieee1275/startup.S (grub_prefix): Likewise. - * grub-core/kern/sparc64/ieee1275/crt0.S (grub_prefix): Likewise. - * grub-core/kern/x86_64/efi/startup.S (grub_prefix): Likewise. - * include/grub/ia64/efi/kernel.h: Removed. - * include/grub/kernel.h: New module type OBJ_TYPE_PREFIX. - (grub_prefix): Removed. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_PREFIX): Removed. - (GRUB_KERNEL_I386_PC_PREFIX_END): Likewise. - (GRUB_KERNEL_I386_QEMU_PREFIX): Likewise. - (GRUB_KERNEL_I386_QEMU_PREFIX_END): Likewise. - (GRUB_KERNEL_SPARC64_IEEE1275_PREFIX): Likewise. - (GRUB_KERNEL_SPARC64_IEEE1275_PREFIX_END): Likewise. - (GRUB_KERNEL_POWERPC_IEEE1275_PREFIX): Likewise. - (GRUB_KERNEL_POWERPC_IEEE1275_PREFIX_END): Likewise. - (GRUB_KERNEL_MIPS_LOONGSON_PREFIX): Likewise. - (GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END): Likewise. - (GRUB_KERNEL_MIPS_ARC_PREFIX): Likewise. - (GRUB_KERNEL_MIPS_ARC_PREFIX_END): Likewise. - (GRUB_KERNEL_I386_EFI_PREFIX): Likewise. - (GRUB_KERNEL_I386_EFI_PREFIX_END): Likewise. - (GRUB_KERNEL_IA64_EFI_PREFIX): Likewise. - (GRUB_KERNEL_IA64_EFI_PREFIX_END): Likewise. - (GRUB_KERNEL_X86_64_EFI_PREFIX): Likewise. - (GRUB_KERNEL_X86_64_EFI_PREFIX_END): Likewise. - (GRUB_KERNEL_I386_COREBOOT_PREFIX): Likewise. - (GRUB_KERNEL_I386_COREBOOT_PREFIX_END): Likewise. - (GRUB_KERNEL_I386_MULTIBOOT_PREFIX): Likewise. - (GRUB_KERNEL_I386_MULTIBOOT_PREFIX_END): Likewise. - (GRUB_KERNEL_I386_IEEE1275_PREFIX): Likewise. - (GRUB_KERNEL_I386_IEEE1275_PREFIX_END): Likewise. - (GRUB_KERNEL_MACHINE_PREFIX): Likewise. - (GRUB_KERNEL_MACHINE_PREFIX_END): Likewise. - * grub-core/kern/main.c (grub_set_prefix_and_root): Retrieve grub_prefix + * VasEBoot-core/kern/emu/main.c (VasEBoot_prefix): Removed. + * VasEBoot-core/kern/i386/coreboot/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/i386/efi/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/i386/ieee1275/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/i386/qemu/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/ia64/efi/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/mips/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/powerpc/ieee1275/startup.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/sparc64/ieee1275/crt0.S (VasEBoot_prefix): Likewise. + * VasEBoot-core/kern/x86_64/efi/startup.S (VasEBoot_prefix): Likewise. + * include/VasEBoot/ia64/efi/kernel.h: Removed. + * include/VasEBoot/kernel.h: New module type OBJ_TYPE_PREFIX. + (VasEBoot_prefix): Removed. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_PREFIX): Removed. + (VasEBoot_KERNEL_I386_PC_PREFIX_END): Likewise. + (VasEBoot_KERNEL_I386_QEMU_PREFIX): Likewise. + (VasEBoot_KERNEL_I386_QEMU_PREFIX_END): Likewise. + (VasEBoot_KERNEL_SPARC64_IEEE1275_PREFIX): Likewise. + (VasEBoot_KERNEL_SPARC64_IEEE1275_PREFIX_END): Likewise. + (VasEBoot_KERNEL_POWERPC_IEEE1275_PREFIX): Likewise. + (VasEBoot_KERNEL_POWERPC_IEEE1275_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MIPS_LOONGSON_PREFIX): Likewise. + (VasEBoot_KERNEL_MIPS_LOONGSON_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_PREFIX): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_PREFIX): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_PREFIX_END): Likewise. + (VasEBoot_KERNEL_I386_EFI_PREFIX): Likewise. + (VasEBoot_KERNEL_I386_EFI_PREFIX_END): Likewise. + (VasEBoot_KERNEL_IA64_EFI_PREFIX): Likewise. + (VasEBoot_KERNEL_IA64_EFI_PREFIX_END): Likewise. + (VasEBoot_KERNEL_X86_64_EFI_PREFIX): Likewise. + (VasEBoot_KERNEL_X86_64_EFI_PREFIX_END): Likewise. + (VasEBoot_KERNEL_I386_COREBOOT_PREFIX): Likewise. + (VasEBoot_KERNEL_I386_COREBOOT_PREFIX_END): Likewise. + (VasEBoot_KERNEL_I386_MULTIBOOT_PREFIX): Likewise. + (VasEBoot_KERNEL_I386_MULTIBOOT_PREFIX_END): Likewise. + (VasEBoot_KERNEL_I386_IEEE1275_PREFIX): Likewise. + (VasEBoot_KERNEL_I386_IEEE1275_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MACHINE_PREFIX): Likewise. + (VasEBoot_KERNEL_MACHINE_PREFIX_END): Likewise. + * VasEBoot-core/kern/main.c (VasEBoot_set_prefix_and_root): Retrieve VasEBoot_prefix from module. - * util/grub-mkimage.c (image_target_desc): Removed prefix and + * util/VasEBoot-mkimage.c (image_target_desc): Removed prefix and prefix_end. (image_targets): Likewise. (generate_image): Put prefix as a module. 2011-10-16 Vladimir Serbinenko - Replace grub_module_iterate with FOR_MODULES. + Replace VasEBoot_module_iterate with FOR_MODULES. - * grub-core/disk/memdisk.c (GRUB_MOD_INIT): Switched to new interface. - * grub-core/kern/efi/efi.c (grub_arch_modules_addr): Renamed to... - (grub_efi_modules_addr): ...this. - * grub-core/kern/efi/init.c (grub_modbase): New variable. - (grub_efi_init): Set grub_modbase. - * grub-core/kern/emu/main.c (grub_arch_modules_addr): Removed. - (grub_modbase): New variable. - * grub-core/kern/i386/coreboot/init.c (grub_arch_modules_addr): Removed. - (grub_modbase): New variable. - (grub_machine_init): Set grub_modbase. - * grub-core/kern/i386/pc/init.c (grub_arch_modules_addr): Removed. - (grub_modbase): New variable. - (grub_machine_init): Set grub_modbase. - * grub-core/kern/ieee1275/init.c (grub_arch_modules_addr): Removed. - (grub_modbase): New variable. - (grub_machine_init): Set grub_modbase. - * grub-core/kern/main.c (grub_module_iterate): Remove. - (grub_modules_get_end): Use grub_modbase. - (grub_load_modules): Use FOR_MODULES. - (grub_load_config): Likewise. - * grub-core/kern/mips/arc/init.c (grub_arch_modules_addr): Removed. - (grub_modbase): New variable. - (grub_machine_init): Set grub_modbase. - * grub-core/kern/mips/loongson/init.c (grub_arch_modules_addr): Removed. - (grub_modbase): New variable. - (grub_machine_init): Set grub_modbase. - * grub-core/kern/mips/qemu_mips/init.c (grub_arch_modules_addr): + * VasEBoot-core/disk/memdisk.c (VasEBoot_MOD_INIT): Switched to new interface. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_arch_modules_addr): Renamed to... + (VasEBoot_efi_modules_addr): ...this. + * VasEBoot-core/kern/efi/init.c (VasEBoot_modbase): New variable. + (VasEBoot_efi_init): Set VasEBoot_modbase. + * VasEBoot-core/kern/emu/main.c (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_modbase): New variable. + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_modbase): New variable. + (VasEBoot_machine_init): Set VasEBoot_modbase. + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_modbase): New variable. + (VasEBoot_machine_init): Set VasEBoot_modbase. + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_modbase): New variable. + (VasEBoot_machine_init): Set VasEBoot_modbase. + * VasEBoot-core/kern/main.c (VasEBoot_module_iterate): Remove. + (VasEBoot_modules_get_end): Use VasEBoot_modbase. + (VasEBoot_load_modules): Use FOR_MODULES. + (VasEBoot_load_config): Likewise. + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_modbase): New variable. + (VasEBoot_machine_init): Set VasEBoot_modbase. + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_modbase): New variable. + (VasEBoot_machine_init): Set VasEBoot_modbase. + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_arch_modules_addr): Removed. - (grub_modbase): New variable. - (grub_machine_init): Set grub_modbase. - * include/grub/efi/efi.h (grub_efi_modules_addr): New declaration. - * include/grub/kernel.h (grub_arch_modules_addr): Removed. - (grub_module_iterate): Likewise. - (grub_modbase): New variable declaration. + (VasEBoot_modbase): New variable. + (VasEBoot_machine_init): Set VasEBoot_modbase. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_modules_addr): New declaration. + * include/VasEBoot/kernel.h (VasEBoot_arch_modules_addr): Removed. + (VasEBoot_module_iterate): Likewise. + (VasEBoot_modbase): New variable declaration. (FOR_MODULES): New macro. 2011-10-16 Vladimir Serbinenko * configure.ac: Check for __ctzdi2 and __ctzsi2. - * include/grub/libgcc.h: Include __ctzdi2 and __ctzsi2 if present. + * include/VasEBoot/libgcc.h: Include __ctzdi2 and __ctzsi2 if present. 2011-10-16 Vladimir Serbinenko Fix few obvious type discrepancies. - * grub-core/fs/affs.c (grub_affs_read_file): Use grub_off_t for offset. - * grub-core/fs/afs.c (grub_afs_read_file): Likewise. - * grub-core/fs/fshelp.c (grub_fshelp_find_file): Remove leftover + * VasEBoot-core/fs/affs.c (VasEBoot_affs_read_file): Use VasEBoot_off_t for offset. + * VasEBoot-core/fs/afs.c (VasEBoot_afs_read_file): Likewise. + * VasEBoot-core/fs/fshelp.c (VasEBoot_fshelp_find_file): Remove leftover variable. - * grub-core/fs/hfs.c (grub_hfs_read_file): Use grub_off_t for offset + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_read_file): Use VasEBoot_off_t for offset and connected types. - * grub-core/fs/nilfs2.c (grub_nilfs2_read_file): Use grub_off_t for + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_read_file): Use VasEBoot_off_t for offset. - (grub_nilfs2_iterate_dir): Use grub_off_t for fpos. - * grub-core/fs/sfs.c (grub_sfs_read_file): Use grub_off_t for offset. - * grub-core/fs/ufs.c (grub_ufs_read_file): Use grub_off_t for offset + (VasEBoot_nilfs2_iterate_dir): Use VasEBoot_off_t for fpos. + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_read_file): Use VasEBoot_off_t for offset. + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_read_file): Use VasEBoot_off_t for offset and connected types. 2011-10-16 Vladimir Serbinenko @@ -17941,22 +17941,22 @@ 2011-10-16 Vladimir Serbinenko - * grub-core/fs/xfs.c (grub_xfs_inode): New field fork_offset. - (GRUB_XFS_INO_AGBITS): Make into inline function. - (GRUB_XFS_INO_INOINAG): Likewise. - (GRUB_XFS_INO_AG): Likewise. - (GRUB_XFS_FSB_TO_BLOCK): Likewise. - (GRUB_XFS_EXTENT_OFFSET): Likewise. - (GRUB_XFS_EXTENT_BLOCK): Likewise. - (GRUB_XFS_EXTENT_SIZE): Likewise. - (GRUB_XFS_ROUND_TO_DIRENT): Likewise. - (GRUB_XFS_NEXT_DIRENT): Likewise. - (grub_xfs_read_block): Rewrite the btree parsing. Fixes invalid BMAP. - (grub_xfs_read_file): Fix offset type. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_inode): New field fork_offset. + (VasEBoot_XFS_INO_AGBITS): Make into inline function. + (VasEBoot_XFS_INO_INOINAG): Likewise. + (VasEBoot_XFS_INO_AG): Likewise. + (VasEBoot_XFS_FSB_TO_BLOCK): Likewise. + (VasEBoot_XFS_EXTENT_OFFSET): Likewise. + (VasEBoot_XFS_EXTENT_BLOCK): Likewise. + (VasEBoot_XFS_EXTENT_SIZE): Likewise. + (VasEBoot_XFS_ROUND_TO_DIRENT): Likewise. + (VasEBoot_XFS_NEXT_DIRENT): Likewise. + (VasEBoot_xfs_read_block): Rewrite the btree parsing. Fixes invalid BMAP. + (VasEBoot_xfs_read_file): Fix offset type. 2011-10-15 Robert Millan - * util/getroot.c (grub_util_get_grub_dev): Fix OS selection #ifdefs. + * util/getroot.c (VasEBoot_util_get_VasEBoot_dev): Fix OS selection #ifdefs. 2011-10-15 Robert Millan @@ -17968,109 +17968,109 @@ Fix overflow with >2GiB file on HFS+. >4GiB wasn't tested. - * grub-core/fs/hfsplus.c (grub_hfsplus_btree): Use more appropriate + * VasEBoot-core/fs/hfsplus.c (VasEBoot_hfsplus_btree): Use more appropriate types. - (grub_hfsplus_btree_recoffset): Likewise. - (grub_hfsplus_btree_recptr): Likewise. - (grub_hfsplus_find_block): Likewise. - (grub_hfsplus_btree_search): Likewise. - (grub_hfsplus_read_block): Likewise. - (grub_hfsplus_read_file): Likewise. - (grub_hfsplus_mount): Likewise. - (grub_hfsplus_btree_iterate_node): Likewise. - (grub_hfsplus_btree_search): Likewise. - (grub_hfsplus_iterate_dir): Likewise. - (grub_hfsplus_read): A small code simplification. + (VasEBoot_hfsplus_btree_recoffset): Likewise. + (VasEBoot_hfsplus_btree_recptr): Likewise. + (VasEBoot_hfsplus_find_block): Likewise. + (VasEBoot_hfsplus_btree_search): Likewise. + (VasEBoot_hfsplus_read_block): Likewise. + (VasEBoot_hfsplus_read_file): Likewise. + (VasEBoot_hfsplus_mount): Likewise. + (VasEBoot_hfsplus_btree_iterate_node): Likewise. + (VasEBoot_hfsplus_btree_search): Likewise. + (VasEBoot_hfsplus_iterate_dir): Likewise. + (VasEBoot_hfsplus_read): A small code simplification. 2011-10-14 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Don't assume that children of mapper nodes are mapper nodes. 2011-10-14 Vladimir Serbinenko - * grub-core/lib/posix_wrap/ctype.h (isxdigit): Use grub_isxdigit. - * include/grub/misc.h (grub_isxdigit): New function. - * grub-core/video/colors.c (my_isxdigit): Removed. All users - switched to grub_isxdigit. - * grub-core/term/serial.c (grub_serial_find): Fix in case of port + * VasEBoot-core/lib/posix_wrap/ctype.h (isxdigit): Use VasEBoot_isxdigit. + * include/VasEBoot/misc.h (VasEBoot_isxdigit): New function. + * VasEBoot-core/video/colors.c (my_isxdigit): Removed. All users + switched to VasEBoot_isxdigit. + * VasEBoot-core/term/serial.c (VasEBoot_serial_find): Fix in case of port number starting with a letter. 2011-10-09 Robert Millan LVM support for FreeBSD and GNU/kFreeBSD. - * util/lvm.c (grub_util_lvm_isvolume): Enable on FreeBSD and + * util/lvm.c (VasEBoot_util_lvm_isvolume): Enable on FreeBSD and GNU/kFreeBSD. (LVM_DEV_MAPPER_STRING): Move from here ... - * include/grub/util/lvm.h (LVM_DEV_MAPPER_STRING): ... to here. - * util/getroot.c: Include `'. - (grub_util_get_dev_abstraction): Enable - grub_util_biosdisk_is_present() on FreeBSD and GNU/kFreeBSD. + * include/VasEBoot/util/lvm.h (LVM_DEV_MAPPER_STRING): ... to here. + * util/getroot.c: Include `'. + (VasEBoot_util_get_dev_abstraction): Enable + VasEBoot_util_biosdisk_is_present() on FreeBSD and GNU/kFreeBSD. Check for LVM abstraction on FreeBSD and GNU/kFreeBSD. - (grub_util_get_grub_dev): Replace "/dev/mapper/" with + (VasEBoot_util_get_VasEBoot_dev): Replace "/dev/mapper/" with `LVM_DEV_MAPPER_STRING'. Enable LVM and mdRAID only on platforms that support it. - * util/grub-setup.c (main): Check for LVM also on FreeBSD and + * util/VasEBoot-setup.c (main): Check for LVM also on FreeBSD and GNU/kFreeBSD. - * util/grub.d/10_kfreebsd.in: Load `geom_linux_lvm' kernel module - when LVM abstraction is required for ${GRUB_DEVICE}. + * util/VasEBoot.d/10_kfreebsd.in: Load `geom_linux_lvm' kernel module + when LVM abstraction is required for ${VasEBoot_DEVICE}. 2011-10-06 Szymon Janc - Add support for LZO compression in GRUB: + Add support for LZO compression in VasEBoot: - import of minilzo library, - LZO decompression for btrfs, - lzop files decompression. - * grub-core/io/lzopio.c: New file. - * grub-core/lib/adler32.c: Likewise. - * grub-core/lib/minilzo/lzoconf.h: Likewise. - * grub-core/lib/minilzo/lzodefs.h: Likewise. - * grub-core/lib/minilzo/minilzo.c: Likewise. - * grub-core/lib/minilzo/minilzo.h: Likewise. - * Makefile.util.def (libgrubmods.a): Add grub-core/io/lzopio.c, - grub-core/lib/adler32.c, grub-core/io/lzopio.c, - grub-core/lib/minilzo/minilzo.c to common. - * Makefile.util.def (libgrubmods.a): Add flags required by minilzo to + * VasEBoot-core/io/lzopio.c: New file. + * VasEBoot-core/lib/adler32.c: Likewise. + * VasEBoot-core/lib/minilzo/lzoconf.h: Likewise. + * VasEBoot-core/lib/minilzo/lzodefs.h: Likewise. + * VasEBoot-core/lib/minilzo/minilzo.c: Likewise. + * VasEBoot-core/lib/minilzo/minilzo.h: Likewise. + * Makefile.util.def (libVasEBootmods.a): Add VasEBoot-core/io/lzopio.c, + VasEBoot-core/lib/adler32.c, VasEBoot-core/io/lzopio.c, + VasEBoot-core/lib/minilzo/minilzo.c to common. + * Makefile.util.def (libVasEBootmods.a): Add flags required by minilzo to cflags in cppflags. - * grub-core/Makefile.core.def (btrfs): Likewise. - * grub-core/Makefile.core.def (lzopio): New module. + * VasEBoot-core/Makefile.core.def (btrfs): Likewise. + * VasEBoot-core/Makefile.core.def (lzopio): New module. (adler32): Likewise. - * grub-core/fs/btrfs.c: Include minilzo.h. - (GRUB_BTRFS_COMPRESSION_LZO): New define. - (GRUB_BTRFS_LZO_BLOCK_SIZE): Likewise. - (GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE): Likewise. - (grub_btrfs_lzo_decompress): New function. - (grub_btrfs_extent_read): Add support for LZO compression type. - * include/grub/types.h (GRUB_UCHAR_MAX): New define. - (GRUB_USHRT_MAX): Likewise. - (GRUB_UINT_MAX): Likewise. - * grub-core/lib/posix_wrap/limits.h (USHRT_MAX): Likewise. + * VasEBoot-core/fs/btrfs.c: Include minilzo.h. + (VasEBoot_BTRFS_COMPRESSION_LZO): New define. + (VasEBoot_BTRFS_LZO_BLOCK_SIZE): Likewise. + (VasEBoot_BTRFS_LZO_BLOCK_MAX_CSIZE): Likewise. + (VasEBoot_btrfs_lzo_decompress): New function. + (VasEBoot_btrfs_extent_read): Add support for LZO compression type. + * include/VasEBoot/types.h (VasEBoot_UCHAR_MAX): New define. + (VasEBoot_USHRT_MAX): Likewise. + (VasEBoot_UINT_MAX): Likewise. + * VasEBoot-core/lib/posix_wrap/limits.h (USHRT_MAX): Likewise. (UINT_MAX): Likewise. (CHAR_BIT): Likewise. - * grub-core/lib/posix_wrap/sys/types.h (ULONG_MAX): Moved to - grub-core/lib/posix_wrap/limits.h + * VasEBoot-core/lib/posix_wrap/sys/types.h (ULONG_MAX): Moved to + VasEBoot-core/lib/posix_wrap/limits.h (UCHAR_MAX): Likewise. - * include/grub/file.h (grub_file_filter_id): New compression filter - GRUB_FILE_FILTER_LZOPIO. - * include/grub/file.h (grub_file_filter_id): Set - GRUB_FILE_FILTER_LZOPIO as GRUB_FILE_FILTER_COMPRESSION_LAST. - * include/grub/types.h (grub_get_unaligned16): New function. - (grub_get_unaligned32): Likewise. - (grub_get_unaligned64): Likewise. + * include/VasEBoot/file.h (VasEBoot_file_filter_id): New compression filter + VasEBoot_FILE_FILTER_LZOPIO. + * include/VasEBoot/file.h (VasEBoot_file_filter_id): Set + VasEBoot_FILE_FILTER_LZOPIO as VasEBoot_FILE_FILTER_COMPRESSION_LAST. + * include/VasEBoot/types.h (VasEBoot_get_unaligned16): New function. + (VasEBoot_get_unaligned32): Likewise. + (VasEBoot_get_unaligned64): Likewise. * util/import_gcry.py (cryptolist): Add adler32. 2011-10-05 Vladimir Serbinenko - * grub-core/Makefile.core.def: Eliminate rarely used emu_condition. This + * VasEBoot-core/Makefile.core.def: Eliminate rarely used emu_condition. This in perspective decreases the complexity of build system and fixes compilation right now. 2011-10-01 Ales Nesrsta - * grub-core/bus/usb/uhci.c: Changes made by Rock Cui - thanks! + * VasEBoot-core/bus/usb/uhci.c: Changes made by Rock Cui - thanks! (fixed problem related to using UHCI with coreboot). 2011-08-25 BVK Chaitanya @@ -18080,17 +18080,17 @@ 2011-09-29 Mads Kiilerich - * grub-core/Makefile.core.def (kernel): Add kern/i386/int.S to + * VasEBoot-core/Makefile.core.def (kernel): Add kern/i386/int.S to extra_dist. 2011-09-29 Mario Limonciello - * util/misc.c (grub_util_get_disk_size) [__MINGW32__]: Strip trailing + * util/misc.c (VasEBoot_util_get_disk_size) [__MINGW32__]: Strip trailing slashes on PHYSICALDRIVE%d paths when making Windows CreateFile calls. 2011-09-29 Mario Limonciello - * grub-core/kern/emu/misc.c (canonicalize_file_name) [__MINGW32__]: Use + * VasEBoot-core/kern/emu/misc.c (canonicalize_file_name) [__MINGW32__]: Use _fullpath. 2011-09-29 Mario Limonciello @@ -18098,69 +18098,69 @@ Remove extra declaration of sleep for mingw32. * util/misc.c (sleep) [__MINGW32__]: Removed. - * include/grub/util/misc.h (sleep) [__MINGW32__]: Likewise. + * include/VasEBoot/util/misc.h (sleep) [__MINGW32__]: Likewise. 2011-09-28 Grégoire Sutre - * include/grub/bsdlabel.h (grub_partition_bsd_disk_label): Add fields + * include/VasEBoot/bsdlabel.h (VasEBoot_partition_bsd_disk_label): Add fields type and packname. - * include/grub/i386/netbsd_bootinfo.h (NETBSD_BTINFO_BOOTDISK): + * include/VasEBoot/i386/netbsd_bootinfo.h (NETBSD_BTINFO_BOOTDISK): Resurrected. (NETBSD_BTINFO_BOOTWEDGE): New definition. - (grub_netbsd_btinfo_bootwedge): New struct. - * grub-core/loader/i386/bsd.c (grub_netbsd_add_boot_disk_and_wedge): + (VasEBoot_netbsd_btinfo_bootwedge): New struct. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_netbsd_add_boot_disk_and_wedge): New function. - (grub_cmd_netbsd): Call grub_netbsd_add_boot_disk_and_wedge. + (VasEBoot_cmd_netbsd): Call VasEBoot_netbsd_add_boot_disk_and_wedge. 2011-09-28 Thomas Haller - * grub-core/loader/multiboot_elfxx.c (Elf_Shdr): Set according to + * VasEBoot-core/loader/multiboot_elfxx.c (Elf_Shdr): Set according to loader. 2011-09-28 Andreas Born Fix incorrect identifiers in bash-completion. - * util/bash-completion.d/grub-completion.bash.in - (_grub_mkpasswd-pbkdf2): Rename to ... - (_grub_mkpasswd_pbkdf2): ... this. All users updated. - (_grub_script-check): Rename to ... - (_grub_script_check): ... this. All users updated. + * util/bash-completion.d/VasEBoot-completion.bash.in + (_VasEBoot_mkpasswd-pbkdf2): Rename to ... + (_VasEBoot_mkpasswd_pbkdf2): ... this. All users updated. + (_VasEBoot_script-check): Rename to ... + (_VasEBoot_script_check): ... this. All users updated. 2011-09-28 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_is_floppy): Return 0 if disk isn't biosdisk. 2011-09-17 Grégoire Sutre - * Makefile.util.def (grub-mkrelpath): Add LIBUTIL for getrawpartition(3) + * Makefile.util.def (VasEBoot-mkrelpath): Add LIBUTIL for getrawpartition(3) on NetBSD. - * Makefile.util.def (grub-fstest): Likewise. + * Makefile.util.def (VasEBoot-fstest): Likewise. 2011-09-17 Grégoire Sutre - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__NetBSD__]: + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors) [__NetBSD__]: Get sector size from disk label. 2011-09-05 Colin Watson - * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Return 1 for + * util/VasEBoot-mkconfig_lib.in (VasEBoot_file_is_not_garbage): Return 1 for */README* as well as README*. Reported by: Axel Beckert. 2011-08-23 Vladimir Serbinenko - * grub-core/kern/mips/loongson/init.c (grub_machine_init): Handle the + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_machine_init): Handle the case of less than 256 MiB of RAM. 2011-08-23 Vladimir Serbinenko - * grub-core/commands/wildcard.c (make_regex): Handle @. + * VasEBoot-core/commands/wildcard.c (make_regex): Handle @. 2011-08-23 Vladimir Serbinenko - * util/grub-install.in: Move cryptodisk logic to appropriate place. + * util/VasEBoot-install.in: Move cryptodisk logic to appropriate place. 2011-08-21 Szymon Janc @@ -18169,62 +18169,62 @@ 2011-08-20 Szymon Janc - Add grub-fstest option to uncompress data for commands. + Add VasEBoot-fstest option to uncompress data for commands. - * util/grub-fstest.c (uncompress): New var. + * util/VasEBoot-fstest.c (uncompress): New var. (options): New option -u. 2011-08-20 Szymon Janc - * grub-core/loader/i386/linux.c (grub_linux_setup_video): Add - GRUB_VIDEO_DRIVER_RADEON_FULOONG2E to switch case statement. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_setup_video): Add + VasEBoot_VIDEO_DRIVER_RADEON_FULOONG2E to switch case statement. 2011-08-20 Szymon Janc - * grub-core/io/gzio.c (grub_gzio_open): Always return original io if + * VasEBoot-core/io/gzio.c (VasEBoot_gzio_open): Always return original io if file type was not recognized correctly (not gzip or corrupted). 2011-08-19 Vladimir Serbinenko - * grub-core/kern/mips/loongson/init.c (grub_reboot): Reboot Fuloong. - * include/grub/cs5536.h (GRUB_CS5536_MSR_DIVIL_RESET): New definition. + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_reboot): Reboot Fuloong. + * include/VasEBoot/cs5536.h (VasEBoot_CS5536_MSR_DIVIL_RESET): New definition. 2011-08-19 Vladimir Serbinenko - * grub-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on + * VasEBoot-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on loongson. - * grub-core/kern/mips/loongson/init.c (grub_machine_init): Init + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_machine_init): Init video_radeon_fuloong2e. - * grub-core/video/radeon_fuloong2e.c: New file. - * include/grub/video.h (grub_video_id_t): Add new ID - GRUB_VIDEO_DRIVER_RADEON_FULOONG2E. + * VasEBoot-core/video/radeon_fuloong2e.c: New file. + * include/VasEBoot/video.h (VasEBoot_video_id_t): Add new ID + VasEBoot_VIDEO_DRIVER_RADEON_FULOONG2E. 2011-08-19 Vladimir Serbinenko - * include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_COP0_PRID): New + * include/VasEBoot/mips/loongson.h (VasEBoot_CPU_LOONGSON_COP0_PRID): New define. - * grub-core/kern/mips/loongson/init.c (grub_machine_init): Check + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_machine_init): Check that PRID matches the detected subplatform and reset the subplatform if it doesn't. 2011-08-19 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vprintf): Fix a bug on malloc failure. + * VasEBoot-core/kern/misc.c (VasEBoot_vprintf): Fix a bug on malloc failure. 2011-08-19 Vladimir Serbinenko Fix PCI iterating on functions >= 4. - * grub-core/bus/pci.c (grub_pci_iterate): Remove useless ghost skipping. - * include/grub/mips/loongson/pci.h (GRUB_LOONGSON_OHCI_GHOST_FUNCTION): + * VasEBoot-core/bus/pci.c (VasEBoot_pci_iterate): Remove useless ghost skipping. + * include/VasEBoot/mips/loongson/pci.h (VasEBoot_LOONGSON_OHCI_GHOST_FUNCTION): Removed. - (GRUB_LOONGSON_EHCI_GHOST_FUNCTION): Likewise. - (grub_pci_read): Fix bitmask. - (grub_pci_read_word): Likewise. - (grub_pci_read_byte): Likewise. - (grub_pci_write): Likewise. - (grub_pci_write_word): Likewise. - (grub_pci_write_byte): Likewise. + (VasEBoot_LOONGSON_EHCI_GHOST_FUNCTION): Likewise. + (VasEBoot_pci_read): Fix bitmask. + (VasEBoot_pci_read_word): Likewise. + (VasEBoot_pci_read_byte): Likewise. + (VasEBoot_pci_write): Likewise. + (VasEBoot_pci_write_word): Likewise. + (VasEBoot_pci_write_byte): Likewise. 2011-08-19 Vladimir Serbinenko @@ -18235,30 +18235,30 @@ Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E. - * grub-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong + * VasEBoot-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong into fwstart_fuloong2f. Use boot/mips/loongson/fuloong2f.S. - * grub-core/boot/mips/loongson/fuloong.S: Rename to ... - * grub-core/boot/mips/loongson/fuloong2f.S: ... this. + * VasEBoot-core/boot/mips/loongson/fuloong.S: Rename to ... + * VasEBoot-core/boot/mips/loongson/fuloong2f.S: ... this. (FULOONG): Rename to ... (FULOONG2F): ... this. All users updated. - * grub-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to + * VasEBoot-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to (machtype_fuloong2f_str): ... this. (machtype_fuloong2e_str): New string. Check for machtype_fuloong2e_str. - * grub-core/loader/mips/linux.c (loongson_machtypes) - [GRUB_MACHINE_MIPS_LOONGSON]: Add GRUB_ARCH_MACHINE_FULOONG2E. - * grub-core/term/serial.c (loongson_defserial) - [GRUB_MACHINE_MIPS_LOONGSON]: New array. - (grub_serial_register) [GRUB_MACHINE_MIPS_LOONGSON]: Use + * VasEBoot-core/loader/mips/linux.c (loongson_machtypes) + [VasEBoot_MACHINE_MIPS_LOONGSON]: Add VasEBoot_ARCH_MACHINE_FULOONG2E. + * VasEBoot-core/term/serial.c (loongson_defserial) + [VasEBoot_MACHINE_MIPS_LOONGSON]: New array. + (VasEBoot_serial_register) [VasEBoot_MACHINE_MIPS_LOONGSON]: Use loongson_defserial. - * include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_FULOONG): + * include/VasEBoot/mips/loongson/kernel.h (VasEBoot_ARCH_MACHINE_FULOONG): Rename to ... - (GRUB_ARCH_MACHINE_FULOONG2F): ... this. - (GRUB_ARCH_MACHINE_FULOONG2E): New const. - * util/grub-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH + (VasEBoot_ARCH_MACHINE_FULOONG2F): ... this. + (VasEBoot_ARCH_MACHINE_FULOONG2E): New const. + * util/VasEBoot-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH to IMAGE_FULOONG2F_FLASH. All users updated. (image_targets): Rename images. - * util/grub-mkstandalone.in: Accept fuloong2f and fuloong2e. + * util/VasEBoot-mkstandalone.in: Accept fuloong2f and fuloong2e. 2011-08-19 Szymon Janc @@ -18266,53 +18266,53 @@ * configure.ac: --enable-cache-stats added. * config.h.in (DISK_CACHE_STATS): New define. - * grub-core/Makefile.core.def (cacheinfo): New command. - * include/grub/disk.h(grub_disk_cache_get_performance): New function. - * grub-core/commands/cacheinfo.c: New file. - * grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and + * VasEBoot-core/Makefile.core.def (cacheinfo): New command. + * include/VasEBoot/disk.h(VasEBoot_disk_cache_get_performance): New function. + * VasEBoot-core/commands/cacheinfo.c: New file. + * VasEBoot-core/commands/minicmd.c (VasEBoot_rescue_cmd_info): Updated and moved to cacheinfo.c. - * grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache + * VasEBoot-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache debug code. - * include/grub/disk.h: Likewise. + * include/VasEBoot/disk.h: Likewise. 2011-08-19 Szymon Janc * Makefile.am (AUTOMAKE_OPTIONS): = Added -Wno-portability flag. - * grub-core/Makefile.am: Likewise. + * VasEBoot-core/Makefile.am: Likewise. 2011-08-16 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_iterate): Skip with + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_iterate): Skip with non-zero pull. 2011-08-16 Vladimir Serbinenko - * grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_read_file): New parameter ino. All users updated. - (grub_jfs_lookup_symlink): Use correct starting inode. + (VasEBoot_jfs_lookup_symlink): Use correct starting inode. 2011-08-16 Vladimir Serbinenko - * util/grub-setup.c (main): Add missing gcry initialisation. + * util/VasEBoot-setup.c (main): Add missing gcry initialisation. 2011-08-16 Vladimir Serbinenko Don't accept text modes on EFI when booting Linux. - * grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. - (grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. + * VasEBoot-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. + (VasEBoot_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. 2011-08-15 Mario Limonciello 2011-08-15 Colin Watson - * util/grub-probe.c (probe): Canonicalise the path argument, fixing - use of "/path/.." as in grub-install for EFI as well as handling + * util/VasEBoot-probe.c (probe): Canonicalise the path argument, fixing + use of "/path/.." as in VasEBoot-install for EFI as well as handling symlinks correctly. Fixes Debian bug #637768. 2011-08-15 Colin Watson - * util/grub-probe.c: Remove duplicate #include. + * util/VasEBoot-probe.c: Remove duplicate #include. 2011-08-10 Robert Millan @@ -18320,112 +18320,112 @@ * util/deviceiter.c [__FreeBSD_kernel__] (get_mfi_disk_name): New function. - [__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for mfi + [__FreeBSD_kernel__] (VasEBoot_util_iterate_devices): Scan for mfi (/dev/mfid[0-9]+) devices using get_mfi_disk_name(). 2011-08-03 Robert Millan - * include/grub/zfs/zap_leaf.h (typedef union zap_leaf_chunk): Mark + * include/VasEBoot/zfs/zap_leaf.h (typedef union zap_leaf_chunk): Mark la_array as packed. Reported by: Zachary Bedell 2011-07-26 Colin Watson - * configure.ac: The Loongson port requires grub-mkfont due to its + * configure.ac: The Loongson port requires VasEBoot-mkfont due to its use of -DUSE_ASCII_FAILBACK. Raise an error if it is not going to be built. 2011-07-26 Colin Watson - * util/grub-install.in: Don't source grub-mkconfig_lib until after - processing arguments (otherwise help2man fails when GRUB has not yet + * util/VasEBoot-install.in: Don't source VasEBoot-mkconfig_lib until after + processing arguments (otherwise help2man fails when VasEBoot has not yet been installed). 2011-07-25 Vladimir Serbinenko - New script grub-mkstandalone. + New script VasEBoot-mkstandalone. - * Makefile.util.def (grub-mkstandalone): New script. - * docs/man/grub-mkstandalone.h2m: New file. - * util/grub-mkstandalone.in: Likewise. + * Makefile.util.def (VasEBoot-mkstandalone): New script. + * docs/man/VasEBoot-mkstandalone.h2m: New file. + * util/VasEBoot-mkstandalone.in: Likewise. 2011-07-25 Vladimir Serbinenko Support ATA disks with 4K sectors. - * include/grub/ata.h (grub_ata): New member log_sector_size. - * grub-core/disk/ata.c (grub_ata_dumpinfo): Show sector size. - (grub_ata_identify): Read sector size. - (grub_ata_readwrite): Use log_sector_size rather than hardcoded value. + * include/VasEBoot/ata.h (VasEBoot_ata): New member log_sector_size. + * VasEBoot-core/disk/ata.c (VasEBoot_ata_dumpinfo): Show sector size. + (VasEBoot_ata_identify): Read sector size. + (VasEBoot_ata_readwrite): Use log_sector_size rather than hardcoded value. 2011-07-25 Vladimir Serbinenko - * util/grub-install.in: Don't use uhci outside of x86. + * util/VasEBoot-install.in: Don't use uhci outside of x86. 2011-07-25 Vladimir Serbinenko - * util/grub-mkrescue.in: Add missing quotes. + * util/VasEBoot-mkrescue.in: Add missing quotes. 2011-07-25 Vladimir Serbinenko - * grub-core/normal/menu.c (grub_menu_execute_entry): Fix NULL + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): Fix NULL dereference. 2011-07-23 Vladimir Serbinenko - * grub-core/disk/pata.c (grub_pata_readwrite): Add missing wait. + * VasEBoot-core/disk/pata.c (VasEBoot_pata_readwrite): Add missing wait. 2011-07-23 Vladimir Serbinenko - * include/grub/video.h: add missing EXPORT_FUND on - grub_video_edid_checksum and grub_video_edid_preferred_mode. + * include/VasEBoot/video.h: add missing EXPORT_FUND on + VasEBoot_video_edid_checksum and VasEBoot_video_edid_preferred_mode. 2011-07-23 Vladimir Serbinenko - * include/grub/mips/kernel.h: Fix define conflict. + * include/VasEBoot/mips/kernel.h: Fix define conflict. 2011-07-23 Vladimir Serbinenko - * grub-core/kern/mips/cache_flush.S [GRUB_MACHINE_MIPS_LOONGSON]: Flush + * VasEBoot-core/kern/mips/cache_flush.S [VasEBoot_MACHINE_MIPS_LOONGSON]: Flush all four ways. 2011-07-21 Colin Watson Preferred resolution detection for VBE. - * grub-core/video/video.c (grub_video_edid_checksum): New function. - (grub_video_edid_preferred_mode): Likewise. Try EDID followed by + * VasEBoot-core/video/video.c (VasEBoot_video_edid_checksum): New function. + (VasEBoot_video_edid_preferred_mode): Likewise. Try EDID followed by the Flat Panel extension, in line with the X.org VESA driver. - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_flat_panel_info): New function. - (grub_vbe_bios_get_ddc_capabilities): Likewise. - (grub_vbe_bios_read_edid): Likewise. - (grub_vbe_get_preferred_mode): Likewise. - (grub_video_vbe_setup): When the mode is "auto", try to get the + (VasEBoot_vbe_bios_get_ddc_capabilities): Likewise. + (VasEBoot_vbe_bios_read_edid): Likewise. + (VasEBoot_vbe_get_preferred_mode): Likewise. + (VasEBoot_video_vbe_setup): When the mode is "auto", try to get the preferred mode from VBE, and use the largest mode that is no larger than the preferred mode (some BIOSes expose a preferred mode that is not in their mode list!). If this fails, fall back to 640x480 as a safe conservative choice. - (grub_video_vbe_get_edid): New function. - (grub_video_vbe_adapter): Add get_edid. - * include/grub/video.h (struct grub_vbe_edid_info): New structure. - (struct grub_video_adapter): Add get_edid. - (grub_video_edid_checksum): Add prototype. - (grub_video_edid_preferred_mode): Likewise. - * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New + (VasEBoot_video_vbe_get_edid): New function. + (VasEBoot_video_vbe_adapter): Add get_edid. + * include/VasEBoot/video.h (struct VasEBoot_vbe_edid_info): New structure. + (struct VasEBoot_video_adapter): Add get_edid. + (VasEBoot_video_edid_checksum): Add prototype. + (VasEBoot_video_edid_preferred_mode): Likewise. + * include/VasEBoot/i386/pc/vbe.h (struct VasEBoot_vbe_flat_panel_info): New structure. - * grub-core/commands/videoinfo.c (print_edid): New function. - (grub_cmd_videoinfo): Print EDID if available. + * VasEBoot-core/commands/videoinfo.c (print_edid): New function. + (VasEBoot_cmd_videoinfo): Print EDID if available. - * util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto". This + * util/VasEBoot.d/00_header.in (VasEBoot_GFXMODE): Default to "auto". This is more appropriate on a wider range of platforms than 640x480. - * docs/grub.texi (Simple configuration): Update GRUB_GFXMODE + * docs/VasEBoot.texi (Simple configuration): Update VasEBoot_GFXMODE documentation. 2011-07-10 Vladimir Serbinenko - * util/grub-install.in: Recognize ESP mounted at /boot/EFI. + * util/VasEBoot-install.in: Recognize ESP mounted at /boot/EFI. 2011-07-10 Vladimir Serbinenko @@ -18433,36 +18433,36 @@ 2011-07-10 Vladimir Serbinenko - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Fix incorrect memory usage. 2011-07-10 Vladimir Serbinenko - * util/grub-install.in: Source grub-mkconfig_lib. + * util/VasEBoot-install.in: Source VasEBoot-mkconfig_lib. 2011-07-08 Vladimir Serbinenko Remove getroot.c from core on emu platform. - * grub-core/Makefile.core.def (kernel): Remove kern/emu/getroot.c and + * VasEBoot-core/Makefile.core.def (kernel): Remove kern/emu/getroot.c and kern/emu/raid.c. - * grub-core/kern/emu/main.c (main): Don't try to guess root device. It's + * VasEBoot-core/kern/emu/main.c (main): Don't try to guess root device. It's useless. - * grub-core/kern/emu/misc.c (get_win32_path): Moved from here... + * VasEBoot-core/kern/emu/misc.c (get_win32_path): Moved from here... * util/getroot.c (get_win32_path): ... here. - * grub-core/kern/emu/misc.c (fini_libzfs): Moved from here... + * VasEBoot-core/kern/emu/misc.c (fini_libzfs): Moved from here... * util/getroot.c (fini_libzfs): ... here. - * grub-core/kern/emu/misc.c (grub_get_libzfs_handle): Moved from here... - * util/getroot.c (grub_get_libzfs_handle): ... here. - * grub-core/kern/emu/misc.c (grub_find_zpool_from_dir): + * VasEBoot-core/kern/emu/misc.c (VasEBoot_get_libzfs_handle): Moved from here... + * util/getroot.c (VasEBoot_get_libzfs_handle): ... here. + * VasEBoot-core/kern/emu/misc.c (VasEBoot_find_zpool_from_dir): Moved from here... - * util/getroot.c (grub_find_zpool_from_dir): ... here. - * grub-core/kern/emu/misc.c - (grub_make_system_path_relative_to_its_root): Moved from here... - * util/getroot.c (grub_make_system_path_relative_to_its_root): ... here. - * grub-core/kern/emu/getroot.c: Moved from here ... + * util/getroot.c (VasEBoot_find_zpool_from_dir): ... here. + * VasEBoot-core/kern/emu/misc.c + (VasEBoot_make_system_path_relative_to_its_root): Moved from here... + * util/getroot.c (VasEBoot_make_system_path_relative_to_its_root): ... here. + * VasEBoot-core/kern/emu/getroot.c: Moved from here ... * util/getroot.c: ... here. All users updated. - * grub-core/kern/emu/raid.c: Moved from here ... + * VasEBoot-core/kern/emu/raid.c: Moved from here ... * util/raid.c: ... here. All users updated. 2011-07-08 Vladimir Serbinenko @@ -18473,11 +18473,11 @@ Fix compilation on GNU/Linux. - * grub-core/kern/emu/getroot.c (grub_util_pull_device) [!FreeBSD]: + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_pull_device) [!FreeBSD]: Disable geli. - (grub_util_get_grub_dev) [!FreeBSD]: Likewise. - (grub_util_pull_device) [HAVE_DEVICE_MAPPER]: Fix const and func name. - * grub-core/disk/cryptodisk.c (grub_cryptodisk_open): Fix proto. + (VasEBoot_util_get_VasEBoot_dev) [!FreeBSD]: Likewise. + (VasEBoot_util_pull_device) [HAVE_DEVICE_MAPPER]: Fix const and func name. + * VasEBoot-core/disk/cryptodisk.c (VasEBoot_cryptodisk_open): Fix proto. 2011-07-07 Vladimir Serbinenko 2011-07-07 Michael Gorven @@ -18485,83 +18485,83 @@ LUKS and GELI support. - * Makefile.util.def (libgrubkern.a): Add grub-core/lib/crypto.c, - grub-core/disk/luks.c, grub-core/disk/geli.c, - grub-core/disk/cryptodisk.c, grub-core/disk/AFSplitter.c, - grub-core/lib/pbkdf2.c, grub-core/commands/extcmd.c, - grub-core/lib/arg.c. - (libgrubmods.a): Remove gcrypts cflags and cppflags. - Remove grub-core/commands/extcmd.c, grub-core/lib/arg.c, - grub-core/lib/crypto.c, grub-core/lib/libgcrypt-grub/cipher/sha512.c, - grub-core/lib/libgcrypt-grub/cipher/crc.c and grub-core/lib/pbkdf2.c. - (grub-bin2h): Add libgcry.a. - (grub-mkimage): Likewise. - (grub-mkrelpath): Likewise. - (grub-script-check): Likewise. - (grub-editenv): Likewise. - (grub-mkpasswd-pbkdf2): Likewise. - (grub-pe2elf): Likewise. - (grub-fstest): Likewise. - (grub-mkfont): Likewise. - (grub-mkdevicemap): Likewise. - (grub-probe): Likewise. - (grub-ofpath): Likewise. - (grub-mklayout): Likewise. + * Makefile.util.def (libVasEBootkern.a): Add VasEBoot-core/lib/crypto.c, + VasEBoot-core/disk/luks.c, VasEBoot-core/disk/geli.c, + VasEBoot-core/disk/cryptodisk.c, VasEBoot-core/disk/AFSplitter.c, + VasEBoot-core/lib/pbkdf2.c, VasEBoot-core/commands/extcmd.c, + VasEBoot-core/lib/arg.c. + (libVasEBootmods.a): Remove gcrypts cflags and cppflags. + Remove VasEBoot-core/commands/extcmd.c, VasEBoot-core/lib/arg.c, + VasEBoot-core/lib/crypto.c, VasEBoot-core/lib/libgcrypt-VasEBoot/cipher/sha512.c, + VasEBoot-core/lib/libgcrypt-VasEBoot/cipher/crc.c and VasEBoot-core/lib/pbkdf2.c. + (VasEBoot-bin2h): Add libgcry.a. + (VasEBoot-mkimage): Likewise. + (VasEBoot-mkrelpath): Likewise. + (VasEBoot-script-check): Likewise. + (VasEBoot-editenv): Likewise. + (VasEBoot-mkpasswd-pbkdf2): Likewise. + (VasEBoot-pe2elf): Likewise. + (VasEBoot-fstest): Likewise. + (VasEBoot-mkfont): Likewise. + (VasEBoot-mkdevicemap): Likewise. + (VasEBoot-probe): Likewise. + (VasEBoot-ofpath): Likewise. + (VasEBoot-mklayout): Likewise. (example_unit_test): Likewise. - (grub-menulst2cfg): Likewise. + (VasEBoot-menulst2cfg): Likewise. * autogen.sh (UTIL_DEFS): Add Makefile.utilgcry.def. - * grub-core/Makefile.core.def (cryptodisk): New module. + * VasEBoot-core/Makefile.core.def (cryptodisk): New module. (luks): Likewise. (geli): Likewise. - * grub-core/disk/AFSplitter.c: New file. - * grub-core/disk/cryptodisk.c: Likewise. - * grub-core/disk/geli.c: Likewise. - * grub-core/disk/luks.c: Likewise. - * grub-core/kern/emu/getroot.c (get_dm_uuid): New function based on - grub_util_is_lvm. - (grub_util_get_dm_abstraction): New function. - (grub_util_follow_gpart_up): Likewise. - (grub_util_get_geom_abstraction): Likewise. - (grub_util_get_dev_abstraction): Use new functions. - (grub_util_pull_device): Pull GELI and LUKS. - (grub_util_get_grub_dev): Handle LUKS and GELI. - * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): New function. - (grub_util_biosdisk_open): Use grub_util_get_fd_sectors. + * VasEBoot-core/disk/AFSplitter.c: New file. + * VasEBoot-core/disk/cryptodisk.c: Likewise. + * VasEBoot-core/disk/geli.c: Likewise. + * VasEBoot-core/disk/luks.c: Likewise. + * VasEBoot-core/kern/emu/getroot.c (get_dm_uuid): New function based on + VasEBoot_util_is_lvm. + (VasEBoot_util_get_dm_abstraction): New function. + (VasEBoot_util_follow_gpart_up): Likewise. + (VasEBoot_util_get_geom_abstraction): Likewise. + (VasEBoot_util_get_dev_abstraction): Use new functions. + (VasEBoot_util_pull_device): Pull GELI and LUKS. + (VasEBoot_util_get_VasEBoot_dev): Handle LUKS and GELI. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_get_fd_sectors): New function. + (VasEBoot_util_biosdisk_open): Use VasEBoot_util_get_fd_sectors. (follow_geom_up): Removed. - (grub_util_fd_seek): New function. - (open_device): Use grub_util_fd_seek. + (VasEBoot_util_fd_seek): New function. + (open_device): Use VasEBoot_util_fd_seek. (nread): Rename to .. - (grub_util_fd_read): ... this. All users updated. - * grub-core/lib/crypto.c (grub_crypto_ecb_decrypt): A better prototype. - (grub_crypto_cbc_decrypt): Likewise. - (grub_crypto_hmac_write): Likewise. - (grub_crypto_hmac_buffer): Likewise. - (grub_password_get): Extend to util. - * include/grub/crypto.h (gcry_cipher_spec) [GRUB_UTIL]: + (VasEBoot_util_fd_read): ... this. All users updated. + * VasEBoot-core/lib/crypto.c (VasEBoot_crypto_ecb_decrypt): A better prototype. + (VasEBoot_crypto_cbc_decrypt): Likewise. + (VasEBoot_crypto_hmac_write): Likewise. + (VasEBoot_crypto_hmac_buffer): Likewise. + (VasEBoot_password_get): Extend to util. + * include/VasEBoot/crypto.h (gcry_cipher_spec) [VasEBoot_UTIL]: New member modname. - (gcry_md_spec) [GRUB_UTIL]: Likewise. - * include/grub/cryptodisk.h: New file. - * include/grub/disk.h (grub_disk_dev_id): Rename LUKS to CRYPTODISK. - * include/grub/emu/getroot.h (grub_dev_abstraction_types): Add + (gcry_md_spec) [VasEBoot_UTIL]: Likewise. + * include/VasEBoot/cryptodisk.h: New file. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Rename LUKS to CRYPTODISK. + * include/VasEBoot/emu/getroot.h (VasEBoot_dev_abstraction_types): Add LUKS and GELI. - (grub_util_follow_gpart_up): New proto. - * include/grub/emu/hostdisk.h (grub_util_fd_seek): Likewise. - (grub_util_fd_read): Likewise. - (grub_cryptodisk_cheat_mount): Likewise. - (grub_util_cryptodisk_print_uuid): Likewise. - (grub_util_get_fd_sectors): Likewise. - * util/grub-fstest.c (mount_crypt): New var. + (VasEBoot_util_follow_gpart_up): New proto. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_fd_seek): Likewise. + (VasEBoot_util_fd_read): Likewise. + (VasEBoot_cryptodisk_cheat_mount): Likewise. + (VasEBoot_util_cryptodisk_print_uuid): Likewise. + (VasEBoot_util_get_fd_sectors): Likewise. + * util/VasEBoot-fstest.c (mount_crypt): New var. (fstest): Mount crypto if requested. (options): New option -C. (argp_parser): Parse -C. (main): Init and fini gcry. - * util/grub-install.in: Support cryptodisk install. - * util/grub-mkconfig.in: Export GRUB_ENABLE_CRYPTODISK. - * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Support + * util/VasEBoot-install.in: Support cryptodisk install. + * util/VasEBoot-mkconfig.in: Export VasEBoot_ENABLE_CRYPTODISK. + * util/VasEBoot-mkconfig_lib.in (is_path_readable_by_VasEBoot): Support cryptodisk. - (prepare_grub_to_access_device): Likewise. - * util/grub-mkpasswd-pbkdf2.c (main): Use grub_password_get. - * util/grub-probe.c (probe_partmap): Support cryptodisk UUID probe. + (prepare_VasEBoot_to_access_device): Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c (main): Use VasEBoot_password_get. + * util/VasEBoot-probe.c (probe_partmap): Support cryptodisk UUID probe. (probe_cryptodisk_uuid): New function. (probe_abstraction): Likewise. (probe): Use new functions. @@ -18572,49 +18572,49 @@ Lazy device scanning. - * Makefile.util.def (libgrubkern.a): Add grub-core/kern/emu/raid.c. - (grub-setup): Remove util/raid.c. - * grub-core/Makefile.core.def (kernel): Add kern/emu/raid.c on emu. - * grub-core/disk/lvm.c (scan_depth): New variable. - (grub_lvm_iterate): Rescan if necessary. - (find_lv): New function based on grub_lvm_open. - (grub_lvm_open): Use find_lv. Rescan on error. + * Makefile.util.def (libVasEBootkern.a): Add VasEBoot-core/kern/emu/raid.c. + (VasEBoot-setup): Remove util/raid.c. + * VasEBoot-core/Makefile.core.def (kernel): Add kern/emu/raid.c on emu. + * VasEBoot-core/disk/lvm.c (scan_depth): New variable. + (VasEBoot_lvm_iterate): Rescan if necessary. + (find_lv): New function based on VasEBoot_lvm_open. + (VasEBoot_lvm_open): Use find_lv. Rescan on error. (is_node_readable): New function. (is_lv_readable): Likewise. - (grub_lvm_scan_device): Skip already found disks. - (do_lvm_scan): New function. Move grub_lvm_scan_device inside of it. + (VasEBoot_lvm_scan_device): Skip already found disks. + (do_lvm_scan): New function. Move VasEBoot_lvm_scan_device inside of it. Stop if searched device is found and readable. - * grub-core/disk/raid.c (inscnt): New variable. + * VasEBoot-core/disk/raid.c (inscnt): New variable. (scan_depth): Likewise. - (scan_devices): New function based on grub_raid_register. Abort if + (scan_devices): New function based on VasEBoot_raid_register. Abort if looked for device is found. - (grub_raid_iterate): Rescan if needed. - (find_array): NEw function based on -grub_raid_open. - (grub_raid_open): Use find_array and rescan. + (VasEBoot_raid_iterate): Rescan if needed. + (find_array): NEw function based on -VasEBoot_raid_open. + (VasEBoot_raid_open): Use find_array and rescan. (insert_array): Set became_readable_at. - * grub-core/kern/disk.c (grub_disk_dev_iterate): Iterate though "pull. - * grub-core/kern/emu/getroot.c (grub_util_open_dm) [HAVE_DEVICE_MAPPER]: + * VasEBoot-core/kern/disk.c (VasEBoot_disk_dev_iterate): Iterate though "pull. + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_open_dm) [HAVE_DEVICE_MAPPER]: New function. - (grub_util_is_lvm) [HAVE_DEVICE_MAPPER]: Use grub_util_open_dm. - (grub_util_pull_device): New function. - (grub_util_get_grub_dev): Call grub_util_pull_device. + (VasEBoot_util_is_lvm) [HAVE_DEVICE_MAPPER]: Use VasEBoot_util_open_dm. + (VasEBoot_util_pull_device): New function. + (VasEBoot_util_get_VasEBoot_dev): Call VasEBoot_util_pull_device. * util/raid.c: Moved to .. - * grub-core/kern/emu/raid.c: ... here. - (grub_util_raid_getmembers): New parameter "bootable". + * VasEBoot-core/kern/emu/raid.c: ... here. + (VasEBoot_util_raid_getmembers): New parameter "bootable". All users updated. Support 1.x. - * include/grub/ata.h (grub_ata_dev): Change iterate prototype. + * include/VasEBoot/ata.h (VasEBoot_ata_dev): Change iterate prototype. All users updated. - * include/grub/disk.h (grub_disk_pull_t): New enum. - (grub_disk_dev): Change iterate prototype. + * include/VasEBoot/disk.h (VasEBoot_disk_pull_t): New enum. + (VasEBoot_disk_dev): Change iterate prototype. All users updated. - * include/grub/emu/getroot.h (grub_util_raid_getmembers) [__linux__]: + * include/VasEBoot/emu/getroot.h (VasEBoot_util_raid_getmembers) [__linux__]: New proto. - * include/grub/emu/hostdisk.h (grub_util_pull_device): Likewise. - * include/grub/lvm.h (grub_lvm_lv): New members fullname and compatname. - * include/grub/raid.h (grub_raid_array): New member became_readable_at. - * include/grub/scsi.h (grub_scsi_dev): Change iterate prototype. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_pull_device): Likewise. + * include/VasEBoot/lvm.h (VasEBoot_lvm_lv): New members fullname and compatname. + * include/VasEBoot/raid.h (VasEBoot_raid_array): New member became_readable_at. + * include/VasEBoot/scsi.h (VasEBoot_scsi_dev): Change iterate prototype. All users updated. - * include/grub/util/raid.h: Removed. + * include/VasEBoot/util/raid.h: Removed. 2011-07-06 Vladimir Serbinenko @@ -18624,224 +18624,224 @@ Unify sparc init with other ieee1275. - * grub-core/Makefile.core.def (kernel): Use kern/ieee1275/init.c + * VasEBoot-core/Makefile.core.def (kernel): Use kern/ieee1275/init.c instead of kern/sparc64/ieee1275/init.c. - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options) - [__sparc__]: Set GRUB_IEEE1275_FLAG_NO_PARTITION_0. - * grub-core/kern/ieee1275/init.c [__sparc__]: Include - grub/machine/kernel.h. - (grub_ieee1275_original_stack) [__sparc__]: New variable. - (grub_claim_heap) [__sparc__]: Use sparc version. - (grub_machine_init): Moved args parsing to - (grub_parse_cmdline): ...this. - * grub-core/kern/sparc64/ieee1275/init.c: Removed. - * include/grub/offsets.h (GRUB_KERNEL_SPARC64_IEEE1275_MOD_GAP): + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options) + [__sparc__]: Set VasEBoot_IEEE1275_FLAG_NO_PARTITION_0. + * VasEBoot-core/kern/ieee1275/init.c [__sparc__]: Include + VasEBoot/machine/kernel.h. + (VasEBoot_ieee1275_original_stack) [__sparc__]: New variable. + (VasEBoot_claim_heap) [__sparc__]: Use sparc version. + (VasEBoot_machine_init): Moved args parsing to + (VasEBoot_parse_cmdline): ...this. + * VasEBoot-core/kern/sparc64/ieee1275/init.c: Removed. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_GAP): New definition. - (GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN): Likewise. + (VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN): Likewise. Move BOOTP to separate file. - * grub-core/Makefile.core.def (net): Add net/bootp.c. - * grub-core/net/net.c: Move all BOOTP functions to - * grub-core/net/bootp.c: ... here. + * VasEBoot-core/Makefile.core.def (net): Add net/bootp.c. + * VasEBoot-core/net/net.c: Move all BOOTP functions to + * VasEBoot-core/net/bootp.c: ... here. Use frame interface on PXE. - * grub-core/Makefile.core.def (pxecmd): Removed. + * VasEBoot-core/Makefile.core.def (pxecmd): Removed. (pxe): Use net/drivers/i386/pc/pxe.c rather than net/i386/pc/pxe.c. - * grub-core/commands/i386/pc/pxecmd.c: Removed. - * grub-core/i386/pc/pxe.c: Moved from here ... - * grub-core/net/i386/pc/pxe.c: ... here. Rewritten. - * grub-core/net/net.c (grub_net_open_real): Handle old pxe syntax. - * include/grub/i386/pc/pxe.h (grub_pxe_unload): Removed. + * VasEBoot-core/commands/i386/pc/pxecmd.c: Removed. + * VasEBoot-core/i386/pc/pxe.c: Moved from here ... + * VasEBoot-core/net/i386/pc/pxe.c: ... here. Rewritten. + * VasEBoot-core/net/net.c (VasEBoot_net_open_real): Handle old pxe syntax. + * include/VasEBoot/i386/pc/pxe.h (VasEBoot_pxe_unload): Removed. EFI network support. - * grub-core/Makefile.core.def (efinet): New module. - * grub-core/disk/efi/efidisk.c (compare_device_paths): Moved from + * VasEBoot-core/Makefile.core.def (efinet): New module. + * VasEBoot-core/disk/efi/efidisk.c (compare_device_paths): Moved from here... - * grub-core/kern/efi/efi.c (grub_efi_compare_device_paths): ... here. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_compare_device_paths): ... here. All users updated. - * grub-core/kern/efi/init.c (grub_efi_net_config): New variable. - (grub_machine_get_bootlocation): Call grub_efi_net_config if needed. - * grub-core/kern/x86_64/efi/callwrap.S (efi_wrap_7): New function. - * grub-core/net/drivers/efi/efinet.c: New file. - * include/grub/efi/efi.h (grub_efi_compare_device_paths): New proto. - (grub_efi_net_config): New extern var. + * VasEBoot-core/kern/efi/init.c (VasEBoot_efi_net_config): New variable. + (VasEBoot_machine_get_bootlocation): Call VasEBoot_efi_net_config if needed. + * VasEBoot-core/kern/x86_64/efi/callwrap.S (efi_wrap_7): New function. + * VasEBoot-core/net/drivers/efi/efinet.c: New file. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_compare_device_paths): New proto. + (VasEBoot_efi_net_config): New extern var. Various cleanups and bugfixes. - * grub-core/disk/efi/efidisk.c (grub_efidisk_open): Fix off-by-one + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_open): Fix off-by-one error. - (grub_efidisk_get_device_name): Unify similar codepaths. Accept whole + (VasEBoot_efidisk_get_device_name): Unify similar codepaths. Accept whole disk declared as partition. - * grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_open): Fix memory + * VasEBoot-core/disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Fix memory leak on failure. - * grub-core/kern/dl.c (grub_dl_load_file): Fix memory leak. - * grub-core/kern/mm.c (grub_debug_malloc): Don't use unsupported %zx. - (grub_debug_zalloc): Likewise. - (grub_debug_realloc): Likewise. - (grub_debug_memalign): Likewise. - * grub-core/net/arp.c (grub_net_arp_receive): IPv4 is 4-byte wide. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_load_file): Fix memory leak. + * VasEBoot-core/kern/mm.c (VasEBoot_debug_malloc): Don't use unsupported %zx. + (VasEBoot_debug_zalloc): Likewise. + (VasEBoot_debug_realloc): Likewise. + (VasEBoot_debug_memalign): Likewise. + * VasEBoot-core/net/arp.c (VasEBoot_net_arp_receive): IPv4 is 4-byte wide. Check that target is IPv4. - * grub-core/net/drivers/ieee1275/ofnet.c (grub_ofnet_findcards): Use + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (VasEBoot_ofnet_findcards): Use local-mac-address as fallback. - * grub-core/net/ethernet.c (grub_net_recv_ethernet_packet): Prevent + * VasEBoot-core/net/ethernet.c (VasEBoot_net_recv_ethernet_packet): Prevent memory leak. - * grub-core/net/ip.c (ipchksum): Rename to ... - (grub_net_ip_chksum): ... this. All users updated. - (grub_net_recv_ip_packets): Special handling for DHCP. - * util/grub-mkimage.c (generate_image): Zero-out aout header. + * VasEBoot-core/net/ip.c (ipchksum): Rename to ... + (VasEBoot_net_ip_chksum): ... this. All users updated. + (VasEBoot_net_recv_ip_packets): Special handling for DHCP. + * util/VasEBoot-mkimage.c (generate_image): Zero-out aout header. Unify prefix handling - * grub-core/kern/efi/init.c (grub_efi_set_prefix): Revamped into ... - (grub_machine_get_bootlocation): ... this. - * grub-core/kern/emu/main.c (grub_machine_set_prefix): Revamped into ... - (grub_machine_get_bootlocation): ... this. - (grub_prefix): New variable. + * VasEBoot-core/kern/efi/init.c (VasEBoot_efi_set_prefix): Revamped into ... + (VasEBoot_machine_get_bootlocation): ... this. + * VasEBoot-core/kern/emu/main.c (VasEBoot_machine_set_prefix): Revamped into ... + (VasEBoot_machine_get_bootlocation): ... this. + (VasEBoot_prefix): New variable. (prefix): Removed. (root_dev): New variable. (dir): Likewise. (main): Use new variables. - * grub-core/kern/i386/coreboot/init.c (grub_machine_set_prefix): + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_machine_set_prefix): Revamped into ... - (grub_machine_get_bootlocation): ... this. - * grub-core/kern/i386/efi/init.c (grub_machine_set_prefix): Removed. - * grub-core/kern/i386/pc/init.c (make_install_device): Revamped into ... - (grub_machine_get_bootlocation): ... this. - (grub_machine_set_prefix): Removed. - * grub-core/kern/ia64/efi/init.c (grub_machine_set_prefix): Removed. - * grub-core/kern/ieee1275/init.c (grub_machine_set_prefix): + (VasEBoot_machine_get_bootlocation): ... this. + * VasEBoot-core/kern/i386/efi/init.c (VasEBoot_machine_set_prefix): Removed. + * VasEBoot-core/kern/i386/pc/init.c (make_install_device): Revamped into ... + (VasEBoot_machine_get_bootlocation): ... this. + (VasEBoot_machine_set_prefix): Removed. + * VasEBoot-core/kern/ia64/efi/init.c (VasEBoot_machine_set_prefix): Removed. + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_machine_set_prefix): Revamped into ... - (grub_machine_get_bootlocation): ... this. - * grub-core/kern/main.c (grub_set_root_dev): Revamped into ... - (grub_set_prefix_and_root): ... this. All users updated. - * grub-core/kern/mips/init.c (grub_machine_set_prefix): + (VasEBoot_machine_get_bootlocation): ... this. + * VasEBoot-core/kern/main.c (VasEBoot_set_root_dev): Revamped into ... + (VasEBoot_set_prefix_and_root): ... this. All users updated. + * VasEBoot-core/kern/mips/init.c (VasEBoot_machine_set_prefix): Revamped into ... - (grub_machine_get_bootlocation): ... this. - * include/grub/kernel.h (grub_machine_set_prefix): Removed. - (grub_machine_get_bootlocation): New proto. - * include/grub/i386/pc/kernel.h (grub_pc_net_config): New var. + (VasEBoot_machine_get_bootlocation): ... this. + * include/VasEBoot/kernel.h (VasEBoot_machine_set_prefix): Removed. + (VasEBoot_machine_get_bootlocation): New proto. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_pc_net_config): New var. Less intrusive and more reliable seek on network implementation. - * grub-core/kern/file.c (grub_file_net_seek): Removed. - (grub_file_seek): Don't call grub_file_net_seek. - * grub-core/net/net.c (grub_net_fs_read): Renamed to ... - (grub_net_fs_read_real): .. this. - (grub_net_seek_real): Use net->offset. - (grub_net_fs_read): Seek if necessary. + * VasEBoot-core/kern/file.c (VasEBoot_file_net_seek): Removed. + (VasEBoot_file_seek): Don't call VasEBoot_file_net_seek. + * VasEBoot-core/net/net.c (VasEBoot_net_fs_read): Renamed to ... + (VasEBoot_net_fs_read_real): .. this. + (VasEBoot_net_seek_real): Use net->offset. + (VasEBoot_net_fs_read): Seek if necessary. Unify IEEE1275 netwotk config with the other platforms. - * grub-core/kern/ieee1275/init.c (grub_ieee1275_net_config): + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_ieee1275_net_config): New variable. - (grub_machine_get_bootlocation): Support network. - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args): + (VasEBoot_machine_get_bootlocation): Support network. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_parse_args): Support type and device parsing. - (grub_ieee1275_get_device_type): New function. - * grub-core/net/drivers/ieee1275/ofnet.c (grub_getbootp_real): Revamped + (VasEBoot_ieee1275_get_device_type): New function. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (VasEBoot_getbootp_real): Revamped into ... - (grub_ieee1275_net_config_real): ... this. - (grub_ofnet_probecards): Removed. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Remove ofnet.h. - * include/grub/ieee1275/ofnet.h: Removed. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_net_config): NEw + (VasEBoot_ieee1275_net_config_real): ... this. + (VasEBoot_ofnet_probecards): Removed. + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Remove ofnet.h. + * include/VasEBoot/ieee1275/ofnet.h: Removed. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_net_config): NEw extern var. - (grub_ieee1275_get_device_type): New function. + (VasEBoot_ieee1275_get_device_type): New function. Unify network device closing across platforms and make more robust. - * grub-core/kern/ieee1275/init.c (grub_machine_fini): Don't call - grub_grubnet_fini. - * grub-core/net/ethernet.c (send_ethernet_packet): Open card if it isn't + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_machine_fini): Don't call + VasEBoot_VasEBootnet_fini. + * VasEBoot-core/net/ethernet.c (send_ethernet_packet): Open card if it isn't already. - * grub-core/net/net.c (grub_net_network_level_interface_register): + * VasEBoot-core/net/net.c (VasEBoot_net_network_level_interface_register): Update num_ifaces. - (grub_net_card_unregister): Close all interfaces. + (VasEBoot_net_card_unregister): Close all interfaces. (receive_packets): Don't poll if no iterfaces are registered. Open if necessary. - (grub_net_fini_hw): New function. - (grub_net_restore_hw): Likewise. + (VasEBoot_net_fini_hw): New function. + (VasEBoot_net_restore_hw): Likewise. (fini_hnd): New variable. - (GRUB_MOD_INIT): Register preboot hook. - (GRUB_MOD_FINI): Run and unregister preboot hook. + (VasEBoot_MOD_INIT): Register preboot hook. + (VasEBoot_MOD_FINI): Run and unregister preboot hook. Poll network cards when idle. - * grub-core/kern/term.c (grub_net_poll_cards_idle): New variable. - (grub_checkkey): Call grub_net_poll_cards_idle if it's not NULL. - * grub-core/net/net.c (receive_packets): Save last poll time. - (grub_net_poll_cards_idle_real): New function. - (GRUB_MOD_INIT): Register grub_net_poll_cards_idle. - (GRUB_MOD_FINI): Unregister grub_net_poll_cards_idle. - * include/grub/kernel.h (grub_poll_cards_idle): New extern variable. + * VasEBoot-core/kern/term.c (VasEBoot_net_poll_cards_idle): New variable. + (VasEBoot_checkkey): Call VasEBoot_net_poll_cards_idle if it's not NULL. + * VasEBoot-core/net/net.c (receive_packets): Save last poll time. + (VasEBoot_net_poll_cards_idle_real): New function. + (VasEBoot_MOD_INIT): Register VasEBoot_net_poll_cards_idle. + (VasEBoot_MOD_FINI): Unregister VasEBoot_net_poll_cards_idle. + * include/VasEBoot/kernel.h (VasEBoot_poll_cards_idle): New extern variable. Rename ofnet interfaces. - * grub-core/net/drivers/ieee1275/ofnet.c (find_alias): New function. - (grub_ofnet_findcards): Use ofnet_%s names. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (find_alias): New function. + (VasEBoot_ofnet_findcards): Use ofnet_%s names. - * util/grub-mknetdir.in: Support for EFI and IEEE1275. + * util/VasEBoot-mknetdir.in: Support for EFI and IEEE1275. Cleanup socket opening. - * grub-core/net/net.c (grub_net_fs_open): Rewritten. - (grub_net_fs_close): Likewise. - (grub_net_fs_read_real): Use eof member. - * include/grub/net/udp.h (+grub_net_udp_open): New proto. - (+grub_net_udp_close): New inline function. + * VasEBoot-core/net/net.c (VasEBoot_net_fs_open): Rewritten. + (VasEBoot_net_fs_close): Likewise. + (VasEBoot_net_fs_read_real): Use eof member. + * include/VasEBoot/net/udp.h (+VasEBoot_net_udp_open): New proto. + (+VasEBoot_net_udp_close): New inline function. - * include/grub/net/tftp.h: Moved to the top of ... - * grub-core/net/tftp.c: ... here. - * include/grub/net/ip.h: Moved mostly to the top of ... - * grub-core/net/ip.c: ... here. - * include/grub/net/ethernet.h: Moved mostly to the top of ... - * grub-core/net/ethernet.c: ... here. + * include/VasEBoot/net/tftp.h: Moved to the top of ... + * VasEBoot-core/net/tftp.c: ... here. + * include/VasEBoot/net/ip.h: Moved mostly to the top of ... + * VasEBoot-core/net/ip.c: ... here. + * include/VasEBoot/net/ethernet.h: Moved mostly to the top of ... + * VasEBoot-core/net/ethernet.c: ... here. - * grub-core/kern/device.c (grub_device_close): Free device->net->server. + * VasEBoot-core/kern/device.c (VasEBoot_device_close): Free device->net->server. - * grub-core/commands/probe.c (grub_cmd_probe): Use protocol name for + * VasEBoot-core/commands/probe.c (VasEBoot_cmd_probe): Use protocol name for FS name. - * include/grub/net/ip.h (ipv4_ini): Removed. + * include/VasEBoot/net/ip.h (ipv4_ini): Removed. (ipv4_fini): Likewise. - * include/grub/net/ip.h (grub_net_recv_ip_packets): New proto. - (grub_net_send_ip_packets): Likewise. + * include/VasEBoot/net/ip.h (VasEBoot_net_recv_ip_packets): New proto. + (VasEBoot_net_send_ip_packets): Likewise. 2011-07-05 Vladimir Serbinenko - * grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_init): Use new - grub_read_cmos prototype. + * VasEBoot-core/kern/i386/qemu/mmap.c (VasEBoot_machine_mmap_init): Use new + VasEBoot_read_cmos prototype. 2011-07-05 Vladimir Serbinenko VGA text support in qemu-mips - * grub-core/Makefile.core.def (kernel): Add term/i386/pc/vga_text.c, + * VasEBoot-core/Makefile.core.def (kernel): Add term/i386/pc/vga_text.c, term/i386/vga_common.c and kern/vga_init.c on qemu-mips. - * grub-core/kern/mips/qemu_mips/init.c (grub_machine_init): Init vga + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_machine_init): Init vga text. - * grub-core/kern/i386/qemu/init.c: Renamed to ... - * grub-core/kern/vga_init.c: ... this. - * grub-core/kern/vga_init.c (VGA_ADDR) [__mips__]: Adjust. - (grub_qemu_init_cirrus) [__mips__]: Skip PCI and adjust the I/O base. - * grub-core/term/i386/pc/vga_text.c (VGA_TEXT_SCREEN) [__mips__]: + * VasEBoot-core/kern/i386/qemu/init.c: Renamed to ... + * VasEBoot-core/kern/vga_init.c: ... this. + * VasEBoot-core/kern/vga_init.c (VGA_ADDR) [__mips__]: Adjust. + (VasEBoot_qemu_init_cirrus) [__mips__]: Skip PCI and adjust the I/O base. + * VasEBoot-core/term/i386/pc/vga_text.c (VGA_TEXT_SCREEN) [__mips__]: Adjust. - * include/grub/vga.h [GRUB_MACHINE_MIPS_QEMU_MIPS]: Declare - GRUB_MACHINE_PCI_IO_BASE. + * include/VasEBoot/vga.h [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Declare + VasEBoot_MACHINE_PCI_IO_BASE. 2011-07-05 Vladimir Serbinenko MIPS qemu flash support. - * grub-core/boot/mips/startup_raw.S [GRUB_MACHINE_MIPS_QEMU_MIPS]: Check + * VasEBoot-core/boot/mips/startup_raw.S [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Check magic. - * grub-core/kern/mips/qemu_mips/init.c (probe_mem): New function. - (grub_machine_init): Probe memory if its size isn't known. - * util/grub-mkimage.c (image_targets): Add flash targets. + * VasEBoot-core/kern/mips/qemu_mips/init.c (probe_mem): New function. + (VasEBoot_machine_init): Probe memory if its size isn't known. + * util/VasEBoot-mkimage.c (image_targets): Add flash targets. (generate_image): Handle flash targets. 2011-07-05 Vladimir Serbinenko @@ -18849,156 +18849,156 @@ MIPS qemu at_keyboard support. * gentpl.py (videoinkernel): Add qemu-mips. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Add necessary headers. - * grub-core/Makefile.core.def (kernel): Add at_keyboard and layout. - * grub-core/kern/mips/qemu_mips/init.c (grub_machine_init): Init new + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Add necessary headers. + * VasEBoot-core/Makefile.core.def (kernel): Add at_keyboard and layout. + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_machine_init): Init new modules. - * grub-core/term/at_keyboard.c (grub_keyboard_controller_init) - [GRUB_MACHINE_MIPS_QEMU_MIPS]: Don't consider original set. - * grub-core/term/serial.c (grub_serial_register) - [GRUB_MACHINE_MIPS_QEMU_MIPS]: Make com0 explicitly active. + * VasEBoot-core/term/at_keyboard.c (VasEBoot_keyboard_controller_init) + [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Don't consider original set. + * VasEBoot-core/term/serial.c (VasEBoot_serial_register) + [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Make com0 explicitly active. 2011-07-05 Vladimir Serbinenko CMOS support on sparc. * gentpl.py (cmos): Add powerpc and sparc. - * grub-core/Makefile.core.def (datetime): Add lib/ieee1275/cmos.c on + * VasEBoot-core/Makefile.core.def (datetime): Add lib/ieee1275/cmos.c on powerpc and sparc. - * grub-core/lib/cmos_datetime.c (grub_get_datetime) - [__powerpc__ || __sparc__]: Rename to grub_get_datetime_cmos. - (grub_set_datetime) [__powerpc__ || __sparc__]: Likewise to - grub_set_datetime_cmos. - * grub-core/lib/ieee1275/cmos.c: New file. - * grub-core/lib/ieee1275/datetime.c (no_ieee1275_rtc): New vaiable. + * VasEBoot-core/lib/cmos_datetime.c (VasEBoot_get_datetime) + [__powerpc__ || __sparc__]: Rename to VasEBoot_get_datetime_cmos. + (VasEBoot_set_datetime) [__powerpc__ || __sparc__]: Likewise to + VasEBoot_set_datetime_cmos. + * VasEBoot-core/lib/ieee1275/cmos.c: New file. + * VasEBoot-core/lib/ieee1275/datetime.c (no_ieee1275_rtc): New vaiable. (find_rtc): Set no_ieee1275_rtc on error. - (grub_get_datetime): Call grub_get_datetime_cmos on error. - (grub_set_datetime): Call grub_set_datetime_cmos on error. - * include/grub/cmos.h (grub_cmos_read): Return grub_err_t since it may + (VasEBoot_get_datetime): Call VasEBoot_get_datetime_cmos on error. + (VasEBoot_set_datetime): Call VasEBoot_set_datetime_cmos on error. + * include/VasEBoot/cmos.h (VasEBoot_cmos_read): Return VasEBoot_err_t since it may fail. Move value to argument. All users updated - (grub_cmos_write): Likewise. - (grub_cmos_read) [__powerpc__ || __sparc__]: Rewritten. - (grub_cmos_write) [__powerpc__ || __sparc__]: Likewise. - * include/grub/datetime.h [__powerpc__ || __sparc__]: Declare - grub_get_datetime_cmos and grub_set_datetime_cmos. + (VasEBoot_cmos_write): Likewise. + (VasEBoot_cmos_read) [__powerpc__ || __sparc__]: Rewritten. + (VasEBoot_cmos_write) [__powerpc__ || __sparc__]: Likewise. + * include/VasEBoot/datetime.h [__powerpc__ || __sparc__]: Declare + VasEBoot_get_datetime_cmos and VasEBoot_set_datetime_cmos. 2011-07-02 Grégoire Sutre - * util/grub-mkconfig.in: Use @PACKAGE@ instead of hardcoded name when - sourcing grub-mkconfig_lib. - * util/update-grub_lib.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. + * util/VasEBoot-mkconfig.in: Use @PACKAGE@ instead of hardcoded name when + sourcing VasEBoot-mkconfig_lib. + * util/update-VasEBoot_lib.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. 2011-06-28 Colin Watson - * grub-core/term/gfxterm.c (grub_virtual_screen_setup): Use + * VasEBoot-core/term/gfxterm.c (VasEBoot_virtual_screen_setup): Use default_bg_color rather than black. - (grub_gfxterm_fullscreen): Likewise. - (grub_gfxterm_background_color_cmd): Save new background color in + (VasEBoot_gfxterm_fullscreen): Likewise. + (VasEBoot_gfxterm_background_color_cmd): Save new background color in default_bg_color. 2011-06-27 Vladimir Serbinenko - * grub-core/Makefile.core.def (chain): Fix coreboot filename. + * VasEBoot-core/Makefile.core.def (chain): Fix coreboot filename. 2011-06-27 Vladimir Serbinenko - * grub-core/disk/pata.c (grub_pata_initialize) [QEMU_MIPS]: Fix a + * VasEBoot-core/disk/pata.c (VasEBoot_pata_initialize) [QEMU_MIPS]: Fix a mismerge. 2011-06-27 Vladimir Serbinenko Chainloading on coreboot support. - * grub-core/Makefile.core.def (chain): Add coreboot. - * grub-core/loader/i386/coreboot/chainloader.c: New file. + * VasEBoot-core/Makefile.core.def (chain): Add coreboot. + * VasEBoot-core/loader/i386/coreboot/chainloader.c: New file. 2011-06-27 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c (grub_bsd_load): Handle relocator failure + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_bsd_load): Handle relocator failure if it happens. 2011-06-27 Vladimir Serbinenko Implement time command. - * grub-core/Makefile.core.def (time): New module. - * grub-core/commands/time.c: New file. - * grub-core/script/parser.y: Remove "time" keyword. - * grub-core/script/yylex.l: Likewise. + * VasEBoot-core/Makefile.core.def (time): New module. + * VasEBoot-core/commands/time.c: New file. + * VasEBoot-core/script/parser.y: Remove "time" keyword. + * VasEBoot-core/script/yylex.l: Likewise. 2011-06-27 Vladimir Serbinenko - * include/grub/loader.h (grub_loader_unregister_preboot_hook): Export. + * include/VasEBoot/loader.h (VasEBoot_loader_unregister_preboot_hook): Export. 2011-06-27 Vladimir Serbinenko - * grub-core/lib/relocator.c (malloc_in_range): Fix a memory corruption + * VasEBoot-core/lib/relocator.c (malloc_in_range): Fix a memory corruption when handling leftovers. 2011-06-27 Vladimir Serbinenko - * util/ieee1275/grub-ofpathname.c (main): Handle --help and --version + * util/ieee1275/VasEBoot-ofpathname.c (main): Handle --help and --version so that help2man doesn't fail. 2011-06-27 Vladimir Serbinenko - * grub-core/net/drivers/ieee1275/ofnet.c (send_card_buffer) Use right + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (send_card_buffer) Use right type in pointers on sparc64. (get_card_packet): Likewise. 2011-06-27 Colin Watson - * grub-core/commands/videoinfo.c (hook): Indicate current video mode + * VasEBoot-core/commands/videoinfo.c (hook): Indicate current video mode with `*'. - (grub_cmd_videoinfo): Fetch current video mode. + (VasEBoot_cmd_videoinfo): Fetch current video mode. 2011-06-27 Vladimir Serbinenko - * grub-core/disk/scsi.c (grub_scsi_read): Limit SCSI reads to 32K + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_read): Limit SCSI reads to 32K because of underlying system restrictions. 2011-06-27 Vladimir Serbinenko - * util/grub-mkrescue.in: Rename "ata" to "pata" and add ahci when + * util/VasEBoot-mkrescue.in: Rename "ata" to "pata" and add ahci when necessary. 2011-06-27 Vladimir Serbinenko Coreboot video support. - * grub-core/Makefile.core.def (vga): Extend to coreboot and multiboot. + * VasEBoot-core/Makefile.core.def (vga): Extend to coreboot and multiboot. (vbe): Likewise. - * grub-core/kern/i386/coreboot/startup.S: Include int.S. - * grub-core/kern/i386/pc/startup.S (grub_bios_interrupt): Moved from + * VasEBoot-core/kern/i386/coreboot/startup.S: Include int.S. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_bios_interrupt): Moved from here ... - * grub-core/kern/i386/int.S: ... here. - * grub-core/video/i386/pc/vbe.c: Updated includes. - * grub-core/video/i386/pc/vga.c: Likewise. - * include/grub/i386/coreboot/memory.h - (GRUB_MEMORY_MACHINE_SCRATCH_ADDR): New definition. - (GRUB_MEMORY_MACHINE_SCRATCH_SEG): Likewise. - (GRUB_MEMORY_MACHINE_SCRATCH_SIZE): Likewise. - * include/grub/i386/pc/int.h (GRUB_CPU_INT_FLAGS_DEFAULT) [!PCBIOS]: + * VasEBoot-core/kern/i386/int.S: ... here. + * VasEBoot-core/video/i386/pc/vbe.c: Updated includes. + * VasEBoot-core/video/i386/pc/vga.c: Likewise. + * include/VasEBoot/i386/coreboot/memory.h + (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR): New definition. + (VasEBoot_MEMORY_MACHINE_SCRATCH_SEG): Likewise. + (VasEBoot_MEMORY_MACHINE_SCRATCH_SIZE): Likewise. + * include/VasEBoot/i386/pc/int.h (VasEBoot_CPU_INT_FLAGS_DEFAULT) [!PCBIOS]: Disable interrupts. - * include/grub/i386/pc/vga.h: Removed. All users updated. + * include/VasEBoot/i386/pc/vga.h: Removed. All users updated. 2011-06-27 Vladimir Serbinenko - * grub-core/disk/ahci.c (grub_ahci_readwrite_real): Use proper + * VasEBoot-core/disk/ahci.c (VasEBoot_ahci_readwrite_real): Use proper definitions for dprintf. - * grub-core/disk/pata.c (grub_pata_readwrite): Likewise. + * VasEBoot-core/disk/pata.c (VasEBoot_pata_readwrite): Likewise. 2011-06-27 Vladimir Serbinenko - * grub-core/net/drivers/ieee1275/ofnet.c (send_card_buffer): Fix + * VasEBoot-core/net/drivers/ieee1275/ofnet.c (send_card_buffer): Fix prototype. (get_card_packet): Likewise. @@ -19006,44 +19006,44 @@ Display the path of the file when file is not found - * grub-core/fs/fat.c: Display the filename when file is not found. - * grub-core/fs/fshelp.c: Likewise. - * grub-core/fs/hfs.c: Likewise. - * grub-core/fs/jfs.c: Likewise. - * grub-core/fs/minix.c: Likewise. - * grub-core/fs/ufs.c: Likewise. - * grub-core/fs/btrfs.c: Likewise. - * grub-core/commands/i386/pc/play.c: Likewise. + * VasEBoot-core/fs/fat.c: Display the filename when file is not found. + * VasEBoot-core/fs/fshelp.c: Likewise. + * VasEBoot-core/fs/hfs.c: Likewise. + * VasEBoot-core/fs/jfs.c: Likewise. + * VasEBoot-core/fs/minix.c: Likewise. + * VasEBoot-core/fs/ufs.c: Likewise. + * VasEBoot-core/fs/btrfs.c: Likewise. + * VasEBoot-core/commands/i386/pc/play.c: Likewise. 2011-06-26 Szymon Janc - * grub-core/commands/cmp.c (grub_cmd_cmp): Remove unnecessary NULL - pointer checks before calling grub_free(). - * grub-core/commands/wildcard.c (match_devices): Likewise. - * grub-core/commands/wildcard.c (match_files): Likewise. - * grub-core/fs/cpio.c (grub_cpio_dir): Likewise. - * grub-core/fs/cpio.c (grub_cpio_open): Likewise. - * grub-core/fs/udf.c (grub_udf_read_block): Likewise. - * grub-core/fs/xfs.c (grub_xfs_read_block): Likewise. - * grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Likewise. - * grub-core/normal/cmdline.c (grub_cmdline_get): Likewise. - * grub-core/script/yylex.l (grub_lexer_unput): Likewise. - * grub-core/video/readers/jpeg.c (grub_video_reader_jpeg): Likewise. - * grub-core/video/readers/png.c (grub_png_output_byte): Likewise. + * VasEBoot-core/commands/cmp.c (VasEBoot_cmd_cmp): Remove unnecessary NULL + pointer checks before calling VasEBoot_free(). + * VasEBoot-core/commands/wildcard.c (match_devices): Likewise. + * VasEBoot-core/commands/wildcard.c (match_files): Likewise. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_dir): Likewise. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_open): Likewise. + * VasEBoot-core/fs/udf.c (VasEBoot_udf_read_block): Likewise. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_read_block): Likewise. + * VasEBoot-core/loader/efi/chainloader.c (VasEBoot_cmd_chainloader): Likewise. + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Likewise. + * VasEBoot-core/script/yylex.l (VasEBoot_lexer_unput): Likewise. + * VasEBoot-core/video/readers/jpeg.c (VasEBoot_video_reader_jpeg): Likewise. + * VasEBoot-core/video/readers/png.c (VasEBoot_png_output_byte): Likewise. 2011-06-25 Patrick - * grub-core/kern/main.c (grub_load_normal_mode): Correct the comment. + * VasEBoot-core/kern/main.c (VasEBoot_load_normal_mode): Correct the comment. 2011-06-25 Vladimir Serbinenko - * grub-core/net/i386/pc/pxe.c (grub_pxe_recv): Fix declaration. - (grub_pxe_send): Likewise. - (GRUB_MOD_INIT): Fix types. + * VasEBoot-core/net/i386/pc/pxe.c (VasEBoot_pxe_recv): Fix declaration. + (VasEBoot_pxe_send): Likewise. + (VasEBoot_MOD_INIT): Fix types. 2011-06-24 Szymon Janc - * grub-core/io/xzio.c: Fix code style issues + * VasEBoot-core/io/xzio.c: Fix code style issues 2011-06-24 Vladimir Serbinenko 2011-06-24 Manoel Rebelo Abranches @@ -19051,86 +19051,86 @@ Network infrastructure. The ARP protocol was made by Paulo Pinatti - * include/grub/net/arp.h: New file. - * include/grub/net/device.h: Likewise. - * include/grub/net/ethernet.h: Likewise. - * include/grub/net/ip.h: Likewise. - * include/grub/net/netbuff.h: Likewise. - * include/grub/net/tftp.h: Likewise. - * include/grub/net/udp.h: Likewise. - * include/grub/ieee1275/ofnet.h: Likewise. - * include/grub/emu/export.h: Likewise. - * include/grub/net.h: Likewise. - * grub-core/net/arp.c: Likewise. - * grub-core/net/ethernet.c: Likewise. - * grub-core/net/ip.c: Likewise. - * grub-core/net/udp.c: Likewise. - * grub-core/net/tftp.c: Likewise. - * grub-core/net/netbuff.c: Likewise. - * grub-core/net/net.c: Likewise. - * grub-core/net/drivers/emu/emunet.c: Likewise. - * grub-core/net/drivers/ieee1275/ofnet.c: Likewise. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Add net.h, ofnet.h and + * include/VasEBoot/net/arp.h: New file. + * include/VasEBoot/net/device.h: Likewise. + * include/VasEBoot/net/ethernet.h: Likewise. + * include/VasEBoot/net/ip.h: Likewise. + * include/VasEBoot/net/netbuff.h: Likewise. + * include/VasEBoot/net/tftp.h: Likewise. + * include/VasEBoot/net/udp.h: Likewise. + * include/VasEBoot/ieee1275/ofnet.h: Likewise. + * include/VasEBoot/emu/export.h: Likewise. + * include/VasEBoot/net.h: Likewise. + * VasEBoot-core/net/arp.c: Likewise. + * VasEBoot-core/net/ethernet.c: Likewise. + * VasEBoot-core/net/ip.c: Likewise. + * VasEBoot-core/net/udp.c: Likewise. + * VasEBoot-core/net/tftp.c: Likewise. + * VasEBoot-core/net/netbuff.c: Likewise. + * VasEBoot-core/net/net.c: Likewise. + * VasEBoot-core/net/drivers/emu/emunet.c: Likewise. + * VasEBoot-core/net/drivers/ieee1275/ofnet.c: Likewise. + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Add net.h, ofnet.h and export.h. - * grub-core/Makefile.core.def (net): New module. + * VasEBoot-core/Makefile.core.def (net): New module. (tftp): Likewise. (ofnet): Likewise. (emunet): Likewise. - * grub-core/commands/ls.c (grub_ls_list_devices) [!GRUB_UTIL]: List + * VasEBoot-core/commands/ls.c (VasEBoot_ls_list_devices) [!VasEBoot_UTIL]: List network protocols. - * grub-core/kern/device.c (grub_net_open) : New variable. - (grub_device_open): Handle network device. - (grub_device_close): Likewise. - * grub-core/kern/file.c (grub_file_net_seek) : New variable. - (grub_grubnet_fini): Likewise. - (grub_file_seek): Seek in network device. - * grub-core/kern/fs.c (grub_fs_probe): Handle network devices. - * grub-core/kern/ieee1275/init.c (grub_machine_set_prefix): Handle + * VasEBoot-core/kern/device.c (VasEBoot_net_open) : New variable. + (VasEBoot_device_open): Handle network device. + (VasEBoot_device_close): Likewise. + * VasEBoot-core/kern/file.c (VasEBoot_file_net_seek) : New variable. + (VasEBoot_VasEBootnet_fini): Likewise. + (VasEBoot_file_seek): Seek in network device. + * VasEBoot-core/kern/fs.c (VasEBoot_fs_probe): Handle network devices. + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_machine_set_prefix): Handle network root. - (grub_machine_fini): Call grub_grubnet_fini. - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args): Handle + (VasEBoot_machine_fini): Call VasEBoot_VasEBootnet_fini. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_parse_args): Handle network. - (grub_ieee1275_get_aliasdevname): New function. - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_get_mbi_size): + (VasEBoot_ieee1275_get_aliasdevname): New function. + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_get_mbi_size): Add unofficial Solaris network info. - (grub_multiboot_make_mbi): Likewise. - * grub-core/fs/i386/pc/pxe.c: Moved from here ... - * grub-core/net/i386/pc/pxe.c: ...here. Adapted for new design. - * include/grub/device.h (grub_fs): Removed. - * include/grub/err.h (grub_err_t): Add network-related values. - * include/grub/i386/pc/pxe.h: Removed bootp parts. - * include/grub/ieee1275/ieee1275.h (grub_ofnetcard_data): New struct. - (grub_ieee1275_get_aliasdevname): New proto. - * include/grub/net.h: Rewritten. + (VasEBoot_multiboot_make_mbi): Likewise. + * VasEBoot-core/fs/i386/pc/pxe.c: Moved from here ... + * VasEBoot-core/net/i386/pc/pxe.c: ...here. Adapted for new design. + * include/VasEBoot/device.h (VasEBoot_fs): Removed. + * include/VasEBoot/err.h (VasEBoot_err_t): Add network-related values. + * include/VasEBoot/i386/pc/pxe.h: Removed bootp parts. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ofnetcard_data): New struct. + (VasEBoot_ieee1275_get_aliasdevname): New proto. + * include/VasEBoot/net.h: Rewritten. 2011-06-24 Vladimir Serbinenko - * grub-core/disk/raid.c (insert_array): Ensure uniqueness of readable + * VasEBoot-core/disk/raid.c (insert_array): Ensure uniqueness of readable names. 2011-06-24 Vladimir Serbinenko - * grub-core/commands/wildcard.c (match_files): Add a useful dprintf. + * VasEBoot-core/commands/wildcard.c (match_files): Add a useful dprintf. (wildcard_expand): Don't stop on nonregexp parts after regexp ones since it truncates the output. Reported by: Ximin Luo. 2011-06-24 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Skip . and .. + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Skip . and .. 2011-06-24 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Load partmap before abstraction. 2011-06-24 Alexander Kurtz - * util/grub-mkconfig_lib.in: Add missing quotes. + * util/VasEBoot-mkconfig_lib.in: Add missing quotes. 2011-06-24 Vladimir Serbinenko - * grub-core/kern/emu/getroot.c (grub_guess_root_device): Revert to + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_guess_root_device): Revert to old method if mountinfo would return /dev/root and /dev/root doesn't exist. @@ -19138,62 +19138,62 @@ ZFS zlib support - * grub-core/fs/zfs/zfs.c (zlib_decompress): New function. + * VasEBoot-core/fs/zfs/zfs.c (zlib_decompress): New function. (decomp_table): Add zlib entries. (zio_read): USe 8 bits for compression function rather than 3. - * include/grub/zfs/zio.h (zio_compress): Add zlib values. + * include/VasEBoot/zfs/zio.h (zio_compress): Add zlib values. 2011-06-24 Vladimir Serbinenko - * grub-core/disk/ahci.c: Add missing license statements. - * grub-core/fs/romfs.c: Likewise. - * grub-core/lib/ia64/setjmp.S: Likewise. - * grub-core/loader/i386/pc/freedos.c: Likewise. - * grub-core/loader/ia64/efi/linux.c: Likewise. - * grub-core/video/colors.c: Likewise. - * include/grub/dl.h (GRUB_MOD_DEP): New macro. + * VasEBoot-core/disk/ahci.c: Add missing license statements. + * VasEBoot-core/fs/romfs.c: Likewise. + * VasEBoot-core/lib/ia64/setjmp.S: Likewise. + * VasEBoot-core/loader/i386/pc/freedos.c: Likewise. + * VasEBoot-core/loader/ia64/efi/linux.c: Likewise. + * VasEBoot-core/video/colors.c: Likewise. + * include/VasEBoot/dl.h (VasEBoot_MOD_DEP): New macro. 2011-06-23 Vladimir Serbinenko AHCI support. - * grub-core/Makefile.core.def (ata_pthru): Removed. + * VasEBoot-core/Makefile.core.def (ata_pthru): Removed. (ahci): New module. (pata): Likewise. - * grub-core/bus/usb/ohci.c (GRUB_MOD_FINI): Unregister preboot hook + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_MOD_FINI): Unregister preboot hook on unload. - * grub-core/commands/hdparm.c (grub_hdparm_do_ata_cmd): Use ATA + * VasEBoot-core/commands/hdparm.c (VasEBoot_hdparm_do_ata_cmd): Use ATA readwrite. - (grub_hdparm_do_check_powermode_cmd): Likewise. - (grub_hdparm_do_smart_cmd): Likewise. - (grub_hdparm_set_val_cmd): Likewise. - (grub_cmd_hdparm): Likewise. Check thta we have an ATA device. - * grub-core/disk/ahci.c: New file. - * grub-core/disk/ata.c: Factor out the low-level part into ... - * grub-core/disk/pata.c: ... here. - * grub-core/disk/ata_pthru.c: Contents moved to ... - * grub-core/disk/pata.c: ... here. - * grub-core/disk/scsi.c (grub_scsi_names): New array. - (grub_scsi_iterate): Use grub_scsi_names. - (grub_scsi_open): Likewise. - * grub-core/kern/disk.c (grub_disk_ata_pass_through): Removed. - * include/grub/ata.h (grub_ata_commands): Add DMA commands. - (grub_ata_regs_t): New struct. - (grub_disk_ata_pass_through_parms): Likewise. - (grub_ata_device): Renamed to ... - (grub_ata): ... this. - (grub_ata_dev): New struct. + (VasEBoot_hdparm_do_check_powermode_cmd): Likewise. + (VasEBoot_hdparm_do_smart_cmd): Likewise. + (VasEBoot_hdparm_set_val_cmd): Likewise. + (VasEBoot_cmd_hdparm): Likewise. Check thta we have an ATA device. + * VasEBoot-core/disk/ahci.c: New file. + * VasEBoot-core/disk/ata.c: Factor out the low-level part into ... + * VasEBoot-core/disk/pata.c: ... here. + * VasEBoot-core/disk/ata_pthru.c: Contents moved to ... + * VasEBoot-core/disk/pata.c: ... here. + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_names): New array. + (VasEBoot_scsi_iterate): Use VasEBoot_scsi_names. + (VasEBoot_scsi_open): Likewise. + * VasEBoot-core/kern/disk.c (VasEBoot_disk_ata_pass_through): Removed. + * include/VasEBoot/ata.h (VasEBoot_ata_commands): Add DMA commands. + (VasEBoot_ata_regs_t): New struct. + (VasEBoot_disk_ata_pass_through_parms): Likewise. + (VasEBoot_ata_device): Renamed to ... + (VasEBoot_ata): ... this. + (VasEBoot_ata_dev): New struct. Removed all low-level inline functions. - * include/grub/scsi.h: Add PATA and AHCI subsystems. - (grub_scsi_dev): Removed 'name' and 'id'. Added 'id' parameter to + * include/VasEBoot/scsi.h: Add PATA and AHCI subsystems. + (VasEBoot_scsi_dev): Removed 'name' and 'id'. Added 'id' parameter to iterate hooks and open. All users updated. - * util/grub-install.in: Handle AHCI disk module. + * util/VasEBoot-install.in: Handle AHCI disk module. 2011-06-23 Szymon Janc Add support for DRI and RSTn markers in JPEG files. - * grub-core/video/readers/jpeg.c (JPEG_MARKER_DRI): New define. + * VasEBoot-core/video/readers/jpeg.c (JPEG_MARKER_DRI): New define. (JPEG_MARKER_RST0): Likewise. (JPEG_MARKER_RST1): Likewise. (JPEG_MARKER_RST2): Likewise. @@ -19202,13 +19202,13 @@ (JPEG_MARKER_RST5): Likewise. (JPEG_MARKER_RST6): Likewise. (JPEG_MARKER_RST7): Likewise. - (grub_jpeg_data): New fields dri, r1, bitmap_ptr. - (grub_jpeg_decode_dri): New function. - (grub_jpeg_decode_sos): Move image data related part into - grub_jpeg_decode_data function. - (grub_jpeg_decode_data): New function. - (grub_jpeg_reset): New function. - (grub_jpeg_decode_jpeg): Handle new markers. + (VasEBoot_jpeg_data): New fields dri, r1, bitmap_ptr. + (VasEBoot_jpeg_decode_dri): New function. + (VasEBoot_jpeg_decode_sos): Move image data related part into + VasEBoot_jpeg_decode_data function. + (VasEBoot_jpeg_decode_data): New function. + (VasEBoot_jpeg_reset): New function. + (VasEBoot_jpeg_decode_jpeg): Handle new markers. 2011-06-23 Vladimir Serbinenko @@ -19218,102 +19218,102 @@ 2011-06-23 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c (main): Don't double-close. + * util/VasEBoot-mkpasswd-pbkdf2.c (main): Don't double-close. Reported by: David Volgyes . 2011-06-23 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): Close + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_is_floppy): Close file after stat. Reported by: David Volgyes . 2011-06-23 Vladimir Serbinenko - * util/raid.c (grub_util_raid_getmembers): Close fd before returning. + * util/raid.c (VasEBoot_util_raid_getmembers): Close fd before returning. Reported by: David Volgyes . 2011-06-23 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (rs_recover) [STANDALONE]: + * VasEBoot-core/lib/reed_solomon.c (rs_recover) [STANDALONE]: Prevent memory leak. 2011-06-23 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (rs_recover): Prevent memory leak. + * VasEBoot-core/lib/reed_solomon.c (rs_recover): Prevent memory leak. (main): Close file. Reported by: David Volgyes . 2011-06-23 Vladimir Serbinenko - * grub-core/loader/i386/xnu.c (grub_cpu_xnu_fill_devprop): Don't attempt + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_cpu_xnu_fill_devprop): Don't attempt to continue if allocation is failed. Reported by: David Volgyes . 2011-06-23 David Volgyes - * grub-core/bus/usb/ohci.c (grub_ohci_pci_iter): Avoid NULL-pointer + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Avoid NULL-pointer dereference. 2011-06-23 Vladimir Serbinenko Fix spurious warning. - * grub-core/partmap/acorn.c (grub_acorn_boot_block): Make a union. + * VasEBoot-core/partmap/acorn.c (VasEBoot_acorn_boot_block): Make a union. (acorn_partition_map_find): Use .bin member. 2011-06-23 Vladimir Serbinenko - * grub-core/kern/emu/getroot.c (grub_guess_root_device): Don't accept + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_guess_root_device): Don't accept /dev/root as a valid device. 2011-06-23 Jim Meyering - Avoid NULL deref in grub_device_open. + Avoid NULL deref in VasEBoot_device_open. - * grub-core/kern/device.c (grub_device_open): Don't dereference - a NULL pointer upon failed grub_env_get. + * VasEBoot-core/kern/device.c (VasEBoot_device_open): Don't dereference + a NULL pointer upon failed VasEBoot_env_get. 2011-06-23 Vladimir Serbinenko Support non-512B sectors and agglomerate reads. - * Makefile.util.def (libgrubmods.a): Add grub-core/commands/testload.c. - * grub-core/disk/efi/efidisk.c (grub_efidisk_data): Remove disk_io. + * Makefile.util.def (libVasEBootmods.a): Add VasEBoot-core/commands/testload.c. + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_data): Remove disk_io. (disk_io_guid): Removed. (make_devices): Locate solely by BlockIO. - (grub_efidisk_open): Fill log_sector_size and total_sectors. - (grub_efidisk_read): Use read_blocks. - (grub_efidisk_write): Use write_blocks. - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Fill + (VasEBoot_efidisk_open): Fill log_sector_size and total_sectors. + (VasEBoot_efidisk_read): Use read_blocks. + (VasEBoot_efidisk_write): Use write_blocks. + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Fill log_sector_size. (get_safe_sectors): Handle non-512B sectors. - (grub_biosdisk_read): Remove special CDROM handling. Handle non-512B + (VasEBoot_biosdisk_read): Remove special CDROM handling. Handle non-512B sectors. - (grub_biosdisk_write): Handle non-512B sectors. - * grub-core/disk/scsi.c (grub_scsi_open): Fill log_sector_size. - (grub_scsi_read): Remove special non-512B block handling (now handled + (VasEBoot_biosdisk_write): Handle non-512B sectors. + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_open): Fill log_sector_size. + (VasEBoot_scsi_read): Remove special non-512B block handling (now handled one level up). - * grub-core/kern/disk.c (grub_disk_open): Fill default log_sector_size + * VasEBoot-core/kern/disk.c (VasEBoot_disk_open): Fill default log_sector_size and do sanity checks. - (grub_disk_adjust_range): Handle non-512B sectors. + (VasEBoot_disk_adjust_range): Handle non-512B sectors. (transform_sector): New function. - (grub_disk_read_small): Likewise. - (grub_disk_read): Rewritten. - (grub_disk_write): Handle non-512B sectors. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Fill + (VasEBoot_disk_read_small): Likewise. + (VasEBoot_disk_read): Rewritten. + (VasEBoot_disk_write): Handle non-512B sectors. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_open): Fill log_sector_size. (open_device): Use log_sector_size. - (grub_util_biosdisk_read): Likewise. - (grub_util_biosdisk_write): Likewise. - * grub-core/partmap/msdos.c (grub_partition_msdos_iterate): Handle + (VasEBoot_util_biosdisk_read): Likewise. + (VasEBoot_util_biosdisk_write): Likewise. + * VasEBoot-core/partmap/msdos.c (VasEBoot_partition_msdos_iterate): Handle non-512B sectors. (pc_partition_map_embed): Likewise. - * include/grub/disk.h (grub_disk): New field log_sector_size. - (GRUB_DISK_CACHE_SIZE): Redefined from GRUB_DISK_CACHE_BITS. - (GRUB_DISK_CACHE_BITS): Increased to 6. - * util/grub-fstest.c (fstest): New command testload. + * include/VasEBoot/disk.h (VasEBoot_disk): New field log_sector_size. + (VasEBoot_DISK_CACHE_SIZE): Redefined from VasEBoot_DISK_CACHE_BITS. + (VasEBoot_DISK_CACHE_BITS): Increased to 6. + * util/VasEBoot-fstest.c (fstest): New command testload. (argp_parser): Likewise. 2011-06-16 Robert Millan @@ -19323,28 +19323,28 @@ * util/deviceiter.c [__FreeBSD_kernel__] (get_ada_disk_name) (get_ataraid_disk_name): New functions. - [__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for ataraid + [__FreeBSD_kernel__] (VasEBoot_util_iterate_devices): Scan for ataraid (/dev/ar[0-9]+) and ada (/dev/ada[0-9]+) devices using get_ataraid_disk_name() and get_ada_disk_name(). 2011-06-13 Colin Watson - * docs/man/grub-mklayout.h2m (DESCRIPTION): Add a reference to the + * docs/man/VasEBoot-mklayout.h2m (DESCRIPTION): Add a reference to the input format. 2011-05-29 Colin Watson - * docs/grub.texi (Obtaining and Building GRUB): Substitute + * docs/VasEBoot.texi (Obtaining and Building VasEBoot): Substitute `ftp.gnu.org' for `alpha.gnu.org'. 2011-05-27 Colin Watson - * grub-core/kern/emu/hostdisk.c (linux_find_partition): Handle + * VasEBoot-core/kern/emu/hostdisk.c (linux_find_partition): Handle partitions under /dev/disk/by-id/. 2011-05-27 Colin Watson - * grub-core/kern/emu/hostdisk.c (linux_find_partition): Give up + * VasEBoot-core/kern/emu/hostdisk.c (linux_find_partition): Give up after ten consecutive open failures. Scanning all the way up to 10000 is excessive and can cause serious performance problems in some configurations. @@ -19352,7 +19352,7 @@ 2011-05-21 Vladimir Serbinenko - * grub-core/disk/arc/arcdisk.c (reopen): Close old handle before + * VasEBoot-core/disk/arc/arcdisk.c (reopen): Close old handle before opening new one. 2011-05-21 Colin Watson @@ -19360,22 +19360,22 @@ Don't stat devices unless we have to. - * grub-core/kern/emu/getroot.c (grub_find_device): Recognize + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_find_device): Recognize dir == /dev/mapper. - (grub_guess_root_device): Use already known os_dev if possible. - * grub-core/kern/emu/hostdisk.c + (VasEBoot_guess_root_device): Use already known os_dev if possible. + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Scan only in /dev/mapper if device is known to be a dm one. 2011-05-20 Colin Watson - * util/grub-mkconfig.in: Export GRUB_CMDLINE_LINUX_XEN_REPLACE and - GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT. + * util/VasEBoot-mkconfig.in: Export VasEBoot_CMDLINE_LINUX_XEN_REPLACE and + VasEBoot_CMDLINE_LINUX_XEN_REPLACE_DEFAULT. Reported by: Pawel Tecza. 2011-05-19 Vladimir Serbinenko - * grub-core/Makefile.core.def (lsacpi): Fix ia64 mismerge. + * VasEBoot-core/Makefile.core.def (lsacpi): Fix ia64 mismerge. (lsefisystab): Likewise. (lssal): Likewise. (lsefimmap): Likewise. @@ -19385,148 +19385,148 @@ 2011-05-18 Colin Watson - * Makefile.util.def (grub-ofpathname): Install manual page. + * Makefile.util.def (VasEBoot-ofpathname): Install manual page. 2011-05-18 Colin Watson - * grub-core/fs/squash4.c: Add missing GRUB_MOD_LICENSE. + * VasEBoot-core/fs/squash4.c: Add missing VasEBoot_MOD_LICENSE. 2011-05-18 Colin Watson - * .bzrignore: Add grub-core/modinfo.sh and a number of test files. + * .bzrignore: Add VasEBoot-core/modinfo.sh and a number of test files. 2011-05-18 Vladimir Serbinenko - * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Downgrade a printf + * VasEBoot-core/bus/usb/usbhub.c (poll_nonroot_hub): Downgrade a printf into dprintf. 2011-05-18 Vladimir Serbinenko Use full 64-bit division. - * grub-core/kern/misc.c (grub_divmod64_full): Renamed to ... - (grub_divmod64): ... this. - * include/grub/misc.h (grub_divmod64): Removed. All users switch to full + * VasEBoot-core/kern/misc.c (VasEBoot_divmod64_full): Renamed to ... + (VasEBoot_divmod64): ... this. + * include/VasEBoot/misc.h (VasEBoot_divmod64): Removed. All users switch to full version. 2011-05-18 Colin Watson - * util/grub-mkrescue.in: Use portable `.' rather than non-portable + * util/VasEBoot-mkrescue.in: Use portable `.' rather than non-portable `source'. 2011-05-18 Colin Watson - * grub-core/genmod.sh.in: Use 'set -e' rather than '#! /bin/sh -e', + * VasEBoot-core/genmod.sh.in: Use 'set -e' rather than '#! /bin/sh -e', to avoid accidents when debugging with 'sh -x'. - * grub-core/gensyminfo.sh.in: Likewise. + * VasEBoot-core/gensyminfo.sh.in: Likewise. * tests/example_scripted_test.in: Likewise. - * tests/grub_cmd_regexp.in: Likewise. - * tests/grub_script_blanklines.in: Likewise. - * tests/grub_script_dollar.in: Likewise. - * tests/grub_script_expansion.in: Likewise. - * tests/grub_script_final_semicolon.in: Likewise. + * tests/VasEBoot_cmd_regexp.in: Likewise. + * tests/VasEBoot_script_blanklines.in: Likewise. + * tests/VasEBoot_script_dollar.in: Likewise. + * tests/VasEBoot_script_expansion.in: Likewise. + * tests/VasEBoot_script_final_semicolon.in: Likewise. * tests/partmap_test.in: Likewise. - * tests/util/grub-shell-tester.in: Likewise. - * tests/util/grub-shell.in: Likewise. + * tests/util/VasEBoot-shell-tester.in: Likewise. + * tests/util/VasEBoot-shell.in: Likewise. 2011-05-18 Colin Watson Move gfxmenu color handling to video, so that gfxterm can use it too. - * grub-core/gfxmenu/named_colors.c: Move to ... - * grub-core/video/colors.c: ... here. Rename - grub_gui_get_named_color to grub_video_get_named_color. - * grub-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ... - * grub-core/video/colors.c (my_isxdigit): ... here. - * grub-core/gfxmenu/gui_string_util.c (parse_hex_color_component): + * VasEBoot-core/gfxmenu/named_colors.c: Move to ... + * VasEBoot-core/video/colors.c: ... here. Rename + VasEBoot_gui_get_named_color to VasEBoot_video_get_named_color. + * VasEBoot-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ... + * VasEBoot-core/video/colors.c (my_isxdigit): ... here. + * VasEBoot-core/gfxmenu/gui_string_util.c (parse_hex_color_component): Move to ... - * grub-core/video/colors.c (parse_hex_color_component): ... here. - * grub-core/gfxmenu/gui_string_util.c (grub_gui_parse_color): Move + * VasEBoot-core/video/colors.c (parse_hex_color_component): ... here. + * VasEBoot-core/gfxmenu/gui_string_util.c (VasEBoot_gui_parse_color): Move to ... - * grub-core/video/colors.c (grub_video_parse_color): ... here. + * VasEBoot-core/video/colors.c (VasEBoot_video_parse_color): ... here. - * include/grub/gui.h (grub_gui_color_t): Move to ... - * include/grub/video.h (grub_video_rgba_color_t): ... here. - * include/grub/gui.h (grub_gui_color_rgb): Move to ... - * include/grub/video.h (grub_video_rgba_color_rgb): ... here. - * include/grub/gui.h (grub_gui_map_color): Move to ... - * include/grub/video.h (grub_video_map_rgba_color): ... here. - * include/grub/gui_string_util.h (grub_gui_get_named_color): Move + * include/VasEBoot/gui.h (VasEBoot_gui_color_t): Move to ... + * include/VasEBoot/video.h (VasEBoot_video_rgba_color_t): ... here. + * include/VasEBoot/gui.h (VasEBoot_gui_color_rgb): Move to ... + * include/VasEBoot/video.h (VasEBoot_video_rgba_color_rgb): ... here. + * include/VasEBoot/gui.h (VasEBoot_gui_map_color): Move to ... + * include/VasEBoot/video.h (VasEBoot_video_map_rgba_color): ... here. + * include/VasEBoot/gui_string_util.h (VasEBoot_gui_get_named_color): Move to ... - * include/grub/video.h (grub_video_get_named_color): ... here. - * include/grub/gui_string_util.h (grub_gui_parse_color): Move to ... - * include/grub/video.h (grub_video_parse_color): ... here. + * include/VasEBoot/video.h (VasEBoot_video_get_named_color): ... here. + * include/VasEBoot/gui_string_util.h (VasEBoot_gui_parse_color): Move to ... + * include/VasEBoot/video.h (VasEBoot_video_parse_color): ... here. - * grub-core/Makefile.core.def (kernel) [videoinkernel]: Add + * VasEBoot-core/Makefile.core.def (kernel) [videoinkernel]: Add video/colors.c. (gfxmenu): Remove gfxmenu/named_colors.c. (video) [videomodules]: Add video/colors.c. Add a background_color command. - * grub-core/term/gfxterm.c (grub_gfxterm_background_color_cmd): New + * VasEBoot-core/term/gfxterm.c (VasEBoot_gfxterm_background_color_cmd): New function. - (GRUB_MOD_INIT): Register background_color command. - (GRUB_MOD_FINI): Unregister background_color command. + (VasEBoot_MOD_INIT): Register background_color command. + (VasEBoot_MOD_FINI): Unregister background_color command. (redraw_screen_rect): Allow blend/replace of text layer to be controlled independently from whether there is a background bitmap. - (grub_gfxterm_background_image_cmd): Change blend_text_bg when + (VasEBoot_gfxterm_background_image_cmd): Change blend_text_bg when changing bitmap. 2011-05-18 Vladimir Serbinenko Patch BPB in ntldr and chainloader --bpb. - * grub-core/fs/fat.c: Include grub/fat.h. - (grub_fat_bpb): Moved to ... - * include/grub/fat.h (grub_fat_bpb): ... here. New file. - * grub-core/loader/i386/pc/chainloader.c: Include grub/fat.h and - grub/ntfs.h. - * include/grub/i386/pc/chainloader.h (grub_chainloader_flags_t): + * VasEBoot-core/fs/fat.c: Include VasEBoot/fat.h. + (VasEBoot_fat_bpb): Moved to ... + * include/VasEBoot/fat.h (VasEBoot_fat_bpb): ... here. New file. + * VasEBoot-core/loader/i386/pc/chainloader.c: Include VasEBoot/fat.h and + VasEBoot/ntfs.h. + * include/VasEBoot/i386/pc/chainloader.h (VasEBoot_chainloader_flags_t): Moved from here... - * grub-core/loader/i386/pc/chainloader.c (grub_chainloader_flags_t): ... + * VasEBoot-core/loader/i386/pc/chainloader.c (VasEBoot_chainloader_flags_t): ... here. - * grub-core/loader/i386/pc/chainloader.c (grub_chainloader_patch_bpb): + * VasEBoot-core/loader/i386/pc/chainloader.c (VasEBoot_chainloader_patch_bpb): New function. - (grub_chainloader_cmd): Patch BPB if --bpb is given. - (GRUB_MOD_INIT): Show --bpb. - * grub-core/loader/i386/pc/ntldr.c (grub_cmd_ntldr): Patch BPB. - * grub-core/normal/main.c (features): New variable. - (GRUB_MOD_INIT): Set feature_* variables. - * include/grub/i386/pc/chainloader.h (grub_chainloader_patch_bpb): New + (VasEBoot_chainloader_cmd): Patch BPB if --bpb is given. + (VasEBoot_MOD_INIT): Show --bpb. + * VasEBoot-core/loader/i386/pc/ntldr.c (VasEBoot_cmd_ntldr): Patch BPB. + * VasEBoot-core/normal/main.c (features): New variable. + (VasEBoot_MOD_INIT): Set feature_* variables. + * include/VasEBoot/i386/pc/chainloader.h (VasEBoot_chainloader_patch_bpb): New proto. - * include/grub/ntfs.h (grub_ntfs_bpb): New field bios_drive. + * include/VasEBoot/ntfs.h (VasEBoot_ntfs_bpb): New field bios_drive. 2011-05-18 Vladimir Serbinenko - * grub-core/Makefile.core.def (ieee1275_fb): Use enable=powerpc_ieee1275 + * VasEBoot-core/Makefile.core.def (ieee1275_fb): Use enable=powerpc_ieee1275 for cleanness. 2011-05-18 Vladimir Serbinenko FreeDOS direct loading support. - * docs/grub.texi (Supported OS): Add FreeDOS. - * grub-core/Makefile.core.def (freedos): New module. - * grub-core/lib/i386/relocator.c (grub_relocator16_ebx): New extern + * docs/VasEBoot.texi (Supported OS): Add FreeDOS. + * VasEBoot-core/Makefile.core.def (freedos): New module. + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator16_ebx): New extern variable. - (grub_relocator16_boot): Handle %ebx. - * grub-core/lib/i386/relocator16.S: Likewise. - * grub-core/loader/i386/pc/freedos.c: New file. + (VasEBoot_relocator16_boot): Handle %ebx. + * VasEBoot-core/lib/i386/relocator16.S: Likewise. + * VasEBoot-core/loader/i386/pc/freedos.c: New file. 2011-05-18 Vladimir Serbinenko Long Linux command line support. - * grub-core/loader/i386/linux.c (GRUB_LINUX_CL_END_OFFSET): Removed. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_LINUX_CL_END_OFFSET): Removed. (maximal_cmdline_size): New variable. (allocate_pages): Use maximal_cmdline_size. - (grub_cmd_linux): Set and use maximal_cmdline_size. - * grub-core/loader/i386/pc/linux.c (GRUB_LINUX_CL_END_OFFSET): Removed. + (VasEBoot_cmd_linux): Set and use maximal_cmdline_size. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_LINUX_CL_END_OFFSET): Removed. (allocate_pages): Use maximal_cmdline_size. - (grub_cmd_linux): Set and use maximal_cmdline_size. - * include/grub/i386/linux.h (GRUB_LINUX_SETUP_MOVE_SIZE): Removed. + (VasEBoot_cmd_linux): Set and use maximal_cmdline_size. + * include/VasEBoot/i386/linux.h (VasEBoot_LINUX_SETUP_MOVE_SIZE): Removed. (linux_kernel_header): Add fields kernel_alignment, relocatable, pad and cmdline_size. @@ -19535,32 +19535,32 @@ Improve devmapper support - * grub-core/kern/emu/getroot.c (grub_util_is_dmraid): Removed. - (grub_util_is_lvm): New function. - (grub_util_get_dev_abstraction): Assume dmraid if not lvm rather + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_is_dmraid): Removed. + (VasEBoot_util_is_lvm): New function. + (VasEBoot_util_get_dev_abstraction): Assume dmraid if not lvm rather than lvm if not dmraid. Handle mapped md nodes. - * grub-core/kern/emu/hostdisk.c (device_is_mapped): Rename to ... - (grub_util_device_is_mapped): ... this. Make always available. All users + * VasEBoot-core/kern/emu/hostdisk.c (device_is_mapped): Rename to ... + (VasEBoot_util_device_is_mapped): ... this. Make always available. All users updated. - (grub_util_get_dm_node_linear_info) [HAVE_DEVICE_MAPPER]: New function. + (VasEBoot_util_get_dm_node_linear_info) [HAVE_DEVICE_MAPPER]: New function. (convert_system_partition_to_system_disk): Handle lvm, mpath and dmraid nodes. - * include/grub/emu/misc.h (grub_util_device_is_mapped): New proto. + * include/VasEBoot/emu/misc.h (VasEBoot_util_device_is_mapped): New proto. 2011-05-18 Vladimir Serbinenko - Unify grub-mkrescue (except powerpc) and grrub-mknetdir across platforms + Unify VasEBoot-mkrescue (except powerpc) and grrub-mknetdir across platforms - * grub-core/Makefile.am (platform_DATA): Add modinfo.sh. - * grub-core/modinfo.sh.in: New file. - * grub-core/Makefile.core.def (modinfo.sh): New script. - * util/grub-mknetdir.in: Use modinfo.sh. - * util/grub-mkrescue.in: Likewise. + * VasEBoot-core/Makefile.am (platform_DATA): Add modinfo.sh. + * VasEBoot-core/modinfo.sh.in: New file. + * VasEBoot-core/Makefile.core.def (modinfo.sh): New script. + * util/VasEBoot-mknetdir.in: Use modinfo.sh. + * util/VasEBoot-mkrescue.in: Likewise. 2011-05-17 Vladimir Serbinenko - * grub-core/kern/ia64/dl_helper.c (grub_ia64_dl_get_tramp_got_size): + * VasEBoot-core/kern/ia64/dl_helper.c (VasEBoot_ia64_dl_get_tramp_got_size): Fix potential usage of Elf32 instead of Elf64 when compiling on 32-bit architecture. Add endianness macros while on it. @@ -19571,19 +19571,19 @@ * configure.ac: proparate target_cpu=mipsel rather than resetting to mips. All conditions adjusted. - * tests/util/grub-shell-tester.in: Remove gratuitious target_cpu + * tests/util/VasEBoot-shell-tester.in: Remove gratuitious target_cpu variable. - * util/grub-install.in: Adjust conditions to take renaming into account. - * util/grub-mkimage.c (image_targets): Likewise. New target + * util/VasEBoot-install.in: Adjust conditions to take renaming into account. + * util/VasEBoot-mkimage.c (image_targets): Likewise. New target mips-qemu_mips-elf for bigendian mips. 2011-05-17 Vladimir Serbinenko Avoid unnecessary copying on MIPS. - * grub-core/boot/decompressor/none.c (grub_decompress_core): Exit + * VasEBoot-core/boot/decompressor/none.c (VasEBoot_decompress_core): Exit early if src == dest. - * util/grub-mkimage.c (generate_image): Arange for src == dest if + * util/VasEBoot-mkimage.c (generate_image): Arange for src == dest if compression is none. 2011-05-17 Vladimir Serbinenko @@ -19591,28 +19591,28 @@ Reduce memory footprint on SGI by putting modules before the kernel as opposed to after. - * grub-core/Makefile.core.def (kernel): Increase linking address. + * VasEBoot-core/Makefile.core.def (kernel): Increase linking address. (none_decompress): Likewise. (xz_decompress): Likewise. - * grub-core/boot/mips/startup_raw.S: Use prewritten uncompression + * VasEBoot-core/boot/mips/startup_raw.S: Use prewritten uncompression address. - * grub-core/kern/mips/arc/init.c (grub_machine_init): Handle memory + * VasEBoot-core/kern/mips/arc/init.c (VasEBoot_machine_init): Handle memory layout change. - (grub_arch_modules_addr): New function. - * grub-core/kern/mips/init.c (grub_arch_modules_addr): Moved from here... - * grub-core/kern/mips/loongson/init.c (grub_arch_modules_addr): .. here - * grub-core/kern/mips/qemu_mips/init.c (grub_arch_modules_addr): ... and + (VasEBoot_arch_modules_addr): New function. + * VasEBoot-core/kern/mips/init.c (VasEBoot_arch_modules_addr): Moved from here... + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_arch_modules_addr): .. here + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_arch_modules_addr): ... and here. - * grub-core/kern/mips/startup.S (total_size): Rename to ... - (grub_total_modules_size): ... this. Make global. - [GRUB_MACHINE_ARC]: Don't attempt to move modules out of the bss. - * include/grub/offsets.h (GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_ADDR): + * VasEBoot-core/kern/mips/startup.S (total_size): Rename to ... + (VasEBoot_total_modules_size): ... this. Make global. + [VasEBoot_MACHINE_ARC]: Don't attempt to move modules out of the bss. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_ADDR): New definition. - (GRUB_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR): Likewise. - (GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_ADDR): Likewise. - (GRUB_KERNEL_MACHINE_UNCOMPRESSED_ADDR): Likewise. - (GRUB_KERNEL_MIPS_ARC_LINK_ADDR): Increased. - * util/grub-mkimage.c (image_target_desc): New flag + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_UNCOMPRESSED_ADDR): Likewise. + (VasEBoot_KERNEL_MACHINE_UNCOMPRESSED_ADDR): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_LINK_ADDR): Increased. + * util/VasEBoot-mkimage.c (image_target_desc): New flag PLATFORM_FLAGS_MODULES_BEFORE_KERNEL. (image_targets): Set PLATFORM_FLAGS_MODULES_BEFORE_KERNEL on mips-arc. (generate_image): Handle images with modules before kernel. @@ -19621,45 +19621,45 @@ Prevent potential loss of memory map by overwrite on qemu-mips. - * grub-core/boot/mips/startup_raw.S [GRUB_MACHINE_MIPS_QEMU_MIPS]: + * VasEBoot-core/boot/mips/startup_raw.S [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Save ram size in $s4. - * grub-core/kern/mips/qemu_mips/init.c (RAMSIZE): Removed. - All users changed to grub_arch_memsize. - * grub-core/kern/mips/startup.S (grub_arch_machine): Restrict to + * VasEBoot-core/kern/mips/qemu_mips/init.c (RAMSIZE): Removed. + All users changed to VasEBoot_arch_memsize. + * VasEBoot-core/kern/mips/startup.S (VasEBoot_arch_machine): Restrict to Loongson. - [GRUB_MACHINE_MIPS_QEMU_MIPS]: Save grub_arch_memsize. - * grub-core/loader/mips/linux.c (grub_linux_boot): Pass memory size. - * include/grub/mips/qemu_mips/memory.h (grub_arch_memsize): New + [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Save VasEBoot_arch_memsize. + * VasEBoot-core/loader/mips/linux.c (VasEBoot_linux_boot): Pass memory size. + * include/VasEBoot/mips/qemu_mips/memory.h (VasEBoot_arch_memsize): New external variable. 2011-05-17 Colin Watson - * .bzrignore: Remove grub-dumpbios. + * .bzrignore: Remove VasEBoot-dumpbios. 2011-05-17 Colin Watson - * util/grub.d/20_linux_xen.in: Honour GRUB_CMDLINE_LINUX_XEN_REPLACE - and GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT, which replace - GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT (complementing the + * util/VasEBoot.d/20_linux_xen.in: Honour VasEBoot_CMDLINE_LINUX_XEN_REPLACE + and VasEBoot_CMDLINE_LINUX_XEN_REPLACE_DEFAULT, which replace + VasEBoot_CMDLINE_LINUX and VasEBoot_CMDLINE_LINUX_DEFAULT (complementing the existing options which append). - * docs/grub.texi (Simple configuration): Document new options. + * docs/VasEBoot.texi (Simple configuration): Document new options. Reported by: Ian Jackson. Fixes Debian bug #617538. 2011-05-17 Colin Watson - * util/grub-fstest.c (cmd_cat): New function. + * util/VasEBoot-fstest.c (cmd_cat): New function. (fstest): Handle CMD_CAT. (options): Add cat. (argp_parser): Handle cat. 2011-05-17 Colin Watson - * Makefile.util.def (grub-bin2h): Don't install. - * docs/man/grub-bin2h.h2m: Remove. + * Makefile.util.def (VasEBoot-bin2h): Don't install. + * docs/man/VasEBoot-bin2h.h2m: Remove. 2011-05-17 Vladimir Serbinenko - * grub-core/kern/mips/startup.S (grub_arch_cpuclock): Move to the right + * VasEBoot-core/kern/mips/startup.S (VasEBoot_arch_cpuclock): Move to the right place. 2011-05-17 Vladimir Serbinenko @@ -19669,266 +19669,266 @@ * configure.ac: Handle --target=qemu-mips and --target=qemu_mips. Fix small arc bug while on it. * gentpl.py: Handle qemu_mips. - * grub-core/Makefile.am: Likewise. - * grub-core/Makefile.core.def: Likewise. - * grub-core/disk/ata.c [GRUB_MACHINE_MIPS_QEMU_MIPS]: Remove + * VasEBoot-core/Makefile.am: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. + * VasEBoot-core/disk/ata.c [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Remove inappropriate includes. - (grub_ata_pciinit) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Removed. - (grub_ata_initialize): [GRUB_MACHINE_MIPS_QEMU_MIPS]: Rewritten. - * grub-core/kern/main.c (grub_modules_get_end) - [GRUB_MACHINE_MIPS_QEMU_MIPS]: Enable. - * grub-core/kern/mips/qemu-mips: Moved to .. - * grub-core/kern/mips/qemu_mips: ... this. - * grub-core/kern/mips/qemu_mips/init.c (grub_get_rtc): Removed. - (grub_machine_init): Call terminfo_init and serial_init. - * grub-core/kern/mips/startup.S: Change MIPS_LOONGSON to MACHINE. - * grub-core/loader/mips/linux.c (params) [GRUB_MACHINE_MIPS_QEMU_MIPS]: + (VasEBoot_ata_pciinit) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Removed. + (VasEBoot_ata_initialize): [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Rewritten. + * VasEBoot-core/kern/main.c (VasEBoot_modules_get_end) + [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Enable. + * VasEBoot-core/kern/mips/qemu-mips: Moved to .. + * VasEBoot-core/kern/mips/qemu_mips: ... this. + * VasEBoot-core/kern/mips/qemu_mips/init.c (VasEBoot_get_rtc): Removed. + (VasEBoot_machine_init): Call terminfo_init and serial_init. + * VasEBoot-core/kern/mips/startup.S: Change MIPS_LOONGSON to MACHINE. + * VasEBoot-core/loader/mips/linux.c (params) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: New variable. - (grub_linux_boot) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Handle the qemu-mips + (VasEBoot_linux_boot) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Handle the qemu-mips parameter passing. - (grub_linux_unload) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Free params. - (grub_cmd_linux) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Handle params. - (grub_cmd_initrd) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Likewise. - * include/grub/mips/qemu_mips/cmos.h: New file. - * include/grub/mips/qemu-mips/kernel.h: Don't include cpu/kernel.h. - * include/grub/mips/qemu-mips/memory.h (grub_machine_mmap_iterate): + (VasEBoot_linux_unload) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Free params. + (VasEBoot_cmd_linux) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Handle params. + (VasEBoot_cmd_initrd) [VasEBoot_MACHINE_MIPS_QEMU_MIPS]: Likewise. + * include/VasEBoot/mips/qemu_mips/cmos.h: New file. + * include/VasEBoot/mips/qemu-mips/kernel.h: Don't include cpu/kernel.h. + * include/VasEBoot/mips/qemu-mips/memory.h (VasEBoot_machine_mmap_iterate): Removed. - * include/grub/mips/qemu-mips/serial.h (GRUB_MACHINE_SERIAL_PORTS): + * include/VasEBoot/mips/qemu-mips/serial.h (VasEBoot_MACHINE_SERIAL_PORTS): Use correct mips-style address. - * include/grub/mips/qemu-mips/time.h: Include cpu/time.h. - (GRUB_TICKS_PER_SECOND): Removed. - (grub_get_rtc): Likewise. - (grub_cpu_idle): Likewise. - * include/grub/offsets.h (GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR): + * include/VasEBoot/mips/qemu-mips/time.h: Include cpu/time.h. + (VasEBoot_TICKS_PER_SECOND): Removed. + (VasEBoot_get_rtc): Likewise. + (VasEBoot_cpu_idle): Likewise. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR): New definition. - (GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_COMPRESSED_SIZE): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_SIZE): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END): Likewise. - (GRUB_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN): Likewise. - * util/grub-mkimage.c (image_targets): Add mipsel-qemu_mips-elf. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_COMPRESSED_SIZE): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_SIZE): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_PREFIX): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN): Likewise. + * util/VasEBoot-mkimage.c (image_targets): Add mipsel-qemu_mips-elf. 2011-05-17 Vladimir Serbinenko SGI ARCS port. - * Makefile.util.def (libgrubmods.a): Add dvh.c. + * Makefile.util.def (libVasEBootmods.a): Add dvh.c. * conf/Makefile.common (CCASFLAGS_PLATFORM): Add -mips3 on all mips platforms. * configure.ac: New target mips-arc. * gentpl.py: Likewise. - * grub-core/Makefile.am: Likewise. - * grub-core/Makefile.core.def: Likewise. - (xz_decompress): Remove -D GRUB_MACHINE_LINK_ADDR. + * VasEBoot-core/Makefile.am: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. + (xz_decompress): Remove -D VasEBoot_MACHINE_LINK_ADDR. (none_decompress): Likewise. (lsdev): New module. (datetime): Use lib/arc/datetime.c on ARC. (part_dvh): New module. - * grub-core/commands/arc/lsdev.c: New file. - * grub-core/disk/arc/arcdisk.c: Likewise. - * grub-core/kern/mips/arc/init.c: Likewise. - * grub-core/kern/mips/cache_flush.S: Don't flush non 4-byte + * VasEBoot-core/commands/arc/lsdev.c: New file. + * VasEBoot-core/disk/arc/arcdisk.c: Likewise. + * VasEBoot-core/kern/mips/arc/init.c: Likewise. + * VasEBoot-core/kern/mips/cache_flush.S: Don't flush non 4-byte aligned addresses. - * grub-core/kern/mips/dl.c (grub_arch_dl_check_header): Fix bigendian + * VasEBoot-core/kern/mips/dl.c (VasEBoot_arch_dl_check_header): Fix bigendian support. - (grub_arch_dl_relocate_symbols): Likewise. - * grub-core/kern/mips/loongson/init.c (grub_get_rtc): Moved from here... - * grub-core/kern/mips/init.c (grub_get_rtc): ... here. - * grub-core/kern/mips/startup.S (grub_arch_cpuclock): Have on all + (VasEBoot_arch_dl_relocate_symbols): Likewise. + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_get_rtc): Moved from here... + * VasEBoot-core/kern/mips/init.c (VasEBoot_get_rtc): ... here. + * VasEBoot-core/kern/mips/startup.S (VasEBoot_arch_cpuclock): Have on all platforms. - * grub-core/lib/arc/datetime.c: New file. - * grub-core/loader/mips/linux.c: Always include time.h. Don't include + * VasEBoot-core/lib/arc/datetime.c: New file. + * VasEBoot-core/loader/mips/linux.c: Always include time.h. Don't include pci.h on non-loongson. - (envp_off) [!GRUB_MACHINE_MIPS_LOONGSON]: Remove. - (grub_linux_boot): Set unused registers to 0. - (grub_cmd_linux) [!GRUB_MACHINE_MIPS_LOONGSON]: Remove envp. - * grub-core/mmap/mips/loongson/uppermem.c: Moved from here ... - * grub-core/mmap/mips/uppermem.c: ...here. - * grub-core/partmap/dvh.c: New file. - * grub-core/term/arc/console.c: Likewise. - * grub-core/term/terminfo.c (ANSI_C0_STR): New const. - (grub_terminfo_set_current): Add terminal "arc". - (grub_terminfo_readkey): Support ARC sequences. - * include/grub/arc/arc.h: New file. - * include/grub/arc/console.h: Likewise. - * include/grub/disk.h (grub_disk_dev_id): Add - GRUB_DISK_DEVICE_ARCDISK_ID. - * include/grub/mips/arc/kernel.h: New file. - * include/grub/mips/arc/memory.h: Likewise. - * include/grub/mips/arc/time.h: Likewise. - * include/grub/mips/loongson/kernel.h (grub_halt): Moved from here ... - * include/grub/mips/kernel.h (grub_halt): ... here. - * include/grub/mips/loongson.h (GRUB_CPU_REGISTER_WRAP): Moved from + (envp_off) [!VasEBoot_MACHINE_MIPS_LOONGSON]: Remove. + (VasEBoot_linux_boot): Set unused registers to 0. + (VasEBoot_cmd_linux) [!VasEBoot_MACHINE_MIPS_LOONGSON]: Remove envp. + * VasEBoot-core/mmap/mips/loongson/uppermem.c: Moved from here ... + * VasEBoot-core/mmap/mips/uppermem.c: ...here. + * VasEBoot-core/partmap/dvh.c: New file. + * VasEBoot-core/term/arc/console.c: Likewise. + * VasEBoot-core/term/terminfo.c (ANSI_C0_STR): New const. + (VasEBoot_terminfo_set_current): Add terminal "arc". + (VasEBoot_terminfo_readkey): Support ARC sequences. + * include/VasEBoot/arc/arc.h: New file. + * include/VasEBoot/arc/console.h: Likewise. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add + VasEBoot_DISK_DEVICE_ARCDISK_ID. + * include/VasEBoot/mips/arc/kernel.h: New file. + * include/VasEBoot/mips/arc/memory.h: Likewise. + * include/VasEBoot/mips/arc/time.h: Likewise. + * include/VasEBoot/mips/loongson/kernel.h (VasEBoot_halt): Moved from here ... + * include/VasEBoot/mips/kernel.h (VasEBoot_halt): ... here. + * include/VasEBoot/mips/loongson.h (VasEBoot_CPU_REGISTER_WRAP): Moved from here... - * include/grub/mips/mips.h (GRUB_CPU_REGISTER_WRAP): ... here. - (GRUB_CPU_LOONGSON_COP0_TIMER_COUNT): Moved from here ... - * include/grub/mips/mips.h (GRUB_CPU_LOONGSON_COP0_TIMER_COUNT): .. here - * include/grub/mips/loongson/kernel.h (grub_reboot): Removed redundant + * include/VasEBoot/mips/mips.h (VasEBoot_CPU_REGISTER_WRAP): ... here. + (VasEBoot_CPU_LOONGSON_COP0_TIMER_COUNT): Moved from here ... + * include/VasEBoot/mips/mips.h (VasEBoot_CPU_LOONGSON_COP0_TIMER_COUNT): .. here + * include/VasEBoot/mips/loongson/kernel.h (VasEBoot_reboot): Removed redundant proto. - * include/grub/mips/loongson/memory.h (GRUB_ARCH_LOWMEMVSTART): Moved + * include/VasEBoot/mips/loongson/memory.h (VasEBoot_ARCH_LOWMEMVSTART): Moved from here ... - * include/grub/mips/memory.h (GRUB_ARCH_LOWMEMVSTART): ... here. - (GRUB_ARCH_LOWMEMPSTART): Moved from here ... - * include/grub/mips/memory.h (GRUB_ARCH_LOWMEMPSTART): ... here. - (GRUB_ARCH_LOWMEMMAXSIZE): Moved from here ... - * include/grub/mips/memory.h (GRUB_ARCH_LOWMEMMAXSIZE): ... here. - (GRUB_ARCH_HIGHMEMPSTART): Moved from here ... - * include/grub/mips/memory.h (GRUB_ARCH_HIGHMEMPSTART): ... here. - (grub_phys_addr_t): Moved from here ... - * include/grub/mips/memory.h (grub_phys_addr_t): ... here. - (grub_vtop): Moved from here ... - * include/grub/mips/memory.h (grub_vtop): ... here. - (grub_map_memory): Moved from here ... - * include/grub/mips/memory.h (grub_map_memory): ... here. - (grub_unmap_memory): Moved from here ... - * include/grub/mips/memory.h (grub_unmap_memory): ... here. - (grub_machine_mmap_iterate): Moved from here ... - * include/grub/mips/memory.h (grub_machine_mmap_iterate): ... here. - (grub_mmap_get_lower): Moved from here ... - * include/grub/mips/memory.h (grub_mmap_get_lower): ... here. - (grub_mmap_get_upper): Moved from here ... - * include/grub/mips/memory.h (grub_mmap_get_upper): ... here. - * include/grub/mips/loongson/time.h (grub_arch_cpuclock): Moved from + * include/VasEBoot/mips/memory.h (VasEBoot_ARCH_LOWMEMVSTART): ... here. + (VasEBoot_ARCH_LOWMEMPSTART): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_ARCH_LOWMEMPSTART): ... here. + (VasEBoot_ARCH_LOWMEMMAXSIZE): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_ARCH_LOWMEMMAXSIZE): ... here. + (VasEBoot_ARCH_HIGHMEMPSTART): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_ARCH_HIGHMEMPSTART): ... here. + (VasEBoot_phys_addr_t): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_phys_addr_t): ... here. + (VasEBoot_vtop): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_vtop): ... here. + (VasEBoot_map_memory): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_map_memory): ... here. + (VasEBoot_unmap_memory): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_unmap_memory): ... here. + (VasEBoot_machine_mmap_iterate): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_machine_mmap_iterate): ... here. + (VasEBoot_mmap_get_lower): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_mmap_get_lower): ... here. + (VasEBoot_mmap_get_upper): Moved from here ... + * include/VasEBoot/mips/memory.h (VasEBoot_mmap_get_upper): ... here. + * include/VasEBoot/mips/loongson/time.h (VasEBoot_arch_cpuclock): Moved from here ... - * include/grub/mips/time.h (grub_arch_cpuclock): ... here. - * include/grub/mips/loongson/time.h (grub_get_rtc): Moved from + * include/VasEBoot/mips/time.h (VasEBoot_arch_cpuclock): ... here. + * include/VasEBoot/mips/loongson/time.h (VasEBoot_get_rtc): Moved from here ... - * include/grub/mips/time.h (grub_get_rtc): ... here. - * include/grub/mips/loongson/time.h (grub_arch_cpuclock): Moved from + * include/VasEBoot/mips/time.h (VasEBoot_get_rtc): ... here. + * include/VasEBoot/mips/loongson/time.h (VasEBoot_arch_cpuclock): Moved from here ... - * include/grub/mips/time.h (grub_arch_cpuclock): ... here. - * include/grub/mips/loongson/time.h (grub_cpu_idle): Moved from + * include/VasEBoot/mips/time.h (VasEBoot_arch_cpuclock): ... here. + * include/VasEBoot/mips/loongson/time.h (VasEBoot_cpu_idle): Moved from here ... - * include/grub/mips/time.h (grub_cpu_idle): ... here. - * include/grub/offsets.h (GRUB_KERNEL_MIPS_ARC_LINK_ADDR): New + * include/VasEBoot/mips/time.h (VasEBoot_cpu_idle): ... here. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_MIPS_ARC_LINK_ADDR): New definition. - (GRUB_KERNEL_MIPS_ARC_LINK_ALIGN): Likewise. - (GRUB_KERNEL_MIPS_ARC_COMPRESSED_SIZE): Likewise. - (GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_SIZE): Likewise. - (GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE): Likewise. - (GRUB_KERNEL_MIPS_ARC_PREFIX): Likewise. - (GRUB_KERNEL_MIPS_ARC_PREFIX_END): Likewise. - (GRUB_KERNEL_MIPS_ARC_MOD_ALIGN): Likewise. - (GRUB_MACHINE_LINK_ADDR): Likewise. - * include/grub/terminfo.h (GRUB_TERMINFO_READKEY_MAX_LEN): Increased + (VasEBoot_KERNEL_MIPS_ARC_LINK_ALIGN): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_COMPRESSED_SIZE): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_UNCOMPRESSED_SIZE): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_PREFIX): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MIPS_ARC_MOD_ALIGN): Likewise. + (VasEBoot_MACHINE_LINK_ADDR): Likewise. + * include/VasEBoot/terminfo.h (VasEBoot_TERMINFO_READKEY_MAX_LEN): Increased to 6. - * util/grub-install.in: Run dvhtool on ARC. - * util/grub-mkimage.c (image_targets): Add mips-arc. + * util/VasEBoot-install.in: Run dvhtool on ARC. + * util/VasEBoot-mkimage.c (image_targets): Add mips-arc. (generate_image): Handle ECOFF output for mips-arc. 2011-05-16 Vladimir Serbinenko - * grub-core/bus/pci.c (grub_memalign_dma32): Always allocate in 64-byte + * VasEBoot-core/bus/pci.c (VasEBoot_memalign_dma32): Always allocate in 64-byte blocks. 2011-05-16 Vladimir Serbinenko - * grub-core/bus/usb/usbhub.c (attach_root_port): Wait 10ms + * VasEBoot-core/bus/usb/usbhub.c (attach_root_port): Wait 10ms after enabling port. 2011-05-16 Vladimir Serbinenko Skip incorrect USB devices. - * grub-core/bus/usb/usb.c (grub_usb_device_initialize): Fail if + * VasEBoot-core/bus/usb/usb.c (VasEBoot_usb_device_initialize): Fail if configcnt == 0. - * include/grub/usb.h (grub_usb_err_t): New enum value - GRUB_USB_ERR_BADDEVICE. + * include/VasEBoot/usb.h (VasEBoot_usb_err_t): New enum value + VasEBoot_USB_ERR_BADDEVICE. 2011-05-16 Vladimir Serbinenko Fuloong video init support. - * include/grub/vga.h (grub_vga_write_arx): inb monochrome address as + * include/VasEBoot/vga.h (VasEBoot_vga_write_arx): inb monochrome address as well. - (grub_vga_read_arx): New function. - * grub-core/video/sis315pro.c (GRUB_SIS315PRO_MMIO_SPACE): New + (VasEBoot_vga_read_arx): New function. + * VasEBoot-core/video/sis315pro.c (VasEBoot_SIS315PRO_MMIO_SPACE): New definition. (framebuffer): New members io, mmioptr and mmiobase. (read_sis_cmd): New function. (write_sis_cmd): Likewise. - (grub_video_sis315pro_setup): Do the initialisation. Use 640x480 + (VasEBoot_video_sis315pro_setup): Do the initialisation. Use 640x480 rather than 640x400. - * grub-core/video/sis315_init.c: New file. + * VasEBoot-core/video/sis315_init.c: New file. 2011-05-15 Vladimir Serbinenko - * grub-core/bus/cs5536.c: Don't include grub/machine/kernel.h on + * VasEBoot-core/bus/cs5536.c: Don't include VasEBoot/machine/kernel.h on non-loongson. - * grub-core/kern/mips/dl.c (grub_arch_dl_init_linker): Fix argument - to grub_dl_register_symbol. + * VasEBoot-core/kern/mips/dl.c (VasEBoot_arch_dl_init_linker): Fix argument + to VasEBoot_dl_register_symbol. 2011-05-15 Vladimir Serbinenko Fix compilation errors. - * grub-core/term/ns8250.c (serial_get_divisor): Declare 'port' as + * VasEBoot-core/term/ns8250.c (serial_get_divisor): Declare 'port' as potentially unused. - * grub-core/loader/i386/linux.c (grub_linux_setup_video): - Handle GRUB_VIDEO_DRIVER_SIS315PRO. - * grub-core/bus/cs5536.c (grub_cs5536_init_geode): Restrict DIVIL init + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_setup_video): + Handle VasEBoot_VIDEO_DRIVER_SIS315PRO. + * VasEBoot-core/bus/cs5536.c (VasEBoot_cs5536_init_geode): Restrict DIVIL init to loongson machines. 2011-05-15 Vladimir Serbinenko Several FS mtime support. - * grub-core/fs/affs.c (grub_affs_time): New struct. - (grub_affs_file): New field mtime. - (grub_fshelp_node): Changed 'block' and 'parent' to more appropriate + * VasEBoot-core/fs/affs.c (VasEBoot_affs_time): New struct. + (VasEBoot_affs_file): New field mtime. + (VasEBoot_fshelp_node): Changed 'block' and 'parent' to more appropriate type. Removed 'size'. New field 'di'. All users updated. - (grub_affs_mount): Simplify checsum checking. - (grub_affs_iterate_dir): New helper grub_affs_create_node. - (grub_affs_dir): Handle mtime. - * grub-core/fs/cpio.c (grub_cpio_find_file): Handle mtime. - (grub_cpio_dir): Likewise. - * grub-core/fs/hfs.c (grub_hfs_dirrec): New fields 'ctime' and 'mtime'. - (grub_hfs_filerec): New field mtime. - (grub_hfs_dir): Handle mtime. - (grub_hfs_mtime): New function. - (grub_hfs_fs): Register grub_hfs_mtime. - * grub-core/fs/iso9660.c (grub_iso9660_date2): New struct. - (grub_iso9660_dir): New field mtime. - (grub_fshelp_node): New field dirent. + (VasEBoot_affs_mount): Simplify checsum checking. + (VasEBoot_affs_iterate_dir): New helper VasEBoot_affs_create_node. + (VasEBoot_affs_dir): Handle mtime. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_find_file): Handle mtime. + (VasEBoot_cpio_dir): Likewise. + * VasEBoot-core/fs/hfs.c (VasEBoot_hfs_dirrec): New fields 'ctime' and 'mtime'. + (VasEBoot_hfs_filerec): New field mtime. + (VasEBoot_hfs_dir): Handle mtime. + (VasEBoot_hfs_mtime): New function. + (VasEBoot_hfs_fs): Register VasEBoot_hfs_mtime. + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_date2): New struct. + (VasEBoot_iso9660_dir): New field mtime. + (VasEBoot_fshelp_node): New field dirent. (iso9660_to_unixtime): New function. (iso9660_to_unixtime2): Likewise. - (grub_iso9660_read_symlink): Use node->dirent. - (grub_iso9660_iterate_dir): Likewise. - (grub_iso9660_dir): Set mtime. - (grub_iso9660_mtime): New function. - (grub_iso9660_fs): Register grub_iso9660_mtime. - * grub-core/fs/jfs.c (grub_jfs_time): New struct. - (grub_jfs_inode): New fields atime, ctime and mtime. - (grub_jfs_dir): Set mtime. - * grub-core/fs/minix.c (grub_minix_dir): Likewise. - * grub-core/fs/ntfs.c (list_file): Set mtime. - (grub_ntfs_dir): Likewise. - * grub-core/fs/reiserfs.c (grub_fshelp_node): New field 'mtime'. - (grub_reiserfs_iterate_dir): Set mtime. - (grub_reiserfs_dir): Likewise. - * grub-core/fs/sfs.c (grub_sfs_obj): New field mtime. - (grub_fshelp_node): Likewise. - (grub_sfs_iterate_dir): Set mtime. - (grub_sfs_dir): Likewise. - * grub-core/fs/udf.c (grub_udf_dir): Set mtime. - * grub-core/fs/xfs.c (grub_xfs_time): New struct. - (grub_xfs_inode): New fields atime, mtime, ctime. - (grub_xfs_dir): Set mtime. - * include/grub/datetime.h (grub_datetime2unixtime): New function. - * include/grub/hfs.h (grub_hfs_sblock): New fields ctime and mtime. - * include/grub/ntfs.h (grub_fshelp_node): New field mtime. + (VasEBoot_iso9660_read_symlink): Use node->dirent. + (VasEBoot_iso9660_iterate_dir): Likewise. + (VasEBoot_iso9660_dir): Set mtime. + (VasEBoot_iso9660_mtime): New function. + (VasEBoot_iso9660_fs): Register VasEBoot_iso9660_mtime. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_time): New struct. + (VasEBoot_jfs_inode): New fields atime, ctime and mtime. + (VasEBoot_jfs_dir): Set mtime. + * VasEBoot-core/fs/minix.c (VasEBoot_minix_dir): Likewise. + * VasEBoot-core/fs/ntfs.c (list_file): Set mtime. + (VasEBoot_ntfs_dir): Likewise. + * VasEBoot-core/fs/reiserfs.c (VasEBoot_fshelp_node): New field 'mtime'. + (VasEBoot_reiserfs_iterate_dir): Set mtime. + (VasEBoot_reiserfs_dir): Likewise. + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_obj): New field mtime. + (VasEBoot_fshelp_node): Likewise. + (VasEBoot_sfs_iterate_dir): Set mtime. + (VasEBoot_sfs_dir): Likewise. + * VasEBoot-core/fs/udf.c (VasEBoot_udf_dir): Set mtime. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_time): New struct. + (VasEBoot_xfs_inode): New fields atime, mtime, ctime. + (VasEBoot_xfs_dir): Set mtime. + * include/VasEBoot/datetime.h (VasEBoot_datetime2unixtime): New function. + * include/VasEBoot/hfs.h (VasEBoot_hfs_sblock): New fields ctime and mtime. + * include/VasEBoot/ntfs.h (VasEBoot_fshelp_node): New field mtime. Support UDF symlinks. - * grub-core/fs/udf.c (grub_udf_iterate_dir): Handle symlinks. - (grub_ufs_read_symlink): New function. All users updated. + * VasEBoot-core/fs/udf.c (VasEBoot_udf_iterate_dir): Handle symlinks. + (VasEBoot_ufs_read_symlink): New function. All users updated. Check amiga partmap checksum. - * grub-core/partmap/amiga.c (grub_amiga_rdsk): Pad to 128 bytes. - (grub_amiga_partition): Likewise. + * VasEBoot-core/partmap/amiga.c (VasEBoot_amiga_rdsk): Pad to 128 bytes. + (VasEBoot_amiga_partition): Likewise. (amiga_partition_map_checksum): New function. (amiga_partition_map_iterate): Check checksum. @@ -19936,122 +19936,122 @@ ROMFS support. - * Makefile.util.def (libgrubmods.a): Add romfs. - * grub-core/Makefile.core.def (romfs): New module. - * grub-core/fs/romfs.c: New file. + * Makefile.util.def (libVasEBootmods.a): Add romfs. + * VasEBoot-core/Makefile.core.def (romfs): New module. + * VasEBoot-core/fs/romfs.c: New file. 2011-05-15 Vladimir Serbinenko Squashfs v4 support. - * Makefile.util.def (libgrubmods.a): Add squash4. - * grub-core/Makefile.core.def (squash4): New module. - * grub-core/fs/squash4.c: New file. - * grub-core/io/gzio.c (grub_gzio): New members disk_input_off, + * Makefile.util.def (libVasEBootmods.a): Add squash4. + * VasEBoot-core/Makefile.core.def (squash4): New module. + * VasEBoot-core/fs/squash4.c: New file. + * VasEBoot-core/io/gzio.c (VasEBoot_gzio): New members disk_input_off, disk_input_start, disk_input. (get_byte): Handle disk_input. - (grub_zlib_disk_read): New function. - * include/grub/deflate.h (grub_zlib_disk_read): New proto. + (VasEBoot_zlib_disk_read): New function. + * include/VasEBoot/deflate.h (VasEBoot_zlib_disk_read): New proto. 2011-05-15 Vladimir Serbinenko 2011-05-15 Feiran Zheng - * Makefile.util.def (libgrubmods.a): Add minix3. - * grub-core/Makefile.core.def (minix3): New module. - * grub-core/fs/minix.c (GRUB_MINIX_MAGIC) [MODE_MINIX3]: New value. - (GRUB_MINIX_BSIZE): Removed. - (GRUB_MINIX_INODE_DIR_BLOCKS): New definition. All users updated. - (grub_minix_ino_t): New type. - (grub_minix_le_to_cpu_ino): New macro. - (GRUB_MINIX_ZONE2SECT): New definition. All users updated. - (grub_minix_sblock) [MODE_MINIX3]: Change for minix3. - (grub_minix_data): New field block_size. - (grub_minix_read_file): Handle 64-bit correctly. - * grub-core/fs/minix3.c: New file. + * Makefile.util.def (libVasEBootmods.a): Add minix3. + * VasEBoot-core/Makefile.core.def (minix3): New module. + * VasEBoot-core/fs/minix.c (VasEBoot_MINIX_MAGIC) [MODE_MINIX3]: New value. + (VasEBoot_MINIX_BSIZE): Removed. + (VasEBoot_MINIX_INODE_DIR_BLOCKS): New definition. All users updated. + (VasEBoot_minix_ino_t): New type. + (VasEBoot_minix_le_to_cpu_ino): New macro. + (VasEBoot_MINIX_ZONE2SECT): New definition. All users updated. + (VasEBoot_minix_sblock) [MODE_MINIX3]: Change for minix3. + (VasEBoot_minix_data): New field block_size. + (VasEBoot_minix_read_file): Handle 64-bit correctly. + * VasEBoot-core/fs/minix3.c: New file. 2011-05-15 Tristan Gingold -2011-05-15 Robert Millan +2011-05-15 Robert Millan 2011-05-15 Vladimir Serbinenko IA64 support. - * Makefile.util.def (libgrubmods.a): Add grub-core/kern/ia64/dl_helper.c + * Makefile.util.def (libVasEBootmods.a): Add VasEBoot-core/kern/ia64/dl_helper.c * configure.ac: Add ia64-efi target. Probe for __ia64_trampoline, __udivsi3, __umoddi3, __udivdi3, __divsi3, __modsi3, __umodsi3, __moddi3 and __divdi3 symbols. * gentpl.py: Add ia64_efi platform. Rename x86_efi to efi and Add ia64-efi. All users updated. - * grub-core/Makefile.am: Set KERNEL_HEADER_FILES for ia64-efi. - * grub-core/Makefile.core.def (kernel.img): Add compile flags for ia64. + * VasEBoot-core/Makefile.am: Set KERNEL_HEADER_FILES for ia64-efi. + * VasEBoot-core/Makefile.core.def (kernel.img): Add compile flags for ia64. Remove kern/generic/rtc_get_time_ms.c on EFI. Add kern/ia64/efi/startup.S, kern/ia64/efi/init.c, kern/ia64/dl.c, kern/ia64/dl_helper.c on ia64-efi. Add kern/emu/cache.c on emu. (linux): Use on loader/ia64/efi/linux.c on ia64. - * grub-core/gensymlist.sh (grub_register_exported_symbols): Check + * VasEBoot-core/gensymlist.sh (VasEBoot_register_exported_symbols): Check whether symbol is a function. - * grub-core/kern/dl.c [GRUB_MACHINE_EMU]: Include sys/mman.h. - (grub_symbol): New field 'isfunc'. - (grub_dl_resolve_symbol): Return whole symbol rather than just address. - (grub_dl_register_symbol): New argument 'isfunc'. All users updated. - (grub_dl_load_segments): Place all sections into the same region. + * VasEBoot-core/kern/dl.c [VasEBoot_MACHINE_EMU]: Include sys/mman.h. + (VasEBoot_symbol): New field 'isfunc'. + (VasEBoot_dl_resolve_symbol): Return whole symbol rather than just address. + (VasEBoot_dl_register_symbol): New argument 'isfunc'. All users updated. + (VasEBoot_dl_load_segments): Place all sections into the same region. [__ia64__]: Create trampolines and got. - [GRUB_MACHINE_EMU]: Call mprotect. - (grub_dl_resolve_symbols): Resolve symbol type as well. + [VasEBoot_MACHINE_EMU]: Call mprotect. + (VasEBoot_dl_resolve_symbols): Resolve symbol type as well. [__ia64__]: Create function descriptors. - * grub-core/kern/efi/efi.c (grub_get_rtc): Renamed to ... - (grub_rtc_get_time_ms): ... this. Expressions simplified. - (grub_get_rtc): New function. - * grub-core/kern/emu/cache.c [__ia64__]: New file. - * grub-core/kern/emu/cache.S: Renamed to ... - * grub-core/kern/emu/cache_s.S: ... this. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_get_rtc): Renamed to ... + (VasEBoot_rtc_get_time_ms): ... this. Expressions simplified. + (VasEBoot_get_rtc): New function. + * VasEBoot-core/kern/emu/cache.c [__ia64__]: New file. + * VasEBoot-core/kern/emu/cache.S: Renamed to ... + * VasEBoot-core/kern/emu/cache_s.S: ... this. [__ia64__]: Add a nop. - * grub-core/kern/emu/full.c (grub_arch_dl_get_tramp_got_size) + * VasEBoot-core/kern/emu/full.c (VasEBoot_arch_dl_get_tramp_got_size) [__ia64__]: New function. - * grub-core/kern/emu/lite.c [__ia64__]: Include ../ia64/dl.c. - * grub-core/kern/ia64/dl.c: New file. - * grub-core/kern/ia64/dl_helper.c: Likewise. - * grub-core/kern/ia64/efi/init.c: New file. - * grub-core/kern/ia64/efi/startup.S: Likewise. - * grub-core/lib/efi/halt.c [__ia64__]: Don't try acpi. - * grub-core/lib/ia64/longjmp.S: New file (from glibc). - * grub-core/lib/ia64/setjmp.S: Likewise (from glibc). - * grub-core/lib/setjmp.S [__ia64__]: Include ./ia64/setjmp.S. - * grub-core/loader/ia64/efi/linux.c: New file. - * include/grub/dl.h (GRUB_MOD_NAME): Redefined using C rather than asm. - (GRUB_MOD_DEP): Likewise. - (grub_dl) [__ia64__]: New fields got and tramp. - (grub_dl): New field 'base'. - (grub_dl_register_symbol): New argument isfunc. All users updated. - (GRUB_IA64_DL_TRAMP_ALIGN): New definition. - (GRUB_IA64_DL_TRAMP_SIZE): Likewise. - (GRUB_IA64_DL_GOT_ALIGN): Likewise. - (grub_ia64_dl_get_tramp_got_size): New proto. - (GRUB_ARCH_DL_TRAMP_ALIGN) [__ia64__]: Likewise - (GRUB_ARCH_DL_GOT_ALIGN) [__ia64__]: Likewise - (grub_arch_dl_get_tramp_got_size) [__ia64__]: Likewise - * include/grub/efi/api.h: Skip call wrappers on ia64. - * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_IA64): New definition. - * include/grub/efi/time.h (GRUB_TICKS_PER_SECOND): Change to 1000. - * include/grub/elf.h (ELF_ST_INFO): New definition. - * include/grub/ia64/efi/kernel.h: New file. - * include/grub/ia64/efi/memory.h: Likewise. - * include/grub/ia64/efi/time.h: Likewise. - * include/grub/ia64/kernel.h: Likewise. - * include/grub/ia64/setjmp.h: Likewise (from glibc). - * include/grub/ia64/time.h: New file. - * include/grub/ia64/types.h: Likewise. - * include/grub/libgcc.h (__udivsi3, __umodsi3, __umoddi3, __udivdi3, + * VasEBoot-core/kern/emu/lite.c [__ia64__]: Include ../ia64/dl.c. + * VasEBoot-core/kern/ia64/dl.c: New file. + * VasEBoot-core/kern/ia64/dl_helper.c: Likewise. + * VasEBoot-core/kern/ia64/efi/init.c: New file. + * VasEBoot-core/kern/ia64/efi/startup.S: Likewise. + * VasEBoot-core/lib/efi/halt.c [__ia64__]: Don't try acpi. + * VasEBoot-core/lib/ia64/longjmp.S: New file (from glibc). + * VasEBoot-core/lib/ia64/setjmp.S: Likewise (from glibc). + * VasEBoot-core/lib/setjmp.S [__ia64__]: Include ./ia64/setjmp.S. + * VasEBoot-core/loader/ia64/efi/linux.c: New file. + * include/VasEBoot/dl.h (VasEBoot_MOD_NAME): Redefined using C rather than asm. + (VasEBoot_MOD_DEP): Likewise. + (VasEBoot_dl) [__ia64__]: New fields got and tramp. + (VasEBoot_dl): New field 'base'. + (VasEBoot_dl_register_symbol): New argument isfunc. All users updated. + (VasEBoot_IA64_DL_TRAMP_ALIGN): New definition. + (VasEBoot_IA64_DL_TRAMP_SIZE): Likewise. + (VasEBoot_IA64_DL_GOT_ALIGN): Likewise. + (VasEBoot_ia64_dl_get_tramp_got_size): New proto. + (VasEBoot_ARCH_DL_TRAMP_ALIGN) [__ia64__]: Likewise + (VasEBoot_ARCH_DL_GOT_ALIGN) [__ia64__]: Likewise + (VasEBoot_arch_dl_get_tramp_got_size) [__ia64__]: Likewise + * include/VasEBoot/efi/api.h: Skip call wrappers on ia64. + * include/VasEBoot/efi/pe32.h (VasEBoot_PE32_MACHINE_IA64): New definition. + * include/VasEBoot/efi/time.h (VasEBoot_TICKS_PER_SECOND): Change to 1000. + * include/VasEBoot/elf.h (ELF_ST_INFO): New definition. + * include/VasEBoot/ia64/efi/kernel.h: New file. + * include/VasEBoot/ia64/efi/memory.h: Likewise. + * include/VasEBoot/ia64/efi/time.h: Likewise. + * include/VasEBoot/ia64/kernel.h: Likewise. + * include/VasEBoot/ia64/setjmp.h: Likewise (from glibc). + * include/VasEBoot/ia64/time.h: New file. + * include/VasEBoot/ia64/types.h: Likewise. + * include/VasEBoot/libgcc.h (__udivsi3, __umodsi3, __umoddi3, __udivdi3, __moddi3, __divdi3, __divsi3, __modsi3, __ia64_trampoline): New protos. - * include/grub/offsets.h (GRUB_KERNEL_IA64_EFI_PREFIX): New definition. - (GRUB_KERNEL_IA64_EFI_PREFIX_END): Likewise. - * include/grub/types.h (PRIxGRUB_ADDR): Likewise. - * util/grub-mkimage.c (image_target_desc): New field pe_target. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_IA64_EFI_PREFIX): New definition. + (VasEBoot_KERNEL_IA64_EFI_PREFIX_END): Likewise. + * include/VasEBoot/types.h (PRIxVasEBoot_ADDR): Likewise. + * util/VasEBoot-mkimage.c (image_target_desc): New field pe_target. All users updated. (EFI64_HEADER_SIZE): New definition. All users updated. (image_targets): Add ia64-efi. - * util/grub-mkimagexx.c (relocate_symbols): New arguments jumpers and + * util/VasEBoot-mkimagexx.c (relocate_symbols): New arguments jumpers and jumpers_addr. All users updated. Create function descriptors. (count_funcs): New function. @@ -20072,7 +20072,7 @@ 2011-05-15 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_read_logical): Silence spurious + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_read_logical): Silence spurious warning. Move variables before code while on it. 2011-05-15 Vladimir Serbinenko @@ -20080,117 +20080,117 @@ Fuloong support. * configure.ac: Rename yeeloong platform to loongson. All users updated. - * grub-core/Makefile.core.def (fwstart_fuloong): New image. - * grub-core/boot/mips/loongson/fuloong.S: New file. - * grub-core/boot/mips/loongson/fwstart.S: Wait for CS5536 to come up. + * VasEBoot-core/Makefile.core.def (fwstart_fuloong): New image. + * VasEBoot-core/boot/mips/loongson/fuloong.S: New file. + * VasEBoot-core/boot/mips/loongson/fwstart.S: Wait for CS5536 to come up. Explicitly init CS5536. [FULOONG]: Don't use serial until CS5536 is available. Set GPIO based on dumps. (serial_hw_init) [FULOONG]: Handle CS5536 parts. [FULOONG]: Handle GPIO and memory controller differences. Parse machine type in $a2. - * grub-core/boot/mips/startup_raw.S: Determine and save the + * VasEBoot-core/boot/mips/startup_raw.S: Determine and save the architecture. - * grub-core/bus/cs5536.c (gpiodump): Move to fwstart.S. - (grub_cs5536_init_geode): Remove gpio part. Conditionalise DIVIL + * VasEBoot-core/bus/cs5536.c (gpiodump): Move to fwstart.S. + (VasEBoot_cs5536_init_geode): Remove gpio part. Conditionalise DIVIL init on architecture type. - * grub-core/kern/mips/loongson/init.c (grub_machine_init): Init + * VasEBoot-core/kern/mips/loongson/init.c (VasEBoot_machine_init): Init SIS315E. Don't init at_keyboard on fuloong. - (grub_halt): Support Fuloong. - * grub-core/kern/mips/startup.S [LOONGSON]: Save $s7. - * grub-core/loader/mips/linux.c (LOONGSON_MACHTYPE): Removed. + (VasEBoot_halt): Support Fuloong. + * VasEBoot-core/kern/mips/startup.S [LOONGSON]: Save $s7. + * VasEBoot-core/loader/mips/linux.c (LOONGSON_MACHTYPE): Removed. (loongson_machtypes): New array. - (grub_cmd_linux) [GRUB_MACHINE_MIPS_LOONGSON]: Pass the right machine + (VasEBoot_cmd_linux) [VasEBoot_MACHINE_MIPS_LOONGSON]: Pass the right machine type. - * grub-core/term/ns8250.c (serial_get_divisor): New parameter port and + * VasEBoot-core/term/ns8250.c (serial_get_divisor): New parameter port and config. All users updated. Handle CS5536 serial. - * grub-core/term/serial.c (grub_serial_register): Conditionalise + * VasEBoot-core/term/serial.c (VasEBoot_serial_register): Conditionalise default port on machine type. Register serial as inactive. - * grub-core/video/sis315pro.c: New file. - * include/grub/cs5536.h (GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED): New + * VasEBoot-core/video/sis315pro.c: New file. + * include/VasEBoot/cs5536.h (VasEBoot_CS5536_MSR_MAILBOX_CONFIG_ENABLED): New definition. - (GRUB_CS5536_MSR_MAILBOX_CONFIG): Likewise. - (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1): Likewise. - (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3): Likewise. - (GRUB_CS5536_MSR_DIVIL_UART1_CONF): Likewise. - (GRUB_CS5536_MSR_DIVIL_UART2_CONF): Likewise. - * include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_SHUTDOWN_GPIO): Rename + (VasEBoot_CS5536_MSR_MAILBOX_CONFIG): Likewise. + (VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1): Likewise. + (VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3): Likewise. + (VasEBoot_CS5536_MSR_DIVIL_UART1_CONF): Likewise. + (VasEBoot_CS5536_MSR_DIVIL_UART2_CONF): Likewise. + * include/VasEBoot/mips/loongson.h (VasEBoot_CPU_LOONGSON_SHUTDOWN_GPIO): Rename to ... - (GRUB_CPU_YEELOONG_SHUTDOWN_GPIO): ... this. - * include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_YEELOONG): New + (VasEBoot_CPU_YEELOONG_SHUTDOWN_GPIO): ... this. + * include/VasEBoot/mips/loongson/kernel.h (VasEBoot_ARCH_MACHINE_YEELOONG): New definition. - (GRUB_ARCH_MACHINE_FULOONG): Likewise. - (grub_arch_machine): New extern var. - * include/grub/mips/loongson/serial.h - (GRUB_MACHINE_SERIAL_DIVISOR_115200): Renamed to ... - (GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200): ... this. - (GRUB_MACHINE_SERIAL_PORT): Renamed to ... - (GRUB_MACHINE_SERIAL_PORT0): ... this. - (GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200): New definition. - (GRUB_MACHINE_SERIAL_PORT1): Likewise. - (GRUB_MACHINE_SERIAL_PORT2): Likewise. - (GRUB_MACHINE_SERIAL_PORTS): Include ports 1 and 2. - * include/grub/term.h (grub_term_register_input_inactive): New inline + (VasEBoot_ARCH_MACHINE_FULOONG): Likewise. + (VasEBoot_arch_machine): New extern var. + * include/VasEBoot/mips/loongson/serial.h + (VasEBoot_MACHINE_SERIAL_DIVISOR_115200): Renamed to ... + (VasEBoot_MACHINE_SERIAL_PORT0_DIVISOR_115200): ... this. + (VasEBoot_MACHINE_SERIAL_PORT): Renamed to ... + (VasEBoot_MACHINE_SERIAL_PORT0): ... this. + (VasEBoot_MACHINE_SERIAL_PORT2_DIVISOR_115200): New definition. + (VasEBoot_MACHINE_SERIAL_PORT1): Likewise. + (VasEBoot_MACHINE_SERIAL_PORT2): Likewise. + (VasEBoot_MACHINE_SERIAL_PORTS): Include ports 1 and 2. + * include/VasEBoot/term.h (VasEBoot_term_register_input_inactive): New inline function. - (grub_term_register_output_inactive): Likewise. - * include/grub/video.h (grub_video_driver_id): New value - GRUB_VIDEO_DRIVER_SIS315PRO. - * util/grub-mkimage.c (image_target_desc): Rename name to dirname. + (VasEBoot_term_register_output_inactive): Likewise. + * include/VasEBoot/video.h (VasEBoot_video_driver_id): New value + VasEBoot_VIDEO_DRIVER_SIS315PRO. + * util/VasEBoot-mkimage.c (image_target_desc): Rename name to dirname. New field "names". All users updated. New field value IMAGE_FULOONG_FLASH. (generate_image): USe separate fwstart hashes for yeeloong and fuloong. 2011-05-14 Jordan Uggla - * docs/grub.texi (Invoking grub-install): Fix additional outdated claims + * docs/VasEBoot.texi (Invoking VasEBoot-install): Fix additional outdated claims and add some clarification. 2011-05-14 Vladimir Serbinenko - * util/grub.d/10_linux.in: Autoload gzio since it's needed on some + * util/VasEBoot.d/10_linux.in: Autoload gzio since it's needed on some platforms if kernel is compressed. 2011-05-14 Vladimir Serbinenko - * grub-core/kern/mm.c (grub_memalign): Disable auto-unloadding of + * VasEBoot-core/kern/mm.c (VasEBoot_memalign): Disable auto-unloadding of unused modules since currently referrence counter isn't reliable and there isn't much memory to recover there anyway. 2011-05-14 Vladimir Serbinenko - * grub-core/kern/dl.c (grub_dl_load_file): Decrease ref counter + * VasEBoot-core/kern/dl.c (VasEBoot_dl_load_file): Decrease ref counter rather than resetting it to allow modules to reference themselves in init. 2011-05-14 Vladimir Serbinenko - * grub-core/kern/dl.c (grub_dl_unload): Don't decrease reference - counter on dependencies since grub_dl_unref already handles this. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_unload): Don't decrease reference + counter on dependencies since VasEBoot_dl_unref already handles this. 2011-05-14 Vladimir Serbinenko - * grub-core/font/font_cmd.c (loadfont_command): Set grub_errno + * VasEBoot-core/font/font_cmd.c (loadfont_command): Set VasEBoot_errno on error if not already done. 2011-05-14 Vladimir Serbinenko Fix few potential memory misusage. - * grub-core/font/font.c (load_font_index): Don't free char_index to + * VasEBoot-core/font/font.c (load_font_index): Don't free char_index to avoid double free. - (grub_font_load): Zero-fill font at alloc for safety. + (VasEBoot_font_load): Zero-fill font at alloc for safety. Close file on error. (free_font): Free bmp_idx. 2011-05-14 Vladimir Serbinenko - * docs/grub.texi (Installation): Fix several outdated claims. + * docs/VasEBoot.texi (Installation): Fix several outdated claims. 2011-05-14 Vladimir Serbinenko Handle module_license on windows. - * util/grub-pe2elf.c (MODLICENSE_SECTION): New definition. All following + * util/VasEBoot-pe2elf.c (MODLICENSE_SECTION): New definition. All following sections shifted. (insert_string): Make argument const char * instead of char *. (write_section_data): Handle long section names. @@ -20198,13 +20198,13 @@ 2011-05-14 Vladimir Serbinenko - * grub-core/commands/menuentry.c (grub_cmd_menuentry): Correctly + * VasEBoot-core/commands/menuentry.c (VasEBoot_cmd_menuentry): Correctly handle class-free menuentries. - (grub_normal_add_menu_entry): Add a check to be sure. + (VasEBoot_normal_add_menu_entry): Add a check to be sure. 2011-05-14 Vladimir Serbinenko - * grub-core/term/at_keyboard.c (set1_e0_mapping): Fix swap between + * VasEBoot-core/term/at_keyboard.c (set1_e0_mapping): Fix swap between PgUp and PgDown. 2011-05-13 Vladimir Serbinenko @@ -20216,87 +20216,87 @@ Give ATA device a bit more time on first try in order to allow disks to spin up. - * grub-core/disk/ata.c (grub_atapi_identify): Use GRUB_ATA_TOUT_DEV_INIT + * VasEBoot-core/disk/ata.c (VasEBoot_atapi_identify): Use VasEBoot_ATA_TOUT_DEV_INIT if dev->present is 1. Reset dev->present on failure. - (grub_ata_device_initialize): Set dev->present to 1. - * include/grub/ata.h (GRUB_ATA_TOUT_DEV_INIT): New value. - (grub_ata_device): New member 'present'. + (VasEBoot_ata_device_initialize): Set dev->present to 1. + * include/VasEBoot/ata.h (VasEBoot_ATA_TOUT_DEV_INIT): New value. + (VasEBoot_ata_device): New member 'present'. 2011-05-13 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Update hash. + * util/VasEBoot-mkimage.c (generate_image): Update hash. 2011-05-13 Vladimir Serbinenko Flush caches on DMA memory. - * grub-core/kern/mips/cache.S (grub_arch_sync_dma_caches): New function. - * grub-core/bus/pci.c (grub_memalign_dma32): Flush caches. - (grub_dma_free): Likewise. - * include/grub/cache.h (grub_arch_sync_dma_caches): New declaration. + * VasEBoot-core/kern/mips/cache.S (VasEBoot_arch_sync_dma_caches): New function. + * VasEBoot-core/bus/pci.c (VasEBoot_memalign_dma32): Flush caches. + (VasEBoot_dma_free): Likewise. + * include/VasEBoot/cache.h (VasEBoot_arch_sync_dma_caches): New declaration. 2011-05-13 Vladimir Serbinenko - * grub-core/boot/mips/yeeloong/fwstart.S: Add explicit set mips3 + * VasEBoot-core/boot/mips/yeeloong/fwstart.S: Add explicit set mips3 to avoid asm treating ld and sd as macros. 2011-05-13 Vladimir Serbinenko - * grub-core/boot/mips/startup_raw.S: Flush cache after loading + * VasEBoot-core/boot/mips/startup_raw.S: Flush cache after loading decompressor. 2011-05-13 Vladimir Serbinenko - * grub-core/boot/mips/startup_raw.S: Use jalr rather than bal to call - grub_decompress_core since later would fail if grub_decompress_core + * VasEBoot-core/boot/mips/startup_raw.S: Use jalr rather than bal to call + VasEBoot_decompress_core since later would fail if VasEBoot_decompress_core is too far. 2011-05-13 Vladimir Serbinenko - * grub-core/kern/mips/dl.c (grub_arch_dl_relocate_symbols): Handle + * VasEBoot-core/kern/mips/dl.c (VasEBoot_arch_dl_relocate_symbols): Handle R_MIPS_JALR since it's used by newer compiler. 2011-05-10 Vladimir Serbinenko - * util/grub.d/10_linux.in: Correctly handle the Linux in root. + * util/VasEBoot.d/10_linux.in: Correctly handle the Linux in root. 2011-05-09 Vladimir Serbinenko - * grub-core/loader/efi/chainloader.c (grub_chainloader_unload): Set + * VasEBoot-core/loader/efi/chainloader.c (VasEBoot_chainloader_unload): Set file_path to 0 for surety. - (grub_chainloader_boot): Set exit_data to NULL. + (VasEBoot_chainloader_boot): Set exit_data to NULL. Unset the loader once done. - (grub_cmd_chainloader): Fix confusing error message if file is empty. + (VasEBoot_cmd_chainloader): Fix confusing error message if file is empty. 2011-05-09 Vladimir Serbinenko - * grub-core/term/at_keyboard.c (fetch_key): Make a printf on + * VasEBoot-core/term/at_keyboard.c (fetch_key): Make a printf on unknown key into a dprintf. 2011-05-09 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (linux_find_partition): Don't abort + * VasEBoot-core/kern/emu/hostdisk.c (linux_find_partition): Don't abort on first non-existant partition. 2011-05-09 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (open_device): Set data->fd to -1 if + * VasEBoot-core/kern/emu/hostdisk.c (open_device): Set data->fd to -1 if openning fails. Reported by: Mark Korenberg. 2011-05-09 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (linux_find_partition): Prevent possible + * VasEBoot-core/kern/emu/hostdisk.c (linux_find_partition): Prevent possible overflow. 2011-05-09 Vladimir Serbinenko - * util/grub-mkimage.c (main): Explicitely flush and sync the output - before closing to ensure that it will be readable by grub-setup. + * util/VasEBoot-mkimage.c (main): Explicitely flush and sync the output + before closing to ensure that it will be readable by VasEBoot-setup. 2011-05-05 Vladimir Serbinenko - * grub-core/loader/efi/appleloader.c (MAKE_PIWG_PATH): New macro. + * VasEBoot-core/loader/efi/appleloader.c (MAKE_PIWG_PATH): New macro. (devpath_1): Use MAKE_PIWG_PATH. (devpath_2): Likewise. (devpath_3): Likewise. @@ -20311,35 +20311,35 @@ Support 2010 Macbooks. - * grub-core/loader/efi/appleloader.c (devpath_6): New variable. + * VasEBoot-core/loader/efi/appleloader.c (devpath_6): New variable. (devs): Add devpath_6. 2011-05-05 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c (main): Use /dev/urandom and not + * util/VasEBoot-mkpasswd-pbkdf2.c (main): Use /dev/urandom and not /dev/random. /dev/urandom is good enough for our purposes (salting). 2011-05-05 Vladimir Serbinenko - * util/grub-mkrescue.in (process_input_dir): Include efiemu??.o. + * util/VasEBoot-mkrescue.in (process_input_dir): Include efiemu??.o. 2011-05-05 Vladimir Serbinenko - * grub-core/lib/legacy_parse.c (grub_legacy_parse): Correctly handle + * VasEBoot-core/lib/legacy_parse.c (VasEBoot_legacy_parse): Correctly handle hexadecimal. 2011-05-05 Vladimir Serbinenko - * grub-core/efiemu/main.c (grub_efiemu_load_file): Return grub_errno + * VasEBoot-core/efiemu/main.c (VasEBoot_efiemu_load_file): Return VasEBoot_errno and not 0 on failure. 2011-05-03 Colin Watson - * grub-core/fs/i386/pc/pxe.c (grub_pxefs_dir): Return - GRUB_ERR_BAD_FS rather than GRUB_ERR_IO if the disk is not a pxe - disk; otherwise grub_fs_probe will not fall back to the next + * VasEBoot-core/fs/i386/pc/pxe.c (VasEBoot_pxefs_dir): Return + VasEBoot_ERR_BAD_FS rather than VasEBoot_ERR_IO if the disk is not a pxe + disk; otherwise VasEBoot_fs_probe will not fall back to the next filesystem. - (grub_pxefs_open): Likewise, for consistency. + (VasEBoot_pxefs_open): Likewise, for consistency. Reported and tested by: Ezekiel Grave. 2011-05-03 Colin Watson @@ -20349,28 +20349,28 @@ 2011-05-01 Colin Watson - * docs/grub.texi (GRUB only offers a rescue shell): Suggest the use + * docs/VasEBoot.texi (VasEBoot only offers a rescue shell): Suggest the use of `ls' to find out which devices are available. 2011-04-25 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_linux_boot): Supply target rather + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Supply target rather than source address for efi mmap buffer. 2011-04-25 Vladimir Serbinenko - * grub-core/partmap/amiga.c (amiga_partition_map_iterate): Fix a + * VasEBoot-core/partmap/amiga.c (amiga_partition_map_iterate): Fix a wrong action on non-detecting the magic. 2011-04-25 Vladimir Serbinenko - * grub-core/gnulib/regex.c: Remove GRUB_MOD_LICENSE since it's + * VasEBoot-core/gnulib/regex.c: Remove VasEBoot_MOD_LICENSE since it's already supplied by another part of the module (fixes compilation on FreeBSD). 2011-04-25 Vladimir Serbinenko - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Make mdraid UUID + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Make mdraid UUID match the one used by mdadm. 2011-04-21 Colin Watson @@ -20382,33 +20382,33 @@ Add "SEE ALSO" sections to most man pages. Fixes Debian bug #551428. - * docs/man/grub-editenv.h2m (SEE ALSO): New section. - * docs/man/grub-emu.h2m (SEE ALSO): Likewise. - * docs/man/grub-fstest.h2m (SEE ALSO): Likewise. - * docs/man/grub-install.h2m (SEE ALSO): Likewise. - * docs/man/grub-macho2img.h2m (SEE ALSO): Likewise. - * docs/man/grub-menulst2cfg.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkconfig.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkdevicemap.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkfont.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkimage.h2m (SEE ALSO): Likewise. - * docs/man/grub-mklayout.h2m (SEE ALSO): Likewise. - * docs/man/grub-mknetdir.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkpasswd-pbkdf2.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkrelpath.h2m (SEE ALSO): Likewise. - * docs/man/grub-mkrescue.h2m (SEE ALSO): Likewise. - * docs/man/grub-ofpathname.h2m (SEE ALSO): Likewise. - * docs/man/grub-pe2elf.h2m (SEE ALSO): Likewise. - * docs/man/grub-probe.h2m (SEE ALSO): Likewise. - * docs/man/grub-reboot.h2m (SEE ALSO): Likewise. - * docs/man/grub-script-check.h2m (SEE ALSO): Likewise. - * docs/man/grub-set-default.h2m (SEE ALSO): Likewise. - * docs/man/grub-setup.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-editenv.h2m (SEE ALSO): New section. + * docs/man/VasEBoot-emu.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-fstest.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-install.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-macho2img.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-menulst2cfg.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkconfig.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkdevicemap.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkfont.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkimage.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mklayout.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mknetdir.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkpasswd-pbkdf2.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkrelpath.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-mkrescue.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-ofpathname.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-pe2elf.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-probe.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-reboot.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-script-check.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-set-default.h2m (SEE ALSO): Likewise. + * docs/man/VasEBoot-setup.h2m (SEE ALSO): Likewise. 2011-04-21 Colin Watson - * grub-core/kern/emu/getroot.c - (grub_find_root_device_from_mountinfo): Remove non-virtual-device + * VasEBoot-core/kern/emu/getroot.c + (VasEBoot_find_root_device_from_mountinfo): Remove non-virtual-device test that was incorrectly reintroduced in r3214. Reported by: Ian Dall. Fixes Savannah bug #33133. @@ -20416,8 +20416,8 @@ Fix stack pointer handling in 16-bit relocator. - * grub-core/lib/i386/relocator16.S (grub_relocator16_start): Move - grub_relocator16_sp to %esp rather than %ss, and zero-extend it. + * VasEBoot-core/lib/i386/relocator16.S (VasEBoot_relocator16_start): Move + VasEBoot_relocator16_sp to %esp rather than %ss, and zero-extend it. Fixes Ubuntu bug #683904. 2011-04-20 Vladimir Serbinenko @@ -20426,71 +20426,71 @@ 2011-04-20 Vladimir Serbinenko - * include/grub/dl.h [ASM_FILE]: Adapt for assembly. - * grub-core/lib/i386/setjmp.S: Add missing GRUB_MOD_LICENSE. - * grub-core/lib/x86_64/setjmp.S: Likewise. - * grub-core/lib/mips/setjmp.S: Likewise. - * grub-core/lib/powerpc/setjmp.S: Likewise. - * grub-core/lib/sparc64/setjmp.S: Likewise. + * include/VasEBoot/dl.h [ASM_FILE]: Adapt for assembly. + * VasEBoot-core/lib/i386/setjmp.S: Add missing VasEBoot_MOD_LICENSE. + * VasEBoot-core/lib/x86_64/setjmp.S: Likewise. + * VasEBoot-core/lib/mips/setjmp.S: Likewise. + * VasEBoot-core/lib/powerpc/setjmp.S: Likewise. + * VasEBoot-core/lib/sparc64/setjmp.S: Likewise. 2011-04-20 Vladimir Serbinenko - * grub-core/lib/efi/datetime.c: Add missing GRUB_MOD_LICENSE. - * grub-core/lib/efi/datetime.c: Likewise. + * VasEBoot-core/lib/efi/datetime.c: Add missing VasEBoot_MOD_LICENSE. + * VasEBoot-core/lib/efi/datetime.c: Likewise. 2011-04-19 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_flush): + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_flush): New function. - (grub_util_biosdisk_close): Use grub_util_biosdisk_flush. - * include/grub/emu/hostdisk.h (grub_util_biosdisk_flush): New proto. - * util/grub-setup.c (setup): Use grub_util_biosdisk_flush. + (VasEBoot_util_biosdisk_close): Use VasEBoot_util_biosdisk_flush. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_biosdisk_flush): New proto. + * util/VasEBoot-setup.c (setup): Use VasEBoot_util_biosdisk_flush. 2011-04-19 Vladimir Serbinenko - * grub-core/term/gfxterm.c (grub_gfxterm_fullscreen): Preserve previous + * VasEBoot-core/term/gfxterm.c (VasEBoot_gfxterm_fullscreen): Preserve previous bitmap. - (grub_gfxterm_term_init): Likewise. + (VasEBoot_gfxterm_term_init): Likewise. 2011-04-19 Vladimir Serbinenko Take into account the decorations the computing menu entry width. - * grub-core/gfxmenu/widget-box.c (get_border_width): New function. - (grub_gfxmenu_create_box): Register get_border_width. - * grub-core/gfxmenu/gui_list.c (draw_menu): Use get_border_width + * VasEBoot-core/gfxmenu/widget-box.c (get_border_width): New function. + (VasEBoot_gfxmenu_create_box): Register get_border_width. + * VasEBoot-core/gfxmenu/gui_list.c (draw_menu): Use get_border_width if available. - * include/grub/gfxwidgets.h (grub_gfxmenu_box): New member + * include/VasEBoot/gfxwidgets.h (VasEBoot_gfxmenu_box): New member get_border_width. 2011-04-18 Endres Puschner - * grub-core/gfxmenu/icon_manager.c (grub_gfxmenu_icon_manager_get_icon): + * VasEBoot-core/gfxmenu/icon_manager.c (VasEBoot_gfxmenu_icon_manager_get_icon): Don't skip first class. 2011-04-18 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_read_logical): Support huge + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_read_logical): Support huge chunks. - * include/grub/err.h (grub_err_t): New enum value GRUB_ERR_BUG. + * include/VasEBoot/err.h (VasEBoot_err_t): New enum value VasEBoot_ERR_BUG. 2011-04-18 Vladimir Serbinenko Complete 64-bit division support. - * grub-core/kern/misc.c (grub_divmod64): Rename to ... - (grub_divmod64_full): ... this. Support 64-bit divisor and reminder. - * include/grub/misc.h (grub_divmod64): Rename to ... - (grub_divmod64_full): ... this. - (grub_divmod64): New inline function. + * VasEBoot-core/kern/misc.c (VasEBoot_divmod64): Rename to ... + (VasEBoot_divmod64_full): ... this. Support 64-bit divisor and reminder. + * include/VasEBoot/misc.h (VasEBoot_divmod64): Rename to ... + (VasEBoot_divmod64_full): ... this. + (VasEBoot_divmod64): New inline function. 2011-04-18 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Add forgotten comma. + * util/VasEBoot-mkimage.c (generate_image): Add forgotten comma. 2011-04-18 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Update fwstart.img hash after + * util/VasEBoot-mkimage.c (generate_image): Update fwstart.img hash after performing the necessary test. 2011-04-17 Vladimir Serbinenko @@ -20504,39 +20504,39 @@ Identify RAID by its UUID rather than (guessed) name. - * grub-core/disk/raid.c (ascii2hex): New function. - (grub_raid_open): Accept mduuid/%s specification. - * grub-core/kern/emu/getroot.c (get_mdadm_name): Revamped into ... + * VasEBoot-core/disk/raid.c (ascii2hex): New function. + (VasEBoot_raid_open): Accept mduuid/%s specification. + * VasEBoot-core/kern/emu/getroot.c (get_mdadm_name): Revamped into ... (get_mdadm_uuid): ... this. - (grub_util_get_grub_dev): Use mduuid/%s if UUID is available. + (VasEBoot_util_get_VasEBoot_dev): Use mduuid/%s if UUID is available. 2011-04-16 Vladimir Serbinenko - * grub-core/gfxmenu/gui_image.c (rescale_image): Don't attempt to scale + * VasEBoot-core/gfxmenu/gui_image.c (rescale_image): Don't attempt to scale to negative size. 2011-04-13 Colin Watson - * util/grub.d/10_linux.in: Add rootflags=subvol= if / is on a + * util/VasEBoot.d/10_linux.in: Add rootflags=subvol= if / is on a btrfs subvolume. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2011-04-13 Colin Watson Rewrite /proc/self/mountinfo handling to cope with bind-mounts and move-mounts appearing out of order. Fixes Ubuntu bug #738345. - * grub-core/kern/emu/getroot.c (find_root_device_from_mountinfo): + * VasEBoot-core/kern/emu/getroot.c (find_root_device_from_mountinfo): Build a list of relevant visible mounts using the mnt_id and parent_mnt_id fields, and then scan that list at the end. 2011-04-12 Colin Watson - * docs/grub.texi (normal): New section. + * docs/VasEBoot.texi (normal): New section. (normal_exit): New section. (Embedded configuration): Add reference to normal. - (GRUB only offers a rescue shell): Likewise. - * docs/grub-dev.texi (Error Handling): Fix typo. + (VasEBoot only offers a rescue shell): Likewise. + * docs/VasEBoot-dev.texi (Error Handling): Fix typo. 2011-04-12 Colin Watson @@ -20556,128 +20556,128 @@ BtrFS support. Written by me (Vladimir) with important bugfixes and even more important testing by Colin. - * Makefile.util.def (libgrubmods.a): Add crc.c and gzio.c - * grub-core/Makefile.core.def (btrfs): Add crc.c. - * grub-core/fs/btrfs.c: Stub replaced with real implementation. - * grub-core/io/gzio.c (grub_gzio): New fields mem_input_size, + * Makefile.util.def (libVasEBootmods.a): Add crc.c and gzio.c + * VasEBoot-core/Makefile.core.def (btrfs): Add crc.c. + * VasEBoot-core/fs/btrfs.c: Stub replaced with real implementation. + * VasEBoot-core/io/gzio.c (VasEBoot_gzio): New fields mem_input_size, mem_input_off and mem_input. All users updated to accept in-RAM input. (gzio_seek): New function. (test_zlib_header): Likewise. - (grub_gzio_read): Likewise. - (grub_zlib_decompress): Likewise. - * grub-core/kern/emu/getroot.c (grub_find_root_device_from_mountinfo): + (VasEBoot_gzio_read): Likewise. + (VasEBoot_zlib_decompress): Likewise. + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_find_root_device_from_mountinfo): Accept partial and non-virtual mounts. - (grub_guess_root_device): Do rescanning after device_from_mountinfo to + (VasEBoot_guess_root_device): Do rescanning after device_from_mountinfo to avoid receiving /dev/dm-X as device. - * grub-core/kern/emu/misc.c (grub_make_system_path_relative_to_its_root): + * VasEBoot-core/kern/emu/misc.c (VasEBoot_make_system_path_relative_to_its_root): Handle bind and partial mounts. - * grub-core/lib/crc.c: New file. - * include/grub/deflate.h: Likewise. - * include/grub/emu/misc.h (grub_find_root_device_from_mountinfo): New + * VasEBoot-core/lib/crc.c: New file. + * include/VasEBoot/deflate.h: Likewise. + * include/VasEBoot/emu/misc.h (VasEBoot_find_root_device_from_mountinfo): New proto. - * include/grub/lib/crc.h: New file. + * include/VasEBoot/lib/crc.h: New file. 2011-04-11 Vladimir Serbinenko Implement automatic module license checking according to new GNU guidelines. - * grub-core/kern/dl.c (grub_dl_check_license): New function. - (grub_dl_load_core): Use grub_dl_check_license. - * include/grub/dl.h (GRUB_MOD_SECTION): New macro. - (GRUB_MOD_LICENSE): Likewise. - (GRUB_MOD_DUAL_LICENSE): Likewise. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_check_license): New function. + (VasEBoot_dl_load_core): Use VasEBoot_dl_check_license. + * include/VasEBoot/dl.h (VasEBoot_MOD_SECTION): New macro. + (VasEBoot_MOD_LICENSE): Likewise. + (VasEBoot_MOD_DUAL_LICENSE): Likewise. All modules updated. 2011-04-11 Colin Watson - * grub-core/fs/btrfs.c (grub_btrfs_fs) [GRUB_UTIL]: Set + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_fs) [VasEBoot_UTIL]: Set reserved_first_sector to 1. btrfs reserves plenty of space for boot loaders. Reported by: Gene Cumm. Fixes Ubuntu bug #757446. 2011-04-11 Vladimir Serbinenko - * util/grub-fstest.c (cmd_cmp): Check that sizes match. + * util/VasEBoot-fstest.c (cmd_cmp): Check that sizes match. 2011-04-11 Vladimir Serbinenko - * util/grub-fstest.c (read_file): Report GRUB error if file opening + * util/VasEBoot-fstest.c (read_file): Report VasEBoot error if file opening failed. 2011-04-11 Vladimir Serbinenko - * grub-core/kern/file.c (grub_file_open): Don't take into account the + * VasEBoot-core/kern/file.c (VasEBoot_file_open): Don't take into account the parenthesis in the middle of the filename. 2011-04-10 Vladimir Serbinenko - * grub-core/loader/mips/linux.c (grub_cmd_initrd): Use correct limits + * VasEBoot-core/loader/mips/linux.c (VasEBoot_cmd_initrd): Use correct limits rather than trying to put initrd way too high. Reported by: Ryan Lortie 2011-04-10 Vladimir Serbinenko - * grub-core/boot/mips/yeeloong/fwstart.S (no_cs5536): Put back + * VasEBoot-core/boot/mips/yeeloong/fwstart.S (no_cs5536): Put back improperly removed string. 2011-04-10 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_data): New member + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_data): New member is_disk. - (grub_util_biosdisk_open): Don't apply ioctl on non-disk devices. + (VasEBoot_util_biosdisk_open): Don't apply ioctl on non-disk devices. (open_device) Likewise. - (grub_util_biosdisk_close): Likewise. + (VasEBoot_util_biosdisk_close): Likewise. Reported by: Mark Korenberg. 2011-04-10 Alexander Kurtz - * util/grub-mkconfig_lib.in: Add missing quotes. + * util/VasEBoot-mkconfig_lib.in: Add missing quotes. 2011-04-10 Colin Watson - * grub-core/gnulib/argp-parse.c (__argp_input): Don't crash if pstate + * VasEBoot-core/gnulib/argp-parse.c (__argp_input): Don't crash if pstate is NULL. 2011-04-10 Vladimir Serbinenko Dynamically count the number of lines for the lower banner. - * grub-core/normal/menu_entry.c (per_term_screen): New member + * VasEBoot-core/normal/menu_entry.c (per_term_screen): New member num_entries. (print_down): Use num_entries. (update_screen): Likewise. - (grub_menu_entry_run): Set num_entries. - * grub-core/normal/menu_text.c (menu_viewer_data): New member + (VasEBoot_menu_entry_run): Set num_entries. + * VasEBoot-core/normal/menu_text.c (menu_viewer_data): New member num_entries. - (grub_print_message_indented): Move real part to ... - (grub_print_message_indented_real): ... here. Additional argument + (VasEBoot_print_message_indented): Move real part to ... + (VasEBoot_print_message_indented_real): ... here. Additional argument dry_run. (draw_border): Additional argument num_entries. (print_message): Additional argument dry_run. (print_entries): Receive menu viewer data. - (grub_menu_init_page): New argment num_entries. + (VasEBoot_menu_init_page): New argment num_entries. (menu_text_set_chosen_entry): Use num_entries. - (grub_menu_try_text): Likewise. - * grub-core/normal/term.c (print_ucs4_terminal): New argument dry_run. + (VasEBoot_menu_try_text): Likewise. + * VasEBoot-core/normal/term.c (print_ucs4_terminal): New argument dry_run. All users updated. - (grub_ucs4_count_lines): New function. - * include/grub/term.h (grub_term_cursor_x): Moved from here .. - * grub-core/normal/menu_text.c (grub_term_cursor_x): ... to here. - * include/grub/term.h (GRUB_TERM_MESSAGE_HEIGHT): Removed. - (grub_term_border_height): Likewise. - (grub_term_num_entries): Likewise. + (VasEBoot_ucs4_count_lines): New function. + * include/VasEBoot/term.h (VasEBoot_term_cursor_x): Moved from here .. + * VasEBoot-core/normal/menu_text.c (VasEBoot_term_cursor_x): ... to here. + * include/VasEBoot/term.h (VasEBoot_TERM_MESSAGE_HEIGHT): Removed. + (VasEBoot_term_border_height): Likewise. + (VasEBoot_term_num_entries): Likewise. 2011-04-10 Vladimir Serbinenko - * grub-core/boot/mips/yeeloong/fwstart.S: Fix address to error message. + * VasEBoot-core/boot/mips/yeeloong/fwstart.S: Fix address to error message. Remove now unused string. 2011-04-09 Colin Watson - * docs/grub-dev.texi (Finding your way around): Update for 1.99 + * docs/VasEBoot-dev.texi (Finding your way around): Update for 1.99 build system. - (Getting started): GRUB is developed in Bazaar now, not Subversion. + (Getting started): VasEBoot is developed in Bazaar now, not Subversion. (Comment): Fix typo. (Getting started): General copy-editing. @@ -20687,57 +20687,57 @@ 2011-04-09 Colin Watson - * docs/grub-dev.texi: Replace MoinMoin syntax with Texinfo syntax + * docs/VasEBoot-dev.texi: Replace MoinMoin syntax with Texinfo syntax throughout. 2011-04-08 Vladimir Serbinenko - * util/grub-mkimage.c (main): Handle special naming of yeeloong + * util/VasEBoot-mkimage.c (main): Handle special naming of yeeloong directory. 2011-04-08 Colin Watson - * docs/grub-dev.texi: Fix spelling of "developer" throughout. - * grub-core/fs/i386/pc/pxe.c (parse_dhcp_vendor): Fix spelling of + * docs/VasEBoot-dev.texi: Fix spelling of "developer" throughout. + * VasEBoot-core/fs/i386/pc/pxe.c (parse_dhcp_vendor): Fix spelling of "development". 2011-04-08 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (run): Use grub_memcpy rather than - grub_strcpy since the lines aren't necessarily 0-terminated. + * VasEBoot-core/normal/menu_entry.c (run): Use VasEBoot_memcpy rather than + VasEBoot_strcpy since the lines aren't necessarily 0-terminated. 2011-04-08 Vladimir Serbinenko - * grub-core/lib/legacy_parse.c (legacy_commands): Find doesn't set + * VasEBoot-core/lib/legacy_parse.c (legacy_commands): Find doesn't set root on legacy. 2011-04-08 Vladimir Serbinenko - * grub-core/commands/probe.c (options): Argument to set isn't optional. - (GRUB_MOD_INIT): DEVICE isn't optional. + * VasEBoot-core/commands/probe.c (options): Argument to set isn't optional. + (VasEBoot_MOD_INIT): DEVICE isn't optional. 2011-04-08 Vladimir Serbinenko - * grub-core/normal/term.c (print_ucs4_terminal): Don't try to put the + * VasEBoot-core/normal/term.c (print_ucs4_terminal): Don't try to put the word on new line if it's too long anyway. Fixes a hang. 2011-04-08 Vladimir Serbinenko - * include/grub/util/raid.h (grub_util_raid_getmembers): Make argument + * include/VasEBoot/util/raid.h (VasEBoot_util_raid_getmembers): Make argument const. - * util/grub-setup.c (main): Reuse md device name if available. - * util/raid.c (grub_util_raid_getmembers): Receive device name and - not GRUB name as argument. + * util/VasEBoot-setup.c (main): Reuse md device name if available. + * util/raid.c (VasEBoot_util_raid_getmembers): Receive device name and + not VasEBoot name as argument. Based on patch by: Florian Wagner . 2011-04-08 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_make_mbi): Place mbi on low memory for better compatibility. 2011-04-08 Vladimir Serbinenko - * include/grub/efiemu/efiemu.h: Use grub_memory_hook_t type. + * include/VasEBoot/efiemu/efiemu.h: Use VasEBoot_memory_hook_t type. 2011-04-08 Vladimir Serbinenko 2011-04-08 Colin Watson @@ -20747,65 +20747,65 @@ 2011-04-08 Vladimir Serbinenko - * grub-core/normal/menu.c: Add missing include. + * VasEBoot-core/normal/menu.c: Add missing include. 2011-04-08 Vladimir Serbinenko - * grub-core/disk/raid.c [GRUB_UTIL]: Add missing include. + * VasEBoot-core/disk/raid.c [VasEBoot_UTIL]: Add missing include. 2011-04-08 Martin Zuther - * util/grub-mkconfig.in: Ignore emacsen backup. + * util/VasEBoot-mkconfig.in: Ignore emacsen backup. 2011-04-08 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (open_device): Sync on close and not + * VasEBoot-core/kern/emu/hostdisk.c (open_device): Sync on close and not on open. - (grub_util_biosdisk_close): Likewise. + (VasEBoot_util_biosdisk_close): Likewise. 2011-04-08 Vladimir Serbinenko - * grub-core/kern/emu/getroot.c (grub_util_get_grub_dev): Add missing - const attribute and use grub_isdigit. + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_get_VasEBoot_dev): Add missing + const attribute and use VasEBoot_isdigit. 2011-04-06 Andrey - * grub-core/video/fb/video_fb.c (grub_video_fb_setup): Silence older + * VasEBoot-core/video/fb/video_fb.c (VasEBoot_video_fb_setup): Silence older gcc warning. 2011-04-06 Vladimir Serbinenko - * grub-core/lib/relocator.c (grub_relocator_alloc_chunk_align): Add few - useful grub_dprintf's. + * VasEBoot-core/lib/relocator.c (VasEBoot_relocator_alloc_chunk_align): Add few + useful VasEBoot_dprintf's. 2011-04-06 Vladimir Serbinenko - * include/grub/fs.h (grub_dirhook_info): Use unsigned for 1-bit fields. + * include/VasEBoot/fs.h (VasEBoot_dirhook_info): Use unsigned for 1-bit fields. 2011-04-06 Vladimir Serbinenko - * util/grub.d/00_header.in: Don't use LANG unless unifont is available. + * util/VasEBoot.d/00_header.in: Don't use LANG unless unifont is available. 2011-04-06 Vladimir Serbinenko Output errors if theme loading failed. - * grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Move the call to - grub_gfxterm_fullscreen on error paths to ... - * grub-core/normal/menu.c (menu_init): ...here. Wait after showing + * VasEBoot-core/gfxmenu/gfxmenu.c (VasEBoot_gfxmenu_try): Move the call to + VasEBoot_gfxterm_fullscreen on error paths to ... + * VasEBoot-core/normal/menu.c (menu_init): ...here. Wait after showing theme loading error. 2011-04-06 Vladimir Serbinenko - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_RAW_SIZE): Let a bit more + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_RAW_SIZE): Let a bit more space for older compilers. - (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise. + (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise. 2011-04-06 Vladimir Serbinenko - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Detect spares - and report them as not RAID members since they are useless for GRUB. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Detect spares + and report them as not RAID members since they are useless for VasEBoot. + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Likewise. 2011-04-02 Vladimir Serbinenko @@ -20814,63 +20814,63 @@ only lvs or only pvs are used whereas it seems that they are used interchangeably. - * grub-core/disk/lvm.c (read_node): New function. + * VasEBoot-core/disk/lvm.c (read_node): New function. (read_lv): Use read_node. - (grub_lvm_scan_device): Use only first mirror on pvmove'd lvs. + (VasEBoot_lvm_scan_device): Use only first mirror on pvmove'd lvs. Match volumes only at the end when all lvs are found. Take both pvs (first) and lvs (second) into account. - * include/grub/lvm.h (grub_lvm_segment): Merge fields stripe_* and + * include/VasEBoot/lvm.h (VasEBoot_lvm_segment): Merge fields stripe_* and mirror_* into node_*. All users updated. - (grub_lvm_stripe): Merge this ... - (grub_lvm_mirror): ... and this ... - (grub_lvm_node): ... into this. All users updated. + (VasEBoot_lvm_stripe): Merge this ... + (VasEBoot_lvm_mirror): ... and this ... + (VasEBoot_lvm_node): ... into this. All users updated. 2011-04-02 Vladimir Serbinenko - * grub-core/disk/lvm.c (grub_lvm_scan_device): Print errors on the end + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_scan_device): Print errors on the end of function to allow further scanning for LVMs. 2011-04-02 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_read): Don't close + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_read): Don't close on failed seek as it breaks open fd reusage. 2011-04-02 Vladimir Serbinenko - * util/grub-install.in: Add a recommendation to use --recheck before + * util/VasEBoot-install.in: Add a recommendation to use --recheck before reporting bugs. 2011-04-02 Vladimir Serbinenko - * docs/grub.texi (Vendor power-on buttons): Explain how the numbers + * docs/VasEBoot.texi (Vendor power-on buttons): Explain how the numbers are obtained. 2011-04-02 Vladimir Serbinenko - GRUB developper manual based on existing Internals section and + VasEBoot developper manual based on existing Internals section and contributions by the various authors with active copyright assignment. - * docs/Makefile.am (info_TEXINFOS): Add grub-dev.texi. + * docs/Makefile.am (info_TEXINFOS): Add VasEBoot-dev.texi. * docs/font_char_metrics.png: New file. * docs/font_char_metrics.txt: Likewise. - * docs/grub-dev.texi: Likewise. - * docs/grub.texi (Internals): Move from here ... - * docs/grub-dev.texi: ... here. + * docs/VasEBoot-dev.texi: Likewise. + * docs/VasEBoot.texi (Internals): Move from here ... + * docs/VasEBoot-dev.texi: ... here. 2011-04-01 Colin Watson - Store the loopback device as data on loopback grub_disk structures, + Store the loopback device as data on loopback VasEBoot_disk structures, rather than the file it points to. This fixes use of freed memory if an existing loopback device is replaced. - * grub-core/disk/loopback.c (grub_loopback_open): Store dev in + * VasEBoot-core/disk/loopback.c (VasEBoot_loopback_open): Store dev in disk->data, not dev->file. - (grub_loopback_read): Adjust file assignment to match. + (VasEBoot_loopback_read): Adjust file assignment to match. Fixes Ubuntu bug #742967. 2011-04-01 Colin Watson - * grub-core/disk/loopback.c (grub_cmd_loopback): Fix a memory leak + * VasEBoot-core/disk/loopback.c (VasEBoot_cmd_loopback): Fix a memory leak when replacing an existing device. 2011-04-01 Vladimir Serbinenko @@ -20878,30 +20878,30 @@ Fix incorrect types in jfs.c. This enables >2TiB disks and fixes some memory corruptions. - * grub-core/fs/jfs.c (struct grub_jfs_diropen): Interpret bytes as + * VasEBoot-core/fs/jfs.c (struct VasEBoot_jfs_diropen): Interpret bytes as unsigned. - (grub_jfs_lookup_symlink): Make ino a grub_uint32_t rather than int. - (grub_jfs_blkno): Use 64-bit quantities for block sectors. - (grub_jfs_read_inode): Likewise. - (grub_jfs_opendir): Likewise. Remove now useless casts. - (grub_jfs_getent): Likewise. - Make ino a grub_uint32_t rather than int. - (grub_jfs_mount): Ensure that blksize and log2_blksize are consistent. - (grub_jfs_read_file): Use 64-bit quantities when necessary. Replace + (VasEBoot_jfs_lookup_symlink): Make ino a VasEBoot_uint32_t rather than int. + (VasEBoot_jfs_blkno): Use 64-bit quantities for block sectors. + (VasEBoot_jfs_read_inode): Likewise. + (VasEBoot_jfs_opendir): Likewise. Remove now useless casts. + (VasEBoot_jfs_getent): Likewise. + Make ino a VasEBoot_uint32_t rather than int. + (VasEBoot_jfs_mount): Ensure that blksize and log2_blksize are consistent. + (VasEBoot_jfs_read_file): Use 64-bit quantities when necessary. Replace division and module with bit operations. - (grub_jfs_find_file): Make ino a grub_uint32_t. - (grub_jfs_lookup_symlink): Likewise. Use 64-bit quantities + (VasEBoot_jfs_find_file): Make ino a VasEBoot_uint32_t. + (VasEBoot_jfs_lookup_symlink): Likewise. Use 64-bit quantities 2011-04-01 Colin Watson - * grub-core/normal/menu_entry.c (run): Quieten uninitialised + * VasEBoot-core/normal/menu_entry.c (run): Quieten uninitialised warning. (This was in fact always initialised before use, but GCC wasn't smart enough to prove that.) - * grub-core/script/lexer.c (grub_script_lexer_yywrap): Likewise. + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_yywrap): Likewise. 2011-03-31 Vladimir Serbinenko - * grub-core/kern/x86_64/efi/callwrap.S (efi_wrap_0): Preserve 16-byte + * VasEBoot-core/kern/x86_64/efi/callwrap.S (efi_wrap_0): Preserve 16-byte stack alignment. (efi_wrap_1): Likewise. (efi_wrap_2): Likewise. @@ -20914,72 +20914,72 @@ 2011-03-31 Colin Watson - * grub-core/mmap/efi/mmap.c (grub_mmap_unregister): Remove + * VasEBoot-core/mmap/efi/mmap.c (VasEBoot_mmap_unregister): Remove set-but-not-used variable. 2011-03-31 Colin Watson - * docs/grub.texi (Simple configuration): Be more explicit about - GRUB_DEFAULT, and add an example. + * docs/VasEBoot.texi (Simple configuration): Be more explicit about + VasEBoot_DEFAULT, and add an example. Reported by: Leslie Rhorer. 2011-03-30 Colin Watson - * docs/grub.texi (Commands): Link to "GRUB only offers a rescue + * docs/VasEBoot.texi (Commands): Link to "VasEBoot only offers a rescue shell". 2011-03-30 Alexey Shvetsov - * util/grub.d/10_linux.in: Add gentoo-specific config filename. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_linux.in: Add gentoo-specific config filename. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2011-03-30 Vladimir Serbinenko - * util/grub.d/10_linux.in: Try alternative config filenames where + * util/VasEBoot.d/10_linux.in: Try alternative config filenames where we parse config file. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2011-03-30 Alexey Shvetsov - * util/grub.d/10_linux.in: Add gentoo-specific Linux and initrd names. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_linux.in: Add gentoo-specific Linux and initrd names. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2011-03-30 Vladimir Serbinenko - * grub-core/disk/raid.c (insert_array): Add few potentially - useful grub_util_info. - (grub_raid_register): Likewise. + * VasEBoot-core/disk/raid.c (insert_array): Add few potentially + useful VasEBoot_util_info. + (VasEBoot_raid_register): Likewise. 2011-03-30 Vladimir Serbinenko - * grub-core/kern/emu/getroot.c (grub_util_get_grub_dev) [__linux__]: + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_get_VasEBoot_dev) [__linux__]: Preserve partition number in mdadm code path. 2011-03-30 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev): Add - few potentially useful grub_util_info. + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Add + few potentially useful VasEBoot_util_info. 2011-03-30 Vladimir Serbinenko - * grub-core/disk/lvm.c (grub_lvm_scan_device): Remove spurious \n. + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_scan_device): Remove spurious \n. 2011-03-30 Colin Watson - * docs/grub.texi (default): Use @example rather than nested + * docs/VasEBoot.texi (default): Use @example rather than nested itemized lists to avoid breaking gendocs. 2011-03-30 Colin Watson - * docs/grub.texi (Future): Update. + * docs/VasEBoot.texi (Future): Update. 2011-03-30 Colin Watson - * docs/grub.texi (Environment): New chapter. - (Changes from GRUB Legacy): Link to "Environment block" section for + * docs/VasEBoot.texi (Environment): New chapter. + (Changes from VasEBoot Legacy): Link to "Environment block" section for details of limitations. (Simple configuration): Likewise. Link to documentation of gfxmode - and gfxpayload variables from GRUB_GFXMODE and GRUB_GFXPAYLOAD + and gfxpayload variables from VasEBoot_GFXMODE and VasEBoot_GFXPAYLOAD respectively. (Shell-like scripting): Note that normal variables are stored in the environment. @@ -20992,18 +20992,18 @@ 2011-03-30 Vladimir Serbinenko - * docs/grub.texi: Correctly use "terminal_input" and not "terminal" in + * docs/VasEBoot.texi: Correctly use "terminal_input" and not "terminal" in the example. 2011-03-30 Vladimir Serbinenko - * grub-core/term/at_keyboard.c (set_scancodes) - [!GRUB_MACHINE_MIPS_YEELOONG && !GRUB_MACHINE_QEMU]: Use scancode set 1. + * VasEBoot-core/term/at_keyboard.c (set_scancodes) + [!VasEBoot_MACHINE_MIPS_YEELOONG && !VasEBoot_MACHINE_QEMU]: Use scancode set 1. 2011-03-30 Colin Watson - * docs/grub.texi (Menu-specific commands): Remove some semantics - that were true in GRUB Legacy but not in GRUB 2. + * docs/VasEBoot.texi (Menu-specific commands): Remove some semantics + that were true in VasEBoot Legacy but not in VasEBoot 2. (submenu): New section. (false): New section. (read): New section. @@ -21011,441 +21011,441 @@ 2011-03-30 Colin Watson - * docs/grub.texi (Changes from GRUB Legacy): Minor proofreading. + * docs/VasEBoot.texi (Changes from VasEBoot Legacy): Minor proofreading. 2011-03-30 Colin Watson - * docs/grub.texi (Simple configuration): Explain some of the - current limitations of grub-mkconfig. + * docs/VasEBoot.texi (Simple configuration): Explain some of the + current limitations of VasEBoot-mkconfig. Reported by: Leslie Rhorer. 2011-03-29 Vladimir Serbinenko Old macs search for boot.efi rather than for bootia32.efi. - * util/grub-install.in: Copy bootia32.efi to boot.efi. - * util/grub-mkrescue.in: Likewise. + * util/VasEBoot-install.in: Copy bootia32.efi to boot.efi. + * util/VasEBoot-mkrescue.in: Likewise. Suggested by: Peter Jones. 2011-03-29 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Accept old-style xen kernels. + * util/VasEBoot.d/20_linux_xen.in: Accept old-style xen kernels. 2011-03-29 Vladimir Serbinenko - * include/grub/lvm.h (grub_lvm_lv): New field 'visible'. - (grub_lvm_segment): New fields 'type', 'mirror_count' and 'mirrors'. - (grub_lvm_mirror): New struct. - * grub-core/disk/lvm.c (grub_lvm_checkvalue): Commented out. - (grub_lvm_iterate): Iterate only visible volumes. - (grub_lvm_read): Factor out to .. + * include/VasEBoot/lvm.h (VasEBoot_lvm_lv): New field 'visible'. + (VasEBoot_lvm_segment): New fields 'type', 'mirror_count' and 'mirrors'. + (VasEBoot_lvm_mirror): New struct. + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_checkvalue): Commented out. + (VasEBoot_lvm_iterate): Iterate only visible volumes. + (VasEBoot_lvm_read): Factor out to .. (read_lv): ... this. Support mirrors. - (grub_lvm_read): New wrapper function. - (grub_lvm_scan_device): Parse mirrors. Skip everything that isn't + (VasEBoot_lvm_read): New wrapper function. + (VasEBoot_lvm_scan_device): Parse mirrors. Skip everything that isn't stripped or mirrored. 2011-03-29 Vladimir Serbinenko - * util/grub.d/10_linux.in: Skip vmlinux-* on x86 platforms. + * util/VasEBoot.d/10_linux.in: Skip vmlinux-* on x86 platforms. 2011-03-29 Colin Watson - * docs/grub.texi (loopback): New section. + * docs/VasEBoot.texi (loopback): New section. 2011-03-29 Colin Watson - * grub-core/disk/loopback.c (GRUB_MOD_INIT): Stop documenting + * VasEBoot-core/disk/loopback.c (VasEBoot_MOD_INIT): Stop documenting removed -p option. 2011-03-29 Colin Watson - * docs/grub.texi (BIOS installation): New section, partly based on + * docs/VasEBoot.texi (BIOS installation): New section, partly based on previous text in other sections. - (Installing GRUB using grub-install): Replace BIOS discussion with a + (Installing VasEBoot using VasEBoot-install): Replace BIOS discussion with a cross-reference. (Images): Likewise. 2011-03-29 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (find_partition_start) + * VasEBoot-core/kern/emu/hostdisk.c (find_partition_start) [HAVE_DIOCGDINFO]: Add safety checks. 2011-03-29 Vladimir Serbinenko - * util/grub.d/10_kfreebsd.in: Allow ufs.ko to be missing as it's + * util/VasEBoot.d/10_kfreebsd.in: Allow ufs.ko to be missing as it's per default compiled in kernel and prior to 8.0 isn't shipped at all. 2011-03-29 Colin Watson - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): If + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): If real_sb->size is zero (e.g. RAID-0), get the disk size from real_sb->data_size instead. Fixes Ubuntu bug #743136. 2011-03-29 Vladimir Serbinenko - * grub-core/normal/misc.c (grub_normal_print_device_info): Use correct + * VasEBoot-core/normal/misc.c (VasEBoot_normal_print_device_info): Use correct printf clauses for printing size and start. 2011-03-29 Vladimir Serbinenko - * grub-core/fs/ext2.c (grub_ext2_read_inode): Fix an overflow. + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_read_inode): Fix an overflow. Reported and tested by: Timothy Nikkel. 2011-03-29 Vladimir Serbinenko - * grub-core/term/gfxterm.c (dirty_region_add): Move core part to ... + * VasEBoot-core/term/gfxterm.c (dirty_region_add): Move core part to ... (dirty_region_add_real): ... this. (dirty_region_add): Don't discard margin refresh when performing scheduled repaint. 2011-03-29 Vladimir Serbinenko - * grub-core/lib/relocator.c (allocate_regstart) - [!DEBUG_RELOCATOR_NOMEM_DPRINTF]: Avoid grub_dprintf since not all + * VasEBoot-core/lib/relocator.c (allocate_regstart) + [!DEBUG_RELOCATOR_NOMEM_DPRINTF]: Avoid VasEBoot_dprintf since not all terminals are capabple of malloc-free operation. (allocate_inreg) [!DEBUG_RELOCATOR_NOMEM_DPRINTF]: Likewise. (malloc_in_range) [!DEBUG_RELOCATOR_NOMEM_DPRINTF]: Likewise. 2011-03-29 Mario Limonciello - * util/grub-setup.c: Copy the partition table zone if floppy support + * util/VasEBoot-setup.c: Copy the partition table zone if floppy support is disabled, even if no partition table is found. Otherwise, the BIOS on Dell Latitude E series laptops will freeze during POST if an invalid partition table is contained in the PBR - of the active partition when GRUB is installed to a partition. + of the active partition when VasEBoot is installed to a partition. 2011-03-28 Colin Watson - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Remove stale + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Remove stale comment. 2011-03-28 Colin Watson - * grub-core/disk/raid.c (grub_raid_register): Adjust debug message + * VasEBoot-core/disk/raid.c (VasEBoot_raid_register): Adjust debug message to be specific about what kind of RAID device we're scanning for. 2011-03-26 Seth Goldberg - * grub-core/kern/emu/getroot.c (find_root_device_from_libzfs): Don't + * VasEBoot-core/kern/emu/getroot.c (find_root_device_from_libzfs): Don't return freed string. 2011-03-26 Vladimir Serbinenko - * grub-core/fs/iso9660.c (grub_iso9660_label): Rtrim the label. + * VasEBoot-core/fs/iso9660.c (VasEBoot_iso9660_label): Rtrim the label. 2011-03-26 Vladimir Serbinenko Use libgeom on FreeBSD to detect partitions. - * Makefile.util.def (grub-mkimage): Add LIBGEOM to ldadd. - (grub-mkrelpath): Likewise. - (grub-script-check): Likewise. - (grub-editenv): Likewise. - (grub-mkpasswd-pbkdf2): Likewise. - (grub-fstest): Likewise. - (grub-mkfont): Likewise. - (grub-mkdevicemap): Likewise. - (grub-probe): Likewise. - (grub-setup): Likewise. - (grub-ofpathname): Likewise. - (grub-mklayout): Likewise. + * Makefile.util.def (VasEBoot-mkimage): Add LIBGEOM to ldadd. + (VasEBoot-mkrelpath): Likewise. + (VasEBoot-script-check): Likewise. + (VasEBoot-editenv): Likewise. + (VasEBoot-mkpasswd-pbkdf2): Likewise. + (VasEBoot-fstest): Likewise. + (VasEBoot-mkfont): Likewise. + (VasEBoot-mkdevicemap): Likewise. + (VasEBoot-probe): Likewise. + (VasEBoot-setup): Likewise. + (VasEBoot-ofpathname): Likewise. + (VasEBoot-mklayout): Likewise. (example_unit_test): Likewise. - (grub-menulst2cfg): Likewise. - * grub-core/Makefile.core.def (grub-emu): Likewise. - (grub-emu-lite): Likewise. + (VasEBoot-menulst2cfg): Likewise. + * VasEBoot-core/Makefile.core.def (VasEBoot-emu): Likewise. + (VasEBoot-emu-lite): Likewise. * configure.ac: Check for -lgeom on FreeBSD and set LIBGEOM. - * grub-core/kern/emu/hostdisk.c [FreeBSD]: Include libgeom.h. Don't + * VasEBoot-core/kern/emu/hostdisk.c [FreeBSD]: Include libgeom.h. Don't define HAVE_DIOCGDINFO. (follow_geom_up) [FreeBSD]: New function. (find_partition_start) [FreeBSD]: Rewritten using follow_geom_up. (convert_system_partition_to_system_disk) [FreeBSD]: Likewise. - (grub_util_biosdisk_get_grub_dev) [FreeBSD]: Use FreeBSD path + (VasEBoot_util_biosdisk_get_VasEBoot_dev) [FreeBSD]: Use FreeBSD path unconditionally of HAVE_DIOCGDINFO. 2011-03-26 Vladimir Serbinenko Fix FreeBSD compilation problem. - * grub-core/kern/emu/hostdisk.c (MAJOR) [FreeBSD]: New definition. + * VasEBoot-core/kern/emu/hostdisk.c (MAJOR) [FreeBSD]: New definition. (FLOPPY_MAJOR) [FreeBSD]: Likewise. 2011-03-24 Colin Watson - * grub-core/video/fb/video_fb.c (grub_video_fb_get_info_and_fini): + * VasEBoot-core/video/fb/video_fb.c (VasEBoot_video_fb_get_info_and_fini): Switch back to page zero before loading a kernel, since some kernel drivers expect that. Thanks to: Felix Kuehling. 2011-03-24 Vladimir Serbinenko - * grub-core/lib/relocator.c (grub_relocator_alloc_chunk_addr) - [DEBUG_RELOCATOR]: Reuse grub_mm_check. - (grub_relocator_alloc_chunk_align) [DEBUG_RELOCATOR]: Likewise. + * VasEBoot-core/lib/relocator.c (VasEBoot_relocator_alloc_chunk_addr) + [DEBUG_RELOCATOR]: Reuse VasEBoot_mm_check. + (VasEBoot_relocator_alloc_chunk_align) [DEBUG_RELOCATOR]: Likewise. 2011-03-24 Vladimir Serbinenko - * include/grub/mm.h (GRUB_MM_CHECK): Rename to ... - (grub_mm_check): ... this. MAke a function-like macro and use GRUB_FILE. + * include/VasEBoot/mm.h (VasEBoot_MM_CHECK): Rename to ... + (VasEBoot_mm_check): ... this. MAke a function-like macro and use VasEBoot_FILE. 2011-03-24 Vladimir Serbinenko - * grub-core/lib/relocator.c (allocate_inreg): Avoid dprintf unless + * VasEBoot-core/lib/relocator.c (allocate_inreg): Avoid dprintf unless DEBUG_RELOCATOR is defined since gfxterm can't cope with output when malloc is disabled. 2011-03-24 Vladimir Serbinenko - * grub-core/loader/i386/bsdXX.c (grub_freebsd_load_elfmodule): Account + * VasEBoot-core/loader/i386/bsdXX.c (VasEBoot_freebsd_load_elfmodule): Account for modules headers when counting the needed allocation size. 2011-03-23 Vladimir Serbinenko - * grub-core/term/gfxterm.c (calculate_normal_character_width): Return 8 + * VasEBoot-core/term/gfxterm.c (calculate_normal_character_width): Return 8 if no ASCII character is found to prevent crash. 2011-03-23 Alexander Kurtz - * grub-core/video/bitmap.c (match_extension): Ignore case. + * VasEBoot-core/video/bitmap.c (match_extension): Ignore case. 2011-03-23 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (init_line): Fix off-by-one error. + * VasEBoot-core/normal/menu_entry.c (init_line): Fix off-by-one error. 2011-03-23 Vladimir Serbinenko - * grub-core/script/parser.y: Declare "time" as valid argument. + * VasEBoot-core/script/parser.y: Declare "time" as valid argument. 2011-03-23 Peter Jones Fix incorrect assert failure reporting. - * grub-core/tests/example_functional_test.c (example_test): Add + * VasEBoot-core/tests/example_functional_test.c (example_test): Add a failure comment. - * grub-core/tests/lib/test.c (add_failure): Renamed to ... + * VasEBoot-core/tests/lib/test.c (add_failure): Renamed to ... (failure_start): ...this. Check that malloc succeeded. Don't call xvasprintf. Return failure struct. (failure_append_vtext): New function. (failure_append_text): Likewise. (add_failure): Likewise. - (grub_test_assert_helper): Likewise. - * include/grub/test.h (grub_test_assert_helper): New declaration. - (grub_test_assert): Macro rewritten. + (VasEBoot_test_assert_helper): Likewise. + * include/VasEBoot/test.h (VasEBoot_test_assert_helper): New declaration. + (VasEBoot_test_assert): Macro rewritten. 2011-03-23 Vladimir Serbinenko - * grub-core/normal/main.c (GRUB_MOD_INIT): Export pager variable. + * VasEBoot-core/normal/main.c (VasEBoot_MOD_INIT): Export pager variable. 2011-03-23 Vladimir Serbinenko - * grub-core/lib/i386/pc/biosnum.c: Add missing include. + * VasEBoot-core/lib/i386/pc/biosnum.c: Add missing include. 2011-03-23 Vladimir Serbinenko - * grub-core/disk/usbms.c (grub_usbms_reset): Transform USB-style error - into GRUB-style one. + * VasEBoot-core/disk/usbms.c (VasEBoot_usbms_reset): Transform USB-style error + into VasEBoot-style one. 2011-03-23 Vladimir Serbinenko - * grub-core/bus/usb/usbtrans.c (grub_usb_control_msg): Return usb-style - error and not grub_errno. - * grub-core/bus/usb/usbhub.c (grub_usb_add_hub): Likewise. + * VasEBoot-core/bus/usb/usbtrans.c (VasEBoot_usb_control_msg): Return usb-style + error and not VasEBoot_errno. + * VasEBoot-core/bus/usb/usbhub.c (VasEBoot_usb_add_hub): Likewise. 2011-03-23 Vladimir Serbinenko - * grub-core/bus/usb/uhci.c (grub_uhci_detect_dev): Return - GRUB_USB_SPEED_NONE in case of failure and not the error code. + * VasEBoot-core/bus/usb/uhci.c (VasEBoot_uhci_detect_dev): Return + VasEBoot_USB_SPEED_NONE in case of failure and not the error code. 2011-03-23 Vladimir Serbinenko - * grub-core/efiemu/i386/pc/cfgtables.c - (grub_machine_efiemu_init_tables): Make declaration a prototype. - * grub-core/loader/xnu.c (grub_xnu_lock): Likewise. - (grub_xnu_unlock): Likewise. - * grub-core/normal/cmdline.c (grub_cmdline_get/cl_set_pos_all): Likewise. + * VasEBoot-core/efiemu/i386/pc/cfgtables.c + (VasEBoot_machine_efiemu_init_tables): Make declaration a prototype. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_lock): Likewise. + (VasEBoot_xnu_unlock): Likewise. + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get/cl_set_pos_all): Likewise. 2011-03-23 Vladimir Serbinenko - * grub-core/bus/usb/usb.c (attach_hooks): Make static. - * grub-core/bus/usb/usbhub.c (hubs): Likewise. - * grub-core/commands/hashsum.c (aliases): Likewise. - * grub-core/commands/setpci.c (pci_registers): Likewise. - * grub-core/disk/usbms.c (attach_hook): Likewise. - * grub-core/fs/zfs/zfs.c (decomp_table): Likewise. + * VasEBoot-core/bus/usb/usb.c (attach_hooks): Make static. + * VasEBoot-core/bus/usb/usbhub.c (hubs): Likewise. + * VasEBoot-core/commands/hashsum.c (aliases): Likewise. + * VasEBoot-core/commands/setpci.c (pci_registers): Likewise. + * VasEBoot-core/disk/usbms.c (attach_hook): Likewise. + * VasEBoot-core/fs/zfs/zfs.c (decomp_table): Likewise. (zio_checksum_table): Likewise. - * grub-core/gettext/gettext.c (grub_gettext_msg_list): Likewise. - * grub-core/gfxmenu/gfxmenu.c (cached_view): Likewise. - * grub-core/lib/legacy_parse.c (legacy_commands): Likewise. - * grub-core/lib/relocator.c (leftovers): Likewise. + * VasEBoot-core/gettext/gettext.c (VasEBoot_gettext_msg_list): Likewise. + * VasEBoot-core/gfxmenu/gfxmenu.c (cached_view): Likewise. + * VasEBoot-core/lib/legacy_parse.c (legacy_commands): Likewise. + * VasEBoot-core/lib/relocator.c (leftovers): Likewise. (extra_blocks): Likewise. - * grub-core/loader/i386/bsd.c (relocator): Likewise. - * grub-core/loader/i386/multiboot_mbi.c (modules): Likewise. + * VasEBoot-core/loader/i386/bsd.c (relocator): Likewise. + * VasEBoot-core/loader/i386/multiboot_mbi.c (modules): Likewise. (modules_last): Likewise. - * grub-core/loader/i386/xnu.c (table_aliases): Likewise. + * VasEBoot-core/loader/i386/xnu.c (table_aliases): Likewise. (devices): Likewise. - * grub-core/loader/multiboot_mbi2.c (modules): Likewise. + * VasEBoot-core/loader/multiboot_mbi2.c (modules): Likewise. (modules_last): Likewise. - * grub-core/normal/auth.c (users): Likewise. - * grub-core/normal/context.c (initial_menu): Likewise. + * VasEBoot-core/normal/auth.c (users): Likewise. + * VasEBoot-core/normal/context.c (initial_menu): Likewise. (current_menu): Likewise. - * grub-core/normal/crypto.c (crypto_specs): Likewise. - * grub-core/term/serial.c (grub_serial_ports): Likewise. - (grub_serial_terminfo_input_template): Likewise. - (grub_serial_terminfo_output_template): Likewise. - (grub_serial_terminfo_input): Likewise. - (grub_serial_terminfo_output): Likewise. + * VasEBoot-core/normal/crypto.c (crypto_specs): Likewise. + * VasEBoot-core/term/serial.c (VasEBoot_serial_ports): Likewise. + (VasEBoot_serial_terminfo_input_template): Likewise. + (VasEBoot_serial_terminfo_output_template): Likewise. + (VasEBoot_serial_terminfo_input): Likewise. + (VasEBoot_serial_terminfo_output): Likewise. (registered): Likewise. - * grub-core/term/usb_keyboard.c (attach_hook): Likewise. + * VasEBoot-core/term/usb_keyboard.c (attach_hook): Likewise. 2011-03-23 Vladimir Serbinenko - * grub-core/video/bochs.c (grub_video_bochs_setup): Use - grub_video_mode_type_t. - * grub-core/video/cirrus.c (grub_video_cirrus_setup): Likewise. - * grub-core/video/i386/pc/vbe.c (grub_video_vbe_setup): Likewise. - * grub-core/video/i386/pc/vga.c (grub_video_vga_setup): Likewise. + * VasEBoot-core/video/bochs.c (VasEBoot_video_bochs_setup): Use + VasEBoot_video_mode_type_t. + * VasEBoot-core/video/cirrus.c (VasEBoot_video_cirrus_setup): Likewise. + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_video_vbe_setup): Likewise. + * VasEBoot-core/video/i386/pc/vga.c (VasEBoot_video_vga_setup): Likewise. 2011-03-23 Vladimir Serbinenko - * util/grub-install.in: Correct the x86-64 name as x86_64. + * util/VasEBoot-install.in: Correct the x86-64 name as x86_64. 2011-03-11 Colin Watson - * grub-core/boot/i386/pc/lnxboot.S (real_code_2): Ensure that the - initial chunk read from the kernel always includes GRUB's multiboot + * VasEBoot-core/boot/i386/pc/lnxboot.S (real_code_2): Ensure that the + initial chunk read from the kernel always includes VasEBoot's multiboot header, which is now outside the first sector. 2011-03-09 Colin Watson - * grub-core/loader/i386/linux.c (find_efi_mmap_size): Page-align + * VasEBoot-core/loader/i386/linux.c (find_efi_mmap_size): Page-align cached mmap_size, so that this works correctly when called multiple times. Reported by: Daniel Kahn Gillmor. Should fix Debian bug #616638. 2011-03-09 Colin Watson - * docs/grub.texi (Simple configuration): Tidy up formatting. + * docs/VasEBoot.texi (Simple configuration): Tidy up formatting. 2011-03-07 Szymon Janc - * grub-core/fs/zfs/zfs.c (zap_leaf_lookup): + * VasEBoot-core/fs/zfs/zfs.c (zap_leaf_lookup): Set-but-not-used variable removed. 2011-02-12 Vladimir Serbinenko Workaround yet another IEEE1275 bug. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New enum value - GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS. - * grub-core/kern/ieee1275/mmap.c (grub_machine_mmap_iterate): Ignore - adress_cells and size:cells if GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New enum value + VasEBoot_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS. + * VasEBoot-core/kern/ieee1275/mmap.c (VasEBoot_machine_mmap_iterate): Ignore + adress_cells and size:cells if VasEBoot_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS is set. - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS on powermacs. + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS on powermacs. 2011-02-12 Vladimir Serbinenko - * grub-core/partmap/msdos.c (pc_partition_map_embed): Fix off by one + * VasEBoot-core/partmap/msdos.c (pc_partition_map_embed): Fix off by one error. 2011-02-11 Colin Watson - * util/grub.d/20_linux_xen.in: Bail out early if linux_list is + * util/VasEBoot.d/20_linux_xen.in: Bail out early if linux_list is empty, since in that case we can only generate either nothing or a syntactically invalid configuration file. Reported by: Michal Suchanek. Fixes Debian bug #612898. 2011-02-09 Colin Watson - * docs/grub.texi (Kernel): Add reference to grub-mkrescue. - (Making a GRUB bootable CD-ROM): Likewise. - (Invoking grub-mkrescue): New section. + * docs/VasEBoot.texi (Kernel): Add reference to VasEBoot-mkrescue. + (Making a VasEBoot bootable CD-ROM): Likewise. + (Invoking VasEBoot-mkrescue): New section. Reported by: Yann Dirson. Fixes Debian bug #612585. 2011-02-09 Colin Watson - * util/grub-install.in: Remove unnecessary brackets from tr + * util/VasEBoot-install.in: Remove unnecessary brackets from tr arguments. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. Reported by: Jamie Heilman. Fixes Debian bug #612564. 2011-02-08 Colin Watson - * include/grub/file.h (not_easly_seekable): Rename to ... + * include/VasEBoot/file.h (not_easly_seekable): Rename to ... (not_easily_seekable): ... this. Update all users. 2011-01-28 Colin Watson - * docs/grub.texi (Making a GRUB bootable CD-ROM): Update to describe - grub-mkrescue. + * docs/VasEBoot.texi (Making a VasEBoot bootable CD-ROM): Update to describe + VasEBoot-mkrescue. 2011-01-24 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Refuse to create the images + * util/VasEBoot-mkimage.c (generate_image): Refuse to create the images bigger than the actual flash (512K) in Loongson machines. 512K is also the biggest chip supported by them. 2011-01-22 Vladimir Serbinenko - * grub-core/kern/emu/getroot.c: Include config-util.h explicitly. + * VasEBoot-core/kern/emu/getroot.c: Include config-util.h explicitly. 2011-01-22 Anthony DeRobertis - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Check + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Check super_offset field. 2011-01-22 Vladimir Serbinenko - * util/grub-install.in: Ignore install device on platforms + * util/VasEBoot-install.in: Ignore install device on platforms where it doesn't make sense. Always use UUIDs except on pc, efi and sparc64. Reported by: Daniel Kahn Gillmor. 2011-01-22 Vladimir Serbinenko - * grub-core/bus/bonito.c (write_bases): Fix direction of the shift. + * VasEBoot-core/bus/bonito.c (write_bases): Fix direction of the shift. 2011-01-22 Vladimir Serbinenko - * grub-core/partmap/bsdlabel.c: Include grub/emu/misc.h and not grub/util/misc.h. + * VasEBoot-core/partmap/bsdlabel.c: Include VasEBoot/emu/misc.h and not VasEBoot/util/misc.h. (iterate_real): Don't rely on partition being non-NULL. 2011-01-22 Vladimir Serbinenko - * grub-core/script/argv.c (round_up_exp): unsigned is 32-bit on all + * VasEBoot-core/script/argv.c (round_up_exp): unsigned is 32-bit on all supported platforms. Put a compile time assert for this rather than generate a warning with 32-bit shift. 2011-01-22 Vladimir Serbinenko - * grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make + * VasEBoot-core/disk/scsi.c (VasEBoot_scsi_read): Fix binary and check and make logical expression more readable. 2011-01-22 Vladimir Serbinenko - * grub-core/disk/raid.c (insert_array): Ensure uniqueness of p->number + * VasEBoot-core/disk/raid.c (insert_array): Ensure uniqueness of p->number even if some elements have a name. Reported by: Alexander GQ Gerasiov. 2011-01-22 Colin Watson - * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Consider a - path unreadable if `grub-probe -t abstraction' fails, for example if + * util/VasEBoot-mkconfig_lib.in (is_path_readable_by_VasEBoot): Consider a + path unreadable if `VasEBoot-probe -t abstraction' fails, for example if memberlist fails on an LVM volume group. Reported by: Darius Jahandarie. 2011-01-22 Colin Watson - * docs/grub.texi (Simple configuration): Document - GRUB_PRELOAD_MODULES. + * docs/VasEBoot.texi (Simple configuration): Document + VasEBoot_PRELOAD_MODULES. 2011-01-17 Colin Watson - * .bzrignore: Remove nonexistent grub-pbkdf2. + * .bzrignore: Remove nonexistent VasEBoot-pbkdf2. 2011-01-16 Vladimir Serbinenko @@ -21453,21 +21453,21 @@ 2011-01-15 Vladimir Serbinenko - * util/grub-mkimage.c (generate_image): Check fwstart.img checksum + * util/VasEBoot-mkimage.c (generate_image): Check fwstart.img checksum for safety. 2011-01-14 Vladimir Serbinenko - * grub-core/kern/mips/yeeloong/init.c (grub_machine_init): Init boot + * VasEBoot-core/kern/mips/yeeloong/init.c (VasEBoot_machine_init): Init boot module. 2011-01-14 Vladimir Serbinenko - * grub-core/Makefile.core.def (fwstart): Add lost LDFLAGS. + * VasEBoot-core/Makefile.core.def (fwstart): Add lost LDFLAGS. 2011-01-13 Vladimir Serbinenko - * grub-core/fs/zfs/zfsinfo.c (grub_cmd_zfs_bootfs): Quote bootpath and + * VasEBoot-core/fs/zfs/zfsinfo.c (VasEBoot_cmd_zfs_bootfs): Quote bootpath and diskdevid. 2011-01-13 Vladimir Serbinenko @@ -21479,15 +21479,15 @@ * conf/i386-pc-cygwin-img-ld.sc: Merge rdata and pdata into data. * configure.ac: Use $(top_builddir) in TARGET_OBJ2ELF. (COND_CYGWIN): New condition. - * grub-core/Makefile.am (%.mod): Set TARGET_OBJ2ELF. - * grub-core/genmod.sh.in: Use ${TARGET_OBJ2ELF} and + * VasEBoot-core/Makefile.am (%.mod): Set TARGET_OBJ2ELF. + * VasEBoot-core/genmod.sh.in: Use ${TARGET_OBJ2ELF} and not @TARGET_OBJ2ELF@. - * util/grub-pe2elf.c (write_symbol_table): Use pe_symtab->type and not + * util/VasEBoot-pe2elf.c (write_symbol_table): Use pe_symtab->type and not type to determine whether aux is to be used. 2011-01-12 Vladimir Serbinenko - * util/ieee1275/ofpath.c (grub_util_devname_to_ofpath): Use the + * util/ieee1275/ofpath.c (VasEBoot_util_devname_to_ofpath): Use the realpath'ed device string. Handle floppy (somewhat). Issue error in unknown case rather than garbage. @@ -21495,33 +21495,33 @@ 2011-01-12 Vladimir Serbinenko - * util/grub.d/00_header.in (load_video): Handle the case when no video + * util/VasEBoot.d/00_header.in (load_video): Handle the case when no video drivers available. Thanks to: Axel Beckert. 2011-01-12 Vladimir Serbinenko - * util/grub-mkfont.c (write_font_pf2): Use appropriate type for data + * util/VasEBoot-mkfont.c (write_font_pf2): Use appropriate type for data variable. Fixes problem on big endian platforms. 2011-01-12 Vladimir Serbinenko - * grub-core/Makefile.core.def (ieee1275_fb): Disable on sparc. + * VasEBoot-core/Makefile.core.def (ieee1275_fb): Disable on sparc. It doesn't work well there. 2011-01-12 Vladimir Serbinenko - * grub-core/normal/context.c (grub_env_context_close): Silence spurious + * VasEBoot-core/normal/context.c (VasEBoot_env_context_close): Silence spurious warning. - * grub-core/normal/menu.c (grub_menu_execute_entry): Likewise. - * grub-core/partmap/msdos.c (pc_partition_map_embed): Use unsigned + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): Likewise. + * VasEBoot-core/partmap/msdos.c (pc_partition_map_embed): Use unsigned counter. 2011-01-12 Vladimir Serbinenko Use alias->path rather than buggy "canon". - * grub-core/disk/ieee1275/ofdisk.c (ofdisk_hash_add_real): New function. + * VasEBoot-core/disk/ieee1275/ofdisk.c (ofdisk_hash_add_real): New function. (ofdisk_hash_add): New argument curcan. All users updated. 2011-01-11 Colin Watson @@ -21530,36 +21530,36 @@ 2011-01-11 Vladimir Serbinenko - * grub-core/loader/powerpc/ieee1275/linux.c (grub_linux_load32): Apply + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_linux_load32): Apply loadmask before doing any calculations. Use correct type for offset. - (grub_linux_load64): Likewise. + (VasEBoot_linux_load64): Likewise. 2011-01-11 Colin Watson - * util/grub-mklayout.c (console_grub_equivalences_shift): Terminate + * util/VasEBoot-mklayout.c (console_VasEBoot_equivalences_shift): Terminate with NULL. - (console_grub_equivalences_unshift): Likewise. + (console_VasEBoot_equivalences_unshift): Likewise. Reported by: Daniel Dehennin. 2011-01-11 Vladimir Serbinenko - * grub-core/fs/i386/pc/pxe.c (set_mac_env): Export variable. + * VasEBoot-core/fs/i386/pc/pxe.c (set_mac_env): Export variable. (set_env_limn_ro): Likewise. - (GRUB_MOD_INIT): Likewise. - * grub-core/hook/datehook.c (GRUB_MOD_INIT): Likewise. Change to + (VasEBoot_MOD_INIT): Likewise. + * VasEBoot-core/hook/datehook.c (VasEBoot_MOD_INIT): Likewise. Change to ARRAY_SIZE while on it. - (GRUB_MOD_FINI): Change to ARRAY_SIZE. - * grub-core/normal/context.c (grub_env_export): Move from here ... - * grub-core/kern/env.c (grub_env_export): ... here. - * grub-core/normal/context.c (grub_cmd_export): Skip exporting root and + (VasEBoot_MOD_FINI): Change to ARRAY_SIZE. + * VasEBoot-core/normal/context.c (VasEBoot_env_export): Move from here ... + * VasEBoot-core/kern/env.c (VasEBoot_env_export): ... here. + * VasEBoot-core/normal/context.c (VasEBoot_cmd_export): Skip exporting root and prefix. - * grub-core/kern/main.c (grub_main): Export root and prefix. - * include/grub/env.h (grub_env_export): Export. + * VasEBoot-core/kern/main.c (VasEBoot_main): Export root and prefix. + * include/VasEBoot/env.h (VasEBoot_env_export): Export. Reported by: Seth Goldberg. 2011-01-11 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_make_mbi): Take into account space used by ELF sections and multiboot palette. Reported by: Grégoire Sutre. @@ -21571,20 +21571,20 @@ Pass more appropriate video id to Linux. - * grub-core/loader/i386/linux.c (grub_linux_setup_video): Use - grub_video_get_driver_id and variable gfxpayloadforcelfb to + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_setup_video): Use + VasEBoot_video_get_driver_id and variable gfxpayloadforcelfb to fill have_vga. - (grub_linux_boot): Rely on grub_linux_setup_video to fill have_vga and + (VasEBoot_linux_boot): Rely on VasEBoot_linux_setup_video to fill have_vga and shift params->lfb_size. - * include/grub/i386/linux.h: Make an enume out of have_vga values. + * include/VasEBoot/i386/linux.h: Make an enume out of have_vga values. 2011-01-10 Vladimir Serbinenko - * util/grub-menulst2cfg.c: Add missing include of misc.h. + * util/VasEBoot-menulst2cfg.c: Add missing include of misc.h. 2011-01-10 Vladimir Serbinenko - * grub-core/fs/zfs/zfsinfo.c (grub_cmd_zfs_bootfs): Use comma as + * VasEBoot-core/fs/zfs/zfsinfo.c (VasEBoot_cmd_zfs_bootfs): Use comma as separator and pass bootpath/devid even if only one of them is available. Reported by: Seth Goldberg. @@ -21593,81 +21593,81 @@ Don't use post-4G memory on EFI even if 64-bit since some non-compliant implementations bug on them. - * grub-core/kern/efi/mm.c (grub_efi_allocate_pages): Skip post-4G + * VasEBoot-core/kern/efi/mm.c (VasEBoot_efi_allocate_pages): Skip post-4G memory. (filter_memory_map): Likewise. 2011-01-10 Vladimir Serbinenko - * util/grub-kbdcomp.in: Add missing prefix and exec_prefix variables. + * util/VasEBoot-kbdcomp.in: Add missing prefix and exec_prefix variables. Reported by: nebuchadnezzar. 2011-01-10 Vladimir Serbinenko - * util/grub-kbdcomp.in: Add missing transform and bindir variables. + * util/VasEBoot-kbdcomp.in: Add missing transform and bindir variables. Reported by: nebuchadnezzar. 2011-01-10 Vladimir Serbinenko Submenu default support. - * grub-core/normal/menu.c (grub_menu_execute_entry): New parameter + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): New parameter auto_boot. All users updated. Declared static. Handle chosen and default with submenus. - (grub_menu_execute_with_fallback): Declared static. + (VasEBoot_menu_execute_with_fallback): Declared static. Don't notify failure if autobooted. Upper level does it. (menuentry_eq): New function. (get_entry_number): Use menuentry_eq. (show_menu): New parameter "autobooted". All users updated. - (grub_show_menu): Likewise. - * include/grub/normal.h (grub_show_menu): Likewise. - * include/grub/menu.h (grub_menu_execute_entry): Removed. - (grub_menu_execute_with_fallback): Likewise. + (VasEBoot_show_menu): Likewise. + * include/VasEBoot/normal.h (VasEBoot_show_menu): Likewise. + * include/VasEBoot/menu.h (VasEBoot_menu_execute_entry): Removed. + (VasEBoot_menu_execute_with_fallback): Likewise. 2011-01-10 Vladimir Serbinenko - * util/grub-mklayout.c (usage): Update help text. + * util/VasEBoot-mklayout.c (usage): Update help text. 2011-01-10 Vladimir Serbinenko - * grub-core/commands/legacycfg.c (legacy_file): Trim the line. + * VasEBoot-core/commands/legacycfg.c (legacy_file): Trim the line. 2011-01-10 Vladimir Serbinenko - * util/grub-menulst2cfg.c (main): Trim the line. + * util/VasEBoot-menulst2cfg.c (main): Trim the line. 2011-01-10 Vladimir Serbinenko - * grub-core/kern/i386/pc/init.c (grub_get_conv_memsize): Removed. - (grub_machine_init): Don't check amount of low memory as reportedly + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_get_conv_memsize): Removed. + (VasEBoot_machine_init): Don't check amount of low memory as reportedly INT 12h can be broken and if low memory is too low we wouldn't have - gotten into grub_machine_init anyway. + gotten into VasEBoot_machine_init anyway. 2011-01-10 Vladimir Serbinenko - * grub-core/kern/i386/pc/mmap.c (grub_get_conv_memsize): New function. - (grub_machine_mmap_iterate): Take low memory into account + * VasEBoot-core/kern/i386/pc/mmap.c (VasEBoot_get_conv_memsize): New function. + (VasEBoot_machine_mmap_iterate): Take low memory into account 2011-01-10 Vladimir Serbinenko - * grub-core/fs/btrfs.c (grub_btrfs_mount): Transform out of range into + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_mount): Transform out of range into badfs. Reported by: TiCPU. 2011-01-10 Vladimir Serbinenko - * grub-core/disk/raid.c (insert_array): Display RAID name in duplicate + * VasEBoot-core/disk/raid.c (insert_array): Display RAID name in duplicate members errors. 2011-01-09 Grégoire Sutre - * util/grub.d/10_netbsd.in (netbsd_load_fs_module): New function. + * util/VasEBoot.d/10_netbsd.in (netbsd_load_fs_module): New function. (netbsd_entry): Use netbsd_load_fs_module() to load filesystem module. 2011-01-09 Grégoire Sutre - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Handle + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Handle openbsd and netbsd types being in part_bsd module. 2011-01-08 Vladimir Serbinenko @@ -21682,30 +21682,30 @@ 2011-01-08 Vladimir Serbinenko - * grub-core/fs/zfs/zfs.c (dmu_read): Use void * for some pointers to + * VasEBoot-core/fs/zfs/zfs.c (dmu_read): Use void * for some pointers to avoid aliasing. (fzap_lookup): Likewise. (dnode_get): Likewise. (make_mdn): Likewise. (zfs_mount): Likewise. (fzap_iterate): Use temporary pointer to avoid aliasing. - (grub_zfs_read): Likewise. - * grub-core/loader/i386/xnu.c (grub_xnu_boot): Likewise. - * grub-core/loader/xnu.c (grub_cmd_xnu_kernel): Use void * for some + (VasEBoot_zfs_read): Likewise. + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_xnu_boot): Likewise. + * VasEBoot-core/loader/xnu.c (VasEBoot_cmd_xnu_kernel): Use void * for some pointers to avoid aliasing. - (grub_cmd_xnu_kernel64): Likewise. - (grub_xnu_load_driver): Likewise. + (VasEBoot_cmd_xnu_kernel64): Likewise. + (VasEBoot_xnu_load_driver): Likewise. 2011-01-08 Vladimir Serbinenko - * grub-core/commands/terminal.c (grub_cmd_terminal_input): Silence + * VasEBoot-core/commands/terminal.c (VasEBoot_cmd_terminal_input): Silence aliasing warning. - (grub_cmd_terminal_output): Likewise. + (VasEBoot_cmd_terminal_output): Likewise. Reported and tested by: Grégoire Sutre. 2011-01-08 Vladimir Serbinenko - * grub-core/term/at_keyboard.c (grub_keyboard_getkey): Silence spurious + * VasEBoot-core/term/at_keyboard.c (VasEBoot_keyboard_getkey): Silence spurious warning. Reported and tested by: Grégoire Sutre. @@ -21716,15 +21716,15 @@ 2011-01-08 Vladimir Serbinenko - * grub-core/Makefile.am (rs_decoder.S): Force compilation with -Os. + * VasEBoot-core/Makefile.am (rs_decoder.S): Force compilation with -Os. Reported and tested by: Alain Greppin. 2011-01-08 Vladimir Serbinenko Satisfy some bison versions need for inttypes.h. - * grub-core/lib/posix_wrap/inttypes.h: New file. - * grub-core/lib/posix_wrap/sys/types.h (int8_t): New type. + * VasEBoot-core/lib/posix_wrap/inttypes.h: New file. + * VasEBoot-core/lib/posix_wrap/sys/types.h (int8_t): New type. (int16_t): Likewise. (int32_t): Likewise. (int64_t): Likewise. @@ -21732,60 +21732,60 @@ 2011-01-08 Vladimir Serbinenko - * grub-core/loader/i386/bsdXX.c (grub_netbsd_load_elf_meta): + * VasEBoot-core/loader/i386/bsdXX.c (VasEBoot_netbsd_load_elf_meta): Silence spurious warning. Reported and tested by: Alain Greppin. 2011-01-07 Szymon Janc - * docs/grub.texi (Support automatic decompression): Update with xz + * docs/VasEBoot.texi (Support automatic decompression): Update with xz decompression support. 2011-01-07 Szymon Janc Improve loaders' kernel command line handling. - * grub-core/lib/cmdline.c: New file. - * include/grub/lib/cmdline.h: Likewise. - * grub-core/loader/i386/linux.c (grub_cmd_linux): Use - grub_create_loader_cmdline to create kernel command line. - * grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Likewise. - * grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_linux): Likewise. - * grub-core/Makefile.core.def (linux16): Add lib/cmdline.c on i386_pc. + * VasEBoot-core/lib/cmdline.c: New file. + * include/VasEBoot/lib/cmdline.h: Likewise. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Use + VasEBoot_create_loader_cmdline to create kernel command line. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_cmd_linux): Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c (VasEBoot_cmd_linux): Likewise. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c (VasEBoot_cmd_linux): Likewise. + * VasEBoot-core/Makefile.core.def (linux16): Add lib/cmdline.c on i386_pc. (linux): Add lib/cmdline.c on common. 2011-01-07 Vladimir Serbinenko - * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Take into account that + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_iterate_dir): Take into account that inopos might be unaligned. 2011-01-07 Vladimir Serbinenko - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Add missing + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Add missing endian transformations. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Likewise. Based on report by: Doug Nazar. 2011-01-07 Doug Nazar - * grub-core/disk/raid5_recover.c (grub_raid5_recover): Add missing + * VasEBoot-core/disk/raid5_recover.c (VasEBoot_raid5_recover): Add missing array->members[i].start_sector. - * grub-core/disk/raid6_recover.c (grub_raid6_recover): Likewise. + * VasEBoot-core/disk/raid6_recover.c (VasEBoot_raid6_recover): Likewise. 2011-01-07 Vladimir Serbinenko - * util/grub-setup.c (setup): Handle NetBSD and OpenBSD disklabels. + * util/VasEBoot-setup.c (setup): Handle NetBSD and OpenBSD disklabels. Reported and tested by: Grégoire Sutre. 2011-01-06 Colin Watson - * tests/util/grub-shell.in: Set serial terminfo type to `dumb', to + * tests/util/VasEBoot-shell.in: Set serial terminfo type to `dumb', to avoid causing test failures by clearing the screen. 2011-01-06 Colin Watson - * grub-core/kern/emu/getroot.c (find_root_device_from_mountinfo): + * VasEBoot-core/kern/emu/getroot.c (find_root_device_from_mountinfo): Fix prefix check to handle the case where dir ends with a slash (most significantly, "/" itself). Reported by: Michael Vogt. @@ -21795,149 +21795,149 @@ Run terminfo_cls on initing terminfo output to clear the screen and move the cursor to (0,0). - * grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_init_output): - Call grub_terminfo_output_init. - * grub-core/term/serial.c (grub_serial_term_output): Set .init. - * grub-core/term/terminfo.c (grub_terminfo_output_init): New function. - * include/grub/terminfo.h (grub_terminfo_output_init): New declaration. + * VasEBoot-core/term/ieee1275/ofconsole.c (VasEBoot_ofconsole_init_output): + Call VasEBoot_terminfo_output_init. + * VasEBoot-core/term/serial.c (VasEBoot_serial_term_output): Set .init. + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_output_init): New function. + * include/VasEBoot/terminfo.h (VasEBoot_terminfo_output_init): New declaration. 2011-01-05 Vladimir Serbinenko - * util/grub-install.in: Determine ofpathname, nvsetenv and efibootmgr + * util/VasEBoot-install.in: Determine ofpathname, nvsetenv and efibootmgr only when needed. 2011-01-05 Vladimir Serbinenko - * grub-core/term/terminfo.c (grub_terminfo_readkey): Handle keys with + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_readkey): Handle keys with CTRL. 2011-01-05 Vladimir Serbinenko The E820 type 5 is BADRAM, not EXEC_CODE. - * grub-core/loader/i386/bsd.c (GRUB_E820_EXEC_CODE): Removed. - (GRUB_E820_BADRAM): New define. - * grub-core/loader/i386/linux.c (grub_linux_boot): Translate code + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_E820_EXEC_CODE): Removed. + (VasEBoot_E820_BADRAM): New define. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Translate code into reserved. Propagate BADRAM. - * grub-core/loader/i386/bsd.c (GRUB_E820_EXEC_CODE): Removed. - (GRUB_E820_BADRAM): New define. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_E820_EXEC_CODE): Removed. + (VasEBoot_E820_BADRAM): New define. 2011-01-04 Vladimir Serbinenko - * grub-core/lib/efi/relocator.c (grub_relocator_firmware_fill_events): + * VasEBoot-core/lib/efi/relocator.c (VasEBoot_relocator_firmware_fill_events): Ignore the memory post-4G. - (grub_relocator_firmware_alloc_region): Additional debug statement. + (VasEBoot_relocator_firmware_alloc_region): Additional debug statement. 2011-01-04 Vladimir Serbinenko - * grub-core/kern/emu/getroot.c (grub_util_get_grub_dev): Check md/%s + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_get_VasEBoot_dev): Check md/%s names. Reported by: David Pravec. 2011-01-04 Vladimir Serbinenko - * grub-core/disk/i386/pc/biosdisk.c (GRUB_MOD_INIT): Workaround buggy + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_MOD_INIT): Workaround buggy BIOSes. 2011-01-04 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (grub_reed_solomon_add_redundancy): + * VasEBoot-core/lib/reed_solomon.c (VasEBoot_reed_solomon_add_redundancy): Prevent overflow. - (grub_reed_solomon_recover): Likewise. + (VasEBoot_reed_solomon_recover): Likewise. 2011-01-04 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (main) [TEST]: Reactivate normal test. + * VasEBoot-core/lib/reed_solomon.c (main) [TEST]: Reactivate normal test. 2011-01-04 Vladimir Serbinenko - * grub-core/lib/reed_solomon.c (scratch) [! STANDALONE]: Remove leftover + * VasEBoot-core/lib/reed_solomon.c (scratch) [! STANDALONE]: Remove leftover variable. 2011-01-04 Colin Watson - * grub-core/commands/legacycfg.c (GRUB_MOD_INIT): Fix typo in + * VasEBoot-core/commands/legacycfg.c (VasEBoot_MOD_INIT): Fix typo in descriptions of extract_legacy_entries_source and extract_legacy_entries_configfile. Reported by: Seung Soo, Ha. 2011-01-03 Colin Watson - * grub-core/bus/pci.c (grub_pci_iterate): Skip remaining functions + * VasEBoot-core/bus/pci.c (VasEBoot_pci_iterate): Skip remaining functions on devices that do not implement function 0. 2011-01-03 Dave Vasilevsky - * grub-core/fs/hfsplus.c: Make parent unsigned. - (grub_hfsplus_cmp_catkey): Don't compare using subtraction, it + * VasEBoot-core/fs/hfsplus.c: Make parent unsigned. + (VasEBoot_hfsplus_cmp_catkey): Don't compare using subtraction, it overflows. - (grub_hfsplus_cmp_extkey): Likewise + (VasEBoot_hfsplus_cmp_extkey): Likewise 2011-01-03 Vladimir Serbinenko - * util/grub-install.in: Correctly use bootloader_id and not - GRUB_DISTRIBUTOR on efibootmgr line. + * util/VasEBoot-install.in: Correctly use bootloader_id and not + VasEBoot_DISTRIBUTOR on efibootmgr line. 2011-01-03 Vladimir Serbinenko - * util/grub-mkfont.c (main): Report errors in FT_New_Face. + * util/VasEBoot-mkfont.c (main): Report errors in FT_New_Face. 2010-12-31 Ian Campbell - * util/grub.d/20_linux_xen.in (linux_entry): Correctly capitalize + * util/VasEBoot.d/20_linux_xen.in (linux_entry): Correctly capitalize Xen and reorder menu item wording to make it clearer that this entry will launch Xen. Print separate messages when loading Xen and Linux. 2010-12-31 Vladimir Serbinenko - * grub-core/partmap/amiga.c (GRUB_AMIGA_PART_MAGIC): New define. + * VasEBoot-core/partmap/amiga.c (VasEBoot_AMIGA_PART_MAGIC): New define. (amiga_partition_map_iterate): Check "PART" magic to avoid a very long loop in case of incorrect amiga partmap. 2010-12-31 Vladimir Serbinenko - * grub-core/partmap/amiga.c (GRUB_AMIGA_RDSK_MAGIC): New define. - (amiga_partition_map_iterate): Use grub_memcmp instead of grub_strcmp. + * VasEBoot-core/partmap/amiga.c (VasEBoot_AMIGA_RDSK_MAGIC): New define. + (amiga_partition_map_iterate): Use VasEBoot_memcmp instead of VasEBoot_strcmp. Reported by:EHeM. 2010-12-31 Vladimir Serbinenko - * grub-core/loader/i386/bsdXX.c (grub_openbsd_find_ramdisk): Silence + * VasEBoot-core/loader/i386/bsdXX.c (VasEBoot_openbsd_find_ramdisk): Silence spurious warning. Reported by: crocket 2010-12-27 Vladimir Serbinenko - * grub-core/loader/xnu.c (grub_cmd_xnu_kernel) [! GRUB_MACHINE_EFI]: + * VasEBoot-core/loader/xnu.c (VasEBoot_cmd_xnu_kernel) [! VasEBoot_MACHINE_EFI]: Preload EFIemu. - (grub_cmd_xnu_kernel64) [! GRUB_MACHINE_EFI]: Likewise. + (VasEBoot_cmd_xnu_kernel64) [! VasEBoot_MACHINE_EFI]: Likewise. 2010-12-27 Vladimir Serbinenko - * grub-core/loader/xnu.c (grub_cmd_xnu_kext): Abort if no kernel + * VasEBoot-core/loader/xnu.c (VasEBoot_cmd_xnu_kext): Abort if no kernel is loaded - (grub_cmd_xnu_kextdir): Likewise. - (grub_cmd_xnu_splash): Likewise. + (VasEBoot_cmd_xnu_kextdir): Likewise. + (VasEBoot_cmd_xnu_splash): Likewise. 2010-12-27 Vladimir Serbinenko Avoid using Reed-Solomon with 0 redundancy. - * grub-core/kern/i386/pc/startup.S: Remove 0-data check. - * grub-core/lib/reed_solomon.c (decode_block): Do not proceed on 0 data + * VasEBoot-core/kern/i386/pc/startup.S: Remove 0-data check. + * VasEBoot-core/lib/reed_solomon.c (decode_block): Do not proceed on 0 data or 0 redundancy. - (grub_reed_solomon_add_redundancy): Do not proceed with 0 redundancy. - (grub_reed_solomon_recover): Likewise. + (VasEBoot_reed_solomon_add_redundancy): Do not proceed with 0 redundancy. + (VasEBoot_reed_solomon_recover): Likewise. 2010-12-27 Vladimir Serbinenko Don't use disk subsystem in freebsd_boot. - * grub-core/loader/i386/bsd.c (freebsd_bootdev): New variable. + * VasEBoot-core/loader/i386/bsd.c (freebsd_bootdev): New variable. (freebsd_biosdev): Likewise. - (grub_freebsd_boot): Use freebsd_bootdev and freebsd_biosdev. - (grub_cmd_freebsd): Set freebsd_bootdev and freebsd_biosdev. + (VasEBoot_freebsd_boot): Use freebsd_bootdev and freebsd_biosdev. + (VasEBoot_cmd_freebsd): Set freebsd_bootdev and freebsd_biosdev. 2010-12-26 Vladimir Serbinenko @@ -21946,50 +21946,50 @@ easily seekable files is buggy. Disable unknown file size for now. May be inefficient but works. - * grub-core/io/gzio.c (test_header): Always retrieve the file size. - * grub-core/io/xzio.c (grub_xzio_open): Likewise. + * VasEBoot-core/io/gzio.c (test_header): Always retrieve the file size. + * VasEBoot-core/io/xzio.c (VasEBoot_xzio_open): Likewise. 2010-12-25 Mirko Parthey - * grub-core/boot/i386/pc/boot.S: Fix %es:%bx pointing to nowhere on + * VasEBoot-core/boot/i386/pc/boot.S: Fix %es:%bx pointing to nowhere on floppy probe. 2010-12-25 Jeroen Dekkers - * grub-core/disk/raid.c (insert_array): Don't add spurious members. + * VasEBoot-core/disk/raid.c (insert_array): Don't add spurious members. 2010-12-25 Shea Levy - * grub-core/genmod.sh.in: Use @OBJCOPY@ rather than objcopy. + * VasEBoot-core/genmod.sh.in: Use @OBJCOPY@ rather than objcopy. 2010-12-25 Vladimir Serbinenko - * util/grub.d/30_os-prober.in: Don't emit drivemap directive for + * util/VasEBoot.d/30_os-prober.in: Don't emit drivemap directive for Windows Server 2008. Reported by: Devin Giddings. 2010-12-25 Vladimir Serbinenko - * grub-core/commands/acpihalt.c (grub_acpi_halt): Sleep for 1.5 before + * VasEBoot-core/commands/acpihalt.c (VasEBoot_acpi_halt): Sleep for 1.5 before writing an error message because of async power management. - * grub-core/kern/mips/yeeloong/init.c (grub_halt): Likewise. - (grub_reboot): Likewise. + * VasEBoot-core/kern/mips/yeeloong/init.c (VasEBoot_halt): Likewise. + (VasEBoot_reboot): Likewise. 2010-12-23 Jordan Uggla - * tests/util/grub-shell.in: Suppress "ACPI shutdown failed" error to + * tests/util/VasEBoot-shell.in: Suppress "ACPI shutdown failed" error to keep unit tests from failing when they shouldn't. 2010-12-21 Colin Watson - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_RAW_SIZE): The + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_RAW_SIZE): The previous patch increased the size of the RS code by 20 bytes (at least with gcc-4.4), so increase this by 20 bytes to match. - (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise. + (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise. 2010-12-21 Colin Watson - * grub-core/lib/reed_solomon.c (gauss_solve): Fix size of standalone + * VasEBoot-core/lib/reed_solomon.c (gauss_solve): Fix size of standalone scratch area. Make sure to initialise chosen in standalone mode as well as non-standalone. Reported by: Robert Hooker and Andy Whitcroft. @@ -21997,99 +21997,99 @@ 2010-12-21 Colin Watson - * grub-core/commands/echo.c (grub_cmd_echo): Make UTF-8-clean by - constructing a new unescaped string and passing it to grub_xputs in - one go, rather than passing characters to grub_printf one at a time. + * VasEBoot-core/commands/echo.c (VasEBoot_cmd_echo): Make UTF-8-clean by + constructing a new unescaped string and passing it to VasEBoot_xputs in + one go, rather than passing characters to VasEBoot_printf one at a time. 2010-12-21 Colin Watson - * grub-core/fs/udf.c (read_string): Pacify GCC warning by + * VasEBoot-core/fs/udf.c (read_string): Pacify GCC warning by initialising utf16. 2010-12-21 Colin Watson - * util/grub-mkconfig_lib.in (gettext_quoted): Add clarifying + * util/VasEBoot-mkconfig_lib.in (gettext_quoted): Add clarifying comment. Add an extra layer of quotation, requiring the output of this function to be used in a printf format string. (gettext_printf): New function. - * util/grub.d/10_hurd.in: Use gettext_printf where appropriate. + * util/VasEBoot.d/10_hurd.in: Use gettext_printf where appropriate. Extract translatable strings from here-documents and use a temporary variable instead, so that xgettext can find them. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. - * po/grub.d.sed: New file. + * po/VasEBoot.d.sed: New file. * po/Makefile.in.in ($(DOMAIN).pot-update): Extract gettext_printf arguments. Set c-format flags on all strings extracted from - util/grub.d/ (xgettext refuses to include these itself for strings + util/VasEBoot.d/ (xgettext refuses to include these itself for strings it extracted from a shell file, but these really are c-format). 2010-12-20 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_add_module): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_add_module): Avoid next pointing to nowhere. 2010-12-19 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_mount): Read data->bblock.rootblock + * VasEBoot-core/fs/affs.c (VasEBoot_affs_mount): Read data->bblock.rootblock rather than assuming than rootblock is exactly in the middle. - (grub_affs_label): Likewise. + (VasEBoot_affs_label): Likewise. 2010-12-19 Vladimir Serbinenko - * grub-core/fs/affs.c (grub_affs_fs) [GRUB_UTIL]: Explicitly set + * VasEBoot-core/fs/affs.c (VasEBoot_affs_fs) [VasEBoot_UTIL]: Explicitly set reserved_first_sector to 0. - * grub-core/fs/cpio.c (grub_cpio_fs) [GRUB_UTIL]: Likewise. - * grub-core/fs/sfs.c (grub_sfs_fs) [GRUB_UTIL]: Likewise. - * grub-core/fs/xfs.c (grub_xfs_fs) [GRUB_UTIL]: Likewise. + * VasEBoot-core/fs/cpio.c (VasEBoot_cpio_fs) [VasEBoot_UTIL]: Likewise. + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_fs) [VasEBoot_UTIL]: Likewise. + * VasEBoot-core/fs/xfs.c (VasEBoot_xfs_fs) [VasEBoot_UTIL]: Likewise. 2010-12-19 Vladimir Serbinenko Fix handling of UTF-16 UDF labels. - * grub-core/fs/udf.c (grub_udf_iterate_dir): Move string-parsing part + * VasEBoot-core/fs/udf.c (VasEBoot_udf_iterate_dir): Move string-parsing part (read_string): .. here. - (grub_udf_label): Use read_string. + (VasEBoot_udf_label): Use read_string. 2010-12-19 BVK Chaitanya - * grub-core/normal/menu_entry.c (run): Execute commands from menu + * VasEBoot-core/normal/menu_entry.c (run): Execute commands from menu editor under argument scope. Reported by: Jordan Uggla 2010-12-18 Vladimir Serbinenko - * util/grub-mkfont.c (main): Handle errors from FT_Set_Pixel_Sizes. + * util/VasEBoot-mkfont.c (main): Handle errors from FT_Set_Pixel_Sizes. 2010-12-18 Colin Watson - * grub-core/normal/term.c (print_more): Make \r or \n scroll one + * VasEBoot-core/normal/term.c (print_more): Make \r or \n scroll one line, and other keys scroll an entire page (previous handling was for \r and \n to scroll a page and other keys to scroll two lines). 2010-12-18 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_make_mbi): Set ptrdest to correct get_physical_target_address rather than incorrect get_virtual_current_address. 2010-12-18 kashyap garimella - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_load): Use - correct cat to grub_uint8_t * rather than grub_uint32_t *. + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_load): Use + correct cat to VasEBoot_uint8_t * rather than VasEBoot_uint32_t *. 2010-12-10 Colin Watson - * .bzrignore: Ignore grub-core/rs_decoder.S. + * .bzrignore: Ignore VasEBoot-core/rs_decoder.S. 2010-12-10 Colin Watson - * grub-core/gettext/gettext.c (grub_gettext_init_ext): Factor out + * VasEBoot-core/gettext/gettext.c (VasEBoot_gettext_init_ext): Factor out .mo/.mo.gz opening sequence to ... - (grub_mofile_open_lang): ... here. - (grub_gettext_init_ext): If opening ll_CC fails, try ll. - * util/grub.d/00_header.in (grub_lang): Include country part of + (VasEBoot_mofile_open_lang): ... here. + (VasEBoot_gettext_init_ext): If opening ll_CC fails, try ll. + * util/VasEBoot.d/00_header.in (VasEBoot_lang): Include country part of locale. Reported by: Mario Limonciello. @@ -22099,93 +22099,93 @@ 2010-12-04 Colin Watson - * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Use `>> 1' + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_getkey): Use `>> 1' rather than `/ 2', as the latter requires -Wa,--divide which would require bumping our minimum binutils version. 2010-12-03 BVK Chaitanya - * util/grub-script-check.c (main): Print script line number on + * util/VasEBoot-script-check.c (main): Print script line number on error. 2010-12-01 Robert Millan - * grub-core/fs/zfs/zfs.c: New file. - * grub-core/fs/zfs/zfs_fletcher.c: Likewise. - * grub-core/fs/zfs/zfs_lzjb.c: Likewise. - * grub-core/fs/zfs/zfs_sha256.c: Likewise. - * grub-core/fs/zfs/zfsinfo.c: Likewise. + * VasEBoot-core/fs/zfs/zfs.c: New file. + * VasEBoot-core/fs/zfs/zfs_fletcher.c: Likewise. + * VasEBoot-core/fs/zfs/zfs_lzjb.c: Likewise. + * VasEBoot-core/fs/zfs/zfs_sha256.c: Likewise. + * VasEBoot-core/fs/zfs/zfsinfo.c: Likewise. - * include/grub/zfs/dmu.h: Likewise. - * include/grub/zfs/dmu_objset.h: Likewise. - * include/grub/zfs/dnode.h: Likewise. - * include/grub/zfs/dsl_dataset.h: Likewise. - * include/grub/zfs/dsl_dir.h: Likewise. - * include/grub/zfs/sa_impl.h: Likewise. - * include/grub/zfs/spa.h: Likewise. - * include/grub/zfs/uberblock_impl.h: Likewise. - * include/grub/zfs/vdev_impl.h: Likewise. - * include/grub/zfs/zap_impl.h: Likewise. - * include/grub/zfs/zap_leaf.h: Likewise. - * include/grub/zfs/zfs.h: Likewise. - * include/grub/zfs/zfs_acl.h: Likewise. - * include/grub/zfs/zfs_znode.h: Likewise. - * include/grub/zfs/zil.h: Likewise. - * include/grub/zfs/zio.h: Likewise. - * include/grub/zfs/zio_checksum.h: Likewise. + * include/VasEBoot/zfs/dmu.h: Likewise. + * include/VasEBoot/zfs/dmu_objset.h: Likewise. + * include/VasEBoot/zfs/dnode.h: Likewise. + * include/VasEBoot/zfs/dsl_dataset.h: Likewise. + * include/VasEBoot/zfs/dsl_dir.h: Likewise. + * include/VasEBoot/zfs/sa_impl.h: Likewise. + * include/VasEBoot/zfs/spa.h: Likewise. + * include/VasEBoot/zfs/uberblock_impl.h: Likewise. + * include/VasEBoot/zfs/vdev_impl.h: Likewise. + * include/VasEBoot/zfs/zap_impl.h: Likewise. + * include/VasEBoot/zfs/zap_leaf.h: Likewise. + * include/VasEBoot/zfs/zfs.h: Likewise. + * include/VasEBoot/zfs/zfs_acl.h: Likewise. + * include/VasEBoot/zfs/zfs_znode.h: Likewise. + * include/VasEBoot/zfs/zil.h: Likewise. + * include/VasEBoot/zfs/zio.h: Likewise. + * include/VasEBoot/zfs/zio_checksum.h: Likewise. - * Makefile.util.def: Build ZFS into libgrubmods. - * grub-core/Makefile.core.def: Build zfs.mod. + * Makefile.util.def: Build ZFS into libVasEBootmods. + * VasEBoot-core/Makefile.core.def: Build zfs.mod. 2010-11-30 Szymon Janc - * grub-core/commands/regexp.c (grub_cmd_regexp): Remove unused + * VasEBoot-core/commands/regexp.c (VasEBoot_cmd_regexp): Remove unused variable. - * grub-core/commands/wildcard.c (match_files): Likewise. + * VasEBoot-core/commands/wildcard.c (match_files): Likewise. 2010-11-30 Robert Millan - * grub-core/loader/i386/bsd.c - (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module_elf): Check - whether kernel is loaded using grub_loader_is_loaded(), rather + * VasEBoot-core/loader/i386/bsd.c + (VasEBoot_cmd_freebsd_loadenv, VasEBoot_cmd_freebsd_module_elf): Check + whether kernel is loaded using VasEBoot_loader_is_loaded(), rather than `kernel_type', which may still be `KERNEL_TYPE_NONE' under certain error conditions. 2010-11-30 Robert Millan - * grub-core/commands/echo.c: Include `'. - (grub_cmd_echo): Call grub_refresh() after printing a message. + * VasEBoot-core/commands/echo.c: Include `'. + (VasEBoot_cmd_echo): Call VasEBoot_refresh() after printing a message. 2010-11-26 Vladimir Serbinenko Avoid using tricks for initialising endian variables. - * grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot): + * VasEBoot-core/partmap/gpt.c (VasEBoot_gpt_partition_type_bios_boot): Make const. - (GRUB_MOD_INIT): Don't byte-swap. - * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_BIOS_BOOT): - Use grub_cpu_to_le16_compile_time and grub_cpu_to_le32_compile_time. - * include/grub/types.h (grub_swap_bytes16_compile_time): New macro. - (grub_swap_bytes32_compile_time): Likewise. - (grub_cpu_to_le32_compile_time): Likewise. - (grub_cpu_to_le16_compile_time): Likewise. + (VasEBoot_MOD_INIT): Don't byte-swap. + * include/VasEBoot/gpt_partition.h (VasEBoot_GPT_PARTITION_TYPE_BIOS_BOOT): + Use VasEBoot_cpu_to_le16_compile_time and VasEBoot_cpu_to_le32_compile_time. + * include/VasEBoot/types.h (VasEBoot_swap_bytes16_compile_time): New macro. + (VasEBoot_swap_bytes32_compile_time): Likewise. + (VasEBoot_cpu_to_le32_compile_time): Likewise. + (VasEBoot_cpu_to_le16_compile_time): Likewise. 2010-11-26 Vladimir Serbinenko - * util/grub-setup.c (setup): Stop recommending --force. People who + * util/VasEBoot-setup.c (setup): Stop recommending --force. People who understand the dangers of blocklists are able to find this option anyway and the ones who don't shouldn't use it anyway. 2010-11-26 Robert Millan - * grub-core/term/i386/pc/vga_text.c (VGA_TEXT_SCREEN): Beautify. + * VasEBoot-core/term/i386/pc/vga_text.c (VGA_TEXT_SCREEN): Beautify. Update all users. 2010-11-26 Colin Watson Fix LVM-on-RAID probing. - * util/grub-probe.c (probe): Remember which disk was detected as + * util/VasEBoot-probe.c (probe): Remember which disk was detected as RAID (perhaps an LVM physical volume). Use that disk's raidname rather than that of the top-level disk. @@ -22194,30 +22194,30 @@ Fix cmdline argument quotes for setparams command of menuentry definitions. - * grub-core/commands/menuentry.c (setparams_prefix): Use single + * VasEBoot-core/commands/menuentry.c (setparams_prefix): Use single quotes for arguments. - * grub-core/lib/legacy_parse.c (grub_legacy_escape): Use - grub_strchrsub function instead. + * VasEBoot-core/lib/legacy_parse.c (VasEBoot_legacy_escape): Use + VasEBoot_strchrsub function instead. - * include/grub/misc.h (grub_strchrsub): New function. + * include/VasEBoot/misc.h (VasEBoot_strchrsub): New function. 2010-11-24 Colin Watson - * util/deviceiter.c (grub_util_iterate_devices): Save a bit of + * util/deviceiter.c (VasEBoot_util_iterate_devices): Save a bit of effort by skipping "." and ".." entries up-front. Suggested by: Michael Lazarev. 2010-11-24 Colin Watson - * grub-core/Makefile.core.def (xz_decompress): Move -lgcc from + * VasEBoot-core/Makefile.core.def (xz_decompress): Move -lgcc from ldflags to ldadd, to fix link line ordering. (none_decompress): Likewise. 2010-11-24 Colin Watson - * grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu + * VasEBoot-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu platforms. - (grub-emu-lite): Remove kern/emu/cache.S. + (VasEBoot-emu-lite): Remove kern/emu/cache.S. 2010-11-23 Colin Watson @@ -22228,29 +22228,29 @@ 2010-11-23 Colin Watson - * Makefile.util.def (grub-menulst2cfg): List libraries in ldadd, not + * Makefile.util.def (VasEBoot-menulst2cfg): List libraries in ldadd, not ldflags, to fix link line ordering. 2010-11-23 Colin Watson - * grub-core/Makefile.am (gentrigtables): Put -lm after $<; some + * VasEBoot-core/Makefile.am (gentrigtables): Put -lm after $<; some linkers are picky about this. 2010-11-23 Colin Watson - * grub-core/Makefile.am (command.lst): Adjust sed expression + * VasEBoot-core/Makefile.am (command.lst): Adjust sed expression ordering so that extended and priority commands aren't treated as ordinary commands. 2010-11-23 Colin Watson - * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_BIOS_BOOT): + * include/VasEBoot/gpt_partition.h (VasEBoot_GPT_PARTITION_TYPE_BIOS_BOOT): Remove byte-swapping function calls, which are not valid in structure initialisers. - * grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot): Make + * VasEBoot-core/partmap/gpt.c (VasEBoot_gpt_partition_type_bios_boot): Make non-const. - (GRUB_MOD_INIT): Byte-swap data1, data2, and data3 fields of - grub_gpt_partition_type_bios_boot. + (VasEBoot_MOD_INIT): Byte-swap data1, data2, and data3 fields of + VasEBoot_gpt_partition_type_bios_boot. 2010-11-22 Colin Watson @@ -22261,37 +22261,37 @@ 2010-11-22 Colin Watson - * util/grub-install.in: Fix parsing of --grub-mkrelpath= option. + * util/VasEBoot-install.in: Fix parsing of --VasEBoot-mkrelpath= option. 2010-11-22 Colin Watson - * util/grub-install.in: Remove excessive quoting that broke + * util/VasEBoot-install.in: Remove excessive quoting that broke installations to RAID devices. 2010-11-19 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_cmd_linux): Pass correctly the + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Pass correctly the bootloader version instead of 0. 2010-11-19 Vladimir Serbinenko - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Fix spurious + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Fix spurious warning. 2010-11-19 Vladimir Serbinenko - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Don't try to + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Don't try to retrieve the metadat sector if size isn't known. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Likewise. 2010-11-18 Robert Millan - * grub-core/fs/btrfs.c (grub_btrfs_mount): Replace grub_strncmp() - with grub_memcmp(). + * VasEBoot-core/fs/btrfs.c (VasEBoot_btrfs_mount): Replace VasEBoot_strncmp() + with VasEBoot_memcmp(). 2010-11-18 Vladimir Serbinenko - * grub-core/normal/menu_entry.c (print_up): Fix displacement of up + * VasEBoot-core/normal/menu_entry.c (print_up): Fix displacement of up arrow. Reported by: Jordan Uggla. @@ -22299,21 +22299,21 @@ Make better UTF compliant. - * grub-core/normal/charset.c (grub_utf8_to_utf16): Handle 6- and 7-byte + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_to_utf16): Handle 6- and 7-byte sequences as incorrect. - (grub_is_valid_utf8): Likewise. - (grub_utf8_to_ucs4): Likewise. - (grub_ucs4_to_utf8): Handle codepoints outside of BMP. - (grub_ucs4_to_utf8_alloc): Likewise. - * include/grub/charset.h (grub_utf16_to_utf8): Likewise. + (VasEBoot_is_valid_utf8): Likewise. + (VasEBoot_utf8_to_ucs4): Likewise. + (VasEBoot_ucs4_to_utf8): Handle codepoints outside of BMP. + (VasEBoot_ucs4_to_utf8_alloc): Likewise. + * include/VasEBoot/charset.h (VasEBoot_utf16_to_utf8): Likewise. 2010-11-16 Vladimir Serbinenko Make legacy_source behave like source. - * grub-core/commands/legacycfg.c (legacy_file): Don't call - grub_show_menu. - (grub_cmd_legacy_source): Call grub_show_menu if needed. + * VasEBoot-core/commands/legacycfg.c (legacy_file): Don't call + VasEBoot_show_menu. + (VasEBoot_cmd_legacy_source): Call VasEBoot_show_menu if needed. 2010-11-16 Colin Watson @@ -22328,25 +22328,25 @@ 2010-11-15 Vladimir Serbinenko - * grub-core/term/at_keyboard.c (grub_keyboard_controller_read) - [GRUB_MACHINE_MIPS_YEELOONG || GRUB_MACHINE_QEMU]: ifdef-ed out + * VasEBoot-core/term/at_keyboard.c (VasEBoot_keyboard_controller_read) + [VasEBoot_MACHINE_MIPS_YEELOONG || VasEBoot_MACHINE_QEMU]: ifdef-ed out (now unused). - (grub_keyboard_controller_init) - [GRUB_MACHINE_MIPS_YEELOONG || GRUB_MACHINE_QEMU]: Don't attempt to + (VasEBoot_keyboard_controller_init) + [VasEBoot_MACHINE_MIPS_YEELOONG || VasEBoot_MACHINE_QEMU]: Don't attempt to read the initial state since controller isn't inited yet. 2010-11-15 Vladimir Serbinenko - * grub-core/lib/relocator.c (malloc_in_range): Take into account that + * VasEBoot-core/lib/relocator.c (malloc_in_range): Take into account that allocate_regbeg may need to create new chunk header. 2010-11-14 Vladimir Serbinenko Fix quoting in legacy parser. - * grub-core/lib/legacy_parse.c (grub_legacy_escape): Correctly handle + * VasEBoot-core/lib/legacy_parse.c (VasEBoot_legacy_escape): Correctly handle single quotes. - (grub_legacy_parse): Likewise. + (VasEBoot_legacy_parse): Likewise. Reported by: Jordan Uggla. Tested by: Jordan Uggla. @@ -22356,7 +22356,7 @@ * configure.ac (LIBS): Don't add -lgcc on i386 and x86_64. * conf/Makefile.common (LDADD_KERNEL): Likewise. - * grub-core/Makefile.core.def (kernel): Use LDADD_KERNEL. + * VasEBoot-core/Makefile.core.def (kernel): Use LDADD_KERNEL. 2010-11-14 Vladimir Serbinenko @@ -22364,19 +22364,19 @@ 2010-11-14 Modestas Vainius - * grub-core/kern/emu/getroot.c (grub_util_is_dmraid): Recognise ddf1_ + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_is_dmraid): Recognise ddf1_ fakeraid. 2010-11-14 Giuseppe Caizzone Add generic logical block size support for UDF. - * grub-core/fs/udf.c (GRUB_UDF_LOG2_BLKSIZE): Removed. - (GRUB_UDF_BLKSZ): Removed. - (struct grub_udf_data): New field "lbshift" to hold the logical block + * VasEBoot-core/fs/udf.c (VasEBoot_UDF_LOG2_BLKSIZE): Removed. + (VasEBoot_UDF_BLKSZ): Removed. + (struct VasEBoot_udf_data): New field "lbshift" to hold the logical block size of the file system in log2 format. All users updated. (sblocklist): Change type to unsigned. - (grub_udf_mount): Change type of "sblklist" to unsigned. + (VasEBoot_udf_mount): Change type of "sblklist" to unsigned. Move AVDP search before VRS recognition, because the latter requires knowledge of the logical block size, which is detected during the former. @@ -22388,98 +22388,98 @@ Properly handle deleted files on UDF. - * grub-core/fs/udf.c (grub_udf_iterate_dir): Skip directory entries - whose "characteristics" field has the bit GRUB_UDF_FID_CHAR_DELETED + * VasEBoot-core/fs/udf.c (VasEBoot_udf_iterate_dir): Skip directory entries + whose "characteristics" field has the bit VasEBoot_UDF_FID_CHAR_DELETED set. 2010-11-14 Giuseppe Caizzone Support reading files larger than 2 GiB. - * grub-core/fs/udf.c (grub_udf_iterate_dir): Change type of variable - "offset" to grub_off_t. - (grub_udf_read_file): Likewise for parameter "pos". + * VasEBoot-core/fs/udf.c (VasEBoot_udf_iterate_dir): Change type of variable + "offset" to VasEBoot_off_t. + (VasEBoot_udf_read_file): Likewise for parameter "pos". 2010-11-14 Vladimir Serbinenko - * docs/grub.texi (Changes from GRUB Legacy): Note when save_env is + * docs/VasEBoot.texi (Changes from VasEBoot Legacy): Note when save_env is unavailable. - (Simple configuration): Refer to Changes from GRUB Legacy about + (Simple configuration): Refer to Changes from VasEBoot Legacy about save_env availability. 2010-11-14 Vladimir Serbinenko - * util/grub-install.in: Ignore empty partition table detection + * util/VasEBoot-install.in: Ignore empty partition table detection instead of trying to include part_ module. 2010-11-14 Vladimir Serbinenko - * grub-core/disk/lvm.c (GRUB_MOD_FINI): Reset the vg_list. Fixes + * VasEBoot-core/disk/lvm.c (VasEBoot_MOD_FINI): Reset the vg_list. Fixes LVM on RAID support. 2010-11-14 Vladimir Serbinenko Properly define WORDS_BIGENDIAN in wrapped environments. - * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (WORDS_BIGENDIAN): New + * VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h (WORDS_BIGENDIAN): New definition. - * grub-core/lib/posix_wrap/sys/types.h (WORDS_BIGENDIAN): Likewise. + * VasEBoot-core/lib/posix_wrap/sys/types.h (WORDS_BIGENDIAN): Likewise. Reported by: Manoel Rebelo Abranches. Tested by: Manoel Rebelo Abranches. 2010-11-13 Vladimir Serbinenko - * util/grub-mkconfig.in: Fix quoting. + * util/VasEBoot-mkconfig.in: Fix quoting. 2010-11-13 Vladimir Serbinenko Support big ext2 files. - * grub-core/fs/ext2.c (grub_ext2_inode): Rename dir_acl to size_high. - (grub_ext2_read_block): Support triple indirect blocks. - (grub_ext2_read_file): Use 64-bit types and read size_high. - (grub_ext2_open): Read size_high. + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_inode): Rename dir_acl to size_high. + (VasEBoot_ext2_read_block): Support triple indirect blocks. + (VasEBoot_ext2_read_file): Use 64-bit types and read size_high. + (VasEBoot_ext2_open): Read size_high. Reported by: Ximin Luo. Tested by: Manoel Rebelo Abranches. 2010-11-13 Vladimir Serbinenko - * util/grub-install.in: Handle filenames containing spaces. + * util/VasEBoot-install.in: Handle filenames containing spaces. Reported by: Jordan Uggla. Tested by: Jordan Uggla. 2010-11-13 Vladimir Serbinenko - * util/grub-mkconfig.in (grub_script_check): New variable. - Use grub_script_check instead of grub-script-check. + * util/VasEBoot-mkconfig.in (VasEBoot_script_check): New variable. + Use VasEBoot_script_check instead of VasEBoot-script-check. Reported by: Barry Jackson. 2010-11-13 Vladimir Serbinenko - * docs/grub.texi (menu): Correct the order. + * docs/VasEBoot.texi (menu): Correct the order. Reported by: D. Hugh Redelmeier. 2010-11-12 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S (multiboot_trampoline): Add missing + * VasEBoot-core/kern/i386/pc/startup.S (multiboot_trampoline): Add missing jump. 2010-11-08 Manoel Rebelo Abranches - * include/grub/elfload.h (grub_elf32_size): New parameter. + * include/VasEBoot/elfload.h (VasEBoot_elf32_size): New parameter. All users updated. Return maximum segments alignment. - (grub_elf64_size): Likewise. - * kern/elf.c (grub_elf32_size): New parameter. All users updated. + (VasEBoot_elf64_size): Likewise. + * kern/elf.c (VasEBoot_elf32_size): New parameter. All users updated. Return maximum segments alignment. - (grub_elf64_size): Likewise. - * grub-core/loader/powerpc/ieee1275/linux.c: - (grub_linux_claimmap_iterate): New function. Uses the + (VasEBoot_elf64_size): Likewise. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c: + (VasEBoot_linux_claimmap_iterate): New function. Uses the "available" property in the "memory" node for memory allocation for kernel in the PowerPC loader. - (grub_linux_load32): Correctly find linux entry point offset. - (grub_linux_load64): Likewise. + (VasEBoot_linux_load32): Correctly find linux entry point offset. + (VasEBoot_linux_load64): Likewise. 2010-11-07 Robert Millan @@ -22495,9 +22495,9 @@ Suppress shell expansion on echo '*' and echo "*" like cases. Reported by: Jordan Uggla. - * grub-core/script/execute.c (grub_script_arglist_to_argv): Escape + * VasEBoot-core/script/execute.c (VasEBoot_script_arglist_to_argv): Escape string arguments before shell expansion. - * tests/grub_cmd_echo.in: New testcases. + * tests/VasEBoot_cmd_echo.in: New testcases. 2010-11-07 Robert Millan @@ -22506,22 +22506,22 @@ 2010-11-07 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Handle devices like "sdaa1". 2010-11-06 Vladimir Serbinenko - * include/grub/emu/misc.h: Don't include grub/util/libzfs.h. - * include/grub/emu/misc.h (grub_get_libzfs_handle): Move from here ... - * include/grub/util/libzfs.h (grub_get_libzfs_handle): ... here. + * include/VasEBoot/emu/misc.h: Don't include VasEBoot/util/libzfs.h. + * include/VasEBoot/emu/misc.h (VasEBoot_get_libzfs_handle): Move from here ... + * include/VasEBoot/util/libzfs.h (VasEBoot_get_libzfs_handle): ... here. 2010-11-06 Vladimir Serbinenko - * grub-core/fs/ntfs.c (grub_ntfs_uuid): Make uppercase. + * VasEBoot-core/fs/ntfs.c (VasEBoot_ntfs_uuid): Make uppercase. 2010-11-06 Vladimir Serbinenko - * util/grub-install.in: Replace useless recomendation to pass + * util/VasEBoot-install.in: Replace useless recomendation to pass --modules with a recomendation to report a bug. 2010-11-06 Vladimir Serbinenko @@ -22529,31 +22529,31 @@ Properly register serial terminfo. Reported by: Jordan Uggla - * grub-core/term/serial.c (grub_serial_terminfo_input_template): New + * VasEBoot-core/term/serial.c (VasEBoot_serial_terminfo_input_template): New const. - (grub_serial_terminfo_output_template): Likewise. - (grub_cmd_serial): Register "serial" with terminfo. - (GRUB_MOD_INIT(serial)): Fill grub_serial_terminfo_input and - grub_serial_terminfo_output. + (VasEBoot_serial_terminfo_output_template): Likewise. + (VasEBoot_cmd_serial): Register "serial" with terminfo. + (VasEBoot_MOD_INIT(serial)): Fill VasEBoot_serial_terminfo_input and + VasEBoot_serial_terminfo_output. 2010-11-05 Robert Millan - * util/grub-mkconfig.in: Remove gfxterm.mod probe (no longer + * util/VasEBoot-mkconfig.in: Remove gfxterm.mod probe (no longer needed). 2010-11-05 Robert Millan On Yeeloong, pass machine type information to Linux. - * grub-core/loader/mips/linux.c [GRUB_MACHINE_MIPS_YEELOONG] + * VasEBoot-core/loader/mips/linux.c [VasEBoot_MACHINE_MIPS_YEELOONG] (LOONGSON_MACHTYPE): New macro, set to "machtype=lemote-yeeloong-2f-8.9inches". - [LOONGSON_MACHTYPE] (grub_cmd_linux): Pass LOONGSON_MACHTYPE as + [LOONGSON_MACHTYPE] (VasEBoot_cmd_linux): Pass LOONGSON_MACHTYPE as additional argument to Linux. 2010-11-04 Robert Millan - * util/deviceiter.c (grub_util_iterate_devices): Increase SCSI + * util/deviceiter.c (VasEBoot_util_iterate_devices): Increase SCSI limit to 48 (to cope with Sun Fire X4500), and IDE limit to 96 (its SATA disks are detected as slaveless IDE master drives on kFreeBSD). @@ -22565,290 +22565,290 @@ 2010-11-01 Grégoire Sutre - * grub-core/partmap/bsdlabel.c (iterate_real): Fix an integer overflow. + * VasEBoot-core/partmap/bsdlabel.c (iterate_real): Fix an integer overflow. 2010-11-01 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (grub_cmd_linux): Autoload vbe.mod if + * VasEBoot-core/loader/i386/linux.c (VasEBoot_cmd_linux): Autoload vbe.mod if vga= option is supplied. 2010-11-01 Vladimir Serbinenko - * util/grub.d/10_hurd.in: Don't call savedefault on recovery entries. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Don't call savedefault on recovery entries. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. 2010-11-01 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_parse): Avoid interpreting direct + * VasEBoot-core/lib/arg.c (VasEBoot_arg_parse): Avoid interpreting direct argument as an argument to no-argument option. 2010-11-01 Vladimir Serbinenko - * util/grub.d/10_linux.in: Add missing load_video with explicit - GRUB_GFXPAYLOAD_LINUX. + * util/VasEBoot.d/10_linux.in: Add missing load_video with explicit + VasEBoot_GFXPAYLOAD_LINUX. 2010-11-01 Vladimir Serbinenko - * Makefile.am (libgrub.pp): Propagate the libgrub.a split. + * Makefile.am (libVasEBoot.pp): Propagate the libVasEBoot.a split. 2010-11-01 Vladimir Serbinenko - * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Do not put + * VasEBoot-core/disk/mdraid1x_linux.c (VasEBoot_mdraid_detect): Do not put elements with invlid index. - * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. - * grub-core/disk/raid.c (insert_array): Automatically reallocate + * VasEBoot-core/disk/mdraid_linux.c (VasEBoot_mdraid_detect): Likewise. + * VasEBoot-core/disk/raid.c (insert_array): Automatically reallocate members. - * include/grub/raid.h (grub_raid_member): New struct. - (grub_raid_array): Transform devices and start_sector into usage of - grub_raid_member. All users updated + * include/VasEBoot/raid.h (VasEBoot_raid_member): New struct. + (VasEBoot_raid_array): Transform devices and start_sector into usage of + VasEBoot_raid_member. All users updated (allocated_devs): New member. 2010-11-01 Vladimir Serbinenko - * docs/man/grub-set-default.h2m: Clarify that only saved default entry + * docs/man/VasEBoot-set-default.h2m: Clarify that only saved default entry is modified 2010-10-29 BVK Chaitanya NetBSD build fix for getline function conflict from gnulib. - * Makefile.util.def (libgrubkern.a): New library for grub kernel + * Makefile.util.def (libVasEBootkern.a): New library for VasEBoot kernel components that depend on gnulib headers. - (libgrubmods.a): Renamed from earlier libgrub.a. + (libVasEBootmods.a): Renamed from earlier libVasEBoot.a. * conf/Makefile.common: Remove gnulib from *_LIBRARY flags. 2010-10-26 Vladimir Serbinenko - * util/grub-setup.c (setup): Refuse to do a cross-disk embeddingless + * util/VasEBoot-setup.c (setup): Refuse to do a cross-disk embeddingless install rather than creating a broken install. 2010-10-26 Vladimir Serbinenko - * util/grub-setup.c (argp): Remove misleading example of installing to + * util/VasEBoot-setup.c (argp): Remove misleading example of installing to a partition. 2010-10-26 Vladimir Serbinenko - * util/grub-setup.c (setup): Clarify the error message. + * util/VasEBoot-setup.c (setup): Clarify the error message. 2010-10-26 Vladimir Serbinenko - * include/grub/types.h (grub_target_off_t): Removed no longer used type. + * include/VasEBoot/types.h (VasEBoot_target_off_t): Removed no longer used type. 2010-10-23 Vladimir Serbinenko - * grub-core/kern/emu/misc.c - (grub_make_system_path_relative_to_its_root) + * VasEBoot-core/kern/emu/misc.c + (VasEBoot_make_system_path_relative_to_its_root) [HAVE_LIBZFS && HAVE_LIBNVPAIR]: Fix mountpoint return on ZFS. 2010-10-23 Vladimir Serbinenko - * grub-core/kern/emu/misc.c - (grub_make_system_path_relative_to_its_root): Revert r2882. + * VasEBoot-core/kern/emu/misc.c + (VasEBoot_make_system_path_relative_to_its_root): Revert r2882. 2010-10-22 Vladimir Serbinenko - * grub-core/lib/relocator.c (grub_relocator_subchunk): Remove now + * VasEBoot-core/lib/relocator.c (VasEBoot_relocator_subchunk): Remove now useless field head. All users updated. (free_subchunk): Correct handling of IN_REGION subchunk. 2010-10-22 Colin Watson - * docs/grub.texi (Installing GRUB using grub-install): Proofread. + * docs/VasEBoot.texi (Installing VasEBoot using VasEBoot-install): Proofread. (Supported kernels): Likewise. 2010-10-18 Grégoire Sutre Make mktemp invocations portable. - * grub-core/genmod.sh.in: Use mktemp with an explicit template, and + * VasEBoot-core/genmod.sh.in: Use mktemp with an explicit template, and exit if mktemp fails. - * tests/grub_script_blockarg.in: Likewise. + * tests/VasEBoot_script_blockarg.in: Likewise. * tests/partmap_test.in: Likewise. - * tests/util/grub-shell-tester.in: Likewise. - * tests/util/grub-shell.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * tests/util/VasEBoot-shell-tester.in: Likewise. + * tests/util/VasEBoot-shell.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. * Makefile.am: Likewise, and chain shell commands with `&&' instead of ';'. - * util/grub-mkrescue.in: Use the same explicit template as above, and + * util/VasEBoot-mkrescue.in: Use the same explicit template as above, and exit if mktemp fails. 2010-10-18 BVK Chaitanya - * util/grub.d/10_linux.in: Fix built-in initramfs image mode for + * util/VasEBoot.d/10_linux.in: Fix built-in initramfs image mode for Linux kernel, reported by Dennis Schridde. 2010-10-17 Szymon Janc - * grub-core/normal/auth.c (grub_auth_check_authentication): + * VasEBoot-core/normal/auth.c (VasEBoot_auth_check_authentication): Set-but-not-used variable removed. 2010-10-17 Vladimir Serbinenko - * docs/grub.texi (GNU/Linux): Document APM unavailability with + * docs/VasEBoot.texi (GNU/Linux): Document APM unavailability with 32-bit linux protocol. 2010-10-17 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Check + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_setcursor): Check cursor shape for sanity. 2010-10-17 Vladimir Serbinenko - * docs/grub.texi (Installation): Document buggy BIOS install. + * docs/VasEBoot.texi (Installation): Document buggy BIOS install. 2010-10-17 Vladimir Serbinenko - * docs/grub.texi (Installation): Indent. + * docs/VasEBoot.texi (Installation): Indent. 2010-10-17 Vladimir Serbinenko - * util/grub-setup.c (setup): New parameter allow_floppy. + * util/VasEBoot-setup.c (setup): New parameter allow_floppy. (arguments): New member allow_floppy. (argp_parser): Handle --allow-floppy. (main): Pass allow_floppy. - * util/grub-install.in: New option --allow-floppy passed though to - grub-setup. + * util/VasEBoot-install.in: New option --allow-floppy passed though to + VasEBoot-setup. 2010-10-17 Vladimir Serbinenko - * util/grub-install.in: Handle partitionless disks. + * util/VasEBoot-install.in: Handle partitionless disks. 2010-10-17 Vladimir Serbinenko - * util/grub-setup.c (setup): Don't clean blocklists before readability + * util/VasEBoot-setup.c (setup): Don't clean blocklists before readability verfification. 2010-10-16 Vladimir Serbinenko - * docs/grub.texi (Installation): Document embedding zone. Remove - obsolete grub-install example. + * docs/VasEBoot.texi (Installation): Document embedding zone. Remove + obsolete VasEBoot-install example. 2010-10-16 Szymon Janc - * grub-core/commands/legacycfg.c (grub_cmd_legacy_kernel): + * VasEBoot-core/commands/legacycfg.c (VasEBoot_cmd_legacy_kernel): Set-but-not-used variable ifdef'ed. - * grub-core/lib/legacy_parse.c (grub_legacy_parse): Likewise. - * grub-core/bus/usb/ohci.c (grub_ohci_pci_iter): Set-but-not-used + * VasEBoot-core/lib/legacy_parse.c (VasEBoot_legacy_parse): Likewise. + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Set-but-not-used variable removed. - * grub-core/disk/lvm.c (grub_lvm_scan_device): Likewise. - * grub-core/fs/jfs.c (grub_jfs_find_file): Likewise. - * grub-core/fs/minix.c (grub_minix_dir): Likewise. - * grub-core/fs/sfs.c (grub_sfs_read_extent): Likewise. - * grub-core/fs/ufs.c (grub_ufs_dir): Likewise. - * grub-core/gfxmenu/gui_list.c (grub_gui_list_new): Likewise. - * grub-core/gfxmenu/view.c (redraw_menu_visit): Likewise. - * grub-core/gfxmenu/widget-box.c (draw): Likewise. - * grub-core/lib/relocator.c (malloc_in_range): Likewise. - * grub-core/loader/i386/bsdXX.c (grub_netbsd_load_elf_meta): Likewise. - * grub-core/loader/i386/bsd_pagetable.c (fill_bsd64_pagetable): + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_scan_device): Likewise. + * VasEBoot-core/fs/jfs.c (VasEBoot_jfs_find_file): Likewise. + * VasEBoot-core/fs/minix.c (VasEBoot_minix_dir): Likewise. + * VasEBoot-core/fs/sfs.c (VasEBoot_sfs_read_extent): Likewise. + * VasEBoot-core/fs/ufs.c (VasEBoot_ufs_dir): Likewise. + * VasEBoot-core/gfxmenu/gui_list.c (VasEBoot_gui_list_new): Likewise. + * VasEBoot-core/gfxmenu/view.c (redraw_menu_visit): Likewise. + * VasEBoot-core/gfxmenu/widget-box.c (draw): Likewise. + * VasEBoot-core/lib/relocator.c (malloc_in_range): Likewise. + * VasEBoot-core/loader/i386/bsdXX.c (VasEBoot_netbsd_load_elf_meta): Likewise. + * VasEBoot-core/loader/i386/bsd_pagetable.c (fill_bsd64_pagetable): Likewise. 2010-10-16 Vladimir Serbinenko - * grub-core/commands/acpihalt.c (skip_ext_op): Skip index field op. - * include/grub/acpi.h (GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP): New + * VasEBoot-core/commands/acpihalt.c (skip_ext_op): Skip index field op. + * include/VasEBoot/acpi.h (VasEBoot_ACPI_EXTOPCODE_INDEX_FIELD_OP): New enum value. 2010-10-16 Vladimir Serbinenko - * grub-core/commands/acpihalt.c (get_sleep_type): Accept \_S5_ as + * VasEBoot-core/commands/acpihalt.c (get_sleep_type): Accept \_S5_ as synonym to _S5_. Needed for some DSDTs. 2010-10-16 Vladimir Serbinenko Userspace ACPI parser debugging. - * grub-core/commands/acpihalt.c [GRUB_DSDT_TEST]: Include userspace + * VasEBoot-core/commands/acpihalt.c [VasEBoot_DSDT_TEST]: Include userspace headers and add relevant defines. Don't include standard headers. - (main) [GRUB_DSDT_TEST]: New function. - * include/grub/acpi.h [GRUB_DSDT_TEST]: Don't include standard headers. + (main) [VasEBoot_DSDT_TEST]: New function. + * include/VasEBoot/acpi.h [VasEBoot_DSDT_TEST]: Don't include standard headers. Don't declare functions. 2010-10-16 Vladimir Serbinenko - Remove dead grub_efi_mm_fini. + Remove dead VasEBoot_efi_mm_fini. - * grub-core/kern/efi/mm.c (allocated_page): Removed. + * VasEBoot-core/kern/efi/mm.c (allocated_page): Removed. (ALLOCATED_PAGES_SIZE): Likewise. (MAX_ALLOCATED_PAGES): Likewise. (allocated_pages): Likewise. - (grub_efi_allocate_pages): Don't record allocated pages. - (grub_efi_free_pages): Likewise. - (grub_efi_mm_init): Likewise. - (grub_efi_mm_fini): Removed. + (VasEBoot_efi_allocate_pages): Don't record allocated pages. + (VasEBoot_efi_free_pages): Likewise. + (VasEBoot_efi_mm_init): Likewise. + (VasEBoot_efi_mm_fini): Removed. 2010-10-16 Vladimir Serbinenko - * grub-core/kern/efi/mm.c (BYTES_TO_PAGES): Round up instead of down. - (grub_efi_mm_init): Take into account the memory map size increase. + * VasEBoot-core/kern/efi/mm.c (BYTES_TO_PAGES): Round up instead of down. + (VasEBoot_efi_mm_init): Take into account the memory map size increase. 2010-10-16 Vladimir Serbinenko - * grub-core/term/ns8250.c (do_real_config): Set port->broken to 0. + * VasEBoot-core/term/ns8250.c (do_real_config): Set port->broken to 0. (serial_hw_put): Wait based on real time rather than port reads. Don't roken ports. - * include/grub/serial.h (grub_serial_port): New field broken. + * include/VasEBoot/serial.h (VasEBoot_serial_port): New field broken. 2010-10-16 Robert Millan - * grub-core/kern/emu/misc.c - (grub_make_system_path_relative_to_its_root): Fix premature return + * VasEBoot-core/kern/emu/misc.c + (VasEBoot_make_system_path_relative_to_its_root): Fix premature return when processing non-root ZFS filesystems. Reported by Sergio Talens-Oliag. 2010-10-15 Robert Millan - * util/grub.d/10_linux.in (list): Expand "vmlinu[zx]" instances to + * util/VasEBoot.d/10_linux.in (list): Expand "vmlinu[zx]" instances to guarantee compressed ones are processed first. 2010-10-14 Vladimir Serbinenko - * grub-core/efiemu/main.c (grub_efiemu_prepare): Handle errors from - grub_efiemu_autocore. + * VasEBoot-core/efiemu/main.c (VasEBoot_efiemu_prepare): Handle errors from + VasEBoot_efiemu_autocore. 2010-10-14 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S (bypass_table): Use 0x1b explicitly + * VasEBoot-core/kern/i386/pc/startup.S (bypass_table): Use 0x1b explicitly rather than 0x1b. - (grub_console_getkey): Use correct jae opcode rather than ja. + (VasEBoot_console_getkey): Use correct jae opcode rather than ja. 2010-10-12 Robert Millan - * util/grub-mkconfig.in: Merge `GRUB_DISABLE_LINUX_RECOVERY' and - `GRUB_DISABLE_NETBSD_RECOVERY' into a single `GRUB_DISABLE_RECOVERY' + * util/VasEBoot-mkconfig.in: Merge `VasEBoot_DISABLE_LINUX_RECOVERY' and + `VasEBoot_DISABLE_NETBSD_RECOVERY' into a single `VasEBoot_DISABLE_RECOVERY' variable. All references updated. - * util/grub.d/10_kfreebsd.in: Support recovery boot entries. + * util/VasEBoot.d/10_kfreebsd.in: Support recovery boot entries. 2010-10-08 Vladimir Serbinenko Correctly distinguish mdraid flavours. - * grub-core/disk/raid.c (grub_raid_getname) [GRUB_UTIL]: New function. + * VasEBoot-core/disk/raid.c (VasEBoot_raid_getname) [VasEBoot_UTIL]: New function. (insert_array): New argument raid. - * include/grub/disk.h (grub_disk_dev) [GRUB_UTIL]: New member raidname. - * include/grub/raid.h (grub_raid_array) [GRUB_UTIL]: New member driver. - * util/grub-probe.c (probe): PRint raidname instead of plainly "mdraid". + * include/VasEBoot/disk.h (VasEBoot_disk_dev) [VasEBoot_UTIL]: New member raidname. + * include/VasEBoot/raid.h (VasEBoot_raid_array) [VasEBoot_UTIL]: New member driver. + * util/VasEBoot-probe.c (probe): PRint raidname instead of plainly "mdraid". 2010-10-09 Vladimir Serbinenko - * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Fix incorrect + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_console_getkey): Fix incorrect handling of special keys. 2010-10-02 Aleš Nesrsta - * include/grub/scsi.h (grub_make_scsi_id): Fix incorrect usgae of - GRUB_SCSI_ID_BUS_SHIFT instead of GRUB_SCSI_ID_LUN_SHIFT. + * include/VasEBoot/scsi.h (VasEBoot_make_scsi_id): Fix incorrect usgae of + VasEBoot_SCSI_ID_BUS_SHIFT instead of VasEBoot_SCSI_ID_LUN_SHIFT. 2010-10-02 Aleš Nesrsta - * grub-core/bus/usb/ohci.c (GRUB_OHCI_TDS): Increase. - * grub-core/bus/usb/uhci.c (N_TD): New definition. All previous implicit + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_OHCI_TDS): Increase. + * VasEBoot-core/bus/usb/uhci.c (N_TD): New definition. All previous implicit users updated. - * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_setup_readwrite): + * VasEBoot-core/bus/usb/usbtrans.c (VasEBoot_usb_bulk_setup_readwrite): Use right endpoint when querying descriptor. 2010-10-01 Vladimir Serbinenko @@ -22857,34 +22857,34 @@ Tested by: decoder Reported by: decoder and meta tech. - * grub-core/term/efi/console.c (grub_console_standard_color): Removed. - (grub_console_setcolorstate): Clear out 0x80 bit. - Use GRUB_TERM_DEFAULT_STANDARD_COLOR. - (grub_console_output): Use GRUB_TERM_DEFAULT_NORMAL_COLOR. - Use GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR. + * VasEBoot-core/term/efi/console.c (VasEBoot_console_standard_color): Removed. + (VasEBoot_console_setcolorstate): Clear out 0x80 bit. + Use VasEBoot_TERM_DEFAULT_STANDARD_COLOR. + (VasEBoot_console_output): Use VasEBoot_TERM_DEFAULT_NORMAL_COLOR. + Use VasEBoot_TERM_DEFAULT_HIGHLIGHT_COLOR. 2010-10-01 Vladimir Serbinenko - * grub-core/loader/i386/linux.c (DEFAULT_VIDEO_MODE) [GRUB_MACHINE_EFI]: + * VasEBoot-core/loader/i386/linux.c (DEFAULT_VIDEO_MODE) [VasEBoot_MACHINE_EFI]: Set to "auto". 2010-09-30 Vladimir Serbinenko - * grub-core/gettext/gettext.c (grub_gettext_init_ext): Avoid using + * VasEBoot-core/gettext/gettext.c (VasEBoot_gettext_init_ext): Avoid using mo_file after freeing. 2010-09-30 Vladimir Serbinenko - * grub-core/normal/term.c (read_terminal_list): Free in a right order. + * VasEBoot-core/normal/term.c (read_terminal_list): Free in a right order. 2010-09-30 Vladimir Serbinenko - * grub-core/script/execute.c (grub_script_execute_sourcecode): Set + * VasEBoot-core/script/execute.c (VasEBoot_script_execute_sourcecode): Set flags. 2010-09-30 Vladimir Serbinenko - * util/grub-setup.c (main) [GRUB_MACHINE_IEEE1275]: Propagate argp + * util/VasEBoot-setup.c (main) [VasEBoot_MACHINE_IEEE1275]: Propagate argp usage. 2010-09-30 Vladimir Serbinenko @@ -22892,96 +22892,96 @@ Put terminfo into core on ieee1275 and yeeloong (needed for console). * gentpl.py: New groups terminfoinkernel and terminfomodule. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Include extcmd.h, arg.h + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Include extcmd.h, arg.h and terminfo.h when needed. - * grub-core/Makefile.core.def (kernel): Include term/terminfo.c, + * VasEBoot-core/Makefile.core.def (kernel): Include term/terminfo.c, term/tparm.c, commands/extcmd.c, lib/arg.c on terminfokernel. (terminfo): Enable only on terminfokernel. (extcmd): Likewise. - * include/grub/extcmd.h: Add missing EXPORT_FUNC. - * include/grub/lib/arg.h: Likewise. - * grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_dimensions): Fix + * include/VasEBoot/extcmd.h: Add missing EXPORT_FUNC. + * include/VasEBoot/lib/arg.h: Likewise. + * VasEBoot-core/term/ieee1275/ofconsole.c (VasEBoot_ofconsole_dimensions): Fix incorrect usage of ->. 2010-09-29 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_make_mbi] - [GRUB_MACHINE_EFI && __i386__]: Fix typo. + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_make_mbi] + [VasEBoot_MACHINE_EFI && __i386__]: Fix typo. 2010-09-29 Vladimir Serbinenko Fix coreboot compilation. - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_get_mbi_size): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_get_mbi_size): Take VBE info into account even if only text is supported. (fill_vbe_info): Take into account the case when only VGA text is supported. - * include/grub/multiboot.h (GRUB_MACHINE_HAS_VBE): Set to zero + * include/VasEBoot/multiboot.h (VasEBoot_MACHINE_HAS_VBE): Set to zero on coreboot, multiboot and qemu. 2010-09-29 Vladimir Serbinenko - * grub-core/lib/relocator.c (malloc_in_range): Trim too verbose + * VasEBoot-core/lib/relocator.c (malloc_in_range): Trim too verbose debug messages. - (grub_relocator_prepare_relocs): Set movers_chunk.srcv. + (VasEBoot_relocator_prepare_relocs): Set movers_chunk.srcv. 2010-09-29 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c (grub_cmd_netbsd): Provide default serial + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_cmd_netbsd): Provide default serial parameters. 2010-09-29 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_parse): Fix treating of all commands as + * VasEBoot-core/lib/arg.c (VasEBoot_arg_parse): Fix treating of all commands as if they were BSD-style. 2010-09-29 Vladimir Serbinenko - * grub-core/boot/i386/pc/lnxboot.S: Replace - GRUB_KERNEL_I386_PC_MULTIBOOT_SIGNATURE with - GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART. + * VasEBoot-core/boot/i386/pc/lnxboot.S: Replace + VasEBoot_KERNEL_I386_PC_MULTIBOOT_SIGNATURE with + VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART. 2010-09-29 Vladimir Serbinenko Write embedding zone using Reed-Solomon. - * Makefile.util.def (grub-setup): Add grub-core/lib/reed_solomon.c. - * grub-core/Makefile.am (rs_decoder.S): New target. + * Makefile.util.def (VasEBoot-setup): Add VasEBoot-core/lib/reed_solomon.c. + * VasEBoot-core/Makefile.am (rs_decoder.S): New target. (kern/i386/pc/startup.S): Depend on rs_decoder.S. - * grub-core/kern/i386/pc/startup.S (reed_solomon_redundancy): New field. + * VasEBoot-core/kern/i386/pc/startup.S (reed_solomon_redundancy): New field. (multiboot): Move to RS part. (post_reed_solomon): New label. - (grub_boot_drive): Move to non-RS part since it's modified in memory + (VasEBoot_boot_drive): Move to non-RS part since it's modified in memory on boot. Include rs_decoder.S. - * grub-core/lib/reed_solomon.c: New file. - * include/grub/offsets.h (GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): + * VasEBoot-core/lib/reed_solomon.c: New file. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): New definition. - (GRUB_KERNEL_I386_PC_MULTIBOOT_SIGNATURE): Removed. - (GRUB_KERNEL_I386_PC_RAW_SIZE): Updated. - (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): New definition. - * include/grub/partition.h (grub_partition_map): Change prototype of + (VasEBoot_KERNEL_I386_PC_MULTIBOOT_SIGNATURE): Removed. + (VasEBoot_KERNEL_I386_PC_RAW_SIZE): Updated. + (VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_PART): New definition. + * include/VasEBoot/partition.h (VasEBoot_partition_map): Change prototype of embed to allow returning additional sectors. - * include/grub/reed_solomon.h: New file. - * util/grub-setup.c (setup): Handle Reed-Solomon. + * include/VasEBoot/reed_solomon.h: New file. + * util/VasEBoot-setup.c (setup): Handle Reed-Solomon. 2010-09-28 Colin Watson - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_make_mbi): Fix + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_make_mbi): Fix i386 and x86-64 definedness tests. 2010-09-27 Yves Blusseau Fix generation of kernel_syms.lst - * grub-core/Makefile.am (kernel_syms.lst): Fix value and position of + * VasEBoot-core/Makefile.am (kernel_syms.lst): Fix value and position of ASM_PREFIX 2010-09-26 Robert Millan - Support degraded ZFS arrays in "grub-probe -t device" resolution. + Support degraded ZFS arrays in "VasEBoot-probe -t device" resolution. - * grub-core/kern/emu/getroot.c (find_root_device_from_libzfs): When + * VasEBoot-core/kern/emu/getroot.c (find_root_device_from_libzfs): When the pool is an array of devices, iterate through it and return the first device that passes a stat() test (instead of blindly returning the first one). @@ -22992,37 +22992,37 @@ * Makefile.util.def: Add `$(LIBZFS) $(LIBNVPAIR)' library dependencies to programs that require ZFS conversion. - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): Support + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_is_floppy): Support kernels that don't have FLOPPY_MAJOR. 2010-09-25 BVK Chaitanya - * grub-core/kern/emu/full.c (grub_emu_post_init): Fix typo. + * VasEBoot-core/kern/emu/full.c (VasEBoot_emu_post_init): Fix typo. 2010-09-25 BVK Chaitanya - Fix grub-emu build. + Fix VasEBoot-emu build. - * grub-core/kern/emu/main.c: Remove #include . - * grub-core/kern/emu/full.c: Split grub_mdraid_{init,fini} into + * VasEBoot-core/kern/emu/main.c: Remove #include . + * VasEBoot-core/kern/emu/full.c: Split VasEBoot_mdraid_{init,fini} into mdraid09 and mdraid1x. 2010-09-24 Colin Watson - Re-enable grub-extras. + Re-enable VasEBoot-extras. - * autogen.sh: Create symlinks to ${GRUB_CONTRIB} if necessary to + * autogen.sh: Create symlinks to ${VasEBoot_CONTRIB} if necessary to avoid confusing Automake. Run autogen only twice, once for the top - level and once for grub-core. Add Makefile.util.def and + level and once for VasEBoot-core. Add Makefile.util.def and Makefile.core.def from extra modules to the appropriate autogen invocations. If Makefile.common exists in an extra module, include - it in both Makefile.util.am and grub-core/Makefile.core.am; + it in both Makefile.util.am and VasEBoot-core/Makefile.core.am; similarly, include any Makefile.util.common file in Makefile.util.am - and any Makefile.core.common file in grub-core/Makefile.core.am. - * conf/Makefile.common ($(top_srcdir)/grub-core/Makefile.core.am): - Depend on $(top_srcdir)/grub-core/Makefile.gcry.def. - ($(top_srcdir)/grub-core/Makefile.gcry.def): Remove. - * grub-core/Makefile.am: Remove inclusion of Makefile.gcry.am. + and any Makefile.core.common file in VasEBoot-core/Makefile.core.am. + * conf/Makefile.common ($(top_srcdir)/VasEBoot-core/Makefile.core.am): + Depend on $(top_srcdir)/VasEBoot-core/Makefile.gcry.def. + ($(top_srcdir)/VasEBoot-core/Makefile.gcry.def): Remove. + * VasEBoot-core/Makefile.am: Remove inclusion of Makefile.gcry.am. * gentpl.py (gvar_add): Turn GVARS into a set. (global_variable_initializers): Sort global variables on output. @@ -23051,65 +23051,65 @@ * configure.ac: Add AC_PROG_LN_S, for the benefit of ntldr-img. - * .bzrignore: Add contrib and grub-core/contrib. Remove - grub-core/Makefile.gcry.am. + * .bzrignore: Add contrib and VasEBoot-core/contrib. Remove + VasEBoot-core/Makefile.gcry.am. 2010-09-24 Yves Blusseau - * grub-core/lib/LzFind.c: Add missing include. - * grub-core/lib/LzmaEnc.c: Likewise. - * grub-core/script/lexer.c: Likewise. - * grub-core/script/yylex.l: Likewise. - * util/grub-macho2img.c: Likewise. - * util/grub-menulst2cfg.c: Likewise. - * util/grub-mklayout.c: Likewise. - * util/grub-mkpasswd-pbkdf2.c - * util/grub-mkrelpath.c: Likewise. + * VasEBoot-core/lib/LzFind.c: Add missing include. + * VasEBoot-core/lib/LzmaEnc.c: Likewise. + * VasEBoot-core/script/lexer.c: Likewise. + * VasEBoot-core/script/yylex.l: Likewise. + * util/VasEBoot-macho2img.c: Likewise. + * util/VasEBoot-menulst2cfg.c: Likewise. + * util/VasEBoot-mklayout.c: Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c + * util/VasEBoot-mkrelpath.c: Likewise. * util/resolve.c: Likewise. 2010-09-24 BVK Chaitanya * Makefile.util.def (example_unit_test): Add - grub-core/gnulib/libgnu.a. + VasEBoot-core/gnulib/libgnu.a. 2010-09-23 Grégoire Sutre - * grub-core/commands/acpihalt.c (get_sleep_type): Initialize prev. + * VasEBoot-core/commands/acpihalt.c (get_sleep_type): Initialize prev. 2010-09-23 Vladimir Serbinenko Support xz compression on yeeloong. - * Makefile.util.def (grub-mkimage): Add $(LIBLZMA). + * Makefile.util.def (VasEBoot-mkimage): Add $(LIBLZMA). * configure.ac: Check for LZMA. - * grub-core/Makefile.core.def (xz_decompress): New target. + * VasEBoot-core/Makefile.core.def (xz_decompress): New target. (none_decompress): Likewise. - * grub-core/boot/decompressor/minilib.c: New file. - * grub-core/boot/decompressor/none.c: Likewise. - * grub-core/boot/decompressor/xz.c: Likewise. - * grub-core/kern/mips/cache.S: Change to noreorder nomacro. - * grub-core/kern/mips/cache_flush.S: Likewise. - * grub-core/kern/i386/pc/lzma_decode.S: Remove dead code. - * grub-core/kern/mips/startup.S: Move first stage to ... - * grub-core/boot/mips/startup_raw.S: ...here. Change to noreorder + * VasEBoot-core/boot/decompressor/minilib.c: New file. + * VasEBoot-core/boot/decompressor/none.c: Likewise. + * VasEBoot-core/boot/decompressor/xz.c: Likewise. + * VasEBoot-core/kern/mips/cache.S: Change to noreorder nomacro. + * VasEBoot-core/kern/mips/cache_flush.S: Likewise. + * VasEBoot-core/kern/i386/pc/lzma_decode.S: Remove dead code. + * VasEBoot-core/kern/mips/startup.S: Move first stage to ... + * VasEBoot-core/boot/mips/startup_raw.S: ...here. Change to noreorder nomacro. - * grub-core/kern/mips/startup.S: Change to noreorder nomacro. - * grub-core/lib/mips/relocator_asm.S: Change to noreorder nomacro. - * grub-core/lib/xzembed/xz_dec_bcj.c [GRUB_EMBED_DECOMPRESSOR]: + * VasEBoot-core/kern/mips/startup.S: Change to noreorder nomacro. + * VasEBoot-core/lib/mips/relocator_asm.S: Change to noreorder nomacro. + * VasEBoot-core/lib/xzembed/xz_dec_bcj.c [VasEBoot_EMBED_DECOMPRESSOR]: Allocate statically. - * grub-core/lib/xzembed/xz_dec_lzma2.c [GRUB_EMBED_DECOMPRESSOR]: + * VasEBoot-core/lib/xzembed/xz_dec_lzma2.c [VasEBoot_EMBED_DECOMPRESSOR]: Allocate statically or use scratch. Don't check CRC32. - * grub-core/lib/xzembed/xz_dec_stream.c [GRUB_EMBED_DECOMPRESSOR]: + * VasEBoot-core/lib/xzembed/xz_dec_stream.c [VasEBoot_EMBED_DECOMPRESSOR]: Allocate statically. Don't check CRC32. - * include/grub/decompressor.h: New file. - * include/grub/offsets.h (GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE): + * include/VasEBoot/decompressor.h: New file. + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_MIPS_YEELOONG_RAW_SIZE): Removed. - (GRUB_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE): New field. - (GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE): Adjusted. - (GRUB_KERNEL_MIPS_YEELOONG_PREFIX): Likewise. - (GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END): Likewise. - (GRUB_KERNEL_MACHINE_UNCOMPRESSED_SIZE): New define. - * util/grub-mkimage.c (grub_compression_t): New type. + (VasEBoot_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE): New field. + (VasEBoot_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE): Adjusted. + (VasEBoot_KERNEL_MIPS_YEELOONG_PREFIX): Likewise. + (VasEBoot_KERNEL_MIPS_YEELOONG_PREFIX_END): Likewise. + (VasEBoot_KERNEL_MACHINE_UNCOMPRESSED_SIZE): New define. + * util/VasEBoot-mkimage.c (VasEBoot_compression_t): New type. (PLATFORM_FLAGS_DECOMPRESSORS): New flag. (image_target_desc): New field default_compression. (image_targets): Adjust yeeloong targets. @@ -23122,54 +23122,54 @@ 2010-09-22 Grégoire Sutre - * grub-core/kern/emu/hostdisk.c [__NetBSD__]: Define FLOPPY_MAJOR. + * VasEBoot-core/kern/emu/hostdisk.c [__NetBSD__]: Define FLOPPY_MAJOR. 2010-09-22 Colin Watson - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_make_mbi): Fix + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_make_mbi): Fix typo in __i386__ conditional. 2010-09-22 Vladimir Serbinenko - * grub-core/loader/multiboot_mbi2.c (GRUB_MACHINE_EFI): Add missing + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_MACHINE_EFI): Add missing include. 2010-09-22 Vladimir Serbinenko Implement EFI and ACPI multiboot2 extensions. - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_load): Declare + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_load): Declare new tags as supported. (acpiv2_size): New function. - (grub_multiboot_get_mbi_size): Take new tags into account. - (grub_multiboot_make_mbi): Add new tags. - * include/grub/multiboot.h (GRUB_MACHINE_HAS_ACPI): New definition. + (VasEBoot_multiboot_get_mbi_size): Take new tags into account. + (VasEBoot_multiboot_make_mbi): Add new tags. + * include/VasEBoot/multiboot.h (VasEBoot_MACHINE_HAS_ACPI): New definition. 2010-09-21 Aleš Nesrsta - * grub-core/bus/usb/serial/common.c (grub_usbserial_attach): + * VasEBoot-core/bus/usb/serial/common.c (VasEBoot_usbserial_attach): Added missing configuration of USB device. 2010-09-21 Colin Watson - * grub-core/normal/menu_entry.c (run): Make sure we always return + * VasEBoot-core/normal/menu_entry.c (run): Make sure we always return a value. 2010-09-21 Colin Watson - * grub-core/commands/efi/lsefimmap.c (grub_cmd_lsefimmap): + * VasEBoot-core/commands/efi/lsefimmap.c (VasEBoot_cmd_lsefimmap): NumberOfPages is UINT64 according to the UEFI specification, not UINTN. Fix printf format. 2010-09-21 Colin Watson - * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Change type of - `err' to grub_usb_err_t. + * VasEBoot-core/bus/usb/usbhub.c (poll_nonroot_hub): Change type of + `err' to VasEBoot_usb_err_t. Reported and tested by: KESHAV P.R. 2010-09-21 Colin Watson - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Make + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Make tpart non-const, so that we can assign to it. (Since this is a typedef, the constness refers to the pointer rather than what it points to.) @@ -23177,19 +23177,19 @@ 2010-09-21 Colin Watson * conf/Makefile.common (CPPFLAGS_GNULIB): Add - $(top_srcdir)/grub-core/gnulib as well as - $(top_builddir)/grub-core/gnulib. + $(top_srcdir)/VasEBoot-core/gnulib as well as + $(top_builddir)/VasEBoot-core/gnulib. Reported by: KESHAV P.R. 2010-09-21 Colin Watson - * util/grub-install.in: Fix the bootloader ID option to be + * util/VasEBoot-install.in: Fix the bootloader ID option to be consistently --bootloader-id, not --bootloader_id. Reported by: KESHAV P.R. 2010-09-21 Colin Watson - * grub-core/commands/hashsum.c (GRUB_MOD_INIT): Make "Compute or + * VasEBoot-core/commands/hashsum.c (VasEBoot_MOD_INIT): Make "Compute or check hash checksum." consistently translatable. 2010-09-21 Yves Blusseau @@ -23199,33 +23199,33 @@ 2010-09-21 Colin Watson - * grub-core/commands/hashsum.c (aliases): Add sha1sum alias. - (GRUB_MOD_INIT): Register sha1sum command. - (GRUB_MOD_FINI): Unregister sha1sum command. + * VasEBoot-core/commands/hashsum.c (aliases): Add sha1sum alias. + (VasEBoot_MOD_INIT): Register sha1sum command. + (VasEBoot_MOD_FINI): Unregister sha1sum command. 2010-09-21 Yves Blusseau - Keep boot and grub directory names in sync with utils scripts + Keep boot and VasEBoot directory names in sync with utils scripts - * configure.ac: Define GRUB_BOOT_DIR_NAME and GRUB_DIR_NAME macros. + * configure.ac: Define VasEBoot_BOOT_DIR_NAME and VasEBoot_DIR_NAME macros. * config.h.in: Add previous macros. - * include/grub/emu/misc.h (DEFAULT_DIRECTORY): Use previous macros. - * util/grub-install.in: Use $bootdir and $grubdir variables. + * include/VasEBoot/emu/misc.h (DEFAULT_DIRECTORY): Use previous macros. + * util/VasEBoot-install.in: Use $bootdir and $VasEBootdir variables. 2010-09-21 Colin Watson - * grub-core/kern/emu/hostdisk.c (find_system_device): Only try to + * VasEBoot-core/kern/emu/hostdisk.c (find_system_device): Only try to convert partition names to disk names if the new `convert' parameter is set. - (grub_util_biosdisk_get_grub_dev): If opening the disk device - returns GRUB_ERR_UNKNOWN_DEVICE, treat the partition device as a + (VasEBoot_util_biosdisk_get_VasEBoot_dev): If opening the disk device + returns VasEBoot_ERR_UNKNOWN_DEVICE, treat the partition device as a disk in its own right. This can happen with Xen disk images. 2010-09-21 Yves Blusseau - * util/grub-editenv.c: Update strings to avoid warnings when generating - grub.pot file. - * util/grub-setup.c: Likewise. + * util/VasEBoot-editenv.c: Update strings to avoid warnings when generating + VasEBoot.pot file. + * util/VasEBoot-setup.c: Likewise. 2010-09-21 Vladimir Serbinenko @@ -23233,9 +23233,9 @@ 2010-09-21 Vladimir Serbinenko - * grub-core/loader/i386/multiboot_mbi.c (grub_fill_multiboot_mmap): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_fill_multiboot_mmap): Add BADRAM. - * grub-core/loader/multiboot_mbi2.c (grub_fill_multiboot_mmap): + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_fill_multiboot_mmap): Likewise. * include/multiboot.h: Resynced with specification. * include/multiboot2.h: Likewise. @@ -23245,7 +23245,7 @@ Fix po directory handling. * configure.ac: Create po/Makefile.in rather than po/Makefile. - * grub-core/gnulib/Makefile.am: Import gettext module. + * VasEBoot-core/gnulib/Makefile.am: Import gettext module. * m4/gnulib-cache.m4: Likewise. * m4/gnulib-comp.m4: Likewise. * m4/gettext.m4: New file, from gnulib. @@ -23287,144 +23287,144 @@ 2010-09-20 Vladimir Serbinenko - * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Use UUID when possible. + * util/VasEBoot.d/10_kfreebsd.in (kfreebsd_entry): Use UUID when possible. 2010-09-20 Vladimir Serbinenko - * util/grub.d/20_linux_xen.in: Use submenus. + * util/VasEBoot.d/20_linux_xen.in: Use submenus. 2010-09-20 Vladimir Serbinenko Support submenus. - * grub-core/commands/menuentry.c (grub_normal_add_menu_entry): New + * VasEBoot-core/commands/menuentry.c (VasEBoot_normal_add_menu_entry): New parameter submenu. All users updated. - * grub-core/normal/main.c (free_menu): Rename to ... - (grub_normal_free_menu): ... this. Made global. - * grub-core/normal/menu.c (grub_menu_execute_entry): Open new context + * VasEBoot-core/normal/main.c (free_menu): Rename to ... + (VasEBoot_normal_free_menu): ... this. Made global. + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): Open new context if requested. - * grub-core/normal/menu_entry.c (screen): New field submenu. + * VasEBoot-core/normal/menu_entry.c (screen): New field submenu. (make_screen): Set submenu. (run): Open new context if requested. - * include/grub/menu.h (grub_menu_entry): New field submenu. - * include/grub/normal.h (grub_normal_free_menu): New proto. + * include/VasEBoot/menu.h (VasEBoot_menu_entry): New field submenu. + * include/VasEBoot/normal.h (VasEBoot_normal_free_menu): New proto. 2010-09-20 Vladimir Serbinenko Menu entries extractor. - * grub-core/commands/configfile.c (grub_cmd_source): Implement extractor + * VasEBoot-core/commands/configfile.c (VasEBoot_cmd_source): Implement extractor variants. - (GRUB_MOD_INIT): Register new variants. - (GRUB_MOD_FINI): Unregister new variants. - * grub-core/commands/legacycfg.c (grub_cmd_legacy_configfile): Merge - into grub_cmd_legacy_source. - (grub_cmd_legacy_source): Implement extractor variants. - (GRUB_MOD_INIT): Register new variants. - (GRUB_MOD_FINI): Unregister new variants. - * grub-core/commands/menuentry.c (grub_menu_init): Declare menuentry + (VasEBoot_MOD_INIT): Register new variants. + (VasEBoot_MOD_FINI): Unregister new variants. + * VasEBoot-core/commands/legacycfg.c (VasEBoot_cmd_legacy_configfile): Merge + into VasEBoot_cmd_legacy_source. + (VasEBoot_cmd_legacy_source): Implement extractor variants. + (VasEBoot_MOD_INIT): Register new variants. + (VasEBoot_MOD_FINI): Unregister new variants. + * VasEBoot-core/commands/menuentry.c (VasEBoot_menu_init): Declare menuentry as an extractor. - * grub-core/commands/search_wrap.c (GRUB_MOD_INIT): Declare + * VasEBoot-core/commands/search_wrap.c (VasEBoot_MOD_INIT): Declare search as an extractor. - * grub-core/commands/test.c (GRUB_MOD_INIT): Declare + * VasEBoot-core/commands/test.c (VasEBoot_MOD_INIT): Declare test as an extractor. - * grub-core/kern/corecmd.c (grub_register_core_commands): Declare set + * VasEBoot-core/kern/corecmd.c (VasEBoot_register_core_commands): Declare set as an extractor. - * grub-core/normal/context.c (grub_env_context_open): Reorganised. - (grub_env_new_context): New function. - (grub_env_context_open): Likewise. - (grub_env_extractor_open): Likewise. - (grub_env_extractor_close): Likewise. - * grub-core/script/execute.c (grub_script_execute_cmdline): Handle - grub_extractor_level. - * include/grub/command.h (GRUB_COMMAND_FLAG_EXTRACTOR): New flag. - * include/grub/env.h (grub_env_extractor_open): New proto. - (grub_env_extractor_close): Likewise. - * include/grub/normal.h (grub_extractor_level): New external variable. + * VasEBoot-core/normal/context.c (VasEBoot_env_context_open): Reorganised. + (VasEBoot_env_new_context): New function. + (VasEBoot_env_context_open): Likewise. + (VasEBoot_env_extractor_open): Likewise. + (VasEBoot_env_extractor_close): Likewise. + * VasEBoot-core/script/execute.c (VasEBoot_script_execute_cmdline): Handle + VasEBoot_extractor_level. + * include/VasEBoot/command.h (VasEBoot_COMMAND_FLAG_EXTRACTOR): New flag. + * include/VasEBoot/env.h (VasEBoot_env_extractor_open): New proto. + (VasEBoot_env_extractor_close): Likewise. + * include/VasEBoot/normal.h (VasEBoot_extractor_level): New external variable. 2010-09-20 Vladimir Serbinenko Make cutmem accept a region specification. Suggested by: Samuel Thibault - * grub-core/mmap/mmap.c (parsemem): New function. - (grub_cmd_cutmem): Handle new arguments. + * VasEBoot-core/mmap/mmap.c (parsemem): New function. + (VasEBoot_cmd_cutmem): Handle new arguments. 2010-09-20 Vladimir Serbinenko New command cutmem. - * grub-core/mmap/mmap.c (grub_cmd_cutmem): New function. - (GRUB_MOD_INIT): Register new command. - (GRUB_MOD_FINI): Unregister new command. + * VasEBoot-core/mmap/mmap.c (VasEBoot_cmd_cutmem): New function. + (VasEBoot_MOD_INIT): Register new command. + (VasEBoot_MOD_FINI): Unregister new command. 2010-09-20 Vladimir Serbinenko Support some annoying BSD and Minix subpartitions. - * Makefile.util.def (libgrub.a): Add grub-core/partmap/bsdlabel.c. - * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): + * Makefile.util.def (libVasEBoot.a): Add VasEBoot-core/partmap/bsdlabel.c. + * VasEBoot-core/disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Properly handle concatenation. - * grub-core/kern/device.c (grub_device_iterate): Likewise. - * grub-core/normal/completion.c (iterate_partition): Likewise. - * grub-core/kern/disk.c (grub_disk_open): Make disk->name not + * VasEBoot-core/kern/device.c (VasEBoot_device_iterate): Likewise. + * VasEBoot-core/normal/completion.c (iterate_partition): Likewise. + * VasEBoot-core/kern/disk.c (VasEBoot_disk_open): Make disk->name not contain partition. All users updated. - * grub-core/partmap/bsdlabel.c (grub_netbsdlabel_partition_map): New + * VasEBoot-core/partmap/bsdlabel.c (VasEBoot_netbsdlabel_partition_map): New struct. - (grub_openbsdlabel_partition_map): Likewise. + (VasEBoot_openbsdlabel_partition_map): Likewise. (bsdlabel_partition_map_iterate): Rename to .. (iterate_real): ... this. New arguments sector, freebsd and pmap. (bsdlabel_partition_map_iterate): New function. (netopenbsdlabel_partition_map_iterate): Likewise. (netbsdlabel_partition_map_iterate): Likewise. (openbsdlabel_partition_map_iterate): Likewise. - (GRUB_MOD_INIT): Register new partmaps. - (GRUB_MOD_FINI): Unregister new partmaps. - * grub-core/partmap/msdos.c (pc_partition_map_iterate): Rename to ... - (grub_partition_msdos_iterate): ... this. All users updated. + (VasEBoot_MOD_INIT): Register new partmaps. + (VasEBoot_MOD_FINI): Unregister new partmaps. + * VasEBoot-core/partmap/msdos.c (pc_partition_map_iterate): Rename to ... + (VasEBoot_partition_msdos_iterate): ... this. All users updated. Don't support embedding other than in a minix partition. - * include/grub/msdos_partition.h (grub_partition_msdos_iterate): New + * include/VasEBoot/msdos_partition.h (VasEBoot_partition_msdos_iterate): New proto. - * include/grub/partition.h (grub_partition): New field msdostype. - * util/grub-install.in: Handle openbsd and netbsd types being in + * include/VasEBoot/partition.h (VasEBoot_partition): New field msdostype. + * util/VasEBoot-install.in: Handle openbsd and netbsd types being in part_bsd module. 2010-09-20 Vladimir Serbinenko Split mdraid.mod into mdraid09.mod and mdraid1x.mod. - * Makefile.util.def (libgrub.a): Add grub-core/disk/mdraid1x_linux.c. - * grub-core/Makefile.core.def (mdraid): Renamed to ... + * Makefile.util.def (libVasEBoot.a): Add VasEBoot-core/disk/mdraid1x_linux.c. + * VasEBoot-core/Makefile.core.def (mdraid): Renamed to ... (mdraid09): ... this. (mdraid1x): New module. - * grub-core/disk/mdraid_linux.c: Move 1.x parts ... - * grub-core/disk/mdraid1x_linux.c: ...here. All users updated. + * VasEBoot-core/disk/mdraid_linux.c: Move 1.x parts ... + * VasEBoot-core/disk/mdraid1x_linux.c: ...here. All users updated. 2010-09-20 Vladimir Serbinenko - * grub-core/kern/emu/misc.c (asprintf): Use vsnprintf instead of + * VasEBoot-core/kern/emu/misc.c (asprintf): Use vsnprintf instead of vsprintf. 2010-09-20 Colin Watson - * grub-core/commands/efi/lsefimmap.c: Correct header. + * VasEBoot-core/commands/efi/lsefimmap.c: Correct header. * NEWS: Update. 2010-09-20 Colin Watson - * util/grub-editenv.c (argp_parser): Don't pass translated strings + * util/VasEBoot-editenv.c (argp_parser): Don't pass translated strings as printf format strings; the translations might contain '%' which could cause a crash. (main): Likewise. - * util/grub-fstest.c (argp_parser): Likewise. - * util/grub-setup.c (argp_parser): Likewise. + * util/VasEBoot-fstest.c (argp_parser): Likewise. + * util/VasEBoot-setup.c (argp_parser): Likewise. (main): Likewise. 2010-09-20 Vladimir Serbinenko - Use argp in grub-fstest. + Use argp in VasEBoot-fstest. - * util/grub-fstest.c: Don't include getopt.h. + * util/VasEBoot-fstest.c: Don't include getopt.h. Include argp.h. (root): New variable. (args_count): Likewise. @@ -23442,114 +23442,114 @@ (main): Use argp_parse. 2010-09-20 Tristan Gingold -2010-09-20 Robert Millan +2010-09-20 Robert Millan 2010-09-20 Vladimir Serbinenko - * grub-core/commands/efi/lsefimmap.c: New file. - * grub-core/Makefile.core.def (lsefimmap): New module. - * include/grub/efi/api.h (PRIxGRUB_EFI_UINTN_T): New definition. + * VasEBoot-core/commands/efi/lsefimmap.c: New file. + * VasEBoot-core/Makefile.core.def (lsefimmap): New module. + * include/VasEBoot/efi/api.h (PRIxVasEBoot_EFI_UINTN_T): New definition. 2010-09-20 Vladimir Serbinenko Pause the execution (10s max) if any errors are displayed so the user has a chance to see them. - * grub-core/kern/err.c (grub_err_printed_errors): New variable. - (grub_print_error): Increment grub_err_printed_errors. - * grub-core/normal/menu.c (grub_menu_execute_entry): Pause the + * VasEBoot-core/kern/err.c (VasEBoot_err_printed_errors): New variable. + (VasEBoot_print_error): Increment VasEBoot_err_printed_errors. + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): Pause the execution if any errors were displayed. (show_menu): Remove old code for pause. - * grub-core/normal/menu_entry.c (run): Likewise. - * grub-core/normal/term.c (grub_normal_char_counter): Removed. All + * VasEBoot-core/normal/menu_entry.c (run): Likewise. + * VasEBoot-core/normal/term.c (VasEBoot_normal_char_counter): Removed. All users updated. - (grub_normal_get_char_counter): Likewise. - * include/grub/err.h (grub_err_printed_errors): New external variable. - * include/grub/normal.h (grub_normal_get_char_counter): Removed. + (VasEBoot_normal_get_char_counter): Likewise. + * include/VasEBoot/err.h (VasEBoot_err_printed_errors): New external variable. + * include/VasEBoot/normal.h (VasEBoot_normal_get_char_counter): Removed. 2010-09-20 Vladimir Serbinenko Support multiboot VBE info. - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_get_mbi_size): + * VasEBoot-core/loader/i386/multiboot_mbi.c (VasEBoot_multiboot_get_mbi_size): Take VBE info into account. - (fill_vbe_info) [GRUB_MACHINE_HAS_VBE]: New function. - (retrieve_video_parameters) [GRUB_MACHINE_HAS_VBE]: + (fill_vbe_info) [VasEBoot_MACHINE_HAS_VBE]: New function. + (retrieve_video_parameters) [VasEBoot_MACHINE_HAS_VBE]: Call fill_vbe_info when appropriate. - (grub_multiboot_make_mbi): Account for the size occupied by VBE info. - * grub-core/loader/multiboot_mbi2.c (grub_multiboot_load): Declare tags + (VasEBoot_multiboot_make_mbi): Account for the size occupied by VBE info. + * VasEBoot-core/loader/multiboot_mbi2.c (VasEBoot_multiboot_load): Declare tags as supported. - (grub_multiboot_get_mbi_size): Take new tags into account. - (fill_vbe_tag) [GRUB_MACHINE_HAS_VBE]: New function. - (retrieve_video_parameters) [GRUB_MACHINE_HAS_VBE]: + (VasEBoot_multiboot_get_mbi_size): Take new tags into account. + (fill_vbe_tag) [VasEBoot_MACHINE_HAS_VBE]: New function. + (retrieve_video_parameters) [VasEBoot_MACHINE_HAS_VBE]: Call fill_vbe_tag when appropriate. - (grub_multiboot_make_mbi): Properly align tags. - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_pm_interface): New + (VasEBoot_multiboot_make_mbi): Properly align tags. + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_pm_interface): New function. - * include/grub/i386/pc/vbe.h (grub_vbe_bios_get_pm_interface): New + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_vbe_bios_get_pm_interface): New proto. - * include/grub/multiboot.h (GRUB_MACHINE_HAS_VBE): New definition. + * include/VasEBoot/multiboot.h (VasEBoot_MACHINE_HAS_VBE): New definition. 2010-09-20 Vladimir Serbinenko Suport manual terminal geometry specification. - * grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_dimensions): - Save state in grub_ofconsole_terminfo_output. - (grub_ofconsole_term): Use grub_terminfo_getwh. - (grub_ofconsole_getwh): Removed. - * grub-core/term/serial.c (grub_serial_getwh): Removed. - (grub_serial_term): Use grub_terminfo_getwh. - * grub-core/term/terminfo.c (grub_terminfo_getwh): New function. + * VasEBoot-core/term/ieee1275/ofconsole.c (VasEBoot_ofconsole_dimensions): + Save state in VasEBoot_ofconsole_terminfo_output. + (VasEBoot_ofconsole_term): Use VasEBoot_terminfo_getwh. + (VasEBoot_ofconsole_getwh): Removed. + * VasEBoot-core/term/serial.c (VasEBoot_serial_getwh): Removed. + (VasEBoot_serial_term): Use VasEBoot_terminfo_getwh. + * VasEBoot-core/term/terminfo.c (VasEBoot_terminfo_getwh): New function. (options): New struct. (OPTION_*): New enum. - (grub_cmd_terminfo): Transform into extcmd and handle new parameters. - * include/grub/terminfo.h (grub_terminfo_output_state): New fields + (VasEBoot_cmd_terminfo): Transform into extcmd and handle new parameters. + * include/VasEBoot/terminfo.h (VasEBoot_terminfo_output_state): New fields width and height. - (grub_terminfo_getwh): New proto. - * grub-core/lib/legacy_parse.c (grub_legacy_parse): Handle --lines. + (VasEBoot_terminfo_getwh): New proto. + * VasEBoot-core/lib/legacy_parse.c (VasEBoot_legacy_parse): Handle --lines. 2010-09-20 Vladimir Serbinenko Handle legacy "terminal" command. - * grub-core/lib/legacy_parse.c (legacy_command): New flags FLAG_TITLE + * VasEBoot-core/lib/legacy_parse.c (legacy_command): New flags FLAG_TITLE and FLAG_TERMINAL. (legacy_commands): Add terminal and title. - (grub_legacy_parse): Handle terminal. Simplify title handling. + (VasEBoot_legacy_parse): Handle terminal. Simplify title handling. 2010-09-20 Vladimir Serbinenko - * grub-core/lib/arg.c (grub_arg_show_help): Correctly handle + * VasEBoot-core/lib/arg.c (VasEBoot_arg_show_help): Correctly handle parameters overflow. 2010-09-20 Colin Watson - * .bzrignore: Add grub-core/gnulib/sys, widthspec.bin, and + * .bzrignore: Add VasEBoot-core/gnulib/sys, widthspec.bin, and widthspec.h. - * docs/grub.texi (Shell-like scripting): Document `!'. + * docs/VasEBoot.texi (Shell-like scripting): Document `!'. (Network): Simplify using new i386-pc-pxe format. Mention - grub-mknetdir. + VasEBoot-mknetdir. * NEWS: Update. 2010-09-20 Colin Watson * Makefile.am (SUBDIRS): Restore "."; it's important to force - ordering, so that e.g. ascii.h is built before grub-core/font/font.c + ordering, so that e.g. ascii.h is built before VasEBoot-core/font/font.c when needed. 2010-09-20 Colin Watson - * grub-core/commands/efi/lsefisystab.c: Correct header. - * grub-core/commands/efi/lssal.c: Likewise. - * grub-core/commands/testload.c: Likewise. + * VasEBoot-core/commands/efi/lsefisystab.c: Correct header. + * VasEBoot-core/commands/efi/lssal.c: Likewise. + * VasEBoot-core/commands/testload.c: Likewise. 2010-09-20 Colin Watson - * util/grub-mkrescue.in: Add explicit root argument to --set to + * util/VasEBoot-mkrescue.in: Add explicit root argument to --set to prevent the UUID being interpreted as an argument to --set (matches - previous change to prepare_grub_to_access_device). + previous change to prepare_VasEBoot_to_access_device). 2010-09-20 Colin Watson @@ -23559,51 +23559,51 @@ (find_partition_start): Define this function on FreeBSD too. (device_is_wholedisk) [__FreeBSD__ || __FreeBSD_kernel__]: New function. - (grub_util_biosdisk_get_grub_dev): Use partition-start-sector logic + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Use partition-start-sector logic on FreeBSD. 2010-09-20 Yves Blusseau - * util/grub-editenv.c: Use argp instead of getopt. + * util/VasEBoot-editenv.c: Use argp instead of getopt. 2010-09-20 Yves Blusseau - * util/grub-setup.c: Use argp instead of getopt. + * util/VasEBoot-setup.c: Use argp instead of getopt. 2010-09-20 Yves Blusseau Use gnulib-tool to create gnulib source files. * Add gnulib files generated by gnulib-tool in build-aux, m4 and - grub-core/gnulib directories + VasEBoot-core/gnulib directories * .bzignore: Add **/.deps and autogenerated gnulib files * configure.ac: Assign auxiliary directory to build-aux, add invocation - of gnulib macros, add grub-core/gnulib/Makefile + of gnulib macros, add VasEBoot-core/gnulib/Makefile * Makefile.am: Add gnulib directory in SUBDIRS (removing unnecessary .), include m4 directory to aclocal. * Makefile.util.def: Remove direct compilation of gnulib source files - and use the new grub-core/gnulib/libgnu.a. + and use the new VasEBoot-core/gnulib/libgnu.a. * build-aux/config.rpath: move config.rpath from top directory to build-aux * conf/Makefile.common: Remove the macro _GL_UNUSED already defined in gnulib headers * conf/Makefile.extra-dist: Add m4/gnulib-cache.m4 - * grub-core/Makefile.core.def: Remove unnecessary extra_dist - * grub-core/lib/posix_wrap/localcharset.h (locale_charset): Update + * VasEBoot-core/Makefile.core.def: Remove unnecessary extra_dist + * VasEBoot-core/lib/posix_wrap/localcharset.h (locale_charset): Update header. - * grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Return static + * VasEBoot-core/lib/posix_wrap/langinfo.h (nl_langinfo): Return static string. 2010-09-20 Yves Blusseau - * .bzrignore: Add grub-kbdcomp, grub-menulst2cfg, *.marker, - grub-core/genmod.sh and grub-core/gensyminfo.sh + * .bzrignore: Add VasEBoot-kbdcomp, VasEBoot-menulst2cfg, *.marker, + VasEBoot-core/genmod.sh and VasEBoot-core/gensyminfo.sh 2010-09-20 BVK Chaitanya Add a test for echo command options. - * tests/grub_cmd_echo.in: New test. + * tests/VasEBoot_cmd_echo.in: New test. * Makefile.util.def: Rules for new test. 2010-09-20 Szymon Janc @@ -23611,24 +23611,24 @@ Remove crc.mod and move crc command to hashsum.mod. Remove lib/crc.c - users updated to use gcrypt implementation. - * grub-core/commands/crc.c: Removed. - * grub-core/Makefile.core.def (crc): Module removed. - * grub-core/commands/hashsum.c (aliases[]): Add crc alias. - * grub-core/commands/hashsum.c (GRUB_MOD_INIT): Register crc command. - * grub-core/commands/hashsum.c (GRUB_MOD_FINI): Unregister crc command. - * grub-core/lib/crc.c: Removed. - * include/grub/lib/crc.h: Removed. + * VasEBoot-core/commands/crc.c: Removed. + * VasEBoot-core/Makefile.core.def (crc): Module removed. + * VasEBoot-core/commands/hashsum.c (aliases[]): Add crc alias. + * VasEBoot-core/commands/hashsum.c (VasEBoot_MOD_INIT): Register crc command. + * VasEBoot-core/commands/hashsum.c (VasEBoot_MOD_FINI): Unregister crc command. + * VasEBoot-core/lib/crc.c: Removed. + * include/VasEBoot/lib/crc.h: Removed. * Makefile.util.def (crc): Remove lib/crc.c - * grub-core/Makefile.core.def (libgrub.a): Remove grub-core/lib/crc.c. - * util/grub-fstest.c (cmd_crd): Use libgcrypt crc implementation. - * Makefile.util.def (libgrub.a): Add grub-core/lib/libgcrypt-grub/cipher/crc.c. - * Makefile.util.def (grub-fstest): Add CFLAGS_GCRY to cflags. - * Makefile.util.def (grub-fstest): Add CPPFLAGS_GCRY to cppflags. - * grub-core/efiemu/prepare.c (grub_efiemu_crc): Use libgcrypt crc implementation. + * VasEBoot-core/Makefile.core.def (libVasEBoot.a): Remove VasEBoot-core/lib/crc.c. + * util/VasEBoot-fstest.c (cmd_crd): Use libgcrypt crc implementation. + * Makefile.util.def (libVasEBoot.a): Add VasEBoot-core/lib/libgcrypt-VasEBoot/cipher/crc.c. + * Makefile.util.def (VasEBoot-fstest): Add CFLAGS_GCRY to cflags. + * Makefile.util.def (VasEBoot-fstest): Add CPPFLAGS_GCRY to cppflags. + * VasEBoot-core/efiemu/prepare.c (VasEBoot_efiemu_crc): Use libgcrypt crc implementation. 2010-09-20 Vladimir Serbinenko - * grub-core/boot/i386/pc/boot.S: Ignore %dl if it's not in a sane range. + * VasEBoot-core/boot/i386/pc/boot.S: Ignore %dl if it's not in a sane range. 2010-09-19 Vladimir Serbinenko @@ -23640,73 +23640,73 @@ (BSS_START_SYMBOL): Likewise. (END_SYMBOL): Likewise. (NEED_ENABLE_EXECUTE_STACK): Likewise. All users updated. - (grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK): Removed. + (VasEBoot_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK): Removed. * config.h.in: New file. * configure.ac: Use config-util.h as config define file. - Rename MACHINE into GRUB_MACHINE. All users updated. + Rename MACHINE into VasEBoot_MACHINE. All users updated. (NEED_REGISTER_FRAME_INFO): Transformed into a variable. All users updated. (NESTED_FUNC_ATTR): Likewise. Substitue new variables. (COND_HAVE_ASM_USCORE): New conditional. - * grub-core/Makefile.am (ASM_PREFIX): New variable. + * VasEBoot-core/Makefile.am (ASM_PREFIX): New variable. (kernel_syms.lst): Use ASM_PREFIX. - * grub-core/kern/emu/console.c: Include config-util.h. - * grub-core/kern/emu/misc.c: Likewise. - * grub-core/kern/emu/mm.c: Likewise. - * include/grub/emu/misc.h: Likewise. - * include/grub/libgcc.h: Likewise. + * VasEBoot-core/kern/emu/console.c: Include config-util.h. + * VasEBoot-core/kern/emu/misc.c: Likewise. + * VasEBoot-core/kern/emu/mm.c: Likewise. + * include/VasEBoot/emu/misc.h: Likewise. + * include/VasEBoot/libgcc.h: Likewise. 2010-09-19 Vladimir Serbinenko - * grub-core/term/efi/console.c (efi_codes): Fix GRUB_TERM_KEY_* + * VasEBoot-core/term/efi/console.c (efi_codes): Fix VasEBoot_TERM_KEY_* constants usage. - * grub-core/kern/emu/console.c (grub_ncurses_getkey): - Fix GRUB_TERM_KEY_* constants usage. - * grub-core/kern/emu/misc.c (asprintf): Fix vasprintf usage. + * VasEBoot-core/kern/emu/console.c (VasEBoot_ncurses_getkey): + Fix VasEBoot_TERM_KEY_* constants usage. + * VasEBoot-core/kern/emu/misc.c (asprintf): Fix vasprintf usage. 2010-09-19 Vladimir Serbinenko - * grub-core/bus/usb/ohci.c (grub_ohci_cancel_transfer): Use %p to + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_ohci_cancel_transfer): Use %p to print pointer. - * grub-core/bus/usb/uhci.c: Remove empty define. - (grub_uhci_check_transfer): Add missing cast. - * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Use %p to + * VasEBoot-core/bus/usb/uhci.c: Remove empty define. + (VasEBoot_uhci_check_transfer): Add missing cast. + * VasEBoot-core/bus/usb/usbhub.c (poll_nonroot_hub): Use %p to print pointer. - * grub-core/term/usb_keyboard.c (grub_usb_keyboard_getkey): Use - PRIuGRUB_SIZE. - * include/grub/types.h (PRIuGRUB_SIZE): New definition. + * VasEBoot-core/term/usb_keyboard.c (VasEBoot_usb_keyboard_getkey): Use + PRIuVasEBoot_SIZE. + * include/VasEBoot/types.h (PRIuVasEBoot_SIZE): New definition. 2010-09-19 Vladimir Serbinenko - * grub-core/Makefile.core.def (legacycfg): Add + * VasEBoot-core/Makefile.core.def (legacycfg): Add lib/i386/pc/vesa_modes_table.c on emu. 2010-09-19 BVK Chaitanya Reduce number of temporary files generated by build system. - * grub-core/gencmdlist.sh: Removed. - * grub-core/genfslist.sh: Removed. - * grub-core/genhandlerlist.sh: Removed. - * grub-core/genmodsrc.sh: Removed. - * grub-core/genpartmaplist.sh: Removed. - * grub-core/genparttoollist.sh: Removed. - * grub-core/gentermiinallist.sh: Removed. - * grub-core/genvideolist.sh: Removed. + * VasEBoot-core/gencmdlist.sh: Removed. + * VasEBoot-core/genfslist.sh: Removed. + * VasEBoot-core/genhandlerlist.sh: Removed. + * VasEBoot-core/genmodsrc.sh: Removed. + * VasEBoot-core/genpartmaplist.sh: Removed. + * VasEBoot-core/genparttoollist.sh: Removed. + * VasEBoot-core/gentermiinallist.sh: Removed. + * VasEBoot-core/genvideolist.sh: Removed. - * grub-core/genmod.sh.in: New file. - * grub-core/gensyminfo.sh.in: New file. + * VasEBoot-core/genmod.sh.in: New file. + * VasEBoot-core/gensyminfo.sh.in: New file. * conf/Makefile.common (CPPFLAGS_*_LIST): New marker flags. * conf/Makefile.extra-dist: Update with new files. * gentpl.py: Remove rules related to unnecessary temporary files. - * grub-core/Makefile.am (syminfo.lst): New replacement for def-* + * VasEBoot-core/Makefile.am (syminfo.lst): New replacement for def-* and und-* files. - * grub-core/Makefile.core.def: New rules for gensyminfo.sh and + * VasEBoot-core/Makefile.core.def: New rules for gensyminfo.sh and genmod.sh scripts. - * grub-core/bus/usb/uhci.c: Remove empty #define. - * grub-core/genmoddep.awk: Updated with new syminfo format. + * VasEBoot-core/bus/usb/uhci.c: Remove empty #define. + * VasEBoot-core/genmoddep.awk: Updated with new syminfo format. * util/bash-completion.d/Makefile.am: Add config.log to CLEANFILES. @@ -23716,25 +23716,25 @@ 2010-09-19 BVK Chaitanya - * util/grub-mkconfig.in: Check the config script for syntax errors + * util/VasEBoot-mkconfig.in: Check the config script for syntax errors before saving. 2010-09-19 Colin Watson 2010-09-19 Vladimir Serbinenko - * Makefile.util.def (grub-install): Use util/grub-install.in on all + * Makefile.util.def (VasEBoot-install): Use util/VasEBoot-install.in on all platforms. - * util/grub-install.in: Add EFI and IEEE1275 support. - * util/i386/efi/grub-install.in: Removed. - * util/ieee1275/grub-install.in: Likewise. + * util/VasEBoot-install.in: Add EFI and IEEE1275 support. + * util/i386/efi/VasEBoot-install.in: Removed. + * util/ieee1275/VasEBoot-install.in: Likewise. 2010-09-19 Vladimir Serbinenko - * grub-core/commands/i386/cmostest.c (+parse_args): New function. - (grub_cmd_cmosclean): Likewise. - (GRUB_MOD_INIT): Register command cmosclean. - * util/grub-mkconfig.in: Export GRUB_BUTTON_CMOS_CLEAN. - * util/grub.d/00_header.in: Handle GRUB_BUTTON_CMOS_CLEAN. + * VasEBoot-core/commands/i386/cmostest.c (+parse_args): New function. + (VasEBoot_cmd_cmosclean): Likewise. + (VasEBoot_MOD_INIT): Register command cmosclean. + * util/VasEBoot-mkconfig.in: Export VasEBoot_BUTTON_CMOS_CLEAN. + * util/VasEBoot.d/00_header.in: Handle VasEBoot_BUTTON_CMOS_CLEAN. 2010-09-18 Carles Pina i Estany 2010-09-18 Aleš Nesrsta @@ -23742,89 +23742,89 @@ Add keyboard layouts support. - * Makefile.util.def (grub-mklayout): New file. - (grub-kbdcomp): New script. - * grub-core/Makefile.am (KERNEL_HEADER_FILES) [COND_mips_yeeloong]: + * Makefile.util.def (VasEBoot-mklayout): New file. + (VasEBoot-kbdcomp): New script. + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES) [COND_mips_yeeloong]: Add keyboard_layouts.h. - * grub-core/Makefile.core.def (kernel): Add commands/keylayouts.c and + * VasEBoot-core/Makefile.core.def (kernel): Add commands/keylayouts.c and commands/boot.c on yeeloong. (keylayouts): New module. - * grub-core/bus/usb/ohci.c - * grub-core/bus/usb/uhci.c - * grub-core/bus/usb/usbhub.c (rescan): New variable. - (grub_usb_add_hub): Poll interrupt pipe for device handling. + * VasEBoot-core/bus/usb/ohci.c + * VasEBoot-core/bus/usb/uhci.c + * VasEBoot-core/bus/usb/usbhub.c (rescan): New variable. + (VasEBoot_usb_add_hub): Poll interrupt pipe for device handling. (attach_root_port): Likewise. (poll_nonroot_hub): Likewise. - (grub_usb_poll_devices): Likewise. + (VasEBoot_usb_poll_devices): Likewise. (detach_device): Close transfer. - * grub-core/bus/usb/usbtrans.c (grub_usb_execute_and_wait_transfer): New + * VasEBoot-core/bus/usb/usbtrans.c (VasEBoot_usb_execute_and_wait_transfer): New function. - (grub_usb_bulk_setup_readwrite): Likewise. - (grub_usb_bulk_finish_readwrite): Likewise. - * grub-core/commands/keylayouts.c: New file. - * grub-core/commands/keystatus.c (grub_getkeystatus): New function. - * grub-core/commands/menuentry.c (hotkey_aliases): All several new + (VasEBoot_usb_bulk_setup_readwrite): Likewise. + (VasEBoot_usb_bulk_finish_readwrite): Likewise. + * VasEBoot-core/commands/keylayouts.c: New file. + * VasEBoot-core/commands/keystatus.c (VasEBoot_getkeystatus): New function. + * VasEBoot-core/commands/menuentry.c (hotkey_aliases): All several new aliases. - * grub-core/term/at_keyboard.c: Restructured to use keylayouts and + * VasEBoot-core/term/at_keyboard.c: Restructured to use keylayouts and support scancode 2. - * grub-core/term/usb_keyboard.c: Restructured to use keylayouts. - * include/grub/keyboard_layouts.h: New file. - * util/grub-mklayout.c: New file. - * util/grub-kbdcomp.in: Likewise. + * VasEBoot-core/term/usb_keyboard.c: Restructured to use keylayouts. + * include/VasEBoot/keyboard_layouts.h: New file. + * util/VasEBoot-mklayout.c: New file. + * util/VasEBoot-kbdcomp.in: Likewise. 2010-09-18 Vladimir Serbinenko Unify memory types. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Include memory.h. - * grub-core/commands/lsmmap.c (grub_cmd_lsmmap): Output user-readable + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Include memory.h. + * VasEBoot-core/commands/lsmmap.c (VasEBoot_cmd_lsmmap): Output user-readable types. - * grub-core/kern/i386/multiboot_mmap.c (grub_lower_mem): Removed. - (grub_upper_mem): Likewise. - * grub-core/kern/ieee1275/init.c (grub_upper_mem): Likewise. - * include/grub/memory.h (grub_memory_type_t): New enum. + * VasEBoot-core/kern/i386/multiboot_mmap.c (VasEBoot_lower_mem): Removed. + (VasEBoot_upper_mem): Likewise. + * VasEBoot-core/kern/ieee1275/init.c (VasEBoot_upper_mem): Likewise. + * include/VasEBoot/memory.h (VasEBoot_memory_type_t): New enum. All users updated. 2010-09-18 Vladimir Serbinenko - * grub-core/Makefile.core.def (lsapm): New module. - * grub-core/commands/i386/pc/lsapm.c: New file. - * grub-core/loader/i386/multiboot_mbi.c (make_mbi) [GRUB_MACHINE_PCBIOS]: Pass APM info. - * grub-core/loader/multiboot_mbi2.c (make_mbi) [GRUB_MACHINE_PCBIOS]: + * VasEBoot-core/Makefile.core.def (lsapm): New module. + * VasEBoot-core/commands/i386/pc/lsapm.c: New file. + * VasEBoot-core/loader/i386/multiboot_mbi.c (make_mbi) [VasEBoot_MACHINE_PCBIOS]: Pass APM info. + * VasEBoot-core/loader/multiboot_mbi2.c (make_mbi) [VasEBoot_MACHINE_PCBIOS]: Likewise. - * include/grub/i386/pc/apm.h: New file. + * include/VasEBoot/i386/pc/apm.h: New file. * include/multiboot.h (multiboot_apm_info): New struct. 2010-09-18 Vladimir Serbinenko - GRUB-legacy configuration file support. + VasEBoot-legacy configuration file support. - * Makefile.util.def (grub-menulst2cfg): New util. - * docs/man/grub-menulst2cfg.h2m: New file. - * grub-core/Makefile.core.def (legacycfg): New module. - * grub-core/commands/legacycfg.c: New file. - * grub-core/commands/menuentry.c (append_menu_entry): Rename to ... - (grub_normal_add_menu_entry): ... this. - * grub-core/commands/password.c (grub_cmd_password): Split main part to ... - (grub_normal_set_password): ...this. - * grub-core/commands/videoinfo.c (grub_cmd_videoinfo): Support MODE. - * grub-core/loader/i386/linux.c (linux_vesafb_res): Move to .., - * grub-core/lib/i386/pc/vesa_modes_table.c: ... here. - * grub-core/lib/legacy_parse.c: New file. - * grub-core/normal/auth.c (grub_cmd_authenticate): New command. - * include/grub/i386/pc/vesa_modes_table.h: New file. - * include/grub/legacy_parse.h: Likewise. - * include/grub/normal.h (grub_normal_add_menu_entry): New proto. - * util/grub-menulst2cfg.c: New file. + * Makefile.util.def (VasEBoot-menulst2cfg): New util. + * docs/man/VasEBoot-menulst2cfg.h2m: New file. + * VasEBoot-core/Makefile.core.def (legacycfg): New module. + * VasEBoot-core/commands/legacycfg.c: New file. + * VasEBoot-core/commands/menuentry.c (append_menu_entry): Rename to ... + (VasEBoot_normal_add_menu_entry): ... this. + * VasEBoot-core/commands/password.c (VasEBoot_cmd_password): Split main part to ... + (VasEBoot_normal_set_password): ...this. + * VasEBoot-core/commands/videoinfo.c (VasEBoot_cmd_videoinfo): Support MODE. + * VasEBoot-core/loader/i386/linux.c (linux_vesafb_res): Move to .., + * VasEBoot-core/lib/i386/pc/vesa_modes_table.c: ... here. + * VasEBoot-core/lib/legacy_parse.c: New file. + * VasEBoot-core/normal/auth.c (VasEBoot_cmd_authenticate): New command. + * include/VasEBoot/i386/pc/vesa_modes_table.h: New file. + * include/VasEBoot/legacy_parse.h: Likewise. + * include/VasEBoot/normal.h (VasEBoot_normal_add_menu_entry): New proto. + * util/VasEBoot-menulst2cfg.c: New file. 2010-09-17 Colin Watson - * grub-core/kern/emu/hostdisk.c + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Initialise node. 2010-09-17 Colin Watson - * grub-core/kern/emu/hostdisk.c + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Fix devmapper memory pool leak. Reported and based on patch by: Modestas Vainius. @@ -23834,7 +23834,7 @@ Fix DM-RAID probing with recent versions of device-mapper udev rules. - * grub-core/kern/emu/hostdisk.c (read_device_map): Don't + * VasEBoot-core/kern/emu/hostdisk.c (read_device_map): Don't canonicalise device paths under /dev/mapper/. (convert_system_partition_to_system_disk): Compare the uncanonicalised path to /dev/mapper/ rather than the canonicalised @@ -23853,42 +23853,42 @@ Support RAID on virtio devices, and others. - * grub-core/kern/emu/getroot.c [__MINGW32__] (find_root_device): + * VasEBoot-core/kern/emu/getroot.c [__MINGW32__] (find_root_device): Rename to ... - [__MINGW32__] (grub_find_device): ... this. + [__MINGW32__] (VasEBoot_find_device): ... this. [! __MINGW32__ && ! __CYGWIN__] (find_root_device): Rename to ... - [! __MINGW32__ && ! __CYGWIN__] (grub_find_device): ... this. Use a + [! __MINGW32__ && ! __CYGWIN__] (VasEBoot_find_device): ... this. Use a reasonable default if dir is NULL. [! __MINGW32__ && __CYGWIN__] (find_cygwin_root_device): Rename to ... - [! __MINGW32__ && __CYGWIN__] (grub_find_device): ... this. - (grub_guess_root_device): Update callers. - * include/grub/emu/getroot.h (grub_find_device): Add prototype. + [! __MINGW32__ && __CYGWIN__] (VasEBoot_find_device): ... this. + (VasEBoot_guess_root_device): Update callers. + * include/VasEBoot/emu/getroot.h (VasEBoot_find_device): Add prototype. - * util/raid.c (grub_util_getdiskname): Remove. - (grub_util_raid_getmembers): Use grub_find_device rather than - grub_util_getdiskname. + * util/raid.c (VasEBoot_util_getdiskname): Remove. + (VasEBoot_util_raid_getmembers): Use VasEBoot_find_device rather than + VasEBoot_util_getdiskname. 2010-09-16 Colin Watson - * docs/grub.texi (serial): Remove obsolete comment about GRUB + * docs/VasEBoot.texi (serial): Remove obsolete comment about VasEBoot needing to be compiled with serial support. (ls): Indicate that multiple files are accepted. - * grub-core/commands/ls.c (GRUB_MOD_INIT): Update help text to + * VasEBoot-core/commands/ls.c (VasEBoot_MOD_INIT): Update help text to indicate that multiple files are accepted. 2010-09-16 Colin Watson - * .bzrignore: Add *.1, *.8, grub-shell, grub-shell-tester, - libgrub_a_init.c, and util/bash-completion.d/grub. + * .bzrignore: Add *.1, *.8, VasEBoot-shell, VasEBoot-shell-tester, + libVasEBoot_a_init.c, and util/bash-completion.d/VasEBoot. 2010-09-15 Vladimir Serbinenko - * util/grub-setup.c (setup): Fix incorrect container semantics. + * util/VasEBoot-setup.c (setup): Fix incorrect container semantics. 2010-09-15 Vladimir Serbinenko - * grub-core/commands/parttool.c (grub_cmd_parttool): Fix a variable + * VasEBoot-core/commands/parttool.c (VasEBoot_cmd_parttool): Fix a variable misusage. Reported by: J. Nick Terry @@ -23896,143 +23896,143 @@ Move embedding routines to partmap sources files. - * grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot) - [GRUB_UTIL]: New variable. + * VasEBoot-core/partmap/gpt.c (VasEBoot_gpt_partition_type_bios_boot) + [VasEBoot_UTIL]: New variable. (gpt_partition_map_iterate): Set part.parent. - (gpt_partition_map_embed) [GRUB_UTIL]: New function. - (grub_gpt_partition_map) [GRUB_UTIL]: Set .embed. - * grub-core/partmap/msdos.c (pc_partition_map_embed) [GRUB_UTIL]: + (gpt_partition_map_embed) [VasEBoot_UTIL]: New function. + (VasEBoot_gpt_partition_map) [VasEBoot_UTIL]: Set .embed. + * VasEBoot-core/partmap/msdos.c (pc_partition_map_embed) [VasEBoot_UTIL]: New function. - (grub_msdos_partition_map) [GRUB_UTIL]: Set .embed. - * include/grub/partition.h (grub_embed_type_t) [GRUB_UTIL]: New type. - (grub_partition_map) [GRUB_UTIL]: New field embed. - * util/grub-setup.c (grub_gpt_partition_type_bios_boot): Removed. + (VasEBoot_msdos_partition_map) [VasEBoot_UTIL]: Set .embed. + * include/VasEBoot/partition.h (VasEBoot_embed_type_t) [VasEBoot_UTIL]: New type. + (VasEBoot_partition_map) [VasEBoot_UTIL]: New field embed. + * util/VasEBoot-setup.c (VasEBoot_gpt_partition_type_bios_boot): Removed. (setup): Use ->embed. 2010-09-15 Vladimir Serbinenko - * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): New + * VasEBoot-core/kern/emu/hostdisk.c (VasEBoot_util_biosdisk_is_floppy): New function. - * include/grub/emu/hostdisk.h (grub_util_biosdisk_is_floppy): New proto. - * util/grub-setup.c (setup): Use grub_util_biosdisk_is_floppy. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_biosdisk_is_floppy): New proto. + * util/VasEBoot-setup.c (setup): Use VasEBoot_util_biosdisk_is_floppy. 2010-09-15 Yves Blusseau Add function to get completions from usage. - * util/bash-completion.d/grub-completion.bash.in: Add function to get + * util/bash-completion.d/VasEBoot-completion.bash.in: Add function to get completions from usage. Use LC_ALL=C to get options properly. 2010-09-15 Vladimir Serbinenko - * grub-core/gnulib/basename-lgpl.c: Imported. - * grub-core/gnulib/basename.c: Likewise. - * grub-core/gnulib/dirname-lgpl.c: Likewise. - * grub-core/gnulib/dirname.c: Likewise. - * grub-core/gnulib/dirname.h: Likewise. - * grub-core/gnulib/stripslash.c: Likewise. + * VasEBoot-core/gnulib/basename-lgpl.c: Imported. + * VasEBoot-core/gnulib/basename.c: Likewise. + * VasEBoot-core/gnulib/dirname-lgpl.c: Likewise. + * VasEBoot-core/gnulib/dirname.c: Likewise. + * VasEBoot-core/gnulib/dirname.h: Likewise. + * VasEBoot-core/gnulib/stripslash.c: Likewise. 2010-09-15 Vladimir Serbinenko - * grub-core/gnulib/error.c: Resynced. - * grub-core/gnulib/getopt.c: Likewise. - * grub-core/gnulib/getopt_int.h: Likewise. - * grub-core/gnulib/regex.h: Likewise. - * grub-core/gnulib/regex_internal.c: Likewise. - * grub-core/gnulib/regex_internal.h: Likewise. + * VasEBoot-core/gnulib/error.c: Resynced. + * VasEBoot-core/gnulib/getopt.c: Likewise. + * VasEBoot-core/gnulib/getopt_int.h: Likewise. + * VasEBoot-core/gnulib/regex.h: Likewise. + * VasEBoot-core/gnulib/regex_internal.c: Likewise. + * VasEBoot-core/gnulib/regex_internal.h: Likewise. 2010-09-15 Szymon Janc - * grub-core/lib/xzembed/xz_dec_stream.c (dec_main): Fix index and block + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (dec_main): Fix index and block CRC calculations and validity checks. - * grub-core/lib/xzembed/xz_dec_stream.c (dec_index): Fix index CRC + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (dec_index): Fix index CRC calculations. 2010-09-15 Szymon Janc - * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_end): Fix memory leak. + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (xz_dec_end): Fix memory leak. 2010-09-14 Vladimir Serbinenko Fix incorrect echo options handling. Reported by: Yves Blusseau. - * include/grub/command.h (grub_command_flags_t): New flags - GRUB_COMMAND_ACCEPT_DASH and GRUB_COMMAND_OPTIONS_AT_START. - * grub-core/lib/arg.c (grub_arg_parse): Handle new flags. - * grub-core/commands/echo.c (GRUB_MOD_INIT): Use new flags. + * include/VasEBoot/command.h (VasEBoot_command_flags_t): New flags + VasEBoot_COMMAND_ACCEPT_DASH and VasEBoot_COMMAND_OPTIONS_AT_START. + * VasEBoot-core/lib/arg.c (VasEBoot_arg_parse): Handle new flags. + * VasEBoot-core/commands/echo.c (VasEBoot_MOD_INIT): Use new flags. 2010-09-14 Vladimir Serbinenko - * include/grub/command.h (GRUB_COMMAND_FLAG_CMDLINE): Removed. All + * include/VasEBoot/command.h (VasEBoot_COMMAND_FLAG_CMDLINE): Removed. All users updated. - (GRUB_COMMAND_FLAG_MENU): Likewise. - (GRUB_COMMAND_FLAG_BOTH): Likewise. - (GRUB_COMMAND_FLAG_TITLE): Removed. - (GRUB_COMMAND_FLAG_NO_ECHO): Likewise. - (GRUB_COMMAND_FLAG_EXTCMD): Moved into enum. - (GRUB_COMMAND_FLAG_DYNCMD): Likewise. - (GRUB_COMMAND_FLAG_BLOCKS): Likewise. - (grub_command_flags_t): New enum. All users updated. + (VasEBoot_COMMAND_FLAG_MENU): Likewise. + (VasEBoot_COMMAND_FLAG_BOTH): Likewise. + (VasEBoot_COMMAND_FLAG_TITLE): Removed. + (VasEBoot_COMMAND_FLAG_NO_ECHO): Likewise. + (VasEBoot_COMMAND_FLAG_EXTCMD): Moved into enum. + (VasEBoot_COMMAND_FLAG_DYNCMD): Likewise. + (VasEBoot_COMMAND_FLAG_BLOCKS): Likewise. + (VasEBoot_command_flags_t): New enum. All users updated. 2010-09-14 Seth Goldberg Fix solaris compilation. - * grub-core/Makefile.core.def (kernel): Include gnulib/error.c on emu. - (grub-emu): Add LIBZFS and LIBNVPAIR to ldadd. - (grub-emu-list): Likewise. + * VasEBoot-core/Makefile.core.def (kernel): Include gnulib/error.c on emu. + (VasEBoot-emu): Add LIBZFS and LIBNVPAIR to ldadd. + (VasEBoot-emu-list): Likewise. 2010-09-14 Vladimir Serbinenko Remove deprecated root command. - * grub-core/commands/minicmd.c (grub_mini_cmd_root): Removed. All users + * VasEBoot-core/commands/minicmd.c (VasEBoot_mini_cmd_root): Removed. All users updated. 2010-09-14 Vladimir Serbinenko - * util/i386/pc/grub-setup.c: Merge this ... - * util/sparc64/ieee1275/grub-setup.c: ... and this ... - * util/grub-setup.c: ... into this. - * include/grub/sparc64/ieee1275/boot.h (grub_boot_blocklist) [ASM_FILE]: + * util/i386/pc/VasEBoot-setup.c: Merge this ... + * util/sparc64/ieee1275/VasEBoot-setup.c: ... and this ... + * util/VasEBoot-setup.c: ... into this. + * include/VasEBoot/sparc64/ieee1275/boot.h (VasEBoot_boot_blocklist) [ASM_FILE]: New struct. 2010-09-14 Vladimir Serbinenko - * grub-core/fs/ext2.c (grub_ext2_open): Use return error value when + * VasEBoot-core/fs/ext2.c (VasEBoot_ext2_open): Use return error value when possible. 2010-09-14 Vladimir Serbinenko - * grub-core/partmap/sun.c (sun_partition_map_iterate): Don't needlesly + * VasEBoot-core/partmap/sun.c (sun_partition_map_iterate): Don't needlesly allocate p. 2010-09-14 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Add + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Add explicit root argument to set to prevent UUID to be interpreted as argument to set. 2010-09-14 Vladimir Serbinenko - * grub-core/kern/sparc64/ieee1275/crt0.S: Align stack. + * VasEBoot-core/kern/sparc64/ieee1275/crt0.S: Align stack. 2010-09-14 Vladimir Serbinenko - Don't export grub_gate_a20. + Don't export VasEBoot_gate_a20. - * grub-core/kern/i386/pc/init.c: Remove leftovers. - * grub-core/kern/i386/pc/startup.S (FUNCTION(grub_gate_a20)): Rename + * VasEBoot-core/kern/i386/pc/init.c: Remove leftovers. + * VasEBoot-core/kern/i386/pc/startup.S (FUNCTION(VasEBoot_gate_a20)): Rename to ... - (grub_gate_a20): ... this. All users updated. - * include/grub/i386/pc/init.h: Removed. All users updated. + (VasEBoot_gate_a20): ... this. All users updated. + * include/VasEBoot/i386/pc/init.h: Removed. All users updated. 2010-09-14 Vladimir Serbinenko Create euro.pf2 which supports most European languages. - * Makefile.am (grubdata_DATA): Add euro.pf2. + * Makefile.am (VasEBootdata_DATA): Add euro.pf2. (euro.pf2): New target. (CLEANFILES): Add euro.pf2. @@ -24043,169 +24043,169 @@ 2010-09-13 Vladimir Serbinenko - Disable usbserial on grub-emu since our libusb code isn't good enough + Disable usbserial on VasEBoot-emu since our libusb code isn't good enough yet. - * grub-core/Makefile.core.def (usbserial_common): Disable on emu. + * VasEBoot-core/Makefile.core.def (usbserial_common): Disable on emu. (usbserial_pl2303): Likewise. (usbserial_ftdi): Likewise. 2010-09-13 Vladimir Serbinenko - * include/grub/disk.h (grub_disk): Remove has_partitions. + * include/VasEBoot/disk.h (VasEBoot_disk): Remove has_partitions. All users updated. - * disk/loopback.c (grub_loopback): Remove has_partitions. + * disk/loopback.c (VasEBoot_loopback): Remove has_partitions. All users updated. (options): Remove partitions. All users updated. - * util/grub-fstest.c (fstest): Don't pass "-p" to loopback. - * util/i386/pc/grub-setup.c (setup): copy partition table only when + * util/VasEBoot-fstest.c (fstest): Don't pass "-p" to loopback. + * util/i386/pc/VasEBoot-setup.c (setup): copy partition table only when actual partition table is found. 2010-09-13 Vladimir Serbinenko Remove readability checks (too many false negatives). - * util/grub-install.in: Remove readability checks. - * util/grub-mkconfig.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Revert to old + * util/VasEBoot-install.in: Remove readability checks. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot-mkconfig_lib.in (is_path_readable_by_VasEBoot): Revert to old way. 2010-09-13 Vladimir Serbinenko Enable acpi shutdown on all ACPI platforms. - * grub-core/Makefile.core.def (halt): Inlude commands/acpihalt.c + * VasEBoot-core/Makefile.core.def (halt): Inlude commands/acpihalt.c on coreboo, multiboot and EFI. - * grub-core/commands/acpihalt.c (get_sleep_type): Add missing casts. - (grub_acpi_halt): Likewise. - * grub-core/commands/i386/pc/halt.c (grub_halt): Call grub_acpi_halt. - (grub_cmd_halt): Don't call grub_acpi_halt directly. - * grub-core/lib/efi/halt.c (grub_halt): Call grub_acpi_halt. - * grub-core/lib/i386/halt.c (grub_halt) - [GRUB_MACHINE_COREBOOT || GRUB_MACHINE_MULTIBOOT]: Likewise. + * VasEBoot-core/commands/acpihalt.c (get_sleep_type): Add missing casts. + (VasEBoot_acpi_halt): Likewise. + * VasEBoot-core/commands/i386/pc/halt.c (VasEBoot_halt): Call VasEBoot_acpi_halt. + (VasEBoot_cmd_halt): Don't call VasEBoot_acpi_halt directly. + * VasEBoot-core/lib/efi/halt.c (VasEBoot_halt): Call VasEBoot_acpi_halt. + * VasEBoot-core/lib/i386/halt.c (VasEBoot_halt) + [VasEBoot_MACHINE_COREBOOT || VasEBoot_MACHINE_MULTIBOOT]: Likewise. 2010-09-13 Vladimir Serbinenko - * grub-core/commands/iorw.c (grub_cmd_read): Declare buf in smallest + * VasEBoot-core/commands/iorw.c (VasEBoot_cmd_read): Declare buf in smallest context. 2010-09-13 Vladimir Serbinenko - * grub-core/video/efi_gop.c: Fix over-80-chars line. - * grub-core/video/efi_uga.c: Likewise. + * VasEBoot-core/video/efi_gop.c: Fix over-80-chars line. + * VasEBoot-core/video/efi_uga.c: Likewise. 2010-09-13 Vladimir Serbinenko Filter devaliases and never open same device twice. - * grub-core/disk/ieee1275/ofdisk.c (last_devpath): New variable. + * VasEBoot-core/disk/ieee1275/ofdisk.c (last_devpath): New variable. (last_ihandle): Likewise. (ofdisk_hash_ent): New member shortest. (ofdisk_hash_add): Add canonical path too. (scan): New function. - (grub_ofdisk_iterate): Iterate over hashed entries. + (VasEBoot_ofdisk_iterate): Iterate over hashed entries. (compute_dev_path): Don't add :0. - (grub_ofdisk_open): Don't really open the disk. - (grub_ofdisk_close): Avoid closing unrelated disk. - (grub_ofdisk_read): Implement reopen logic. - * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_canonicalise_devname): + (VasEBoot_ofdisk_open): Don't really open the disk. + (VasEBoot_ofdisk_close): Avoid closing unrelated disk. + (VasEBoot_ofdisk_read): Implement reopen logic. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_ieee1275_canonicalise_devname): New function. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_canonicalise_devname): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_canonicalise_devname): New proto. 2010-09-13 Vladimir Serbinenko Fix sparc64. - * configure.ac (GRUB_KERNEL_MACHINE_LINK_ADDR): Removed. - * grub-core/Makefile.core.def (kernel): Make ldflags just use the + * configure.ac (VasEBoot_KERNEL_MACHINE_LINK_ADDR): Removed. + * VasEBoot-core/Makefile.core.def (kernel): Make ldflags just use the right address. Add sparc64_ieee1275_ldflags. - * grub-core/loader/sparc64/ieee1275/linux.c: Remove leftover include. - * util/grub-mkimagexx.c (locate_sections): Correct grub_host_to_target32 - to grub_host_to_target_addr + * VasEBoot-core/loader/sparc64/ieee1275/linux.c: Remove leftover include. + * util/VasEBoot-mkimagexx.c (locate_sections): Correct VasEBoot_host_to_target32 + to VasEBoot_host_to_target_addr (load_image): Likewise. 2010-09-13 Vladimir Serbinenko - * grub-core/normal/completion.c (complete_file): Handle device + * VasEBoot-core/normal/completion.c (complete_file): Handle device containing slash. Fix based on patch by Doug Nazar. 2010-09-13 Vladimir Serbinenko - grub-mknetdir script. + VasEBoot-mknetdir script. - * Makefile.util.def (grub-mknetdir): New module. - * tests/util/grub-shell.in: Support boot=net - * util/grub-mknetdir.in: New file. + * Makefile.util.def (VasEBoot-mknetdir): New module. + * tests/util/VasEBoot-shell.in: Support boot=net + * util/VasEBoot-mknetdir.in: New file. 2010-09-13 Vladimir Serbinenko videoinfo on non-vbe. - * grub-core/Makefile.core.def (vbeinfo): Removed. + * VasEBoot-core/Makefile.core.def (vbeinfo): Removed. (vbetest): Removed. (videoinfo): New module. - * grub-core/commands/i386/pc/vbeinfo.c: Removed. - * grub-core/commands/i386/pc/vbetest.c: Removed. - * grub-core/commands/videoinfo.c: New file. - * grub-core/commands/videotest.c (grub_cmd_videotest): Support mode + * VasEBoot-core/commands/i386/pc/vbeinfo.c: Removed. + * VasEBoot-core/commands/i386/pc/vbetest.c: Removed. + * VasEBoot-core/commands/videoinfo.c: New file. + * VasEBoot-core/commands/videotest.c (VasEBoot_cmd_videotest): Support mode specification. - (grub_cmd_videotest) [GRUB_MACHINE_PCBIOS]: Load vbe.mod when invoked + (VasEBoot_cmd_videotest) [VasEBoot_MACHINE_PCBIOS]: Load vbe.mod when invoked as vbetest. - (GRUB_MOD_INIT) [GRUB_MACHINE_PCBIOS]: New command vbetest. - (GRUB_MOD_FINI) [GRUB_MACHINE_PCBIOS]: Unregister vbetest. - * grub-core/video/efi_gop.c (grub_video_gop_fill_mode_info): Fill + (VasEBoot_MOD_INIT) [VasEBoot_MACHINE_PCBIOS]: New command vbetest. + (VasEBoot_MOD_FINI) [VasEBoot_MACHINE_PCBIOS]: Unregister vbetest. + * VasEBoot-core/video/efi_gop.c (VasEBoot_video_gop_fill_mode_info): Fill mode_number. New parameter mode. All users updated. - (grub_video_gop_iterate): New function. - (grub_video_efi_gop): New member iterate. - * grub-core/video/i386/pc/vbe.c (framebuffer): Removed leftover fields. - (grub_vbe_set_video_mode): Remove setting useless fields. + (VasEBoot_video_gop_iterate): New function. + (VasEBoot_video_efi_gop): New member iterate. + * VasEBoot-core/video/i386/pc/vbe.c (framebuffer): Removed leftover fields. + (VasEBoot_vbe_set_video_mode): Remove setting useless fields. (vbe2videoinfo): New function. - (grub_video_vbe_iterate): Likewise. - (grub_video_vbe_setup): Use vbe2videoinfo. - (grub_video_vbe_print_adapter_specific_info): New function. - (grub_video_vbe_adapter): New fields iterate and + (VasEBoot_video_vbe_iterate): Likewise. + (VasEBoot_video_vbe_setup): Use vbe2videoinfo. + (VasEBoot_video_vbe_print_adapter_specific_info): New function. + (VasEBoot_video_vbe_adapter): New fields iterate and print_adapter_specific_info. - * include/grub/video.h (GRUB_VIDEO_MODE_*): Transform into enum. + * include/VasEBoot/video.h (VasEBoot_VIDEO_MODE_*): Transform into enum. All users updated. - (grub_video_mode_info): New field mode_number. - (grub_video_adapter): New fields iterate and + (VasEBoot_video_mode_info): New field mode_number. + (VasEBoot_video_adapter): New fields iterate and print_adapter_specific_info. 2010-09-13 Tristan Gingold -2010-09-13 Robert Millan +2010-09-13 Robert Millan 2010-09-13 Vladimir Serbinenko - * grub-core/commands/efi/lsefisystab.c: New file. - * grub-core/commands/efi/lssal.c: Likewise. - * grub-core/Makefile.core.def (lsacpi): New module. + * VasEBoot-core/commands/efi/lsefisystab.c: New file. + * VasEBoot-core/commands/efi/lssal.c: Likewise. + * VasEBoot-core/Makefile.core.def (lsacpi): New module. (lsefisystab): Likewise. - * include/grub/efi/api.h (GRUB_EFI_SAL_TABLE_GUID): New definition. - (GRUB_EFI_HCDP_TABLE_GUID): Likewise. - (grub_efi_sal_system_table): New struct. - (grub_efi_sal_system_table_entrypoint_descriptor): Likewise. - (grub_efi_sal_system_table_memory_descriptor): Likewise. - (grub_efi_sal_system_table_platform_features): Likewise. - (grub_efi_sal_system_table_translation_register_descriptor): Likewise. - (grub_efi_sal_system_table_purge_translation_coherence): Likewise. - (grub_efi_sal_system_table_ap_wakeup): Likewise. - * include/grub/types.h (PRIuGRUB_UINT64_T): New definition. + * include/VasEBoot/efi/api.h (VasEBoot_EFI_SAL_TABLE_GUID): New definition. + (VasEBoot_EFI_HCDP_TABLE_GUID): Likewise. + (VasEBoot_efi_sal_system_table): New struct. + (VasEBoot_efi_sal_system_table_entrypoint_descriptor): Likewise. + (VasEBoot_efi_sal_system_table_memory_descriptor): Likewise. + (VasEBoot_efi_sal_system_table_platform_features): Likewise. + (VasEBoot_efi_sal_system_table_translation_register_descriptor): Likewise. + (VasEBoot_efi_sal_system_table_purge_translation_coherence): Likewise. + (VasEBoot_efi_sal_system_table_ap_wakeup): Likewise. + * include/VasEBoot/types.h (PRIuVasEBoot_UINT64_T): New definition. 2010-09-13 Vladimir Serbinenko Support explicit user claim that a device is BIOS-visible. - * grub-core/kern/emu/getroot.c (grub_util_get_dev_abstraction): - Return GRUB_DEV_ABSTRACTION_NONE if device is in device.map. - * grub-core/kern/emu/hostdisk.c + * VasEBoot-core/kern/emu/getroot.c (VasEBoot_util_get_dev_abstraction): + Return VasEBoot_DEV_ABSTRACTION_NONE if device is in device.map. + * VasEBoot-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Support mdX. (find_system_device): New parameter add. All users updated. - (grub_util_biosdisk_is_present): New function. - * include/grub/emu/hostdisk.h (grub_util_biosdisk_is_present): New + (VasEBoot_util_biosdisk_is_present): New function. + * include/VasEBoot/emu/hostdisk.h (VasEBoot_util_biosdisk_is_present): New proto. 2010-09-13 Vladimir Serbinenko @@ -24222,98 +24222,98 @@ * Makefile.am: Add util/bash-completion.d directory * configure.ac: Likewise. * util/bash-completion.d/Makefile.am: New file. - * util/bash-completion.d/grub-completion.bash.in: Likewise. + * util/bash-completion.d/VasEBoot-completion.bash.in: Likewise. 2010-09-12 Vladimir Serbinenko - * grub-core/normal/term.c (put_glyphs_terminal): Correct sign. + * VasEBoot-core/normal/term.c (put_glyphs_terminal): Correct sign. (print_backlog): set backlog_ucs4 and backlog_glyphs. Reported by: Yves Blusseau. 2010-09-12 Vladimir Serbinenko - * grub-core/normal/misc.c (grub_normal_print_device_info): Show + * VasEBoot-core/normal/misc.c (VasEBoot_normal_print_device_info): Show partition size and offset. 2010-09-12 Vladimir Serbinenko - * grub-core/commands/wildcard.c (make_regex): Escape brackets. + * VasEBoot-core/commands/wildcard.c (make_regex): Escape brackets. 2010-09-12 Vladimir Serbinenko - * grub-core/commands/ls.c (grub_cmd_ls): Accept multiple files. + * VasEBoot-core/commands/ls.c (VasEBoot_cmd_ls): Accept multiple files. 2010-09-12 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_vprintf): Use va_copy when necessary. - (grub_xvasprintf): Likewise. + * VasEBoot-core/kern/misc.c (VasEBoot_vprintf): Use va_copy when necessary. + (VasEBoot_xvasprintf): Likewise. 2010-09-12 Vladimir Serbinenko - * grub-core/kern/emu/main.c (main): Call hostfs_init only after init_all. + * VasEBoot-core/kern/emu/main.c (main): Call hostfs_init only after init_all. 2010-09-12 Vladimir Serbinenko - * grub-core/commands/menuentry.c (append_menu_entry): Don't rely on + * VasEBoot-core/commands/menuentry.c (append_menu_entry): Don't rely on args ending with NULL. 2010-09-12 Vladimir Serbinenko - * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_reset): Preserve context + * VasEBoot-core/lib/xzembed/xz_dec_stream.c (xz_dec_reset): Preserve context pointer. 2010-09-11 Szymon Janc - * grub-core/commands/lsacpi.c (grub_cmd_lsacpi): Fix prototype. + * VasEBoot-core/commands/lsacpi.c (VasEBoot_cmd_lsacpi): Fix prototype. 2010-09-11 Vladimir Serbinenko Shutdown using ACPI. - * grub-core/Makefile.core.def (halt): Add commands/acpihalt.c on i386-pc. - * grub-core/commands/acpihalt.c: New file. - * grub-core/commands/i386/pc/halt.c (grub_cmd_halt): Call grub_acpi_halt. - * include/grub/acpi.h (grub_acpi_fadt): New member pm1a. - (grub_acpi_halt): New proto. - (GRUB_ACPI_SLP_EN): New const. - (GRUB_ACPI_SLP_TYP_OFFSET): Likewise. - (GRUB_ACPI_OPCODE_*): New enum. - (GRUB_ACPI_EXTOPCODE_*): Likewise. + * VasEBoot-core/Makefile.core.def (halt): Add commands/acpihalt.c on i386-pc. + * VasEBoot-core/commands/acpihalt.c: New file. + * VasEBoot-core/commands/i386/pc/halt.c (VasEBoot_cmd_halt): Call VasEBoot_acpi_halt. + * include/VasEBoot/acpi.h (VasEBoot_acpi_fadt): New member pm1a. + (VasEBoot_acpi_halt): New proto. + (VasEBoot_ACPI_SLP_EN): New const. + (VasEBoot_ACPI_SLP_TYP_OFFSET): Likewise. + (VasEBoot_ACPI_OPCODE_*): New enum. + (VasEBoot_ACPI_EXTOPCODE_*): Likewise. 2010-09-11 Tristan Gingold -2010-09-11 Robert Millan +2010-09-11 Robert Millan 2010-09-11 Vladimir Serbinenko * commands/lsacpi.c: New file. - * grub-core/Makefile.core.def (lsacpi): New module. - * include/grub/acpi.h (GRUB_ACPI_FADT_SIGNATURE): New definition. - (GRUB_ACPI_MADT_SIGNATURE): Likewise. - (grub_acpi_madt_entry_header): New struct. - (grub_acpi_madt): Likewise. - (grub_acpi_madt_entry_interrupt_override): Likewise. - (grub_acpi_madt_entry_sapic): Likewise. - (grub_acpi_madt_entry_lsapic): Likewise. - (grub_acpi_madt_entry_platform_int_source): Likewise. - * include/grub/types.h (PRIxGRUB_UINT32_T): New definition. - (PRIuGRUB_UINT32_T): Likewise. - (PRIxGRUB_UINT64_T): Likewise. + * VasEBoot-core/Makefile.core.def (lsacpi): New module. + * include/VasEBoot/acpi.h (VasEBoot_ACPI_FADT_SIGNATURE): New definition. + (VasEBoot_ACPI_MADT_SIGNATURE): Likewise. + (VasEBoot_acpi_madt_entry_header): New struct. + (VasEBoot_acpi_madt): Likewise. + (VasEBoot_acpi_madt_entry_interrupt_override): Likewise. + (VasEBoot_acpi_madt_entry_sapic): Likewise. + (VasEBoot_acpi_madt_entry_lsapic): Likewise. + (VasEBoot_acpi_madt_entry_platform_int_source): Likewise. + * include/VasEBoot/types.h (PRIxVasEBoot_UINT32_T): New definition. + (PRIuVasEBoot_UINT32_T): Likewise. + (PRIxVasEBoot_UINT64_T): Likewise. 2010-09-11 Vladimir Serbinenko Implement loading palette on ieee1275_fb. - * grub-core/video/ieee1275.c (stdout_ihandle): New variable. + * VasEBoot-core/video/ieee1275.c (stdout_ihandle): New variable. (have_setcolors): Likewise. - (grub_video_ieee1275_init): Fill stdout_ihandle and have_setcolors. - (grub_video_ieee1275_setup): Use grub_video_ieee1275_set_palette. - (grub_video_ieee1275_set_palette): Implement. + (VasEBoot_video_ieee1275_init): Fill stdout_ihandle and have_setcolors. + (VasEBoot_video_ieee1275_setup): Use VasEBoot_video_ieee1275_set_palette. + (VasEBoot_video_ieee1275_set_palette): Implement. 2010-09-11 Vladimir Serbinenko 2010-09-11 Colin Watson - * util/grub-install.in (grub_partition): New variable. - Set prefix_drive on EFI and PC to (,$grub_partition) as last resort. - * util/i386/pc/grub-setup.c (setup): Don't touch prefix. + * util/VasEBoot-install.in (VasEBoot_partition): New variable. + Set prefix_drive on EFI and PC to (,$VasEBoot_partition) as last resort. + * util/i386/pc/VasEBoot-setup.c (setup): Don't touch prefix. Fixes a bug reported by Yves Blusseau. 2010-09-11 Vladimir Serbinenko @@ -24321,85 +24321,85 @@ Fix emu on mipsel. * conf/Makefile.common (CFLAGS_PLATFORM): Add -mflush-func - =grub_cpu_flush_cache on all mips and not only yeeloong. + =VasEBoot_cpu_flush_cache on all mips and not only yeeloong. * configure.ac (COND_mips): New conditional. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Add libgcc on all + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Add libgcc on all platforms. - * grub-core/kern/emu/cache.S (__mips__): Use _flush_cache. - * grub-core/kern/emu/full.c (grub_arch_dl_init_linker) - [GRUB_LINKER_HAVE_INIT]: New function. - (grub_emu_post_init): Likewise. - * grub-core/kern/emu/lite.c (grub_emu_post_init): Likewise. - * grub-core/kern/emu/main.c: Use grub_emu_post_init. - * include/grub/cache.h (_mips): Include mips/cache.h. - * include/grub/disk.h [GRUB_UTIL || GRUB_MACHINE_EMU]: Add missing + * VasEBoot-core/kern/emu/cache.S (__mips__): Use _flush_cache. + * VasEBoot-core/kern/emu/full.c (VasEBoot_arch_dl_init_linker) + [VasEBoot_LINKER_HAVE_INIT]: New function. + (VasEBoot_emu_post_init): Likewise. + * VasEBoot-core/kern/emu/lite.c (VasEBoot_emu_post_init): Likewise. + * VasEBoot-core/kern/emu/main.c: Use VasEBoot_emu_post_init. + * include/VasEBoot/cache.h (_mips): Include mips/cache.h. + * include/VasEBoot/disk.h [VasEBoot_UTIL || VasEBoot_MACHINE_EMU]: Add missing LVM and RAID prototypes. - * include/grub/emu/misc.h (grub_emu_post_init): New proto. - * include/grub/mips/time.h (grub_cpu_idle) [GRUB_MACHINE_EMU]: New + * include/VasEBoot/emu/misc.h (VasEBoot_emu_post_init): New proto. + * include/VasEBoot/mips/time.h (VasEBoot_cpu_idle) [VasEBoot_MACHINE_EMU]: New function. 2010-09-10 Colin Watson - * util/grub-install.in: Don't try to verify core.img until after - running grub-mkimage to create it. + * util/VasEBoot-install.in: Don't try to verify core.img until after + running VasEBoot-mkimage to create it. 2010-09-10 Robert Millan - * util/grub.d/10_hurd.in: Add misc readability checks. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Add misc readability checks. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. 2010-09-10 Colin Watson - * util/grub-install.in: ${imgext} won't be defined here until the + * util/VasEBoot-install.in: ${imgext} won't be defined here until the install branch is merged. For the meantime, only verify core.img on i386-pc and sparc64-ieee1275 platforms. 2010-09-10 Robert Millan - Solaris support in grub_find_zpool_from_dir(). Thanks + Solaris support in VasEBoot_find_zpool_from_dir(). Thanks Seth Goldberg for referring to getextmntent() facility. * configure.ac: Check for getextmntent(), `sys/mnttab.h' and `sys/mkdev.h'. - * grub-core/kern/emu/misc.c [HAVE_SYS_MNTTAB_H]: Include + * VasEBoot-core/kern/emu/misc.c [HAVE_SYS_MNTTAB_H]: Include `'. [HAVE_SYS_MKDEV_H]: Include `'. - [HAVE_GETEXTMNTENT] (grub_find_zpool_from_dir): Add getextmntent() + [HAVE_GETEXTMNTENT] (VasEBoot_find_zpool_from_dir): Add getextmntent() method for finding zpool name. 2010-09-10 Colin Watson - grub-fstest needs the host and hostfs modules while other utilities - actively require those modules to be absent, so grub-fstest needs + VasEBoot-fstest needs the host and hostfs modules while other utilities + actively require those modules to be absent, so VasEBoot-fstest needs its own initialisation and finalisation code. - * Makefile.am (grub_fstest.pp): New target. - (grub_fstest_init.lst): Likewise. - (grub_fstest_init.c): Likewise. - * Makefile.util.def (grub-fstest): Add grub_fstest_init.c. + * Makefile.am (VasEBoot_fstest.pp): New target. + (VasEBoot_fstest_init.lst): Likewise. + (VasEBoot_fstest_init.c): Likewise. + * Makefile.util.def (VasEBoot-fstest): Add VasEBoot_fstest_init.c. 2010-09-10 Robert Millan * configure.ac: Check for `struct statfs.f_fstypename' and `struct statfs.f_mntfromname'. - * grub-core/kern/emu/misc.c (grub_find_zpool_from_dir): Conditionalize + * VasEBoot-core/kern/emu/misc.c (VasEBoot_find_zpool_from_dir): Conditionalize kFreeBSD-specific code. 2010-09-10 Robert Millan - * util/grub.d/10_kfreebsd.in: Fix ${kfreebsd_device} initialization + * util/VasEBoot.d/10_kfreebsd.in: Fix ${kfreebsd_device} initialization on ZFS. Now non-main filesystems are supported as / too. 2010-09-09 Colin Watson - * Makefile.util.def (libgrub.a): Move grub-core/kern/emu/hostfs.c - and grub-core/disk/host.c to ... - (grub-fstest): ... here. Having the host disk implementation - present confuses grub-probe and other utility programs. + * Makefile.util.def (libVasEBoot.a): Move VasEBoot-core/kern/emu/hostfs.c + and VasEBoot-core/disk/host.c to ... + (VasEBoot-fstest): ... here. Having the host disk implementation + present confuses VasEBoot-probe and other utility programs. - * util/grub-mkconfig.in: Only verify readability of grub.cfg.new + * util/VasEBoot-mkconfig.in: Only verify readability of VasEBoot.cfg.new when writing to a file, not when writing to stdout. 2010-09-09 BVK Chaitanya @@ -24409,47 +24409,47 @@ 2010-09-09 Robert Millan - * util/grub-probe.c (probe): Fix a pair of unhandled error + * util/VasEBoot-probe.c (probe): Fix a pair of unhandled error conditions. 2010-09-09 Robert Millan Basic Btrfs support (detection and UUID). - * grub-core/fs/btrfs.c: New file. + * VasEBoot-core/fs/btrfs.c: New file. * Makefile.util.def (library): Register btrfs.c. - * grub-core/Makefile.core.def: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. 2010-09-08 Robert Millan - * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Improve + * util/VasEBoot-mkconfig_lib.in (is_path_readable_by_VasEBoot): Improve with (optional) parameters to specify device and relative path. - * util/grub-install.in: Use is_path_readable_by_grub() to + * util/VasEBoot-install.in: Use is_path_readable_by_VasEBoot() to verify readability of a few critical files. - * util/grub-mkconfig.in: Use is_path_readable_by_grub() to - verify readability of grub.cfg.new. + * util/VasEBoot-mkconfig.in: Use is_path_readable_by_VasEBoot() to + verify readability of VasEBoot.cfg.new. 2010-09-08 Vladimir Serbinenko Split minix.mod into minix.mod and minix2.mod. - * Makefile.util.def (libgrub.a): Add grub-core/fs/minix2.c. - * grub-core/Makefile.core.def (minix2): New module. - * grub-core/fs/minix.c: Use definitions instead of runtime version + * Makefile.util.def (libVasEBoot.a): Add VasEBoot-core/fs/minix2.c. + * VasEBoot-core/Makefile.core.def (minix2): New module. + * VasEBoot-core/fs/minix.c: Use definitions instead of runtime version checking. - * grub-core/fs/minix2.c: New file. + * VasEBoot-core/fs/minix2.c: New file. 2010-09-08 Yves Blusseau Add new --boot-directory option to replace --root-directory - * util/grub-install.in: Add new --boot-directory option - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. + * util/VasEBoot-install.in: Add new --boot-directory option + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. 2010-09-08 Yves Blusseau - * util/grub-mkconfig.in: Use new variable. + * util/VasEBoot-mkconfig.in: Use new variable. 2010-09-08 Yves Blusseau @@ -24457,148 +24457,148 @@ 2010-09-08 Vladimir Serbinenko - * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_HAS_CURSORONOFF when appropriate. - * grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): + * VasEBoot-core/kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_HAS_CURSORONOFF when appropriate. + * VasEBoot-core/term/ieee1275/ofconsole.c (VasEBoot_ofconsole_setcursor): Use terminfo and don't use cursor-on/cursor-off unless it's known to work. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New element - GRUB_IEEE1275_FLAG_HAS_CURSORONOFF. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New element + VasEBoot_IEEE1275_FLAG_HAS_CURSORONOFF. 2010-09-08 Colin Watson - * grub-core/kern/efi/init.c (grub_efi_set_prefix): If the prefix + * VasEBoot-core/kern/efi/init.c (VasEBoot_efi_set_prefix): If the prefix starts with "(,", fill the drive containing the loaded image in between those two characters, but expect that a full partition specification including partition map names will follow. 2010-09-08 Robert Millan - * configure.ac: Remove `--enable-grub-fstest' option. - * Makefile.util.def (grub-fstest): Remove COND_GRUB_FSTEST condition. + * configure.ac: Remove `--enable-VasEBoot-fstest' option. + * Makefile.util.def (VasEBoot-fstest): Remove COND_VasEBoot_FSTEST condition. - * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Use - `grub-fstest' instead of `grub-probe' for readability verification. - * util/grub-probe.c (probe): Remove readability verification kludge. + * util/VasEBoot-mkconfig_lib.in (is_path_readable_by_VasEBoot): Use + `VasEBoot-fstest' instead of `VasEBoot-probe' for readability verification. + * util/VasEBoot-probe.c (probe): Remove readability verification kludge. 2010-09-08 Robert Millan - * util/grub-mkconfig.in: Pass `--device ${GRUB_DEVICE}' when - initializing `GRUB_FS'. + * util/VasEBoot-mkconfig.in: Pass `--device ${VasEBoot_DEVICE}' when + initializing `VasEBoot_FS'. 2010-09-08 BVK Chaitanya - Not command (!) support to GRUB script. + Not command (!) support to VasEBoot script. - * tests/grub_script_not.in: New test. + * tests/VasEBoot_script_not.in: New test. * Makefile.util.def: Rules for new test. - * grub-core/script/execute.c (grub_script_execute_cmdline): Handle + * VasEBoot-core/script/execute.c (VasEBoot_script_execute_cmdline): Handle ! command as a special case. - * grub-core/script/yylex.l (GRUB_PARSER_TOKEN_NOT): Removed. + * VasEBoot-core/script/yylex.l (VasEBoot_PARSER_TOKEN_NOT): Removed. 2010-09-07 BVK Chaitanya - * grub-core/commands/wildcard.c (wildcard_expand): Fix wrong - grub_free. + * VasEBoot-core/commands/wildcard.c (wildcard_expand): Fix wrong + VasEBoot_free. 2010-09-07 BVK Chaitanya - * docs/grub.texi (Shell-like scripting): Fix @dots to @dots{}. + * docs/VasEBoot.texi (Shell-like scripting): Fix @dots to @dots{}. 2010-09-07 BVK Chaitanya - * docs/grub.texi (Shell-like scripting): Documentation for break, + * docs/VasEBoot.texi (Shell-like scripting): Documentation for break, continue, shift and return commands. 2010-09-06 Vladimir Serbinenko Rename CD-ROM to cd on BIOS. - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_get_drive): Recognise + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_get_drive): Recognise "cd". - (grub_biosdisk_call_hook): Call with "cd" instead of arbitrary hdX. + (VasEBoot_biosdisk_call_hook): Call with "cd" instead of arbitrary hdX. 2010-09-05 Vladimir Serbinenko - * grub-core/kern/emu/main.c (main): Reinit LVM and RAID. - * util/grub-probe.c (main): Likewise. - * util/i386/pc/grub-setup.c (main): Likewise. - * util/sparc64/ieee1275/grub-setup.c (main): Likewise. + * VasEBoot-core/kern/emu/main.c (main): Reinit LVM and RAID. + * util/VasEBoot-probe.c (main): Likewise. + * util/i386/pc/VasEBoot-setup.c (main): Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c (main): Likewise. Reported and debugged by: alexxy 2010-09-05 Vladimir Serbinenko - * grub-core/disk/lvm.c (grub_lvm_scan_device) [GRUB_UTIL]: Output more + * VasEBoot-core/disk/lvm.c (VasEBoot_lvm_scan_device) [VasEBoot_UTIL]: Output more diagnostic info. 2010-09-05 Jo Shields - * util/grub.d/30_os-prober.in: Add missing classes. + * util/VasEBoot.d/30_os-prober.in: Add missing classes. 2010-09-05 Vladimir Serbinenko - * docs/grub.texi (Theme file format): Document new position format. + * docs/VasEBoot.texi (Theme file format): Document new position format. 2010-09-05 Vladimir Serbinenko - * docs/grub.texi (Theme file format): Replace Box_slice_names.png with + * docs/VasEBoot.texi (Theme file format): Replace Box_slice_names.png with a table. Use @code instead of @verbatim. 2010-09-05 Colin D Bennett Gfxmenu documentation. - * docs/grub.texi (Theme file format): New chapter. + * docs/VasEBoot.texi (Theme file format): New chapter. 2010-09-05 Szymon Janc - * grub-core/Makefile.core.def (xzio): New module. - * grub-core/io/xzio.c: New file. - * grub-core/lib/xzembed/xz.h: New file (from xembed). - * grub-core/lib/xzembed/xz_config.h: Likewise. - * grub-core/lib/xzembed/xz_dec_bcj.c: Likewise. - * grub-core/lib/xzembed/xz_dec_lzma2.c: Likewise. - * grub-core/lib/xzembed/xz_dec_stream.c: Likewise. - * grub-core/lib/xzembed/xz_lzma2.h: Likewise. - * grub-core/lib/xzembed/xz_private.h: Likewise. - * grub-core/lib/xzembed/xz_stream.h: Likewise. - * include/grub/file.h (grub_file_filter_id): New compression filter - GRUB_FILE_FILTER_XZIO. + * VasEBoot-core/Makefile.core.def (xzio): New module. + * VasEBoot-core/io/xzio.c: New file. + * VasEBoot-core/lib/xzembed/xz.h: New file (from xembed). + * VasEBoot-core/lib/xzembed/xz_config.h: Likewise. + * VasEBoot-core/lib/xzembed/xz_dec_bcj.c: Likewise. + * VasEBoot-core/lib/xzembed/xz_dec_lzma2.c: Likewise. + * VasEBoot-core/lib/xzembed/xz_dec_stream.c: Likewise. + * VasEBoot-core/lib/xzembed/xz_lzma2.h: Likewise. + * VasEBoot-core/lib/xzembed/xz_private.h: Likewise. + * VasEBoot-core/lib/xzembed/xz_stream.h: Likewise. + * include/VasEBoot/file.h (VasEBoot_file_filter_id): New compression filter + VasEBoot_FILE_FILTER_XZIO. 2010-09-05 Vladimir Serbinenko - * include/grub/file.h (GRUB_FILE_SIZE_UNKNOWN): New definition. - * grub-core/disk/loopback.c (grub_loopback_open): Handle unknown file + * include/VasEBoot/file.h (VasEBoot_FILE_SIZE_UNKNOWN): New definition. + * VasEBoot-core/disk/loopback.c (VasEBoot_loopback_open): Handle unknown file size. 2010-09-05 Vladimir Serbinenko - * include/grub/err.h (grub_err_t): Replace GRUB_ERR_BAD_GZIP_DATA with - GRUB_ERR_BAD_COMPRESSED_DATA. All users updated. + * include/VasEBoot/err.h (VasEBoot_err_t): Replace VasEBoot_ERR_BAD_GZIP_DATA with + VasEBoot_ERR_BAD_COMPRESSED_DATA. All users updated. 2010-09-05 Vladimir Serbinenko Uncompressed checksum support. - * grub-core/commands/hashsum.c (options): Add option --uncompress. + * VasEBoot-core/commands/hashsum.c (options): Add option --uncompress. (check_list): New parameter uncompress. - (grub_cmd_hashsum): Handle --uncompress. + (VasEBoot_cmd_hashsum): Handle --uncompress. 2010-09-05 Vladimir Serbinenko Reintroduce testload. - * grub-core/commands/minicmd.c (grub_rescue_cmd_testload) [0]: Moved + * VasEBoot-core/commands/minicmd.c (VasEBoot_rescue_cmd_testload) [0]: Moved from here ... - * grub-core/commands/testload.c (grub_cmd_testload): ... here. - (GRUB_MOD_INIT): New function. - (GRUB_MOD_FINI): Likewise. - * grub-core/Makefile.core.def (testload): New module. + * VasEBoot-core/commands/testload.c (VasEBoot_cmd_testload): ... here. + (VasEBoot_MOD_INIT): New function. + (VasEBoot_MOD_FINI): Likewise. + * VasEBoot-core/Makefile.core.def (testload): New module. 2010-09-05 Szymon Janc - * grub-core/lib/posix_wrap/sys/types.h (bool): Transform into an enum. + * VasEBoot-core/lib/posix_wrap/sys/types.h (bool): Transform into an enum. (uint8_t): New type. (uint16_t): Likewise. (uint32_t): Likewise. @@ -24606,213 +24606,213 @@ 2010-09-05 Szymon Janc - * include/grub/crypto.h (GRUB_MD_CRC32): New definition. + * include/VasEBoot/crypto.h (VasEBoot_MD_CRC32): New definition. 2010-09-05 Vladimir Serbinenko - * grub-core/io/gzio.c (grub_gzio_open): Removed "transparent" parameter. + * VasEBoot-core/io/gzio.c (VasEBoot_gzio_open): Removed "transparent" parameter. Made static. - (grub_gzfile_open): Removed. All users updated. - (GRUB_MOD_INIT): New function. - (GRUB_MOD_FINI): Likewise. - * grub-core/kern/file.c (grub_file_filters_all): New variable. - (grub_file_filters_enabled): Likewise. - (grub_file_open): Handle filters. - * grub-core/loader/i386/bsd.c (GRUB_MOD_INIT): Load gzio. - * grub-core/normal/main.c (GRUB_MOD_INIT): Likewise. - * include/grub/file.h (grub_file_filter_id_t): New type. - (grub_file_filter_t): Likewise. - (grub_file_filters_all): New extern variable. - (grub_file_filters_enabled): Likewise. - (grub_file_filter_register): New inline function. - (grub_file_filter_unregister): Likewise. - (grub_file_filter_disable): Likewise. - (grub_file_filter_disable_compression): Likewise. - * include/grub/gzio.h: Removed. + (VasEBoot_gzfile_open): Removed. All users updated. + (VasEBoot_MOD_INIT): New function. + (VasEBoot_MOD_FINI): Likewise. + * VasEBoot-core/kern/file.c (VasEBoot_file_filters_all): New variable. + (VasEBoot_file_filters_enabled): Likewise. + (VasEBoot_file_open): Handle filters. + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_MOD_INIT): Load gzio. + * VasEBoot-core/normal/main.c (VasEBoot_MOD_INIT): Likewise. + * include/VasEBoot/file.h (VasEBoot_file_filter_id_t): New type. + (VasEBoot_file_filter_t): Likewise. + (VasEBoot_file_filters_all): New extern variable. + (VasEBoot_file_filters_enabled): Likewise. + (VasEBoot_file_filter_register): New inline function. + (VasEBoot_file_filter_unregister): Likewise. + (VasEBoot_file_filter_disable): Likewise. + (VasEBoot_file_filter_disable_compression): Likewise. + * include/VasEBoot/gzio.h: Removed. 2010-09-04 BVK Chaitanya - Filename expansion support for wildcards in GRUB script. + Filename expansion support for wildcards in VasEBoot script. - * tests/grub_script_expansion.in: New test. + * tests/VasEBoot_script_expansion.in: New test. * Makefile.util.def: Rule for new test. - * grub-core/commands/wildcard.c: New file, implements filename - expansion support for GRUB script. - * grub-core/Makefile.core.def: Rule update for regexp.mod. - * grub-core/script/argv.c: Cosmetic changes. - * grub-core/script/execute.c (grub_script_arglist_to_argv): + * VasEBoot-core/commands/wildcard.c: New file, implements filename + expansion support for VasEBoot script. + * VasEBoot-core/Makefile.core.def: Rule update for regexp.mod. + * VasEBoot-core/script/argv.c: Cosmetic changes. + * VasEBoot-core/script/execute.c (VasEBoot_script_arglist_to_argv): Refactored to perform wildcard expansion on arguments. - * include/grub/script_sh.h (grub_script_wildcard_translator): New + * include/VasEBoot/script_sh.h (VasEBoot_script_wildcard_translator): New struct. - * tests/util/grub-shell.in: Fix quoting for read input. + * tests/util/VasEBoot-shell.in: Fix quoting for read input. 2010-09-04 BVK Chaitanya Support for updating environment variables with matched substrings of regexp. - * tests/grub_cmd_regexp.in: New test. + * tests/VasEBoot_cmd_regexp.in: New test. * Makefile.util.def: Rule for new test. - * grub-core/commands/regexp.c: New option -s to update environment + * VasEBoot-core/commands/regexp.c: New option -s to update environment variables with regexp matches. 2010-09-04 Szymon Janc - * include/grub/file.h (grub_file): New member not_easly_seekable. - (grub_file_seekable): New inline function. - * grub-core/io/gzio.c (test_header): Don't test end magic if file isn't + * include/VasEBoot/file.h (VasEBoot_file): New member not_easly_seekable. + (VasEBoot_file_seekable): New inline function. + * VasEBoot-core/io/gzio.c (test_header): Don't test end magic if file isn't easily seekable. - (grub_gzio_open): Set not_easly_seekable. - * grub-core/fs/i386/pc/pxe.c (grub_pxefs_open): Set not_easily_seekable. - * grub-core/io/bufio.c (grub_bufio_open): Propagate not_easily_seekable. + (VasEBoot_gzio_open): Set not_easly_seekable. + * VasEBoot-core/fs/i386/pc/pxe.c (VasEBoot_pxefs_open): Set not_easily_seekable. + * VasEBoot-core/io/bufio.c (VasEBoot_bufio_open): Propagate not_easily_seekable. 2010-09-04 BVK Chaitanya Support for options to appear multiple times on cmdline. - * include/grub/lib/arg.h (grub_arg_list_alloc): New prototype. - * grub-core/commands/extcmd.c: Support for repeatable option. - * grub-core/lib/arg.c (grub_arg_list_alloc): New function for + * include/VasEBoot/lib/arg.h (VasEBoot_arg_list_alloc): New prototype. + * VasEBoot-core/commands/extcmd.c: Support for repeatable option. + * VasEBoot-core/lib/arg.c (VasEBoot_arg_list_alloc): New function for repeatable option support. Refactor menuentry into a regular command. - * grub-core/commands/menuentry.c: New file, menuentry command + * VasEBoot-core/commands/menuentry.c: New file, menuentry command implementation. - * grub-core/Makefile.core.def: Rule update for normal.mod. - * grub-core/normal/main.c: Moved menuentry creation to - grub-core/commands/menuentry.c. - * grub-core/normal/menu.c (grub_menu_execute_entry): Removed. - (grub_menu_execute_entry_real): Removed. - * grub-core/script/execute.c (grub_script_execute_sourcecode): New + * VasEBoot-core/Makefile.core.def: Rule update for normal.mod. + * VasEBoot-core/normal/main.c: Moved menuentry creation to + VasEBoot-core/commands/menuentry.c. + * VasEBoot-core/normal/menu.c (VasEBoot_menu_execute_entry): Removed. + (VasEBoot_menu_execute_entry_real): Removed. + * VasEBoot-core/script/execute.c (VasEBoot_script_execute_sourcecode): New function. - (grub_script_execute_menuentry): Removed. - * grub-core/script/parser.y (menuentry): Removed. - * grub-core/script/script.c (grub_script_create_cmdmenu): Removed. - * grub-core/script/yylex.l (menuentry): Removed. - * include/grub/menu.h (grub_menu_init): New prototype. - (grub_menu_fini): New prototype. - * include/grub/normal.h (grub_normal_add_menu_entry): Removed. - * include/grub/script_sh.h (grub_script_cmd_menuentry): Removed. - (grub_script_execute_sourcecode): New prototype. + (VasEBoot_script_execute_menuentry): Removed. + * VasEBoot-core/script/parser.y (menuentry): Removed. + * VasEBoot-core/script/script.c (VasEBoot_script_create_cmdmenu): Removed. + * VasEBoot-core/script/yylex.l (menuentry): Removed. + * include/VasEBoot/menu.h (VasEBoot_menu_init): New prototype. + (VasEBoot_menu_fini): New prototype. + * include/VasEBoot/normal.h (VasEBoot_normal_add_menu_entry): Removed. + * include/VasEBoot/script_sh.h (VasEBoot_script_cmd_menuentry): Removed. + (VasEBoot_script_execute_sourcecode): New prototype. 2010-09-04 BVK Chaitanya - "return" command for GRUB script functions. + "return" command for VasEBoot script functions. - * tests/grub_script_return.in: New test. + * tests/VasEBoot_script_return.in: New test. * Makefile.util.def: Rules for new test. - * grub-core/script/execute.c (grub_script_return): New function. - * grub-core/script/main.c: Register/unregister return commaond. - * include/grub/script_sh.h (grub_script_return): New prototype. + * VasEBoot-core/script/execute.c (VasEBoot_script_return): New function. + * VasEBoot-core/script/main.c: Register/unregister return commaond. + * include/VasEBoot/script_sh.h (VasEBoot_script_return): New prototype. 2010-09-04 BVK Chaitanya "setparams" command to update positional parameters. - * tests/grub_script_setparams.in: New test. + * tests/VasEBoot_script_setparams.in: New test. * Makefile.util.def: Rules for new test. - * grub-core/script/argv.c (grub_script_argv_make): New function. - * grub-core/script/execute.c (replace_scope): New function. - (grub_script_setparams): New function. - * grub-core/script/lexer.c: Remove unused variables. - * grub-core/script/main.c: Register/unregister setparams command. - * include/grub/script_sh.h (grub_script_argv_make): New prototype. - (grub_script_setparams): New prototype. + * VasEBoot-core/script/argv.c (VasEBoot_script_argv_make): New function. + * VasEBoot-core/script/execute.c (replace_scope): New function. + (VasEBoot_script_setparams): New function. + * VasEBoot-core/script/lexer.c: Remove unused variables. + * VasEBoot-core/script/main.c: Register/unregister setparams command. + * include/VasEBoot/script_sh.h (VasEBoot_script_argv_make): New prototype. + (VasEBoot_script_setparams): New prototype. 2010-09-04 BVK Chaitanya - * grub-core/normal/completion.c (grub_normal_do_completion): Fix - grub_free order. + * VasEBoot-core/normal/completion.c (VasEBoot_normal_do_completion): Fix + VasEBoot_free order. 2010-09-04 BVK Chaitanya Support for passing block of commands as an argument to extcmds. * Makefile.util.def: Rules for new test. - * tests/grub_script_blockarg.in: New test. - * grub-core/tests/test_blockarg.c: New file, block argument + * tests/VasEBoot_script_blockarg.in: New test. + * VasEBoot-core/tests/test_blockarg.c: New file, block argument command used in the test. - * include/grub/extcmd.h (grub_extcmd_context): New struct. - (grub_register_extcmd_prio): New function prototype. - (grub_extcmd_dispatcher): New function prototype. - * include/grub/command.h (GRUB_COMMAND_FLAG_BLOCKS): New command + * include/VasEBoot/extcmd.h (VasEBoot_extcmd_context): New struct. + (VasEBoot_register_extcmd_prio): New function prototype. + (VasEBoot_extcmd_dispatcher): New function prototype. + * include/VasEBoot/command.h (VasEBoot_COMMAND_FLAG_BLOCKS): New command type. - * include/grub/script_sh.h (struct grub_script): New members + * include/VasEBoot/script_sh.h (struct VasEBoot_script): New members `children', `next_siblings' and `refcnt' for block arguments and reference counting. - (GRUB_SCRIPT_ARG_TYPE_BLOCK): New argument type. - (grub_script_arg): New member `script' for block argument. - (grub_script_argv): New member `script' for block argument. - (grub_parser_param): New member `scripts' for block argument. - (grub_script_mem_free): New extern function prototype. - (grub_script_ref): New function prototype. - (grub_script_unref): New function prototype. + (VasEBoot_SCRIPT_ARG_TYPE_BLOCK): New argument type. + (VasEBoot_script_arg): New member `script' for block argument. + (VasEBoot_script_argv): New member `script' for block argument. + (VasEBoot_parser_param): New member `scripts' for block argument. + (VasEBoot_script_mem_free): New extern function prototype. + (VasEBoot_script_ref): New function prototype. + (VasEBoot_script_unref): New function prototype. - * grub-core/normal/dyncmd.c (grub_dyncmd_dispatcher): Moved to + * VasEBoot-core/normal/dyncmd.c (VasEBoot_dyncmd_dispatcher): Moved to extcmd form to support block arguments. - * grub-core/script/argv.c: Block arguments support. - * grub-core/script/execute.c: Likewise. - * grub-core/script/lexer.c: Likewise. - * grub-core/script/main.c: Likewise. - * grub-core/script/script.c: Likewise. - * grub-core/script/parser.y: Likewise. New `block' and `block0' + * VasEBoot-core/script/argv.c: Block arguments support. + * VasEBoot-core/script/execute.c: Likewise. + * VasEBoot-core/script/lexer.c: Likewise. + * VasEBoot-core/script/main.c: Likewise. + * VasEBoot-core/script/script.c: Likewise. + * VasEBoot-core/script/parser.y: Likewise. New `block' and `block0' non-terminals. - * grub-core/commands/acpi.c: Update extcmd implementations with - grub_extcmd_context_t. - * grub-core/commands/cat.c: Likewise. - * grub-core/commands/echo.c: Likewise. - * grub-core/commands/extcmd.c: Likewise. - * grub-core/commands/hashsum.c: Likewise. - * grub-core/commands/hdparm.c: Likewise. - * grub-core/commands/help.c: Likewise. - * grub-core/commands/hexdump.c: Likewise. - * grub-core/commands/i386/cpuid.c: Likewise. - * grub-core/commands/i386/pc/drivemap.c: Likewise. - * grub-core/commands/i386/pc/halt.c: Likewise. - * grub-core/commands/i386/pc/sendkey.c: Likewise. - * grub-core/commands/iorw.c: Likewise. - * grub-core/commands/keystatus.c: Likewise. - * grub-core/commands/loadenv.c: Likewise. - * grub-core/commands/ls.c: Likewise. - * grub-core/commands/lspci.c: Likewise. - * grub-core/commands/memrw.c: Likewise. - * grub-core/commands/probe.c: Likewise. - * grub-core/commands/search_wrap.c: Likewise. - * grub-core/commands/setpci.c: Likewise. - * grub-core/commands/sleep.c: Likewise. - * grub-core/disk/loopback.c: Likewise. - * grub-core/hello/hello.c: Likewise. - * grub-core/loader/i386/bsd.c: Likewise. - * grub-core/loader/xnu.c: Likewise. - * grub-core/term/gfxterm.c: Likewise. - * grub-core/term/serial.c: Likewise. - * grub-core/tests/lib/functional_test.c: Likewise. + * VasEBoot-core/commands/acpi.c: Update extcmd implementations with + VasEBoot_extcmd_context_t. + * VasEBoot-core/commands/cat.c: Likewise. + * VasEBoot-core/commands/echo.c: Likewise. + * VasEBoot-core/commands/extcmd.c: Likewise. + * VasEBoot-core/commands/hashsum.c: Likewise. + * VasEBoot-core/commands/hdparm.c: Likewise. + * VasEBoot-core/commands/help.c: Likewise. + * VasEBoot-core/commands/hexdump.c: Likewise. + * VasEBoot-core/commands/i386/cpuid.c: Likewise. + * VasEBoot-core/commands/i386/pc/drivemap.c: Likewise. + * VasEBoot-core/commands/i386/pc/halt.c: Likewise. + * VasEBoot-core/commands/i386/pc/sendkey.c: Likewise. + * VasEBoot-core/commands/iorw.c: Likewise. + * VasEBoot-core/commands/keystatus.c: Likewise. + * VasEBoot-core/commands/loadenv.c: Likewise. + * VasEBoot-core/commands/ls.c: Likewise. + * VasEBoot-core/commands/lspci.c: Likewise. + * VasEBoot-core/commands/memrw.c: Likewise. + * VasEBoot-core/commands/probe.c: Likewise. + * VasEBoot-core/commands/search_wrap.c: Likewise. + * VasEBoot-core/commands/setpci.c: Likewise. + * VasEBoot-core/commands/sleep.c: Likewise. + * VasEBoot-core/disk/loopback.c: Likewise. + * VasEBoot-core/hello/hello.c: Likewise. + * VasEBoot-core/loader/i386/bsd.c: Likewise. + * VasEBoot-core/loader/xnu.c: Likewise. + * VasEBoot-core/term/gfxterm.c: Likewise. + * VasEBoot-core/term/serial.c: Likewise. + * VasEBoot-core/tests/lib/functional_test.c: Likewise. 2010-09-04 BVK Chaitanya Multi-line quoted strings support. - * grub-core/script/lexer.c (append_newline): Removed. - (grub_script_lexer_yywrap): Refactored. - (grub_script_lexer_init): Refactored. - * grub-core/script/yylex.l (yywrap): New function. - (grub_lexer_resplit): New function. - (grub_lexer_unput): New function. - * include/grub/script_sh.h (grub_lexer_param): New members, unput + * VasEBoot-core/script/lexer.c (append_newline): Removed. + (VasEBoot_script_lexer_yywrap): Refactored. + (VasEBoot_script_lexer_init): Refactored. + * VasEBoot-core/script/yylex.l (yywrap): New function. + (VasEBoot_lexer_resplit): New function. + (VasEBoot_lexer_unput): New function. + * include/VasEBoot/script_sh.h (VasEBoot_lexer_param): New members, unput and resplit. - * tests/grub_script_echo1.in: Added few more testcases. + * tests/VasEBoot_script_echo1.in: Added few more testcases. 2010-09-04 Vladimir Serbinenko - * grub-core/kern/misc.c: Don't add abort alias in utils. + * VasEBoot-core/kern/misc.c: Don't add abort alias in utils. Reported by: echoline. 2010-09-03 BVK Chaitanya @@ -24822,32 +24822,32 @@ * gentpl.py (script): Use dist_noinst_DATA instead of EXTRA_DIST. * conf/Makefile.common (dist_noinst_DATA): New variable. * conf/Makefile.extra-dist: Added missing make dist files. - * grub-core/Makefile.core.def: Likewise. + * VasEBoot-core/Makefile.core.def: Likewise. 2010-09-03 Vladimir Serbinenko - Compress grub_prefix. + Compress VasEBoot_prefix. - * grub-core/boot/i386/pc/lnxboot.S: Use - GRUB_KERNEL_I386_PC_MULTIBOOT_SIGNATURE. - * grub-core/kern/i386/pc/startup.S: Move grub_prefix to compressed part. - * include/grub/offsets.h: Rename GRUB_MACHINE_DATA_END to - GRUB_MACHINE_PREFIX_END. All users updated. - (GRUB_KERNEL_I386_PC_PREFIX): Set to GRUB_KERNEL_I386_PC_RAW_SIZE. - (GRUB_KERNEL_I386_PC_PREFIX_END): Set to GRUB_KERNEL_I386_PC_PREFIX + * VasEBoot-core/boot/i386/pc/lnxboot.S: Use + VasEBoot_KERNEL_I386_PC_MULTIBOOT_SIGNATURE. + * VasEBoot-core/kern/i386/pc/startup.S: Move VasEBoot_prefix to compressed part. + * include/VasEBoot/offsets.h: Rename VasEBoot_MACHINE_DATA_END to + VasEBoot_MACHINE_PREFIX_END. All users updated. + (VasEBoot_KERNEL_I386_PC_PREFIX): Set to VasEBoot_KERNEL_I386_PC_RAW_SIZE. + (VasEBoot_KERNEL_I386_PC_PREFIX_END): Set to VasEBoot_KERNEL_I386_PC_PREFIX + 0x40. - (GRUB_KERNEL_I386_PC_RAW_SIZE): Decrease. - * util/grub-mkimage.c (image_target_desc): Change data_end to + (VasEBoot_KERNEL_I386_PC_RAW_SIZE): Decrease. + * util/VasEBoot-mkimage.c (image_target_desc): Change data_end to prefix_end. All users updated. 2010-09-03 Vladimir Serbinenko - * grub-core/loader/i386/bsd.c (grub_freebsd_boot): Set %ebp to sane + * VasEBoot-core/loader/i386/bsd.c (VasEBoot_freebsd_boot): Set %ebp to sane value. - (grub_openbsd_boot): Likewise. - (grub_netbsd_boot): Likewise. - * grub-core/loader/i386/xnu.c (grub_xnu_boot_resume): Likewise. - (grub_xnu_boot): Likewise. + (VasEBoot_openbsd_boot): Likewise. + (VasEBoot_netbsd_boot): Likewise. + * VasEBoot-core/loader/i386/xnu.c (VasEBoot_xnu_boot_resume): Likewise. + (VasEBoot_xnu_boot): Likewise. 2010-09-02 Vladimir Serbinenko @@ -24864,51 +24864,51 @@ 2010-09-02 Ian Turner - * grub-core/fs/i386/pc/pxe.c (grub_pxefs_read): Keep the blocksize + * VasEBoot-core/fs/i386/pc/pxe.c (VasEBoot_pxefs_read): Keep the blocksize constant for the same file. 2010-09-02 Vladimir Serbinenko - * grub-core/kern/i386/multiboot_mmap.c: Remove leftover include. + * VasEBoot-core/kern/i386/multiboot_mmap.c: Remove leftover include. 2010-09-02 Colin Watson - * .bzrignore: Add *.pp, **/.dirstamp, grub-core/*.module, and - grub-core/*.pp. + * .bzrignore: Add *.pp, **/.dirstamp, VasEBoot-core/*.module, and + VasEBoot-core/*.pp. 2010-09-02 Colin Watson Zero %ebp and %edi when entering Linux's 32-bit entry point, as required by the boot protocol. - * include/grub/i386/relocator.h (struct grub_relocator32_state): Add + * include/VasEBoot/i386/relocator.h (struct VasEBoot_relocator32_state): Add ebp and edi members. - * grub-core/lib/i386/relocator.c (grub_relocator_boot): Handle + * VasEBoot-core/lib/i386/relocator.c (VasEBoot_relocator_boot): Handle state.ebp and state.edi. - * grub-core/lib/i386/relocator32.S (grub_relocator32_start): Set - %ebp and %edi according to grub_relocator32_ebp and - grub_relocator32_edi respectively. - * grub-core/loader/i386/linux.c (grub_linux_boot): Zero state.ebp + * VasEBoot-core/lib/i386/relocator32.S (VasEBoot_relocator32_start): Set + %ebp and %edi according to VasEBoot_relocator32_ebp and + VasEBoot_relocator32_edi respectively. + * VasEBoot-core/loader/i386/linux.c (VasEBoot_linux_boot): Zero state.ebp and state.edi. 2010-09-02 Vladimir Serbinenko Add i386-pc-pxe image target. - * util/grub-mkimage.c (image_target_desc): New enum value + * util/VasEBoot-mkimage.c (image_target_desc): New enum value IMAGE_I386_PC_PXE. (image_targets): New target i386-pc-pxe. (generate_image): Handle i386-pc-pxe image. 2010-09-02 Vladimir Serbinenko - Fix grub_pxe_scan. + Fix VasEBoot_pxe_scan. - * grub-core/fs/i386/pc/pxe.c (grub_pxe_pxenv): Put correct type bangpxe. - (grub_pxe_scan): Fix types and pxe_rm_entry computation. + * VasEBoot-core/fs/i386/pc/pxe.c (VasEBoot_pxe_pxenv): Put correct type bangpxe. + (VasEBoot_pxe_scan): Fix types and pxe_rm_entry computation. All users updated. - * include/grub/i386/pc/pxe.h (grub_pxe_bangpxe): New struct. - (grub_pxe_pxenv): Correct type. + * include/VasEBoot/i386/pc/pxe.h (VasEBoot_pxe_bangpxe): New struct. + (VasEBoot_pxe_pxenv): Correct type. 2010-09-01 Colin Watson @@ -24916,25 +24916,25 @@ 2010-09-01 Colin Watson - * util/grub-mkrescue.in (usage): Tidy up usage output (and hence + * util/VasEBoot-mkrescue.in (usage): Tidy up usage output (and hence generated manual page) a little. 2010-09-01 Colin Watson - * docs/grub.texi: Add myself as an author. + * docs/VasEBoot.texi: Add myself as an author. 2010-09-01 Vladimir Serbinenko - * Makefile.util.def (libgrub.a): Add missing sunpc. + * Makefile.util.def (libVasEBoot.a): Add missing sunpc. Reported by: Seth Goldberg. 2010-08-30 Vladimir Serbinenko Interrupt wrapping and code simplifications. - * Makefile.util.def (grub-mkrescue): Use x86 tg instead of + * Makefile.util.def (VasEBoot-mkrescue): Use x86 tg instead of x86_noieee1275 which are functionaly equivalent in this case. - (grub-install): Make source on each platform explicit. Enable on + (VasEBoot-install): Make source on each platform explicit. Enable on all noemu. * gentpl.py (x86_efi_pc): Removed group. (x86_noefi): Likewise. @@ -24953,18 +24953,18 @@ (usb): Likewise. (videoinkernel): Likewise. (videomodules): Likewise. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Remove - include/grub/elf.h, include/grub/elfload.h, include/grub/net.h, - include/grub/reader.h, include/grub/symbol.h, include/grub/types.h, - include/grub/loader.h, include/grub/msdos_partition.h, - include/grub/machine/biosdisk.h, include/grub/machine/boot.h, - include/grub/machine/console.h, include/grub/machine/vga.h, - include/grub/machine/vbe.h, include/grub/machine/init.h, - include/grub/machine/kernel.h, include/grub/cpu/time.h, - include/grub/cpu/types.h, include/grub/gzio.h and include/grub/menu.h - (KERNEL_HEADER_FILES) [i386-pc]: Add include/grub/machine/int.h. - (KERNEL_HEADER_FILES) [i386-ieee1275]: Add include/grub/i386/pit.h - * grub-core/Makefile.core.def (kernel): Explicit the source for + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Remove + include/VasEBoot/elf.h, include/VasEBoot/elfload.h, include/VasEBoot/net.h, + include/VasEBoot/reader.h, include/VasEBoot/symbol.h, include/VasEBoot/types.h, + include/VasEBoot/loader.h, include/VasEBoot/msdos_partition.h, + include/VasEBoot/machine/biosdisk.h, include/VasEBoot/machine/boot.h, + include/VasEBoot/machine/console.h, include/VasEBoot/machine/vga.h, + include/VasEBoot/machine/vbe.h, include/VasEBoot/machine/init.h, + include/VasEBoot/machine/kernel.h, include/VasEBoot/cpu/time.h, + include/VasEBoot/cpu/types.h, include/VasEBoot/gzio.h and include/VasEBoot/menu.h + (KERNEL_HEADER_FILES) [i386-pc]: Add include/VasEBoot/machine/int.h. + (KERNEL_HEADER_FILES) [i386-ieee1275]: Add include/VasEBoot/i386/pit.h + * VasEBoot-core/Makefile.core.def (kernel): Explicit the source for startup. Explicit the platforms using kern/generic/rtc_get_time_ms.c. Split ieee1275_mips. Remove kern/i386/halt.c. Remove kern/i386/misc.S. Enable kern/i386/pit.c on all x86. Remove kern/i386/ieee1275/init.c. @@ -24994,178 +24994,178 @@ (bitmap_scale): Likewise. (video_fb): Likewise. (video): Likewise. - * grub-core/bus/usb/ohci.c (grub_ohci_td): Make link_td a pointer and + * VasEBoot-core/bus/usb/ohci.c (VasEBoot_ohci_td): Make link_td a pointer and adjust padding accordingly. All users updated. - (grub_ohci_transaction): Fix bad format specification. - (GRUB_MOD_INIT): Add asserts for struct size. - * grub-core/bus/usb/uhci.c (grub_uhci_pci_iter): Add explicit casts. - (grub_alloc_td): Likewise. - (grub_free_queue): Likewise. - (grub_uhci_transfer): Likewise. - (grub_uhci_transaction): Fix bad format specification. - * grub-core/bus/usb/usbtrans.c (grub_usb_control_msg): Likewise. - (grub_usb_bulk_readwrite): Likewise. - * grub-core/kern/i386/misc.S (grub_stop): Moved from here ... - * grub-core/commands/i386/pc/halt.c (stop): ...here. Transformed into C. + (VasEBoot_ohci_transaction): Fix bad format specification. + (VasEBoot_MOD_INIT): Add asserts for struct size. + * VasEBoot-core/bus/usb/uhci.c (VasEBoot_uhci_pci_iter): Add explicit casts. + (VasEBoot_alloc_td): Likewise. + (VasEBoot_free_queue): Likewise. + (VasEBoot_uhci_transfer): Likewise. + (VasEBoot_uhci_transaction): Fix bad format specification. + * VasEBoot-core/bus/usb/usbtrans.c (VasEBoot_usb_control_msg): Likewise. + (VasEBoot_usb_bulk_readwrite): Likewise. + * VasEBoot-core/kern/i386/misc.S (VasEBoot_stop): Moved from here ... + * VasEBoot-core/commands/i386/pc/halt.c (stop): ...here. Transformed into C. Made static. - * grub-core/lib/i386/halt.c (stop): ... and here. Transformed into C. + * VasEBoot-core/lib/i386/halt.c (stop): ... and here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_halt): Moved from here ... - * grub-core/commands/i386/pc/halt.c (grub_halt): ...here. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_halt): Moved from here ... + * VasEBoot-core/commands/i386/pc/halt.c (VasEBoot_halt): ...here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_biosdisk_rw_int13_extensions): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_biosdisk_rw_int13_extensions): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw_int13_extensions): + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_rw_int13_extensions): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_biosdisk_rw_standard): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_biosdisk_rw_standard): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw_standard): + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_rw_standard): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S - (grub_biosdisk_check_int13_extensions): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c - (grub_biosdisk_check_int13_extensions): ... here. Transformed into C. + * VasEBoot-core/kern/i386/pc/startup.S + (VasEBoot_biosdisk_check_int13_extensions): Moved from here ... + * VasEBoot-core/disk/i386/pc/biosdisk.c + (VasEBoot_biosdisk_check_int13_extensions): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S - (grub_biosdisk_get_cdinfo_int13_extensions): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c - (grub_biosdisk_get_cdinfo_int13_extensions): ... here. + * VasEBoot-core/kern/i386/pc/startup.S + (VasEBoot_biosdisk_get_cdinfo_int13_extensions): Moved from here ... + * VasEBoot-core/disk/i386/pc/biosdisk.c + (VasEBoot_biosdisk_get_cdinfo_int13_extensions): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S - (grub_biosdisk_get_diskinfo_int13_extensions): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c - (grub_biosdisk_get_diskinfo_int13_extensions): ... here. + * VasEBoot-core/kern/i386/pc/startup.S + (VasEBoot_biosdisk_get_diskinfo_int13_extensions): Moved from here ... + * VasEBoot-core/disk/i386/pc/biosdisk.c + (VasEBoot_biosdisk_get_diskinfo_int13_extensions): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S - (grub_biosdisk_get_diskinfo_standard): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c - (grub_biosdisk_get_diskinfo_standard): ... here. + * VasEBoot-core/kern/i386/pc/startup.S + (VasEBoot_biosdisk_get_diskinfo_standard): Moved from here ... + * VasEBoot-core/disk/i386/pc/biosdisk.c + (VasEBoot_biosdisk_get_diskinfo_standard): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S - (grub_biosdisk_get_num_floppies): Moved from here ... - * grub-core/disk/i386/pc/biosdisk.c - (grub_biosdisk_get_num_floppies): ... here. + * VasEBoot-core/kern/i386/pc/startup.S + (VasEBoot_biosdisk_get_num_floppies): Moved from here ... + * VasEBoot-core/disk/i386/pc/biosdisk.c + (VasEBoot_biosdisk_get_num_floppies): ... here. Transformed into C. Made static. - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_get_diskinfo_real): + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_get_diskinfo_real): New function. - * grub-core/kern/i386/pc/startup.S (grub_pxe_scan): Moved from here ... - * grub-core/fs/i386/pc/pxe.c (grub_pxe_scan): ... here. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_pxe_scan): Moved from here ... + * VasEBoot-core/fs/i386/pc/pxe.c (VasEBoot_pxe_scan): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_rm_entry): Moved from here ... - * grub-core/fs/i386/pc/pxe.c (grub_rm_entry): ... here. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_rm_entry): Moved from here ... + * VasEBoot-core/fs/i386/pc/pxe.c (VasEBoot_rm_entry): ... here. Transformed into C. Made static. - * grub-core/kern/i386/ieee1275/init.c: Removed. - * grub-core/kern/i386/misc.S: Likewise. - * grub-core/kern/i386/pc/startup.S (grub_get_memsize): + * VasEBoot-core/kern/i386/ieee1275/init.c: Removed. + * VasEBoot-core/kern/i386/misc.S: Likewise. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_get_memsize): Splitted from here ... - * grub-core/kern/i386/pc/init.c (grub_get_conv_memsize): ... here. + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_get_conv_memsize): ... here. Transformed into C. Made static. All users updated. - * grub-core/kern/i386/pc/mmap.c (grub_get_ext_memsize): ... and here. + * VasEBoot-core/kern/i386/pc/mmap.c (VasEBoot_get_ext_memsize): ... and here. Transformed into C. Made static. All users updated. - * grub-core/kern/i386/pc/startup.S (grub_get_eisa_mmap): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_get_eisa_mmap): Moved from here... - * grub-core/kern/i386/pc/mmap.c (grub_get_eisa_mmap): ... here. + * VasEBoot-core/kern/i386/pc/mmap.c (VasEBoot_get_eisa_mmap): ... here. Transformed into C. Made static. All users updated. - * grub-core/kern/i386/pc/startup.S (grub_get_mmap_entry): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_get_mmap_entry): Moved from here... - * grub-core/kern/i386/pc/mmap.c (grub_get_mmap_entry): ... here. + * VasEBoot-core/kern/i386/pc/mmap.c (VasEBoot_get_mmap_entry): ... here. Transformed into C. Made static. All users updated. - * grub-core/kern/i386/pc/startup.S (grub_stop_floppy): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_stop_floppy): Removed (replaced by C version). - * grub-core/kern/i386/pc/startup.S (grub_vga_set_mode): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vga_set_mode): Moved from here... - * grub-core/video/i386/pc/vga.c (grub_vga_set_mode): ...here. + * VasEBoot-core/video/i386/pc/vga.c (VasEBoot_vga_set_mode): ...here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_get_controller_info): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_get_controller_info): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_controller_info): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_controller_info): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_get_mode_info): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_get_mode_info): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_mode_info): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_mode_info): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_set_mode): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_set_mode): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_set_mode): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_set_mode): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_get_mode): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_get_mode): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_mode): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_mode): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S - (grub_vbe_bios_getset_dac_palette_width):Moved from here... - * grub-core/video/i386/pc/vbe.c - (grub_vbe_bios_getset_dac_palette_width):... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_set_memory_window): + * VasEBoot-core/kern/i386/pc/startup.S + (VasEBoot_vbe_bios_getset_dac_palette_width):Moved from here... + * VasEBoot-core/video/i386/pc/vbe.c + (VasEBoot_vbe_bios_getset_dac_palette_width):... here. Transformed into C. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_set_memory_window): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_set_memory_window): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_set_memory_window): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_get_memory_window): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_get_memory_window): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_memory_window): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_memory_window): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_set_scanline_length): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_set_scanline_length): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_set_scanline_length): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_set_scanline_length): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_get_scanline_length): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_get_scanline_length): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_scanline_length): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_scanline_length): ... here. Transformed into C. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_set_display_start): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_set_display_start): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_set_display_start): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_set_display_start): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_get_display_start): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_get_display_start): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_display_start): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_get_display_start): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_vbe_bios_set_palette_data): + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_vbe_bios_set_palette_data): Moved from here... - * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_set_palette_data): + * VasEBoot-core/video/i386/pc/vbe.c (VasEBoot_vbe_bios_set_palette_data): ... here. Transformed into C. Made static. - * grub-core/kern/i386/pc/startup.S (grub_pxe_call): Receive + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_pxe_call): Receive pxe_rm_entry as third argument. - (grub_bios_interrupt): New function. - * grub-core/kern/i386/qemu/mmap.c: Remove useless include. - * grub-core/kern/i386/qemu/startup.S (codestart): Do cli;hlt instead - of calling grub_stop. - * grub-core/kern/efi/efi.c (grub_halt): Moved from here ... - * grub-core/lib/efi/halt.c (grub_halt): ...here. - * grub-core/kern/emu/main.c (grub_halt): Moved from here ... - * grub-core/lib/emu/halt.c (grub_halt): ... here. - * grub-core/lib/i386/halt.c: Moved from here ... - * grub-core/lib/i386/halt.c: ... here. - * grub-core/kern/ieee1275/openfw.c (grub_halt): Moved from here ... - * grub-core/lib/ieee1275/halt.c (grub_halt): ... here. - * grub-core/loader/i386/pc/linux.c (grub_linux16_boot): Call - grub_stop_floppy. - * grub-core/loader/i386/xnu.c (guessfsb) [IEEE1275]: Enable. - * include/grub/i386/coreboot/init.h: Removed. - * include/grub/i386/multiboot/init.h: Likewise. - * include/grub/i386/pc/biosdisk.h: Removed all function prototypes. - * include/grub/i386/pc/init.h: Likewise except grub_gate_a20. - * include/grub/i386/pc/int.h: New file. - * include/grub/i386/pc/pxe.h (GRUB_PXE_SIGNATURE): New definition. - (grub_pxe_scan): Removed. - (grub_pxe_call): Update prototype. - * include/grub/i386/pc/vbe.h: Removed EXPORT_FUNC and useless + (VasEBoot_bios_interrupt): New function. + * VasEBoot-core/kern/i386/qemu/mmap.c: Remove useless include. + * VasEBoot-core/kern/i386/qemu/startup.S (codestart): Do cli;hlt instead + of calling VasEBoot_stop. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_halt): Moved from here ... + * VasEBoot-core/lib/efi/halt.c (VasEBoot_halt): ...here. + * VasEBoot-core/kern/emu/main.c (VasEBoot_halt): Moved from here ... + * VasEBoot-core/lib/emu/halt.c (VasEBoot_halt): ... here. + * VasEBoot-core/lib/i386/halt.c: Moved from here ... + * VasEBoot-core/lib/i386/halt.c: ... here. + * VasEBoot-core/kern/ieee1275/openfw.c (VasEBoot_halt): Moved from here ... + * VasEBoot-core/lib/ieee1275/halt.c (VasEBoot_halt): ... here. + * VasEBoot-core/loader/i386/pc/linux.c (VasEBoot_linux16_boot): Call + VasEBoot_stop_floppy. + * VasEBoot-core/loader/i386/xnu.c (guessfsb) [IEEE1275]: Enable. + * include/VasEBoot/i386/coreboot/init.h: Removed. + * include/VasEBoot/i386/multiboot/init.h: Likewise. + * include/VasEBoot/i386/pc/biosdisk.h: Removed all function prototypes. + * include/VasEBoot/i386/pc/init.h: Likewise except VasEBoot_gate_a20. + * include/VasEBoot/i386/pc/int.h: New file. + * include/VasEBoot/i386/pc/pxe.h (VasEBoot_PXE_SIGNATURE): New definition. + (VasEBoot_pxe_scan): Removed. + (VasEBoot_pxe_call): Update prototype. + * include/VasEBoot/i386/pc/vbe.h: Removed EXPORT_FUNC and useless prototypes. - * include/grub/i386/pc/vga.h (grub_vga_set_mode): Removed. - * include/grub/i386/qemu/init.h: Removed. - * include/grub/mips/yeeloong/kernel.h (grub_reboot): Add missing + * include/VasEBoot/i386/pc/vga.h (VasEBoot_vga_set_mode): Removed. + * include/VasEBoot/i386/qemu/init.h: Removed. + * include/VasEBoot/mips/yeeloong/kernel.h (VasEBoot_reboot): Add missing noreturn. - (grub_halt): Likewise. - * include/grub/misc.h (grub_halt): Removed EXPORT_FUNC. - (grub_reboot): Likewise. - * grub-core/kern/i386/coreboot/init.c (grub_stop_floppy): Moved from here... - * include/grub/i386/floppy.h (grub_stop_floppy): ...here. Inlined. - * grub-core/kern/i386/pc/startup.S (grub_hard_stop): Removed. + (VasEBoot_halt): Likewise. + * include/VasEBoot/misc.h (VasEBoot_halt): Removed EXPORT_FUNC. + (VasEBoot_reboot): Likewise. + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_stop_floppy): Moved from here... + * include/VasEBoot/i386/floppy.h (VasEBoot_stop_floppy): ...here. Inlined. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_hard_stop): Removed. 2010-08-30 Robert Millan - * NEWS: Document addition of ZFS support in `grub-install' and - `grub-mkconfig'. + * NEWS: Document addition of ZFS support in `VasEBoot-install' and + `VasEBoot-mkconfig'. 2010-08-30 BVK Chaitanya @@ -25176,43 +25176,43 @@ Remove leftover embedding of font objects. - * include/grub/kernel.h (OBJ_TYPE_FONT): Removed. - * util/grub-install.in (font): Removed. - * util/grub-mkimage.c (generate_image): Remove font support. All users + * include/VasEBoot/kernel.h (OBJ_TYPE_FONT): Removed. + * util/VasEBoot-install.in (font): Removed. + * util/VasEBoot-mkimage.c (generate_image): Remove font support. All users updated. 2010-08-30 Vladimir Serbinenko Remove leftover embedding of font objects. - * include/grub/kernel.h (OBJ_TYPE_FONT): Removed. - * util/grub-install.in (font): Removed. - * util/grub-mkimage.c (generate_image): Remove font support. All users + * include/VasEBoot/kernel.h (OBJ_TYPE_FONT): Removed. + * util/VasEBoot-install.in (font): Removed. + * util/VasEBoot-mkimage.c (generate_image): Remove font support. All users updated. 2010-08-30 Vladimir Serbinenko - * docs/grub.texi (Network): Fix reference to pxe_blksize. + * docs/VasEBoot.texi (Network): Fix reference to pxe_blksize. Reported by: Ian Turner 2010-08-30 Vladimir Serbinenko - * grub-core/normal/menu.c (grub_wait_after_message): Add a 10 second + * VasEBoot-core/normal/menu.c (VasEBoot_wait_after_message): Add a 10 second timeout to avoid indefinite boot stalling. 2010-08-30 Vladimir Serbinenko - * grub-core/normal/color.c (grub_env_write_color_normal): Fix a warning. - (grub_env_write_color_highlight): Likewise. + * VasEBoot-core/normal/color.c (VasEBoot_env_write_color_normal): Fix a warning. + (VasEBoot_env_write_color_highlight): Likewise. 2010-08-30 Vladimir Serbinenko - * grub-core/normal/term.c (print_more): Return to normal and not + * VasEBoot-core/normal/term.c (print_more): Return to normal and not to standard state after printing "---MORE---". 2010-08-30 Vladimir Serbinenko - * grub-core/term/i386/vga_common.c (grub_console_setcolorstate): + * VasEBoot-core/term/i386/vga_common.c (VasEBoot_console_setcolorstate): Mask out the bit 0x80 since it has other meaning that specifiing color. 2010-08-29 Vladimir Serbinenko @@ -25273,21 +25273,21 @@ (SUCCESSFUL_BOOT_STRING): New variable. (BOOTCHECK_TIMEOUT): Likewise. (bootcheck): New target - * Makefile.util.def (grub-mkrescue): Enable on i386-multiboot. + * Makefile.util.def (VasEBoot-mkrescue): Enable on i386-multiboot. * configure.ac: Correct efiemu excuse. - * docs/grub.texi (Supported kernels): New chapter. - * grub-core/Makefile.am (KERNEL_HEADER_FILES): Add - include/grub/mm_private.h. Simplify inclusion of - include/grub/boot.h, include/grub/loader.h - and include/grub/msdos_partition.h + * docs/VasEBoot.texi (Supported kernels): New chapter. + * VasEBoot-core/Makefile.am (KERNEL_HEADER_FILES): Add + include/VasEBoot/mm_private.h. Simplify inclusion of + include/VasEBoot/boot.h, include/VasEBoot/loader.h + and include/VasEBoot/msdos_partition.h (KERNEL_HEADER_FILES) [i386_coreboot]: - Remove include/grub/machine/loader.h. Add include/grub/i386/pit.h. + Remove include/VasEBoot/machine/loader.h. Add include/VasEBoot/i386/pit.h. (KERNEL_HEADER_FILES) [i386_multiboot]: Likewise. (KERNEL_HEADER_FILES) [i386_qemu]: Likewise. (KERNEL_HEADER_FILES) [i386_ieee1275]: Remove - include/grub/machine/loader.h. + include/VasEBoot/machine/loader.h. (KERNEL_HEADER_FILES) [x86_64-efi]: Likewise. - * grub-core/Makefile.core.def (kernel): Remove kern/i386/loader.S from + * VasEBoot-core/Makefile.core.def (kernel): Remove kern/i386/loader.S from extra_dist. (pci.mod): Enable on i386-multiboot. (acpi.mod): Enable on i386-multiboot and i386-coreboot. @@ -25300,78 +25300,78 @@ (linux.mod): Use loader/i386/linux.c on all x86. (xnu.mod): Enable on all x86. (vga_text.mod): disable on EFI and QEMU. - * grub-core/efiemu/i386/coredetect.c: Remove useless include. - * grub-core/efiemu/i386/pc/cfgtables.c: Likewise. - * grub-core/efiemu/loadcore.c: Likewise. - * grub-core/efiemu/main.c: Likewise. - (grub_efiemu_exit_boot_services): Removed. - (grub_efiemu_finish_boot_services): Likewise. - * grub-core/efiemu/mm.c (grub_efiemu_finish_boot_services): New + * VasEBoot-core/efiemu/i386/coredetect.c: Remove useless include. + * VasEBoot-core/efiemu/i386/pc/cfgtables.c: Likewise. + * VasEBoot-core/efiemu/loadcore.c: Likewise. + * VasEBoot-core/efiemu/main.c: Likewise. + (VasEBoot_efiemu_exit_boot_services): Removed. + (VasEBoot_efiemu_finish_boot_services): Likewise. + * VasEBoot-core/efiemu/mm.c (VasEBoot_efiemu_finish_boot_services): New function. - * grub-core/efiemu/i386/nocfgtables.c: New file. - * grub-core/kern/dl.c (grub_dl_unload_all): Removed. - * grub-core/kern/efi/efi.c (grub_efi_exit_boot_services): Removed. - (grub_efi_finish_boot_services): Moved from here ... - * grub-core/kern/efi/mm.c (grub_efi_finish_boot_services): ...here. + * VasEBoot-core/efiemu/i386/nocfgtables.c: New file. + * VasEBoot-core/kern/dl.c (VasEBoot_dl_unload_all): Removed. + * VasEBoot-core/kern/efi/efi.c (VasEBoot_efi_exit_boot_services): Removed. + (VasEBoot_efi_finish_boot_services): Moved from here ... + * VasEBoot-core/kern/efi/mm.c (VasEBoot_efi_finish_boot_services): ...here. Fille finish memory map and related data. (finish_mmap_buf): New variable. - (grub_efi_uintn_t finish_mmap_size): Likewise. - (grub_efi_uintn_t finish_key): Likewise. - (grub_efi_uintn_t finish_desc_size): Likewise. - (grub_efi_uint32_t finish_desc_version): Likewise. - (grub_efi_is_finished): Likewise. - (grub_efi_get_memory_map): Use saved memory map if EFI is already + (VasEBoot_efi_uintn_t finish_mmap_size): Likewise. + (VasEBoot_efi_uintn_t finish_key): Likewise. + (VasEBoot_efi_uintn_t finish_desc_size): Likewise. + (VasEBoot_efi_uint32_t finish_desc_version): Likewise. + (VasEBoot_efi_is_finished): Likewise. + (VasEBoot_efi_get_memory_map): Use saved memory map if EFI is already finished. - * grub-core/kern/elf.c (grub_elf32_phdr_iterate): Make global. - (grub_elf64_phdr_iterate): Likewise. - * grub-core/kern/i386/coreboot/init.c (grub_os_area_addr): Removed. - (grub_os_area_size): Likewise. - (grub_machine_init): Don't reserve os area. - * grub-core/kern/i386/coreboot/startup.S: Don't include loader.S. - * grub-core/kern/i386/ieee1275/startup.S: Likewise. - * grub-core/kern/i386/loader.S: Removed. - * grub-core/kern/i386/pc/init.c (grub_os_area_addr): Removed. - (grub_os_area_size): Likewise. - (grub_machine_init): Don't reserve os area. - * grub-core/kern/i386/pc/startup.S (grub_chainloader_real_boot): - Don't call grub_dl_unload_all. + * VasEBoot-core/kern/elf.c (VasEBoot_elf32_phdr_iterate): Make global. + (VasEBoot_elf64_phdr_iterate): Likewise. + * VasEBoot-core/kern/i386/coreboot/init.c (VasEBoot_os_area_addr): Removed. + (VasEBoot_os_area_size): Likewise. + (VasEBoot_machine_init): Don't reserve os area. + * VasEBoot-core/kern/i386/coreboot/startup.S: Don't include loader.S. + * VasEBoot-core/kern/i386/ieee1275/startup.S: Likewise. + * VasEBoot-core/kern/i386/loader.S: Removed. + * VasEBoot-core/kern/i386/pc/init.c (VasEBoot_os_area_addr): Removed. + (VasEBoot_os_area_size): Likewise. + (VasEBoot_machine_init): Don't reserve os area. + * VasEBoot-core/kern/i386/pc/startup.S (VasEBoot_chainloader_real_boot): + Don't call VasEBoot_dl_unload_all. Don't include loader.S. - * grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_iterate): + * VasEBoot-core/kern/i386/qemu/mmap.c (VasEBoot_machine_mmap_iterate): Declare the memory after _end as available. - * grub-core/kern/mm.c (GRUB_MM_FREE_MAGIC): Moved from here... - * include/grub/mm_private.h (GRUB_MM_FREE_MAGIC): ... here. - (GRUB_MM_ALLOC_MAGIC): Moved from here... - * include/grub/mm_private.h (GRUB_MM_ALLOC_MAGIC): ... here. - * grub-core/kern/mm.c (grub_mm_header): Moved from here... - * include/grub/mm_private.h (grub_mm_header): ... here. - * grub-core/kern/mm.c (GRUB_MM_ALIGN): Moved from here... - * include/grub/mm_private.h (GRUB_MM_ALIGN): ... here. - * grub-core/kern/mm.c (grub_mm_region): Moved from here ... - (grub_mm_region): ..here. Removed addr. Added pre_size. + * VasEBoot-core/kern/mm.c (VasEBoot_MM_FREE_MAGIC): Moved from here... + * include/VasEBoot/mm_private.h (VasEBoot_MM_FREE_MAGIC): ... here. + (VasEBoot_MM_ALLOC_MAGIC): Moved from here... + * include/VasEBoot/mm_private.h (VasEBoot_MM_ALLOC_MAGIC): ... here. + * VasEBoot-core/kern/mm.c (VasEBoot_mm_header): Moved from here... + * include/VasEBoot/mm_private.h (VasEBoot_mm_header): ... here. + * VasEBoot-core/kern/mm.c (VasEBoot_MM_ALIGN): Moved from here... + * include/VasEBoot/mm_private.h (VasEBoot_MM_ALIGN): ... here. + * VasEBoot-core/kern/mm.c (VasEBoot_mm_region): Moved from here ... + (VasEBoot_mm_region): ..here. Removed addr. Added pre_size. All users updated. - * grub-core/kern/mm.c (base): Renamed to ... - (grub_mm_base): ... this. Made global. - (grub_real_malloc): Alloc from end of region. - (grub_memalign): Don't attempt to malloc if grub_mm_base is NULL. - * grub-core/kern/powerpc/cache.S (grub_arch_sync_caches): Move to ... - * grub-core/kern/powerpc/cache_flush.S: ... here. - * grub-core/lib/efi/relocator.c: New file. - * grub-core/lib/i386/relocator.c: Rewritten. - * grub-core/lib/i386/relocator16.S: New file. - * grub-core/lib/i386/relocator32.S: Likewise. - * grub-core/lib/i386/relocator64.S: Likewise. - * grub-core/lib/i386/relocator_asm.S: Rewritten. - * grub-core/lib/i386/relocator_common.S: New file. - * grub-core/lib/ieee1275/relocator.c: Likewise. - * grub-core/lib/mips/relocator.c: Rewritten. - * grub-core/lib/mips/relocator_asm.S: Renamed variables and minor + * VasEBoot-core/kern/mm.c (base): Renamed to ... + (VasEBoot_mm_base): ... this. Made global. + (VasEBoot_real_malloc): Alloc from end of region. + (VasEBoot_memalign): Don't attempt to malloc if VasEBoot_mm_base is NULL. + * VasEBoot-core/kern/powerpc/cache.S (VasEBoot_arch_sync_caches): Move to ... + * VasEBoot-core/kern/powerpc/cache_flush.S: ... here. + * VasEBoot-core/lib/efi/relocator.c: New file. + * VasEBoot-core/lib/i386/relocator.c: Rewritten. + * VasEBoot-core/lib/i386/relocator16.S: New file. + * VasEBoot-core/lib/i386/relocator32.S: Likewise. + * VasEBoot-core/lib/i386/relocator64.S: Likewise. + * VasEBoot-core/lib/i386/relocator_asm.S: Rewritten. + * VasEBoot-core/lib/i386/relocator_common.S: New file. + * VasEBoot-core/lib/ieee1275/relocator.c: Likewise. + * VasEBoot-core/lib/mips/relocator.c: Rewritten. + * VasEBoot-core/lib/mips/relocator_asm.S: Renamed variables and minor stylistic adjustments. - * grub-core/lib/powerpc/relocator.c: New file. - * grub-core/lib/powerpc/relocator_asm.S: Likewise. - * grub-core/lib/relocator.c: Rewritten. - * grub-core/lib/x86_64/relocator_asm.S: New file. - * grub-core/loader/aout.c (grub_aout_load): Make load_addr a void *. - * grub-core/loader/i386/bsd.c (NETBSD_DEFAULT_VIDEO_MODE): New const. + * VasEBoot-core/lib/powerpc/relocator.c: New file. + * VasEBoot-core/lib/powerpc/relocator_asm.S: Likewise. + * VasEBoot-core/lib/relocator.c: Rewritten. + * VasEBoot-core/lib/x86_64/relocator_asm.S: New file. + * VasEBoot-core/loader/aout.c (VasEBoot_aout_load): Make load_addr a void *. + * VasEBoot-core/loader/i386/bsd.c (NETBSD_DEFAULT_VIDEO_MODE): New const. (bsd_tag): New struct. (tags): New variable. (tags_last): Likewise. @@ -25382,50 +25382,50 @@ (OPENBSD_SERIAL_ARG): New definition. (netbsd_opts): New parameter "serial". (NETBSD_SERIAL_ARG): New definition. - (grub_freebsd_add_meta): Reorganised into ... - (grub_bsd_add_meta): ...this. All users updated. - (grub_freebsd_add_mmap): Reorganised into ... + (VasEBoot_freebsd_add_meta): Reorganised into ... + (VasEBoot_bsd_add_meta): ...this. All users updated. + (VasEBoot_freebsd_add_mmap): Reorganised into ... (generate_e820_mmap): ...this... - (grub_bsd_add_mmap): ...and this. All users updated. - (grub_freebsd_list_modules): Use tags. - (grub_netbsd_add_meta_module): New function. - (grub_netbsd_list_modules): Likewise. - (grub_freebsd_boot): Use relocator and finish EFI. - (grub_openbsd_boot): Likewise. - (grub_netbsd_setup_video): New function. - (grub_netbsd_add_modules): Likewise. - (grub_netbsd_boot): Use grub_netbsd_add_modules, relocator, netbsd_tags + (VasEBoot_bsd_add_mmap): ...and this. All users updated. + (VasEBoot_freebsd_list_modules): Use tags. + (VasEBoot_netbsd_add_meta_module): New function. + (VasEBoot_netbsd_list_modules): Likewise. + (VasEBoot_freebsd_boot): Use relocator and finish EFI. + (VasEBoot_openbsd_boot): Likewise. + (VasEBoot_netbsd_setup_video): New function. + (VasEBoot_netbsd_add_modules): Likewise. + (VasEBoot_netbsd_boot): Use VasEBoot_netbsd_add_modules, relocator, netbsd_tags and finish EFI. - (grub_bsd_unload): Unload tags. - (grub_bsd_load_aout): Use relocator. - (grub_bsd_elf32_size_hook): New function. - (grub_bsd_elf32_hook): Use relocator. - (grub_bsd_elf64_size_hook): New function. - (grub_bsd_elf64_hook): Use relocator. - (grub_bsd_load_elf): Use relocator and call grub_openbsd_find_ramdisk. - (grub_bsd_load): Zero-out openbsd_ramdisk. - (grub_bsd_load): Use relocator. - (grub_cmd_openbsd): Support serial. - (grub_cmd_netbsd): Support modules. - (grub_cmd_freebsd_module): Use relocator. - (grub_netbsd_module_load): New function. - (grub_cmd_netbsd_module): Likewise. - (grub_cmd_openbsd_ramdisk): Likewise. - (GRUB_MOD_INIT): Register knetbsd_module, knetbsd_module_elf and + (VasEBoot_bsd_unload): Unload tags. + (VasEBoot_bsd_load_aout): Use relocator. + (VasEBoot_bsd_elf32_size_hook): New function. + (VasEBoot_bsd_elf32_hook): Use relocator. + (VasEBoot_bsd_elf64_size_hook): New function. + (VasEBoot_bsd_elf64_hook): Use relocator. + (VasEBoot_bsd_load_elf): Use relocator and call VasEBoot_openbsd_find_ramdisk. + (VasEBoot_bsd_load): Zero-out openbsd_ramdisk. + (VasEBoot_bsd_load): Use relocator. + (VasEBoot_cmd_openbsd): Support serial. + (VasEBoot_cmd_netbsd): Support modules. + (VasEBoot_cmd_freebsd_module): Use relocator. + (VasEBoot_netbsd_module_load): New function. + (VasEBoot_cmd_netbsd_module): Likewise. + (VasEBoot_cmd_openbsd_ramdisk): Likewise. + (VasEBoot_MOD_INIT): Register knetbsd_module, knetbsd_module_elf and kopenbsd_ramdisk. - (GRUB_MOD_FINI): Unregister new commands. - * grub-core/loader/i386/bsdXX.c (load): Remove useless checks. - (grub_freebsd_load_elfmodule_obj): Use relocator. - (grub_freebsd_load_elfmodule): Likewise. - (grub_freebsd_load_elf_meta): Likewise. - (grub_netbsd_load_elf_meta): New function. - (grub_openbsd_find_ramdisk): Likewise. - * grub-core/loader/i386/bsd_helper.S: Removed. - * grub-core/loader/i386/bsd_pagetable.c: Support relocator. - * grub-core/loader/i386/bsd_trampoline.S: Removed. - * grub-core/loader/i386/efi/linux.c: Likewise. - * grub-core/loader/i386/ieee1275/linux.c: Likewise. - * grub-core/loader/i386/linux.c (HAS_VGA_TEXT): New const. + (VasEBoot_MOD_FINI): Unregister new commands. + * VasEBoot-core/loader/i386/bsdXX.c (load): Remove useless checks. + (VasEBoot_freebsd_load_elfmodule_obj): Use relocator. + (VasEBoot_freebsd_load_elfmodule): Likewise. + (VasEBoot_freebsd_load_elf_meta): Likewise. + (VasEBoot_netbsd_load_elf_meta): New function. + (VasEBoot_openbsd_find_ramdisk): Likewise. + * VasEBoot-core/loader/i386/bsd_helper.S: Removed. + * VasEBoot-core/loader/i386/bsd_pagetable.c: Support relocator. + * VasEBoot-core/loader/i386/bsd_trampoline.S: Removed. + * VasEBoot-core/loader/i386/efi/linux.c: Likewise. + * VasEBoot-core/loader/i386/ieee1275/linux.c: Likewise. + * VasEBoot-core/loader/i386/linux.c (HAS_VGA_TEXT): New const. (DEFAULT_VIDEO_MODE): Likewise. (real_mode_target): New variable. (prot_mode_target): Likewise. @@ -25433,234 +25433,234 @@ (relocator): Likewise. (efi_mmap_buf): Likewise. (efi_mmap_size): Likewise. - (find_efi_mmap_size): Moved from grub-core/loader/i386/efi/linux.c. + (find_efi_mmap_size): Moved from VasEBoot-core/loader/i386/efi/linux.c. (free_pages): Use relocator. (allocate_pages): Account for efi_mmap and use relocator. Return error. - (grub_linux_setup_video): Return error. - (grub_linux_trampoline_start): Removed. - (grub_linux_trampoline_end): Likewise. - (grub_linux_boot): Use relocator and DEFAULT_VIDEO_MODE. Pass console + (VasEBoot_linux_setup_video): Return error. + (VasEBoot_linux_trampoline_start): Removed. + (VasEBoot_linux_trampoline_end): Likewise. + (VasEBoot_linux_boot): Use relocator and DEFAULT_VIDEO_MODE. Pass console andd video parameters depending on firmware. - [GRUB_MACHINE_IEEE1275]: Pass OFW parameters. - [GRUB_MACHINE_EFI]: Pass EFI parameters. - (grub_cmd_linux) [GRUB_MACHINE_EFI]: Likewise. - (grub_cmd_initrd): Use relocator. - * grub-core/loader/i386/linux_trampoline.S: Removed. - * grub-core/loader/i386/multiboot_mbi.c (elf_sec_num): New variable. + [VasEBoot_MACHINE_IEEE1275]: Pass OFW parameters. + [VasEBoot_MACHINE_EFI]: Pass EFI parameters. + (VasEBoot_cmd_linux) [VasEBoot_MACHINE_EFI]: Likewise. + (VasEBoot_cmd_initrd): Use relocator. + * VasEBoot-core/loader/i386/linux_trampoline.S: Removed. + * VasEBoot-core/loader/i386/multiboot_mbi.c (elf_sec_num): New variable. (elf_sec_entsize): Likewise. (elf_sec_shstrndx): Likewise. (elf_sections): Likewise. - (grub_multiboot_load): Use relocator. - (grub_multiboot_get_mbi_size): Account for sections. - (grub_multiboot_make_mbi): Use relocator and support sections. - (grub_multiboot_add_elfsyms): New function. - (grub_multiboot_free_mbi): Free sections. - * grub-core/loader/i386/pc/linux.c (relocator): New variable. - (grub_linux_real_target): Likewise. - (grub_linux_real_chunk): Likewise. - (grub_linux16_prot_size): Likewise. - (grub_linux16_boot): Use relocator. - (grub_linux_unload): Unload relocator. - (grub_cmd_linux): Use relocator. - (grub_cmd_initrd): Likewise. - * grub-core/loader/i386/pc/ntldr.c: New file. - * grub-core/loader/i386/xnu.c (guessfsb) [GRUB_MACHINE_IEEE1275]: + (VasEBoot_multiboot_load): Use relocator. + (VasEBoot_multiboot_get_mbi_size): Account for sections. + (VasEBoot_multiboot_make_mbi): Use relocator and support sections. + (VasEBoot_multiboot_add_elfsyms): New function. + (VasEBoot_multiboot_free_mbi): Free sections. + * VasEBoot-core/loader/i386/pc/linux.c (relocator): New variable. + (VasEBoot_linux_real_target): Likewise. + (VasEBoot_linux_real_chunk): Likewise. + (VasEBoot_linux16_prot_size): Likewise. + (VasEBoot_linux16_boot): Use relocator. + (VasEBoot_linux_unload): Unload relocator. + (VasEBoot_cmd_linux): Use relocator. + (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/i386/pc/ntldr.c: New file. + * VasEBoot-core/loader/i386/xnu.c (guessfsb) [VasEBoot_MACHINE_IEEE1275]: Don't try to guess CPU frequency. - (grub_xnu_set_video): Stretch bitmap. - (grub_xnu_boot): Use relocator. - * grub-core/loader/mips/linux.c (grub_linux_boot): Use relocator. - (grub_linux_unload): Free relocator. - (grub_linux_load32): Use relocator. - (grub_linux_load64): Likewise. - (grub_cmd_initrd): Likewise. - * grub-core/loader/multiboot.c (grub_multiboot_boot): Use relocator. - (grub_multiboot_unload): Unload relocator. - (grub_cmd_multiboot): Use relocator. - (grub_cmd_module): Likewise. - * grub-core/loader/multiboot_elfxx.c (grub_multiboot_load_elfXX): + (VasEBoot_xnu_set_video): Stretch bitmap. + (VasEBoot_xnu_boot): Use relocator. + * VasEBoot-core/loader/mips/linux.c (VasEBoot_linux_boot): Use relocator. + (VasEBoot_linux_unload): Free relocator. + (VasEBoot_linux_load32): Use relocator. + (VasEBoot_linux_load64): Likewise. + (VasEBoot_cmd_initrd): Likewise. + * VasEBoot-core/loader/multiboot.c (VasEBoot_multiboot_boot): Use relocator. + (VasEBoot_multiboot_unload): Unload relocator. + (VasEBoot_cmd_multiboot): Use relocator. + (VasEBoot_cmd_module): Likewise. + * VasEBoot-core/loader/multiboot_elfxx.c (VasEBoot_multiboot_load_elfXX): Use relocator and support sections. - * grub-core/loader/multiboot_mbi2.c(elf_sec_num): New variable. + * VasEBoot-core/loader/multiboot_mbi2.c(elf_sec_num): New variable. (elf_sec_entsize): Likewise. (elf_sec_shstrndx): Likewise. (elf_sections): Likewise. - (grub_multiboot_load): Use relocator. - (grub_multiboot_get_mbi_size): Account for sections. - (grub_multiboot_make_mbi): Use relocator and support sections. - (grub_multiboot_add_elfsyms): New function. - * grub-core/loader/powerpc/ieee1275/linux.c: Remove useless include. - * grub-core/loader/sparc64/ieee1275/linux.c: Likewise. - * grub-core/loader/xnu.c (grub_xnu_heap_malloc): Use relocator. + (VasEBoot_multiboot_load): Use relocator. + (VasEBoot_multiboot_get_mbi_size): Account for sections. + (VasEBoot_multiboot_make_mbi): Use relocator and support sections. + (VasEBoot_multiboot_add_elfsyms): New function. + * VasEBoot-core/loader/powerpc/ieee1275/linux.c: Remove useless include. + * VasEBoot-core/loader/sparc64/ieee1275/linux.c: Likewise. + * VasEBoot-core/loader/xnu.c (VasEBoot_xnu_heap_malloc): Use relocator. Prototype changed. All users updated. - (grub_xnu_align_heap): Simplified. - (grub_xnu_writetree_toheap): Likewise. - (grub_xnu_unload): Unload relocator. - (grub_cmd_xnu_kernel): Use relocator. - (grub_cmd_xnu_kernel64): Likewise. - (grub_xnu_register_memory): Simplified. - * grub-core/loader/xnu_resume.c (grub_xnu_resume): Use relocator. - * grub-core/term/efi/console.c (grub_console_putchar): Abort if + (VasEBoot_xnu_align_heap): Simplified. + (VasEBoot_xnu_writetree_toheap): Likewise. + (VasEBoot_xnu_unload): Unload relocator. + (VasEBoot_cmd_xnu_kernel): Use relocator. + (VasEBoot_cmd_xnu_kernel64): Likewise. + (VasEBoot_xnu_register_memory): Simplified. + * VasEBoot-core/loader/xnu_resume.c (VasEBoot_xnu_resume): Use relocator. + * VasEBoot-core/term/efi/console.c (VasEBoot_console_putchar): Abort if EFI is finished. - (grub_console_checkkey): Likewise. - (grub_console_getkey): Likewise. - (grub_console_getwh): Likewise. - (grub_console_getxy): Likewise. - (grub_console_gotoxy): Likewise. - (grub_console_cls): Likewise. - (grub_console_setcolorstate): Likewise. - (grub_console_setcursor): Likewise. - * grub-core/term/ns8250.c (grub_ns8250_hw_get_port): New function. - * grub-core/tests/boot/kbsd.init-i386.S: New file. - * grub-core/tests/boot/kbsd.init-x86_64.S: Likewise. - * grub-core/tests/boot/kbsd.spec.txt: Likewise. - * grub-core/tests/boot/kernel-8086.S: Likewise. - * grub-core/tests/boot/kernel-i386.S: Likewise. - * grub-core/tests/boot/kfreebsd-aout.cfg: Likewise. - * grub-core/tests/boot/kfreebsd.cfg: Likewise. - * grub-core/tests/boot/kfreebsd.init-i386.S: Likewise. - * grub-core/tests/boot/kfreebsd.init-x86_64.S: Likewise. - * grub-core/tests/boot/knetbsd.cfg: Likewise. - * grub-core/tests/boot/kopenbsd.cfg: Likewise. - * grub-core/tests/boot/kopenbsdlabel.txt: Likewise. - * grub-core/tests/boot/linux.cfg: Likewise. - * grub-core/tests/boot/linux.init-i386.S: Likewise. - * grub-core/tests/boot/linux.init-x86_64.S: Likewise. - * grub-core/tests/boot/linux16.cfg: Likewise. - * grub-core/tests/boot/multiboot.cfg: Likewise. - * grub-core/tests/boot/multiboot2.cfg: Likewise. - * grub-core/tests/boot/ntldr.cfg: Likewise. - * grub-core/tests/boot/pc-chainloader.cfg: Likewise. - * include/grub/aout.h (grub_aout_load): Make load_addr a void *. - * include/grub/autoefi.h (grub_autoefi_finish_boot_services): + (VasEBoot_console_checkkey): Likewise. + (VasEBoot_console_getkey): Likewise. + (VasEBoot_console_getwh): Likewise. + (VasEBoot_console_getxy): Likewise. + (VasEBoot_console_gotoxy): Likewise. + (VasEBoot_console_cls): Likewise. + (VasEBoot_console_setcolorstate): Likewise. + (VasEBoot_console_setcursor): Likewise. + * VasEBoot-core/term/ns8250.c (VasEBoot_ns8250_hw_get_port): New function. + * VasEBoot-core/tests/boot/kbsd.init-i386.S: New file. + * VasEBoot-core/tests/boot/kbsd.init-x86_64.S: Likewise. + * VasEBoot-core/tests/boot/kbsd.spec.txt: Likewise. + * VasEBoot-core/tests/boot/kernel-8086.S: Likewise. + * VasEBoot-core/tests/boot/kernel-i386.S: Likewise. + * VasEBoot-core/tests/boot/kfreebsd-aout.cfg: Likewise. + * VasEBoot-core/tests/boot/kfreebsd.cfg: Likewise. + * VasEBoot-core/tests/boot/kfreebsd.init-i386.S: Likewise. + * VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S: Likewise. + * VasEBoot-core/tests/boot/knetbsd.cfg: Likewise. + * VasEBoot-core/tests/boot/kopenbsd.cfg: Likewise. + * VasEBoot-core/tests/boot/kopenbsdlabel.txt: Likewise. + * VasEBoot-core/tests/boot/linux.cfg: Likewise. + * VasEBoot-core/tests/boot/linux.init-i386.S: Likewise. + * VasEBoot-core/tests/boot/linux.init-x86_64.S: Likewise. + * VasEBoot-core/tests/boot/linux16.cfg: Likewise. + * VasEBoot-core/tests/boot/multiboot.cfg: Likewise. + * VasEBoot-core/tests/boot/multiboot2.cfg: Likewise. + * VasEBoot-core/tests/boot/ntldr.cfg: Likewise. + * VasEBoot-core/tests/boot/pc-chainloader.cfg: Likewise. + * include/VasEBoot/aout.h (VasEBoot_aout_load): Make load_addr a void *. + * include/VasEBoot/autoefi.h (VasEBoot_autoefi_finish_boot_services): New definition. - * include/grub/dl.h (grub_dl_unload_all): Removed. - * include/grub/efi/efi.h (grub_efi_exit_boot_services): Likewise. - (grub_efi_finish_boot_services): Change prototype. - (grub_efi_is_finished): New variable. - * include/grub/efiemu/efiemu.h (grub_efiemu_finish_boot_services): + * include/VasEBoot/dl.h (VasEBoot_dl_unload_all): Removed. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_exit_boot_services): Likewise. + (VasEBoot_efi_finish_boot_services): Change prototype. + (VasEBoot_efi_is_finished): New variable. + * include/VasEBoot/efiemu/efiemu.h (VasEBoot_efiemu_finish_boot_services): Changed prototype. - (grub_efiemu_finish_boot_services): Removed. - (grub_machine_efiemu_init_tables): New prototype. - * include/grub/elfload.h (grub_elf32_phdr_iterate): Likewise. - (grub_elf64_phdr_iterate): Likewise. - * include/grub/i386/bsd.h: Include relocator.h. + (VasEBoot_efiemu_finish_boot_services): Removed. + (VasEBoot_machine_efiemu_init_tables): New prototype. + * include/VasEBoot/elfload.h (VasEBoot_elf32_phdr_iterate): Likewise. + (VasEBoot_elf64_phdr_iterate): Likewise. + * include/VasEBoot/i386/bsd.h: Include relocator.h. (freebsd_tag_header): New struct. - (grub_openbsd_bios_mmap): Removed. - (grub_unix_real_boot): Removed. - (grub_freebsd_load_elfmodule32): Changed prototype. - (grub_freebsd_load_elfmodule_obj64): Likewise. - (grub_freebsd_load_elf_meta32): Likewise. - (grub_freebsd_load_elf_meta64): Likewise. - (grub_freebsd_add_meta): Removed. - (grub_netbsd_load_elf_meta32): New prototype. - (grub_netbsd_load_elf_meta64): Likewise. - (grub_bsd_add_meta): Likewise. - (grub_openbsd_ramdisk_descriptor): New struct. - (grub_openbsd_find_ramdisk32): New prototype. - (grub_openbsd_find_ramdisk64): Likewise. - * include/grub/i386/coreboot/loader.h: Removed. - * include/grub/i386/efi/loader.h: Likewise. - * include/grub/i386/ieee1275/loader.h: Likewise. - * include/grub/i386/linux.h (linux_kernel_header): Change void * - to grub_uint32_t. - * include/grub/i386/loader.h: Removed. - * include/grub/i386/memory.h (GRUB_MEMORY_CPU_CR4_PAE_ON): Correct the + (VasEBoot_openbsd_bios_mmap): Removed. + (VasEBoot_unix_real_boot): Removed. + (VasEBoot_freebsd_load_elfmodule32): Changed prototype. + (VasEBoot_freebsd_load_elfmodule_obj64): Likewise. + (VasEBoot_freebsd_load_elf_meta32): Likewise. + (VasEBoot_freebsd_load_elf_meta64): Likewise. + (VasEBoot_freebsd_add_meta): Removed. + (VasEBoot_netbsd_load_elf_meta32): New prototype. + (VasEBoot_netbsd_load_elf_meta64): Likewise. + (VasEBoot_bsd_add_meta): Likewise. + (VasEBoot_openbsd_ramdisk_descriptor): New struct. + (VasEBoot_openbsd_find_ramdisk32): New prototype. + (VasEBoot_openbsd_find_ramdisk64): Likewise. + * include/VasEBoot/i386/coreboot/loader.h: Removed. + * include/VasEBoot/i386/efi/loader.h: Likewise. + * include/VasEBoot/i386/ieee1275/loader.h: Likewise. + * include/VasEBoot/i386/linux.h (linux_kernel_header): Change void * + to VasEBoot_uint32_t. + * include/VasEBoot/i386/loader.h: Removed. + * include/VasEBoot/i386/memory.h (VasEBoot_MEMORY_CPU_CR4_PAE_ON): Correct the value. - (GRUB_MEMORY_CPU_CR4_PSE_ON): New definition. - (grub_phys_addr_t): New type. - (grub_vtop): New inline function. - (grub_map_memory): Likewise. - (grub_unmap_memory): Likewise. - * include/grub/i386/multiboot/loader.h: Removed. - * include/grub/i386/netbsd_bootinfo.h (NETBSD_BTINFO_BOOTDISK): Removed. + (VasEBoot_MEMORY_CPU_CR4_PSE_ON): New definition. + (VasEBoot_phys_addr_t): New type. + (VasEBoot_vtop): New inline function. + (VasEBoot_map_memory): Likewise. + (VasEBoot_unmap_memory): Likewise. + * include/VasEBoot/i386/multiboot/loader.h: Removed. + * include/VasEBoot/i386/netbsd_bootinfo.h (NETBSD_BTINFO_BOOTDISK): Removed. (NETBSD_BTINFO_CONSOLE): New definition. (NETBSD_BTINFO_SYMTAB): Likewise. (NETBSD_BTINFO_MODULES): Likewise. (NETBSD_BTINFO_FRAMEBUF): Likewise. - (grub_netbsd_bootinfo): New struct. - (grub_netbsd_btinfo_common): Use explicit bitsize. - (grub_netbsd_btinfo_mmap_entry): Removed. - (GRUB_NETBSD_MAX_BOOTPATH_LEN): New definition. - (grub_netbsd_btinfo_bootdisk): New struct. - (grub_netbsd_btinfo_symtab): Likewise. - (grub_netbsd_btinfo_serial): Likewise. - (grub_netbsd_btinfo_modules): Likewise. - (grub_netbsd_btinfo_framebuf): Likewise. - (GRUB_NETBSD_MAX_ROOTDEVICE_LEN): New definition. - * include/grub/i386/openbsd_bootarg.h (OPENBSD_BOOTARG_CONSOLE): + (VasEBoot_netbsd_bootinfo): New struct. + (VasEBoot_netbsd_btinfo_common): Use explicit bitsize. + (VasEBoot_netbsd_btinfo_mmap_entry): Removed. + (VasEBoot_NETBSD_MAX_BOOTPATH_LEN): New definition. + (VasEBoot_netbsd_btinfo_bootdisk): New struct. + (VasEBoot_netbsd_btinfo_symtab): Likewise. + (VasEBoot_netbsd_btinfo_serial): Likewise. + (VasEBoot_netbsd_btinfo_modules): Likewise. + (VasEBoot_netbsd_btinfo_framebuf): Likewise. + (VasEBoot_NETBSD_MAX_ROOTDEVICE_LEN): New definition. + * include/VasEBoot/i386/openbsd_bootarg.h (OPENBSD_BOOTARG_CONSOLE): Likewise. - (grub_openbsd_bootargs): Use explicit bitsize. - (grub_openbsd_bootarg_console): New struct. - (GRUB_OPENBSD_COM_MAJOR): New definition. - (GRUB_OPENBSD_VGA_MAJOR): Likewise. - * include/grub/i386/pc/efiemu.h: Removed. - * include/grub/i386/pc/loader.h: Don't include cpu/loader.h. - * include/grub/i386/qemu/loader.h: Removed. - * include/grub/i386/relocator.h: Rewritten. - * include/grub/i386/xnu.h (grub_xnu_heap_will_be_at): Removed. - * include/grub/mips/memory.h: New file. - * include/grub/mips/multiboot.h: Rewritten. - * include/grub/mips/relocator.h: Rewritten. - * include/grub/mips/yeeloong/memory.h (grub_phys_addr_t): New type. - (grub_vtop): New function. - (grub_map_memory): Likewise. - (grub_unmap_memory): Likewise. - * include/grub/misc.h (ALIGN_DOWN): New definition. - * include/grub/mm.h (grub_mm_check_real): New proto. - (GRUB_MM_CHECK): New definition. - * include/grub/mm_private.h: New file. - * include/grub/multiboot.h (grub_multiboot_relocator): New variable. - (grub_multiboot_get_mbi_size): Removed. - (grub_multiboot_make_mbi): Change prottype. - (grub_multiboot_set_accepts_video): New proto. - (grub_multiboot_add_elfsyms): Likewise. - (grub_multiboot_payload_eip): New variable. - * include/grub/ns8250.h (grub_ns8250_hw_get_port) [!ASM_FILE]: + (VasEBoot_openbsd_bootargs): Use explicit bitsize. + (VasEBoot_openbsd_bootarg_console): New struct. + (VasEBoot_OPENBSD_COM_MAJOR): New definition. + (VasEBoot_OPENBSD_VGA_MAJOR): Likewise. + * include/VasEBoot/i386/pc/efiemu.h: Removed. + * include/VasEBoot/i386/pc/loader.h: Don't include cpu/loader.h. + * include/VasEBoot/i386/qemu/loader.h: Removed. + * include/VasEBoot/i386/relocator.h: Rewritten. + * include/VasEBoot/i386/xnu.h (VasEBoot_xnu_heap_will_be_at): Removed. + * include/VasEBoot/mips/memory.h: New file. + * include/VasEBoot/mips/multiboot.h: Rewritten. + * include/VasEBoot/mips/relocator.h: Rewritten. + * include/VasEBoot/mips/yeeloong/memory.h (VasEBoot_phys_addr_t): New type. + (VasEBoot_vtop): New function. + (VasEBoot_map_memory): Likewise. + (VasEBoot_unmap_memory): Likewise. + * include/VasEBoot/misc.h (ALIGN_DOWN): New definition. + * include/VasEBoot/mm.h (VasEBoot_mm_check_real): New proto. + (VasEBoot_MM_CHECK): New definition. + * include/VasEBoot/mm_private.h: New file. + * include/VasEBoot/multiboot.h (VasEBoot_multiboot_relocator): New variable. + (VasEBoot_multiboot_get_mbi_size): Removed. + (VasEBoot_multiboot_make_mbi): Change prottype. + (VasEBoot_multiboot_set_accepts_video): New proto. + (VasEBoot_multiboot_add_elfsyms): Likewise. + (VasEBoot_multiboot_payload_eip): New variable. + * include/VasEBoot/ns8250.h (VasEBoot_ns8250_hw_get_port) [!ASM_FILE]: New prototype. - * include/grub/offsets.h (GRUB_KERNEL_I386_MULTIBOOT_PREFIX): + * include/VasEBoot/offsets.h (VasEBoot_KERNEL_I386_MULTIBOOT_PREFIX): New definition. - (GRUB_KERNEL_I386_MULTIBOOT_DATA_END): Likewise. - (GRUB_KERNEL_I386_MULTIBOOT_MOD_ALIGN): Likewise. - * include/grub/powerpc/ieee1275/loader.h: Removed. - * include/grub/powerpc/memory.h: New file. - * include/grub/powerpc/relocator.h: Likewise. - * include/grub/relocator.h: Likewise. - * include/grub/relocator_private.h: Likewise. - * include/grub/sparc64/ieee1275/loader.h: Removed. - * include/grub/x86_64/memory.h: New file. - * include/grub/xnu.h (grub_xnu_writetree_toheap): Changed prototype. - (grub_xnu_heap_malloc): Likewise. - (grub_xnu_heap_real_start): Removed. - (grub_xnu_heap_start): Likewise. - (grub_xnu_relocator): New variable. - (grub_xnu_heap_target_start): Likewise. - * tests/util/grub-shell.in: Support non-pc. - * util/grub-mkimage.c (image_targets): Fix multiboot target. + (VasEBoot_KERNEL_I386_MULTIBOOT_DATA_END): Likewise. + (VasEBoot_KERNEL_I386_MULTIBOOT_MOD_ALIGN): Likewise. + * include/VasEBoot/powerpc/ieee1275/loader.h: Removed. + * include/VasEBoot/powerpc/memory.h: New file. + * include/VasEBoot/powerpc/relocator.h: Likewise. + * include/VasEBoot/relocator.h: Likewise. + * include/VasEBoot/relocator_private.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/loader.h: Removed. + * include/VasEBoot/x86_64/memory.h: New file. + * include/VasEBoot/xnu.h (VasEBoot_xnu_writetree_toheap): Changed prototype. + (VasEBoot_xnu_heap_malloc): Likewise. + (VasEBoot_xnu_heap_real_start): Removed. + (VasEBoot_xnu_heap_start): Likewise. + (VasEBoot_xnu_relocator): New variable. + (VasEBoot_xnu_heap_target_start): Likewise. + * tests/util/VasEBoot-shell.in: Support non-pc. + * util/VasEBoot-mkimage.c (image_targets): Fix multiboot target. 2010-08-29 Vladimir Serbinenko - * grub-core/normal/charset.c (grub_utf8_to_ucs4_alloc): Avoid deadloop + * VasEBoot-core/normal/charset.c (VasEBoot_utf8_to_ucs4_alloc): Avoid deadloop on malloc error. - (grub_bidi_logical_to_visual): Check that malloc succeded. - * grub-core/normal/term.c (grub_puts_terminal): Fix fallback to dumb + (VasEBoot_bidi_logical_to_visual): Check that malloc succeded. + * VasEBoot-core/normal/term.c (VasEBoot_puts_terminal): Fix fallback to dumb puts. - (grub_xputs_normal): Likewise. + (VasEBoot_xputs_normal): Likewise. 2010-08-29 Vladimir Serbinenko - * grub-core/Makefile.core.def (kernel): Add kern/mips/cache_flush.S to + * VasEBoot-core/Makefile.core.def (kernel): Add kern/mips/cache_flush.S to extra_dist. 2010-08-29 Vladimir Serbinenko - * grub-core/efiemu/runtime/efiemu.sh: Removed. + * VasEBoot-core/efiemu/runtime/efiemu.sh: Removed. 2010-08-29 Vladimir Serbinenko - * Makefile.util.def (grub-ofpathname): Add missing ldadd. + * Makefile.util.def (VasEBoot-ofpathname): Add missing ldadd. 2010-08-29 Vladimir Serbinenko - * grub-core/kern/misc.c (grub_real_dprintf): Always refresh after + * VasEBoot-core/kern/misc.c (VasEBoot_real_dprintf): Always refresh after dprintf. 2010-08-29 BVK Chaitanya @@ -25669,86 +25669,86 @@ 2010-08-28 Vladimir Serbinenko - * grub-core/normal/term.c (print_more): Fix a memory leak. - (grub_puts_terminal): Revert to dumb puts if memory allocation fails. - (grub_xputs_normal): Likewise. + * VasEBoot-core/normal/term.c (print_more): Fix a memory leak. + (VasEBoot_puts_terminal): Revert to dumb puts if memory allocation fails. + (VasEBoot_xputs_normal): Likewise. 2010-08-28 Vladimir Serbinenko - * grub-core/script/lexer.c (grub_script_lexer_init): Don't look before + * VasEBoot-core/script/lexer.c (VasEBoot_script_lexer_init): Don't look before the begining of the string 2010-08-28 Vladimir Serbinenko - * grub-core/script/script.c (grub_script_parse): Free parsed on + * VasEBoot-core/script/script.c (VasEBoot_script_parse): Free parsed on failure. 2010-08-28 Vladimir Serbinenko - * grub-core/normal/completion.c (grub_normal_do_completion): Free argv + * VasEBoot-core/normal/completion.c (VasEBoot_normal_do_completion): Free argv on failure. 2010-08-28 Vladimir Serbinenko - * grub-core/normal/cmdline.c (grub_cmdline_get): Free cl_terms on + * VasEBoot-core/normal/cmdline.c (VasEBoot_cmdline_get): Free cl_terms on return. 2010-08-28 Vladimir Serbinenko - * grub-core/term/gfxterm.c (grub_gfxterm_term_fini): Free the text buffer. + * VasEBoot-core/term/gfxterm.c (VasEBoot_gfxterm_term_fini): Free the text buffer. (scroll_up): Fix a memory leak. 2010-08-28 Vladimir Serbinenko - * grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Handle grub_disk_read + * VasEBoot-core/fs/nilfs2.c (VasEBoot_nilfs2_load_sb): Handle VasEBoot_disk_read errors. 2010-08-27 Vladimir Serbinenko Handle USB pendrives exposed as floppies. - * grub-core/boot/i386/pc/boot.S: Check LBA even on what appears to be + * VasEBoot-core/boot/i386/pc/boot.S: Check LBA even on what appears to be floppy. - * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Likewise. + * VasEBoot-core/disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Likewise. Check for partitions on all devices. 2010-08-25 Vladimir Serbinenko - * grub-core/term/ieee1275/ofconsole.c (put): Correct prototype. + * VasEBoot-core/term/ieee1275/ofconsole.c (put): Correct prototype. (readkey): Likewise. 2010-08-25 BVK Chaitanya Multiple variable names support to "export" command. - * normal/context.c (grub_cmd_export): "export" command supports + * normal/context.c (VasEBoot_cmd_export): "export" command supports multiple variable names. 2010-08-23 Samuel Thibault - * util/grub.d/30_os-prober.in: Fix conversion from grub-probe + * util/VasEBoot.d/30_os-prober.in: Fix conversion from VasEBoot-probe --target=drive output to Mach device name. 2010-08-23 BVK Chaitanya - New Automake based build system for GRUB. + New Automake based build system for VasEBoot. * ABOUT-NLS: New file. - * Makefile.am: New file. GRUB host utils' rules that doesn't fit + * Makefile.am: New file. VasEBoot host utils' rules that doesn't fit in Makefile.util.def file. * Makefile.util.def: New file. Autogen build definitions file for - GRUB host utils. - * conf/Makefile.common: New file. Common variables for GRUB host + VasEBoot host utils. + * conf/Makefile.common: New file. Common variables for VasEBoot host utils and target modules. * conf/Makefile.extra-dist: New file. Extra files for make dist. * docs/Makefile.am: New file. Automake file for docs. * gentpl.py: New file. Python script to generate Autogen template. - * grub-core/Makefile.am: New file. GRUB target modules' rules + * VasEBoot-core/Makefile.am: New file. VasEBoot target modules' rules that doesn't fit in Makefile.core.def file. - * grub-core/Makefile.core.def: New file. Autogen build - definitions file for GRUB target modules. - * grub-core/lib/setjmp.S: New file. Wrapper for target_cpu + * VasEBoot-core/Makefile.core.def: New file. Autogen build + definitions file for VasEBoot target modules. + * VasEBoot-core/lib/setjmp.S: New file. Wrapper for target_cpu specific setjmp.S file. * po/Makefile.am: New file. @@ -25760,44 +25760,44 @@ and defines for Automake conditionals. * geninit.sh: Refactoring. - * include/grub/dl.h: Allow build rules to define GRUB_MOD_* if + * include/VasEBoot/dl.h: Allow build rules to define VasEBoot_MOD_* if necessary. - * include/grub/emu/getroot.h (grub_make_system_path_relative_to_its_root): + * include/VasEBoot/emu/getroot.h (VasEBoot_make_system_path_relative_to_its_root): New prototype. - * include/grub/test.h: Fix functional test modules' naming. - * grub-core/tests/example_functional_test.c: Fix test module name. + * include/VasEBoot/test.h: Fix functional test modules' naming. + * VasEBoot-core/tests/example_functional_test.c: Fix test module name. - * util/misc.c: Hosted versions' of grub functions for libgrub.a - * tests/lib/unit_test.c: Remove hosted versions of grub functions. - * util/grub-editenv.c: Likewise. - * util/grub-fstest.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. - * util/grub-mkfont.c: Likewise. - * util/grub-mkimage.c: Likewise. - * util/grub-mkpasswd-pbkdf2.c: Likewise. - * util/grub-probe.c: Likewise. - * util/grub-script-check.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. - * util/sparc64/ieee1275/grub-setup.c: Likewise. + * util/misc.c: Hosted versions' of VasEBoot functions for libVasEBoot.a + * tests/lib/unit_test.c: Remove hosted versions of VasEBoot functions. + * util/VasEBoot-editenv.c: Likewise. + * util/VasEBoot-fstest.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/VasEBoot-mkfont.c: Likewise. + * util/VasEBoot-mkimage.c: Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c: Likewise. + * util/VasEBoot-probe.c: Likewise. + * util/VasEBoot-script-check.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c: Likewise. - * tests/util/grub-shell.in: Fix override directory path. - * util/grub-mkrescue.in: Replace @pkglib_DATA@ with files. + * tests/util/VasEBoot-shell.in: Fix override directory path. + * util/VasEBoot-mkrescue.in: Replace @pkglib_DATA@ with files. * util/import_gcry.py: Create Makefile.gcry.def file instead. * util/lvm.c: Update #includes. * util/raid.c: Likewise. * util/resolve.c: Likewise. - * grub-core/bus/emu/pci.c: Likewise. - * grub-core/lib/posix_wrap/stdlib.h: Likewise. - * grub-core/lib/posix_wrap/string.h: Likewise. - * grub-core/kern/emu/main.c: Likewise. + * VasEBoot-core/bus/emu/pci.c: Likewise. + * VasEBoot-core/lib/posix_wrap/stdlib.h: Likewise. + * VasEBoot-core/lib/posix_wrap/string.h: Likewise. + * VasEBoot-core/kern/emu/main.c: Likewise. - * grub-core/gensymlist.sh: New file. Script for generating kernel + * VasEBoot-core/gensymlist.sh: New file. Script for generating kernel symbols file. - * grub-core/genmoddep.awk: Support new kernel_syms.lst format. + * VasEBoot-core/genmoddep.awk: Support new kernel_syms.lst format. - * grub-core/gentrigtables.c: Fix unused variable warnings. + * VasEBoot-core/gentrigtables.c: Fix unused variable warnings. * Makefile.in: Removed. * conf/any-emu.rmk: Removed. @@ -25823,155 +25823,155 @@ * gensymlist.sh.in: Removed. * mkinstalldirs: Removed. * boot: Moved ... - * grub-core/boot: ... to here. + * VasEBoot-core/boot: ... to here. * bus: Moved ... - * grub-core/bus: ... to here. + * VasEBoot-core/bus: ... to here. * commands: Moved ... - * grub-core/commands: ... to here. + * VasEBoot-core/commands: ... to here. * disk: Moved ... - * grub-core/disk: ... to here. + * VasEBoot-core/disk: ... to here. * efiemu: Moved ... - * grub-core/efiemu: ... to here. + * VasEBoot-core/efiemu: ... to here. * font: Moved ... - * grub-core/font: ... to here. + * VasEBoot-core/font: ... to here. * fs: Moved ... - * grub-core/fs: ... to here. + * VasEBoot-core/fs: ... to here. * gencmdlist.sh: Moved ... - * grub-core/gencmdlist.sh: ... to here. + * VasEBoot-core/gencmdlist.sh: ... to here. * genemuinit.sh: Moved ... - * grub-core/genemuinit.sh: ... to here. + * VasEBoot-core/genemuinit.sh: ... to here. * genemuinitheader.sh: Moved ... - * grub-core/genemuinitheader.sh: ... to here. + * VasEBoot-core/genemuinitheader.sh: ... to here. * genfslist.sh: Moved ... - * grub-core/genfslist.sh: ... to here. + * VasEBoot-core/genfslist.sh: ... to here. * genhandlerlist.sh: Moved ... - * grub-core/genhandlerlist.sh: ... to here. + * VasEBoot-core/genhandlerlist.sh: ... to here. * genmoddep.awk: Moved ... - * grub-core/genmoddep.awk: ... to here. + * VasEBoot-core/genmoddep.awk: ... to here. * genmodsrc.sh: Moved ... - * grub-core/genmodsrc.sh: ... to here. + * VasEBoot-core/genmodsrc.sh: ... to here. * genpartmaplist.sh: Moved ... - * grub-core/genpartmaplist.sh: ... to here. + * VasEBoot-core/genpartmaplist.sh: ... to here. * genparttoollist.sh: Moved ... - * grub-core/genparttoollist.sh: ... to here. + * VasEBoot-core/genparttoollist.sh: ... to here. * genterminallist.sh: Moved ... - * grub-core/genterminallist.sh: ... to here. + * VasEBoot-core/genterminallist.sh: ... to here. * gentrigtables.c: Moved ... - * grub-core/gentrigtables.c: ... to here. + * VasEBoot-core/gentrigtables.c: ... to here. * genvideolist.sh: Moved ... - * grub-core/genvideolist.sh: ... to here. + * VasEBoot-core/genvideolist.sh: ... to here. * gettext: Moved ... - * grub-core/gettext: ... to here. + * VasEBoot-core/gettext: ... to here. * gfxmenu: Moved ... - * grub-core/gfxmenu: ... to here. + * VasEBoot-core/gfxmenu: ... to here. * gnulib: Moved ... - * grub-core/gnulib: ... to here. + * VasEBoot-core/gnulib: ... to here. * hello: Moved ... - * grub-core/hello: ... to here. + * VasEBoot-core/hello: ... to here. * hook: Moved ... - * grub-core/hook: ... to here. + * VasEBoot-core/hook: ... to here. * io: Moved ... - * grub-core/io: ... to here. + * VasEBoot-core/io: ... to here. * kern: Moved ... - * grub-core/kern: ... to here. + * VasEBoot-core/kern: ... to here. * lib: Moved ... - * grub-core/lib: ... to here. + * VasEBoot-core/lib: ... to here. * loader: Moved ... - * grub-core/loader: ... to here. + * VasEBoot-core/loader: ... to here. * mmap: Moved ... - * grub-core/mmap: ... to here. + * VasEBoot-core/mmap: ... to here. * normal: Moved ... - * grub-core/normal: ... to here. + * VasEBoot-core/normal: ... to here. * partmap: Moved ... - * grub-core/partmap: ... to here. + * VasEBoot-core/partmap: ... to here. * parttool: Moved ... - * grub-core/parttool: ... to here. + * VasEBoot-core/parttool: ... to here. * script: Moved ... - * grub-core/script: ... to here. + * VasEBoot-core/script: ... to here. * term: Moved ... - * grub-core/term: ... to here + * VasEBoot-core/term: ... to here * tests/example_functional_test.c: Moved ... - * grub-core/tests/example_functional_test.c: ... to here. + * VasEBoot-core/tests/example_functional_test.c: ... to here. * tests/lib/functional_test.c: Moved ... - * grub-core/tests/lib/functional_test.c: ... to here. + * VasEBoot-core/tests/lib/functional_test.c: ... to here. * tests/lib/test.c: Moved ... - * grub-core/tests/lib/test.c: ... to here. + * VasEBoot-core/tests/lib/test.c: ... to here. * video: Moved ... - * grub-core/video: ... to here. + * VasEBoot-core/video: ... to here. 2010-08-23 BVK Chaitanya - Replace --enable-grub-emu-modules with grub-emu-lite. + Replace --enable-VasEBoot-emu-modules with VasEBoot-emu-lite. * kern/emu/cache.S: New file. Wrapper for $target_cpu specific cache.S. - * include/grub/emu/misc.h (grub_emu_init): New prototype. - * kern/emu/full.c: New file. For grub-emu specific initialization. - * kern/emu/lite.c: New file. For grub-emu-lite initialization. - * kern/emu/main.c: Call initialization function grub_emu_init. + * include/VasEBoot/emu/misc.h (VasEBoot_emu_init): New prototype. + * kern/emu/full.c: New file. For VasEBoot-emu specific initialization. + * kern/emu/lite.c: New file. For VasEBoot-emu-lite initialization. + * kern/emu/main.c: Call initialization function VasEBoot_emu_init. - * Makefile.in: Include grub-emu-lite in install. - * commands/parttool.c: Use grub_no_autoload to differentiate - between grub-emu and grub-emu-lite. - * include/grub/misc.h: New variable grub_no_autoload. + * Makefile.in: Include VasEBoot-emu-lite in install. + * commands/parttool.c: Use VasEBoot_no_autoload to differentiate + between VasEBoot-emu and VasEBoot-emu-lite. + * include/VasEBoot/misc.h: New variable VasEBoot_no_autoload. - * conf/any-emu.rmk: New rules for grub-emu-lite. - * configure.ac: Remove --enable-grub-emu-modules. + * conf/any-emu.rmk: New rules for VasEBoot-emu-lite. + * configure.ac: Remove --enable-VasEBoot-emu-modules. * genmk.rb: Cleanup unnecessary rules. - * include/grub/dl.h: Remove GRUB_NO_MODULES macro. + * include/VasEBoot/dl.h: Remove VasEBoot_NO_MODULES macro. - * normal/main.c: Don't load list files on grub-emu-lite. - * util/misc.c (grub_arch_sync_caches): Removed. + * normal/main.c: Don't load list files on VasEBoot-emu-lite. + * util/misc.c (VasEBoot_arch_sync_caches): Removed. 2010-08-23 Colin Watson - * kern/mips/startup.S (grub_prefix): Update comment to refer to - grub-mkimage rather than grub-mkelfimage. - * kern/powerpc/ieee1275/startup.S (grub_prefix): Likewise. + * kern/mips/startup.S (VasEBoot_prefix): Update comment to refer to + VasEBoot-mkimage rather than VasEBoot-mkelfimage. + * kern/powerpc/ieee1275/startup.S (VasEBoot_prefix): Likewise. 2010-08-22 Vladimir Serbinenko - * term/at_keyboard.c (grub_at_keyboard_getkey_noblock): Don't discard + * term/at_keyboard.c (VasEBoot_at_keyboard_getkey_noblock): Don't discard a key after CapsLock or NumLock. It's just a qemu bug. 2010-08-21 Vladimir Serbinenko - * include/grub/usb.h (grub_usb_device): Add 'data' field back. It's + * include/VasEBoot/usb.h (VasEBoot_usb_device): Add 'data' field back. It's needed by libusb wrapper. 2010-08-21 Samuel Thibault - * docs/grub.texi (GNU/Hurd): Document booting GNU/Hurd. + * docs/VasEBoot.texi (GNU/Hurd): Document booting GNU/Hurd. 2010-08-21 Vladimir Serbinenko - * loader/multiboot.c (grub_cmd_module): Don't unzip module if + * loader/multiboot.c (VasEBoot_cmd_module): Don't unzip module if --nounzip is passed. 2010-08-20 Vladimir Serbinenko USB hotunplugging and USB serial support. - * bus/usb/ohci.c (grub_ohci_transfer): Fill *actual and respect timeout. - * bus/usb/uhci.c (grub_free_queue): Compute *actual. - (grub_uhci_transfer): Respect timeout and set *actual. - * bus/usb/usb.c (grub_usb_device_initialize): Correctly skip fields of + * bus/usb/ohci.c (VasEBoot_ohci_transfer): Fill *actual and respect timeout. + * bus/usb/uhci.c (VasEBoot_free_queue): Compute *actual. + (VasEBoot_uhci_transfer): Respect timeout and set *actual. + * bus/usb/usb.c (VasEBoot_usb_device_initialize): Correctly skip fields of non-standard length. - (grub_usb_device_attach): Autoload modules. - (GRUB_MOD_INIT): Set grub_term_poll_usb. - (GRUB_MOD_FINI): Unset grub_term_poll_usb. - * bus/usb/usbhub.c (grub_usb_hub): Replace speed with devices. All + (VasEBoot_usb_device_attach): Autoload modules. + (VasEBoot_MOD_INIT): Set VasEBoot_term_poll_usb. + (VasEBoot_MOD_FINI): Unset VasEBoot_term_poll_usb. + * bus/usb/usbhub.c (VasEBoot_usb_hub): Replace speed with devices. All users updated. - (grub_usb_add_hub): Fill nports and children. + (VasEBoot_usb_add_hub): Fill nports and children. (attach_root_port): Receive hub instead of controller. All users updated. Fill hub->devices. - (grub_usb_root_hub): Allocate hub->devices. + (VasEBoot_usb_root_hub): Allocate hub->devices. (detach_device): New function. (poll_nonroot_hub): Fill children and detach devices. - * bus/usb/usbtrans.c (grub_usb_bulk_readwrite): Accept timeout and + * bus/usb/usbtrans.c (VasEBoot_usb_bulk_readwrite): Accept timeout and actual arguments. All users updated. - (grub_usb_bulk_read_extended): New function. + (VasEBoot_usb_bulk_read_extended): New function. * bus/usb/serial/common.c: New file. * bus/usb/serial/ftdi.c: Likewise. * bus/usb/serial/pl2303.c: Likewise. @@ -25998,30 +25998,30 @@ * conf/i386.rmk (serial_mod_SOURCES): Add term/ns8250.c. * conf/mips-yeeloong.rmk (kernel_img_SOURCES): Likewise. * disk/usbms.c (first_available_slot): New variable. - (grub_usbms_attach): Don't reuse free slots due to potential cache + (VasEBoot_usbms_attach): Don't reuse free slots due to potential cache problems. - * include/grub/serial.h: Moved to .. - * include/grub/ns8250.h: ...this. - * include/grub/serial.h: New file. - * include/grub/term.h (grub_term_poll_usb): New variable. - * include/grub/terminfo.h (grub_terminfo_input_state): Pass term to + * include/VasEBoot/serial.h: Moved to .. + * include/VasEBoot/ns8250.h: ...this. + * include/VasEBoot/serial.h: New file. + * include/VasEBoot/term.h (VasEBoot_term_poll_usb): New variable. + * include/VasEBoot/terminfo.h (VasEBoot_terminfo_input_state): Pass term to readkey. All users updated. - (grub_terminfo_output_state): Pass term to put. - * include/grub/usb.h (GRUB_USB_REQTYPE): New enum. - (grub_usb_controller_dev): Add timeout and actual arguments to + (VasEBoot_terminfo_output_state): Pass term to put. + * include/VasEBoot/usb.h (VasEBoot_USB_REQTYPE): New enum. + (VasEBoot_usb_controller_dev): Add timeout and actual arguments to transfer. All users updated. - (grub_usb_interface): New field detach_data. - (grub_usb_device): New fields children and nports. - (grub_usb_ep_type_t): New type. - (grub_usb_get_ep_type): New function. - (grub_usb_bulk_read_extended): Likewise. - * include/grub/usbdesc.h (grub_usb_desc): New type. - * include/grub/usbserial.h: New file. - * include/grub/usbtrans.h (grub_usb_transaction): New field preceding. - * kern/term.c (grub_term_poll_usb): New variable. - (grub_getkey): Call grub_term_poll_usb if set. - (grub_checkkey): Likewise. - (grub_getkeystatus): Likewise. + (VasEBoot_usb_interface): New field detach_data. + (VasEBoot_usb_device): New fields children and nports. + (VasEBoot_usb_ep_type_t): New type. + (VasEBoot_usb_get_ep_type): New function. + (VasEBoot_usb_bulk_read_extended): Likewise. + * include/VasEBoot/usbdesc.h (VasEBoot_usb_desc): New type. + * include/VasEBoot/usbserial.h: New file. + * include/VasEBoot/usbtrans.h (VasEBoot_usb_transaction): New field preceding. + * kern/term.c (VasEBoot_term_poll_usb): New variable. + (VasEBoot_getkey): Call VasEBoot_term_poll_usb if set. + (VasEBoot_checkkey): Likewise. + (VasEBoot_getkeystatus): Likewise. * term/serial.c: Moved controller-specific parts to ... * term/ns8250.c: ... here. * term/serial.c: Mostly rewritten. @@ -26033,16 +26033,16 @@ Make kFreeBSD code more generic to support ext2fs as root, ufs as a separate module and maybe other interesting combinations. - * util/grub.d/10_kfreebsd.in (load_kfreebsd_module): New function. + * util/VasEBoot.d/10_kfreebsd.in (load_kfreebsd_module): New function. (kfreebsd_entry): Use load_kfreebsd_module() to load modules. (kfreebsd_entry): Add generic filesystem module load routine. - Map GRUB `ext2' to kFreeBSD `ext2fs'. + Map VasEBoot `ext2' to kFreeBSD `ext2fs'. 2010-08-20 Colin Watson * commands/i386/pc/sendkey.c (keysym_table): Rename "numlock" to "numcenter" (I misunderstood the purpose of this entry). - * docs/grub.texi (sendkey): Likewise. + * docs/VasEBoot.texi (sendkey): Likewise. 2010-08-20 Colin Watson @@ -26050,10 +26050,10 @@ status flag options; simply omitting the option is equivalent and simpler. Rename "wait" to "pause". Rename "sysreq" to "sysrq". (keysym_table): Rename "num5numlock" to "numlock". - (grub_cmd_sendkey): Reinitialise `andmask' and `ormask', so that we + (VasEBoot_cmd_sendkey): Reinitialise `andmask' and `ormask', so that we can uniformly say that only the last of multiple `sendkey' invocations has any effect. - * docs/grub.texi (sendkey): New section. + * docs/VasEBoot.texi (sendkey): New section. 2010-08-19 Colin Watson @@ -26076,20 +26076,20 @@ 2010-08-18 Colin Watson - * acinclude.m4 (grub_ASM_USCORE): Use a more accurate grep pattern, + * acinclude.m4 (VasEBoot_ASM_USCORE): Use a more accurate grep pattern, to avoid false positives with some assemblers that output things like "someprefix_func" as part of their output. 2010-08-15 Robert Millan - * kern/emu/misc.c (grub_get_libzfs_handle): Handle libzfs_init() + * kern/emu/misc.c (VasEBoot_get_libzfs_handle): Handle libzfs_init() errors. * kern/emu/getroot.c (find_root_device_from_libzfs): Handle - grub_get_libzfs_handle() errors. + VasEBoot_get_libzfs_handle() errors. 2010-08-14 Robert Millan - * kern/emu/misc.c (grub_find_zpool_from_dir): Abort function if + * kern/emu/misc.c (VasEBoot_find_zpool_from_dir): Abort function if filesystem is not ZFS. 2010-08-12 BVK Chaitanya @@ -26097,127 +26097,127 @@ Fix for misspelled color names defaulting to black/black (bug reported by Doug Nazar) - * include/grub/normal.h (grub_parse_color_name_pair): Add return + * include/VasEBoot/normal.h (VasEBoot_parse_color_name_pair): Add return status to prototype. - * normal/color.c (grub_parse_color_name_pair): Return failure + * normal/color.c (VasEBoot_parse_color_name_pair): Return failure status. - (grub_env_write_color_normal): Ignore bad color names. - (grub_env_write_color_highlight): Likewise. - * normal/main.c (GRUB_MOD_INIT): Set default color names. + (VasEBoot_env_write_color_normal): Ignore bad color names. + (VasEBoot_env_write_color_highlight): Likewise. + * normal/main.c (VasEBoot_MOD_INIT): Set default color names. 2010-08-12 BVK Chaitanya - "shift" command support to GRUB script. + "shift" command support to VasEBoot script. - * include/grub/script_sh.h (grub_script_shift): New prototype. - * script/execute.c (grub_script_shift): New function. - * script/main.c (grub_script_init): Register shift command. - (grub_script_fini): Unregister shift command. - * util/grub-script-check.c (grub_script_cmd_shift): New function. + * include/VasEBoot/script_sh.h (VasEBoot_script_shift): New prototype. + * script/execute.c (VasEBoot_script_shift): New function. + * script/main.c (VasEBoot_script_init): Register shift command. + (VasEBoot_script_fini): Unregister shift command. + * util/VasEBoot-script-check.c (VasEBoot_script_cmd_shift): New function. - * tests/grub_script_shift.in: New testcase. + * tests/VasEBoot_script_shift.in: New testcase. * conf/tests.rmk: Rules for new testcase. 2010-08-12 BVK Chaitanya - "continue" command support to GRUB script. + "continue" command support to VasEBoot script. - * script/execute.c (grub_script_execute_cmdwhile): Continue support. - (grub_script_break): Continue support. - * script/main.c (grub_script_init): Register continue command. - (grub_script_fini): Unregister continue command. + * script/execute.c (VasEBoot_script_execute_cmdwhile): Continue support. + (VasEBoot_script_break): Continue support. + * script/main.c (VasEBoot_script_init): Register continue command. + (VasEBoot_script_fini): Unregister continue command. - * tests/grub_script_continue.in: New testcase. + * tests/VasEBoot_script_continue.in: New testcase. * conf/tests.rmk: Rules for new testcase. 2010-08-12 BVK Chaitanya - "break" command support to GRUB script. + "break" command support to VasEBoot script. - * conf/common.rmk: Rule updates to grub-script-check. - * include/grub/misc.h (grub_min): New function. - * include/grub/script_sh.h (grub_script_init): New prototype. - (grub_script_fini): New prototype. - (grub_script_break): New prototype. - * script/main.c (grub_script_init): New function. - (grub_script_fini): New function. - * script/execute.c (grub_script_break): New function. - * normal/main.c: Calls to grub_script_{init,fini}. - * util/grub-script-check.c (grub_script_break): New function. + * conf/common.rmk: Rule updates to VasEBoot-script-check. + * include/VasEBoot/misc.h (VasEBoot_min): New function. + * include/VasEBoot/script_sh.h (VasEBoot_script_init): New prototype. + (VasEBoot_script_fini): New prototype. + (VasEBoot_script_break): New prototype. + * script/main.c (VasEBoot_script_init): New function. + (VasEBoot_script_fini): New function. + * script/execute.c (VasEBoot_script_break): New function. + * normal/main.c: Calls to VasEBoot_script_{init,fini}. + * util/VasEBoot-script-check.c (VasEBoot_script_break): New function. - * tests/grub_script_break.in: New testcase. + * tests/VasEBoot_script_break.in: New testcase. * conf/tests.rmk: Rules for new test case. 2010-08-12 BVK Chaitanya - Function parameters support to GRUB script. + Function parameters support to VasEBoot script. * script/yylex.l (VARIABLE): Regular expression update. - * script/function.c (grub_script_function_call): Moved ... - * script/execute.c (grub_script_function_call): ... to here. - (grub_script_execute_arglist_to_argv): Removed. - (grub_script_arglist_to_argv): New function. + * script/function.c (VasEBoot_script_function_call): Moved ... + * script/execute.c (VasEBoot_script_function_call): ... to here. + (VasEBoot_script_execute_arglist_to_argv): Removed. + (VasEBoot_script_arglist_to_argv): New function. * script/argv.c: New file. - (grub_script_argv_free): New function. - (grub_script_argv_next): Likewise. - (grub_script_argv_append): Likewise. - (grub_script_argv_split_append): Likewise. - * include/grub/script_sh.h (grub_script_argv): New struct. - (grub_script_argv_free): New function. - (grub_script_argv_next): Likewise. - (grub_script_argv_append): Likewise. - (grub_script_argv_split_append): Likewise. + (VasEBoot_script_argv_free): New function. + (VasEBoot_script_argv_next): Likewise. + (VasEBoot_script_argv_append): Likewise. + (VasEBoot_script_argv_split_append): Likewise. + * include/VasEBoot/script_sh.h (VasEBoot_script_argv): New struct. + (VasEBoot_script_argv_free): New function. + (VasEBoot_script_argv_next): Likewise. + (VasEBoot_script_argv_append): Likewise. + (VasEBoot_script_argv_split_append): Likewise. * conf/common.rmk (normal.mod): New source script/argv.c. - * tests/grub_script_echo1.in: More tests. - * tests/grub_script_vars1.in: Likewise. - * tests/grub_script_functions.in: New test case. + * tests/VasEBoot_script_echo1.in: More tests. + * tests/VasEBoot_script_vars1.in: Likewise. + * tests/VasEBoot_script_functions.in: New test case. * conf/tests.rmk: Rules for new testcase. 2010-08-12 BVK Chaitanya - Remove grub_script_cmdblock struct. + Remove VasEBoot_script_cmdblock struct. - * include/grub/script_sh.h: Remove grub_script_cmdblock. + * include/VasEBoot/script_sh.h: Remove VasEBoot_script_cmdblock. * script/parser.y: Likewise. * script/execute.c: Rename cmdblock suffix to cmdlist. * script/script.c: Likewise. - * util/grub-script-check.c: Likewise. + * util/VasEBoot-script-check.c: Likewise. 2010-08-11 Yves Blusseau - * .bzrignore: add grub-macho2img + * .bzrignore: add VasEBoot-macho2img 2010-08-11 Vladimir Serbinenko - * kern/i386/qemu/init.c (grub_qemu_init_cirrus): Fix compilation error. + * kern/i386/qemu/init.c (VasEBoot_qemu_init_cirrus): Fix compilation error. 2010-08-11 Vladimir Serbinenko Remove the dump of sm712 initialisation sequence. - * include/grub/pci.h (GRUB_PCI_CLASS_SUBCLASS_VGA): New const. - * include/grub/vga.h (GRUB_VGA_IO_ARX_READ): New register. - (GRUB_VGA_IO_MISC_WRITE): Likewise. - (GRUB_VGA_CR_*): Added many registers. - (GRUB_VGA_SR_*): Likewise. - (GRUB_VGA_GR_*): Likewise. - (grub_vga_write_arx): New function. - (grub_video_hw_config): New struct. - (grub_vga_set_geometry): New function. - * kern/i386/qemu/init.c (load_palette): Use grub_vga_write_arx and - GRUB_PCI_CLASS_SUBCLASS_VGA. - * video/cirrus.c (grub_video_cirrus_setup): Use grub_vga_set_geometry. - * video/sm712.c (grub_sm712_write_reg): New function - (grub_sm712_read_reg): Likewise. - (grub_sm712_sr_write): Likewise. - (grub_sm712_gr_write): Likewise. - (grub_sm712_cr_write): Likewise. - (grub_sm712_write_arx): Likewise. - (grub_sm712_cr_shadow_write): Likewise. - (grub_sm712_write_dda_lookup): Likewise. - (grub_video_sm712_setup): Initialise the video rather then + * include/VasEBoot/pci.h (VasEBoot_PCI_CLASS_SUBCLASS_VGA): New const. + * include/VasEBoot/vga.h (VasEBoot_VGA_IO_ARX_READ): New register. + (VasEBoot_VGA_IO_MISC_WRITE): Likewise. + (VasEBoot_VGA_CR_*): Added many registers. + (VasEBoot_VGA_SR_*): Likewise. + (VasEBoot_VGA_GR_*): Likewise. + (VasEBoot_vga_write_arx): New function. + (VasEBoot_video_hw_config): New struct. + (VasEBoot_vga_set_geometry): New function. + * kern/i386/qemu/init.c (load_palette): Use VasEBoot_vga_write_arx and + VasEBoot_PCI_CLASS_SUBCLASS_VGA. + * video/cirrus.c (VasEBoot_video_cirrus_setup): Use VasEBoot_vga_set_geometry. + * video/sm712.c (VasEBoot_sm712_write_reg): New function + (VasEBoot_sm712_read_reg): Likewise. + (VasEBoot_sm712_sr_write): Likewise. + (VasEBoot_sm712_gr_write): Likewise. + (VasEBoot_sm712_cr_write): Likewise. + (VasEBoot_sm712_write_arx): Likewise. + (VasEBoot_sm712_cr_shadow_write): Likewise. + (VasEBoot_sm712_write_dda_lookup): Likewise. + (VasEBoot_video_sm712_setup): Initialise the video rather then blindly replay the dump. (main) [TEST]: Add a routine to be able to compile as standalone for tests. @@ -26227,54 +26227,54 @@ 2010-08-10 Vladimir Serbinenko - * include/grub/vga.h: Add missing grub/pci.h include. + * include/VasEBoot/vga.h: Add missing VasEBoot/pci.h include. 2010-08-10 Yves Blusseau - * util/grub-macho2img.c (main): fix typo + * util/VasEBoot-macho2img.c (main): fix typo 2010-08-10 Vladimir Serbinenko - * include/grub/vga.h (grub_vga_gr_write): Add GRUB_MACHINE_PCI_IO_BASE. - (grub_vga_gr_read): Likewise. - (grub_vga_cr_write): Likewise. - (grub_vga_cr_read): Likewise. - (grub_vga_sr_write): Likewise. - (grub_vga_sr_read): Likewise. - (grub_vga_palette_read): Likewise. - (grub_vga_palette_write): Likewise. - * video/sm712.c (GRUB_SM712_REG_BASE): New definition. - (grub_sm712_sr_read): New function. - (grub_video_sm712_setup): Use grub_vga_sr_write and grub_sm712_sr_read. - * video/sm712_init.c (sm712_init): Substract GRUB_MACHINE_PCI_IO_BASE. + * include/VasEBoot/vga.h (VasEBoot_vga_gr_write): Add VasEBoot_MACHINE_PCI_IO_BASE. + (VasEBoot_vga_gr_read): Likewise. + (VasEBoot_vga_cr_write): Likewise. + (VasEBoot_vga_cr_read): Likewise. + (VasEBoot_vga_sr_write): Likewise. + (VasEBoot_vga_sr_read): Likewise. + (VasEBoot_vga_palette_read): Likewise. + (VasEBoot_vga_palette_write): Likewise. + * video/sm712.c (VasEBoot_SM712_REG_BASE): New definition. + (VasEBoot_sm712_sr_read): New function. + (VasEBoot_video_sm712_setup): Use VasEBoot_vga_sr_write and VasEBoot_sm712_sr_read. + * video/sm712_init.c (sm712_init): Substract VasEBoot_MACHINE_PCI_IO_BASE. 2010-08-09 Robert Millan - * kern/emu/misc.c (grub_make_system_path_relative_to_its_root): Filter + * kern/emu/misc.c (VasEBoot_make_system_path_relative_to_its_root): Filter out unused variables on non-ZFS build. 2010-08-08 Robert Millan Fix path generation for sub-filesystems in ZFS. - * kern/emu/misc.c (grub_make_system_path_relative_to_its_root): Add + * kern/emu/misc.c (VasEBoot_make_system_path_relative_to_its_root): Add missing slash. 2010-08-08 Robert Millan - * util/grub-fstest.c (read_file, cmd_cmp): Improve error message. + * util/VasEBoot-fstest.c (read_file, cmd_cmp): Improve error message. 2010-08-08 Robert Millan - * util/grub.d/10_kfreebsd.in: When files required for ZFS do not + * util/VasEBoot.d/10_kfreebsd.in: When files required for ZFS do not exist, issue a proper error message (rely on `ls' for translated strings). 2010-08-08 Robert Millan - Fix grub-probe invocation. + Fix VasEBoot-probe invocation. - * util/grub.d/10_kfreebsd.in: s/label/fs_label/g. + * util/VasEBoot.d/10_kfreebsd.in: s/label/fs_label/g. 2010-08-04 Robert Millan @@ -26285,20 +26285,20 @@ [HAVE_SYS_MOUNT_H]: Include `'. [HAVE_LIBZFS && HAVE_LIBNVPAIR] (find_mount_point_from_dir): Remove function. - (grub_find_zpool_from_dir): Use statfs() instead of indirect matching + (VasEBoot_find_zpool_from_dir): Use statfs() instead of indirect matching via find_mount_point_from_dir() and getfsstat() / getmntany(). 2010-08-04 Robert Millan - * include/grub/emu/misc.h (grub_find_mount_point_from_dir) - (grub_find_zpool_from_mount_point): Merge into ... - (grub_find_zpool_from_dir): ... this. + * include/VasEBoot/emu/misc.h (VasEBoot_find_mount_point_from_dir) + (VasEBoot_find_zpool_from_mount_point): Merge into ... + (VasEBoot_find_zpool_from_dir): ... this. * kern/emu/misc.c: Likewise. * kern/emu/misc.c - (grub_make_system_path_relative_to_its_root): Replace - grub_find_mount_point_from_dir() / grub_find_zpool_from_mount_point() - with grub_find_zpool_from_dir(). + (VasEBoot_make_system_path_relative_to_its_root): Replace + VasEBoot_find_mount_point_from_dir() / VasEBoot_find_zpool_from_mount_point() + with VasEBoot_find_zpool_from_dir(). * kern/emu/getroot.c (find_root_device_from_libzfs): Likewise. 2010-08-04 Robert Millan @@ -26307,28 +26307,28 @@ * configure.ac: Check for getmntany(). * kern/emu/misc.c [HAVE_GETMNTANY]: Include `'. - [HAVE_GETMNTANY] (grub_find_zpool_from_mount_point): Add OpenSolaris + [HAVE_GETMNTANY] (VasEBoot_find_zpool_from_mount_point): Add OpenSolaris support. 2010-08-03 Robert Millan - Fix grub-emu build. + Fix VasEBoot-emu build. - * include/grub/util/misc.h: Move `' to ... - * include/grub/emu/misc.h: ... here. + * include/VasEBoot/util/misc.h: Move `' to ... + * include/VasEBoot/emu/misc.h: ... here. - * include/grub/util/misc.h (grub_get_libzfs_handle): Move function ... - * include/grub/emu/misc.h (grub_get_libzfs_handle): ... here. + * include/VasEBoot/util/misc.h (VasEBoot_get_libzfs_handle): Move function ... + * include/VasEBoot/emu/misc.h (VasEBoot_get_libzfs_handle): ... here. - * util/misc.c: Remove `'. + * util/misc.c: Remove `'. [HAVE_LIBZFS] (libzfs_handle, fini_libzfs) - (grub_get_libzfs_handle): Move to ... + (VasEBoot_get_libzfs_handle): Move to ... * kern/emu/misc.c [HAVE_LIBZFS] (__libzfs_handle, fini_libzfs) - (grub_get_libzfs_handle): ... here. + (VasEBoot_get_libzfs_handle): ... here. 2010-08-03 BVK Chaitanya - * script/execute.c (grub_script_execute_cmdline): Check for NULL + * script/execute.c (VasEBoot_script_execute_cmdline): Check for NULL as command name case. 2010-08-02 Colin Watson @@ -26338,7 +26338,7 @@ 2010-08-01 Robert Millan - * util/grub.d/10_kfreebsd.in: Initialize ${kfreebsd_device} as the + * util/VasEBoot.d/10_kfreebsd.in: Initialize ${kfreebsd_device} as the kFreeBSD device name, except on ZFS where the filesystem label is used. (kfreebsd_entry): On ZFS root, load `opensolaris.ko', `zfs.ko' and @@ -26350,48 +26350,48 @@ Make it even harder to use uninitialized `libzfs_handle' (and make the interface a bit simpler). - * include/grub/util/misc.h (grub_util_init_libzfs) + * include/VasEBoot/util/misc.h (VasEBoot_util_init_libzfs) (libzfs_handle): Remove. - (grub_get_libzfs_handle): New prototype. + (VasEBoot_get_libzfs_handle): New prototype. * util/misc.c [HAVE_LIBZFS] (libzfs_handle): Add `static' attribute. - (grub_util_init_libzfs): Remove. - (grub_get_libzfs_handle): New function. + (VasEBoot_util_init_libzfs): Remove. + (VasEBoot_get_libzfs_handle): New function. * kern/emu/getroot.c (find_root_device_from_libzfs): Use - grub_get_libzfs_handle() to obtain a libzfs handle instead of + VasEBoot_get_libzfs_handle() to obtain a libzfs handle instead of accessing `libzfs_handle' directly. 2010-08-01 Robert Millan - * include/grub/emu/misc.h (grub_find_mount_point_from_dir) - (grub_find_zpool_from_mount_point): New function prototypes. + * include/VasEBoot/emu/misc.h (VasEBoot_find_mount_point_from_dir) + (VasEBoot_find_zpool_from_mount_point): New function prototypes. * kern/emu/getroot.c [HAVE_GETFSSTAT]: Move `' to ... * kern/emu/misc.c [HAVE_GETFSSTAT]: ... here. * kern/emu/getroot.c (find_mount_point_from_dir): Move to ... - * kern/emu/misc.c (grub_find_mount_point_from_dir): ... this. Remove + * kern/emu/misc.c (VasEBoot_find_mount_point_from_dir): ... this. Remove `static' attribute. * kern/emu/getroot.c (find_root_device_from_libzfs): Split code for finding zpool from mount point into ... - * kern/emu/misc.c (grub_find_zpool_from_mount_point): ... this. + * kern/emu/misc.c (VasEBoot_find_zpool_from_mount_point): ... this. - * kern/emu/misc.c (grub_make_system_path_relative_to_its_root): When + * kern/emu/misc.c (VasEBoot_make_system_path_relative_to_its_root): When requested path is part of a ZFS pool, use - grub_find_zpool_from_mount_point() to detect its filesystem name, + VasEBoot_find_zpool_from_mount_point() to detect its filesystem name, and generate a path with `/fsname@path' syntax. 2010-08-01 Colin Watson - * include/grub/util/libzfs.h (libzfs_init): Set argument list to + * include/VasEBoot/util/libzfs.h (libzfs_init): Set argument list to (void) rather than () so that this is a proper prototype. 2010-08-01 Vladimir Serbinenko - * lib/arg.c (grub_arg_show_help): Add the necessary spacing. + * lib/arg.c (VasEBoot_arg_show_help): Add the necessary spacing. 2010-08-01 Vladimir Serbinenko @@ -26400,7 +26400,7 @@ 2010-08-01 Colin Watson - * util/grub-mkrescue.in: Remove ${efi_dir} after building efi.img. + * util/VasEBoot-mkrescue.in: Remove ${efi_dir} after building efi.img. 2010-08-01 Colin Watson @@ -26408,9 +26408,9 @@ 2010-08-01 Colin Watson - * docs/grub.texi (Simple configuration): Document GRUB_CMDLINE_XEN - and GRUB_CMDLINE_XEN_DEFAULT. Recommend setting - GRUB_GFXPAYLOAD_LINUX=text rather than unsetting it in order to + * docs/VasEBoot.texi (Simple configuration): Document VasEBoot_CMDLINE_XEN + and VasEBoot_CMDLINE_XEN_DEFAULT. Recommend setting + VasEBoot_GFXPAYLOAD_LINUX=text rather than unsetting it in order to disable gfxpayload. (Shell-like scripting): Add real content. (Serial terminal): Suggest `terminal_input serial; terminal_output @@ -26423,49 +26423,49 @@ 2010-08-01 Vladimir Serbinenko 2010-08-01 Colin Watson - * kern/misc.c (grub_memset): Optimise to reduce cache stalls. + * kern/misc.c (VasEBoot_memset): Optimise to reduce cache stalls. 2010-08-01 Robert Millan - * include/grub/emu/misc.h (grub_find_mount_point_from_dir) - (grub_find_zpool_from_mount_point): New function prototypes. + * include/VasEBoot/emu/misc.h (VasEBoot_find_mount_point_from_dir) + (VasEBoot_find_zpool_from_mount_point): New function prototypes. * kern/emu/getroot.c [HAVE_GETFSSTAT]: Move `' to ... * kern/emu/misc.c [HAVE_GETFSSTAT]: ... here. * kern/emu/getroot.c (find_mount_point_from_dir): Move to ... - * kern/emu/misc.c (grub_find_mount_point_from_dir): ... this. Remove + * kern/emu/misc.c (VasEBoot_find_mount_point_from_dir): ... this. Remove `static' attribute. * kern/emu/getroot.c (find_root_device_from_libzfs): Split code for finding zpool from mount point into ... - * kern/emu/misc.c (grub_find_zpool_from_mount_point): ... this. + * kern/emu/misc.c (VasEBoot_find_zpool_from_mount_point): ... this. - * kern/emu/misc.c (grub_make_system_path_relative_to_its_root): When + * kern/emu/misc.c (VasEBoot_make_system_path_relative_to_its_root): When requested path is part of a ZFS pool, use - grub_find_zpool_from_mount_point() to detect its filesystem name, + VasEBoot_find_zpool_from_mount_point() to detect its filesystem name, and generate a path with `/fsname@path' syntax. 2010-08-01 Robert Millan Prevent accidental use of uninitialized libzfs_handle. - * util/grub-probe.c (main): Move grub_util_init_libzfs() call to ... + * util/VasEBoot-probe.c (main): Move VasEBoot_util_init_libzfs() call to ... * kern/emu/getroot.c (find_root_device_from_libzfs): ... here. - * util/misc.c (grub_util_init_libzfs): Make this function idempotent. + * util/misc.c (VasEBoot_util_init_libzfs): Make this function idempotent. 2010-08-01 Colin Watson - * util/grub.d/20_linux_xen.in: Don't use UUID for LVM root (matching - util/grub.d/10_linux.in). Fixes Debian bug #591093. + * util/VasEBoot.d/20_linux_xen.in: Don't use UUID for LVM root (matching + util/VasEBoot.d/10_linux.in). Fixes Debian bug #591093. 2010-08-01 Robert Millan - * kern/emu/getroot.c: Include `'. + * kern/emu/getroot.c: Include `'. 2010-07-31 Robert Millan - * util/grub.d/10_kfreebsd.in: Make module handling more generic. + * util/VasEBoot.d/10_kfreebsd.in: Make module handling more generic. 2010-07-31 Robert Millan @@ -26475,76 +26475,76 @@ * configure.ac: Check for `libzfs.h' and `libnvpair.h'. - * include/grub/util/libnvpair.h: Include `'. + * include/VasEBoot/util/libnvpair.h: Include `'. [HAVE_LIBNVPAIR_H]: Include `' instead of declaring libnvpair prototypes ourselves. - * include/grub/util/libzfs.h: Include `'. + * include/VasEBoot/util/libzfs.h: Include `'. [HAVE_LIBZFS_H]: Include `' instead of declaring libzfs prototypes ourselves. (libzfs_handle): Moved to ... - * include/grub/util/misc.h (libzfs_handle): ... here. - Include `'. + * include/VasEBoot/util/misc.h (libzfs_handle): ... here. + Include `'. 2010-07-30 Robert Millan - * include/grub/emu/misc.h: Add missing license header. + * include/VasEBoot/emu/misc.h: Add missing license header. 2010-07-30 Robert Millan - Enable `grub-probe -t device' resolution on ZFS. + Enable `VasEBoot-probe -t device' resolution on ZFS. * configure.ac: Check for getfsstat(), libzfs and libnvpair. - * include/grub/util/libnvpair.h: New file. - * include/grub/util/libzfs.h: New file. + * include/VasEBoot/util/libnvpair.h: New file. + * include/VasEBoot/util/libzfs.h: New file. * kern/emu/getroot.c: Include `' and `'. - [HAVE_LIBZFS && HAVE_LIBNVPAIR]: Include `' and - `'. + [HAVE_LIBZFS && HAVE_LIBNVPAIR]: Include `' and + `'. [HAVE_GETFSSTAT]: Include `'. (find_mount_point_from_dir): New static function. [HAVE_LIBZFS && HAVE_LIBNVPAIR] (find_root_device_from_libzfs): New function. - [HAVE_LIBZFS && HAVE_LIBNVPAIR] (grub_guess_root_device): Use + [HAVE_LIBZFS && HAVE_LIBNVPAIR] (VasEBoot_guess_root_device): Use find_root_device_from_libzfs() before ressorting to find_root_device(). - * include/grub/util/misc.h (grub_util_init_libzfs): New function + * include/VasEBoot/util/misc.h (VasEBoot_util_init_libzfs): New function prototype. - * util/misc.c: Include `'. - (grub_util_init_libzfs): New function. + * util/misc.c: Include `'. + (VasEBoot_util_init_libzfs): New function. [HAVE_LIBZFS] (libzfs_handle): New global variable. [HAVE_LIBZFS] (fini_libzfs): New static function. - (grub_util_init_libzfs): New function. - * util/grub-probe.c (main): Call grub_util_init_libzfs(). + (VasEBoot_util_init_libzfs): New function. + * util/VasEBoot-probe.c (main): Call VasEBoot_util_init_libzfs(). 2010-07-30 Robert Millan - * include/grub/emu/misc.h (grub_make_system_path_relative_to_its_root) + * include/VasEBoot/emu/misc.h (VasEBoot_make_system_path_relative_to_its_root) (xmalloc, xrealloc, xstrdup, xasprintf): Add `warn_unused_result' attribute. - * include/grub/misc.h (grub_strdup, grub_strndup, grub_strlen) - (grub_xasprintf, grub_xvasprintf): Likewise. - * include/grub/emu/misc.h (xasprintf): Remove duplicate prototype. + * include/VasEBoot/misc.h (VasEBoot_strdup, VasEBoot_strndup, VasEBoot_strlen) + (VasEBoot_xasprintf, VasEBoot_xvasprintf): Likewise. + * include/VasEBoot/emu/misc.h (xasprintf): Remove duplicate prototype. 2010-07-29 Robert Millan - * util/grub-probe.c (PRINT_FS_LABEL): New enum value. + * util/VasEBoot-probe.c (PRINT_FS_LABEL): New enum value. (probe): Handle `PRINT_FS_LABEL'. (main): Handle `-t fs_label'. 2010-07-29 Robert Millan - * configure.ac: Remove grub-mkisofs checks. + * configure.ac: Remove VasEBoot-mkisofs checks. 2010-07-28 Vladimir Serbinenko - * util/ieee1275/grub-install.in: Don't use empty grub_device. + * util/ieee1275/VasEBoot-install.in: Don't use empty VasEBoot_device. Reported by: Lennart Sorensen. 2010-07-20 Vladimir Serbinenko - * util/grub.d/00_header.in: Remove compatibility with terminal.mod + * util/VasEBoot.d/00_header.in: Remove compatibility with terminal.mod prior to terminal_input/terminal_output separation. It's been over 1.5 years and those versions weren't widely deployed. @@ -26556,51 +26556,51 @@ 2010-07-20 Colin Watson - * bus/usb/emu/usb.c (grub_usb_poll_devices): Add a dummy - implementation of this so that grub-emu links again, with a note + * bus/usb/emu/usb.c (VasEBoot_usb_poll_devices): Add a dummy + implementation of this so that VasEBoot-emu links again, with a note that this should support hotplugging in the future. 2010-07-20 Colin Watson - * kern/emu/getroot.c (grub_util_get_grub_dev): Use xasprintf. + * kern/emu/getroot.c (VasEBoot_util_get_VasEBoot_dev): Use xasprintf. 2010-07-20 Colin Watson - * disk/loopback.c (grub_cmd_loopback): Don't leak a grub_file_t + * disk/loopback.c (VasEBoot_cmd_loopback): Don't leak a VasEBoot_file_t handle on failure. - (grub_loopback_close): Remove empty function. - (grub_loopback_dev): Remove close method. + (VasEBoot_loopback_close): Remove empty function. + (VasEBoot_loopback_dev): Remove close method. 2010-07-20 Colin Watson Disable EFI cursor when the EFI console becomes inactive. - * term/efi/console.c (grub_efi_console_init): New function. - (grub_efi_console_fini): New function. - (grub_console_term_output): Register init and fini methods. + * term/efi/console.c (VasEBoot_efi_console_init): New function. + (VasEBoot_efi_console_fini): New function. + (VasEBoot_console_term_output): Register init and fini methods. 2010-07-20 Vladimir Serbinenko - * tests/util/grub-shell-tester.in: Remove bashism and declare as + * tests/util/VasEBoot-shell-tester.in: Remove bashism and declare as sh script. 2010-07-20 Vladimir Serbinenko - * disk/loopback.c (grub_loopback): Replace filename with file. + * disk/loopback.c (VasEBoot_loopback): Replace filename with file. (delete_loopback): Handle new semantics. - (grub_cmd_loopback): Likewise. - (grub_loopback_iterate): Likewise. - (grub_loopback_close): Likewise. + (VasEBoot_cmd_loopback): Likewise. + (VasEBoot_loopback_iterate): Likewise. + (VasEBoot_loopback_close): Likewise. 2010-07-20 Vladimir Serbinenko - * util/i386/efi/grub-install.in: Revert to platform-specific behaviour + * util/i386/efi/VasEBoot-install.in: Revert to platform-specific behaviour with -p "". Reported by: Tito Keitel. 2010-07-20 Vladimir Serbinenko - * docs/grub.texi (Naming convention): Document new naming convention. + * docs/VasEBoot.texi (Naming convention): Document new naming convention. 2010-07-20 Vadim Solomin 2010-07-20 Colin Watson @@ -26612,7 +26612,7 @@ (compare_devices): ... this. Sort by kernel name in preference to the stable by-id name, but keep the latter as a fallback comparison. Update header comment. - (grub_util_iterate_devices) [__linux__]: Construct and sort an array + (VasEBoot_util_iterate_devices) [__linux__]: Construct and sort an array of `struct device' rather than of plain file names. 2010-07-20 Thomas Frauendorfer @@ -26631,49 +26631,49 @@ * disk/raid.c (insert_array): Use md/%s to name mdadm 1.x devices, removing the homehost if present. * kern/emu/getroot.c (get_mdadm_name) [__linux__]: New function. - (grub_util_get_grub_dev): Use md/%s to name mdadm 1.x devices, + (VasEBoot_util_get_VasEBoot_dev): Use md/%s to name mdadm 1.x devices, removing the homehost if present. - (grub_util_get_grub_dev) [__linux__]: Get the array name from mdadm + (VasEBoot_util_get_VasEBoot_dev) [__linux__]: Get the array name from mdadm if possible. - * util/i386/pc/grub-setup.c (main): Handle md/* devices. + * util/i386/pc/VasEBoot-setup.c (main): Handle md/* devices. - * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Add start_sector + * disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Add start_sector parameter. Set its pointer target to 0. - * disk/mdraid_linux.c (grub_mdraid_detect): Add start_sector + * disk/mdraid_linux.c (VasEBoot_mdraid_detect): Add start_sector parameter. Set its pointer target to 0 for 0.9 metadata, or to the `data_offset' value from the superblock for 1.x metadata. - * disk/raid.c (grub_raid_read): Offset reads by the start sector of + * disk/raid.c (VasEBoot_raid_read): Offset reads by the start sector of data on the device. (insert_array): Record the start sector of data on the device. - (grub_raid_register): Pass start_sector parameters to - grub_raid_list->detect and insert_array. - * include/grub/raid.h (struct grub_raid_array): Add start_sector + (VasEBoot_raid_register): Pass start_sector parameters to + VasEBoot_raid_list->detect and insert_array. + * include/VasEBoot/raid.h (struct VasEBoot_raid_array): Add start_sector member. - (struct grub_raid): Add start_sector parameter to `detect'. + (struct VasEBoot_raid): Add start_sector parameter to `detect'. - * disk/mdraid_linux.c (struct grub_raid_super_1x): Remove + * disk/mdraid_linux.c (struct VasEBoot_raid_super_1x): Remove __attribute__ ((packed)), leaving a comment. - (grub_mdraid_detect): Split out 0.9 and 1.x detection to ... - (grub_mdraid_detect_09): ... here and ... - (grub_mdraid_detect_1x): ... here. + (VasEBoot_mdraid_detect): Split out 0.9 and 1.x detection to ... + (VasEBoot_mdraid_detect_09): ... here and ... + (VasEBoot_mdraid_detect_1x): ... here. 2010-07-20 Peter Henn - * disk/mdraid_linux.c (grub_mdraid_detect): Fix calculation of 1.x + * disk/mdraid_linux.c (VasEBoot_mdraid_detect): Fix calculation of 1.x chunk size and disk size, which are already given as sector counts as distinct from the 0.90 units. Fetch the correct device number from the role table instead of using the table index. 2010-07-20 Felix Zielcke - * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Set array->name to NULL. - * disk/mdraid_linux.c (grub_raid_super_1x): New structure. + * disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Set array->name to NULL. + * disk/mdraid_linux.c (VasEBoot_raid_super_1x): New structure. (WriteMostly1): New macro. Set array->name to NULL for metadata format 0.90. Add support for metadata 1.x. Fix some comments. * disk/raid.c (): Add support for name based RAID arrays. Fix a few comments. - * util/getroot.c (grub_util_get_grub_dev): Add support for + * util/getroot.c (VasEBoot_util_get_VasEBoot_dev): Add support for /dev/md/name style devices. 2010-07-20 Colin Watson @@ -26688,79 +26688,79 @@ Hotplugging and USB hub support. - * bus/usb/ohci.c (grub_ohci_td): Add convenience fields. - (grub_ohci): Likewise. - (GRUB_OHCI_REG_CONTROL_BULK_ENABLE): New definition. - (GRUB_OHCI_REG_CONTROL_CONTROL_ENABLE): Likewise. - (GRUB_OHCI_RESET_CONNECT_CHANGE): Likewise. - (GRUB_OHCI_CTRL_EDS): Likewise. - (GRUB_OHCI_BULK_EDS): Likewise. - (GRUB_OHCI_TDS): Likewise. - (GRUB_OHCI_ED_ADDR_MASK): Likewise. - (grub_ohci_ed_phys2virt): New function. - (grub_ohci_virt_to_phys): Likewise. - (grub_ohci_td_phys2virt): Likewise. - (grub_ohci_td_virt2phys): Likewise. - (grub_ohci_pci_iter): Allocate memory and don't wait for stable + * bus/usb/ohci.c (VasEBoot_ohci_td): Add convenience fields. + (VasEBoot_ohci): Likewise. + (VasEBoot_OHCI_REG_CONTROL_BULK_ENABLE): New definition. + (VasEBoot_OHCI_REG_CONTROL_CONTROL_ENABLE): Likewise. + (VasEBoot_OHCI_RESET_CONNECT_CHANGE): Likewise. + (VasEBoot_OHCI_CTRL_EDS): Likewise. + (VasEBoot_OHCI_BULK_EDS): Likewise. + (VasEBoot_OHCI_TDS): Likewise. + (VasEBoot_OHCI_ED_ADDR_MASK): Likewise. + (VasEBoot_ohci_ed_phys2virt): New function. + (VasEBoot_ohci_virt_to_phys): Likewise. + (VasEBoot_ohci_td_phys2virt): Likewise. + (VasEBoot_ohci_td_virt2phys): Likewise. + (VasEBoot_ohci_pci_iter): Allocate memory and don't wait for stable attachment. - (grub_ohci_find_ed): New function. - (grub_ohci_alloc_td): Likewise. - (grub_ohci_free_td): Likewise. - (grub_ohci_free_tds): Likewise. - (grub_ohci_transfer): Use previously allocated memory. - (grub_ohci_portstatus): Reset status changed bit. - (grub_ohci_detect_dev): Supply status changed. - (grub_ohci_fini_hw): Free memory. - (grub_ohci_restore_hw): Reallocate memory. - * bus/usb/uhci.c (grub_uhci_portstatus): Don't reset on disable. + (VasEBoot_ohci_find_ed): New function. + (VasEBoot_ohci_alloc_td): Likewise. + (VasEBoot_ohci_free_td): Likewise. + (VasEBoot_ohci_free_tds): Likewise. + (VasEBoot_ohci_transfer): Use previously allocated memory. + (VasEBoot_ohci_portstatus): Reset status changed bit. + (VasEBoot_ohci_detect_dev): Supply status changed. + (VasEBoot_ohci_fini_hw): Free memory. + (VasEBoot_ohci_restore_hw): Reallocate memory. + * bus/usb/uhci.c (VasEBoot_uhci_portstatus): Don't reset on disable. Reset status change. - (grub_uhci_detect_dev): Supply status_change. + (VasEBoot_uhci_detect_dev): Supply status_change. * bus/usb/usb.c (attach_hooks): New var. - (grub_usb_device_attach): New function. - (grub_usb_register_attach_hook_class): Likewise. - (grub_usb_unregister_attach_hook_class): Likewise. - * bus/usb/usbhub.c (grub_usb_hub_add_dev): Handle errors correctly. - (grub_usb_add_hub): Reset connection changed bit. + (VasEBoot_usb_device_attach): New function. + (VasEBoot_usb_register_attach_hook_class): Likewise. + (VasEBoot_usb_unregister_attach_hook_class): Likewise. + * bus/usb/usbhub.c (VasEBoot_usb_hub_add_dev): Handle errors correctly. + (VasEBoot_usb_add_hub): Reset connection changed bit. (attach_root_port): New function. - (grub_usb_root_hub): Likewise. + (VasEBoot_usb_root_hub): Likewise. (poll_nonroot_hub): Likewise. - (grub_usb_poll_devices): Likewise. - * commands/usbtest.c (grub_cmd_usbtest): Poll devices before listing. - * disk/usbms.c (grub_usbms_open): Use device hooks. - (grub_usbms_iterate) :Poll devices. - (grub_usbms_finddevs): Split into ... - (grub_usbms_attach): ... this ... - (grub_usbms_attach): ... and this. - * include/grub/usb.h (grub_usb_controller_dev): Supply status_changed + (VasEBoot_usb_poll_devices): Likewise. + * commands/usbtest.c (VasEBoot_cmd_usbtest): Poll devices before listing. + * disk/usbms.c (VasEBoot_usbms_open): Use device hooks. + (VasEBoot_usbms_iterate) :Poll devices. + (VasEBoot_usbms_finddevs): Split into ... + (VasEBoot_usbms_attach): ... this ... + (VasEBoot_usbms_attach): ... and this. + * include/VasEBoot/usb.h (VasEBoot_usb_controller_dev): Supply status_changed in detect_dev. - (grub_usb_interface): New fields attached and detach_hook. - (grub_usb_attach_hook_class): New type. - (grub_usb_attach_desc): New struct. - (grub_usb_register_attach_hook_class): New function. - (grub_usb_unregister_attach_hook_class): Likewise. - (grub_usb_poll_devices): Likewise. - (grub_usb_device_attach): Likewise. - * include/grub/usbtrans.h (GRUB_USB_HUB_FEATURE_C_CONNECTED): New const. - (GRUB_USB_HUB_STATUS_C_CONNECTED): Likewise. + (VasEBoot_usb_interface): New fields attached and detach_hook. + (VasEBoot_usb_attach_hook_class): New type. + (VasEBoot_usb_attach_desc): New struct. + (VasEBoot_usb_register_attach_hook_class): New function. + (VasEBoot_usb_unregister_attach_hook_class): Likewise. + (VasEBoot_usb_poll_devices): Likewise. + (VasEBoot_usb_device_attach): Likewise. + * include/VasEBoot/usbtrans.h (VasEBoot_USB_HUB_FEATURE_C_CONNECTED): New const. + (VasEBoot_USB_HUB_STATUS_C_CONNECTED): Likewise. 2010-07-17 Vladimir Serbinenko - * include/grub/bsdlabel.h (GRUB_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION): New definition. + * include/VasEBoot/bsdlabel.h (VasEBoot_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION): New definition. * partmap/bsdlabel.c (bsdlabel_partition_map_iterate): Use FreeBSD delta determination style. Works with most NetBSD partitions too. 2010-07-17 Vladimir Serbinenko - * kern/partition.c [GRUB_UTIL]: Add missing util/misc.h inclusion. - * partmap/bsdlabel.c [GRUB_UTIL]: Likewise. + * kern/partition.c [VasEBoot_UTIL]: Add missing util/misc.h inclusion. + * partmap/bsdlabel.c [VasEBoot_UTIL]: Likewise. 2010-07-17 Vladimir Serbinenko - * disk/scsi.c (grub_scsi_open): Fix incorrect pointer dereference. + * disk/scsi.c (VasEBoot_scsi_open): Fix incorrect pointer dereference. 2010-07-14 Anton Blanchard - * loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Do not reject + * loader/powerpc/ieee1275/linux.c (VasEBoot_cmd_linux): Do not reject ET_DYN files. 2010-07-14 Grégoire Sutre @@ -26769,13 +26769,13 @@ 2010-07-14 Grégoire Sutre - * kern/partition.c (grub_partition_check_containment): New function to + * kern/partition.c (VasEBoot_partition_check_containment): New function to check that a partition is physically contained in a parent. Since offsets are relative (and non-negative), this reduces to checking that the partition ends before its parent. - (grub_partition_map_probe): Discard out-of-range sub-partitions. - (grub_partition_iterate): Likewise. - * include/grub/partition.h (grub_partition_map): Slightly more detailed + (VasEBoot_partition_map_probe): Discard out-of-range sub-partitions. + (VasEBoot_partition_iterate): Likewise. + * include/VasEBoot/partition.h (VasEBoot_partition_map): Slightly more detailed comments. * partmap/bsdlabel.c (bsdlabel_partition_map_iterate): Discard partitions that start before their parent, and add debug printfs. @@ -26808,20 +26808,20 @@ Restructure SCSI .id handling. Reported and tested by: Aleš Nesrsta. - * disk/ata.c (grub_atapi_close): Removed. All users updated. - (grub_atapi_dev): Changed .name to "ata". New field .id. - * disk/usbms.c (grub_usbms_close): Removed. All users updated. - (grub_usbms_dev): New field .id. - * disk/scsi.c (grub_scsi_iterate): Generate name. - (grub_scsi_open): Parse name. - * include/grub/scsi.h (grub_make_scsi_id): New function. - (grub_scsi_dev): Change iterate and open to number instead of naming + * disk/ata.c (VasEBoot_atapi_close): Removed. All users updated. + (VasEBoot_atapi_dev): Changed .name to "ata". New field .id. + * disk/usbms.c (VasEBoot_usbms_close): Removed. All users updated. + (VasEBoot_usbms_dev): New field .id. + * disk/scsi.c (VasEBoot_scsi_iterate): Generate name. + (VasEBoot_scsi_open): Parse name. + * include/VasEBoot/scsi.h (VasEBoot_make_scsi_id): New function. + (VasEBoot_scsi_dev): Change iterate and open to number instead of naming busses. All users updated. - (grub_scsi): Remove name. Add .bus. + (VasEBoot_scsi): Remove name. Add .bus. 2010-07-10 Vladimir Serbinenko - * commands/help.c (grub_cmd_help): Fix a typo. + * commands/help.c (VasEBoot_cmd_help): Fix a typo. 2010-07-10 Vladimir Serbinenko @@ -26830,24 +26830,24 @@ 2010-07-10 Vladimir Serbinenko - * util/grub-mkrescue.in: Don't use tar GNU-ism since it's not necessary + * util/VasEBoot-mkrescue.in: Don't use tar GNU-ism since it's not necessary in this context. 2010-07-07 Vladimir Serbinenko - * tests/util/grub-shell.in: Remove bashisms and declare as sh script. + * tests/util/VasEBoot-shell.in: Remove bashisms and declare as sh script. 2010-07-07 Colin Watson - * term/gfxterm.c (grub_gfxterm_background_image_cmd): Fix + * term/gfxterm.c (VasEBoot_gfxterm_background_image_cmd): Fix indentation. 2010-07-06 Colin Watson - * conf/common.rmk (grub_probe_SOURCES): Add disk/raid5_recover.c + * conf/common.rmk (VasEBoot_probe_SOURCES): Add disk/raid5_recover.c and disk/raid6_recover.c. - * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_setup_SOURCES): Likewise. 2010-07-06 Colin Watson @@ -26858,7 +26858,7 @@ 2010-07-06 Colin Watson - * util/deviceiter.c (grub_util_iterate_devices): Skip MD devices, + * util/deviceiter.c (VasEBoot_util_iterate_devices): Skip MD devices, which we expect to be handled by upper layers. 2010-07-06 BVK Chaitanya @@ -26867,26 +26867,26 @@ 2010-07-06 Colin Watson - * fs/reiserfs.c (grub_reiserfs_iterate_dir): Zero out first byte of + * fs/reiserfs.c (VasEBoot_reiserfs_iterate_dir): Zero out first byte of entry_name also for entries without stat blocks (e.g. ".."); fixes corruption of the first entry in a directory. 2010-07-06 Colin Watson - * util/grub.d/00_header.in: Process GRUB_THEME and GRUB_BACKGROUND - after setting gfxterm as the active terminal. GRUB_BACKGROUND + * util/VasEBoot.d/00_header.in: Process VasEBoot_THEME and VasEBoot_BACKGROUND + after setting gfxterm as the active terminal. VasEBoot_BACKGROUND doesn't work otherwise. 2010-07-05 Colin Watson - * docs/grub.texi (Features): Update list of supported file systems. - (GNU/Linux): Update for GRUB 2. + * docs/VasEBoot.texi (Features): Update list of supported file systems. + (GNU/Linux): Update for VasEBoot 2. (Serial terminal): Remove mention of --disable-serial, which was a - GRUB Legacy configure option. Update instructions to use + VasEBoot Legacy configure option. Update instructions to use `terminal_input' and `terminal_output' rather than `terminal'. (Vendor power-on keys): Copy-edit. Add cross-references to `Simple - configuration' and `Installing GRUB using grub-install'. - (Menu entry editor): Update for GRUB 2. + configuration' and `Installing VasEBoot using VasEBoot-install'. + (Menu entry editor): Update for VasEBoot 2. (terminfo): Add vt100-color, ieee1275, and dumb terminal types. Document new -a, -u, and -v options. (initrd): New section. @@ -26894,7 +26894,7 @@ (linux): New section. (linux16): New section. (search): The `var' argument to `--set' is optional. - (GRUB only offers a rescue shell): Go into a little more detail on + (VasEBoot only offers a rescue shell): Go into a little more detail on drive ordering. 2010-07-05 Colin Watson @@ -26908,7 +26908,7 @@ 2010-07-05 Colin Watson - * util/i386/pc/grub-setup.c (setup): Rename prefix to + * util/i386/pc/VasEBoot-setup.c (setup): Rename prefix to install_prefix, in line with install_dos_part and install_bsd_part. Add new prefix variable, which is copied to install_prefix after comparing core.img in memory with the one read from disk in the @@ -26920,7 +26920,7 @@ 2010-07-04 Grégoire Sutre * configure.ac: Avoid == in test command, it's not portable. - * util/grub.d/30_os-prober.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. 2010-07-04 Colin Watson @@ -26928,12 +26928,12 @@ 2010-07-04 Grégoire Sutre - * util/i386/pc/grub-setup.c (setup): Do not embed when there are + * util/i386/pc/VasEBoot-setup.c (setup): Do not embed when there are multiple (top-level) partmaps. 2010-07-02 Vladimir Serbinenko - * util/i386/efi/grub-install.in: Don't use empty grub_device. + * util/i386/efi/VasEBoot-install.in: Don't use empty VasEBoot_device. Reported by: Tino Keitel. 2010-07-02 Vladimir Serbinenko @@ -26944,20 +26944,20 @@ (widthspec.h): Likewise. (TARGET_CFLAGS): Add -DHAVE_UNIFONT_WIDTHSPEC=1 if font was available. * autogen.sh: Generate unidata.c. - * commands/cat.c (grub_cmd_cat): Don't use grub_putchar. - * commands/ls.c (grub_ls_list_devices): Likewise. - (grub_ls_list_files): Likewise. - * commands/minicmd.c (grub_mini_cmd_cat): Likewise. - (grub_mini_cmd_lsmod): Likewise. + * commands/cat.c (VasEBoot_cmd_cat): Don't use VasEBoot_putchar. + * commands/ls.c (VasEBoot_ls_list_devices): Likewise. + (VasEBoot_ls_list_files): Likewise. + * commands/minicmd.c (VasEBoot_mini_cmd_cat): Likewise. + (VasEBoot_mini_cmd_lsmod): Likewise. * commands/read.c: Likewise. - * kern/corecmd.c (grub_core_cmd_ls): Likewise. - * kern/rescue_reader.c (grub_rescue_read_line): Likewise. - * lib/arg.c (grub_arg_show_help): Likewise. - * lib/crypto.c (grub_password_get): Likewise. - * normal/auth.c (grub_username_get): Likewise. - * normal/misc.c (grub_normal_print_device_info): Likewise. - * commands/help.c (grub_cmd_help): Use grub_unicode_aglomerate_comb. - * conf/common.rmk (grub_mkfont_SOURCES): Add unidata.c. + * kern/corecmd.c (VasEBoot_core_cmd_ls): Likewise. + * kern/rescue_reader.c (VasEBoot_rescue_read_line): Likewise. + * lib/arg.c (VasEBoot_arg_show_help): Likewise. + * lib/crypto.c (VasEBoot_password_get): Likewise. + * normal/auth.c (VasEBoot_username_get): Likewise. + * normal/misc.c (VasEBoot_normal_print_device_info): Likewise. + * commands/help.c (VasEBoot_cmd_help): Use VasEBoot_unicode_aglomerate_comb. + * conf/common.rmk (VasEBoot_mkfont_SOURCES): Add unidata.c. (gfxmenu_mod_SOURCES): Add gfxmenu/font.c. (normal/charset.c_DEPENDENCIES): New variable. (normal_mod_SOURCES): Add normal/charset.c and unidata.c. @@ -26973,96 +26973,96 @@ (kernel_img_HEADERS): Add terminfo.h. * font/font.c (ascii_glyph_lookup): Return NULL on failure. Fill ->font. Reverse ascii bitmaps. - (grub_font_get_xheight): New function. - * font/font.c (grub_font_get_string_width): Moved from here ... - * gfxmenu/font.c (grub_font_get_string_width): ... here. - * font/font.c (grub_font_draw_string): Moved from here ... - * gfxmenu/font.c (grub_font_draw_string): ... here. - * font/font.c (grub_font_dup_glyph): New function. - (grub_font_blit_glyph): Likewise. - (grub_font_blit_glyph_mirror): Likewise. + (VasEBoot_font_get_xheight): New function. + * font/font.c (VasEBoot_font_get_string_width): Moved from here ... + * gfxmenu/font.c (VasEBoot_font_get_string_width): ... here. + * font/font.c (VasEBoot_font_draw_string): Moved from here ... + * gfxmenu/font.c (VasEBoot_font_draw_string): ... here. + * font/font.c (VasEBoot_font_dup_glyph): New function. + (VasEBoot_font_blit_glyph): Likewise. + (VasEBoot_font_blit_glyph_mirror): Likewise. (blit_comb): Likewise. - (grub_font_construct_dry_run): Likewise. - (grub_font_get_constructed_device_width): Likewise. - (grub_font_construct_glyph): Likewise. - * include/grub/charset.h (grub_ucs4_to_utf8): New proto. - * include/grub/misc.h (grub_utf8_to_ucs4): Moved from here ... - * include/grub/charset.h (grub_utf8_to_ucs4): ... here. - * include/grub/font.h (GRUB_FONT_CODE_CHAR_MASK): New constant. - (GRUB_FONT_CODE_RIGHT_JOINED): Likewise. - (GRUB_FONT_CODE_LEFT_JOINED): Likewise. - (grub_font_get_xheight): New proto. - (grub_font_get_constructed_device_width): Likewise. - (grub_font_construct_glyph): Likewise. - * include/grub/font.h (grub_font_get_string_width): Moved from here ... - * include/grub/gfxmenu_view.h (grub_font_get_string_width): ... here. - * include/grub/font.h (grub_font_draw_string): Moved from here ... - * include/grub/gfxmenu_view.h (grub_font_draw_string): ... here. - * include/grub/i386/vga_common.h (grub_console_putchar): Moved from here.. - * include/grub/i386/pc/console.h (grub_console_putchar): ... here. - * include/grub/i386/vga_common.h (grub_console_real_putchar): Removed. - (grub_console_getcharwidth): Likewise. - * include/grub/misc.h (grub_xputs): New proto. - (grub_puts): Inlined. - * include/grub/normal.h (grub_print_ucs4): Add margin specification. - (grub_normal_get_line_counter): Removed. - (grub_install_newline_hook): Likewise. - (grub_normal_get_char_counter): New proto. - (grub_normal_reset_more): Likewise. - (grub_xputs_normal): Likewise. - * include/grub/powerpc/ieee1275/console.h: Removed. - * include/grub/sparc64/ieee1275/console.h: Likewise. - * include/grub/term.h (GRUB_TERM_CODE_TYPE_MASK): New definition. - (GRUB_TERM_CODE_TYPE_ASCII): Likewise. - (GRUB_TERM_CODE_TYPE_CP437): Likewise. - (GRUB_TERM_CODE_TYPE_UTF8_LOGICAL): Likewise. - (GRUB_TERM_CODE_TYPE_UTF8_VISUAL): Likewise. - (GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS): Likewise. - (grub_term_input): Pass reference to self. All users updated. - (grub_term_output): Pass grub_unicode_glyph to putchar and getcharwidth. + (VasEBoot_font_construct_dry_run): Likewise. + (VasEBoot_font_get_constructed_device_width): Likewise. + (VasEBoot_font_construct_glyph): Likewise. + * include/VasEBoot/charset.h (VasEBoot_ucs4_to_utf8): New proto. + * include/VasEBoot/misc.h (VasEBoot_utf8_to_ucs4): Moved from here ... + * include/VasEBoot/charset.h (VasEBoot_utf8_to_ucs4): ... here. + * include/VasEBoot/font.h (VasEBoot_FONT_CODE_CHAR_MASK): New constant. + (VasEBoot_FONT_CODE_RIGHT_JOINED): Likewise. + (VasEBoot_FONT_CODE_LEFT_JOINED): Likewise. + (VasEBoot_font_get_xheight): New proto. + (VasEBoot_font_get_constructed_device_width): Likewise. + (VasEBoot_font_construct_glyph): Likewise. + * include/VasEBoot/font.h (VasEBoot_font_get_string_width): Moved from here ... + * include/VasEBoot/gfxmenu_view.h (VasEBoot_font_get_string_width): ... here. + * include/VasEBoot/font.h (VasEBoot_font_draw_string): Moved from here ... + * include/VasEBoot/gfxmenu_view.h (VasEBoot_font_draw_string): ... here. + * include/VasEBoot/i386/vga_common.h (VasEBoot_console_putchar): Moved from here.. + * include/VasEBoot/i386/pc/console.h (VasEBoot_console_putchar): ... here. + * include/VasEBoot/i386/vga_common.h (VasEBoot_console_real_putchar): Removed. + (VasEBoot_console_getcharwidth): Likewise. + * include/VasEBoot/misc.h (VasEBoot_xputs): New proto. + (VasEBoot_puts): Inlined. + * include/VasEBoot/normal.h (VasEBoot_print_ucs4): Add margin specification. + (VasEBoot_normal_get_line_counter): Removed. + (VasEBoot_install_newline_hook): Likewise. + (VasEBoot_normal_get_char_counter): New proto. + (VasEBoot_normal_reset_more): Likewise. + (VasEBoot_xputs_normal): Likewise. + * include/VasEBoot/powerpc/ieee1275/console.h: Removed. + * include/VasEBoot/sparc64/ieee1275/console.h: Likewise. + * include/VasEBoot/term.h (VasEBoot_TERM_CODE_TYPE_MASK): New definition. + (VasEBoot_TERM_CODE_TYPE_ASCII): Likewise. + (VasEBoot_TERM_CODE_TYPE_CP437): Likewise. + (VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL): Likewise. + (VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL): Likewise. + (VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS): Likewise. + (VasEBoot_term_input): Pass reference to self. All users updated. + (VasEBoot_term_output): Pass VasEBoot_unicode_glyph to putchar and getcharwidth. Pass reference to self. New fields normal_color, highlight_color and data. All users updated. - (grub_putchar): Removed. - (grub_putcode): Remove EXPORT_FUNC since it's not in kernel anymore. - (grub_unicode_estimate_width): New function. - (grub_term_getcharwidth): Add defaults. - (GRUB_TERM_DEFAULT_NORMAL_COLOR): New definition. - (GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR): Likewise. - (GRUB_TERM_DEFAULT_STANDARD_COLOR): Likewise. - (grub_cls): Remove EXPORT_FUNC. - (grub_setcolorstate): Inline. - (grub_newline_hook): Removed. - * include/grub/terminfo.h: Rewritten. All users updated. - * include/grub/unicode.h: New file. - * include/grub/video.h (grub_video_signed_rect): New type. - * kern/emu/console.c (grub_console_highlight_color): Removed. - (grub_console_normal_color): Likewise. - (grub_console_standard_color): Made static. - (grub_ncurses_putchar): Remove mapping. - (grub_ncurses_getcharwidth): Removed. - (grub_ncurses_term_output): Declare as GRUB_TERM_CODE_TYPE_ASCII. - (grub_ncurses_setcolor): Removed. - (grub_ncurses_getcolor): Likewise. - * kern/i386/pc/startup.S (grub_console_real_putchar): Renamed to ... - (grub_console_putchar): ... this. - (grub_console_putchar): Handle argument difference. - * kern/ieee1275/init.c (grub_machine_init): Split console_init into + (VasEBoot_putchar): Removed. + (VasEBoot_putcode): Remove EXPORT_FUNC since it's not in kernel anymore. + (VasEBoot_unicode_estimate_width): New function. + (VasEBoot_term_getcharwidth): Add defaults. + (VasEBoot_TERM_DEFAULT_NORMAL_COLOR): New definition. + (VasEBoot_TERM_DEFAULT_HIGHLIGHT_COLOR): Likewise. + (VasEBoot_TERM_DEFAULT_STANDARD_COLOR): Likewise. + (VasEBoot_cls): Remove EXPORT_FUNC. + (VasEBoot_setcolorstate): Inline. + (VasEBoot_newline_hook): Removed. + * include/VasEBoot/terminfo.h: Rewritten. All users updated. + * include/VasEBoot/unicode.h: New file. + * include/VasEBoot/video.h (VasEBoot_video_signed_rect): New type. + * kern/emu/console.c (VasEBoot_console_highlight_color): Removed. + (VasEBoot_console_normal_color): Likewise. + (VasEBoot_console_standard_color): Made static. + (VasEBoot_ncurses_putchar): Remove mapping. + (VasEBoot_ncurses_getcharwidth): Removed. + (VasEBoot_ncurses_term_output): Declare as VasEBoot_TERM_CODE_TYPE_ASCII. + (VasEBoot_ncurses_setcolor): Removed. + (VasEBoot_ncurses_getcolor): Likewise. + * kern/i386/pc/startup.S (VasEBoot_console_real_putchar): Renamed to ... + (VasEBoot_console_putchar): ... this. + (VasEBoot_console_putchar): Handle argument difference. + * kern/ieee1275/init.c (VasEBoot_machine_init): Split console_init into console_init_early and console_init_lately. - * kern/sparc64/ieee1275/init.c (grub_machine_init): Likewise. - * kern/misc.c (grub_puts): Removed. - (grub_vprintf): Store UTF-8 string instead of outputting it directly. - (grub_vsnprintf_real): Remove str = NULL support. - * kern/misc.c (grub_utf8_to_ucs4): Move from here ... - * normal/charset.c (grub_utf8_to_ucs4): ... here. - * kern/term.c (grub_putcode): Renamed to ... - (grub_putcode_dumb): ... this. Pass grub_unicode_glyph instead of code. - (grub_putchar): Removed. - (grub_xputs_dumb): New function. - (grub_xputs): New variable. + * kern/sparc64/ieee1275/init.c (VasEBoot_machine_init): Likewise. + * kern/misc.c (VasEBoot_puts): Removed. + (VasEBoot_vprintf): Store UTF-8 string instead of outputting it directly. + (VasEBoot_vsnprintf_real): Remove str = NULL support. + * kern/misc.c (VasEBoot_utf8_to_ucs4): Move from here ... + * normal/charset.c (VasEBoot_utf8_to_ucs4): ... here. + * kern/term.c (VasEBoot_putcode): Renamed to ... + (VasEBoot_putcode_dumb): ... this. Pass VasEBoot_unicode_glyph instead of code. + (VasEBoot_putchar): Removed. + (VasEBoot_xputs_dumb): New function. + (VasEBoot_xputs): New variable. * lib/charset.c: Move from here ... * normal/charset.c: ... to here. - (grub_ucs4_to_utf8): New function. - (grub_ucs4_to_utf8_alloc): Use grub_ucs4_to_utf8. + (VasEBoot_ucs4_to_utf8): New function. + (VasEBoot_ucs4_to_utf8_alloc): Use VasEBoot_ucs4_to_utf8. (join_types): New variable. (unpack_join): New function. (bidi_types): New variable. @@ -27070,49 +27070,49 @@ (get_bidi_type): Likewise. (get_join_type): Likewise. (is_mirrored): Likewise. - (grub_unicode_get_comb_type): Likewise. - (grub_unicode_estimate_width) [HAVE_UNIFONT_WIDTHSPEC]: Likewise. + (VasEBoot_unicode_get_comb_type): Likewise. + (VasEBoot_unicode_estimate_width) [HAVE_UNIFONT_WIDTHSPEC]: Likewise. (is_type_after): Likewise. - (grub_unicode_aglomerate_comb): Likewise. + (VasEBoot_unicode_aglomerate_comb): Likewise. (bidi_line_wrap): Likewise. - (grub_bidi_line_logical_to_visual): Likewise. - (grub_bidi_logical_to_visual): Likewise. - (grub_unicode_mirror_code): Likewise. - (grub_unicode_shape_code): Likewise. - * normal/cmdline.c (grub_cmdline_get): Reset more counter. - Don't use grub_putchar. - * normal/main.c (grub_normal_init_page): Use grub_putcode. - (grub_normal_reader_init): Likewise. - (grub_xputs_saved): New variable. - (GRUB_MOD_INIT): Set grub_xputs. - (GRUB_MOD_FINI): Restore grub_xputs. - * normal/menu.c (grub_wait_after_message): Don't use grub_putchar. + (VasEBoot_bidi_line_logical_to_visual): Likewise. + (VasEBoot_bidi_logical_to_visual): Likewise. + (VasEBoot_unicode_mirror_code): Likewise. + (VasEBoot_unicode_shape_code): Likewise. + * normal/cmdline.c (VasEBoot_cmdline_get): Reset more counter. + Don't use VasEBoot_putchar. + * normal/main.c (VasEBoot_normal_init_page): Use VasEBoot_putcode. + (VasEBoot_normal_reader_init): Likewise. + (VasEBoot_xputs_saved): New variable. + (VasEBoot_MOD_INIT): Set VasEBoot_xputs. + (VasEBoot_MOD_FINI): Restore VasEBoot_xputs. + * normal/menu.c (VasEBoot_wait_after_message): Don't use VasEBoot_putchar. (menu_init): Avoid printing gfxmenu error. - (show_menu): Use grub_normal_get_char_counter. + (show_menu): Use VasEBoot_normal_get_char_counter. * normal/menu_entry.c (update_screen): Fix out-of-array. (complete): Avoid NULL dereferencing. - * grub_menu_entry_run (grub_menu_entry_run): Don't use putchar. + * VasEBoot_menu_entry_run (VasEBoot_menu_entry_run): Don't use putchar. * normal/menu_text.c (print_spaces): Removed. - (grub_print_ucs4): Likewise. - (grub_print_message_indented): Use grub_print_ucs4. - (print_message): Use grub_putcode. + (VasEBoot_print_ucs4): Likewise. + (VasEBoot_print_message_indented): Use VasEBoot_print_ucs4. + (print_message): Use VasEBoot_putcode. (print_entry): Hanlde diacritics. * normal/term.c (term_state): New type. - (grub_more_lines): Removed. + (VasEBoot_more_lines): Removed. (term_states): New variable. - (grub_normal_line_counter): Renamed to .. - (grub_normal_char_counter): ...this. All users updated. - (grub_normal_get_line_counter): Renamed to ... - (grub_normal_get_char_counter): ... this. - (grub_normal_reset_more): New function. + (VasEBoot_normal_line_counter): Renamed to .. + (VasEBoot_normal_char_counter): ...this. All users updated. + (VasEBoot_normal_get_line_counter): Renamed to ... + (VasEBoot_normal_get_char_counter): ... this. + (VasEBoot_normal_reset_more): New function. (process_newline): Removed. (print_more): New function. - (grub_install_newline_hook): Removed. + (VasEBoot_install_newline_hook): Removed. (map_code): New function. - (grub_puts_terminal): Use grub_print_ucs4. + (VasEBoot_puts_terminal): Use VasEBoot_print_ucs4. (putglyph): New function. (putcode_real): Likewise. - (grub_putcode): Use putcode_real. + (VasEBoot_putcode): Use putcode_real. (get_maxwidth): New function. (get_startwidth): Likewise. (print_ucs4_terminal): Likewise. @@ -27120,52 +27120,52 @@ (put_glyphs_terminal): Likewise. (print_backlog): Likewise. (print_ucs4_real): Likewise. - (grub_print_ucs4): Likewise. - (grub_xputs_normal): Likewise. - * term/efi/console.c (grub_console_putchar): Output diacritics. - (grub_console_getcharwidth): Removed. - (grub_console_term_output): Declare as GRUB_TERM_CODE_TYPE_UCS4_VISUAL. + (VasEBoot_print_ucs4): Likewise. + (VasEBoot_xputs_normal): Likewise. + * term/efi/console.c (VasEBoot_console_putchar): Output diacritics. + (VasEBoot_console_getcharwidth): Removed. + (VasEBoot_console_term_output): Declare as VasEBoot_TERM_CODE_TYPE_UCS4_VISUAL. * term/gfxterm.c (clear_char): Free chars. (scroll_up): Avoid leaking memory. - (grub_gfxterm_putchar): Support diacritics. - (grub_video_term): Declare as GRUB_TERM_CODE_TYPE_UCS4_VISUAL. - * term/i386/pc/console.c (grub_console_term_output): Declare as - GRUB_TERM_CODE_TYPE_VGA. - * term/i386/pc/vga.c (grub_vga_term): Declare as - GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS. - * term/i386/pc/vga_text.c (grub_vga_text_term): Declare as - GRUB_TERM_CODE_TYPE_VGA. + (VasEBoot_gfxterm_putchar): Support diacritics. + (VasEBoot_video_term): Declare as VasEBoot_TERM_CODE_TYPE_UCS4_VISUAL. + * term/i386/pc/console.c (VasEBoot_console_term_output): Declare as + VasEBoot_TERM_CODE_TYPE_VGA. + * term/i386/pc/vga.c (VasEBoot_vga_term): Declare as + VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS. + * term/i386/pc/vga_text.c (VasEBoot_vga_text_term): Declare as + VasEBoot_TERM_CODE_TYPE_VGA. * term/i386/vga_common.c (map_char): Removed. - (grub_console_putchar): Likewise. - (grub_console_getcharwidth): Likewise. + (VasEBoot_console_putchar): Likewise. + (VasEBoot_console_getcharwidth): Likewise. * term/ieee1275/ofconsole.c: Simplify using terminfo. (colors): Reordered to match terminfo. - (grub_ofconsole_normal_color): Removed. - (grub_ofconsole_writeesc): Likewise. - (grub_ofconsole_highlight_color): Likewise. - (grub_ofconsole_getcharwidth): Likewise. - (grub_ofconsole_setcolorstate): Likewise. - (grub_ofconsole_setcolor): Likewise. - (grub_ofconsole_getcolor): Likewise. - (grub_ofconsole_readkey): Renamed to ... + (VasEBoot_ofconsole_normal_color): Removed. + (VasEBoot_ofconsole_writeesc): Likewise. + (VasEBoot_ofconsole_highlight_color): Likewise. + (VasEBoot_ofconsole_getcharwidth): Likewise. + (VasEBoot_ofconsole_setcolorstate): Likewise. + (VasEBoot_ofconsole_setcolor): Likewise. + (VasEBoot_ofconsole_getcolor): Likewise. + (VasEBoot_ofconsole_readkey): Renamed to ... (readkey): ... this. Remove escape sequence handling. Return -1 on no key. - (grub_ofconsole_checkkey): Removed. - (grub_ofconsole_getkey): Likewise. - (grub_ofconsole_getxy): Likewise. - (grub_ofconsole_gotoxy): Likewise. - (grub_ofconsole_cls): Likewise. - (grub_ofconsole_refresh): Likewise. - (grub_ofconsole_terminfo_input): New struct. - (grub_ofconsole_terminfo_output): Likewise. - (grub_ofconsole_term_input): Use terminfo. - (grub_ofconsole_term_output): Likewise. - (grub_console_init): Split into ... - (grub_console_init_early): ...this and ... - (grub_console_init_lately): ...this. Use terminfo. - (grub_ofconsole_putchar): Renamed to ... + (VasEBoot_ofconsole_checkkey): Removed. + (VasEBoot_ofconsole_getkey): Likewise. + (VasEBoot_ofconsole_getxy): Likewise. + (VasEBoot_ofconsole_gotoxy): Likewise. + (VasEBoot_ofconsole_cls): Likewise. + (VasEBoot_ofconsole_refresh): Likewise. + (VasEBoot_ofconsole_terminfo_input): New struct. + (VasEBoot_ofconsole_terminfo_output): Likewise. + (VasEBoot_ofconsole_term_input): Use terminfo. + (VasEBoot_ofconsole_term_output): Likewise. + (VasEBoot_console_init): Split into ... + (VasEBoot_console_init_early): ...this and ... + (VasEBoot_console_init_lately): ...this. Use terminfo. + (VasEBoot_ofconsole_putchar): Renamed to ... (put): ... this. Remove mapping. - (grub_ofconsole_term_output): Declare as GRUB_TERM_CODE_TYPE_ASCII. + (VasEBoot_ofconsole_term_output): Declare as VasEBoot_TERM_CODE_TYPE_ASCII. * term/serial.c: Simplify using terminfo. (xpos): Removed. (ypos): Likewise. @@ -27175,66 +27175,66 @@ (npending): Likewise. (serial_translate_key_sequence): Likewise. (fill_input_buf): Likewise. - (grub_serial_checkkey): Likewise. - (grub_serial_getkey): Likewise. - (grub_serial_getxy): Likewise. - (grub_serial_gotoxy): Likewise. - (grub_serial_putchar): Likewise. - (grub_serial_cls): Likewise. - (grub_serial_setcolorstate): Likewise. - (grub_serial_setcursor): Likewise. + (VasEBoot_serial_checkkey): Likewise. + (VasEBoot_serial_getkey): Likewise. + (VasEBoot_serial_getxy): Likewise. + (VasEBoot_serial_gotoxy): Likewise. + (VasEBoot_serial_putchar): Likewise. + (VasEBoot_serial_cls): Likewise. + (VasEBoot_serial_setcolorstate): Likewise. + (VasEBoot_serial_setcursor): Likewise. (serial_hw_init): Use serial_hw_fetch. - (grub_serial_terminfo_input): New variable. - (grub_serial_terminfo_output): Likewise. - (grub_serial_term_input): Use terminfo. - (grub_serial_term_output): Likewise. + (VasEBoot_serial_terminfo_input): New variable. + (VasEBoot_serial_terminfo_output): Likewise. + (VasEBoot_serial_term_input): Use terminfo. + (VasEBoot_serial_term_output): Likewise. * term/terminfo.c (putstr): Use put. - (grub_terminfo_all_free): New function - (grub_terminfo_set_current): New types vt100-color, ieee1275 and dumb. - (grub_terminfo_output_register): New function. - (grub_terminfo_output_unregister): Likewise. - (grub_terminfo_getxy): Likewise. - (grub_terminfo_readkey): Likewise. - (grub_terminfo_checkkey): Likewise. - (grub_terminfo_getkey): Likewise. - (grub_terminfo_input_init): Likewise. + (VasEBoot_terminfo_all_free): New function + (VasEBoot_terminfo_set_current): New types vt100-color, ieee1275 and dumb. + (VasEBoot_terminfo_output_register): New function. + (VasEBoot_terminfo_output_unregister): Likewise. + (VasEBoot_terminfo_getxy): Likewise. + (VasEBoot_terminfo_readkey): Likewise. + (VasEBoot_terminfo_checkkey): Likewise. + (VasEBoot_terminfo_getkey): Likewise. + (VasEBoot_terminfo_input_init): Likewise. (print_terminfo): Likewise. - (grub_cmd_terminfo): Handle encoding. - (grub_terminfo_gotoxy): Track position. - (grub_terminfo_cls): Likewise. - (grub_terminfo_putchar): Likewise. - (grub_terminfo_setcolorstate): Handle colors - (grub_terminfo_cursor_on): This ... - (grub_terminfo_cursor_off): ... and this merged into ... - (grub_terminfo_setcursor): ... this. - * term/tparm.c (grub_terminfo_tparm): Avoid NULL dereferencing. + (VasEBoot_cmd_terminfo): Handle encoding. + (VasEBoot_terminfo_gotoxy): Track position. + (VasEBoot_terminfo_cls): Likewise. + (VasEBoot_terminfo_putchar): Likewise. + (VasEBoot_terminfo_setcolorstate): Handle colors + (VasEBoot_terminfo_cursor_on): This ... + (VasEBoot_terminfo_cursor_off): ... and this merged into ... + (VasEBoot_terminfo_setcursor): ... this. + * term/tparm.c (VasEBoot_terminfo_tparm): Avoid NULL dereferencing. * unicode/ArabicShaping.txt: New file (imported from Unicode). * unicode/BidiMirroring.txt: Likewise. * unicode/UnicodeData.txt: Likewise. * unicode/COPYING: Likewise. - * util/grub-editenv.c (grub_putchar): Removed. - (grub_xputs_real): New function. - (grub_xputs): New variable. - * util/grub-fstest.c (grub_putchar): Removed. - (grub_xputs_real): New function. - (grub_xputs): New variable. - * util/grub-mkdevicemap.c (grub_putchar): Removed. - (grub_xputs_real): New function. - (grub_xputs): New variable. - * util/grub-probe.c (grub_putchar): Removed. - (grub_xputs_real): New function. - (grub_xputs): New variable. - * util/grub-script-check.c (grub_putchar): Removed. - (grub_xputs_real): New function. - (grub_xputs): New variable. - * util/i386/pc/grub-setup.c (grub_putchar): Removed. - (grub_xputs_real): New function. - (grub_xputs): New variable. + * util/VasEBoot-editenv.c (VasEBoot_putchar): Removed. + (VasEBoot_xputs_real): New function. + (VasEBoot_xputs): New variable. + * util/VasEBoot-fstest.c (VasEBoot_putchar): Removed. + (VasEBoot_xputs_real): New function. + (VasEBoot_xputs): New variable. + * util/VasEBoot-mkdevicemap.c (VasEBoot_putchar): Removed. + (VasEBoot_xputs_real): New function. + (VasEBoot_xputs): New variable. + * util/VasEBoot-probe.c (VasEBoot_putchar): Removed. + (VasEBoot_xputs_real): New function. + (VasEBoot_xputs): New variable. + * util/VasEBoot-script-check.c (VasEBoot_putchar): Removed. + (VasEBoot_xputs_real): New function. + (VasEBoot_xputs): New variable. + * util/i386/pc/VasEBoot-setup.c (VasEBoot_putchar): Removed. + (VasEBoot_xputs_real): New function. + (VasEBoot_xputs): New variable. * util/import_unicode.py: New file. - * util/grub-mkfont.c (ft_errmsgs): New array. - (grub_glyph_info): Make bitmap a pointer. + * util/VasEBoot-mkfont.c (ft_errmsgs): New array. + (VasEBoot_glyph_info): Make bitmap a pointer. (file_formats): New type WIDTH_SPEC. - (grub_font_info): New members glyphs_unsorted, glyphs_sorted, num_glyphs. + (VasEBoot_font_info): New members glyphs_unsorted, glyphs_sorted, num_glyphs. (options): Add width-spec. (help): Likewise. (add_char): Renamed to ... @@ -27248,18 +27248,18 @@ (add_font): Handle GSUB. (write_font_width_spec): New function. (main): Sort glyphs. - * commands/minicmd.c (grub_mini_cmd_clear): Moved from here ... - * normal/main.c (grub_mini_cmd_clear): ..here. All users updated. - * kern/term.c (grub_cls): Moved from here... - * normal/term.c (grub_cls): ... here. + * commands/minicmd.c (VasEBoot_mini_cmd_clear): Moved from here ... + * normal/main.c (VasEBoot_mini_cmd_clear): ..here. All users updated. + * kern/term.c (VasEBoot_cls): Moved from here... + * normal/term.c (VasEBoot_cls): ... here. 2010-07-02 Colin Watson - * include/grub/types.h: Define the C99-style PRIxGRUB_SIZE macro, + * include/VasEBoot/types.h: Define the C99-style PRIxVasEBoot_SIZE macro, suitable for using within the format argument of printf when - converting grub_size_t. - * disk/usbms.c (grub_usbms_transfer): Use PRIxGRUB_SIZE rather than - "x" to convert grub_size_t arguments. + converting VasEBoot_size_t. + * disk/usbms.c (VasEBoot_usbms_transfer): Use PRIxVasEBoot_SIZE rather than + "x" to convert VasEBoot_size_t arguments. 2010-07-02 Vladimir Serbinenko @@ -27269,46 +27269,46 @@ 2010-07-02 Vladimir Serbinenko - * font/font.c (grub_font_get_glyph_with_fallback): Avoid dereferencing + * font/font.c (VasEBoot_font_get_glyph_with_fallback): Avoid dereferencing NULL font. 2010-07-02 Colin Watson - * util/deviceiter.c (grub_util_iterate_devices): Skip device-mapper + * util/deviceiter.c (VasEBoot_util_iterate_devices): Skip device-mapper devices when iterating over /dev/disk/by-id; they will be handled later if appropriate, which they aren't always (e.g. LVM). 2010-07-02 Colin Watson - * include/grub/misc.h (grub_reboot): Declare as noreturn. - * kern/efi/efi.c (grub_reboot): Don't return, even if reset_system + * include/VasEBoot/misc.h (VasEBoot_reboot): Declare as noreturn. + * kern/efi/efi.c (VasEBoot_reboot): Don't return, even if reset_system fails. - (grub_halt): Likewise. - * kern/ieee1275/openfw.c (grub_reboot): Don't return, even if + (VasEBoot_halt): Likewise. + * kern/ieee1275/openfw.c (VasEBoot_reboot): Don't return, even if reset-all fails. - (grub_halt): Don't return, even if all of shut-down, power-off, and + (VasEBoot_halt): Don't return, even if all of shut-down, power-off, and poweroff fail. 2010-07-02 Colin Watson - * kern/efi/init.c (grub_efi_init): set_watchdog_timer takes four + * kern/efi/init.c (VasEBoot_efi_init): set_watchdog_timer takes four arguments, not three. 2010-07-02 Colin Watson - * util/grub-mkconfig_lib.in (uses_abstraction): New function. - * util/grub.d/10_linux.in: Use it to check for LVM, so that + * util/VasEBoot-mkconfig_lib.in (uses_abstraction): New function. + * util/VasEBoot.d/10_linux.in: Use it to check for LVM, so that LVM-on-RAID is handled correctly. 2010-07-02 Colin Watson - * docs/grub.texi (Changes from GRUB Legacy): New section. + * docs/VasEBoot.texi (Changes from VasEBoot Legacy): New section. (Future): Fix typo. 2010-07-02 Colin Watson - * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Sometimes - grub.d/README accidentally ends up executable for one reason or + * util/VasEBoot-mkconfig_lib.in (VasEBoot_file_is_not_garbage): Sometimes + VasEBoot.d/README accidentally ends up executable for one reason or another. Ignore it. 2010-07-02 Vladimir Serbinenko @@ -27318,38 +27318,38 @@ 2010-07-02 Vladimir Serbinenko - * kern/efi/init.c (grub_efi_init): Disable watchdog. + * kern/efi/init.c (VasEBoot_efi_init): Disable watchdog. Tested by: Seth Goldberg. 2010-07-02 Vladimir Serbinenko - * loader/multiboot.c (grub_multiboot_boot) [GRUB_USE_MULTIBOOT2]: + * loader/multiboot.c (VasEBoot_multiboot_boot) [VasEBoot_USE_MULTIBOOT2]: Properly align mbi. Reported by: Seth Goldberg. 2010-07-01 Vladimir Serbinenko - * util/grub-mkrescue.in: Avoid module duplication. + * util/VasEBoot-mkrescue.in: Avoid module duplication. 2010-07-01 Sean Finney - * util/grub.d/10_linux.in: Don't use UUID for LVM root. + * util/VasEBoot.d/10_linux.in: Don't use UUID for LVM root. 2010-07-01 Sean Finney - * disk/lvm.c (grub_lvm_scan_device): Skip snapshots. + * disk/lvm.c (VasEBoot_lvm_scan_device): Skip snapshots. 2010-07-01 Vladimir Serbinenko - * disk/lvm.c (grub_lvm_checkvalue): New function. - (grub_lvm_check_flag): Likewise. + * disk/lvm.c (VasEBoot_lvm_checkvalue): New function. + (VasEBoot_lvm_check_flag): Likewise. 2010-07-01 Robert Millan * kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Support 'p' as partition separator on kernel of FreeBSD (used with GPT labels). - (grub_util_biosdisk_get_grub_dev): Likewise. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Likewise. 2010-07-01 Vladimir Serbinenko @@ -27360,7 +27360,7 @@ (set_io_space): New function. (set_iod): Likewise. (set_p2d): Likewise. - (grub_cs5536_init_geode): Likewise. + (VasEBoot_cs5536_init_geode): Likewise. * commands/mips/yeeloong/lsspd.c: New file. * conf/mips-qemu-mips.rmk (pkglib_MODULES): Add serial.mod. (serial_mod_SOURCES): New variable. @@ -27387,45 +27387,45 @@ (serial_mod_CFLAGS): Likewise. (serial_mod_LDFLAGS): Likewise. * disk/ata.c (check_device): New function. - (grub_ata_device_initialize): Use check_device. - (grub_ata_iterate): Recheck devices. - (grub_ata_open): Likewise. - (grub_atapi_iterate): Likewise. - (grub_atapi_open): Likewise. - * include/grub/ata.h (GRUB_ATA_CH0_PORT1): New macro. - (GRUB_ATA_CH1_PORT1): Likewise. - (GRUB_ATA_CH0_PORT2): Likewise. - (GRUB_ATA_CH1_PORT2): Likewise. - * include/grub/mips/loongson.h: New file. - * include/grub/mips/yeeloong/ec.h: Likewise. - * include/grub/mips/yeeloong/serial.h (GRUB_MACHINE_SERIAL_PORT): New definition. - (GRUB_MACHINE_SERIAL_DIVISOR_115200): Likewise. - (GRUB_MACHINE_SERIAL_PORTS) [ASM_FILE]: Remove. - * include/grub/misc.h (grub_halt): Declare as noreturn. - * include/grub/serial.h (UART_ENABLE_FIFO): Renamed to ... + (VasEBoot_ata_device_initialize): Use check_device. + (VasEBoot_ata_iterate): Recheck devices. + (VasEBoot_ata_open): Likewise. + (VasEBoot_atapi_iterate): Likewise. + (VasEBoot_atapi_open): Likewise. + * include/VasEBoot/ata.h (VasEBoot_ATA_CH0_PORT1): New macro. + (VasEBoot_ATA_CH1_PORT1): Likewise. + (VasEBoot_ATA_CH0_PORT2): Likewise. + (VasEBoot_ATA_CH1_PORT2): Likewise. + * include/VasEBoot/mips/loongson.h: New file. + * include/VasEBoot/mips/yeeloong/ec.h: Likewise. + * include/VasEBoot/mips/yeeloong/serial.h (VasEBoot_MACHINE_SERIAL_PORT): New definition. + (VasEBoot_MACHINE_SERIAL_DIVISOR_115200): Likewise. + (VasEBoot_MACHINE_SERIAL_PORTS) [ASM_FILE]: Remove. + * include/VasEBoot/misc.h (VasEBoot_halt): Declare as noreturn. + * include/VasEBoot/serial.h (UART_ENABLE_FIFO): Renamed to ... (UART_ENABLE_FIFO_TRIGGER14): ... this. All users updated. (UART_ENABLE_FIFO_TRIGGER1): New definition. (UART_ENABLE_DTRRTS): Likewise. (UART_ENABLE_MODEM): Removed. (UART_ENABLE_OUT2): New const. - * include/grub/term.h (grub_term_register_input_active): New function. - (grub_term_register_output_active): Likewise. - * kern/mips/startup.S [GRUB_MACHINE_MIPS_YEELOONG]: Handle 0xffffffff + * include/VasEBoot/term.h (VasEBoot_term_register_input_active): New function. + (VasEBoot_term_register_output_active): Likewise. + * kern/mips/startup.S [VasEBoot_MACHINE_MIPS_YEELOONG]: Handle 0xffffffff argument. - * kern/mips/yeeloong/init.c (grub_get_rtc): Macroify. + * kern/mips/yeeloong/init.c (VasEBoot_get_rtc): Macroify. (init_pci): New function. - (grub_machine_init): Execute platform init when firmware. Init serial. - (grub_halt): Implement. - (grub_exit): Likewise. - (grub_reboot): Likewise. + (VasEBoot_machine_init): Execute platform init when firmware. Init serial. + (VasEBoot_halt): Implement. + (VasEBoot_exit): Likewise. + (VasEBoot_reboot): Likewise. * term/serial.c (serial_hw_init): Update macros. - [GRUB_MACHINE_MIPS_YEELOONG]: Init on startup. - * util/grub-mkimage.c (image_target_desc): New id IMAGE_YEELOONG_FLASH. + [VasEBoot_MACHINE_MIPS_YEELOONG]: Init on startup. + * util/VasEBoot-mkimage.c (image_target_desc): New id IMAGE_YEELOONG_FLASH. (image_targets): New target mipsel-yeeloong-flash. (generate_image): Support IMAGE_YEELOONG_FLASH. - * video/sm712.c (GRUB_SM712_TOTAL_MEMORY_SPACE): New definition. - (grub_video_sm712_setup): Init card. - (grub_video_sm712_set_palette): Removed. + * video/sm712.c (VasEBoot_SM712_TOTAL_MEMORY_SPACE): New definition. + (VasEBoot_video_sm712_setup): Init card. + (VasEBoot_video_sm712_set_palette): Removed. * video/sm712_init.c: New file. 2010-06-30 Colin Watson @@ -27438,41 +27438,41 @@ 2010-06-29 Colin Watson - * util/grub-mkconfig.in: Use 'set -e' rather than '#! /bin/sh -e', + * util/VasEBoot-mkconfig.in: Use 'set -e' rather than '#! /bin/sh -e', to avoid accidents when debugging with 'sh -x'. - * util/grub-mkrescue.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_netbsd.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/20_linux_xen.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_netbsd.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/20_linux_xen.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2010-06-29 Colin Watson - * commands/cat.c (grub_cmd_cat): Fix buffer overrun if '\r' is the + * commands/cat.c (VasEBoot_cmd_cat): Fix buffer overrun if '\r' is the last character in the buffer. Reported by: Vladimir Serbinenko. 2010-06-29 Robert Millan - * docs/grub.texi (Simple configuration): Document ${GRUB_BADRAM}. + * docs/VasEBoot.texi (Simple configuration): Document ${VasEBoot_BADRAM}. (Command-line and menu entry commands): Document `badram' command. 2010-06-28 Robert Millan - * util/grub-mkconfig.in: Export `GRUB_BADRAM' variable. - * util/grub.d/00_header.in: When `GRUB_BADRAM' is set, issue badram - command using ${GRUB_BADRAM} as parameter. + * util/VasEBoot-mkconfig.in: Export `VasEBoot_BADRAM' variable. + * util/VasEBoot.d/00_header.in: When `VasEBoot_BADRAM' is set, issue badram + command using ${VasEBoot_BADRAM} as parameter. 2010-06-28 Colin Watson - * docs/grub.texi (Device map): New section. + * docs/VasEBoot.texi (Device map): New section. (Themes): New section (stub). - * Makefile.in (docs/grub.info): The info documentation now builds + * Makefile.in (docs/VasEBoot.info): The info documentation now builds without errors. Make sure it stays that way. 2010-06-28 Vladimir Serbinenko @@ -27480,13 +27480,13 @@ Use normal parser for menu entries. Reported by: Thomas Frauendorfer - * include/grub/parser.h (grub_parser_execute): Don't export. - * normal/menu.c (grub_menu_execute_entry_real): New function. - (grub_menu_execute_entry): Use grub_menu_execute_entry_real. + * include/VasEBoot/parser.h (VasEBoot_parser_execute): Don't export. + * normal/menu.c (VasEBoot_menu_execute_entry_real): New function. + (VasEBoot_menu_execute_entry): Use VasEBoot_menu_execute_entry_real. 2010-06-28 Colin Watson - * docs/grub.texi (Embedded configuration): New section (replacing + * docs/VasEBoot.texi (Embedded configuration): New section (replacing old "Preset Menu" stub). (Images): New section. (configfile): Note that any menu entries defined in `file' are shown @@ -27498,11 +27498,11 @@ 2010-06-28 Colin Watson - * util/grub-install.in: Add --debug-image= option. + * util/VasEBoot-install.in: Add --debug-image= option. 2010-06-28 Colin Watson - Change grub-mkdevicemap to emit /dev/disk/by-id/ names where + Change VasEBoot-mkdevicemap to emit /dev/disk/by-id/ names where possible on Linux. * util/deviceiter.c (check_device): Rename to ... @@ -27511,30 +27511,30 @@ have already been seen. (clear_seen_devices): New function. (compare_file_names) [__linux__]: New function. - (grub_util_iterate_devices): Clear the list of seen devices on exit + (VasEBoot_util_iterate_devices): Clear the list of seen devices on exit and (just in case) on entry. - (grub_util_iterate_devices) [__linux__]: Iterate over non-partition + (VasEBoot_util_iterate_devices) [__linux__]: Iterate over non-partition devices in /dev/disk/by-id/, in sorted order. Remove DM-RAID seen-devices list, superseded by general code in check_device. 2010-06-28 Colin Watson * commands/cat.c (options): New variable. - (grub_cmd_cat): Parse options. If the --dos option is given, print + (VasEBoot_cmd_cat): Parse options. If the --dos option is given, print DOS-style "\r\n" line endings as simple newlines (Debian bug #586358). - (GRUB_MOD_INIT): Use extcmd. - (GRUB_MOD_FINI): Likewise. - * docs/grub.texi (cat): Document --dos. + (VasEBoot_MOD_INIT): Use extcmd. + (VasEBoot_MOD_FINI): Likewise. + * docs/VasEBoot.texi (cat): Document --dos. 2010-06-28 Vladimir Serbinenko - XEN with Linux grub-mkconfig support. + XEN with Linux VasEBoot-mkconfig support. - * conf/common.rmk (grub-mkconfig_SCRIPTS) [linux]: Add 20_linux_xen. - * util/grub-mkconfig.in: Export GRUB_CMDLINE_XEN and - GRUB_CMDLINE_XEN_DEFAULT. - * util/grub.d/20_linux_xen.in: New file. + * conf/common.rmk (VasEBoot-mkconfig_SCRIPTS) [linux]: Add 20_linux_xen. + * util/VasEBoot-mkconfig.in: Export VasEBoot_CMDLINE_XEN and + VasEBoot_CMDLINE_XEN_DEFAULT. + * util/VasEBoot.d/20_linux_xen.in: New file. 2010-06-28 Vladimir Serbinenko @@ -27546,24 +27546,24 @@ (kernel_img_HEADERS): Add pci.h. * conf/i386.rmk (pkglib_MODULES) [qemu]: Remove pci.mod. * configure.ac: Force unifont on qemu and yeeloong. - * include/grub/i386/qemu/kernel.h (grub_qemu_init_cirrus): New proto. - (grub_vga_palette_write): Use correct register. - * kern/i386/coreboot/init.c (grub_machine_init) [GRUB_MACHINE_QEMU]: - Call grub_qemu_init_cirrus. + * include/VasEBoot/i386/qemu/kernel.h (VasEBoot_qemu_init_cirrus): New proto. + (VasEBoot_vga_palette_write): Use correct register. + * kern/i386/coreboot/init.c (VasEBoot_machine_init) [VasEBoot_MACHINE_QEMU]: + Call VasEBoot_qemu_init_cirrus. * kern/i386/qemu/init.c: New file. * term/i386/pc/vga_text.c (inc_y): Never read outside the screen. - * commands/videotest.c (grub_cmd_videotest): Handle double buffering. + * commands/videotest.c (VasEBoot_cmd_videotest): Handle double buffering. 2010-06-26 Pavel Roskin - * util/grub.d/10_linux.in: Add support for initrd images on Fedora + * util/VasEBoot.d/10_linux.in: Add support for initrd images on Fedora 13. 2010-06-26 Colin Watson - * docs/grub.texi (Simple configuration): Explain that - GRUB_DISABLE_LINUX_RECOVERY and GRUB_DISABLE_NETBSD_RECOVERY must be + * docs/VasEBoot.texi (Simple configuration): Explain that + VasEBoot_DISABLE_LINUX_RECOVERY and VasEBoot_DISABLE_NETBSD_RECOVERY must be set to `true' to disable their respective recovery entries, not merely set. @@ -27571,7 +27571,7 @@ Make the `source' command slightly faster. - * normal/main.c (grub_normal_execute): Don't re-read list files when + * normal/main.c (VasEBoot_normal_execute): Don't re-read list files when nested. 2010-06-23 Colin Watson @@ -27588,25 +27588,25 @@ Sync up other versions of the Linux loader with Robert Millan's change of 2010-01-09, "Make loader output a bit more user-friendly". - * loader/i386/efi/linux.c (grub_linux_boot): Move debug info to - grub_dprintf(). - (grub_cmd_linux): Likewise. - (grub_cmd_initrd): Likewise. - * loader/i386/ieee1275/linux.c (grub_cmd_linux): Likewise. - * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. + * loader/i386/efi/linux.c (VasEBoot_linux_boot): Move debug info to + VasEBoot_dprintf(). + (VasEBoot_cmd_linux): Likewise. + (VasEBoot_cmd_initrd): Likewise. + * loader/i386/ieee1275/linux.c (VasEBoot_cmd_linux): Likewise. + * loader/i386/pc/linux.c (VasEBoot_cmd_linux): Likewise. 2010-06-21 Colin Watson - * kern/efi/mm.c (grub_efi_mm_init): Handle systems with memory maps + * kern/efi/mm.c (VasEBoot_efi_mm_init): Handle systems with memory maps larger than MEMORY_MAP_SIZE. 2010-06-21 BVK Chaitanya Fix parallel build. - * conf/common.rmk: Add grub_script.tab.h as a grub-script-check + * conf/common.rmk: Add VasEBoot_script.tab.h as a VasEBoot-script-check dependency. - * script/parser.y: #include grub_script.tab.h header. + * script/parser.y: #include VasEBoot_script.tab.h header. 2010-06-20 Vladimir Serbinenko @@ -27614,12 +27614,12 @@ * kern/i386/qemu/mmap.c (QEMU_CMOS_MEMSIZE2_HIGH): New const. (QEMU_CMOS_MEMSIZE2_LOW): Likewise. - (grub_lower_mem): Removed. - (grub_upper_mem): Likewise. + (VasEBoot_lower_mem): Removed. + (VasEBoot_upper_mem): Likewise. (mem_size): Made static. (above_4g): New variable. - (grub_machine_mmap_init): Detect small mem_size and above_4g. - (grub_machine_mmap_iterate): Order in ascending order and add above_4g + (VasEBoot_machine_mmap_init): Detect small mem_size and above_4g. + (VasEBoot_machine_mmap_iterate): Order in ascending order and add above_4g support. 2010-06-20 Vladimir Serbinenko @@ -27634,49 +27634,49 @@ (video_bochs_mod_SOURCES): Likewise. (video_bochs_mod_CFLAGS): Likewise. (video_bochs_mod_LDFLAGS): Likewise. - * include/grub/vga.h: New file. - * include/grub/video_fb.h (grub_video_fb_doublebuf_blit_init): Removed. - (grub_video_fb_set_page_t): New type. - (grub_video_fb_setup): New prototype. - (grub_video_fb_swap_buffers): Likewise. - (grub_video_fb_get_info_and_fini): Likewise. - * term/i386/pc/vga_text.c (CRTC_ADDR_PORT): Moved to include/grub/vga.h. + * include/VasEBoot/vga.h: New file. + * include/VasEBoot/video_fb.h (VasEBoot_video_fb_doublebuf_blit_init): Removed. + (VasEBoot_video_fb_set_page_t): New type. + (VasEBoot_video_fb_setup): New prototype. + (VasEBoot_video_fb_swap_buffers): Likewise. + (VasEBoot_video_fb_get_info_and_fini): Likewise. + * term/i386/pc/vga_text.c (CRTC_ADDR_PORT): Moved to include/VasEBoot/vga.h. (CRTC_DATA_PORT): Likewise. (CRTC_CURSOR): Likewise. (CRTC_CURSOR_ADDR_HIGH): Likewise. (CRTC_CURSOR_ADDR_LOW): Likewise. (CRTC_CURSOR_DISABLE): Likewise. - (update_cursor): Use grub_vga_cr_write. - (grub_vga_text_setcursor): Likewise. + (update_cursor): Use VasEBoot_vga_cr_write. + (VasEBoot_vga_text_setcursor): Likewise. * video/bochs.c: New file. * video/fb/video_fb.c (render_target): Moved into framebuffer variable. (palette): Likewise. (palette_size): Likewise. (framebuffer): New variable. - (grub_video_fb_init): Use 'framebuffer'. - (grub_video_fb_fini): Likewise. - (grub_video_fb_get_info): Likewise. - (grub_video_fb_get_palette): Likewise. - (grub_video_fb_set_palette): Likewise. - (grub_video_fb_set_viewport): Likewise. - (grub_video_fb_get_viewport): Likewise. - (grub_video_fb_map_color): Likewise. - (grub_video_fb_map_rgb): Likewise. - (grub_video_fb_map_rgba): Likewise. - (grub_video_fb_unmap_color): Likewise. - (grub_video_fb_unmap_color_int): Likewise. - (grub_video_fb_fill_rect): Likewise. - (grub_video_fb_blit_bitmap): Likewise. - (grub_video_fb_blit_render_target): Likewise. - (grub_video_fb_scroll): Likewise. - (grub_video_fb_create_render_target): Likewise. - (grub_video_fb_doublebuf_blit_init): Likewise. - (grub_video_fb_set_active_render_target): Handle doublebuffering. + (VasEBoot_video_fb_init): Use 'framebuffer'. + (VasEBoot_video_fb_fini): Likewise. + (VasEBoot_video_fb_get_info): Likewise. + (VasEBoot_video_fb_get_palette): Likewise. + (VasEBoot_video_fb_set_palette): Likewise. + (VasEBoot_video_fb_set_viewport): Likewise. + (VasEBoot_video_fb_get_viewport): Likewise. + (VasEBoot_video_fb_map_color): Likewise. + (VasEBoot_video_fb_map_rgb): Likewise. + (VasEBoot_video_fb_map_rgba): Likewise. + (VasEBoot_video_fb_unmap_color): Likewise. + (VasEBoot_video_fb_unmap_color_int): Likewise. + (VasEBoot_video_fb_fill_rect): Likewise. + (VasEBoot_video_fb_blit_bitmap): Likewise. + (VasEBoot_video_fb_blit_render_target): Likewise. + (VasEBoot_video_fb_scroll): Likewise. + (VasEBoot_video_fb_create_render_target): Likewise. + (VasEBoot_video_fb_doublebuf_blit_init): Likewise. + (VasEBoot_video_fb_set_active_render_target): Handle doublebuffering. (doublebuf_pageflipping_update_screen): New function. (doublebuf_pageflipping_init): Likewise. - (grub_video_fb_setup): Likewise. - (grub_video_fb_swap_buffers): Likewise. - (grub_video_fb_get_info_and_fini): Likewise. + (VasEBoot_video_fb_setup): Likewise. + (VasEBoot_video_fb_swap_buffers): Likewise. + (VasEBoot_video_fb_get_info_and_fini): Likewise. * video/i386/pc/vbe.c (framebuffer): Remove all doublebuffering fields. All users updated. (doublebuf_pageflipping_commit): Restructured into ... @@ -27684,15 +27684,15 @@ (doublebuf_pageflipping_update_screen): Removed. (doublebuf_pageflipping_init): Likewise. (double_buffering_init): Likewise. - (grub_video_vbe_setup): Use grub_video_fb_setup. - (grub_video_vbe_swap_buffers): Removed. - (grub_video_vbe_set_active_render_target): Likewise. - (grub_video_vbe_get_active_render_target): Likewise. - (grub_video_vbe_get_info_and_fini): Use grub_video_fb_get_info_and_fini. - (grub_video_vbe_adapter): Use grub_video_fb_swap_buffers, - grub_video_fb_set_active_render_target and - grub_video_fb_get_active_render_target. - * video/i386/pc/vga.c (SEQUENCER_ADDR_PORT): Move to include/grub/vga.h. + (VasEBoot_video_vbe_setup): Use VasEBoot_video_fb_setup. + (VasEBoot_video_vbe_swap_buffers): Removed. + (VasEBoot_video_vbe_set_active_render_target): Likewise. + (VasEBoot_video_vbe_get_active_render_target): Likewise. + (VasEBoot_video_vbe_get_info_and_fini): Use VasEBoot_video_fb_get_info_and_fini. + (VasEBoot_video_vbe_adapter): Use VasEBoot_video_fb_swap_buffers, + VasEBoot_video_fb_set_active_render_target and + VasEBoot_video_fb_get_active_render_target. + * video/i386/pc/vga.c (SEQUENCER_ADDR_PORT): Move to include/VasEBoot/vga.h. (SEQUENCER_DATA_PORT): Likewise. (MAP_MASK_REGISTER): Likewise. (CRTC_ADDR_PORT): Likewise. @@ -27704,26 +27704,26 @@ (READ_MAP_REGISTER): Likewise. (INPUT_STATUS1_REGISTER): Likewise. (INPUT_STATUS1_VERTR_BIT): Likewise. - (get_map_mask): Use grub_vga_sr_read. - (set_map_mask): Use grub_vga_sr_write. - (set_read_map): Use grub_vga_gr_write. - (set_start_address): Use grub_vga_cr_write. + (get_map_mask): Use VasEBoot_vga_sr_read. + (set_map_mask): Use VasEBoot_vga_sr_write. + (set_read_map): Use VasEBoot_vga_gr_write. + (set_start_address): Use VasEBoot_vga_cr_write. * video/sm712.c (framebuffer): Remove leftover fields. 2010-06-20 Colin Watson - * util/grub-mkconfig.in: Capitalise and export GRUB_PREFIX. Stop - setting GRUB_VIDEO_BACKEND. Make it available as a user override + * util/VasEBoot-mkconfig.in: Capitalise and export VasEBoot_PREFIX. Stop + setting VasEBoot_VIDEO_BACKEND. Make it available as a user override instead. Replace the gfxterm backend check with a check that - ${GRUB_PREFIX}/video.lst is non-empty. - * util/grub.d/00_header.in: Use GRUB_PREFIX rather than computing it + ${VasEBoot_PREFIX}/video.lst is non-empty. + * util/VasEBoot.d/00_header.in: Use VasEBoot_PREFIX rather than computing it again. (load_video): New generated function. Call it before loading - gfxterm rather than loading ${GRUB_VIDEO_BACKEND}. - * util/grub.d/10_linux.in (linux_entry): Call load_video. - * util/grub.d/30_os-prober.in (osx_entry): Likewise. - * docs/grub.texi (Simple configuration): Document - GRUB_VIDEO_BACKEND. + gfxterm rather than loading ${VasEBoot_VIDEO_BACKEND}. + * util/VasEBoot.d/10_linux.in (linux_entry): Call load_video. + * util/VasEBoot.d/30_os-prober.in (osx_entry): Likewise. + * docs/VasEBoot.texi (Simple configuration): Document + VasEBoot_VIDEO_BACKEND. 2010-06-20 Vladimir Serbinenko @@ -27731,52 +27731,52 @@ * conf/i386-pc.rmk (xnu_mod_SOURCES): Remove loader/i386/pc/xnu.c. * conf/x86-efi.rmk (xnu_mod_SOURCES): Remove loader/i386/efi/xnu.c. - * include/grub/i386/xnu.h (grub_xnu_set_video): Removed. - * loader/i386/efi/linux.c (grub_linux_setup_video): Copied from + * include/VasEBoot/i386/xnu.h (VasEBoot_xnu_set_video): Removed. + * loader/i386/efi/linux.c (VasEBoot_linux_setup_video): Copied from loader/i386/pc/linux.c. - (grub_linux_boot): Resynced with loader/i386/pc/linux.c. + (VasEBoot_linux_boot): Resynced with loader/i386/pc/linux.c. (find_line_len): Removed. (find_framebuf): Likewise. - (grub_cmd_linux): Declare grub_linux_boot as possibly returning. + (VasEBoot_cmd_linux): Declare VasEBoot_linux_boot as possibly returning. * loader/i386/efi/xnu.c: Removed. * loader/i386/pc/xnu.c: Moved from here... * loader/i386/xnu.c: ...here. Enable priorities in video drivers. - * include/grub/video.h (grub_video_adapter_prio_t): New type. - (grub_video_adapter): New field prio. - (grub_video_register): Respect prio when inserting. - * video/efi_gop.c (grub_video_gop_adapter): Add prio. - * video/efi_uga.c (grub_video_uga_adapter): Likewise. - * video/emu/sdl.c (grub_video_sdl_adapter): Likewise. - * video/i386/pc/vbe.c (grub_video_vbe_adapter): Likewise. - * video/i386/pc/vga.c (grub_video_vga_adapter): Likewise. - * video/ieee1275.c (grub_video_ieee1275_adapter): Likewise. - * video/sm712.c (grub_video_sm712_adapter): Likewise. + * include/VasEBoot/video.h (VasEBoot_video_adapter_prio_t): New type. + (VasEBoot_video_adapter): New field prio. + (VasEBoot_video_register): Respect prio when inserting. + * video/efi_gop.c (VasEBoot_video_gop_adapter): Add prio. + * video/efi_uga.c (VasEBoot_video_uga_adapter): Likewise. + * video/emu/sdl.c (VasEBoot_video_sdl_adapter): Likewise. + * video/i386/pc/vbe.c (VasEBoot_video_vbe_adapter): Likewise. + * video/i386/pc/vga.c (VasEBoot_video_vga_adapter): Likewise. + * video/ieee1275.c (VasEBoot_video_ieee1275_adapter): Likewise. + * video/sm712.c (VasEBoot_video_sm712_adapter): Likewise. Fix SDL driver ID. - * include/grub/video.h (grub_video_driver_id_t): New value - GRUB_VIDEO_DRIVER_SDL. - * video/emu/sdl.c (grub_video_sdl_adapter): Add id. + * include/VasEBoot/video.h (VasEBoot_video_driver_id_t): New value + VasEBoot_VIDEO_DRIVER_SDL. + * video/emu/sdl.c (VasEBoot_video_sdl_adapter): Add id. 2010-06-17 Colin Watson - * util/i386/pc/grub-setup.c (usage): Pass an extra `program_name' + * util/i386/pc/VasEBoot-setup.c (usage): Pass an extra `program_name' argument to printf. - * util/sparc64/ieee1275/grub-setup.c (usage): Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c (usage): Likewise. 2010-06-17 Colin Watson - * util/i386/pc/grub-setup.c (usage): Fix syntax error. - * util/sparc64/ieee1275/grub-setup.c (usage): Likewise. + * util/i386/pc/VasEBoot-setup.c (usage): Fix syntax error. + * util/sparc64/ieee1275/VasEBoot-setup.c (usage): Likewise. 2010-06-17 Colin Watson - * util/i386/pc/grub-setup.c (usage): Warn against running grub-setup - directly, and recommend grub-install instead. - * util/sparc64/ieee1275/grub-setup.c (usage): Likewise. + * util/i386/pc/VasEBoot-setup.c (usage): Warn against running VasEBoot-setup + directly, and recommend VasEBoot-install instead. + * util/sparc64/ieee1275/VasEBoot-setup.c (usage): Likewise. 2010-06-17 Colin Watson @@ -27789,16 +27789,16 @@ with "(,", fill the boot drive in between those two characters, but expect that a full partition specification including partition map names will follow. - * util/i386/pc/grub-setup.c (setup): Unless an explicit prefix was + * util/i386/pc/VasEBoot-setup.c (setup): Unless an explicit prefix was specified, write a prefix without the drive name but including a full partition specification. 2010-06-16 Colin Watson - * util/grub-mkconfig.in: Ignore non-option arguments, for + * util/VasEBoot-mkconfig.in: Ignore non-option arguments, for compatibility with older versions (before 2010-06-12) which did the - same. In particular, this makes it easier to ship an update-grub - wrapper which is compatible with that used with GRUB Legacy (Debian + same. In particular, this makes it easier to ship an update-VasEBoot + wrapper which is compatible with that used with VasEBoot Legacy (Debian bug #586056). 2010-06-14 Grégoire Sutre @@ -27812,37 +27812,37 @@ 2010-06-14 Colin Watson - * util/grub-mkconfig.in: Remove vestige of old argument parsing that + * util/VasEBoot-mkconfig.in: Remove vestige of old argument parsing that left this script non-functional. 2010-06-14 Colin Watson - * docs/man/grub-emu.h2m: New file. + * docs/man/VasEBoot-emu.h2m: New file. 2010-06-13 Colin Watson - * docs/grub.texi (Commands): Document reduced command set in rescue + * docs/VasEBoot.texi (Commands): Document reduced command set in rescue mode. (cpuid): New section. 2010-06-13 Grégoire Sutre - * kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev): Use the + * kern/emu/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Use the new partition naming style. - * util/grub-install.in: Adapt sed subtitutions in grub-probe calls. + * util/VasEBoot-install.in: Adapt sed subtitutions in VasEBoot-probe calls. 2010-06-12 BVK Chaitanya - Add "-o grub.iso" like cmdline options support. + Add "-o VasEBoot.iso" like cmdline options support. - * util/grub-install.in: Improve cmdline option parsing. - * util/grub-mkconfig.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/i386/efi/grub-install.in: Likewise. - * util/ieee1275/grub-install.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-install.in: Improve cmdline option parsing. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/i386/efi/VasEBoot-install.in: Likewise. + * util/ieee1275/VasEBoot-install.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2010-06-12 Colin Watson @@ -27850,247 +27850,247 @@ 2010-06-12 Thomas Schmitt - * util/grub-mkrescue.in: Pass unrecognized options to xorriso. + * util/VasEBoot-mkrescue.in: Pass unrecognized options to xorriso. 2010-06-12 Colin Watson Avoid false positives in fs.lst, partmap.lst, and video.lst due to prototype declarations. - * genmk.rb (PModule::rule): Define GRUB_LST_GENERATOR when + * genmk.rb (PModule::rule): Define VasEBoot_LST_GENERATOR when generating fs, partmap, and video lists. - * include/grub/fs.h (grub_fs_register): Omit prototype if - GRUB_LST_GENERATOR is defined. - * include/grub/partition.h (grub_partition_map_register): Likewise. - * include/grub/video.h (grub_video_register): Likewise. + * include/VasEBoot/fs.h (VasEBoot_fs_register): Omit prototype if + VasEBoot_LST_GENERATOR is defined. + * include/VasEBoot/partition.h (VasEBoot_partition_map_register): Likewise. + * include/VasEBoot/video.h (VasEBoot_video_register): Likewise. 2010-06-12 Javier Martín - * include/grub/types.h: Check for GRUB_CPU_SIZEOF_LONG when appropriate. + * include/VasEBoot/types.h: Check for VasEBoot_CPU_SIZEOF_LONG when appropriate. 2010-06-12 Thomas Schmitt - * util/grub-mkrescue.in: Support --xorriso argument. + * util/VasEBoot-mkrescue.in: Support --xorriso argument. 2010-06-12 Vladimir Serbinenko - * util/grub-mkrescue.in: Use -graft-points instead of -pathspecs. + * util/VasEBoot-mkrescue.in: Use -graft-points instead of -pathspecs. Suggested by: Thomas Schmitt. 2010-06-12 Vladimir Serbinenko - * util/grub-mkrescue.in: Add --sort-weight arguments to xorriso. + * util/VasEBoot-mkrescue.in: Add --sort-weight arguments to xorriso. Suggested by: Thomas Schmitt. 2010-06-12 Vladimir Serbinenko custom.cfg support. - * conf/common.rmk (grub-mkconfig_SCRIPTS): Add 41_custom. - * util/grub.d/41_custom.in: New file. + * conf/common.rmk (VasEBoot-mkconfig_SCRIPTS): Add 41_custom. + * util/VasEBoot.d/41_custom.in: New file. 2010-06-12 Colin Watson - * util/grub-mkrescue.in (make_image): Remove sh module, which has + * util/VasEBoot-mkrescue.in (make_image): Remove sh module, which has been merged back into normal. 2010-06-11 Colin Watson - * include/grub/efi/uga_draw.h (GRUB_EFI_UGA_GLT_MAX): Rename to ... - (GRUB_EFI_UGA_BLT_MAX): ... this (typo fix). + * include/VasEBoot/efi/uga_draw.h (VasEBoot_EFI_UGA_GLT_MAX): Rename to ... + (VasEBoot_EFI_UGA_BLT_MAX): ... this (typo fix). 2010-06-11 Colin Watson * Makefile.in (install-local): Include $(srcdir)/docs/man/$$dest.h2m when generating manual pages. - * docs/man/grub-bin2h.h2m: New file. - * docs/man/grub-editenv.h2m: New file. - * docs/man/grub-fstest.h2m: New file. - * docs/man/grub-install.h2m: New file. - * docs/man/grub-macho2img.h2m: New file. - * docs/man/grub-mkconfig.h2m: New file. - * docs/man/grub-mkdevicemap.h2m: New file. - * docs/man/grub-mkfont.h2m: New file. - * docs/man/grub-mkimage.h2m: New file. - * docs/man/grub-mkpasswd-pbkdf2.h2m: New file. - * docs/man/grub-mkrelpath.h2m: New file. - * docs/man/grub-mkrescue.h2m: New file. - * docs/man/grub-ofpathname.h2m: New file. - * docs/man/grub-pe2elf.h2m: New file. - * docs/man/grub-probe.h2m: New file. - * docs/man/grub-reboot.h2m: New file. - * docs/man/grub-script-check.h2m: New file. - * docs/man/grub-set-default.h2m: New file. - * docs/man/grub-setup.h2m: New file. + * docs/man/VasEBoot-bin2h.h2m: New file. + * docs/man/VasEBoot-editenv.h2m: New file. + * docs/man/VasEBoot-fstest.h2m: New file. + * docs/man/VasEBoot-install.h2m: New file. + * docs/man/VasEBoot-macho2img.h2m: New file. + * docs/man/VasEBoot-mkconfig.h2m: New file. + * docs/man/VasEBoot-mkdevicemap.h2m: New file. + * docs/man/VasEBoot-mkfont.h2m: New file. + * docs/man/VasEBoot-mkimage.h2m: New file. + * docs/man/VasEBoot-mkpasswd-pbkdf2.h2m: New file. + * docs/man/VasEBoot-mkrelpath.h2m: New file. + * docs/man/VasEBoot-mkrescue.h2m: New file. + * docs/man/VasEBoot-ofpathname.h2m: New file. + * docs/man/VasEBoot-pe2elf.h2m: New file. + * docs/man/VasEBoot-probe.h2m: New file. + * docs/man/VasEBoot-reboot.h2m: New file. + * docs/man/VasEBoot-script-check.h2m: New file. + * docs/man/VasEBoot-set-default.h2m: New file. + * docs/man/VasEBoot-setup.h2m: New file. 2010-06-10 Vladimir Serbinenko Use FOR_* macros instead of *_iterate whenever possible. * commands/handler.c: Removed. - * commands/help.c (grub_cmd_help): Use FOR_COMMANDS. - * commands/minicmd.c (grub_mini_cmd_lsmod): Use FOR_DL_MODULES. + * commands/help.c (VasEBoot_cmd_help): Use FOR_COMMANDS. + * commands/minicmd.c (VasEBoot_mini_cmd_lsmod): Use FOR_DL_MODULES. * conf/any-emu.rmk (kernel_img_SOURCES): Remove kern/handler.c. - * conf/common.rmk (script/lexer.c_DEPENDENCIES): Add grub_script.yy.h. - (grub_probe_SOURCES): Remove kern/parser.c. - (util/grub-script-check.c_DEPENDENCIES): Removed. - (grub_script_check_SOURCES): Remove kern/handler.c, kern/parser.c - and grub_script_check_init.c. - (grub_script_check_init.lst): Removed. - (grub_script_check_init.h): Likewise. - (grub_script_check_init.c): Likewise. + * conf/common.rmk (script/lexer.c_DEPENDENCIES): Add VasEBoot_script.yy.h. + (VasEBoot_probe_SOURCES): Remove kern/parser.c. + (util/VasEBoot-script-check.c_DEPENDENCIES): Removed. + (VasEBoot_script_check_SOURCES): Remove kern/handler.c, kern/parser.c + and VasEBoot_script_check_init.c. + (VasEBoot_script_check_init.lst): Removed. + (VasEBoot_script_check_init.h): Likewise. + (VasEBoot_script_check_init.c): Likewise. (pkglib_MODULES): Remove handler.mod and sh.mod. (handler_mod_SOURCES): Removed. (handler_mod_CFLAGS): Likewise. (handler_mod_LDFLAGS): Likewise. (normal_mod_SOURCES): Remove normal/handler.c. Add script/main.c, script/script.c, script/execute.c, - script/function.c, script/lexer.c, grub_script.tab.c - and grub_script.yy.c. + script/function.c, script/lexer.c, VasEBoot_script.tab.c + and VasEBoot_script.yy.c. * conf/i386-coreboot.rmk (kernel_img_SOURCES): Remove kern/handler.c. * conf/i386-ieee1275.rmk (kernel_img_SOURCES): Likewise. * conf/i386-pc.rmk (kernel_img_SOURCES): Likewise. - (grub_setup_SOURCES): Remove kern/parser.c. + (VasEBoot_setup_SOURCES): Remove kern/parser.c. * conf/i386-qemu.rmk (kernel_img_SOURCES): Remove kern/handler.c. * conf/mips-qemu-mips.rmk (kernel_img_SOURCES): Likewise. * conf/mips-yeeloong.rmk (kernel_img_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (kernel_img_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (kernel_img_SOURCES): Likewise. - (grub_setup_SOURCES): Remove kern/parser.c. + (VasEBoot_setup_SOURCES): Remove kern/parser.c. * conf/x86-efi.rmk (kernel_img_SOURCES): Remove kern/handler.c. - * gettext/gettext.c (grub_gettext_delete_list): Don't use grub_list_pop. - * include/grub/command.h (grub_command_iterate): Removed. + * gettext/gettext.c (VasEBoot_gettext_delete_list): Don't use VasEBoot_list_pop. + * include/VasEBoot/command.h (VasEBoot_command_iterate): Removed. (FOR_COMMANDS): New macro. - * include/grub/dl.h (grub_dl): New member next. - (grub_dl_iterate): Removed. - (grub_dl_head): New variable declaration. + * include/VasEBoot/dl.h (VasEBoot_dl): New member next. + (VasEBoot_dl_iterate): Removed. + (VasEBoot_dl_head): New variable declaration. (FOR_DL_MODULES): New macro. - * include/grub/fs.h: Include list.h. - (grub_fs): Make next first element. - (grub_fs_list): New variable declaration. - (grub_fs_register): Make inline. - (grub_fs_unregister): Likewise. - (grub_fs_iterate): Removed. + * include/VasEBoot/fs.h: Include list.h. + (VasEBoot_fs): Make next first element. + (VasEBoot_fs_list): New variable declaration. + (VasEBoot_fs_register): Make inline. + (VasEBoot_fs_unregister): Likewise. + (VasEBoot_fs_iterate): Removed. (FOR_FILESYSTEMS): New macro. - * include/grub/handler.h: Removed. - * include/grub/list.h (grub_list_hook_t): Removed. - (grub_list_test_t): Likewise. - (grub_list_pop): Likewise. - (grub_list_iterate): Likewise. - (grub_list_insert): Likewise. + * include/VasEBoot/handler.h: Removed. + * include/VasEBoot/list.h (VasEBoot_list_hook_t): Removed. + (VasEBoot_list_test_t): Likewise. + (VasEBoot_list_pop): Likewise. + (VasEBoot_list_iterate): Likewise. + (VasEBoot_list_insert): Likewise. (FOR_LIST_ELEMENTS): New macro. - * include/grub/parser.h (grub_parser_class): Removed. - (grub_parser_register): Likewise. - (grub_parser_unregister): Likewise. - (grub_parser_get_current): Likewise. - (grub_parser_set_current): Likewise. - (grub_register_rescue_parser): Likewise. - (grub_rescue_parse_line): New function. - * include/grub/partition.h (FOR_PARTITION_MAPS): Use FOR_LIST_ELEMENTS. - * include/grub/script_sh.h (grub_script_function_list): New variable + * include/VasEBoot/parser.h (VasEBoot_parser_class): Removed. + (VasEBoot_parser_register): Likewise. + (VasEBoot_parser_unregister): Likewise. + (VasEBoot_parser_get_current): Likewise. + (VasEBoot_parser_set_current): Likewise. + (VasEBoot_register_rescue_parser): Likewise. + (VasEBoot_rescue_parse_line): New function. + * include/VasEBoot/partition.h (FOR_PARTITION_MAPS): Use FOR_LIST_ELEMENTS. + * include/VasEBoot/script_sh.h (VasEBoot_script_function_list): New variable declaration. (FOR_SCRIPT_FUNCTIONS): New macro. - (grub_script_function_iterate): Removed. - (grub_normal_parse_line): New prototype. - * include/grub/term.h (FOR_ACTIVE_TERM_INPUTS): Use FOR_LIST_ELEMENTS. + (VasEBoot_script_function_iterate): Removed. + (VasEBoot_normal_parse_line): New prototype. + * include/VasEBoot/term.h (FOR_ACTIVE_TERM_INPUTS): Use FOR_LIST_ELEMENTS. (FOR_DISABLED_TERM_INPUTS): Likewise. (FOR_ACTIVE_TERM_OUTPUTS): Likewise. (FOR_DISABLED_TERM_OUTPUTS): Likewise. - * include/grub/video.h (grub_video_adapter): Move 'next' to first + * include/VasEBoot/video.h (VasEBoot_video_adapter): Move 'next' to first element. - (grub_video_register): Inline. - (grub_video_unregister): Likewise. - (grub_video_adapter_list): New variable declaration. - (grub_video_iterate): Removed. + (VasEBoot_video_register): Inline. + (VasEBoot_video_unregister): Likewise. + (VasEBoot_video_adapter_list): New variable declaration. + (VasEBoot_video_iterate): Removed. (FOR_VIDEO_ADAPTERS): New macro. - * kern/dl.c (grub_dl_list): Removed. All users updated. - (grub_dl_iterate): Removed. - * kern/fs.c (grub_fs_list): Make global. - (grub_fs_register): Removed. - (grub_fs_unregister): Likewise. - (grub_fs_iterate): Likewise. + * kern/dl.c (VasEBoot_dl_list): Removed. All users updated. + (VasEBoot_dl_iterate): Removed. + * kern/fs.c (VasEBoot_fs_list): Make global. + (VasEBoot_fs_register): Removed. + (VasEBoot_fs_unregister): Likewise. + (VasEBoot_fs_iterate): Likewise. * kern/handler.c: Removed. - * kern/list.c (grub_list_pop): Removed. - (grub_list_iterate): Likewise. - (grub_list_insert): Likewise. - (grub_named_list_find): Use FOR_LIST_ELEMENTS. - (grub_prio_list_insert): Don't use grub_list_insert. - * kern/main.c (grub_register_rescue_parser): Don't call - grub_register_rescue_parser. - * kern/parser.c (grub_parser_class): Removed. - (grub_parser_execute): Use grub_rescue_parse_line. - * kern/rescue_parser.c (grub_rescue_parse_line): Make global. - (grub_rescue_parser): Removed. - (grub_register_rescue_parser): Likewise. - * kern/rescue_reader.c (grub_rescue_run): Use grub_rescue_parse_line. + * kern/list.c (VasEBoot_list_pop): Removed. + (VasEBoot_list_iterate): Likewise. + (VasEBoot_list_insert): Likewise. + (VasEBoot_named_list_find): Use FOR_LIST_ELEMENTS. + (VasEBoot_prio_list_insert): Don't use VasEBoot_list_insert. + * kern/main.c (VasEBoot_register_rescue_parser): Don't call + VasEBoot_register_rescue_parser. + * kern/parser.c (VasEBoot_parser_class): Removed. + (VasEBoot_parser_execute): Use VasEBoot_rescue_parse_line. + * kern/rescue_parser.c (VasEBoot_rescue_parse_line): Make global. + (VasEBoot_rescue_parser): Removed. + (VasEBoot_register_rescue_parser): Likewise. + * kern/rescue_reader.c (VasEBoot_rescue_run): Use VasEBoot_rescue_parse_line. * normal/auth.c (is_authenticated): Use FOR_LIST_ELEMENTS. - (grub_auth_check_authentication): Likewise. + (VasEBoot_auth_check_authentication): Likewise. * normal/completion.c (iterate_command): Removed. - (grub_normal_do_completion): Use FOR_COMMANDS. + (VasEBoot_normal_do_completion): Use FOR_COMMANDS. * normal/handler.c: Removed. * normal/main.c (read_config_file): Remove parser changing. - (grub_normal_execute): Don't call read_handler_list. - (grub_normal_read_line_real): Statically allocate prompt. - (grub_cmdline_run): Use grub_normal_parse_line. - (GRUB_MOD_FINI): Don't call free_handler_list. + (VasEBoot_normal_execute): Don't call read_handler_list. + (VasEBoot_normal_read_line_real): Statically allocate prompt. + (VasEBoot_cmdline_run): Use VasEBoot_normal_parse_line. + (VasEBoot_MOD_FINI): Don't call free_handler_list. * normal/menu_entry.c (run): Likewise. - * script/function.c (grub_script_function_list): Make global. - (grub_script_function_iterate): Removed. - * script/main.c (grub_normal_parse_line): Make global. - (grub_sh_parser): Removed. - (GRUB_MOD_INIT): Likewise. - (GRUB_MOD_FINI): Likewise. - * tests/lib/functional_test.c (grub_functional_test): Use + * script/function.c (VasEBoot_script_function_list): Make global. + (VasEBoot_script_function_iterate): Removed. + * script/main.c (VasEBoot_normal_parse_line): Make global. + (VasEBoot_sh_parser): Removed. + (VasEBoot_MOD_INIT): Likewise. + (VasEBoot_MOD_FINI): Likewise. + * tests/lib/functional_test.c (VasEBoot_functional_test): Use FOR_LIST_ELEMENTS. - * tests/lib/test.c (free_failures): Don't use grub_list_pop. - (grub_test_run): Use FOR_LIST_ELEMENTS. + * tests/lib/test.c (free_failures): Don't use VasEBoot_list_pop. + (VasEBoot_test_run): Use FOR_LIST_ELEMENTS. * tests/lib/unit_test.c (main): Likewise. - * util/deviceiter.c (grub_util_iterate_devices): Don't use - grub_list_pop. - * util/grub-fstest.c (grub_term_input_class): Removed. - (grub_term_output_class): Likewise. - * util/grub-probe.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. - * util/sparc64/ieee1275/grub-setup.c: Likewise. - * util/grub-script-check.c (main): Don't call grub_init_all and - grub_fini_all. - * video/video.c (grub_video_adapter_list): Make global. - (grub_video_register): Removed. - (grub_video_unregister): Likewise. - (grub_video_iterate): Likewise. + * util/deviceiter.c (VasEBoot_util_iterate_devices): Don't use + VasEBoot_list_pop. + * util/VasEBoot-fstest.c (VasEBoot_term_input_class): Removed. + (VasEBoot_term_output_class): Likewise. + * util/VasEBoot-probe.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c: Likewise. + * util/VasEBoot-script-check.c (main): Don't call VasEBoot_init_all and + VasEBoot_fini_all. + * video/video.c (VasEBoot_video_adapter_list): Make global. + (VasEBoot_video_register): Removed. + (VasEBoot_video_unregister): Likewise. + (VasEBoot_video_iterate): Likewise. 2010-06-09 Vladimir Serbinenko - * docs/grub.texi (Vendor power-on button): Add Asus EeePC 1005PE as + * docs/VasEBoot.texi (Vendor power-on button): Add Asus EeePC 1005PE as reported by Henrique Ferreiro. 2010-06-09 Robert Millan - * util/grub.d/10_linux.in: Prefer compressed images over non-compressed + * util/VasEBoot.d/10_linux.in: Prefer compressed images over non-compressed ones, when both are available. 2010-06-08 Grégoire Sutre Make --version uniform and avoid hard-coded program name. - * util/grub-mkimage.c (main): Use `program_name' instead of + * util/VasEBoot-mkimage.c (main): Use `program_name' instead of hard-coded string. - * util/i386/pc/grub-setup.c (main): Likewise. - * util/sparc64/ieee1275/grub-setup.c (parse_options): Likewise. - * util/grub-install.in: Save the basename of $0 in $self, and use the + * util/i386/pc/VasEBoot-setup.c (main): Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c (parse_options): Likewise. + * util/VasEBoot-install.in: Save the basename of $0 in $self, and use the latter in informational messages. Use the same format for --version as the binary programs. - * util/grub-mkconfig.in: Likewise. - * util/grub-mkrescue.in: Likewise. - * util/grub-reboot.in: Likewise. - * util/grub-set-default.in: Likewise. - * util/i386/efi/grub-install.in: Likewise. - * util/ieee1275/grub-install.in: Likewise. - * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. + * util/VasEBoot-mkrescue.in: Likewise. + * util/VasEBoot-reboot.in: Likewise. + * util/VasEBoot-set-default.in: Likewise. + * util/i386/efi/VasEBoot-install.in: Likewise. + * util/ieee1275/VasEBoot-install.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Likewise. 2010-06-08 Grégoire Sutre - * util/i386/pc/grub-setup.c (setup): Use absolute offsets for start of + * util/i386/pc/VasEBoot-setup.c (setup): Use absolute offsets for start of embedding area. Use <= instead of == when checking for non-emptiness. 2010-06-08 Grégoire Sutre @@ -28099,103 +28099,103 @@ 2010-06-08 Colin Watson - * .bzrignore: Add ascii.bitmaps, ascii.h, grub_script.yy.c, and - grub_script.yy.h. + * .bzrignore: Add ascii.bitmaps, ascii.h, VasEBoot_script.yy.c, and + VasEBoot_script.yy.h. 2010-06-08 Colin Watson - * docs/grub.texi (History): Expand to cover GRUB 2. + * docs/VasEBoot.texi (History): Expand to cover VasEBoot 2. (Serial terminal): Refer to `terminal_input' and `terminal_output' commands, not `terminal'. (serial): Likewise. (terminal_input): New section. (terminal_output): New section. (uppermem): New section (stub). - (Obtaining and Building GRUB): Refer to Bazaar, not Subversion. + (Obtaining and Building VasEBoot): Refer to Bazaar, not Subversion. 2010-06-08 Colin Watson - * docs/grub.texi (Security): Menu entries are unrestricted by + * docs/VasEBoot.texi (Security): Menu entries are unrestricted by default, not restricted to superusers as I had previously thought. Reword to account for this. 2010-06-07 Colin Watson * kern/emu/misc.c (device_mapper_null_log): New function. - (grub_device_mapper_supported): New function. - * include/grub/emu/misc.h (grub_device_mapper_supported): Add + (VasEBoot_device_mapper_supported): New function. + * include/VasEBoot/emu/misc.h (VasEBoot_device_mapper_supported): Add prototype. * kern/emu/hostdisk.c (find_partition_start): Check whether device-mapper is supported before trying to use it. - * util/deviceiter.c (grub_util_iterate_devices): Likewise. + * util/deviceiter.c (VasEBoot_util_iterate_devices): Likewise. 2010-06-07 Colin Watson - * docs/grub.texi (Naming convention): Use GRUB 2 syntax. + * docs/VasEBoot.texi (Naming convention): Use VasEBoot 2 syntax. (File name syntax): Likewise. - (help): --all is no longer supported in GRUB 2. Be more precise + (help): --all is no longer supported in VasEBoot 2. Be more precise about pattern matching. 2010-06-07 Colin Watson - * normal/completion.c (grub_normal_do_completion): When completing + * normal/completion.c (VasEBoot_normal_do_completion): When completing arguments to "set" and the current word contains an equals sign, skip to after the equals sign before starting completion. 2010-06-07 Colin Watson - * fs/i386/pc/pxe.c (grub_pxe_open): Fix parsing of gateway_ip. + * fs/i386/pc/pxe.c (VasEBoot_pxe_open): Fix parsing of gateway_ip. 2010-06-07 Colin Watson - * docs/grub.texi (Network): New section. - (Device syntax): The network device is called `(pxe)' in GRUB 2, not - `(nd)' as in GRUB Legacy. + * docs/VasEBoot.texi (Network): New section. + (Device syntax): The network device is called `(pxe)' in VasEBoot 2, not + `(nd)' as in VasEBoot Legacy. (pxe_unload): New section. 2010-06-07 Colin Watson - * docs/grub.texi (Troubleshooting): `echo' is not usually available + * docs/VasEBoot.texi (Troubleshooting): `echo' is not usually available in the rescue shell, so recommend using `set' instead. Thanks, Jordan Uggla. 2010-06-07 Colin Watson - * docs/grub.texi (Filesystem): Refer to `search' instead of `find'. + * docs/VasEBoot.texi (Filesystem): Refer to `search' instead of `find'. (password): New section. (password_pbkdf2): New section. (search): New section. (Security): New section. (Troubleshooting): New section, currently very incomplete. - (Invoking grub-mkpasswd-pbkdf2): New section. + (Invoking VasEBoot-mkpasswd-pbkdf2): New section. (Internals): New section, currently very incomplete. 2010-06-07 Colin Watson - * util/grub.d/00_header.in: Add some more quoting (of + * util/VasEBoot.d/00_header.in: Add some more quoting (of "${prev_saved_entry}" and "${boot_once}") needed to make savedefault work again. Reported by: Mario 'BitKoenig' Holbe (Debian bug #584812). 2010-06-07 Colin Watson - * util/grub-mkpasswd-pbkdf2.c (main): Rename top-level `c' variable + * util/VasEBoot-mkpasswd-pbkdf2.c (main): Rename top-level `c' variable to `count', fixing variable shadowing that broke the -c option. 2010-06-05 Colin Watson - * util/grub.d/00_header.in: Quote values assigned to `saved_entry', + * util/VasEBoot.d/00_header.in: Quote values assigned to `saved_entry', in case they contain spaces. 2010-06-04 Colin Watson - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Prepend - "part_" to partmap module names, in line with grub-install. + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Prepend + "part_" to partmap module names, in line with VasEBoot-install. Reported by: Jindřich Makovička (Debian bug #584426). 2010-06-04 Colin Watson - * util/grub-mkimage.c: Make target-related error messages slightly + * util/VasEBoot-mkimage.c: Make target-related error messages slightly more helpful; -O talks about "format". Explicitly point to the use of -O if no target is specified. Reported by: Didier Raboud (Debian bug #584415). @@ -28213,101 +28213,101 @@ 2010-06-02 Colin Watson - * docs/grub.texi (Simple configuration): Fix copy-and-paste typo. + * docs/VasEBoot.texi (Simple configuration): Fix copy-and-paste typo. Thanks to Jordan Uggla for spotting this. 2010-06-02 Aleš Nesrsta Finally make USB usable. - * bus/usb/ohci.c (grub_ohci_reg_t): Add missing values. - (GRUB_OHCI_RHUB_PORT_POWER_MASK): New macro. - (GRUB_OHCI_RHUB_PORT_ALL_POWERED): Likewise. - (GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK): Likewise. - (GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT): Likewise. - (GRUB_OHCI_REG_FRAME_INTERVAL_FI_SHIFT): Likewise. - (GRUB_OHCI_FSMPS): Likewise. - (GRUB_OHCI_PERIODIC_START): Likewise. - (GRUB_OHCI_FRAME_INTERVAL): Likewise. - (GRUB_OHCI_SET_PORT_ENABLE): Likewise. - (GRUB_OHCI_CLEAR_PORT_ENABLE): Likewise. - (GRUB_OHCI_SET_PORT_RESET): Likewise. - (GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE): Likewise. - * bus/usb/ohci.c (grub_ohci_pci_iter): Various important fixups. - (grub_ohci_transaction): Likewise. - (grub_ohci_transfer): Improve condition detection algorithms. + * bus/usb/ohci.c (VasEBoot_ohci_reg_t): Add missing values. + (VasEBoot_OHCI_RHUB_PORT_POWER_MASK): New macro. + (VasEBoot_OHCI_RHUB_PORT_ALL_POWERED): Likewise. + (VasEBoot_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK): Likewise. + (VasEBoot_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT): Likewise. + (VasEBoot_OHCI_REG_FRAME_INTERVAL_FI_SHIFT): Likewise. + (VasEBoot_OHCI_FSMPS): Likewise. + (VasEBoot_OHCI_PERIODIC_START): Likewise. + (VasEBoot_OHCI_FRAME_INTERVAL): Likewise. + (VasEBoot_OHCI_SET_PORT_ENABLE): Likewise. + (VasEBoot_OHCI_CLEAR_PORT_ENABLE): Likewise. + (VasEBoot_OHCI_SET_PORT_RESET): Likewise. + (VasEBoot_OHCI_SET_PORT_RESET_STATUS_CHANGE): Likewise. + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Various important fixups. + (VasEBoot_ohci_transaction): Likewise. + (VasEBoot_ohci_transfer): Improve condition detection algorithms. Handle toggle property. Program the transactions correctly. Improve error handling. Various important fixups. - (grub_ohci_portstatus): Put register writes in right order. - * bus/usb/uhci.c (grub_free_queue): Compute last_trans. - (grub_uhci_transfer): Don't show "failed" message on success. - * bus/usb/usb.c (grub_usb_set_configuration): Zero-fill whole "toggle" + (VasEBoot_ohci_portstatus): Put register writes in right order. + * bus/usb/uhci.c (VasEBoot_free_queue): Compute last_trans. + (VasEBoot_uhci_transfer): Don't show "failed" message on success. + * bus/usb/usb.c (VasEBoot_usb_set_configuration): Zero-fill whole "toggle" array. - (grub_usb_device_initialize): Read first 8 bytes of descriptor to + (VasEBoot_usb_device_initialize): Read first 8 bytes of descriptor to determine its size. - * bus/usb/usbtrans.c (grub_usb_control_msg): Use descdev.maxsize0 even + * bus/usb/usbtrans.c (VasEBoot_usb_control_msg): Use descdev.maxsize0 even before initialization is completed. Use IN direction for empty transfers. Use last_trans and compute toggle. - * include/grub/usbtrans.h (grub_usb_transfer): New field last_trans. - (GRUB_USB_FEATURE_ENDP_HALT): Correct the value. - (GRUB_USB_FEATURE_DEV_REMOTE_WU): Likewise. - (GRUB_USB_FEATURE_TEST_MODE): Likewise. - * include/grub/usb.h (grub_usb_err_t): New value GRUB_USB_ERR_UNRECOVERABLE. - (grub_usb_device): Increase toggle to 256. - (grub_usbms_subclass_t): New values GRUB_USBMS_SUBCLASS_RBC, - GRUB_USBMS_SUBCLASS_MMC2, GRUB_USBMS_SUBCLASS_UFI and - GRUB_USBMS_SUBCLASS_SFF8070. - * include/grub/scsicmd.h (grub_scsi_test_unit_ready): New structure. - (grub_scsi_inquiry): New member page and alloc_length. - (grub_scsi_request_sense): New structure. - (grub_scsi_request_sense_data): Likewise. - (grub_scsi_read_capacity): New fields logical_block_addr, PMI and + * include/VasEBoot/usbtrans.h (VasEBoot_usb_transfer): New field last_trans. + (VasEBoot_USB_FEATURE_ENDP_HALT): Correct the value. + (VasEBoot_USB_FEATURE_DEV_REMOTE_WU): Likewise. + (VasEBoot_USB_FEATURE_TEST_MODE): Likewise. + * include/VasEBoot/usb.h (VasEBoot_usb_err_t): New value VasEBoot_USB_ERR_UNRECOVERABLE. + (VasEBoot_usb_device): Increase toggle to 256. + (VasEBoot_usbms_subclass_t): New values VasEBoot_USBMS_SUBCLASS_RBC, + VasEBoot_USBMS_SUBCLASS_MMC2, VasEBoot_USBMS_SUBCLASS_UFI and + VasEBoot_USBMS_SUBCLASS_SFF8070. + * include/VasEBoot/scsicmd.h (VasEBoot_scsi_test_unit_ready): New structure. + (VasEBoot_scsi_inquiry): New member page and alloc_length. + (VasEBoot_scsi_request_sense): New structure. + (VasEBoot_scsi_request_sense_data): Likewise. + (VasEBoot_scsi_read_capacity): New fields logical_block_addr, PMI and control. - * disk/scsi.c (grub_scsi_request_sense): New function. - (grub_scsi_test_unit_ready): Likewise. - (grub_scsi_inquiry): Fill new fields. - (grub_scsi_read_capacity): Likewise. - (grub_scsi_read10): Add request sense at the end. - (grub_scsi_read12): Likewise. - (grub_scsi_write10): Likewise. - (grub_scsi_write12): Likewise. - (grub_scsi_open): Add Test Unit Ready. - * disk/usbms.c (grub_usbms_finddevs): Check configcnt. + * disk/scsi.c (VasEBoot_scsi_request_sense): New function. + (VasEBoot_scsi_test_unit_ready): Likewise. + (VasEBoot_scsi_inquiry): Fill new fields. + (VasEBoot_scsi_read_capacity): Likewise. + (VasEBoot_scsi_read10): Add request sense at the end. + (VasEBoot_scsi_read12): Likewise. + (VasEBoot_scsi_write10): Likewise. + (VasEBoot_scsi_write12): Likewise. + (VasEBoot_scsi_open): Add Test Unit Ready. + * disk/usbms.c (VasEBoot_usbms_finddevs): Check configcnt. Support additional subclasses. Con't clear halt yet. Activate the proper config. Calculate LUNs correctly. - (grub_usbms_transfer): Various important fixups. + (VasEBoot_usbms_transfer): Various important fixups. 2010-06-02 Vladimir Serbinenko - * bus/pci.c (grub_pci_iterate) [GRUB_MACHINE_MIPS_YEELOONG]: Skip ghosts. - * bus/usb/ohci.c (grub_ohci_portstatus): Handle R/WC correctly. - (grub_ohci_fini_hw): New function. - (grub_ohci_restore_hw): Likewise. - (GRUB_MOD_INIT(ohci)): Register preboot hook. - (GRUB_MOD_FINI(ohci)): Shutdown OHCI. - * term/usb_keyboard.c: Remove include of grub/machine/console.h. + * bus/pci.c (VasEBoot_pci_iterate) [VasEBoot_MACHINE_MIPS_YEELOONG]: Skip ghosts. + * bus/usb/ohci.c (VasEBoot_ohci_portstatus): Handle R/WC correctly. + (VasEBoot_ohci_fini_hw): New function. + (VasEBoot_ohci_restore_hw): Likewise. + (VasEBoot_MOD_INIT(ohci)): Register preboot hook. + (VasEBoot_MOD_FINI(ohci)): Shutdown OHCI. + * term/usb_keyboard.c: Remove include of VasEBoot/machine/console.h. 2010-06-02 Vladimir Serbinenko Dedicated DMA allocations. - * bus/pci.c (grub_memalign_dma32): New function - (grub_dma_free): Likewise. - (grub_dma_get_virt): Likewise. - (grub_dma_get_phys): Likewise. - * bus/usb/ohci.c (grub_ohci): New members hcca_addr and hcca_chunk. - (grub_ohci_pci_iter): Use dma32_alloc. - (grub_ohci_transfer): Likewise. - * bus/usb/usbtrans.c (grub_usb_control_msg): Likewise. - (grub_usb_bulk_readwrite): Likewise. - * include/grub/pci.h: Add declarations. + * bus/pci.c (VasEBoot_memalign_dma32): New function + (VasEBoot_dma_free): Likewise. + (VasEBoot_dma_get_virt): Likewise. + (VasEBoot_dma_get_phys): Likewise. + * bus/usb/ohci.c (VasEBoot_ohci): New members hcca_addr and hcca_chunk. + (VasEBoot_ohci_pci_iter): Use dma32_alloc. + (VasEBoot_ohci_transfer): Likewise. + * bus/usb/usbtrans.c (VasEBoot_usb_control_msg): Likewise. + (VasEBoot_usb_bulk_readwrite): Likewise. + * include/VasEBoot/pci.h: Add declarations. 2010-06-02 Vladimir Serbinenko CS5536 support. * bus/cs5536.c: New file. - * bus/usb/ohci.c (grub_ohci_pci_iter): Check for CS5536. + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Check for CS5536. * conf/i386.rmk (pkglib_MODULES): Add cs5536.mod. (cs5536_mod_SOURCES): New variable. (cs5536_mod_CFLAGS): Likewise. @@ -28332,17 +28332,17 @@ (usb_keyboard_mod_SOURCES): New variable. (usb_keyboard_mod_CFLAGS): New variable. (usb_keyboard_mod_LDFLAGS): New variable. - * include/grub/smbus.h: New file. - * include/grub/cs5536.h: New file. + * include/VasEBoot/smbus.h: New file. + * include/VasEBoot/cs5536.h: New file. 2010-06-02 Colin Watson - * util/grub.d/00_header.in: Add safety check to make sure that + * util/VasEBoot.d/00_header.in: Add safety check to make sure that ${locale_dir} exists before trying to probe it. 2010-06-02 Colin Watson - * docs/grub.texi (SCO UnixWare): Remove, at Vladimir's request and + * docs/VasEBoot.texi (SCO UnixWare): Remove, at Vladimir's request and per the GNU Coding Standards; this is now too obscure to be worth documenting. (QNX): Likewise. @@ -28350,9 +28350,9 @@ 2010-06-02 Colin Watson - * docs/grub.texi (Chain-loading): New section. - (DOS/Windows): New section, borrowed from GRUB Legacy with details - adjusted for GRUB 2. + * docs/VasEBoot.texi (Chain-loading): New section. + (DOS/Windows): New section, borrowed from VasEBoot Legacy with details + adjusted for VasEBoot 2. (SCO UnixWare): Likewise. (QNX): Likewise. (chainloader): Add reference to `Block list syntax'. @@ -28361,34 +28361,34 @@ 2010-06-02 Colin Watson - * docs/grub.texi (GNU GRUB manual): Remove reference to `Invoking - the grub shell'. - (Installation): Add reference to `Making a GRUB bootable CD-ROM'. - (Installing GRUB using grub-install): Remove reference to the grub - shell; mention `grub-mkimage' and `grub-setup' instead. - (Invoking grub-install): Likewise. + * docs/VasEBoot.texi (GNU VasEBoot manual): Remove reference to `Invoking + the VasEBoot shell'. + (Installation): Add reference to `Making a VasEBoot bootable CD-ROM'. + (Installing VasEBoot using VasEBoot-install): Remove reference to the VasEBoot + shell; mention `VasEBoot-mkimage' and `VasEBoot-setup' instead. + (Invoking VasEBoot-install): Likewise. (Interface): Add reference to `Menu entry editor'. (serial): Remove `--device' option. 2010-06-02 Colin Watson - * docs/grub.texi (Configuration): New section, documenting - configuration file generation using grub-mkconfig. I've left a slot + * docs/VasEBoot.texi (Configuration): New section, documenting + configuration file generation using VasEBoot-mkconfig. I've left a slot for documenting the full shell scripting format but have not yet started on writing that up. - (Invoking grub-mkconfig): New section. + (Invoking VasEBoot-mkconfig): New section. 2010-06-02 Colin Watson - * docs/grub.texi (direntry): Remove grub-terminfo reference. - (GNU GRUB manual): Likewise. - (General commands): Update description of `terminfo' for GRUB 2. + * docs/VasEBoot.texi (direntry): Remove VasEBoot-terminfo reference. + (GNU VasEBoot manual): Likewise. + (General commands): Update description of `terminfo' for VasEBoot 2. 2010-06-02 Colin Watson - * commands/gptsync.c (grub_cmd_gptsync): Fix typos. - (GRUB_MOD_INIT): Fix capitalisation. - * docs/grub.texi (Command-line and menu entry commands): Document + * commands/gptsync.c (VasEBoot_cmd_gptsync): Fix typos. + (VasEBoot_MOD_INIT): Fix capitalisation. + * docs/VasEBoot.texi (Command-line and menu entry commands): Document gettext and gptsync commands. 2010-06-02 Colin Watson @@ -28402,40 +28402,40 @@ * kern/emu/getroot.c (find_root_device_from_mountinfo): New function. - (grub_guess_root_device): Call find_root_device_from_mountinfo + (VasEBoot_guess_root_device): Call find_root_device_from_mountinfo before looking in /dev. 2010-05-31 Vladimir Serbinenko - * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Use - GRUB_DISK_SIZE_UNKNOWN. - * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Likewise. + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Use + VasEBoot_DISK_SIZE_UNKNOWN. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Likewise. 2010-05-31 Jiro SEKIBA - * include/grub/disk.h (GRUB_DISK_SIZE_UNKNOWN): New macro. + * include/VasEBoot/disk.h (VasEBoot_DISK_SIZE_UNKNOWN): New macro. * fs/nilfs.c: Support 2nd super block in case 1st one is accidently corrupted or not synced properly. 2010-05-31 Vladimir Serbinenko - * normal/main.c (grub_normal_add_menu_entry): Avoid going out of args. + * normal/main.c (VasEBoot_normal_add_menu_entry): Avoid going out of args. Reported by: Seth Goldberg. 2010-05-31 Vladimir Serbinenko - * loader/multiboot_mbi2.c (grub_multiboot_make_mbi): Fix incorrect + * loader/multiboot_mbi2.c (VasEBoot_multiboot_make_mbi): Fix incorrect addition of dest. Reported by: Seth Goldberg. 2010-05-31 Vladimir Serbinenko - * commands/setpci.c (grub_setpci_iter): Fix an incorrect function check. + * commands/setpci.c (VasEBoot_setpci_iter): Fix an incorrect function check. Reported by: Seth Goldberg. 2010-05-31 Vladimir Serbinenko - * loader/multiboot_elfxx.c (grub_multiboot_load_elfXX) [__mips]: Check + * loader/multiboot_elfxx.c (VasEBoot_multiboot_load_elfXX) [__mips]: Check 64-bit address as signed on MIPS. 2010-05-28 Colin Watson @@ -28445,25 +28445,25 @@ 2010-05-28 BVK Chaitanya - Fix grub-emu issues on NetBSD, with gcc 4.1.3. + Fix VasEBoot-emu issues on NetBSD, with gcc 4.1.3. * conf/any-emu.rmk: Remove unnecessary COMMON_CFLAGS. - * include/grub/emu/misc.h (canonicalize_file_name): New Prototype. + * include/VasEBoot/emu/misc.h (canonicalize_file_name): New Prototype. * kern/misc.c (__enable_execute_stack): Disable on - GRUB_MACHINE_EMU. + VasEBoot_MACHINE_EMU. 2010-05-28 Colin Watson - Make grub-probe work with symbolic links under /dev/mapper as well + Make VasEBoot-probe work with symbolic links under /dev/mapper as well as with real block devices. The Linux world seems to be (at best) - in transition here, and GRUB shouldn't get caught in the middle. + in transition here, and VasEBoot shouldn't get caught in the middle. * kern/emu/getroot.c (find_root_device): Follow symbolic links under /dev/mapper. 2010-05-27 Colin Watson - * util/grub-script-check.c (main): Ensure defined behaviour on empty + * util/VasEBoot-script-check.c (main): Ensure defined behaviour on empty input files (in which case exit zero). 2010-05-27 Colin Watson @@ -28475,13 +28475,13 @@ 2010-05-27 Robert Millan - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Insert + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Insert partmap module to handle cross-partmap setups. Reported by Orestes Mas. Gràcies! 2010-05-27 Colin Watson - * util/grub-mkrescue.in: Initialise override_dir rather than + * util/VasEBoot-mkrescue.in: Initialise override_dir rather than assuming that it's unset or empty in the environment. 2010-05-26 Grégoire Sutre @@ -28495,7 +28495,7 @@ 2010-05-23 Vladimir Serbinenko - * commands/usbtest.c (grub_usb_get_string): Properly support UTF-16. + * commands/usbtest.c (VasEBoot_usb_get_string): Properly support UTF-16. 2010-05-23 Vladimir Serbinenko @@ -28507,11 +28507,11 @@ (cmostest_mod_CFLAGS): Likewise. (cmostest_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk: Likewise. - * docs/grub.texi (Vendor power-on keys): New section. - * util/grub-mkconfig.in: export GRUB_DEFAULT_BUTTON, - GRUB_HIDDEN_TIMEOUT_BUTTON, GRUB_TIMEOUT_BUTTON - and GRUB_BUTTON_CMOS_ADDRESS. - * util/grub.d/00_header.in: Handle powering-on by separate button. + * docs/VasEBoot.texi (Vendor power-on keys): New section. + * util/VasEBoot-mkconfig.in: export VasEBoot_DEFAULT_BUTTON, + VasEBoot_HIDDEN_TIMEOUT_BUTTON, VasEBoot_TIMEOUT_BUTTON + and VasEBoot_BUTTON_CMOS_ADDRESS. + * util/VasEBoot.d/00_header.in: Handle powering-on by separate button. 2010-05-23 Vladimir Serbinenko @@ -28522,22 +28522,22 @@ 2010-05-23 Vladimir Serbinenko - * gfxmenu/view.c (grub_gfxmenu_draw_terminal_box): Apply only to current + * gfxmenu/view.c (VasEBoot_gfxmenu_draw_terminal_box): Apply only to current buffer since gfxterm handles double repaint. 2010-05-23 Vladimir Serbinenko - * gfxmenu/gfxmenu.c (grub_gfxmenu_try): Change viewport on both buffers. + * gfxmenu/gfxmenu.c (VasEBoot_gfxmenu_try): Change viewport on both buffers. * term/gfxterm.c (real_scroll): Likewise. 2010-05-21 Vladimir Serbinenko - * kern/i386/pc/mmap.c (grub_machine_mmap_iterate): Zero-fill entry + * kern/i386/pc/mmap.c (VasEBoot_machine_mmap_iterate): Zero-fill entry before calling BIOS. 2010-05-21 Vladimir Serbinenko - * include/grub/i18n.h: Always enable grub_gettext. + * include/VasEBoot/i18n.h: Always enable VasEBoot_gettext. 2010-05-21 Vladimir Serbinenko @@ -28546,12 +28546,12 @@ 2010-05-21 Colin Watson - * util/grub-mkconfig.in: Fix handling of -o so that it works when + * util/VasEBoot-mkconfig.in: Fix handling of -o so that it works when not the first option. 2010-05-20 Colin Watson - * util/grub-mkrelpath.c (usage): Remove excess apostrophe. + * util/VasEBoot-mkrelpath.c (usage): Remove excess apostrophe. 2010-05-20 Colin Watson @@ -28560,52 +28560,52 @@ 2010-05-20 Grégoire Sutre - * kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev) [__NetBSD__]: + * kern/emu/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__NetBSD__]: Fix merge error in NetBSD code. (find_partition_start) [__NetBSD__]: Likewise. 2010-05-19 BVK Chaitanya - Fix grub-mkrescue usage unit testing. + Fix VasEBoot-mkrescue usage unit testing. - * tests/util/grub-shell.in: Use --grub-mkimage with grub-mkrescue. + * tests/util/VasEBoot-shell.in: Use --VasEBoot-mkimage with VasEBoot-mkrescue. 2010-05-18 Christian Franke - * util/grub.d/10_windows.in: Use path names instead of + * util/VasEBoot.d/10_windows.in: Use path names instead of drive letters to prevent warning from Cygwin 1.7. Add drivemap command to menuentry if needed. 2010-05-18 Justus Winter <4winter@informatik.uni-hamburg.de> - * util/grub.d/10_hurd.in: Include all gnumach* kernels, not only + * util/VasEBoot.d/10_hurd.in: Include all gnumach* kernels, not only gnumach and gnumach.gz. 2010-05-18 Vladimir Serbinenko - * include/grub/i18n.h (gettext): Inline instead of using #define. - (grub_gettext): Likewise. + * include/VasEBoot/i18n.h (gettext): Inline instead of using #define. + (VasEBoot_gettext): Likewise. (_): Likewise. 2010-05-18 Vladimir Serbinenko - * Makefile.in (CPPFLAGS): Replace -DGRUB_LIBDIR with - -DGRUB_PKGLIBROOTDIR= and prepend @PACKAGE_TARNAME@. All users updated. - * util/grub-mkimage.c (image_targets): Add i386-multiboot. + * Makefile.in (CPPFLAGS): Replace -DVasEBoot_LIBDIR with + -DVasEBoot_PKGLIBROOTDIR= and prepend @PACKAGE_TARNAME@. All users updated. + * util/VasEBoot-mkimage.c (image_targets): Add i386-multiboot. (main): Add a slash after pkglibdirroot. 2010-05-18 Vladimir Serbinenko - * util/grub-install.in: Add missing "in" keyword. + * util/VasEBoot-install.in: Add missing "in" keyword. 2010-05-18 Vladimir Serbinenko - * util/grub-mkrescue.in: Remove -O i386-pc duplication. + * util/VasEBoot-mkrescue.in: Remove -O i386-pc duplication. Reported by: Seth Goldberg. 2010-05-18 Vladimir Serbinenko - * po/POTFILES: Rename util/grub-mkrawimage.c to util/grub-mkimage.c. + * po/POTFILES: Rename util/VasEBoot-mkrawimage.c to util/VasEBoot-mkimage.c. 2010-05-18 Colin Watson @@ -28613,7 +28613,7 @@ * util/hostdisk.c (device_is_mapped): New function. (find_partition_start): New function, partly broken out from - linux_find_partition and grub_util_biosdisk_get_grub_dev but with + linux_find_partition and VasEBoot_util_biosdisk_get_VasEBoot_dev but with device-mapper support added. (linux_find_partition): Use find_partition_start. (convert_system_partition_to_system_disk): Add `st' argument. @@ -28621,17 +28621,17 @@ available; only DM-RAID devices are understood at present. (find_system_device): Add `st' argument. Pass it to convert_system_partition_to_system_disk. - (grub_util_biosdisk_get_grub_dev): Pass stat result to + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Pass stat result to find_system_device and convert_system_partition_to_system_disk. Use find_partition_start. - * conf/common.rmk (grub_mkdevicemap_SOURCES): Add kern/env.c, + * conf/common.rmk (VasEBoot_mkdevicemap_SOURCES): Add kern/env.c, kern/err.c, kern/list.c, kern/misc.c, and kern/emu/mm.c. * util/deviceiter.c [__linux__]: Define MINOR. - (grub_util_iterate_devices): Add support for DM-RAID disk devices. - * util/mkdevicemap.c (grub_putchar): New function. - (grub_getkey): New function. - (grub_refresh): New function. + (VasEBoot_util_iterate_devices): Add support for DM-RAID disk devices. + * util/mkdevicemap.c (VasEBoot_putchar): New function. + (VasEBoot_getkey): New function. + (VasEBoot_refresh): New function. (main): Set debug=all if -v -v is used. 2010-05-18 Colin Watson @@ -28640,22 +28640,22 @@ * util/misc.c (canonicalize_file_name): Move to ... * kern/emu/misc.c (canonicalize_file_name): ... here. Needed by - grub_make_system_path_relative_to_its_root. + VasEBoot_make_system_path_relative_to_its_root. 2010-05-18 Colin Watson - * util/grub-mkrescue.in: Sync up with grub-install in terms of how - we handle finding grub-mkimage. Default to finding grub-mkimage in + * util/VasEBoot-mkrescue.in: Sync up with VasEBoot-install in terms of how + we handle finding VasEBoot-mkimage. Default to finding VasEBoot-mkimage in ${bindir} with program_transform_name applied, and provide a - --grub-mkimage option to override this. + --VasEBoot-mkimage option to override this. 2010-05-17 Vladimir Serbinenko - Remove grub-mkisofs. + Remove VasEBoot-mkisofs. - * conf/common.rmk (bin_UTILITIES): Remove grub-mkisofs. - (grub_mkisofs_SOURCES): Removed. - (grub_mkisofs_CFLAGS): Removed. + * conf/common.rmk (bin_UTILITIES): Remove VasEBoot-mkisofs. + (VasEBoot_mkisofs_SOURCES): Removed. + (VasEBoot_mkisofs_CFLAGS): Removed. * util/mkisofs/defaults.h: Removed. * util/mkisofs/eltorito.c: Likewise. * util/mkisofs/exclude.h: Likewise. @@ -28680,143 +28680,143 @@ 2010-05-17 Vladimir Serbinenko - Unify grub-mkimage accross platforms. + Unify VasEBoot-mkimage accross platforms. - * Makefile.in (CPPFLAGS): Set GRUB_LIBDIR to $(libdir). - * conf/common.rmk (bin_UTILITIES): Removed grub-mkelfimage. - (grub_mkelfimage_SOURCES): Removed. - (util/elf/grub-mkimage.c_DEPENDENCIES): Renamed to .. - (util/grub-mkimage.c_DEPENDENCIES): .. this. - (bin_UTILITIES): Add grub-mkimage. - (grub_mkimage_SOURCES): New variable. + * Makefile.in (CPPFLAGS): Set VasEBoot_LIBDIR to $(libdir). + * conf/common.rmk (bin_UTILITIES): Removed VasEBoot-mkelfimage. + (VasEBoot_mkelfimage_SOURCES): Removed. + (util/elf/VasEBoot-mkimage.c_DEPENDENCIES): Renamed to .. + (util/VasEBoot-mkimage.c_DEPENDENCIES): .. this. + (bin_UTILITIES): Add VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): New variable. (kernel_img_HEADERS): Remove machine/kernel.h. * conf/i386-pc.rmk (pkglib_IMAGES): Remove kernel.img. (pkglib_PROGRAMS): Add kernel.img. (kernel_img_HEADERS): Add machine/kernel.h. (kernel_img_FORMAT): Removed. - (bin_UTILITIES): Remove grub-mkimage. - (grub_mkimage_SOURCES): Removed. - (grub_mkimage_CFLAGS): Likewise. - (util/grub-mkrawimage.c_DEPENDENCIES): Likewise. + (bin_UTILITIES): Remove VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): Removed. + (VasEBoot_mkimage_CFLAGS): Likewise. + (util/VasEBoot-mkrawimage.c_DEPENDENCIES): Likewise. * conf/i386-qemu.rmk (pkglib_IMAGES): Remove kernel.img. (pkglib_PROGRAMS): Add kernel.img. - (bin_UTILITIES): Remove grub-mkimage. - (grub_mkimage_SOURCES): Removed. - (grub_mkimage_CFLAGS): Likewise. - (util/grub-mkrawimage.c_DEPENDENCIES): Likewise. + (bin_UTILITIES): Remove VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): Removed. + (VasEBoot_mkimage_CFLAGS): Likewise. + (util/VasEBoot-mkrawimage.c_DEPENDENCIES): Likewise. * conf/mips-qemu-mips.rmk (pkglib_IMAGES): Remove kernel.img. (pkglib_PROGRAMS): Add kernel.img. * conf/mips-yeeloong.rmk (pkglib_IMAGES): Remove kernel.img. (pkglib_PROGRAMS): Add kernel.img. - * conf/mips.rmk (bin_UTILITIES): Remove grub-mkimage. - (grub_mkimage_SOURCES): Removed. - (grub_mkimage_CFLAGS): Likewise. - (util/grub-mkrawimage.c_DEPENDENCIES): Likewise. + * conf/mips.rmk (bin_UTILITIES): Remove VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): Removed. + (VasEBoot_mkimage_CFLAGS): Likewise. + (util/VasEBoot-mkrawimage.c_DEPENDENCIES): Likewise. * conf/sparc64-ieee1275.rmk (pkglib_IMAGES): Remove kernel.img. (pkglib_PROGRAMS): Add kernel.img. - (bin_UTILITIES): Remove grub-mkimage. - (grub_mkimage_SOURCES): Removed. - (grub_mkimage_CFLAGS): Likewise. - (util/grub-mkrawimage.c_DEPENDENCIES): Likewise. - * conf/x86-efi.rmk (bin_UTILITIES): Remove grub-mkimage. - (grub_mkimage_SOURCES): Removed. - (grub_mkimage_CFLAGS): Likewise. - (util/grub-mkrawimage.c_DEPENDENCIES): Likewise. + (bin_UTILITIES): Remove VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): Removed. + (VasEBoot_mkimage_CFLAGS): Likewise. + (util/VasEBoot-mkrawimage.c_DEPENDENCIES): Likewise. + * conf/x86-efi.rmk (bin_UTILITIES): Remove VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): Removed. + (VasEBoot_mkimage_CFLAGS): Likewise. + (util/VasEBoot-mkrawimage.c_DEPENDENCIES): Likewise. * configure.ac (machine_CFLAGS): Add "-DMACHINE". - * include/grub/efi/pe32.h (grub_pe32_optional_header): Split into ... - (grub_pe32_optional_header): ... this. - (grub_pe64_optional_header): ... and this. All users updated. - (GRUB_PE32_PE32_MAGIC): Split into .. - (GRUB_PE32_PE32_MAGIC): .. this. - (GRUB_PE32_PE64_MAGIC): .. and this. - (GRUB_PE32_SIGNATURE_SIZE): New definition. - * include/grub/elf.h (PT_GNU_STACK): New definition. - * include/grub/i386/coreboot/kernel.h: Merged into include/grub/offsets.h. All users updated. - * include/grub/i386/efi/kernel.h: Likewise. - * include/grub/i386/kernel.h: Likewise. - * include/grub/i386/pc/kernel.h: Likewise. - * include/grub/i386/qemu/boot.h: Likewise. - * include/grub/mips/kernel.h: Likewise. - * include/grub/mips/qemu-mips/kernel.h: Likewise. - * include/grub/powerpc/ieee1275/kernel.h: Likewise. - * include/grub/powerpc/kernel.h: Likewise. - * include/grub/sparc64/ieee1275/boot.h: Likewise. - * include/grub/sparc64/ieee1275/kernel.h: Likewise. - * include/grub/sparc64/kernel.h: Likewise. - * include/grub/x86_64/efi/kernel.h: Likewise. - * include/grub/x86_64/kernel.h: Likewise. - * include/grub/offsets.h: New file. - * include/grub/kernel.h (grub_module_info): Split into ... - (grub_module_info32): ... this. - (grub_module_info64): ... and this. - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_KERNEL_SEG): Moved from here ... - * include/grub/offsets.h (GRUB_BOOT_I386_PC_KERNEL_SEG): ... here. - (grub_boot_blocklist): Moved from here ... - * include/grub/offsets.h (grub_pc_bios_boot_blocklist): ... here. - * include/grub/i386/pc/memory.h (GRUB_MEMORY_MACHINE_UPPER): Moved from here. - * include/grub/offsets.h (GRUB_MEMORY_I386_PC_UPPER): .. here. - * include/grub/types.h (grub_target_to_host16): Removed. - (grub_target_to_host32): Likewise. - (grub_target_to_host64): Likewise. - (grub_host_to_target16): Likewise. - (grub_host_to_target32): Likewise. - (grub_host_to_target64): Likewise. - (grub_host_to_target_addr): Likewise. + * include/VasEBoot/efi/pe32.h (VasEBoot_pe32_optional_header): Split into ... + (VasEBoot_pe32_optional_header): ... this. + (VasEBoot_pe64_optional_header): ... and this. All users updated. + (VasEBoot_PE32_PE32_MAGIC): Split into .. + (VasEBoot_PE32_PE32_MAGIC): .. this. + (VasEBoot_PE32_PE64_MAGIC): .. and this. + (VasEBoot_PE32_SIGNATURE_SIZE): New definition. + * include/VasEBoot/elf.h (PT_GNU_STACK): New definition. + * include/VasEBoot/i386/coreboot/kernel.h: Merged into include/VasEBoot/offsets.h. All users updated. + * include/VasEBoot/i386/efi/kernel.h: Likewise. + * include/VasEBoot/i386/kernel.h: Likewise. + * include/VasEBoot/i386/pc/kernel.h: Likewise. + * include/VasEBoot/i386/qemu/boot.h: Likewise. + * include/VasEBoot/mips/kernel.h: Likewise. + * include/VasEBoot/mips/qemu-mips/kernel.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/kernel.h: Likewise. + * include/VasEBoot/powerpc/kernel.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/boot.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/kernel.h: Likewise. + * include/VasEBoot/sparc64/kernel.h: Likewise. + * include/VasEBoot/x86_64/efi/kernel.h: Likewise. + * include/VasEBoot/x86_64/kernel.h: Likewise. + * include/VasEBoot/offsets.h: New file. + * include/VasEBoot/kernel.h (VasEBoot_module_info): Split into ... + (VasEBoot_module_info32): ... this. + (VasEBoot_module_info64): ... and this. + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_KERNEL_SEG): Moved from here ... + * include/VasEBoot/offsets.h (VasEBoot_BOOT_I386_PC_KERNEL_SEG): ... here. + (VasEBoot_boot_blocklist): Moved from here ... + * include/VasEBoot/offsets.h (VasEBoot_pc_bios_boot_blocklist): ... here. + * include/VasEBoot/i386/pc/memory.h (VasEBoot_MEMORY_MACHINE_UPPER): Moved from here. + * include/VasEBoot/offsets.h (VasEBoot_MEMORY_I386_PC_UPPER): .. here. + * include/VasEBoot/types.h (VasEBoot_target_to_host16): Removed. + (VasEBoot_target_to_host32): Likewise. + (VasEBoot_target_to_host64): Likewise. + (VasEBoot_host_to_target16): Likewise. + (VasEBoot_host_to_target32): Likewise. + (VasEBoot_host_to_target64): Likewise. + (VasEBoot_host_to_target_addr): Likewise. - Support grub-mkrescue for efi, coreboot and qemu. + Support VasEBoot-mkrescue for efi, coreboot and qemu. - * conf/x86-efi.rmk (bin_SCRIPTS): Add grub-mkrescue. - * kern/efi/init.c (grub_efi_set_prefix): Handle baked in prefix. - * util/elf/grub-mkimage.c: Merged into util/grub-mkimage.c. - * util/grub-mkrawimage.c: Moved from here ... - * util/grub-mkimage.c: ... here. All users updated. + * conf/x86-efi.rmk (bin_SCRIPTS): Add VasEBoot-mkrescue. + * kern/efi/init.c (VasEBoot_efi_set_prefix): Handle baked in prefix. + * util/elf/VasEBoot-mkimage.c: Merged into util/VasEBoot-mkimage.c. + * util/VasEBoot-mkrawimage.c: Moved from here ... + * util/VasEBoot-mkimage.c: ... here. All users updated. (ALIGN_ADDR): Use image_target. (TARGET_NO_FIELD): New const. (image_target_desc): New type. (image_targets): New array. - (grub_target_to_host64): Use image_target. - (grub_target_to_host32): Likewise. - (grub_target_to_host16): Likewise. - (grub_host_to_target64): Likewise. - (grub_host_to_target32): Likewise. - (grub_host_to_target16): Likewise. - (grub_host_to_target_addr): Likewise. + (VasEBoot_target_to_host64): Use image_target. + (VasEBoot_target_to_host32): Likewise. + (VasEBoot_target_to_host16): Likewise. + (VasEBoot_host_to_target64): Likewise. + (VasEBoot_host_to_target32): Likewise. + (VasEBoot_host_to_target16): Likewise. + (VasEBoot_host_to_target_addr): Likewise. (generate_image): Handle multiimage. (main): Require -O parameter. All users updated. - * util/grub-mkimagexx.c: New file. Based on util/grub-mkrawimage.c and - util/efi/grub-mkimage.c - * util/grub-mkrescue.in: Handle coreboot, efi and qemu. + * util/VasEBoot-mkimagexx.c: New file. Based on util/VasEBoot-mkrawimage.c and + util/efi/VasEBoot-mkimage.c + * util/VasEBoot-mkrescue.in: Handle coreboot, efi and qemu. New option --rom-directory. Use xorriso. - * util/i386/efi/grub-mkimage.c: Removed. - * util/i386/pc/grub-setup.c (grub_target_to_host16): New definition. - (grub_target_to_host32): Likewise. - (grub_target_to_host64): Likewise. - (grub_host_to_target16): Likewise. - (grub_host_to_target32): Likewise. - (grub_host_to_target64): Likewise. - * util/sparc64/ieee1275/grub-setup.c (grub_target_to_host16): New definition. - (grub_target_to_host32): Likewise. - (grub_target_to_host64): Likewise. - (grub_host_to_target16): Likewise. - (grub_host_to_target32): Likewise. - (grub_host_to_target64): Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Removed. + * util/i386/pc/VasEBoot-setup.c (VasEBoot_target_to_host16): New definition. + (VasEBoot_target_to_host32): Likewise. + (VasEBoot_target_to_host64): Likewise. + (VasEBoot_host_to_target16): Likewise. + (VasEBoot_host_to_target32): Likewise. + (VasEBoot_host_to_target64): Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c (VasEBoot_target_to_host16): New definition. + (VasEBoot_target_to_host32): Likewise. + (VasEBoot_target_to_host64): Likewise. + (VasEBoot_host_to_target16): Likewise. + (VasEBoot_host_to_target32): Likewise. + (VasEBoot_host_to_target64): Likewise. 2010-05-17 BVK Chaitanya Source tree is reorganized for emu build. - * include/grub/util/console.h: Move from here... - * include/grub/emu/console.h: ...to here. - * include/grub/util/getroot.h: Move from here... - * include/grub/emu/getroot.h: ...to here. - * include/grub/util/hostdisk.h: Move from here... - * include/grub/emu/hostdisk.h: ...to here. + * include/VasEBoot/util/console.h: Move from here... + * include/VasEBoot/emu/console.h: ...to here. + * include/VasEBoot/util/getroot.h: Move from here... + * include/VasEBoot/emu/getroot.h: ...to here. + * include/VasEBoot/util/hostdisk.h: Move from here... + * include/VasEBoot/emu/hostdisk.h: ...to here. * util/console.c: Move from here... * kern/emu/console.c: ...to here. * util/getroot.c: Move from here... * kern/emu/getroot.c: ...to here. - * util/grub-emu.c: Move from here... + * util/VasEBoot-emu.c: Move from here... * kern/emu/main.c: ...to here. * util/hostdisk.c: Move from here... * kern/emu/hostdisk.c: ...to here. @@ -28833,8 +28833,8 @@ * util/usb.c: Move from here... * bus/usb/emu/usb.c: ...to here. - * include/grub/emu/misc.h: New header for grub-emu functions. - * kern/emu/misc.c: grub-emu functions separated from util/misc.c + * include/VasEBoot/emu/misc.h: New header for VasEBoot-emu functions. + * kern/emu/misc.c: VasEBoot-emu functions separated from util/misc.c * conf/any-emu.rmk: Rule updates for above renames. * conf/common.rmk: Likewise. @@ -28845,19 +28845,19 @@ * conf/x86-efi.rmk: Likewise. * disk/lvm.h: #include updates for above renames. - * util/grub-mkrelpath.c: Likewise. - * util/grub-probe.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. - * util/sparc64/ieee1275/grub-setup.c: Likewise. + * util/VasEBoot-mkrelpath.c: Likewise. + * util/VasEBoot-probe.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c: Likewise. * kern/emu/console.c: Likewise. * kern/emu/getroot.c: Likewise. * kern/emu/hostdisk.c: Likewise. - * kern/emu/main.c: Likewise. (was grub-emu.c earlier) + * kern/emu/main.c: Likewise. (was VasEBoot-emu.c earlier) - * include/grub/dl.h: Remove grub_dl_{ref,unref}. - * include/grub/util/misc.h: Move grub-emu functions to emu/misc.h. - * kern/dl.c: Handle null mod in grub_dl_{ref,unref}. - * util/misc.c: Remove grub-emu functions. + * include/VasEBoot/dl.h: Remove VasEBoot_dl_{ref,unref}. + * include/VasEBoot/util/misc.h: Move VasEBoot-emu functions to emu/misc.h. + * kern/dl.c: Handle null mod in VasEBoot_dl_{ref,unref}. + * util/misc.c: Remove VasEBoot-emu functions. 2010-05-13 Vladimir Serbinenko @@ -28867,7 +28867,7 @@ * gfxmenu/gui_circular_progress.c (circprog_destroy): Unregister timeout hook. (circprog_set_property): Register and unregister timeout hook. - * gfxmenu/gui_label.c (grub_gui_label): New fields template and value. + * gfxmenu/gui_label.c (VasEBoot_gui_label): New fields template and value. (label_destroy): Free template. and unregister hook. (label_set_state): New function. (label_set_property): Handle templates and hooks. @@ -28875,18 +28875,18 @@ timeout hook. (progress_bar_set_property): Register and unregister timeout hook. * gfxmenu/view.c (TIMEOUT_COMPONENT_ID): Move from here ... - * include/grub/gui.h (GRUB_GFXMENU_TIMEOUT_COMPONENT_ID): ...to here - * gfxmenu/view.c (grub_gfxmenu_timeout_notifications): New variable. + * include/VasEBoot/gui.h (VasEBoot_GFXMENU_TIMEOUT_COMPONENT_ID): ...to here + * gfxmenu/view.c (VasEBoot_gfxmenu_timeout_notifications): New variable. (update_timeout_visit): Removed. (update_timeouts): New function. (redraw_timeouts): Likewise. - (grub_gfxmenu_print_timeout): Use update_timeouts and redraw_timeouts. - (grub_gfxmenu_clear_timeout): Likewise. - * include/grub/gui.h (grub_gfxmenu_set_state_t): New type. - (grub_gfxmenu_timeout_notify): Likewise. - (grub_gfxmenu_timeout_notifications): New external variable. - (grub_gfxmenu_timeout_register): New function. - (grub_gfxmenu_timeout_unregister): Likewise. + (VasEBoot_gfxmenu_print_timeout): Use update_timeouts and redraw_timeouts. + (VasEBoot_gfxmenu_clear_timeout): Likewise. + * include/VasEBoot/gui.h (VasEBoot_gfxmenu_set_state_t): New type. + (VasEBoot_gfxmenu_timeout_notify): Likewise. + (VasEBoot_gfxmenu_timeout_notifications): New external variable. + (VasEBoot_gfxmenu_timeout_register): New function. + (VasEBoot_gfxmenu_timeout_unregister): Likewise. 2010-05-09 Vladimir Serbinenko @@ -28894,8 +28894,8 @@ * conf/i386-pc.rmk (vga_mod_SOURCES): Change term/i386/pc/vga.c to video/i386/pc/vga.c. - * include/grub/video.h (grub_video_driver_id): - Add GRUB_VIDEO_DRIVER_VGA. + * include/VasEBoot/video.h (VasEBoot_video_driver_id): + Add VasEBoot_VIDEO_DRIVER_VGA. * term/i386/pc/vga.c: Renamed to ... * video/i386/pc/vga.c: ...this (DEBUG_VGA): Removed. @@ -28918,35 +28918,35 @@ (set_read_map): Disabled. (setup): New variable. (is_target): Likewise. - (grub_vga_mod_init): Likewise. - (grub_vga_mod_fini): Likewise. + (VasEBoot_vga_mod_init): Likewise. + (VasEBoot_vga_mod_fini): Likewise. (check_vga_mem): Likewise. (write_char): Likewise. (write_cursor): Likewise. (scroll_up): Likewise. - (grub_vga_putchar): Likewise. - (grub_vga_getcharwidth): Likewise. - (grub_vga_getwh): Likewise. - (grub_vga_getxy): Likewise. - (grub_vga_gotoxy): Likewise. - (grub_vga_cls): Likewise. - (grub_vga_setcolorstate): Likewise. - (grub_vga_setcursor): Likewise. - (grub_video_vga_init): New function. - (grub_video_vga_setup): Likewise. - (grub_video_vga_fini): Likewise. + (VasEBoot_vga_putchar): Likewise. + (VasEBoot_vga_getcharwidth): Likewise. + (VasEBoot_vga_getwh): Likewise. + (VasEBoot_vga_getxy): Likewise. + (VasEBoot_vga_gotoxy): Likewise. + (VasEBoot_vga_cls): Likewise. + (VasEBoot_vga_setcolorstate): Likewise. + (VasEBoot_vga_setcursor): Likewise. + (VasEBoot_video_vga_init): New function. + (VasEBoot_video_vga_setup): Likewise. + (VasEBoot_video_vga_fini): Likewise. (update_target): Likewise. - (grub_video_vga_blit_bitmap): Likewise. - (grub_video_vga_blit_render_target): Likewise. - (grub_video_vga_set_active_render_target): Likewise. - (grub_video_vga_get_active_render_target): Likewise. - (grub_video_vga_swap_buffers): Likewise. - (grub_video_vga_set_palette): Likewise. - (grub_video_vga_get_info_and_fini): Likewise. - (grub_vga_term): Removed. - (grub_video_vga_adapter): New variable. - (GRUB_MOD_INIT): Register a video driver instead of terminal. - (GRUB_MOD_FINI): Unrefister a video driver instead of terminal. + (VasEBoot_video_vga_blit_bitmap): Likewise. + (VasEBoot_video_vga_blit_render_target): Likewise. + (VasEBoot_video_vga_set_active_render_target): Likewise. + (VasEBoot_video_vga_get_active_render_target): Likewise. + (VasEBoot_video_vga_swap_buffers): Likewise. + (VasEBoot_video_vga_set_palette): Likewise. + (VasEBoot_video_vga_get_info_and_fini): Likewise. + (VasEBoot_vga_term): Removed. + (VasEBoot_video_vga_adapter): New variable. + (VasEBoot_MOD_INIT): Register a video driver instead of terminal. + (VasEBoot_MOD_FINI): Unrefister a video driver instead of terminal. 2010-05-05 Vladimir Serbinenko @@ -28956,56 +28956,56 @@ Various jpeg cleanups. - * video/readers/jpeg.c (grub_jpeg_get_huff_code): Use ARRAY_SIZE. - (grub_jpeg_decode_quan_table): Use sizeof. - (grub_jpeg_decode_du): Use ARRAY_SIZE. + * video/readers/jpeg.c (VasEBoot_jpeg_get_huff_code): Use ARRAY_SIZE. + (VasEBoot_jpeg_decode_quan_table): Use sizeof. + (VasEBoot_jpeg_decode_du): Use ARRAY_SIZE. 2010-05-05 Peter Hurley (tiny change) - * video/readers/jpeg.c (grub_jpeg_decode_huff_table): Loop over all + * video/readers/jpeg.c (VasEBoot_jpeg_decode_huff_table): Loop over all tables. Ignore non-last ac bit. - (grub_jpeg_decode_quan_table): Likewise. + (VasEBoot_jpeg_decode_quan_table): Likewise. 2010-05-05 Vladimir Serbinenko - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): New value - GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM. - * kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM on qemu. - * kern/ieee1275/init.c (grub_claim_heap): Don0t allocate below - 1.5MiB if GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM is set. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): New value + VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM. + * kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM on qemu. + * kern/ieee1275/init.c (VasEBoot_claim_heap): Don0t allocate below + 1.5MiB if VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM is set. 2010-05-05 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_getkey): Fix off-by-one + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_getkey): Fix off-by-one error. 2010-05-05 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Support C0 code. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Support C0 code. 2010-05-03 Vladimir Serbinenko - * commands/parttool.c (grub_cmd_parttool): Fix #if !GRUB_NO_MODULES + * commands/parttool.c (VasEBoot_cmd_parttool): Fix #if !VasEBoot_NO_MODULES condition. 2010-05-03 Vladimir Serbinenko - * kern/mm.c (grub_real_malloc): Put magic and size assignment in common + * kern/mm.c (VasEBoot_real_malloc): Put magic and size assignment in common part. 2010-05-03 Vladimir Serbinenko - * kern/mm.c (grub_mm_init_region): Check for region size after aligning + * kern/mm.c (VasEBoot_mm_init_region): Check for region size after aligning pointers. 2010-05-03 Vladimir Serbinenko - * kern/mm.c (grub_real_malloc): Fix size calculation when extra == 0. + * kern/mm.c (VasEBoot_real_malloc): Fix size calculation when extra == 0. 2010-05-01 Christian Franke - * util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root): + * util/VasEBoot-mkconfig_lib.in (make_system_path_relative_to_its_root): Remove broken Cygwin path conversion. * util/misc.c: [__CYGWIN__] Add include and define. [__CYGWIN__] (get_win32_path): Copy function from getroot.c, modify @@ -29017,37 +29017,37 @@ 2010-05-01 Vladimir Serbinenko - * kern/main.c (grub_load_config): Fix copy-pasted comment. + * kern/main.c (VasEBoot_load_config): Fix copy-pasted comment. Reported by: Seth Goldberg 2010-05-01 Vladimir Serbinenko - * commands/help.c (grub_cmd_help): Fix a typo. + * commands/help.c (VasEBoot_cmd_help): Fix a typo. Reported by: Seth Goldberg 2010-05-01 Vladimir Serbinenko - * commands/hashsum.c (GRUB_MOD_INIT): Remove duplication of command + * commands/hashsum.c (VasEBoot_MOD_INIT): Remove duplication of command name and add N_. - * commands/i386/pc/drivemap.c (GRUB_MOD_INIT): Likewise. - * commands/iorw.c (GRUB_MOD_INIT): Likewise. - * commands/password_pbkdf2.c (GRUB_MOD_INIT): Likewise. - * commands/regexp.c (GRUB_MOD_INIT): Likewise. - * commands/setpci.c (GRUB_MOD_INIT): Likewise. - * commands/terminal.c (GRUB_MOD_INIT): Likewise. - * efiemu/main.c (GRUB_MOD_INIT): Likewise. - * font/font_cmd.c (GRUB_MOD_INIT): Likewise. - * kern/corecmd.c (GRUB_MOD_INIT): Likewise. - * mmap/mmap.c (GRUB_MOD_INIT): Likewise. - * normal/context.c (GRUB_MOD_INIT): Likewise. - * normal/main.c (GRUB_MOD_INIT): Likewise. - * term/gfxterm.c (GRUB_MOD_INIT): Likewise. - * term/serial.c (GRUB_MOD_INIT): Likewise. - * term/terminfo.c (GRUB_MOD_INIT): Likewise. + * commands/i386/pc/drivemap.c (VasEBoot_MOD_INIT): Likewise. + * commands/iorw.c (VasEBoot_MOD_INIT): Likewise. + * commands/password_pbkdf2.c (VasEBoot_MOD_INIT): Likewise. + * commands/regexp.c (VasEBoot_MOD_INIT): Likewise. + * commands/setpci.c (VasEBoot_MOD_INIT): Likewise. + * commands/terminal.c (VasEBoot_MOD_INIT): Likewise. + * efiemu/main.c (VasEBoot_MOD_INIT): Likewise. + * font/font_cmd.c (VasEBoot_MOD_INIT): Likewise. + * kern/corecmd.c (VasEBoot_MOD_INIT): Likewise. + * mmap/mmap.c (VasEBoot_MOD_INIT): Likewise. + * normal/context.c (VasEBoot_MOD_INIT): Likewise. + * normal/main.c (VasEBoot_MOD_INIT): Likewise. + * term/gfxterm.c (VasEBoot_MOD_INIT): Likewise. + * term/serial.c (VasEBoot_MOD_INIT): Likewise. + * term/terminfo.c (VasEBoot_MOD_INIT): Likewise. 2010-05-01 Vladimir Serbinenko - * kern/mm.c (grub_real_malloc): Satisfy alignment requirement when + * kern/mm.c (VasEBoot_real_malloc): Satisfy alignment requirement when extra == 0. 2010-05-01 Vladimir Serbinenko @@ -29062,15 +29062,15 @@ Hotkey support - * include/grub/menu.h (grub_menu_entry): New field 'hotkey'. + * include/VasEBoot/menu.h (VasEBoot_menu_entry): New field 'hotkey'. * normal/main.c (hotkey_aliases): New variable. - (grub_normal_add_menu_entry): Parse "--hotkey". + (VasEBoot_normal_add_menu_entry): Parse "--hotkey". * normal/menu_text.c (run_menu): Handle hotkeys. 2010-05-01 Vladimir Serbinenko - * kern/i386/coreboot/init.c (grub_machine_init): Call - grub_machine_mmap_init on qemu. + * kern/i386/coreboot/init.c (VasEBoot_machine_init): Call + VasEBoot_machine_mmap_init on qemu. 2010-05-01 Vladimir Serbinenko @@ -29082,13 +29082,13 @@ * conf/i386-coreboot.rmk (kernel_img_SOURCES): Change kern/i386/multiboot_mmap.c to kern/i386/coreboot/mmap.c. - * include/grub/i386/coreboot/memory.h (GRUB_LINUXBIOS_MEMBER_LINK): + * include/VasEBoot/i386/coreboot/memory.h (VasEBoot_LINUXBIOS_MEMBER_LINK): New declaration. - * kern/i386/coreboot/init.c (grub_machine_init): Don't call - grub_machine_mmap_init on coreboot. - * kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): Handle - GRUB_LINUXBIOS_MEMBER_LINK. - (grub_machine_mmap_iterate): Fix declaration. + * kern/i386/coreboot/init.c (VasEBoot_machine_init): Don't call + VasEBoot_machine_mmap_init on coreboot. + * kern/i386/coreboot/mmap.c (VasEBoot_linuxbios_table_iterate): Handle + VasEBoot_LINUXBIOS_MEMBER_LINK. + (VasEBoot_machine_mmap_iterate): Fix declaration. * kern/i386/coreboot/startup.S: Don't save mbi location on coreboot. 2010-05-01 Vladimir Serbinenko @@ -29097,44 +29097,44 @@ * conf/i386-multiboot.rmk: New file. * configure.ac: Add multiboot port. - * include/grub/i386/multiboot/boot.h: New file. - * include/grub/i386/multiboot/console.h: Likewise. - * include/grub/i386/multiboot/init.h: Likewise. - * include/grub/i386/multiboot/kernel.h: Likewise. - * include/grub/i386/multiboot/loader.h: Likewise. - * include/grub/i386/multiboot/memory.h: Likewise. - * include/grub/i386/multiboot/serial.h: Likewise. - * include/grub/i386/multiboot/time.h: Likewise. - * include/grub/multiboot.h: Add GRUB_MACHINE_MULTIBOOT to ifdef. + * include/VasEBoot/i386/multiboot/boot.h: New file. + * include/VasEBoot/i386/multiboot/console.h: Likewise. + * include/VasEBoot/i386/multiboot/init.h: Likewise. + * include/VasEBoot/i386/multiboot/kernel.h: Likewise. + * include/VasEBoot/i386/multiboot/loader.h: Likewise. + * include/VasEBoot/i386/multiboot/memory.h: Likewise. + * include/VasEBoot/i386/multiboot/serial.h: Likewise. + * include/VasEBoot/i386/multiboot/time.h: Likewise. + * include/VasEBoot/multiboot.h: Add VasEBoot_MACHINE_MULTIBOOT to ifdef. * loader/multiboot.c: Likewise. * loader/multiboot_mbi2.c: Likewise. - * util/grub-mkrescue.in: Generate multiboot rescue. + * util/VasEBoot-mkrescue.in: Generate multiboot rescue. 2010-05-01 Vladimir Serbinenko - * kern/parser.c (grub_parser_execute): Cope with read-only config. + * kern/parser.c (VasEBoot_parser_execute): Cope with read-only config. 2010-05-01 Vladimir Serbinenko Merge handling of input and output terminals. Fix a hang. * commands/terminal.c (abstract_terminal): New struct. - (handle_command): New function. Based on grub_cmd_terminal_input. - (grub_cmd_terminal_input): Use handle_command. - (grub_cmd_terminal_output): Use handle_command. + (handle_command): New function. Based on VasEBoot_cmd_terminal_input. + (VasEBoot_cmd_terminal_input): Use handle_command. + (VasEBoot_cmd_terminal_output): Use handle_command. 2010-05-01 BVK Chaitanya Fix comment handling. - * tests/grub_script_comments.in: New testcase. + * tests/VasEBoot_script_comments.in: New testcase. * conf/tests.rmk: Rules for new testcase. * script/yylex.l: Updated flex rules. 2010-04-28 Samuel Thibault - * docs/grub.texi (play): Document that zero pitches produce rests. - * commands/i386/pc/play.c (grub_cmd_play): Call 'grub_file_open' only + * docs/VasEBoot.texi (play): Document that zero pitches produce rests. + * commands/i386/pc/play.c (VasEBoot_cmd_play): Call 'VasEBoot_file_open' only if argc is 1. 2010-04-27 Vladimir Serbinenko @@ -29144,12 +29144,12 @@ 2010-04-26 Christian Franke - * include/grub/util/getroot.h (grub_get_prefix): Remove prototype. + * include/VasEBoot/util/getroot.h (VasEBoot_get_prefix): Remove prototype. * util/getroot.c [__CYGWIN__] (get_win32_path): Remove function. - (grub_get_prefix): Remove function. - * util/grub-emu.c (main): Replace grub_get_prefix () call by + (VasEBoot_get_prefix): Remove function. + * util/VasEBoot-emu.c (main): Replace VasEBoot_get_prefix () call by make_system_path_relative_to_its_root (). - * util/sparc64/ieee1275/grub-setup.c (main): Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c (main): Likewise. 2010-04-24 Christian Franke @@ -29159,22 +29159,22 @@ 2010-04-24 Christian Franke * configure.ac: Do not CHECK_BSS_START_SYMBOL - and CHECK_END_SYMBOL if grub-emu is built. - Unset TARGET_OBJ2ELF if grub-emu is built + and CHECK_END_SYMBOL if VasEBoot-emu is built. + Unset TARGET_OBJ2ELF if VasEBoot-emu is built without module support. 2010-04-24 Jiro SEKIBA Nilfs2 support. - * conf/common.rmk (grub_probe_SOURCES): Add fs/nilfs2.c. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add fs/nilfs2.c. + (VasEBoot_fstest_SOURCES): Likewise. (pkglib_MODULES): Add nilfs2.mod. (nilfs2_mod_SOURCES): New variable. (nilfs2_mod_CFLAGS): Likewise. (nilfs2_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/nilfs2.c. - * conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Add fs/nilfs2.c. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/nilfs2.c. + * conf/sparc64-ieee1275.rmk (VasEBoot_setup_SOURCES): Add fs/nilfs2.c. * fs/nilfs2.c: New file. 2010-04-21 Vladimir Serbinenko @@ -29184,56 +29184,56 @@ 2010-04-19 Grégoire Sutre - Add grub-mkconfig support for NetBSD. + Add VasEBoot-mkconfig support for NetBSD. - * util/grub.d/10_netbsd.in: grub-mkconfig helper script for NetBSD. - * util/grub-mkconfig.in: export new NetBSD specific variables. + * util/VasEBoot.d/10_netbsd.in: VasEBoot-mkconfig helper script for NetBSD. + * util/VasEBoot-mkconfig.in: export new NetBSD specific variables. * po/POTFILES-shell: added 10_netbsd.in. - * util/grub-mkconfig_lib.in: check for gettext binary, default to echo. + * util/VasEBoot-mkconfig_lib.in: check for gettext binary, default to echo. 2010-04-19 BVK Chaitanya - Fix emu build with grub-emu-pci and grub-emu-modules. + Fix emu build with VasEBoot-emu-pci and VasEBoot-emu-modules. - * include/grub/util/misc.h: Export grub_util_{info,error,warn} + * include/VasEBoot/util/misc.h: Export VasEBoot_util_{info,error,warn} functions. - * include/grub/libpciaccess.h: New file. + * include/VasEBoot/libpciaccess.h: New file. * conf/any-emu.rmk: Update kernel headers for emu build. 2010-04-19 Vladimir Serbinenko - * fs/udf.c (grub_udf_iterate_dir): Silence a spurious warning. + * fs/udf.c (VasEBoot_udf_iterate_dir): Silence a spurious warning. 2010-04-19 Vladimir Serbinenko - * fs/udf.c (grub_udf_iterate_dir): Decode the Unicode filenames. + * fs/udf.c (VasEBoot_udf_iterate_dir): Decode the Unicode filenames. 2010-04-18 Vladimir Serbinenko * boot/sparc64/ieee1275/boot.S: Various size-reducing changes. Retrieve chosen/bootpath if bootpath isn't hardcoded. - * conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Add + * conf/sparc64-ieee1275.rmk (VasEBoot_setup_SOURCES): Add util/ieee1275/ofpath.c. - * util/sparc64/ieee1275/grub-ofpathname.c: Renamed to ... - * util/ieee1275/grub-ofpathname.c: ... this. All users updated - * include/grub/sparc64/ieee1275/boot.h - (GRUB_BOOT_MACHINE_KERNEL_SECTOR): Renamed to ... - (GRUB_BOOT_MACHINE_KERNEL_BYTE): ...this. Moved 8 bytes lower. - * util/hostdisk.c (grub_util_biosdisk_get_osdev): New function. - * util/ieee1275/ofpath.c (grub_util_devname_to_ofpath): Make argument + * util/sparc64/ieee1275/VasEBoot-ofpathname.c: Renamed to ... + * util/ieee1275/VasEBoot-ofpathname.c: ... this. All users updated + * include/VasEBoot/sparc64/ieee1275/boot.h + (VasEBoot_BOOT_MACHINE_KERNEL_SECTOR): Renamed to ... + (VasEBoot_BOOT_MACHINE_KERNEL_BYTE): ...this. Moved 8 bytes lower. + * util/hostdisk.c (VasEBoot_util_biosdisk_get_osdev): New function. + * util/ieee1275/ofpath.c (VasEBoot_util_devname_to_ofpath): Make argument const char *. - * util/sparc64/ieee1275/grub-setup.c (compute_dest_ofpath): Removed. + * util/sparc64/ieee1275/VasEBoot-setup.c (compute_dest_ofpath): Removed. (setup): Use KERNEL_BYTE instead of KERNEL_SECTOR. - Use grub_util_devname_to_ofpath. Zero-fill boot_devpath on same disk + Use VasEBoot_util_devname_to_ofpath. Zero-fill boot_devpath on same disk install. 2010-04-18 Grégoire Sutre - * util/grub-mkconfig.in: Corrected two == equality tests. - Set grub_prefix as in grub-install for NetBSD and OpenBSD. + * util/VasEBoot-mkconfig.in: Corrected two == equality tests. + Set VasEBoot_prefix as in VasEBoot-install for NetBSD and OpenBSD. * configure.ac: All definitions and uses of TARGET_IMG_LDFLAGS_AC now expect a number appended to it. - * acinclude.m4 (grub_PROG_OBJCOPY_ABSOLUTE): ${TARGET_IMG_LDFLAGS_AC} + * acinclude.m4 (VasEBoot_PROG_OBJCOPY_ABSOLUTE): ${TARGET_IMG_LDFLAGS_AC} expects a number appended to it. 2010-04-18 Vladimir Serbinenko @@ -29246,7 +29246,7 @@ 2010-04-17 Vladimir Serbinenko - * disk/lvm.c (grub_lvm_memberlist): Issue an error if pv->disk = 0. + * disk/lvm.c (VasEBoot_lvm_memberlist): Issue an error if pv->disk = 0. 2010-04-17 Christian Franke @@ -29257,18 +29257,18 @@ Restore TEXTDOMAINDIR correction from r1889, lost apparently by mistake in r2156. Noticed by Anthony Fok. - * util/grub.d/10_kfreebsd.in (TEXTDOMAINDIR): Set to lowercased + * util/VasEBoot.d/10_kfreebsd.in (TEXTDOMAINDIR): Set to lowercased @localedir@. - * util/grub.d/10_linux.in (TEXTDOMAINDIR): Likewise. + * util/VasEBoot.d/10_linux.in (TEXTDOMAINDIR): Likewise. 2010-04-14 BVK Chaitanya Fix a spurious, uninitialized variable warning. - * loader/i386/bsdXX.c (grub_freebsd_load_elfmodule_obj): + * loader/i386/bsdXX.c (VasEBoot_freebsd_load_elfmodule_obj): Initialize variable, shdr. - (grub_freebsd_load_elfmodule): Likewise. - (grub_freebsd_load_elf_meta): Likewise. + (VasEBoot_freebsd_load_elfmodule): Likewise. + (VasEBoot_freebsd_load_elf_meta): Likewise. 2010-04-13 BVK Chaitanya @@ -29276,25 +29276,25 @@ * script/yylex.l: Updated flex rules. * conf/tests.rmk: Rule for new testcase. - * tests/grub_script_dollar.in: New testcase. + * tests/VasEBoot_script_dollar.in: New testcase. 2010-04-13 Carles Pina i Estany 2010-04-13 Colin Watson - Enclose all translated strings in grub.cfg in single quotes, and + Enclose all translated strings in VasEBoot.cfg in single quotes, and escape them appropriately (Ubuntu bug #552921). - * util/grub-mkconfig_lib.in (gettext_quoted): New function. - * util/grub.d/10_hurd.in: Use it. - * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise. - * util/grub.d/10_linux.in (linux_entry): Likewise. + * util/VasEBoot-mkconfig_lib.in (gettext_quoted): New function. + * util/VasEBoot.d/10_hurd.in: Use it. + * util/VasEBoot.d/10_kfreebsd.in (kfreebsd_entry): Likewise. + * util/VasEBoot.d/10_linux.in (linux_entry): Likewise. 2010-04-11 Vladimir Serbinenko Fix cygwin compilation. * configure.ac: Define NEED_REGISTER_FRAME_INFO. - * include/grub/misc.h (__register_frame_info) + * include/VasEBoot/misc.h (__register_frame_info) [NEED_REGISTER_FRAME_INFO && !UTIL]: New export. (__deregister_frame_info) [NEED_REGISTER_FRAME_INFO && !UTIL]: Likewise. * kern/misc.c (__register_frame_info) @@ -29303,7 +29303,7 @@ 2010-04-11 Vladimir Serbinenko - * configure.ac: Respect grub_cv_asm_uscore when defining dummy symbols. + * configure.ac: Respect VasEBoot_cv_asm_uscore when defining dummy symbols. 2010-04-11 Vladimir Serbinenko @@ -29325,22 +29325,22 @@ (kernel_img_LDFLAGS): Append instead of overwriting. Remove -lgcc and -static-libgcc * conf/sparc64-ieee1275.rmk: Likewise. - * include/grub/powerpc/libgcc.h: Move to ... - * include/grub/libgcc.h: .. this. - * include/grub/libgcc.h: Don't export most of the function on x86. + * include/VasEBoot/powerpc/libgcc.h: Move to ... + * include/VasEBoot/libgcc.h: .. this. + * include/VasEBoot/libgcc.h: Don't export most of the function on x86. (__bswapsi2): New export. (__bswapdi2): Likewise. - * include/grub/mips/libgcc.h: Removed. - * include/grub/sparc64/libgcc.h: Likewise. + * include/VasEBoot/mips/libgcc.h: Removed. + * include/VasEBoot/sparc64/libgcc.h: Likewise. 2010-04-10 Vladimir Serbinenko - * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Remove + * util/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Remove disk_info_msg (conflicts with gettexting into languages with cases). 2010-04-10 Grégoire Sutre - Add grub-probe support for NetBSD. + Add VasEBoot-probe support for NetBSD. * util/getroot.c (find_root_device): Convert block device to character device on NetBSD. @@ -29348,12 +29348,12 @@ * util/hostdisk.c: NetBSD specific headers. (configure_device_driver): new function to tune device driver parameters (currently only for NetBSD floppy driver). - (grub_util_biosdisk_open): NetBSD specific code (get disk size + (VasEBoot_util_biosdisk_open): NetBSD specific code (get disk size via disklabel ioctl). (open_device): call configure_device_driver on NetBSD. (convert_system_partition_to_system_disk): NetBSD specific code. (device_is_wholedisk): Likewise. - (grub_util_biosdisk_get_grub_dev): Likewise. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Likewise. (make_device_name): Fixed a typo in bsd_part_str. * configure.ac: check for opendisk() and getrawpartition() on NetBSD and set LIBUTIL. @@ -29363,7 +29363,7 @@ Documentation fix. - * util/grub-script-check.c: Better help message. + * util/VasEBoot-script-check.c: Better help message. 2010-04-10 BVK Chaitanya @@ -29375,19 +29375,19 @@ 2010-04-10 Vladimir Serbinenko - * include/grub/util/misc.h (canonicalise_file_name): Add missing + * include/VasEBoot/util/misc.h (canonicalise_file_name): Add missing prototype. Reported by: Seth Goldberg. 2010-04-10 Vladimir Serbinenko - * loader/multiboot.c (GRUB_MOD_INIT) [GRUB_USE_MULTIBOOT2]: + * loader/multiboot.c (VasEBoot_MOD_INIT) [VasEBoot_USE_MULTIBOOT2]: Rename "module" to "module2". Reported by: Seth Goldberg. 2010-04-10 Vladimir Serbinenko - * include/grub/efi/memory.h (grub_machine_mmap_iterate): Remove + * include/VasEBoot/efi/memory.h (VasEBoot_machine_mmap_iterate): Remove EXPORT_FUNC. Reported by: Seth Goldberg. @@ -29398,11 +29398,11 @@ 2010-04-10 Vladimir Serbinenko - grub-emu module load support. + VasEBoot-emu module load support. * Makefile.in (TARGET_NO_MODULES): New variable. All users of NO_DYNAMIC_MODULES switched to this. - (TARGET_CFLAGS): Add -DGRUB_TARGET_NO_MODULES=1 if applicable. + (TARGET_CFLAGS): Add -DVasEBoot_TARGET_NO_MODULES=1 if applicable. (CFLAGS): Likewise. * conf/any-emu.rmk: Generate symlist. (kernel_img_HEADERS): Add util/datetime.h. @@ -29410,13 +29410,13 @@ (kernel_img_HEADERS) [libusb]: Add libusb.h. (kernel_img_SOURCES) [TARGET_NO_MODULES = no && !x86]: Add kern/$(target_cpu)/cache.S. - * configure.ac (grub-emu-modules): New option. + * configure.ac (VasEBoot-emu-modules): New option. * genmk.rb: Handle multiple source lists. - * include/grub/sdl.h: New file. - * include/grub/libusb.h: Likewise. - * util/grub-emu.c (main): Hanle (host) root. - * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Error with - GRUB_ERR_UNKNOWN_DEVICE. + * include/VasEBoot/sdl.h: New file. + * include/VasEBoot/libusb.h: Likewise. + * util/VasEBoot-emu.c (main): Hanle (host) root. + * util/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Error with + VasEBoot_ERR_UNKNOWN_DEVICE. * util/misc.c: Move mm functions to ... * util/mm.c: ... here. All users updated. @@ -29425,17 +29425,17 @@ * Makefile.in (RMKFILES): Search in srcdir and not current directory. (MAINTAINER_CLEANFILES): Don't add $(srcdir) to MKFILES. Add few missing files. - (maintainer-clean): Remove libgcrypt-grub. + (maintainer-clean): Remove libgcrypt-VasEBoot. 2010-04-09 Vladimir Serbinenko - * term/efi/console.c (grub_console_checkkey): Macroify key contants. + * term/efi/console.c (VasEBoot_console_checkkey): Macroify key contants. 2010-04-09 EFI Coder * normal/menu_text.c (print_message): Clean up the message and show the Fn information when on EFI - * term/efi/console.c (grub_console_checkkey): Add F4 support. + * term/efi/console.c (VasEBoot_console_checkkey): Add F4 support. 2010-04-09 Vladimir Serbinenko @@ -29446,13 +29446,13 @@ * normal/term.c (read_terminal_list): Likewise. * normal/main.c (read_lists): Use explicit prefix. (read_lists_hook): Use read_lists. - (grub_normal_execute): Likewise. + (VasEBoot_normal_execute): Likewise. 2010-04-09 Vladimir Serbinenko - * util/grub-mkrescue.in: Fix incorrect path in coreboot part. + * util/VasEBoot-mkrescue.in: Fix incorrect path in coreboot part. Reported by: Thomas Schmitt. - Add -no-emul-boot to grub-mkisofs parameters. + Add -no-emul-boot to VasEBoot-mkisofs parameters. 2010-04-09 Vladimir Serbinenko @@ -29460,55 +29460,55 @@ 2010-04-09 BVK Chaitanya - Elif support to GRUB script (by Deepak Vankadaru). + Elif support to VasEBoot script (by Deepak Vankadaru). - * tests/grub_script_if.in: New testcase. + * tests/VasEBoot_script_if.in: New testcase. * conf/tests.rmk: Rule for new testcase. * script/parser.y: Grammar rules for elif. 2010-04-09 BVK Chaitanya - While and until loops support to GRUB script. + While and until loops support to VasEBoot script. - * include/grub/script_sh.h (grub_script_cmdwhile): New struct. - (grub_script_create_cmdwhile): New function prototype. - (grub_script_execute_cmdwhile): New function prototype. - * script/execute.c (grub_script_execute_cmdwhile): New function. + * include/VasEBoot/script_sh.h (VasEBoot_script_cmdwhile): New struct. + (VasEBoot_script_create_cmdwhile): New function prototype. + (VasEBoot_script_execute_cmdwhile): New function prototype. + * script/execute.c (VasEBoot_script_execute_cmdwhile): New function. * script/parser.y (command): New commands. (whilecmd): New grammar rule. (untilcmd): New grammar rule. - * script/script.c (grub_script_create_cmdwhile): New function. - * util/grub-script-check.c (grub_script_execute_cmdwhile): New + * script/script.c (VasEBoot_script_create_cmdwhile): New function. + * util/VasEBoot-script-check.c (VasEBoot_script_execute_cmdwhile): New function. - * tests/grub_script_while1.in: New testcase. + * tests/VasEBoot_script_while1.in: New testcase. * conf/tests.rmk: Rule for new testcase. 2010-04-09 Vladimir Serbinenko - * util/grub.d/00_header.in: Add few missing quotes. Recognise *.jpeg + * util/VasEBoot.d/00_header.in: Add few missing quotes. Recognise *.jpeg as *.jpg. 2010-04-09 Mario Vazquez - GRUB_BACKGROUND support. + VasEBoot_BACKGROUND support. - * util/grub-mkconfig.in: Export GRUB_BACKGROUND. - * util/grub.d/00_header.in: Parse GRUB_BACKGROUND. + * util/VasEBoot-mkconfig.in: Export VasEBoot_BACKGROUND. + * util/VasEBoot.d/00_header.in: Parse VasEBoot_BACKGROUND. 2010-04-09 Vladimir Serbinenko - Load fonts and modules for gfxmenu in grub-mkconfig. + Load fonts and modules for gfxmenu in VasEBoot-mkconfig. Idea by: Mario Vazquez - * util/grub.d/00_header.in: Load pf2 and image modules. + * util/VasEBoot.d/00_header.in: Load pf2 and image modules. 2010-04-09 Vladimir Serbinenko - grub-mkconfig multiple terminal support. + VasEBoot-mkconfig multiple terminal support. - * util/grub-mkconfig.in: Handle multiple terminals correctly. - * util/grub.d/00_header.in: Likewise. + * util/VasEBoot-mkconfig.in: Handle multiple terminals correctly. + * util/VasEBoot.d/00_header.in: Likewise. 2010-04-09 Vladimir Serbinenko @@ -29517,17 +29517,17 @@ 2010-04-08 Colin Watson - * util/grub.d/10_linux.in: Only use the first word of - GRUB_DISTRIBUTOR for --class, to avoid problems if somebody puts - spaces in GRUB_DISTRIBUTOR. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Only use the first word of + VasEBoot_DISTRIBUTOR for --class, to avoid problems if somebody puts + spaces in VasEBoot_DISTRIBUTOR. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. 2010-04-06 BVK Chaitanya Fix unit testing framework for Qemu 0.12. - * tests/util/grub-shell.in: Remove -serial stdio option. + * tests/util/VasEBoot-shell.in: Remove -serial stdio option. 2010-04-06 Vladimir Serbinenko @@ -29548,8 +29548,8 @@ * lib/posix_wrap/unistd.h: Likewise. * lib/posix_wrap/wchar.h: Likewise. * lib/posix_wrap/wctype.h: Likewise. - * conf/common.rmk (grub_script.yy.c): Remove #include elimination. - (grub_script.yy.h): Likewise. + * conf/common.rmk (VasEBoot_script.yy.c): Remove #include elimination. + (VasEBoot_script.yy.h): Likewise. * script/yylex.l: Remove POSIX emulation #defines. * Makefile.in (POSIX_CFLAGS): New variable. (GNULIB_UTIL_CFLAGS): Likewise. @@ -29570,40 +29570,40 @@ 2010-04-05 Vladimir Serbinenko - * loader/i386/multiboot_mbi.c (grub_multiboot_load): Correctly report + * loader/i386/multiboot_mbi.c (VasEBoot_multiboot_load): Correctly report unsupported video mode types. 2010-04-05 Vladimir Serbinenko - * kern/i386/pc/startup.S (grub_getrtsecs): Removed (dead code). + * kern/i386/pc/startup.S (VasEBoot_getrtsecs): Removed (dead code). 2010-04-05 Vladimir Serbinenko - * include/grub/i386/pc/init.h (grub_get_mmap_entry): Don't export. + * include/VasEBoot/i386/pc/init.h (VasEBoot_get_mmap_entry): Don't export. * conf/i386-pc.rmk (kernel_img_HEADERS): Remove machine/init.h. 2010-04-04 Vladimir Serbinenko - Remove unused grub_vga_get_font. + Remove unused VasEBoot_vga_get_font. - * kern/i386/pc/startup.S (grub_vga_get_font): Removed. - * include/grub/i386/pc/vga.h (grub_vga_get_font): Likewise. + * kern/i386/pc/startup.S (VasEBoot_vga_get_font): Removed. + * include/VasEBoot/i386/pc/vga.h (VasEBoot_vga_get_font): Likewise. 2010-04-03 Grégoire Sutre * kern/misc.c: Disable the __enable_execute_stack hack for utilities. - * include/grub/misc.h: Likewise. + * include/VasEBoot/misc.h: Likewise. 2010-04-03 Grégoire Sutre - * util/grub-install.in: Add `|| exit 1' to all grub-probe calls + * util/VasEBoot-install.in: Add `|| exit 1' to all VasEBoot-probe calls for which failure is fatal. 2010-04-03 Grégoire Sutre - * util/grub-install.in: Use mkdir -p to create grub directory. - * util/i386/efi/grub-install.in: Likewise. - * util/ieee1275/grub-install.in: Likewise. + * util/VasEBoot-install.in: Use mkdir -p to create VasEBoot directory. + * util/i386/efi/VasEBoot-install.in: Likewise. + * util/ieee1275/VasEBoot-install.in: Likewise. 2010-04-03 Grégoire Sutre @@ -29611,7 +29611,7 @@ 2010-04-03 Grégoire Sutre - * util/i386/efi/grub-dumpdevtree: replaced the non-portable `==' by + * util/i386/efi/VasEBoot-dumpdevtree: replaced the non-portable `==' by `=' and added double quotes on operands of this equality test. 2010-04-03 Vladimir Serbinenko @@ -29628,28 +29628,28 @@ (multiboot2_mod_CFLAGS): Likewise. (multiboot2_mod_LDFLAGS): Likewise. (multiboot2_mod_ASFLAGS): Likewise. - * include/grub/i386/multiboot.h (MULTIBOOT_INITIAL_STATE): New + * include/VasEBoot/i386/multiboot.h (MULTIBOOT_INITIAL_STATE): New definition. (MULTIBOOT_ENTRY_REGISTER): Likewise. (MULTIBOOT_MBI_REGISTER): Likewise. (MULTIBOOT_ARCHITECTURE_CURRENT): Likewise. (MULTIBOOT_ELF32_MACHINE): Likewise. (MULTIBOOT_ELF64_MACHINE): Likewise. - * include/grub/mips/multiboot.h: New file. - * include/grub/video.h (grub_video_driver_id): New type - GRUB_VIDEO_DRIVER_SM712. - (grub_video_get_info_and_fini): Export. - (grub_video_get_palette): Likewise. - (grub_video_get_driver_id): Likewise. + * include/VasEBoot/mips/multiboot.h: New file. + * include/VasEBoot/video.h (VasEBoot_video_driver_id): New type + VasEBoot_VIDEO_DRIVER_SM712. + (VasEBoot_video_get_info_and_fini): Export. + (VasEBoot_video_get_palette): Likewise. + (VasEBoot_video_get_driver_id): Likewise. * include/multiboot2.h: Resynced with spec. * loader/i386/multiboot.c: Moved from here ... * loader/multiboot.c: ... here. All users updated. - (grub_multiboot_boot): Use platform-specific macros. + (VasEBoot_multiboot_boot): Use platform-specific macros. * loader/i386/multiboot_elfxx.c: Moved from here ... * loader/multiboot_elfxx.c: ... here. All users updated. (E_MACHINE): Use MULTIBOOT_ELF32_MACHINE and MULTIBOOT_ELF64_MACHINE. - * loader/i386/multiboot_mbi2.c (grub_multiboot_load): Check arcitecture. - * video/sm712.c (grub_video_sm712_adapter): Add missing id field. + * loader/i386/multiboot_mbi2.c (VasEBoot_multiboot_load): Check arcitecture. + * video/sm712.c (VasEBoot_video_sm712_adapter): Add missing id field. 2010-04-02 Vladimir Serbinenko @@ -29673,12 +29673,12 @@ 2010-03-31 Vladimir Serbinenko - * kern/device.c (grub_device_iterate): Clear errors after failed + * kern/device.c (VasEBoot_device_iterate): Clear errors after failed opening device. 2010-03-31 Vladimir Serbinenko - * kern/ieee1275/openfw.c (grub_children_iterate): Skip device itself if + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Skip device itself if returned by firmware. 2010-03-30 Vladimir Serbinenko @@ -29697,36 +29697,36 @@ * conf/i386.rmk (multiboot2_mod_SOURCES): Replace loader/i386/multiboot_mbi.c with loader/i386/multiboot_mbi2.c. Remove loader/multiboot_loader.c. - * include/grub/i386/multiboot.h (grub_multiboot_real_boot): Removed. - (grub_multiboot2_real_boot): Likewise. - * include/grub/multiboot.h (grub_multiboot_set_accepts_video): Removed. - (grub_get_multiboot_mmap_count): New proto. - (grub_fill_multiboot_mmap): Likewise. - (grub_multiboot_set_video_mode): Likewise. - (grub_multiboot_set_console): Likewise. - (grub_multiboot_load): Likewise. - (grub_multiboot_load_elf): Likewise. - (GRUB_MULTIBOOT_CONSOLE_EGA_TEXT): New definition. - (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER): Likewise. + * include/VasEBoot/i386/multiboot.h (VasEBoot_multiboot_real_boot): Removed. + (VasEBoot_multiboot2_real_boot): Likewise. + * include/VasEBoot/multiboot.h (VasEBoot_multiboot_set_accepts_video): Removed. + (VasEBoot_get_multiboot_mmap_count): New proto. + (VasEBoot_fill_multiboot_mmap): Likewise. + (VasEBoot_multiboot_set_video_mode): Likewise. + (VasEBoot_multiboot_set_console): Likewise. + (VasEBoot_multiboot_load): Likewise. + (VasEBoot_multiboot_load_elf): Likewise. + (VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT): New definition. + (VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER): Likewise. * include/multiboot.h: Resynced with specification. * include/multiboot2.h: Resynced with specification. * loader/i386/multiboot_mbi.c (DEFAULT_VIDEO_MODE): Moved from here... * loader/i386/multiboot.c (DEFAULT_VIDEO_MODE): ... here. * loader/i386/multiboot_mbi.c (HAS_VGA_TEXT): Moved from here .. - * include/grub/multiboot.h (GRUB_MACHINE_HAS_VGA_TEXT): ... here. All + * include/VasEBoot/multiboot.h (VasEBoot_MACHINE_HAS_VGA_TEXT): ... here. All users updated. * loader/i386/multiboot_mbi.c (accepts_video): Moved from here... * loader/i386/multiboot.c (accepts_video): ... here. All users updated. - * loader/i386/multiboot_mbi.c (grub_multiboot_set_accepts_video): + * loader/i386/multiboot_mbi.c (VasEBoot_multiboot_set_accepts_video): Removed. - * loader/i386/multiboot_mbi.c (grub_get_multiboot_mmap_len): + * loader/i386/multiboot_mbi.c (VasEBoot_get_multiboot_mmap_len): Moved from here... - * loader/i386/multiboot.c (grub_get_multiboot_mmap_len): ... here. - * loader/i386/multiboot_mbi.c (grub_fill_multiboot_mmap): + * loader/i386/multiboot.c (VasEBoot_get_multiboot_mmap_len): ... here. + * loader/i386/multiboot_mbi.c (VasEBoot_fill_multiboot_mmap): Moved from here... - * loader/i386/multiboot.c (grub_fill_multiboot_mmap): ... here. + * loader/i386/multiboot.c (VasEBoot_fill_multiboot_mmap): ... here. * loader/i386/multiboot_mbi.c (set_video_mode): Moved from here... - * loader/i386/multiboot.c (grub_multiboot_set_video_mode): ... here. + * loader/i386/multiboot.c (VasEBoot_multiboot_set_video_mode): ... here. All users updated. * loader/i386/multiboot_mbi2.c: New file. @@ -29735,8 +29735,8 @@ Resync with gnulib. * Makefile.in (GNULIB_CFLAGS): New variable. - * conf/common.rmk (grub_mkisofs_CFLAGS): Add GNULIB_CFLAGS. - (grub_script_check_CFLAGS): New variable. + * conf/common.rmk (VasEBoot_mkisofs_CFLAGS): Add GNULIB_CFLAGS. + (VasEBoot_script_check_CFLAGS): New variable. * gnulib/alloca.h: Resync with gnulib. * gnulib/error.c: Likewise. * gnulib/error.h: Likewise. @@ -29756,7 +29756,7 @@ Fix a build failure (-Wundef -Werror) when ENABLE_NLS is not defined, which is the case with --disabled-nls. - * include/grub/i18n.h: Use (defined(ENABLE_NLS) + * include/VasEBoot/i18n.h: Use (defined(ENABLE_NLS) && ENABLE_NLS) instead of ENABLE_NLS in all #if preprocessor macros. * util/misc.c: Likewise. * util/mkisofs/mkisofs.c: Likewise. @@ -29776,27 +29776,27 @@ Testcase and the fix for final semicolon on cmdline. - * tests/grub_script_final_semicolon.in: New testcase. + * tests/VasEBoot_script_final_semicolon.in: New testcase. * conf/tests.rmk: Rules for the new testcase. * script/parser.y: Grammar fix. 2010-03-26 BVK Chaitanya - Blank lines testcase for GRUB script. + Blank lines testcase for VasEBoot script. - * tests/grub_script_blanklines.in: New testcase. + * tests/VasEBoot_script_blanklines.in: New testcase. * conf/tests.rmk: Rules for the new testcase. 2010-03-26 Vladimir Serbinenko Don't use __FILE__. - * genmk.rb: Add -DGRUB_FILE to all C targets. - * fs/reiserfs.c: Replace __FILE__ with GRUB_FILE. - * include/grub/list.h: Likewise. - * include/grub/misc.h: Likewise. - * include/grub/mm.h: Likewise. - * include/grub/test.h: Likewise. + * genmk.rb: Add -DVasEBoot_FILE to all C targets. + * fs/reiserfs.c: Replace __FILE__ with VasEBoot_FILE. + * include/VasEBoot/list.h: Likewise. + * include/VasEBoot/misc.h: Likewise. + * include/VasEBoot/mm.h: Likewise. + * include/VasEBoot/test.h: Likewise. * kern/mm.c: Likewise. * lib/libgcrypt_wrap/cipher_wrap.h: Likewise. @@ -29804,70 +29804,70 @@ Sunpc partitions support. - * conf/common.rmk (grub_probe_SOURCES): Add partmap/sunpc.c. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add partmap/sunpc.c. + (VasEBoot_fstest_SOURCES): Likewise. (pkglib_MODULES): Add part_sunpc.mod. (part_sunpc_mod_SOURCES): New variable. (part_sunpc_mod_CFLAGS): Likewise. (part_sunpc_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add partmap/sunpc.c. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add partmap/sunpc.c. * partmap/sunpc.c: New file. 2010-03-26 BVK Chaitanya - For loop support to GRUB script. + For loop support to VasEBoot script. - * include/grub/script_sh.h (grub_script_cmdfor): New struct. - (grub_script_create_cmdfor): New function prototype. - (grub_script_execute_cmdfor): New function prototype. - * script/execute.c (grub_script_execute_cmdfor): New function. + * include/VasEBoot/script_sh.h (VasEBoot_script_cmdfor): New struct. + (VasEBoot_script_create_cmdfor): New function prototype. + (VasEBoot_script_execute_cmdfor): New function prototype. + * script/execute.c (VasEBoot_script_execute_cmdfor): New function. * script/parser.y (command): New for command. (forcmd): New grammar rule. - * script/script.c (grub_script_create_cmdfor): New function. - * util/grub-script-check.c (grub_script_execute_cmdfor): New + * script/script.c (VasEBoot_script_create_cmdfor): New function. + * util/VasEBoot-script-check.c (VasEBoot_script_execute_cmdfor): New function. - * tests/grub_script_for1.in: New testcase. + * tests/VasEBoot_script_for1.in: New testcase. * conf/tests.rmk: Rules for new testcase. 2010-03-26 Vladimir Serbinenko Nested partitions - * commands/blocklist.c (grub_cmd_blocklist): Don't check whether - 'partition' is NULL, grub_partition_get_start already does that. + * commands/blocklist.c (VasEBoot_cmd_blocklist): Don't check whether + 'partition' is NULL, VasEBoot_partition_get_start already does that. * commands/loadenv.c (check_blocklists): Likewise. (write_blocklists): Likewise. - * conf/common.rmk (grub_probe_SOURCES): Add partmap/bsdlabel.c. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add partmap/bsdlabel.c. + (VasEBoot_fstest_SOURCES): Likewise. (pkglib_MODULES): Add part_bsd.mod. (part_bsd_mod_SOURCES): New variable. (part_bsd_mod_CFLAGS): Likewise. (part_bsd_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add partmap/bsdlabel.c. - (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * include/grub/bsdlabel.h: New file. - * include/grub/partition.h (grub_partition_map): Remove 'probe' and + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add partmap/bsdlabel.c. + (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * include/VasEBoot/bsdlabel.h: New file. + * include/VasEBoot/partition.h (VasEBoot_partition_map): Remove 'probe' and 'get_name'. - (grub_partition): Add 'parent' and 'number'. Remove 'data'. - (grub_partition_map_list): New variable. - (grub_partition_map_register): Inline. - (grub_partition_map_unregister): Likewise. + (VasEBoot_partition): Add 'parent' and 'number'. Remove 'data'. + (VasEBoot_partition_map_list): New variable. + (VasEBoot_partition_map_register): Inline. + (VasEBoot_partition_map_unregister): Likewise. (FOR_PARTITION_MAPS): New macro. - (grub_partition_map_iterate): Removed. - (grub_partition_get_start): Handle nested partitions. - * include/grub/msdos_partition.h: Remove bsd-related entries. - (grub_pc_partition): Remove. - * kern/disk.c (grub_disk_close): Free partition data. - (grub_disk_adjust_range): Handle nested partitions. - * kern/partition.c (grub_partition_map_probe): New function. - (grub_partition_probe): Parse name to number, handle subpartitions. + (VasEBoot_partition_map_iterate): Removed. + (VasEBoot_partition_get_start): Handle nested partitions. + * include/VasEBoot/msdos_partition.h: Remove bsd-related entries. + (VasEBoot_pc_partition): Remove. + * kern/disk.c (VasEBoot_disk_close): Free partition data. + (VasEBoot_disk_adjust_range): Handle nested partitions. + * kern/partition.c (VasEBoot_partition_map_probe): New function. + (VasEBoot_partition_probe): Parse name to number, handle subpartitions. (get_partmap): New function. - (grub_partition_iterate): Handle subpartitions. - (grub_partition_get_name): Likewise. - * loader/i386/pc/bsd.c (grub_bsd_get_device): Likewise. - * loader/i386/multiboot.c (grub_multiboot_get_bootdev): Likewise. - * loader/i386/pc/chainloader.c (grub_chainloader_cmd): Likewise. + (VasEBoot_partition_iterate): Handle subpartitions. + (VasEBoot_partition_get_name): Likewise. + * loader/i386/pc/bsd.c (VasEBoot_bsd_get_device): Likewise. + * loader/i386/multiboot.c (VasEBoot_multiboot_get_bootdev): Likewise. + * loader/i386/pc/chainloader.c (VasEBoot_chainloader_cmd): Likewise. * partmap/acorn.c (acorn_partition_map_iterate): Don't force raw access. Set 'number'. (acorn_partition_map_probe): Remove. @@ -29889,7 +29889,7 @@ Set 'index' to offset inside sector. (gpt_partition_map_probe): Remove. (gpt_partition_map_get_name): Likewise. - * partmap/msdos.c (grub_partition_parse): Remove. + * partmap/msdos.c (VasEBoot_partition_parse): Remove. (pc_partition_map_iterate): Don't force raw access. Set 'number'. Make 'ext_offset' a local variable. @@ -29899,34 +29899,34 @@ Set 'number'. (sun_partition_map_probe): Remove. (sun_partition_map_get_name): Likewise. - * parttool/msdospart.c (grub_pcpart_boot): Handle nested partitions. - (grub_pcpart_type): Likewise. + * parttool/msdospart.c (VasEBoot_pcpart_boot): Handle nested partitions. + (VasEBoot_pcpart_type): Likewise. * util/hostdisk.c (open_device): Handle new numbering scheme. - (grub_util_biosdisk_get_grub_dev): Handle nested partitions. - * util/i386/pc/grub-setup.c (setup): Handle new numbering scheme. - * util/grub-probe.c (probe_partmap): Handle nested paritions. - * util/grub-install.in: Insert all subpartition modules. - * util/ieee1275/grub-install.in: Likewise. + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Handle nested partitions. + * util/i386/pc/VasEBoot-setup.c (setup): Handle new numbering scheme. + * util/VasEBoot-probe.c (probe_partmap): Handle nested paritions. + * util/VasEBoot-install.in: Insert all subpartition modules. + * util/ieee1275/VasEBoot-install.in: Likewise. 2010-03-24 Adrian Glaubitz - * kern/dl.c (grub_dl_resolve_symbols): Improve error message + * kern/dl.c (VasEBoot_dl_resolve_symbols): Improve error message grammar. 2010-03-24 Colin Watson - * .bzrignore: Add grub-bin2h, grub-reboot, and grub-set-default. + * .bzrignore: Add VasEBoot-bin2h, VasEBoot-reboot, and VasEBoot-set-default. 2010-03-21 Colin Watson - * util/grub-install.in: Copy .mo files from @datadir@/locale, to + * util/VasEBoot-install.in: Copy .mo files from @datadir@/locale, to match where 'make install' puts them. - * util/i386/efi/grub-install.in: Likewise. + * util/i386/efi/VasEBoot-install.in: Likewise. 2010-03-19 Colin Watson - * .bzrignore: Add gentrigtables, grub-script-check, - grub_script_check_init.c, grub_script_check_init.h, and + * .bzrignore: Add gentrigtables, VasEBoot-script-check, + VasEBoot_script_check_init.c, VasEBoot_script_check_init.h, and trigtables.c. 2010-03-18 Vladimir Serbinenko @@ -29939,12 +29939,12 @@ 2010-03-17 Vladimir Serbinenko - * video/fb/fbblit.c (grub_video_fbblit_blend_XXXA8888_1bit): Handle + * video/fb/fbblit.c (VasEBoot_video_fbblit_blend_XXXA8888_1bit): Handle alpha_mask_size == 0 case. 2010-03-14 BVK Chaitanya - GRUB shell lexer and parser improvements. + VasEBoot shell lexer and parser improvements. * conf/any-emu.rmk: Build rule updates. * conf/common.rmk: Likewise. @@ -29957,62 +29957,62 @@ * configure.ac: Configure check for flex. - * include/grub/script_sh.h (grub_script_arg_type_t): More argument + * include/VasEBoot/script_sh.h (VasEBoot_script_arg_type_t): More argument types. - (grub_lexer_param): Struct member updates. - (grub_parser_param): Likewise. - (GRUB_LEXER_TOKEN_MAX): Maximum token size. - (GRUB_LEXER_RECORD_INCREMENT): Memory increments' size. - (grub_script_lexer_init): Prototype update. - (grub_script_lexer_record_start): Likewise. - (grub_script_lexer_record_stop): Likewise. - (grub_script_lexer_yywrap): New function prototype. - (grub_script_lexer_fini): Likewise. - (grub_script_execute_argument_to_string): Removed by... - (grub_script_execute_argument_to_argv): ...better version. + (VasEBoot_lexer_param): Struct member updates. + (VasEBoot_parser_param): Likewise. + (VasEBoot_LEXER_TOKEN_MAX): Maximum token size. + (VasEBoot_LEXER_RECORD_INCREMENT): Memory increments' size. + (VasEBoot_script_lexer_init): Prototype update. + (VasEBoot_script_lexer_record_start): Likewise. + (VasEBoot_script_lexer_record_stop): Likewise. + (VasEBoot_script_lexer_yywrap): New function prototype. + (VasEBoot_script_lexer_fini): Likewise. + (VasEBoot_script_execute_argument_to_string): Removed by... + (VasEBoot_script_execute_argument_to_argv): ...better version. * script/execute.c (ROUND_UPTO): New macro. - (grub_script_execute_cmdline): Out of memory fixes. - (grub_script_execute_menuentry): Likewise. - (grub_script_execute_argument_to_string): Removed. Update all + (VasEBoot_script_execute_cmdline): Out of memory fixes. + (VasEBoot_script_execute_menuentry): Likewise. + (VasEBoot_script_execute_argument_to_string): Removed. Update all users by... - (grub_script_execute_argument_to_argv): ...better version. - * script/function.c (grub_script_function_create): Use - grub_script_execute_argument_to_argv instead of - grub_script_execute_argument_to_string. + (VasEBoot_script_execute_argument_to_argv): ...better version. + * script/function.c (VasEBoot_script_function_create): Use + VasEBoot_script_execute_argument_to_argv instead of + VasEBoot_script_execute_argument_to_string. * script/lexer.c (check_varstate): Removed. (check_textstate): Removed. - (grub_script_lexer_record_start): Likewise. - (grub_script_lexer_record_stop): Likewise. + (VasEBoot_script_lexer_record_start): Likewise. + (VasEBoot_script_lexer_record_stop): Likewise. (recordchar): Replaced with... - (grub_script_lexer_record): ...new function. + (VasEBoot_script_lexer_record): ...new function. (nextchar): Removed. - (grub_script_lexer_init): Rewritten. - (grub_script_yylex): Rewritten. + (VasEBoot_script_lexer_init): Rewritten. + (VasEBoot_script_yylex): Rewritten. (append_newline): New function. - (grub_script_lexer_yywrap): New function. - (grub_script_lexer_fini): New function. - (grub_script_yyerror): Sets error flag. + (VasEBoot_script_lexer_yywrap): New function. + (VasEBoot_script_lexer_fini): New function. + (VasEBoot_script_yyerror): Sets error flag. * script/yylex.l: New file. - (grub_lexer_yyfree): Wrapper for flex yyffre. - (grub_lexer_yyalloc): Likewise. - (grub_lexer_yyrealloc): Likewise. + (VasEBoot_lexer_yyfree): Wrapper for flex yyffre. + (VasEBoot_lexer_yyalloc): Likewise. + (VasEBoot_lexer_yyrealloc): Likewise. * script/parser.y: Refactored. - * script/script.c (grub_script_arg_add): Out of memory fixes. - (grub_script_add_arglist): Likewise. - (grub_script_create_cmdline): Likewise. - (grub_script_create_cmdmenu): Likewise. - (grub_script_add_cmd): Likewise. - (grub_script_parse): Use grub_script_lexer_fini to deallocated. - * util/grub-script-check.c (grub_script_execute_menuentry): Remove + * script/script.c (VasEBoot_script_arg_add): Out of memory fixes. + (VasEBoot_script_add_arglist): Likewise. + (VasEBoot_script_create_cmdline): Likewise. + (VasEBoot_script_create_cmdmenu): Likewise. + (VasEBoot_script_add_cmd): Likewise. + (VasEBoot_script_parse): Use VasEBoot_script_lexer_fini to deallocated. + * util/VasEBoot-script-check.c (VasEBoot_script_execute_menuentry): Remove unnecessary code. - * tests/grub_script_echo1.in: New testcase. - * tests/grub_script_vars1.in: New testcase. - * tests/grub_script_echo_keywords.in: New testcase. + * tests/VasEBoot_script_echo1.in: New testcase. + * tests/VasEBoot_script_vars1.in: New testcase. + * tests/VasEBoot_script_echo_keywords.in: New testcase. 2010-03-14 Vladimir Serbinenko @@ -30022,7 +30022,7 @@ (TARGET_ASFLAGS): Add -nostdinc -fno-builtin. (TARGET_LDFLAGS): Add -nostdlib. (TARGET_IMG_LDFLAGS): Likewise. - * commands/lsmmap.c (grub_cmd_lsmmap) [GRUB_MACHINE_EMU]: Don't do + * commands/lsmmap.c (VasEBoot_cmd_lsmmap) [VasEBoot_MACHINE_EMU]: Don't do anything since mmap isn't available. * conf/any-emu.rmk (kernel_img_SOURCES): Remove commands/boot.c. Add util/time.c. @@ -30074,15 +30074,15 @@ * conf/x86-efi.rmk: ... here. * conf/i386.rmk: Added modules common to all x86 variants. * configure.ac: Add -m32/-m64 to TARGET_ASFLAGS. - * disk/memdisk.c: Remove grub/machine/kernel.h. + * disk/memdisk.c: Remove VasEBoot/machine/kernel.h. * gensymlist.sh.in: Include symbol.h. * hook/datehook.c: Correct module name. - * include/grub/datetime.h (grub_get_datetime) [GRUB_MACHINE_EMU]: Export. - (grub_set_datetime) [GRUB_MACHINE_EMU]: Likewise. - * include/grub/i386/efi/serial.h: New file. - * include/grub/x86_64/efi/serial.h: Likewise. + * include/VasEBoot/datetime.h (VasEBoot_get_datetime) [VasEBoot_MACHINE_EMU]: Export. + (VasEBoot_set_datetime) [VasEBoot_MACHINE_EMU]: Likewise. + * include/VasEBoot/i386/efi/serial.h: New file. + * include/VasEBoot/x86_64/efi/serial.h: Likewise. * util/time.c: Likewise. - * video/ieee1275.c (grub_video_ieee1275_setup): Handle 64-bit void *. + * video/ieee1275.c (VasEBoot_video_ieee1275_setup): Handle 64-bit void *. 2010-03-14 Colin King 2010-03-14 Colin Watson @@ -30102,40 +30102,40 @@ Speed up consecutive hostdisk operations on the same device. - * util/hostdisk.c (struct grub_util_biosdisk_data): New structure. - (grub_util_biosdisk_open): Initialise disk->data. + * util/hostdisk.c (struct VasEBoot_util_biosdisk_data): New structure. + (VasEBoot_util_biosdisk_open): Initialise disk->data. (struct linux_partition_cache): New structure. (linux_find_partition): Cache partition start positions; these are expensive to compute on every read and write. (open_device): Cache open file descriptor in disk->data, so that we don't have to reopen it and flush the buffer cache for consecutive operations on the same device. - (grub_util_biosdisk_close): New function. - (grub_util_biosdisk_dev): Set `close' member. + (VasEBoot_util_biosdisk_close): New function. + (VasEBoot_util_biosdisk_dev): Set `close' member. - * conf/common.rmk (grub_probe_SOURCES): Add kern/list.c. - * conf/i386-efi.rmk (grub_setup_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_setup_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add kern/list.c. + * conf/i386-efi.rmk (VasEBoot_setup_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_setup_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_setup_SOURCES): Likewise. 2010-03-14 Vladimir Serbinenko - Compile parts of grub-emu as modules. + Compile parts of VasEBoot-emu as modules. * Makefile.in (TARGET_CPPFLAGS) [emu]: Remove -nostdinc -isystem. (pkglib_DATA) [emu]: Remove moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst. - (all-local): Add $(GRUB_EMU). - (install-local): Install $(GRUB_EMU). - (uninstall): Uninstall $(GRUB_EMU). - * commands/parttool.c: Replace GRUB_UTIL with GRUB_NO_MODULES. + (all-local): Add $(VasEBoot_EMU). + (install-local): Install $(VasEBoot_EMU). + (uninstall): Uninstall $(VasEBoot_EMU). + * commands/parttool.c: Replace VasEBoot_UTIL with VasEBoot_NO_MODULES. * kern/dl.c: Likewise. * commands/sleep.c: Not include machine/time.h. * conf/any-emu.rmk (COMMON_LDFLAGS): New variable. (COMMON_CFLAGS): Likewise. - (sbin_UTILITIES): Remove grub-emu. - (grub_emu_SOURCES): Removed. + (sbin_UTILITIES): Remove VasEBoot-emu. + (VasEBoot_emu_SOURCES): Removed. (kernel_img_RELOCATABLE): New variable. (pkglib_PROGRAMS): Add kernel.img. (kernel_img_SOURCES): New variable @@ -30145,18 +30145,18 @@ (TARGET_NO_DYNAMIC_MODULES): Likewise. (pkglib_MODULES): Add progname.mod, hostfs.mod, host.mod, reboot.mod, halt.mod, cpuid.mod, usb.mod, sdl.mod and pci.mod. - (grub-emu): New target. - (GRUB_EMU): New variable. + (VasEBoot-emu): New target. + (VasEBoot_EMU): New variable. * configure.ac: Whitelist -emu as possible x86_64 architecture. - * efiemu/main.c: Replace GRUB_UTIL with GRUB_MACHINE_EMU. + * efiemu/main.c: Replace VasEBoot_UTIL with VasEBoot_MACHINE_EMU. * loader/xnu.c: Likewise. - * include/grub/pci.h: Likewise. + * include/VasEBoot/pci.h: Likewise. * genemuinit.sh: New file. * genemuinitheader.sh: Likewise. * genmk.rb: Don't strip if TARGET_NO_STRIP is yes. Support TARGET_NO_DYNAMIC_MODULES. - * include/grub/dl.h (GRUB_NO_MODULES): New variable. - * commands/search.c: Fix GRUB_MOD_INIT and GRUB_MOD_FINI arguments. + * include/VasEBoot/dl.h (VasEBoot_NO_MODULES): New variable. + * commands/search.c: Fix VasEBoot_MOD_INIT and VasEBoot_MOD_FINI arguments. * disk/loopback.c: Likewise. * font/font_cmd.c: Likewise. * partmap/acorn.c: Likewise. @@ -30172,10 +30172,10 @@ * video/readers/png.c: Likewise. * video/readers/tga.c: Likewise. * video/video.c: Likewise. - * util/grub-emu.c (read_command_list): Removed. + * util/VasEBoot-emu.c (read_command_list): Removed. (main): Don't call util_init_nls. - * util/misc.c (grub_err_printf) [!GRUB_UTIL]: Removed. - (grub_util_init_nls) [!GRUB_UTIL]: Likewise. + * util/misc.c (VasEBoot_err_printf) [!VasEBoot_UTIL]: Removed. + (VasEBoot_util_init_nls) [!VasEBoot_UTIL]: Likewise. 2010-03-14 Vladimir Serbinenko @@ -30199,19 +30199,19 @@ (ieee1275_fb_mod_SOURCES): New variable. (ieee1275_fb_mod_CFLAGS): Likewise. (ieee1275_fb_mod_LDFLAGS): Likewise. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_devices_iterate): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_devices_iterate): New proto. * kern/ieee1275/init.c (HEAP_MAX_SIZE): Increased. (HEAP_MAX_ADDR): Likewise. - * kern/ieee1275/openfw.c (grub_children_iterate): Don't skip empty + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Don't skip empty type. Correct stop condition. - (grub_ieee1275_devices_iterate): New function. + (VasEBoot_ieee1275_devices_iterate): New function. * video/ieee1275.c: New file. 2010-03-14 Vladimir Serbinenko - Merge sparc grub-mkimage into generic grub-mkimage and a.out support. + Merge sparc VasEBoot-mkimage into generic VasEBoot-mkimage and a.out support. * boot/sparc64/ieee1275/boot.S (boot_continue): Use SCRATCH_PAD_BOOT as scratch. @@ -30220,49 +30220,49 @@ (bootit): Pass Openfirmware pointer in %o4. * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link at 0x4400 instead of 0x200000. - (grub_mkimage_SOURCES): Replace util/sparc64/ieee1275/grub-mkimage.c - with util/grub-mkrawimage.c. - * configure.ac: Handle GRUB_MACHINE_SPARC64 and GRUB_MACHINE_MIPS. - * include/grub/aout.h (AOUT_MID_SUN): New definition. - (grub_aout_get_type) [GRUB_UTIL]: Removed. - (grub_aout_load) [GRUB_UTIL]: Likewise. - * include/grub/kernel.h (grub_modules_get_end): New proto. - * include/grub/sparc64/ieee1275/boot.h (SCRATCH_PAD): Removed. + (VasEBoot_mkimage_SOURCES): Replace util/sparc64/ieee1275/VasEBoot-mkimage.c + with util/VasEBoot-mkrawimage.c. + * configure.ac: Handle VasEBoot_MACHINE_SPARC64 and VasEBoot_MACHINE_MIPS. + * include/VasEBoot/aout.h (AOUT_MID_SUN): New definition. + (VasEBoot_aout_get_type) [VasEBoot_UTIL]: Removed. + (VasEBoot_aout_load) [VasEBoot_UTIL]: Likewise. + * include/VasEBoot/kernel.h (VasEBoot_modules_get_end): New proto. + * include/VasEBoot/sparc64/ieee1275/boot.h (SCRATCH_PAD): Removed. (SCRATCH_PAD_BOOT): New definition. (SCRATCH_PAD_DISKBOOT): Likewise. - (GRUB_BOOT_MACHINE_IMAGE_ADDRESS): Set to 0x4400. - * include/grub/sparc64/ieee1275/ieee1275.h - (grub_ieee1275_original_stack): New variable - * include/grub/sparc64/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): + (VasEBoot_BOOT_MACHINE_IMAGE_ADDRESS): Set to 0x4400. + * include/VasEBoot/sparc64/ieee1275/ieee1275.h + (VasEBoot_ieee1275_original_stack): New variable + * include/VasEBoot/sparc64/ieee1275/kernel.h (VasEBoot_KERNEL_MACHINE_RAW_SIZE): New definition - (GRUB_KERNEL_MACHINE_STACK_SIZE): Likewise. - (GRUB_PLATFORM_IMAGE_FORMATS): Likewise. - (GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT): Likewise. - (GRUB_PLATFORM_IMAGE_DEFAULT): Likewise. - (GRUB_PLATFORM_IMAGE_RAW): Likewise. - (GRUB_PLATFORM_IMAGE_AOUT): Likewise. - (grub_platform_image_format_t): New type. - * kern/mips/yeeloong/init.c (grub_modules_get_end): Move from here ... - * kern/main.c (grub_modules_get_end) - [GRUB_MACHINE_MIPS_YEELOONG || GRUB_MACHINE_SPARC64]: ... here. + (VasEBoot_KERNEL_MACHINE_STACK_SIZE): Likewise. + (VasEBoot_PLATFORM_IMAGE_FORMATS): Likewise. + (VasEBoot_PLATFORM_IMAGE_DEFAULT_FORMAT): Likewise. + (VasEBoot_PLATFORM_IMAGE_DEFAULT): Likewise. + (VasEBoot_PLATFORM_IMAGE_RAW): Likewise. + (VasEBoot_PLATFORM_IMAGE_AOUT): Likewise. + (VasEBoot_platform_image_format_t): New type. + * kern/mips/yeeloong/init.c (VasEBoot_modules_get_end): Move from here ... + * kern/main.c (VasEBoot_modules_get_end) + [VasEBoot_MACHINE_MIPS_YEELOONG || VasEBoot_MACHINE_SPARC64]: ... here. * kern/sparc64/ieee1275/crt0.S: Store firmware entry point in %o0. (codestart): Switch stacks. - * kern/sparc64/ieee1275/init.c (grub_ieee1275_original_stack): New + * kern/sparc64/ieee1275/init.c (VasEBoot_ieee1275_original_stack): New variable. - (grub_heap_init): Use grub_modules_get_end. - * loader/sparc64/ieee1275/linux.c (grub_linux_boot): Restore original + (VasEBoot_heap_init): Use VasEBoot_modules_get_end. + * loader/sparc64/ieee1275/linux.c (VasEBoot_linux_boot): Restore original stack. - * util/grub-mkrawimage.c (generate_image): Support sparc64. + * util/VasEBoot-mkrawimage.c (generate_image): Support sparc64. (main): Likewise. - * util/sparc64/ieee1275/grub-mkimage.c: Removed. + * util/sparc64/ieee1275/VasEBoot-mkimage.c: Removed. 2010-03-14 Thorsten Glaser - * util/grub-mkrescue.in: Base ISO UUID on UTC. + * util/VasEBoot-mkrescue.in: Base ISO UUID on UTC. 2010-03-08 Matt Kraai - * util/i386/pc/grub-setup.c (setup): Fix a grammatical error (Debian + * util/i386/pc/VasEBoot-setup.c (setup): Fix a grammatical error (Debian bug #559005). 2010-03-07 Vladimir Serbinenko @@ -30280,20 +30280,20 @@ 2010-03-06 Vladimir Serbinenko - * normal/cmdline.c (grub_cmdline_get): Fix gabled line after + * normal/cmdline.c (VasEBoot_cmdline_get): Fix gabled line after completition in the middle of string. 2010-03-06 Vladimir Serbinenko - * util/grub-mkrescue.in: Use mktemp with explicit template. + * util/VasEBoot-mkrescue.in: Use mktemp with explicit template. 2010-03-06 Vladimir Serbinenko - * loader/i386/bsd.c (grub_bsd_get_device): Fix a memory leak. + * loader/i386/bsd.c (VasEBoot_bsd_get_device): Fix a memory leak. 2010-03-06 Vladimir Serbinenko - * loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Free the + * loader/i386/multiboot_mbi.c (VasEBoot_multiboot_set_bootdev): Free the right pointer. 2010-03-05 Vladimir Serbinenko @@ -30309,17 +30309,17 @@ 2010-03-04 Vladimir Serbinenko - * gettext/gettext.c (grub_gettext_init_ext): Fix a memory leak. + * gettext/gettext.c (VasEBoot_gettext_init_ext): Fix a memory leak. 2010-03-04 Vladimir Serbinenko - * disk/scsi.c (grub_scsi_iterate): Fix a memory leak. + * disk/scsi.c (VasEBoot_scsi_iterate): Fix a memory leak. -2010-03-04 Robert Millan +2010-03-04 Robert Millan Support relative image path in theme file. - * gfxmenu/gui_image.c (grub_gui_image): New member theme_dir. + * gfxmenu/gui_image.c (VasEBoot_gui_image): New member theme_dir. (image_set_property): Handle theme_dir and relative path. 2010-03-04 Vladimir Serbinenko @@ -30332,7 +30332,7 @@ 2010-03-04 Vladimir Serbinenko - * kern/main.c (grub_load_modules): Handle errors from init functions of + * kern/main.c (VasEBoot_load_modules): Handle errors from init functions of embeded modules. 2010-03-04 Vladimir Serbinenko @@ -30363,7 +30363,7 @@ 2010-03-04 Christian Franke - * util/grub-pe2elf.c: Add missing include "progname.h". + * util/VasEBoot-pe2elf.c: Add missing include "progname.h". 2010-03-04 Vladimir Serbinenko @@ -30377,7 +30377,7 @@ 2010-03-04 Vladimir Serbinenko - * Makefile.in (CLEANFILES) [FONT_SOURCE && grub_mkfont]: Add + * Makefile.in (CLEANFILES) [FONT_SOURCE && VasEBoot_mkfont]: Add ascii.bitmaps. 2010-03-04 Vladimir Serbinenko @@ -30387,28 +30387,28 @@ 2010-03-04 Vladimir Serbinenko - * util/i386/efi/grub-install.in: Copy gettext files. + * util/i386/efi/VasEBoot-install.in: Copy gettext files. 2010-03-01 Vladimir Serbinenko - * fs/ext2.c (grub_ext2_read_block): Fix an integer overflow. + * fs/ext2.c (VasEBoot_ext2_read_block): Fix an integer overflow. 2010-03-01 Vladimir Serbinenko Wait for user entry basing on presence of output rather than on errors. - * include/grub/normal.h (grub_normal_get_line_counter): New proto. - (grub_install_newline_hook): Likewise. - * normal/main.c (GRUB_MOD_INIT): Call grub_install_newline_hook. + * include/VasEBoot/normal.h (VasEBoot_normal_get_line_counter): New proto. + (VasEBoot_install_newline_hook): Likewise. + * normal/main.c (VasEBoot_MOD_INIT): Call VasEBoot_install_newline_hook. * normal/menu.c (show_menu): Check line_counter to determine presence of output. - * normal/term.c (grub_normal_line_counter): New variable. - (grub_normal_get_line_counter): New function. - (grub_install_newline_hook): Likewise. + * normal/term.c (VasEBoot_normal_line_counter): New variable. + (VasEBoot_normal_get_line_counter): New function. + (VasEBoot_install_newline_hook): Likewise. 2010-03-01 Vladimir Serbinenko - * commands/cat.c (grub_cmd_cat): Propagate grub_gzfile_open error. + * commands/cat.c (VasEBoot_cmd_cat): Propagate VasEBoot_gzfile_open error. 2010-03-01 Vladimir Serbinenko @@ -30416,7 +30416,7 @@ 2010-02-26 Vladimir Serbinenko - * util/grub.d/10_linux.in (linux_entry): Don't default to + * util/VasEBoot.d/10_linux.in (linux_entry): Don't default to gfxpayload=keep if Linux doesn't support video handover. 2010-02-25 Vladimir Serbinenko @@ -30429,92 +30429,92 @@ * conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add bitmap.h, video.h, gfxterm.h, font.h, bitmap_scale.h and bufio.h. * conf/mips.rmk (kernel_img_HEADERS): Add values instead of overwriting. - * include/grub/bitmap.h: Add EXPORT_FUNC and EXPORT_VAR. - * include/grub/bitmap_scale.h: Likewise. - * include/grub/bufio.h: Likewise. - * include/grub/font.h: Likewise. - * include/grub/gfxterm.h: Likewise. - * include/grub/video.h: Likewise. - * include/grub/vbe.h: Don't include video_fb.h. + * include/VasEBoot/bitmap.h: Add EXPORT_FUNC and EXPORT_VAR. + * include/VasEBoot/bitmap_scale.h: Likewise. + * include/VasEBoot/bufio.h: Likewise. + * include/VasEBoot/font.h: Likewise. + * include/VasEBoot/gfxterm.h: Likewise. + * include/VasEBoot/video.h: Likewise. + * include/VasEBoot/vbe.h: Don't include video_fb.h. * video/i386/pc/vbe.c: Include video_fb.h. * commands/i386/pc/vbetest.c: Include video.h. 2010-02-25 Jordan Uggla - * util/grub-mkconfig.in (GRUB_SAVEDEFAULT): Export new variable. - * util/grub-mkconfig_lib.in (save_default_entry): Only save a new - default entry if GRUB_SAVEDEFAULT=true. This allows using - GRUB_DEFAULT=saved on its own to let grub-reboot work, without + * util/VasEBoot-mkconfig.in (VasEBoot_SAVEDEFAULT): Export new variable. + * util/VasEBoot-mkconfig_lib.in (save_default_entry): Only save a new + default entry if VasEBoot_SAVEDEFAULT=true. This allows using + VasEBoot_DEFAULT=saved on its own to let VasEBoot-reboot work, without saving a new default on every boot. 2010-02-24 Vladimir Serbinenko * normal/crypto.c (read_crypto_list): Fix a memory leak. * normal/term.c (read_terminal_list): Likewise. - * normal/main.c (grub_normal_init_page): Likewise. - (grub_normal_read_line_real): Likewise. + * normal/main.c (VasEBoot_normal_init_page): Likewise. + (VasEBoot_normal_read_line_real): Likewise. 2010-02-24 Vladimir Serbinenko - * loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Fix a + * loader/i386/multiboot_mbi.c (VasEBoot_multiboot_set_bootdev): Fix a memory leak. Reported by: Seth Goldberg. 2010-02-24 Joey Korkames - * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Remove + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Remove duplicate declaration of `start'. 2010-02-20 Vladimir Serbinenko - * fs/iso9660.c (grub_iso9660_iterate_dir): Strip version from joliet + * fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Strip version from joliet filename. Reported by: Georgy Buranov 2010-02-20 Carles Pina i Estany - * util/grub-mkrawimage.c (usage): Change string formatting to + * util/VasEBoot-mkrawimage.c (usage): Change string formatting to improve gettext. 2010-02-20 Manoel Rebelo Abranches - * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Add delete and + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Add delete and backspace keys. 2010-02-20 Vladimir Serbinenko - * video/fb/video_fb.c (grub_video_fb_scroll): Fix a pixel size bug. + * video/fb/video_fb.c (VasEBoot_video_fb_scroll): Fix a pixel size bug. Reported by: Michael Suchanek. 2010-02-18 Samuel Thibault - * util/grub-mkconfig.in: Export GRUB_INIT_TUNE. - * util/grub.d/00_header.in: Handle GRUB_INIT_TUNE. + * util/VasEBoot-mkconfig.in: Export VasEBoot_INIT_TUNE. + * util/VasEBoot.d/00_header.in: Handle VasEBoot_INIT_TUNE. 2010-02-16 Vladimir Serbinenko Remove any reference to non-free fonts. - * commands/videotest.c (grub_cmd_videotest): Use unifont by default. + * commands/videotest.c (VasEBoot_cmd_videotest): Use unifont by default. * docs/gfxmenu-theme-example.txt: Removed. It's both outdated and uses non-free components. - * font/font.c (grub_font_get_name): Remove example name. - * gfxmenu/gui_label.c (grub_gui_label_new): Use unifont by default. - * gfxmenu/gui_list.c (grub_gui_list_new): Likewise. - * gfxmenu/gui_progress_bar.c (grub_gui_progress_bar_new): Likewise. - * gfxmenu/view.c (grub_gfxmenu_view_new): Likewise. + * font/font.c (VasEBoot_font_get_name): Remove example name. + * gfxmenu/gui_label.c (VasEBoot_gui_label_new): Use unifont by default. + * gfxmenu/gui_list.c (VasEBoot_gui_list_new): Likewise. + * gfxmenu/gui_progress_bar.c (VasEBoot_gui_progress_bar_new): Likewise. + * gfxmenu/view.c (VasEBoot_gfxmenu_view_new): Likewise. 2010-02-16 Georgy Buranov - * disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix a typo. + * disk/efi/efidisk.c (VasEBoot_efidisk_get_device_name): Fix a typo. 2010-02-15 Vladimir Serbinenko - * term/serial.c (serial_get_divisor) [GRUB_MACHINE_MIPS_YEELOONG]: + * term/serial.c (serial_get_divisor) [VasEBoot_MACHINE_MIPS_YEELOONG]: Double divisor. - (serial_hw_init) [GRUB_MACHINE_MIPS_YEELOONG]: Don't enable advanced + (serial_hw_init) [VasEBoot_MACHINE_MIPS_YEELOONG]: Don't enable advanced features. - (GRUB_MOD_INIT) [GRUB_MACHINE_MIPS_YEELOONG]: Default to 115200. + (VasEBoot_MOD_INIT) [VasEBoot_MACHINE_MIPS_YEELOONG]: Default to 115200. 2010-02-15 Vladimir Serbinenko @@ -30522,13 +30522,13 @@ 2010-02-14 Samuel Thibault - * commands/i386/pc/play.c (GRUB_MOD_INIT(play)): Fix help. - * docs/grub.texi (Command-line and menu entry commands): Document play + * commands/i386/pc/play.c (VasEBoot_MOD_INIT(play)): Fix help. + * docs/VasEBoot.texi (Command-line and menu entry commands): Document play command. 2010-02-14 Samuel Thibault - * commands/i386/pc/play.c (grub_cmd_play): If grub_file_open fails, + * commands/i386/pc/play.c (VasEBoot_cmd_play): If VasEBoot_file_open fails, parse arguments as inline tempo and notes. Move code for playing notes to... (play): ... new function. @@ -30536,67 +30536,67 @@ 2010-02-14 Samuel Thibault * commands/i386/pc/play.c (T_REST, T_FINE, struct note, beep_on): Use - grub_uint16_t instead of short. - (grub_cmd_play): Use grub_uint32_t instead of int, convert data from + VasEBoot_uint16_t instead of short. + (VasEBoot_cmd_play): Use VasEBoot_uint32_t instead of int, convert data from disk from little endian to cpu endianness. 2010-02-07 Samuel Thibault * commands/i386/pc/play.c (BASE_TEMPO): Set to 60 * - GRUB_TICKS_PER_SECOND instead of 120. + VasEBoot_TICKS_PER_SECOND instead of 120. 2010-02-14 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Wait for possible + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Wait for possible escape sequence after \e. 2010-02-14 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_putchar): Don't output + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_putchar): Don't output non-ASCII characters. 2010-02-14 Vladimir Serbinenko - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Enclose + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Enclose set root in single quotes to prevent \, from being unescaped. 2010-02-14 Vladimir Serbinenko Prevent unknown commands from stopping menuentry execution. - * script/execute.c (grub_script_execute_cmdline): Print error after + * script/execute.c (VasEBoot_script_execute_cmdline): Print error after unknown command. 2010-02-14 Vladimir Serbinenko - * fs/i386/pc/pxe.c (GRUB_MOD_INIT): Fix typo. + * fs/i386/pc/pxe.c (VasEBoot_MOD_INIT): Fix typo. Reported by: Pavel Pisa. 2010-02-13 Vladimir Serbinenko - * io/gzio.c (grub_gzio_open): Use grub_zalloc. + * io/gzio.c (VasEBoot_gzio_open): Use VasEBoot_zalloc. 2010-02-13 Vladimir Serbinenko - Merge grub_ieee1275_map_physical into grub_map and rename to - grub_ieee1275_map + Merge VasEBoot_ieee1275_map_physical into VasEBoot_map and rename to + VasEBoot_ieee1275_map - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_map): New proto. - * include/grub/sparc64/ieee1275/ieee1275.h (grub_ieee1275_map_physical): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_map): New proto. + * include/VasEBoot/sparc64/ieee1275/ieee1275.h (VasEBoot_ieee1275_map_physical): Remove. - * kern/ieee1275/openfw.c (grub_map): Rename to ... - (grub_ieee1275_map): ... this. All users updated. Add phys_lo when + * kern/ieee1275/openfw.c (VasEBoot_map): Rename to ... + (VasEBoot_ieee1275_map): ... this. All users updated. Add phys_lo when necessary. - * kern/sparc64/ieee1275/ieee1275.c (grub_ieee1275_map_physical): Remove. + * kern/sparc64/ieee1275/ieee1275.c (VasEBoot_ieee1275_map_physical): Remove. 2010-02-13 Vladimir Serbinenko - * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Check device type before + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Check device type before opening and not after. 2010-02-13 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Macroify + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Macroify constants. 2010-02-13 Vladimir Serbinenko @@ -30614,62 +30614,62 @@ 2010-02-13 Vladimir Serbinenko - * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Remove excessively + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_read): Remove excessively verbose dprintf. 2010-02-13 Vladimir Serbinenko Fix over-4GiB seek on sparc64. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_seek): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_seek): Replace pos_i and pos_lo with pos. All users updated. - * include/grub/powerpc/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF): + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (VasEBoot_IEEE1275_CELL_SIZEOF): New constant. - * include/grub/sparc64/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF): + * include/VasEBoot/sparc64/ieee1275/ieee1275.h (VasEBoot_IEEE1275_CELL_SIZEOF): Likewise. - * kern/ieee1275/ieee1275.c (grub_ieee1275_seek): Split pos into pos_hi + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_seek): Split pos into pos_hi and pos_lo. 2010-02-13 Vladimir Serbinenko - * util/grub-mkrawimage.c (main): Call set_program_name. + * util/VasEBoot-mkrawimage.c (main): Call set_program_name. 2010-02-13 Vladimir Serbinenko Properly align 64-bit targets. - * util/grub-mkrawimage.c (ALIGN_ADDR): New macro. + * util/VasEBoot-mkrawimage.c (ALIGN_ADDR): New macro. (generate_image): Use ALIGN_ADDR. 2010-02-13 Vladimir Serbinenko Properly create cross-endian images. - * include/grub/types.h (grub_host_to_target_addr): New macro - * util/grub-mkrawimage.c (generate_image): Add missing host_to_target. + * include/VasEBoot/types.h (VasEBoot_host_to_target_addr): New macro + * util/VasEBoot-mkrawimage.c (generate_image): Add missing host_to_target. 2010-02-13 Vladimir Serbinenko - * util/grub-mkrawimage.c (generate_image): Add forgotten ALIGN_UP. + * util/VasEBoot-mkrawimage.c (generate_image): Add forgotten ALIGN_UP. 2010-02-10 Vladimir Serbinenko Pass SIMPLE framebuffer size in bytes and not 64K blocks. - * loader/i386/efi/linux.c (grub_linux_setup_video): Don't divide by 64K. - * loader/i386/linux.c (grub_linux_setup_video): Likewise. - (grub_linux_boot): Divide by 64K when on VESA. + * loader/i386/efi/linux.c (VasEBoot_linux_setup_video): Don't divide by 64K. + * loader/i386/linux.c (VasEBoot_linux_setup_video): Likewise. + (VasEBoot_linux_boot): Divide by 64K when on VESA. 2010-02-10 Vladimir Serbinenko - Support GRUB_GFXPAYLOAD_LINUX. + Support VasEBoot_GFXPAYLOAD_LINUX. - * util/grub-mkconfig.in: Export GRUB_GFXPAYLOAD_LINUX. - * util/grub.d/10_linux.in (linux_entry): Handle GRUB_GFXPAYLOAD_LINUX. + * util/VasEBoot-mkconfig.in: Export VasEBoot_GFXPAYLOAD_LINUX. + * util/VasEBoot.d/10_linux.in (linux_entry): Handle VasEBoot_GFXPAYLOAD_LINUX. 2010-02-10 Vladimir Serbinenko - * script/execute.c (grub_script_execute_cmdline): Use grub_print_error + * script/execute.c (VasEBoot_script_execute_cmdline): Use VasEBoot_print_error to show messages instead of discarding them. Process errors after executing command and not before. Keep old method too as precaution. @@ -30680,7 +30680,7 @@ 2010-02-07 Vladimir Serbinenko - * kern/ieee1275/openfw.c (grub_halt): Try executing "poweroff". + * kern/ieee1275/openfw.c (VasEBoot_halt): Try executing "poweroff". 2010-02-07 Vladimir Serbinenko @@ -30692,9 +30692,9 @@ 2010-02-07 Vladimir Serbinenko - * include/grub/multiboot2.h: Remove leftover file. - * include/grub/normal.h [GRUB_UTIL]: Remove leftover declarations. - * include/grub/partition.h [GRUB_UTIL]: Likewise. + * include/VasEBoot/multiboot2.h: Remove leftover file. + * include/VasEBoot/normal.h [VasEBoot_UTIL]: Remove leftover declarations. + * include/VasEBoot/partition.h [VasEBoot_UTIL]: Likewise. 2010-02-07 Yves Blusseau @@ -30702,57 +30702,57 @@ 2010-02-07 Vladimir Serbinenko - Fix warnings in grub-emu when compiling with maximum warning options. + Fix warnings in VasEBoot-emu when compiling with maximum warning options. - * util/grub-emu.c (ENABLE_RELOCATABLE): New definition. - (grub_arch_modules_addr): Return 0 and not NULL. + * util/VasEBoot-emu.c (ENABLE_RELOCATABLE): New definition. + (VasEBoot_arch_modules_addr): Return 0 and not NULL. * util/misc.c (ENABLE_RELOCATABLE): New definition. (xstrdup): Use newstr instead of dup. - * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Rename one instance + * util/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Rename one instance of disk to dsk to avoid shadowing. (find_free_slot): Fix prototype. - * util/getroot.c (grub_util_is_dmraid): Make static. - * include/grub/time.h (grub_get_rtc) [GRUB_MACHINE_EMU || GRUB_UTIL]: + * util/getroot.c (VasEBoot_util_is_dmraid): Make static. + * include/VasEBoot/time.h (VasEBoot_get_rtc) [VasEBoot_MACHINE_EMU || VasEBoot_UTIL]: Add missing prototype. - * util/sdl.c (grub_video_sdl_set_viewport): Remove. + * util/sdl.c (VasEBoot_video_sdl_set_viewport): Remove. 2010-02-07 Vladimir Serbinenko - * loader/i386/linux.c (grub_linux_setup_video): Handle error + * loader/i386/linux.c (VasEBoot_linux_setup_video): Handle error appropriately. 2010-02-07 Vladimir Serbinenko - * fs/reiserfs.c (grub_reiserfs_read): Use #if 0 instead of commenting + * fs/reiserfs.c (VasEBoot_reiserfs_read): Use #if 0 instead of commenting code out. 2010-02-07 Vladimir Serbinenko - * include/grub/cache.h (grub_arch_sync_caches) [i386 || x86_64]: Inline. - * kern/i386/coreboot/init.c (grub_arch_sync_caches): Remove. - * kern/i386/efi/init.c (grub_arch_sync_caches): Likewise. - * kern/i386/ieee1275/init.c (grub_arch_sync_caches): Likewise. - * kern/i386/pc/init.c (grub_arch_sync_caches): Likewise. - * util/misc.c (grub_arch_sync_caches) [i386 || x86_64]: Likewise. + * include/VasEBoot/cache.h (VasEBoot_arch_sync_caches) [i386 || x86_64]: Inline. + * kern/i386/coreboot/init.c (VasEBoot_arch_sync_caches): Remove. + * kern/i386/efi/init.c (VasEBoot_arch_sync_caches): Likewise. + * kern/i386/ieee1275/init.c (VasEBoot_arch_sync_caches): Likewise. + * kern/i386/pc/init.c (VasEBoot_arch_sync_caches): Likewise. + * util/misc.c (VasEBoot_arch_sync_caches) [i386 || x86_64]: Likewise. 2010-02-07 Vladimir Serbinenko - * include/grub/err.h (grub_err_printf): Don't export. + * include/VasEBoot/err.h (VasEBoot_err_printf): Don't export. 2010-02-07 Vladimir Serbinenko - * include/grub/dl.h (grub_dl_register_symbol): Don't export. + * include/VasEBoot/dl.h (VasEBoot_dl_register_symbol): Don't export. 2010-02-07 Vladimir Serbinenko - * include/grub/i18n.h (grub_gettext_dummy): Removed. - * kern/misc.c (grub_gettext_dummy): Make static. + * include/VasEBoot/i18n.h (VasEBoot_gettext_dummy): Removed. + * kern/misc.c (VasEBoot_gettext_dummy): Make static. 2010-02-06 Vladimir Serbinenko - * kern/misc.c (grub_utf8_to_ucs4): Don't eat valid characters preceeded + * kern/misc.c (VasEBoot_utf8_to_ucs4): Don't eat valid characters preceeded by non-valid ones. - * kern/term.c (grub_putchar): Likewise. + * kern/term.c (VasEBoot_putchar): Likewise. 2010-02-06 Vladimir Serbinenko @@ -30761,38 +30761,38 @@ 2010-02-06 Vladimir Serbinenko - * commands/ls.c (grub_ls_list_files): Free pathname on exit. + * commands/ls.c (VasEBoot_ls_list_files): Free pathname on exit. 2010-02-06 Vladimir Serbinenko - * fs/fat.c (grub_fat_iterate_dir): Free unibuf at exit. + * fs/fat.c (VasEBoot_fat_iterate_dir): Free unibuf at exit. 2010-02-06 Vladimir Serbinenko - * loader/i386/pc/xnu.c (grub_xnu_set_video): Add const qualifier to + * loader/i386/pc/xnu.c (VasEBoot_xnu_set_video): Add const qualifier to modevar. - Return grub_errno on allocation error. + Return VasEBoot_errno on allocation error. 2010-02-06 Vladimir Serbinenko - * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Correct error handling. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_read): Correct error handling. 2010-02-06 Yves Blusseau - * conf/common.rmk (grub_script_check_SOURCES): add missing dependencies. - (grub_mkpasswd_pbkdf2_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_script_check_SOURCES): add missing dependencies. + (VasEBoot_mkpasswd_pbkdf2_SOURCES): Likewise. 2010-02-06 Vladimir Serbinenko - * fs/i386/pc/pxe.c (grub_pxefs_dir): Return with failure on + * fs/i386/pc/pxe.c (VasEBoot_pxefs_dir): Return with failure on non-pxe disk. - (grub_pxefs_open): Likewise. + (VasEBoot_pxefs_open): Likewise. -2010-02-06 Robert Millan +2010-02-06 Robert Millan - * util/grub.d/10_hurd.in: Add --class information to menuentries. - * util/grub.d/10_kfreebsd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Add --class information to menuentries. + * util/VasEBoot.d/10_kfreebsd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. 2010-02-06 Colin D Bennett @@ -30800,7 +30800,7 @@ (gfxmenu_mod_SOURCES): New variable. (gfxmenu_mod_CFLAGS): Likewise. (gfxmenu_mod_LDFLAGS): Likewise. - * include/grub/term.h (grub_term_set_current_output): Declare + * include/VasEBoot/term.h (VasEBoot_term_set_current_output): Declare argument as const. * docs/gfxmenu-theme-example.txt: New file. * gfxmenu/gfxmenu.c: Likewise. @@ -30819,19 +30819,19 @@ * gfxmenu/theme_loader.c: Likewise. * gfxmenu/view.c: Likewise. * gfxmenu/widget-box.c: Likewise. - * include/grub/gfxmenu_model.h: Likewise. - * include/grub/gfxmenu_view.h: Likewise. - * include/grub/gfxwidgets.h: Likewise. - * include/grub/gui.h: Likewise. - * include/grub/gui_string_util.h: Likewise. - * include/grub/icon_manager.h: Likewise. + * include/VasEBoot/gfxmenu_model.h: Likewise. + * include/VasEBoot/gfxmenu_view.h: Likewise. + * include/VasEBoot/gfxwidgets.h: Likewise. + * include/VasEBoot/gui.h: Likewise. + * include/VasEBoot/gui_string_util.h: Likewise. + * include/VasEBoot/icon_manager.h: Likewise. 2010-02-06 Vladimir Serbinenko Agglomerate scrolling in gfxterm. - * term/gfxterm.c (grub_virtual_screen): New member 'total_screen'. - (grub_virtual_screen_setup): Initialise 'total_screen'. + * term/gfxterm.c (VasEBoot_virtual_screen): New member 'total_screen'. + (VasEBoot_virtual_screen_setup): Initialise 'total_screen'. (write_char): Split to ... (paint_char): ... this ... (write_char): ... and this. @@ -30842,54 +30842,54 @@ (scroll_up): ... and this. (real_scroll): Handle multi-line scroll and draw below-the-bottom characters. - (grub_gfxterm_refresh): Call real_scroll. + (VasEBoot_gfxterm_refresh): Call real_scroll. 2010-02-06 Colin D Bennett - * include/grub/misc.h (grub_iscntrl): New inline function. - (grub_isalnum): Likewise. - (grub_strtol): Likewise. + * include/VasEBoot/misc.h (VasEBoot_iscntrl): New inline function. + (VasEBoot_isalnum): Likewise. + (VasEBoot_strtol): Likewise. 2010-02-06 Colin D Bennett * normal/menu_text.c (get_entry_number): Move from here ... * normal/menu.c (get_entry_number): ... moved here. - * include/grub/menu.h (grub_menu_get_default_entry_index): + * include/VasEBoot/menu.h (VasEBoot_menu_get_default_entry_index): New prototype. - * normal/menu.c (grub_menu_get_default_entry_index): New function. - * normal/menu_text.c (run_menu): Use grub_menu_get_default_entry_index. - * include/grub/menu_viewer.h (grub_menu_viewer_init): New prototype. - (grub_menu_viewer_should_return): Likewise. - * normal/main.c (GRUB_MOD_INIT (normal)): Call grub_menu_viewer_init. + * normal/menu.c (VasEBoot_menu_get_default_entry_index): New function. + * normal/menu_text.c (run_menu): Use VasEBoot_menu_get_default_entry_index. + * include/VasEBoot/menu_viewer.h (VasEBoot_menu_viewer_init): New prototype. + (VasEBoot_menu_viewer_should_return): Likewise. + * normal/main.c (VasEBoot_MOD_INIT (normal)): Call VasEBoot_menu_viewer_init. * normal/menu_text.c (run_menu): Enable menu switching. * normal/menu_viewer.c (should_return): New variable. (menu_viewer_changed): Likewise. - (grub_menu_viewer_show_menu): Handle menu viewer changes. - (grub_menu_viewer_should_return): New function. + (VasEBoot_menu_viewer_show_menu): Handle menu viewer changes. + (VasEBoot_menu_viewer_should_return): New function. (menuviewer_write_hook): Likewise. - (grub_menu_viewer_init): Likewise. + (VasEBoot_menu_viewer_init): Likewise. 2010-02-06 Colin D Bennet 2010-02-06 Vladimir Serbinenko Support for gfxterm in a window. - * include/grub/gfxterm.h: New file. - * include/grub/video.h (struct grub_video_rect): New declaration. - (grub_video_rect_t): Likewise. - * term/gfxterm.c (struct grub_gfxterm_window): New type. + * include/VasEBoot/gfxterm.h: New file. + * include/VasEBoot/video.h (struct VasEBoot_video_rect): New declaration. + (VasEBoot_video_rect_t): Likewise. + * term/gfxterm.c (struct VasEBoot_gfxterm_window): New type. (refcount): New variable. (render_target): Likewise. (window): Likewise. (repaint_callback): Likewise. - (grub_virtual_screen_setup): Use 'render_target'. + (VasEBoot_virtual_screen_setup): Use 'render_target'. (init_window): New function. - (grub_gfxterm_init_window): Likewise. - (grub_gfxterm_init): Check reference counter. + (VasEBoot_gfxterm_init_window): Likewise. + (VasEBoot_gfxterm_init): Check reference counter. Use init_window. (destroy_window): New function. - (grub_gfxterm_destroy_window): Likewise. - (grub_gfxterm_fini): Check reference counter. + (VasEBoot_gfxterm_destroy_window): Likewise. + (VasEBoot_gfxterm_fini): Check reference counter. Use destroy_window. (redraw_screen_rect): Restore viewport. Use 'render_target' and 'window'. @@ -30899,12 +30899,12 @@ (scroll_up): Restore viewport. Use 'render_target' and 'window'. Call 'repaint_callback'. - (grub_gfxterm_cls): Likewise. - (grub_gfxterm_refresh): Use 'window'. - (grub_gfxterm_set_repaint_callback): New function. - (grub_gfxterm_background_image_cmd): Use 'window'. - (grub_gfxterm_get_term): New function. - (GRUB_MOD_INIT(term_gfxterm)): Set 'refcount' to 0. + (VasEBoot_gfxterm_cls): Likewise. + (VasEBoot_gfxterm_refresh): Use 'window'. + (VasEBoot_gfxterm_set_repaint_callback): New function. + (VasEBoot_gfxterm_background_image_cmd): Use 'window'. + (VasEBoot_gfxterm_get_term): New function. + (VasEBoot_MOD_INIT(term_gfxterm)): Set 'refcount' to 0. 2010-02-06 Colin D Bennett @@ -30914,13 +30914,13 @@ (bitmap_scale_mod_SOURCES): New variable. (bitmap_scale_mod_CFLAGS): Likewise. (bitmap_scale_mod_LDFLAGS): Likewise. - * include/grub/bitmap_scale.h: New file. + * include/VasEBoot/bitmap_scale.h: New file. * term/gfxterm.c (BACKGROUND_CMD_ARGINDEX_MODE): New definiton. (background_image_cmd_options): New variable. - (grub_gfxterm_background_image_cmd): Support bitmap stretching. + (VasEBoot_gfxterm_background_image_cmd): Support bitmap stretching. (cmd): Rename and change type to ... (background_image_cmd_handle): ... this. All users updated. - (GRUB_MOD_INIT(term_gfxterm)): Make background_image extended command. + (VasEBoot_MOD_INIT(term_gfxterm)): Make background_image extended command. * video/bitmap_scale.c: New file. 2010-02-06 Vladimir Serbinenko @@ -30928,11 +30928,11 @@ SDL support. * Makefile.in (LIBSDL): New variable. - (enable_grub_emu_sdl): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add video files. - (grub_emu_SOURCES) [enable_grub_emu_sdl]: Add util/sdl.c. - (grub_emu_LDFLAGS) [enable_grub_emu_sdl]: Add $(LIBSDL). - * configure.ac: Detect SDL availability and add --enable-grub-emu-sdl + (enable_VasEBoot_emu_sdl): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add video files. + (VasEBoot_emu_SOURCES) [enable_VasEBoot_emu_sdl]: Add util/sdl.c. + (VasEBoot_emu_LDFLAGS) [enable_VasEBoot_emu_sdl]: Add $(LIBSDL). + * configure.ac: Detect SDL availability and add --enable-VasEBoot-emu-sdl * util/sdl.c: New file. 2010-02-06 Colin D Bennett @@ -30940,34 +30940,34 @@ Double buffering support. - * commands/i386/pc/videotest.c (grub_cmd_videotest): Swap doublebuffers. - * include/grub/video.h: Update comment. - * include/grub/video_fb.h (grub_video_fb_doublebuf_update_screen_t): + * commands/i386/pc/videotest.c (VasEBoot_cmd_videotest): Swap doublebuffers. + * include/VasEBoot/video.h: Update comment. + * include/VasEBoot/video_fb.h (VasEBoot_video_fb_doublebuf_update_screen_t): New type. - (grub_video_fb_doublebuf_blit_init): New prototype. + (VasEBoot_video_fb_doublebuf_blit_init): New prototype. * term/gfxterm.c (scroll_up): Support double buffering. - (grub_gfxterm_refresh): Likewise. + (VasEBoot_gfxterm_refresh): Likewise. * video/fb/video_fb.c (doublebuf_blit_update_screen): New function. - (grub_video_fb_doublebuf_blit_init): Likewise. + (VasEBoot_video_fb_doublebuf_blit_init): Likewise. * video/i386/pc/vbe.c (framebuffer): Remove 'render_target'. Add 'front_target', 'back_target', 'offscreen_buffer', 'page_size', 'displayed_page', 'render_page' and 'update_screen'. - (grub_video_vbe_fini): Free offscreen buffer. + (VasEBoot_video_vbe_fini): Free offscreen buffer. (doublebuf_pageflipping_commit): New function. (doublebuf_pageflipping_update_screen): Likewise. (doublebuf_pageflipping_init): Likewise. (double_buffering_init): Likewise. - (grub_video_vbe_setup): Enable doublebuffering. - (grub_video_vbe_swap_buffers): Implement. - (grub_video_vbe_set_active_render_target): Handle double buffering. - (grub_video_vbe_get_active_render_target): Likewise. - (grub_video_vbe_get_info_and_fini): Likewise. Free offscreen_buffer. - (grub_video_vbe_adapter): Use grub_video_vbe_get_active_render_target. - (grub_video_vbe_enable_double_buffering): Likewise. - (grub_video_vbe_swap_buffers): Use update_screen. - (grub_video_set_mode): Use double buffering. + (VasEBoot_video_vbe_setup): Enable doublebuffering. + (VasEBoot_video_vbe_swap_buffers): Implement. + (VasEBoot_video_vbe_set_active_render_target): Handle double buffering. + (VasEBoot_video_vbe_get_active_render_target): Likewise. + (VasEBoot_video_vbe_get_info_and_fini): Likewise. Free offscreen_buffer. + (VasEBoot_video_vbe_adapter): Use VasEBoot_video_vbe_get_active_render_target. + (VasEBoot_video_vbe_enable_double_buffering): Likewise. + (VasEBoot_video_vbe_swap_buffers): Use update_screen. + (VasEBoot_video_set_mode): Use double buffering. -2010-02-06 Robert Millan +2010-02-06 Robert Millan * maintainance/gentrigtables.py: Remove. * lib/trig.c: Likewise. @@ -30980,7 +30980,7 @@ (gentrigtables): Likewise. (DISTCLEANFILES): Add `trigtables.c' and `gentrigtables'. -2010-02-06 Robert Millan +2010-02-06 Robert Millan * maintainance/gentrigtables.py: Avoid duplicate hardcoding of integer constants. @@ -30989,7 +30989,7 @@ Trigonometry support. - * include/grub/trig.h: New file. + * include/VasEBoot/trig.h: New file. * lib/trig.c: Likewise. * maintainance/gentrigtables.py: Likewise. * conf/common.rmk (pkglib_MODULES): Add trig.mod. @@ -30999,55 +30999,55 @@ 2010-02-06 Vladimir Serbinenko - * kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): Support whole + * kern/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): Support whole disk devices. 2010-02-06 Vladimir Serbinenko - * kern/ieee1275/openfw.c (grub_devalias_iterate): Stop iterating on + * kern/ieee1275/openfw.c (VasEBoot_devalias_iterate): Stop iterating on error. 2010-02-03 Vladimir Serbinenko * util/hostdisk.c (open_device): Don't use partition device when reading before the partition. - (grub_util_biosdisk_read): Don't read from partition and before the + (VasEBoot_util_biosdisk_read): Don't read from partition and before the partition in single operation. - (grub_util_biosdisk_write): Don't write to partition and before the + (VasEBoot_util_biosdisk_write): Don't write to partition and before the partition in single operation. 2010-02-03 Torsten Landschoff - * kern/disk.c (grub_disk_read): Fix offset computation when reading + * kern/disk.c (VasEBoot_disk_read): Fix offset computation when reading last sectors. 2010-02-03 Vladimir Serbinenko - * disk/i386/pc/biosdisk.c (grub_biosdisk_read): Handle non-2048 aligned + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_read): Handle non-2048 aligned CDROM reads. - (grub_biosdisk_write): Refuse to write to CDROM. + (VasEBoot_biosdisk_write): Refuse to write to CDROM. 2010-01-31 Vladimir Serbinenko - * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Fix off-by-one error. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Fix off-by-one error. 2010-01-31 Vladimir Serbinenko * font/font.c (find_glyph): Check that bmp_idx is available before using it. - (grub_font_get_string_width): Never call grub_font_get_glyph_internal + (VasEBoot_font_get_string_width): Never call VasEBoot_font_get_glyph_internal with (font == NULL). 2010-01-28 Christian Schmitt - * util/ieee1275/grub-install.in: Fix nvsetenv arguments. + * util/ieee1275/VasEBoot-install.in: Fix nvsetenv arguments. 2010-01-28 BVK Chaitanya - * include/grub/script_sh.h (sourcecode): Add const qualifier. - * util/grub-script-check.c (getline): Fix empty lines case. + * include/VasEBoot/script_sh.h (sourcecode): Add const qualifier. + * util/VasEBoot-script-check.c (getline): Fix empty lines case. -2010-01-28 Robert Millan +2010-01-28 Robert Millan * Makefile.in (check): Exit with fail status when one of the tests fails. @@ -31056,20 +31056,20 @@ 2010-01-28 Colin Watson - * util/grub.d/10_linux.in: This script does not use any of the + * util/VasEBoot.d/10_linux.in: This script does not use any of the contents of gettext.sh, only the external command `gettext', so stop sourcing it. (Moreover, gettext.sh isn't necessarily installed in - the same prefix as GRUB.) - * util/grub.d/10_kfreebsd.in: Likewise. + the same prefix as VasEBoot.) + * util/VasEBoot.d/10_kfreebsd.in: Likewise. 2010-01-27 Vladimir Serbinenko - * normal/cmdline.c (grub_cmdline_get): Fix completion in the middle + * normal/cmdline.c (VasEBoot_cmdline_get): Fix completion in the middle of the line. 2010-01-27 Vladimir Serbinenko - * kern/disk.c (grub_disk_read): Fix offset computation when reading + * kern/disk.c (VasEBoot_disk_read): Fix offset computation when reading last sectors. 2010-01-27 Vladimir Serbinenko @@ -31077,32 +31077,32 @@ * commands/hashsum.c (hash_file): Avoid possible stack overflow by having a 4KiB and not 32KiB buffer size. -2010-01-27 Robert Millan +2010-01-27 Robert Millan * util/hostfs.c: Include `'. - (grub_hostfs_read): Handle errors from fseeko() and fread(). + (VasEBoot_hostfs_read): Handle errors from fseeko() and fread(). -2010-01-27 Robert Millan +2010-01-27 Robert Millan - * kern/disk.c (grub_disk_read): Fix bug that would cause infinite + * kern/disk.c (VasEBoot_disk_read): Fix bug that would cause infinite loop when using read hooks on files whose size isn't sector-aligned. -2010-01-27 Robert Millan +2010-01-27 Robert Millan Remove unused parameter. - * fs/iso9660.c (struct grub_iso9660_data): Remove `length' parameter. - (grub_iso9660_open): Remove initialization of `data->length'. + * fs/iso9660.c (struct VasEBoot_iso9660_data): Remove `length' parameter. + (VasEBoot_iso9660_open): Remove initialization of `data->length'. -2010-01-27 Robert Millan +2010-01-27 Robert Millan - * util/grub-fstest.c (fstest): Rewrite allocation, fixing a few + * util/VasEBoot-fstest.c (fstest): Rewrite allocation, fixing a few memleak conditions. 2010-01-27 Carles Pina i Estany * util/lvm.c: New macro LVM_DEV_MAPPER_STRING. - (grub_util_lvm_isvolume): Use LVM_DEV_MAPPER_STRING. + (VasEBoot_util_lvm_isvolume): Use LVM_DEV_MAPPER_STRING. 2010-01-26 Carles Pina i Estany @@ -31110,26 +31110,26 @@ 2010-01-26 Carles Pina i Estany - * font/font.c: Include `grub/fontformat.h. + * font/font.c: Include `VasEBoot/fontformat.h. Remove font file format constants. - (grub_font_load): Use the new macros. - * include/grub/fontformat.h: New file. - * util/grub-mkfont.c: Include `grub/fontformat.c'. + (VasEBoot_font_load): Use the new macros. + * include/VasEBoot/fontformat.h: New file. + * util/VasEBoot-mkfont.c: Include `VasEBoot/fontformat.c'. (write_font_pf2): Use the new macros. -2010-01-26 Robert Millan +2010-01-26 Robert Millan - * util/bin2h.c (usage): Make --help actually explain what `grub-bin2h' + * util/bin2h.c (usage): Make --help actually explain what `VasEBoot-bin2h' does. -2010-01-26 Robert Millan +2010-01-26 Robert Millan - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_PXE_DL): New macro. + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_PXE_DL): New macro. - * boot/i386/pc/pxeboot.S: Include `'. + * boot/i386/pc/pxeboot.S: Include `'. (_start): Macroify `0x7F'. - * kern/i386/pc/init.c: Include `'. + * kern/i386/pc/init.c: Include `'. (make_install_device): Use "(pxe)" as fallback prefix when booting via PXE. @@ -31147,14 +31147,14 @@ * configure.ac: Check for `limits.h'. * util/misc.c: Include `' (for PATH_MAX). -2010-01-24 Robert Millan +2010-01-24 Robert Millan - * loader/mips/linux.c (grub_cmd_linux, grub_cmd_initrd): Don't + * loader/mips/linux.c (VasEBoot_cmd_linux, VasEBoot_cmd_initrd): Don't capitalize error strings. 2010-01-24 Samuel Thibault - * util/grub.d/10_hurd.in: Add a recovery mode. + * util/VasEBoot.d/10_hurd.in: Add a recovery mode. 2010-01-23 Vladimir Serbinenko @@ -31166,46 +31166,46 @@ 2010-01-22 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_setcolorstate): Allocate on + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_setcolorstate): Allocate on stack since heap may be unavailable at that point. - (grub_ofconsole_gotoxy): Likewise. + (VasEBoot_ofconsole_gotoxy): Likewise. 2010-01-22 Vladimir Serbinenko * configure.ac: Check for _restgpr_14_x. - * include/grub/powerpc/libgcc.h [HAVE__RESTGPR_14_X]: Add _restgpr_*_x + * include/VasEBoot/powerpc/libgcc.h [HAVE__RESTGPR_14_X]: Add _restgpr_*_x and _savegpr_* prototypes. -2010-01-22 Robert Millan +2010-01-22 Robert Millan - Use generic grub_reboot() for i386-efi. + Use generic VasEBoot_reboot() for i386-efi. - * kern/efi/efi.c [__i386__] (grub_reboot): Remove. + * kern/efi/efi.c [__i386__] (VasEBoot_reboot): Remove. * kern/i386/efi/startup.S: Include `"../realmode.S"'. - * kern/i386/realmode.S: Include `'. + * kern/i386/realmode.S: Include `'. 2010-01-22 Vladimir Serbinenko - * kern/ieee1275/init.c (grub_machine_set_prefix): Don't check for + * kern/ieee1275/init.c (VasEBoot_machine_set_prefix): Don't check for presence of "prefix" variable as it breaks when normal.mod is embedded. 2010-01-21 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_dimensions): Allocate on + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_dimensions): Allocate on stack since heap is unavailable at that point. 2010-01-21 Vladimir Serbinenko - * include/grub/i386/bsd.h (FREEBSD_N_BIOS_GEOM): Removed. - (grub_freebsd_bootinfo): Rewritten. - * loader/i386/bsd.c (grub_freebsd_boot): Use new grub_freebsd_bootinfo. + * include/VasEBoot/i386/bsd.h (FREEBSD_N_BIOS_GEOM): Removed. + (VasEBoot_freebsd_bootinfo): Rewritten. + * loader/i386/bsd.c (VasEBoot_freebsd_boot): Use new VasEBoot_freebsd_bootinfo. 2010-01-21 Vladimir Serbinenko * util/misc.c (make_system_path_relative_to_its_root): Fix typo. -2010-01-21 Robert Millan +2010-01-21 Robert Millan * po/POTFILES: Remove mkisofs-related files. They have their own TLP domain now. @@ -31224,21 +31224,21 @@ Optimise glyph lookup by Basic Multilingual Plane lookup array. - * font/font.c (struct grub_font): New member 'bmp_idx'. + * font/font.c (struct VasEBoot_font): New member 'bmp_idx'. (font_init): Initialise 'bmp_idx'. (load_font_index): Fill 'bmp_idx'. (find_glyph): Make inline. Use bmp_idx for BMP characters. 2010-01-20 Vladimir Serbinenko - * video/fb/video_fb.c (grub_video_fb_scroll): Optimise by avoiding + * video/fb/video_fb.c (VasEBoot_video_fb_scroll): Optimise by avoiding unnecessary calls. 2010-01-20 Vladimir Serbinenko Move context handling out of the kernel. - * conf/any-emu.rmk (grub_emu_SOURCES): Add normal/context.c. + * conf/any-emu.rmk (VasEBoot_emu_SOURCES): Add normal/context.c. * conf/common.rmk (normal_mod_SOURCES): Add normal/context.c. * conf/i386-coreboot.rmk (kernel_img_HEADERS): Add env_private.h. * conf/i386-efi.rmk: Likewise. @@ -31247,48 +31247,48 @@ * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. - * include/grub/env.h: Include grub/menu.h. - (grub_env_var_type): Removed. - (grub_env_var): Replaced field 'type' with 'global'. - (grub_env_find): New prototype. - (grub_env_context_open): Remove EXPORT_FUNC. - (grub_env_context_close): Likewise. - (grub_env_export): Likewise. - (grub_env_set_data_slot): Removed. - (grub_env_get_data_slot): Likewise. - (grub_env_unset_data_slot): Likewise. - (grub_env_unset_menu): New prototype. - (grub_env_set_menu): Likewise. - (grub_env_get_menu): Likewise. - * include/grub/env_private.h: New file. - * include/grub/normal.h (grub_context_init): New prototype. - (grub_context_fini): Likewise. - * kern/corecmd.c (grub_core_cmd_export): Moved from here ... - * normal/context.c (grub_cmd_export): ... to here. + * include/VasEBoot/env.h: Include VasEBoot/menu.h. + (VasEBoot_env_var_type): Removed. + (VasEBoot_env_var): Replaced field 'type' with 'global'. + (VasEBoot_env_find): New prototype. + (VasEBoot_env_context_open): Remove EXPORT_FUNC. + (VasEBoot_env_context_close): Likewise. + (VasEBoot_env_export): Likewise. + (VasEBoot_env_set_data_slot): Removed. + (VasEBoot_env_get_data_slot): Likewise. + (VasEBoot_env_unset_data_slot): Likewise. + (VasEBoot_env_unset_menu): New prototype. + (VasEBoot_env_set_menu): Likewise. + (VasEBoot_env_get_menu): Likewise. + * include/VasEBoot/env_private.h: New file. + * include/VasEBoot/normal.h (VasEBoot_context_init): New prototype. + (VasEBoot_context_fini): Likewise. + * kern/corecmd.c (VasEBoot_core_cmd_export): Moved from here ... + * normal/context.c (VasEBoot_cmd_export): ... to here. * kern/env.c: Include env_private.h. - (HASHSZ): Moved to include/grub/env_private.h. - (grub_env_context): Likewise. - (grub_env_sorted_var): Likewise. + (HASHSZ): Moved to include/VasEBoot/env_private.h. + (VasEBoot_env_context): Likewise. + (VasEBoot_env_sorted_var): Likewise. (current_context): Renamed from this ... - (grub_current_context): ...to this. 'static' removed. All users updated. - (grub_env_find): Removed 'static'. - (grub_env_context_open): Moved to normal/context.c. - (grub_env_context_close): Likewise. - (grub_env_export): Likewise. + (VasEBoot_current_context): ...to this. 'static' removed. All users updated. + (VasEBoot_env_find): Removed 'static'. + (VasEBoot_env_context_open): Moved to normal/context.c. + (VasEBoot_env_context_close): Likewise. + (VasEBoot_env_export): Likewise. (mangle_data_slot_name): Removed. - (grub_env_set_data_slot): Likewise. - (grub_env_get_data_slot): Likewise. - (grub_env_unset_data_slot): Likewise. - * kern/main.c (grub_set_root_dev): Don't export root. + (VasEBoot_env_set_data_slot): Likewise. + (VasEBoot_env_get_data_slot): Likewise. + (VasEBoot_env_unset_data_slot): Likewise. + * kern/main.c (VasEBoot_set_root_dev): Don't export root. It will be done later. - (grub_main): Don't export prefix. + (VasEBoot_main): Don't export prefix. It will be done later. * normal/context.c: New file. - * normal/main.c (free_menu): Use grub_env_unset_menu. - (grub_normal_add_menu_entry): Use grub_env_get_menu. - (read_config_file): Use grub_env_get_menu and grub_env_set_menu. - (GRUB_MOD_INIT(normal)): Call grub_context_init. - (GRUB_MOD_FINI(normal)): Call grub_context_fini. + * normal/main.c (free_menu): Use VasEBoot_env_unset_menu. + (VasEBoot_normal_add_menu_entry): Use VasEBoot_env_get_menu. + (read_config_file): Use VasEBoot_env_get_menu and VasEBoot_env_set_menu. + (VasEBoot_MOD_INIT(normal)): Call VasEBoot_context_init. + (VasEBoot_MOD_FINI(normal)): Call VasEBoot_context_fini. 2010-01-20 Vladimir Serbinenko @@ -31304,73 +31304,73 @@ Byte-addressable PCI configuration space. - * bus/pci.c (grub_pci_make_address): Use byte address instead of + * bus/pci.c (VasEBoot_pci_make_address): Use byte address instead of dword address. - (grub_pci_iterate): Use macroses GRUB_PCI_REG_PCI_ID and - GRUB_PCI_REG_CACHELINE. - * bus/usb/ohci.c (grub_ohci_pci_iter): Use macroses - GRUB_PCI_REG_CLASS and GRUB_PCI_REG_ADDRESS_REG0. - * bus/usb/uhci.c (grub_ohci_pci_iter): Use macroses - GRUB_PCI_REG_CLASS and GRUB_PCI_REG_ADDRESS_REG4. - * commands/efi/fixvideo.c (scan_card): Use macros GRUB_PCI_REG_CLASS. + (VasEBoot_pci_iterate): Use macroses VasEBoot_PCI_REG_PCI_ID and + VasEBoot_PCI_REG_CACHELINE. + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Use macroses + VasEBoot_PCI_REG_CLASS and VasEBoot_PCI_REG_ADDRESS_REG0. + * bus/usb/uhci.c (VasEBoot_ohci_pci_iter): Use macroses + VasEBoot_PCI_REG_CLASS and VasEBoot_PCI_REG_ADDRESS_REG4. + * commands/efi/fixvideo.c (scan_card): Use macros VasEBoot_PCI_REG_CLASS. * commands/efi/loadbios.c (enable_rom_area): Pass byte-address to - grub_pci_make_address. + VasEBoot_pci_make_address. (lock_rom_area): Likewise. - * commands/lspci.c (grub_lspci_iter): Use macroses - GRUB_PCI_REG_CLASS and GRUB_PCI_REG_ADDRESSES. Handle byte-addressing - of grub_pci_make_address. - * disk/ata.c (grub_ata_pciinit): Likewise. - * include/grub/pci.h (GRUB_PCI_REG_PCI_ID): New macro. - (GRUB_PCI_REG_VENDOR): Likewise. - (GRUB_PCI_REG_DEVICE): Likewise. - (GRUB_PCI_REG_COMMAND): Likewise. - (GRUB_PCI_REG_STATUS): Likewise. - (GRUB_PCI_REG_REVISION): Likewise. - (GRUB_PCI_REG_CLASS): Likewise. - (GRUB_PCI_REG_CACHELINE): Likewise. - (GRUB_PCI_REG_LAT_TIMER): Likewise. - (GRUB_PCI_REG_HEADER_TYPE): Likewise. - (GRUB_PCI_REG_BIST): Likewise. - (GRUB_PCI_REG_ADDRESSES): Likewise. - (GRUB_PCI_REG_ADDRESS_REG): Likewise. - (GRUB_PCI_REG_ADDRESS_REG): Likewise. - (GRUB_PCI_REG_ADDRESS_REG): Likewise. - (GRUB_PCI_REG_ADDRESS_REG): Likewise. - (GRUB_PCI_REG_ADDRESS_REG): Likewise. - (GRUB_PCI_REG_ADDRESS_REG): Likewise. - (GRUB_PCI_REG_CIS_POINTER): Likewise. - (GRUB_PCI_REG_SUBVENDOR): Likewise. - (GRUB_PCI_REG_SUBSYSTEM): Likewise. - (GRUB_PCI_REG_ROM_ADDRESS): Likewise. - (GRUB_PCI_REG_CAP_POINTER): Likewise. - (GRUB_PCI_REG_IRQ_LINE): Likewise. - (GRUB_PCI_REG_IRQ_PIN): Likewise. - (GRUB_PCI_REG_MIN_GNT): Likewise. - (GRUB_PCI_REG_MAX_LAT): Likewise. - * loader/i386/efi/linux.c (find_framebuf): Use GRUB_PCI_REG_CLASS. + * commands/lspci.c (VasEBoot_lspci_iter): Use macroses + VasEBoot_PCI_REG_CLASS and VasEBoot_PCI_REG_ADDRESSES. Handle byte-addressing + of VasEBoot_pci_make_address. + * disk/ata.c (VasEBoot_ata_pciinit): Likewise. + * include/VasEBoot/pci.h (VasEBoot_PCI_REG_PCI_ID): New macro. + (VasEBoot_PCI_REG_VENDOR): Likewise. + (VasEBoot_PCI_REG_DEVICE): Likewise. + (VasEBoot_PCI_REG_COMMAND): Likewise. + (VasEBoot_PCI_REG_STATUS): Likewise. + (VasEBoot_PCI_REG_REVISION): Likewise. + (VasEBoot_PCI_REG_CLASS): Likewise. + (VasEBoot_PCI_REG_CACHELINE): Likewise. + (VasEBoot_PCI_REG_LAT_TIMER): Likewise. + (VasEBoot_PCI_REG_HEADER_TYPE): Likewise. + (VasEBoot_PCI_REG_BIST): Likewise. + (VasEBoot_PCI_REG_ADDRESSES): Likewise. + (VasEBoot_PCI_REG_ADDRESS_REG): Likewise. + (VasEBoot_PCI_REG_ADDRESS_REG): Likewise. + (VasEBoot_PCI_REG_ADDRESS_REG): Likewise. + (VasEBoot_PCI_REG_ADDRESS_REG): Likewise. + (VasEBoot_PCI_REG_ADDRESS_REG): Likewise. + (VasEBoot_PCI_REG_ADDRESS_REG): Likewise. + (VasEBoot_PCI_REG_CIS_POINTER): Likewise. + (VasEBoot_PCI_REG_SUBVENDOR): Likewise. + (VasEBoot_PCI_REG_SUBSYSTEM): Likewise. + (VasEBoot_PCI_REG_ROM_ADDRESS): Likewise. + (VasEBoot_PCI_REG_CAP_POINTER): Likewise. + (VasEBoot_PCI_REG_IRQ_LINE): Likewise. + (VasEBoot_PCI_REG_IRQ_PIN): Likewise. + (VasEBoot_PCI_REG_MIN_GNT): Likewise. + (VasEBoot_PCI_REG_MAX_LAT): Likewise. + * loader/i386/efi/linux.c (find_framebuf): Use VasEBoot_PCI_REG_CLASS. * loader/i386/efi/xnu.c (find_framebuf): Likewise. * video/efi_uga.c (find_framebuf): Likewise. - * video/sm712.c (grub_video_sm712_setup): Likewise. - * util/pci.c (grub_pci_make_address): Use byte-addressed configuration + * video/sm712.c (VasEBoot_video_sm712_setup): Likewise. + * util/pci.c (VasEBoot_pci_make_address): Use byte-addressed configuration space. -2010-01-20 Robert Millan +2010-01-20 Robert Millan - * util/grub.d/10_linux.in (linux_entry): Set gfxpayload=keep when it + * util/VasEBoot.d/10_linux.in (linux_entry): Set gfxpayload=keep when it can be reliably determined to be supported. -2010-01-20 Robert Millan +2010-01-20 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): If `vga=' was used, write down + * loader/i386/linux.c (VasEBoot_cmd_linux): If `vga=' was used, write down that VESA is supported. - (grub_linux_boot): Use generic framebuffer unless VESA is known to be + (VasEBoot_linux_boot): Use generic framebuffer unless VESA is known to be supported. 2010-01-20 Vladimir Serbinenko * conf/common.rmk (font/font.c_DEPENDENCIES): Condition on FONT_SOURCE. -2010-01-20 Robert Millan +2010-01-20 Robert Millan * util/misc.c (make_system_path_relative_to_its_root): Work around special-casing of "/", as previous incarnation of this routine did. @@ -31379,16 +31379,16 @@ Fix any-emu compilation. - * conf/any-emu.rmk (bin_UTILITIES): Add grub-bin2h. - * grub_bin2h_SOURCES: New variable. + * conf/any-emu.rmk (bin_UTILITIES): Add VasEBoot-bin2h. + * VasEBoot_bin2h_SOURCES: New variable. -2010-01-20 Robert Millan +2010-01-20 Robert Millan - * util/grub.d/00_header.in: Fix stupid mistake from last commit. + * util/VasEBoot.d/00_header.in: Fix stupid mistake from last commit. -2010-01-20 Robert Millan +2010-01-20 Robert Millan - * util/grub.d/00_header.in: Fix handling of locale_dir. + * util/VasEBoot.d/00_header.in: Fix handling of locale_dir. 2010-01-20 Vladimir Serbinenko @@ -31409,30 +31409,30 @@ 2010-01-20 Vladimir Serbinenko - * include/grub/misc.h (grub_sprintf): Removed. All users switched to - grub_xasprintf or grub_snprintf. - (grub_vsprintf): Likewise. - (grub_snprintf): New proto. - (grub_vsnprintf): Likewise. - (grub_xasprintf): Likewise. - (grub_xvasprintf): Likewise. - * kern/misc.c (grub_vprintf): Use grub_vsnprintf_real. - (grub_sprintf): Removed. - (grub_vsnprintf): New function. - (grub_snprintf): Likewise. - (grub_xvasprintf): Likewise. - (grub_xasprintf): Likewise. - (grub_vsprintf): Renamed to ... - (grub_vsnprintf_real): ...this. New argument max_len. + * include/VasEBoot/misc.h (VasEBoot_sprintf): Removed. All users switched to + VasEBoot_xasprintf or VasEBoot_snprintf. + (VasEBoot_vsprintf): Likewise. + (VasEBoot_snprintf): New proto. + (VasEBoot_vsnprintf): Likewise. + (VasEBoot_xasprintf): Likewise. + (VasEBoot_xvasprintf): Likewise. + * kern/misc.c (VasEBoot_vprintf): Use VasEBoot_vsnprintf_real. + (VasEBoot_sprintf): Removed. + (VasEBoot_vsnprintf): New function. + (VasEBoot_snprintf): Likewise. + (VasEBoot_xvasprintf): Likewise. + (VasEBoot_xasprintf): Likewise. + (VasEBoot_vsprintf): Renamed to ... + (VasEBoot_vsnprintf_real): ...this. New argument max_len. 2010-01-20 BVK Chaitanya - * include/grub/script_sh.h (sourcecode): Remove const qualifier to - fix grub-script-check warning. + * include/VasEBoot/script_sh.h (sourcecode): Remove const qualifier to + fix VasEBoot-script-check warning. 2010-01-20 Vladimir Serbinenko - * include/grub/font.h (grub_font_load): Fix prototype. + * include/VasEBoot/font.h (VasEBoot_font_load): Fix prototype. 2010-01-20 Vladimir Serbinenko @@ -31440,47 +31440,47 @@ 2010-01-20 Vladimir Serbinenko - * include/grub/x86_64/at_keyboard.h: New file. + * include/VasEBoot/x86_64/at_keyboard.h: New file. 2010-01-20 Vladimir Serbinenko - * loader/mips/linux.c: Include missing grub/i18n.h. + * loader/mips/linux.c: Include missing VasEBoot/i18n.h. -2009-12-20 Robert Millan +2009-12-20 Robert Millan * normal/menu.c (notify_execution_failure): Clarify error message. -2009-12-20 Robert Millan +2009-12-20 Robert Millan - * commands/loadenv.c (check_blocklists): Use `grub_err_t' as + * commands/loadenv.c (check_blocklists): Use `VasEBoot_err_t' as return value (and revert all return statements). Update users. 2010-01-20 Dan Merillat - * kern/device.c (grub_device_iterate): Allocate new part_ent + * kern/device.c (VasEBoot_device_iterate): Allocate new part_ent structure based on sizeof (*p) rather than sizeof (p->next), to account for structure padding. - * util/grub-probe.c (probe_raid_level): Return -1 immediately if + * util/VasEBoot-probe.c (probe_raid_level): Return -1 immediately if disk is NULL, which might happen for LVM physical volumes with no LVM signature. -2009-12-20 Robert Millan +2009-12-20 Robert Millan - * loader/mips/linux.c (grub_cmd_initrd) - (GRUB_MOD_INIT(linux)): Adjust and gettextize a few strings. + * loader/mips/linux.c (VasEBoot_cmd_initrd) + (VasEBoot_MOD_INIT(linux)): Adjust and gettextize a few strings. -2009-12-20 Robert Millan +2009-12-20 Robert Millan - * kern/mips/yeeloong/init.c (grub_video_sm712_init) - (grub_video_video_init, grub_video_bitmap_init) - (grub_font_manager_init, grub_term_gfxterm_init) - (grub_at_keyboard_init): New extern declarations. - (grub_machine_init): Initialize gfxterm and at_keyboard. + * kern/mips/yeeloong/init.c (VasEBoot_video_sm712_init) + (VasEBoot_video_video_init, VasEBoot_video_bitmap_init) + (VasEBoot_font_manager_init, VasEBoot_term_gfxterm_init) + (VasEBoot_at_keyboard_init): New extern declarations. + (VasEBoot_machine_init): Initialize gfxterm and at_keyboard. - * kern/main.c (grub_main): Revert grub_printf delay kludge. + * kern/main.c (VasEBoot_main): Revert VasEBoot_printf delay kludge. - * util/grub-install.in: Revert embed of `at_keyboard.mod' and + * util/VasEBoot-install.in: Revert embed of `at_keyboard.mod' and `gfxterm.mod' into core image. * conf/mips.rmk (pkglib_IMAGES, kernel_img_SOURCES) @@ -31509,9 +31509,9 @@ * po/POTFILES: Replace `term/i386/pc/serial.c' with `term/serial.c'. -2009-12-10 Robert Millan +2009-12-10 Robert Millan - * include/grub/mips/libgcc.h: Only export symbols for functions + * include/VasEBoot/mips/libgcc.h: Only export symbols for functions that libgcc provides. 2009-12-02 Vladimir Serbinenko @@ -31519,12 +31519,12 @@ MIPS support. * bus/bonito.c: New file. - * bus/pci.c (grub_pci_iterate): Use GRUB_PCI_NUM_BUS and - GRUB_PCI_NUM_DEVICES. + * bus/pci.c (VasEBoot_pci_iterate): Use VasEBoot_PCI_NUM_BUS and + VasEBoot_PCI_NUM_DEVICES. * term/i386/pc/serial.c: Move to ... * term/serial.c: ... here. All users updated. - * util/i386/pc/grub-mkimage.c: Move to ... - * util/grub-mkrawimage.c: ... here. All users updated. + * util/i386/pc/VasEBoot-mkimage.c: Move to ... + * util/VasEBoot-mkrawimage.c: ... here. All users updated. * term/i386/pc/at_keyboard.c: Move to ... * term/at_keyboard.c: ... here. All users updated. * conf/mips-qemu-mips.rmk: New file. @@ -31532,71 +31532,71 @@ * conf/mips.rmk: Likewise. * configure.ac: New platforms mipsel-yeeloong, mips-qemu-mips and mipsel-qemu-mips. - * disk/ata.c (grub_ata_device_initialize): Add GRUB_MACHINE_PCI_IO_BASE + * disk/ata.c (VasEBoot_ata_device_initialize): Add VasEBoot_MACHINE_PCI_IO_BASE to port addresses. - (grub_ata_pciinit): Support CS5536. - * font/font.c (grub_font_load): Use grub_file_t instead of filename. + (VasEBoot_ata_pciinit): Support CS5536. + * font/font.c (VasEBoot_font_load): Use VasEBoot_file_t instead of filename. * font/font_cmd.c (loadfont_command): Open file before passing it to - grub_font_load. + VasEBoot_font_load. (pseudo_file_read): New function. (pseudo_file_close): Likewise. (pseudo_fs): New structure. (load_font_module): New function. - (GRUB_MOD_INIT(font_manager)): Load embedded font. - * fs/cpio.c (grub_cpio_open): Handle partial matches correctly. + (VasEBoot_MOD_INIT(font_manager)): Load embedded font. + * fs/cpio.c (VasEBoot_cpio_open): Handle partial matches correctly. * genmk.rb: Strip .rel.dyn, .reginfo, .note and .comment. * genmoddep.awk: Ignore __gnu_local_gp. It's defined by linker. - * include/grub/i386/at_keyboard.h: Split into ... - * include/grub/at_keyboard.h: ... this ... - * include/grub/i386/at_keyboard.h: ... and this. - * include/grub/dl.h (grub_arch_dl_init_linker) [_mips && !GRUB_UTIL]: + * include/VasEBoot/i386/at_keyboard.h: Split into ... + * include/VasEBoot/at_keyboard.h: ... this ... + * include/VasEBoot/i386/at_keyboard.h: ... and this. + * include/VasEBoot/dl.h (VasEBoot_arch_dl_init_linker) [_mips && !VasEBoot_UTIL]: New prototype. - * include/grub/elfload.h (grub_elf32_size): New parameter. All users + * include/VasEBoot/elfload.h (VasEBoot_elf32_size): New parameter. All users updated. - (grub_elf64_size): Likewise. - * include/grub/font.h (grub_font_load): Use grub_file_t instead of + (VasEBoot_elf64_size): Likewise. + * include/VasEBoot/font.h (VasEBoot_font_load): Use VasEBoot_file_t instead of filename. - * include/grub/i386/io.h (grub_port_t): New type. All users updated. - * include/grub/i386/coreboot/serial.h: Rewritten. - * include/grub/i386/ieee1275/serial.h: Include - grub/i386/coreboot/serial.h instead of grub/i386/pc/serial.h. - * include/grub/i386/pc/serial.h: Moved from here ... - * include/grub/serial.h: ... to here. All users updated. - * include/grub/i386/pci.h (GRUB_MACHINE_PCI_IO_BASE): New definition. - (GRUB_PCI_NUM_BUS): Likewise. - (GRUB_PCI_NUM_DEVICES): Likewise. - (grub_pci_device_map_range): Add missing volatile keyword. - * include/grub/kernel.h (OBJ_TYPE_FONT): New enum value. - * include/grub/mips/at_keyboard.h: New file. - * include/grub/mips/cache.h: Likewise. - * include/grub/mips/io.h: Likewise. - * include/grub/mips/kernel.h: Likewise. - * include/grub/mips/libgcc.h: Likewise. - * include/grub/mips/pci.h: Likewise. - * include/grub/mips/qemu-mips/boot.h: Likewise. - * include/grub/mips/qemu-mips/kernel.h: Likewise. - * include/grub/mips/qemu-mips/loader.h: Likewise. - * include/grub/mips/qemu-mips/memory.h: Likewise. - * include/grub/mips/qemu-mips/serial.h: Likewise. - * include/grub/mips/qemu-mips/time.h: Likewise. - * include/grub/mips/relocator.h: Likewise. - * include/grub/mips/time.h: Likewise. - * include/grub/mips/types.h: Likewise. - * include/grub/mips/yeeloong/at_keyboard.h: Likewise. - * include/grub/mips/yeeloong/boot.h: Likewise. - * include/grub/mips/yeeloong/kernel.h: Likewise. - * include/grub/mips/yeeloong/loader.h: Likewise. - * include/grub/mips/yeeloong/memory.h: Likewise. - * include/grub/mips/yeeloong/pci.h: Likewise. - * include/grub/mips/yeeloong/serial.h: Likewise. - * include/grub/mips/yeeloong/time.h: Likewise. - * kern/dl.c (grub_dl_resolve_symbols): Handle STT_OBJECT correctly. - * kern/elf.c (grub_elf32_size): New parameter. All users + * include/VasEBoot/i386/io.h (VasEBoot_port_t): New type. All users updated. + * include/VasEBoot/i386/coreboot/serial.h: Rewritten. + * include/VasEBoot/i386/ieee1275/serial.h: Include + VasEBoot/i386/coreboot/serial.h instead of VasEBoot/i386/pc/serial.h. + * include/VasEBoot/i386/pc/serial.h: Moved from here ... + * include/VasEBoot/serial.h: ... to here. All users updated. + * include/VasEBoot/i386/pci.h (VasEBoot_MACHINE_PCI_IO_BASE): New definition. + (VasEBoot_PCI_NUM_BUS): Likewise. + (VasEBoot_PCI_NUM_DEVICES): Likewise. + (VasEBoot_pci_device_map_range): Add missing volatile keyword. + * include/VasEBoot/kernel.h (OBJ_TYPE_FONT): New enum value. + * include/VasEBoot/mips/at_keyboard.h: New file. + * include/VasEBoot/mips/cache.h: Likewise. + * include/VasEBoot/mips/io.h: Likewise. + * include/VasEBoot/mips/kernel.h: Likewise. + * include/VasEBoot/mips/libgcc.h: Likewise. + * include/VasEBoot/mips/pci.h: Likewise. + * include/VasEBoot/mips/qemu-mips/boot.h: Likewise. + * include/VasEBoot/mips/qemu-mips/kernel.h: Likewise. + * include/VasEBoot/mips/qemu-mips/loader.h: Likewise. + * include/VasEBoot/mips/qemu-mips/memory.h: Likewise. + * include/VasEBoot/mips/qemu-mips/serial.h: Likewise. + * include/VasEBoot/mips/qemu-mips/time.h: Likewise. + * include/VasEBoot/mips/relocator.h: Likewise. + * include/VasEBoot/mips/time.h: Likewise. + * include/VasEBoot/mips/types.h: Likewise. + * include/VasEBoot/mips/yeeloong/at_keyboard.h: Likewise. + * include/VasEBoot/mips/yeeloong/boot.h: Likewise. + * include/VasEBoot/mips/yeeloong/kernel.h: Likewise. + * include/VasEBoot/mips/yeeloong/loader.h: Likewise. + * include/VasEBoot/mips/yeeloong/memory.h: Likewise. + * include/VasEBoot/mips/yeeloong/pci.h: Likewise. + * include/VasEBoot/mips/yeeloong/serial.h: Likewise. + * include/VasEBoot/mips/yeeloong/time.h: Likewise. + * kern/dl.c (VasEBoot_dl_resolve_symbols): Handle STT_OBJECT correctly. + * kern/elf.c (VasEBoot_elf32_size): New parameter. All users updated. - (grub_elf64_size): Likewise. - * kern/main.c (grub_main): Call grub_arch_dl_init_linker if necessary. - Load modules before saying "Welcome to GRUB!". - Call grub_refresh after saying "Welcome to GRUB!". + (VasEBoot_elf64_size): Likewise. + * kern/main.c (VasEBoot_main): Call VasEBoot_arch_dl_init_linker if necessary. + Load modules before saying "Welcome to VasEBoot!". + Call VasEBoot_refresh after saying "Welcome to VasEBoot!". * kern/mips/cache.S: New file. * kern/mips/cache_flush.S: Likewise. * kern/mips/dl.c: Likewise. @@ -31604,19 +31604,19 @@ * kern/mips/qemu-mips/init.c: Likewise. * kern/mips/startup.S: Likewise. * kern/mips/yeeloong/init.c: Likewise. - * kern/term.c (grub_putcode): Handle NULL terminal. - (grub_getcharwidth): Likewise. - (grub_getkey): Likewise. - (grub_checkkey): Likewise. - (grub_getkeystatus): Likewise. - (grub_getxy): Likewise. - (grub_getwh): Likewise. - (grub_gotoxy): Likewise. - (grub_cls): Likewise. - (grub_setcolorstate): Likewise. - (grub_setcolor): Likewise. - (grub_getcolor): Likewise. - (grub_refresh): Likewise. + * kern/term.c (VasEBoot_putcode): Handle NULL terminal. + (VasEBoot_getcharwidth): Likewise. + (VasEBoot_getkey): Likewise. + (VasEBoot_checkkey): Likewise. + (VasEBoot_getkeystatus): Likewise. + (VasEBoot_getxy): Likewise. + (VasEBoot_getwh): Likewise. + (VasEBoot_gotoxy): Likewise. + (VasEBoot_cls): Likewise. + (VasEBoot_setcolorstate): Likewise. + (VasEBoot_setcolor): Likewise. + (VasEBoot_getcolor): Likewise. + (VasEBoot_refresh): Likewise. * lib/mips/relocator.c (JUMP_SIZEOF): Fix incorrect value. (write_jump): Add hatch nop. * lib/mips/relocator_asm.S: Use kern/mips/cache_flush.S. @@ -31627,34 +31627,34 @@ * term/i386/pc/serial.c: Moved from here ... * term/serial.c: ... to here. All users updated. (TEXT_HEIGHT): Set to 24 to fit linux terminal. - (serial_hw_io_addr): Use GRUB_MACHINE_SERIAL_PORTS. + (serial_hw_io_addr): Use VasEBoot_MACHINE_SERIAL_PORTS. (serial_translate_key_sequence): Avoid deadlock. - (grub_serial_getkey): Handle backspace. - (grub_serial_putchar): Fix newline handling. - * util/i386/pc/grub-mkimage.c: Move from here ... - * util/grub-mkrawimage.c: ... to here. All users updated. + (VasEBoot_serial_getkey): Handle backspace. + (VasEBoot_serial_putchar): Fix newline handling. + * util/i386/pc/VasEBoot-mkimage.c: Move from here ... + * util/VasEBoot-mkrawimage.c: ... to here. All users updated. (generate_image): New parameters 'font_path' and 'format'. Support embedding font. - Use grub_host_to_target* instead of grub_cpu_to_le*. - (generate_image) [GRUB_MACHINE_MIPS]: Support ELF encapsulation. - (options) [GRUB_PLATFORM_IMAGE_DEFAULT]: New option "--format". + Use VasEBoot_host_to_target* instead of VasEBoot_cpu_to_le*. + (generate_image) [VasEBoot_MACHINE_MIPS]: Support ELF encapsulation. + (options) [VasEBoot_PLATFORM_IMAGE_DEFAULT]: New option "--format". (options): New option "--font". (usage): Likewise. - (main) [GRUB_PLATFORM_IMAGE_DEFAULT]: Handle "--format". + (main) [VasEBoot_PLATFORM_IMAGE_DEFAULT]: Handle "--format". (main): Handle "--font". - * term/gfxterm.c (grub_virtual_screen): New member bg_color_display. - (grub_virtual_screen_setup): Set bg_color_display. + * term/gfxterm.c (VasEBoot_virtual_screen): New member bg_color_display. + (VasEBoot_virtual_screen_setup): Set bg_color_display. (redraw_screen_rect): Use bg_color_display instead of incorrect bg_color. - (grub_gfxterm_cls): Likewise. - * util/elf/grub-mkimage.c (load_modules): New parameter 'config_path'. + (VasEBoot_gfxterm_cls): Likewise. + * util/elf/VasEBoot-mkimage.c (load_modules): New parameter 'config_path'. Support embedding config file. (add_segments): Likewise. (options): New option "--config". (main): Handle "--config". * video/sm712.c: New file. -2010-01-18 Robert Millan +2010-01-18 Robert Millan Fix parallel builds. @@ -31669,13 +31669,13 @@ * font/font.c (GENERATE_ASCII): Change the name to USE_ASCII_FAILBACK. By default: disabled. - * Makefile.in (ascii.h): Remove the non-needed grub/bin2h size + * Makefile.in (ascii.h): Remove the non-needed VasEBoot/bin2h size parameter. 2010-01-10 Carles Pina i Estany * font/font.c: Update copyright years. - * util/grub-mkfont.c (write_font_ascii_bitmap): Change comment format. + * util/VasEBoot-mkfont.c (write_font_ascii_bitmap): Change comment format. 2010-01-10 Carles Pina i Estany @@ -31683,11 +31683,11 @@ (ASCII_BITMAP_SIZE): New macro. (ascii_font_glyph): Define. (ascii_glyph_lookup): New function. - (grub_font_get_string_width): Change comment. If glyph not found, use + (VasEBoot_font_get_string_width): Change comment. If glyph not found, use ascii_glyph_lookup. - (grub_font_get_glyph_with_fallback): If glyph not available returns + (VasEBoot_font_get_glyph_with_fallback): If glyph not available returns ascii_glyph_lookup. - * util/grub-mkfont.c (file_formats): New enum. + * util/VasEBoot-mkfont.c (file_formats): New enum. (options): Add `ascii-bitmaps' new option. (usage): Add `asii-bitmaps' new option. (write_font_ascii_bitmap): New function. @@ -31697,87 +31697,87 @@ used. Call print_glyphs. * Makefile.in (pkgdata_DATA): Add `ascii.h'. -2010-01-14 Robert Millan +2010-01-14 Robert Millan - * conf/common.rmk (bin_UTILITIES): Add `grub-bin2h'. - (grub_bin2h_SOURCES): New variable. + * conf/common.rmk (bin_UTILITIES): Add `VasEBoot-bin2h'. + (VasEBoot_bin2h_SOURCES): New variable. * util/bin2h.c: New file. 2010-01-20 Vladimir Serbinenko * include/multiboot.h: Resynced with spec. * include/multiboot2.h: Likewise. - * loader/i386/multiboot_mbi.c (grub_fill_multiboot_mmap): Handle - GRUB_MACHINE_MEMORY_ACPI_RECLAIMABLE and GRUB_MACHINE_MEMORY_NVS. + * loader/i386/multiboot_mbi.c (VasEBoot_fill_multiboot_mmap): Handle + VasEBoot_MACHINE_MEMORY_ACPI_RECLAIMABLE and VasEBoot_MACHINE_MEMORY_NVS. -2010-01-18 Robert Millan +2010-01-18 Robert Millan - * include/grub/term.h (grub_term_register_input, - grub_term_register_output): Check return of terminal init() + * include/VasEBoot/term.h (VasEBoot_term_register_input, + VasEBoot_term_register_output): Check return of terminal init() routines, and abort if errors are raised. * commands/terminal.c: Update copyright year. -2010-01-18 Robert Millan +2010-01-18 Robert Millan - * commands/terminal.c (grub_cmd_terminal_input) - (grub_cmd_terminal_output): Check return of terminal init() + * commands/terminal.c (VasEBoot_cmd_terminal_input) + (VasEBoot_cmd_terminal_output): Check return of terminal init() routines, and abort if errors are raised. 2010-01-18 Vladimir Serbinenko - * include/grub/i386/bsd.h: Fix include pathes. + * include/VasEBoot/i386/bsd.h: Fix include pathes. 2010-01-18 Vladimir Serbinenko Add missing *BSD copyright headers. - * include/grub/aout.h: Add BSD licence. - * include/grub/i386/bsd.h: Parts under different licences moved to ... - * include/grub/i386/freebsd_linker.h: ... here, - * include/grub/i386/freebsd_reboot.h: ... here, - * include/grub/i386/netbsd_bootinfo.h: ... here, - * include/grub/i386/netbsd_reboot.h: ... here, - * include/grub/i386/openbsd_bootarg.h: ... here, - * include/grub/i386/openbsd_reboot.h: ... and here. Added appropriate + * include/VasEBoot/aout.h: Add BSD licence. + * include/VasEBoot/i386/bsd.h: Parts under different licences moved to ... + * include/VasEBoot/i386/freebsd_linker.h: ... here, + * include/VasEBoot/i386/freebsd_reboot.h: ... here, + * include/VasEBoot/i386/netbsd_bootinfo.h: ... here, + * include/VasEBoot/i386/netbsd_reboot.h: ... here, + * include/VasEBoot/i386/openbsd_bootarg.h: ... here, + * include/VasEBoot/i386/openbsd_reboot.h: ... and here. Added appropriate licence to each file. -2010-01-18 Robert Millan +2010-01-18 Robert Millan * acinclude.m4: Remove `nop' assembly instruction; it's not implemented by all architectures. -2010-01-18 Robert Millan +2010-01-18 Robert Millan - * loader/i386/efi/linux.c (grub_cmd_linux): Stop pretending we're + * loader/i386/efi/linux.c (VasEBoot_cmd_linux): Stop pretending we're ELILO. This is no longer necessary. 2010-01-18 BVK Chaitanya - Added new tool, grub-scrit-check to verify grub.cfg syntax. + Added new tool, VasEBoot-scrit-check to verify VasEBoot.cfg syntax. - * util/grub-script-check.c: grub-script-check tool. - * conf/common.rmk: Make rules for grub-script-check. + * util/VasEBoot-script-check.c: VasEBoot-script-check tool. + * conf/common.rmk: Make rules for VasEBoot-script-check. -2010-01-18 Robert Millan +2010-01-18 Robert Millan Fix annoying UI bug in rescue mode. Thanks to Tristan Gingold for spotting it back in 2008. Shame on me for forgetting he did. - * kern/rescue_reader.c (grub_rescue_run): Skip zero-length lines. + * kern/rescue_reader.c (VasEBoot_rescue_run): Skip zero-length lines. -2010-01-18 Robert Millan +2010-01-18 Robert Millan - * include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): Rename to ... - (GRUB_VIDEO_LINUX_TYPE_TEXT): ... this. Update all users. - (GRUB_VIDEO_TYPE_VLFB): Rename to ... - (GRUB_VIDEO_LINUX_TYPE_VESA): ... this. Update all users. - (GRUB_VIDEO_TYPE_EFI): Rename to ... - (GRUB_VIDEO_LINUX_TYPE_SIMPLE): ... this. Update all users. + * include/VasEBoot/i386/linux.h (VasEBoot_VIDEO_TYPE_TEXT): Rename to ... + (VasEBoot_VIDEO_LINUX_TYPE_TEXT): ... this. Update all users. + (VasEBoot_VIDEO_TYPE_VLFB): Rename to ... + (VasEBoot_VIDEO_LINUX_TYPE_VESA): ... this. Update all users. + (VasEBoot_VIDEO_TYPE_EFI): Rename to ... + (VasEBoot_VIDEO_LINUX_TYPE_SIMPLE): ... this. Update all users. -2010-01-17 Robert Millan +2010-01-17 Robert Millan - * include/grub/test.h: Add license header. + * include/VasEBoot/test.h: Add license header. * tests/example_functional_test.c: Likewise. * tests/example_unit_test.c: Likewise. * tests/lib/functional_test.c: Likewise. @@ -31789,15 +31789,15 @@ Use flag-based instead of hook-based video mode selection and "auto" keyword. - * include/grub/video.h (grub_video_adapter): Changed 'setup' member. - (grub_video_set_mode): Changed prototype. All users updated. - (grub_video_check_mode_flag): New inline function. + * include/VasEBoot/video.h (VasEBoot_video_adapter): Changed 'setup' member. + (VasEBoot_video_set_mode): Changed prototype. All users updated. + (VasEBoot_video_check_mode_flag): New inline function. * video/video.c (parse_modespec): New function. - (grub_video_set_mode): Parse flags and keywords. + (VasEBoot_video_set_mode): Parse flags and keywords. 2010-01-17 Carles Pina i Estany - * util/misc.c (grub_util_info): Fix the order of the parameters in a + * util/misc.c (VasEBoot_util_info): Fix the order of the parameters in a fprintf call. 2010-01-16 Grégoire Sutre @@ -31806,44 +31806,44 @@ 2010-01-16 Carles Pina i Estany - * util/grub-editenv.c (usage): Use `program_name' instead of hardcoded + * util/VasEBoot-editenv.c (usage): Use `program_name' instead of hardcoded string. - * util/grub-emu.c (usage): Likewise. - * util/grub-mkpasswd-pbkdf2.c (usage): Likewise. - * util/i386/efi/grub-mkimage.c (usage): Likewise. - * util/i386/pc/grub-mkimage.c (usage): Likewise. - * util/i386/pc/grub-setup.c (usage): Likewise. + * util/VasEBoot-emu.c (usage): Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c (usage): Likewise. + * util/i386/efi/VasEBoot-mkimage.c (usage): Likewise. + * util/i386/pc/VasEBoot-mkimage.c (usage): Likewise. + * util/i386/pc/VasEBoot-setup.c (usage): Likewise. 2010-01-16 Carles Pina i Estany - * util/misc.c (grub_util_warn): Gettextizze, print full stop after + * util/misc.c (VasEBoot_util_warn): Gettextizze, print full stop after the message. - (grub_util_info): Likewise. - (grub_util_error): Likewise. - * util/elf/grub-mkimage.c: Fix capitalisation, quotes, full stops - and/or new lines in `grub_util_warna', `grub_util_info', - `grub_util_error' calls. + (VasEBoot_util_info): Likewise. + (VasEBoot_util_error): Likewise. + * util/elf/VasEBoot-mkimage.c: Fix capitalisation, quotes, full stops + and/or new lines in `VasEBoot_util_warna', `VasEBoot_util_info', + `VasEBoot_util_error' calls. * util/getroot.c: Likewise. - * util/grub-editenv.c: Likewise. - * util/grub-emu.c: Likewise. - * util/grub-fstest.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. - * util/grub-mkfont.c: Likewise. - * util/grub-mkpasswd-pbkdf2.c: Likewise. - * util/grub-mkrelpath.c: Likewise. - * util/grub-pe2elf.c: Likewise. - * util/grub-probe.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. + * util/VasEBoot-emu.c: Likewise. + * util/VasEBoot-fstest.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/VasEBoot-mkfont.c: Likewise. + * util/VasEBoot-mkpasswd-pbkdf2.c: Likewise. + * util/VasEBoot-mkrelpath.c: Likewise. + * util/VasEBoot-pe2elf.c: Likewise. + * util/VasEBoot-probe.c: Likewise. * util/hostdisk.c: Likewise. - * util/i386/efi/grub-mkimage.c: Likewise. - * util/i386/pc/grub-mkimage.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. * util/ieee1275/ofpath.c: Likewise. * util/mkisofs/eltorito.c: Likewise. * util/mkisofs/rock.c: Likewise. * util/mkisofs/write.c: Likewise. * util/raid.c: Likewise. - * util/sparc64/ieee1275/grub-mkimage.c: Likewise. - * util/sparc64/ieee1275/grub-setup.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-mkimage.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c: Likewise. 2010-01-15 Vladimir Serbinenko @@ -31874,41 +31874,41 @@ (relocator_mod_ASFLAGS): Likewise. (relocator_mod_LDFLAGS): Likewise. Include i386.mk. - * include/grub/x86_64/multiboot.h: New file. - * loader/i386/multiboot.c (grub_multiboot_boot) [GRUB_MACHINE_EFI]: + * include/VasEBoot/x86_64/multiboot.h: New file. + * loader/i386/multiboot.c (VasEBoot_multiboot_boot) [VasEBoot_MACHINE_EFI]: Terminate EFI. 2010-01-15 Vladimir Serbinenko Video multiboot support. - * include/grub/multiboot.h (grub_multiboot_set_accepts_video): + * include/VasEBoot/multiboot.h (VasEBoot_multiboot_set_accepts_video): New prototype. * include/multiboot.h: Resynced with multiboot specification. * include/multiboot2.h: Likewise. * loader/i386/multiboot.c (UNSUPPORTED_FLAGS): Support video flags. - (grub_multiboot): Parse MULTIBOOT_VIDEO_MODE fields. + (VasEBoot_multiboot): Parse MULTIBOOT_VIDEO_MODE fields. * loader/i386/multiboot_mbi.c (DEFAULT_VIDEO_MODE): New constant. (HAS_VGA_TEXT): Likewise. (accepts_video): New variable. - (grub_multiboot_set_accepts_video): New function. - (grub_multiboot_get_mbi_size): Account for video structures. + (VasEBoot_multiboot_set_accepts_video): New function. + (VasEBoot_multiboot_get_mbi_size): Account for video structures. (set_video_mode): New function. (retrieve_video_parameters): Likewise. - (grub_multiboot_make_mbi): Fill video fields. + (VasEBoot_multiboot_make_mbi): Fill video fields. 2010-01-15 Vladimir Serbinenko Video driver ids. - * include/grub/video.h (grub_video_driver_id): New type. - (grub_video_adapter): New member 'id'. All users updated. - (grub_video_get_driver_id): New proto. - * video/video.c (grub_video_get_driver_id): New function. + * include/VasEBoot/video.h (VasEBoot_video_driver_id): New type. + (VasEBoot_video_adapter): New member 'id'. All users updated. + (VasEBoot_video_get_driver_id): New proto. + * video/video.c (VasEBoot_video_get_driver_id): New function. 2010-01-14 Carles Pina i Estany - * util/grub.d/30_os-prober.in: Use `set var=val' rather than plain + * util/VasEBoot.d/30_os-prober.in: Use `set var=val' rather than plain `var=val'. 2010-01-14 Carles Pina i Estany @@ -31917,126 +31917,126 @@ 2001-01-14 Carles Pina i Estany - * loader/i386/pc/chainloader.c: Include `'. + * loader/i386/pc/chainloader.c: Include `'. 2010-01-14 Carles Pina i Estany - * gettext/gettext.c (grub_gettext_translate): Push and pop - grub_errno. - (grub_gettext_delete_list): Change comment style. - * kern/err.c (grub_error): Gettextizze. - (grub_fatal): Gettextizze. + * gettext/gettext.c (VasEBoot_gettext_translate): Push and pop + VasEBoot_errno. + (VasEBoot_gettext_delete_list): Change comment style. + * kern/err.c (VasEBoot_error): Gettextizze. + (VasEBoot_fatal): Gettextizze. -2010-01-14 Robert Millan +2010-01-14 Robert Millan - * include/grub/i386/loader.h (grub_linux16_boot): Renamed to ... - (grub_linux16_real_boot): ... this. + * include/VasEBoot/i386/loader.h (VasEBoot_linux16_boot): Renamed to ... + (VasEBoot_linux16_real_boot): ... this. * kern/i386/loader.S: Likewise. - * loader/i386/pc/linux.c: Include `' and `'. - (grub_linux16_boot): New function. Switches to text mode and calls - grub_linux16_real_boot(). + * loader/i386/pc/linux.c: Include `' and `'. + (VasEBoot_linux16_boot): New function. Switches to text mode and calls + VasEBoot_linux16_real_boot(). - * loader/i386/bsd.c: Include `'. - (grub_freebsd_boot, grub_openbsd_boot, grub_netbsd_boot): Switch to - text mode before calling grub_unix_real_boot(). + * loader/i386/bsd.c: Include `'. + (VasEBoot_freebsd_boot, VasEBoot_openbsd_boot, VasEBoot_netbsd_boot): Switch to + text mode before calling VasEBoot_unix_real_boot(). - * loader/i386/multiboot.c: Include `'. - (grub_multiboot_boot): Switch to text mode before calling - grub_relocator32_boot(). + * loader/i386/multiboot.c: Include `'. + (VasEBoot_multiboot_boot): Switch to text mode before calling + VasEBoot_relocator32_boot(). - * loader/i386/pc/chainloader.c: Include `'. - (grub_chainloader_boot): Switch to text mode before calling - grub_chainloader_real_boot(). + * loader/i386/pc/chainloader.c: Include `'. + (VasEBoot_chainloader_boot): Switch to text mode before calling + VasEBoot_chainloader_real_boot(). 2010-01-05 Jordan Uggla 2010-01-05 Colin Watson - * util/grub-reboot.in: Make sure prev_saved_entry always gets a + * util/VasEBoot-reboot.in: Make sure prev_saved_entry always gets a non-empty value. 2010-01-05 Jordan Uggla 2010-01-05 Colin Watson - * util/grub.d/00_header.in: Define a "savedefault" function for use + * util/VasEBoot.d/00_header.in: Define a "savedefault" function for use in menu entries. - * util/grub-mkconfig_lib.in (save_default_entry): Use it. + * util/VasEBoot-mkconfig_lib.in (save_default_entry): Use it. 2010-01-05 Jordan Uggla 2010-01-05 Colin Watson - * util/grub-mkconfig_lib.in (save_default_entry): Only set + * util/VasEBoot-mkconfig_lib.in (save_default_entry): Only set saved_entry if boot_once is unset. - * util/grub.d/00_header.in: Set boot_once to "true" if there was a - previous saved entry (i.e. grub-reboot). + * util/VasEBoot.d/00_header.in: Set boot_once to "true" if there was a + previous saved entry (i.e. VasEBoot-reboot). 2009-12-08 Colin Watson - * util/grub.d/30_os-prober.in: Call save_default_entry for hurd. + * util/VasEBoot.d/30_os-prober.in: Call save_default_entry for hurd. 2009-12-08 Colin Watson - * util/grub.d/00_header.in: Use `set var=val' rather than plain + * util/VasEBoot.d/00_header.in: Use `set var=val' rather than plain `var=val'. - * util/grub-mkconfig_lib.in (save_default_entry): Likewise. + * util/VasEBoot-mkconfig_lib.in (save_default_entry): Likewise. 2009-12-08 Colin Watson - * util/grub-reboot.in: Fix --version output. - * util/grub-set-default.in: Likewise. + * util/VasEBoot-reboot.in: Fix --version output. + * util/VasEBoot-set-default.in: Likewise. 2009-12-08 Colin Watson - * util/grub.d/00_header.in: Silently ignore zero-sized environment + * util/VasEBoot.d/00_header.in: Silently ignore zero-sized environment blocks. 2009-12-08 Colin Watson - * util/grub.d/00_header.in: Quote the value assigned to `default', + * util/VasEBoot.d/00_header.in: Quote the value assigned to `default', in case it contains spaces. 2009-12-08 Colin Watson - * util/grub.d/30_os-prober.in: Fix merge error that moved a + * util/VasEBoot.d/30_os-prober.in: Fix merge error that moved a `save_default_entry' call from the macosx case to the linux case. 2009-10-25 Vladimir Serbinenko 2009-10-25 Colin Watson - * normal/menu.c (grub_menu_execute_entry): Save selected entry title + * normal/menu.c (VasEBoot_menu_execute_entry): Save selected entry title in `chosen' environment variable. * normal/menu_text.c (get_entry_number): Check if the variable matches the title of a menu entry. (run_menu): Pass menu to get_entry_number. - * util/grub-reboot.in: New file. - * util/grub-set-default.in: New file. - * conf/common.rmk (grub-reboot): New utility. - (grub-set-default): New utility. + * util/VasEBoot-reboot.in: New file. + * util/VasEBoot-set-default.in: New file. + * conf/common.rmk (VasEBoot-reboot): New utility. + (VasEBoot-set-default): New utility. - * util/grub-mkconfig_lib.in (save_default_entry): New function. - * util/grub.d/00_header.in: If GRUB_DEFAULT is `saved', set + * util/VasEBoot-mkconfig_lib.in (save_default_entry): New function. + * util/VasEBoot.d/00_header.in: If VasEBoot_DEFAULT is `saved', set default to `${saved_entry}'. If `${prev_saved_entry}' is non-empty, move it to `saved_entry' for the next boot. Load environment on initialisation. - * util/grub.d/10_kfreebsd.in: Call save_default_entry. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_linux.in (linux_entry): Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/30_os-prober.in: Likewise. + * util/VasEBoot.d/10_kfreebsd.in: Call save_default_entry. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_linux.in (linux_entry): Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. - * util/grub-install.in: Create environment block. - * util/i386/efi/grub-install.in: Likewise. - * util/ieee1275/grub-install.in: Likewise. - * util/sparc64/ieee1275/grub-install.in: Likewise. + * util/VasEBoot-install.in: Create environment block. + * util/i386/efi/VasEBoot-install.in: Likewise. + * util/ieee1275/VasEBoot-install.in: Likewise. + * util/sparc64/ieee1275/VasEBoot-install.in: Likewise. 2010-01-14 BVK Chaitanya - Unit testing framework for GRUB. + Unit testing framework for VasEBoot. * Makefile.in: Test framework build rules for 'make check'. * conf/tests.rmk: Build rules for individual tests and framework. - * include/grub/test.h: Header file for whitebox tests. + * include/VasEBoot/test.h: Header file for whitebox tests. * tests/lib/functional_test.c: Framework support for whitebox functional tests. * tests/lib/test.c: Common whitebox testing code for unit and @@ -32044,14 +32044,14 @@ * tests/lib/unit_test.c: Framework support for whitebox unit tests. - * tests/util/grub-shell-tester.in: Support utility for grub-script + * tests/util/VasEBoot-shell-tester.in: Support utility for VasEBoot-script tests. - * tests/util/grub-shell.in: Utility to execute grub-script + * tests/util/VasEBoot-shell.in: Utility to execute VasEBoot-script commands in a Qemu instance. * tests/example_functional_test.c: Example whitebox functional test. - * tests/example_grub_script_test.in: Example grub-script test. + * tests/example_VasEBoot_script_test.in: Example VasEBoot-script test. * tests/example_scripted_test.in: Example scripted test. * tests/example_unit_test.c: Example whitebox unit test. @@ -32062,39 +32062,39 @@ (multiboot2_mod_SOURCES): Likewise. * conf/i386-pc.rmk (multiboot_mod_SOURCES): Likewise. (multiboot2_mod_SOURCES): Likewise. - * include/grub/multiboot.h (grub_multiboot_get_mbi_size): New proto. - (grub_multiboot_make_mbi): Likewise. - (grub_multiboot_free_mbi): Likewise. - (grub_multiboot_init_mbi): Likewise. - (grub_multiboot_add_module): Likewise. - (grub_multiboot_set_bootdev): Likewise. + * include/VasEBoot/multiboot.h (VasEBoot_multiboot_get_mbi_size): New proto. + (VasEBoot_multiboot_make_mbi): Likewise. + (VasEBoot_multiboot_free_mbi): Likewise. + (VasEBoot_multiboot_init_mbi): Likewise. + (VasEBoot_multiboot_add_module): Likewise. + (VasEBoot_multiboot_set_bootdev): Likewise. * loader/i386/multiboot.c (mbi): Removed. (mbi_dest): Likewise. (alloc_mbi): New variable. - (grub_multiboot_payload_size): Removed. All users updated. - (grub_multiboot_pure_size): New variable. - (grub_multiboot_boot): Use grub_multiboot_make_mbi. - (grub_multiboot_unload): Use grub_multiboot_free_mbi. - (grub_get_multiboot_mmap_len): Moved to loader/i386/multiboot_mbi.c. - (grub_fill_multiboot_mmap): Likewise. - (grub_multiboot_get_bootdev): Likewise. - (grub_multiboot): Use multiboot_mbi functions. + (VasEBoot_multiboot_payload_size): Removed. All users updated. + (VasEBoot_multiboot_pure_size): New variable. + (VasEBoot_multiboot_boot): Use VasEBoot_multiboot_make_mbi. + (VasEBoot_multiboot_unload): Use VasEBoot_multiboot_free_mbi. + (VasEBoot_get_multiboot_mmap_len): Moved to loader/i386/multiboot_mbi.c. + (VasEBoot_fill_multiboot_mmap): Likewise. + (VasEBoot_multiboot_get_bootdev): Likewise. + (VasEBoot_multiboot): Use multiboot_mbi functions. * loader/i386/multiboot_mbi.c: New file. 2010-01-13 Vladimir Serbinenko - * kern/efi/init.c (grub_efi_fini): Don't call grub_efi_mm_fini as + * kern/efi/init.c (VasEBoot_efi_fini): Don't call VasEBoot_efi_mm_fini as it would result in module crash. 2010-01-13 Vladimir Serbinenko - * term/ieee1275/ofconsole.c (grub_ofconsole_putchar): Handle '\r'. - (grub_ofconsole_getwh): Split to ... - (grub_ofconsole_getwh): ... this. - (grub_ofconsole_dimensions): ...and this. - (grub_ofconsole_init_output): Call grub_ofconsole_dimensions. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_putchar): Handle '\r'. + (VasEBoot_ofconsole_getwh): Split to ... + (VasEBoot_ofconsole_getwh): ... this. + (VasEBoot_ofconsole_dimensions): ...and this. + (VasEBoot_ofconsole_init_output): Call VasEBoot_ofconsole_dimensions. -2010-01-13 Robert Millan +2010-01-13 Robert Millan * util/mkisofs/rock.c (generate_rock_ridge_attributes): Fix a typo. @@ -32104,10 +32104,10 @@ 2010-01-12 Vladimir Serbinenko - * util/grub-mkpasswd-pbkdf2.c (main): Use grub_util_init_nls. + * util/VasEBoot-mkpasswd-pbkdf2.c (main): Use VasEBoot_util_init_nls. Reported by: Grégoire Sutre -2010-01-11 Robert Millan +2010-01-11 Robert Millan * util/misc.c (canonicalize_file_name): New function. (make_system_path_relative_to_its_root): Use canonicalize_file_name() @@ -32115,7 +32115,7 @@ 2010-01-11 Colin Watson - * util/grub-install.in (usage): Clarify meaning of --root-directory, + * util/VasEBoot-install.in (usage): Clarify meaning of --root-directory, and make it clearer that it's optional. Based on confusion witnessed on IRC. @@ -32126,43 +32126,43 @@ 2010-01-10 Vladimir Serbinenko - * normal/cmdline.c (grub_cmdline_get): Fix off-by-one error + * normal/cmdline.c (VasEBoot_cmdline_get): Fix off-by-one error which resulted in garbled command line at the end of screen. -2010-01-10 Robert Millan +2010-01-10 Robert Millan - * loader/i386/ieee1275/linux.c (grub_linux_boot): Rework video position + * loader/i386/ieee1275/linux.c (VasEBoot_linux_boot): Rework video position initialization with similar approach as with other Linux loaders. -2010-01-10 Robert Millan +2010-01-10 Robert Millan Fix i386-ieee1275 build. - * loader/i386/ieee1275/linux.c (grub_linux_boot): Use grub_term_width() - and grub_term_height() for video_{width,height} initialization. + * loader/i386/ieee1275/linux.c (VasEBoot_linux_boot): Use VasEBoot_term_width() + and VasEBoot_term_height() for video_{width,height} initialization. -2010-01-10 Robert Millan +2010-01-10 Robert Millan - Fix grub-emu build. + Fix VasEBoot-emu build. - * conf/any-emu.rmk (grub_emu_SOURCES): Remove `kern/reader.c'. + * conf/any-emu.rmk (VasEBoot_emu_SOURCES): Remove `kern/reader.c'. 2010-01-07 Vladimir Serbinenko -2010-01-09 Robert Millan +2010-01-09 Robert Millan Support for multiple terminals. * Makefile.in (pkglib_DATA): terminal.lst. (terminal.lst): New target. - * commands/handler.c (grub_cmd_handler): Don't handle terminals. - (GRUB_MOD_INIT(handler)): Likewise. - (GRUB_MOD_FINI(handler)): Likewise. - * commands/help.c (grub_cmd_help): Handle multiple terminals. - * commands/keystatus.c (grub_cmd_keystatus): Likewise. - * commands/sleep.c (do_print): Use grub_term_restore_pos. - (grub_cmd_sleep): Use grub_term_save_pos. + * commands/handler.c (VasEBoot_cmd_handler): Don't handle terminals. + (VasEBoot_MOD_INIT(handler)): Likewise. + (VasEBoot_MOD_FINI(handler)): Likewise. + * commands/help.c (VasEBoot_cmd_help): Handle multiple terminals. + * commands/keystatus.c (VasEBoot_cmd_keystatus): Likewise. + * commands/sleep.c (do_print): Use VasEBoot_term_restore_pos. + (VasEBoot_cmd_sleep): Use VasEBoot_term_save_pos. * commands/terminal.c: New file. - * conf/any-emu.rmk (grub_emu_SOURCES): Add normal/term.c + * conf/any-emu.rmk (VasEBoot_emu_SOURCES): Add normal/term.c commands/terminal.c and lib/charset.c. * conf/common.rmk (normal_mod_SOURCES): Add normal/term.c. (pkglib_MODULES): Add terminal.mod. @@ -32172,78 +32172,78 @@ * genhandlerlist.sh: Don't handle terminals. * genmk.rb: Generate terminal-*.lst. * genterminallist.sh: New file. - * include/grub/charset.h (grub_ucs4_to_utf8_alloc): New proto. - (grub_is_valid_utf8): Likewise. - (grub_utf8_to_ucs4_alloc): Likewise. - * include/grub/menu_viewer.h (grub_menu_viewer): Rewritten. - (grub_menu_register_viewer): Changed argument. - (grub_menu_try_text): New proto. - (grub_gfxmenu_try_hook): New declaration. - * include/grub/normal.h (grub_normal_exit_level): New declaration. - (grub_menu_init_page): Additional argument term. - (grub_normal_init_page): Likewise. - (grub_cmdline_get): Arguments simplified. - (grub_utf8_to_ucs4_alloc): Removed. - (grub_print_ucs4): Additional argument term. - (grub_getstringwidth): Likewise. - (grub_print_message_indented): Likewise. - (grub_menu_text_register_instances): New proto. - (grub_show_menu): Likewise. + * include/VasEBoot/charset.h (VasEBoot_ucs4_to_utf8_alloc): New proto. + (VasEBoot_is_valid_utf8): Likewise. + (VasEBoot_utf8_to_ucs4_alloc): Likewise. + * include/VasEBoot/menu_viewer.h (VasEBoot_menu_viewer): Rewritten. + (VasEBoot_menu_register_viewer): Changed argument. + (VasEBoot_menu_try_text): New proto. + (VasEBoot_gfxmenu_try_hook): New declaration. + * include/VasEBoot/normal.h (VasEBoot_normal_exit_level): New declaration. + (VasEBoot_menu_init_page): Additional argument term. + (VasEBoot_normal_init_page): Likewise. + (VasEBoot_cmdline_get): Arguments simplified. + (VasEBoot_utf8_to_ucs4_alloc): Removed. + (VasEBoot_print_ucs4): Additional argument term. + (VasEBoot_getstringwidth): Likewise. + (VasEBoot_print_message_indented): Likewise. + (VasEBoot_menu_text_register_instances): New proto. + (VasEBoot_show_menu): Likewise. (read_terminal_list): Likewise. - (grub_set_more): Likewise. - * include/grub/parser.h: Include handler.h. - * include/grub/reader.h: Rewritten. - * include/grub/term.h (GRUB_TERM_NEED_INIT): Removed. - (GRUB_TERM_WIDTH): Changed to function. - (GRUB_TERM_HEIGHT): Likewise. - (GRUB_TERM_BORDER_WIDTH): Likewise. - (GRUB_TERM_BORDER_HEIGHT): Likewise. - (GRUB_TERM_NUM_ENTRIES): Likewise. - (GRUB_TERM_ENTRY_WIDTH): Likewise. - (GRUB_TERM_CURSOR_X): Likewise. - (grub_term_input_class): Likewise. - (grub_term_output_class): Likewise. - (grub_term_outputs_disabled): New declaration. - (grub_term_inputs_disabled): Likewise. - (grub_term_outputs): Likewise. - (grub_term_inputs): Likewise. - (grub_term_register_input): Rewritten. - (grub_term_register_output): Likewise. - (grub_term_unregister_input): Likewise. - (grub_term_unregister_output): Likewise. + (VasEBoot_set_more): Likewise. + * include/VasEBoot/parser.h: Include handler.h. + * include/VasEBoot/reader.h: Rewritten. + * include/VasEBoot/term.h (VasEBoot_TERM_NEED_INIT): Removed. + (VasEBoot_TERM_WIDTH): Changed to function. + (VasEBoot_TERM_HEIGHT): Likewise. + (VasEBoot_TERM_BORDER_WIDTH): Likewise. + (VasEBoot_TERM_BORDER_HEIGHT): Likewise. + (VasEBoot_TERM_NUM_ENTRIES): Likewise. + (VasEBoot_TERM_ENTRY_WIDTH): Likewise. + (VasEBoot_TERM_CURSOR_X): Likewise. + (VasEBoot_term_input_class): Likewise. + (VasEBoot_term_output_class): Likewise. + (VasEBoot_term_outputs_disabled): New declaration. + (VasEBoot_term_inputs_disabled): Likewise. + (VasEBoot_term_outputs): Likewise. + (VasEBoot_term_inputs): Likewise. + (VasEBoot_term_register_input): Rewritten. + (VasEBoot_term_register_output): Likewise. + (VasEBoot_term_unregister_input): Likewise. + (VasEBoot_term_unregister_output): Likewise. (FOR_ACTIVE_TERM_INPUTS): New macro. (FOR_DISABLED_TERM_INPUTS): Likewise. (FOR_ACTIVE_TERM_OUTPUTS): Likewise. (FOR_DISABLED_TERM_OUTPUTS): Likewise. - * include/grub/terminfo.h: Add oterm argument to all protypes. - * kern/main.c (grub_main): Don't call grub_register_rescue_reader. - Use grub_rescue_run. - * kern/misc.c (grub_utf8_to_ucs4): Put '?' for invalid characters. + * include/VasEBoot/terminfo.h: Add oterm argument to all protypes. + * kern/main.c (VasEBoot_main): Don't call VasEBoot_register_rescue_reader. + Use VasEBoot_rescue_run. + * kern/misc.c (VasEBoot_utf8_to_ucs4): Put '?' for invalid characters. All users updated. * kern/reader.c: Removed. All users updated. - * kern/rescue_reader.c (grub_rescue_init): Removed. - (grub_rescue_reader): Likewise. - (grub_register_rescue_reader): Likewise. - (grub_rescue_run): New function based on kern/reader.c. + * kern/rescue_reader.c (VasEBoot_rescue_init): Removed. + (VasEBoot_rescue_reader): Likewise. + (VasEBoot_register_rescue_reader): Likewise. + (VasEBoot_rescue_run): New function based on kern/reader.c. * kern/term.c: Adapted for multiterm. - * lib/charset.c (grub_ucs4_to_utf8_alloc): New function. - (grub_is_valid_utf8): Likewise. - (grub_utf8_to_ucs4_alloc): Moved from normal/menu_text.c. - * loader/i386/efi/linux.c (grub_cmd_linux): Retrieve parameters of + * lib/charset.c (VasEBoot_ucs4_to_utf8_alloc): New function. + (VasEBoot_is_valid_utf8): Likewise. + (VasEBoot_utf8_to_ucs4_alloc): Moved from normal/menu_text.c. + * loader/i386/efi/linux.c (VasEBoot_cmd_linux): Retrieve parameters of right terminal. - * loader/i386/linux.c (grub_linux_boot): Likewise. - * normal/auth.c (grub_username_get): New function. - (grub_auth_check_authentication): Use grub_username_get. + * loader/i386/linux.c (VasEBoot_linux_boot): Likewise. + * normal/auth.c (VasEBoot_username_get): New function. + (VasEBoot_auth_check_authentication): Use VasEBoot_username_get. * normal/cmdline.c: Changed to UCS4. Adapted for multiterm. * normal/color.c: Adapt for multiterm. - * normal/main.c (read_config_file): Don't use grub_reader_loop. - (grub_normal_init_page): Additional argument term. + * normal/main.c (read_config_file): Don't use VasEBoot_reader_loop. + (VasEBoot_normal_init_page): Additional argument term. (read_lists): Call read_terminal_lists. - (grub_enter_normal_mode): Call grub_cmdline_run. - Handle grub_normal_exit_level. - (grub_cmd_normal): Make reentrant. - (grub_cmd_normal_exit): New function. - (grub_normal_reader_init): Additional argument nested. Handle multiterm. + (VasEBoot_enter_normal_mode): Call VasEBoot_cmdline_run. + Handle VasEBoot_normal_exit_level. + (VasEBoot_cmd_normal): Make reentrant. + (VasEBoot_cmd_normal_exit): New function. + (VasEBoot_normal_reader_init): Additional argument nested. Handle multiterm. * normal/menu.c: Adapt for multiterm. * normal/menu_entry.c: Likewise. * normal/menu_text.c: Likewise. @@ -32253,60 +32253,60 @@ ncurses headers. * term/terminfo.c: New argument oterm on all exported functions. All users updated. - * util/grub-editenv.c (grub_term_input_class): Removed. - (grub_term_output_class): Likewise. + * util/VasEBoot-editenv.c (VasEBoot_term_input_class): Removed. + (VasEBoot_term_output_class): Likewise. -2010-01-09 Robert Millan +2010-01-09 Robert Millan Make loader output a bit more user-friendly. - * util/grub.d/10_hurd.in: Print message indicating that GNU Mach + * util/VasEBoot.d/10_hurd.in: Print message indicating that GNU Mach is being loaded. Likewise for the Hurd. - * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Print message indicating + * util/VasEBoot.d/10_kfreebsd.in (kfreebsd_entry): Print message indicating that kernel of FreeBSD ${version} is being loaded. - * loader/i386/linux.c (grub_cmd_linux): Move debug info to - grub_dprintf(). - (grub_cmd_initrd): Likewise. - * util/grub.d/10_linux.in (linux_entry): Print message indicating + * loader/i386/linux.c (VasEBoot_cmd_linux): Move debug info to + VasEBoot_dprintf(). + (VasEBoot_cmd_initrd): Likewise. + * util/VasEBoot.d/10_linux.in (linux_entry): Print message indicating that Linux ${version} is being loaded. Likewise for initrd. 2010-01-09 Carles Pina i Estany - * gettext/gettext.c (GRUB_MOD_INIT): Gettextizze. + * gettext/gettext.c (VasEBoot_MOD_INIT): Gettextizze. 2010-01-08 Carles Pina i Estany - * loader/efi/appleloader.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. - * loader/efi/chainloader.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. - * loader/i386/efi/linux.c: Include `'. - (grub_cmd_linux): Capitalise Linux. - (GRUB_MOD_INIT): Gettextizze. - * loader/i386/ieee1275/linux.c: Include `'. - (grub_cmd_linux): Capitalise Linux. - (GRUB_MOD_INIT): Gettextizze. - * loader/i386/linux.c: Include `'. - (grub_cmd_linux): Capitalise Linux. - (GRUB_MOD_INIT): Gettextizze. - * loader/i386/pc/chainloader.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. - * loader/i386/pc/linux.c: Include `'. - (grub_cmd_linux): Capitalise Linux. - (GRUB_MOD_INIT): Gettextizze. - * loader/i386/xnu.c: Include `'. - (grub_cpu_xnu_init): Gettextizze. - * loader/multiboot_loader.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. - * loader/powerpc/ieee1275/linux.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. - * loader/sparc64/ieee1275/linux.c: Include `'. - (grub_linux_load64): Capitalise Linux. - (GRUB_MOD_INIT): Gettextizze. - * loader/xnu.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. + * loader/efi/appleloader.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/efi/chainloader.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/i386/efi/linux.c: Include `'. + (VasEBoot_cmd_linux): Capitalise Linux. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/i386/ieee1275/linux.c: Include `'. + (VasEBoot_cmd_linux): Capitalise Linux. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/i386/linux.c: Include `'. + (VasEBoot_cmd_linux): Capitalise Linux. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/i386/pc/chainloader.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/i386/pc/linux.c: Include `'. + (VasEBoot_cmd_linux): Capitalise Linux. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/i386/xnu.c: Include `'. + (VasEBoot_cpu_xnu_init): Gettextizze. + * loader/multiboot_loader.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/powerpc/ieee1275/linux.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/sparc64/ieee1275/linux.c: Include `'. + (VasEBoot_linux_load64): Capitalise Linux. + (VasEBoot_MOD_INIT): Gettextizze. + * loader/xnu.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. * po/POTFILES: Add `loader/efi/appleloader.c', `loader/efi/chainloader.c', `loader/i386/efi/linux.c', `loader/i386/ieee1275/linux.c', `loader/i386/linux.c', @@ -32315,17 +32315,17 @@ `loader/powerpc/ieee1275/linux.c', `loader/sparc64/ieee1275/linux.c' and `loader/xnu.c'. -2010-01-08 Robert Millan +2010-01-08 Robert Millan * src/mkisofs.c: Remove `ifdef linux' portability kludge. -2010-01-08 Robert Millan +2010-01-08 Robert Millan * util/mkisofs/defaults.h (APPID_DEFAULT): Redefine using PACKAGE_NAME. (SYSTEM_ID_DEFAULT): Set to "GNU" unconditionally. * util/mkisofs/mkisofs.c (main): Readjust --version output. -2010-01-07 Robert Millan +2010-01-07 Robert Millan Reset Multiboot 2 support. New loader implements the draft in /branches/multiboot2 and shares as much code as possible with the @@ -32343,7 +32343,7 @@ (pkglib_MODULES): Add `multiboot2.mod'. (multiboot2_mod_SOURCES): New variable. (multiboot2_mod_LDFLAGS): Likewise. - (multiboot2_mod_CFLAGS): Likewise. Define `GRUB_USE_MULTIBOOT2'. + (multiboot2_mod_CFLAGS): Likewise. Define `VasEBoot_USE_MULTIBOOT2'. * conf/i386-pc.rmk: Likewise. @@ -32352,26 +32352,26 @@ (multiboot_mod_LDFLAGS): Likewise. (multiboot_mod_CFLAGS): Likewise. - * include/grub/multiboot.h [GRUB_USE_MULTIBOOT2]: Include + * include/VasEBoot/multiboot.h [VasEBoot_USE_MULTIBOOT2]: Include `' instead of `'. - [GRUB_USE_MULTIBOOT2] (MULTIBOOT_BOOTLOADER_MAGIC) + [VasEBoot_USE_MULTIBOOT2] (MULTIBOOT_BOOTLOADER_MAGIC) (MULTIBOOT_HEADER_MAGIC): New macros. * loader/multiboot_loader.c (module_version_status): Remove variable. (find_multi_boot2_header): Remove function. - (grub_cmd_multiboot_loader): Remove Multiboot 2 / Multiboot 1 selection + (VasEBoot_cmd_multiboot_loader): Remove Multiboot 2 / Multiboot 1 selection logic. Always check for the Multiboot version we're compiling for. - (grub_cmd_module_loader): Likewise. - [GRUB_USE_MULTIBOOT2] (GRUB_MOD_INIT(multiboot)): Register `multiboot2' + (VasEBoot_cmd_module_loader): Likewise. + [VasEBoot_USE_MULTIBOOT2] (VasEBoot_MOD_INIT(multiboot)): Register `multiboot2' command instead of `multiboot'. -2010-01-07 Robert Millan +2010-01-07 Robert Millan * include/multiboot.h (MULTIBOOT_UNSUPPORTED): Moved from here ... * loader/i386/multiboot.c (UNSUPPORTED_FLAGS): ... to here. Update all users. -2010-01-07 Robert Millan +2010-01-07 Robert Millan 2010-01-07 Vladimir Serbinenko Fix breakage introduced with previous commit. @@ -32381,9 +32381,9 @@ * normal/handler.c (read_handler_list): Revert part of previous commit affecting this file. * normal/main.c (read_lists): Move read_handler_list() call back to ... - (grub_normal_execute): ... here. + (VasEBoot_normal_execute): ... here. -2010-01-07 Robert Millan +2010-01-07 Robert Millan Merge prefix-redefinition-fix branch. @@ -32394,7 +32394,7 @@ * normal/handler.c (read_handler_list): Likewise. * normal/main.c (read_lists): New function. Calls all the list reading functions. - (grub_normal_execute): Use read_lists() instead of calling all + (VasEBoot_normal_execute): Use read_lists() instead of calling all list reading functions explicitly. Register read_lists() as a variable hook attached to ${prefix}. @@ -32405,12 +32405,12 @@ * Makefile.in (pkglib_DATA): Add crypto.lst. (crypto.lst): New target. * commands/hashsum.c: New file. - * commands/password.c (check_password): Use grub_crypto_memcmp. + * commands/password.c (check_password): Use VasEBoot_crypto_memcmp. * commands/password_pbkdf2.c: New file. - * commands/xnu_uuid.c: Remove MD5. Use GRUB_MD_MD5. - * conf/any-emu.rmk (grub_emu_SOURCES): Add lib/crypto.c, - normal/crypto.c and lib/libgcrypt-grub/cipher/md5.c. - (grub_emu_CFLAGS): Add -Wno-missing-field-initializers -Wno-error + * commands/xnu_uuid.c: Remove MD5. Use VasEBoot_MD_MD5. + * conf/any-emu.rmk (VasEBoot_emu_SOURCES): Add lib/crypto.c, + normal/crypto.c and lib/libgcrypt-VasEBoot/cipher/md5.c. + (VasEBoot_emu_CFLAGS): Add -Wno-missing-field-initializers -Wno-error -I$(srcdir)/lib/libgcrypt_wrap. * conf/common.rmk (normal_mod_SOURCES): Add normal/crypto.c. (pkglib_MODULES): Add crypto.mod, hashsum.mod, pbkdf2.mod and @@ -32427,33 +32427,33 @@ (password_pbkdf2_mod_SOURCES): New variable. (password_pbkdf2_mod_CFLAGS): Likewise. (password_pbkdf2_mod_LDFLAGS): Likewise. - (bin_UTILITIES): Add grub-mkpasswd-pbkdf2. - (grub_mkpasswd_pbkdf2_SOURCES): New variable. - (grub_mkpasswd_pbkdf2_CFLAGS): Likewise. + (bin_UTILITIES): Add VasEBoot-mkpasswd-pbkdf2. + (VasEBoot_mkpasswd_pbkdf2_SOURCES): New variable. + (VasEBoot_mkpasswd_pbkdf2_CFLAGS): Likewise. Include conf/gcry.rmk. - * include/grub/auth.h: Rewritten. - * include/grub/crypto.h: New file. - * include/grub/disk.h (grub_disk_dev_id): Add GRUB_DISK_DEVICE_LUKS_ID. - * include/grub/normal.h (read_crypto_list): New prototype. + * include/VasEBoot/auth.h: Rewritten. + * include/VasEBoot/crypto.h: New file. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add VasEBoot_DISK_DEVICE_LUKS_ID. + * include/VasEBoot/normal.h (read_crypto_list): New prototype. * lib/crypto.c: New file. * lib/libgcrypt_wrap/cipher_wrap.h: Likewise. * lib/pbkdf2.c: Likewise. - * normal/auth.c (grub_auth_strcmp): Removed. - (grub_iswordseparator): Likewise. - (grub_auth_strword): Likewise. - (is_authenticated): Use grub_strword. - (grub_auth_check_authentication): Use grub_strcmp, grub_password_get - and grub_strword. Pass entered password to authentication callback. + * normal/auth.c (VasEBoot_auth_strcmp): Removed. + (VasEBoot_iswordseparator): Likewise. + (VasEBoot_auth_strword): Likewise. + (is_authenticated): Use VasEBoot_strword. + (VasEBoot_auth_check_authentication): Use VasEBoot_strcmp, VasEBoot_password_get + and VasEBoot_strword. Pass entered password to authentication callback. * normal/crypto.c: New file. * normal/main.c: Call read_crypto_list. - * util/grub-mkpasswd-pbkdf2.c: New file. + * util/VasEBoot-mkpasswd-pbkdf2.c: New file. * util/import_gcry.py: Generate crypto.lst. Add hash blocklen. 2010-01-06 Vladimir Serbinenko Fix descent and ascent calculation. - * util/grub-mkfont.c (grub_font_info): New fields 'asce' and 'max_y'. + * util/VasEBoot-mkfont.c (VasEBoot_font_info): New fields 'asce' and 'max_y'. (options): New option "asce". (usage): Likewise. (add_char): Ignore invalid glyphs for descent calculation. @@ -32464,18 +32464,18 @@ 2010-01-06 Carles Pina i Estany - * kern/err.c: Include `'. - (grub_print_error): Add full stop. Gettextizze. - * loader/i386/bsd.c (grub_netbsd_boot): Change grub_error description. - (grub_bsd_load_elf): Capitalise ELF. - (grub_cmd_freebsd_loadenv): Add `s' in error string. - (grub_cmd_freebsd_module): Likewise. - (grub_cmd_freebsd_module_elf): Likewise. + * kern/err.c: Include `'. + (VasEBoot_print_error): Add full stop. Gettextizze. + * loader/i386/bsd.c (VasEBoot_netbsd_boot): Change VasEBoot_error description. + (VasEBoot_bsd_load_elf): Capitalise ELF. + (VasEBoot_cmd_freebsd_loadenv): Add `s' in error string. + (VasEBoot_cmd_freebsd_module): Likewise. + (VasEBoot_cmd_freebsd_module_elf): Likewise. * loader/i386/bsdXX.c (SUFFIX): Capitalise ELF. 2010-01-06 Carles Pina i Estany - * commands/search.c (GRUB_MOD_INIT): Use HELP_MESSAGE. + * commands/search.c (VasEBoot_MOD_INIT): Use HELP_MESSAGE. * commands/search_file.c (HELP_MESSAGE): New macro. * commands/search_label.c (HELP_MESSAGE): Likewise. * commands/search_uuid.c (HELP_MESSAGE): Likewise. @@ -32483,17 +32483,17 @@ `commands/search_label.c', `commands_uuid.c'. Remove duplicate `commands/search.c'. -2010-01-05 Robert Millan +2010-01-05 Robert Millan * config.rpath: Update from Gnulib. 2010-01-05 Yves Blusseau - * commands/acpi.c (grub_acpi_create_ebda): fix incorrect message. + * commands/acpi.c (VasEBoot_acpi_create_ebda): fix incorrect message. 2010-01-05 Yves Blusseau - * util/sparc64/ieee1275/grub-mkimage.c (main): Typo fix. + * util/sparc64/ieee1275/VasEBoot-mkimage.c (main): Typo fix. 2010-01-05 Colin Watson @@ -32508,34 +32508,34 @@ * util/mkisofs/write.c (padblock_write): Check return value of fread. -2010-01-05 Robert Millan +2010-01-05 Robert Millan - Remove grub-mkfloppy. Images produced by grub-mkrescue are valid + Remove VasEBoot-mkfloppy. Images produced by VasEBoot-mkrescue are valid floppy images now. - * util/i386/pc/grub-mkfloppy.in: Remove. Update all users. + * util/i386/pc/VasEBoot-mkfloppy.in: Remove. Update all users. -2010-01-04 Robert Millan +2010-01-04 Robert Millan - * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Use ALIGN_UP macro + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_rw): Use ALIGN_UP macro instead of manual alignment. - * kern/disk.c (grub_disk_read): Remove grub_dprintf call (excessively + * kern/disk.c (VasEBoot_disk_read): Remove VasEBoot_dprintf call (excessively verbose). Avoid attempts to read past end of the device - (grub_disk_adjust_range() guarantees that we can read `size' bytes, - but GRUB_DISK_CACHE_SIZE may exceed that). + (VasEBoot_disk_adjust_range() guarantees that we can read `size' bytes, + but VasEBoot_DISK_CACHE_SIZE may exceed that). -2010-01-04 Robert Millan +2010-01-04 Robert Millan - * commands/crc.c (grub_cmd_crc): Abort on read errors. - * fs/iso9660.c (grub_iso9660_read): Check for read error and pass + * commands/crc.c (VasEBoot_cmd_crc): Abort on read errors. + * fs/iso9660.c (VasEBoot_iso9660_read): Check for read error and pass it to upper layer. 2010-01-04 Vladimir Serbinenko - * include/grub/efi/api.h (GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE): + * include/VasEBoot/efi/api.h (VasEBoot_EFI_PIWG_DEVICE_PATH_SUBTYPE): New constant. - (grub_efi_piwg_device_path): New structure - (grub_efi_piwg_device_path_t): New type. + (VasEBoot_efi_piwg_device_path): New structure + (VasEBoot_efi_piwg_device_path_t): New type. * loader/efi/appleloader.c (piwg_full_device_path): New structure. (devpath_1): Transform to a structure. All users updated. (devpath_2): Likewise. @@ -32547,26 +32547,26 @@ * loader/efi/appleloader.c: Restored. Update all users. -2010-01-03 Robert Millan +2010-01-03 Robert Millan * boot/i386/pc/diskboot.S: Fix inaccurate comment. - * util/i386/pc/grub-setup.c: Include `'. + * util/i386/pc/VasEBoot-setup.c: Include `'. (struct boot_blocklist): Move from here ... - * include/grub/i386/pc/boot.h [ASM_FILE] - (struct grub_boot_blocklist): ... to here. Update all users. + * include/VasEBoot/i386/pc/boot.h [ASM_FILE] + (struct VasEBoot_boot_blocklist): ... to here. Update all users. (setup): Only initialize `start' member of `first_block' structure. Add assert() calls to verify the other members. - * util/i386/pc/grub-mkimage.c: Include `'. + * util/i386/pc/VasEBoot-mkimage.c: Include `'. (generate_image): Fix broken blocklist length initialization. Add assert() call to verify blocklist `segment' field. -2010-01-03 Robert Millan +2010-01-03 Robert Millan * loader/efi/appleloader.c: Remove. Update all users. -2010-01-03 Robert Millan +2010-01-03 Robert Millan * boot/i386/pc/boot.S: Update copyright year. * boot/i386/pc/cdboot.S: Likewise. @@ -32602,23 +32602,23 @@ * fs/xfs.c: Likewise. * gencmdlist.sh: Likewise. * genmk.rb: Likewise. - * include/grub/disk.h: Likewise. - * include/grub/efi/api.h: Likewise. - * include/grub/efi/efi.h: Likewise. - * include/grub/efi/pe32.h: Likewise. - * include/grub/elf.h: Likewise. - * include/grub/fs.h: Likewise. - * include/grub/i386/at_keyboard.h: Likewise. - * include/grub/i386/pc/memory.h: Likewise. - * include/grub/i386/pc/vbe.h: Likewise. - * include/grub/i386/pci.h: Likewise. - * include/grub/i386/tsc.h: Likewise. - * include/grub/ieee1275/ieee1275.h: Likewise. - * include/grub/ntfs.h: Likewise. - * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. - * include/grub/sparc64/libgcc.h: Likewise. - * include/grub/symbol.h: Likewise. - * include/grub/types.h: Likewise. + * include/VasEBoot/disk.h: Likewise. + * include/VasEBoot/efi/api.h: Likewise. + * include/VasEBoot/efi/efi.h: Likewise. + * include/VasEBoot/efi/pe32.h: Likewise. + * include/VasEBoot/elf.h: Likewise. + * include/VasEBoot/fs.h: Likewise. + * include/VasEBoot/i386/at_keyboard.h: Likewise. + * include/VasEBoot/i386/pc/memory.h: Likewise. + * include/VasEBoot/i386/pc/vbe.h: Likewise. + * include/VasEBoot/i386/pci.h: Likewise. + * include/VasEBoot/i386/tsc.h: Likewise. + * include/VasEBoot/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/ntfs.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/sparc64/libgcc.h: Likewise. + * include/VasEBoot/symbol.h: Likewise. + * include/VasEBoot/types.h: Likewise. * include/multiboot2.h: Likewise. * io/gzio.c: Likewise. * kern/device.c: Likewise. @@ -32650,15 +32650,15 @@ * normal/completion.c: Likewise. * normal/menu_entry.c: Likewise. * partmap/apple.c: Likewise. - * util/grub.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. * util/hostfs.c: Likewise. * video/readers/png.c: Likewise. 2010-01-03 Colin Watson - * include/grub/misc.h (GNUC_PREREQ): New macro. + * include/VasEBoot/misc.h (GNUC_PREREQ): New macro. (ATTRIBUTE_ERROR): New macro. - * include/grub/list.h (grub_bad_type_cast_real): Use + * include/VasEBoot/list.h (VasEBoot_bad_type_cast_real): Use ATTRIBUTE_ERROR. 2010-01-03 Carles Pina i Estany @@ -32671,7 +32671,7 @@ 2010-01-03 Carles Pina i Estany - * kern/env.c (grub_env_unset): Set the variable to "" if has hooks. + * kern/env.c (VasEBoot_env_unset): Set the variable to "" if has hooks. 2010-01-03 Carles Pina i Estany @@ -32679,27 +32679,27 @@ 2010-01-03 Carles Pina i Estany - * commands/acpi.c (GRUB_MOD_INIT): Capitalise some words from help. - * commands/efi/loadbios.c (GRUB_MOD_INIT): Capitalise BIOS. - * commands/i386/pc/drivemap.c (GRUB_MOD_INIT): Remove space. Add + * commands/acpi.c (VasEBoot_MOD_INIT): Capitalise some words from help. + * commands/efi/loadbios.c (VasEBoot_MOD_INIT): Capitalise BIOS. + * commands/i386/pc/drivemap.c (VasEBoot_MOD_INIT): Remove space. Add full stop. - * commands/loadenv.c (GRUB_MOD_INIT): Remove command name from + * commands/loadenv.c (VasEBoot_MOD_INIT): Remove command name from summary. Gettextizze the strings. - * commands/probe.c (grub_cmd_probe): Capitalise UUID and FS. - * commands/xnu_uuid.c (GRUB_MOD_INIT): Capitalise XNU. - * disk/loopback.c (grub_arg_options): Capitalise first letter. Add + * commands/probe.c (VasEBoot_cmd_probe): Capitalise UUID and FS. + * commands/xnu_uuid.c (VasEBoot_MOD_INIT): Capitalise XNU. + * disk/loopback.c (VasEBoot_arg_options): Capitalise first letter. Add full stop. - (GRUB_MOD_INIT): Remove command name from summary. + (VasEBoot_MOD_INIT): Remove command name from summary. * hello/hello.c (GRUD_MOT_INIT): Add missing full stop. Improve the summary. - * loader/i386/bsd.c (grub_arg_option): Capitalise CDROM. + * loader/i386/bsd.c (VasEBoot_arg_option): Capitalise CDROM. * term/i386/pc/serial.c (options): Add full stops. - (GRUB_MOD_INIT): Remove command name from the summary. + (VasEBoot_MOD_INIT): Remove command name from the summary. 2010-01-03 Carles Pina i Estany * commands/acpi.c: Gettextizze help strings and/or options. Include - `grub/i18n.h' if needed. + `VasEBoot/i18n.h' if needed. * commands/blocklist.c: Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. @@ -32755,16 +32755,16 @@ 2010-01-01 Carles Pina i Estany - * commands/help.c: Include `grub/mm.h' and `grub/normal.h'. - (grub_cmd_help): Print the cmd->name before the cmd->summary. Cut the + * commands/help.c: Include `VasEBoot/mm.h' and `VasEBoot/normal.h'. + (VasEBoot_cmd_help): Print the cmd->name before the cmd->summary. Cut the string using string width. - * normal/menu_text.c (grub_print_message_indented): Use - grub_print_spaces and not print_spaces. + * normal/menu_text.c (VasEBoot_print_message_indented): Use + VasEBoot_print_spaces and not print_spaces. (print_timeout): Likewise. (print_spaces): Move to... - * include/grub/term.h: ... here. Change the name to grub_print_spaces. + * include/VasEBoot/term.h: ... here. Change the name to VasEBoot_print_spaces. -2010-01-01 Robert Millan +2010-01-01 Robert Millan Import from Gnulib. @@ -32773,23 +32773,23 @@ 2009-12-31 BVK Chaitanya - * include/grub/list.h (grub_assert_fail): Removed. - (grub_bad_type_cast_real): New function. - (grub_bad_type_cast): New macro. - (GRUB_AS_LIST): Use grub_bad_type_cast. - (GRUB_AS_LIST_P): Likewise. - (GRUB_AS_NAMED_LIST): Likewise. - (GRUB_AS_NAMED_LIST_P): Likewise. - (GRUB_AS_PRIO_LIST): Likewise. - (GRUB_AS_PRIO_LIST_P): Likewise. - * include/grub/handler.h (GRUB_AS_HANDLER): Likewise. + * include/VasEBoot/list.h (VasEBoot_assert_fail): Removed. + (VasEBoot_bad_type_cast_real): New function. + (VasEBoot_bad_type_cast): New macro. + (VasEBoot_AS_LIST): Use VasEBoot_bad_type_cast. + (VasEBoot_AS_LIST_P): Likewise. + (VasEBoot_AS_NAMED_LIST): Likewise. + (VasEBoot_AS_NAMED_LIST_P): Likewise. + (VasEBoot_AS_PRIO_LIST): Likewise. + (VasEBoot_AS_PRIO_LIST_P): Likewise. + * include/VasEBoot/handler.h (VasEBoot_AS_HANDLER): Likewise. 2009-12-29 Vladimir Serbinenko - * loader/sparc64/ieee1275/linux.c (GRUB_MOD_INIT (linux)): + * loader/sparc64/ieee1275/linux.c (VasEBoot_MOD_INIT (linux)): Fix syntax error. -2009-12-29 Robert Millan +2009-12-29 Robert Millan * configure.ac: Check for TARGET_CFLAGS initialization before we initialize it ourselves (sigh). @@ -32797,7 +32797,7 @@ (extra warning flags, loop alignment, i386 CPU extensions, GCC 4.4 eh_frame) - * gettext/gettext.c (grub_gettext_delete_list): Add `void' argument. + * gettext/gettext.c (VasEBoot_gettext_delete_list): Add `void' argument. * term/i386/pc/at_keyboard.c (keyboard_controller_wait_untill_ready): Likewise. (keyboard_controller_led): Rename `led_status' paramter to avoid @@ -32805,131 +32805,131 @@ 2009-12-28 Carles Pina i Estany - * normal/misc.c (grub_normal_print_device_info): Add spaces and double + * normal/misc.c (VasEBoot_normal_print_device_info): Add spaces and double quotes. 2009-12-27 Vladimir Serbinenko - * kern/parser.c (grub_parser_split_cmdline): Don't dereference NULL. + * kern/parser.c (VasEBoot_parser_split_cmdline): Don't dereference NULL. 2009-12-27 Vladimir Serbinenko - * normal/menu_text.c (grub_print_message_indented): Prevent + * normal/menu_text.c (VasEBoot_print_message_indented): Prevent past-the-end-of-array dereference. 2009-12-27 Vladimir Serbinenko - * video/readers/jpeg.c (GRUB_MOD_FINI (grub_cmd_jpegtest)): Rename to .. - (GRUB_MOD_FINI (video_reader_jpeg)): ...this + * video/readers/jpeg.c (VasEBoot_MOD_FINI (VasEBoot_cmd_jpegtest)): Rename to .. + (VasEBoot_MOD_FINI (video_reader_jpeg)): ...this 2009-12-27 Carles Pina i Estany - * normal/cmdline.c (grub_cmdline_get): Print a space after prompt. - * normal/main.c (grub_normal_read_line): Remove a space from the + * normal/cmdline.c (VasEBoot_cmdline_get): Print a space after prompt. + * normal/main.c (VasEBoot_normal_read_line): Remove a space from the default prompt. 2009-12-27 Carles Pina i Estany - * loader/i386/efi/linux.c (GRUB_MOD_INIT): Improve command summary. - * loader/i386/ieee1275/linux.c (GRUB_MOD_INIT): Likewise. - * loader/i386/linux.c (GRUB_MOD_INIT): Likewise. - * loader/i386/pc/linux.c (GRUB_MOD_INIT): Likewise. - * loader/powerpc/ieee1275/linux.c (GRUB_MOD_INIT): Likewise. - * loader/sparc64/ieee1275/linux.c (GRUB_MOD_INIT): Likewise. - * loader/xnu.c (GRUB_MOD_INIT): Likewise. + * loader/i386/efi/linux.c (VasEBoot_MOD_INIT): Improve command summary. + * loader/i386/ieee1275/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/pc/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/powerpc/ieee1275/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/sparc64/ieee1275/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/xnu.c (VasEBoot_MOD_INIT): Likewise. 2009-12-26 Carles Pina i Estany * video/readers/jpeg.c (cmd): Declare. - (grub_cmd_jpegtest): Use `grub_command_t' type. - (GRUB_MOD_INIT): Fix arguments passed to `grub_register_command'. + (VasEBoot_cmd_jpegtest): Use `VasEBoot_command_t' type. + (VasEBoot_MOD_INIT): Fix arguments passed to `VasEBoot_register_command'. Assign to `cmd'. - (GRUB_MOD_FINI): Use `cmd' to unregister. + (VasEBoot_MOD_FINI): Use `cmd' to unregister. * video/readers/png.c (cmd): Declare. - (grub_cmd_pngtest): Use `grub_command_t' type. - (GRUB_MOD_INIT): Fix arguments passed to `grub_register_command'. + (VasEBoot_cmd_pngtest): Use `VasEBoot_command_t' type. + (VasEBoot_MOD_INIT): Fix arguments passed to `VasEBoot_register_command'. Assign to `cmd'. - (GRUB_MOD_FINI): Use `cmd' to unregister. + (VasEBoot_MOD_FINI): Use `cmd' to unregister. * video/readers/tga.c (cmd): Declare. - (grub_cmd_tgatest): Use `grub_command_t' type. - (GRUB_MOD_INIT): Fix arguments passed to `grub_register_command'. + (VasEBoot_cmd_tgatest): Use `VasEBoot_command_t' type. + (VasEBoot_MOD_INIT): Fix arguments passed to `VasEBoot_register_command'. Assign to `cmd'. - (GRUB_MOD_FINI): Use `cmd' to unregister. + (VasEBoot_MOD_FINI): Use `cmd' to unregister. 2009-12-26 Carles Pina i Estany - * efiemu/main.c (GRUB_MOD_INIT): Fix capitalizations and/or full + * efiemu/main.c (VasEBoot_MOD_INIT): Fix capitalizations and/or full stops. - * kern/corecmd.c (grub_register_core_commands): Likewise. - * loader/efi/chainloader.c (GRUB_MOD_INIT): Likewise. - * loader/i386/bsd.c (GRUB_MOD_INIT): Likewise. - * loader/i386/efi/linux.c (GRUB_MOD_INIT): Likewise. - * loader/i386/ieee1275/linux.c (GRUB_MOD_INIT): Likewise. - * loader/i386/linux.c (GRUB_MOD_INIT): Likewise. - * loader/i386/pc/chainloader.c (GRUB_MOD_INIT): Likewise. - * loader/i386/pc/linux.c (GRUB_MOD_INIT): Likewise. - * loader/multiboot_loader.c (GRUB_MOD_INIT): Likewise. - * loader/powerpc/ieee1275/linux.c (GRUB_MOD_INIT): Likewise. - * loader/sparc64/ieee1275/linux.c (GRUB_MOD_INIT): Likewise. - * loader/xnu.c (GRUB_MOD_INIT): Likewise. - * mmap/mmap.c (GRUB_MOD_INIT): Likewise. + * kern/corecmd.c (VasEBoot_register_core_commands): Likewise. + * loader/efi/chainloader.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/bsd.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/efi/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/ieee1275/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/pc/chainloader.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/pc/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/multiboot_loader.c (VasEBoot_MOD_INIT): Likewise. + * loader/powerpc/ieee1275/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/sparc64/ieee1275/linux.c (VasEBoot_MOD_INIT): Likewise. + * loader/xnu.c (VasEBoot_MOD_INIT): Likewise. + * mmap/mmap.c (VasEBoot_MOD_INIT): Likewise. * normal/handler.c (insert_handler): Likewise. - * normal/main.c (GRUB_MOD_INIT): Likewise. - * term/gfxterm.c (GRUB_MOD_INIT): Likewise. + * normal/main.c (VasEBoot_MOD_INIT): Likewise. + * term/gfxterm.c (VasEBoot_MOD_INIT): Likewise. 2009-12-26 Carles Pina i Estany - * commands/help.c (grub_cmd_help): Print the command name before the + * commands/help.c (VasEBoot_cmd_help): Print the command name before the summary. - (GRUB_MOD_INIT): Remove command name from the summary. - * kern/command.c (GRUB_MOD_INIT): If summary is null assign an empty + (VasEBoot_MOD_INIT): Remove command name from the summary. + * kern/command.c (VasEBoot_MOD_INIT): If summary is null assign an empty string as summary. * lib/arg.c (find_long): Print the command name before the summary. - * commands/acpi.c (GRUB_MOD_INIT): Remove command name from the + * commands/acpi.c (VasEBoot_MOD_INIT): Remove command name from the summary. - * commands/blocklist.c (GRUB_MOD_INIT): Likewise. - * commands/cat.c (GRUB_MOD_INIT): Likewise. - * commands/cmp.c (GRUB_MOD_INIT): Likewise. - * commands/configfile.c (GRUB_MOD_INIT): Likewise. - * commands/crc.c (GRUB_MOD_INIT): Likewise. - * commands/date.c (GRUB_MOD_INIT): Likewise. - * commands/echo.c (GRUB_MOD_INIT): Likewise. - * commands/efi/loadbios.c (GRUB_MOD_INIT): Likewise. - * commands/gptsync.c (GRUB_MOD_INIT): Likewise. - * commands/handler.c (GRUB_MOD_INIT): Likewise. - * commands/hdparm.c (GRUB_MOD_INIT): Likewise. - * commands/hexdump.c (GRUB_MOD_INIT): Likewise. - * commands/i386/cpuid.c (GRUB_MOD_INIT): Likewise. - * commands/i386/pc/halt.c (GRUB_MOD_INIT): Likewise. - * commands/i386/pc/play.c (GRUB_MOD_INIT): Likewise. - * commands/i386/pc/pxecmd.c (GRUB_MOD_INIT): Likewise. - * commands/keystatus.c (GRUB_MOD_INIT): Likewise. - * commands/loadenv.c (GRUB_MOD_INIT): Likewise. - * commands/ls.c (GRUB_MOD_INIT): Likewise. - * commands/lspci.c (GRUB_MOD_INIT): Likewise. - * commands/memrw.c (GRUB_MOD_INIT): Likewise. - * commands/minicmd.c (GRUB_MOD_INIT): Likewise. - * commands/parttool.c (GRUB_MOD_INIT): Likewise. - * commands/password.c (GRUB_MOD_INIT): Likewise. - * commands/probe.c (GRUB_MOD_INIT): Likewise. - * commands/read.c (GRUB_MOD_INIT): Likewise. - * commands/search.c (GRUB_MOD_INIT): Likewise. - * commands/sleep.c (GRUB_MOD_INIT): Likewise. - * commands/test.c (GRUB_MOD_INIT): Likewise. - * commands/xnu_uuid.c (GRUB_MOD_INIT): Likewise. - * efiemu/main.c (GRUB_MOD_INIT): Likewise. - * font/font_cmd.c (GRUB_MOD_INIT): Likewise. - * gettext/gettext.c (GRUB_MOD_INIT): Likewise. - * kern/corecmd.c (GRUB_MOD_INIT): Likewise. - * lib/arg.c (GRUB_MOD_INIT): Likewise. - * loader/efi/appleloader.c (GRUB_MOD_INIT): Likewise. - * loader/i386/bsd.c (GRUB_MOD_INIT): Likewise. - * loader/xnu.c (GRUB_MOD_INIT): Likewise. - * mmap/mmap.c (GRUB_MOD_INIT): Likewise. - * term/terminfo.c (GRUB_MOD_INIT): Likewise. - * video/readers/jpeg.c (GRUB_MOD_INIT): Likewise. - * video/readers/png.c (GRUB_MOD_INIT): Likewise. - * video/readers/tga.c (GRUB_MOD_INIT): Likewise. + * commands/blocklist.c (VasEBoot_MOD_INIT): Likewise. + * commands/cat.c (VasEBoot_MOD_INIT): Likewise. + * commands/cmp.c (VasEBoot_MOD_INIT): Likewise. + * commands/configfile.c (VasEBoot_MOD_INIT): Likewise. + * commands/crc.c (VasEBoot_MOD_INIT): Likewise. + * commands/date.c (VasEBoot_MOD_INIT): Likewise. + * commands/echo.c (VasEBoot_MOD_INIT): Likewise. + * commands/efi/loadbios.c (VasEBoot_MOD_INIT): Likewise. + * commands/gptsync.c (VasEBoot_MOD_INIT): Likewise. + * commands/handler.c (VasEBoot_MOD_INIT): Likewise. + * commands/hdparm.c (VasEBoot_MOD_INIT): Likewise. + * commands/hexdump.c (VasEBoot_MOD_INIT): Likewise. + * commands/i386/cpuid.c (VasEBoot_MOD_INIT): Likewise. + * commands/i386/pc/halt.c (VasEBoot_MOD_INIT): Likewise. + * commands/i386/pc/play.c (VasEBoot_MOD_INIT): Likewise. + * commands/i386/pc/pxecmd.c (VasEBoot_MOD_INIT): Likewise. + * commands/keystatus.c (VasEBoot_MOD_INIT): Likewise. + * commands/loadenv.c (VasEBoot_MOD_INIT): Likewise. + * commands/ls.c (VasEBoot_MOD_INIT): Likewise. + * commands/lspci.c (VasEBoot_MOD_INIT): Likewise. + * commands/memrw.c (VasEBoot_MOD_INIT): Likewise. + * commands/minicmd.c (VasEBoot_MOD_INIT): Likewise. + * commands/parttool.c (VasEBoot_MOD_INIT): Likewise. + * commands/password.c (VasEBoot_MOD_INIT): Likewise. + * commands/probe.c (VasEBoot_MOD_INIT): Likewise. + * commands/read.c (VasEBoot_MOD_INIT): Likewise. + * commands/search.c (VasEBoot_MOD_INIT): Likewise. + * commands/sleep.c (VasEBoot_MOD_INIT): Likewise. + * commands/test.c (VasEBoot_MOD_INIT): Likewise. + * commands/xnu_uuid.c (VasEBoot_MOD_INIT): Likewise. + * efiemu/main.c (VasEBoot_MOD_INIT): Likewise. + * font/font_cmd.c (VasEBoot_MOD_INIT): Likewise. + * gettext/gettext.c (VasEBoot_MOD_INIT): Likewise. + * kern/corecmd.c (VasEBoot_MOD_INIT): Likewise. + * lib/arg.c (VasEBoot_MOD_INIT): Likewise. + * loader/efi/appleloader.c (VasEBoot_MOD_INIT): Likewise. + * loader/i386/bsd.c (VasEBoot_MOD_INIT): Likewise. + * loader/xnu.c (VasEBoot_MOD_INIT): Likewise. + * mmap/mmap.c (VasEBoot_MOD_INIT): Likewise. + * term/terminfo.c (VasEBoot_MOD_INIT): Likewise. + * video/readers/jpeg.c (VasEBoot_MOD_INIT): Likewise. + * video/readers/png.c (VasEBoot_MOD_INIT): Likewise. + * video/readers/tga.c (VasEBoot_MOD_INIT): Likewise. 2009-12-25 Vladimir Serbinenko @@ -32941,7 +32941,7 @@ * commands/search_file.c: New file. * commands/search_label.c: New file. * commands/search_uuid.c: New file. - * conf/any-emu.rmk (grub_emu_SOURCES): Remove commands/search.c. + * conf/any-emu.rmk (VasEBoot_emu_SOURCES): Remove commands/search.c. Add commands/search_wrap.c, commands/search_file.c, commands/search_label.c and commands/search_uuid.c. * conf/common.rmk (pkglib_MODULES): Remove fs_uuid.mod and fs_file.mod. @@ -32963,26 +32963,26 @@ (fs_uuid_mod_SOURCES): Removed. (fs_uuid_mod_CFLAGS): Likewise. (fs_uuid_mod_LDFLAGS): Likewise. - * conf/sparc64-ieee1275.rmk (grub_install_SOURCES): - Set to util/grub-install.in. + * conf/sparc64-ieee1275.rmk (VasEBoot_install_SOURCES): + Set to util/VasEBoot-install.in. * disk/fs_file.c: Removed. * disk/fs_uuid.c: Likewise. - * include/grub/search.h: New file. - * util/grub-install.in: Handle sparc64. + * include/VasEBoot/search.h: New file. + * util/VasEBoot-install.in: Handle sparc64. Create and use load.cfg. - * util/sparc64/ieee1275/grub-install.in: Removed. + * util/sparc64/ieee1275/VasEBoot-install.in: Removed. 2009-12-25 Vladimir Serbinenko - * kern/i386/pc/startup.S (grub_biosdisk_get_diskinfo_int13_extensions): + * kern/i386/pc/startup.S (VasEBoot_biosdisk_get_diskinfo_int13_extensions): Ignore return status if CF is cleared. - (grub_biosdisk_get_diskinfo_standard): Likewise. + (VasEBoot_biosdisk_get_diskinfo_standard): Likewise. -2009-12-25 Robert Millan +2009-12-25 Robert Millan * term/i386/pc/at_keyboard.c (keyboard_controller_wait_untill_ready): New function. - (grub_keyboard_controller_write, grub_keyboard_controller_read) + (VasEBoot_keyboard_controller_write, VasEBoot_keyboard_controller_read) (keyboard_controller_led): Use keyboard_controller_wait_untill_ready() for keyboard polling, rather than duplicate the same loop. This saves a few bytes in code size. @@ -32994,88 +32994,88 @@ * commands/i386/pc/pxecmd.c (options): Removed. (print_ip): Removed. - (grub_cmd_pxe): Removed - (grub_cmd_pxe_unload): New function. - * fs/i386/pc/pxe.c (grub_pxe_disk_data): New structure. - (grub_pxe_your_ip): Made static. - (grub_pxe_default_server_ip): Likewise. - (grub_pxe_default_gateway_ip): Likewise. - (grub_pxe_blksize): Likewise. + (VasEBoot_cmd_pxe): Removed + (VasEBoot_cmd_pxe_unload): New function. + * fs/i386/pc/pxe.c (VasEBoot_pxe_disk_data): New structure. + (VasEBoot_pxe_your_ip): Made static. + (VasEBoot_pxe_default_server_ip): Likewise. + (VasEBoot_pxe_default_gateway_ip): Likewise. + (VasEBoot_pxe_blksize): Likewise. (parse_ip): New function. - (grub_pxe_open): Support server and gateway specification. - (grub_pxe_close): Free disk->data. - (grub_pxefs_open): Use disk->data. - (grub_pxefs_read): Likewise. - (grub_env_write_readonly): New function. + (VasEBoot_pxe_open): Support server and gateway specification. + (VasEBoot_pxe_close): Free disk->data. + (VasEBoot_pxefs_open): Use disk->data. + (VasEBoot_pxefs_read): Likewise. + (VasEBoot_env_write_readonly): New function. (set_mac_env): Likewise. (set_env_limn_ro): Likewise. (parse_dhcp_vendor): Likewise. - (grub_pxe_detect): Set the environment variables. + (VasEBoot_pxe_detect): Set the environment variables. (set_ip_env): New function. (write_ip_env): Likewise. - (grub_env_write_pxe_default_server): Likewise. - (grub_env_write_pxe_default_gateway): Likewise. - (grub_env_write_pxe_blocksize): Likewise. - (GRUB_MOD_INIT(pxe)): Set environment variables. - * include/grub/i386/pc/pxe.h (grub_pxe_mac_addr): Rename to ... - (grub_pxe_mac_addr_t): ... this. All users updated. - (grub_pxe_your_ip): Removed. - (grub_pxe_server_ip): Likewise. - (grub_pxe_gateway_ip): Likewise. - (grub_pxe_blksize): Likewise. + (VasEBoot_env_write_pxe_default_server): Likewise. + (VasEBoot_env_write_pxe_default_gateway): Likewise. + (VasEBoot_env_write_pxe_blocksize): Likewise. + (VasEBoot_MOD_INIT(pxe)): Set environment variables. + * include/VasEBoot/i386/pc/pxe.h (VasEBoot_pxe_mac_addr): Rename to ... + (VasEBoot_pxe_mac_addr_t): ... this. All users updated. + (VasEBoot_pxe_your_ip): Removed. + (VasEBoot_pxe_server_ip): Likewise. + (VasEBoot_pxe_gateway_ip): Likewise. + (VasEBoot_pxe_blksize): Likewise. 2009-12-25 Carles Pina i Estany - * commands/help.c: Include `'. - (grub_cmd_help): Gettextizze. - (GRUB_MOD_INIT): Likewise. - * commands/i386/pc/play.c: Include `'. - (GRUB_MOD_INIT): Gettextizze. - * commands/search.c: Include `'. + * commands/help.c: Include `'. + (VasEBoot_cmd_help): Gettextizze. + (VasEBoot_MOD_INIT): Likewise. + * commands/i386/pc/play.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * commands/search.c: Include `'. (options): Gettextizze. - (GRUB_MOD_INIT): Gettextizze. - * lib/arg.c: Include `'. + (VasEBoot_MOD_INIT): Gettextizze. + * lib/arg.c: Include `'. (help_options): Gettextizze. (find_long): Likewise. - (grub_arg_show_help): Likewise. - * normal/dyncmd.c: Include `'. + (VasEBoot_arg_show_help): Likewise. + * normal/dyncmd.c: Include `'. (read_command_list): Gettextizze. * po/POTFILES: Add `commands/i386/pc/play.c', `commands/search.c', `commands/help.c', `lib/arg.c' and `normal/dyncmd.c'. -2009-12-25 Robert Millan +2009-12-25 Robert Millan - * include/grub/i386/at_keyboard.h (NUM_LOCK, SCROLL_LOCK): New macros. + * include/VasEBoot/i386/at_keyboard.h (NUM_LOCK, SCROLL_LOCK): New macros. * term/i386/pc/at_keyboard.c (KEYBOARD_STATUS_NUM_LOCK) (KEYBOARD_LED_SCROLL, KEYBOARD_LED_NUM, KEYBOARD_LED_CAPS): New macros. (led_status): New variable. (keyboard_controller_led): New function. - (grub_at_keyboard_getkey_noblock): Handle num lock and scroll lock, + (VasEBoot_at_keyboard_getkey_noblock): Handle num lock and scroll lock, update led status for caps lock, num lock and scroll lock. 2009-12-25 Felix Zielcke * util/hostdisk.c (open_device): Fix a comment. -2009-12-24 Robert Millan +2009-12-24 Robert Millan - * util/grub-install.in (host_os): New variable. - * util/i386/efi/grub-install.in (host_os): Likewise. + * util/VasEBoot-install.in (host_os): New variable. + * util/i386/efi/VasEBoot-install.in (host_os): Likewise. -2009-12-24 Robert Millan +2009-12-24 Robert Millan * util/mkisofs/write.c (padblock_write): Abort when given an excedingly large embed image, instead of silently truncating it. -2009-12-24 Robert Millan +2009-12-24 Robert Millan * include/multiboot.h: Indentation fixes. -2009-12-24 Robert Millan +2009-12-24 Robert Millan * include/multiboot.h (struct multiboot_aout_symbol_table) (struct multiboot_elf_section_header_table): New structure - declarations (stolen from GRUB Legacy). + declarations (stolen from VasEBoot Legacy). (struct multiboot_info): Replace opaque `syms' with a.out and ELF table information. @@ -33083,11 +33083,11 @@ (multiboot_info_t, multiboot_memory_map_t, multiboot_module_t): New type aliases. -2009-12-24 Robert Millan +2009-12-24 Robert Millan * include/multiboot.h: Make comments src2texi-friendly. -2009-12-24 Robert Millan +2009-12-24 Robert Millan For consistency with [multiboot]/docs/boot.S. @@ -33096,9 +33096,9 @@ (MULTIBOOT_MAGIC2): Rename from this ... (MULTIBOOT_BOOTLOADER_MAGIC): ... to this. Update all users. -2009-12-24 Robert Millan +2009-12-24 Robert Millan - * include/multiboot.h: Remove `'. + * include/multiboot.h: Remove `'. (multiboot_uint16_t, multiboot_uint32_t, multiboot_uint64_t): New types. Update all users. @@ -33123,13 +33123,13 @@ * fs/xfs.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. - * util/grub-probe.c: Likewise. + * util/VasEBoot-probe.c: Likewise. * util/misc.c: Likewise. 2009-12-24 Carles Pina i Estany * bus/usb/usbhub.c: Fix capitalization, fullstop and newlines in - grub_errno calls. + VasEBoot_errno calls. * commands/acpi.c: Likewise. * commands/blocklist.c: Likewise. * commands/efi/loadbios.c: Likewise. @@ -33165,7 +33165,7 @@ * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * gettext/gettext.c: Likewise. - * include/grub/auth.h: Likewise. + * include/VasEBoot/auth.h: Likewise. * kern/elf.c: Likewise. * kern/file.c: Likewise. * kern/ieee1275/init.c: Likewise. @@ -33227,8 +33227,8 @@ * conf/x86_64-efi.rmk: Likewise. * fs/i386/pc/pxe.c: Likewise. * gettext/gettext.c: Likewise. - * include/grub/efi/graphics_output.h: Likewise. - * include/grub/i386/pc/memory.h: Likewise. + * include/VasEBoot/efi/graphics_output.h: Likewise. + * include/VasEBoot/i386/pc/memory.h: Likewise. * kern/env.c: Likewise. * kern/i386/qemu/startup.S: Likewise. * lib/i386/pc/biosnum.c: Likewise. @@ -33243,9 +33243,9 @@ * normal/main.c: Likewise. * normal/menu_text.c: Likewise. * util/getroot.c: Likewise. - * util/grub-mkconfig_lib.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/i386/pc/grub-mkimage.c: Likewise. + * util/VasEBoot-mkconfig_lib.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/i386/pc/VasEBoot-mkimage.c: Likewise. * util/mkisofs/eltorito.c: Likewise. * util/mkisofs/exclude.h: Likewise. * util/mkisofs/hash.c: Likewise. @@ -33262,26 +33262,26 @@ 2009-12-23 Vladimir Serbinenko - * video/efi_gop.c (grub_video_gop_get_bitmask): Fix off-by-one in mask + * video/efi_gop.c (VasEBoot_video_gop_get_bitmask): Fix off-by-one in mask size counting. 2009-12-22 Felix Zielcke - * util/grub-mkrescue.in (pkglib_DATA): Set to @pkglib_DATA@. + * util/VasEBoot-mkrescue.in (pkglib_DATA): Set to @pkglib_DATA@. * genmk.rb (class SCRIPT): Modify the target file instead of source. 2009-12-22 Vladimir Serbinenko - * commands/memrw.c (grub_cmd_write): Support for mask parameter. - (GRUB_MOD_INIT(memrw)): Update help line. + * commands/memrw.c (VasEBoot_cmd_write): Support for mask parameter. + (VasEBoot_MOD_INIT(memrw)): Update help line. 2009-12-22 Vladimir Serbinenko * commands/memrw.c (cmd_read_byte, cmd_read_word, cmd_read_dword): - Use grub_extcmd_t. All users updated. + Use VasEBoot_extcmd_t. All users updated. (options): New variable. - (grub_cmd_read): Restructure for readability. Support "-v" option. - (grub_cmd_write): Restructure for readability. + (VasEBoot_cmd_read): Restructure for readability. Support "-v" option. + (VasEBoot_cmd_write): Restructure for readability. 2009-12-22 Felix Zielcke @@ -33291,81 +33291,81 @@ * genmk.rb (class SCRIPT): Use sed to substitute @pkglib_DATA@ with the actual contents of the correspondending make variable. - * util/grub-mkrescue.in (pkglib_DATA): New variable. + * util/VasEBoot-mkrescue.in (pkglib_DATA): New variable. (process_input_dir): Copy all $pkglib_DATA files instead of explicitly specifying `*.lst' and `efiemu??.o' 2009-12-22 Felix Zielcke - * util/grub.d/30_os-prober.in (osx_entry): Add round brackets + * util/VasEBoot.d/30_os-prober.in (osx_entry): Add round brackets after function name. Noticed by Rene Engelhard . 2009-12-22 Vladimir Serbinenko - * commands/lspci.c (grub_pci_classes): Add "USB Controller". + * commands/lspci.c (VasEBoot_pci_classes): Add "USB Controller". (options): New variable. (iospace): Likewise. - (grub_lspci_iter): List IO spaces if "-i" was given. - (grub_cmd_lspci): Parse options. - (GRUB_MOD_INIT(lspci)): Use extcmd. - (GRUB_MOD_FINI(lspci)): Likewise. + (VasEBoot_lspci_iter): List IO spaces if "-i" was given. + (VasEBoot_cmd_lspci): Parse options. + (VasEBoot_MOD_INIT(lspci)): Use extcmd. + (VasEBoot_MOD_FINI(lspci)): Likewise. 2009-12-22 Felix Zielcke - * util/grub.d/30_os-prober.in (osx_entry): Remove non POSIX compliant + * util/VasEBoot.d/30_os-prober.in (osx_entry): Remove non POSIX compliant `function' keyword. Patch by Tony Mancill . 2009-12-22 Vladimir Serbinenko - * bus/usb/uhci.c (grub_uhci_transfer): Set a limit transaction time. - (grub_uhci_portstatus): Likewise. - (grub_uhci_portstatus): Add necessary delay. - * bus/usb/usbhub.c (grub_usb_hub_add_dev): Fix loop-break condition. + * bus/usb/uhci.c (VasEBoot_uhci_transfer): Set a limit transaction time. + (VasEBoot_uhci_portstatus): Likewise. + (VasEBoot_uhci_portstatus): Add necessary delay. + * bus/usb/usbhub.c (VasEBoot_usb_hub_add_dev): Fix loop-break condition. 2009-12-21 Carles Pina i Estany * commands/acpi.c (options): Fix capitalizations and/or full stops. - (GRUB_MOD_INIT): Likewise. - * commands/boot.c (GRUB_MOD_INIT): Likewise. - * commands/cmp.c (grub_cmd_cmp): Improve the help message. + (VasEBoot_MOD_INIT): Likewise. + * commands/boot.c (VasEBoot_MOD_INIT): Likewise. + * commands/cmp.c (VasEBoot_cmd_cmp): Improve the help message. * commands/echo.c (options): Fix capitalizations and/or full stops. * commands/efi/loadbios.c (enable_rom_area): Likewise. (enable_rom_area): Likewise. - (GRUB_MOD_INIT): Likewise. - * commands/gptsync.c (GRUB_MOD_INIT): Likewise. - * commands/halt.c (GRUB_MOD_INIT): Improve the help message. - * commands/handler.c (GRUB_MOD_INIT): Likewise. + (VasEBoot_MOD_INIT): Likewise. + * commands/gptsync.c (VasEBoot_MOD_INIT): Likewise. + * commands/halt.c (VasEBoot_MOD_INIT): Improve the help message. + * commands/handler.c (VasEBoot_MOD_INIT): Likewise. * commands/hdparm.c (options): Fix capitalizations and/or full stops. * commands/hexdump.c (options): Likewise. * commands/i386/cpuid.c (options): Likewise. - (GRUB_MOD_INIT): Likewise. + (VasEBoot_MOD_INIT): Likewise. * commands/i386/pc/drivemap.c (options): Likewise. - (GRUB_MOD_INIT): Likewise. + (VasEBoot_MOD_INIT): Likewise. * commands/i386/pc/halt (options): Likewise. - (GRUB_MOD_INIT): Likewise. - * commands/i386/pc/play.c (GRUB_MOD_INIT): Likewise. + (VasEBoot_MOD_INIT): Likewise. + * commands/i386/pc/play.c (VasEBoot_MOD_INIT): Likewise. * commands/i386/pc/pxecmd.c (options): Likewise. - * commands/i386/pc/vbetest.c (GRUB_MOD_INIT): Likewise. - * commands/ieee1275/suspend.c (GRUB_MOD_INIT): Likewise. + * commands/i386/pc/vbetest.c (VasEBoot_MOD_INIT): Likewise. + * commands/ieee1275/suspend.c (VasEBoot_MOD_INIT): Likewise. * commands/keystatus.c (options): Likewise. - (GRUB_MOD_INIT): Likewise. + (VasEBoot_MOD_INIT): Likewise. * commands/loadenv.c (options): Likewise. * commands/ls.c (options): Likewise. - * commands/lspci.c (GRUB_MOD_INIT): Likewise. - * commands/memrw.c (GRUB_MOD_INIT): Likewise. - * commands/minicmd.c (GRUB_MOD_INIT): Likewise. + * commands/lspci.c (VasEBoot_MOD_INIT): Likewise. + * commands/memrw.c (VasEBoot_MOD_INIT): Likewise. + * commands/minicmd.c (VasEBoot_MOD_INIT): Likewise. * commands/parttool.c (helpmsg): Likewise. * commands/probe.c (options): Likewise. - * commands/read.c (GRUB_MOD_INIT): Likewise. - * commands/reboot.c (GRUB_MOD_INIT): Likewise. + * commands/read.c (VasEBoot_MOD_INIT): Likewise. + * commands/reboot.c (VasEBoot_MOD_INIT): Likewise. * commands/search.c (options): Likewise. * commands/sleep.c (options): Likewise. - * commands/test.c (GRUB_MOD_INIT): Likewise. - * commands/true.c (GRUB_MOD_INIT): Likewise. - * commands/usbtest.c (GRUB_MOD_INIT): Likewise. - * commands/videotest.c (GRUB_MOD_INIT): Likewise. + * commands/test.c (VasEBoot_MOD_INIT): Likewise. + * commands/true.c (VasEBoot_MOD_INIT): Likewise. + * commands/usbtest.c (VasEBoot_MOD_INIT): Likewise. + * commands/videotest.c (VasEBoot_MOD_INIT): Likewise. * lib/arg.c (help_options): Likewise. * Makefile.in ($(srcdir)/po/$(PACKAGE).pot): Pass -ctranslate to `$(XGETTEXT)'. @@ -33373,21 +33373,21 @@ 2009-12-21 Felix Zielcke - * util/grub-mkrescue.in (process_input_dir): Copy `*.lst' files + * util/VasEBoot-mkrescue.in (process_input_dir): Copy `*.lst' files instead of specifying them explicit. -2009-12-21 Robert Millan +2009-12-21 Robert Millan - * NEWS: Add grub-probe support for GNU/Hurd. + * NEWS: Add VasEBoot-probe support for GNU/Hurd. -2009-12-21 Robert Millan +2009-12-21 Robert Millan * NEWS: gettext was added after 1.97. -2009-12-21 Robert Millan +2009-12-21 Robert Millan * util/mkisofs/msdos_partition.h: New file (based on - include/grub/msdos_partition.h). + include/VasEBoot/msdos_partition.h). * util/mkisofs/mkisofs.c (use_protective_msdos_label): New variable. (OPTION_PROTECTIVE_MSDOS_LABEL): New macro. (ld_options, main): Recognize --protective-msdos-label. @@ -33396,14 +33396,14 @@ (padblock_write): If `use_protective_msdos_label' is set, patch a protective DOS-style label in the output image. - * util/grub-mkrescue.in: Use --protective-msdos-label. + * util/VasEBoot-mkrescue.in: Use --protective-msdos-label. -2009-12-21 Robert Millan +2009-12-21 Robert Millan - * util/grub-mkrescue.in: Do not zero-pad image for BIOS-based disk + * util/VasEBoot-mkrescue.in: Do not zero-pad image for BIOS-based disk boot. -2009-12-21 Robert Millan +2009-12-21 Robert Millan * util/mkisofs/mkisofs.c (use_embedded_boot, boot_image_embed): New variables. @@ -33414,96 +33414,96 @@ (padblock_size): Use `PADBLOCK_SIZE' instead of hardcoding 16. (padblock_write): Likewise. Rewrite to support embedded boot image. - * util/grub-mkrescue.in: When building i386-pc images, embed core.img + * util/VasEBoot-mkrescue.in: When building i386-pc images, embed core.img for BIOS-based disk boot instead of only ElTorito. -2009-12-21 Robert Millan +2009-12-21 Robert Millan - * util/grub-mkrescue.in: Remove `configfile' and `sh' from i386-pc + * util/VasEBoot-mkrescue.in: Remove `configfile' and `sh' from i386-pc build (not needed for bootstrap). -2009-12-21 Robert Millan +2009-12-21 Robert Millan - * util/grub-mkrescue.in: Remove `memdisk', `tar' and `search' modules + * util/VasEBoot-mkrescue.in: Remove `memdisk', `tar' and `search' modules from i386-pc build (not needed for bootstrap). Rewrite a pair of strings. -2009-12-21 Robert Millan +2009-12-21 Robert Millan - * normal/main.c (grub_normal_reader_init): Set left margin back to 3. + * normal/main.c (VasEBoot_normal_reader_init): Set left margin back to 3. 2009-12-21 Vladimir Serbinenko - * video/i386/pc/vbe.c (grub_video_vbe_fini): Set 'last_set_mode'. + * video/i386/pc/vbe.c (VasEBoot_video_vbe_fini): Set 'last_set_mode'. 2009-12-21 Andreas Born - * kern/env.c (grub_env_context_open): Mark exported variable for + * kern/env.c (VasEBoot_env_context_open): Mark exported variable for reexport. 2009-12-21 Andreas Born - * kern/env.c (grub_env_export): Create nonexistent variables before + * kern/env.c (VasEBoot_env_export): Create nonexistent variables before exporting. 2009-12-20 Carles Pina i Estany - * include/grub/auth.h: Include `'. - (GRUB_GET_PASSWORD): Gettextizze string. - * include/grub/normal.h (STANDARD_MARGIN): New macro, moved from + * include/VasEBoot/auth.h: Include `'. + (VasEBoot_GET_PASSWORD): Gettextizze string. + * include/VasEBoot/normal.h (STANDARD_MARGIN): New macro, moved from menu_text.c. - (grub_utf8_to_ucs4_alloc): Fix indentation. - (grub_print_ucs4): Likewise. - (grub_getstringwidth): Likewise. + (VasEBoot_utf8_to_ucs4_alloc): Fix indentation. + (VasEBoot_print_ucs4): Likewise. + (VasEBoot_getstringwidth): Likewise. (print_message_indented): New declaration. - * normal/auth.c: Include `'. - (grub_auth_check_authentication): Gettexttize string. - * normal/cmdline.c: Include `'. - (grub_cmdline_get): Gettextizze. - * normal/color.c: Include `'. - (grub_parse_color_name_pair): Gettexttize strings. - * normal/main.c (grub_normal_reader_init): Cleanup gettexttized + * normal/auth.c: Include `'. + (VasEBoot_auth_check_authentication): Gettexttize string. + * normal/cmdline.c: Include `'. + (VasEBoot_cmdline_get): Gettextizze. + * normal/color.c: Include `'. + (VasEBoot_parse_color_name_pair): Gettexttize strings. + * normal/main.c (VasEBoot_normal_reader_init): Cleanup gettexttized string (use `print_message_indented'). * normal/menu_text.c (STANDARD_MARGIN): Moved from here to - `include/grub/normal.h'. + `include/VasEBoot/normal.h'. (print_message_indented): Renamed to ... - (grub_print_message_indented): ... this. Remove `static' qualifer (now + (VasEBoot_print_message_indented): ... this. Remove `static' qualifer (now used in normal/main.c). - (print_message): Use `grub_print_message_indented' instead of + (print_message): Use `VasEBoot_print_message_indented' instead of `print_message_indented'. (print_timeout): Likewise. - * normal/misc.c: Include `' and `'. - (grub_normal_print_device_info): Gettexttize strings. + * normal/misc.c: Include `' and `'. + (VasEBoot_normal_print_device_info): Gettexttize strings. * po/POTFILES: Add `auth.c', `color.c' and `misc.c'. 2009-12-20 Vladimir Serbinenko - * kern/parser.c (grub_parser_split_cmdline): Fix incorrect counting + * kern/parser.c (VasEBoot_parser_split_cmdline): Fix incorrect counting of arguments. Return number of tokens and not arguments. All users updated. 2009-12-20 Vladimir Serbinenko - * util/i386/pc/grub-setup.c (setup): Don't install on non-GPT, + * util/i386/pc/VasEBoot-setup.c (setup): Don't install on non-GPT, non-MSDOS paritions. 2009-12-19 Vladimir Serbinenko - * include/grub/types.h (UNUSED): Removed since it conflicts with + * include/VasEBoot/types.h (UNUSED): Removed since it conflicts with NetBSD headers. All users changed to direct __attribute__ ((unused)). Reported by Grégoire Sutre. 2009-12-19 Carles Pina i Estany - * include/grub/normal.h (grub_utf8_to_ucs4): New declaration. - (grub_print_ucs4_alloc): Likewise. - (grub_getstringwidth): Likewise. - * normal/main.c (grub_normal_init_page): Gettextize version string. - * normal/menu_text.c (grub_utf8_to_ucs4_alloc): New definition. + * include/VasEBoot/normal.h (VasEBoot_utf8_to_ucs4): New declaration. + (VasEBoot_print_ucs4_alloc): Likewise. + (VasEBoot_getstringwidth): Likewise. + * normal/main.c (VasEBoot_normal_init_page): Gettextize version string. + * normal/menu_text.c (VasEBoot_utf8_to_ucs4_alloc): New definition. (getstringwidth): Renamed to ... - (grub_getstringwidth): ... this. Remove `static' qualifier (now used - in normal/main.c). Use `grub_utf8_to_ucs4_alloc'. - (grub_print_ucs4): Remove `static' qualifer (now used in + (VasEBoot_getstringwidth): ... this. Remove `static' qualifier (now used + in normal/main.c). Use `VasEBoot_utf8_to_ucs4_alloc'. + (VasEBoot_print_ucs4): Remove `static' qualifer (now used in normal/main.c). * po/POTFILES: Add normal/main.c. @@ -33524,51 +33524,51 @@ * term/ieee1275/ofconsole.c (MAX): Removed. (colors): Redone based on VGA palette. - (grub_ofconsole_setcolor): Discard brightness bit since only 8 + (VasEBoot_ofconsole_setcolor): Discard brightness bit since only 8 colors are supported. - (grub_ofconsole_init_output): Use ARRAY_SIZE instead of hardcoded size. + (VasEBoot_ofconsole_init_output): Use ARRAY_SIZE instead of hardcoded size. 2009-12-18 Vladimir Serbinenko Fix potential EfiEmu double prepare. * efiemu/main.c (prepared): New variable - (grub_efiemu_unload): Set prepare to '0'. - (grub_efiemu_prepare): Return if already prepared. Set prepared. + (VasEBoot_efiemu_unload): Set prepare to '0'. + (VasEBoot_efiemu_prepare): Return if already prepared. Set prepared. set_virtual_address_map support. - * include/grub/efi/efi.h (grub_efi_set_virtual_address_map): New + * include/VasEBoot/efi/efi.h (VasEBoot_efi_set_virtual_address_map): New prototype. - * include/grub/efiemu/efiemu.h (grub_efiemu_write_sym_markers): New + * include/VasEBoot/efiemu/efiemu.h (VasEBoot_efiemu_write_sym_markers): New prototype. - (grub_efiemu_crc32): Likewise. - (grub_efiemu_crc64): Likewise. - (grub_efiemu_set_virtual_address_map): Likewise. - * include/grub/autoefi.h (grub_autoefi_exit_boot_services): + (VasEBoot_efiemu_crc32): Likewise. + (VasEBoot_efiemu_crc64): Likewise. + (VasEBoot_efiemu_set_virtual_address_map): Likewise. + * include/VasEBoot/autoefi.h (VasEBoot_autoefi_exit_boot_services): New definition. - (grub_autoefi_set_virtual_address_map): Likewise. - * kern/efi/efi.c (grub_efi_set_virtual_address_map): New function. - * loader/i386/xnu.c (grub_xnu_boot): Call set_virtual_address_map. + (VasEBoot_autoefi_set_virtual_address_map): Likewise. + * kern/efi/efi.c (VasEBoot_efi_set_virtual_address_map): New function. + * loader/i386/xnu.c (VasEBoot_xnu_boot): Call set_virtual_address_map. Restructure flow to accomodate it. - * efiemu/prepare.c (grub_efiemu_prepare): Support set_virtual_address_map. - (grub_efiemu_crc): Recompute CRC32. + * efiemu/prepare.c (VasEBoot_efiemu_prepare): Support set_virtual_address_map. + (VasEBoot_efiemu_crc): Recompute CRC32. * efiemu/runtime/efiemu.c (ptv_relocated): Renamed to ... (efiemu_ptv_relocated): ... this. Made global. All users updated. * efiemu/symbols.c (relocated_handle): New variable. - (grub_efiemu_free_syms): Free relocated_handle. - (grub_efiemu_alloc_syms): Allocate relocated_handle. - (grub_efiemu_write_sym_markers): New function. - (grub_efiemu_set_virtual_address_map): Likewise. + (VasEBoot_efiemu_free_syms): Free relocated_handle. + (VasEBoot_efiemu_alloc_syms): Allocate relocated_handle. + (VasEBoot_efiemu_write_sym_markers): New function. + (VasEBoot_efiemu_set_virtual_address_map): Likewise. Newer XNU parameters. - * include/grub/i386/xnu.h (GRUB_XNU_BOOTARGS_VERMINOR): Change to 5. - * include/grub/xnu.h (grub_xnu_extheader): Add nameaddr and namesize. - (grub_xnu_fill_devicetree): New prototype. - (grub_xnu_heap_real_start): New variable. + * include/VasEBoot/i386/xnu.h (VasEBoot_XNU_BOOTARGS_VERMINOR): Change to 5. + * include/VasEBoot/xnu.h (VasEBoot_xnu_extheader): Add nameaddr and namesize. + (VasEBoot_xnu_fill_devicetree): New prototype. + (VasEBoot_xnu_heap_real_start): New variable. * loader/xnu.c (get_name_ptr): New function. - (grub_xnu_load_driver): Fill namelen and name. + (VasEBoot_xnu_load_driver): Fill namelen and name. 64-bit xnu support. @@ -33576,55 +33576,55 @@ and 'loader/macho64.c'. * conf/i386-pc.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. - * include/grub/i386/macho.h (grub_macho_thread64): New structure. - * include/grub/xnu.h (grub_xnu_is_64bit): New variable. - * include/grub/macho.h (grub_macho_segment64): New structure. - * include/grub/machoload.h (grub_macho32_size): Renamed from ... - (grub_macho_size32): ... to this. - (grub_macho32_get_entry_point): Renamed from ... - (grub_macho_get_entry_point32): ... to this. - (grub_macho_contains_macho64): New prototype. - (grub_macho_size64): Likewise. - (grub_macho_get_entry_point64): Likewise. - (grub_macho32_load): Renamed from ... - (grub_macho_load32): ... to this. - (grub_macho32_filesize): Renamed from ... - (grub_macho_filesize32): ... to this. - (grub_macho32_readfile): Renamed from ... - (grub_macho_readfile32): ... to this. - (grub_macho_filesize64): New prototype. - (grub_macho_readfile64): Likewise. - (grub_macho_parse32): Likewise. - (grub_macho_parse64): Likewise. + * include/VasEBoot/i386/macho.h (VasEBoot_macho_thread64): New structure. + * include/VasEBoot/xnu.h (VasEBoot_xnu_is_64bit): New variable. + * include/VasEBoot/macho.h (VasEBoot_macho_segment64): New structure. + * include/VasEBoot/machoload.h (VasEBoot_macho32_size): Renamed from ... + (VasEBoot_macho_size32): ... to this. + (VasEBoot_macho32_get_entry_point): Renamed from ... + (VasEBoot_macho_get_entry_point32): ... to this. + (VasEBoot_macho_contains_macho64): New prototype. + (VasEBoot_macho_size64): Likewise. + (VasEBoot_macho_get_entry_point64): Likewise. + (VasEBoot_macho32_load): Renamed from ... + (VasEBoot_macho_load32): ... to this. + (VasEBoot_macho32_filesize): Renamed from ... + (VasEBoot_macho_filesize32): ... to this. + (VasEBoot_macho32_readfile): Renamed from ... + (VasEBoot_macho_readfile32): ... to this. + (VasEBoot_macho_filesize64): New prototype. + (VasEBoot_macho_readfile64): Likewise. + (VasEBoot_macho_parse32): Likewise. + (VasEBoot_macho_parse64): Likewise. * loader/macho.c: Split into ... * loader/machoXX.c: ... and this. Replace 32 with XX. * loader/macho32.c: New file. * loader/macho64.c: Likewise. - * loader/xnu.c (grub_xnu_is_64bit): New variable. - (grub_cmd_xnu_kernel): Make 32-bit only. - (grub_cmd_xnu_kernel64): New function. - (grub_xnu_load_driver): Support Mach-O 64. - (grub_cmd_xnu_mkext): Likewise. - * util/grub.d/30_os-prober.in (osx_entry): New function. + * loader/xnu.c (VasEBoot_xnu_is_64bit): New variable. + (VasEBoot_cmd_xnu_kernel): Make 32-bit only. + (VasEBoot_cmd_xnu_kernel64): New function. + (VasEBoot_xnu_load_driver): Support Mach-O 64. + (VasEBoot_cmd_xnu_mkext): Likewise. + * util/VasEBoot.d/30_os-prober.in (osx_entry): New function. Generate entries for 64-bit boot too. Eliminate ad-hoc tree format in XNU and EfiEmu. - * efiemu/main.c (grub_efiemu_prepare): Update comment. + * efiemu/main.c (VasEBoot_efiemu_prepare): Update comment. * efiemu/pnvram.c: Rewritten to use environment variables. All users updated. Inline utf16_to_utf8. - * kern/misc.c (grub_utf16_to_utf8): Move from here ... - * include/grub/charset.h (grub_utf16_to_utf8): ... to here. Inlined. + * kern/misc.c (VasEBoot_utf16_to_utf8): Move from here ... + * include/VasEBoot/charset.h (VasEBoot_utf16_to_utf8): ... to here. Inlined. All users updated. - * include/grub/misc.h (grub_utf16_to_utf8): Removed. + * include/VasEBoot/misc.h (VasEBoot_utf16_to_utf8): Removed. - * bus/usb/usb.c (grub_usb_get_string): Move from here ... - * commands/usbtest.c (grub_usb_get_string): ... move here. + * bus/usb/usb.c (VasEBoot_usb_get_string): Move from here ... + * commands/usbtest.c (VasEBoot_usb_get_string): ... move here. (usb_print_str): Fix error handling. - * include/grub/usb.h (grub_usb_get_string): Remove. + * include/VasEBoot/usb.h (VasEBoot_usb_get_string): Remove. UTF-8 to UTF-16 transformation. @@ -33632,57 +33632,57 @@ (charset_mod_SOURCES): New variable. (charset_mod_CFLAGS): Likewise. (charset_mod_LDFLAGS): Likewise. - * include/grub/utf.h: New file. - * lib/utf.c: New file. (Based on grub_utf8_to_ucs4 from kern/misc.c) + * include/VasEBoot/utf.h: New file. + * lib/utf.c: New file. (Based on VasEBoot_utf8_to_ucs4 from kern/misc.c) Support for device properties. - * include/grub/i386/xnu.h (grub_xnu_devprop_header): New structure. - (grub_xnu_devprop_device_header): Likewise. - (grub_xnu_devprop_device_descriptor): Likewise. - (grub_xnu_devprop_add_device): New prototype. - (grub_xnu_devprop_remove_device): Likewise. - (grub_xnu_devprop_remove_property): Likewise. - (grub_xnu_devprop_add_property_utf8): Likewise. - (grub_xnu_devprop_add_property_utf16): Likewise. - (grub_cpu_xnu_init): Likewise. - (grub_cpu_xnu_fini): Likewise. - (grub_cpu_xnu_unload): Likewise. - * loader/i386/xnu.c (grub_xnu_devprop_device_descriptor): New structure. + * include/VasEBoot/i386/xnu.h (VasEBoot_xnu_devprop_header): New structure. + (VasEBoot_xnu_devprop_device_header): Likewise. + (VasEBoot_xnu_devprop_device_descriptor): Likewise. + (VasEBoot_xnu_devprop_add_device): New prototype. + (VasEBoot_xnu_devprop_remove_device): Likewise. + (VasEBoot_xnu_devprop_remove_property): Likewise. + (VasEBoot_xnu_devprop_add_property_utf8): Likewise. + (VasEBoot_xnu_devprop_add_property_utf16): Likewise. + (VasEBoot_cpu_xnu_init): Likewise. + (VasEBoot_cpu_xnu_fini): Likewise. + (VasEBoot_cpu_xnu_unload): Likewise. + * loader/i386/xnu.c (VasEBoot_xnu_devprop_device_descriptor): New structure. (property_descriptor): Likewise. (devices): New variable. - (grub_xnu_devprop_remove_property): New function. - (grub_xnu_devprop_add_device): Likewise. - (grub_xnu_devprop_remove_device): Likewise. - (grub_xnu_devprop_add_property): Likewise. - (grub_xnu_devprop_add_property_utf8): Likewise. - (grub_xnu_devprop_add_property_utf16): Likewise. + (VasEBoot_xnu_devprop_remove_property): New function. + (VasEBoot_xnu_devprop_add_device): Likewise. + (VasEBoot_xnu_devprop_remove_device): Likewise. + (VasEBoot_xnu_devprop_add_property): Likewise. + (VasEBoot_xnu_devprop_add_property_utf8): Likewise. + (VasEBoot_xnu_devprop_add_property_utf16): Likewise. (hextoval): Likewise. - (grub_cpu_xnu_fill_devprop): Likewise. - (grub_cmd_devprop_load): Likewise. - (grub_xnu_boot): Call grub_cpu_xnu_fill_devprop, - grub_xnu_fill_devicetree, grub_xnu_fill_devicetree + (VasEBoot_cpu_xnu_fill_devprop): Likewise. + (VasEBoot_cmd_devprop_load): Likewise. + (VasEBoot_xnu_boot): Call VasEBoot_cpu_xnu_fill_devprop, + VasEBoot_xnu_fill_devicetree, VasEBoot_xnu_fill_devicetree (cmd_devprop_load): New variable. - (grub_cpu_xnu_init): New function. - (grub_cpu_xnu_fini): Likewise. - * loader/i386/xnu.c (grub_xnu_unload): Call grub_cpu_xnu_unload. - * loader/xnu.c (grub_xnu_parse_devtree): Remove. - (grub_cmd_xnu_devtree): Likewise. + (VasEBoot_cpu_xnu_init): New function. + (VasEBoot_cpu_xnu_fini): Likewise. + * loader/i386/xnu.c (VasEBoot_xnu_unload): Call VasEBoot_cpu_xnu_unload. + * loader/xnu.c (VasEBoot_xnu_parse_devtree): Remove. + (VasEBoot_cmd_xnu_devtree): Likewise. (hextoval): New function. (unescape): Likewise. - (grub_xnu_fill_devicetree): Likewise. + (VasEBoot_xnu_fill_devicetree): Likewise. - * util/grub.d/30_os-prober.in: Load devprop.bin. Don't load devtree.txt. - * util/i386/efi/grub-dumpdevtree: Generate devprop.bin. + * util/VasEBoot.d/30_os-prober.in: Load devprop.bin. Don't load devtree.txt. + * util/i386/efi/VasEBoot-dumpdevtree: Generate devprop.bin. 2009-12-18 Vladimir Serbinenko Workaround for broken ATI VBE. * video/i386/pc/vbe.c (last_set_mode): New variable. - (grub_vbe_set_video_mode): Set 'last_set_mode'. - (grub_vbe_get_video_mode): Use 'last_set_mode' if get_mode fails. - (grub_video_vbe_setup): Don't check for reserved flag. + (VasEBoot_vbe_set_video_mode): Set 'last_set_mode'. + (VasEBoot_vbe_get_video_mode): Use 'last_set_mode' if get_mode fails. + (VasEBoot_video_vbe_setup): Don't check for reserved flag. 2009-12-17 Felix Zielcke @@ -33693,31 +33693,31 @@ UUID support for HFS. - * fs/hfs.c (grub_hfs_uuid): New function. - (grub_hfs_fs): New value .uuid. - * include/grub/hfs.h (grub_hfs_sblock): New field 'num_serial'. + * fs/hfs.c (VasEBoot_hfs_uuid): New function. + (VasEBoot_hfs_fs): New value .uuid. + * include/VasEBoot/hfs.h (VasEBoot_hfs_sblock): New field 'num_serial'. 2009-12-14 Felix Zielcke Fix a segfault with parsing unknown long options. - * util/grub-mkrelpath.c (options): Zero terminate it. + * util/VasEBoot-mkrelpath.c (options): Zero terminate it. 2009-12-13 Carles Pina i Estany - * include/grub/misc.h (grub_puts): New declaration. - (grub_puts_): Likewise. - * kern/misc.c (grub_puts): New definition. - (grub_puts_): Likewise. + * include/VasEBoot/misc.h (VasEBoot_puts): New declaration. + (VasEBoot_puts_): Likewise. + * kern/misc.c (VasEBoot_puts): New definition. + (VasEBoot_puts_): Likewise. -2009-12-13 Robert Millan +2009-12-13 Robert Millan - * util/grub-probe.c (probe): Improve error message. + * util/VasEBoot-probe.c (probe): Improve error message. -2009-12-13 Robert Millan +2009-12-13 Robert Millan * loader/i386/multiboot_elfxx.c - (CONCAT(grub_multiboot_load_elf, XX)): Fix `grub_multiboot_payload_eip' + (CONCAT(VasEBoot_multiboot_load_elf, XX)): Fix `VasEBoot_multiboot_payload_eip' initialization. 2009-12-13 Vladimir Serbinenko @@ -33731,70 +33731,70 @@ (relocator_mod_LDFLAGS): Likewise. (relocator_mod_ASFLAGS): Likewise. * conf/x86_64.rmk: Likewise. - * include/grub/i386/multiboot.h (grub_multiboot_payload_orig): Removed. - (grub_multiboot_payload_entry_offset): Likewise. - (grub_multiboot_forward_relocator): Likewise. - (grub_multiboot_forward_relocator_end): Likewise. - (grub_multiboot_backward_relocator): Likewise. - (grub_multiboot_backward_relocator_end): Likewise. - (grub_multiboot_payload_eip): New variable. - (grub_multiboot_payload_orig): Likewise. - * include/grub/i386/pc/memory.h: Include grub/i386/memory.h. - (GRUB_MEMORY_MACHINE_CR0_PE_ON): Move from here ... - * include/grub/i386/memory.h - (GRUB_MEMORY_CPU_CR0_PE_ON): ... to here - (GRUB_MEMORY_CPU_CR4_PAE_ON): New definition. - (GRUB_MEMORY_CPU_CR0_PAGING_ON): Likewise. - (GRUB_MEMORY_CPU_AMD64_MSR): Likewise. - (GRUB_MEMORY_CPU_AMD64_MSR_ON): Likewise. - * include/grub/i386/relocator.h: New file. - * include/grub/x86_64/relocator.h: Likewise. - * include/grub/i386/xnu.h: Include grub/cpu/relocator.h. + * include/VasEBoot/i386/multiboot.h (VasEBoot_multiboot_payload_orig): Removed. + (VasEBoot_multiboot_payload_entry_offset): Likewise. + (VasEBoot_multiboot_forward_relocator): Likewise. + (VasEBoot_multiboot_forward_relocator_end): Likewise. + (VasEBoot_multiboot_backward_relocator): Likewise. + (VasEBoot_multiboot_backward_relocator_end): Likewise. + (VasEBoot_multiboot_payload_eip): New variable. + (VasEBoot_multiboot_payload_orig): Likewise. + * include/VasEBoot/i386/pc/memory.h: Include VasEBoot/i386/memory.h. + (VasEBoot_MEMORY_MACHINE_CR0_PE_ON): Move from here ... + * include/VasEBoot/i386/memory.h + (VasEBoot_MEMORY_CPU_CR0_PE_ON): ... to here + (VasEBoot_MEMORY_CPU_CR4_PAE_ON): New definition. + (VasEBoot_MEMORY_CPU_CR0_PAGING_ON): Likewise. + (VasEBoot_MEMORY_CPU_AMD64_MSR): Likewise. + (VasEBoot_MEMORY_CPU_AMD64_MSR_ON): Likewise. + * include/VasEBoot/i386/relocator.h: New file. + * include/VasEBoot/x86_64/relocator.h: Likewise. + * include/VasEBoot/i386/xnu.h: Include VasEBoot/cpu/relocator.h. (XNU_RELOCATOR): New macro. - (grub_xnu_launcher_start): Remove. - (grub_xnu_launcher_end): Likewise. - * include/grub/xnu.h (grub_xnu_boot_resume): New prototype. - (grub_xnu_heap_real_start): Remove. - (grub_xnu_heap_start): Change to void *. All users updated. - * kern/i386/realmode.S (real_to_prot): Use GRUB_MEMORY_CPU_CR0_PE_ON. + (VasEBoot_xnu_launcher_start): Remove. + (VasEBoot_xnu_launcher_end): Likewise. + * include/VasEBoot/xnu.h (VasEBoot_xnu_boot_resume): New prototype. + (VasEBoot_xnu_heap_real_start): Remove. + (VasEBoot_xnu_heap_start): Change to void *. All users updated. + * kern/i386/realmode.S (real_to_prot): Use VasEBoot_MEMORY_CPU_CR0_PE_ON. * lib/i386/relocator.c: New file. * lib/i386/relocator_asm.S: Likewise. * lib/i386/relocator_backward.S: Likewise. * lib/mips/relocator.c: Likewise. * lib/mips/relocator_asm.S: Likewise. * lib/relocator.c: Likewise. - * loader/i386/multiboot.c: Include grub/i386/relocator.h. + * loader/i386/multiboot.c: Include VasEBoot/i386/relocator.h. (entry): Removed. (playground): Likewise. - (grub_multiboot_payload_orig): New variable. - (grub_multiboot_payload_dest): Likewise. - (grub_multiboot_payload_size): Likewise. - (grub_multiboot_payload_eip): Likewise. - (grub_multiboot_payload_esp): Likewise. - (grub_multiboot_boot): Use grub_relocator32_boot. - (grub_multiboot_unload): Free relocators. - (grub_multiboot): Setup stack. Use relocators. - * loader/i386/multiboot_elfxx.c: Include grub/i386/relocator.h. - (grub_multiboot_load_elfXX): Use relocators. - * loader/i386/multiboot_helper.S (grub_multiboot_payload_orig): Removed. - (grub_multiboot_payload_size): Likewise. - (grub_multiboot_payload_dest): Likewise. - (grub_multiboot_payload_entry_offset): Likewise. - (grub_multiboot_forward_relocator): Likewise. - (grub_multiboot_backward_relocator): Likewise. - (grub_multiboot_real_boot): Likewise. - * loader/i386/xnu.c (grub_xnu_heap_will_be_at): New variable. - (grub_xnu_entry_point): Likewise. - (grub_xnu_arg1): Likewise. - (grub_xnu_stack): Likewise. - (grub_xnu_launch): Removed. - (grub_xnu_boot_resume): New function. - (grub_xnu_boot): Use relocators. + (VasEBoot_multiboot_payload_orig): New variable. + (VasEBoot_multiboot_payload_dest): Likewise. + (VasEBoot_multiboot_payload_size): Likewise. + (VasEBoot_multiboot_payload_eip): Likewise. + (VasEBoot_multiboot_payload_esp): Likewise. + (VasEBoot_multiboot_boot): Use VasEBoot_relocator32_boot. + (VasEBoot_multiboot_unload): Free relocators. + (VasEBoot_multiboot): Setup stack. Use relocators. + * loader/i386/multiboot_elfxx.c: Include VasEBoot/i386/relocator.h. + (VasEBoot_multiboot_load_elfXX): Use relocators. + * loader/i386/multiboot_helper.S (VasEBoot_multiboot_payload_orig): Removed. + (VasEBoot_multiboot_payload_size): Likewise. + (VasEBoot_multiboot_payload_dest): Likewise. + (VasEBoot_multiboot_payload_entry_offset): Likewise. + (VasEBoot_multiboot_forward_relocator): Likewise. + (VasEBoot_multiboot_backward_relocator): Likewise. + (VasEBoot_multiboot_real_boot): Likewise. + * loader/i386/xnu.c (VasEBoot_xnu_heap_will_be_at): New variable. + (VasEBoot_xnu_entry_point): Likewise. + (VasEBoot_xnu_arg1): Likewise. + (VasEBoot_xnu_stack): Likewise. + (VasEBoot_xnu_launch): Removed. + (VasEBoot_xnu_boot_resume): New function. + (VasEBoot_xnu_boot): Use relocators. * loader/i386/xnu_helper.S: Removed. - * loader/xnu.c (grub_xnu_heap_start): New variable. - (grub_xnu_heap_size): Likewise. - (grub_xnu_heap_malloc): Use relocators. - * loader/xnu_resume.c (grub_xnu_resume): Use relocators. + * loader/xnu.c (VasEBoot_xnu_heap_start): New variable. + (VasEBoot_xnu_heap_size): Likewise. + (VasEBoot_xnu_heap_malloc): Use relocators. + * loader/xnu_resume.c (VasEBoot_xnu_resume): Use relocators. 2009-12-13 Vladimir Serbinenko @@ -33803,8 +33803,8 @@ 2009-12-13 Carles Pina i Estany - * script/execute.c (grub_script_execute_cmdline): Set grub_errno to - GRUB_ERR_NONE before calling grub_env_set. + * script/execute.c (VasEBoot_script_execute_cmdline): Set VasEBoot_errno to + VasEBoot_ERR_NONE before calling VasEBoot_env_set. 2009-12-12 Robert Millan @@ -33815,12 +33815,12 @@ * genvideolist.sh: New file. * Makefile.in (pkglib_DATA): Add video.lst. (video.lst): New target rule. - * util/grub-mkconfig.in: Initialize ${GRUB_VIDEO_BACKEND} using + * util/VasEBoot-mkconfig.in: Initialize ${VasEBoot_VIDEO_BACKEND} using `video.lst'. - * util/grub.d/30_os-prober.in: Replace `vbe' with - ${GRUB_VIDEO_BACKEND}. + * util/VasEBoot.d/30_os-prober.in: Replace `vbe' with + ${VasEBoot_VIDEO_BACKEND}. -2009-12-11 Robert Millan +2009-12-11 Robert Millan * THANKS: Add David Miller. @@ -33829,21 +33829,21 @@ libpciaccess support. * Makefile.in (LIBPCIACCESS): New variable. - (enable_grub_emu_pci): Likewise. - * conf/any-emu.rmk (grub_emu_SOURCES) [enable_grub_emu_pci]: Add + (enable_VasEBoot_emu_pci): Likewise. + * conf/any-emu.rmk (VasEBoot_emu_SOURCES) [enable_VasEBoot_emu_pci]: Add util/pci.c and commands/lspci.c. - (grub_emu_LDFLAGS) [enable_grub_emu_pci]: Add $(LIBPCIACCESS). - * configure.ac (grub-emu-pci): New option. - * include/grub/i386/pci.h (grub_pci_device_map_range): New function. - (grub_pci_device_unmap_range): Likewise. - * include/grub/pci.h [GRUB_UTIL]: Include grub/pciutils.h. - (grub_pci_device) [!GRUB_UTIL]: New structure. All users updated. - (grub_pci_address_t) [!GRUB_UTIL]: New type. - (grub_pci_device_t) [!GRUB_UTIL]: Likewise. - (grub_pci_get_bus) [!GRUB_UTIL]: New function. - (grub_pci_get_device) [!GRUB_UTIL]: Likewise. - (grub_pci_get_function) [!GRUB_UTIL]: Likewise. - * include/grub/pciutils.h: New file. + (VasEBoot_emu_LDFLAGS) [enable_VasEBoot_emu_pci]: Add $(LIBPCIACCESS). + * configure.ac (VasEBoot-emu-pci): New option. + * include/VasEBoot/i386/pci.h (VasEBoot_pci_device_map_range): New function. + (VasEBoot_pci_device_unmap_range): Likewise. + * include/VasEBoot/pci.h [VasEBoot_UTIL]: Include VasEBoot/pciutils.h. + (VasEBoot_pci_device) [!VasEBoot_UTIL]: New structure. All users updated. + (VasEBoot_pci_address_t) [!VasEBoot_UTIL]: New type. + (VasEBoot_pci_device_t) [!VasEBoot_UTIL]: Likewise. + (VasEBoot_pci_get_bus) [!VasEBoot_UTIL]: New function. + (VasEBoot_pci_get_device) [!VasEBoot_UTIL]: Likewise. + (VasEBoot_pci_get_function) [!VasEBoot_UTIL]: Likewise. + * include/VasEBoot/pciutils.h: New file. * util/pci.c: Likewise. 2009-12-11 Felix Zielcke @@ -33852,78 +33852,78 @@ 2009-12-10 Felix Zielcke - * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Show the disk + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Show the disk name in an error message. - (grub_biosdisk_rw): Likewise. + (VasEBoot_biosdisk_rw): Likewise. 2009-12-10 Vladimir Serbinenko Eliminate NTFS 4Gib barrier. - * fs/ntfs.c (read_attr): Use grub_disk_addr_t and grub_size_t. + * fs/ntfs.c (read_attr): Use VasEBoot_disk_addr_t and VasEBoot_size_t. (read_run_data): Likewise. - (grub_ntfs_read_run_list): Likewise. - (grub_ntfs_read_block): Likewise. - (grub_ntfs_iterate_dir): Likewise. + (VasEBoot_ntfs_read_run_list): Likewise. + (VasEBoot_ntfs_read_block): Likewise. + (VasEBoot_ntfs_iterate_dir): Likewise. (read_mft): Likewise. (read_data): Likewise. Use COM_LOG_LEN. * fs/ntfscomp.c (read_block): Cast ctx->target_vcn & 0xF to unsigned to avoid 64-bit division - * include/grub/ntfs.h (COM_LOG_LEN): New definition. - (grub_ntfs_rlst): Use grub_disk_addr_t. + * include/VasEBoot/ntfs.h (COM_LOG_LEN): New definition. + (VasEBoot_ntfs_rlst): Use VasEBoot_disk_addr_t. 2009-12-10 Vladimir Serbinenko - Eliminate grub-fstest 4Gib barrier. + Eliminate VasEBoot-fstest 4Gib barrier. - * util/grub-fstest.c (skip, leng): Use grub_disk_addr_t. + * util/VasEBoot-fstest.c (skip, leng): Use VasEBoot_disk_addr_t. (read_file): Fix error reporting. 2009-12-10 Vladimir Serbinenko Eliminate hexdump 4Gib barrier. - * commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_addr_t. - * lib/arg.c (grub_arg_parse): Use grub_strtoull. + * commands/hexdump.c (VasEBoot_cmd_hexdump): Use VasEBoot_disk_addr_t. + * lib/arg.c (VasEBoot_arg_parse): Use VasEBoot_strtoull. 2009-12-10 Vladimir Serbinenko - * kern/device.c (grub_device_iterate): Ignore errors during first scan. + * kern/device.c (VasEBoot_device_iterate): Ignore errors during first scan. Fixes amarsh bug. 2009-12-09 Bruce Dubbs Remove miscellaneous files in distclean target. - * Makefile.in: Remove docs/{grub.info,version.texi,stamp-vti} + * Makefile.in: Remove docs/{VasEBoot.info,version.texi,stamp-vti} 2009-12-09 Colin Watson - * util/grub-mkconfig_lib.in: Don't set grub_probe or grub_mkrelpath + * util/VasEBoot-mkconfig_lib.in: Don't set VasEBoot_probe or VasEBoot_mkrelpath if they're already set. This resolves the conflict between my - grub-install change on 2009-10-06 and Felix' change on 2009-11-11, - fixing the --grub-probe option again. - * util/sparc64/ieee1275/grub-install.in: Revert the last piece of my + VasEBoot-install change on 2009-10-06 and Felix' change on 2009-11-11, + fixing the --VasEBoot-probe option again. + * util/sparc64/ieee1275/VasEBoot-install.in: Revert the last piece of my change on 2009-10-06, so that we now once again source - `${libdir}/grub/grub-mkconfig_lib' after options have been parsed. + `${libdir}/VasEBoot/VasEBoot-mkconfig_lib' after options have been parsed. -2009-12-08 Robert Millan +2009-12-08 Robert Millan - * conf/common.rmk [sparc64-ieee1275] (grub_mkdevicemap_SOURCES): Use + * conf/common.rmk [sparc64-ieee1275] (VasEBoot_mkdevicemap_SOURCES): Use `util/ieee1275/ofpath.c' and `util/ieee1275/devicemap.c' instead of `util/devicemap.c'. 2009-12-08 Carles Pina i Estany - * include/grub/misc.h (grub_printf_): New declaration. - * kern/misc.c (grub_printf_): New definition. - * normal/main.c (grub_normal_reader_init): Use `grub_printf_' and `N_' - instead of `grub_printf' and `_'. + * include/VasEBoot/misc.h (VasEBoot_printf_): New declaration. + * kern/misc.c (VasEBoot_printf_): New definition. + * normal/main.c (VasEBoot_normal_reader_init): Use `VasEBoot_printf_' and `N_' + instead of `VasEBoot_printf' and `_'. * normal/menu_entry.c (store_completion): Likewise. (run): Likewise. - (grub_menu_entry_run): Likewise. - * normal/menu_text.c (grub_wait_after_message): Likewise. + (VasEBoot_menu_entry_run): Likewise. + * normal/menu_text.c (VasEBoot_wait_after_message): Likewise. (notify_booting): Likewise. (notify_fallback): Likewise. (notify_execution_failure): Likewise. @@ -33934,16 +33934,16 @@ * util/misc.c (asprintf): Move allocation from here ... (vasprintf): ... to here. New function. (xasprintf): New function. - * include/grub/util/misc.h (vasprintf, xasprintf): Add + * include/VasEBoot/util/misc.h (vasprintf, xasprintf): Add prototypes. - * util/getroot.c (grub_util_get_grub_dev): Use xasprintf. - * util/grub-mkfont.c (write_font): Likewise. - * util/grub-probe.c (probe): Likewise. + * util/getroot.c (VasEBoot_util_get_VasEBoot_dev): Use xasprintf. + * util/VasEBoot-mkfont.c (write_font): Likewise. + * util/VasEBoot-probe.c (probe): Likewise. * util/hostdisk.c (make_device_name): Likewise. 2009-12-06 David S. Miller - * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Recognize + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Recognize anything even prefixed with 'cdrom' as a cdrom. 2009-12-06 Felix Zielcke @@ -33953,17 +33953,17 @@ 2009-12-05 Carles Pina i Estany - * gettext/gettext.c: Include `'. Define grub_gettext_msg, - grub_gettext_msg_list. - (grub_gettext_gettranslation_from_position): Return const char * + * gettext/gettext.c: Include `'. Define VasEBoot_gettext_msg, + VasEBoot_gettext_msg_list. + (VasEBoot_gettext_gettranslation_from_position): Return const char * and not char *. - (grub_gettext_translate): Add the translated strings into a list, + (VasEBoot_gettext_translate): Add the translated strings into a list, returns from the list if existing there. - (grub_gettext_init_ext): Add \n at the end of grub_dprintf string. - (grub_gettext_delete_list): Delete the list. - (grub_gettext_env_write_lang): Call grub_gettext_delete_list when + (VasEBoot_gettext_init_ext): Add \n at the end of VasEBoot_dprintf string. + (VasEBoot_gettext_delete_list): Delete the list. + (VasEBoot_gettext_env_write_lang): Call VasEBoot_gettext_delete_list when lang environment variable is changed. - (GRUB_MOD_FINI): Call grub_gettext_delete_list. + (VasEBoot_MOD_FINI): Call VasEBoot_gettext_delete_list. 2009-12-05 Vladimir Serbinenko @@ -33983,19 +33983,19 @@ (kernel_mod_LDFLAGS): Rename to ... (kernel_img_LDFLAGS): ... this. * conf/x86_64-efi.rmk: Likewise. - * util/i386/efi/grub-mkimage.c (read_kernel_module): Rename to ... + * util/i386/efi/VasEBoot-mkimage.c (read_kernel_module): Rename to ... (read_kernel_image): ... this. All users updated. (read_kernel_image): Read "kernel.img" instead of "kernel.mod". 2009-12-05 Carles Pina i Estany - * normal/menu_text.c (grub_color_menu_high): Gettexttize string. + * normal/menu_text.c (VasEBoot_color_menu_high): Gettexttize string. (print_spaces): New function. - (grub_print_ucs4): New function. + (VasEBoot_print_ucs4): New function. (getstringwidth): New function. (print_message_indented): New function. (print_message): Gettexttize strings using print_message_indented. - (run_menu): Replaces grub_printf by print_spaces and dynamic terminal + (run_menu): Replaces VasEBoot_printf by print_spaces and dynamic terminal width. (get_entry_number): Gettextize and uses dynamic terminal width. (notify_booting, notify_fallback, notify_execution_failure): @@ -34003,7 +34003,7 @@ * normal/menu_entry.c (store_completion): Cleanup the gettextized string. (run): Likewise. - (grub_menu_entry_run): Likewise. + (VasEBoot_menu_entry_run): Likewise. * PO/POTFILES: Add normal/menu_entry.c. 2009-12-05 Vladimir Serbinenko @@ -34012,53 +34012,53 @@ 2009-12-05 Carles Pina i Estany - * util/grub-install.in: Install gettext .mo files. - * util/grub-mkrescue.in (process_input_dir): Copy gettext .mo files. + * util/VasEBoot-install.in: Install gettext .mo files. + * util/VasEBoot-mkrescue.in (process_input_dir): Copy gettext .mo files. 2009-12-05 Carles Pina i Estany - * gettext/gettext.c (grub_gettext_init_ext): Replace grub_printf with - grub_dprintf. + * gettext/gettext.c (VasEBoot_gettext_init_ext): Replace VasEBoot_printf with + VasEBoot_dprintf. -2009-12-05 Robert Millan +2009-12-05 Robert Millan - * kern/ieee1275/openfw.c (grub_reboot): Disable for i386. The + * kern/ieee1275/openfw.c (VasEBoot_reboot): Disable for i386. The non-firmware-dependant one in realmode.S takes precedence. -2009-12-04 Robert Millan +2009-12-04 Robert Millan * commands/halt.c: Replace misc arch-specific headers with - `'. + `'. * commands/reboot.c: Likewise. - * commands/i386/pc/halt.c: Replace `' with - `'. + * commands/i386/pc/halt.c: Replace `' with + `'. * conf/i386-coreboot.rmk (kernel_img_HEADERS): Remove `cpu/reboot.h'. (halt_mod_SOURCES): Move `kern/i386/halt.c' from here ... (kernel_img_SOURCES): ... to here. - * include/grub/efi/efi.h (grub_reboot, grub_halt): Remove prototypes. - * include/grub/i386/pc/init.h: Likewise. - * include/grub/powerpc/ieee1275/kernel.h: Likewise. - * include/grub/sparc64/ieee1275/kernel.h: Likewise. + * include/VasEBoot/efi/efi.h (VasEBoot_reboot, VasEBoot_halt): Remove prototypes. + * include/VasEBoot/i386/pc/init.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/kernel.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/kernel.h: Likewise. - * include/grub/misc.h (grub_reboot, grub_halt): New prototypes. + * include/VasEBoot/misc.h (VasEBoot_reboot, VasEBoot_halt): New prototypes. - * include/grub/i386/halt.h: Remove. - * include/grub/i386/reboot.h: Likewise. + * include/VasEBoot/i386/halt.h: Remove. + * include/VasEBoot/i386/reboot.h: Likewise. - * kern/i386/halt.c: Remove `'. + * kern/i386/halt.c: Remove `'. 2009-12-03 David S. Miller - * conf/sparc64-ieee1275.rmk (grub_mkimage_SOURCES, - grub_setup_SOURCES, grub_ofpathname_SOURCES): Add gnulib/progname.c - * util/sparc64/ieee1275/grub-mkimage.c: Include and + * conf/sparc64-ieee1275.rmk (VasEBoot_mkimage_SOURCES, + VasEBoot_setup_SOURCES, VasEBoot_ofpathname_SOURCES): Add gnulib/progname.c + * util/sparc64/ieee1275/VasEBoot-mkimage.c: Include and "progname.h" - * util/sparc64/ieee1275/grub-ofpathname.c: Likewise. - * util/sparc64/ieee1275/grub-setup.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-ofpathname.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c: Likewise. (usage): Add missing comma in printf. -2009-12-02 Robert Millan +2009-12-02 Robert Millan Use the same reboot approach on i386 coreboot and qemu as we do on BIOS. @@ -34066,14 +34066,14 @@ * conf/i386-coreboot.rmk (kernel_img_HEADERS): Add `cpu/reboot.h'. (reboot_mod_SOURCES): Remove `kern/i386/reboot.c'. * kern/i386/reboot.c: Remove. - * include/grub/i386/reboot.h (grub_reboot): Export function. - * kern/i386/pc/startup.S (grub_reboot): Move from here ... - * kern/i386/realmode.S (grub_reboot): ... to here. Jump to + * include/VasEBoot/i386/reboot.h (VasEBoot_reboot): Export function. + * kern/i386/pc/startup.S (VasEBoot_reboot): Move from here ... + * kern/i386/realmode.S (VasEBoot_reboot): ... to here. Jump to 0xf000:0xfff0 instead of 0xffff:0x0000. - [!GRUB_MACHINE_PCBIOS] (prot_to_real): Do not restore interrupts. + [!VasEBoot_MACHINE_PCBIOS] (prot_to_real): Do not restore interrupts. * kern/i386/qemu/startup.S: Include `"../realmode.S"'. -2009-11-30 Robert Millan +2009-11-30 Robert Millan Fix $srcdir != $objdir build. @@ -34082,24 +34082,24 @@ 2009-11-29 Samuel Thibault - Fix GNU/Hurd grub-install crash. - * util/grub-probe.c (probe): Try to access `path' only when it is not + Fix GNU/Hurd VasEBoot-install crash. + * util/VasEBoot-probe.c (probe): Try to access `path' only when it is not NULL. 2009-11-28 Vladimir Serbinenko Correct module naming. - * video/efi_uga.c (GRUB_MOD_INIT(efi_fb)): Renamed from this ... - (GRUB_MOD_INIT(efi_uga)): ... to this - (GRUB_MOD_FINI(efi_fb)): Renamed from this ... - (GRUB_MOD_FINI(efi_uga)): ... to this - * video/efi_gop.c (GRUB_MOD_INIT(efi_fb)): Renamed from this ... - (GRUB_MOD_INIT(efi_gop)): ... to this - (GRUB_MOD_FINI(efi_fb)): Renamed from this ... - (GRUB_MOD_FINI(efi_gop)): ... to this + * video/efi_uga.c (VasEBoot_MOD_INIT(efi_fb)): Renamed from this ... + (VasEBoot_MOD_INIT(efi_uga)): ... to this + (VasEBoot_MOD_FINI(efi_fb)): Renamed from this ... + (VasEBoot_MOD_FINI(efi_uga)): ... to this + * video/efi_gop.c (VasEBoot_MOD_INIT(efi_fb)): Renamed from this ... + (VasEBoot_MOD_INIT(efi_gop)): ... to this + (VasEBoot_MOD_FINI(efi_fb)): Renamed from this ... + (VasEBoot_MOD_FINI(efi_gop)): ... to this -2009-11-28 Robert Millan +2009-11-28 Robert Millan * util/mkisofs/mkisofs.c (ld_options): Mark all `arg' strings as translatable. @@ -34109,10 +34109,10 @@ 2009-11-28 Vladimir Serbinenko GOP support. Based on patch from Bean - (http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00384.html) + (http://lists.gnu.org/archive/html/VasEBoot-devel/2009-08/msg00384.html) * video/efi_gop.c: New file. - * include/grub/efi/graphics_output.h: Likewise. + * include/VasEBoot/efi/graphics_output.h: Likewise. * conf/i386-efi.rmk (pkglib_MODULES): Add `efi_gop.mod'. (efi_fb_mod_SOURCES, efi_fb_mod_CFLAGS, efi_fb_mod_LDFLAGS): New variables. @@ -34139,13 +34139,13 @@ (efi_fb_mod_LDFLAGS): Rename this ... (efi_uga_mod_LDFLAGS): ... to this. * video/efi_fb.c: Move this ... - * video/efi_uga.c: ... to this. Change prefix to 'grub_video_uga_'. + * video/efi_uga.c: ... to this. Change prefix to 'VasEBoot_video_uga_'. -2009-11-27 Robert Millan +2009-11-27 Robert Millan * po/README: New file. Explain our PO file workflow. -2009-11-27 Robert Millan +2009-11-27 Robert Millan * po/ChangeLog: Remove. Move relevant entries back to ... * ChangeLog: ... here. @@ -34155,7 +34155,7 @@ * Makefile.in (LINGUAS): Initialize in a way that supports empty set. -2009-11-27 Robert Millan +2009-11-27 Robert Millan * Makefile.in (LINGUAS): Rewrite by scanning po/ directory instead of reliing on po/LINGUAS. @@ -34164,15 +34164,15 @@ 2009-11-26 Felix Zielcke - * util/i386/efi/grub-mkimage.c: Include "progname.h". + * util/i386/efi/VasEBoot-mkimage.c: Include "progname.h". (main): Use `program_name' instead of nonexistent `progname'. 2009-11-26 Felix Zielcke - * conf/i386-efi.rmk (grub_mkimage_SOURCES): Add `gnulib/progname.c'. - * conf/x86_64-efi.rmk (grub_mkimage_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_mkimage_SOURCES): Add `gnulib/progname.c'. + * conf/x86_64-efi.rmk (VasEBoot_mkimage_SOURCES): Likewise. -2009-11-26 Robert Millan +2009-11-26 Robert Millan * conf/i386-coreboot.rmk: Cleanup stale filenames from my previous commit. @@ -34184,51 +34184,51 @@ 2009-11-26 Felix Zielcke - * conf/any-emu.rmk (grub_emu_SOURCES): Add `gnulib/progname.c'. + * conf/any-emu.rmk (VasEBoot_emu_SOURCES): Add `gnulib/progname.c'. 2009-11-26 Felix Zielcke - * conf/any-emu.rmk (grub_mkfont_SOURCES): Add `gnulib/progname.c'. + * conf/any-emu.rmk (VasEBoot_mkfont_SOURCES): Add `gnulib/progname.c'. -2009-11-26 Robert Millan +2009-11-26 Robert Millan - * conf/common.rmk (sbin_UTILITIES): Add `grub-mkdevicemap'. - (grub_mkdevicemap_SOURCES): New variable. - (grub_probe_SOURCES, grub_fstest_SOURCES, grub_mkfont_SOURCES) - (grub_mkrelpath_SOURCES, grub_editenv_SOURCES) - (grub_pe2elf_SOURCES): Add `gnulib/progname.c'. - * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-mkdevicemap'. - (grub_mkdevicemap_SOURCES): Remove. + * conf/common.rmk (sbin_UTILITIES): Add `VasEBoot-mkdevicemap'. + (VasEBoot_mkdevicemap_SOURCES): New variable. + (VasEBoot_probe_SOURCES, VasEBoot_fstest_SOURCES, VasEBoot_mkfont_SOURCES) + (VasEBoot_mkrelpath_SOURCES, VasEBoot_editenv_SOURCES) + (VasEBoot_pe2elf_SOURCES): Add `gnulib/progname.c'. + * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `VasEBoot-mkdevicemap'. + (VasEBoot_mkdevicemap_SOURCES): Remove. * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. - * util/elf/grub-mkimage.c: Include `' and `"progname.h"'. + * util/elf/VasEBoot-mkimage.c: Include `' and `"progname.h"'. (usage): Fix strings to use `program_name'. (main): Initialize gettext. - * util/grub-editenv.c: Likewise. - * util/grub-emu.c: Likewise. - * util/grub-fstest.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. - * util/grub-mkfont.c: Likewise. - * util/grub-mkrelpath.c: Likewise. - * util/grub-pe2elf.c: Likewise. - * util/grub-probe.c: Likewise. - * util/sparc64/ieee1275/grub-mkimage.c: Likewise. - * util/sparc64/ieee1275/grub-ofpathname.c: Likewise. - * util/sparc64/ieee1275/grub-setup.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. + * util/VasEBoot-emu.c: Likewise. + * util/VasEBoot-fstest.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/VasEBoot-mkfont.c: Likewise. + * util/VasEBoot-mkrelpath.c: Likewise. + * util/VasEBoot-pe2elf.c: Likewise. + * util/VasEBoot-probe.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-mkimage.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-ofpathname.c: Likewise. + * util/sparc64/ieee1275/VasEBoot-setup.c: Likewise. * util/misc.c: Include `"progname.h"'. (progname): Remove variable. - (grub_util_warn, grub_util_info, grub_util_error): Use `program_name'. + (VasEBoot_util_warn, VasEBoot_util_info, VasEBoot_util_error): Use `program_name'. 2009-11-25 Felix Zielcke - * util/grub.d/10_linux.in (linux_entry): Quote the arguments to + * util/VasEBoot.d/10_linux.in (linux_entry): Quote the arguments to printf and print a newline after the menuentry header line. - * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise. + * util/VasEBoot.d/10_kfreebsd.in (kfreebsd_entry): Likewise. 2009-11-25 Felix Zielcke @@ -34236,23 +34236,23 @@ * INSTALL: Note that autoconf 2.60 is required. * configure.ac (AC_PREREQ): Bump to 2.60. - * util/grub.d/10_kfreebsd.in (TEXTDOMAINDIR): Set to lowercased @localedir@. - * util/grub.d/10_linux.in (TEXTDOMAINDIR): Likewise. + * util/VasEBoot.d/10_kfreebsd.in (TEXTDOMAINDIR): Set to lowercased @localedir@. + * util/VasEBoot.d/10_linux.in (TEXTDOMAINDIR): Likewise. 2009-11-25 Yves Blusseau * configure.ac: move the call to AM_GNU_GETTEXT to avoid warnings when aclocal is run. -2009-11-25 Robert Millan +2009-11-25 Robert Millan - * normal/main.c (grub_normal_read_line): Fix off-by-one + * normal/main.c (VasEBoot_normal_read_line): Fix off-by-one buffer overflow. -2009-11-25 Robert Millan +2009-11-25 Robert Millan - * normal/main.c (grub_normal_execute): Replace "parser.sh" with - "parser.grub" in grub_command_execute() call. + * normal/main.c (VasEBoot_normal_execute): Replace "parser.sh" with + "parser.VasEBoot" in VasEBoot_command_execute() call. 2009-11-24 Carles Pina i Estany @@ -34263,20 +34263,20 @@ * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. - * gettext/gettex.c: Include . - * include/grub/misc.h (grub_gettext_dummy, grub_gettext): Move from + * gettext/gettex.c: Include . + * include/VasEBoot/misc.h (VasEBoot_gettext_dummy, VasEBoot_gettext): Move from here ... - * include/grub/i18n.h: ... to here - * include/grub/i18n.h: ... to here. - * kern/misc.c: Include - (grub_gettext_dummy): Move above user. + * include/VasEBoot/i18n.h: ... to here + * include/VasEBoot/i18n.h: ... to here. + * kern/misc.c: Include + (VasEBoot_gettext_dummy): Move above user. 2009-11-24 Felix Zielcke * util/Makefile.in (install-local): Convert a `for' into a normal shell expansion. -2009-11-24 Robert Millan +2009-11-24 Robert Millan * autogen.sh: Add automake call. * config.guess: Remove. @@ -34294,74 +34294,74 @@ 2009-11-24 Felix Zielcke - * conf/i386-coreboot.rmk (grub_mkimage_SOURCES): Add `gnulib/progname.c'. + * conf/i386-coreboot.rmk (VasEBoot_mkimage_SOURCES): Add `gnulib/progname.c'. 2009-11-24 Felix Zielcke - * util/grub-mkrelpath.c: New file. - * conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath. - (grub_mkrelpath_SOURCES): New variable. - * include/grub/util/misc.h: New function prototype. + * util/VasEBoot-mkrelpath.c: New file. + * conf/common.rmk (bin_UTILITIES): Add VasEBoot-mkrelpath. + (VasEBoot_mkrelpath_SOURCES): New variable. + * include/VasEBoot/util/misc.h: New function prototype. * util/misc.c (make_system_path_relative_to_its_root): New function. - * util/grub-mkconfig_lib.in (bindir): New variable. - (grub_mkrelpath): Likewise. - (make_system_path_relative_to_its_root): Use grub-mkrelpath. + * util/VasEBoot-mkconfig_lib.in (bindir): New variable. + (VasEBoot_mkrelpath): Likewise. + (make_system_path_relative_to_its_root): Use VasEBoot-mkrelpath. * util/probe.c (probe): Make the file path relative to its root. - Change a info message to use the GRUB path. Enable again the - check if we can read the file with GRUB facilities. + Change a info message to use the VasEBoot path. Enable again the + check if we can read the file with VasEBoot facilities. - * util/i386/pc/grub-setup.c (setup): Make core.img path relative + * util/i386/pc/VasEBoot-setup.c (setup): Make core.img path relative to its root. 2009-11-24 Felix Zielcke - * Makefile.in: Don't include GRUB_CONTRIB makefiles with emu + * Makefile.in: Don't include VasEBoot_CONTRIB makefiles with emu platform. 2009-11-24 Felix Zielcke - * util/getroot.c (grub_util_get_dev_abstraction): Properly use + * util/getroot.c (VasEBoot_util_get_dev_abstraction): Properly use strncmp(). 2009-11-24 Felix Zielcke - * util/getroot.c (grub_util_is_dmraid): New function. - (grub_util_get_dev_abstraction): Treat dmraid and multipath + * util/getroot.c (VasEBoot_util_is_dmraid): New function. + (VasEBoot_util_get_dev_abstraction): Treat dmraid and multipath devices as normal ones, not as LVM. 2009-11-23 Carles Pina i Estany - * conf/common.rmk: Add grub-gettext_lib target and updates + * conf/common.rmk: Add VasEBoot-gettext_lib target and updates lib_DATA and CLEANFILES. Adds gettext.mod SOURCES, CFLAGS, LDFLAGS. * gettext/gettext.c: New file. (Reads mo files). - * include/grub/file.h (grub_file_pread): New prototype. - * include/grub/i18n.h (_): New prototype. - * include/grub/misc.h (grub_gettext_dummy, grub_gettext): New + * include/VasEBoot/file.h (VasEBoot_file_pread): New prototype. + * include/VasEBoot/i18n.h (_): New prototype. + * include/VasEBoot/misc.h (VasEBoot_gettext_dummy, VasEBoot_gettext): New prototypes. - * kern/misc.c (grub_gettext_dummy): New function. - * normal/menu_text.c: Include . + * kern/misc.c (VasEBoot_gettext_dummy): New function. + * normal/menu_text.c: Include . * normal/menu_text.c (print_timeout): Gettexttize string. * normal/menu_text.c (print_message): Gettexttize string. * po/POTFILES: Add `normal/menu_text.c'. * po/ca.po: Add new translations. - * util/grub.d/00_header.in: Define locale_dir and lang. insmod - gettext module and defines locale_dir and lang in grub.cfg. + * util/VasEBoot.d/00_header.in: Define locale_dir and lang. insmod + gettext module and defines locale_dir and lang in VasEBoot.cfg. * NEWS: Add gettext support. -2009-11-23 Robert Millan +2009-11-23 Robert Millan - * util/hostdisk.c: Include `'. - (find_grub_drive): Use ARRAY_SIZE for map size calculation. + * util/hostdisk.c: Include `'. + (find_VasEBoot_drive): Use ARRAY_SIZE for map size calculation. (make_device_name): Rewrite using asprintf. (convert_system_partition_to_system_disk): Replace 0 with NULL. (find_system_device): If a device is not found, generate one just by reusing the OS path name. (read_device_map): Make it permissible for device.map not to exist. -2009-11-23 Robert Millan +2009-11-23 Robert Millan * script/sh/execute.c: Move from here ... * script/execute.c: ... to here. Update all users. @@ -34376,33 +34376,33 @@ * script/sh/script.c: Move from here ... * script/script.c: ... to here. Update all users. -2009-11-23 Robert Millan +2009-11-23 Robert Millan * configure.ac: Detect all `emu' platforms. Define - GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove - --enable-grub-emu logic. Disable include/grub/machine + VasEBoot_MACHINE_* macros in TARGET_CFLAGS. Remove + --enable-VasEBoot-emu logic. Disable include/VasEBoot/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. - * include/grub/i386/coreboot/machine.h: Remove file. - * include/grub/i386/efi/machine.h: Likewise. - * include/grub/i386/ieee1275/machine.h: Likewise. - * include/grub/i386/pc/machine.h: Likewise. - * include/grub/i386/qemu/machine.h: Likewise. - * include/grub/powerpc/ieee1275/machine.h: Likewise. - * include/grub/sparc64/ieee1275/machine.h: Likewise. - * include/grub/x86_64/efi/machine.h: Likewise. + * include/VasEBoot/i386/coreboot/machine.h: Remove file. + * include/VasEBoot/i386/efi/machine.h: Likewise. + * include/VasEBoot/i386/ieee1275/machine.h: Likewise. + * include/VasEBoot/i386/pc/machine.h: Likewise. + * include/VasEBoot/i386/qemu/machine.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/machine.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/machine.h: Likewise. + * include/VasEBoot/x86_64/efi/machine.h: Likewise. - * commands/acpi.c: Remove `'. + * commands/acpi.c: Remove `'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. - * include/grub/autoefi.h: Likewise. - * include/grub/i386/at_keyboard.h: Likewise. - * include/grub/i386/kernel.h: Likewise. - * include/grub/i386/loader.h: Likewise. - * include/grub/i386/pc/memory.h: Likewise. + * include/VasEBoot/autoefi.h: Likewise. + * include/VasEBoot/i386/at_keyboard.h: Likewise. + * include/VasEBoot/i386/kernel.h: Likewise. + * include/VasEBoot/i386/loader.h: Likewise. + * include/VasEBoot/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. @@ -34411,46 +34411,46 @@ * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. - * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove - `' - [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. - * util/misc.c: Remove `' and - `'. + * include/VasEBoot/time.h [!VasEBoot_MACHINE_EMU]: Remove + `' + [!VasEBoot_MACHINE_EMU] (VasEBoot_TICKS_PER_SECOND): New macro. + * util/misc.c: Remove `' and + `'. - * Makefile.in (enable_grub_emu): Remove variable. + * Makefile.in (enable_VasEBoot_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. - * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) - (grub_emu_init.c): Move from here ... + * conf/common.rmk (VasEBoot_emu_init.lst, VasEBoot_emu_init.h) + (VasEBoot_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. - * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. - (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... + * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `VasEBoot-emu'. + (VasEBoot_emu_SOURCES, VasEBoot_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here. -2009-11-23 Robert Millan +2009-11-23 Robert Millan - * include/grub/parser.h (grub_parser_register): Document need + * include/VasEBoot/parser.h (VasEBoot_parser_register): Document need of `name' parameter. - * normal/main.c (grub_normal_read_line): Simplify prompt string. - * script/sh/main.c (grub_sh_parser, GRUB_MOD_INIT(sh)): Rename - "sh" to "grub". + * normal/main.c (VasEBoot_normal_read_line): Simplify prompt string. + * script/sh/main.c (VasEBoot_sh_parser, VasEBoot_MOD_INIT(sh)): Rename + "sh" to "VasEBoot". -2009-11-23 Robert Millan +2009-11-23 Robert Millan * Makefile.in ($(srcdir)/po/$(PACKAGE).pot): Pass --keyword=N_ to `$(XGETTEXT)'. - * include/grub/i18n.h (N_): New macro. + * include/VasEBoot/i18n.h (N_): New macro. * util/mkisofs/mkisofs.h: Likewise. * util/mkisofs/mkisofs.c (ld_options): Wrap all translatable strings around N_(). (usage): Use gettext() to translate help strings when printing them. -2009-11-23 Robert Millan +2009-11-23 Robert Millan Based on patch from Bean - (http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00384.html) + (http://lists.gnu.org/archive/html/VasEBoot-devel/2009-08/msg00384.html) * video/efi_fb.c: New file. * conf/i386-efi.rmk (pkglib_MODULES): Add `efi_fb.mod'. @@ -34458,17 +34458,17 @@ variables. * conf/x86_64-efi.rmk: Likewise. -2009-11-22 Robert Millan +2009-11-22 Robert Millan - * util/i386/pc/grub-mkimage.c: Ungettextize grub_util_info() strings. - * util/i386/pc/grub-setup.c: Likewise. + * util/i386/pc/VasEBoot-mkimage.c: Ungettextize VasEBoot_util_info() strings. + * util/i386/pc/VasEBoot-setup.c: Likewise. 2009-11-21 Samuel Thibault * util/getroot.c [__GNU__]: Include , , and - [__GNU__] (grub_guess_root_device): Call file_name_lookup and - file_get_storage_info to implement grub_guess_root_device. + [__GNU__] (VasEBoot_guess_root_device): Call file_name_lookup and + file_get_storage_info to implement VasEBoot_guess_root_device. 2009-11-21 Felix Zielcke @@ -34478,16 +34478,16 @@ 2009-11-21 Felix Zielcke - * util/grub-mkrescue.in: Print an error and usage if output option + * util/VasEBoot-mkrescue.in: Print an error and usage if output option has not been given. 2009-11-21 Felix Zielcke Patch from Loïc Minier . - * util/grub.d/30_os-prober.in: Cope with Linux entries where + * util/VasEBoot.d/30_os-prober.in: Cope with Linux entries where root and /boot are on different devices. -2009-11-21 Robert Millan +2009-11-21 Robert Millan Fix build for srcdir != objdir. @@ -34498,16 +34498,16 @@ ($(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po): ... this. Use $^ reference for input. -2009-11-21 Robert Millan +2009-11-21 Robert Millan - * util/grub-mkrescue.in: Use source directory direcly (without copiing + * util/VasEBoot-mkrescue.in: Use source directory direcly (without copiing or hardlinking it). Remove -J option, Joliet is not compatible with multiple source directories. 2009-11-21 Carles Pina i Estany -2009-11-21 Robert Millan +2009-11-21 Robert Millan - * util/grub-mkrescue.in: Recognize `--override-directory' option. + * util/VasEBoot-mkrescue.in: Recognize `--override-directory' option. (process_input_dir): New function. Process an arbitrary input directory. Misc adjustments to support both "override mode" and system-wide mode. @@ -34522,12 +34522,12 @@ * configure.ac: Add `/usr/share/fonts/X11/misc/unifont.pcf.gz' to the list of unifont files to look for. -2009-11-19 Robert Millan +2009-11-19 Robert Millan Patch from Joe Auricchio - * commands/minicmd.c (grub_mini_cmd_clear): New function. - (GRUB_MOD_INIT(minicmd)): Register grub_mini_cmd_clear(). - (GRUB_MOD_FINI(minicmd)): Unregister grub_mini_cmd_clear(). + * commands/minicmd.c (VasEBoot_mini_cmd_clear): New function. + (VasEBoot_MOD_INIT(minicmd)): Register VasEBoot_mini_cmd_clear(). + (VasEBoot_MOD_FINI(minicmd)): Unregister VasEBoot_mini_cmd_clear(). 2009-11-19 Felix Zielcke @@ -34535,25 +34535,25 @@ 2009-11-19 Felix Zielcke - * include/grub/x86_64/io.h: New file. + * include/VasEBoot/x86_64/io.h: New file. -2009-11-19 Robert Millan +2009-11-19 Robert Millan - * conf/i386-pc.rmk (grub_setup_SOURCES): Add `gnulib/progname.c'. - * util/i386/pc/grub-setup.c: Include `'. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add `gnulib/progname.c'. + * util/i386/pc/VasEBoot-setup.c: Include `'. Include `"progname.h"'. (main): Initialize gettext. - * util/i386/pc/grub-setup.c: Gettexttize. - * util/i386/pc/grub-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Gettexttize. + * util/i386/pc/VasEBoot-mkimage.c: Likewise. * Makefile.in (po/*.po): Redefine as ... ($(foreach lang, $(LINGUAS), po/$(lang).po)): ... this. - * po/POTFILES: Add `util/i386/pc/grub-setup.c'. + * po/POTFILES: Add `util/i386/pc/VasEBoot-setup.c'. -2009-11-19 Robert Millan +2009-11-19 Robert Millan - * conf/common.rmk (grub_mkisofs_SOURCES): Add `gnulib/progname.c'. + * conf/common.rmk (VasEBoot_mkisofs_SOURCES): Add `gnulib/progname.c'. * util/mkisofs/mkisofs.c: Include `"progname.h"'. (program_name): Remove. (main): Initialize gettext support. @@ -34571,7 +34571,7 @@ * po/POTFILES: Update with new files. -2009-11-18 Robert Millan +2009-11-18 Robert Millan * util/mkisofs/eltorito.c: Fix minor mistake in license text. * util/mkisofs/iso9660.h: Likewise. @@ -34590,32 +34590,32 @@ * util/mkisofs/tree.c: Likewise. * util/mkisofs/write.c: Likewise. -2009-11-18 Robert Millan +2009-11-18 Robert Millan * util/mkisofs/match.c: Rewrite from scratch, using a linked list instead of static allocation. * util/mkisofs/match.h: Likewise. -2009-11-18 Robert Millan +2009-11-18 Robert Millan - * po/POTFILES-shell: New file. List `util/grub.d/10_kfreebsd.in' - and `util/grub.d/10_linux.in'. + * po/POTFILES-shell: New file. List `util/VasEBoot.d/10_kfreebsd.in' + and `util/VasEBoot.d/10_linux.in'. * Makefile.in (po/$(PACKAGE).pot): Process `po/POTFILES-shell' for translatable Shell files. -2009-11-18 Robert Millan +2009-11-18 Robert Millan * Makefile.in ($(srcdir)/aclocal.m4): New target. -2009-11-17 Robert Millan +2009-11-17 Robert Millan * INSTALL: Document Automake is needed for bootstrap. * po/ca.po: Fix PO-Revision-Date and Language-Team fields. - * util/grub.d/10_kfreebsd.in (bindir): New variable. + * util/VasEBoot.d/10_kfreebsd.in (bindir): New variable. Add gettext initialization. (kfreebsd_entry): Make menuentry output translatable. -2009-11-17 Robert Millan +2009-11-17 Robert Millan * Makefile.in (XGETTEXT, MSGMERGE, MSGFMT): New variables. (po/$(PACKAGE).pot): Replace `xgettext' with `$(XGETTEXT)'. @@ -34624,62 +34624,62 @@ (LINGUAS): Auto-generate using `po/LINGUAS'. * po/LINGUAS: New file. -2009-11-17 Robert Millan +2009-11-17 Robert Millan * configure.ac: Call AM_GNU_GETTEXT() (defines localedir, among other things). * Makefile.in (CPPFLAGS): Add `-DLOCALEDIR=\"$(localedir)\"'. - * util/i386/pc/grub-mkimage.c (main): Issue setlocale() and + * util/i386/pc/VasEBoot-mkimage.c (main): Issue setlocale() and bindtextdomain() calls for gettext initialization. -2009-11-17 Robert Millan +2009-11-17 Robert Millan * gnulib/progname.c: New file (imported from Gnulib). * gnulib/progname.h: Likewise. - * conf/i386-pc.rmk (grub_mkimage_SOURCES): Add `gnulib/progname.c'. - * util/i386/pc/grub-mkimage.c: Include `"progname.h"'. + * conf/i386-pc.rmk (VasEBoot_mkimage_SOURCES): Add `gnulib/progname.c'. + * util/i386/pc/VasEBoot-mkimage.c: Include `"progname.h"'. (usage): Replace `progname' with `program_name'. (main): Use set_program_name() for program name initialization. -2009-11-17 Robert Millan +2009-11-17 Robert Millan - * conf/common.rmk (grub_mkisofs_CFLAGS): Move `-I$(srcdir)/gnulib' + * conf/common.rmk (VasEBoot_mkisofs_CFLAGS): Move `-I$(srcdir)/gnulib' from here ... * Makefile.in (CPPFLAGS): ... to here. -2009-11-16 Robert Millan +2009-11-16 Robert Millan * aclocal.m4: Move from here ... * acinclude.m4: ... to here. * autogen.sh: Add call to `aclocal'. * configure.ac: Add AM_INIT_AUTOMAKE() after AC_INIT() call. -2009-11-16 Robert Millan +2009-11-16 Robert Millan * Makefile.in (CLEANFILES): Add `po/*.mo'. (LINGUAS): New variable. (all-local): Add `$(foreach lang, $(LINGUAS), po/$(lang).mo)'. (install-local): Install MO files. (po/$(PACKAGE).pot, po/*.po, po/%.mo): New rules. - * include/grub/i18n.h: New file. + * include/VasEBoot/i18n.h: New file. * po/POTFILES: New file. * po/ca.po: New file. - * util/grub.d/10_linux.in (bindir): New variable. + * util/VasEBoot.d/10_linux.in (bindir): New variable. Add gettext initialization. (linux_entry): Make menuentry output translatable. - * util/i386/pc/grub-mkimage.c: Include `'. + * util/i386/pc/VasEBoot-mkimage.c: Include `'. (usage): Make --help output translatable. (main): Initialize gettext. -2009-11-17 Robert Millan +2009-11-17 Robert Millan * import_gcry.py: New file (written by Vladimir with minor adjustments). - * autogen.sh: Use import_gcry.py to auto-generate GRUB-ified + * autogen.sh: Use import_gcry.py to auto-generate VasEBoot-ified ciphers. * INSTALL: Document that Python is required for bootstrap. -2009-11-17 Robert Millan +2009-11-17 Robert Millan Import ciphers from libgcrypt 1.4.4. @@ -34721,13 +34721,13 @@ * lib/libgcrypt/cipher/twofish.c * lib/libgcrypt/cipher/whirlpool.c -2009-11-16 Robert Millan +2009-11-16 Robert Millan Fix build for systems without error(). * gnulib/error.c: New file (imported from Gnulib). * gnulib/error.h: Likewise. - * conf/common.rmk (grub_mkisofs_SOURCES): Add `gnulib/error.c'. + * conf/common.rmk (VasEBoot_mkisofs_SOURCES): Add `gnulib/error.c'. * util/mkisofs/mkisofs.c (program_name): Remove `static' qualifier (this variable is now used by error()). @@ -34738,17 +34738,17 @@ 2009-11-16 Vladimir Serbinenko - * fs/i386/pc/pxe.c (grub_pxefs_open): Correctly handle PXE choosing + * fs/i386/pc/pxe.c (VasEBoot_pxefs_open): Correctly handle PXE choosing blocksize different from specified. - (grub_pxefs_read): Likewise. + (VasEBoot_pxefs_read): Likewise. 2009-11-16 Felix Zielcke Enable ata.mod on x86_64-efi, i386-efi and i386-ieee1275. - * disk/ata.c (grub_ata_dumpinfo): Add a cast. - (grub_ata_readwrite): Likewise. Update 2 format strings. - (grub_atapi_read): Likewise. + * disk/ata.c (VasEBoot_ata_dumpinfo): Add a cast. + (VasEBoot_ata_readwrite): Likewise. Update 2 format strings. + (VasEBoot_atapi_read): Likewise. * conf/i386-coreboot.rmk (pkglib_MODULES): Move `ata.mod' from here ... * conf/i386.rmk (pkglib_MODULES): ... to here ... @@ -34760,15 +34760,15 @@ * conf/i386-pc.rmk (pkglib_MODULES): Remove `ata.mod' (ata_mod_SOURCES, ata_mod_CFLAGS, ata_mod_LDFLAGS): Remove. -2009-11-16 Robert Millan +2009-11-16 Robert Millan Relicense multiboot.h, with RMS' blessing. * include/multiboot.h: Change to X11 license. -2009-11-15 Robert Millan +2009-11-15 Robert Millan - Support --version in grub-mkisofs. + Support --version in VasEBoot-mkisofs. * util/mkisofs/mkisofs.c (rcsid): Remove variable. (OPTION_VERSION): New macro. @@ -34782,48 +34782,48 @@ * Makefile.in (TARGET_CPPFLAGS): Replace `-isystem=$(srcdir)/include' with `-nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include)'. -2009-11-14 Robert Millan +2009-11-14 Robert Millan Fix help2man generation for mkisofs. * util/mkisofs/mkisofs.c (ld_options): Recognize --help. (usage): Send output to stdout (rather than stderr). -2009-11-14 Robert Millan +2009-11-14 Robert Millan - * conf/i386-coreboot.rmk (grub_mkrescue_SOURCES): Replace - `util/i386/coreboot/grub-mkrescue.in' with `util/grub-mkrescue.in'. - * conf/i386-pc.rmk (grub_mkrescue_SOURCES): Replace - `util/i386/pc/grub-mkrescue.in' with `util/grub-mkrescue.in'. - (bin_SCRIPTS): Add `grub-mkfloppy'. - (grub_mkfloppy_SOURCES): New variable. + * conf/i386-coreboot.rmk (VasEBoot_mkrescue_SOURCES): Replace + `util/i386/coreboot/VasEBoot-mkrescue.in' with `util/VasEBoot-mkrescue.in'. + * conf/i386-pc.rmk (VasEBoot_mkrescue_SOURCES): Replace + `util/i386/pc/VasEBoot-mkrescue.in' with `util/VasEBoot-mkrescue.in'. + (bin_SCRIPTS): Add `VasEBoot-mkfloppy'. + (VasEBoot_mkfloppy_SOURCES): New variable. - * util/grub-mkrescue.in: New file. - * util/i386/pc/grub-mkfloppy.in: New file. + * util/VasEBoot-mkrescue.in: New file. + * util/i386/pc/VasEBoot-mkfloppy.in: New file. - * util/i386/coreboot/grub-mkrescue.in: Remove. - * util/i386/pc/grub-mkrescue.in: Remove. + * util/i386/coreboot/VasEBoot-mkrescue.in: Remove. + * util/i386/pc/VasEBoot-mkrescue.in: Remove. -2009-11-13 Robert Millan +2009-11-13 Robert Millan - * include/grub/multiboot.h (struct grub_multiboot_header): Move + * include/VasEBoot/multiboot.h (struct VasEBoot_multiboot_header): Move from here ... * include/multiboot.h (struct multiboot_header): ... to here. Update all users. - * include/grub/multiboot.h (struct grub_multiboot_info): Move + * include/VasEBoot/multiboot.h (struct VasEBoot_multiboot_info): Move from here ... * include/multiboot.h (struct multiboot_info): ... to here. Update all users. - * include/grub/multiboot.h (struct grub_multiboot_mmap_entry): Move + * include/VasEBoot/multiboot.h (struct VasEBoot_multiboot_mmap_entry): Move from here ... * include/multiboot.h (struct multiboot_mmap_entry): ... to here. Update all users. - * include/grub/multiboot.h (struct grub_mod_list): Move + * include/VasEBoot/multiboot.h (struct VasEBoot_mod_list): Move from here ... * include/multiboot.h (struct multiboot_mod_list): ... to here. Update all users. -2009-11-13 Robert Millan +2009-11-13 Robert Millan * include/multiboot2.h (multiboot_word): Rename from this ... (multiboot2_word): ... to this. Update all users. @@ -34844,7 +34844,7 @@ (multiboot_tag_end): Rename from this ... (multiboot2_tag_end): ... to this. Update all users. -2009-11-13 Robert Millan +2009-11-13 Robert Millan Disable Multiboot2 in i386-ieee1275. It didn't actually work, and on this platform we should support Multiboot1 first. @@ -34853,23 +34853,23 @@ (multiboot_mod_SOURCES, multiboot_mod_CFLAGS) (multiboot_mod_LDFLAGS, multiboot_mod_ASFLAGS): Remove. -2009-11-12 Robert Millan +2009-11-12 Robert Millan * util/mkisofs/eltorito.c (init_boot_catalog): Handle return code of write calls (converting them to fwrite() if they aren't already). (get_torito_desc): Likewise. * util/mkisofs/rock.c (generate_rock_ridge_attributes): Likewise. -2009-11-12 Robert Millan +2009-11-12 Robert Millan - * util/i386/pc/grub-install.in: Move from here ... - * util/grub-install.in: ... to here. Update all users. + * util/i386/pc/VasEBoot-install.in: Move from here ... + * util/VasEBoot-install.in: ... to here. Update all users. 2009-11-11 Colin Watson - * util/powerpc/ieee1275/grub-mkrescue.in: Fix --version output. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: Fix --version output. -2009-11-11 Robert Millan +2009-11-11 Robert Millan Support for El Torito without floppy emulation. @@ -34895,14 +34895,14 @@ Fix the generation of the man page. - * util/pc/i386/grub-install.in: Source - `${libdir}/grub/grub-mkconfig_lib' after options have been parsed. + * util/pc/i386/VasEBoot-install.in: Source + `${libdir}/VasEBoot/VasEBoot-mkconfig_lib' after options have been parsed. -2009-11-11 Robert Millan +2009-11-11 Robert Millan - Large file support for grub-mkisofs. + Large file support for VasEBoot-mkisofs. - * conf/common.rmk (grub_mkisofs_CFLAGS): Add `-D_FILE_OFFSET_BITS=64'. + * conf/common.rmk (VasEBoot_mkisofs_CFLAGS): Add `-D_FILE_OFFSET_BITS=64'. * util/mkisofs/mkisofs.c (next_extent, last_extent) (session_start): Upgrade type to `uint64_t'. Update all users. * util/mkisofs/mkisofs.h: Include `'. @@ -34930,16 +34930,16 @@ * util/mkisofs/mkisofs.c (ld_options): Fix a spelling mistake. -2009-11-09 Robert Millan +2009-11-09 Robert Millan * util/mkisofs/fnmatch.c: Remove. * util/mkisofs/getopt1.c: Likewise. * util/mkisofs/getopt.c: Likewise. - * conf/common.rmk (grub_mkisofs_SOURCES): Replace + * conf/common.rmk (VasEBoot_mkisofs_SOURCES): Replace `util/mkisofs/fnmatch.c', `util/mkisofs/getopt1.c' and `util/mkisofs/getopt.c' with `gnulib/fnmatch.c', `gnulib/getopt1.c' and `gnulib/getopt.c'. - (grub_mkisofs_CFLAGS): Add `-I$(srcdir)/gnulib'. + (VasEBoot_mkisofs_CFLAGS): Add `-I$(srcdir)/gnulib'. * configure.ac: Detect `mingw32msvc' host_os. Check for lstat(), getuid() and getgid(). @@ -34954,12 +34954,12 @@ [!S_IROTH] (S_IROTH): New macro (dummy). [!S_IRGRP] (S_IRGRP): Likewise. -2009-11-09 Robert Millan +2009-11-09 Robert Millan * gnulib/fnmatch_loop.c (EXT): Fix warning (signed and unsigned type in conditional expression). -2009-11-09 Robert Millan +2009-11-09 Robert Millan Import from Gnulib. @@ -34972,67 +34972,67 @@ * gnulib/getopt_int.h: Likewise. * gnulib/gettext.h: Likewise. -2009-11-09 Robert Millan +2009-11-09 Robert Millan * normal/dyncmd.c (read_command_list): Replace `0' with `NULL'. * normal/handler.c (read_handler_list): Likewise. -2009-11-09 Robert Millan +2009-11-09 Robert Millan Misc cleanup. - * kern/command.c (grub_register_command_prio): Use - grub_zalloc() instead of explicitly zeroing data. - * kern/list.c: Include `'. - (grub_named_list_find): Replace `0' with `NULL'. - * normal/autofs.c (struct grub_fs_module_list): Remove ad-hoc type. - (fs_module_list): Change type to `grub_named_list_t'. Update all + * kern/command.c (VasEBoot_register_command_prio): Use + VasEBoot_zalloc() instead of explicitly zeroing data. + * kern/list.c: Include `'. + (VasEBoot_named_list_find): Replace `0' with `NULL'. + * normal/autofs.c (struct VasEBoot_fs_module_list): Remove ad-hoc type. + (fs_module_list): Change type to `VasEBoot_named_list_t'. Update all users. * normal/dyncmd.c (read_command_list): Add space between function call and parenthesis. * normal/handler.c (read_handler_list): Likewise. -2009-11-09 Robert Millan +2009-11-09 Robert Millan * normal/auth.c (punishment_delay): Moved from here ... - (grub_auth_strcmp): ... to here (inside function). + (VasEBoot_auth_strcmp): ... to here (inside function). -2009-11-09 Robert Millan +2009-11-09 Robert Millan - * include/grub/list.h (struct grub_named_list): Remove `const' + * include/VasEBoot/list.h (struct VasEBoot_named_list): Remove `const' qualifier from `name'. - (struct grub_prio_list): Likewise. + (struct VasEBoot_prio_list): Likewise. -2009-11-09 Robert Millan +2009-11-09 Robert Millan - * normal/auth.c: Include `'. - (grub_auth_strcmp): Replace `strcmp' with `grub_strcmp'. + * normal/auth.c: Include `'. + (VasEBoot_auth_strcmp): Replace `strcmp' with `VasEBoot_strcmp'. -2009-11-09 Robert Millan +2009-11-09 Robert Millan * normal/auth.c (punishment_delay): New variable. - (grub_auth_strcmp): Rewrite using grub_get_time_ms (). - (grub_auth_check_authentication): Punish failed login attempts with + (VasEBoot_auth_strcmp): Rewrite using VasEBoot_get_time_ms (). + (VasEBoot_auth_check_authentication): Punish failed login attempts with an incremental (2^N) delay. -2009-11-09 Robert Millan +2009-11-09 Robert Millan - * conf/common.rmk (grub_mkisofs_CFLAGS): Prefix include + * conf/common.rmk (VasEBoot_mkisofs_CFLAGS): Prefix include path with $(srcdir). 2009-11-09 Vladimir Serbinenko - * normal/auth.c (grub_auth_strcmp): Fixed incorrect variable usage. + * normal/auth.c (VasEBoot_auth_strcmp): Fixed incorrect variable usage. -2009-11-09 Robert Millan +2009-11-09 Robert Millan - * util/i386/coreboot/grub-mkrescue.in: New file. - * conf/i386-coreboot.rmk (bin_SCRIPTS, grub_mkrescue_SOURCES): New + * util/i386/coreboot/VasEBoot-mkrescue.in: New file. + * conf/i386-coreboot.rmk (bin_SCRIPTS, VasEBoot_mkrescue_SOURCES): New variables. - * conf/common.rmk (bin_UTILITIES): Add `grub-mkisofs'. - (grub_mkisofs_SOURCES, grub_mkisofs_CFLAGS): New variables. - * configure.ac: Add header and function checks to satisfy grub-mkisofs + * conf/common.rmk (bin_UTILITIES): Add `VasEBoot-mkisofs'. + (VasEBoot_mkisofs_SOURCES, VasEBoot_mkisofs_CFLAGS): New variables. + * configure.ac: Add header and function checks to satisfy VasEBoot-mkisofs requirements. * util/mkisofs/defaults.h: New file. * util/mkisofs/eltorito.c: Likewise. @@ -35059,30 +35059,30 @@ 2009-11-09 Vladimir Serbinenko - * normal/auth.c (grub_auth_strcmp): Fix bug which resulted in function + * normal/auth.c (VasEBoot_auth_strcmp): Fix bug which resulted in function being insecure. -2009-11-08 Robert Millan +2009-11-08 Robert Millan - * util/i386/pc/grub-mkrescue.in: Fix miss-identification as - `grub-mkimage' (and use $0 when possible). + * util/i386/pc/VasEBoot-mkrescue.in: Fix miss-identification as + `VasEBoot-mkimage' (and use $0 when possible). -2009-11-08 Robert Millan +2009-11-08 Robert Millan - * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve + * kern/i386/multiboot_mmap.c (VasEBoot_machine_mmap_init): Improve error message for excessively large memory map. -2009-11-08 Robert Millan +2009-11-08 Robert Millan * autogen.sh: Use `sh gendistlist.sh' to avoid reliing on executable bit. -2009-11-08 Robert Millan +2009-11-08 Robert Millan - * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve error + * kern/i386/multiboot_mmap.c (VasEBoot_machine_mmap_init): Improve error message for coreboot users. -2009-11-07 Robert Millan +2009-11-07 Robert Millan Fix build with GNU gold. @@ -35100,51 +35100,51 @@ 2009-11-03 Samuel Thibault - * util/grub.d/30_os-prober.in: Restore default behavior for unsupported + * util/VasEBoot.d/30_os-prober.in: Restore default behavior for unsupported OSes. 2009-11-02 Samuel Thibault - * util/grub.d/30_os-prober.in: Add GNU/Hurd support + * util/VasEBoot.d/30_os-prober.in: Add GNU/Hurd support 2009-11-02 Samuel Thibault - * util/grub.d/10_hurd.in: Drop /dev/ prefix from root device path before + * util/VasEBoot.d/10_hurd.in: Drop /dev/ prefix from root device path before giving it to GNU Mach. 2009-11-02 Samuel Thibault - * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Subtract 1 from - GNU partition number to get internal GRUB partition number. + * util/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Subtract 1 from + GNU partition number to get internal VasEBoot partition number. 2009-11-02 Samuel Thibault - * util/grub.d/10_hurd.in: Call prepare_grub_to_access_device - ${GRUB_DEVICE_BOOT} before loading /boot kernel. + * util/VasEBoot.d/10_hurd.in: Call prepare_VasEBoot_to_access_device + ${VasEBoot_DEVICE_BOOT} before loading /boot kernel. -2009-11-01 Robert Millan +2009-11-01 Robert Millan Based on patch from BVK Chaitanya - * kern/misc.c (grub_strchr, grub_strrchr): Fix to handle c == '\0' + * kern/misc.c (VasEBoot_strchr, VasEBoot_strrchr): Fix to handle c == '\0' case. 2009-11-01 Felix Zielcke * Makefile.in (TARGET_CPPFLAGS): Add `-I$(srcdir)/include'. -2009-10-30 Robert Millan +2009-10-30 Robert Millan Fix build problem. * Makefile.in (TARGET_CPPFLAGS): Replace `-nostdinc' with `-isystem=$(srcdir)/include'. -2009-10-30 Robert Millan +2009-10-30 Robert Millan - * util/i386/pc/grub-install.in: Remove hint that device.map should be - checked (grub-install doesn't currently rely on it). + * util/i386/pc/VasEBoot-install.in: Remove hint that device.map should be + checked (VasEBoot-install doesn't currently rely on it). -2009-10-29 Robert Millan +2009-10-29 Robert Millan Revert SVN r2660. @@ -35157,55 +35157,55 @@ * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. -2009-10-28 Robert Millan +2009-10-28 Robert Millan * Makefile.in (TARGET_CPPFLAGS): Add `-nostdinc'. -2009-10-28 Robert Millan +2009-10-28 Robert Millan - * include/grub/misc.h: Stop checking for APPLE_CC. + * include/VasEBoot/misc.h: Stop checking for APPLE_CC. -2009-10-28 Robert Millan +2009-10-28 Robert Millan - * kern/i386/coreboot/init.c (grub_exit): Reimplement in a way that + * kern/i386/coreboot/init.c (VasEBoot_exit): Reimplement in a way that doesn't cause an infinite call loop. 2009-10-28 Felix Zielcke - * commands/acpi.c (grub_cmd_acpi): Fix the out of memory error + * commands/acpi.c (VasEBoot_cmd_acpi): Fix the out of memory error strings. -2009-10-26 Robert Millan +2009-10-26 Robert Millan - * autogen.sh: Support addition of external modules via `GRUB_CONTRIB' + * autogen.sh: Support addition of external modules via `VasEBoot_CONTRIB' variable. * Makefile.in: Likewise. -2009-10-26 Robert Millan +2009-10-26 Robert Millan * gendistlist.sh: Simplify .svn check. Skip .bzr as well. -2009-10-26 Robert Millan +2009-10-26 Robert Millan * Makefile.in (RMKFILES): Rewrite using $(wildcard). -2009-10-26 Robert Millan +2009-10-26 Robert Millan - * disk/scsi.c: Remove `' (not needed). + * disk/scsi.c: Remove `' (not needed). -2009-10-26 Robert Millan +2009-10-26 Robert Millan * gensymlist.sh.in (COMPILE_TIME_ASSERT): Copy macro declaration from here ... - * include/grub/misc.h (COMPILE_TIME_ASSERT): ... to here. + * include/VasEBoot/misc.h (COMPILE_TIME_ASSERT): ... to here. -2009-10-26 Robert Millan +2009-10-26 Robert Millan - * Makefile.in (docs/grub.info): Use make syntax to ignore errors + * Makefile.in (docs/VasEBoot.info): Use make syntax to ignore errors in $(MAKEINFO) invocation. This makes it clear in output that errors are being ignored. -2009-10-26 Robert Millan +2009-10-26 Robert Millan * conf/i386-coreboot.rmk (script/sh/lexer.c_DEPENDENCIES): Moved from here ... @@ -35219,91 +35219,91 @@ 2009-10-26 Colin Watson - * util/grub-editenv.c (main): If only a command is given, use - DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG as a default file name. + * util/VasEBoot-editenv.c (main): If only a command is given, use + DEFAULT_DIRECTORY "/" VasEBoot_ENVBLK_DEFCFG as a default file name. (usage): FILENAME is now optional and has a default. 2009-10-26 Colin Watson - Improve grub-mkconfig performance when there are several menu + Improve VasEBoot-mkconfig performance when there are several menu entries on a single filesystem. - * util/grub.d/10_linux.in (linux_entry): Cache the output of - prepare_grub_to_access_device. - * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise. - * util/grub.d/30_os-prober.in: Likewise. + * util/VasEBoot.d/10_linux.in (linux_entry): Cache the output of + prepare_VasEBoot_to_access_device. + * util/VasEBoot.d/10_kfreebsd.in (kfreebsd_entry): Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. -2009-10-26 Robert Millan +2009-10-26 Robert Millan - * util/grub.d/10_freebsd.in: Remove. - * util/grub.d/10_kfreebsd.in: New file (based on 10_linux.in). + * util/VasEBoot.d/10_freebsd.in: Remove. + * util/VasEBoot.d/10_kfreebsd.in: New file (based on 10_linux.in). * configure.ac: Set host_kernel=kfreebsd for FreeBSD and GNU/kFreeBSD. -2009-10-26 Robert Millan +2009-10-26 Robert Millan - * docs/grub.cfg: Fix example usage of *BSD loaders. + * docs/VasEBoot.cfg: Fix example usage of *BSD loaders. -2009-10-25 Robert Millan +2009-10-25 Robert Millan - * util/i386/pc/grub-setup.c (setup): Add missing parameter to - grub_util_error() call. + * util/i386/pc/VasEBoot-setup.c (setup): Add missing parameter to + VasEBoot_util_error() call. -2009-10-25 Robert Millan +2009-10-25 Robert Millan - * include/grub/fs.h [GRUB_UTIL] (struct grub_fs): Add + * include/VasEBoot/fs.h [VasEBoot_UTIL] (struct VasEBoot_fs): Add `reserved_first_sector' member. - * fs/ext2.c [GRUB_UTIL] (grub_ext2_fs): Initialize + * fs/ext2.c [VasEBoot_UTIL] (VasEBoot_ext2_fs): Initialize `reserved_first_sector' to 1. - * fs/fat.c [GRUB_UTIL] (grub_fat_fs): Likewise. - * fs/ntfs.c [GRUB_UTIL] (grub_ntfs_fs): Likewise. - * fs/hfsplus.c [GRUB_UTIL] (grub_hfsplus_fs): Likewise. - * util/i386/pc/grub-setup.c (setup): Add safety check that probes for + * fs/fat.c [VasEBoot_UTIL] (VasEBoot_fat_fs): Likewise. + * fs/ntfs.c [VasEBoot_UTIL] (VasEBoot_ntfs_fs): Likewise. + * fs/hfsplus.c [VasEBoot_UTIL] (VasEBoot_hfsplus_fs): Likewise. + * util/i386/pc/VasEBoot-setup.c (setup): Add safety check that probes for filesystems which begin at first sector. (options): New option --skip-fs-probe. (main): Handle --skip-fs-probe and pass it to setup(). -2009-10-25 Robert Millan +2009-10-25 Robert Millan - * include/grub/misc.h: Fix wrong evaluation of APPLE_CC. + * include/VasEBoot/misc.h: Fix wrong evaluation of APPLE_CC. (memset): Fix function prototype. -2009-10-25 Robert Millan +2009-10-25 Robert Millan 2009-10-25 Vasily Averin - * fs/ext2.c (grub_ext2_iterate_dir): Avoid infinite loop when + * fs/ext2.c (VasEBoot_ext2_iterate_dir): Avoid infinite loop when `dirent.direntlen == 0'. -2009-10-25 Robert Millan +2009-10-25 Robert Millan * fs/cpio.c [MODE_USTAR]: Initialize `tar' module instead of `cpio'. [! MODE_USTAR]: Initialize `cpio' module instead of `tar'. -2009-10-25 Robert Millan +2009-10-25 Robert Millan * configure.ac: Check for `__ashldi3', `__ashrdi3', `__lshrdi3', `__trampoline_setup' and `__ucmpdi2'. - * include/grub/powerpc/libgcc.h: Only export symbols for functions + * include/VasEBoot/powerpc/libgcc.h: Only export symbols for functions that libgcc provides. -2009-10-25 Robert Millan +2009-10-25 Robert Millan - * include/grub/powerpc/libgcc.h (memset): Remove function prototype. - * include/grub/sparc64/libgcc.h (memset): Likewise. - * include/grub/misc.h (memset, memcmp): New function prototypes. + * include/VasEBoot/powerpc/libgcc.h (memset): Remove function prototype. + * include/VasEBoot/sparc64/libgcc.h (memset): Likewise. + * include/VasEBoot/misc.h (memset, memcmp): New function prototypes. -2009-10-25 Robert Millan +2009-10-25 Robert Millan * fs/cpio.c [MODE_USTAR]: Finish `tar' module instead of `cpio'. [! MODE_USTAR]: Finish `cpio' module instead of `tar'. -2009-10-25 Robert Millan +2009-10-25 Robert Millan Patch from Samuel Thibault - * docs/grub.cfg: Compensate for recent change in multiboot + * docs/VasEBoot.cfg: Compensate for recent change in multiboot loader (since 2009-08-14 it won't pass filename to payload). - * util/grub.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. 2009-10-21 Felix Zielcke @@ -35311,7 +35311,7 @@ repository. * config.sub: Likewise. -2009-10-20 Robert Millan +2009-10-20 Robert Millan Fix build on sparc64. @@ -35325,10 +35325,10 @@ * loader/i386/bsd.c (openbsd_root): New variable. (openbsd_opts): New option 'root'. (OPENBSD_ROOT_ARG): New macro. - (grub_openbsd_boot): Use 'openbsd_root'. - (grub_cmd_openbsd): Fill 'openbsd_root'. + (VasEBoot_openbsd_boot): Use 'openbsd_root'. + (VasEBoot_cmd_openbsd): Fill 'openbsd_root'. -2009-10-16 Robert Millan +2009-10-16 Robert Millan * NEWS: Misc adjustments. @@ -35336,7 +35336,7 @@ * NEWS: Mentioned XNU, ACPI, gptsync, password and parttool. -2009-10-16 Robert Millan +2009-10-16 Robert Millan * configure.ac: Bump version to 1.97. @@ -35345,21 +35345,21 @@ * configure.ac (TARGET_CFLAGS): Add -mno-mmx -mno-sse -mno-sse2 -mno-3dnow on x86 architectures. Some toolchains enable these features by default, but they rely on registers that aren't enabled - in GRUB. Thanks to Vladimir Serbinenko for the suggestion. + in VasEBoot. Thanks to Vladimir Serbinenko for the suggestion. -2009-10-15 Robert Millan +2009-10-15 Robert Millan Make entry text a bit more readable. - * util/grub.d/10_linux.in: Add `with' before `Linux'. + * util/VasEBoot.d/10_linux.in: Add `with' before `Linux'. 2009-10-15 Vladimir Serbinenko - * loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image. + * loader/i386/pc/xnu.c (VasEBoot_xnu_set_video): Fix loading splash image. 2009-10-15 Vladimir Serbinenko - * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise + * commands/xnu_uuid.c (VasEBoot_cmd_xnu_uuid): Remove duplicated bitwise operations. 2009-10-15 Vladimir Serbinenko @@ -35371,51 +35371,51 @@ Revert 2009-06-10 Pavel Roskin * configure.ac: Put checks for __bswapsi2 and __bswapdi2. - * include/grub/powerpc/libgcc.h: Don't use weak attribute for all + * include/VasEBoot/powerpc/libgcc.h: Don't use weak attribute for all exports. - * include/grub/sparc64/libgcc.h: Likewise. Use + * include/VasEBoot/sparc64/libgcc.h: Likewise. Use preprocessor conditionals. -2009-10-14 Robert Millan +2009-10-14 Robert Millan - * conf/common.rmk (grub-dumpbios): Remove rule. - (sbin_SCRIPTS, CLEANFILES): Remove `grub-dumpbios'. - * util/grub-dumpbios.in: Remove file. + * conf/common.rmk (VasEBoot-dumpbios): Remove rule. + (sbin_SCRIPTS, CLEANFILES): Remove `VasEBoot-dumpbios'. + * util/VasEBoot-dumpbios.in: Remove file. -2009-10-14 Robert Millan +2009-10-14 Robert Millan Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between the Operating System (FreeBSD) and its kernel (kernel of FreeBSD). - * loader/i386/bsd.c (grub_freebsd_boot): Read kernel environment + * loader/i386/bsd.c (VasEBoot_freebsd_boot): Read kernel environment from "kFreeBSD" namespace (rather than "FreeBSD"). Update all users. - (GRUB_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd", + (VasEBoot_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd", "openbsd" to "kopenbsd", "netbsd" to "knetbsd", "freebsd_loadenv" to "kfreebsd_loadenv", "freebsd_module" to "kfreebsd_module", and "freebsd_module_elf" to "kfreebsd_module_elf". Update all users. -2009-10-12 Robert Millan +2009-10-12 Robert Millan * term/tparm.c: Switch to GPLv3. -2009-10-09 Robert Millan +2009-10-09 Robert Millan - * include/grub/i386/cpuid.h: Add header protection. + * include/VasEBoot/i386/cpuid.h: Add header protection. -2009-10-09 Robert Millan +2009-10-09 Robert Millan Fail gracefuly when attempting to load 64-bit kFreeBSD on IA32 CPU. - * include/grub/i386/cpuid.h: New file. - * commands/i386/cpuid.c: Include `'. + * include/VasEBoot/i386/cpuid.h: New file. + * commands/i386/cpuid.c: Include `'. (has_longmode): Rename to ... - (grub_cpuid_has_longmode): ... this. Update all users. Remove + (VasEBoot_cpuid_has_longmode): ... this. Update all users. Remove `static' attribute. - * loader/i386/bsd.c: Include `'. - (grub_bsd_load_elf): Fail if load of 64-bit kernel was requested + * loader/i386/bsd.c: Include `'. + (VasEBoot_bsd_load_elf): Fail if load of 64-bit kernel was requested on a CPU that doesn't implement AMD64 instruction set. 2009-10-06 Colin Watson @@ -35430,36 +35430,36 @@ 2009-10-06 Colin Watson - * util/i386/pc/grub-install.in: Source - ${libdir}/grub/grub-mkconfig_lib before option processing, in order - that the --grub-probe option will work. - * util/sparc64/ieee1275/grub-install.in: Likewise. + * util/i386/pc/VasEBoot-install.in: Source + ${libdir}/VasEBoot/VasEBoot-mkconfig_lib before option processing, in order + that the --VasEBoot-probe option will work. + * util/sparc64/ieee1275/VasEBoot-install.in: Likewise. -2009-10-05 Robert Millan +2009-10-05 Robert Millan * configure.ac: Bump version to 1.97~beta4. -2009-10-03 Robert Millan +2009-10-03 Robert Millan - Resync grub-mkdevicemap in x86_64-efi. + Resync VasEBoot-mkdevicemap in x86_64-efi. - * conf/x86_64-efi.rmk (sbin_UTILITIES): Enable `grub-mkdevicemap'. - (grub_mkdevicemap_SOURCES): Add missing `util/deviceiter.c' and + * conf/x86_64-efi.rmk (sbin_UTILITIES): Enable `VasEBoot-mkdevicemap'. + (VasEBoot_mkdevicemap_SOURCES): Add missing `util/deviceiter.c' and `util/devicemap.c'. 2009-10-01 Colin Watson - * util/grub-editenv.c (create_envblk_file): Write new block with a + * util/VasEBoot-editenv.c (create_envblk_file): Write new block with a .new suffix and then rename it into place, to ensure atomic creation. -2009-09-28 Robert Millan +2009-09-28 Robert Millan Do not automatically install headers. * Makefile.in (include_DATA): Remove. Update all users. -2009-09-26 Robert Millan +2009-09-26 Robert Millan * conf/common.rmk (pkglib_MODULES): Remove `lua.mod'. (lua_mod_SOURCES, lua_mod_CFLAGS, lua_mod_LDFLAGS): Remove. @@ -35467,7 +35467,7 @@ * util/osdetect.lua: Remove. * script/lua/lauxlib.c: Likewise. * script/lua/ldebug.c: Likewise. - * script/lua/grub_main.c: Likewise. + * script/lua/VasEBoot_main.c: Likewise. * script/lua/lauxlib.h: Likewise. * script/lua/ldebug.h: Likewise. * script/lua/ltablib.c: Likewise. @@ -35479,11 +35479,11 @@ * script/lua/ldo.h: Likewise. * script/lua/loslib.c: Likewise. * script/lua/lundump.c: Likewise. - * script/lua/grub_lib.c: Likewise. + * script/lua/VasEBoot_lib.c: Likewise. * script/lua/ldblib.c: Likewise. * script/lua/lundump.h: Likewise. * script/lua/lmem.c: Likewise. - * script/lua/grub_lib.h: Likewise. + * script/lua/VasEBoot_lib.h: Likewise. * script/lua/lmathlib.c: Likewise. * script/lua/lstate.c: Likewise. * script/lua/ltm.c: Likewise. @@ -35495,7 +35495,7 @@ * script/lua/lvm.h: Likewise. * script/lua/llex.c: Likewise. * script/lua/lgc.c: Likewise. - * script/lua/grub_lua.h: Likewise. + * script/lua/VasEBoot_lua.h: Likewise. * script/lua/loadlib.c: Likewise. * script/lua/lfunc.c: Likewise. * script/lua/lopcodes.c: Likewise. @@ -35524,42 +35524,42 @@ 2009-09-26 Colin Watson - * docs/grub.texi (Command-line and menu entry commands): Document + * docs/VasEBoot.texi (Command-line and menu entry commands): Document date and echo commands. 2009-09-24 Pavel Roskin - * include/grub/kernel.h (struct grub_module_header): Remove - `grub_module_header_types'. Make `type' unsigned. Make `size' + * include/VasEBoot/kernel.h (struct VasEBoot_module_header): Remove + `VasEBoot_module_header_types'. Make `type' unsigned. Make `size' 32-bit on all platforms. - * util/elf/grub-mkimage.c (load_modules): Treat `type' as an - 8-bit field. Use grub_host_to_target32() for `size'. - * util/i386/efi/grub-mkimage.c (make_mods_section): Likewise. - * util/i386/pc/grub-mkimage.c (generate_image): Likewise. - * util/sparc64/ieee1275/grub-mkimage.c (generate_image): Likewise. + * util/elf/VasEBoot-mkimage.c (load_modules): Treat `type' as an + 8-bit field. Use VasEBoot_host_to_target32() for `size'. + * util/i386/efi/VasEBoot-mkimage.c (make_mods_section): Likewise. + * util/i386/pc/VasEBoot-mkimage.c (generate_image): Likewise. + * util/sparc64/ieee1275/VasEBoot-mkimage.c (generate_image): Likewise. -2009-09-24 Robert Millan +2009-09-24 Robert Millan Fix "lost keypress" bug in at_keyboard. - * term/i386/pc/at_keyboard.c (grub_at_keyboard_checkkey): New function. + * term/i386/pc/at_keyboard.c (VasEBoot_at_keyboard_checkkey): New function. Checks for readyness of input buffer (without flushing it). - (grub_at_keyboard_term): Use grub_at_keyboard_checkkey() rather - than grub_at_keyboard_getkey_noblock() for `checkkey' struct member. + (VasEBoot_at_keyboard_term): Use VasEBoot_at_keyboard_checkkey() rather + than VasEBoot_at_keyboard_getkey_noblock() for `checkkey' struct member. -2009-09-24 Robert Millan +2009-09-24 Robert Millan - * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific - size check within GRUB_MACHINE_PCBIOS section. + * util/i386/pc/VasEBoot-mkimage.c (generate_image): Enclose BIOS-specific + size check within VasEBoot_MACHINE_PCBIOS section. -2009-09-24 Robert Millan +2009-09-24 Robert Millan - * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate + * include/VasEBoot/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate return value. - * term/i386/pc/at_keyboard.c (grub_keyboard_getkey): Negate + * term/i386/pc/at_keyboard.c (VasEBoot_keyboard_getkey): Negate KEYBOARD_ISREADY check. - (grub_at_keyboard_checkkey): Rename to ... - (grub_at_keyboard_getkey_noblock): ... this. Update all users. + (VasEBoot_at_keyboard_checkkey): Rename to ... + (VasEBoot_at_keyboard_getkey_noblock): ... this. Update all users. Remove gratuitous cast. 2009-09-23 Colin Watson @@ -35567,16 +35567,16 @@ * configure.ac: Call AC_PROG_MKDIR_P. * Makefile.in (docs/stamp-vti): Create docs directory. Create version.texi in $(builddir) rather than $(srcdir). - (docs/grub.info): Create docs directory. Prepend $(builddir)/docs + (docs/VasEBoot.info): Create docs directory. Prepend $(builddir)/docs to makeinfo's @include search path. 2009-09-23 Felix Zielcke - * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Cope with `*.dpkg-*' + * util/VasEBoot-mkconfig_lib.in (VasEBoot_file_is_not_garbage): Cope with `*.dpkg-*' 2009-09-23 Felix Zielcke - * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Add support + * util/VasEBoot-mkconfig_lib.in (VasEBoot_file_is_not_garbage): Add support for `*.dpkg-new'. 2009-09-21 Colin Watson @@ -35589,7 +35589,7 @@ docs/version.texi. (MOSTLYCLEANFILES): Add vti.tmp. (docs/version.texi, docs/stamp-vti): Update automatically. - (docs/grub.info): Build info documentation. Use --force and ignore + (docs/VasEBoot.info): Build info documentation. Use --force and ignore errors for now. (all-local): Add $(INFOS). (install-local): Install info files. @@ -35606,7 +35606,7 @@ * util/hostdisk.c: Fix a comment. -2009-09-20 Robert Millan +2009-09-20 Robert Millan Fix regression introduced in r2539. @@ -35615,26 +35615,26 @@ 2009-09-19 Colin Watson - * util/grub.d/30_os-prober.in: Don't throw away stderr from + * util/VasEBoot.d/30_os-prober.in: Don't throw away stderr from os-prober. Under normal operation, it does not print anything to stderr; if it does, we need to debug it, and throwing away stderr makes that excessively difficult. 2009-09-16 Vladimir Serbinenko - * mmap/mmap.c (grub_cmd_badram): Fix off-by-one error. + * mmap/mmap.c (VasEBoot_cmd_badram): Fix off-by-one error. -2009-09-16 Robert Millan +2009-09-16 Robert Millan * aclocal.m4 (AC_LANG_PROGRAM): New macro. Overrides stock AC_LANG_PROGRAM from autoconf. - (grub_ASM_USCORE, grub_PROG_OBJCOPY_ABSOLUTE): Add missing + (VasEBoot_ASM_USCORE, VasEBoot_PROG_OBJCOPY_ABSOLUTE): Add missing prototypes (fixes warning). * configure.ac: Add `-Werror' to TARGET_CFLAGS unless `--disable-werror' was used. -2009-09-16 Robert Millan +2009-09-16 Robert Millan * partmap/msdos.c (pc_partition_map_iterate): Fix possible use of uninitialized `lastaddr'. @@ -35646,41 +35646,41 @@ 2009-09-14 Colin Watson * commands/test.c (get_fileinfo): Return immediately if - grub_fs_probe fails. + VasEBoot_fs_probe fails. 2009-09-14 José Martínez - * commands/acpi.c (grub_cmd_acpi): Fix loading ACPI tables from file. + * commands/acpi.c (VasEBoot_cmd_acpi): Fix loading ACPI tables from file. 2009-09-14 Colin Watson - * util/grub.d/30_os-prober.in: Cope with Windows 7 in os-prober + * util/VasEBoot.d/30_os-prober.in: Cope with Windows 7 in os-prober output. -2009-09-13 Robert Millan +2009-09-13 Robert Millan - * configure.ac: Remove --enable-grub-pe2elf. Only build - grub-pe2elf when needed by the build system itself. - * conf/common.rmk: Remove $(enable_grub_pe2elf) check. + * configure.ac: Remove --enable-VasEBoot-pe2elf. Only build + VasEBoot-pe2elf when needed by the build system itself. + * conf/common.rmk: Remove $(enable_VasEBoot_pe2elf) check. -2009-09-12 Robert Millan +2009-09-12 Robert Millan * configure.ac: Bump version to 1.97~beta3. * docs/version.texi: Likewise. -2009-09-12 Robert Millan +2009-09-12 Robert Millan - * video/i386/pc/vbe.c (grub_vbe_get_video_mode_info): Move packed - mode special handling (grub_vbe_bios_set_dac_palette_width() call) + * video/i386/pc/vbe.c (VasEBoot_vbe_get_video_mode_info): Move packed + mode special handling (VasEBoot_vbe_bios_set_dac_palette_width() call) from here ... - * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] - (grub_linux_setup_video): ... to here (with some adjustments). + * loader/i386/linux.c [VasEBoot_MACHINE_PCBIOS] + (VasEBoot_linux_setup_video): ... to here (with some adjustments). -2009-09-12 Robert Millan +2009-09-12 Robert Millan Fix memory corruption issue (spotted by Colin Watson). - * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette): Fix bug + * kern/i386/pc/startup.S (VasEBoot_vbe_bios_getset_dac_palette): Fix bug causing returned size to be stored in an incorrect memory location. Fix use of uninitialized value when storing the returned size. @@ -35694,8 +35694,8 @@ 2009-09-11 Colin Watson - * include/grub/ntfs.h (struct grub_fshelp_node): Change `size' - to grub_uint64_t. + * include/VasEBoot/ntfs.h (struct VasEBoot_fshelp_node): Change `size' + to VasEBoot_uint64_t. * fs/ntfs.c (init_file): Understand 64-bit sizes for non-resident files. @@ -35706,27 +35706,27 @@ 2009-09-10 Felix Zielcke - * util/grub-mkconfig.in: Make the created config mode 400 and + * util/VasEBoot-mkconfig.in: Make the created config mode 400 and print a warning if it fails. -2009-09-10 Robert Millan +2009-09-10 Robert Millan - * util/grub.d/40_custom.in: Ask user to type custom entries below + * util/VasEBoot.d/40_custom.in: Ask user to type custom entries below comment, rather than below 'exec tail' line. 2009-09-10 Colin Watson - * util/grub.d/40_custom.in: Make sure that the explanatory text is - visible in grub.cfg. + * util/VasEBoot.d/40_custom.in: Make sure that the explanatory text is + visible in VasEBoot.cfg. 2009-09-10 Colin Watson - * util/grub.d/40_custom.in: Make it a little clearer how to use this + * util/VasEBoot.d/40_custom.in: Make it a little clearer how to use this file. 2009-09-10 Felix Zielcke - * docs/grub.cfg: Add an example menu entry for memtest86+. + * docs/VasEBoot.cfg: Add an example menu entry for memtest86+. 2009-09-09 Felix Zielcke @@ -35735,15 +35735,15 @@ 2009-09-08 Colin Watson - * script/sh/execute.c (grub_script_execute_cmdline): Set "?" in + * script/sh/execute.c (VasEBoot_script_execute_cmdline): Set "?" in unknown-command case. Fixes bug #27320. 2009-09-08 Felix Zielcke - * kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try + * kern/rescue_parser.c (VasEBoot_rescue_parse_line): Only suggest to try `help' if the command exists. -2009-09-06 Robert Millan +2009-09-06 Robert Millan * INSTALL: Require GCC 4.1.3 or later. @@ -35753,27 +35753,27 @@ (MAINTAINER_CLEANFILES): add $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in -2009-09-05 Robert Millan +2009-09-05 Robert Millan - * util/grub-probe.c (probe): Comment out buggy codepath, which + * util/VasEBoot-probe.c (probe): Comment out buggy codepath, which was unexpectedly enabled by Colin Watson's 2009-09-02 fix. This should be re-enabled after 1.97. 2009-09-05 Felix Zielcke - * gendistlist.sh: Add `grub-dumpdevtree' and `*.lua' to the list + * gendistlist.sh: Add `VasEBoot-dumpdevtree' and `*.lua' to the list find searches for. 2009-09-04 Vladimir Serbinenko - * loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): Remove - unnecessary calls to grub_error. + * loader/i386/xnu.c (VasEBoot_cpu_xnu_fill_devicetree): Remove + unnecessary calls to VasEBoot_error. 2009-09-04 Colin Watson * NEWS: Mention `keystatus' and Unicode fonts. -2009-09-04 Robert Millan +2009-09-04 Robert Millan * configure.ac: Bump version to 1.97~beta2. * docs/version.texi: Likewise. @@ -35788,20 +35788,20 @@ 2009-09-02 Yves BLUSSEAU - Embedding loadenv module into grub-emu + Embedding loadenv module into VasEBoot-emu - * conf/i386-pc.rmk (grub_emu_SOURCES): add lib/envblk.c and + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): add lib/envblk.c and commands/loadenv.c - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Likewise + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise 2009-09-03 Magnus Granberg - * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler + * aclocal.m4: Add VasEBoot_CHECK_PIE. It check if the compiler include -fPIE in the default specs. * configure.ac: Check if pie_possible is yes and add -fno-PIE to TARGET_CFLAGS. @@ -35816,17 +35816,17 @@ 2009-09-02 Vladimir Serbinenko - * efiemu/loadcore.c (SUFFIX (grub_efiemu_loadcore_load)): Fix style + * efiemu/loadcore.c (SUFFIX (VasEBoot_efiemu_loadcore_load)): Fix style according to GCS. 2009-09-02 Colin Watson - * docs/grub.texi (Naming convention): Describe one-based partition + * docs/VasEBoot.texi (Naming convention): Describe one-based partition numbering. (Device syntax): Likewise. (File name syntax): Likewise. (Block list syntax): Likewise. - (Making a GRUB bootable CD-ROM): Talk about grub.cfg rather than + (Making a VasEBoot bootable CD-ROM): Talk about VasEBoot.cfg rather than menu.lst. (File name syntax): Likewise. (Command-line and menu entry commands): Document acpi, blocklist, @@ -35834,13 +35834,13 @@ 2009-09-02 Colin Watson - * commands/keystatus.c (GRUB_MOD_INIT (keystatus)): Adjust summary + * commands/keystatus.c (VasEBoot_MOD_INIT (keystatus)): Adjust summary to avoid implying that only one of --shift, --ctrl, or --alt may be used. 2009-09-02 Colin Watson - * util/grub-probe.c (probe): Test st.st_mode using S_ISREG macro + * util/VasEBoot-probe.c (probe): Test st.st_mode using S_ISREG macro rather than comparing against S_IFREG, which will almost never work. 2009-09-01 Vladimir Serbinenko @@ -35850,8 +35850,8 @@ 2009-09-01 Colin Watson - * script/lua/grub_lua.h (fputs): Supply a format string as the first - argument to grub_printf. + * script/lua/VasEBoot_lua.h (fputs): Supply a format string as the first + argument to VasEBoot_printf. 2009-09-01 Felix Zielcke @@ -35860,129 +35860,129 @@ 2009-08-30 Vladimir Serbinenko - * kern/file.c (grub_file_read): Spelling fix + * kern/file.c (VasEBoot_file_read): Spelling fix 2009-08-30 Vladimir Serbinenko - * loader/i386/bsdXX.c (SUFFIX (grub_freebsd_load_elfmodule)): Fix + * loader/i386/bsdXX.c (SUFFIX (VasEBoot_freebsd_load_elfmodule)): Fix loading of headers in some cases. -2009-08-30 Robert Millan +2009-08-30 Robert Millan * configure.ac: Bump version to 1.97~beta1. * docs/version.texi: Likewise. 2009-08-29 Vladimir Serbinenko - * include/grub/i386/xnu.h: Add license header. - include grub/err.h explicitly. + * include/VasEBoot/i386/xnu.h: Add license header. + include VasEBoot/err.h explicitly. -2009-08-29 Robert Millan +2009-08-29 Robert Millan - * util/grub.d/10_freebsd.in: Detect `ufs1' and `ufs2' and map them + * util/VasEBoot.d/10_freebsd.in: Detect `ufs1' and `ufs2' and map them to `ufs' in the vfs.root.mountfrom kernel parameter. -2009-08-29 Robert Millan +2009-08-29 Robert Millan - * term/i386/pc/serial.c: Include `'. + * term/i386/pc/serial.c: Include `'. - [GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Macroify initialization - value (0x0400 -> GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR). + [VasEBoot_MACHINE_PCBIOS] (serial_hw_io_addr): Macroify initialization + value (0x0400 -> VasEBoot_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR). - [! GRUB_MACHINE_PCBIOS] (GRUB_SERIAL_PORT_NUM): Calculate using + [! VasEBoot_MACHINE_PCBIOS] (VasEBoot_SERIAL_PORT_NUM): Calculate using `ARRAY_SIZE' macro. 2009-08-28 Vladimir Serbinenko - * kern/file.c (grub_file_read): Check offset. - * fs/hfs.c (grub_hfs_read_file): Remove unnecessary offset check. - * fs/jfs.c (grub_jfs_read_file): Likewise. - * fs/ntfs.c (grub_ntfs_read): Likewise. - * fs/reiserfs.c (grub_reiserfs_read): Likewise. - * fs/minix.c (grub_minix_read_file): Correct offset check. - * fs/ufs.c (grub_ufs_read_file): Likewise. + * kern/file.c (VasEBoot_file_read): Check offset. + * fs/hfs.c (VasEBoot_hfs_read_file): Remove unnecessary offset check. + * fs/jfs.c (VasEBoot_jfs_read_file): Likewise. + * fs/ntfs.c (VasEBoot_ntfs_read): Likewise. + * fs/reiserfs.c (VasEBoot_reiserfs_read): Likewise. + * fs/minix.c (VasEBoot_minix_read_file): Correct offset check. + * fs/ufs.c (VasEBoot_ufs_read_file): Likewise. 2009-08-28 Colin Watson * term/i386/pc/console.c (bios_data_area): Cast - GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR explicitly. + VasEBoot_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR explicitly. 2009-08-28 Vladimir Serbinenko 1-bit optimised blitters. - * include/grub/fbblit.h (grub_video_fbblit_replace_32bit_1bit): New + * include/VasEBoot/fbblit.h (VasEBoot_video_fbblit_replace_32bit_1bit): New prototype. - (grub_video_fbblit_replace_24bit_1bit): Likewise. - (grub_video_fbblit_replace_16bit_1bit): Likewise. - (grub_video_fbblit_replace_8bit_1bit): Likewise. - (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. - (grub_video_fbblit_blend_XXX888_1bit): Likewise. - (grub_video_fbblit_blend_XXX565_1bit): Likewise. - * video/fb/fbblit.c (grub_video_fbblit_replace_32bit_1bit): New + (VasEBoot_video_fbblit_replace_24bit_1bit): Likewise. + (VasEBoot_video_fbblit_replace_16bit_1bit): Likewise. + (VasEBoot_video_fbblit_replace_8bit_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXXA8888_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXX888_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXX565_1bit): Likewise. + * video/fb/fbblit.c (VasEBoot_video_fbblit_replace_32bit_1bit): New function. - (grub_video_fbblit_replace_24bit_1bit): Likewise. - (grub_video_fbblit_replace_16bit_1bit): Likewise. - (grub_video_fbblit_replace_8bit_1bit): Likewise. - (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. - (grub_video_fbblit_blend_XXX888_1bit): Likewise. - (grub_video_fbblit_blend_XXX565_1bit): Likewise. + (VasEBoot_video_fbblit_replace_24bit_1bit): Likewise. + (VasEBoot_video_fbblit_replace_16bit_1bit): Likewise. + (VasEBoot_video_fbblit_replace_8bit_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXXA8888_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXX888_1bit): Likewise. + (VasEBoot_video_fbblit_blend_XXX565_1bit): Likewise. * video/fb/video_fb.c (common_blitter): Use 1-bit optimised blitters when possible. - * video/video.c (grub_video_get_blit_format): Return - GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED if bpp = 1. + * video/video.c (VasEBoot_video_get_blit_format): Return + VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED if bpp = 1. 2009-08-28 Colin Watson - * normal/cmdline.c (grub_cmdline_get): Supply a format string as - the first argument to grub_printf. + * normal/cmdline.c (VasEBoot_cmdline_get): Supply a format string as + the first argument to VasEBoot_printf. 2009-08-28 Colin Watson -2009-08-28 Robert Millan +2009-08-28 Robert Millan Add `getkeystatus' terminal method. Add a new `keystatus' command to query it. - * include/grub/term.h (GRUB_TERM_STATUS_SHIFT, - GRUB_TERM_STATUS_CTRL, GRUB_TERM_STATUS_ALT): Definitions for + * include/VasEBoot/term.h (VasEBoot_TERM_STATUS_SHIFT, + VasEBoot_TERM_STATUS_CTRL, VasEBoot_TERM_STATUS_ALT): Definitions for modifier key bitmasks. - (struct grub_term_input): Add `getkeystatus' member. - (grub_getkeystatus): Add prototype. - * kern/term.c (grub_getkeystatus): New function. + (struct VasEBoot_term_input): Add `getkeystatus' member. + (VasEBoot_getkeystatus): Add prototype. + * kern/term.c (VasEBoot_getkeystatus): New function. - * include/grub/i386/pc/memory.h - (GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR): New macro. - (struct grub_machine_bios_data_area): Define necessary parts of BIOS + * include/VasEBoot/i386/pc/memory.h + (VasEBoot_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR): New macro. + (struct VasEBoot_machine_bios_data_area): Define necessary parts of BIOS Data Area layout. - * term/i386/pc/console.c (grub_console_getkeystatus): New function. - (grub_console_term_input): Set `getkeystatus' member. - * term/usb_keyboard.c (grub_usb_hid): Macroify HID protocol + * term/i386/pc/console.c (VasEBoot_console_getkeystatus): New function. + (VasEBoot_console_term_input): Set `getkeystatus' member. + * term/usb_keyboard.c (VasEBoot_usb_hid): Macroify HID protocol constants. - (grub_usb_keyboard_getreport): Likewise. - (grub_usb_keyboard_checkkey): Likewise. - (grub_usb_keyboard_getkeystatus): New function. - (grub_usb_keyboard_term): Set `getkeystatus' member. + (VasEBoot_usb_keyboard_getreport): Likewise. + (VasEBoot_usb_keyboard_checkkey): Likewise. + (VasEBoot_usb_keyboard_getkeystatus): New function. + (VasEBoot_usb_keyboard_term): Set `getkeystatus' member. * commands/keystatus.c: New file. * conf/common.rmk (pkglib_MODULES): Add keystatus.mod. (keystatus_mod_SOURCES): New variable. (keystatus_mod_CFLAGS): Likewise. (keystatus_mod_LDFLAGS): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add commands/keystatus.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. 2009-08-28 Vladimir Serbinenko Split befs.mod and afs.mod into *_be.mod and *.mod - * conf/common.rmk (grub_probe_SOURCES): Add afs_be.c and befs_be.c. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add afs_be.c and befs_be.c. + (VasEBoot_fstest_SOURCES): Likewise. (pkglib_MODULES): Add afs_be.mod and befs_be.mod. (afs_be_mod_SOURCES): New variable. (afs_be_mod_CFLAGS): Likewise. @@ -35990,52 +35990,52 @@ (befs_be_mod_SOURCES): Likewise. (befs_be_mod_CFLAGS): Likewise. (befs_be_mod_LDFLAGS): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add afs_be.c and befs_be.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add afs_be.c and befs_be.c. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. * fs/afs_be.c: New file. * fs/befs_be.c: New file. - * fs/afs.c (GRUB_AFS_FSNAME_SUFFIX): New definition. - (GRUB_AFS_FSNAME): Use GRUB_AFS_FSNAME_SUFFIX. + * fs/afs.c (VasEBoot_AFS_FSNAME_SUFFIX): New definition. + (VasEBoot_AFS_FSNAME): Use VasEBoot_AFS_FSNAME_SUFFIX. (U16): Replaced with ... - (grub_afs_to_cpu16): ...this. All users updated. + (VasEBoot_afs_to_cpu16): ...this. All users updated. (U32): Replaced with ... - (grub_afs_to_cpu32): ...this. All users updated. + (VasEBoot_afs_to_cpu32): ...this. All users updated. (U64): Replaced with ... - (grub_afs_to_cpu64): ...this. All users updated. - (GRUB_AFS_BO_LITTLE_ENDIAN): Remove. - (GRUB_AFS_BO_BIG_ENDIAN): Likewise. - (grub_afs_validate_sblock): Check only one endianness. - (GRUB_MOD_INIT (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. - (GRUB_MOD_INIT (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. - (GRUB_MOD_INIT (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. - (GRUB_MOD_INIT (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. - (GRUB_MOD_FINI (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. - (GRUB_MOD_FINI (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. - (GRUB_MOD_FINI (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. - (GRUB_MOD_FINI (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. + (VasEBoot_afs_to_cpu64): ...this. All users updated. + (VasEBoot_AFS_BO_LITTLE_ENDIAN): Remove. + (VasEBoot_AFS_BO_BIG_ENDIAN): Likewise. + (VasEBoot_afs_validate_sblock): Check only one endianness. + (VasEBoot_MOD_INIT (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. + (VasEBoot_MOD_INIT (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. + (VasEBoot_MOD_INIT (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. + (VasEBoot_MOD_INIT (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. + (VasEBoot_MOD_FINI (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. + (VasEBoot_MOD_FINI (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. + (VasEBoot_MOD_FINI (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. + (VasEBoot_MOD_FINI (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. 2009-08-26 Bean - * fs/xfs.c (GRUB_XFS_INO_INOINAG): Replace 1L with 1LL to support + * fs/xfs.c (VasEBoot_XFS_INO_INOINAG): Replace 1L with 1LL to support 64-bit number. - (GRUB_XFS_FSB_TO_BLOCK): Likewise. - (grub_xfs_inode_block): Change return type to grub_uint64_t. - (grub_xfs_read_inode): Change type of block to grub_uint64_t. + (VasEBoot_XFS_FSB_TO_BLOCK): Likewise. + (VasEBoot_xfs_inode_block): Change return type to VasEBoot_uint64_t. + (VasEBoot_xfs_read_inode): Change type of block to VasEBoot_uint64_t. 2009-08-25 Vladimir Serbinenko NetBSD memory map support. - * include/grub/i386/bsd.h (NETBSD_BTINFO_MEMMAP): New definition. - (grub_netbsd_btinfo_mmap_header): New structure. - (grub_netbsd_btinfo_mmap_entry): Likewise. - * loader/i386/bsd.c (grub_netbsd_boot): Pass memory map. + * include/VasEBoot/i386/bsd.h (NETBSD_BTINFO_MEMMAP): New definition. + (VasEBoot_netbsd_btinfo_mmap_header): New structure. + (VasEBoot_netbsd_btinfo_mmap_entry): Likewise. + * loader/i386/bsd.c (VasEBoot_netbsd_boot): Pass memory map. 2009-08-25 Vladimir Serbinenko @@ -36046,36 +36046,36 @@ (bsd_mod_CFLAGS): Likewise. (bsd_mod_LDFLAGS): Likewise. (bsd_mod_ASFLAGS): Likewise. - * loader/i386/bsd.c [!GRUB_MACHINE_PCBIOS]: Fix includes. - (grub_bsd_get_device) [!GRUB_MACHINE_PCBIOS]: Set *biosdev to 0xff. + * loader/i386/bsd.c [!VasEBoot_MACHINE_PCBIOS]: Fix includes. + (VasEBoot_bsd_get_device) [!VasEBoot_MACHINE_PCBIOS]: Set *biosdev to 0xff. 2009-08-25 Vladimir Serbinenko Cleanup NetBSD root support. - * loader/i386/bsd.c (grub_netbsd_boot): Remove call to - grub_bsd_get_device. + * loader/i386/bsd.c (VasEBoot_netbsd_boot): Remove call to + VasEBoot_bsd_get_device. Fix typo. 2009-08-25 Felix Zielcke - * util/grub.d/00_header.in: Move check for the video backend of + * util/VasEBoot.d/00_header.in: Move check for the video backend of gfxterm from here ... - * util/grub-mkconfig.in: ... to here. Enable gfxterm if there's + * util/VasEBoot-mkconfig.in: ... to here. Enable gfxterm if there's a suitable video backend. 2009-08-25 Vladimir Serbinenko - Fix breakage in grub-setup. + Fix breakage in VasEBoot-setup. - * util/i386/pc/grub-setup.c (setup): Use "part_msdos" instead of + * util/i386/pc/VasEBoot-setup.c (setup): Use "part_msdos" instead of "msdos_partition_map". 2009-08-25 Vladimir Serbinenko Fix breakage in normal/auth.c. - * normal/auth.c (grub_iswordseparator): New function. + * normal/auth.c (VasEBoot_iswordseparator): New function. 2009-08-25 Vladimir Serbinenko @@ -36087,99 +36087,99 @@ (password_mod_CFLAGS): Likewise. (password_mod_LDFLAGS): Likewise. (normal_mod_SOURCES): Add normal/auth.c. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add commands/password.c and + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add commands/password.c and normal/auth.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. - * include/grub/auth.h: New file. - * include/grub/err.h (grub_err_t): New enum value - GRUB_ERR_ACCESS_DENIED. - * include/grub/menu.h (grub_menu_entry): New fields 'restricted' and + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * include/VasEBoot/auth.h: New file. + * include/VasEBoot/err.h (VasEBoot_err_t): New enum value + VasEBoot_ERR_ACCESS_DENIED. + * include/VasEBoot/menu.h (VasEBoot_menu_entry): New fields 'restricted' and 'users'. - * include/grub/normal.h (grub_cmdline_get): New argument 'history'. - * normal/cmdline.c (grub_cmdline_get): New argument 'history'. All + * include/VasEBoot/normal.h (VasEBoot_cmdline_get): New argument 'history'. + * normal/cmdline.c (VasEBoot_cmdline_get): New argument 'history'. All users updated. * normal/auth.c: New file. - * normal/main.c (grub_normal_add_menu_entry): Handle --users option. - (grub_cmdline_run): Don't allow to go to command line without + * normal/main.c (VasEBoot_normal_add_menu_entry): Handle --users option. + (VasEBoot_cmdline_run): Don't allow to go to command line without authentication. - * normal/menu.c (grub_menu_execute_entry): Handle restricted entries. - * normal/menu_entry.c (grub_menu_entry_run): Don't allow editing + * normal/menu.c (VasEBoot_menu_execute_entry): Handle restricted entries. + * normal/menu_entry.c (VasEBoot_menu_entry_run): Don't allow editing menuentry without superuser rights. - * normal/menu_viewer.c (grub_menu_viewer_show_menu): Don't exit if + * normal/menu_viewer.c (VasEBoot_menu_viewer_show_menu): Don't exit if user isn't a superuser. 2009-08-24 Vladimir Serbinenko Save space by inlining misc.c functions. - * kern/misc.c (grub_iswordseparator): Made static. - * kern/misc.c (grub_strcat): Moved from here ... - * include/grub/misc.h (grub_strcat): ... here. Inlined. - * kern/misc.c (grub_strncat): Moved from here ... - * include/grub/misc.h (grub_strncat): ... here. Inlined. - * kern/misc.c (grub_strcasecmp): Moved from here ... - * include/grub/misc.h (grub_strcasecmp): ... here. Inlined. - * kern/misc.c (grub_strncasecmp): Moved from here ... - * include/grub/misc.h (grub_strncasecmp): ... here. Inlined. - * kern/misc.c (grub_isalpha): Moved from here ... - * include/grub/misc.h (grub_isalpha): ... here. Inlined. - * kern/misc.c (grub_isdigit): Moved from here ... - * include/grub/misc.h (grub_isdigit): ... here. Inlined. - * kern/misc.c (grub_isgraph): Moved from here ... - * include/grub/misc.h (grub_isgraph): ... here. Inlined. - * kern/misc.c (grub_tolower): Moved from here ... - * include/grub/misc.h (grub_tolower): ... here. Inlined. + * kern/misc.c (VasEBoot_iswordseparator): Made static. + * kern/misc.c (VasEBoot_strcat): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_strcat): ... here. Inlined. + * kern/misc.c (VasEBoot_strncat): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_strncat): ... here. Inlined. + * kern/misc.c (VasEBoot_strcasecmp): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_strcasecmp): ... here. Inlined. + * kern/misc.c (VasEBoot_strncasecmp): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_strncasecmp): ... here. Inlined. + * kern/misc.c (VasEBoot_isalpha): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_isalpha): ... here. Inlined. + * kern/misc.c (VasEBoot_isdigit): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_isdigit): ... here. Inlined. + * kern/misc.c (VasEBoot_isgraph): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_isgraph): ... here. Inlined. + * kern/misc.c (VasEBoot_tolower): Moved from here ... + * include/VasEBoot/misc.h (VasEBoot_tolower): ... here. Inlined. 2009-08-24 Vladimir Serbinenko - * script/sh/function.c (grub_script_function_find): Cut error message + * script/sh/function.c (VasEBoot_script_function_find): Cut error message not to flood terminal. - * script/sh/lexer.c (grub_script_yylex): Remove command line length + * script/sh/lexer.c (VasEBoot_script_yylex): Remove command line length limit. - * script/sh/script.c (grub_script_arg_add): Duplicate string. + * script/sh/script.c (VasEBoot_script_arg_add): Duplicate string. 2009-08-24 Colin Watson - * term/usb_keyboard.c (grub_usb_keyboard_getreport): Make - `report' grub_uint8_t *. - (grub_usb_keyboard_checkkey): Make `data' elements grub_uint8_t. + * term/usb_keyboard.c (VasEBoot_usb_keyboard_getreport): Make + `report' VasEBoot_uint8_t *. + (VasEBoot_usb_keyboard_checkkey): Make `data' elements VasEBoot_uint8_t. Use a 50-millisecond timeout rather than just repeating - grub_usb_keyboard_getreport 50 times. - (grub_usb_keyboard_getkey): Make `data' elements grub_uint8_t. + VasEBoot_usb_keyboard_getreport 50 times. + (VasEBoot_usb_keyboard_getkey): Make `data' elements VasEBoot_uint8_t. 2009-08-24 Vladimir Serbinenko Rename *_partition_map to part_* - * partmap/acorn.c (grub_acorn_partition_map): Set name to 'part_acorn'. - * partmap/amiga.c (grub_amiga_partition_map): Set name to 'part_amiga'. - * partmap/apple.c (grub_apple_partition_map): Set name to 'part_apple'. - * partmap/gpt.c (grub_gpt_partition_map): Set name to 'part_gpt'. + * partmap/acorn.c (VasEBoot_acorn_partition_map): Set name to 'part_acorn'. + * partmap/amiga.c (VasEBoot_amiga_partition_map): Set name to 'part_amiga'. + * partmap/apple.c (VasEBoot_apple_partition_map): Set name to 'part_apple'. + * partmap/gpt.c (VasEBoot_gpt_partition_map): Set name to 'part_gpt'. All users updated. - * partmap/msdos.c (grub_msdos_partition_map): Set name to 'part_msdos'. + * partmap/msdos.c (VasEBoot_msdos_partition_map): Set name to 'part_msdos'. All users updated. - * partmap/sun.c (grub_sun_partition_map): Set name to 'part_sun'. - * util/grub-probe.c (probe_partmap): Don't transform partition name + * partmap/sun.c (VasEBoot_sun_partition_map): Set name to 'part_sun'. + * util/VasEBoot-probe.c (probe_partmap): Don't transform partition name to get module name. 2009-08-24 Vladimir Serbinenko Fix OpenBSD and NetBSD support. - * include/grub/i386/bsd.h (GRUB_BSD_TEMP_BUFFER): Change to resolve + * include/VasEBoot/i386/bsd.h (VasEBoot_BSD_TEMP_BUFFER): Change to resolve memory address conflict. (OPENBSD_MMAP_ACPI): New definition. (OPENBSD_MMAP_NVS): Likewise. - * loader/i386/bsd.c (grub_openbsd_boot): Support OPENBSD_MMAP_ACPI + * loader/i386/bsd.c (VasEBoot_openbsd_boot): Support OPENBSD_MMAP_ACPI and OPENBSD_MMAP_NVS. Add memory map terminator - Explicit cast when calling grub_unix_real_boot. - (grub_netbsd_boot): Explicit cast when calling grub_unix_real_boot. + Explicit cast when calling VasEBoot_unix_real_boot. + (VasEBoot_netbsd_boot): Explicit cast when calling VasEBoot_unix_real_boot. 2009-08-24 Vladimir Serbinenko @@ -36188,76 +36188,76 @@ * loader/i386/bsd.c (netbsd_root): New variable. (netbsd_opts): New option 'root'. (NETBSD_ROOT_ARG): New macro. - (grub_netbsd_boot): Use 'netbsd_root'. - (grub_bsd_unload): Free 'netbsd_root'. - (grub_cmd_netbsd): Fill 'netbsd_root'. + (VasEBoot_netbsd_boot): Use 'netbsd_root'. + (VasEBoot_bsd_unload): Free 'netbsd_root'. + (VasEBoot_cmd_netbsd): Fill 'netbsd_root'. 2009-08-24 Vladimir Serbinenko Support for 64-bit NetBSD. - * loader/i386/bsd.c (grub_bsd_load_elf): Apply correct mask to entry + * loader/i386/bsd.c (VasEBoot_bsd_load_elf): Apply correct mask to entry point when booting non-FreeBSD. 2009-08-24 Vladimir Serbinenko Support --no-smp and --no-acpi for NetBSD. - * include/grub/i386/bsd.h (NETBSD_AB_NOSMP): New definition. + * include/VasEBoot/i386/bsd.h (NETBSD_AB_NOSMP): New definition. (NETBSD_AB_NOACPI): Likewise. * loader/i386/bsd.c (netbsd_opts): New entries no-smp and no-acpi. (netbsd_flags): Add NETBSD_AB_NOSMP, NETBSD_AB_NOACPI. 2009-08-23 Vladimir Serbinenko - * fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file + * fs/hfsplus.c (VasEBoot_hfsplus_mount): Don't ignore VasEBoot_hfsplus_read_file errors. - (grub_hfsplus_btree_iterate_node): Don't ignore grub_hfsplus_read_file - errors. Call grub_error when needed. + (VasEBoot_hfsplus_btree_iterate_node): Don't ignore VasEBoot_hfsplus_read_file + errors. Call VasEBoot_error when needed. 2009-08-23 Vladimir Serbinenko * commands/search.c (search_fs): Try searching without autoload first. - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Load filesystem module explicitly for faster booting. 2009-08-23 Colin Watson - * util/grub-mkconfig.in: Export GRUB_DISABLE_OS_PROBER. + * util/VasEBoot-mkconfig.in: Export VasEBoot_DISABLE_OS_PROBER. 2009-08-23 Colin Watson - * util/grub.d/30_os-prober.in: Disable os-prober if - `GRUB_DISABLE_OS_PROBER' was set to true. + * util/VasEBoot.d/30_os-prober.in: Disable os-prober if + `VasEBoot_DISABLE_OS_PROBER' was set to true. -2009-08-23 Robert Millan +2009-08-23 Robert Millan * partmap/pc.c: Rename to ... * partmap/msdos.c: ... this. Update all users. - (grub_pc_partition_map): Rename to ... - (grub_msdos_partition_map): ... this. Update all users. + (VasEBoot_pc_partition_map): Rename to ... + (VasEBoot_msdos_partition_map): ... this. Update all users. * parttool/pcpart.c: Rename to ... * parttool/msdospart.c: ... this. Update all users. - * include/grub/pc_partition.h: Rename to ... - * include/grub/msdos_partition.h: ... this. Update all users. - (grub_pc_partition_bsd_entry): Rename to ... - (grub_msdos_partition_bsd_entry): ... this. Update all users. - (grub_pc_partition_disk_label): Rename to ... - (grub_msdos_partition_disk_label): ... this. Update all users. - (grub_pc_partition_entry): Rename to ... - (grub_msdos_partition_entry): ... this. Update all users. - (grub_pc_partition_mbr): Rename to ... - (grub_msdos_partition_mbr): ... this. Update all users. - (grub_pc_partition): Rename to ... - (grub_msdos_partition): ... this. Update all users. - (grub_pc_partition_is_empty): Rename to ... - (grub_msdos_partition_is_empty): ... this. Update all users. - (grub_pc_partition_is_extended): Rename to ... - (grub_msdos_partition_is_extended): ... this. Update all users. - (grub_pc_partition_is_bsd): Rename to ... - (grub_msdos_partition_is_bsd): ... this. Update all users. + * include/VasEBoot/pc_partition.h: Rename to ... + * include/VasEBoot/msdos_partition.h: ... this. Update all users. + (VasEBoot_pc_partition_bsd_entry): Rename to ... + (VasEBoot_msdos_partition_bsd_entry): ... this. Update all users. + (VasEBoot_pc_partition_disk_label): Rename to ... + (VasEBoot_msdos_partition_disk_label): ... this. Update all users. + (VasEBoot_pc_partition_entry): Rename to ... + (VasEBoot_msdos_partition_entry): ... this. Update all users. + (VasEBoot_pc_partition_mbr): Rename to ... + (VasEBoot_msdos_partition_mbr): ... this. Update all users. + (VasEBoot_pc_partition): Rename to ... + (VasEBoot_msdos_partition): ... this. Update all users. + (VasEBoot_pc_partition_is_empty): Rename to ... + (VasEBoot_msdos_partition_is_empty): ... this. Update all users. + (VasEBoot_pc_partition_is_extended): Rename to ... + (VasEBoot_msdos_partition_is_extended): ... this. Update all users. + (VasEBoot_pc_partition_is_bsd): Rename to ... + (VasEBoot_msdos_partition_is_bsd): ... this. Update all users. * conf/common.rmk (amiga_mod_SOURCES, amiga_mod_CFLAGS) (amiga_mod_LDFLAGS, apple_mod_SOURCES, apple_mod_CFLAGS) @@ -36288,21 +36288,21 @@ (freebsd_flags): Added 0 terminator. (openbsd_flags): Likewise. (netbsd_flags): Likewise. - (grub_bsd_parse_flags): Rewritten to use extcmd. All users updated. - (grub_cmd_freebsd): Transformed into extended command. - (grub_cmd_openbsd): Likewise. - (grub_cmd_netbsd): Likewise. - (cmd_freebsd): Changed type to grub_extcmd_t. + (VasEBoot_bsd_parse_flags): Rewritten to use extcmd. All users updated. + (VasEBoot_cmd_freebsd): Transformed into extended command. + (VasEBoot_cmd_openbsd): Likewise. + (VasEBoot_cmd_netbsd): Likewise. + (cmd_freebsd): Changed type to VasEBoot_extcmd_t. (cmd_openbsd): Likewise. (cmd_netbsd): Likewise. - (GRUB_MOD_INIT (bsd)): Register grub_cmd_freebsd, grub_cmd_netbsd and - grub_cmd_openbsd as extended commands. - (GRUB_MOD_FINI (bsd)): Use grub_unregister_extcmd for cmd_freebsd, + (VasEBoot_MOD_INIT (bsd)): Register VasEBoot_cmd_freebsd, VasEBoot_cmd_netbsd and + VasEBoot_cmd_openbsd as extended commands. + (VasEBoot_MOD_FINI (bsd)): Use VasEBoot_unregister_extcmd for cmd_freebsd, cmd_netbsd and cmd_openbsd 2009-08-22 Vladimir Serbinenko - * commands/xnu_uuid.c (transform): Use grub_memcpy instead of memcpy. + * commands/xnu_uuid.c (transform): Use VasEBoot_memcpy instead of memcpy. 2009-08-21 Pavel Roskin @@ -36314,19 +36314,19 @@ 2009-08-18 Felix Zielcke - * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Use - grub-mkelfimage. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in (VasEBoot_mkimage): Use + VasEBoot-mkelfimage. 2009-08-18 Felix Zielcke - * util/grub-mkconfig.in: Don't use gfxterm by default if not + * util/VasEBoot-mkconfig.in: Don't use gfxterm by default if not explicitly specified by the user. 2009-08-18 Pavel Roskin - * include/grub/fbfill.h (struct grub_video_fbrender_target): Use - grub_uint8_t pointer for data. - * include/grub/fbutil.h (struct grub_video_fbblit_info): + * include/VasEBoot/fbfill.h (struct VasEBoot_video_fbrender_target): Use + VasEBoot_uint8_t pointer for data. + * include/VasEBoot/fbutil.h (struct VasEBoot_video_fbblit_info): Likewise. * video/fb/fbutil.c: Remove unnecessary casts. @@ -36335,9 +36335,9 @@ VBE cleanup. * video/i386/pc/vbe.c (vbe_mode_in_use): Removed (duplicate). - (grub_vbe_set_video_mode): Save active mode info + (VasEBoot_vbe_set_video_mode): Save active mode info only after setting the mode. - (grub_video_vbe_setup): Call 'grub_vbe_set_video_mode' with NULL as + (VasEBoot_video_vbe_setup): Call 'VasEBoot_vbe_set_video_mode' with NULL as second argument. 2009-08-17 Michal Suchanek @@ -36354,68 +36354,68 @@ (vbe_mode_in_use): ... this. All users updated. (mode_list): Rename to .. (vbe_mode_list): ... this. All users updated. - (grub_vbe_set_video_mode): Rename 'mode' to 'vbe_mode', 'mode_info' to + (VasEBoot_vbe_set_video_mode): Rename 'mode' to 'vbe_mode', 'mode_info' to 'vbe_mode_info' and 'old_mode' to 'old_vbe_mode'. - (grub_video_vbe_init): Rename 'rm_mode_list' to 'rm_vbe_mode_list' and + (VasEBoot_video_vbe_init): Rename 'rm_mode_list' to 'rm_vbe_mode_list' and 'mode_list_size' to 'vbe_mode_list_size'. - (grub_video_vbe_setup): Rename 'mode_info' to 'vbe_mode_info', + (VasEBoot_video_vbe_setup): Rename 'mode_info' to 'vbe_mode_info', 'best_mode_info' to 'best_vbe_mode_info' and 'best_mode' to 'best_vbe_mode' 2009-08-17 Michal Suchanek - Remove duplicate grub_video_fb_get_video_ptr. + Remove duplicate VasEBoot_video_fb_get_video_ptr. - * include/grub/fbutil.h (get_data_ptr): Rename to ... - (grub_video_fb_get_video_ptr): ... this. - * include/grub/video_fb.h (grub_video_fb_get_video_ptr): Removed. + * include/VasEBoot/fbutil.h (get_data_ptr): Rename to ... + (VasEBoot_video_fb_get_video_ptr): ... this. + * include/VasEBoot/video_fb.h (VasEBoot_video_fb_get_video_ptr): Removed. * video/fb/fbutil.c: Add comment about addressing. (get_data_ptr): Rename to ... - (grub_video_fb_get_video_ptr): ... this. All users updated. - * video/fb/video_fb.c (grub_video_fb_get_video_ptr): Remove. + (VasEBoot_video_fb_get_video_ptr): ... this. All users updated. + * video/fb/video_fb.c (VasEBoot_video_fb_get_video_ptr): Remove. -2009-08-17 Robert Millan +2009-08-17 Robert Millan - * fs/fat.c (grub_fat_read_data): Remove `#if 0' braces around the - grub_dprintf() that was just added. + * fs/fat.c (VasEBoot_fat_read_data): Remove `#if 0' braces around the + VasEBoot_dprintf() that was just added. -2009-08-17 Robert Millan +2009-08-17 Robert Millan - * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT) + * loader/i386/linux.c (VasEBoot_ASSUME_LINUX_HAS_FB_SUPPORT) (DEFAULT_VIDEO_MODE): Remove macros. - (grub_linux_boot): Remove assumption that Linux has FB support, + (VasEBoot_linux_boot): Remove assumption that Linux has FB support, and use "text" as default video mode. 2009-08-15 Vladimir Serbinenko - * fs/affs.c (grub_affs_read_symlink): Change leftover grub_printf into - grub_dprintf. - * fs/fat.c (grub_fat_read_data): Likewise. + * fs/affs.c (VasEBoot_affs_read_symlink): Change leftover VasEBoot_printf into + VasEBoot_dprintf. + * fs/fat.c (VasEBoot_fat_read_data): Likewise. 2009-08-14 Vladimir Serbinenko - * loader/i386/multiboot.c (grub_multiboot): Don't pass filename to + * loader/i386/multiboot.c (VasEBoot_multiboot): Don't pass filename to payload. - (grub_module): Likewise. + (VasEBoot_module): Likewise. 2009-08-14 Vladimir Serbinenko - * loader/i386/multiboot.c (grub_multiboot_unload): Don't free mbi and + * loader/i386/multiboot.c (VasEBoot_multiboot_unload): Don't free mbi and mbi->cmdline but free playground. 2009-08-14 Vladimir Serbinenko Handle group offset on UFS1. - * fs/ufs.c (grub_ufs_sblock): New field 'cylg_mask'. - (grub_ufs_read_inode) [!MODE_UFS2]: handle cylg_offset and cylg_mask. + * fs/ufs.c (VasEBoot_ufs_sblock): New field 'cylg_mask'. + (VasEBoot_ufs_read_inode) [!MODE_UFS2]: handle cylg_offset and cylg_mask. 2009-08-14 Vladimir Serbinenko Split ufs.mod into ufs1.mod and ufs2.mod. - * conf/common.rmk (grub_probe_SOURCES): Add fs/ufs2.c. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add fs/ufs2.c. + (VasEBoot_fstest_SOURCES): Likewise. (pkglib_MODULES): Remove ufs.mod. Add ufs1.mod and ufs2.mod. (ufs_mod_SOURCES): Remove. (ufs_mod_CFLAGS): Likewise. @@ -36426,17 +36426,17 @@ (ufs2_mod_SOURCES): New variable. (ufs2_mod_CFLAGS): Likewise. (ufs2_mod_LDFLAGS): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add fs/ufs2.c. - * conf/i386-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add fs/ufs2.c. + * conf/i386-efi.rmk (util/i386/efi/VasEBoot-mkimage.c_DEPENDENCIES): Likewise. - (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. - (grub_setup_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64.rmk (grub_emu_SOURCES): Likewise. - (grub_setup_SOURCES): Likewise. - * conf/x86_64-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): + (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. + (VasEBoot_setup_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64.rmk (VasEBoot_emu_SOURCES): Likewise. + (VasEBoot_setup_SOURCES): Likewise. + * conf/x86_64-efi.rmk (util/i386/efi/VasEBoot-mkimage.c_DEPENDENCIES): Likewise. * fs/ufs2.c: New file. * fs/ufs.c: Separate UFS1 from UFS2 by using preprocessor. @@ -36445,7 +36445,7 @@ Framebuffer split. - * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video + * commands/i386/pc/vbetest.c (VasEBoot_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. @@ -36459,40 +36459,40 @@ * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. - * include/grub/i386/pc/vbeblit.h: Moved from here ... - * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. - * include/grub/i386/pc/vbefill.h: Moved from here ... - * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. - * include/grub/i386/pc/vbeutil.h: Moved from here ... - * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. - * include/grub/i386/pc/vbe.h: Moved framebuffer part ... - * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. - * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. - (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. - (grub_video_adapter): Added 'get_info_and_fini'. - (grub_video_get_info_and_fini): New prototype. - (grub_video_set_mode): make modestring const char *. - * loader/i386/linux.c (grub_linux_setup_video): Use - grub_video_get_info_and_fini. - (grub_linux_boot): Move modesetting just before booting. - * loader/i386/pc/xnu.c (grub_xnu_set_video): Use - grub_video_get_info_and_fini. + * include/VasEBoot/i386/pc/vbeblit.h: Moved from here ... + * include/VasEBoot/fbblit.h: ... here. Replaced 'vbe' with 'fb'. + * include/VasEBoot/i386/pc/vbefill.h: Moved from here ... + * include/VasEBoot/fbfill.h: ... here. Replaced 'vbe' with 'fb'. + * include/VasEBoot/i386/pc/vbeutil.h: Moved from here ... + * include/VasEBoot/fbutil.h: ... here. Replaced 'vbe' with 'fb'. + * include/VasEBoot/i386/pc/vbe.h: Moved framebuffer part ... + * include/VasEBoot/video_fb.h: ... here. Replaced 'vbe' with 'fb'. + * include/VasEBoot/video.h (VasEBoot_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. + (VasEBoot_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. + (VasEBoot_video_adapter): Added 'get_info_and_fini'. + (VasEBoot_video_get_info_and_fini): New prototype. + (VasEBoot_video_set_mode): make modestring const char *. + * loader/i386/linux.c (VasEBoot_linux_setup_video): Use + VasEBoot_video_get_info_and_fini. + (VasEBoot_linux_boot): Move modesetting just before booting. + * loader/i386/pc/xnu.c (VasEBoot_xnu_set_video): Use + VasEBoot_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. - * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use - grub_video_fbstd_colors and grub_video_fb_set_palette. - (grub_video_vbe_init): Clear 'framebuffer' variable and use - grub_video_fb_init. - (grub_video_vbe_fini): Use grub_video_fb_fini. - (grub_video_vbe_setup): Use framebuffer.render_target instead of - render_target and use grub_video_fb_set_active_render_target and - grub_video_fb_set_palette. - (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. - (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. - (grub_video_vbe_adapter): Use framebuffer. - * video/video.c (grub_video_get_info_and_fini): New function. - (grub_video_set_mode): Make modestring const char *. - (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these + * video/i386/pc/vbe.c (VasEBoot_vbe_set_video_mode): Use + VasEBoot_video_fbstd_colors and VasEBoot_video_fb_set_palette. + (VasEBoot_video_vbe_init): Clear 'framebuffer' variable and use + VasEBoot_video_fb_init. + (VasEBoot_video_vbe_fini): Use VasEBoot_video_fb_fini. + (VasEBoot_video_vbe_setup): Use framebuffer.render_target instead of + render_target and use VasEBoot_video_fb_set_active_render_target and + VasEBoot_video_fb_set_palette. + (VasEBoot_video_vbe_set_palette): Use VasEBoot_video_fb_set_palette. + (VasEBoot_video_vbe_set_viewport): Use VasEBoot_video_fb_set_viewport. + (VasEBoot_video_vbe_adapter): Use framebuffer. + * video/video.c (VasEBoot_video_get_info_and_fini): New function. + (VasEBoot_video_set_mode): Make modestring const char *. + (VasEBoot_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised. 2009-08-14 Pavel Roskin @@ -36507,13 +36507,13 @@ 2009-08-13 Colin Watson - * util/grub-mkconfig.in: Export GRUB_HIDDEN_TIMEOUT. - * util/grub.d/00_header.in: Enter interruptible sleep if - GRUB_HIDDEN_TIMEOUT is set. + * util/VasEBoot-mkconfig.in: Export VasEBoot_HIDDEN_TIMEOUT. + * util/VasEBoot.d/00_header.in: Enter interruptible sleep if + VasEBoot_HIDDEN_TIMEOUT is set. 2009-08-13 Yves Blusseau - * include/grub/symbol.h: Add the LOCAL macro. + * include/VasEBoot/symbol.h: Add the LOCAL macro. * boot/i386/pc/boot.S: Use the LOCAL macro for all labels starting with "L_". @@ -36526,136 +36526,136 @@ Use local labels starting with "L_" so that Apple assembler knows they are local. -2009-08-10 Robert Millan +2009-08-10 Robert Millan - * include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD) + * include/VasEBoot/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD) (KERNEL_TYPE_OPENBSD, KERNEL_TYPE_NETBSD): Convert to ... (bsd_kernel_types): ... this enum. - * loader/i386/bsd.c (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module) - (grub_cmd_freebsd_module_elf): Abort with "You need to load the + * loader/i386/bsd.c (VasEBoot_cmd_freebsd_loadenv, VasEBoot_cmd_freebsd_module) + (VasEBoot_cmd_freebsd_module_elf): Abort with "You need to load the kernel first." when `kernel_type' is set to KERNEL_TYPE_NONE. - (grub_bsd_load_aout, grub_bsd_load, grub_cmd_freebsd_loadenv) - (grub_cmd_freebsd_module, grub_cmd_freebsd_module_elf) - (GRUB_MOD_INIT (bsd)): Fix capitalization in a few error + (VasEBoot_bsd_load_aout, VasEBoot_bsd_load, VasEBoot_cmd_freebsd_loadenv) + (VasEBoot_cmd_freebsd_module, VasEBoot_cmd_freebsd_module_elf) + (VasEBoot_MOD_INIT (bsd)): Fix capitalization in a few error messages. -2009-08-08 Robert Millan +2009-08-08 Robert Millan - * util/grub-dumpdevtree: Moved from here ... - * util/i386/efi/grub-dumpdevtree: ... to here. + * util/VasEBoot-dumpdevtree: Moved from here ... + * util/i386/efi/VasEBoot-dumpdevtree: ... to here. (hexify): New function. Converts a string to its hex version. Generate hex versions of "efi" and "device-properties" by calling hexify() on the ASCII strings rather than by hardcoding numbers. -2009-08-08 Robert Millan +2009-08-08 Robert Millan * fs/jfs.c: Update copyright year. 2009-08-08 Felix Zielcke - * util/grub.d/00_header.in: Fix a comment. - * util/grub.d/10_linux.in: Likewise. - * util/grub.d/10_windows.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. + * util/VasEBoot.d/00_header.in: Fix a comment. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot.d/10_windows.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. 2009-08-08 Felix Zielcke - * util/grub-mkconfig.in: Allow the user to specify the used font - with GRUB_FONT. + * util/VasEBoot-mkconfig.in: Allow the user to specify the used font + with VasEBoot_FONT. 2009-08-08 Pavel Roskin - * include/grub/powerpc/libgcc.h: Export __ashrdi3() if + * include/VasEBoot/powerpc/libgcc.h: Export __ashrdi3() if available, xfs.mod needs it now. - * util/grub-mkconfig_lib.in (version_test_numeric): Don't use + * util/VasEBoot-mkconfig_lib.in (version_test_numeric): Don't use the "g" modifier in sed when the intention is to strip something once. This fixes comparison of kernels with multiple dashes. - * util/grub-mkconfig.in: Define datarootdir, datadir may depend + * util/VasEBoot-mkconfig.in: Define datarootdir, datadir may depend on it. Add missing space before closing bracket. Fix misleading formatting. -2009-08-07 Robert Millan +2009-08-07 Robert Millan - * docs/grub.texi: Major overhaul. Remove all sections that are - specific to GRUB Legacy, or mostly composed of Legacy-specific + * docs/VasEBoot.texi: Major overhaul. Remove all sections that are + specific to VasEBoot Legacy, or mostly composed of Legacy-specific information. -2009-08-07 Robert Millan +2009-08-07 Robert Millan * docs/version.texi: New file. Provides version information for - grub.texi. + VasEBoot.texi. -2009-08-07 Robert Millan +2009-08-07 Robert Millan - * docs/grub.texi: Update CVS information to SVN. - Replace outdated "GRUB 2 will include" phrase with "GRUB 2 includes". + * docs/VasEBoot.texi: Update CVS information to SVN. + Replace outdated "VasEBoot 2 will include" phrase with "VasEBoot 2 includes". 2009-08-07 Felix Zielcke - * util/grub-mkconfig.in: Remove a wrong `fi'. + * util/VasEBoot-mkconfig.in: Remove a wrong `fi'. 2009-08-07 Felix Zielcke - * fs/uuid.c (grub_jfs_superblock): New fields unused2 and uuid. - (grub_jfs_uuid): New function. - (grub_jfs_fs): Set uuid field to grub_jfs_uuid. + * fs/uuid.c (VasEBoot_jfs_superblock): New fields unused2 and uuid. + (VasEBoot_jfs_uuid): New function. + (VasEBoot_jfs_fs): Set uuid field to VasEBoot_jfs_uuid. 2009-08-07 Felix Zielcke - * util/grub-mkconfig_lib.in (font_path): Move the functionality + * util/VasEBoot-mkconfig_lib.in (font_path): Move the functionality of it to ... - * util/grub-mkconfig.in: ... here. Prefer unicode.pf2 and + * util/VasEBoot-mkconfig.in: ... here. Prefer unicode.pf2 and unifont.pf2 over ascii.pf2. Export LANG=C in case ascii.pf2 gets used. -2009-08-07 Robert Millan +2009-08-07 Robert Millan - * util/grub.d/10_linux.in (test_numeric): Moved from here ... - * util/grub-mkconfig_lib.in (version_test_numeric): ... to here. + * util/VasEBoot.d/10_linux.in (test_numeric): Moved from here ... + * util/VasEBoot-mkconfig_lib.in (version_test_numeric): ... to here. Update all users. - * util/grub.d/10_linux.in (test_gt): Strip any basename prefix, + * util/VasEBoot.d/10_linux.in (test_gt): Strip any basename prefix, not just "vmlinu[zx]". Moved from here ... - * util/grub-mkconfig_lib.in (version_test_gt): ... to here. Update + * util/VasEBoot-mkconfig_lib.in (version_test_gt): ... to here. Update all users. - * util/grub.d/10_linux.in (find_latest): Moved from here ... - * util/grub-mkconfig_lib.in (version_find_latest): ... to here. Update + * util/VasEBoot.d/10_linux.in (find_latest): Moved from here ... + * util/VasEBoot-mkconfig_lib.in (version_find_latest): ... to here. Update all users. -2009-08-07 Robert Millan +2009-08-07 Robert Millan - * util/grub.d/10_freebsd.in: Use an absolute device path for + * util/VasEBoot.d/10_freebsd.in: Use an absolute device path for `vfs.root.mountfrom'. Set `vfs.root.mountfrom.options=rw'. 2009-08-06 Felix Zielcke - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Fix handling of multiple abstraction modules. -2009-08-04 Robert Millan +2009-08-04 Robert Millan Fix a bug resulting in black screen when loading Linux using a packed video mode. - * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette_width): New + * kern/i386/pc/startup.S (VasEBoot_vbe_bios_getset_dac_palette_width): New function. - * include/grub/i386/pc/vbe.h (GRUB_VBE_CAPABILITY_DACWIDTH): New macro. - (grub_vbe_bios_getset_dac_palette_width): New function. - (grub_vbe_bios_get_dac_palette_width) - (grub_vbe_bios_set_dac_palette_width): New macros (act as wrappers for - grub_vbe_bios_getset_dac_palette_width()). + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_VBE_CAPABILITY_DACWIDTH): New macro. + (VasEBoot_vbe_bios_getset_dac_palette_width): New function. + (VasEBoot_vbe_bios_get_dac_palette_width) + (VasEBoot_vbe_bios_set_dac_palette_width): New macros (act as wrappers for + VasEBoot_vbe_bios_getset_dac_palette_width()). - * video/i386/pc/vbe.c (grub_vbe_probe): Use `GRUB_VBE_STATUS_OK' to + * video/i386/pc/vbe.c (VasEBoot_vbe_probe): Use `VasEBoot_VBE_STATUS_OK' to check for return status. - (grub_vbe_get_video_mode_info): When getting information for a packed + (VasEBoot_vbe_get_video_mode_info): When getting information for a packed mode (<= 8 bpp), obtain DAC palette width using - grub_vbe_bios_getset_dac_palette_width(), and use that for initializing + VasEBoot_vbe_bios_getset_dac_palette_width(), and use that for initializing {red,green,blue}_mark_size. 2009-08-04 Felix Zielcke @@ -36664,30 +36664,30 @@ 2009-08-02 Vladimir Serbinenko - * commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_read instead + * commands/hexdump.c (VasEBoot_cmd_hexdump): Use VasEBoot_disk_read instead of homegrown code. 2009-08-01 Vladimir Serbinenko - * util/hostfs.c (grub_hostfs_dir): Don't use DT_DIR: It doesn't work + * util/hostfs.c (VasEBoot_hostfs_dir): Don't use DT_DIR: It doesn't work on XFS or ReiserFS. 2009-08-01 Vladimir Serbinenko Support Apple partition map with sector size different from 512 bytes. - * partmap/apple.c (grub_apple_header): New field 'blocksize'. + * partmap/apple.c (VasEBoot_apple_header): New field 'blocksize'. (apple_partition_map_iterate): Respect 'aheader.blocksize' and 'apart.partmap_size'. 2009-08-01 Vladimir Serbinenko -2009-08-01 Robert Millan +2009-08-01 Robert Millan Fix cpuid command. * commands/i386/cpuid.c (options): New variable. - (grub_cmd_cpuid): Return real error. - (GRUB_MOD_INIT(cpuid)): Declare options. + (VasEBoot_cmd_cpuid): Return real error. + (VasEBoot_MOD_INIT(cpuid)): Declare options. 2009-07-31 Vladimir Serbinenko @@ -36696,126 +36696,126 @@ 2009-07-31 Bean - * fs/xfs.c (grub_xfs_sblock): Change unused5 field to log2_sect and + * fs/xfs.c (VasEBoot_xfs_sblock): Change unused5 field to log2_sect and log2_inode. - (grub_fshelp_node): Move inode field to the end. - (grub_xfs_data): Remove inode field. - (grub_xfs_inode_block): Calculate inode size using sblock. - (grub_xfs_inode_offset): Likewise. - (grub_xfs_read_inode): Calculate inode size using sblock. - (grub_xfs_read_block): Replace XFS_INODE_EXTENTS with nrec. - (grub_xfs_iterate_dir): Calculate inode size using sblock. - (grub_xfs_mount): Use grub_zalloc instead of grub_malloc. Realloc data + (VasEBoot_fshelp_node): Move inode field to the end. + (VasEBoot_xfs_data): Remove inode field. + (VasEBoot_xfs_inode_block): Calculate inode size using sblock. + (VasEBoot_xfs_inode_offset): Likewise. + (VasEBoot_xfs_read_inode): Calculate inode size using sblock. + (VasEBoot_xfs_read_block): Replace XFS_INODE_EXTENTS with nrec. + (VasEBoot_xfs_iterate_dir): Calculate inode size using sblock. + (VasEBoot_xfs_mount): Use VasEBoot_zalloc instead of VasEBoot_malloc. Realloc data to match inode size. - (grub_xfs_dir): goto mount_fail when mount fails, as data->diropen is + (VasEBoot_xfs_dir): goto mount_fail when mount fails, as data->diropen is not accessible when data is null. - (grub_xfs_open): Likewise. + (VasEBoot_xfs_open): Likewise. 2009-07-31 Bean - * disk/lvm.c (grub_lvm_scan_device): Ignore extra copy of metadata. + * disk/lvm.c (VasEBoot_lvm_scan_device): Ignore extra copy of metadata. Don't change pv->disk if it's already set. - * disk/raid.c (grub_raid_scan_device): Merge this function into ... - (grub_raid_register): ... here. - (grub_raid_rescan): Removed. + * disk/raid.c (VasEBoot_raid_scan_device): Merge this function into ... + (VasEBoot_raid_register): ... here. + (VasEBoot_raid_rescan): Removed. - * include/grub/raid.h (grub_raid_rescan): Removed. + * include/VasEBoot/raid.h (VasEBoot_raid_rescan): Removed. - * util/grub-fstest.c: Remove include file . - (fstest): Replace grub_raid_rescan with module fini function followed + * util/VasEBoot-fstest.c: Remove include file . + (fstest): Replace VasEBoot_raid_rescan with module fini function followed by init function. - * util/grub-probe.c: Add include file . + * util/VasEBoot-probe.c: Add include file . (probe_raid_level): New function. (probe): Detect abstraction by walking the disk device, support two level of abstraction (LVM on RAID) when detecting partition map. 2009-07-31 Pavel Roskin - * disk/raid5_recover.c (grub_raid5_recover): Revert conversion - to grub_zalloc(), it was erroneous. + * disk/raid5_recover.c (VasEBoot_raid5_recover): Revert conversion + to VasEBoot_zalloc(), it was erroneous. Reported by Bean 2009-07-30 Vladimir Serbinenko - * util/i386/pc/grub-setup.c (setup): Check that no partition is in + * util/i386/pc/VasEBoot-setup.c (setup): Check that no partition is in embedding zone, not only the first one. 2009-07-29 Joe Auricchio * term/gfxterm.c (clear_char): New function. - (grub_virtual_screen_setup): Use clear_char. + (VasEBoot_virtual_screen_setup): Use clear_char. (scroll_up): Likewise. - (grub_virtual_screen_cls): Likewise. + (VasEBoot_virtual_screen_cls): Likewise. 2009-07-29 Felix Zielcke * util/deviceiter.c (get_acceleraid_disk_name): New static function. - (grub_util_iterate_devices): Handle Accelraid devices. + (VasEBoot_util_iterate_devices): Handle Accelraid devices. * util/hostdisk.c (convert_system_partition_to_system_disk): Likewise. -2009-07-28 Robert Millan +2009-07-28 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): Use ',' rather than ';' as + * loader/i386/linux.c (VasEBoot_cmd_linux): Use ',' rather than ';' as separator for the suggested gfxpayload string (';' collides with the parser and needs escaping). 2009-07-28 Vladimir Serbinenko - * loader/i386/multiboot_helper.S (grub_multiboot_backward_relocator): + * loader/i386/multiboot_helper.S (VasEBoot_multiboot_backward_relocator): Clear direction flag before jumping to OS. - (grub_multiboot2_real_boot): Likewise. + (VasEBoot_multiboot2_real_boot): Likewise. 2009-07-28 Felix Zielcke - * util/i386/pc/grub-install: Fix parsing of --disk-module + * util/i386/pc/VasEBoot-install: Fix parsing of --disk-module option. 2009-07-28 Felix Zielcke - * util/i386/pc/grub-setup.c (setup): Fix 2 incorrect checks + * util/i386/pc/VasEBoot-setup.c (setup): Fix 2 incorrect checks when embedding. 2009-07-26 Felix Zielcke - * util/grub-mkconfig.in (package_version): New variable. + * util/VasEBoot-mkconfig.in (package_version): New variable. Use it do display the version. 2009-07-25 Felix Zielcke - * kern/file.c (grub_file_open): Revert to previous check with - grub_errno. + * kern/file.c (VasEBoot_file_open): Revert to previous check with + VasEBoot_errno. 2009-07-25 Vladimir Serbinenko - * commands/probe.c (GRUB_MOD_INIT (probe)): Remove "[--target=target]" + * commands/probe.c (VasEBoot_MOD_INIT (probe)): Remove "[--target=target]" from help line. It's out of sync with code. 2009-07-25 Vladimir Serbinenko - * kern/parser.c (grub_parser_execute): Fix a bug causing truncated + * kern/parser.c (VasEBoot_parser_execute): Fix a bug causing truncated entries on failed boot. 2009-07-25 Felix Zielcke - * kern/file.c (grub_file_open): Fix an error check. + * kern/file.c (VasEBoot_file_open): Fix an error check. 2009-07-24 Vladimir Serbinenko - * util/i386/pc/grub-setup.c (setup): Fix segmentation fault when + * util/i386/pc/VasEBoot-setup.c (setup): Fix segmentation fault when partition map couldn't be identified. 2009-07-23 Pavel Roskin - * commands/xnu_uuid.c (transform): Use GRUB_CPU_WORDS_BIGENDIAN - instead of WORDS_BIGENDIAN. Use grub_le_to_cpu32(), so that the + * commands/xnu_uuid.c (transform): Use VasEBoot_CPU_WORDS_BIGENDIAN + instead of WORDS_BIGENDIAN. Use VasEBoot_le_to_cpu32(), so that the case of little endian words becomes just an optimization. Respect const modifier. (md5_final): Use code that doesn't depend on endianness. - * include/grub/misc.h (ALIGN_UP): Cast align to the type of addr + * include/VasEBoot/misc.h (ALIGN_UP): Cast align to the type of addr to avoid loss of upper bits if align is unsigned and shorter than addr. @@ -36823,62 +36823,62 @@ UUID support for UFS - * fs/ufs.c (grub_ufs_sblock): Add uuidhi and uuidlow. - (grub_ufs_uuid): New function. - (grub_ufs_fs): add .uuid + * fs/ufs.c (VasEBoot_ufs_sblock): Add uuidhi and uuidlow. + (VasEBoot_ufs_uuid): New function. + (VasEBoot_ufs_fs): add .uuid 2009-07-21 Pavel Roskin - * kern/dl.c (grub_dl_check_header): Make static. + * kern/dl.c (VasEBoot_dl_check_header): Make static. 2009-07-21 Felix Zielcke - * util/grub.d/30_os-prober.in: Remove unused CHAINROOT. Don't + * util/VasEBoot.d/30_os-prober.in: Remove unused CHAINROOT. Don't add drivemap for Vista. It breaks Windows 7. 2009-07-21 Vladimir Serbinenko - * fs/ufs.c (grub_ufs_sblock): Fix offset of mtime2 which was off by + * fs/ufs.c (VasEBoot_ufs_sblock): Fix offset of mtime2 which was off by 128 bytes 2009-07-20 Vladimir Serbinenko Add BFS support - * conf/common.rmk (grub_probe_SOURCES): Add fs/befs.c. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add fs/befs.c. + (VasEBoot_fstest_SOURCES): Likewise. (pkglib_MODULES): Add befs.mod. (befs_mod_SOURCES): New variable. (befs_mod_CFLAGS): Likewise. (befs_mod_LDFLAGS): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. - (grub_setup_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - (grub_setup_SOURCES): Likewise. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. + (VasEBoot_setup_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + (VasEBoot_setup_SOURCES): Likewise. * fs/befs.c: New file. - * fs/afs.c (GRUB_AFS_FSNAME): New declaration. - (GRUB_AFS_SBLOCK_SECTOR): Likewise. - (GRUB_AFS_SBLOCK_MAGIC1) [MODE_BFS]: New conditional declaration. - (GRUB_AFS_BTREE_MAGIC) [MODE_BFS]: Likewise + * fs/afs.c (VasEBoot_AFS_FSNAME): New declaration. + (VasEBoot_AFS_SBLOCK_SECTOR): Likewise. + (VasEBoot_AFS_SBLOCK_MAGIC1) [MODE_BFS]: New conditional declaration. + (VasEBoot_AFS_BTREE_MAGIC) [MODE_BFS]: Likewise (B_KEY_INDEX_ALIGN): New declaration. (B_KEY_INDEX_OFFSET): Use B_KEY_INDEX_ALIGN. - (grub_afs_bnode) [MODE_BFS]: Make key_count and key_size 16-bit - (grub_afs_btree) [MODE_BFS]: New conditional declaration. - (grub_afs_sblock) [MODE_BFS]: Remove link_count. - (grub_afs_validate_sblock) [MODE_BFS]: Support BFS - (grub_afs_mount) [MODE_BFS]: Likewise. - (grub_afs_dir) [MODE_BFS]: Divide mtime by 65536 and not 1000000. - (grub_afs_fs): Use GRUB_AFS_FSNAME - (GRUB_MOD_INIT (afs)) [MODE_BFS]: Rename to ... - (GRUB_MOD_INIT (befs)) [MODE_BFS]: ... this - (GRUB_MOD_FINI (afs)) [MODE_BFS]: Rename to ... - (GRUB_MOD_FINI (befs)) [MODE_BFS]: ... this + (VasEBoot_afs_bnode) [MODE_BFS]: Make key_count and key_size 16-bit + (VasEBoot_afs_btree) [MODE_BFS]: New conditional declaration. + (VasEBoot_afs_sblock) [MODE_BFS]: Remove link_count. + (VasEBoot_afs_validate_sblock) [MODE_BFS]: Support BFS + (VasEBoot_afs_mount) [MODE_BFS]: Likewise. + (VasEBoot_afs_dir) [MODE_BFS]: Divide mtime by 65536 and not 1000000. + (VasEBoot_afs_fs): Use VasEBoot_AFS_FSNAME + (VasEBoot_MOD_INIT (afs)) [MODE_BFS]: Rename to ... + (VasEBoot_MOD_INIT (befs)) [MODE_BFS]: ... this + (VasEBoot_MOD_FINI (afs)) [MODE_BFS]: Rename to ... + (VasEBoot_MOD_FINI (befs)) [MODE_BFS]: ... this -2009-07-19 Yves BLUSSEAU +2009-07-19 Yves BLUSSEAU * util/getroot.c (find_root_device): Add support for MacOSX. * util/hostdisk.c: Likewise. @@ -36890,7 +36890,7 @@ 2009-07-20 Joe Auricchio - * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. + * term/gfxterm.c (VasEBoot_virtual_screen_setup): Clear virtual_screen. 2009-07-20 Pavel Roskin @@ -36900,137 +36900,137 @@ Add symlink, mtime and label support to AtheFS. - * fs/afs.c (grub_afs_sblock): Declare `name' as char. - (grub_afs_iterate_dir): Handle symlinks. - (grub_afs_open): Use grub_afs_read_symlink. - (grub_afs_dir): Likewise. + * fs/afs.c (VasEBoot_afs_sblock): Declare `name' as char. + (VasEBoot_afs_iterate_dir): Handle symlinks. + (VasEBoot_afs_open): Use VasEBoot_afs_read_symlink. + (VasEBoot_afs_dir): Likewise. Pass mtime. - (grub_afs_label): New function. - (grub_afs_fs): Add grub_afs_label. - (grub_afs_read_symlink): New function. + (VasEBoot_afs_label): New function. + (VasEBoot_afs_fs): Add VasEBoot_afs_label. + (VasEBoot_afs_read_symlink): New function. 2009-07-20 Vladimir Serbinenko Fix AtheFS support. * fs/afs.c: Fix comments style. - (grub_afs_blockrun): Declare as packed. - (grub_afs_datastream): Likewise. - (grub_afs_bnode): Likewise. - (grub_afs_btree): Likewise. - (grub_afs_sblock): Likewise. + (VasEBoot_afs_blockrun): Declare as packed. + (VasEBoot_afs_datastream): Likewise. + (VasEBoot_afs_bnode): Likewise. + (VasEBoot_afs_btree): Likewise. + (VasEBoot_afs_sblock): Likewise. Declare `name' as char. - (grub_afs_inode): Declare as packed. - Change void *vnode to grub_uint32_t unused. - (grub_afs_iterate_dir): Check that key_size is positive. - (grub_afs_mount): Don't read superblock twice. - (grub_afs_dir): Don't free node in case of error, - grub_fshelp_find_file already handles this. - (grub_afs_open): Likewise. + (VasEBoot_afs_inode): Declare as packed. + Change void *vnode to VasEBoot_uint32_t unused. + (VasEBoot_afs_iterate_dir): Check that key_size is positive. + (VasEBoot_afs_mount): Don't read superblock twice. + (VasEBoot_afs_dir): Don't free node in case of error, + VasEBoot_fshelp_find_file already handles this. + (VasEBoot_afs_open): Likewise. 2009-07-19 Pavel Roskin * Makefile.in: Remove LIBLZO and enable_lzo. * conf/i386-pc.rmk: Remove lzo support. * configure.ac: Remove checks for lzo, don't define ENABLE_LZMA. - * include/grub/i386/pc/kernel.h: Define ENABLE_LZMA. Remove lzo + * include/VasEBoot/i386/pc/kernel.h: Define ENABLE_LZMA. Remove lzo support. * kern/i386/pc/lzo1x.S: Remove. * kern/i386/pc/startup.S: Remove lzo support. - * util/i386/pc/grub-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-mkimage.c: Likewise. 2009-07-19 Vladimir Serbinenko - * disk/usbms.c (grub_usbms_transfer): Fix double semicolon. - * fs/xfs.c (grub_xfs_dir): Likewise. - * fs/afs.c (grub_afs_dir): Likewise. - * fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. - (grub_iso9660_open): Likewise. - * fs/jfs.c (grub_jfs_open): Likewise. - * fs/ext2.c (grub_ext2_dir): Likewise. - * include/grub/macho.h (grub_macho_fat_arch): Likewise. - * script/sh/lexer.c (grub_script_yylex): Likewise. + * disk/usbms.c (VasEBoot_usbms_transfer): Fix double semicolon. + * fs/xfs.c (VasEBoot_xfs_dir): Likewise. + * fs/afs.c (VasEBoot_afs_dir): Likewise. + * fs/iso9660.c (VasEBoot_iso9660_iterate_dir): Likewise. + (VasEBoot_iso9660_open): Likewise. + * fs/jfs.c (VasEBoot_jfs_open): Likewise. + * fs/ext2.c (VasEBoot_ext2_dir): Likewise. + * include/VasEBoot/macho.h (VasEBoot_macho_fat_arch): Likewise. + * script/sh/lexer.c (VasEBoot_script_yylex): Likewise. 2009-07-16 Pavel Roskin * configure.ac: Never add "-c" to CFLAGS. - * configure.ac: Fix incorrect comparison for grub_cv_cc_efiemu. + * configure.ac: Fix incorrect comparison for VasEBoot_cv_cc_efiemu. - * configure.ac: Fix wrong use of grub_cv_cc_no_red_zone where - grub_cv_cc_efiemu should be used. + * configure.ac: Fix wrong use of VasEBoot_cv_cc_no_red_zone where + VasEBoot_cv_cc_efiemu should be used. * configure.ac: Typo fixes. - * kern/mm.c (grub_zalloc): New function. - (grub_debug_zalloc): Likewise. - * include/grub/mm.h: Declare grub_zalloc() and - grub_debug_zalloc(). - * util/misc.c (grub_zalloc): New function. - * bus/usb/uhci.c (grub_uhci_pci_iter): Use grub_zalloc() - instead of grub_malloc(), remove unneeded initializations. - * bus/usb/usbhub.c (grub_usb_hub_add_dev): Likewise. - * commands/extcmd.c (grub_extcmd_dispatcher): Likewise. - * commands/parttool.c (grub_cmd_parttool): Likewise. - * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Likewise. - * disk/raid5_recover.c (grub_raid5_recover): Likewise. - * disk/raid6_recover.c (grub_raid6_recover): Likewise. - * disk/usbms.c (grub_usbms_finddevs): Likewise. - * efiemu/mm.c (grub_efiemu_request_memalign): Likewise. - * efiemu/pnvram.c (grub_efiemu_pnvram): Likewise. - (grub_cmd_efiemu_pnvram): Likewise. - * fs/i386/pc/pxe.c (grub_pxefs_open): Likewise. - * fs/iso9660.c (grub_iso9660_mount): Likewise. - (grub_iso9660_iterate_dir): Likewise. - * fs/jfs.c (grub_jfs_opendir): Likewise. + * kern/mm.c (VasEBoot_zalloc): New function. + (VasEBoot_debug_zalloc): Likewise. + * include/VasEBoot/mm.h: Declare VasEBoot_zalloc() and + VasEBoot_debug_zalloc(). + * util/misc.c (VasEBoot_zalloc): New function. + * bus/usb/uhci.c (VasEBoot_uhci_pci_iter): Use VasEBoot_zalloc() + instead of VasEBoot_malloc(), remove unneeded initializations. + * bus/usb/usbhub.c (VasEBoot_usb_hub_add_dev): Likewise. + * commands/extcmd.c (VasEBoot_extcmd_dispatcher): Likewise. + * commands/parttool.c (VasEBoot_cmd_parttool): Likewise. + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Likewise. + * disk/raid5_recover.c (VasEBoot_raid5_recover): Likewise. + * disk/raid6_recover.c (VasEBoot_raid6_recover): Likewise. + * disk/usbms.c (VasEBoot_usbms_finddevs): Likewise. + * efiemu/mm.c (VasEBoot_efiemu_request_memalign): Likewise. + * efiemu/pnvram.c (VasEBoot_efiemu_pnvram): Likewise. + (VasEBoot_cmd_efiemu_pnvram): Likewise. + * fs/i386/pc/pxe.c (VasEBoot_pxefs_open): Likewise. + * fs/iso9660.c (VasEBoot_iso9660_mount): Likewise. + (VasEBoot_iso9660_iterate_dir): Likewise. + * fs/jfs.c (VasEBoot_jfs_opendir): Likewise. * fs/ntfs.c (list_file): Likewise. - (grub_ntfs_mount): Likewise. - * kern/disk.c (grub_disk_open): Likewise. - * kern/dl.c (grub_dl_load_core): Likewise. - * kern/elf.c (grub_elf_file): Likewise. - * kern/env.c (grub_env_context_open): Likewise. - (grub_env_set): Likewise. - (grub_env_set_data_slot): Likewise. - * kern/file.c (grub_file_open): Likewise. - * kern/fs.c (grub_fs_blocklist_open): Likewise. - * loader/i386/multiboot.c (grub_module): Likewise. - * loader/xnu.c (grub_xnu_create_key): Likewise. - (grub_xnu_create_value): Likewise. - * normal/main.c (grub_normal_add_menu_entry): Likewise. + (VasEBoot_ntfs_mount): Likewise. + * kern/disk.c (VasEBoot_disk_open): Likewise. + * kern/dl.c (VasEBoot_dl_load_core): Likewise. + * kern/elf.c (VasEBoot_elf_file): Likewise. + * kern/env.c (VasEBoot_env_context_open): Likewise. + (VasEBoot_env_set): Likewise. + (VasEBoot_env_set_data_slot): Likewise. + * kern/file.c (VasEBoot_file_open): Likewise. + * kern/fs.c (VasEBoot_fs_blocklist_open): Likewise. + * loader/i386/multiboot.c (VasEBoot_module): Likewise. + * loader/xnu.c (VasEBoot_xnu_create_key): Likewise. + (VasEBoot_xnu_create_value): Likewise. + * normal/main.c (VasEBoot_normal_add_menu_entry): Likewise. (read_config_file): Likewise. * normal/menu_entry.c (make_screen): Likewise. * partmap/sun.c (sun_partition_map_iterate): Likewise. - * script/sh/lexer.c (grub_script_lexer_init): Likewise. - * script/sh/script.c (grub_script_parse): Likewise. - * video/bitmap.c (grub_video_bitmap_create): Likewise. - * video/readers/jpeg.c (grub_video_reader_jpeg): Likewise. - * video/readers/png.c (grub_png_output_byte): Likewise. - (grub_video_reader_png): Likewise. + * script/sh/lexer.c (VasEBoot_script_lexer_init): Likewise. + * script/sh/script.c (VasEBoot_script_parse): Likewise. + * video/bitmap.c (VasEBoot_video_bitmap_create): Likewise. + * video/readers/jpeg.c (VasEBoot_video_reader_jpeg): Likewise. + * video/readers/png.c (VasEBoot_png_output_byte): Likewise. + (VasEBoot_video_reader_png): Likewise. 2009-07-16 Vladimir Serbinenko Enable all targets that can be built by default - * configure.ac: enable efiemu runtime, grub-emu, grub-emu-usb, - grub-mkfont and grub-fstest if they can be built + * configure.ac: enable efiemu runtime, VasEBoot-emu, VasEBoot-emu-usb, + VasEBoot-mkfont and VasEBoot-fstest if they can be built 2009-07-16 Vladimir Serbinenko - Fix hang and segmentation fault in grub-emu-usb + Fix hang and segmentation fault in VasEBoot-emu-usb - * disk/scsi.c (grub_scsi_open): return err and not grub_errno - * util/usb.c (grub_libusb_devices): likewise - (grub_libusb_init): rename to ... - (GRUB_MOD_INIT (libusb)):...this - (grub_libusb_fini): rename to .. - (GRUB_MOD_FINI (libusb)):...this - * disk/usbms.c (grub_usbms_transfer): fix retry logic - * include/grub/disk.h (grub_raid_init): removed, it's useless - (grub_raid_fini): likewise - (grub_lvm_init): likewise - (grub_lvm_fini): likewise - * util/grub-emu.c (main): don't call grub_libusb_init, it's done - by grub_init_all + * disk/scsi.c (VasEBoot_scsi_open): return err and not VasEBoot_errno + * util/usb.c (VasEBoot_libusb_devices): likewise + (VasEBoot_libusb_init): rename to ... + (VasEBoot_MOD_INIT (libusb)):...this + (VasEBoot_libusb_fini): rename to .. + (VasEBoot_MOD_FINI (libusb)):...this + * disk/usbms.c (VasEBoot_usbms_transfer): fix retry logic + * include/VasEBoot/disk.h (VasEBoot_raid_init): removed, it's useless + (VasEBoot_raid_fini): likewise + (VasEBoot_lvm_init): likewise + (VasEBoot_lvm_fini): likewise + * util/VasEBoot-emu.c (main): don't call VasEBoot_libusb_init, it's done + by VasEBoot_init_all 2009-07-16 Vladimir Serbinenko @@ -37045,86 +37045,86 @@ Make FreeBSD accept zpool.cache - * loader/i386/bsd.c (grub_freebsd_add_meta_module): spoof filename if + * loader/i386/bsd.c (VasEBoot_freebsd_add_meta_module): spoof filename if type is /boot/zfs/zpool.cache 2009-07-16 Vladimir Serbinenko Fix 64-bit efiemu - * include/grub/efiemu/efiemu.h (grub_efiemu_configuration_table64_t): + * include/VasEBoot/efiemu/efiemu.h (VasEBoot_efiemu_configuration_table64_t): correct wrong typedef - * efiemu/prepare.c (SUFFIX (grub_efiemu_prepare)): minor style fixes + * efiemu/prepare.c (SUFFIX (VasEBoot_efiemu_prepare)): minor style fixes 2009-07-15 Pavel Roskin - * include/grub/disk.h (struct grub_disk_dev): Use enum for id. - * kern/disk.c (struct grub_disk_cache): Likewise. + * include/VasEBoot/disk.h (struct VasEBoot_disk_dev): Use enum for id. + * kern/disk.c (struct VasEBoot_disk_cache): Likewise. * commands/probe.c (options): Typo fix. - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_BPB_END): + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_BPB_END): Increase to 0x5a to accommodate FAT32. Adjust other offsets accordingly. - Original patch by Yves Blusseau + Original patch by Yves Blusseau * boot/i386/pc/boot.S (general_error_string): Add DOS newline at the end of "Error" to make the message more readable. * boot/i386/pc/boot.S (kernel_segment): Remove. - (copy_buffer): Use GRUB_BOOT_MACHINE_KERNEL_ADDR in segment 0 + (copy_buffer): Use VasEBoot_BOOT_MACHINE_KERNEL_ADDR in segment 0 for destination. * boot/i386/pc/boot.S (boot_version): Remove. - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_VER_MAJ): + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_VER_MAJ): Remove. - * include/grub/i386/pc/boot.h: Sort all offsets. - (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Remove, it's unused. - (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Likewise. + * include/VasEBoot/i386/pc/boot.h: Sort all offsets. + (VasEBoot_BOOT_MACHINE_KERNEL_ADDRESS): Remove, it's unused. + (VasEBoot_BOOT_MACHINE_KERNEL_SEGMENT): Likewise. * boot/i386/pc/boot.S: Assert location of every offset listed in - include/grub/i386/pc/boot.h. + include/VasEBoot/i386/pc/boot.h. 2009-07-13 Pavel Roskin - * include/grub/i386/coreboot/machine.h: Rename - GRUB_MACHINE_LINUXBIOS to GRUB_MACHINE_COREBOOT. - * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Allow - multiboot 1 for GRUB_MACHINE_COREBOOT and GRUB_MACHINE_QEMU. + * include/VasEBoot/i386/coreboot/machine.h: Rename + VasEBoot_MACHINE_LINUXBIOS to VasEBoot_MACHINE_COREBOOT. + * loader/multiboot_loader.c (VasEBoot_cmd_multiboot_loader): Allow + multiboot 1 for VasEBoot_MACHINE_COREBOOT and VasEBoot_MACHINE_QEMU. * kern/dl.c: Force native word size to suppress warnings when - compiling grub-emu. + compiling VasEBoot-emu. - * kern/device.c (grub_device_iterate): Change struct part_ent to - hold the name, not a pointer to it. Use one grub_malloc() per - partition, not two. Free partition_name if grub_malloc() fails. - Set ents to NULL only before grub_partition_iterate() is called. + * kern/device.c (VasEBoot_device_iterate): Change struct part_ent to + hold the name, not a pointer to it. Use one VasEBoot_malloc() per + partition, not two. Free partition_name if VasEBoot_malloc() fails. + Set ents to NULL only before VasEBoot_partition_iterate() is called. 2009-07-11 Bean - * kern/ieee1275/openfw.c (grub_children_iterate): Fix size of + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Fix size of childname. 2009-07-10 Bean -2009-07-10 Robert Millan +2009-07-10 Robert Millan - * kern/ieee1275/openfw.c (grub_children_iterate) - (grub_devalias_iterate): Fix size evaluation for property or path + * kern/ieee1275/openfw.c (VasEBoot_children_iterate) + (VasEBoot_devalias_iterate): Fix size evaluation for property or path strings, which was broken since r2132. 2009-07-07 Pavel Roskin * commands/search.c (search_file): Merge into ... (search_fs): ... this. Accept search type as argument. - (grub_cmd_search): Pass search type to search_fs(). + (VasEBoot_cmd_search): Pass search type to search_fs(). - * include/grub/util/console.h: New file. - * util/console.c: Use it instead of grub/machine/console.h. - * util/grub-emu.c: Likewise. + * include/VasEBoot/util/console.h: New file. + * util/console.c: Use it instead of VasEBoot/machine/console.h. + * util/VasEBoot-emu.c: Likewise. * lib/arg.c (find_long_option): Remove. (find_long): Add `len' argument, make `s' const char *. - (grub_arg_parse): Parse long options in place, not in a + (VasEBoot_arg_parse): Parse long options in place, not in a temporary buffer. 2009-07-06 Pavel Roskin @@ -37137,15 +37137,15 @@ 2009-07-06 Daniel Mierswa - * commands/search.c (search_fs): Use grub_strcasecmp() for UUID + * commands/search.c (search_fs): Use VasEBoot_strcasecmp() for UUID comparison. 2009-07-05 Pavel Roskin - * include/grub/i386/linux.h (struct linux_kernel_params): + * include/VasEBoot/i386/linux.h (struct linux_kernel_params): Restore padding3, it's still needed. - * util/grub.d/10_freebsd.in: Fix spelling of `device.hints' on + * util/VasEBoot.d/10_freebsd.in: Fix spelling of `device.hints' on FreeBSD. * util/osdetect.lua: Likewise. @@ -37153,25 +37153,25 @@ * conf/common.rmk (lua_mode_SOURCES): Add script/lua/lstrlib.c. - * script/lua/grub_lib.c (grub_lua_run): Check input parameter. - (grub_lua_getenv): Likewise. - (grub_lua_setenv): Likewise. + * script/lua/VasEBoot_lib.c (VasEBoot_lua_run): Check input parameter. + (VasEBoot_lua_getenv): Likewise. + (VasEBoot_lua_setenv): Likewise. (save_errno): New function. (push_result): Likewise. - (grub_lua_enum_device): Likewise. - (grub_lua_enum_file): Likewise. - (grub_lua_file_open): Likewise. - (grub_lua_file_close): Likewise. - (grub_lua_file_seek): Likewise. - (grub_lua_file_read): Likewise. - (grub_lua_file_getline): Likewise. - (grub_lua_file_getsize): Likewise. - (grub_lua_file_getpos): Likewise. - (grub_lua_file_eof): Likewise. - (grub_lua_file_exist): Likewise. - (grub_lua_add_menu): Likewise. + (VasEBoot_lua_enum_device): Likewise. + (VasEBoot_lua_enum_file): Likewise. + (VasEBoot_lua_file_open): Likewise. + (VasEBoot_lua_file_close): Likewise. + (VasEBoot_lua_file_seek): Likewise. + (VasEBoot_lua_file_read): Likewise. + (VasEBoot_lua_file_getline): Likewise. + (VasEBoot_lua_file_getsize): Likewise. + (VasEBoot_lua_file_getpos): Likewise. + (VasEBoot_lua_file_eof): Likewise. + (VasEBoot_lua_file_exist): Likewise. + (VasEBoot_lua_add_menu): Likewise. - * script/lua/grub_lua.h (isupper): New inline function. + * script/lua/VasEBoot_lua.h (isupper): New inline function. (islower): Likewise. (ispunct): Likewise. (isxdigit): Likewise. @@ -37179,7 +37179,7 @@ (strpbkr): New function declaration. (memchr): Likewise. - * script/lua/grub_main.c (scan_str): New function. + * script/lua/VasEBoot_main.c (scan_str): New function. (strcspn): Likewise. (strpbrk): Likewise. (memchr): Likewise. @@ -37188,9 +37188,9 @@ * util/osdetect.lua: New file. -2009-07-04 Robert Millan +2009-07-04 Robert Millan - * include/grub/i386/linux.h (struct linux_kernel_params): Add + * include/VasEBoot/i386/linux.h (struct linux_kernel_params): Add `capabilities' member. 2009-07-02 Pavel Roskin @@ -37205,53 +37205,53 @@ `sysctl_size', as sysctlbyname() can change it (in this case it doesn't actually happen). - * include/grub/types.h: Define GRUB_LONG_MAX and GRUB_LONG_MIN + * include/VasEBoot/types.h: Define VasEBoot_LONG_MAX and VasEBoot_LONG_MIN using signed long int constants. - * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Make `p' + * util/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Make `p' constant to avoid a warning on FreeBSD. * util/hostdisk.c (device_is_wholedisk): Compile only on systems where it's needed. - * Makefile.in: Install include/grub/machine symlink. + * Makefile.in: Install include/VasEBoot/machine symlink. * Makefile.in: When installing symlinks, use "cp -fR", which works on FreeBSD and MacOSX. From Yves Blusseau - * kern/dl.c (grub_dl_resolve_symbol): Make static. - * include/grub/dl.h: Remove grub_dl_resolve_symbol(). + * kern/dl.c (VasEBoot_dl_resolve_symbol): Make static. + * include/VasEBoot/dl.h: Remove VasEBoot_dl_resolve_symbol(). - * util/misc.c: Move grub_reboot() and grub_halt() ... - * util/grub-emu.c: ... here. Make main_env static. - * include/grub/util/misc.h: Remove main_env. + * util/misc.c: Move VasEBoot_reboot() and VasEBoot_halt() ... + * util/VasEBoot-emu.c: ... here. Make main_env static. + * include/VasEBoot/util/misc.h: Remove main_env. * kern/mm.c: Use correct format to print size_t. - * include/grub/elf.h: Define Elf_Sword and Elf_Xword. + * include/VasEBoot/elf.h: Define Elf_Sword and Elf_Xword. * kern/i386/dl.c: Use ELF symbols without "32" or "64". * kern/powerpc/dl.c: Likewise. * kern/sparc64/dl.c: Likewise. * kern/x86_64/dl.c: Likewise. -2009-07-01 Robert Millan +2009-07-01 Robert Millan - Fix grub-emu build on sparc64-ieee1275. + Fix VasEBoot-emu build on sparc64-ieee1275. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Synchronize with ... - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): ... this. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Synchronize with ... + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): ... this. -2009-07-01 Robert Millan +2009-07-01 Robert Millan - * util/misc.c: Include `' and `'. - (grub_reboot, grub_halt): New functions. + * util/misc.c: Include `' and `'. + (VasEBoot_reboot, VasEBoot_halt): New functions. * util/i386/pc/misc.c: Delete. Update all users. * util/sparc64/ieee1275/misc.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. -2009-07-01 Robert Millan +2009-07-01 Robert Millan * conf/i386.rmk (setjmp_mod_SOURCES) (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): Move to ... @@ -37274,20 +37274,20 @@ kern/$(target_cpu)/cache.S. * conf/sparc64-ieee1275.rmk: Likewise. -2009-07-01 Robert Millan +2009-07-01 Robert Millan - * include/grub/i386/linux.h (linux_kernel_params): Change `mmap_size' - type to `grub_uint8_t', and adjust `padding9' accordingly. + * include/VasEBoot/i386/linux.h (linux_kernel_params): Change `mmap_size' + type to `VasEBoot_uint8_t', and adjust `padding9' accordingly. -2009-06-29 Robert Millan +2009-06-29 Robert Millan - * include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro. + * include/VasEBoot/i386/linux.h (VasEBoot_VIDEO_TYPE_TEXT): New macro. - * loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline + * loader/i386/linux.c [__i386__] (VasEBoot_linux_boot): Simplify inline assembly in final jump, using register constraints. - (grub_linux_boot): For text mode, initialize `have_vga' using - GRUB_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1). + (VasEBoot_linux_boot): For text mode, initialize `have_vga' using + VasEBoot_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1). Initialize `video_cursor_x' and `video_cursor_y' as late as possible, right before the final jump. @@ -37297,13 +37297,13 @@ Document initialization of `video_page', `video_mode' and `video_ega_bx'. -2009-06-29 Robert Millan +2009-06-29 Robert Millan - * include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro. - * loader/i386/linux.c (grub_cmd_linux): Recognize "quiet" option, - and set GRUB_LINUX_FLAG_QUIET appropriately. + * include/VasEBoot/i386/linux.h (VasEBoot_LINUX_FLAG_QUIET): New macro. + * loader/i386/linux.c (VasEBoot_cmd_linux): Recognize "quiet" option, + and set VasEBoot_LINUX_FLAG_QUIET appropriately. -2009-06-29 Robert Millan +2009-06-29 Robert Millan Fix build on Debian / sparc. @@ -37311,35 +37311,35 @@ 2009-06-28 Pavel Roskin - * kern/i386/qemu/mmap.c (grub_machine_mmap_iterate): Use cast to + * kern/i386/qemu/mmap.c (VasEBoot_machine_mmap_iterate): Use cast to fix a warning. - * util/grub.d/10_linux.in: Match SUSE style initrd names. + * util/VasEBoot.d/10_linux.in: Match SUSE style initrd names. -2009-06-27 Robert Millan +2009-06-27 Robert Millan - * loader/i386/linux.c (grub_linux_boot): Fix uninitialized use of + * loader/i386/linux.c (VasEBoot_linux_boot): Fix uninitialized use of `err'. -2009-06-27 Robert Millan +2009-06-27 Robert Millan Revert r2338. - * loader/i386/linux.c (grub_cmd_linux): Don't call grub_error when - file can't be opened. grub_file_open() is already supposed to set - grub_errno / grub_errmsg appropriately. - * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. + * loader/i386/linux.c (VasEBoot_cmd_linux): Don't call VasEBoot_error when + file can't be opened. VasEBoot_file_open() is already supposed to set + VasEBoot_errno / VasEBoot_errmsg appropriately. + * loader/i386/pc/linux.c (VasEBoot_cmd_linux): Likewise. 2009-06-27 Pavel Roskin -2009-06-27 Robert Millan +2009-06-27 Robert Millan - * include/grub/dl.h: Include grub/elf.h. - (struct grub_dl): Add symtab field. - * kern/dl.c [GRUB_MACHINE_QEMU]: Define - GRUB_MODULES_MACHINE_READONLY. - (grub_dl_resolve_symbols): Populate mod->symtab, making a copy + * include/VasEBoot/dl.h: Include VasEBoot/elf.h. + (struct VasEBoot_dl): Add symtab field. + * kern/dl.c [VasEBoot_MACHINE_QEMU]: Define + VasEBoot_MODULES_MACHINE_READONLY. + (VasEBoot_dl_resolve_symbols): Populate mod->symtab, making a copy of the header for read-only modules. - (grub_dl_unload): Free mod->symtab for read-only modules. + (VasEBoot_dl_unload): Free mod->symtab for read-only modules. * kern/i386/dl.c: Use mod->symtab. * kern/powerpc/dl.c: Likewise. * kern/sparc64/dl.c: Likewise. @@ -37349,35 +37349,35 @@ * kern/i386/qemu/startup.S: Likewise. * kern/i386/qemu/mmap.c: Likewise. * boot/i386/qemu/boot.S: Likewise. - * include/grub/i386/qemu/time.h: Likewise. - * include/grub/i386/qemu/serial.h: Likewise. - * include/grub/i386/qemu/kernel.h: Likewise. - * include/grub/i386/qemu/console.h: Likewise. - * include/grub/i386/qemu/boot.h: Likewise. - * include/grub/i386/qemu/init.h: Likewise. - * include/grub/i386/qemu/machine.h: Likewise. - * include/grub/i386/qemu/loader.h: Likewise. - * include/grub/i386/qemu/memory.h: Likewise. + * include/VasEBoot/i386/qemu/time.h: Likewise. + * include/VasEBoot/i386/qemu/serial.h: Likewise. + * include/VasEBoot/i386/qemu/kernel.h: Likewise. + * include/VasEBoot/i386/qemu/console.h: Likewise. + * include/VasEBoot/i386/qemu/boot.h: Likewise. + * include/VasEBoot/i386/qemu/init.h: Likewise. + * include/VasEBoot/i386/qemu/machine.h: Likewise. + * include/VasEBoot/i386/qemu/loader.h: Likewise. + * include/VasEBoot/i386/qemu/memory.h: Likewise. - * conf/i386-coreboot.rmk (GRUB_BOOT_MACHINE_LINK_ADDR) - (GRUB_KERNEL_MACHINE_LINK_ADDR): New variables. + * conf/i386-coreboot.rmk (VasEBoot_BOOT_MACHINE_LINK_ADDR) + (VasEBoot_KERNEL_MACHINE_LINK_ADDR): New variables. [qemu] (pkglib_IMAGES): Add `boot.img'. [qemu] (boot_img_SOURCES, boot_img_ASFLAGS, boot_img_LDFLAGS) [qemu] (boot_img_FORMAT): New variables. - [qemu] (bin_UTILITIES): Add `grub-mkimage'. - [qemu] (grub_mkimage_SOURCES, grub_mkimage_CFLAGS): New variables. + [qemu] (bin_UTILITIES): Add `VasEBoot-mkimage'. + [qemu] (VasEBoot_mkimage_SOURCES, VasEBoot_mkimage_CFLAGS): New variables. [qemu] (kernel_img_SOURCES, kernel_img_HEADERS, kernel_img_CFLAGS) [qemu] (kernel_img_ASFLAGS, kernel_img_LDFLAGS) [qemu] (kernel_img_FORMAT): New variables. * configure.ac: Recognise `i386-qemu'. - * util/i386/pc/grub-mkimage.c (compress_kernel): Add dummy variant + * util/i386/pc/VasEBoot-mkimage.c (compress_kernel): Add dummy variant (for no compression). - [GRUB_MACHINE_QEMU] (generate_image): Misc adjustments to produce - a valid i386 ROM image. Make `GRUB_KERNEL_MACHINE_COMPRESSED_SIZE', - `GRUB_KERNEL_MACHINE_INSTALL_DOS_PART' and - `GRUB_KERNEL_MACHINE_INSTALL_BSD_PART' optional features (with + [VasEBoot_MACHINE_QEMU] (generate_image): Misc adjustments to produce + a valid i386 ROM image. Make `VasEBoot_KERNEL_MACHINE_COMPRESSED_SIZE', + `VasEBoot_KERNEL_MACHINE_INSTALL_DOS_PART' and + `VasEBoot_KERNEL_MACHINE_INSTALL_BSD_PART' optional features (with ifdefs). 2009-06-27 Pavel Roskin @@ -37389,58 +37389,58 @@ 2009-06-26 Pavel Roskin - * include/grub/types.h: Define GRUB_TARGET_WORDSIZE. - * include/grub/elf.h: Define symbols without "32" or "64" based - on GRUB_TARGET_WORDSIZE. - * include/grub/multiboot2.h: Use GRUB_TARGET_WORDSIZE. - * efiemu/loadcore32.c: Redefine GRUB_TARGET_WORDSIZE, remove own + * include/VasEBoot/types.h: Define VasEBoot_TARGET_WORDSIZE. + * include/VasEBoot/elf.h: Define symbols without "32" or "64" based + on VasEBoot_TARGET_WORDSIZE. + * include/VasEBoot/multiboot2.h: Use VasEBoot_TARGET_WORDSIZE. + * efiemu/loadcore32.c: Redefine VasEBoot_TARGET_WORDSIZE, remove own ELF definitions. * efiemu/loadcore64.c: Likewise. * loader/i386/bsd32.c: Likewise. * loader/i386/bsd64.c: Likewise. * kern/dl.c: Remove own ELF definitions. - * util/i386/efi/grub-mkimage.c: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. -2009-06-23 Robert Millan +2009-06-23 Robert Millan * kern/i386/pc/startup.S (real_to_prot): Access `gdtdesc' using segment 0x0 unconditionally, because the reference generated by GAS is an absolute address. -2009-06-22 Robert Millan +2009-06-22 Robert Millan - * include/grub/i386/kernel.h: Include `'. - [! GRUB_MACHINE_IEEE1275]: Set `GRUB_MOD_ALIGN' to 0x1. + * include/VasEBoot/i386/kernel.h: Include `'. + [! VasEBoot_MACHINE_IEEE1275]: Set `VasEBoot_MOD_ALIGN' to 0x1. -2009-06-22 Robert Millan +2009-06-22 Robert Millan - * commands/search.c (grub_cmd_search): Macroify hardcoded args[] + * commands/search.c (VasEBoot_cmd_search): Macroify hardcoded args[] indexes. Check for -f explicitly. (search_file): Improve error message. - (GRUB_MOD_INIT(search)): Add missing `-n' to help output. + (VasEBoot_MOD_INIT(search)): Add missing `-n' to help output. -2009-06-22 Robert Millan +2009-06-22 Robert Millan - * conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): Rename to ... - (GRUB_KERNEL_MACHINE_LINK_ADDR): ... this. Update all users. + * conf/i386-pc.rmk (VasEBoot_MEMORY_MACHINE_LINK_ADDR): Rename to ... + (VasEBoot_KERNEL_MACHINE_LINK_ADDR): ... this. Update all users. -2009-06-22 Robert Millan +2009-06-22 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/misc.S'. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. - * kern/i386/pc/startup.S (grub_stop): Remove function. + * kern/i386/pc/startup.S (VasEBoot_stop): Remove function. * kern/i386/ieee1275/startup.S: Likewise. * kern/i386/coreboot/startup.S: Likewise. - * kern/i386/misc.S (grub_stop): New function. + * kern/i386/misc.S (VasEBoot_stop): New function. -2009-06-22 Robert Millan +2009-06-22 Robert Millan * kern/i386/pc/startup.S (real_to_prot): Move from here ... * kern/i386/realmode.S (real_to_prot): ... to here. -2009-06-22 Robert Millan +2009-06-22 Robert Millan * conf/i386-ieee1275.rmk (pkglib_PROGRAMS): Replace `kernel.elf' with `kernel.img'. @@ -37457,7 +37457,7 @@ * conf/i386-coreboot.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. - * util/elf/grub-mkimage.c (add_segments): Replace "kernel.elf" + * util/elf/VasEBoot-mkimage.c (add_segments): Replace "kernel.elf" with "kernel.img". 2009-06-21 Pavel Roskin @@ -37468,12 +37468,12 @@ * conf/i386-ieee1275.rmk: Define kernel_elf_ASFLAGS. -2009-06-21 Robert Millan +2009-06-21 Robert Millan * configure.ac: Enable `END_SYMBOL' / `BSS_START_SYMBOL' test on all i386 platforms. -2009-06-21 Robert Millan +2009-06-21 Robert Millan Fix asm file handling on ELF, and remove workarounds. @@ -37488,54 +37488,54 @@ * conf/i386-pc.rmk (bsd_mod_SOURCES): Add loader/i386/bsd32.c and loader/i386/bsd64.c - * include/grub/i386/bsd.h (FREEBSD_MODTYPE_MODULE): Remove + * include/VasEBoot/i386/bsd.h (FREEBSD_MODTYPE_MODULE): Remove (FREEBSD_MODTYPE_ELF_MODULE): New definition (FREEBSD_MODTYPE_ELF_MODULE_OBJ): Likewise - (grub_freebsd_load_elfmodule32): New declaration - (grub_freebsd_load_elfmoduleobj64): Likewise - (grub_freebsd_load_elf_meta32): Likewise - (grub_freebsd_load_elf_meta64): Likewise - (grub_freebsd_add_meta): Likewise - (grub_freebsd_add_meta_module): Likewise - * loader/i386/bsd.c (grub_freebsd_add_meta): Make global - (grub_freebsd_add_meta_module): Likewise and move module-specific - parts to grub_cmd_freebsd and grub_cmd_freebsd_module - (grub_cmd_freebsd): Add elf-kernel specific parts - based on grub_freebsd_add_meta_module - (grub_cmd_freebsd_module): Add type parsing moved from - grub_freebsd_add_meta_module - (grub_cmd_freebsd_module_elf): New function + (VasEBoot_freebsd_load_elfmodule32): New declaration + (VasEBoot_freebsd_load_elfmoduleobj64): Likewise + (VasEBoot_freebsd_load_elf_meta32): Likewise + (VasEBoot_freebsd_load_elf_meta64): Likewise + (VasEBoot_freebsd_add_meta): Likewise + (VasEBoot_freebsd_add_meta_module): Likewise + * loader/i386/bsd.c (VasEBoot_freebsd_add_meta): Make global + (VasEBoot_freebsd_add_meta_module): Likewise and move module-specific + parts to VasEBoot_cmd_freebsd and VasEBoot_cmd_freebsd_module + (VasEBoot_cmd_freebsd): Add elf-kernel specific parts + based on VasEBoot_freebsd_add_meta_module + (VasEBoot_cmd_freebsd_module): Add type parsing moved from + VasEBoot_freebsd_add_meta_module + (VasEBoot_cmd_freebsd_module_elf): New function (cmd_freebsd_module_elf): New variable - (GRUB_MOD_INIT): Register freebsd_module_elf + (VasEBoot_MOD_INIT): Register freebsd_module_elf * loader/i386/bsd32.c: New file * loader/i386/bsd64.c: Likewise * loader/i386/bsdXX.c: Likewise - * kern/elf.c (grub_elf32_load): Let hook decide which pheaders to load - (grub_elf64_load): Likewise - * include/grub/elfload.h (grub_elf32_load_hook_t): New parameter do_load + * kern/elf.c (VasEBoot_elf32_load): Let hook decide which pheaders to load + (VasEBoot_elf64_load): Likewise + * include/VasEBoot/elfload.h (VasEBoot_elf32_load_hook_t): New parameter do_load All users updated - (grub_elf64_load_hook_t): Likewise + (VasEBoot_elf64_load_hook_t): Likewise 2009-06-21 Colin Watson - * util/grub-mkconfig.in (GRUB_DISABLE_LINUX_RECOVERY): Export + * util/VasEBoot-mkconfig.in (VasEBoot_DISABLE_LINUX_RECOVERY): Export variable. - * util/grub.d/10_linux.in: If GRUB_DISABLE_LINUX_RECOVERY is true, + * util/VasEBoot.d/10_linux.in: If VasEBoot_DISABLE_LINUX_RECOVERY is true, don't write a menu entry for recovery mode. -2009-06-20 Robert Millan +2009-06-20 Robert Millan - * util/i386/pc/grub-mkimage.c (main): Oops, free `output' only + * util/i386/pc/VasEBoot-mkimage.c (main): Oops, free `output' only after it's no longer needed. -2009-06-20 Robert Millan +2009-06-20 Robert Millan - * include/grub/i386/loader.h (grub_linux_prot_size) - (grub_linux_tmp_addr, grub_linux_real_addr) - (grub_linux_is_bzimage, grub_linux16_boot): Declare only on - GRUB_MACHINE_PCBIOS. - * util/i386/pc/grub-mkimage.c (compress_kernel): Move - common grub_util_info() call to ... + * include/VasEBoot/i386/loader.h (VasEBoot_linux_prot_size) + (VasEBoot_linux_tmp_addr, VasEBoot_linux_real_addr) + (VasEBoot_linux_is_bzimage, VasEBoot_linux16_boot): Declare only on + VasEBoot_MACHINE_PCBIOS. + * util/i386/pc/VasEBoot-mkimage.c (compress_kernel): Move + common VasEBoot_util_info() call to ... (generate_image): ... here. Fix use of uninitialized memory, comparison of signed with unsigned integers and memory leak. @@ -37543,9 +37543,9 @@ 2009-06-20 Vladimir Serbinenko - * disk/mdraid_linux.c (GRUB_MOD_FINI): use grub_raid_unregister and not - grub_raid_register - * disk/dmraid_nvidia.c (GRUB_MOD_FINI): likewise + * disk/mdraid_linux.c (VasEBoot_MOD_FINI): use VasEBoot_raid_unregister and not + VasEBoot_raid_register + * disk/dmraid_nvidia.c (VasEBoot_MOD_FINI): likewise 2009-06-19 Pavel Roskin @@ -37553,20 +37553,20 @@ 2009-06-19 Vladimir Serbinenko - * disk/scsi.c (grub_scsi_open): use continue instead of big if + * disk/scsi.c (VasEBoot_scsi_open): use continue instead of big if 2009-06-18 Pavel Roskin * conf/common.rmk: Add fs_file.mod. * disk/fs_file.c: New file. - * include/grub/disk.h (enum grub_disk_dev_id): Add - GRUB_DISK_DEVICE_FILE_ID. + * include/VasEBoot/disk.h (enum VasEBoot_disk_dev_id): Add + VasEBoot_DISK_DEVICE_FILE_ID. 2009-06-18 Vladimir Serbinenko Fix build with Apple's toolchain. Part 2 - * aclocal.m4 (grub_PROG_TARGET_CC): add missing prototype for main and + * aclocal.m4 (VasEBoot_PROG_TARGET_CC): add missing prototype for main and a fake start 2009-06-18 Vladimir Serbinenko @@ -37585,79 +37585,79 @@ * fs/ntfscomp.c (decomp_get16): initialize c1 and c2 (decomp_block): initialize ch - use grub_memcpy instead of memcpy + use VasEBoot_memcpy instead of memcpy 2009-06-17 Pavel Roskin - * include/grub/i386/coreboot/console.h: Don't use the i386-pc + * include/VasEBoot/i386/coreboot/console.h: Don't use the i386-pc version, use declarations needed to use vga_text as the startup console. * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Remove term/i386/pc/at_keyboard.c, it doesn't need to be compiled into the kernel. - * kern/i386/coreboot/init.c: Don't call grub_at_keyboard_init() - and grub_at_keyboard_fini(), it's done on module load and + * kern/i386/coreboot/init.c: Don't call VasEBoot_at_keyboard_init() + and VasEBoot_at_keyboard_fini(), it's done on module load and unload. 2009-06-17 Felix Zielcke - * loader/i386/linux.c (grub_cmd_linux): Set grub_error if the + * loader/i386/linux.c (VasEBoot_cmd_linux): Set VasEBoot_error if the file can't be found. - * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. + * loader/i386/pc/linux.c (VasEBoot_cmd_linux): Likewise. 2009-06-17 Vladimir Serbinenko Fix newline handling - * include/grub/script_sh.h (grub_lexer_param): new field was_newline - * script/sh/lexer.c (grub_script_lexer_init): initialize was_newline - (grub_script_yylex): don't segfault on unterminated script + * include/VasEBoot/script_sh.h (VasEBoot_lexer_param): new field was_newline + * script/sh/lexer.c (VasEBoot_script_lexer_init): initialize was_newline + (VasEBoot_script_yylex): don't segfault on unterminated script newline terminates command and variable 2009-06-17 Vladimir Serbinenko - avoid double grub_adjust_range call. Bug reported by David Simner + avoid double VasEBoot_adjust_range call. Bug reported by David Simner - * kern/disk.c (grub_disk_write): change to raw disk access before + * kern/disk.c (VasEBoot_disk_write): change to raw disk access before calling disk_read 2009-06-17 Colin Watson - * util/elf/grub-mkimage.c (usage): Prefix each option line with two + * util/elf/VasEBoot-mkimage.c (usage): Prefix each option line with two spaces, for the benefit of help2man. - * util/i386/efi/grub-mkimage.c (usage): Likewise. + * util/i386/efi/VasEBoot-mkimage.c (usage): Likewise. 2009-06-16 Pavel Roskin - * kern/i386/halt.c: Include grub/machine/init.h. - * kern/i386/reboot.c: Include grub/cpu/reboot.h. + * kern/i386/halt.c: Include VasEBoot/machine/init.h. + * kern/i386/reboot.c: Include VasEBoot/cpu/reboot.h. 2009-06-16 Felix Zielcke - * util/grub.d/30_os-prober.in: Use ${root} in the generated + * util/VasEBoot.d/30_os-prober.in: Use ${root} in the generated drivemap menuentry. 2009-06-16 James Jarvis - * commands/help.c GRUB_MOD_INIT(echo): Fix the help output of + * commands/help.c VasEBoot_MOD_INIT(echo): Fix the help output of `echo' command. 2009-06-16 Pavel Roskin * boot/i386/pc/boot.S: Remove root_drive. Assert offset of - boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK. Don't + boot_drive_check by using VasEBoot_BOOT_MACHINE_DRIVE_CHECK. Don't save %dx, we only need %dl and we never change it. * boot/i386/pc/cdboot.S: Don't set the root drive. * boot/i386/pc/pxeboot.S: Likewise. - * include/grub/i386/pc/boot.h: Remove - GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust - GRUB_BOOT_MACHINE_DRIVE_CHECK. - * include/grub/i386/pc/kernel.h: Remove grub_root_drive. + * include/VasEBoot/i386/pc/boot.h: Remove + VasEBoot_BOOT_MACHINE_ROOT_DRIVE, adjust + VasEBoot_BOOT_MACHINE_DRIVE_CHECK. + * include/VasEBoot/i386/pc/kernel.h: Remove VasEBoot_root_drive. * kern/i386/pc/init.c (make_install_device): Remove references - to grub_root_drive. + to VasEBoot_root_drive. * kern/i386/pc/startup.S: Likewise. - * util/i386/pc/grub-setup.c (setup): Don't set root_drive. + * util/i386/pc/VasEBoot-setup.c (setup): Don't set root_drive. 2009-06-16 Vladimir Serbinenko @@ -37668,12 +37668,12 @@ (xnu_uuid_mod_SOURCES): new variable (xnu_uuid_mod_CFLAGS): likewise (xnu_uuid_mod_LDFLAGS): likewise - * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): add commands/probe.c * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise - * util/grub.d/30_os-prober.in: use UUID for Mac OS X/Darwin + * util/VasEBoot.d/30_os-prober.in: use UUID for Mac OS X/Darwin 2009-06-16 Pavel Roskin @@ -37688,7 +37688,7 @@ (probe_mod_SOURCES): new variable (probe_mod_CFLAGS): likewise (probe_mod_LDFLAGS): likewise - * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): add commands/probe.c * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise @@ -37699,17 +37699,17 @@ Fix handling of string like \"hello\" and "a b" - * script/sh/lexer.c (check_textstate): accept GRUB_PARSER_STATE_ESC - (grub_script_yylex): fix parsing of quoting, escaping and newline + * script/sh/lexer.c (check_textstate): accept VasEBoot_PARSER_STATE_ESC + (VasEBoot_script_yylex): fix parsing of quoting, escaping and newline 2009-06-13 Vladimir Serbinenko - * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition + * loader/i386/multiboot.c (VasEBoot_multiboot_get_bootdev): fix partition handling 2009-06-13 Jun Inoue - * util/grub-mkconfig.in: Fix parsing of --output option. + * util/VasEBoot-mkconfig.in: Fix parsing of --output option. 2009-06-12 Pavel Roskin @@ -37725,14 +37725,14 @@ * Makefile.in (uninstall): Uninstall manuals. * Makefile.in: Rename lib_DATA to lib_SCRIPTS, move it from - PKGLIB to SCRIPTS. This fixes installation of grub-mkconfig_lib - and update-grub_lib in two places. + PKGLIB to SCRIPTS. This fixes installation of VasEBoot-mkconfig_lib + and update-VasEBoot_lib in two places. * conf/common.rmk: Rename lib_DATA to lib_SCRIPTS. - * disk/usbms.c (grub_usbms_transfer): Initialize `err' to fix + * disk/usbms.c (VasEBoot_usbms_transfer): Initialize `err' to fix a compiler warning. - * loader/i386/bsd.c (grub_freebsd_boot): Rename `entry' to + * loader/i386/bsd.c (VasEBoot_freebsd_boot): Rename `entry' to `entry_lo' to fix variable shadowing. 2009-06-11 Christian Franke @@ -37756,18 +37756,18 @@ UDF fix - * fs/udf.c (grub_udf_read_block): handle the fact that ad->length + * fs/udf.c (VasEBoot_udf_read_block): handle the fact that ad->length is in bytes and not in blocks 2009-06-11 Pavel Roskin - * kern/i386/halt.c (grub_halt): Make `i' unsigned to fix a + * kern/i386/halt.c (VasEBoot_halt): Make `i' unsigned to fix a warning. 2009-06-11 Felix Zielcke - * util/grub.d/30_os-prober.in: Fix a comment. Source - ${libdir}/grub/grub-mkconfig_lib. Use prepare_grub_to_access_device + * util/VasEBoot.d/30_os-prober.in: Fix a comment. Source + ${libdir}/VasEBoot/VasEBoot-mkconfig_lib. Use prepare_VasEBoot_to_access_device to set the root device. Place drivemap command in the generated chain entry. @@ -37778,20 +37778,20 @@ 2009-06-11 Colin Watson - * util/grub.d/10_linux.in: Capitalise "Linux". + * util/VasEBoot.d/10_linux.in: Capitalise "Linux". - * util/grub-pe2elf.c (usage): Fix references to grub-editenv. + * util/VasEBoot-pe2elf.c (usage): Fix references to VasEBoot-editenv. 2009-06-11 Pavel Roskin - * kern/efi/efi.c (grub_exit): Add infinite loop at the end to + * kern/efi/efi.c (VasEBoot_exit): Add infinite loop at the end to fix a gcc warning and ensure that the function won't ever exit. * kern/i386/ieee1275/init.c: Add missing prototype for - grub_stop_floppy(). + VasEBoot_stop_floppy(). * loader/ieee1275/multiboot2.c [__i386__]: Include - grub/cpu/multiboot.h. + VasEBoot/cpu/multiboot.h. * term/i386/pc/serial.c (serial_translate_key_sequence): Avoid casts to short - they are not portable and cause warnings. Fix @@ -37801,12 +37801,12 @@ Drivemap fixes - * commands/i386/pc/drivemap.c (grub_get_root_biosnumber_drivemap): + * commands/i386/pc/drivemap.c (VasEBoot_get_root_biosnumber_drivemap): new function - (grub_get_root_biosnumber_saved): new variable - (GRUB_MOD_INIT): register grub_get_root_biosnumber_drivemap - (GRUB_MOD_FINI): unregister grub_get_root_biosnumber_drivemap - * commands/i386/pc/drivemap_int13h.S (grub_drivemap_handler): restore + (VasEBoot_get_root_biosnumber_saved): new variable + (VasEBoot_MOD_INIT): register VasEBoot_get_root_biosnumber_drivemap + (VasEBoot_MOD_FINI): unregister VasEBoot_get_root_biosnumber_drivemap + * commands/i386/pc/drivemap_int13h.S (VasEBoot_drivemap_handler): restore %dx after the call if necessary * conf/common.rmk (pkglib_MODULES): remove boot.mod (boot_mod_SOURCES): remove @@ -37822,11 +37822,11 @@ * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise * conf/x86_64-efi.rmk: likewise - * include/grub/i386/pc/biosnum.h: new file + * include/VasEBoot/i386/pc/biosnum.h: new file * lib/i386/pc/biosnum.c: likewise - * loader/i386/bsd.c (grub_bsd_get_device): use grub_get_root_biosnumber - * loader/i386/multiboot.c (grub_multiboot_get_bootdev): likewise - * loader/i386/pc/chainloader.c (grub_chainloader_cmd): likewise + * loader/i386/bsd.c (VasEBoot_bsd_get_device): use VasEBoot_get_root_biosnumber + * loader/i386/multiboot.c (VasEBoot_multiboot_get_bootdev): likewise + * loader/i386/pc/chainloader.c (VasEBoot_chainloader_cmd): likewise 2009-06-10 Pavel Roskin @@ -37834,14 +37834,14 @@ Use separate variables. Read only the file size at the end, but not the checksum that we don't use. - * kern/file.c (grub_file_read): Use void pointer for the buffer. + * kern/file.c (VasEBoot_file_read): Use void pointer for the buffer. Adjust all callers. * kern/ieee1275/openfw.c: Remove libc includes. * kern/ieee1275/cmain.c: Likewise. - * include/grub/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/ieee1275/ieee1275.h: Likewise. - * kern/i386/coreboot/init.c: Include grub/cpu/tsc.h to fix + * kern/i386/coreboot/init.c: Include VasEBoot/cpu/tsc.h to fix compiler warnings. 2009-06-10 Felix Zielcke @@ -37850,7 +37850,7 @@ * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. - * docs/grub.texi: Likewise. + * docs/VasEBoot.texi: Likewise. * docs/texinfo.tex: Likewise. * disk/fs_uuid.c: Likewise. * disk/lvm.c: Likewise. @@ -37936,37 +37936,37 @@ * efiemu/loadcore.c: Likewise. * efiemu/symbols.c: Likewise. * efiemu/mm.c: Likewise. - * include/grub/autoefi.h: Likewise. - * include/grub/datetime.h: Likewise. - * include/grub/term.h: Likewise. - * include/grub/hfs.h: Likewise. - * include/grub/lvm.h: Likewise. - * include/grub/i386/tsc.h: Likewise. - * include/grub/i386/linux.h: Likewise. - * include/grub/i386/xnu.h: Likewise. - * include/grub/i386/efiemu.h: Likewise. - * include/grub/i386/pc/biosdisk.h: Likewise. - * include/grub/i386/pc/memory.h: Likewise. - * include/grub/i386/pc/vbe.h: Likewise. - * include/grub/parttool.h: Likewise. - * include/grub/video.h: Likewise. - * include/grub/memory.h: Likewise. - * include/grub/fs.h: Likewise. - * include/grub/partition.h: Likewise. - * include/grub/xnu.h: Likewise. - * include/grub/efi/api.h: Likewise. - * include/grub/efi/pe32.h: Likewise. - * include/grub/efi/memory.h: Likewise. - * include/grub/multiboot.h: Likewise. - * include/grub/usbdesc.h: Likewise. - * include/grub/multiboot2.h: Likewise. - * include/grub/acpi.h: Likewise. - * include/grub/efiemu/efiemu.h: Likewise. - * include/grub/disk.h: Likewise. - * include/grub/ieee1275/ieee1275.h: Likewise. - * include/grub/net.h: Likewise. - * include/grub/machoload.h: Likewise. - * include/grub/macho.h: Likewise. + * include/VasEBoot/autoefi.h: Likewise. + * include/VasEBoot/datetime.h: Likewise. + * include/VasEBoot/term.h: Likewise. + * include/VasEBoot/hfs.h: Likewise. + * include/VasEBoot/lvm.h: Likewise. + * include/VasEBoot/i386/tsc.h: Likewise. + * include/VasEBoot/i386/linux.h: Likewise. + * include/VasEBoot/i386/xnu.h: Likewise. + * include/VasEBoot/i386/efiemu.h: Likewise. + * include/VasEBoot/i386/pc/biosdisk.h: Likewise. + * include/VasEBoot/i386/pc/memory.h: Likewise. + * include/VasEBoot/i386/pc/vbe.h: Likewise. + * include/VasEBoot/parttool.h: Likewise. + * include/VasEBoot/video.h: Likewise. + * include/VasEBoot/memory.h: Likewise. + * include/VasEBoot/fs.h: Likewise. + * include/VasEBoot/partition.h: Likewise. + * include/VasEBoot/xnu.h: Likewise. + * include/VasEBoot/efi/api.h: Likewise. + * include/VasEBoot/efi/pe32.h: Likewise. + * include/VasEBoot/efi/memory.h: Likewise. + * include/VasEBoot/multiboot.h: Likewise. + * include/VasEBoot/usbdesc.h: Likewise. + * include/VasEBoot/multiboot2.h: Likewise. + * include/VasEBoot/acpi.h: Likewise. + * include/VasEBoot/efiemu/efiemu.h: Likewise. + * include/VasEBoot/disk.h: Likewise. + * include/VasEBoot/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/net.h: Likewise. + * include/VasEBoot/machoload.h: Likewise. + * include/VasEBoot/macho.h: Likewise. * include/multiboot.h: Likewise. * genmoddep.awk: Likewise. * normal/main.c: Likewise. @@ -38049,24 +38049,24 @@ * term/gfxterm.c: Likewise. * aclocal.m4: Likewise. * util/lvm.c: Likewise. - * util/grub.d/30_os-prober.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. + * util/VasEBoot.d/30_os-prober.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. * util/console.c: Likewise. - * util/grub-macho2img.c: Likewise. - * util/grub-probe.c: Likewise. + * util/VasEBoot-macho2img.c: Likewise. + * util/VasEBoot-probe.c: Likewise. * util/hostfs.c: Likewise. - * util/i386/pc/grub-mkimage.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. - * util/i386/efi/grub-mkimage.c: Likewise. - * util/grub-mkconfig.in: Likewise. + * util/i386/pc/VasEBoot-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. + * util/VasEBoot-mkconfig.in: Likewise. * util/raid.c: Likewise. * util/resolve.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. - * util/grub-emu.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/VasEBoot-emu.c: Likewise. * util/getroot.c: Likewise. * util/hostdisk.c: Likewise. * util/usb.c: Likewise. - * util/grub-editenv.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. * util/misc.c: Likewise. 2009-06-10 Felix Zielcke @@ -38079,12 +38079,12 @@ 2009-06-10 Pavel Roskin - * include/grub/multiboot2.h: Provide compatibility defines for + * include/VasEBoot/multiboot2.h: Provide compatibility defines for multiboot2.h. * include/multiboot2.h: Include stdint.h only if needed, using angle brackets. * loader/i386/pc/multiboot2.c: Include multiboot2.h after - grub/multiboot2.h. + VasEBoot/multiboot2.h. * loader/ieee1275/multiboot2.c: Likewise. * loader/multiboot2.c: Likewise. * loader/multiboot_loader.c: Likewise. @@ -38094,9 +38094,9 @@ * configure.ac: Remove checks for __bswapsi2 and __bswapdi2, they fail without libc headers for the target. - * include/grub/powerpc/libgcc.h: Use weak attribute for all + * include/VasEBoot/powerpc/libgcc.h: Use weak attribute for all exports. - * include/grub/sparc64/libgcc.h: Likewise. Don't use + * include/VasEBoot/sparc64/libgcc.h: Likewise. Don't use preprocessor conditionals. * conf/common.rmk: Compile tar.mod from tar.c, not cpio.c. The @@ -38104,64 +38104,64 @@ 2009-06-09 Michel Hermier - * fs/i386/pc/pxe.c (grub_pxefs_read): Fix returned values. + * fs/i386/pc/pxe.c (VasEBoot_pxefs_read): Fix returned values. -2009-06-09 Robert Millan +2009-06-09 Robert Millan - * util/deviceiter.c (grub_util_iterate_devices): Increase number of + * util/deviceiter.c (VasEBoot_util_iterate_devices): Increase number of disk limit to 26 for IDE, Virtio, Xen and SCSI. 2009-06-09 Felix Zielcke - * util/i386/pc/grub-install.in: Change the error message if UUIDs + * util/i386/pc/VasEBoot-install.in: Change the error message if UUIDs aren't available if ata.mod gets used. 2009-06-09 Oliver Henshaw - * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Link struct only after initialising controller. - * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * bus/usb/uhci.c (VasEBoot_uhci_pci_iter): Likewise. 2009-06-08 Felix Zielcke - * util/i386/pc/grub-install.in: Add a parameter --disk-module + * util/i386/pc/VasEBoot-install.in: Add a parameter --disk-module to choose between ata and biosdisk module on i386-pc. 2009-06-08 Oliver Henshaw - * bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class, + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Define the Class, Subclass and Programming Interface fields in terms of the 3 byte Class Code register. - * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * bus/usb/uhci.c (VasEBoot_uhci_pci_iter): Likewise. - * bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming - interface is OHCI. Add grub_dprintf for symmetry with + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Check that programming + interface is OHCI. Add VasEBoot_dprintf for symmetry with bus/usb/uhci.c. - * bus/usb/uhci.c (grub_uhci_pci_iter): Check that programming + * bus/usb/uhci.c (VasEBoot_uhci_pci_iter): Check that programming interface is UHCI. Add interf variable for programming interface. Print interface with class/subclass. * bus/usb/ohci.c: Set interf with correct field. * bus/usb/uhci.c: Remove unneeded doubled lines. - * bus/usb/ohci.c: Likewise. Change interf to grub_uint32_t. + * bus/usb/ohci.c: Likewise. Change interf to VasEBoot_uint32_t. Remove whitespace inside comment. -2009-06-08 Robert Millan +2009-06-08 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): When processing `vga=', use + * loader/i386/linux.c (VasEBoot_cmd_linux): When processing `vga=', use as fallback an equivalent option without depth. 2009-06-08 Vladimir Serbinenko Not fail if unable to retrieve C/H/S on LBA disks - * disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): behave gracefully if unable to retrieve C/H/S on LBA disks 2009-06-08 Pavel Roskin - * fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning + * fs/hfs.c (VasEBoot_hfs_find_dir): Use union to avoid a warning about aliasing. 2009-06-08 Felix Zielcke @@ -38172,7 +38172,7 @@ Bugfix: install on partitionless device - * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): check if os_dev + * util/hostdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): check if os_dev is a whole disk 2009-06-08 Felix Zielcke @@ -38200,9 +38200,9 @@ 2009-06-05 Michael Scherer - * fs/hfsplus.c (grub_hfsplus_mount): Determine if the filesystem + * fs/hfsplus.c (VasEBoot_hfsplus_mount): Determine if the filesystem uses case sensitive btree. - (grub_hfsplus_iterate_dir): Use GRUB_FSHELP_CASE_INSENSITIVE + (VasEBoot_hfsplus_iterate_dir): Use VasEBoot_FSHELP_CASE_INSENSITIVE only for case insensitive filesystems. 2009-06-05 Vladimir Serbinenko @@ -38217,14 +38217,14 @@ 2009-06-04 Vladimir Serbinenko - * include/grub/term.h (GRUB_TERM_BACKSPACE): explicitly define as 8 + * include/VasEBoot/term.h (VasEBoot_TERM_BACKSPACE): explicitly define as 8 instead of '\b' 2009-06-04 Vladimir Serbinenko Definitions for creating asm symbols with Apple's CC - * include/grub/symbol.h [APPLE_CC] (FUNCTION): new macro + * include/VasEBoot/symbol.h [APPLE_CC] (FUNCTION): new macro [APPLE_CC] (VARIABLE): likewise 2009-06-04 Vladimir Serbinenko @@ -38254,27 +38254,27 @@ * kern/misc.c [APPLE_CC] (memcpy): new function [APPLE_CC] (memmove): likewise - [APPLE_CC && !GRUB_UTIL] (grub_err_printf): likewise + [APPLE_CC && !VasEBoot_UTIL] (VasEBoot_err_printf): likewise (memcpy): define alias conditionally on !APPLE_CC (memset): likewise (abort): likewise - * include/grub/misc.h (memove): don't define when both GRUB_UTIL and + * include/VasEBoot/misc.h (memove): don't define when both VasEBoot_UTIL and APPLE_CC are defined - * include/grub/list.h [APPLE_CC] (grub_assert_fail): new function - (grub_assert_fail): make prototype conditional + * include/VasEBoot/list.h [APPLE_CC] (VasEBoot_assert_fail): new function + (VasEBoot_assert_fail): make prototype conditional 2009-06-04 Vladimir Serbinenko - Use grub-macho2img when compiling with Apple's CC for PCBIOS machine + Use VasEBoot-macho2img when compiling with Apple's CC for PCBIOS machine * conf/common.rmk (bin_UTILITIES): add (on false on condition) - grub-macho2img - (CLEANFILES): add grub-macho2img - (grub_macho2img_SOURCES): new variable + VasEBoot-macho2img + (CLEANFILES): add VasEBoot-macho2img + (VasEBoot_macho2img_SOURCES): new variable * kern/i386/pc/startup.S (bss_start): new variable (bss_end): likewise - * genmk.rb: use grub-macho2img for *.img when compiled with Apple's CC - * util/grub-macho2img.c: new file + * genmk.rb: use VasEBoot-macho2img for *.img when compiled with Apple's CC + * util/VasEBoot-macho2img.c: new file 2009-06-04 Vladimir Serbinenko @@ -38301,14 +38301,14 @@ (efiemu_getcrc32): likewise (init_crc32_table): likewise (reflect): likewise - * include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC - (GRUB_MOD_DEP): likewise + * include/VasEBoot/dl.h (VasEBoot_MOD_NAME): define segment with Apple's CC + (VasEBoot_MOD_DEP): likewise 2009-06-04 Vladimir Serbinenko Allow a compilation without -mcmodel=large - * kern/efi/mm.c (grub_efi_allocate_pages): don't allocate >4GiB + * kern/efi/mm.c (VasEBoot_efi_allocate_pages): don't allocate >4GiB when compiled without -mcmodel=large (filter_memory_map): remove memory post 4 GiB when compiled without -mcmodel=large @@ -38327,9 +38327,9 @@ * efiemu/runtime/efiemu.c (write_cmos): use %cl instead of %bl as temporary storage - * include/grub/i386/tsc.h (grub_get_tsc): restore %rbx/%ebx when + * include/VasEBoot/i386/tsc.h (VasEBoot_get_tsc): restore %rbx/%ebx when using Apple's CC - (grub_cpu_is_tsc_supported): likewise + (VasEBoot_cpu_is_tsc_supported): likewise * loader/i386/xnu.c (guessfsb): restore %rbx/%ebx in inline assembly 2009-06-04 Vladimir Serbinenko @@ -38356,7 +38356,7 @@ (OBJCONV): likewise (TARGET_IMG_CFLAGS): likewise (TARGET_CPPFLAGS): add includedir - * configure.ac: call grub_apple_cc and grub_apple_target_cc + * configure.ac: call VasEBoot_apple_cc and VasEBoot_apple_target_cc (TARGET_IMG_LDFLAGS): Add -Wl,-Ttext,. All users updated Check for linker script only if compiler isn't Apple's CC (TARGET_MODULE_FORMAT): set @@ -38366,8 +38366,8 @@ Check for objcopy only if compiler isn't Apple's CC Check for BSS symbol only if compiler isn't Apple's CC * genmk.rb: adapt nm options if we use Apple's utils - * aclocal.m4 (grub_apple_cc): new test - (grub_apple_target_cc): likewise + * aclocal.m4 (VasEBoot_apple_cc): new test + (VasEBoot_apple_target_cc): likewise 2009-06-04 Vladimir Serbinenko @@ -38386,9 +38386,9 @@ 2009-06-04 Vladimir Serbinenko - Fix wrong assumptions with grub-mkimage on EFI + Fix wrong assumptions with VasEBoot-mkimage on EFI - * i386/efi/grub-mkimage.c (read_kernel_module): don't write prefix here + * i386/efi/VasEBoot-mkimage.c (read_kernel_module): don't write prefix here (relocate_addresses): consider both r_addend and value at offset (make_mods_section): zerofill modinfo and header (convert_elf): write prefix here @@ -38399,34 +38399,34 @@ * i386/pc/diskboot.S: use .asciz instead of .string * i386/pc/boot.S: likewise - * include/grub/dl.h (GRUB_MOD_DEP): likewise - (GRUB_MOD_NAME): likewise + * include/VasEBoot/dl.h (VasEBoot_MOD_DEP): likewise + (VasEBoot_MOD_NAME): likewise 2009-06-04 Vladimir Serbinenko gfxpayload support - * commands/videotest.c (grub_cmd_videotest): use grub_video_set_mode - * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_PURE_TEXT): new definition - (grub_video_setup): remove - (grub_video_set_mode): new prototype + * commands/videotest.c (VasEBoot_cmd_videotest): use VasEBoot_video_set_mode + * include/VasEBoot/video.h (VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT): new definition + (VasEBoot_video_setup): remove + (VasEBoot_video_set_mode): new prototype * loader/i386/linux.c (DEFAULT_VIDEO_MODE): new definition (vid_mode): remove (linux_vesafb_res): compile only on PCBIOS - (grub_linux_boot): support gfxpayload + (VasEBoot_linux_boot): support gfxpayload * loader/i386/pc/xnu.c (video_hook): new function - (grub_xnu_set_video): support gfxpayload + (VasEBoot_xnu_set_video): support gfxpayload * term/gfxterm.c (DEFAULT_VIDEO_WIDTH): removed (DEFAULT_VIDEO_HEIGHT): likewise (DEFAULT_VIDEO_FLAGS): likewise (DEFAULT_VIDEO_MODE): new definition (video_hook): new function - (grub_gfxterm_init): use grub_video_set_mode - * util/grub.d/30_os-prober.in: remove explicit modesetting before + (VasEBoot_gfxterm_init): use VasEBoot_video_set_mode + * util/VasEBoot.d/30_os-prober.in: remove explicit modesetting before loading xnu - * video/video.c (grub_video_setup): removed - (grub_video_set_mode): new function based on grub_gfxterm_init and - grub_video_setup + * video/video.c (VasEBoot_video_setup): removed + (VasEBoot_video_set_mode): new function based on VasEBoot_gfxterm_init and + VasEBoot_video_setup 2009-06-04 Vladimir Serbinenko @@ -38435,33 +38435,33 @@ * commands/i386/pc/drivemap.c (parse_biosdisk): remove (revparse_biosdisk): likewise (list_mappings): derive name from id directly - (grub_cmd_drivemap): use tryparse_diskstring + (VasEBoot_cmd_drivemap): use tryparse_diskstring 2009-06-04 Vladimir Serbinenko Script fixes - * include/grub/script_sh.h (grub_script_cmdline): remove cmdline - (grub_lexer_param): add tokenonhold - (grub_script_create_cmdline): remove cmdline. All callers updated - (grub_script_function_create): make functionname - grub_script_arg. All callers updated - (grub_script_execute_argument_to_string): new prototype + * include/VasEBoot/script_sh.h (VasEBoot_script_cmdline): remove cmdline + (VasEBoot_lexer_param): add tokenonhold + (VasEBoot_script_create_cmdline): remove cmdline. All callers updated + (VasEBoot_script_function_create): make functionname + VasEBoot_script_arg. All callers updated + (VasEBoot_script_execute_argument_to_string): new prototype * kern/parser.c (state_transitions): reorder - (grub_parser_cmdline_state): fix a bug and make more compact - * script/sh/execute.c (grub_script_execute_argument_to_string): + (VasEBoot_parser_cmdline_state): fix a bug and make more compact + * script/sh/execute.c (VasEBoot_script_execute_argument_to_string): make global - (grub_script_execute_cmdline): use new format - * script/sh/function.c (grub_script_function_create): make functionname - grub_script_arg. All callers updated - * script/sh/lexer.c (grub_script_lexer_init): initialize tokenonhold - (grub_script_yylex): remove - (grub_script_yylex2): renamed to ... - (grub_script_yylex): ...renamed + (VasEBoot_script_execute_cmdline): use new format + * script/sh/function.c (VasEBoot_script_function_create): make functionname + VasEBoot_script_arg. All callers updated + * script/sh/lexer.c (VasEBoot_script_lexer_init): initialize tokenonhold + (VasEBoot_script_yylex): remove + (VasEBoot_script_yylex2): renamed to ... + (VasEBoot_script_yylex): ...renamed parse the expressions like a${b}c - * script/sh/parser.y (GRUB_PARSER_TOKEN_ARG): new typed terminal - (GRUB_PARSER_TOKEN_VAR): remove - (GRUB_PARSER_TOKEN_NAME): likewise + * script/sh/parser.y (VasEBoot_PARSER_TOKEN_ARG): new typed terminal + (VasEBoot_PARSER_TOKEN_VAR): remove + (VasEBoot_PARSER_TOKEN_NAME): likewise ("if"): declare as typeless ("while"): likewise ("function"): likewise @@ -38471,24 +38471,24 @@ (text): remove (argument): likewise (script): accept empty scripts and make exit on error - (arguments): use GRUB_PARSER_TOKEN_ARG + (arguments): use VasEBoot_PARSER_TOKEN_ARG (function): likewise (command): move error handling to script - (menuentry): move grub_script_lexer_ref before - * script/sh/script.c (grub_script_create_cmdline): remove cmdline + (menuentry): move VasEBoot_script_lexer_ref before + * script/sh/script.c (VasEBoot_script_create_cmdline): remove cmdline argument. All callers updated -2009-06-04 Robert Millan +2009-06-04 Robert Millan - Prevent GRUB from probing floppies during boot. + Prevent VasEBoot from probing floppies during boot. * conf/common.rmk (search_mod_CFLAGS): Use `-Werror -Wall'. * commands/search.c (options): Add --no-floppy. - (search_fs, search_file, grub_cmd_search): Support --no-floppy. - * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Use + (search_fs, search_file, VasEBoot_cmd_search): Support --no-floppy. + * util/VasEBoot-mkconfig_lib.in (prepare_VasEBoot_to_access_device): Use --no-floppy when searching for UUIDs. -2009-06-04 Robert Millan +2009-06-04 Robert Millan Simplify the code duplication in commands/search.c. @@ -38497,70 +38497,70 @@ 2009-06-03 Felix Zielcke - * util/grub-mkconfig.in (update_grub_dir): Rename to grub_mkconfig_dir. + * util/VasEBoot-mkconfig.in (update_VasEBoot_dir): Rename to VasEBoot_mkconfig_dir. 2009-05-28 Pavel Roskin * Makefile.in: Don't use "cp -d", it doesn't work on FreeBSD. Remove the original symlink explicitly. - * fs/hfs.c (grub_hfs_find_dir): Skip sequences of slashes, not - just one slash. That's how grub_fshelp_find_file() does it. + * fs/hfs.c (VasEBoot_hfs_find_dir): Skip sequences of slashes, not + just one slash. That's how VasEBoot_fshelp_find_file() does it. 2009-05-26 Pavel Roskin * genmk.rb: Avoid shadowing variable `s', rename the outer `s' to `str'. - * util/getroot.c (grub_util_get_dev_abstraction): Mark os_dev as + * util/getroot.c (VasEBoot_util_get_dev_abstraction): Mark os_dev as possibly unused. 2009-05-25 Christian Franke - * disk/ata.c (grub_ata_wait_not_busy): Add debug output of status + * disk/ata.c (VasEBoot_ata_wait_not_busy): Add debug output of status register. - (grub_atapi_identify): Add wait after drive select. - (grub_ata_identify): Do more strict status register check before - calling grub_atapi_identify (). Suppress error message if status + (VasEBoot_atapi_identify): Add wait after drive select. + (VasEBoot_ata_identify): Do more strict status register check before + calling VasEBoot_atapi_identify (). Suppress error message if status register is 0x00 after command failure. Add status register check after PIO read to avoid bogus identify due to stuck DRQ. Thanks to Pavel Roskin for testing. - (grub_device_initialize): Remove unsafe status register check. + (VasEBoot_device_initialize): Remove unsafe status register check. Thanks to 'phcoder' for problem report and patch. Prevent sign extension in debug message. 2009-05-23 Colin D Bennett - Cleaned up `include/grub/normal.h'. Grouped prototypes by + Cleaned up `include/VasEBoot/normal.h'. Grouped prototypes by definition file, and functions defined in `normal/menu.c' have had - their prototypes moved to `include/grub/menu.h' for consistency. + their prototypes moved to `include/VasEBoot/menu.h' for consistency. - * include/grub/menu.h (grub_menu_execute_callback): Added; moved + * include/VasEBoot/menu.h (VasEBoot_menu_execute_callback): Added; moved from normal.h. - (grub_menu_get_entry): Likewise. - (grub_menu_get_timeout): Likewise. - (grub_menu_set_timeout): Likewise. - (grub_menu_execute_entry): Likewise. - (grub_menu_execute_with_fallback): Likewise. - (grub_menu_entry_run): Likewise. + (VasEBoot_menu_get_entry): Likewise. + (VasEBoot_menu_get_timeout): Likewise. + (VasEBoot_menu_set_timeout): Likewise. + (VasEBoot_menu_execute_entry): Likewise. + (VasEBoot_menu_execute_with_fallback): Likewise. + (VasEBoot_menu_entry_run): Likewise. - * include/grub/normal.h: Re-ordered and grouped function + * include/VasEBoot/normal.h: Re-ordered and grouped function prototypes by file that the function is defined in. - (grub_menu_execute_callback): Removed; moved to menu.h. - (grub_menu_get_entry): Likewise. - (grub_menu_get_timeout): Likewise. - (grub_menu_set_timeout): Likewise. - (grub_menu_execute_entry): Likewise. - (grub_menu_execute_with_fallback): Likewise. - (grub_menu_entry_run): Likewise. - (grub_menu_addentry): Renamed from this ... - (grub_normal_add_menu_entry): ... to this. + (VasEBoot_menu_execute_callback): Removed; moved to menu.h. + (VasEBoot_menu_get_entry): Likewise. + (VasEBoot_menu_get_timeout): Likewise. + (VasEBoot_menu_set_timeout): Likewise. + (VasEBoot_menu_execute_entry): Likewise. + (VasEBoot_menu_execute_with_fallback): Likewise. + (VasEBoot_menu_entry_run): Likewise. + (VasEBoot_menu_addentry): Renamed from this ... + (VasEBoot_normal_add_menu_entry): ... to this. - * normal/main.c (grub_menu_addentry): Renamed from this ... - (grub_normal_add_menu_entry): ... to this. + * normal/main.c (VasEBoot_menu_addentry): Renamed from this ... + (VasEBoot_normal_add_menu_entry): ... to this. - * script/sh/execute.c (grub_script_execute_menuentry): Update - reference to renamed grub_menu_addentry function. + * script/sh/execute.c (VasEBoot_script_execute_menuentry): Update + reference to renamed VasEBoot_menu_addentry function. 2009-05-23 Felix Zielcke @@ -38568,20 +38568,20 @@ 2009-05-22 Pavel Roskin - * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Remove. - * configure.ac: Don't call grub_I386_CHECK_REGPARM_BUG. Define + * aclocal.m4 (VasEBoot_I386_CHECK_REGPARM_BUG): Remove. + * configure.ac: Don't call VasEBoot_I386_CHECK_REGPARM_BUG. Define NESTED_FUNC_ATTR using AH_BOTTOM. Use regparm(1) only when compiling for the i386 targets, but not for the utilities. - * include/grub/i386/pc/kernel.h (grub_boot_drive): Change type - to grub_uint8_t. - (grub_root_drive): Likewise. - * kern/i386/pc/startup.S (grub_boot_drive): Change size to byte, + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_boot_drive): Change type + to VasEBoot_uint8_t. + (VasEBoot_root_drive): Likewise. + * kern/i386/pc/startup.S (VasEBoot_boot_drive): Change size to byte, remove alignment. - (grub_root_drive): Change size to byte. - (grub_start_addr): Remove. - (grub_end_addr): Likewise. - (grub_apm_bios_info): Likewise. + (VasEBoot_root_drive): Change size to byte. + (VasEBoot_start_addr): Remove. + (VasEBoot_end_addr): Likewise. + (VasEBoot_apm_bios_info): Likewise. 2009-05-21 Felix Zielcke @@ -38602,8 +38602,8 @@ Previously, executing a syntactically invalid statement like ")foo" or "bar;" would silently fail. - * script/lua/grub_main.c (handle_lua_error): New function. - (grub_lua_parse_line): Improved reporting of Lua parser and + * script/lua/VasEBoot_main.c (handle_lua_error): New function. + (VasEBoot_lua_parse_line): Improved reporting of Lua parser and execution errors. 2009-05-17 Vladimir Serbinenko @@ -38620,25 +38620,25 @@ * conf/x86_64-efi.rmk (linux_mod_SOURCES): added loader/i386/efi/linux_trampoline.S - * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed + * include/VasEBoot/x86_64/efi/loader.h (VasEBoot_linux_real_boot): removed declaration - * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from + * kern/x86_64/efi/startup.S (VasEBoot_linux_real_boot): moved from here * loader/i386/linux_trampoline.S: moved here * loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline (jumpvector): removed - (grub_linux_trampoline_start): new declaration - (grub_linux_trampoline_end): likewise - (grub_linux_boot): use trampoline when on 64-bit platform + (VasEBoot_linux_trampoline_start): new declaration + (VasEBoot_linux_trampoline_end): likewise + (VasEBoot_linux_boot): use trampoline when on 64-bit platform * loader/i386/linux.c: likewise 2009-05-16 Pavel Roskin - * script/lua/grub_lib.c (grub_lua_getenv): Make name and value + * script/lua/VasEBoot_lib.c (VasEBoot_lua_getenv): Make name and value const to avoid a warning. - (grub_lua_setenv): Likewise. - * script/lua/grub_main.c (grub_lua_parse_line): Use size_t for + (VasEBoot_lua_setenv): Likewise. + * script/lua/VasEBoot_main.c (VasEBoot_lua_parse_line): Use size_t for lmsg to fix a warning. 2009-05-16 Felix Zielcke @@ -38654,7 +38654,7 @@ 2009-05-16 Felix Zielcke - * util/grub-mkconfig.in: Export GRUB_TERMINAL_INPUT. + * util/VasEBoot-mkconfig.in: Export VasEBoot_TERMINAL_INPUT. 2009-05-16 Bean @@ -38692,13 +38692,13 @@ * normal/sparc64/setjmp.S: Moved from here ... * lib/sparc64/setjmp.S: ... Moved here - * include/grub/i386/setjmp.h (grub_setjmp): Don't use attribute + * include/VasEBoot/i386/setjmp.h (VasEBoot_setjmp): Don't use attribute returns_twice in mingw. - * script/lua/grub_lib.c: New file. - * script/lua/grub_lib.h: Likewise. - * script/lua/grub_lua.h: Likewise. - * script/lua/grub_main.c: Likewise. + * script/lua/VasEBoot_lib.c: New file. + * script/lua/VasEBoot_lib.h: Likewise. + * script/lua/VasEBoot_lua.h: Likewise. + * script/lua/VasEBoot_main.c: Likewise. * script/lua/lapi.c: Likewise. * script/lua/lapi.h: Likewise. * script/lua/lauxlib.c: Likewise. @@ -38754,13 +38754,13 @@ 2009-05-16 Bean - * include/grub/kernel.h (grub_module_header_types): Add type + * include/VasEBoot/kernel.h (VasEBoot_module_header_types): Add type OBJ_TYPE_CONFIG. - * kern/main.c (grub_load_config): New function. - (grub_main): Call grub_load_config to read boot config. + * kern/main.c (VasEBoot_load_config): New function. + (VasEBoot_main): Call VasEBoot_load_config to read boot config. - * grub-mkimage (generate_image): New parameter config_path. + * VasEBoot-mkimage (generate_image): New parameter config_path. (options): New option --config. (main): Parse --config option, and pass it to generate_image. @@ -38777,14 +38777,14 @@ 2009-05-13 Pavel Roskin - * loader/i386/multiboot.c (grub_multiboot): Cast mmap_addr to - grub_uint32_t to avoid a warning. + * loader/i386/multiboot.c (VasEBoot_multiboot): Cast mmap_addr to + VasEBoot_uint32_t to avoid a warning. * loader/i386/linux.c (allocate_pages): When assigning - real_mode_mem, cast through grub_size_t to fix a warning. The + real_mode_mem, cast through VasEBoot_size_t to fix a warning. The code already makes sure that the value would fit a pointer. - (grub_linux_setup_video): Cast render_target->data to - grub_size_t to fix a warning. + (VasEBoot_linux_setup_video): Cast render_target->data to + VasEBoot_size_t to fix a warning. 2009-05-13 Javier Martín @@ -38795,12 +38795,12 @@ 2009-05-13 Pavel Roskin - * util/i386/pc/grub-setup.c (setup): Remove unused variable + * util/i386/pc/VasEBoot-setup.c (setup): Remove unused variable embedding_area_exists. -2009-05-13 Robert Millan +2009-05-13 Robert Millan - * util/i386/pc/grub-setup.c (setup): Restructure code flow to make + * util/i386/pc/VasEBoot-setup.c (setup): Restructure code flow to make it easier to understand / work with. Improve warning messages for cases where there's no embedding area, or when it is too small (or core.img too large). @@ -38808,25 +38808,25 @@ 2009-05-13 Pavel Roskin * loader/i386/pc/multiboot2.c: Add necessary includes for - grub_multiboot2_real_boot(). + VasEBoot_multiboot2_real_boot(). - * fs/iso9660.c (grub_iso9660_iterate_dir): The file mode in the + * fs/iso9660.c (VasEBoot_iso9660_iterate_dir): The file mode in the PX record is always little-endian. We only need the lower 2 bytes of the mode. * fs/cpio.c: Use the same name "struct head" for tar and cpio to facilitate code reuse. - (grub_cpio_mount): Use "struct head", not a char buffer. This + (VasEBoot_cpio_mount): Use "struct head", not a char buffer. This fixes a warning reported by gcc 4.4. - * kernel/disk.c (grub_disk_read): Use void pointer for the + * kernel/disk.c (VasEBoot_disk_read): Use void pointer for the buffer. - (grub_disk_write): Use const void pointer for the buffer. + (VasEBoot_disk_write): Use const void pointer for the buffer. Adjust all callers. Remove unnecessary casts. -2009-05-10 Robert Millan +2009-05-10 Robert Millan - * util/i386/pc/grub-install.in: Update copyright year. + * util/i386/pc/VasEBoot-install.in: Update copyright year. 2009-05-09 Vladimir Serbinenko @@ -38837,60 +38837,60 @@ (gptsync_mod_SOURCES): new variable (gptsync_mod_CFLAGS): likewise (gptsync_mod_LDFLAGS): likewise - * include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_NTFS): + * include/VasEBoot/pc_partition.h (VasEBoot_PC_PARTITION_TYPE_NTFS): new definition - (GRUB_PC_PARTITION_TYPE_HFS): likewise - * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/gptsync.c + (VasEBoot_PC_PARTITION_TYPE_HFS): likewise + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): add commands/gptsync.c * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise 2009-05-09 Vladimir Serbinenko - Fixed grub-emu + Fixed VasEBoot-emu - * kern/dl.c (grub_dl_ref): omit when compiling grub-emu - (grub_dl_ref): likewise + * kern/dl.c (VasEBoot_dl_ref): omit when compiling VasEBoot-emu + (VasEBoot_dl_ref): likewise -2009-05-08 Robert Millan +2009-05-08 Robert Millan - * util/i386/pc/grub-setup.c (setup): Factorize find_usable_region(), + * util/i386/pc/VasEBoot-setup.c (setup): Factorize find_usable_region(), split in two functions (one for msdos and one for gpt). 2009-05-08 Pavel Roskin - * disk/raid.c (grub_raid_block_xor): Make buf2 constant, it's + * disk/raid.c (VasEBoot_raid_block_xor): Make buf2 constant, it's not modified. - * disk/raid6_recover.c (grub_raid6_recover): Fix warnings about + * disk/raid6_recover.c (VasEBoot_raid6_recover): Fix warnings about uninitialized err[0] and err[1]. Rename them to bad1 and bad2. Initialize them with -1. Add sanity check for bad1. Eliminate nerr variable. 2009-05-08 David S. Miller - * util/sparc64/ieee1275/grub-ofpathname.c (main): Set progname. + * util/sparc64/ieee1275/VasEBoot-ofpathname.c (main): Set progname. -2009-05-06 Robert Millan +2009-05-06 Robert Millan - * util/i386/pc/grub-setup.c (setup): Fix check for embed region + * util/i386/pc/VasEBoot-setup.c (setup): Fix check for embed region existence. 2009-05-05 Felix Zielcke - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `kern/rescue_reader.c', `kern/rescue_parser.c' and `normal/autofs.c'. 2009-05-05 David S. Miller - * util/sparc64/ieee1275/grub-install.in: Fix sed arg quoting. + * util/sparc64/ieee1275/VasEBoot-install.in: Fix sed arg quoting. 2009-05-05 Pavel Roskin - * include/grub/dl.h [GRUB_UTIL]: Provide inline implementations - of grub_dl_ref() and grub_dl_unref(). + * include/VasEBoot/dl.h [VasEBoot_UTIL]: Provide inline implementations + of VasEBoot_dl_ref() and VasEBoot_dl_unref(). * commands/parttool.c: Remove preprocessor conditionals around - grub_dl_ref() and grub_dl_unref(). + VasEBoot_dl_ref() and VasEBoot_dl_unref(). * fs/affs.c: Likewise. * fs/afs.c: Likewise. * fs/cpio.c: Likewise. @@ -38907,7 +38907,7 @@ * fs/udf.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. - * include/grub/dl.h: Likewise. + * include/VasEBoot/dl.h: Likewise. * loader/xnu.c: Likewise. 2009-05-04 Pavel Roskin @@ -38924,28 +38924,28 @@ 2009-05-04 David S. Miller - * kern/ieee1275/openfw.c (grub_children_iterate): Fix string - pointer args to grub_ieee1275_get_property(). + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Fix string + pointer args to VasEBoot_ieee1275_get_property(). * conf/sparc64-ieee1275.rmk: Fix build due to missing '\'. - * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Bypass cdrom + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Bypass cdrom devices, and do not traverse down under controller nodes. * disk/ieee1275/ofdisk.c (compute_dev_path): New. - (grub_ofdisk_open): Use it to un-escape "," characters. + (VasEBoot_ofdisk_open): Use it to un-escape "," characters. * kern/disk.c (find_part_sep): New. - (grub_disk_open): Use it to find the first non-escaped ',' + (VasEBoot_disk_open): Use it to find the first non-escaped ',' character in the disk name. * util/ieee1275/devicemap.c (escape_of_path): New. - (grub_util_emit_devicemap_entry): Use it. - * util/sparc64/ieee1275/grub-install.in: Update script to + (VasEBoot_util_emit_devicemap_entry): Use it. + * util/sparc64/ieee1275/VasEBoot-install.in: Update script to strip partition specifiers properly by not triggering on '\' escaped ',' characters. -2009-05-04 Robert Millan +2009-05-04 Robert Millan - * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set + * include/VasEBoot/i386/linux.h (VasEBoot_LINUX_VID_MODE_VESA_START): Set to 0x300. * loader/i386/linux.c (vga_modes, linux_vesafb_res): Add a few resolutions. @@ -38970,14 +38970,14 @@ * efiemu/runtime/efiemu.c: Likewise. * efiemu/main.c: Likewise. * efiemu/mm.c: Likewise. - * include/grub/elf.h: Likewise. - * include/grub/xnu.h: Likewise. - * include/grub/usbdesc.h: Likewise. - * include/grub/usb.h: Likewise. - * include/grub/script_sh.h: Likewise. - * include/grub/lib/LzmaEnc.h: Likewise. - * include/grub/efiemu/efiemu.h: Likewise. - * include/grub/command.h: Likewise. + * include/VasEBoot/elf.h: Likewise. + * include/VasEBoot/xnu.h: Likewise. + * include/VasEBoot/usbdesc.h: Likewise. + * include/VasEBoot/usb.h: Likewise. + * include/VasEBoot/script_sh.h: Likewise. + * include/VasEBoot/lib/LzmaEnc.h: Likewise. + * include/VasEBoot/efiemu/efiemu.h: Likewise. + * include/VasEBoot/command.h: Likewise. * normal/menu.c: Likewise. * normal/main.c: Likewise. * normal/datetime.c: Likewise. @@ -39002,60 +39002,60 @@ * conf/i386-pc.rmk (libpkg_DATA): Rename to pkglib_DATA. -2009-05-04 Robert Millan +2009-05-04 Robert Millan - * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (grub_cmd_linux): Fix + * loader/i386/linux.c [VasEBoot_MACHINE_PCBIOS] (VasEBoot_cmd_linux): Fix build error. -2009-05-04 Robert Millan +2009-05-04 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): Make "vga=" compatibility + * loader/i386/linux.c (VasEBoot_cmd_linux): Make "vga=" compatibility parameter only available on BIOS. 2009-05-04 Vladimir Serbinenko Removed wrong semicolon in declaration - * grub/misc.h (grub_dprintf): remove semicolon + * VasEBoot/misc.h (VasEBoot_dprintf): remove semicolon -2009-05-04 Robert Millan +2009-05-04 Robert Millan - * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT): New macro. - (grub_linux_boot): Don't check for `linux_vesafb_modes' bounds (this - is done by grub_cmd_linux() now). - [! GRUB_ASSUME_LINUX_HAS_FB_SUPPORT]: If "vga=" parameter wasn't set, + * loader/i386/linux.c (VasEBoot_ASSUME_LINUX_HAS_FB_SUPPORT): New macro. + (VasEBoot_linux_boot): Don't check for `linux_vesafb_modes' bounds (this + is done by VasEBoot_cmd_linux() now). + [! VasEBoot_ASSUME_LINUX_HAS_FB_SUPPORT]: If "vga=" parameter wasn't set, restore video to text mode. - (grub_cmd_linux): Default `vid_mode' initialization to 0, which + (VasEBoot_cmd_linux): Default `vid_mode' initialization to 0, which indicates lack of "vga=" parameter. "vga=0" is mapped to - `GRUB_LINUX_VID_MODE_NORMAL'. + `VasEBoot_LINUX_VID_MODE_NORMAL'. 2009-05-04 Felix Zielcke - * conf/i386-efi.rmk (grub_emu_SOURCES): Remove `normal/execute.c', + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Remove `normal/execute.c', `normal/lexer.c', `kern/rescue.c', `normal/function.c', `normal/misc.c' and `normal/script.c'. Add `kern/rescue_reader.c', `kern/rescue_parser.c', `script/sh/main.c', `script/sh/execute.c', `script/sh/function.c', `script/sh/lexer.c', `script/sh/script.c' and - `grub_script.tab.c'. + `VasEBoot_script.tab.c'. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. * Makefile.in: Remove duplicated 2008 in Copyright line. -2009-05-04 Robert Millan +2009-05-04 Robert Millan - * util/misc.c (grub_util_warn): New function. Emits a warning + * util/misc.c (VasEBoot_util_warn): New function. Emits a warning unconditionally. - * include/grub/util/misc.h (grub_util_warn): New declaration. + * include/VasEBoot/util/misc.h (VasEBoot_util_warn): New declaration. - * util/i386/pc/grub-install.in: Understand --force and pass it down - to grub-setup. + * util/i386/pc/VasEBoot-install.in: Understand --force and pass it down + to VasEBoot-setup. - * util/i386/pc/grub-setup.c (main): Understand --force and pass it + * util/i386/pc/VasEBoot-setup.c (main): Understand --force and pass it down to setup(). (setup): Improve error messages and add warnings when requested to install in odd layouts. Refuse to install using blocklists unless @@ -39063,7 +39063,7 @@ 2009-05-04 martin f. krafft - * disk/raid.c (grub_raid_scan_device): Improve debug message. + * disk/raid.c (VasEBoot_raid_scan_device): Improve debug message. 2009-05-04 Vladimir Serbinenko @@ -39075,14 +39075,14 @@ HFS+ UUID - * fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field + * fs/hfsplus.c (VasEBoot_hfsplus_volheader): added num_serial field in the space previously used by unused3 - (grub_hfsplus_uuid): new function - (grub_hfsplus_fs): added uuid field + (VasEBoot_hfsplus_uuid): new function + (VasEBoot_hfsplus_fs): added uuid field 2009-05-03 Pavel Roskin - * disk/ata.c: Don't cast mod to void in GRUB_MOD_INIT to + * disk/ata.c: Don't cast mod to void in VasEBoot_MOD_INIT to suppress warnings. It's no longer needed. * disk/host.c: Likewise. * disk/ata_pthru.c: Likewise. @@ -39135,18 +39135,18 @@ 2009-05-03 David S. Miller - * normal/menu.c: Include grub/parser.h + * normal/menu.c: Include VasEBoot/parser.h 2009-05-03 Pavel Roskin - * mmap/efi/mmap.c (grub_mmap_malign_and_register): Return void*, + * mmap/efi/mmap.c (VasEBoot_mmap_malign_and_register): Return void*, not char*. - * mmap/i386/mmap.c (grub_mmap_malign_and_register): Likewise. + * mmap/i386/mmap.c (VasEBoot_mmap_malign_and_register): Likewise. Suggested by Javier Martín - * util/i386/pc/grub-mkrescue.in: Allow for the case when + * util/i386/pc/VasEBoot-mkrescue.in: Allow for the case when efiemu??.o doesn't exist. - * util/i386/pc/grub-install.in: Likewise. Use "cp -f" for + * util/i386/pc/VasEBoot-install.in: Likewise. Use "cp -f" for copying. 2009-05-03 Bean Vladimir Serbinenko @@ -39156,17 +39156,17 @@ * conf/i386-pc.rmk (bsd_mod_SOURCES): add loader/i386/bsd_helper.S and loader/i386/bsd_trampoline.S (bsd_mod_ASFLAGS): new variable - * include/grub/i386/bsd.h (FREEBSD_MODINFOMD_SMAP): new definition + * include/VasEBoot/i386/bsd.h (FREEBSD_MODINFOMD_SMAP): new definition (FREEBSD_MODTYPE_KERNEL64): likewise - (grub_bsd64_trampoline_start): likewise - (grub_bsd64_trampoline_end): likewise - (grub_bsd64_trampoline_selfjump): likewise - (grub_bsd64_trampoline_gdt): likewise - * include/grub/i386/loader.h (grub_unix_real_boot): moved from here ... - * include/grub/i386/bsd.h (grub_unix_real_boot): ... moved here - * kern/i386/loader.S (grub_unix_real_boot): moved from here ... - * loader/i386/bsd_helper.S (grub_unix_real_boot): moved here - * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type + (VasEBoot_bsd64_trampoline_start): likewise + (VasEBoot_bsd64_trampoline_end): likewise + (VasEBoot_bsd64_trampoline_selfjump): likewise + (VasEBoot_bsd64_trampoline_gdt): likewise + * include/VasEBoot/i386/loader.h (VasEBoot_unix_real_boot): moved from here ... + * include/VasEBoot/i386/bsd.h (VasEBoot_unix_real_boot): ... moved here + * kern/i386/loader.S (VasEBoot_unix_real_boot): moved from here ... + * loader/i386/bsd_helper.S (VasEBoot_unix_real_boot): moved here + * include/VasEBoot/gpt_partition.h (VasEBoot_gpt_partentry): Corrected the type of "attrib" member * loader/i386/bsd_pagetable.c: new file * loader/i386/bsd_trampoline.S: likewise @@ -39175,19 +39175,19 @@ (entry_hi): new variable (kern_end_mdofs): likewise (is_64bit): likewise - (grub_freebsd_add_meta): use ALIGN_VAR - (grub_e820_mmap): new declaration - (grub_freebsd_add_mmap): new function - (grub_freebsd_add_meta_module): support 64 bit kernels - (grub_freebsd_list_modules): use ALIGN_VAR + (VasEBoot_freebsd_add_meta): use ALIGN_VAR + (VasEBoot_e820_mmap): new declaration + (VasEBoot_freebsd_add_mmap): new function + (VasEBoot_freebsd_add_meta_module): support 64 bit kernels + (VasEBoot_freebsd_list_modules): use ALIGN_VAR (gdt_descriptor): new declaration - (grub_freebsd_boot): support 64 bit kernels - (grub_bsd_elf64_hook): new function - (grub_bsd_load_elf): support elf64 + (VasEBoot_freebsd_boot): support 64 bit kernels + (VasEBoot_bsd_elf64_hook): new function + (VasEBoot_bsd_load_elf): support elf64 2009-05-03 Bean - * script/sh/execute.c (grub_script_execute_cmdif): Reset grub_errno + * script/sh/execute.c (VasEBoot_script_execute_cmdif): Reset VasEBoot_errno after we get the result of if statement. 2009-05-03 Bean @@ -39217,16 +39217,16 @@ (xnu_mod_ASFLAGS): likewise * conf/i386-pc.rmk: likewise * conf/x86_64-efi.rmk: likewise - * include/grub/efi/efi.h (grub_efi_finish_boot_services): + * include/VasEBoot/efi/efi.h (VasEBoot_efi_finish_boot_services): new declaration - * include/grub/i386/macho.h: new file - * include/grub/i386/xnu.h: likewise - * include/grub/macho.h: likewise - * include/grub/machoload.h: likewise - * include/grub/x86_64/macho.h: likewise - * include/grub/x86_64/xnu.h: likewise - * include/grub/xnu.h: likewise - * kern/efi/efi.c (grub_efi_finish_boot_services): new function + * include/VasEBoot/i386/macho.h: new file + * include/VasEBoot/i386/xnu.h: likewise + * include/VasEBoot/macho.h: likewise + * include/VasEBoot/machoload.h: likewise + * include/VasEBoot/x86_64/macho.h: likewise + * include/VasEBoot/x86_64/xnu.h: likewise + * include/VasEBoot/xnu.h: likewise + * kern/efi/efi.c (VasEBoot_efi_finish_boot_services): new function * kern/efi/mm.c (MAX_HEAP_SIZE): increase * loader/i386/efi/xnu.c: new file * loader/i386/pc/xnu.c: likewise @@ -39235,10 +39235,10 @@ * loader/macho.c: likewise * loader/xnu.c: likewise * loader/xnu_resume.c: likewise - * util/grub-dumpdevtree: likewise - * include/grub/i386/pit.h: include grub/err.h - (grub_pit_wait): export - * util/grub.d/30_os-prober.in: support Darwin/Mac OS X + * util/VasEBoot-dumpdevtree: likewise + * include/VasEBoot/i386/pit.h: include VasEBoot/err.h + (VasEBoot_pit_wait): export + * util/VasEBoot.d/30_os-prober.in: support Darwin/Mac OS X 2009-05-02 Vladimir Serbinenko @@ -39246,19 +39246,19 @@ * conf/i386-pc.rmk: new modules efiemu, efiemu_acpi, efiemu_pnvram, _linux_efi, linux_efi. - new files in grub-emu + new files in VasEBoot-emu new targets efiemu32.o and efiemu64.o * loader/linux_normal_efiemu.c: likewise * loader/i386/efi/linux.c: added preliminary efiemu support - * util/i386/pc/grub-install.in: add efiemu??.o to the list of + * util/i386/pc/VasEBoot-install.in: add efiemu??.o to the list of files to copy - * include/grub/autoefi.h: new file - * include/grub/i386/efiemu.h: likewise - * include/grub/i386/pc/efiemu.h: likewise - * include/grub/efi/api.h: add LL suffix when necessary + * include/VasEBoot/autoefi.h: new file + * include/VasEBoot/i386/efiemu.h: likewise + * include/VasEBoot/i386/pc/efiemu.h: likewise + * include/VasEBoot/efi/api.h: add LL suffix when necessary new definitions relating to tables - * include/grub/efiemu/efiemu.h: new file - * include/grub/efiemu/runtime.h: likewise + * include/VasEBoot/efiemu/efiemu.h: new file + * include/VasEBoot/efiemu/runtime.h: likewise * efiemu/prepare.c: likewise * efiemu/loadcore_common.c: likewise * efiemu/loadcore64.c: likewise @@ -39288,7 +39288,7 @@ * commands/acpi.c: new file * commands/i386/pc/acpi.c: likewise * commands/efi/acpi.c: likewise - * include/grub/acpi.h: likewise + * include/VasEBoot/acpi.h: likewise * conf/i386-pc.rmk (pkglib_MODULES): added acpi.mod (acpi_mod_SOURCES): new variable (acpi_mod_CFLAGS): likewise @@ -39300,38 +39300,38 @@ Missing part from mmap patch - * mmap/efi/mmap.c (grub_machine_mmap_unregister): renamed to - (grub_mmap_unregister) - (grub_mmap_free_and_unregister): use grub_mmap_register + * mmap/efi/mmap.c (VasEBoot_machine_mmap_unregister): renamed to + (VasEBoot_mmap_unregister) + (VasEBoot_mmap_free_and_unregister): use VasEBoot_mmap_register 2009-05-02 Vladimir Serbinenko Mmap services - * loader/i386/efi/linux.c (grub_linux_boot): use grub_mmap_iterate + * loader/i386/efi/linux.c (VasEBoot_linux_boot): use VasEBoot_mmap_iterate * loader/i386/linux.c (find_mmap_size): likewise (allocate_pages): likewise - * loader/i386/multiboot.c (grub_get_multiboot_mmap_len): likewise - (grub_fill_multiboot_mmap): likewise - (grub_multiboot): use grub_mmap_get_lower and grub_mmap_get_upper - * loader/i386/pc/linux.c (grub_cmd_linux): use grub_mmap_get_lower - * include/grub/i386/bsd.h (OPENBSD_MMAP_AVAILABLE): new definition + * loader/i386/multiboot.c (VasEBoot_get_multiboot_mmap_len): likewise + (VasEBoot_fill_multiboot_mmap): likewise + (VasEBoot_multiboot): use VasEBoot_mmap_get_lower and VasEBoot_mmap_get_upper + * loader/i386/pc/linux.c (VasEBoot_cmd_linux): use VasEBoot_mmap_get_lower + * include/VasEBoot/i386/bsd.h (OPENBSD_MMAP_AVAILABLE): new definition (OPENBSD_MMAP_RESERVED): likewise - * include/grub/i386/pc/memory.h: include grub/memory.h - (grub_lower_mem): removed - (grub_upper_mem): likewise - (GRUB_MACHINE_MEMORY_ACPI): new definition - (GRUB_MACHINE_MEMORY_NVS): likewise - (GRUB_MACHINE_MEMORY_MAX_TYPE): likewise - (GRUB_MACHINE_MEMORY_HOLE): likewise - (grub_machine_mmap_register): likewise - (grub_machine_mmap_unregister): likewise - (grub_machine_get_upper): likewise - (grub_machine_get_lower): likewise - (grub_machine_get_post64): likewise - * include/grub/i386/efi/memory.h: new file - * include/grub/x86_64/efi/memory.h: likewise - * include/grub/efi/memory.h: likewise + * include/VasEBoot/i386/pc/memory.h: include VasEBoot/memory.h + (VasEBoot_lower_mem): removed + (VasEBoot_upper_mem): likewise + (VasEBoot_MACHINE_MEMORY_ACPI): new definition + (VasEBoot_MACHINE_MEMORY_NVS): likewise + (VasEBoot_MACHINE_MEMORY_MAX_TYPE): likewise + (VasEBoot_MACHINE_MEMORY_HOLE): likewise + (VasEBoot_machine_mmap_register): likewise + (VasEBoot_machine_mmap_unregister): likewise + (VasEBoot_machine_get_upper): likewise + (VasEBoot_machine_get_lower): likewise + (VasEBoot_machine_get_post64): likewise + * include/VasEBoot/i386/efi/memory.h: new file + * include/VasEBoot/x86_64/efi/memory.h: likewise + * include/VasEBoot/efi/memory.h: likewise * conf/i386-pc.rmk (pkglib_MODULES): added mmap.mod (mmap_mod_SOURCES): new variable (mmap_mod_LDFLAGS): likewise @@ -39340,28 +39340,28 @@ * conf/i386-ieee1275.rmk: likewise * conf/i386-efi.rmk: likewise * conf/x86_64-efi.rmk: likewise - * include/grub/types.h (UINT_TO_PTR): new macro + * include/VasEBoot/types.h (UINT_TO_PTR): new macro (PTR_TO_UINT32): likewise (PTR_TO_UINT64): likewise - * include/grub/memory.h: new file + * include/VasEBoot/memory.h: new file * mmap/i386/pc/mmap.c: likewise * mmap/i386/pc/mmap_helper.S: likewise * mmap/i386/uppermem.c: likewise * mmap/mmap.c: likewise * mmap/efi/mmap.c: likewise - * kern/i386/coreboot/init.c (grub_machine_init): don't use - grub_upper_mem - * kern/i386/pc/init.c (grub_lower_mem): removed variable - (grub_upper_mem): likewise - (grub_machine_init): don't use grub_upper_mem, - make grub_lower_mem local - * loader/i386/bsd.c (grub_openbsd_boot): use grub_mmap_get_lower, - grub_mmap_iterate and grub_mmap_get_upper - (grub_netbsd_boot): use grub_mmap_get_lower and grub_mmap_get_upper + * kern/i386/coreboot/init.c (VasEBoot_machine_init): don't use + VasEBoot_upper_mem + * kern/i386/pc/init.c (VasEBoot_lower_mem): removed variable + (VasEBoot_upper_mem): likewise + (VasEBoot_machine_init): don't use VasEBoot_upper_mem, + make VasEBoot_lower_mem local + * loader/i386/bsd.c (VasEBoot_openbsd_boot): use VasEBoot_mmap_get_lower, + VasEBoot_mmap_iterate and VasEBoot_mmap_get_upper + (VasEBoot_netbsd_boot): use VasEBoot_mmap_get_lower and VasEBoot_mmap_get_upper 2009-05-02 Bean - * conf/common.rmk (grub_script.tab.c): Change normal/parser.y to + * conf/common.rmk (VasEBoot_script.tab.c): Change normal/parser.y to script/sh/parser.y. (pkglib_MODULES): Add normal.mod and sh.mod. (normal_SOURCES): New variable. @@ -39376,7 +39376,7 @@ (kernel_img_SOURCES): Remove kern/rescue.c, and kern/reader.c, kern/rescue_reader.c and kern/rescue_parser.c. (kernel_img_HEADERS): Remove rescue.h, add reader.h. - (grub_emu_SOURCES): Change source files. + (VasEBoot_emu_SOURCES): Change source files. (pkglib_MODULES): Remove normal.mod. (normal_SOURCES): Removed. (normal_mod_CFLAGS): Likewise. @@ -39388,42 +39388,42 @@ * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. - * include/grub/command.h (grub_command_execute): New inline function. + * include/VasEBoot/command.h (VasEBoot_command_execute): New inline function. - * include/grub/menu.h (grub_menu_entry): Removed commands field. + * include/VasEBoot/menu.h (VasEBoot_menu_entry): Removed commands field. - * include/grub/normal.h: Remove . - (grub_fs_module_list): Moved to normal/autofs.c. - (grub_exit_env): Removed. - (grub_command_execute): Likewise. - (grub_normal_menu_addentry): Renamed to grub_menu_addentry, removed + * include/VasEBoot/normal.h: Remove . + (VasEBoot_fs_module_list): Moved to normal/autofs.c. + (VasEBoot_exit_env): Removed. + (VasEBoot_command_execute): Likewise. + (VasEBoot_normal_menu_addentry): Renamed to VasEBoot_menu_addentry, removed parameter script. (read_command_list): New function declaration. (read_fs_list): Likewise. - * include/parser.h: Include . - (grub_parser_split_cmdline): Change type of getline parameter. - (grub_parser): New structure. - (grub_parser_class): New variable. - (grub_parser_execute): New function declaration. - (grub_register_rescue_parser): Likewise. - (grub_parser_register): New inline function. - (grub_parser_unregister): Likewise. - (grub_parser_get_current): Likewise. - (grub_parser_set_current): Likewise. + * include/parser.h: Include . + (VasEBoot_parser_split_cmdline): Change type of getline parameter. + (VasEBoot_parser): New structure. + (VasEBoot_parser_class): New variable. + (VasEBoot_parser_execute): New function declaration. + (VasEBoot_register_rescue_parser): Likewise. + (VasEBoot_parser_register): New inline function. + (VasEBoot_parser_unregister): Likewise. + (VasEBoot_parser_get_current): Likewise. + (VasEBoot_parser_set_current): Likewise. - * include/grub/reader.h: New file. + * include/VasEBoot/reader.h: New file. * kern/reader.c: Likewise. * kern/rescue_parser.c: Likewise. * kern/rescue_reader.c: Likewise. * normal/autofs.c: Likewise. * normal/dyncmd.c: Likewise. - * include/grub/rescue.h: Removed. + * include/VasEBoot/rescue.h: Removed. * normal/command.h: Likewise. - * include/grub/script.h: Moved to ... - * include/grub/script_sh.h: ... Moved here. + * include/VasEBoot/script.h: Moved to ... + * include/VasEBoot/script_sh.h: ... Moved here. * normal/execute.c: Moved to ... * script/sh/execute.c: ... Moved here. * normal/function.c: Moved to ... @@ -39435,124 +39435,124 @@ * normal/script.c: Moved to ... * script/sh/script.c: ... Moved here. - * normal/main.c: Remove and , include - . - (grub_exit_env): Removed. + * normal/main.c: Remove and , include + . + (VasEBoot_exit_env): Removed. (fs_module_list): Moved to normal/autofs.c. - (grub_file_getline): Don't handle comment here. + (VasEBoot_file_getline): Don't handle comment here. (free_menu): Skip removed field entry->commands. - (grub_normal_menu_addentry): Removed as grub_menu_entry, removed + (VasEBoot_normal_menu_addentry): Removed as VasEBoot_menu_entry, removed script parameter. (read_config_file): Removed nested parameter, change getline function. - (grub_enter_normal_mode): Removed. - (grub_dyncmd_dispatcher): Moved to normal/dyncmd.c. + (VasEBoot_enter_normal_mode): Removed. + (VasEBoot_dyncmd_dispatcher): Moved to normal/dyncmd.c. (read_command_list): Likewise. (autoload_fs_module): Moved to normal/autofs.c. (read_fs_list): Likewise. (reader_nested): New variable. - (grub_normal_execute): Run parser.sh to switch to sh parser. - (grub_cmd_rescue): Removed. + (VasEBoot_normal_execute): Run parser.sh to switch to sh parser. + (VasEBoot_cmd_rescue): Removed. (cmd_normal): Removed. - (grub_cmd_normal): Unregister itself at the beginning. Don't register + (VasEBoot_cmd_normal): Unregister itself at the beginning. Don't register rescue command. - (grub_cmdline_run): New function. - (grub_normal_reader_init): Likewise. - (grub_normal_read_line): Likewise. - (grub_env_write_pager): Likewise. + (VasEBoot_cmdline_run): New function. + (VasEBoot_normal_reader_init): Likewise. + (VasEBoot_normal_read_line): Likewise. + (VasEBoot_env_write_pager): Likewise. (cmdline): New variable. - (grub_normal_reader): Likewise. - (GRUB_MOD_INIT): Register normal reader and set as current, register - pager hook, register normal command with grub_register_command_prio, + (VasEBoot_normal_reader): Likewise. + (VasEBoot_MOD_INIT): Register normal reader and set as current, register + pager hook, register normal command with VasEBoot_register_command_prio, so that it won't show up in command.lst. - (GRUB_MOD_FINI): Unregister normal reader, unhook pager, clear - grub_fs_autoload_hook. + (VasEBoot_MOD_FINI): Unregister normal reader, unhook pager, clear + VasEBoot_fs_autoload_hook. - * normal/menu.c: Remove , add . - (grub_menu_execute_entry): Replace grub_script_execute with - grub_parser_execute, change parameter to grub_command_execute. + * normal/menu.c: Remove , add . + (VasEBoot_menu_execute_entry): Replace VasEBoot_script_execute with + VasEBoot_parser_execute, change parameter to VasEBoot_command_execute. - * normal/menu_text.c: Remove . + * normal/menu_text.c: Remove . - * normal/menu_entry.c: Remove , add - and . + * normal/menu_entry.c: Remove , add + and . (run): Change editor_getline to use new parser interface. Change - parameter to grub_command_execute. + parameter to VasEBoot_command_execute. - * kern/main.c: Remove , include , - and . - (grub_load_normal_mode): Execute normal command. - (grub_main): Call grub_register_core_commands, - grub_register_rescue_parser and grub_register_rescue_reader, use - grub_reader_loop to enter input loop. + * kern/main.c: Remove , include , + and . + (VasEBoot_load_normal_mode): Execute normal command. + (VasEBoot_main): Call VasEBoot_register_core_commands, + VasEBoot_register_rescue_parser and VasEBoot_register_rescue_reader, use + VasEBoot_reader_loop to enter input loop. - * kern/parser.c (grub_parser_split_cmdline): Change type of + * kern/parser.c (VasEBoot_parser_split_cmdline): Change type of getline parameter. - (grub_parser_class): New variable. - (grub_parser_execute): New function. + (VasEBoot_parser_class): New variable. + (VasEBoot_parser_execute): New function. - * loader/i386/multiboot.c: Remove . + * loader/i386/multiboot.c: Remove . * loader/multiboot2.c: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. - * util/grub-emu.c (read_command_list): New dummy function. + * util/VasEBoot-emu.c (read_command_list): New dummy function. -2009-05-02 Robert Millan +2009-05-02 Robert Millan - * util/deviceiter.c (grub_util_iterate_devices): Increase max drive + * util/deviceiter.c (VasEBoot_util_iterate_devices): Increase max drive count to 16 for CCISS and IDA. -2009-05-02 Robert Millan +2009-05-02 Robert Millan - * normal/menu_text.c (grub_wait_after_message): Print a newline + * normal/menu_text.c (VasEBoot_wait_after_message): Print a newline after waiting for user input. - * loader/i386/linux.c: Include `'. - (grub_cmd_linux): Improve the error message about `ask' mode, by + * loader/i386/linux.c: Include `'. + (VasEBoot_cmd_linux): Improve the error message about `ask' mode, by waiting for user input so it's not missed (we can do this, since user requested interaction). 2009-05-02 Vladimir Serbinenko - Added missing lst to grub-mkrescue + Added missing lst to VasEBoot-mkrescue - * util/i386/pc/grub-mkrescue.in: added ${input_dir}/handler.lst + * util/i386/pc/VasEBoot-mkrescue.in: added ${input_dir}/handler.lst and ${input_dir}/parttool.lst 2009-04-30 David S. Miller * util/hostdisk.c (device_is_wholedisk): New function. - (grub_util_biosdisk_get_grub_dev): Shortcut when hdg.start is + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Shortcut when hdg.start is zero only if device_is_wholedisk() returns true. * util/hostdisk.c (convert_system_partition_to_system_disk): Handle virtual disk devices named /dev/vdiskX as found on sparc and powerpc. - * kern/sparc64/ieee1275/init.c (grub_machine_set_prefix): If + * kern/sparc64/ieee1275/init.c (VasEBoot_machine_set_prefix): If lettered partition specifier is found, convert to numbered. 2009-04-29 David S. Miller - * include/grub/powerpc/ieee1275/memory.h: Include ieee1275.h. - * include/grub/sparc64/ieee1275/memory.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/memory.h: Include ieee1275.h. + * include/VasEBoot/sparc64/ieee1275/memory.h: Likewise. * normal/command.c: Add missing newline at end of file. - * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf + * commands/lsmmap.c (VasEBoot_cmd_lsmmap): Add casts to avoid printf warnings. - * kern/ieee1275/openfw.c (grub_claimmap): Likewise. - * disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close, - grub_ofdisk_read): Likewise, and deal similarly with the fact that + * kern/ieee1275/openfw.c (VasEBoot_claimmap): Likewise. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open, VasEBoot_ofdisk_close, + VasEBoot_ofdisk_read): Likewise, and deal similarly with the fact that ihandles have a 32-bit type but need to be stored in a "void *". 2009-04-28 Pavel Roskin - * disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev, + * disk/fs_uuid.c (VasEBoot_fs_uuid_open): Use parent->data for dev, not disk. Adjust all dependencies. - (grub_fs_uuid_close): Use grub_device_close(), not - grub_disk_close(). + (VasEBoot_fs_uuid_close): Use VasEBoot_device_close(), not + VasEBoot_disk_close(). - * disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy + * disk/fs_uuid.c (VasEBoot_fs_uuid_open): Allocate memory to copy parent's partition, don't copy it by reference, as it gets freed on close. @@ -39560,28 +39560,28 @@ Preboot hooks support - * commands/boot.c (struct grub_preboot_t): new declaration + * commands/boot.c (struct VasEBoot_preboot_t): new declaration (preboots_head): new variable (preboots_tail): likewise - (grub_loader_register_preboot_hook): new function - (grub_loader_unregister_preboot_hook): likewise - (grub_loader_set): launch preboot hooks - * include/grub/loader.h (grub_loader_preboot_hook_prio_t): new type - (grub_loader_register_preboot_hook): new declaration - (grub_loader_unregister_preboot_hook): likewise + (VasEBoot_loader_register_preboot_hook): new function + (VasEBoot_loader_unregister_preboot_hook): likewise + (VasEBoot_loader_set): launch preboot hooks + * include/VasEBoot/loader.h (VasEBoot_loader_preboot_hook_prio_t): new type + (VasEBoot_loader_register_preboot_hook): new declaration + (VasEBoot_loader_unregister_preboot_hook): likewise 2009-04-27 Vladimir Serbinenko Warning fix - * disk/scsi.c (grub_scsi_open): added missing cast when - calling grub_dprintf + * disk/scsi.c (VasEBoot_scsi_open): added missing cast when + calling VasEBoot_dprintf 2009-04-26 Vladimir Serbinenko Bug and warning fixes - * include/grub/i386/pc/init.h (grub_stop_floppy): added missing + * include/VasEBoot/i386/pc/init.h (VasEBoot_stop_floppy): added missing declaration * commands/test.c (test_parse): fixed bug with file tests and corrected declaration of find_file @@ -39593,7 +39593,7 @@ 2009-04-26 David S. Miller - * util/grub-mkdevicemap.c (make_device_map): Add missing + * util/VasEBoot-mkdevicemap.c (make_device_map): Add missing NESTED_FUNC_ATTR to process_device(). 2009-04-25 Vladimir Serbinenko @@ -39612,35 +39612,35 @@ (CLEANFILES): add #{parttool} (PARTTOOLFILES): new variable * genparttoollist.sh: new file - * parttool/pcpart.c (grub_pcpart_boot): more feedback - (grub_pcpart_type): likewise + * parttool/pcpart.c (VasEBoot_pcpart_boot): more feedback + (VasEBoot_pcpart_type): likewise * commands/parttool.c (helpmsg): new variable - (grub_cmd_parttool): output help if not enough arguments are supplied + (VasEBoot_cmd_parttool): output help if not enough arguments are supplied autoload modules - (GRUB_MOD_INIT(parttool)): use helpmsg + (VasEBoot_MOD_INIT(parttool)): use helpmsg 2009-04-24 David S. Miller Avoiding opening same device multiple times in device iterator. - * kern/device.c: (grub_device_iterate): Define struct part_ent, + * kern/device.c: (VasEBoot_device_iterate): Define struct part_ent, and use it to build a list of partitions in iterate_disk() and iterate_partition(). - * disk/fs_uuid.c (grub_fs_uuid_close): Call grub_disk_close() + * disk/fs_uuid.c (VasEBoot_fs_uuid_close): Call VasEBoot_disk_close() on disk->data. - * disk/ieee1275/nand.c (grub_nand_iterate): Return - grub_devalias_iterate() result instead of unconditional 0. - * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Likewise. + * disk/ieee1275/nand.c (VasEBoot_nand_iterate): Return + VasEBoot_devalias_iterate() result instead of unconditional 0. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Likewise. Also, capture hook return value, either directly or via - grub_children_iterate(), and propagate to caller. - * include/grub/ieee1275/ieee1275.h (grub_devalias_iterate, - grub_children_iterate): Return value is now 'int' instead of - 'grub_err_t'. - * kern/ieee1275/openfw.c (grub_children_iterate): Fix to behave + VasEBoot_children_iterate(), and propagate to caller. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_devalias_iterate, + VasEBoot_children_iterate): Return value is now 'int' instead of + 'VasEBoot_err_t'. + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Fix to behave like a proper iterator, stopping when hooks return non-zero. - (grub_devalias_iterate): Likewise. + (VasEBoot_devalias_iterate): Likewise. 2009-04-23 David S. Miller @@ -39648,33 +39648,33 @@ 2009-04-22 David S. Miller - * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells + * kern/ieee1275/mmap.c (VasEBoot_machine_mmap_iterate): If size_cells is larger than address_cells, use that value for address_cells too. - * include/grub/ieee1275/ieee1275.h (IEEE1275_MAX_PROP_LEN, + * include/VasEBoot/ieee1275/ieee1275.h (IEEE1275_MAX_PROP_LEN, IEEE1275_MAX_PATH_LEN): Define. - * kern/ieee1275/openfw.c (grub_children_iterate): Dynamically + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Dynamically allocate 'childtype', 'childpath', 'childname', and 'fullname'. - (grub_devalias_iterate): Dynamically allocate 'aliasname' and + (VasEBoot_devalias_iterate): Dynamically allocate 'aliasname' and 'devtype'. Explicitly NULL terminate devalias expansion. * util/sparc64/ieee1275/misc.c: New file. - * util/sparc64/ieee1275/grub-setup.c: New file. - * util/sparc64/ieee1275/grub-ofpathname.c: New file. - * util/sparc64/ieee1275/grub-mkimage.c: New file. - * util/sparc64/ieee1275/grub-install.in: New file. + * util/sparc64/ieee1275/VasEBoot-setup.c: New file. + * util/sparc64/ieee1275/VasEBoot-ofpathname.c: New file. + * util/sparc64/ieee1275/VasEBoot-mkimage.c: New file. + * util/sparc64/ieee1275/VasEBoot-install.in: New file. * util/ieee1275/ofpath.c: New file. * util/ieee1275/devicemap.c: New file. * util/devicemap.c: New file. * util/deviceiter.c: New file. * kern/sparc64/ieee1275/init.c: New file. - * include/grub/util/ofpath.h: New file. - * include/grub/util/deviceiter.h: New file. - * util/grub-mkdevicemap.c: Include deviceiter.h. - Implement using grub_util_emit_devicemap_entry and - grub_util_iterate_devices. + * include/VasEBoot/util/ofpath.h: New file. + * include/VasEBoot/util/deviceiter.h: New file. + * util/VasEBoot-mkdevicemap.c: Include deviceiter.h. + Implement using VasEBoot_util_emit_devicemap_entry and + VasEBoot_util_iterate_devices. * conf/i386-corebook.rmk: Build util/deviceiter.c and - util/devicemap.c into grub-mkdevicemap + util/devicemap.c into VasEBoot-mkdevicemap * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-pc.rmk: Likewise. @@ -39687,7 +39687,7 @@ Correct GPT definition - * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type + * include/VasEBoot/gpt_partition.h (VasEBoot_gpt_partentry): Corrected the type of "attrib" member 2009-04-19 Felix Zielcke @@ -39696,49 +39696,49 @@ 2009-04-19 David S. Miller - * loader/sparc64/ieee1275/linux.c: Include grub/command.h - (grub_rescue_cmd_linux): Rename to... - (grub_cmd_linux): and fix prototype. - (grub_rescue_cmd_initrd): Rename to... - (grub_cmd_initrd): and fix prototype. + * loader/sparc64/ieee1275/linux.c: Include VasEBoot/command.h + (VasEBoot_rescue_cmd_linux): Rename to... + (VasEBoot_cmd_linux): and fix prototype. + (VasEBoot_rescue_cmd_initrd): Rename to... + (VasEBoot_cmd_initrd): and fix prototype. (cmd_linux, cmd_initrd): New. - (GRUB_MOD_INIT(linux)): Use grub_register_command(). - (GRUB_MOD_FINI(linux): Use grub_unregister_command(). + (VasEBoot_MOD_INIT(linux)): Use VasEBoot_register_command(). + (VasEBoot_MOD_FINI(linux): Use VasEBoot_unregister_command(). 2009-04-17 Pavel Roskin - * bus/usb/ohci.c (grub_ohci_transaction): Fix incorrect printf + * bus/usb/ohci.c (VasEBoot_ohci_transaction): Fix incorrect printf format. - (grub_ohci_transfer): Likewise. + (VasEBoot_ohci_transfer): Likewise. - * bus/usb/usbtrans.c (grub_usb_control_msg): Warning fix. + * bus/usb/usbtrans.c (VasEBoot_usb_control_msg): Warning fix. - * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Fix + * loader/multiboot_loader.c (VasEBoot_cmd_multiboot_loader): Fix return without a value. Fix inconsistent indentation. - * fs/i386/pc/pxe.c (grub_pxefs_dir): Fix function prototype to - match struct grub_fs. + * fs/i386/pc/pxe.c (VasEBoot_pxefs_dir): Fix function prototype to + match struct VasEBoot_fs. - * disk/ata.c (grub_ata_pciinit): Use NESTED_FUNC_ATTR. - * bus/usb/ohci.c (grub_ohci_pci_iter): Likewise. - * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. - * commands/lspci.c (grub_lspci_iter): Likewise. + * disk/ata.c (VasEBoot_ata_pciinit): Use NESTED_FUNC_ATTR. + * bus/usb/ohci.c (VasEBoot_ohci_pci_iter): Likewise. + * bus/usb/uhci.c (VasEBoot_uhci_pci_iter): Likewise. + * commands/lspci.c (VasEBoot_lspci_iter): Likewise. 2009-04-16 Bean - * commands/efi/loadbios.c (grub_cmd_fakebios): Add missing return + * commands/efi/loadbios.c (VasEBoot_cmd_fakebios): Add missing return value. 2009-04-15 Pavel Roskin - * include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and - LONG_MAX to GRUB_LONG_MAX. Introduce GRUB_LONG_MIN. Update all + * include/VasEBoot/types.h: Rename ULONG_MAX to VasEBoot_ULONG_MAX and + LONG_MAX to VasEBoot_LONG_MAX. Introduce VasEBoot_LONG_MIN. Update all users of ULONG_MAX, LONG_MAX and LONG_MIN to use the new definitions. 2009-04-15 Felix Zielcke - * disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages, + * disk/lvm.c (VasEBoot_lvm_scan_device): Add `LVM' to the error messages, that no multiple data or metadata areas are supported and `Unknown metadata header'. @@ -39748,43 +39748,43 @@ * kern/loader.c: moved to ... * commands/boot.c: ... moved here - * commands/minicmd.c (grub_mini_cmd_boot): moved to ... - * commands/boot.c (grub_cmd_boot): moved here. All users updated - * include/grub/kernel.h (grub_machine_fini): export - * include/grub/loader.h (grub_loader_is_loaded): update declaration - (grub_loader_set): likewise - (grub_loader_unset): likewise - (grub_loader_boot): likewise + * commands/minicmd.c (VasEBoot_mini_cmd_boot): moved to ... + * commands/boot.c (VasEBoot_cmd_boot): moved here. All users updated + * include/VasEBoot/kernel.h (VasEBoot_machine_fini): export + * include/VasEBoot/loader.h (VasEBoot_loader_is_loaded): update declaration + (VasEBoot_loader_set): likewise + (VasEBoot_loader_unset): likewise + (VasEBoot_loader_boot): likewise * conf/common.rmk: new module boot.mod (pkglib_MODULES): add boot.mod * conf/i386-coreboot.rmk (kernel_elf_SOURCES): remove kern/loader.c - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise * conf/i386-efi.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise * conf/i386-pc.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise * conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise * conf/x86_64-efi.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (VasEBoot_emu_SOURCES): likewise 2009-04-15 Vladimir Serbinenko - use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes + use VasEBoot_lltoa instead of VasEBoot_itoa and VasEBoot_ltoa for all purposes - * kern/misc.c (grub_itoa): Removed function - (grub_ltoa): likewise - (grub_vsprintf): use grub_lltoa + * kern/misc.c (VasEBoot_itoa): Removed function + (VasEBoot_ltoa): likewise + (VasEBoot_vsprintf): use VasEBoot_lltoa 2009-04-15 Vladimir Serbinenko - Restore grub-emu + Restore VasEBoot-emu - * conf/i386-pc.rmk (grub_emu_SOURCES): add normal/handler.c + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): add normal/handler.c * conf/i386-coreboot.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise @@ -39811,24 +39811,24 @@ * genmk.rb: Add rules to generate handler.lst. - * include/grub/normal.h (grub_file_getline): New function definition. + * include/VasEBoot/normal.h (VasEBoot_file_getline): New function definition. (read_handler_list): Likewise. (free_handler_list): Likewise. - * include/grub/term.h (grub_term_register_input): Add name parameter + * include/VasEBoot/term.h (VasEBoot_term_register_input): Add name parameter for auto generation of handler.lst. - (grub_term_register_output): Likewise. + (VasEBoot_term_register_output): Likewise. * normal/handler.c: New file. - * normal/main.c (get_line): Renamed to grub_file_getline. - (read_config_file): Use the newly renamed grub_file_getline. + * normal/main.c (get_line): Renamed to VasEBoot_file_getline. + (read_config_file): Use the newly renamed VasEBoot_file_getline. (read_command_list): Likewise. (read_fs_list): Likewise. - (grub_normal_execute): Call read_handler_list to parse handler.lst. - (GRUB_MOD_FINI): Call free_handler_list to free handler list. + (VasEBoot_normal_execute): Call read_handler_list to parse handler.lst. + (VasEBoot_MOD_FINI): Call free_handler_list to free handler list. - * term/efi/console.c (grub_console_init): Add name parameter for auto + * term/efi/console.c (VasEBoot_console_init): Add name parameter for auto generation of handler.lst. * term/gfxterm.c: Likewise. * term/i386/pc/at_keyboard.c: Likewise. @@ -39842,7 +39842,7 @@ 2009-04-14 Bean - * util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol + * util/VasEBoot-pe2elf.c (write_symbol_table): Terminate short name symbol properly with null character. 2009-04-14 Felix Zielcke @@ -39862,7 +39862,7 @@ * conf/x86_64-efi.mk: Likewise. * INSTALL: Remove the sentence that Ruby and autoconf are only required if you - develop on GRUB. + develop on VasEBoot. 2009-04-14 John Stanley David S. Miller @@ -39880,66 +39880,66 @@ 2009-04-13 Pavel Roskin - * conf/common.rmk (grub_fstest_SOURCES): Add normal/datetime.c. + * conf/common.rmk (VasEBoot_fstest_SOURCES): Add normal/datetime.c. Reported by John Stanley 2009-04-13 Robert Millan - * util/grub.d/10_freebsd.in: Detect Debian GNU/kFreeBSD and use + * util/VasEBoot.d/10_freebsd.in: Detect Debian GNU/kFreeBSD and use that name for menuentries when appropriate. 2009-04-13 Felix Zielcke - * util/grub.d/10_freebsd.in: Add a missing `fi'. + * util/VasEBoot.d/10_freebsd.in: Add a missing `fi'. 2009-04-13 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): Don't pass `vga=ask' parameter + * loader/i386/linux.c (VasEBoot_cmd_linux): Don't pass `vga=ask' parameter to Linux, simply abort telling the user it's no longer supported. 2009-04-13 Felix Zielcke - * util/grub.d/10_freebsd.in: Don't exit if /boot/devices.hints + * util/VasEBoot.d/10_freebsd.in: Don't exit if /boot/devices.hints doesn't exist. Check also for /boot/kernel/kernel.gz. Print `freebsd_loadenv' only when devices.hints exist. 2009-04-13 Pavel Roskin - * term/usb_keyboard.c (grub_usb_keyboard_getkey): Warning fixes. + * term/usb_keyboard.c (VasEBoot_usb_keyboard_getkey): Warning fixes. 2009-04-13 Felix Zielcke - * util/i386/pc/grub-install.in (install_drive): Remove the BSD + * util/i386/pc/VasEBoot-install.in (install_drive): Remove the BSD partition number. - (grub_drive): Likewise. + (VasEBoot_drive): Likewise. 2009-04-13 David S. Miller * kern/sparc64/ieee1275/ieee1275.c: New file. - * include/grub/sparc64/ieee1275/ieee1275.h (IEEE1275_MAP_WRITE, + * include/VasEBoot/sparc64/ieee1275/ieee1275.h (IEEE1275_MAP_WRITE, IEEE1275_MAP_READ, IEEE1275_MAP_EXEC, IEEE1275_MAP_LOCKED, IEEE1275_MAP_CACHED, IEEE1275_MAP_SE, IEEE1275_MAP_GLOBAL, IEEE1275_MAP_IE, IEEE1275_MAP_DEFAULT): Define. - (grub_ieee1275_map_physical, grub_ieee1275_claim_vaddr, - grub_ieee1275_alloc_physmem): Declare new exported functions. + (VasEBoot_ieee1275_map_physical, VasEBoot_ieee1275_claim_vaddr, + VasEBoot_ieee1275_alloc_physmem): Declare new exported functions. - * include/grub/sparc64/ieee1275/loader.h: New file. - * include/grub/sparc64/ieee1275/memory.h: Likewise. - * include/grub/sparc64/kernel.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/loader.h: New file. + * include/VasEBoot/sparc64/ieee1275/memory.h: Likewise. + * include/VasEBoot/sparc64/kernel.h: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. - * conf/common.rmk (grub_probe_SOURCES): Add Sun partition module. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_probe_SOURCES): Add Sun partition module. + (VasEBoot_fstest_SOURCES): Likewise. * util/hostdisk.c (make_device_name): Do not make any assumptions about the length of drive names. - * kern/dl.c (grub_dl_load_file): Close file immediately when + * kern/dl.c (VasEBoot_dl_load_file): Close file immediately when we are done using it. 2009-04-12 David S. Miller - * kern/misc.c (grub_ltoa): Fix cast when handling negative + * kern/misc.c (VasEBoot_ltoa): Fix cast when handling negative values. Noticed by Pavel Roskin. * configure.ac: Check for __bswapsi2 and__bswapdi2 using @@ -39954,17 +39954,17 @@ (OFDISK_HASH_SZ): Define. (ofdisk_hash): New hash table. (ofdisk_hash_fn, ofdisk_hash_find, ofdisk_hash_add): New functions. - (grub_ofdisk_open): Use ofdisk_hash_ent address as disk->id + (VasEBoot_ofdisk_open): Use ofdisk_hash_ent address as disk->id instead of device phandle which is not unique. * kern/sparc64/ieee1275/init.c: Delete, replace with... * kern/sparc64/ieee1275/crt0.S: assembler implementation. - * include/grub/sparc64/ieee1275/kernel.h: Declare grub_prefix[]. - (GRUB_MOD_ALIGN, GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE, - GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE, - GRUB_KERNEL_MACHINE_COMPRESSED_SIZE, GRUB_KERNEL_MACHINE_PREFIX, - GRUB_KERNEL_MACHINE_DATA_END): Define. - (grub_kernel_image_size, grub_total_module_size): Declare. + * include/VasEBoot/sparc64/ieee1275/kernel.h: Declare VasEBoot_prefix[]. + (VasEBoot_MOD_ALIGN, VasEBoot_MOD_GAP, VasEBoot_KERNEL_MACHINE_TOTAL_MODULE_SIZE, + VasEBoot_KERNEL_MACHINE_KERNEL_IMAGE_SIZE, + VasEBoot_KERNEL_MACHINE_COMPRESSED_SIZE, VasEBoot_KERNEL_MACHINE_PREFIX, + VasEBoot_KERNEL_MACHINE_DATA_END): Define. + (VasEBoot_kernel_image_size, VasEBoot_total_module_size): Declare. 2009-04-12 Pavel Roskin @@ -39975,41 +39975,41 @@ 2009-04-11 Felix Zielcke * util/hostdisk.c [__FreeBSD_kernel__]: Include sys/disk.h. - (grub_util_biosdisk_open) [__FreeBSD_kernel__]: Add support for + (VasEBoot_util_biosdisk_open) [__FreeBSD_kernel__]: Add support for GNU/kFreeBSD. Check if a device is a character device. Use DIOCGMEDIASIZE to get the size. (convert_system_partition_to_system_disk) [__FreeBSD_kernel__]: Add support for GNU/kFreeBSD. - (grub_util_biosdisk_get_grub_dev) [__FreeBSD_kernel__]: Check if OS_DEV + (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__FreeBSD_kernel__]: Check if OS_DEV is a character device instead of a block device. Add support for FreeBSD device names. * util/getroot.c (find_root_device) [__FreeBSD_kernel__]: Check if ENT is a character device instead of a block device. - * util/grub-probe.c (probe) [__FreeBSD_kernel__]: Check if DEVICE_NAME + * util/VasEBoot-probe.c (probe) [__FreeBSD_kernel__]: Check if DEVICE_NAME is a character device instead of a block device. 2009-04-11 Andrey Shuvikov * util/hostdisk.c [__FreeBSD__]: Include sys/disk.h. - (grub_util_biosdisk_open) [__FreeBSD__]: Add support for + (VasEBoot_util_biosdisk_open) [__FreeBSD__]: Add support for FreeBSD. Check if a device is a character device. Use DIOCGMEDIASIZE to get the size. (convert_system_partition_to_system_disk) [__FreeBSD__]: Add support for FreeBSD. - (grub_util_biosdisk_get_grub_dev) [__FreeBSD__]: Check if OS_DEV + (VasEBoot_util_biosdisk_get_VasEBoot_dev) [__FreeBSD__]: Check if OS_DEV is a character device instead of a block device. Add support for FreeBSD device names. * util/getroot.c (find_root_device) [__FreeBSD__]: Check if ENT is a character device instead of a block device. - (grub_util_check_char_device): New function. + (VasEBoot_util_check_char_device): New function. - * util/grub-probe.c (probe) [__FreeBSD__]: Check if DEVICE_NAME is + * util/VasEBoot-probe.c (probe) [__FreeBSD__]: Check if DEVICE_NAME is a character device instead of a block device. - * include/grub/util/getroot.h (grub_util_check_char_device): New + * include/VasEBoot/util/getroot.h (VasEBoot_util_check_char_device): New prototype. 2009-04-11 David S. Miller @@ -40017,66 +40017,66 @@ * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link with static libgcc. * configure.ac: Check for __bswapsi2 and __bswapdi2 presence. - * include/grub/sparc64/libgcc.h (__bswapsi2): Export libgcc + * include/VasEBoot/sparc64/libgcc.h (__bswapsi2): Export libgcc function, if present. (__bswapdi2): Likewise. - * include/grub/sparc64/ieee1275/boot.h: New file. + * include/VasEBoot/sparc64/ieee1275/boot.h: New file. * boot/sparc64/ieee1275/boot.S: Likewise. * boot/sparc64/ieee1275/diskboot.S: Likewise. - * kern/misc.c (grub_ltoa): New function. - (grub_vsprintf): Use it to format 'long' integers. + * kern/misc.c (VasEBoot_ltoa): New function. + (VasEBoot_vsprintf): Use it to format 'long' integers. 2009-04-10 David S. Miller - * disk/ieee1275/nand.c (grub_nand_open): All ieee1275 call arg - slots are of type grub_ieee1275_cell_t. - (grub_nand_read): Likewise. + * disk/ieee1275/nand.c (VasEBoot_nand_open): All ieee1275 call arg + slots are of type VasEBoot_ieee1275_cell_t. + (VasEBoot_nand_read): Likewise. * kern/ieee1275/ieee1275.c (IEEE1275_PHANDLE_INVALID, - IEEE1275_IHANDLE_INVALID): Use grub_ieee1275_cell_t since these + IEEE1275_IHANDLE_INVALID): Use VasEBoot_ieee1275_cell_t since these macros are used to compare values in arg/ret block of the call. - (grub_ieee1275_finddevice, grub_ieee1275_get_property, - grub_ieee1275_next_property, grub_ieee1275_get_property_length, - grub_ieee1275_instance_to_package, grub_ieee1275_package_to_path, - grub_ieee1275_instance_to_path, grub_ieee1275_write, - grub_ieee1275_read, grub_ieee1275_seek, grub_ieee1275_peer, - grub_ieee1275_child, grub_ieee1275_parent, grub_ieee1275_open, - grub_ieee1275_close, grub_ieee1275_set_property, - grub_ieee1275_set_color): All ieee1275 call arg slots are of type - grub_ieee1275_cell_t. - * kern/ieee1275/openfw.c (grub_map): Likewise. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_ihandle_t, - grub_ieee1275_phandle_t): Define as grub_unit32_t type. + (VasEBoot_ieee1275_finddevice, VasEBoot_ieee1275_get_property, + VasEBoot_ieee1275_next_property, VasEBoot_ieee1275_get_property_length, + VasEBoot_ieee1275_instance_to_package, VasEBoot_ieee1275_package_to_path, + VasEBoot_ieee1275_instance_to_path, VasEBoot_ieee1275_write, + VasEBoot_ieee1275_read, VasEBoot_ieee1275_seek, VasEBoot_ieee1275_peer, + VasEBoot_ieee1275_child, VasEBoot_ieee1275_parent, VasEBoot_ieee1275_open, + VasEBoot_ieee1275_close, VasEBoot_ieee1275_set_property, + VasEBoot_ieee1275_set_color): All ieee1275 call arg slots are of type + VasEBoot_ieee1275_cell_t. + * kern/ieee1275/openfw.c (VasEBoot_map): Likewise. + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_ihandle_t, + VasEBoot_ieee1275_phandle_t): Define as VasEBoot_unit32_t type. - * kern/ieee1275/init.c (grub_machine_init): Make 'actual' grub_ssize_t. - * kern/ieee1275/openfw.c (grub_children_iterate): Likewise. - (grub_devalias_iterate): Likewise. + * kern/ieee1275/init.c (VasEBoot_machine_init): Make 'actual' VasEBoot_ssize_t. + * kern/ieee1275/openfw.c (VasEBoot_children_iterate): Likewise. + (VasEBoot_devalias_iterate): Likewise. 2009-04-10 Vladimir Serbinenko UFS improvements * fs/ufs.c (INODE_NBLOCKS): new definition - (struct grub_ufs_dirent): added fields for non-BSD dirents - (grub_ufs_get_file_block): fixed double indirect handling - (grub_ufs_lookup_symlink): use more robust way to determine whether + (struct VasEBoot_ufs_dirent): added fields for non-BSD dirents + (VasEBoot_ufs_get_file_block): fixed double indirect handling + (VasEBoot_ufs_lookup_symlink): use more robust way to determine whether symlink is inline - (grub_ufs_find_file): support for non-BSD dirents - (grub_ufs_dir): support for non-BSD dirents + (VasEBoot_ufs_find_file): support for non-BSD dirents + (VasEBoot_ufs_dir): support for non-BSD dirents 2009-04-10 Bean - * include/grub/efi/api.h (grub_efi_configuration_table): Add packed + * include/VasEBoot/efi/api.h (VasEBoot_efi_configuration_table): Add packed attribute, otherwise the size would be wrong for i386 platform. - * include/grub/pci.h (grub_pci_read_word): New inline function. - (grub_pci_read_byte): Likewise. - (grub_pci_write): Likewise. - (grub_pci_write_word): Likewise. - (grub_pci_write_byte): Likewise. + * include/VasEBoot/pci.h (VasEBoot_pci_read_word): New inline function. + (VasEBoot_pci_read_byte): Likewise. + (VasEBoot_pci_write): Likewise. + (VasEBoot_pci_write_word): Likewise. + (VasEBoot_pci_write_byte): Likewise. - * include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. + * include/VasEBoot/pci.h (VasEBoot_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. * loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module. (find_framebuf): Scan pci to locate the frame buffer address. @@ -40087,9 +40087,9 @@ * commands/memrw.c: Likewise. - * util/grub-dumpbios.in: Likewise. + * util/VasEBoot-dumpbios.in: Likewise. - * conf/common.rmk (grub-dumpbios): New utility. + * conf/common.rmk (VasEBoot-dumpbios): New utility. (pkglib_MODULES): New module memrw.mod. (memrw_mod_SOURCE): New macro. (memrw_mod_CFLAGS): Likewise. @@ -40115,29 +40115,29 @@ 2009-04-08 Felix Zielcke - * disk/lvm.c (grub_lvm_scan_device): Add a missing NULL check. + * disk/lvm.c (VasEBoot_lvm_scan_device): Add a missing NULL check. 2009-04-07 David S. Miller - * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add + * kern/sparc64/dl.c (VasEBoot_arch_dl_relocate_symbols): Add support for R_SPARC_OLO10 relocations. Fix compile warning for R_SPARC_WDISP30 case. - * kern/sparc64/cache.S: Fix grub_arch_sync_caches implementation. + * kern/sparc64/cache.S: Fix VasEBoot_arch_sync_caches implementation. 2009-04-06 Pavel Roskin - * include/grub/misc.h (ARRAY_SIZE): New macro. - * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): + * include/VasEBoot/misc.h (ARRAY_SIZE): New macro. + * include/VasEBoot/i386/linux.h (VasEBoot_LINUX_VID_MODE_VESA_START): New macro. * loader/i386/linux.c (allocate_pages): Use free_pages(). - (grub_linux_unload): Don't use free_pages(). - (grub_linux_boot): Prevent accessing linux_vesafb_modes with a + (VasEBoot_linux_unload): Don't use free_pages(). + (VasEBoot_linux_boot): Prevent accessing linux_vesafb_modes with a wrong index. Treat all other modes as text modes. - (grub_cmd_linux): Initialize vid_mode unconditionally to - GRUB_LINUX_VID_MODE_NORMAL. Recognize and support "vga=ask". + (VasEBoot_cmd_linux): Initialize vid_mode unconditionally to + VasEBoot_LINUX_VID_MODE_NORMAL. Recognize and support "vga=ask". * commands/help.c (print_command_help): Use cmd->prio, not - cmd->flags to check for GRUB_PRIO_LIST_FLAG_ACTIVE. + cmd->flags to check for VasEBoot_PRIO_LIST_FLAG_ACTIVE. 2009-04-06 Vladimir Serbinenko @@ -40152,7 +40152,7 @@ (pcpart_mod_SOURCES): likewise (pcpart_mod_CFLAGS): likewise (pcpart_mod_LDFLAGS): likewise - * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): added commands/parttool.c and parttool/pcpart.c * conf/i386-efi.rmk: likewise * conf/i386-ieee1275.rmk: likewise @@ -40165,49 +40165,49 @@ Support for mtime and further expandability of dir command - * include/grub/lib/datetime.h: moved to ... - * include/grub/datetime.h: ... moved here and added - declaration of grub_unixtime2datetime. All users updated - * include/grub/fs.h: new syntax for dir and mtime functions in - struct grub_fs - * include/grub/fshelp.h: new declarations of GRUB_FSHELP_TYPE_MASK - and GRUB_FSHELP_FLAGS_MASK - * commands/ls.c (grub_ls_list_files): Write mtime in long format - * fs/ext2.c (grub_ext2_dir): use new dir syntax and supply mtime - (grub_ext2_mtime): new function - * fs/hfsplus.c (grub_hfsplus_dir): use new dir syntax and supply mtime - (grub_hfsplus_mtime): new function - * fs/ufs.c (GRUB_UFS_ATTR_TYPE): new definition - (GRUB_UFS_ATTR_FILE): likewise - (GRUB_UFS_ATTR_LNK): likewise - (struct grub_ufs_sblock): new fields mtime - (grub_ufs_read_inode): new parameter to read inode to a separate buffer + * include/VasEBoot/lib/datetime.h: moved to ... + * include/VasEBoot/datetime.h: ... moved here and added + declaration of VasEBoot_unixtime2datetime. All users updated + * include/VasEBoot/fs.h: new syntax for dir and mtime functions in + struct VasEBoot_fs + * include/VasEBoot/fshelp.h: new declarations of VasEBoot_FSHELP_TYPE_MASK + and VasEBoot_FSHELP_FLAGS_MASK + * commands/ls.c (VasEBoot_ls_list_files): Write mtime in long format + * fs/ext2.c (VasEBoot_ext2_dir): use new dir syntax and supply mtime + (VasEBoot_ext2_mtime): new function + * fs/hfsplus.c (VasEBoot_hfsplus_dir): use new dir syntax and supply mtime + (VasEBoot_hfsplus_mtime): new function + * fs/ufs.c (VasEBoot_UFS_ATTR_TYPE): new definition + (VasEBoot_UFS_ATTR_FILE): likewise + (VasEBoot_UFS_ATTR_LNK): likewise + (struct VasEBoot_ufs_sblock): new fields mtime + (VasEBoot_ufs_read_inode): new parameter to read inode to a separate buffer all users updated - (grub_ufs_dir): mtime support - (grub_ufs_mtime): new function - * fs/affs.c (grub_affs_dir): use new dir syntax - * fs/afs.c (grub_afs_dir): likewise - * fs/cpio.c (grub_cpio_dir): likewise - * fs/fat.c (grub_fat_find_dir): likewise - * fs/hfs.c (grub_hfs_dir): likewise - * fs/iso9660.c (grub_iso9660_dir): likewise - * fs/jfs.c (grub_jfs_dir): likewise - * fs/minix.c (grub_minix_dir): likewise - * fs/ntfs.c (grub_ntfs_dir): likewise - * fs/reiserfs.c (grub_reiserfs_dir): likewise - * fs/sfs.c (grub_sfs_dir): likewise - * fs/xfs.c (grub_xfs_dir): likewise - * util/hostfs.c (grub_hostfs_dir): likewise + (VasEBoot_ufs_dir): mtime support + (VasEBoot_ufs_mtime): new function + * fs/affs.c (VasEBoot_affs_dir): use new dir syntax + * fs/afs.c (VasEBoot_afs_dir): likewise + * fs/cpio.c (VasEBoot_cpio_dir): likewise + * fs/fat.c (VasEBoot_fat_find_dir): likewise + * fs/hfs.c (VasEBoot_hfs_dir): likewise + * fs/iso9660.c (VasEBoot_iso9660_dir): likewise + * fs/jfs.c (VasEBoot_jfs_dir): likewise + * fs/minix.c (VasEBoot_minix_dir): likewise + * fs/ntfs.c (VasEBoot_ntfs_dir): likewise + * fs/reiserfs.c (VasEBoot_reiserfs_dir): likewise + * fs/sfs.c (VasEBoot_sfs_dir): likewise + * fs/xfs.c (VasEBoot_xfs_dir): likewise + * util/hostfs.c (VasEBoot_hostfs_dir): likewise * lib/datetime.c: moved to ... * normal/datetime.c: ... moved here - (grub_unixtime2datetime): new function - * kern/rescue.c (grub_rescue_print_files): use new dir syntax + (VasEBoot_unixtime2datetime): new function + * kern/rescue.c (VasEBoot_rescue_print_files): use new dir syntax * normal/completion.c (iterate_dir): use new dir syntax - * normal/misc.c (grub_normal_print_device_info): tell the + * normal/misc.c (VasEBoot_normal_print_device_info): tell the last modification time of a volume - * kern/fs.c (grub_fs_probe): updated dummy function to use new syntax + * kern/fs.c (VasEBoot_fs_probe): updated dummy function to use new syntax * conf/common.rmk: added lib/datetime.c to ls.mod - * conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): add normal/datetime.c (normal_mod_SOURCES): likewise (datetime_mod_SOURCES): Removed lib/datetime.c * conf/i386-efi.rmk: likewise @@ -40221,10 +40221,10 @@ Trim trailing spaces in FAT label and support mtools-like labels - * fs/fat.c (grub_fat_iterate_dir): New function based - on grub_fat_find_dir - (grub_fat_find_dir): use grub_fat_iterate_dir - (grub_fat_label): likewise + * fs/fat.c (VasEBoot_fat_iterate_dir): New function based + on VasEBoot_fat_find_dir + (VasEBoot_fat_find_dir): use VasEBoot_fat_iterate_dir + (VasEBoot_fat_label): likewise 2009-04-04 Vladimir Serbinenko @@ -40234,18 +40234,18 @@ 2009-04-04 Bean - * include/grub/util/misc.h: Add dummy function fsync for mingw. + * include/VasEBoot/util/misc.h: Add dummy function fsync for mingw. * util/misc.c: Likewise. 2009-04-04 Yoshinori K. Okuji - * loader/i386/efi/linux.c (fake_bios_data): Use grub_dprintf - instead of grub_printf. + * loader/i386/efi/linux.c (fake_bios_data): Use VasEBoot_dprintf + instead of VasEBoot_printf. 2009-04-03 Robert Millan - * loader/i386/linux.c (grub_linux_setup_video): Fill + * loader/i386/linux.c (VasEBoot_linux_setup_video): Fill `params->{red,green,blue,reserved}_{mask_size,field_pos}' with values from `mode info' structure instead of hardcoded values. @@ -40260,48 +40260,48 @@ 2009-04-01 Manoel Abranches * aclocal.m4: Move --build-id=none from MODULE_LDFLAGS to - TARGET_LDFLAGS. This corrects a problem with grub-mkelfimage. + TARGET_LDFLAGS. This corrects a problem with VasEBoot-mkelfimage. 2009-04-01 David S. Miller * normal/sparc64/setjmp.S: Fix setjmp implementation. - * include/grub/sparc64/setjmp.h (grub_jmp_buf): Update. - (grub_setjmp): Mark with 'returns_twice' attribute. - * include/grub/i386/setjmp.h (grub_setjmp): Likewise - * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise. - * include/grub/x86_64/setjmp.h (grub_setjmp): Likewise. + * include/VasEBoot/sparc64/setjmp.h (VasEBoot_jmp_buf): Update. + (VasEBoot_setjmp): Mark with 'returns_twice' attribute. + * include/VasEBoot/i386/setjmp.h (VasEBoot_setjmp): Likewise + * include/VasEBoot/powerpc/setjmp.h (VasEBoot_setjmp): Likewise. + * include/VasEBoot/x86_64/setjmp.h (VasEBoot_setjmp): Likewise. 2009-04-01 Robert Millan Reapply fix from 2008-07-28 which was accidentally reverted; also perform the same fix to a similar check in same function. - * disk/raid.c (grub_raid_scan_device): Do not abort when two disks + * disk/raid.c (VasEBoot_raid_scan_device): Do not abort when two disks with the same number are found, just use issue a warning with - grub_dprintf(), as this error has been reported to be non-fatal. + VasEBoot_dprintf(), as this error has been reported to be non-fatal. 2009-03-31 Pavel Roskin - * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Provide safe default + * aclocal.m4 (VasEBoot_I386_CHECK_REGPARM_BUG): Provide safe default for cross-compilation. 2009-03-30 Robert Millan Fix i386-ieee1275 build. - * include/grub/i386/ieee1275/loader.h (grub_multiboot2_real_boot): + * include/VasEBoot/i386/ieee1275/loader.h (VasEBoot_multiboot2_real_boot): Remove declaration. 2009-03-30 Pavel Roskin - * fs/hfs.c (grub_hfs_strncasecmp): Integrate into ... - (grub_hfs_cmp_catkeys): ... this. Don't assume strings to be + * fs/hfs.c (VasEBoot_hfs_strncasecmp): Integrate into ... + (VasEBoot_hfs_cmp_catkeys): ... this. Don't assume strings to be zero-terminated, rely only on the strlen value. Fix comparison of strings differing in length. 2009-03-30 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): Check for zImage before + * loader/i386/linux.c (VasEBoot_cmd_linux): Check for zImage before checking for abi version. Improve error messages on BIOS to notify user about `linux16' command. @@ -40309,19 +40309,19 @@ Leak fixes - * kern/disk.c (grub_disk_cache_store): Invalidate previous cache + * kern/disk.c (VasEBoot_disk_cache_store): Invalidate previous cache in case of collision - * disk/scsi.c (grub_scsi_open): free scsi in case of error + * disk/scsi.c (VasEBoot_scsi_open): free scsi in case of error 2009-03-29 Robert Millan - * loader/i386/linux.c (grub_cmd_linux): Parse "vga=" parameter and + * loader/i386/linux.c (VasEBoot_cmd_linux): Parse "vga=" parameter and set `vid_mode' accordingly. - (grub_linux_boot): Process `vid_mode' and set video mode. + (VasEBoot_linux_boot): Process `vid_mode' and set video mode. 2009-03-29 Robert Millan - * util/grub.d/10_linux.in (linux_entry): New function. + * util/VasEBoot.d/10_linux.in (linux_entry): New function. Factorize generation of Linux boot entries. 2009-03-29 Yoshinori K. Okuji @@ -40329,7 +40329,7 @@ Make the format of Environment Block plain text. The boot loader part is not tested well yet. - * util/grub-editenv.c (DEFAULT_ENVBLK_SIZE): New macro. + * util/VasEBoot-editenv.c (DEFAULT_ENVBLK_SIZE): New macro. (buffer): Removed. (envblk): Likewise. (usage): Remove "info" and "clear". Add "unset". Update the @@ -40351,38 +40351,38 @@ (envblk): Likewise. (open_envblk_file): New function. (read_envblk_file): Complete rewrite. - (grub_cmd_load_env): Likewise. - (grub_cmd_list_env): Likewise. + (VasEBoot_cmd_load_env): Likewise. + (VasEBoot_cmd_list_env): Likewise. (struct blocklist): New struct. (free_blocklists): New function. (check_blocklists): Likewise. (write_blocklists): Likewise. - (grub_cmd_save_env): Complete rewrite. + (VasEBoot_cmd_save_env): Complete rewrite. - * include/grub/lib/envblk.h (GRUB_ENVBLK_SIGNATURE): Replaced with + * include/VasEBoot/lib/envblk.h (VasEBoot_ENVBLK_SIGNATURE): Replaced with a plain text signature. - (GRUB_ENVBLK_MAXLEN): Removed. - (struct grub_envblk): Complete rewrite. - (grub_envblk_find): Removed. - (grub_envblk_insert): Likewise. - (grub_envblk_open): New prototype. - (grub_envblk_set): Likewise. - (grub_envblk_delete): Put const to VALUE. - (grub_envblk_iterate): Put const to NAME and VALUE. - (grub_envblk_close): New prototype. - (grub_envblk_buffer): New inline function. - (grub_envblk_size): Likewise. + (VasEBoot_ENVBLK_MAXLEN): Removed. + (struct VasEBoot_envblk): Complete rewrite. + (VasEBoot_envblk_find): Removed. + (VasEBoot_envblk_insert): Likewise. + (VasEBoot_envblk_open): New prototype. + (VasEBoot_envblk_set): Likewise. + (VasEBoot_envblk_delete): Put const to VALUE. + (VasEBoot_envblk_iterate): Put const to NAME and VALUE. + (VasEBoot_envblk_close): New prototype. + (VasEBoot_envblk_buffer): New inline function. + (VasEBoot_envblk_size): Likewise. - * lib/envblk.c: Include grub/mm.h. - (grub_env_find): Removed. - (grub_envblk_open): New function. - (grub_envblk_close): Likewise. + * lib/envblk.c: Include VasEBoot/mm.h. + (VasEBoot_env_find): Removed. + (VasEBoot_envblk_open): New function. + (VasEBoot_envblk_close): Likewise. (escaped_value_len): Likewise. (find_next_line): Likewise. - (grub_envblk_insert): Removed. - (grub_envblk_set): New function. - (grub_envblk_delete): Complete rewrite. - (grub_envblk_iterate): Likewise. + (VasEBoot_envblk_insert): Removed. + (VasEBoot_envblk_set): New function. + (VasEBoot_envblk_delete): Complete rewrite. + (VasEBoot_envblk_iterate): Likewise. 2009-03-28 Robert Millan @@ -40391,16 +40391,16 @@ variables. Use 16-bit loader. (linux_mod_SOURCES, linux_mod_CFLAGS, linux_mod_LDFLAGS): Use 32-bit loader. - * kern/i386/loader.S (grub_linux_boot): Rename to ... - (grub_linux16_boot): ... this. Update all users. - * loader/i386/linux.c (grub_linux32_boot): Rename to ... - (grub_linux_boot): ... this. Update all users. + * kern/i386/loader.S (VasEBoot_linux_boot): Rename to ... + (VasEBoot_linux16_boot): ... this. Update all users. + * loader/i386/linux.c (VasEBoot_linux32_boot): Rename to ... + (VasEBoot_linux_boot): ... this. Update all users. - * loader/i386/pc/linux.c (GRUB_MOD_INIT(linux)): Rename to ... - (GRUB_MOD_INIT(linux16)): ... this. Rename `linux' and `initrd' + * loader/i386/pc/linux.c (VasEBoot_MOD_INIT(linux)): Rename to ... + (VasEBoot_MOD_INIT(linux16)): ... this. Rename `linux' and `initrd' commands to `linux16' and `initrd16'. - (GRUB_MOD_FINI(linux)): Rename to ... - (GRUB_MOD_FINI(linux16)): ... this. + (VasEBoot_MOD_FINI(linux)): Rename to ... + (VasEBoot_MOD_FINI(linux16)): ... this. 2009-03-24 Pavel Roskin @@ -40418,35 +40418,35 @@ * kern/i386/loader.S: Move multiboot helpers from here... * loader/i386/multiboot_helper.S: ...moved here - * include/grub/i386/loader.h: Move declarations of multiboot + * include/VasEBoot/i386/loader.h: Move declarations of multiboot helpers from here... - * include/grub/i386/multiboot.h: ...moved here - * loader/i386/multiboot.c: Added include of grub/cpu/multiboot.h + * include/VasEBoot/i386/multiboot.h: ...moved here + * loader/i386/multiboot.c: Added include of VasEBoot/cpu/multiboot.h 2009-03-22 Yoshinori K. Okuji - * kern/env.c (grub_env_context_open): Added an argument to specify + * kern/env.c (VasEBoot_env_context_open): Added an argument to specify whether a new context inherits exported variables from current one. This is useful when making a sandbox to interpret a config file. All callers updated. - * include/grub/env.h (grub_env_context_open): Updated the prototype. + * include/VasEBoot/env.h (VasEBoot_env_context_open): Updated the prototype. 2009-03-22 Yoshinori K. Okuji - * kern/env.c (grub_env_context_close): Fix memory leaks. + * kern/env.c (VasEBoot_env_context_close): Fix memory leaks. 2009-03-22 Yoshinori K. Okuji - * normal/main.c (grub_normal_execute): Added an argument + * normal/main.c (VasEBoot_normal_execute): Added an argument BATCH to specify if an interactive interface should be provided after reading a config file. All callers updated. (read_command_list): Prevent being executed twice. (read_fs_list): Likewise. - * include/grub/normal.h (grub_normal_execute): Updated the + * include/VasEBoot/normal.h (VasEBoot_normal_execute): Updated the prototype. 2009-03-22 Pavel Roskin @@ -40459,25 +40459,25 @@ * kern/i386/coreboot/startup.S: Likewise. * kern/x86_64/efi/startup.S: Likewise. - * aclocal.m4 (grub_CHECK_START_SYMBOL): Remove. - * configure.ac: Don't call grub_CHECK_START_SYMBOL. + * aclocal.m4 (VasEBoot_CHECK_START_SYMBOL): Remove. + * configure.ac: Don't call VasEBoot_CHECK_START_SYMBOL. * kern/i386/pc/startup.S: Use _start instead of START_SYMBOL. 2009-03-21 Vladimir Serbinenko Bugfixes in multiboot for bugs uncovered by solaris kernel. - * loader/i386/multiboot_elfxx.c (grub_multiboot_load_elf): Corrected + * loader/i386/multiboot_elfxx.c (VasEBoot_multiboot_load_elf): Corrected limit detection. Use vaddr of correct segment for entry_point. 2009-03-21 Bean - * commands/blocklist.c: Add include file , remove - and . - (grub_cmd_blocklist): Use the new command interface. - (GRUB_MOD_INIT): Likewise. - (GRUB_MOD_FINI): Likewise. + * commands/blocklist.c: Add include file , remove + and . + (VasEBoot_cmd_blocklist): Use the new command interface. + (VasEBoot_MOD_INIT): Likewise. + (VasEBoot_MOD_FINI): Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. * commands/cmp.c: Likewise. @@ -40525,21 +40525,21 @@ * term/i386/pc/serial.c: Likewise. * term/terminfo.c: Likewise. - * term/i386/pc/vesafb.c: Removed . + * term/i386/pc/vesafb.c: Removed . * term/i386/pc/vga.c: Likewise. * video/readers/jpeg.c: Likewise. * video/readers/png.c: Likewise. * video/readers/tga.c: Likewise. - * util/grub-fstest (cmd_loopback): Removed. + * util/VasEBoot-fstest (cmd_loopback): Removed. (cmd_blocklist): Likewise. (cmd_ls): Likewise. - (grub_register_command): Likewise. - (grub_unregister_command): Likewise. - (execute_command): Use grub_command_find to locate command and execute + (VasEBoot_register_command): Likewise. + (VasEBoot_unregister_command): Likewise. + (execute_command): Use VasEBoot_command_find to locate command and execute it. - * include/grub/efi/chainloader.h: Removed. + * include/VasEBoot/efi/chainloader.h: Removed. * loader/efi/chainloader_normal.c: Likewise. * loader/i386/bsd_normal.c: Likewise. * loader/i386/pc/chainloader_normal.c: Likewise. @@ -40548,10 +40548,10 @@ * loader/multiboot_loader_normal.c: Likewise. * loader/powerpc/ieee1275/linux_normal.c: Likewise. - * gencmdlist.sh: Scan new registration command grub_register_extcmd - and grub_register_command_p1. + * gencmdlist.sh: Scan new registration command VasEBoot_register_extcmd + and VasEBoot_register_command_p1. - * conf/common.rmk (grub_fstest_SOURCES): Add kern/list.c, + * conf/common.rmk (VasEBoot_fstest_SOURCES): Add kern/list.c, kern/command.c, lib/arg.c and commands/extcmd.c. (pkglib_MODULES): Remove boot.mod, and minicmd.mod and extcmd.mod. (minicmd_mod_SOURCES): New variable. @@ -40567,7 +40567,7 @@ * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/command.c and kern/corecmd.c. (kernel_img_HEADERS): Add command.h. - (grub_emu_SOURCES): Remove commands/boot.c and normal/arg.c, add + (VasEBoot_emu_SOURCES): Remove commands/boot.c and normal/arg.c, add commands/minicmd.c, kern/command.c, kern/corecmd.c, commands/extcmd.c and lib/arg.c. (pkglib_MODULES): Change _linux.mod, _chain.mod, _bsd.mod and @@ -40580,50 +40580,50 @@ * conf/powerpc-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. - * include/grub/arg.h: Move from here ... - * include/grub/lib/arg.h: ... to here. + * include/VasEBoot/arg.h: Move from here ... + * include/VasEBoot/lib/arg.h: ... to here. * normal/arg.c: Move from here ... * lib/arg.c: ... to here. * commands/extcmd.c: New file. * commands/minicmd.c: Likewise. - * include/grub/command.h: Likewise. - * include/grub/extcmd.h: Likewise. + * include/VasEBoot/command.h: Likewise. + * include/VasEBoot/extcmd.h: Likewise. * kern/command.c: Likewise. * kern/corecmd.c: Likewise. - * kern/list.c (grub_list_iterate): Return int instead of void. - (grub_list_insert): New function. - (grub_prio_list_insert): Likewise. + * kern/list.c (VasEBoot_list_iterate): Return int instead of void. + (VasEBoot_list_insert): New function. + (VasEBoot_prio_list_insert): Likewise. - * kern/rescue.c (grub_rescue_command): Removed. - (grub_rescue_command_list): Likewise. - (grub_rescue_register_command): Likewise. - (grub_rescue_unregister_command): Likewise. - (grub_rescue_cmd_boot): Move to minicmd.c - (grub_rescue_cmd_help): Likewise. - (grub_rescue_cmd_info): Likewise. - (grub_rescue_cmd_boot): Likewise. - (grub_rescue_cmd_testload): Likewise. - (grub_rescue_cmd_dump): Likewise. - (grub_rescue_cmd_rmmod): Likewise. - (grub_rescue_cmd_lsmod): Likewise. - (grub_rescue_cmd_exit): Likewise. - (grub_rescue_print_devices): Moved to corecmd.c. - (grub_rescue_print_files): Likewise. - (grub_rescue_cmd_ls): Likewise. - (grub_rescue_cmd_insmod): Likewise. - (grub_rescue_cmd_set): Likewise. - (grub_rescue_cmd_unset): Likewise. - (attempt_normal_mode): Use grub_command_find to get normal module. - (grub_enter_rescue_mode): Use grub_register_core_commands to register - commands, remove grub_rescue_register_command calls. + * kern/rescue.c (VasEBoot_rescue_command): Removed. + (VasEBoot_rescue_command_list): Likewise. + (VasEBoot_rescue_register_command): Likewise. + (VasEBoot_rescue_unregister_command): Likewise. + (VasEBoot_rescue_cmd_boot): Move to minicmd.c + (VasEBoot_rescue_cmd_help): Likewise. + (VasEBoot_rescue_cmd_info): Likewise. + (VasEBoot_rescue_cmd_boot): Likewise. + (VasEBoot_rescue_cmd_testload): Likewise. + (VasEBoot_rescue_cmd_dump): Likewise. + (VasEBoot_rescue_cmd_rmmod): Likewise. + (VasEBoot_rescue_cmd_lsmod): Likewise. + (VasEBoot_rescue_cmd_exit): Likewise. + (VasEBoot_rescue_print_devices): Moved to corecmd.c. + (VasEBoot_rescue_print_files): Likewise. + (VasEBoot_rescue_cmd_ls): Likewise. + (VasEBoot_rescue_cmd_insmod): Likewise. + (VasEBoot_rescue_cmd_set): Likewise. + (VasEBoot_rescue_cmd_unset): Likewise. + (attempt_normal_mode): Use VasEBoot_command_find to get normal module. + (VasEBoot_enter_rescue_mode): Use VasEBoot_register_core_commands to register + commands, remove VasEBoot_rescue_register_command calls. - * normal/command.c (grub_register_command): Removed. - (grub_unregister_command): Likewise. - (grub_command_find): Likewise. - (grub_iterate_commands): Likewise. + * normal/command.c (VasEBoot_register_command): Removed. + (VasEBoot_unregister_command): Likewise. + (VasEBoot_command_find): Likewise. + (VasEBoot_iterate_commands): Likewise. (rescue_command): Likewise. (export_command): Moved to corecmd.c. (set_command): Removed. @@ -40631,95 +40631,95 @@ (insmod_command): Likewise. (rmmod_command): Likewise. (lsmod_command): Likewise. - (grub_command_init): Likewise. + (VasEBoot_command_init): Likewise. * normal/completion.c (iterate_command): Use cmd->prio to check for active command. - (complete_arguments): Use grub_extcmd_t structure to find options. - (grub_normal_do_completion): Change function grub_iterate_commands to - grub_command_iterate. + (complete_arguments): Use VasEBoot_extcmd_t structure to find options. + (VasEBoot_normal_do_completion): Change function VasEBoot_iterate_commands to + VasEBoot_command_iterate. - * normal/execute.c (grub_script_execute_cmd): No need to parse + * normal/execute.c (VasEBoot_script_execute_cmd): No need to parse argument here. - * normal/main.c (grub_dyncmd_dispatcher): New function. + * normal/main.c (VasEBoot_dyncmd_dispatcher): New function. (read_command_list): Register unload commands as dyncmd. - (grub_cmd_normal): Use new command interface, register rescue, + (VasEBoot_cmd_normal): Use new command interface, register rescue, unregister normal at entry, register normal, unregister rescue at exit. - * include/grub/list.h (grub_list_test_t): New type. - (grub_list_iterate): Return int instead of void. - (grub_list_insert): New function. - (GRUB_AS_NAMED_LIST_P): New macro. - (GRUB_AS_PRIO_LIST): Likewise. - (GRUB_AS_PRIO_LIST_P): Likewise. - (GRUB_PRIO_LIST_PRIO_MASK): New constant. - (GRUB_PRIO_LIST_FLAG_ACTIVE): Likewise. - (grub_prio_list): New structure. - (grub_prio_list_insert): New function. - (grub_prio_list_remove): New inline function. + * include/VasEBoot/list.h (VasEBoot_list_test_t): New type. + (VasEBoot_list_iterate): Return int instead of void. + (VasEBoot_list_insert): New function. + (VasEBoot_AS_NAMED_LIST_P): New macro. + (VasEBoot_AS_PRIO_LIST): Likewise. + (VasEBoot_AS_PRIO_LIST_P): Likewise. + (VasEBoot_PRIO_LIST_PRIO_MASK): New constant. + (VasEBoot_PRIO_LIST_FLAG_ACTIVE): Likewise. + (VasEBoot_prio_list): New structure. + (VasEBoot_prio_list_insert): New function. + (VasEBoot_prio_list_remove): New inline function. - * include/grub/normal.h: Remove , add . - (GRUB_COMMAND_FLAG_CMDLINE): Moved to command.h. - (GRUB_COMMAND_FLAG_MENU): Likewise. - (GRUB_COMMAND_FLAG_BOTH): Likewise. - (GRUB_COMMAND_FLAG_TITLE): Likewise. - (GRUB_COMMAND_FLAG_NO_ECHO): Likewise. - (GRUB_COMMAND_FLAG_NO_ARG_PARSE): Removed. - (GRUB_COMMAND_FLAG_NOT_LOADED): Likewise. - (grub_command): Likewise. - (grub_register_command): Likewise. - (grub_command_find): Likewise. - (grub_iterate_commands): Likewise. - (grub_command_init): Likewise. - (grub_arg_parse): Likewise. - (grub_arg_show_help): Likewise. + * include/VasEBoot/normal.h: Remove , add . + (VasEBoot_COMMAND_FLAG_CMDLINE): Moved to command.h. + (VasEBoot_COMMAND_FLAG_MENU): Likewise. + (VasEBoot_COMMAND_FLAG_BOTH): Likewise. + (VasEBoot_COMMAND_FLAG_TITLE): Likewise. + (VasEBoot_COMMAND_FLAG_NO_ECHO): Likewise. + (VasEBoot_COMMAND_FLAG_NO_ARG_PARSE): Removed. + (VasEBoot_COMMAND_FLAG_NOT_LOADED): Likewise. + (VasEBoot_command): Likewise. + (VasEBoot_register_command): Likewise. + (VasEBoot_command_find): Likewise. + (VasEBoot_iterate_commands): Likewise. + (VasEBoot_command_init): Likewise. + (VasEBoot_arg_parse): Likewise. + (VasEBoot_arg_show_help): Likewise. - * include/grub/rescue.h (grub_rescue_register_command): Removed. - (grub_rescue_unregister_command): Likewise. + * include/VasEBoot/rescue.h (VasEBoot_rescue_register_command): Removed. + (VasEBoot_rescue_unregister_command): Likewise. - * include/grub/i386/bsd.h: Remove grub_rescue_cmd_freebsd, - grub_rescue_cmd_openbsd, grub_rescue_cmd_netbsd, - grub_rescue_cmd_freebsd_loadenv and grub_rescue_cmd_freebsd_module. + * include/VasEBoot/i386/bsd.h: Remove VasEBoot_rescue_cmd_freebsd, + VasEBoot_rescue_cmd_openbsd, VasEBoot_rescue_cmd_netbsd, + VasEBoot_rescue_cmd_freebsd_loadenv and VasEBoot_rescue_cmd_freebsd_module. - * include/grub/i386/efi/loader.h: Remove grub_rescue_cmd_linux and - grub_rescue_cmd_initrd. - * include/grub/i386/loader.h: Likewise. - * include/grub/x86_64/loader.h: Likewise. + * include/VasEBoot/i386/efi/loader.h: Remove VasEBoot_rescue_cmd_linux and + VasEBoot_rescue_cmd_initrd. + * include/VasEBoot/i386/loader.h: Likewise. + * include/VasEBoot/x86_64/loader.h: Likewise. - * include/grub/i386/pc/chainloader.h: Remove grub_chainloader_cmd. + * include/VasEBoot/i386/pc/chainloader.h: Remove VasEBoot_chainloader_cmd. 2009-03-21 Bean - * util/hostdisk.c (read_device_map): Use grub_util_get_disk_size + * util/hostdisk.c (read_device_map): Use VasEBoot_util_get_disk_size instead of stat in mingw environment. - * util/misc.c (grub_millisleep): Use Sleep in mingw environment. + * util/misc.c (VasEBoot_millisleep): Use Sleep in mingw environment. - * aclocal.m4 (grub_CHECK_LINK_DIR): New function. + * aclocal.m4 (VasEBoot_CHECK_LINK_DIR): New function. - * configure.ac: Use grub_CHECK_LINK_DIR to determine whether to use + * configure.ac: Use VasEBoot_CHECK_LINK_DIR to determine whether to use AC_CONFIG_LINKS. 2009-03-21 Bean - * fs/ext2.c (grub_ext2_mount): Change errno to GRUB_ERR_BAD_FS for + * fs/ext2.c (VasEBoot_ext2_mount): Change errno to VasEBoot_ERR_BAD_FS for out of range error. 2009-03-18 Michel Dänzer - * fs/ext2.c (grub_ext2_read_block): Take endianness into account when + * fs/ext2.c (VasEBoot_ext2_read_block): Take endianness into account when checking inode flags for EXT4_EXTENTS_FLAG. 2009-03-18 Robert Millan - * loader/i386/linux.c: Include `' and - `'.. - (grub_linux_setup_video): New function. Loosely based on the EFI one. - (grub_linux32_boot): Attempt to configure video settings with - grub_linux_setup_video(). - (grub_rescue_cmd_linux): Set noreturn=0 in grub_loader_set, in order - to avoid grub_console_fini() which would step out of graphical mode + * loader/i386/linux.c: Include `' and + `'.. + (VasEBoot_linux_setup_video): New function. Loosely based on the EFI one. + (VasEBoot_linux32_boot): Attempt to configure video settings with + VasEBoot_linux_setup_video(). + (VasEBoot_rescue_cmd_linux): Set noreturn=0 in VasEBoot_loader_set, in order + to avoid VasEBoot_console_fini() which would step out of graphical mode unconditionally. 2009-03-14 Robert Millan @@ -40729,24 +40729,24 @@ 2009-03-12 Vladimir Serbinenko - * term/gfxterm.c (GRUB_MOD_FINI(term_gfxterm)): Correct name of + * term/gfxterm.c (VasEBoot_MOD_FINI(term_gfxterm)): Correct name of background image command. 2009-03-12 Colin D Bennett * term/gfxterm.c (draw_cursor): Ensure character is redrawn. - (grub_gfxterm_putchar): Extract pairs of identical calls to + (VasEBoot_gfxterm_putchar): Extract pairs of identical calls to draw_cursor out of conditional blocks. 2009-03-11 Pavel Roskin - * fs/hfs.c (grub_hfs_strncasecmp): New function. - (grub_hfs_cmp_catkeys): Use HFS specific string comparison. + * fs/hfs.c (VasEBoot_hfs_strncasecmp): New function. + (VasEBoot_hfs_cmp_catkeys): Use HFS specific string comparison. 2009-03-11 Robert Millan * loader/i386/multiboot_elfxx.c - (CONCAT(grub_multiboot_load_elf, XX)): Do not reject ET_DYN files. + (CONCAT(VasEBoot_multiboot_load_elf, XX)): Do not reject ET_DYN files. 2009-03-11 Felix Zielcke @@ -40756,31 +40756,31 @@ 2009-03-11 Robert Millan * loader/i386/multiboot.c (code_size): New variable. - (grub_multiboot): Define offsets by adding to `code_size' rather - than subtracting from `grub_multiboot_payload_size'. Provide + (VasEBoot_multiboot): Define offsets by adding to `code_size' rather + than subtracting from `VasEBoot_multiboot_payload_size'. Provide 4-byte alignment to MBI and others by increasing `boot_loader_name_length' appropriately. * loader/i386/multiboot_elfxx.c - (CONCAT(grub_multiboot_load_elf, XX)): Initialize `code_size'. + (CONCAT(VasEBoot_multiboot_load_elf, XX)): Initialize `code_size'. 2009-03-09 Felix Zielcke - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove duplicated + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Remove duplicated `fs/ext2.c'. 2009-03-08 Robert Millan Make loader/i386/linux.c usable on i386-pc again. - * kern/i386/pc/init.c (grub_machine_init): Disable addition of low + * kern/i386/pc/init.c (VasEBoot_machine_init): Disable addition of low memory to heap. - * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (allocate_pages): Remove + * loader/i386/linux.c [VasEBoot_MACHINE_PCBIOS] (allocate_pages): Remove `#error' stanza. 2009-03-07 Bean - * loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd + * loader/i386/efi/linux.c (VasEBoot_rescue_cmd_initrd): Fix a bug in initrd allocation. 2009-03-06 Robert Millan @@ -40788,30 +40788,30 @@ Fix display issue on terminals with screen size other than 80x25 (e.g. gfxterm with resolution higher than 640x480). - * normal/main.c (grub_normal_init_page): Display title text in a + * normal/main.c (VasEBoot_normal_init_page): Display title text in a position relative to the center of the terminal instead of relying on a hardcoded offset. 2009-03-04 Robert Millan - Filter /etc/grub.d/10_* so that only add-ons for native kernels are + Filter /etc/VasEBoot.d/10_* so that only add-ons for native kernels are installed. * Makefile.in (host_kernel): New variable. - * conf/common.rmk (grub-mkconfig_SCRIPTS): Conditionalize all 10_*.in + * conf/common.rmk (VasEBoot-mkconfig_SCRIPTS): Conditionalize all 10_*.in scripts instead of just the windows one. * configure.ac: Initialize and AC_SUBST `host_kernel'. 2009-03-04 Felix Zielcke - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `kern/list.c' and + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `kern/list.c' and `kern/handler.c'. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. 2009-03-04 Felix Zielcke @@ -40822,7 +40822,7 @@ 2009-03-04 Felix Zielcke * util/misc.c: Include . - (grub_millisleep): New function. + (VasEBoot_millisleep): New function. 2009-03-04 Bean @@ -40842,16 +40842,16 @@ Vladimir Serbinenko for spotting). * loader/i386/multiboot.c (mbi_dest): New variable. - (grub_multiboot_boot): Use `mbi_dest' instead of `mbi'. - (grub_multiboot): Put cmdline, boot_loader_name and mbi in the + (VasEBoot_multiboot_boot): Use `mbi_dest' instead of `mbi'. + (VasEBoot_multiboot): Put cmdline, boot_loader_name and mbi in the relocation area. 2009-03-01 Bean - * include/grub/efi/api.h (GRUB_EFI_MPS_TABLE_GUID): New constant. - (GRUB_EFI_ACPI_TABLE_GUID): Likewise. - (GRUB_EFI_ACPI_20_TABLE_GUID): Likewise. - (GRUB_EFI_SMBIOS_TABLE_GUID): Likewise. + * include/VasEBoot/efi/api.h (VasEBoot_EFI_MPS_TABLE_GUID): New constant. + (VasEBoot_EFI_ACPI_TABLE_GUID): Likewise. + (VasEBoot_EFI_ACPI_20_TABLE_GUID): Likewise. + (VasEBoot_EFI_SMBIOS_TABLE_GUID): Likewise. * loader/i386/efi/linux.c (acpi_guid): New variable. (acpi_guid): Likewise. @@ -40859,7 +40859,7 @@ (LOW_MEM_ADDR): Likewise. (FAKE_EBDA_SEG): Likewise. (fake_bios_data): New function. - (grub_linux_boot): Call fake_bios_data. + (VasEBoot_linux_boot): Call fake_bios_data. 2009-03-01 Bean @@ -40867,99 +40867,99 @@ * commands/handler.c: New file. - * include/grub/list.h: Likewise. + * include/VasEBoot/list.h: Likewise. - * include/grub/handler.h: Likewise. + * include/VasEBoot/handler.h: Likewise. * kern/list.c: Likewise. * kern/handler.c: Likewise. - * kern/term.h: Include header file . - (grub_term_input): Move next field to the beginning. - (grub_term_output): Likewise. - (grub_term_input_class): New variable. - (grub_term_output_class): Likewise. - (grub_term_register_input): Changed to inline function. - (grub_term_register_output): Likewise. - (grub_term_unregister_input): Likewise. - (grub_term_unregister_output): Likewise. - (grub_term_set_current_input): Likewise. - (grub_term_set_current_output): Likewise. - (grub_term_get_current_input): Likewise. - (grub_term_get_current_output): Likewise. - (grub_term_iterate_input): Removed. - (grub_term_iterate_output): Likewise. + * kern/term.h: Include header file . + (VasEBoot_term_input): Move next field to the beginning. + (VasEBoot_term_output): Likewise. + (VasEBoot_term_input_class): New variable. + (VasEBoot_term_output_class): Likewise. + (VasEBoot_term_register_input): Changed to inline function. + (VasEBoot_term_register_output): Likewise. + (VasEBoot_term_unregister_input): Likewise. + (VasEBoot_term_unregister_output): Likewise. + (VasEBoot_term_set_current_input): Likewise. + (VasEBoot_term_set_current_output): Likewise. + (VasEBoot_term_get_current_input): Likewise. + (VasEBoot_term_get_current_output): Likewise. + (VasEBoot_term_iterate_input): Removed. + (VasEBoot_term_iterate_output): Likewise. - * kern/term.c (grub_term_list_input): Removed. - (grub_term_list_output): Likewise. - (grub_term_input_class): New variable. - (grub_term_output_class): Likewise. - (grub_cur_term_input): Change variable as macro. - (grub_cur_term_output): Likewise. - (grub_term_register_input): Removed. - (grub_term_register_output): Likewise. - (grub_term_unregister_input): Likewise. - (grub_term_unregister_output): Likewise. - (grub_term_set_current_input): Likewise. - (grub_term_set_current_output): Likewise. - (grub_term_iterate_input): Likewise. - (grub_term_iterate_output): Likewise. - (grub_term_get_current_input): Likewise. - (grub_term_get_current_output): Likewise. + * kern/term.c (VasEBoot_term_list_input): Removed. + (VasEBoot_term_list_output): Likewise. + (VasEBoot_term_input_class): New variable. + (VasEBoot_term_output_class): Likewise. + (VasEBoot_cur_term_input): Change variable as macro. + (VasEBoot_cur_term_output): Likewise. + (VasEBoot_term_register_input): Removed. + (VasEBoot_term_register_output): Likewise. + (VasEBoot_term_unregister_input): Likewise. + (VasEBoot_term_unregister_output): Likewise. + (VasEBoot_term_set_current_input): Likewise. + (VasEBoot_term_set_current_output): Likewise. + (VasEBoot_term_iterate_input): Likewise. + (VasEBoot_term_iterate_output): Likewise. + (VasEBoot_term_get_current_input): Likewise. + (VasEBoot_term_get_current_output): Likewise. - * util/grub-editenv.c: Include header file . - (grub_term_get_current_input): Removed. - (grub_term_get_current_output): Likewise. - (grub_term_input_class): New variable. - (grub_term_output_class): Likewise. + * util/VasEBoot-editenv.c: Include header file . + (VasEBoot_term_get_current_input): Removed. + (VasEBoot_term_get_current_output): Likewise. + (VasEBoot_term_input_class): New variable. + (VasEBoot_term_output_class): Likewise. - * util/grub-fstest.c (grub_term_get_current_input): Removed. - (grub_term_get_current_output): Likewise. - (grub_term_input_class): New variable. - (grub_term_output_class): Likewise. + * util/VasEBoot-fstest.c (VasEBoot_term_get_current_input): Removed. + (VasEBoot_term_get_current_output): Likewise. + (VasEBoot_term_input_class): New variable. + (VasEBoot_term_output_class): Likewise. - * util/grub-probe.c (grub_term_get_current_input): Removed. - (grub_term_get_current_output): Likewise. - (grub_term_input_class): New variable. - (grub_term_output_class): Likewise. + * util/VasEBoot-probe.c (VasEBoot_term_get_current_input): Removed. + (VasEBoot_term_get_current_output): Likewise. + (VasEBoot_term_input_class): New variable. + (VasEBoot_term_output_class): Likewise. - * util/i386/pc/grub-setup.c (grub_term_get_current_input): Removed. - (grub_term_get_current_output): Likewise. - (grub_term_input_class): New variable. - (grub_term_output_class): Likewise. + * util/i386/pc/VasEBoot-setup.c (VasEBoot_term_get_current_input): Removed. + (VasEBoot_term_get_current_output): Likewise. + (VasEBoot_term_input_class): New variable. + (VasEBoot_term_output_class): Likewise. * conf/common.rmk (pkglib_MODULES): Replace terminal with handler. (terminal_mod_SOURCES): Likewise. (terminal_mod_CFLAGS): Likewise. (terminal_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Replace terminal.c with + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Replace terminal.c with handler.c. (kernel_img_SOURCES): Add list.c and handler.c. (kernel_img_HEADERS): Add list.h and handler.h. - * conf/i386-efi.rmk (grub_emu_SOURCES): Replace terminal.c with + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Replace terminal.c with handler.c. (kernel_mod_SOURCES): Add list.c and handler.c. (kernel_mod_HEADERS): Add list.h and handler.h. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Replace terminal.c with + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Replace terminal.c with handler.c. (kernel_elf_SOURCES): Add list.c and handler.c. (kernel_elf_HEADERS): Add list.h and handler.h. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace terminal.c with + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Replace terminal.c with handler.c. (kernel_elf_SOURCES): Add list.c and handler.c. (kernel_elf_HEADERS): Add list.h and handler.h. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Replace terminal.c with + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Replace terminal.c with handler.c. (kernel_mod_SOURCES): Add list.c and handler.c. (kernel_mod_HEADERS): Add list.h and handler.h. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Replace terminal.c with + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Replace terminal.c with handler.c. (kernel_elf_SOURCES): Add list.c and handler.c. (kernel_elf_HEADERS): Add list.h and handler.h. @@ -40969,21 +40969,21 @@ Factorize elf32 / elf64 code in Multiboot loader. This will prevent it from getting out of sync again. - * loader/i386/multiboot.c (grub_multiboot_is_elf32, - grub_multiboot_load_elf32, grub_multiboot_is_elf64, - grub_multiboot_load_elf64): Move from here ... - * loader/i386/multiboot_elfxx.c (grub_multiboot_is_elf, - grub_multiboot_load_elf): ... to here (new file). + * loader/i386/multiboot.c (VasEBoot_multiboot_is_elf32, + VasEBoot_multiboot_load_elf32, VasEBoot_multiboot_is_elf64, + VasEBoot_multiboot_load_elf64): Move from here ... + * loader/i386/multiboot_elfxx.c (VasEBoot_multiboot_is_elf, + VasEBoot_multiboot_load_elf): ... to here (new file). 2009-02-27 Robert Millan - * util/grub.d/10_linux.in: Rename "single-user mode" to + * util/VasEBoot.d/10_linux.in: Rename "single-user mode" to "recovery mode". 2009-02-27 Vladimir Serbinenko Don't leak in SCSI code. - * disk/scsi.c (grub_scsi_close): free `scsi'. + * disk/scsi.c (VasEBoot_scsi_close): free `scsi'. 2009-02-27 Robert Millan @@ -40993,38 +40993,38 @@ 2009-02-27 Robert Millan Patch from Alexandre Bique - * util/i386/pc/grub-setup.c (setup): Fix directory path. + * util/i386/pc/VasEBoot-setup.c (setup): Fix directory path. 2009-02-27 Krzysztof Smiechowicz - * fs/sfs.c (grub_sfs_read_extent): Correction to traversing extent + * fs/sfs.c (VasEBoot_sfs_read_extent): Correction to traversing extent b-tree. 2009-02-27 Robert Millan - * kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the + * kern/misc.c (VasEBoot_strtoull): Fix bug (it mistakenly parsed the `0x' qualifier as 0 when base is specified as parameter). 2009-02-24 Bean * configure.ac: Check for -mcmodel=large in x86_64 target. - * include/grub/efi/api.h (efi_call_10): New macro. + * include/VasEBoot/efi/api.h (efi_call_10): New macro. (efi_wrap_10): New function. - * include/grub/efi/pe32.h (GRUB_PE32_REL_BASE_HIGH): New macro. - (GRUB_PE32_REL_BASED_HIGH): Likewise. - (GRUB_PE32_REL_BASED_LOW): Likewise. - (GRUB_PE32_REL_BASED_HIGHLOW): Likewise. - (GRUB_PE32_REL_BASED_HIGHADJ): Likewise. - (GRUB_PE32_REL_BASED_MIPS_JMPADDR): Likewise. - (GRUB_PE32_REL_BASED_SECTION): Likewise. - (GRUB_PE32_REL_BASED_REL): Likewise. - (GRUB_PE32_REL_BASED_IA64_IMM64): Likewise. - (GRUB_PE32_REL_BASED_DIR64): Likewise. - (GRUB_PE32_REL_BASED_HIGH3ADJ): Likewise. + * include/VasEBoot/efi/pe32.h (VasEBoot_PE32_REL_BASE_HIGH): New macro. + (VasEBoot_PE32_REL_BASED_HIGH): Likewise. + (VasEBoot_PE32_REL_BASED_LOW): Likewise. + (VasEBoot_PE32_REL_BASED_HIGHLOW): Likewise. + (VasEBoot_PE32_REL_BASED_HIGHADJ): Likewise. + (VasEBoot_PE32_REL_BASED_MIPS_JMPADDR): Likewise. + (VasEBoot_PE32_REL_BASED_SECTION): Likewise. + (VasEBoot_PE32_REL_BASED_REL): Likewise. + (VasEBoot_PE32_REL_BASED_IA64_IMM64): Likewise. + (VasEBoot_PE32_REL_BASED_DIR64): Likewise. + (VasEBoot_PE32_REL_BASED_HIGH3ADJ): Likewise. - * kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Fixed relocation + * kern/x86_64/dl.c (VasEBoot_arch_dl_relocate_symbols): Fixed relocation issue. * kern/x86_64/efi/callwrap.S (efi_wrap_6): Bug fix. @@ -41044,25 +41044,25 @@ (FBTEST_STEP): Likewise. (FBTEST_COUNT): Likewise. (fb_list): New variable. - (grub_find_video_card): Remove function. + (VasEBoot_find_video_card): Remove function. (find_framebuf): New function. - (grub_linux_setup_video): Use find_framebuf to get frame buffer and + (VasEBoot_linux_setup_video): Use find_framebuf to get frame buffer and line length. - * util/i386/efi/grub-mkimage.c (grub_reloc_section): Fix relocation + * util/i386/efi/VasEBoot-mkimage.c (VasEBoot_reloc_section): Fix relocation problem for x86_64. 2009-02-22 Vesa Jääskeläinen Patch #25624 by Kevin Lacquement . - * util/grub-mkconfig.in: Use ${grub_mkdevicemap} instead of hard + * util/VasEBoot-mkconfig.in: Use ${VasEBoot_mkdevicemap} instead of hard coding tool name. 2009-02-22 Robert Millan * include/multiboot.h (MULTIBOOT_INFO_ALIGN): New macro. - * loader/i386/pc/multiboot.c (grub_multiboot): Include the MBI + * loader/i386/pc/multiboot.c (VasEBoot_multiboot): Include the MBI in our relocation, instead of using it directly from heap. Also use `MULTIBOOT_INFO_ALIGN' to ensure it is aligned. @@ -41080,12 +41080,12 @@ Corrected wrong declaration - * kern/disk.c: corrected declaration of grub_disk_ata_pass_through. + * kern/disk.c: corrected declaration of VasEBoot_disk_ata_pass_through. 2009-02-14 Christian Franke - * commands/lspci.c (grub_pci_classes): Add `SATA Controller'. - (grub_lspci_iter): Print class code and programming interface byte. + * commands/lspci.c (VasEBoot_pci_classes): Add `SATA Controller'. + (VasEBoot_lspci_iter): Print class code and programming interface byte. 2009-02-14 Christian Franke @@ -41098,40 +41098,40 @@ 2009-02-14 Christian Franke * commands/hdparm.c: New file. Provides `hdparm' command - which sends ATA commands via grub_disk_ata_pass_through (). + which sends ATA commands via VasEBoot_disk_ata_pass_through (). * conf/i386-pc.rmk: Add ata_pthru.mod and hdparm.mod. - * disk/ata.c: Include . Move - and to include/grub/ata.h. - (enum grub_ata_addressing_t): Move to include/grub/ata.h. - (GRUB_CDROM_SECTOR_SIZE): Remove. - (GRUB_ATA_*): Move to include/grub/ata.h. - (GRUB_ATAPI_*): Likewise. - (enum grub_ata_commands): Likewise. - (enum grub_ata_timeout_milliseconds): Likewise. - (struct grub_ata_device): Likewise. - (grub_ata_regset): Likewise. - (grub_ata_regget): Likewise. - (grub_ata_regset2): Likewise. - (grub_ata_regget2): Likewise. - (grub_ata_check_ready): Likewise. - (grub_ata_wait_not_busy): Remove static, exported in - include/grub/ata.h. - (grub_ata_wait_drq): Likewise. - (grub_ata_pio_read): Likewise. + * disk/ata.c: Include . Move + and to include/VasEBoot/ata.h. + (enum VasEBoot_ata_addressing_t): Move to include/VasEBoot/ata.h. + (VasEBoot_CDROM_SECTOR_SIZE): Remove. + (VasEBoot_ATA_*): Move to include/VasEBoot/ata.h. + (VasEBoot_ATAPI_*): Likewise. + (enum VasEBoot_ata_commands): Likewise. + (enum VasEBoot_ata_timeout_milliseconds): Likewise. + (struct VasEBoot_ata_device): Likewise. + (VasEBoot_ata_regset): Likewise. + (VasEBoot_ata_regget): Likewise. + (VasEBoot_ata_regset2): Likewise. + (VasEBoot_ata_regget2): Likewise. + (VasEBoot_ata_check_ready): Likewise. + (VasEBoot_ata_wait_not_busy): Remove static, exported in + include/VasEBoot/ata.h. + (VasEBoot_ata_wait_drq): Likewise. + (VasEBoot_ata_pio_read): Likewise. - * disk/ata_pthru.c: New file. Provides grub_ata_pass_through () + * disk/ata_pthru.c: New file. Provides VasEBoot_ata_pass_through () function for hdparm.mod. - * include/grub/ata.h: New file, contains declarations from + * include/VasEBoot/ata.h: New file, contains declarations from disk/ata.c. - (enum grub_ata_commands): Add new commands for commands/hdparm.c. + (enum VasEBoot_ata_commands): Add new commands for commands/hdparm.c. - * include/grub/disk.h (grub_disk_ata_pass_through_parms): New struct. - (grub_disk_ata_pass_through): New exported variable. + * include/VasEBoot/disk.h (VasEBoot_disk_ata_pass_through_parms): New struct. + (VasEBoot_disk_ata_pass_through): New exported variable. - * kern/disk.c (grub_disk_ata_pass_through): New variable. + * kern/disk.c (VasEBoot_disk_ata_pass_through): New variable. 2009-02-13 Colin D Bennett @@ -41139,89 +41139,89 @@ executing default+fallback menu entries. Renamed the `terminal' menu viewer to `text'. - * include/grub/normal.h (grub_normal_text_menu_viewer): New global + * include/VasEBoot/normal.h (VasEBoot_normal_text_menu_viewer): New global variable declaration. - (grub_menu_execute_callback): New structure declaration. - (grub_menu_execute_callback_t): New typedef. - (grub_menu_execute_with_fallback): New function declaration. - (grub_menu_get_entry): Likewise. - (grub_menu_get_timeout): Likewise. - (grub_menu_set_timeout): Likewise. + (VasEBoot_menu_execute_callback): New structure declaration. + (VasEBoot_menu_execute_callback_t): New typedef. + (VasEBoot_menu_execute_with_fallback): New function declaration. + (VasEBoot_menu_get_entry): Likewise. + (VasEBoot_menu_get_timeout): Likewise. + (VasEBoot_menu_set_timeout): Likewise. - * normal/main.c (GRUB_MOD_INIT(normal)): Refer to new variable name. + * normal/main.c (VasEBoot_MOD_INIT(normal)): Refer to new variable name. - * normal/menu.c (grub_wait_after_message): Moved to + * normal/menu.c (VasEBoot_wait_after_message): Moved to `normal/menu_text.c'. (draw_border): Likewise. (print_message): Likewise. (print_entry): Likewise. (print_entries): Likewise. - (grub_menu_init_page): Likewise. + (VasEBoot_menu_init_page): Likewise. (get_entry_number): Likewise. (print_timeout): Likewise. (run_menu): Likewise. - (grub_menu_execute_entry): Likewise. + (VasEBoot_menu_execute_entry): Likewise. (show_text_menu): Likewise. (get_and_remove_first_entry_number): New function. - (grub_menu_execute_with_fallback): Likewise. + (VasEBoot_menu_execute_with_fallback): Likewise. (get_entry): Renamed to ... - (grub_menu_get_entry): .. this and made it global. + (VasEBoot_menu_get_entry): .. this and made it global. (get_timeout): Renamed to ... - (grub_menu_get_timeout): ... this and made it global. + (VasEBoot_menu_get_timeout): ... this and made it global. (set_timeout): Renamed to ... - (grub_menu_set_timeout): ... this and made it global. - (grub_normal_terminal_menu_viewer): Renamed to ... - (grub_normal_text_menu_viewer): ... this. + (VasEBoot_menu_set_timeout): ... this and made it global. + (VasEBoot_normal_terminal_menu_viewer): Renamed to ... + (VasEBoot_normal_text_menu_viewer): ... this. * normal/menu_text.c: New file. Extracted text-menu-specific code from normal/menu.c. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add `normal/menu_text.c'. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add `normal/menu_text.c'. (normal_mod_SOURCES): Likewise. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * conf/i386-pc.rmk, (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk, (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. 2009-02-11 Robert Millan - * util/grub.d/00_header.in: Update old reference to `font' command. + * util/VasEBoot.d/00_header.in: Update old reference to `font' command. 2009-02-10 Felix Zielcke - * fs/fat.c (grub_fat_mount): Fix wrong comparison. + * fs/fat.c (VasEBoot_fat_mount): Fix wrong comparison. Based on patch from Javier Martín. 2009-02-09 Felix Zielcke - * conf/common.rmk (grub_probe_SOURCES): Move fs/ext2.c before fs/fat.c + * conf/common.rmk (VasEBoot_probe_SOURCES): Move fs/ext2.c before fs/fat.c to avoid false positives with FAT. - (grub_fstest_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + (VasEBoot_fstest_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. 2009-02-09 Felix Zielcke - * fs/fat.c (grub_fat_mount): Try to avoid false positives by checking + * fs/fat.c (VasEBoot_fat_mount): Try to avoid false positives by checking bpb.version_specific.fat12_or_fat16.fstype and bpb.version_specific.fat32.fstype. @@ -41236,11 +41236,11 @@ 2009-02-08 Marco Gerards - * Makefile.in (enable_grub_emu_usb): New variable. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'. - (grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c', + * Makefile.in (enable_VasEBoot_emu_usb): New variable. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `disk/scsi.c'. + (VasEBoot_emu_SOURCES) [VasEBoot_emu_SOURCES]: Add `disk/usbms.c', `util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'. - (grub_emu_LDFLAGS): Add `$(LIBUSB)'. + (VasEBoot_emu_LDFLAGS): Add `$(LIBUSB)'. (pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod', `usbtest.mod' and `usbms.mod'. (usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS) @@ -41252,11 +41252,11 @@ * disk/usbms.c: New file. - * include/grub/usb.h: Likewise. + * include/VasEBoot/usb.h: Likewise. - * include/grub/usbtrans.h: Likewise. + * include/VasEBoot/usbtrans.h: Likewise. - * include/grub/usbdesc.h: Likewise. + * include/VasEBoot/usbdesc.h: Likewise. * bus/usb/usbtrans.c: Likewise. @@ -41272,11 +41272,11 @@ * util/usb.c: Likewise. - * include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'. + * include/VasEBoot/err.h (VasEBoot_err_t): Add `VasEBoot_ERR_IO'. * configure.ac: Test for libusb presence. - * util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'. + * util/VasEBoot-emu.c (main) [HAVE_LIBUSB_H]: Call `VasEBoot_libusb_init'. 2009-02-08 Vesa Jääskeläinen @@ -41295,19 +41295,19 @@ 2009-02-07 Robert Millan - * fs/ext2.c (grub_ext2_mount): Avoid mounting filesystems with + * fs/ext2.c (VasEBoot_ext2_mount): Avoid mounting filesystems with backward-incompatible features. Based on patch from Javier Martín, with some adjustments. 2009-02-07 Michael Scherer - * fs/hfs.c (grub_hfsplus_iterate_dir): Treat hfs+ as case insensitive. + * fs/hfs.c (VasEBoot_hfsplus_iterate_dir): Treat hfs+ as case insensitive. 2009-02-07 Robert Millan - * conf/common.rmk (grub_probe_SOURCES, grub_fstest_SOURCES): Move - position of `disk/lvm.c' to ensure grub_init_all() always picks it + * conf/common.rmk (VasEBoot_probe_SOURCES, VasEBoot_fstest_SOURCES): Move + position of `disk/lvm.c' to ensure VasEBoot_init_all() always picks it after the RAID stuff. 2009-02-05 Vesa Jääskeläinen @@ -41315,11 +41315,11 @@ Fixes problem when running vbetest command as reported by Vladimir Serbinenko . - * (grub_vbe_set_video_mode): Fixed problem with text modes. + * (VasEBoot_vbe_set_video_mode): Fixed problem with text modes. 2009-02-04 Felix Zielcke - util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and + util/getroot.c (VasEBoot_util_get_VasEBoot_dev): Add support for /dev/mdNpN and /dev/md/NpN style mdraid devices. 2009-02-03 Felix Zielcke @@ -41328,18 +41328,18 @@ 2009-02-03 Felix Zielcke - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add a missing trailing + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Add a missing trailing `#'. 2009-02-03 Felix Zielcke - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `normal/menu_viewer.c'. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `normal/menu_viewer.c'. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. 2009-02-02 Christian Franke @@ -41355,7 +41355,7 @@ Base on patch on bug #24154 created by Tomas Tintera . - * video/i386/pc/vbe.c (grub_video_vbe_scroll): Fix downward scrolling. + * video/i386/pc/vbe.c (VasEBoot_video_vbe_scroll): Fix downward scrolling. 2009-02-01 Vesa Jääskeläinen @@ -41366,53 +41366,53 @@ 2009-01-31 Colin D Bennett - * normal/main.c: Add include to grub/menu_viewer.h. + * normal/main.c: Add include to VasEBoot/menu_viewer.h. (free_menu_entry_classes): Added. - (grub_normal_menu_addentry): Added class property handling. - (grub_normal_execute): Changed to use new menu viewer for menu viewing. - (GRUB_MOD_INIT(normal)): Added register for text based menu viewer. + (VasEBoot_normal_menu_addentry): Added class property handling. + (VasEBoot_normal_execute): Changed to use new menu viewer for menu viewing. + (VasEBoot_MOD_INIT(normal)): Added register for text based menu viewer. * normal/menu_viewer.c: New file. * normal/menu.c (run_menu_entry): Renamed to ... - (grub_menu_execute_entry): ... this and made it as global. - (grub_menu_run): Renamed to ... + (VasEBoot_menu_execute_entry): ... this and made it as global. + (VasEBoot_menu_run): Renamed to ... (show_text_menu): ... this and made it local. (show_text_menu): Adapt to new function names. - (grub_normal_terminal_menu_viewer): New global variable. + (VasEBoot_normal_terminal_menu_viewer): New global variable. - * include/grub/menu.h: New file. + * include/VasEBoot/menu.h: New file. - * include/grub/menu_viewer.h: New file. + * include/VasEBoot/menu_viewer.h: New file. - * include/grub/normal.h: Added include to grub/menu.h. - (grub_menu_entry): Moved to include/grub/menu.h. - (grub_menu_entry_t): Likewise. - (grub_menu): Likewise. - (grub_menu_t): Likewise. - (grub_normal_terminal_menu_viewer): Added. - (grub_menu_execute_entry): Likewise. - (grub_menu_run): Removed. + * include/VasEBoot/normal.h: Added include to VasEBoot/menu.h. + (VasEBoot_menu_entry): Moved to include/VasEBoot/menu.h. + (VasEBoot_menu_entry_t): Likewise. + (VasEBoot_menu): Likewise. + (VasEBoot_menu_t): Likewise. + (VasEBoot_normal_terminal_menu_viewer): Added. + (VasEBoot_menu_execute_entry): Likewise. + (VasEBoot_menu_run): Removed. - * DISTLIST: Added include/grub/menu.h. - Added include/grub/menu_viewer.h. + * DISTLIST: Added include/VasEBoot/menu.h. + Added include/VasEBoot/menu_viewer.h. Added normal/menu_viewer.c. 2009-01-31 Vesa Jääskeläinen - * normal/execute.c (grub_script_execute_menuentry): Changed to use + * normal/execute.c (VasEBoot_script_execute_menuentry): Changed to use arglist for menutitle arguments. - * normal/main.c (grub_normal_menu_addentry): Likewise. + * normal/main.c (VasEBoot_normal_menu_addentry): Likewise. * normal/parser.y (menuentry): Likewise. - * normal/script.c (grub_script_create_cmdmenu): Likewise. + * normal/script.c (VasEBoot_script_create_cmdmenu): Likewise. - * include/grub/script.h (grub_script_cmd_menuentry): Likewise. - (grub_script_create_cmdmenu): Likewise. + * include/VasEBoot/script.h (VasEBoot_script_cmd_menuentry): Likewise. + (VasEBoot_script_create_cmdmenu): Likewise. - * include/grub/normal.h (grub_normal_menu_addentry): Likewise. + * include/VasEBoot/normal.h (VasEBoot_normal_menu_addentry): Likewise. * conf/i386-pc.rmk (normal_mod_SOURCES): Adapt Colin D Bennett's changes. @@ -41431,7 +41431,7 @@ 2009-01-30 Christian Franke - * normal/arg.c (grub_arg_show_help): Add indentation if '\n' appears + * normal/arg.c (VasEBoot_arg_show_help): Add indentation if '\n' appears in option help text. 2009-01-27 Pavel Roskin @@ -41440,33 +41440,33 @@ 2009-01-27 Vesa Jääskeläinen - * commands/lsmmap.c: Add include to grub/machine/memory.h. + * commands/lsmmap.c: Add include to VasEBoot/machine/memory.h. - * fs/i386/pc/pxe.c (grub_pxefs_open): Fix sign problem. + * fs/i386/pc/pxe.c (VasEBoot_pxefs_open): Fix sign problem. - * term/i386/pc/at_keyboard.c (GRUB_MOD_FINI(at_keyboard)): Use proper + * term/i386/pc/at_keyboard.c (VasEBoot_MOD_FINI(at_keyboard)): Use proper unregister function. 2009-01-27 Vesa Jääskeläinen - * disk/scsi.c (grub_scsi_read): Fix sign problem. + * disk/scsi.c (VasEBoot_scsi_read): Fix sign problem. - * term/i386/pc/vga_text.c (grub_vga_text_init_fini). Fix declaration. + * term/i386/pc/vga_text.c (VasEBoot_vga_text_init_fini). Fix declaration. - * util/grub-mkfont.c (usage): Fix typo. + * util/VasEBoot-mkfont.c (usage): Fix typo. - * util/elf/grub-mkimage.c (load_modules): Fix warning. + * util/elf/VasEBoot-mkimage.c (load_modules): Fix warning. 2009-01-26 Daniel Mierswa - * fs/fat.c (grub_fat_uuid): Fix shift of the first two bytes. + * fs/fat.c (VasEBoot_fat_uuid): Fix shift of the first two bytes. * commands/search.c (search_fs_uuid): Ignore case of the UUID. - * kern/misc.c (grub_strcasecmp): New function. - (grub_strcasecmp): Use grub_size_t instead of int for length. + * kern/misc.c (VasEBoot_strcasecmp): New function. + (VasEBoot_strcasecmp): Use VasEBoot_size_t instead of int for length. Fix return value. - * include/grub/misc.h: Update function prototypes. + * include/VasEBoot/misc.h: Update function prototypes. 2009-01-26 Robert Millan @@ -41474,68 +41474,68 @@ 2009-01-22 Christian Franke - * kern/misc.c (grub_vsprintf): Fix size and termination of `format2' + * kern/misc.c (VasEBoot_vsprintf): Fix size and termination of `format2' (precision) digit string. Allow `.format2' without `format1' (width). Limit input chars for `%s' output to `format2' if specified. This is compatible with standard printf (). 2009-01-22 Christian Franke - * disk/ata.c (grub_ata_wait_status): Replace by ... - (grub_ata_wait_not_busy): ... this function. Checks only BSY bit, + * disk/ata.c (VasEBoot_ata_wait_status): Replace by ... + (VasEBoot_ata_wait_not_busy): ... this function. Checks only BSY bit, other status bits may be invalid while BSY is asserted. - (grub_ata_check_ready): New function. - (grub_ata_cmd): Removed. - (grub_ata_wait_drq): New function. - (grub_ata_strncpy): Remove inline. - (grub_ata_pio_read): Reduce to actual block transfer. BSY wait - and error check now done by grub_ata_wait_drq (). - (grub_ata_pio_write): Likewise. - (grub_atapi_identify): Set DEV before check for !BSY. Use - grub_ata_wait_drq () to wait for data. - (grub_ata_device_initialize): Add status register check to + (VasEBoot_ata_check_ready): New function. + (VasEBoot_ata_cmd): Removed. + (VasEBoot_ata_wait_drq): New function. + (VasEBoot_ata_strncpy): Remove inline. + (VasEBoot_ata_pio_read): Reduce to actual block transfer. BSY wait + and error check now done by VasEBoot_ata_wait_drq (). + (VasEBoot_ata_pio_write): Likewise. + (VasEBoot_atapi_identify): Set DEV before check for !BSY. Use + VasEBoot_ata_wait_drq () to wait for data. + (VasEBoot_ata_device_initialize): Add status register check to detect missing SATA slave devices. Add debug messages. - (grub_atapi_wait_drq): Use grub_ata_wait_not_busy (). - (grub_atapi_packet): Set DEV before check for !BSY. Replace - transfer loop by grub_ata_pio_write (). - (grub_ata_identify): Set DEV before check for !BSY. Use - grub_ata_wait_drq () to wait for data. - (grub_ata_setaddress): Set DEV before check for !BSY. - (grub_ata_readwrite): Remove duplicate code, handle batch/rest and + (VasEBoot_atapi_wait_drq): Use VasEBoot_ata_wait_not_busy (). + (VasEBoot_atapi_packet): Set DEV before check for !BSY. Replace + transfer loop by VasEBoot_ata_pio_write (). + (VasEBoot_ata_identify): Set DEV before check for !BSY. Use + VasEBoot_ata_wait_drq () to wait for data. + (VasEBoot_ata_setaddress): Set DEV before check for !BSY. + (VasEBoot_ata_readwrite): Remove duplicate code, handle batch/rest and read/write in one loop. Fix invalid command on write. Fix incomplete command on (size % batch) == 0. Add missing error check after write of last block. Add debug messages. - (grub_atapi_read): Replace transfer loop by grub_ata_pio_read (). + (VasEBoot_atapi_read): Replace transfer loop by VasEBoot_ata_pio_read (). 2009-01-19 Christian Franke - * disk/ata.c (GRUB_ATAPI_REG_*): New defines. - (GRUB_ATAPI_IREASON_*): Likewise. - (grub_ata_pio_write): Fix timeout error return. - (grub_atapi_identify): Add grub_ata_wait () after cmd. - (grub_atapi_wait_drq): New function. - (grub_atapi_packet): New parameter `size'. - Use grub_atapi_wait_drq () and direct write instead of - grub_ata_pio_write (). - (grub_atapi_read): Replace grub_ata_pio_read () by a loop which + * disk/ata.c (VasEBoot_ATAPI_REG_*): New defines. + (VasEBoot_ATAPI_IREASON_*): Likewise. + (VasEBoot_ata_pio_write): Fix timeout error return. + (VasEBoot_atapi_identify): Add VasEBoot_ata_wait () after cmd. + (VasEBoot_atapi_wait_drq): New function. + (VasEBoot_atapi_packet): New parameter `size'. + Use VasEBoot_atapi_wait_drq () and direct write instead of + VasEBoot_ata_pio_write (). + (VasEBoot_atapi_read): Replace VasEBoot_ata_pio_read () by a loop which reads the number of bytes requested by the device for each DRQ assertion. - (grub_atapi_write): Remove old implementation, return not + (VasEBoot_atapi_write): Remove old implementation, return not implemented instead. 2009-01-19 Christian Franke - * disk/scsi.c (grub_scsi_read10): Use scsi->blocksize instead + * disk/scsi.c (VasEBoot_scsi_read10): Use scsi->blocksize instead of 512 to calculate data size. - (grub_scsi_read12): Likewise. - (grub_scsi_write10): Likewise. - (grub_scsi_write12): Likewise. - (grub_scsi_read): Adjust size according to blocksize. + (VasEBoot_scsi_read12): Likewise. + (VasEBoot_scsi_write10): Likewise. + (VasEBoot_scsi_write12): Likewise. + (VasEBoot_scsi_read): Adjust size according to blocksize. Add checks for invalid blocksize and unaligned transfer. 2009-01-19 Vesa Jääskeläinen - * font/font.c (grub_font_loader_init): Re-position unknown glyph. + * font/font.c (VasEBoot_font_loader_init): Re-position unknown glyph. * term/gfxterm.c (write_char): Fix background rendering for wide width glyphs. @@ -41547,78 +41547,78 @@ 2009-01-17 Felix Zielcke - * Makefile.in: Change font compilation to use new grub-mkfont instead + * Makefile.in: Change font compilation to use new VasEBoot-mkfont instead of java version. - * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: Remove. - * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/BDFLoader.java: Remove. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/CharDefs.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/CharacterRange.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/CharacterRange.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/Converter.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/Font.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/Glyph.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/PFF2Sections.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/PFF2Writer.java: Likewise. 2009-01-16 Christian Franke - * disk/ata.c (enum grub_ata_commands): Remove EXEC_DEV_DIAGNOSTICS. - (enum grub_ata_timeout_milliseconds): New enum. - (grub_ata_wait_status): Add parameter milliseconds. - (grub_ata_cmd): Remove variable `err'. Remove wait for !DRQ to allow + * disk/ata.c (enum VasEBoot_ata_commands): Remove EXEC_DEV_DIAGNOSTICS. + (enum VasEBoot_ata_timeout_milliseconds): New enum. + (VasEBoot_ata_wait_status): Add parameter milliseconds. + (VasEBoot_ata_cmd): Remove variable `err'. Remove wait for !DRQ to allow recovery from timed-out commands. - (grub_ata_pio_read): Add parameter milliseconds. Fix error return, - return grub_errno instead of REG_ERROR. - (grub_ata_pio_write): Add parameter milliseconds. - (grub_atapi_identify): Fix size of ATAPI IDENTIFY sector. - Pass milliseconds to grub_ata_wait_status () and - grub_ata_pio_read (). - (grub_atapi_packet): Pass milliseconds to grub_ata_pio_write (). - (grub_ata_identify): Remove variable `ataerr'. Pass milliseconds to - grub_ata_wait_status (). Fix IDENTIFY timeout check. - (grub_ata_device_initialize): Remove EXECUTE DEVICE DIAGNOSTICS. + (VasEBoot_ata_pio_read): Add parameter milliseconds. Fix error return, + return VasEBoot_errno instead of REG_ERROR. + (VasEBoot_ata_pio_write): Add parameter milliseconds. + (VasEBoot_atapi_identify): Fix size of ATAPI IDENTIFY sector. + Pass milliseconds to VasEBoot_ata_wait_status () and + VasEBoot_ata_pio_read (). + (VasEBoot_atapi_packet): Pass milliseconds to VasEBoot_ata_pio_write (). + (VasEBoot_ata_identify): Remove variable `ataerr'. Pass milliseconds to + VasEBoot_ata_wait_status (). Fix IDENTIFY timeout check. + (VasEBoot_ata_device_initialize): Remove EXECUTE DEVICE DIAGNOSTICS. It is not suitable for device detection, because DEV bit is ignored, the command may run too long, and not all devices set the signature properly. - (grub_ata_pciinit): Clear grub_errno before grub_ata_device_initialize (). - (grub_ata_setaddress): Pass milliseconds to grub_ata_wait_status (). + (VasEBoot_ata_pciinit): Clear VasEBoot_errno before VasEBoot_ata_device_initialize (). + (VasEBoot_ata_setaddress): Pass milliseconds to VasEBoot_ata_wait_status (). Fix device selection, DEV bit must be set first to address the registers of the correct device. - (grub_ata_readwrite): Pass milliseconds to grub_ata_wait_status () and - grub_ata_pio_read/write (). - (grub_atapi_read): Pass milliseconds to grub_ata_pio_read (). - (grub_atapi_write): Pass milliseconds to grub_ata_pio_write (). + (VasEBoot_ata_readwrite): Pass milliseconds to VasEBoot_ata_wait_status () and + VasEBoot_ata_pio_read/write (). + (VasEBoot_atapi_read): Pass milliseconds to VasEBoot_ata_pio_read (). + (VasEBoot_atapi_write): Pass milliseconds to VasEBoot_ata_pio_write (). 2009-01-13 Carles Pina i Estany - * util/grub-editenv.c (main): Use fseeko(), not fseek(). + * util/VasEBoot-editenv.c (main): Use fseeko(), not fseek(). 2009-01-13 Bean - * util/grub-mkfont.c (write_font): forget to remove some debug code. + * util/VasEBoot-mkfont.c (write_font): forget to remove some debug code. 2009-01-13 Bean - * Makefile.in: (enable_grub_mkfont): New variable. + * Makefile.in: (enable_VasEBoot_mkfont): New variable. (freetype_cflags): Likewise. (freetype_libs): Likewise. - * common.rmk (bin_UTILITIES): Add `grub-mkfont' if requested. - (grub_mkfont_SOURCES): New variable. - (grub_mkfont_CFLAGS): Likewise. - (grub_mkfont_LDFLAGS): Likewise. + * common.rmk (bin_UTILITIES): Add `VasEBoot-mkfont' if requested. + (VasEBoot_mkfont_SOURCES): New variable. + (VasEBoot_mkfont_CFLAGS): Likewise. + (VasEBoot_mkfont_LDFLAGS): Likewise. - * configure.ac (--enable-grub-mkfont): New option. Check for freetype2 - library if `--enable-grub-mkfont' is requested. - (enable_grub_mkfont): New variable. + * configure.ac (--enable-VasEBoot-mkfont): New option. Check for freetype2 + library if `--enable-VasEBoot-mkfont' is requested. + (enable_VasEBoot_mkfont): New variable. (freetype_cflags): Likewise. (freetype_libs): Likewise. - * util/grub-mkfont.c: New file. + * util/VasEBoot-mkfont.c: New file. 2009-01-12 Christian Franke - * disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility + * disk/ata.c (VasEBoot_ata_pciinit): Fix bit numbers of compatibility mode check. Fix setting of compat_use[]. 2009-01-10 Robert Millan @@ -41642,18 +41642,18 @@ * fs/ufs.c: Likewise. * gensymlist.sh.in: Likewise. * genkernsyms.sh.in: Likewise. - * include/grub/misc.h: Likewise. - * include/grub/types.h: Likewise. - * include/grub/symbol.h: Likewise. - * include/grub/elf.h: Likewise. - * include/grub/kernel.h: Likewise. - * include/grub/disk.h: Likewise. - * include/grub/dl.h: Likewise. - * include/grub/i386/linux.h: Likewise. - * include/grub/i386/pc/biosdisk.h: Likewise. - * include/grub/efi/api.h: Likewise. - * include/grub/efi/pe32.h: Likewise. - * include/grub/util/misc.h: Likewise. + * include/VasEBoot/misc.h: Likewise. + * include/VasEBoot/types.h: Likewise. + * include/VasEBoot/symbol.h: Likewise. + * include/VasEBoot/elf.h: Likewise. + * include/VasEBoot/kernel.h: Likewise. + * include/VasEBoot/disk.h: Likewise. + * include/VasEBoot/dl.h: Likewise. + * include/VasEBoot/i386/linux.h: Likewise. + * include/VasEBoot/i386/pc/biosdisk.h: Likewise. + * include/VasEBoot/efi/api.h: Likewise. + * include/VasEBoot/efi/pe32.h: Likewise. + * include/VasEBoot/util/misc.h: Likewise. * normal/execute.c: Likewise. * normal/arg.c: Likewise. * normal/completion.c: Likewise. @@ -41673,12 +41673,12 @@ * term/i386/pc/serial.c: Likewise. * util/lvm.c: Likewise. * util/console.c: Likewise. - * util/i386/efi/grub-mkimage.c: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. * util/raid.c: Likewise. 2009-01-06 Vesa Jääskeläinen - * commands/videotest.c: Removed include to grub/machine/memory.h. + * commands/videotest.c: Removed include to VasEBoot/machine/memory.h. * conf/i386-pc.rmk (pkglib_MODULES): Removed video.mod, gfxterm.mod, videotest.mod, bitmap.mod, tga.mod, jpeg.mod, png.mod. @@ -41728,8 +41728,8 @@ (gfxterm_mod_CFLAGS): Likewise. (gfxterm_mod_LDFLAGS): Likewise. - * term/gfxterm.c: Removed include to grub/machine/memory.h, - grub/machine/console.h. + * term/gfxterm.c: Removed include to VasEBoot/machine/memory.h, + VasEBoot/machine/console.h. 2009-01-04 Jerone Young @@ -41757,28 +41757,28 @@ * Makefile.in: Changed UNIFONT_HEX to UNIFONT_BDF. Added Font tool compilation. - * include/grub/misc.h (grub_utf8_to_ucs4): Changed prototype. Changed users. + * include/VasEBoot/misc.h (VasEBoot_utf8_to_ucs4): Changed prototype. Changed users. - * kern/misc.c (grub_utf8_to_ucs4): Changed prototype. + * kern/misc.c (VasEBoot_utf8_to_ucs4): Changed prototype. - * kern/term.c: Changed users of grub_utf8_to_ucs4. + * kern/term.c: Changed users of VasEBoot_utf8_to_ucs4. * normal/menu.c: Likewise. * conf/common.rmk (font_mod_SOURCES): Removed font/manager.c. (font_mod_SOURCES): Added font/font_cmd.c, font/font.c. - * include/grub/font.h: Replaced with new file. + * include/VasEBoot/font.h: Replaced with new file. - * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_ALPHA): Changed value. - (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED): Likewise. - (GRUB_VIDEO_MODE_TYPE_COLOR_MASK): Likewise. - (GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP): Added. - (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED. - (grub_video_mode_info): Added bg_red, bg_green, bg_blue, bg_alpha, + * include/VasEBoot/video.h (VasEBoot_VIDEO_MODE_TYPE_ALPHA): Changed value. + (VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED): Likewise. + (VasEBoot_VIDEO_MODE_TYPE_COLOR_MASK): Likewise. + (VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP): Added. + (VasEBoot_video_blit_format): Added VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED. + (VasEBoot_video_mode_info): Added bg_red, bg_green, bg_blue, bg_alpha, fg_red, fg_green, fg_blue, fg_alpha. - (grub_video_adapter): Removed blit_glyph. - (grub_video_blit_glyph): Removed. + (VasEBoot_video_adapter): Removed blit_glyph. + (VasEBoot_video_blit_glyph): Removed. * font/manager.c: Removed file. @@ -41786,19 +41786,19 @@ * font/font_cmd.c: Likewise. - * video/video.c (grub_video_blit_glyph): Removed. + * video/video.c (VasEBoot_video_blit_glyph): Removed. - * video/i386/pc/vbe.c (grub_video_vbe_map_rgb): Added 1-bit support. - (grub_video_vbe_map_rgba): Likewise. - (grub_video_vbe_unmap_color_int): Likewise. - (grub_video_vbe_blit_glyph): Removed. - (grub_video_vbe_adapter): Removed blit_glyph. + * video/i386/pc/vbe.c (VasEBoot_video_vbe_map_rgb): Added 1-bit support. + (VasEBoot_video_vbe_map_rgba): Likewise. + (VasEBoot_video_vbe_unmap_color_int): Likewise. + (VasEBoot_video_vbe_blit_glyph): Removed. + (VasEBoot_video_vbe_adapter): Removed blit_glyph. * video/i386/pc/vbeutil.c (get_data_ptr): Added 1-bit support. (get_pixel): Likewise. (set_pixel): Likewise. - * commands/videotest.c (grub_cmd_videotest): Added more tests for fonts. + * commands/videotest.c (VasEBoot_cmd_videotest): Added more tests for fonts. * term/gfxterm.c: Adapted to new font engine. @@ -41806,49 +41806,49 @@ * term/i386/pc/vga.c: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: New file. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/BDFLoader.java: New file. - * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/CharDefs.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/CharacterRange.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/CharacterRange.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/Converter.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/Font.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/Glyph.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/PFF2Sections.java: Likewise. - * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. + * util/fonttool/src/org/gnu/VasEBoot/fonttool/PFF2Writer.java: Likewise. - * util/grub.d/00_header.in: Changed to use new loadfont command. + * util/VasEBoot.d/00_header.in: Changed to use new loadfont command. - * util/grub-mkconfig_lib.in: Changed font extension. + * util/VasEBoot-mkconfig_lib.in: Changed font extension. 2008-12-28 Felix Zielcke - * util/getroot.c (grub_util_get_grub_dev): Add support for + * util/getroot.c (VasEBoot_util_get_VasEBoot_dev): Add support for /dev/md/dNNpNN style partitionable mdraid devices. 2008-12-12 Alex Smith - * fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection + * fs/i386/pc/pxe.c (VasEBoot_pxefs_open): Handle the one open connection at a time limit of the PXE TFTP API correctly. - (grub_pxefs_close): Likewise. + (VasEBoot_pxefs_close): Likewise. 2008-11-29 Robert Millan - * disk/ata.c (grub_ata_pciinit): Handle errors raised by - grub_ata_device_initialize() calls. + * disk/ata.c (VasEBoot_ata_pciinit): Handle errors raised by + VasEBoot_ata_device_initialize() calls. 2008-11-28 Krzysztof Smiechowicz - * fs/affs.c (grub_affs_iterate_dir): Return failure when directory + * fs/affs.c (VasEBoot_affs_iterate_dir): Return failure when directory iteration failed. - * fs/sfs.c (grub_sfs_iterate_dir): Likewise. + * fs/sfs.c (VasEBoot_sfs_iterate_dir): Likewise. 2008-11-28 Robert Millan @@ -41856,29 +41856,29 @@ Manoel Abranches . * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/ieee1275/mmap.c'. - * include/grub/powerpc/ieee1275/memory.h: New file. + * include/VasEBoot/powerpc/ieee1275/memory.h: New file. - Provide grub-install on coreboot. - * conf/i386-coreboot.rmk (sbin_SCRIPTS): Add `grub-install'. - (grub_install_SOURCES): New variable. - * util/i386/pc/grub-install.in: Add a few condition checks to make it + Provide VasEBoot-install on coreboot. + * conf/i386-coreboot.rmk (sbin_SCRIPTS): Add `VasEBoot-install'. + (VasEBoot_install_SOURCES): New variable. + * util/i386/pc/VasEBoot-install.in: Add a few condition checks to make it usable on coreboot. 2008-11-25 Felix Zielcke - * util/grub-fstest.c (grub_term_get_current_input): Change return type - to `grub_term_input_t'. - (grub_term_get_current_output): Change return type to - `grub_term_output_t'. + * util/VasEBoot-fstest.c (VasEBoot_term_get_current_input): Change return type + to `VasEBoot_term_input_t'. + (VasEBoot_term_get_current_output): Change return type to + `VasEBoot_term_output_t'. 2008-11-22 Robert Millan Fix breakage on coreboot due to declaration mismatch. - * term/i386/pc/vga_text.c (grub_vga_text_init_fini): New function. - (grub_vga_text_term): Use grub_vga_text_init_fini() instead of - grub_vga_text_cls(). + * term/i386/pc/vga_text.c (VasEBoot_vga_text_init_fini): New function. + (VasEBoot_vga_text_term): Use VasEBoot_vga_text_init_fini() instead of + VasEBoot_vga_text_cls(). - * kern/i386/loader.S (grub_multiboot_backward_relocator): Improve + * kern/i386/loader.S (VasEBoot_multiboot_backward_relocator): Improve comments. Avoid copying one more byte than necessary (just in case). * conf/powerpc-ieee1275.rmk (kernel_elf_LDFLAGS): Change link address @@ -41888,34 +41888,34 @@ 2008-11-20 Robert Millan - * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. - (grub_get_rtc, grub_exit): Abort with grub_fatal() if called. + * kern/i386/coreboot/init.c (VasEBoot_time_tics): Remove variable. + (VasEBoot_get_rtc, VasEBoot_exit): Abort with VasEBoot_fatal() if called. - * util/grub-mkconfig_lib.in (grub_warn): New function. - (convert_system_path_to_grub_path): Use grub_warn() when issuing + * util/VasEBoot-mkconfig_lib.in (VasEBoot_warn): New function. + (convert_system_path_to_VasEBoot_path): Use VasEBoot_warn() when issuing warnings, to obtain consistent formatting. - * util/grub.d/00_header.in: Likewise. - * util/update-grub_lib.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/update-VasEBoot_lib.in: Likewise. * loader/i386/linux.c (allocate_pages): Fix a warning. Move comment text to `#error' stanza. - Harmonize ieee1275's grub_available_iterate() with the generic - grub_machine_mmap_iterate() interface (fixes a recently-introduced + Harmonize ieee1275's VasEBoot_available_iterate() with the generic + VasEBoot_machine_mmap_iterate() interface (fixes a recently-introduced build problem on i386-ieee1275): - * kern/ieee1275/openfw.c (grub_available_iterate): Moved from here ... - * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): ... here. Add third + * kern/ieee1275/openfw.c (VasEBoot_available_iterate): Moved from here ... + * kern/ieee1275/mmap.c (VasEBoot_machine_mmap_iterate): ... here. Add third parameter `type'. Update all users of this function. * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/ieee1275/mmap.c'. * kern/ieee1275/init.c - * include/grub/ieee1275/ieee1275.h (grub_available_iterate): Replace + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_available_iterate): Replace with ... - (grub_machine_mmap_iterate): ... this. - * include/grub/i386/pc/memory.h (grub_machine_mmap_iterate): Change - return type to `grub_err_t'. Update all implementations of this + (VasEBoot_machine_mmap_iterate): ... this. + * include/VasEBoot/i386/pc/memory.h (VasEBoot_machine_mmap_iterate): Change + return type to `VasEBoot_err_t'. Update all implementations of this function prototype. - * include/grub/i386/coreboot/memory.h (grub_machine_mmap_iterate): + * include/VasEBoot/i386/coreboot/memory.h (VasEBoot_machine_mmap_iterate): Likewise. Add `lsmmap' command (lists firmware-provided memory map): @@ -41929,21 +41929,21 @@ 2008-11-19 Robert Millan - * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. - * loader/i386/linux.c (grub_rescue_cmd_initrd): Implement a few needed + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_initrd): Fix a typo. + * loader/i386/linux.c (VasEBoot_rescue_cmd_initrd): Implement a few needed constraints to initrd allocation (based on code from loader/i386/pc/linux.c). Without them, initrd was allocated too high for Linux to find it. 2008-11-14 Robert Millan - * fs/cpio.c (grub_cpio_open): Compare `name' and `fn' by hand in + * fs/cpio.c (VasEBoot_cpio_open): Compare `name' and `fn' by hand in order to cope with duplicate slashes. 2008-11-14 Robert Millan - * include/grub/i386/coreboot/memory.h (GRUB_MEMORY_MACHINE_LOWER_SIZE): - Redefine to match with GRUB_MEMORY_MACHINE_UPPER_START (0x100000). We + * include/VasEBoot/i386/coreboot/memory.h (VasEBoot_MEMORY_MACHINE_LOWER_SIZE): + Redefine to match with VasEBoot_MEMORY_MACHINE_UPPER_START (0x100000). We don't want to mess with lower memory, because it is used in the Linux loader. @@ -41956,35 +41956,35 @@ 2008-11-14 Robert Millan - * term/i386/pc/serial.c [! GRUB_MACHINE_PCBIOS] - (GRUB_SERIAL_PORT_NUM): Fix miscalculation. + * term/i386/pc/serial.c [! VasEBoot_MACHINE_PCBIOS] + (VasEBoot_SERIAL_PORT_NUM): Fix miscalculation. 2008-11-12 Robert Millan Make loader/i386/linux.c buildable on i386-pc (although disabled). - * include/grub/i386/pc/init.h: Include `'. - (struct grub_machine_mmap_entry, grub_machine_mmap_iterate): Move + * include/VasEBoot/i386/pc/init.h: Include `'. + (struct VasEBoot_machine_mmap_entry, VasEBoot_machine_mmap_iterate): Move from here ... - * include/grub/i386/pc/memory.h: ... to here. + * include/VasEBoot/i386/pc/memory.h: ... to here. 2008-11-12 Robert Millan Fix build problems on i386-ieee1275 and *-efi (introduced by vga_text split). - * include/grub/i386/pc/console.h: Include `'. - (grub_console_cur_color, grub_console_real_putchar) - (grub_console_putchar, grub_console_getcharwidth, grub_console_getwh) - (grub_console_setcolorstate, grub_console_setcolor) - (grub_console_getcolor): Move from here ... - * include/grub/i386/vga_common.h: ... to here (new file). + * include/VasEBoot/i386/pc/console.h: Include `'. + (VasEBoot_console_cur_color, VasEBoot_console_real_putchar) + (VasEBoot_console_putchar, VasEBoot_console_getcharwidth, VasEBoot_console_getwh) + (VasEBoot_console_setcolorstate, VasEBoot_console_setcolor) + (VasEBoot_console_getcolor): Move from here ... + * include/VasEBoot/i386/vga_common.h: ... to here (new file). - * term/i386/pc/vga_text.c: Replace `' with - `' and `' with - `'. - * term/i386/vga_common.c: Replace `' with - `'. + * term/i386/pc/vga_text.c: Replace `' with + `' and `' with + `'. + * term/i386/vga_common.c: Replace `' with + `'. 2008-11-12 Robert Millan @@ -41995,29 +41995,29 @@ * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace `term/i386/pc/console.c' with `term/i386/vga_common.c'. - * kern/i386/coreboot/init.c (grub_machine_init): Replace call to - grub_console_init() with call to grub_vga_text_init(). - (grub_machine_fini): Replace call to - grub_console_fini() with call to grub_vga_text_fini() and - grub_at_keyboard_fini(). + * kern/i386/coreboot/init.c (VasEBoot_machine_init): Replace call to + VasEBoot_console_init() with call to VasEBoot_vga_text_init(). + (VasEBoot_machine_fini): Replace call to + VasEBoot_console_fini() with call to VasEBoot_vga_text_fini() and + VasEBoot_at_keyboard_fini(). - * include/grub/i386/pc/console.h: Include `'. - (grub_console_putchar, grub_console_getcharwidth, grub_console_getwh) - (grub_console_setcolorstate, grub_console_setcolor) - (grub_console_getcolor): New function prototypes. + * include/VasEBoot/i386/pc/console.h: Include `'. + (VasEBoot_console_putchar, VasEBoot_console_getcharwidth, VasEBoot_console_getwh) + (VasEBoot_console_setcolorstate, VasEBoot_console_setcolor) + (VasEBoot_console_getcolor): New function prototypes. - * term/i386/pc/vga_text.c: Include `'. - (grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls) - (grub_vga_text_setcursor): Static-ize. - (grub_vga_text_term): New structure. - (GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions. + * term/i386/pc/vga_text.c: Include `'. + (VasEBoot_vga_text_getxy, VasEBoot_vga_text_gotoxy, VasEBoot_vga_text_cls) + (VasEBoot_vga_text_setcursor): Static-ize. + (VasEBoot_vga_text_term): New structure. + (VasEBoot_MOD_INIT(vga_text), VasEBoot_MOD_FINI(vga_text)): New functions. - * term/i386/pc/console.c: Remove `'. - (grub_console_cur_color, grub_console_standard_color) - (grub_console_normal_color, grub_console_highlight_color) - (map_char, grub_console_putchar, grub_console_getcharwidth) - (grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor) - (grub_console_getcolor): Move from here ... + * term/i386/pc/console.c: Remove `'. + (VasEBoot_console_cur_color, VasEBoot_console_standard_color) + (VasEBoot_console_normal_color, VasEBoot_console_highlight_color) + (map_char, VasEBoot_console_putchar, VasEBoot_console_getcharwidth) + (VasEBoot_console_getwh, VasEBoot_console_setcolorstate, VasEBoot_console_setcolor) + (VasEBoot_console_getcolor): Move from here ... * term/i386/vga_common.c: ... to here (same function names). 2008-11-12 Robert Millan @@ -42032,15 +42032,15 @@ (codestart): Store the MBI in `startup_multiboot_info' when we're being loaded using Multiboot. - * kern/i386/coreboot/init.c (grub_machine_init): Move - grub_at_keyboard_init() call to beginning of function (useful for - debugging). Call grub_machine_mmap_init() before attempting to use - grub_machine_mmap_iterate(). - (grub_lower_mem, grub_upper_mem): Move from here ... - * kern/i386/multiboot_mmap.c (grub_lower_mem, grub_upper_mem): ... to + * kern/i386/coreboot/init.c (VasEBoot_machine_init): Move + VasEBoot_at_keyboard_init() call to beginning of function (useful for + debugging). Call VasEBoot_machine_mmap_init() before attempting to use + VasEBoot_machine_mmap_iterate(). + (VasEBoot_lower_mem, VasEBoot_upper_mem): Move from here ... + * kern/i386/multiboot_mmap.c (VasEBoot_lower_mem, VasEBoot_upper_mem): ... to here (new file). - * include/grub/i386/coreboot/memory.h (grub_machine_mmap_init): New + * include/VasEBoot/i386/coreboot/memory.h (VasEBoot_machine_mmap_init): New function prototype. 2008-11-12 Robert Millan @@ -42050,26 +42050,26 @@ others, the first terminal being registered determines which is going to be default. - * kern/term.c (grub_term_register_input): If this is the first + * kern/term.c (VasEBoot_term_register_input): If this is the first terminal being registered, set it as the current one. - (grub_term_register_output): Likewise. + (VasEBoot_term_register_output): Likewise. - * term/efi/console.c (grub_console_init): Do not call - grub_term_set_current_output() or grub_term_set_current_input(). - * term/ieee1275/ofconsole.c (grub_console_init): Likewise. - * term/i386/pc/console.c (grub_console_init): Likewise. - (grub_console_fini): Do not call grub_term_set_current_input() - (but leave grub_term_set_current_output() to restore text mode). + * term/efi/console.c (VasEBoot_console_init): Do not call + VasEBoot_term_set_current_output() or VasEBoot_term_set_current_input(). + * term/ieee1275/ofconsole.c (VasEBoot_console_init): Likewise. + * term/i386/pc/console.c (VasEBoot_console_init): Likewise. + (VasEBoot_console_fini): Do not call VasEBoot_term_set_current_input() + (but leave VasEBoot_term_set_current_output() to restore text mode). 2008-11-10 Robert Millan - * util/grub.d/00_header.in: Add backward compatibility check for + * util/VasEBoot.d/00_header.in: Add backward compatibility check for versions of terminal.mod that don't understand `terminal_input' or `terminal_output'. 2008-11-09 Robert Millan - * commands/terminal.c (GRUB_MOD_FINI(terminal)): Unregister + * commands/terminal.c (VasEBoot_MOD_FINI(terminal)): Unregister `terminal_input' / `terminal_output', not `terminal'. 2008-11-08 Robert Millan @@ -42079,12 +42079,12 @@ 2008-11-08 Robert Millan - * term/i386/pc/vesafb.c (grub_vesafb_term): Change type to - `struct grub_term_output'. Remove `.checkkey' and `.getkey' + * term/i386/pc/vesafb.c (VasEBoot_vesafb_term): Change type to + `struct VasEBoot_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. - * util/console.c (grub_ncurses_term): Split in ... - (grub_ncurses_term_input): ... this, and ... - (grub_ncurses_term_output): ... this. Update all users. + * util/console.c (VasEBoot_ncurses_term): Split in ... + (VasEBoot_ncurses_term_input): ... this, and ... + (VasEBoot_ncurses_term_output): ... this. Update all users. * term/ieee1275/ofconsole.c: Remove stale `#endif'. 2008-11-08 Robert Millan @@ -42102,17 +42102,17 @@ * gendistlist.sh: Use C locale for sorting to ensure consistent output on all systems. - * util/grub.d/00_header.in: Remove incorrect space before + * util/VasEBoot.d/00_header.in: Remove incorrect space before "serial". 2008-11-07 Robert Millan * include/multiboot2.h (struct multiboot_header): Add `flags' member as per specification. - * loader/multiboot2.c (grub_multiboot2): Fix Multiboot2 header check. + * loader/multiboot2.c (VasEBoot_multiboot2): Fix Multiboot2 header check. * loader/multiboot_loader.c (find_multi_boot2_header): New function (based on find_multi_boot1_header). - (grub_rescue_cmd_multiboot_loader): Check for Multiboot2 header, + (VasEBoot_rescue_cmd_multiboot_loader): Check for Multiboot2 header, using find_multi_boot2_header(), and abort if neither Multiboot or Multiboot headers were found. @@ -42126,149 +42126,149 @@ Actual terminal split: - * include/grub/term.h (struct grub_term): Split in ... - (struct grub_term_input): ... this, and ... - (struct grub_term_output): ... this. Update all users. - (grub_term_set_current): Split in ... - (grub_term_set_current_input): ... this, and ... - (grub_term_set_current_output): ... this. - (grub_term_get_current): Split in ... - (grub_term_get_current_input): ... this, and ... - (grub_term_get_current_output): ... this. - (grub_term_register): Split in ... - (grub_term_register_input): ... this, and ... - (grub_term_register_output): ... this. - (grub_term_unregister): Split in ... - (grub_term_unregister_input): ... this, and ... - (grub_term_unregister_output): ... this. - (grub_term_iterate): Split in ... - (grub_term_iterate_input): ... this, and ... - (grub_term_iterate_output): ... this. + * include/VasEBoot/term.h (struct VasEBoot_term): Split in ... + (struct VasEBoot_term_input): ... this, and ... + (struct VasEBoot_term_output): ... this. Update all users. + (VasEBoot_term_set_current): Split in ... + (VasEBoot_term_set_current_input): ... this, and ... + (VasEBoot_term_set_current_output): ... this. + (VasEBoot_term_get_current): Split in ... + (VasEBoot_term_get_current_input): ... this, and ... + (VasEBoot_term_get_current_output): ... this. + (VasEBoot_term_register): Split in ... + (VasEBoot_term_register_input): ... this, and ... + (VasEBoot_term_register_output): ... this. + (VasEBoot_term_unregister): Split in ... + (VasEBoot_term_unregister_input): ... this, and ... + (VasEBoot_term_unregister_output): ... this. + (VasEBoot_term_iterate): Split in ... + (VasEBoot_term_iterate_input): ... this, and ... + (VasEBoot_term_iterate_output): ... this. - * kern/term.c (grub_term_list): Split in ... - (grub_term_list_input): ... this, and ... - (grub_term_list_output): ... this. Update all users. - (grub_cur_term): Split in ... - (grub_cur_term_input): ... this, and ... - (grub_cur_term_output): ... this. Update all users. - (grub_term_set_current): Split in ... - (grub_term_set_current_input): ... this, and ... - (grub_term_set_current_output): ... this. - (grub_term_get_current): Split in ... - (grub_term_get_current_input): ... this, and ... - (grub_term_get_current_output): ... this. - (grub_term_register): Split in ... - (grub_term_register_input): ... this, and ... - (grub_term_register_output): ... this. - (grub_term_unregister): Split in ... - (grub_term_unregister_input): ... this, and ... - (grub_term_unregister_output): ... this. - (grub_term_iterate): Split in ... - (grub_term_iterate_input): ... this, and ... - (grub_term_iterate_output): ... this. + * kern/term.c (VasEBoot_term_list): Split in ... + (VasEBoot_term_list_input): ... this, and ... + (VasEBoot_term_list_output): ... this. Update all users. + (VasEBoot_cur_term): Split in ... + (VasEBoot_cur_term_input): ... this, and ... + (VasEBoot_cur_term_output): ... this. Update all users. + (VasEBoot_term_set_current): Split in ... + (VasEBoot_term_set_current_input): ... this, and ... + (VasEBoot_term_set_current_output): ... this. + (VasEBoot_term_get_current): Split in ... + (VasEBoot_term_get_current_input): ... this, and ... + (VasEBoot_term_get_current_output): ... this. + (VasEBoot_term_register): Split in ... + (VasEBoot_term_register_input): ... this, and ... + (VasEBoot_term_register_output): ... this. + (VasEBoot_term_unregister): Split in ... + (VasEBoot_term_unregister_input): ... this, and ... + (VasEBoot_term_unregister_output): ... this. + (VasEBoot_term_iterate): Split in ... + (VasEBoot_term_iterate_input): ... this, and ... + (VasEBoot_term_iterate_output): ... this. - * kern/misc.c (grub_abort): Split use of grub_term_get_current() into + * kern/misc.c (VasEBoot_abort): Split use of VasEBoot_term_get_current() into a check for input and one for output (and only attempt to get keys from user when input works). - * util/grub-probe.c (grub_term_get_current): Split in ... - (grub_term_get_current_input): ... this, and ... - (grub_term_get_current_output): ... this. - * util/grub-fstest.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. - * util/grub-editenv.c: Likewise. + * util/VasEBoot-probe.c (VasEBoot_term_get_current): Split in ... + (VasEBoot_term_get_current_input): ... this, and ... + (VasEBoot_term_get_current_output): ... this. + * util/VasEBoot-fstest.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. Portability adjustments: * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Remove `term/i386/pc/at_keyboard.c'. - * kern/ieee1275/init.c [__i386__] (grub_machine_init): Remove call to - grub_keyboard_controller_init() (now handled by terminal .init). - * kern/i386/coreboot/init.c (grub_machine_init): Add call to - grub_at_keyboard_init(). - * include/grub/i386/ieee1275/console.h (grub_keyboard_controller_init) - (grub_console_checkkey, grub_console_getkey): Remove (now provided by + * kern/ieee1275/init.c [__i386__] (VasEBoot_machine_init): Remove call to + VasEBoot_keyboard_controller_init() (now handled by terminal .init). + * kern/i386/coreboot/init.c (VasEBoot_machine_init): Add call to + VasEBoot_at_keyboard_init(). + * include/VasEBoot/i386/ieee1275/console.h (VasEBoot_keyboard_controller_init) + (VasEBoot_console_checkkey, VasEBoot_console_getkey): Remove (now provided by at_keyboard.mod via input terminal interface). - * include/grub/i386/coreboot/console.h: Convert into a stub for - `'. + * include/VasEBoot/i386/coreboot/console.h: Convert into a stub for + `'. Migrate full terminals to new API: - * term/efi/console.c (grub_console_term): Split into ... - (grub_console_term_input): ... this, and ... - (grub_console_term_output): ... this. Update all users. + * term/efi/console.c (VasEBoot_console_term): Split into ... + (VasEBoot_console_term_input): ... this, and ... + (VasEBoot_console_term_output): ... this. Update all users. * term/ieee1275/ofconsole.c: Remove __i386__ hack. - (grub_ofconsole_init): Split into ... - (grub_ofconsole_init_input): ... this, and ... - (grub_ofconsole_init_output): ... this. - (grub_ofconsole_term): Split into ... - (grub_ofconsole_term_input): ... this, and ... - (grub_ofconsole_term_output): ... this. Update all users. - * term/i386/pc/serial.c (grub_serial_term): Split into ... - (grub_serial_term_input): ... this, and ... - (grub_serial_term_output): ... this. Update all users. - * term/i386/pc/console.c (grub_console_term): Split into ... - (grub_console_term_input): ... this, and ... - (grub_console_term_output): ... this. Update all users. - (grub_console_term_input): Only enable it on PC/BIOS platform. - (grub_console_init): Remove grub_keyboard_controller_init() call. + (VasEBoot_ofconsole_init): Split into ... + (VasEBoot_ofconsole_init_input): ... this, and ... + (VasEBoot_ofconsole_init_output): ... this. + (VasEBoot_ofconsole_term): Split into ... + (VasEBoot_ofconsole_term_input): ... this, and ... + (VasEBoot_ofconsole_term_output): ... this. Update all users. + * term/i386/pc/serial.c (VasEBoot_serial_term): Split into ... + (VasEBoot_serial_term_input): ... this, and ... + (VasEBoot_serial_term_output): ... this. Update all users. + * term/i386/pc/console.c (VasEBoot_console_term): Split into ... + (VasEBoot_console_term_input): ... this, and ... + (VasEBoot_console_term_output): ... this. Update all users. + (VasEBoot_console_term_input): Only enable it on PC/BIOS platform. + (VasEBoot_console_init): Remove VasEBoot_keyboard_controller_init() call. Migrate input terminals to new API: * term/i386/pc/at_keyboard.c: Replace `cpu' and `machine' with `i386' and `i386/pc' to enable build on x86_64 (this driver is i386-specific anyway). - (grub_console_checkkey): Rename to ... - (grub_at_keyboard_checkkey): ... this. Static-ize. Update all + (VasEBoot_console_checkkey): Rename to ... + (VasEBoot_at_keyboard_checkkey): ... this. Static-ize. Update all users. - (grub_keyboard_controller_orig): New variable. - (grub_console_getkey): Rename to ... - (grub_at_keyboard_getkey): ... this. Static-ize. Update all + (VasEBoot_keyboard_controller_orig): New variable. + (VasEBoot_console_getkey): Rename to ... + (VasEBoot_at_keyboard_getkey): ... this. Static-ize. Update all users. - (grub_keyboard_controller_init): Static-ize. Save original + (VasEBoot_keyboard_controller_init): Static-ize. Save original controller value so that it can be restored ... - (grub_keyboard_controller_fini): ... here (new function). - (grub_at_keyboard_term): New structure. - (GRUB_MOD_INIT(at_keyboard), GRUB_MOD_FINI(at_keyboard)): New + (VasEBoot_keyboard_controller_fini): ... here (new function). + (VasEBoot_at_keyboard_term): New structure. + (VasEBoot_MOD_INIT(at_keyboard), VasEBoot_MOD_FINI(at_keyboard)): New functions. Migrate output terminals to new API: - * term/i386/pc/vga.c (grub_vga_term): Change type to - `struct grub_term_output'. Remove `.checkkey' and `.getkey' + * term/i386/pc/vga.c (VasEBoot_vga_term): Change type to + `struct VasEBoot_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. - * term/gfxterm.c (grub_video_term): Change type to - `struct grub_term_output'. Remove `.checkkey' and `.getkey' + * term/gfxterm.c (VasEBoot_video_term): Change type to + `struct VasEBoot_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. - * include/grub/i386/pc/console.h (grub_console_checkkey) - (grub_console_getkey): Do not export (no longer needed by gfxterm, + * include/VasEBoot/i386/pc/console.h (VasEBoot_console_checkkey) + (VasEBoot_console_getkey): Do not export (no longer needed by gfxterm, etc). Migrate `terminal' command and userland tools to new API: - * commands/terminal.c (grub_cmd_terminal): Split into ... - (grub_cmd_terminal_input): ... this, and ... - (grub_cmd_terminal_output): ... this. - (GRUB_MOD_INIT(terminal)): Split `terminal' command in two commands: + * commands/terminal.c (VasEBoot_cmd_terminal): Split into ... + (VasEBoot_cmd_terminal_input): ... this, and ... + (VasEBoot_cmd_terminal_output): ... this. + (VasEBoot_MOD_INIT(terminal)): Split `terminal' command in two commands: `terminal_input' and `terminal_output'. - * util/grub.d/00_header.in: Adjust `terminal' calls to new + * util/VasEBoot.d/00_header.in: Adjust `terminal' calls to new `terminal_input' / `terminal_output' API. - * util/grub-mkconfig.in: Export ${GRUB_TERMINAL_INPUT} and - ${GRUB_TERMINAL_OUTPUT} instead of ${GRUB_TERMINAL} (and if user - provided ${GRUB_TERMINAL}, convert it). + * util/VasEBoot-mkconfig.in: Export ${VasEBoot_TERMINAL_INPUT} and + ${VasEBoot_TERMINAL_OUTPUT} instead of ${VasEBoot_TERMINAL} (and if user + provided ${VasEBoot_TERMINAL}, convert it). 2008-11-04 Robert Millan - * util/grub.d/10_freebsd.in: New file. Generate grub configuration + * util/VasEBoot.d/10_freebsd.in: New file. Generate VasEBoot configuration for FreeBSD. - * conf/common.rmk (grub-mkconfig_SCRIPTS): Add 10_freebsd. + * conf/common.rmk (VasEBoot-mkconfig_SCRIPTS): Add 10_freebsd. 2008-11-03 Bean - * kern/elf.c (grub_elf32_load): Revert to previous code. - (grub_elf64_load): Likewise. + * kern/elf.c (VasEBoot_elf32_load): Revert to previous code. + (VasEBoot_elf64_load): Likewise. - * loader/i386/bsd.c (grub_bsd_elf32_hook): Change return address. + * loader/i386/bsd.c (VasEBoot_bsd_elf32_hook): Change return address. 2008-11-01 Robert Millan @@ -42282,139 +42282,139 @@ 2008-10-29 Guillem Jover - * disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the + * disk/lvm.c (VasEBoot_lvm_scan_device): Fix error recovery by delaying the addition of objects until the code is not going to be able to fail. 2008-10-29 Guillem Jover - * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling + * disk/lvm.c (VasEBoot_lvm_scan_device): Fix possible NULL value handling (add a missing NULL check, and correct them by moving the pointer operations after the actual check). 2008-10-29 Robert Millan - * util/i386/pc/grub-install.in: Handle empty string as output from + * util/i386/pc/VasEBoot-install.in: Handle empty string as output from make_system_path_relative_to_its_root(). 2008-10-05 Hans Lambermont - * disk/lvm.c (grub_lvm_scan_device): Allocate buffer space for the + * disk/lvm.c (VasEBoot_lvm_scan_device): Allocate buffer space for the circular metadata worst case scenario. If the metadata is circular then copy the wrap in place. - * include/grub/lvm.h: Add GRUB_LVM_MDA_HEADER_SIZE, from the LVM2 + * include/VasEBoot/lvm.h: Add VasEBoot_LVM_MDA_HEADER_SIZE, from the LVM2 project lib/format_text/layout.h Circular metadata bug found and patch debugged by Jan Derk Gerlings. 2008-10-03 Felix Zielcke - * util/i386/pc/grub-install.in: Source grub-mkconfig_lib instead of update-grub_lib. + * util/i386/pc/VasEBoot-install.in: Source VasEBoot-mkconfig_lib instead of update-VasEBoot_lib. 2008-10-03 Felix Zielcke - * util/update-grub_lib.in: Mention filename in warning message. + * util/update-VasEBoot_lib.in: Mention filename in warning message. 2008-09-29 Felix Zielcke - * NEWS: Update for rename of update-grub to grub-mkconfig. + * NEWS: Update for rename of update-VasEBoot to VasEBoot-mkconfig. 2008-09-29 Felix Zielcke - * util/update-grub_lib.in: Copy to ... - * util/grub-mkconfig_lib.in: ... this. Update all users. - * util/update-grub_lib.in: Make it a stub to `grub-mkconfig_lib.in'. - * util/update-grub.in: Rename to ... - * util/grub-mkconfig.in: ... this. Update all users. Remove `-y' + * util/update-VasEBoot_lib.in: Copy to ... + * util/VasEBoot-mkconfig_lib.in: ... this. Update all users. + * util/update-VasEBoot_lib.in: Make it a stub to `VasEBoot-mkconfig_lib.in'. + * util/update-VasEBoot.in: Rename to ... + * util/VasEBoot-mkconfig.in: ... this. Update all users. Remove `-y' option. Add `--output' option to allow users to specify the generated configuration file. Default to stdout. - (update_grub_dir): Rename to ... - (grub_mkconfig_dir): ... this. - (grub_cfg): Default to an empty string. - * conf/common.rmk (update-grub): Rename to ... - (grub-mkconfig): ... this. - (update-grub_lib): Copy to ... - (grub-mkconfig_lib): ... this. - (update-grub_SCRIPTS): Copy to ... - (grub-mkconfig_SCRIPTS): ... this. Update all users. - (update-grub_DATA): Rename to ... - (grub-mkconfig_DATA): ... this. + (update_VasEBoot_dir): Rename to ... + (VasEBoot_mkconfig_dir): ... this. + (VasEBoot_cfg): Default to an empty string. + * conf/common.rmk (update-VasEBoot): Rename to ... + (VasEBoot-mkconfig): ... this. + (update-VasEBoot_lib): Copy to ... + (VasEBoot-mkconfig_lib): ... this. + (update-VasEBoot_SCRIPTS): Copy to ... + (VasEBoot-mkconfig_SCRIPTS): ... this. Update all users. + (update-VasEBoot_DATA): Rename to ... + (VasEBoot-mkconfig_DATA): ... this. 2008-09-28 Robert Millan - * fs/iso9660.c (struct grub_iso9660_primary_voldesc): Rename `created' + * fs/iso9660.c (struct VasEBoot_iso9660_primary_voldesc): Rename `created' to `modified'. Add the real `created' field. - (grub_iso9660_uuid): Use `modified' rather than `created' for + (VasEBoot_iso9660_uuid): Use `modified' rather than `created' for constructing the UUID. 2008-09-28 Felix Zielcke - fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one. + fs/jfs.c (VasEBoot_jfs_find_file): Treat multiple slashes like one. Based on code from Tomas Ebenlendr . 2008-09-28 Bean - * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a bug in the previous patch. + * fs/ntfs.c (VasEBoot_ntfs_iterate_dir): Fix a bug in the previous patch. Thanks to Christian Franke for finding this bug. 2008-09-25 Robert Millan - * util/grub-mkdevicemap.c (make_device_map): Actually replace all - instances of grub_util_get_disk_name() (see previous commit). + * util/VasEBoot-mkdevicemap.c (make_device_map): Actually replace all + instances of VasEBoot_util_get_disk_name() (see previous commit). 2008-09-25 Robert Millan - * conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Remove + * conf/i386-pc.rmk (VasEBoot_mkdevicemap_SOURCES): Remove `util/i386/get_disk_name.c'. * conf/i386-efi.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. - * conf/powerpc-ieee1275.rmk (grub_mkdevicemap_SOURCES): Remove + * conf/powerpc-ieee1275.rmk (VasEBoot_mkdevicemap_SOURCES): Remove `util/ieee1275/get_disk_name.c'. - * include/grub/util/misc.h (grub_util_get_disk_name): Remove. + * include/VasEBoot/util/misc.h (VasEBoot_util_get_disk_name): Remove. * util/ieee1275/get_disk_name.c: Remove file. * util/i386/get_disk_name.c: Remove file. - * util/grub-mkdevicemap.c (make_device_map): Back to hardcoding + * util/VasEBoot-mkdevicemap.c (make_device_map): Back to hardcoding "hd%d" for device.map entries, rather than using - grub_util_get_disk_name(). + VasEBoot_util_get_disk_name(). 2008-09-24 Carles Pina i Estany - * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Fix `unused parameter' + * disk/dmraid_nvidia.c (VasEBoot_dmraid_nv_detect): Fix `unused parameter' warning. * commands/i386/pc/pxecmd.c (dmraid_nvidia): Likewise. 2008-09-24 Carles Pina i Estany - * include/grub/i386/pc/console.h (GRUB_TERM_NPAGE): + * include/VasEBoot/i386/pc/console.h (VasEBoot_TERM_NPAGE): Changed to 0x5100. - (GRUB_TERM_PPAGE): Changed to 0x4900. + (VasEBoot_TERM_PPAGE): Changed to 0x4900. 2008-09-24 Robert Millan - * include/grub/powerpc/ieee1275/console.h (GRUB_CONSOLE_KEY_*): Remove + * include/VasEBoot/powerpc/ieee1275/console.h (VasEBoot_CONSOLE_KEY_*): Remove macros (they were i386-pc specific). - * include/grub/sparc64/ieee1275/console.h: Likewise. - * include/grub/efi/console.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/console.h: Likewise. + * include/VasEBoot/efi/console.h: Likewise. 2008-09-22 Bean - * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a rare case where $BITMAP is + * fs/ntfs.c (VasEBoot_ntfs_iterate_dir): Fix a rare case where $BITMAP is resident and in attribute list. - * include/grub/ntfs.h (BMP_LEN): Removed. + * include/VasEBoot/ntfs.h (BMP_LEN): Removed. 2008-09-22 Bean - * disk/ata.c (grub_atapi_open): Initialize devfnd, no need to set - scsi->name and scsi->luns, as they will be set in grub_scsi_open. + * disk/ata.c (VasEBoot_atapi_open): Initialize devfnd, no need to set + scsi->name and scsi->luns, as they will be set in VasEBoot_scsi_open. - * disk/scsi.c (grub_scsi_open): Don't call p->close (scsi) here when - error occurs, as grub_disk_open will call grub_disk_close, which will + * disk/scsi.c (VasEBoot_scsi_open): Don't call p->close (scsi) here when + error occurs, as VasEBoot_disk_open will call VasEBoot_disk_close, which will call p->close (scsi). 2008-09-21 Felix Zielcke - * configure.ac (AC_INIT): Quote `GRUB' string and version number. + * configure.ac (AC_INIT): Quote `VasEBoot' string and version number. (AC_PREREQ): Bumped to 2.59. (AC_TRY_COMPILE): Replace obsolete macro with ... (AC_COMPILE_IFELSE): ... this. @@ -42427,9 +42427,9 @@ 2008-09-19 Christian Franke - * aclocal.m4 (grub_CHECK_ENABLE_EXECUTE_STACK): New function. - * configure.ac: Call grub_CHECK_ENABLE_EXECUTE_STACK. - * include/grub/misc.h [NEED_ENABLE_EXECUTE_STACK]: + * aclocal.m4 (VasEBoot_CHECK_ENABLE_EXECUTE_STACK): New function. + * configure.ac: Call VasEBoot_CHECK_ENABLE_EXECUTE_STACK. + * include/VasEBoot/misc.h [NEED_ENABLE_EXECUTE_STACK]: Export __enable_execute_stack() to modules. * kern/misc.c [NEED_ENABLE_EXECUTE_STACK] (__enable_execute_stack): New function. @@ -42441,27 +42441,27 @@ 2008-09-09 Felix Zielcke - * util/hostdisk.c: Replace #include with - #include . + * util/hostdisk.c: Replace #include with + #include . 2008-09-08 Robert Millan - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Skip - segments when their filesz is zero (grub_file_read() interprets + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): Skip + segments when their filesz is zero (VasEBoot_file_read() interprets zero-size as "read until EOF", which results in memory corruption). Use `lowest_segment' rather than 0 for calculating the current segment load address. 2008-09-08 Robert Millan - * util/hostdisk.c (open_device): Replace a grub_util_info() call - with grub_dprintf("hostdisk", ...), as it was so verbose that it + * util/hostdisk.c (open_device): Replace a VasEBoot_util_info() call + with VasEBoot_dprintf("hostdisk", ...), as it was so verbose that it clobbered useful information. 2008-09-08 Robert Millan - * include/grub/util/biosdisk.h: Move to ... - * include/grub/util/hostdisk.h: ... here. Update all users. + * include/VasEBoot/util/biosdisk.h: Move to ... + * include/VasEBoot/util/hostdisk.h: ... here. Update all users. * util/biosdisk.c: Move to ... * util/hostdisk.c: ... here. Update all users. @@ -42469,7 +42469,7 @@ * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): Remove variables. - (grub_multiboot): Move `mbi' allocation upwards, so that mmap address + (VasEBoot_multiboot): Move `mbi' allocation upwards, so that mmap address and length can be stored directly in the `mbi->mmap_addr' and `mbi->mmap_length' struct fields. @@ -42491,97 +42491,97 @@ Based on patch created by Colin D Bennett . Adds optimization support for BGR based modes. - * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. - (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8): Likewise. - (grub_video_i386_vbeblit_index_index): Likewise. - (grub_video_i386_vbeblit_replace_directN): Added. - (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. - (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. - (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. - (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. - (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. + * include/VasEBoot/i386/pc/vbeblit.h (VasEBoot_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. + (VasEBoot_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8A8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_index_index): Likewise. + (VasEBoot_video_i386_vbeblit_replace_directN): Added. + (VasEBoot_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_index_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_index_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_index_RGBA8888): Likewise. - * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. - (grub_video_i386_vbefill_R8G8B8): Likewise. - (grub_video_i386_vbefill_index): Likewise. - (grub_video_i386_vbefill_direct32): Added. - (grub_video_i386_vbefill_direct24): Likewise. - (grub_video_i386_vbefill_direct16): Likewise. - (grub_video_i386_vbefill_direct8): Likewise. + * include/VasEBoot/i386/pc/vbefill.h (VasEBoot_video_i386_vbefill_R8G8B8A8) Removed. + (VasEBoot_video_i386_vbefill_R8G8B8): Likewise. + (VasEBoot_video_i386_vbefill_index): Likewise. + (VasEBoot_video_i386_vbefill_direct32): Added. + (VasEBoot_video_i386_vbefill_direct24): Likewise. + (VasEBoot_video_i386_vbefill_direct16): Likewise. + (VasEBoot_video_i386_vbefill_direct8): Likewise. - * include/grub/video.h (grub_video_blit_format): Removed - GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. - (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, - GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, - GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, - GRUB_VIDEO_BLIT_FORMAT_BGR_565. + * include/VasEBoot/video.h (VasEBoot_video_blit_format): Removed + VasEBoot_VIDEO_BLIT_FORMAT_R8G8B8A8, VasEBoot_VIDEO_BLIT_FORMAT_R8G8B8. + (VasEBoot_video_blit_format): Added VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888, + VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888, VasEBoot_VIDEO_BLIT_FORMAT_RGB_888, + VasEBoot_VIDEO_BLIT_FORMAT_BGR_888, VasEBoot_VIDEO_BLIT_FORMAT_RGB_565, + VasEBoot_VIDEO_BLIT_FORMAT_BGR_565. - * video/video.c (grub_video_get_blit_format): Updated to use new + * video/video.c (VasEBoot_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. - * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new + * video/i386/pc/vbe.c (VasEBoot_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. - * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): + * video/i386/pc/vbeblit.c (VasEBoot_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. - (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8): Likewise. - (grub_video_i386_vbeblit_index_index): Likewise. - (grub_video_i386_vbeblit_replace_directN): Added. - (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. - (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. - (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. - (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. - (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. - (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8A8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_index_index): Likewise. + (VasEBoot_video_i386_vbeblit_replace_directN): Added. + (VasEBoot_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_index_RGBX8888): Likewise. + (VasEBoot_video_i386_vbeblit_replace_index_RGB888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. + (VasEBoot_video_i386_vbeblit_blend_index_RGBA8888): Likewise. - * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. - (grub_video_i386_vbefill_R8G8B8): Likewise. - (grub_video_i386_vbefill_index): Likewise. - (grub_video_i386_vbefill_direct32): Added. - (grub_video_i386_vbefill_direct24): Likewise. - (grub_video_i386_vbefill_direct16): Likewise. - (grub_video_i386_vbefill_direct8): Likewise. + * video/i386/pc/vbefill.c (VasEBoot_video_i386_vbefill_R8G8B8A8): Removed. + (VasEBoot_video_i386_vbefill_R8G8B8): Likewise. + (VasEBoot_video_i386_vbefill_index): Likewise. + (VasEBoot_video_i386_vbefill_direct32): Added. + (VasEBoot_video_i386_vbefill_direct24): Likewise. + (VasEBoot_video_i386_vbefill_direct16): Likewise. + (VasEBoot_video_i386_vbefill_direct8): Likewise. - * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter + * video/readers/jpeg.c (VasEBoot_jpeg_decode_sos): Adapt to new blitter types. - * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter + * video/readers/tga.c (VasEBoot_video_reader_tga): Adapt to new blitter types. - * video/readers/png.c (grub_png_decode_image_header): Adapt to new + * video/readers/png.c (VasEBoot_png_decode_image_header): Adapt to new blitter types. - * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter + * video/bitmap.c (VasEBoot_video_bitmap_create): Adapt to new blitter types. 2008-09-06 Felix Zielcke @@ -42591,25 +42591,25 @@ 2008-09-06 Felix Zielcke - * fs/iso9660.c (grub_iso9660_date): New structure. - (grub_iso9660_primary_voldesc): Add `grub_iso9660_date' member. - (grub_iso9660_uuid): New function. + * fs/iso9660.c (VasEBoot_iso9660_date): New structure. + (VasEBoot_iso9660_primary_voldesc): Add `VasEBoot_iso9660_date' member. + (VasEBoot_iso9660_uuid): New function. 2008-09-05 Bean - * fs/fshelp.c (grub_fshelp_find_file): Handle case insensitive names. + * fs/fshelp.c (VasEBoot_fshelp_find_file): Handle case insensitive names. * fs/ntfs.c (list_file): Ignore names in DOS namespace, set the case insensitive bit for names in Win32 and Win32 & DOS namespace. - * include/grub/fshelp.h (GRUB_FSHELP_CASE_INSENSITIVE): New macro. + * include/VasEBoot/fshelp.h (VasEBoot_FSHELP_CASE_INSENSITIVE): New macro. - * include/grub/types.h (LONG_MAX): Likewise. + * include/VasEBoot/types.h (LONG_MAX): Likewise. 2008-09-04 Felix Zielcke * util/getroot.c: Include . - (grub_util_get_grub_dev): Rewrite to use asprintf for mdraid devices, + (VasEBoot_util_get_VasEBoot_dev): Rewrite to use asprintf for mdraid devices, add support for /dev/md/N devices and handle LVM double dash escaping. 2008-09-04 Felix Zielcke @@ -42619,44 +42619,44 @@ 2008-09-03 Robert Millan - * disk/scsi.c (grub_scsi_open): Remove size limit when printing + * disk/scsi.c (VasEBoot_scsi_open): Remove size limit when printing `disk->total_sectors'. 2008-09-01 Colin D Bennett - * include/grub/normal.h: Fixed incorrect comment for - GRUB_COMMAND_FLAG_NO_ARG_PARSE. + * include/VasEBoot/normal.h: Fixed incorrect comment for + VasEBoot_COMMAND_FLAG_NO_ARG_PARSE. 2008-09-01 Colin D Bennett - * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Replaced constant + * commands/i386/pc/vbeinfo.c (VasEBoot_cmd_vbeinfo): Replaced constant values with defines. - * include/grub/i386/pc/vbe.h (GRUB_VBE_MODEATTR_SUPPORTED): Added. - (GRUB_VBE_MODEATTR_RESERVED_1): Likewise. - (GRUB_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT): Likewise. - (GRUB_VBE_MODEATTR_COLOR): Likewise. - (GRUB_VBE_MODEATTR_GRAPHICS): Likewise. - (GRUB_VBE_MODEATTR_VGA_COMPATIBLE): Likewise. - (GRUB_VBE_MODEATTR_VGA_WINDOWED_AVAIL): Likewise. - (GRUB_VBE_MODEATTR_LFB_AVAIL): Likewise. - (GRUB_VBE_MODEATTR_DOUBLE_SCAN_AVAIL): Likewise. - (GRUB_VBE_MODEATTR_INTERLACED_AVAIL): Likewise. - (GRUB_VBE_MODEATTR_TRIPLE_BUF_AVAIL): Likewise. - (GRUB_VBE_MODEATTR_STEREO_AVAIL): Likewise. - (GRUB_VBE_MODEATTR_DUAL_DISPLAY_START): Likewise. - (GRUB_VBE_MEMORY_MODEL_TEXT): Likewise. - (GRUB_VBE_MEMORY_MODEL_CGA): Likewise. - (GRUB_VBE_MEMORY_MODEL_HERCULES): Likewise. - (GRUB_VBE_MEMORY_MODEL_PLANAR): Likewise. - (GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256): Likewise. - (GRUB_VBE_MEMORY_MODEL_YUV): Likewise. + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_VBE_MODEATTR_SUPPORTED): Added. + (VasEBoot_VBE_MODEATTR_RESERVED_1): Likewise. + (VasEBoot_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT): Likewise. + (VasEBoot_VBE_MODEATTR_COLOR): Likewise. + (VasEBoot_VBE_MODEATTR_GRAPHICS): Likewise. + (VasEBoot_VBE_MODEATTR_VGA_COMPATIBLE): Likewise. + (VasEBoot_VBE_MODEATTR_VGA_WINDOWED_AVAIL): Likewise. + (VasEBoot_VBE_MODEATTR_LFB_AVAIL): Likewise. + (VasEBoot_VBE_MODEATTR_DOUBLE_SCAN_AVAIL): Likewise. + (VasEBoot_VBE_MODEATTR_INTERLACED_AVAIL): Likewise. + (VasEBoot_VBE_MODEATTR_TRIPLE_BUF_AVAIL): Likewise. + (VasEBoot_VBE_MODEATTR_STEREO_AVAIL): Likewise. + (VasEBoot_VBE_MODEATTR_DUAL_DISPLAY_START): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_TEXT): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_CGA): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_HERCULES): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_PLANAR): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_NONCHAIN4_256): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_YUV): Likewise. 2008-08-31 Robert Millan - * loader/i386/pc/multiboot.c (grub_get_multiboot_mmap_len): Fix + * loader/i386/pc/multiboot.c (VasEBoot_get_multiboot_mmap_len): Fix declaration. - (grub_multiboot): Fix a few warnings. + (VasEBoot_multiboot): Fix a few warnings. 2008-08-31 Robert Millan @@ -42670,11 +42670,11 @@ 2008-08-31 Colin D Bennett - * util/i386/pc/grub-mkrescue.in: Support multiple overlay directories. + * util/i386/pc/VasEBoot-mkrescue.in: Support multiple overlay directories. 2008-08-31 Colin D Bennett - * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Show VBE version and + * commands/i386/pc/vbeinfo.c (VasEBoot_cmd_vbeinfo): Show VBE version and total video memory in 'vbeinfo' output; show color format details for each video mode. @@ -42696,43 +42696,43 @@ * conf/powerpc-ieee1275.rmk: Adjust for the above. * DISTLIST: Likewise. - * kern/powerpc/ieee1275/crt0.S: Include grub/symbol.h and - grub/cpu/kernel.h. Add start label for consistency with other - platforms. Add grub_prefix immediately after start. Add jump - to the code after grub_prefix. - * include/grub/powerpc/kernel.h: Provide valid values for - GRUB_KERNEL_CPU_PREFIX and GRUB_KERNEL_CPU_DATA_END. + * kern/powerpc/ieee1275/crt0.S: Include VasEBoot/symbol.h and + VasEBoot/cpu/kernel.h. Add start label for consistency with other + platforms. Add VasEBoot_prefix immediately after start. Add jump + to the code after VasEBoot_prefix. + * include/VasEBoot/powerpc/kernel.h: Provide valid values for + VasEBoot_KERNEL_CPU_PREFIX and VasEBoot_KERNEL_CPU_DATA_END. 2008-08-29 Bean * configure.ac: Change host_os to cygwin for mingw. (asprintf): New check for function. - * include/grub/symbol.h: Replace #ifndef __CYGWIN__ with + * include/VasEBoot/symbol.h: Replace #ifndef __CYGWIN__ with #if ! defined (__CYGWIN__) && ! defined (__MINGW32__). - * include/grub/util/misc.h: #include and , + * include/VasEBoot/util/misc.h: #include and , declare asprintf if HAVE_ASPRINTF is not set, declare fseeko, ftello, - sync, sleep and grub_util_get_disk_size for mingw. + sync, sleep and VasEBoot_util_get_disk_size for mingw. - * util/biosdisk.c (grub_util_biosdisk_open): Use grub_util_get_disk_size + * util/biosdisk.c (VasEBoot_util_biosdisk_open): Use VasEBoot_util_get_disk_size to get size in mingw. (open_device): Use flag O_BINARY if it's defined. (find_root_device): Add dummy code for mingw. - * util/grub-mkdevicemap.c (get_floppy_disk_name): Return 0 for mingw. + * util/VasEBoot-mkdevicemap.c (get_floppy_disk_name): Return 0 for mingw. (get_ide_disk_name): Return //./PHYSICALDRIVE%d for mingw. (get_scsi_disk_name): Return 0 for mingw. - * util/hostfs.c: #include . - (grub_hostfs_open): Use "rb" flag to open file, use - grub_util_get_disk_size to get disk size for mingw. + * util/hostfs.c: #include . + (VasEBoot_hostfs_open): Use "rb" flag to open file, use + VasEBoot_util_get_disk_size to get disk size for mingw. * util/misc.c: #include and in mingw. (asprintf): New function if HAVE_ASPRINTF is not set. (sync): New function for mingw. (sleep): Likewise. - (grub_util_get_disk_size): Likewise. + (VasEBoot_util_get_disk_size): Likewise. 2008-08-28 Pavel Roskin @@ -42741,14 +42741,14 @@ 2008-08-28 Robert Millan - * util/biosdisk.c (find_grub_drive): Declare missing `i' variable. + * util/biosdisk.c (find_VasEBoot_drive): Declare missing `i' variable. 2008-08-28 Robert Millan - Change find_grub_drive() syntax so it doesn't prevent it from + Change find_VasEBoot_drive() syntax so it doesn't prevent it from detecting NULL names as errors. - * util/biosdisk.c (find_grub_drive): Move free slot search code + * util/biosdisk.c (find_VasEBoot_drive): Move free slot search code from here ... (find_free_slot): ... to here. (read_device_map): Use find_free_slot() to search for free slots. @@ -42762,41 +42762,41 @@ * disk/scsi.c: New file. - * include/grub/scsi.h: Likewise. + * include/VasEBoot/scsi.h: Likewise. - * include/grub/scsicmd.h: Likewise. + * include/VasEBoot/scsicmd.h: Likewise. - * disk/ata.c: Include . - (grub_atapi_packet): Do not use grub_ata_cmd, use registers + * disk/ata.c: Include . + (VasEBoot_atapi_packet): Do not use VasEBoot_ata_cmd, use registers instead. - (grub_ata_iterate): Skip ATAPI devices. - (grub_ata_open): Only handle ATAPI devices. - (struct grub_atapi_read): Removed. - (grub_atapi_readsector): Likewise. - (grub_ata_read): No longer handle ATAPI devices. - (grub_ata_write): Likewise. - (grub_atapi_iterate): New function. - (grub_atapi_read): Likewise. - (grub_atapi_write): Likewise. - (grub_atapi_open): Likewise. - (grub_atapi_close): Likewise. - (grub_atapi_dev): New variable. - (GRUB_MOD_INIT(ata)): Register ATAPI as SCSI device. - (GRUB_MOD_FINI(ata)): Unregister ATAPI. + (VasEBoot_ata_iterate): Skip ATAPI devices. + (VasEBoot_ata_open): Only handle ATAPI devices. + (struct VasEBoot_atapi_read): Removed. + (VasEBoot_atapi_readsector): Likewise. + (VasEBoot_ata_read): No longer handle ATAPI devices. + (VasEBoot_ata_write): Likewise. + (VasEBoot_atapi_iterate): New function. + (VasEBoot_atapi_read): Likewise. + (VasEBoot_atapi_write): Likewise. + (VasEBoot_atapi_open): Likewise. + (VasEBoot_atapi_close): Likewise. + (VasEBoot_atapi_dev): New variable. + (VasEBoot_MOD_INIT(ata)): Register ATAPI as SCSI device. + (VasEBoot_MOD_FINI(ata)): Unregister ATAPI. - * include/grub/disk.h (enum grub_disk_dev_id): Add - `GRUB_DISK_DEVICE_SCSI_ID'. + * include/VasEBoot/disk.h (enum VasEBoot_disk_dev_id): Add + `VasEBoot_DISK_DEVICE_SCSI_ID'. 2008-08-26 Robert Millan - * util/biosdisk.c (grub_util_biosdisk_open, open_device) - (grub_util_biosdisk_get_grub_dev): Make error messages a bit more + * util/biosdisk.c (VasEBoot_util_biosdisk_open, open_device) + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Make error messages a bit more descriptive. 2008-08-23 Bean - * conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c. - (grub_fstest_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, + * conf/common.rmk (VasEBoot_probe_SOURCES): Add disk/mdraid_linux.c. + (VasEBoot_fstest_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c and lib/crc.c. (pkglib_MODULES): Add raid5rec.mod, raid6rec.mod, mdraid.mod and dm_nv.mod. @@ -42813,20 +42813,20 @@ (dm_nv_mod_CFLAGS): Likewise. (dm_nv_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add disk/mdraid_linux.c. - (grub_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add disk/mdraid_linux.c. + (VasEBoot_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add disk/raid5_recover.c, + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. * disk/raid5_recover.c: New file. @@ -42839,30 +42839,30 @@ * disk/i386/pc/biosdisk.c: Set total_sectors of cdrom device to ULONG_MAX. - * disk/raid.c (grub_raid_open): Use the size of the smallest disk to + * disk/raid.c (VasEBoot_raid_open): Use the size of the smallest disk to calculate the size of raid device. - (grub_raid_read): Simplify raid0 code. Support raid4, raid6 and four + (VasEBoot_raid_read): Simplify raid0 code. Support raid4, raid6 and four different layout of raid5. - (grub_raid_scan_device): Remove code specific to mdraid. - (grub_raid_list): New variable. + (VasEBoot_raid_scan_device): Remove code specific to mdraid. + (VasEBoot_raid_list): New variable. (free_array): New function. - (grub_raid_register): Likewise. - (grub_raid_unregister): Likewise. - (grub_raid_rescan): Likewise. - (GRUB_MOD_INIT): Don't iterate device here. - (GRUB_MOD_FINI): Use free_array to release resource. + (VasEBoot_raid_register): Likewise. + (VasEBoot_raid_unregister): Likewise. + (VasEBoot_raid_rescan): Likewise. + (VasEBoot_MOD_INIT): Don't iterate device here. + (VasEBoot_MOD_FINI): Use free_array to release resource. - * include/grub/raid.h: Remove macro and structure specific to mdraid. - (grub_raid5_recover_func_t): New function variable type. - (grub_raid6_recover_func_t): Likewise. - (grub_raid5_recover_func): New variable. - (grub_raid6_recover_func): Likewise. - (grub_raid_register): New function. - (grub_raid_unregister): Likewise. - (grub_raid_rescan): Likewise. - (grub_raid_block_xor): Likewise. + * include/VasEBoot/raid.h: Remove macro and structure specific to mdraid. + (VasEBoot_raid5_recover_func_t): New function variable type. + (VasEBoot_raid6_recover_func_t): Likewise. + (VasEBoot_raid5_recover_func): New variable. + (VasEBoot_raid6_recover_func): Likewise. + (VasEBoot_raid_register): New function. + (VasEBoot_raid_unregister): Likewise. + (VasEBoot_raid_rescan): Likewise. + (VasEBoot_raid_block_xor): Likewise. - * util/grub-fstest.c: Add #include and . + * util/VasEBoot-fstest.c: Add #include and . (CMD_CRC): New macro. (part): Removed. (read_file): Handle device as well as file. @@ -42873,11 +42873,11 @@ (main): Find the first non option entry and ignore subsequent options, add handling for the new options, support multiple disks. - * util/grub-probe.c (probe): Add mdraid to abstraction_name. + * util/VasEBoot-probe.c (probe): Add mdraid to abstraction_name. 2008-08-23 Bean - * normal/x86_64/setjmp.S (grub_longjmp): Return 1 when val = 0. + * normal/x86_64/setjmp.S (VasEBoot_longjmp): Return 1 when val = 0. * genfslist.sh: Ignore kernel.mod. @@ -42890,13 +42890,13 @@ 2008-08-22 Felix Zielcke - * util/update-grub.in (GRUB_GFXMODE): Export variable. - * util/grub.d/00_header.in: Allow the administrator to change default - gfxmode via ${GRUB_GFXMODE}. + * util/update-VasEBoot.in (VasEBoot_GFXMODE): Export variable. + * util/VasEBoot.d/00_header.in: Allow the administrator to change default + gfxmode via ${VasEBoot_GFXMODE}. 2008-08-21 Felix Zielcke - * fs/ntfs.c (grub_ntfs_mount): Fix a memory leak. + * fs/ntfs.c (VasEBoot_ntfs_mount): Fix a memory leak. 2008-08-21 Robert Millan @@ -42908,13 +42908,13 @@ 2008-08-20 Carles Pina i Estany * menu/normal.c (run_menu): Replace hardcoded numbers with macros - (16 for GRUB_TERM_UP and 14 for GRUB_TERM_DOWN) + (16 for VasEBoot_TERM_UP and 14 for VasEBoot_TERM_DOWN) 2008-08-19 Robert Millan * term/gfxterm.c (DEFAULT_CURSOR_COLOR): Remove. - (struct grub_virtual_screen): Remove `cursor_color'. - (grub_virtual_screen_setup): Remove `virtual_screen.cursor_color' + (struct VasEBoot_virtual_screen): Remove `cursor_color'. + (VasEBoot_virtual_screen_setup): Remove `virtual_screen.cursor_color' initialization. (write_cursor): Use `virtual_screen.fg_color' to draw cursor. @@ -42928,73 +42928,73 @@ 2008-08-18 Robert Millan - * include/grub/i386/linux.h (LINUX_LOADER_ID_LILO) + * include/VasEBoot/i386/linux.h (LINUX_LOADER_ID_LILO) (LINUX_LOADER_ID_LOADLIN, LINUX_LOADER_ID_BOOTSECT) (LINUX_LOADER_ID_SYSLINUX, LINUX_LOADER_ID_ETHERBOOT) - (LINUX_LOADER_ID_ELILO, LINUX_LOADER_ID_GRUB, LINUX_LOADER_ID_UBOOT) + (LINUX_LOADER_ID_ELILO, LINUX_LOADER_ID_VasEBoot, LINUX_LOADER_ID_UBOOT) (LINUX_LOADER_ID_XEN, LINUX_LOADER_ID_GUJIN, LINUX_LOADER_ID_QEMU): New macros. - (GRUB_LINUX_CL_OFFSET, GRUB_LINUX_CL_END_OFFSET): Move from here ... - * loader/i386/pc/linux.c (GRUB_LINUX_CL_OFFSET) - (GRUB_LINUX_CL_END_OFFSET): ... to here. - * loader/i386/efi/linux.c (GRUB_EFI_CL_OFFSET): Rename to ... - (GRUB_LINUX_CL_OFFSET): ... this. Update all users. - (GRUB_EFI_CL_END_OFFSET): Rename to ... - (GRUB_LINUX_CL_END_OFFSET): ... this. Update all users. - (grub_rescue_cmd_linux): Macroify `type_of_loader' initialization. + (VasEBoot_LINUX_CL_OFFSET, VasEBoot_LINUX_CL_END_OFFSET): Move from here ... + * loader/i386/pc/linux.c (VasEBoot_LINUX_CL_OFFSET) + (VasEBoot_LINUX_CL_END_OFFSET): ... to here. + * loader/i386/efi/linux.c (VasEBoot_EFI_CL_OFFSET): Rename to ... + (VasEBoot_LINUX_CL_OFFSET): ... this. Update all users. + (VasEBoot_EFI_CL_END_OFFSET): Rename to ... + (VasEBoot_LINUX_CL_END_OFFSET): ... this. Update all users. + (VasEBoot_rescue_cmd_linux): Macroify `type_of_loader' initialization. Initialize `params->video_cursor_x' and `params->video_cursor_y' - portably using grub_getxy(). + portably using VasEBoot_getxy(). Replace `-EFI' with `-bzImage' in boot message. 2008-08-17 Robert Millan - * include/grub/x86_64/kernel.h: New file ( stub). + * include/VasEBoot/x86_64/kernel.h: New file ( stub). 2008-08-17 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pc/mmap.c'. - * include/grub/i386/pc/init.h (GRUB_MACHINE_MEMORY_AVAILABLE) - (GRUB_MACHINE_MEMORY_RESERVED): New macros. - (grub_machine_mmap_iterate): New function declaration. - * include/grub/multiboot.h (struct grub_multiboot_mmap_entry): New + * include/VasEBoot/i386/pc/init.h (VasEBoot_MACHINE_MEMORY_AVAILABLE) + (VasEBoot_MACHINE_MEMORY_RESERVED): New macros. + (VasEBoot_machine_mmap_iterate): New function declaration. + * include/VasEBoot/multiboot.h (struct VasEBoot_multiboot_mmap_entry): New structure. - (GRUB_MMAP_MEMORY_AVAILABLE, GRUB_MMAP_MEMORY_RESERVED): New + (VasEBoot_MMAP_MEMORY_AVAILABLE, VasEBoot_MMAP_MEMORY_RESERVED): New macros. - * kern/i386/pc/init.c (grub_machine_init): Replace hardcoded region - type check value with `GRUB_MACHINE_MEMORY_AVAILABLE'. + * kern/i386/pc/init.c (VasEBoot_machine_init): Replace hardcoded region + type check value with `VasEBoot_MACHINE_MEMORY_AVAILABLE'. Move e820 parsing from here ... * kern/i386/pc/mmap.c: New file. - (grub_machine_mmap_iterate): ... to here. + (VasEBoot_machine_mmap_iterate): ... to here. - * include/grub/i386/coreboot/memory.h: Remove `'. - (GRUB_LINUXBIOS_MEMORY_AVAILABLE): Rename (for consistency) to ... - (GRUB_MACHINE_MEMORY_AVAILABLE): ... this. Update all users. - (grub_available_iterate): Redeclare to return `void', and redeclare - its hook to use grub_uint64_t as addr and size parameters, and rename + * include/VasEBoot/i386/coreboot/memory.h: Remove `'. + (VasEBoot_LINUXBIOS_MEMORY_AVAILABLE): Rename (for consistency) to ... + (VasEBoot_MACHINE_MEMORY_AVAILABLE): ... this. Update all users. + (VasEBoot_available_iterate): Redeclare to return `void', and redeclare + its hook to use VasEBoot_uint64_t as addr and size parameters, and rename to ... - (grub_machine_mmap_iterate): ... this. Update all users. + (VasEBoot_machine_mmap_iterate): ... this. Update all users. - * kern/i386/coreboot/mmap.c (grub_mmap_iterate): Simplify parser loop + * kern/i386/coreboot/mmap.c (VasEBoot_mmap_iterate): Simplify parser loop to make it more readable. Rename to ... - (grub_machine_mmap_iterate): ... this. + (VasEBoot_machine_mmap_iterate): ... this. * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): New variables. - (grub_get_multiboot_mmap_len, grub_fill_multiboot_mmap): New functions. - (grub_multiboot): Allocate an extra region after the payload, and fill + (VasEBoot_get_multiboot_mmap_len, VasEBoot_fill_multiboot_mmap): New functions. + (VasEBoot_multiboot): Allocate an extra region after the payload, and fill it with a Multiboot memory map. Adjust a.out loader to calculate size with the extra space. - (grub_multiboot_load_elf32): Adjust elf32 loader to calculate size + (VasEBoot_multiboot_load_elf32): Adjust elf32 loader to calculate size with the extra space. 2008-08-17 Carles Pina i Estany - * menu/normal.c (run_menu): Add Home and End keys in grub-menu. + * menu/normal.c (run_menu): Add Home and End keys in VasEBoot-menu. 2008-08-17 Felix Zielcke - * gendistlist.sh: Add *.y, *.tex, *.texi, grub.cfg, README, *.sc, + * gendistlist.sh: Add *.y, *.tex, *.texi, VasEBoot.cfg, README, *.sc, mdate-sh to the list `find' searches for. * DISTLIST: Regenerated. @@ -43009,9 +43009,9 @@ 2008-08-16 Robert Millan - * disk/raid.c (grub_raid_init): Handle/report errors set by - grub_device_iterate(). - * disk/lvm.c (grub_lvm_init): Likewise. + * disk/raid.c (VasEBoot_raid_init): Handle/report errors set by + VasEBoot_device_iterate(). + * disk/lvm.c (VasEBoot_lvm_init): Likewise. 2008-08-15 Bean @@ -43075,15 +43075,15 @@ (datehook_mod_CFLAGS): Likewise. (datehook_mod_LDFLAGS): Likewise. - * kern/env.c (grub_env_insert): Fix a bug in prevp pointer. + * kern/env.c (VasEBoot_env_insert): Fix a bug in prevp pointer. * commands/date.c: New file. * hook/datehook.c: Likewise. - * include/grub/lib/datetime.h: Likewise. + * include/VasEBoot/lib/datetime.h: Likewise. - * include/grub/i386/cmos.h: Likewise. + * include/VasEBoot/i386/cmos.h: Likewise. * lib/datetime.c: Likewise. @@ -43093,79 +43093,79 @@ 2008-08-14 Robert Millan - * conf/common.rmk (bin_UTILITIES): Add `grub-mkelfimage'. - (grub_mkelfimage_SOURCES): New variable. - (util/elf/grub-mkimage.c_DEPENDENCIES): Likewise. + * conf/common.rmk (bin_UTILITIES): Add `VasEBoot-mkelfimage'. + (VasEBoot_mkelfimage_SOURCES): New variable. + (util/elf/VasEBoot-mkimage.c_DEPENDENCIES): Likewise. - * conf/i386-coreboot.rmk (bin_UTILITIES, grub_mkimage_SOURCES) - (grub_mkimage_LDFLAGS, util/elf/grub-mkimage.c_DEPENDENCIES): Remove. + * conf/i386-coreboot.rmk (bin_UTILITIES, VasEBoot_mkimage_SOURCES) + (VasEBoot_mkimage_LDFLAGS, util/elf/VasEBoot-mkimage.c_DEPENDENCIES): Remove. * conf/powerpc-ieee1275.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. - * kern/ieee1275/init.c: Include `'. + * kern/ieee1275/init.c: Include `'. * kern/i386/coreboot/init.c: Likewise. - * kern/i386/ieee1275/startup.S: Replace `' - with `'. - (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Renamed + * kern/i386/ieee1275/startup.S: Replace `' + with `'. + (VasEBoot_KERNEL_MACHINE_PREFIX, VasEBoot_KERNEL_MACHINE_DATA_END): Renamed to ... - (GRUB_KERNEL_CPU_PREFIX, GRUB_KERNEL_CPU_DATA_END): ... this. + (VasEBoot_KERNEL_CPU_PREFIX, VasEBoot_KERNEL_CPU_DATA_END): ... this. * kern/i386/coreboot/startup.S: Likewise. - * include/grub/powerpc/ieee1275/kernel.h (GRUB_MOD_ALIGN) - (GRUB_MOD_GAP): Remove. - * include/grub/powerpc/kernel.h: New file. - * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX) - (GRUB_KERNEL_MACHINE_DATA_END): Remove. - * include/grub/i386/kernel.h: New file. - * include/grub/i386/coreboot/kernel.h (GRUB_MOD_ALIGN) - (GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_PREFIX) - (GRUB_KERNEL_MACHINE_DATA_END): Remove. + * include/VasEBoot/powerpc/ieee1275/kernel.h (VasEBoot_MOD_ALIGN) + (VasEBoot_MOD_GAP): Remove. + * include/VasEBoot/powerpc/kernel.h: New file. + * include/VasEBoot/i386/ieee1275/kernel.h (VasEBoot_KERNEL_MACHINE_PREFIX) + (VasEBoot_KERNEL_MACHINE_DATA_END): Remove. + * include/VasEBoot/i386/kernel.h: New file. + * include/VasEBoot/i386/coreboot/kernel.h (VasEBoot_MOD_ALIGN) + (VasEBoot_MOD_GAP, VasEBoot_KERNEL_MACHINE_PREFIX) + (VasEBoot_KERNEL_MACHINE_DATA_END): Remove. - * util/ieee1275/grub-install.in (grub_mkimage): Initialize to use - `grub-mkelfimage'. - Use --directory when invoking grub_mkimage. + * util/ieee1275/VasEBoot-install.in (VasEBoot_mkimage): Initialize to use + `VasEBoot-mkelfimage'. + Use --directory when invoking VasEBoot_mkimage. - * util/elf/grub-mkimage.c: Include `'. - (add_segments): Replace GRUB_KERNEL_MACHINE_DATA_END and - GRUB_KERNEL_MACHINE_PREFIX with GRUB_KERNEL_CPU_DATA_END - and GRUB_KERNEL_CPU_PREFIX. + * util/elf/VasEBoot-mkimage.c: Include `'. + (add_segments): Replace VasEBoot_KERNEL_MACHINE_DATA_END and + VasEBoot_KERNEL_MACHINE_PREFIX with VasEBoot_KERNEL_CPU_DATA_END + and VasEBoot_KERNEL_CPU_PREFIX. 2008-08-14 Felix Zielcke - * include/grub/err.h (grub_err_printf): New function prototype. - * util/misc.c (grub_err_printf): New function. - * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for - grub_printf. - * kern/err.c (grub_print_error): Use grub_err_printf. + * include/VasEBoot/err.h (VasEBoot_err_printf): New function prototype. + * util/misc.c (VasEBoot_err_printf): New function. + * kern/misc.c [! VasEBoot_UTIL] (VasEBoot_err_printf): New alias for + VasEBoot_printf. + * kern/err.c (VasEBoot_print_error): Use VasEBoot_err_printf. 2008-08-13 Robert Millan - * docs/grub.cfg: Remove `/dev/' prefix in GNU/Hurd boot entry. + * docs/VasEBoot.cfg: Remove `/dev/' prefix in GNU/Hurd boot entry. 2008-08-13 Robert Millan - * docs/grub.cfg: Use the native device name for the example GNU/Hurd + * docs/VasEBoot.cfg: Use the native device name for the example GNU/Hurd boot entry. 2008-08-12 Robert Millan - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Move part + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): Move part of the relocation code from here ... - (grub_multiboot): ... to here. + (VasEBoot_multiboot): ... to here. (forward_relocator, backward_relocator): Move from here ... - * kern/i386/loader.S (grub_multiboot_forward_relocator) - (grub_multiboot_backward_relocator): ... to here. - (grub_multiboot_real_boot): Use %edx for entry offset. Put Multiboot + * kern/i386/loader.S (VasEBoot_multiboot_forward_relocator) + (VasEBoot_multiboot_backward_relocator): ... to here. + (VasEBoot_multiboot_real_boot): Use %edx for entry offset. Put Multiboot magic in %eax. Use %ebp for jumping (so %edx is not trashed). - * include/grub/i386/loader.h (grub_multiboot_forward_relocator) - (grub_multiboot_forward_relocator_end) - (grub_multiboot_backward_relocator) - (grub_multiboot_backward_relocator_end): New variables. + * include/VasEBoot/i386/loader.h (VasEBoot_multiboot_forward_relocator) + (VasEBoot_multiboot_forward_relocator_end) + (VasEBoot_multiboot_backward_relocator) + (VasEBoot_multiboot_backward_relocator_end): New variables. 2008-08-12 Bean - * disk/raid.c (grub_raid_read): Fix a bug in raid0 code. + * disk/raid.c (VasEBoot_raid_read): Fix a bug in raid0 code. 2008-08-11 Robert Millan @@ -43182,55 +43182,55 @@ 2008-08-11 Robert Millan - * kern/device.c (grub_device_open): Do not handle grub_disk_open() + * kern/device.c (VasEBoot_device_open): Do not handle VasEBoot_disk_open() errors. Leave it to the upper layer to handle them. 2008-08-09 Christian Franke - * Makefile.in: Add `target_os' and `enable_grub_pe2elf'. - * conf/common.rmk: Install `grub-pe2elf' only if requested. - Install `grub.d/10_windows' only on Cygwin. + * Makefile.in: Add `target_os' and `enable_VasEBoot_pe2elf'. + * conf/common.rmk: Install `VasEBoot-pe2elf' only if requested. + Install `VasEBoot.d/10_windows' only on Cygwin. * configure.ac: Add subst of `target_os'. Check `target_os' also before setting TARGET_OBJ2ELF. - Add `--enable-grub-pe2elf'. + Add `--enable-VasEBoot-pe2elf'. 2008-08-08 Robert Millan - * kern/disk.c: Replace `' with `'. - (grub_last_time): Change type to grub_uint64_t. - (grub_disk_open): Migrate code from to using grub_get_time_ms(). - (grub_disk_close): Likewise. + * kern/disk.c: Replace `' with `'. + (VasEBoot_last_time): Change type to VasEBoot_uint64_t. + (VasEBoot_disk_open): Migrate code from to using VasEBoot_get_time_ms(). + (VasEBoot_disk_close): Likewise. - * normal/menu.c: Replace `' with `'. - (run_menu): Migrate code from to using grub_get_time_ms(). + * normal/menu.c: Replace `' with `'. + (run_menu): Migrate code from to using VasEBoot_get_time_ms(). - * util/misc.c (grub_get_time_ms): New function. + * util/misc.c (VasEBoot_get_time_ms): New function. 2008-08-08 Marco Gerards - * disk/ata.c (grub_ata_regget): Change return type to - `grub_uint8_t'. - (grub_ata_regget2): Likewise. - (grub_ata_wait_status): New function. - (grub_ata_wait_busy): Removed function, updated all users to use - `grub_ata_wait_status'. - (grub_ata_wait_drq): Likewise. - (grub_ata_cmd): New function. - (grub_ata_pio_read): Change return type to `grub_uint8_t'. Add + * disk/ata.c (VasEBoot_ata_regget): Change return type to + `VasEBoot_uint8_t'. + (VasEBoot_ata_regget2): Likewise. + (VasEBoot_ata_wait_status): New function. + (VasEBoot_ata_wait_busy): Removed function, updated all users to use + `VasEBoot_ata_wait_status'. + (VasEBoot_ata_wait_drq): Likewise. + (VasEBoot_ata_cmd): New function. + (VasEBoot_ata_pio_read): Change return type to `VasEBoot_uint8_t'. Add error handling. - (grub_ata_pio_write): Add error handling. - (grub_atapi_identify): Likewise. - (grub_atapi_packet): Use `grub_ata_cmd' and improve error + (VasEBoot_ata_pio_write): Add error handling. + (VasEBoot_atapi_identify): Likewise. + (VasEBoot_atapi_packet): Use `VasEBoot_ata_cmd' and improve error handling. - (grub_ata_identify): Use `grub_ata_cmd' and improve error + (VasEBoot_ata_identify): Use `VasEBoot_ata_cmd' and improve error handling. Actually use the detected registers. Reorder the detection logic such that it is easier to read. - (grub_ata_pciinit): Do not assign the same ID to each controller. - (grub_ata_setaddress): Use `grub_ata_cmd' and improve error + (VasEBoot_ata_pciinit): Do not assign the same ID to each controller. + (VasEBoot_ata_setaddress): Use `VasEBoot_ata_cmd' and improve error handling. - (grub_atapi_readsector): Check the result of `grub_ata_pio_read'. + (VasEBoot_atapi_readsector): Check the result of `VasEBoot_ata_pio_read'. - * include/grub/err.h (grub_err_t): Add `GRUB_ERR_TIMEOUT'. + * include/VasEBoot/err.h (VasEBoot_err_t): Add `VasEBoot_ERR_TIMEOUT'. 2008-08-08 Marco Gerards @@ -43238,13 +43238,13 @@ 2008-08-07 Bean - * include/grub/x86_64/pci.h: New file. + * include/VasEBoot/x86_64/pci.h: New file. 2008-08-07 Christian Franke * kern/i386/pit.c (TIMER2_SPEAKER): New define. (TIMER2_GATE): Likewise. - (grub_pit_wait): Add enable/disable of the timer2 gate + (VasEBoot_pit_wait): Add enable/disable of the timer2 gate bit of port 0x61. This fixes a possible infinite loop. 2008-08-07 Bean @@ -43252,13 +43252,13 @@ * conf/x86_64-efi.rmk (kernel_mod_SOURCES): Add kern/time.c, kern/i386/tsc.c and kern/i386/pit.c. - * include/grub/i386/tsc.h (grub_cpu_is_cpuid_supported): Handle + * include/VasEBoot/i386/tsc.h (VasEBoot_cpu_is_cpuid_supported): Handle x86_64 platform. - * kern/i386/efi/init.c: Replace with - . + * kern/i386/efi/init.c: Replace with + . - * kern/i386/pit.c: Replace with . + * kern/i386/pit.c: Replace with . 2008-08-07 Bean @@ -43266,43 +43266,43 @@ * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add kern/time.c, - * include/grub/i386/pit.h: Use macro KERNEL_CPU_PIT_HEADER to avoid - multiple inclusion. Add #include . + * include/VasEBoot/i386/pit.h: Use macro KERNEL_CPU_PIT_HEADER to avoid + multiple inclusion. Add #include . 2008-08-06 Christian Franke * conf/common.rmk: Build and install `10_windows'. - * util/grub.d/10_windows.in: New script. + * util/VasEBoot.d/10_windows.in: New script. 2008-08-06 Pavel Roskin - * kern/i386/pit.c: Include `'. + * kern/i386/pit.c: Include `'. 2008-08-06 Robert Millan * conf/i386-coreboot.rmk (kernel_elf_ASFLAGS): New variable. - * kern/i386/tsc.c: Include `'. + * kern/i386/tsc.c: Include `'. 2008-08-06 Bean - * fs/i386/pc/pxe.c (grub_pxe_data): New member block_size. - (grub_pxefs_fs_int): Remove dummy definition. - (grub_pxefs_open): Use data->block_size to store the current block + * fs/i386/pc/pxe.c (VasEBoot_pxe_data): New member block_size. + (VasEBoot_pxefs_fs_int): Remove dummy definition. + (VasEBoot_pxefs_open): Use data->block_size to store the current block size setting. - (grub_pxefs_read): Use block size stored in data->block_size. As the - value of grub_pxe_blksize can be changed after the file is opened. + (VasEBoot_pxefs_read): Use block size stored in data->block_size. As the + value of VasEBoot_pxe_blksize can be changed after the file is opened. 2008-08-06 Bean * fs/i386/pc/pxe.c (curr_file): new variable. - (grub_pxefs_open): Simply the handling of pxe file system. Don't + (VasEBoot_pxefs_open): Simply the handling of pxe file system. Don't require the dummy internal file system anymore. - (grub_pxefs_read): Removed. - (grub_pxefs_close): Likewise. - (grub_pxefs_fs_int): Likewise. - (grub_pxefs_read_int): Renamed to grub_pxefs_read. Reinitialize tftp + (VasEBoot_pxefs_read): Removed. + (VasEBoot_pxefs_close): Likewise. + (VasEBoot_pxefs_fs_int): Likewise. + (VasEBoot_pxefs_read_int): Renamed to VasEBoot_pxefs_read. Reinitialize tftp connection when we switch file. - (grub_pxefs_close_int): Renamed to grub_pxefs_close. + (VasEBoot_pxefs_close_int): Renamed to VasEBoot_pxefs_close. 2008-08-06 Robert Millan @@ -43313,22 +43313,22 @@ * kern/i386/halt.c: New file. * kern/i386/reboot.c: Likewise. - * include/grub/i386/reboot.h: Likewise. - * include/grub/i386/halt.h: Likewise. + * include/VasEBoot/i386/reboot.h: Likewise. + * include/VasEBoot/i386/halt.h: Likewise. - * commands/halt.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI]: - Include `'. - * commands/reboot.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI] - [! GRUB_MACHINE_PCBIOS]: Include `'. + * commands/halt.c [! VasEBoot_MACHINE_IEEE1275 ! VasEBoot_MACHINE_EFI]: + Include `'. + * commands/reboot.c [! VasEBoot_MACHINE_IEEE1275 ! VasEBoot_MACHINE_EFI] + [! VasEBoot_MACHINE_PCBIOS]: Include `'. - * term/i386/pc/at_keyboard.c: Include `'. + * term/i386/pc/at_keyboard.c: Include `'. (SHIFT_L, SHIFT_R, CTRL, ALT, CAPS_LOCK, KEYBOARD_REG_DATA) (KEYBOARD_REG_STATUS, KEYBOARD_COMMAND_ISREADY, KEYBOARD_COMMAND_READ) (KEYBOARD_COMMAND_WRITE, KEYBOARD_COMMAND_REBOOT) (KEYBOARD_SCANCODE_SET1, KEYBOARD_ISMAKE, KEYBOARD_ISREADY) (KEYBOARD_SCANCODE, OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): Move from here ... - * include/grub/i386/at_keyboard.h: ... to here. + * include/VasEBoot/i386/at_keyboard.h: ... to here. 2008-08-05 Robert Millan @@ -43338,16 +43338,16 @@ `kern/i386/tsc.c', `kern/generic/rtc_get_time_ms.c' and `kern/generic/millisleep.c'. - * kern/i386/tsc.c (calibrate_tsc): Rewrite using grub_pit_wait() - instead of grub_get_rtc(). - (grub_tsc_init): Initialize `tsc_boot_time'. + * kern/i386/tsc.c (calibrate_tsc): Rewrite using VasEBoot_pit_wait() + instead of VasEBoot_get_rtc(). + (VasEBoot_tsc_init): Initialize `tsc_boot_time'. - * kern/i386/linuxbios/init.c (grub_millisleep): Remove stub. - (grub_machine_init): Use grub_tsc_init() rather than - installing an RTC-based handler via grub_install_get_time_ms(). + * kern/i386/linuxbios/init.c (VasEBoot_millisleep): Remove stub. + (VasEBoot_machine_init): Use VasEBoot_tsc_init() rather than + installing an RTC-based handler via VasEBoot_install_get_time_ms(). * kern/i386/pit.c: New file. - * include/grub/i386/pit.h: Likewise. + * include/VasEBoot/i386/pit.h: Likewise. 2008-08-05 Bean @@ -43362,39 +43362,39 @@ (pxecmd_mod_CFLAGS): Likewise. (pxecmd_mod_LDFLAGS): Likewise. - * kern/i386/pc/startup.S (grub_pxe_scan): New function. - (grub_pxe_call): Likewise. + * kern/i386/pc/startup.S (VasEBoot_pxe_scan): New function. + (VasEBoot_pxe_call): Likewise. - * include/grub/disk.h (grub_disk_dev_id): Add GRUB_DISK_DEVICE_PXE_ID. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add VasEBoot_DISK_DEVICE_PXE_ID. * commands/i386/pc/pxecmd.c: New file. * fs/i386/pc/pxe.c: Likewise. - * include/grub/i386/pc/pxe.h: Likewise. + * include/VasEBoot/i386/pc/pxe.h: Likewise. 2008-08-05 Bean - * util/console.c (grub_console_cur_color): New variable. - (grub_console_standard_color): Likewise. - (grub_console_normal_color): Likewise. - (grub_console_highlight_color): Likewise. + * util/console.c (VasEBoot_console_cur_color): New variable. + (VasEBoot_console_standard_color): Likewise. + (VasEBoot_console_normal_color): Likewise. + (VasEBoot_console_highlight_color): Likewise. (color_map): Likewise. (use_color): Likewise. (NUM_COLORS): New macro. - (grub_ncurses_setcolorstate): Handle color properly. - (grub_ncurses_setcolor): Don't change color here, just remember the - settings, color will be set in grub_ncurses_setcolorstate. - (grub_ncurses_getcolor): New function. - (grub_ncurses_init): Initialize color pairs. - (grub_ncurses_term): New member grub_ncurses_getcolor. + (VasEBoot_ncurses_setcolorstate): Handle color properly. + (VasEBoot_ncurses_setcolor): Don't change color here, just remember the + settings, color will be set in VasEBoot_ncurses_setcolorstate. + (VasEBoot_ncurses_getcolor): New function. + (VasEBoot_ncurses_init): Initialize color pairs. + (VasEBoot_ncurses_term): New member VasEBoot_ncurses_getcolor. 2008-08-05 Colin D Bennett High resolution timer support. Implemented for x86 CPUs using TSC. - Extracted generic grub_millisleep() so it's linked in only as needed. + Extracted generic VasEBoot_millisleep() so it's linked in only as needed. This requires a Pentium compatible CPU; if the RDTSC instruction is - not supported, then it falls back on the generic grub_get_time_ms() + not supported, then it falls back on the generic VasEBoot_get_time_ms() implementation that uses the machine's RTC. * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/time.c', @@ -43422,62 +43422,62 @@ * kern/misc.c: Don't include anymore. - (grub_millisleep_generic): Removed. + (VasEBoot_millisleep_generic): Removed. - * commands/sleep.c (grub_interruptible_millisleep): Uses - grub_get_time_ms() instead of grub_get_rtc(). + * commands/sleep.c (VasEBoot_interruptible_millisleep): Uses + VasEBoot_get_time_ms() instead of VasEBoot_get_rtc(). - * include/grub/i386/tsc.h (grub_get_tsc): New file. New inline + * include/VasEBoot/i386/tsc.h (VasEBoot_get_tsc): New file. New inline function. - (grub_cpu_is_cpuid_supported): New inline function. - (grub_cpu_is_tsc_supported): New inline function. - (grub_tsc_init): New function prototype. - (grub_tsc_get_time_ms): New function prototype. + (VasEBoot_cpu_is_cpuid_supported): New inline function. + (VasEBoot_cpu_is_tsc_supported): New inline function. + (VasEBoot_tsc_init): New function prototype. + (VasEBoot_tsc_get_time_ms): New function prototype. - * kern/i386/tsc.c (grub_get_time_ms): New file. + * kern/i386/tsc.c (VasEBoot_get_time_ms): New file. - * include/grub/time.h: Include . Don't include - anymore. - (grub_millisleep): Removed. - (grub_machine_init): Call grub_tsc_init. + * kern/i386/efi/init.c: Include . Don't include + anymore. + (VasEBoot_millisleep): Removed. + (VasEBoot_machine_init): Call VasEBoot_tsc_init. - * kern/i386/linuxbios/init.c (grub_machine_init): Install the RTC + * kern/i386/linuxbios/init.c (VasEBoot_machine_init): Install the RTC get_time_ms() implementation. - * kern/sparc64/ieee1275/init.c (grub_millisleep): Removed. + * kern/sparc64/ieee1275/init.c (VasEBoot_millisleep): Removed. (ieee1275_get_time_ms): New function. - (grub_machine_init): Install get_time_ms() implementation. + (VasEBoot_machine_init): Install get_time_ms() implementation. - * kern/i386/pc/init.c: Include . - (grub_machine_init): Call grub_tsc_init(). - (grub_millisleep): Removed. + * kern/i386/pc/init.c: Include . + (VasEBoot_machine_init): Call VasEBoot_tsc_init(). + (VasEBoot_millisleep): Removed. - * kern/ieee1275/init.c (grub_millisleep): Removed. - (grub_machine_init): Install ieee1275_get_time_ms() + * kern/ieee1275/init.c (VasEBoot_millisleep): Removed. + (VasEBoot_machine_init): Install ieee1275_get_time_ms() implementation. (ieee1275_get_time_ms): New function. - (grub_get_rtc): Now calls ieee1275_get_time_ms(), which does the + (VasEBoot_get_rtc): Now calls ieee1275_get_time_ms(), which does the real work. 2008-08-05 Marco Gerards - * disk/ata.c: Include . - (enum grub_ata_commands): Add `GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS'. - (grub_ata_initialize): Rewritten. - (grub_ata_device_initialize): New function. + * disk/ata.c: Include . + (enum VasEBoot_ata_commands): Add `VasEBoot_ATA_CMD_EXEC_DEV_DIAGNOSTICS'. + (VasEBoot_ata_initialize): Rewritten. + (VasEBoot_ata_device_initialize): New function. 2008-08-04 Pavel Roskin - * kern/main.c: Include grub/mm.h. + * kern/main.c: Include VasEBoot/mm.h. 2008-08-04 Robert Millan @@ -43487,22 +43487,22 @@ 2008-08-04 Robert Millan - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Fix misc + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): Fix misc warnings introduced in my last commit. 2008-08-03 Robert Millan Make PCI available on all i386 architectures. - * include/grub/i386/pc/pci.h: Move from here ... - * include/grub/i386/pci.h: ... to here. + * include/VasEBoot/i386/pc/pci.h: Move from here ... + * include/VasEBoot/i386/pci.h: ... to here. - * include/grub/i386/pc/pci.h: Remove. - * include/grub/i386/efi/pci.h: Remove. - * include/grub/x86_64/efi/pci.h: Remove. + * include/VasEBoot/i386/pc/pci.h: Remove. + * include/VasEBoot/i386/efi/pci.h: Remove. + * include/VasEBoot/x86_64/efi/pci.h: Remove. - * include/grub/pci.h: Replace `' with - `'. + * include/VasEBoot/pci.h: Replace `' with + `'. * conf/i386-coreboot.rmk (pkglib_MODULES): Add `pci' and `lspci'. (pci_mod_SOURCES, pci_mod_CFLAGS, pci_mod_LDFLAGS, lspci_mod_SOURCES) @@ -43513,74 +43513,74 @@ 2008-08-03 Robert Millan * term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro. - (grub_console_setcursor): Make it possible to set cursor off. + (VasEBoot_console_setcursor): Make it possible to set cursor off. 2008-08-03 Robert Millan - * util/grub.d/00_header.in: Be platform-agnostic. Probe for existence + * util/VasEBoot.d/00_header.in: Be platform-agnostic. Probe for existence of modules instead of assuming which platform provides what. - * util/update-grub.in: Likewise. + * util/update-VasEBoot.in: Likewise. 2008-08-03 Robert Millan - * kern/i386/pc/init.c (make_install_device): Check for `grub_prefix' - instead of `grub_install_dos_part' to determine whether a drive needs - to be prepended to prefix (`grub_install_dos_part' is not reliable, - because it can be overridden when loading GRUB via Multiboot). + * kern/i386/pc/init.c (make_install_device): Check for `VasEBoot_prefix' + instead of `VasEBoot_install_dos_part' to determine whether a drive needs + to be prepended to prefix (`VasEBoot_install_dos_part' is not reliable, + because it can be overridden when loading VasEBoot via Multiboot). 2008-08-02 Robert Millan - * util/i386/pc/grub-install.in: Remove trailing slash from prefix. + * util/i386/pc/VasEBoot-install.in: Remove trailing slash from prefix. 2008-08-02 Robert Millan - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Add a pair - of informational grub_dprintf() calls. + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): Add a pair + of informational VasEBoot_dprintf() calls. 2008-08-02 Robert Millan * disk/memdisk.c (memdisk_size): Don't initialize. - (GRUB_MOD_INIT(memdisk)): Find memdisk using grub_module_iterate(). + (VasEBoot_MOD_INIT(memdisk)): Find memdisk using VasEBoot_module_iterate(). - * include/grub/i386/pc/kernel.h - (GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): Remove macro. - (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Shift. - (grub_memdisk_image_size, grub_arch_memdisk_addr) - (grub_arch_memdisk_size): Remove. + * include/VasEBoot/i386/pc/kernel.h + (VasEBoot_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): Remove macro. + (VasEBoot_KERNEL_MACHINE_PREFIX, VasEBoot_KERNEL_MACHINE_DATA_END): Shift. + (VasEBoot_memdisk_image_size, VasEBoot_arch_memdisk_addr) + (VasEBoot_arch_memdisk_size): Remove. - * include/grub/kernel.h (struct grub_module_header): Remove `offset' + * include/VasEBoot/kernel.h (struct VasEBoot_module_header): Remove `offset' field (was only used to transfer a constant). Add `type' field to support multiple module types. - (grub_module_iterate): New function. + (VasEBoot_module_iterate): New function. - * kern/device.c (grub_device_open): Do not hide error messages - when grub_disk_open() fails. Use grub_print_error() instead. + * kern/device.c (VasEBoot_device_open): Do not hide error messages + when VasEBoot_disk_open() fails. Use VasEBoot_print_error() instead. - * kern/i386/pc/init.c (grub_arch_modules_addr) - (grub_arch_memdisk_size): Remove functions. - (grub_arch_modules_addr): Return the module address in high memory + * kern/i386/pc/init.c (VasEBoot_arch_modules_addr) + (VasEBoot_arch_memdisk_size): Remove functions. + (VasEBoot_arch_modules_addr): Return the module address in high memory (now that it isn't copied anymore). - * kern/i386/pc/startup.S (grub_memdisk_image_size): Remove variable. - (codestart): Don't add grub_memdisk_image_size to %ecx in LZMA - decompression routine (grub_total_module_size already includes that + * kern/i386/pc/startup.S (VasEBoot_memdisk_image_size): Remove variable. + (codestart): Don't add VasEBoot_memdisk_image_size to %ecx in LZMA + decompression routine (VasEBoot_total_module_size already includes that now). Don't copy modules back to low memory. - * kern/main.c: Include `'. - (grub_load_modules): Split out (and use) ... - (grub_module_iterate): ... this function, which iterates through + * kern/main.c: Include `'. + (VasEBoot_load_modules): Split out (and use) ... + (VasEBoot_module_iterate): ... this function, which iterates through module objects and runs a hook. - Comment out grub_mm_init_region() call, as it would cause non-ELF + Comment out VasEBoot_mm_init_region() call, as it would cause non-ELF modules to be overwritten. - * util/i386/pc/grub-mkimage.c (generate_image): Instead of appending + * util/i386/pc/VasEBoot-mkimage.c (generate_image): Instead of appending the memdisk image in its own region, make it part of the module list. - * util/elf/grub-mkimage.c (options): Add "memdisk"|'m' option. + * util/elf/VasEBoot-mkimage.c (options): Add "memdisk"|'m' option. (main): Parse --memdisk|-m option, and pass user-provided path as parameter to generate_image(). (add_segments): Pass `memdisk_path' down to load_modules(). (load_modules): Embed memdisk image in module section when requested. - * util/i386/efi/grub-mkimage.c (make_mods_section): Initialize + * util/i386/efi/VasEBoot-mkimage.c (make_mods_section): Initialize `header.type' instead of `header.offset'. * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add `memdisk.mod'. @@ -43594,20 +43594,20 @@ * loader/i386/pc/multiboot.c (playground, forward_relocator) (backward_relocator): New variables. Used to allocate and relocate the payload, respectively. - (grub_multiboot_load_elf32): Load into heap instead of requested + (VasEBoot_multiboot_load_elf32): Load into heap instead of requested address, install the appropriate relocator code in each bound of the payload, and set the entry point such that - grub_multiboot_real_boot() will jump to one of them. + VasEBoot_multiboot_real_boot() will jump to one of them. - * kern/i386/loader.S (grub_multiboot_payload_size) - (grub_multiboot_payload_orig, grub_multiboot_payload_dest) - (grub_multiboot_payload_entry_offset): New variables. - (grub_multiboot_real_boot): Set cpu context to what the relocator + * kern/i386/loader.S (VasEBoot_multiboot_payload_size) + (VasEBoot_multiboot_payload_orig, VasEBoot_multiboot_payload_dest) + (VasEBoot_multiboot_payload_entry_offset): New variables. + (VasEBoot_multiboot_real_boot): Set cpu context to what the relocator expects, and jump to the relocator instead of the payload. - * include/grub/i386/loader.h (grub_multiboot_payload_size) - (grub_multiboot_payload_orig, grub_multiboot_payload_dest) - (grub_multiboot_payload_entry_offset): Export. + * include/VasEBoot/i386/loader.h (VasEBoot_multiboot_payload_size) + (VasEBoot_multiboot_payload_orig, VasEBoot_multiboot_payload_dest) + (VasEBoot_multiboot_payload_entry_offset): Export. 2008-08-01 Bean @@ -43617,9 +43617,9 @@ 2008-08-01 Robert Millan - * util/grub.d/10_linux.in: Use prepare_grub_to_access_device() from + * util/VasEBoot.d/10_linux.in: Use prepare_VasEBoot_to_access_device() from within menuentries, not before them. - util/grub.d/10_hurd.in: Likewise. + util/VasEBoot.d/10_hurd.in: Likewise. 2008-08-01 Bean @@ -43628,91 +43628,91 @@ (bufio_mod_CFLAGS): Likewise. (bufio_mod_LDFLAGS): Likewise. - * include/grub/bufio.h: New file. + * include/VasEBoot/bufio.h: New file. * io/bufio.c: Likewise. - * video/png.c: Replace with . - (grub_video_reader_png): Use grub_buffile_open to open file. + * video/png.c: Replace with . + (VasEBoot_video_reader_png): Use VasEBoot_buffile_open to open file. - * video/jpeg.c: Replace with . - (grub_video_reader_jpeg): Use grub_buffile_open to open file. + * video/jpeg.c: Replace with . + (VasEBoot_video_reader_jpeg): Use VasEBoot_buffile_open to open file. - * video/tga.c: Replace with . - (grub_video_reader_tga): Use grub_buffile_open to open file. + * video/tga.c: Replace with . + (VasEBoot_video_reader_tga): Use VasEBoot_buffile_open to open file. - * font/manager.c: Include . - (add_font): Use grub_buffile_open to open file. + * font/manager.c: Include . + (add_font): Use VasEBoot_buffile_open to open file. 2008-07-31 Robert Millan - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): When loading + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): When loading ELF segments, use a macro for arbitrarily accessing any of them instead of preparing a pointer that allows access to one at a time. - (grub_multiboot_load_elf64): Likewise. + (VasEBoot_multiboot_load_elf64): Likewise. 2008-07-31 Bean * boot/i386/pc/lnxboot.S (real_code_2): Replace 0x50 with - GRUB_KERNEL_MACHINE_DATA_END. + VasEBoot_KERNEL_MACHINE_DATA_END. 2008-07-30 Robert Millan - * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_DATA_END): + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_KERNEL_MACHINE_DATA_END): Increase from 0x50 to 0x60. - * util/i386/pc/grub-install.in: Detect cross-disk installs, and + * util/i386/pc/VasEBoot-install.in: Detect cross-disk installs, and use UUIDs to identify the root drive for them. If that's not possible, abort. - * util/i386/pc/grub-setup.c (setup): Do not special-case, or even + * util/i386/pc/VasEBoot-setup.c (setup): Do not special-case, or even check, for cross-disk installs. 2008-07-30 Robert Millan - * kern/ieee1275/init.c (grub_machine_set_prefix): If `grub_prefix' + * kern/ieee1275/init.c (VasEBoot_machine_set_prefix): If `VasEBoot_prefix' is non-empty, use it to set the `prefix' environment variable instead of the usual approach. * kern/i386/linuxbios/init.c (make_install_device): Remove function. - (grub_machine_set_prefix): Use `grub_prefix' to set the `prefix' + (VasEBoot_machine_set_prefix): Use `VasEBoot_prefix' to set the `prefix' environment variable instead of dummy make_install_device(). - * kern/i386/ieee1275/startup.S: Include `'. - (start): Insert a data section, with `grub_prefix' variable. + * kern/i386/ieee1275/startup.S: Include `'. + (start): Insert a data section, with `VasEBoot_prefix' variable. * kern/i386/linuxbios/startup.S: Likewise. - * include/grub/powerpc/ieee1275/kernel.h [!ASM_FILE] (grub_prefix): + * include/VasEBoot/powerpc/ieee1275/kernel.h [!ASM_FILE] (VasEBoot_prefix): New variable reference. - * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX): - New macro. Defines offset of `grub_prefix' within startup.S (relative + * include/VasEBoot/i386/ieee1275/kernel.h (VasEBoot_KERNEL_MACHINE_PREFIX): + New macro. Defines offset of `VasEBoot_prefix' within startup.S (relative to `start'). - (GRUB_KERNEL_MACHINE_DATA_END): New macro. Defines the end of data + (VasEBoot_KERNEL_MACHINE_DATA_END): New macro. Defines the end of data section within startup.S (relative to `start'). - * include/grub/i386/coreboot/kernel.h: Likewise. + * include/VasEBoot/i386/coreboot/kernel.h: Likewise. - * util/elf/grub-mkimage.c (add_segments): Receive `prefix' parameter. - Overwrite grub_prefix with its contents, at the beginning of the + * util/elf/VasEBoot-mkimage.c (add_segments): Receive `prefix' parameter. + Overwrite VasEBoot_prefix with its contents, at the beginning of the first segment. (main): Understand -p|--prefix. 2008-07-30 Robert Millan - * util/grub.d/10_hurd.in: Source ${libdir}/grub/update-grub_lib. + * util/VasEBoot.d/10_hurd.in: Source ${libdir}/VasEBoot/update-VasEBoot_lib. 2008-07-30 Robert Millan - * term/i386/pc/vga_text.c (grub_console_cls): Use - grub_console_gotoxy() to go back to beginning of the screen. + * term/i386/pc/vga_text.c (VasEBoot_console_cls): Use + VasEBoot_console_gotoxy() to go back to beginning of the screen. Found by Patrick Georgi 2008-07-29 Christian Franke - * util/update-grub_lib.in (make_system_path_relative_to_its_root): + * util/update-VasEBoot_lib.in (make_system_path_relative_to_its_root): Add conversion of emulated mount points on Cygwin. 2008-07-29 Christian Franke - * util/update-grub.in: Add a check for admin + * util/update-VasEBoot.in: Add a check for admin group on Cygwin. - Remove old `grub.cfg.new' before creation. + Remove old `VasEBoot.cfg.new' before creation. Add `-f' to `mv' to handle the different filesystem semantics of Windows. @@ -43722,8 +43722,8 @@ 2008-07-28 Robert Millan - * partmap/apple.c (GRUB_APPLE_HEADER_MAGIC): New macro. - (struct grub_apple_header): New struct. Describes the layout of + * partmap/apple.c (VasEBoot_APPLE_HEADER_MAGIC): New macro. + (struct VasEBoot_apple_header): New struct. Describes the layout of the partmap header. (apple_partition_map_iterate): Check the header magic as well as the partition magic (which was already being checked). @@ -43735,26 +43735,26 @@ 2008-07-28 Robert Millan - * disk/raid.c (grub_raid_scan_device): Do not abort when two disks + * disk/raid.c (VasEBoot_raid_scan_device): Do not abort when two disks with the same number are found, just use issue a warning with - grub_dprintf(), as this error has been reported to be non-fatal. + VasEBoot_dprintf(), as this error has been reported to be non-fatal. 2008-07-27 Robert Millan - * disk/ata.c (grub_ata_dumpinfo): Use grub_dprintf() for debugging + * disk/ata.c (VasEBoot_ata_dumpinfo): Use VasEBoot_dprintf() for debugging information. 2008-07-27 Bean - * fs/fat.c (GRUB_FAT_MAXFILE): New constant. - (grub_fat_find_dir): Ignore case when comparing filename. + * fs/fat.c (VasEBoot_FAT_MAXFILE): New constant. + (VasEBoot_fat_find_dir): Ignore case when comparing filename. 2008-07-27 Bean - * fs/xfs.c (grub_xfs_dir_header): Change field i8count back to + * fs/xfs.c (VasEBoot_xfs_dir_header): Change field i8count back to smallino, as it's more descriptive, and i8count can be confused with the other field count. - (grub_xfs_iterate_dir): Adjust grub_xfs_dir_entry pointer for small + (VasEBoot_xfs_iterate_dir): Adjust VasEBoot_xfs_dir_entry pointer for small inode type. 2008-07-27 Bean @@ -43763,22 +43763,22 @@ * lib/crc.c: Likewise. - * include/grub/lib/crc.h: Likewise. + * include/VasEBoot/lib/crc.h: Likewise. - * util/grub-fstest.c: grub/hexdump.h => grub/lib/hexdump.h. + * util/VasEBoot-fstest.c: VasEBoot/hexdump.h => VasEBoot/lib/hexdump.h. - * commands/hexdump.c: grub/hexdump.h => grub/lib/hexdump.h. + * commands/hexdump.c: VasEBoot/hexdump.h => VasEBoot/lib/hexdump.h. (hexdump): Move this function to ... * lib/hexdump.c: ... here. - * include/grub/hexdump.h: Renamed to ... + * include/VasEBoot/hexdump.h: Renamed to ... - * include/grub/lib/hexdump.h: ... this. + * include/VasEBoot/lib/hexdump.h: ... this. - * commands/loadenv.c: grub/envblk.h => grub/lib/envblk.h + * commands/loadenv.c: VasEBoot/envblk.h => VasEBoot/lib/envblk.h - * util/grub-editenv.c: Likewise. + * util/VasEBoot-editenv.c: Likewise. * include/envblk.h: Renamed to ... @@ -43788,9 +43788,9 @@ * lib/envblk.c: ... this. - * conf/common.rmk (grub_fstest_SOURCES): commands/hexdump.c => + * conf/common.rmk (VasEBoot_fstest_SOURCES): commands/hexdump.c => lib/hexdump.c. - (grub_editenv_SOURCES): util/envblk.c => lib/envblk.c + (VasEBoot_editenv_SOURCES): util/envblk.c => lib/envblk.c (pkglib_MODULES): Add crc.mod. (hexdump_mod_SOURCES): Add lib/hexdump.c. (loadenv_mod_SOURCES): util/envblk.c => lib/envblk.c. @@ -43798,19 +43798,19 @@ (crc_mod_CFLAGS): Likewise. (crc_mod_LDFLAGS): Likewise. - * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add lib/hexdump.c. + * conf/i386-coreboot.rmk (VasEBoot_emu_SOURCES): Add lib/hexdump.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (VasEBoot_emu_SOURCES): Likewise. 2008-07-27 Felix Zielcke - * commands/help.c: Include . + * commands/help.c: Include . (TERM_WIDTH): Removed. Updated all users. 2008-07-27 Pavel Roskin @@ -43823,19 +43823,19 @@ * util/getroot.c (find_root_device): Skip devices that match /dev/dm-[0-9]. This lets the real device be found for any type of abstraction (LVM, EVMS, RAID..). - (grub_guess_root_device): Do not traverse /dev/mapper (for LVM) + (VasEBoot_guess_root_device): Do not traverse /dev/mapper (for LVM) and /dev/evms (for EVMS) before traversing /dev. If a /dev/dm-[0-9] device is found first, find_root_device() will now skip it. 2008-07-24 Pavel Roskin - * include/grub/types.h: Use __builtin_bswap32() and + * include/VasEBoot/types.h: Use __builtin_bswap32() and __builtin_bswap64() with gcc 4.3 and newer. 2008-07-24 Christian Franke - * util/i386/pc/grub-install.in: If `--debug' is specified, - pass `--verbose' to grub-setup. + * util/i386/pc/VasEBoot-install.in: If `--debug' is specified, + pass `--verbose' to VasEBoot-setup. Abort script if make_system_path_relative_to_its_root() fails. 2008-07-24 Bean @@ -43846,34 +43846,34 @@ 2008-07-24 Bean * video/reader/png.c (DEFLATE_HLIT_MAX): Change value. - (grub_png_init_fixed_block): New function. - (grub_png_decode_image_data): Handle fixed huffman code compression. + (VasEBoot_png_init_fixed_block): New function. + (VasEBoot_png_decode_image_data): Handle fixed huffman code compression. 2008-07-24 Bean - * common.rmk (bin_UTILITIES): Add grub-pe2elf. - (grub_pe2elf_SOURCES): New macro. - (CLEANFILES): Add grub-pe2elf. + * common.rmk (bin_UTILITIES): Add VasEBoot-pe2elf. + (VasEBoot_pe2elf_SOURCES): New macro. + (CLEANFILES): Add VasEBoot-pe2elf. - * include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant. - (GRUB_PE32_SCN_ALIGN_2BYTES): Likewise. - (GRUB_PE32_SCN_ALIGN_4BYTES): Likewise. - (GRUB_PE32_SCN_ALIGN_8BYTES): Likewise. - (GRUB_PE32_SCN_ALIGN_16BYTES): Likewise. - (GRUB_PE32_SCN_ALIGN_32BYTES): Likewise. - (GRUB_PE32_SCN_ALIGN_64BYTES): Likewise. - (GRUB_PE32_SCN_ALIGN_SHIFT): Likewise. - (GRUB_PE32_SCN_ALIGN_MASK): Likewise. - (GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise. - (GRUB_PE32_SYM_CLASS_STATIC): Likewise. - (GRUB_PE32_SYM_CLASS_FILE): Likewise. - (GRUB_PE32_DT_FUNCTION): Likewise. - (GRUB_PE32_REL_I386_DIR32): Likewise. - (GRUB_PE32_REL_I386_REL32): Likewise. - (grub_pe32_symbol): New structure. - (grub_pe32_reloc): Likewise. + * include/VasEBoot/efi/pe32.h (VasEBoot_PE32_SCN_ALIGN_1BYTES): New constant. + (VasEBoot_PE32_SCN_ALIGN_2BYTES): Likewise. + (VasEBoot_PE32_SCN_ALIGN_4BYTES): Likewise. + (VasEBoot_PE32_SCN_ALIGN_8BYTES): Likewise. + (VasEBoot_PE32_SCN_ALIGN_16BYTES): Likewise. + (VasEBoot_PE32_SCN_ALIGN_32BYTES): Likewise. + (VasEBoot_PE32_SCN_ALIGN_64BYTES): Likewise. + (VasEBoot_PE32_SCN_ALIGN_SHIFT): Likewise. + (VasEBoot_PE32_SCN_ALIGN_MASK): Likewise. + (VasEBoot_PE32_SYM_CLASS_EXTERNAL): Likewise. + (VasEBoot_PE32_SYM_CLASS_STATIC): Likewise. + (VasEBoot_PE32_SYM_CLASS_FILE): Likewise. + (VasEBoot_PE32_DT_FUNCTION): Likewise. + (VasEBoot_PE32_REL_I386_DIR32): Likewise. + (VasEBoot_PE32_REL_I386_REL32): Likewise. + (VasEBoot_pe32_symbol): New structure. + (VasEBoot_pe32_reloc): Likewise. - * util/grub-pe2elf.c: New file. + * util/VasEBoot-pe2elf.c: New file. * configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for start symbol in non pc platform. @@ -43882,22 +43882,22 @@ The following patches are from Christian Franke. - * include/grub/dl.h: Remove .previous, gas supports this only + * include/VasEBoot/dl.h: Remove .previous, gas supports this only for ELF format. - * include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE): + * include/VasEBoot/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE): Remove .type, gas supports this only for ELF format. - * kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing + * kern/dl.c (VasEBoot_dl_resolve_dependencies): Add check for trailing nullbytes in symbol table. This fixes an infinite loop if table is zero filled. * Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT, TARGET_IMG_LDFLAGS and EXEEXT. - * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by + * aclocal.m4 (VasEBoot_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by TARGET_IMG_LDFLAGS_AC. - (grub_CHECK_STACK_ARG_PROBE): New function. + (VasEBoot_CHECK_STACK_ARG_PROBE): New function. * conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS. @@ -43906,7 +43906,7 @@ * configure.ac: Add check for linker script "conf/${target}-img-ld.c" to set TARGET_IMG_LD* accordingly. Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly. - Add call to grub_CHECK_STACK_ARG_PROBE. + Add call to VasEBoot_CHECK_STACK_ARG_PROBE. Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols. * genkernsyms.sh.in: Handle HAVE_ASM_USCORE case. @@ -43920,7 +43920,7 @@ (ascii.pff): Generate fonts for $(UNICODE_ARROWS) and $(UNICODE_LINES) as well. - * util/update-grub_lib.in (font_path): Prefer ascii.pff over complete + * util/update-VasEBoot_lib.in (font_path): Prefer ascii.pff over complete fonts, because the latter are too slow. 2008-07-21 Bean @@ -43930,7 +43930,7 @@ 2008-07-18 Pavel Roskin - * kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P. We cannot + * kern/dl.c: Go back to using VasEBoot_CPU_SIZEOF_VOID_P. We cannot load foreign architecture modules correctly anyway. Keep support for loading host architecture modules, whether we compile them or not. @@ -43944,9 +43944,9 @@ * disk/efi/efidisk.c: Fix format warnings on x86_64. * kern/efi/efi.c: Likewise. - * aclocal.m4 (grub_PROG_TARGET_CC): New macro. Check if the + * aclocal.m4 (VasEBoot_PROG_TARGET_CC): New macro. Check if the target compiler is functional. - * configure.ac: Call grub_PROG_TARGET_CC once all target flags + * configure.ac: Call VasEBoot_PROG_TARGET_CC once all target flags are set up. * configure.ac: Default to efi platform for x86_64-apple. Allow @@ -43967,8 +43967,8 @@ * Makefile.in (RMKFILES): s/i386-linuxbios.rmk/i386-coreboot.rmk/g. * configure.ac: Accept "coreboot" as input platform (but maintain compatibility with "linuxbios"). - * include/grub/i386/linuxbios: Renamed to ... - * include/grub/i386/coreboot: ... this. + * include/VasEBoot/i386/linuxbios: Renamed to ... + * include/VasEBoot/i386/coreboot: ... this. 2008-07-17 Bean @@ -43985,9 +43985,9 @@ * conf/x86_64-efi.rmk: New file. - * disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N + * disk/efi/efidisk.c (VasEBoot_efidisk_read): Wrap efi calls with efi_call_N macro. - (grub_efidisk_write): Likewise. + (VasEBoot_efidisk_write): Likewise. * include/efi/api.h (efi_call_0): New macro. (efi_call_1): Likewise. @@ -43997,17 +43997,17 @@ (efi_call_5): Likewise. (efi_call_6): Likewise. - * include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to - grub_rescue_cmd_chainloader. + * include/VasEBoot/efi/chainloader.h (VasEBoot_chainloader_cmd): Rename to + VasEBoot_rescue_cmd_chainloader. - * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro. - (grub_pe32_optional_header): Change some fields based on i386 or + * include/VasEBoot/efi/pe32.h (VasEBoot_PE32_MACHINE_X86_64): New macro. + (VasEBoot_pe32_optional_header): Change some fields based on i386 or x86_64 platform. - (GRUB_PE32_PE32_MAGIC): Likewise. + (VasEBoot_PE32_PE32_MAGIC): Likewise. - * include/grub/efi/uga_draw.h: New file. + * include/VasEBoot/efi/uga_draw.h: New file. - * include/grub/elf.h (STN_ABS): New constant. + * include/VasEBoot/elf.h (STN_ABS): New constant. (R_X86_64_NONE): Relocation constant for x86_64. (R_X86_64_64): Likewise. (R_X86_64_PC32): Likewise. @@ -44025,71 +44025,71 @@ (R_X86_64_8): Likewise. (R_X86_64_PC8): Likewise. - * include/grub/i386/efi/pci.h: New file. + * include/VasEBoot/i386/efi/pci.h: New file. - * include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE): + * include/VasEBoot/i386/linux.h (VasEBoot_LINUX_EFI_SIGNATURE): Change it value based on platform. - (GRUB_LINUX_EFI_SIGNATURE_0204): New constant. - (GRUB_E820_RAM): Likewise. - (GRUB_E820_RESERVED): Likewise. - (GRUB_E820_ACPI): Likewise. - (GRUB_E820_NVS): Likewise. - (GRUB_E820_EXEC_CODE): Likewise. - (GRUB_E820_MAX_ENTRY): Likewise. - (grub_e820_mmap): New structure. + (VasEBoot_LINUX_EFI_SIGNATURE_0204): New constant. + (VasEBoot_E820_RAM): Likewise. + (VasEBoot_E820_RESERVED): Likewise. + (VasEBoot_E820_ACPI): Likewise. + (VasEBoot_E820_NVS): Likewise. + (VasEBoot_E820_EXEC_CODE): Likewise. + (VasEBoot_E820_MAX_ENTRY): Likewise. + (VasEBoot_e820_mmap): New structure. (linux_kernel_header): Change the efi field according to different kernel version, also field from linux_kernel_header. - * include/grub/kernel.h (grub_module_info): Add padding for x86_64. + * include/VasEBoot/kernel.h (VasEBoot_module_info): Add padding for x86_64. - * include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant. - (GRUB_PCI_ADDR_SPACE_MEMORY): Likewise. - (GRUB_PCI_ADDR_SPACE_IO): Likewise. - (GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise. - (GRUB_PCI_ADDR_MEM_TYPE_32): Likewise. - (GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise. - (GRUB_PCI_ADDR_MEM_TYPE_64): Likewise. - (GRUB_PCI_ADDR_MEM_PREFETCH): Likewise. - (GRUB_PCI_ADDR_MEM_MASK): Likewise. - (GRUB_PCI_ADDR_IO_MASK): Likewise. + * include/VasEBoot/pci.h (VasEBoot_PCI_ADDR_SPACE_MASK): New constant. + (VasEBoot_PCI_ADDR_SPACE_MEMORY): Likewise. + (VasEBoot_PCI_ADDR_SPACE_IO): Likewise. + (VasEBoot_PCI_ADDR_MEM_TYPE_MASK): Likewise. + (VasEBoot_PCI_ADDR_MEM_TYPE_32): Likewise. + (VasEBoot_PCI_ADDR_MEM_TYPE_1M): Likewise. + (VasEBoot_PCI_ADDR_MEM_TYPE_64): Likewise. + (VasEBoot_PCI_ADDR_MEM_PREFETCH): Likewise. + (VasEBoot_PCI_ADDR_MEM_MASK): Likewise. + (VasEBoot_PCI_ADDR_IO_MASK): Likewise. - * include/grub/x86_64/efi/kernel.h: New file. + * include/VasEBoot/x86_64/efi/kernel.h: New file. - * include/grub/x86_64/efi/loader.h: Likewise. + * include/VasEBoot/x86_64/efi/loader.h: Likewise. - * include/grub/x86_64/efi/machine.h: Likewise. + * include/VasEBoot/x86_64/efi/machine.h: Likewise. - * include/grub/x86_64/efi/pci.h: Likewise. + * include/VasEBoot/x86_64/efi/pci.h: Likewise. - * include/grub/x86_64/efi/time.h: Likewise. + * include/VasEBoot/x86_64/efi/time.h: Likewise. - * include/grub/x86_64/linux.h: Likewise. + * include/VasEBoot/x86_64/linux.h: Likewise. - * include/grub/x86_64/setjmp.h: Likewise. + * include/VasEBoot/x86_64/setjmp.h: Likewise. - * include/grub/x86_64/time.h: Likewise. + * include/VasEBoot/x86_64/time.h: Likewise. - * include/grub/x86_64/types.h: Likewise. + * include/VasEBoot/x86_64/types.h: Likewise. - * kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to - GRUB_TARGET_SIZEOF_VOID_P. + * kern/dl.c (VasEBoot_CPU_SIZEOF_VOID_P): Changed to + VasEBoot_TARGET_SIZEOF_VOID_P. - * kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls. - (grub_efi_locate_handle): Likewise. - (grub_efi_open_protocol): Likewise. - (grub_efi_set_text_mode): Likewise. - (grub_efi_stall): Likewise. - (grub_exit): Likewise. - (grub_reboot): Likewise. - (grub_halt): Likewise. - (grub_efi_exit_boot_services): Likewise. - (grub_get_rtc): Likewise. + * kern/efi/efi.c (VasEBoot_efi_locate_protocol): Wrap efi calls. + (VasEBoot_efi_locate_handle): Likewise. + (VasEBoot_efi_open_protocol): Likewise. + (VasEBoot_efi_set_text_mode): Likewise. + (VasEBoot_efi_stall): Likewise. + (VasEBoot_exit): Likewise. + (VasEBoot_reboot): Likewise. + (VasEBoot_halt): Likewise. + (VasEBoot_efi_exit_boot_services): Likewise. + (VasEBoot_get_rtc): Likewise. * kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models. - (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. - (grub_efi_allocate_pages): Wrap efi calls. - (grub_efi_free_pages): Wrap efi calls. - (grub_efi_get_memory_map): Wrap efi calls. + (VasEBoot_CPU_SIZEOF_VOID_P): Changed to VasEBoot_TARGET_SIZEOF_VOID_P. + (VasEBoot_efi_allocate_pages): Wrap efi calls. + (VasEBoot_efi_free_pages): Wrap efi calls. + (VasEBoot_efi_get_memory_map): Wrap efi calls. * kern/x86_64/dl.c: New file. @@ -44100,81 +44100,81 @@ * loader/efi/appleloader.c: Likewise. * loader/efi/chainloader.c (cmdline): New variable. - (grub_chainloader_unload): Wrap efi calls. - (grub_chainloader_boot): Likewise. - (grub_rescue_cmd_chainloader): Wrap efi calls, handle + (VasEBoot_chainloader_unload): Wrap efi calls. + (VasEBoot_chainloader_boot): Likewise. + (VasEBoot_rescue_cmd_chainloader): Wrap efi calls, handle command line. * loader/efi/chainloader_normal.c (chainloader_command): - Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass + Change VasEBoot_chainloader_cmd to VasEBoot_rescue_cmd_chainloader, pass command line. * loader/i386/efi/linux.c (allocate_pages): Change allocation method. - (grub_e820_add_region): New function. - (grub_linux_boot): Construct e820 map from efi map, handle x86_64 + (VasEBoot_e820_add_region): New function. + (VasEBoot_linux_boot): Construct e820 map from efi map, handle x86_64 booting. - (grub_find_video_card): New function. - (grub_linux_setup_video): New function. - (grub_rescue_cmd_linux): Probe for video information. + (VasEBoot_find_video_card): New function. + (VasEBoot_linux_setup_video): New function. + (VasEBoot_rescue_cmd_linux): Probe for video information. * normal/x86_64/setjmp.S: New file. * term/efi/console.c (map_char): New function. - (grub_console_putchar): Map unicode char. - (grub_console_checkkey): Wrap efi calls. - (grub_console_getkey): Likewise. - (grub_console_getwh): Likewise. - (grub_console_gotoxy): Likewise. - (grub_console_cls): Likewise. - (grub_console_setcolorstate): Likewise. - (grub_console_setcursor): Likewise. + (VasEBoot_console_putchar): Map unicode char. + (VasEBoot_console_checkkey): Wrap efi calls. + (VasEBoot_console_getkey): Likewise. + (VasEBoot_console_getwh): Likewise. + (VasEBoot_console_gotoxy): Likewise. + (VasEBoot_console_cls): Likewise. + (VasEBoot_console_setcolorstate): Likewise. + (VasEBoot_console_setcursor): Likewise. - * util/i386/efi/grub-mkimage.c: Add support for x86_64. + * util/i386/efi/VasEBoot-mkimage.c: Add support for x86_64. 2008-07-16 Pavel Roskin * loader/i386/efi/linux.c (allocate_pages): Fix warnings in format strings. - * util/i386/efi/grub-mkimage.c (get_target_address): Return a + * util/i386/efi/VasEBoot-mkimage.c (get_target_address): Return a pointer, not an integer. This fixes a warning and prevents precision loss on 64-bit systems. (relocate_addresses): Remove unneeded cast. 2008-07-15 Pavel Roskin - * kern/i386/ieee1275/init.c: Include grub/cache.h. + * kern/i386/ieee1275/init.c: Include VasEBoot/cache.h. * term/ieee1275/ofconsole.c: Disable code unused on i386. - * kern/ieee1275/ieee1275.c (grub_ieee1275_get_integer_property): + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_get_integer_property): Fix comparison between signed and unsigned. - * include/grub/i386/ieee1275/console.h: Declare - grub_console_init() and grub_console_fini(). + * include/VasEBoot/i386/ieee1275/console.h: Declare + VasEBoot_console_init() and VasEBoot_console_fini(). - * loader/i386/ieee1275/linux.c (grub_set_bootpath): Remove. + * loader/i386/ieee1275/linux.c (VasEBoot_set_bootpath): Remove. It's empty and unused. - * fs/ext2.c (grub_ext2_read_block): Initialize blknr in the + * fs/ext2.c (VasEBoot_ext2_read_block): Initialize blknr in the beginning to avoid warnings with some compilers. - * loader/ieee1275/multiboot2.c: Include grub/machine/loader.h. - [__i386__] (grub_mb2_arch_boot): Avoid unnecessary cast. + * loader/ieee1275/multiboot2.c: Include VasEBoot/machine/loader.h. + [__i386__] (VasEBoot_mb2_arch_boot): Avoid unnecessary cast. 2008-07-14 Pavel Roskin - * kern/env.c (grub_register_variable_hook): Don't copy empty - string, it leaks memory. Pass "" to grub_env_set(), it should + * kern/env.c (VasEBoot_register_variable_hook): Don't copy empty + string, it leaks memory. Pass "" to VasEBoot_env_set(), it should handle constant strings. - * commands/blocklist.c (grub_cmd_blocklist): Fix format warning. - * commands/cmp.c (grub_cmd_cmp): Likewise. - * kern/dl.c (grub_dl_flush_cache): Likewise. - (grub_dl_load_core): Likewise. - * kern/elf.c (grub_elf32_load_phdrs): Likewise. - (grub_elf64_load_phdrs): Likewise. + * commands/blocklist.c (VasEBoot_cmd_blocklist): Fix format warning. + * commands/cmp.c (VasEBoot_cmd_cmp): Likewise. + * kern/dl.c (VasEBoot_dl_flush_cache): Likewise. + (VasEBoot_dl_load_core): Likewise. + * kern/elf.c (VasEBoot_elf32_load_phdrs): Likewise. + (VasEBoot_elf64_load_phdrs): Likewise. 2008-07-13 Pavel Roskin @@ -44186,31 +44186,31 @@ * Makefile.in (enable_lzo): New rule. - * conf/i386-pc.rmk (grub_mkimage_SOURCES): New test with enable_lzo. + * conf/i386-pc.rmk (VasEBoot_mkimage_SOURCES): New test with enable_lzo. * configure.ac (ENABLE_LZO): New option --enable-lzo. * boot/i386/pc/lnxboot.S: #include . - * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): Change + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_KERNEL_MACHINE_RAW_SIZE): Change its value according to the compression algorithm used, lzo or lzma. - * util/i386/pc/grub-mkimage.c (compress_kernel): Use different + * util/i386/pc/VasEBoot-mkimage.c (compress_kernel): Use different compression algorithm according to configure macro. * kern/i386/pc/startup.S (codestart): Likewise. * kern/i386/pc/lzma_decode.S: New file. - * include/grub/lib/LzFind.h: Likewise. + * include/VasEBoot/lib/LzFind.h: Likewise. - * include/grub/lib/LzHash.h: Likewise. + * include/VasEBoot/lib/LzHash.h: Likewise. - * include/grub/lib/LzmaDec.h: Likewise. + * include/VasEBoot/lib/LzmaDec.h: Likewise. - * include/grub/lib/LzmaEnc.h: Likewise. + * include/VasEBoot/lib/LzmaEnc.h: Likewise. - * include/grub/lib/LzmaTypes.h: Likewise. + * include/VasEBoot/lib/LzmaTypes.h: Likewise. * lib/LzFind.c: Likewise. @@ -44221,32 +44221,32 @@ 2008-07-13 Bean * fs/ext2.c (EXT4_EXTENTS_FLAG): New macro. - (grub_ext4_extent_header): New structure. - (grub_ext4_extent): Likewise. - (grub_ext4_extent_idx): Likewise. - (grub_ext4_find_leaf): New function. - (grub_ext2_read_block): Handle extents. + (VasEBoot_ext4_extent_header): New structure. + (VasEBoot_ext4_extent): Likewise. + (VasEBoot_ext4_extent_idx): Likewise. + (VasEBoot_ext4_find_leaf): New function. + (VasEBoot_ext2_read_block): Handle extents. 2008-07-12 Robert Millan - * util/i386/pc/grub-mkrescue.in: s/grub-install/grub-mkrescue/g. + * util/i386/pc/VasEBoot-mkrescue.in: s/VasEBoot-install/VasEBoot-mkrescue/g. 2008-07-11 Robert Millan - * util/grub.d/40_custom.in: New file. Example on how to add custom - entries to /etc/grub.d. - * conf/common.rmk (%, update-grub_SCRIPTS, CLEANFILES): Install - 40_custom (implicitly, by merging all the grub.d rules). + * util/VasEBoot.d/40_custom.in: New file. Example on how to add custom + entries to /etc/VasEBoot.d. + * conf/common.rmk (%, update-VasEBoot_SCRIPTS, CLEANFILES): Install + 40_custom (implicitly, by merging all the VasEBoot.d rules). 2008-07-11 Pavel Roskin - * commands/read.c (grub_getline): Fix invalid memory access. + * commands/read.c (VasEBoot_getline): Fix invalid memory access. Don't add newline to the variable value. - * term/i386/pc/serial.c (GRUB_SERIAL_PORT_NUM): New constant. - [!GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Add COM2 and COM3. + * term/i386/pc/serial.c (VasEBoot_SERIAL_PORT_NUM): New constant. + [!VasEBoot_MACHINE_PCBIOS] (serial_hw_io_addr): Add COM2 and COM3. (serial_hw_get_port): Check validity of the port number. - (grub_cmd_serial): Check return value of serial_hw_get_port(). + (VasEBoot_cmd_serial): Check return value of serial_hw_get_port(). 2008-07-07 Pavel Roskin @@ -44256,7 +44256,7 @@ 2008-07-05 Pavel Roskin - * disk/ata.c (grub_ata_dumpinfo): Don't output addressing and + * disk/ata.c (VasEBoot_ata_dumpinfo): Don't output addressing and size for ATAPI devices, they are undefined. Output sector number in decimal form. @@ -44264,24 +44264,24 @@ 2008-07-04 Pavel Roskin - * kern/i386/linuxbios/init.c (grub_machine_init): Cast addr to - grub_addr_t before casting it to the void pointer to fix a + * kern/i386/linuxbios/init.c (VasEBoot_machine_init): Cast addr to + VasEBoot_addr_t before casting it to the void pointer to fix a warning. Non-addressable regions are discarded earlier. - (grub_arch_modules_addr): Cast _end to grub_addr_t. - * kern/i386/linuxbios/table.c: Include grub/misc.h. + (VasEBoot_arch_modules_addr): Cast _end to VasEBoot_addr_t. + * kern/i386/linuxbios/table.c: Include VasEBoot/misc.h. (check_signature): Don't shadow table_header. - (grub_linuxbios_table_iterate): Cast numeric constants to - grub_linuxbios_table_header_t. - * include/grub/i386/linuxbios/init.h: Add noreturn attribute to - grub_stop(). + (VasEBoot_linuxbios_table_iterate): Cast numeric constants to + VasEBoot_linuxbios_table_header_t. + * include/VasEBoot/i386/linuxbios/init.h: Add noreturn attribute to + VasEBoot_stop(). - * kern/ieee1275/init.c: Cast _start and _end to grub_addr_t to + * kern/ieee1275/init.c: Cast _start and _end to VasEBoot_addr_t to prevent warnings. - * include/grub/misc.h (ALIGN_UP): Avoid unnecessary cast to a + * include/VasEBoot/misc.h (ALIGN_UP): Avoid unnecessary cast to a pointer, which can cause warnings. Support 64-bit addresses. - * util/elf/grub-mkimage.c: Use GRUB_TARGET_SIZEOF_LONG instead + * util/elf/VasEBoot-mkimage.c: Use VasEBoot_TARGET_SIZEOF_LONG instead of sizeof(long). This fixes PowerPC image generation on x86_64. 2008-07-04 Robert Millan @@ -44294,34 +44294,34 @@ raise an error when their own hooks caused early abortion of its iteration. - * kern/device.c (grub_device_open): Improve error message. - * disk/lvm.c (grub_lvm_open): Likewise. - * disk/raid.c (grub_raid_open): Likewise. + * kern/device.c (VasEBoot_device_open): Improve error message. + * disk/lvm.c (VasEBoot_lvm_open): Likewise. + * disk/raid.c (VasEBoot_raid_open): Likewise. * partmap/pc.c (pc_partition_map_iterate): Abort parent iteration - when hook requests it, independently of grub_errno. + when hook requests it, independently of VasEBoot_errno. (pc_partition_map_probe): Do not fail when find_func() caused early abortion of pc_partition_map_iterate(). * partmap/gpt.c (gpt_partition_map_iterate): Abort parent iteration - when hook requests it, independently of grub_errno. + when hook requests it, independently of VasEBoot_errno. (gpt_partition_map_probe): Do not fail when find_func() caused early abortion of gpt_partition_map_iterate(). - * kern/partition.c (grub_partition_iterate): Abort parent iteration - when hook requests it, independently of grub_errno. Do not fail when + * kern/partition.c (VasEBoot_partition_iterate): Abort parent iteration + when hook requests it, independently of VasEBoot_errno. Do not fail when part_map_iterate_hook() caused early abortion of p->iterate(). - * util/biosdisk.c (grub_util_biosdisk_get_grub_dev): Do not fail - when grub_partition_iterate() returned with non-zero. + * util/biosdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Do not fail + when VasEBoot_partition_iterate() returned with non-zero. 2008-07-03 Pavel Roskin - * disk/ata.c (grub_ata_pio_write): Check status before writing, - like we do in grub_ata_pio_read(). - (grub_ata_readwrite): Always write individual sectors. Fix the + * disk/ata.c (VasEBoot_ata_pio_write): Check status before writing, + like we do in VasEBoot_ata_pio_read(). + (VasEBoot_ata_readwrite): Always write individual sectors. Fix the sector count for the remainder. - (grub_ata_write): Enable writing to ATA devices. Correctly + (VasEBoot_ata_write): Enable writing to ATA devices. Correctly report error for ATAPI devices. 2008-07-02 Pavel Roskin @@ -44329,85 +44329,85 @@ * boot/i386/pc/cdboot.S: Add _start entry to fix a linker warning. - * disk/ata.c (grub_ata_readwrite): Don't increment sector number + * disk/ata.c (VasEBoot_ata_readwrite): Don't increment sector number for every read sector, we already increment it for the whole batch. This fixes reading more than 256 sectors at once. - * util/grub-editenv.c (cmd_info): Cast argument to long + * util/VasEBoot-editenv.c (cmd_info): Cast argument to long explicitly. ptrdiff_t reduces to int on i386. - * util/grub-editenv.c (main): Be specific which parameter is + * util/VasEBoot-editenv.c (main): Be specific which parameter is missing. * disk/memdisk.c (memdisk_addr): Make a pointer to fix warnings. (memdisk): Make memdisk_orig_addr a pointer. - * fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t - for file offsets, use grub_off_t instead. Fix printf format + * fs/reiserfs.c (VasEBoot_reiserfs_read): Fix misuse of VasEBoot_size_t + for file offsets, use VasEBoot_off_t instead. Fix printf format warnings. * fs/reiserfs.c: Remove #warning, TODO list items don't belong there. Real unexpected warnings should not drown in the noise about known problems. - * commands/hexdump.c (grub_cmd_hexdump): Fix misuse of - grub_disk_addr_t for memory addresses. + * commands/hexdump.c (VasEBoot_cmd_hexdump): Fix misuse of + VasEBoot_disk_addr_t for memory addresses. - * loader/aout.c (grub_aout_load): Cast load_addr to pointer + * loader/aout.c (VasEBoot_aout_load): Cast load_addr to pointer explicitly to fix a warning. - * util/grub-editenv.c (cmd_info): Fix warning in printf format. + * util/VasEBoot-editenv.c (cmd_info): Fix warning in printf format. * Makefile.in (MODULE_LDFLAGS): New variable. - * aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if + * aclocal.m4 (VasEBoot_PROG_LD_BUILD_ID_NONE): New macro. Check if the linker accepts --build-id=none. - * configure.ac: Call grub_PROG_LD_BUILD_ID_NONE. Substitute + * configure.ac: Call VasEBoot_PROG_LD_BUILD_ID_NONE. Substitute MODULE_LDFLAGS. * genmk.rb: Use MODULE_LDFLAGS when linking modules. - * fs/xfs.c (struct grub_xfs_dir_header): Use names similar to + * fs/xfs.c (struct VasEBoot_xfs_dir_header): Use names similar to those in Linux XFS code. Provide a way to access 64-bit parent inode. - (grub_xfs_iterate_dir): Use the new names. Avoid reading past - the end of struct grub_xfs_dir_header. + (VasEBoot_xfs_iterate_dir): Use the new names. Avoid reading past + the end of struct VasEBoot_xfs_dir_header. 2008-07-02 Bean - * include/grub/ieee1275.h (grub_ieee1275_flag): New constant - GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM - and GRUB_IEEE1275_FLAG_NO_ANSI. + * include/VasEBoot/ieee1275.h (VasEBoot_ieee1275_flag): New constant + VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET, VasEBoot_IEEE1275_FLAG_FORCE_CLAIM + and VasEBoot_IEEE1275_FLAG_NO_ANSI. - * kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set flag - GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM - and GRUB_IEEE1275_FLAG_NO_ANSI for Open Hackware. + * kern/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set flag + VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET, VasEBoot_IEEE1275_FLAG_FORCE_CLAIM + and VasEBoot_IEEE1275_FLAG_NO_ANSI for Open Hackware. - * kern/ieee1275/ieee1275.c (grub_ieee1275_interpret): Return - immediately if GRUB_IEEE1275_FLAG_CANNOT_INTERPRET is set. + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_interpret): Return + immediately if VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET is set. - * kern/ieee1275/init.c (grub_claim_heap): Claim memory directly if - GRUB_IEEE1275_FLAG_FORCE_CLAIM is set. + * kern/ieee1275/init.c (VasEBoot_claim_heap): Claim memory directly if + VasEBoot_IEEE1275_FLAG_FORCE_CLAIM is set. - * term/ieee1275/ofconsole.c (grub_ofconsole_writeesc): Don't output + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_writeesc): Don't output esc sequence on non ANSI terminal. - (grub_ofconsole_gotoxy): Emulate backspace key on non ANSI terminal. + (VasEBoot_ofconsole_gotoxy): Emulate backspace key on non ANSI terminal. - * util/elf/grub-mkimage.c (add_segments): Move ELF header to the + * util/elf/VasEBoot-mkimage.c (add_segments): Move ELF header to the beginning of file. 2008-07-02 Bean - * conf/common.rmk (bin_UTILITIES): Add grub-editenv. - (grub_editenv_SOURCES): New variable. + * conf/common.rmk (bin_UTILITIES): Add VasEBoot-editenv. + (VasEBoot_editenv_SOURCES): New variable. (pkglib_MODULES): Add loadenv.mod. (loadenv_mod_SOURCES): New variable. (loadenv_mod_CFLAGS): Likewise. (loadenv_mod_LDFLAGS): Likewise. - * include/grub/envblk.h: New file. + * include/VasEBoot/envblk.h: New file. * util/envblk.c: New file. - * util/grub-editenv.c: New file. + * util/VasEBoot-editenv.c: New file. * commands/loadenv.c: New file. @@ -44423,50 +44423,50 @@ * term/tparm.c (analyze): Always set *popcount. - * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Remove useless + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_linux): Remove useless cast to fix a warning. - * loader/i386/pc/multiboot2.c (grub_mb2_arch_module_alloc): Use + * loader/i386/pc/multiboot2.c (VasEBoot_mb2_arch_module_alloc): Use cast to suppress a warning. - * fs/afs.c (grub_afs_read_block): Return grub_disk_addr_t, as - grub_fshelp_read_file() expects. + * fs/afs.c (VasEBoot_afs_read_block): Return VasEBoot_disk_addr_t, as + VasEBoot_fshelp_read_file() expects. * fs/fat.c: Fix UUID calculation on big-endian systems. We write uuid as a 32-bit value in CPU byte order, so declare and use it as such. - * disk/raid.c: Cast grub_dprintf() arguments to unsigned long + * disk/raid.c: Cast VasEBoot_dprintf() arguments to unsigned long long if the format specifier expects it. * partmap/gpt.c (gpt_partition_map_iterate): Likewise. * partmap/pc.c (pc_partition_map_iterate): Likewise. - * fs/ntfs.c (grub_ntfs_uuid): Cast data->uuid to unsigned long + * fs/ntfs.c (VasEBoot_ntfs_uuid): Cast data->uuid to unsigned long long to fix a warning. - * fs/reiserfs.c (grub_reiserfs_read): Change casts in - grub_dprintf() arguments to fix warnings. + * fs/reiserfs.c (VasEBoot_reiserfs_read): Change casts in + VasEBoot_dprintf() arguments to fix warnings. 2008-06-30 Pavel Roskin - * util/i386/pc/grub-setup.c (setup): Write install_dos_part and + * util/i386/pc/VasEBoot-setup.c (setup): Write install_dos_part and install_bsd_part immediately before core.img is embedded or modified on disk. This fixes core.img verification if core.img cannot be embedded. - * util/i386/pc/grub-setup.c (setup): Use core_path_dev, not + * util/i386/pc/VasEBoot-setup.c (setup): Use core_path_dev, not core_path to calculate the blocklist. Patch from Javier Martín 2008-06-29 Robert Millan - * fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro. Maps filesystem + * fs/xfs.c (VasEBoot_XFS_FSB_TO_BLOCK): New macro. Maps filesystem block to disk block. - (grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result. + (VasEBoot_xfs_read_block): Use VasEBoot_XFS_FSB_TO_BLOCK() on result. Patch from Niels Böhm 2008-06-29 Robert Millan - * util/update-grub_lib.in (font_path): Search for fonts in - /boot/grub first, which is more likely to be readable (we aren't + * util/update-VasEBoot_lib.in (font_path): Search for fonts in + /boot/VasEBoot first, which is more likely to be readable (we aren't deciding where fonts live, just looking for them). 2008-06-26 Pavel Roskin @@ -44474,7 +44474,7 @@ * util/biosdisk.c (read_device_map): Don't leave dead map entries for devices failing stat() check. - * util/i386/pc/grub-setup.c (setup): Don't reuse core_path, use + * util/i386/pc/VasEBoot-setup.c (setup): Don't reuse core_path, use core_path_dev for the core.img path on the target device. 2008-06-26 Robert Millan @@ -44483,35 +44483,35 @@ * conf/common.rmk (pkglib_MODULES): Add `fs_uuid.mod'. (fs_uuid_mod_SOURCES, fs_uuid_mod_CFLAGS) (fs_uuid_mod_LDFLAGS): New variables. - * include/grub/disk.h (grub_disk_dev_id): Add - `GRUB_DISK_DEVICE_UUID_ID'. - * kern/disk.c (grub_disk_dev_iterate): Allow disk devices not to + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add + `VasEBoot_DISK_DEVICE_UUID_ID'. + * kern/disk.c (VasEBoot_disk_dev_iterate): Allow disk devices not to implement iterate(). 2008-06-26 Robert Millan - * util/grub.d/10_linux.in: Avoid passing UUIDs to Linux when either - "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" does not exist, or when a + * util/VasEBoot.d/10_linux.in: Avoid passing UUIDs to Linux when either + "/dev/disk/by-uuid/${VasEBoot_DEVICE_UUID}" does not exist, or when a Linux image includes no initrd. 2008-06-21 Javier Martín - * util/i386/pc/grub-setup.c (setup): Remove literal "core.img" in a + * util/i386/pc/VasEBoot-setup.c (setup): Remove literal "core.img" in a call to resolve the core image location that effectively appended the name twice. 2008-06-21 Robert Millan - * util/grub.d/00_header.in: Move last prepare_grub_to_access_device() + * util/VasEBoot.d/00_header.in: Move last prepare_VasEBoot_to_access_device() call from here ... - * util/grub.d/10_hurd.in: ... to here ... - * util/grub.d/10_linux.in: ... and here. + * util/VasEBoot.d/10_hurd.in: ... to here ... + * util/VasEBoot.d/10_linux.in: ... and here. 2008-06-19 Robert Millan - * kern/main.c (grub_main): Export `prefix' variable immediately - after it has been set by grub_machine_set_prefix(). + * kern/main.c (VasEBoot_main): Export `prefix' variable immediately + after it has been set by VasEBoot_machine_set_prefix(). 2008-06-19 Robert Millan @@ -44521,22 +44521,22 @@ 2008-06-19 Robert Millan - * util/update-grub_lib.in (prepare_grub_to_access_device): Remove - check for partition that provides /boot/grub. Its logic is flawed, - as it prevents prepare_grub_to_access_device() from being called + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): Remove + check for partition that provides /boot/VasEBoot. Its logic is flawed, + as it prevents prepare_VasEBoot_to_access_device() from being called multiple times. 2008-06-19 Robert Millan - * util/update-grub_lib.in (prepare_grub_to_access_device): Issue + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): Issue "insmod" command directly when abstraction modules are needed, - instead of relying on GRUB_PRELOAD_MODULES (which had no effect + instead of relying on VasEBoot_PRELOAD_MODULES (which had no effect since it had already been processed). 2008-06-19 Pavel Roskin - * conf/i386-efi.rmk: Recompile grub-mkimage.c if Makefile has - changed. This is needed in case GRUB_LIBDIR changes. + * conf/i386-efi.rmk: Recompile VasEBoot-mkimage.c if Makefile has + changed. This is needed in case VasEBoot_LIBDIR changes. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/i386-pc.rmk: Likewise. @@ -44551,15 +44551,15 @@ 2008-06-18 Robert Millan - * util/i386/pc/grub-install.in: If the drive is LVM or RAID, prepend + * util/i386/pc/VasEBoot-install.in: If the drive is LVM or RAID, prepend it in prefix. - * util/i386/pc/grub-setup.c (main): Don't handle prefix at all. Set + * util/i386/pc/VasEBoot-setup.c (main): Don't handle prefix at all. Set `must_embed' to 1 when root_dev is a RAID device. When dest_dev is a RAID device, run setup() for all members independently on whether LVM abstraction is being used. - (setup): Don't handle prefix at all; let grub-mkimage take care of it. - If grub-mkimage has set `*install_dos_part == -2', don't override this + (setup): Don't handle prefix at all; let VasEBoot-mkimage take care of it. + If VasEBoot-mkimage has set `*install_dos_part == -2', don't override this value. Perform *install_dos_part adjustments independently on whether we're embedding or not. @@ -44569,24 +44569,24 @@ 2008-06-17 Robert Millan * term/ieee1275/ofconsole.c (fgcolor, bgcolor): Remove variables. - (grub_ofconsole_normal_color, grub_ofconsole_highlight_color): New + (VasEBoot_ofconsole_normal_color, VasEBoot_ofconsole_highlight_color): New variables. - (grub_ofconsole_setcolor, grub_ofconsole_getcolor): Load/store - values in grub_ofconsole_normal_color and - grub_ofconsole_highlight_color (they're not directly related to + (VasEBoot_ofconsole_setcolor, VasEBoot_ofconsole_getcolor): Load/store + values in VasEBoot_ofconsole_normal_color and + VasEBoot_ofconsole_highlight_color (they're not directly related to background and foreground). - (grub_ofconsole_setcolorstate): Extract background and foreground - from grub_ofconsole_normal_color and grub_ofconsole_highlight_color. + (VasEBoot_ofconsole_setcolorstate): Extract background and foreground + from VasEBoot_ofconsole_normal_color and VasEBoot_ofconsole_highlight_color. 2008-06-17 Robert Millan - * util/update-grub_lib.in (prepare_grub_to_access_device): Use - /boot/grub for the check in last commit, not /boot (they could be + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): Use + /boot/VasEBoot for the check in last commit, not /boot (they could be different partitions). 2008-06-16 Robert Millan - * util/update-grub_lib.in (prepare_grub_to_access_device): If we were + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): If we were asked to setup access for the same partition that provides /boot, don't bother using UUIDs since our root already has the value we want. @@ -44599,131 +44599,131 @@ 2008-06-16 Robert Millan - * util/update-grub.in: Check for $EUID instead of $UID. + * util/update-VasEBoot.in: Check for $EUID instead of $UID. Reported by Vincent Zweije. 2008-06-16 Bean - * fs/ext2.c (grub_ext2_blockgroup): Revert to pre-journal state. - (grub_ext2_read_block): Likewise. - (grub_ext2_read_inode): Likewise. - (grub_ext2_mount): Likewise. - (grub_ext2_close): Likewise. - (grub_ext3_get_journal): Removed. + * fs/ext2.c (VasEBoot_ext2_blockgroup): Revert to pre-journal state. + (VasEBoot_ext2_read_block): Likewise. + (VasEBoot_ext2_read_inode): Likewise. + (VasEBoot_ext2_mount): Likewise. + (VasEBoot_ext2_close): Likewise. + (VasEBoot_ext3_get_journal): Removed. - * fs/reiserfs.c (grub_reiserfs_get_item): Revert to pre-journal state. - (grub_reiserfs_read_symlink): Likewise. - (grub_reiserfs_mount): Likewise. - (grub_reiserfs_open): Likewise. - (grub_reiserfs_read): Likewise. - (grub_reiserfs_close): Likewise. - (grub_reiserfs_get_journal): Removed. + * fs/reiserfs.c (VasEBoot_reiserfs_get_item): Revert to pre-journal state. + (VasEBoot_reiserfs_read_symlink): Likewise. + (VasEBoot_reiserfs_mount): Likewise. + (VasEBoot_reiserfs_open): Likewise. + (VasEBoot_reiserfs_read): Likewise. + (VasEBoot_reiserfs_close): Likewise. + (VasEBoot_reiserfs_get_journal): Removed. - * fs/fshelp.c (grub_fshelp_read): Removed. - (grub_fshelp_map_block): Likewise. + * fs/fshelp.c (VasEBoot_fshelp_read): Removed. + (VasEBoot_fshelp_map_block): Likewise. - * include/grub/fshelp.h (grub_fshelp_journal_type): Removed. - (grub_fshelp_journal): Likewise. - (grub_fshelp_read): Likewise. - (grub_fshelp_map_block): Likewise. + * include/VasEBoot/fshelp.h (VasEBoot_fshelp_journal_type): Removed. + (VasEBoot_fshelp_journal): Likewise. + (VasEBoot_fshelp_read): Likewise. + (VasEBoot_fshelp_map_block): Likewise. 2008-06-16 Pavel Roskin * conf/powerpc-ieee1275.rmk: Remove -msoft-float, we don't use floating point anymore. - * include/grub/powerpc/libgcc.h: Leave only necessary exports. + * include/VasEBoot/powerpc/libgcc.h: Leave only necessary exports. 2008-06-15 Pavel Roskin - * commands/ls.c (grub_ls_list_files): Use integer calculations + * commands/ls.c (VasEBoot_ls_list_files): Use integer calculations for human readable format, avoid floating point use. - * kern/misc.c (grub_ftoa): Remove. - (grub_vsprintf): Remove floating point support. + * kern/misc.c (VasEBoot_ftoa): Remove. + (VasEBoot_vsprintf): Remove floating point support. 2008-06-15 Robert Millan - * util/grub.d/10_linux.in: Use the underlying device for loop-AES + * util/VasEBoot.d/10_linux.in: Use the underlying device for loop-AES devices. Reported by Max Vozeler. 2008-06-15 Robert Millan - * util/i386/pc/grub-mkimage.c (generate_image): If we included a drive + * util/i386/pc/VasEBoot-mkimage.c (generate_image): If we included a drive in our prefix, set install_{dos,bsd}_part = -2 to indicate this can be skipped later. (main): If a memdisk was requested, add "(memdisk)" drive explicitly to the beginning of the prefix. * kern/i386/pc/init.c (make_install_device): Remove memdisk check. - It is assumed that if we have a memdisk, grub-mkimage has set - grub_prefix to include the "(memdisk)" drive in it. + It is assumed that if we have a memdisk, VasEBoot-mkimage has set + VasEBoot_prefix to include the "(memdisk)" drive in it. 2008-06-15 Robert Millan - * term/i386/pc/console.c [GRUB_MACHINE_LINUXBIOS] (grub_console_init): + * term/i386/pc/console.c [VasEBoot_MACHINE_LINUXBIOS] (VasEBoot_console_init): Initialize keyboard controller after registering the terminal, so that - grub_printf() can be called from grub_keyboard_controller_init(). + VasEBoot_printf() can be called from VasEBoot_keyboard_controller_init(). 2008-06-15 Robert Millan - * fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in + * fs/sfs.c (VasEBoot_sfs_read_extent): Fix the count of nodes in extent-btree which is written as big endian on disk. Reported by Alain Greppin . 2008-06-14 Robert Millan - * util/i386/efi/grub-install.in (modules): Remove `_chain'. - * util/i386/pc/grub-install.in (modules): Likewise. + * util/i386/efi/VasEBoot-install.in (modules): Remove `_chain'. + * util/i386/pc/VasEBoot-install.in (modules): Likewise. 2008-06-13 Pavel Roskin - * commands/ls.c (grub_ls_list_files): Fix format warnings. + * commands/ls.c (VasEBoot_ls_list_files): Fix format warnings. 2008-06-13 Bean - * commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition. + * commands/hexdump.c (VasEBoot_cmd_hexdump): Adjust offset for partition. - * fs/ext2.c (grub_ext3_get_journal): Fix revoke block handling. + * fs/ext2.c (VasEBoot_ext3_get_journal): Fix revoke block handling. - * fs/fshelp.c (grub_fshelp_map_block): Don't map block 0 as it's used + * fs/fshelp.c (VasEBoot_fshelp_map_block): Don't map block 0 as it's used to indicate sparse block. 2008-06-12 Pavel Roskin - * fs/ext2.c (grub_ext2_read_inode): Don't normalize block - number, grub_fshelp_read() does it for us. + * fs/ext2.c (VasEBoot_ext2_read_inode): Don't normalize block + number, VasEBoot_fshelp_read() does it for us. - * fs/fshelp.c (grub_fshelp_read): New function. Implement + * fs/fshelp.c (VasEBoot_fshelp_read): New function. Implement linear disk read with journal translation. - * fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read(). - * include/grub/fshelp.h: Declare grub_fshelp_read(). + * fs/ext2.c: Use VasEBoot_fshelp_read() instead of VasEBoot_disk_read(). + * include/VasEBoot/fshelp.h: Declare VasEBoot_fshelp_read(). 2008-06-09 Pavel Roskin - * fs/minix.c (grub_minix_mount): Handle error reading + * fs/minix.c (VasEBoot_minix_mount): Handle error reading superblock. 2008-06-08 Robert Millan - * util/i386/pc/grub-setup.c (main): If install drive is an LVM, + * util/i386/pc/VasEBoot-setup.c (main): If install drive is an LVM, don't append the RAID prefix afterwards. Reported by Clint Adams. 2008-06-08 Robert Millan Based on description from Pavel: - * kern/disk.c (grub_disk_check_range): Rename to ... - (grub_disk_adjust_range): ... this. Add a comment explaining the + * kern/disk.c (VasEBoot_disk_check_range): Rename to ... + (VasEBoot_disk_adjust_range): ... this. Add a comment explaining the tasks performed by this function. 2008-06-08 Robert Millan - * include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to + * include/VasEBoot/ntfs.h (struct VasEBoot_ntfs_bpb): Rename `serial_number' to `num_serial' (for consistency with other variables). - (struct grub_ntfs_data): Add `uuid' member. - * fs/ntfs.c (grub_ntfs_mount): Initialize `data->uuid'. - (grub_ntfs_uuid): New function. - (grub_ntfs_fs): Reference grub_ntfs_uuid() in `uuid' struct member. + (struct VasEBoot_ntfs_data): Add `uuid' member. + * fs/ntfs.c (VasEBoot_ntfs_mount): Initialize `data->uuid'. + (VasEBoot_ntfs_uuid): New function. + (VasEBoot_ntfs_fs): Reference VasEBoot_ntfs_uuid() in `uuid' struct member. 2008-06-07 Pavel Roskin @@ -44733,14 +44733,14 @@ 2008-06-06 Robert Millan - Ensure GRUB_KERNEL_MACHINE_DATA_END is always consistent with the - rest of GRUB, and breakage doesn't happen if its value were modified. + Ensure VasEBoot_KERNEL_MACHINE_DATA_END is always consistent with the + rest of VasEBoot, and breakage doesn't happen if its value were modified. - * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): - Redefine as an offset from `GRUB_KERNEL_MACHINE_DATA_END' instead of + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_KERNEL_MACHINE_RAW_SIZE): + Redefine as an offset from `VasEBoot_KERNEL_MACHINE_DATA_END' instead of a constant (same value). * kern/i386/pc/startup.S: Replace hardcoded `0x50' with - `GRUB_KERNEL_MACHINE_DATA_END' (same value). + `VasEBoot_KERNEL_MACHINE_DATA_END' (same value). 2008-06-06 Robert Millan @@ -44749,27 +44749,27 @@ 2008-06-06 Robert Millan - * util/grub-emu.c (grub_machine_init): Move code in this function from + * util/VasEBoot-emu.c (VasEBoot_machine_init): Move code in this function from here ... - (main): ... to here (before grub_util_biosdisk_init() call, to prevent - segfault in case grub_printf() is called). + (main): ... to here (before VasEBoot_util_biosdisk_init() call, to prevent + segfault in case VasEBoot_printf() is called). - * util/i386/pc/grub-install.in: Append `--device-map=${device_map}' to - grub_probe. Update all users not to explicitly add it again. - (grub_device): New variable; contains corresponding device for grubdir. + * util/i386/pc/VasEBoot-install.in: Append `--device-map=${device_map}' to + VasEBoot_probe. Update all users not to explicitly add it again. + (VasEBoot_device): New variable; contains corresponding device for VasEBootdir. (fs_module, partmap_module, devabstraction_module): Pass - `--device ${grub_device}' to grub_probe to avoid traversing /dev + `--device ${VasEBoot_device}' to VasEBoot_probe to avoid traversing /dev every time. 2008-06-05 Robert Millan - * normal/misc.c (grub_normal_print_device_info): When a filesystem UUID + * normal/misc.c (VasEBoot_normal_print_device_info): When a filesystem UUID is found, print it (same layout as with labels). 2008-06-04 Robert Millan * util/biosdisk.c (get_drive): Rename to ... - (find_grub_drive): ... this. Update all users. + (find_VasEBoot_drive): ... this. Update all users. (get_os_disk): Rename to ... (convert_system_partition_to_system_disk): ... this. Update all users. @@ -44780,7 +44780,7 @@ 2008-06-04 Robert Millan * util/biosdisk.c (get_os_disk): Handle IDA devices. - * util/grub-mkdevicemap.c (get_mmc_disk_name) + * util/VasEBoot-mkdevicemap.c (get_mmc_disk_name) (make_device_map): Likewise. 2008-06-01 Robert Millan @@ -44788,32 +44788,32 @@ * util/biosdisk.c (get_drive): Verify that `map[i].drive' is non-NULL before dereferencing it. - * fs/fat.c (struct grub_fat_bpb): Move fat32-specific fields into a + * fs/fat.c (struct VasEBoot_fat_bpb): Move fat32-specific fields into a union with fat12/fat16-specific ones. Add some new fields, including `num_serial' for both versions. - (struct grub_fat_data): Add `uuid' member. - (grub_fat_mount): Refer to fat32-specific fields in `bpb' by their new + (struct VasEBoot_fat_data): Add `uuid' member. + (VasEBoot_fat_mount): Refer to fat32-specific fields in `bpb' by their new names. Initialize `data->uuid' using `num_serial'. - (grub_fat_uuid): New function. - (grub_fat_fs): Reference grub_fat_uuid() in `uuid' struct member. + (VasEBoot_fat_uuid): New function. + (VasEBoot_fat_fs): Reference VasEBoot_fat_uuid() in `uuid' struct member. - * fs/reiserfs.c (grub_reiserfs_superblock): Add `uuid' field. - (grub_reiserfs_uuid): New function. - (grub_reiserfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct + * fs/reiserfs.c (VasEBoot_reiserfs_superblock): Add `uuid' field. + (VasEBoot_reiserfs_uuid): New function. + (VasEBoot_reiserfs_fs): Reference VasEBoot_reiserfs_uuid() in `uuid' struct member. - * fs/xfs.c (grub_xfs_sblock): Add `uuid' field. - (grub_xfs_uuid): New function. - (grub_xfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct member. + * fs/xfs.c (VasEBoot_xfs_sblock): Add `uuid' field. + (VasEBoot_xfs_uuid): New function. + (VasEBoot_xfs_fs): Reference VasEBoot_reiserfs_uuid() in `uuid' struct member. 2008-06-01 Robert Millan - * util/update-grub_lib.in (prepare_grub_to_access_device): Generate + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): Generate code that is backward compatible with pre-uuid search command. 2008-05-31 Robert Millan - * disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Iterate through + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_iterate): Iterate through floppies after everything else, to ensure floppy drive isn't accessed unnecessarily (patch from Bean). @@ -44824,19 +44824,19 @@ 2008-05-31 Robert Millan - * term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): Implement + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_setcursor): Implement using "cursor-on" and "cursor-off" commands (understood at least by the Open Firmware flavour on OLPC). 2008-05-31 Michael Gorven - * term/terminfo.c (grub_terminfo_set_current): Correct vt100 cursor + * term/terminfo.c (VasEBoot_terminfo_set_current): Correct vt100 cursor on and off sequences. 2008-05-31 Robert Millan - * util/update-grub_lib.in: Replace `grub-probe' with `${grub_probe}'. - * util/update-grub.in: Likewise. + * util/update-VasEBoot_lib.in: Replace `VasEBoot-probe' with `${VasEBoot_probe}'. + * util/update-VasEBoot.in: Likewise. 2008-05-30 Pavel Roskin @@ -44848,92 +44848,92 @@ 2008-05-30 Robert Millan - * util/update-grub.in (GRUB_DISABLE_LINUX_UUID): Export variable. - * util/grub.d/10_linux.in: If GRUB_DEVICE_UUID is set, and - GRUB_DISABLE_LINUX_UUID isn't true, use the filesystem UUIDs as + * util/update-VasEBoot.in (VasEBoot_DISABLE_LINUX_UUID): Export variable. + * util/VasEBoot.d/10_linux.in: If VasEBoot_DEVICE_UUID is set, and + VasEBoot_DISABLE_LINUX_UUID isn't true, use the filesystem UUIDs as the `root' parameter to Linux. 2008-05-30 Robert Millan * commands/search.c (options): Rename --fs_uuid to --fs-uuid. - * util/update-grub_lib.in (prepare_grub_to_access_device): Replace + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): Replace --fs_uuid with --fs-uuid. - * util/update-grub.in: Allow filesystem UUID probes to fail (since not + * util/update-VasEBoot.in: Allow filesystem UUID probes to fail (since not all filesystems support them). 2008-05-30 Robert Millan - * fs/ext2.c (grub_ext2_uuid): Use `04x' instead of '02x' as - grub_printf() flags, since we're printing in units of 2 bytes. + * fs/ext2.c (VasEBoot_ext2_uuid): Use `04x' instead of '02x' as + VasEBoot_printf() flags, since we're printing in units of 2 bytes. 2008-05-30 Robert Millan - * util/grub.d/00_header.in: Remove obsolete comment referencing - convert_system_path_to_grub_path(). - * util/update-grub.in: Likewise. - * util/update-grub_lib.in (is_path_readable_by_grub): New function. - (convert_system_path_to_grub_path): Add a warning message explaining - that this function is deprecated. Rely on is_path_readable_by_grub() + * util/VasEBoot.d/00_header.in: Remove obsolete comment referencing + convert_system_path_to_VasEBoot_path(). + * util/update-VasEBoot.in: Likewise. + * util/update-VasEBoot_lib.in (is_path_readable_by_VasEBoot): New function. + (convert_system_path_to_VasEBoot_path): Add a warning message explaining + that this function is deprecated. Rely on is_path_readable_by_VasEBoot() for the readability checks. - (font_path): Use is_path_readable_by_grub() for the readability - check rather than convert_system_path_to_grub_path(). + (font_path): Use is_path_readable_by_VasEBoot() for the readability + check rather than convert_system_path_to_VasEBoot_path(). 2008-05-30 Robert Millan - * util/update-grub_lib.in (prepare_grub_to_access_device): New function. - * util/update-grub.in: Set `GRUB_FONT_PATH' to the system path, without + * util/update-VasEBoot_lib.in (prepare_VasEBoot_to_access_device): New function. + * util/update-VasEBoot.in: Set `VasEBoot_FONT_PATH' to the system path, without converting it first. - * util/grub.d/00_header.in: Use prepare_grub_to_access_device() to setup - grub.cfg for access to font file, and afterwards call it again to set + * util/VasEBoot.d/00_header.in: Use prepare_VasEBoot_to_access_device() to setup + VasEBoot.cfg for access to font file, and afterwards call it again to set the root device. 2008-05-30 Robert Millan * commands/search.c (options): Add --fs_uuid option. (search_fs_uuid): New function. - (grub_cmd_search): Fix --set argument passing. + (VasEBoot_cmd_search): Fix --set argument passing. Use search_fs_uuid() when requested via --fs_uuid. - (grub_search_init): Update help message. - * fs/ext2.c (struct grub_ext2_sblock): Rename `unique_id' to `uuid' + (VasEBoot_search_init): Update help message. + * fs/ext2.c (struct VasEBoot_ext2_sblock): Rename `unique_id' to `uuid' and redeclare it as an array of 16-bit words. - (grub_ext2_uuid): New function. - (grub_ext2_fs): Reference grub_ext2_uuid() in `uuid' struct member. - * include/grub/fs.h (struct grub_fs): Add `uuid' struct member. - * util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT) - (GRUB_DEVICE_BOOT_UUID): New variables. - (GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove. - * util/grub.d/00_header.in: Set root using `search --fs_uuid' command + (VasEBoot_ext2_uuid): New function. + (VasEBoot_ext2_fs): Reference VasEBoot_ext2_uuid() in `uuid' struct member. + * include/VasEBoot/fs.h (struct VasEBoot_fs): Add `uuid' struct member. + * util/update-VasEBoot.in (VasEBoot_DEVICE_UUID, VasEBoot_DEVICE_BOOT) + (VasEBoot_DEVICE_BOOT_UUID): New variables. + (VasEBoot_DRIVE. VasEBoot_DRIVE_BOOT. VasEBoot_DRIVE_BOOT_VasEBoot): Remove. + * util/VasEBoot.d/00_header.in: Set root using `search --fs_uuid' command whenever possible. - * util/grub.d/10_hurd.in: Avoid explicit use of root drive. Instead, + * util/VasEBoot.d/10_hurd.in: Avoid explicit use of root drive. Instead, just assume `root' variable has the right value. - * util/grub.d/10_linux.in: Likewise. - * util/grub-probe.c (probe): Probe for filesystem UUID when requested + * util/VasEBoot.d/10_linux.in: Likewise. + * util/VasEBoot-probe.c (probe): Probe for filesystem UUID when requested via PRINT_FS_UUID. (main): Recognise `-t fs_uuid' argument. 2008-05-30 Robert Millan * util/biosdisk.c (map): Redefine structure to hold information - about GRUB drive name. + about VasEBoot drive name. (get_drive): Reimplement without assuming (and verifying) BIOS-like drive names. (call_hook): Remove. - (grub_util_biosdisk_iterate): Access drive names via `.drive' struct + (VasEBoot_util_biosdisk_iterate): Access drive names via `.drive' struct member. Assume drive has partitions. - (grub_util_biosdisk_open): Access device names via `.device' struct + (VasEBoot_util_biosdisk_open): Access device names via `.device' struct member. (open_device): Likewise. (find_drive): Likewise. (read_device_map): Adjust map[] usage to match the new struct definition. Don't check for duplicates (still possible, but not cheap anymore). - (grub_util_biosdisk_fini): Free malloced buffers referenced by map[]. + (VasEBoot_util_biosdisk_fini): Free malloced buffers referenced by map[]. (make_device_name): Remove assumption of BIOS-like drive names. 2008-05-30 Pavel Roskin * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Remove, as - compiling execute.c doesn't need grub_script.tab.h anymore. + compiling execute.c doesn't need VasEBoot_script.tab.h anymore. (normal/command.c_DEPENDENCIES): Likewise. (normal/function.c_DEPENDENCIES): Likewise. * conf/i386-ieee1275.rmk: Likewise. @@ -44944,10 +44944,10 @@ 2008-05-29 Pavel Roskin - * disk/lvm.c (grub_lvm_scan_device): Check for the buffer end + * disk/lvm.c (VasEBoot_lvm_scan_device): Check for the buffer end when scanning metadata for volume group name. - * include/grub/script.h: Don't include grub_script.tab.h. It's + * include/VasEBoot/script.h: Don't include VasEBoot_script.tab.h. It's a generated file, which may only be included from the files with DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE, use union YYSTYPE, as the later allows forward declaration. @@ -44955,24 +44955,24 @@ 2008-05-29 Robert Millan - * term/i386/pc/at_keyboard.c: Include `grub/machine/machine.h'. + * term/i386/pc/at_keyboard.c: Include `VasEBoot/machine/machine.h'. (OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): New macros. - [GRUB_MACHINE_IEEE1275] (keyboard_map): Add OLPC scan codes - (grub_console_checkkey): Add grub_dprintf() call to report unknown + [VasEBoot_MACHINE_IEEE1275] (keyboard_map): Add OLPC scan codes + (VasEBoot_console_checkkey): Add VasEBoot_dprintf() call to report unknown scan codes. 2008-05-29 Robert Millan - * term/i386/pc/at_keyboard.c (grub_console_checkkey): Add support for + * term/i386/pc/at_keyboard.c (VasEBoot_console_checkkey): Add support for control key combinations. 2008-05-29 Robert Millan - * util/powerpc/ieee1275/grub-install.in: Move from here ... - * util/ieee1275/grub-install.in: ... to here. - * powerpc-ieee1275.rmk (grub_install_SOURCES): Update location. + * util/powerpc/ieee1275/VasEBoot-install.in: Move from here ... + * util/ieee1275/VasEBoot-install.in: ... to here. + * powerpc-ieee1275.rmk (VasEBoot_install_SOURCES): Update location. * i386-ieee1275.rmk (sbin_SCRIPTS): New variable. - (grub_install_SOURCES): Likewise. + (VasEBoot_install_SOURCES): Likewise. 2008-05-29 Robert Millan @@ -44982,12 +44982,12 @@ * fs/hfsplus.c: Likewise. * fs/ntfs.c: Likewise. * fs/xfs.c: Likewise. - * include/grub/fshelp.h: Likewise. - * util/grub-mkdevicemap.c: Likewise. + * include/VasEBoot/fshelp.h: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. 2008-05-28 Robert Millan - * util/update-grub.in: Allow chmod call to fail, since /boot/grub/ + * util/update-VasEBoot.in: Allow chmod call to fail, since /boot/VasEBoot/ might need to be fatfs to support some firmware implementations (e.g. OFW or EFI). @@ -44995,21 +44995,21 @@ * util/biosdisk.c (linux_find_partition, get_os_disk): Handle MMC devices. - * util/grub-mkdevicemap.c (get_mmc_disk_name) + * util/VasEBoot-mkdevicemap.c (get_mmc_disk_name) (make_device_map): Likewise. 2008-05-20 Bean - * fs/fshelp.c (grub_fshelp_map_block): New function. - (grub_fshelp_find_file): Use 64-bit type for pos and block address. + * fs/fshelp.c (VasEBoot_fshelp_map_block): New function. + (VasEBoot_fshelp_find_file): Use 64-bit type for pos and block address. Use `>>' and `&' operator to avoid 64-bit divide and modulo. - * include/grub/fshelp.h (grub_fshelp_journal_type): New enum. - (GRUB_FSHELP_JOURNAL_UNUSED_MAPPING): New macro. - (grub_fshelp_journal): New structure. - (grub_fshelp_map_block): New function prototype. - (grub_fshelp_read_file): Use grub_disk_addr_t as block type. - (grub_fshelp_map_block): Likewise. + * include/VasEBoot/fshelp.h (VasEBoot_fshelp_journal_type): New enum. + (VasEBoot_FSHELP_JOURNAL_UNUSED_MAPPING): New macro. + (VasEBoot_fshelp_journal): New structure. + (VasEBoot_fshelp_map_block): New function prototype. + (VasEBoot_fshelp_read_file): Use VasEBoot_disk_addr_t as block type. + (VasEBoot_fshelp_map_block): Likewise. * fs/ext2.c (EXT3_FEATURE_COMPAT_HAS_JOURNAL): New macro. (EXT3_JOURNAL_MAGIC_NUMBER): Likewise. @@ -45022,137 +45022,137 @@ (EXT3_JOURNAL_FLAG_SAME_UUID): Likewise. (EXT3_JOURNAL_FLAG_DELETED): Likewise. (EXT3_JOURNAL_FLAG_LAST_TAG): Likewise. - (grub_ext2_sblock): New members for journal support. - (grub_ext3_journal_header): New structure. - (grub_ext3_journal_revoke_header): Likewise. - (grub_ext3_journal_block_tag): Likewise. - (grub_ext3_journal_sblock): Likewise. - (grub_fshelp_node): New members logfile and journal. - (grub_ext2_read_block): Change block type to grub_disk_addr_t. Use - grub_fshelp_map_block to get real block number. - (grub_ext2_blockgroup): Use grub_fshelp_map_block to get real block + (VasEBoot_ext2_sblock): New members for journal support. + (VasEBoot_ext3_journal_header): New structure. + (VasEBoot_ext3_journal_revoke_header): Likewise. + (VasEBoot_ext3_journal_block_tag): Likewise. + (VasEBoot_ext3_journal_sblock): Likewise. + (VasEBoot_fshelp_node): New members logfile and journal. + (VasEBoot_ext2_read_block): Change block type to VasEBoot_disk_addr_t. Use + VasEBoot_fshelp_map_block to get real block number. + (VasEBoot_ext2_blockgroup): Use VasEBoot_fshelp_map_block to get real block number. - (grub_ext2_read_inode): Likewise. - (grub_ext3_get_journal): New function. - (grub_read_inode): Initialize journal using grub_ext3_get_journal. - (grub_ext2_close): Release memory used by journal. + (VasEBoot_ext2_read_inode): Likewise. + (VasEBoot_ext3_get_journal): New function. + (VasEBoot_read_inode): Initialize journal using VasEBoot_ext3_get_journal. + (VasEBoot_ext2_close): Release memory used by journal. * fs/reiserfs.c (REISERFS_MAGIC_STRING): Changed to "ReIsEr". (REISERFS_MAGIC_DESC_BLOCK): New macro. - (grub_reiserfs_transaction_header): Renamed to - grub_reiserfs_description_block, replace field data with real_blocks. - (grub_reiserfs_commit_block): New structure. - (grub_reiserfs_data): New member journal. - (grub_reiserfs_get_item): Use grub_fshelp_map_block to get real block + (VasEBoot_reiserfs_transaction_header): Renamed to + VasEBoot_reiserfs_description_block, replace field data with real_blocks. + (VasEBoot_reiserfs_commit_block): New structure. + (VasEBoot_reiserfs_data): New member journal. + (VasEBoot_reiserfs_get_item): Use VasEBoot_fshelp_map_block to get real block number. - (grub_reiserfs_read_symlink): Likewise. - (grub_reiserfs_iterate_dir): Likewise. - (grub_reiserfs_open): Likewise. - (grub_reiserfs_read): Likewise. - (grub_reiserfs_get_journal): New function. - (grub_reiserfs_mount): Use "ReIsEr" as super block magic, as there are + (VasEBoot_reiserfs_read_symlink): Likewise. + (VasEBoot_reiserfs_iterate_dir): Likewise. + (VasEBoot_reiserfs_open): Likewise. + (VasEBoot_reiserfs_read): Likewise. + (VasEBoot_reiserfs_get_journal): New function. + (VasEBoot_reiserfs_mount): Use "ReIsEr" as super block magic, as there are three varieties ReIsErFs, ReIsEr2Fs and ReIsEr3Fs. Initialize journal - using grub_reiserfs_get_journal. - (grub_reiserfs_close): Release memory used by journal. + using VasEBoot_reiserfs_get_journal. + (VasEBoot_reiserfs_close): Release memory used by journal. - * fs/affs.c (grub_affs_read_block): Change block type to - grub_disk_addr_t. Use grub_divmod64 to do 64-bit division. + * fs/affs.c (VasEBoot_affs_read_block): Change block type to + VasEBoot_disk_addr_t. Use VasEBoot_divmod64 to do 64-bit division. - * fs/afs.c (grub_afs_read_block): Change block type to grub_disk_addr_t. + * fs/afs.c (VasEBoot_afs_read_block): Change block type to VasEBoot_disk_addr_t. - * fs/hfsplus.c (grub_hfsplus_read_block): Likewise. + * fs/hfsplus.c (VasEBoot_hfsplus_read_block): Likewise. - * fs/ntfs.c (grub_ntfs_read_block): Likewise. + * fs/ntfs.c (VasEBoot_ntfs_read_block): Likewise. - * fs/udf.c (grub_udf_read_block): Change block type to - grub_disk_addr_t. Use type cast to avoid warning. + * fs/udf.c (VasEBoot_udf_read_block): Change block type to + VasEBoot_disk_addr_t. Use type cast to avoid warning. - * fs/xfs.c (grub_xfs_read_block): Likewise. + * fs/xfs.c (VasEBoot_xfs_read_block): Likewise. 2008-05-16 Christian Franke - * commands/cat.c (grub_cmd_cat): Remove non-ESC keys from keyboard queue + * commands/cat.c (VasEBoot_cmd_cat): Remove non-ESC keys from keyboard queue to ensure that break with ESC will always work. - * commands/sleep.c (grub_interruptible_millisleep): Likewise. + * commands/sleep.c (VasEBoot_interruptible_millisleep): Likewise. Remove ESC from keyboard queue. 2008-05-16 Christian Franke * util/biosdisk.c: [__CYGWIN__] Add includes. - (grub_util_biosdisk_open): Use Linux code also for Cygwin. + (VasEBoot_util_biosdisk_open): Use Linux code also for Cygwin. (get_os_disk): Move variable declarations to OS specific parts to avoid warning. [__GNU__] (get_os_disk): Fix /dev/sdXsN case. [__CYGWIN__] (get_os_disk): Add Cygwin /dev/sdXN device names. - (grub_util_biosdisk_get_grub_dev): Use Linux code also for + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Use Linux code also for Cygwin. * util/getroot.c: [__CYGWIN__] Add includes. (strip_extra_slashes): Fix "/" case. [__CYGWIN__] (get_win32_path): New function. - [__CYGWIN__] (grub_get_prefix): Add conversion to win32 path. + [__CYGWIN__] (VasEBoot_get_prefix): Add conversion to win32 path. [__CYGWIN__] (find_root_device): Disable. [__CYGWIN__] (get_bootsec_serial): New function. [__CYGWIN__] (find_cygwin_root_device): Likewise. - [__linux__] (grub_guess_root_device): Add early returns to simplify + [__linux__] (VasEBoot_guess_root_device): Add early returns to simplify structure. - [__CYGWIN__] (grub_guess_root_device): Call find_cygwin_root_device. - [__linux__] (grub_util_get_dev_abstraction): Enable LVM and RAID + [__CYGWIN__] (VasEBoot_guess_root_device): Call find_cygwin_root_device. + [__linux__] (VasEBoot_util_get_dev_abstraction): Enable LVM and RAID check for Linux only. 2008-05-15 Bean - * kern/i386/pc/startup.S (grub_console_getkey): Workaround for the + * kern/i386/pc/startup.S (VasEBoot_console_getkey): Workaround for the keyboard hang problem in apple's intel mac. 2008-05-09 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio devices. - * util/grub-mkdevicemap.c (get_virtio_disk_name) + * util/VasEBoot-mkdevicemap.c (get_virtio_disk_name) (make_device_map): Likewise. Reported by Aurelien Jarno 2008-05-07 Ian Campbell * util/biosdisk.c (get_os_disk): Recognise xvd type disks. - * util/grub-mkdevicemap.c (get_xvd_disk_name): New function. + * util/VasEBoot-mkdevicemap.c (get_xvd_disk_name): New function. (make_device_map): Output entries for xvd type disks. 2008-05-07 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle CCISS devices. - * util/grub-mkdevicemap.c (get_cciss_disk_name) + * util/VasEBoot-mkdevicemap.c (get_cciss_disk_name) (make_device_map): Likewise. Reported by Roland Dreier 2008-05-07 Robert Millan - * disk/lvm.c (grub_lvm_scan_device): Detect errors in an additional - grub_strstr() call. Correct a few mistakes in failure path handling. + * disk/lvm.c (VasEBoot_lvm_scan_device): Detect errors in an additional + VasEBoot_strstr() call. Correct a few mistakes in failure path handling. 2008-05-06 Robert Millan - * util/update-grub_lib.in (make_system_path_relative_to_its_root): + * util/update-VasEBoot_lib.in (make_system_path_relative_to_its_root): Do not print a trailing slash (therefore, the root directory is an empty string). - (convert_system_path_to_grub_path): Do not remove trailing slash + (convert_system_path_to_VasEBoot_path): Do not remove trailing slash from make_system_path_relative_to_its_root() output. - * util/i386/pc/grub-install.in: Add trailing slash to output from + * util/i386/pc/VasEBoot-install.in: Add trailing slash to output from make_system_path_relative_to_its_root(). 2008-05-06 Robert Millan - * util/grub-fstest.c (grub_refresh): Call `fflush (stdout)'. This + * util/VasEBoot-fstest.c (VasEBoot_refresh): Call `fflush (stdout)'. This ensures that output lines aren't intermangled with those sent to - stderr (via grub_util_info()). - * util/grub-probe.c (grub_refresh): Likewise. - * util/i386/pc/grub-setup.c (grub_refresh): Likewise. + stderr (via VasEBoot_util_info()). + * util/VasEBoot-probe.c (VasEBoot_refresh): Likewise. + * util/i386/pc/VasEBoot-setup.c (VasEBoot_refresh): Likewise. 2008-05-05 Christian Franke - * util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]: + * util/VasEBoot-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]: Add Cygwin device names. (get_ide_disk_name) [__CYGWIN__]: Likewise. (get_scsi_disk_name) [__CYGWIN__]: Likewise. @@ -45163,13 +45163,13 @@ 2008-04-30 Robert Millan Based on patch from Fabian Greffrath - * util/grub.d/10_linux.in: Add ${GRUB_CMDLINE_LINUX_DEFAULT} to the + * util/VasEBoot.d/10_linux.in: Add ${VasEBoot_CMDLINE_LINUX_DEFAULT} to the first boot option. - * util/update-grub.in: Export GRUB_CMDLINE_LINUX_DEFAULT. + * util/update-VasEBoot.in: Export VasEBoot_CMDLINE_LINUX_DEFAULT. 2008-04-29 Robert Millan - * docs/grub.cfg: New file (example GRUB configuration). + * docs/VasEBoot.cfg: New file (example VasEBoot configuration). 2008-04-26 Robert Millan @@ -45182,7 +45182,7 @@ * Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and i386-linuxbios. - * commands/hexdump.c (grub_cmd_hexdump): Support dumping of device, + * commands/hexdump.c (VasEBoot_cmd_hexdump): Support dumping of device, change the buffer size to 4096 for cdrom device. * conf/i386-ieee1275.rmk (pkglib_MODULES): Add _linux.mod, linux.mod @@ -45197,34 +45197,34 @@ (nand_mod_CFLAGS): Likewise. (nand_mod_LDFLAGS): Likewise. - * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Return - GRUB_ERR_UNKNOWN_DEVICE instead of GRUB_ERR_BAD_DEVICE if no device + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Return + VasEBoot_ERR_UNKNOWN_DEVICE instead of VasEBoot_ERR_BAD_DEVICE if no device type property. (nand device in olpc don't have this property) - * include/grub/disk.h (grub_disk_dev_id): New macro - GRUB_DISK_DEVICE_NAND_ID. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): New macro + VasEBoot_DISK_DEVICE_NAND_ID. - * include/grub/i386/ieee1275/loader.h (grub_rescue_cmd_linux): New + * include/VasEBoot/i386/ieee1275/loader.h (VasEBoot_rescue_cmd_linux): New function prototype. - (grub_rescue_cmd_initrd): Likewise. + (VasEBoot_rescue_cmd_initrd): Likewise. - * include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro. + * include/VasEBoot/i386/linux.h (VasEBoot_LINUX_OFW_SIGNATURE): New macro. (linux_kernel_params): Add new member ofw_signature, ofw_num_items, ofw_cif_handler and ofw_idt, adjust padding number. - * include/grub/i386/pc/memory.h (grub_upper_mem): Export it if - GRUB_MACHINE_IEEE1275 is defined. + * include/VasEBoot/i386/pc/memory.h (VasEBoot_upper_mem): Export it if + VasEBoot_MACHINE_IEEE1275 is defined. - * include/grub/ieee1275/ieee1275.h (grub_available_iterate): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_available_iterate): Use NESTED_FUNC_ATTR attribute on the hook parameter. - * kern/powerpc/ieee1275/init.c (grub_claim_heap): Use NESTED_FUNC_ATTR + * kern/powerpc/ieee1275/init.c (VasEBoot_claim_heap): Use NESTED_FUNC_ATTR on nested function heap_init. - (grub_upper_mem): New variable for i386-ieee1275. - (grub_get_extended_memory): New function for i386-ieee1275. - (grub_machine_init): Call grub_get_extended_memory for i386-ieee1275. + (VasEBoot_upper_mem): New variable for i386-ieee1275. + (VasEBoot_get_extended_memory): New function for i386-ieee1275. + (VasEBoot_machine_init): Call VasEBoot_get_extended_memory for i386-ieee1275. - * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use + * kern/powerpc/ieee1275/openfw.c (VasEBoot_available_iterate): Use NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type property. @@ -45236,33 +45236,33 @@ 2008-04-18 Thomas Schwinge - * util/i386/pc/grub-mkrescue.in (grub_mkimage): Don't overwrite correct + * util/i386/pc/VasEBoot-mkrescue.in (VasEBoot_mkimage): Don't overwrite correct value. - * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Likewise. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in (VasEBoot_mkimage): Likewise. 2008-04-18 Robert Millan - Restructures early code path on ieee1275 to unify grub_main() as + Restructures early code path on ieee1275 to unify VasEBoot_main() as the first C function that is executed in every platform. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_init): New prototype. - * kern/i386/ieee1275/startup.S (_start): Jump to grub_main() instead of + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_init): New prototype. + * kern/i386/ieee1275/startup.S (_start): Jump to VasEBoot_main() instead of cmain(). * kern/powerpc/ieee1275/crt0.S (_start): Likewise. * kern/ieee1275/cmain.c (cmain): Rename to ... - * kern/ieee1275/cmain.c (grub_ieee1275_init): ... this. - * kern/ieee1275/init.c (grub_machine_init): Call grub_ieee1275_init() + * kern/ieee1275/cmain.c (VasEBoot_ieee1275_init): ... this. + * kern/ieee1275/init.c (VasEBoot_machine_init): Call VasEBoot_ieee1275_init() at the beginning. 2008-04-18 Robert Millan - * util/update-grub.in: Fix syntax error when setting - `GRUB_PRELOAD_MODULES'. + * util/update-VasEBoot.in: Fix syntax error when setting + `VasEBoot_PRELOAD_MODULES'. Reported by Stephane Chazelas 2008-04-17 Lubomir Kundrak - * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text + * aclocal.m4 (VasEBoot_PROG_OBJCOPY_ABSOLUTE): take only .text section into account, newer toolchains generate unique build ids * configure.ac: remove the test for --build-id=none acceptance, we want build ids to be preserved @@ -45277,51 +45277,51 @@ 2008-04-14 Vesa Jaaskelainen - * disk/lvm.c (grub_lvm_scan_device): Add forgotten failure path when + * disk/lvm.c (VasEBoot_lvm_scan_device): Add forgotten failure path when there is no memory left for physical volume name. 2008-04-14 Vesa Jaaskelainen - * disk/lvm.c (grub_lvm_scan_device): Fix logical volume's physical + * disk/lvm.c (VasEBoot_lvm_scan_device): Fix logical volume's physical volume name mapping to support bigger than 9 character names properly. 2008-04-13 Robert Millan - * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check, + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_rw): Fix CHS limit check, as per http://www.allensmith.net/Storage/HDDlimit/Int13h.htm 2008-04-13 Christian Franke - * util/i386/pc/grub-mkrescue.in: Add --emulation=floppy + * util/i386/pc/VasEBoot-mkrescue.in: Add --emulation=floppy to create a floppy emulation boot CD when non emulation mode does not work. Enable Joliet CD filesystem extension. 2008-04-13 Robert Millan - * kern/misc.c (grub_strncat): Fix off-by-one error. + * kern/misc.c (VasEBoot_strncat): Fix off-by-one error. Reported by Zhang Huan - * kern/env.c (grub_env_context_close): Clear current context, not + * kern/env.c (VasEBoot_env_context_close): Clear current context, not previous one. Patch from Zhang Huan - * kern/misc.c (grub_strcat): Minor speed optimization (same code size). + * kern/misc.c (VasEBoot_strcat): Minor speed optimization (same code size). 2008-04-13 Robert Millan Improve robustness when handling LVM. - * disk/lvm.c (grub_lvm_getvalue): Return 0 when `*p' is NULL + * disk/lvm.c (VasEBoot_lvm_getvalue): Return 0 when `*p' is NULL (and leave `*p' unmodified). - (grub_lvm_iterate): Don't assume `vg->lvs != NULL' when iterating + (VasEBoot_lvm_iterate): Don't assume `vg->lvs != NULL' when iterating through it. - (grub_lvm_memberlist): Don't assume `lv->vg->pvs != NULL' when + (VasEBoot_lvm_memberlist): Don't assume `lv->vg->pvs != NULL' when iterating through it. - (grub_lvm_open): Don't assume `vg->lvs != NULL' when iterating + (VasEBoot_lvm_open): Don't assume `vg->lvs != NULL' when iterating through it. - (grub_lvm_scan_device): Check the return value (and fail gracefully - when due) on each grub_lvm_getvalue() or grub_strstr() call. + (VasEBoot_lvm_scan_device): Check the return value (and fail gracefully + when due) on each VasEBoot_lvm_getvalue() or VasEBoot_strstr() call. Don't assume `vg->pvs != NULL' when iterating through it. 2008-04-13 Robert Millan @@ -45333,12 +45333,12 @@ * genpartmaplist.sh: New file. * Makefile.in (pkglib_DATA): Add partmap.lst. (partmap.lst): New target rule. - * util/i386/pc/grub-mkrescue.in: Generate grub.cfg that loads needed + * util/i386/pc/VasEBoot-mkrescue.in: Generate VasEBoot.cfg that loads needed modules (including all partition maps), instead of preloading them. 2007-04-13 Fabian Greffrath - * util/grub.d/30_os-prober.in: New script. Use `os-prober' and + * util/VasEBoot.d/30_os-prober.in: New script. Use `os-prober' and `linux-boot-prober' (if installed) to detect other operating systems which are installed on the computer and add them to the boot menu. @@ -45365,14 +45365,14 @@ 2008-04-07 Robert Millan - Revert grub/machine/init.h addition by Pavel (since it breaks on + Revert VasEBoot/machine/init.h addition by Pavel (since it breaks on i386-ieee1275 and others): - * util/i386/pc/misc.c: Remove grub/machine/init.h. + * util/i386/pc/misc.c: Remove VasEBoot/machine/init.h. * util/powerpc/ieee1275/misc.c: Likewise. 2008-04-07 Robert Millan - * util/grub-probe.c (probe): Improve error message. + * util/VasEBoot-probe.c (probe): Improve error message. 2008-04-07 Robert Millan @@ -45382,40 +45382,40 @@ 2008-04-06 Pavel Roskin - * util/biosdisk.c: Include grub/util/biosdisk.h. - * util/grub-fstest.c (execute_command): Make static. - * util/grub-mkdevicemap.c (check_device): Likewise. - * util/i386/pc/misc.c: Include grub/machine/init.h. + * util/biosdisk.c: Include VasEBoot/util/biosdisk.h. + * util/VasEBoot-fstest.c (execute_command): Make static. + * util/VasEBoot-mkdevicemap.c (check_device): Likewise. + * util/i386/pc/misc.c: Include VasEBoot/machine/init.h. * util/powerpc/ieee1275/misc.c: Likewise. - * util/lvm.c: Include grub/util/lvm.h. - * util/misc.c: Include grub/kernel.h, grub/misc.h and - grub/cache.h. - * util/raid.c: Include grub/util/raid.h. - (grub_util_getdiskname): Make static. + * util/lvm.c: Include VasEBoot/util/lvm.h. + * util/misc.c: Include VasEBoot/kernel.h, VasEBoot/misc.h and + VasEBoot/cache.h. + * util/raid.c: Include VasEBoot/util/raid.h. + (VasEBoot_util_getdiskname): Make static. - * util/grub-emu.c (main): Remove calls to grub_hostfs_init() and - grub_hostfs_fini(), as they are called from grub_init_all() and - grub_fini_all() respectively. This fixes an infinite loop in - grub-fstest due to double registration of hostfs. + * util/VasEBoot-emu.c (main): Remove calls to VasEBoot_hostfs_init() and + VasEBoot_hostfs_fini(), as they are called from VasEBoot_init_all() and + VasEBoot_fini_all() respectively. This fixes an infinite loop in + VasEBoot-fstest due to double registration of hostfs. Reported by Christian Franke 2008-04-05 Pavel Roskin - * bus/pci.c (grub_pci_iterate): For multifunction devices, probe + * bus/pci.c (VasEBoot_pci_iterate): For multifunction devices, probe all 8 functions. Otherwise, probe function 0 only. 2008-04-04 Pavel Roskin - * commands/lspci.c (grub_lspci_iter): Print the bus number + * commands/lspci.c (VasEBoot_lspci_iter): Print the bus number correctly. - * commands/lspci.c (grub_pci_classes): Fix typos. - (grub_lspci_iter): Don't print func twice. Print vendor ID + * commands/lspci.c (VasEBoot_pci_classes): Fix typos. + (VasEBoot_lspci_iter): Don't print func twice. Print vendor ID before device ID, as it's normally done. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Fix signedness warnings. - * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): + * kern/powerpc/ieee1275/openfw.c (VasEBoot_available_iterate): Likewise. * util/ieee1275/get_disk_name.c: Include config.h so that _GNU_SOURCE is defined and getline() is declared. Mark an @@ -45428,125 +45428,125 @@ * gensymlist.sh.in: Likewise. Assert at the compile time that the symbol table is not empty. - * disk/raid.c (grub_raid_memberlist): Fix a signedness warning. - * fs/cpio.c (grub_cpio_read): Likewise. + * disk/raid.c (VasEBoot_raid_memberlist): Fix a signedness warning. + * fs/cpio.c (VasEBoot_cpio_read): Likewise. 2008-04-01 Pavel Roskin - * disk/ata.c (grub_ata_open): Don't lose precision in disk->id. - * disk/host.c (grub_host_open): Likewise. - * disk/loopback.c (grub_loopback_open): Likewise. - * disk/memdisk.c (grub_memdisk_open): Use a string pointer for + * disk/ata.c (VasEBoot_ata_open): Don't lose precision in disk->id. + * disk/host.c (VasEBoot_host_open): Likewise. + * disk/loopback.c (VasEBoot_loopback_open): Likewise. + * disk/memdisk.c (VasEBoot_memdisk_open): Use a string pointer for disk->id as in disk/host.c, not a multi-character constant. - * util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The + * util/VasEBoot-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The later is obsolete, potentially dangerous and sets a bad example. - * util/i386/efi/grub-mkimage.c (make_header): Likewise. - * util/misc.c (grub_util_get_image_size): Likewise. + * util/i386/efi/VasEBoot-mkimage.c (make_header): Likewise. + * util/misc.c (VasEBoot_util_get_image_size): Likewise. * disk/loopback.c (options): Improve help for "--partitions". - * normal/arg.c (grub_arg_show_help): Fix spacing of the long + * normal/arg.c (VasEBoot_arg_show_help): Fix spacing of the long options to align them with the short options, e.g. "echo -e". 2008-03-31 Bean - * video/reader/png.c (grub_png_data): New member is_16bit and + * video/reader/png.c (VasEBoot_png_data): New member is_16bit and image_data. - (grub_png_decode_image_header): Detect 16 bit png image. - (grub_png_convert_image): New function to convert 16 bit image to 8 bit. - (grub_png_decode_png): Call grub_png_convert_image for 16 bit image. - (grub_video_reader_png): Release memory occupied by image_data. + (VasEBoot_png_decode_image_header): Detect 16 bit png image. + (VasEBoot_png_convert_image): New function to convert 16 bit image to 8 bit. + (VasEBoot_png_decode_png): Call VasEBoot_png_convert_image for 16 bit image. + (VasEBoot_video_reader_png): Release memory occupied by image_data. * fs/ntfs.c (find_attr): Handle non-resident attribute list larger than 4096 bytes. - (grub_nfs_mount): Skip the test for sector per cluster. + (VasEBoot_nfs_mount): Skip the test for sector per cluster. - * include/grub/ntfs.h (MAX_SPC): Removed. + * include/VasEBoot/ntfs.h (MAX_SPC): Removed. 2008-03-31 Bean * conf/common.rmk (pkgdata_MODULES): Add afs.mod. - (grub_probe_SOURCES): Add fs/afs.c. - (grub_fstest_SOURCES): Likewise. + (VasEBoot_probe_SOURCES): Add fs/afs.c. + (VasEBoot_fstest_SOURCES): Likewise. (afs_mod_SOURCES): New variable. (afs_mod_CFLAGS): Likewise. (afs_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/afs.c. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/afs.c. + (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. * fs/afs.c: New file. 2008-03-30 Pavel Roskin - * disk/host.c: Include grub/misc.h to fix a warning. - * util/hostfs.c: Use GRUB_MOD_INIT and GRUB_MOD_FINI to fix + * disk/host.c: Include VasEBoot/misc.h to fix a warning. + * util/hostfs.c: Use VasEBoot_MOD_INIT and VasEBoot_MOD_FINI to fix warnings about implicit declarations. - * fs/udf.c (grub_udf_mount): Fix warning about a shadowing a + * fs/udf.c (VasEBoot_udf_mount): Fix warning about a shadowing a variable. - * include/grub/i386/loader.h: Change declaration of - grub_linux_boot() to match what grub_loader_set() expects. - * util/getroot.c (grub_guess_root_device): Return const char* to + * include/VasEBoot/i386/loader.h: Change declaration of + VasEBoot_linux_boot() to match what VasEBoot_loader_set() expects. + * util/getroot.c (VasEBoot_guess_root_device): Return const char* to fix a warning. - * util/grub-probe.c (probe): Fix a warning about uninitialized + * util/VasEBoot-probe.c (probe): Fix a warning about uninitialized abstraction_name variable. - * util/i386/get_disk_name.c (grub_util_get_disk_name): Mark + * util/i386/get_disk_name.c (VasEBoot_util_get_disk_name): Mark second argument as unused to fix a warning. - * loader/i386/pc/multiboot2.c (grub_mb2_arch_elf64_hook): Add - missing grub_error() call. + * loader/i386/pc/multiboot2.c (VasEBoot_mb2_arch_elf64_hook): Add + missing VasEBoot_error() call. - * util/update-grub_lib.in: Define datarootdir, since Autoconf + * util/update-VasEBoot_lib.in: Define datarootdir, since Autoconf 2.60 and newer uses it to define datadir. * commands/sleep.c: Fix warning about implicit declaration. * disk/memdisk.c: Likewise. * loader/aout.c: Likewise. * loader/i386/bsd_normal.c: Likewise. - * util/grub-probe.c: Likewise. + * util/VasEBoot-probe.c: Likewise. * commands/i386/cpuid.c (has_longmode): Make static. * disk/i386/pc/biosdisk.c (cd_drive): Likewise. - * include/grub/i386/bsd.h (bios_memmap_t): Remove, it's unused. + * include/VasEBoot/i386/bsd.h (bios_memmap_t): Remove, it's unused. * kern/i386/pc/startup.S (real_to_prot): Use %cs prefix to load GDT. This is more robust, as %ds can change. - (grub_biosdisk_rw_int13_extensions): Don't clear %ds before + (VasEBoot_biosdisk_rw_int13_extensions): Don't clear %ds before calling real_to_prot(). - (grub_biosdisk_get_diskinfo_int13_extensions): Likewise. + (VasEBoot_biosdisk_get_diskinfo_int13_extensions): Likewise. 2008-03-28 Pavel Roskin * kern/i386/pc/startup.S: Assert that uncompressed functions - don't spill beyond GRUB_KERNEL_MACHINE_RAW_SIZE. + don't spill beyond VasEBoot_KERNEL_MACHINE_RAW_SIZE. * kern/i386/pc/lzo1x.S: Remove all .align directives in the code, as they push parts of the code (error handlers) beyond - GRUB_KERNEL_MACHINE_RAW_SIZE. Speed is not as important in this + VasEBoot_KERNEL_MACHINE_RAW_SIZE. Speed is not as important in this code as correctness and size. 2008-03-28 Pavel Roskin * kern/i386/pc/startup.S - (grub_biosdisk_get_diskinfo_int13_extensions): When converting + (VasEBoot_biosdisk_get_diskinfo_int13_extensions): When converting data block address to the real mode, keep offset minimal. This works around a bug in AWARD BIOS on old Athlon systems, which makes CD detection hang. 2008-03-26 Pavel Roskin - * normal/color.c (grub_parse_color_name_pair): Make `name' a + * normal/color.c (VasEBoot_parse_color_name_pair): Make `name' a const. - * include/grub/normal.h: Add grub_parse_color_name_pair() + * include/VasEBoot/normal.h: Add VasEBoot_parse_color_name_pair() declaration. 2008-03-24 Bean @@ -45554,59 +45554,59 @@ * disk/i386/pc/biosdisk.c (cd_start): Removed. (cd_count): Removed. (cd_drive): New variable. - (grub_biosdisk_get_drive): Don't check for (cdN) device. - (grub_biosdisk_call_hook): Likewise. - (grub_biosdisk_iterate): Change cdrom detection method. - (grub_biosdisk_open): Replace cd_start with cd_drive. - (GRUB_MOD_INIT): Use grub_biosdisk_get_cdinfo_int13_extension to + (VasEBoot_biosdisk_get_drive): Don't check for (cdN) device. + (VasEBoot_biosdisk_call_hook): Likewise. + (VasEBoot_biosdisk_iterate): Change cdrom detection method. + (VasEBoot_biosdisk_open): Replace cd_start with cd_drive. + (VasEBoot_MOD_INIT): Use VasEBoot_biosdisk_get_cdinfo_int13_extension to detect cdrom device. - * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START): + * include/VasEBoot/i386/pc/biosdisk.h (VasEBoot_BIOSDISK_MACHINE_CDROM_START): Removed. - (GRUB_BIOSDISK_MACHINE_CDROM_END): Removed. - (GRUB_BIOSDISK_CDTYPE_NO_EMUL): New macro. - (GRUB_BIOSDISK_CDTYPE_1_2_M): Likewise. - (GRUB_BIOSDISK_CDTYPE_1_44_M): Likewise. - (GRUB_BIOSDISK_CDTYPE_2_88_M): Likewise. - (GRUB_BIOSDISK_CDTYPE_HARDDISK): Likewise. - (GRUB_BIOSDISK_CDTYPE_MASK): Likewise. - (grub_biosdisk_cdrp): New structure. - (grub_biosdisk_get_cdinfo_int13_extensions): New function. + (VasEBoot_BIOSDISK_MACHINE_CDROM_END): Removed. + (VasEBoot_BIOSDISK_CDTYPE_NO_EMUL): New macro. + (VasEBoot_BIOSDISK_CDTYPE_1_2_M): Likewise. + (VasEBoot_BIOSDISK_CDTYPE_1_44_M): Likewise. + (VasEBoot_BIOSDISK_CDTYPE_2_88_M): Likewise. + (VasEBoot_BIOSDISK_CDTYPE_HARDDISK): Likewise. + (VasEBoot_BIOSDISK_CDTYPE_MASK): Likewise. + (VasEBoot_biosdisk_cdrp): New structure. + (VasEBoot_biosdisk_get_cdinfo_int13_extensions): New function. - * include/grub/i386/pc/kernel.h (grub_boot_drive): Export this variable. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_boot_drive): Export this variable. * kern/i386/pc/init.c (make_install_device): Don't use (cdN) as root device. - * kern/i386/pc/startup.S (grub_biosdisk_get_cdinfo_int13_extensions): + * kern/i386/pc/startup.S (VasEBoot_biosdisk_get_cdinfo_int13_extensions): New function. 2008-03-20 Robert Millan Remove 2 TiB limit in ata.mod. - * disk/ata.c (grub_ata_device): Promote `size' to grub_uint64_t. - (grub_ata_dumpinfo): Print sector count with 0x%llx. - (grub_ata_identify): Interpret `&info16[100]' as a pointer to - grub_uint64_t instead of grub_uint32_t. + * disk/ata.c (VasEBoot_ata_device): Promote `size' to VasEBoot_uint64_t. + (VasEBoot_ata_dumpinfo): Print sector count with 0x%llx. + (VasEBoot_ata_identify): Interpret `&info16[100]' as a pointer to + VasEBoot_uint64_t instead of VasEBoot_uint32_t. 2008-03-05 Bean - * loader/i386/pc/multiboot.c (grub_multiboot_get_bootdev): New function. - (grub_multiboot): Set boot device. + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_get_bootdev): New function. + (VasEBoot_multiboot): Set boot device. * boot/i386/pc/lnxboot.S (real_code_2): Set %dh to 0xFF. 2008-03-02 Bean - * fs/reiserfs.c (grub_reiserfs_read_symlink): Add 0 at the end of + * fs/reiserfs.c (VasEBoot_reiserfs_read_symlink): Add 0 at the end of symlink_buffer. 2008-03-01 Yoshinori K. Okuji - * DISTLIST: Added docs/fdl.texi, docs/grub.texi, docs/mdate-sh and + * DISTLIST: Added docs/fdl.texi, docs/VasEBoot.texi, docs/mdate-sh and texinfo.tex. - * docs/grub.texi: New file. Copied from GRUB Legacy, and slightly + * docs/VasEBoot.texi: New file. Copied from VasEBoot Legacy, and slightly modified. * docs/fdl.texi: New file. @@ -45628,20 +45628,20 @@ 2008-02-28 Robert Millan - * util/update-grub.in: Reorganise terminal validity check. Accept + * util/update-VasEBoot.in: Reorganise terminal validity check. Accept `ieee1275:console' (OLPC) and `*:gfxterm' as valid too. Based on suggestion by Franklin PIAT. 2008-02-28 Fabian Greffrath - * include/grub/util/getroot.h (grub_util_check_block_device): Export new + * include/VasEBoot/util/getroot.h (VasEBoot_util_check_block_device): Export new function. - * util/getroot.c (grub_util_check_block_device): New function that + * util/getroot.c (VasEBoot_util_check_block_device): New function that returns the given argument if it is a block device and returns NULL else. - * util/grub-probe.c (argument_is_device): New variable. + * util/VasEBoot-probe.c (argument_is_device): New variable. (probe): Promote device_name from a variable to an argument. Receive - device_name from grub_util_check_block_device() if path is NULL and from - grub_guess_root_device() else. Do not free() device_name anymore. + device_name from VasEBoot_util_check_block_device() if path is NULL and from + VasEBoot_guess_root_device() else. Do not free() device_name anymore. (options): Introduce new parameter '-d, --device'. (main): Add description of the new parameter to the help screen. Rename path variable to argument. Set argument_is_device if the '-d' @@ -45650,35 +45650,35 @@ 2008-02-24 Bean - * fs/iso9660.c (GRUB_ISO9660_VOLDESC_BOOT): New macro. - (GRUB_ISO9660_VOLDESC_PRIMARY): Likewise. - (GRUB_ISO9660_VOLDESC_SUPP): Likewise. - (GRUB_ISO9660_VOLDESC_PART): Likewise. - (GRUB_ISO9660_VOLDESC_END): Likewise. - (grub_iso9660_primary_voldesc): New member escape. - (grub_iso9660_data): New member joliet. - (grub_iso9660_convert_string): New function. - (grub_iso9660_mount): Detect joliet extension. - (grub_iso9660_iterate_dir): Convert filename when joliet is detected. - (grub_iso9660_iso9660_label): Likewise. + * fs/iso9660.c (VasEBoot_ISO9660_VOLDESC_BOOT): New macro. + (VasEBoot_ISO9660_VOLDESC_PRIMARY): Likewise. + (VasEBoot_ISO9660_VOLDESC_SUPP): Likewise. + (VasEBoot_ISO9660_VOLDESC_PART): Likewise. + (VasEBoot_ISO9660_VOLDESC_END): Likewise. + (VasEBoot_iso9660_primary_voldesc): New member escape. + (VasEBoot_iso9660_data): New member joliet. + (VasEBoot_iso9660_convert_string): New function. + (VasEBoot_iso9660_mount): Detect joliet extension. + (VasEBoot_iso9660_iterate_dir): Convert filename when joliet is detected. + (VasEBoot_iso9660_iso9660_label): Likewise. * conf/common.rmk (pkgdata_MODULES): Add udf.mod. - (grub_setup_SOURCES): Add fs/udf.c. - (grub_fstest_SOURCES): Likewise. + (VasEBoot_setup_SOURCES): Add fs/udf.c. + (VasEBoot_fstest_SOURCES): Likewise. (udf_mod_SOURCES): New variable. (udf_mod_CFLAGS): Likewise. (udf_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/udf.c. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/udf.c. + (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. * fs/udf.c: New file. @@ -45699,21 +45699,21 @@ 2008-02-23 Robert Millan - * partmap/gpt.c (grub_gpt_magic): Add `0x' qualifier to each member, + * partmap/gpt.c (VasEBoot_gpt_magic): Add `0x' qualifier to each member, since they were intended to be in hex. This didn't break previously because of a bug in gpt_partition_map_iterate() (see below). - (gpt_partition_map_iterate): Replace `grub_memcmp' with `! grub_memcmp' + (gpt_partition_map_iterate): Replace `VasEBoot_memcmp' with `! VasEBoot_memcmp' when checking the validity of GPT header. Remove `partno', since it always provides the same information as `i'. 2008-02-21 Yoshinori K. Okuji - * include/grub/efi/time.h: Fix a wrong comment. + * include/VasEBoot/efi/time.h: Fix a wrong comment. 2008-02-19 Pavel Roskin - * kern/rescue.c (grub_enter_rescue_mode): Improve initial + * kern/rescue.c (VasEBoot_enter_rescue_mode): Improve initial message. 2008-02-19 Bean @@ -45729,25 +45729,25 @@ (bsd_mod_CFLAGS): Likewise. (bsd_mod_LDFLAGS): Likewise. - * include/grub/aout.h: New file. + * include/VasEBoot/aout.h: New file. - * include/grub/i386/loader.h (grub_unix_real_boot): New function. + * include/VasEBoot/i386/loader.h (VasEBoot_unix_real_boot): New function. - * include/grub/i386/bsd.h: New file. + * include/VasEBoot/i386/bsd.h: New file. - * include/grub/i386/pc/init.h (grub_get_mmap_entry): Use EXPORT_FUNC + * include/VasEBoot/i386/pc/init.h (VasEBoot_get_mmap_entry): Use EXPORT_FUNC to make it public. - * kern/elf.c (grub_elf32_load): Get the physical address after the hook + * kern/elf.c (VasEBoot_elf32_load): Get the physical address after the hook function is called, so that it's possible to change it inside the hook. - (grub_elf64_load): Likewise. - (grub_elf_file): Don't close the file if elf header is not found. - (grub_elf_close): Close the file if grub_elf_file fails (The new - grub_elf_file won't close it). - (grub_elf32_size): Use NESTED_FUNC_ATTR for nested function calcsize. - (grub_elf64_size): Likewise. + (VasEBoot_elf64_load): Likewise. + (VasEBoot_elf_file): Don't close the file if elf header is not found. + (VasEBoot_elf_close): Close the file if VasEBoot_elf_file fails (The new + VasEBoot_elf_file won't close it). + (VasEBoot_elf32_size): Use NESTED_FUNC_ATTR for nested function calcsize. + (VasEBoot_elf64_size): Likewise. - * kern/i386/loader.S (grub_unix_real_boot): New function. + * kern/i386/loader.S (VasEBoot_unix_real_boot): New function. * loader/aout.c: New file. @@ -45755,28 +45755,28 @@ * loader/i386/bsd_normal.c: New file. - * loader/i386/pc/multiboot.c (grub_multiboot): Handle a.out format. + * loader/i386/pc/multiboot.c (VasEBoot_multiboot): Handle a.out format. - * loader/multiboot2.c (grub_multiboot2): Reset grub_errno so that it + * loader/multiboot2.c (VasEBoot_multiboot2): Reset VasEBoot_errno so that it can test other formats. 2008-02-19 Robert Millan - * partmap/gpt.c: Include `'. - (grub_gpt_partition_type_empty): Redefine with macro from - `'. + * partmap/gpt.c: Include `'. + (VasEBoot_gpt_partition_type_empty): Redefine with macro from + `'. (gpt_partition_map_iterate): Adjust partition type comparison. Export `entry' as partmap-specific `part.data' struct. - (grub_gpt_header, grub_gpt_partentry): Move from here ... + (VasEBoot_gpt_header, VasEBoot_gpt_partentry): Move from here ... - * include/grub/gpt_partition.h (grub_gpt_header) - (grub_gpt_partentry): ... to here (new file). + * include/VasEBoot/gpt_partition.h (VasEBoot_gpt_header) + (VasEBoot_gpt_partentry): ... to here (new file). - * util/i386/pc/grub-setup.c: Include `'. + * util/i386/pc/VasEBoot-setup.c: Include `'. - (grub_gpt_partition_type_bios_boot): New const variable, defined - with macro from `'. + (VasEBoot_gpt_partition_type_bios_boot): New const variable, defined + with macro from `'. (setup): Replace `first_start' with `embed_region', which keeps track of the embed region (and is partmap-agnostic). @@ -45789,7 +45789,7 @@ `embed_region.start' from now on. Similarly, use `embed_region.end' rather than `first_start' to calculate available size. - In grub_util_info() message, replace "into after the MBR" with an + In VasEBoot_util_info() message, replace "into after the MBR" with an indication of the specific sector our embed region starts at. 2008-02-19 Robert Millan @@ -45797,31 +45797,31 @@ * DISTLIST: Replace `commands/ieee1275/halt.c' and `commands/ieee1275/reboot.c' with `commands/halt.c' and `commands/reboot.c'. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES, reboot_mod_SOURCES) + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES, reboot_mod_SOURCES) (halt_mod_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES, reboot_mod_SOURCES) + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES, reboot_mod_SOURCES) (halt_mod_SOURCES): Likewise. 2008-02-17 Christian Franke - * commands/cat.c (grub_cmd_cat): Add break on GRUB_TERM_ESC key. + * commands/cat.c (VasEBoot_cmd_cat): Add break on VasEBoot_TERM_ESC key. 2008-02-17 Robert Millan - * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), + * util/i386/pc/VasEBoot-setup.c (setup): In find_first_partition_start(), set `first_start' to 0 for non-PC/MSDOS partition maps. 2008-02-16 Robert Millan - * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), + * util/i386/pc/VasEBoot-setup.c (setup): In find_first_partition_start(), do not assume partition map is PC/MSDOS before performing checks that are specific to that layout. 2008-02-13 Robert Millan - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Remove + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Remove `commands/i386/pc/halt.c' and `commands/i386/pc/reboot.c'. - * kern/i386/linuxbios/init.c (grub_halt, grub_reboot): Remove stubs. + * kern/i386/linuxbios/init.c (VasEBoot_halt, VasEBoot_reboot): Remove stubs. 2008-02-13 Yoshinori K. Okuji @@ -45830,10 +45830,10 @@ 2008-02-12 Alexandre Boeglin - * conf/i386-efi.rmk (grub_emu_SOURCES): Replace + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Replace commands/i386/pc/halt.c and reboot.c by commands/halt.c and reboot.c. - (grub_install_SOURCES): Add halt.mod and reboot.mod. + (VasEBoot_install_SOURCES): Add halt.mod and reboot.mod. (halt_mod_SOURCES): New variable. (halt_mod_CFLAGS): Likewise. (halt_mod_LDFLAGS): Likewise. @@ -45841,13 +45841,13 @@ (reboot_mod_CFLAGS): Likewise. (reboot_mod_LDFLAGS): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Replace commands/ieee1275/halt.c and reboot.c by commands/halt.c and reboot.c. (halt_mod_SOURCES): Likewise. (reboot_mod_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Replace + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Replace commands/i386/pc/reboot.c by commands/reboot.c. (reboot_mod_SOURCES): Likewise. @@ -45865,47 +45865,47 @@ Add some precompiler directive to include the correct header for each machine. - * include/grub/efi/efi.h (grub_reboot): New function declaration. - (grub_halt): Likewise. + * include/VasEBoot/efi/efi.h (VasEBoot_reboot): New function declaration. + (VasEBoot_halt): Likewise. - * kern/efi/efi.c (grub_reboot): New function. - (grub_halt): Likewise. + * kern/efi/efi.c (VasEBoot_reboot): New function. + (VasEBoot_halt): Likewise. 2008-02-12 Robert Millan - * util/getroot.c (grub_guess_root_device): Inspect /dev/evms before + * util/getroot.c (VasEBoot_guess_root_device): Inspect /dev/evms before /dev (like it is done for /dev/mapper). This doesn't provide support for EVMS, but at least it is now easy to identify the problem when it arises. 2008-02-11 Robert Millan - * util/biosdisk.c (grub_util_biosdisk_open, linux_find_partition) - (grub_util_biosdisk_get_grub_dev): Check open() exit status by + * util/biosdisk.c (VasEBoot_util_biosdisk_open, linux_find_partition) + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Check open() exit status by comparing it with -1, not 0. 2008-02-10 Robert Millan - * conf/i386-efi.rmk (grub_emu_SOURCES): Add `disk/raid.c' and + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Add `disk/raid.c' and `disk/lvm.c'. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Move `disk/raid.c' and + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Move `disk/raid.c' and `disk/lvm.c' to the end of the list. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. 2008-02-10 Robert Millan - * kern/main.c (grub_load_normal_mode): Do not reset `grub_errno'. Call - grub_print_error() instead. This will let user know why we're entering + * kern/main.c (VasEBoot_load_normal_mode): Do not reset `VasEBoot_errno'. Call + VasEBoot_print_error() instead. This will let user know why we're entering rescue mode. Based on suggestions from Sam Morris. 2008-02-10 Alexandre Boeglin - * normal/arg.c (grub_arg_parse): If one of the args is "--", call add_arg() + * normal/arg.c (VasEBoot_arg_parse): If one of the args is "--", call add_arg() on remaining N args, instead of "--" arg N times. 2008-02-09 Vesa Jaaskelainen @@ -45924,21 +45924,21 @@ installed, invoke $(HELP2MAN) to install a manpage based on --help output. - * util/i386/pc/grub-install.in: Move down `update-grub_lib' sourcing, so + * util/i386/pc/VasEBoot-install.in: Move down `update-VasEBoot_lib' sourcing, so that it doesn't prevent --help from working in build tree. - * util/i386/pc/grub-mkrescue.in (usage): Replace `grub-devel@gnu.org' - with `bug-grub@gnu.org'. - * util/powerpc/ieee1275/grub-mkrescue.in (usage): Likewise. - * util/update-grub.in (usage): New function. + * util/i386/pc/VasEBoot-mkrescue.in (usage): Replace `VasEBoot-devel@gnu.org' + with `bug-VasEBoot@gnu.org'. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in (usage): Likewise. + * util/update-VasEBoot.in (usage): New function. Implement proper argument check, with support for --help and --version (as well as existing -y). 2008-02-09 Christian Franke - * commands/cat.c (grub_cmd_cat): Print '\r' as hex to + * commands/cat.c (VasEBoot_cmd_cat): Print '\r' as hex to avoid overwriting previous output. - * kern/rescue.c (grub_rescue_cmd_cat): Likewise. + * kern/rescue.c (VasEBoot_rescue_cmd_cat): Likewise. 2008-02-09 Robert Millan @@ -45955,27 +45955,27 @@ 2008-02-09 Robert Millan - * disk/raid.c (grub_raid_scan_device): Add a pair of sanity checks for + * disk/raid.c (VasEBoot_raid_scan_device): Add a pair of sanity checks for situations in which we can deduce the RAID size and the superblock doesn't match it. 2008-02-09 Robert Millan - * disk/lvm.c [GRUB_UTIL] (grub_lvm_memberlist): New function. Construct - and return a grub_diskmemberlist_t composed of LVM physical volumes. - [GRUB_UTIL] (grub_lvm_dev): Add `memberlist' member. + * disk/lvm.c [VasEBoot_UTIL] (VasEBoot_lvm_memberlist): New function. Construct + and return a VasEBoot_diskmemberlist_t composed of LVM physical volumes. + [VasEBoot_UTIL] (VasEBoot_lvm_dev): Add `memberlist' member. - * disk/raid.c [GRUB_UTIL] (grub_raid_memberlist): New function. Construct - and return a grub_diskmemberlist_t composed of physical array members. - [GRUB_UTIL] (grub_raid_dev): Add `memberlist' member. + * disk/raid.c [VasEBoot_UTIL] (VasEBoot_raid_memberlist): New function. Construct + and return a VasEBoot_diskmemberlist_t composed of physical array members. + [VasEBoot_UTIL] (VasEBoot_raid_dev): Add `memberlist' member. - * include/grub/disk.h [GRUB_UTIL] (grub_disk_memberlist): New struct + * include/VasEBoot/disk.h [VasEBoot_UTIL] (VasEBoot_disk_memberlist): New struct prototype. - [GRUB_UTIL] (struct grub_disk_dev): Add `memberlist' function pointer. - [GRUB_UTIL] (struct grub_disk_memberlist): New struct declaration. - [GRUB_UTIL] (grub_disk_memberlist_t): New typedef. + [VasEBoot_UTIL] (struct VasEBoot_disk_dev): Add `memberlist' function pointer. + [VasEBoot_UTIL] (struct VasEBoot_disk_memberlist): New struct declaration. + [VasEBoot_UTIL] (VasEBoot_disk_memberlist_t): New typedef. - * util/grub-probe.c (probe): Move partmap probing code from here ... + * util/VasEBoot-probe.c (probe): Move partmap probing code from here ... (probe_partmap): ... to here. (probe): Use probe_partmap() once for the disk we're probing, and additionally, when such disk contains a memberlist() struct member, @@ -45984,14 +45984,14 @@ 2008-02-09 Robert Millan - * util/grub-probe.c (main): When `verbosity > 1', set `debug' + * util/VasEBoot-probe.c (main): When `verbosity > 1', set `debug' environment variable to 'all' in order to obtain debug output from non-util/ code. - * util/i386/pc/grub-setup.c (main): Likewise. + * util/i386/pc/VasEBoot-setup.c (main): Likewise. 2008-02-08 Robert Millan - * disk/raid.c (grub_raid_scan_device): Check for + * disk/raid.c (VasEBoot_raid_scan_device): Check for `array->device[sb.this_disk.number]' rather than for `array->device[sb.this_disk.number]->name', since the latter is not guaranteed to be accessible. @@ -46000,110 +46000,110 @@ * disk/raid.c: Update copyright. * fs/cpio.c: Likewise. - * include/grub/raid.h: Likewise. + * include/VasEBoot/raid.h: Likewise. * loader/i386/pc/multiboot.c: Likewise. * util/hostfs.c: Likewise. 2008-02-08 Robert Millan - * include/grub/raid.h (struct grub_raid_array): Change type of `device' - to a grub_disk_t array. - * disk/raid.c (grub_raid_read): Replace `device[x].disk' accesses with + * include/VasEBoot/raid.h (struct VasEBoot_raid_array): Change type of `device' + to a VasEBoot_disk_t array. + * disk/raid.c (VasEBoot_raid_read): Replace `device[x].disk' accesses with `device[x]'. - (grub_raid_scan_device): Replace `device[x].name' accesses with + (VasEBoot_raid_scan_device): Replace `device[x].name' accesses with `device[x]->name'. Simplify initialization of `array->device[x]'. 2008-02-08 Robert Millan - * disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few - grub_dprintf() calls. - * kern/disk.c (grub_disk_read): Include grub_errmsg in out of range + * disk/raid.c (VasEBoot_raid_open, VasEBoot_raid_scan_device): Add a few + VasEBoot_dprintf() calls. + * kern/disk.c (VasEBoot_disk_read): Include VasEBoot_errmsg in out of range error message. 2008-02-07 Christian Franke - * util/hostfs.c (grub_hostfs_open): Use fseeko and ftello + * util/hostfs.c (VasEBoot_hostfs_open): Use fseeko and ftello instead of fseek and ftell to support large files. - (grub_hostfs_read): Likewise. + (VasEBoot_hostfs_read): Likewise. 2008-02-07 Robert Millan Patch from Jeroen Dekkers. - * disk/raid.c (grub_raid_scan_device): Reset `grub_errno' on disk + * disk/raid.c (VasEBoot_raid_scan_device): Reset `VasEBoot_errno' on disk failure, since successfully reading all array members might not be required. 2008-02-06 Robert Millan - * util/grub-probe.c (probe): Simplify partmap probing (with the + * util/VasEBoot-probe.c (probe): Simplify partmap probing (with the assumption that the first word up to the underscore equals to the module name). 2008-02-06 Christian Franke - * fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_NONE - (and set *ofs = 0) instead of GRUB_ERR_FILE_NOT_FOUND on + * fs/cpio.c (VasEBoot_cpio_find_file): Return VasEBoot_ERR_NONE + (and set *ofs = 0) instead of VasEBoot_ERR_FILE_NOT_FOUND on last block of a cpio or tar stream. Check for "TRAILER!!!" instead of any empty data block to detect last block of a cpio stream. - (grub_cpio_dir): Fix constness of variable np. - (grub_cpio_open): Return GRUB_ERR_FILE_NOT_FOUND if + (VasEBoot_cpio_dir): Fix constness of variable np. + (VasEBoot_cpio_open): Return VasEBoot_ERR_FILE_NOT_FOUND if cpio or tar trailer is detected. This fixes a crash on open of a non existing file. 2008-02-05 Bean - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Get physical + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): Get physical address of entry. - (grub_multiboot_load_elf64): Likewise. - (grub_multiboot): Initialize mbi structure. + (VasEBoot_multiboot_load_elf64): Likewise. + (VasEBoot_multiboot): Initialize mbi structure. - * util/grub-fstest.c: Don't include unused header file script.h. + * util/VasEBoot-fstest.c: Don't include unused header file script.h. - * conf/common.rmk (grub-fstest.c_DEPENDENCIES): Move to the beginning + * conf/common.rmk (VasEBoot-fstest.c_DEPENDENCIES): Move to the beginning of file. - (grub_fstest_SOURCES): Likewise. + (VasEBoot_fstest_SOURCES): Likewise. 2008-02-05 Robert Millan - * include/grub/term.h (GRUB_TERM_LEFT, GRUB_TERM_RIGHT) - (GRUB_TERM_UP, GRUB_TERM_DOWN, GRUB_TERM_HOME, GRUB_TERM_END) - (GRUB_TERM_DC, GRUB_TERM_PPAGE, GRUB_TERM_NPAGE, GRUB_TERM_ESC) - (GRUB_TERM_TAB, GRUB_TERM_BACKSPACE): New macros. + * include/VasEBoot/term.h (VasEBoot_TERM_LEFT, VasEBoot_TERM_RIGHT) + (VasEBoot_TERM_UP, VasEBoot_TERM_DOWN, VasEBoot_TERM_HOME, VasEBoot_TERM_END) + (VasEBoot_TERM_DC, VasEBoot_TERM_PPAGE, VasEBoot_TERM_NPAGE, VasEBoot_TERM_ESC) + (VasEBoot_TERM_TAB, VasEBoot_TERM_BACKSPACE): New macros. - * kern/i386/pc/startup.S: Include `'. + * kern/i386/pc/startup.S: Include `'. (translation_table): Replace hardcoded values with macros - provided by `'. + provided by `'. - * term/i386/pc/at_keyboard.c: Include `'. + * term/i386/pc/at_keyboard.c: Include `'. (keyboard_map): Correct/add a few values, with macros provided - by `'. + by `'. (keyboard_map_shift): Zero values that don't differ from their `keyboard_map' equivalents. - (grub_console_checkkey): Optimize KEYBOARD_STATUS_CAPS_LOCK toggling. + (VasEBoot_console_checkkey): Optimize KEYBOARD_STATUS_CAPS_LOCK toggling. Discard the second scan code that is always sent by Caps lock. Only use `keyboard_map_shift' when it provides a non-zero value, otherwise fallback to `keyboard_map'. 2008-02-04 Bean - * Makefile.in (enable_grub_fstest): New variable. + * Makefile.in (enable_VasEBoot_fstest): New variable. - * conf/common.rmk (grub_fstest_init.lst): New rule. - (grub_fstest_init.h): Likewise. - (grub_fstest_init.c): Likewise. - (util/grub-fstest.c_DEPENDENCIES): New variable. - (grub_fstest_SOURCES): Likewise. + * conf/common.rmk (VasEBoot_fstest_init.lst): New rule. + (VasEBoot_fstest_init.h): Likewise. + (VasEBoot_fstest_init.c): Likewise. + (util/VasEBoot-fstest.c_DEPENDENCIES): New variable. + (VasEBoot_fstest_SOURCES): Likewise. - * configure.ac (enable_grub_fstest): Check for --enable-grub-fstest. + * configure.ac (enable_VasEBoot_fstest): Check for --enable-VasEBoot-fstest. - * util/grub-fstest.c: New file. + * util/VasEBoot-fstest.c: New file. 2008-02-03 Yoshinori K. Okuji - Make grub-setup handle a separate root device. + Make VasEBoot-setup handle a separate root device. - * util/i386/pc/grub-setup.c (setup): Always open the root device, + * util/i386/pc/VasEBoot-setup.c (setup): Always open the root device, so that the root device can be compared with the destination device. When embedding the core image, if the root and destination devices @@ -46113,23 +46113,23 @@ 2008-02-03 Yoshinori K. Okuji - Add support for having a grub directory in a different drive. This + Add support for having a VasEBoot directory in a different drive. This is still only the data handling part. * kern/i386/pc/startup.S (multiboot_trampoline): Set %dh to 0xFF. - (codestart): Save %dh in GRUB_ROOT_DRIVE. - (grub_root_drive): New variable. + (codestart): Save %dh in VasEBoot_ROOT_DRIVE. + (VasEBoot_root_drive): New variable. - * kern/i386/pc/init.c (make_install_device): Use GRUB_ROOT_DRIVE - instead of GRUB_BOOT_DRIVE to construct a device name. Set - GRUB_ROOT_DRIVE to GRUB_BOOT_DRIVE if it is 0xFF, otherwise use it + * kern/i386/pc/init.c (make_install_device): Use VasEBoot_ROOT_DRIVE + instead of VasEBoot_BOOT_DRIVE to construct a device name. Set + VasEBoot_ROOT_DRIVE to VasEBoot_BOOT_DRIVE if it is 0xFF, otherwise use it as it was. - * include/grub/i386/pc/kernel.h (grub_root_drive): New prototype. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_root_drive): New prototype. - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_ROOT_DRIVE): New + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_ROOT_DRIVE): New macro. - (GRUB_BOOT_MACHINE_DRIVE_CHECK): Set to 0x4f. + (VasEBoot_BOOT_MACHINE_DRIVE_CHECK): Set to 0x4f. * boot/i386/pc/pxeboot.S (_start): Set %dh to 0xFF. For now, this is bogus, because PXE booting does not specify any drive @@ -46151,33 +46151,33 @@ 2008-02-03 Robert Millan - * util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to + * util/i386/pc/VasEBoot-mkrescue.in: Rewrite most of image generation to use `cdboot.img' for cdrom images. 2008-02-03 Robert Millan - * util/grub.d/00_header.in: Issue scripting commands for GRUB to + * util/VasEBoot.d/00_header.in: Issue scripting commands for VasEBoot to only setup gfxterm when `font' command has succeeded. 2008-02-03 Robert Millan - * loader/multiboot_loader.c [GRUB_MACHINE_LINUXBIOS] - (grub_rescue_cmd_multiboot_loader) - (grub_rescue_cmd_module_loader): Enable multiboot1 calls. + * loader/multiboot_loader.c [VasEBoot_MACHINE_LINUXBIOS] + (VasEBoot_rescue_cmd_multiboot_loader) + (VasEBoot_rescue_cmd_module_loader): Enable multiboot1 calls. 2008-02-03 Pavel Roskin - * kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop - %edx and %esi from stack only after grub_gate_a20() is called. - grub_gate_a20() clobbers %edx. + * kern/i386/pc/startup.S (VasEBoot_chainloader_real_boot): Pop + %edx and %esi from stack only after VasEBoot_gate_a20() is called. + VasEBoot_gate_a20() clobbers %edx. 2008-02-03 Yoshinori K. Okuji * configure.ac (AC_INIT): Bumped to 1.96. * DISTLIST: Added boot/i386/pc/cdboot.S, bus/pci.c, - commands/lspci.c,disk/memdisk.c, include/grub/pci.h, - include/grub/i386/pc/pci.h, video/readers/jpeg.c, and + commands/lspci.c,disk/memdisk.c, include/VasEBoot/pci.h, + include/VasEBoot/i386/pc/pci.h, video/readers/jpeg.c, and video/readers/png.c. 2008-02-03 Bean @@ -46191,17 +46191,17 @@ * disk/i386/pc/biosdisk.c (cd_start): New variable. (cd_count): Likewise. - (grub_biosdisk_get_drive): Add support for cd device. - (grub_biosdisk_call_hook): Likewise. - (grub_biosdisk_iterate): Likewise. - (grub_biosdisk_open): Likewise. - (GRUB_BIOSDISK_CDROM_RETRY_COUNT): New macro. - (grub_biosdisk_rw): Support reading from cd device. - (GRUB_MOD_INIT): Iterate cd devices. + (VasEBoot_biosdisk_get_drive): Add support for cd device. + (VasEBoot_biosdisk_call_hook): Likewise. + (VasEBoot_biosdisk_iterate): Likewise. + (VasEBoot_biosdisk_open): Likewise. + (VasEBoot_BIOSDISK_CDROM_RETRY_COUNT): New macro. + (VasEBoot_biosdisk_rw): Support reading from cd device. + (VasEBoot_MOD_INIT): Iterate cd devices. - * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_FLAG_CDROM): New macro. - (GRUB_BIOSDISK_MACHINE_CDROM_START): Likewise. - (GRUB_BIOSDISK_MACHINE_CDROM_END): Likewise. + * include/VasEBoot/i386/pc/biosdisk.h (VasEBoot_BIOSDISK_FLAG_CDROM): New macro. + (VasEBoot_BIOSDISK_MACHINE_CDROM_START): Likewise. + (VasEBoot_BIOSDISK_MACHINE_CDROM_END): Likewise. * kern/i386/pc/init.c (make_install_device): Check for cd device. @@ -46215,16 +46215,16 @@ 2008-02-02 Robert Millan - * normal/main.c (grub_normal_execute): Check for `menu->size' when + * normal/main.c (VasEBoot_normal_execute): Check for `menu->size' when determining whether menu has to be displayed. 2008-02-02 Marco Gerards * bus/pci.c: New file. - * include/grub/pci.h: Likewise. + * include/VasEBoot/pci.h: Likewise. - * include/grub/i386/pc/pci.h: Likewise. + * include/VasEBoot/i386/pc/pci.h: Likewise. * commands/lspci.c: Likewise. @@ -46240,22 +46240,22 @@ 2008-02-02 Bean * fs/ufs.c (INODE_BLKSZ): Fix incorrect value. - (grub_ufs_get_file_block): Fix indirect block calculation problem. + (VasEBoot_ufs_get_file_block): Fix indirect block calculation problem. - * fs/xfs.c (grub_xfs_sblock): New member log2_dirblk. - (grub_xfs_btree_node): New structure. - (grub_xfs_btree_root): New structure. - (grub_xfs_inode): New members nblocks, extsize, nextents and btree. - (GRUB_XFS_EXTENT_OFFSET): Use exts instead of inode->data.extents. - (GRUB_XFS_EXTENT_BLOCK): Likewise. - (GRUB_XFS_EXTENT_SIZE): Likewise. - (grub_xfs_read_block): Support btree format type. - (grub_xfs_iterate_dir): Use NESTED_FUNC_ATTR in call_hook. + * fs/xfs.c (VasEBoot_xfs_sblock): New member log2_dirblk. + (VasEBoot_xfs_btree_node): New structure. + (VasEBoot_xfs_btree_root): New structure. + (VasEBoot_xfs_inode): New members nblocks, extsize, nextents and btree. + (VasEBoot_XFS_EXTENT_OFFSET): Use exts instead of inode->data.extents. + (VasEBoot_XFS_EXTENT_BLOCK): Likewise. + (VasEBoot_XFS_EXTENT_SIZE): Likewise. + (VasEBoot_xfs_read_block): Support btree format type. + (VasEBoot_xfs_iterate_dir): Use NESTED_FUNC_ATTR in call_hook. Use directory block as basic unit. - * fs/fshelp.c (grub_fshelp_read_file): Bug fix for sparse block. + * fs/fshelp.c (VasEBoot_fshelp_read_file): Bug fix for sparse block. - * aclocal.m4 (grub_i386_CHECK_REGPARM_BUG): Define NESTED_FUNC_ATTR as + * aclocal.m4 (VasEBoot_i386_CHECK_REGPARM_BUG): Define NESTED_FUNC_ATTR as __attribute__ ((__regparm__ (1))). 2008-02-01 Robert Millan @@ -46271,37 +46271,37 @@ * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Move to the top. (normal/command.c_DEPENDENCIES): New variable. - (grub-emu_DEPENDENCIES, normal_mod_DEPENDENCIES): Remove variables. + (VasEBoot-emu_DEPENDENCIES, normal_mod_DEPENDENCIES): Remove variables. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. - (grub_emu_SOURCES): Add `fs/fshelp.c'. + (VasEBoot_emu_SOURCES): Add `fs/fshelp.c'. * genmk.rb: Add `$(#{src}_DEPENDENCIES)' in targets that require it. 2008-02-01 Robert Millan - * kern/disk.c (grub_disk_read, grub_disk_write): Add grub_dprintf() + * kern/disk.c (VasEBoot_disk_read, VasEBoot_disk_write): Add VasEBoot_dprintf() call at beginning of function. 2008-01-31 Pavel Roskin - * util/powerpc/ieee1275/grub-mkrescue.in: New file. + * util/powerpc/ieee1275/VasEBoot-mkrescue.in: New file. * conf/powerpc-ieee1275.rmk (bin_SCRIPTS): New variable. - (grub_mkrescue_SOURCES): Likewise. - * DISTLIST: Add util/powerpc/ieee1275/grub-mkrescue.in. + (VasEBoot_mkrescue_SOURCES): Likewise. + * DISTLIST: Add util/powerpc/ieee1275/VasEBoot-mkrescue.in. 2008-01-30 Robert Millan - * conf/i386-pc.rmk (sbin_UTILITIES): Remove `grub-probe'. - (util/grub-probe.c_DEPENDENCIES, grub_probe_SOURCES): Moved from here ... - * conf/common.rmk (util/grub-probe.c_DEPENDENCIES) - (grub_probe_SOURCES): ... to here. + * conf/i386-pc.rmk (sbin_UTILITIES): Remove `VasEBoot-probe'. + (util/VasEBoot-probe.c_DEPENDENCIES, VasEBoot_probe_SOURCES): Moved from here ... + * conf/common.rmk (util/VasEBoot-probe.c_DEPENDENCIES) + (VasEBoot_probe_SOURCES): ... to here. - * conf/i386-efi.rmk (sbin_UTILITIES): Remove `grub-probe'. - (util/grub-probe.c_DEPENDENCIES, grub_probe_SOURCES): Remove. + * conf/i386-efi.rmk (sbin_UTILITIES): Remove `VasEBoot-probe'. + (util/VasEBoot-probe.c_DEPENDENCIES, VasEBoot_probe_SOURCES): Remove. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. @@ -46327,32 +46327,32 @@ 2008-01-28 Robert Millan - * include/grub/i386/linuxbios/kernel.h (GRUB_MOD_GAP): New macro. - * kern/powerpc/ieee1275/init.c (grub_arch_modules_addr): Remove - `ifndef GRUB_MOD_GAP' hack. - * util/elf/grub-mkimage.c (add_segments): Likewise. + * include/VasEBoot/i386/linuxbios/kernel.h (VasEBoot_MOD_GAP): New macro. + * kern/powerpc/ieee1275/init.c (VasEBoot_arch_modules_addr): Remove + `ifndef VasEBoot_MOD_GAP' hack. + * util/elf/VasEBoot-mkimage.c (add_segments): Likewise. 2008-01-27 Robert Millan - * kern/powerpc/ieee1275/init.c (grub_arch_modules_addr): Skip - `GRUB_MOD_GAP' for platforms in which it's not defined. - * util/elf/grub-mkimage.c (add_segments): Likewise. + * kern/powerpc/ieee1275/init.c (VasEBoot_arch_modules_addr): Skip + `VasEBoot_MOD_GAP' for platforms in which it's not defined. + * util/elf/VasEBoot-mkimage.c (add_segments): Likewise. 2008-01-27 Robert Millan - Get grub-emu to build again (including parallel builds). + Get VasEBoot-emu to build again (including parallel builds). - * conf/i386-pc.rmk (util/grub-emu.c_DEPENDENCIES): Remove variable. + * conf/i386-pc.rmk (util/VasEBoot-emu.c_DEPENDENCIES): Remove variable. Split into ... - (util/grub-emu.c_DEPENDENCIES): ... this, ... + (util/VasEBoot-emu.c_DEPENDENCIES): ... this, ... (normal/execute.c_DEPENDENCIES): ... this, ... - (grub-emu_DEPENDENCIES): ... and this. + (VasEBoot-emu_DEPENDENCIES): ... and this. * conf/i386-efi.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. - (grub_emu_SOURCES): Remove duplicated `kern/file.c'. + (VasEBoot_emu_SOURCES): Remove duplicated `kern/file.c'. 2008-01-27 Robert Millan @@ -46360,128 +46360,128 @@ 2008-01-27 Robert Millan - Fix parallel builds with grub-emu. Based on earlier commit for - grub-probe and grub-setup. + Fix parallel builds with VasEBoot-emu. Based on earlier commit for + VasEBoot-probe and VasEBoot-setup. - * conf/i386-pc.rmk (grub-emu_DEPENDENCIES): Renamed to ... - (util/grub-emu.c_DEPENDENCIES): ... this. - * conf/i386-efi.rmk (grub-emu_DEPENDENCIES): Renamed to ... - (util/grub-emu.c_DEPENDENCIES): ... this. - * conf/i386-linuxbios.rmk (grub-emu_DEPENDENCIES): Renamed to ... - (util/grub-emu.c_DEPENDENCIES): ... this. - * conf/i386-ieee1275.rmk (grub-emu_DEPENDENCIES): Renamed to ... - (util/grub-emu.c_DEPENDENCIES): ... this. - * conf/powerpc-ieee1275.rmk (grub-emu_DEPENDENCIES): Renamed to ... - (util/grub-emu.c_DEPENDENCIES): ... this. + * conf/i386-pc.rmk (VasEBoot-emu_DEPENDENCIES): Renamed to ... + (util/VasEBoot-emu.c_DEPENDENCIES): ... this. + * conf/i386-efi.rmk (VasEBoot-emu_DEPENDENCIES): Renamed to ... + (util/VasEBoot-emu.c_DEPENDENCIES): ... this. + * conf/i386-linuxbios.rmk (VasEBoot-emu_DEPENDENCIES): Renamed to ... + (util/VasEBoot-emu.c_DEPENDENCIES): ... this. + * conf/i386-ieee1275.rmk (VasEBoot-emu_DEPENDENCIES): Renamed to ... + (util/VasEBoot-emu.c_DEPENDENCIES): ... this. + * conf/powerpc-ieee1275.rmk (VasEBoot-emu_DEPENDENCIES): Renamed to ... + (util/VasEBoot-emu.c_DEPENDENCIES): ... this. 2008-01-27 Pavel Roskin - * include/grub/powerpc/ieee1275/kernel.h: Introduce GRUB_MOD_GAP + * include/VasEBoot/powerpc/ieee1275/kernel.h: Introduce VasEBoot_MOD_GAP to create a gap between _end and the modules added to the image - with grub-mkrescue. That fixes "CLAIM failed" on PowerMAC. - * kern/powerpc/ieee1275/init.c: Use GRUB_MOD_GAP. - * util/elf/grub-mkimage.c (add_segments): Likewise. + with VasEBoot-mkrescue. That fixes "CLAIM failed" on PowerMAC. + * kern/powerpc/ieee1275/init.c: Use VasEBoot_MOD_GAP. + * util/elf/VasEBoot-mkimage.c (add_segments): Likewise. 2008-01-26 Pavel Roskin - * kern/dl.c (grub_dl_load): Don't abort if prefix is not set, + * kern/dl.c (VasEBoot_dl_load): Don't abort if prefix is not set, just return an error. 2008-01-26 Bean - * fs/reiserfs.c (grub_fshelp_node): New member next_offset. - (grub_reiserfs_get_item): Save offset of the next item. - (grub_reiserfs_iterate_dir): Use next_offset to find next item. + * fs/reiserfs.c (VasEBoot_fshelp_node): New member next_offset. + (VasEBoot_reiserfs_get_item): Save offset of the next item. + (VasEBoot_reiserfs_iterate_dir): Use next_offset to find next item. 2008-01-25 Robert Millan - * conf/i386-pc.rmk (grub_setup_SOURCES, grub_emu_SOURCES): Regroup to + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES, VasEBoot_emu_SOURCES): Regroup to make all filesystem sources appear together (possibly fixing omissions while at it). - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_probe_SOURCES): Likewise. Additionally, + * conf/i386-pc.rmk (VasEBoot_probe_SOURCES): Likewise. Additionally, add `kern/file.c'. - * conf/i386-efi.rmk (grub_probe_SOURCES): Likewise. - * conf/i386-ieee1275.rmk (grub_probe_SOURCES): Likewise. - * conf/i386-linuxbios.rmk (grub_probe_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_probe_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (VasEBoot_probe_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_probe_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_probe_SOURCES): Likewise. - * util/grub-probe.c: Include `' and `'. + * util/VasEBoot-probe.c: Include `' and `'. (probe): Add a sanity check to make sure of our ability to read requested files when probing for filesystem type. * genmk.rb: Update copyright year (2007). - * include/grub/fs.h (grub_fat_init, grub_fat_fini, grub_ext2_init) - (grub_ext2_fini, grub_ufs_init, grub_ufs_fini, grub_minix_init) - (grub_minix_fini, grub_hfs_init, grub_hfs_fini, grub_jfs_init) - (grub_jfs_fini, grub_xfs_init, grub_xfs_fini, grub_affs_init) - (grub_affs_fini, grub_sfs_init, grub_sfs_fini, grub_iso9660_init) + * include/VasEBoot/fs.h (VasEBoot_fat_init, VasEBoot_fat_fini, VasEBoot_ext2_init) + (VasEBoot_ext2_fini, VasEBoot_ufs_init, VasEBoot_ufs_fini, VasEBoot_minix_init) + (VasEBoot_minix_fini, VasEBoot_hfs_init, VasEBoot_hfs_fini, VasEBoot_jfs_init) + (VasEBoot_jfs_fini, VasEBoot_xfs_init, VasEBoot_xfs_fini, VasEBoot_affs_init) + (VasEBoot_affs_fini, VasEBoot_sfs_init, VasEBoot_sfs_fini, VasEBoot_iso9660_init) : Remove function prototypes. 2008-01-25 Robert Millan - Revert my previous commits (based on wrong assumption of how grub_errno + Revert my previous commits (based on wrong assumption of how VasEBoot_errno works). - * kern/disk.c (grub_disk_open): Stop resetting grub_errno. - * kern/file.c (grub_file_open): Likewise. + * kern/disk.c (VasEBoot_disk_open): Stop resetting VasEBoot_errno. + * kern/file.c (VasEBoot_file_open): Likewise. 2008-01-24 Pavel Roskin - * include/grub/ieee1275/ieee1275.h: Introduce flag for firmwares - that hang if GRUB tries to setup colors. - * term/ieee1275/ofconsole.c (grub_ofconsole_init): Don't set + * include/VasEBoot/ieee1275/ieee1275.h: Introduce flag for firmwares + that hang if VasEBoot tries to setup colors. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_init): Don't set colors for firmwares that don't support it. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_set_flag): + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_set_flag): Recognize Open Hack'Ware, set flags to work around its limitations. 2008-01-24 Robert Millan - * kern/file.c (grub_file_open): Do not account previous failures of - unrelated functions when grub_errno is checked for. + * kern/file.c (VasEBoot_file_open): Do not account previous failures of + unrelated functions when VasEBoot_errno is checked for. Reported by Oleg Strikov. 2008-01-24 Bean - * fs/ufs.c (GRUB_UFS_VOLNAME_LEN): New macro. - (grub_ufs_sblock): New member volume name. - (grub_ufs_find_file): Fix string copy bug. - (grub_ufs_label): Implement this function properly. + * fs/ufs.c (VasEBoot_UFS_VOLNAME_LEN): New macro. + (VasEBoot_ufs_sblock): New member volume name. + (VasEBoot_ufs_find_file): Fix string copy bug. + (VasEBoot_ufs_label): Implement this function properly. - * fs/hfs.c (grub_hfs_cnid_type): New enum. - (grub_hfs_iterate_records): Use the correct file number for extents + * fs/hfs.c (VasEBoot_hfs_cnid_type): New enum. + (VasEBoot_hfs_iterate_records): Use the correct file number for extents and catalog file. Fix problem in next index calculation. - (grub_hfs_find_node): Replace recursive function call with loop. - (grub_hfs_iterate_dir): Replace recursive function call with loop. + (VasEBoot_hfs_find_node): Replace recursive function call with loop. + (VasEBoot_hfs_iterate_dir): Replace recursive function call with loop. 2008-01-23 Robert Millan - * include/grub/i386/ieee1275/loader.h: Include `', - `' and `'. - (grub_multiboot2_real_boot): New function prototype. + * include/VasEBoot/i386/ieee1275/loader.h: Include `', + `' and `'. + (VasEBoot_multiboot2_real_boot): New function prototype. - * include/grub/i386/pc/memory.h: Include `'. - [!GRUB_MACHINE_IEEE1275] (grub_lower_mem, grub_upper_mem): Disable. + * include/VasEBoot/i386/pc/memory.h: Include `'. + [!VasEBoot_MACHINE_IEEE1275] (VasEBoot_lower_mem, VasEBoot_upper_mem): Disable. - * kern/i386/ieee1275/init.c (grub_os_area_addr) - (grub_os_area_size, grub_lower_mem, grub_upper_mem): Remove variables. + * kern/i386/ieee1275/init.c (VasEBoot_os_area_addr) + (VasEBoot_os_area_size, VasEBoot_lower_mem, VasEBoot_upper_mem): Remove variables. 2008-01-23 Robert Millan - * kern/mm.c (grub_mm_init_region): Replace grub_dprintf() call with - #ifdef'ed out grub_printf(). + * kern/mm.c (VasEBoot_mm_init_region): Replace VasEBoot_dprintf() call with + #ifdef'ed out VasEBoot_printf(). 2008-01-23 Robert Millan - * term/i386/pc/at_keyboard.c (grub_keyboard_isr): #ifdef out - grub_dprintf calls, since they make "debug=all" mode unusable. - (grub_console_checkkey): Likewise. + * term/i386/pc/at_keyboard.c (VasEBoot_keyboard_isr): #ifdef out + VasEBoot_dprintf calls, since they make "debug=all" mode unusable. + (VasEBoot_console_checkkey): Likewise. 2008-01-23 Robert Millan @@ -46492,24 +46492,24 @@ (serial_mod_CFLAGS): Likewise. (serial_mod_LDFLAGS): Likewise. - * include/grub/i386/ieee1275/console.h: Add `'. Remove - `'. - (grub_keyboard_controller_init): New function prototype. - (grub_console_checkkey): Likewise. - (grub_console_getkey): Likewise. + * include/VasEBoot/i386/ieee1275/console.h: Add `'. Remove + `'. + (VasEBoot_keyboard_controller_init): New function prototype. + (VasEBoot_console_checkkey): Likewise. + (VasEBoot_console_getkey): Likewise. - * kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize AT + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_init): Initialize AT keyboard on i386. - * term/ieee1275/ofconsole.c (grub_ofconsole_term): On i386, use - grub_ofconsole_checkkey() and grub_ofconsole_getkey() for input. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_term): On i386, use + VasEBoot_ofconsole_checkkey() and VasEBoot_ofconsole_getkey() for input. 2008-01-23 Robert Millan * kern/i386/pc/init.c (make_install_device): When memdisk image is - present, "(memdisk)/boot/grub" becomes the default prefix. + present, "(memdisk)/boot/VasEBoot" becomes the default prefix. - * util/i386/pc/grub-mkrescue.in: Switch to a minimal core.img plus + * util/i386/pc/VasEBoot-mkrescue.in: Switch to a minimal core.img plus a memdisk tarball with all the modules. Add --overlay=DIR option that allows users to overlay additional files into the image. @@ -46525,46 +46525,46 @@ (multiboot_mod_CFLAGS): Likewise. (multiboot_mod_LDFLAGS): Likewise. - * include/grub/i386/ieee1275/loader.h: New file. + * include/VasEBoot/i386/ieee1275/loader.h: New file. - * include/grub/i386/ieee1275/machine.h: Likewise. + * include/VasEBoot/i386/ieee1275/machine.h: Likewise. - * include/grub/i386/ieee1275/memory.h: Likewise. + * include/VasEBoot/i386/ieee1275/memory.h: Likewise. - * include/grub/i386/pc/init.h (grub_os_area_addr): Remove (redundant) + * include/VasEBoot/i386/pc/init.h (VasEBoot_os_area_addr): Remove (redundant) variable declaration. - (grub_os_area_size): Likewise. + (VasEBoot_os_area_size): Likewise. - * kern/i386/ieee1275/init.c (grub_os_area_addr, grub_os_area_size) - (grub_lower_mem, grub_upper_mem): New variables. - (grub_stop_floppy): New function (just to make - grub_multiboot2_real_boot() happy). + * kern/i386/ieee1275/init.c (VasEBoot_os_area_addr, VasEBoot_os_area_size) + (VasEBoot_lower_mem, VasEBoot_upper_mem): New variables. + (VasEBoot_stop_floppy): New function (just to make + VasEBoot_multiboot2_real_boot() happy). - * kern/i386/ieee1275/startup.S: Include `', - `', `' and `'. - (grub_stop): New function. + * kern/i386/ieee1275/startup.S: Include `', + `', `' and `'. + (VasEBoot_stop): New function. Include `"../realmode.S"' and `"../loader.S"'. - * loader/multiboot_loader.c: Include `'. - Replace `__i386__' #ifdefs with `GRUB_MACHINE_PCBIOS'. + * loader/multiboot_loader.c: Include `'. + Replace `__i386__' #ifdefs with `VasEBoot_MACHINE_PCBIOS'. - * loader/powerpc/ieee1275/multiboot2.c (grub_mb2_arch_boot): On i386, - rely on grub_multiboot2_real_boot() for final boot. + * loader/powerpc/ieee1275/multiboot2.c (VasEBoot_mb2_arch_boot): On i386, + rely on VasEBoot_multiboot2_real_boot() for final boot. 2008-01-22 Robert Millan - * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): When - `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag is set, skip any + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): When + `VasEBoot_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag is set, skip any device that doesn't look like an SD card. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): Add - `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_set_flag): Detect - OLPC laptop, and set `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' when + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): Add + `VasEBoot_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag. + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_set_flag): Detect + OLPC laptop, and set `VasEBoot_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' when found. 2008-01-22 Robert Millan - * kern/powerpc/ieee1275/init.c (grub_claim_heap): Add sanity check to + * kern/powerpc/ieee1275/init.c (VasEBoot_claim_heap): Add sanity check to avoid claiming over our own code. 2008-01-22 Bean @@ -46578,61 +46578,61 @@ 2008-01-22 Bean - * fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_FILE_NOT_FOUND when + * fs/cpio.c (VasEBoot_cpio_find_file): Return VasEBoot_ERR_FILE_NOT_FOUND when there are no more items. 2008-01-21 Robert Millan - * kern/mm.c (grub_mm_init_region): Improve debug message. + * kern/mm.c (VasEBoot_mm_init_region): Improve debug message. 2008-01-21 Robert Millan - * conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): New variable. - (kernel_img_LDFLAGS): Use `GRUB_MEMORY_MACHINE_LINK_ADDR' as link + * conf/i386-pc.rmk (VasEBoot_MEMORY_MACHINE_LINK_ADDR): New variable. + (kernel_img_LDFLAGS): Use `VasEBoot_MEMORY_MACHINE_LINK_ADDR' as link address. - (grub_mkimage_CFLAGS): Propagate `GRUB_MEMORY_MACHINE_LINK_ADDR' as + (VasEBoot_mkimage_CFLAGS): Propagate `VasEBoot_MEMORY_MACHINE_LINK_ADDR' as a C macro. - * include/grub/i386/pc/memory.h (GRUB_MEMORY_MACHINE_UPPER): New macro. + * include/VasEBoot/i386/pc/memory.h (VasEBoot_MEMORY_MACHINE_UPPER): New macro. Indicates start of upper memory. - * util/i386/pc/grub-mkimage.c: Include `'. + * util/i386/pc/VasEBoot-mkimage.c: Include `'. (generate_image): Abort when image size is big enough to corrupt upper memory. - * include/grub/i386/pc/vga.h: Include `'. - (GRUB_MEMORY_MACHINE_VGA_ADDR): Alias for `GRUB_MEMORY_MACHINE_UPPER'. - * term/i386/pc/vga.c (VGA_MEM): Use `GRUB_MEMORY_MACHINE_VGA_ADDR' + * include/VasEBoot/i386/pc/vga.h: Include `'. + (VasEBoot_MEMORY_MACHINE_VGA_ADDR): Alias for `VasEBoot_MEMORY_MACHINE_UPPER'. + * term/i386/pc/vga.c (VGA_MEM): Use `VasEBoot_MEMORY_MACHINE_VGA_ADDR' instead of hardcoding 0xA0000. - * video/i386/pc/vbe.c: Include `'. - (grub_vbe_set_video_mode): Use `GRUB_MEMORY_MACHINE_VGA_ADDR' + * video/i386/pc/vbe.c: Include `'. + (VasEBoot_vbe_set_video_mode): Use `VasEBoot_MEMORY_MACHINE_VGA_ADDR' instead of hardcoding 0xA0000. 2008-01-21 Robert Millan * disk/memdisk.c (memdisk_size): New variable. - (grub_memdisk_open): Replace grub_arch_memdisk_size() call with + (VasEBoot_memdisk_open): Replace VasEBoot_arch_memdisk_size() call with `memdisk_size'. - (grub_memdisk_init): Initialize `memdisk_size'. Reallocate memdisk + (VasEBoot_memdisk_init): Initialize `memdisk_size'. Reallocate memdisk image to dynamic memory. - (grub_memdisk_fini): Replace grub_arch_memdisk_size() call with + (VasEBoot_memdisk_fini): Replace VasEBoot_arch_memdisk_size() call with `memdisk_size'. Free memdisk block. 2008-01-21 Robert Millan Fix detection of very small filesystems (like tar). - * fs/reiserfs.c (grub_reiserfs_mount): When disk is too small to - contain a ReiserFS, abort with GRUB_ERR_BAD_FS rather than - GRUB_ERR_OUT_OF_RANGE (which made the upper layer think there's + * fs/reiserfs.c (VasEBoot_reiserfs_mount): When disk is too small to + contain a ReiserFS, abort with VasEBoot_ERR_BAD_FS rather than + VasEBoot_ERR_OUT_OF_RANGE (which made the upper layer think there's a problem with this disk). 2008-01-21 Robert Millan - * disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Add debug message - on grub_biosdisk_rw_standard() error. + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_iterate): Add debug message + on VasEBoot_biosdisk_rw_standard() error. 2008-01-21 Robert Millan - * include/grub/ieee1275/ieee1275.h: Add 2008 to Copyright line for + * include/VasEBoot/ieee1275/ieee1275.h: Add 2008 to Copyright line for recent changes. * kern/elf.c: Likewise. * kern/ieee1275/ieee1275.c: Likewise. @@ -46641,25 +46641,25 @@ 2008-01-21 Robert Millan - * include/grub/i386/pc/kernel.h: Include `'. + * include/VasEBoot/i386/pc/kernel.h: Include `'. - * include/grub/kernel.h (grub_arch_memdisk_addr) - (grub_arch_memdisk_size): Moved from here ... + * include/VasEBoot/kernel.h (VasEBoot_arch_memdisk_addr) + (VasEBoot_arch_memdisk_size): Moved from here ... - * include/grub/i386/pc/kernel.h (grub_arch_memdisk_addr) - (grub_arch_memdisk_size): ... to here. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_arch_memdisk_addr) + (VasEBoot_arch_memdisk_size): ... to here. 2008-01-21 Robert Millan Mostly based on bugfix from Bean. - * kern/elf.c (grub_elf32_phdr_iterate): Use `NESTED_FUNC_ATTR' + * kern/elf.c (VasEBoot_elf32_phdr_iterate): Use `NESTED_FUNC_ATTR' attribute with hook() parameter. - (grub_elf32_load): Use `NESTED_FUNC_ATTR' with grub_elf32_load_segment() + (VasEBoot_elf32_load): Use `NESTED_FUNC_ATTR' with VasEBoot_elf32_load_segment() declaration. - (grub_elf64_phdr_iterate): Use `NESTED_FUNC_ATTR' + (VasEBoot_elf64_phdr_iterate): Use `NESTED_FUNC_ATTR' attribute with hook() parameter. - (grub_elf64_load): Use `NESTED_FUNC_ATTR' with grub_elf64_load_segment() + (VasEBoot_elf64_load): Use `NESTED_FUNC_ATTR' with VasEBoot_elf64_load_segment() declaration. 2008-01-21 Robert Millan @@ -46672,160 +46672,160 @@ * disk/memdisk.c: New file. - * include/grub/disk.h (grub_disk_dev_id): Add - `GRUB_DISK_DEVICE_MEMDISK_ID'. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add + `VasEBoot_DISK_DEVICE_MEMDISK_ID'. - * include/grub/i386/pc/kernel.h - (GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): New macro. - (GRUB_KERNEL_MACHINE_PREFIX): Increment by 4. - (grub_kernel_image_size): New variable declaration. - (grub_total_module_size): Likewise. - (grub_memdisk_image_size): Likewise. + * include/VasEBoot/i386/pc/kernel.h + (VasEBoot_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): New macro. + (VasEBoot_KERNEL_MACHINE_PREFIX): Increment by 4. + (VasEBoot_kernel_image_size): New variable declaration. + (VasEBoot_total_module_size): Likewise. + (VasEBoot_memdisk_image_size): Likewise. - * include/grub/i386/pc/memory.h - (GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR): New macro. + * include/VasEBoot/i386/pc/memory.h + (VasEBoot_MEMORY_MACHINE_DECOMPRESSION_ADDR): New macro. - * include/grub/kernel.h: Include `'. - (grub_arch_memdisk_addr): New variable declaration. - (grub_arch_memdisk_size): Likewise. + * include/VasEBoot/kernel.h: Include `'. + (VasEBoot_arch_memdisk_addr): New variable declaration. + (VasEBoot_arch_memdisk_size): Likewise. - * kern/i386/pc/init.c (grub_arch_memdisk_addr): New function. - (grub_arch_memdisk_size): Likewise. + * kern/i386/pc/init.c (VasEBoot_arch_memdisk_addr): New function. + (VasEBoot_arch_memdisk_size): Likewise. - * kern/i386/pc/startup.S (grub_memdisk_image_size): New variable. + * kern/i386/pc/startup.S (VasEBoot_memdisk_image_size): New variable. (codestart): Replace hardcoded `0x100000' with - `GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR' macro. + `VasEBoot_MEMORY_MACHINE_DECOMPRESSION_ADDR' macro. - * util/i386/pc/grub-mkimage.c: Include `'. + * util/i386/pc/VasEBoot-mkimage.c: Include `'. (generate_image): Add `memdisk_path' parameter. When `memdisk_path' is not NULL, append the contents of the file it refers to, at the end of - the compressed kernel image. Initialize `grub_memdisk_image_size' - variable (at `GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE' offset). + the compressed kernel image. Initialize `VasEBoot_memdisk_image_size' + variable (at `VasEBoot_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE' offset). (options): Add "memdisk"|'m' option. (main): Parse --memdisk|-m option, and pass user-provided path as parameter to generate_image(). 2008-01-20 Robert Millan - * kern/sparc64/ieee1275/openfw.c (grub_devalias_iterate): Copy debug - grub_dprintf() calls from here ... - * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): ... to here. + * kern/sparc64/ieee1275/openfw.c (VasEBoot_devalias_iterate): Copy debug + VasEBoot_dprintf() calls from here ... + * kern/powerpc/ieee1275/openfw.c (VasEBoot_devalias_iterate): ... to here. 2008-01-20 Robert Millan Fix detection of "real mode" when /options/real-mode? doesn't exist. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_mmu): New variable + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_mmu): New variable declaration. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_mmu): New variable. - (grub_ieee1275_find_options): If `grub_ieee1275_mmu' is 0, set - `GRUB_IEEE1275_FLAG_REAL_MODE'. - (cmain): Initialize `grub_ieee1275_mmu' (using /chosen/mmu integer + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_mmu): New variable. + (VasEBoot_ieee1275_find_options): If `VasEBoot_ieee1275_mmu' is 0, set + `VasEBoot_IEEE1275_FLAG_REAL_MODE'. + (cmain): Initialize `VasEBoot_ieee1275_mmu' (using /chosen/mmu integer property). - * kern/powerpc/ieee1275/openfw.c (grub_map): Rely on pre-initialized - `grub_ieee1275_mmu' rather than obtaining a handler on every call. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_map): Rely on pre-initialized + `VasEBoot_ieee1275_mmu' rather than obtaining a handler on every call. 2008-01-19 Robert Millan Get rid of confusing function (superseded by - `grub_ieee1275_get_integer_property') - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_decode_int_4): Remove + `VasEBoot_ieee1275_get_integer_property') + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_decode_int_4): Remove prototype. - * kern/ieee1275/ieee1275.c (grub_ieee1275_decode_int_4): Remove + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_decode_int_4): Remove function. - * term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid use of - grub_ieee1275_decode_int_4(), by obtaining integer properties directly - in native endianness from grub_ieee1275_get_integer_property(). + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_init): Avoid use of + VasEBoot_ieee1275_decode_int_4(), by obtaining integer properties directly + in native endianness from VasEBoot_ieee1275_get_integer_property(). 2008-01-19 Robert Millan - * kern/powerpc/ieee1275/openfw.c (grub_halt): Issue "power-off" + * kern/powerpc/ieee1275/openfw.c (VasEBoot_halt): Issue "power-off" command after "shut-down", since implementations differ on which the command for halt is. 2008-01-19 Robert Millan - * include/grub/i386/linuxbios/console.h: Add header protection. - (grub_keyboard_controller_init): New function prototype. + * include/VasEBoot/i386/linuxbios/console.h: Add header protection. + (VasEBoot_keyboard_controller_init): New function prototype. * term/i386/pc/at_keyboard.c (KEYBOARD_COMMAND_ISREADY): New macro. (KEYBOARD_COMMAND_READ): Likewise. (KEYBOARD_COMMAND_WRITE): Likewise. (KEYBOARD_SCANCODE_SET1): Likewise. - (grub_keyboard_controller_write): New function. - (grub_keyboard_controller_read): Likewise. - (grub_keyboard_controller_init): Likewise. + (VasEBoot_keyboard_controller_write): New function. + (VasEBoot_keyboard_controller_read): Likewise. + (VasEBoot_keyboard_controller_init): Likewise. - * term/i386/pc/console.c: Include `'. - (grub_console_init): On coreboot/LinuxBIOS, call - grub_keyboard_controller_init(). + * term/i386/pc/console.c: Include `'. + (VasEBoot_console_init): On coreboot/LinuxBIOS, call + VasEBoot_keyboard_controller_init(). 2008-01-19 Robert Millan PowerPC changes provided by Pavel Roskin. * kern/powerpc/ieee1275/cmain.c (cmain): Don't take any arguments. - * kern/powerpc/ieee1275/crt0.S: Store r5 in grub_ieee1275_entry_fn, + * kern/powerpc/ieee1275/crt0.S: Store r5 in VasEBoot_ieee1275_entry_fn, don't rely on cmain() doing it. * kern/i386/ieee1275/startup.S (_start): Store %eax in - grub_ieee1275_entry_fn, don't rely on cmain() doing it. + VasEBoot_ieee1275_entry_fn, don't rely on cmain() doing it. 2008-01-16 Robert Millan - * include/grub/i386/linuxbios/memory.h - (GRUB_MEMORY_MACHINE_LINUXBIOS_TABLE_ADDR): Remove macro. - * kern/i386/linuxbios/table.c (grub_linuxbios_table_iterate): Do not + * include/VasEBoot/i386/linuxbios/memory.h + (VasEBoot_MEMORY_MACHINE_LINUXBIOS_TABLE_ADDR): Remove macro. + * kern/i386/linuxbios/table.c (VasEBoot_linuxbios_table_iterate): Do not receive `table_header' as argument. Instead, probe for it in the known memory ranges where it can be present. - (grub_available_iterate): Do not pass a fixed `table_header' address - to grub_linuxbios_table_iterate(). + (VasEBoot_available_iterate): Do not pass a fixed `table_header' address + to VasEBoot_linuxbios_table_iterate(). 2008-01-15 Robert Millan * configure.ac: Add `i386-ieee1275' to the list of supported targets. * conf/i386-ieee1275.rmk: New file. - * include/grub/i386/ieee1275/console.h: Likewise. - * include/grub/i386/ieee1275/ieee1275.h: Likewise. - * include/grub/i386/ieee1275/kernel.h: Likewise. - * include/grub/i386/ieee1275/time.h: Likewise. + * include/VasEBoot/i386/ieee1275/console.h: Likewise. + * include/VasEBoot/i386/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/i386/ieee1275/kernel.h: Likewise. + * include/VasEBoot/i386/ieee1275/time.h: Likewise. * kern/i386/ieee1275/init.c: Likewise. * kern/i386/ieee1275/startup.S: Likewise. 2008-01-15 Robert Millan - * kern/misc.c (grub_vsprintf): Do not reset `longlongfmt' to zero + * kern/misc.c (VasEBoot_vsprintf): Do not reset `longlongfmt' to zero when pointers are 32-bit (but still do set it to one when they are 64-bit). 2008-01-15 Robert Millan - * include/grub/ieee1275/ieee1275.h - (grub_ieee1275_get_integer_property): New function prototype. + * include/VasEBoot/ieee1275/ieee1275.h + (VasEBoot_ieee1275_get_integer_property): New function prototype. - * kern/ieee1275/ieee1275.c: Include `'. - (grub_ieee1275_get_integer_property): New function. Wraps around - grub_ieee1275_get_property() to handle endianness. + * kern/ieee1275/ieee1275.c: Include `'. + (VasEBoot_ieee1275_get_integer_property): New function. Wraps around + VasEBoot_ieee1275_get_property() to handle endianness. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Replace - grub_ieee1275_get_property() with grub_ieee1275_get_integer_property() + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Replace + VasEBoot_ieee1275_get_property() with VasEBoot_ieee1275_get_integer_property() where appropriate. - * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Likewise. - (grub_map): Likewise. - * kern/sparc64/ieee1275/openfw.c (grub_map): Likewise. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_available_iterate): Likewise. + (VasEBoot_map): Likewise. + * kern/sparc64/ieee1275/openfw.c (VasEBoot_map): Likewise. 2008-01-15 Bean - * normal/execute.c (grub_script_exec_argument_to_string): Check for undefined variable. - (grub_script_execute_cmdline): Reset grub_errno. + * normal/execute.c (VasEBoot_script_exec_argument_to_string): Check for undefined variable. + (VasEBoot_script_execute_cmdline): Reset VasEBoot_errno. - * normal/main.c (read_config_file): Reset grub_errno. + * normal/main.c (read_config_file): Reset VasEBoot_errno. * normal/parse.y (script_init): New. (script): Move function and menuentry here. (delimiter): New. (command): Add delimiter at the end of command. (commands): Adjust to match the new command. - (commandblock): Remove grub_script_lexer_record_start. - (menuentry): Add grub_script_lexer_record_start, use the new commands. + (commandblock): Remove VasEBoot_script_lexer_record_start. + (menuentry): Add VasEBoot_script_lexer_record_start, use the new commands. (if): Use the new commands. * conf/common.rmk (pkgdata_MODULES): Add echo.mod. @@ -46840,13 +46840,13 @@ 2008-01-15 Robert Millan - * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Obtain - actual size of `available' from grub_ieee1275_get_property(), and + * kern/powerpc/ieee1275/openfw.c (VasEBoot_available_iterate): Obtain + actual size of `available' from VasEBoot_ieee1275_get_property(), and restrict parsing to that bound. 2008-01-15 Christian Franke - * util/grub-emu.c: Replace by . + * util/VasEBoot-emu.c: Replace by . (argp_program_version): Remove variable. (argp_program_bug_address): Likewise. (options): Convert from struct argp_option to struct option. @@ -46860,109 +46860,109 @@ 2008-01-14 Robert Millan - * kern/powerpc/ieee1275/init.c (grub_exit): Reimplement as a wrapper - for grub_ieee1275_exit(), in order to improve portability. + * kern/powerpc/ieee1275/init.c (VasEBoot_exit): Reimplement as a wrapper + for VasEBoot_ieee1275_exit(), in order to improve portability. 2008-01-14 Robert Millan - * util/grub.d/10_linux.in (prefix): Define. + * util/VasEBoot.d/10_linux.in (prefix): Define. (exec_prefix): Likewise. Both definitions are later used by `libdir'. 2008-01-13 Pavel Roskin - * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Don't use - grub_errno if no errors have been detected. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Don't use + VasEBoot_errno if no errors have been detected. 2008-01-12 Robert Millan - * include/grub/util/getroot.h (grub_dev_abstraction_types): New enum. - (grub_util_get_dev_abstraction): New function prototype. + * include/VasEBoot/util/getroot.h (VasEBoot_dev_abstraction_types): New enum. + (VasEBoot_util_get_dev_abstraction): New function prototype. - * util/getroot.c: Include `' - (grub_util_get_grub_dev): Move detection of abstraction type to ... - (grub_util_get_dev_abstraction): ... here (new function). + * util/getroot.c: Include `' + (VasEBoot_util_get_VasEBoot_dev): Move detection of abstraction type to ... + (VasEBoot_util_get_dev_abstraction): ... here (new function). - * util/grub-probe.c: Convert PRINT_* to an enum. Add + * util/VasEBoot-probe.c: Convert PRINT_* to an enum. Add `PRINT_ABSTRACTION'. (probe): Probe for abstraction type when requested. (main): Understand `--target=abstraction'. - * util/i386/efi/grub-install.in: Add abstraction module to core + * util/i386/efi/VasEBoot-install.in: Add abstraction module to core image when it is found to be necessary. - * util/i386/pc/grub-install.in: Likewise. - * util/powerpc/ieee1275/grub-install.in: Likewise. + * util/i386/pc/VasEBoot-install.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-install.in: Likewise. - * util/update-grub_lib.in (font_path): Return system path without - converting to GRUB path. - * util/update-grub.in: Convert system path returned by font_path() - to a GRUB path. Use `grub-probe -t abstraction' to determine what + * util/update-VasEBoot_lib.in (font_path): Return system path without + converting to VasEBoot path. + * util/update-VasEBoot.in: Convert system path returned by font_path() + to a VasEBoot path. Use `VasEBoot-probe -t abstraction' to determine what abstraction module is needed for loading fonts (if any). Export - that as `GRUB_PRELOAD_MODULES'. - * util/grub.d/00_header.in: Process `GRUB_PRELOAD_MODULES' (print + that as `VasEBoot_PRELOAD_MODULES'. + * util/VasEBoot.d/00_header.in: Process `VasEBoot_PRELOAD_MODULES' (print insmod commands). 2008-01-12 Yoshinori K. Okuji Remove some unused code from reiserfs. - * fs/reiserfs.c (struct grub_reiserfs_key) - [GRUB_REISERFS_KEYV2_BITFIELD]: Removed offset and type. - (struct grub_reiserfs_node_body): Removed. - (grub_reiserfs_get_key_v2_type) [GRUB_REISERFS_KEYV2_BITFIELD]: + * fs/reiserfs.c (struct VasEBoot_reiserfs_key) + [VasEBoot_REISERFS_KEYV2_BITFIELD]: Removed offset and type. + (struct VasEBoot_reiserfs_node_body): Removed. + (VasEBoot_reiserfs_get_key_v2_type) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_get_key_offset) [GRUB_REISERFS_KEYV2_BITFIELD]: + (VasEBoot_reiserfs_get_key_offset) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_set_key_offset) [GRUB_REISERFS_KEYV2_BITFIELD]: + (VasEBoot_reiserfs_set_key_offset) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_set_key_offset) [GRUB_REISERFS_KEYV2_BITFIELD]: + (VasEBoot_reiserfs_set_key_offset) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_set_key_type) [GRUB_REISERFS_KEYV2_BITFIELD]: + (VasEBoot_reiserfs_set_key_type) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_iterate_dir) [GRUB_REISERFS_KEYV2_BITFIELD]: + (VasEBoot_reiserfs_iterate_dir) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_open) [GRUB_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_read) [GRUB_REISERFS_KEYV2_BITFIELD]: Likewise. - (grub_reiserfs_dir) [GRUB_REISERFS_KEYV2_BITFIELD]: Likewise. + (VasEBoot_reiserfs_open) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. + (VasEBoot_reiserfs_read) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. + (VasEBoot_reiserfs_dir) [VasEBoot_REISERFS_KEYV2_BITFIELD]: Likewise. 2008-01-10 Robert Millan - * util/update-grub_lib.in (grub_file_is_not_garbage): New function. + * util/update-VasEBoot_lib.in (VasEBoot_file_is_not_garbage): New function. Determines if a file is garbage left by packaging systems, etc. - * util/update-grub.in: Use grub_file_is_not_garbage() as a condition - for processing /etc/grub.d scripts. - * util/grub.d/10_hurd.in: Fix `GRUB_DISTRIBUTOR' comparison. - * util/grub.d/10_linux.in: Likewise. Use grub_file_is_not_garbage() + * util/update-VasEBoot.in: Use VasEBoot_file_is_not_garbage() as a condition + for processing /etc/VasEBoot.d scripts. + * util/VasEBoot.d/10_hurd.in: Fix `VasEBoot_DISTRIBUTOR' comparison. + * util/VasEBoot.d/10_linux.in: Likewise. Use VasEBoot_file_is_not_garbage() as a condition for processing Linux images. 2008-01-10 Pavel Roskin - * include/grub/powerpc/libgcc.h (__ucmpdi2): New export. Needed + * include/VasEBoot/powerpc/libgcc.h (__ucmpdi2): New export. Needed to compile reiserfs.c on PowerPC. 2008-01-10 Robert Millan - * kern/device.c (grub_device_iterate): Do not abort device iteration + * kern/device.c (VasEBoot_device_iterate): Do not abort device iteration when one of the devices cannot be opened. - * kern/disk.c (grub_disk_open): Do not account previous failures of - unrelated functions when grub_errno is checked for. + * kern/disk.c (VasEBoot_disk_open): Do not account previous failures of + unrelated functions when VasEBoot_errno is checked for. 2008-01-08 Robert Millan - * loader/i386/pc/linux.c (grub_rescue_cmd_linux): For - `! grub_linux_is_bzimage', change order of address comparison to make + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_linux): For + `! VasEBoot_linux_is_bzimage', change order of address comparison to make it more intuitive, and improve "too big zImage" error message. 2008-01-08 Robert Millan - * Makefile.in (uninstall): Handle `$(update-grub_SCRIPTS)' and - `$(update-grub_DATA)'. + * Makefile.in (uninstall): Handle `$(update-VasEBoot_SCRIPTS)' and + `$(update-VasEBoot_DATA)'. (distcheck): Fix race condition when invoking `$(MAKE)' on multiple targets. 2008-01-07 Robert Millan * boot/i386/pc/boot.S (boot_drive_check): Add a comment indicating - which instruction is modified by grub-setup during installation + which instruction is modified by VasEBoot-setup during installation (since it wasn't obvious by only looking at this file). 2008-01-07 Robert Millan @@ -46972,21 +46972,21 @@ 2008-01-06 Yoshinori K. Okuji - * fs/reiserfs.c (grub_reiserfs_get_key_v2_type): Handle endianness + * fs/reiserfs.c (VasEBoot_reiserfs_get_key_v2_type): Handle endianness correctly. - (grub_reiserfs_get_key_offset): Likewise. - (grub_reiserfs_set_key_offset): Likewise. - (grub_reiserfs_set_key_type): Likewise. - (grub_reiserfs_iterate_dir): Return 1 if found, otherwise 0. + (VasEBoot_reiserfs_get_key_offset): Likewise. + (VasEBoot_reiserfs_set_key_offset): Likewise. + (VasEBoot_reiserfs_set_key_type): Likewise. + (VasEBoot_reiserfs_iterate_dir): Return 1 if found, otherwise 0. - (GRUB_REISERFS_KEYV2_BITFIELD): Undefined. Probably it would be + (VasEBoot_REISERFS_KEYV2_BITFIELD): Undefined. Probably it would be better to remove the bitfield version completely. 2008-01-06 Yoshinori K. Okuji - * fs/reiserfs.c (grub_reiserfs_iterate_dir): ENTRY_ITEM must be + * fs/reiserfs.c (VasEBoot_reiserfs_iterate_dir): ENTRY_ITEM must be allocated from the heap, due to the fshelp implementation. - (grub_reiserfs_dir): Free NODE, due to the same reason. + (VasEBoot_reiserfs_dir): Free NODE, due to the same reason. 2008-01-06 Yoshinori K. Okuji @@ -47001,87 +47001,87 @@ * DISTLIST: Added boot/i386/pc/lnxboot.S, commands/hexdump.c, disk/ata.c, fs/cpio.c, fs/ntfscomp.c, fs/reiserfs.c, - include/grub/ntfs.h, include/grub/i386/pc/machine.h, and + include/VasEBoot/ntfs.h, include/VasEBoot/i386/pc/machine.h, and normal/color.c. 2008-01-06 Robert Millan - * normal/color.c: Remove `'. + * normal/color.c: Remove `'. 2008-01-05 Jeroen Dekkers - * include/grub/normal.h: Include . + * include/VasEBoot/normal.h: Include . 2008-01-05 Robert Millan - * util/i386/pc/grub-setup.c (usage): Replace obsolete `(hd0,0)' in + * util/i386/pc/VasEBoot-setup.c (usage): Replace obsolete `(hd0,0)' in usage example with `(hd0,1)'. Reported by Samuel Thibault. 2008-01-05 Robert Millan - * kern/i386/loader.S (grub_linux_is_bzimage): New variable. - (grub_linux_boot_zimage): Rename to ... - (grub_linux_boot): ... this. - (grub_linux_boot_bzimage): Merge with `grub_linux_boot_zimage'. - (grub_linux_boot_zimage): Conditionalize zImage copy. + * kern/i386/loader.S (VasEBoot_linux_is_bzimage): New variable. + (VasEBoot_linux_boot_zimage): Rename to ... + (VasEBoot_linux_boot): ... this. + (VasEBoot_linux_boot_bzimage): Merge with `VasEBoot_linux_boot_zimage'. + (VasEBoot_linux_boot_zimage): Conditionalize zImage copy. - * include/grub/i386/loader.h (grub_linux_is_bzimage): Add prototype. - (grub_linux_boot_bzimage): Remove prototype. - (grub_linux_boot_zimage): Rename to ... - (grub_linux_boot): ... this. + * include/VasEBoot/i386/loader.h (VasEBoot_linux_is_bzimage): Add prototype. + (VasEBoot_linux_boot_bzimage): Remove prototype. + (VasEBoot_linux_boot_zimage): Rename to ... + (VasEBoot_linux_boot): ... this. - * loader/i386/pc/linux.c (big_linux): Replace with `grub_linux_is_bzimage'. - (grub_linux_boot): Remove function. + * loader/i386/pc/linux.c (big_linux): Replace with `VasEBoot_linux_is_bzimage'. + (VasEBoot_linux_boot): Remove function. 2008-01-05 Robert Millan - * include/grub/normal.h (grub_env_write_color_normal): New prototype. - (grub_env_write_color_highlight): Likewise. - (grub_wait_after_message): Likewise. + * include/VasEBoot/normal.h (VasEBoot_env_write_color_normal): New prototype. + (VasEBoot_env_write_color_highlight): Likewise. + (VasEBoot_wait_after_message): Likewise. * normal/color.c: New file. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `normal/color.c'. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `normal/color.c'. (normal_mod_DEPENDENCIES): Likewise. - * conf/i386-efi.rmk (grub_emu_SOURCES): Add `normal/color.c'. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Add `normal/color.c'. (normal_mod_DEPENDENCIES): Likewise. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Add `normal/color.c'. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Add `normal/color.c'. (normal_mod_DEPENDENCIES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `normal/color.c'. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `normal/color.c'. (normal_mod_DEPENDENCIES): Likewise. - * normal/menu_entry.c (run): Rely on grub_wait_after_message() + * normal/menu_entry.c (run): Rely on VasEBoot_wait_after_message() for waiting after a message is printed. * normal/main.c (read_config_file): Likewise. - (grub_normal_init): Register grub_env_write_color_normal() and - grub_env_write_color_highlight() hooks. Mark `color_normal' and + (VasEBoot_normal_init): Register VasEBoot_env_write_color_normal() and + VasEBoot_env_write_color_highlight() hooks. Mark `color_normal' and `color_highlight' variables as global. - * normal/menu.c (grub_wait_after_message): New function. - (grub_color_menu_normal): New variable. Replaces ... - (GRUB_COLOR_MENU_NORMAL): ... this macro. - (grub_color_menu_highlight): New variable. Replaces ... - (GRUB_COLOR_MENU_HIGHLIGHT): ... this macro. - (draw_border): Set color state to `GRUB_TERM_COLOR_NORMAL' instead of - `GRUB_TERM_COLOR_STANDARD'. - (print_message): Use `grub_setcolorstate' to reload colors. Rename + * normal/menu.c (VasEBoot_wait_after_message): New function. + (VasEBoot_color_menu_normal): New variable. Replaces ... + (VasEBoot_COLOR_MENU_NORMAL): ... this macro. + (VasEBoot_color_menu_highlight): New variable. Replaces ... + (VasEBoot_COLOR_MENU_HIGHLIGHT): ... this macro. + (draw_border): Set color state to `VasEBoot_TERM_COLOR_NORMAL' instead of + `VasEBoot_TERM_COLOR_STANDARD'. + (print_message): Use `VasEBoot_setcolorstate' to reload colors. Rename `normal_code' and `highlight_code' to `old_color_normal' and `old_color_highlight', respectively. - (grub_menu_init_page): Update colors when drawing the menu, based on + (VasEBoot_menu_init_page): Update colors when drawing the menu, based on `menu_color_normal' and `menu_color_highlight' variables. - (grub_menu_run): Rely on grub_wait_after_message() for waiting after + (VasEBoot_menu_run): Rely on VasEBoot_wait_after_message() for waiting after a message is printed. 2008-01-05 Robert Millan - * kern/env.c (grub_env_context_open): Propagate hooks for global + * kern/env.c (VasEBoot_env_context_open): Propagate hooks for global variables to new context. - * kern/main.c (grub_set_root_dev): Export `root' variable. + * kern/main.c (VasEBoot_set_root_dev): Export `root' variable. 2008-01-05 Robert Millan @@ -47095,7 +47095,7 @@ 2008-01-04 Christian Franke - * kern/i386/pc/init.c (grub_machine_init): Fix evaluation + * kern/i386/pc/init.c (VasEBoot_machine_init): Fix evaluation of eisa_mmap. 2008-01-03 Pavel Roskin @@ -47105,17 +47105,17 @@ * kern/powerpc/ieee1275/init.c: Likewise. * term/i386/pc/at_keyboard.c: Likewise. * term/i386/pc/vga_text.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. 2008-01-02 Robert Millan - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Improve error + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf32): Improve error message when loaded image is out of bounds. - (grub_multiboot_load_elf64): Likewise. + (VasEBoot_multiboot_load_elf64): Likewise. 2008-01-02 Pavel Roskin - * util/grub.d/10_linux.in: Try version without ".old" when + * util/VasEBoot.d/10_linux.in: Try version without ".old" when looking for initrd. It's better to use initrd from the newer kernel of the same version than no initrd at all. @@ -47125,24 +47125,24 @@ 2008-01-01 Vesa Jaaskelainen - * include/grub/video.h: Added grub_video_unmap_color and - grub_video_get_active_render_target. - (grub_video_adapter): Added unmap_color and get_active_render_target. + * include/VasEBoot/video.h: Added VasEBoot_video_unmap_color and + VasEBoot_video_get_active_render_target. + (VasEBoot_video_adapter): Added unmap_color and get_active_render_target. - * video/video.c: Added grub_video_unmap_color and - grub_video_get_active_render_target. - (grub_video_get_info): Changed method to accept NULL pointer as an + * video/video.c: Added VasEBoot_video_unmap_color and + VasEBoot_video_get_active_render_target. + (VasEBoot_video_get_info): Changed method to accept NULL pointer as an argument to allow detection of active video adapter. - * video/i386/pc/vbe.c: Renamed grub_video_vbe_unmap_color as - grub_video_vbe_unmap_color_int. - Added grub_video_vbe_unmap_color and - grub_video_vbe_get_active_render_target. - (grub_video_vbe_adapter): Added unmap_color and + * video/i386/pc/vbe.c: Renamed VasEBoot_video_vbe_unmap_color as + VasEBoot_video_vbe_unmap_color_int. + Added VasEBoot_video_vbe_unmap_color and + VasEBoot_video_vbe_get_active_render_target. + (VasEBoot_video_vbe_adapter): Added unmap_color and get_active_render_target. - * video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage - with grub_video_vbe_unmap_color_int. + * video/i386/pc/vbeblit.c: Replaced VasEBoot_video_vbe_unmap_color usage + with VasEBoot_video_vbe_unmap_color_int. * term/gfxterm.c (DEFAULT_STANDARD_COLOR): Added. (DEFAULT_NORMAL_COLOR): Likewise. @@ -47150,27 +47150,27 @@ (DEFAULT_FG_COLOR): Removed. (DEFAULT_BG_COLOR): Likewise. (DEFAULT_CURSOR_COLOR): Changed value. - (grub_virtual_screen): Added standard_color_setting, + (VasEBoot_virtual_screen): Added standard_color_setting, normal_color_setting, highlight_color_setting and term_color. - (grub_virtual_screen): Removed fg_color_setting and bg_color_setting. + (VasEBoot_virtual_screen): Removed fg_color_setting and bg_color_setting. (bitmap_width): Added. (bitmap_height): Likewise. (bitmap): Likewise. (set_term_color): Likewise. - (grub_virtual_screen_setup): Changed to use new terminal coloring + (VasEBoot_virtual_screen_setup): Changed to use new terminal coloring settings. - (grub_gfxterm_init): Added init for bitmap. - (grub_gfxterm_fini): Added destroy for bitmap. + (VasEBoot_gfxterm_init): Added init for bitmap. + (VasEBoot_gfxterm_fini): Added destroy for bitmap. (redraw_screen_rect): Updated to use background bitmap and new terminal coloring. (scroll_up): Added optimization for case when there is no bitmap. - (grub_gfxterm_cls): Fixed to use correct background color. - (grub_virtual_screen_setcolorstate): Changed to use new terminal + (VasEBoot_gfxterm_cls): Fixed to use correct background color. + (VasEBoot_virtual_screen_setcolorstate): Changed to use new terminal coloring. - (grub_virtual_screen_setcolor): Likewise. - (grub_virtual_screen_getcolor): Added. - (grub_gfxterm_background_image_cmd): Likewise. - (grub_video_term): Added setcolor and getcolor. + (VasEBoot_virtual_screen_setcolor): Likewise. + (VasEBoot_virtual_screen_getcolor): Added. + (VasEBoot_gfxterm_background_image_cmd): Likewise. + (VasEBoot_video_term): Added setcolor and getcolor. (MOD_INIT): Added registration of background_image command. (MOD_TERM): Added unregistration for background_image command. @@ -47181,7 +47181,7 @@ 2007-12-29 Pavel Roskin - * util/grub.d/10_linux.in: Refactor search for initrd. Add + * util/VasEBoot.d/10_linux.in: Refactor search for initrd. Add support for initrd names used in Fedora. 2007-12-26 Bean @@ -47193,44 +47193,44 @@ * fs/cpio.c: New file. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add cpio.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add cpio.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. 2007-12-25 Robert Millan - * include/grub/term.h (struct grub_term): Add `getcolor' function. - (grub_getcolor): New function. + * include/VasEBoot/term.h (struct VasEBoot_term): Add `getcolor' function. + (VasEBoot_getcolor): New function. - * kern/term.c (grub_getcolor): New function. - * normal/menu.c (GRUB_COLOR_MENU_NORMAL): New macro. - (GRUB_COLOR_MENU_HIGHLIGHT): New macro. + * kern/term.c (VasEBoot_getcolor): New function. + * normal/menu.c (VasEBoot_COLOR_MENU_NORMAL): New macro. + (VasEBoot_COLOR_MENU_HIGHLIGHT): New macro. (print_entry): Set normal and highlight colors to - `GRUB_COLOR_MENU_NORMAL' and `GRUB_COLOR_MENU_HIGHLIGHT', + `VasEBoot_COLOR_MENU_NORMAL' and `VasEBoot_COLOR_MENU_HIGHLIGHT', respectively, before printing and restore them to old values afterwards. - (grub_menu_init_page): Likewise. Fill an additional colored space + (VasEBoot_menu_init_page): Likewise. Fill an additional colored space that would otherwise be left blank. - * term/efi/console.c (grub_console_getcolor): New function. - (struct grub_console_term.getcolor): New variable. - * term/i386/pc/console.c (grub_console_getcolor): New function. - (struct grub_console_term.getcolor): New variable. - * term/ieee1275/ofconsole.c (grub_ofconsole_getcolor): New function. - (struct grub_console_term.getcolor): New variable. + * term/efi/console.c (VasEBoot_console_getcolor): New function. + (struct VasEBoot_console_term.getcolor): New variable. + * term/i386/pc/console.c (VasEBoot_console_getcolor): New function. + (struct VasEBoot_console_term.getcolor): New variable. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_getcolor): New function. + (struct VasEBoot_console_term.getcolor): New variable. - * term/i386/pc/serial.c (grub_serial_setcolor): Remove function. - (struct grub_console_term.setcolor): Remove variable. - * term/i386/pc/vesafb.c (grub_virtual_screen_setcolor): Remove function. - (struct grub_console_term.setcolor): Remove variable. - * term/i386/pc/vga.c (grub_vga_setcolor): Remove function. - (struct grub_console_term.setcolor): Remove variable. - * term/gfxterm.c (grub_virtual_screen_setcolor): Remove function. - (struct grub_console_term.setcolor): Remove variable. + * term/i386/pc/serial.c (VasEBoot_serial_setcolor): Remove function. + (struct VasEBoot_console_term.setcolor): Remove variable. + * term/i386/pc/vesafb.c (VasEBoot_virtual_screen_setcolor): Remove function. + (struct VasEBoot_console_term.setcolor): Remove variable. + * term/i386/pc/vga.c (VasEBoot_vga_setcolor): Remove function. + (struct VasEBoot_console_term.setcolor): Remove variable. + * term/gfxterm.c (VasEBoot_virtual_screen_setcolor): Remove function. + (struct VasEBoot_console_term.setcolor): Remove variable. 2007-12-25 Robert Millan @@ -47254,13 +47254,13 @@ (all-local): Add `$(PKGDATA)' dependency. (install-local): Process `$(PKGDATA)'. - * util/update-grub_lib.in (font_path): Search for *.pff files in + * util/update-VasEBoot_lib.in (font_path): Search for *.pff files in a few more locations, including `${pkgdata}'. 2007-12-23 Robert Millan Patch from Bean : - * disk/loopback.c (grub_loopback_read): Add missing bit shift to + * disk/loopback.c (VasEBoot_loopback_read): Add missing bit shift to `size'. 2007-12-21 Bean @@ -47270,29 +47270,29 @@ (ntfscomp_mod_CFLAGS): Likewise. (ntfscomp_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ntfscomp.c. - (grub_probe_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/ntfscomp.c. + (VasEBoot_probe_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-efi.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c. - (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_probe_SOURCES): Add fs/ntfscomp.c. + (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-linuxbios.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c. - (grub_emu_SOURCES): Likewise. + * conf/i386-linuxbios.rmk (VasEBoot_probe_SOURCES): Add fs/ntfscomp.c. + (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c. - (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_probe_SOURCES): Add fs/ntfscomp.c. + (VasEBoot_emu_SOURCES): Likewise. - * fs/ntfs.c (grub_ntfscomp_func): New variable. - (read_run_list): Renamed to grub_ntfs_read_run_list. + * fs/ntfs.c (VasEBoot_ntfscomp_func): New variable. + (read_run_list): Renamed to VasEBoot_ntfs_read_run_list. (decomp_nextvcn): Moved to ntfscomp.c. (decomp_getch): Likewise. (decomp_get16): Likewise. (decomp_block): Likewise. (read_block): Likewise. (read_data): Partially moved to ntfscomp.c. - (fixup): Change unsigned to grub_uint16_t. - (read_mft): Change unsigned long to grub_uint32_t. + (fixup): Change unsigned to VasEBoot_uint16_t. + (read_mft): Change unsigned long to VasEBoot_uint32_t. (read_attr): Likewise. (read_data): Likewise. (read_run_data): Likewise. @@ -47301,11 +47301,11 @@ * fs/ntfscomp.c: New file. - * include/grub/ntfs.h: New file. + * include/VasEBoot/ntfs.h: New file. 2007-12-16 Robert Millan - * util/grub-mkdevicemap.c (make_device_map): Iterate up to 20 for + * util/VasEBoot-mkdevicemap.c (make_device_map): Iterate up to 20 for IDE disk check, since Linux is known to support 20 IDE disks. Reported by Colin Watson. @@ -47324,39 +47324,39 @@ linker. If yes, add it to TARGET_LDFLAGS. Build ID causes objcopy to generate incorrect binary files (binutils 2.17.50.0.18-1 as shipped by Fedora 8). - * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when + * aclocal.m4 (VasEBoot_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when linking, so that build ID doesn't break the test. 2007-11-24 Pavel Roskin - * include/grub/i386/time.h: use "void" in the argument list - of grub_cpu_idle(). - * include/grub/powerpc/time.h: Likewise. - * include/grub/sparc64/time.h: Likewise. + * include/VasEBoot/i386/time.h: use "void" in the argument list + of VasEBoot_cpu_idle(). + * include/VasEBoot/powerpc/time.h: Likewise. + * include/VasEBoot/sparc64/time.h: Likewise. 2007-11-18 Christian Franke - * util/console.c (grub_ncurses_getkey): Change curses KEY_* mapping, - now return control chars instead of GRUB_CONSOLE_KEY_* constants. - This fixes the problem that function keys did not work in grub-emu. + * util/console.c (VasEBoot_ncurses_getkey): Change curses KEY_* mapping, + now return control chars instead of VasEBoot_CONSOLE_KEY_* constants. + This fixes the problem that function keys did not work in VasEBoot-emu. 2007-11-18 Christian Franke - * disk/host.c (grub_host_open): Remove attribute unused from + * disk/host.c (VasEBoot_host_open): Remove attribute unused from name parameter. Add check for "host". This fixes the problem - that grub-emu does not find partitions. + that VasEBoot-emu does not find partitions. 2007-11-18 Christian Franke * util/hostfs.c (is_dir): New function. - (grub_hostfs_dir): Handle missing dirent.d_type case. - (grub_hostfs_read): Add missing fseek(). - (grub_hostfs_label): Clear label pointer. This fixes a crash - of grub-emu on "ls (host)". + (VasEBoot_hostfs_dir): Handle missing dirent.d_type case. + (VasEBoot_hostfs_read): Add missing fseek(). + (VasEBoot_hostfs_label): Clear label pointer. This fixes a crash + of VasEBoot-emu on "ls (host)". 2007-11-18 Christian Franke - * include/grub/i386/pc/init.h (struct grub_machine_mmap_entry): + * include/VasEBoot/i386/pc/init.h (struct VasEBoot_machine_mmap_entry): Add attribute packed, gcc 3.4.4 on Cygwin aligns this to 64 bit boundary by default. @@ -47367,38 +47367,38 @@ (hexdump_mod_CFLAGS): Likewise. (hexdump_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add command/hexdump.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add command/hexdump.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Add command/hexdump.c. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Add command/hexdump.c. - * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Add command/hexdump.c. + * conf/i386-linuxbios.rmk (VasEBoot_emu_SOURCES): Add command/hexdump.c. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add command/hexdump.c. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add command/hexdump.c. - * include/grub/hexdump.h: New file. + * include/VasEBoot/hexdump.h: New file. * commands/hexdump.c: New file. 2007-11-10 Robert Millan * commands/i386/pc/play.c (beep_off): Switch order of arguments - in grub_outb() calls. + in VasEBoot_outb() calls. (beep_on): Likewise. 2007-11-10 Christian Franke * normal/menu.c (run_menu): Check for empty menu to avoid crash. - (grub_menu_run): Likewise. + (VasEBoot_menu_run): Likewise. 2007-11-10 Robert Millan - * include/grub/i386/efi/machine.h: New file. - * include/grub/i386/linuxbios/machine.h: Likewise. - * include/grub/i386/pc/machine.h: Likewise. - * include/grub/powerpc/ieee1275/machine.h: Likewise. - * include/grub/sparc64/ieee1275/machine.h: Likewise. + * include/VasEBoot/i386/efi/machine.h: New file. + * include/VasEBoot/i386/linuxbios/machine.h: Likewise. + * include/VasEBoot/i386/pc/machine.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/machine.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/machine.h: Likewise. - * term/i386/pc/serial.c: Include . + * term/i386/pc/serial.c: Include . (serial_hw_io_addr): New variable. (serial_hw_get_port): Obtain port address from `serial_hw_io_addr' instead of `(unsigned short *) 0x400'. @@ -47415,17 +47415,17 @@ (vga_mod_LDFLAGS): Likewise. * term/i386/pc/vga.c (get_map_mask): Switch order of arguments in - grub_outb() calls. + VasEBoot_outb() calls. (set_map_mask): Likewise. (set_read_map): Likewise. (set_read_address): Likewise. (vga_font): Removed variable. (get_vga_glyph): Removed function. (invalidate_char): Likewise. - (write_char): Changed to use grub_font_get_glyph() for font + (write_char): Changed to use VasEBoot_font_get_glyph() for font information. - (grub_vga_putchar): Likewise. - (grub_vga_getcharwidth): Likewise. + (VasEBoot_vga_putchar): Likewise. + (VasEBoot_vga_getcharwidth): Likewise. 2007-11-10 Vesa Jaaskelainen @@ -47438,32 +47438,32 @@ 2007-11-06 Robert Millan * term/i386/pc/serial.c (serial_hw_put): Switch order of arguments - in grub_outb() calls. + in VasEBoot_outb() calls. (serial_hw_init): Likewise. 2007-11-05 Robert Millan - * util/update-grub.in: Allow files in ${update_grub_dir} to contain + * util/update-VasEBoot.in: Allow files in ${update_VasEBoot_dir} to contain spaces. Skip non-regular files. 2007-11-05 Robert Millan - * kern/disk.c (grub_disk_firmware_fini) - (grub_disk_firmware_is_tainted): New variables. + * kern/disk.c (VasEBoot_disk_firmware_fini) + (VasEBoot_disk_firmware_is_tainted): New variables. - * include/grub/disk.h (grub_disk_firmware_fini) - (grub_disk_firmware_is_tainted): Likewise. + * include/VasEBoot/disk.h (VasEBoot_disk_firmware_fini) + (VasEBoot_disk_firmware_is_tainted): Likewise. - * disk/i386/pc/biosdisk.c (GRUB_MOD_FINI(biosdisk)): Moved from here ... - (grub_disk_biosdisk_fini): ... to here. - (GRUB_MOD_FINI(biosdisk)): Implement using grub_disk_biosdisk_fini(). - (GRUB_MOD_INIT(biosdisk)): Abort when `grub_disk_firmware_is_tainted' - is set. Register grub_disk_biosdisk_fini() in - `grub_disk_firmware_fini'. + * disk/i386/pc/biosdisk.c (VasEBoot_MOD_FINI(biosdisk)): Moved from here ... + (VasEBoot_disk_biosdisk_fini): ... to here. + (VasEBoot_MOD_FINI(biosdisk)): Implement using VasEBoot_disk_biosdisk_fini(). + (VasEBoot_MOD_INIT(biosdisk)): Abort when `VasEBoot_disk_firmware_is_tainted' + is set. Register VasEBoot_disk_biosdisk_fini() in + `VasEBoot_disk_firmware_fini'. - * disk/ata.c: Remove `'. - (GRUB_MOD_INIT(ata)): Remove grub_biosdisk_fini() call. - Use `grub_disk_firmware_is_tainted' and `grub_disk_firmware_fini' + * disk/ata.c: Remove `'. + (VasEBoot_MOD_INIT(ata)): Remove VasEBoot_biosdisk_fini() call. + Use `VasEBoot_disk_firmware_is_tainted' and `VasEBoot_disk_firmware_fini' to finish existing firmware disk interface. * conf/i386-linuxbios.rmk (pkgdata_MODULES): Add `ata.mod'. @@ -47473,49 +47473,49 @@ 2007-11-05 Robert Millan - * disk/ata.c: Remove `'. Include `'. - (grub_ata_wait): Reimplement using grub_millisleep(). + * disk/ata.c: Remove `'. Include `'. + (VasEBoot_ata_wait): Reimplement using VasEBoot_millisleep(). - * include/grub/misc.h (grub_div_roundup): Fix parenthesization. - * include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction. + * include/VasEBoot/misc.h (VasEBoot_div_roundup): Fix parenthesization. + * include/VasEBoot/i386/time.h (VasEBoot_cpu_idle): Disable `hlt' instruction. 2007-11-03 Marco Gerards - * term/i386/pc/vga_text.c: Include . + * term/i386/pc/vga_text.c: Include . (CRTC_ADDR_PORT): New macro. (CRTC_DATA_PORT): Likewise. (CRTC_CURSOR): Likewise. (CRTC_CURSOR_ADDR_HIGH): Likewise. (CRTC_CURSOR_ADDR_LOW): Likewise. (update_cursor): New function. - (grub_console_real_putchar): Call `update_cursor'. - (grub_console_gotoxy): Likewise. - (grub_console_cls): Set the default color when clearing the + (VasEBoot_console_real_putchar): Call `update_cursor'. + (VasEBoot_console_gotoxy): Likewise. + (VasEBoot_console_cls): Set the default color when clearing the screen. - (grub_console_setcursor): Implemented. + (VasEBoot_console_setcursor): Implemented. 2007-11-03 Marco Gerards - * disk/ata.c (grub_ata_pio_read): Don't wait for the command to + * disk/ata.c (VasEBoot_ata_pio_read): Don't wait for the command to become activate. - (grub_ata_pio_write): Likewise. + (VasEBoot_ata_pio_write): Likewise. - (grub_atapi_identify): Wait after issuing an ATA command. - (grub_atapi_packet): Likewise. - (grub_ata_identify): Likewise. - (grub_ata_readwrite): Likewise. + (VasEBoot_atapi_identify): Wait after issuing an ATA command. + (VasEBoot_atapi_packet): Likewise. + (VasEBoot_ata_identify): Likewise. + (VasEBoot_ata_readwrite): Likewise. 2007-11-03 Marco Gerards - * disk/ata.c (grub_ata_pio_read): Detect and return the error code. - (grub_ata_pio_write): Likewise. - (grub_ata_readwrite): Use `grub_error', instead of - returning `grub_errno'. + * disk/ata.c (VasEBoot_ata_pio_read): Detect and return the error code. + (VasEBoot_ata_pio_write): Likewise. + (VasEBoot_ata_readwrite): Use `VasEBoot_error', instead of + returning `VasEBoot_errno'. 2007-11-03 Marco Gerards - * disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and - grub_ata_pio_write once for every single sector, instead of for + * disk/ata.c (VasEBoot_ata_readwrite): Call VasEBoot_ata_pio_read and + VasEBoot_ata_pio_write once for every single sector, instead of for multiple sectors. 2007-10-31 Robert Millan @@ -47528,14 +47528,14 @@ * term/i386/pc/at_keyboard.c: Likewise. * term/i386/pc/vga_text.c: Likewise. - * include/grub/i386/linuxbios/boot.h: Likewise. - * include/grub/i386/linuxbios/console.h: Likewise. - * include/grub/i386/linuxbios/init.h: Likewise. - * include/grub/i386/linuxbios/kernel.h: Likewise. - * include/grub/i386/linuxbios/loader.h: Likewise. - * include/grub/i386/linuxbios/memory.h: Likewise. - * include/grub/i386/linuxbios/serial.h: Likewise. - * include/grub/i386/linuxbios/time.h: Likewise. + * include/VasEBoot/i386/linuxbios/boot.h: Likewise. + * include/VasEBoot/i386/linuxbios/console.h: Likewise. + * include/VasEBoot/i386/linuxbios/init.h: Likewise. + * include/VasEBoot/i386/linuxbios/kernel.h: Likewise. + * include/VasEBoot/i386/linuxbios/loader.h: Likewise. + * include/VasEBoot/i386/linuxbios/memory.h: Likewise. + * include/VasEBoot/i386/linuxbios/serial.h: Likewise. + * include/VasEBoot/i386/linuxbios/time.h: Likewise. * kern/i386/linuxbios/init.c: Likewise. * kern/i386/linuxbios/startup.S: Likewise. @@ -47550,25 +47550,25 @@ * disk/ata.c: New file. - * include/grub/disk.h (grub_disk_dev_id): Add - `GRUB_DISK_DEV_ATA_ID'. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add + `VasEBoot_DISK_DEV_ATA_ID'. 2007-10-31 Robert Millan - * include/grub/i386/pc/init.h (grub_lower_mem): Moved from here ... - * include/grub/i386/pc/memory.h (grub_lower_mem): ... to here. + * include/VasEBoot/i386/pc/init.h (VasEBoot_lower_mem): Moved from here ... + * include/VasEBoot/i386/pc/memory.h (VasEBoot_lower_mem): ... to here. - * include/grub/i386/pc/init.h (grub_upper_mem): Moved from here ... - * include/grub/i386/pc/memory.h (grub_upper_mem): ... to here. + * include/VasEBoot/i386/pc/init.h (VasEBoot_upper_mem): Moved from here ... + * include/VasEBoot/i386/pc/memory.h (VasEBoot_upper_mem): ... to here. - * include/grub/i386/pc/memory.h: Include `' and - `'. + * include/VasEBoot/i386/pc/memory.h: Include `' and + `'. - * loader/i386/pc/multiboot.c: Include `'. + * loader/i386/pc/multiboot.c: Include `'. 2007-10-27 Robert Millan - * include/grub/types.h (ULONG_MAX): Define macro. + * include/VasEBoot/types.h (ULONG_MAX): Define macro. 2007-10-22 Robert Millan @@ -47583,50 +47583,50 @@ (biosdisk_mod_SOURCES, biosdisk_mod_CFLAGS, biosdisk_mod_LDFLAGS): New variables. - * disk/i386/pc/biosdisk.c: Include `'. - (grub_biosdisk_init): Replace with ... - (GRUB_MOD_INIT(biosdisk)): ... this. - (grub_biosdisk_fini): Replace with ... - (GRUB_MOD_FINI(biosdisk)): ... this. + * disk/i386/pc/biosdisk.c: Include `'. + (VasEBoot_biosdisk_init): Replace with ... + (VasEBoot_MOD_INIT(biosdisk)): ... this. + (VasEBoot_biosdisk_fini): Replace with ... + (VasEBoot_MOD_FINI(biosdisk)): ... this. - * kern/i386/pc/init.c: Remove `'. - (grub_machine_init): Remove call to grub_biosdisk_init(). - (grub_machine_fini): Remove call to grub_machine_fini(). + * kern/i386/pc/init.c: Remove `'. + (VasEBoot_machine_init): Remove call to VasEBoot_biosdisk_init(). + (VasEBoot_machine_fini): Remove call to VasEBoot_machine_fini(). - * util/i386/pc/grub-install.in (modules): Add `biosdisk'. + * util/i386/pc/VasEBoot-install.in (modules): Add `biosdisk'. 2007-10-22 Robert Millan - * include/grub/time.h: New file. - * include/grub/i386/time.h: Likewise. - * include/grub/powerpc/time.h: Likewise. - * include/grub/sparc64/time.h: Likewise. + * include/VasEBoot/time.h: New file. + * include/VasEBoot/i386/time.h: Likewise. + * include/VasEBoot/powerpc/time.h: Likewise. + * include/VasEBoot/sparc64/time.h: Likewise. - * include/grub/i386/pc/time.h (KERNEL_TIME_HEADER): Rename all + * include/VasEBoot/i386/pc/time.h (KERNEL_TIME_HEADER): Rename all instances to ... (KERNEL_MACHINE_TIME_HEADER): ... this. - * include/grub/powerpc/ieee1275/time.h (KERNEL_TIME_HEADER): Rename all + * include/VasEBoot/powerpc/ieee1275/time.h (KERNEL_TIME_HEADER): Rename all instances to ... (KERNEL_MACHINE_TIME_HEADER): ... this. - * include/grub/sparc64/ieee1275/time.h (KERNEL_TIME_HEADER): Rename all + * include/VasEBoot/sparc64/ieee1275/time.h (KERNEL_TIME_HEADER): Rename all instances to ... (KERNEL_MACHINE_TIME_HEADER): ... this. - * kern/i386/efi/init.c: Include `'. - (grub_millisleep): New function. - * kern/i386/pc/init.c: Include `'. - (grub_millisleep): New function. - * kern/powerpc/ieee1275/init.c: Include `'. - Remove `grub/machine/time.h' include. - (grub_millisleep): New function. - * kern/sparc64/ieee1275/init.c: Include `'. - Remove `grub/machine/time.h' include. - (grub_millisleep): New function. + * kern/i386/efi/init.c: Include `'. + (VasEBoot_millisleep): New function. + * kern/i386/pc/init.c: Include `'. + (VasEBoot_millisleep): New function. + * kern/powerpc/ieee1275/init.c: Include `'. + Remove `VasEBoot/machine/time.h' include. + (VasEBoot_millisleep): New function. + * kern/sparc64/ieee1275/init.c: Include `'. + Remove `VasEBoot/machine/time.h' include. + (VasEBoot_millisleep): New function. - * include/grub/misc.h (grub_div_roundup): New function. + * include/VasEBoot/misc.h (VasEBoot_div_roundup): New function. - * kern/misc.c: Include `'. - (grub_millisleep_generic): New function. + * kern/misc.c: Include `'. + (VasEBoot_millisleep_generic): New function. * conf/i386-efi.rmk (kernel_mod_HEADERS): Remove `i386/efi/time.h'. Add `time.h'. @@ -47638,38 +47638,38 @@ 2007-10-21 Robert Millan - * include/grub/misc.h (grub_max): New function. + * include/VasEBoot/misc.h (VasEBoot_max): New function. 2007-10-21 Robert Millan - * util/misc.c (grub_util_info): Call fflush() before returning. + * util/misc.c (VasEBoot_util_info): Call fflush() before returning. 2007-10-20 Robert Millan * genmk.rb (Image): Copy `extra_flags' from here ... (PModule): ... to here. Use it in `#{obj}: #{src}' rule. - * commands/i386/cpuid.c (grub_cmd_cpuid): Add __attribute__ ((unused)) + * commands/i386/cpuid.c (VasEBoot_cmd_cpuid): Add __attribute__ ((unused)) to `argc' and `args' arguments. 2007-10-17 Robert Millan * kern/i386/loader.S: New file. - * kern/i386/pc/startup.S (grub_linux_prot_size): Moved from here ... - * kern/i386/loader.S (grub_linux_prot_size)... to here. - * kern/i386/pc/startup.S (grub_linux_tmp_addr): Moved from here ... - * kern/i386/loader.S (grub_linux_tmp_addr)... to here. - * kern/i386/pc/startup.S (grub_linux_real_addr): Moved from here ... - * kern/i386/loader.S (grub_linux_real_addr)... to here. - * kern/i386/pc/startup.S (grub_linux_boot_zimage): Moved from here ... - * kern/i386/loader.S (grub_linux_boot_zimage)... to here. - * kern/i386/pc/startup.S (grub_linux_boot_bzimage): Moved from here ... - * kern/i386/loader.S (grub_linux_boot_bzimage)... to here. - * kern/i386/pc/startup.S (grub_multiboot_real_boot): Moved from here ... - * kern/i386/loader.S (grub_multiboot_real_boot)... to here. - * kern/i386/pc/startup.S (grub_multiboot2_real_boot): Moved from here ... - * kern/i386/loader.S (grub_multiboot2_real_boot)... to here. + * kern/i386/pc/startup.S (VasEBoot_linux_prot_size): Moved from here ... + * kern/i386/loader.S (VasEBoot_linux_prot_size)... to here. + * kern/i386/pc/startup.S (VasEBoot_linux_tmp_addr): Moved from here ... + * kern/i386/loader.S (VasEBoot_linux_tmp_addr)... to here. + * kern/i386/pc/startup.S (VasEBoot_linux_real_addr): Moved from here ... + * kern/i386/loader.S (VasEBoot_linux_real_addr)... to here. + * kern/i386/pc/startup.S (VasEBoot_linux_boot_zimage): Moved from here ... + * kern/i386/loader.S (VasEBoot_linux_boot_zimage)... to here. + * kern/i386/pc/startup.S (VasEBoot_linux_boot_bzimage): Moved from here ... + * kern/i386/loader.S (VasEBoot_linux_boot_bzimage)... to here. + * kern/i386/pc/startup.S (VasEBoot_multiboot_real_boot): Moved from here ... + * kern/i386/loader.S (VasEBoot_multiboot_real_boot)... to here. + * kern/i386/pc/startup.S (VasEBoot_multiboot2_real_boot): Moved from here ... + * kern/i386/loader.S (VasEBoot_multiboot2_real_boot)... to here. * kern/i386/realmode.S: New file. @@ -47685,24 +47685,24 @@ 2007-10-17 Robert Millan - * include/grub/i386/loader.h: New file. + * include/VasEBoot/i386/loader.h: New file. - * include/grub/i386/pc/loader.h (grub_linux_prot_size) - (grub_linux_tmp_addr, grub_linux_real_addr, grub_os_area_addr) - (grub_os_area_size, grub_linux_boot_zimage, grub_linux_boot_bzimage) - (grub_multiboot_real_boot, grub_multiboot2_real_boot) - (grub_rescue_cmd_linux, grub_rescue_cmd_initrd): Moved from here ... - * include/grub/i386/loader.h (grub_linux_prot_size) - (grub_linux_tmp_addr, grub_linux_real_addr, grub_os_area_addr) - (grub_os_area_size, grub_linux_boot_zimage, grub_linux_boot_bzimage) - (grub_multiboot_real_boot, grub_multiboot2_real_boot) - (grub_rescue_cmd_linux, grub_rescue_cmd_initrd): ... to here. + * include/VasEBoot/i386/pc/loader.h (VasEBoot_linux_prot_size) + (VasEBoot_linux_tmp_addr, VasEBoot_linux_real_addr, VasEBoot_os_area_addr) + (VasEBoot_os_area_size, VasEBoot_linux_boot_zimage, VasEBoot_linux_boot_bzimage) + (VasEBoot_multiboot_real_boot, VasEBoot_multiboot2_real_boot) + (VasEBoot_rescue_cmd_linux, VasEBoot_rescue_cmd_initrd): Moved from here ... + * include/VasEBoot/i386/loader.h (VasEBoot_linux_prot_size) + (VasEBoot_linux_tmp_addr, VasEBoot_linux_real_addr, VasEBoot_os_area_addr) + (VasEBoot_os_area_size, VasEBoot_linux_boot_zimage, VasEBoot_linux_boot_bzimage) + (VasEBoot_multiboot_real_boot, VasEBoot_multiboot2_real_boot) + (VasEBoot_rescue_cmd_linux, VasEBoot_rescue_cmd_initrd): ... to here. - * include/grub/i386/pc/loader.h: Include `grub/cpu/loader.h'. + * include/VasEBoot/i386/pc/loader.h: Include `VasEBoot/cpu/loader.h'. 2007-10-15 Robert Millan - * normal/misc.c (grub_normal_print_device_info): Do not probe for + * normal/misc.c (VasEBoot_normal_print_device_info): Do not probe for filesystem when dev->disk is unset. Do probe for filesystem even when dev->disk->has_partitions is set. In case a filesystem is found, always report it. @@ -47712,75 +47712,75 @@ 2007-10-12 Robert Millan - * conf/powerpc-ieee1275.rmk (grub_mkimage_SOURCES): Replace reference - to util/powerpc/ieee1275/grub-mkimage.c with util/elf/grub-mkimage.c. + * conf/powerpc-ieee1275.rmk (VasEBoot_mkimage_SOURCES): Replace reference + to util/powerpc/ieee1275/VasEBoot-mkimage.c with util/elf/VasEBoot-mkimage.c. - * include/grub/types.h (grub_host_to_target16): New macro. - (grub_host_to_target32): Likewise. - (grub_host_to_target64): Likewise. - (grub_target_to_host16): Likewise. - (grub_target_to_host32): Likewise. - (grub_target_to_host64): Likewise. + * include/VasEBoot/types.h (VasEBoot_host_to_target16): New macro. + (VasEBoot_host_to_target32): Likewise. + (VasEBoot_host_to_target64): Likewise. + (VasEBoot_target_to_host16): Likewise. + (VasEBoot_target_to_host32): Likewise. + (VasEBoot_target_to_host64): Likewise. - * include/grub/powerpc/ieee1275/kernel.h (GRUB_IEEE1275_MOD_ALIGN): + * include/VasEBoot/powerpc/ieee1275/kernel.h (VasEBoot_IEEE1275_MOD_ALIGN): Renamed from to ... - (GRUB_MOD_ALIGN): ...this. Update all users. + (VasEBoot_MOD_ALIGN): ...this. Update all users. - * util/elf/grub-mkimage.c (load_note): Replace grub_cpu_to_be32 with - grub_host_to_target32. - Replace grub_be_to_cpu32 with grub_target_to_host32. + * util/elf/VasEBoot-mkimage.c (load_note): Replace VasEBoot_cpu_to_be32 with + VasEBoot_host_to_target32. + Replace VasEBoot_be_to_cpu32 with VasEBoot_target_to_host32. (load_modules): Likewise. - (add_segments): Replace grub_be_to_cpu16 with grub_target_to_host16. - Replace grub_be_to_cpu32 with grub_target_to_host32. - Replace grub_cpu_to_be16 with grub_host_to_target16. - Replace grub_cpu_to_be32 grub_host_to_target32. + (add_segments): Replace VasEBoot_be_to_cpu16 with VasEBoot_target_to_host16. + Replace VasEBoot_be_to_cpu32 with VasEBoot_target_to_host32. + Replace VasEBoot_cpu_to_be16 with VasEBoot_host_to_target16. + Replace VasEBoot_cpu_to_be32 VasEBoot_host_to_target32. 2007-10-12 Robert Millan - * util/powerpc/ieee1275/grub-mkimage.c: Moved to ... - * util/elf/grub-mkimage.c: ... here. + * util/powerpc/ieee1275/VasEBoot-mkimage.c: Moved to ... + * util/elf/VasEBoot-mkimage.c: ... here. - * DISTLIST: Add `util/elf/grub-mkimage.c'. Remove - `util/powerpc/ieee1275/grub-mkimage.c'. + * DISTLIST: Add `util/elf/VasEBoot-mkimage.c'. Remove + `util/powerpc/ieee1275/VasEBoot-mkimage.c'. 2007-10-07 Robert Millan * kern/powerpc/ieee1275/init.c: Rename HEAP_LIMIT to HEAP_MAX_ADDR, and make it easier to figure out. Add HEAP_MIN_SIZE and HEAP_MAX_ADDR definitions. - (grub_claim_heap): Use HEAP_MAX_ADDR rather than taking a parameter. + (VasEBoot_claim_heap): Use HEAP_MAX_ADDR rather than taking a parameter. Do not avoid claiming a region above HEAP_MAX_ADDR if that would leave us with less than HEAP_MIN_SIZE total heap. Avoid our total amount of heap to surpass HEAP_MAX_SIZE. 2007-10-03 Robert Millan - * include/grub/i386/io.h: New file. + * include/VasEBoot/i386/io.h: New file. * commands/i386/pc/play.c (inb): Removed. (outb): Removed. - Include grub/cpu/io.h. Replace inb() with grub_inb() and outb() - with grub_outb(). + Include VasEBoot/cpu/io.h. Replace inb() with VasEBoot_inb() and outb() + with VasEBoot_outb(). * term/i386/pc/serial.c (inb): Removed. (outb): Removed. - Include grub/cpu/io.h. Replace inb() with grub_inb() and outb() - with grub_outb(). + Include VasEBoot/cpu/io.h. Replace inb() with VasEBoot_inb() and outb() + with VasEBoot_outb(). * term/i386/pc/vga.c (inb): Removed. (outb): Removed. - Include grub/cpu/io.h. Replace inb() with grub_inb() and outb() - with grub_outb(). + Include VasEBoot/cpu/io.h. Replace inb() with VasEBoot_inb() and outb() + with VasEBoot_outb(). 2007-10-02 Robert Millan - * conf/i386-efi.rmk (grub_emu_SOURCES): Add util/hostfs.c. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Add util/hostfs.c. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. Reported by Marcin Kurek. 2007-09-07 Robert Millan - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_test_flag): Detect + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_test_flag): Detect SmartFirmware version updates (as released by Sven Luther), and avoid - setting GRUB_IEEE1275_FLAG_NO_PARTITION_0 or - GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS unless the running version is + setting VasEBoot_IEEE1275_FLAG_NO_PARTITION_0 or + VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS unless the running version is known broken. 2007-09-03 Yoshinori K. Okuji @@ -47791,8 +47791,8 @@ 2007-09-03 Yoshinori K. Okuji - * kern/rescue.c (grub_enter_rescue_mode): Free ARGS. - * normal/completion.c (grub_normal_do_completion): Likewise. + * kern/rescue.c (VasEBoot_enter_rescue_mode): Free ARGS. + * normal/completion.c (VasEBoot_normal_do_completion): Likewise. Reported by Hitoshi Ozeki. 2007-09-03 Yoshinori K. Okuji @@ -47801,42 +47801,42 @@ * loader/i386/pc/chainloader.c (boot_drive): New variable. (boot_part_addr): Likewise. - (grub_chainloader_boot): Simply call grub_chainloader_real_boot + (VasEBoot_chainloader_boot): Simply call VasEBoot_chainloader_real_boot with BOOT_DRIVE and BOOT_PART_ADDR. - (grub_chainloader_cmd): Set BOOT_DRIVE and BOOT_PART_ADDR. + (VasEBoot_chainloader_cmd): Set BOOT_DRIVE and BOOT_PART_ADDR. Reported by Hitoshi Ozeki . 2007-08-29 Robert Millan Patch from Simon Peter : * genmk.rb (Utility): Append $(#{src}_DEPENDENCIES) to #{obj} targets. - * conf/i386-pc.rmk: Replace grub-probe_DEPENDENCIES with - util/grub-probe.c_DEPENDENCIES. Replace grub-setup_DEPENDENCIES with - util/i386/pc/grub-setup.c_DEPENDENCIES. - * conf/i386-efi.rmk: Replace grub-probe_DEPENDENCIES with - util/grub-probe.c_DEPENDENCIES. + * conf/i386-pc.rmk: Replace VasEBoot-probe_DEPENDENCIES with + util/VasEBoot-probe.c_DEPENDENCIES. Replace VasEBoot-setup_DEPENDENCIES with + util/i386/pc/VasEBoot-setup.c_DEPENDENCIES. + * conf/i386-efi.rmk: Replace VasEBoot-probe_DEPENDENCIES with + util/VasEBoot-probe.c_DEPENDENCIES. * conf/powerpc-ieee1275.rmk: Likewise. 2007-08-28 Robert Millan - * util/i386/get_disk_name.c: New. Implement grub_util_get_disk_name() - to tell grub-mkdevicemap how to name devices. + * util/i386/get_disk_name.c: New. Implement VasEBoot_util_get_disk_name() + to tell VasEBoot-mkdevicemap how to name devices. * util/ieee1275/get_disk_name.c: Likewise (using "ofpathname -a" feature). - * conf/i386-efi.rmk (grub_mkdevicemap_SOURCES): Add + * conf/i386-efi.rmk (VasEBoot_mkdevicemap_SOURCES): Add util/i386/get_disk_name.c. - * conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_mkdevicemap_SOURCES): Add + * conf/i386-pc.rmk (VasEBoot_mkdevicemap_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_mkdevicemap_SOURCES): Add util/ieee1275/get_disk_name.c. - * include/grub/util/misc.h: grub_util_get_disk_name() declaration. + * include/VasEBoot/util/misc.h: VasEBoot_util_get_disk_name() declaration. * DISTLIST: Add util/i386/get_disk_name.c and util/ieee1275/get_disk_name.c. - * util/grub-mkdevicemap.c: Replace device naming logic with - grub_util_get_disk_name() calls. + * util/VasEBoot-mkdevicemap.c: Replace device naming logic with + VasEBoot_util_get_disk_name() calls. 2007-08-20 Robert Millan @@ -47845,24 +47845,24 @@ 2007-08-05 Robert Millan - * util/grub.d/10_linux.in (test_gt): Strip out vmlinu[xz]- prefix + * util/VasEBoot.d/10_linux.in (test_gt): Strip out vmlinu[xz]- prefix so that [xz] isn't taken into account when determining order. 2007-08-02 Marco Gerards * DISTLIST: Add `disk/host.c', `fs/ntfs.c', `include/multiboot.h', - `include/multiboot2.h', `include/grub/elfload.h', - `include/multiboot.h', `include/grub/multiboot.h', - `include/grub/multiboot_loader.h', `include/grub/multiboot2.h', - `include/grub/i386/pc/biosdisk.h', `include/grub/util/biosdisk.h', + `include/multiboot2.h', `include/VasEBoot/elfload.h', + `include/multiboot.h', `include/VasEBoot/multiboot.h', + `include/VasEBoot/multiboot_loader.h', `include/VasEBoot/multiboot2.h', + `include/VasEBoot/i386/pc/biosdisk.h', `include/VasEBoot/util/biosdisk.h', `kern/elf.c', `loader/multiboot_loader.c', `loader/multiboot_loader_normal.c', `loader/multiboot2.c', `loader/i386/pc/multiboot2.c', `loader/powerpc/ieee1275/multiboot2.c', `util/hostfs.c' and - `util/i386/pc/grub-mkrescue.in'. Remove - `include/grub/biosdisk.h', `include/grub/i386/pc/multiboot.h', - `include/grub/i386/pc/util/biosdisk.h' and - `include/grub/powerpc/ieee1275/multiboot.h'. + `util/i386/pc/VasEBoot-mkrescue.in'. Remove + `include/VasEBoot/biosdisk.h', `include/VasEBoot/i386/pc/multiboot.h', + `include/VasEBoot/i386/pc/util/biosdisk.h' and + `include/VasEBoot/powerpc/ieee1275/multiboot.h'. 2007-08-02 Bean @@ -47871,75 +47871,75 @@ (ntfs_mod_CFLAGS): Likewise. (ntfs_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ntfs.c. - (grub_probe_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/ntfs.c. + (VasEBoot_probe_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. - * conf/i386-efi.rmk (grub_probe_SOURCES): Add fs/ntfs.c. - (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_probe_SOURCES): Add fs/ntfs.c. + (VasEBoot_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add fs/ntfs.c. - (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_probe_SOURCES): Add fs/ntfs.c. + (VasEBoot_emu_SOURCES): Likewise. - * conf/misc.c (grub_utf16_to_utf8): Fix unicode conversion bug. + * conf/misc.c (VasEBoot_utf16_to_utf8): Fix unicode conversion bug. * fs/ntfs.c: New file. 2007-08-02 Bean - * disk.h (grub_disk): Use NESTED_FUNC_ATTR. + * disk.h (VasEBoot_disk): Use NESTED_FUNC_ATTR. - * file.h (grub_file): Likewise. + * file.h (VasEBoot_file): Likewise. - * fshelp.h (grub_fshelp_read_file): Likewise. + * fshelp.h (VasEBoot_fshelp_read_file): Likewise. - * util/i386/pc/grub-setup.c (setup): Likewise. + * util/i386/pc/VasEBoot-setup.c (setup): Likewise. (save_first_sector): Likewise. (save_blocklists): Likewise. - * fs/affs.c (grub_affs_read_file): Likewise. + * fs/affs.c (VasEBoot_affs_read_file): Likewise. - * fs/ext2.c (grub_ext2_read_file): Likewise. + * fs/ext2.c (VasEBoot_ext2_read_file): Likewise. - * fs/fat.c (grub_fat_read_data): Likewise. + * fs/fat.c (VasEBoot_fat_read_data): Likewise. - * fs/fshelp.c (grub_fshelp_read_file): Likewise. + * fs/fshelp.c (VasEBoot_fshelp_read_file): Likewise. - * fs/hfs.c (grub_hfs_read_file): Likewise. + * fs/hfs.c (VasEBoot_hfs_read_file): Likewise. - * fs/hfsplus.c (grub_hfsplus_read_file): Likewise. + * fs/hfsplus.c (VasEBoot_hfsplus_read_file): Likewise. - * fs/jfs.c (grub_jfs_read_file): Likewise. + * fs/jfs.c (VasEBoot_jfs_read_file): Likewise. - * fs/minix.c (grub_minix_read_file): Likewise. + * fs/minix.c (VasEBoot_minix_read_file): Likewise. - * fs/sfs.c (grub_sfs_read_file): Likewise. + * fs/sfs.c (VasEBoot_sfs_read_file): Likewise. - * fs/ufs.c (grub_ufs_read_file): Likewise. + * fs/ufs.c (VasEBoot_ufs_read_file): Likewise. - * fs/xfs.c (grub_xfs_read_file): Likewise. + * fs/xfs.c (VasEBoot_xfs_read_file): Likewise. * command/blocklist.c (read_blocklist): Likewise. (print_blocklist): Likewise. 2007-08-02 Marco Gerards - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/host.c' and + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `disk/host.c' and `util/hostfs.c'. * disk/host.c: New file. * util/hostfs.c: Likewise. - * fs/hfsplus.c (grub_hfsplus_mount): When reading out of disk, - return `GRUB_ERR_BAD_FS'. - * fs/sfs.c (grub_sfs_mount): Likewise. - * fs/xfs.c (grub_xfs_mount): Likewise. + * fs/hfsplus.c (VasEBoot_hfsplus_mount): When reading out of disk, + return `VasEBoot_ERR_BAD_FS'. + * fs/sfs.c (VasEBoot_sfs_mount): Likewise. + * fs/xfs.c (VasEBoot_xfs_mount): Likewise. - * include/grub/disk.h (enum grub_disk_dev_id): Add - `GRUB_DISK_DEVICE_HOST_ID'. + * include/VasEBoot/disk.h (enum VasEBoot_disk_dev_id): Add + `VasEBoot_DISK_DEVICE_HOST_ID'. - * util/grub-emu.c (main): Initialize and de-initialize hostfs. + * util/VasEBoot-emu.c (main): Initialize and de-initialize hostfs. 2007-07-24 Jerone Young @@ -47948,14 +47948,14 @@ * conf/powerpc-ieee1275.rmk: Likewise. * include/multiboot.h: Move multiboot definitions to one file. Rename - many definitions to not get grub specific. + many definitions to not get VasEBoot specific. * include/multiboot2.h: Create header with multiboot 2 definitions. - * include/grub/multiboot.h: Header for grub specific function + * include/VasEBoot/multiboot.h: Header for VasEBoot specific function prototypes and definitions. - * include/grub/multiboot2.h: Likewise. - * include/grub/multiboot_loader.h: Likewise. - * include/grub/i386/pc/multiboot.h: Removed. - * include/grub/powerpc/ieee1275/multiboot.h: Removed. + * include/VasEBoot/multiboot2.h: Likewise. + * include/VasEBoot/multiboot_loader.h: Likewise. + * include/VasEBoot/i386/pc/multiboot.h: Removed. + * include/VasEBoot/powerpc/ieee1275/multiboot.h: Removed. * loader/multiboot_loader.c: Created to act as a proxy for multiboot 1 and 2 to allow for one multiboot and module commands. @@ -47968,66 +47968,66 @@ ieee1275 specific multiboot2 code. * kern/i386/pc/startup.S: Change headers and definition names for - multiboot. Add function grub_multiboot2_real_boot for multiboot 2. + multiboot. Add function VasEBoot_multiboot2_real_boot for multiboot 2. 2007-07-22 Robert Millan * geninitheader.sh: Process file specified in first parameter rather - than hardcoding grub_modules_init.lst. + than hardcoding VasEBoot_modules_init.lst. * geninit.sh: Likewise. Also, construct header name dynamically rather - than hardcoding grub_modules_init.h. + than hardcoding VasEBoot_modules_init.h. - * conf/common.rmk: Rename grub_modules_init.[ch] files associated with - grub-emu to grub_emu_init.[ch]. Add rules to build analogous - grub_probe_init.[ch] and grub_setup_init.[ch]. + * conf/common.rmk: Rename VasEBoot_modules_init.[ch] files associated with + VasEBoot-emu to VasEBoot_emu_init.[ch]. Add rules to build analogous + VasEBoot_probe_init.[ch] and VasEBoot_setup_init.[ch]. - * conf/powerpc-ieee1275.rmk (grub_emu_DEPENDENCIES): Replace - grub_modules_init.h with grub_emu_init.h. - (grub_probe_DEPENDENCIES, grub_probe_SOURCES): Add new - grub_probe_init.[ch] files. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_DEPENDENCIES): Replace + VasEBoot_modules_init.h with VasEBoot_emu_init.h. + (VasEBoot_probe_DEPENDENCIES, VasEBoot_probe_SOURCES): Add new + VasEBoot_probe_init.[ch] files. * conf/i386-efi.rmk: Likewise. * conf/i386-pc.rmk: Likewise. - (grub_setup_DEPENDENCIES, grub_setup_SOURCES): Add new - grub_setup_init.[ch] files. + (VasEBoot_setup_DEPENDENCIES, VasEBoot_setup_SOURCES): Add new + VasEBoot_setup_init.[ch] files. - * util/grub-emu.c: Replace grub_modules_init.h with grub_emu_init.h. - * util/grub-probe.c: Include grub_probe_init.h. Use grub_init_all() + * util/VasEBoot-emu.c: Replace VasEBoot_modules_init.h with VasEBoot_emu_init.h. + * util/VasEBoot-probe.c: Include VasEBoot_probe_init.h. Use VasEBoot_init_all() to initialize modules rather than a list of hardcoded functions. - * util/i386/pc/grub-setup.c: Include grub_setup_init.h. Use - grub_init_all() to initialize modules rather than a list of hardcoded + * util/i386/pc/VasEBoot-setup.c: Include VasEBoot_setup_init.h. Use + VasEBoot_init_all() to initialize modules rather than a list of hardcoded functions. 2007-07-22 Robert Millan - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Set - GRUB_IEEE1275_FLAG_NO_PARTITION_0 flag when running on SmartFirmware. + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set + VasEBoot_IEEE1275_FLAG_NO_PARTITION_0 flag when running on SmartFirmware. 2007-07-22 Robert Millan - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): Add - GRUB_IEEE1275_FLAG_BROKEN_OUTPUT flag. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Set this + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_flag): Add + VasEBoot_IEEE1275_FLAG_BROKEN_OUTPUT flag. + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): Set this flag when running on SmartFirmware. - * term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid running - "output-device output" command when GRUB_IEEE1275_FLAG_BROKEN_OUTPUT + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_init): Avoid running + "output-device output" command when VasEBoot_IEEE1275_FLAG_BROKEN_OUTPUT was set. - * kern/powerpc/ieee1275/openfw.c (grub_ieee1275_encode_devname): - Increase partno when GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS flag is set, + * kern/powerpc/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): + Increase partno when VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS flag is set, rather than decreasing it. - * util/i386/pc/grub-setup.c (setup): When embedding is required, but + * util/i386/pc/VasEBoot-setup.c (setup): When embedding is required, but there's not enough space to do it, fail in the same way as when it can't be done because there are no partitions. - * util/powerpc/ieee1275/grub-install.in: Improve error message shown + * util/powerpc/ieee1275/VasEBoot-install.in: Improve error message shown when nvsetenv failed. 2007-07-22 Yoshinori K. Okuji - * conf/i386-pc.rmk (CLEANFILES): Removed for grub-mkrescue, + * conf/i386-pc.rmk (CLEANFILES): Removed for VasEBoot-mkrescue, because this rule is automatically generated. - (grub-mkrescue): Removed for the same reason as above. + (VasEBoot-mkrescue): Removed for the same reason as above. 2007-07-22 Yoshinori K. Okuji @@ -48087,99 +48087,99 @@ * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * hello/hello.c: Likewise. - * include/grub/acorn_filecore.h: Likewise. - * include/grub/arg.h: Likewise. - * include/grub/bitmap.h: Likewise. - * include/grub/boot.h: Likewise. - * include/grub/cache.h: Likewise. - * include/grub/device.h: Likewise. - * include/grub/disk.h: Likewise. - * include/grub/dl.h: Likewise. - * include/grub/elfload.h: Likewise. - * include/grub/env.h: Likewise. - * include/grub/err.h: Likewise. - * include/grub/file.h: Likewise. - * include/grub/font.h: Likewise. - * include/grub/fs.h: Likewise. - * include/grub/fshelp.h: Likewise. - * include/grub/gzio.h: Likewise. - * include/grub/hfs.h: Likewise. - * include/grub/kernel.h: Likewise. - * include/grub/loader.h: Likewise. - * include/grub/lvm.h: Likewise. - * include/grub/misc.h: Likewise. - * include/grub/mm.h: Likewise. - * include/grub/net.h: Likewise. - * include/grub/normal.h: Likewise. - * include/grub/parser.h: Likewise. - * include/grub/partition.h: Likewise. - * include/grub/pc_partition.h: Likewise. - * include/grub/raid.h: Likewise. - * include/grub/rescue.h: Likewise. - * include/grub/script.h: Likewise. - * include/grub/setjmp.h: Likewise. - * include/grub/symbol.h: Likewise. - * include/grub/term.h: Likewise. - * include/grub/terminfo.h: Likewise. - * include/grub/tparm.h: Likewise. - * include/grub/types.h: Likewise. - * include/grub/video.h: Likewise. - * include/grub/efi/api.h: Likewise. - * include/grub/efi/chainloader.h: Likewise. - * include/grub/efi/console.h: Likewise. - * include/grub/efi/console_control.h: Likewise. - * include/grub/efi/disk.h: Likewise. - * include/grub/efi/efi.h: Likewise. - * include/grub/efi/pe32.h: Likewise. - * include/grub/efi/time.h: Likewise. - * include/grub/i386/linux.h: Likewise. - * include/grub/i386/setjmp.h: Likewise. - * include/grub/i386/types.h: Likewise. - * include/grub/i386/efi/kernel.h: Likewise. - * include/grub/i386/efi/loader.h: Likewise. - * include/grub/i386/efi/time.h: Likewise. - * include/grub/i386/pc/biosdisk.h: Likewise. - * include/grub/i386/pc/boot.h: Likewise. - * include/grub/i386/pc/chainloader.h: Likewise. - * include/grub/i386/pc/console.h: Likewise. - * include/grub/i386/pc/init.h: Likewise. - * include/grub/i386/pc/kernel.h: Likewise. - * include/grub/i386/pc/loader.h: Likewise. - * include/grub/i386/pc/memory.h: Likewise. - * include/grub/i386/pc/multiboot.h: Likewise. - * include/grub/i386/pc/serial.h: Likewise. - * include/grub/i386/pc/time.h: Likewise. - * include/grub/i386/pc/vbe.h: Likewise. - * include/grub/i386/pc/vbeblit.h: Likewise. - * include/grub/i386/pc/vbefill.h: Likewise. - * include/grub/i386/pc/vbeutil.h: Likewise. - * include/grub/i386/pc/vga.h: Likewise. - * include/grub/ieee1275/ieee1275.h: Likewise. - * include/grub/ieee1275/ofdisk.h: Likewise. - * include/grub/powerpc/libgcc.h: Likewise. - * include/grub/powerpc/setjmp.h: Likewise. - * include/grub/powerpc/types.h: Likewise. - * include/grub/powerpc/ieee1275/biosdisk.h: Likewise. - * include/grub/powerpc/ieee1275/console.h: Likewise. - * include/grub/powerpc/ieee1275/ieee1275.h: Likewise. - * include/grub/powerpc/ieee1275/kernel.h: Likewise. - * include/grub/powerpc/ieee1275/loader.h: Likewise. - * include/grub/powerpc/ieee1275/multiboot.h: Likewise. - * include/grub/powerpc/ieee1275/time.h: Likewise. - * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise. - * include/grub/sparc64/libgcc.h: Likewise. - * include/grub/sparc64/setjmp.h: Likewise. - * include/grub/sparc64/types.h: Likewise. - * include/grub/sparc64/ieee1275/console.h: Likewise. - * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. - * include/grub/sparc64/ieee1275/kernel.h: Likewise. - * include/grub/sparc64/ieee1275/time.h: Likewise. - * include/grub/util/biosdisk.h: Likewise. - * include/grub/util/getroot.h: Likewise. - * include/grub/util/lvm.h: Likewise. - * include/grub/util/misc.h: Likewise. - * include/grub/util/raid.h: Likewise. - * include/grub/util/resolve.h: Likewise. + * include/VasEBoot/acorn_filecore.h: Likewise. + * include/VasEBoot/arg.h: Likewise. + * include/VasEBoot/bitmap.h: Likewise. + * include/VasEBoot/boot.h: Likewise. + * include/VasEBoot/cache.h: Likewise. + * include/VasEBoot/device.h: Likewise. + * include/VasEBoot/disk.h: Likewise. + * include/VasEBoot/dl.h: Likewise. + * include/VasEBoot/elfload.h: Likewise. + * include/VasEBoot/env.h: Likewise. + * include/VasEBoot/err.h: Likewise. + * include/VasEBoot/file.h: Likewise. + * include/VasEBoot/font.h: Likewise. + * include/VasEBoot/fs.h: Likewise. + * include/VasEBoot/fshelp.h: Likewise. + * include/VasEBoot/gzio.h: Likewise. + * include/VasEBoot/hfs.h: Likewise. + * include/VasEBoot/kernel.h: Likewise. + * include/VasEBoot/loader.h: Likewise. + * include/VasEBoot/lvm.h: Likewise. + * include/VasEBoot/misc.h: Likewise. + * include/VasEBoot/mm.h: Likewise. + * include/VasEBoot/net.h: Likewise. + * include/VasEBoot/normal.h: Likewise. + * include/VasEBoot/parser.h: Likewise. + * include/VasEBoot/partition.h: Likewise. + * include/VasEBoot/pc_partition.h: Likewise. + * include/VasEBoot/raid.h: Likewise. + * include/VasEBoot/rescue.h: Likewise. + * include/VasEBoot/script.h: Likewise. + * include/VasEBoot/setjmp.h: Likewise. + * include/VasEBoot/symbol.h: Likewise. + * include/VasEBoot/term.h: Likewise. + * include/VasEBoot/terminfo.h: Likewise. + * include/VasEBoot/tparm.h: Likewise. + * include/VasEBoot/types.h: Likewise. + * include/VasEBoot/video.h: Likewise. + * include/VasEBoot/efi/api.h: Likewise. + * include/VasEBoot/efi/chainloader.h: Likewise. + * include/VasEBoot/efi/console.h: Likewise. + * include/VasEBoot/efi/console_control.h: Likewise. + * include/VasEBoot/efi/disk.h: Likewise. + * include/VasEBoot/efi/efi.h: Likewise. + * include/VasEBoot/efi/pe32.h: Likewise. + * include/VasEBoot/efi/time.h: Likewise. + * include/VasEBoot/i386/linux.h: Likewise. + * include/VasEBoot/i386/setjmp.h: Likewise. + * include/VasEBoot/i386/types.h: Likewise. + * include/VasEBoot/i386/efi/kernel.h: Likewise. + * include/VasEBoot/i386/efi/loader.h: Likewise. + * include/VasEBoot/i386/efi/time.h: Likewise. + * include/VasEBoot/i386/pc/biosdisk.h: Likewise. + * include/VasEBoot/i386/pc/boot.h: Likewise. + * include/VasEBoot/i386/pc/chainloader.h: Likewise. + * include/VasEBoot/i386/pc/console.h: Likewise. + * include/VasEBoot/i386/pc/init.h: Likewise. + * include/VasEBoot/i386/pc/kernel.h: Likewise. + * include/VasEBoot/i386/pc/loader.h: Likewise. + * include/VasEBoot/i386/pc/memory.h: Likewise. + * include/VasEBoot/i386/pc/multiboot.h: Likewise. + * include/VasEBoot/i386/pc/serial.h: Likewise. + * include/VasEBoot/i386/pc/time.h: Likewise. + * include/VasEBoot/i386/pc/vbe.h: Likewise. + * include/VasEBoot/i386/pc/vbeblit.h: Likewise. + * include/VasEBoot/i386/pc/vbefill.h: Likewise. + * include/VasEBoot/i386/pc/vbeutil.h: Likewise. + * include/VasEBoot/i386/pc/vga.h: Likewise. + * include/VasEBoot/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/ieee1275/ofdisk.h: Likewise. + * include/VasEBoot/powerpc/libgcc.h: Likewise. + * include/VasEBoot/powerpc/setjmp.h: Likewise. + * include/VasEBoot/powerpc/types.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/biosdisk.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/console.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/kernel.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/loader.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/multiboot.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/time.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/util/biosdisk.h: Likewise. + * include/VasEBoot/sparc64/libgcc.h: Likewise. + * include/VasEBoot/sparc64/setjmp.h: Likewise. + * include/VasEBoot/sparc64/types.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/console.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/kernel.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/time.h: Likewise. + * include/VasEBoot/util/biosdisk.h: Likewise. + * include/VasEBoot/util/getroot.h: Likewise. + * include/VasEBoot/util/lvm.h: Likewise. + * include/VasEBoot/util/misc.h: Likewise. + * include/VasEBoot/util/raid.h: Likewise. + * include/VasEBoot/util/resolve.h: Likewise. * io/gzio.c: Likewise. * kern/device.c: Likewise. * kern/disk.c: Likewise. @@ -48263,27 +48263,27 @@ * util/console.c: Likewise. * util/genmoddep.c: Likewise. * util/getroot.c: Likewise. - * util/grub-emu.c: Likewise. - * util/grub-mkdevicemap.c: Likewise. - * util/grub-probe.c: Likewise. + * util/VasEBoot-emu.c: Likewise. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/VasEBoot-probe.c: Likewise. * util/lvm.c: Likewise. * util/misc.c: Likewise. * util/raid.c: Likewise. * util/resolve.c: Likewise. - * util/update-grub.in: Likewise. - * util/update-grub_lib.in: Likewise. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. - * util/i386/efi/grub-install.in: Likewise. - * util/i386/efi/grub-mkimage.c: Likewise. - * util/i386/pc/grub-install.in: Likewise. - * util/i386/pc/grub-mkimage.c: Likewise. - * util/i386/pc/grub-mkrescue.in: Likewise. - * util/i386/pc/grub-setup.c: Likewise. + * util/update-VasEBoot.in: Likewise. + * util/update-VasEBoot_lib.in: Likewise. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. + * util/i386/efi/VasEBoot-install.in: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-install.in: Likewise. + * util/i386/pc/VasEBoot-mkimage.c: Likewise. + * util/i386/pc/VasEBoot-mkrescue.in: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. * util/i386/pc/misc.c: Likewise. - * util/powerpc/ieee1275/grub-install.in: Likewise. - * util/powerpc/ieee1275/grub-mkimage.c: Likewise. + * util/powerpc/ieee1275/VasEBoot-install.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-mkimage.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. * video/bitmap.c: Likewise. * video/video.c: Likewise. @@ -48301,34 +48301,34 @@ * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. - * util/grub-emu.c (main): Fix unchecked pointer handling. + * util/VasEBoot-emu.c (main): Fix unchecked pointer handling. 2007-07-02 Robert Millan - * util/i386/efi/grub-install.in: Allow `grub_probe --target=partmap' + * util/i386/efi/VasEBoot-install.in: Allow `VasEBoot_probe --target=partmap' invocation to fail, in order to support partition-less media. - * util/i386/pc/grub-install.in: Likewise. + * util/i386/pc/VasEBoot-install.in: Likewise. - * util/powerpc/ieee1275/grub-install.in: Use grub-probe to determine + * util/powerpc/ieee1275/VasEBoot-install.in: Use VasEBoot-probe to determine which fs or partmap modules are needed (akin to its sister scripts). - Also use grub-probe to get rid of unportable /proc/mounts check. + Also use VasEBoot-probe to get rid of unportable /proc/mounts check. Print the same informational message that the other scripts do, before exiting. 2007-06-23 Robert Millan - * util/update-grub_lib.in (font_path): New function. Determine whether - a font file can be found and, if so, echo the GRUB path to it. + * util/update-VasEBoot_lib.in (font_path): New function. Determine whether + a font file can be found and, if so, echo the VasEBoot path to it. - * util/update-grub.in: Handle multiple terminals depending on user + * util/update-VasEBoot.in: Handle multiple terminals depending on user input, platform availability and font file presence. Propagate - variables of our findings to /etc/grub.d/ children. + variables of our findings to /etc/VasEBoot.d/ children. - * util/grub.d/00_header.in: Handle multiple terminals, based on - environment setup by update-grub. + * util/VasEBoot.d/00_header.in: Handle multiple terminals, based on + environment setup by update-VasEBoot. 2007-06-23 Robert Millan @@ -48336,137 +48336,137 @@ 2007-06-21 Robert Millan - * include/grub/i386/pc/kernel.h: Define GRUB_KERNEL_MACHINE_DATA_END to + * include/VasEBoot/i386/pc/kernel.h: Define VasEBoot_KERNEL_MACHINE_DATA_END to indicate end of data section in kernel image. - * include/grub/i386/efi/kernel.h: Define GRUB_KERNEL_MACHINE_PREFIX and - GRUB_KERNEL_MACHINE_DATA_END. + * include/VasEBoot/i386/efi/kernel.h: Define VasEBoot_KERNEL_MACHINE_PREFIX and + VasEBoot_KERNEL_MACHINE_DATA_END. - * kern/i386/pc/startup.S: Do not initialize grub_prefix, only reserve + * kern/i386/pc/startup.S: Do not initialize VasEBoot_prefix, only reserve space for it. * kern/i386/efi/startup.S: Likewise. - * util/i386/pc/grub-mkimage.c: Initialize grub_prefix to /boot/grub + * util/i386/pc/VasEBoot-mkimage.c: Initialize VasEBoot_prefix to /boot/VasEBoot during image generation. Implement --prefix option to override this patch. - * util/i386/efi/grub-mkimage.c: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. - * util/update-grub_lib.in (convert_system_path_to_grub_path): Split + * util/update-VasEBoot_lib.in (convert_system_path_to_VasEBoot_path): Split code to make path relative to its root into a separate function. - * util/i386/pc/grub-install.in: Use newly provided - make_system_path_relative_to_its_root() to convert ${grubdir}, then - pass the result to grub-install --prefix. + * util/i386/pc/VasEBoot-install.in: Use newly provided + make_system_path_relative_to_its_root() to convert ${VasEBootdir}, then + pass the result to VasEBoot-install --prefix. 2007-06-13 Robert Millan - * include/grub/util/misc.h: Define DEFAULT_DIRECTORY and + * include/VasEBoot/util/misc.h: Define DEFAULT_DIRECTORY and DEFAULT_DEVICE_MAP. - * util/grub-emu.c: Use above definitions from misc.h instead of + * util/VasEBoot-emu.c: Use above definitions from misc.h instead of defining them. - * util/grub-mkdevicemap.c: Likewise. - * util/i386/pc/grub-setup.c: Likewise. - * util/grub-probe.c: Likewise. - (probe): Abort with grub_util_error() when either - grub_guess_root_device or grub_util_get_grub_dev fails. + * util/VasEBoot-mkdevicemap.c: Likewise. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/VasEBoot-probe.c: Likewise. + (probe): Abort with VasEBoot_util_error() when either + VasEBoot_guess_root_device or VasEBoot_util_get_VasEBoot_dev fails. 2007-06-12 Robert Millan - * normal/command.c (grub_command_execute): Use NULL rather than 0 for + * normal/command.c (VasEBoot_command_execute): Use NULL rather than 0 for "pager" assignment. - * util/biosdisk.c (grub_util_biosdisk_get_grub_dev): Likewise for + * util/biosdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Likewise for "pcdata". - * util/grub-probe.c (probe): Likewise for "drive_name". + * util/VasEBoot-probe.c (probe): Likewise for "drive_name". 2007-06-11 Robert Millan - * util/i386/pc/grub-mkrescue.in: Pad both floppy images with zeroes, + * util/i386/pc/VasEBoot-mkrescue.in: Pad both floppy images with zeroes, not just the cdrom one. 2007-06-11 Robert Millan - * util/i386/pc/grub-mkrescue.in: Add "set -e". + * util/i386/pc/VasEBoot-mkrescue.in: Add "set -e". Add --pkglibdir=DIR option to override pkglibdir. Mention --image-type=TYPE in help output. - Fix --grub-mkimage (it was a no-op). + Fix --VasEBoot-mkimage (it was a no-op). Abort gracefully when no parameter is given. 2007-06-11 Robert Millan - * util/i386/pc/grub-mkrescue.in: New file. + * util/i386/pc/VasEBoot-mkrescue.in: New file. * conf/i386-pc.rmk: Add its build declarations. Put it in bin_SCRIPTS. * Makefile.in: Handle bin_SCRIPTS. 2007-06-10 Vesa Jaaskelainen - * term/gfxterm.c (grub_gfxterm_init): Added support for specifying + * term/gfxterm.c (VasEBoot_gfxterm_init): Added support for specifying list of video modes. 2007-06-06 Robert Millan - * util/update-grub_lib.in (convert_system_path_to_grub_path): Abort if - file doesn't exist, or if it is in a filesystem grub can't read. + * util/update-VasEBoot_lib.in (convert_system_path_to_VasEBoot_path): Abort if + file doesn't exist, or if it is in a filesystem VasEBoot can't read. - * util/update-grub.in: Set fallback for GRUB_FS check to "unknown". Do - not abort if GRUB_DRIVE could not be defined. Rearrange generated + * util/update-VasEBoot.in: Set fallback for VasEBoot_FS check to "unknown". Do + not abort if VasEBoot_DRIVE could not be defined. Rearrange generated header comment to fit in 80 columns when the variables are resolved. - * util/grub.d/00_header.in: Only set root variable when GRUB_DRIVE - could be identified by update-grub. Remove redundant check for - unifont.pff existence (since convert_system_path_to_grub_path now + * util/VasEBoot.d/00_header.in: Only set root variable when VasEBoot_DRIVE + could be identified by update-VasEBoot. Remove redundant check for + unifont.pff existence (since convert_system_path_to_VasEBoot_path now handles that). 2007-06-04 Robert Millan - * conf/i386-efi.rmk (grub_probe_SOURCES): Add partmap/apple.c. + * conf/i386-efi.rmk (VasEBoot_probe_SOURCES): Add partmap/apple.c. - * conf/i386-pc.rmk (grub_probe_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_probe_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add partmap/pc.c. + * conf/powerpc-ieee1275.rmk (VasEBoot_probe_SOURCES): Add partmap/pc.c. 2007-06-04 Robert Millan - * conf/powerpc-ieee1275.rmk: Enable grub-mkdevicemap and grub-probe. + * conf/powerpc-ieee1275.rmk: Enable VasEBoot-mkdevicemap and VasEBoot-probe. - * include/grub/partition.h: Declare grub_apple_partition_map_init and - grub_apple_partition_map_fini. + * include/VasEBoot/partition.h: Declare VasEBoot_apple_partition_map_init and + VasEBoot_apple_partition_map_fini. * util/biosdisk.c - (grub_util_biosdisk_open): Replace BLKGETSIZE with BLKGETSIZE64 (needed + (VasEBoot_util_biosdisk_open): Replace BLKGETSIZE with BLKGETSIZE64 (needed to access >2 TiB disks). Print disk->total_sectors with %llu instead of %lu, since this variable is always 64-bit (prevents wrong disk size from being displayed on either >2 TiB disk or big-endian CPU). - (grub_util_biosdisk_get_grub_dev): Convert gpt_partition_map handling + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Convert gpt_partition_map handling into a generic case that supports all (sane) partition maps. - Stop using grub_cpu_to_le32() on dos_part / bsd_part since it actually + Stop using VasEBoot_cpu_to_le32() on dos_part / bsd_part since it actually breaks big-endian. - * util/grub-probe.c: Call grub_apple_partition_map_init() before probe() - and grub_apple_partition_map_fini() after that. + * util/VasEBoot-probe.c: Call VasEBoot_apple_partition_map_init() before probe() + and VasEBoot_apple_partition_map_fini() after that. 2007-06-01 Robert Millan - * util/update-grub.in: Export GRUB_CMDLINE_LINUX. + * util/update-VasEBoot.in: Export VasEBoot_CMDLINE_LINUX. - * util/grub.d/00_header.in: Only enable gfxterm when - convert_system_path_to_grub_path() succeeds. + * util/VasEBoot.d/00_header.in: Only enable gfxterm when + convert_system_path_to_VasEBoot_path() succeeds. 2007-05-20 Robert Millan - * util/update-grub_lib.in: New file. - * DISTLIST: Add update-grub_lib.in. - * conf/common.rmk: Generate update-grub_lib and install it in + * util/update-VasEBoot_lib.in: New file. + * DISTLIST: Add update-VasEBoot_lib.in. + * conf/common.rmk: Generate update-VasEBoot_lib and install it in $(lib_DATA). * Makefile.in: Add install routine for $(lib_DATA). - * util/grub.d/00_header.in: Use convert_system_path_to_grub_path() - function provided by update-grub_lib to support arbitrary paths of + * util/VasEBoot.d/00_header.in: Use convert_system_path_to_VasEBoot_path() + function provided by update-VasEBoot_lib to support arbitrary paths of unifont.pff. - * util/update-grub.in: Use convert_system_path_to_grub_path() to - initialize GRUB_DRIVE_BOOT and GRUB_DRIVE_BOOT_GRUB variables. + * util/update-VasEBoot.in: Use convert_system_path_to_VasEBoot_path() to + initialize VasEBoot_DRIVE_BOOT and VasEBoot_DRIVE_BOOT_VasEBoot variables. 2007-05-19 Robert Millan @@ -48477,21 +48477,21 @@ 2007-05-18 Jeroen Dekkers - * kern/disk.c (grub_disk_read): Check return value of - grub_realloc(). + * kern/disk.c (VasEBoot_disk_read): Check return value of + VasEBoot_realloc(). 2007-05-18 Jeroen Dekkers - * util/getroot.c (grub_util_get_grub_dev): Support partitionable + * util/getroot.c (VasEBoot_util_get_VasEBoot_dev): Support partitionable arrays. - * disk/raid.c (grub_raid_open): Likewise. + * disk/raid.c (VasEBoot_raid_open): Likewise. 2007-05-17 Jeroen Dekkers * util/biosdisk.c (linux_find_partition): Allocate real_dev on the stack instead of on the heap. - * kern/disk.c (grub_disk_read): Make sure tmp_buf is big enough + * kern/disk.c (VasEBoot_disk_read): Make sure tmp_buf is big enough before doing a read on it. * configure.ac: Only use -fno-stack-protector for the target @@ -48499,107 +48499,107 @@ 2007-05-17 Jeroen Dekkers - * video/i386/pc/vbe.c (grub_video_vbe_create_render_target): Add + * video/i386/pc/vbe.c (VasEBoot_video_vbe_create_render_target): Add __attribute_ ((unused)) to mode_type argument. - * util/getroot.c (grub_guess_root_device): Fix #endif. + * util/getroot.c (VasEBoot_guess_root_device): Fix #endif. * kern/misc.c (memcmp): Fix prototype. - * include/grub/partition.h [GRUB_UTIL] - (grub_gpt_partition_map_init): Add prototype. - (grub_gpt_partition_map_fini): Likewise. + * include/VasEBoot/partition.h [VasEBoot_UTIL] + (VasEBoot_gpt_partition_map_init): Add prototype. + (VasEBoot_gpt_partition_map_fini): Likewise. - * fs/jfs.c (struct grub_jfs_inode): Put __attribute__ ((packed) + * fs/jfs.c (struct VasEBoot_jfs_inode): Put __attribute__ ((packed) at the right place. - * fs/fat.c (grub_fat_mount): Replace ~0UL with ~0U. - (grub_fat_read_data): Likewise. - (grub_fat_find_dir): Likewise. + * fs/fat.c (VasEBoot_fat_mount): Replace ~0UL with ~0U. + (VasEBoot_fat_read_data): Likewise. + (VasEBoot_fat_find_dir): Likewise. * font/manager.c (find_glyph): Make table a const. - (grub_font_get_glyph): Remove bitmap from if statement. + (VasEBoot_font_get_glyph): Remove bitmap from if statement. 2007-05-16 Jeroen Dekkers - * util/getroot.c (grub_guess_root_device): Remove RAID and LVM + * util/getroot.c (VasEBoot_guess_root_device): Remove RAID and LVM code, first search for device in /dev/mapper, then in /dev. - (grub_util_get_grub_dev): New function. - * include/grub/util/getroot.h (grub_util_get_grub_dev): Add + (VasEBoot_util_get_VasEBoot_dev): New function. + * include/VasEBoot/util/getroot.h (VasEBoot_util_get_VasEBoot_dev): Add prototype. - * util/grub-probe.c (probe): Remove check for RAID, call - grub_util_get_grub_dev() instead of - grub_util_biosdisk_get_grub_dev(). - * util/grub-emu.c (main): Call grub_util_get_grub_dev() instead of - grub_util_biosdisk_get_grub_dev(). - * util/i386/pc/grub-setup.c (main): Likewise. + * util/VasEBoot-probe.c (probe): Remove check for RAID, call + VasEBoot_util_get_VasEBoot_dev() instead of + VasEBoot_util_biosdisk_get_VasEBoot_dev(). + * util/VasEBoot-emu.c (main): Call VasEBoot_util_get_VasEBoot_dev() instead of + VasEBoot_util_biosdisk_get_VasEBoot_dev(). + * util/i386/pc/VasEBoot-setup.c (main): Likewise. 2007-05-16 Robert Millan * DISTLIST: Update for the latest changes. * conf/i386-pc.rmk: Use the new paths for util/getroot.c, - util/grub-mkdevicemap.c, util/grub-probe.c and util/biosdisk.c. - * util/grub-emu.c: Replace grub/i386/pc/util/biosdisk.h with - grub/util/biosdisk.h. - * util/i386/pc/grub-setup.c: Replace grub/machine/util/biosdisk.h with - grub/util/biosdisk.h. + util/VasEBoot-mkdevicemap.c, util/VasEBoot-probe.c and util/biosdisk.c. + * util/VasEBoot-emu.c: Replace VasEBoot/i386/pc/util/biosdisk.h with + VasEBoot/util/biosdisk.h. + * util/i386/pc/VasEBoot-setup.c: Replace VasEBoot/machine/util/biosdisk.h with + VasEBoot/util/biosdisk.h. 2007-05-16 Robert Millan - * util/grub.d/00_header.in: Set default gfxmode to `640x480'. + * util/VasEBoot.d/00_header.in: Set default gfxmode to `640x480'. 2007-05-16 Robert Millan - * util/i386/efi/grub-install.in: New. - * conf/i386-efi.rmk: Enable grub-mkdevicemap, grub-probe and the - newly added grub-install. - * util/biosdisk.c: Remove unnecessary grub/machine/biosdisk.h + * util/i386/efi/VasEBoot-install.in: New. + * conf/i386-efi.rmk: Enable VasEBoot-mkdevicemap, VasEBoot-probe and the + newly added VasEBoot-install. + * util/biosdisk.c: Remove unnecessary VasEBoot/machine/biosdisk.h include. - * util/getroot.c: Replace grub/i386/pc/util/biosdisk.h with - grub/util/biosdisk.h. - * util/grub-probe.c: Replace grub/machine/util/biosdisk.h with - grub/util/biosdisk.h. + * util/getroot.c: Replace VasEBoot/i386/pc/util/biosdisk.h with + VasEBoot/util/biosdisk.h. + * util/VasEBoot-probe.c: Replace VasEBoot/machine/util/biosdisk.h with + VasEBoot/util/biosdisk.h. 2007-05-16 Robert Millan - * include/grub/i386/pc/util/biosdisk.h: Moved to ... - * include/grub/util/biosdisk.h: ... here. + * include/VasEBoot/i386/pc/util/biosdisk.h: Moved to ... + * include/VasEBoot/util/biosdisk.h: ... here. * util/i386/pc/biosdisk.c: Moved to ... * util/biosdisk.c: ... here. * util/i386/pc/getroot.c: Moved to ... * util/getroot.c: ... here. - * util/i386/pc/grub-mkdevicemap.c: Moved to ... - * util/grub-mkdevicemap.c: ... here. - * util/i386/pc/grub-probe.c: Moved to ... - * util/grub-probe.c: ... here. + * util/i386/pc/VasEBoot-mkdevicemap.c: Moved to ... + * util/VasEBoot-mkdevicemap.c: ... here. + * util/i386/pc/VasEBoot-probe.c: Moved to ... + * util/VasEBoot-probe.c: ... here. 2007-05-15 Robert Millan - * util/update-grub.in: Remove duplicated line in grub.cfg header + * util/update-VasEBoot.in: Remove duplicated line in VasEBoot.cfg header message. 2007-05-13 Robert Millan - * util/update-grub.in: Fix a few assumptions about the devices holding - /, /boot and /boot/grub being the same. - * util/grub.d/00_header.in: Likewise. - * util/grub.d/10_hurd.in: Likewise. - * util/grub.d/10_linux.in: Likewise. + * util/update-VasEBoot.in: Fix a few assumptions about the devices holding + /, /boot and /boot/VasEBoot being the same. + * util/VasEBoot.d/00_header.in: Likewise. + * util/VasEBoot.d/10_hurd.in: Likewise. + * util/VasEBoot.d/10_linux.in: Likewise. - * util/grub.d/10_linux.in: Implement Linux image sorting with arbitrary + * util/VasEBoot.d/10_linux.in: Implement Linux image sorting with arbitrary patterns. Use that to define the `.old' suffix as older than `'. - * util/grub.d/00_header.in: Set default gfxmode to `800x600x16'. + * util/VasEBoot.d/00_header.in: Set default gfxmode to `800x600x16'. - * util/update-grub.in: Add a reference to ${sysconfdir}/default/grub in - the grub.cfg header message. + * util/update-VasEBoot.in: Add a reference to ${sysconfdir}/default/VasEBoot in + the VasEBoot.cfg header message. 2007-05-11 Robert Millan - * util/update-grub.in: Create device.map if it doesn't already exist, - before attempting to run grub-probe. - Check for grub-probe and grub-mkdevicemap with the same code - grub-install is using. + * util/update-VasEBoot.in: Create device.map if it doesn't already exist, + before attempting to run VasEBoot-probe. + Check for VasEBoot-probe and VasEBoot-mkdevicemap with the same code + VasEBoot-install is using. Remove test mode. 2007-05-09 Jeroen Dekkers @@ -48608,14 +48608,14 @@ 2007-05-09 Robert Millan - * util/i386/pc/grub-probe.c (probe): When detecting partition map, + * util/i386/pc/VasEBoot-probe.c (probe): When detecting partition map, fail gracefully if dev->disk->partition == NULL. 2007-05-07 Robert Millan - * util/i386/pc/grub-probe.c: Add `grub-probe -t partmap' parameter to + * util/i386/pc/VasEBoot-probe.c: Add `VasEBoot-probe -t partmap' parameter to determine partition map module. - * util/i386/pc/grub-install.in: Use this feature to decide which + * util/i386/pc/VasEBoot-install.in: Use this feature to decide which partition module to load, instead of hardcoding pc and gpt. 2007-05-07 Robert Millan @@ -48625,60 +48625,60 @@ 2007-05-05 Robert Millan - * util/powerpc/ieee1275/grub-install.in: Fix syntax error in pkglibdir + * util/powerpc/ieee1275/VasEBoot-install.in: Fix syntax error in pkglibdir initialisation. 2007-05-05 Robert Millan - * util/update-grub.in: Create ${grub_prefix} if it doesn't exist. + * util/update-VasEBoot.in: Create ${VasEBoot_prefix} if it doesn't exist. 2007-05-05 Robert Millan - * util/grub.d/10_linux.in: Allow the administrator to insert Linux - command-line arguments via ${GRUB_CMDLINE_LINUX}. + * util/VasEBoot.d/10_linux.in: Allow the administrator to insert Linux + command-line arguments via ${VasEBoot_CMDLINE_LINUX}. 2007-05-05 Robert Millan - * conf/i386-pc.rmk (grub_setup_SOURCES): Add partmap/gpt.c. - (grub_probe_SOURCES): Likewise. - * util/i386/pc/biosdisk.c (grub_util_biosdisk_get_grub_dev): Detect + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add partmap/gpt.c. + (VasEBoot_probe_SOURCES): Likewise. + * util/i386/pc/biosdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): Detect GPT and initialize dos_part and bsd_part accordingly. - * util/i386/pc/grub-setup.c (setup): Ditto for install_dos_part and + * util/i386/pc/VasEBoot-setup.c (setup): Ditto for install_dos_part and install_bsd_part. (main): Activate gpt module for use during partition identification, and deactivate it afterwards. - * util/i386/pc/grub-install.in: Add gpt module to core.img. - * util/i386/pc/grub-probe.c (main): Activate gpt module for use during + * util/i386/pc/VasEBoot-install.in: Add gpt module to core.img. + * util/i386/pc/VasEBoot-probe.c (main): Activate gpt module for use during partition identification, and deactivate it afterwards. 2007-05-05 Robert Millan - * term/i386/pc/console.c (grub_console_fini): Call - grub_term_set_current() before grub_term_unregister(). + * term/i386/pc/console.c (VasEBoot_console_fini): Call + VasEBoot_term_set_current() before VasEBoot_term_unregister(). 2007-05-04 Robert Millan - * DISTLIST: Add util/update-grub.in, util/grub.d/00_header.in, - util/grub.d/10_hurd.in, util/grub.d/10_linux.in and util/grub.d/README. - * Makefile.in: Build update-grub_SCRIPTS. Install update-grub_SCRIPTS - and update-grub_DATA. - * conf/common.rmk: Build and install update-grub components. + * DISTLIST: Add util/update-VasEBoot.in, util/VasEBoot.d/00_header.in, + util/VasEBoot.d/10_hurd.in, util/VasEBoot.d/10_linux.in and util/VasEBoot.d/README. + * Makefile.in: Build update-VasEBoot_SCRIPTS. Install update-VasEBoot_SCRIPTS + and update-VasEBoot_DATA. + * conf/common.rmk: Build and install update-VasEBoot components. * conf/common.mk: Regenerate. - * util/update-grub.in: New. Core of update-grub. - * util/grub.d/00_header.in: New. Generates grub.cfg header. - * util/grub.d/10_hurd.in: New. Generates boot entries for the Hurd. - * util/grub.d/10_linux.in: New. Generates boot entries for Linux. - * util/grub.d/README: New. Document grub.d directory layout. + * util/update-VasEBoot.in: New. Core of update-VasEBoot. + * util/VasEBoot.d/00_header.in: New. Generates VasEBoot.cfg header. + * util/VasEBoot.d/10_hurd.in: New. Generates boot entries for the Hurd. + * util/VasEBoot.d/10_linux.in: New. Generates boot entries for Linux. + * util/VasEBoot.d/README: New. Document VasEBoot.d directory layout. 2007-05-01 Robert Millan - * util/grub-emu.c: Move initialization functions - grub_util_biosdisk_init() and grub_init_all() before - grub_util_biosdisk_get_grub_dev(), which relies on them. + * util/VasEBoot-emu.c: Move initialization functions + VasEBoot_util_biosdisk_init() and VasEBoot_init_all() before + VasEBoot_util_biosdisk_get_VasEBoot_dev(), which relies on them. 2007-04-19 Robert Millan - * util/powerpc/ieee1275/grub-install.in: Initialize ${bindir}, since + * util/powerpc/ieee1275/VasEBoot-install.in: Initialize ${bindir}, since it is used later. 2007-04-18 Jerone Young @@ -48696,8 +48696,8 @@ * configure.ac: Add argument for autoconf to use transformation ability. * Makefile.in: Add autoconf package transformation code. - * util/i386/pc/grub-install.in: Likewise. - * util/powerpc/ieee1275/grub-install.in: Likewise. + * util/i386/pc/VasEBoot-install.in: Likewise. + * util/powerpc/ieee1275/VasEBoot-install.in: Likewise. 2007-03-19 Yoshinori K. Okuji @@ -48705,18 +48705,18 @@ (EXT2_GOOD_OLD_INODE_SIZE): Likewise. (EXT2_REVISION): Likewise. (EXT2_INODE_SIZE): Likewise. - (struct grub_ext2_block_group): Added a missing member + (struct VasEBoot_ext2_block_group): Added a missing member "used_dirs". - (grub_ext2_read_inode): Divide by the inode size in a superblock + (VasEBoot_ext2_read_inode): Divide by the inode size in a superblock instead of 128 to obtain INODES_PER_BLOCK. Use the macro EXT2_INODE_SIZE instead of directly using SBLOCK->INODE_SIZE. 2007-03-18 Yoshinori K. Okuji - * fs/ext2.c (grub_ext2_read_inode): Use the inode size in a + * fs/ext2.c (VasEBoot_ext2_read_inode): Use the inode size in a superblock instead of the structure size to compute an - offset. This fixes the problem that GRUB could not read a + offset. This fixes the problem that VasEBoot could not read a filesystem when inode size is different from 128-byte. 2007-03-05 Marco Gerards @@ -48728,105 +48728,105 @@ * kern/powerpc/ieee1275/init.c (HEAP_SIZE): Removed. (HEAP_LIMIT): New macro. - (grub_claim_heap): Claim memory up to `heaplimit'. + (VasEBoot_claim_heap): Claim memory up to `heaplimit'. 2007-02-21 Hollis Blanchard * conf/powerpc-ieee1275.rmk (kernel_elf_LDFLAGS): Link at 64KB. * kern/powerpc/ieee1275/init.c (_end): Add declaration. (_start): Likewise. - (grub_arch_modules_addr): Return address after `_end'. - * util/powerpc/ieee1275/grub-mkimage.c: Include grub/misc.h. + (VasEBoot_arch_modules_addr): Return address after `_end'. + * util/powerpc/ieee1275/VasEBoot-mkimage.c: Include VasEBoot/misc.h. (load_modules): Use new parameter as `p_paddr' and `p_vaddr'. (add_segments): Calculate `_end' from phdr size and location. (ALIGN_UP): Moved to ... - * include/grub/misc.h: here. - * include/grub/powerpc/ieee1275/kernel.h (GRUB_IEEE1275_MOD_ALIGN): + * include/VasEBoot/misc.h: here. + * include/VasEBoot/powerpc/ieee1275/kernel.h (VasEBoot_IEEE1275_MOD_ALIGN): New macro. - (GRUB_IEEE1275_MODULE_BASE): Removed. + (VasEBoot_IEEE1275_MODULE_BASE): Removed. 2007-02-20 Hollis Blanchard - * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Correct + * kern/powerpc/ieee1275/openfw.c (VasEBoot_available_iterate): Correct loop boundary. 2007-02-20 Hollis Blanchard - * include/grub/elfload.h (grub_elf32_load_hook_t): Return grub_err_t. + * include/VasEBoot/elfload.h (VasEBoot_elf32_load_hook_t): Return VasEBoot_err_t. All users updated. - (grub_elf64_load_hook_t): Likewise. - * kern/elf.c: Call `grub_error_push' before `grub_error'. Improve + (VasEBoot_elf64_load_hook_t): Likewise. + * kern/elf.c: Call `VasEBoot_error_push' before `VasEBoot_error'. Improve debug output. 2007-02-20 Hollis Blanchard * kern/mm.c: Update copyright. - (grub_mm_debug): Correct syntax error. - (grub_mm_dump_free): New function. - (grub_debug_free): Call `grub_free'. - * include/grub/mm.h: Update copyright. - (grub_mm_dump_free): Add declaration. + (VasEBoot_mm_debug): Correct syntax error. + (VasEBoot_mm_dump_free): New function. + (VasEBoot_debug_free): Call `VasEBoot_free'. + * include/VasEBoot/mm.h: Update copyright. + (VasEBoot_mm_dump_free): Add declaration. 2007-02-12 Hollis Blanchard - * include/grub/ieee1275/ieee1275.h: Update copyright. + * include/VasEBoot/ieee1275/ieee1275.h: Update copyright. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. - * include/grub/elfload.h: Likewise. + * include/VasEBoot/elfload.h: Likewise. * kern/elf.c: Likewise. - (grub_elf32_load): Pass `base' and `size' parameters. Update all + (VasEBoot_elf32_load): Pass `base' and `size' parameters. Update all callers. - (grub_elf64_load): Likewise. - (grub_elf32_load_segment): Move to a nested function. - (grub_elf64_load_segment): Likewise. + (VasEBoot_elf64_load): Likewise. + (VasEBoot_elf32_load_segment): Move to a nested function. + (VasEBoot_elf64_load_segment): Likewise. 2007-02-12 Hollis Blanchard - * include/grub/ieee1275/ieee1275.h (grub_available_iterate): New + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_available_iterate): New prototype. - * kern/powerpc/ieee1275/init.c (grub_heap_start): Removed. - (grub_heap_len): Likewise. + * kern/powerpc/ieee1275/init.c (VasEBoot_heap_start): Removed. + (VasEBoot_heap_len): Likewise. (HEAP_SIZE): New macro. - (grub_claim_heap): New function. - (grub_machine_init): Don't claim heap directly. Call - `grub_claim_heap'. + (VasEBoot_claim_heap): New function. + (VasEBoot_machine_init): Don't claim heap directly. Call + `VasEBoot_claim_heap'. * kern/powerpc/ieee1275/openfw.c: Include alloca.h. - (grub_available_iterate): New function. + (VasEBoot_available_iterate): New function. 2007-02-03 Thomas Schwinge - * aclocal.m4 (grub_CHECK_STACK_PROTECTOR): New definition. + * aclocal.m4 (VasEBoot_CHECK_STACK_PROTECTOR): New definition. * configure.ac: Use it for testing the HOST and TARGET compilers. 2006-12-13 Thomas Schwinge - * Makefile.in (enable_grub_emu): New variable. - * configure.ac (--enable-grub-emu): New option. - Do the checks for (n)curses only if `--enable-grub-emu' is requested. - * conf/i386-efi.rmk (sbin_UTILITIES): Add `grub-emu' only if requested. + * Makefile.in (enable_VasEBoot_emu): New variable. + * configure.ac (--enable-VasEBoot-emu): New option. + Do the checks for (n)curses only if `--enable-VasEBoot-emu' is requested. + * conf/i386-efi.rmk (sbin_UTILITIES): Add `VasEBoot-emu' only if requested. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk (bin_UTILITIES): Likewise. 2006-12-12 Marco Gerards - * include/grub/err.h (grub_err_t): Add `GRUB_ERR_MENU'. + * include/VasEBoot/err.h (VasEBoot_err_t): Add `VasEBoot_ERR_MENU'. - * kern/env.c (grub_env_unset): Don't free the member `value' when - the type is GRUB_ENV_VAR_DATA, in this case it's a user defined + * kern/env.c (VasEBoot_env_unset): Don't free the member `value' when + the type is VasEBoot_ENV_VAR_DATA, in this case it's a user defined pointer. * normal/main.c (current_menu): Removed. (free_menu): Unset the `menu' environment variable. - (grub_normal_menu_addentry): Make use of the environment variable + (VasEBoot_normal_menu_addentry): Make use of the environment variable `menu', instead of using the global `current_menu'. Allocate memory for the sourcecode of this entry. (read_config_file): New argument `nested', changed all callers. Only in the case of a new context, initialize a new menu. Set the `menu' environment variable. - (grub_normal_execute): Don't set and unset the environment + (VasEBoot_normal_execute): Don't set and unset the environment variable `menu' here anymore. Only free the menu when leaving the context. @@ -48844,45 +48844,45 @@ 2006-11-25 Yoshinori K. Okuji - * util/i386/pc/grub-mkimage.c (generate_image): Fix the offset of + * util/i386/pc/VasEBoot-mkimage.c (generate_image): Fix the offset of the number of sectors. Reported by Andrey Shuvikov . 2006-11-11 Jeroen Dekkers - * kern/disk.c (grub_disk_read): When there is a read error, always + * kern/disk.c (VasEBoot_disk_read): When there is a read error, always try to read only the necessary data. - * conf/i386-pc.rmk (grub_probe_SOURCES): Add disk/lvm.c and + * conf/i386-pc.rmk (VasEBoot_probe_SOURCES): Add disk/lvm.c and disk/raid.c. - * include/grub/disk.h [GRUB_UTIL] (grub_raid_init): New + * include/VasEBoot/disk.h [VasEBoot_UTIL] (VasEBoot_raid_init): New prototype. - [GRUB_UTIL] (grub_raid_fini): Likewise. - [GRUB_UTIL] (grub_lvm_init): Likewise. - [GRUB_UTIL] (grub_lvm_fini): Likewise. - * util/i386/pc/grub-probe.c (probe): Check whether DEVICE_NAME is + [VasEBoot_UTIL] (VasEBoot_raid_fini): Likewise. + [VasEBoot_UTIL] (VasEBoot_lvm_init): Likewise. + [VasEBoot_UTIL] (VasEBoot_lvm_fini): Likewise. + * util/i386/pc/VasEBoot-probe.c (probe): Check whether DEVICE_NAME is RAID device and copy DEVICE_NAME to DRIVE_NAME in that case. - (main): Call grub_raid_init(), grub_lvm_init(), grub_lvm_fini() - and grub_raid_fini(). + (main): Call VasEBoot_raid_init(), VasEBoot_lvm_init(), VasEBoot_lvm_fini() + and VasEBoot_raid_fini(). 2006-11-09 Jeroen Dekkers - * include/grub/types.h (__unused): Rename to UNUSED. - * kern/elf.c (grub_elf32_size): Use UNUSED instead of __unused. - (grub_elf64_size): Likewise. + * include/VasEBoot/types.h (__unused): Rename to UNUSED. + * kern/elf.c (VasEBoot_elf32_size): Use UNUSED instead of __unused. + (VasEBoot_elf64_size): Likewise. 2006-11-03 Hollis Blanchard - * kern/elf.c (grub_elf_file): Call grub_file_seek. Call - grub_error_push and grub_error_pop in the error-handling path. - (grub_elf32_load_segment): Only call grub_file_read with non-zero + * kern/elf.c (VasEBoot_elf_file): Call VasEBoot_file_seek. Call + VasEBoot_error_push and VasEBoot_error_pop in the error-handling path. + (VasEBoot_elf32_load_segment): Only call VasEBoot_file_read with non-zero length. 2006-11-03 Hollis Blanchard - * conf/i386-efi.rmk (grub_emu_SOURCES): Add kern/elf.c. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Add kern/elf.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. (kernel_elf_SOURCES): Likewise. * conf/i386-efi.rmk (kernel_mod_HEADERS): Add elfload.h and cache.h. * conf/i386-pc.rmk (kernel_mod_HEADERS): Likewise. @@ -48892,66 +48892,66 @@ (elf_mod_SOURCES): New variable. (elf_mod_CFLAGS): Likewise. (elf_mod_LDFLAGS): Likewise. - * include/grub/types.h (__unused): New macro. - * include/grub/elfload.h: New file. + * include/VasEBoot/types.h (__unused): New macro. + * include/VasEBoot/elfload.h: New file. * kern/elf.c: Likewise. * loader/powerpc/ieee1275/linux.c: Include elfload.h. (ELF32_LOADMASK): New macro. (ELF64_LOADMASK): Likewise. (vmlinux): Removed. - (grub_linux_load32): New function. - (grub_linux_load64): Likewise. - (grub_rescue_cmd_linux): Call grub_linux_load32 or grub_linux_load64. - Use grub_elf_t instead of grub_file_t. + (VasEBoot_linux_load32): New function. + (VasEBoot_linux_load64): Likewise. + (VasEBoot_rescue_cmd_linux): Call VasEBoot_linux_load32 or VasEBoot_linux_load64. + Use VasEBoot_elf_t instead of VasEBoot_file_t. 2006-11-02 Hollis Blanchard - * kern/ieee1275/ieee1275.c (grub_ieee1275_set_color): Add + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_set_color): Add `catch_result' to struct set_color_args. 2006-10-28 Yoshinori K. Okuji - * normal/menu.c: Include grub/script.h. + * normal/menu.c: Include VasEBoot/script.h. * normal/menu_entry.c: Likewise. - * include/grub/normal.h: Do not include grub/script.h. + * include/VasEBoot/normal.h: Do not include VasEBoot/script.h. 2006-10-27 Hollis Blanchard - * kern/disk.c (grub_disk_read): Correct debug printf formatting. + * kern/disk.c (VasEBoot_disk_read): Correct debug printf formatting. 2006-10-27 Hollis Blanchard - * kern/disk.c (grub_disk_open): Print debug messages when opening a + * kern/disk.c (VasEBoot_disk_open): Print debug messages when opening a disk. - (grub_disk_close): Print debug messages when closing a disk. - (grub_disk_read): Print debug messages when disk read fails. - * kern/fs.c (grub_fs_probe): Print debug messages when detecting + (VasEBoot_disk_close): Print debug messages when closing a disk. + (VasEBoot_disk_read): Print debug messages when disk read fails. + * kern/fs.c (VasEBoot_fs_probe): Print debug messages when detecting filesystem type. * kern/partition.c: Include misc.h. - (grub_partition_iterate): Print debug messages when detecting + (VasEBoot_partition_iterate): Print debug messages when detecting partition type. 2006-10-27 Hollis Blanchard - * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Return error if `status' + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_read): Return error if `status' is negative. * kern/ieee1275/ieee1275.c (IEEE1275_IHANDLE_INVALID): Change to 0. 2006-10-26 Hollis Blanchard - * kern/powerpc/ieee1275/openfw.c (grub_ieee1275_encode_devname): - Reverse GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS test. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_ieee1275_encode_devname): + Reverse VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS test. 2006-10-25 Jeroen Dekkers - * disk/lvm.c (grub_lvm_scan_device): Malloc sizeof(*lv) bytes + * disk/lvm.c (VasEBoot_lvm_scan_device): Malloc sizeof(*lv) bytes instead of sizeof(lv). Patch by Michael Guntsche. 2006-10-18 Jeroen Dekkers * disk/lvm.c: Rename VGS to VG_LIST. - (grub_lvm_iterate): Change VGS->LV to VG-LV. - (grub_lvm_open): Likewise. + (VasEBoot_lvm_iterate): Change VGS->LV to VG-LV. + (VasEBoot_lvm_open): Likewise. Thanks to Michael Guntsche for finding this bug. 2006-10-15 Yoshinori K. Okuji @@ -48960,13 +48960,13 @@ 2006-10-14 Robert Millan - * util/i386/pc/getroot.c (grub_guess_root_device): Don't compare os_dev + * util/i386/pc/getroot.c (VasEBoot_guess_root_device): Don't compare os_dev with "/dev/.static/dev/md". 2006-10-14 Yoshinori K. Okuji - * util/i386/pc/grub-probe.c (probe): Print DEVICE_NAME instead of - DRIVE_NAME when grub_util_biosdisk_get_grub_dev fails. Open + * util/i386/pc/VasEBoot-probe.c (probe): Print DEVICE_NAME instead of + DRIVE_NAME when VasEBoot_util_biosdisk_get_VasEBoot_dev fails. Open DRIVE_NAME instead of DEVICE_NAME. Make sure that DEVICE_NAME and DRIVE_NAME are always freed. @@ -48976,29 +48976,29 @@ 2006-10-14 Robert Millan - * util/i386/pc/getroot.c (grub_guess_root_device): Stop using - grub_util_biosdisk_get_grub_dev to convert system device to GRUB device. - * util/grub-emu.c (main): Use grub_util_biosdisk_get_grub_dev with the - string returned by grub_guess_root_device. - * util/i386/pc/grub-setup.c: Likewise. - * util/i386/pc/grub-probefs.c: Likewise. + * util/i386/pc/getroot.c (VasEBoot_guess_root_device): Stop using + VasEBoot_util_biosdisk_get_VasEBoot_dev to convert system device to VasEBoot device. + * util/VasEBoot-emu.c (main): Use VasEBoot_util_biosdisk_get_VasEBoot_dev with the + string returned by VasEBoot_guess_root_device. + * util/i386/pc/VasEBoot-setup.c: Likewise. + * util/i386/pc/VasEBoot-probefs.c: Likewise. - * util/i386/pc/grub-probefs.c: Rename to ... - * util/i386/pc/grub-probe.c: ... this. - * DISTLIST: Remove grub-probefs, add grub-probe. + * util/i386/pc/VasEBoot-probefs.c: Rename to ... + * util/i386/pc/VasEBoot-probe.c: ... this. + * DISTLIST: Remove VasEBoot-probefs, add VasEBoot-probe. * conf/i386-efi.rmk: Likewise. * conf/i386-pc.rmk: Likewise. - * util/i386/pc/grub-install.in: Likewise. + * util/i386/pc/VasEBoot-install.in: Likewise. - * util/i386/pc/grub-probe.c: Add --target=(fs|device|drive) option to + * util/i386/pc/VasEBoot-probe.c: Add --target=(fs|device|drive) option to choose which information we want to print. 2006-10-14 Yoshinori K. Okuji * DISTLIST: Added commands/echo.c, disk/lvm.c, disk/raid.c, - include/grub/bitmap.h, include/grub/lvm.h, include/grub/raid.h, - include/grub/i386/pc/vbeutil.h, include/grub/util/lvm.h, - include/grub/util/raid.h, util/lvm.c, util/raid.c, video/bitmap.c, + include/VasEBoot/bitmap.h, include/VasEBoot/lvm.h, include/VasEBoot/raid.h, + include/VasEBoot/i386/pc/vbeutil.h, include/VasEBoot/util/lvm.h, + include/VasEBoot/util/raid.h, util/lvm.c, util/raid.c, video/bitmap.c, video/readers/tga.c and video/i386/pc/vbeutil.c. 2006-10-14 Jeroen Dekkers @@ -49007,46 +49007,46 @@ * disk/lvm.c: New file. * disk/raid.c: Likewise. - * include/grub/lvm.h: Likewise. - * include/grub/raid.h: Likewise. - * include/grub/util/lvm.h: Likewise. - * include/grub/util/raid.h: Likewise. + * include/VasEBoot/lvm.h: Likewise. + * include/VasEBoot/raid.h: Likewise. + * include/VasEBoot/util/lvm.h: Likewise. + * include/VasEBoot/util/raid.h: Likewise. * util/lvm.c: Likewise. * util/raid.c: Likewise. - * include/grub/disk.h (grub_disk_dev_id): Add - GRUB_DISK_DEVICE_RAID_ID and GRUB_DISK_DEVICE_LVM_ID. - (grub_disk_get_size): New prototype. - * kern/disk.c (grub_disk_open): Check whether grub_partition_probe() + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add + VasEBoot_DISK_DEVICE_RAID_ID and VasEBoot_DISK_DEVICE_LVM_ID. + (VasEBoot_disk_get_size): New prototype. + * kern/disk.c (VasEBoot_disk_open): Check whether VasEBoot_partition_probe() returns a partition. - (grub_disk_get_size): New function. + (VasEBoot_disk_get_size): New function. * kern/i386/pc/init.c (make_install_device): Copy the prefix - verbatim if grub_install_dos_part is -2. + verbatim if VasEBoot_install_dos_part is -2. - * util/i386/pc/getroot.c (grub_guess_root_device): Support RAID + * util/i386/pc/getroot.c (VasEBoot_guess_root_device): Support RAID and LVM devices. - * util/i386/pc/grub-setup.c (setup): New argument - MUST_EMBED. Force embedding of GRUB when the argument is + * util/i386/pc/VasEBoot-setup.c (setup): New argument + MUST_EMBED. Force embedding of VasEBoot when the argument is true. Close FILE before returning. (main): Add support for RAID and LVM. * conf/common.rmk: Add RAID and LVM modules. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add util/raid.c and + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add util/raid.c and util/lvm.c. - (grub_emu_SOURCES): Add disk/raid.c and disk/lvm.c. + (VasEBoot_emu_SOURCES): Add disk/raid.c and disk/lvm.c. - * kern/misc.c (grub_strstr): New function. - * include/grub/misc.h (grub_strstr): New prototype. + * kern/misc.c (VasEBoot_strstr): New function. + * include/VasEBoot/misc.h (VasEBoot_strstr): New prototype. 2006-10-10 Tristan Gingold - * include/grub/efi/api.h (GRUB_EFI_ERROR_CODE): Long constant. + * include/VasEBoot/efi/api.h (VasEBoot_EFI_ERROR_CODE): Long constant. 2006-10-05 Tristan Gingold - * kern/misc.c (grub_strtoull): Guess the base only if not + * kern/misc.c (VasEBoot_strtoull): Guess the base only if not specified. 2006-10-01 Hollis Blanchard @@ -49056,66 +49056,66 @@ 2006-10-01 Hollis Blanchard - * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Cast `size' to long. + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): Cast `size' to long. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_next_property): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_next_property): Remove `flags' argument. All callers changed. * kern/ieee1275/ieee1275.c (IEEE1275_PHANDLE_ROOT): Removed. (IEEE1275_IHANDLE_INVALID): New variable. (IEEE1275_CELL_INVALID): New variable. - (grub_ieee1275_finddevice, grub_ieee1275_get_property, - grub_ieee1275_get_property_length, grub_ieee1275_instance_to_package, - grub_ieee1275_package_to_path, grub_ieee1275_instance_to_path, - grub_ieee1275_peer, grub_ieee1275_child, grub_ieee1275_open, - grub_ieee1275_claim, grub_ieee1275_set_property): Error-check return + (VasEBoot_ieee1275_finddevice, VasEBoot_ieee1275_get_property, + VasEBoot_ieee1275_get_property_length, VasEBoot_ieee1275_instance_to_package, + VasEBoot_ieee1275_package_to_path, VasEBoot_ieee1275_instance_to_path, + VasEBoot_ieee1275_peer, VasEBoot_ieee1275_child, VasEBoot_ieee1275_open, + VasEBoot_ieee1275_claim, VasEBoot_ieee1275_set_property): Error-check return codes from Open Firmware. All callers updated. - (grub_ieee1275_next_property): Directly return Open Firmware return + (VasEBoot_ieee1275_next_property): Directly return Open Firmware return code. - * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): - Standardize error checking from `grub_ieee1275_get_property'. - * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Rename + * kern/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_find_options): + Standardize error checking from `VasEBoot_ieee1275_get_property'. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_devalias_iterate): Rename `devalias' to `aliases'. Correct comments. Consolidate error paths. 2006-10-01 Hollis Blanchard - * kern/ieee1275/ieee1275.c (grub_ieee1275_instance_to_path): Rename + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_instance_to_path): Rename `instance_to_package_args' to `instance_to_path_args'. - * kern/powerpc/ieee1275/init.c (grub_machine_init): Use - `grub_ieee1275_chosen'. + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_init): Use + `VasEBoot_ieee1275_chosen'. - * term/ieee1275/ofconsole.c (grub_ofconsole_init): Call - `grub_ieee1275_interpret'. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_init): Call + `VasEBoot_ieee1275_interpret'. 2006-09-25 Hollis Blanchard - * util/powerpc/ieee1275/grub-mkimage.c: Include config.h. + * util/powerpc/ieee1275/VasEBoot-mkimage.c: Include config.h. 2006-09-25 Hollis Blanchard - * include/grub/powerpc/libgcc.h (__floatdisf): New prototype. + * include/VasEBoot/powerpc/libgcc.h (__floatdisf): New prototype. (__cmpdi): Likewise. - * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Pass 0 as - `flags' to `grub_ieee1275_next_property'. Change `pathlen' to type - `grub_ssize_t'. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_devalias_iterate): Pass 0 as + `flags' to `VasEBoot_ieee1275_next_property'. Change `pathlen' to type + `VasEBoot_ssize_t'. - * kern/powerpc/ieee1275/cmain.c: Include grub/misc.h. + * kern/powerpc/ieee1275/cmain.c: Include VasEBoot/misc.h. - * loader/powerpc/ieee1275/linux.c (grub_linux_boot): Change `actual' - to type `grub_ssize_t'. - (grub_rescue_cmd_linux): Cast -1 to `grub_off_t'. + * loader/powerpc/ieee1275/linux.c (VasEBoot_linux_boot): Change `actual' + to type `VasEBoot_ssize_t'. + (VasEBoot_rescue_cmd_linux): Cast -1 to `VasEBoot_off_t'. 2006-09-22 Marco Gerards - * normal/script.c (grub_script_create_cmdmenu): Skip leading + * normal/script.c (VasEBoot_script_create_cmdmenu): Skip leading newlines. 2006-09-22 Marco Gerards * commands/echo.c: New file. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/echo.c'. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `commands/echo.c'. * conf/common.rmk (echo_mod_SOURCES): New variable. (echo_mod_CFLAGS): Likewise. @@ -49129,10 +49129,10 @@ 2006-09-22 Marco Gerards - * conf/i386-efi.rmk (grub_emu_DEPENDENCIES): New variable. + * conf/i386-efi.rmk (VasEBoot_emu_DEPENDENCIES): New variable. (normal_mod_DEPENDENCIES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_DEPENDENCIES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_DEPENDENCIES): Likewise. (normal_mod_DEPENDENCIES): Likewise. * conf/sparc64-ieee1275.rmk (normal_mod_DEPENDENCIES): Likewise. @@ -49141,7 +49141,7 @@ * genmk.rb: Add DEPENDENCIES variables to modules, utilities, and programs. - * conf/i386-pc.rmk (grub_emu_DEPENDENCIES): Declare. + * conf/i386-pc.rmk (VasEBoot_emu_DEPENDENCIES): Declare. (normal_mod_DEPENDENCIES): Likewise. * conf/i386-pc.mk: Regenerate. * conf/i386-efi.mk: Likewise @@ -49152,13 +49152,13 @@ 2006-09-22 Robert Millan Sync with i386 version. - * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Remove grub-emu, add grub-mkimage. - * conf/powerpc-ieee1275.rmk (sbin_UTILITIES): Remove grub-mkimage, add grub-emu. + * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Remove VasEBoot-emu, add VasEBoot-mkimage. + * conf/powerpc-ieee1275.rmk (sbin_UTILITIES): Remove VasEBoot-mkimage, add VasEBoot-emu. 2006-09-21 Robert Millan - Import from GRUB Legacy (lib/device.c): - * util/i386/pc/grub-mkdevicemap.c (get_i2o_disk_name): New function. + Import from VasEBoot Legacy (lib/device.c): + * util/i386/pc/VasEBoot-mkdevicemap.c (get_i2o_disk_name): New function. (init_device_map) [__linux__]: Add support for I2O devices. 2006-09-14 Marco Gerards @@ -49168,12 +49168,12 @@ 2006-09-14 Robert Millan - * util/i386/pc/grub-install.in: Skip menu.lst when removing - /boot/grub/*.lst. + * util/i386/pc/VasEBoot-install.in: Skip menu.lst when removing + /boot/VasEBoot/*.lst. * util/i386/pc/getroot.c: Don't recurse into dotdirs (e.g. ".static"). - * util/i386/pc/grub-mkdevicemap.c: Make sure the floppy device exists + * util/i386/pc/VasEBoot-mkdevicemap.c: Make sure the floppy device exists before adding it to device.map. 2006-08-15 Johan Rydberg @@ -49188,30 +49188,30 @@ 2006-08-04 Yoshinori K. Okuji - Move the prototypes of grub_setjmp and grub_longjmp to + Move the prototypes of VasEBoot_setjmp and VasEBoot_longjmp to cpu/setjmp.h, so that each architecture may specify different attributes. - * include/grub/i386/setjmp.h (grub_setjmp): New prototype. - (grub_longjmp): Likewise. - * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise.. - (grub_longjmp): Likewise. - * include/grub/sparc64/setjmp.h (grub_setjmp): Likewise.. - (grub_longjmp): Likewise. + * include/VasEBoot/i386/setjmp.h (VasEBoot_setjmp): New prototype. + (VasEBoot_longjmp): Likewise. + * include/VasEBoot/powerpc/setjmp.h (VasEBoot_setjmp): Likewise.. + (VasEBoot_longjmp): Likewise. + * include/VasEBoot/sparc64/setjmp.h (VasEBoot_setjmp): Likewise.. + (VasEBoot_longjmp): Likewise. - * include/grub/setjmp.h [!GRUB_UTIL] (grub_setjmp): Removed. - [!GRUB_UTIL] (grub_longjmp): Removed. + * include/VasEBoot/setjmp.h [!VasEBoot_UTIL] (VasEBoot_setjmp): Removed. + [!VasEBoot_UTIL] (VasEBoot_longjmp): Removed. 2006-08-01 Pelletier Vincent - * kern/ieee1275/ieee1275.c (grub_ieee1275_set_color): IEEE1275 + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_set_color): IEEE1275 "color!" method does not return any value. 2006-07-29 Vesa Jaaskelainen - * include/grub/bitmap.h: New file. + * include/VasEBoot/bitmap.h: New file. - * include/grub/i386/pc/vbeutil.h: Likewise. + * include/VasEBoot/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. @@ -49235,74 +49235,74 @@ (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. - * include/grub/video.h (grub_video_blit_operators): New enum type. - (grub_video_render_target): Changed as forward declaration and moved + * include/VasEBoot/video.h (VasEBoot_video_blit_operators): New enum type. + (VasEBoot_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. - (grub_video_adapter.blit_bitmap): Added blitting operator. - (grub_video_adapter.blit_render_target): Likewise. - (grub_video_blit_bitmap): Likewise. - (grub_video_blit_render_target): Likewise. + (VasEBoot_video_adapter.blit_bitmap): Added blitting operator. + (VasEBoot_video_adapter.blit_render_target): Likewise. + (VasEBoot_video_blit_bitmap): Likewise. + (VasEBoot_video_blit_render_target): Likewise. - * include/grub/i386/pc/vbe.h (grub_video_render_target): Added + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_video_render_target): Added driver specific render target definition. - (grub_video_vbe_map_rgba): Added driver internal helper. - (grub_video_vbe_unmap_color): Updated to use - grub_video_i386_vbeblit_info. - (grub_video_vbe_get_video_ptr): Likewise. + (VasEBoot_video_vbe_map_rgba): Added driver internal helper. + (VasEBoot_video_vbe_unmap_color): Updated to use + VasEBoot_video_i386_vbeblit_info. + (VasEBoot_video_vbe_get_video_ptr): Likewise. - * include/grub/i386/pc/vbeblit.h - (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use - grub_video_i386_vbeblit_info. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. - (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8): Likewise. - (grub_video_i386_vbeblit_index_index): Likewise. - (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. - (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. - (grub_video_i386_vbeblit_blend): Added generic blitter for blend + * include/VasEBoot/i386/pc/vbeblit.h + (VasEBoot_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use + VasEBoot_video_i386_vbeblit_info. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8A8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8): Likewise. + (VasEBoot_video_i386_vbeblit_index_index): Likewise. + (VasEBoot_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. + (VasEBoot_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_index_R8G8B8X8): Likewise. + (VasEBoot_video_i386_vbeblit_blend): Added generic blitter for blend operator. - (grub_video_i386_vbeblit_replace): Added generic blitter for replace + (VasEBoot_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on - include/grub/i386/pc/vbeblit.h. + include/VasEBoot/i386/pc/vbeblit.h. - * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): - Updated to use grub_video_i386_vbeblit_info. - (grub_video_i386_vbefill_R8G8B8): Likewise. - (grub_video_i386_vbefill_index): Likewise. - (grub_video_i386_vbefill): Added generic filler. + * include/VasEBoot/i386/pc/vbefill.h (VasEBoot_video_i386_vbefill_R8G8B8A8): + Updated to use VasEBoot_video_i386_vbeblit_info. + (VasEBoot_video_i386_vbefill_R8G8B8): Likewise. + (VasEBoot_video_i386_vbefill_index): Likewise. + (VasEBoot_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on - include/grub/i386/pc/vbefill.h. + include/VasEBoot/i386/pc/vbefill.h. - * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use - grub_video_i386_vbeblit_info. - (grub_video_vbe_unmap_color): Likewise. - (grub_video_vbe_blit_glyph): Likewise. - (grub_video_vbe_scroll): Likewise. - (grub_video_vbe_draw_pixel): Removed function. - (grub_video_vbe_get_pixel): Likewise. - (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and + * video/i386/pc/vbe.c (VasEBoot_video_vbe_get_video_ptr): Updated to use + VasEBoot_video_i386_vbeblit_info. + (VasEBoot_video_vbe_unmap_color): Likewise. + (VasEBoot_video_vbe_blit_glyph): Likewise. + (VasEBoot_video_vbe_scroll): Likewise. + (VasEBoot_video_vbe_draw_pixel): Removed function. + (VasEBoot_video_vbe_get_pixel): Likewise. + (VasEBoot_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. - (grub_video_vbe_blit_bitmap): Updated to use common_blitter. - (grub_video_vbe_blit_render_target): Likewise. + (VasEBoot_video_vbe_blit_bitmap): Updated to use common_blitter. + (VasEBoot_video_vbe_blit_render_target): Likewise. 2006-07-30 Johan Rydberg - * kern/efi/efi.c (grub_efi_set_text_mode): Assume console already + * kern/efi/efi.c (VasEBoot_efi_set_text_mode): Assume console already is in text mode if there is no console control protocol instance available. 2006-07-29 Vesa Jaaskelainen - * include/grub/video.h: Code cleanup. + * include/VasEBoot/video.h: Code cleanup. - * include/grub/i386/pc/vbe.h: Likewise. + * include/VasEBoot/i386/pc/vbe.h: Likewise. * video/i386/pc/vbe.c: Likewise. @@ -49314,10 +49314,10 @@ 2006-07-29 Vesa Jaaskelainen - * disk/i386/pc/biosdisk.c (struct grub_biosdisk_drp): Moved to ... - (struct grub_biosdisk_dap): Likewise. + * disk/i386/pc/biosdisk.c (struct VasEBoot_biosdisk_drp): Moved to ... + (struct VasEBoot_biosdisk_dap): Likewise. - * include/grub/i386/pc/biosdisk.h: ... to here. Also corrected + * include/VasEBoot/i386/pc/biosdisk.h: ... to here. Also corrected linkage settings for all functions. 2006-07-12 Marco Gerards @@ -49335,12 +49335,12 @@ * util/misc.c: Include config.h. [!HAVE_MEMALIGN]: Do not include malloc.h. - (grub_memalign): Use posix_memalign, if present. Then, use + (VasEBoot_memalign): Use posix_memalign, if present. Then, use memalign, if present. Otherwise, emit an error. - * util/grub-emu.c: Do not include malloc.h. + * util/VasEBoot-emu.c: Do not include malloc.h. - * include/grub/util/misc.h: Include unistd.h. This is required for + * include/VasEBoot/util/misc.h: Include unistd.h. This is required for FreeBSD, because off_t is defined in unistd.h. Reported by Harley D. Eades III . @@ -49350,25 +49350,25 @@ 2006-06-09 Yoshinori K. Okuji - * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Make sure that - ADDR_MAX does not exceed GRUB_LINUX_INITRD_MAX_ADDRESS. + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_initrd): Make sure that + ADDR_MAX does not exceed VasEBoot_LINUX_INITRD_MAX_ADDRESS. 2006-06-07 Jeroen Dekkers - * include/grub/types.h (grub_host_addr_t): Rename to - grub_target_addr_t. - (grub_host_off_t): Rename to grub_target_off_t. - (grub_host_size_t): Rename to grub_target_size_t. - (grub_host_ssize_t): Rename to grub_target_ssize_t. - Refer to GRUB_TARGET_SIZEOF_VOID_P to define those variables. + * include/VasEBoot/types.h (VasEBoot_host_addr_t): Rename to + VasEBoot_target_addr_t. + (VasEBoot_host_off_t): Rename to VasEBoot_target_off_t. + (VasEBoot_host_size_t): Rename to VasEBoot_target_size_t. + (VasEBoot_host_ssize_t): Rename to VasEBoot_target_ssize_t. + Refer to VasEBoot_TARGET_SIZEOF_VOID_P to define those variables. - * include/grub/kernel.h (struct grub_module_header): Change type - of OFFSET to grub_target_off_t and type of SIZE to grub_target_size_t. - (grub_module_info): Likewise. + * include/VasEBoot/kernel.h (struct VasEBoot_module_header): Change type + of OFFSET to VasEBoot_target_off_t and type of SIZE to VasEBoot_target_size_t. + (VasEBoot_module_info): Likewise. 2006-06-05 Yoshinori K. Okuji - * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): The conditional + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_initrd): The conditional of checking LINUX_MEM_SIZE was reverse. Reported by Jesus Velazquez . @@ -49377,14 +49377,14 @@ Count partitions from 1 instead of 0 in the string representation of partitions. Still use 0-based internally. - * partmap/sun.c (grub_sun_is_valid): A cosmetic change. - (sun_partition_map_iterate): Use grub_partition_t instead of - struct grub_partition *. Cast DESC->START_CYLINDER to - grub_uint64_t after converting the endian. + * partmap/sun.c (VasEBoot_sun_is_valid): A cosmetic change. + (sun_partition_map_iterate): Use VasEBoot_partition_t instead of + struct VasEBoot_partition *. Cast DESC->START_CYLINDER to + VasEBoot_uint64_t after converting the endian. (sun_partition_map_probe): Subtract 1 for PARTNUM. (sun_partition_map_get_name): Add 1 to P->INDEX. - * partmap/pc.c (grub_partition_parse): Subtract 1 for + * partmap/pc.c (VasEBoot_partition_parse): Subtract 1 for PCDATA->DOS_PART. (pc_partition_map_get_name): Add 1 into PCDATA->DOS_PART. @@ -49400,23 +49400,23 @@ * partmap/amiga.c (amiga_partition_map_iterate): Change the type of POS to unsigned. - (amiga_partition_map_iterate): Cast NEXT to grub_off_t to + (amiga_partition_map_iterate): Cast NEXT to VasEBoot_off_t to calculate the offset of a partition. (amiga_partition_map_probe): Subtract 1 for PARTNUM. (amiga_partition_map_get_name): Add 1 into P->INDEX. * partmap/acorn.c (acorn_partition_map_find): Change the type of - SECTOR to grub_disk_addr_t. + SECTOR to VasEBoot_disk_addr_t. (acorn_partition_map_iterate): Likewise. (acorn_partition_map_probe): Subtract 1 for PARTNUM. - Change the type of SECTOR to grub_disk_addr_t. Declare P on the + Change the type of SECTOR to VasEBoot_disk_addr_t. Declare P on the top. (acorn_partition_map_get_name): Add 1 into P->INDEX. * kern/i386/pc/init.c (make_install_device): Add 1 into - GRUB_INSTALL_DOS_PART. + VasEBoot_INSTALL_DOS_PART. - * fs/iso9660.c (grub_iso9660_mount): Fixed a reversed + * fs/iso9660.c (VasEBoot_iso9660_mount): Fixed a reversed conditional. 2006-06-04 Yoshinori K. Okuji @@ -49424,15 +49424,15 @@ Clean up the code to support 64-bit addressing in disks and files. This change is not enough for filesystems yet. - * util/i386/pc/grub-setup.c (struct boot_blocklist): Change the - type of "start" to grub_uint64_t. + * util/i386/pc/VasEBoot-setup.c (struct boot_blocklist): Change the + type of "start" to VasEBoot_uint64_t. (setup): Change the types of KERNEL_SECTOR and FIRST_SECTOR to - grub_disk_addr_t * and grub_disk_addr_t. Fix the format string in - save_first_sector and save_blocklists. Use grub_le_to_cpu64 to + VasEBoot_disk_addr_t * and VasEBoot_disk_addr_t. Fix the format string in + save_first_sector and save_blocklists. Use VasEBoot_le_to_cpu64 to convert addresses. * util/i386/pc/biosdisk.c (open_device): Change the type of SECTOR - to grub_disk_addr_t. + to VasEBoot_disk_addr_t. * partmap/gpt.c (gpt_partition_map_iterate): Fix the format string. @@ -49442,192 +49442,192 @@ * partmap/amiga.c (amiga_partition_map_iterate): Cast RDSK.MAGIC to char *. - * normal/script.c (grub_script_parse): Remove unused MEMFREE. + * normal/script.c (VasEBoot_script_parse): Remove unused MEMFREE. * normal/parser.y (YYLTYPE_IS_TRIVIAL): New macro. - * normal/lexer.c (grub_script_yyerror): Specify unused to LEX. + * normal/lexer.c (VasEBoot_script_yyerror): Specify unused to LEX. - * loader/i386/pc/multiboot.c (grub_multiboot_load_elf64): Cast -1 - to grub_off_t, to detect an error from grub_file_seek. - (grub_multiboot_load_elf32): Likewise. + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_load_elf64): Cast -1 + to VasEBoot_off_t, to detect an error from VasEBoot_file_seek. + (VasEBoot_multiboot_load_elf32): Likewise. - * kern/misc.c (grub_strtoul): Use grub_strtoull. Return the + * kern/misc.c (VasEBoot_strtoul): Use VasEBoot_strtoull. Return the maximum unsigned long value when an overflow is detected. - (grub_strtoull): New function. - (grub_divmod64): Likewise. - (grub_lltoa): use grub_divmod64. + (VasEBoot_strtoull): New function. + (VasEBoot_divmod64): Likewise. + (VasEBoot_lltoa): use VasEBoot_divmod64. - * kern/fs.c (struct grub_fs_block): Change the type of "offset" to - grub_disk_addr_t. - (grub_fs_blocklist_open): Increase P if P is not NULL to advance - the pointer to next character. Use grub_strtoull instead of - grub_strtoul. - (grub_fs_blocklist_read): Change the types of SECTOR, OFFSET and - SIZE to grub_disk_addr_t, grub_off_t and grub_size_t, + * kern/fs.c (struct VasEBoot_fs_block): Change the type of "offset" to + VasEBoot_disk_addr_t. + (VasEBoot_fs_blocklist_open): Increase P if P is not NULL to advance + the pointer to next character. Use VasEBoot_strtoull instead of + VasEBoot_strtoul. + (VasEBoot_fs_blocklist_read): Change the types of SECTOR, OFFSET and + SIZE to VasEBoot_disk_addr_t, VasEBoot_off_t and VasEBoot_size_t, respectively. - * kern/file.c (grub_file_read): Prevent an overflow of LEN, as the + * kern/file.c (VasEBoot_file_read): Prevent an overflow of LEN, as the return value is signed. - (grub_file_seek): Change the type of OLD to grub_off_t. Do not + (VasEBoot_file_seek): Change the type of OLD to VasEBoot_off_t. Do not test if OFFSET is less than zero, as OFFSET is unsigned now. - * kern/disk.c (struct grub_disk_cache): Change the type of - "sector" to grub_disk_addr_t. - (grub_disk_cache_get_index): Change the type of SECTOR to - grub_disk_addr_t. Calculate the hash with SECTOR casted to + * kern/disk.c (struct VasEBoot_disk_cache): Change the type of + "sector" to VasEBoot_disk_addr_t. + (VasEBoot_disk_cache_get_index): Change the type of SECTOR to + VasEBoot_disk_addr_t. Calculate the hash with SECTOR casted to unsigned after shifting. - (grub_disk_cache_invalidate): Change the type of SECTOR to - grub_disk_addr_t. - (grub_disk_cache_unlock): Likewise. - (grub_disk_cache_store): Likewise. - (grub_disk_check_range): Change the types of SECTOR, OFFSET, SIZE, - START and LEN to grub_disk_addr_t *, grub_off_t *, grub_size_t, - grub_disk_addr_t and grub_uint64_t, respectively. - (grub_disk_read): Use an unsigned variable REAL_OFFSET for the + (VasEBoot_disk_cache_invalidate): Change the type of SECTOR to + VasEBoot_disk_addr_t. + (VasEBoot_disk_cache_unlock): Likewise. + (VasEBoot_disk_cache_store): Likewise. + (VasEBoot_disk_check_range): Change the types of SECTOR, OFFSET, SIZE, + START and LEN to VasEBoot_disk_addr_t *, VasEBoot_off_t *, VasEBoot_size_t, + VasEBoot_disk_addr_t and VasEBoot_uint64_t, respectively. + (VasEBoot_disk_read): Use an unsigned variable REAL_OFFSET for the body, as the value of OFFSET is tweaked by - grub_disk_check_range. Change the types of START_SECTOR, LEN and - POS to grub_disk_addr_t, grub_size_t and grub_size_t, + VasEBoot_disk_check_range. Change the types of START_SECTOR, LEN and + POS to VasEBoot_disk_addr_t, VasEBoot_size_t and VasEBoot_size_t, respectively. - (grub_disk_write): Use an unsigned variable REAL_OFFSET for the + (VasEBoot_disk_write): Use an unsigned variable REAL_OFFSET for the body, as the value of OFFSET is tweaked by - grub_disk_check_range. Change the types of LEN and N to - grub_size_t. + VasEBoot_disk_check_range. Change the types of LEN and N to + VasEBoot_size_t. - * io/gzio.c (struct grub_gzio): Change the types of "data_offset" - and "saved_offset" to grub_off_t. + * io/gzio.c (struct VasEBoot_gzio): Change the types of "data_offset" + and "saved_offset" to VasEBoot_off_t. (test_header): Cast BUF to char *. - (get_byte): Cast GZIO->DATA_OFFSET to grub_off_t. Cast GZIO->INBUF + (get_byte): Cast GZIO->DATA_OFFSET to VasEBoot_off_t. Cast GZIO->INBUF to char *. - (grub_gzio_read): Change the types of OFFSET and SIZE to - grub_off_t and grub_size_t, respectively. + (VasEBoot_gzio_read): Change the types of OFFSET and SIZE to + VasEBoot_off_t and VasEBoot_size_t, respectively. - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_FORCE_LBA): + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_FORCE_LBA): Removed. - (GRUB_BOOT_MACHINE_BOOT_DRIVE): Changed to 0x4c. - (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Changed to 0x40. - (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Changed to 0x42. - (GRUB_BOOT_MACHINE_DRIVE_CHECK): Changed to 0x4e. - (GRUB_BOOT_MACHINE_LIST_SIZE): Increased to 12. + (VasEBoot_BOOT_MACHINE_BOOT_DRIVE): Changed to 0x4c. + (VasEBoot_BOOT_MACHINE_KERNEL_ADDRESS): Changed to 0x40. + (VasEBoot_BOOT_MACHINE_KERNEL_SEGMENT): Changed to 0x42. + (VasEBoot_BOOT_MACHINE_DRIVE_CHECK): Changed to 0x4e. + (VasEBoot_BOOT_MACHINE_LIST_SIZE): Increased to 12. - * include/grub/types.h (grub_off_t): Unconditionally set to - grub_uint64_t. - (grub_disk_addr_t): Changed to grub_uint64_t. + * include/VasEBoot/types.h (VasEBoot_off_t): Unconditionally set to + VasEBoot_uint64_t. + (VasEBoot_disk_addr_t): Changed to VasEBoot_uint64_t. - * include/grub/partition.h (struct grub_partition): Change the - types of "start", "len" and "offset" to grub_disk_addr_t, - grub_uint64_t and grub_disk_addr_t, respectively. - (grub_partition_get_start): Return grub_disk_addr_t. - (grub_partition_get_len): Return grub_uint64_t. + * include/VasEBoot/partition.h (struct VasEBoot_partition): Change the + types of "start", "len" and "offset" to VasEBoot_disk_addr_t, + VasEBoot_uint64_t and VasEBoot_disk_addr_t, respectively. + (VasEBoot_partition_get_start): Return VasEBoot_disk_addr_t. + (VasEBoot_partition_get_len): Return VasEBoot_uint64_t. - * include/grub/misc.h (grub_strtoull): New prototype. - (grub_divmod64): Likewise. + * include/VasEBoot/misc.h (VasEBoot_strtoull): New prototype. + (VasEBoot_divmod64): Likewise. - * include/grub/fshelp.h (grub_fshelp_read_file): Change the types - of SECTOR, LEN and FILESIZE to grub_disk_addr_t, grub_size_t and - grub_off_t, respectively. + * include/VasEBoot/fshelp.h (VasEBoot_fshelp_read_file): Change the types + of SECTOR, LEN and FILESIZE to VasEBoot_disk_addr_t, VasEBoot_size_t and + VasEBoot_off_t, respectively. All callers and references changed. - * include/grub/fs.h (struct grub_fs): Change the type of LEN to - grub_size_t in "read". + * include/VasEBoot/fs.h (struct VasEBoot_fs): Change the type of LEN to + VasEBoot_size_t in "read". All callers and references changed. - * include/grub/file.h (struct grub_file): Change the types of - "offset" and "size" to grub_off_t and grub_off_t, - respectively. Change the type of SECTOR to grub_disk_addr_t in + * include/VasEBoot/file.h (struct VasEBoot_file): Change the types of + "offset" and "size" to VasEBoot_off_t and VasEBoot_off_t, + respectively. Change the type of SECTOR to VasEBoot_disk_addr_t in "read_hook". - (grub_file_read): Change the type of LEN to grub_size_t. - (grub_file_seek): Return grub_off_t. Change the type of OFFSET to - grub_off_t. - (grub_file_size): Return grub_off_t. - (grub_file_tell): Likewise. + (VasEBoot_file_read): Change the type of LEN to VasEBoot_size_t. + (VasEBoot_file_seek): Return VasEBoot_off_t. Change the type of OFFSET to + VasEBoot_off_t. + (VasEBoot_file_size): Return VasEBoot_off_t. + (VasEBoot_file_tell): Likewise. All callers and references changed. - * include/grub/disk.h (struct grub_disk_dev): Change the types of - SECTOR and SIZE to grub_disk_addr_t and grub_size_t in "read" and + * include/VasEBoot/disk.h (struct VasEBoot_disk_dev): Change the types of + SECTOR and SIZE to VasEBoot_disk_addr_t and VasEBoot_size_t in "read" and "write". - (struct grub_disk): Change the type of "total_sectors" to - grub_uint64_t. Change the type of SECTOR to grub_disk_addr_t in + (struct VasEBoot_disk): Change the type of "total_sectors" to + VasEBoot_uint64_t. Change the type of SECTOR to VasEBoot_disk_addr_t in "read_hook". - (grub_disk_read): Change the types of SECTOR, OFFSET and SIZE to - grub_disk_addr_t, grub_off_t and grub_size_t, respectively. - (grub_disk_write): Likewise. + (VasEBoot_disk_read): Change the types of SECTOR, OFFSET and SIZE to + VasEBoot_disk_addr_t, VasEBoot_off_t and VasEBoot_size_t, respectively. + (VasEBoot_disk_write): Likewise. All callers and references changed. - * fs/iso9660.c (grub_iso9660_susp_iterate): Cast parameters to - char * for grub_strncmp to silence gcc. - (grub_iso9660_mount): Likewise. - (grub_iso9660_mount): Likewise. - (grub_iso9660_read_symlink): Likewise. Also, remove the nonsense + * fs/iso9660.c (VasEBoot_iso9660_susp_iterate): Cast parameters to + char * for VasEBoot_strncmp to silence gcc. + (VasEBoot_iso9660_mount): Likewise. + (VasEBoot_iso9660_mount): Likewise. + (VasEBoot_iso9660_read_symlink): Likewise. Also, remove the nonsense return statement. - (grub_iso9660_iterate_dir): Likewise. - (grub_iso9660_label): Cast DATA->VOLDESC.VOLNAME to char *. + (VasEBoot_iso9660_iterate_dir): Likewise. + (VasEBoot_iso9660_label): Cast DATA->VOLDESC.VOLNAME to char *. - * fs/hfs.c (grub_hfs_read_file): Change the types of SECTOR and - LEN to grub_disk_addr_t and grub_size_t, respectively. + * fs/hfs.c (VasEBoot_hfs_read_file): Change the types of SECTOR and + LEN to VasEBoot_disk_addr_t and VasEBoot_size_t, respectively. - * fs/hfsplus.c (grub_hfsplus_read_file): Likewise. + * fs/hfsplus.c (VasEBoot_hfsplus_read_file): Likewise. - * fs/jfs.c (grub_jfs_read_file): Likewise. + * fs/jfs.c (VasEBoot_jfs_read_file): Likewise. - * fs/minix.c (grub_jfs_read_file): Likewise. + * fs/minix.c (VasEBoot_jfs_read_file): Likewise. - * fs/sfs.c (grub_jfs_read_file): Likewise. + * fs/sfs.c (VasEBoot_jfs_read_file): Likewise. - * fs/ufs.c (grub_jfs_read_file): Likewise. + * fs/ufs.c (VasEBoot_jfs_read_file): Likewise. - * fs/xfs.c (grub_jfs_read_file): Likewise. + * fs/xfs.c (VasEBoot_jfs_read_file): Likewise. - * fs/fat.c (grub_fat_read_data): Change the types of SECTOR, LEN - and SIZE to grub_disk_addr_t, grub_size_t and grub_size_t, + * fs/fat.c (VasEBoot_fat_read_data): Change the types of SECTOR, LEN + and SIZE to VasEBoot_disk_addr_t, VasEBoot_size_t and VasEBoot_size_t, respectively. - * fs/ext2.c (grub_ext2_read_block): When an error happens, set - BLKNR to -1 instead of returning GRUB_ERRNO. - (grub_ext2_read_file): Change the types of SECTOR and - LEN to grub_disk_addr_t and grub_size_t, respectively. + * fs/ext2.c (VasEBoot_ext2_read_block): When an error happens, set + BLKNR to -1 instead of returning VasEBoot_ERRNO. + (VasEBoot_ext2_read_file): Change the types of SECTOR and + LEN to VasEBoot_disk_addr_t and VasEBoot_size_t, respectively. - * fs/affs.c (grub_affs_read_file): Change the types of SECTOR and - LEN to grub_disk_addr_t and grub_size_t, respectively. + * fs/affs.c (VasEBoot_affs_read_file): Change the types of SECTOR and + LEN to VasEBoot_disk_addr_t and VasEBoot_size_t, respectively. - * font/manager.c (grub_font_get_glyph): Cast BITMAP to char * for - grub_file_read. + * font/manager.c (VasEBoot_font_get_glyph): Cast BITMAP to char * for + VasEBoot_file_read. - * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Fix the format + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_read): Fix the format string. Do not cast SECTOR explicitly. - * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Change the type of - TOTAL_SECTORS to grub_uint64_t. Do not mask DRP->TOTAL_SECTORS. - (grub_biosdisk_rw): Change the types of SECTOR and SIZE to - grub_disk_addr_t and grub_size_t, respectively. If the sector is + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_open): Change the type of + TOTAL_SECTORS to VasEBoot_uint64_t. Do not mask DRP->TOTAL_SECTORS. + (VasEBoot_biosdisk_rw): Change the types of SECTOR and SIZE to + VasEBoot_disk_addr_t and VasEBoot_size_t, respectively. If the sector is over 2TB and LBA mode is not supported, raise an error. (get_safe_sectors): New function. - (grub_biosdisk_read): Use get_safe_sectors. - (grub_biosdisk_write): Likewise. + (VasEBoot_biosdisk_read): Use get_safe_sectors. + (VasEBoot_biosdisk_write): Likewise. - * disk/efi/efidisk.c (grub_efidisk_read): Fix the format string. - (grub_efidisk_write): Likewise. + * disk/efi/efidisk.c (VasEBoot_efidisk_read): Fix the format string. + (VasEBoot_efidisk_write): Likewise. * disk/loopback.c (delete_loopback): Cosmetic changes. - (grub_cmd_loopback): Likewise. Also, test NEWDEV->FILENAME + (VasEBoot_cmd_loopback): Likewise. Also, test NEWDEV->FILENAME correctly. - (grub_loopback_open): Likewise. - (grub_loopback_read): Likewise. Also, change the type of POS to - grub_off_t, and fix the usage of grub_memset. + (VasEBoot_loopback_open): Likewise. + (VasEBoot_loopback_read): Likewise. Also, change the type of POS to + VasEBoot_off_t, and fix the usage of VasEBoot_memset. - * commands/i386/pc/play.c: Include grub/machine/time.h. + * commands/i386/pc/play.c: Include VasEBoot/machine/time.h. - * commands/ls.c (grub_ls_list_files): Use "llu" instead of "d" to + * commands/ls.c (VasEBoot_ls_list_files): Use "llu" instead of "d" to print FILE->SIZE. - * commands/configfile.c: Include grub/env.h. + * commands/configfile.c: Include VasEBoot/env.h. - * commands/cmp.c (grub_cmd_cmp): Do not use ERR, but use - GRUB_ERRNO directly instead. Change the type of POS to - grub_off_t. Follow the coding standard. + * commands/cmp.c (VasEBoot_cmd_cmp): Do not use ERR, but use + VasEBoot_ERRNO directly instead. Change the type of POS to + VasEBoot_off_t. Follow the coding standard. - * commands/blocklist.c: Include grub/partition.h. - (grub_cmd_blocklist): Return an error if the underlying device is + * commands/blocklist.c: Include VasEBoot/partition.h. + (VasEBoot_cmd_blocklist): Return an error if the underlying device is not a disk. Take the starting sector of a partition into account, if a partition is used. @@ -49651,8 +49651,8 @@ 2006-06-04 Yoshinori K. Okuji - * DISTLIST: Added include/grub/i386/linux.h. Removed - include/grub/i386/pc/linux.h + * DISTLIST: Added include/VasEBoot/i386/linux.h. Removed + include/VasEBoot/i386/pc/linux.h * configure.ac (AC_INIT): Bumped to 1.94. @@ -49663,19 +49663,19 @@ 2006-06-02 Yoshinori K. Okuji - * conf/common.rmk (grub_modules_init.lst): Depended on - grub_emu_SOURCES, excluding grub_emu_init.c, instead of + * conf/common.rmk (VasEBoot_modules_init.lst): Depended on + VasEBoot_emu_SOURCES, excluding VasEBoot_emu_init.c, instead of MODSRCFILES. * genmk.rb (PModule::rule): Reverted the previous change. 2006-06-02 Yoshinori K. Okuji - * conf/common.rmk (grub_modules_init.lst): Depends on + * conf/common.rmk (VasEBoot_modules_init.lst): Depends on $(MODSRCFILES). Grep only the files in $(MODSRCFILES). Make sure that the target does not exist before producing. - (grub_modules_init.h): Remove the target before generating. - (grub_emu_init.c): Likewise. + (VasEBoot_modules_init.h): Remove the target before generating. + (VasEBoot_emu_init.c): Likewise. * genmk.rb (PModule::rule): Add source files into MODSRCFILES. @@ -49703,52 +49703,52 @@ 2006-05-29 Yoshinori K. Okuji - * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. + * util/powerpc/ieee1275/VasEBoot-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. - * util/i386/pc/grub-install.in (host_cpu): Removed. + * util/i386/pc/VasEBoot-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. - * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P - instead of GRUB_HOST_SIZEOF_VOID_P. + * kern/efi/mm.c (filter_memory_map): Use VasEBoot_CPU_SIZEOF_VOID_P + instead of VasEBoot_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. - * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to + * include/VasEBoot/i386/types.h (VasEBoot_HOST_SIZEOF_VOID_P): Renamed to ... - (GRUB_TARGET_SIZEOF_VOID_P): ... this. - (GRUB_HOST_SIZEOF_LONG): Renamed to ... - (GRUB_TARGET_SIZEOF_LONG): ... this. - (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... - (GRUB_TARGET_WORDS_BIGENDIAN): ... this. - * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed + (VasEBoot_TARGET_SIZEOF_VOID_P): ... this. + (VasEBoot_HOST_SIZEOF_LONG): Renamed to ... + (VasEBoot_TARGET_SIZEOF_LONG): ... this. + (VasEBoot_HOST_WORDS_BIGENDIAN): Renamed to ... + (VasEBoot_TARGET_WORDS_BIGENDIAN): ... this. + * include/VasEBoot/powerpc/types.h (VasEBoot_HOST_SIZEOF_VOID_P): Renamed to ... - (GRUB_TARGET_SIZEOF_VOID_P): ... this. - (GRUB_HOST_SIZEOF_LONG): Renamed to ... - (GRUB_TARGET_SIZEOF_LONG): ... this. - (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... - (GRUB_TARGET_WORDS_BIGENDIAN): ... this. - * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed + (VasEBoot_TARGET_SIZEOF_VOID_P): ... this. + (VasEBoot_HOST_SIZEOF_LONG): Renamed to ... + (VasEBoot_TARGET_SIZEOF_LONG): ... this. + (VasEBoot_HOST_WORDS_BIGENDIAN): Renamed to ... + (VasEBoot_TARGET_WORDS_BIGENDIAN): ... this. + * include/VasEBoot/sparc64/types.h (VasEBoot_HOST_SIZEOF_VOID_P): Renamed to ... - (GRUB_TARGET_SIZEOF_VOID_P): ... this. - (GRUB_HOST_SIZEOF_LONG): Renamed to ... - (GRUB_TARGET_SIZEOF_LONG): ... this. - (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... - (GRUB_TARGET_WORDS_BIGENDIAN): ... this. + (VasEBoot_TARGET_SIZEOF_VOID_P): ... this. + (VasEBoot_HOST_SIZEOF_LONG): Renamed to ... + (VasEBoot_TARGET_SIZEOF_LONG): ... this. + (VasEBoot_HOST_WORDS_BIGENDIAN): Renamed to ... + (VasEBoot_TARGET_WORDS_BIGENDIAN): ... this. - * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use - GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. - [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG - instead of GRUB_HOST_SIZEOF_LONG. - [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of - GRUB_HOST_WORDS_BIGENDIAN to define or undefine - GRUB_CPU_WORDS_BIGENDIAN. - Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to - define grub_host_addr_t, grub_host_off_t, grub_host_size_t and - grub_host_ssize_t. + * include/VasEBoot/types.h [!VasEBoot_UTIL] (VasEBoot_CPU_SIZEOF_VOID_P): Use + VasEBoot_TARGET_SIZEOF_VOID_P instead of VasEBoot_HOST_SIZEOF_VOID_P. + [!VasEBoot_UTIL] (VasEBoot_CPU_SIZEOF_LONG): Use VasEBoot_TARGET_SIZEOF_LONG + instead of VasEBoot_HOST_SIZEOF_LONG. + [!VasEBoot_UTIL]: Refer to VasEBoot_TARGET_WORDS_BIGENDIAN instead of + VasEBoot_HOST_WORDS_BIGENDIAN to define or undefine + VasEBoot_CPU_WORDS_BIGENDIAN. + Refer to SIZEOF_VOID_P instead of VasEBoot_HOST_SIZEOF_VOID_P to + define VasEBoot_host_addr_t, VasEBoot_host_off_t, VasEBoot_host_size_t and + VasEBoot_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. @@ -49777,7 +49777,7 @@ * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. - (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". + (CPPFLAGS): Added @CPPFLAGS@ and -DVasEBoot_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. @@ -49793,29 +49793,29 @@ 2006-05-29 Vesa Jaaskelainen - * include/grub/script.h (grub_script_cmdif): Renamed field 'bool' to + * include/VasEBoot/script.h (VasEBoot_script_cmdif): Renamed field 'bool' to 'exec_to_evaluate'. Renamed field 'true' to 'exec_on_true'. Renamed field 'false' to 'exec_on_false'. - (grub_script_create_cmdif): Renamed argument names to reflect above + (VasEBoot_script_create_cmdif): Renamed argument names to reflect above changes. - * normal/execute.c (grub_script_execute_cmdif): Likewise. + * normal/execute.c (VasEBoot_script_execute_cmdif): Likewise. - * normal/script.c (grub_script_create_cmdif): Likewise. + * normal/script.c (VasEBoot_script_create_cmdif): Likewise. 2006-05-28 Yoshinori K. Okuji - * fs/hfsplus.c (grub_hfsplus_btree_recoffset): Moved to near the + * fs/hfsplus.c (VasEBoot_hfsplus_btree_recoffset): Moved to near the top. - (grub_hfsplus_btree_recptr): Likewise. - (grub_hfsplus_find_block): Do not take RETRY any longer. Use + (VasEBoot_hfsplus_btree_recptr): Likewise. + (VasEBoot_hfsplus_find_block): Do not take RETRY any longer. Use FILEBLOCK both to pass a block number and store next block number. - (grub_hfsplus_read_block): Rewritten heavily to support an extent + (VasEBoot_hfsplus_read_block): Rewritten heavily to support an extent overflow file correctly. Specify errors appropriately, because - fshelp expects that GRUB_ERRNO is set when fails. Reuse - grub_hfsplus_btree_recptr to get the pointer to a found key. - (grub_hfsplus_btree_search): Return 1 instead of 0 when no match + fshelp expects that VasEBoot_ERRNO is set when fails. Reuse + VasEBoot_hfsplus_btree_recptr to get the pointer to a found key. + (VasEBoot_hfsplus_btree_search): Return 1 instead of 0 when no match is found. * conf/i386-efi.rmk (pkgdata_MODULES): Added _linux.mod and @@ -49829,11 +49829,11 @@ * DISTLIST: Added loader/i386/efi/linux.c, loader/i386/efi/linux_normal.c and - include/grub/i386/efi/loader.h. + include/VasEBoot/i386/efi/loader.h. * loader/i386/efi/linux.c: New file. * loader/i386/efi/linux_normal.c: Likewise. - * include/grub/i386/efi/loader.h: Likewise. + * include/VasEBoot/i386/efi/loader.h: Likewise. 2006-05-27 Yoshinori K. Okuji @@ -49841,30 +49841,30 @@ * DISTLIST: Added commands/blocklist.c. - * term/efi/console.c (grub_console_highlight_color): Use a lighter + * term/efi/console.c (VasEBoot_console_highlight_color): Use a lighter color for the background, and a darker color for the foreground. - (grub_console_checkkey): Return READ_KEY. - (grub_console_cls): Set the background to - GRUB_EFI_BACKGROUND_BLACK temporarily to clean out the screen. + (VasEBoot_console_checkkey): Return READ_KEY. + (VasEBoot_console_cls): Set the background to + VasEBoot_EFI_BACKGROUND_BLACK temporarily to clean out the screen. - * kern/efi/efi.c (grub_efi_exit_boot_services): New function. + * kern/efi/efi.c (VasEBoot_efi_exit_boot_services): New function. - * include/grub/i386/linux.h (struct linux_kernel_params): Fixed + * include/VasEBoot/i386/linux.h (struct linux_kernel_params): Fixed the size of "padding5", "hd0_drive_info" and "hd1_drive_info". - * include/grub/efi/efi.h (grub_efi_exit_boot_services): New + * include/VasEBoot/efi/efi.h (VasEBoot_efi_exit_boot_services): New prototype. - * include/grub/efi/api.h (GRUB_EFI_TEXT_ATTR): Do not shift + * include/VasEBoot/efi/api.h (VasEBoot_EFI_TEXT_ATTR): Do not shift BG. The spec is wrong again. - * include/grub/normal.h [GRUB_UTIL] (grub_blocklist_init): New + * include/VasEBoot/normal.h [VasEBoot_UTIL] (VasEBoot_blocklist_init): New prototype. - [GRUB_UTIL] (grub_blocklist_fini): Likewise. + [VasEBoot_UTIL] (VasEBoot_blocklist_fini): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added commands/blocklist.c. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. * conf/common.rmk (pkgdata_MODULES): Added blocklist.mod. (blocklist_mod_SOURCES): New variable. @@ -49879,46 +49879,46 @@ 2006-05-20 Marco Gerards - * normal/lexer.c (grub_script_yylex): Don't filter out newlines. + * normal/lexer.c (VasEBoot_script_yylex): Don't filter out newlines. * normal/parser.y (commandblock): Defined as . A subroutine for `menuentry'. (script): Accept leading newlines. (newlines): New rule to describe 0 or more newlines. (commands): Accept `command' with trailing newline. Fixed the - order in which arguments were passed to `grub_script_add_cmd'. + order in which arguments were passed to `VasEBoot_script_add_cmd'. Accept commands separated by newlines. (function): Changed to accept newlines. (menuentry) Rewritten. - * normal/script.c (grub_script_create_cmdmenu): Add new entries in + * normal/script.c (VasEBoot_script_create_cmdmenu): Add new entries in front of the list, instead of to the end. 2006-05-19 Yoshinori K. Okuji - * util/i386/pc/grub-install.in (bindir): New variable. - (grub_mkimage): Use BINDIR instead of SBINDIR. Reported by Lee + * util/i386/pc/VasEBoot-install.in (bindir): New variable. + (VasEBoot_mkimage): Use BINDIR instead of SBINDIR. Reported by Lee Shaver . 2006-05-14 Yoshinori K. Okuji - * kern/i386/pc/startup.S: Include grub/cpu/linux.h instead of - grub/machine/linux.h + * kern/i386/pc/startup.S: Include VasEBoot/cpu/linux.h instead of + VasEBoot/machine/linux.h * loader/i386/pc/linux.c: Likewise. - * include/grub/i386/pc/linux.h: Moved to ... - * include/grub/i386/linux.h: ... here. + * include/VasEBoot/i386/pc/linux.h: Moved to ... + * include/VasEBoot/i386/linux.h: ... here. - * include/grub/i386/linux.h (struct linux_kernel_params): New + * include/VasEBoot/i386/linux.h (struct linux_kernel_params): New struct. 2006-05-09 Vesa Jaaskelainen - * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Corrected bounds + * video/i386/pc/vbe.c (VasEBoot_video_vbe_fill_rect): Corrected bounds checking. - (grub_video_vbe_blit_glyph): Likewise. - (grub_video_vbe_blit_bitmap): Likewise. - (grub_video_vbe_blit_render_target): Likewise. + (VasEBoot_video_vbe_blit_glyph): Likewise. + (VasEBoot_video_vbe_blit_bitmap): Likewise. + (VasEBoot_video_vbe_blit_render_target): Likewise. 2006-05-09 Yoshinori K. Okuji @@ -49927,49 +49927,49 @@ 2006-05-08 Marco Gerards - * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Renamed from + * conf/powerpc-ieee1275.rmk (VasEBootof_HEADERS): Renamed from this... (kernel_elf_HEADERS): ...to this. Updated all users. - (grubof_symlist.c): Renamed from this... + (VasEBootof_symlist.c): Renamed from this... (kernel_elf_symlist.c): ...to this. Updated all users. - (pkgdata_PROGRAMS): Changed `grubof' to `kernel.elf'. - (grubof_SOURCES): Renamed from this... + (pkgdata_PROGRAMS): Changed `VasEBootof' to `kernel.elf'. + (VasEBootof_SOURCES): Renamed from this... (kernel_elf_SOURCES): ...to this. - (grubof_HEADERS): Renamed from this... + (VasEBootof_HEADERS): Renamed from this... (kernel_elf_HEADERS): ...to this. - (grubof_CFLAGS): Renamed from this... + (VasEBootof_CFLAGS): Renamed from this... (kernel_elf_CFLAGS): ...to this. - (grubof_ASFLAGS): Renamed from this... + (VasEBootof_ASFLAGS): Renamed from this... (kernel_elf_ASFLAGS): ...to this. - (grubof_LDFLAGS): Renamed from this... + (VasEBootof_LDFLAGS): Renamed from this... (kernel_elf_LDFLAGS): ...to this. - * conf/sparc64-ieee1275.rmk (grubof_HEADERS): Renamed from + * conf/sparc64-ieee1275.rmk (VasEBootof_HEADERS): Renamed from this... (kernel_elf_HEADERS): ...to this. Updated all users. - (grubof_symlist.c): Renamed from this... + (VasEBootof_symlist.c): Renamed from this... (kernel_elf_symlist.c): ...to this. Updated all users. - (pkgdata_PROGRAMS): Changed `grubof' to `kernel.elf'. - (grubof_SOURCES): Renamed from this... + (pkgdata_PROGRAMS): Changed `VasEBootof' to `kernel.elf'. + (VasEBootof_SOURCES): Renamed from this... (kernel_elf_SOURCES): ...to this. - (grubof_HEADERS): Renamed from this... + (VasEBootof_HEADERS): Renamed from this... (kernel_elf_HEADERS): ...to this. - (grubof_CFLAGS): Renamed from this... + (VasEBootof_CFLAGS): Renamed from this... (kernel_elf_CFLAGS): ...to this. - (grubof_ASFLAGS): Renamed from this... + (VasEBootof_ASFLAGS): Renamed from this... (kernel_elf_ASFLAGS): ...to this. - (grubof_LDFLAGS): Renamed from this... + (VasEBootof_LDFLAGS): Renamed from this... (kernel_elf_LDFLAGS): ...to this. - * util/powerpc/ieee1275/grub-mkimage.c (add_segments): Use - `kernel.elf' instead of `grubof'. + * util/powerpc/ieee1275/VasEBoot-mkimage.c (add_segments): Use + `kernel.elf' instead of `VasEBootof'. 2006-05-08 Yoshinori K. Okuji Add --with-platform to configure. Use pkglibdir instead of pkgdatadir. This is reported by Roger Leigh. - * util/powerpc/ieee1275/grub-install.in (datadir): Removed. + * util/powerpc/ieee1275/VasEBoot-install.in (datadir): Removed. (host_vendor): Likewise. (host_os): Likewise. (pkgdatadir): Likewise. @@ -49977,7 +49977,7 @@ (pkglibdir): Likewise. Use PKGLIBDIR instead of PKGDATADIR. - * util/i386/pc/grub-install.in (datadir): Removed. + * util/i386/pc/VasEBoot-install.in (datadir): Removed. (host_vendor): Likewise. (host_os): Likewise. (pkgdatadir): Likewise. @@ -49985,12 +49985,12 @@ (pkglibdir): Likewise. Use PKGLIBDIR instead of PKGDATADIR. - * util/powerpc/ieee1275/grub-mkimage.c (usage): Use GRUB_LIBDIR - instead of GRUB_DATADIR. + * util/powerpc/ieee1275/VasEBoot-mkimage.c (usage): Use VasEBoot_LIBDIR + instead of VasEBoot_DATADIR. (main): Likewise. - * util/i386/pc/grub-mkimage.c (usage): Likewise. + * util/i386/pc/VasEBoot-mkimage.c (usage): Likewise. (main): Likewise. - * util/i386/efi/grub-mkimage.c (usage): Likewise. + * util/i386/efi/VasEBoot-mkimage.c (usage): Likewise. (main): Likewise. * configure.ac (--with-platform): New option. @@ -50002,7 +50002,7 @@ (pkglibdir): Appended by the machine type. (host_vendor): Removed. (platform): New variable. - (BUILD_CPPFLAGS): Specify GRUB_LIBDIR instead of GRUB_DATADIR. + (BUILD_CPPFLAGS): Specify VasEBoot_LIBDIR instead of VasEBoot_DATADIR. (install-local): Use PKGLIBDIR instead of PKGDATADIR. (uninstall): Likewise. @@ -50011,7 +50011,7 @@ Use the environment context in the menu. Remove the commands "default" and "timeout", and use variables instead. - * normal/menu.c: Include grub/env.h. + * normal/menu.c: Include VasEBoot/env.h. (print_entry): Cast TITLE to silence gcc. (get_timeout): New function. (set_timeout): Likewise. @@ -50020,42 +50020,42 @@ in the environment variables "default", "fallback" and "timeout". Also, tweak the default entry if it is not within the current menu entries. - (grub_menu_run): Use a fallback entry in the environment variable + (VasEBoot_menu_run): Use a fallback entry in the environment variable "fallback". * normal/main.c (read_config_file): Do not initialize NEWMENU->DEFAULT_ENTRY, NEWMENU->FALLBACK_ENTRY or NEWMENU->TIMEOUT. - (grub_normal_execute): Use a data slot to store the menu. + (VasEBoot_normal_execute): Use a data slot to store the menu. - * include/grub/normal.h (struct grub_menu): Removed default_entry, + * include/VasEBoot/normal.h (struct VasEBoot_menu): Removed default_entry, fallback_entry and timeout. - (struct grub_menu_list): Removed. - (grub_menu_list_t): Likewise. - (struct grub_context): Likewise. - (grub_context_t): Likewise. - (grub_context_get): Likewise. - (grub_context_get_current_menu): Likewise. - (grub_context_push_menu): Likewise. - (grub_context_pop_menu): Likewise. - (grub_default_init): Likewise. - (grub_default_fini): Likewise. - (grub_timeout_init): Likewise. - (grub_timeout_fini): Likewise. + (struct VasEBoot_menu_list): Removed. + (VasEBoot_menu_list_t): Likewise. + (struct VasEBoot_context): Likewise. + (VasEBoot_context_t): Likewise. + (VasEBoot_context_get): Likewise. + (VasEBoot_context_get_current_menu): Likewise. + (VasEBoot_context_push_menu): Likewise. + (VasEBoot_context_pop_menu): Likewise. + (VasEBoot_default_init): Likewise. + (VasEBoot_default_fini): Likewise. + (VasEBoot_timeout_init): Likewise. + (VasEBoot_timeout_fini): Likewise. * conf/sparc64-ieee1275.rmk (pkgdata_MODULES): Removed default.mod and timeout.mod. (normal_mod_SOURCES): Removed normal/context.c. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Removed + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. - * conf/i386-pc.rmk (grub_emu_SOURCES): Removed commands/default.c, + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. - * conf/i386-efi.rmk (grub_emu_SOURCES): Removed + * conf/i386-efi.rmk (VasEBoot_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. @@ -50077,60 +50077,60 @@ 2006-05-07 Vesa Jaaskelainen - * kern/i386/pc/startup.S (grub_exit): Added missing .code32 tag. + * kern/i386/pc/startup.S (VasEBoot_exit): Added missing .code32 tag. 2006-05-02 Yoshinori K. Okuji - * kern/env.c (struct grub_env_context): Removed "sorted". Renamed + * kern/env.c (struct VasEBoot_env_context): Removed "sorted". Renamed "next" to "prev" for readability. - (struct grub_env_sorted_var): New struct. - (grub_env_context): Renamed to ... + (struct VasEBoot_env_sorted_var): New struct. + (VasEBoot_env_context): Renamed to ... (initial_context): ... this. - (grub_env_var_context): Renamed to ... + (VasEBoot_env_var_context): Renamed to ... (current_context): ... this. - (grub_env_find): Look only at CURRENT_CONTEXT. - (grub_env_context_open): Rewritten to copy exported variables from + (VasEBoot_env_find): Look only at CURRENT_CONTEXT. + (VasEBoot_env_context_open): Rewritten to copy exported variables from previous context. - (grub_env_context_close): Rewritten according to the new + (VasEBoot_env_context_close): Rewritten according to the new scheme. Also, add an assertion to prevent the initial context from removed. - (grub_env_insert): Removed the code for the sorted list. - (grub_env_remove): Likewise. - (grub_env_export): Simply mark the variable with - GRUB_ENV_VAR_GLOBAL. - (grub_env_set): A cosmetic change for naming consistency. - (grub_env_get): Likewise. - (grub_env_unset): Likewise. - (grub_env_iterate): Rewritten to sort variables within this + (VasEBoot_env_insert): Removed the code for the sorted list. + (VasEBoot_env_remove): Likewise. + (VasEBoot_env_export): Simply mark the variable with + VasEBoot_ENV_VAR_GLOBAL. + (VasEBoot_env_set): A cosmetic change for naming consistency. + (VasEBoot_env_get): Likewise. + (VasEBoot_env_unset): Likewise. + (VasEBoot_env_iterate): Rewritten to sort variables within this function. - (grub_register_variable_hook): Fixed for naming consistency. Call - grub_env_find again, only if NAME is not found at the first time. + (VasEBoot_register_variable_hook): Fixed for naming consistency. Call + VasEBoot_env_find again, only if NAME is not found at the first time. (mangle_data_slot_name): New function. - (grub_env_set_data_slot): Likewise. - (grub_env_get_data_slot): Likewise. - (grub_env_unset_data_slot): Likewise. + (VasEBoot_env_set_data_slot): Likewise. + (VasEBoot_env_get_data_slot): Likewise. + (VasEBoot_env_unset_data_slot): Likewise. - * include/grub/env.h (grub_env_var_type): New enum. - (GRUB_ENV_VAR_LOCAL): New constant. - (GRUB_ENV_VAR_GLOBAL): Likewise. - (GRUB_ENV_VAR_DATA): Likewise. - (struct grub_env_var): Removed "sort_next" and "sort_prevp". Added + * include/VasEBoot/env.h (VasEBoot_env_var_type): New enum. + (VasEBoot_ENV_VAR_LOCAL): New constant. + (VasEBoot_ENV_VAR_GLOBAL): Likewise. + (VasEBoot_ENV_VAR_DATA): Likewise. + (struct VasEBoot_env_var): Removed "sort_next" and "sort_prevp". Added "type". - (grub_env_set): Replace VAR with NAME for consistency. - (grub_register_variable_hook): Likewise. - (grub_env_export): Specify the name of the argument. - (grub_env_set_data_slot): New prototype. - (grub_env_get_data_slot): Likewise. - (grub_env_unset_data_slot): Likewise. + (VasEBoot_env_set): Replace VAR with NAME for consistency. + (VasEBoot_register_variable_hook): Likewise. + (VasEBoot_env_export): Specify the name of the argument. + (VasEBoot_env_set_data_slot): New prototype. + (VasEBoot_env_get_data_slot): Likewise. + (VasEBoot_env_unset_data_slot): Likewise. 2006-04-30 Yoshinori K. Okuji - Extend the loader so that GRUB can accept a loader which comes - back to GRUB when a loaded image exits. Also, this change adds + Extend the loader so that VasEBoot can accept a loader which comes + back to VasEBoot when a loaded image exits. Also, this change adds support for a chainloader on EFI. - * term/efi/console.c: Include grub/misc.h. - (grub_console_checkkey): Display a scan code on the top for + * term/efi/console.c: Include VasEBoot/misc.h. + (VasEBoot_console_checkkey): Display a scan code on the top for debugging. This will be removed once the EFI port gets stable. Correct the scan code mapping. @@ -50143,42 +50143,42 @@ possible, to avoid allocating a region near to 1MB, for the MacOSX loader. - * kern/efi/init.c (grub_efi_set_prefix): Specify - GRUB_EFI_IMAGE_HANDLE to grub_efi_get_loaded_image. + * kern/efi/init.c (VasEBoot_efi_set_prefix): Specify + VasEBoot_EFI_IMAGE_HANDLE to VasEBoot_efi_get_loaded_image. - * kern/efi/efi.c (grub_efi_get_loaded_image): Accept a new + * kern/efi/efi.c (VasEBoot_efi_get_loaded_image): Accept a new argument IMAGE_HANDLE and specify it to get a loaded image. - (grub_arch_modules_addr): Specify GRUB_EFI_IMAGE_HANDLE to - grub_efi_get_loaded_image. - (grub_efi_get_filename): Divide the length by the size of - grub_efi_char16_t. - (grub_efi_get_device_path): New function. - (grub_efi_print_device_path): Print End Device Path nodes. Divide - the length by the size of grub_efi_char16_t for a file path device + (VasEBoot_arch_modules_addr): Specify VasEBoot_EFI_IMAGE_HANDLE to + VasEBoot_efi_get_loaded_image. + (VasEBoot_efi_get_filename): Divide the length by the size of + VasEBoot_efi_char16_t. + (VasEBoot_efi_get_device_path): New function. + (VasEBoot_efi_print_device_path): Print End Device Path nodes. Divide + the length by the size of VasEBoot_efi_char16_t for a file path device path node. - * kern/loader.c (grub_loader_noreturn): New variable. - (grub_loader_set): Accept a new argument NORETURN. Set - GRUB_LOADER_NORETURN to NORETURN. + * kern/loader.c (VasEBoot_loader_noreturn): New variable. + (VasEBoot_loader_set): Accept a new argument NORETURN. Set + VasEBoot_LOADER_NORETURN to NORETURN. All callers changed. - (grub_loader_boot): If GRUB_LOADER_NORETURN is false, do not call - grub_machine_fini. + (VasEBoot_loader_boot): If VasEBoot_LOADER_NORETURN is false, do not call + VasEBoot_machine_fini. - * include/grub/efi/efi.h (grub_efi_get_device_path): New + * include/VasEBoot/efi/efi.h (VasEBoot_efi_get_device_path): New prototype. - (grub_efi_get_loaded_image): Take an argument to specify an image + (VasEBoot_efi_get_loaded_image): Take an argument to specify an image handle. - * include/grub/loader.h (grub_loader_set): Added one more argument + * include/VasEBoot/loader.h (VasEBoot_loader_set): Added one more argument NORETURN. - * disk/efi/efidisk.c (make_devices): Use grub_efi_get_device_path - instead of grub_efi_open_protocol. - (grub_efidisk_get_device_name): Likewise. - (grub_efidisk_close): Print a newline. - (grub_efidisk_get_device_handle): Fixed to use - GRUB_EFI_DEVICE_PATH_SUBTYPE instead of - GRUB_EFI_DEVICE_PATH_TYPE. + * disk/efi/efidisk.c (make_devices): Use VasEBoot_efi_get_device_path + instead of VasEBoot_efi_open_protocol. + (VasEBoot_efidisk_get_device_name): Likewise. + (VasEBoot_efidisk_close): Print a newline. + (VasEBoot_efidisk_get_device_handle): Fixed to use + VasEBoot_EFI_DEVICE_PATH_SUBTYPE instead of + VasEBoot_EFI_DEVICE_PATH_TYPE. * disk/efi/efidisk.c (device_path_guid): Moved to ... * kern/efi/efi.c (device_path_guid): ... here. @@ -50193,144 +50193,144 @@ (chain_mod_CFLAGS): Likewise. (chain_mod_LDFLAGS): Likewise. - * DISTLIST: Added include/grub/efi/chainloader.h, + * DISTLIST: Added include/VasEBoot/efi/chainloader.h, loader/efi/chainloader.c and loader/efi/chainloader_normal.c. - * include/grub/efi/chainloader.h: New file. + * include/VasEBoot/efi/chainloader.h: New file. * loader/efi/chainloader.c: Likewise. * loader/efi/chainloader_normal.c: Likewise. 2006-04-30 Marco Gerards - * commands/configfile.c (grub_cmd_source): New function. - (GRUB_MOD_INIT): Register the commands `source' and `.'. - (GRUB_MOD_FINI): De-register the commands `source' and `.'. + * commands/configfile.c (VasEBoot_cmd_source): New function. + (VasEBoot_MOD_INIT): Register the commands `source' and `.'. + (VasEBoot_MOD_FINI): De-register the commands `source' and `.'. 2006-04-30 Marco Gerards - * normal/execute.c (grub_script_execute_cmd): Change the return - type to `grub_err_t'. Correctly return the error. - (grub_script_execute_cmdline): In case a command line is not a + * normal/execute.c (VasEBoot_script_execute_cmd): Change the return + type to `VasEBoot_err_t'. Correctly return the error. + (VasEBoot_script_execute_cmdline): In case a command line is not a command or a function, try to interpret it as an assignment. 2006-04-30 Yoshinori K. Okuji - * fs/hfsplus.c (grub_hfsplus_read_block): Fixed a memory leak. - (grub_hfsplus_iterate_dir): Reordered to skip unknown nodes. Also, + * fs/hfsplus.c (VasEBoot_hfsplus_read_block): Fixed a memory leak. + (VasEBoot_hfsplus_iterate_dir): Reordered to skip unknown nodes. Also, skip a node whose name is obviously invalid as UTF-16, i.e. contains a NUL character. Stop the iteration when the last directory entry is found. Instead of using the return value of - grub_hfsplus_btree_iterate_node, store the value in RET and use + VasEBoot_hfsplus_btree_iterate_node, store the value in RET and use it, because the iterator can be stopped by the last directory entry. 2006-04-30 Marco Gerards - * include/grub/env.h (grub_env_export): New prototype. Reported + * include/VasEBoot/env.h (VasEBoot_env_export): New prototype. Reported by Jan C. Kleinsorge . 2006-04-30 Marco Gerards - * fs/hfsplus.c (grub_hfsplus_iterate_dir): Correctly calculate the + * fs/hfsplus.c (VasEBoot_hfsplus_iterate_dir): Correctly calculate the size of the extents in a catalog file record. 2006-04-29 Marco Gerards - * commands/configfile.c (grub_cmd_configfile): Execute the + * commands/configfile.c (VasEBoot_cmd_configfile): Execute the configfile within its own context. - * include/grub/env.h (grub_env_context_open): New prototype. - (grub_env_context_close): Likewise. + * include/VasEBoot/env.h (VasEBoot_env_context_open): New prototype. + (VasEBoot_env_context_close): Likewise. - * kern/env.c (grub_env): Removed. - (grub_env_sorted): Likewise. - (grub_env_context): New variable. - (grub_env_var_context): Likewise. - (grub_env_find): Search both the active context and the global + * kern/env.c (VasEBoot_env): Removed. + (VasEBoot_env_sorted): Likewise. + (VasEBoot_env_context): New variable. + (VasEBoot_env_var_context): Likewise. + (VasEBoot_env_find): Search both the active context and the global context. - (grub_env_context_open): New function. - (grub_env_context_close): Likewise. - (grub_env_insert): Likewise. - (grub_env_remove): Likewise. - (grub_env_export): Likewise. - (grub_env_set): Changed to use helper functions to avoid code + (VasEBoot_env_context_open): New function. + (VasEBoot_env_context_close): Likewise. + (VasEBoot_env_insert): Likewise. + (VasEBoot_env_remove): Likewise. + (VasEBoot_env_export): Likewise. + (VasEBoot_env_set): Changed to use helper functions to avoid code duplication. - (grub_env_iterate): Rewritten so both the current context and the + (VasEBoot_env_iterate): Rewritten so both the current context and the global context are being used. * normal/command.c (export_command): New function. - (grub_command_init): Register the `export' function. + (VasEBoot_command_init): Register the `export' function. 2006-04-26 Yoshinori K. Okuji - * util/i386/pc/grub-mkimage.c (compress_kernel): Cast arguments + * util/i386/pc/VasEBoot-mkimage.c (compress_kernel): Cast arguments explicitly to suppress gcc's warnings. - * fs/fat.c (grub_fat_find_dir): Likewise. - (grub_fat_label): Likewise. - * fs/xfs.c (grub_xfs_read_inode): Likewise. - (grub_xfs_mount): Likewise. - (grub_xfs_label): Likewise. - * fs/affs.c (grub_affs_mount): Likewise. - (grub_affs_label): Likewise. - (grub_affs_iterate_dir): Likewise. - * fs/sfs.c (grub_sfs_mount): Likewise. - (grub_sfs_iterate_dir): Likewise. - * fs/ufs.c (grub_ufs_lookup_symlink): Likewise. - * fs/hfs.c (grub_hfs_mount): Likewise. - (grub_hfs_cmp_catkeys): Likewise. - (grub_hfs_find_dir): Likewise. - (grub_hfs_dir): Likewise. - (grub_hfs_label): Likewise. - * fs/jfs.c (grub_jfs_mount): Likewise. - (grub_jfs_opendir): Likewise. - (grub_jfs_getent): Likewise. - (grub_jfs_lookup_symlink): Likewise. - (grub_jfs_label): Likewise. - * fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise. - (grub_hfsplus_iterate_dir): Likewise. - (grub_hfsplus_btree_iterate_node): Made static. + * fs/fat.c (VasEBoot_fat_find_dir): Likewise. + (VasEBoot_fat_label): Likewise. + * fs/xfs.c (VasEBoot_xfs_read_inode): Likewise. + (VasEBoot_xfs_mount): Likewise. + (VasEBoot_xfs_label): Likewise. + * fs/affs.c (VasEBoot_affs_mount): Likewise. + (VasEBoot_affs_label): Likewise. + (VasEBoot_affs_iterate_dir): Likewise. + * fs/sfs.c (VasEBoot_sfs_mount): Likewise. + (VasEBoot_sfs_iterate_dir): Likewise. + * fs/ufs.c (VasEBoot_ufs_lookup_symlink): Likewise. + * fs/hfs.c (VasEBoot_hfs_mount): Likewise. + (VasEBoot_hfs_cmp_catkeys): Likewise. + (VasEBoot_hfs_find_dir): Likewise. + (VasEBoot_hfs_dir): Likewise. + (VasEBoot_hfs_label): Likewise. + * fs/jfs.c (VasEBoot_jfs_mount): Likewise. + (VasEBoot_jfs_opendir): Likewise. + (VasEBoot_jfs_getent): Likewise. + (VasEBoot_jfs_lookup_symlink): Likewise. + (VasEBoot_jfs_label): Likewise. + * fs/hfsplus.c (VasEBoot_hfsplus_cmp_catkey): Likewise. + (VasEBoot_hfsplus_iterate_dir): Likewise. + (VasEBoot_hfsplus_btree_iterate_node): Made static. - * util/grub-emu.c (prefix): New variable. - (grub_machine_set_prefix): New function. + * util/VasEBoot-emu.c (prefix): New variable. + (VasEBoot_machine_set_prefix): New function. (main): Do not set the environment variable "prefix" here. Only - set PREFIX, which is used later by grub_machine_set_prefix. + set PREFIX, which is used later by VasEBoot_machine_set_prefix. - * include/grub/video.h: Do not include grub/symbol.h. - (grub_video_register): Not exported. This symbol is not defined in + * include/VasEBoot/video.h: Do not include VasEBoot/symbol.h. + (VasEBoot_video_register): Not exported. This symbol is not defined in the kernel. - (grub_video_unregister): Likewise. - (grub_video_iterate): Likewise. - (grub_video_setup): Likewise. - (grub_video_restore): Likewise. - (grub_video_get_info): Likewise. - (grub_video_get_blit_format): Likewise. - (grub_video_set_palette): Likewise. - (grub_video_get_palette): Likewise. - (grub_video_set_viewport): Likewise. - (grub_video_get_viewport): Likewise. - (grub_video_map_color): Likewise. - (grub_video_map_rgb): Likewise. - (grub_video_map_rgba): Likewise. - (grub_video_fill_rect): Likewise. - (grub_video_blit_glyph): Likewise. - (grub_video_blit_bitmap): Likewise. - (grub_video_blit_render_target): Likewise. - (grub_video_scroll): Likewise. - (grub_video_swap_buffers): Likewise. - (grub_video_create_render_target): Likewise. - (grub_video_delete_render_target): Likewise. - (grub_video_set_active_render_target): Likewise. + (VasEBoot_video_unregister): Likewise. + (VasEBoot_video_iterate): Likewise. + (VasEBoot_video_setup): Likewise. + (VasEBoot_video_restore): Likewise. + (VasEBoot_video_get_info): Likewise. + (VasEBoot_video_get_blit_format): Likewise. + (VasEBoot_video_set_palette): Likewise. + (VasEBoot_video_get_palette): Likewise. + (VasEBoot_video_set_viewport): Likewise. + (VasEBoot_video_get_viewport): Likewise. + (VasEBoot_video_map_color): Likewise. + (VasEBoot_video_map_rgb): Likewise. + (VasEBoot_video_map_rgba): Likewise. + (VasEBoot_video_fill_rect): Likewise. + (VasEBoot_video_blit_glyph): Likewise. + (VasEBoot_video_blit_bitmap): Likewise. + (VasEBoot_video_blit_render_target): Likewise. + (VasEBoot_video_scroll): Likewise. + (VasEBoot_video_swap_buffers): Likewise. + (VasEBoot_video_create_render_target): Likewise. + (VasEBoot_video_delete_render_target): Likewise. + (VasEBoot_video_set_active_render_target): Likewise. - * include/grub/symbol.h [GRUB_SYMBOL_GENERATOR] (EXPORT_FUNC): + * include/VasEBoot/symbol.h [VasEBoot_SYMBOL_GENERATOR] (EXPORT_FUNC): Undefined. - [GRUB_SYMBOL_GENERATOR] (EXPORT_VAR): Likewise. + [VasEBoot_SYMBOL_GENERATOR] (EXPORT_VAR): Likewise. - * conf/sparc64-ieee1275.rmk (grubof_symlist.c): Depended on + * conf/sparc64-ieee1275.rmk (VasEBootof_symlist.c): Depended on config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh instead of $(srcdir)/genkernsyms.sh. - * conf/powerpc-ieee1275.rmk (grubof_symlist.c): Depended on + * conf/powerpc-ieee1275.rmk (VasEBootof_symlist.c): Depended on config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh instead of $(srcdir)/genkernsyms.sh. @@ -50364,16 +50364,16 @@ 2006-04-25 Hollis Blanchard - * kern/powerpc/ieee1275/init.c (grub_machine_set_prefix): Do not + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_set_prefix): Do not clobber "prefix", since we may have already set it manually. 2006-04-25 Hollis Blanchard - * kern/misc.c (abort): New alias for grub_abort. + * kern/misc.c (abort): New alias for VasEBoot_abort. 2006-04-25 Yoshinori K. Okuji - A new machine-specific function "grub_machine_set_prefix" is + A new machine-specific function "VasEBoot_machine_set_prefix" is defined. This is called after loading modules, so that a prefix initialization can use modules. Also, this change adds an intensive debugging feature for the memory manager via the @@ -50383,76 +50383,76 @@ PART.LEN. * kern/sparc64/ieee1275/init.c (abort): Removed. - (grub_stop): Likewise. - (grub_exit): New function. - (grub_set_prefix): Renamed to ... - (grub_machine_set_prefix): ... this. - (grub_machine_init): Do not call grub_set_prefix. + (VasEBoot_stop): Likewise. + (VasEBoot_exit): New function. + (VasEBoot_set_prefix): Renamed to ... + (VasEBoot_machine_set_prefix): ... this. + (VasEBoot_machine_init): Do not call VasEBoot_set_prefix. - * kern/powerpc/ieee1275/init.c (grub_set_prefix): Renamed to ... - (grub_machine_set_prefix): ... this. - (grub_machine_init): Do not call grub_set_prefix. + * kern/powerpc/ieee1275/init.c (VasEBoot_set_prefix): Renamed to ... + (VasEBoot_machine_set_prefix): ... this. + (VasEBoot_machine_init): Do not call VasEBoot_set_prefix. - * kern/i386/pc/init.c (grub_machine_set_prefix): New function. - (grub_machine_init): Do not set the prefix here. + * kern/i386/pc/init.c (VasEBoot_machine_set_prefix): New function. + (VasEBoot_machine_init): Do not set the prefix here. - * kern/i386/efi/init.c (grub_machine_set_prefix): New function. + * kern/i386/efi/init.c (VasEBoot_machine_set_prefix): New function. - * kern/efi/init.c: Include grub/mm.h. - (grub_efi_set_prefix): New function. + * kern/efi/init.c: Include VasEBoot/mm.h. + (VasEBoot_efi_set_prefix): New function. - * kern/efi/efi.c (grub_exit): Call grub_efi_fini. - (grub_efi_get_filename): New function. - (grub_print_device_path): Renamed to ... - (grub_efi_print_device_path): ... this. + * kern/efi/efi.c (VasEBoot_exit): Call VasEBoot_efi_fini. + (VasEBoot_efi_get_filename): New function. + (VasEBoot_print_device_path): Renamed to ... + (VasEBoot_efi_print_device_path): ... this. - * kern/mm.c [MM_DEBUG] (grub_malloc): Undefined. - [MM_DEBUG] (grub_realloc): Likewise. - [MM_DEBUG] (grub_free): Likewise. - [MM_DEBUG] (grub_memalign): Likewise. - [MM_DEBUG] (grub_mm_debug): New variable. - [MM_DEBUG] (grub_debug_malloc): New function. - [MM_DEBUG] (grub_debug_free): New function. - [MM_DEBUG] (grub_debug_realloc): New function. - [MM_DEBUG] (grub_debug_memalign): New function. + * kern/mm.c [MM_DEBUG] (VasEBoot_malloc): Undefined. + [MM_DEBUG] (VasEBoot_realloc): Likewise. + [MM_DEBUG] (VasEBoot_free): Likewise. + [MM_DEBUG] (VasEBoot_memalign): Likewise. + [MM_DEBUG] (VasEBoot_mm_debug): New variable. + [MM_DEBUG] (VasEBoot_debug_malloc): New function. + [MM_DEBUG] (VasEBoot_debug_free): New function. + [MM_DEBUG] (VasEBoot_debug_realloc): New function. + [MM_DEBUG] (VasEBoot_debug_memalign): New function. - * kern/misc.c (grub_abort): Print a newline to distinguish + * kern/misc.c (VasEBoot_abort): Print a newline to distinguish the message. - * kern/main.c (grub_main): Call grub_machine_set_prefix and - grub_set_root_dev after loading modules. This is necessary when + * kern/main.c (VasEBoot_main): Call VasEBoot_machine_set_prefix and + VasEBoot_set_root_dev after loading modules. This is necessary when setting a prefix depends on modules. - * include/grub/efi/efi.h (grub_print_device_path): Renamed to ... - (grub_efi_print_device_path): ... this. - (grub_efi_get_filename): New prototype. - (grub_efi_set_prefix): Likewise. + * include/VasEBoot/efi/efi.h (VasEBoot_print_device_path): Renamed to ... + (VasEBoot_efi_print_device_path): ... this. + (VasEBoot_efi_get_filename): New prototype. + (VasEBoot_efi_set_prefix): Likewise. - * include/grub/efi/disk.h: Include grub/efi/api.h, grub/symbol.h - and grub/disk.h. - (grub_efidisk_get_device_handle): New prototype. - (grub_efidisk_get_device_name): Likewise. + * include/VasEBoot/efi/disk.h: Include VasEBoot/efi/api.h, VasEBoot/symbol.h + and VasEBoot/disk.h. + (VasEBoot_efidisk_get_device_handle): New prototype. + (VasEBoot_efidisk_get_device_name): Likewise. - * include/grub/mm.h: Include config.h. + * include/VasEBoot/mm.h: Include config.h. (MM_DEBUG): Removed. - [MM_DEBUG && !GRUB_UTIL] (grub_mm_debug): New prototype. - [MM_DEBUG && !GRUB_UTIL] (grub_malloc): New macro. - [MM_DEBUG && !GRUB_UTIL] (grub_realloc): Likewise. - [MM_DEBUG && !GRUB_UTIL] (grub_memalign): Likewise. - [MM_DEBUG && !GRUB_UTIL] (grub_free): Likewise. - [MM_DEBUG && !GRUB_UTIL] (grub_debug_malloc): New prototype. - [MM_DEBUG && !GRUB_UTIL] (grub_debug_realloc): New prototype. - [MM_DEBUG && !GRUB_UTIL] (grub_debug_memalign): New prototype. - [MM_DEBUG && !GRUB_UTIL] (grub_debug_free): New prototype. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_mm_debug): New prototype. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_malloc): New macro. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_realloc): Likewise. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_memalign): Likewise. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_free): Likewise. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_debug_malloc): New prototype. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_debug_realloc): New prototype. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_debug_memalign): New prototype. + [MM_DEBUG && !VasEBoot_UTIL] (VasEBoot_debug_free): New prototype. - * include/grub/kernel.h (grub_machine_set_prefix): New prototype. + * include/VasEBoot/kernel.h (VasEBoot_machine_set_prefix): New prototype. - * disk/efi/efidisk.c: Include grub/partition.h. + * disk/efi/efidisk.c: Include VasEBoot/partition.h. (iterate_child_devices): New function. (add_device): First, compare only last device path nodes, so that devices are sorted by the types. - (grub_efidisk_get_device_handle): New function. - (grub_efidisk_get_device_name): Likewise. + (VasEBoot_efidisk_get_device_handle): New function. + (VasEBoot_efidisk_get_device_name): Likewise. * configure.ac (--enable-mm-debug): New option to enable the memory manager debugging feature. This makes the binary much @@ -50460,190 +50460,190 @@ 2006-04-23 Yoshinori K. Okuji - Use grub_abort instead of grub_stop, and grub_exit must be + Use VasEBoot_abort instead of VasEBoot_stop, and VasEBoot_exit must be define in each architecture now. Also, this change adds support for EFI disks. - * util/i386/pc/grub-probefs.c: Include grub/term.h. - (grub_getkey): New function. - (grub_term_get_current): Likewise. + * util/i386/pc/VasEBoot-probefs.c: Include VasEBoot/term.h. + (VasEBoot_getkey): New function. + (VasEBoot_term_get_current): Likewise. - * util/i386/pc/grub-setup.c: Include grub/term.h. - (grub_getkey): New function. - (grub_term_get_current): Likewise. + * util/i386/pc/VasEBoot-setup.c: Include VasEBoot/term.h. + (VasEBoot_getkey): New function. + (VasEBoot_term_get_current): Likewise. - * util/misc.c (grub_stop): Renamed to ... - (grub_exit): ... this. + * util/misc.c (VasEBoot_stop): Renamed to ... + (VasEBoot_exit): ... this. * kern/powerpc/ieee1275/init.c (abort): Renamed to ... - (grub_exit): ... this. - (grub_machine_init): Use grub_abort instead of abort. - (grub_stop): Removed. + (VasEBoot_exit): ... this. + (VasEBoot_machine_init): Use VasEBoot_abort instead of abort. + (VasEBoot_stop): Removed. - * kern/powerpc/ieee1275/cmain.c (cmain): Use grub_abort instead of + * kern/powerpc/ieee1275/cmain.c (cmain): Use VasEBoot_abort instead of abort. - * kern/i386/pc/startup.S (grub_exit): New function. + * kern/i386/pc/startup.S (VasEBoot_exit): New function. (cold_reboot): New label. - * kern/efi/init.c: Include grub/efi/disk.h and grub/env.h. - (grub_efi_init): Call grub_efidisk_init. - (grub_efi_fini): Call grub_efidisk_fini. + * kern/efi/init.c: Include VasEBoot/efi/disk.h and VasEBoot/env.h. + (VasEBoot_efi_init): Call VasEBoot_efidisk_init. + (VasEBoot_efi_fini): Call VasEBoot_efidisk_fini. - * kern/efi/efi.c: Include grub/mm.h. - (grub_efi_console_control_guid): Renamed to ... + * kern/efi/efi.c: Include VasEBoot/mm.h. + (VasEBoot_efi_console_control_guid): Renamed to ... (console_control_guid): ... this. - (grub_efi_loaded_image_guid): Renamed to ... + (VasEBoot_efi_loaded_image_guid): Renamed to ... (loaded_image_guid): ... this. - (grub_efi_locate_handle): New function. - (grub_efi_open_protocol): Likewise. - (grub_efi_set_text_mode): Use CONSOLE_CONTROL_GUID instead of - GRUB_EFI_CONSOLE_CONTROL_GUID. - (grub_efi_exit): Removed. - (grub_stop): Likewise. - (grub_efi_get_loaded_image): Use grub_efi_open_protocol. - (grub_exit): New function. - (grub_print_device_path): Likewise. + (VasEBoot_efi_locate_handle): New function. + (VasEBoot_efi_open_protocol): Likewise. + (VasEBoot_efi_set_text_mode): Use CONSOLE_CONTROL_GUID instead of + VasEBoot_EFI_CONSOLE_CONTROL_GUID. + (VasEBoot_efi_exit): Removed. + (VasEBoot_stop): Likewise. + (VasEBoot_efi_get_loaded_image): Use VasEBoot_efi_open_protocol. + (VasEBoot_exit): New function. + (VasEBoot_print_device_path): Likewise. - * kern/rescue.c (grub_rescue_cmd_exit): New function. - (grub_enter_rescue_mode): Register "exit". + * kern/rescue.c (VasEBoot_rescue_cmd_exit): New function. + (VasEBoot_enter_rescue_mode): Register "exit". - * kern/misc.c (grub_real_dprintf): A cosmetic change. - (grub_abort): New function. + * kern/misc.c (VasEBoot_real_dprintf): A cosmetic change. + (VasEBoot_abort): New function. - * kern/err.c (grub_fatal): Use grub_abort instead of grub_stop. + * kern/err.c (VasEBoot_fatal): Use VasEBoot_abort instead of VasEBoot_stop. - * include/grub/sparc64/ieee1275/kernel.h (abort): Removed. + * include/VasEBoot/sparc64/ieee1275/kernel.h (abort): Removed. - * include/grub/powerpc/ieee1275/kernel.h (abort): Removed. + * include/VasEBoot/powerpc/ieee1275/kernel.h (abort): Removed. - * include/grub/efi/efi.h (grub_efi_exit): Removed. - (grub_print_device_path): New prototype. - (grub_efi_locate_handle): Likewise. - (grub_efi_open_protocol): Likewise. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_exit): Removed. + (VasEBoot_print_device_path): New prototype. + (VasEBoot_efi_locate_handle): Likewise. + (VasEBoot_efi_open_protocol): Likewise. - * include/grub/efi/disk.h (grub_efidisk_fini): New file. + * include/VasEBoot/efi/disk.h (VasEBoot_efidisk_fini): New file. * disk/efi/efidisk.c: Likewise. - * DISTLIST: Added disk/efi/efidisk.c and include/grub/efi/disk.h. + * DISTLIST: Added disk/efi/efidisk.c and include/VasEBoot/efi/disk.h. - * include/grub/efi/console_control.h - (GRUB_EFI_CONSOLE_CONTROL_GUID): Use an array for the last 8 bytes. + * include/VasEBoot/efi/console_control.h + (VasEBoot_EFI_CONSOLE_CONTROL_GUID): Use an array for the last 8 bytes. - * include/grub/efi/api.h (GRUB_EFI_LOADED_IMAGE_GUID): Specify the + * include/VasEBoot/efi/api.h (VasEBoot_EFI_LOADED_IMAGE_GUID): Specify the last 8 bytes as an array. - (GRUB_EFI_DISK_IO_GUID): New macro. - (GRUB_EFI_BLOCK_IO_GUID): Likewise. - (GRUB_EFI_DEVICE_PATH_GUID): Likewise. - (grub_efi_ipv6_address_t): Change the type to grub_uint16_t from - grub_uint8_t. - (struct grub_efi_guid): Use an array to specify the last 8 bytes. - (struct grub_efi_device_path): Rename the member "sub_type" to + (VasEBoot_EFI_DISK_IO_GUID): New macro. + (VasEBoot_EFI_BLOCK_IO_GUID): Likewise. + (VasEBoot_EFI_DEVICE_PATH_GUID): Likewise. + (VasEBoot_efi_ipv6_address_t): Change the type to VasEBoot_uint16_t from + VasEBoot_uint8_t. + (struct VasEBoot_efi_guid): Use an array to specify the last 8 bytes. + (struct VasEBoot_efi_device_path): Rename the member "sub_type" to "subtype". - (GRUB_EFI_DEVICE_PATH_TYPE): New macro. - (GRUB_EFI_DEVICE_PATH_SUBTYPE): Likewise. - (GRUB_EFI_DEVICE_PATH_LENGTH): Likewise. - (GRUB_EFI_END_DEVICE_PATH_TYPE): Likewise. - (GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE): Likewise. - (GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE): Likewise. - (GRUB_EFI_END_ENTIRE_DEVICE_PATH): Likewise. - (GRUB_EFI_NEXT_DEVICE_PATH): Likewise. - (GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE): Likewise. - (GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE): Likewise. - (struct grub_efi_pci_device_path): New structure. - (grub_efi_pci_device_path_t): New type. - (GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_pccard_device_path): New structure. - (grub_efi_pccard_device_path_t): New type. - (GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_memory_mapped_device_path): New structure. - (grub_efi_memory_mapped_device_path_t): New type. - (GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_vendor_device_path): New structure. - (grub_efi_vendor_device_path_t): New type. - (GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_controller_device_path): New structure. - (grub_efi_controller_device_path_t): New type. - (GRUB_EFI_ACPI_DEVICE_PATH_TYPE): New macro. - (GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE): Likewise. - (struct grub_efi_acpi_device_path): New structure. - (grub_efi_acpi_device_path_t): New type. - (GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_expanded_acpi_device_path): New structure. - (grub_efi_expanded_acpi_device_path_t): New type. - (GRUB_EFI_EXPANDED_ACPI_HIDSTR): New macro. - (GRUB_EFI_EXPANDED_ACPI_UIDSTR): Likewise. - (GRUB_EFI_EXPANDED_ACPI_CIDSTR): Likewise. - (GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE): Likewise. - (GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE): Likewise. - (struct grub_efi_atapi_device_path): New structure. - (grub_efi_atapi_device_path_t): New type. - (GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_fibre_channel_device_path): New structure. - (grub_efi_fibre_channel_device_path_t): New type. - (GRUB_EFI_1394_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_1394_device_path): New structure. - (grub_efi_1394_device_path_t): New type. - (GRUB_EFI_USB_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_usb_device_path): New structure. - (grub_efi_usb_device_path_t): New type. - (GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_usb_class_device_path): New structure. - (grub_efi_usb_class_device_path_t): New type. - (GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_i2o_device_path): New structure. - (grub_efi_i2o_device_path_t): New type. - (GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_mac_address_device_path): New structure. - (grub_efi_mac_address_device_path_t): New type. - (GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_ipv4_device_path): New structure. - (grub_efi_ipv4_device_path_t): New type. - (GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_ipv6_device_path): New structure. - (grub_efi_ipv6_device_path_t): New type. - (GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_infiniband_device_path): New structure. - (grub_efi_infiniband_device_path_t): New type. - (GRUB_EFI_UART_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_uart_device_path): New structure. - (grub_efi_uart_device_path_t): New type. - (GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_vendor_messaging_device_path): New structure. - (grub_efi_vendor_messaging_device_path_t): New type. - (GRUB_EFI_MEDIA_DEVICE_PATH_TYPE): New macro. - (GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE): Likewise. - (struct grub_efi_hard_drive_device_path): New structure. - (grub_efi_hard_drive_device_path_t): New type. - (GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_cdrom_device_path): New structure. - (grub_efi_cdrom_device_path_t): New type. - (GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_vendor_media_device_path): New structure. - (grub_efi_vendor_media_device_path_t): New type. - (GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_file_path_device_path): New structure. - (grub_efi_file_path_device_path_t): New type. - (GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE): New macro. - (struct grub_efi_protocol_device_path): New structure. - (grub_efi_protocol_device_path_t): New type. - (GRUB_EFI_BIOS_DEVICE_PATH_TYPE): New macro. - (GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE): Likewise. - (struct grub_efi_bios_device_path): New structure. - (grub_efi_bios_device_path_t): New type. - (struct grub_efi_disk_io): New structure. - (grub_efi_disk_io_t): New type. - (struct grub_efi_block_io_media): New structure. - (grub_efi_block_io_media_t): New type. - (struct grub_efi_block_io): New structure. - (grub_efi_block_io_t): New type. + (VasEBoot_EFI_DEVICE_PATH_TYPE): New macro. + (VasEBoot_EFI_DEVICE_PATH_SUBTYPE): Likewise. + (VasEBoot_EFI_DEVICE_PATH_LENGTH): Likewise. + (VasEBoot_EFI_END_DEVICE_PATH_TYPE): Likewise. + (VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE): Likewise. + (VasEBoot_EFI_END_THIS_DEVICE_PATH_SUBTYPE): Likewise. + (VasEBoot_EFI_END_ENTIRE_DEVICE_PATH): Likewise. + (VasEBoot_EFI_NEXT_DEVICE_PATH): Likewise. + (VasEBoot_EFI_HARDWARE_DEVICE_PATH_TYPE): Likewise. + (VasEBoot_EFI_PCI_DEVICE_PATH_SUBTYPE): Likewise. + (struct VasEBoot_efi_pci_device_path): New structure. + (VasEBoot_efi_pci_device_path_t): New type. + (VasEBoot_EFI_PCCARD_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_pccard_device_path): New structure. + (VasEBoot_efi_pccard_device_path_t): New type. + (VasEBoot_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_memory_mapped_device_path): New structure. + (VasEBoot_efi_memory_mapped_device_path_t): New type. + (VasEBoot_EFI_VENDOR_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_vendor_device_path): New structure. + (VasEBoot_efi_vendor_device_path_t): New type. + (VasEBoot_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_controller_device_path): New structure. + (VasEBoot_efi_controller_device_path_t): New type. + (VasEBoot_EFI_ACPI_DEVICE_PATH_TYPE): New macro. + (VasEBoot_EFI_ACPI_DEVICE_PATH_SUBTYPE): Likewise. + (struct VasEBoot_efi_acpi_device_path): New structure. + (VasEBoot_efi_acpi_device_path_t): New type. + (VasEBoot_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_expanded_acpi_device_path): New structure. + (VasEBoot_efi_expanded_acpi_device_path_t): New type. + (VasEBoot_EFI_EXPANDED_ACPI_HIDSTR): New macro. + (VasEBoot_EFI_EXPANDED_ACPI_UIDSTR): Likewise. + (VasEBoot_EFI_EXPANDED_ACPI_CIDSTR): Likewise. + (VasEBoot_EFI_MESSAGING_DEVICE_PATH_TYPE): Likewise. + (VasEBoot_EFI_ATAPI_DEVICE_PATH_SUBTYPE): Likewise. + (struct VasEBoot_efi_atapi_device_path): New structure. + (VasEBoot_efi_atapi_device_path_t): New type. + (VasEBoot_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_fibre_channel_device_path): New structure. + (VasEBoot_efi_fibre_channel_device_path_t): New type. + (VasEBoot_EFI_1394_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_1394_device_path): New structure. + (VasEBoot_efi_1394_device_path_t): New type. + (VasEBoot_EFI_USB_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_usb_device_path): New structure. + (VasEBoot_efi_usb_device_path_t): New type. + (VasEBoot_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_usb_class_device_path): New structure. + (VasEBoot_efi_usb_class_device_path_t): New type. + (VasEBoot_EFI_I2O_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_i2o_device_path): New structure. + (VasEBoot_efi_i2o_device_path_t): New type. + (VasEBoot_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_mac_address_device_path): New structure. + (VasEBoot_efi_mac_address_device_path_t): New type. + (VasEBoot_EFI_IPV4_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_ipv4_device_path): New structure. + (VasEBoot_efi_ipv4_device_path_t): New type. + (VasEBoot_EFI_IPV6_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_ipv6_device_path): New structure. + (VasEBoot_efi_ipv6_device_path_t): New type. + (VasEBoot_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_infiniband_device_path): New structure. + (VasEBoot_efi_infiniband_device_path_t): New type. + (VasEBoot_EFI_UART_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_uart_device_path): New structure. + (VasEBoot_efi_uart_device_path_t): New type. + (VasEBoot_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_vendor_messaging_device_path): New structure. + (VasEBoot_efi_vendor_messaging_device_path_t): New type. + (VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE): New macro. + (VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE): Likewise. + (struct VasEBoot_efi_hard_drive_device_path): New structure. + (VasEBoot_efi_hard_drive_device_path_t): New type. + (VasEBoot_EFI_CDROM_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_cdrom_device_path): New structure. + (VasEBoot_efi_cdrom_device_path_t): New type. + (VasEBoot_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_vendor_media_device_path): New structure. + (VasEBoot_efi_vendor_media_device_path_t): New type. + (VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_file_path_device_path): New structure. + (VasEBoot_efi_file_path_device_path_t): New type. + (VasEBoot_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE): New macro. + (struct VasEBoot_efi_protocol_device_path): New structure. + (VasEBoot_efi_protocol_device_path_t): New type. + (VasEBoot_EFI_BIOS_DEVICE_PATH_TYPE): New macro. + (VasEBoot_EFI_BIOS_DEVICE_PATH_SUBTYPE): Likewise. + (struct VasEBoot_efi_bios_device_path): New structure. + (VasEBoot_efi_bios_device_path_t): New type. + (struct VasEBoot_efi_disk_io): New structure. + (VasEBoot_efi_disk_io_t): New type. + (struct VasEBoot_efi_block_io_media): New structure. + (VasEBoot_efi_block_io_media_t): New type. + (struct VasEBoot_efi_block_io): New structure. + (VasEBoot_efi_block_io_t): New type. - * include/grub/misc.h (grub_stop): Removed. - (grub_exit): New prototype. - (grub_abort): Likewise. + * include/VasEBoot/misc.h (VasEBoot_stop): Removed. + (VasEBoot_exit): New prototype. + (VasEBoot_abort): Likewise. - * include/grub/disk.h (enum grub_disk_dev_id): Added - GRUB_DISK_DEVICE_EFIDISK_ID. + * include/VasEBoot/disk.h (enum VasEBoot_disk_dev_id): Added + VasEBoot_DISK_DEVICE_EFIDISK_ID. * conf/i386-efi.rmk (kernel_mod_SOURCES): Added disk/efi/efidisk.c. @@ -50651,13 +50651,13 @@ 2006-04-22 Yoshinori K. Okuji - * kern/misc.c (grub_lltoa): Rewritten the decimal conversion part, + * kern/misc.c (VasEBoot_lltoa): Rewritten the decimal conversion part, as it was simply too buggy. 2006-04-21 Yoshinori K. Okuji - * kern/misc.c (grub_lltoa): New function. - (grub_vsprintf): Added support for the long long suffix, + * kern/misc.c (VasEBoot_lltoa): New function. + (VasEBoot_vsprintf): Added support for the long long suffix, i.e. "ll". 2006-04-20 Hollis Blanchard @@ -50667,7 +50667,7 @@ * configure.ac: Add -m32 to LDFLAGS. * genmk.rb (PModule#rule): Use $(CC) instead of $(LD). * conf/powerpc-ieee1275.rmk (COMMON_LDFLAGS): Add variable. - (grubof_LDFLAGS): Use $(COMMON_LDFLAGS). + (VasEBootof_LDFLAGS): Use $(COMMON_LDFLAGS). (_linux_mod_LDFLAGS, linux_mod_LDFLAGS, normal_mod_LDFLAGS, suspend_mod_LDFLAGS, reboot_mod_LDFLAGS, halt_mod_LDFLAGS): New variables. @@ -50677,108 +50677,108 @@ 2006-04-20 Vesa Jaaskelainen - * term/gfxterm.c (grub_gfxterm_getcharwidth): Fixed character + * term/gfxterm.c (VasEBoot_gfxterm_getcharwidth): Fixed character length for unknown glyph. 2006-04-20 Yoshinori K. Okuji Add support for pre-loaded modules into the EFI port. - * util/i386/efi/grub-mkimage.c (make_mods_section): Rewritten + * util/i386/efi/VasEBoot-mkimage.c (make_mods_section): Rewritten completely. Accept one more argument DIR. The caller has changed. - * kern/i386/efi/init.c (grub_arch_modules_addr): Removed. + * kern/i386/efi/init.c (VasEBoot_arch_modules_addr): Removed. - * kern/efi/efi.c: Include grub/efi/pe32.h and grub/kernel.h. - (grub_efi_loaded_image_guid): New variable. - (grub_efi_get_loaded_image): New function. - (grub_arch_modules_addr): Likewise. + * kern/efi/efi.c: Include VasEBoot/efi/pe32.h and VasEBoot/kernel.h. + (VasEBoot_efi_loaded_image_guid): New variable. + (VasEBoot_efi_get_loaded_image): New function. + (VasEBoot_arch_modules_addr): Likewise. - * include/grub/efi/efi.h (grub_efi_get_loaded_image): New + * include/VasEBoot/efi/efi.h (VasEBoot_efi_get_loaded_image): New prototype. - * include/grub/efi/api.h (GRUB_EFI_LOADED_IMAGE_GUID): New macro. - (struct grub_efi_loaded_image): New structure. - (grub_efi_loaded_image_t): New type. + * include/VasEBoot/efi/api.h (VasEBoot_EFI_LOADED_IMAGE_GUID): New macro. + (struct VasEBoot_efi_loaded_image): New structure. + (VasEBoot_efi_loaded_image_t): New type. 2006-04-20 Yoshinori K. Okuji - * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Compare the file - size with GRUB_OS_AREA_SIZE as grub_size_t instead of - grub_ssize_t. Reported by Jeff Chua . + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_linux): Compare the file + size with VasEBoot_OS_AREA_SIZE as VasEBoot_size_t instead of + VasEBoot_ssize_t. Reported by Jeff Chua . 2006-04-19 Roger Leigh - * DISTLIST: Added `util/powerpc/ieee1275/grub-install.in'. + * DISTLIST: Added `util/powerpc/ieee1275/VasEBoot-install.in'. 2006-04-19 Yoshinori K. Okuji - * DISTLIST: Added include/grub/efi/console.h, - include/grub/efi/time.h, include/grub/i386/efi/kernel.h, + * DISTLIST: Added include/VasEBoot/efi/console.h, + include/VasEBoot/efi/time.h, include/VasEBoot/i386/efi/kernel.h, kern/efi/init.c, kern/efi/mm.c, and term/efi/console.c. - * include/grub/efi/console.h: New file. - * include/grub/efi/time.h: Likewise. - * include/grub/i386/efi/kernel.h: Likewise. + * include/VasEBoot/efi/console.h: New file. + * include/VasEBoot/efi/time.h: Likewise. + * include/VasEBoot/i386/efi/kernel.h: Likewise. * kern/efi/init.c: Likewise. * kern/efi/mm.c: Likewise. * term/efi/console.c: Likewise. - * kern/i386/efi/init.c: Do not include grub/machine/time.h. - (grub_stop): Removed. - (grub_get_rtc): Likewise. - (grub_machine_init): Simply call grub_efi_init. - (grub_machine_fini): Call grub_efi_fini. + * kern/i386/efi/init.c: Do not include VasEBoot/machine/time.h. + (VasEBoot_stop): Removed. + (VasEBoot_get_rtc): Likewise. + (VasEBoot_machine_init): Simply call VasEBoot_efi_init. + (VasEBoot_machine_fini): Call VasEBoot_efi_fini. - * kern/efi/efi.c: Include grub/machine/time.h and grub/term.h. - (grub_efi_output_string): Removed. - (grub_efi_stall): New function. - (grub_stop): Likewise. - (grub_get_rtc): Likewise. + * kern/efi/efi.c: Include VasEBoot/machine/time.h and VasEBoot/term.h. + (VasEBoot_efi_output_string): Removed. + (VasEBoot_efi_stall): New function. + (VasEBoot_stop): Likewise. + (VasEBoot_get_rtc): Likewise. - * include/grub/efi/efi.h (grub_efi_output_string): Removed. - (grub_efi_stall): New prototype. - (grub_efi_allocate_pages): Likewise. - (grub_efi_free_pages): Likewise. - (grub_efi_get_memory_map): Likewise. - (grub_efi_mm_init): Likewise. - (grub_efi_mm_fini): Likewise. - (grub_efi_init): Likewise. - (grub_efi_fini): Likewise. + * include/VasEBoot/efi/efi.h (VasEBoot_efi_output_string): Removed. + (VasEBoot_efi_stall): New prototype. + (VasEBoot_efi_allocate_pages): Likewise. + (VasEBoot_efi_free_pages): Likewise. + (VasEBoot_efi_get_memory_map): Likewise. + (VasEBoot_efi_mm_init): Likewise. + (VasEBoot_efi_mm_fini): Likewise. + (VasEBoot_efi_init): Likewise. + (VasEBoot_efi_fini): Likewise. - * include/grub/i386/efi/time.h: Do not include - grub/symbol.h. Include grub/efi/time.h. - (GRUB_TICKS_PER_SECOND): Removed. - (grub_get_rtc): Likewise. + * include/VasEBoot/i386/efi/time.h: Do not include + VasEBoot/symbol.h. Include VasEBoot/efi/time.h. + (VasEBoot_TICKS_PER_SECOND): Removed. + (VasEBoot_get_rtc): Likewise. - * include/grub/efi/api.h (struct grub_efi_memory_descriptor): + * include/VasEBoot/efi/api.h (struct VasEBoot_efi_memory_descriptor): Added padding. The EFI spec is buggy. - (GRUB_EFI_BLACK): New macro. - (GRUB_EFI_BLUE): Likewise. - (GRUB_EFI_GREEN): Likewise. - (GRUB_EFI_CYAN): Likewise. - (GRUB_EFI_RED): Likewise. - (GRUB_EFI_MAGENTA): Likewise. - (GRUB_EFI_BROWN): Likewise. - (GRUB_EFI_LIGHTGRAY): Likewise. - (GRUB_EFI_BRIGHT): Likewise. - (GRUB_EFI_DARKGRAY): Likewise. - (GRUB_EFI_LIGHTBLUE): Likewise. - (GRUB_EFI_LIGHTGREEN): Likewise. - (GRUB_EFI_LIGHTCYAN): Likewise. - (GRUB_EFI_LIGHTRED): Likewise. - (GRUB_EFI_LIGHTMAGENTA): Likewise. - (GRUB_EFI_YELLOW): Likewise. - (GRUB_EFI_WHITE): Likewise. - (GRUB_EFI_BACKGROUND_BLACK): Likewise. - (GRUB_EFI_BACKGROUND_BLUE): Likewise. - (GRUB_EFI_BACKGROUND_GREEN): Likewise. - (GRUB_EFI_BACKGROUND_CYAN): Likewise. - (GRUB_EFI_BACKGROUND_RED): Likewise. - (GRUB_EFI_BACKGROUND_MAGENTA): Likewise. - (GRUB_EFI_BACKGROUND_BROWN): Likewise. - (GRUB_EFI_BACKGROUND_LIGHTGRAY): Likewise. - (GRUB_EFI_TEXT_ATTR): Likewise. + (VasEBoot_EFI_BLACK): New macro. + (VasEBoot_EFI_BLUE): Likewise. + (VasEBoot_EFI_GREEN): Likewise. + (VasEBoot_EFI_CYAN): Likewise. + (VasEBoot_EFI_RED): Likewise. + (VasEBoot_EFI_MAGENTA): Likewise. + (VasEBoot_EFI_BROWN): Likewise. + (VasEBoot_EFI_LIGHTGRAY): Likewise. + (VasEBoot_EFI_BRIGHT): Likewise. + (VasEBoot_EFI_DARKGRAY): Likewise. + (VasEBoot_EFI_LIGHTBLUE): Likewise. + (VasEBoot_EFI_LIGHTGREEN): Likewise. + (VasEBoot_EFI_LIGHTCYAN): Likewise. + (VasEBoot_EFI_LIGHTRED): Likewise. + (VasEBoot_EFI_LIGHTMAGENTA): Likewise. + (VasEBoot_EFI_YELLOW): Likewise. + (VasEBoot_EFI_WHITE): Likewise. + (VasEBoot_EFI_BACKGROUND_BLACK): Likewise. + (VasEBoot_EFI_BACKGROUND_BLUE): Likewise. + (VasEBoot_EFI_BACKGROUND_GREEN): Likewise. + (VasEBoot_EFI_BACKGROUND_CYAN): Likewise. + (VasEBoot_EFI_BACKGROUND_RED): Likewise. + (VasEBoot_EFI_BACKGROUND_MAGENTA): Likewise. + (VasEBoot_EFI_BACKGROUND_BROWN): Likewise. + (VasEBoot_EFI_BACKGROUND_LIGHTGRAY): Likewise. + (VasEBoot_EFI_TEXT_ATTR): Likewise. * conf/i386-efi.rmk (kernel_mod_SOURCES): Added kern/efi/efi.c, kern/efi/init.c, kern/efi/mm.c, and term/efi/console.c. @@ -50787,11 +50787,11 @@ 2006-04-18 Yoshinori K. Okuji * DISTLIST: Added conf/i386-efi.mk, conf/i386-efi.rmk, - include/grub/efi/api.h, include/grub/efi/console_control.h, - include/grub/efi/efi.h, include/grub/efi/pe32.h, - include/grub/i386/efi/time.h, kern/efi/efi.c, + include/VasEBoot/efi/api.h, include/VasEBoot/efi/console_control.h, + include/VasEBoot/efi/efi.h, include/VasEBoot/efi/pe32.h, + include/VasEBoot/i386/efi/time.h, kern/efi/efi.c, kern/i386/efi/init.c, kern/i386/efi/startup.S, - and util/i386/efi/grub-mkimage.c. + and util/i386/efi/VasEBoot-mkimage.c. * Makefile.in (RMKFILES): Added i386-efi.rmk. @@ -50800,65 +50800,65 @@ * conf/i386-efi.mk: New file. * conf/i386-efi.rmk: Likewise. - * include/grub/efi/api.h: Likewise. - * include/grub/efi/console_control.h: Likewise. - * include/grub/efi/efi.h: Likewise. - * include/grub/efi/pe32.h: Likewise. - * include/grub/i386/efi/time.h: Likewise. + * include/VasEBoot/efi/api.h: Likewise. + * include/VasEBoot/efi/console_control.h: Likewise. + * include/VasEBoot/efi/efi.h: Likewise. + * include/VasEBoot/efi/pe32.h: Likewise. + * include/VasEBoot/i386/efi/time.h: Likewise. * kern/efi/efi.c: Likewise. * kern/i386/efi/init.c: Likewise. * kern/i386/efi/startup.S: Likewise. - * util/i386/efi/grub-mkimage.c: Likewise. + * util/i386/efi/VasEBoot-mkimage.c: Likewise. 2006-04-17 Marco Gerards - * include/grub/script.h: Include and - "grub_script.tab.h". - (struct grub_lexer_param): New struct. - (struct grub_parser_param): Likewise. - (grub_script_create_arglist): Pass the state in an argument. - (grub_script_add_arglist): Likewise. - (grub_script_create_cmdline): Likewise. - (grub_script_create_cmdblock): Likewise. - (grub_script_create_cmdif): Likewise. - (grub_script_create_cmdmenu): Likewise. - (grub_script_add_cmd): Likewise. - (grub_script_arg_add): Likewise. - (grub_script_lexer_ref): Likewise. - (grub_script_lexer_deref): Likewise. - (grub_script_lexer_record_start): Likewise. - (grub_script_lexer_record_stop): Likewise. - (grub_script_mem_record): Likewise. - (grub_script_mem_record_stop): Likewise. - (grub_script_malloc): Likewise. - (grub_script_yylex): Likewise. - (grub_script_yyparse): Likewise. - (grub_script_yyerror): Likewise. - (grub_script_yylex): Likewise. - (grub_script_lexer_init): Return the state. + * include/VasEBoot/script.h: Include and + "VasEBoot_script.tab.h". + (struct VasEBoot_lexer_param): New struct. + (struct VasEBoot_parser_param): Likewise. + (VasEBoot_script_create_arglist): Pass the state in an argument. + (VasEBoot_script_add_arglist): Likewise. + (VasEBoot_script_create_cmdline): Likewise. + (VasEBoot_script_create_cmdblock): Likewise. + (VasEBoot_script_create_cmdif): Likewise. + (VasEBoot_script_create_cmdmenu): Likewise. + (VasEBoot_script_add_cmd): Likewise. + (VasEBoot_script_arg_add): Likewise. + (VasEBoot_script_lexer_ref): Likewise. + (VasEBoot_script_lexer_deref): Likewise. + (VasEBoot_script_lexer_record_start): Likewise. + (VasEBoot_script_lexer_record_stop): Likewise. + (VasEBoot_script_mem_record): Likewise. + (VasEBoot_script_mem_record_stop): Likewise. + (VasEBoot_script_malloc): Likewise. + (VasEBoot_script_yylex): Likewise. + (VasEBoot_script_yyparse): Likewise. + (VasEBoot_script_yyerror): Likewise. + (VasEBoot_script_yylex): Likewise. + (VasEBoot_script_lexer_init): Return the state. - * normal/lexer.c (grub_script_lexer_state): Removed variable. - (grub_script_lexer_done): Likewise. - (grub_script_lexer_getline): Likewise. - (grub_script_lexer_refs): Likewise. + * normal/lexer.c (VasEBoot_script_lexer_state): Removed variable. + (VasEBoot_script_lexer_done): Likewise. + (VasEBoot_script_lexer_getline): Likewise. + (VasEBoot_script_lexer_refs): Likewise. (script): Likewise. (newscript): Likewise. (record): Likewise. (recording): Likewise. (recordpos): Likewise. (recordlen): Likewise. - (grub_script_lexer_init): Return the state instead of setting + (VasEBoot_script_lexer_init): Return the state instead of setting global variables. - (grub_script_lexer_ref): Use the newly added argument for state + (VasEBoot_script_lexer_ref): Use the newly added argument for state instead of globals. - (grub_script_lexer_deref): Likewise. - (grub_script_lexer_record_start): Likewise. - (grub_script_lexer_record_stop): Likewise. + (VasEBoot_script_lexer_deref): Likewise. + (VasEBoot_script_lexer_record_start): Likewise. + (VasEBoot_script_lexer_record_stop): Likewise. (recordchar): Likewise. (nextchar): Likewise. - (grub_script_yylex2): Likewise. - (grub_script_yylex): Likewise. - (grub_script_yyerror): Likewise. + (VasEBoot_script_yylex2): Likewise. + (VasEBoot_script_yylex): Likewise. + (VasEBoot_script_yyerror): Likewise. * normal/parser.y (func_mem): Removed variable. (menu_entry): Likewise. @@ -50868,36 +50868,36 @@ (script): Always return the AST. (argument): Pass the state around. (arguments): Likewise. - (grubcmd): Likewise. + (VasEBootcmd): Likewise. (commands): Likewise. (function): Likewise. (menuentry): Likewise. (if_statement): Likewise. (if): Likewise. - * normal/script.c (grub_script_memused): Removed variable. - (grub_script_parsed): Likewise. - (grub_script_malloc): Added a state argument. Use that instead of + * normal/script.c (VasEBoot_script_memused): Removed variable. + (VasEBoot_script_parsed): Likewise. + (VasEBoot_script_malloc): Added a state argument. Use that instead of global variables. - (grub_script_mem_record): Likewise. - (grub_script_mem_record_stop): Likewise. - (grub_script_arg_add): Likewise. - (grub_script_add_arglist): Likewise. - (grub_script_create_cmdline): Likewise. - (grub_script_create_cmdif): Likewise. - (grub_script_create_cmdmenu): Likewise. - (grub_script_add_cmd): Likewise. - (grub_script_parse): Setup the state before calling the parser. + (VasEBoot_script_mem_record): Likewise. + (VasEBoot_script_mem_record_stop): Likewise. + (VasEBoot_script_arg_add): Likewise. + (VasEBoot_script_add_arglist): Likewise. + (VasEBoot_script_create_cmdline): Likewise. + (VasEBoot_script_create_cmdif): Likewise. + (VasEBoot_script_create_cmdmenu): Likewise. + (VasEBoot_script_add_cmd): Likewise. + (VasEBoot_script_parse): Setup the state before calling the parser. 2006-04-16 Marco Gerards - * normal/command.c (grub_command_init): Remove the title command. + * normal/command.c (VasEBoot_command_init): Remove the title command. - * normal/lexer.c (grub_script_yylex): Renamed from this... - (grub_script_yylex2): ... to this. - (grub_script_yylex): New function. Temporary + * normal/lexer.c (VasEBoot_script_yylex): Renamed from this... + (VasEBoot_script_yylex2): ... to this. + (VasEBoot_script_yylex): New function. Temporary introduced to filter some tokens. - (grub_script_yyerror): Print a newline. + (VasEBoot_script_yyerror): Print a newline. * normal/main.c (read_config_file): Output information about the lines that contain errors. Wait for a key after all lines have @@ -50910,14 +50910,14 @@ (ws, returns): Removed rules. (argument): Disabled concatenated variable support. (arguments): Remove explicit separators. - (grubcmd): Likewise. + (VasEBootcmd): Likewise. (function): Likewise. (menuentry): Likewise. (if): Likewise. (commands): Likewise. Add error handling. - * normal/script.c (grub_script_create_cmdline): If - `grub_script_parsed' is 0, assume the parser encountered an error. + * normal/script.c (VasEBoot_script_create_cmdline): If + `VasEBoot_script_parsed' is 0, assume the parser encountered an error. 2006-04-02 Yoshinori K. Okuji @@ -50931,43 +50931,43 @@ 2006-04-01 Vesa Jaaskelainen - * normal/main.c (grub_normal_menu_addentry): Fixed menu size + * normal/main.c (VasEBoot_normal_menu_addentry): Fixed menu size calculation. (read_config_file): Made it to close file before returning. 2006-03-31 Vesa Jaaskelainen - * DISTLIST: Added include/grub/i386/pc/vbeblit.h, - include/grub/i386/pc/vbefill.h, video/i386/pc/vbeblit.c, + * DISTLIST: Added include/VasEBoot/i386/pc/vbeblit.h, + include/VasEBoot/i386/pc/vbefill.h, video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c. * conf/i386-pc.rmk (vbe_mod_SOURCES): Added video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c. - * include/grub/video.h (grub_video_blit_format): New enum. - (grub_video_mode_info): Added new member blit_format. - (grub_video_get_blit_format): New function prototype. + * include/VasEBoot/video.h (VasEBoot_video_blit_format): New enum. + (VasEBoot_video_mode_info): Added new member blit_format. + (VasEBoot_video_get_blit_format): New function prototype. - * include/grub/i386/pc/vbe.h (grub_video_vbe_get_video_ptr): New + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_video_vbe_get_video_ptr): New function prototype. - (grub_video_vbe_map_rgb): Likewise. - (grub_video_vbe_unmap_color): Likewise. + (VasEBoot_video_vbe_map_rgb): Likewise. + (VasEBoot_video_vbe_unmap_color): Likewise. - * include/grub/i386/pc/vbeblit.h: New file. + * include/VasEBoot/i386/pc/vbeblit.h: New file. - * include/grub/i386/pc/vbefill.h: New file. + * include/VasEBoot/i386/pc/vbefill.h: New file. - * video/video.c (grub_video_get_blit_format): New function. - (grub_video_vbe_get_video_ptr): Re-declared as non-static. - (grub_video_vbe_map_rgb): Likewise. - (grub_video_vbe_unmap_color): Likewise. + * video/video.c (VasEBoot_video_get_blit_format): New function. + (VasEBoot_video_vbe_get_video_ptr): Re-declared as non-static. + (VasEBoot_video_vbe_map_rgb): Likewise. + (VasEBoot_video_vbe_unmap_color): Likewise. - * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Changed to use more + * video/i386/pc/vbe.c (VasEBoot_video_vbe_fill_rect): Changed to use more optimized fills. - (grub_video_vbe_blit_render_target): Changed to use more optimized + (VasEBoot_video_vbe_blit_render_target): Changed to use more optimized blits. - (grub_video_vbe_setup): Added detection for optimized settings. - (grub_video_vbe_create_render_target): Likewise. + (VasEBoot_video_vbe_setup): Added detection for optimized settings. + (VasEBoot_video_vbe_create_render_target): Likewise. * video/i386/pc/vbeblit.c: New file. @@ -50975,7 +50975,7 @@ 2006-03-30 Vesa Jaaskelainen - * font/manager.c (grub_font_get_glyph): Removed font fixup from + * font/manager.c (VasEBoot_font_get_glyph): Removed font fixup from here... * util/unifont2pff.rb: ... and moved it to here. Improved argument @@ -50984,7 +50984,7 @@ 2006-03-14 Vesa Jaaskelainen - * DISTLIST: Added include/grub/video.h, term/gfxterm.c, + * DISTLIST: Added include/VasEBoot/video.h, term/gfxterm.c, video/video.c, commands/videotest.c. Removed term/i386/pc/vesafb.c. * conf/i386-pc.rmk (pkgdata_MODULES): Added video.mod, @@ -51008,78 +51008,78 @@ * commands/videotest.c: New file. * font/manager.c (fill_with_default_glyph): Modified to use - grub_font_glyph. - (grub_font_get_glyph): Likewise. + VasEBoot_font_glyph. + (VasEBoot_font_get_glyph): Likewise. (fontmanager): Renamed from this... (font_manager): ... to this. - * include/grub/font.h (grub_font_glyph): Added new structure. - (grub_font_get_glyph): Modified to use grub_font_glyph. + * include/VasEBoot/font.h (VasEBoot_font_glyph): Added new structure. + (VasEBoot_font_get_glyph): Modified to use VasEBoot_font_glyph. - * include/grub/misc.h (grub_abs): Added as inline function. + * include/VasEBoot/misc.h (VasEBoot_abs): Added as inline function. - * include/grub/video.h: New file. + * include/VasEBoot/video.h: New file. - * include/grub/i386/pc/vbe.h (GRUB_VBE_STATUS_OK): New macro. - (GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL): Likewise. - (GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR): Likewise. - (grub_vbe_get_controller_info): Renamed from this... - (grub_vbe_bios_get_controller_info): ... to this. - (grub_vbe_get_mode_info): Renamed from this... - (grub_vbe_bios_get_mode_info): ... to this. - (grub_vbe_set_mode): Renamed from this... - (grub_vbe_bios_set_mode): ... to this. - (grub_vbe_get_mode): Renamed from this... - (grub_vbe_bios_get_mode): ... to this. - (grub_vbe_set_memory_window): Renamed from this... - (grub_vbe_bios_set_memory_window): ... to this. - (grub_vbe_get_memory_window): Renamed from this... - (grub_vbe_bios_get_memory_window): ... to this. - (grub_vbe_set_scanline_length): Renamed from this... - (grub_vbe_set_scanline_length): ... to this. - (grub_vbe_get_scanline_length): Renamed from this... - (grub_vbe_bios_get_scanline_length): ... to this. - (grub_vbe_set_display_start): Renamed from this... - (grub_vbe_bios_set_display_start): ... to this. - (grub_vbe_get_display_start): Renamed from this... - (grub_vbe_bios_get_display_start): ... to this. - (grub_vbe_set_palette_data): Renamed from this... - (grub_vbe_bios_set_palette_data): ... to this. - (grub_vbe_set_pixel_rgb): Removed. - (grub_vbe_set_pixel_index): Likewise. + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_VBE_STATUS_OK): New macro. + (VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL): Likewise. + (VasEBoot_VBE_MEMORY_MODEL_DIRECT_COLOR): Likewise. + (VasEBoot_vbe_get_controller_info): Renamed from this... + (VasEBoot_vbe_bios_get_controller_info): ... to this. + (VasEBoot_vbe_get_mode_info): Renamed from this... + (VasEBoot_vbe_bios_get_mode_info): ... to this. + (VasEBoot_vbe_set_mode): Renamed from this... + (VasEBoot_vbe_bios_set_mode): ... to this. + (VasEBoot_vbe_get_mode): Renamed from this... + (VasEBoot_vbe_bios_get_mode): ... to this. + (VasEBoot_vbe_set_memory_window): Renamed from this... + (VasEBoot_vbe_bios_set_memory_window): ... to this. + (VasEBoot_vbe_get_memory_window): Renamed from this... + (VasEBoot_vbe_bios_get_memory_window): ... to this. + (VasEBoot_vbe_set_scanline_length): Renamed from this... + (VasEBoot_vbe_set_scanline_length): ... to this. + (VasEBoot_vbe_get_scanline_length): Renamed from this... + (VasEBoot_vbe_bios_get_scanline_length): ... to this. + (VasEBoot_vbe_set_display_start): Renamed from this... + (VasEBoot_vbe_bios_set_display_start): ... to this. + (VasEBoot_vbe_get_display_start): Renamed from this... + (VasEBoot_vbe_bios_get_display_start): ... to this. + (VasEBoot_vbe_set_palette_data): Renamed from this... + (VasEBoot_vbe_bios_set_palette_data): ... to this. + (VasEBoot_vbe_set_pixel_rgb): Removed. + (VasEBoot_vbe_set_pixel_index): Likewise. - * kern/i386/pc/startup.S (grub_vbe_get_controller_info): Renamed + * kern/i386/pc/startup.S (VasEBoot_vbe_get_controller_info): Renamed from this... - (grub_vbe_bios_get_controller_info): ... to this. - (grub_vbe_get_mode_info): Renamed from this... - (grub_vbe_bios_get_mode_info): ... to this. - (grub_vbe_set_mode): Renamed from this... - (grub_vbe_bios_set_mode): ... to this. - (grub_vbe_get_mode): Renamed from this... - (grub_vbe_bios_get_mode): ... to this. - (grub_vbe_set_memory_window): Renamed from this... - (grub_vbe_bios_set_memory_window): ... to this. - (grub_vbe_get_memory_window): Renamed from this... - (grub_vbe_bios_get_memory_window): ... to this. - (grub_vbe_set_scanline_length): Renamed from this... - (grub_vbe_set_scanline_length): ... to this. - (grub_vbe_get_scanline_length): Renamed from this... - (grub_vbe_bios_get_scanline_length): ... to this. - (grub_vbe_set_display_start): Renamed from this... - (grub_vbe_bios_set_display_start): ... to this. - (grub_vbe_get_display_start): Renamed from this... - (grub_vbe_bios_get_display_start): ... to this. - (grub_vbe_set_palette_data): Renamed from this... - (grub_vbe_bios_set_palette_data): ... to this. - (grub_vbe_bios_get_controller_info): Fixed problem with registers + (VasEBoot_vbe_bios_get_controller_info): ... to this. + (VasEBoot_vbe_get_mode_info): Renamed from this... + (VasEBoot_vbe_bios_get_mode_info): ... to this. + (VasEBoot_vbe_set_mode): Renamed from this... + (VasEBoot_vbe_bios_set_mode): ... to this. + (VasEBoot_vbe_get_mode): Renamed from this... + (VasEBoot_vbe_bios_get_mode): ... to this. + (VasEBoot_vbe_set_memory_window): Renamed from this... + (VasEBoot_vbe_bios_set_memory_window): ... to this. + (VasEBoot_vbe_get_memory_window): Renamed from this... + (VasEBoot_vbe_bios_get_memory_window): ... to this. + (VasEBoot_vbe_set_scanline_length): Renamed from this... + (VasEBoot_vbe_set_scanline_length): ... to this. + (VasEBoot_vbe_get_scanline_length): Renamed from this... + (VasEBoot_vbe_bios_get_scanline_length): ... to this. + (VasEBoot_vbe_set_display_start): Renamed from this... + (VasEBoot_vbe_bios_set_display_start): ... to this. + (VasEBoot_vbe_get_display_start): Renamed from this... + (VasEBoot_vbe_bios_get_display_start): ... to this. + (VasEBoot_vbe_set_palette_data): Renamed from this... + (VasEBoot_vbe_bios_set_palette_data): ... to this. + (VasEBoot_vbe_bios_get_controller_info): Fixed problem with registers getting corrupted after calling it. Added more pushes and pops. - (grub_vbe_bios_set_mode): Likewise. - (grub_vbe_bios_get_mode): Likewise. - (grub_vbe_bios_get_memory_window): Likewise. - (grub_vbe_bios_set_scanline_length): Likewise. - (grub_vbe_bios_get_scanline_length): Likewise. - (grub_vbe_bios_get_display_start): Likewise. - (grub_vbe_bios_set_palette_data): Likewise. + (VasEBoot_vbe_bios_set_mode): Likewise. + (VasEBoot_vbe_bios_get_mode): Likewise. + (VasEBoot_vbe_bios_get_memory_window): Likewise. + (VasEBoot_vbe_bios_set_scanline_length): Likewise. + (VasEBoot_vbe_bios_get_scanline_length): Likewise. + (VasEBoot_vbe_bios_get_display_start): Likewise. + (VasEBoot_vbe_bios_set_palette_data): Likewise. * normal/cmdline.c (cl_set_pos): Refresh the screen. (cl_insert): Likewise. @@ -51092,37 +51092,37 @@ * video/video.c: New file. * video/i386/pc/vbe.c (real2pm): Added new function. - (grub_video_vbe_draw_pixel): Likewise. - (grub_video_vbe_get_video_ptr): Likewise. - (grub_video_vbe_get_pixel): Likewise - (grub_video_vbe_init): Likewise. - (grub_video_vbe_fini): Likewise. - (grub_video_vbe_setup): Likewise. - (grub_video_vbe_get_info): Likewise. - (grub_video_vbe_set_palette): Likewise. - (grub_video_vbe_get_palette): Likewise. - (grub_video_vbe_set_viewport): Likewise. - (grub_video_vbe_get_viewport): Likewise. - (grub_video_vbe_map_color): Likewise. - (grub_video_vbe_map_rgb): Likewise. - (grub_video_vbe_map_rgba): Likewise. - (grub_video_vbe_unmap_color): Likewise. - (grub_video_vbe_fill_rect): Likewise. - (grub_video_vbe_blit_glyph): Likewise. - (grub_video_vbe_blit_bitmap): Likewise. - (grub_video_vbe_blit_render_target): Likewise. - (grub_video_vbe_scroll): Likewise. - (grub_video_vbe_swap_buffers): Likewise. - (grub_video_vbe_create_render_target): Likewise. - (grub_video_vbe_delete_render_target): Likewise. - (grub_video_vbe_set_active_render_target): Likewise. - (grub_vbe_set_pixel_rgb): Remove function. - (grub_vbe_set_pixel_index): Likewise. + (VasEBoot_video_vbe_draw_pixel): Likewise. + (VasEBoot_video_vbe_get_video_ptr): Likewise. + (VasEBoot_video_vbe_get_pixel): Likewise + (VasEBoot_video_vbe_init): Likewise. + (VasEBoot_video_vbe_fini): Likewise. + (VasEBoot_video_vbe_setup): Likewise. + (VasEBoot_video_vbe_get_info): Likewise. + (VasEBoot_video_vbe_set_palette): Likewise. + (VasEBoot_video_vbe_get_palette): Likewise. + (VasEBoot_video_vbe_set_viewport): Likewise. + (VasEBoot_video_vbe_get_viewport): Likewise. + (VasEBoot_video_vbe_map_color): Likewise. + (VasEBoot_video_vbe_map_rgb): Likewise. + (VasEBoot_video_vbe_map_rgba): Likewise. + (VasEBoot_video_vbe_unmap_color): Likewise. + (VasEBoot_video_vbe_fill_rect): Likewise. + (VasEBoot_video_vbe_blit_glyph): Likewise. + (VasEBoot_video_vbe_blit_bitmap): Likewise. + (VasEBoot_video_vbe_blit_render_target): Likewise. + (VasEBoot_video_vbe_scroll): Likewise. + (VasEBoot_video_vbe_swap_buffers): Likewise. + (VasEBoot_video_vbe_create_render_target): Likewise. + (VasEBoot_video_vbe_delete_render_target): Likewise. + (VasEBoot_video_vbe_set_active_render_target): Likewise. + (VasEBoot_vbe_set_pixel_rgb): Remove function. + (VasEBoot_vbe_set_pixel_index): Likewise. (index_color_mode): Remove static variable. (active_mode): Likewise. (framebuffer): Likewise. (bytes_per_scan_line): Likewise. - (grub_video_vbe_adapter): Added new static variable. + (VasEBoot_video_vbe_adapter): Added new static variable. (framebuffer): Likewise. (render_target): Likewise. (initial_mode): Likewise. @@ -51133,7 +51133,7 @@ * configure.ac (AC_INIT): Bumped to 1.93. - * DISTLIST: Added `include/grub/hfs.h'. + * DISTLIST: Added `include/VasEBoot/hfs.h'. 2006-02-01 Yoshinori K. Okuji @@ -51142,45 +51142,45 @@ 2006-01-25 Yoshinori K. Okuji - * util/i386/pc/grub-install.in: Escape a backslash. Reported by + * util/i386/pc/VasEBoot-install.in: Escape a backslash. Reported by Poe Chen . 2006-01-17 Marco Gerards - * include/grub/normal.h: Include . - (grub_command_list): Removed struct. - (grub_command_list_t): Removed type. - (grub_menu_entry): Remove members `num' and `command_list'. Add + * include/VasEBoot/normal.h: Include . + (VasEBoot_command_list): Removed struct. + (VasEBoot_command_list_t): Removed type. + (VasEBoot_menu_entry): Remove members `num' and `command_list'. Add members `commands' and `sourcecode'. - * include/grub/script.h: Add inclusion guards. - (grub_script_cmd_menuentry): New struct. - (grub_script_execute_menuentry): New prototype. - (grub_script_lexer_record_start): Likewise. - (grub_script_lexer_record_stop): Likewise. - * normal/execute.c (grub_script_execute_menuentry): New function. + * include/VasEBoot/script.h: Add inclusion guards. + (VasEBoot_script_cmd_menuentry): New struct. + (VasEBoot_script_execute_menuentry): New prototype. + (VasEBoot_script_lexer_record_start): Likewise. + (VasEBoot_script_lexer_record_stop): Likewise. + * normal/execute.c (VasEBoot_script_execute_menuentry): New function. * normal/lexer.c (record, recording, recordpos, recordlen): New variables. - (grub_script_lexer_record_start): New function. - (grub_script_lexer_record_stop): Likewise. + (VasEBoot_script_lexer_record_start): New function. + (VasEBoot_script_lexer_record_stop): Likewise. (recordchar): Likewise. (nextchar): Likewise. - (grub_script_yylex): Use `nextchar' to fetch new characters. Use + (VasEBoot_script_yylex): Use `nextchar' to fetch new characters. Use 2048 as the buffer size. Add the tokens `menuentry' and `@'. - * normal/main.c: Include and + * normal/main.c: Include and (current_menu): New variable. (free_menu): Mainly rewritten. - (grub_normal_menu_addentry): New function. + (VasEBoot_normal_menu_addentry): New function. (read_config_file): Rewritten. * normal/menu.c (run_menu_entry): Mainly rewritten. * normal/menu_entry.c (make_screen): Rewritten the code to insert the menu entry. (run): Mainly rewritten. * normal/parser.y (menu_entry): New variable. - (GRUB_PARSER_TOKEN_MENUENTRY): New token. + (VasEBoot_PARSER_TOKEN_MENUENTRY): New token. (menuentry): New rule. (command): Add `menuentry'. (if_statement): Allow additional returns before `fi'. - * normal/script.c (grub_script_create_cmdmenu): New function. + * normal/script.c (VasEBoot_script_create_cmdmenu): New function. 2006-01-03 Marco Gerards @@ -51191,9 +51191,9 @@ 2006-01-03 Marco Gerards - * fs/hfsplus.c (grub_hfsplus_read_block): Convert the offset of + * fs/hfsplus.c (VasEBoot_hfsplus_read_block): Convert the offset of the HFS+ filesystem to filesystem blocks. - (grub_hfsplus_iterate_dir): Cast the `fileinfo' assignment so a + (VasEBoot_hfsplus_iterate_dir): Cast the `fileinfo' assignment so a GCC warning is silenced. 2006-01-03 Marco Gerards @@ -51203,40 +51203,40 @@ 2006-01-03 Hollis Blanchard - * fs/hfs.c: Include . Added reference to the official + * fs/hfs.c: Include . Added reference to the official documentation. - (GRUB_HFS_EMBED_HFSPLUS_SIG): New macro. - (grub_hfs_mount): Grammar fix in error. Make sure this is not an + (VasEBoot_HFS_EMBED_HFSPLUS_SIG): New macro. + (VasEBoot_hfs_mount): Grammar fix in error. Make sure this is not an embedded HFS+ filesystem. - (GRUB_HFS_MAGIC, grub_hfs_extent, grub_hfs_datarecord_t) - (grub_hfs_sblock): Move from here... - * include/grub/hfs.h: To here... New file. - * fs/hfsplus.c: Include . Added reference to the official + (VasEBoot_HFS_MAGIC, VasEBoot_hfs_extent, VasEBoot_hfs_datarecord_t) + (VasEBoot_hfs_sblock): Move from here... + * include/VasEBoot/hfs.h: To here... New file. + * fs/hfsplus.c: Include . Added reference to the official documentation. - (GRUB_HFSPLUS_MAGIC, GRUB_HFSPLUSX_MAGIC, GRUB_HFSPLUS_SBLOCK): + (VasEBoot_HFSPLUS_MAGIC, VasEBoot_HFSPLUSX_MAGIC, VasEBoot_HFSPLUS_SBLOCK): New macros. - (grub_hfsplus_volheader): Change type of member `magic' to - `grub_uint16_t'. - (grub_hfsplus_data): Add new member `embedded_offset'. - (grub_hfsplus_read_block): Add the HFS+ wrapper offset to the + (VasEBoot_hfsplus_volheader): Change type of member `magic' to + `VasEBoot_uint16_t'. + (VasEBoot_hfsplus_data): Add new member `embedded_offset'. + (VasEBoot_hfsplus_read_block): Add the HFS+ wrapper offset to the returned block. - (grub_hfsplus_mount): Read the HFS+ wrapper if it exists. + (VasEBoot_hfsplus_mount): Read the HFS+ wrapper if it exists. Calculate the offset. 2005-12-25 Yoshinori K. Okuji - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_DRP_ADDR): + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_DRP_ADDR): Removed. - (GRUB_BOOT_MACHINE_DRP_SIZE): Likewise. + (VasEBoot_BOOT_MACHINE_DRP_SIZE): Likewise. 2005-12-25 Yoshinori K. Okuji - * kern/env.c (grub_env_set): Check if ENV->VALUE instead of + * kern/env.c (VasEBoot_env_set): Check if ENV->VALUE instead of ENV->NAME is NULL after allocating ENV->VALUE. 2005-12-25 Marco Gerards - * kern/env.c (grub_env_set): Rewritten the error handling code. + * kern/env.c (VasEBoot_env_set): Rewritten the error handling code. 2005-12-25 Yoshinori K. Okuji @@ -51254,62 +51254,62 @@ (hfsplus_mod_SOURCES): New variable. (hfsplus_mod_CFLAGS): Likewise. (hfsplus_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/hfsplus.c'. - (grub_setup_SOURCES): Likewise. - (grub_mkdevicemap_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add `fs/hfsplus.c'. + (VasEBoot_setup_SOURCES): Likewise. + (VasEBoot_mkdevicemap_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. - * fs/fshelp.c (grub_fshelp_log2blksize): New function. + * fs/fshelp.c (VasEBoot_fshelp_log2blksize): New function. - * include/grub/fshelp.h (grub_fshelp_log2blksize): new prototype. + * include/VasEBoot/fshelp.h (VasEBoot_fshelp_log2blksize): new prototype. 2005-12-25 Yoshinori K. Okuji * DISTLIST: Added geninitheader.sh, geninit.sh, commands/test.c, commands/i386/pc/play.c, conf/common.mk, conf/common.rmk, - include/grub/parser.h, include/grub/script.h, kern/parser.c, + include/VasEBoot/parser.h, include/VasEBoot/script.h, kern/parser.c, kern/sparc64/cache.S, normal/execute.c, normal/function.c, normal/lexer.c, normal/parser.y, normal/script.c, and partmap/gpt.c. Removed kern/sparc64/cache.c. - * conf/common.rmk (DISTCLEANFILES): Added grub_script.tab.c, - grub_script.tab.h, grub_modules_init.lst, grub_modules_init.h, - grub_emu_init.c. + * conf/common.rmk (DISTCLEANFILES): Added VasEBoot_script.tab.c, + VasEBoot_script.tab.h, VasEBoot_modules_init.lst, VasEBoot_modules_init.h, + VasEBoot_emu_init.c. * configure.ac (AC_INIT): Bumped to 1.92. 2005-12-24 Vesa Jaaskelainen - * kern/err.c (grub_error_push): Added new function to support error + * kern/err.c (VasEBoot_error_push): Added new function to support error stacks. - (grub_error_pop): Likewise. - (grub_error_stack_items): New local variable to support error stacks. - (grub_error_stack_pos): Likewise. - (grub_error_stack_assert): Likewise. - (GRUB_ERROR_STACK_SIZE): Added new define to configure maximum error + (VasEBoot_error_pop): Likewise. + (VasEBoot_error_stack_items): New local variable to support error stacks. + (VasEBoot_error_stack_pos): Likewise. + (VasEBoot_error_stack_assert): Likewise. + (VasEBoot_ERROR_STACK_SIZE): Added new define to configure maximum error stack depth. - (grub_print_error): Added support to print errors from error stack. + (VasEBoot_print_error): Added support to print errors from error stack. - * include/grub/err.h (grub_error_push): Added function prototype. - (grub_error_pop): Likewise. + * include/VasEBoot/err.h (VasEBoot_error_push): Added function prototype. + (VasEBoot_error_pop): Likewise. 2005-12-09 Hollis Blanchard * configure.ac: Accept `powerpc64' as host_cpu. (amd64): Rename to `biarch32'. - * kern/powerpc/cache.S (grub_arch_sync_caches): Handle + * kern/powerpc/cache.S (VasEBoot_arch_sync_caches): Handle non-cacheline-aligned addresses. - * kern/dl.c (grub_dl_load_core): Add grub_dprintf messages. - (grub_dl_flush_cache): Likewise. Only call `grub_arch_sync_caches' + * kern/dl.c (VasEBoot_dl_load_core): Add VasEBoot_dprintf messages. + (VasEBoot_dl_flush_cache): Likewise. Only call `VasEBoot_arch_sync_caches' if `size' is non-zero. 2005-12-03 Marco Gerards - * conf/common.rmk (grub_modules_init.lst): Use `-printf "%P\n"' + * conf/common.rmk (VasEBoot_modules_init.lst): Use `-printf "%P\n"' and `cd' to make sure the filename is not prefixed with a directory name. (pkgdata_MODULES): Add `gpt.mod'. @@ -51317,9 +51317,9 @@ (gpt_mod_CFLAGS): Likewise. (gpt_mod_LDFLAGS): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `partmap/gpt.c'. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `partmap/gpt.c'. - * include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_GPT_DISK): + * include/VasEBoot/pc_partition.h (VasEBoot_PC_PARTITION_TYPE_GPT_DISK): New macro. * partmap/gpt.c: New file. @@ -51336,7 +51336,7 @@ 2005-11-27 Marco Gerards - * include/grub/dl.h (GRUB_MOD_INIT): Use `__attribute__ + * include/VasEBoot/dl.h (VasEBoot_MOD_INIT): Use `__attribute__ ((unused))' to silence gcc warning. 2005-11-26 Hollis Blanchard @@ -51345,26 +51345,26 @@ 2005-11-22 Hollis Blanchard - * util/powerpc/ieee1275/grub-install.in: Run the mount point + * util/powerpc/ieee1275/VasEBoot-install.in: Run the mount point check before installing files. 2005-11-22 Mike Small - * util/powerpc/ieee1275/grub-install.in (grubdir): Fixed partition + * util/powerpc/ieee1275/VasEBoot-install.in (VasEBootdir): Fixed partition number regex so multidigit numbers are recognized correctly. 2005-11-22 Mike Small - * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Add a + * loader/powerpc/ieee1275/linux.c (VasEBoot_rescue_cmd_linux): Add a debugging message before attempting to claim memory. - (grub_rescue_cmd_initrd): Add a claim debugging message and try + (VasEBoot_rescue_cmd_initrd): Add a claim debugging message and try multiple addresses in case of failure. 2005-11-22 Hollis Blanchard * term/tparm.c (get_space): Remove empty `if' statement. - * fs/ufs.c (grub_ufs_find_file): Remove `grub_le_to_cpu32'. + * fs/ufs.c (VasEBoot_ufs_find_file): Remove `VasEBoot_le_to_cpu32'. * kern/parser.c (check_varstate): Rename `state' to 's'. @@ -51373,7 +51373,7 @@ * partmap/acorn.c: Change `unsigned' to `unsigned int'. Move all variable definitions to the beginning of each function. Sort stack variables by size. - (find): Rename to `acorn_partition_map_find'. Cast `grub_disk_read' + (find): Rename to `acorn_partition_map_find'. Cast `VasEBoot_disk_read' `buf' argument to `char *'. 2005-11-22 Hollis Blanchard @@ -51385,8 +51385,8 @@ help.mod, font.mod, terminfo.mod, amiga.mod, apple.mod, pc.mod, sun.mod, acorn.mod, loopback.mod, default.mod, timeout.mod, configfile.mod, search.mod, gzio.mod and test.mod. - (symlist.c, grub_script.tab.c, grub_script.tab.h, kernel_syms.lst) - (grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c) + (symlist.c, VasEBoot_script.tab.c, VasEBoot_script.tab.h, kernel_syms.lst) + (VasEBoot_modules_init.lst, VasEBoot_modules_init.h, VasEBoot_emu_init.c) (fshelp_mod_SOURCES, fshelp_mod_CFLAGS, fshelp_mod_LDFLAGS) (fat_mod_SOURCES, fat_mod_CFLAGS, fat_mod_LDFLAGS) (ext2_mod_SOURCES, ext2_mod_CFLAGS, ext2_mod_LDFLAGS) @@ -51409,7 +51409,7 @@ (amiga_mod_SOURCES, amiga_mod_CFLAGS, amiga_mod_LDFLAGS) (apple_mod_SOURCES, apple_mod_CFLAGS, apple_mod_LDFLAG): Removed. - * conf/common.mk (grub_modules_init.lst): Use `find' instead of + * conf/common.mk (VasEBoot_modules_init.lst): Use `find' instead of `grep --include'. (pkgdata_MODULES): Add test.mod. @@ -51430,8 +51430,8 @@ help.mod, font.mod, terminfo.mod, amiga.mod, apple.mod, pc.mod, sun.mod, acorn.mod, loopback.mod, default.mod, timeout.mod, configfile.mod, search.mod, gzio.mod and test.mod. - (symlist.c, grub_script.tab.c, grub_script.tab.h, kernel_syms.lst) - (grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c) + (symlist.c, VasEBoot_script.tab.c, VasEBoot_script.tab.h, kernel_syms.lst) + (VasEBoot_modules_init.lst, VasEBoot_modules_init.h, VasEBoot_emu_init.c) (fshelp_mod_SOURCES, fshelp_mod_CFLAGS, fshelp_mod_LDFLAGS) (fat_mod_SOURCES, fat_mod_CFLAGS, fat_mod_LDFLAGS) (ext2_mod_SOURCES, ext2_mod_CFLAGS, ext2_mod_LDFLAGS) @@ -51460,21 +51460,21 @@ 2005-11-18 Yoshinori K. Okuji - * conf/powerpc-ieee1275.rmk (grub_script.tab.h): Unified to ... - (grub_script.tab.c): ... here. + * conf/powerpc-ieee1275.rmk (VasEBoot_script.tab.h): Unified to ... + (VasEBoot_script.tab.c): ... here. - * conf/sparc64-ieee1275.rmk (grub_script.tab.h): Unified to ... - (grub_script.tab.c): ... here. + * conf/sparc64-ieee1275.rmk (VasEBoot_script.tab.h): Unified to ... + (VasEBoot_script.tab.c): ... here. - * conf/i386-pc.rmk (grub_script.tab.h): Unified to ... - (grub_script.tab.c): ... here. + * conf/i386-pc.rmk (VasEBoot_script.tab.h): Unified to ... + (VasEBoot_script.tab.c): ... here. - * normal/command.c (grub_command_find): Fixed a memory leak of + * normal/command.c (VasEBoot_command_find): Fixed a memory leak of MODULE_NAME. Reported by Mike Small . 2005-11-13 Timothy Baldwin - * include/grub/symbol.h: (FUNCTION): Use double quotes instead of + * include/VasEBoot/symbol.h: (FUNCTION): Use double quotes instead of "@" which marks the start of a comment on ARM. (VARIABLE): Likewise. @@ -51484,30 +51484,30 @@ * partmap/acorn.c: New file. - * include/grub/acorn_filecore.h: Likewise. + * include/VasEBoot/acorn_filecore.h: Likewise. * DISTLIST: Added `partmap/acorn.c' and - `include/grub/acorn_filecore.h'. + `include/VasEBoot/acorn_filecore.h'. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `partmap/acorn.c'. (pkgdata_MODULES): Add `acorn.mod'. (acorn_mod_SOURCES): New variable. (acorn_mod_CFLAGS): Likewise. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `partmap/acorn.c'. (pkgdata_MODULES): Add `acorn.mod'. (acorn_mod_SOURCES): New variable. (acorn_mod_CFLAGS): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `partmap/acorn.c'. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `partmap/acorn.c'. (pkgdata_MODULES): Add `acorn.mod'. (acorn_mod_SOURCES): New variable. (acorn_mod_CFLAGS): Likewise. (acorn_mod_LDFLAGS): Likewise. - * include/types.h (grub_disk_addr_t): New typedef. + * include/types.h (VasEBoot_disk_addr_t): New typedef. 2005-11-13 Marco Gerards @@ -51515,125 +51515,125 @@ * geninitheader.sh: Likewise. - * commands/boot.c (grub_boot_init, grub_boot_fini): Removed. - * commands/cat.c (grub_cat_init, grub_cat_fini): Likewise. - * commands/cmp.c (grub_cmp_init, grub_cmp_fini): Likewise. - * commands/configfile.c (grub_configfile_init) - (grub_configfile_fini): Likewise. - * commands/default.c (grub_default_init, grub_default_fini): + * commands/boot.c (VasEBoot_boot_init, VasEBoot_boot_fini): Removed. + * commands/cat.c (VasEBoot_cat_init, VasEBoot_cat_fini): Likewise. + * commands/cmp.c (VasEBoot_cmp_init, VasEBoot_cmp_fini): Likewise. + * commands/configfile.c (VasEBoot_configfile_init) + (VasEBoot_configfile_fini): Likewise. + * commands/default.c (VasEBoot_default_init, VasEBoot_default_fini): Likewise. - * commands/help.c (grub_help_init, grub_help_fini): Likewise. - * commands/ls.c (grub_ls_init, grub_ls_fini): Likewise. - * commands/search.c (grub_search_init, grub_search_fini): Likewise. - * commands/terminal.c (grub_terminal_init, grub_terminal_fini): + * commands/help.c (VasEBoot_help_init, VasEBoot_help_fini): Likewise. + * commands/ls.c (VasEBoot_ls_init, VasEBoot_ls_fini): Likewise. + * commands/search.c (VasEBoot_search_init, VasEBoot_search_fini): Likewise. + * commands/terminal.c (VasEBoot_terminal_init, VasEBoot_terminal_fini): Likewise. - * commands/test.c (grub_test_init, grub_test_fini): Likewise. - * commands/timeout.c (grub_timeout_init, grub_timeout_fini): + * commands/test.c (VasEBoot_test_init, VasEBoot_test_fini): Likewise. + * commands/timeout.c (VasEBoot_timeout_init, VasEBoot_timeout_fini): Likewise. - * commands/i386/pc/halt.c (grub_halt_init, grub_halt_fini): Likewise. - * commands/ieee1275/halt.c (grub_halt_init, grub_halt_fini): + * commands/i386/pc/halt.c (VasEBoot_halt_init, VasEBoot_halt_fini): Likewise. + * commands/ieee1275/halt.c (VasEBoot_halt_init, VasEBoot_halt_fini): Likewise. - * commands/i386/pc/reboot.c (grub_reboot_init, grub_reboot_fini): + * commands/i386/pc/reboot.c (VasEBoot_reboot_init, VasEBoot_reboot_fini): Likewise. - * commands/ieee1275/reboot.c (grub_reboot_init, grub_reboot_fini): + * commands/ieee1275/reboot.c (VasEBoot_reboot_init, VasEBoot_reboot_fini): Likewise. - * disk/loopback.c (grub_loop_init, grub_loop_fini): Likewise. - * fs/affs.c (grub_affs_init, grub_affs_fini): Likewise. - * fs/ext2.c (grub_ext2_init, grub_ext2_fini): Likewise. - * fs/fat.c (grub_fat_init, grub_fat_fini): Likewise. - * fs/hfs.c (grub_hfs_init, grub_hfs_fini): Likewise. - * fs/iso9660.c (grub_iso9660_init, grub_iso9660_fini): Likewise. - * fs/jfs.c (grub_jfs_init, grub_jfs_fini): Likewise. - * fs/minix.c (grub_minix_init, grub_minix_fini): Likewise. - * fs/sfs.c (grub_sfs_init, grub_sfs_fini): Likewise. - * fs/ufs.c (grub_ufs_init, grub_ufs_fini): Likewise. - * fs/xfs.c (grub_xfs_init, grub_xfs_fini): Likewise. - * normal/main.c (grub_normal_init, grub_normal_fini): Likewise. - * partmap/amiga.c (grub_amiga_partition_map_init) - (grub_amiga_partition_map_fini): Likewise. - * partmap/apple.c (grub_apple_partition_map_init) - (grub_apple_partition_map_fini): Likewise. - * partmap/pc.c (grub_pc_partition_map_init) - (grub_pc_partition_map_fini): Likewise. - * partmap/sun.c (grub_sun_partition_map_init, - grub_sun_partition_map_fini): Likewise. - * term/terminfo.c (grub_terminal_init, grub_terminal_fini): + * disk/loopback.c (VasEBoot_loop_init, VasEBoot_loop_fini): Likewise. + * fs/affs.c (VasEBoot_affs_init, VasEBoot_affs_fini): Likewise. + * fs/ext2.c (VasEBoot_ext2_init, VasEBoot_ext2_fini): Likewise. + * fs/fat.c (VasEBoot_fat_init, VasEBoot_fat_fini): Likewise. + * fs/hfs.c (VasEBoot_hfs_init, VasEBoot_hfs_fini): Likewise. + * fs/iso9660.c (VasEBoot_iso9660_init, VasEBoot_iso9660_fini): Likewise. + * fs/jfs.c (VasEBoot_jfs_init, VasEBoot_jfs_fini): Likewise. + * fs/minix.c (VasEBoot_minix_init, VasEBoot_minix_fini): Likewise. + * fs/sfs.c (VasEBoot_sfs_init, VasEBoot_sfs_fini): Likewise. + * fs/ufs.c (VasEBoot_ufs_init, VasEBoot_ufs_fini): Likewise. + * fs/xfs.c (VasEBoot_xfs_init, VasEBoot_xfs_fini): Likewise. + * normal/main.c (VasEBoot_normal_init, VasEBoot_normal_fini): Likewise. + * partmap/amiga.c (VasEBoot_amiga_partition_map_init) + (VasEBoot_amiga_partition_map_fini): Likewise. + * partmap/apple.c (VasEBoot_apple_partition_map_init) + (VasEBoot_apple_partition_map_fini): Likewise. + * partmap/pc.c (VasEBoot_pc_partition_map_init) + (VasEBoot_pc_partition_map_fini): Likewise. + * partmap/sun.c (VasEBoot_sun_partition_map_init, + VasEBoot_sun_partition_map_fini): Likewise. + * term/terminfo.c (VasEBoot_terminal_init, VasEBoot_terminal_fini): Likewise. - * util/grub-emu.c: Include . + * util/VasEBoot-emu.c: Include . (main): Don't initialize and de-initialize any modules directly, - use `grub_init_all' and `grub_fini_all' instead. + use `VasEBoot_init_all' and `VasEBoot_fini_all' instead. - * term/i386/pc/vesafb.c (grub_vesafb_init): Renamed to - `grub_vesafb_mod_init'. - (grub_vesafb_fini): Renamed to `grub_vesafb_mod_fini'. Updated + * term/i386/pc/vesafb.c (VasEBoot_vesafb_init): Renamed to + `VasEBoot_vesafb_mod_init'. + (VasEBoot_vesafb_fini): Renamed to `VasEBoot_vesafb_mod_fini'. Updated all users. - * term/i386/pc/vga.c (grub_vga_init): Renamed to - `grub_vga_mod_init'. Updated all users. - (grub_vga_fini): Renamed to `grub_vga_mod_fini'. + * term/i386/pc/vga.c (VasEBoot_vga_init): Renamed to + `VasEBoot_vga_mod_init'. Updated all users. + (VasEBoot_vga_fini): Renamed to `VasEBoot_vga_mod_fini'. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `grub_emu_init.c'. - (grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c): New + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `VasEBoot_emu_init.c'. + (VasEBoot_modules_init.lst, VasEBoot_modules_init.h, VasEBoot_emu_init.c): New rules. - * include/grub/dl.h (GRUB_MOD_INIT): Add argument `name'. + * include/VasEBoot/dl.h (VasEBoot_MOD_INIT): Add argument `name'. Generate a function to initialize the module in utilities. Updated all callers. - (GRUB_MOD_FINI): Add argument `name'. Generate a function to + (VasEBoot_MOD_FINI): Add argument `name'. Generate a function to initialize the module in utilities. Updated all callers. 2005-11-09 Hollis Blanchard - * term/ieee1275/ofconsole.c (grub_ofconsole_cls): Use both the ANSI + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_cls): Use both the ANSI escape sequence and a literal ^L to clear the screen. - * commands/ieee1275/suspend.c (grub_cmd_suspend): Clear the screen + * commands/ieee1275/suspend.c (VasEBoot_cmd_suspend): Clear the screen when returning from Open Firmware. 2005-11-09 Hollis Blanchard - * term/ieee1275/ofconsole.c (grub_ofconsole_width): New variable. - (grub_ofconsole_height): Likewise. - (grub_ofconsole_putchar): If `grub_curr_x' exceeds console width, + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_width): New variable. + (VasEBoot_ofconsole_height): Likewise. + (VasEBoot_ofconsole_putchar): If `VasEBoot_curr_x' exceeds console width, manually insert a '\n'. - (grub_ofconsole_getwh): Set and return `grub_ofconsole_width' and - `grub_ofconsole_height'. Return early if these are already set. + (VasEBoot_ofconsole_getwh): Set and return `VasEBoot_ofconsole_width' and + `VasEBoot_ofconsole_height'. Return early if these are already set. 2005-11-07 Vincent Pelletier - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/sparc64-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `commands/test.c', `fs/affs.c', `fs/sfs.c', `fs/xfs.c', `normal/execute.c', `normal/lexer.c', `io/gzio.c', - `kern/parser.c', `grub_script.tab.c', `normal/function.c' + `kern/parser.c', `VasEBoot_script.tab.c', `normal/function.c' and `normal/script.c'. (normal_mod_SOURCES): `normal/execute.c', `normal/lexer.c', - `grub_script.tab.c', `normal/function.c' and `normal/script.c'. + `VasEBoot_script.tab.c', `normal/function.c' and `normal/script.c'. (test_mod_SOURCES): New variable. (test_mod_CFLAGS): Likewise. (test_mod_LDFLAGS): Likewise. (pkgdata_MODULES): Add `test.mod'. - (grub_script.tab.c): New rule. - (grub_script.tab.h): Likewise. + (VasEBoot_script.tab.c): New rule. + (VasEBoot_script.tab.h): Likewise. 2005-11-07 Marco Gerards - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `commands/test.c', `normal/execute.c', `normal/lexer.c', - `grub_script.tab.c', `normal/function.c' and `normal/script.c'. + `VasEBoot_script.tab.c', `normal/function.c' and `normal/script.c'. (normal_mod_SOURCES): `normal/execute.c', `normal/lexer.c', - `grub_script.tab.c', `normal/function.c' and `normal/script.c'. + `VasEBoot_script.tab.c', `normal/function.c' and `normal/script.c'. (test_mod_SOURCES): New variable. (test_mod_CFLAGS): Likewise. (pkgdata_MODULES): Add `test.mod'. - (grub_script.tab.c): New rule. - (grub_script.tab.h): Likewise. + (VasEBoot_script.tab.c): New rule. + (VasEBoot_script.tab.h): Likewise. 2005-11-06 Marco Gerards Add initial scripting support. * commands/test.c: New file. - * include/grub/script.h: Likewise. + * include/VasEBoot/script.h: Likewise. * normal/execute.c: Likewise. * normal/function.c: Likewise. * normal/lexer.c: Likewise. @@ -51642,103 +51642,103 @@ * configure.ac: Add `AC_PROG_YACC' test. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/test.c', - `normal/execute.c', `normal/lexer.c', `grub_script.tab.c', + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `commands/test.c', + `normal/execute.c', `normal/lexer.c', `VasEBoot_script.tab.c', `normal/function.c' and `normal/script.c'. (normal_mod_SOURCES): `normal/execute.c', `normal/lexer.c', - `grub_script.tab.c', `normal/function.c' and `normal/script.c'. + `VasEBoot_script.tab.c', `normal/function.c' and `normal/script.c'. (test_mod_SOURCES, test_mod_CFLAGS, test_mod_LDFLAGS): New variables. (pkgdata_MODULES): Add `test.mod'. - (grub_script.tab.c): New rule. - (grub_script.tab.h): Likewise. + (VasEBoot_script.tab.c): New rule. + (VasEBoot_script.tab.h): Likewise. - * include/grub/err.h (grub_err_t): Add `GRUB_ERR_TEST_FAILURE'. + * include/VasEBoot/err.h (VasEBoot_err_t): Add `VasEBoot_ERR_TEST_FAILURE'. - * include/grub/normal.h (grub_test_init): New prototype. - (grub_test_fini): Likewise. + * include/VasEBoot/normal.h (VasEBoot_test_init): New prototype. + (VasEBoot_test_fini): Likewise. - * normal/command.c: Include . - (grub_command_execute): Rewritten. + * normal/command.c: Include . + (VasEBoot_command_execute): Rewritten. - * util/grub-emu.c (main): Call `grub_test_init' and - `grub_test_fini'. + * util/VasEBoot-emu.c (main): Call `VasEBoot_test_init' and + `VasEBoot_test_fini'. 2005-11-03 Hollis Blanchard - * kern/powerpc/ieee1275/init.c (grub_get_rtc): Initialize `msecs' + * kern/powerpc/ieee1275/init.c (VasEBoot_get_rtc): Initialize `msecs' to 0. - * term/ieee1275/ofconsole.c (grub_ofconsole_checkkey): Return -1 if + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_checkkey): Return -1 if there are no pending characters. 2005-11-03 Hollis Blanchard - * kern/powerpc/ieee1275/openfw.c (grub_ieee1275_get_devname): Use - `grub_strndup' to drop device arguments. Replace unnecessary - `grub_strndup' with `grub_strdup'. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_ieee1275_get_devname): Use + `VasEBoot_strndup' to drop device arguments. Replace unnecessary + `VasEBoot_strndup' with `VasEBoot_strdup'. 2005-11-03 Hollis Blanchard - * kern/term.c (grub_cls): Do not call grub_cur_term->cls() if the + * kern/term.c (VasEBoot_cls): Do not call VasEBoot_cur_term->cls() if the `debug' environment variable has been set. 2005-11-02 Hollis Blanchard * Makefile.in (install-local): Use $(DATA). (uninstall): Likewise. - * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Move grub-mkimage... + * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Move VasEBoot-mkimage... (sbin_UTILITIES): ... to here. (sbin_SCRIPTS): New variable. - (grub_install_SOURCES): New variable. - * util/powerpc/ieee1275/grub-install.in: New file. - * util/powerpc/ieee1275/grub-mkimage.c (kernel_path): Remove + (VasEBoot_install_SOURCES): New variable. + * util/powerpc/ieee1275/VasEBoot-install.in: New file. + * util/powerpc/ieee1275/VasEBoot-mkimage.c (kernel_path): Remove variable. - (add_segments): Call `grub_util_get_path'. + (add_segments): Call `VasEBoot_util_get_path'. 2005-10-28 Yoshinori K. Okuji From Timothy Baldwin: - * commands/ls.c (grub_ls_list_files): Close FILE with - grub_file_close. - * kern/misc.c (grub_vsprintf): Terminate the string S with NUL. + * commands/ls.c (VasEBoot_ls_list_files): Close FILE with + VasEBoot_file_close. + * kern/misc.c (VasEBoot_vsprintf): Terminate the string S with NUL. 2005-10-24 Marco Gerards - * include/grub/parser.h: New file. + * include/VasEBoot/parser.h: New file. * kern/parser.c: Likewise. * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/parser.c'. - (grub_setup_SOURCES): Likewise. - (grub_probefs_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. + (VasEBoot_setup_SOURCES): Likewise. + (VasEBoot_probefs_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (kernel_img_HEADERS): Add `parser.h'. - * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add `parser.h'. - (grub_emu_SOURCES): Add `kern/parser.c'. - (grubof_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBootof_HEADERS): Add `parser.h'. + (VasEBoot_emu_SOURCES): Add `kern/parser.c'. + (VasEBootof_SOURCES): Likewise. - * conf/sparc64-ieee1275.rmk (grubof_HEADERS): Add `parser.h'. - (grubof_SOURCES): Add `kern/parser.c'. + * conf/sparc64-ieee1275.rmk (VasEBootof_HEADERS): Add `parser.h'. + (VasEBootof_SOURCES): Add `kern/parser.c'. - * include/grub/misc.h (grub_split_cmdline): Removed prototype. + * include/VasEBoot/misc.h (VasEBoot_split_cmdline): Removed prototype. - * kern/misc.c (grub_split_cmdline): Removed function. + * kern/misc.c (VasEBoot_split_cmdline): Removed function. - * kern/rescue.c: Include . - (grub_enter_rescue_mode): Use `grub_parser_split_cmdline' instead - of `grub_split_cmdline'. + * kern/rescue.c: Include . + (VasEBoot_enter_rescue_mode): Use `VasEBoot_parser_split_cmdline' instead + of `VasEBoot_split_cmdline'. - * normal/command.c: Include . - (grub_command_execute): Use `grub_parser_split_cmdline' instead - of `grub_split_cmdline'. + * normal/command.c: Include . + (VasEBoot_command_execute): Use `VasEBoot_parser_split_cmdline' instead + of `VasEBoot_split_cmdline'. - * normal/completion.c: Include . + * normal/completion.c: Include . (cmdline_state): New variable. (iterate_dir): End the filename with a quote depending on the command line state. (get_state): new function. - (grub_normal_do_completion): Use `grub_parser_split_cmdline' to + (VasEBoot_normal_do_completion): Use `VasEBoot_parser_split_cmdline' to split the arguments and determine the current argument. When the argument string is not quoted, escape all spaces. @@ -51748,7 +51748,7 @@ 2005-10-23 Vincent Pelletier - * include/grub/sparc64/libgcc.h: New file. + * include/VasEBoot/sparc64/libgcc.h: New file. * conf/sparc64-ieee1275.rmk (COMMON_ASFLAGS): Remove -Av9. (normal_mod_SOURCES): Use normal/sparc64/setjmp.S instead of normal/sparc64/setjmp.c. @@ -51762,9 +51762,9 @@ (COMMON_CFLAGS): Add -mno-app-regs. Remove -mcpu=v9 and -mtune=ultrasparc. (COMMON_LDFLAGS): Add -melf64_sparc. - (grubof_HEADERS): Add sparc64/libgcc.h and machine/kernel.h. - (grubof_SOURCES): Use cache.S instead of cache.c. - (grubof_LDFLAGS): Add -mno-app-regs. Replace "-Xlinker + (VasEBootof_HEADERS): Add sparc64/libgcc.h and machine/kernel.h. + (VasEBootof_SOURCES): Use cache.S instead of cache.c. + (VasEBootof_LDFLAGS): Add -mno-app-regs. Replace "-Xlinker --oformat -Xlinker elf64-sparc" by "-Bstatic,-melf64_sparc". (pkgdata_MODULES): Uncomment. Leave linux.mod and _linux.mod commented though. @@ -51790,31 +51790,31 @@ 2005-10-20 Yoshinori K. Okuji - * util/i386/pc/grub-probefs.c (main): Call grub_xfs_init and - grub_xfs_fini. Do not call grub_hfs_init or grub_hfs_fini any + * util/i386/pc/VasEBoot-probefs.c (main): Call VasEBoot_xfs_init and + VasEBoot_xfs_fini. Do not call VasEBoot_hfs_init or VasEBoot_hfs_fini any longer, because HFS should not be used on PC. 2005-10-20 Timothy Baldwin - * io/gzio.c (grub_gzio_read): Use OFFSET instead of FILE->OFFSET + * io/gzio.c (VasEBoot_gzio_read): Use OFFSET instead of FILE->OFFSET consistently within the loop. 2005-10-15 Marco Gerards - * fs/xfs.c (grub_xfs_iterate_dir): Detect an error if part of a + * fs/xfs.c (VasEBoot_xfs_iterate_dir): Detect an error if part of a directory can not be read. 2005-10-15 Yoshinori K. Okuji * configure.ac (AC_INIT): Increase the version number to 1.91. - * DISTLIST: Added include/grub/terminfo.h, include/grub/tparm.h, - include/grub/i386/pc/serial.h, term/terminfo.c, term/tparm.c and + * DISTLIST: Added include/VasEBoot/terminfo.h, include/VasEBoot/tparm.h, + include/VasEBoot/i386/pc/serial.h, term/terminfo.c, term/tparm.c and term/i386/pc/serial.c. 2005-10-15 Yoshinori K. Okuji - * kern/file.c (grub_file_seek): Seeking to an offset equal to a + * kern/file.c (VasEBoot_file_seek): Seeking to an offset equal to a file size must be permitted. * kern/i386/pc/startup.S (multiboot_trampoline): Fix a mistake @@ -51822,19 +51822,19 @@ 2005-10-15 Yoshinori K. Okuji - * fs/xfs.c (grub_xfs_iterate_dir): Change the type of BLK to - grub_uint64_t. + * fs/xfs.c (VasEBoot_xfs_iterate_dir): Change the type of BLK to + VasEBoot_uint64_t. Call the hook with a NUL-terminated filename. - (grub_xfs_mount): Use grub_be_to_cpu32 instead of - grub_cpu_to_be32. + (VasEBoot_xfs_mount): Use VasEBoot_be_to_cpu32 instead of + VasEBoot_cpu_to_be32. * kern/term.c (cursor_state): New variable. - (grub_term_set_current): Reset the cursor state on a new + (VasEBoot_term_set_current): Reset the cursor state on a new terminal. - (grub_setcursor): Rewritten to use CURSOR_STATE. - (grub_getcursor): New function. + (VasEBoot_setcursor): Rewritten to use CURSOR_STATE. + (VasEBoot_getcursor): New function. - * include/grub/term.h (grub_getcursor): New prototype. + * include/VasEBoot/term.h (VasEBoot_getcursor): New prototype. * io/gzio.c (test_header): Align BUF for accessing it as 32-bit integers on ARM. Reported by Timothy Baldwin @@ -51842,9 +51842,9 @@ 2005-10-11 Marco Gerards - * fs/sfs.c (grub_sfs_open): Don't free `data->label' if it is not + * fs/sfs.c (VasEBoot_sfs_open): Don't free `data->label' if it is not allocated. - (grub_sfs_dir): Likewise. + (VasEBoot_sfs_dir): Likewise. 2005-10-09 Marco Gerards @@ -51854,24 +51854,24 @@ * DISTLIST: Added `fs/sfs.c'. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/sfs.c'. - (grub_probefs_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add `fs/sfs.c'. + (VasEBoot_probefs_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add `sfs.mod'. (sfs_mod_SOURCES): New variable. (sfs_mod_CFLAGS): Likewise. (sfs_mod_LDFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `fs/sfs.c'. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `fs/sfs.c'. (pkgdata_MODULES): Add `sfs.mod'. (sfs_mod_SOURCES): New variable. (sfs_mod_CFLAGS): Likewise. - * util/grub-emu.c (main): Call `grub_sfs_init' and - `grub_sfs_fini'. + * util/VasEBoot-emu.c (main): Call `VasEBoot_sfs_init' and + `VasEBoot_sfs_fini'. - * include/grub/fs.h (grub_sfs_init): New prototype. - (grub_sfs_fini): Likewise. + * include/VasEBoot/fs.h (VasEBoot_sfs_init): New prototype. + (VasEBoot_sfs_fini): Likewise. 2005-10-07 Marco Gerards @@ -51881,28 +51881,28 @@ * DISTLIST: Added `fs/affs.c'. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/affs.c'. - (grub_probefs_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add `fs/affs.c'. + (VasEBoot_probefs_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add `affs.mod'. (affs_mod_SOURCES): New variable. (affs_mod_CFLAGS): Likewise. (affs_mod_LDFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `fs/affs.c'. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `fs/affs.c'. (pkgdata_MODULES): Add `affs.mod'. (affs_mod_SOURCES): New variable. (affs_mod_CFLAGS): Likewise. - * util/grub-emu.c (main): Call `grub_affs_init' and - `grub_affs_fini'. + * util/VasEBoot-emu.c (main): Call `VasEBoot_affs_init' and + `VasEBoot_affs_fini'. - * include/grub/fs.h (grub_affs_init): New prototype. - (grub_affs_fini): Likewise. + * include/VasEBoot/fs.h (VasEBoot_affs_init): New prototype. + (VasEBoot_affs_fini): Likewise. 2005-10-01 Marco Gerards - * fs/xfs.c (grub_xfs_iterate_dir): Add parentheses. + * fs/xfs.c (VasEBoot_xfs_iterate_dir): Add parentheses. 2005-10-01 Marco Gerards @@ -51932,35 +51932,35 @@ variables. (normal_mod_ASFLAGS): Add `-m32'. - * include/grub/types.h (grub_host_addr_t, grub_host_off_t) - (grub_host_size_t, grub_host_ssize_t): New types. - (grub_addr_t, grub_off_t, grub_size_t, grub_ssize_t): Make type - dependent of `GRUB_CPU_SIZEOF_VOID_P' instead on - `GRUB_HOST_SIZEOF_VOID_P'. + * include/VasEBoot/types.h (VasEBoot_host_addr_t, VasEBoot_host_off_t) + (VasEBoot_host_size_t, VasEBoot_host_ssize_t): New types. + (VasEBoot_addr_t, VasEBoot_off_t, VasEBoot_size_t, VasEBoot_ssize_t): Make type + dependent of `VasEBoot_CPU_SIZEOF_VOID_P' instead on + `VasEBoot_HOST_SIZEOF_VOID_P'. - * include/grub/kernel.h (struct grub_module_header): Type of - member offset changed to `grub_host_off_t'. Type of member size - changed to `grub_host_size_t'. - (struct grub_module_info): Type of member offset changed to - `grub_host_off_t'. Type of member size changed to - `grub_host_size_t'. + * include/VasEBoot/kernel.h (struct VasEBoot_module_header): Type of + member offset changed to `VasEBoot_host_off_t'. Type of member size + changed to `VasEBoot_host_size_t'. + (struct VasEBoot_module_info): Type of member offset changed to + `VasEBoot_host_off_t'. Type of member size changed to + `VasEBoot_host_size_t'. 2005-09-29 Yoshinori K. Okuji - Make GRUB's kernel compliant to Multiboot Specification. + Make VasEBoot's kernel compliant to Multiboot Specification. * kern/i386/pc/startup.S (multiboot_header): New label. (multiboot_entry): Likewise. (multiboot_trampoline): Likewise. - * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_KERNEL_MACHINE_RAW_SIZE): Increased to 0x4A0. - * fs/xfs.c (grub_xfs_iterate_dir): Fix a syntax error. You may not + * fs/xfs.c (VasEBoot_xfs_iterate_dir): Fix a syntax error. You may not put parentheses after a question mark. - [!GRUB_UTIL] (my_mod): New variable. + [!VasEBoot_UTIL] (my_mod): New variable. - * util/grub-emu.c (main): Call grub_xfs_init and grub_xfs_fini. + * util/VasEBoot-emu.c (main): Call VasEBoot_xfs_init and VasEBoot_xfs_fini. 2005-09-28 Marco Gerards @@ -51971,28 +51971,28 @@ * DISTLIST: Added `fs/xfs.c'. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/xfs.c'. - (grub_probefs_SOURCES): Likewise. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add `fs/xfs.c'. + (VasEBoot_probefs_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add `xfs.mod'. (xfs_mod_SOURCES): New variable. (xfs_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `fs/xfs.c'. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `fs/xfs.c'. (pkgdata_MODULES): Add `xfs.mod'. (xfs_mod_SOURCES): New variable. (xfs_mod_CFLAGS): Likewise. - * util/grub-emu.c (main): Call `grub_xfs_init' and - `grub_xfs_fini'. + * util/VasEBoot-emu.c (main): Call `VasEBoot_xfs_init' and + `VasEBoot_xfs_fini'. - * include/grub/fs.h (grub_xfs_init): New prototype. - (grub_xfs_fini): Likewise. + * include/VasEBoot/fs.h (VasEBoot_xfs_init): New prototype. + (VasEBoot_xfs_fini): Likewise. 2005-09-18 Vesa Jaaskelainen - * video/i386/pc/vbe.c (grub_vbe_set_video_mode): In indexed + * video/i386/pc/vbe.c (VasEBoot_vbe_set_video_mode): In indexed color modes, allow greater than 16 colors to be configured as a default palette. @@ -52002,9 +52002,9 @@ const into OPTIONS. From Omniflux : - * include/grub/terminfo.h: New file. - * include/grub/tparm.h: Likewise. - * include/grub/i386/pc/serial.h: Likewise. + * include/VasEBoot/terminfo.h: New file. + * include/VasEBoot/tparm.h: Likewise. + * include/VasEBoot/i386/pc/serial.h: Likewise. * term/terminfo.c: Likewise. * term/tparm.c: Likewise. * term/i386/pc/serial.c: Likewise. @@ -52027,7 +52027,7 @@ * boot/powerpc/ieee1275/cmain.c: Moved to ... * kern/powerpc/ieee1275/cmain.c: ... here. - * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Use + * conf/powerpc-ieee1275.rmk (VasEBootof_SOURCES): Use kern/powerpc/ieee1275/crt0.S and kern/powerpc/ieee1275/cmain.c instead of boot/powerpc/ieee1275/crt0.S and boot/powerpc/ieee1275/cmain.c, respectively. @@ -52037,27 +52037,27 @@ 2005-08-30 Hollis Blanchard - * term/ieee1275/ofconsole.c (grub_ofconsole_getcharwidth): Fix + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_getcharwidth): Fix `unused parameter' warning. 2005-08-30 Hollis Blanchard - * term/ieee1275/ofconsole.c (grub_ofconsole_getcharwidth): New + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_getcharwidth): New function. - (grub_ofconsole_term): Specify grub_ofconsole_getcharwidth as + (VasEBoot_ofconsole_term): Specify VasEBoot_ofconsole_getcharwidth as getcharwidth. 2005-08-28 Marco Gerards - * include/grub/normal.h (enum grub_completion_type): Added - `GRUB_COMPLETION_TYPE_ARGUMENT'. + * include/VasEBoot/normal.h (enum VasEBoot_completion_type): Added + `VasEBoot_COMPLETION_TYPE_ARGUMENT'. * normal/cmdline.c (print_completion): Handle - the `GRUB_COMPLETION_TYPE_ARGUMENT' type. + the `VasEBoot_COMPLETION_TYPE_ARGUMENT' type. * normal/menu_entry.c (store_completion): Likewise. * normal/completion.c (complete_arguments): New function. - (grub_normal_do_completion): Call `complete_arguments' when the + (VasEBoot_normal_do_completion): Call `complete_arguments' when the current words start with a dash. 2005-08-27 Marco Gerards @@ -52072,48 +52072,48 @@ Rewrite the search routine to make an output consistently. * DISTLIST: Added conf/sparc64-ieee1275.mk, - conf/sparc64-ieee1275.rmk, include/grub/gzio.h, - include/grub/ieee1275/ieee1275.h, include/grub/ieee1275/ofdisk.h, + conf/sparc64-ieee1275.rmk, include/VasEBoot/gzio.h, + include/VasEBoot/ieee1275/ieee1275.h, include/VasEBoot/ieee1275/ofdisk.h, io/gzio.c, kern/sparc64/cache.c, kern/sparc64/dl.c, kern/sparc64/ieee1275/init.c, kern/sparc64/ieee1275/openfw.c and util/powerpc/ieee1275/misc.c. - * include/grub/gzio.h: New file. + * include/VasEBoot/gzio.h: New file. * io/gzio.c: Likewise. - * kern/file.c (grub_file_close): Call grub_device_close only if + * kern/file.c (VasEBoot_file_close): Call VasEBoot_device_close only if FILE->DEVICE is not NULL. - * include/grub/mm.h [!NULL] (NULL): New macro. + * include/VasEBoot/mm.h [!NULL] (NULL): New macro. - * include/grub/err.h (GRUB_ERR_BAD_GZIP_DATA): New constant. + * include/VasEBoot/err.h (VasEBoot_ERR_BAD_GZIP_DATA): New constant. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added io/gzip.c. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Added io/gzip.c. (pkgdata_MODULES): Added gzio.mod. (gzio_mod_SOURCES): New variable. (gzio_mod_CFLAGS): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added io/gzip.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added io/gzip.c. (pkgdata_MODULES): Added gzio.mod. (gzio_mod_SOURCES): New variable. (gzio_mod_CFLAGS): Likewise. - * commands/cat.c: Include grub/gzio.h. - (grub_cmd_cat): Use grub_gzfile_open instead of - grub_file_open. + * commands/cat.c: Include VasEBoot/gzio.h. + (VasEBoot_cmd_cat): Use VasEBoot_gzfile_open instead of + VasEBoot_file_open. - * commands/cmp.c: Include grub/gzio.h. - (grub_cmd_cmp): Use grub_gzfile_open instead of - grub_file_open. + * commands/cmp.c: Include VasEBoot/gzio.h. + (VasEBoot_cmd_cmp): Use VasEBoot_gzfile_open instead of + VasEBoot_file_open. - * loader/i386/pc/multiboot.c: Include grub/gzio.h. - (grub_rescue_cmd_multiboot): Use grub_gzfile_open instead of - grub_file_open. - (grub_rescue_cmd_module): Likewise. + * loader/i386/pc/multiboot.c: Include VasEBoot/gzio.h. + (VasEBoot_rescue_cmd_multiboot): Use VasEBoot_gzfile_open instead of + VasEBoot_file_open. + (VasEBoot_rescue_cmd_module): Likewise. 2005-08-21 Vincent Pelletier - * conf/sparc64-ieee1275.rmk (grubof_SOURCES): The first file must be + * conf/sparc64-ieee1275.rmk (VasEBootof_SOURCES): The first file must be kern/sparc64/ieee1275/init.c because it contains _start. * conf/sparc64-ieee1275.mk: Generated from conf/sparc64-ieee1275.rmk. @@ -52122,28 +52122,28 @@ * configure.ac: Add support for sparc64 host with ieee1275 firmware. * configure: Generated from configure.ac. - * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Use grub_ssize_t + * disk/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Use VasEBoot_ssize_t instead of int. - (grub_ofdisk_read): Likewise. - (grub_ofdisk_open): Use %p to print pointer values, and cast the + (VasEBoot_ofdisk_read): Likewise. + (VasEBoot_ofdisk_open): Use %p to print pointer values, and cast the pointers as (void *) to remove a warning. - (grub_ofdisk_close): Likewise. - (grub_ofdisk_read): Likewise. - * kern/ieee1275/ieee1275.c (grub_ieee1275_exit): This never + (VasEBoot_ofdisk_close): Likewise. + (VasEBoot_ofdisk_read): Likewise. + * kern/ieee1275/ieee1275.c (VasEBoot_ieee1275_exit): This never returns, so make it return void to remove a warning. - * include/grub/ieee1275/ieee1275.h (grub_ieee1275_exit): + * include/VasEBoot/ieee1275/ieee1275.h (VasEBoot_ieee1275_exit): Corresponding prototype change. - * kern/mm.c (grub_mm_init_region): Use %p to print pointer + * kern/mm.c (VasEBoot_mm_init_region): Use %p to print pointer values, and cast the pointers as (void *) to remove a warning. - (grub_mm_dump): Likewise. + (VasEBoot_mm_dump): Likewise. * conf/sparc64-ieee1275.mk: New file. * conf/sparc64-ieee1275.rmk: Likewise. - * include/grub/sparc64/setjmp.h: Likewise. - * include/grub/sparc64/types.h: Likewise. - * include/grub/sparc64/ieee1275/console.h: Likewise. - * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. - * include/grub/sparc64/ieee1275/kernel.h: Likewise. - * include/grub/sparc64/ieee1275/time.h: Likewise. + * include/VasEBoot/sparc64/setjmp.h: Likewise. + * include/VasEBoot/sparc64/types.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/console.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/ieee1275.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/kernel.h: Likewise. + * include/VasEBoot/sparc64/ieee1275/time.h: Likewise. * kern/sparc64/cache.c: Likewise. * kern/sparc64/dl.c: Likewise. * kern/sparc64/ieee1275/init.c: Likewise. @@ -52151,29 +52151,29 @@ 2005-08-21 Yoshinori K. Okuji - * util/console.c (grub_ncurses_putchar): If C is greater than + * util/console.c (VasEBoot_ncurses_putchar): If C is greater than 0x7f, set C to a question mark. - (grub_ncurses_getcharwidth): New function. - (grub_ncurses_term): Specify grub_ncurses_getcharwidth as + (VasEBoot_ncurses_getcharwidth): New function. + (VasEBoot_ncurses_term): Specify VasEBoot_ncurses_getcharwidth as getcharwidth. * normal/menu.c (print_entry): Made aware of Unicode. First, convert TITLE to UCS-4, and predict the cursor position by - grub_getcharwidth. + VasEBoot_getcharwidth. - * include/grub/misc.h (grub_utf8_to_ucs4): Specify the qualifier + * include/VasEBoot/misc.h (VasEBoot_utf8_to_ucs4): Specify the qualifier const to SRC. - * kern/misc.c (grub_utf16_to_utf8): Likewise. + * kern/misc.c (VasEBoot_utf16_to_utf8): Likewise. 2005-08-20 Yoshinori K. Okuji - * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Specify - the boot file by the option BOOT_IMAGE. Use grub_stpcpy instead of - grub_strcat. + * loader/powerpc/ieee1275/linux.c (VasEBoot_rescue_cmd_linux): Specify + the boot file by the option BOOT_IMAGE. Use VasEBoot_stpcpy instead of + VasEBoot_strcat. - * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Specify the boot - file by the option BOOT_IMAGE. Use grub_stpcpy instead of - grub_strcpy and grub_strlen. Take it into account that a space + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_linux): Specify the boot + file by the option BOOT_IMAGE. Use VasEBoot_stpcpy instead of + VasEBoot_strcpy and VasEBoot_strlen. Take it into account that a space character is inserted as a delimiter. 2005-08-20 Yoshinori K. Okuji @@ -52183,79 +52183,79 @@ * commands/search.c: New file. - * util/grub-emu.c (main): Call grub_search_init and - grub_search_fini. + * util/VasEBoot-emu.c (main): Call VasEBoot_search_init and + VasEBoot_search_fini. - * kern/rescue.c (grub_rescue_print_disks): Removed. - (grub_rescue_print_devices): New function. - (grub_rescue_cmd_ls): Use grub_device_iterate with - grub_rescue_print_devices instead of grub_disk_dev_iterate with - grub_rescue_print_disks. + * kern/rescue.c (VasEBoot_rescue_print_disks): Removed. + (VasEBoot_rescue_print_devices): New function. + (VasEBoot_rescue_cmd_ls): Use VasEBoot_device_iterate with + VasEBoot_rescue_print_devices instead of VasEBoot_disk_dev_iterate with + VasEBoot_rescue_print_disks. - * kern/partition.c (grub_partition_iterate): Return the result of - PARTMAP->ITERATE instead of GRUB_ERRNO. + * kern/partition.c (VasEBoot_partition_iterate): Return the result of + PARTMAP->ITERATE instead of VasEBoot_ERRNO. - * kern/device.c: Include grub/partition.h. - (grub_device_iterate): New function. + * kern/device.c: Include VasEBoot/partition.h. + (VasEBoot_device_iterate): New function. - * include/grub/partition.h (grub_partition_iterate): Return int - instead of grub_err_t. + * include/VasEBoot/partition.h (VasEBoot_partition_iterate): Return int + instead of VasEBoot_err_t. - * include/grub/normal.h [GRUB_UTIL] (grub_search_init): New + * include/VasEBoot/normal.h [VasEBoot_UTIL] (VasEBoot_search_init): New prototype. - [GRUB_UTIL] (grub_search_fini): Likewise. + [VasEBoot_UTIL] (VasEBoot_search_fini): Likewise. - * include/grub/device.h (grub_device_iterate): New prototype. + * include/VasEBoot/device.h (VasEBoot_device_iterate): New prototype. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Added commands/search.c. (pkgdata_MODULES): Added search.mod. (search_mod_SOURCES): New variable. (search_mod_CFLAGS): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/search.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added commands/search.c. (pkgdata_MODULES): Added search.mod. (search_mod_SOURCES): New variable. (search_mod_CFLAGS): Likewise. - * commands/ls.c (grub_ls_list_disks): Renamed to ... - (grub_ls_list_devices): ... this, and use grub_device_iterate. + * commands/ls.c (VasEBoot_ls_list_disks): Renamed to ... + (VasEBoot_ls_list_devices): ... this, and use VasEBoot_device_iterate. All callers changed. * DISTLIST: Added commands/search.c. 2005-08-20 Yoshinori K. Okuji - * kern/term.c (grub_putchar): Use grub_utf8_to_ucs4 for the + * kern/term.c (VasEBoot_putchar): Use VasEBoot_utf8_to_ucs4 for the conversion. - (grub_getcharwidth): New function. + (VasEBoot_getcharwidth): New function. - * kern/misc.c (grub_utf8_to_ucs4): New function. + * kern/misc.c (VasEBoot_utf8_to_ucs4): New function. - * include/grub/term.h (struct grub_term): Added a new member + * include/VasEBoot/term.h (struct VasEBoot_term): Added a new member "getcharwidth". - (grub_getcharwidth): New prototype. + (VasEBoot_getcharwidth): New prototype. - * include/grub/misc.h (grub_utf8_to_ucs4): New prototype. + * include/VasEBoot/misc.h (VasEBoot_utf8_to_ucs4): New prototype. * term/i386/pc/console.c (map_char): New function. Segregated from - grub_console_putchar. - (grub_console_putchar): Use map_char. - (grub_console_getcharwidth): New function. - (grub_console_term): Specified grub_console_getcharwidth as + VasEBoot_console_putchar. + (VasEBoot_console_putchar): Use map_char. + (VasEBoot_console_getcharwidth): New function. + (VasEBoot_console_term): Specified VasEBoot_console_getcharwidth as getcharwidth. - * term/i386/pc/vga.c (grub_vga_getcharwidth): New function. - (grub_vga_term): Specified grub_vga_getcharwidth as getcharwidth. + * term/i386/pc/vga.c (VasEBoot_vga_getcharwidth): New function. + (VasEBoot_vga_term): Specified VasEBoot_vga_getcharwidth as getcharwidth. - * term/i386/pc/vesafb.c (grub_virtual_screen_setup): Return - GRUB_ERRNO. - (grub_vesafb_init): Do not use RC. Instead, use GRUB_ERRNO. Rely - on grub_strtoul completely. + * term/i386/pc/vesafb.c (VasEBoot_virtual_screen_setup): Return + VasEBoot_ERRNO. + (VasEBoot_vesafb_init): Do not use RC. Instead, use VasEBoot_ERRNO. Rely + on VasEBoot_strtoul completely. (write_char): Declare local variables in the beginning of the function. - (grub_vesafb_getcharwidth): New function. - (grub_vesafb_term): Specified grub_vesafb_getcharwidth as + (VasEBoot_vesafb_getcharwidth): New function. + (VasEBoot_vesafb_term): Specified VasEBoot_vesafb_getcharwidth as getcharwidth. 2005-08-19 Yoshinori K. Okuji @@ -52264,14 +52264,14 @@ commands/i386/pc/vbe_test.c with commands/i386/pc/vbeinfo.c and commands/i386/pc/vbetest.c. - * video/i386/pc/vbe.c (grub_vbe_probe): If INFOBLOCK is not NULL, - call grub_vbe_get_controller_info again, because the returned + * video/i386/pc/vbe.c (VasEBoot_vbe_probe): If INFOBLOCK is not NULL, + call VasEBoot_vbe_get_controller_info again, because the returned information is volatile. - (grub_vbe_set_video_mode): Mostly rewritten. - (grub_vbe_get_video_mode): Use grub_vbe_probe and use - grub_vbe_status_t correctly. - (grub_vbe_get_video_mode_info): Likewise. - (grub_vbe_set_pixel_rgb): Use a switch statement rather than + (VasEBoot_vbe_set_video_mode): Mostly rewritten. + (VasEBoot_vbe_get_video_mode): Use VasEBoot_vbe_probe and use + VasEBoot_vbe_status_t correctly. + (VasEBoot_vbe_get_video_mode_info): Likewise. + (VasEBoot_vbe_set_pixel_rgb): Use a switch statement rather than several if statements. * commands/i386/pc/vbe_list_modes.c: Renamed to ... @@ -52280,26 +52280,26 @@ * commands/i386/pc/vbe_test.c: Renamed to ... * commands/i386/pc/vbetest.c: ... this. - * commands/i386/pc/vbeinfo.c (grub_cmd_vbe_list_modes): Renamed to + * commands/i386/pc/vbeinfo.c (VasEBoot_cmd_vbe_list_modes): Renamed to ... - (grub_cmd_vbeinfo): ... this. Save video modes before + (VasEBoot_cmd_vbeinfo): ... this. Save video modes before iterating. Skip a video mode, if it is not available, not enough information is given or it is monochrome. Show the memory - model. Leave the interpretation of MODEVAR to grub_strtoul + model. Leave the interpretation of MODEVAR to VasEBoot_strtoul completely. - (GRUB_MOD_INIT): Rename vbe_list_modes to vbeinfo. - (GRUB_MOD_FINI): Likewise. + (VasEBoot_MOD_INIT): Rename vbe_list_modes to vbeinfo. + (VasEBoot_MOD_FINI): Likewise. - * commands/i386/pc/vbetest.c (grub_cmd_vbe_test): Renamed to ... - (grub_cmd_vbetest): ... this. Don't print unnecessarily. Use - grub_err_t instead of grub_uint32_t. Don't use SPTR. Remove a - duplicated grub_env_get. Leave the interpretation of MODEVAR to - grub_strtoul completely. + * commands/i386/pc/vbetest.c (VasEBoot_cmd_vbe_test): Renamed to ... + (VasEBoot_cmd_vbetest): ... this. Don't print unnecessarily. Use + VasEBoot_err_t instead of VasEBoot_uint32_t. Don't use SPTR. Remove a + duplicated VasEBoot_env_get. Leave the interpretation of MODEVAR to + VasEBoot_strtoul completely. (real2pm): Removed. - (GRUB_MOD_INIT): Rename vbe_test to vbetest. - (GRUB_MOD_FINI): Likewise. + (VasEBoot_MOD_INIT): Rename vbe_test to vbetest. + (VasEBoot_MOD_FINI): Likewise. - * normal/misc.c: Include grub/mm.h. + * normal/misc.c: Include VasEBoot/mm.h. * conf/i386-pc.rmk (pkgdata_MODULES): Replaced vbe_test.mod and vbe_list_modes with vbetest.mod and vbeinfo.mod. @@ -52331,7 +52331,7 @@ (store_completion): New function. (complete): Likewise. (clear_completions): Likewise. - (grub_menu_entry_run): If SCREEN->COMPLETION_SHOWN is non-zero, + (VasEBoot_menu_entry_run): If SCREEN->COMPLETION_SHOWN is non-zero, call clear_completions and reset SCREEN->COMPLETION_SHOWN. If C is a tab, call complete. @@ -52345,43 +52345,43 @@ All callers changed. (complete_device): Use a local variable DEV instead of DISK_DEV. Do not move CURRENT_WORD to the end of a device name. - (grub_normal_do_completion): Take a new argument HOOK. Do not + (VasEBoot_normal_do_completion): Take a new argument HOOK. Do not initialize DISK_DEV. Initialize PRINT_FUNC to HOOK. If RET is an empty string, return NULL instead. All callers changed. * normal/cmdline.c (print_completion): New function. - * kern/partition.c (grub_partition_iterate): Add an argument DISK + * kern/partition.c (VasEBoot_partition_iterate): Add an argument DISK to HOOK. All callers changed. - * kern/disk.c (grub_print_partinfo): Removed. + * kern/disk.c (VasEBoot_print_partinfo): Removed. - * include/grub/partition.h (struct grub_partition_map): Add a new + * include/VasEBoot/partition.h (struct VasEBoot_partition_map): Add a new argument DISK into HOOK of ITERATE. - (grub_partition_iterate): Add a new argument DISK to HOOK. + (VasEBoot_partition_iterate): Add a new argument DISK to HOOK. - * include/grub/normal.h (enum grub_completion_type): New enum. - (grub_completion_type_t): New type. - (GRUB_COMPLETION_TYPE_COMMAND): New constant. - (GRUB_COMPLETION_TYPE_DEVICE): Likewise. - (GRUB_COMPLETION_TYPE_PARTITION): Likewise. - (GRUB_COMPLETION_TYPE_FILE): Likewise. - (grub_normal_do_completion): Added a new argument HOOK. - (grub_normal_print_device_info): New prototype. + * include/VasEBoot/normal.h (enum VasEBoot_completion_type): New enum. + (VasEBoot_completion_type_t): New type. + (VasEBoot_COMPLETION_TYPE_COMMAND): New constant. + (VasEBoot_COMPLETION_TYPE_DEVICE): Likewise. + (VasEBoot_COMPLETION_TYPE_PARTITION): Likewise. + (VasEBoot_COMPLETION_TYPE_FILE): Likewise. + (VasEBoot_normal_do_completion): Added a new argument HOOK. + (VasEBoot_normal_print_device_info): New prototype. - * include/grub/disk.h (grub_print_partinfo): Removed. + * include/VasEBoot/disk.h (VasEBoot_print_partinfo): Removed. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added normal/misc.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added normal/misc.c. (normal_mod_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * commands/ls.c (grub_ls_list_disks): Use - grub_normal_print_device_info instead of grub_print_partinfo. Free + * commands/ls.c (VasEBoot_ls_list_disks): Use + VasEBoot_normal_print_device_info instead of VasEBoot_print_partinfo. Free PNAME. - (grub_ls_list_files): Use grub_normal_print_device_info instead of + (VasEBoot_ls_list_files): Use VasEBoot_normal_print_device_info instead of duplicating the code. 2005-08-16 Vesa Jaaskelainen @@ -52389,7 +52389,7 @@ * commands/i386/pc/vbe_list_modes.c: Update source formatting to follow GCS more precisely. * commands/i386/pc/vbe_test.c: Likewise. - * include/grub/i386/pc/vbe.h: Likewise. + * include/VasEBoot/i386/pc/vbe.h: Likewise. * term/i386/pc/vesafb.c: Likewise. * video/i386/pc/vbe.c: Likewise. @@ -52403,13 +52403,13 @@ * commands/i386/pc/vbe_test.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * video/i386/pc/vbe.c: Likewise. - * include/grub/i386/pc/vbe.h (GRUB_VBE_DEFAULT_VIDEO_MODE): Added define. - (grub_vbe_probe) Added prototype. - (grub_vbe_set_video_mode) Likewise. - (grub_vbe_get_video_mode) Likewise. - (grub_vbe_get_video_mode_info) Likewise. - (grub_vbe_set_pixel_rgb) Likewise. - (grub_vbe_set_pixel_index) Likewise. + * include/VasEBoot/i386/pc/vbe.h (VasEBoot_VBE_DEFAULT_VIDEO_MODE): Added define. + (VasEBoot_vbe_probe) Added prototype. + (VasEBoot_vbe_set_video_mode) Likewise. + (VasEBoot_vbe_get_video_mode) Likewise. + (VasEBoot_vbe_get_video_mode_info) Likewise. + (VasEBoot_vbe_set_pixel_rgb) Likewise. + (VasEBoot_vbe_set_pixel_index) Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added vbe.mod. (pkgdata_MODULES): Added vesafb.mod. (pkgdata_MODULES): Added vbe_list_modes.mod. @@ -52425,17 +52425,17 @@ 2005-08-14 Yoshinori K. Okuji - * normal/command.c (grub_command_execute): If INTERACTIVE is - false and GRUB_COMMAND_FLAG_NO_ECHO is not specified, print + * normal/command.c (VasEBoot_command_execute): If INTERACTIVE is + false and VasEBoot_COMMAND_FLAG_NO_ECHO is not specified, print CMDLINE. Disable the pager if INTERACTIVE is true. All callers are changed. - * normal/main.c (grub_normal_execute): Read command.lst and fs.lst + * normal/main.c (VasEBoot_normal_execute): Read command.lst and fs.lst before reading a config file. * normal/main.c (read_config_file): Even if a command is not found, register it if it is within an entry. - * util/grub-emu.c: Include sys/types.h and unistd.h. + * util/VasEBoot-emu.c: Include sys/types.h and unistd.h. (options): Added --hold. (struct arguments): Added a new member "hold". (parse_opt): If KEY is 'H', set ARGS->HOLD to ARG or -1 if ARG is @@ -52443,16 +52443,16 @@ (main): Initialize ARGS.HOLD to zero. Wait until ARGS.HOLD is cleared by a debugger, if it is not zero. - * include/grub/normal.h (grub_command_execute): Add an argument + * include/VasEBoot/normal.h (VasEBoot_command_execute): Add an argument INTERACTIVE. 2005-08-14 Vesa Jaaskelainen - * DISTLIST: Added include/grub/i386/pc/vbe.h. + * DISTLIST: Added include/VasEBoot/i386/pc/vbe.h. 2005-08-13 Yoshinori K. Okuji - * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Replace the test + * aclocal.m4 (VasEBoot_I386_CHECK_REGPARM_BUG): Replace the test program with another one, because the old one didn't detect a bug in gcc-3.4. Always use regparm 2, because the new test is still not enough for gcc-4.0. Someone must investigate a simple test @@ -52464,49 +52464,49 @@ * normal/completion.c: New file. - * term/i386/pc/console.c (grub_console_getwh): New function. - (grub_console_term): Assign grub_console_getwh to getwh. + * term/i386/pc/console.c (VasEBoot_console_getwh): New function. + (VasEBoot_console_term): Assign VasEBoot_console_getwh to getwh. - * normal/cmdline.c (grub_tab_complete): Removed. Now the same + * normal/cmdline.c (VasEBoot_tab_complete): Removed. Now the same function is defined in normal/completion.c as - grub_normal_do_completion. - (grub_cmdline_get): Use grub_normal_do_completion instead of - grub_tab_complete. + VasEBoot_normal_do_completion. + (VasEBoot_cmdline_get): Use VasEBoot_normal_do_completion instead of + VasEBoot_tab_complete. - * kern/partition.c (grub_partition_map_iterate): Return 1 if HOOK + * kern/partition.c (VasEBoot_partition_map_iterate): Return 1 if HOOK returns non-zero, otherwise return 0. - (grub_partition_iterate): First, probe the partition map. Then, + (VasEBoot_partition_iterate): First, probe the partition map. Then, call ITERATE only for this partition map. - * kern/misc.c (grub_strncmp): Rewritten. + * kern/misc.c (VasEBoot_strncmp): Rewritten. - * kern/disk.c (grub_disk_dev_iterate): Return 1 if P->ITERATE + * kern/disk.c (VasEBoot_disk_dev_iterate): Return 1 if P->ITERATE returns non-zero. Otherwise return 0. - * include/grub/partition.h (grub_partition_map_iterate): Return + * include/VasEBoot/partition.h (VasEBoot_partition_map_iterate): Return int instead of void. - * include/grub/normal.h (grub_normal_do_completion): New prototype. + * include/VasEBoot/normal.h (VasEBoot_normal_do_completion): New prototype. - * include/grub/misc.h (grub_strncmp): Change the type of N to - grub_size_t. + * include/VasEBoot/misc.h (VasEBoot_strncmp): Change the type of N to + VasEBoot_size_t. - * include/grub/disk.h (grub_disk_dev_iterate): Return int instead + * include/VasEBoot/disk.h (VasEBoot_disk_dev_iterate): Return int instead of void. - * normal/menu.c (draw_border): Cast GRUB_TERM_BORDER_WIDTH to + * normal/menu.c (draw_border): Cast VasEBoot_TERM_BORDER_WIDTH to unsigned explicitly before comparing it with I. - * kern/main.c (grub_env_write_root): Add the attribute unused into + * kern/main.c (VasEBoot_env_write_root): Add the attribute unused into VAR. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Added normal/completion.c. (normal_mod_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. - * normal/command.c (grub_iterate_commands): If ITERATE returns + * normal/command.c (VasEBoot_iterate_commands): If ITERATE returns non-zero, return one immediately. 2005-08-09 Vesa Jaaskelainen @@ -52514,22 +52514,22 @@ * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vbe.h. * kern/i386/pc/startup.S: Updated Global Descriptor table's descriptions. - (grub_vbe_get_controller_info): New function. - (grub_vbe_get_mode_info): Likewise. - (grub_vbe_set_mode): Likewise. - (grub_vbe_get_mode): Likewise. - (grub_vbe_set_memory_window): Likewise. - (grub_vbe_get_memory_window): Likewise. - (grub_vbe_set_scanline_length): Likewise. - (grub_vbe_get_scanline_length): Likewise. - (grub_vbe_set_display_start): Likewise. - (grub_vbe_get_display_start): Likewise. - (grub_vbe_set_palette_data): Likewise. - * include/grub/i386/pc/vbe.h: New file. + (VasEBoot_vbe_get_controller_info): New function. + (VasEBoot_vbe_get_mode_info): Likewise. + (VasEBoot_vbe_set_mode): Likewise. + (VasEBoot_vbe_get_mode): Likewise. + (VasEBoot_vbe_set_memory_window): Likewise. + (VasEBoot_vbe_get_memory_window): Likewise. + (VasEBoot_vbe_set_scanline_length): Likewise. + (VasEBoot_vbe_get_scanline_length): Likewise. + (VasEBoot_vbe_set_display_start): Likewise. + (VasEBoot_vbe_get_display_start): Likewise. + (VasEBoot_vbe_set_palette_data): Likewise. + * include/VasEBoot/i386/pc/vbe.h: New file. 2005-08-08 Hollis Blanchard - * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Replaced + * conf/powerpc-ieee1275.rmk (VasEBootof_SOURCES): Replaced kern/ieee1275/of.c with kern/ieee1275/ieee1275.c. * DISTLIST: Likewise. * kern/ieee1275/of.c: Moved to ... @@ -52537,25 +52537,25 @@ 2005-08-08 Hollis Blanchard - * term/ieee1275/ofconsole.c: Include . - (grub_ofconsole_getwh): Cast -1 to type grub_ieee1275_ihandle_t. - Pass 0 as `end' parameter to grub_strtoul(). + * term/ieee1275/ofconsole.c: Include . + (VasEBoot_ofconsole_getwh): Cast -1 to type VasEBoot_ieee1275_ihandle_t. + Pass 0 as `end' parameter to VasEBoot_strtoul(). 2005-08-08 Hollis Blanchard - * include/grub/powerpc/ieee1275/console.h: Do not include - . Do not include . Remove ASM_FILE + * include/VasEBoot/powerpc/ieee1275/console.h: Do not include + . Do not include . Remove ASM_FILE ifdef. - (grub_console_cur_color): Remove i386-specific prototype. - (grub_console_real_putchar): Likewise. - (grub_console_checkkey): Likewise. - (grub_console_getkey): Likewise. - (grub_console_getxy): Likewise. - (grub_console_gotoxy): Likewise. - (grub_console_cls): Likewise. - (grub_console_setcursor): Likewise. - * kern/powerpc/ieee1275/init.c: Don't include . - Include . + (VasEBoot_console_cur_color): Remove i386-specific prototype. + (VasEBoot_console_real_putchar): Likewise. + (VasEBoot_console_checkkey): Likewise. + (VasEBoot_console_getkey): Likewise. + (VasEBoot_console_getxy): Likewise. + (VasEBoot_console_gotoxy): Likewise. + (VasEBoot_console_cls): Likewise. + (VasEBoot_console_setcursor): Likewise. + * kern/powerpc/ieee1275/init.c: Don't include . + Include . * term/ieee1275/ofconsole.c: Likewise. 2005-08-08 Yoshinori K. Okuji @@ -52564,13 +52564,13 @@ * configure.ac: Check for LZO version 2. - * util/i386/pc/grub-mkimage.c [HAVE_LZO_LZO1X_H]: Include + * util/i386/pc/VasEBoot-mkimage.c [HAVE_LZO_LZO1X_H]: Include lzo/lzo1x.h instead of lzo1x.h. - * conf/i386-pc.rmk (grub_mkimage_LDFLAGS): Use $(LIBLZO) instead + * conf/i386-pc.rmk (VasEBoot_mkimage_LDFLAGS): Use $(LIBLZO) instead of -llzo. - * util/i386/pc/grub-setup.c (main): Do not free PREFIX + * util/i386/pc/VasEBoot-setup.c (main): Do not free PREFIX twice. Reported by Vladimir Serbinenko . * partmap/pc.c (pc_partition_map_probe): Restore P->DATA after @@ -52578,10 +52578,10 @@ 2005-08-07 Yoshinori K. Okuji - * kern/rescue.c (grub_rescue_cmd_rmmod): If the reference count is + * kern/rescue.c (VasEBoot_rescue_cmd_rmmod): If the reference count is negative, unload the module. - * util/i386/pc/grub-setup.c (setup): The name of the PC partition + * util/i386/pc/VasEBoot-setup.c (setup): The name of the PC partition map is "pc_partition_map" but not "pc". (usage): Fix the description. The options are --boot-image and --core-image but not --boot-file or --core-file. @@ -52589,7 +52589,7 @@ based on DEFAULT_BOOT_FILE and DEFAULT_CORE_FILE with DIR or DEFAULT_DIRECTORY. - * util/i386/pc/grub-install.in: Do not specify --boot-file or + * util/i386/pc/VasEBoot-install.in: Do not specify --boot-file or --core-file. Specify INSTALL_DEVICE as an argument. * util/console.c: Include config.h. @@ -52599,9 +52599,9 @@ [!A_NORMAL] (A_NORMAL): Defined as zero. [!A_STANDOUT] (A_STANDOUT): Likewise. - * conf/i386-pc.rmk (grub_emu_LDFLAGS): Use $(LIBCURSES) instead of + * conf/i386-pc.rmk (VasEBoot_emu_LDFLAGS): Use $(LIBCURSES) instead of -lncurses. - * conf/powerpc-ieee1275.rmk (grub_emu_LDFLAGS): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_LDFLAGS): Likewise. * configure.ac: Check for curses libraries and headers. @@ -52609,35 +52609,35 @@ * genmk.rb (Script::rule): Set the executable bits. - * util/i386/pc/biosdisk.c (grub_util_biosdisk_get_grub_dev): The + * util/i386/pc/biosdisk.c (VasEBoot_util_biosdisk_get_VasEBoot_dev): The name of the PC partition map is "pc_partition_map" but not "pc". 2005-08-07 Yoshinori K. Okuji - * util/i386/pc/grub-install.in (grub_probefs): New variable. + * util/i386/pc/VasEBoot-install.in (VasEBoot_probefs): New variable. (modules): Likewise. - (usage): Added descriptions for --modules and --grub-probefs. - Handle --modules and --grub-probefs. Save the arguments in MODULES - and GRUB_PROBEFS, respectively. - Auto-detect a filesystem module against GRUBDIR. If the result is + (usage): Added descriptions for --modules and --VasEBoot-probefs. + Handle --modules and --VasEBoot-probefs. Save the arguments in MODULES + and VasEBoot_PROBEFS, respectively. + Auto-detect a filesystem module against VasEBootDIR. If the result is empty and modules are not specified explicitly, abort the installation. Add the result to MODULES. * DISTLIST: Removed boot/powerpc/ieee1275/ieee1275.c, disk/powerpc/ieee1275/ofdisk.c, - include/grub/powerpc/ieee1275/init.h and + include/VasEBoot/powerpc/ieee1275/init.h and term/powerpc/ieee1275/ofconsole.c. Added disk/ieee1275/ofdisk.c, kern/ieee1275/of.c and term/ieee1275/ofconsole.c. - * include/grub/powerpc/ieee1275/console.h: Resurrected. + * include/VasEBoot/powerpc/ieee1275/console.h: Resurrected. * COPYING: Upgraded to the latest version. Only the address of the FSF office has changed. 2005-08-07 Yoshinori K. Okuji - * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Replaced + * conf/powerpc-ieee1275.rmk (VasEBootof_SOURCES): Replaced kern/ieee1275.c with kern/ieee1275/of.c. * kern/ieee1275.c: Moved to ... @@ -52653,117 +52653,117 @@ * install.sh: Likewise. * mkinstalldirs: Likewise. - * include/grub/console.h: Removed. This file is arch-specific. Do - not put this in include/grub. + * include/VasEBoot/console.h: Removed. This file is arch-specific. Do + not put this in include/VasEBoot. - * include/grub/i386/pc/console.h: Resurrected. + * include/VasEBoot/i386/pc/console.h: Resurrected. - * util/console.c: Include grub/machine/console.h instead of - grub/console.h. - * util/grub-emu.c: Likewise. + * util/console.c: Include VasEBoot/machine/console.h instead of + VasEBoot/console.h. + * util/VasEBoot-emu.c: Likewise. 2005-08-04 Marco Gerards - * kern/term.c (grub_putcode): Use `grub_getwh' instead of + * kern/term.c (VasEBoot_putcode): Use `VasEBoot_getwh' instead of hardcoded value. From Vincent Pelletier - * include/grub/term.h (GRUB_TERM_WIDTH, GRUB_TERM_HEIGHT): - Redefined to use grub_getwh. - (grub_term): New member named getwh. - (grub_getwh): New prototype. - * kern/term.c (grub_getwh): New function. - * term/i386/pc/console.c (grub_console_getwh): New function. - (grub_console_term): New member `getwh'. - * term/i386/pc/vga.c (grub_vga_getwh): New function. - (grub_vga_term): New member `getwh'. - * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Use - grub_ssize_t. - (grub_ofconsole_getw): New function. - (grub_ofconsole_init): Use grub_ssize_t and unsigned char. - (grub_ofconsole_term): New field named getwh and new initial + * include/VasEBoot/term.h (VasEBoot_TERM_WIDTH, VasEBoot_TERM_HEIGHT): + Redefined to use VasEBoot_getwh. + (VasEBoot_term): New member named getwh. + (VasEBoot_getwh): New prototype. + * kern/term.c (VasEBoot_getwh): New function. + * term/i386/pc/console.c (VasEBoot_console_getwh): New function. + (VasEBoot_console_term): New member `getwh'. + * term/i386/pc/vga.c (VasEBoot_vga_getwh): New function. + (VasEBoot_vga_term): New member `getwh'. + * term/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Use + VasEBoot_ssize_t. + (VasEBoot_ofconsole_getw): New function. + (VasEBoot_ofconsole_init): Use VasEBoot_ssize_t and unsigned char. + (VasEBoot_ofconsole_term): New field named getwh and new initial value. 2005-08-03 Hollis Blanchard - * include/grub/powerpc/ieee1275/ieee1275.h: Move ... - * include/grub/ieee1275/ieee1275.h: ... to here. All users updated. - Move `abort', `grub_reboot', and `grub_halt' prototypes ... - * include/grub/powerpc/ieee1275/kernel.h: ... to here. - * commands/ieee1275/halt.c: Include instead - of . + * include/VasEBoot/powerpc/ieee1275/ieee1275.h: Move ... + * include/VasEBoot/ieee1275/ieee1275.h: ... to here. All users updated. + Move `abort', `VasEBoot_reboot', and `VasEBoot_halt' prototypes ... + * include/VasEBoot/powerpc/ieee1275/kernel.h: ... to here. + * commands/ieee1275/halt.c: Include instead + of . * commands/ieee1275/reboot.c: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Move ... * kern/ieee1275.c: ... to here. All users updated. Change all - parameter structs to use new type `grub_ieee1275_cell_t'. + parameter structs to use new type `VasEBoot_ieee1275_cell_t'. * term/powerpc/ieee1275/ofconsole.c: Move ... * term/ieee1275/ofconsole.c: ... to here. All users updated. * disk/powerpc/ieee1275/ofdisk.c: Move ... * disk/ieee1275/ofdisk.c: ... to here. All users updated. - * boot/powerpc/ieee1275/cmain.c: Change `grub_ieee1275_entry_fn' type + * boot/powerpc/ieee1275/cmain.c: Change `VasEBoot_ieee1275_entry_fn' type to return int. - * include/grub/i386/pc/console.h: Move to include/grub/console.h. + * include/VasEBoot/i386/pc/console.h: Move to include/VasEBoot/console.h. Remove unused prototypes. All users updated. - * include/grub/powerpc/ieee1275/console.h: Removed. - * include/grub/powerpc/ieee1275/ieee1275.h: Define - `grub_ieee1275_cell_t'. - * kern/powerpc/ieee1275/openfw.c: Include . + * include/VasEBoot/powerpc/ieee1275/console.h: Removed. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h: Define + `VasEBoot_ieee1275_cell_t'. + * kern/powerpc/ieee1275/openfw.c: Include . Cast comparisons with -1 to the correct type. * loader/powerpc/ieee1275/linux.c (kernel_entry_t): Change parameter - type to match `grub_ieee1275_entry_fn'. + type to match `VasEBoot_ieee1275_entry_fn'. 2005-08-01 Yoshinori K. Okuji - * DISTLIST: Added util/i386/pc/grub-probefs.c. + * DISTLIST: Added util/i386/pc/VasEBoot-probefs.c. - * conf/i386-pc.rmk (sbin_UTILITIES): Added grub-probefs. - (grub_setup_SOURCES): Removed partmap/amiga.c, partmap/apple.c and + * conf/i386-pc.rmk (sbin_UTILITIES): Added VasEBoot-probefs. + (VasEBoot_setup_SOURCES): Removed partmap/amiga.c, partmap/apple.c and partmap/sun.c. - (grub_probefs_SOURCES): New variable. + (VasEBoot_probefs_SOURCES): New variable. - * util/i386/pc/grub-probefs.c: New file. + * util/i386/pc/VasEBoot-probefs.c: New file. - * util/i386/pc/grub-setup.c (main): Call - grub_pc_partition_map_init, grub_ufs_init, grub_minix_init, - grub_hfs_init and grub_jfs_init to initialize the system. Call - grub_ufs_fini, grub_minix_fini, grub_hfs_fini, grub_jfs_init and - grub_pc_partition_map_fini to finish the system. + * util/i386/pc/VasEBoot-setup.c (main): Call + VasEBoot_pc_partition_map_init, VasEBoot_ufs_init, VasEBoot_minix_init, + VasEBoot_hfs_init and VasEBoot_jfs_init to initialize the system. Call + VasEBoot_ufs_fini, VasEBoot_minix_fini, VasEBoot_hfs_fini, VasEBoot_jfs_init and + VasEBoot_pc_partition_map_fini to finish the system. 2005-07-31 Yoshinori K. Okuji - * loader/i386/pc/multiboot.c (grub_multiboot_is_elf32): New + * loader/i386/pc/multiboot.c (VasEBoot_multiboot_is_elf32): New function. - (grub_multiboot_load_elf32): Likewise. - (grub_multiboot_is_elf64): Likewise. - (grub_multiboot_load_elf64): Likewise. - (grub_multiboot_load_elf): Likewise. - (grub_rescue_cmd_multiboot): Call grub_multiboot_load_elf to load + (VasEBoot_multiboot_load_elf32): Likewise. + (VasEBoot_multiboot_is_elf64): Likewise. + (VasEBoot_multiboot_load_elf64): Likewise. + (VasEBoot_multiboot_load_elf): Likewise. + (VasEBoot_rescue_cmd_multiboot): Call VasEBoot_multiboot_load_elf to load an ELF32 or ELF64 file. This is based on a patch from Ruslan Nikolaev . From Serbinenko Vladimir : - * kern/disk.c (grub_print_partinfo): Check if FS->LABEL is not + * kern/disk.c (VasEBoot_print_partinfo): Check if FS->LABEL is not NULL before calling FS->LABEL. - * fs/fat.c (grub_fat_dir): Initialize DIRNAME to NULL. - * commands/ls.c (grub_ls_list_files): Show labels, if possible. - (grub_ls_list_disks): Check if FS and FS->LABEL are not NULL + * fs/fat.c (VasEBoot_fat_dir): Initialize DIRNAME to NULL. + * commands/ls.c (VasEBoot_ls_list_files): Show labels, if possible. + (VasEBoot_ls_list_disks): Check if FS and FS->LABEL are not NULL before calling FS->LABEL. 2005-07-26 Yoshinori K. Okuji - * util/i386/pc/grub-install.in (datadir): New variable. + * util/i386/pc/VasEBoot-install.in (datadir): New variable. (libdir): Removed. (pkgdatadir): New variable. (pkglibdir): Removed. 2005-07-24 Yoshinori K. Okuji - * DISTLIST: Added util/i386/pc/grub-install.in. + * DISTLIST: Added util/i386/pc/VasEBoot-install.in. - * util/i386/pc/grub-install.in: New file. + * util/i386/pc/VasEBoot-install.in: New file. * conf/i386-pc.rmk (sbin_SCRIPTS): New variable. - (grub_install_SOURCES): Likewise. + (VasEBoot_install_SOURCES): Likewise. * genmk.rb: Added support for scripts. (Script): New class. @@ -52773,12 +52773,12 @@ INSTALL_SCRIPT. (uninstall): Remove sbin_SCRIPTS. - * util/i386/pc/grub-setup.c (main): If the argument is not a GRUB - device, try to get a GRUB device by - grub_util_biosdisk_get_grub_dev. + * util/i386/pc/VasEBoot-setup.c (main): If the argument is not a VasEBoot + device, try to get a VasEBoot device by + VasEBoot_util_biosdisk_get_VasEBoot_dev. Free DEST_DEV. - * util/i386/pc/grub-mkdevicemap.c (usage): Remove a duplicated + * util/i386/pc/VasEBoot-mkdevicemap.c (usage): Remove a duplicated description for --device-map. 2005-07-20 Yoshinori K. Okuji @@ -52786,105 +52786,105 @@ Change the semantics of variable hooks. They now return strings instead of error values. - * util/i386/pc/grub-setup.c: Include grub/env.h. - (setup): Use grub_device_set_root instead of grub_env_set. + * util/i386/pc/VasEBoot-setup.c: Include VasEBoot/env.h. + (setup): Use VasEBoot_device_set_root instead of VasEBoot_env_set. - * kern/rescue.c (grub_rescue_cmd_root): Use grub_env_set and - grub_env_get instead of grub_device_set_root and - grub_device_get_root, respectively. + * kern/rescue.c (VasEBoot_rescue_cmd_root): Use VasEBoot_env_set and + VasEBoot_env_get instead of VasEBoot_device_set_root and + VasEBoot_device_get_root, respectively. - * kern/main.c (grub_env_write_root): New function. - (grub_set_root_dev): Register grub_env_write_hook for "root". Use - grub_env_set instead of grub_device_set_root. + * kern/main.c (VasEBoot_env_write_root): New function. + (VasEBoot_set_root_dev): Register VasEBoot_env_write_hook for "root". Use + VasEBoot_env_set instead of VasEBoot_device_set_root. - * kern/env.c (HASHSZ): Reduced to 13, because GRUB does not need + * kern/env.c (HASHSZ): Reduced to 13, because VasEBoot does not need many variables. - (grub_env_set): Set ENV->VALUE to the result of ENV->WRITE_HOOK + (VasEBoot_env_set): Set ENV->VALUE to the result of ENV->WRITE_HOOK rather than calling ENV->WRITE_HOOK afterwards. - (grub_env_get): Return the result of ENV->READ_HOOK rather than + (VasEBoot_env_get): Return the result of ENV->READ_HOOK rather than passing a pointer of a pointer. - (grub_register_variable_hook): Change the types of "read_hook" and - "write_hook" to grub_env_read_hook_t and grub_env_write_hook_t, + (VasEBoot_register_variable_hook): Change the types of "read_hook" and + "write_hook" to VasEBoot_env_read_hook_t and VasEBoot_env_write_hook_t, respectively. Allocate the default empty string on the heap, because this string may be freed later. - * kern/device.c: Include grub/env.h. - (grub_device_set_root): Removed. - (grub_device_get_root): Likewise. - (grub_device_open): Use grub_env_get instead of - grub_device_get_root. + * kern/device.c: Include VasEBoot/env.h. + (VasEBoot_device_set_root): Removed. + (VasEBoot_device_get_root): Likewise. + (VasEBoot_device_open): Use VasEBoot_env_get instead of + VasEBoot_device_get_root. - * include/grub/env.h (grub_env_read_hook_t): New type. - (grub_env_write_hook_t): Likewise. - (grub_env_var): Change the types of "read_hook" and "write_hook" - to grub_env_read_hook_t and grub_env_write_hook_t, respectively. - (grub_register_variable_hook): Likewise. + * include/VasEBoot/env.h (VasEBoot_env_read_hook_t): New type. + (VasEBoot_env_write_hook_t): Likewise. + (VasEBoot_env_var): Change the types of "read_hook" and "write_hook" + to VasEBoot_env_read_hook_t and VasEBoot_env_write_hook_t, respectively. + (VasEBoot_register_variable_hook): Likewise. - * include/grub/device.h (grub_device_set_root): Removed. - (grub_device_set_root): Likewise. + * include/VasEBoot/device.h (VasEBoot_device_set_root): Removed. + (VasEBoot_device_set_root): Likewise. - * fs/fat.c (grub_fat_dir): Make a copy of PATH in DIRNAME, and + * fs/fat.c (VasEBoot_fat_dir): Make a copy of PATH in DIRNAME, and make sure that DIRNAME terminates with '/', so that - grub_fat_find_dir will fail if PATH is not a directory. + VasEBoot_fat_find_dir will fail if PATH is not a directory. - * commands/ls.c (grub_ls_list_files): Remove the qualifier const + * commands/ls.c (VasEBoot_ls_list_files): Remove the qualifier const from DIRNAME. Use the qualifier auto for print_files and print_files_long. - If FS->DIR sets GRUB_ERRNO to GRUB_ERR_BAD_FILE_TYPE, try DIRNAME + If FS->DIR sets VasEBoot_ERRNO to VasEBoot_ERR_BAD_FILE_TYPE, try DIRNAME as a regular file. Put a newline only if there is no error. - (grub_cmd_ls): Remove grub_ls_print_files, because this is not + (VasEBoot_cmd_ls): Remove VasEBoot_ls_print_files, because this is not used. 2005-07-20 Yoshinori K. Okuji - * kern/partition.c (grub_partition_probe): Initialize PART to + * kern/partition.c (VasEBoot_partition_probe): Initialize PART to NULL. Otherwise, when no partition map is registered, this returns a garbage. 2005-07-19 Yoshinori K. Okuji * partmap/apple.c (apple_partition_map_iterate): Check if POS - equals GRUB_DISK_SECTOR_SIZE to see if the partition table is + equals VasEBoot_DISK_SECTOR_SIZE to see if the partition table is valid. 2005-07-18 Yoshinori K. Okuji - * commands/ls.c (grub_ls_list_disks): Print the filesystem + * commands/ls.c (VasEBoot_ls_list_disks): Print the filesystem information on each device, if it does not have partitions. Print "Device" instead of "Disk", because this function is not specific to disk devices. - * normal/main.c (grub_rescue_cmd_normal): Make the variable CONFIG + * normal/main.c (VasEBoot_rescue_cmd_normal): Make the variable CONFIG static to ensure that it is put on the memory rather than a register. 2005-07-17 Yoshinori Okuji - * commands/cat.c (GRUB_MOD_INIT): Use better documentation. - (grub_cat_init): Likewise. - * loader/i386/pc/chainloader_normal.c (GRUB_MOD_INIT): Likewise. + * commands/cat.c (VasEBoot_MOD_INIT): Use better documentation. + (VasEBoot_cat_init): Likewise. + * loader/i386/pc/chainloader_normal.c (VasEBoot_MOD_INIT): Likewise. (options): Likewise. - * commands/configfile.c (GRUB_MOD_INIT): Likewise. - (grub_configfile_init): Likewise. - * font/manager.c (GRUB_MOD_INIT): Likewise. - * commands/help.c (GRUB_MOD_INIT): Likewise. - (grub_help_init): Likewise. - * normal/command.c (grub_command_init): Likewise. - * loader/i386/pc/linux_normal.c (GRUB_MOD_INIT): Likewise. - * disk/loopback.c (grub_loop_init): Likewise. - (GRUB_MOD_INIT): Likewise. - * commands/ls.c (grub_ls_init): Likewise. - (GRUB_MOD_INIT): Likewise. + * commands/configfile.c (VasEBoot_MOD_INIT): Likewise. + (VasEBoot_configfile_init): Likewise. + * font/manager.c (VasEBoot_MOD_INIT): Likewise. + * commands/help.c (VasEBoot_MOD_INIT): Likewise. + (VasEBoot_help_init): Likewise. + * normal/command.c (VasEBoot_command_init): Likewise. + * loader/i386/pc/linux_normal.c (VasEBoot_MOD_INIT): Likewise. + * disk/loopback.c (VasEBoot_loop_init): Likewise. + (VasEBoot_MOD_INIT): Likewise. + * commands/ls.c (VasEBoot_ls_init): Likewise. + (VasEBoot_MOD_INIT): Likewise. (options): Likewise. - * commands/boot.c (grub_boot_init): Likewise. - (GRUB_MOD_INIT): Likewise. - * loader/i386/pc/multiboot_normal.c (GRUB_MOD_INIT): Likewise. - * commands/i386/pc/reboot.c (grub_reboot_init): Likewise. - (GRUB_MOD_INIT): Likewise. - * commands/cmp.c (grub_cmp_init): Likewise. - (GRUB_MOD_INIT): Likewise. + * commands/boot.c (VasEBoot_boot_init): Likewise. + (VasEBoot_MOD_INIT): Likewise. + * loader/i386/pc/multiboot_normal.c (VasEBoot_MOD_INIT): Likewise. + * commands/i386/pc/reboot.c (VasEBoot_reboot_init): Likewise. + (VasEBoot_MOD_INIT): Likewise. + * commands/cmp.c (VasEBoot_cmp_init): Likewise. + (VasEBoot_MOD_INIT): Likewise. * normal/arg.c: Use <> instead of "" to include header files. (SHORT_ARG_HELP): New macro. @@ -52893,25 +52893,25 @@ of 'h' and 'u' for help and usage, respectively. Use more GNU-like descriptions. (find_short): Check if C is 'h' or 'u' explicitly. - (grub_arg_show_help): Use space characters instead of tabs. Treat + (VasEBoot_arg_show_help): Use space characters instead of tabs. Treat SHORT_ARG_HELP and SHORT_ARG_USAGE exceptionally so that -h and -u are shown with --help and --usage only if they are not used for the command itself. (parse_option): Use SHORT_ARG_HELP and SHORT_ARG_USAGE instead of 'h' and 'u'. - * include/grub/arg.h (struct grub_arg_option): Add the qualifier + * include/VasEBoot/arg.h (struct VasEBoot_arg_option): Add the qualifier const into "longarg". Change the type of "shortarg" to int. 2005-07-17 Yoshinori Okuji * boot/i386/pc/boot.S (boot_drive_check): New label. - * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_DRIVE_CHECK): New + * include/VasEBoot/i386/pc/boot.h (VasEBoot_BOOT_MACHINE_DRIVE_CHECK): New macro. - * util/i386/pc/grub-setup.c (setup): Added a workaround for BIOSes - which do not pass a boot drive correctly. Copied from GRUB Legacy. + * util/i386/pc/VasEBoot-setup.c (setup): Added a workaround for BIOSes + which do not pass a boot drive correctly. Copied from VasEBoot Legacy. 2005-07-17 Yoshinori Okuji @@ -52933,65 +52933,65 @@ 2005-07-16 Yoshinori K. Okuji - * kern/i386/pc/startup.S (grub_gate_a20): Rewritten for + * kern/i386/pc/startup.S (VasEBoot_gate_a20): Rewritten for robustness. This routine now supports a BIOS call and System Control Port A to modify the gate A20. - * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_KERNEL_MACHINE_RAW_SIZE): Increased to 0x440. 2005-07-12 Hollis Blanchard - * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): dprintf the + * disk/powerpc/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): dprintf the device path and resulting ihandle. - (grub_ofdisk_close): dprintf the ihandle being closed. - (grub_ofdisk_read): dprintf function parameters. - * kern/mm.c (grub_mm_init_region): Likewise. + (VasEBoot_ofdisk_close): dprintf the ihandle being closed. + (VasEBoot_ofdisk_read): dprintf function parameters. + * kern/mm.c (VasEBoot_mm_init_region): Likewise. * loader/powerpc/ieee1275/linux.c: Remove extra whitespace. - (grub_linux_boot): dprintf the Linux entry point, initrd address and + (VasEBoot_linux_boot): dprintf the Linux entry point, initrd address and size, and boot arguments. - (grub_rescue_cmd_linux): dprintf each ELF segment's address and size + (VasEBoot_rescue_cmd_linux): dprintf each ELF segment's address and size before loading into memory. - (grub_rescue_cmd_initrd): dprintf the initrd's address and size + (VasEBoot_rescue_cmd_initrd): dprintf the initrd's address and size before loading into memory. 2005-07-12 Yoshinori K. Okuji * kern/mm.c: Added much documentation. - (GRUB_MM_ALIGN_LOG2): When GRUB_CPU_SIZEOF_VOID_P is + (VasEBoot_MM_ALIGN_LOG2): When VasEBoot_CPU_SIZEOF_VOID_P is 8, set to 5 instead of 8. 2005-07-10 Yoshinori Okuji - * DISTLIST: Added util/i386/pc/grub-mkimage.c. + * DISTLIST: Added util/i386/pc/VasEBoot-mkimage.c. - * conf/i386-pc.rmk (sbin_UTILITIES): Added grub-mkdevicemap. - (grub_mkdevicemap_SOURCES): New variable. + * conf/i386-pc.rmk (sbin_UTILITIES): Added VasEBoot-mkdevicemap. + (VasEBoot_mkdevicemap_SOURCES): New variable. - * util/i386/pc/grub-mkdevicemap.c: New file. Mostly copied from - lib/device.c of GRUB Legacy. + * util/i386/pc/VasEBoot-mkdevicemap.c: New file. Mostly copied from + lib/device.c of VasEBoot Legacy. 2005-07-10 Yoshinori Okuji - * commands/ls.c (grub_ls_list_files): Check if *PATH is NUL + * commands/ls.c (VasEBoot_ls_list_files): Check if *PATH is NUL instead of PATH is NULL. 2005-07-09 Vincent Pelletier * commands/cmp.c (BUFFER_SIZE): New macro. - (grub_cmd_cmp): Close the right file at the right time. Compare + (VasEBoot_cmd_cmp): Close the right file at the right time. Compare only data just read. Don't report files of different size as identical. Dynamically allocate buffers. Move variable declarations at the beginning of function. 2005-07-09 Yoshinori Okuji - * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): The return value was + * aclocal.m4 (VasEBoot_I386_CHECK_REGPARM_BUG): The return value was reverse. 2004-07-04 Vincent Pelletier - * normal/cmdline.c (grub_cmdline_get): Don't fallback on ctrl-d + * normal/cmdline.c (VasEBoot_cmdline_get): Don't fallback on ctrl-d when backspace is pressed at beginning of line. 2005-07-03 Yoshinori Okuji @@ -53001,16 +53001,16 @@ * normal/main.c (fs_module_list): New variable. (autoload_fs_module): New function. (read_fs_list): Likewise. - (grub_normal_execute): Call read_fs_list. + (VasEBoot_normal_execute): Call read_fs_list. - * kern/fs.c (grub_fs_autoload_hook): New variable. - (grub_fs_probe): Added support for auto-loading. + * kern/fs.c (VasEBoot_fs_autoload_hook): New variable. + (VasEBoot_fs_probe): Added support for auto-loading. - * include/grub/normal.h (struct grub_fs_module_list): New struct. - (grub_fs_module_list_t): New type. + * include/VasEBoot/normal.h (struct VasEBoot_fs_module_list): New struct. + (VasEBoot_fs_module_list_t): New type. - * include/grub/fs.h (grub_fs_autoload_hook_t): New type. - (grub_fs_autoload_hook): New prototype. + * include/VasEBoot/fs.h (VasEBoot_fs_autoload_hook_t): New type. + (VasEBoot_fs_autoload_hook): New prototype. * genfslist.sh: New file. @@ -53021,21 +53021,21 @@ * configure.ac: Fix the test for cross-compiling. * genmk.rb (Program): Use `$(CC)' instead of `$(BUILD_CC)'. Don't - define GRUB_UTIL anymore. + define VasEBoot_UTIL anymore. - * util/powerpc/ieee1275/grub-mkimage.c (load_note): Endian fixes + * util/powerpc/ieee1275/VasEBoot-mkimage.c (load_note): Endian fixes so this function works on other systems than just big endian. (load_modules): Likewise. (add_segments): Likewise. 2005-06-23 Hollis Blanchard - * kern/misc.c (grub_vsprintf): Add `longfmt'. If format string + * kern/misc.c (VasEBoot_vsprintf): Add `longfmt'. If format string contains `l' modifier, get a long from va_arg(). 2005-06-23 Yoshinori K. Okuji - * kern/mm.c (grub_free): If the next free block which is being + * kern/mm.c (VasEBoot_free): If the next free block which is being merged is the first free block, set the first block to the block being freed. Reported by Vincent Guffens . @@ -53043,137 +53043,137 @@ 2005-05-08 Hollis Blanchard * boot/powerpc/ieee1275/cmain.c (cmain): Initialize - `grub_ieee1275_chosen'. + `VasEBoot_ieee1275_chosen'. 2005-05-08 Hollis Blanchard * boot/powerpc/ieee1275/cmain.c (module_info): Remove definition. - (grub_ieee1275_chosen): New variable. - (cmain): Initialize and use `grub_ieee1275_chosen' instead of + (VasEBoot_ieee1275_chosen): New variable. + (cmain): Initialize and use `VasEBoot_ieee1275_chosen' instead of `chosen'. * boot/powerpc/ieee1275/crt0.S (init_stack): Remove stack space. - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property): + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_get_property): Rename first argument to `phandle' for consistency. - (grub_ieee1275_get_property_length): Likewise. - (grub_ieee1275_next_property): Likewise. Change type of first argument - to grub_ieee1275_phandle_t. - * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_entry_fn): + (VasEBoot_ieee1275_get_property_length): Likewise. + (VasEBoot_ieee1275_next_property): Likewise. Change type of first argument + to VasEBoot_ieee1275_phandle_t. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (VasEBoot_ieee1275_entry_fn): Move export next to declaration. - (grub_ieee1275_chosen): New variable. - * include/grub/powerpc/ieee1275/kernel.h (GRUB_IEEE1275_MODULE_BASE): + (VasEBoot_ieee1275_chosen): New variable. + * include/VasEBoot/powerpc/ieee1275/kernel.h (VasEBoot_IEEE1275_MODULE_BASE): Correct cosmetic typo. - * kern/powerpc/ieee1275/init.c (grub_set_prefix): Use - `grub_ieee1275_chosen'. - * kern/powerpc/ieee1275/openfw.c (grub_map): Likewise. - * loader/powerpc/ieee1275/linux.c (grub_linux_boot): Likewise. - (grub_rescue_cmd_linux): Set `initrd_addr' to 0. - * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_refresh): Use - `grub_ieee1275_chosen'. + * kern/powerpc/ieee1275/init.c (VasEBoot_set_prefix): Use + `VasEBoot_ieee1275_chosen'. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_map): Likewise. + * loader/powerpc/ieee1275/linux.c (VasEBoot_linux_boot): Likewise. + (VasEBoot_rescue_cmd_linux): Set `initrd_addr' to 0. + * term/powerpc/ieee1275/ofconsole.c (VasEBoot_ofconsole_refresh): Use + `VasEBoot_ieee1275_chosen'. 2005-05-10 Hollis Blanchard * boot/powerpc/ieee1275/cmain.c (cmain): Remove code to parse /chosen/bootargs. - * kern/powerpc/ieee1275/init.c (grub_machine_init): Parse + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_init): Parse /chosen/bootargs as "variable=value" pairs. 2005-05-08 Vincent Pelletier - * include/grub/misc.h (grub_dprintf): New macro. - (grub_real_dprintf): New prototype. - (grub_strword): Likewise. - (grub_iswordseparator): Likewise. - * kern/misc.c (grub_real_dprintf): New function. - (grub_strword): Likewise. - (grub_iswordseparator): Likewise. + * include/VasEBoot/misc.h (VasEBoot_dprintf): New macro. + (VasEBoot_real_dprintf): New prototype. + (VasEBoot_strword): Likewise. + (VasEBoot_iswordseparator): Likewise. + * kern/misc.c (VasEBoot_real_dprintf): New function. + (VasEBoot_strword): Likewise. + (VasEBoot_iswordseparator): Likewise. 2005-04-30 Hollis Blanchard - * boot/powerpc/ieee1275/cmain.c: Don't include grub/machine/init.h. + * boot/powerpc/ieee1275/cmain.c: Don't include VasEBoot/machine/init.h. (roundup): Remove macro. - (grub_ieee1275_flags): Make static. - (grub_ieee1275_realmode): Remove. - (grub_ieee1275_test_flag): New function. - (grub_ieee1275_set_flag): Likewise. - (find_options): Rename to `grub_ieee1275_find_options'; update - callers. Set GRUB_IEEE1275_FLAG_REAL_MODE and - GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS. + (VasEBoot_ieee1275_flags): Make static. + (VasEBoot_ieee1275_realmode): Remove. + (VasEBoot_ieee1275_test_flag): New function. + (VasEBoot_ieee1275_set_flag): Likewise. + (find_options): Rename to `VasEBoot_ieee1275_find_options'; update + callers. Set VasEBoot_IEEE1275_FLAG_REAL_MODE and + VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS. (cmain): New prototype. - (cmain): Use `grub_ieee1275_set_flag' instead of accessing - `grub_ieee1275_flags' directly. - * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Remove + (cmain): Use `VasEBoot_ieee1275_set_flag' instead of accessing + `VasEBoot_ieee1275_flags' directly. + * conf/powerpc-ieee1275.rmk (VasEBootof_HEADERS): Remove machine/biosdisk.h. - * disk/powerpc/ieee1275/ofdisk.c: Include grub/machine/ofdisk.h. - Don't include grub/machine/init.h. - (grub_ofdisk_open): Call `grub_ieee1275_test_flag'. - * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags): + * disk/powerpc/ieee1275/ofdisk.c: Include VasEBoot/machine/ofdisk.h. + Don't include VasEBoot/machine/init.h. + (VasEBoot_ofdisk_open): Call `VasEBoot_ieee1275_test_flag'. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (VasEBoot_ieee1275_flags): Remove prototype. - (grub_ieee1275_realmode): Likewise. - (grub_ieee1275_flag): New enum. - (grub_ieee1275_test_flag): New prototype. - (grub_ieee1275_set_flag): New prototype. - * include/grub/powerpc/ieee1275/init.h: Remove file. - * include/grub/powerpc/ieee1275/ofdisk.h: New file. - * kern/powerpc/ieee1275/init.c: Don't include grub/machine/init.h. - Include grub/machine/console.h. Include grub/machine/ofdisk.h. - (grub_machine_fini): Don't call `grub_ieee1275_release'. Remove + (VasEBoot_ieee1275_realmode): Likewise. + (VasEBoot_ieee1275_flag): New enum. + (VasEBoot_ieee1275_test_flag): New prototype. + (VasEBoot_ieee1275_set_flag): New prototype. + * include/VasEBoot/powerpc/ieee1275/init.h: Remove file. + * include/VasEBoot/powerpc/ieee1275/ofdisk.h: New file. + * kern/powerpc/ieee1275/init.c: Don't include VasEBoot/machine/init.h. + Include VasEBoot/machine/console.h. Include VasEBoot/machine/ofdisk.h. + (VasEBoot_machine_fini): Don't call `VasEBoot_ieee1275_release'. Remove comment. - * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Call - `grub_ieee1275_test_flag'. - (grub_ieee1275_encode_devname): Likewise. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_claimmap): Call + `VasEBoot_ieee1275_test_flag'. + (VasEBoot_ieee1275_encode_devname): Likewise. 2005-04-21 Hollis Blanchard - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_encode_devname): New prototype. - (grub_ieee1275_get_filename): Likewise. - * kern/powerpc/ieee1275/init.c (grub_translate_ieee175_path): New + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_encode_devname): New prototype. + (VasEBoot_ieee1275_get_filename): Likewise. + * kern/powerpc/ieee1275/init.c (VasEBoot_translate_ieee175_path): New function. - (grub_set_prefix): Likewise. - (grub_machine_init): Call grub_set_prefix. + (VasEBoot_set_prefix): Likewise. + (VasEBoot_machine_init): Call VasEBoot_set_prefix. * kern/powerpc/ieee1275/openfw.c: Fix typos. - (grub_parse_type): New enum. - (grub_ieee1275_get_devargs): New function. - (grub_ieee1275_get_devname): Likewise. - (grub_ieee1275_parse_args): Likewise. - (grub_ieee1275_get_filename): Likewise. - (grub_ieee1275_encode_devname): Likewise. + (VasEBoot_parse_type): New enum. + (VasEBoot_ieee1275_get_devargs): New function. + (VasEBoot_ieee1275_get_devname): Likewise. + (VasEBoot_ieee1275_parse_args): Likewise. + (VasEBoot_ieee1275_get_filename): Likewise. + (VasEBoot_ieee1275_encode_devname): Likewise. 2005-03-30 Marco Gerards - * kern/powerpc/ieee1275/init.c (grub_machine_fini): Don't call - `grub_loader_unset'. + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_fini): Don't call + `VasEBoot_loader_unset'. 2005-03-26 Hollis Blanchard - * commands/ieee1275/halt.c (grub_cmd_halt): Call grub_halt - instead of grub_ieee1275_interpret. - (grub_halt_init): New function. - (grub_halt_fini): Likewise. - (GRUB_MOD_INIT): Correct message grammar. - * commands/ieee1275/reboot.c (grub_cmd_reboot): Call grub_reboot - instead of grub_ieee1275_interpret. - (grub_reboot_init): New function. - (grub_reboot_fini): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Replace + * commands/ieee1275/halt.c (VasEBoot_cmd_halt): Call VasEBoot_halt + instead of VasEBoot_ieee1275_interpret. + (VasEBoot_halt_init): New function. + (VasEBoot_halt_fini): Likewise. + (VasEBoot_MOD_INIT): Correct message grammar. + * commands/ieee1275/reboot.c (VasEBoot_cmd_reboot): Call VasEBoot_reboot + instead of VasEBoot_ieee1275_interpret. + (VasEBoot_reboot_init): New function. + (VasEBoot_reboot_fini): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Replace commands/i386/pc/halt.c, commands/i386/pc/reboot.c, and util/i386/pc/misc.c with commands/ieee1275/halt.c, commands/ieee1275/reboot.c, and util/powerpc/ieee1275/misc.c. - * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_fini): New + * disk/powerpc/ieee1275/ofdisk.c (VasEBoot_ofdisk_fini): New function. - * include/grub/powerpc/ieee1275/console.h (grub_console_fini): + * include/VasEBoot/powerpc/ieee1275/console.h (VasEBoot_console_fini): Add prototype. - * include/grub/powerpc/ieee1275/ieee1275.h (grub_reboot): Add + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (VasEBoot_reboot): Add prototype. - (grub_halt): Likewise. - * include/grub/powerpc/ieee1275/init.h: Remove inaccurate comment. + (VasEBoot_halt): Likewise. + * include/VasEBoot/powerpc/ieee1275/init.h: Remove inaccurate comment. (cmain): Remove __attribute__((unused)). - * kern/powerpc/ieee1275/init.c (grub_heap_start): New variable. - (grub_heap_len): Likewise. - (grub_machine_fini): New function. - * kern/powerpc/ieee1275/openfw.c (grub_reboot): New function. - (grub_halt): Likewise. - * term/powerpc/ieee1275/ofconsole.c (grub_console_fini): New + * kern/powerpc/ieee1275/init.c (VasEBoot_heap_start): New variable. + (VasEBoot_heap_len): Likewise. + (VasEBoot_machine_fini): New function. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_reboot): New function. + (VasEBoot_halt): Likewise. + * term/powerpc/ieee1275/ofconsole.c (VasEBoot_console_fini): New function. * util/powerpc/ieee1275/misc.c: New file. @@ -53200,8 +53200,8 @@ 2005-03-18 Yoshinori K. Okuji - * fs/fat.c (grub_fat_mount): Ignore the 3rd bit of a media - descriptor. This is ported from GRUB Legacy. + * fs/fat.c (VasEBoot_fat_mount): Ignore the 3rd bit of a media + descriptor. This is ported from VasEBoot Legacy. * gencmdlist.sh: Added an extra semicolon to make it work with old sed versions. Reported by Robert Bihlmeyer @@ -53212,28 +53212,28 @@ Automatic loading of commands is supported. * normal/main.c (read_command_list): New function. - (grub_normal_execute): Call read_command_list. + (VasEBoot_normal_execute): Call read_command_list. - * normal/command.c (grub_register_command): Return zero or CMD. + * normal/command.c (VasEBoot_register_command): Return zero or CMD. Allocate CMD->NAME from the heap. Initialize CMD->MODULE_NAME to zero. Find the same name as well. If the same command is found and it is a dummy command, overwrite members. If it is not a dummy command, return zero. - (grub_unregister_command): Free Q->NAME and Q->MODULE_NAME. - (grub_command_find): If a dummy command is found, load a module + (VasEBoot_unregister_command): Free Q->NAME and Q->MODULE_NAME. + (VasEBoot_command_find): If a dummy command is found, load a module and retry to find a command only once. - * normal/cmdline.c (grub_tab_complete): Call grub_command_find to + * normal/cmdline.c (VasEBoot_tab_complete): Call VasEBoot_command_find to make sure that each command is loaded. - * include/grub/normal.h (GRUB_COMMAND_FLAG_NOT_LOADED): New + * include/VasEBoot/normal.h (VasEBoot_COMMAND_FLAG_NOT_LOADED): New macro. - (struct grub_command): Remove const from the member `name'. + (struct VasEBoot_command): Remove const from the member `name'. Add a new member `module_name'. - (grub_register_command): Return grub_command_t. + (VasEBoot_register_command): Return VasEBoot_command_t. - * commands/help.c (grub_cmd_help): Call grub_command_find to make + * commands/help.c (VasEBoot_cmd_help): Call VasEBoot_command_find to make sure that each command is loaded. * genmk.rb (PModule::rule): Specify a module name without the @@ -53254,32 +53254,32 @@ 2005-03-02 Yoshinori K. Okuji * term/i386/pc/vga.c (debug_command): Removed. - (GRUB_MOD_INIT): Do not register the command "debug". + (VasEBoot_MOD_INIT): Do not register the command "debug". From Hollis Blanchard: * commands/configfile.c: New file. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added commands/configfile.c. (pkgdata_MODULES): Added configfile.mod. (configfile_mod_SOURCES): New variable. (configfile_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Added commands/configfile.c. (pkgdata_MODULES): Added configfile.mod. (configfile_mod_SOURCES): New variable. (configfile_mod_CFLAGS): Likewise. - * util/grub-emu.c (main): Call grub_configfile_init and - grub_configfile_fini. - * include/grub/normal.h [GRUB_UTIL] (grub_configfile_init): New + * util/VasEBoot-emu.c (main): Call VasEBoot_configfile_init and + VasEBoot_configfile_fini. + * include/VasEBoot/normal.h [VasEBoot_UTIL] (VasEBoot_configfile_init): New prototype. - [GRUB_UTIL] (grub_configfile_fini): Likewise. + [VasEBoot_UTIL] (VasEBoot_configfile_fini): Likewise. 2005-02-27 Yoshinori K. Okuji - * normal/arg.c (grub_arg_show_help): Do not show the bug report + * normal/arg.c (VasEBoot_arg_show_help): Do not show the bug report address. - * commands/help.c (grub_cmd_help): Do not print newlines after + * commands/help.c (VasEBoot_cmd_help): Do not print newlines after the last command in print_command_help. 2005-02-27 Yoshinori K. Okuji @@ -53289,14 +53289,14 @@ * normal/context.c: Likewise. * util/misc.c: Do not include sys/times.h. - Include sys/time.h and grub/machine/time.h. - (grub_get_rtc): Rewritten with gettimeofday. + Include sys/time.h and VasEBoot/machine/time.h. + (VasEBoot_get_rtc): Rewritten with gettimeofday. - * util/grub-emu.c (main): Call grub_default_init and - grub_timeout_init before grub_normal_init, and call - grub_timeout_fini and grub_default_fini after grub_main. + * util/VasEBoot-emu.c (main): Call VasEBoot_default_init and + VasEBoot_timeout_init before VasEBoot_normal_init, and call + VasEBoot_timeout_fini and VasEBoot_default_fini after VasEBoot_main. - * util/console.c (grub_ncurses_checkkey): Return the read + * util/console.c (VasEBoot_ncurses_checkkey): Return the read character or -1. * normal/menu.c (run_menu): Set MENU->TIMEOUT to -1 once it @@ -53304,38 +53304,38 @@ * normal/main.c (read_config_file): Push MENU. If this fails, print an error and wait for a user input. - Print an error only if GRUB_ERRNO is not GRUB_ERR_NONE. + Print an error only if VasEBoot_ERRNO is not VasEBoot_ERR_NONE. If a menu is empty or an error occurs, pop MENU. - (grub_normal_execute): Pop and free MENU after grub_menu_run + (VasEBoot_normal_execute): Pop and free MENU after VasEBoot_menu_run returns. - * kern/loader.c (grub_loader_boot): Call grub_machine_fini. + * kern/loader.c (VasEBoot_loader_boot): Call VasEBoot_machine_fini. - * include/grub/powerpc/ieee1275/time.h [GRUB_UTIL]: Do not + * include/VasEBoot/powerpc/ieee1275/time.h [VasEBoot_UTIL]: Do not include time.h. - [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as - without GRUB_UTIL. - * include/grub/i386/pc/time.h [GRUB_UTIL]: Do not include + [VasEBoot_UTIL] (VasEBoot_TICKS_PER_SECOND): Use the same definition as + without VasEBoot_UTIL. + * include/VasEBoot/i386/pc/time.h [VasEBoot_UTIL]: Do not include time.h. - [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as - without GRUB_UTIL. + [VasEBoot_UTIL] (VasEBoot_TICKS_PER_SECOND): Use the same definition as + without VasEBoot_UTIL. - * include/grub/normal.h (struct grub_menu_list): New struct. - (grub_menu_list_t): New type. - (struct grub_context): New struct. - (grub_context_t): New type. - (grub_register_command): Got rid of EXPORT_FUNC. - (grub_unregister_command): Likewise. - (grub_context_get): New prototype. - (grub_context_get_current_menu): Likewise. - (grub_context_push_menu): Likewise. - (grub_context_pop_menu): Likewise. - [GRUB_UTIL] (grub_default_init): Likewise. - [GRUB_UTIL] (grub_default_fini): Likewise. - [GRUB_UTIL] (grub_timeout_init): Likewise. - [GRUB_UTIL] (grub_timeout_fini): Likewise. + * include/VasEBoot/normal.h (struct VasEBoot_menu_list): New struct. + (VasEBoot_menu_list_t): New type. + (struct VasEBoot_context): New struct. + (VasEBoot_context_t): New type. + (VasEBoot_register_command): Got rid of EXPORT_FUNC. + (VasEBoot_unregister_command): Likewise. + (VasEBoot_context_get): New prototype. + (VasEBoot_context_get_current_menu): Likewise. + (VasEBoot_context_push_menu): Likewise. + (VasEBoot_context_pop_menu): Likewise. + [VasEBoot_UTIL] (VasEBoot_default_init): Likewise. + [VasEBoot_UTIL] (VasEBoot_default_fini): Likewise. + [VasEBoot_UTIL] (VasEBoot_timeout_init): Likewise. + [VasEBoot_UTIL] (VasEBoot_timeout_fini): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/default.c, + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added commands/default.c, commands/timeout.c and normal/context.c. (pkgdata_MODULES): Added default.mod and timeout.mod. (normal_mod_SOURCES): Added normal/context.c. @@ -53343,7 +53343,7 @@ (default_mod_CFLAGS): Likewise. (timeout_mod_SOURCES): Likewise. (timeout_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Copied from + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Copied from conf/i386-pc.rmk. (pkgdata_MODULES): Added default.mod and timeout.mod. (normal_mod_SOURCES): Added normal/context.c. @@ -53356,19 +53356,19 @@ 2005-02-21 Vincent Pelletier - * conf/i386-pc.rmk (grub_setup_SOURCES): Add `partmap/sun.c'. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add `partmap/sun.c'. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add `sun.mod'. (sun_mod_SOURCES, sun_mod_CFLAGS): New variables. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `partmap/sun.c'. (pkgdata_MODULES): Add `sun.mod'. (sun_mod_SOURCES, sun_mod_CFLAGS): New variables. - * include/grub/partition.h (grub_sun_partition_map_init): New + * include/VasEBoot/partition.h (VasEBoot_sun_partition_map_init): New prototype. - (grub_sun_partition_map_fini): Likewise. + (VasEBoot_sun_partition_map_fini): Likewise. * partmap/sun.c: New file. - * util/grub-emu.c (main): Initialize and de-initialize the sun + * util/VasEBoot-emu.c (main): Initialize and de-initialize the sun partitionmap support. 2005-02-19 Yoshinori K. Okuji @@ -53377,240 +53377,240 @@ * normal/menu_entry.c: New file. - * util/console.c (grub_ncurses_putchar): Translate some Unicode + * util/console.c (VasEBoot_ncurses_putchar): Translate some Unicode characters to ASCII. (saved_char): New variable. - (grub_ncurses_checkkey): Rewritten completely. - (grub_ncurses_getkey): Likewise. - (grub_ncurses_init): Call raw instead of cbreak. + (VasEBoot_ncurses_checkkey): Rewritten completely. + (VasEBoot_ncurses_getkey): Likewise. + (VasEBoot_ncurses_init): Call raw instead of cbreak. * normal/menu.c (print_entry): Do not put a space. (init_page): Renamed to ... - (grub_menu_init_page): ... this. All callers changed. + (VasEBoot_menu_init_page): ... this. All callers changed. (edit_menu_entry): Removed. - (run_menu): Call grub_menu_entry_run instead of edit_menu_entry. + (run_menu): Call VasEBoot_menu_entry_run instead of edit_menu_entry. - * normal/cmdline.c (grub_cmdline_run): Call grub_setcursor. + * normal/cmdline.c (VasEBoot_cmdline_run): Call VasEBoot_setcursor. - * kern/misc.c (grub_vprintf): Call grub_refresh. + * kern/misc.c (VasEBoot_vprintf): Call VasEBoot_refresh. * normal/menu.c (DISP_LEFT): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_LEFT): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_LEFT): ... this. * normal/menu.c (DISP_UP): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_UP): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_UP): ... this. * normal/menu.c (DISP_RIGHT): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_RIGHT): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_RIGHT): ... this. * normal/menu.c (DISP_DOWN): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_DOWN): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_DOWN): ... this. * normal/menu.c (DISP_HLINE): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_HLINE): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_HLINE): ... this. * normal/menu.c (DISP_VLINE): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_VLINE): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_VLINE): ... this. * normal/menu.c (DISP_UL): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_UL): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_UL): ... this. * normal/menu.c (DISP_UR): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_UR): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_UR): ... this. * normal/menu.c (DISP_LL): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_LL): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_LL): ... this. * normal/menu.c (DISP_LR): Renamed to ... - * include/grub/term.h (GRUB_TERM_DISP_LR): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_DISP_LR): ... this. * normal/menu.c (TERM_WIDTH): Renamed to ... - * include/grub/term.h (GRUB_TERM_WIDTH): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_WIDTH): ... this. * normal/menu.c (TERM_HEIGHT): Renamed to ... - * include/grub/term.h (GRUB_TERM_HEIGHT): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_HEIGHT): ... this. * normal/menu.c (TERM_INFO_HEIGHT): Renamed to ... - * include/grub/term.h (GRUB_TERM_INFO_HEIGHT): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_INFO_HEIGHT): ... this. * normal/menu.c (TERM_MARGIN): Renamed to ... - * include/grub/term.h (GRUB_TERM_MARGIN): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_MARGIN): ... this. * normal/menu.c (TERM_SCROLL_WIDTH): Renamed to ... - * include/grub/term.h (GRUB_TERM_SCROLL_WIDTH): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_SCROLL_WIDTH): ... this. * normal/menu.c (TERM_TOP_BORDER_Y): Renamed to ... - * include/grub/term.h (GRUB_TERM_TOP_BORDER_Y): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_TOP_BORDER_Y): ... this. * normal/menu.c (TERM_LEFT_BORDER_X): Renamed to ... - * include/grub/term.h (GRUB_TERM_LEFT_BORDER_X): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_LEFT_BORDER_X): ... this. * normal/menu.c (TERM_BORDER_WIDTH): Renamed to ... - * include/grub/term.h (GRUB_TERM_BORDER_WIDTH): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_BORDER_WIDTH): ... this. * normal/menu.c (TERM_MESSAGE_HEIGHT): Renamed to ... - * include/grub/term.h (GRUB_TERM_MESSAGE_HEIGHT): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_MESSAGE_HEIGHT): ... this. * normal/menu.c (TERM_BORDER_HEIGHT): Renamed to ... - * include/grub/term.h (GRUB_TERM_BORDER_HEIGHT): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_BORDER_HEIGHT): ... this. * normal/menu.c (TERM_NUM_ENTRIES): Renamed to ... - * include/grub/term.h (GRUB_TERM_NUM_ENTRIES): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_NUM_ENTRIES): ... this. * normal/menu.c (TERM_FIRST_ENTRY_Y): Renamed to ... - * include/grub/term.h (GRUB_TERM_FIRST_ENTRY_Y): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_FIRST_ENTRY_Y): ... this. * normal/menu.c (TERM_ENTRY_WIDTH): Renamed to ... - * include/grub/term.h (GRUB_TERM_ENTRY_WIDTH): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_ENTRY_WIDTH): ... this. * normal/menu.c (TERM_CURSOR_X): Renamed to ... - * include/grub/term.h (GRUB_TERM_CURSOR_X): ... this. + * include/VasEBoot/term.h (VasEBoot_TERM_CURSOR_X): ... this. All callers changed. - * include/grub/normal.h: New prototype. + * include/VasEBoot/normal.h: New prototype. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added normal/menu_entry.c. (normal_mod_SOURCES): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. 2005-02-15 Yoshinori K. Okuji - * include/grub/normal.h (grub_halt_init): New prototype. - (grub_halt_fini): Likewise. - (grub_reboot_init): Likewise. - (grub_reboot_fini): Likewise. + * include/VasEBoot/normal.h (VasEBoot_halt_init): New prototype. + (VasEBoot_halt_fini): Likewise. + (VasEBoot_reboot_init): Likewise. + (VasEBoot_reboot_fini): Likewise. - * util/grub-emu.c: Include signal.h. + * util/VasEBoot-emu.c: Include signal.h. (main_env): New global variable. - (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot + (VasEBoot_machine_init): Ignore SIGINT. Otherwise VasEBoot-emu cannot catch C-c. - (grub_machine_fini): New function. - (main): Call grub_halt_init and grub_reboot_init before - grub_main, and grub_reboot_fini and grub_halt_fini after it. + (VasEBoot_machine_fini): New function. + (main): Call VasEBoot_halt_init and VasEBoot_reboot_init before + VasEBoot_main, and VasEBoot_reboot_fini and VasEBoot_halt_fini after it. Call setjmp with MAIN_ENV to go back afterwards. - Call grub_machine_fini right before return. + Call VasEBoot_machine_fini right before return. - * include/grub/util/misc.h: Include setjmp.h. + * include/VasEBoot/util/misc.h: Include setjmp.h. (main_env): New prototype. - * include/grub/kernel.h (grub_machine_fini): New prototype. - * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise. - * include/grub/i386/pc/console.h (grub_console_fini): Likewise. + * include/VasEBoot/kernel.h (VasEBoot_machine_fini): New prototype. + * include/VasEBoot/i386/pc/biosdisk.h (VasEBoot_biosdisk_fini): Likewise. + * include/VasEBoot/i386/pc/console.h (VasEBoot_console_fini): Likewise. - * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function. - * kern/i386/pc/init.c (grub_machine_fini): Likewise. - * term/i386/pc/console.c (grub_console_fini): Likewise. + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_fini): New function. + * kern/i386/pc/init.c (VasEBoot_machine_fini): Likewise. + * term/i386/pc/console.c (VasEBoot_console_fini): Likewise. * util/i386/pc/misc.c: New file. - * conf/i386-pc.rmk (grub_emu_SOURCES): Added + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Added util/i386/pc/misc.c, commands/i386/pc/halt.c and commands/i386/pc/reboot.c. 2005-02-14 Guillem Jover - * include/grub/dl.h (grub_dl_check_header): New prototype. - (grub_arch_dl_check_header): Change return type to grub_err_t, + * include/VasEBoot/dl.h (VasEBoot_dl_check_header): New prototype. + (VasEBoot_arch_dl_check_header): Change return type to VasEBoot_err_t, remove size parameter and export function. Update all callers. - * kern/dl.c (grub_dl_check_header): New function. - (grub_dl_load_core): Use `grub_dl_check_header' instead of - `grub_arch_dl_check_header'. Check ELF type. Check if sections + * kern/dl.c (VasEBoot_dl_check_header): New function. + (VasEBoot_dl_load_core): Use `VasEBoot_dl_check_header' instead of + `VasEBoot_arch_dl_check_header'. Check ELF type. Check if sections are inside the core. - * kern/i386/dl.c (grub_arch_dl_check_header): Remove arch + * kern/i386/dl.c (VasEBoot_arch_dl_check_header): Remove arch independent ELF header checks. - * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise. - * loader/i386/pc/multiboot.c (grub_rescue_cmd_multiboot): Use - `grub_dl_check_header' instead of explicit checks. Check for the + * kern/powerpc/dl.c (VasEBoot_arch_dl_check_header): Likewise. + * loader/i386/pc/multiboot.c (VasEBoot_rescue_cmd_multiboot): Use + `VasEBoot_dl_check_header' instead of explicit checks. Check for the ELF type. - * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Use - `grub_dl_check_header' instead of explicit checks. Remove arch + * loader/powerpc/ieee1275/linux.c (VasEBoot_rescue_cmd_linux): Use + `VasEBoot_dl_check_header' instead of explicit checks. Remove arch specific ELF header checks. - * util/grub-emu.c (grub_arch_dl_check_header): Remove the + * util/VasEBoot-emu.c (VasEBoot_arch_dl_check_header): Remove the argument SIZE. 2005-02-13 Hollis Blanchard * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add ls.mod. - * include/grub/powerpc/libgcc.h (__mulsf3): New prototype. + * include/VasEBoot/powerpc/libgcc.h (__mulsf3): New prototype. 2005-02-12 Hollis Blanchard - * kern/partition.c (grub_partition_probe): Clear `grub_errno' and - return 0 if `grub_errno' is GRUB_ERR_BAD_PART_TABLE. - (part_map_iterate): Clear `grub_errno' and return 0 if - `partmap->iterate' returns GRUB_ERR_BAD_PART_TABLE. + * kern/partition.c (VasEBoot_partition_probe): Clear `VasEBoot_errno' and + return 0 if `VasEBoot_errno' is VasEBoot_ERR_BAD_PART_TABLE. + (part_map_iterate): Clear `VasEBoot_errno' and return 0 if + `partmap->iterate' returns VasEBoot_ERR_BAD_PART_TABLE. * partmap/amiga.c (amiga_partition_map_iterate): Return - GRUB_ERR_BAD_PART_TABLE if no partition map magic is found. + VasEBoot_ERR_BAD_PART_TABLE if no partition map magic is found. * partmap/apple.c (apple_partition_map_iterate): Likewise. 2005-02-01 Guillem Jover - * loader/i386/pc/multiboot_normal.c (GRUB_MOD_INIT): Fix module + * loader/i386/pc/multiboot_normal.c (VasEBoot_MOD_INIT): Fix module help info. 2005-01-31 Marco Gerards - * include/grub/powerpc/ieee1275/loader.h (grub_load_linux): + * include/VasEBoot/powerpc/ieee1275/loader.h (VasEBoot_load_linux): Removed prototype. - (grub_rescue_cmd_linux): New prototype. - (grub_rescue_cmd_initrd): Likewise. - * powerpc/ieee1275/linux.c (grub_linux_boot): Remove struct + (VasEBoot_rescue_cmd_linux): New prototype. + (VasEBoot_rescue_cmd_initrd): Likewise. + * powerpc/ieee1275/linux.c (VasEBoot_linux_boot): Remove struct `bi_rec'. - (grub_linux_release_mem): Release the memory for the initrd. - (grub_load_linux): Renamed from this... - (grub_rescue_cmd_linux): ...To this. Changed all callers. + (VasEBoot_linux_release_mem): Release the memory for the initrd. + (VasEBoot_load_linux): Renamed from this... + (VasEBoot_rescue_cmd_linux): ...To this. Changed all callers. Changed `entry' not to be static. Loop over memory regions to find another one when the default fails. - (grub_rescue_cmd_initrd): New function. - (grub_linux_init): Remove function. - (grub_linux_fini): Likewise. - (GRUB_MOD_INIT): Register `initrd'. - (GRUB_MOD_FINI): Unregister `initrd'. - * powerpc/ieee1275/linux_normal.c (grub_linux_normal_init): + (VasEBoot_rescue_cmd_initrd): New function. + (VasEBoot_linux_init): Remove function. + (VasEBoot_linux_fini): Likewise. + (VasEBoot_MOD_INIT): Register `initrd'. + (VasEBoot_MOD_FINI): Unregister `initrd'. + * powerpc/ieee1275/linux_normal.c (VasEBoot_linux_normal_init): Function removed. - (grub_linux_normal_fini): Likewise. - (GRUB_MOD_INIT): Register `initrd'. - (GRUB_MOD_FINI): Unregister `initrd'. + (VasEBoot_linux_normal_fini): Likewise. + (VasEBoot_MOD_INIT): Register `initrd'. + (VasEBoot_MOD_FINI): Unregister `initrd'. 2005-01-31 Marco Gerards * commands/help.c: New file. * normal/arg.c (show_help): Renamed to... - (grub_arg_show_help): ... this. + (VasEBoot_arg_show_help): ... this. * commands/i386/pc/halt.c: New file. * commands/i386/pc/reboot.c: Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/help.c'. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `commands/help.c'. (pkgdata_MODULES): Add `reboot.mod', `halt.mod' and `help.mod'. (help_mod_SOURCES, help_mod_CFLAGS, reboot_mod_SOURCES) (reboot_mod_CFLAGS, halt_mod_SOURCES, halt_mod_CFLAGS): New variables. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `commands/help.c'. (pkgdata_MODULES): Add `help.mod'. (help_mod_SOURCES, help_mod_CFLAGS): New variables. - * grub/i386/pc/init.h (grub_reboot): New prototype. - (grub_halt): Likewise. - * include/grub/normal.h (grub_arg_show_help): New prototype. - (grub_help_init): Likewise. - (grub_help_fini): Likewise. - * util/grub-emu.c (main): Initialize and deinitialize the help + * VasEBoot/i386/pc/init.h (VasEBoot_reboot): New prototype. + (VasEBoot_halt): Likewise. + * include/VasEBoot/normal.h (VasEBoot_arg_show_help): New prototype. + (VasEBoot_help_init): Likewise. + (VasEBoot_help_fini): Likewise. + * util/VasEBoot-emu.c (main): Initialize and deinitialize the help command. - * normal/cmdline.c (grub_cmdline_get): Doc fix. + * normal/cmdline.c (VasEBoot_cmdline_get): Doc fix. - * normal/command.c (grub_command_init): Fixed the description of + * normal/command.c (VasEBoot_command_init): Fixed the description of the `set' and `unset' commands. 2005-01-31 Marco Gerards - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_interpret): New + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_interpret): New function. * commands/ieee1275/halt.c: New file. * commands/ieee1275/reboot.c: Likewise. - * commands/ieee1275/suspend.c (grub_cmd_suspend): Use + * commands/ieee1275/suspend.c (VasEBoot_cmd_suspend): Use `__attribute__ ((unused))'. Some GCS related fixed. - (grub_suspend_init) [GRUB_UTIL]: Function removed. - (grub_suspend_fini): Likewise. + (VasEBoot_suspend_init) [VasEBoot_UTIL]: Function removed. + (VasEBoot_suspend_fini): Likewise. * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add `reboot.mod' and `halt.mod'. (reboot_mod_SOURCES, reboot_mod_CFLAGS, halt_mod_SOURCES) (halt_mod_CFLAGS): New variables. - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_interpret): New prototype. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_interpret): New prototype. 2005-01-29 Yoshinori K. Okuji - * include/grub/misc.h (memmove): New prototype. + * include/VasEBoot/misc.h (memmove): New prototype. (memcpy): Likewise. 2005-01-22 Hollis Blanchard - * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Don't initialize - `devpath' to 0. Use `name' instead of `devpath' with `grub_strndup'. + * disk/powerpc/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Don't initialize + `devpath' to 0. Use `name' instead of `devpath' with `VasEBoot_strndup'. 2005-01-22 Marco Gerards - * kern/misc.c (grub_strndup): Function rewritten. + * kern/misc.c (VasEBoot_strndup): Function rewritten. 2005-01-22 Vincent Pelletier @@ -53625,166 +53625,166 @@ 2005-01-21 Marco Gerards - * fs/minix.c (grub_minix_find_file): Reserve more space for - `fpath' so the \0 can be stored. Use `grub_strcpy' instead of - `grub_strncpy' to copy `path' into it. + * fs/minix.c (VasEBoot_minix_find_file): Reserve more space for + `fpath' so the \0 can be stored. Use `VasEBoot_strcpy' instead of + `VasEBoot_strncpy' to copy `path' into it. 2005-01-21 Marco Gerards Add the loopback device, a device via which files can be accessed as devices. - * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/loopback.c'. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add `disk/loopback.c'. (pkgdata_MODULES): Add loopback.mod. (loopback_mod_SOURCES): New variable. (loopback_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add `disk/loopback.c'. (pkgdata_MODULES): Add loopback.mod. (loopback_mod_SOURCES): New variable. (loopback_mod_CFLAGS): Likewise. * disk/loopback.c: new file. - * include/grub/normal.h (grub_loop_init): New prototype. - (grub_loop_fini): New prototype. - * util/grub-emu.c (main): Initialize and de-initialize loopback + * include/VasEBoot/normal.h (VasEBoot_loop_init): New prototype. + (VasEBoot_loop_fini): New prototype. + * util/VasEBoot-emu.c (main): Initialize and de-initialize loopback support. - * include/grub/disk.h (grub_disk_dev_id): Add - `GRUB_DISK_DEVICE_LOOPBACK_ID'. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): Add + `VasEBoot_DISK_DEVICE_LOOPBACK_ID'. 2005-01-20 Hollis Blanchard - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_enter): New + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_enter): New function. * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add suspend.mod. (suspend_mod_SOURCES): New variable. (suspend_mod_CFLAGS): Likewise. - * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_enter): + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (VasEBoot_ieee1275_enter): New prototype. * commands/ieee1275/suspend.c: New file. 2005-01-20 Timothy Baldwin - * include/grub/dl.h (GRUB_MOD_INIT): Changed `__attribute__ + * include/VasEBoot/dl.h (VasEBoot_MOD_INIT): Changed `__attribute__ ((unused))' to `__attribute__ ((used))'. - (GRUB_MOD_FINI): Likewise. - * kern/dl.c (grub_dl_load_file): Fix null pointer dereference. + (VasEBoot_MOD_FINI): Likewise. + * kern/dl.c (VasEBoot_dl_load_file): Fix null pointer dereference. * genmk.rb (PModule): Assign space to common symbols when linking modules. 2005-01-20 Marco Gerards - * include/grub/mm.h (grub_mm_init_region): Change the type of the - `unsigned' arguments to `grub_size_t'. - (grub_malloc): Likewise. - (grub_realloc): Likewise. - (grub_memalign): Likewise. - * kern/i386/dl.c (grub_arch_dl_check_header): Likewise. - * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise. - * util/misc.c (grub_malloc): Likewise. - (grub_realloc): Likewise. + * include/VasEBoot/mm.h (VasEBoot_mm_init_region): Change the type of the + `unsigned' arguments to `VasEBoot_size_t'. + (VasEBoot_malloc): Likewise. + (VasEBoot_realloc): Likewise. + (VasEBoot_memalign): Likewise. + * kern/i386/dl.c (VasEBoot_arch_dl_check_header): Likewise. + * kern/powerpc/dl.c (VasEBoot_arch_dl_check_header): Likewise. + * util/misc.c (VasEBoot_malloc): Likewise. + (VasEBoot_realloc): Likewise. * kern/mm.c (get_header_from_pointer): Change the casts to - `unsigned' into a cast to `grub_size_t'. + `unsigned' into a cast to `VasEBoot_size_t'. - * fs/fshelp.c (grub_fshelp_find_file): The `oldnode' should always + * fs/fshelp.c (VasEBoot_fshelp_find_file): The `oldnode' should always point to `currnode' when `currnode' is changed. - * util/grub-emu.c (main): Initialize `progname'. Reported by Nico + * util/VasEBoot-emu.c (main): Initialize `progname'. Reported by Nico Schottelius . 2005-01-09 Hollis Blanchard - * util/powerpc/ieee1275/grub-mkimage.c: Include . + * util/powerpc/ieee1275/VasEBoot-mkimage.c: Include . (note_path): Remove variable. - (GRUB_IEEE1275_NOTE_NAME): New macro. - (GRUB_IEEE1275_NOTE_TYPE): Likewise. - (grub_ieee1275_note_hdr): New structure. - (grub_ieee1275_note_desc): Likewise. - (grub_ieee1275_note): Likewise. + (VasEBoot_IEEE1275_NOTE_NAME): New macro. + (VasEBoot_IEEE1275_NOTE_TYPE): Likewise. + (VasEBoot_ieee1275_note_hdr): New structure. + (VasEBoot_ieee1275_note_desc): Likewise. + (VasEBoot_ieee1275_note): Likewise. (load_note): Remove `dir' argument. All callers updated. Remove `note_img' and `path'. Do not load a file from `note_path'. - Initialize a struct grub_ieee1275_note and write that to `out'. - Use GRUB_IEEE1275_MODULE_BASE instead of MODULE_BASE. + Initialize a struct VasEBoot_ieee1275_note and write that to `out'. + Use VasEBoot_IEEE1275_MODULE_BASE instead of MODULE_BASE. 2005-01-05 Marco Gerards - * util/misc.c (grub_util_read_image): Revert last change. It - called `grub_util_read_at', which seeks from the beginning of the + * util/misc.c (VasEBoot_util_read_image): Revert last change. It + called `VasEBoot_util_read_at', which seeks from the beginning of the file. 2005-01-04 Hollis Blanchard - * TODO: Add note about endianness in grub-mkimage. + * TODO: Add note about endianness in VasEBoot-mkimage. * boot/powerpc/ieee1275/crt0.S (note): Remove unused .note section. - * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add grub-mkimage. - (grub_mkimage_SOURCES): New target. - * include/grub/kernel.h (grub_start_addr): Remove variable. - (grub_end_addr): Likewise. - (grub_total_module_size): Likewise. - (grub_kernel_image_size): Likewise. - (GRUB_MODULE_MAGIC): New constant. - (grub_module_info): New structure. - (grub_arch_modules_addr): New prototype. - (grub_get_end_addr): Remove prototype. - * include/grub/i386/pc/kernel.h (grub_end_addr): New prototype. - * include/grub/powerpc/ieee1275/kernel.h: New file. - * include/grub/util/misc.h (grub_util_get_fp_size): New + * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add VasEBoot-mkimage. + (VasEBoot_mkimage_SOURCES): New target. + * include/VasEBoot/kernel.h (VasEBoot_start_addr): Remove variable. + (VasEBoot_end_addr): Likewise. + (VasEBoot_total_module_size): Likewise. + (VasEBoot_kernel_image_size): Likewise. + (VasEBoot_MODULE_MAGIC): New constant. + (VasEBoot_module_info): New structure. + (VasEBoot_arch_modules_addr): New prototype. + (VasEBoot_get_end_addr): Remove prototype. + * include/VasEBoot/i386/pc/kernel.h (VasEBoot_end_addr): New prototype. + * include/VasEBoot/powerpc/ieee1275/kernel.h: New file. + * include/VasEBoot/util/misc.h (VasEBoot_util_get_fp_size): New prototype. - (grub_util_read_at): Likewise. - (grub_util_write_image_at): Likewise. - * kern/main.c (grub_get_end_addr): Remove function. - (grub_load_modules): Call grub_arch_modules_addr instead of using - grub_end_addr. Look for a grub_module_info struct in memory. Use - the grub_module_info fields instead of calling grub_get_end_addr - as loop conditions. Move grub_add_unused_region code here. - (grub_add_unused_region): Remove function. - * kern/i386/pc/init.c: Include grub/cache.h. - (grub_machine_init): Remove call to grub_get_end_addr. Remove + (VasEBoot_util_read_at): Likewise. + (VasEBoot_util_write_image_at): Likewise. + * kern/main.c (VasEBoot_get_end_addr): Remove function. + (VasEBoot_load_modules): Call VasEBoot_arch_modules_addr instead of using + VasEBoot_end_addr. Look for a VasEBoot_module_info struct in memory. Use + the VasEBoot_module_info fields instead of calling VasEBoot_get_end_addr + as loop conditions. Move VasEBoot_add_unused_region code here. + (VasEBoot_add_unused_region): Remove function. + * kern/i386/pc/init.c: Include VasEBoot/cache.h. + (VasEBoot_machine_init): Remove call to VasEBoot_get_end_addr. Remove one call to add_mem_region. - (grub_arch_modules_addr): New function. - * kern/powerpc/ieee1275/init.c (grub_end_addr): Remove variable. - (grub_total_module_size): Likewise. - Include grub/machine/kernel.h. - (grub_arch_modules_addr): New function. - * util/grub-emu.c (grub_end_addr): Remove variable. - (grub_total_module_size): Likewise. - (grub_arch_modules_addr): New function. + (VasEBoot_arch_modules_addr): New function. + * kern/powerpc/ieee1275/init.c (VasEBoot_end_addr): Remove variable. + (VasEBoot_total_module_size): Likewise. + Include VasEBoot/machine/kernel.h. + (VasEBoot_arch_modules_addr): New function. + * util/VasEBoot-emu.c (VasEBoot_end_addr): Remove variable. + (VasEBoot_total_module_size): Likewise. + (VasEBoot_arch_modules_addr): New function. * util/misc.c: Include unistd.h. - (grub_util_get_fp_size): New function. - (grub_util_read_at): Likewise. - (grub_util_write_image_at): Likewise. - (grub_util_read_image): Call grub_util_read_at. - (grub_util_write_image): Call grub_util_write_image_at. - * util/i386/pc/grub-mkimage.c (generate_image): Allocate - additional memory in kernel_img for a struct grub_module_info. - Fill in that grub_module_info. - * util/powerpc/ieee1275/grub-mkimage.c: New file. + (VasEBoot_util_get_fp_size): New function. + (VasEBoot_util_read_at): Likewise. + (VasEBoot_util_write_image_at): Likewise. + (VasEBoot_util_read_image): Call VasEBoot_util_read_at. + (VasEBoot_util_write_image): Call VasEBoot_util_write_image_at. + * util/i386/pc/VasEBoot-mkimage.c (generate_image): Allocate + additional memory in kernel_img for a struct VasEBoot_module_info. + Fill in that VasEBoot_module_info. + * util/powerpc/ieee1275/VasEBoot-mkimage.c: New file. 2005-01-03 Hollis Blanchard - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_milliseconds): + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_milliseconds): New function. - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_milliseconds): New prototype. - * include/grub/powerpc/ieee1275/time.h (GRUB_TICKS_PER_SECOND): + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_milliseconds): New prototype. + * include/VasEBoot/powerpc/ieee1275/time.h (VasEBoot_TICKS_PER_SECOND): Change to 1000. - * kern/powerpc/ieee1275/init.c (grub_get_rtc): Call - grub_ieee1275_milliseconds. + * kern/powerpc/ieee1275/init.c (VasEBoot_get_rtc): Call + VasEBoot_ieee1275_milliseconds. 2005-01-03 Hollis Blanchard - * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New + * boot/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_realmode): New variable. (find_options): New function. (cmain): Call find_options. - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_realmode): New extern variable. - * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call - grub_map if grub_ieee1275_realmode is false. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_realmode): New extern variable. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_claimmap): Only call + VasEBoot_map if VasEBoot_ieee1275_realmode is false. 2004-12-29 Marco Gerards - * normal/cmdline.c (grub_cmdline_get): Redone logic so no empty + * normal/cmdline.c (VasEBoot_cmdline_get): Redone logic so no empty lines are inserted and make it work like readline. Reported by Vincent Pelletier . @@ -53792,7 +53792,7 @@ * boot/powerpc/ieee1275/crt0.S (_start): Don't set up the stack. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCE): Remove + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCE): Remove `kern/powerpc/cache.S'. 2004-12-27 Marco Gerards @@ -53801,18 +53801,18 @@ by Johan Rydberg . (Program): New class. (programs): New variable. - * boot/powerpc/ieee1275/cmain.c: Include - instead of "grub/machine/ieee1275.h". Include - instead of "grub/kernel.h". Include . + * boot/powerpc/ieee1275/cmain.c: Include + instead of "VasEBoot/machine/ieee1275.h". Include + instead of "VasEBoot/kernel.h". Include . (help_arch): Function removed. - * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add + * conf/powerpc-ieee1275.rmk (VasEBootof_HEADERS): Add `powerpc/libgcc.h' and `loader.h'. (pkgdata_PROGRAMS): New variable. (sbin_UTILITIES): Variable removed. - (grub_emu_SOURCES): Added kern/powerpc/cache.S. - (grubof_SOURCES): Variable re-defined so it only includes the + (VasEBoot_emu_SOURCES): Added kern/powerpc/cache.S. + (VasEBootof_SOURCES): Variable re-defined so it only includes the core functionality. - (grubof_CFLAGS): Remove `-DGRUBOF'. + (VasEBootof_CFLAGS): Remove `-DVasEBootOF'. (pkgdata_MODULES, fshelp_mod_SOURCES, fshelp_mod_CFLAGS, (fat_mod_SOURCES, fat_mod_CFLAGS, ext2_mod_SOURCES) (ext2_mod_CFLAGS, ufs_mod_SOURCES, ufs_mod_CFLAGS) @@ -53828,67 +53828,67 @@ (font_mod_CFLAGS, amiga_mod_SOURCES, amiga_mod_CFLAGS) (apple_mod_SOURCES, apple_mod_CFLAGS, pc_mod_SOURCES) (pc_mod_CFLAGS): New variables. - * disk/powerpc/ieee1275/ofdisk.c: Include . - (grub_ofdisk_iterate): Add a prototype for `dev_iterate'. - * include/grub/dl.h (grub_arch_dl_sync_caches): New prototype. - * include/grub/loader.h (grub_os_area_addr, grub_os_area_size): + * disk/powerpc/ieee1275/ofdisk.c: Include . + (VasEBoot_ofdisk_iterate): Add a prototype for `dev_iterate'. + * include/VasEBoot/dl.h (VasEBoot_arch_dl_sync_caches): New prototype. + * include/VasEBoot/loader.h (VasEBoot_os_area_addr, VasEBoot_os_area_size): Moved from here... - * include/grub/i386/pc/init.h (grub_os_area_addr) + * include/VasEBoot/i386/pc/init.h (VasEBoot_os_area_addr) (rub_os_area_size): ... to here. - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_entry_fn): Export symbol. - * include/grub/powerpc/ieee1275/init.h: New file. - * include/grub/powerpc/libgcc.h: Likewise. - * include/grub/cache.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_entry_fn): Export symbol. + * include/VasEBoot/powerpc/ieee1275/init.h: New file. + * include/VasEBoot/powerpc/libgcc.h: Likewise. + * include/VasEBoot/cache.h: Likewise. * kern/powerpc/cache.S: Likewise. Written by Hollis Blanchard . - * kern/dl.c: Include . - (grub_dl_flush_cache): New function. - (grub_dl_load_core): Call `grub_dl_flush_cache' to flush the cache + * kern/dl.c: Include . + (VasEBoot_dl_flush_cache): New function. + (VasEBoot_dl_load_core): Call `VasEBoot_dl_flush_cache' to flush the cache for this module. - * kern/powerpc/ieee1275/init.c (grub_ofdisk_init) - (grub_console_init): Removed prototypes. - (grub_machine_init): Don't initialize the modules anymore. - * kern/powerpc/ieee1275/openfw.c (grub_map): Make the function + * kern/powerpc/ieee1275/init.c (VasEBoot_ofdisk_init) + (VasEBoot_console_init): Removed prototypes. + (VasEBoot_machine_init): Don't initialize the modules anymore. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_map): Make the function static. - * include/grub/powerpc/types.h (GRUB_HOST_WORDS_LITTLEENDIAN): + * include/VasEBoot/powerpc/types.h (VasEBoot_HOST_WORDS_LITTLEENDIAN): Macro undef removed. - (GRUB_HOST_WORDS_BIGENDIAN): New macro. - * kern/powerpc/dl.c (grub_arch_dl_relocate_symbols): Add + (VasEBoot_HOST_WORDS_BIGENDIAN): New macro. + * kern/powerpc/dl.c (VasEBoot_arch_dl_relocate_symbols): Add relocation `R_PPC_REL32'. Return an error when the relocation is unknown. * Makefile.in (DATA): Add `$(pkgdata_PROGRAMS)'. - * kern/i386/pc/init.c (grub_arch_sync_caches): New function. - * util/misc.c (grub_arch_sync_caches): Likewise. + * kern/i386/pc/init.c (VasEBoot_arch_sync_caches): New function. + * util/misc.c (VasEBoot_arch_sync_caches): Likewise. 2004-12-19 Marco Gerards * conf/powerpc-ieee1275.rmk (MOSTLYCLEANFILES): Remove - `symlist.c', add `grubof_symlist.c'. + `symlist.c', add `VasEBootof_symlist.c'. (symlist.c): Variable removed. - (grubof_HEADERS): Variable added. - (grubof_symlist.c): New target. - (kernel_syms.lst): Use `grubof_HEADERS' instead of + (VasEBootof_HEADERS): Variable added. + (VasEBootof_symlist.c): New target. + (kernel_syms.lst): Use `VasEBootof_HEADERS' instead of `kernel_img_HEADERS'. - (grubof_SOURCES): Add `kern/powerpc/dl.c' and `grubof_symlist.c'. + (VasEBootof_SOURCES): Add `kern/powerpc/dl.c' and `VasEBootof_symlist.c'. * kern/powerpc/dl.c: New file. - * kern/powerpc/ieee1275/init.c (grub_arch_dl_check_header): + * kern/powerpc/ieee1275/init.c (VasEBoot_arch_dl_check_header): Function removed. - (grub_arch_dl_relocate_symbols): Likewise. - (grub_register_exported_symbols): Likewise. + (VasEBoot_arch_dl_relocate_symbols): Likewise. + (VasEBoot_register_exported_symbols): Likewise. 2004-12-13 Marco Gerards - * fs/ext2.c (grub_ext2_open): Don't use data after freeing it. - (grub_ext2_dir): Likewise. Don't return in case of an error, jump + * fs/ext2.c (VasEBoot_ext2_open): Don't use data after freeing it. + (VasEBoot_ext2_dir): Likewise. Don't return in case of an error, jump to fail instead. Reported by Vincent Pelletier . - * fs/fshelp.c (grub_fshelp_find_file): Don't free `oldnode' when + * fs/fshelp.c (VasEBoot_fshelp_find_file): Don't free `oldnode' when it is not allocated. Reported by Vincent Pelletier . - * normal/cmdline.c (grub_tab_complete): Add a blank line to the + * normal/cmdline.c (VasEBoot_tab_complete): Add a blank line to the output so the output looks better. 2004-12-04 Marco Gerards @@ -53896,83 +53896,83 @@ Modulize the partition map support and add support for the amiga partition map. - * commands/ls.c: Include instead of - . + * commands/ls.c: Include instead of + . * kern/disk.c: Likewise. * kern/rescue.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * normal/cmdline.c: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. - (grub_machine_init): Call `grub_pc_partition_map_init', - `grub_amiga_partition_map_init' and - `grub_apple_partition_map_init'. + (VasEBoot_machine_init): Call `VasEBoot_pc_partition_map_init', + `VasEBoot_amiga_partition_map_init' and + `VasEBoot_apple_partition_map_init'. * conf/i386-pc.rmk (kernel_img_SOURCES): Remove `disk/i386/pc/partition.c'. Add `kern/partition.c'. (kernel_img_HEADERS): Remove `machine/partition.h'. Add `partition.h' and `pc_partition.h'. - (grub_setup_SOURCES): Remove + (VasEBoot_setup_SOURCES): Remove `disk/i386/pc/partition.c'. Add `kern/partition.c', `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'. - (grub_emu_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add `amiga.mod', `apple.mod' and `pc.mod'. (amiga_mod_SOURCES, amiga_mod_CFLAGS, apple_mod_SOURCES) (apple_mod_CFLAGS, pc_mod_SOURCES, pc_mod_CFLAGS): New variables. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Remove `disk/powerpc/ieee1275/partition.c'. Add `kern/partition.c', `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'. - (grubof_SOURCES): Likewise. + (VasEBootof_SOURCES): Likewise. * disk/i386/pc/partition.c: File removed. * disk/powerpc/ieee1275/partition.c: Likewise. - * include/grub/powerpc/ieee1275/partition.h: Likewise. - * include/grub/i386/pc/partition.h: Likewise. + * include/VasEBoot/powerpc/ieee1275/partition.h: Likewise. + * include/VasEBoot/i386/pc/partition.h: Likewise. * kern/partition.c: New file. * partmap/amiga.c: Likewise. * partmap/apple.c: Likewise. * partmap/pc.c: Likewise. - * include/grub/partition.h: Likewise.. - * include/grub/pc_partition.h: Likewise. - * util/grub-emu.c: Include instead of - . - (main): Call `grub_pc_partition_map_init', - `grub_amiga_partition_map_init' and - `grub_apple_partition_map_init' and deinitialize afterwards. + * include/VasEBoot/partition.h: Likewise.. + * include/VasEBoot/pc_partition.h: Likewise. + * util/VasEBoot-emu.c: Include instead of + . + (main): Call `VasEBoot_pc_partition_map_init', + `VasEBoot_amiga_partition_map_init' and + `VasEBoot_apple_partition_map_init' and deinitialize afterwards. * util/i386/pc/biosdisk.c: Include `#include - ' and `include ' instead of - `'. - * util/i386/pc/grub-setup.c: Likewise. + ' and `include ' instead of + `'. + * util/i386/pc/VasEBoot-setup.c: Likewise. * util/i386/pc/biosdisk.c: Likewise. - (grub_util_biosdisk_get_grub_dev): Only access the PC specific + (VasEBoot_util_biosdisk_get_VasEBoot_dev): Only access the PC specific partition information in case of a PC partition. - * util/i386/pc/grub-setup.c: Include `#include - ' and `include ' instead of - `'. + * util/i386/pc/VasEBoot-setup.c: Include `#include + ' and `include ' instead of + `'. (setup): Only access the PC specific partition information in case of a PC partition. 2004-11-17 Hollis Blanchard - * kern/powerpc/ieee1275/init.c (grub_setjmp): Remove function. - (grub_longjmp): Likewise. - * include/grub/powerpc/setjmp.h (grub_jmp_buf): Set array size to + * kern/powerpc/ieee1275/init.c (VasEBoot_setjmp): Remove function. + (VasEBoot_longjmp): Likewise. + * include/VasEBoot/powerpc/setjmp.h (VasEBoot_jmp_buf): Set array size to 20. * normal/powerpc/setjmp.S: New file. - * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add + * conf/powerpc-ieee1275.rmk (VasEBootof_SOURCES): Add `normal/powerpc/setjmp.S'. - (grubof_CFLAGS): Add `-DGRUBOF'. - * include/grub/setjmp.h [GRUB_UTIL]: Changed condition to - [GRUB_UTIL && !GRUBOF]. + (VasEBootof_CFLAGS): Add `-DVasEBootOF'. + * include/VasEBoot/setjmp.h [VasEBoot_UTIL]: Changed condition to + [VasEBoot_UTIL && !VasEBootOF]. 2004-11-16 Marco Gerards - * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any + * kern/powerpc/ieee1275/openfw.c (VasEBoot_devalias_iterate): Skip any property named `name'. Correctly handle the error returned by - `grub_ieee1275_finddevice' if a device can not be opened. + `VasEBoot_ieee1275_finddevice' if a device can not be opened. 2004-11-02 Hollis Blanchard - * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey): Test + * term/powerpc/ieee1275/ofconsole.c (VasEBoot_ofconsole_readkey): Test `actual' for negativity. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Remove kern/fshelp.c. 2004-11-01 Marco Gerards @@ -53992,51 +53992,51 @@ (wait_vretrace): New function. (set_read_map): Likewise. (set_start_address): Likewise. - (grub_vga_init): Use mode 0x10 instead of mode 0x12. Switch to + (VasEBoot_vga_init): Use mode 0x10 instead of mode 0x12. Switch to the right page. (check_vga_mem): Take the page into account. (write_char): Likewise. (write_cursor): Likewise. (scroll_up): Likewise. Copy the page to the page that is not shown and switch between both pages. - (grub_vga_putchar): Fix off by one error. - (grub_vga_cls): Wait for the vertical retrace. Take the page into + (VasEBoot_vga_putchar): Fix off by one error. + (VasEBoot_vga_cls): Wait for the vertical retrace. Take the page into account. 2004-11-01 Marco Gerards Add support for iso9660 (including rockridge). - * conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c. + * conf/i386-pc.rmk (VasEBoot_emu_SOURCES): Add fs/iso9660.c. (iso9660_mod_SOURCES): New variable. (iso9660_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/iso9660.c. - * include/grub/fs.h (grub_iso9660_init): New prototype. - * util/grub-emu.c (main): Call `grub_iso9660_init'. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add fs/iso9660.c. + * include/VasEBoot/fs.h (VasEBoot_iso9660_init): New prototype. + * util/VasEBoot-emu.c (main): Call `VasEBoot_iso9660_init'. * fs/iso9660.c: New file. - * include/grub/misc.h (grub_strncat): New prototype. - * kern/misc.c (grub_strncat): New function. + * include/VasEBoot/misc.h (VasEBoot_strncat): New prototype. + * kern/misc.c (VasEBoot_strncat): New function. - * fs/hfs.c (grub_hfs_mount): Translate the error - `GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'. - * fs/jfs.c (grub_jfs_mount): Likewise. - * fs/ufs.c (grub_ufs_mount): Likewise. + * fs/hfs.c (VasEBoot_hfs_mount): Translate the error + `VasEBoot_ERR_OUT_OF_RANGE' to `VasEBoot_ERR_BAD_FS'. + * fs/jfs.c (VasEBoot_jfs_mount): Likewise. + * fs/ufs.c (VasEBoot_ufs_mount): Likewise. 2004-10-28 Hollis Blanchard * boot/powerpc/ieee1275/cmain.c (cmain): Remove asm statements which initialized BAT registers. * boot/powerpc/ieee1275/ieee1275.c (IEEE1275_CALL_ENTRY_FN, - grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON): + VasEBoot_ieee1275_common_hdr, INIT_IEEE1275_COMMON): Move from here... - * include/grub/powerpc/ieee1275/ieee1275.h (IEEE1275_CALL_ENTRY_FN, - grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON): + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (IEEE1275_CALL_ENTRY_FN, + VasEBoot_ieee1275_common_hdr, INIT_IEEE1275_COMMON): ... to here. - * kern/powerpc/ieee1275/openfw.c (grub_map): New function. - (grub_mapclaim): Likewise. - * loader/powerpc/ieee1275/linux.c (grub_load_linux): Use - grub_mapclaim instead of grub_ieee1275_claim. Assign linux_addr by + * kern/powerpc/ieee1275/openfw.c (VasEBoot_map): New function. + (VasEBoot_mapclaim): Likewise. + * loader/powerpc/ieee1275/linux.c (VasEBoot_load_linux): Use + VasEBoot_mapclaim instead of VasEBoot_ieee1275_claim. Assign linux_addr by hand. 2004-10-19 Hollis Blanchard @@ -54047,80 +54047,80 @@ 2004-10-15 Hollis Blanchard - * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Do not - append ":0" to devpath if the GRUB_IEEE1275_NO_PARTITION_0 flag is - set in grub_ieee1275_flags. + * disk/powerpc/ieee1275/ofdisk.c (VasEBoot_ofdisk_open): Do not + append ":0" to devpath if the VasEBoot_IEEE1275_NO_PARTITION_0 flag is + set in VasEBoot_ieee1275_flags. 2004-10-14 Hollis Blanchard - * include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (abort): Add function prototype. - * kern/powerpc/ieee1275/init.c (grub_machine_init): Call - grub_console_init first. - Change the memory range used for grub_ieee1275_claim and - grub_mm_init_region. + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_init): Call + VasEBoot_console_init first. + Change the memory range used for VasEBoot_ieee1275_claim and + VasEBoot_mm_init_region. Print an error message if the claim fails. - Include . + Include . 2004-10-13 Hollis Blanchard - * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate): - Call grub_children_iterate for device nodes of type `scsi', + * disk/powerpc/ieee1275/ofdisk.c (VasEBoot_ofdisk_iterate): + Call VasEBoot_children_iterate for device nodes of type `scsi', `ide', or `ata'. - (grub_ofdisk_open): Remove manual device alias resolution. + (VasEBoot_ofdisk_open): Remove manual device alias resolution. Fix memory leak when device cannot be opened. - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_children_iterate): New prototype. - * kern/powerpc/ieee1275/openfw.c (grub_children_iterate): + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_children_iterate): New prototype. + * kern/powerpc/ieee1275/openfw.c (VasEBoot_children_iterate): New function. - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property): + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_get_property): Return -1 if args.size was -1. 2004-10-11 Hollis Blanchard - * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_flags): New global. + * boot/powerpc/ieee1275/cmain.c (VasEBoot_ieee1275_flags): New global. (cmain): Accept 3 parameters. Test for 0xdeadbeef, indicating Old - World Macintosh. If Old Wold, set flag in grub_ieee1275_flags; claim + World Macintosh. If Old Wold, set flag in VasEBoot_ieee1275_flags; claim Open Firmware's memory for it; claim memory from _start to _end. * boot/powerpc/ieee1275/crt0.S (__bss_start): New extern. (_end): New extern. (_start): Zero BSS from __bss_start to _end. - * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags): + * include/VasEBoot/powerpc/ieee1275/ieee1275.h (VasEBoot_ieee1275_flags): New extern. - (GRUB_IEEE1275_NO_PARTITION_0): New #define. + (VasEBoot_IEEE1275_NO_PARTITION_0): New #define. 2004-10-11 Hollis Blanchard - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): Return + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_claim): Return -1 if args.base was -1. 2004-10-08 Hollis Blanchard - * term/powerpc/ieee1275/ieee1275.c (grub_ofconsole_cls): Use an ANSI + * term/powerpc/ieee1275/ieee1275.c (VasEBoot_ofconsole_cls): Use an ANSI escape sequence instead of a literal ^L. Also call - grub_ofconsole_gotoxy. + VasEBoot_ofconsole_gotoxy. 2004-10-03 Hollis Blanchard - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change - void * arguments to grub_addr_t. All callers updated. Also make + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_claim): change + void * arguments to VasEBoot_addr_t. All callers updated. Also make the `result' argument optional. - (grub_ieee1275_release): change void * arguments to grub_addr_t. + (VasEBoot_ieee1275_release): change void * arguments to VasEBoot_addr_t. All callers updated. 2004-09-22 Hollis Blanchard - * commands/ls.c (grub_ls_list_files): Use the string following the + * commands/ls.c (VasEBoot_ls_list_files): Use the string following the initial ')', if present, as the filesystem path. - * kern/rescue.c (grub_rescue_cmd_ls): Likewise. + * kern/rescue.c (VasEBoot_rescue_cmd_ls): Likewise. - * conf/powerpc-ieee1275.rmk (grubof_SOURCES): List crt0.S first. + * conf/powerpc-ieee1275.rmk (VasEBootof_SOURCES): List crt0.S first. 2004-09-18 Yoshinori K. Okuji Make the source code of the menu interface more readable. - * normal/menu.c: Include grub/mm.h. + * normal/menu.c: Include VasEBoot/mm.h. (TERM_WIDTH): New macro. (TERM_HEIGHT): Likewise. (TERM_INFO_HEIGHT): Likewise. @@ -54157,42 +54157,42 @@ * loader/i386/pc/linux_normal.c: New file. * loader/i386/pc/multiboot_normal.c: Likewise. - * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the + * loader/i386/pc/linux.c (VasEBoot_rescue_cmd_initrd): Don't use the attribute `unused'. - * fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type. Use + * fs/ext2.c (VasEBoot_ext2_iterate_dir): Fix typos in inode type. Use `fdiro' to read the mode information from instead of `diro'. - * fs/fshelp.c (grub_fshelp_find_file): Set type to foundtype after + * fs/fshelp.c (VasEBoot_fshelp_find_file): Set type to foundtype after looking up a symlink. - * include/grub/normal.h (GRUB_COMMAND_FLAG_NO_ARG_PARSE): New + * include/VasEBoot/normal.h (VasEBoot_COMMAND_FLAG_NO_ARG_PARSE): New macro. - * normal/command.c (grub_command_execute): Don't parse the - arguments when `GRUB_COMMAND_FLAG_NO_ARG_PARSE' is set in the + * normal/command.c (VasEBoot_command_execute): Don't parse the + arguments when `VasEBoot_COMMAND_FLAG_NO_ARG_PARSE' is set in the flags of the command. - * normal/menu.c (grub_menu_run): Fix typo. + * normal/menu.c (VasEBoot_menu_run): Fix typo. 2004-09-14 Hollis Blanchard * kern/powerpc/ieee1275/init.c (abort): Trap into Open Firmware. - * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_gotoxy): Use + * term/powerpc/ieee1275/ofconsole.c (VasEBoot_ofconsole_gotoxy): Use `y + 1' instead of `y - 1'. - * conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): Add `-N' and `-S'. + * conf/powerpc-ieee1275.rmk (VasEBootof_LDFLAGS): Add `-N' and `-S'. 2004-09-14 Yoshinori K. Okuji From Hollis Blanchard : - * kern/misc.c (memmove): New alias for grub_memmove. - (memcmp): New alias for grub_memcmp. - (memset): New alias for grub_memset. - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property): - Change "int handle" to "grub_ieee1275_phandle_t handle". - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_get_property): Likewise. + * kern/misc.c (memmove): New alias for VasEBoot_memmove. + (memcmp): New alias for VasEBoot_memcmp. + (memset): New alias for VasEBoot_memset. + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_get_property): + Change "int handle" to "VasEBoot_ieee1275_phandle_t handle". + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_get_property): Likewise. 2004-09-12 Tomas Ebenlendr @@ -54201,65 +54201,65 @@ * conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'. (chain_mod_SOURCES, chain_mod_CFLAGS): Variables added. - * include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader): + * include/VasEBoot/i386/pc/loader.h (VasEBoot_rescue_cmd_chainloader): Deleted prototype. - * loader/i386/pc/chainloader.c (grub_rescue_cmd_chainloader): All + * loader/i386/pc/chainloader.c (VasEBoot_rescue_cmd_chainloader): All but arguments parsing moved to ... - (grub_chainloader_cmd): ... here. New function. - * include/grub/i386/pc/chainloader.h: New file. + (VasEBoot_chainloader_cmd): ... here. New function. + * include/VasEBoot/i386/pc/chainloader.h: New file. * loader/i386/pc/chainloader_normal.c: Likewise. 2004-09-11 Marco Gerards * conf/i386-pc.rmk (kernel_img_SOURCES): Added kern/fshelp.c. - (grub_mkimage_LDFLAGS): Likewise. - (grub_emu_SOURCES): Likewise. + (VasEBoot_mkimage_LDFLAGS): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (kernel_img_HEADERS): Added fshelp.h. - * fs/ext2.c: Include . + * fs/ext2.c: Include . (FILETYPE_REG): New macro. (FILETYPE_INO_REG): Likewise. - (grub_ext_sblock): Renamed to `grub_ext2_sblock'. + (VasEBoot_ext_sblock): Renamed to `VasEBoot_ext2_sblock'. Changed all users. - (ext2_block_group): Renamed to `grub_ext2_block_group'. Changed + (ext2_block_group): Renamed to `VasEBoot_ext2_block_group'. Changed all users. - (grub_fshelp_node): New struct. - (grub_ext2_data): Added member `diropen'. Changed member `inode' + (VasEBoot_fshelp_node): New struct. + (VasEBoot_ext2_data): Added member `diropen'. Changed member `inode' to a pointer. - (grub_ext2_get_file_block): Removed function. - (grub_ext2_read_block): New function. - (grub_ext2_read_file): Replaced parameter `data' by `node'. + (VasEBoot_ext2_get_file_block): Removed function. + (VasEBoot_ext2_read_block): New function. + (VasEBoot_ext2_read_file): Replaced parameter `data' by `node'. This function was written. - (grub_ext2_mount): Read the root inode. Create a diropen struct. - (grub_ext2_find_file): Removed function. - (grub_ext2_read_symlink): New function. - (grub_ext2_iterate_dir): Likewise. - (grub_ext2_open): Rewritten. - (grub_ext2_dir): Rewritten. - * include/grub/fshelp.h: New file. + (VasEBoot_ext2_mount): Read the root inode. Create a diropen struct. + (VasEBoot_ext2_find_file): Removed function. + (VasEBoot_ext2_read_symlink): New function. + (VasEBoot_ext2_iterate_dir): Likewise. + (VasEBoot_ext2_open): Rewritten. + (VasEBoot_ext2_dir): Rewritten. + * include/VasEBoot/fshelp.h: New file. * fs/fshelp.c: Likewise. 2004-09-10 Yoshinori K. Okuji - * normal/menu.c: Include grub/loader.h and grub/machine/time.h. + * normal/menu.c: Include VasEBoot/loader.h and VasEBoot/machine/time.h. (print_message): Add a missing newline. (run_menu): Added timeout support. (run_menu_entry): New local function. - (grub_menu_run): Added support for booting. + (VasEBoot_menu_run): Added support for booting. - * kern/loader.c (grub_loader_is_loaded): New function. + * kern/loader.c (VasEBoot_loader_is_loaded): New function. - * include/grub/powerpc/ieee1275/time.h: Include grub/symbol.h. - (grub_get_rtc): Exported. + * include/VasEBoot/powerpc/ieee1275/time.h: Include VasEBoot/symbol.h. + (VasEBoot_get_rtc): Exported. - * include/grub/i386/pc/time.h: Include grub/symbol.h. - (grub_get_rtc): Exported. + * include/VasEBoot/i386/pc/time.h: Include VasEBoot/symbol.h. + (VasEBoot_get_rtc): Exported. - * include/grub/normal.h (struct grub_command_list): Remove + * include/VasEBoot/normal.h (struct VasEBoot_command_list): Remove constant from the member `command'. - * include/grub/loader.h (grub_loader_is_loaded): Declared. + * include/VasEBoot/loader.h (VasEBoot_loader_is_loaded): Declared. - * include/grub/err.h (GRUB_ERR_INVALID_COMMAND): New constant. + * include/VasEBoot/err.h (VasEBoot_ERR_INVALID_COMMAND): New constant. * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/time.h. @@ -54268,42 +54268,42 @@ Add support for the JFS filesystem. * fs/jfs.c: New file. - * include/grub/fs.h (grub_jfs_init): New prototype. - (grub_jfs_fini): New prototype. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/jfs.c. - (grub_emu_SOURCES): Likewise. + * include/VasEBoot/fs.h (VasEBoot_jfs_init): New prototype. + (VasEBoot_jfs_fini): New prototype. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/jfs.c. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add jfs.mod. (jfs_mod_SOURCES): New variable. (jfs_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs.jfs.c. - (grubof_SOURCES): Likewise. - * util/grub-emu.c (main): Initialize and deinitialize JFS support. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add fs.jfs.c. + (VasEBootof_SOURCES): Likewise. + * util/VasEBoot-emu.c (main): Initialize and deinitialize JFS support. - * fs/fat.c (grub_fat_find_dir): Convert the filename little + * fs/fat.c (VasEBoot_fat_find_dir): Convert the filename little endian to the host endian. - (grub_fat_utf16_to_utf8): Move function from there... - * kern/misc.c (grub_utf16_to_utf8): ...to here. Do not convert + (VasEBoot_fat_utf16_to_utf8): Move function from there... + * kern/misc.c (VasEBoot_utf16_to_utf8): ...to here. Do not convert the endianness of the source string anymore. - * include/grub/misc.h (grub_utf16_to_utf8): New prototype. + * include/VasEBoot/misc.h (VasEBoot_utf16_to_utf8): New prototype. 2004-08-24 Marco Gerards - * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional. - (grub_boot_fini) [GRUB_UTIL]: Likewise. - (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise. - (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise. + * commands/boot.c (VasEBoot_boot_init) [VasEBoot_UTIL]: Make conditional. + (VasEBoot_boot_fini) [VasEBoot_UTIL]: Likewise. + (VasEBoot_MOD_INIT) [!VasEBoot_UTIL]: Likewise. + (VasEBoot_MOD_FINI) [!VasEBoot_UTIL]: Likewise. - * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'. - (grub_hfs_iterate_dir): Make the function static. Add prototypes + * fs/hfs.c (VasEBoot_hfs_find_node): Add a prototype for `node_found'. + (VasEBoot_hfs_iterate_dir): Make the function static. Add prototypes for `node_found' and `it_dir'. - (grub_hfs_dir): Add prototype for `dir_hook'. + (VasEBoot_hfs_dir): Add prototype for `dir_hook'. - * fs/minix.c (grub_minix_get_file_block): Add prototype for - `grub_get_indir'. Rename `indir' in two blocks to `indir16' + * fs/minix.c (VasEBoot_minix_get_file_block): Add prototype for + `VasEBoot_get_indir'. Rename `indir' in two blocks to `indir16' and `indir32' to silence a gcc warning. - * include/grub/fs.h (grub_hfs_init): New prototype. - (grub_hfs_fini): Likewise. + * include/VasEBoot/fs.h (VasEBoot_hfs_init): New prototype. + (VasEBoot_hfs_fini): Likewise. 2004-08-21 Yoshinori K. Okuji @@ -54311,88 +54311,88 @@ Each disk device has its own id now. This is useful to make use of multiple disk devices. - * include/grub/disk.h (grub_disk_dev_id): New enum. - (GRUB_DISK_DEVICE_BIOSDISK_ID): New constant. - (GRUB_DISK_DEVICE_OFDISK_ID): Likewise. + * include/VasEBoot/disk.h (VasEBoot_disk_dev_id): New enum. + (VasEBoot_DISK_DEVICE_BIOSDISK_ID): New constant. + (VasEBoot_DISK_DEVICE_OFDISK_ID): Likewise. - * disk/i386/pc/biosdisk.c (grub_biosdisk_dev): Specify - GRUB_DISK_DEVICE_BIOSDISK_ID as an id. + * disk/i386/pc/biosdisk.c (VasEBoot_biosdisk_dev): Specify + VasEBoot_DISK_DEVICE_BIOSDISK_ID as an id. - * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_dev): Specify - GRUB_DISK_DEVICE_OFDISK_ID as an id. + * disk/powerpc/ieee1275/ofdisk.c (VasEBoot_ofdisk_dev): Specify + VasEBoot_DISK_DEVICE_OFDISK_ID as an id. - * util/i386/pc/biosdisk.c (grub_util_biosdisk_dev): Specify - GRUB_DISK_DEVICE_BIOSDISK_ID as an id. + * util/i386/pc/biosdisk.c (VasEBoot_util_biosdisk_dev): Specify + VasEBoot_DISK_DEVICE_BIOSDISK_ID as an id. - * include/grub/disk.h (struct grub_disk_dev): Added a new member + * include/VasEBoot/disk.h (struct VasEBoot_disk_dev): Added a new member "id" which is used by the cache manager. - * normal/main.c (grub_normal_init_page): Use "GNU GRUB" instead - of just "GRUB". + * normal/main.c (VasEBoot_normal_init_page): Use "GNU VasEBoot" instead + of just "VasEBoot". 2004-08-18 Marco Gerards * fs/hfs.c: New file. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/hfs.c. - (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/hfs.c. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add hfs.mod. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/hfs.c. - (grubof_SOURCES): Likewise. - * util/grub-emu.c (main): Initialize and deinitialize HFS support. + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add fs/hfs.c. + (VasEBootof_SOURCES): Likewise. + * util/VasEBoot-emu.c (main): Initialize and deinitialize HFS support. - * include/grub/misc.h (grub_strncasecmp): Add prototype. - * kern/misc.c (grub_strncasecmp): Add function. + * include/VasEBoot/misc.h (VasEBoot_strncasecmp): Add prototype. + * kern/misc.c (VasEBoot_strncasecmp): Add function. 2004-08-14 Marco Gerards - * include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro + * include/VasEBoot/arg.h (VasEBoot_ARG_OPTION_OPTIONAL): Surround macro with parentheses. * fs/ext2.c (FILETYPE_UNKNOWN): New macro. - (grub_ext2_dir): In case the directory entry type is unknown, read + (VasEBoot_ext2_dir): In case the directory entry type is unknown, read it from the inode. 2004-08-02 Peter Bruin - * loader/powerpc/ieee1275/linux.c (grub_linux_init): Pass - grub_load_linux instead of grub_rescue_cmd_linux as second - argument of grub_rescue_register_command. + * loader/powerpc/ieee1275/linux.c (VasEBoot_linux_init): Pass + VasEBoot_load_linux instead of VasEBoot_rescue_cmd_linux as second + argument of VasEBoot_rescue_register_command. * Makefile.in (RMKFILES): Add conf/powerpc-ieee1275.rmk. 2004-07-27 Marco Gerards - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_release): New + * boot/powerpc/ieee1275/ieee1275.c (VasEBoot_ieee1275_release): New function. - * commands/boot.c: Remove the check for `GRUB_UTIL'. - * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add + * commands/boot.c: Remove the check for `VasEBoot_UTIL'. + * conf/powerpc-ieee1275.rmk (VasEBootof_SOURCES): Add `loader/powerpc/ieee1275/linux.c', `loader/powerpc/ieee1275/linux_normal.c' and `commands/boot.c'. - * include/grub/powerpc/ieee1275/ieee1275.h - (grub_ieee1275_release): New prototype. - * include/grub/powerpc/ieee1275/loader.h: Rewritten. - * kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize + * include/VasEBoot/powerpc/ieee1275/ieee1275.h + (VasEBoot_ieee1275_release): New prototype. + * include/VasEBoot/powerpc/ieee1275/loader.h: Rewritten. + * kern/powerpc/ieee1275/init.c (VasEBoot_machine_init): Initialize normal, boot, linux and linux_normal. * loader/powerpc/ieee1275/linux.c: New file. * loader/powerpc/ieee1275/linux_normal.c: Likewise. 2004-07-12 Marco Gerards - * normal/arg.c (grub_arg_parse): Correct error handling after + * normal/arg.c (VasEBoot_arg_parse): Correct error handling after reallocating the argumentlist (check if `argl' is not null instead of checking if `args' is not null). - * kern/mm.c (grub_realloc): Return the same pointer when using the + * kern/mm.c (VasEBoot_realloc): Return the same pointer when using the same region, instead of returning the header address. 2004-07-11 Marco Gerards - * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip + * disk/powerpc/ieee1275/partition.c (VasEBoot_partition_iterate): Skip one block instead of two when looking for the initial partition. - (grub_partition_probe): Initialize the local variable `p' with 0. - Use base 10 for the grub_strtoul call. - * kern/misc.c (grub_strncpy): Fix off by one bug. Eliminated the + (VasEBoot_partition_probe): Initialize the local variable `p' with 0. + Use base 10 for the VasEBoot_strtoul call. + * kern/misc.c (VasEBoot_strncpy): Fix off by one bug. Eliminated the need for one local variable. - (grub_strtoul): Don't add the new value to `num', instead of that + (VasEBoot_strtoul): Don't add the new value to `num', instead of that just assign it. 2004-07-11 Marco Gerards @@ -54402,27 +54402,27 @@ (pxeboot_img_ASFLAGS): Likewise. (pxeboot_img_LDFLAGS): Likewise. * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from - GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy + VasEBoot Legacy and boot.S. Adopted for VasEBoot 2 by lode leroy . 2004-06-27 Tomas Ebenlendr - * kern/rescue.c (grub_enter_rescue_mode): Don't continue when + * kern/rescue.c (VasEBoot_enter_rescue_mode): Don't continue when there was no input. 2004-06-27 Tomas Ebenlendr - * normal/cmdline.c (grub_set_history): Fix off by one bug. Fixed + * normal/cmdline.c (VasEBoot_set_history): Fix off by one bug. Fixed the history buffer logic. 2004-06-27 Tomas Ebenlendr * fs/ext2.c (FILETYPE_INO_MASK, FILETYPE_INO_DIRECTORY) (FILETYPE_INO_SYMLINK): New macros. - (grub_ext2_find_file): Check if the node is a directory using the + (VasEBoot_ext2_find_file): Check if the node is a directory using the inode stat information instead of using the filetype in the dirent. Exclude the first character of an absolute symlink. - (grub_ext2_dir): Mask out the filetype part of the mode member of + (VasEBoot_ext2_dir): Mask out the filetype part of the mode member of the inode. 2004-05-24 Marco Gerards @@ -54431,53 +54431,53 @@ filesystem version 1 and 2, both the variants with 14 and 30 long filenames. - * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c and + * conf/i386-pc.rmk (VasEBoot_setup_SOURCES): Add fs/ufs.c and fs/minix.c. - (grub_emu_SOURCES): Likewise. + (VasEBoot_emu_SOURCES): Likewise. (pkgdata_MODULES): Add ufs.mod and minix.mod. (ufs_mod_SOURCES): New variable. (ufs_mod_CFLAGS): Likewise. (minix_mod_SOURCES): Likewise. (minix_mod_CFLAGS): Likewise. - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/ufs.c and + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add fs/ufs.c and fs/minix.c. - (grubof_SOURCES): Likewise. + (VasEBootof_SOURCES): Likewise. * fs/ufs.c: New file. * fs/minix.c: New file. - * include/grub/fs.h (grub_ufs_init): New prototype. - (grub_ufs_fini): Likewise. - (grub_minix_init): Likewise. - (grub_minix_fini): Likewise. - * util/grub-emu.c (main): Initialize and deinitialize UFS and + * include/VasEBoot/fs.h (VasEBoot_ufs_init): New prototype. + (VasEBoot_ufs_fini): Likewise. + (VasEBoot_minix_init): Likewise. + (VasEBoot_minix_fini): Likewise. + * util/VasEBoot-emu.c (main): Initialize and deinitialize UFS and minix fs. 2004-04-30 Jeroen Dekkers - * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add normal/arg.c, + * conf/powerpc-ieee1275.rmk (VasEBoot_emu_SOURCES): Add normal/arg.c, commands/ls.c, commands/terminal.c, commands/boot.c, commands/cmp.c and commands/cat.c. - (grubof_LDFLAGS): Add -nostdlib -static-libgcc -lgcc. + (VasEBootof_LDFLAGS): Add -nostdlib -static-libgcc -lgcc. - * kern/powerpc/ieee1275/init.c: Include "grub/env.h" instead of + * kern/powerpc/ieee1275/init.c: Include "VasEBoot/env.h" instead of "env.h" 2004-04-04 Yoshinori K. Okuji - All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_ - and grub_, respectively. Because the conversion is trivial and + All symbols prefixed with PUPA_ and pupa_ are renamed to VasEBoot_ + and VasEBoot_, respectively. Because the conversion is trivial and mechanical, I omit the details here. Please refer to the CVS if you need more information. 2004-04-04 Yoshinori K. Okuji * include/pupa: Renamed to ... - * include/grub: ... this. + * include/VasEBoot: ... this. * util/i386/pc/pupa-mkimage.c: Renamed to ... - * util/i386/pc/grub-mkimage.c: ... this. + * util/i386/pc/VasEBoot-mkimage.c: ... this. * util/i386/pc/pupa-setup.c: Renamed to ... - * util/i386/pc/grub-setup.c: ... this. + * util/i386/pc/VasEBoot-setup.c: ... this. * util/pupa-emu.c: Renamed to ... - * util/grub-emu.c: ... this. + * util/VasEBoot-emu.c: ... this. 2004-03-29 Marco Gerards @@ -54700,11 +54700,11 @@ 2004-03-07 Yoshinori K. Okuji - Now this project is GRUB 2 rather than PUPA. The location of - the CVS repository was moved to GRUB's. + Now this project is VasEBoot 2 rather than PUPA. The location of + the CVS repository was moved to VasEBoot's. - * configure.ac: Use bug-grub as the reporting address. - Use GRUB instead of PUPA. + * configure.ac: Use bug-VasEBoot as the reporting address. + Use VasEBoot instead of PUPA. Change the version number to 1.90. 2004-02-24 Yoshinori K. Okuji @@ -54982,7 +54982,7 @@ * genmk.rb (PModule#rule): Make sure to get only symbol names from the output of nm. - Reported by Robert Millan . + Reported by Robert Millan . 2003-09-25 Yoshinori K. Okuji diff --git a/INSTALL b/INSTALL index f3c20edc8..514789053 100644 --- a/INSTALL +++ b/INSTALL @@ -1,15 +1,15 @@ -*- Text -*- -This is the GRUB. Welcome. +This is the VasEBoot. Welcome. -This file contains instructions for compiling and installing the GRUB. +This file contains instructions for compiling and installing the VasEBoot. The Requirements ================ -GRUB depends on some software packages installed into your system. If +VasEBoot depends on some software packages installed into your system. If you don't have any of them, please obtain and install them before -configuring the GRUB. +configuring the VasEBoot. * GCC 4.1.3 or later Note: older versions may work but support is limited @@ -30,7 +30,7 @@ configuring the GRUB. earlier versions not tested Note: clang 3.5 or later works for sparc64 earlier versions return "error: unable to interface with target machine" - Note: clang has no support for ia64 and hence you can't compile GRUB + Note: clang has no support for ia64 and hence you can't compile VasEBoot for ia64 with clang * GNU Make * GNU Bison 2.3 or later @@ -44,18 +44,18 @@ On GNU/Linux, you also need: * libdevmapper 1.02.34 or later (recommended) -For optional grub-emu features, you need: +For optional VasEBoot-emu features, you need: * SDL (recommended) * libpciaccess (optional) * libusb (optional) -To build GRUB's graphical terminal (gfxterm), you need: +To build VasEBoot's graphical terminal (gfxterm), you need: * FreeType 2 or later * GNU Unifont -If you use a development snapshot or want to hack on GRUB you may +If you use a development snapshot or want to hack on VasEBoot you may need the following. * Python 2.6 or later @@ -65,9 +65,9 @@ need the following. Prerequisites for make-check: * qemu, specifically the binary 'qemu-system-i386' -* xorriso 1.2.9 or later, for grub-mkrescue and grub-shell +* xorriso 1.2.9 or later, for VasEBoot-mkrescue and VasEBoot-shell -Configuring the GRUB +Configuring the VasEBoot ==================== The `configure' shell script attempts to guess correct values for @@ -91,7 +91,7 @@ called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. -Building the GRUB +Building the VasEBoot ================= The simplest way to compile this package is: @@ -131,16 +131,16 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. -Cross-compiling the GRUB +Cross-compiling the VasEBoot ======================== -GRUB defines 3 platforms: +VasEBoot defines 3 platforms: - "Build" is the one which build systems runs on. - - "Host" is where you execute GRUB utils. - - "Target" is where GRUB itself runs. + - "Host" is where you execute VasEBoot utils. + - "Target" is where VasEBoot itself runs. -For grub-emu host and target must be the same but may differ from build. +For VasEBoot-emu host and target must be the same but may differ from build. If build and host are different make check isn't available. @@ -247,10 +247,10 @@ If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Please note, however, that the GRUB knows where it is located in the +Please note, however, that the VasEBoot knows where it is located in the filesystem. If you have installed it in an unusual location, the system might not work properly, or at all. The chief utility of these -options for the GRUB is to allow you to "install" in some alternate +options for the VasEBoot is to allow you to "install" in some alternate location, and then copy these to the actual root filesystem later. diff --git a/Makefile.am b/Makefile.am index 7795baeb6..17664b043 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,9 +1,9 @@ AUTOMAKE_OPTIONS = subdir-objects -Wno-portability DEPDIR = .deps-util -SUBDIRS = grub-core/gnulib . +SUBDIRS = VasEBoot-core/gnulib . if COND_real_platform -SUBDIRS += grub-core +SUBDIRS += VasEBoot-core endif SUBDIRS += po docs util/bash-completion.d @@ -25,44 +25,44 @@ CCASFLAGS_PROGRAM += $(CCASFLAGS_GNULIB) include $(srcdir)/Makefile.util.am # XXX Use Automake's LEX & YACC support -grub_script.tab.h: $(top_srcdir)/grub-core/script/parser.y - $(YACC) -d -p grub_script_yy -b grub_script $(top_srcdir)/grub-core/script/parser.y -grub_script.tab.c: grub_script.tab.h -CLEANFILES += grub_script.tab.c grub_script.tab.h +VasEBoot_script.tab.h: $(top_srcdir)/VasEBoot-core/script/parser.y + $(YACC) -d -p VasEBoot_script_yy -b VasEBoot_script $(top_srcdir)/VasEBoot-core/script/parser.y +VasEBoot_script.tab.c: VasEBoot_script.tab.h +CLEANFILES += VasEBoot_script.tab.c VasEBoot_script.tab.h # For the lexer. -grub_script.yy.h: $(top_srcdir)/grub-core/script/yylex.l - $(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $(top_srcdir)/grub-core/script/yylex.l -grub_script.yy.c: grub_script.yy.h -CLEANFILES += grub_script.yy.c grub_script.yy.h +VasEBoot_script.yy.h: $(top_srcdir)/VasEBoot-core/script/yylex.l + $(LEX) -o VasEBoot_script.yy.c --header-file=VasEBoot_script.yy.h $(top_srcdir)/VasEBoot-core/script/yylex.l +VasEBoot_script.yy.c: VasEBoot_script.yy.h +CLEANFILES += VasEBoot_script.yy.c VasEBoot_script.yy.h -# For libgrub.a -libgrub.pp: grub_script.tab.h grub_script.yy.h $(libgrubmods_a_SOURCES) $(libgrubkern_a_SOURCES) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrubmods_a_CPPFLAGS) $(libgrubkern_a_CPPFLAGS) $(CPPFLAGS) \ - -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1) -CLEANFILES += libgrub.pp +# For libVasEBoot.a +libVasEBoot.pp: VasEBoot_script.tab.h VasEBoot_script.yy.h $(libVasEBootmods_a_SOURCES) $(libVasEBootkern_a_SOURCES) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libVasEBootmods_a_CPPFLAGS) $(libVasEBootkern_a_CPPFLAGS) $(CPPFLAGS) \ + -D'VasEBoot_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1) +CLEANFILES += libVasEBoot.pp -libgrub_a_init.lst: libgrub.pp +libVasEBoot_a_init.lst: libVasEBoot.pp cat $< | grep '@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1) -CLEANFILES += libgrub_a_init.lst +CLEANFILES += libVasEBoot_a_init.lst -libgrub_a_init.c: libgrub_a_init.lst $(top_srcdir)/geninit.sh +libVasEBoot_a_init.c: libVasEBoot_a_init.lst $(top_srcdir)/geninit.sh sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1) -CLEANFILES += libgrub_a_init.c +CLEANFILES += libVasEBoot_a_init.c -# For grub-fstest -grub_fstest.pp: $(grub_fstest_SOURCES) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_fstest_CPPFLAGS) $(CPPFLAGS) \ - -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1) -CLEANFILES += grub_fstest.pp +# For VasEBoot-fstest +VasEBoot_fstest.pp: $(VasEBoot_fstest_SOURCES) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(VasEBoot_fstest_CPPFLAGS) $(CPPFLAGS) \ + -D'VasEBoot_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1) +CLEANFILES += VasEBoot_fstest.pp -grub_fstest_init.lst: libgrub.pp grub_fstest.pp +VasEBoot_fstest_init.lst: libVasEBoot.pp VasEBoot_fstest.pp cat $^ | grep '@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1) -CLEANFILES += grub_fstest_init.lst +CLEANFILES += VasEBoot_fstest_init.lst -grub_fstest_init.c: grub_fstest_init.lst $(top_srcdir)/geninit.sh +VasEBoot_fstest_init.c: VasEBoot_fstest_init.lst $(top_srcdir)/geninit.sh sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1) -CLEANFILES += grub_fstest_init.c +CLEANFILES += VasEBoot_fstest_init.c if COND_HAVE_FONT_SOURCE pkgdata_DATA += unicode.pf2 ascii.pf2 euro.pf2 ascii.h widthspec.h @@ -70,39 +70,39 @@ endif starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 -build-grub-mkfont$(BUILD_EXEEXT): util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) -CLEANFILES += build-grub-mkfont$(BUILD_EXEEXT) +build-VasEBoot-mkfont$(BUILD_EXEEXT): util/VasEBoot-mkfont.c VasEBoot-core/unidata.c VasEBoot-core/kern/emu/misc.c util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DVasEBoot_MKFONT=1 -DVasEBoot_BUILD=1 -DVasEBoot_UTIL=1 -DVasEBoot_BUILD_PROGRAM_NAME=\"build-VasEBoot-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) +CLEANFILES += build-VasEBoot-mkfont$(BUILD_EXEEXT) garbage-gen$(BUILD_EXEEXT): util/garbage-gen.c $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^ CLEANFILES += garbage-gen$(BUILD_EXEEXT) EXTRA_DIST += util/garbage-gen.c -build-grub-gen-asciih$(BUILD_EXEEXT): util/grub-gen-asciih.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror -CLEANFILES += build-grub-gen-asciih$(BUILD_EXEEXT) +build-VasEBoot-gen-asciih$(BUILD_EXEEXT): util/VasEBoot-gen-asciih.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DVasEBoot_MKFONT=1 -DVasEBoot_BUILD=1 -DVasEBoot_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror +CLEANFILES += build-VasEBoot-gen-asciih$(BUILD_EXEEXT) -build-grub-gen-widthspec$(BUILD_EXEEXT): util/grub-gen-widthspec.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror -CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) +build-VasEBoot-gen-widthspec$(BUILD_EXEEXT): util/VasEBoot-gen-widthspec.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DVasEBoot_MKFONT=1 -DVasEBoot_BUILD=1 -DVasEBoot_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror +CLEANFILES += build-VasEBoot-gen-widthspec$(BUILD_EXEEXT) if COND_STARFIELD starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) -dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -s 10 -o $@ $(DJVU_FONT_SOURCE) +dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -s 10 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_10.pf2 -dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -s 12 -o $@ $(DJVU_FONT_SOURCE) +dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -s 12 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_12.pf2 -dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -s 14 -o $@ $(DJVU_FONT_SOURCE) +dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -s 14 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_14.pf2 -dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -b -s 14 -o $@ $(DJVU_FONT_SOURCE) +dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -b -s 14 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_bold_14.pf2 -dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -s 16 -o $@ $(DJVU_FONT_SOURCE) +dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -s 16 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_16.pf2 else starfield_DATA = @@ -111,34 +111,34 @@ endif EXTRA_DIST += $(starfield_theme_files) EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf -unicode.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) +unicode.pf2: $(FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) CLEANFILES += unicode.pf2 # Arrows and lines are needed to draw the menu, so always include them UNICODE_ARROWS=0x2190-0x2193 UNICODE_LINES=0x2501-0x251B -ascii.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) +ascii.pf2: $(FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) CLEANFILES += ascii.pf2 -euro.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) - ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) +euro.pf2: $(FONT_SOURCE) build-VasEBoot-mkfont$(BUILD_EXEEXT) + ./build-VasEBoot-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) CLEANFILES += euro.pf2 -ascii.h: $(FONT_SOURCE) build-grub-gen-asciih$(BUILD_EXEEXT) - ./build-grub-gen-asciih$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) +ascii.h: $(FONT_SOURCE) build-VasEBoot-gen-asciih$(BUILD_EXEEXT) + ./build-VasEBoot-gen-asciih$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) CLEANFILES += ascii.h -widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec$(BUILD_EXEEXT) - ./build-grub-gen-widthspec$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) +widthspec.h: $(FONT_SOURCE) build-VasEBoot-gen-widthspec$(BUILD_EXEEXT) + ./build-VasEBoot-gen-widthspec$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) CLEANFILES += widthspec.h # Install config.h into platformdir nodist_platform_HEADERS = config.h -pkgdata_DATA += grub-mkconfig_lib +pkgdata_DATA += VasEBoot-mkconfig_lib if COND_real_platform @@ -178,64 +178,64 @@ QEMU32=qemu-system-x86_64 MINIMUM_CPU_LINUX=core2duo endif -linux.init.x86_64: $(srcdir)/grub-core/tests/boot/linux.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +linux.init.x86_64: $(srcdir)/VasEBoot-core/tests/boot/linux.init-x86_64.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -static -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +linux.init.i386: $(srcdir)/VasEBoot-core/tests/boot/linux.init-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -static -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -linux.init.mips: $(srcdir)/grub-core/tests/boot/linux.init-mips.S +linux.init.mips: $(srcdir)/VasEBoot-core/tests/boot/linux.init-mips.S $(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -linux.init.ppc: $(srcdir)/grub-core/tests/boot/linux.init-ppc.S +linux.init.ppc: $(srcdir)/VasEBoot-core/tests/boot/linux.init-ppc.S $(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -linux.init.mipsel: $(srcdir)/grub-core/tests/boot/linux.init-mips.S +linux.init.mipsel: $(srcdir)/VasEBoot-core/tests/boot/linux.init-mips.S $(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -linux.init.loongson: $(srcdir)/grub-core/tests/boot/linux.init-mips.S +linux.init.loongson: $(srcdir)/VasEBoot-core/tests/boot/linux.init-mips.S $(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -DREBOOT=1 -multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +multiboot.elf: $(srcdir)/VasEBoot-core/tests/boot/kernel-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -static -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +kfreebsd.elf: $(srcdir)/VasEBoot-core/tests/boot/kernel-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -static -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include kfreebsd.aout: kfreebsd.elf $(TARGET_OBJCOPY) -O a.out-i386-linux $< $@ -j .text -pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +pc-chainloader.elf: $(srcdir)/VasEBoot-core/tests/boot/kernel-8086.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -static -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x7c00 -m32 pc-chainloader.bin: pc-chainloader.elf $(TARGET_OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; -ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +ntldr.elf: $(srcdir)/VasEBoot-core/tests/boot/kernel-8086.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -static -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0 -m32 ntldr.bin: ntldr.elf $(TARGET_OBJCOPY) -O binary --strip-unneeded -j .text $< $@; -multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +multiboot2.elf: $(srcdir)/VasEBoot-core/tests/boot/kernel-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -static -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1 -kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +kfreebsd.init.x86_64: $(srcdir)/VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -m64 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@ -kfreebsd.init.i386: $(srcdir)/grub-core/tests/boot/kfreebsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +kfreebsd.init.i386: $(srcdir)/VasEBoot-core/tests/boot/kfreebsd.init-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -m32 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@ -knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +knetbsd.init.i386: $(srcdir)/VasEBoot-core/tests/boot/kbsd.init-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -m32 -static -nostdlib -nostdinc -DTARGET_NETBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +kopenbsd.init.i386: $(srcdir)/VasEBoot-core/tests/boot/kbsd.init-i386.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -m32 -static -nostdlib -nostdinc -DTARGET_OPENBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +knetbsd.init.x86_64: $(srcdir)/VasEBoot-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -m64 -DTARGET_NETBSD=1 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S +kopenbsd.init.x86_64: $(srcdir)/VasEBoot-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/VasEBoot-core/tests/boot/qemu-shutdown-x86.S $(TARGET_CC) -o $@ $< -m64 -DTARGET_OPENBSD=1 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" linux-initramfs.mips: linux.init.mips Makefile @@ -259,97 +259,97 @@ linux-initramfs.x86_64: linux.init.x86_64 Makefile kfreebsd-mfsroot.i386.img: kfreebsd.init.i386 Makefile TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -t ffs -s 30m -f 1000 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR -knetbsd.image.i386: knetbsd.init.i386 $(srcdir)/grub-core/tests/boot/kbsd.spec.txt - TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 64k -f 10 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR +knetbsd.image.i386: knetbsd.init.i386 $(srcdir)/VasEBoot-core/tests/boot/kbsd.spec.txt + TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/VasEBoot-core/tests/boot/kbsd.spec.txt -t ffs -s 64k -f 10 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR -kopenbsd.image.i386: kopenbsd.init.i386 $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt - TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@ +kopenbsd.image.i386: kopenbsd.init.i386 $(srcdir)/VasEBoot-core/tests/boot/kopenbsdlabel.txt + TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/VasEBoot-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/VasEBoot-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@ -kopenbsd.image.x86_64: kopenbsd.init.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt - TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@ +kopenbsd.image.x86_64: kopenbsd.init.x86_64 $(srcdir)/VasEBoot-core/tests/boot/kopenbsdlabel.txt + TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/VasEBoot-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/VasEBoot-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@ -knetbsd.miniroot-image.i386.img: knetbsd.image.i386 $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386 - $(TARGET_OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386 $@ +knetbsd.miniroot-image.i386.img: knetbsd.image.i386 $(VasEBoot_PAYLOADS_DIR)/knetbsd.miniroot.i386 + $(TARGET_OBJCOPY) --add-section=miniroot=$< $(VasEBoot_PAYLOADS_DIR)/knetbsd.miniroot.i386 $@ kfreebsd-mfsroot.x86_64.img: kfreebsd.init.x86_64 Makefile TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -t ffs -s 30m -f 1000 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR -knetbsd.image.x86_64: knetbsd.init.x86_64 $(srcdir)/grub-core/tests/boot/kbsd.spec.txt - TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 64k -f 10 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR +knetbsd.image.x86_64: knetbsd.init.x86_64 $(srcdir)/VasEBoot-core/tests/boot/kbsd.spec.txt + TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/VasEBoot-core/tests/boot/kbsd.spec.txt -t ffs -s 64k -f 10 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR -knetbsd.miniroot-image.x86_64.img: knetbsd.image.x86_64 $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.x86_64 - $(TARGET_OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.x86_64 $@ +knetbsd.miniroot-image.x86_64.img: knetbsd.image.x86_64 $(VasEBoot_PAYLOADS_DIR)/knetbsd.miniroot.x86_64 + $(TARGET_OBJCOPY) --add-section=miniroot=$< $(VasEBoot_PAYLOADS_DIR)/knetbsd.miniroot.x86_64 $@ CLEANFILES += linux.init.i386 kfreebsd.init.i386 linux.init.x86_64 linux-initramfs.i386 linux-initramfs.x86_64 kfreebsd-mfsroot.i386.gz: kfreebsd-mfsroot.i386.img gzip < $< > $@ -bootcheck-kfreebsd-i386: kfreebsd-mfsroot.i386.gz $(GRUB_PAYLOADS_DIR)/kfreebsd.i386 $(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/mfsroot.gz=kfreebsd-mfsroot.i386.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.i386 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-kfreebsd-i386: kfreebsd-mfsroot.i386.gz $(VasEBoot_PAYLOADS_DIR)/kfreebsd.i386 $(VasEBoot_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/VasEBoot-core/tests/boot/kfreebsd.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/mfsroot.gz=kfreebsd-mfsroot.i386.gz --files=/kfreebsd=$(VasEBoot_PAYLOADS_DIR)/kfreebsd.i386 --files=/kfreebsd_env=$(VasEBoot_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/VasEBoot-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null kfreebsd-mfsroot.x86_64.gz: kfreebsd-mfsroot.x86_64.img gzip < $< > $@ -bootcheck-kfreebsd-x86_64: kfreebsd-mfsroot.x86_64.gz $(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 $(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/mfsroot.gz=kfreebsd-mfsroot.x86_64.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-kfreebsd-x86_64: kfreebsd-mfsroot.x86_64.gz $(VasEBoot_PAYLOADS_DIR)/kfreebsd.x86_64 $(VasEBoot_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/VasEBoot-core/tests/boot/kfreebsd.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/mfsroot.gz=kfreebsd-mfsroot.x86_64.gz --files=/kfreebsd=$(VasEBoot_PAYLOADS_DIR)/kfreebsd.x86_64 --files=/kfreebsd_env=$(VasEBoot_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/VasEBoot-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null knetbsd.miniroot-image.i386.gz: knetbsd.miniroot-image.i386.img gzip < $< > $@ -bootcheck-knetbsd-i386: knetbsd.miniroot-image.i386.gz $(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/miniroot.gz=knetbsd.miniroot-image.i386.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-knetbsd-i386: knetbsd.miniroot-image.i386.gz $(VasEBoot_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/VasEBoot-core/tests/boot/knetbsd.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/miniroot.gz=knetbsd.miniroot-image.i386.gz --files=/knetbsd=$(VasEBoot_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/VasEBoot-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-kopenbsd-i386: kopenbsd.image.i386 $(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-kopenbsd-i386: kopenbsd.image.i386 $(VasEBoot_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/VasEBoot-core/tests/boot/kopenbsd.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(VasEBoot_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/VasEBoot-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-kopenbsd-x86_64: kopenbsd.image.x86_64 $(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-kopenbsd-x86_64: kopenbsd.image.x86_64 $(VasEBoot_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/VasEBoot-core/tests/boot/kopenbsd.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(VasEBoot_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/VasEBoot-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null knetbsd.miniroot-image.x86_64.gz: knetbsd.miniroot-image.x86_64.img gzip < $< > $@ -bootcheck-knetbsd-x86_64: knetbsd.miniroot-image.x86_64.gz $(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-knetbsd-x86_64: knetbsd.miniroot-image.x86_64.gz $(VasEBoot_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/VasEBoot-core/tests/boot/knetbsd.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(VasEBoot_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/VasEBoot-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg --qemu-opts="-cpu $(MINIMUM_CPU_LINUX)" | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux-i386: linux-initramfs.i386 $(VasEBoot_PAYLOADS_DIR)/linux.i386 $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.i386 $(srcdir)/VasEBoot-core/tests/boot/linux.cfg --qemu-opts="-cpu $(MINIMUM_CPU_LINUX)" | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux-x86_64: linux-initramfs.x86_64 $(VasEBoot_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/VasEBoot-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux-mips: linux-initramfs.mips $(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux-mips: linux-initramfs.mips $(VasEBoot_PAYLOADS_DIR)/linux.mips $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mips --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.mips $(srcdir)/VasEBoot-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux-ppc: linux-initramfs.ppc $(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux-ppc: linux-initramfs.ppc $(VasEBoot_PAYLOADS_DIR)/linux.ppc $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.ppc --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.ppc $(srcdir)/VasEBoot-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux-mipsel: linux-initramfs.mipsel $(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux-mipsel: linux-initramfs.mipsel $(VasEBoot_PAYLOADS_DIR)/linux.mipsel $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mipsel --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.mipsel $(srcdir)/VasEBoot-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux-loongson: linux-initramfs.loongson $(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.loongson --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux-loongson: linux-initramfs.loongson $(VasEBoot_PAYLOADS_DIR)/linux.loongson $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.loongson --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.loongson $(srcdir)/VasEBoot-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux16-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux16-i386: linux-initramfs.i386 $(VasEBoot_PAYLOADS_DIR)/linux.i386 $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.i386 $(srcdir)/VasEBoot-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-linux16-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-linux16-x86_64: linux-initramfs.x86_64 $(VasEBoot_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/VasEBoot-core/tests/boot/linux.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(VasEBoot_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/VasEBoot-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-multiboot: multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot.elf=multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-multiboot: multiboot.elf $(srcdir)/VasEBoot-core/tests/boot/multiboot.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot.elf=multiboot.elf $(srcdir)/VasEBoot-core/tests/boot/multiboot.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-multiboot2: multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-multiboot2: multiboot2.elf $(srcdir)/VasEBoot-core/tests/boot/multiboot2.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/VasEBoot-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-kfreebsd-aout: kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-kfreebsd-aout: kfreebsd.aout $(srcdir)/VasEBoot-core/tests/boot/kfreebsd-aout.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/VasEBoot-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-pc-chainloader: pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-pc-chainloader: pc-chainloader.bin $(srcdir)/VasEBoot-core/tests/boot/pc-chainloader.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/VasEBoot-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null -bootcheck-ntldr: ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg grub-shell - ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-ntldr: ntldr.bin $(srcdir)/VasEBoot-core/tests/boot/ntldr.cfg VasEBoot-shell + ./VasEBoot-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/VasEBoot-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null if COND_i386_efi # NetBSD has no support for finding ACPI on EFI @@ -422,21 +422,21 @@ BOOTCHECK_TIMEOUT=180 bootcheck: $(BOOTCHECKS) if COND_i386_coreboot -default_payload.elf: grub-mkstandalone grub-mkimage FORCE +default_payload.elf: VasEBoot-mkstandalone VasEBoot-mkimage FORCE test -f $@ && rm $@ || true - pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg + pkgdatadir=. ./VasEBoot-mkstandalone --VasEBoot-mkimage=./VasEBoot-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat VasEBoot-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d VasEBoot-core/ /boot/VasEBoot/VasEBoot.cfg=$(srcdir)/coreboot.cfg endif endif -EXTRA_DIST += grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/tests/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/boot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/boot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub-core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/tests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/tests/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-core/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core/tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/tests/boot/qemu-shutdown-x86.S +EXTRA_DIST += VasEBoot-core/tests/boot/kbsd.init-i386.S VasEBoot-core/tests/boot/kbsd.init-x86_64.S VasEBoot-core/tests/boot/kbsd.spec.txt VasEBoot-core/tests/boot/kernel-8086.S VasEBoot-core/tests/boot/kernel-i386.S VasEBoot-core/tests/boot/kfreebsd-aout.cfg VasEBoot-core/tests/boot/kfreebsd.cfg VasEBoot-core/tests/boot/kfreebsd.init-i386.S VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S VasEBoot-core/tests/boot/knetbsd.cfg VasEBoot-core/tests/boot/kopenbsd.cfg VasEBoot-core/tests/boot/kopenbsdlabel.txt VasEBoot-core/tests/boot/linux16.cfg VasEBoot-core/tests/boot/linux.cfg VasEBoot-core/tests/boot/linux.init-i386.S VasEBoot-core/tests/boot/linux.init-mips.S VasEBoot-core/tests/boot/linux.init-ppc.S VasEBoot-core/tests/boot/linux.init-x86_64.S VasEBoot-core/tests/boot/linux-ppc.cfg VasEBoot-core/tests/boot/multiboot2.cfg VasEBoot-core/tests/boot/multiboot.cfg VasEBoot-core/tests/boot/ntldr.cfg VasEBoot-core/tests/boot/pc-chainloader.cfg VasEBoot-core/tests/boot/qemu-shutdown-x86.S windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA) test -d $(windowsdir) && rm -rf $(windowsdir) || true test -d $(windowsdir) || mkdir $(windowsdir) $(MAKE) -C po $(AM_MAKEFLAGS) windowsdir - $(MAKE) -C grub-core $(AM_MAKEFLAGS) windowsdir + $(MAKE) -C VasEBoot-core $(AM_MAKEFLAGS) windowsdir test -d $(windowsdir)/themes || mkdir $(windowsdir)/themes test -d $(windowsdir)/themes/starfield || mkdir $(windowsdir)/themes/starfield for x in $(PROGRAMS); do \ @@ -449,7 +449,7 @@ windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA) for x in $(starfield_DATA); do \ cp -fp $$x $(windowsdir)/themes/starfield/$$(basename $$x); \ done - for x in $(GRUB_WINDOWS_EXTRA_DIST); do \ + for x in $(VasEBoot_WINDOWS_EXTRA_DIST); do \ cp -fp $$x $(windowsdir); \ done @@ -474,8 +474,8 @@ ChangeLog: FORCE EXTRA_DIST += ChangeLog ChangeLog-2015 -syslinux_test: $(top_builddir)/config.status tests/syslinux/ubuntu10.04_grub.cfg +syslinux_test: $(top_builddir)/config.status tests/syslinux/ubuntu10.04_VasEBoot.cfg -tests/syslinux/ubuntu10.04_grub.cfg: $(top_builddir)/config.status tests/syslinux/ubuntu10.04_grub.cfg.in - (for x in tests/syslinux/ubuntu10.04_grub.cfg.in ; do cat $(srcdir)/"$$x"; done) | $(top_builddir)/config.status --file=$@:- -CLEANFILES += tests/syslinux/ubuntu10.04_grub.cfg +tests/syslinux/ubuntu10.04_VasEBoot.cfg: $(top_builddir)/config.status tests/syslinux/ubuntu10.04_VasEBoot.cfg.in + (for x in tests/syslinux/ubuntu10.04_VasEBoot.cfg.in ; do cat $(srcdir)/"$$x"; done) | $(top_builddir)/config.status --file=$@:- +CLEANFILES += tests/syslinux/ubuntu10.04_VasEBoot.cfg diff --git a/Makefile.util.def b/Makefile.util.def index 4b1b4c410..b7dc09ea6 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -1,548 +1,548 @@ AutoGen definitions Makefile.tpl; library = { - name = libgrubkern.a; + name = libVasEBootkern.a; cflags = '$(CFLAGS_GNULIB)'; cppflags = '$(CPPFLAGS_GNULIB)'; common = util/misc.c; - common = grub-core/kern/command.c; - common = grub-core/kern/device.c; - common = grub-core/kern/disk.c; - common = grub-core/lib/disk.c; + common = VasEBoot-core/kern/command.c; + common = VasEBoot-core/kern/device.c; + common = VasEBoot-core/kern/disk.c; + common = VasEBoot-core/lib/disk.c; common = util/getroot.c; - common = grub-core/osdep/unix/getroot.c; - common = grub-core/osdep/getroot.c; - common = grub-core/osdep/devmapper/getroot.c; - common = grub-core/osdep/relpath.c; - extra_dist = grub-core/kern/disk_common.c; - extra_dist = grub-core/osdep/unix/relpath.c; - extra_dist = grub-core/osdep/aros/relpath.c; - extra_dist = grub-core/osdep/windows/relpath.c; - common = grub-core/kern/emu/hostdisk.c; - common = grub-core/osdep/devmapper/hostdisk.c; - common = grub-core/osdep/hostdisk.c; - common = grub-core/osdep/unix/hostdisk.c; - common = grub-core/osdep/exec.c; - common = grub-core/osdep/sleep.c; - common = grub-core/osdep/password.c; - common = grub-core/kern/emu/misc.c; - common = grub-core/kern/emu/mm.c; - common = grub-core/kern/env.c; - common = grub-core/kern/err.c; - common = grub-core/kern/file.c; - common = grub-core/kern/fs.c; - common = grub-core/kern/list.c; - common = grub-core/kern/misc.c; - common = grub-core/kern/partition.c; - common = grub-core/lib/crypto.c; - common = grub-core/disk/luks.c; - common = grub-core/disk/geli.c; - common = grub-core/disk/cryptodisk.c; - common = grub-core/disk/AFSplitter.c; - common = grub-core/lib/pbkdf2.c; - common = grub-core/commands/extcmd.c; - common = grub-core/lib/arg.c; - common = grub-core/disk/ldm.c; - common = grub-core/disk/diskfilter.c; - common = grub-core/partmap/gpt.c; - common = grub-core/partmap/msdos.c; - common = grub-core/fs/proc.c; - common = grub-core/fs/archelp.c; + common = VasEBoot-core/osdep/unix/getroot.c; + common = VasEBoot-core/osdep/getroot.c; + common = VasEBoot-core/osdep/devmapper/getroot.c; + common = VasEBoot-core/osdep/relpath.c; + extra_dist = VasEBoot-core/kern/disk_common.c; + extra_dist = VasEBoot-core/osdep/unix/relpath.c; + extra_dist = VasEBoot-core/osdep/aros/relpath.c; + extra_dist = VasEBoot-core/osdep/windows/relpath.c; + common = VasEBoot-core/kern/emu/hostdisk.c; + common = VasEBoot-core/osdep/devmapper/hostdisk.c; + common = VasEBoot-core/osdep/hostdisk.c; + common = VasEBoot-core/osdep/unix/hostdisk.c; + common = VasEBoot-core/osdep/exec.c; + common = VasEBoot-core/osdep/sleep.c; + common = VasEBoot-core/osdep/password.c; + common = VasEBoot-core/kern/emu/misc.c; + common = VasEBoot-core/kern/emu/mm.c; + common = VasEBoot-core/kern/env.c; + common = VasEBoot-core/kern/err.c; + common = VasEBoot-core/kern/file.c; + common = VasEBoot-core/kern/fs.c; + common = VasEBoot-core/kern/list.c; + common = VasEBoot-core/kern/misc.c; + common = VasEBoot-core/kern/partition.c; + common = VasEBoot-core/lib/crypto.c; + common = VasEBoot-core/disk/luks.c; + common = VasEBoot-core/disk/geli.c; + common = VasEBoot-core/disk/cryptodisk.c; + common = VasEBoot-core/disk/AFSplitter.c; + common = VasEBoot-core/lib/pbkdf2.c; + common = VasEBoot-core/commands/extcmd.c; + common = VasEBoot-core/lib/arg.c; + common = VasEBoot-core/disk/ldm.c; + common = VasEBoot-core/disk/diskfilter.c; + common = VasEBoot-core/partmap/gpt.c; + common = VasEBoot-core/partmap/msdos.c; + common = VasEBoot-core/fs/proc.c; + common = VasEBoot-core/fs/archelp.c; }; library = { - name = libgrubmods.a; + name = libVasEBootmods.a; cflags = '-fno-builtin -Wno-undef'; - cppflags = '-I$(top_srcdir)/grub-core/lib/minilzo -I$(srcdir)/grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H'; + cppflags = '-I$(top_srcdir)/VasEBoot-core/lib/minilzo -I$(srcdir)/VasEBoot-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H'; - common_nodist = grub_script.tab.c; - common_nodist = grub_script.yy.c; - common_nodist = libgrub_a_init.c; - common_nodist = grub_script.yy.h; - common_nodist = grub_script.tab.h; + common_nodist = VasEBoot_script.tab.c; + common_nodist = VasEBoot_script.yy.c; + common_nodist = libVasEBoot_a_init.c; + common_nodist = VasEBoot_script.yy.h; + common_nodist = VasEBoot_script.tab.h; - common = grub-core/commands/blocklist.c; - common = grub-core/commands/macbless.c; - common = grub-core/commands/xnu_uuid.c; - common = grub-core/commands/testload.c; - common = grub-core/commands/ls.c; - common = grub-core/disk/dmraid_nvidia.c; - common = grub-core/disk/loopback.c; - common = grub-core/disk/lvm.c; - common = grub-core/disk/mdraid_linux.c; - common = grub-core/disk/mdraid_linux_be.c; - common = grub-core/disk/mdraid1x_linux.c; - common = grub-core/disk/raid5_recover.c; - common = grub-core/disk/raid6_recover.c; - common = grub-core/font/font.c; - common = grub-core/gfxmenu/font.c; - common = grub-core/normal/charset.c; - common = grub-core/video/fb/fbblit.c; - common = grub-core/video/fb/fbutil.c; - common = grub-core/video/fb/fbfill.c; - common = grub-core/video/fb/video_fb.c; - common = grub-core/video/video.c; - common = grub-core/video/capture.c; - common = grub-core/video/colors.c; - common = grub-core/unidata.c; - common = grub-core/io/bufio.c; - common = grub-core/fs/affs.c; - common = grub-core/fs/afs.c; - common = grub-core/fs/bfs.c; - common = grub-core/fs/btrfs.c; - common = grub-core/fs/cbfs.c; - common = grub-core/fs/cpio.c; - common = grub-core/fs/cpio_be.c; - common = grub-core/fs/odc.c; - common = grub-core/fs/newc.c; - common = grub-core/fs/ext2.c; - common = grub-core/fs/fat.c; - common = grub-core/fs/exfat.c; - common = grub-core/fs/fshelp.c; - common = grub-core/fs/hfs.c; - common = grub-core/fs/hfsplus.c; - common = grub-core/fs/hfspluscomp.c; - common = grub-core/fs/iso9660.c; - common = grub-core/fs/jfs.c; - common = grub-core/fs/minix.c; - common = grub-core/fs/minix2.c; - common = grub-core/fs/minix3.c; - common = grub-core/fs/minix_be.c; - common = grub-core/fs/minix2_be.c; - common = grub-core/fs/minix3_be.c; - common = grub-core/fs/nilfs2.c; - common = grub-core/fs/ntfs.c; - common = grub-core/fs/ntfscomp.c; - common = grub-core/fs/reiserfs.c; - common = grub-core/fs/romfs.c; - common = grub-core/fs/sfs.c; - common = grub-core/fs/squash4.c; - common = grub-core/fs/tar.c; - common = grub-core/fs/udf.c; - common = grub-core/fs/ufs2.c; - common = grub-core/fs/ufs.c; - common = grub-core/fs/ufs_be.c; - common = grub-core/fs/xfs.c; - common = grub-core/fs/zfs/zfscrypt.c; - common = grub-core/fs/zfs/zfs.c; - common = grub-core/fs/zfs/zfsinfo.c; - common = grub-core/fs/zfs/zfs_lzjb.c; - common = grub-core/fs/zfs/zfs_lz4.c; - common = grub-core/fs/zfs/zfs_sha256.c; - common = grub-core/fs/zfs/zfs_fletcher.c; - common = grub-core/lib/envblk.c; - common = grub-core/lib/hexdump.c; - common = grub-core/lib/LzFind.c; - common = grub-core/lib/LzmaEnc.c; - common = grub-core/lib/crc.c; - common = grub-core/lib/adler32.c; - common = grub-core/lib/crc64.c; - common = grub-core/normal/datetime.c; - common = grub-core/normal/misc.c; - common = grub-core/partmap/acorn.c; - common = grub-core/partmap/amiga.c; - common = grub-core/partmap/apple.c; - common = grub-core/partmap/sun.c; - common = grub-core/partmap/plan.c; - common = grub-core/partmap/dvh.c; - common = grub-core/partmap/sunpc.c; - common = grub-core/partmap/bsdlabel.c; - common = grub-core/partmap/dfly.c; - common = grub-core/script/function.c; - common = grub-core/script/lexer.c; - common = grub-core/script/main.c; - common = grub-core/script/script.c; - common = grub-core/script/argv.c; - common = grub-core/io/gzio.c; - common = grub-core/io/xzio.c; - common = grub-core/io/lzopio.c; - common = grub-core/kern/ia64/dl_helper.c; - common = grub-core/kern/arm/dl_helper.c; - common = grub-core/kern/arm64/dl_helper.c; - common = grub-core/lib/minilzo/minilzo.c; - common = grub-core/lib/xzembed/xz_dec_bcj.c; - common = grub-core/lib/xzembed/xz_dec_lzma2.c; - common = grub-core/lib/xzembed/xz_dec_stream.c; + common = VasEBoot-core/commands/blocklist.c; + common = VasEBoot-core/commands/macbless.c; + common = VasEBoot-core/commands/xnu_uuid.c; + common = VasEBoot-core/commands/testload.c; + common = VasEBoot-core/commands/ls.c; + common = VasEBoot-core/disk/dmraid_nvidia.c; + common = VasEBoot-core/disk/loopback.c; + common = VasEBoot-core/disk/lvm.c; + common = VasEBoot-core/disk/mdraid_linux.c; + common = VasEBoot-core/disk/mdraid_linux_be.c; + common = VasEBoot-core/disk/mdraid1x_linux.c; + common = VasEBoot-core/disk/raid5_recover.c; + common = VasEBoot-core/disk/raid6_recover.c; + common = VasEBoot-core/font/font.c; + common = VasEBoot-core/gfxmenu/font.c; + common = VasEBoot-core/normal/charset.c; + common = VasEBoot-core/video/fb/fbblit.c; + common = VasEBoot-core/video/fb/fbutil.c; + common = VasEBoot-core/video/fb/fbfill.c; + common = VasEBoot-core/video/fb/video_fb.c; + common = VasEBoot-core/video/video.c; + common = VasEBoot-core/video/capture.c; + common = VasEBoot-core/video/colors.c; + common = VasEBoot-core/unidata.c; + common = VasEBoot-core/io/bufio.c; + common = VasEBoot-core/fs/affs.c; + common = VasEBoot-core/fs/afs.c; + common = VasEBoot-core/fs/bfs.c; + common = VasEBoot-core/fs/btrfs.c; + common = VasEBoot-core/fs/cbfs.c; + common = VasEBoot-core/fs/cpio.c; + common = VasEBoot-core/fs/cpio_be.c; + common = VasEBoot-core/fs/odc.c; + common = VasEBoot-core/fs/newc.c; + common = VasEBoot-core/fs/ext2.c; + common = VasEBoot-core/fs/fat.c; + common = VasEBoot-core/fs/exfat.c; + common = VasEBoot-core/fs/fshelp.c; + common = VasEBoot-core/fs/hfs.c; + common = VasEBoot-core/fs/hfsplus.c; + common = VasEBoot-core/fs/hfspluscomp.c; + common = VasEBoot-core/fs/iso9660.c; + common = VasEBoot-core/fs/jfs.c; + common = VasEBoot-core/fs/minix.c; + common = VasEBoot-core/fs/minix2.c; + common = VasEBoot-core/fs/minix3.c; + common = VasEBoot-core/fs/minix_be.c; + common = VasEBoot-core/fs/minix2_be.c; + common = VasEBoot-core/fs/minix3_be.c; + common = VasEBoot-core/fs/nilfs2.c; + common = VasEBoot-core/fs/ntfs.c; + common = VasEBoot-core/fs/ntfscomp.c; + common = VasEBoot-core/fs/reiserfs.c; + common = VasEBoot-core/fs/romfs.c; + common = VasEBoot-core/fs/sfs.c; + common = VasEBoot-core/fs/squash4.c; + common = VasEBoot-core/fs/tar.c; + common = VasEBoot-core/fs/udf.c; + common = VasEBoot-core/fs/ufs2.c; + common = VasEBoot-core/fs/ufs.c; + common = VasEBoot-core/fs/ufs_be.c; + common = VasEBoot-core/fs/xfs.c; + common = VasEBoot-core/fs/zfs/zfscrypt.c; + common = VasEBoot-core/fs/zfs/zfs.c; + common = VasEBoot-core/fs/zfs/zfsinfo.c; + common = VasEBoot-core/fs/zfs/zfs_lzjb.c; + common = VasEBoot-core/fs/zfs/zfs_lz4.c; + common = VasEBoot-core/fs/zfs/zfs_sha256.c; + common = VasEBoot-core/fs/zfs/zfs_fletcher.c; + common = VasEBoot-core/lib/envblk.c; + common = VasEBoot-core/lib/hexdump.c; + common = VasEBoot-core/lib/LzFind.c; + common = VasEBoot-core/lib/LzmaEnc.c; + common = VasEBoot-core/lib/crc.c; + common = VasEBoot-core/lib/adler32.c; + common = VasEBoot-core/lib/crc64.c; + common = VasEBoot-core/normal/datetime.c; + common = VasEBoot-core/normal/misc.c; + common = VasEBoot-core/partmap/acorn.c; + common = VasEBoot-core/partmap/amiga.c; + common = VasEBoot-core/partmap/apple.c; + common = VasEBoot-core/partmap/sun.c; + common = VasEBoot-core/partmap/plan.c; + common = VasEBoot-core/partmap/dvh.c; + common = VasEBoot-core/partmap/sunpc.c; + common = VasEBoot-core/partmap/bsdlabel.c; + common = VasEBoot-core/partmap/dfly.c; + common = VasEBoot-core/script/function.c; + common = VasEBoot-core/script/lexer.c; + common = VasEBoot-core/script/main.c; + common = VasEBoot-core/script/script.c; + common = VasEBoot-core/script/argv.c; + common = VasEBoot-core/io/gzio.c; + common = VasEBoot-core/io/xzio.c; + common = VasEBoot-core/io/lzopio.c; + common = VasEBoot-core/kern/ia64/dl_helper.c; + common = VasEBoot-core/kern/arm/dl_helper.c; + common = VasEBoot-core/kern/arm64/dl_helper.c; + common = VasEBoot-core/lib/minilzo/minilzo.c; + common = VasEBoot-core/lib/xzembed/xz_dec_bcj.c; + common = VasEBoot-core/lib/xzembed/xz_dec_lzma2.c; + common = VasEBoot-core/lib/xzembed/xz_dec_stream.c; }; program = { - name = grub-mkimage; + name = VasEBoot-mkimage; mansection = 1; - common = util/grub-mkimage.c; + common = util/VasEBoot-mkimage.c; common = util/mkimage.c; - common = util/grub-mkimage32.c; - common = util/grub-mkimage64.c; + common = util/VasEBoot-mkimage32.c; + common = util/VasEBoot-mkimage64.c; common = util/resolve.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; - common = grub-core/osdep/config.c; - extra_dist = grub-core/osdep/aros/config.c; - extra_dist = grub-core/osdep/windows/config.c; - extra_dist = grub-core/osdep/unix/config.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; + common = VasEBoot-core/osdep/config.c; + extra_dist = VasEBoot-core/osdep/aros/config.c; + extra_dist = VasEBoot-core/osdep/windows/config.c; + extra_dist = VasEBoot-core/osdep/unix/config.c; common = util/config.c; - extra_dist = util/grub-mkimagexx.c; + extra_dist = util/VasEBoot-mkimagexx.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBLZMA)'; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - cppflags = '-DGRUB_PKGLIBDIR=\"$(pkglibdir)\"'; + cppflags = '-DVasEBoot_PKGLIBDIR=\"$(pkglibdir)\"'; }; program = { - name = grub-mkrelpath; + name = VasEBoot-mkrelpath; mansection = 1; - common = util/grub-mkrelpath.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = util/VasEBoot-mkrelpath.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-script-check; + name = VasEBoot-script-check; mansection = 1; - common = util/grub-script-check.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = util/VasEBoot-script-check.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-editenv; + name = VasEBoot-editenv; mansection = 1; - common = util/grub-editenv.c; + common = util/VasEBoot-editenv.c; common = util/editenv.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-mkpasswd-pbkdf2; + name = VasEBoot-mkpasswd-pbkdf2; mansection = 1; - common = util/grub-mkpasswd-pbkdf2.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/random.c; - common = grub-core/osdep/init.c; + common = util/VasEBoot-mkpasswd-pbkdf2.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/random.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-macho2img; + name = VasEBoot-macho2img; mansection = 1; - common = util/grub-macho2img.c; + common = util/VasEBoot-macho2img.c; condition = COND_APPLE_LINKER; }; program = { - name = grub-fstest; + name = VasEBoot-fstest; mansection = 1; - common_nodist = grub_fstest_init.c; - common = util/grub-fstest.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; - common = grub-core/osdep/init.c; + common_nodist = VasEBoot_fstest_init.c; + common = util/VasEBoot-fstest.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-mount; + name = VasEBoot-mount; mansection = 1; - common_nodist = grub_fstest_init.c; - common = util/grub-mount.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; - common = grub-core/osdep/init.c; + common_nodist = VasEBoot_fstest_init.c; + common = util/VasEBoot-mount.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM) -lfuse'; - condition = COND_GRUB_MOUNT; + condition = COND_VasEBoot_MOUNT; }; program = { - name = grub-mkfont; + name = VasEBoot-mkfont; mansection = 1; - common = util/grub-mkfont.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = util/VasEBoot-mkfont.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; cflags = '$(freetype_cflags)'; - cppflags = '-DGRUB_MKFONT=1'; + cppflags = '-DVasEBoot_MKFONT=1'; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(freetype_libs)'; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - condition = COND_GRUB_MKFONT; + condition = COND_VasEBoot_MKFONT; }; program = { - name = grub-probe; + name = VasEBoot-probe; installdir = sbin; mansection = 8; - common = util/grub-probe.c; + common = util/VasEBoot-probe.c; common = util/probe.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-bios-setup; + name = VasEBoot-bios-setup; installdir = sbin; mansection = 8; - common = util/grub-setup.c; + common = util/VasEBoot-setup.c; common = util/setup_bios.c; extra_dist = util/setup.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/lib/reed_solomon.c; - common = grub-core/osdep/blocklist.c; - extra_dist = grub-core/osdep/generic/blocklist.c; - extra_dist = grub-core/osdep/linux/blocklist.c; - extra_dist = grub-core/osdep/windows/blocklist.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/lib/reed_solomon.c; + common = VasEBoot-core/osdep/blocklist.c; + extra_dist = VasEBoot-core/osdep/generic/blocklist.c; + extra_dist = VasEBoot-core/osdep/linux/blocklist.c; + extra_dist = VasEBoot-core/osdep/windows/blocklist.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubkern.a; - ldadd = libgrubgcry.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootkern.a; + ldadd = libVasEBootgcry.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - cppflags = '-DGRUB_SETUP_FUNC=grub_util_bios_setup'; + cppflags = '-DVasEBoot_SETUP_FUNC=VasEBoot_util_bios_setup'; }; program = { - name = grub-sparc64-setup; + name = VasEBoot-sparc64-setup; installdir = sbin; mansection = 8; - common = util/grub-setup.c; + common = util/VasEBoot-setup.c; common = util/setup_sparc.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/lib/reed_solomon.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/osdep/blocklist.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/lib/reed_solomon.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/osdep/blocklist.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubkern.a; - ldadd = libgrubgcry.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootkern.a; + ldadd = libVasEBootgcry.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - cppflags = '-DGRUB_SETUP_FUNC=grub_util_sparc_setup'; + cppflags = '-DVasEBoot_SETUP_FUNC=VasEBoot_util_sparc_setup'; }; program = { - name = grub-ofpathname; + name = VasEBoot-ofpathname; installdir = sbin; mansection = 8; - common = util/ieee1275/grub-ofpathname.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/osdep/init.c; + common = util/ieee1275/VasEBoot-ofpathname.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-mklayout; + name = VasEBoot-mklayout; mansection = 1; - common = util/grub-mklayout.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = util/VasEBoot-mklayout.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-macbless; + name = VasEBoot-macbless; installdir = sbin; mansection = 8; - common = util/grub-macbless.c; - common = grub-core/osdep/init.c; - common = grub-core/kern/emu/argp_common.c; + common = util/VasEBoot-macbless.c; + common = VasEBoot-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; data = { - common = util/grub.d/README; - installdir = grubconf; + common = util/VasEBoot.d/README; + installdir = VasEBootconf; }; script = { name = '00_header'; - common = util/grub.d/00_header.in; - installdir = grubconf; + common = util/VasEBoot.d/00_header.in; + installdir = VasEBootconf; }; script = { name = '10_windows'; - common = util/grub.d/10_windows.in; - installdir = grubconf; + common = util/VasEBoot.d/10_windows.in; + installdir = VasEBootconf; condition = COND_HOST_WINDOWS; }; script = { name = '10_hurd'; - common = util/grub.d/10_hurd.in; - installdir = grubconf; + common = util/VasEBoot.d/10_hurd.in; + installdir = VasEBootconf; condition = COND_HOST_HURD; }; script = { name = '10_kfreebsd'; - common = util/grub.d/10_kfreebsd.in; - installdir = grubconf; + common = util/VasEBoot.d/10_kfreebsd.in; + installdir = VasEBootconf; condition = COND_HOST_KFREEBSD; }; script = { name = '10_illumos'; - common = util/grub.d/10_illumos.in; - installdir = grubconf; + common = util/VasEBoot.d/10_illumos.in; + installdir = VasEBootconf; condition = COND_HOST_ILLUMOS; }; script = { name = '10_netbsd'; - common = util/grub.d/10_netbsd.in; - installdir = grubconf; + common = util/VasEBoot.d/10_netbsd.in; + installdir = VasEBootconf; condition = COND_HOST_NETBSD; }; script = { name = '10_linux'; - common = util/grub.d/10_linux.in; - installdir = grubconf; + common = util/VasEBoot.d/10_linux.in; + installdir = VasEBootconf; condition = COND_HOST_LINUX; }; script = { name = '10_xnu'; - common = util/grub.d/10_xnu.in; - installdir = grubconf; + common = util/VasEBoot.d/10_xnu.in; + installdir = VasEBootconf; condition = COND_HOST_XNU; }; script = { name = '20_linux_xen'; - common = util/grub.d/20_linux_xen.in; - installdir = grubconf; + common = util/VasEBoot.d/20_linux_xen.in; + installdir = VasEBootconf; condition = COND_HOST_LINUX; }; script = { name = '30_os-prober'; - common = util/grub.d/30_os-prober.in; - installdir = grubconf; + common = util/VasEBoot.d/30_os-prober.in; + installdir = VasEBootconf; }; script = { name = '40_custom'; - common = util/grub.d/40_custom.in; - installdir = grubconf; + common = util/VasEBoot.d/40_custom.in; + installdir = VasEBootconf; }; script = { name = '41_custom'; - common = util/grub.d/41_custom.in; - installdir = grubconf; + common = util/VasEBoot.d/41_custom.in; + installdir = VasEBootconf; }; program = { mansection = 1; - name = grub-mkrescue; + name = VasEBoot-mkrescue; - common = util/grub-mkrescue.c; + common = util/VasEBoot-mkrescue.c; common = util/render-label.c; common = util/glue-efi.c; common = util/mkimage.c; - common = util/grub-mkimage32.c; - common = util/grub-mkimage64.c; - common = util/grub-install-common.c; + common = util/VasEBoot-mkimage32.c; + common = util/VasEBoot-mkimage64.c; + common = util/VasEBoot-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; - common = grub-core/lib/reed_solomon.c; - common = grub-core/osdep/random.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/osdep/platform.c; - common = grub-core/osdep/platform_unix.c; - common = grub-core/osdep/compress.c; - extra_dist = grub-core/osdep/unix/compress.c; - extra_dist = grub-core/osdep/basic/compress.c; + common = VasEBoot-core/lib/reed_solomon.c; + common = VasEBoot-core/osdep/random.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/osdep/platform.c; + common = VasEBoot-core/osdep/platform_unix.c; + common = VasEBoot-core/osdep/compress.c; + extra_dist = VasEBoot-core/osdep/unix/compress.c; + extra_dist = VasEBoot-core/osdep/basic/compress.c; common = util/editenv.c; - common = grub-core/osdep/blocklist.c; - common = grub-core/osdep/config.c; + common = VasEBoot-core/osdep/blocklist.c; + common = VasEBoot-core/osdep/config.c; common = util/config.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; common = util/resolve.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; ldadd = '$(LIBLZMA)'; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; condition = COND_HAVE_EXEC; @@ -550,172 +550,172 @@ program = { program = { mansection = 1; - name = grub-mkstandalone; - common = util/grub-mkstandalone.c; + name = VasEBoot-mkstandalone; + common = util/VasEBoot-mkstandalone.c; common = util/render-label.c; common = util/glue-efi.c; common = util/mkimage.c; - common = util/grub-mkimage32.c; - common = util/grub-mkimage64.c; - common = util/grub-install-common.c; + common = util/VasEBoot-mkimage32.c; + common = util/VasEBoot-mkimage64.c; + common = util/VasEBoot-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; - common = grub-core/lib/reed_solomon.c; - common = grub-core/osdep/random.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/osdep/platform.c; - common = grub-core/osdep/platform_unix.c; - extra_dist = grub-core/osdep/linux/platform.c; - extra_dist = grub-core/osdep/windows/platform.c; - extra_dist = grub-core/osdep/basic/platform.c; - extra_dist = grub-core/osdep/basic/no_platform.c; - extra_dist = grub-core/osdep/unix/platform.c; - common = grub-core/osdep/compress.c; + common = VasEBoot-core/lib/reed_solomon.c; + common = VasEBoot-core/osdep/random.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/osdep/platform.c; + common = VasEBoot-core/osdep/platform_unix.c; + extra_dist = VasEBoot-core/osdep/linux/platform.c; + extra_dist = VasEBoot-core/osdep/windows/platform.c; + extra_dist = VasEBoot-core/osdep/basic/platform.c; + extra_dist = VasEBoot-core/osdep/basic/no_platform.c; + extra_dist = VasEBoot-core/osdep/unix/platform.c; + common = VasEBoot-core/osdep/compress.c; common = util/editenv.c; - common = grub-core/osdep/blocklist.c; - common = grub-core/osdep/config.c; + common = VasEBoot-core/osdep/blocklist.c; + common = VasEBoot-core/osdep/config.c; common = util/config.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; common = util/resolve.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; ldadd = '$(LIBLZMA)'; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { mansection = 8; installdir = sbin; - name = grub-install; + name = VasEBoot-install; - common = util/grub-install.c; + common = util/VasEBoot-install.c; common = util/probe.c; common = util/mkimage.c; - common = util/grub-mkimage32.c; - common = util/grub-mkimage64.c; - common = util/grub-install-common.c; + common = util/VasEBoot-mkimage32.c; + common = util/VasEBoot-mkimage64.c; + common = util/VasEBoot-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; - common = grub-core/lib/reed_solomon.c; - common = grub-core/osdep/random.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/osdep/platform.c; - common = grub-core/osdep/platform_unix.c; - common = grub-core/osdep/compress.c; + common = VasEBoot-core/lib/reed_solomon.c; + common = VasEBoot-core/osdep/random.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/osdep/platform.c; + common = VasEBoot-core/osdep/platform_unix.c; + common = VasEBoot-core/osdep/compress.c; common = util/editenv.c; - common = grub-core/osdep/blocklist.c; - common = grub-core/osdep/config.c; + common = VasEBoot-core/osdep/blocklist.c; + common = VasEBoot-core/osdep/config.c; common = util/config.c; common = util/render-label.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; common = util/resolve.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; ldadd = '$(LIBLZMA)'; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { mansection = 1; installdir = bin; - name = grub-mknetdir; + name = VasEBoot-mknetdir; - common = util/grub-mknetdir.c; + common = util/VasEBoot-mknetdir.c; common = util/mkimage.c; - common = util/grub-mkimage32.c; - common = util/grub-mkimage64.c; - common = util/grub-install-common.c; + common = util/VasEBoot-mkimage32.c; + common = util/VasEBoot-mkimage64.c; + common = util/VasEBoot-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; - common = grub-core/lib/reed_solomon.c; - common = grub-core/osdep/random.c; - common = grub-core/osdep/ofpath.c; - common = grub-core/osdep/platform.c; - common = grub-core/osdep/platform_unix.c; - common = grub-core/osdep/compress.c; + common = VasEBoot-core/lib/reed_solomon.c; + common = VasEBoot-core/osdep/random.c; + common = VasEBoot-core/osdep/ofpath.c; + common = VasEBoot-core/osdep/platform.c; + common = VasEBoot-core/osdep/platform_unix.c; + common = VasEBoot-core/osdep/compress.c; common = util/editenv.c; - common = grub-core/osdep/blocklist.c; - common = grub-core/osdep/config.c; + common = VasEBoot-core/osdep/blocklist.c; + common = VasEBoot-core/osdep/config.c; common = util/config.c; common = util/resolve.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; ldadd = '$(LIBLZMA)'; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; script = { - name = grub-mkconfig; - common = util/grub-mkconfig.in; + name = VasEBoot-mkconfig; + common = util/VasEBoot-mkconfig.in; mansection = 8; installdir = sbin; }; script = { - name = grub-set-default; - common = util/grub-set-default.in; + name = VasEBoot-set-default; + common = util/VasEBoot-set-default.in; mansection = 8; installdir = sbin; }; script = { - name = grub-reboot; - common = util/grub-reboot.in; + name = VasEBoot-reboot; + common = util/VasEBoot-reboot.in; mansection = 8; installdir = sbin; }; script = { - name = grub-mkconfig_lib; - common = util/grub-mkconfig_lib.in; + name = VasEBoot-mkconfig_lib; + common = util/VasEBoot-mkconfig_lib.in; installdir = noinst; }; script = { - name = grub-kbdcomp; - common = util/grub-kbdcomp.in; + name = VasEBoot-kbdcomp; + common = util/VasEBoot-kbdcomp.in; mansection = 1; }; script = { - name = grub-shell; - common = tests/util/grub-shell.in; + name = VasEBoot-shell; + common = tests/util/VasEBoot-shell.in; installdir = noinst; }; script = { - name = grub-shell-tester; - common = tests/util/grub-shell-tester.in; + name = VasEBoot-shell-tester; + common = tests/util/VasEBoot-shell-tester.in; installdir = noinst; }; script = { - name = grub-fs-tester; - common = tests/util/grub-fs-tester.in; + name = VasEBoot-fs-tester; + common = tests/util/VasEBoot-fs-tester.in; installdir = noinst; dependencies = 'garbage-gen$(BUILD_EXEEXT)'; }; @@ -879,170 +879,170 @@ script = { script = { testcase; - name = example_grub_script_test; - common = tests/example_grub_script_test.in; + name = example_VasEBoot_script_test; + common = tests/example_VasEBoot_script_test.in; }; script = { testcase; - name = grub_script_eval; - common = tests/grub_script_eval.in; + name = VasEBoot_script_eval; + common = tests/VasEBoot_script_eval.in; }; script = { testcase; - name = grub_script_test; - common = tests/grub_script_test.in; + name = VasEBoot_script_test; + common = tests/VasEBoot_script_test.in; }; script = { testcase; - name = grub_script_echo1; - common = tests/grub_script_echo1.in; + name = VasEBoot_script_echo1; + common = tests/VasEBoot_script_echo1.in; }; script = { testcase; - name = grub_script_leading_whitespace; - common = tests/grub_script_leading_whitespace.in; + name = VasEBoot_script_leading_whitespace; + common = tests/VasEBoot_script_leading_whitespace.in; }; script = { testcase; - name = grub_script_echo_keywords; - common = tests/grub_script_echo_keywords.in; + name = VasEBoot_script_echo_keywords; + common = tests/VasEBoot_script_echo_keywords.in; }; script = { testcase; - name = grub_script_vars1; - common = tests/grub_script_vars1.in; + name = VasEBoot_script_vars1; + common = tests/VasEBoot_script_vars1.in; }; script = { testcase; - name = grub_script_for1; - common = tests/grub_script_for1.in; + name = VasEBoot_script_for1; + common = tests/VasEBoot_script_for1.in; }; script = { testcase; - name = grub_script_while1; - common = tests/grub_script_while1.in; + name = VasEBoot_script_while1; + common = tests/VasEBoot_script_while1.in; }; script = { testcase; - name = grub_script_if; - common = tests/grub_script_if.in; + name = VasEBoot_script_if; + common = tests/VasEBoot_script_if.in; }; script = { testcase; - name = grub_script_blanklines; - common = tests/grub_script_blanklines.in; + name = VasEBoot_script_blanklines; + common = tests/VasEBoot_script_blanklines.in; }; script = { testcase; - name = grub_script_final_semicolon; - common = tests/grub_script_final_semicolon.in; + name = VasEBoot_script_final_semicolon; + common = tests/VasEBoot_script_final_semicolon.in; }; script = { testcase; - name = grub_script_dollar; - common = tests/grub_script_dollar.in; + name = VasEBoot_script_dollar; + common = tests/VasEBoot_script_dollar.in; }; script = { testcase; - name = grub_script_comments; - common = tests/grub_script_comments.in; + name = VasEBoot_script_comments; + common = tests/VasEBoot_script_comments.in; }; script = { testcase; - name = grub_script_functions; - common = tests/grub_script_functions.in; + name = VasEBoot_script_functions; + common = tests/VasEBoot_script_functions.in; }; script = { testcase; - name = grub_script_break; - common = tests/grub_script_break.in; + name = VasEBoot_script_break; + common = tests/VasEBoot_script_break.in; }; script = { testcase; - name = grub_script_continue; - common = tests/grub_script_continue.in; + name = VasEBoot_script_continue; + common = tests/VasEBoot_script_continue.in; }; script = { testcase; - name = grub_script_shift; - common = tests/grub_script_shift.in; + name = VasEBoot_script_shift; + common = tests/VasEBoot_script_shift.in; }; script = { testcase; - name = grub_script_blockarg; - common = tests/grub_script_blockarg.in; + name = VasEBoot_script_blockarg; + common = tests/VasEBoot_script_blockarg.in; }; script = { testcase; - name = grub_script_setparams; - common = tests/grub_script_setparams.in; + name = VasEBoot_script_setparams; + common = tests/VasEBoot_script_setparams.in; }; script = { testcase; - name = grub_script_return; - common = tests/grub_script_return.in; + name = VasEBoot_script_return; + common = tests/VasEBoot_script_return.in; }; script = { testcase; - name = grub_cmd_regexp; - common = tests/grub_cmd_regexp.in; + name = VasEBoot_cmd_regexp; + common = tests/VasEBoot_cmd_regexp.in; }; script = { testcase; - name = grub_cmd_date; - common = tests/grub_cmd_date.in; + name = VasEBoot_cmd_date; + common = tests/VasEBoot_cmd_date.in; }; script = { testcase; - name = grub_cmd_set_date; - common = tests/grub_cmd_set_date.in; + name = VasEBoot_cmd_set_date; + common = tests/VasEBoot_cmd_set_date.in; }; script = { testcase; - name = grub_cmd_sleep; - common = tests/grub_cmd_sleep.in; + name = VasEBoot_cmd_sleep; + common = tests/VasEBoot_cmd_sleep.in; }; script = { testcase; - name = grub_script_expansion; - common = tests/grub_script_expansion.in; + name = VasEBoot_script_expansion; + common = tests/VasEBoot_script_expansion.in; }; script = { testcase; - name = grub_script_not; - common = tests/grub_script_not.in; + name = VasEBoot_script_not; + common = tests/VasEBoot_script_not.in; }; script = { testcase; - name = grub_script_no_commands; - common = tests/grub_script_no_commands.in; + name = VasEBoot_script_no_commands; + common = tests/VasEBoot_script_no_commands.in; }; script = { @@ -1107,8 +1107,8 @@ script = { script = { testcase; - name = grub_cmd_echo; - common = tests/grub_cmd_echo.in; + name = VasEBoot_cmd_echo; + common = tests/VasEBoot_cmd_echo.in; }; script = { @@ -1119,20 +1119,20 @@ script = { script = { testcase; - name = grub_script_gettext; - common = tests/grub_script_gettext.in; + name = VasEBoot_script_gettext; + common = tests/VasEBoot_script_gettext.in; }; script = { testcase; - name = grub_script_escape_comma; - common = tests/grub_script_escape_comma.in; + name = VasEBoot_script_escape_comma; + common = tests/VasEBoot_script_escape_comma.in; }; script = { testcase; - name = grub_script_strcmp; - common = tests/grub_script_strcmp.in; + name = VasEBoot_script_strcmp; + common = tests/VasEBoot_script_strcmp.in; }; script = { @@ -1149,14 +1149,14 @@ script = { script = { testcase; - name = grub_func_test; - common = tests/grub_func_test.in; + name = VasEBoot_func_test; + common = tests/VasEBoot_func_test.in; }; script = { testcase; - name = grub_cmd_tr; - common = tests/grub_cmd_tr.in; + name = VasEBoot_cmd_tr; + common = tests/VasEBoot_cmd_tr.in; }; script = { @@ -1179,8 +1179,8 @@ script = { script = { testcase; - name = grub_cmd_test; - common = tests/grub_cmd_test.in; + name = VasEBoot_cmd_test; + common = tests/VasEBoot_cmd_test.in; }; script = { @@ -1194,13 +1194,13 @@ program = { name = example_unit_test; common = tests/example_unit_test.c; common = tests/lib/unit_test.c; - common = grub-core/kern/list.c; - common = grub-core/kern/misc.c; - common = grub-core/tests/lib/test.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + common = VasEBoot-core/kern/list.c; + common = VasEBoot-core/kern/misc.c; + common = VasEBoot-core/tests/lib/test.c; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -1209,13 +1209,13 @@ program = { name = printf_test; common = tests/printf_unit_test.c; common = tests/lib/unit_test.c; - common = grub-core/kern/list.c; - common = grub-core/kern/misc.c; - common = grub-core/tests/lib/test.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + common = VasEBoot-core/kern/list.c; + common = VasEBoot-core/kern/misc.c; + common = VasEBoot-core/tests/lib/test.c; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -1224,13 +1224,13 @@ program = { name = date_test; common = tests/date_unit_test.c; common = tests/lib/unit_test.c; - common = grub-core/kern/list.c; - common = grub-core/kern/misc.c; - common = grub-core/tests/lib/test.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + common = VasEBoot-core/kern/list.c; + common = VasEBoot-core/kern/misc.c; + common = VasEBoot-core/tests/lib/test.c; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -1239,14 +1239,14 @@ program = { name = priority_queue_unit_test; common = tests/priority_queue_unit_test.cc; common = tests/lib/unit_test.c; - common = grub-core/kern/list.c; - common = grub-core/kern/misc.c; - common = grub-core/tests/lib/test.c; - common = grub-core/lib/priority_queue.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + common = VasEBoot-core/kern/list.c; + common = VasEBoot-core/kern/misc.c; + common = VasEBoot-core/tests/lib/test.c; + common = VasEBoot-core/lib/priority_queue.c; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; condition = COND_HAVE_CXX; }; @@ -1256,13 +1256,13 @@ program = { name = cmp_test; common = tests/cmp_unit_test.c; common = tests/lib/unit_test.c; - common = grub-core/kern/list.c; - common = grub-core/kern/misc.c; - common = grub-core/tests/lib/test.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + common = VasEBoot-core/kern/list.c; + common = VasEBoot-core/kern/misc.c; + common = VasEBoot-core/tests/lib/test.c; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ -1271,112 +1271,112 @@ program = { name = gpt_unit_test; common = tests/gpt_unit_test.c; common = tests/lib/unit_test.c; - common = grub-core/commands/search_part_label.c; - common = grub-core/commands/search_part_uuid.c; - common = grub-core/commands/search_disk_uuid.c; - common = grub-core/disk/host.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/lib/gpt.c; - common = grub-core/tests/lib/test.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + common = VasEBoot-core/commands/search_part_label.c; + common = VasEBoot-core/commands/search_part_uuid.c; + common = VasEBoot-core/commands/search_disk_uuid.c; + common = VasEBoot-core/disk/host.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/lib/gpt.c; + common = VasEBoot-core/tests/lib/test.c; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-menulst2cfg; + name = VasEBoot-menulst2cfg; mansection = 1; - common = util/grub-menulst2cfg.c; - common = grub-core/lib/legacy_parse.c; - common = grub-core/lib/i386/pc/vesa_modes_table.c; - common = grub-core/osdep/init.c; + common = util/VasEBoot-menulst2cfg.c; + common = VasEBoot-core/lib/legacy_parse.c; + common = VasEBoot-core/lib/i386/pc/vesa_modes_table.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-syslinux2cfg; + name = VasEBoot-syslinux2cfg; mansection = 1; - common = util/grub-syslinux2cfg.c; - common = grub-core/lib/syslinux_parse.c; - common = grub-core/lib/getline.c; - common = grub-core/osdep/init.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; - common = grub-core/kern/emu/argp_common.c; + common = util/VasEBoot-syslinux2cfg.c; + common = VasEBoot-core/lib/syslinux_parse.c; + common = VasEBoot-core/lib/getline.c; + common = VasEBoot-core/osdep/init.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; + common = VasEBoot-core/kern/emu/argp_common.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-glue-efi; + name = VasEBoot-glue-efi; mansection = 1; - common = util/grub-glue-efi.c; + common = util/VasEBoot-glue-efi.c; common = util/glue-efi.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-render-label; + name = VasEBoot-render-label; mansection = 1; - common = util/grub-render-label.c; + common = util/VasEBoot-render-label.c; common = util/render-label.c; - common = grub-core/kern/emu/argp_common.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/kern/emu/argp_common.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { - name = grub-file; + name = VasEBoot-file; mansection = 1; - common = util/grub-file.c; + common = util/VasEBoot-file.c; common = util/render-label.c; - common = grub-core/commands/file.c; - common = grub-core/commands/file32.c; - common = grub-core/commands/file64.c; - common = grub-core/loader/i386/xen_file.c; - common = grub-core/loader/i386/xen_file32.c; - common = grub-core/loader/i386/xen_file64.c; - common = grub-core/io/offset.c; - common = grub-core/kern/elf.c; - common = grub-core/loader/lzss.c; - common = grub-core/loader/macho.c; - common = grub-core/loader/macho32.c; - common = grub-core/loader/macho64.c; - common = grub-core/kern/emu/hostfs.c; - common = grub-core/disk/host.c; - common = grub-core/osdep/init.c; + common = VasEBoot-core/commands/file.c; + common = VasEBoot-core/commands/file32.c; + common = VasEBoot-core/commands/file64.c; + common = VasEBoot-core/loader/i386/xen_file.c; + common = VasEBoot-core/loader/i386/xen_file32.c; + common = VasEBoot-core/loader/i386/xen_file64.c; + common = VasEBoot-core/io/offset.c; + common = VasEBoot-core/kern/elf.c; + common = VasEBoot-core/loader/lzss.c; + common = VasEBoot-core/loader/macho.c; + common = VasEBoot-core/loader/macho32.c; + common = VasEBoot-core/loader/macho64.c; + common = VasEBoot-core/kern/emu/hostfs.c; + common = VasEBoot-core/disk/host.c; + common = VasEBoot-core/osdep/init.c; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; + ldadd = libVasEBootmods.a; + ldadd = libVasEBootgcry.a; + ldadd = libVasEBootkern.a; + ldadd = VasEBoot-core/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; diff --git a/NEWS b/NEWS index 2ebd54e78..58740ce2b 100644 --- a/NEWS +++ b/NEWS @@ -21,13 +21,13 @@ New in 2.02: * LVM RAID1 support. * New/improved terminal and video support: - * Monochrome text (matching `hercules' in GRUB Legacy). + * Monochrome text (matching `hercules' in VasEBoot Legacy). * Morse code output using system speaker. * `spkmodem' output (simple data protocol using system speaker). * Handle Japanese special keys. * coreboot framebuffer. * Serial on ARC. - * Native vt100 handling for grub-emu, replacing the use of the curses + * Native vt100 handling for VasEBoot-emu, replacing the use of the curses library. * New gfxmenu options for terminal window positioning, theme background image handling, and scrollbar padding, plus `item_pixmap_style' and @@ -48,7 +48,7 @@ New in 2.02: interface. * Autoload `http' and `tftp' modules if necessary. * Improve TFTP robustness. - * Parse `nd' disk names in GRUB Legacy configuration files. + * Parse `nd' disk names in VasEBoot Legacy configuration files. * Issue separate DNS queries for IPv4 and IPv6. * Support IPv6 Router Advertisement to configure default router. * New variable net__next_server containing next server @@ -71,11 +71,11 @@ New in 2.02: * New command `pcidump' for PCI platforms. * Improve opcode parsing in ACPI halt implementation. * Use the TSC as a possible time source on i386-ieee1275. - * Merge PowerPC grub-mkrescue implementation with the common one. - * Support grub-mkrescue on i386-ieee1275, sparc64, bootinfo machines such + * Merge PowerPC VasEBoot-mkrescue implementation with the common one. + * Support VasEBoot-mkrescue on i386-ieee1275, sparc64, bootinfo machines such as pSeries, and mips-arc. - * Make grub-mkrescue better support Apple Intel Macs on CD. - * Enable GRUB Legacy configuration file parsing on EFI. + * Make VasEBoot-mkrescue better support Apple Intel Macs on CD. + * Enable VasEBoot Legacy configuration file parsing on EFI. * Support halt for Loongson 2E. * ARM U-Boot and EFI ports. * Reorganise platform-dependent code in utilities to avoid #ifdef mess. @@ -84,8 +84,8 @@ New in 2.02: * Fix EFI stack alignment. * ARM64 EFI port. * On Linux, read partition start offsets from sysfs if possible. - * New grub-macbless utility, and better integration with Mac firmware in - grub-install. + * New VasEBoot-macbless utility, and better integration with Mac firmware in + VasEBoot-install. * Support Yeeloong 3A. * Add `cpuid --pae' option to detect Physical Address Extension on x86. * Support for USB debug dongles. @@ -118,36 +118,36 @@ New in 2.02: * Scripting: * New `eval' and `tr' commands. - * grub-script-check fails on scripts containing no commands. + * VasEBoot-script-check fails on scripts containing no commands. * Installation and other utility improvements: * Add option to compress files on installation or image creation. - * Using grub-reboot no longer requires setting `GRUB_DEFAULT=saved'. + * Using VasEBoot-reboot no longer requires setting `VasEBoot_DEFAULT=saved'. * Support probing EFI System Partition (requires os-prober >= 1.58). - * Fix inconsistent use of `GRUB_CRYPTODISK_ENABLE' and - `GRUB_ENABLE_CRYPTODISK'; the latter is now used consistently. - * grub-mount handles symbolic links to directories. - * Support disabling submenus with `GRUB_DISABLE_SUBMENU' configuration key - for grub-mkconfig. - * grub-install, grub-mknetdir, grub-mkrescue, and grub-mkstandalone + * Fix inconsistent use of `VasEBoot_CRYPTODISK_ENABLE' and + `VasEBoot_ENABLE_CRYPTODISK'; the latter is now used consistently. + * VasEBoot-mount handles symbolic links to directories. + * Support disabling submenus with `VasEBoot_DISABLE_SUBMENU' configuration key + for VasEBoot-mkconfig. + * VasEBoot-install, VasEBoot-mknetdir, VasEBoot-mkrescue, and VasEBoot-mkstandalone rewritten in C. They should now work in supported non-Unix-like environments. * Native mingw support. * Ability to install on EFI under windows. * Reorganise timeout handling using new `timeout_style' environment - variable and `GRUB_TIMEOUT_STYLE' configuration key for grub-mkconfig. + variable and `VasEBoot_TIMEOUT_STYLE' configuration key for VasEBoot-mkconfig. Menu hotkeys pressed during a hidden timeout now boot the corresponding menu entry immediately. - * New `file' command and grub-file utility to check file types. + * New `file' command and VasEBoot-file utility to check file types. * New syslinux configuration file parser. * Set menu entry class to primary OS name returned by os-prober to display OS specific icon. - * On Linux x86 detect EFI word size in grub-install and automatically select + * On Linux x86 detect EFI word size in VasEBoot-install and automatically select correct platform (x86_64-efi or i386-efi) to install. Requires Linux kernel 4.0 or higher. * Build system: - * Remove all uses of nested functions; GRUB no longer requires an + * Remove all uses of nested functions; VasEBoot no longer requires an executable stack. * Fix documentation build with Texinfo >= 5.1. * More robust and documented cross-compiling support. @@ -155,7 +155,7 @@ New in 2.02: * Partial mingw64 x86_64-efi compile support (highly experimental). * Partial mingw32 i386-* (other than already present i386-pc) compile support (highly experimental). - * Support for grub-mkpasswd on Windows. + * Support for VasEBoot-mkpasswd on Windows. * Eliminate the use of AutoGen. This allowed some performance improvements to the build system. * Remove variable length arrays. @@ -170,7 +170,7 @@ New in 2.02: system. * emu libusb support removed (was broken and unmaintained). * powerpc64le compile support. - * Use fixed timestamp when generating GRUB image for reproducible builds. + * Use fixed timestamp when generating VasEBoot image for reproducible builds. * Verify at build time that modules contain only supported relocations and their structure matches what boot-time module loader expects. * Do not require fonts on powerpc-ieee1275. @@ -186,12 +186,12 @@ New in 2.00: * New platforms: * Itanium port. - * Fuloong2F support (including GRUB as firmware) - * Fuloong2E support (except GRUB as firmware) + * Fuloong2F support (including VasEBoot as firmware) + * Fuloong2E support (except VasEBoot as firmware) * ARCS (SGI machines) port. * qemu -M mips port. -* grub-mount to mount filesystems using GRUB FS drivers and FUSE. +* VasEBoot-mount to mount filesystems using VasEBoot FS drivers and FUSE. * Changed security default so entries are locked by default if any superuser is defined. @@ -250,8 +250,8 @@ New in 2.00: * Basic illumos and xnu autoconfig. * Testing and debugging: - * New grub-fstest commands: cat, zfsinfo, testload xnu_uuid - * grub-fstest recursive directory compare for quickly checking that + * New VasEBoot-fstest commands: cat, zfsinfo, testload xnu_uuid + * VasEBoot-fstest recursive directory compare for quickly checking that a directory is read correctly. * Backtace on crash (if gdb module is loaded, x86 only) * Disk cache statistics gathering. @@ -269,12 +269,12 @@ New in 2.00: * Internationalisation: * Updated to Unicode 6.0. - * $"..." syntax for translation in grub scripting language. This allows easy - translation of grub.cfg at runtime. + * $"..." syntax for translation in VasEBoot scripting language. This allows easy + translation of VasEBoot.cfg at runtime. * Translations to many languages included in official distribution. * Scripting: - * $grub_cpu and $grub_platform variables for conditioning grub.cfg on platform + * $VasEBoot_cpu and $VasEBoot_platform variables for conditioning VasEBoot.cfg on platform at runtime. * $feature_* variables to condition scripts on available features. * Use of ids to identify menu entries. @@ -282,16 +282,16 @@ New in 2.00: allowing easy loading of all of them. * Installation: - * grub-mknetdir script for easy creation of netbootable GRUB directory. - * Itanium and mips support in grub-mkrescue. - * grub-install support for all platforms except emu. + * VasEBoot-mknetdir script for easy creation of netbootable VasEBoot directory. + * Itanium and mips support in VasEBoot-mkrescue. + * VasEBoot-install support for all platforms except emu. * PreP partition install support. - * No files conflict between flavours (except grub-mkrescue for ppc). This - allows easy install of GRUB for several platforms. - * grub-mkstandalone script for easy creating of image including all modules + * No files conflict between flavours (except VasEBoot-mkrescue for ppc). This + allows easy install of VasEBoot for several platforms. + * VasEBoot-mkstandalone script for easy creating of image including all modules for platforms with generous limit on image size. * program-transform-name now functions according to usual conventions. - Use --grubdir and --bootdir to get old behaviour. + Use --VasEBootdir and --bootdir to get old behaviour. * ADLER32 and CRC64 support (for XZ and hashsum). @@ -299,8 +299,8 @@ New in 2.00: * Experimental support for compiling with Apple toolchain. -* grub-mkdevicemap removed. Now all devices are detected on invocation of - any grub utility. +* VasEBoot-mkdevicemap removed. Now all devices are detected on invocation of + any VasEBoot utility. New in 1.99: @@ -308,7 +308,7 @@ New in 1.99: * New `lsapm' command (i386-pc only). -* Parser for GRUB Legacy configuration files. +* Parser for VasEBoot Legacy configuration files. * Support RAID on virtio devices. @@ -327,7 +327,7 @@ New in 1.99: listed in device.map will be assumed to be readable using only BIOS facilities, rather than anything more complex such as LVM or RAID. -* New bash-completion script for GRUB utilities. +* New bash-completion script for VasEBoot utilities. * Use ACPI to shut down if possible. @@ -335,15 +335,15 @@ New in 1.99: * Btrfs support. -* New `--boot-directory' option to `grub-install', `grub-reboot', and - `grub-set-default', with clearer semantics than the previous +* New `--boot-directory' option to `VasEBoot-install', `VasEBoot-reboot', and + `VasEBoot-set-default', with clearer semantics than the previous `--root-directory' option. * Rename CD-ROM device to "cd" on BIOS platforms. * Transparent decompression filters. -* Simpler PXE image generation. New `grub-mknetdir' utility to generate +* Simpler PXE image generation. New `VasEBoot-mknetdir' utility to generate netboot directory trees. * New relocator. Allows for more kernel support and more @@ -367,18 +367,18 @@ New in 1.99: * MIPS Yeeloong firmware port. -* Change grub-mkdevicemap to emit /dev/disk/by-id/ names where possible +* Change VasEBoot-mkdevicemap to emit /dev/disk/by-id/ names where possible on GNU/Linux. -* Add `grub-mkconfig' support for Xen with Linux. +* Add `VasEBoot-mkconfig' support for Xen with Linux. -* Add `grub-mkconfig' support for initrd images on Fedora 13. +* Add `VasEBoot-mkconfig' support for initrd images on Fedora 13. * Support >3GiB and <16MiB RAM in i386-qemu. * Add support for Cirrus 5446 and Bochs video cards. -* Load more appropriate video drivers automatically in `grub-mkconfig'. +* Load more appropriate video drivers automatically in `VasEBoot-mkconfig'. * USB improvements, including hotplugging/hotunplugging, hub support, and USB serial support. @@ -395,12 +395,12 @@ New in 1.99: * Add support for DM-RAID disk devices on GNU/Linux. -* Remove `grub-mkisofs'. `grub-mkrescue' now uses GNU xorriso to build +* Remove `VasEBoot-mkisofs'. `VasEBoot-mkrescue' now uses GNU xorriso to build CD images. -* `grub-mkrescue' support for EFI, coreboot, and QEMU platforms. +* `VasEBoot-mkrescue' support for EFI, coreboot, and QEMU platforms. -* Unify `grub-mkimage', `grub-setup', and `grub-install' source code +* Unify `VasEBoot-mkimage', `VasEBoot-setup', and `VasEBoot-install' source code across platforms. * Fix VGA (as opposed to VBE) video driver, formerly a terminal driver. @@ -409,11 +409,11 @@ New in 1.99: * Add support for the nilfs2 filesystem. -* `grub-probe' and `grub-mkconfig' support for NetBSD. +* `VasEBoot-probe' and `VasEBoot-mkconfig' support for NetBSD. -* Support setting a background image in `grub-mkconfig'. +* Support setting a background image in `VasEBoot-mkconfig'. -* Support multiple terminals in `grub-mkconfig'. +* Support multiple terminals in `VasEBoot-mkconfig'. * Regexp support. @@ -423,17 +423,17 @@ New in 1.99: * sunpc partition table support. -* Add a number of new language features to GRUB script: `for', `while', +* Add a number of new language features to VasEBoot script: `for', `while', `until', `elif', function parameters, `break', `continue', `shift', multi-line quoted strings, positional parameters with `setparams', `return', filename wildcard expansion, and `!'. -* Support nested partition tables. GRUB now prefers to name partitions +* Support nested partition tables. VasEBoot now prefers to name partitions in the form `(hd0,msdos1,bsd1)' rather than `(hd0,1,a)'. * Speed up consecutive hostdisk operations on the same device. -* Compile parts of `grub-emu' as modules. +* Compile parts of `VasEBoot-emu' as modules. New in 1.98 - 2010-03-06: @@ -443,18 +443,18 @@ New in 1.98 - 2010-03-06: * MIPS support. -* Saved default menu entry support, with new utilities `grub-reboot' and - `grub-set-default'. +* Saved default menu entry support, with new utilities `VasEBoot-reboot' and + `VasEBoot-set-default'. * Unit testing framework. * Support for multiple terminals. -* Encrypted password support, with a new utility `grub-mkpasswd-pbkdf2'. +* Encrypted password support, with a new utility `VasEBoot-mkpasswd-pbkdf2'. -* `grub-mkfloppy' removed; use `grub-mkrescue' to create floppy images. +* `VasEBoot-mkfloppy' removed; use `VasEBoot-mkrescue' to create floppy images. -* Add grub-probe support for GNU/Hurd. +* Add VasEBoot-probe support for GNU/Hurd. * Add support for gettext. @@ -482,7 +482,7 @@ New in 1.97: * Add support for RAID levels 4,6 and 10. -* update-grub is replaced by grub-mkconfig. +* update-VasEBoot is replaced by VasEBoot-mkconfig. * When booting from PXE, PXE can be used to load files. @@ -510,7 +510,7 @@ New in 1.97: * Create partmap.lst and use it to automatically load partition map modules. -* grub-mkconfig supports os-prober to add operating systems to the +* VasEBoot-mkconfig supports os-prober to add operating systems to the boot menu. * The ATA driver supports devices bigger than 2 TiB. @@ -525,26 +525,26 @@ New in 1.97: * Support for direct access to AT keyboards. -* New utility `grub-fstest'. +* New utility `VasEBoot-fstest'. New in 1.96 - 2008-02-03: * The license term is changed to GNU General Public License Version 3. -* grub-emu is made optional. Now you have to use - `--enable-grub-emu' to enable it. +* VasEBoot-emu is made optional. Now you have to use + `--enable-VasEBoot-emu' to enable it. * Add Multiboot2 support. -* grub-emu can access the host filesystem now. +* VasEBoot-emu can access the host filesystem now. * Add support for the NTFS, cpio/tar and Reiserfs filesystems. * Add support for ATA/ATAPI. -* Add update-grub script to generate grub.cfg. +* Add update-VasEBoot script to generate VasEBoot.cfg. -* Add grub-mkrescue script to generate floppy or ElTorito images +* Add VasEBoot-mkrescue script to generate floppy or ElTorito images (i386-pc only). * Add support for background images in gfxterm (background_image command). @@ -553,7 +553,7 @@ New in 1.96 - 2008-02-03: * GPT is now enabled in i386-pc target. -* Add grub-install for EFI. +* Add VasEBoot-install for EFI. * Ported to the following new platforms: Efika, coreboot (a.k.a. LinuxBIOS), OLPC XO. @@ -568,8 +568,8 @@ New in 1.95 - 2006-10-15: * Number partitions from 1 instead of 0. For instance, the first partition of "hd0" is now "hd0,1" but not "hd0,0". -* grub-probefs is renamed to grub-probe, and supports printing a - guessed OS device name and a GRUB drive name. +* VasEBoot-probefs is renamed to VasEBoot-probe, and supports printing a + guessed OS device name and a VasEBoot drive name. * RAID and LVM support is added. @@ -591,9 +591,9 @@ New in 1.94 - 2006-06-04: * Use --with-platform to specify a boot environment. For now, efi, ieee1275 and pc are supported. -* Use the filename "kernel.elf" instead of "grubof" on ieee1275. +* Use the filename "kernel.elf" instead of "VasEBootof" on ieee1275. -* Install GRUB into pkglibdir instead of pkgdatadir. +* Install VasEBoot into pkglibdir instead of pkgdatadir. * Support environmental variables. You can export variables by the command "export". @@ -646,17 +646,17 @@ New in 1.91 - 2005-10-15: * Add support for x86_64. -* GRUB itself is a Multiboot-compliant kernel. +* VasEBoot itself is a Multiboot-compliant kernel. * Add new filesystems: XFS, SFS, and AFFS. New in 1.90 - 2005-08-07: -* Rename the project name PUPA to GRUB. Now this version is the - developmental version of GRUB officially. +* Rename the project name PUPA to VasEBoot. Now this version is the + developmental version of VasEBoot officially. -* The GRUB emulator ``grub-emu'' is added. +* The VasEBoot emulator ``VasEBoot-emu'' is added. * Add support for newworld Mac. This should work with other PowerPC-based machines as well, if they use IEEE 1275 diff --git a/README b/README index 685b01657..60e66b81b 100644 --- a/README +++ b/README @@ -1,20 +1,20 @@ -This is GRUB 2, the second version of the GRand Unified Bootloader. -GRUB 2 is rewritten from scratch to make GNU GRUB cleaner, safer, more +This is VasEBoot 2, the second version of the GRand Unified Bootloader. +VasEBoot 2 is rewritten from scratch to make GNU VasEBoot cleaner, safer, more robust, more powerful, and more portable. -See the file NEWS for a description of recent changes to GRUB 2. +See the file NEWS for a description of recent changes to VasEBoot 2. See the file INSTALL for instructions on how to build and install the -GRUB 2 data and program files. +VasEBoot 2 data and program files. -Please visit the official web page of GRUB 2, for more information. -The URL is . +Please visit the official web page of VasEBoot 2, for more information. +The URL is . More extensive documentation is available in the Info manual, -accessible using 'info grub' after building and installing GRUB 2. +accessible using 'info VasEBoot' after building and installing VasEBoot 2. There are a number of important user-visible differences from the -first version of GRUB, now known as GRUB Legacy. For a summary, please +first version of VasEBoot, now known as VasEBoot Legacy. For a summary, please see: - info grub Introduction 'Changes from GRUB Legacy' + info VasEBoot Introduction 'Changes from VasEBoot Legacy' diff --git a/THANKS b/THANKS index 82b4bc838..6b7040944 100644 --- a/THANKS +++ b/THANKS @@ -1,10 +1,10 @@ -GRUB 2 would not be what it is today without the invaluable help of +VasEBoot 2 would not be what it is today without the invaluable help of everybody who was kind enough to spend time testing it and reporting bugs. The following people made especially gracious contributions of their time and energy in helping to track down bugs, add new features, and -generally assist in the GRUB 2 maintainership process: +generally assist in the VasEBoot 2 maintainership process: Andrey Shuvikov Bibo Mao diff --git a/TODO b/TODO index a9b6d3523..66ea3a09c 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ -Before working on improving GRUB, it's very important that you -make contact with the core GRUB developers. Things herein might be +Before working on improving VasEBoot, it's very important that you +make contact with the core VasEBoot developers. Things herein might be slightly out of date or otherwise not easy to understand at first -glance. So write to first. +glance. So write to first. For bug tracking, refer to: - http://savannah.gnu.org/bugs/?group=grub + http://savannah.gnu.org/bugs/?group=VasEBoot diff --git a/VasEBoot-core/Makefile.am b/VasEBoot-core/Makefile.am index 23ce9e9fb..420c5033f 100644 --- a/VasEBoot-core/Makefile.am +++ b/VasEBoot-core/Makefile.am @@ -10,7 +10,7 @@ CCAS=$(TARGET_CC) RANLIB=$(TARGET_RANLIB) STRIP=$(TARGET_STRIP) -MACHO2IMG=$(top_builddir)/grub-macho2img +MACHO2IMG=$(top_builddir)/VasEBoot-macho2img AM_CFLAGS = $(TARGET_CFLAGS) AM_LDFLAGS = $(TARGET_LDFLAGS) @@ -26,22 +26,22 @@ CFLAGS_LIBRARY += $(CFLAGS_PLATFORM) -fno-builtin CPPFLAGS_LIBRARY += $(CPPFLAGS_PLATFORM) CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM) -build-grub-pep2elf$(BUILD_EXEEXT): $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_TARGET_WORDSIZE=64 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pep2elf\" $^ -CLEANFILES += build-grub-pep2elf$(BUILD_EXEEXT) +build-VasEBoot-pep2elf$(BUILD_EXEEXT): $(top_srcdir)/util/VasEBoot-pe2elf.c $(top_srcdir)/VasEBoot-core/kern/emu/misc.c $(top_srcdir)/util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DVasEBoot_BUILD=1 -DVasEBoot_TARGET_WORDSIZE=64 -DVasEBoot_UTIL=1 -DVasEBoot_BUILD_PROGRAM_NAME=\"build-VasEBoot-pep2elf\" $^ +CLEANFILES += build-VasEBoot-pep2elf$(BUILD_EXEEXT) -build-grub-pe2elf$(BUILD_EXEEXT): $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_TARGET_WORDSIZE=32 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pe2elf\" $^ -CLEANFILES += build-grub-pe2elf$(BUILD_EXEEXT) +build-VasEBoot-pe2elf$(BUILD_EXEEXT): $(top_srcdir)/util/VasEBoot-pe2elf.c $(top_srcdir)/VasEBoot-core/kern/emu/misc.c $(top_srcdir)/util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DVasEBoot_BUILD=1 -DVasEBoot_TARGET_WORDSIZE=32 -DVasEBoot_UTIL=1 -DVasEBoot_BUILD_PROGRAM_NAME=\"build-VasEBoot-pe2elf\" $^ +CLEANFILES += build-VasEBoot-pe2elf$(BUILD_EXEEXT) # gentrigtables gentrigtables$(BUILD_EXEEXT): gentrigtables.c $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $< $(BUILD_LIBM) CLEANFILES += gentrigtables$(BUILD_EXEEXT) -build-grub-module-verifier$(BUILD_EXEEXT): $(top_srcdir)/util/grub-module-verifier.c $(top_srcdir)/util/grub-module-verifier32.c $(top_srcdir)/util/grub-module-verifier64.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-module-verifier\" $^ -CLEANFILES += build-grub-module-verifier$(BUILD_EXEEXT) +build-VasEBoot-module-verifier$(BUILD_EXEEXT): $(top_srcdir)/util/VasEBoot-module-verifier.c $(top_srcdir)/util/VasEBoot-module-verifier32.c $(top_srcdir)/util/VasEBoot-module-verifier64.c $(top_srcdir)/VasEBoot-core/kern/emu/misc.c $(top_srcdir)/util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DVasEBoot_BUILD=1 -DVasEBoot_UTIL=1 -DVasEBoot_BUILD_PROGRAM_NAME=\"build-VasEBoot-module-verifier\" $^ +CLEANFILES += build-VasEBoot-module-verifier$(BUILD_EXEEXT) # trigtables.c trigtables.c: gentrigtables$(BUILD_EXEEXT) gentrigtables.c $(top_srcdir)/configure.ac @@ -49,223 +49,223 @@ trigtables.c: gentrigtables$(BUILD_EXEEXT) gentrigtables.c $(top_srcdir)/configu CLEANFILES += trigtables.c # XXX Use Automake's LEX & YACC support -grub_script.tab.h: script/parser.y - $(YACC) -d -p grub_script_yy -b grub_script $< -grub_script.tab.c: grub_script.tab.h -CLEANFILES += grub_script.tab.c grub_script.tab.h +VasEBoot_script.tab.h: script/parser.y + $(YACC) -d -p VasEBoot_script_yy -b VasEBoot_script $< +VasEBoot_script.tab.c: VasEBoot_script.tab.h +CLEANFILES += VasEBoot_script.tab.c VasEBoot_script.tab.h # For the lexer. -grub_script.yy.h: script/yylex.l - $(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $< -grub_script.yy.c: grub_script.yy.h +VasEBoot_script.yy.h: script/yylex.l + $(LEX) -o VasEBoot_script.yy.c --header-file=VasEBoot_script.yy.h $< +VasEBoot_script.yy.c: VasEBoot_script.yy.h rs_decoder.h: $(srcdir)/lib/reed_solomon.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Os -I$(top_builddir) -S -DSTANDALONE -o $@ $< -g0 -mregparm=3 -ffreestanding -CLEANFILES += grub_script.yy.c grub_script.yy.h +CLEANFILES += VasEBoot_script.yy.c VasEBoot_script.yy.h include $(srcdir)/Makefile.core.am -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cache.h -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/env.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/file.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fs.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i18n.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/kernel.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/list.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/misc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/cache.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/command.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/device.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/dl.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/env.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/env_private.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/err.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/file.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/fs.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i18n.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/kernel.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/list.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/misc.h if COND_emu -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/compiler-rt-emu.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/compiler-rt-emu.h else -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/compiler-rt.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/compiler-rt.h endif -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/parser.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/partition.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/term.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/tpm.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/mm.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/parser.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/partition.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/term.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/time.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/mm_private.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/net.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/tpm.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/memory.h if COND_i386_pc -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pxe.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/int.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/kernel.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/pxe.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/int.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h endif if COND_i386_efi -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/efi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/pmtimer.h 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/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/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/coreboot/lbio.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/video.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/video_fb.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/gfxterm.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/font.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/bufio.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h endif if COND_i386_multiboot -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h endif if COND_i386_qemu -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h endif if COND_i386_ieee1275 -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/ieee1275/ieee1275.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h endif if COND_i386_xen -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/xen/hypercall.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/xen.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/xen/hypercall.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/loader.h endif if COND_x86_64_xen -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/x86_64/xen/hypercall.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/xen.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/x86_64/xen/hypercall.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/loader.h endif if COND_x86_64_efi -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/efi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/tsc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/i386/pmtimer.h endif if COND_ia64_efi -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/efi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h endif if COND_mips -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/kernel.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/cpu/kernel.h endif if COND_mips_arc -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arc/arc.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/arc/arc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h endif if COND_mips_qemu_mips -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/keyboard_layouts.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/kernel.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/serial.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/loader.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h endif if COND_mips_loongson -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/time.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/pci.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cs5536.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pci.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/keyboard_layouts.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/kernel.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/time.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/video.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/video_fb.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/gfxterm.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/font.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/bufio.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/cs5536.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/serial.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/loader.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h endif if COND_mips_qemu_mips -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h -KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/memory.h +KERNEL_HEADER_FILES += $(top_builddir)/include/VasEBoot/machine/kernel.h endif if COND_powerpc_ieee1275 -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/ieee1275/ieee1275.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h endif if COND_sparc64_ieee1275 -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sparc64/ieee1275/ieee1275.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/ieee1275/ieee1275.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/sparc64/ieee1275/ieee1275.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/terminfo.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h endif if COND_arm_uboot -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/uboot.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/disk.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/uboot/uboot.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/uboot/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/lib/arg.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/arm/system.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 -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/arm/efi/loader.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/efi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/arm/system.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h endif if COND_arm64_efi -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/efi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/efi/disk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/acpi.h endif if COND_emu -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/datetime.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/misc.h -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/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 -if COND_GRUB_EMU_SDL -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/datetime.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/emu/misc.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/emu/net.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/emu/hostdisk.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/emu/hostfile.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/extcmd.h +if COND_VasEBoot_EMU_SDL +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/sdl.h endif -if COND_GRUB_EMU_PCI -KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libpciaccess.h +if COND_VasEBoot_EMU_PCI +KERNEL_HEADER_FILES += $(top_srcdir)/include/VasEBoot/libpciaccess.h endif endif @@ -278,7 +278,7 @@ CLEANFILES += symlist.h BUILT_SOURCES += symlist.h symlist.c: symlist.h gensymlist.sh - $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) -DGRUB_SYMBOL_GENERATOR=1 symlist.h > symlist.p || (rm -f symlist.p; exit 1) + $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) -DVasEBoot_SYMBOL_GENERATOR=1 symlist.h > symlist.p || (rm -f symlist.p; exit 1) cat symlist.p | /bin/sh $(srcdir)/gensymlist.sh $(top_builddir)/config.h $(KERNEL_HEADER_FILES) >$@ || (rm -f $@; exit 1) rm -f symlist.p CLEANFILES += symlist.c @@ -293,7 +293,7 @@ endif noinst_DATA += kernel_syms.lst kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h - $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input + $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DVasEBoot_SYMBOL_GENERATOR=1 $^ >kernel_syms.input cat kernel_syms.input | grep -v '^#' | sed -n \ -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined kernel '"$(ASM_PREFIX)"'\1/;p;}' \ -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined kernel '"$(ASM_PREFIX)"'\1/;p;}' \ @@ -302,18 +302,18 @@ kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h CLEANFILES += kernel_syms.lst if COND_emu -kern/emu/grub_emu-main.$(OBJEXT):grub_emu_init.h -grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h -kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h -grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h +kern/emu/VasEBoot_emu-main.$(OBJEXT):VasEBoot_emu_init.h +VasEBoot_emu-VasEBoot_emu_init.$(OBJEXT):VasEBoot_emu_init.h +kern/emu/VasEBoot_emu_dyn-main.$(OBJEXT):VasEBoot_emu_init.h +VasEBoot_emu_dyn-VasEBoot_emu_init.$(OBJEXT):VasEBoot_emu_init.h -grub_emu_init.h: genemuinitheader.sh $(MODULE_FILES) +VasEBoot_emu_init.h: genemuinitheader.sh $(MODULE_FILES) rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@ -CLEANFILES += grub_emu_init.h +CLEANFILES += VasEBoot_emu_init.h -grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MODULE_FILES) +VasEBoot_emu_init.c: VasEBoot_emu_init.h genemuinit.sh $(MODULE_FILES) rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@ -CLEANFILES += grub_emu_init.c +CLEANFILES += VasEBoot_emu_init.c endif # List files @@ -379,7 +379,7 @@ platform_DATA += video.lst CLEANFILES += video.lst # but, crypto.lst is simply copied -crypto.lst: $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst +crypto.lst: $(srcdir)/lib/libgcrypt-VasEBoot/cipher/crypto.lst cp $^ $@ platform_DATA += crypto.lst CLEANFILES += crypto.lst @@ -397,7 +397,7 @@ moddep.lst: syminfo.lst genmoddep.awk video.lst platform_DATA += moddep.lst CLEANFILES += config.log syminfo.lst moddep.lst -$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier$(BUILD_EXEEXT) +$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-VasEBoot-module-verifier$(BUILD_EXEEXT) TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ platform_DATA += $(MOD_FILES) platform_DATA += modinfo.sh diff --git a/VasEBoot-core/Makefile.core.def b/VasEBoot-core/Makefile.core.def index 80b3bceae..4d37ac408 100644 --- a/VasEBoot-core/Makefile.core.def +++ b/VasEBoot-core/Makefile.core.def @@ -26,14 +26,14 @@ transform_data = { transform_data = { installdir = platform; - name = gdb_grub; - common = gdb_grub.in; + name = gdb_VasEBoot; + common = gdb_VasEBoot.in; }; transform_data = { installdir = platform; - name = grub.chrp; - common = boot/powerpc/grub.chrp.in; + name = VasEBoot.chrp; + common = boot/powerpc/VasEBoot.chrp.in; enable = powerpc_ieee1275; }; @@ -86,8 +86,8 @@ kernel = { mips_arc_ldflags = '-Wl,-Ttext,$(TARGET_LINK_ADDR)'; mips_qemu_mips_ldflags = '-Wl,-Ttext,0x80200000'; - mips_arc_cppflags = '-DGRUB_DECOMPRESSOR_LINK_ADDR=$(TARGET_DECOMPRESSOR_LINK_ADDR)'; - i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)'; + mips_arc_cppflags = '-DVasEBoot_DECOMPRESSOR_LINK_ADDR=$(TARGET_DECOMPRESSOR_LINK_ADDR)'; + i386_qemu_cppflags = '-DVasEBoot_BOOT_MACHINE_LINK_ADDR=$(VasEBoot_BOOT_MACHINE_LINK_ADDR)'; emu_cflags = '$(CFLAGS_GNULIB)'; emu_cppflags = '$(CPPFLAGS_GNULIB)'; arm_uboot_ldflags = '-Wl,-r,-d'; @@ -334,11 +334,11 @@ kernel = { }; program = { - name = grub-emu; + name = VasEBoot-emu; mansection = 1; emu = kern/emu/full.c; - emu_nodist = grub_emu_init.c; + emu_nodist = VasEBoot_emu_init.c; ldadd = 'kernel.exec$(EXEEXT)'; ldadd = '$(MODULE_FILES)'; @@ -348,7 +348,7 @@ program = { }; program = { - name = grub-emu-lite; + name = VasEBoot-emu-lite; emu = kern/emu/lite.c; emu_nodist = symlist.c; @@ -369,8 +369,8 @@ image = { i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00'; i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)'; - i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_BOOT_MACHINE_LINK_ADDR)'; - i386_qemu_ccasflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)'; + i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(VasEBoot_BOOT_MACHINE_LINK_ADDR)'; + i386_qemu_ccasflags = '-DVasEBoot_BOOT_MACHINE_LINK_ADDR=$(VasEBoot_BOOT_MACHINE_LINK_ADDR)'; sparc64_ieee1275_objcopyflags = '-O a.out-sunos-big'; sparc64_ieee1275_ldflags = ' -Wl,-Ttext=0x4000'; @@ -460,7 +460,7 @@ image = { common = lib/xzembed/xz_dec_stream.c; common = kern/compiler-rt.c; - cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1'; + cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DVasEBoot_EMBED_DECOMPRESSOR=1'; objcopyflags = '-O binary'; mips_ldflags = '-Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)'; @@ -473,7 +473,7 @@ image = { mips = boot/mips/startup_raw.S; common = boot/decompressor/none.c; - cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1'; + cppflags = '-DVasEBoot_EMBED_DECOMPRESSOR=1'; objcopyflags = '-O binary'; mips_ldflags = '-Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)'; @@ -606,7 +606,7 @@ module = { common = commands/lspci.c; enable = emu; - condition = COND_GRUB_EMU_PCI; + condition = COND_VasEBoot_EMU_PCI; }; module = { @@ -1557,7 +1557,7 @@ module = { name = crypto; common = lib/crypto.c; - extra_dist = lib/libgcrypt-grub/cipher/crypto.lst; + extra_dist = lib/libgcrypt-VasEBoot/cipher/crypto.lst; }; module = { @@ -1688,7 +1688,7 @@ module = { module = { name = multiboot2; - cppflags = "-DGRUB_USE_MULTIBOOT2"; + cppflags = "-DVasEBoot_USE_MULTIBOOT2"; common = loader/multiboot.c; common = lib/cmdline.c; @@ -1856,10 +1856,10 @@ module = { common = commands/menuentry.c; common = unidata.c; - common_nodist = grub_script.tab.c; - common_nodist = grub_script.yy.c; - common_nodist = grub_script.tab.h; - common_nodist = grub_script.yy.h; + common_nodist = VasEBoot_script.tab.c; + common_nodist = VasEBoot_script.yy.c; + common_nodist = VasEBoot_script.tab.h; + common_nodist = VasEBoot_script.yy.h; extra_dist = script/yylex.l; extra_dist = script/parser.y; @@ -2184,7 +2184,7 @@ module = { name = sdl; emu = video/emu/sdl.c; enable = emu; - condition = COND_GRUB_EMU_SDL; + condition = COND_VasEBoot_EMU_SDL; }; module = { @@ -2348,28 +2348,28 @@ module = { module = { name = mpi; - common = lib/libgcrypt-grub/mpi/mpiutil.c; - common = lib/libgcrypt-grub/mpi/mpi-bit.c; - common = lib/libgcrypt-grub/mpi/mpi-add.c; - common = lib/libgcrypt-grub/mpi/mpi-mul.c; - common = lib/libgcrypt-grub/mpi/mpi-mod.c; - common = lib/libgcrypt-grub/mpi/mpi-gcd.c; - common = lib/libgcrypt-grub/mpi/mpi-div.c; - common = lib/libgcrypt-grub/mpi/mpi-cmp.c; - common = lib/libgcrypt-grub/mpi/mpi-inv.c; - common = lib/libgcrypt-grub/mpi/mpi-pow.c; - common = lib/libgcrypt-grub/mpi/mpi-mpow.c; - common = lib/libgcrypt-grub/mpi/mpih-lshift.c; - common = lib/libgcrypt-grub/mpi/mpih-mul.c; - common = lib/libgcrypt-grub/mpi/mpih-mul1.c; - common = lib/libgcrypt-grub/mpi/mpih-mul2.c; - common = lib/libgcrypt-grub/mpi/mpih-mul3.c; - common = lib/libgcrypt-grub/mpi/mpih-add1.c; - common = lib/libgcrypt-grub/mpi/mpih-sub1.c; - common = lib/libgcrypt-grub/mpi/mpih-div.c; - common = lib/libgcrypt-grub/mpi/mpicoder.c; - common = lib/libgcrypt-grub/mpi/mpih-rshift.c; - common = lib/libgcrypt-grub/mpi/mpi-inline.c; + common = lib/libgcrypt-VasEBoot/mpi/mpiutil.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-bit.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-add.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-mul.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-mod.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-gcd.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-div.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-cmp.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-inv.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-pow.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-mpow.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-lshift.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-mul.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-mul1.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-mul2.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-mul3.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-add1.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-sub1.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-div.c; + common = lib/libgcrypt-VasEBoot/mpi/mpicoder.c; + common = lib/libgcrypt-VasEBoot/mpi/mpih-rshift.c; + common = lib/libgcrypt-VasEBoot/mpi/mpi-inline.c; common = lib/libgcrypt_wrap/mem.c; cflags = '$(CFLAGS_GCRY) -Wno-redundant-decls -Wno-sign-compare'; diff --git a/VasEBoot-core/boot/decompressor/minilib.c b/VasEBoot-core/boot/decompressor/minilib.c index fc46ee07b..48a6143b1 100644 --- a/VasEBoot-core/boot/decompressor/minilib.c +++ b/VasEBoot-core/boot/decompressor/minilib.c @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include void * -grub_memset (void *s, int c, grub_size_t len) +VasEBoot_memset (void *s, int c, VasEBoot_size_t len) { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; for (ptr = s; len; ptr++, len--) *ptr = c; return s; } void * -grub_memmove (void *dest, const void *src, grub_size_t n) +VasEBoot_memmove (void *dest, const void *src, VasEBoot_size_t n) { char *d = (char *) dest; const char *s = (const char *) src; @@ -51,7 +51,7 @@ grub_memmove (void *dest, const void *src, grub_size_t n) } int -grub_memcmp (const void *s1, const void *s2, grub_size_t n) +VasEBoot_memcmp (const void *s1, const void *s2, VasEBoot_size_t n) { const unsigned char *t1 = s1; const unsigned char *t2 = s2; @@ -68,7 +68,7 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n) return 0; } -void *grub_decompressor_scratch; +void *VasEBoot_decompressor_scratch; void find_scratch (void *src, void *dst, unsigned long srcsize, @@ -76,18 +76,18 @@ find_scratch (void *src, void *dst, unsigned long srcsize, { #ifdef _mips /* Decoding from ROM. */ - if (((grub_addr_t) src & 0x10000000)) + if (((VasEBoot_addr_t) src & 0x10000000)) { - grub_decompressor_scratch = (void *) ALIGN_UP((grub_addr_t) dst + dstsize, + VasEBoot_decompressor_scratch = (void *) ALIGN_UP((VasEBoot_addr_t) dst + dstsize, 256); return; } #endif if ((char *) src + srcsize > (char *) dst + dstsize) - grub_decompressor_scratch = (void *) ALIGN_UP ((grub_addr_t) src + srcsize, + VasEBoot_decompressor_scratch = (void *) ALIGN_UP ((VasEBoot_addr_t) src + srcsize, 256); else - grub_decompressor_scratch = (void *) ALIGN_UP ((grub_addr_t) dst + dstsize, + VasEBoot_decompressor_scratch = (void *) ALIGN_UP ((VasEBoot_addr_t) dst + dstsize, 256); return; } diff --git a/VasEBoot-core/boot/decompressor/none.c b/VasEBoot-core/boot/decompressor/none.c index 911e861e3..c8b7293d9 100644 --- a/VasEBoot-core/boot/decompressor/none.c +++ b/VasEBoot-core/boot/decompressor/none.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include void -grub_decompress_core (void *src, void *dest, unsigned long n, +VasEBoot_decompress_core (void *src, void *dest, unsigned long n, unsigned long dstsize __attribute__ ((unused))) { char *d = (char *) dest; diff --git a/VasEBoot-core/boot/decompressor/xz.c b/VasEBoot-core/boot/decompressor/xz.c index 2279118e1..379d9dd53 100644 --- a/VasEBoot-core/boot/decompressor/xz.c +++ b/VasEBoot-core/boot/decompressor/xz.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #include "xz.h" #include "xz_stream.h" void -grub_decompress_core (void *src, void *dst, unsigned long srcsize, +VasEBoot_decompress_core (void *src, void *dst, unsigned long srcsize, unsigned long dstsize) { struct xz_dec *dec; @@ -32,7 +32,7 @@ grub_decompress_core (void *src, void *dst, unsigned long srcsize, find_scratch (src, dst, srcsize, dstsize); - dec = xz_dec_init (GRUB_DECOMPRESSOR_DICT_SIZE); + dec = xz_dec_init (VasEBoot_DECOMPRESSOR_DICT_SIZE); buf.in = src; buf.in_pos = 0; diff --git a/VasEBoot-core/boot/i386/pc/boot.S b/VasEBoot-core/boot/i386/pc/boot.S index 47a461ed5..cc63d4eb8 100644 --- a/VasEBoot-core/boot/i386/pc/boot.S +++ b/VasEBoot-core/boot/i386/pc/boot.S @@ -1,24 +1,24 @@ /* -*-Asm-*- */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include /* * defines for the code go here @@ -72,7 +72,7 @@ fd_probe_error_string: .asciz "Floppy" 1: /* perform read */ - movw MACRO_DOLLAR(GRUB_BOOT_MACHINE_BUFFER_SEG), %bx + movw MACRO_DOLLAR(VasEBoot_BOOT_MACHINE_BUFFER_SEG), %bx movw %bx, %es xorw %bx, %bx movw MACRO_DOLLAR(0x201), %ax @@ -169,7 +169,7 @@ start: * this area. */ - .org GRUB_BOOT_MACHINE_BPB_START + .org VasEBoot_BOOT_MACHINE_BPB_START .org 4 #endif #ifdef HYBRID_BOOT @@ -178,23 +178,23 @@ start: scratch #endif - .org GRUB_BOOT_MACHINE_BPB_END + .org VasEBoot_BOOT_MACHINE_BPB_END /* * End of BIOS parameter block. */ LOCAL(kernel_address): - .word GRUB_BOOT_MACHINE_KERNEL_ADDR + .word VasEBoot_BOOT_MACHINE_KERNEL_ADDR #ifndef HYBRID_BOOT - .org GRUB_BOOT_MACHINE_KERNEL_SECTOR + .org VasEBoot_BOOT_MACHINE_KERNEL_SECTOR LOCAL(kernel_sector): .long 1 LOCAL(kernel_sector_high): .long 0 #endif - .org GRUB_BOOT_MACHINE_BOOT_DRIVE + .org VasEBoot_BOOT_MACHINE_BOOT_DRIVE boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ @@ -206,15 +206,15 @@ LOCAL(after_BPB): /* * This is a workaround for buggy BIOSes which don't pass boot - * drive correctly. If GRUB is installed into a HDD, check if + * drive correctly. If VasEBoot is installed into a HDD, check if * DL is masked correctly. If not, assume that the BIOS passed * a bogus value and set DL to 0x80, since this is the only - * possible boot drive. If GRUB is installed into a floppy, + * possible boot drive. If VasEBoot is installed into a floppy, * this does nothing (only jump). */ - .org GRUB_BOOT_MACHINE_DRIVE_CHECK + .org VasEBoot_BOOT_MACHINE_DRIVE_CHECK boot_drive_check: - jmp 3f /* grub-setup may overwrite this jump */ + jmp 3f /* VasEBoot-setup may overwrite this jump */ testb $0x80, %dl jz 2f 3: @@ -238,7 +238,7 @@ real_start: movw %ax, %ss /* set up the REAL stack */ - movw $GRUB_BOOT_MACHINE_STACK_SEG, %sp + movw $VasEBoot_BOOT_MACHINE_STACK_SEG, %sp sti /* we're safe again */ @@ -302,7 +302,7 @@ LOCAL(lba_mode): movl %ebx, 12(%si) /* the segment of buffer address */ - movw $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si) + movw $VasEBoot_BOOT_MACHINE_BUFFER_SEG, 6(%si) /* * BIOS call "INT 0x13 Function 0x42" to read sectors from disk into memory @@ -319,7 +319,7 @@ LOCAL(lba_mode): /* LBA read is not supported, so fallback to CHS. */ jc LOCAL(chs_mode) - movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx + movw $VasEBoot_BOOT_MACHINE_BUFFER_SEG, %bx jmp LOCAL(copy_buffer) LOCAL(chs_mode): @@ -427,7 +427,7 @@ setup_sectors: * %al = 0x0 on success; err code on failure */ - movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx + movw $VasEBoot_BOOT_MACHINE_BUFFER_SEG, %bx movw %bx, %es /* load %es segment with disk buffer */ xorw %bx, %bx /* %bx = 0, put it at 0 in the segment */ @@ -449,7 +449,7 @@ LOCAL(copy_buffer): movw $0x100, %cx movw %bx, %ds xorw %si, %si - movw $GRUB_BOOT_MACHINE_KERNEL_ADDR, %di + movw $VasEBoot_BOOT_MACHINE_KERNEL_ADDR, %di movw %si, %es cld @@ -469,7 +469,7 @@ LOCAL(copy_buffer): jnz boot /* No TPM or TPM deactivated */ movw $0xBB07, %ax /* TCG_CompactHashLogExtendEvent */ - movw $GRUB_BOOT_MACHINE_KERNEL_ADDR, %di + movw $VasEBoot_BOOT_MACHINE_KERNEL_ADDR, %di xorl %esi, %esi movl $0x41504354, %ebx /* TCPA */ movl $0x200, %ecx /* Measure 512 bytes */ @@ -506,7 +506,7 @@ LOCAL(general_error): LOCAL(stop): jmp LOCAL(stop) -notification_string: .asciz "GRUB " +notification_string: .asciz "VasEBoot " geometry_error_string: .asciz "Geom" hd_probe_error_string: .asciz "Hard Disk" read_error_string: .asciz "Read" @@ -545,7 +545,7 @@ LOCAL(kernel_sector): LOCAL(kernel_sector_high): .long 0 #endif - .org GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC + .org VasEBoot_BOOT_MACHINE_WINDOWS_NT_MAGIC nt_magic: .long 0 .word 0 @@ -556,7 +556,7 @@ nt_magic: * sneaky, huh? */ - .org GRUB_BOOT_MACHINE_PART_START + .org VasEBoot_BOOT_MACHINE_PART_START #ifndef HYBRID_BOOT floppy @@ -564,7 +564,7 @@ nt_magic: scratch #endif - .org GRUB_BOOT_MACHINE_PART_END + .org VasEBoot_BOOT_MACHINE_PART_END /* the last 2 bytes in the sector 0 contain the signature */ - .word GRUB_BOOT_MACHINE_SIGNATURE + .word VasEBoot_BOOT_MACHINE_SIGNATURE diff --git a/VasEBoot-core/boot/i386/pc/cdboot.S b/VasEBoot-core/boot/i386/pc/cdboot.S index de4f80929..1c7b1ce44 100644 --- a/VasEBoot-core/boot/i386/pc/cdboot.S +++ b/VasEBoot-core/boot/i386/pc/cdboot.S @@ -1,31 +1,31 @@ /* -*-Asm-*- */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #include .file "cdboot.S" #define CODE_ADDR 0x6000 -#define DATA_ADDR ((GRUB_BOOT_MACHINE_KERNEL_ADDR) + 0x200) +#define DATA_ADDR ((VasEBoot_BOOT_MACHINE_KERNEL_ADDR) + 0x200) #define CDSEC_SHIFT 11 #define CDBLK_LENG 16 diff --git a/VasEBoot-core/boot/i386/pc/diskboot.S b/VasEBoot-core/boot/i386/pc/diskboot.S index 3a324ea74..eeb71a652 100644 --- a/VasEBoot-core/boot/i386/pc/diskboot.S +++ b/VasEBoot-core/boot/i386/pc/diskboot.S @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2006,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include #define TPM 1 @@ -132,7 +132,7 @@ LOCAL(setup_sectors): movl %ecx, 12(%si) /* the segment of buffer address */ - movw $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si) + movw $VasEBoot_BOOT_MACHINE_BUFFER_SEG, 6(%si) /* save %ax from destruction! */ pushw %ax @@ -154,7 +154,7 @@ LOCAL(setup_sectors): jc LOCAL(read_error) - movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx + movw $VasEBoot_BOOT_MACHINE_BUFFER_SEG, %bx jmp LOCAL(copy_buffer) LOCAL(chs_mode): @@ -249,7 +249,7 @@ LOCAL(chs_mode): * %al = 0x0 on success; err code on failure */ - movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx + movw $VasEBoot_BOOT_MACHINE_BUFFER_SEG, %bx movw %bx, %es /* load %es segment with disk buffer */ xorw %bx, %bx /* %bx = 0, put it at 0 in the segment */ @@ -304,7 +304,7 @@ LOCAL(copy_buffer): jne LOCAL(setup_sectors) /* update position to load from */ - subw $GRUB_BOOT_MACHINE_LIST_SIZE, %di + subw $VasEBoot_BOOT_MACHINE_LIST_SIZE, %di /* jump to bootloop */ jmp LOCAL(bootloop) @@ -321,7 +321,7 @@ LOCAL(bootit): /* We've already measured the first 512 bytes, now measure the rest */ xorl %edi, %edi - movw $(GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200), %di + movw $(VasEBoot_BOOT_MACHINE_KERNEL_ADDR + 0x200), %di movl $0x41504354, %ebx /* EBX = "TCPA" */ @@ -338,7 +338,7 @@ LOCAL(bootit): /* print a newline */ MSG(notification_done) popw %dx /* this makes sure %dl is our "boot" drive */ - ljmp $0, $(GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200) + ljmp $0, $(VasEBoot_BOOT_MACHINE_KERNEL_ADDR + 0x200) /* @@ -406,7 +406,7 @@ LOCAL(message): .word 0 .word 0 - .org 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE + .org 0x200 - VasEBoot_BOOT_MACHINE_LIST_SIZE LOCAL(firstlist): /* this label has to be before the first list entry!!! */ /* fill the first data listing with the default */ blocklist_default_start: @@ -414,9 +414,9 @@ blocklist_default_start: the start of the disk, sector 0 */ .long 2, 0 blocklist_default_len: - /* this is the number of sectors to read. grub-mkimage + /* this is the number of sectors to read. VasEBoot-mkimage will fill this up */ .word 0 blocklist_default_seg: /* this is the segment of the starting address to load the data into */ - .word (GRUB_BOOT_MACHINE_KERNEL_SEG + 0x20) + .word (VasEBoot_BOOT_MACHINE_KERNEL_SEG + 0x20) diff --git a/VasEBoot-core/boot/i386/pc/lnxboot.S b/VasEBoot-core/boot/i386/pc/lnxboot.S index 2dda0e06b..84d601b6d 100644 --- a/VasEBoot-core/boot/i386/pc/lnxboot.S +++ b/VasEBoot-core/boot/i386/pc/lnxboot.S @@ -1,33 +1,33 @@ /* -*-Asm-*- */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include +#include +#include +#include #include .file "lnxboot.S" #define CODE_ADDR 0x6000 #define CODE_SECTORS 1 -#define DATA_ADDR ((GRUB_BOOT_MACHINE_KERNEL_ADDR) + 0x200) +#define DATA_ADDR ((VasEBoot_BOOT_MACHINE_KERNEL_ADDR) + 0x200) #define BLCK_LENG 0x4000 @@ -201,15 +201,15 @@ real_code_2: 1: movl $(DATA_ADDR + 0x1000), %edi - movl %ss:(DATA_ADDR + GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE), %ecx - addl $GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE, %ecx + movl %ss:(DATA_ADDR + VasEBoot_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE), %ecx + addl $VasEBoot_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE, %ecx 2: call LOCAL(move_memory) - movb %dh, %ss:(DATA_ADDR + GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE + 2) + movb %dh, %ss:(DATA_ADDR + VasEBoot_DECOMPRESSOR_I386_PC_BOOT_DEVICE + 2) movb (reg_edx + 2 - start), %dh - movb %dh, %ss:(DATA_ADDR + GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE + 1) + movb %dh, %ss:(DATA_ADDR + VasEBoot_DECOMPRESSOR_I386_PC_BOOT_DEVICE + 1) movb $0xFF, %dh diff --git a/VasEBoot-core/boot/i386/pc/lzma_decode.S b/VasEBoot-core/boot/i386/pc/lzma_decode.S index 88c668d5e..5385d66af 100644 --- a/VasEBoot-core/boot/i386/pc/lzma_decode.S +++ b/VasEBoot-core/boot/i386/pc/lzma_decode.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define FIXED_PROPS diff --git a/VasEBoot-core/boot/i386/pc/pxeboot.S b/VasEBoot-core/boot/i386/pc/pxeboot.S index b695b24d0..654f41473 100644 --- a/VasEBoot-core/boot/i386/pc/pxeboot.S +++ b/VasEBoot-core/boot/i386/pc/pxeboot.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "pxeboot.S" .text @@ -30,7 +30,7 @@ _start: start: /* Use drive number 0x7F for PXE */ - movb $GRUB_BOOT_MACHINE_PXE_DL, %dl + movb $VasEBoot_BOOT_MACHINE_PXE_DL, %dl /* Jump to the real world */ ljmp $0, $0x8200 diff --git a/VasEBoot-core/boot/i386/pc/startup_raw.S b/VasEBoot-core/boot/i386/pc/startup_raw.S index 8bce7985c..3a1f127f3 100644 --- a/VasEBoot-core/boot/i386/pc/startup_raw.S +++ b/VasEBoot-core/boot/i386/pc/startup_raw.S @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#define ABS(x) ((x) - LOCAL (base) + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200) +#define ABS(x) ((x) - LOCAL (base) + VasEBoot_BOOT_MACHINE_KERNEL_ADDR + 0x200) .file "startup_raw.S" @@ -50,23 +50,23 @@ LOCAL (base): * This is a special data area. */ - .org GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE + .org VasEBoot_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE LOCAL(compressed_size): .long 0 - .org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE + .org VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE LOCAL(uncompressed_size): .long 0 - .org GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY + .org VasEBoot_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY reed_solomon_redundancy: .long 0 - .org GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH + .org VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH .short (LOCAL(reed_solomon_part) - _start) /* * This is the area for all of the special variables. */ - .org GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE + .org VasEBoot_DECOMPRESSOR_I386_PC_BOOT_DEVICE LOCAL(boot_dev): .byte 0xFF, 0xFF, 0xFF LOCAL(boot_drive): @@ -83,7 +83,7 @@ LOCAL (codestart): movw %ax, %es /* set up the real mode/BIOS stack */ - movl $GRUB_MEMORY_MACHINE_REAL_STACK, %ebp + movl $VasEBoot_MEMORY_MACHINE_REAL_STACK, %ebp movl %ebp, %esp sti /* we're safe again */ @@ -101,7 +101,7 @@ LOCAL (codestart): .code32 cld - call grub_gate_a20 + call VasEBoot_gate_a20 movl LOCAL(compressed_size), %edx #ifdef __APPLE__ @@ -113,7 +113,7 @@ LOCAL (codestart): movl reed_solomon_redundancy, %ecx leal LOCAL(reed_solomon_part), %eax cld - call EXT_C (grub_reed_solomon_recover) + call EXT_C (VasEBoot_reed_solomon_recover) jmp post_reed_solomon #include "../../../kern/i386/realmode.S" @@ -123,7 +123,7 @@ LOCAL (codestart): .text /* - * grub_gate_a20(void) + * VasEBoot_gate_a20(void) * * Gate address-line 20 for high memory. * @@ -132,7 +132,7 @@ LOCAL (codestart): * It also eats any keystrokes in the keyboard buffer. :-( */ -grub_gate_a20: +VasEBoot_gate_a20: gate_a20_test_current_state: /* first of all, test if already in a good state */ call gate_a20_check_state @@ -228,7 +228,7 @@ gate_a20_check_state: pushl %ecx xorl %eax, %eax /* compare the byte at 0x8000 with that at 0x108000 */ - movl $GRUB_BOOT_MACHINE_KERNEL_ADDR, %ebx + movl $VasEBoot_BOOT_MACHINE_KERNEL_ADDR, %ebx pushl %ebx /* save the original byte in CL */ movb (%ebx), %cl @@ -259,7 +259,7 @@ gate_a20_check_state: LOCAL(reed_solomon_part): /* - * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). + * Support for booting VasEBoot from a Multiboot boot loader (e.g. VasEBoot itself). * This uses the a.out kludge to load raw binary to the area starting at 1MB, * and relocates itself after loaded. */ @@ -287,7 +287,7 @@ multiboot_entry: /* obtain the boot device */ movl 12(%ebx), %edx - movl $GRUB_MEMORY_MACHINE_PROT_STACK, %ebp + movl $VasEBoot_MEMORY_MACHINE_PROT_STACK, %ebp movl %ebp, %esp /* relocate the code */ @@ -302,7 +302,7 @@ multiboot_entry: addl LOCAL(compressed_size) - _start + 0x100000 + 0x200, %ecx #endif movl $0x100000, %esi - movl $GRUB_BOOT_MACHINE_KERNEL_ADDR, %edi + movl $VasEBoot_BOOT_MACHINE_KERNEL_ADDR, %edi cld rep movsb @@ -323,7 +323,7 @@ multiboot_trampoline: post_reed_solomon: #ifdef ENABLE_LZMA - movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %edi + movl $VasEBoot_MEMORY_MACHINE_DECOMPRESSION_ADDR, %edi #ifdef __APPLE__ movl $decompressor_end, %esi #else diff --git a/VasEBoot-core/boot/i386/qemu/boot.S b/VasEBoot-core/boot/i386/qemu/boot.S index 8c3a1db71..dbd70b59d 100644 --- a/VasEBoot-core/boot/i386/qemu/boot.S +++ b/VasEBoot-core/boot/i386/qemu/boot.S @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include +#include +#include +#include +#include .text .code16 @@ -31,8 +31,8 @@ _start: jmp 1f - .org GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR -VARIABLE(grub_core_entry_addr) + .org VasEBoot_BOOT_I386_QEMU_CORE_ENTRY_ADDR +VARIABLE(VasEBoot_core_entry_addr) .long 0 1: @@ -43,7 +43,7 @@ VARIABLE(grub_core_entry_addr) movw %ax, %es /* Set up the real mode stack. */ - movl $GRUB_MEMORY_MACHINE_REAL_STACK, %esp + movl $VasEBoot_MEMORY_MACHINE_REAL_STACK, %esp /* Transition to protected mode. We use pushl to force generation of a flat return address. */ @@ -58,7 +58,7 @@ VARIABLE(grub_core_entry_addr) andb $(~0x03), %al orb $0x02, %al outb $0x92 - movl EXT_C(grub_core_entry_addr), %edx + movl EXT_C(VasEBoot_core_entry_addr), %edx jmp *%edx #include "../../../kern/i386/realmode.S" @@ -66,9 +66,9 @@ VARIABLE(grub_core_entry_addr) /* Intel, in its infinite wisdom, decided to put the i8086 entry point *right here* and this is why we need this kludge. */ - .org GRUB_BOOT_MACHINE_SIZE - 16 + .org VasEBoot_BOOT_MACHINE_SIZE - 16 .code16 jmp _start - .org GRUB_BOOT_MACHINE_SIZE + .org VasEBoot_BOOT_MACHINE_SIZE diff --git a/VasEBoot-core/boot/mips/loongson/fwstart.S b/VasEBoot-core/boot/mips/loongson/fwstart.S index 28c634614..ec35ae464 100644 --- a/VasEBoot-core/boot/mips/loongson/fwstart.S +++ b/VasEBoot-core/boot/mips/loongson/fwstart.S @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifndef FULOONG2F -#include -#define GRUB_SM712_REG_BASE 0x700000 -#define GRUB_SM712_PCIID 0x0712126f +#include +#define VasEBoot_SM712_REG_BASE 0x700000 +#define VasEBoot_SM712_PCIID 0x0712126f #endif #ifdef FULOONG2F -#define GRUB_MACHINE_SERIAL_PORT GRUB_MACHINE_SERIAL_PORT2 -#define GRUB_MACHINE_SERIAL_DIVISOR_115200 GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200 +#define VasEBoot_MACHINE_SERIAL_PORT VasEBoot_MACHINE_SERIAL_PORT2 +#define VasEBoot_MACHINE_SERIAL_DIVISOR_115200 VasEBoot_MACHINE_SERIAL_PORT2_DIVISOR_115200 #else -#define GRUB_MACHINE_SERIAL_PORT GRUB_MACHINE_SERIAL_PORT0 -#define GRUB_MACHINE_SERIAL_DIVISOR_115200 GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200 +#define VasEBoot_MACHINE_SERIAL_PORT VasEBoot_MACHINE_SERIAL_PORT0 +#define VasEBoot_MACHINE_SERIAL_DIVISOR_115200 VasEBoot_MACHINE_SERIAL_PORT0_DIVISOR_115200 #endif .set noreorder @@ -59,22 +59,22 @@ __start: /* Find CS5536 controller. */ /* $t4 chooses device in priority encoding. */ - /* Resulting value is kept in GRUB_MACHINE_PCI_CONF_CTRL_REG. + /* Resulting value is kept in VasEBoot_MACHINE_PCI_CONF_CTRL_REG. This way we don't need to sacrifice a register for it. */ retry_cs5536: /* We have only one bus (0). Function is 0. */ - lui $t0, %hi(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F) - lui $t1, %hi(GRUB_MACHINE_PCI_CONFSPACE_2F) - lui $t3, %hi(GRUB_CS5536_PCIID) - addiu $t3, $t3, %lo(GRUB_CS5536_PCIID) + lui $t0, %hi(VasEBoot_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F) + lui $t1, %hi(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + lui $t3, %hi(VasEBoot_CS5536_PCIID) + addiu $t3, $t3, %lo(VasEBoot_CS5536_PCIID) ori $t4, $zero, 1 1: - andi $t4, $t4, ((1 << GRUB_PCI_NUM_DEVICES_2F) - 1) + andi $t4, $t4, ((1 << VasEBoot_PCI_NUM_DEVICES_2F) - 1) /* In case of failure try again. CS5536 may be slow to come up. */ beql $t4, $zero, retry_cs5536 nop - sw $t4, %lo(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F) ($t0) - lw $t2, (%lo(GRUB_MACHINE_PCI_CONFSPACE_2F) + GRUB_PCI_REG_PCI_ID) ($t1) + sw $t4, %lo(VasEBoot_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F) ($t0) + lw $t2, (%lo(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + VasEBoot_PCI_REG_PCI_ID) ($t1) bnel $t2, $t3, 1b sll $t4, $t4, 1 @@ -86,18 +86,18 @@ retry_cs5536: move $a0, $t4 #endif - lui $t0, %hi(GRUB_MACHINE_PCI_CONFSPACE_2F) - li $t1, GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED - sw $t1, (%lo(GRUB_MACHINE_PCI_CONFSPACE_2F) + GRUB_CS5536_MSR_MAILBOX_CONFIG) ($t0) + lui $t0, %hi(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + li $t1, VasEBoot_CS5536_MSR_MAILBOX_CONFIG_ENABLED + sw $t1, (%lo(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + VasEBoot_CS5536_MSR_MAILBOX_CONFIG) ($t0) /* Set GPIO LBAR. */ - lui $a0, %hi(GRUB_CS5536_MSR_GPIO_BAR) - addiu $a0, $a0, %lo(GRUB_CS5536_MSR_GPIO_BAR) - ori $a1, $zero, GRUB_CS5536_LBAR_GPIO + lui $a0, %hi(VasEBoot_CS5536_MSR_GPIO_BAR) + addiu $a0, $a0, %lo(VasEBoot_CS5536_MSR_GPIO_BAR) + ori $a1, $zero, VasEBoot_CS5536_LBAR_GPIO /* Set mask to 0xf and enabled bit to 1. */ bal wrmsr - ori $a2, $zero, ((GRUB_CS5536_LBAR_MASK_MASK \ - | GRUB_CS5536_LBAR_ENABLE) >> 32) + ori $a2, $zero, ((VasEBoot_CS5536_LBAR_MASK_MASK \ + | VasEBoot_CS5536_LBAR_ENABLE) >> 32) bal gpio_init nop @@ -109,63 +109,63 @@ retry_cs5536: /* Initialise SMBus controller. */ /* Set SMBUS LBAR. */ - lui $a0, %hi(GRUB_CS5536_MSR_SMB_BAR) - addiu $a0, $a0, %lo(GRUB_CS5536_MSR_SMB_BAR) - ori $a1, $zero, GRUB_CS5536_LBAR_SMBUS + lui $a0, %hi(VasEBoot_CS5536_MSR_SMB_BAR) + addiu $a0, $a0, %lo(VasEBoot_CS5536_MSR_SMB_BAR) + ori $a1, $zero, VasEBoot_CS5536_LBAR_SMBUS /* Set mask to 0xf and enabled bit to 1. */ bal wrmsr - ori $a2, $zero, ((GRUB_CS5536_LBAR_MASK_MASK \ - | GRUB_CS5536_LBAR_ENABLE) >> 32) + ori $a2, $zero, ((VasEBoot_CS5536_LBAR_MASK_MASK \ + | VasEBoot_CS5536_LBAR_ENABLE) >> 32) lui $a0, %hi(smbus_enabled) bal message addiu $a0, $a0, %lo(smbus_enabled) - lui $t0, %hi(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_SMBUS) + lui $t0, %hi(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_SMBUS) /* Disable SMB. */ - sb $zero, %lo(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL2) ($t0) + sb $zero, %lo(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL2) ($t0) /* Disable interrupts. */ - sb $zero, %lo(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1) ($t0) + sb $zero, %lo(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1) ($t0) /* Set as master. */ - sb $zero, %lo(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_ADDR) ($t0) + sb $zero, %lo(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_ADDR) ($t0) /* Launch SMBus controller at slowest speed possible. */ ori $t1, $zero, 0xff - sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL3) ($t0) - sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL2) ($t0) + sb $t1, %lo(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL3) ($t0) + sb $t1, %lo(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL2) ($t0) /* Yeeloong and Fuloong2f have only one memory slot. */ /* Output first byte on serial for debugging. */ - ori $a1, $zero, GRUB_SMB_RAM_START_ADDR + ori $a1, $zero, VasEBoot_SMB_RAM_START_ADDR bal read_spd move $a0, $zero bal printhex move $a0, $v0 bal read_spd - ori $a0, $zero, GRUB_SMBUS_SPD_MEMORY_TYPE_ADDR - ori $t0, $zero, GRUB_SMBUS_SPD_MEMORY_TYPE_DDR2 + ori $a0, $zero, VasEBoot_SMBUS_SPD_MEMORY_TYPE_ADDR + ori $t0, $zero, VasEBoot_SMBUS_SPD_MEMORY_TYPE_DDR2 lui $a0, %hi(unimplemented_memory_type) bne $t0, $v0, fatal addiu $a0, $a0, %lo(unimplemented_memory_type) /* And here is our goal: DDR2 controller initialisation. */ - lui $t0, %hi(GRUB_CPU_LOONGSON_CORECFG) - ld $t1, %lo(GRUB_CPU_LOONGSON_CORECFG) ($t0) + lui $t0, %hi(VasEBoot_CPU_LOONGSON_CORECFG) + ld $t1, %lo(VasEBoot_CPU_LOONGSON_CORECFG) ($t0) /* Use addiu for sign-extension. */ - addiu $t2, $zero, ~(GRUB_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE|GRUB_CPU_LOONGSON_CORECFG_BUFFER_CPU) + addiu $t2, $zero, ~(VasEBoot_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE|VasEBoot_CPU_LOONGSON_CORECFG_BUFFER_CPU) and $t1, $t1, $t2 - sd $t1, %lo (GRUB_CPU_LOONGSON_CORECFG) ($t0) + sd $t1, %lo (VasEBoot_CPU_LOONGSON_CORECFG) ($t0) b continue - .org GRUB_CPU_LOONGSON_FLASH_TLB_REFILL - GRUB_CPU_LOONGSON_FLASH_START + .org VasEBoot_CPU_LOONGSON_FLASH_TLB_REFILL - VasEBoot_CPU_LOONGSON_FLASH_START tlb_refill: - mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC - mfc0 $s2, GRUB_CPU_LOONGSON_COP0_BADVADDR + mfc0 $s1, VasEBoot_CPU_LOONGSON_COP0_EPC + mfc0 $s2, VasEBoot_CPU_LOONGSON_COP0_BADVADDR move $s3, $ra lui $a0, %hi(epc) bal message @@ -196,17 +196,17 @@ tlb_refill: b fatal addiu $a0, $a0, %lo(unhandled_tlb_refill) - .org GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR - GRUB_CPU_LOONGSON_FLASH_START + .org VasEBoot_CPU_LOONGSON_FLASH_CACHE_ERROR - VasEBoot_CPU_LOONGSON_FLASH_START cache_error: lui $a0, %hi(unhandled_cache_error) b fatal addiu $a0, $a0, %lo(unhandled_cache_error) - .org GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION - GRUB_CPU_LOONGSON_FLASH_START + .org VasEBoot_CPU_LOONGSON_FLASH_OTHER_EXCEPTION - VasEBoot_CPU_LOONGSON_FLASH_START other_exception: - mfc0 $s0, GRUB_CPU_LOONGSON_COP0_CAUSE - mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC - mfc0 $s2, GRUB_CPU_LOONGSON_COP0_BADVADDR + mfc0 $s0, VasEBoot_CPU_LOONGSON_COP0_CAUSE + mfc0 $s1, VasEBoot_CPU_LOONGSON_COP0_EPC + mfc0 $s2, VasEBoot_CPU_LOONGSON_COP0_BADVADDR lui $a0, %hi(cause) bal message addiu $a0, $a0, %lo(cause) @@ -237,8 +237,8 @@ other_exception: addiu $a0, $a0, %lo(unhandled_exception) gpio_init: - lui $t0, %hi(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_GPIO) - addiu $t0, $t0, %lo(GRUB_MACHINE_PCI_IO_BASE_2F + GRUB_CS5536_LBAR_GPIO) + lui $t0, %hi(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_GPIO) + addiu $t0, $t0, %lo(VasEBoot_MACHINE_PCI_IO_BASE_2F + VasEBoot_CS5536_LBAR_GPIO) lui $t1, %hi (gpio_dump) addiu $t1, $t1, %lo (gpio_dump) @@ -260,55 +260,55 @@ gpio_init: serial_hw_init: move $t2, $ra #ifdef FULOONG2F - lui $a0, %hi(GRUB_CS5536_MSR_DIVIL_LEG_IO) - addiu $a0, $a0, %lo(GRUB_CS5536_MSR_DIVIL_LEG_IO) - lui $a1, %hi (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 \ - | GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP \ - | GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 \ - | GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1) - ori $a1, $a1, (GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 \ - | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1) + lui $a0, %hi(VasEBoot_CS5536_MSR_DIVIL_LEG_IO) + addiu $a0, $a0, %lo(VasEBoot_CS5536_MSR_DIVIL_LEG_IO) + lui $a1, %hi (VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 \ + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_F_REMAP \ + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 \ + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1) + ori $a1, $a1, (VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 \ + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1) bal wrmsr move $a2, $zero - lui $a0, %hi(GRUB_CS5536_MSR_DIVIL_UART1_CONF) - addiu $a0, $a0, %lo(GRUB_CS5536_MSR_DIVIL_UART1_CONF) + lui $a0, %hi(VasEBoot_CS5536_MSR_DIVIL_UART1_CONF) + addiu $a0, $a0, %lo(VasEBoot_CS5536_MSR_DIVIL_UART1_CONF) li $a1, 2 bal wrmsr move $a2, $zero - lui $a0, %hi(GRUB_CS5536_MSR_DIVIL_UART2_CONF) - addiu $a0, $a0, %lo(GRUB_CS5536_MSR_DIVIL_UART2_CONF) + lui $a0, %hi(VasEBoot_CS5536_MSR_DIVIL_UART2_CONF) + addiu $a0, $a0, %lo(VasEBoot_CS5536_MSR_DIVIL_UART2_CONF) li $a1, 2 bal wrmsr move $a2, $zero #endif - lui $t0, %hi (GRUB_MACHINE_SERIAL_PORT) + lui $t0, %hi (VasEBoot_MACHINE_SERIAL_PORT) /* Turn off the interrupt. */ - sb $zero, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_IER)($t0) + sb $zero, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_IER)($t0) /* Set DLAB. */ ori $t1, $zero, UART_DLAB - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_LCR)($t0) + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_LCR)($t0) /* Set the baud rate 115200. */ - ori $t1, $zero, GRUB_MACHINE_SERIAL_DIVISOR_115200 - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_DLL)($t0) - sb $zero, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_DLH)($t0) + ori $t1, $zero, VasEBoot_MACHINE_SERIAL_DIVISOR_115200 + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_DLL)($t0) + sb $zero, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_DLH)($t0) /* Set the line status. */ ori $t1, $zero, (UART_NO_PARITY | UART_8BITS_WORD | UART_1_STOP_BIT) - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_LCR)($t0) + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_LCR)($t0) /* Enable the FIFO. */ ori $t1, $zero, UART_ENABLE_FIFO_TRIGGER1 - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_FCR)($t0) + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_FCR)($t0) /* Turn on DTR and RTS. */ ori $t1, $zero, UART_ENABLE_DTRRTS - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_MCR)($t0) + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_MCR)($t0) /* Let message return to original caller. */ lui $a0, %hi(notification_string) @@ -318,14 +318,14 @@ serial_hw_init: /* Print message on serial console. */ /* In: $a0 = asciiz message. Out: none. Clobbered: $t0, $t1, $a0. */ message: - lui $t0, %hi (GRUB_MACHINE_SERIAL_PORT) + lui $t0, %hi (VasEBoot_MACHINE_SERIAL_PORT) 1: - lb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_LSR)($t0) + lb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_LSR)($t0) andi $t1, $t1, UART_EMPTY_TRANSMITTER beq $t1, $zero, 1b nop lb $t1, 0($a0) - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_TX)($t0) + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_TX)($t0) bne $t1, $zero, 1b addiu $a0, $a0, 1 jr $ra @@ -335,10 +335,10 @@ message: In: $a0. Out: None. Clobbered: $a0, $t0, $t1, $t2 */ printhex: - lui $t0, %hi (GRUB_MACHINE_SERIAL_PORT) + lui $t0, %hi (VasEBoot_MACHINE_SERIAL_PORT) ori $t2, $zero, 8 1: - lb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_LSR)($t0) + lb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_LSR)($t0) andi $t1, $t1, UART_EMPTY_TRANSMITTER beq $t1, $zero, 1b nop @@ -348,7 +348,7 @@ printhex: sll $a0, $a0, 4 addiu $t1, $t1, 'A'-10-'0' 2: addiu $t1, $t1, '0'+10 - sb $t1, (%lo (GRUB_MACHINE_SERIAL_PORT) + UART_TX)($t0) + sb $t1, (%lo (VasEBoot_MACHINE_SERIAL_PORT) + UART_TX)($t0) addiu $t2, $t2, -1 bne $t2, $zero, 1b nop @@ -368,22 +368,22 @@ self: Clobbered: $t0 */ wrmsr: - lui $t0, %hi(GRUB_MACHINE_PCI_CONFSPACE_2F) - sw $a0, (%lo(GRUB_MACHINE_PCI_CONFSPACE_2F) + GRUB_CS5536_MSR_MAILBOX_ADDR) ($t0) - sw $a1, (%lo(GRUB_MACHINE_PCI_CONFSPACE_2F) + GRUB_CS5536_MSR_MAILBOX_DATA0) ($t0) + lui $t0, %hi(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + sw $a0, (%lo(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + VasEBoot_CS5536_MSR_MAILBOX_ADDR) ($t0) + sw $a1, (%lo(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + VasEBoot_CS5536_MSR_MAILBOX_DATA0) ($t0) jr $ra - sw $a2, (%lo(GRUB_MACHINE_PCI_CONFSPACE_2F) + GRUB_CS5536_MSR_MAILBOX_DATA1) ($t0) + sw $a2, (%lo(VasEBoot_MACHINE_PCI_CONFSPACE_2F) + VasEBoot_CS5536_MSR_MAILBOX_DATA1) ($t0) /* Wait for SMBus data or empty transmitter. */ /* In: $a0 = exception handler. Out: none. Clobbered: $t0, $t1 */ smbus_wait: 1: - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_STATUS + GRUB_MACHINE_PCI_IO_BASE_2F) - lb $t0, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_STATUS + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) - andi $t1, $t0, GRUB_CS5536_SMB_REG_STATUS_SDAST + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_STATUS + VasEBoot_MACHINE_PCI_IO_BASE_2F) + lb $t0, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_STATUS + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) + andi $t1, $t0, VasEBoot_CS5536_SMB_REG_STATUS_SDAST bne $t1, $zero, return nop - andi $t1, $t0, (GRUB_CS5536_SMB_REG_STATUS_BER | GRUB_CS5536_SMB_REG_STATUS_NACK) + andi $t1, $t0, (VasEBoot_CS5536_SMB_REG_STATUS_BER | VasEBoot_CS5536_SMB_REG_STATUS_NACK) beq $t1, $zero, 1b nop jr $a0 @@ -401,59 +401,59 @@ read_spd: addiu $a0, $a0, %lo(read_spd_fail) /* Send START. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) - lb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) - ori $t1, $t1, GRUB_CS5536_SMB_REG_CTRL1_START + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) + lb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) + ori $t1, $t1, VasEBoot_CS5536_SMB_REG_CTRL1_START bal smbus_wait - sb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + sb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) /* Send device address. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) sll $t1, $a1, 1 bal smbus_wait - sb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + sb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) /* Send ACK. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) - lb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) - ori $t1, $t1, GRUB_CS5536_SMB_REG_CTRL1_ACK - sb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) + lb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) + ori $t1, $t1, VasEBoot_CS5536_SMB_REG_CTRL1_ACK + sb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) /* Send byte address. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) bal smbus_wait - sb $t2, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + sb $t2, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) /* Send START. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) - lb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) - ori $t1, $t1, GRUB_CS5536_SMB_REG_CTRL1_START + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) + lb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) + ori $t1, $t1, VasEBoot_CS5536_SMB_REG_CTRL1_START bal smbus_wait - sb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + sb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) /* Send device address. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) sll $t1, $a1, 1 ori $t1, $t1, 1 bal smbus_wait - sb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + sb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) /* Send STOP. */ - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) - lb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) - ori $t1, $t1, GRUB_CS5536_SMB_REG_CTRL1_STOP + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) + lb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) + ori $t1, $t1, VasEBoot_CS5536_SMB_REG_CTRL1_STOP bal smbus_wait - sb $t1, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL1 + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + sb $t1, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_CTRL1 + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) - lui $t0, %hi(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) - lb $v0, %lo(GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_DATA + GRUB_MACHINE_PCI_IO_BASE_2F) ($t0) + lui $t0, %hi(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) + lb $v0, %lo(VasEBoot_CS5536_LBAR_SMBUS + VasEBoot_CS5536_SMB_REG_DATA + VasEBoot_MACHINE_PCI_IO_BASE_2F) ($t0) jr $t3 andi $v0, $v0, 0xff read_spd_fail: jr $t3 ori $v0, $v0, 0x100 -notification_string: .asciz "GRUB " +notification_string: .asciz "VasEBoot " cs5536_found: .asciz "CS5536 at " sm_failed: .asciz "SM transaction failed.\n\r" unhandled_tlb_refill: .asciz "Unhandled TLB refill.\n\r" @@ -552,13 +552,13 @@ gpio_dump_end: write_dumpreg: ld $t2, 0($t6) sd $t2, 0($t4) - addiu $t4, $t4, GRUB_CPU_LOONGSON_DDR2_REG_STEP + addiu $t4, $t4, VasEBoot_CPU_LOONGSON_DDR2_REG_STEP jr $ra - addiu $t6, $t6, GRUB_CPU_LOONGSON_DDR2_REG_SIZE + addiu $t6, $t6, VasEBoot_CPU_LOONGSON_DDR2_REG_SIZE continue: - lui $t4, %hi(GRUB_CPU_LOONGSON_DDR2_BASE) - addiu $t4, $t4, %lo(GRUB_CPU_LOONGSON_DDR2_BASE) + lui $t4, %hi(VasEBoot_CPU_LOONGSON_DDR2_BASE) + addiu $t4, $t4, %lo(VasEBoot_CPU_LOONGSON_DDR2_BASE) lui $t6, %hi(regdump) /* 0 */ @@ -566,20 +566,20 @@ continue: addiu $t6, $t6, %lo(regdump) /* 1 */ - ori $a1, $a1, GRUB_SMB_RAM_START_ADDR + ori $a1, $a1, VasEBoot_SMB_RAM_START_ADDR move $t8, $zero lui $t5, 0x0001 bal read_spd - ori $a0, $zero, GRUB_SMBUS_SPD_MEMORY_NUM_BANKS_ADDR + ori $a0, $zero, VasEBoot_SMBUS_SPD_MEMORY_NUM_BANKS_ADDR ori $t7, $zero, 8 bne $v0, $t7, 1f ori $t5, $t5, 0x0001 - ori $t8, $t8, GRUB_CPU_LOONGSON_DDR2_REG1_HI_8BANKS + ori $t8, $t8, VasEBoot_CPU_LOONGSON_DDR2_REG1_HI_8BANKS 1: dsll $t8, $t8, 32 or $t5, $t5, $t8 sd $t5, 0 ($t4) - addiu $t4, $t4, GRUB_CPU_LOONGSON_DDR2_REG_STEP + addiu $t4, $t4, VasEBoot_CPU_LOONGSON_DDR2_REG_STEP /* 2 */ bal write_dumpreg @@ -597,7 +597,7 @@ continue: /* FIXME: figure termination resistance. */ ori $t5, $zero, 0x2 bal read_spd - ori $a0, $zero, GRUB_SMBUS_SPD_MEMORY_NUM_ROWS_ADDR + ori $a0, $zero, VasEBoot_SMBUS_SPD_MEMORY_NUM_ROWS_ADDR /* $v0 = 15 - $v0. */ xori $v0, $v0, 0xf andi $v0, $v0, 0x7 @@ -606,9 +606,9 @@ continue: /* Find the fastest supported CAS latency. */ bal read_spd - ori $a0, $zero, GRUB_SMBUS_SPD_MEMORY_CAS_LATENCY_ADDR - ori $t0, $zero, GRUB_SMBUS_SPD_MEMORY_CAS_LATENCY_MIN_VALUE - ori $t1, $zero, (1 << GRUB_SMBUS_SPD_MEMORY_CAS_LATENCY_MIN_VALUE) + ori $a0, $zero, VasEBoot_SMBUS_SPD_MEMORY_CAS_LATENCY_ADDR + ori $t0, $zero, VasEBoot_SMBUS_SPD_MEMORY_CAS_LATENCY_MIN_VALUE + ori $t1, $zero, (1 << VasEBoot_SMBUS_SPD_MEMORY_CAS_LATENCY_MIN_VALUE) 2: and $t2, $t1, $v0 bne $t2, $zero, 1f @@ -624,7 +624,7 @@ continue: or $t5, $t5, $t0 bal read_spd - ori $a0, $zero, GRUB_SMBUS_SPD_MEMORY_NUM_COLUMNS_ADDR + ori $a0, $zero, VasEBoot_SMBUS_SPD_MEMORY_NUM_COLUMNS_ADDR /* $v0 = 15 - ($v0 + 1) = 14 - $v0. */ addiu $v0, $v0, 1 xori $v0, $v0, 0xf @@ -633,112 +633,112 @@ continue: or $t5, $t5, $v0 sd $t5, 0 ($t4) - addiu $t4, $t4, GRUB_CPU_LOONGSON_DDR2_REG_STEP + addiu $t4, $t4, VasEBoot_CPU_LOONGSON_DDR2_REG_STEP ori $t7, $zero, 0x16 1: ld $t2, 0($t6) sd $t2, 0($t4) - addiu $t4, $t4, GRUB_CPU_LOONGSON_DDR2_REG_STEP + addiu $t4, $t4, VasEBoot_CPU_LOONGSON_DDR2_REG_STEP addiu $t7, $t7, -1 bne $t7, $zero, 1b - addiu $t6, $t6, GRUB_CPU_LOONGSON_DDR2_REG_SIZE + addiu $t6, $t6, VasEBoot_CPU_LOONGSON_DDR2_REG_SIZE - lui $t4, %hi(GRUB_CPU_LOONGSON_DDR2_BASE) - ld $t5, (%lo(GRUB_CPU_LOONGSON_DDR2_BASE) + 0x30) ($t4) + lui $t4, %hi(VasEBoot_CPU_LOONGSON_DDR2_BASE) + ld $t5, (%lo(VasEBoot_CPU_LOONGSON_DDR2_BASE) + 0x30) ($t4) ori $t0, $zero, 1 dsll $t0, $t0, 40 or $t5, $t5, $t0 - sd $t5, (%lo(GRUB_CPU_LOONGSON_DDR2_BASE) + 0x30) ($t4) + sd $t5, (%lo(VasEBoot_CPU_LOONGSON_DDR2_BASE) + 0x30) ($t4) /* Desactivate DDR2 registers. */ - lui $t0, %hi (GRUB_CPU_LOONGSON_CORECFG) - ld $t1, %lo (GRUB_CPU_LOONGSON_CORECFG) ($t0) - ori $t1, $t1, GRUB_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE - sd $t1, %lo (GRUB_CPU_LOONGSON_CORECFG) ($t0) + lui $t0, %hi (VasEBoot_CPU_LOONGSON_CORECFG) + ld $t1, %lo (VasEBoot_CPU_LOONGSON_CORECFG) ($t0) + ori $t1, $t1, VasEBoot_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE + sd $t1, %lo (VasEBoot_CPU_LOONGSON_CORECFG) ($t0) /* Enable cache. */ - mfc0 $t0, GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG - addiu $t1, $zero, ~GRUB_CPU_LOONGSON_CACHE_TYPE_MASK + mfc0 $t0, VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG + addiu $t1, $zero, ~VasEBoot_CPU_LOONGSON_CACHE_TYPE_MASK and $t0, $t1, $t1 /* Set line size to 32 bytes and disabled cache. */ - ori $t0, $t0, (GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG_ILINESIZE \ - | GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG_DLINESIZE \ - | GRUB_CPU_LOONGSON_CACHE_ACCELERATED) - mtc0 $t0, GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG + ori $t0, $t0, (VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG_ILINESIZE \ + | VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG_DLINESIZE \ + | VasEBoot_CPU_LOONGSON_CACHE_ACCELERATED) + mtc0 $t0, VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG /* Invalidate all I-cache entries. */ - srl $t1, $t0, GRUB_CPU_LOONGSON_COP0_CACHE_ISIZE_SHIFT - andi $t1, $t1, GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_MASK - ori $t2, $zero, (1 << (GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET \ - - GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG \ - - GRUB_CPU_LOONGSON_I_CACHE_LOG_WAYS)) + srl $t1, $t0, VasEBoot_CPU_LOONGSON_COP0_CACHE_ISIZE_SHIFT + andi $t1, $t1, VasEBoot_CPU_LOONGSON_COP0_CACHE_SIZE_MASK + ori $t2, $zero, (1 << (VasEBoot_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET \ + - VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG \ + - VasEBoot_CPU_LOONGSON_I_CACHE_LOG_WAYS)) sll $t1, $t2, $t1 lui $t2, 0x8000 1: - cache GRUB_CPU_LOONGSON_COP0_I_INDEX_INVALIDATE, 0($t2) + cache VasEBoot_CPU_LOONGSON_COP0_I_INDEX_INVALIDATE, 0($t2) addiu $t1, $t1, -1 bne $t1, $zero, 1b - addiu $t2, $t2, (1 << GRUB_CPU_LOONGSON_COP0_I_INDEX_BIT_OFFSET) + addiu $t2, $t2, (1 << VasEBoot_CPU_LOONGSON_COP0_I_INDEX_BIT_OFFSET) /* Invalidate all D-cache entries. */ - srl $t1, $t0, GRUB_CPU_LOONGSON_COP0_CACHE_DSIZE_SHIFT - andi $t1, $t1, GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_MASK - ori $t2, $zero, (1 << (GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET \ - - GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG \ - - GRUB_CPU_LOONGSON_D_CACHE_LOG_WAYS)) + srl $t1, $t0, VasEBoot_CPU_LOONGSON_COP0_CACHE_DSIZE_SHIFT + andi $t1, $t1, VasEBoot_CPU_LOONGSON_COP0_CACHE_SIZE_MASK + ori $t2, $zero, (1 << (VasEBoot_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET \ + - VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG \ + - VasEBoot_CPU_LOONGSON_D_CACHE_LOG_WAYS)) sll $t1, $t2, $t1 lui $t2, 0x8000 - mtc0 $zero, GRUB_CPU_LOONGSON_COP0_CACHE_TAGLO - mtc0 $zero, GRUB_CPU_LOONGSON_COP0_CACHE_TAGHI + mtc0 $zero, VasEBoot_CPU_LOONGSON_COP0_CACHE_TAGLO + mtc0 $zero, VasEBoot_CPU_LOONGSON_COP0_CACHE_TAGHI 1: /* All four ways. */ - cache GRUB_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 0($t2) - cache GRUB_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 1($t2) - cache GRUB_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 2($t2) - cache GRUB_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 3($t2) + cache VasEBoot_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 0($t2) + cache VasEBoot_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 1($t2) + cache VasEBoot_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 2($t2) + cache VasEBoot_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE, 3($t2) addiu $t1, $t1, -1 bne $t1, $zero, 1b - addiu $t2, $t2, (1 << GRUB_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET) + addiu $t2, $t2, (1 << VasEBoot_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET) /* Invalidate all S-cache entries. */ - ori $t1, $zero, (1 << (GRUB_CPU_LOONGSON_SECONDARY_CACHE_LOG_SIZE \ - - GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG \ - - GRUB_CPU_LOONGSON_S_CACHE_LOG_WAYS)) + ori $t1, $zero, (1 << (VasEBoot_CPU_LOONGSON_SECONDARY_CACHE_LOG_SIZE \ + - VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG \ + - VasEBoot_CPU_LOONGSON_S_CACHE_LOG_WAYS)) lui $t2, 0x8000 - mtc0 $zero, GRUB_CPU_LOONGSON_COP0_CACHE_TAGLO - mtc0 $zero, GRUB_CPU_LOONGSON_COP0_CACHE_TAGHI + mtc0 $zero, VasEBoot_CPU_LOONGSON_COP0_CACHE_TAGLO + mtc0 $zero, VasEBoot_CPU_LOONGSON_COP0_CACHE_TAGHI 1: /* All four ways. */ - cache GRUB_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 0($t2) - cache GRUB_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 1($t2) - cache GRUB_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 2($t2) - cache GRUB_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 3($t2) + cache VasEBoot_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 0($t2) + cache VasEBoot_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 1($t2) + cache VasEBoot_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 2($t2) + cache VasEBoot_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE, 3($t2) addiu $t1, $t1, -1 bne $t1, $zero, 1b - addiu $t2, $t2, (1 << GRUB_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET) + addiu $t2, $t2, (1 << VasEBoot_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET) /* Finally enable cache. */ - mfc0 $t0, GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG - addiu $t1, $zero, ~GRUB_CPU_LOONGSON_CACHE_TYPE_MASK + mfc0 $t0, VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG + addiu $t1, $zero, ~VasEBoot_CPU_LOONGSON_CACHE_TYPE_MASK and $t0, $t1, $t1 - ori $t0, $t0, GRUB_CPU_LOONGSON_CACHE_CACHED - mtc0 $t0, GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG + ori $t0, $t0, VasEBoot_CPU_LOONGSON_CACHE_CACHED + mtc0 $t0, VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG lui $a0, %hi(caches_enabled) bal message addiu $a0, $a0, %lo(caches_enabled) /* Set ROM delay cycles to 1. */ - lui $t0, %hi(GRUB_CPU_LOONGSON_LIOCFG) - lw $t1, %lo(GRUB_CPU_LOONGSON_LIOCFG) ($t0) - addiu $t2, $zero, ~(GRUB_CPU_LOONGSON_ROM_DELAY_MASK \ - << GRUB_CPU_LOONGSON_ROM_DELAY_OFFSET) + lui $t0, %hi(VasEBoot_CPU_LOONGSON_LIOCFG) + lw $t1, %lo(VasEBoot_CPU_LOONGSON_LIOCFG) ($t0) + addiu $t2, $zero, ~(VasEBoot_CPU_LOONGSON_ROM_DELAY_MASK \ + << VasEBoot_CPU_LOONGSON_ROM_DELAY_OFFSET) and $t1, $t1, $t2 - ori $t1, $t1, (1 << GRUB_CPU_LOONGSON_ROM_DELAY_OFFSET) - sw $t1, %lo(GRUB_CPU_LOONGSON_LIOCFG) ($t0) + ori $t1, $t1, (1 << VasEBoot_CPU_LOONGSON_ROM_DELAY_OFFSET) + sw $t1, %lo(VasEBoot_CPU_LOONGSON_LIOCFG) ($t0) addiu $a0, $zero, -1 addiu $a1, $zero, -1 @@ -748,9 +748,9 @@ continue: addiu $t0, $t0, %lo(cached_continue - 0x20000000) jr $t0 #ifdef FULOONG2F - addiu $a2, $zero, -(1 + GRUB_ARCH_MACHINE_FULOONG2F) + addiu $a2, $zero, -(1 + VasEBoot_ARCH_MACHINE_FULOONG2F) #else - addiu $a2, $zero, -(1 + GRUB_ARCH_MACHINE_YEELOONG) + addiu $a2, $zero, -(1 + VasEBoot_ARCH_MACHINE_YEELOONG) #endif cached_continue: diff --git a/VasEBoot-core/boot/mips/startup_raw.S b/VasEBoot-core/boot/mips/startup_raw.S index 6a81b3733..994ba584a 100644 --- a/VasEBoot-core/boot/mips/startup_raw.S +++ b/VasEBoot-core/boot/mips/startup_raw.S @@ -1,28 +1,28 @@ /* startup.S - Startup code for the MIPS. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define BASE_ADDR 8 @@ -40,13 +40,13 @@ start: bal codestart nop base: - .org GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE + .org VasEBoot_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE compressed_size: .long 0 - .org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE + .org VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE uncompressed_size: .long 0 - .org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR + .org VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR uncompressed_addr: .long 0 codestart: @@ -55,7 +55,7 @@ codestart: /* Parse arguments. Has to be done before relocation. So need to do it in asm. */ -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS lui $t0, %hi (((16 << 20) - 264 + 4) | 0x80000000) lw $t1, %lo (((16 << 20) - 264 + 4) | 0x80000000) ($t0) @@ -74,7 +74,7 @@ codestart: 2: #endif -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON move $s2, $zero move $s3, $zero move $s4, $zero @@ -110,8 +110,8 @@ argcont: DO_PARSE (cpuclockstr, $s3) DO_PARSE (memsizestr, $s4) DO_PARSE (highmemsizestr, $s5) - DO_CHECKT1 (pmon_yeeloong_verstr, GRUB_ARCH_MACHINE_YEELOONG) - DO_CHECKT1 (pmon_fuloong2f_verstr, GRUB_ARCH_MACHINE_FULOONG2F) + DO_CHECKT1 (pmon_yeeloong_verstr, VasEBoot_ARCH_MACHINE_YEELOONG) + DO_CHECKT1 (pmon_fuloong2f_verstr, VasEBoot_ARCH_MACHINE_FULOONG2F) 2: b argcont addiu $t0, $t0, 4 @@ -119,32 +119,32 @@ parsestr: move $v0, $zero move $t3, $t1 3: - lb GRUB_ASM_T4, 0($t2) - lb GRUB_ASM_T5, 0($t3) + lb VasEBoot_ASM_T4, 0($t2) + lb VasEBoot_ASM_T5, 0($t3) addiu $t2, $t2, 1 addiu $t3, $t3, 1 - beq GRUB_ASM_T5, $zero, 1f + beq VasEBoot_ASM_T5, $zero, 1f nop - beq GRUB_ASM_T5, GRUB_ASM_T4, 3b + beq VasEBoot_ASM_T5, VasEBoot_ASM_T4, 3b nop - bne GRUB_ASM_T4, $zero, 1f + bne VasEBoot_ASM_T4, $zero, 1f nop addiu $t3, $t3, 0xffff digcont: - lb GRUB_ASM_T5, 0($t3) + lb VasEBoot_ASM_T5, 0($t3) /* Substract '0' from digit. */ - addiu GRUB_ASM_T5, GRUB_ASM_T5, 0xffd0 - bltz GRUB_ASM_T5, 1f + addiu VasEBoot_ASM_T5, VasEBoot_ASM_T5, 0xffd0 + bltz VasEBoot_ASM_T5, 1f nop - addiu GRUB_ASM_T4, GRUB_ASM_T5, 0xfff7 - bgtz GRUB_ASM_T4, 1f + addiu VasEBoot_ASM_T4, VasEBoot_ASM_T5, 0xfff7 + bgtz VasEBoot_ASM_T4, 1f nop /* Multiply $v0 by 10 with bitshifts. */ sll $v0, $v0, 1 - sll GRUB_ASM_T4, $v0, 2 - addu $v0, $v0, GRUB_ASM_T4 - addu $v0, $v0, GRUB_ASM_T5 + sll VasEBoot_ASM_T4, $v0, 2 + addu $v0, $v0, VasEBoot_ASM_T4 + addu $v0, $v0, VasEBoot_ASM_T5 addiu $t3, $t3, 1 b digcont nop @@ -173,20 +173,20 @@ argdone: addiu $t7, $s0, (str - base);\ bal do_check ;\ li $t2, val - DO_CHECKA1 (machtype_yeeloong_str1, GRUB_ARCH_MACHINE_YEELOONG) - DO_CHECKA1 (machtype_yeeloong_str2, GRUB_ARCH_MACHINE_YEELOONG) - DO_CHECKA1 (pmon_yeeloong_str, GRUB_ARCH_MACHINE_YEELOONG) - DO_CHECKA1 (machtype_fuloong2f_str, GRUB_ARCH_MACHINE_FULOONG2F) - DO_CHECKA1 (machtype_fuloong2e_str, GRUB_ARCH_MACHINE_FULOONG2E) - DO_CHECKA1 (pmon_fuloong2f_str, GRUB_ARCH_MACHINE_FULOONG2F) + DO_CHECKA1 (machtype_yeeloong_str1, VasEBoot_ARCH_MACHINE_YEELOONG) + DO_CHECKA1 (machtype_yeeloong_str2, VasEBoot_ARCH_MACHINE_YEELOONG) + DO_CHECKA1 (pmon_yeeloong_str, VasEBoot_ARCH_MACHINE_YEELOONG) + DO_CHECKA1 (machtype_fuloong2f_str, VasEBoot_ARCH_MACHINE_FULOONG2F) + DO_CHECKA1 (machtype_fuloong2e_str, VasEBoot_ARCH_MACHINE_FULOONG2E) + DO_CHECKA1 (pmon_fuloong2f_str, VasEBoot_ARCH_MACHINE_FULOONG2F) addiu $a0, $a0, -1 b argdone addiu $a1, $a1, 4 do_check: - lb GRUB_ASM_T4, 0($t7) - beq GRUB_ASM_T4, $zero, 1f + lb VasEBoot_ASM_T4, 0($t7) + beq VasEBoot_ASM_T4, $zero, 1f lb $t3, 0($t6) - bne $t3, GRUB_ASM_T4, 2f + bne $t3, VasEBoot_ASM_T4, 2f addiu $t6, $t6, 1 b do_check addiu $t7, $t7, 1 @@ -199,7 +199,7 @@ argfw: not $s7, $a2 cmdlinedone: #endif -#ifdef GRUB_MACHINE_ARC +#ifdef VasEBoot_MACHINE_ARC lui $t0, %hi(_start - 256) addiu $t0, $t0, %lo(_start - 256) addiu $t3, $t0, 255 @@ -223,8 +223,8 @@ cmdlinedone: 1: beq $t1, $t3, 2f - lb GRUB_ASM_T4, 0($t2) - sb GRUB_ASM_T4, 0($t1) + lb VasEBoot_ASM_T4, 0($t2) + sb VasEBoot_ASM_T4, 0($t1) addiu $t1, $t1, 1 b 1b addiu $t2, $t2, 1 @@ -258,9 +258,9 @@ cmdlinedone: subu $a0, $a0, $t0 addu $a0, $a0, $s0 - lw $a1, (GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR - BASE_ADDR)($s0) - lw $a2, (GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE - BASE_ADDR)($s0) - lw $a3, (GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE - BASE_ADDR)($s0) + lw $a1, (VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR - BASE_ADDR)($s0) + lw $a2, (VasEBoot_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE - BASE_ADDR)($s0) + lw $a3, (VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE - BASE_ADDR)($s0) move $s1, $a1 /* $a0 contains source compressed address, $a1 is destination, @@ -268,10 +268,10 @@ cmdlinedone: */ move $s6, $a3 - lui $t9, %hi(EXT_C(grub_decompress_core)) - addiu $t9, $t9, %lo(EXT_C(grub_decompress_core)) + lui $t9, %hi(EXT_C(VasEBoot_decompress_core)) + addiu $t9, $t9, %lo(EXT_C(VasEBoot_decompress_core)) -#ifdef GRUB_MACHINE_ARC +#ifdef VasEBoot_MACHINE_ARC lui $sp, %hi(_start - 512) jalr $t9 addiu $sp, $sp, %lo(_start - 512) @@ -285,8 +285,8 @@ cmdlinedone: #include "../../kern/mips/cache_flush.S" - lui $t1, %hi(GRUB_MACHINE_LINK_ADDR) - addiu $t1, %lo(GRUB_MACHINE_LINK_ADDR) + lui $t1, %hi(VasEBoot_MACHINE_LINK_ADDR) + addiu $t1, %lo(VasEBoot_MACHINE_LINK_ADDR) jr $t1 nop diff --git a/VasEBoot-core/boot/powerpc/VasEBoot.chrp.in b/VasEBoot-core/boot/powerpc/VasEBoot.chrp.in index 9b2218352..b82540a50 100644 --- a/VasEBoot-core/boot/powerpc/VasEBoot.chrp.in +++ b/VasEBoot-core/boot/powerpc/VasEBoot.chrp.in @@ -167,6 +167,6 @@ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -boot &device;:&partition;,\System\Library\CoreServices\grub.elf +boot &device;:&partition;,\System\Library\CoreServices\VasEBoot.elf diff --git a/VasEBoot-core/boot/powerpc/bootinfo.txt.in b/VasEBoot-core/boot/powerpc/bootinfo.txt.in index bc831daa9..413cbefd8 100644 --- a/VasEBoot-core/boot/powerpc/bootinfo.txt.in +++ b/VasEBoot-core/boot/powerpc/bootinfo.txt.in @@ -1,7 +1,7 @@ @PACKAGE@ @VERSION@ @PACKAGE@ @VERSION@ -boot &device;:\boot\grub\powerpc.elf +boot &device;:\boot\VasEBoot\powerpc.elf FF FF FF FF FF FF FF FF FF FF 92 6D 6D 6D 6D 6D 6D 6D 6D 6D DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 92 6D 92 92 92 DB FF FF FF FF FF FF FF FF FF FF diff --git a/VasEBoot-core/boot/sparc64/ieee1275/boot.S b/VasEBoot-core/boot/sparc64/ieee1275/boot.S index 586efb401..0b2266829 100644 --- a/VasEBoot-core/boot/sparc64/ieee1275/boot.S +++ b/VasEBoot-core/boot/sparc64/ieee1275/boot.S @@ -1,23 +1,23 @@ /* -*-Asm-*- */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .text .align 4 @@ -30,32 +30,32 @@ pic_base: #ifndef CDBOOT /* The offsets to these locations are defined by the - * GRUB_BOOT_MACHINE_foo macros in include/grub/sparc/ieee1275/boot.h, - * and grub-setup uses this to patch these next three values as needed. + * VasEBoot_BOOT_MACHINE_foo macros in include/VasEBoot/sparc/ieee1275/boot.h, + * and VasEBoot-setup uses this to patch these next three values as needed. * * The boot_path will be the OF device path of the partition where the - * rest of the GRUB kernel image resides. kernel_sector will be set to - * the location of the first block of the GRUB kernel, and + * rest of the VasEBoot kernel image resides. kernel_sector will be set to + * the location of the first block of the VasEBoot kernel, and * kernel_address is the location where we should load that first block. * * After loading in that block we will execute it by jumping to the * load address plus the size of the prepended A.OUT header (32 bytes). */ - .org GRUB_BOOT_MACHINE_BOOT_DEVPATH + .org VasEBoot_BOOT_MACHINE_BOOT_DEVPATH boot_path: - .org GRUB_BOOT_MACHINE_KERNEL_BYTE + .org VasEBoot_BOOT_MACHINE_KERNEL_BYTE boot_path_end: kernel_byte: .xword (2 << 9) -kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR +kernel_address: .word VasEBoot_BOOT_MACHINE_KERNEL_ADDR #else #define boot_path (_start + 512 + SCRATCH_PAD_BOOT_SIZE) #define boot_path_end (_start + 1024) -#include +#include .org 8 kernel_byte: .xword (2 << 9) kernel_size: .word 512 -kernel_address: .word GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS +kernel_address: .word VasEBoot_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS #endif prom_finddev_name: .asciz "finddevice" @@ -68,8 +68,8 @@ prom_open_name: .asciz "open" prom_seek_name: .asciz "seek" prom_read_name: .asciz "read" prom_exit_name: .asciz "exit" -grub_name: .asciz "GRUB " -#define GRUB_NAME_LEN 5 +VasEBoot_name: .asciz "VasEBoot " +#define VasEBoot_NAME_LEN 5 .align 4 @@ -167,10 +167,10 @@ boot_continue: lduw [%l1 + 256], STDOUT_NODE_REG brz,pn STDOUT_NODE_REG, prom_error - /* write(stdout_node, "GRUB ", strlen("GRUB ")) */ - GET_ABS(grub_name, %o2) + /* write(stdout_node, "VasEBoot ", strlen("VasEBoot ")) */ + GET_ABS(VasEBoot_name, %o2) call console_write - mov GRUB_NAME_LEN, %o3 + mov VasEBoot_NAME_LEN, %o3 GET_ABS(boot_path, %o3) #ifndef CDBOOT @@ -186,7 +186,7 @@ boot_continue: bootpath_known: /* Open up the boot_path, and use that handle to read the - * first block of the GRUB kernel image. + * first block of the VasEBoot kernel image. * * bootdev_handle = open(boot_path) */ @@ -224,7 +224,7 @@ bootpath_known: #else nop #endif - .org GRUB_BOOT_MACHINE_CODE_END + .org VasEBoot_BOOT_MACHINE_CODE_END /* the last 4 bytes in the sector 0 contain the signature */ - .word GRUB_BOOT_MACHINE_SIGNATURE + .word VasEBoot_BOOT_MACHINE_SIGNATURE diff --git a/VasEBoot-core/boot/sparc64/ieee1275/diskboot.S b/VasEBoot-core/boot/sparc64/ieee1275/diskboot.S index 35e02c1b6..db0b79a90 100644 --- a/VasEBoot-core/boot/sparc64/ieee1275/diskboot.S +++ b/VasEBoot-core/boot/sparc64/ieee1275/diskboot.S @@ -1,24 +1,24 @@ /* -*-Asm-*- */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .text .align 4 @@ -87,8 +87,8 @@ after_info_block: call console_write mov NOTIFICATION_STRING_LEN, %o3 - GET_ABS(firstlist - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE, %l2) - set GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS, %l3 + GET_ABS(firstlist - VasEBoot_BOOT_SPARC64_IEEE1275_LIST_SIZE, %l2) + set VasEBoot_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS, %l3 bootloop: lduw [%l2 + 0x08], %o0 brz %o0, bootit @@ -115,7 +115,7 @@ bootloop: mov NOTIFICATION_STEP_LEN, %o3 ba bootloop - sub %l2, GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE, %l2 + sub %l2, VasEBoot_BOOT_SPARC64_IEEE1275_LIST_SIZE, %l2 bootit: GET_ABS(prom_close_name, %o0) @@ -127,8 +127,8 @@ bootit: GET_ABS(notification_done, %o2) call console_write mov NOTIFICATION_DONE_LEN, %o3 - sethi %hi(GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS), %o2 - jmpl %o2 + %lo(GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS), %o7 + sethi %hi(VasEBoot_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS), %o2 + jmpl %o2 + %lo(VasEBoot_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS), %o7 mov CIF_REG, %o4 1: ba,a 1b @@ -136,7 +136,7 @@ lastlist: .word 0 .word 0 - .org (0x200 - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE) + .org (0x200 - VasEBoot_BOOT_SPARC64_IEEE1275_LIST_SIZE) blocklist_default_start: .word 0 .word 2 diff --git a/VasEBoot-core/bus/bonito.c b/VasEBoot-core/bus/bonito.c index 9a63f073c..fd258f2dc 100644 --- a/VasEBoot-core/bus/bonito.c +++ b/VasEBoot-core/bus/bonito.c @@ -1,90 +1,90 @@ /* bonito.c - PCI bonito interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -static grub_uint32_t base_win[GRUB_MACHINE_PCI_NUM_WIN]; -static const grub_size_t sizes_win[GRUB_MACHINE_PCI_NUM_WIN] = - {GRUB_MACHINE_PCI_WIN1_SIZE, GRUB_MACHINE_PCI_WIN_SIZE, - GRUB_MACHINE_PCI_WIN_SIZE}; +static VasEBoot_uint32_t base_win[VasEBoot_MACHINE_PCI_NUM_WIN]; +static const VasEBoot_size_t sizes_win[VasEBoot_MACHINE_PCI_NUM_WIN] = + {VasEBoot_MACHINE_PCI_WIN1_SIZE, VasEBoot_MACHINE_PCI_WIN_SIZE, + VasEBoot_MACHINE_PCI_WIN_SIZE}; /* Usage counters. */ -static int usage_win[GRUB_MACHINE_PCI_NUM_WIN]; -static grub_addr_t addr_win[GRUB_MACHINE_PCI_NUM_WIN] = - {GRUB_MACHINE_PCI_WIN1_ADDR, GRUB_MACHINE_PCI_WIN2_ADDR, - GRUB_MACHINE_PCI_WIN3_ADDR}; +static int usage_win[VasEBoot_MACHINE_PCI_NUM_WIN]; +static VasEBoot_addr_t addr_win[VasEBoot_MACHINE_PCI_NUM_WIN] = + {VasEBoot_MACHINE_PCI_WIN1_ADDR, VasEBoot_MACHINE_PCI_WIN2_ADDR, + VasEBoot_MACHINE_PCI_WIN3_ADDR}; -grub_bonito_type_t grub_bonito_type; +VasEBoot_bonito_type_t VasEBoot_bonito_type; static volatile void * -config_addr (grub_pci_address_t addr) +config_addr (VasEBoot_pci_address_t addr) { - if (grub_bonito_type == GRUB_BONITO_2F) + if (VasEBoot_bonito_type == VasEBoot_BONITO_2F) { - GRUB_MACHINE_PCI_CONF_CTRL_REG_2F = 1 << ((addr >> 11) & 0xf); - return (volatile void *) (GRUB_MACHINE_PCI_CONFSPACE_2F + VasEBoot_MACHINE_PCI_CONF_CTRL_REG_2F = 1 << ((addr >> 11) & 0xf); + return (volatile void *) (VasEBoot_MACHINE_PCI_CONFSPACE_2F | (addr & 0x07ff)); } else { if (addr >> 16) - return (volatile void *) (GRUB_MACHINE_PCI_CONFSPACE_3A_EXT | addr); + return (volatile void *) (VasEBoot_MACHINE_PCI_CONFSPACE_3A_EXT | addr); else - return (volatile void *) (GRUB_MACHINE_PCI_CONFSPACE_3A | addr); + return (volatile void *) (VasEBoot_MACHINE_PCI_CONFSPACE_3A | addr); } } -grub_uint32_t -grub_pci_read (grub_pci_address_t addr) +VasEBoot_uint32_t +VasEBoot_pci_read (VasEBoot_pci_address_t addr) { - return *(volatile grub_uint32_t *) config_addr (addr); + return *(volatile VasEBoot_uint32_t *) config_addr (addr); } -grub_uint16_t -grub_pci_read_word (grub_pci_address_t addr) +VasEBoot_uint16_t +VasEBoot_pci_read_word (VasEBoot_pci_address_t addr) { - return *(volatile grub_uint16_t *) config_addr (addr); + return *(volatile VasEBoot_uint16_t *) config_addr (addr); } -grub_uint8_t -grub_pci_read_byte (grub_pci_address_t addr) +VasEBoot_uint8_t +VasEBoot_pci_read_byte (VasEBoot_pci_address_t addr) { - return *(volatile grub_uint8_t *) config_addr (addr); + return *(volatile VasEBoot_uint8_t *) config_addr (addr); } void -grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) +VasEBoot_pci_write (VasEBoot_pci_address_t addr, VasEBoot_uint32_t data) { - *(volatile grub_uint32_t *) config_addr (addr) = data; + *(volatile VasEBoot_uint32_t *) config_addr (addr) = data; } void -grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) +VasEBoot_pci_write_word (VasEBoot_pci_address_t addr, VasEBoot_uint16_t data) { - *(volatile grub_uint16_t *) config_addr (addr) = data; + *(volatile VasEBoot_uint16_t *) config_addr (addr) = data; } void -grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) +VasEBoot_pci_write_byte (VasEBoot_pci_address_t addr, VasEBoot_uint8_t data) { - *(volatile grub_uint8_t *) config_addr (addr) = data; + *(volatile VasEBoot_uint8_t *) config_addr (addr) = data; } @@ -92,35 +92,35 @@ static inline void write_bases_2f (void) { int i; - grub_uint32_t reg = 0; - for (i = 0; i < GRUB_MACHINE_PCI_NUM_WIN; i++) - reg |= (((base_win[i] >> GRUB_MACHINE_PCI_WIN_SHIFT) - & GRUB_MACHINE_PCI_WIN_MASK) - << (i * GRUB_MACHINE_PCI_WIN_MASK_SIZE)); - GRUB_MACHINE_PCI_IO_CTRL_REG_2F = reg; + VasEBoot_uint32_t reg = 0; + for (i = 0; i < VasEBoot_MACHINE_PCI_NUM_WIN; i++) + reg |= (((base_win[i] >> VasEBoot_MACHINE_PCI_WIN_SHIFT) + & VasEBoot_MACHINE_PCI_WIN_MASK) + << (i * VasEBoot_MACHINE_PCI_WIN_MASK_SIZE)); + VasEBoot_MACHINE_PCI_IO_CTRL_REG_2F = reg; } volatile void * -grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)), - grub_addr_t base, grub_size_t size) +VasEBoot_pci_device_map_range (VasEBoot_pci_device_t dev __attribute__ ((unused)), + VasEBoot_addr_t base, VasEBoot_size_t size) { - if (grub_bonito_type == GRUB_BONITO_2F) + if (VasEBoot_bonito_type == VasEBoot_BONITO_2F) { int i; - grub_addr_t newbase; + VasEBoot_addr_t newbase; /* First try already used registers. */ - for (i = 0; i < GRUB_MACHINE_PCI_NUM_WIN; i++) + for (i = 0; i < VasEBoot_MACHINE_PCI_NUM_WIN; i++) if (usage_win[i] && base_win[i] <= base && base_win[i] + sizes_win[i] > base + size) { usage_win[i]++; return (void *) - (addr_win[i] | (base & GRUB_MACHINE_PCI_WIN_OFFSET_MASK)); + (addr_win[i] | (base & VasEBoot_MACHINE_PCI_WIN_OFFSET_MASK)); } /* Map new register. */ - newbase = base & ~GRUB_MACHINE_PCI_WIN_OFFSET_MASK; - for (i = 0; i < GRUB_MACHINE_PCI_NUM_WIN; i++) + newbase = base & ~VasEBoot_MACHINE_PCI_WIN_OFFSET_MASK; + for (i = 0; i < VasEBoot_MACHINE_PCI_NUM_WIN; i++) if (!usage_win[i] && newbase <= base && newbase + sizes_win[i] > base + size) { @@ -128,9 +128,9 @@ grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)), base_win[i] = newbase; write_bases_2f (); return (void *) - (addr_win[i] | (base & GRUB_MACHINE_PCI_WIN_OFFSET_MASK)); + (addr_win[i] | (base & VasEBoot_MACHINE_PCI_WIN_OFFSET_MASK)); } - grub_fatal ("Out of PCI windows."); + VasEBoot_fatal ("Out of PCI windows."); } else { @@ -142,35 +142,35 @@ grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)), && base + size <= 0x1f000000) region = 2; if (region == 0) - grub_fatal ("Attempt to map out of regions"); + VasEBoot_fatal ("Attempt to map out of regions"); return (void *) (0xa0000000 | base); } } void * -grub_pci_device_map_range_cached (grub_pci_device_t dev, - grub_addr_t base, grub_size_t size) +VasEBoot_pci_device_map_range_cached (VasEBoot_pci_device_t dev, + VasEBoot_addr_t base, VasEBoot_size_t size) { - return (void *) (((grub_addr_t) grub_pci_device_map_range (dev, base, size)) + return (void *) (((VasEBoot_addr_t) VasEBoot_pci_device_map_range (dev, base, size)) & ~0x20000000); } void -grub_pci_device_unmap_range (grub_pci_device_t dev __attribute__ ((unused)), +VasEBoot_pci_device_unmap_range (VasEBoot_pci_device_t dev __attribute__ ((unused)), volatile void *mem, - grub_size_t size __attribute__ ((unused))) + VasEBoot_size_t size __attribute__ ((unused))) { - if (grub_bonito_type == GRUB_BONITO_2F) + if (VasEBoot_bonito_type == VasEBoot_BONITO_2F) { int i; - for (i = 0; i < GRUB_MACHINE_PCI_NUM_WIN; i++) + for (i = 0; i < VasEBoot_MACHINE_PCI_NUM_WIN; i++) if (usage_win[i] && addr_win[i] - == (((grub_addr_t) mem | 0x20000000) - & ~GRUB_MACHINE_PCI_WIN_OFFSET_MASK)) + == (((VasEBoot_addr_t) mem | 0x20000000) + & ~VasEBoot_MACHINE_PCI_WIN_OFFSET_MASK)) { usage_win[i]--; return; } - grub_fatal ("Tried to unmap not mapped region"); + VasEBoot_fatal ("Tried to unmap not mapped region"); } } diff --git a/VasEBoot-core/bus/cs5536.c b/VasEBoot-core/bus/cs5536.c index bb9aa27e5..fd8d8c365 100644 --- a/VasEBoot-core/bus/cs5536.c +++ b/VasEBoot-core/bus/cs5536.c @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#ifdef GRUB_MACHINE_MIPS_LOONGSON -#include +#include +#include +#include +#include +#include +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON +#include #endif -#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -/* Context for grub_cs5536_find. */ -struct grub_cs5536_find_ctx +/* Context for VasEBoot_cs5536_find. */ +struct VasEBoot_cs5536_find_ctx { - grub_pci_device_t *devp; + VasEBoot_pci_device_t *devp; int found; }; -/* Helper for grub_cs5536_find. */ +/* Helper for VasEBoot_cs5536_find. */ static int -grub_cs5536_find_iter (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +VasEBoot_cs5536_find_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { - struct grub_cs5536_find_ctx *ctx = data; + struct VasEBoot_cs5536_find_ctx *ctx = data; - if (pciid == GRUB_CS5536_PCIID) + if (pciid == VasEBoot_CS5536_PCIID) { *ctx->devp = dev; ctx->found = 1; @@ -52,330 +52,330 @@ grub_cs5536_find_iter (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) } int -grub_cs5536_find (grub_pci_device_t *devp) +VasEBoot_cs5536_find (VasEBoot_pci_device_t *devp) { - struct grub_cs5536_find_ctx ctx = { + struct VasEBoot_cs5536_find_ctx ctx = { .devp = devp, .found = 0 }; - grub_pci_iterate (grub_cs5536_find_iter, &ctx); + VasEBoot_pci_iterate (VasEBoot_cs5536_find_iter, &ctx); return ctx.found; } -grub_uint64_t -grub_cs5536_read_msr (grub_pci_device_t dev, grub_uint32_t addr) +VasEBoot_uint64_t +VasEBoot_cs5536_read_msr (VasEBoot_pci_device_t dev, VasEBoot_uint32_t addr) { - grub_uint64_t ret = 0; - grub_pci_write (grub_pci_make_address (dev, GRUB_CS5536_MSR_MAILBOX_ADDR), + VasEBoot_uint64_t ret = 0; + VasEBoot_pci_write (VasEBoot_pci_make_address (dev, VasEBoot_CS5536_MSR_MAILBOX_ADDR), addr); - ret = (grub_uint64_t) - grub_pci_read (grub_pci_make_address (dev, GRUB_CS5536_MSR_MAILBOX_DATA0)); - ret |= (((grub_uint64_t) - grub_pci_read (grub_pci_make_address (dev, - GRUB_CS5536_MSR_MAILBOX_DATA1))) + ret = (VasEBoot_uint64_t) + VasEBoot_pci_read (VasEBoot_pci_make_address (dev, VasEBoot_CS5536_MSR_MAILBOX_DATA0)); + ret |= (((VasEBoot_uint64_t) + VasEBoot_pci_read (VasEBoot_pci_make_address (dev, + VasEBoot_CS5536_MSR_MAILBOX_DATA1))) << 32); return ret; } void -grub_cs5536_write_msr (grub_pci_device_t dev, grub_uint32_t addr, - grub_uint64_t val) +VasEBoot_cs5536_write_msr (VasEBoot_pci_device_t dev, VasEBoot_uint32_t addr, + VasEBoot_uint64_t val) { - grub_pci_write (grub_pci_make_address (dev, GRUB_CS5536_MSR_MAILBOX_ADDR), + VasEBoot_pci_write (VasEBoot_pci_make_address (dev, VasEBoot_CS5536_MSR_MAILBOX_ADDR), addr); - grub_pci_write (grub_pci_make_address (dev, GRUB_CS5536_MSR_MAILBOX_DATA0), + VasEBoot_pci_write (VasEBoot_pci_make_address (dev, VasEBoot_CS5536_MSR_MAILBOX_DATA0), val & 0xffffffff); - grub_pci_write (grub_pci_make_address (dev, GRUB_CS5536_MSR_MAILBOX_DATA1), + VasEBoot_pci_write (VasEBoot_pci_make_address (dev, VasEBoot_CS5536_MSR_MAILBOX_DATA1), val >> 32); } -grub_err_t -grub_cs5536_smbus_wait (grub_port_t smbbase) +VasEBoot_err_t +VasEBoot_cs5536_smbus_wait (VasEBoot_port_t smbbase) { - grub_uint64_t start = grub_get_time_ms (); + VasEBoot_uint64_t start = VasEBoot_get_time_ms (); while (1) { - grub_uint8_t status; - status = grub_inb (smbbase + GRUB_CS5536_SMB_REG_STATUS); - if (status & GRUB_CS5536_SMB_REG_STATUS_SDAST) - return GRUB_ERR_NONE; - if (status & GRUB_CS5536_SMB_REG_STATUS_BER) - return grub_error (GRUB_ERR_IO, "SM bus error"); - if (status & GRUB_CS5536_SMB_REG_STATUS_NACK) - return grub_error (GRUB_ERR_IO, "NACK received"); - if (grub_get_time_ms () > start + 40) - return grub_error (GRUB_ERR_IO, "SM stalled"); + VasEBoot_uint8_t status; + status = VasEBoot_inb (smbbase + VasEBoot_CS5536_SMB_REG_STATUS); + if (status & VasEBoot_CS5536_SMB_REG_STATUS_SDAST) + return VasEBoot_ERR_NONE; + if (status & VasEBoot_CS5536_SMB_REG_STATUS_BER) + return VasEBoot_error (VasEBoot_ERR_IO, "SM bus error"); + if (status & VasEBoot_CS5536_SMB_REG_STATUS_NACK) + return VasEBoot_error (VasEBoot_ERR_IO, "NACK received"); + if (VasEBoot_get_time_ms () > start + 40) + return VasEBoot_error (VasEBoot_ERR_IO, "SM stalled"); } } -grub_err_t -grub_cs5536_read_spd_byte (grub_port_t smbbase, grub_uint8_t dev, - grub_uint8_t addr, grub_uint8_t *res) +VasEBoot_err_t +VasEBoot_cs5536_read_spd_byte (VasEBoot_port_t smbbase, VasEBoot_uint8_t dev, + VasEBoot_uint8_t addr, VasEBoot_uint8_t *res) { - grub_err_t err; + VasEBoot_err_t err; /* Send START. */ - grub_outb (grub_inb (smbbase + GRUB_CS5536_SMB_REG_CTRL1) - | GRUB_CS5536_SMB_REG_CTRL1_START, - smbbase + GRUB_CS5536_SMB_REG_CTRL1); + VasEBoot_outb (VasEBoot_inb (smbbase + VasEBoot_CS5536_SMB_REG_CTRL1) + | VasEBoot_CS5536_SMB_REG_CTRL1_START, + smbbase + VasEBoot_CS5536_SMB_REG_CTRL1); /* Send device address. */ - err = grub_cs5536_smbus_wait (smbbase); + err = VasEBoot_cs5536_smbus_wait (smbbase); if (err) return err; - grub_outb (dev << 1, smbbase + GRUB_CS5536_SMB_REG_DATA); + VasEBoot_outb (dev << 1, smbbase + VasEBoot_CS5536_SMB_REG_DATA); /* Send ACK. */ - err = grub_cs5536_smbus_wait (smbbase); + err = VasEBoot_cs5536_smbus_wait (smbbase); if (err) return err; - grub_outb (grub_inb (smbbase + GRUB_CS5536_SMB_REG_CTRL1) - | GRUB_CS5536_SMB_REG_CTRL1_ACK, - smbbase + GRUB_CS5536_SMB_REG_CTRL1); + VasEBoot_outb (VasEBoot_inb (smbbase + VasEBoot_CS5536_SMB_REG_CTRL1) + | VasEBoot_CS5536_SMB_REG_CTRL1_ACK, + smbbase + VasEBoot_CS5536_SMB_REG_CTRL1); /* Send byte address. */ - grub_outb (addr, smbbase + GRUB_CS5536_SMB_REG_DATA); + VasEBoot_outb (addr, smbbase + VasEBoot_CS5536_SMB_REG_DATA); /* Send START. */ - err = grub_cs5536_smbus_wait (smbbase); + err = VasEBoot_cs5536_smbus_wait (smbbase); if (err) return err; - grub_outb (grub_inb (smbbase + GRUB_CS5536_SMB_REG_CTRL1) - | GRUB_CS5536_SMB_REG_CTRL1_START, - smbbase + GRUB_CS5536_SMB_REG_CTRL1); + VasEBoot_outb (VasEBoot_inb (smbbase + VasEBoot_CS5536_SMB_REG_CTRL1) + | VasEBoot_CS5536_SMB_REG_CTRL1_START, + smbbase + VasEBoot_CS5536_SMB_REG_CTRL1); /* Send device address. */ - err = grub_cs5536_smbus_wait (smbbase); + err = VasEBoot_cs5536_smbus_wait (smbbase); if (err) return err; - grub_outb ((dev << 1) | 1, smbbase + GRUB_CS5536_SMB_REG_DATA); + VasEBoot_outb ((dev << 1) | 1, smbbase + VasEBoot_CS5536_SMB_REG_DATA); /* Send STOP. */ - err = grub_cs5536_smbus_wait (smbbase); + err = VasEBoot_cs5536_smbus_wait (smbbase); if (err) return err; - grub_outb (grub_inb (smbbase + GRUB_CS5536_SMB_REG_CTRL1) - | GRUB_CS5536_SMB_REG_CTRL1_STOP, - smbbase + GRUB_CS5536_SMB_REG_CTRL1); + VasEBoot_outb (VasEBoot_inb (smbbase + VasEBoot_CS5536_SMB_REG_CTRL1) + | VasEBoot_CS5536_SMB_REG_CTRL1_STOP, + smbbase + VasEBoot_CS5536_SMB_REG_CTRL1); - err = grub_cs5536_smbus_wait (smbbase); + err = VasEBoot_cs5536_smbus_wait (smbbase); if (err) return err; - *res = grub_inb (smbbase + GRUB_CS5536_SMB_REG_DATA); + *res = VasEBoot_inb (smbbase + VasEBoot_CS5536_SMB_REG_DATA); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_cs5536_init_smbus (grub_pci_device_t dev, grub_uint16_t divisor, - grub_port_t *smbbase) +VasEBoot_err_t +VasEBoot_cs5536_init_smbus (VasEBoot_pci_device_t dev, VasEBoot_uint16_t divisor, + VasEBoot_port_t *smbbase) { - grub_uint64_t smbbar; + VasEBoot_uint64_t smbbar; - smbbar = grub_cs5536_read_msr (dev, GRUB_CS5536_MSR_SMB_BAR); + smbbar = VasEBoot_cs5536_read_msr (dev, VasEBoot_CS5536_MSR_SMB_BAR); /* FIXME */ - if (!(smbbar & GRUB_CS5536_LBAR_ENABLE)) - return grub_error(GRUB_ERR_IO, "SMB controller not enabled\n"); - *smbbase = (smbbar & GRUB_CS5536_LBAR_ADDR_MASK) + GRUB_MACHINE_PCI_IO_BASE; + if (!(smbbar & VasEBoot_CS5536_LBAR_ENABLE)) + return VasEBoot_error(VasEBoot_ERR_IO, "SMB controller not enabled\n"); + *smbbase = (smbbar & VasEBoot_CS5536_LBAR_ADDR_MASK) + VasEBoot_MACHINE_PCI_IO_BASE; if (divisor < 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid divisor"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid divisor"); /* Disable SMB. */ - grub_outb (0, *smbbase + GRUB_CS5536_SMB_REG_CTRL2); + VasEBoot_outb (0, *smbbase + VasEBoot_CS5536_SMB_REG_CTRL2); /* Disable interrupts. */ - grub_outb (0, *smbbase + GRUB_CS5536_SMB_REG_CTRL1); + VasEBoot_outb (0, *smbbase + VasEBoot_CS5536_SMB_REG_CTRL1); /* Set as master. */ - grub_outb (GRUB_CS5536_SMB_REG_ADDR_MASTER, - *smbbase + GRUB_CS5536_SMB_REG_ADDR); + VasEBoot_outb (VasEBoot_CS5536_SMB_REG_ADDR_MASTER, + *smbbase + VasEBoot_CS5536_SMB_REG_ADDR); /* Launch. */ - grub_outb (((divisor >> 7) & 0xff), *smbbase + GRUB_CS5536_SMB_REG_CTRL3); - grub_outb (((divisor << 1) & 0xfe) | GRUB_CS5536_SMB_REG_CTRL2_ENABLE, - *smbbase + GRUB_CS5536_SMB_REG_CTRL2); + VasEBoot_outb (((divisor >> 7) & 0xff), *smbbase + VasEBoot_CS5536_SMB_REG_CTRL3); + VasEBoot_outb (((divisor << 1) & 0xfe) | VasEBoot_CS5536_SMB_REG_CTRL2_ENABLE, + *smbbase + VasEBoot_CS5536_SMB_REG_CTRL2); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_cs5536_read_spd (grub_port_t smbbase, grub_uint8_t dev, - struct grub_smbus_spd *res) +VasEBoot_err_t +VasEBoot_cs5536_read_spd (VasEBoot_port_t smbbase, VasEBoot_uint8_t dev, + struct VasEBoot_smbus_spd *res) { - grub_err_t err; - grub_size_t size; - grub_uint8_t b; - grub_size_t ptr; + VasEBoot_err_t err; + VasEBoot_size_t size; + VasEBoot_uint8_t b; + VasEBoot_size_t ptr; - err = grub_cs5536_read_spd_byte (smbbase, dev, 0, &b); + err = VasEBoot_cs5536_read_spd_byte (smbbase, dev, 0, &b); if (err) return err; if (b == 0) - return grub_error (GRUB_ERR_IO, "no SPD found"); + return VasEBoot_error (VasEBoot_ERR_IO, "no SPD found"); size = b; - ((grub_uint8_t *) res)[0] = b; + ((VasEBoot_uint8_t *) res)[0] = b; for (ptr = 1; ptr < size; ptr++) { - err = grub_cs5536_read_spd_byte (smbbase, dev, ptr, - &((grub_uint8_t *) res)[ptr]); + err = VasEBoot_cs5536_read_spd_byte (smbbase, dev, ptr, + &((VasEBoot_uint8_t *) res)[ptr]); if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static inline void -set_io_space (grub_pci_device_t dev, int num, grub_uint16_t start, - grub_uint16_t len) +set_io_space (VasEBoot_pci_device_t dev, int num, VasEBoot_uint16_t start, + VasEBoot_uint16_t len) { - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_GL_REGIONS_START + num, - ((((grub_uint64_t) start + len - 4) - << GRUB_CS5536_MSR_GL_REGION_IO_TOP_SHIFT) - & GRUB_CS5536_MSR_GL_REGION_TOP_MASK) - | (((grub_uint64_t) start - << GRUB_CS5536_MSR_GL_REGION_IO_BASE_SHIFT) - & GRUB_CS5536_MSR_GL_REGION_BASE_MASK) - | GRUB_CS5536_MSR_GL_REGION_IO - | GRUB_CS5536_MSR_GL_REGION_ENABLE); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_GL_REGIONS_START + num, + ((((VasEBoot_uint64_t) start + len - 4) + << VasEBoot_CS5536_MSR_GL_REGION_IO_TOP_SHIFT) + & VasEBoot_CS5536_MSR_GL_REGION_TOP_MASK) + | (((VasEBoot_uint64_t) start + << VasEBoot_CS5536_MSR_GL_REGION_IO_BASE_SHIFT) + & VasEBoot_CS5536_MSR_GL_REGION_BASE_MASK) + | VasEBoot_CS5536_MSR_GL_REGION_IO + | VasEBoot_CS5536_MSR_GL_REGION_ENABLE); } static inline void -set_iod (grub_pci_device_t dev, int num, int dest, int start, int mask) +set_iod (VasEBoot_pci_device_t dev, int num, int dest, int start, int mask) { - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_GL_IOD_START + num, - ((grub_uint64_t) dest << GRUB_CS5536_IOD_DEST_SHIFT) - | (((grub_uint64_t) start & GRUB_CS5536_IOD_ADDR_MASK) - << GRUB_CS5536_IOD_BASE_SHIFT) - | ((mask & GRUB_CS5536_IOD_ADDR_MASK) - << GRUB_CS5536_IOD_MASK_SHIFT)); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_GL_IOD_START + num, + ((VasEBoot_uint64_t) dest << VasEBoot_CS5536_IOD_DEST_SHIFT) + | (((VasEBoot_uint64_t) start & VasEBoot_CS5536_IOD_ADDR_MASK) + << VasEBoot_CS5536_IOD_BASE_SHIFT) + | ((mask & VasEBoot_CS5536_IOD_ADDR_MASK) + << VasEBoot_CS5536_IOD_MASK_SHIFT)); } static inline void -set_p2d (grub_pci_device_t dev, int num, int dest, grub_uint32_t start) +set_p2d (VasEBoot_pci_device_t dev, int num, int dest, VasEBoot_uint32_t start) { - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_GL_P2D_START + num, - (((grub_uint64_t) dest) << GRUB_CS5536_P2D_DEST_SHIFT) - | ((grub_uint64_t) (start >> GRUB_CS5536_P2D_LOG_ALIGN) - << GRUB_CS5536_P2D_BASE_SHIFT) - | (((1 << (32 - GRUB_CS5536_P2D_LOG_ALIGN)) - 1) - << GRUB_CS5536_P2D_MASK_SHIFT)); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_GL_P2D_START + num, + (((VasEBoot_uint64_t) dest) << VasEBoot_CS5536_P2D_DEST_SHIFT) + | ((VasEBoot_uint64_t) (start >> VasEBoot_CS5536_P2D_LOG_ALIGN) + << VasEBoot_CS5536_P2D_BASE_SHIFT) + | (((1 << (32 - VasEBoot_CS5536_P2D_LOG_ALIGN)) - 1) + << VasEBoot_CS5536_P2D_MASK_SHIFT)); } void -grub_cs5536_init_geode (grub_pci_device_t dev) +VasEBoot_cs5536_init_geode (VasEBoot_pci_device_t dev) { /* Enable more BARs. */ - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_IRQ_MAP_BAR, - GRUB_CS5536_LBAR_TURN_ON | GRUB_CS5536_LBAR_IRQ_MAP); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_MFGPT_BAR, - GRUB_CS5536_LBAR_TURN_ON | GRUB_CS5536_LBAR_MFGPT); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_ACPI_BAR, - GRUB_CS5536_LBAR_TURN_ON | GRUB_CS5536_LBAR_ACPI); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_PM_BAR, - GRUB_CS5536_LBAR_TURN_ON | GRUB_CS5536_LBAR_PM); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_IRQ_MAP_BAR, + VasEBoot_CS5536_LBAR_TURN_ON | VasEBoot_CS5536_LBAR_IRQ_MAP); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_MFGPT_BAR, + VasEBoot_CS5536_LBAR_TURN_ON | VasEBoot_CS5536_LBAR_MFGPT); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_ACPI_BAR, + VasEBoot_CS5536_LBAR_TURN_ON | VasEBoot_CS5536_LBAR_ACPI); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_PM_BAR, + VasEBoot_CS5536_LBAR_TURN_ON | VasEBoot_CS5536_LBAR_PM); /* Setup DIVIL. */ -#ifdef GRUB_MACHINE_MIPS_LOONGSON - switch (grub_arch_machine) +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON + switch (VasEBoot_arch_machine) { - case GRUB_ARCH_MACHINE_YEELOONG: - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LEG_IO, - GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 - | GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP - | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 - | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1); + case VasEBoot_ARCH_MACHINE_YEELOONG: + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_DIVIL_LEG_IO, + VasEBoot_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_F_REMAP + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1); break; - case GRUB_ARCH_MACHINE_FULOONG2F: - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LEG_IO, - GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 - | GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 - | GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 - | GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP - | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 - | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1); + case VasEBoot_ARCH_MACHINE_FULOONG2F: + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_DIVIL_LEG_IO, + VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_F_REMAP + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 + | VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1); break; } #endif - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK, - (~GRUB_CS5536_DIVIL_LPC_INTERRUPTS) & 0xffff); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK, - GRUB_CS5536_DIVIL_LPC_INTERRUPTS); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL, - GRUB_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL_ENABLE); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK, + (~VasEBoot_CS5536_DIVIL_LPC_INTERRUPTS) & 0xffff); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK, + VasEBoot_CS5536_DIVIL_LPC_INTERRUPTS); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL, + VasEBoot_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL_ENABLE); /* Initialise USB controller. */ /* FIXME: assign adresses dynamically. */ - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_OHCI_BASE, - GRUB_CS5536_MSR_USB_BASE_BUS_MASTER - | GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_USB_OHCI_BASE, + VasEBoot_CS5536_MSR_USB_BASE_BUS_MASTER + | VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE | 0x05024000); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE, - GRUB_CS5536_MSR_USB_BASE_BUS_MASTER - | GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE - | (0x20ULL << GRUB_CS5536_MSR_USB_EHCI_BASE_FLDJ_SHIFT) + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_USB_EHCI_BASE, + VasEBoot_CS5536_MSR_USB_BASE_BUS_MASTER + | VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE + | (0x20ULL << VasEBoot_CS5536_MSR_USB_EHCI_BASE_FLDJ_SHIFT) | 0x05023000); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_CONTROLLER_BASE, - GRUB_CS5536_MSR_USB_BASE_BUS_MASTER - | GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE | 0x05020000); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_OPTION_CONTROLLER_BASE, - GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE | 0x05022000); - set_p2d (dev, 0, GRUB_CS5536_DESTINATION_USB, 0x05020000); - set_p2d (dev, 1, GRUB_CS5536_DESTINATION_USB, 0x05022000); - set_p2d (dev, 5, GRUB_CS5536_DESTINATION_USB, 0x05024000); - set_p2d (dev, 6, GRUB_CS5536_DESTINATION_USB, 0x05023000); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_USB_CONTROLLER_BASE, + VasEBoot_CS5536_MSR_USB_BASE_BUS_MASTER + | VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE | 0x05020000); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_USB_OPTION_CONTROLLER_BASE, + VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE | 0x05022000); + set_p2d (dev, 0, VasEBoot_CS5536_DESTINATION_USB, 0x05020000); + set_p2d (dev, 1, VasEBoot_CS5536_DESTINATION_USB, 0x05022000); + set_p2d (dev, 5, VasEBoot_CS5536_DESTINATION_USB, 0x05024000); + set_p2d (dev, 6, VasEBoot_CS5536_DESTINATION_USB, 0x05023000); { - volatile grub_uint32_t *oc; - oc = grub_pci_device_map_range (dev, 0x05022000, - GRUB_CS5536_USB_OPTION_REGS_SIZE); + volatile VasEBoot_uint32_t *oc; + oc = VasEBoot_pci_device_map_range (dev, 0x05022000, + VasEBoot_CS5536_USB_OPTION_REGS_SIZE); - oc[GRUB_CS5536_USB_OPTION_REG_UOCMUX] = - (oc[GRUB_CS5536_USB_OPTION_REG_UOCMUX] - & ~GRUB_CS5536_USB_OPTION_REG_UOCMUX_PMUX_MASK) - | GRUB_CS5536_USB_OPTION_REG_UOCMUX_PMUX_HC; - grub_pci_device_unmap_range (dev, oc, GRUB_CS5536_USB_OPTION_REGS_SIZE); + oc[VasEBoot_CS5536_USB_OPTION_REG_UOCMUX] = + (oc[VasEBoot_CS5536_USB_OPTION_REG_UOCMUX] + & ~VasEBoot_CS5536_USB_OPTION_REG_UOCMUX_PMUX_MASK) + | VasEBoot_CS5536_USB_OPTION_REG_UOCMUX_PMUX_HC; + VasEBoot_pci_device_unmap_range (dev, oc, VasEBoot_CS5536_USB_OPTION_REGS_SIZE); } /* Setup IDE controller. */ - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_IDE_IO_BAR, - GRUB_CS5536_LBAR_IDE - | GRUB_CS5536_MSR_IDE_IO_BAR_UNITS); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_IDE_CFG, - GRUB_CS5536_MSR_IDE_CFG_CHANNEL_ENABLE); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_IDE_TIMING, - (GRUB_CS5536_MSR_IDE_TIMING_PIO0 - << GRUB_CS5536_MSR_IDE_TIMING_DRIVE0_SHIFT) - | (GRUB_CS5536_MSR_IDE_TIMING_PIO0 - << GRUB_CS5536_MSR_IDE_TIMING_DRIVE1_SHIFT)); - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_IDE_CAS_TIMING, - (GRUB_CS5536_MSR_IDE_CAS_TIMING_CMD_PIO0 - << GRUB_CS5536_MSR_IDE_CAS_TIMING_CMD_SHIFT) - | (GRUB_CS5536_MSR_IDE_CAS_TIMING_PIO0 - << GRUB_CS5536_MSR_IDE_CAS_TIMING_DRIVE0_SHIFT) - | (GRUB_CS5536_MSR_IDE_CAS_TIMING_PIO0 - << GRUB_CS5536_MSR_IDE_CAS_TIMING_DRIVE1_SHIFT)); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_IDE_IO_BAR, + VasEBoot_CS5536_LBAR_IDE + | VasEBoot_CS5536_MSR_IDE_IO_BAR_UNITS); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_IDE_CFG, + VasEBoot_CS5536_MSR_IDE_CFG_CHANNEL_ENABLE); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_IDE_TIMING, + (VasEBoot_CS5536_MSR_IDE_TIMING_PIO0 + << VasEBoot_CS5536_MSR_IDE_TIMING_DRIVE0_SHIFT) + | (VasEBoot_CS5536_MSR_IDE_TIMING_PIO0 + << VasEBoot_CS5536_MSR_IDE_TIMING_DRIVE1_SHIFT)); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_IDE_CAS_TIMING, + (VasEBoot_CS5536_MSR_IDE_CAS_TIMING_CMD_PIO0 + << VasEBoot_CS5536_MSR_IDE_CAS_TIMING_CMD_SHIFT) + | (VasEBoot_CS5536_MSR_IDE_CAS_TIMING_PIO0 + << VasEBoot_CS5536_MSR_IDE_CAS_TIMING_DRIVE0_SHIFT) + | (VasEBoot_CS5536_MSR_IDE_CAS_TIMING_PIO0 + << VasEBoot_CS5536_MSR_IDE_CAS_TIMING_DRIVE1_SHIFT)); /* Setup Geodelink PCI. */ - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_GL_PCI_CTRL, - (4ULL << GRUB_CS5536_MSR_GL_PCI_CTRL_OUT_THR_SHIFT) - | (4ULL << GRUB_CS5536_MSR_GL_PCI_CTRL_IN_THR_SHIFT) - | (8ULL << GRUB_CS5536_MSR_GL_PCI_CTRL_LATENCY_SHIFT) - | GRUB_CS5536_MSR_GL_PCI_CTRL_IO_ENABLE - | GRUB_CS5536_MSR_GL_PCI_CTRL_MEMORY_ENABLE); + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_GL_PCI_CTRL, + (4ULL << VasEBoot_CS5536_MSR_GL_PCI_CTRL_OUT_THR_SHIFT) + | (4ULL << VasEBoot_CS5536_MSR_GL_PCI_CTRL_IN_THR_SHIFT) + | (8ULL << VasEBoot_CS5536_MSR_GL_PCI_CTRL_LATENCY_SHIFT) + | VasEBoot_CS5536_MSR_GL_PCI_CTRL_IO_ENABLE + | VasEBoot_CS5536_MSR_GL_PCI_CTRL_MEMORY_ENABLE); /* Setup windows. */ - set_io_space (dev, 0, GRUB_CS5536_LBAR_SMBUS, GRUB_CS5536_SMBUS_REGS_SIZE); - set_io_space (dev, 1, GRUB_CS5536_LBAR_GPIO, GRUB_CS5536_GPIO_REGS_SIZE); - set_io_space (dev, 2, GRUB_CS5536_LBAR_MFGPT, GRUB_CS5536_MFGPT_REGS_SIZE); - set_io_space (dev, 3, GRUB_CS5536_LBAR_IRQ_MAP, GRUB_CS5536_IRQ_MAP_REGS_SIZE); - set_io_space (dev, 4, GRUB_CS5536_LBAR_PM, GRUB_CS5536_PM_REGS_SIZE); - set_io_space (dev, 5, GRUB_CS5536_LBAR_ACPI, GRUB_CS5536_ACPI_REGS_SIZE); - set_iod (dev, 0, GRUB_CS5536_DESTINATION_IDE, GRUB_ATA_CH0_PORT1, 0xffff8); - set_iod (dev, 1, GRUB_CS5536_DESTINATION_ACC, GRUB_CS5536_LBAR_ACC, 0xfff80); - set_iod (dev, 2, GRUB_CS5536_DESTINATION_IDE, GRUB_CS5536_LBAR_IDE, 0xffff0); + set_io_space (dev, 0, VasEBoot_CS5536_LBAR_SMBUS, VasEBoot_CS5536_SMBUS_REGS_SIZE); + set_io_space (dev, 1, VasEBoot_CS5536_LBAR_GPIO, VasEBoot_CS5536_GPIO_REGS_SIZE); + set_io_space (dev, 2, VasEBoot_CS5536_LBAR_MFGPT, VasEBoot_CS5536_MFGPT_REGS_SIZE); + set_io_space (dev, 3, VasEBoot_CS5536_LBAR_IRQ_MAP, VasEBoot_CS5536_IRQ_MAP_REGS_SIZE); + set_io_space (dev, 4, VasEBoot_CS5536_LBAR_PM, VasEBoot_CS5536_PM_REGS_SIZE); + set_io_space (dev, 5, VasEBoot_CS5536_LBAR_ACPI, VasEBoot_CS5536_ACPI_REGS_SIZE); + set_iod (dev, 0, VasEBoot_CS5536_DESTINATION_IDE, VasEBoot_ATA_CH0_PORT1, 0xffff8); + set_iod (dev, 1, VasEBoot_CS5536_DESTINATION_ACC, VasEBoot_CS5536_LBAR_ACC, 0xfff80); + set_iod (dev, 2, VasEBoot_CS5536_DESTINATION_IDE, VasEBoot_CS5536_LBAR_IDE, 0xffff0); } diff --git a/VasEBoot-core/bus/emu/pci.c b/VasEBoot-core/bus/emu/pci.c index 267f2622d..f62413793 100644 --- a/VasEBoot-core/bus/emu/pci.c +++ b/VasEBoot-core/bus/emu/pci.c @@ -1,38 +1,38 @@ /* pci.c - Generic PCI interfaces. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -grub_pci_address_t -grub_pci_make_address (grub_pci_device_t dev, int reg) +VasEBoot_pci_address_t +VasEBoot_pci_make_address (VasEBoot_pci_device_t dev, int reg) { - grub_pci_address_t ret; + VasEBoot_pci_address_t ret; ret.dev = dev; ret.pos = reg; return ret; } void -grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data) +VasEBoot_pci_iterate (VasEBoot_pci_iteratefunc_t hook, void *hook_data) { struct pci_device_iterator *iter; struct pci_slot_match slot; @@ -48,31 +48,31 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data) } void * -grub_pci_device_map_range (grub_pci_device_t dev, grub_addr_t base, - grub_size_t size) +VasEBoot_pci_device_map_range (VasEBoot_pci_device_t dev, VasEBoot_addr_t base, + VasEBoot_size_t size) { void *addr; int err; err = pci_device_map_range (dev, base, size, PCI_DEV_MAP_FLAG_WRITABLE, &addr); if (err) - grub_util_error ("mapping 0x%llx failed (error %d)", + VasEBoot_util_error ("mapping 0x%llx failed (error %d)", (unsigned long long) base, err); return addr; } void -grub_pci_device_unmap_range (grub_pci_device_t dev, void *mem, - grub_size_t size) +VasEBoot_pci_device_unmap_range (VasEBoot_pci_device_t dev, void *mem, + VasEBoot_size_t size) { pci_device_unmap_range (dev, mem, size); } -GRUB_MOD_INIT (emupci) +VasEBoot_MOD_INIT (emupci) { pci_system_init (); } -GRUB_MOD_FINI (emupci) +VasEBoot_MOD_FINI (emupci) { pci_system_cleanup (); } diff --git a/VasEBoot-core/bus/i386/ieee1275/pci.c b/VasEBoot-core/bus/i386/ieee1275/pci.c index 1fd3b5610..e6aa24aa2 100644 --- a/VasEBoot-core/bus/i386/ieee1275/pci.c +++ b/VasEBoot-core/bus/i386/ieee1275/pci.c @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include volatile void * -grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)), - grub_addr_t base, - grub_size_t size) +VasEBoot_pci_device_map_range (VasEBoot_pci_device_t dev __attribute__ ((unused)), + VasEBoot_addr_t base, + VasEBoot_size_t size) { - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_REAL_MODE)) return (volatile void *) base; - if (grub_ieee1275_map (base, base, size, 7)) - grub_fatal ("couldn't map 0x%lx", base); + if (VasEBoot_ieee1275_map (base, base, size, 7)) + VasEBoot_fatal ("couldn't map 0x%lx", base); return (volatile void *) base; } void -grub_pci_device_unmap_range (grub_pci_device_t dev __attribute__ ((unused)), +VasEBoot_pci_device_unmap_range (VasEBoot_pci_device_t dev __attribute__ ((unused)), volatile void *mem __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused))) + VasEBoot_size_t size __attribute__ ((unused))) { } diff --git a/VasEBoot-core/bus/pci.c b/VasEBoot-core/bus/pci.c index b388ce5c8..5fcfe8b4e 100644 --- a/VasEBoot-core/bus/pci.c +++ b/VasEBoot-core/bus/pci.c @@ -1,118 +1,118 @@ /* pci.c - Generic PCI interfaces. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* FIXME: correctly support 64-bit architectures. */ -/* #if GRUB_TARGET_SIZEOF_VOID_P == 4 */ -struct grub_pci_dma_chunk * -grub_memalign_dma32 (grub_size_t align, grub_size_t size) +/* #if VasEBoot_TARGET_SIZEOF_VOID_P == 4 */ +struct VasEBoot_pci_dma_chunk * +VasEBoot_memalign_dma32 (VasEBoot_size_t align, VasEBoot_size_t size) { void *ret; if (align < 64) align = 64; size = ALIGN_UP (size, align); - ret = grub_memalign (align, size); -#if GRUB_CPU_SIZEOF_VOID_P == 8 - if ((grub_addr_t) ret >> 32) + ret = VasEBoot_memalign (align, size); +#if VasEBoot_CPU_SIZEOF_VOID_P == 8 + if ((VasEBoot_addr_t) ret >> 32) { /* Shouldn't happend since the only platform in this case is x86_64-efi and it skips any regions > 4GiB because of EFI bugs anyway. */ - grub_error (GRUB_ERR_BUG, "allocation outside 32-bit range"); + VasEBoot_error (VasEBoot_ERR_BUG, "allocation outside 32-bit range"); return 0; } #endif if (!ret) return 0; - grub_arch_sync_dma_caches (ret, size); + VasEBoot_arch_sync_dma_caches (ret, size); return ret; } /* FIXME: evil. */ void -grub_dma_free (struct grub_pci_dma_chunk *ch) +VasEBoot_dma_free (struct VasEBoot_pci_dma_chunk *ch) { - grub_size_t size = (((struct grub_mm_header *) ch) - 1)->size * GRUB_MM_ALIGN; - grub_arch_sync_dma_caches (ch, size); - grub_free (ch); + VasEBoot_size_t size = (((struct VasEBoot_mm_header *) ch) - 1)->size * VasEBoot_MM_ALIGN; + VasEBoot_arch_sync_dma_caches (ch, size); + VasEBoot_free (ch); } /* #endif */ -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON volatile void * -grub_dma_get_virt (struct grub_pci_dma_chunk *ch) +VasEBoot_dma_get_virt (struct VasEBoot_pci_dma_chunk *ch) { - return (void *) ((((grub_uint32_t) ch) & 0x1fffffff) | 0xa0000000); + return (void *) ((((VasEBoot_uint32_t) ch) & 0x1fffffff) | 0xa0000000); } -grub_uint32_t -grub_dma_get_phys (struct grub_pci_dma_chunk *ch) +VasEBoot_uint32_t +VasEBoot_dma_get_phys (struct VasEBoot_pci_dma_chunk *ch) { - return (((grub_uint32_t) ch) & 0x1fffffff) | 0x80000000; + return (((VasEBoot_uint32_t) ch) & 0x1fffffff) | 0x80000000; } #else volatile void * -grub_dma_get_virt (struct grub_pci_dma_chunk *ch) +VasEBoot_dma_get_virt (struct VasEBoot_pci_dma_chunk *ch) { return (void *) ch; } -grub_uint32_t -grub_dma_get_phys (struct grub_pci_dma_chunk *ch) +VasEBoot_uint32_t +VasEBoot_dma_get_phys (struct VasEBoot_pci_dma_chunk *ch) { - return (grub_uint32_t) (grub_addr_t) ch; + return (VasEBoot_uint32_t) (VasEBoot_addr_t) ch; } #endif -grub_pci_address_t -grub_pci_make_address (grub_pci_device_t dev, int reg) +VasEBoot_pci_address_t +VasEBoot_pci_make_address (VasEBoot_pci_device_t dev, int reg) { return (1 << 31) | (dev.bus << 16) | (dev.device << 11) | (dev.function << 8) | reg; } void -grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data) +VasEBoot_pci_iterate (VasEBoot_pci_iteratefunc_t hook, void *hook_data) { - grub_pci_device_t dev; - grub_pci_address_t addr; - grub_pci_id_t id; - grub_uint32_t hdr; + VasEBoot_pci_device_t dev; + VasEBoot_pci_address_t addr; + VasEBoot_pci_id_t id; + VasEBoot_uint32_t hdr; - for (dev.bus = 0; dev.bus < GRUB_PCI_NUM_BUS; dev.bus++) + for (dev.bus = 0; dev.bus < VasEBoot_PCI_NUM_BUS; dev.bus++) { - for (dev.device = 0; dev.device < GRUB_PCI_NUM_DEVICES; dev.device++) + for (dev.device = 0; dev.device < VasEBoot_PCI_NUM_DEVICES; dev.device++) { for (dev.function = 0; dev.function < 8; dev.function++) { - addr = grub_pci_make_address (dev, GRUB_PCI_REG_PCI_ID); - id = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_PCI_ID); + id = VasEBoot_pci_read (addr); /* Check if there is a device present. */ if (id >> 16 == 0xFFFF) @@ -131,8 +131,8 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data) /* Probe only func = 0 if the device if not multifunction */ if (dev.function == 0) { - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CACHELINE); - hdr = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CACHELINE); + hdr = VasEBoot_pci_read (addr); if (!(hdr & 0x800000)) break; } @@ -141,26 +141,26 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data) } } -grub_uint8_t -grub_pci_find_capability (grub_pci_device_t dev, grub_uint8_t cap) +VasEBoot_uint8_t +VasEBoot_pci_find_capability (VasEBoot_pci_device_t dev, VasEBoot_uint8_t cap) { - grub_uint8_t pos = 0x34; + VasEBoot_uint8_t pos = 0x34; int ttl = 48; while (ttl--) { - grub_uint8_t id; - grub_pci_address_t addr; + VasEBoot_uint8_t id; + VasEBoot_pci_address_t addr; - addr = grub_pci_make_address (dev, pos); - pos = grub_pci_read_byte (addr); + addr = VasEBoot_pci_make_address (dev, pos); + pos = VasEBoot_pci_read_byte (addr); if (pos < 0x40) break; pos &= ~3; - addr = grub_pci_make_address (dev, pos); - id = grub_pci_read_byte (addr); + addr = VasEBoot_pci_make_address (dev, pos); + id = VasEBoot_pci_read_byte (addr); if (id == 0xff) break; diff --git a/VasEBoot-core/bus/usb/ehci.c b/VasEBoot-core/bus/usb/ehci.c index 5f4297bb2..3500edc8c 100644 --- a/VasEBoot-core/bus/usb/ehci.c +++ b/VasEBoot-core/bus/usb/ehci.c @@ -1,278 +1,278 @@ /* ehci.c - EHCI Support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -/* This simple GRUB implementation of EHCI driver: +/* This simple VasEBoot implementation of EHCI driver: * - assumes no IRQ * - is not supporting isochronous transfers (iTD, siTD) * - is not supporting interrupt transfers */ -#define GRUB_EHCI_PCI_SBRN_REG 0x60 +#define VasEBoot_EHCI_PCI_SBRN_REG 0x60 /* Capability registers offsets */ enum { - GRUB_EHCI_EHCC_CAPLEN = 0x00, /* byte */ - GRUB_EHCI_EHCC_VERSION = 0x02, /* word */ - GRUB_EHCI_EHCC_SPARAMS = 0x04, /* dword */ - GRUB_EHCI_EHCC_CPARAMS = 0x08, /* dword */ - GRUB_EHCI_EHCC_PROUTE = 0x0c, /* 60 bits */ + VasEBoot_EHCI_EHCC_CAPLEN = 0x00, /* byte */ + VasEBoot_EHCI_EHCC_VERSION = 0x02, /* word */ + VasEBoot_EHCI_EHCC_SPARAMS = 0x04, /* dword */ + VasEBoot_EHCI_EHCC_CPARAMS = 0x08, /* dword */ + VasEBoot_EHCI_EHCC_PROUTE = 0x0c, /* 60 bits */ }; -#define GRUB_EHCI_EECP_MASK (0xff << 8) -#define GRUB_EHCI_EECP_SHIFT 8 +#define VasEBoot_EHCI_EECP_MASK (0xff << 8) +#define VasEBoot_EHCI_EECP_SHIFT 8 -#define GRUB_EHCI_ADDR_MEM_MASK (~0xff) -#define GRUB_EHCI_POINTER_MASK (~0x1f) +#define VasEBoot_EHCI_ADDR_MEM_MASK (~0xff) +#define VasEBoot_EHCI_POINTER_MASK (~0x1f) /* Capability register SPARAMS bits */ enum { - GRUB_EHCI_SPARAMS_N_PORTS = (0xf << 0), - GRUB_EHCI_SPARAMS_PPC = (1 << 4), /* Power port control */ - GRUB_EHCI_SPARAMS_PRR = (1 << 7), /* Port routing rules */ - GRUB_EHCI_SPARAMS_N_PCC = (0xf << 8), /* No of ports per comp. */ - GRUB_EHCI_SPARAMS_NCC = (0xf << 12), /* No of com. controllers */ - GRUB_EHCI_SPARAMS_P_IND = (1 << 16), /* Port indicators present */ - GRUB_EHCI_SPARAMS_DEBUG_P = (0xf << 20) /* Debug port */ + VasEBoot_EHCI_SPARAMS_N_PORTS = (0xf << 0), + VasEBoot_EHCI_SPARAMS_PPC = (1 << 4), /* Power port control */ + VasEBoot_EHCI_SPARAMS_PRR = (1 << 7), /* Port routing rules */ + VasEBoot_EHCI_SPARAMS_N_PCC = (0xf << 8), /* No of ports per comp. */ + VasEBoot_EHCI_SPARAMS_NCC = (0xf << 12), /* No of com. controllers */ + VasEBoot_EHCI_SPARAMS_P_IND = (1 << 16), /* Port indicators present */ + VasEBoot_EHCI_SPARAMS_DEBUG_P = (0xf << 20) /* Debug port */ }; -#define GRUB_EHCI_MAX_N_PORTS 15 /* Max. number of ports */ +#define VasEBoot_EHCI_MAX_N_PORTS 15 /* Max. number of ports */ /* Capability register CPARAMS bits */ enum { - GRUB_EHCI_CPARAMS_64BIT = (1 << 0), - GRUB_EHCI_CPARAMS_PROG_FRAMELIST = (1 << 1), - GRUB_EHCI_CPARAMS_PARK_CAP = (1 << 2) + VasEBoot_EHCI_CPARAMS_64BIT = (1 << 0), + VasEBoot_EHCI_CPARAMS_PROG_FRAMELIST = (1 << 1), + VasEBoot_EHCI_CPARAMS_PARK_CAP = (1 << 2) }; -#define GRUB_EHCI_N_FRAMELIST 1024 -#define GRUB_EHCI_N_QH 256 -#define GRUB_EHCI_N_TD 640 +#define VasEBoot_EHCI_N_FRAMELIST 1024 +#define VasEBoot_EHCI_N_QH 256 +#define VasEBoot_EHCI_N_TD 640 -#define GRUB_EHCI_QH_EMPTY 1 +#define VasEBoot_EHCI_QH_EMPTY 1 /* USBLEGSUP bits and related OS OWNED byte offset */ enum { - GRUB_EHCI_BIOS_OWNED = (1 << 16), - GRUB_EHCI_OS_OWNED = (1 << 24) + VasEBoot_EHCI_BIOS_OWNED = (1 << 16), + VasEBoot_EHCI_OS_OWNED = (1 << 24) }; /* Operational registers offsets */ enum { - GRUB_EHCI_COMMAND = 0x00, - GRUB_EHCI_STATUS = 0x04, - GRUB_EHCI_INTERRUPT = 0x08, - GRUB_EHCI_FRAME_INDEX = 0x0c, - GRUB_EHCI_64BIT_SEL = 0x10, - GRUB_EHCI_FL_BASE = 0x14, - GRUB_EHCI_CUR_AL_ADDR = 0x18, - GRUB_EHCI_CONFIG_FLAG = 0x40, - GRUB_EHCI_PORT_STAT_CMD = 0x44 + VasEBoot_EHCI_COMMAND = 0x00, + VasEBoot_EHCI_STATUS = 0x04, + VasEBoot_EHCI_INTERRUPT = 0x08, + VasEBoot_EHCI_FRAME_INDEX = 0x0c, + VasEBoot_EHCI_64BIT_SEL = 0x10, + VasEBoot_EHCI_FL_BASE = 0x14, + VasEBoot_EHCI_CUR_AL_ADDR = 0x18, + VasEBoot_EHCI_CONFIG_FLAG = 0x40, + VasEBoot_EHCI_PORT_STAT_CMD = 0x44 }; /* Operational register COMMAND bits */ enum { - GRUB_EHCI_CMD_RUNSTOP = (1 << 0), - GRUB_EHCI_CMD_HC_RESET = (1 << 1), - GRUB_EHCI_CMD_FL_SIZE = (3 << 2), - GRUB_EHCI_CMD_PS_ENABL = (1 << 4), - GRUB_EHCI_CMD_AS_ENABL = (1 << 5), - GRUB_EHCI_CMD_AS_ADV_D = (1 << 6), - GRUB_EHCI_CMD_L_HC_RES = (1 << 7), - GRUB_EHCI_CMD_AS_PARKM = (3 << 8), - GRUB_EHCI_CMD_AS_PARKE = (1 << 11), - GRUB_EHCI_CMD_INT_THRS = (0xff << 16) + VasEBoot_EHCI_CMD_RUNSTOP = (1 << 0), + VasEBoot_EHCI_CMD_HC_RESET = (1 << 1), + VasEBoot_EHCI_CMD_FL_SIZE = (3 << 2), + VasEBoot_EHCI_CMD_PS_ENABL = (1 << 4), + VasEBoot_EHCI_CMD_AS_ENABL = (1 << 5), + VasEBoot_EHCI_CMD_AS_ADV_D = (1 << 6), + VasEBoot_EHCI_CMD_L_HC_RES = (1 << 7), + VasEBoot_EHCI_CMD_AS_PARKM = (3 << 8), + VasEBoot_EHCI_CMD_AS_PARKE = (1 << 11), + VasEBoot_EHCI_CMD_INT_THRS = (0xff << 16) }; /* Operational register STATUS bits */ enum { - GRUB_EHCI_ST_INTERRUPT = (1 << 0), - GRUB_EHCI_ST_ERROR_INT = (1 << 1), - GRUB_EHCI_ST_PORT_CHG = (1 << 2), - GRUB_EHCI_ST_FL_ROLLOVR = (1 << 3), - GRUB_EHCI_ST_HS_ERROR = (1 << 4), - GRUB_EHCI_ST_AS_ADVANCE = (1 << 5), - GRUB_EHCI_ST_HC_HALTED = (1 << 12), - GRUB_EHCI_ST_RECLAM = (1 << 13), - GRUB_EHCI_ST_PS_STATUS = (1 << 14), - GRUB_EHCI_ST_AS_STATUS = (1 << 15) + VasEBoot_EHCI_ST_INTERRUPT = (1 << 0), + VasEBoot_EHCI_ST_ERROR_INT = (1 << 1), + VasEBoot_EHCI_ST_PORT_CHG = (1 << 2), + VasEBoot_EHCI_ST_FL_ROLLOVR = (1 << 3), + VasEBoot_EHCI_ST_HS_ERROR = (1 << 4), + VasEBoot_EHCI_ST_AS_ADVANCE = (1 << 5), + VasEBoot_EHCI_ST_HC_HALTED = (1 << 12), + VasEBoot_EHCI_ST_RECLAM = (1 << 13), + VasEBoot_EHCI_ST_PS_STATUS = (1 << 14), + VasEBoot_EHCI_ST_AS_STATUS = (1 << 15) }; /* Operational register PORT_STAT_CMD bits */ enum { - GRUB_EHCI_PORT_CONNECT = (1 << 0), - GRUB_EHCI_PORT_CONNECT_CH = (1 << 1), - GRUB_EHCI_PORT_ENABLED = (1 << 2), - GRUB_EHCI_PORT_ENABLED_CH = (1 << 3), - GRUB_EHCI_PORT_OVERCUR = (1 << 4), - GRUB_EHCI_PORT_OVERCUR_CH = (1 << 5), - GRUB_EHCI_PORT_RESUME = (1 << 6), - GRUB_EHCI_PORT_SUSPEND = (1 << 7), - GRUB_EHCI_PORT_RESET = (1 << 8), - GRUB_EHCI_PORT_LINE_STAT = (3 << 10), - GRUB_EHCI_PORT_POWER = (1 << 12), - GRUB_EHCI_PORT_OWNER = (1 << 13), - GRUB_EHCI_PORT_INDICATOR = (3 << 14), - GRUB_EHCI_PORT_TEST = (0xf << 16), - GRUB_EHCI_PORT_WON_CONN_E = (1 << 20), - GRUB_EHCI_PORT_WON_DISC_E = (1 << 21), - GRUB_EHCI_PORT_WON_OVER_E = (1 << 22), + VasEBoot_EHCI_PORT_CONNECT = (1 << 0), + VasEBoot_EHCI_PORT_CONNECT_CH = (1 << 1), + VasEBoot_EHCI_PORT_ENABLED = (1 << 2), + VasEBoot_EHCI_PORT_ENABLED_CH = (1 << 3), + VasEBoot_EHCI_PORT_OVERCUR = (1 << 4), + VasEBoot_EHCI_PORT_OVERCUR_CH = (1 << 5), + VasEBoot_EHCI_PORT_RESUME = (1 << 6), + VasEBoot_EHCI_PORT_SUSPEND = (1 << 7), + VasEBoot_EHCI_PORT_RESET = (1 << 8), + VasEBoot_EHCI_PORT_LINE_STAT = (3 << 10), + VasEBoot_EHCI_PORT_POWER = (1 << 12), + VasEBoot_EHCI_PORT_OWNER = (1 << 13), + VasEBoot_EHCI_PORT_INDICATOR = (3 << 14), + VasEBoot_EHCI_PORT_TEST = (0xf << 16), + VasEBoot_EHCI_PORT_WON_CONN_E = (1 << 20), + VasEBoot_EHCI_PORT_WON_DISC_E = (1 << 21), + VasEBoot_EHCI_PORT_WON_OVER_E = (1 << 22), - GRUB_EHCI_PORT_LINE_SE0 = (0 << 10), - GRUB_EHCI_PORT_LINE_K = (1 << 10), - GRUB_EHCI_PORT_LINE_J = (2 << 10), - GRUB_EHCI_PORT_LINE_UNDEF = (3 << 10), - GRUB_EHCI_PORT_LINE_LOWSP = GRUB_EHCI_PORT_LINE_K, /* K state means low speed */ - GRUB_EHCI_PORT_WMASK = ~(GRUB_EHCI_PORT_CONNECT_CH - | GRUB_EHCI_PORT_ENABLED_CH - | GRUB_EHCI_PORT_OVERCUR_CH) + VasEBoot_EHCI_PORT_LINE_SE0 = (0 << 10), + VasEBoot_EHCI_PORT_LINE_K = (1 << 10), + VasEBoot_EHCI_PORT_LINE_J = (2 << 10), + VasEBoot_EHCI_PORT_LINE_UNDEF = (3 << 10), + VasEBoot_EHCI_PORT_LINE_LOWSP = VasEBoot_EHCI_PORT_LINE_K, /* K state means low speed */ + VasEBoot_EHCI_PORT_WMASK = ~(VasEBoot_EHCI_PORT_CONNECT_CH + | VasEBoot_EHCI_PORT_ENABLED_CH + | VasEBoot_EHCI_PORT_OVERCUR_CH) }; /* Operational register CONFIGFLAGS bits */ enum { - GRUB_EHCI_CF_EHCI_OWNER = (1 << 0) + VasEBoot_EHCI_CF_EHCI_OWNER = (1 << 0) }; /* Queue Head & Transfer Descriptor constants */ -#define GRUB_EHCI_HPTR_OFF 5 /* Horiz. pointer bit offset */ +#define VasEBoot_EHCI_HPTR_OFF 5 /* Horiz. pointer bit offset */ enum { - GRUB_EHCI_HPTR_TYPE_MASK = (3 << 1), - GRUB_EHCI_HPTR_TYPE_ITD = (0 << 1), - GRUB_EHCI_HPTR_TYPE_QH = (1 << 1), - GRUB_EHCI_HPTR_TYPE_SITD = (2 << 1), - GRUB_EHCI_HPTR_TYPE_FSTN = (3 << 1) + VasEBoot_EHCI_HPTR_TYPE_MASK = (3 << 1), + VasEBoot_EHCI_HPTR_TYPE_ITD = (0 << 1), + VasEBoot_EHCI_HPTR_TYPE_QH = (1 << 1), + VasEBoot_EHCI_HPTR_TYPE_SITD = (2 << 1), + VasEBoot_EHCI_HPTR_TYPE_FSTN = (3 << 1) }; enum { - GRUB_EHCI_C = (1 << 27), - GRUB_EHCI_MAXPLEN_MASK = (0x7ff << 16), - GRUB_EHCI_H = (1 << 15), - GRUB_EHCI_DTC = (1 << 14), - GRUB_EHCI_SPEED_MASK = (3 << 12), - GRUB_EHCI_SPEED_FULL = (0 << 12), - GRUB_EHCI_SPEED_LOW = (1 << 12), - GRUB_EHCI_SPEED_HIGH = (2 << 12), - GRUB_EHCI_SPEED_RESERVED = (3 << 12), - GRUB_EHCI_EP_NUM_MASK = (0xf << 8), - GRUB_EHCI_DEVADDR_MASK = 0x7f, - GRUB_EHCI_TARGET_MASK = (GRUB_EHCI_EP_NUM_MASK | GRUB_EHCI_DEVADDR_MASK) + VasEBoot_EHCI_C = (1 << 27), + VasEBoot_EHCI_MAXPLEN_MASK = (0x7ff << 16), + VasEBoot_EHCI_H = (1 << 15), + VasEBoot_EHCI_DTC = (1 << 14), + VasEBoot_EHCI_SPEED_MASK = (3 << 12), + VasEBoot_EHCI_SPEED_FULL = (0 << 12), + VasEBoot_EHCI_SPEED_LOW = (1 << 12), + VasEBoot_EHCI_SPEED_HIGH = (2 << 12), + VasEBoot_EHCI_SPEED_RESERVED = (3 << 12), + VasEBoot_EHCI_EP_NUM_MASK = (0xf << 8), + VasEBoot_EHCI_DEVADDR_MASK = 0x7f, + VasEBoot_EHCI_TARGET_MASK = (VasEBoot_EHCI_EP_NUM_MASK | VasEBoot_EHCI_DEVADDR_MASK) }; enum { - GRUB_EHCI_MAXPLEN_OFF = 16, - GRUB_EHCI_SPEED_OFF = 12, - GRUB_EHCI_EP_NUM_OFF = 8 + VasEBoot_EHCI_MAXPLEN_OFF = 16, + VasEBoot_EHCI_SPEED_OFF = 12, + VasEBoot_EHCI_EP_NUM_OFF = 8 }; enum { - GRUB_EHCI_MULT_MASK = (3 << 30), - GRUB_EHCI_MULT_RESERVED = (0 << 30), - GRUB_EHCI_MULT_ONE = (1 << 30), - GRUB_EHCI_MULT_TWO = (2 << 30), - GRUB_EHCI_MULT_THREE = (3 << 30), - GRUB_EHCI_DEVPORT_MASK = (0x7f << 23), - GRUB_EHCI_HUBADDR_MASK = (0x7f << 16), - GRUB_EHCI_CMASK_MASK = (0xff << 8), - GRUB_EHCI_SMASK_MASK = (0xff << 0), + VasEBoot_EHCI_MULT_MASK = (3 << 30), + VasEBoot_EHCI_MULT_RESERVED = (0 << 30), + VasEBoot_EHCI_MULT_ONE = (1 << 30), + VasEBoot_EHCI_MULT_TWO = (2 << 30), + VasEBoot_EHCI_MULT_THREE = (3 << 30), + VasEBoot_EHCI_DEVPORT_MASK = (0x7f << 23), + VasEBoot_EHCI_HUBADDR_MASK = (0x7f << 16), + VasEBoot_EHCI_CMASK_MASK = (0xff << 8), + VasEBoot_EHCI_SMASK_MASK = (0xff << 0), }; enum { - GRUB_EHCI_MULT_OFF = 30, - GRUB_EHCI_DEVPORT_OFF = 23, - GRUB_EHCI_HUBADDR_OFF = 16, - GRUB_EHCI_CMASK_OFF = 8, - GRUB_EHCI_SMASK_OFF = 0, + VasEBoot_EHCI_MULT_OFF = 30, + VasEBoot_EHCI_DEVPORT_OFF = 23, + VasEBoot_EHCI_HUBADDR_OFF = 16, + VasEBoot_EHCI_CMASK_OFF = 8, + VasEBoot_EHCI_SMASK_OFF = 0, }; -#define GRUB_EHCI_TERMINATE (1<<0) +#define VasEBoot_EHCI_TERMINATE (1<<0) -#define GRUB_EHCI_TOGGLE (1<<31) +#define VasEBoot_EHCI_TOGGLE (1<<31) enum { - GRUB_EHCI_TOTAL_MASK = (0x7fff << 16), - GRUB_EHCI_CERR_MASK = (3 << 10), - GRUB_EHCI_CERR_0 = (0 << 10), - GRUB_EHCI_CERR_1 = (1 << 10), - GRUB_EHCI_CERR_2 = (2 << 10), - GRUB_EHCI_CERR_3 = (3 << 10), - GRUB_EHCI_PIDCODE_OUT = (0 << 8), - GRUB_EHCI_PIDCODE_IN = (1 << 8), - GRUB_EHCI_PIDCODE_SETUP = (2 << 8), - GRUB_EHCI_STATUS_MASK = 0xff, - GRUB_EHCI_STATUS_ACTIVE = (1 << 7), - GRUB_EHCI_STATUS_HALTED = (1 << 6), - GRUB_EHCI_STATUS_BUFERR = (1 << 5), - GRUB_EHCI_STATUS_BABBLE = (1 << 4), - GRUB_EHCI_STATUS_TRANERR = (1 << 3), - GRUB_EHCI_STATUS_MISSDMF = (1 << 2), - GRUB_EHCI_STATUS_SPLITST = (1 << 1), - GRUB_EHCI_STATUS_PINGERR = (1 << 0) + VasEBoot_EHCI_TOTAL_MASK = (0x7fff << 16), + VasEBoot_EHCI_CERR_MASK = (3 << 10), + VasEBoot_EHCI_CERR_0 = (0 << 10), + VasEBoot_EHCI_CERR_1 = (1 << 10), + VasEBoot_EHCI_CERR_2 = (2 << 10), + VasEBoot_EHCI_CERR_3 = (3 << 10), + VasEBoot_EHCI_PIDCODE_OUT = (0 << 8), + VasEBoot_EHCI_PIDCODE_IN = (1 << 8), + VasEBoot_EHCI_PIDCODE_SETUP = (2 << 8), + VasEBoot_EHCI_STATUS_MASK = 0xff, + VasEBoot_EHCI_STATUS_ACTIVE = (1 << 7), + VasEBoot_EHCI_STATUS_HALTED = (1 << 6), + VasEBoot_EHCI_STATUS_BUFERR = (1 << 5), + VasEBoot_EHCI_STATUS_BABBLE = (1 << 4), + VasEBoot_EHCI_STATUS_TRANERR = (1 << 3), + VasEBoot_EHCI_STATUS_MISSDMF = (1 << 2), + VasEBoot_EHCI_STATUS_SPLITST = (1 << 1), + VasEBoot_EHCI_STATUS_PINGERR = (1 << 0) }; enum { - GRUB_EHCI_TOTAL_OFF = 16, - GRUB_EHCI_CERR_OFF = 10 + VasEBoot_EHCI_TOTAL_OFF = 16, + VasEBoot_EHCI_CERR_OFF = 10 }; -#define GRUB_EHCI_BUFPTR_MASK (0xfffff<<12) -#define GRUB_EHCI_QHTDPTR_MASK 0xffffffe0 +#define VasEBoot_EHCI_BUFPTR_MASK (0xfffff<<12) +#define VasEBoot_EHCI_QHTDPTR_MASK 0xffffffe0 -#define GRUB_EHCI_TD_BUF_PAGES 5 +#define VasEBoot_EHCI_TD_BUF_PAGES 5 -#define GRUB_EHCI_BUFPAGELEN 0x1000 -#define GRUB_EHCI_MAXBUFLEN 0x5000 +#define VasEBoot_EHCI_BUFPAGELEN 0x1000 +#define VasEBoot_EHCI_MAXBUFLEN 0x5000 -struct grub_ehci_td; -struct grub_ehci_qh; -typedef volatile struct grub_ehci_td *grub_ehci_td_t; -typedef volatile struct grub_ehci_qh *grub_ehci_qh_t; +struct VasEBoot_ehci_td; +struct VasEBoot_ehci_qh; +typedef volatile struct VasEBoot_ehci_td *VasEBoot_ehci_td_t; +typedef volatile struct VasEBoot_ehci_qh *VasEBoot_ehci_qh_t; /* EHCI Isochronous Transfer Descriptor */ /* Currently not supported */ @@ -282,19 +282,19 @@ typedef volatile struct grub_ehci_qh *grub_ehci_qh_t; /* EHCI Queue Element Transfer Descriptor (qTD) */ /* Align to 32-byte boundaries */ -struct grub_ehci_td +struct VasEBoot_ehci_td { /* EHCI HW part */ - grub_uint32_t next_td; /* Pointer to next qTD */ - grub_uint32_t alt_next_td; /* Pointer to alternate next qTD */ - grub_uint32_t token; /* Toggle, Len, Interrupt, Page, Error, PID, Status */ - grub_uint32_t buffer_page[GRUB_EHCI_TD_BUF_PAGES]; /* Buffer pointer (+ cur. offset in page 0 */ + VasEBoot_uint32_t next_td; /* Pointer to next qTD */ + VasEBoot_uint32_t alt_next_td; /* Pointer to alternate next qTD */ + VasEBoot_uint32_t token; /* Toggle, Len, Interrupt, Page, Error, PID, Status */ + VasEBoot_uint32_t buffer_page[VasEBoot_EHCI_TD_BUF_PAGES]; /* Buffer pointer (+ cur. offset in page 0 */ /* 64-bits part */ - grub_uint32_t buffer_page_high[GRUB_EHCI_TD_BUF_PAGES]; + VasEBoot_uint32_t buffer_page_high[VasEBoot_EHCI_TD_BUF_PAGES]; /* EHCI driver part */ - grub_uint32_t link_td; /* pointer to next free/chained TD */ - grub_uint32_t size; - grub_uint32_t pad[1]; /* padding to some multiple of 32 bytes */ + VasEBoot_uint32_t link_td; /* pointer to next free/chained TD */ + VasEBoot_uint32_t size; + VasEBoot_uint32_t pad[1]; /* padding to some multiple of 32 bytes */ }; /* EHCI Queue Head */ @@ -302,221 +302,221 @@ struct grub_ehci_td /* QH allocation is made in the similar/same way as in OHCI driver, * because unlninking QH from the Asynchronous list is not so * trivial as on UHCI (at least it is time consuming) */ -struct grub_ehci_qh +struct VasEBoot_ehci_qh { /* EHCI HW part */ - grub_uint32_t qh_hptr; /* Horiz. pointer & Terminate */ - grub_uint32_t ep_char; /* EP characteristics */ - grub_uint32_t ep_cap; /* EP capabilities */ - grub_uint32_t td_current; /* current TD link pointer */ - struct grub_ehci_td td_overlay; /* TD overlay area = 64 bytes */ + VasEBoot_uint32_t qh_hptr; /* Horiz. pointer & Terminate */ + VasEBoot_uint32_t ep_char; /* EP characteristics */ + VasEBoot_uint32_t ep_cap; /* EP capabilities */ + VasEBoot_uint32_t td_current; /* current TD link pointer */ + struct VasEBoot_ehci_td td_overlay; /* TD overlay area = 64 bytes */ /* EHCI driver part */ - grub_uint32_t pad[4]; /* padding to some multiple of 32 bytes */ + VasEBoot_uint32_t pad[4]; /* padding to some multiple of 32 bytes */ }; /* EHCI Periodic Frame Span Traversal Node */ /* Currently not supported */ -struct grub_ehci +struct VasEBoot_ehci { - volatile grub_uint32_t *iobase_ehcc; /* Capability registers */ - volatile grub_uint32_t *iobase; /* Operational registers */ - struct grub_pci_dma_chunk *framelist_chunk; /* Currently not used */ - volatile grub_uint32_t *framelist_virt; - grub_uint32_t framelist_phys; - struct grub_pci_dma_chunk *qh_chunk; /* GRUB_EHCI_N_QH Queue Heads */ - grub_ehci_qh_t qh_virt; - grub_uint32_t qh_phys; - struct grub_pci_dma_chunk *td_chunk; /* GRUB_EHCI_N_TD Transfer Descriptors */ - grub_ehci_td_t td_virt; - grub_uint32_t td_phys; - grub_ehci_td_t tdfree_virt; /* Free Transfer Descriptors */ + volatile VasEBoot_uint32_t *iobase_ehcc; /* Capability registers */ + volatile VasEBoot_uint32_t *iobase; /* Operational registers */ + struct VasEBoot_pci_dma_chunk *framelist_chunk; /* Currently not used */ + volatile VasEBoot_uint32_t *framelist_virt; + VasEBoot_uint32_t framelist_phys; + struct VasEBoot_pci_dma_chunk *qh_chunk; /* VasEBoot_EHCI_N_QH Queue Heads */ + VasEBoot_ehci_qh_t qh_virt; + VasEBoot_uint32_t qh_phys; + struct VasEBoot_pci_dma_chunk *td_chunk; /* VasEBoot_EHCI_N_TD Transfer Descriptors */ + VasEBoot_ehci_td_t td_virt; + VasEBoot_uint32_t td_phys; + VasEBoot_ehci_td_t tdfree_virt; /* Free Transfer Descriptors */ int flag64; - grub_uint32_t reset; /* bits 1-15 are flags if port was reset from connected time or not */ - struct grub_ehci *next; + VasEBoot_uint32_t reset; /* bits 1-15 are flags if port was reset from connected time or not */ + struct VasEBoot_ehci *next; }; -static struct grub_ehci *ehci; +static struct VasEBoot_ehci *ehci; static void -sync_all_caches (struct grub_ehci *e) +sync_all_caches (struct VasEBoot_ehci *e) { if (!e) return; if (e->td_virt) - grub_arch_sync_dma_caches (e->td_virt, sizeof (struct grub_ehci_td) * - GRUB_EHCI_N_TD); + VasEBoot_arch_sync_dma_caches (e->td_virt, sizeof (struct VasEBoot_ehci_td) * + VasEBoot_EHCI_N_TD); if (e->qh_virt) - grub_arch_sync_dma_caches (e->qh_virt, sizeof (struct grub_ehci_qh) * - GRUB_EHCI_N_QH); + VasEBoot_arch_sync_dma_caches (e->qh_virt, sizeof (struct VasEBoot_ehci_qh) * + VasEBoot_EHCI_N_QH); if (e->framelist_virt) - grub_arch_sync_dma_caches (e->framelist_virt, 4096); + VasEBoot_arch_sync_dma_caches (e->framelist_virt, 4096); } /* EHCC registers access functions */ -static inline grub_uint32_t -grub_ehci_ehcc_read32 (struct grub_ehci *e, grub_uint32_t addr) +static inline VasEBoot_uint32_t +VasEBoot_ehci_ehcc_read32 (struct VasEBoot_ehci *e, VasEBoot_uint32_t addr) { return - grub_le_to_cpu32 (*((volatile grub_uint32_t *) e->iobase_ehcc + - (addr / sizeof (grub_uint32_t)))); + VasEBoot_le_to_cpu32 (*((volatile VasEBoot_uint32_t *) e->iobase_ehcc + + (addr / sizeof (VasEBoot_uint32_t)))); } -static inline grub_uint16_t -grub_ehci_ehcc_read16 (struct grub_ehci *e, grub_uint32_t addr) +static inline VasEBoot_uint16_t +VasEBoot_ehci_ehcc_read16 (struct VasEBoot_ehci *e, VasEBoot_uint32_t addr) { return - grub_le_to_cpu16 (*((volatile grub_uint16_t *) e->iobase_ehcc + - (addr / sizeof (grub_uint16_t)))); + VasEBoot_le_to_cpu16 (*((volatile VasEBoot_uint16_t *) e->iobase_ehcc + + (addr / sizeof (VasEBoot_uint16_t)))); } -static inline grub_uint8_t -grub_ehci_ehcc_read8 (struct grub_ehci *e, grub_uint32_t addr) +static inline VasEBoot_uint8_t +VasEBoot_ehci_ehcc_read8 (struct VasEBoot_ehci *e, VasEBoot_uint32_t addr) { - return *((volatile grub_uint8_t *) e->iobase_ehcc + addr); + return *((volatile VasEBoot_uint8_t *) e->iobase_ehcc + addr); } /* Operational registers access functions */ -static inline grub_uint32_t -grub_ehci_oper_read32 (struct grub_ehci *e, grub_uint32_t addr) +static inline VasEBoot_uint32_t +VasEBoot_ehci_oper_read32 (struct VasEBoot_ehci *e, VasEBoot_uint32_t addr) { return - grub_le_to_cpu32 (* - ((volatile grub_uint32_t *) e->iobase + - (addr / sizeof (grub_uint32_t)))); + VasEBoot_le_to_cpu32 (* + ((volatile VasEBoot_uint32_t *) e->iobase + + (addr / sizeof (VasEBoot_uint32_t)))); } static inline void -grub_ehci_oper_write32 (struct grub_ehci *e, grub_uint32_t addr, - grub_uint32_t value) +VasEBoot_ehci_oper_write32 (struct VasEBoot_ehci *e, VasEBoot_uint32_t addr, + VasEBoot_uint32_t value) { - *((volatile grub_uint32_t *) e->iobase + (addr / sizeof (grub_uint32_t))) = - grub_cpu_to_le32 (value); + *((volatile VasEBoot_uint32_t *) e->iobase + (addr / sizeof (VasEBoot_uint32_t))) = + VasEBoot_cpu_to_le32 (value); } -static inline grub_uint32_t -grub_ehci_port_read (struct grub_ehci *e, grub_uint32_t port) +static inline VasEBoot_uint32_t +VasEBoot_ehci_port_read (struct VasEBoot_ehci *e, VasEBoot_uint32_t port) { - return grub_ehci_oper_read32 (e, GRUB_EHCI_PORT_STAT_CMD + port * 4); + return VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_PORT_STAT_CMD + port * 4); } static inline void -grub_ehci_port_resbits (struct grub_ehci *e, grub_uint32_t port, - grub_uint32_t bits) +VasEBoot_ehci_port_resbits (struct VasEBoot_ehci *e, VasEBoot_uint32_t port, + VasEBoot_uint32_t bits) { - grub_ehci_oper_write32 (e, GRUB_EHCI_PORT_STAT_CMD + port * 4, - grub_ehci_port_read (e, - port) & GRUB_EHCI_PORT_WMASK & + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_PORT_STAT_CMD + port * 4, + VasEBoot_ehci_port_read (e, + port) & VasEBoot_EHCI_PORT_WMASK & ~(bits)); - grub_ehci_port_read (e, port); + VasEBoot_ehci_port_read (e, port); } static inline void -grub_ehci_port_setbits (struct grub_ehci *e, grub_uint32_t port, - grub_uint32_t bits) +VasEBoot_ehci_port_setbits (struct VasEBoot_ehci *e, VasEBoot_uint32_t port, + VasEBoot_uint32_t bits) { - grub_ehci_oper_write32 (e, GRUB_EHCI_PORT_STAT_CMD + port * 4, - (grub_ehci_port_read (e, port) & - GRUB_EHCI_PORT_WMASK) | bits); - grub_ehci_port_read (e, port); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_PORT_STAT_CMD + port * 4, + (VasEBoot_ehci_port_read (e, port) & + VasEBoot_EHCI_PORT_WMASK) | bits); + VasEBoot_ehci_port_read (e, port); } /* Halt if EHCI HC not halted */ -static grub_usb_err_t -grub_ehci_halt (struct grub_ehci *e) +static VasEBoot_usb_err_t +VasEBoot_ehci_halt (struct VasEBoot_ehci *e) { - grub_uint64_t maxtime; + VasEBoot_uint64_t maxtime; - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) & GRUB_EHCI_ST_HC_HALTED) == 0) /* EHCI is not halted */ + if ((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) & VasEBoot_EHCI_ST_HC_HALTED) == 0) /* EHCI is not halted */ { /* Halt EHCI */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - ~GRUB_EHCI_CMD_RUNSTOP - & grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + ~VasEBoot_EHCI_CMD_RUNSTOP + & VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Ensure command is written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND); - maxtime = grub_get_time_ms () + 1000; /* Fix: Should be 2ms ! */ - while (((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & GRUB_EHCI_ST_HC_HALTED) == 0) - && (grub_get_time_ms () < maxtime)); - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & GRUB_EHCI_ST_HC_HALTED) == 0) - return GRUB_USB_ERR_TIMEOUT; + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND); + maxtime = VasEBoot_get_time_ms () + 1000; /* Fix: Should be 2ms ! */ + while (((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) + & VasEBoot_EHCI_ST_HC_HALTED) == 0) + && (VasEBoot_get_time_ms () < maxtime)); + if ((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) + & VasEBoot_EHCI_ST_HC_HALTED) == 0) + return VasEBoot_USB_ERR_TIMEOUT; } - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } /* EHCI HC reset */ -static grub_usb_err_t -grub_ehci_reset (struct grub_ehci *e) +static VasEBoot_usb_err_t +VasEBoot_ehci_reset (struct VasEBoot_ehci *e) { - grub_uint64_t maxtime; + VasEBoot_uint64_t maxtime; sync_all_caches (e); - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_HC_RESET - | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_HC_RESET + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Ensure command is written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND); + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND); /* XXX: How long time could take reset of HC ? */ - maxtime = grub_get_time_ms () + 1000; - while (((grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND) - & GRUB_EHCI_CMD_HC_RESET) != 0) - && (grub_get_time_ms () < maxtime)); - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND) - & GRUB_EHCI_CMD_HC_RESET) != 0) - return GRUB_USB_ERR_TIMEOUT; + maxtime = VasEBoot_get_time_ms () + 1000; + while (((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND) + & VasEBoot_EHCI_CMD_HC_RESET) != 0) + && (VasEBoot_get_time_ms () < maxtime)); + if ((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND) + & VasEBoot_EHCI_CMD_HC_RESET) != 0) + return VasEBoot_USB_ERR_TIMEOUT; - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } /* PCI iteration function... */ static int -grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, +VasEBoot_ehci_pci_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_uint8_t release; - grub_uint32_t class_code; - grub_uint32_t interf; - grub_uint32_t subclass; - grub_uint32_t class; - grub_uint32_t base, base_h; - struct grub_ehci *e; - grub_uint32_t eecp_offset; - grub_uint32_t fp; + VasEBoot_uint8_t release; + VasEBoot_uint32_t class_code; + VasEBoot_uint32_t interf; + VasEBoot_uint32_t subclass; + VasEBoot_uint32_t class; + VasEBoot_uint32_t base, base_h; + struct VasEBoot_ehci *e; + VasEBoot_uint32_t eecp_offset; + VasEBoot_uint32_t fp; int i; - grub_uint32_t usblegsup = 0; - grub_uint64_t maxtime; - grub_uint32_t n_ports; - grub_uint8_t caplen; + VasEBoot_uint32_t usblegsup = 0; + VasEBoot_uint64_t maxtime; + VasEBoot_uint32_t n_ports; + VasEBoot_uint8_t caplen; - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: begin\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: begin\n"); - if (pciid == GRUB_CS5536_PCIID) + if (pciid == VasEBoot_CS5536_PCIID) { - grub_uint64_t basereg; + VasEBoot_uint64_t basereg; - basereg = grub_cs5536_read_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE); - if (!(basereg & GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE)) + basereg = VasEBoot_cs5536_read_msr (dev, VasEBoot_CS5536_MSR_USB_EHCI_BASE); + if (!(basereg & VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE)) { /* Shouldn't happen. */ - grub_dprintf ("ehci", "No EHCI address is assigned\n"); + VasEBoot_dprintf ("ehci", "No EHCI address is assigned\n"); return 0; } - base = (basereg & GRUB_CS5536_MSR_USB_BASE_ADDR_MASK); - basereg |= GRUB_CS5536_MSR_USB_BASE_BUS_MASTER; - basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_ENABLED; - basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_STATUS; - basereg &= ~GRUB_CS5536_MSR_USB_BASE_SMI_ENABLE; - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE, basereg); + base = (basereg & VasEBoot_CS5536_MSR_USB_BASE_ADDR_MASK); + basereg |= VasEBoot_CS5536_MSR_USB_BASE_BUS_MASTER; + basereg &= ~VasEBoot_CS5536_MSR_USB_BASE_PME_ENABLED; + basereg &= ~VasEBoot_CS5536_MSR_USB_BASE_PME_STATUS; + basereg &= ~VasEBoot_CS5536_MSR_USB_BASE_SMI_ENABLE; + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_USB_EHCI_BASE, basereg); } else { - grub_pci_address_t addr; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class_code = grub_pci_read (addr) >> 8; + VasEBoot_pci_address_t addr; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class_code = VasEBoot_pci_read (addr) >> 8; interf = class_code & 0xFF; subclass = (class_code >> 8) & 0xFF; class = class_code >> 16; @@ -525,202 +525,202 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, if (class != 0x0c || subclass != 0x03 || interf != 0x20) return 0; - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: class OK\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: class OK\n"); /* Check Serial Bus Release Number */ - addr = grub_pci_make_address (dev, GRUB_EHCI_PCI_SBRN_REG); - release = grub_pci_read_byte (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_EHCI_PCI_SBRN_REG); + release = VasEBoot_pci_read_byte (addr); if (release != 0x20) { - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: Wrong SBRN: %0x\n", + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: Wrong SBRN: %0x\n", release); return 0; } - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: bus rev. num. OK\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: bus rev. num. OK\n"); /* Determine EHCI EHCC registers base address. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - base = grub_pci_read (addr); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG1); - base_h = grub_pci_read (addr); - /* Stop if registers are mapped above 4G - GRUB does not currently + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + base = VasEBoot_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG1); + base_h = VasEBoot_pci_read (addr); + /* Stop if registers are mapped above 4G - VasEBoot does not currently * work with registers mapped above 4G */ - if (((base & GRUB_PCI_ADDR_MEM_TYPE_MASK) != GRUB_PCI_ADDR_MEM_TYPE_32) + if (((base & VasEBoot_PCI_ADDR_MEM_TYPE_MASK) != VasEBoot_PCI_ADDR_MEM_TYPE_32) && (base_h != 0)) { - grub_dprintf ("ehci", - "EHCI grub_ehci_pci_iter: registers above 4G are not supported\n"); + VasEBoot_dprintf ("ehci", + "EHCI VasEBoot_ehci_pci_iter: registers above 4G are not supported\n"); return 0; } - base &= GRUB_PCI_ADDR_MEM_MASK; + base &= VasEBoot_PCI_ADDR_MEM_MASK; if (!base) { - grub_dprintf ("ehci", + VasEBoot_dprintf ("ehci", "EHCI: EHCI is not mapped\n"); return 0; } /* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word(addr, - GRUB_PCI_COMMAND_MEM_ENABLED - | GRUB_PCI_COMMAND_BUS_MASTER - | grub_pci_read_word(addr)); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word(addr, + VasEBoot_PCI_COMMAND_MEM_ENABLED + | VasEBoot_PCI_COMMAND_BUS_MASTER + | VasEBoot_pci_read_word(addr)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: 32-bit EHCI OK\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: 32-bit EHCI OK\n"); } /* Allocate memory for the controller and fill basic values. */ - e = grub_zalloc (sizeof (*e)); + e = VasEBoot_zalloc (sizeof (*e)); if (!e) return 1; e->framelist_chunk = NULL; e->td_chunk = NULL; e->qh_chunk = NULL; - e->iobase_ehcc = grub_pci_device_map_range (dev, - (base & GRUB_EHCI_ADDR_MEM_MASK), + e->iobase_ehcc = VasEBoot_pci_device_map_range (dev, + (base & VasEBoot_EHCI_ADDR_MEM_MASK), 0x100); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: iobase of EHCC: %08x\n", - (base & GRUB_EHCI_ADDR_MEM_MASK)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CAPLEN: %02x\n", - grub_ehci_ehcc_read8 (e, GRUB_EHCI_EHCC_CAPLEN)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: VERSION: %04x\n", - grub_ehci_ehcc_read16 (e, GRUB_EHCI_EHCC_VERSION)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: SPARAMS: %08x\n", - grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_SPARAMS)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CPARAMS: %08x\n", - grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_CPARAMS)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: iobase of EHCC: %08x\n", + (base & VasEBoot_EHCI_ADDR_MEM_MASK)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: CAPLEN: %02x\n", + VasEBoot_ehci_ehcc_read8 (e, VasEBoot_EHCI_EHCC_CAPLEN)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: VERSION: %04x\n", + VasEBoot_ehci_ehcc_read16 (e, VasEBoot_EHCI_EHCC_VERSION)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: SPARAMS: %08x\n", + VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_SPARAMS)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: CPARAMS: %08x\n", + VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_CPARAMS)); /* Determine base address of EHCI operational registers */ - caplen = grub_ehci_ehcc_read8 (e, GRUB_EHCI_EHCC_CAPLEN); -#ifndef GRUB_HAVE_UNALIGNED_ACCESS - if (caplen & (sizeof (grub_uint32_t) - 1)) + caplen = VasEBoot_ehci_ehcc_read8 (e, VasEBoot_EHCI_EHCC_CAPLEN); +#ifndef VasEBoot_HAVE_UNALIGNED_ACCESS + if (caplen & (sizeof (VasEBoot_uint32_t) - 1)) { - grub_dprintf ("ehci", "Unaligned caplen\n"); + VasEBoot_dprintf ("ehci", "Unaligned caplen\n"); return 0; } - e->iobase = ((volatile grub_uint32_t *) e->iobase_ehcc - + (caplen / sizeof (grub_uint32_t))); + e->iobase = ((volatile VasEBoot_uint32_t *) e->iobase_ehcc + + (caplen / sizeof (VasEBoot_uint32_t))); #else - e->iobase = (volatile grub_uint32_t *) - ((grub_uint8_t *) e->iobase_ehcc + caplen); + e->iobase = (volatile VasEBoot_uint32_t *) + ((VasEBoot_uint8_t *) e->iobase_ehcc + caplen); #endif - grub_dprintf ("ehci", - "EHCI grub_ehci_pci_iter: iobase of oper. regs: %08x\n", - (base & GRUB_EHCI_ADDR_MEM_MASK) + caplen); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: COMMAND: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: STATUS: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: INTERRUPT: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_INTERRUPT)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: FRAME_INDEX: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_FRAME_INDEX)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: FL_BASE: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_FL_BASE)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CUR_AL_ADDR: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_CUR_AL_ADDR)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG)); + VasEBoot_dprintf ("ehci", + "EHCI VasEBoot_ehci_pci_iter: iobase of oper. regs: %08x\n", + (base & VasEBoot_EHCI_ADDR_MEM_MASK) + caplen); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: COMMAND: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: STATUS: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: INTERRUPT: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_INTERRUPT)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: FRAME_INDEX: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_FRAME_INDEX)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: FL_BASE: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_FL_BASE)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: CUR_AL_ADDR: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_CUR_AL_ADDR)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: CONFIG_FLAG: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_CONFIG_FLAG)); /* Is there EECP ? */ - eecp_offset = (grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_CPARAMS) - & GRUB_EHCI_EECP_MASK) >> GRUB_EHCI_EECP_SHIFT; + eecp_offset = (VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_CPARAMS) + & VasEBoot_EHCI_EECP_MASK) >> VasEBoot_EHCI_EECP_SHIFT; /* Check format of data structures requested by EHCI */ /* XXX: In fact it is not used at any place, it is prepared for future * This implementation uses 32-bits pointers only */ - e->flag64 = ((grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_CPARAMS) - & GRUB_EHCI_CPARAMS_64BIT) != 0); + e->flag64 = ((VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_CPARAMS) + & VasEBoot_EHCI_CPARAMS_64BIT) != 0); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: flag64=%d\n", e->flag64); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: flag64=%d\n", e->flag64); /* Reserve a page for the frame list - it is accurate for max. * possible size of framelist. But currently it is not used. */ - e->framelist_chunk = grub_memalign_dma32 (4096, 4096); + e->framelist_chunk = VasEBoot_memalign_dma32 (4096, 4096); if (!e->framelist_chunk) goto fail; - e->framelist_virt = grub_dma_get_virt (e->framelist_chunk); - e->framelist_phys = grub_dma_get_phys (e->framelist_chunk); - grub_memset ((void *) e->framelist_virt, 0, 4096); + e->framelist_virt = VasEBoot_dma_get_virt (e->framelist_chunk); + e->framelist_phys = VasEBoot_dma_get_phys (e->framelist_chunk); + VasEBoot_memset ((void *) e->framelist_virt, 0, 4096); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: framelist mem=%p. OK\n", + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: framelist mem=%p. OK\n", e->framelist_virt); /* Allocate memory for the QHs and register it in "e". */ - e->qh_chunk = grub_memalign_dma32 (4096, - sizeof (struct grub_ehci_qh) * - GRUB_EHCI_N_QH); + e->qh_chunk = VasEBoot_memalign_dma32 (4096, + sizeof (struct VasEBoot_ehci_qh) * + VasEBoot_EHCI_N_QH); if (!e->qh_chunk) goto fail; - e->qh_virt = (grub_ehci_qh_t) grub_dma_get_virt (e->qh_chunk); - e->qh_phys = grub_dma_get_phys (e->qh_chunk); - grub_memset ((void *) e->qh_virt, 0, - sizeof (struct grub_ehci_qh) * GRUB_EHCI_N_QH); + e->qh_virt = (VasEBoot_ehci_qh_t) VasEBoot_dma_get_virt (e->qh_chunk); + e->qh_phys = VasEBoot_dma_get_phys (e->qh_chunk); + VasEBoot_memset ((void *) e->qh_virt, 0, + sizeof (struct VasEBoot_ehci_qh) * VasEBoot_EHCI_N_QH); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: QH mem=%p. OK\n", + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: QH mem=%p. OK\n", e->qh_virt); /* Allocate memory for the TDs and register it in "e". */ - e->td_chunk = grub_memalign_dma32 (4096, - sizeof (struct grub_ehci_td) * - GRUB_EHCI_N_TD); + e->td_chunk = VasEBoot_memalign_dma32 (4096, + sizeof (struct VasEBoot_ehci_td) * + VasEBoot_EHCI_N_TD); if (!e->td_chunk) goto fail; - e->td_virt = (grub_ehci_td_t) grub_dma_get_virt (e->td_chunk); - e->td_phys = grub_dma_get_phys (e->td_chunk); - grub_memset ((void *) e->td_virt, 0, - sizeof (struct grub_ehci_td) * GRUB_EHCI_N_TD); + e->td_virt = (VasEBoot_ehci_td_t) VasEBoot_dma_get_virt (e->td_chunk); + e->td_phys = VasEBoot_dma_get_phys (e->td_chunk); + VasEBoot_memset ((void *) e->td_virt, 0, + sizeof (struct VasEBoot_ehci_td) * VasEBoot_EHCI_N_TD); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: TD mem=%p. OK\n", + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: TD mem=%p. OK\n", e->td_virt); /* Setup all frame list pointers. Since no isochronous transfers are supported, they all point to the (same!) queue head with index 0. */ - fp = grub_cpu_to_le32 ((e->qh_phys & GRUB_EHCI_POINTER_MASK) - | GRUB_EHCI_HPTR_TYPE_QH); - for (i = 0; i < GRUB_EHCI_N_FRAMELIST; i++) + fp = VasEBoot_cpu_to_le32 ((e->qh_phys & VasEBoot_EHCI_POINTER_MASK) + | VasEBoot_EHCI_HPTR_TYPE_QH); + for (i = 0; i < VasEBoot_EHCI_N_FRAMELIST; i++) e->framelist_virt[i] = fp; /* Prepare chain of all TDs and set Terminate in all TDs */ - for (i = 0; i < (GRUB_EHCI_N_TD - 1); i++) + for (i = 0; i < (VasEBoot_EHCI_N_TD - 1); i++) { - e->td_virt[i].link_td = e->td_phys + (i + 1) * sizeof (struct grub_ehci_td); - e->td_virt[i].next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); - e->td_virt[i].alt_next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->td_virt[i].link_td = e->td_phys + (i + 1) * sizeof (struct VasEBoot_ehci_td); + e->td_virt[i].next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); + e->td_virt[i].alt_next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); } - e->td_virt[GRUB_EHCI_N_TD - 1].next_td = - grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); - e->td_virt[GRUB_EHCI_N_TD - 1].alt_next_td = - grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->td_virt[VasEBoot_EHCI_N_TD - 1].next_td = + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); + e->td_virt[VasEBoot_EHCI_N_TD - 1].alt_next_td = + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); e->tdfree_virt = e->td_virt; /* Set Terminate in first QH, which is used in framelist */ - e->qh_virt[0].qh_hptr = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE | GRUB_EHCI_HPTR_TYPE_QH); - e->qh_virt[0].td_overlay.next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + e->qh_virt[0].qh_hptr = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE | VasEBoot_EHCI_HPTR_TYPE_QH); + e->qh_virt[0].td_overlay.next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); e->qh_virt[0].td_overlay.alt_next_td = - grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); /* Also set Halted bit in token */ - e->qh_virt[0].td_overlay.token = grub_cpu_to_le32_compile_time (GRUB_EHCI_STATUS_HALTED); + e->qh_virt[0].td_overlay.token = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_STATUS_HALTED); /* Set the H bit in first QH used for AL */ - e->qh_virt[1].ep_char = grub_cpu_to_le32_compile_time (GRUB_EHCI_H); + e->qh_virt[1].ep_char = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_H); /* Set Terminate into TD in rest of QHs and set horizontal link * pointer to itself - these QHs will be used for asynchronous * schedule and they should have valid value in horiz. link */ - for (i = 1; i < GRUB_EHCI_N_QH; i++) + for (i = 1; i < VasEBoot_EHCI_N_QH; i++) { e->qh_virt[i].qh_hptr = - grub_cpu_to_le32 ((grub_dma_virt2phys (&e->qh_virt[i], + VasEBoot_cpu_to_le32 ((VasEBoot_dma_virt2phys (&e->qh_virt[i], e->qh_chunk) & - GRUB_EHCI_POINTER_MASK) | GRUB_EHCI_HPTR_TYPE_QH); + VasEBoot_EHCI_POINTER_MASK) | VasEBoot_EHCI_HPTR_TYPE_QH); e->qh_virt[i].td_overlay.next_td = - grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); e->qh_virt[i].td_overlay.alt_next_td = - grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); /* Also set Halted bit in token */ e->qh_virt[i].td_overlay.token = - grub_cpu_to_le32_compile_time (GRUB_EHCI_STATUS_HALTED); + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_STATUS_HALTED); } /* Note: QH 0 and QH 1 are reserved and must not be used anywhere. @@ -730,129 +730,129 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, * itself must exist in asynchronous schedule * QH 1 has the H flag set to one */ - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: QH/TD init. OK\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: QH/TD init. OK\n"); /* Determine and change ownership. */ /* EECP offset valid in HCCPARAMS */ /* Ownership can be changed via EECP only */ - if (pciid != GRUB_CS5536_PCIID && eecp_offset >= 0x40) + if (pciid != VasEBoot_CS5536_PCIID && eecp_offset >= 0x40) { - grub_pci_address_t pciaddr_eecp; - pciaddr_eecp = grub_pci_make_address (dev, eecp_offset); + VasEBoot_pci_address_t pciaddr_eecp; + pciaddr_eecp = VasEBoot_pci_make_address (dev, eecp_offset); - usblegsup = grub_pci_read (pciaddr_eecp); - if (usblegsup & GRUB_EHCI_BIOS_OWNED) + usblegsup = VasEBoot_pci_read (pciaddr_eecp); + if (usblegsup & VasEBoot_EHCI_BIOS_OWNED) { - grub_boot_time ("Taking ownership of EHCI controller"); - grub_dprintf ("ehci", - "EHCI grub_ehci_pci_iter: EHCI owned by: BIOS\n"); + VasEBoot_boot_time ("Taking ownership of EHCI controller"); + VasEBoot_dprintf ("ehci", + "EHCI VasEBoot_ehci_pci_iter: EHCI owned by: BIOS\n"); /* Ownership change - set OS_OWNED bit */ - grub_pci_write (pciaddr_eecp, usblegsup | GRUB_EHCI_OS_OWNED); + VasEBoot_pci_write (pciaddr_eecp, usblegsup | VasEBoot_EHCI_OS_OWNED); /* Ensure PCI register is written */ - grub_pci_read (pciaddr_eecp); + VasEBoot_pci_read (pciaddr_eecp); /* Wait for finish of ownership change, EHCI specification * doesn't say how long it can take... */ - maxtime = grub_get_time_ms () + 1000; - while ((grub_pci_read (pciaddr_eecp) & GRUB_EHCI_BIOS_OWNED) - && (grub_get_time_ms () < maxtime)); - if (grub_pci_read (pciaddr_eecp) & GRUB_EHCI_BIOS_OWNED) + maxtime = VasEBoot_get_time_ms () + 1000; + while ((VasEBoot_pci_read (pciaddr_eecp) & VasEBoot_EHCI_BIOS_OWNED) + && (VasEBoot_get_time_ms () < maxtime)); + if (VasEBoot_pci_read (pciaddr_eecp) & VasEBoot_EHCI_BIOS_OWNED) { - grub_dprintf ("ehci", - "EHCI grub_ehci_pci_iter: EHCI change ownership timeout"); + VasEBoot_dprintf ("ehci", + "EHCI VasEBoot_ehci_pci_iter: EHCI change ownership timeout"); /* Change ownership in "hard way" - reset BIOS ownership */ - grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED); + VasEBoot_pci_write (pciaddr_eecp, VasEBoot_EHCI_OS_OWNED); /* Ensure PCI register is written */ - grub_pci_read (pciaddr_eecp); + VasEBoot_pci_read (pciaddr_eecp); } } - else if (usblegsup & GRUB_EHCI_OS_OWNED) + else if (usblegsup & VasEBoot_EHCI_OS_OWNED) /* XXX: What to do in this case - nothing ? Can it happen ? */ - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: EHCI owned by: OS\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: EHCI owned by: OS\n"); else { - grub_dprintf ("ehci", - "EHCI grub_ehci_pci_iter: EHCI owned by: NONE\n"); + VasEBoot_dprintf ("ehci", + "EHCI VasEBoot_ehci_pci_iter: EHCI owned by: NONE\n"); /* XXX: What to do in this case ? Can it happen ? * Is code below correct ? */ /* Ownership change - set OS_OWNED bit */ - grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED); + VasEBoot_pci_write (pciaddr_eecp, VasEBoot_EHCI_OS_OWNED); /* Ensure PCI register is written */ - grub_pci_read (pciaddr_eecp); + VasEBoot_pci_read (pciaddr_eecp); } /* Disable SMI, just to be sure. */ - pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4); - grub_pci_write (pciaddr_eecp, 0); + pciaddr_eecp = VasEBoot_pci_make_address (dev, eecp_offset + 4); + VasEBoot_pci_write (pciaddr_eecp, 0); /* Ensure PCI register is written */ - grub_pci_read (pciaddr_eecp); + VasEBoot_pci_read (pciaddr_eecp); } - grub_dprintf ("ehci", "inithw: EHCI grub_ehci_pci_iter: ownership OK\n"); + VasEBoot_dprintf ("ehci", "inithw: EHCI VasEBoot_ehci_pci_iter: ownership OK\n"); /* Now we can setup EHCI (maybe...) */ /* Check if EHCI is halted and halt it if not */ - if (grub_ehci_halt (e) != GRUB_USB_ERR_NONE) + if (VasEBoot_ehci_halt (e) != VasEBoot_USB_ERR_NONE) { - grub_error (GRUB_ERR_TIMEOUT, - "EHCI grub_ehci_pci_iter: EHCI halt timeout"); + VasEBoot_error (VasEBoot_ERR_TIMEOUT, + "EHCI VasEBoot_ehci_pci_iter: EHCI halt timeout"); goto fail; } - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: halted OK\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: halted OK\n"); /* Reset EHCI */ - if (grub_ehci_reset (e) != GRUB_USB_ERR_NONE) + if (VasEBoot_ehci_reset (e) != VasEBoot_USB_ERR_NONE) { - grub_error (GRUB_ERR_TIMEOUT, - "EHCI grub_ehci_pci_iter: EHCI reset timeout"); + VasEBoot_error (VasEBoot_ERR_TIMEOUT, + "EHCI VasEBoot_ehci_pci_iter: EHCI reset timeout"); goto fail; } - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: reset OK\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: reset OK\n"); /* Setup list address registers */ - grub_ehci_oper_write32 (e, GRUB_EHCI_FL_BASE, e->framelist_phys); - grub_ehci_oper_write32 (e, GRUB_EHCI_CUR_AL_ADDR, - grub_dma_virt2phys (&e->qh_virt[1], + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_FL_BASE, e->framelist_phys); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_CUR_AL_ADDR, + VasEBoot_dma_virt2phys (&e->qh_virt[1], e->qh_chunk)); /* Set ownership of root hub ports to EHCI */ - grub_ehci_oper_write32 (e, GRUB_EHCI_CONFIG_FLAG, GRUB_EHCI_CF_EHCI_OWNER); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_CONFIG_FLAG, VasEBoot_EHCI_CF_EHCI_OWNER); /* Enable both lists */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_AS_ENABL - | GRUB_EHCI_CMD_PS_ENABL - | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_AS_ENABL + | VasEBoot_EHCI_CMD_PS_ENABL + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Now should be possible to power-up and enumerate ports etc. */ - if ((grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_SPARAMS) - & GRUB_EHCI_SPARAMS_PPC) != 0) + if ((VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_SPARAMS) + & VasEBoot_EHCI_SPARAMS_PPC) != 0) { /* EHCI has port powering control */ /* Power on all ports */ - n_ports = grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_SPARAMS) - & GRUB_EHCI_SPARAMS_N_PORTS; + n_ports = VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_SPARAMS) + & VasEBoot_EHCI_SPARAMS_N_PORTS; for (i = 0; i < (int) n_ports; i++) - grub_ehci_oper_write32 (e, GRUB_EHCI_PORT_STAT_CMD + i * 4, - GRUB_EHCI_PORT_POWER - | grub_ehci_oper_read32 (e, - GRUB_EHCI_PORT_STAT_CMD + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_PORT_STAT_CMD + i * 4, + VasEBoot_EHCI_PORT_POWER + | VasEBoot_ehci_oper_read32 (e, + VasEBoot_EHCI_PORT_STAT_CMD + i * 4)); } /* Ensure all commands are written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND); + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND); /* Enable EHCI */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_RUNSTOP - | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_RUNSTOP + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Ensure command is written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND); + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND); /* Link to ehci now that initialisation is successful. */ e->next = ehci; @@ -860,25 +860,25 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, sync_all_caches (e); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: OK at all\n"); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: OK at all\n"); - grub_dprintf ("ehci", - "EHCI grub_ehci_pci_iter: iobase of oper. regs: %08x\n", - (base & GRUB_EHCI_ADDR_MEM_MASK)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: COMMAND: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: STATUS: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: INTERRUPT: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_INTERRUPT)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: FRAME_INDEX: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_FRAME_INDEX)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: FL_BASE: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_FL_BASE)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CUR_AL_ADDR: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_CUR_AL_ADDR)); - grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG)); + VasEBoot_dprintf ("ehci", + "EHCI VasEBoot_ehci_pci_iter: iobase of oper. regs: %08x\n", + (base & VasEBoot_EHCI_ADDR_MEM_MASK)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: COMMAND: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: STATUS: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: INTERRUPT: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_INTERRUPT)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: FRAME_INDEX: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_FRAME_INDEX)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: FL_BASE: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_FL_BASE)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: CUR_AL_ADDR: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_CUR_AL_ADDR)); + VasEBoot_dprintf ("ehci", "EHCI VasEBoot_ehci_pci_iter: CONFIG_FLAG: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_CONFIG_FLAG)); return 0; @@ -886,22 +886,22 @@ fail: if (e) { if (e->td_chunk) - grub_dma_free ((void *) e->td_chunk); + VasEBoot_dma_free ((void *) e->td_chunk); if (e->qh_chunk) - grub_dma_free ((void *) e->qh_chunk); + VasEBoot_dma_free ((void *) e->qh_chunk); if (e->framelist_chunk) - grub_dma_free (e->framelist_chunk); + VasEBoot_dma_free (e->framelist_chunk); } - grub_free (e); + VasEBoot_free (e); return 0; } static int -grub_ehci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data) +VasEBoot_ehci_iterate (VasEBoot_usb_controller_iterate_hook_t hook, void *hook_data) { - struct grub_ehci *e; - struct grub_usb_controller dev; + struct VasEBoot_ehci *e; + struct VasEBoot_usb_controller dev; for (e = ehci; e; e = e->next) { @@ -914,10 +914,10 @@ grub_ehci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data) } static void -grub_ehci_setup_qh (grub_ehci_qh_t qh, grub_usb_transfer_t transfer) +VasEBoot_ehci_setup_qh (VasEBoot_ehci_qh_t qh, VasEBoot_usb_transfer_t transfer) { - grub_uint32_t ep_char = 0; - grub_uint32_t ep_cap = 0; + VasEBoot_uint32_t ep_char = 0; + VasEBoot_uint32_t ep_cap = 0; /* Note: Another part of code is responsible to this QH is * Halted ! But it can be linked in AL, so we cannot erase or @@ -936,29 +936,29 @@ grub_ehci_setup_qh (grub_ehci_qh_t qh, grub_usb_transfer_t transfer) * "I" bit must not be set, * Device Address is taken from transfer structure * */ - if ((transfer->dev->speed != GRUB_USB_SPEED_HIGH) - && (transfer->type == GRUB_USB_TRANSACTION_TYPE_CONTROL)) - ep_char |= GRUB_EHCI_C; - ep_char |= (transfer->max << GRUB_EHCI_MAXPLEN_OFF) - & GRUB_EHCI_MAXPLEN_MASK; - ep_char |= GRUB_EHCI_DTC; + if ((transfer->dev->speed != VasEBoot_USB_SPEED_HIGH) + && (transfer->type == VasEBoot_USB_TRANSACTION_TYPE_CONTROL)) + ep_char |= VasEBoot_EHCI_C; + ep_char |= (transfer->max << VasEBoot_EHCI_MAXPLEN_OFF) + & VasEBoot_EHCI_MAXPLEN_MASK; + ep_char |= VasEBoot_EHCI_DTC; switch (transfer->dev->speed) { - case GRUB_USB_SPEED_LOW: - ep_char |= GRUB_EHCI_SPEED_LOW; + case VasEBoot_USB_SPEED_LOW: + ep_char |= VasEBoot_EHCI_SPEED_LOW; break; - case GRUB_USB_SPEED_FULL: - ep_char |= GRUB_EHCI_SPEED_FULL; + case VasEBoot_USB_SPEED_FULL: + ep_char |= VasEBoot_EHCI_SPEED_FULL; break; - case GRUB_USB_SPEED_HIGH: + case VasEBoot_USB_SPEED_HIGH: default: - ep_char |= GRUB_EHCI_SPEED_HIGH; + ep_char |= VasEBoot_EHCI_SPEED_HIGH; /* XXX: How we will handle unknown value of speed? */ } - ep_char |= (transfer->endpoint << GRUB_EHCI_EP_NUM_OFF) - & GRUB_EHCI_EP_NUM_MASK; - ep_char |= transfer->devaddr & GRUB_EHCI_DEVADDR_MASK; - qh->ep_char = grub_cpu_to_le32 (ep_char); + ep_char |= (transfer->endpoint << VasEBoot_EHCI_EP_NUM_OFF) + & VasEBoot_EHCI_EP_NUM_MASK; + ep_char |= transfer->devaddr & VasEBoot_EHCI_DEVADDR_MASK; + qh->ep_char = VasEBoot_cpu_to_le32 (ep_char); /* EP capabilities setup */ /* MULT field - we try to use max. number * PortNumber - included now in device structure referenced @@ -967,64 +967,64 @@ grub_ehci_setup_qh (grub_ehci_qh_t qh, grub_usb_transfer_t transfer) * inside transfer structure * SplitCompletionMask - AFAIK it is ignored in asynchronous list, * InterruptScheduleMask - AFAIK it should be zero in async. list */ - ep_cap |= GRUB_EHCI_MULT_THREE; - ep_cap |= (transfer->dev->split_hubport << GRUB_EHCI_DEVPORT_OFF) - & GRUB_EHCI_DEVPORT_MASK; - ep_cap |= (transfer->dev->split_hubaddr << GRUB_EHCI_HUBADDR_OFF) - & GRUB_EHCI_HUBADDR_MASK; - if (transfer->dev->speed == GRUB_USB_SPEED_LOW - && transfer->type != GRUB_USB_TRANSACTION_TYPE_CONTROL) + ep_cap |= VasEBoot_EHCI_MULT_THREE; + ep_cap |= (transfer->dev->split_hubport << VasEBoot_EHCI_DEVPORT_OFF) + & VasEBoot_EHCI_DEVPORT_MASK; + ep_cap |= (transfer->dev->split_hubaddr << VasEBoot_EHCI_HUBADDR_OFF) + & VasEBoot_EHCI_HUBADDR_MASK; + if (transfer->dev->speed == VasEBoot_USB_SPEED_LOW + && transfer->type != VasEBoot_USB_TRANSACTION_TYPE_CONTROL) { - ep_cap |= (1<<0) << GRUB_EHCI_SMASK_OFF; - ep_cap |= (7<<2) << GRUB_EHCI_CMASK_OFF; + ep_cap |= (1<<0) << VasEBoot_EHCI_SMASK_OFF; + ep_cap |= (7<<2) << VasEBoot_EHCI_CMASK_OFF; } - qh->ep_cap = grub_cpu_to_le32 (ep_cap); + qh->ep_cap = VasEBoot_cpu_to_le32 (ep_cap); - grub_dprintf ("ehci", "setup_qh: qh=%p, not changed: qh_hptr=%08x\n", - qh, grub_le_to_cpu32 (qh->qh_hptr)); - grub_dprintf ("ehci", "setup_qh: ep_char=%08x, ep_cap=%08x\n", + VasEBoot_dprintf ("ehci", "setup_qh: qh=%p, not changed: qh_hptr=%08x\n", + qh, VasEBoot_le_to_cpu32 (qh->qh_hptr)); + VasEBoot_dprintf ("ehci", "setup_qh: ep_char=%08x, ep_cap=%08x\n", ep_char, ep_cap); - grub_dprintf ("ehci", "setup_qh: end\n"); - grub_dprintf ("ehci", "setup_qh: not changed: td_current=%08x\n", - grub_le_to_cpu32 (qh->td_current)); - grub_dprintf ("ehci", "setup_qh: not changed: next_td=%08x\n", - grub_le_to_cpu32 (qh->td_overlay.next_td)); - grub_dprintf ("ehci", "setup_qh: not changed: alt_next_td=%08x\n", - grub_le_to_cpu32 (qh->td_overlay.alt_next_td)); - grub_dprintf ("ehci", "setup_qh: not changed: token=%08x\n", - grub_le_to_cpu32 (qh->td_overlay.token)); + VasEBoot_dprintf ("ehci", "setup_qh: end\n"); + VasEBoot_dprintf ("ehci", "setup_qh: not changed: td_current=%08x\n", + VasEBoot_le_to_cpu32 (qh->td_current)); + VasEBoot_dprintf ("ehci", "setup_qh: not changed: next_td=%08x\n", + VasEBoot_le_to_cpu32 (qh->td_overlay.next_td)); + VasEBoot_dprintf ("ehci", "setup_qh: not changed: alt_next_td=%08x\n", + VasEBoot_le_to_cpu32 (qh->td_overlay.alt_next_td)); + VasEBoot_dprintf ("ehci", "setup_qh: not changed: token=%08x\n", + VasEBoot_le_to_cpu32 (qh->td_overlay.token)); } -static grub_ehci_qh_t -grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer) +static VasEBoot_ehci_qh_t +VasEBoot_ehci_find_qh (struct VasEBoot_ehci *e, VasEBoot_usb_transfer_t transfer) { - grub_uint32_t target, mask; + VasEBoot_uint32_t target, mask; int i; - grub_ehci_qh_t qh = e->qh_virt; - grub_ehci_qh_t head; - grub_uint32_t qh_phys; - grub_uint32_t qh_terminate = - GRUB_EHCI_TERMINATE | GRUB_EHCI_HPTR_TYPE_QH; - grub_ehci_qh_t qh_iter; + VasEBoot_ehci_qh_t qh = e->qh_virt; + VasEBoot_ehci_qh_t head; + VasEBoot_uint32_t qh_phys; + VasEBoot_uint32_t qh_terminate = + VasEBoot_EHCI_TERMINATE | VasEBoot_EHCI_HPTR_TYPE_QH; + VasEBoot_ehci_qh_t qh_iter; /* Prepare part of EP Characteristic to find existing QH */ - target = ((transfer->endpoint << GRUB_EHCI_EP_NUM_OFF) | - transfer->devaddr) & GRUB_EHCI_TARGET_MASK; - target = grub_cpu_to_le32 (target); - mask = grub_cpu_to_le32_compile_time (GRUB_EHCI_TARGET_MASK); + target = ((transfer->endpoint << VasEBoot_EHCI_EP_NUM_OFF) | + transfer->devaddr) & VasEBoot_EHCI_TARGET_MASK; + target = VasEBoot_cpu_to_le32 (target); + mask = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TARGET_MASK); /* low speed interrupt transfers are linked to the periodic */ /* schedule, everything else to the asynchronous schedule */ - if (transfer->dev->speed == GRUB_USB_SPEED_LOW - && transfer->type != GRUB_USB_TRANSACTION_TYPE_CONTROL) + if (transfer->dev->speed == VasEBoot_USB_SPEED_LOW + && transfer->type != VasEBoot_USB_TRANSACTION_TYPE_CONTROL) head = &qh[0]; else head = &qh[1]; /* First try to find existing QH with proper target in proper list */ - qh_phys = grub_le_to_cpu32( head->qh_hptr ); + qh_phys = VasEBoot_le_to_cpu32( head->qh_hptr ); if (qh_phys != qh_terminate) - qh_iter = grub_dma_phys2virt ( qh_phys & GRUB_EHCI_QHTDPTR_MASK, + qh_iter = VasEBoot_dma_phys2virt ( qh_phys & VasEBoot_EHCI_QHTDPTR_MASK, e->qh_chunk ); else qh_iter = NULL; @@ -1032,80 +1032,80 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer) for ( i = 0; (qh_phys != qh_terminate) && (qh_iter != NULL) && - (qh_iter != head) && (i < GRUB_EHCI_N_QH); + (qh_iter != head) && (i < VasEBoot_EHCI_N_QH); i++ ) { if (target == (qh_iter->ep_char & mask)) { /* Found proper existing (and linked) QH, do setup of QH */ - grub_dprintf ("ehci", "find_qh: found, QH=%p\n", qh_iter); - grub_ehci_setup_qh (qh_iter, transfer); + VasEBoot_dprintf ("ehci", "find_qh: found, QH=%p\n", qh_iter); + VasEBoot_ehci_setup_qh (qh_iter, transfer); sync_all_caches (e); return qh_iter; } - qh_phys = grub_le_to_cpu32( qh_iter->qh_hptr ); + qh_phys = VasEBoot_le_to_cpu32( qh_iter->qh_hptr ); if (qh_phys != qh_terminate) - qh_iter = grub_dma_phys2virt ( qh_phys & GRUB_EHCI_QHTDPTR_MASK, + qh_iter = VasEBoot_dma_phys2virt ( qh_phys & VasEBoot_EHCI_QHTDPTR_MASK, e->qh_chunk ); else qh_iter = NULL; } - /* variable "i" should be never equal to GRUB_EHCI_N_QH here */ - if (i >= GRUB_EHCI_N_QH) + /* variable "i" should be never equal to VasEBoot_EHCI_N_QH here */ + if (i >= VasEBoot_EHCI_N_QH) { /* Something very bad happened in QH list(s) ! */ - grub_dprintf ("ehci", "find_qh: Mismatch in QH list! head=%p\n", + VasEBoot_dprintf ("ehci", "find_qh: Mismatch in QH list! head=%p\n", head); } /* QH with target_addr does not exist, we have to find and add it */ - for (i = 2; i < GRUB_EHCI_N_QH; i++) /* We ignore zero and first QH */ + for (i = 2; i < VasEBoot_EHCI_N_QH; i++) /* We ignore zero and first QH */ { if (!qh[i].ep_char) break; /* Found first not-allocated QH, finish */ } /* Have we any free QH in array ? */ - if (i >= GRUB_EHCI_N_QH) /* No. */ + if (i >= VasEBoot_EHCI_N_QH) /* No. */ { - grub_dprintf ("ehci", "find_qh: end - no free QH\n"); + VasEBoot_dprintf ("ehci", "find_qh: end - no free QH\n"); return NULL; } - grub_dprintf ("ehci", "find_qh: new, i=%d, QH=%p\n", + VasEBoot_dprintf ("ehci", "find_qh: new, i=%d, QH=%p\n", i, &qh[i]); /* Currently we simply take next (current) QH in array, no allocation * function is used. It should be no problem until we will need to * de-allocate QHs of unplugged devices. */ /* We should preset new QH and link it into AL */ - grub_ehci_setup_qh (&qh[i], transfer); + VasEBoot_ehci_setup_qh (&qh[i], transfer); /* Linking - this new (last) QH will copy the QH from the head QH */ qh[i].qh_hptr = head->qh_hptr; /* Linking - the head QH will point to this new QH */ - head->qh_hptr = grub_cpu_to_le32 (GRUB_EHCI_HPTR_TYPE_QH - | grub_dma_virt2phys (&qh[i], + head->qh_hptr = VasEBoot_cpu_to_le32 (VasEBoot_EHCI_HPTR_TYPE_QH + | VasEBoot_dma_virt2phys (&qh[i], e->qh_chunk)); return &qh[i]; } -static grub_ehci_td_t -grub_ehci_alloc_td (struct grub_ehci *e) +static VasEBoot_ehci_td_t +VasEBoot_ehci_alloc_td (struct VasEBoot_ehci *e) { - grub_ehci_td_t ret; + VasEBoot_ehci_td_t ret; /* Check if there is a Transfer Descriptor available. */ if (!e->tdfree_virt) { - grub_dprintf ("ehci", "alloc_td: end - no free TD\n"); + VasEBoot_dprintf ("ehci", "alloc_td: end - no free TD\n"); return NULL; } ret = e->tdfree_virt; /* Take current free TD */ /* Advance to next free TD in chain */ if (ret->link_td) - e->tdfree_virt = grub_dma_phys2virt (ret->link_td, e->td_chunk); + e->tdfree_virt = VasEBoot_dma_phys2virt (ret->link_td, e->td_chunk); else e->tdfree_virt = NULL; ret->link_td = 0; /* Reset link_td in allocated TD */ @@ -1113,22 +1113,22 @@ grub_ehci_alloc_td (struct grub_ehci *e) } static void -grub_ehci_free_td (struct grub_ehci *e, grub_ehci_td_t td) +VasEBoot_ehci_free_td (struct VasEBoot_ehci *e, VasEBoot_ehci_td_t td) { /* Chain new free TD & rest */ if (e->tdfree_virt) - td->link_td = grub_dma_virt2phys (e->tdfree_virt, e->td_chunk); + td->link_td = VasEBoot_dma_virt2phys (e->tdfree_virt, e->td_chunk); else td->link_td = 0; e->tdfree_virt = td; /* Change address of first free TD */ } static void -grub_ehci_free_tds (struct grub_ehci *e, grub_ehci_td_t td, - grub_usb_transfer_t transfer, grub_size_t * actual) +VasEBoot_ehci_free_tds (struct VasEBoot_ehci *e, VasEBoot_ehci_td_t td, + VasEBoot_usb_transfer_t transfer, VasEBoot_size_t * actual) { int i; /* Index of TD in transfer */ - grub_uint32_t token, to_transfer; + VasEBoot_uint32_t token, to_transfer; /* Note: Another part of code is responsible to this QH is * INACTIVE ! */ @@ -1137,10 +1137,10 @@ grub_ehci_free_tds (struct grub_ehci *e, grub_ehci_td_t td, /* Free the TDs in this queue and set last_trans. */ for (i = 0; td; i++) { - grub_ehci_td_t tdprev; + VasEBoot_ehci_td_t tdprev; - token = grub_le_to_cpu32 (td->token); - to_transfer = (token & GRUB_EHCI_TOTAL_MASK) >> GRUB_EHCI_TOTAL_OFF; + token = VasEBoot_le_to_cpu32 (td->token); + to_transfer = (token & VasEBoot_EHCI_TOTAL_MASK) >> VasEBoot_EHCI_TOTAL_OFF; /* Check state of TD - if it did not transfer * whole data then set last_trans - it should be last executed TD @@ -1153,12 +1153,12 @@ grub_ehci_free_tds (struct grub_ehci *e, grub_ehci_td_t td, /* Unlink the TD */ tdprev = td; if (td->link_td) - td = grub_dma_phys2virt (td->link_td, e->td_chunk); + td = VasEBoot_dma_phys2virt (td->link_td, e->td_chunk); else td = NULL; /* Free the TD. */ - grub_ehci_free_td (e, tdprev); + VasEBoot_ehci_free_td (e, tdprev); } /* Check if last_trans was set. If not and something was @@ -1177,56 +1177,56 @@ grub_ehci_free_tds (struct grub_ehci *e, grub_ehci_td_t td, * and if the buffer is crossing page boundary (?). */ } -static grub_ehci_td_t -grub_ehci_transaction (struct grub_ehci *e, - grub_transfer_type_t type, - unsigned int toggle, grub_size_t size, - grub_uint32_t data, grub_ehci_td_t td_alt) +static VasEBoot_ehci_td_t +VasEBoot_ehci_transaction (struct VasEBoot_ehci *e, + VasEBoot_transfer_type_t type, + unsigned int toggle, VasEBoot_size_t size, + VasEBoot_uint32_t data, VasEBoot_ehci_td_t td_alt) { - grub_ehci_td_t td; - grub_uint32_t token; - grub_uint32_t bufadr; + VasEBoot_ehci_td_t td; + VasEBoot_uint32_t token; + VasEBoot_uint32_t bufadr; int i; /* Test of transfer size, it can be: - * <= GRUB_EHCI_MAXBUFLEN if data aligned to page boundary - * <= GRUB_EHCI_MAXBUFLEN - GRUB_EHCI_BUFPAGELEN if not aligned + * <= VasEBoot_EHCI_MAXBUFLEN if data aligned to page boundary + * <= VasEBoot_EHCI_MAXBUFLEN - VasEBoot_EHCI_BUFPAGELEN if not aligned * (worst case) */ - if ((((data % GRUB_EHCI_BUFPAGELEN) == 0) - && (size > GRUB_EHCI_MAXBUFLEN)) + if ((((data % VasEBoot_EHCI_BUFPAGELEN) == 0) + && (size > VasEBoot_EHCI_MAXBUFLEN)) || - (((data % GRUB_EHCI_BUFPAGELEN) != 0) - && (size > (GRUB_EHCI_MAXBUFLEN - GRUB_EHCI_BUFPAGELEN)))) + (((data % VasEBoot_EHCI_BUFPAGELEN) != 0) + && (size > (VasEBoot_EHCI_MAXBUFLEN - VasEBoot_EHCI_BUFPAGELEN)))) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "too long data buffer for EHCI transaction"); return 0; } /* Grab a free Transfer Descriptor and initialize it. */ - td = grub_ehci_alloc_td (e); + td = VasEBoot_ehci_alloc_td (e); if (!td) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "no transfer descriptors available for EHCI transfer"); return 0; } - grub_dprintf ("ehci", + VasEBoot_dprintf ("ehci", "transaction: type=%d, toggle=%d, size=%lu data=0x%x td=%p\n", type, toggle, (unsigned long) size, data, td); /* Fill whole TD by zeros */ - grub_memset ((void *) td, 0, sizeof (struct grub_ehci_td)); + VasEBoot_memset ((void *) td, 0, sizeof (struct VasEBoot_ehci_td)); /* Don't point to any TD yet, just terminate. */ - td->next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + td->next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); /* Set alternate pointer. When short packet occurs, alternate TD * will not be really fetched because it is not active. But don't * forget, EHCI will try to fetch alternate TD every scan of AL * until QH is halted. */ - td->alt_next_td = grub_cpu_to_le32 (grub_dma_virt2phys (td_alt, + td->alt_next_td = VasEBoot_cpu_to_le32 (VasEBoot_dma_virt2phys (td_alt, e->td_chunk)); /* token: * TOGGLE - according to toggle @@ -1240,148 +1240,148 @@ grub_ehci_transaction (struct grub_ehci *e, * SPLIT TRANS. STATE bit should be zero. It is ignored * in HIGH speed transaction, and should be zero for LOW/FULL * speed to indicate state Do Split Transaction */ - token = toggle ? GRUB_EHCI_TOGGLE : 0; - token |= (size << GRUB_EHCI_TOTAL_OFF) & GRUB_EHCI_TOTAL_MASK; - token |= GRUB_EHCI_CERR_3; + token = toggle ? VasEBoot_EHCI_TOGGLE : 0; + token |= (size << VasEBoot_EHCI_TOTAL_OFF) & VasEBoot_EHCI_TOTAL_MASK; + token |= VasEBoot_EHCI_CERR_3; switch (type) { - case GRUB_USB_TRANSFER_TYPE_IN: - token |= GRUB_EHCI_PIDCODE_IN; + case VasEBoot_USB_TRANSFER_TYPE_IN: + token |= VasEBoot_EHCI_PIDCODE_IN; break; - case GRUB_USB_TRANSFER_TYPE_OUT: - token |= GRUB_EHCI_PIDCODE_OUT; + case VasEBoot_USB_TRANSFER_TYPE_OUT: + token |= VasEBoot_EHCI_PIDCODE_OUT; break; - case GRUB_USB_TRANSFER_TYPE_SETUP: - token |= GRUB_EHCI_PIDCODE_SETUP; + case VasEBoot_USB_TRANSFER_TYPE_SETUP: + token |= VasEBoot_EHCI_PIDCODE_SETUP; break; default: /* XXX: Should not happen, but what to do if it does ? */ break; } - token |= GRUB_EHCI_STATUS_ACTIVE; - td->token = grub_cpu_to_le32 (token); + token |= VasEBoot_EHCI_STATUS_ACTIVE; + td->token = VasEBoot_cpu_to_le32 (token); /* Fill buffer pointers according to size */ bufadr = data; - td->buffer_page[0] = grub_cpu_to_le32 (bufadr); - bufadr = ((bufadr / GRUB_EHCI_BUFPAGELEN) + 1) * GRUB_EHCI_BUFPAGELEN; - for (i = 1; ((bufadr - data) < size) && (i < GRUB_EHCI_TD_BUF_PAGES); i++) + td->buffer_page[0] = VasEBoot_cpu_to_le32 (bufadr); + bufadr = ((bufadr / VasEBoot_EHCI_BUFPAGELEN) + 1) * VasEBoot_EHCI_BUFPAGELEN; + for (i = 1; ((bufadr - data) < size) && (i < VasEBoot_EHCI_TD_BUF_PAGES); i++) { - td->buffer_page[i] = grub_cpu_to_le32 (bufadr & GRUB_EHCI_BUFPTR_MASK); - bufadr = ((bufadr / GRUB_EHCI_BUFPAGELEN) + 1) * GRUB_EHCI_BUFPAGELEN; + td->buffer_page[i] = VasEBoot_cpu_to_le32 (bufadr & VasEBoot_EHCI_BUFPTR_MASK); + bufadr = ((bufadr / VasEBoot_EHCI_BUFPAGELEN) + 1) * VasEBoot_EHCI_BUFPAGELEN; } /* Remember data size for future use... */ - td->size = (grub_uint32_t) size; + td->size = (VasEBoot_uint32_t) size; - grub_dprintf ("ehci", "td=%p\n", td); - grub_dprintf ("ehci", "HW: next_td=%08x, alt_next_td=%08x\n", - grub_le_to_cpu32 (td->next_td), - grub_le_to_cpu32 (td->alt_next_td)); - grub_dprintf ("ehci", "HW: token=%08x, buffer[0]=%08x\n", - grub_le_to_cpu32 (td->token), - grub_le_to_cpu32 (td->buffer_page[0])); - grub_dprintf ("ehci", "HW: buffer[1]=%08x, buffer[2]=%08x\n", - grub_le_to_cpu32 (td->buffer_page[1]), - grub_le_to_cpu32 (td->buffer_page[2])); - grub_dprintf ("ehci", "HW: buffer[3]=%08x, buffer[4]=%08x\n", - grub_le_to_cpu32 (td->buffer_page[3]), - grub_le_to_cpu32 (td->buffer_page[4])); - grub_dprintf ("ehci", "link_td=%08x, size=%08x\n", + VasEBoot_dprintf ("ehci", "td=%p\n", td); + VasEBoot_dprintf ("ehci", "HW: next_td=%08x, alt_next_td=%08x\n", + VasEBoot_le_to_cpu32 (td->next_td), + VasEBoot_le_to_cpu32 (td->alt_next_td)); + VasEBoot_dprintf ("ehci", "HW: token=%08x, buffer[0]=%08x\n", + VasEBoot_le_to_cpu32 (td->token), + VasEBoot_le_to_cpu32 (td->buffer_page[0])); + VasEBoot_dprintf ("ehci", "HW: buffer[1]=%08x, buffer[2]=%08x\n", + VasEBoot_le_to_cpu32 (td->buffer_page[1]), + VasEBoot_le_to_cpu32 (td->buffer_page[2])); + VasEBoot_dprintf ("ehci", "HW: buffer[3]=%08x, buffer[4]=%08x\n", + VasEBoot_le_to_cpu32 (td->buffer_page[3]), + VasEBoot_le_to_cpu32 (td->buffer_page[4])); + VasEBoot_dprintf ("ehci", "link_td=%08x, size=%08x\n", td->link_td, td->size); return td; } -struct grub_ehci_transfer_controller_data +struct VasEBoot_ehci_transfer_controller_data { - grub_ehci_qh_t qh_virt; - grub_ehci_td_t td_first_virt; - grub_ehci_td_t td_alt_virt; - grub_ehci_td_t td_last_virt; - grub_uint32_t td_last_phys; + VasEBoot_ehci_qh_t qh_virt; + VasEBoot_ehci_td_t td_first_virt; + VasEBoot_ehci_td_t td_alt_virt; + VasEBoot_ehci_td_t td_last_virt; + VasEBoot_uint32_t td_last_phys; }; -static grub_usb_err_t -grub_ehci_setup_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +static VasEBoot_usb_err_t +VasEBoot_ehci_setup_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_ehci *e = (struct grub_ehci *) dev->data; - grub_ehci_td_t td = NULL; - grub_ehci_td_t td_prev = NULL; + struct VasEBoot_ehci *e = (struct VasEBoot_ehci *) dev->data; + VasEBoot_ehci_td_t td = NULL; + VasEBoot_ehci_td_t td_prev = NULL; int i; - struct grub_ehci_transfer_controller_data *cdata; - grub_uint32_t status; + struct VasEBoot_ehci_transfer_controller_data *cdata; + VasEBoot_uint32_t status; sync_all_caches (e); /* Check if EHCI is running and AL is enabled */ - status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); - if ((status & GRUB_EHCI_ST_HC_HALTED) != 0) + status = VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS); + if ((status & VasEBoot_EHCI_ST_HC_HALTED) != 0) /* XXX: Fix it: Currently we don't do anything to restart EHCI */ { - grub_dprintf ("ehci", "setup_transfer: halted, status = 0x%x\n", + VasEBoot_dprintf ("ehci", "setup_transfer: halted, status = 0x%x\n", status); - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; } - status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); + status = VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS); if ((status - & (GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0) + & (VasEBoot_EHCI_ST_AS_STATUS | VasEBoot_EHCI_ST_PS_STATUS)) == 0) /* XXX: Fix it: Currently we don't do anything to restart EHCI */ { - grub_dprintf ("ehci", "setup_transfer: no AS/PS, status = 0x%x\n", + VasEBoot_dprintf ("ehci", "setup_transfer: no AS/PS, status = 0x%x\n", status); - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; } /* Allocate memory for controller transfer data. */ - cdata = grub_malloc (sizeof (*cdata)); + cdata = VasEBoot_malloc (sizeof (*cdata)); if (!cdata) - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; cdata->td_first_virt = NULL; /* Allocate a queue head for the transfer queue. */ - cdata->qh_virt = grub_ehci_find_qh (e, transfer); + cdata->qh_virt = VasEBoot_ehci_find_qh (e, transfer); if (!cdata->qh_virt) { - grub_dprintf ("ehci", "setup_transfer: no QH\n"); - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_dprintf ("ehci", "setup_transfer: no QH\n"); + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } /* To detect short packet we need some additional "alternate" TD, * allocate it first. */ - cdata->td_alt_virt = grub_ehci_alloc_td (e); + cdata->td_alt_virt = VasEBoot_ehci_alloc_td (e); if (!cdata->td_alt_virt) { - grub_dprintf ("ehci", "setup_transfer: no TDs\n"); - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_dprintf ("ehci", "setup_transfer: no TDs\n"); + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } /* Fill whole alternate TD by zeros (= inactive) and set * Terminate bits and Halt bit */ - grub_memset ((void *) cdata->td_alt_virt, 0, sizeof (struct grub_ehci_td)); - cdata->td_alt_virt->next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); - cdata->td_alt_virt->alt_next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); - cdata->td_alt_virt->token = grub_cpu_to_le32_compile_time (GRUB_EHCI_STATUS_HALTED); + VasEBoot_memset ((void *) cdata->td_alt_virt, 0, sizeof (struct VasEBoot_ehci_td)); + cdata->td_alt_virt->next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); + cdata->td_alt_virt->alt_next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); + cdata->td_alt_virt->token = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_STATUS_HALTED); /* Allocate appropriate number of TDs and set */ for (i = 0; i < transfer->transcnt; i++) { - grub_usb_transaction_t tr = &transfer->transactions[i]; + VasEBoot_usb_transaction_t tr = &transfer->transactions[i]; - td = grub_ehci_transaction (e, tr->pid, tr->toggle, tr->size, + td = VasEBoot_ehci_transaction (e, tr->pid, tr->toggle, tr->size, tr->data, cdata->td_alt_virt); if (!td) /* de-allocate and free all */ { - grub_size_t actual = 0; + VasEBoot_size_t actual = 0; if (cdata->td_first_virt) - grub_ehci_free_tds (e, cdata->td_first_virt, NULL, &actual); + VasEBoot_ehci_free_tds (e, cdata->td_first_virt, NULL, &actual); - grub_free (cdata); - grub_dprintf ("ehci", "setup_transfer: no TD\n"); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (cdata); + VasEBoot_dprintf ("ehci", "setup_transfer: no TD\n"); + return VasEBoot_USB_ERR_INTERNAL; } /* Register new TD in cdata or previous TD */ @@ -1389,54 +1389,54 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, cdata->td_first_virt = td; else { - td_prev->link_td = grub_dma_virt2phys (td, e->td_chunk); + td_prev->link_td = VasEBoot_dma_virt2phys (td, e->td_chunk); td_prev->next_td = - grub_cpu_to_le32 (grub_dma_virt2phys (td, e->td_chunk)); + VasEBoot_cpu_to_le32 (VasEBoot_dma_virt2phys (td, e->td_chunk)); } td_prev = td; } /* Remember last TD */ cdata->td_last_virt = td; - cdata->td_last_phys = grub_dma_virt2phys (td, e->td_chunk); + cdata->td_last_phys = VasEBoot_dma_virt2phys (td, e->td_chunk); /* Last TD should not have set alternate TD */ - cdata->td_last_virt->alt_next_td = grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + cdata->td_last_virt->alt_next_td = VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); - grub_dprintf ("ehci", "setup_transfer: cdata=%p, qh=%p\n", + VasEBoot_dprintf ("ehci", "setup_transfer: cdata=%p, qh=%p\n", cdata,cdata->qh_virt); - grub_dprintf ("ehci", "setup_transfer: td_first=%p, td_alt=%p\n", + VasEBoot_dprintf ("ehci", "setup_transfer: td_first=%p, td_alt=%p\n", cdata->td_first_virt, cdata->td_alt_virt); - grub_dprintf ("ehci", "setup_transfer: td_last=%p\n", + VasEBoot_dprintf ("ehci", "setup_transfer: td_last=%p\n", cdata->td_last_virt); /* Start transfer: */ /* Unlink possible alternate pointer in QH */ cdata->qh_virt->td_overlay.alt_next_td = - grub_cpu_to_le32_compile_time (GRUB_EHCI_TERMINATE); + VasEBoot_cpu_to_le32_compile_time (VasEBoot_EHCI_TERMINATE); /* Link new TDs with QH via next_td */ cdata->qh_virt->td_overlay.next_td = - grub_cpu_to_le32 (grub_dma_virt2phys + VasEBoot_cpu_to_le32 (VasEBoot_dma_virt2phys (cdata->td_first_virt, e->td_chunk)); /* Reset Active and Halted bits in QH to activate Advance Queue, * i.e. reset token */ - cdata->qh_virt->td_overlay.token = grub_cpu_to_le32_compile_time (0); + cdata->qh_virt->td_overlay.token = VasEBoot_cpu_to_le32_compile_time (0); sync_all_caches (e); /* Finito */ transfer->controller_data = cdata; - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } /* This function expects QH is not active. * Function set Halt bit in QH TD overlay and possibly prints * necessary debug information. */ static void -grub_ehci_pre_finish_transfer (grub_usb_transfer_t transfer) +VasEBoot_ehci_pre_finish_transfer (VasEBoot_usb_transfer_t transfer) { - struct grub_ehci_transfer_controller_data *cdata = + struct VasEBoot_ehci_transfer_controller_data *cdata = transfer->controller_data; /* Collect debug data here if necessary */ @@ -1446,228 +1446,228 @@ grub_ehci_pre_finish_transfer (grub_usb_transfer_t transfer) * safely manipulate with QH TD part. */ cdata->qh_virt->td_overlay.token = (cdata->qh_virt->td_overlay.token | - grub_cpu_to_le32_compile_time - (GRUB_EHCI_STATUS_HALTED)) & - grub_cpu_to_le32_compile_time (~GRUB_EHCI_STATUS_ACTIVE); + VasEBoot_cpu_to_le32_compile_time + (VasEBoot_EHCI_STATUS_HALTED)) & + VasEBoot_cpu_to_le32_compile_time (~VasEBoot_EHCI_STATUS_ACTIVE); /* Print debug data here if necessary */ } -static grub_usb_err_t -grub_ehci_parse_notrun (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, grub_size_t * actual) +static VasEBoot_usb_err_t +VasEBoot_ehci_parse_notrun (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, VasEBoot_size_t * actual) { - struct grub_ehci *e = dev->data; - struct grub_ehci_transfer_controller_data *cdata = + struct VasEBoot_ehci *e = dev->data; + struct VasEBoot_ehci_transfer_controller_data *cdata = transfer->controller_data; - grub_dprintf ("ehci", "parse_notrun: info\n"); + VasEBoot_dprintf ("ehci", "parse_notrun: info\n"); /* QH can be in any state in this case. */ /* But EHCI or AL is not running, so QH is surely not active * even if it has Active bit set... */ - grub_ehci_pre_finish_transfer (transfer); - grub_ehci_free_tds (e, cdata->td_first_virt, transfer, actual); - grub_ehci_free_td (e, cdata->td_alt_virt); - grub_free (cdata); + VasEBoot_ehci_pre_finish_transfer (transfer); + VasEBoot_ehci_free_tds (e, cdata->td_first_virt, transfer, actual); + VasEBoot_ehci_free_td (e, cdata->td_alt_virt); + VasEBoot_free (cdata); sync_all_caches (e); /* Additionally, do something with EHCI to make it running (what?) */ /* Try enable EHCI and AL */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_RUNSTOP | GRUB_EHCI_CMD_AS_ENABL - | GRUB_EHCI_CMD_PS_ENABL - | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_RUNSTOP | VasEBoot_EHCI_CMD_AS_ENABL + | VasEBoot_EHCI_CMD_PS_ENABL + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Ensure command is written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND); + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND); - return GRUB_USB_ERR_UNRECOVERABLE; + return VasEBoot_USB_ERR_UNRECOVERABLE; } -static grub_usb_err_t -grub_ehci_parse_halt (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, grub_size_t * actual) +static VasEBoot_usb_err_t +VasEBoot_ehci_parse_halt (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, VasEBoot_size_t * actual) { - struct grub_ehci *e = dev->data; - struct grub_ehci_transfer_controller_data *cdata = + struct VasEBoot_ehci *e = dev->data; + struct VasEBoot_ehci_transfer_controller_data *cdata = transfer->controller_data; - grub_uint32_t token; - grub_usb_err_t err = GRUB_USB_ERR_NAK; + VasEBoot_uint32_t token; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NAK; /* QH should be halted and not active in this case. */ - grub_dprintf ("ehci", "parse_halt: info\n"); + VasEBoot_dprintf ("ehci", "parse_halt: info\n"); /* Remember token before call pre-finish function */ - token = grub_le_to_cpu32 (cdata->qh_virt->td_overlay.token); + token = VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.token); /* Do things like in normal finish */ - grub_ehci_pre_finish_transfer (transfer); - grub_ehci_free_tds (e, cdata->td_first_virt, transfer, actual); - grub_ehci_free_td (e, cdata->td_alt_virt); - grub_free (cdata); + VasEBoot_ehci_pre_finish_transfer (transfer); + VasEBoot_ehci_free_tds (e, cdata->td_first_virt, transfer, actual); + VasEBoot_ehci_free_td (e, cdata->td_alt_virt); + VasEBoot_free (cdata); sync_all_caches (e); - /* Evaluation of error code - currently we don't have GRUB USB error - * codes for some EHCI states, GRUB_USB_ERR_DATA is used for them. + /* Evaluation of error code - currently we don't have VasEBoot USB error + * codes for some EHCI states, VasEBoot_USB_ERR_DATA is used for them. * Order of evaluation is critical, specially bubble/stall. */ - if ((token & GRUB_EHCI_STATUS_BABBLE) != 0) - err = GRUB_USB_ERR_BABBLE; - else if ((token & GRUB_EHCI_CERR_MASK) != 0) - err = GRUB_USB_ERR_STALL; - else if ((token & GRUB_EHCI_STATUS_TRANERR) != 0) - err = GRUB_USB_ERR_DATA; - else if ((token & GRUB_EHCI_STATUS_BUFERR) != 0) - err = GRUB_USB_ERR_DATA; - else if ((token & GRUB_EHCI_STATUS_MISSDMF) != 0) - err = GRUB_USB_ERR_DATA; + if ((token & VasEBoot_EHCI_STATUS_BABBLE) != 0) + err = VasEBoot_USB_ERR_BABBLE; + else if ((token & VasEBoot_EHCI_CERR_MASK) != 0) + err = VasEBoot_USB_ERR_STALL; + else if ((token & VasEBoot_EHCI_STATUS_TRANERR) != 0) + err = VasEBoot_USB_ERR_DATA; + else if ((token & VasEBoot_EHCI_STATUS_BUFERR) != 0) + err = VasEBoot_USB_ERR_DATA; + else if ((token & VasEBoot_EHCI_STATUS_MISSDMF) != 0) + err = VasEBoot_USB_ERR_DATA; return err; } -static grub_usb_err_t -grub_ehci_parse_success (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, grub_size_t * actual) +static VasEBoot_usb_err_t +VasEBoot_ehci_parse_success (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, VasEBoot_size_t * actual) { - struct grub_ehci *e = dev->data; - struct grub_ehci_transfer_controller_data *cdata = + struct VasEBoot_ehci *e = dev->data; + struct VasEBoot_ehci_transfer_controller_data *cdata = transfer->controller_data; - grub_dprintf ("ehci", "parse_success: info\n"); + VasEBoot_dprintf ("ehci", "parse_success: info\n"); /* QH should be not active in this case, but it is not halted. */ - grub_ehci_pre_finish_transfer (transfer); - grub_ehci_free_tds (e, cdata->td_first_virt, transfer, actual); - grub_ehci_free_td (e, cdata->td_alt_virt); - grub_free (cdata); + VasEBoot_ehci_pre_finish_transfer (transfer); + VasEBoot_ehci_free_tds (e, cdata->td_first_virt, transfer, actual); + VasEBoot_ehci_free_td (e, cdata->td_alt_virt); + VasEBoot_free (cdata); sync_all_caches (e); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_err_t -grub_ehci_check_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, grub_size_t * actual) +static VasEBoot_usb_err_t +VasEBoot_ehci_check_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, VasEBoot_size_t * actual) { - struct grub_ehci *e = dev->data; - struct grub_ehci_transfer_controller_data *cdata = + struct VasEBoot_ehci *e = dev->data; + struct VasEBoot_ehci_transfer_controller_data *cdata = transfer->controller_data; - grub_uint32_t token, token_ftd; + VasEBoot_uint32_t token, token_ftd; sync_all_caches (e); - grub_dprintf ("ehci", + VasEBoot_dprintf ("ehci", "check_transfer: EHCI STATUS=%08x, cdata=%p, qh=%p\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS), + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS), cdata, cdata->qh_virt); - grub_dprintf ("ehci", "check_transfer: qh_hptr=%08x, ep_char=%08x\n", - grub_le_to_cpu32 (cdata->qh_virt->qh_hptr), - grub_le_to_cpu32 (cdata->qh_virt->ep_char)); - grub_dprintf ("ehci", "check_transfer: ep_cap=%08x, td_current=%08x\n", - grub_le_to_cpu32 (cdata->qh_virt->ep_cap), - grub_le_to_cpu32 (cdata->qh_virt->td_current)); - grub_dprintf ("ehci", "check_transfer: next_td=%08x, alt_next_td=%08x\n", - grub_le_to_cpu32 (cdata->qh_virt->td_overlay.next_td), - grub_le_to_cpu32 (cdata->qh_virt->td_overlay.alt_next_td)); - grub_dprintf ("ehci", "check_transfer: token=%08x, buffer[0]=%08x\n", - grub_le_to_cpu32 (cdata->qh_virt->td_overlay.token), - grub_le_to_cpu32 (cdata->qh_virt->td_overlay.buffer_page[0])); + VasEBoot_dprintf ("ehci", "check_transfer: qh_hptr=%08x, ep_char=%08x\n", + VasEBoot_le_to_cpu32 (cdata->qh_virt->qh_hptr), + VasEBoot_le_to_cpu32 (cdata->qh_virt->ep_char)); + VasEBoot_dprintf ("ehci", "check_transfer: ep_cap=%08x, td_current=%08x\n", + VasEBoot_le_to_cpu32 (cdata->qh_virt->ep_cap), + VasEBoot_le_to_cpu32 (cdata->qh_virt->td_current)); + VasEBoot_dprintf ("ehci", "check_transfer: next_td=%08x, alt_next_td=%08x\n", + VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.next_td), + VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.alt_next_td)); + VasEBoot_dprintf ("ehci", "check_transfer: token=%08x, buffer[0]=%08x\n", + VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.token), + VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.buffer_page[0])); /* Check if EHCI is running and AL is enabled */ - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & GRUB_EHCI_ST_HC_HALTED) != 0) - return grub_ehci_parse_notrun (dev, transfer, actual); - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & (GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0) - return grub_ehci_parse_notrun (dev, transfer, actual); + if ((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) + & VasEBoot_EHCI_ST_HC_HALTED) != 0) + return VasEBoot_ehci_parse_notrun (dev, transfer, actual); + if ((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) + & (VasEBoot_EHCI_ST_AS_STATUS | VasEBoot_EHCI_ST_PS_STATUS)) == 0) + return VasEBoot_ehci_parse_notrun (dev, transfer, actual); - token = grub_le_to_cpu32 (cdata->qh_virt->td_overlay.token); + token = VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.token); /* If the transfer consist from only one TD, we should check */ /* if the TD was really executed and deactivated - to prevent */ /* false detection of transfer finish. */ - token_ftd = grub_le_to_cpu32 (cdata->td_first_virt->token); + token_ftd = VasEBoot_le_to_cpu32 (cdata->td_first_virt->token); /* Detect QH halted */ - if ((token & GRUB_EHCI_STATUS_HALTED) != 0) - return grub_ehci_parse_halt (dev, transfer, actual); + if ((token & VasEBoot_EHCI_STATUS_HALTED) != 0) + return VasEBoot_ehci_parse_halt (dev, transfer, actual); /* Detect QH not active - QH is not active and no next TD */ - if (token && ((token & GRUB_EHCI_STATUS_ACTIVE) == 0) - && ((token_ftd & GRUB_EHCI_STATUS_ACTIVE) == 0)) + if (token && ((token & VasEBoot_EHCI_STATUS_ACTIVE) == 0) + && ((token_ftd & VasEBoot_EHCI_STATUS_ACTIVE) == 0)) { /* It could be finish at all or short packet condition */ - if ((grub_le_to_cpu32 (cdata->qh_virt->td_overlay.next_td) - & GRUB_EHCI_TERMINATE) && - ((grub_le_to_cpu32 (cdata->qh_virt->td_current) - & GRUB_EHCI_QHTDPTR_MASK) == cdata->td_last_phys)) + if ((VasEBoot_le_to_cpu32 (cdata->qh_virt->td_overlay.next_td) + & VasEBoot_EHCI_TERMINATE) && + ((VasEBoot_le_to_cpu32 (cdata->qh_virt->td_current) + & VasEBoot_EHCI_QHTDPTR_MASK) == cdata->td_last_phys)) /* Normal finish */ - return grub_ehci_parse_success (dev, transfer, actual); - else if ((token & GRUB_EHCI_TOTAL_MASK) != 0) + return VasEBoot_ehci_parse_success (dev, transfer, actual); + else if ((token & VasEBoot_EHCI_TOTAL_MASK) != 0) /* Short packet condition */ /* But currently we don't handle it - higher level will do it */ - return grub_ehci_parse_success (dev, transfer, actual); + return VasEBoot_ehci_parse_success (dev, transfer, actual); } - return GRUB_USB_ERR_WAIT; + return VasEBoot_USB_ERR_WAIT; } -static grub_usb_err_t -grub_ehci_cancel_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +static VasEBoot_usb_err_t +VasEBoot_ehci_cancel_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_ehci *e = dev->data; - struct grub_ehci_transfer_controller_data *cdata = + struct VasEBoot_ehci *e = dev->data; + struct VasEBoot_ehci_transfer_controller_data *cdata = transfer->controller_data; - grub_size_t actual; + VasEBoot_size_t actual; int i; - grub_uint64_t maxtime; - grub_uint32_t qh_phys; + VasEBoot_uint64_t maxtime; + VasEBoot_uint32_t qh_phys; sync_all_caches (e); - grub_uint32_t interrupt = - cdata->qh_virt->ep_cap & GRUB_EHCI_SMASK_MASK; + VasEBoot_uint32_t interrupt = + cdata->qh_virt->ep_cap & VasEBoot_EHCI_SMASK_MASK; /* QH can be active and should be de-activated and halted */ - grub_dprintf ("ehci", "cancel_transfer: begin\n"); + VasEBoot_dprintf ("ehci", "cancel_transfer: begin\n"); /* First check if EHCI is running - if not, there is no problem */ /* to cancel any transfer. Or, if transfer is asynchronous, check */ /* if AL is enabled - if not, transfer can be canceled also. */ - if (((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) & - GRUB_EHCI_ST_HC_HALTED) != 0) || - (!interrupt && ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) & - (GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0))) + if (((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) & + VasEBoot_EHCI_ST_HC_HALTED) != 0) || + (!interrupt && ((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) & + (VasEBoot_EHCI_ST_AS_STATUS | VasEBoot_EHCI_ST_PS_STATUS)) == 0))) { - grub_ehci_pre_finish_transfer (transfer); - grub_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual); - grub_ehci_free_td (e, cdata->td_alt_virt); - grub_free (cdata); + VasEBoot_ehci_pre_finish_transfer (transfer); + VasEBoot_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual); + VasEBoot_ehci_free_td (e, cdata->td_alt_virt); + VasEBoot_free (cdata); sync_all_caches (e); - grub_dprintf ("ehci", "cancel_transfer: end - EHCI not running\n"); - return GRUB_USB_ERR_NONE; + VasEBoot_dprintf ("ehci", "cancel_transfer: end - EHCI not running\n"); + return VasEBoot_USB_ERR_NONE; } /* EHCI and (AL or SL) are running. What to do? */ /* Try to Halt QH via de-scheduling QH. */ /* Find index of previous QH */ - qh_phys = grub_dma_virt2phys(cdata->qh_virt, e->qh_chunk); - for (i = 0; i < GRUB_EHCI_N_QH; i++) + qh_phys = VasEBoot_dma_virt2phys(cdata->qh_virt, e->qh_chunk); + for (i = 0; i < VasEBoot_EHCI_N_QH; i++) { - if ((grub_le_to_cpu32(e->qh_virt[i].qh_hptr) - & GRUB_EHCI_QHTDPTR_MASK) == qh_phys) + if ((VasEBoot_le_to_cpu32(e->qh_virt[i].qh_hptr) + & VasEBoot_EHCI_QHTDPTR_MASK) == qh_phys) break; } - if (i == GRUB_EHCI_N_QH) + if (i == VasEBoot_EHCI_N_QH) { - grub_printf ("%s: prev not found, queues are corrupt\n", __func__); - return GRUB_USB_ERR_UNRECOVERABLE; + VasEBoot_printf ("%s: prev not found, queues are corrupt\n", __func__); + return VasEBoot_USB_ERR_UNRECOVERABLE; } /* Unlink QH from AL */ e->qh_virt[i].qh_hptr = cdata->qh_virt->qh_hptr; @@ -1677,9 +1677,9 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, /* If this is an interrupt transfer, we just wait for the periodic * schedule to advance a few times and then assume that the EHCI * controller has read the updated QH. */ - if (cdata->qh_virt->ep_cap & GRUB_EHCI_SMASK_MASK) + if (cdata->qh_virt->ep_cap & VasEBoot_EHCI_SMASK_MASK) { - grub_millisleep(20); + VasEBoot_millisleep(20); } else { @@ -1687,164 +1687,164 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, * out when the EHCI controller has read the updated QH. */ /* Ring the doorbell */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_AS_ADV_D - | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_AS_ADV_D + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Ensure command is written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND); + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND); /* Wait answer with timeout */ - maxtime = grub_get_time_ms () + 2; - while (((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & GRUB_EHCI_ST_AS_ADVANCE) == 0) - && (grub_get_time_ms () < maxtime)); + maxtime = VasEBoot_get_time_ms () + 2; + while (((VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS) + & VasEBoot_EHCI_ST_AS_ADVANCE) == 0) + && (VasEBoot_get_time_ms () < maxtime)); /* We do not detect the timeout because if timeout occurs, it most * probably means something wrong with EHCI - maybe stopped etc. */ /* Shut up the doorbell */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - ~GRUB_EHCI_CMD_AS_ADV_D - & grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); - grub_ehci_oper_write32 (e, GRUB_EHCI_STATUS, - GRUB_EHCI_ST_AS_ADVANCE - | grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + ~VasEBoot_EHCI_CMD_AS_ADV_D + & VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_STATUS, + VasEBoot_EHCI_ST_AS_ADVANCE + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS)); /* Ensure command is written */ - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS); } /* Now is QH out of AL and we can do anything with it... */ - grub_ehci_pre_finish_transfer (transfer); - grub_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual); - grub_ehci_free_td (e, cdata->td_alt_virt); + VasEBoot_ehci_pre_finish_transfer (transfer); + VasEBoot_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual); + VasEBoot_ehci_free_td (e, cdata->td_alt_virt); /* "Free" the QH - link it to itself */ cdata->qh_virt->ep_char = 0; cdata->qh_virt->qh_hptr = - grub_cpu_to_le32 ((grub_dma_virt2phys (cdata->qh_virt, + VasEBoot_cpu_to_le32 ((VasEBoot_dma_virt2phys (cdata->qh_virt, e->qh_chunk) - & GRUB_EHCI_POINTER_MASK) | GRUB_EHCI_HPTR_TYPE_QH); + & VasEBoot_EHCI_POINTER_MASK) | VasEBoot_EHCI_HPTR_TYPE_QH); - grub_free (cdata); + VasEBoot_free (cdata); - grub_dprintf ("ehci", "cancel_transfer: end\n"); + VasEBoot_dprintf ("ehci", "cancel_transfer: end\n"); sync_all_caches (e); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } static int -grub_ehci_hubports (grub_usb_controller_t dev) +VasEBoot_ehci_hubports (VasEBoot_usb_controller_t dev) { - struct grub_ehci *e = (struct grub_ehci *) dev->data; - grub_uint32_t portinfo; + struct VasEBoot_ehci *e = (struct VasEBoot_ehci *) dev->data; + VasEBoot_uint32_t portinfo; - portinfo = grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_SPARAMS) - & GRUB_EHCI_SPARAMS_N_PORTS; - grub_dprintf ("ehci", "root hub ports=%d\n", portinfo); + portinfo = VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_SPARAMS) + & VasEBoot_EHCI_SPARAMS_N_PORTS; + VasEBoot_dprintf ("ehci", "root hub ports=%d\n", portinfo); return portinfo; } -static grub_usb_err_t -grub_ehci_portstatus (grub_usb_controller_t dev, +static VasEBoot_usb_err_t +VasEBoot_ehci_portstatus (VasEBoot_usb_controller_t dev, unsigned int port, unsigned int enable) { - struct grub_ehci *e = (struct grub_ehci *) dev->data; - grub_uint64_t endtime; + struct VasEBoot_ehci *e = (struct VasEBoot_ehci *) dev->data; + VasEBoot_uint64_t endtime; - grub_dprintf ("ehci", "portstatus: EHCI STATUS: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)); - grub_dprintf ("ehci", + VasEBoot_dprintf ("ehci", "portstatus: EHCI STATUS: %08x\n", + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_STATUS)); + VasEBoot_dprintf ("ehci", "portstatus: begin, iobase=%p, port=%d, status=0x%02x\n", - e->iobase, port, grub_ehci_port_read (e, port)); + e->iobase, port, VasEBoot_ehci_port_read (e, port)); /* In any case we need to disable port: * - if enable==false - we should disable port * - if enable==true we will do the reset and the specification says * PortEnable should be FALSE in such case */ /* Disable the port and wait for it. */ - grub_ehci_port_resbits (e, port, GRUB_EHCI_PORT_ENABLED); - endtime = grub_get_time_ms () + 1000; - while (grub_ehci_port_read (e, port) & GRUB_EHCI_PORT_ENABLED) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; + VasEBoot_ehci_port_resbits (e, port, VasEBoot_EHCI_PORT_ENABLED); + endtime = VasEBoot_get_time_ms () + 1000; + while (VasEBoot_ehci_port_read (e, port) & VasEBoot_EHCI_PORT_ENABLED) + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; if (!enable) /* We don't need reset port */ { - grub_dprintf ("ehci", "portstatus: Disabled.\n"); - grub_dprintf ("ehci", "portstatus: end, status=0x%02x\n", - grub_ehci_port_read (e, port)); - return GRUB_USB_ERR_NONE; + VasEBoot_dprintf ("ehci", "portstatus: Disabled.\n"); + VasEBoot_dprintf ("ehci", "portstatus: end, status=0x%02x\n", + VasEBoot_ehci_port_read (e, port)); + return VasEBoot_USB_ERR_NONE; } - grub_dprintf ("ehci", "portstatus: enable\n"); + VasEBoot_dprintf ("ehci", "portstatus: enable\n"); - grub_boot_time ("Resetting port %d", port); + VasEBoot_boot_time ("Resetting port %d", port); /* Now we will do reset - if HIGH speed device connected, it will * result in Enabled state, otherwise port remains disabled. */ /* Set RESET bit for 50ms */ - grub_ehci_port_setbits (e, port, GRUB_EHCI_PORT_RESET); - grub_millisleep (50); + VasEBoot_ehci_port_setbits (e, port, VasEBoot_EHCI_PORT_RESET); + VasEBoot_millisleep (50); /* Reset RESET bit and wait for the end of reset */ - grub_ehci_port_resbits (e, port, GRUB_EHCI_PORT_RESET); - endtime = grub_get_time_ms () + 1000; - while (grub_ehci_port_read (e, port) & GRUB_EHCI_PORT_RESET) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; - grub_boot_time ("Port %d reset", port); + VasEBoot_ehci_port_resbits (e, port, VasEBoot_EHCI_PORT_RESET); + endtime = VasEBoot_get_time_ms () + 1000; + while (VasEBoot_ehci_port_read (e, port) & VasEBoot_EHCI_PORT_RESET) + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; + VasEBoot_boot_time ("Port %d reset", port); /* Remember "we did the reset" - needed by detect_dev */ e->reset |= (1 << port); /* Test if port enabled, i.e. HIGH speed device connected */ - if ((grub_ehci_port_read (e, port) & GRUB_EHCI_PORT_ENABLED) != 0) /* yes! */ + if ((VasEBoot_ehci_port_read (e, port) & VasEBoot_EHCI_PORT_ENABLED) != 0) /* yes! */ { - grub_dprintf ("ehci", "portstatus: Enabled!\n"); + VasEBoot_dprintf ("ehci", "portstatus: Enabled!\n"); /* "Reset recovery time" (USB spec.) */ - grub_millisleep (10); + VasEBoot_millisleep (10); } else /* no... */ { /* FULL speed device connected - change port ownership. * It results in disconnected state of this EHCI port. */ - grub_ehci_port_setbits (e, port, GRUB_EHCI_PORT_OWNER); - return GRUB_USB_ERR_BADDEVICE; + VasEBoot_ehci_port_setbits (e, port, VasEBoot_EHCI_PORT_OWNER); + return VasEBoot_USB_ERR_BADDEVICE; } /* XXX: Fix it! There is possible problem - we can say to calling * function that we lost device if it is FULL speed onlu via - * return value <> GRUB_ERR_NONE. It (maybe) displays also error + * return value <> VasEBoot_ERR_NONE. It (maybe) displays also error * message on screen - but this situation is not error, it is normal * state! */ - grub_dprintf ("ehci", "portstatus: end, status=0x%02x\n", - grub_ehci_port_read (e, port)); + VasEBoot_dprintf ("ehci", "portstatus: end, status=0x%02x\n", + VasEBoot_ehci_port_read (e, port)); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_speed_t -grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed) +static VasEBoot_usb_speed_t +VasEBoot_ehci_detect_dev (VasEBoot_usb_controller_t dev, int port, int *changed) { - struct grub_ehci *e = (struct grub_ehci *) dev->data; - grub_uint32_t status, line_state; + struct VasEBoot_ehci *e = (struct VasEBoot_ehci *) dev->data; + VasEBoot_uint32_t status, line_state; - status = grub_ehci_port_read (e, port); + status = VasEBoot_ehci_port_read (e, port); /* Connect Status Change bit - it detects change of connection */ - if (status & GRUB_EHCI_PORT_CONNECT_CH) + if (status & VasEBoot_EHCI_PORT_CONNECT_CH) { *changed = 1; /* Reset bit Connect Status Change */ - grub_ehci_port_setbits (e, port, GRUB_EHCI_PORT_CONNECT_CH); + VasEBoot_ehci_port_setbits (e, port, VasEBoot_EHCI_PORT_CONNECT_CH); } else *changed = 0; - if (!(status & GRUB_EHCI_PORT_CONNECT)) + if (!(status & VasEBoot_EHCI_PORT_CONNECT)) { /* We should reset related "reset" flag in not connected state */ e->reset &= ~(1 << port); - return GRUB_USB_SPEED_NONE; + return VasEBoot_USB_SPEED_NONE; } /* Detected connected state, so we should return speed. * But we can detect only LOW speed device and only at connection @@ -1867,23 +1867,23 @@ grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed) * 5. If we detect connected, not enabled and not reset port, which * has line state == "K", we can say NONE speed, because LOW speed * device is connected and we should change port ownership. */ - if ((status & GRUB_EHCI_PORT_ENABLED) != 0) /* Port already enabled, return high speed. */ - return GRUB_USB_SPEED_HIGH; - if ((status & GRUB_EHCI_PORT_OWNER) != 0) /* EHCI is not port owner */ - return GRUB_USB_SPEED_NONE; /* EHCI driver is ignoring this port. */ + if ((status & VasEBoot_EHCI_PORT_ENABLED) != 0) /* Port already enabled, return high speed. */ + return VasEBoot_USB_SPEED_HIGH; + if ((status & VasEBoot_EHCI_PORT_OWNER) != 0) /* EHCI is not port owner */ + return VasEBoot_USB_SPEED_NONE; /* EHCI driver is ignoring this port. */ if ((e->reset & (1 << port)) != 0) /* Port reset was done = FULL speed */ - return GRUB_USB_SPEED_NONE; /* EHCI driver is ignoring this port. */ + return VasEBoot_USB_SPEED_NONE; /* EHCI driver is ignoring this port. */ else /* Port connected but not enabled - test port speed. */ { - line_state = status & GRUB_EHCI_PORT_LINE_STAT; - if (line_state != GRUB_EHCI_PORT_LINE_LOWSP) - return GRUB_USB_SPEED_HIGH; + line_state = status & VasEBoot_EHCI_PORT_LINE_STAT; + if (line_state != VasEBoot_EHCI_PORT_LINE_LOWSP) + return VasEBoot_USB_SPEED_HIGH; /* Detected LOW speed device, we should change * port ownership. * XXX: Fix it!: There should be test if related companion * controler is available ! And what to do if it does not exist ? */ - grub_ehci_port_setbits (e, port, GRUB_EHCI_PORT_OWNER); - return GRUB_USB_SPEED_NONE; /* Ignore this port */ + VasEBoot_ehci_port_setbits (e, port, VasEBoot_EHCI_PORT_OWNER); + return VasEBoot_USB_SPEED_NONE; /* Ignore this port */ /* Note: Reset of PORT_OWNER bit is done by EHCI HW when * device is really disconnected from port. * Don't do PORT_OWNER bit reset by SW when not connected signal @@ -1892,121 +1892,121 @@ grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed) } static void -grub_ehci_inithw (void) +VasEBoot_ehci_inithw (void) { - grub_pci_iterate (grub_ehci_pci_iter, NULL); + VasEBoot_pci_iterate (VasEBoot_ehci_pci_iter, NULL); } -static grub_err_t -grub_ehci_restore_hw (void) +static VasEBoot_err_t +VasEBoot_ehci_restore_hw (void) { - struct grub_ehci *e; - grub_uint32_t n_ports; + struct VasEBoot_ehci *e; + VasEBoot_uint32_t n_ports; int i; /* We should re-enable all EHCI HW similarly as on inithw */ for (e = ehci; e; e = e->next) { /* Check if EHCI is halted and halt it if not */ - if (grub_ehci_halt (e) != GRUB_USB_ERR_NONE) - grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI halt timeout"); + if (VasEBoot_ehci_halt (e) != VasEBoot_USB_ERR_NONE) + VasEBoot_error (VasEBoot_ERR_TIMEOUT, "restore_hw: EHCI halt timeout"); /* Reset EHCI */ - if (grub_ehci_reset (e) != GRUB_USB_ERR_NONE) - grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI reset timeout"); + if (VasEBoot_ehci_reset (e) != VasEBoot_USB_ERR_NONE) + VasEBoot_error (VasEBoot_ERR_TIMEOUT, "restore_hw: EHCI reset timeout"); /* Setup some EHCI registers and enable EHCI */ - grub_ehci_oper_write32 (e, GRUB_EHCI_FL_BASE, e->framelist_phys); - grub_ehci_oper_write32 (e, GRUB_EHCI_CUR_AL_ADDR, - grub_dma_virt2phys (&e->qh_virt[1], + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_FL_BASE, e->framelist_phys); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_CUR_AL_ADDR, + VasEBoot_dma_virt2phys (&e->qh_virt[1], e->qh_chunk)); - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_RUNSTOP | - grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_RUNSTOP | + VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Set ownership of root hub ports to EHCI */ - grub_ehci_oper_write32 (e, GRUB_EHCI_CONFIG_FLAG, - GRUB_EHCI_CF_EHCI_OWNER); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_CONFIG_FLAG, + VasEBoot_EHCI_CF_EHCI_OWNER); /* Enable asynchronous list */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - GRUB_EHCI_CMD_AS_ENABL - | GRUB_EHCI_CMD_PS_ENABL - | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + VasEBoot_EHCI_CMD_AS_ENABL + | VasEBoot_EHCI_CMD_PS_ENABL + | VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Now should be possible to power-up and enumerate ports etc. */ - if ((grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_SPARAMS) - & GRUB_EHCI_SPARAMS_PPC) != 0) + if ((VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_SPARAMS) + & VasEBoot_EHCI_SPARAMS_PPC) != 0) { /* EHCI has port powering control */ /* Power on all ports */ - n_ports = grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_SPARAMS) - & GRUB_EHCI_SPARAMS_N_PORTS; + n_ports = VasEBoot_ehci_ehcc_read32 (e, VasEBoot_EHCI_EHCC_SPARAMS) + & VasEBoot_EHCI_SPARAMS_N_PORTS; for (i = 0; i < (int) n_ports; i++) - grub_ehci_oper_write32 (e, GRUB_EHCI_PORT_STAT_CMD + i * 4, - GRUB_EHCI_PORT_POWER - | grub_ehci_oper_read32 (e, - GRUB_EHCI_PORT_STAT_CMD + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_PORT_STAT_CMD + i * 4, + VasEBoot_EHCI_PORT_POWER + | VasEBoot_ehci_oper_read32 (e, + VasEBoot_EHCI_PORT_STAT_CMD + i * 4)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_ehci_fini_hw (int noreturn __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_ehci_fini_hw (int noreturn __attribute__ ((unused))) { - struct grub_ehci *e; + struct VasEBoot_ehci *e; /* We should disable all EHCI HW to prevent any DMA access etc. */ for (e = ehci; e; e = e->next) { /* Disable both lists */ - grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, - ~(GRUB_EHCI_CMD_AS_ENABL | GRUB_EHCI_CMD_PS_ENABL) - & grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); + VasEBoot_ehci_oper_write32 (e, VasEBoot_EHCI_COMMAND, + ~(VasEBoot_EHCI_CMD_AS_ENABL | VasEBoot_EHCI_CMD_PS_ENABL) + & VasEBoot_ehci_oper_read32 (e, VasEBoot_EHCI_COMMAND)); /* Check if EHCI is halted and halt it if not */ - grub_ehci_halt (e); + VasEBoot_ehci_halt (e); /* Reset EHCI */ - grub_ehci_reset (e); + VasEBoot_ehci_reset (e); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_usb_controller_dev usb_controller = { +static struct VasEBoot_usb_controller_dev usb_controller = { .name = "ehci", - .iterate = grub_ehci_iterate, - .setup_transfer = grub_ehci_setup_transfer, - .check_transfer = grub_ehci_check_transfer, - .cancel_transfer = grub_ehci_cancel_transfer, - .hubports = grub_ehci_hubports, - .portstatus = grub_ehci_portstatus, - .detect_dev = grub_ehci_detect_dev, + .iterate = VasEBoot_ehci_iterate, + .setup_transfer = VasEBoot_ehci_setup_transfer, + .check_transfer = VasEBoot_ehci_check_transfer, + .cancel_transfer = VasEBoot_ehci_cancel_transfer, + .hubports = VasEBoot_ehci_hubports, + .portstatus = VasEBoot_ehci_portstatus, + .detect_dev = VasEBoot_ehci_detect_dev, /* estimated max. count of TDs for one bulk transfer */ - .max_bulk_tds = GRUB_EHCI_N_TD * 3 / 4 + .max_bulk_tds = VasEBoot_EHCI_N_TD * 3 / 4 }; -GRUB_MOD_INIT (ehci) +VasEBoot_MOD_INIT (ehci) { - COMPILE_TIME_ASSERT (sizeof (struct grub_ehci_td) == 64); - COMPILE_TIME_ASSERT (sizeof (struct grub_ehci_qh) == 96); + COMPILE_TIME_ASSERT (sizeof (struct VasEBoot_ehci_td) == 64); + COMPILE_TIME_ASSERT (sizeof (struct VasEBoot_ehci_qh) == 96); - grub_stop_disk_firmware (); + VasEBoot_stop_disk_firmware (); - grub_boot_time ("Initing EHCI hardware"); - grub_ehci_inithw (); - grub_boot_time ("Registering EHCI driver"); - grub_usb_controller_dev_register (&usb_controller); - grub_boot_time ("EHCI driver registered"); - grub_loader_register_preboot_hook (grub_ehci_fini_hw, grub_ehci_restore_hw, - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); + VasEBoot_boot_time ("Initing EHCI hardware"); + VasEBoot_ehci_inithw (); + VasEBoot_boot_time ("Registering EHCI driver"); + VasEBoot_usb_controller_dev_register (&usb_controller); + VasEBoot_boot_time ("EHCI driver registered"); + VasEBoot_loader_register_preboot_hook (VasEBoot_ehci_fini_hw, VasEBoot_ehci_restore_hw, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_DISK); } -GRUB_MOD_FINI (ehci) +VasEBoot_MOD_FINI (ehci) { - grub_ehci_fini_hw (0); - grub_usb_controller_dev_unregister (&usb_controller); + VasEBoot_ehci_fini_hw (0); + VasEBoot_usb_controller_dev_unregister (&usb_controller); } diff --git a/VasEBoot-core/bus/usb/ohci.c b/VasEBoot-core/bus/usb/ohci.c index f0be533d4..f7cb53250 100644 --- a/VasEBoot-core/bus/usb/ohci.c +++ b/VasEBoot-core/bus/usb/ohci.c @@ -1,213 +1,213 @@ /* ohci.c - OHCI Support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_ohci_hcca +struct VasEBoot_ohci_hcca { /* Pointers to Interrupt Endpoint Descriptors. Not used by - GRUB. */ - grub_uint32_t inttable[32]; + VasEBoot. */ + VasEBoot_uint32_t inttable[32]; /* Current frame number. */ - grub_uint16_t framenumber; + VasEBoot_uint16_t framenumber; - grub_uint16_t pad; + VasEBoot_uint16_t pad; /* List of completed TDs. */ - grub_uint32_t donehead; + VasEBoot_uint32_t donehead; - grub_uint8_t reserved[116]; -} GRUB_PACKED; + VasEBoot_uint8_t reserved[116]; +} VasEBoot_PACKED; /* OHCI General Transfer Descriptor */ -struct grub_ohci_td +struct VasEBoot_ohci_td { /* Information used to construct the TOKEN packet. */ - grub_uint32_t token; - grub_uint32_t buffer; /* LittleEndian physical address */ - grub_uint32_t next_td; /* LittleEndian physical address */ - grub_uint32_t buffer_end; /* LittleEndian physical address */ + VasEBoot_uint32_t token; + VasEBoot_uint32_t buffer; /* LittleEndian physical address */ + VasEBoot_uint32_t next_td; /* LittleEndian physical address */ + VasEBoot_uint32_t buffer_end; /* LittleEndian physical address */ /* next values are not for OHCI HW */ - volatile struct grub_ohci_td *link_td; /* pointer to next free/chained TD + volatile struct VasEBoot_ohci_td *link_td; /* pointer to next free/chained TD * pointer as uint32 */ - grub_uint32_t prev_td_phys; /* we need it to find previous TD + VasEBoot_uint32_t prev_td_phys; /* we need it to find previous TD * physical address in CPU endian */ - grub_uint32_t tr_index; /* index of TD in transfer */ - grub_uint8_t pad[8 - sizeof (volatile struct grub_ohci_td *)]; /* padding to 32 bytes */ -} GRUB_PACKED; + VasEBoot_uint32_t tr_index; /* index of TD in transfer */ + VasEBoot_uint8_t pad[8 - sizeof (volatile struct VasEBoot_ohci_td *)]; /* padding to 32 bytes */ +} VasEBoot_PACKED; /* OHCI Endpoint Descriptor. */ -struct grub_ohci_ed +struct VasEBoot_ohci_ed { - grub_uint32_t target; - grub_uint32_t td_tail; - grub_uint32_t td_head; - grub_uint32_t next_ed; -} GRUB_PACKED; + VasEBoot_uint32_t target; + VasEBoot_uint32_t td_tail; + VasEBoot_uint32_t td_head; + VasEBoot_uint32_t next_ed; +} VasEBoot_PACKED; -typedef volatile struct grub_ohci_td *grub_ohci_td_t; -typedef volatile struct grub_ohci_ed *grub_ohci_ed_t; +typedef volatile struct VasEBoot_ohci_td *VasEBoot_ohci_td_t; +typedef volatile struct VasEBoot_ohci_ed *VasEBoot_ohci_ed_t; /* Experimental change of ED/TD allocation */ /* Little bit similar as in UHCI */ /* Implementation assumes: * 32-bits architecture - XXX: fix for 64-bits - * memory allocated by grub_memalign_dma32 must be continuous + * memory allocated by VasEBoot_memalign_dma32 must be continuous * in virtual and also in physical memory */ -struct grub_ohci +struct VasEBoot_ohci { - volatile grub_uint32_t *iobase; - volatile struct grub_ohci_hcca *hcca; - grub_uint32_t hcca_addr; - struct grub_pci_dma_chunk *hcca_chunk; - grub_ohci_ed_t ed_ctrl; /* EDs for CONTROL */ - grub_uint32_t ed_ctrl_addr; - struct grub_pci_dma_chunk *ed_ctrl_chunk; - grub_ohci_ed_t ed_bulk; /* EDs for BULK */ - grub_uint32_t ed_bulk_addr; - struct grub_pci_dma_chunk *ed_bulk_chunk; - grub_ohci_td_t td; /* TDs */ - grub_uint32_t td_addr; - struct grub_pci_dma_chunk *td_chunk; - struct grub_ohci *next; - grub_ohci_td_t td_free; /* Pointer to first free TD */ + volatile VasEBoot_uint32_t *iobase; + volatile struct VasEBoot_ohci_hcca *hcca; + VasEBoot_uint32_t hcca_addr; + struct VasEBoot_pci_dma_chunk *hcca_chunk; + VasEBoot_ohci_ed_t ed_ctrl; /* EDs for CONTROL */ + VasEBoot_uint32_t ed_ctrl_addr; + struct VasEBoot_pci_dma_chunk *ed_ctrl_chunk; + VasEBoot_ohci_ed_t ed_bulk; /* EDs for BULK */ + VasEBoot_uint32_t ed_bulk_addr; + struct VasEBoot_pci_dma_chunk *ed_bulk_chunk; + VasEBoot_ohci_td_t td; /* TDs */ + VasEBoot_uint32_t td_addr; + struct VasEBoot_pci_dma_chunk *td_chunk; + struct VasEBoot_ohci *next; + VasEBoot_ohci_td_t td_free; /* Pointer to first free TD */ }; -static struct grub_ohci *ohci; +static struct VasEBoot_ohci *ohci; typedef enum { - GRUB_OHCI_REG_REVISION = 0x00, - GRUB_OHCI_REG_CONTROL, - GRUB_OHCI_REG_CMDSTATUS, - GRUB_OHCI_REG_INTSTATUS, - GRUB_OHCI_REG_INTENA, - GRUB_OHCI_REG_INTDIS, - GRUB_OHCI_REG_HCCA, - GRUB_OHCI_REG_PERIODIC, - GRUB_OHCI_REG_CONTROLHEAD, - GRUB_OHCI_REG_CONTROLCURR, - GRUB_OHCI_REG_BULKHEAD, - GRUB_OHCI_REG_BULKCURR, - GRUB_OHCI_REG_DONEHEAD, - GRUB_OHCI_REG_FRAME_INTERVAL, - GRUB_OHCI_REG_PERIODIC_START = 16, - GRUB_OHCI_REG_RHUBA = 18, - GRUB_OHCI_REG_RHUBPORT = 21, - GRUB_OHCI_REG_LEGACY_CONTROL = 0x100, - GRUB_OHCI_REG_LEGACY_INPUT = 0x104, - GRUB_OHCI_REG_LEGACY_OUTPUT = 0x108, - GRUB_OHCI_REG_LEGACY_STATUS = 0x10c -} grub_ohci_reg_t; + VasEBoot_OHCI_REG_REVISION = 0x00, + VasEBoot_OHCI_REG_CONTROL, + VasEBoot_OHCI_REG_CMDSTATUS, + VasEBoot_OHCI_REG_INTSTATUS, + VasEBoot_OHCI_REG_INTENA, + VasEBoot_OHCI_REG_INTDIS, + VasEBoot_OHCI_REG_HCCA, + VasEBoot_OHCI_REG_PERIODIC, + VasEBoot_OHCI_REG_CONTROLHEAD, + VasEBoot_OHCI_REG_CONTROLCURR, + VasEBoot_OHCI_REG_BULKHEAD, + VasEBoot_OHCI_REG_BULKCURR, + VasEBoot_OHCI_REG_DONEHEAD, + VasEBoot_OHCI_REG_FRAME_INTERVAL, + VasEBoot_OHCI_REG_PERIODIC_START = 16, + VasEBoot_OHCI_REG_RHUBA = 18, + VasEBoot_OHCI_REG_RHUBPORT = 21, + VasEBoot_OHCI_REG_LEGACY_CONTROL = 0x100, + VasEBoot_OHCI_REG_LEGACY_INPUT = 0x104, + VasEBoot_OHCI_REG_LEGACY_OUTPUT = 0x108, + VasEBoot_OHCI_REG_LEGACY_STATUS = 0x10c +} VasEBoot_ohci_reg_t; -#define GRUB_OHCI_RHUB_PORT_POWER_MASK 0x300 -#define GRUB_OHCI_RHUB_PORT_ALL_POWERED 0x200 +#define VasEBoot_OHCI_RHUB_PORT_POWER_MASK 0x300 +#define VasEBoot_OHCI_RHUB_PORT_ALL_POWERED 0x200 -#define GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK 0x8fff0000 -#define GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT 16 -#define GRUB_OHCI_REG_FRAME_INTERVAL_FI_SHIFT 0 +#define VasEBoot_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK 0x8fff0000 +#define VasEBoot_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT 16 +#define VasEBoot_OHCI_REG_FRAME_INTERVAL_FI_SHIFT 0 /* XXX: Is this choice of timings sane? */ -#define GRUB_OHCI_FSMPS 0x2778 -#define GRUB_OHCI_PERIODIC_START 0x257f -#define GRUB_OHCI_FRAME_INTERVAL 0x2edf +#define VasEBoot_OHCI_FSMPS 0x2778 +#define VasEBoot_OHCI_PERIODIC_START 0x257f +#define VasEBoot_OHCI_FRAME_INTERVAL 0x2edf -#define GRUB_OHCI_SET_PORT_ENABLE (1 << 1) -#define GRUB_OHCI_CLEAR_PORT_ENABLE (1 << 0) -#define GRUB_OHCI_SET_PORT_RESET (1 << 4) -#define GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE (1 << 20) +#define VasEBoot_OHCI_SET_PORT_ENABLE (1 << 1) +#define VasEBoot_OHCI_CLEAR_PORT_ENABLE (1 << 0) +#define VasEBoot_OHCI_SET_PORT_RESET (1 << 4) +#define VasEBoot_OHCI_SET_PORT_RESET_STATUS_CHANGE (1 << 20) -#define GRUB_OHCI_REG_CONTROL_BULK_ENABLE (1 << 5) -#define GRUB_OHCI_REG_CONTROL_CONTROL_ENABLE (1 << 4) +#define VasEBoot_OHCI_REG_CONTROL_BULK_ENABLE (1 << 5) +#define VasEBoot_OHCI_REG_CONTROL_CONTROL_ENABLE (1 << 4) -#define GRUB_OHCI_RESET_CONNECT_CHANGE (1 << 16) -#define GRUB_OHCI_CTRL_EDS 256 -#define GRUB_OHCI_BULK_EDS 510 -#define GRUB_OHCI_TDS 640 +#define VasEBoot_OHCI_RESET_CONNECT_CHANGE (1 << 16) +#define VasEBoot_OHCI_CTRL_EDS 256 +#define VasEBoot_OHCI_BULK_EDS 510 +#define VasEBoot_OHCI_TDS 640 -#define GRUB_OHCI_ED_ADDR_MASK 0x7ff +#define VasEBoot_OHCI_ED_ADDR_MASK 0x7ff -static inline grub_ohci_ed_t -grub_ohci_ed_phys2virt (struct grub_ohci *o, int bulk, grub_uint32_t x) +static inline VasEBoot_ohci_ed_t +VasEBoot_ohci_ed_phys2virt (struct VasEBoot_ohci *o, int bulk, VasEBoot_uint32_t x) { if (!x) return NULL; if (bulk) - return (grub_ohci_ed_t) (x - o->ed_bulk_addr - + (grub_uint8_t *) o->ed_bulk); - return (grub_ohci_ed_t) (x - o->ed_ctrl_addr - + (grub_uint8_t *) o->ed_ctrl); + return (VasEBoot_ohci_ed_t) (x - o->ed_bulk_addr + + (VasEBoot_uint8_t *) o->ed_bulk); + return (VasEBoot_ohci_ed_t) (x - o->ed_ctrl_addr + + (VasEBoot_uint8_t *) o->ed_ctrl); } -static grub_uint32_t -grub_ohci_virt_to_phys (struct grub_ohci *o, int bulk, grub_ohci_ed_t x) +static VasEBoot_uint32_t +VasEBoot_ohci_virt_to_phys (struct VasEBoot_ohci *o, int bulk, VasEBoot_ohci_ed_t x) { if (!x) return 0; if (bulk) - return (grub_uint8_t *) x - (grub_uint8_t *) o->ed_bulk + o->ed_bulk_addr; - return (grub_uint8_t *) x - (grub_uint8_t *) o->ed_ctrl + o->ed_ctrl_addr; + return (VasEBoot_uint8_t *) x - (VasEBoot_uint8_t *) o->ed_bulk + o->ed_bulk_addr; + return (VasEBoot_uint8_t *) x - (VasEBoot_uint8_t *) o->ed_ctrl + o->ed_ctrl_addr; } -static inline grub_ohci_td_t -grub_ohci_td_phys2virt (struct grub_ohci *o, grub_uint32_t x) +static inline VasEBoot_ohci_td_t +VasEBoot_ohci_td_phys2virt (struct VasEBoot_ohci *o, VasEBoot_uint32_t x) { if (!x) return NULL; - return (grub_ohci_td_t) (x - o->td_addr + (grub_uint8_t *) o->td); + return (VasEBoot_ohci_td_t) (x - o->td_addr + (VasEBoot_uint8_t *) o->td); } -static grub_uint32_t -grub_ohci_td_virt2phys (struct grub_ohci *o, grub_ohci_td_t x) +static VasEBoot_uint32_t +VasEBoot_ohci_td_virt2phys (struct VasEBoot_ohci *o, VasEBoot_ohci_td_t x) { if (!x) return 0; - return (grub_uint8_t *)x - (grub_uint8_t *)o->td + o->td_addr; + return (VasEBoot_uint8_t *)x - (VasEBoot_uint8_t *)o->td + o->td_addr; } -static grub_uint32_t -grub_ohci_readreg32 (struct grub_ohci *o, grub_ohci_reg_t reg) +static VasEBoot_uint32_t +VasEBoot_ohci_readreg32 (struct VasEBoot_ohci *o, VasEBoot_ohci_reg_t reg) { - return grub_le_to_cpu32 (*(o->iobase + reg)); + return VasEBoot_le_to_cpu32 (*(o->iobase + reg)); } static void -grub_ohci_writereg32 (struct grub_ohci *o, - grub_ohci_reg_t reg, grub_uint32_t val) +VasEBoot_ohci_writereg32 (struct VasEBoot_ohci *o, + VasEBoot_ohci_reg_t reg, VasEBoot_uint32_t val) { - *(o->iobase + reg) = grub_cpu_to_le32 (val); + *(o->iobase + reg) = VasEBoot_cpu_to_le32 (val); } @@ -215,44 +215,44 @@ grub_ohci_writereg32 (struct grub_ohci *o, /* Iterate over all PCI devices. Determine if a device is an OHCI controller. If this is the case, initialize it. */ static int -grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, +VasEBoot_ohci_pci_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_uint32_t interf; - grub_uint32_t base; - grub_pci_address_t addr; - struct grub_ohci *o; - grub_uint32_t revision; + VasEBoot_uint32_t interf; + VasEBoot_uint32_t base; + VasEBoot_pci_address_t addr; + struct VasEBoot_ohci *o; + VasEBoot_uint32_t revision; int j; /* Determine IO base address. */ - grub_dprintf ("ohci", "pciid = %x\n", pciid); + VasEBoot_dprintf ("ohci", "pciid = %x\n", pciid); - if (pciid == GRUB_CS5536_PCIID) + if (pciid == VasEBoot_CS5536_PCIID) { - grub_uint64_t basereg; + VasEBoot_uint64_t basereg; - basereg = grub_cs5536_read_msr (dev, GRUB_CS5536_MSR_USB_OHCI_BASE); - if (!(basereg & GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE)) + basereg = VasEBoot_cs5536_read_msr (dev, VasEBoot_CS5536_MSR_USB_OHCI_BASE); + if (!(basereg & VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE)) { /* Shouldn't happen. */ - grub_dprintf ("ohci", "No OHCI address is assigned\n"); + VasEBoot_dprintf ("ohci", "No OHCI address is assigned\n"); return 0; } - base = (basereg & GRUB_CS5536_MSR_USB_BASE_ADDR_MASK); - basereg |= GRUB_CS5536_MSR_USB_BASE_BUS_MASTER; - basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_ENABLED; - basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_STATUS; - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_OHCI_BASE, basereg); + base = (basereg & VasEBoot_CS5536_MSR_USB_BASE_ADDR_MASK); + basereg |= VasEBoot_CS5536_MSR_USB_BASE_BUS_MASTER; + basereg &= ~VasEBoot_CS5536_MSR_USB_BASE_PME_ENABLED; + basereg &= ~VasEBoot_CS5536_MSR_USB_BASE_PME_STATUS; + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_USB_OHCI_BASE, basereg); } else { - grub_uint32_t class_code; - grub_uint32_t class; - grub_uint32_t subclass; + VasEBoot_uint32_t class_code; + VasEBoot_uint32_t class; + VasEBoot_uint32_t subclass; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class_code = grub_pci_read (addr) >> 8; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class_code = VasEBoot_pci_read (addr) >> 8; interf = class_code & 0xFF; subclass = (class_code >> 8) & 0xFF; @@ -262,201 +262,201 @@ grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, if (class != 0x0c || subclass != 0x03 || interf != 0x10) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - base = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + base = VasEBoot_pci_read (addr); - base &= GRUB_PCI_ADDR_MEM_MASK; + base &= VasEBoot_PCI_ADDR_MEM_MASK; if (!base) { - grub_dprintf ("ehci", + VasEBoot_dprintf ("ehci", "EHCI: EHCI is not mapper\n"); return 0; } /* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word(addr, - GRUB_PCI_COMMAND_MEM_ENABLED - | GRUB_PCI_COMMAND_BUS_MASTER - | grub_pci_read_word(addr)); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word(addr, + VasEBoot_PCI_COMMAND_MEM_ENABLED + | VasEBoot_PCI_COMMAND_BUS_MASTER + | VasEBoot_pci_read_word(addr)); - grub_dprintf ("ohci", "class=0x%02x 0x%02x interface 0x%02x\n", + VasEBoot_dprintf ("ohci", "class=0x%02x 0x%02x interface 0x%02x\n", class, subclass, interf); } /* Allocate memory for the controller and register it. */ - o = grub_malloc (sizeof (*o)); + o = VasEBoot_malloc (sizeof (*o)); if (! o) return 1; - grub_memset ((void*)o, 0, sizeof (*o)); - o->iobase = grub_pci_device_map_range (dev, base, 0x800); + VasEBoot_memset ((void*)o, 0, sizeof (*o)); + o->iobase = VasEBoot_pci_device_map_range (dev, base, 0x800); - grub_dprintf ("ohci", "base=%p\n", o->iobase); + VasEBoot_dprintf ("ohci", "base=%p\n", o->iobase); /* Reserve memory for the HCCA. */ - o->hcca_chunk = grub_memalign_dma32 (256, 256); + o->hcca_chunk = VasEBoot_memalign_dma32 (256, 256); if (! o->hcca_chunk) goto fail; - o->hcca = grub_dma_get_virt (o->hcca_chunk); - o->hcca_addr = grub_dma_get_phys (o->hcca_chunk); - grub_memset ((void*)o->hcca, 0, sizeof(*o->hcca)); - grub_dprintf ("ohci", "hcca: chunk=%p, virt=%p, phys=0x%02x\n", + o->hcca = VasEBoot_dma_get_virt (o->hcca_chunk); + o->hcca_addr = VasEBoot_dma_get_phys (o->hcca_chunk); + VasEBoot_memset ((void*)o->hcca, 0, sizeof(*o->hcca)); + VasEBoot_dprintf ("ohci", "hcca: chunk=%p, virt=%p, phys=0x%02x\n", o->hcca_chunk, o->hcca, o->hcca_addr); /* Reserve memory for ctrl EDs. */ - o->ed_ctrl_chunk = grub_memalign_dma32 (16, sizeof(struct grub_ohci_ed) - * GRUB_OHCI_CTRL_EDS); + o->ed_ctrl_chunk = VasEBoot_memalign_dma32 (16, sizeof(struct VasEBoot_ohci_ed) + * VasEBoot_OHCI_CTRL_EDS); if (! o->ed_ctrl_chunk) goto fail; - o->ed_ctrl = grub_dma_get_virt (o->ed_ctrl_chunk); - o->ed_ctrl_addr = grub_dma_get_phys (o->ed_ctrl_chunk); + o->ed_ctrl = VasEBoot_dma_get_virt (o->ed_ctrl_chunk); + o->ed_ctrl_addr = VasEBoot_dma_get_phys (o->ed_ctrl_chunk); /* Preset EDs */ - grub_memset ((void *) o->ed_ctrl, 0, sizeof (struct grub_ohci_ed) - * GRUB_OHCI_CTRL_EDS); - for (j=0; j < GRUB_OHCI_CTRL_EDS; j++) - o->ed_ctrl[j].target = grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + VasEBoot_memset ((void *) o->ed_ctrl, 0, sizeof (struct VasEBoot_ohci_ed) + * VasEBoot_OHCI_CTRL_EDS); + for (j=0; j < VasEBoot_OHCI_CTRL_EDS; j++) + o->ed_ctrl[j].target = VasEBoot_cpu_to_le32_compile_time (1 << 14); /* skip */ - grub_dprintf ("ohci", "EDs-C: chunk=%p, virt=%p, phys=0x%02x\n", + VasEBoot_dprintf ("ohci", "EDs-C: chunk=%p, virt=%p, phys=0x%02x\n", o->ed_ctrl_chunk, o->ed_ctrl, o->ed_ctrl_addr); /* Reserve memory for bulk EDs. */ - o->ed_bulk_chunk = grub_memalign_dma32 (16, sizeof (struct grub_ohci_ed) - * GRUB_OHCI_BULK_EDS); + o->ed_bulk_chunk = VasEBoot_memalign_dma32 (16, sizeof (struct VasEBoot_ohci_ed) + * VasEBoot_OHCI_BULK_EDS); if (! o->ed_bulk_chunk) goto fail; - o->ed_bulk = grub_dma_get_virt (o->ed_bulk_chunk); - o->ed_bulk_addr = grub_dma_get_phys (o->ed_bulk_chunk); + o->ed_bulk = VasEBoot_dma_get_virt (o->ed_bulk_chunk); + o->ed_bulk_addr = VasEBoot_dma_get_phys (o->ed_bulk_chunk); /* Preset EDs */ - grub_memset ((void*)o->ed_bulk, 0, sizeof(struct grub_ohci_ed) * GRUB_OHCI_BULK_EDS); - for (j=0; j < GRUB_OHCI_BULK_EDS; j++) - o->ed_bulk[j].target = grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + VasEBoot_memset ((void*)o->ed_bulk, 0, sizeof(struct VasEBoot_ohci_ed) * VasEBoot_OHCI_BULK_EDS); + for (j=0; j < VasEBoot_OHCI_BULK_EDS; j++) + o->ed_bulk[j].target = VasEBoot_cpu_to_le32_compile_time (1 << 14); /* skip */ - grub_dprintf ("ohci", "EDs-B: chunk=%p, virt=%p, phys=0x%02x\n", + VasEBoot_dprintf ("ohci", "EDs-B: chunk=%p, virt=%p, phys=0x%02x\n", o->ed_bulk_chunk, o->ed_bulk, o->ed_bulk_addr); /* Reserve memory for TDs. */ - o->td_chunk = grub_memalign_dma32 (32, sizeof(struct grub_ohci_td)*GRUB_OHCI_TDS); + o->td_chunk = VasEBoot_memalign_dma32 (32, sizeof(struct VasEBoot_ohci_td)*VasEBoot_OHCI_TDS); /* Why is it aligned on 32 boundary if spec. says 16 ? * We have structure 32 bytes long and we don't want cross * 4K boundary inside structure. */ if (! o->td_chunk) goto fail; - o->td_free = o->td = grub_dma_get_virt (o->td_chunk); - o->td_addr = grub_dma_get_phys (o->td_chunk); + o->td_free = o->td = VasEBoot_dma_get_virt (o->td_chunk); + o->td_addr = VasEBoot_dma_get_phys (o->td_chunk); /* Preset free TDs chain in TDs */ - grub_memset ((void*)o->td, 0, sizeof(struct grub_ohci_td) * GRUB_OHCI_TDS); - for (j=0; j < (GRUB_OHCI_TDS-1); j++) + VasEBoot_memset ((void*)o->td, 0, sizeof(struct VasEBoot_ohci_td) * VasEBoot_OHCI_TDS); + for (j=0; j < (VasEBoot_OHCI_TDS-1); j++) o->td[j].link_td = &o->td[j+1]; - grub_dprintf ("ohci", "TDs: chunk=%p, virt=%p, phys=0x%02x\n", + VasEBoot_dprintf ("ohci", "TDs: chunk=%p, virt=%p, phys=0x%02x\n", o->td_chunk, o->td, o->td_addr); /* Check if the OHCI revision is actually 1.0 as supported. */ - revision = grub_ohci_readreg32 (o, GRUB_OHCI_REG_REVISION); - grub_dprintf ("ohci", "OHCI revision=0x%02x\n", revision & 0xFF); + revision = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_REVISION); + VasEBoot_dprintf ("ohci", "OHCI revision=0x%02x\n", revision & 0xFF); if ((revision & 0xFF) != 0x10) goto fail; { - grub_uint32_t control; + VasEBoot_uint32_t control; /* Check SMM/BIOS ownership of OHCI (SMM = USB Legacy Support driver for BIOS) */ - control = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL); + control = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CONTROL); if ((control & 0x100) != 0) { unsigned i; - grub_dprintf("ohci", "OHCI is owned by SMM\n"); + VasEBoot_dprintf("ohci", "OHCI is owned by SMM\n"); /* Do change of ownership */ /* Ownership change request */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, (1<<3)); /* XXX: Magic. */ + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CMDSTATUS, (1<<3)); /* XXX: Magic. */ /* Waiting for SMM deactivation */ for (i=0; i < 10; i++) { - if ((grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) & 0x100) == 0) + if ((VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CONTROL) & 0x100) == 0) { - grub_dprintf("ohci", "Ownership changed normally.\n"); + VasEBoot_dprintf("ohci", "Ownership changed normally.\n"); break; } - grub_millisleep (100); + VasEBoot_millisleep (100); } if (i >= 10) { - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, - grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) & ~0x100); - grub_dprintf("ohci", "Ownership changing timeout, change forced !\n"); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROL, + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CONTROL) & ~0x100); + VasEBoot_dprintf("ohci", "Ownership changing timeout, change forced !\n"); } } else if (((control & 0x100) == 0) && ((control & 0xc0) != 0)) /* Not owned by SMM nor reset */ { - grub_dprintf("ohci", "OHCI is owned by BIOS\n"); + VasEBoot_dprintf("ohci", "OHCI is owned by BIOS\n"); /* Do change of ownership - not implemented yet... */ /* In fact we probably need to do nothing ...? */ } else { - grub_dprintf("ohci", "OHCI is not owned by SMM nor BIOS\n"); + VasEBoot_dprintf("ohci", "OHCI is not owned by SMM nor BIOS\n"); /* We can setup OHCI. */ } } /* Suspend the OHCI by issuing a reset. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. */ - grub_millisleep (1); - grub_dprintf ("ohci", "OHCI reset\n"); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. */ + VasEBoot_millisleep (1); + VasEBoot_dprintf ("ohci", "OHCI reset\n"); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL, - (GRUB_OHCI_FSMPS - << GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT) - | (GRUB_OHCI_FRAME_INTERVAL - << GRUB_OHCI_REG_FRAME_INTERVAL_FI_SHIFT)); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_FRAME_INTERVAL, + (VasEBoot_OHCI_FSMPS + << VasEBoot_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT) + | (VasEBoot_OHCI_FRAME_INTERVAL + << VasEBoot_OHCI_REG_FRAME_INTERVAL_FI_SHIFT)); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_PERIODIC_START, - GRUB_OHCI_PERIODIC_START); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_PERIODIC_START, + VasEBoot_OHCI_PERIODIC_START); /* Setup the HCCA. */ o->hcca->donehead = 0; - grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, o->hcca_addr); - grub_dprintf ("ohci", "OHCI HCCA\n"); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_HCCA, o->hcca_addr); + VasEBoot_dprintf ("ohci", "OHCI HCCA\n"); /* Misc. pre-sets. */ o->hcca->donehead = 0; - grub_ohci_writereg32 (o, GRUB_OHCI_REG_INTSTATUS, 0x7f); /* Clears everything */ + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_INTSTATUS, 0x7f); /* Clears everything */ /* We don't want modify CONTROL/BULK HEAD registers. * So we assign to HEAD registers zero ED from related array * and we will not use this ED, it will be always skipped. * It should not produce notable performance penalty (I hope). */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD, o->ed_ctrl_addr); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLCURR, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, o->ed_bulk_addr); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLHEAD, o->ed_ctrl_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKHEAD, o->ed_bulk_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKCURR, 0); /* Check OHCI Legacy Support */ if ((revision & 0x100) != 0) { - grub_dprintf ("ohci", "Legacy Support registers detected\n"); - grub_dprintf ("ohci", "Current state of legacy control reg.: 0x%04x\n", - grub_ohci_readreg32 (o, GRUB_OHCI_REG_LEGACY_CONTROL)); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_LEGACY_CONTROL, - (grub_ohci_readreg32 (o, GRUB_OHCI_REG_LEGACY_CONTROL)) & ~1); - grub_dprintf ("ohci", "OHCI Legacy Support disabled.\n"); + VasEBoot_dprintf ("ohci", "Legacy Support registers detected\n"); + VasEBoot_dprintf ("ohci", "Current state of legacy control reg.: 0x%04x\n", + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_LEGACY_CONTROL)); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_LEGACY_CONTROL, + (VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_LEGACY_CONTROL)) & ~1); + VasEBoot_dprintf ("ohci", "OHCI Legacy Support disabled.\n"); } /* Enable the OHCI + enable CONTROL and BULK LIST. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROL, (2 << 6) - | GRUB_OHCI_REG_CONTROL_CONTROL_ENABLE - | GRUB_OHCI_REG_CONTROL_BULK_ENABLE ); - grub_dprintf ("ohci", "OHCI enable: 0x%02x\n", - (grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) >> 6) & 3); + | VasEBoot_OHCI_REG_CONTROL_CONTROL_ENABLE + | VasEBoot_OHCI_REG_CONTROL_BULK_ENABLE ); + VasEBoot_dprintf ("ohci", "OHCI enable: 0x%02x\n", + (VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CONTROL) >> 6) & 3); /* Power on all ports */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBA, - (grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBA) - & ~GRUB_OHCI_RHUB_PORT_POWER_MASK) - | GRUB_OHCI_RHUB_PORT_ALL_POWERED); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBA, + (VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBA) + & ~VasEBoot_OHCI_RHUB_PORT_POWER_MASK) + | VasEBoot_OHCI_RHUB_PORT_ALL_POWERED); #if 0 /* We don't need it at all, handled via hotplugging */ /* Now we have hot-plugging, we need to wait for stable power only */ - grub_millisleep (100); + VasEBoot_millisleep (100); #endif /* Link to ohci now that initialisation is successful. */ @@ -468,30 +468,30 @@ grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, fail: if (o) { - grub_dma_free (o->td_chunk); - grub_dma_free (o->ed_bulk_chunk); - grub_dma_free (o->ed_ctrl_chunk); - grub_dma_free (o->hcca_chunk); + VasEBoot_dma_free (o->td_chunk); + VasEBoot_dma_free (o->ed_bulk_chunk); + VasEBoot_dma_free (o->ed_ctrl_chunk); + VasEBoot_dma_free (o->hcca_chunk); } - grub_free (o); + VasEBoot_free (o); return 0; } static void -grub_ohci_inithw (void) +VasEBoot_ohci_inithw (void) { - grub_pci_iterate (grub_ohci_pci_iter, NULL); + VasEBoot_pci_iterate (VasEBoot_ohci_pci_iter, NULL); } static int -grub_ohci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data) +VasEBoot_ohci_iterate (VasEBoot_usb_controller_iterate_hook_t hook, void *hook_data) { - struct grub_ohci *o; - struct grub_usb_controller dev; + struct VasEBoot_ohci *o; + struct VasEBoot_usb_controller dev; for (o = ohci; o; o = o->next) { @@ -503,42 +503,42 @@ grub_ohci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data) return 0; } -static grub_ohci_ed_t -grub_ohci_find_ed (struct grub_ohci *o, int bulk, grub_uint32_t target) +static VasEBoot_ohci_ed_t +VasEBoot_ohci_find_ed (struct VasEBoot_ohci *o, int bulk, VasEBoot_uint32_t target) { - grub_ohci_ed_t ed, ed_next; - grub_uint32_t target_addr = target & GRUB_OHCI_ED_ADDR_MASK; + VasEBoot_ohci_ed_t ed, ed_next; + VasEBoot_uint32_t target_addr = target & VasEBoot_OHCI_ED_ADDR_MASK; int count; int i; /* Use proper values and structures. */ if (bulk) { - count = GRUB_OHCI_BULK_EDS; + count = VasEBoot_OHCI_BULK_EDS; ed = o->ed_bulk; - ed_next = grub_ohci_ed_phys2virt(o, bulk, - grub_le_to_cpu32 (ed->next_ed) ); + ed_next = VasEBoot_ohci_ed_phys2virt(o, bulk, + VasEBoot_le_to_cpu32 (ed->next_ed) ); } else { - count = GRUB_OHCI_CTRL_EDS; + count = VasEBoot_OHCI_CTRL_EDS; ed = o->ed_ctrl; - ed_next = grub_ohci_ed_phys2virt(o, bulk, - grub_le_to_cpu32 (ed->next_ed) ); + ed_next = VasEBoot_ohci_ed_phys2virt(o, bulk, + VasEBoot_le_to_cpu32 (ed->next_ed) ); } /* First try to find existing ED with proper target address */ for (i = 0; ; ) { if (i && /* We ignore zero ED */ - ((ed->target & GRUB_OHCI_ED_ADDR_MASK) == target_addr)) + ((ed->target & VasEBoot_OHCI_ED_ADDR_MASK) == target_addr)) return ed; /* Found proper existing ED */ i++; if (ed_next && (i < count)) { ed = ed_next; - ed_next = grub_ohci_ed_phys2virt(o, bulk, - grub_le_to_cpu32 (ed->next_ed) ); + ed_next = VasEBoot_ohci_ed_phys2virt(o, bulk, + VasEBoot_le_to_cpu32 (ed->next_ed) ); continue; } break; @@ -553,36 +553,36 @@ grub_ohci_find_ed (struct grub_ohci *o, int bulk, grub_uint32_t target) * of unplugged devices. */ /* We can link new ED to previous ED safely as the new ED should * still have set skip bit. */ - ed->next_ed = grub_cpu_to_le32 ( grub_ohci_virt_to_phys (o, + ed->next_ed = VasEBoot_cpu_to_le32 ( VasEBoot_ohci_virt_to_phys (o, bulk, &ed[1])); return &ed[1]; } -static grub_ohci_td_t -grub_ohci_alloc_td (struct grub_ohci *o) +static VasEBoot_ohci_td_t +VasEBoot_ohci_alloc_td (struct VasEBoot_ohci *o) { - grub_ohci_td_t ret; + VasEBoot_ohci_td_t ret; /* Check if there is a Transfer Descriptor available. */ if (! o->td_free) return NULL; ret = o->td_free; /* Take current free TD */ - o->td_free = (grub_ohci_td_t)ret->link_td; /* Advance to next free TD in chain */ + o->td_free = (VasEBoot_ohci_td_t)ret->link_td; /* Advance to next free TD in chain */ ret->link_td = 0; /* Reset link_td in allocated TD */ return ret; } static void -grub_ohci_free_td (struct grub_ohci *o, grub_ohci_td_t td) +VasEBoot_ohci_free_td (struct VasEBoot_ohci *o, VasEBoot_ohci_td_t td) { - grub_memset ( (void*)td, 0, sizeof(struct grub_ohci_td) ); + VasEBoot_memset ( (void*)td, 0, sizeof(struct VasEBoot_ohci_td) ); td->link_td = o->td_free; /* Cahin new free TD & rest */ o->td_free = td; /* Change address of first free TD */ } static void -grub_ohci_free_tds (struct grub_ohci *o, grub_ohci_td_t td) +VasEBoot_ohci_free_tds (struct VasEBoot_ohci *o, VasEBoot_ohci_td_t td) { if (!td) return; @@ -590,48 +590,48 @@ grub_ohci_free_tds (struct grub_ohci *o, grub_ohci_td_t td) /* Unchain first TD from previous TD if it is chained */ if (td->prev_td_phys) { - grub_ohci_td_t td_prev_virt = grub_ohci_td_phys2virt(o, + VasEBoot_ohci_td_t td_prev_virt = VasEBoot_ohci_td_phys2virt(o, td->prev_td_phys); - if (td == (grub_ohci_td_t) td_prev_virt->link_td) + if (td == (VasEBoot_ohci_td_t) td_prev_virt->link_td) td_prev_virt->link_td = 0; } /* Free all TDs from td (chained by link_td) */ while (td) { - grub_ohci_td_t tdprev; + VasEBoot_ohci_td_t tdprev; /* Unlink the queue. */ tdprev = td; - td = (grub_ohci_td_t) td->link_td; + td = (VasEBoot_ohci_td_t) td->link_td; /* Free the TD. */ - grub_ohci_free_td (o, tdprev); + VasEBoot_ohci_free_td (o, tdprev); } } static void -grub_ohci_transaction (grub_ohci_td_t td, - grub_transfer_type_t type, unsigned int toggle, - grub_size_t size, grub_uint32_t data) +VasEBoot_ohci_transaction (VasEBoot_ohci_td_t td, + VasEBoot_transfer_type_t type, unsigned int toggle, + VasEBoot_size_t size, VasEBoot_uint32_t data) { - grub_uint32_t token; - grub_uint32_t buffer; - grub_uint32_t buffer_end; + VasEBoot_uint32_t token; + VasEBoot_uint32_t buffer; + VasEBoot_uint32_t buffer_end; - grub_dprintf ("ohci", "OHCI transaction td=%p type=%d, toggle=%d, size=%lu\n", + VasEBoot_dprintf ("ohci", "OHCI transaction td=%p type=%d, toggle=%d, size=%lu\n", td, type, toggle, (unsigned long) size); switch (type) { - case GRUB_USB_TRANSFER_TYPE_SETUP: + case VasEBoot_USB_TRANSFER_TYPE_SETUP: token = 0 << 19; break; - case GRUB_USB_TRANSFER_TYPE_IN: + case VasEBoot_USB_TRANSFER_TYPE_IN: token = 2 << 19; break; - case GRUB_USB_TRANSFER_TYPE_OUT: + case VasEBoot_USB_TRANSFER_TYPE_OUT: token = 1 << 19; break; default: @@ -653,10 +653,10 @@ grub_ohci_transaction (grub_ohci_td_t td, /* Set correct buffer values in TD if zero transfer occurs */ if (size) { - buffer = (grub_uint32_t) data; + buffer = (VasEBoot_uint32_t) data; buffer_end = buffer + size - 1; - td->buffer = grub_cpu_to_le32 (buffer); - td->buffer_end = grub_cpu_to_le32 (buffer_end); + td->buffer = VasEBoot_cpu_to_le32 (buffer); + td->buffer_end = VasEBoot_cpu_to_le32 (buffer_end); } else { @@ -665,35 +665,35 @@ grub_ohci_transaction (grub_ohci_td_t td, } /* Set the rest of TD */ - td->token = grub_cpu_to_le32 (token); + td->token = VasEBoot_cpu_to_le32 (token); td->next_td = 0; } -struct grub_ohci_transfer_controller_data +struct VasEBoot_ohci_transfer_controller_data { - grub_uint32_t tderr_phys; - grub_uint32_t td_last_phys; - grub_ohci_ed_t ed_virt; - grub_ohci_td_t td_current_virt; - grub_ohci_td_t td_head_virt; + VasEBoot_uint32_t tderr_phys; + VasEBoot_uint32_t td_last_phys; + VasEBoot_ohci_ed_t ed_virt; + VasEBoot_ohci_td_t td_current_virt; + VasEBoot_ohci_td_t td_head_virt; }; -static grub_usb_err_t -grub_ohci_setup_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +static VasEBoot_usb_err_t +VasEBoot_ohci_setup_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_ohci *o = (struct grub_ohci *) dev->data; + struct VasEBoot_ohci *o = (struct VasEBoot_ohci *) dev->data; int bulk = 0; - grub_ohci_td_t td_next_virt; - grub_uint32_t target; - grub_uint32_t td_head_phys; - grub_uint32_t td_tail_phys; + VasEBoot_ohci_td_t td_next_virt; + VasEBoot_uint32_t target; + VasEBoot_uint32_t td_head_phys; + VasEBoot_uint32_t td_tail_phys; int i; - struct grub_ohci_transfer_controller_data *cdata; + struct VasEBoot_ohci_transfer_controller_data *cdata; - cdata = grub_zalloc (sizeof (*cdata)); + cdata = VasEBoot_zalloc (sizeof (*cdata)); if (!cdata) - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; /* Pre-set target for ED - we need it to find proper ED */ /* Set the device address. */ @@ -701,111 +701,111 @@ grub_ohci_setup_transfer (grub_usb_controller_t dev, /* Set the endpoint. It should be masked, we need 4 bits only. */ target |= (transfer->endpoint & 15) << 7; /* Set the device speed. */ - target |= (transfer->dev->speed == GRUB_USB_SPEED_LOW) << 13; + target |= (transfer->dev->speed == VasEBoot_USB_SPEED_LOW) << 13; /* Set the maximum packet size. */ target |= transfer->max << 16; /* Determine if transfer type is bulk - we need to select proper ED */ switch (transfer->type) { - case GRUB_USB_TRANSACTION_TYPE_BULK: + case VasEBoot_USB_TRANSACTION_TYPE_BULK: bulk = 1; break; - case GRUB_USB_TRANSACTION_TYPE_CONTROL: + case VasEBoot_USB_TRANSACTION_TYPE_CONTROL: break; default: - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } /* Find proper ED or add new ED */ - cdata->ed_virt = grub_ohci_find_ed (o, bulk, target); + cdata->ed_virt = VasEBoot_ohci_find_ed (o, bulk, target); if (!cdata->ed_virt) { - grub_dprintf ("ohci","Fatal: No free ED !\n"); - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_dprintf ("ohci","Fatal: No free ED !\n"); + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } /* Take pointer to first TD from ED */ - td_head_phys = grub_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xf; - td_tail_phys = grub_le_to_cpu32 (cdata->ed_virt->td_tail) & ~0xf; + td_head_phys = VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xf; + td_tail_phys = VasEBoot_le_to_cpu32 (cdata->ed_virt->td_tail) & ~0xf; /* Sanity check - td_head should be equal to td_tail */ if (td_head_phys != td_tail_phys) /* Should never happen ! */ { - grub_dprintf ("ohci", "Fatal: HEAD is not equal to TAIL !\n"); - grub_dprintf ("ohci", "HEAD = 0x%02x, TAIL = 0x%02x\n", + VasEBoot_dprintf ("ohci", "Fatal: HEAD is not equal to TAIL !\n"); + VasEBoot_dprintf ("ohci", "HEAD = 0x%02x, TAIL = 0x%02x\n", td_head_phys, td_tail_phys); /* XXX: Fix: What to do ? */ - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } /* Now we should handle first TD. If ED is newly allocated, * we must allocate the first TD. */ if (!td_head_phys) { - cdata->td_head_virt = grub_ohci_alloc_td (o); + cdata->td_head_virt = VasEBoot_ohci_alloc_td (o); if (!cdata->td_head_virt) { - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; /* We don't need de-allocate ED */ + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; /* We don't need de-allocate ED */ } /* We can set td_head only when ED is not active, i.e. * when it is newly allocated. */ cdata->ed_virt->td_head - = grub_cpu_to_le32 (grub_ohci_td_virt2phys (o, cdata->td_head_virt)); + = VasEBoot_cpu_to_le32 (VasEBoot_ohci_td_virt2phys (o, cdata->td_head_virt)); cdata->ed_virt->td_tail = cdata->ed_virt->td_head; } else - cdata->td_head_virt = grub_ohci_td_phys2virt ( o, td_head_phys ); + cdata->td_head_virt = VasEBoot_ohci_td_phys2virt ( o, td_head_phys ); /* Set TDs */ cdata->td_last_phys = td_head_phys; /* initial value to make compiler happy... */ for (i = 0, cdata->td_current_virt = cdata->td_head_virt; i < transfer->transcnt; i++) { - grub_usb_transaction_t tr = &transfer->transactions[i]; + VasEBoot_usb_transaction_t tr = &transfer->transactions[i]; - grub_ohci_transaction (cdata->td_current_virt, tr->pid, tr->toggle, + VasEBoot_ohci_transaction (cdata->td_current_virt, tr->pid, tr->toggle, tr->size, tr->data); /* Set index of TD in transfer */ - cdata->td_current_virt->tr_index = (grub_uint32_t) i; + cdata->td_current_virt->tr_index = (VasEBoot_uint32_t) i; /* Remember last used (processed) TD phys. addr. */ - cdata->td_last_phys = grub_ohci_td_virt2phys (o, cdata->td_current_virt); + cdata->td_last_phys = VasEBoot_ohci_td_virt2phys (o, cdata->td_current_virt); /* Allocate next TD */ - td_next_virt = grub_ohci_alloc_td (o); + td_next_virt = VasEBoot_ohci_alloc_td (o); if (!td_next_virt) /* No free TD, cancel transfer and free TDs except head TD */ { if (i) /* if i==0 we have nothing to free... */ - grub_ohci_free_tds (o, grub_ohci_td_phys2virt(o, - grub_le_to_cpu32 (cdata->td_head_virt->next_td))); + VasEBoot_ohci_free_tds (o, VasEBoot_ohci_td_phys2virt(o, + VasEBoot_le_to_cpu32 (cdata->td_head_virt->next_td))); /* Reset head TD */ - grub_memset ( (void*)cdata->td_head_virt, 0, - sizeof(struct grub_ohci_td) ); - grub_dprintf ("ohci", "Fatal: No free TD !"); - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_memset ( (void*)cdata->td_head_virt, 0, + sizeof(struct VasEBoot_ohci_td) ); + VasEBoot_dprintf ("ohci", "Fatal: No free TD !"); + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } /* Chain TDs */ cdata->td_current_virt->link_td = td_next_virt; - cdata->td_current_virt->next_td = grub_cpu_to_le32 ( - grub_ohci_td_virt2phys (o, + cdata->td_current_virt->next_td = VasEBoot_cpu_to_le32 ( + VasEBoot_ohci_td_virt2phys (o, td_next_virt) ); - td_next_virt->prev_td_phys = grub_ohci_td_virt2phys (o, + td_next_virt->prev_td_phys = VasEBoot_ohci_td_virt2phys (o, cdata->td_current_virt); cdata->td_current_virt = td_next_virt; } - grub_dprintf ("ohci", "Tail TD (not processed) = %p\n", + VasEBoot_dprintf ("ohci", "Tail TD (not processed) = %p\n", cdata->td_current_virt); /* Setup the Endpoint Descriptor for transfer. */ @@ -814,56 +814,56 @@ grub_ohci_setup_transfer (grub_usb_controller_t dev, * size never change after first allocation of ED. * But unfortunately max. packet size may change during initial * setup sequence and we must handle it. */ - cdata->ed_virt->target = grub_cpu_to_le32 (target | (1 << 14)); + cdata->ed_virt->target = VasEBoot_cpu_to_le32 (target | (1 << 14)); /* Set td_tail */ cdata->ed_virt->td_tail - = grub_cpu_to_le32 (grub_ohci_td_virt2phys (o, cdata->td_current_virt)); + = VasEBoot_cpu_to_le32 (VasEBoot_ohci_td_virt2phys (o, cdata->td_current_virt)); /* Now reset skip bit */ - cdata->ed_virt->target = grub_cpu_to_le32 (target); - /* ed_virt->td_head = grub_cpu_to_le32 (td_head); Must not be changed, it is maintained by OHCI */ - /* ed_virt->next_ed = grub_cpu_to_le32 (0); Handled by grub_ohci_find_ed, do not change ! */ + cdata->ed_virt->target = VasEBoot_cpu_to_le32 (target); + /* ed_virt->td_head = VasEBoot_cpu_to_le32 (td_head); Must not be changed, it is maintained by OHCI */ + /* ed_virt->next_ed = VasEBoot_cpu_to_le32 (0); Handled by VasEBoot_ohci_find_ed, do not change ! */ - grub_dprintf ("ohci", "program OHCI\n"); + VasEBoot_dprintf ("ohci", "program OHCI\n"); /* Program the OHCI to actually transfer. */ switch (transfer->type) { - case GRUB_USB_TRANSACTION_TYPE_BULK: + case VasEBoot_USB_TRANSACTION_TYPE_BULK: { - grub_dprintf ("ohci", "BULK list filled\n"); + VasEBoot_dprintf ("ohci", "BULK list filled\n"); /* Set BulkListFilled. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1 << 2); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CMDSTATUS, 1 << 2); /* Read back of register should ensure it is really written */ - grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CMDSTATUS); break; } - case GRUB_USB_TRANSACTION_TYPE_CONTROL: + case VasEBoot_USB_TRANSACTION_TYPE_CONTROL: { - grub_dprintf ("ohci", "CONTROL list filled\n"); + VasEBoot_dprintf ("ohci", "CONTROL list filled\n"); /* Set ControlListFilled. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1 << 1); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CMDSTATUS, 1 << 1); /* Read back of register should ensure it is really written */ - grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CMDSTATUS); break; } } transfer->controller_data = cdata; - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } static void -pre_finish_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +pre_finish_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_ohci *o = dev->data; - struct grub_ohci_transfer_controller_data *cdata = transfer->controller_data; - grub_uint32_t target; - grub_uint32_t status; - grub_uint32_t control; - grub_uint32_t intstatus; + struct VasEBoot_ohci *o = dev->data; + struct VasEBoot_ohci_transfer_controller_data *cdata = transfer->controller_data; + VasEBoot_uint32_t target; + VasEBoot_uint32_t status; + VasEBoot_uint32_t control; + VasEBoot_uint32_t intstatus; /* There are many ways how the loop above can finish: * - normally without any error via INTSTATUS WDH bit @@ -895,35 +895,35 @@ pre_finish_transfer (grub_usb_controller_t dev, /* Remember target for debug and set skip flag in ED */ /* It should be normaly not necessary but we need it at least * in case of timeout */ - target = grub_le_to_cpu32 ( cdata->ed_virt->target ); - cdata->ed_virt->target = grub_cpu_to_le32 (target | (1 << 14)); + target = VasEBoot_le_to_cpu32 ( cdata->ed_virt->target ); + cdata->ed_virt->target = VasEBoot_cpu_to_le32 (target | (1 << 14)); /* Read registers for debug - they should be read now because * debug prints case unwanted delays, so something can happen * in the meantime... */ - control = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL); - status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); - intstatus = grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS); + control = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CONTROL); + status = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CMDSTATUS); + intstatus = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS); /* Now print debug values - to have full info what happened */ - grub_dprintf ("ohci", "loop finished: control=0x%02x status=0x%02x\n", + VasEBoot_dprintf ("ohci", "loop finished: control=0x%02x status=0x%02x\n", control, status); - grub_dprintf ("ohci", "intstatus=0x%02x, td_last_phys=0x%02x\n", + VasEBoot_dprintf ("ohci", "intstatus=0x%02x, td_last_phys=0x%02x\n", intstatus, cdata->td_last_phys); - grub_dprintf ("ohci", "TARGET=0x%02x, HEAD=0x%02x, TAIL=0x%02x\n", + VasEBoot_dprintf ("ohci", "TARGET=0x%02x, HEAD=0x%02x, TAIL=0x%02x\n", target, - grub_le_to_cpu32 (cdata->ed_virt->td_head), - grub_le_to_cpu32 (cdata->ed_virt->td_tail) ); + VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head), + VasEBoot_le_to_cpu32 (cdata->ed_virt->td_tail) ); } static void -finish_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +finish_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_ohci *o = dev->data; - struct grub_ohci_transfer_controller_data *cdata = transfer->controller_data; + struct VasEBoot_ohci *o = dev->data; + struct VasEBoot_ohci_transfer_controller_data *cdata = transfer->controller_data; /* Set empty ED - set HEAD = TAIL = last (not processed) TD */ - cdata->ed_virt->td_head = grub_cpu_to_le32 (grub_le_to_cpu32 (cdata->ed_virt->td_tail) & ~0xf); + cdata->ed_virt->td_head = VasEBoot_cpu_to_le32 (VasEBoot_le_to_cpu32 (cdata->ed_virt->td_tail) & ~0xf); /* At this point always should be: * ED has skip bit set and halted or empty or after next SOF, @@ -933,30 +933,30 @@ finish_transfer (grub_usb_controller_t dev, /* Un-chainig of last TD */ if (cdata->td_current_virt->prev_td_phys) { - grub_ohci_td_t td_prev_virt - = grub_ohci_td_phys2virt (o, cdata->td_current_virt->prev_td_phys); + VasEBoot_ohci_td_t td_prev_virt + = VasEBoot_ohci_td_phys2virt (o, cdata->td_current_virt->prev_td_phys); - if (cdata->td_current_virt == (grub_ohci_td_t) td_prev_virt->link_td) + if (cdata->td_current_virt == (VasEBoot_ohci_td_t) td_prev_virt->link_td) td_prev_virt->link_td = 0; cdata->td_current_virt->prev_td_phys = 0; } - grub_dprintf ("ohci", "OHCI finished, freeing\n"); - grub_ohci_free_tds (o, cdata->td_head_virt); - grub_free (cdata); + VasEBoot_dprintf ("ohci", "OHCI finished, freeing\n"); + VasEBoot_ohci_free_tds (o, cdata->td_head_virt); + VasEBoot_free (cdata); } -static grub_usb_err_t -parse_halt (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, - grub_size_t *actual) +static VasEBoot_usb_err_t +parse_halt (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, + VasEBoot_size_t *actual) { - struct grub_ohci *o = dev->data; - struct grub_ohci_transfer_controller_data *cdata = transfer->controller_data; - grub_uint8_t errcode = 0; - grub_usb_err_t err = GRUB_USB_ERR_NAK; - grub_ohci_td_t tderr_virt = NULL; + struct VasEBoot_ohci *o = dev->data; + struct VasEBoot_ohci_transfer_controller_data *cdata = transfer->controller_data; + VasEBoot_uint8_t errcode = 0; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NAK; + VasEBoot_ohci_td_t tderr_virt = NULL; *actual = 0; @@ -964,107 +964,107 @@ parse_halt (grub_usb_controller_t dev, /* First we must get proper tderr_phys value */ /* Retired TD with error should be previous TD to ED->td_head */ - cdata->tderr_phys = grub_ohci_td_phys2virt (o, - grub_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xf ) + cdata->tderr_phys = VasEBoot_ohci_td_phys2virt (o, + VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xf ) ->prev_td_phys; /* Prepare pointer to last processed TD and get error code */ - tderr_virt = grub_ohci_td_phys2virt (o, cdata->tderr_phys); + tderr_virt = VasEBoot_ohci_td_phys2virt (o, cdata->tderr_phys); /* Set index of last processed TD */ if (tderr_virt) { - errcode = grub_le_to_cpu32 (tderr_virt->token) >> 28; + errcode = VasEBoot_le_to_cpu32 (tderr_virt->token) >> 28; transfer->last_trans = tderr_virt->tr_index; } else transfer->last_trans = -1; /* Evaluation of error code */ - grub_dprintf ("ohci", "OHCI tderr_phys=0x%02x, errcode=0x%02x\n", + VasEBoot_dprintf ("ohci", "OHCI tderr_phys=0x%02x, errcode=0x%02x\n", cdata->tderr_phys, errcode); switch (errcode) { case 0: /* XXX: Should not happen! */ - grub_error (GRUB_ERR_IO, "OHCI failed without reporting the reason"); - err = GRUB_USB_ERR_INTERNAL; + VasEBoot_error (VasEBoot_ERR_IO, "OHCI failed without reporting the reason"); + err = VasEBoot_USB_ERR_INTERNAL; break; case 1: /* XXX: CRC error. */ - err = GRUB_USB_ERR_TIMEOUT; + err = VasEBoot_USB_ERR_TIMEOUT; break; case 2: - err = GRUB_USB_ERR_BITSTUFF; + err = VasEBoot_USB_ERR_BITSTUFF; break; case 3: /* XXX: Data Toggle error. */ - err = GRUB_USB_ERR_DATA; + err = VasEBoot_USB_ERR_DATA; break; case 4: - err = GRUB_USB_ERR_STALL; + err = VasEBoot_USB_ERR_STALL; break; case 5: /* XXX: Not responding. */ - err = GRUB_USB_ERR_TIMEOUT; + err = VasEBoot_USB_ERR_TIMEOUT; break; case 6: /* XXX: PID Check bits failed. */ - err = GRUB_USB_ERR_BABBLE; + err = VasEBoot_USB_ERR_BABBLE; break; case 7: /* XXX: PID unexpected failed. */ - err = GRUB_USB_ERR_BABBLE; + err = VasEBoot_USB_ERR_BABBLE; break; case 8: /* XXX: Data overrun error. */ - err = GRUB_USB_ERR_DATA; - grub_dprintf ("ohci", "Overrun, failed TD address: %p, index: %d\n", + err = VasEBoot_USB_ERR_DATA; + VasEBoot_dprintf ("ohci", "Overrun, failed TD address: %p, index: %d\n", tderr_virt, tderr_virt->tr_index); break; case 9: /* XXX: Data underrun error. */ - grub_dprintf ("ohci", "Underrun, failed TD address: %p, index: %d\n", + VasEBoot_dprintf ("ohci", "Underrun, failed TD address: %p, index: %d\n", tderr_virt, tderr_virt->tr_index); if (transfer->last_trans == -1) break; *actual = transfer->transactions[transfer->last_trans].size - - (grub_le_to_cpu32 (tderr_virt->buffer_end) - - grub_le_to_cpu32 (tderr_virt->buffer)) + - (VasEBoot_le_to_cpu32 (tderr_virt->buffer_end) + - VasEBoot_le_to_cpu32 (tderr_virt->buffer)) + transfer->transactions[transfer->last_trans].preceding; - err = GRUB_USB_ERR_NONE; + err = VasEBoot_USB_ERR_NONE; break; case 10: /* XXX: Reserved. */ - err = GRUB_USB_ERR_NAK; + err = VasEBoot_USB_ERR_NAK; break; case 11: /* XXX: Reserved. */ - err = GRUB_USB_ERR_NAK; + err = VasEBoot_USB_ERR_NAK; break; case 12: /* XXX: Buffer overrun. */ - err = GRUB_USB_ERR_DATA; + err = VasEBoot_USB_ERR_DATA; break; case 13: /* XXX: Buffer underrun. */ - err = GRUB_USB_ERR_DATA; + err = VasEBoot_USB_ERR_DATA; break; default: - err = GRUB_USB_ERR_NAK; + err = VasEBoot_USB_ERR_NAK; break; } @@ -1073,14 +1073,14 @@ parse_halt (grub_usb_controller_t dev, return err; } -static grub_usb_err_t -parse_success (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, - grub_size_t *actual) +static VasEBoot_usb_err_t +parse_success (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, + VasEBoot_size_t *actual) { - struct grub_ohci *o = dev->data; - struct grub_ohci_transfer_controller_data *cdata = transfer->controller_data; - grub_ohci_td_t tderr_virt = NULL; + struct VasEBoot_ohci *o = dev->data; + struct VasEBoot_ohci_transfer_controller_data *cdata = transfer->controller_data; + VasEBoot_ohci_td_t tderr_virt = NULL; pre_finish_transfer (dev, transfer); @@ -1088,7 +1088,7 @@ parse_success (grub_usb_controller_t dev, cdata->tderr_phys = cdata->td_last_phys; /* Prepare pointer to last processed TD */ - tderr_virt = grub_ohci_td_phys2virt (o, cdata->tderr_phys); + tderr_virt = VasEBoot_ohci_td_phys2virt (o, cdata->tderr_phys); /* Set index of last processed TD */ if (tderr_virt) @@ -1099,15 +1099,15 @@ parse_success (grub_usb_controller_t dev, finish_transfer (dev, transfer); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_err_t -parse_unrec (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, - grub_size_t *actual) +static VasEBoot_usb_err_t +parse_unrec (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, + VasEBoot_size_t *actual) { - struct grub_ohci *o = dev->data; + struct VasEBoot_ohci *o = dev->data; *actual = 0; @@ -1115,102 +1115,102 @@ parse_unrec (grub_usb_controller_t dev, /* Don't try to get error code and last processed TD for proper * toggle bit value - anything can be invalid */ - grub_dprintf("ohci", "Unrecoverable error!"); + VasEBoot_dprintf("ohci", "Unrecoverable error!"); /* Do OHCI reset in case of unrecoverable error - maybe we will need * do more - re-enumerate bus etc. (?) */ /* Suspend the OHCI by issuing a reset. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. */ + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. */ /* Read back of register should ensure it is really written */ - grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); - grub_millisleep (1); - grub_dprintf ("ohci", "Unrecoverable error - OHCI reset\n"); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_CMDSTATUS); + VasEBoot_millisleep (1); + VasEBoot_dprintf ("ohci", "Unrecoverable error - OHCI reset\n"); /* Misc. resets. */ o->hcca->donehead = 0; - grub_ohci_writereg32 (o, GRUB_OHCI_REG_INTSTATUS, 0x7f); /* Clears everything */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD, o->ed_ctrl_addr); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLCURR, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, o->ed_bulk_addr); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_INTSTATUS, 0x7f); /* Clears everything */ + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLHEAD, o->ed_ctrl_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKHEAD, o->ed_bulk_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKCURR, 0); /* Read back of register should ensure it is really written */ - grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS); /* Enable the OHCI. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROL, (2 << 6) - | GRUB_OHCI_REG_CONTROL_CONTROL_ENABLE - | GRUB_OHCI_REG_CONTROL_BULK_ENABLE ); + | VasEBoot_OHCI_REG_CONTROL_CONTROL_ENABLE + | VasEBoot_OHCI_REG_CONTROL_BULK_ENABLE ); finish_transfer (dev, transfer); - return GRUB_USB_ERR_UNRECOVERABLE; + return VasEBoot_USB_ERR_UNRECOVERABLE; } -static grub_usb_err_t -grub_ohci_check_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, - grub_size_t *actual) +static VasEBoot_usb_err_t +VasEBoot_ohci_check_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, + VasEBoot_size_t *actual) { - struct grub_ohci *o = dev->data; - struct grub_ohci_transfer_controller_data *cdata = transfer->controller_data; - grub_uint32_t intstatus; + struct VasEBoot_ohci *o = dev->data; + struct VasEBoot_ohci_transfer_controller_data *cdata = transfer->controller_data; + VasEBoot_uint32_t intstatus; /* Check transfer status */ - intstatus = grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS); + intstatus = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS); if ((intstatus & 0x10) != 0) /* Unrecoverable error - only reset can help...! */ return parse_unrec (dev, transfer, actual); /* Detected a HALT. */ - if ((grub_le_to_cpu32 (cdata->ed_virt->td_head) & 1)) + if ((VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head) & 1)) return parse_halt (dev, transfer, actual); /* Finished ED detection */ - if ( (grub_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xfU) == - (grub_le_to_cpu32 (cdata->ed_virt->td_tail) & ~0xfU) ) /* Empty ED */ + if ( (VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xfU) == + (VasEBoot_le_to_cpu32 (cdata->ed_virt->td_tail) & ~0xfU) ) /* Empty ED */ { /* Check the HALT bit */ /* It looks like nonsense - it was tested previously... * but it can change because OHCI is working * simultaneously via DMA... */ - if (grub_le_to_cpu32 (cdata->ed_virt->td_head) & 1) + if (VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head) & 1) return parse_halt (dev, transfer, actual); else return parse_success (dev, transfer, actual); } - return GRUB_USB_ERR_WAIT; + return VasEBoot_USB_ERR_WAIT; } -static grub_usb_err_t -grub_ohci_cancel_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +static VasEBoot_usb_err_t +VasEBoot_ohci_cancel_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_ohci *o = dev->data; - struct grub_ohci_transfer_controller_data *cdata = transfer->controller_data; - grub_ohci_td_t tderr_virt = NULL; + struct VasEBoot_ohci *o = dev->data; + struct VasEBoot_ohci_transfer_controller_data *cdata = transfer->controller_data; + VasEBoot_ohci_td_t tderr_virt = NULL; pre_finish_transfer (dev, transfer); - grub_dprintf("ohci", "Timeout !\n"); + VasEBoot_dprintf("ohci", "Timeout !\n"); /* We should wait for next SOF to be sure that ED is unaccessed * by OHCI */ /* SF bit reset. (SF bit indicates Start Of Frame (SOF) packet) */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_INTSTATUS, (1<<2)); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_INTSTATUS, (1<<2)); /* Wait for new SOF */ - while ((grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS) & 0x4) == 0); + while ((VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS) & 0x4) == 0); /* Possible retired TD with error should be previous TD to ED->td_head */ cdata->tderr_phys - = grub_ohci_td_phys2virt (o, grub_le_to_cpu32 (cdata->ed_virt->td_head) + = VasEBoot_ohci_td_phys2virt (o, VasEBoot_le_to_cpu32 (cdata->ed_virt->td_head) & ~0xf)->prev_td_phys; - tderr_virt = grub_ohci_td_phys2virt (o,cdata-> tderr_phys); + tderr_virt = VasEBoot_ohci_td_phys2virt (o,cdata-> tderr_phys); - grub_dprintf ("ohci", "Cancel: tderr_phys=0x%x, tderr_virt=%p\n", + VasEBoot_dprintf ("ohci", "Cancel: tderr_phys=0x%x, tderr_virt=%p\n", cdata->tderr_phys, tderr_virt); if (tderr_virt) @@ -1220,34 +1220,34 @@ grub_ohci_cancel_transfer (grub_usb_controller_t dev, finish_transfer (dev, transfer); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_err_t -grub_ohci_portstatus (grub_usb_controller_t dev, +static VasEBoot_usb_err_t +VasEBoot_ohci_portstatus (VasEBoot_usb_controller_t dev, unsigned int port, unsigned int enable) { - struct grub_ohci *o = (struct grub_ohci *) dev->data; - grub_uint64_t endtime; + struct VasEBoot_ohci *o = (struct VasEBoot_ohci *) dev->data; + VasEBoot_uint64_t endtime; int i; - grub_dprintf ("ohci", "begin of portstatus=0x%02x\n", - grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)); + VasEBoot_dprintf ("ohci", "begin of portstatus=0x%02x\n", + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port)); if (!enable) /* We don't need reset port */ { /* Disable the port and wait for it. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, - GRUB_OHCI_CLEAR_PORT_ENABLE); - endtime = grub_get_time_ms () + 1000; - while ((grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port) + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port, + VasEBoot_OHCI_CLEAR_PORT_ENABLE); + endtime = VasEBoot_get_time_ms () + 1000; + while ((VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port) & (1 << 1))) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; - grub_dprintf ("ohci", "end of portstatus=0x%02x\n", - grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)); - return GRUB_USB_ERR_NONE; + VasEBoot_dprintf ("ohci", "end of portstatus=0x%02x\n", + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port)); + return VasEBoot_USB_ERR_NONE; } /* OHCI does one reset signal 10ms long but USB spec. @@ -1256,213 +1256,213 @@ grub_ohci_portstatus (grub_usb_controller_t dev, for (i = 0; i < 5; i++) { /* Reset the port - timing of reset is done by OHCI */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, - GRUB_OHCI_SET_PORT_RESET); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port, + VasEBoot_OHCI_SET_PORT_RESET); /* Wait for reset completion */ - endtime = grub_get_time_ms () + 1000; - while (! (grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port) - & GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE)) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; + endtime = VasEBoot_get_time_ms () + 1000; + while (! (VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port) + & VasEBoot_OHCI_SET_PORT_RESET_STATUS_CHANGE)) + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; /* End the reset signaling - reset the reset status change */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, - GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE); - grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port, + VasEBoot_OHCI_SET_PORT_RESET_STATUS_CHANGE); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port); } /* Enable port */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, - GRUB_OHCI_SET_PORT_ENABLE); - grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port, + VasEBoot_OHCI_SET_PORT_ENABLE); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port); /* Wait for signal enabled */ - endtime = grub_get_time_ms () + 1000; - while (! (grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port) + endtime = VasEBoot_get_time_ms () + 1000; + while (! (VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port) & (1 << 1))) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; /* Reset bit Connect Status Change */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, - GRUB_OHCI_RESET_CONNECT_CHANGE); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port, + VasEBoot_OHCI_RESET_CONNECT_CHANGE); /* "Reset recovery time" (USB spec.) */ - grub_millisleep (10); + VasEBoot_millisleep (10); - grub_dprintf ("ohci", "end of portstatus=0x%02x\n", - grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)); + VasEBoot_dprintf ("ohci", "end of portstatus=0x%02x\n", + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port)); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_speed_t -grub_ohci_detect_dev (grub_usb_controller_t dev, int port, int *changed) +static VasEBoot_usb_speed_t +VasEBoot_ohci_detect_dev (VasEBoot_usb_controller_t dev, int port, int *changed) { - struct grub_ohci *o = (struct grub_ohci *) dev->data; - grub_uint32_t status; + struct VasEBoot_ohci *o = (struct VasEBoot_ohci *) dev->data; + VasEBoot_uint32_t status; - status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + status = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port); - grub_dprintf ("ohci", "detect_dev status=0x%02x\n", status); + VasEBoot_dprintf ("ohci", "detect_dev status=0x%02x\n", status); /* Connect Status Change bit - it detects change of connection */ - if (status & GRUB_OHCI_RESET_CONNECT_CHANGE) + if (status & VasEBoot_OHCI_RESET_CONNECT_CHANGE) { *changed = 1; /* Reset bit Connect Status Change */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, - GRUB_OHCI_RESET_CONNECT_CHANGE); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + port, + VasEBoot_OHCI_RESET_CONNECT_CHANGE); } else *changed = 0; if (! (status & 1)) - return GRUB_USB_SPEED_NONE; + return VasEBoot_USB_SPEED_NONE; else if (status & (1 << 9)) - return GRUB_USB_SPEED_LOW; + return VasEBoot_USB_SPEED_LOW; else - return GRUB_USB_SPEED_FULL; + return VasEBoot_USB_SPEED_FULL; } static int -grub_ohci_hubports (grub_usb_controller_t dev) +VasEBoot_ohci_hubports (VasEBoot_usb_controller_t dev) { - struct grub_ohci *o = (struct grub_ohci *) dev->data; - grub_uint32_t portinfo; + struct VasEBoot_ohci *o = (struct VasEBoot_ohci *) dev->data; + VasEBoot_uint32_t portinfo; - portinfo = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBA); + portinfo = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBA); - grub_dprintf ("ohci", "root hub ports=%d\n", portinfo & 0xFF); + VasEBoot_dprintf ("ohci", "root hub ports=%d\n", portinfo & 0xFF); return portinfo & 0xFF; } -static grub_err_t -grub_ohci_fini_hw (int noreturn __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_ohci_fini_hw (int noreturn __attribute__ ((unused))) { - struct grub_ohci *o; + struct VasEBoot_ohci *o; for (o = ohci; o; o = o->next) { - int i, nports = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBA) & 0xff; - grub_uint64_t maxtime; + int i, nports = VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_RHUBA) & 0xff; + VasEBoot_uint64_t maxtime; /* Set skip in all EDs */ if (o->ed_bulk) - for (i=0; i < GRUB_OHCI_BULK_EDS; i++) - o->ed_bulk[i].target |= grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + for (i=0; i < VasEBoot_OHCI_BULK_EDS; i++) + o->ed_bulk[i].target |= VasEBoot_cpu_to_le32_compile_time (1 << 14); /* skip */ if (o->ed_ctrl) - for (i=0; i < GRUB_OHCI_CTRL_EDS; i++) - o->ed_ctrl[i].target |= grub_cpu_to_le32_compile_time (1 << 14); /* skip */ + for (i=0; i < VasEBoot_OHCI_CTRL_EDS; i++) + o->ed_ctrl[i].target |= VasEBoot_cpu_to_le32_compile_time (1 << 14); /* skip */ /* We should wait for next SOF to be sure that all EDs are * unaccessed by OHCI. But OHCI can be non-functional, so * more than 1ms timeout have to be applied. */ /* SF bit reset. (SF bit indicates Start Of Frame (SOF) packet) */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_INTSTATUS, (1<<2)); - maxtime = grub_get_time_ms () + 2; + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_INTSTATUS, (1<<2)); + maxtime = VasEBoot_get_time_ms () + 2; /* Wait for new SOF or timeout */ - while ( ((grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS) & 0x4) - == 0) || (grub_get_time_ms () >= maxtime) ); + while ( ((VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS) & 0x4) + == 0) || (VasEBoot_get_time_ms () >= maxtime) ); for (i = 0; i < nports; i++) - grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + i, - GRUB_OHCI_CLEAR_PORT_ENABLE); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_RHUBPORT + i, + VasEBoot_OHCI_CLEAR_PORT_ENABLE); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1); - grub_millisleep (1); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLCURR, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKCURR, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_DONEHEAD, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CMDSTATUS, 1); + VasEBoot_millisleep (1); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_HCCA, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLHEAD, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKHEAD, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_DONEHEAD, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROL, 0); /* Read back of register should ensure it is really written */ - grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS); #if 0 /* Is this necessary before booting? Probably not .(?) * But it must be done if module is removed ! (Or not ?) - * How to do it ? - Probably grub_ohci_restore_hw should be more + * How to do it ? - Probably VasEBoot_ohci_restore_hw should be more * complicated. (?) * (If we do it, we need to reallocate EDs and TDs in function - * grub_ohci_restore_hw ! */ + * VasEBoot_ohci_restore_hw ! */ /* Free allocated EDs and TDs */ - grub_dma_free (o->td_chunk); - grub_dma_free (o->ed_bulk_chunk); - grub_dma_free (o->ed_ctrl_chunk); - grub_dma_free (o->hcca_chunk); + VasEBoot_dma_free (o->td_chunk); + VasEBoot_dma_free (o->ed_bulk_chunk); + VasEBoot_dma_free (o->ed_ctrl_chunk); + VasEBoot_dma_free (o->hcca_chunk); #endif } - grub_millisleep (10); + VasEBoot_millisleep (10); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_ohci_restore_hw (void) +static VasEBoot_err_t +VasEBoot_ohci_restore_hw (void) { - struct grub_ohci *o; + struct VasEBoot_ohci *o; for (o = ohci; o; o = o->next) { - grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, o->hcca_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_HCCA, o->hcca_addr); o->hcca->donehead = 0; - grub_ohci_writereg32 (o, GRUB_OHCI_REG_INTSTATUS, 0x7f); /* Clears everything */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD, o->ed_ctrl_addr); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLCURR, 0); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, o->ed_bulk_addr); - grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_INTSTATUS, 0x7f); /* Clears everything */ + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLHEAD, o->ed_ctrl_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROLCURR, 0); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKHEAD, o->ed_bulk_addr); + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_BULKCURR, 0); /* Read back of register should ensure it is really written */ - grub_ohci_readreg32 (o, GRUB_OHCI_REG_INTSTATUS); + VasEBoot_ohci_readreg32 (o, VasEBoot_OHCI_REG_INTSTATUS); /* Enable the OHCI. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, + VasEBoot_ohci_writereg32 (o, VasEBoot_OHCI_REG_CONTROL, (2 << 6) - | GRUB_OHCI_REG_CONTROL_CONTROL_ENABLE - | GRUB_OHCI_REG_CONTROL_BULK_ENABLE ); + | VasEBoot_OHCI_REG_CONTROL_CONTROL_ENABLE + | VasEBoot_OHCI_REG_CONTROL_BULK_ENABLE ); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_usb_controller_dev usb_controller = +static struct VasEBoot_usb_controller_dev usb_controller = { .name = "ohci", - .iterate = grub_ohci_iterate, - .setup_transfer = grub_ohci_setup_transfer, - .check_transfer = grub_ohci_check_transfer, - .cancel_transfer = grub_ohci_cancel_transfer, - .hubports = grub_ohci_hubports, - .portstatus = grub_ohci_portstatus, - .detect_dev = grub_ohci_detect_dev, + .iterate = VasEBoot_ohci_iterate, + .setup_transfer = VasEBoot_ohci_setup_transfer, + .check_transfer = VasEBoot_ohci_check_transfer, + .cancel_transfer = VasEBoot_ohci_cancel_transfer, + .hubports = VasEBoot_ohci_hubports, + .portstatus = VasEBoot_ohci_portstatus, + .detect_dev = VasEBoot_ohci_detect_dev, /* estimated max. count of TDs for one bulk transfer */ - .max_bulk_tds = GRUB_OHCI_TDS * 3 / 4 + .max_bulk_tds = VasEBoot_OHCI_TDS * 3 / 4 }; -static struct grub_preboot *fini_hnd; +static struct VasEBoot_preboot *fini_hnd; -GRUB_MOD_INIT(ohci) +VasEBoot_MOD_INIT(ohci) { - COMPILE_TIME_ASSERT (sizeof (struct grub_ohci_td) == 32); - COMPILE_TIME_ASSERT (sizeof (struct grub_ohci_ed) == 16); + COMPILE_TIME_ASSERT (sizeof (struct VasEBoot_ohci_td) == 32); + COMPILE_TIME_ASSERT (sizeof (struct VasEBoot_ohci_ed) == 16); - grub_stop_disk_firmware (); + VasEBoot_stop_disk_firmware (); - grub_ohci_inithw (); - grub_usb_controller_dev_register (&usb_controller); - fini_hnd = grub_loader_register_preboot_hook (grub_ohci_fini_hw, - grub_ohci_restore_hw, - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); + VasEBoot_ohci_inithw (); + VasEBoot_usb_controller_dev_register (&usb_controller); + fini_hnd = VasEBoot_loader_register_preboot_hook (VasEBoot_ohci_fini_hw, + VasEBoot_ohci_restore_hw, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_DISK); } -GRUB_MOD_FINI(ohci) +VasEBoot_MOD_FINI(ohci) { - grub_ohci_fini_hw (0); - grub_loader_unregister_preboot_hook (fini_hnd); - grub_usb_controller_dev_unregister (&usb_controller); + VasEBoot_ohci_fini_hw (0); + VasEBoot_loader_unregister_preboot_hook (fini_hnd); + VasEBoot_usb_controller_dev_unregister (&usb_controller); } diff --git a/VasEBoot-core/bus/usb/serial/common.c b/VasEBoot-core/bus/usb/serial/common.c index 8e94c7dc0..9edfd9fbb 100644 --- a/VasEBoot-core/bus/usb/serial/common.c +++ b/VasEBoot-core/bus/usb/serial/common.c @@ -1,69 +1,69 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); void -grub_usbserial_fini (struct grub_serial_port *port) +VasEBoot_usbserial_fini (struct VasEBoot_serial_port *port) { port->usbdev->config[port->configno].interf[port->interfno].detach_hook = 0; port->usbdev->config[port->configno].interf[port->interfno].attached = 0; } void -grub_usbserial_detach (grub_usb_device_t usbdev, int configno, int interfno) +VasEBoot_usbserial_detach (VasEBoot_usb_device_t usbdev, int configno, int interfno) { - static struct grub_serial_port *port; + static struct VasEBoot_serial_port *port; port = usbdev->config[configno].interf[interfno].detach_data; - grub_serial_unregister (port); + VasEBoot_serial_unregister (port); } static int usbnum = 0; int -grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno, - struct grub_serial_driver *driver, int in_endp, +VasEBoot_usbserial_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno, + struct VasEBoot_serial_driver *driver, int in_endp, int out_endp) { - struct grub_serial_port *port; + struct VasEBoot_serial_port *port; int j; - struct grub_usb_desc_if *interf; - grub_usb_err_t err = GRUB_USB_ERR_NONE; + struct VasEBoot_usb_desc_if *interf; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NONE; interf = usbdev->config[configno].interf[interfno].descif; - port = grub_zalloc (sizeof (*port)); + port = VasEBoot_zalloc (sizeof (*port)); if (!port) { - grub_print_error (); + VasEBoot_print_error (); return 0; } - port->name = grub_xasprintf ("usb%d", usbnum++); + port->name = VasEBoot_xasprintf ("usb%d", usbnum++); if (!port->name) { - grub_free (port); - grub_print_error (); + VasEBoot_free (port); + VasEBoot_print_error (); return 0; } @@ -71,18 +71,18 @@ grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno, port->driver = driver; for (j = 0; j < interf->endpointcnt; j++) { - struct grub_usb_desc_endp *endp; + struct VasEBoot_usb_desc_endp *endp; endp = &usbdev->config[0].interf[interfno].descendp[j]; if ((endp->endp_addr & 128) && (endp->attrib & 3) == 2 - && (in_endp == GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING + && (in_endp == VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING || in_endp == endp->endp_addr)) { /* Bulk IN endpoint. */ port->in_endp = endp; } else if (!(endp->endp_addr & 128) && (endp->attrib & 3) == 2 - && (out_endp == GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING + && (out_endp == VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING || out_endp == endp->endp_addr)) { /* Bulk OUT endpoint. */ @@ -92,23 +92,23 @@ grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno, /* Configure device */ if (port->out_endp && port->in_endp) - err = grub_usb_set_configuration (usbdev, configno + 1); + err = VasEBoot_usb_set_configuration (usbdev, configno + 1); if (!port->out_endp || !port->in_endp || err) { - grub_free (port->name); - grub_free (port); + VasEBoot_free (port->name); + VasEBoot_free (port); return 0; } port->configno = configno; port->interfno = interfno; - grub_serial_config_defaults (port); - grub_serial_register (port); + VasEBoot_serial_config_defaults (port); + VasEBoot_serial_register (port); port->usbdev->config[port->configno].interf[port->interfno].detach_hook - = grub_usbserial_detach; + = VasEBoot_usbserial_detach; port->usbdev->config[port->configno].interf[port->interfno].detach_data = port; @@ -116,18 +116,18 @@ grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno, } int -grub_usbserial_fetch (struct grub_serial_port *port, grub_size_t header_size) +VasEBoot_usbserial_fetch (struct VasEBoot_serial_port *port, VasEBoot_size_t header_size) { - grub_usb_err_t err; - grub_size_t actual; + VasEBoot_usb_err_t err; + VasEBoot_size_t actual; if (port->bufstart < port->bufend) return port->buf[port->bufstart++]; - err = grub_usb_bulk_read_extended (port->usbdev, port->in_endp, + err = VasEBoot_usb_bulk_read_extended (port->usbdev, port->in_endp, sizeof (port->buf), port->buf, 10, &actual); - if (err != GRUB_USB_ERR_NONE) + if (err != VasEBoot_USB_ERR_NONE) return -1; port->bufstart = header_size; diff --git a/VasEBoot-core/bus/usb/serial/ftdi.c b/VasEBoot-core/bus/usb/serial/ftdi.c index 1a99cba17..22733cc43 100644 --- a/VasEBoot-core/bus/usb/serial/ftdi.c +++ b/VasEBoot-core/bus/usb/serial/ftdi.c @@ -1,45 +1,45 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); enum { - GRUB_FTDI_MODEM_CTRL = 0x01, - GRUB_FTDI_FLOW_CTRL = 0x02, - GRUB_FTDI_SPEED_CTRL = 0x03, - GRUB_FTDI_DATA_CTRL = 0x04 + VasEBoot_FTDI_MODEM_CTRL = 0x01, + VasEBoot_FTDI_FLOW_CTRL = 0x02, + VasEBoot_FTDI_SPEED_CTRL = 0x03, + VasEBoot_FTDI_DATA_CTRL = 0x04 }; -#define GRUB_FTDI_MODEM_CTRL_DTRRTS 3 -#define GRUB_FTDI_FLOW_CTRL_DTRRTS 3 +#define VasEBoot_FTDI_MODEM_CTRL_DTRRTS 3 +#define VasEBoot_FTDI_FLOW_CTRL_DTRRTS 3 /* Convert speed to divisor. */ -static grub_uint32_t +static VasEBoot_uint32_t get_divisor (unsigned int speed) { unsigned int i; @@ -48,7 +48,7 @@ get_divisor (unsigned int speed) struct divisor { unsigned int speed; - grub_uint32_t div; + VasEBoot_uint32_t div; }; /* The table which lists common configurations. */ @@ -72,40 +72,40 @@ get_divisor (unsigned int speed) } static void -real_config (struct grub_serial_port *port) +real_config (struct VasEBoot_serial_port *port) { - grub_uint32_t divisor; - const grub_uint16_t parities[] = { - [GRUB_SERIAL_PARITY_NONE] = 0x0000, - [GRUB_SERIAL_PARITY_ODD] = 0x0100, - [GRUB_SERIAL_PARITY_EVEN] = 0x0200 + VasEBoot_uint32_t divisor; + const VasEBoot_uint16_t parities[] = { + [VasEBoot_SERIAL_PARITY_NONE] = 0x0000, + [VasEBoot_SERIAL_PARITY_ODD] = 0x0100, + [VasEBoot_SERIAL_PARITY_EVEN] = 0x0200 }; - const grub_uint16_t stop_bits[] = { - [GRUB_SERIAL_STOP_BITS_1] = 0x0000, - [GRUB_SERIAL_STOP_BITS_1_5] = 0x0800, - [GRUB_SERIAL_STOP_BITS_2] = 0x1000, + const VasEBoot_uint16_t stop_bits[] = { + [VasEBoot_SERIAL_STOP_BITS_1] = 0x0000, + [VasEBoot_SERIAL_STOP_BITS_1_5] = 0x0800, + [VasEBoot_SERIAL_STOP_BITS_2] = 0x1000, }; if (port->configured) return; - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, - GRUB_FTDI_MODEM_CTRL, - port->config.rtscts ? GRUB_FTDI_MODEM_CTRL_DTRRTS : 0, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, + VasEBoot_FTDI_MODEM_CTRL, + port->config.rtscts ? VasEBoot_FTDI_MODEM_CTRL_DTRRTS : 0, 0, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, - GRUB_FTDI_FLOW_CTRL, - port->config.rtscts ? GRUB_FTDI_FLOW_CTRL_DTRRTS : 0, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, + VasEBoot_FTDI_FLOW_CTRL, + port->config.rtscts ? VasEBoot_FTDI_FLOW_CTRL_DTRRTS : 0, 0, 0, 0); divisor = get_divisor (port->config.speed); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, - GRUB_FTDI_SPEED_CTRL, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, + VasEBoot_FTDI_SPEED_CTRL, divisor & 0xffff, divisor >> 16, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, - GRUB_FTDI_DATA_CTRL, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, + VasEBoot_FTDI_DATA_CTRL, parities[port->config.parity] | stop_bits[port->config.stop_bits] | port->config.word_len, 0, 0, 0); @@ -115,75 +115,75 @@ real_config (struct grub_serial_port *port) /* Fetch a key. */ static int -ftdi_hw_fetch (struct grub_serial_port *port) +ftdi_hw_fetch (struct VasEBoot_serial_port *port) { real_config (port); - return grub_usbserial_fetch (port, 2); + return VasEBoot_usbserial_fetch (port, 2); } /* Put a character. */ static void -ftdi_hw_put (struct grub_serial_port *port, const int c) +ftdi_hw_put (struct VasEBoot_serial_port *port, const int c) { char cc = c; real_config (port); - grub_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc); + VasEBoot_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc); } -static grub_err_t -ftdi_hw_configure (struct grub_serial_port *port, - struct grub_serial_config *config) +static VasEBoot_err_t +ftdi_hw_configure (struct VasEBoot_serial_port *port, + struct VasEBoot_serial_config *config) { - grub_uint16_t divisor; + VasEBoot_uint16_t divisor; divisor = get_divisor (config->speed); if (divisor == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port speed")); - if (config->parity != GRUB_SERIAL_PARITY_NONE - && config->parity != GRUB_SERIAL_PARITY_ODD - && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->parity != VasEBoot_SERIAL_PARITY_NONE + && config->parity != VasEBoot_SERIAL_PARITY_ODD + && config->parity != VasEBoot_SERIAL_PARITY_EVEN) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); - if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_1_5 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1_5 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_2) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port word length")); port->config = *config; port->configured = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_serial_driver grub_ftdi_driver = +static struct VasEBoot_serial_driver VasEBoot_ftdi_driver = { .configure = ftdi_hw_configure, .fetch = ftdi_hw_fetch, .put = ftdi_hw_put, - .fini = grub_usbserial_fini + .fini = VasEBoot_usbserial_fini }; static const struct { - grub_uint16_t vendor, product; + VasEBoot_uint16_t vendor, product; } products[] = { {0x0403, 0x6001} /* QEMU virtual USBserial. */ }; static int -grub_ftdi_attach (grub_usb_device_t usbdev, int configno, int interfno) +VasEBoot_ftdi_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno) { unsigned j; @@ -194,25 +194,25 @@ grub_ftdi_attach (grub_usb_device_t usbdev, int configno, int interfno) if (j == ARRAY_SIZE (products)) return 0; - return grub_usbserial_attach (usbdev, configno, interfno, - &grub_ftdi_driver, - GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING, - GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING); + return VasEBoot_usbserial_attach (usbdev, configno, interfno, + &VasEBoot_ftdi_driver, + VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING, + VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING); } -static struct grub_usb_attach_desc attach_hook = +static struct VasEBoot_usb_attach_desc attach_hook = { .class = 0xff, - .hook = grub_ftdi_attach + .hook = VasEBoot_ftdi_attach }; -GRUB_MOD_INIT(usbserial_ftdi) +VasEBoot_MOD_INIT(usbserial_ftdi) { - grub_usb_register_attach_hook_class (&attach_hook); + VasEBoot_usb_register_attach_hook_class (&attach_hook); } -GRUB_MOD_FINI(usbserial_ftdi) +VasEBoot_MOD_FINI(usbserial_ftdi) { - grub_serial_unregister_driver (&grub_ftdi_driver); - grub_usb_unregister_attach_hook_class (&attach_hook); + VasEBoot_serial_unregister_driver (&VasEBoot_ftdi_driver); + VasEBoot_usb_unregister_attach_hook_class (&attach_hook); } diff --git a/VasEBoot-core/bus/usb/serial/pl2303.c b/VasEBoot-core/bus/usb/serial/pl2303.c index d1945a2cb..1eb7af823 100644 --- a/VasEBoot-core/bus/usb/serial/pl2303.c +++ b/VasEBoot-core/bus/usb/serial/pl2303.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Convert speed to divisor. */ -static grub_uint32_t +static VasEBoot_uint32_t is_speed_supported (unsigned int speed) { unsigned int i; @@ -40,163 +40,163 @@ is_speed_supported (unsigned int speed) return 0; } -#define GRUB_PL2303_REQUEST_SET_CONFIG 0x20 -#define GRUB_PL2303_STOP_BITS_1 0x0 -#define GRUB_PL2303_STOP_BITS_1_5 0x1 -#define GRUB_PL2303_STOP_BITS_2 0x2 +#define VasEBoot_PL2303_REQUEST_SET_CONFIG 0x20 +#define VasEBoot_PL2303_STOP_BITS_1 0x0 +#define VasEBoot_PL2303_STOP_BITS_1_5 0x1 +#define VasEBoot_PL2303_STOP_BITS_2 0x2 -#define GRUB_PL2303_PARITY_NONE 0 -#define GRUB_PL2303_PARITY_ODD 1 -#define GRUB_PL2303_PARITY_EVEN 2 +#define VasEBoot_PL2303_PARITY_NONE 0 +#define VasEBoot_PL2303_PARITY_ODD 1 +#define VasEBoot_PL2303_PARITY_EVEN 2 -struct grub_pl2303_config +struct VasEBoot_pl2303_config { - grub_uint32_t speed; - grub_uint8_t stop_bits; - grub_uint8_t parity; - grub_uint8_t word_len; -} GRUB_PACKED; + VasEBoot_uint32_t speed; + VasEBoot_uint8_t stop_bits; + VasEBoot_uint8_t parity; + VasEBoot_uint8_t word_len; +} VasEBoot_PACKED; static void -real_config (struct grub_serial_port *port) +real_config (struct VasEBoot_serial_port *port) { - struct grub_pl2303_config config_pl2303; + struct VasEBoot_pl2303_config config_pl2303; char xx; if (port->configured) return; - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_IN, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_IN, 1, 0x8484, 0, 1, &xx); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 0x0404, 0, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_IN, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_IN, 1, 0x8484, 0, 1, &xx); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_IN, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_IN, 1, 0x8383, 0, 1, &xx); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_IN, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_IN, 1, 0x8484, 0, 1, &xx); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 0x0404, 1, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_IN, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_IN, 1, 0x8484, 0, 1, &xx); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_IN, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_IN, 1, 0x8383, 0, 1, &xx); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 0, 1, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 1, 0, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 2, 0x44, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 8, 0, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 9, 0, 0, 0); - if (port->config.stop_bits == GRUB_SERIAL_STOP_BITS_2) - config_pl2303.stop_bits = GRUB_PL2303_STOP_BITS_2; - else if (port->config.stop_bits == GRUB_SERIAL_STOP_BITS_1_5) - config_pl2303.stop_bits = GRUB_PL2303_STOP_BITS_1_5; + if (port->config.stop_bits == VasEBoot_SERIAL_STOP_BITS_2) + config_pl2303.stop_bits = VasEBoot_PL2303_STOP_BITS_2; + else if (port->config.stop_bits == VasEBoot_SERIAL_STOP_BITS_1_5) + config_pl2303.stop_bits = VasEBoot_PL2303_STOP_BITS_1_5; else - config_pl2303.stop_bits = GRUB_PL2303_STOP_BITS_1; + config_pl2303.stop_bits = VasEBoot_PL2303_STOP_BITS_1; switch (port->config.parity) { - case GRUB_SERIAL_PARITY_NONE: - config_pl2303.parity = GRUB_PL2303_PARITY_NONE; + case VasEBoot_SERIAL_PARITY_NONE: + config_pl2303.parity = VasEBoot_PL2303_PARITY_NONE; break; - case GRUB_SERIAL_PARITY_ODD: - config_pl2303.parity = GRUB_PL2303_PARITY_ODD; + case VasEBoot_SERIAL_PARITY_ODD: + config_pl2303.parity = VasEBoot_PL2303_PARITY_ODD; break; - case GRUB_SERIAL_PARITY_EVEN: - config_pl2303.parity = GRUB_PL2303_PARITY_EVEN; + case VasEBoot_SERIAL_PARITY_EVEN: + config_pl2303.parity = VasEBoot_PL2303_PARITY_EVEN; break; } config_pl2303.word_len = port->config.word_len; config_pl2303.speed = port->config.speed; - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT, - GRUB_PL2303_REQUEST_SET_CONFIG, 0, 0, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT, + VasEBoot_PL2303_REQUEST_SET_CONFIG, 0, 0, sizeof (config_pl2303), (char *) &config_pl2303); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT, 0x22, 3, 0, 0, 0); - grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT, + VasEBoot_usb_control_msg (port->usbdev, VasEBoot_USB_REQTYPE_VENDOR_OUT, 1, 0, port->config.rtscts ? 0x61 : 0, 0, 0); port->configured = 1; } /* Fetch a key. */ static int -pl2303_hw_fetch (struct grub_serial_port *port) +pl2303_hw_fetch (struct VasEBoot_serial_port *port) { real_config (port); - return grub_usbserial_fetch (port, 0); + return VasEBoot_usbserial_fetch (port, 0); } /* Put a character. */ static void -pl2303_hw_put (struct grub_serial_port *port, const int c) +pl2303_hw_put (struct VasEBoot_serial_port *port, const int c) { char cc = c; real_config (port); - grub_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc); + VasEBoot_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc); } -static grub_err_t -pl2303_hw_configure (struct grub_serial_port *port, - struct grub_serial_config *config) +static VasEBoot_err_t +pl2303_hw_configure (struct VasEBoot_serial_port *port, + struct VasEBoot_serial_config *config) { if (!is_speed_supported (config->speed)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port speed")); - if (config->parity != GRUB_SERIAL_PARITY_NONE - && config->parity != GRUB_SERIAL_PARITY_ODD - && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->parity != VasEBoot_SERIAL_PARITY_NONE + && config->parity != VasEBoot_SERIAL_PARITY_ODD + && config->parity != VasEBoot_SERIAL_PARITY_EVEN) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); - if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_1_5 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1_5 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_2) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port word length")); port->config = *config; port->configured = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_serial_driver grub_pl2303_driver = +static struct VasEBoot_serial_driver VasEBoot_pl2303_driver = { .configure = pl2303_hw_configure, .fetch = pl2303_hw_fetch, .put = pl2303_hw_put, - .fini = grub_usbserial_fini + .fini = VasEBoot_usbserial_fini }; static const struct { - grub_uint16_t vendor, product; + VasEBoot_uint16_t vendor, product; } products[] = { {0x067b, 0x2303} }; static int -grub_pl2303_attach (grub_usb_device_t usbdev, int configno, int interfno) +VasEBoot_pl2303_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno) { unsigned j; @@ -207,25 +207,25 @@ grub_pl2303_attach (grub_usb_device_t usbdev, int configno, int interfno) if (j == ARRAY_SIZE (products)) return 0; - return grub_usbserial_attach (usbdev, configno, interfno, - &grub_pl2303_driver, - GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING, - GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING); + return VasEBoot_usbserial_attach (usbdev, configno, interfno, + &VasEBoot_pl2303_driver, + VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING, + VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING); } -static struct grub_usb_attach_desc attach_hook = +static struct VasEBoot_usb_attach_desc attach_hook = { .class = 0xff, - .hook = grub_pl2303_attach + .hook = VasEBoot_pl2303_attach }; -GRUB_MOD_INIT(usbserial_pl2303) +VasEBoot_MOD_INIT(usbserial_pl2303) { - grub_usb_register_attach_hook_class (&attach_hook); + VasEBoot_usb_register_attach_hook_class (&attach_hook); } -GRUB_MOD_FINI(usbserial_pl2303) +VasEBoot_MOD_FINI(usbserial_pl2303) { - grub_serial_unregister_driver (&grub_pl2303_driver); - grub_usb_unregister_attach_hook_class (&attach_hook); + VasEBoot_serial_unregister_driver (&VasEBoot_pl2303_driver); + VasEBoot_usb_unregister_attach_hook_class (&attach_hook); } diff --git a/VasEBoot-core/bus/usb/serial/usbdebug_late.c b/VasEBoot-core/bus/usb/serial/usbdebug_late.c index e88ba130e..226ca88e1 100644 --- a/VasEBoot-core/bus/usb/serial/usbdebug_late.c +++ b/VasEBoot-core/bus/usb/serial/usbdebug_late.c @@ -1,93 +1,93 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Fetch a key. */ static int -usbdebug_late_hw_fetch (struct grub_serial_port *port) +usbdebug_late_hw_fetch (struct VasEBoot_serial_port *port) { - return grub_usbserial_fetch (port, 0); + return VasEBoot_usbserial_fetch (port, 0); } /* Put a character. */ static void -usbdebug_late_hw_put (struct grub_serial_port *port, const int c) +usbdebug_late_hw_put (struct VasEBoot_serial_port *port, const int c) { char cc = c; - grub_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc); + VasEBoot_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc); } -static grub_err_t -usbdebug_late_hw_configure (struct grub_serial_port *port __attribute__ ((unused)), - struct grub_serial_config *config __attribute__ ((unused))) +static VasEBoot_err_t +usbdebug_late_hw_configure (struct VasEBoot_serial_port *port __attribute__ ((unused)), + struct VasEBoot_serial_config *config __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_serial_driver grub_usbdebug_late_driver = +static struct VasEBoot_serial_driver VasEBoot_usbdebug_late_driver = { .configure = usbdebug_late_hw_configure, .fetch = usbdebug_late_hw_fetch, .put = usbdebug_late_hw_put, - .fini = grub_usbserial_fini + .fini = VasEBoot_usbserial_fini }; static int -grub_usbdebug_late_attach (grub_usb_device_t usbdev, int configno, int interfno) +VasEBoot_usbdebug_late_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno) { - grub_usb_err_t err; - struct grub_usb_desc_debug debugdesc; + VasEBoot_usb_err_t err; + struct VasEBoot_usb_desc_debug debugdesc; - err = grub_usb_get_descriptor (usbdev, GRUB_USB_DESCRIPTOR_DEBUG, configno, + err = VasEBoot_usb_get_descriptor (usbdev, VasEBoot_USB_DESCRIPTOR_DEBUG, configno, sizeof (debugdesc), (char *) &debugdesc); if (err) return 0; - return grub_usbserial_attach (usbdev, configno, interfno, - &grub_usbdebug_late_driver, + return VasEBoot_usbserial_attach (usbdev, configno, interfno, + &VasEBoot_usbdebug_late_driver, debugdesc.in_endp, debugdesc.out_endp); } -static struct grub_usb_attach_desc attach_hook = +static struct VasEBoot_usb_attach_desc attach_hook = { .class = 0xff, - .hook = grub_usbdebug_late_attach + .hook = VasEBoot_usbdebug_late_attach }; -GRUB_MOD_INIT(usbserial_usbdebug_late) +VasEBoot_MOD_INIT(usbserial_usbdebug_late) { - grub_usb_register_attach_hook_class (&attach_hook); + VasEBoot_usb_register_attach_hook_class (&attach_hook); } -GRUB_MOD_FINI(usbserial_usbdebug_late) +VasEBoot_MOD_FINI(usbserial_usbdebug_late) { - grub_serial_unregister_driver (&grub_usbdebug_late_driver); - grub_usb_unregister_attach_hook_class (&attach_hook); + VasEBoot_serial_unregister_driver (&VasEBoot_usbdebug_late_driver); + VasEBoot_usb_unregister_attach_hook_class (&attach_hook); } diff --git a/VasEBoot-core/bus/usb/uhci.c b/VasEBoot-core/bus/usb/uhci.c index 7c5811fd6..a55d8c124 100644 --- a/VasEBoot-core/bus/usb/uhci.c +++ b/VasEBoot-core/bus/usb/uhci.c @@ -1,213 +1,213 @@ /* uhci.c - UHCI Support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_UHCI_IOMASK (0x7FF << 5) +#define VasEBoot_UHCI_IOMASK (0x7FF << 5) #define N_QH 256 #define N_TD 640 typedef enum { - GRUB_UHCI_REG_USBCMD = 0x00, - GRUB_UHCI_REG_USBINTR = 0x04, - GRUB_UHCI_REG_FLBASEADD = 0x08, - GRUB_UHCI_REG_PORTSC1 = 0x10, - GRUB_UHCI_REG_PORTSC2 = 0x12, - GRUB_UHCI_REG_USBLEGSUP = 0xc0 - } grub_uhci_reg_t; + VasEBoot_UHCI_REG_USBCMD = 0x00, + VasEBoot_UHCI_REG_USBINTR = 0x04, + VasEBoot_UHCI_REG_FLBASEADD = 0x08, + VasEBoot_UHCI_REG_PORTSC1 = 0x10, + VasEBoot_UHCI_REG_PORTSC2 = 0x12, + VasEBoot_UHCI_REG_USBLEGSUP = 0xc0 + } VasEBoot_uhci_reg_t; enum { - GRUB_UHCI_DETECT_CHANGED = (1 << 1), - GRUB_UHCI_DETECT_HAVE_DEVICE = 1, - GRUB_UHCI_DETECT_LOW_SPEED = (1 << 8) + VasEBoot_UHCI_DETECT_CHANGED = (1 << 1), + VasEBoot_UHCI_DETECT_HAVE_DEVICE = 1, + VasEBoot_UHCI_DETECT_LOW_SPEED = (1 << 8) }; /* R/WC legacy support bits */ enum { - GRUB_UHCI_LEGSUP_END_A20GATE = (1 << 15), - GRUB_UHCI_TRAP_BY_64H_WSTAT = (1 << 11), - GRUB_UHCI_TRAP_BY_64H_RSTAT = (1 << 10), - GRUB_UHCI_TRAP_BY_60H_WSTAT = (1 << 9), - GRUB_UHCI_TRAP_BY_60H_RSTAT = (1 << 8) + VasEBoot_UHCI_LEGSUP_END_A20GATE = (1 << 15), + VasEBoot_UHCI_TRAP_BY_64H_WSTAT = (1 << 11), + VasEBoot_UHCI_TRAP_BY_64H_RSTAT = (1 << 10), + VasEBoot_UHCI_TRAP_BY_60H_WSTAT = (1 << 9), + VasEBoot_UHCI_TRAP_BY_60H_RSTAT = (1 << 8) }; /* Reset all legacy support - clear all R/WC bits and all R/W bits */ -#define GRUB_UHCI_RESET_LEGSUP_SMI ( GRUB_UHCI_LEGSUP_END_A20GATE \ - | GRUB_UHCI_TRAP_BY_64H_WSTAT \ - | GRUB_UHCI_TRAP_BY_64H_RSTAT \ - | GRUB_UHCI_TRAP_BY_60H_WSTAT \ - | GRUB_UHCI_TRAP_BY_60H_RSTAT ) +#define VasEBoot_UHCI_RESET_LEGSUP_SMI ( VasEBoot_UHCI_LEGSUP_END_A20GATE \ + | VasEBoot_UHCI_TRAP_BY_64H_WSTAT \ + | VasEBoot_UHCI_TRAP_BY_64H_RSTAT \ + | VasEBoot_UHCI_TRAP_BY_60H_WSTAT \ + | VasEBoot_UHCI_TRAP_BY_60H_RSTAT ) /* Some UHCI commands */ -#define GRUB_UHCI_CMD_RUN_STOP (1 << 0) -#define GRUB_UHCI_CMD_HCRESET (1 << 1) -#define GRUB_UHCI_CMD_MAXP (1 << 7) +#define VasEBoot_UHCI_CMD_RUN_STOP (1 << 0) +#define VasEBoot_UHCI_CMD_HCRESET (1 << 1) +#define VasEBoot_UHCI_CMD_MAXP (1 << 7) /* Important bits in structures */ -#define GRUB_UHCI_LINK_TERMINATE 1 -#define GRUB_UHCI_LINK_QUEUE_HEAD 2 +#define VasEBoot_UHCI_LINK_TERMINATE 1 +#define VasEBoot_UHCI_LINK_QUEUE_HEAD 2 enum { - GRUB_UHCI_REG_PORTSC_CONNECT_CHANGED = 0x0002, - GRUB_UHCI_REG_PORTSC_PORT_ENABLED = 0x0004, - GRUB_UHCI_REG_PORTSC_RESUME = 0x0040, - GRUB_UHCI_REG_PORTSC_RESET = 0x0200, - GRUB_UHCI_REG_PORTSC_SUSPEND = 0x1000, - GRUB_UHCI_REG_PORTSC_RW = GRUB_UHCI_REG_PORTSC_PORT_ENABLED - | GRUB_UHCI_REG_PORTSC_RESUME | GRUB_UHCI_REG_PORTSC_RESET - | GRUB_UHCI_REG_PORTSC_SUSPEND, + VasEBoot_UHCI_REG_PORTSC_CONNECT_CHANGED = 0x0002, + VasEBoot_UHCI_REG_PORTSC_PORT_ENABLED = 0x0004, + VasEBoot_UHCI_REG_PORTSC_RESUME = 0x0040, + VasEBoot_UHCI_REG_PORTSC_RESET = 0x0200, + VasEBoot_UHCI_REG_PORTSC_SUSPEND = 0x1000, + VasEBoot_UHCI_REG_PORTSC_RW = VasEBoot_UHCI_REG_PORTSC_PORT_ENABLED + | VasEBoot_UHCI_REG_PORTSC_RESUME | VasEBoot_UHCI_REG_PORTSC_RESET + | VasEBoot_UHCI_REG_PORTSC_SUSPEND, /* These bits should not be written as 1 unless we really need it */ - GRUB_UHCI_PORTSC_RWC = ((1 << 1) | (1 << 3) | (1 << 11) | (3 << 13)) + VasEBoot_UHCI_PORTSC_RWC = ((1 << 1) | (1 << 3) | (1 << 11) | (3 << 13)) }; /* UHCI Queue Head. */ -struct grub_uhci_qh +struct VasEBoot_uhci_qh { /* Queue head link pointer which points to the next queue head. */ - grub_uint32_t linkptr; + VasEBoot_uint32_t linkptr; /* Queue element link pointer which points to the first data object within the queue. */ - grub_uint32_t elinkptr; + VasEBoot_uint32_t elinkptr; /* Queue heads are aligned on 16 bytes, pad so a queue head is 16 bytes so we can store many in a 4K page. */ - grub_uint8_t pad[8]; -} GRUB_PACKED; + VasEBoot_uint8_t pad[8]; +} VasEBoot_PACKED; /* UHCI Transfer Descriptor. */ -struct grub_uhci_td +struct VasEBoot_uhci_td { /* Pointer to the next TD in the list. */ - grub_uint32_t linkptr; + VasEBoot_uint32_t linkptr; /* Control and status bits. */ - grub_uint32_t ctrl_status; + VasEBoot_uint32_t ctrl_status; /* All information required to transfer the Token packet. */ - grub_uint32_t token; + VasEBoot_uint32_t token; /* A pointer to the data buffer, UHCI requires this pointer to be 32 bits. */ - grub_uint32_t buffer; + VasEBoot_uint32_t buffer; /* Another linkptr that is not overwritten by the Host Controller. - This is GRUB specific. */ - grub_uint32_t linkptr2; + This is VasEBoot specific. */ + VasEBoot_uint32_t linkptr2; /* 3 additional 32 bits words reserved for the Host Controller Driver. */ - grub_uint32_t data[3]; -} GRUB_PACKED; + VasEBoot_uint32_t data[3]; +} VasEBoot_PACKED; -typedef volatile struct grub_uhci_td *grub_uhci_td_t; -typedef volatile struct grub_uhci_qh *grub_uhci_qh_t; +typedef volatile struct VasEBoot_uhci_td *VasEBoot_uhci_td_t; +typedef volatile struct VasEBoot_uhci_qh *VasEBoot_uhci_qh_t; -struct grub_uhci +struct VasEBoot_uhci { - grub_port_t iobase; - volatile grub_uint32_t *framelist_virt; - grub_uint32_t framelist_phys; - struct grub_pci_dma_chunk *framelist_chunk; + VasEBoot_port_t iobase; + volatile VasEBoot_uint32_t *framelist_virt; + VasEBoot_uint32_t framelist_phys; + struct VasEBoot_pci_dma_chunk *framelist_chunk; /* N_QH Queue Heads. */ - struct grub_pci_dma_chunk *qh_chunk; - volatile grub_uhci_qh_t qh_virt; - grub_uint32_t qh_phys; + struct VasEBoot_pci_dma_chunk *qh_chunk; + volatile VasEBoot_uhci_qh_t qh_virt; + VasEBoot_uint32_t qh_phys; /* N_TD Transfer Descriptors. */ - struct grub_pci_dma_chunk *td_chunk; - volatile grub_uhci_td_t td_virt; - grub_uint32_t td_phys; + struct VasEBoot_pci_dma_chunk *td_chunk; + volatile VasEBoot_uhci_td_t td_virt; + VasEBoot_uint32_t td_phys; /* Free Transfer Descriptors. */ - grub_uhci_td_t tdfree; + VasEBoot_uhci_td_t tdfree; int qh_busy[N_QH]; - struct grub_uhci *next; + struct VasEBoot_uhci *next; }; -static struct grub_uhci *uhci; +static struct VasEBoot_uhci *uhci; -static grub_uint16_t -grub_uhci_readreg16 (struct grub_uhci *u, grub_uhci_reg_t reg) +static VasEBoot_uint16_t +VasEBoot_uhci_readreg16 (struct VasEBoot_uhci *u, VasEBoot_uhci_reg_t reg) { - return grub_inw (u->iobase + reg); + return VasEBoot_inw (u->iobase + reg); } #if 0 -static grub_uint32_t -grub_uhci_readreg32 (struct grub_uhci *u, grub_uhci_reg_t reg) +static VasEBoot_uint32_t +VasEBoot_uhci_readreg32 (struct VasEBoot_uhci *u, VasEBoot_uhci_reg_t reg) { - return grub_inl (u->iobase + reg); + return VasEBoot_inl (u->iobase + reg); } #endif static void -grub_uhci_writereg16 (struct grub_uhci *u, - grub_uhci_reg_t reg, grub_uint16_t val) +VasEBoot_uhci_writereg16 (struct VasEBoot_uhci *u, + VasEBoot_uhci_reg_t reg, VasEBoot_uint16_t val) { - grub_outw (val, u->iobase + reg); + VasEBoot_outw (val, u->iobase + reg); } static void -grub_uhci_writereg32 (struct grub_uhci *u, - grub_uhci_reg_t reg, grub_uint32_t val) +VasEBoot_uhci_writereg32 (struct VasEBoot_uhci *u, + VasEBoot_uhci_reg_t reg, VasEBoot_uint32_t val) { - grub_outl (val, u->iobase + reg); + VasEBoot_outl (val, u->iobase + reg); } /* Iterate over all PCI devices. Determine if a device is an UHCI controller. If this is the case, initialize it. */ static int -grub_uhci_pci_iter (grub_pci_device_t dev, - grub_pci_id_t pciid __attribute__((unused)), +VasEBoot_uhci_pci_iter (VasEBoot_pci_device_t dev, + VasEBoot_pci_id_t pciid __attribute__((unused)), void *data __attribute__ ((unused))) { - grub_uint32_t class_code; - grub_uint32_t class; - grub_uint32_t subclass; - grub_uint32_t interf; - grub_uint32_t base; - grub_uint32_t fp; - grub_pci_address_t addr; - struct grub_uhci *u; + VasEBoot_uint32_t class_code; + VasEBoot_uint32_t class; + VasEBoot_uint32_t subclass; + VasEBoot_uint32_t interf; + VasEBoot_uint32_t base; + VasEBoot_uint32_t fp; + VasEBoot_pci_address_t addr; + struct VasEBoot_uhci *u; int i; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class_code = grub_pci_read (addr) >> 8; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class_code = VasEBoot_pci_read (addr) >> 8; interf = class_code & 0xFF; subclass = (class_code >> 8) & 0xFF; @@ -218,78 +218,78 @@ grub_uhci_pci_iter (grub_pci_device_t dev, return 0; /* Determine IO base address. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG4); - base = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG4); + base = VasEBoot_pci_read (addr); /* Stop if there is no IO space base address defined. */ - if ((base & GRUB_PCI_ADDR_SPACE_MASK) != GRUB_PCI_ADDR_SPACE_IO) + if ((base & VasEBoot_PCI_ADDR_SPACE_MASK) != VasEBoot_PCI_ADDR_SPACE_IO) return 0; - if ((base & GRUB_UHCI_IOMASK) == 0) + if ((base & VasEBoot_UHCI_IOMASK) == 0) return 0; /* Set bus master - needed for coreboot or broken BIOSes */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word(addr, GRUB_PCI_COMMAND_IO_ENABLED - | GRUB_PCI_COMMAND_BUS_MASTER - | GRUB_PCI_COMMAND_MEM_ENABLED - | grub_pci_read_word (addr)); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word(addr, VasEBoot_PCI_COMMAND_IO_ENABLED + | VasEBoot_PCI_COMMAND_BUS_MASTER + | VasEBoot_PCI_COMMAND_MEM_ENABLED + | VasEBoot_pci_read_word (addr)); - grub_dprintf ("uhci", "base = %x\n", base); + VasEBoot_dprintf ("uhci", "base = %x\n", base); /* Allocate memory for the controller and register it. */ - u = grub_zalloc (sizeof (*u)); + u = VasEBoot_zalloc (sizeof (*u)); if (! u) return 1; - u->iobase = (base & GRUB_UHCI_IOMASK) + GRUB_MACHINE_PCI_IO_BASE; + u->iobase = (base & VasEBoot_UHCI_IOMASK) + VasEBoot_MACHINE_PCI_IO_BASE; /* Reset PIRQ and SMI */ - addr = grub_pci_make_address (dev, GRUB_UHCI_REG_USBLEGSUP); - grub_pci_write_word(addr, GRUB_UHCI_RESET_LEGSUP_SMI); + addr = VasEBoot_pci_make_address (dev, VasEBoot_UHCI_REG_USBLEGSUP); + VasEBoot_pci_write_word(addr, VasEBoot_UHCI_RESET_LEGSUP_SMI); /* Reset the HC */ - grub_uhci_writereg16(u, GRUB_UHCI_REG_USBCMD, GRUB_UHCI_CMD_HCRESET); - grub_millisleep(5); + VasEBoot_uhci_writereg16(u, VasEBoot_UHCI_REG_USBCMD, VasEBoot_UHCI_CMD_HCRESET); + VasEBoot_millisleep(5); /* Disable interrupts and commands (just to be safe) */ - grub_uhci_writereg16(u, GRUB_UHCI_REG_USBINTR, 0); + VasEBoot_uhci_writereg16(u, VasEBoot_UHCI_REG_USBINTR, 0); /* Finish HC reset, HC remains disabled */ - grub_uhci_writereg16(u, GRUB_UHCI_REG_USBCMD, 0); + VasEBoot_uhci_writereg16(u, VasEBoot_UHCI_REG_USBCMD, 0); /* Read back to be sure PCI write is done */ - grub_uhci_readreg16(u, GRUB_UHCI_REG_USBCMD); + VasEBoot_uhci_readreg16(u, VasEBoot_UHCI_REG_USBCMD); /* Reserve a page for the frame list. */ - u->framelist_chunk = grub_memalign_dma32 (4096, 4096); + u->framelist_chunk = VasEBoot_memalign_dma32 (4096, 4096); if (! u->framelist_chunk) goto fail; - u->framelist_virt = grub_dma_get_virt (u->framelist_chunk); - u->framelist_phys = grub_dma_get_phys (u->framelist_chunk); + u->framelist_virt = VasEBoot_dma_get_virt (u->framelist_chunk); + u->framelist_phys = VasEBoot_dma_get_phys (u->framelist_chunk); - grub_dprintf ("uhci", + VasEBoot_dprintf ("uhci", "class=0x%02x 0x%02x interface 0x%02x base=0x%x framelist=%p\n", class, subclass, interf, u->iobase, u->framelist_virt); /* The QH pointer of UHCI is only 32 bits, make sure this code works on on 64 bits architectures. */ - u->qh_chunk = grub_memalign_dma32 (4096, sizeof(struct grub_uhci_qh) * N_QH); + u->qh_chunk = VasEBoot_memalign_dma32 (4096, sizeof(struct VasEBoot_uhci_qh) * N_QH); if (! u->qh_chunk) goto fail; - u->qh_virt = grub_dma_get_virt (u->qh_chunk); - u->qh_phys = grub_dma_get_phys (u->qh_chunk); + u->qh_virt = VasEBoot_dma_get_virt (u->qh_chunk); + u->qh_phys = VasEBoot_dma_get_phys (u->qh_chunk); /* The TD pointer of UHCI is only 32 bits, make sure this code works on on 64 bits architectures. */ - u->td_chunk = grub_memalign_dma32 (4096, sizeof(struct grub_uhci_td) * N_TD); + u->td_chunk = VasEBoot_memalign_dma32 (4096, sizeof(struct VasEBoot_uhci_td) * N_TD); if (! u->td_chunk) goto fail; - u->td_virt = grub_dma_get_virt (u->td_chunk); - u->td_phys = grub_dma_get_phys (u->td_chunk); + u->td_virt = VasEBoot_dma_get_virt (u->td_chunk); + u->td_phys = VasEBoot_dma_get_phys (u->td_chunk); - grub_dprintf ("uhci", "QH=%p, TD=%p\n", + VasEBoot_dprintf ("uhci", "QH=%p, TD=%p\n", u->qh_virt, u->td_virt); /* Link all Transfer Descriptors in a list of available Transfer Descriptors. */ for (i = 0; i < N_TD; i++) - u->td_virt[i].linkptr = u->td_phys + (i + 1) * sizeof(struct grub_uhci_td); + u->td_virt[i].linkptr = u->td_phys + (i + 1) * sizeof(struct VasEBoot_uhci_td); u->td_virt[N_TD - 2].linkptr = 0; u->tdfree = u->td_virt; @@ -302,18 +302,18 @@ grub_uhci_pci_iter (grub_pci_device_t dev, for (i = 0; i < 1024; i++) u->framelist_virt[i] = fp; /* Program the framelist address into the UHCI controller. */ - grub_uhci_writereg32 (u, GRUB_UHCI_REG_FLBASEADD, u->framelist_phys); + VasEBoot_uhci_writereg32 (u, VasEBoot_UHCI_REG_FLBASEADD, u->framelist_phys); /* Make the Queue Heads point to each other. */ for (i = 0; i < N_QH; i++) { /* Point to the next QH. */ u->qh_virt[i].linkptr = ((u->qh_phys - + (i + 1) * sizeof(struct grub_uhci_qh)) + + (i + 1) * sizeof(struct VasEBoot_uhci_qh)) & (~15)); /* This is a QH. */ - u->qh_virt[i].linkptr |= GRUB_UHCI_LINK_QUEUE_HEAD; + u->qh_virt[i].linkptr |= VasEBoot_UHCI_LINK_QUEUE_HEAD; /* For the moment, do not point to a Transfer Descriptor. These are set at transfer time, so just terminate it. */ @@ -324,11 +324,11 @@ grub_uhci_pci_iter (grub_pci_device_t dev, u->qh_virt[N_QH - 1].linkptr = 1; /* Enable UHCI again. */ - grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, - GRUB_UHCI_CMD_RUN_STOP | GRUB_UHCI_CMD_MAXP); + VasEBoot_uhci_writereg16 (u, VasEBoot_UHCI_REG_USBCMD, + VasEBoot_UHCI_CMD_RUN_STOP | VasEBoot_UHCI_CMD_MAXP); /* UHCI is initialized and ready for transfers. */ - grub_dprintf ("uhci", "UHCI initialized\n"); + VasEBoot_dprintf ("uhci", "UHCI initialized\n"); #if 0 @@ -336,11 +336,11 @@ grub_uhci_pci_iter (grub_pci_device_t dev, int i; for (i = 0; i < 10; i++) { - grub_uint16_t frnum; + VasEBoot_uint16_t frnum; - frnum = grub_uhci_readreg16 (u, 6); - grub_dprintf ("uhci", "Framenum=%d\n", frnum); - grub_millisleep (100); + frnum = VasEBoot_uhci_readreg16 (u, 6); + VasEBoot_dprintf ("uhci", "Framenum=%d\n", frnum); + VasEBoot_millisleep (100); } } #endif @@ -354,45 +354,45 @@ grub_uhci_pci_iter (grub_pci_device_t dev, fail: if (u) { - grub_dma_free (u->qh_chunk); - grub_dma_free (u->framelist_chunk); + VasEBoot_dma_free (u->qh_chunk); + VasEBoot_dma_free (u->framelist_chunk); } - grub_free (u); + VasEBoot_free (u); return 1; } static void -grub_uhci_inithw (void) +VasEBoot_uhci_inithw (void) { - grub_pci_iterate (grub_uhci_pci_iter, NULL); + VasEBoot_pci_iterate (VasEBoot_uhci_pci_iter, NULL); } -static grub_uhci_td_t -grub_alloc_td (struct grub_uhci *u) +static VasEBoot_uhci_td_t +VasEBoot_alloc_td (struct VasEBoot_uhci *u) { - grub_uhci_td_t ret; + VasEBoot_uhci_td_t ret; /* Check if there is a Transfer Descriptor available. */ if (! u->tdfree) return NULL; ret = u->tdfree; - u->tdfree = grub_dma_phys2virt (u->tdfree->linkptr, u->td_chunk); + u->tdfree = VasEBoot_dma_phys2virt (u->tdfree->linkptr, u->td_chunk); return ret; } static void -grub_free_td (struct grub_uhci *u, grub_uhci_td_t td) +VasEBoot_free_td (struct VasEBoot_uhci *u, VasEBoot_uhci_td_t td) { - td->linkptr = grub_dma_virt2phys (u->tdfree, u->td_chunk); + td->linkptr = VasEBoot_dma_virt2phys (u->tdfree, u->td_chunk); u->tdfree = td; } static void -grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td, - grub_usb_transfer_t transfer, grub_size_t *actual) +VasEBoot_free_queue (struct VasEBoot_uhci *u, VasEBoot_uhci_qh_t qh, VasEBoot_uhci_td_t td, + VasEBoot_usb_transfer_t transfer, VasEBoot_size_t *actual) { int i; /* Index of TD in transfer */ @@ -403,9 +403,9 @@ grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td, /* Free the TDs in this queue and set last_trans. */ for (i=0; td; i++) { - grub_uhci_td_t tdprev; + VasEBoot_uhci_td_t tdprev; - grub_dprintf ("uhci", "Freeing %p\n", td); + VasEBoot_dprintf ("uhci", "Freeing %p\n", td); /* Check state of TD and possibly set last_trans */ if (transfer && (td->linkptr & 1)) transfer->last_trans = i; @@ -417,24 +417,24 @@ grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td, if (!td->linkptr2) td = 0; else - td = grub_dma_phys2virt (td->linkptr2, u->td_chunk); + td = VasEBoot_dma_phys2virt (td->linkptr2, u->td_chunk); /* Free the TD. */ - grub_free_td (u, tdprev); + VasEBoot_free_td (u, tdprev); } } -static grub_uhci_qh_t -grub_alloc_qh (struct grub_uhci *u, - grub_transaction_type_t tr __attribute__((unused))) +static VasEBoot_uhci_qh_t +VasEBoot_alloc_qh (struct VasEBoot_uhci *u, + VasEBoot_transaction_type_t tr __attribute__((unused))) { int i; - grub_uhci_qh_t qh; + VasEBoot_uhci_qh_t qh; /* Look for a Queue Head for this transfer. Skip the first QH if this is a Interrupt Transfer. */ #if 0 - if (tr == GRUB_USB_TRANSACTION_TYPE_INTERRUPT) + if (tr == VasEBoot_USB_TRANSACTION_TYPE_INTERRUPT) i = 0; else #endif @@ -448,7 +448,7 @@ grub_alloc_qh (struct grub_uhci *u, qh = &u->qh_virt[i]; if (i == N_QH) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "no free queue heads available"); return NULL; } @@ -458,28 +458,28 @@ grub_alloc_qh (struct grub_uhci *u, return qh; } -static grub_uhci_td_t -grub_uhci_transaction (struct grub_uhci *u, unsigned int endp, - grub_transfer_type_t type, unsigned int addr, - unsigned int toggle, grub_size_t size, - grub_uint32_t data, grub_usb_speed_t speed) +static VasEBoot_uhci_td_t +VasEBoot_uhci_transaction (struct VasEBoot_uhci *u, unsigned int endp, + VasEBoot_transfer_type_t type, unsigned int addr, + unsigned int toggle, VasEBoot_size_t size, + VasEBoot_uint32_t data, VasEBoot_usb_speed_t speed) { - grub_uhci_td_t td; + VasEBoot_uhci_td_t td; static const unsigned int tf[] = { 0x69, 0xE1, 0x2D }; /* XXX: Check if data is <4GB. If it isn't, just copy stuff around. This is only relevant for 64 bits architectures. */ /* Grab a free Transfer Descriptor and initialize it. */ - td = grub_alloc_td (u); + td = VasEBoot_alloc_td (u); if (! td) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "no transfer descriptors available for UHCI transfer"); return 0; } - grub_dprintf ("uhci", + VasEBoot_dprintf ("uhci", "transaction: endp=%d, type=%d, addr=%d, toggle=%d, size=%lu data=0x%x td=%p\n", endp, type, addr, toggle, (unsigned long) size, data, td); @@ -488,7 +488,7 @@ grub_uhci_transaction (struct grub_uhci *u, unsigned int endp, /* Active! Only retry a transfer 3 times. */ td->ctrl_status = (1 << 23) | (3 << 27) | - ((speed == GRUB_USB_SPEED_LOW) ? (1 << 26) : 0); + ((speed == VasEBoot_USB_SPEED_LOW) ? (1 << 26) : 0); /* If zero bytes are transmitted, size is 0x7FF. Otherwise size is size-1. */ @@ -506,49 +506,49 @@ grub_uhci_transaction (struct grub_uhci *u, unsigned int endp, return td; } -struct grub_uhci_transfer_controller_data +struct VasEBoot_uhci_transfer_controller_data { - grub_uhci_qh_t qh; - grub_uhci_td_t td_first; + VasEBoot_uhci_qh_t qh; + VasEBoot_uhci_td_t td_first; }; -static grub_usb_err_t -grub_uhci_setup_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +static VasEBoot_usb_err_t +VasEBoot_uhci_setup_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_uhci *u = (struct grub_uhci *) dev->data; - grub_uhci_td_t td; - grub_uhci_td_t td_prev = NULL; + struct VasEBoot_uhci *u = (struct VasEBoot_uhci *) dev->data; + VasEBoot_uhci_td_t td; + VasEBoot_uhci_td_t td_prev = NULL; int i; - struct grub_uhci_transfer_controller_data *cdata; + struct VasEBoot_uhci_transfer_controller_data *cdata; - cdata = grub_malloc (sizeof (*cdata)); + cdata = VasEBoot_malloc (sizeof (*cdata)); if (!cdata) - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; cdata->td_first = NULL; /* Allocate a queue head for the transfer queue. */ - cdata->qh = grub_alloc_qh (u, GRUB_USB_TRANSACTION_TYPE_CONTROL); + cdata->qh = VasEBoot_alloc_qh (u, VasEBoot_USB_TRANSACTION_TYPE_CONTROL); if (! cdata->qh) { - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } - grub_dprintf ("uhci", "transfer, iobase:%08x\n", u->iobase); + VasEBoot_dprintf ("uhci", "transfer, iobase:%08x\n", u->iobase); for (i = 0; i < transfer->transcnt; i++) { - grub_usb_transaction_t tr = &transfer->transactions[i]; + VasEBoot_usb_transaction_t tr = &transfer->transactions[i]; - td = grub_uhci_transaction (u, transfer->endpoint & 15, tr->pid, + td = VasEBoot_uhci_transaction (u, transfer->endpoint & 15, tr->pid, transfer->devaddr, tr->toggle, tr->size, tr->data, transfer->dev->speed); if (! td) { - grub_size_t actual = 0; + VasEBoot_size_t actual = 0; /* Terminate and free. */ if (td_prev) { @@ -557,18 +557,18 @@ grub_uhci_setup_transfer (grub_usb_controller_t dev, } if (cdata->td_first) - grub_free_queue (u, cdata->qh, cdata->td_first, NULL, &actual); + VasEBoot_free_queue (u, cdata->qh, cdata->td_first, NULL, &actual); - grub_free (cdata); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_INTERNAL; } if (! cdata->td_first) cdata->td_first = td; else { - td_prev->linkptr2 = grub_dma_virt2phys (td, u->td_chunk); - td_prev->linkptr = grub_dma_virt2phys (td, u->td_chunk); + td_prev->linkptr2 = VasEBoot_dma_virt2phys (td, u->td_chunk); + td_prev->linkptr = VasEBoot_dma_virt2phys (td, u->td_chunk); td_prev->linkptr |= 4; } td_prev = td; @@ -576,38 +576,38 @@ grub_uhci_setup_transfer (grub_usb_controller_t dev, td_prev->linkptr2 = 0; td_prev->linkptr = 1; - grub_dprintf ("uhci", "setup transaction %d\n", transfer->type); + VasEBoot_dprintf ("uhci", "setup transaction %d\n", transfer->type); /* Link it into the queue and terminate. Now the transaction can take place. */ - cdata->qh->elinkptr = grub_dma_virt2phys (cdata->td_first, u->td_chunk); + cdata->qh->elinkptr = VasEBoot_dma_virt2phys (cdata->td_first, u->td_chunk); - grub_dprintf ("uhci", "initiate transaction\n"); + VasEBoot_dprintf ("uhci", "initiate transaction\n"); transfer->controller_data = cdata; - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_err_t -grub_uhci_check_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, - grub_size_t *actual) +static VasEBoot_usb_err_t +VasEBoot_uhci_check_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, + VasEBoot_size_t *actual) { - struct grub_uhci *u = (struct grub_uhci *) dev->data; - grub_uhci_td_t errtd; - struct grub_uhci_transfer_controller_data *cdata = transfer->controller_data; + struct VasEBoot_uhci *u = (struct VasEBoot_uhci *) dev->data; + VasEBoot_uhci_td_t errtd; + struct VasEBoot_uhci_transfer_controller_data *cdata = transfer->controller_data; *actual = 0; if (cdata->qh->elinkptr & ~0x0f) - errtd = grub_dma_phys2virt (cdata->qh->elinkptr & ~0x0f, u->qh_chunk); + errtd = VasEBoot_dma_phys2virt (cdata->qh->elinkptr & ~0x0f, u->qh_chunk); else errtd = 0; if (errtd) { - grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p, %x\n", + VasEBoot_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p, %x\n", errtd->ctrl_status, errtd->buffer & (~15), errtd, cdata->qh->elinkptr); } @@ -615,53 +615,53 @@ grub_uhci_check_transfer (grub_usb_controller_t dev, /* Check if the transaction completed. */ if (cdata->qh->elinkptr & 1) { - grub_dprintf ("uhci", "transaction complete\n"); + VasEBoot_dprintf ("uhci", "transaction complete\n"); /* Place the QH back in the free list and deallocate the associated TDs. */ cdata->qh->elinkptr = 1; - grub_free_queue (u, cdata->qh, cdata->td_first, transfer, actual); - grub_free (cdata); - return GRUB_USB_ERR_NONE; + VasEBoot_free_queue (u, cdata->qh, cdata->td_first, transfer, actual); + VasEBoot_free (cdata); + return VasEBoot_USB_ERR_NONE; } if (errtd && !(errtd->ctrl_status & (1 << 23))) { - grub_usb_err_t err = GRUB_USB_ERR_NONE; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NONE; /* Check if the endpoint is stalled. */ if (errtd->ctrl_status & (1 << 22)) - err = GRUB_USB_ERR_STALL; + err = VasEBoot_USB_ERR_STALL; /* Check if an error related to the data buffer occurred. */ else if (errtd->ctrl_status & (1 << 21)) - err = GRUB_USB_ERR_DATA; + err = VasEBoot_USB_ERR_DATA; /* Check if a babble error occurred. */ else if (errtd->ctrl_status & (1 << 20)) - err = GRUB_USB_ERR_BABBLE; + err = VasEBoot_USB_ERR_BABBLE; /* Check if a NAK occurred. */ else if (errtd->ctrl_status & (1 << 19)) - err = GRUB_USB_ERR_NAK; + err = VasEBoot_USB_ERR_NAK; /* Check if a timeout occurred. */ else if (errtd->ctrl_status & (1 << 18)) - err = GRUB_USB_ERR_TIMEOUT; + err = VasEBoot_USB_ERR_TIMEOUT; /* Check if a bitstuff error occurred. */ else if (errtd->ctrl_status & (1 << 17)) - err = GRUB_USB_ERR_BITSTUFF; + err = VasEBoot_USB_ERR_BITSTUFF; if (err) { - grub_dprintf ("uhci", "transaction failed\n"); + VasEBoot_dprintf ("uhci", "transaction failed\n"); /* Place the QH back in the free list and deallocate the associated TDs. */ cdata->qh->elinkptr = 1; - grub_free_queue (u, cdata->qh, cdata->td_first, transfer, actual); - grub_free (cdata); + VasEBoot_free_queue (u, cdata->qh, cdata->td_first, transfer, actual); + VasEBoot_free (cdata); return err; } @@ -669,35 +669,35 @@ grub_uhci_check_transfer (grub_usb_controller_t dev, /* Fall through, no errors occurred, so the QH might be updated. */ - grub_dprintf ("uhci", "transaction fallthrough\n"); + VasEBoot_dprintf ("uhci", "transaction fallthrough\n"); - return GRUB_USB_ERR_WAIT; + return VasEBoot_USB_ERR_WAIT; } -static grub_usb_err_t -grub_uhci_cancel_transfer (grub_usb_controller_t dev, - grub_usb_transfer_t transfer) +static VasEBoot_usb_err_t +VasEBoot_uhci_cancel_transfer (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer) { - struct grub_uhci *u = (struct grub_uhci *) dev->data; - grub_size_t actual; - struct grub_uhci_transfer_controller_data *cdata = transfer->controller_data; + struct VasEBoot_uhci *u = (struct VasEBoot_uhci *) dev->data; + VasEBoot_size_t actual; + struct VasEBoot_uhci_transfer_controller_data *cdata = transfer->controller_data; - grub_dprintf ("uhci", "transaction cancel\n"); + VasEBoot_dprintf ("uhci", "transaction cancel\n"); /* Place the QH back in the free list and deallocate the associated TDs. */ cdata->qh->elinkptr = 1; - grub_free_queue (u, cdata->qh, cdata->td_first, transfer, &actual); - grub_free (cdata); + VasEBoot_free_queue (u, cdata->qh, cdata->td_first, transfer, &actual); + VasEBoot_free (cdata); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } static int -grub_uhci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data) +VasEBoot_uhci_iterate (VasEBoot_usb_controller_iterate_hook_t hook, void *hook_data) { - struct grub_uhci *u; - struct grub_usb_controller dev; + struct VasEBoot_uhci *u; + struct VasEBoot_usb_controller dev; for (u = uhci; u; u = u->next) { @@ -709,163 +709,163 @@ grub_uhci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data) return 0; } -static grub_usb_err_t -grub_uhci_portstatus (grub_usb_controller_t dev, +static VasEBoot_usb_err_t +VasEBoot_uhci_portstatus (VasEBoot_usb_controller_t dev, unsigned int port, unsigned int enable) { - struct grub_uhci *u = (struct grub_uhci *) dev->data; + struct VasEBoot_uhci *u = (struct VasEBoot_uhci *) dev->data; int reg; unsigned int status; - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; - grub_dprintf ("uhci", "portstatus, iobase:%08x\n", u->iobase); + VasEBoot_dprintf ("uhci", "portstatus, iobase:%08x\n", u->iobase); - grub_dprintf ("uhci", "enable=%d port=%d\n", enable, port); + VasEBoot_dprintf ("uhci", "enable=%d port=%d\n", enable, port); if (port == 0) - reg = GRUB_UHCI_REG_PORTSC1; + reg = VasEBoot_UHCI_REG_PORTSC1; else if (port == 1) - reg = GRUB_UHCI_REG_PORTSC2; + reg = VasEBoot_UHCI_REG_PORTSC2; else - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; - status = grub_uhci_readreg16 (u, reg); - grub_dprintf ("uhci", "detect=0x%02x\n", status); + status = VasEBoot_uhci_readreg16 (u, reg); + VasEBoot_dprintf ("uhci", "detect=0x%02x\n", status); if (!enable) /* We don't need reset port */ { /* Disable the port. */ - grub_uhci_writereg16 (u, reg, 0 << 2); - grub_dprintf ("uhci", "waiting for the port to be disabled\n"); - endtime = grub_get_time_ms () + 1000; - while ((grub_uhci_readreg16 (u, reg) & (1 << 2))) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; + VasEBoot_uhci_writereg16 (u, reg, 0 << 2); + VasEBoot_dprintf ("uhci", "waiting for the port to be disabled\n"); + endtime = VasEBoot_get_time_ms () + 1000; + while ((VasEBoot_uhci_readreg16 (u, reg) & (1 << 2))) + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; - status = grub_uhci_readreg16 (u, reg); - grub_dprintf ("uhci", ">3detect=0x%02x\n", status); - return GRUB_USB_ERR_NONE; + status = VasEBoot_uhci_readreg16 (u, reg); + VasEBoot_dprintf ("uhci", ">3detect=0x%02x\n", status); + return VasEBoot_USB_ERR_NONE; } /* Reset the port. */ - status = grub_uhci_readreg16 (u, reg) & ~GRUB_UHCI_PORTSC_RWC; - grub_uhci_writereg16 (u, reg, status | (1 << 9)); - grub_uhci_readreg16 (u, reg); /* Ensure it is writen... */ + status = VasEBoot_uhci_readreg16 (u, reg) & ~VasEBoot_UHCI_PORTSC_RWC; + VasEBoot_uhci_writereg16 (u, reg, status | (1 << 9)); + VasEBoot_uhci_readreg16 (u, reg); /* Ensure it is writen... */ /* Wait for the reset to complete. XXX: How long exactly? */ - grub_millisleep (50); /* For root hub should be nominaly 50ms */ - status = grub_uhci_readreg16 (u, reg) & ~GRUB_UHCI_PORTSC_RWC; - grub_uhci_writereg16 (u, reg, status & ~(1 << 9)); - grub_uhci_readreg16 (u, reg); /* Ensure it is writen... */ + VasEBoot_millisleep (50); /* For root hub should be nominaly 50ms */ + status = VasEBoot_uhci_readreg16 (u, reg) & ~VasEBoot_UHCI_PORTSC_RWC; + VasEBoot_uhci_writereg16 (u, reg, status & ~(1 << 9)); + VasEBoot_uhci_readreg16 (u, reg); /* Ensure it is writen... */ /* Note: some debug prints were removed because they affected reset/enable timing. */ - grub_millisleep (1); /* Probably not needed at all or only few microsecs. */ + VasEBoot_millisleep (1); /* Probably not needed at all or only few microsecs. */ /* Reset bits Connect & Enable Status Change */ - status = grub_uhci_readreg16 (u, reg) & ~GRUB_UHCI_PORTSC_RWC; - grub_uhci_writereg16 (u, reg, status | (1 << 3) | GRUB_UHCI_REG_PORTSC_CONNECT_CHANGED); - grub_uhci_readreg16 (u, reg); /* Ensure it is writen... */ + status = VasEBoot_uhci_readreg16 (u, reg) & ~VasEBoot_UHCI_PORTSC_RWC; + VasEBoot_uhci_writereg16 (u, reg, status | (1 << 3) | VasEBoot_UHCI_REG_PORTSC_CONNECT_CHANGED); + VasEBoot_uhci_readreg16 (u, reg); /* Ensure it is writen... */ /* Enable the port. */ - status = grub_uhci_readreg16 (u, reg) & ~GRUB_UHCI_PORTSC_RWC; - grub_uhci_writereg16 (u, reg, status | (1 << 2)); - grub_uhci_readreg16 (u, reg); /* Ensure it is writen... */ + status = VasEBoot_uhci_readreg16 (u, reg) & ~VasEBoot_UHCI_PORTSC_RWC; + VasEBoot_uhci_writereg16 (u, reg, status | (1 << 2)); + VasEBoot_uhci_readreg16 (u, reg); /* Ensure it is writen... */ - endtime = grub_get_time_ms () + 1000; - while (! ((status = grub_uhci_readreg16 (u, reg)) & (1 << 2))) - if (grub_get_time_ms () > endtime) - return GRUB_USB_ERR_TIMEOUT; + endtime = VasEBoot_get_time_ms () + 1000; + while (! ((status = VasEBoot_uhci_readreg16 (u, reg)) & (1 << 2))) + if (VasEBoot_get_time_ms () > endtime) + return VasEBoot_USB_ERR_TIMEOUT; /* Reset recovery time */ - grub_millisleep (10); + VasEBoot_millisleep (10); /* Read final port status */ - status = grub_uhci_readreg16 (u, reg); - grub_dprintf ("uhci", ">3detect=0x%02x\n", status); + status = VasEBoot_uhci_readreg16 (u, reg); + VasEBoot_dprintf ("uhci", ">3detect=0x%02x\n", status); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } -static grub_usb_speed_t -grub_uhci_detect_dev (grub_usb_controller_t dev, int port, int *changed) +static VasEBoot_usb_speed_t +VasEBoot_uhci_detect_dev (VasEBoot_usb_controller_t dev, int port, int *changed) { - struct grub_uhci *u = (struct grub_uhci *) dev->data; + struct VasEBoot_uhci *u = (struct VasEBoot_uhci *) dev->data; int reg; unsigned int status; - grub_dprintf ("uhci", "detect_dev, iobase:%08x\n", u->iobase); + VasEBoot_dprintf ("uhci", "detect_dev, iobase:%08x\n", u->iobase); if (port == 0) - reg = GRUB_UHCI_REG_PORTSC1; + reg = VasEBoot_UHCI_REG_PORTSC1; else if (port == 1) - reg = GRUB_UHCI_REG_PORTSC2; + reg = VasEBoot_UHCI_REG_PORTSC2; else - return GRUB_USB_SPEED_NONE; + return VasEBoot_USB_SPEED_NONE; - status = grub_uhci_readreg16 (u, reg); + status = VasEBoot_uhci_readreg16 (u, reg); - grub_dprintf ("uhci", "detect=0x%02x port=%d\n", status, port); + VasEBoot_dprintf ("uhci", "detect=0x%02x port=%d\n", status, port); /* Connect Status Change bit - it detects change of connection */ - if (status & GRUB_UHCI_DETECT_CHANGED) + if (status & VasEBoot_UHCI_DETECT_CHANGED) { *changed = 1; /* Reset bit Connect Status Change */ - grub_uhci_writereg16 (u, reg, (status & GRUB_UHCI_REG_PORTSC_RW) - | GRUB_UHCI_REG_PORTSC_CONNECT_CHANGED); + VasEBoot_uhci_writereg16 (u, reg, (status & VasEBoot_UHCI_REG_PORTSC_RW) + | VasEBoot_UHCI_REG_PORTSC_CONNECT_CHANGED); } else *changed = 0; - if (! (status & GRUB_UHCI_DETECT_HAVE_DEVICE)) - return GRUB_USB_SPEED_NONE; - else if (status & GRUB_UHCI_DETECT_LOW_SPEED) - return GRUB_USB_SPEED_LOW; + if (! (status & VasEBoot_UHCI_DETECT_HAVE_DEVICE)) + return VasEBoot_USB_SPEED_NONE; + else if (status & VasEBoot_UHCI_DETECT_LOW_SPEED) + return VasEBoot_USB_SPEED_LOW; else - return GRUB_USB_SPEED_FULL; + return VasEBoot_USB_SPEED_FULL; } static int -grub_uhci_hubports (grub_usb_controller_t dev __attribute__((unused))) +VasEBoot_uhci_hubports (VasEBoot_usb_controller_t dev __attribute__((unused))) { /* The root hub has exactly two ports. */ return 2; } -static struct grub_usb_controller_dev usb_controller = +static struct VasEBoot_usb_controller_dev usb_controller = { .name = "uhci", - .iterate = grub_uhci_iterate, - .setup_transfer = grub_uhci_setup_transfer, - .check_transfer = grub_uhci_check_transfer, - .cancel_transfer = grub_uhci_cancel_transfer, - .hubports = grub_uhci_hubports, - .portstatus = grub_uhci_portstatus, - .detect_dev = grub_uhci_detect_dev, + .iterate = VasEBoot_uhci_iterate, + .setup_transfer = VasEBoot_uhci_setup_transfer, + .check_transfer = VasEBoot_uhci_check_transfer, + .cancel_transfer = VasEBoot_uhci_cancel_transfer, + .hubports = VasEBoot_uhci_hubports, + .portstatus = VasEBoot_uhci_portstatus, + .detect_dev = VasEBoot_uhci_detect_dev, /* estimated max. count of TDs for one bulk transfer */ .max_bulk_tds = N_TD * 3 / 4 }; -GRUB_MOD_INIT(uhci) +VasEBoot_MOD_INIT(uhci) { - grub_stop_disk_firmware (); + VasEBoot_stop_disk_firmware (); - grub_uhci_inithw (); - grub_usb_controller_dev_register (&usb_controller); - grub_dprintf ("uhci", "registered\n"); + VasEBoot_uhci_inithw (); + VasEBoot_usb_controller_dev_register (&usb_controller); + VasEBoot_dprintf ("uhci", "registered\n"); } -GRUB_MOD_FINI(uhci) +VasEBoot_MOD_FINI(uhci) { - struct grub_uhci *u; + struct VasEBoot_uhci *u; /* Disable all UHCI controllers. */ for (u = uhci; u; u = u->next) - grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, 0); + VasEBoot_uhci_writereg16 (u, VasEBoot_UHCI_REG_USBCMD, 0); /* Unregister the controller. */ - grub_usb_controller_dev_unregister (&usb_controller); + VasEBoot_usb_controller_dev_unregister (&usb_controller); } diff --git a/VasEBoot-core/bus/usb/usb.c b/VasEBoot-core/bus/usb/usb.c index 8da5e4c74..9a228402e 100644 --- a/VasEBoot-core/bus/usb/usb.c +++ b/VasEBoot-core/bus/usb/usb.c @@ -1,47 +1,47 @@ /* usb.c - Generic USB interfaces. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static struct grub_usb_attach_desc *attach_hooks; +static struct VasEBoot_usb_attach_desc *attach_hooks; #if 0 -/* Context for grub_usb_controller_iterate. */ -struct grub_usb_controller_iterate_ctx +/* Context for VasEBoot_usb_controller_iterate. */ +struct VasEBoot_usb_controller_iterate_ctx { - grub_usb_controller_iterate_hook_t hook; + VasEBoot_usb_controller_iterate_hook_t hook; void *hook_data; - grub_usb_controller_dev_t p; + VasEBoot_usb_controller_dev_t p; }; -/* Helper for grub_usb_controller_iterate. */ +/* Helper for VasEBoot_usb_controller_iterate. */ static int -grub_usb_controller_iterate_iter (grub_usb_controller_t dev, void *data) +VasEBoot_usb_controller_iterate_iter (VasEBoot_usb_controller_t dev, void *data) { - struct grub_usb_controller_iterate_ctx *ctx = data; + struct VasEBoot_usb_controller_iterate_ctx *ctx = data; dev->dev = ctx->p; if (ctx->hook (dev, ctx->hook_data)) @@ -50,20 +50,20 @@ grub_usb_controller_iterate_iter (grub_usb_controller_t dev, void *data) } int -grub_usb_controller_iterate (grub_usb_controller_iterate_hook_t hook, +VasEBoot_usb_controller_iterate (VasEBoot_usb_controller_iterate_hook_t hook, void *hook_data) { - struct grub_usb_controller_iterate_ctx ctx = { + struct VasEBoot_usb_controller_iterate_ctx ctx = { .hook = hook, .hook_data = hook_data }; /* Iterate over all controller drivers. */ - for (ctx.p = grub_usb_list; ctx.p; ctx.p = ctx.p->next) + for (ctx.p = VasEBoot_usb_list; ctx.p; ctx.p = ctx.p->next) { /* Iterate over the busses of the controllers. XXX: Actually, a hub driver should do this. */ - if (ctx.p->iterate (grub_usb_controller_iterate_iter, &ctx)) + if (ctx.p->iterate (VasEBoot_usb_controller_iterate_iter, &ctx)) return 1; } @@ -72,63 +72,63 @@ grub_usb_controller_iterate (grub_usb_controller_iterate_hook_t hook, #endif -grub_usb_err_t -grub_usb_clear_halt (grub_usb_device_t dev, int endpoint) +VasEBoot_usb_err_t +VasEBoot_usb_clear_halt (VasEBoot_usb_device_t dev, int endpoint) { dev->toggle[endpoint] = 0; - return grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_STANDARD - | GRUB_USB_REQTYPE_TARGET_ENDP), - GRUB_USB_REQ_CLEAR_FEATURE, - GRUB_USB_FEATURE_ENDP_HALT, + return VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_STANDARD + | VasEBoot_USB_REQTYPE_TARGET_ENDP), + VasEBoot_USB_REQ_CLEAR_FEATURE, + VasEBoot_USB_FEATURE_ENDP_HALT, endpoint, 0, 0); } -grub_usb_err_t -grub_usb_set_configuration (grub_usb_device_t dev, int configuration) +VasEBoot_usb_err_t +VasEBoot_usb_set_configuration (VasEBoot_usb_device_t dev, int configuration) { - grub_memset (dev->toggle, 0, sizeof (dev->toggle)); + VasEBoot_memset (dev->toggle, 0, sizeof (dev->toggle)); - return grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_STANDARD - | GRUB_USB_REQTYPE_TARGET_DEV), - GRUB_USB_REQ_SET_CONFIGURATION, configuration, + return VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_STANDARD + | VasEBoot_USB_REQTYPE_TARGET_DEV), + VasEBoot_USB_REQ_SET_CONFIGURATION, configuration, 0, 0, NULL); } -grub_usb_err_t -grub_usb_get_descriptor (grub_usb_device_t dev, - grub_uint8_t type, grub_uint8_t index, - grub_size_t size, char *data) +VasEBoot_usb_err_t +VasEBoot_usb_get_descriptor (VasEBoot_usb_device_t dev, + VasEBoot_uint8_t type, VasEBoot_uint8_t index, + VasEBoot_size_t size, char *data) { - return grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN - | GRUB_USB_REQTYPE_STANDARD - | GRUB_USB_REQTYPE_TARGET_DEV), - GRUB_USB_REQ_GET_DESCRIPTOR, + return VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_IN + | VasEBoot_USB_REQTYPE_STANDARD + | VasEBoot_USB_REQTYPE_TARGET_DEV), + VasEBoot_USB_REQ_GET_DESCRIPTOR, (type << 8) | index, 0, size, data); } -grub_usb_err_t -grub_usb_device_initialize (grub_usb_device_t dev) +VasEBoot_usb_err_t +VasEBoot_usb_device_initialize (VasEBoot_usb_device_t dev) { - struct grub_usb_desc_device *descdev; - struct grub_usb_desc_config config; - grub_usb_err_t err; + struct VasEBoot_usb_desc_device *descdev; + struct VasEBoot_usb_desc_config config; + VasEBoot_usb_err_t err; int i; /* First we have to read first 8 bytes only and determine * max. size of packet */ dev->descdev.maxsize0 = 0; /* invalidating, for safety only, can be removed if it is sure it is zero here */ - err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_DEVICE, + err = VasEBoot_usb_get_descriptor (dev, VasEBoot_USB_DESCRIPTOR_DEVICE, 0, 8, (char *) &dev->descdev); if (err) return err; /* Now we have valid value in dev->descdev.maxsize0, * so we can read whole device descriptor */ - err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_DEVICE, - 0, sizeof (struct grub_usb_desc_device), + err = VasEBoot_usb_get_descriptor (dev, VasEBoot_USB_DESCRIPTOR_DEVICE, + 0, sizeof (struct VasEBoot_usb_desc_device), (char *) &dev->descdev); if (err) return err; @@ -139,7 +139,7 @@ grub_usb_device_initialize (grub_usb_device_t dev) if (descdev->configcnt == 0) { - err = GRUB_USB_ERR_BADDEVICE; + err = VasEBoot_USB_ERR_BADDEVICE; goto fail; } @@ -148,23 +148,23 @@ grub_usb_device_initialize (grub_usb_device_t dev) int pos; int currif; char *data; - struct grub_usb_desc *desc; + struct VasEBoot_usb_desc *desc; /* First just read the first 4 bytes of the configuration descriptor, after that it is known how many bytes really have to be read. */ - err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_CONFIG, i, 4, + err = VasEBoot_usb_get_descriptor (dev, VasEBoot_USB_DESCRIPTOR_CONFIG, i, 4, (char *) &config); - data = grub_malloc (config.totallen); + data = VasEBoot_malloc (config.totallen); if (! data) { - err = GRUB_USB_ERR_INTERNAL; + err = VasEBoot_USB_ERR_INTERNAL; goto fail; } - dev->config[i].descconf = (struct grub_usb_desc_config *) data; - err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_CONFIG, i, + dev->config[i].descconf = (struct VasEBoot_usb_desc_config *) data; + err = VasEBoot_usb_get_descriptor (dev, VasEBoot_USB_DESCRIPTOR_CONFIG, i, config.totallen, data); if (err) goto fail; @@ -177,29 +177,29 @@ grub_usb_device_initialize (grub_usb_device_t dev) { while (pos < config.totallen) { - desc = (struct grub_usb_desc *)&data[pos]; - if (desc->type == GRUB_USB_DESCRIPTOR_INTERFACE) + desc = (struct VasEBoot_usb_desc *)&data[pos]; + if (desc->type == VasEBoot_USB_DESCRIPTOR_INTERFACE) break; if (!desc->length) { - err = GRUB_USB_ERR_BADDEVICE; + err = VasEBoot_USB_ERR_BADDEVICE; goto fail; } pos += desc->length; } dev->config[i].interf[currif].descif - = (struct grub_usb_desc_if *) &data[pos]; + = (struct VasEBoot_usb_desc_if *) &data[pos]; pos += dev->config[i].interf[currif].descif->length; while (pos < config.totallen) { - desc = (struct grub_usb_desc *)&data[pos]; - if (desc->type == GRUB_USB_DESCRIPTOR_ENDPOINT) + desc = (struct VasEBoot_usb_desc *)&data[pos]; + if (desc->type == VasEBoot_USB_DESCRIPTOR_ENDPOINT) break; if (!desc->length) { - err = GRUB_USB_ERR_BADDEVICE; + err = VasEBoot_USB_ERR_BADDEVICE; goto fail; } pos += desc->length; @@ -207,35 +207,35 @@ grub_usb_device_initialize (grub_usb_device_t dev) /* Point to the first endpoint. */ dev->config[i].interf[currif].descendp - = (struct grub_usb_desc_endp *) &data[pos]; - pos += (sizeof (struct grub_usb_desc_endp) + = (struct VasEBoot_usb_desc_endp *) &data[pos]; + pos += (sizeof (struct VasEBoot_usb_desc_endp) * dev->config[i].interf[currif].descif->endpointcnt); } } - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; fail: for (i = 0; i < 8; i++) - grub_free (dev->config[i].descconf); + VasEBoot_free (dev->config[i].descconf); return err; } -void grub_usb_device_attach (grub_usb_device_t dev) +void VasEBoot_usb_device_attach (VasEBoot_usb_device_t dev) { int i; /* XXX: Just check configuration 0 for now. */ for (i = 0; i < dev->config[0].descconf->numif; i++) { - struct grub_usb_desc_if *interf; - struct grub_usb_attach_desc *desc; + struct VasEBoot_usb_desc_if *interf; + struct VasEBoot_usb_attach_desc *desc; interf = dev->config[0].interf[i].descif; - grub_dprintf ("usb", "iterate: interf=%d, class=%d, subclass=%d, protocol=%d\n", + VasEBoot_dprintf ("usb", "iterate: interf=%d, class=%d, subclass=%d, protocol=%d\n", i, interf->class, interf->subclass, interf->protocol); if (dev->config[0].interf[i].attached) @@ -244,10 +244,10 @@ void grub_usb_device_attach (grub_usb_device_t dev) for (desc = attach_hooks; desc; desc = desc->next) if (interf->class == desc->class) { - grub_boot_time ("Probing USB device driver class %x", desc->class); + VasEBoot_boot_time ("Probing USB device driver class %x", desc->class); if (desc->hook (dev, 0, i)) dev->config[0].interf[i].attached = 1; - grub_boot_time ("Probed USB device driver class %x", desc->class); + VasEBoot_boot_time ("Probed USB device driver class %x", desc->class); } if (dev->config[0].interf[i].attached) @@ -255,33 +255,33 @@ void grub_usb_device_attach (grub_usb_device_t dev) switch (interf->class) { - case GRUB_USB_CLASS_MASS_STORAGE: - grub_dl_load ("usbms"); - grub_print_error (); + case VasEBoot_USB_CLASS_MASS_STORAGE: + VasEBoot_dl_load ("usbms"); + VasEBoot_print_error (); break; - case GRUB_USB_CLASS_HID: - grub_dl_load ("usb_keyboard"); - grub_print_error (); + case VasEBoot_USB_CLASS_HID: + VasEBoot_dl_load ("usb_keyboard"); + VasEBoot_print_error (); break; case 0xff: /* FIXME: don't load useless modules. */ - grub_dl_load ("usbserial_ftdi"); - grub_print_error (); - grub_dl_load ("usbserial_pl2303"); - grub_print_error (); - grub_dl_load ("usbserial_usbdebug"); - grub_print_error (); + VasEBoot_dl_load ("usbserial_ftdi"); + VasEBoot_print_error (); + VasEBoot_dl_load ("usbserial_pl2303"); + VasEBoot_print_error (); + VasEBoot_dl_load ("usbserial_usbdebug"); + VasEBoot_print_error (); break; } } } -/* Helper for grub_usb_register_attach_hook_class. */ +/* Helper for VasEBoot_usb_register_attach_hook_class. */ static int -grub_usb_register_attach_hook_class_iter (grub_usb_device_t usbdev, void *data) +VasEBoot_usb_register_attach_hook_class_iter (VasEBoot_usb_device_t usbdev, void *data) { - struct grub_usb_attach_desc *desc = data; - struct grub_usb_desc_device *descdev = &usbdev->descdev; + struct VasEBoot_usb_attach_desc *desc = data; + struct VasEBoot_usb_desc_device *descdev = &usbdev->descdev; int i; if (descdev->class != 0 || descdev->subclass || descdev->protocol != 0 @@ -291,11 +291,11 @@ grub_usb_register_attach_hook_class_iter (grub_usb_device_t usbdev, void *data) /* XXX: Just check configuration 0 for now. */ for (i = 0; i < usbdev->config[0].descconf->numif; i++) { - struct grub_usb_desc_if *interf; + struct VasEBoot_usb_desc_if *interf; interf = usbdev->config[0].interf[i].descif; - grub_dprintf ("usb", "iterate: interf=%d, class=%d, subclass=%d, protocol=%d\n", + VasEBoot_dprintf ("usb", "iterate: interf=%d, class=%d, subclass=%d, protocol=%d\n", i, interf->class, interf->subclass, interf->protocol); if (usbdev->config[0].interf[i].attached) @@ -311,27 +311,27 @@ grub_usb_register_attach_hook_class_iter (grub_usb_device_t usbdev, void *data) } void -grub_usb_register_attach_hook_class (struct grub_usb_attach_desc *desc) +VasEBoot_usb_register_attach_hook_class (struct VasEBoot_usb_attach_desc *desc) { desc->next = attach_hooks; attach_hooks = desc; - grub_usb_iterate (grub_usb_register_attach_hook_class_iter, desc); + VasEBoot_usb_iterate (VasEBoot_usb_register_attach_hook_class_iter, desc); } void -grub_usb_unregister_attach_hook_class (struct grub_usb_attach_desc *desc) +VasEBoot_usb_unregister_attach_hook_class (struct VasEBoot_usb_attach_desc *desc) { - grub_list_remove (GRUB_AS_LIST (desc)); + VasEBoot_list_remove (VasEBoot_AS_LIST (desc)); } -GRUB_MOD_INIT(usb) +VasEBoot_MOD_INIT(usb) { - grub_term_poll_usb = grub_usb_poll_devices; + VasEBoot_term_poll_usb = VasEBoot_usb_poll_devices; } -GRUB_MOD_FINI(usb) +VasEBoot_MOD_FINI(usb) { - grub_term_poll_usb = NULL; + VasEBoot_term_poll_usb = NULL; } diff --git a/VasEBoot-core/bus/usb/usbhub.c b/VasEBoot-core/bus/usb/usbhub.c index 34a7ff1b5..c8a2a1f8a 100644 --- a/VasEBoot-core/bus/usb/usbhub.c +++ b/VasEBoot-core/bus/usb/usbhub.c @@ -1,63 +1,63 @@ /* usb.c - USB Hub Support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#define GRUB_USBHUB_MAX_DEVICES 128 +#define VasEBoot_USBHUB_MAX_DEVICES 128 /* USB Supports 127 devices, with device 0 as special case. */ -static struct grub_usb_device *grub_usb_devs[GRUB_USBHUB_MAX_DEVICES]; +static struct VasEBoot_usb_device *VasEBoot_usb_devs[VasEBoot_USBHUB_MAX_DEVICES]; static int rescan = 0; static int npending = 0; -struct grub_usb_hub +struct VasEBoot_usb_hub { - struct grub_usb_hub *next; - grub_usb_controller_t controller; + struct VasEBoot_usb_hub *next; + VasEBoot_usb_controller_t controller; int nports; - struct grub_usb_device **devices; - struct grub_usb_hub_port *ports; - grub_usb_device_t dev; + struct VasEBoot_usb_device **devices; + struct VasEBoot_usb_hub_port *ports; + VasEBoot_usb_device_t dev; }; -static struct grub_usb_hub *hubs; -static grub_usb_controller_dev_t grub_usb_list; +static struct VasEBoot_usb_hub *hubs; +static VasEBoot_usb_controller_dev_t VasEBoot_usb_list; /* Add a device that currently has device number 0 and resides on CONTROLLER, the Hub reported that the device speed is SPEED. */ -static grub_usb_device_t -grub_usb_hub_add_dev (grub_usb_controller_t controller, - grub_usb_speed_t speed, +static VasEBoot_usb_device_t +VasEBoot_usb_hub_add_dev (VasEBoot_usb_controller_t controller, + VasEBoot_usb_speed_t speed, int split_hubport, int split_hubaddr) { - grub_usb_device_t dev; + VasEBoot_usb_device_t dev; int i; - grub_usb_err_t err; + VasEBoot_usb_err_t err; - grub_boot_time ("Attaching USB device"); + VasEBoot_boot_time ("Attaching USB device"); - dev = grub_zalloc (sizeof (struct grub_usb_device)); + dev = VasEBoot_zalloc (sizeof (struct VasEBoot_usb_device)); if (! dev) return NULL; @@ -66,108 +66,108 @@ grub_usb_hub_add_dev (grub_usb_controller_t controller, dev->split_hubport = split_hubport; dev->split_hubaddr = split_hubaddr; - err = grub_usb_device_initialize (dev); + err = VasEBoot_usb_device_initialize (dev); if (err) { - grub_free (dev); + VasEBoot_free (dev); return NULL; } /* Assign a new address to the device. */ - for (i = 1; i < GRUB_USBHUB_MAX_DEVICES; i++) + for (i = 1; i < VasEBoot_USBHUB_MAX_DEVICES; i++) { - if (! grub_usb_devs[i]) + if (! VasEBoot_usb_devs[i]) break; } - if (i == GRUB_USBHUB_MAX_DEVICES) + if (i == VasEBoot_USBHUB_MAX_DEVICES) { - grub_error (GRUB_ERR_IO, "can't assign address to USB device"); + VasEBoot_error (VasEBoot_ERR_IO, "can't assign address to USB device"); for (i = 0; i < 8; i++) - grub_free (dev->config[i].descconf); - grub_free (dev); + VasEBoot_free (dev->config[i].descconf); + VasEBoot_free (dev); return NULL; } - err = grub_usb_control_msg (dev, - (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_STANDARD - | GRUB_USB_REQTYPE_TARGET_DEV), - GRUB_USB_REQ_SET_ADDRESS, + err = VasEBoot_usb_control_msg (dev, + (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_STANDARD + | VasEBoot_USB_REQTYPE_TARGET_DEV), + VasEBoot_USB_REQ_SET_ADDRESS, i, 0, 0, NULL); if (err) { for (i = 0; i < 8; i++) - grub_free (dev->config[i].descconf); - grub_free (dev); + VasEBoot_free (dev->config[i].descconf); + VasEBoot_free (dev); return NULL; } dev->addr = i; dev->initialized = 1; - grub_usb_devs[i] = dev; + VasEBoot_usb_devs[i] = dev; - grub_dprintf ("usb", "Added new usb device: %p, addr=%d\n", + VasEBoot_dprintf ("usb", "Added new usb device: %p, addr=%d\n", dev, i); - grub_dprintf ("usb", "speed=%d, split_hubport=%d, split_hubaddr=%d\n", + VasEBoot_dprintf ("usb", "speed=%d, split_hubport=%d, split_hubaddr=%d\n", speed, split_hubport, split_hubaddr); /* Wait "recovery interval", spec. says 2ms */ - grub_millisleep (2); + VasEBoot_millisleep (2); - grub_boot_time ("Probing USB device driver"); + VasEBoot_boot_time ("Probing USB device driver"); - grub_usb_device_attach (dev); + VasEBoot_usb_device_attach (dev); - grub_boot_time ("Attached USB device"); + VasEBoot_boot_time ("Attached USB device"); return dev; } -static grub_usb_err_t -grub_usb_add_hub (grub_usb_device_t dev) +static VasEBoot_usb_err_t +VasEBoot_usb_add_hub (VasEBoot_usb_device_t dev) { - struct grub_usb_usb_hubdesc hubdesc; - grub_usb_err_t err; + struct VasEBoot_usb_usb_hubdesc hubdesc; + VasEBoot_usb_err_t err; int i; - err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_DEV), - GRUB_USB_REQ_GET_DESCRIPTOR, - (GRUB_USB_DESCRIPTOR_HUB << 8) | 0, + err = VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_IN + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_DEV), + VasEBoot_USB_REQ_GET_DESCRIPTOR, + (VasEBoot_USB_DESCRIPTOR_HUB << 8) | 0, 0, sizeof (hubdesc), (char *) &hubdesc); if (err) return err; - grub_dprintf ("usb", "Hub descriptor:\n\t\t len:%d, typ:0x%02x, cnt:%d, char:0x%02x, pwg:%d, curr:%d\n", + VasEBoot_dprintf ("usb", "Hub descriptor:\n\t\t len:%d, typ:0x%02x, cnt:%d, char:0x%02x, pwg:%d, curr:%d\n", hubdesc.length, hubdesc.type, hubdesc.portcnt, hubdesc.characteristics, hubdesc.pwdgood, hubdesc.current); /* Activate the first configuration. Hubs should have only one conf. */ - grub_dprintf ("usb", "Hub set configuration\n"); - grub_usb_set_configuration (dev, 1); + VasEBoot_dprintf ("usb", "Hub set configuration\n"); + VasEBoot_usb_set_configuration (dev, 1); dev->nports = hubdesc.portcnt; - dev->children = grub_zalloc (hubdesc.portcnt * sizeof (dev->children[0])); - dev->ports = grub_zalloc (dev->nports * sizeof (dev->ports[0])); + dev->children = VasEBoot_zalloc (hubdesc.portcnt * sizeof (dev->children[0])); + dev->ports = VasEBoot_zalloc (dev->nports * sizeof (dev->ports[0])); if (!dev->children || !dev->ports) { - grub_free (dev->children); - grub_free (dev->ports); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (dev->children); + VasEBoot_free (dev->ports); + return VasEBoot_USB_ERR_INTERNAL; } /* Power on all Hub ports. */ for (i = 1; i <= hubdesc.portcnt; i++) { - grub_dprintf ("usb", "Power on - port %d\n", i); + VasEBoot_dprintf ("usb", "Power on - port %d\n", i); /* Power on the port and wait for possible device connect */ - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_SET_FEATURE, - GRUB_USB_HUB_FEATURE_PORT_POWER, + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_SET_FEATURE, + VasEBoot_USB_HUB_FEATURE_PORT_POWER, i, 0, NULL); } @@ -175,19 +175,19 @@ grub_usb_add_hub (grub_usb_device_t dev) for (i = 0; i < dev->config[0].interf[0].descif->endpointcnt; i++) { - struct grub_usb_desc_endp *endp = NULL; + struct VasEBoot_usb_desc_endp *endp = NULL; endp = &dev->config[0].interf[0].descendp[i]; - if ((endp->endp_addr & 128) && grub_usb_get_ep_type(endp) - == GRUB_USB_EP_INTERRUPT) + if ((endp->endp_addr & 128) && VasEBoot_usb_get_ep_type(endp) + == VasEBoot_USB_EP_INTERRUPT) { - grub_size_t len; + VasEBoot_size_t len; dev->hub_endpoint = endp; len = endp->maxpacket; if (len > sizeof (dev->statuschange)) len = sizeof (dev->statuschange); dev->hub_transfer - = grub_usb_bulk_read_background (dev, endp, len, + = VasEBoot_usb_bulk_read_background (dev, endp, len, (char *) &dev->statuschange); break; } @@ -195,28 +195,28 @@ grub_usb_add_hub (grub_usb_device_t dev) rescan = 1; - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } static void -attach_root_port (struct grub_usb_hub *hub, int portno, - grub_usb_speed_t speed) +attach_root_port (struct VasEBoot_usb_hub *hub, int portno, + VasEBoot_usb_speed_t speed) { - grub_usb_device_t dev; - grub_usb_err_t err; + VasEBoot_usb_device_t dev; + VasEBoot_usb_err_t err; - grub_boot_time ("After detect_dev"); + VasEBoot_boot_time ("After detect_dev"); /* Enable the port. */ err = hub->controller->dev->portstatus (hub->controller, portno, 1); if (err) return; - hub->controller->dev->pending_reset = grub_get_time_ms () + 5000; + hub->controller->dev->pending_reset = VasEBoot_get_time_ms () + 5000; npending++; - grub_millisleep (10); + VasEBoot_millisleep (10); - grub_boot_time ("Port enabled"); + VasEBoot_boot_time ("Port enabled"); /* Enable the port and create a device. */ /* High speed device needs not transaction translation @@ -224,7 +224,7 @@ attach_root_port (struct grub_usb_hub *hub, int portno, and full/low speed device connected to OHCI/UHCI needs not transaction translation - e.g. hubport and hubaddr should be always none (zero) for any device connected to any root hub. */ - dev = grub_usb_hub_add_dev (hub->controller, speed, 0, 0); + dev = VasEBoot_usb_hub_add_dev (hub->controller, speed, 0, 0); hub->controller->dev->pending_reset = 0; npending--; if (! dev) @@ -234,49 +234,49 @@ attach_root_port (struct grub_usb_hub *hub, int portno, /* If the device is a Hub, scan it for more devices. */ if (dev->descdev.class == 0x09) - grub_usb_add_hub (dev); + VasEBoot_usb_add_hub (dev); - grub_boot_time ("Attached root port"); + VasEBoot_boot_time ("Attached root port"); } /* Iterate over all controllers found by the driver. */ static int -grub_usb_controller_dev_register_iter (grub_usb_controller_t controller, void *data) +VasEBoot_usb_controller_dev_register_iter (VasEBoot_usb_controller_t controller, void *data) { - grub_usb_controller_dev_t usb = data; - struct grub_usb_hub *hub; + VasEBoot_usb_controller_dev_t usb = data; + struct VasEBoot_usb_hub *hub; controller->dev = usb; - grub_boot_time ("Registering USB root hub"); + VasEBoot_boot_time ("Registering USB root hub"); - hub = grub_malloc (sizeof (*hub)); + hub = VasEBoot_malloc (sizeof (*hub)); if (!hub) - return GRUB_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_INTERNAL; hub->next = hubs; hubs = hub; - hub->controller = grub_malloc (sizeof (*controller)); + hub->controller = VasEBoot_malloc (sizeof (*controller)); if (!hub->controller) { - grub_free (hub); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (hub); + return VasEBoot_USB_ERR_INTERNAL; } - grub_memcpy (hub->controller, controller, sizeof (*controller)); + VasEBoot_memcpy (hub->controller, controller, sizeof (*controller)); hub->dev = 0; /* Query the number of ports the root Hub has. */ hub->nports = controller->dev->hubports (controller); - hub->devices = grub_zalloc (sizeof (hub->devices[0]) * hub->nports); - hub->ports = grub_zalloc (sizeof (hub->ports[0]) * hub->nports); + hub->devices = VasEBoot_zalloc (sizeof (hub->devices[0]) * hub->nports); + hub->ports = VasEBoot_zalloc (sizeof (hub->ports[0]) * hub->nports); if (!hub->devices || !hub->ports) { - grub_free (hub->devices); - grub_free (hub->ports); - grub_free (hub->controller); - grub_free (hub); - grub_print_error (); + VasEBoot_free (hub->devices); + VasEBoot_free (hub->ports); + VasEBoot_free (hub->controller); + VasEBoot_free (hub); + VasEBoot_print_error (); return 0; } @@ -284,11 +284,11 @@ grub_usb_controller_dev_register_iter (grub_usb_controller_t controller, void *d } void -grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb) +VasEBoot_usb_controller_dev_unregister (VasEBoot_usb_controller_dev_t usb) { - grub_usb_controller_dev_t *p, q; + VasEBoot_usb_controller_dev_t *p, q; - for (p = &grub_usb_list, q = *p; q; p = &(q->next), q = q->next) + for (p = &VasEBoot_usb_list, q = *p; q; p = &(q->next), q = q->next) if (q == usb) { *p = q->next; @@ -297,19 +297,19 @@ grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb) } void -grub_usb_controller_dev_register (grub_usb_controller_dev_t usb) +VasEBoot_usb_controller_dev_register (VasEBoot_usb_controller_dev_t usb) { int portno; int continue_waiting = 0; - struct grub_usb_hub *hub; + struct VasEBoot_usb_hub *hub; - usb->next = grub_usb_list; - grub_usb_list = usb; + usb->next = VasEBoot_usb_list; + VasEBoot_usb_list = usb; if (usb->iterate) - usb->iterate (grub_usb_controller_dev_register_iter, usb); + usb->iterate (VasEBoot_usb_controller_dev_register_iter, usb); - grub_boot_time ("waiting for stable power on USB root\n"); + VasEBoot_boot_time ("waiting for stable power on USB root\n"); while (1) { @@ -323,41 +323,41 @@ grub_usb_controller_dev_register (grub_usb_controller_dev_t usb) * it - but prevent deadlock in case when device is too faulty... */ for (portno = 0; portno < hub->nports; portno++) { - grub_usb_speed_t speed; + VasEBoot_usb_speed_t speed; int changed = 0; speed = hub->controller->dev->detect_dev (hub->controller, portno, &changed); if (hub->ports[portno].state == PORT_STATE_NORMAL - && speed != GRUB_USB_SPEED_NONE) + && speed != VasEBoot_USB_SPEED_NONE) { - hub->ports[portno].soft_limit_time = grub_get_time_ms () + 250; + hub->ports[portno].soft_limit_time = VasEBoot_get_time_ms () + 250; hub->ports[portno].hard_limit_time = hub->ports[portno].soft_limit_time + 1750; hub->ports[portno].state = PORT_STATE_WAITING_FOR_STABLE_POWER; - grub_boot_time ("Scheduling stable power wait for port %p:%d", + VasEBoot_boot_time ("Scheduling stable power wait for port %p:%d", usb, portno); continue_waiting++; continue; } if (hub->ports[portno].state == PORT_STATE_WAITING_FOR_STABLE_POWER - && speed == GRUB_USB_SPEED_NONE) + && speed == VasEBoot_USB_SPEED_NONE) { - hub->ports[portno].soft_limit_time = grub_get_time_ms () + 250; + hub->ports[portno].soft_limit_time = VasEBoot_get_time_ms () + 250; continue; } if (hub->ports[portno].state == PORT_STATE_WAITING_FOR_STABLE_POWER - && grub_get_time_ms () > hub->ports[portno].soft_limit_time) + && VasEBoot_get_time_ms () > hub->ports[portno].soft_limit_time) { hub->ports[portno].state = PORT_STATE_STABLE_POWER; - grub_boot_time ("Got stable power wait for port %p:%d", + VasEBoot_boot_time ("Got stable power wait for port %p:%d", usb, portno); continue_waiting--; continue; } if (hub->ports[portno].state == PORT_STATE_WAITING_FOR_STABLE_POWER - && grub_get_time_ms () > hub->ports[portno].hard_limit_time) + && VasEBoot_get_time_ms () > hub->ports[portno].hard_limit_time) { hub->ports[portno].state = PORT_STATE_FAILED_DEVICE; continue_waiting--; @@ -367,73 +367,73 @@ grub_usb_controller_dev_register (grub_usb_controller_dev_t usb) } if (!continue_waiting) break; - grub_millisleep (1); + VasEBoot_millisleep (1); } - grub_boot_time ("After the stable power wait on USB root"); + VasEBoot_boot_time ("After the stable power wait on USB root"); for (hub = hubs; hub; hub = hub->next) if (hub->controller->dev == usb) for (portno = 0; portno < hub->nports; portno++) if (hub->ports[portno].state == PORT_STATE_STABLE_POWER) { - grub_usb_speed_t speed; + VasEBoot_usb_speed_t speed; int changed = 0; hub->ports[portno].state = PORT_STATE_NORMAL; speed = hub->controller->dev->detect_dev (hub->controller, portno, &changed); attach_root_port (hub, portno, speed); } - grub_boot_time ("USB root hub registered"); + VasEBoot_boot_time ("USB root hub registered"); } -static void detach_device (grub_usb_device_t dev); +static void detach_device (VasEBoot_usb_device_t dev); static void -detach_device (grub_usb_device_t dev) +detach_device (VasEBoot_usb_device_t dev) { unsigned i; int k; if (!dev) return; - if (dev->descdev.class == GRUB_USB_CLASS_HUB) + if (dev->descdev.class == VasEBoot_USB_CLASS_HUB) { if (dev->hub_transfer) - grub_usb_cancel_transfer (dev->hub_transfer); + VasEBoot_usb_cancel_transfer (dev->hub_transfer); for (i = 0; i < dev->nports; i++) detach_device (dev->children[i]); - grub_free (dev->children); + VasEBoot_free (dev->children); } for (i = 0; i < ARRAY_SIZE (dev->config); i++) if (dev->config[i].descconf) for (k = 0; k < dev->config[i].descconf->numif; k++) { - struct grub_usb_interface *inter = &dev->config[i].interf[k]; + struct VasEBoot_usb_interface *inter = &dev->config[i].interf[k]; if (inter && inter->detach_hook) inter->detach_hook (dev, i, k); } - grub_usb_devs[dev->addr] = 0; + VasEBoot_usb_devs[dev->addr] = 0; } static int -wait_power_nonroot_hub (grub_usb_device_t dev) +wait_power_nonroot_hub (VasEBoot_usb_device_t dev) { - grub_usb_err_t err; + VasEBoot_usb_err_t err; int continue_waiting = 0; unsigned i; for (i = 1; i <= dev->nports; i++) if (dev->ports[i - 1].state == PORT_STATE_WAITING_FOR_STABLE_POWER) { - grub_uint64_t tm; - grub_uint32_t current_status = 0; + VasEBoot_uint64_t tm; + VasEBoot_uint32_t current_status = 0; /* Get the port status. */ - err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_GET_STATUS, + err = VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_IN + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_GET_STATUS, 0, i, sizeof (current_status), (char *) ¤t_status); @@ -442,22 +442,22 @@ wait_power_nonroot_hub (grub_usb_device_t dev) dev->ports[i - 1].state = PORT_STATE_FAILED_DEVICE; continue; } - tm = grub_get_time_ms (); - if (!(current_status & GRUB_USB_HUB_STATUS_PORT_CONNECTED)) + tm = VasEBoot_get_time_ms (); + if (!(current_status & VasEBoot_USB_HUB_STATUS_PORT_CONNECTED)) dev->ports[i - 1].soft_limit_time = tm + 250; if (tm >= dev->ports[i - 1].soft_limit_time) { if (dev->controller.dev->pending_reset) continue; /* Now do reset of port. */ - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_SET_FEATURE, - GRUB_USB_HUB_FEATURE_PORT_RESET, + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_SET_FEATURE, + VasEBoot_USB_HUB_FEATURE_PORT_RESET, i, 0, 0); dev->ports[i - 1].state = PORT_STATE_NORMAL; - grub_boot_time ("Resetting port %p:%d", dev, i - 1); + VasEBoot_boot_time ("Resetting port %p:%d", dev, i - 1); rescan = 1; /* We cannot reset more than one device at the same time ! @@ -467,7 +467,7 @@ wait_power_nonroot_hub (grub_usb_device_t dev) * Additionaly, we cannot perform another reset * anywhere on the same OHCI controller until * we will finish addressing of reseted device ! */ - dev->controller.dev->pending_reset = grub_get_time_ms () + 5000; + dev->controller.dev->pending_reset = VasEBoot_get_time_ms () + 5000; npending++; continue; } @@ -482,19 +482,19 @@ wait_power_nonroot_hub (grub_usb_device_t dev) } static void -poll_nonroot_hub (grub_usb_device_t dev) +poll_nonroot_hub (VasEBoot_usb_device_t dev) { - grub_usb_err_t err; + VasEBoot_usb_err_t err; unsigned i; - grub_uint32_t changed; - grub_size_t actual, len; + VasEBoot_uint32_t changed; + VasEBoot_size_t actual, len; if (!dev->hub_transfer) return; - err = grub_usb_check_transfer (dev->hub_transfer, &actual); + err = VasEBoot_usb_check_transfer (dev->hub_transfer, &actual); - if (err == GRUB_USB_ERR_WAIT) + if (err == VasEBoot_USB_ERR_WAIT) return; changed = dev->statuschange; @@ -503,7 +503,7 @@ poll_nonroot_hub (grub_usb_device_t dev) if (len > sizeof (dev->statuschange)) len = sizeof (dev->statuschange); dev->hub_transfer - = grub_usb_bulk_read_background (dev, dev->hub_endpoint, len, + = VasEBoot_usb_bulk_read_background (dev, dev->hub_endpoint, len, (char *) &dev->statuschange); if (err || actual == 0 || changed == 0) @@ -512,111 +512,111 @@ poll_nonroot_hub (grub_usb_device_t dev) /* Iterate over the Hub ports. */ for (i = 1; i <= dev->nports; i++) { - grub_uint32_t status; + VasEBoot_uint32_t status; if (!(changed & (1 << i)) || dev->ports[i - 1].state == PORT_STATE_WAITING_FOR_STABLE_POWER) continue; /* Get the port status. */ - err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_GET_STATUS, + err = VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_IN + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_GET_STATUS, 0, i, sizeof (status), (char *) &status); - grub_dprintf ("usb", "dev = %p, i = %d, status = %08x\n", + VasEBoot_dprintf ("usb", "dev = %p, i = %d, status = %08x\n", dev, i, status); if (err) continue; /* FIXME: properly handle these conditions. */ - if (status & GRUB_USB_HUB_STATUS_C_PORT_ENABLED) - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_CLEAR_FEATURE, - GRUB_USB_HUB_FEATURE_C_PORT_ENABLED, i, 0, 0); + if (status & VasEBoot_USB_HUB_STATUS_C_PORT_ENABLED) + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_CLEAR_FEATURE, + VasEBoot_USB_HUB_FEATURE_C_PORT_ENABLED, i, 0, 0); - if (status & GRUB_USB_HUB_STATUS_C_PORT_SUSPEND) - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_CLEAR_FEATURE, - GRUB_USB_HUB_FEATURE_C_PORT_SUSPEND, i, 0, 0); + if (status & VasEBoot_USB_HUB_STATUS_C_PORT_SUSPEND) + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_CLEAR_FEATURE, + VasEBoot_USB_HUB_FEATURE_C_PORT_SUSPEND, i, 0, 0); - if (status & GRUB_USB_HUB_STATUS_C_PORT_OVERCURRENT) - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_CLEAR_FEATURE, - GRUB_USB_HUB_FEATURE_C_PORT_OVERCURRENT, i, 0, 0); + if (status & VasEBoot_USB_HUB_STATUS_C_PORT_OVERCURRENT) + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_CLEAR_FEATURE, + VasEBoot_USB_HUB_FEATURE_C_PORT_OVERCURRENT, i, 0, 0); if (!dev->controller.dev->pending_reset && - (status & GRUB_USB_HUB_STATUS_C_PORT_CONNECTED)) + (status & VasEBoot_USB_HUB_STATUS_C_PORT_CONNECTED)) { - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_CLEAR_FEATURE, - GRUB_USB_HUB_FEATURE_C_PORT_CONNECTED, i, 0, 0); + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_CLEAR_FEATURE, + VasEBoot_USB_HUB_FEATURE_C_PORT_CONNECTED, i, 0, 0); detach_device (dev->children[i - 1]); dev->children[i - 1] = NULL; /* Connected and status of connection changed ? */ - if (status & GRUB_USB_HUB_STATUS_PORT_CONNECTED) + if (status & VasEBoot_USB_HUB_STATUS_PORT_CONNECTED) { - grub_boot_time ("Before the stable power wait portno=%d", i); + VasEBoot_boot_time ("Before the stable power wait portno=%d", i); /* A device is actually connected to this port. */ /* Wait for completion of insertion and stable power (USB spec.) * Should be at least 100ms, some devices requires more... * There is also another thing - some devices have worse contacts * and connected signal is unstable for some time - we should handle * it - but prevent deadlock in case when device is too faulty... */ - dev->ports[i - 1].soft_limit_time = grub_get_time_ms () + 250; + dev->ports[i - 1].soft_limit_time = VasEBoot_get_time_ms () + 250; dev->ports[i - 1].hard_limit_time = dev->ports[i - 1].soft_limit_time + 1750; dev->ports[i - 1].state = PORT_STATE_WAITING_FOR_STABLE_POWER; - grub_boot_time ("Scheduling stable power wait for port %p:%d", + VasEBoot_boot_time ("Scheduling stable power wait for port %p:%d", dev, i - 1); continue; } } - if (status & GRUB_USB_HUB_STATUS_C_PORT_RESET) + if (status & VasEBoot_USB_HUB_STATUS_C_PORT_RESET) { - grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT - | GRUB_USB_REQTYPE_CLASS - | GRUB_USB_REQTYPE_TARGET_OTHER), - GRUB_USB_REQ_CLEAR_FEATURE, - GRUB_USB_HUB_FEATURE_C_PORT_RESET, i, 0, 0); + VasEBoot_usb_control_msg (dev, (VasEBoot_USB_REQTYPE_OUT + | VasEBoot_USB_REQTYPE_CLASS + | VasEBoot_USB_REQTYPE_TARGET_OTHER), + VasEBoot_USB_REQ_CLEAR_FEATURE, + VasEBoot_USB_HUB_FEATURE_C_PORT_RESET, i, 0, 0); - grub_boot_time ("Port %d reset", i); + VasEBoot_boot_time ("Port %d reset", i); - if (status & GRUB_USB_HUB_STATUS_PORT_CONNECTED) + if (status & VasEBoot_USB_HUB_STATUS_PORT_CONNECTED) { - grub_usb_speed_t speed; - grub_usb_device_t next_dev; + VasEBoot_usb_speed_t speed; + VasEBoot_usb_device_t next_dev; int split_hubport = 0; int split_hubaddr = 0; /* Determine the device speed. */ - if (status & GRUB_USB_HUB_STATUS_PORT_LOWSPEED) - speed = GRUB_USB_SPEED_LOW; + if (status & VasEBoot_USB_HUB_STATUS_PORT_LOWSPEED) + speed = VasEBoot_USB_SPEED_LOW; else { - if (status & GRUB_USB_HUB_STATUS_PORT_HIGHSPEED) - speed = GRUB_USB_SPEED_HIGH; + if (status & VasEBoot_USB_HUB_STATUS_PORT_HIGHSPEED) + speed = VasEBoot_USB_SPEED_HIGH; else - speed = GRUB_USB_SPEED_FULL; + speed = VasEBoot_USB_SPEED_FULL; } /* Wait a recovery time after reset, spec. says 10ms */ - grub_millisleep (10); + VasEBoot_millisleep (10); /* Find correct values for SPLIT hubport and hubaddr */ - if (speed == GRUB_USB_SPEED_HIGH) + if (speed == VasEBoot_USB_SPEED_HIGH) { /* HIGH speed device needs not transaction translation */ split_hubport = 0; @@ -625,7 +625,7 @@ poll_nonroot_hub (grub_usb_device_t dev) else /* FULL/LOW device needs hub port and hub address for transaction translation (if connected to EHCI) */ - if (dev->speed == GRUB_USB_SPEED_HIGH) + if (dev->speed == VasEBoot_USB_SPEED_HIGH) { /* This port is the first FULL/LOW speed port in the chain from root hub. Attached device @@ -644,7 +644,7 @@ poll_nonroot_hub (grub_usb_device_t dev) } /* Add the device and assign a device address to it. */ - next_dev = grub_usb_hub_add_dev (&dev->controller, speed, + next_dev = VasEBoot_usb_hub_add_dev (&dev->controller, speed, split_hubport, split_hubaddr); if (dev->controller.dev->pending_reset) { @@ -658,16 +658,16 @@ poll_nonroot_hub (grub_usb_device_t dev) /* If the device is a Hub, scan it for more devices. */ if (next_dev->descdev.class == 0x09) - grub_usb_add_hub (next_dev); + VasEBoot_usb_add_hub (next_dev); } } } } void -grub_usb_poll_devices (int wait_for_completion) +VasEBoot_usb_poll_devices (int wait_for_completion) { - struct grub_usb_hub *hub; + struct VasEBoot_usb_hub *hub; int i; for (hub = hubs; hub; hub = hub->next) @@ -676,13 +676,13 @@ grub_usb_poll_devices (int wait_for_completion) /* No, it should be never changed, it should be constant. */ for (i = 0; i < hub->nports; i++) { - grub_usb_speed_t speed = GRUB_USB_SPEED_NONE; + VasEBoot_usb_speed_t speed = VasEBoot_USB_SPEED_NONE; int changed = 0; if (hub->controller->dev->pending_reset) { /* Check for possible timeout */ - if (grub_get_time_ms () > hub->controller->dev->pending_reset) + if (VasEBoot_get_time_ms () > hub->controller->dev->pending_reset) { /* Something went wrong, reset device was not * addressed properly, timeout happened */ @@ -698,7 +698,7 @@ grub_usb_poll_devices (int wait_for_completion) { detach_device (hub->devices[i]); hub->devices[i] = NULL; - if (speed != GRUB_USB_SPEED_NONE) + if (speed != VasEBoot_USB_SPEED_NONE) attach_root_port (hub, i, speed); } } @@ -709,9 +709,9 @@ grub_usb_poll_devices (int wait_for_completion) rescan = 0; /* We should check changes of non-root hubs too. */ - for (i = 0; i < GRUB_USBHUB_MAX_DEVICES; i++) + for (i = 0; i < VasEBoot_USBHUB_MAX_DEVICES; i++) { - grub_usb_device_t dev = grub_usb_devs[i]; + VasEBoot_usb_device_t dev = VasEBoot_usb_devs[i]; if (dev && dev->descdev.class == 0x09) poll_nonroot_hub (dev); @@ -720,34 +720,34 @@ grub_usb_poll_devices (int wait_for_completion) while (1) { int continue_waiting = 0; - for (i = 0; i < GRUB_USBHUB_MAX_DEVICES; i++) + for (i = 0; i < VasEBoot_USBHUB_MAX_DEVICES; i++) { - grub_usb_device_t dev = grub_usb_devs[i]; + VasEBoot_usb_device_t dev = VasEBoot_usb_devs[i]; if (dev && dev->descdev.class == 0x09) continue_waiting = continue_waiting || wait_power_nonroot_hub (dev); } if (!continue_waiting) break; - grub_millisleep (1); + VasEBoot_millisleep (1); } if (!(rescan || (npending && wait_for_completion))) break; - grub_millisleep (25); + VasEBoot_millisleep (25); } } int -grub_usb_iterate (grub_usb_iterate_hook_t hook, void *hook_data) +VasEBoot_usb_iterate (VasEBoot_usb_iterate_hook_t hook, void *hook_data) { int i; - for (i = 0; i < GRUB_USBHUB_MAX_DEVICES; i++) + for (i = 0; i < VasEBoot_USBHUB_MAX_DEVICES; i++) { - if (grub_usb_devs[i]) + if (VasEBoot_usb_devs[i]) { - if (hook (grub_usb_devs[i], hook_data)) + if (hook (VasEBoot_usb_devs[i], hook_data)) return 1; } } diff --git a/VasEBoot-core/bus/usb/usbtrans.c b/VasEBoot-core/bus/usb/usbtrans.c index 9266e4931..19439f7c6 100644 --- a/VasEBoot-core/bus/usb/usbtrans.c +++ b/VasEBoot-core/bus/usb/usbtrans.c @@ -1,35 +1,35 @@ /* usbtrans.c - USB Transfers and Transactions. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include static inline unsigned int -grub_usb_bulk_maxpacket (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint) +VasEBoot_usb_bulk_maxpacket (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint) { /* Use the maximum packet size given in the endpoint descriptor. */ if (dev->initialized && endpoint && (unsigned int) endpoint->maxpacket) @@ -39,93 +39,93 @@ grub_usb_bulk_maxpacket (grub_usb_device_t dev, } -static grub_usb_err_t -grub_usb_execute_and_wait_transfer (grub_usb_device_t dev, - grub_usb_transfer_t transfer, - int timeout, grub_size_t *actual) +static VasEBoot_usb_err_t +VasEBoot_usb_execute_and_wait_transfer (VasEBoot_usb_device_t dev, + VasEBoot_usb_transfer_t transfer, + int timeout, VasEBoot_size_t *actual) { - grub_usb_err_t err; - grub_uint64_t endtime; + VasEBoot_usb_err_t err; + VasEBoot_uint64_t endtime; err = dev->controller.dev->setup_transfer (&dev->controller, transfer); if (err) return err; /* endtime moved behind setup transfer to prevent false timeouts * while debugging... */ - endtime = grub_get_time_ms () + timeout; + endtime = VasEBoot_get_time_ms () + timeout; while (1) { err = dev->controller.dev->check_transfer (&dev->controller, transfer, actual); if (!err) - return GRUB_USB_ERR_NONE; - if (err != GRUB_USB_ERR_WAIT) + return VasEBoot_USB_ERR_NONE; + if (err != VasEBoot_USB_ERR_WAIT) return err; - if (grub_get_time_ms () > endtime) + if (VasEBoot_get_time_ms () > endtime) { err = dev->controller.dev->cancel_transfer (&dev->controller, transfer); if (err) return err; - return GRUB_USB_ERR_TIMEOUT; + return VasEBoot_USB_ERR_TIMEOUT; } - grub_cpu_idle (); + VasEBoot_cpu_idle (); } } -grub_usb_err_t -grub_usb_control_msg (grub_usb_device_t dev, - grub_uint8_t reqtype, - grub_uint8_t request, - grub_uint16_t value, - grub_uint16_t index, - grub_size_t size0, char *data_in) +VasEBoot_usb_err_t +VasEBoot_usb_control_msg (VasEBoot_usb_device_t dev, + VasEBoot_uint8_t reqtype, + VasEBoot_uint8_t request, + VasEBoot_uint16_t value, + VasEBoot_uint16_t index, + VasEBoot_size_t size0, char *data_in) { int i; - grub_usb_transfer_t transfer; + VasEBoot_usb_transfer_t transfer; int datablocks; - volatile struct grub_usb_packet_setup *setupdata; - grub_uint32_t setupdata_addr; - grub_usb_err_t err; + volatile struct VasEBoot_usb_packet_setup *setupdata; + VasEBoot_uint32_t setupdata_addr; + VasEBoot_usb_err_t err; unsigned int max; - struct grub_pci_dma_chunk *data_chunk, *setupdata_chunk; + struct VasEBoot_pci_dma_chunk *data_chunk, *setupdata_chunk; volatile char *data; - grub_uint32_t data_addr; - grub_size_t size = size0; - grub_size_t actual; + VasEBoot_uint32_t data_addr; + VasEBoot_size_t size = size0; + VasEBoot_size_t actual; /* FIXME: avoid allocation any kind of buffer in a first place. */ - data_chunk = grub_memalign_dma32 (128, size ? : 16); + data_chunk = VasEBoot_memalign_dma32 (128, size ? : 16); if (!data_chunk) - return GRUB_USB_ERR_INTERNAL; - data = grub_dma_get_virt (data_chunk); - data_addr = grub_dma_get_phys (data_chunk); - grub_memcpy ((char *) data, data_in, size); + return VasEBoot_USB_ERR_INTERNAL; + data = VasEBoot_dma_get_virt (data_chunk); + data_addr = VasEBoot_dma_get_phys (data_chunk); + VasEBoot_memcpy ((char *) data, data_in, size); - grub_arch_sync_dma_caches (data, size); + VasEBoot_arch_sync_dma_caches (data, size); - grub_dprintf ("usb", + VasEBoot_dprintf ("usb", "control: reqtype=0x%02x req=0x%02x val=0x%02x idx=0x%02x size=%lu\n", reqtype, request, value, index, (unsigned long)size); /* Create a transfer. */ - transfer = grub_malloc (sizeof (*transfer)); + transfer = VasEBoot_malloc (sizeof (*transfer)); if (! transfer) { - grub_dma_free (data_chunk); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_dma_free (data_chunk); + return VasEBoot_USB_ERR_INTERNAL; } - setupdata_chunk = grub_memalign_dma32 (32, sizeof (*setupdata)); + setupdata_chunk = VasEBoot_memalign_dma32 (32, sizeof (*setupdata)); if (! setupdata_chunk) { - grub_free (transfer); - grub_dma_free (data_chunk); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (transfer); + VasEBoot_dma_free (data_chunk); + return VasEBoot_USB_ERR_INTERNAL; } - setupdata = grub_dma_get_virt (setupdata_chunk); - setupdata_addr = grub_dma_get_phys (setupdata_chunk); + setupdata = VasEBoot_dma_get_virt (setupdata_chunk); + setupdata_addr = VasEBoot_dma_get_phys (setupdata_chunk); /* Determine the maximum packet size. */ if (dev->descdev.maxsize0) @@ -133,7 +133,7 @@ grub_usb_control_msg (grub_usb_device_t dev, else max = 64; - grub_dprintf ("usb", "control: transfer = %p, dev = %p\n", transfer, dev); + VasEBoot_dprintf ("usb", "control: transfer = %p, dev = %p\n", transfer, dev); datablocks = (size + max - 1) / max; @@ -143,19 +143,19 @@ grub_usb_control_msg (grub_usb_device_t dev, transfer->size = size; /* XXX ? */ transfer->endpoint = 0; transfer->devaddr = dev->addr; - transfer->type = GRUB_USB_TRANSACTION_TYPE_CONTROL; + transfer->type = VasEBoot_USB_TRANSACTION_TYPE_CONTROL; transfer->max = max; transfer->dev = dev; /* Allocate an array of transfer data structures. */ - transfer->transactions = grub_malloc (transfer->transcnt - * sizeof (struct grub_usb_transfer)); + transfer->transactions = VasEBoot_malloc (transfer->transcnt + * sizeof (struct VasEBoot_usb_transfer)); if (! transfer->transactions) { - grub_free (transfer); - grub_dma_free (setupdata_chunk); - grub_dma_free (data_chunk); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (transfer); + VasEBoot_dma_free (setupdata_chunk); + VasEBoot_dma_free (data_chunk); + return VasEBoot_USB_ERR_INTERNAL; } /* Build a Setup packet. XXX: Endianness. */ @@ -164,10 +164,10 @@ grub_usb_control_msg (grub_usb_device_t dev, setupdata->value = value; setupdata->index = index; setupdata->length = size; - grub_arch_sync_dma_caches (setupdata, sizeof (*setupdata)); + VasEBoot_arch_sync_dma_caches (setupdata, sizeof (*setupdata)); transfer->transactions[0].size = sizeof (*setupdata); - transfer->transactions[0].pid = GRUB_USB_TRANSFER_TYPE_SETUP; + transfer->transactions[0].pid = VasEBoot_USB_TRANSFER_TYPE_SETUP; transfer->transactions[0].data = setupdata_addr; transfer->transactions[0].toggle = 0; @@ -175,16 +175,16 @@ grub_usb_control_msg (grub_usb_device_t dev, transfers? */ for (i = 0; i < datablocks; i++) { - grub_usb_transaction_t tr = &transfer->transactions[i + 1]; + VasEBoot_usb_transaction_t tr = &transfer->transactions[i + 1]; tr->size = (size > max) ? max : size; /* Use the right most bit as the data toggle. Simple and effective. */ tr->toggle = !(i & 1); if (reqtype & 128) - tr->pid = GRUB_USB_TRANSFER_TYPE_IN; + tr->pid = VasEBoot_USB_TRANSFER_TYPE_IN; else - tr->pid = GRUB_USB_TRANSFER_TYPE_OUT; + tr->pid = VasEBoot_USB_TRANSFER_TYPE_OUT; tr->data = data_addr + i * max; tr->preceding = i * max; size -= max; @@ -194,76 +194,76 @@ grub_usb_control_msg (grub_usb_device_t dev, transfer->transactions[datablocks + 1].size = 0; transfer->transactions[datablocks + 1].data = 0; if ((reqtype & 128) && datablocks) - transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_OUT; + transfer->transactions[datablocks + 1].pid = VasEBoot_USB_TRANSFER_TYPE_OUT; else - transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_IN; + transfer->transactions[datablocks + 1].pid = VasEBoot_USB_TRANSFER_TYPE_IN; transfer->transactions[datablocks + 1].toggle = 1; - err = grub_usb_execute_and_wait_transfer (dev, transfer, 1000, &actual); + err = VasEBoot_usb_execute_and_wait_transfer (dev, transfer, 1000, &actual); - grub_dprintf ("usb", "control: err=%d\n", err); + VasEBoot_dprintf ("usb", "control: err=%d\n", err); - grub_free (transfer->transactions); + VasEBoot_free (transfer->transactions); - grub_free (transfer); - grub_dma_free (setupdata_chunk); + VasEBoot_free (transfer); + VasEBoot_dma_free (setupdata_chunk); - grub_arch_sync_dma_caches (data, size0); - grub_memcpy (data_in, (char *) data, size0); + VasEBoot_arch_sync_dma_caches (data, size0); + VasEBoot_memcpy (data_in, (char *) data, size0); - grub_dma_free (data_chunk); + VasEBoot_dma_free (data_chunk); return err; } -static grub_usb_transfer_t -grub_usb_bulk_setup_readwrite (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size0, char *data_in, - grub_transfer_type_t type) +static VasEBoot_usb_transfer_t +VasEBoot_usb_bulk_setup_readwrite (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size0, char *data_in, + VasEBoot_transfer_type_t type) { int i; - grub_usb_transfer_t transfer; + VasEBoot_usb_transfer_t transfer; int datablocks; unsigned int max; volatile char *data; - grub_uint32_t data_addr; - struct grub_pci_dma_chunk *data_chunk; - grub_size_t size = size0; + VasEBoot_uint32_t data_addr; + struct VasEBoot_pci_dma_chunk *data_chunk; + VasEBoot_size_t size = size0; int toggle = dev->toggle[endpoint->endp_addr]; - grub_dprintf ("usb", "bulk: size=0x%02lx type=%d\n", (unsigned long) size, + VasEBoot_dprintf ("usb", "bulk: size=0x%02lx type=%d\n", (unsigned long) size, type); /* FIXME: avoid allocation any kind of buffer in a first place. */ - data_chunk = grub_memalign_dma32 (128, size); + data_chunk = VasEBoot_memalign_dma32 (128, size); if (!data_chunk) return NULL; - data = grub_dma_get_virt (data_chunk); - data_addr = grub_dma_get_phys (data_chunk); - if (type == GRUB_USB_TRANSFER_TYPE_OUT) + data = VasEBoot_dma_get_virt (data_chunk); + data_addr = VasEBoot_dma_get_phys (data_chunk); + if (type == VasEBoot_USB_TRANSFER_TYPE_OUT) { - grub_memcpy ((char *) data, data_in, size); - grub_arch_sync_dma_caches (data, size); + VasEBoot_memcpy ((char *) data, data_in, size); + VasEBoot_arch_sync_dma_caches (data, size); } /* Create a transfer. */ - transfer = grub_malloc (sizeof (struct grub_usb_transfer)); + transfer = VasEBoot_malloc (sizeof (struct VasEBoot_usb_transfer)); if (! transfer) { - grub_dma_free (data_chunk); + VasEBoot_dma_free (data_chunk); return NULL; } - max = grub_usb_bulk_maxpacket (dev, endpoint); + max = VasEBoot_usb_bulk_maxpacket (dev, endpoint); datablocks = ((size + max - 1) / max); transfer->transcnt = datablocks; transfer->size = size - 1; transfer->endpoint = endpoint->endp_addr; transfer->devaddr = dev->addr; - transfer->type = GRUB_USB_TRANSACTION_TYPE_BULK; + transfer->type = VasEBoot_USB_TRANSACTION_TYPE_BULK; transfer->dir = type; transfer->max = max; transfer->dev = dev; @@ -272,19 +272,19 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev, transfer->data = data_in; /* Allocate an array of transfer data structures. */ - transfer->transactions = grub_malloc (transfer->transcnt - * sizeof (struct grub_usb_transfer)); + transfer->transactions = VasEBoot_malloc (transfer->transcnt + * sizeof (struct VasEBoot_usb_transfer)); if (! transfer->transactions) { - grub_free (transfer); - grub_dma_free (data_chunk); + VasEBoot_free (transfer); + VasEBoot_dma_free (data_chunk); return NULL; } /* Set up all transfers. */ for (i = 0; i < datablocks; i++) { - grub_usb_transaction_t tr = &transfer->transactions[i]; + VasEBoot_usb_transaction_t tr = &transfer->transactions[i]; tr->size = (size > max) ? max : size; /* XXX: Use the right most bit as the data toggle. Simple and @@ -300,9 +300,9 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev, } static void -grub_usb_bulk_finish_readwrite (grub_usb_transfer_t transfer) +VasEBoot_usb_bulk_finish_readwrite (VasEBoot_usb_transfer_t transfer) { - grub_usb_device_t dev = transfer->dev; + VasEBoot_usb_device_t dev = transfer->dev; int toggle = dev->toggle[transfer->endpoint]; /* We must remember proper toggle value even if some transactions @@ -312,59 +312,59 @@ grub_usb_bulk_finish_readwrite (grub_usb_transfer_t transfer) toggle = transfer->transactions[transfer->last_trans].toggle ? 0 : 1; else toggle = dev->toggle[transfer->endpoint]; /* Nothing done, take original */ - grub_dprintf ("usb", "bulk: toggle=%d\n", toggle); + VasEBoot_dprintf ("usb", "bulk: toggle=%d\n", toggle); dev->toggle[transfer->endpoint] = toggle; - if (transfer->dir == GRUB_USB_TRANSFER_TYPE_IN) + if (transfer->dir == VasEBoot_USB_TRANSFER_TYPE_IN) { - grub_arch_sync_dma_caches (grub_dma_get_virt (transfer->data_chunk), + VasEBoot_arch_sync_dma_caches (VasEBoot_dma_get_virt (transfer->data_chunk), transfer->size + 1); - grub_memcpy (transfer->data, (void *) - grub_dma_get_virt (transfer->data_chunk), + VasEBoot_memcpy (transfer->data, (void *) + VasEBoot_dma_get_virt (transfer->data_chunk), transfer->size + 1); } - grub_free (transfer->transactions); - grub_dma_free (transfer->data_chunk); - grub_free (transfer); + VasEBoot_free (transfer->transactions); + VasEBoot_dma_free (transfer->data_chunk); + VasEBoot_free (transfer); } -static grub_usb_err_t -grub_usb_bulk_readwrite (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size0, char *data_in, - grub_transfer_type_t type, int timeout, - grub_size_t *actual) +static VasEBoot_usb_err_t +VasEBoot_usb_bulk_readwrite (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size0, char *data_in, + VasEBoot_transfer_type_t type, int timeout, + VasEBoot_size_t *actual) { - grub_usb_err_t err; - grub_usb_transfer_t transfer; + VasEBoot_usb_err_t err; + VasEBoot_usb_transfer_t transfer; - transfer = grub_usb_bulk_setup_readwrite (dev, endpoint, size0, + transfer = VasEBoot_usb_bulk_setup_readwrite (dev, endpoint, size0, data_in, type); if (!transfer) - return GRUB_USB_ERR_INTERNAL; - err = grub_usb_execute_and_wait_transfer (dev, transfer, timeout, actual); + return VasEBoot_USB_ERR_INTERNAL; + err = VasEBoot_usb_execute_and_wait_transfer (dev, transfer, timeout, actual); - grub_usb_bulk_finish_readwrite (transfer); + VasEBoot_usb_bulk_finish_readwrite (transfer); return err; } -static grub_usb_err_t -grub_usb_bulk_readwrite_packetize (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_transfer_type_t type, - grub_size_t size, char *data) +static VasEBoot_usb_err_t +VasEBoot_usb_bulk_readwrite_packetize (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_transfer_type_t type, + VasEBoot_size_t size, char *data) { - grub_size_t actual, transferred; - grub_usb_err_t err = GRUB_USB_ERR_NONE; - grub_size_t current_size, position; - grub_size_t max_bulk_transfer_len = MAX_USB_TRANSFER_LEN; - grub_size_t max; + VasEBoot_size_t actual, transferred; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NONE; + VasEBoot_size_t current_size, position; + VasEBoot_size_t max_bulk_transfer_len = MAX_USB_TRANSFER_LEN; + VasEBoot_size_t max; if (dev->controller.dev->max_bulk_tds) { - max = grub_usb_bulk_maxpacket (dev, endpoint); + max = VasEBoot_usb_bulk_maxpacket (dev, endpoint); /* Calculate max. possible length of bulk transfer */ max_bulk_transfer_len = dev->controller.dev->max_bulk_tds * max; @@ -376,63 +376,63 @@ grub_usb_bulk_readwrite_packetize (grub_usb_device_t dev, current_size = size - position; if (current_size >= max_bulk_transfer_len) current_size = max_bulk_transfer_len; - err = grub_usb_bulk_readwrite (dev, endpoint, current_size, + err = VasEBoot_usb_bulk_readwrite (dev, endpoint, current_size, &data[position], type, 1000, &actual); transferred += actual; if (err || (current_size != actual)) break; } if (!err && transferred != size) - err = GRUB_USB_ERR_DATA; + err = VasEBoot_USB_ERR_DATA; return err; } -grub_usb_err_t -grub_usb_bulk_write (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, char *data) +VasEBoot_usb_err_t +VasEBoot_usb_bulk_write (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, char *data) { - return grub_usb_bulk_readwrite_packetize (dev, endpoint, - GRUB_USB_TRANSFER_TYPE_OUT, + return VasEBoot_usb_bulk_readwrite_packetize (dev, endpoint, + VasEBoot_USB_TRANSFER_TYPE_OUT, size, data); } -grub_usb_err_t -grub_usb_bulk_read (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, char *data) +VasEBoot_usb_err_t +VasEBoot_usb_bulk_read (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, char *data) { - return grub_usb_bulk_readwrite_packetize (dev, endpoint, - GRUB_USB_TRANSFER_TYPE_IN, + return VasEBoot_usb_bulk_readwrite_packetize (dev, endpoint, + VasEBoot_USB_TRANSFER_TYPE_IN, size, data); } -grub_usb_err_t -grub_usb_check_transfer (grub_usb_transfer_t transfer, grub_size_t *actual) +VasEBoot_usb_err_t +VasEBoot_usb_check_transfer (VasEBoot_usb_transfer_t transfer, VasEBoot_size_t *actual) { - grub_usb_err_t err; - grub_usb_device_t dev = transfer->dev; + VasEBoot_usb_err_t err; + VasEBoot_usb_device_t dev = transfer->dev; err = dev->controller.dev->check_transfer (&dev->controller, transfer, actual); - if (err == GRUB_USB_ERR_WAIT) + if (err == VasEBoot_USB_ERR_WAIT) return err; - grub_usb_bulk_finish_readwrite (transfer); + VasEBoot_usb_bulk_finish_readwrite (transfer); return err; } -grub_usb_transfer_t -grub_usb_bulk_read_background (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, void *data) +VasEBoot_usb_transfer_t +VasEBoot_usb_bulk_read_background (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, void *data) { - grub_usb_err_t err; - grub_usb_transfer_t transfer; + VasEBoot_usb_err_t err; + VasEBoot_usb_transfer_t transfer; - transfer = grub_usb_bulk_setup_readwrite (dev, endpoint, size, - data, GRUB_USB_TRANSFER_TYPE_IN); + transfer = VasEBoot_usb_bulk_setup_readwrite (dev, endpoint, size, + data, VasEBoot_USB_TRANSFER_TYPE_IN); if (!transfer) return NULL; @@ -444,19 +444,19 @@ grub_usb_bulk_read_background (grub_usb_device_t dev, } void -grub_usb_cancel_transfer (grub_usb_transfer_t transfer) +VasEBoot_usb_cancel_transfer (VasEBoot_usb_transfer_t transfer) { - grub_usb_device_t dev = transfer->dev; + VasEBoot_usb_device_t dev = transfer->dev; dev->controller.dev->cancel_transfer (&dev->controller, transfer); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } -grub_usb_err_t -grub_usb_bulk_read_extended (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, char *data, - int timeout, grub_size_t *actual) +VasEBoot_usb_err_t +VasEBoot_usb_bulk_read_extended (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, char *data, + int timeout, VasEBoot_size_t *actual) { - return grub_usb_bulk_readwrite (dev, endpoint, size, data, - GRUB_USB_TRANSFER_TYPE_IN, timeout, actual); + return VasEBoot_usb_bulk_readwrite (dev, endpoint, size, data, + VasEBoot_USB_TRANSFER_TYPE_IN, timeout, actual); } diff --git a/VasEBoot-core/commands/acpi.c b/VasEBoot-core/commands/acpi.c index 9f02f2201..7f3f06a86 100644 --- a/VasEBoot-core/commands/acpi.c +++ b/VasEBoot-core/commands/acpi.c @@ -1,43 +1,43 @@ /* acpi.c - modify acpi tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_MACHINE_EFI -#include -#include +#ifdef VasEBoot_MACHINE_EFI +#include +#include #endif #pragma GCC diagnostic ignored "-Wcast-align" -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"exclude", 'x', 0, N_("Don't load host tables specified by comma-separated list."), 0, ARG_TYPE_STRING}, @@ -56,7 +56,7 @@ static const struct grub_arg_option options[] = { N_("Set creator revision of RSDP, XSDT and RSDT."), 0, ARG_TYPE_INT}, /* TRANSLATORS: "hangs" here is a noun, not a verb. */ {"no-ebda", 'e', 0, N_("Don't update EBDA. May fix failures or hangs on some " - "BIOSes but makes it ineffective with OS not receiving RSDP from GRUB."), + "BIOSes but makes it ineffective with OS not receiving RSDP from VasEBoot."), 0, ARG_TYPE_NONE}, {0, 0, 0, 0, 0, 0} }; @@ -69,13 +69,13 @@ static char root_oemid[6]; /* OEMTABLE of the same tables. */ static char root_oemtable[8]; /* OEMREVISION of the same tables. */ -static grub_uint32_t root_oemrev; +static VasEBoot_uint32_t root_oemrev; /* CreatorID of the same tables. */ static char root_creator_id[4]; /* CreatorRevision of the same tables. */ -static grub_uint32_t root_creator_rev; -static struct grub_acpi_rsdp_v10 *rsdpv1_new = 0; -static struct grub_acpi_rsdp_v20 *rsdpv2_new = 0; +static VasEBoot_uint32_t root_creator_rev; +static struct VasEBoot_acpi_rsdp_v10 *rsdpv1_new = 0; +static struct VasEBoot_acpi_rsdp_v20 *rsdpv2_new = 0; static char *playground = 0, *playground_ptr = 0; static int playground_size = 0; @@ -83,7 +83,7 @@ static int playground_size = 0; struct efiemu_acpi_table { void *addr; - grub_size_t size; + VasEBoot_size_t size; struct efiemu_acpi_table *next; }; static struct efiemu_acpi_table *acpi_tables = 0; @@ -94,35 +94,35 @@ static void *table_dsdt = 0; static void *rsdt_addr = 0; /* Allocation handles for different tables. */ -static grub_size_t dsdt_size = 0; +static VasEBoot_size_t dsdt_size = 0; /* Address of original FACS. */ -static grub_uint32_t facs_addr = 0; +static VasEBoot_uint32_t facs_addr = 0; -struct grub_acpi_rsdp_v20 * -grub_acpi_get_rsdpv2 (void) +struct VasEBoot_acpi_rsdp_v20 * +VasEBoot_acpi_get_rsdpv2 (void) { if (rsdpv2_new) return rsdpv2_new; if (rsdpv1_new) return 0; - return grub_machine_acpi_get_rsdpv2 (); + return VasEBoot_machine_acpi_get_rsdpv2 (); } -struct grub_acpi_rsdp_v10 * -grub_acpi_get_rsdpv1 (void) +struct VasEBoot_acpi_rsdp_v10 * +VasEBoot_acpi_get_rsdpv1 (void) { if (rsdpv1_new) return rsdpv1_new; if (rsdpv2_new) return 0; - return grub_machine_acpi_get_rsdpv1 (); + return VasEBoot_machine_acpi_get_rsdpv1 (); } #if defined (__i386__) || defined (__x86_64__) static inline int -iszero (grub_uint8_t *reg, int size) +iszero (VasEBoot_uint8_t *reg, int size) { int i; for (i = 0; i < size; i++) @@ -131,20 +131,20 @@ iszero (grub_uint8_t *reg, int size) return 1; } -/* Context for grub_acpi_create_ebda. */ -struct grub_acpi_create_ebda_ctx { +/* Context for VasEBoot_acpi_create_ebda. */ +struct VasEBoot_acpi_create_ebda_ctx { int ebda_len; - grub_uint64_t highestlow; + VasEBoot_uint64_t highestlow; }; -/* Helper for grub_acpi_create_ebda. */ +/* Helper for VasEBoot_acpi_create_ebda. */ static int -find_hook (grub_uint64_t start, grub_uint64_t size, grub_memory_type_t type, +find_hook (VasEBoot_uint64_t start, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - struct grub_acpi_create_ebda_ctx *ctx = data; - grub_uint64_t end = start + size; - if (type != GRUB_MEMORY_AVAILABLE) + struct VasEBoot_acpi_create_ebda_ctx *ctx = data; + VasEBoot_uint64_t end = start + size; + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; if (end > 0x100000) end = 0x100000; @@ -154,71 +154,71 @@ find_hook (grub_uint64_t start, grub_uint64_t size, grub_memory_type_t type, return 0; } -grub_err_t -grub_acpi_create_ebda (void) +VasEBoot_err_t +VasEBoot_acpi_create_ebda (void) { - struct grub_acpi_create_ebda_ctx ctx = { + struct VasEBoot_acpi_create_ebda_ctx ctx = { .highestlow = 0 }; int ebda_kb_len = 0; int mmapregion = 0; - grub_uint8_t *ebda, *v1inebda = 0, *v2inebda = 0; - grub_uint8_t *targetebda, *target; - struct grub_acpi_rsdp_v10 *v1; - struct grub_acpi_rsdp_v20 *v2; + VasEBoot_uint8_t *ebda, *v1inebda = 0, *v2inebda = 0; + VasEBoot_uint8_t *targetebda, *target; + struct VasEBoot_acpi_rsdp_v10 *v1; + struct VasEBoot_acpi_rsdp_v20 *v2; - ebda = (grub_uint8_t *) (grub_addr_t) ((*((grub_uint16_t *)0x40e)) << 4); - grub_dprintf ("acpi", "EBDA @%p\n", ebda); + ebda = (VasEBoot_uint8_t *) (VasEBoot_addr_t) ((*((VasEBoot_uint16_t *)0x40e)) << 4); + VasEBoot_dprintf ("acpi", "EBDA @%p\n", ebda); if (ebda) - ebda_kb_len = *(grub_uint16_t *) ebda; - grub_dprintf ("acpi", "EBDA length 0x%x\n", ebda_kb_len); + ebda_kb_len = *(VasEBoot_uint16_t *) ebda; + VasEBoot_dprintf ("acpi", "EBDA length 0x%x\n", ebda_kb_len); if (ebda_kb_len > 16) ebda_kb_len = 0; ctx.ebda_len = (ebda_kb_len + 1) << 10; /* FIXME: use low-memory mm allocation once it's available. */ - grub_mmap_iterate (find_hook, &ctx); - targetebda = (grub_uint8_t *) (grub_addr_t) ctx.highestlow; - grub_dprintf ("acpi", "creating ebda @%llx\n", + VasEBoot_mmap_iterate (find_hook, &ctx); + targetebda = (VasEBoot_uint8_t *) (VasEBoot_addr_t) ctx.highestlow; + VasEBoot_dprintf ("acpi", "creating ebda @%llx\n", (unsigned long long) ctx.highestlow); if (! ctx.highestlow) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't find space for the new EBDA"); - mmapregion = grub_mmap_register ((grub_addr_t) targetebda, ctx.ebda_len, - GRUB_MEMORY_RESERVED); + mmapregion = VasEBoot_mmap_register ((VasEBoot_addr_t) targetebda, ctx.ebda_len, + VasEBoot_MEMORY_RESERVED); if (! mmapregion) - return grub_errno; + return VasEBoot_errno; /* XXX: EBDA is unstandardized, so this implementation is heuristical. */ if (ebda_kb_len) - grub_memcpy (targetebda, ebda, 0x400); + VasEBoot_memcpy (targetebda, ebda, 0x400); else - grub_memset (targetebda, 0, 0x400); - *((grub_uint16_t *) targetebda) = ebda_kb_len + 1; + VasEBoot_memset (targetebda, 0, 0x400); + *((VasEBoot_uint16_t *) targetebda) = ebda_kb_len + 1; target = targetebda; - v1 = grub_acpi_get_rsdpv1 (); - v2 = grub_acpi_get_rsdpv2 (); + v1 = VasEBoot_acpi_get_rsdpv1 (); + v2 = VasEBoot_acpi_get_rsdpv2 (); if (v2 && v2->length > 40) v2 = 0; /* First try to replace already existing rsdp. */ if (v2) { - grub_dprintf ("acpi", "Scanning EBDA for old rsdpv2\n"); + VasEBoot_dprintf ("acpi", "Scanning EBDA for old rsdpv2\n"); for (; target < targetebda + 0x400 - v2->length; target += 0x10) - if (grub_memcmp (target, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (target, - sizeof (struct grub_acpi_rsdp_v10)) == 0 - && ((struct grub_acpi_rsdp_v10 *) target)->revision != 0 - && ((struct grub_acpi_rsdp_v20 *) target)->length <= v2->length) + if (VasEBoot_memcmp (target, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (target, + sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0 + && ((struct VasEBoot_acpi_rsdp_v10 *) target)->revision != 0 + && ((struct VasEBoot_acpi_rsdp_v20 *) target)->length <= v2->length) { - grub_memcpy (target, v2, v2->length); - grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); + VasEBoot_memcpy (target, v2, v2->length); + VasEBoot_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); v2inebda = target; target += v2->length; - target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + target = (VasEBoot_uint8_t *) ALIGN_UP((VasEBoot_addr_t) target, 16); v2 = 0; break; } @@ -226,18 +226,18 @@ grub_acpi_create_ebda (void) if (v1) { - grub_dprintf ("acpi", "Scanning EBDA for old rsdpv1\n"); - for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + VasEBoot_dprintf ("acpi", "Scanning EBDA for old rsdpv1\n"); + for (; target < targetebda + 0x400 - sizeof (struct VasEBoot_acpi_rsdp_v10); target += 0x10) - if (grub_memcmp (target, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (target, - sizeof (struct grub_acpi_rsdp_v10)) == 0) + if (VasEBoot_memcmp (target, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (target, + sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0) { - grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); - grub_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); + VasEBoot_memcpy (target, v1, sizeof (struct VasEBoot_acpi_rsdp_v10)); + VasEBoot_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); v1inebda = target; - target += sizeof (struct grub_acpi_rsdp_v10); - target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + target += sizeof (struct VasEBoot_acpi_rsdp_v10); + target = (VasEBoot_uint8_t *) ALIGN_UP((VasEBoot_addr_t) target, 16); v1 = 0; break; } @@ -248,15 +248,15 @@ grub_acpi_create_ebda (void) /* Try contiguous zeros. */ if (v2) { - grub_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); + VasEBoot_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); for (; target < targetebda + 0x400 - v2->length; target += 0x10) if (iszero (target, v2->length)) { - grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); - grub_memcpy (target, v2, v2->length); + VasEBoot_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); + VasEBoot_memcpy (target, v2, v2->length); v2inebda = target; target += v2->length; - target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + target = (VasEBoot_uint8_t *) ALIGN_UP((VasEBoot_addr_t) target, 16); v2 = 0; break; } @@ -264,16 +264,16 @@ grub_acpi_create_ebda (void) if (v1) { - grub_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); - for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + VasEBoot_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); + for (; target < targetebda + 0x400 - sizeof (struct VasEBoot_acpi_rsdp_v10); target += 0x10) - if (iszero (target, sizeof (struct grub_acpi_rsdp_v10))) + if (iszero (target, sizeof (struct VasEBoot_acpi_rsdp_v10))) { - grub_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); - grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); + VasEBoot_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); + VasEBoot_memcpy (target, v1, sizeof (struct VasEBoot_acpi_rsdp_v10)); v1inebda = target; - target += sizeof (struct grub_acpi_rsdp_v10); - target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16); + target += sizeof (struct VasEBoot_acpi_rsdp_v10); + target = (VasEBoot_uint8_t *) ALIGN_UP((VasEBoot_addr_t) target, 16); v1 = 0; break; } @@ -281,26 +281,26 @@ grub_acpi_create_ebda (void) if (v1 || v2) { - grub_mmap_unregister (mmapregion); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_mmap_unregister (mmapregion); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't find suitable spot in EBDA"); } /* Remove any other RSDT. */ for (target = targetebda; - target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + target < targetebda + 0x400 - sizeof (struct VasEBoot_acpi_rsdp_v10); target += 0x10) - if (grub_memcmp (target, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (target, - sizeof (struct grub_acpi_rsdp_v10)) == 0 + if (VasEBoot_memcmp (target, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (target, + sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0 && target != v1inebda && target != v2inebda) *target = 0; - grub_dprintf ("acpi", "Switching EBDA\n"); - (*((grub_uint16_t *) 0x40e)) = ((grub_addr_t) targetebda) >> 4; - grub_dprintf ("acpi", "EBDA switched\n"); + VasEBoot_dprintf ("acpi", "Switching EBDA\n"); + (*((VasEBoot_uint16_t *) 0x40e)) = ((VasEBoot_addr_t) targetebda) >> 4; + VasEBoot_dprintf ("acpi", "EBDA switched\n"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif @@ -309,44 +309,44 @@ static void setup_common_tables (void) { struct efiemu_acpi_table *cur; - struct grub_acpi_table_header *rsdt; - grub_uint32_t *rsdt_entry; + struct VasEBoot_acpi_table_header *rsdt; + VasEBoot_uint32_t *rsdt_entry; int numoftables; /* Treat DSDT. */ - grub_memcpy (playground_ptr, table_dsdt, dsdt_size); - grub_free (table_dsdt); + VasEBoot_memcpy (playground_ptr, table_dsdt, dsdt_size); + VasEBoot_free (table_dsdt); table_dsdt = playground_ptr; playground_ptr += dsdt_size; /* Treat other tables. */ for (cur = acpi_tables; cur; cur = cur->next) { - struct grub_acpi_fadt *fadt; + struct VasEBoot_acpi_fadt *fadt; - grub_memcpy (playground_ptr, cur->addr, cur->size); - grub_free (cur->addr); + VasEBoot_memcpy (playground_ptr, cur->addr, cur->size); + VasEBoot_free (cur->addr); cur->addr = playground_ptr; playground_ptr += cur->size; /* If it's FADT correct DSDT and FACS addresses. */ - fadt = (struct grub_acpi_fadt *) cur->addr; - if (grub_memcmp (fadt->hdr.signature, GRUB_ACPI_FADT_SIGNATURE, + fadt = (struct VasEBoot_acpi_fadt *) cur->addr; + if (VasEBoot_memcmp (fadt->hdr.signature, VasEBoot_ACPI_FADT_SIGNATURE, sizeof (fadt->hdr.signature)) == 0) { - fadt->dsdt_addr = (grub_addr_t) table_dsdt; + fadt->dsdt_addr = (VasEBoot_addr_t) table_dsdt; fadt->facs_addr = facs_addr; /* Does a revision 2 exist at all? */ if (fadt->hdr.revision >= 3) { - fadt->dsdt_xaddr = (grub_addr_t) table_dsdt; + fadt->dsdt_xaddr = (VasEBoot_addr_t) table_dsdt; fadt->facs_xaddr = facs_addr; } /* Recompute checksum. */ fadt->hdr.checksum = 0; - fadt->hdr.checksum = 1 + ~grub_byte_checksum (fadt, fadt->hdr.length); + fadt->hdr.checksum = 1 + ~VasEBoot_byte_checksum (fadt, fadt->hdr.length); } } @@ -355,27 +355,27 @@ setup_common_tables (void) for (cur = acpi_tables; cur; cur = cur->next) numoftables++; - rsdt_addr = rsdt = (struct grub_acpi_table_header *) playground_ptr; - playground_ptr += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint32_t) * numoftables; + rsdt_addr = rsdt = (struct VasEBoot_acpi_table_header *) playground_ptr; + playground_ptr += sizeof (struct VasEBoot_acpi_table_header) + sizeof (VasEBoot_uint32_t) * numoftables; - rsdt_entry = (grub_uint32_t *) (rsdt + 1); + rsdt_entry = (VasEBoot_uint32_t *) (rsdt + 1); /* Fill RSDT header. */ - grub_memcpy (&(rsdt->signature), "RSDT", 4); - rsdt->length = sizeof (struct grub_acpi_table_header) + sizeof (grub_uint32_t) * numoftables; + VasEBoot_memcpy (&(rsdt->signature), "RSDT", 4); + rsdt->length = sizeof (struct VasEBoot_acpi_table_header) + sizeof (VasEBoot_uint32_t) * numoftables; rsdt->revision = 1; - grub_memcpy (&(rsdt->oemid), root_oemid, sizeof (rsdt->oemid)); - grub_memcpy (&(rsdt->oemtable), root_oemtable, sizeof (rsdt->oemtable)); + VasEBoot_memcpy (&(rsdt->oemid), root_oemid, sizeof (rsdt->oemid)); + VasEBoot_memcpy (&(rsdt->oemtable), root_oemtable, sizeof (rsdt->oemtable)); rsdt->oemrev = root_oemrev; - grub_memcpy (&(rsdt->creator_id), root_creator_id, sizeof (rsdt->creator_id)); + VasEBoot_memcpy (&(rsdt->creator_id), root_creator_id, sizeof (rsdt->creator_id)); rsdt->creator_rev = root_creator_rev; for (cur = acpi_tables; cur; cur = cur->next) - *(rsdt_entry++) = (grub_addr_t) cur->addr; + *(rsdt_entry++) = (VasEBoot_addr_t) cur->addr; /* Recompute checksum. */ rsdt->checksum = 0; - rsdt->checksum = 1 + ~grub_byte_checksum (rsdt, rsdt->length); + rsdt->checksum = 1 + ~VasEBoot_byte_checksum (rsdt, rsdt->length); } /* Regenerate ACPIv1 RSDP */ @@ -383,25 +383,25 @@ static void setv1table (void) { /* Create RSDP. */ - rsdpv1_new = (struct grub_acpi_rsdp_v10 *) playground_ptr; - playground_ptr += sizeof (struct grub_acpi_rsdp_v10); - grub_memcpy (&(rsdpv1_new->signature), GRUB_RSDP_SIGNATURE, + rsdpv1_new = (struct VasEBoot_acpi_rsdp_v10 *) playground_ptr; + playground_ptr += sizeof (struct VasEBoot_acpi_rsdp_v10); + VasEBoot_memcpy (&(rsdpv1_new->signature), VasEBoot_RSDP_SIGNATURE, sizeof (rsdpv1_new->signature)); - grub_memcpy (&(rsdpv1_new->oemid), root_oemid, sizeof (rsdpv1_new->oemid)); + VasEBoot_memcpy (&(rsdpv1_new->oemid), root_oemid, sizeof (rsdpv1_new->oemid)); rsdpv1_new->revision = 0; - rsdpv1_new->rsdt_addr = (grub_addr_t) rsdt_addr; + rsdpv1_new->rsdt_addr = (VasEBoot_addr_t) rsdt_addr; rsdpv1_new->checksum = 0; - rsdpv1_new->checksum = 1 + ~grub_byte_checksum (rsdpv1_new, + rsdpv1_new->checksum = 1 + ~VasEBoot_byte_checksum (rsdpv1_new, sizeof (*rsdpv1_new)); - grub_dprintf ("acpi", "Generated ACPIv1 tables\n"); + VasEBoot_dprintf ("acpi", "Generated ACPIv1 tables\n"); } static void setv2table (void) { - struct grub_acpi_table_header *xsdt; + struct VasEBoot_acpi_table_header *xsdt; struct efiemu_acpi_table *cur; - grub_uint64_t *xsdt_entry; + VasEBoot_uint64_t *xsdt_entry; int numoftables; numoftables = 0; @@ -409,41 +409,41 @@ setv2table (void) numoftables++; /* Create XSDT. */ - xsdt = (struct grub_acpi_table_header *) playground_ptr; - playground_ptr += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint64_t) * numoftables; + xsdt = (struct VasEBoot_acpi_table_header *) playground_ptr; + playground_ptr += sizeof (struct VasEBoot_acpi_table_header) + sizeof (VasEBoot_uint64_t) * numoftables; - xsdt_entry = (grub_uint64_t *)(xsdt + 1); + xsdt_entry = (VasEBoot_uint64_t *)(xsdt + 1); for (cur = acpi_tables; cur; cur = cur->next) - *(xsdt_entry++) = (grub_addr_t) cur->addr; - grub_memcpy (&(xsdt->signature), "XSDT", 4); - xsdt->length = sizeof (struct grub_acpi_table_header) + sizeof (grub_uint64_t) * numoftables; + *(xsdt_entry++) = (VasEBoot_addr_t) cur->addr; + VasEBoot_memcpy (&(xsdt->signature), "XSDT", 4); + xsdt->length = sizeof (struct VasEBoot_acpi_table_header) + sizeof (VasEBoot_uint64_t) * numoftables; xsdt->revision = 1; - grub_memcpy (&(xsdt->oemid), root_oemid, sizeof (xsdt->oemid)); - grub_memcpy (&(xsdt->oemtable), root_oemtable, sizeof (xsdt->oemtable)); + VasEBoot_memcpy (&(xsdt->oemid), root_oemid, sizeof (xsdt->oemid)); + VasEBoot_memcpy (&(xsdt->oemtable), root_oemtable, sizeof (xsdt->oemtable)); xsdt->oemrev = root_oemrev; - grub_memcpy (&(xsdt->creator_id), root_creator_id, sizeof (xsdt->creator_id)); + VasEBoot_memcpy (&(xsdt->creator_id), root_creator_id, sizeof (xsdt->creator_id)); xsdt->creator_rev = root_creator_rev; xsdt->checksum = 0; - xsdt->checksum = 1 + ~grub_byte_checksum (xsdt, xsdt->length); + xsdt->checksum = 1 + ~VasEBoot_byte_checksum (xsdt, xsdt->length); /* Create RSDPv2. */ - rsdpv2_new = (struct grub_acpi_rsdp_v20 *) playground_ptr; - playground_ptr += sizeof (struct grub_acpi_rsdp_v20); - grub_memcpy (&(rsdpv2_new->rsdpv1.signature), GRUB_RSDP_SIGNATURE, + rsdpv2_new = (struct VasEBoot_acpi_rsdp_v20 *) playground_ptr; + playground_ptr += sizeof (struct VasEBoot_acpi_rsdp_v20); + VasEBoot_memcpy (&(rsdpv2_new->rsdpv1.signature), VasEBoot_RSDP_SIGNATURE, sizeof (rsdpv2_new->rsdpv1.signature)); - grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid, + VasEBoot_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid, sizeof (rsdpv2_new->rsdpv1.oemid)); rsdpv2_new->rsdpv1.revision = rev2; - rsdpv2_new->rsdpv1.rsdt_addr = (grub_addr_t) rsdt_addr; + rsdpv2_new->rsdpv1.rsdt_addr = (VasEBoot_addr_t) rsdt_addr; rsdpv2_new->rsdpv1.checksum = 0; - rsdpv2_new->rsdpv1.checksum = 1 + ~grub_byte_checksum + rsdpv2_new->rsdpv1.checksum = 1 + ~VasEBoot_byte_checksum (&(rsdpv2_new->rsdpv1), sizeof (rsdpv2_new->rsdpv1)); rsdpv2_new->length = sizeof (*rsdpv2_new); - rsdpv2_new->xsdt_addr = (grub_addr_t) xsdt; + rsdpv2_new->xsdt_addr = (VasEBoot_addr_t) xsdt; rsdpv2_new->checksum = 0; - rsdpv2_new->checksum = 1 + ~grub_byte_checksum (rsdpv2_new, + rsdpv2_new->checksum = 1 + ~VasEBoot_byte_checksum (rsdpv2_new, rsdpv2_new->length); - grub_dprintf ("acpi", "Generated ACPIv2 tables\n"); + VasEBoot_dprintf ("acpi", "Generated ACPIv2 tables\n"); } static void @@ -451,23 +451,23 @@ free_tables (void) { struct efiemu_acpi_table *cur, *t; if (table_dsdt) - grub_free (table_dsdt); + VasEBoot_free (table_dsdt); for (cur = acpi_tables; cur;) { t = cur; - grub_free (cur->addr); + VasEBoot_free (cur->addr); cur = cur->next; - grub_free (t); + VasEBoot_free (t); } acpi_tables = 0; table_dsdt = 0; } -static grub_err_t -grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_acpi (struct VasEBoot_extcmd_context *ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - struct grub_acpi_rsdp_v10 *rsdp; + struct VasEBoot_arg_list *state = ctxt->state; + struct VasEBoot_acpi_rsdp_v10 *rsdp; struct efiemu_acpi_table *cur, *t; int i, mmapregion; int numoftables; @@ -480,88 +480,88 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) playground = playground_ptr = 0; playground_size = 0; - rsdp = (struct grub_acpi_rsdp_v10 *) grub_machine_acpi_get_rsdpv2 (); + rsdp = (struct VasEBoot_acpi_rsdp_v10 *) VasEBoot_machine_acpi_get_rsdpv2 (); if (! rsdp) - rsdp = grub_machine_acpi_get_rsdpv1 (); + rsdp = VasEBoot_machine_acpi_get_rsdpv1 (); - grub_dprintf ("acpi", "RSDP @%p\n", rsdp); + VasEBoot_dprintf ("acpi", "RSDP @%p\n", rsdp); if (rsdp) { - grub_uint32_t *entry_ptr; + VasEBoot_uint32_t *entry_ptr; char *exclude = 0; char *load_only = 0; char *ptr; /* RSDT consists of header and an array of 32-bit pointers. */ - struct grub_acpi_table_header *rsdt; + struct VasEBoot_acpi_table_header *rsdt; - exclude = state[0].set ? grub_strdup (state[0].arg) : 0; + exclude = state[0].set ? VasEBoot_strdup (state[0].arg) : 0; if (exclude) { for (ptr = exclude; *ptr; ptr++) - *ptr = grub_tolower (*ptr); + *ptr = VasEBoot_tolower (*ptr); } - load_only = state[1].set ? grub_strdup (state[1].arg) : 0; + load_only = state[1].set ? VasEBoot_strdup (state[1].arg) : 0; if (load_only) { for (ptr = load_only; *ptr; ptr++) - *ptr = grub_tolower (*ptr); + *ptr = VasEBoot_tolower (*ptr); } /* Set revision variables to replicate the same version as host. */ rev1 = ! rsdp->revision; rev2 = rsdp->revision; - rsdt = (struct grub_acpi_table_header *) (grub_addr_t) rsdp->rsdt_addr; + rsdt = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) rsdp->rsdt_addr; /* Load host tables. */ - for (entry_ptr = (grub_uint32_t *) (rsdt + 1); - entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt) + for (entry_ptr = (VasEBoot_uint32_t *) (rsdt + 1); + entry_ptr < (VasEBoot_uint32_t *) (((VasEBoot_uint8_t *) rsdt) + rsdt->length); entry_ptr++) { char signature[5]; struct efiemu_acpi_table *table; - struct grub_acpi_table_header *curtable - = (struct grub_acpi_table_header *) (grub_addr_t) *entry_ptr; + struct VasEBoot_acpi_table_header *curtable + = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) *entry_ptr; signature[4] = 0; for (i = 0; i < 4;i++) - signature[i] = grub_tolower (curtable->signature[i]); + signature[i] = VasEBoot_tolower (curtable->signature[i]); /* If it's FADT it contains addresses of DSDT and FACS. */ - if (grub_strcmp (signature, "facp") == 0) + if (VasEBoot_strcmp (signature, "facp") == 0) { - struct grub_acpi_table_header *dsdt; - struct grub_acpi_fadt *fadt = (struct grub_acpi_fadt *) curtable; + struct VasEBoot_acpi_table_header *dsdt; + struct VasEBoot_acpi_fadt *fadt = (struct VasEBoot_acpi_fadt *) curtable; /* Set root header variables to the same values as FADT by default. */ - grub_memcpy (&root_oemid, &(fadt->hdr.oemid), + VasEBoot_memcpy (&root_oemid, &(fadt->hdr.oemid), sizeof (root_oemid)); - grub_memcpy (&root_oemtable, &(fadt->hdr.oemtable), + VasEBoot_memcpy (&root_oemtable, &(fadt->hdr.oemtable), sizeof (root_oemtable)); root_oemrev = fadt->hdr.oemrev; - grub_memcpy (&root_creator_id, &(fadt->hdr.creator_id), + VasEBoot_memcpy (&root_creator_id, &(fadt->hdr.creator_id), sizeof (root_creator_id)); root_creator_rev = fadt->hdr.creator_rev; /* Load DSDT if not excluded. */ - dsdt = (struct grub_acpi_table_header *) - (grub_addr_t) fadt->dsdt_addr; - if (dsdt && (! exclude || ! grub_strword (exclude, "dsdt")) - && (! load_only || grub_strword (load_only, "dsdt")) + dsdt = (struct VasEBoot_acpi_table_header *) + (VasEBoot_addr_t) fadt->dsdt_addr; + if (dsdt && (! exclude || ! VasEBoot_strword (exclude, "dsdt")) + && (! load_only || VasEBoot_strword (load_only, "dsdt")) && dsdt->length >= sizeof (*dsdt)) { dsdt_size = dsdt->length; - table_dsdt = grub_malloc (dsdt->length); + table_dsdt = VasEBoot_malloc (dsdt->length); if (! table_dsdt) { free_tables (); - grub_free (exclude); - grub_free (load_only); - return grub_errno; + VasEBoot_free (exclude); + VasEBoot_free (load_only); + return VasEBoot_errno; } - grub_memcpy (table_dsdt, dsdt, dsdt->length); + VasEBoot_memcpy (table_dsdt, dsdt, dsdt->length); } /* Save FACS address. FACS shouldn't be overridden. */ @@ -569,41 +569,41 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) } /* Skip excluded tables. */ - if (exclude && grub_strword (exclude, signature)) + if (exclude && VasEBoot_strword (exclude, signature)) continue; - if (load_only && ! grub_strword (load_only, signature)) + if (load_only && ! VasEBoot_strword (load_only, signature)) continue; /* Sanity check. */ if (curtable->length < sizeof (*curtable)) continue; - table = (struct efiemu_acpi_table *) grub_malloc + table = (struct efiemu_acpi_table *) VasEBoot_malloc (sizeof (struct efiemu_acpi_table)); if (! table) { free_tables (); - grub_free (exclude); - grub_free (load_only); - return grub_errno; + VasEBoot_free (exclude); + VasEBoot_free (load_only); + return VasEBoot_errno; } table->size = curtable->length; - table->addr = grub_malloc (table->size); + table->addr = VasEBoot_malloc (table->size); playground_size += table->size; if (! table->addr) { free_tables (); - grub_free (exclude); - grub_free (load_only); - grub_free (table); - return grub_errno; + VasEBoot_free (exclude); + VasEBoot_free (load_only); + VasEBoot_free (table); + return VasEBoot_errno; } table->next = acpi_tables; acpi_tables = table; - grub_memcpy (table->addr, curtable, table->size); + VasEBoot_memcpy (table->addr, curtable, table->size); } - grub_free (exclude); - grub_free (load_only); + VasEBoot_free (exclude); + VasEBoot_free (load_only); } /* Does user specify versions to generate? */ @@ -618,74 +618,74 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) /* Does user override root header information? */ if (state[4].set) - grub_strncpy (root_oemid, state[4].arg, sizeof (root_oemid)); + VasEBoot_strncpy (root_oemid, state[4].arg, sizeof (root_oemid)); if (state[5].set) - grub_strncpy (root_oemtable, state[5].arg, sizeof (root_oemtable)); + VasEBoot_strncpy (root_oemtable, state[5].arg, sizeof (root_oemtable)); if (state[6].set) - root_oemrev = grub_strtoul (state[6].arg, 0, 0); + root_oemrev = VasEBoot_strtoul (state[6].arg, 0, 0); if (state[7].set) - grub_strncpy (root_creator_id, state[7].arg, sizeof (root_creator_id)); + VasEBoot_strncpy (root_creator_id, state[7].arg, sizeof (root_creator_id)); if (state[8].set) - root_creator_rev = grub_strtoul (state[8].arg, 0, 0); + root_creator_rev = VasEBoot_strtoul (state[8].arg, 0, 0); /* Load user tables */ for (i = 0; i < argc; i++) { - grub_file_t file; - grub_size_t size; + VasEBoot_file_t file; + VasEBoot_size_t size; char *buf; - file = grub_file_open (args[i]); + file = VasEBoot_file_open (args[i]); if (! file) { free_tables (); - return grub_errno; + return VasEBoot_errno; } - size = grub_file_size (file); - if (size < sizeof (struct grub_acpi_table_header)) + size = VasEBoot_file_size (file); + if (size < sizeof (struct VasEBoot_acpi_table_header)) { - grub_file_close (file); + VasEBoot_file_close (file); free_tables (); - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), args[i]); } - buf = (char *) grub_malloc (size); + buf = (char *) VasEBoot_malloc (size); if (! buf) { - grub_file_close (file); + VasEBoot_file_close (file); free_tables (); - return grub_errno; + return VasEBoot_errno; } - if (grub_file_read (file, buf, size) != (int) size) + if (VasEBoot_file_read (file, buf, size) != (int) size) { - grub_file_close (file); + VasEBoot_file_close (file); free_tables (); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), args[i]); - return grub_errno; + return VasEBoot_errno; } - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_memcmp (((struct grub_acpi_table_header *) buf)->signature, + if (VasEBoot_memcmp (((struct VasEBoot_acpi_table_header *) buf)->signature, "DSDT", 4) == 0) { - grub_free (table_dsdt); + VasEBoot_free (table_dsdt); table_dsdt = buf; dsdt_size = size; } else { struct efiemu_acpi_table *table; - table = (struct efiemu_acpi_table *) grub_malloc + table = (struct efiemu_acpi_table *) VasEBoot_malloc (sizeof (struct efiemu_acpi_table)); if (! table) { free_tables (); - return grub_errno; + return VasEBoot_errno; } table->size = size; @@ -704,22 +704,22 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) /* DSDT. */ playground_size += dsdt_size; /* RSDT. */ - playground_size += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint32_t) * numoftables; + playground_size += sizeof (struct VasEBoot_acpi_table_header) + sizeof (VasEBoot_uint32_t) * numoftables; /* RSDPv1. */ - playground_size += sizeof (struct grub_acpi_rsdp_v10); + playground_size += sizeof (struct VasEBoot_acpi_rsdp_v10); /* XSDT. */ - playground_size += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint64_t) * numoftables; + playground_size += sizeof (struct VasEBoot_acpi_table_header) + sizeof (VasEBoot_uint64_t) * numoftables; /* RSDPv2. */ - playground_size += sizeof (struct grub_acpi_rsdp_v20); + playground_size += sizeof (struct VasEBoot_acpi_rsdp_v20); playground = playground_ptr - = grub_mmap_malign_and_register (1, playground_size, &mmapregion, - GRUB_MEMORY_ACPI, 0); + = VasEBoot_mmap_malign_and_register (1, playground_size, &mmapregion, + VasEBoot_MEMORY_ACPI, 0); if (! playground) { free_tables (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't allocate space for ACPI tables"); } @@ -737,45 +737,45 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) { t = cur; cur = cur->next; - grub_free (t); + VasEBoot_free (t); } acpi_tables = 0; #if defined (__i386__) || defined (__x86_64__) if (! state[9].set) { - grub_err_t err; - err = grub_acpi_create_ebda (); + VasEBoot_err_t err; + err = VasEBoot_acpi_create_ebda (); if (err) { rsdpv1_new = 0; rsdpv2_new = 0; - grub_mmap_free_and_unregister (mmapregion); + VasEBoot_mmap_free_and_unregister (mmapregion); return err; } } #endif -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI { - struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID; - struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID; + struct VasEBoot_efi_guid acpi = VasEBoot_EFI_ACPI_TABLE_GUID; + struct VasEBoot_efi_guid acpi20 = VasEBoot_EFI_ACPI_20_TABLE_GUID; - efi_call_2 (grub_efi_system_table->boot_services->install_configuration_table, - &acpi20, grub_acpi_get_rsdpv2 ()); - efi_call_2 (grub_efi_system_table->boot_services->install_configuration_table, - &acpi, grub_acpi_get_rsdpv1 ()); + efi_call_2 (VasEBoot_efi_system_table->boot_services->install_configuration_table, + &acpi20, VasEBoot_acpi_get_rsdpv2 ()); + efi_call_2 (VasEBoot_efi_system_table->boot_services->install_configuration_table, + &acpi, VasEBoot_acpi_get_rsdpv1 ()); } #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(acpi) +VasEBoot_MOD_INIT(acpi) { - cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, 0, + cmd = VasEBoot_register_extcmd ("acpi", VasEBoot_cmd_acpi, 0, N_("[-1|-2] [--exclude=TABLE1,TABLE2|" "--load-only=TABLE1,TABLE2] FILE1" " [FILE2] [...]"), @@ -784,7 +784,7 @@ GRUB_MOD_INIT(acpi) options); } -GRUB_MOD_FINI(acpi) +VasEBoot_MOD_FINI(acpi) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/acpihalt.c b/VasEBoot-core/commands/acpihalt.c index 9cc7f18e3..21adab238 100644 --- a/VasEBoot-core/commands/acpihalt.c +++ b/VasEBoot-core/commands/acpihalt.c @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifdef GRUB_DSDT_TEST +#ifdef VasEBoot_DSDT_TEST #include #include #include @@ -24,37 +24,37 @@ #include #include -#define grub_dprintf(cond, args...) printf ( args ) -#define grub_printf printf -#define grub_util_fopen fopen -#define grub_memcmp memcmp -typedef uint64_t grub_uint64_t; -typedef uint32_t grub_uint32_t; -typedef uint16_t grub_uint16_t; -typedef uint8_t grub_uint8_t; +#define VasEBoot_dprintf(cond, args...) printf ( args ) +#define VasEBoot_printf printf +#define VasEBoot_util_fopen fopen +#define VasEBoot_memcmp memcmp +typedef uint64_t VasEBoot_uint64_t; +typedef uint32_t VasEBoot_uint32_t; +typedef uint16_t VasEBoot_uint16_t; +typedef uint8_t VasEBoot_uint8_t; #endif -#include -#ifndef GRUB_DSDT_TEST -#include +#include +#ifndef VasEBoot_DSDT_TEST +#include #else #define _(x) x #define N_(x) x #endif -#ifndef GRUB_DSDT_TEST -#include -#include -#include -#include +#ifndef VasEBoot_DSDT_TEST +#include +#include +#include +#include #endif -static inline grub_uint32_t -decode_length (const grub_uint8_t *ptr, int *numlen) +static inline VasEBoot_uint32_t +decode_length (const VasEBoot_uint8_t *ptr, int *numlen) { int num_bytes, i; - grub_uint32_t ret; + VasEBoot_uint32_t ret; if (*ptr < 64) { if (numlen) @@ -74,10 +74,10 @@ decode_length (const grub_uint8_t *ptr, int *numlen) return ret; } -static inline grub_uint32_t -skip_name_string (const grub_uint8_t *ptr, const grub_uint8_t *end) +static inline VasEBoot_uint32_t +skip_name_string (const VasEBoot_uint8_t *ptr, const VasEBoot_uint8_t *end) { - const grub_uint8_t *ptr0 = ptr; + const VasEBoot_uint8_t *ptr0 = ptr; while (ptr < end && (*ptr == '^' || *ptr == '\\')) ptr++; @@ -101,28 +101,28 @@ skip_name_string (const grub_uint8_t *ptr, const grub_uint8_t *end) return ptr - ptr0; } -static inline grub_uint32_t -skip_data_ref_object (const grub_uint8_t *ptr, const grub_uint8_t *end) +static inline VasEBoot_uint32_t +skip_data_ref_object (const VasEBoot_uint8_t *ptr, const VasEBoot_uint8_t *end) { - grub_dprintf ("acpi", "data type = 0x%x\n", *ptr); + VasEBoot_dprintf ("acpi", "data type = 0x%x\n", *ptr); switch (*ptr) { - case GRUB_ACPI_OPCODE_PACKAGE: - case GRUB_ACPI_OPCODE_BUFFER: + case VasEBoot_ACPI_OPCODE_PACKAGE: + case VasEBoot_ACPI_OPCODE_BUFFER: return 1 + decode_length (ptr + 1, 0); - case GRUB_ACPI_OPCODE_ZERO: - case GRUB_ACPI_OPCODE_ONES: - case GRUB_ACPI_OPCODE_ONE: + case VasEBoot_ACPI_OPCODE_ZERO: + case VasEBoot_ACPI_OPCODE_ONES: + case VasEBoot_ACPI_OPCODE_ONE: return 1; - case GRUB_ACPI_OPCODE_BYTE_CONST: + case VasEBoot_ACPI_OPCODE_BYTE_CONST: return 2; - case GRUB_ACPI_OPCODE_WORD_CONST: + case VasEBoot_ACPI_OPCODE_WORD_CONST: return 3; - case GRUB_ACPI_OPCODE_DWORD_CONST: + case VasEBoot_ACPI_OPCODE_DWORD_CONST: return 5; - case GRUB_ACPI_OPCODE_STRING_CONST: + case VasEBoot_ACPI_OPCODE_STRING_CONST: { - const grub_uint8_t *ptr0 = ptr; + const VasEBoot_uint8_t *ptr0 = ptr; for (ptr++; ptr < end && *ptr; ptr++); if (ptr == end) return 0; @@ -132,35 +132,35 @@ skip_data_ref_object (const grub_uint8_t *ptr, const grub_uint8_t *end) if (*ptr == '^' || *ptr == '\\' || *ptr == '_' || (*ptr >= 'A' && *ptr <= 'Z')) return skip_name_string (ptr, end); - grub_printf ("Unknown opcode 0x%x\n", *ptr); + VasEBoot_printf ("Unknown opcode 0x%x\n", *ptr); return 0; } } -static inline grub_uint32_t -skip_term (const grub_uint8_t *ptr, const grub_uint8_t *end) +static inline VasEBoot_uint32_t +skip_term (const VasEBoot_uint8_t *ptr, const VasEBoot_uint8_t *end) { - grub_uint32_t add; - const grub_uint8_t *ptr0 = ptr; + VasEBoot_uint32_t add; + const VasEBoot_uint8_t *ptr0 = ptr; switch(*ptr) { - case GRUB_ACPI_OPCODE_ADD: - case GRUB_ACPI_OPCODE_AND: - case GRUB_ACPI_OPCODE_CONCAT: - case GRUB_ACPI_OPCODE_CONCATRES: - case GRUB_ACPI_OPCODE_DIVIDE: - case GRUB_ACPI_OPCODE_INDEX: - case GRUB_ACPI_OPCODE_LSHIFT: - case GRUB_ACPI_OPCODE_MOD: - case GRUB_ACPI_OPCODE_MULTIPLY: - case GRUB_ACPI_OPCODE_NAND: - case GRUB_ACPI_OPCODE_NOR: - case GRUB_ACPI_OPCODE_OR: - case GRUB_ACPI_OPCODE_RSHIFT: - case GRUB_ACPI_OPCODE_SUBTRACT: - case GRUB_ACPI_OPCODE_TOSTRING: - case GRUB_ACPI_OPCODE_XOR: + case VasEBoot_ACPI_OPCODE_ADD: + case VasEBoot_ACPI_OPCODE_AND: + case VasEBoot_ACPI_OPCODE_CONCAT: + case VasEBoot_ACPI_OPCODE_CONCATRES: + case VasEBoot_ACPI_OPCODE_DIVIDE: + case VasEBoot_ACPI_OPCODE_INDEX: + case VasEBoot_ACPI_OPCODE_LSHIFT: + case VasEBoot_ACPI_OPCODE_MOD: + case VasEBoot_ACPI_OPCODE_MULTIPLY: + case VasEBoot_ACPI_OPCODE_NAND: + case VasEBoot_ACPI_OPCODE_NOR: + case VasEBoot_ACPI_OPCODE_OR: + case VasEBoot_ACPI_OPCODE_RSHIFT: + case VasEBoot_ACPI_OPCODE_SUBTRACT: + case VasEBoot_ACPI_OPCODE_TOSTRING: + case VasEBoot_ACPI_OPCODE_XOR: /* * Parameters for these opcodes: TermArg, TermArg Target, see ACPI * spec r5.0, page 828f. @@ -180,24 +180,24 @@ skip_term (const grub_uint8_t *ptr, const grub_uint8_t *end) return ptr - ptr0; } -static inline grub_uint32_t -skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end) +static inline VasEBoot_uint32_t +skip_ext_op (const VasEBoot_uint8_t *ptr, const VasEBoot_uint8_t *end) { - const grub_uint8_t *ptr0 = ptr; + const VasEBoot_uint8_t *ptr0 = ptr; int add; - grub_dprintf ("acpi", "Extended opcode: 0x%x\n", *ptr); + VasEBoot_dprintf ("acpi", "Extended opcode: 0x%x\n", *ptr); switch (*ptr) { - case GRUB_ACPI_EXTOPCODE_MUTEX: + case VasEBoot_ACPI_EXTOPCODE_MUTEX: ptr++; ptr += skip_name_string (ptr, end); ptr++; break; - case GRUB_ACPI_EXTOPCODE_EVENT_OP: + case VasEBoot_ACPI_EXTOPCODE_EVENT_OP: ptr++; ptr += skip_name_string (ptr, end); break; - case GRUB_ACPI_EXTOPCODE_OPERATION_REGION: + case VasEBoot_ACPI_EXTOPCODE_OPERATION_REGION: ptr++; ptr += skip_name_string (ptr, end); ptr++; @@ -208,18 +208,18 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end) if (!add) return 0; break; - case GRUB_ACPI_EXTOPCODE_FIELD_OP: - case GRUB_ACPI_EXTOPCODE_DEVICE_OP: - case GRUB_ACPI_EXTOPCODE_PROCESSOR_OP: - case GRUB_ACPI_EXTOPCODE_POWER_RES_OP: - case GRUB_ACPI_EXTOPCODE_THERMAL_ZONE_OP: - case GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP: - case GRUB_ACPI_EXTOPCODE_BANK_FIELD_OP: + case VasEBoot_ACPI_EXTOPCODE_FIELD_OP: + case VasEBoot_ACPI_EXTOPCODE_DEVICE_OP: + case VasEBoot_ACPI_EXTOPCODE_PROCESSOR_OP: + case VasEBoot_ACPI_EXTOPCODE_POWER_RES_OP: + case VasEBoot_ACPI_EXTOPCODE_THERMAL_ZONE_OP: + case VasEBoot_ACPI_EXTOPCODE_INDEX_FIELD_OP: + case VasEBoot_ACPI_EXTOPCODE_BANK_FIELD_OP: ptr++; ptr += decode_length (ptr, 0); break; default: - grub_printf ("Unexpected extended opcode: 0x%x\n", *ptr); + VasEBoot_printf ("Unexpected extended opcode: 0x%x\n", *ptr); return 0; } return ptr - ptr0; @@ -227,30 +227,30 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end) static int -get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, - grub_uint8_t *scope, int scope_len) +get_sleep_type (VasEBoot_uint8_t *table, VasEBoot_uint8_t *ptr, VasEBoot_uint8_t *end, + VasEBoot_uint8_t *scope, int scope_len) { - grub_uint8_t *prev = table; + VasEBoot_uint8_t *prev = table; if (!ptr) - ptr = table + sizeof (struct grub_acpi_table_header); + ptr = table + sizeof (struct VasEBoot_acpi_table_header); while (ptr < end && prev < ptr) { int add; prev = ptr; - grub_dprintf ("acpi", "Opcode 0x%x\n", *ptr); - grub_dprintf ("acpi", "Tell %x\n", (unsigned) (ptr - table)); + VasEBoot_dprintf ("acpi", "Opcode 0x%x\n", *ptr); + VasEBoot_dprintf ("acpi", "Tell %x\n", (unsigned) (ptr - table)); switch (*ptr) { - case GRUB_ACPI_OPCODE_EXTOP: + case VasEBoot_ACPI_OPCODE_EXTOP: ptr++; ptr += add = skip_ext_op (ptr, end); if (!add) return -1; break; - case GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD: - case GRUB_ACPI_OPCODE_CREATE_WORD_FIELD: - case GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD: + case VasEBoot_ACPI_OPCODE_CREATE_DWORD_FIELD: + case VasEBoot_ACPI_OPCODE_CREATE_WORD_FIELD: + case VasEBoot_ACPI_OPCODE_CREATE_BYTE_FIELD: { ptr += 5; ptr += add = skip_data_ref_object (ptr, end); @@ -259,18 +259,18 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, ptr += 4; break; } - case GRUB_ACPI_OPCODE_NAME: + case VasEBoot_ACPI_OPCODE_NAME: ptr++; - if ((!scope || grub_memcmp (scope, "\\", scope_len) == 0) && - (grub_memcmp (ptr, "_S5_", 4) == 0 || grub_memcmp (ptr, "\\_S5_", 4) == 0)) + if ((!scope || VasEBoot_memcmp (scope, "\\", scope_len) == 0) && + (VasEBoot_memcmp (ptr, "_S5_", 4) == 0 || VasEBoot_memcmp (ptr, "\\_S5_", 4) == 0)) { int ll; - grub_uint8_t *ptr2 = ptr; - grub_dprintf ("acpi", "S5 found\n"); + VasEBoot_uint8_t *ptr2 = ptr; + VasEBoot_dprintf ("acpi", "S5 found\n"); ptr2 += skip_name_string (ptr, end); if (*ptr2 != 0x12) { - grub_printf ("Unknown opcode in _S5: 0x%x\n", *ptr2); + VasEBoot_printf ("Unknown opcode in _S5: 0x%x\n", *ptr2); return -1; } ptr2++; @@ -279,14 +279,14 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, ptr2++; switch (*ptr2) { - case GRUB_ACPI_OPCODE_ZERO: + case VasEBoot_ACPI_OPCODE_ZERO: return 0; - case GRUB_ACPI_OPCODE_ONE: + case VasEBoot_ACPI_OPCODE_ONE: return 1; - case GRUB_ACPI_OPCODE_BYTE_CONST: + case VasEBoot_ACPI_OPCODE_BYTE_CONST: return ptr2[1]; default: - grub_printf ("Unknown data type in _S5: 0x%x\n", *ptr2); + VasEBoot_printf ("Unknown data type in _S5: 0x%x\n", *ptr2); return -1; } } @@ -297,7 +297,7 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, if (!add) return -1; break; - case GRUB_ACPI_OPCODE_ALIAS: + case VasEBoot_ACPI_OPCODE_ALIAS: ptr++; /* We need to skip two name strings */ ptr += add = skip_name_string (ptr, end); @@ -308,11 +308,11 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, return -1; break; - case GRUB_ACPI_OPCODE_SCOPE: + case VasEBoot_ACPI_OPCODE_SCOPE: { int scope_sleep_type; int ll; - grub_uint8_t *name; + VasEBoot_uint8_t *name; int name_len; ptr++; @@ -328,15 +328,15 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, ptr += add; break; } - case GRUB_ACPI_OPCODE_IF: - case GRUB_ACPI_OPCODE_METHOD: + case VasEBoot_ACPI_OPCODE_IF: + case VasEBoot_ACPI_OPCODE_METHOD: { ptr++; ptr += decode_length (ptr, 0); break; } default: - grub_printf ("Unknown opcode 0x%x\n", *ptr); + VasEBoot_printf ("Unknown opcode 0x%x\n", *ptr); return -1; } } @@ -344,7 +344,7 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, return -2; } -#ifdef GRUB_DSDT_TEST +#ifdef VasEBoot_DSDT_TEST int main (int argc, char **argv) { @@ -353,7 +353,7 @@ main (int argc, char **argv) unsigned char *buf; if (argc < 2) printf ("Usage: %s FILE\n", argv[0]); - f = grub_util_fopen (argv[1], "rb"); + f = VasEBoot_util_fopen (argv[1], "rb"); if (!f) { printf ("Couldn't open file\n"); @@ -386,69 +386,69 @@ main (int argc, char **argv) #else void -grub_acpi_halt (void) +VasEBoot_acpi_halt (void) { - struct grub_acpi_rsdp_v20 *rsdp2; - struct grub_acpi_rsdp_v10 *rsdp1; - struct grub_acpi_table_header *rsdt; - grub_uint32_t *entry_ptr; - grub_uint32_t port = 0; + struct VasEBoot_acpi_rsdp_v20 *rsdp2; + struct VasEBoot_acpi_rsdp_v10 *rsdp1; + struct VasEBoot_acpi_table_header *rsdt; + VasEBoot_uint32_t *entry_ptr; + VasEBoot_uint32_t port = 0; int sleep_type = -1; - rsdp2 = grub_acpi_get_rsdpv2 (); + rsdp2 = VasEBoot_acpi_get_rsdpv2 (); if (rsdp2) rsdp1 = &(rsdp2->rsdpv1); else - rsdp1 = grub_acpi_get_rsdpv1 (); - grub_dprintf ("acpi", "rsdp1=%p\n", rsdp1); + rsdp1 = VasEBoot_acpi_get_rsdpv1 (); + VasEBoot_dprintf ("acpi", "rsdp1=%p\n", rsdp1); if (!rsdp1) return; - rsdt = (struct grub_acpi_table_header *) (grub_addr_t) rsdp1->rsdt_addr; - for (entry_ptr = (grub_uint32_t *) (rsdt + 1); - entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt) + rsdt = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) rsdp1->rsdt_addr; + for (entry_ptr = (VasEBoot_uint32_t *) (rsdt + 1); + entry_ptr < (VasEBoot_uint32_t *) (((VasEBoot_uint8_t *) rsdt) + rsdt->length); entry_ptr++) { - if (grub_memcmp ((void *) (grub_addr_t) *entry_ptr, "FACP", 4) == 0) + if (VasEBoot_memcmp ((void *) (VasEBoot_addr_t) *entry_ptr, "FACP", 4) == 0) { - struct grub_acpi_fadt *fadt - = ((struct grub_acpi_fadt *) (grub_addr_t) *entry_ptr); - struct grub_acpi_table_header *dsdt - = (struct grub_acpi_table_header *) (grub_addr_t) fadt->dsdt_addr; - grub_uint8_t *buf = (grub_uint8_t *) dsdt; + struct VasEBoot_acpi_fadt *fadt + = ((struct VasEBoot_acpi_fadt *) (VasEBoot_addr_t) *entry_ptr); + struct VasEBoot_acpi_table_header *dsdt + = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) fadt->dsdt_addr; + VasEBoot_uint8_t *buf = (VasEBoot_uint8_t *) dsdt; port = fadt->pm1a; - grub_dprintf ("acpi", "PM1a port=%x\n", port); + VasEBoot_dprintf ("acpi", "PM1a port=%x\n", port); - if (grub_memcmp (dsdt->signature, "DSDT", + if (VasEBoot_memcmp (dsdt->signature, "DSDT", sizeof (dsdt->signature)) == 0 && sleep_type < 0) sleep_type = get_sleep_type (buf, NULL, buf + dsdt->length, NULL, 0); } - else if (grub_memcmp ((void *) (grub_addr_t) *entry_ptr, "SSDT", 4) == 0 + else if (VasEBoot_memcmp ((void *) (VasEBoot_addr_t) *entry_ptr, "SSDT", 4) == 0 && sleep_type < 0) { - struct grub_acpi_table_header *ssdt - = (struct grub_acpi_table_header *) (grub_addr_t) *entry_ptr; - grub_uint8_t *buf = (grub_uint8_t *) ssdt; + struct VasEBoot_acpi_table_header *ssdt + = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) *entry_ptr; + VasEBoot_uint8_t *buf = (VasEBoot_uint8_t *) ssdt; - grub_dprintf ("acpi", "SSDT = %p\n", ssdt); + VasEBoot_dprintf ("acpi", "SSDT = %p\n", ssdt); sleep_type = get_sleep_type (buf, NULL, buf + ssdt->length, NULL, 0); } } - grub_dprintf ("acpi", "SLP_TYP = %d, port = 0x%x\n", sleep_type, port); + VasEBoot_dprintf ("acpi", "SLP_TYP = %d, port = 0x%x\n", sleep_type, port); if (port && sleep_type >= 0 && sleep_type < 8) - grub_outw (GRUB_ACPI_SLP_EN | (sleep_type << GRUB_ACPI_SLP_TYP_OFFSET), + VasEBoot_outw (VasEBoot_ACPI_SLP_EN | (sleep_type << VasEBoot_ACPI_SLP_TYP_OFFSET), port & 0xffff); - grub_millisleep (1500); + VasEBoot_millisleep (1500); /* TRANSLATORS: It's computer shutdown using ACPI, not disabling ACPI. */ - grub_puts_ (N_("ACPI shutdown failed")); + VasEBoot_puts_ (N_("ACPI shutdown failed")); } #endif diff --git a/VasEBoot-core/commands/arc/lsdev.c b/VasEBoot-core/commands/arc/lsdev.c index 27ed0a248..ce9aaa523 100644 --- a/VasEBoot-core/commands/arc/lsdev.c +++ b/VasEBoot-core/commands/arc/lsdev.c @@ -1,57 +1,57 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -/* Helper for grub_cmd_lsdev. */ +/* Helper for VasEBoot_cmd_lsdev. */ static int -grub_cmd_lsdev_iter (const char *name, - const struct grub_arc_component *comp __attribute__ ((unused)), +VasEBoot_cmd_lsdev_iter (const char *name, + const struct VasEBoot_arc_component *comp __attribute__ ((unused)), void *data __attribute__ ((unused))) { - grub_printf ("%s\n", name); + VasEBoot_printf ("%s\n", name); return 0; } -static grub_err_t -grub_cmd_lsdev (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsdev (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_arc_iterate_devs (grub_cmd_lsdev_iter, 0, 0); + VasEBoot_arc_iterate_devs (VasEBoot_cmd_lsdev_iter, 0, 0); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsdev) +VasEBoot_MOD_INIT(lsdev) { - cmd = grub_register_command ("lsdev", grub_cmd_lsdev, "", + cmd = VasEBoot_register_command ("lsdev", VasEBoot_cmd_lsdev, "", N_("List devices.")); } -GRUB_MOD_FINI(lsdev) +VasEBoot_MOD_FINI(lsdev) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/blocklist.c b/VasEBoot-core/commands/blocklist.c index d1a47b504..f44a67758 100644 --- a/VasEBoot-core/commands/blocklist.c +++ b/VasEBoot-core/commands/blocklist.c @@ -1,60 +1,60 @@ /* blocklist.c - print the block list of a file */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -/* Context for grub_cmd_blocklist. */ +/* Context for VasEBoot_cmd_blocklist. */ struct blocklist_ctx { unsigned long start_sector; unsigned num_sectors; int num_entries; - grub_disk_addr_t part_start; + VasEBoot_disk_addr_t part_start; }; -/* Helper for grub_cmd_blocklist. */ +/* Helper for VasEBoot_cmd_blocklist. */ static void -print_blocklist (grub_disk_addr_t sector, unsigned num, +print_blocklist (VasEBoot_disk_addr_t sector, unsigned num, unsigned offset, unsigned length, struct blocklist_ctx *ctx) { if (ctx->num_entries++) - grub_printf (","); + VasEBoot_printf (","); - grub_printf ("%llu", (unsigned long long) (sector - ctx->part_start)); + VasEBoot_printf ("%llu", (unsigned long long) (sector - ctx->part_start)); if (num > 0) - grub_printf ("+%u", num); + VasEBoot_printf ("+%u", num); if (offset != 0 || length != 0) - grub_printf ("[%u-%u]", offset, offset + length); + VasEBoot_printf ("[%u-%u]", offset, offset + length); } -/* Helper for grub_cmd_blocklist. */ +/* Helper for VasEBoot_cmd_blocklist. */ static void -read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length, +read_blocklist (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data) { struct blocklist_ctx *ctx = data; @@ -62,11 +62,11 @@ read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length, if (ctx->num_sectors > 0) { if (ctx->start_sector + ctx->num_sectors == sector - && offset == 0 && length >= GRUB_DISK_SECTOR_SIZE) + && offset == 0 && length >= VasEBoot_DISK_SECTOR_SIZE) { - ctx->num_sectors += length >> GRUB_DISK_SECTOR_BITS; - sector += length >> GRUB_DISK_SECTOR_BITS; - length &= (GRUB_DISK_SECTOR_SIZE - 1); + ctx->num_sectors += length >> VasEBoot_DISK_SECTOR_BITS; + sector += length >> VasEBoot_DISK_SECTOR_BITS; + length &= (VasEBoot_DISK_SECTOR_SIZE - 1); } if (!length) @@ -78,7 +78,7 @@ read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length, if (offset) { unsigned l = length + offset; - l &= (GRUB_DISK_SECTOR_SIZE - 1); + l &= (VasEBoot_DISK_SECTOR_SIZE - 1); l -= offset; print_blocklist (sector, 0, offset, l, ctx); length -= l; @@ -89,28 +89,28 @@ read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length, if (!length) return; - if (length & (GRUB_DISK_SECTOR_SIZE - 1)) + if (length & (VasEBoot_DISK_SECTOR_SIZE - 1)) { - if (length >> GRUB_DISK_SECTOR_BITS) + if (length >> VasEBoot_DISK_SECTOR_BITS) { - print_blocklist (sector, length >> GRUB_DISK_SECTOR_BITS, 0, 0, ctx); - sector += length >> GRUB_DISK_SECTOR_BITS; + print_blocklist (sector, length >> VasEBoot_DISK_SECTOR_BITS, 0, 0, ctx); + sector += length >> VasEBoot_DISK_SECTOR_BITS; } - print_blocklist (sector, 0, 0, length & (GRUB_DISK_SECTOR_SIZE - 1), ctx); + print_blocklist (sector, 0, 0, length & (VasEBoot_DISK_SECTOR_SIZE - 1), ctx); } else { ctx->start_sector = sector; - ctx->num_sectors = length >> GRUB_DISK_SECTOR_BITS; + ctx->num_sectors = length >> VasEBoot_DISK_SECTOR_BITS; } } -static grub_err_t -grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_blocklist (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_file_t file; - char buf[GRUB_DISK_SECTOR_SIZE]; + VasEBoot_file_t file; + char buf[VasEBoot_DISK_SECTOR_SIZE]; struct blocklist_ctx ctx = { .start_sector = 0, .num_sectors = 0, @@ -119,42 +119,42 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), }; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_file_filter_disable_compression (); - file = grub_file_open (args[0]); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; + return VasEBoot_errno; if (! file->device->disk) - return grub_error (GRUB_ERR_BAD_DEVICE, + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "this command is available only for disk devices"); - ctx.part_start = grub_partition_get_start (file->device->disk->partition); + ctx.part_start = VasEBoot_partition_get_start (file->device->disk->partition); file->read_hook = read_blocklist; file->read_hook_data = &ctx; - while (grub_file_read (file, buf, sizeof (buf)) > 0) + while (VasEBoot_file_read (file, buf, sizeof (buf)) > 0) ; if (ctx.num_sectors > 0) print_blocklist (ctx.start_sector, ctx.num_sectors, 0, 0, &ctx); - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(blocklist) +VasEBoot_MOD_INIT(blocklist) { - cmd = grub_register_command ("blocklist", grub_cmd_blocklist, + cmd = VasEBoot_register_command ("blocklist", VasEBoot_cmd_blocklist, N_("FILE"), N_("Print a block list.")); } -GRUB_MOD_FINI(blocklist) +VasEBoot_MOD_FINI(blocklist) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/boot.c b/VasEBoot-core/commands/boot.c index bbca81e94..3408e94ca 100644 --- a/VasEBoot-core/commands/boot.c +++ b/VasEBoot-core/commands/boot.c @@ -1,68 +1,68 @@ /* boot.c - command to boot an operating system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t (*grub_loader_boot_func) (void); -static grub_err_t (*grub_loader_unload_func) (void); -static int grub_loader_flags; +static VasEBoot_err_t (*VasEBoot_loader_boot_func) (void); +static VasEBoot_err_t (*VasEBoot_loader_unload_func) (void); +static int VasEBoot_loader_flags; -struct grub_preboot +struct VasEBoot_preboot { - grub_err_t (*preboot_func) (int); - grub_err_t (*preboot_rest_func) (void); - grub_loader_preboot_hook_prio_t prio; - struct grub_preboot *next; - struct grub_preboot *prev; + VasEBoot_err_t (*preboot_func) (int); + VasEBoot_err_t (*preboot_rest_func) (void); + VasEBoot_loader_preboot_hook_prio_t prio; + struct VasEBoot_preboot *next; + struct VasEBoot_preboot *prev; }; -static int grub_loader_loaded; -static struct grub_preboot *preboots_head = 0, +static int VasEBoot_loader_loaded; +static struct VasEBoot_preboot *preboots_head = 0, *preboots_tail = 0; int -grub_loader_is_loaded (void) +VasEBoot_loader_is_loaded (void) { - return grub_loader_loaded; + return VasEBoot_loader_loaded; } /* Register a preboot hook. */ -struct grub_preboot * -grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int flags), - grub_err_t (*preboot_rest_func) (void), - grub_loader_preboot_hook_prio_t prio) +struct VasEBoot_preboot * +VasEBoot_loader_register_preboot_hook (VasEBoot_err_t (*preboot_func) (int flags), + VasEBoot_err_t (*preboot_rest_func) (void), + VasEBoot_loader_preboot_hook_prio_t prio) { - struct grub_preboot *cur, *new_preboot; + struct VasEBoot_preboot *cur, *new_preboot; if (! preboot_func && ! preboot_rest_func) return 0; - new_preboot = (struct grub_preboot *) - grub_malloc (sizeof (struct grub_preboot)); + new_preboot = (struct VasEBoot_preboot *) + VasEBoot_malloc (sizeof (struct VasEBoot_preboot)); if (! new_preboot) return 0; @@ -93,9 +93,9 @@ grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int flags), } void -grub_loader_unregister_preboot_hook (struct grub_preboot *hnd) +VasEBoot_loader_unregister_preboot_hook (struct VasEBoot_preboot *hnd) { - struct grub_preboot *preb = hnd; + struct VasEBoot_preboot *preb = hnd; if (preb->next) preb->next->prev = preb->prev; @@ -106,51 +106,51 @@ grub_loader_unregister_preboot_hook (struct grub_preboot *hnd) else preboots_head = preb->next; - grub_free (preb); + VasEBoot_free (preb); } void -grub_loader_set (grub_err_t (*boot) (void), - grub_err_t (*unload) (void), +VasEBoot_loader_set (VasEBoot_err_t (*boot) (void), + VasEBoot_err_t (*unload) (void), int flags) { - if (grub_loader_loaded && grub_loader_unload_func) - grub_loader_unload_func (); + if (VasEBoot_loader_loaded && VasEBoot_loader_unload_func) + VasEBoot_loader_unload_func (); - grub_loader_boot_func = boot; - grub_loader_unload_func = unload; - grub_loader_flags = flags; + VasEBoot_loader_boot_func = boot; + VasEBoot_loader_unload_func = unload; + VasEBoot_loader_flags = flags; - grub_loader_loaded = 1; + VasEBoot_loader_loaded = 1; } void -grub_loader_unset(void) +VasEBoot_loader_unset(void) { - if (grub_loader_loaded && grub_loader_unload_func) - grub_loader_unload_func (); + if (VasEBoot_loader_loaded && VasEBoot_loader_unload_func) + VasEBoot_loader_unload_func (); - grub_loader_boot_func = 0; - grub_loader_unload_func = 0; + VasEBoot_loader_boot_func = 0; + VasEBoot_loader_unload_func = 0; - grub_loader_loaded = 0; + VasEBoot_loader_loaded = 0; } -grub_err_t -grub_loader_boot (void) +VasEBoot_err_t +VasEBoot_loader_boot (void) { - grub_err_t err = GRUB_ERR_NONE; - struct grub_preboot *cur; + VasEBoot_err_t err = VasEBoot_ERR_NONE; + struct VasEBoot_preboot *cur; - if (! grub_loader_loaded) - return grub_error (GRUB_ERR_NO_KERNEL, + if (! VasEBoot_loader_loaded) + return VasEBoot_error (VasEBoot_ERR_NO_KERNEL, N_("you need to load the kernel first")); - grub_machine_fini (grub_loader_flags); + VasEBoot_machine_fini (VasEBoot_loader_flags); for (cur = preboots_head; cur; cur = cur->next) { - err = cur->preboot_func (grub_loader_flags); + err = cur->preboot_func (VasEBoot_loader_flags); if (err) { for (cur = cur->prev; cur; cur = cur->prev) @@ -158,7 +158,7 @@ grub_loader_boot (void) return err; } } - err = (grub_loader_boot_func) (); + err = (VasEBoot_loader_boot_func) (); for (cur = preboots_tail; cur; cur = cur->prev) if (! err) @@ -170,26 +170,26 @@ grub_loader_boot (void) } /* boot */ -static grub_err_t -grub_cmd_boot (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_boot (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - return grub_loader_boot (); + return VasEBoot_loader_boot (); } -static grub_command_t cmd_boot; +static VasEBoot_command_t cmd_boot; -GRUB_MOD_INIT(boot) +VasEBoot_MOD_INIT(boot) { cmd_boot = - grub_register_command ("boot", grub_cmd_boot, + VasEBoot_register_command ("boot", VasEBoot_cmd_boot, 0, N_("Boot an operating system.")); } -GRUB_MOD_FINI(boot) +VasEBoot_MOD_FINI(boot) { - grub_unregister_command (cmd_boot); + VasEBoot_unregister_command (cmd_boot); } diff --git a/VasEBoot-core/commands/boottime.c b/VasEBoot-core/commands/boottime.c index dcc078c2a..6777a7794 100644 --- a/VasEBoot-core/commands/boottime.c +++ b/VasEBoot-core/commands/boottime.c @@ -1,65 +1,65 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_boottime (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_boottime (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - struct grub_boot_time *cur; - grub_uint64_t last_time = 0, start_time = 0; - if (!grub_boot_time_head) + struct VasEBoot_boot_time *cur; + VasEBoot_uint64_t last_time = 0, start_time = 0; + if (!VasEBoot_boot_time_head) { - grub_puts_ (N_("No boot time statistics is available\n")); + VasEBoot_puts_ (N_("No boot time statistics is available\n")); return 0; } - start_time = last_time = grub_boot_time_head->tp; - for (cur = grub_boot_time_head; cur; cur = cur->next) + start_time = last_time = VasEBoot_boot_time_head->tp; + for (cur = VasEBoot_boot_time_head; cur; cur = cur->next) { - grub_uint32_t tmabs = cur->tp - start_time; - grub_uint32_t tmrel = cur->tp - last_time; + VasEBoot_uint32_t tmabs = cur->tp - start_time; + VasEBoot_uint32_t tmrel = cur->tp - last_time; last_time = cur->tp; - grub_printf ("%3d.%03ds %2d.%03ds %s:%d %s\n", + VasEBoot_printf ("%3d.%03ds %2d.%03ds %s:%d %s\n", tmabs / 1000, tmabs % 1000, tmrel / 1000, tmrel % 1000, cur->file, cur->line, cur->msg); } return 0; } -static grub_command_t cmd_boottime; +static VasEBoot_command_t cmd_boottime; -GRUB_MOD_INIT(boottime) +VasEBoot_MOD_INIT(boottime) { cmd_boottime = - grub_register_command ("boottime", grub_cmd_boottime, + VasEBoot_register_command ("boottime", VasEBoot_cmd_boottime, 0, N_("Show boot time statistics.")); } -GRUB_MOD_FINI(boottime) +VasEBoot_MOD_FINI(boottime) { - grub_unregister_command (cmd_boottime); + VasEBoot_unregister_command (cmd_boottime); } diff --git a/VasEBoot-core/commands/cacheinfo.c b/VasEBoot-core/commands/cacheinfo.c index d34a34696..af3ac4d39 100644 --- a/VasEBoot-core/commands/cacheinfo.c +++ b/VasEBoot-core/commands/cacheinfo.c @@ -1,62 +1,62 @@ /* cacheinfo.c - disk cache statistics */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_rescue_cmd_info (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_rescue_cmd_info (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { unsigned long hits, misses; - grub_disk_cache_get_performance (&hits, &misses); + VasEBoot_disk_cache_get_performance (&hits, &misses); if (hits + misses) { unsigned long ratio = hits * 10000 / (hits + misses); - grub_printf ("(%lu.%lu%%)\n", ratio / 100, ratio % 100); - grub_printf_ (N_("Disk cache statistics: hits = %lu (%lu.%02lu%%)," + VasEBoot_printf ("(%lu.%lu%%)\n", ratio / 100, ratio % 100); + VasEBoot_printf_ (N_("Disk cache statistics: hits = %lu (%lu.%02lu%%)," " misses = %lu\n"), ratio / 100, ratio % 100, hits, misses); } else - grub_printf ("%s\n", _("No disk cache statistics available\n")); + VasEBoot_printf ("%s\n", _("No disk cache statistics available\n")); return 0; } -static grub_command_t cmd_cacheinfo; +static VasEBoot_command_t cmd_cacheinfo; -GRUB_MOD_INIT(cacheinfo) +VasEBoot_MOD_INIT(cacheinfo) { cmd_cacheinfo = - grub_register_command ("cacheinfo", grub_rescue_cmd_info, + VasEBoot_register_command ("cacheinfo", VasEBoot_rescue_cmd_info, 0, N_("Get disk cache info.")); } -GRUB_MOD_FINI(cacheinfo) +VasEBoot_MOD_FINI(cacheinfo) { - grub_unregister_command (cmd_cacheinfo); + VasEBoot_unregister_command (cmd_cacheinfo); } diff --git a/VasEBoot-core/commands/cat.c b/VasEBoot-core/commands/cat.c index 88d904436..b1bde69d5 100644 --- a/VasEBoot-core/commands/cat.c +++ b/VasEBoot-core/commands/cat.c @@ -1,51 +1,51 @@ /* cat.c - command to show the contents of a file */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"dos", -1, 0, N_("Accept DOS-style CR/NL line endings."), 0, 0}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_cat (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; int dos = 0; - grub_file_t file; - unsigned char buf[GRUB_DISK_SECTOR_SIZE]; - grub_ssize_t size; - int key = GRUB_TERM_NO_KEY; - grub_uint32_t code = 0; + VasEBoot_file_t file; + unsigned char buf[VasEBoot_DISK_SECTOR_SIZE]; + VasEBoot_ssize_t size; + int key = VasEBoot_TERM_NO_KEY; + VasEBoot_uint32_t code = 0; int count = 0; - unsigned char utbuf[GRUB_MAX_UTF8_PER_CODEPOINT + 1]; + unsigned char utbuf[VasEBoot_MAX_UTF8_PER_CODEPOINT + 1]; int utcount = 0; int is_0d = 0; int j; @@ -54,14 +54,14 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args) dos = 1; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - while ((size = grub_file_read (file, buf, sizeof (buf))) > 0 - && key != GRUB_TERM_ESC) + while ((size = VasEBoot_file_read (file, buf, sizeof (buf))) > 0 + && key != VasEBoot_TERM_ESC) { int i; @@ -71,39 +71,39 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args) if (is_0d && buf[i] != '\n') { - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - grub_printf ("<%x>", (int) '\r'); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); + VasEBoot_printf ("<%x>", (int) '\r'); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); } is_0d = 0; - if (!grub_utf8_process (buf[i], &code, &count)) + if (!VasEBoot_utf8_process (buf[i], &code, &count)) { - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); for (j = 0; j < utcount - 1; j++) - grub_printf ("<%x>", (unsigned int) utbuf[j]); + VasEBoot_printf ("<%x>", (unsigned int) utbuf[j]); code = 0; count = 0; - if (utcount == 1 || !grub_utf8_process (buf[i], &code, &count)) + if (utcount == 1 || !VasEBoot_utf8_process (buf[i], &code, &count)) { - grub_printf ("<%x>", (unsigned int) buf[i]); + VasEBoot_printf ("<%x>", (unsigned int) buf[i]); code = 0; count = 0; utcount = 0; - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); continue; } - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); utcount = 1; } if (count) continue; - if ((code >= 0xa1 || grub_isprint (code) - || grub_isspace (code)) && code != '\r') + if ((code >= 0xa1 || VasEBoot_isprint (code) + || VasEBoot_isspace (code)) && code != '\r') { - grub_printf ("%C", code); + VasEBoot_printf ("%C", code); count = 0; code = 0; utcount = 0; @@ -119,52 +119,52 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args) continue; } - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); for (j = 0; j < utcount; j++) - grub_printf ("<%x>", (unsigned int) utbuf[j]); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_printf ("<%x>", (unsigned int) utbuf[j]); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); count = 0; code = 0; utcount = 0; } do - key = grub_getkey_noblock (); - while (key != GRUB_TERM_ESC && key != GRUB_TERM_NO_KEY); + key = VasEBoot_getkey_noblock (); + while (key != VasEBoot_TERM_ESC && key != VasEBoot_TERM_NO_KEY); } if (is_0d) { - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - grub_printf ("<%x>", (unsigned int) '\r'); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); + VasEBoot_printf ("<%x>", (unsigned int) '\r'); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); } if (utcount) { - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); for (j = 0; j < utcount; j++) - grub_printf ("<%x>", (unsigned int) utbuf[j]); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_printf ("<%x>", (unsigned int) utbuf[j]); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); } - grub_xputs ("\n"); - grub_refresh (); - grub_file_close (file); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); + VasEBoot_file_close (file); return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(cat) +VasEBoot_MOD_INIT(cat) { - cmd = grub_register_extcmd ("cat", grub_cmd_cat, 0, + cmd = VasEBoot_register_extcmd ("cat", VasEBoot_cmd_cat, 0, N_("FILE"), N_("Show the contents of a file."), options); } -GRUB_MOD_FINI(cat) +VasEBoot_MOD_FINI(cat) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/cmp.c b/VasEBoot-core/commands/cmp.c index cc23ee67e..0f5152c0e 100644 --- a/VasEBoot-core/commands/cmp.c +++ b/VasEBoot-core/commands/cmp.c @@ -1,65 +1,65 @@ /* cmd.c - command to cmp an operating system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define BUFFER_SIZE 512 -static grub_err_t -grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cmp (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_ssize_t rd1, rd2; - grub_off_t pos; - grub_file_t file1 = 0; - grub_file_t file2 = 0; + VasEBoot_ssize_t rd1, rd2; + VasEBoot_off_t pos; + VasEBoot_file_t file1 = 0; + VasEBoot_file_t file2 = 0; char *buf1 = 0; char *buf2 = 0; if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); - grub_printf_ (N_("Compare file `%s' with `%s':\n"), args[0], + VasEBoot_printf_ (N_("Compare file `%s' with `%s':\n"), args[0], args[1]); - file1 = grub_file_open (args[0]); - file2 = grub_file_open (args[1]); + file1 = VasEBoot_file_open (args[0]); + file2 = VasEBoot_file_open (args[1]); if (! file1 || ! file2) goto cleanup; - if (grub_file_size (file1) != grub_file_size (file2)) - grub_printf_ (N_("Files differ in size: %llu [%s], %llu [%s]\n"), - (unsigned long long) grub_file_size (file1), args[0], - (unsigned long long) grub_file_size (file2), args[1]); + if (VasEBoot_file_size (file1) != VasEBoot_file_size (file2)) + VasEBoot_printf_ (N_("Files differ in size: %llu [%s], %llu [%s]\n"), + (unsigned long long) VasEBoot_file_size (file1), args[0], + (unsigned long long) VasEBoot_file_size (file2), args[1]); else { pos = 0; - buf1 = grub_malloc (BUFFER_SIZE); - buf2 = grub_malloc (BUFFER_SIZE); + buf1 = VasEBoot_malloc (BUFFER_SIZE); + buf2 = VasEBoot_malloc (BUFFER_SIZE); if (! buf1 || ! buf2) goto cleanup; @@ -68,8 +68,8 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), { int i; - rd1 = grub_file_read (file1, buf1, BUFFER_SIZE); - rd2 = grub_file_read (file2, buf2, BUFFER_SIZE); + rd1 = VasEBoot_file_read (file1, buf1, BUFFER_SIZE); + rd2 = VasEBoot_file_read (file2, buf2, BUFFER_SIZE); if (rd1 != rd2) goto cleanup; @@ -78,7 +78,7 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), { if (buf1[i] != buf2[i]) { - grub_printf_ (N_("Files differ at the offset %llu: 0x%x [%s], 0x%x [%s]\n"), + VasEBoot_printf_ (N_("Files differ at the offset %llu: 0x%x [%s], 0x%x [%s]\n"), (unsigned long long) (i + pos), buf1[i], args[0], buf2[i], args[1]); goto cleanup; @@ -90,30 +90,30 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), while (rd2); /* TRANSLATORS: it's always exactly 2 files. */ - grub_printf_ (N_("The files are identical.\n")); + VasEBoot_printf_ (N_("The files are identical.\n")); } cleanup: - grub_free (buf1); - grub_free (buf2); + VasEBoot_free (buf1); + VasEBoot_free (buf2); if (file1) - grub_file_close (file1); + VasEBoot_file_close (file1); if (file2) - grub_file_close (file2); + VasEBoot_file_close (file2); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(cmp) +VasEBoot_MOD_INIT(cmp) { - cmd = grub_register_command ("cmp", grub_cmd_cmp, + cmd = VasEBoot_register_command ("cmp", VasEBoot_cmd_cmp, N_("FILE1 FILE2"), N_("Compare two files.")); } -GRUB_MOD_FINI(cmp) +VasEBoot_MOD_FINI(cmp) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/configfile.c b/VasEBoot-core/commands/configfile.c index f2d2abb5f..efe13b6e1 100644 --- a/VasEBoot-core/commands/configfile.c +++ b/VasEBoot-core/commands/configfile.c @@ -1,98 +1,98 @@ /* configfile.c - command to manually load config file */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_source (grub_command_t cmd, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_source (VasEBoot_command_t cmd, int argc, char **args) { int new_env, extractor; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); extractor = (cmd->name[0] == 'e'); new_env = (cmd->name[extractor ? sizeof ("extract_entries_") - 1 : 0] == 'c'); if (new_env) - grub_cls (); + VasEBoot_cls (); if (new_env && !extractor) - grub_env_context_open (); + VasEBoot_env_context_open (); if (extractor) - grub_env_extractor_open (!new_env); + VasEBoot_env_extractor_open (!new_env); - grub_normal_execute (args[0], 1, ! new_env); + VasEBoot_normal_execute (args[0], 1, ! new_env); if (new_env && !extractor) - grub_env_context_close (); + VasEBoot_env_context_close (); if (extractor) - grub_env_extractor_close (!new_env); + VasEBoot_env_extractor_close (!new_env); return 0; } -static grub_command_t cmd_configfile, cmd_source, cmd_dot; -static grub_command_t cmd_extractor_source, cmd_extractor_configfile; +static VasEBoot_command_t cmd_configfile, cmd_source, cmd_dot; +static VasEBoot_command_t cmd_extractor_source, cmd_extractor_configfile; -GRUB_MOD_INIT(configfile) +VasEBoot_MOD_INIT(configfile) { cmd_configfile = - grub_register_command ("configfile", grub_cmd_source, + VasEBoot_register_command ("configfile", VasEBoot_cmd_source, N_("FILE"), N_("Load another config file.")); cmd_source = - grub_register_command ("source", grub_cmd_source, + VasEBoot_register_command ("source", VasEBoot_cmd_source, N_("FILE"), N_("Load another config file without changing context.") ); cmd_extractor_source = - grub_register_command ("extract_entries_source", grub_cmd_source, + VasEBoot_register_command ("extract_entries_source", VasEBoot_cmd_source, N_("FILE"), N_("Load another config file without changing context but take only menu entries.") ); cmd_extractor_configfile = - grub_register_command ("extract_entries_configfile", grub_cmd_source, + VasEBoot_register_command ("extract_entries_configfile", VasEBoot_cmd_source, N_("FILE"), N_("Load another config file but take only menu entries.") ); cmd_dot = - grub_register_command (".", grub_cmd_source, + VasEBoot_register_command (".", VasEBoot_cmd_source, N_("FILE"), N_("Load another config file without changing context.") ); } -GRUB_MOD_FINI(configfile) +VasEBoot_MOD_FINI(configfile) { - grub_unregister_command (cmd_configfile); - grub_unregister_command (cmd_source); - grub_unregister_command (cmd_extractor_configfile); - grub_unregister_command (cmd_extractor_source); - grub_unregister_command (cmd_dot); + VasEBoot_unregister_command (cmd_configfile); + VasEBoot_unregister_command (cmd_source); + VasEBoot_unregister_command (cmd_extractor_configfile); + VasEBoot_unregister_command (cmd_extractor_source); + VasEBoot_unregister_command (cmd_dot); } diff --git a/VasEBoot-core/commands/date.c b/VasEBoot-core/commands/date.c index 8e1f41f14..53ce63367 100644 --- a/VasEBoot-core/commands/date.c +++ b/VasEBoot-core/commands/date.c @@ -1,60 +1,60 @@ /* date.c - command to display/set current datetime. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_DATETIME_SET_YEAR 1 -#define GRUB_DATETIME_SET_MONTH 2 -#define GRUB_DATETIME_SET_DAY 4 -#define GRUB_DATETIME_SET_HOUR 8 -#define GRUB_DATETIME_SET_MINUTE 16 -#define GRUB_DATETIME_SET_SECOND 32 +#define VasEBoot_DATETIME_SET_YEAR 1 +#define VasEBoot_DATETIME_SET_MONTH 2 +#define VasEBoot_DATETIME_SET_DAY 4 +#define VasEBoot_DATETIME_SET_HOUR 8 +#define VasEBoot_DATETIME_SET_MINUTE 16 +#define VasEBoot_DATETIME_SET_SECOND 32 -static grub_err_t -grub_cmd_date (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_date (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_datetime datetime; + struct VasEBoot_datetime datetime; int limit[6][2] = {{1980, 2079}, {1, 12}, {1, 31}, {0, 23}, {0, 59}, {0, 59}}; int value[6], mask; if (argc == 0) { - if (grub_get_datetime (&datetime)) - return grub_errno; + if (VasEBoot_get_datetime (&datetime)) + return VasEBoot_errno; - grub_printf ("%d-%02d-%02d %02d:%02d:%02d %s\n", + VasEBoot_printf ("%d-%02d-%02d %02d:%02d:%02d %s\n", datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second, - grub_get_weekday_name (&datetime)); + VasEBoot_get_weekday_name (&datetime)); return 0; } - grub_memset (&value, 0, sizeof (value)); + VasEBoot_memset (&value, 0, sizeof (value)); mask = 0; for (; argc; argc--, args++) @@ -63,7 +63,7 @@ grub_cmd_date (grub_command_t cmd __attribute__ ((unused)), int m1, ofs, n, cur_mask; p = args[0]; - m1 = grub_strtoul (p, &p, 10); + m1 = VasEBoot_strtoul (p, &p, 10); c = *p; if (c == '-') @@ -82,7 +82,7 @@ grub_cmd_date (grub_command_t cmd __attribute__ ((unused)), if (*p != c) goto fail; - value[ofs + n] = grub_strtoul (p + 1, &p, 10); + value[ofs + n] = VasEBoot_strtoul (p + 1, &p, 10); cur_mask |= (1 << (ofs + n)); } @@ -105,44 +105,44 @@ grub_cmd_date (grub_command_t cmd __attribute__ ((unused)), mask |= cur_mask; } - if (grub_get_datetime (&datetime)) - return grub_errno; + if (VasEBoot_get_datetime (&datetime)) + return VasEBoot_errno; - if (mask & GRUB_DATETIME_SET_YEAR) + if (mask & VasEBoot_DATETIME_SET_YEAR) datetime.year = value[0]; - if (mask & GRUB_DATETIME_SET_MONTH) + if (mask & VasEBoot_DATETIME_SET_MONTH) datetime.month = value[1]; - if (mask & GRUB_DATETIME_SET_DAY) + if (mask & VasEBoot_DATETIME_SET_DAY) datetime.day = value[2]; - if (mask & GRUB_DATETIME_SET_HOUR) + if (mask & VasEBoot_DATETIME_SET_HOUR) datetime.hour = value[3]; - if (mask & GRUB_DATETIME_SET_MINUTE) + if (mask & VasEBoot_DATETIME_SET_MINUTE) datetime.minute = value[4]; - if (mask & GRUB_DATETIME_SET_SECOND) + if (mask & VasEBoot_DATETIME_SET_SECOND) datetime.second = value[5]; - return grub_set_datetime (&datetime); + return VasEBoot_set_datetime (&datetime); fail: - return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid datetime"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid datetime"); } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(date) +VasEBoot_MOD_INIT(date) { cmd = - grub_register_command ("date", grub_cmd_date, + VasEBoot_register_command ("date", VasEBoot_cmd_date, N_("[[year-]month-day] [hour:minute[:second]]"), N_("Display/set current datetime.")); } -GRUB_MOD_FINI(date) +VasEBoot_MOD_FINI(date) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/echo.c b/VasEBoot-core/commands/echo.c index 81ba50d68..e36fe7e1e 100644 --- a/VasEBoot-core/commands/echo.c +++ b/VasEBoot-core/commands/echo.c @@ -1,41 +1,41 @@ /* echo.c - Command to display a line of text */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {0, 'n', 0, N_("Do not output the trailing newline."), 0, 0}, {0, 'e', 0, N_("Enable interpretation of backslash escapes."), 0, 0}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_echo (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_echo (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; int newline = 1; int i; @@ -47,12 +47,12 @@ grub_cmd_echo (grub_extcmd_context_t ctxt, int argc, char **args) { char *arg = *args; /* Unescaping results in a string no longer than the original. */ - char *unescaped = grub_malloc (grub_strlen (arg) + 1); + char *unescaped = VasEBoot_malloc (VasEBoot_strlen (arg) + 1); char *p = unescaped; args++; if (!unescaped) - return grub_errno; + return VasEBoot_errno; while (*arg) { @@ -108,34 +108,34 @@ grub_cmd_echo (grub_extcmd_context_t ctxt, int argc, char **args) } *p = '\0'; - grub_xputs (unescaped); - grub_free (unescaped); + VasEBoot_xputs (unescaped); + VasEBoot_free (unescaped); /* If another argument follows, insert a space. */ if (i != argc - 1) - grub_printf (" " ); + VasEBoot_printf (" " ); } if (newline) - grub_printf ("\n"); + VasEBoot_printf ("\n"); - grub_refresh (); + VasEBoot_refresh (); return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(echo) +VasEBoot_MOD_INIT(echo) { - cmd = grub_register_extcmd ("echo", grub_cmd_echo, - GRUB_COMMAND_ACCEPT_DASH - | GRUB_COMMAND_OPTIONS_AT_START, + cmd = VasEBoot_register_extcmd ("echo", VasEBoot_cmd_echo, + VasEBoot_COMMAND_ACCEPT_DASH + | VasEBoot_COMMAND_OPTIONS_AT_START, N_("[-e|-n] STRING"), N_("Display a line of text."), options); } -GRUB_MOD_FINI(echo) +VasEBoot_MOD_FINI(echo) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/efi/efifwsetup.c b/VasEBoot-core/commands/efi/efifwsetup.c index 7a137a72a..88e2eaa18 100644 --- a/VasEBoot-core/commands/efi/efifwsetup.c +++ b/VasEBoot-core/commands/efi/efifwsetup.c @@ -1,90 +1,90 @@ /* fwsetup.c - Reboot into firmware setup menu. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_fwsetup (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_fwsetup (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_efi_uint64_t *old_os_indications; - grub_efi_uint64_t os_indications = GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI; - grub_err_t status; - grub_size_t oi_size; - grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID; + VasEBoot_efi_uint64_t *old_os_indications; + VasEBoot_efi_uint64_t os_indications = VasEBoot_EFI_OS_INDICATIONS_BOOT_TO_FW_UI; + VasEBoot_err_t status; + VasEBoot_size_t oi_size; + VasEBoot_efi_guid_t global = VasEBoot_EFI_GLOBAL_VARIABLE_GUID; - old_os_indications = grub_efi_get_variable ("OsIndications", &global, + old_os_indications = VasEBoot_efi_get_variable ("OsIndications", &global, &oi_size); if (old_os_indications != NULL && oi_size == sizeof (os_indications)) os_indications |= *old_os_indications; - status = grub_efi_set_variable ("OsIndications", &global, &os_indications, + status = VasEBoot_efi_set_variable ("OsIndications", &global, &os_indications, sizeof (os_indications)); - if (status != GRUB_ERR_NONE) + if (status != VasEBoot_ERR_NONE) return status; - grub_reboot (); + VasEBoot_reboot (); - return GRUB_ERR_BUG; + return VasEBoot_ERR_BUG; } -static grub_command_t cmd = NULL; +static VasEBoot_command_t cmd = NULL; -static grub_efi_boolean_t +static VasEBoot_efi_boolean_t efifwsetup_is_supported (void) { - grub_efi_uint64_t *os_indications_supported = NULL; - grub_size_t oi_size = 0; - grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID; + VasEBoot_efi_uint64_t *os_indications_supported = NULL; + VasEBoot_size_t oi_size = 0; + VasEBoot_efi_guid_t global = VasEBoot_EFI_GLOBAL_VARIABLE_GUID; - os_indications_supported = grub_efi_get_variable ("OsIndicationsSupported", + os_indications_supported = VasEBoot_efi_get_variable ("OsIndicationsSupported", &global, &oi_size); if (!os_indications_supported) return 0; - if (*os_indications_supported & GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI) + if (*os_indications_supported & VasEBoot_EFI_OS_INDICATIONS_BOOT_TO_FW_UI) return 1; return 0; } -GRUB_MOD_INIT (efifwsetup) +VasEBoot_MOD_INIT (efifwsetup) { if (efifwsetup_is_supported ()) - cmd = grub_register_command ("fwsetup", grub_cmd_fwsetup, NULL, + cmd = VasEBoot_register_command ("fwsetup", VasEBoot_cmd_fwsetup, NULL, N_("Reboot into firmware setup menu.")); } -GRUB_MOD_FINI (efifwsetup) +VasEBoot_MOD_FINI (efifwsetup) { if (cmd) - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/efi/fixvideo.c b/VasEBoot-core/commands/efi/fixvideo.c index d9d54a2e8..788171a0e 100644 --- a/VasEBoot-core/commands/efi/fixvideo.c +++ b/VasEBoot-core/commands/efi/fixvideo.c @@ -1,39 +1,39 @@ /* fixvideo.c - fix video problem in efi */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static struct grub_video_patch +static struct VasEBoot_video_patch { const char *name; - grub_uint32_t pci_id; - grub_uint32_t mmio_bar; - grub_uint32_t mmio_reg; - grub_uint32_t mmio_old; + VasEBoot_uint32_t pci_id; + VasEBoot_uint32_t mmio_bar; + VasEBoot_uint32_t mmio_reg; + VasEBoot_uint32_t mmio_old; } video_patches[] = { {"Intel 945GM", 0x27a28086, 0, 0x71184, 0x1000000}, /* DSPBBASE */ @@ -42,40 +42,40 @@ static struct grub_video_patch }; static int -scan_card (grub_pci_device_t dev, grub_pci_id_t pciid, +scan_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_pci_address_t addr; + VasEBoot_pci_address_t addr; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - if (grub_pci_read_byte (addr + 3) == 0x3) + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + if (VasEBoot_pci_read_byte (addr + 3) == 0x3) { - struct grub_video_patch *p = video_patches; + struct VasEBoot_video_patch *p = video_patches; while (p->name) { if (p->pci_id == pciid) { - grub_addr_t base; + VasEBoot_addr_t base; - grub_dprintf ("fixvideo", "Found graphic card: %s\n", p->name); + VasEBoot_dprintf ("fixvideo", "Found graphic card: %s\n", p->name); addr += 8 + p->mmio_bar * 4; - base = grub_pci_read (addr); - if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) || - (base & GRUB_PCI_ADDR_MEM_PREFETCH)) - grub_dprintf ("fixvideo", "Invalid MMIO bar %d\n", p->mmio_bar); + base = VasEBoot_pci_read (addr); + if ((! base) || (base & VasEBoot_PCI_ADDR_SPACE_IO) || + (base & VasEBoot_PCI_ADDR_MEM_PREFETCH)) + VasEBoot_dprintf ("fixvideo", "Invalid MMIO bar %d\n", p->mmio_bar); else { - base &= GRUB_PCI_ADDR_MEM_MASK; + base &= VasEBoot_PCI_ADDR_MEM_MASK; base += p->mmio_reg; - if (*((volatile grub_uint32_t *) base) != p->mmio_old) - grub_dprintf ("fixvideo", "Old value doesn't match\n"); + if (*((volatile VasEBoot_uint32_t *) base) != p->mmio_old) + VasEBoot_dprintf ("fixvideo", "Old value doesn't match\n"); else { - *((volatile grub_uint32_t *) base) = 0; - if (*((volatile grub_uint32_t *) base)) - grub_dprintf ("fixvideo", "Setting MMIO fails\n"); + *((volatile VasEBoot_uint32_t *) base) = 0; + if (*((volatile VasEBoot_uint32_t *) base)) + VasEBoot_dprintf ("fixvideo", "Setting MMIO fails\n"); } } @@ -84,31 +84,31 @@ scan_card (grub_pci_device_t dev, grub_pci_id_t pciid, p++; } - grub_dprintf ("fixvideo", "Unknown graphic card: %x\n", pciid); + VasEBoot_dprintf ("fixvideo", "Unknown graphic card: %x\n", pciid); } return 0; } -static grub_err_t -grub_cmd_fixvideo (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_fixvideo (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_pci_iterate (scan_card, NULL); + VasEBoot_pci_iterate (scan_card, NULL); return 0; } -static grub_command_t cmd_fixvideo; +static VasEBoot_command_t cmd_fixvideo; -GRUB_MOD_INIT(fixvideo) +VasEBoot_MOD_INIT(fixvideo) { - cmd_fixvideo = grub_register_command ("fix_video", grub_cmd_fixvideo, + cmd_fixvideo = VasEBoot_register_command ("fix_video", VasEBoot_cmd_fixvideo, 0, N_("Fix video problem.")); } -GRUB_MOD_FINI(fixvideo) +VasEBoot_MOD_FINI(fixvideo) { - grub_unregister_command (cmd_fixvideo); + VasEBoot_unregister_command (cmd_fixvideo); } diff --git a/VasEBoot-core/commands/efi/getenv.c b/VasEBoot-core/commands/efi/getenv.c index 7eb2c4506..b9ab2960d 100644 --- a/VasEBoot-core/commands/efi/getenv.c +++ b/VasEBoot-core/commands/efi/getenv.c @@ -1,35 +1,35 @@ /* getenv.c - retrieve EFI variables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * Copyright (C) 2014 CoreOS, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options_getenv[] = { +static const struct VasEBoot_arg_option options_getenv[] = { {"var-name", 'e', 0, N_("Environment variable to query"), N_("VARNAME"), ARG_TYPE_STRING}, @@ -49,105 +49,105 @@ enum options_getenv GETENV_BINARY, }; -static grub_err_t -grub_cmd_getenv (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_getenv (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; char *envvar = NULL, *guid = NULL, *bindata = NULL, *data = NULL; - grub_size_t datasize; - grub_efi_guid_t efi_var_guid; - grub_efi_boolean_t binary = state[GETENV_BINARY].set; + VasEBoot_size_t datasize; + VasEBoot_efi_guid_t efi_var_guid; + VasEBoot_efi_boolean_t binary = state[GETENV_BINARY].set; unsigned int i; if (!state[GETENV_VAR_NAME].set || !state[GETENV_VAR_GUID].set) { - grub_error (GRUB_ERR_INVALID_COMMAND, N_("-e and -g are required")); + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, N_("-e and -g are required")); goto done; } if (argc != 1) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unexpected arguments")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unexpected arguments")); goto done; } envvar = state[GETENV_VAR_NAME].arg; guid = state[GETENV_VAR_GUID].arg; - if (grub_strlen(guid) != 36 || + if (VasEBoot_strlen(guid) != 36 || guid[8] != '-' || guid[13] != '-' || guid[18] != '-' || guid[23] != '-') { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid GUID")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid GUID")); goto done; } /* Forgive me father for I have sinned */ guid[8] = 0; - efi_var_guid.data1 = grub_strtoul(guid, NULL, 16); + efi_var_guid.data1 = VasEBoot_strtoul(guid, NULL, 16); guid[13] = 0; - efi_var_guid.data2 = grub_strtoul(guid + 9, NULL, 16); + efi_var_guid.data2 = VasEBoot_strtoul(guid + 9, NULL, 16); guid[18] = 0; - efi_var_guid.data3 = grub_strtoul(guid + 14, NULL, 16); - efi_var_guid.data4[7] = grub_strtoul(guid + 34, NULL, 16); + efi_var_guid.data3 = VasEBoot_strtoul(guid + 14, NULL, 16); + efi_var_guid.data4[7] = VasEBoot_strtoul(guid + 34, NULL, 16); guid[34] = 0; - efi_var_guid.data4[6] = grub_strtoul(guid + 32, NULL, 16); + efi_var_guid.data4[6] = VasEBoot_strtoul(guid + 32, NULL, 16); guid[32] = 0; - efi_var_guid.data4[5] = grub_strtoul(guid + 30, NULL, 16); + efi_var_guid.data4[5] = VasEBoot_strtoul(guid + 30, NULL, 16); guid[30] = 0; - efi_var_guid.data4[4] = grub_strtoul(guid + 28, NULL, 16); + efi_var_guid.data4[4] = VasEBoot_strtoul(guid + 28, NULL, 16); guid[28] = 0; - efi_var_guid.data4[3] = grub_strtoul(guid + 26, NULL, 16); + efi_var_guid.data4[3] = VasEBoot_strtoul(guid + 26, NULL, 16); guid[26] = 0; - efi_var_guid.data4[2] = grub_strtoul(guid + 24, NULL, 16); + efi_var_guid.data4[2] = VasEBoot_strtoul(guid + 24, NULL, 16); guid[23] = 0; - efi_var_guid.data4[1] = grub_strtoul(guid + 21, NULL, 16); + efi_var_guid.data4[1] = VasEBoot_strtoul(guid + 21, NULL, 16); guid[21] = 0; - efi_var_guid.data4[0] = grub_strtoul(guid + 19, NULL, 16); + efi_var_guid.data4[0] = VasEBoot_strtoul(guid + 19, NULL, 16); - data = grub_efi_get_variable(envvar, &efi_var_guid, &datasize); + data = VasEBoot_efi_get_variable(envvar, &efi_var_guid, &datasize); if (!data || !datasize) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("No such variable")); + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("No such variable")); goto done; } if (binary) { - bindata = grub_zalloc(datasize * 2 + 1); + bindata = VasEBoot_zalloc(datasize * 2 + 1); for (i=0; i. + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; -static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; -static grub_efi_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID; -static grub_efi_guid_t smbios3_guid = GRUB_EFI_SMBIOS3_TABLE_GUID; +static VasEBoot_efi_guid_t acpi_guid = VasEBoot_EFI_ACPI_TABLE_GUID; +static VasEBoot_efi_guid_t acpi2_guid = VasEBoot_EFI_ACPI_20_TABLE_GUID; +static VasEBoot_efi_guid_t smbios_guid = VasEBoot_EFI_SMBIOS_TABLE_GUID; +static VasEBoot_efi_guid_t smbios3_guid = VasEBoot_EFI_SMBIOS3_TABLE_GUID; #define EBDA_SEG_ADDR 0x40e #define LOW_MEM_ADDR 0x413 @@ -43,32 +43,32 @@ static grub_efi_guid_t smbios3_guid = GRUB_EFI_SMBIOS3_TABLE_GUID; static int enable_rom_area (void) { - grub_pci_address_t addr; - grub_uint32_t *rom_ptr; - grub_pci_device_t dev = { .bus = 0, .device = 0, .function = 0}; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t *rom_ptr; + VasEBoot_pci_device_t dev = { .bus = 0, .device = 0, .function = 0}; - rom_ptr = (grub_uint32_t *) VBIOS_ADDR; + rom_ptr = (VasEBoot_uint32_t *) VBIOS_ADDR; if (*rom_ptr != BLANK_MEM) { - grub_puts_ (N_("ROM image is present.")); + VasEBoot_puts_ (N_("ROM image is present.")); return 0; } /* FIXME: should be macroified. */ - addr = grub_pci_make_address (dev, 144); - grub_pci_write_byte (addr++, 0x30); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr, 0); + addr = VasEBoot_pci_make_address (dev, 144); + VasEBoot_pci_write_byte (addr++, 0x30); + VasEBoot_pci_write_byte (addr++, 0x33); + VasEBoot_pci_write_byte (addr++, 0x33); + VasEBoot_pci_write_byte (addr++, 0x33); + VasEBoot_pci_write_byte (addr++, 0x33); + VasEBoot_pci_write_byte (addr++, 0x33); + VasEBoot_pci_write_byte (addr++, 0x33); + VasEBoot_pci_write_byte (addr, 0); *rom_ptr = 0; if (*rom_ptr != 0) { - grub_puts_ (N_("Can\'t enable ROM area.")); + VasEBoot_puts_ (N_("Can\'t enable ROM area.")); return 0; } @@ -78,16 +78,16 @@ enable_rom_area (void) static void lock_rom_area (void) { - grub_pci_address_t addr; - grub_pci_device_t dev = { .bus = 0, .device = 0, .function = 0}; + VasEBoot_pci_address_t addr; + VasEBoot_pci_device_t dev = { .bus = 0, .device = 0, .function = 0}; /* FIXME: should be macroified. */ - addr = grub_pci_make_address (dev, 144); - grub_pci_write_byte (addr++, 0x10); - grub_pci_write_byte (addr++, 0x11); - grub_pci_write_byte (addr++, 0x11); - grub_pci_write_byte (addr++, 0x11); - grub_pci_write_byte (addr, 0x11); + addr = VasEBoot_pci_make_address (dev, 144); + VasEBoot_pci_write_byte (addr++, 0x10); + VasEBoot_pci_write_byte (addr++, 0x11); + VasEBoot_pci_write_byte (addr++, 0x11); + VasEBoot_pci_write_byte (addr++, 0x11); + VasEBoot_pci_write_byte (addr, 0x11); } static void @@ -95,66 +95,66 @@ fake_bios_data (int use_rom) { unsigned i; void *acpi, *smbios, *smbios3; - grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; + VasEBoot_uint16_t *ebda_seg_ptr, *low_mem_ptr; - ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; - low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; + ebda_seg_ptr = (VasEBoot_uint16_t *) EBDA_SEG_ADDR; + low_mem_ptr = (VasEBoot_uint16_t *) LOW_MEM_ADDR; if ((*ebda_seg_ptr) || (*low_mem_ptr)) return; acpi = 0; smbios = 0; smbios3 = 0; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + for (i = 0; i < VasEBoot_efi_system_table->num_table_entries; i++) { - grub_efi_packed_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; + VasEBoot_efi_packed_guid_t *guid = + &VasEBoot_efi_system_table->configuration_table[i].vendor_guid; - if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) + if (! VasEBoot_memcmp (guid, &acpi2_guid, sizeof (VasEBoot_efi_guid_t))) { - acpi = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("efi", "ACPI2: %p\n", acpi); + acpi = VasEBoot_efi_system_table->configuration_table[i].vendor_table; + VasEBoot_dprintf ("efi", "ACPI2: %p\n", acpi); } - else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) + else if (! VasEBoot_memcmp (guid, &acpi_guid, sizeof (VasEBoot_efi_guid_t))) { void *t; - t = grub_efi_system_table->configuration_table[i].vendor_table; + t = VasEBoot_efi_system_table->configuration_table[i].vendor_table; if (! acpi) acpi = t; - grub_dprintf ("efi", "ACPI: %p\n", t); + VasEBoot_dprintf ("efi", "ACPI: %p\n", t); } - else if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_efi_guid_t))) + else if (! VasEBoot_memcmp (guid, &smbios_guid, sizeof (VasEBoot_efi_guid_t))) { - smbios = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("efi", "SMBIOS: %p\n", smbios); + smbios = VasEBoot_efi_system_table->configuration_table[i].vendor_table; + VasEBoot_dprintf ("efi", "SMBIOS: %p\n", smbios); } - else if (! grub_memcmp (guid, &smbios3_guid, sizeof (grub_efi_guid_t))) + else if (! VasEBoot_memcmp (guid, &smbios3_guid, sizeof (VasEBoot_efi_guid_t))) { - smbios3 = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("efi", "SMBIOS3: %p\n", smbios3); + smbios3 = VasEBoot_efi_system_table->configuration_table[i].vendor_table; + VasEBoot_dprintf ("efi", "SMBIOS3: %p\n", smbios3); } } *ebda_seg_ptr = FAKE_EBDA_SEG; *low_mem_ptr = (FAKE_EBDA_SEG >> 6); - *((grub_uint16_t *) (FAKE_EBDA_SEG << 4)) = 640 - *low_mem_ptr; + *((VasEBoot_uint16_t *) (FAKE_EBDA_SEG << 4)) = 640 - *low_mem_ptr; if (acpi) - grub_memcpy ((char *) ((FAKE_EBDA_SEG << 4) + 16), acpi, 1024 - 16); + VasEBoot_memcpy ((char *) ((FAKE_EBDA_SEG << 4) + 16), acpi, 1024 - 16); if (use_rom) { if (smbios) - grub_memcpy ((char *) SBIOS_ADDR, (char *) smbios, 31); + VasEBoot_memcpy ((char *) SBIOS_ADDR, (char *) smbios, 31); if (smbios3) - grub_memcpy ((char *) SBIOS_ADDR + 32, (char *) smbios3, 24); + VasEBoot_memcpy ((char *) SBIOS_ADDR + 32, (char *) smbios3, 24); } } -static grub_err_t -grub_cmd_fakebios (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_fakebios (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { @@ -169,66 +169,66 @@ grub_cmd_fakebios (struct grub_command *cmd __attribute__ ((unused)), return 0; } -static grub_err_t -grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_loadbios (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file; + VasEBoot_file_t file; int size; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); if (argc > 1) { - file = grub_file_open (argv[1]); + file = VasEBoot_file_open (argv[1]); if (! file) - return grub_errno; + return VasEBoot_errno; if (file->size != 4) - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid int10 dump size"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid int10 dump size"); else - grub_file_read (file, (void *) 0x40, 4); + VasEBoot_file_read (file, (void *) 0x40, 4); - grub_file_close (file); - if (grub_errno) - return grub_errno; + VasEBoot_file_close (file); + if (VasEBoot_errno) + return VasEBoot_errno; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; size = file->size; if ((size < 0x10000) || (size > 0x40000)) - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid bios dump size"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid bios dump size"); else if (enable_rom_area ()) { - grub_file_read (file, (void *) VBIOS_ADDR, size); + VasEBoot_file_read (file, (void *) VBIOS_ADDR, size); fake_bios_data (size <= 0x40000); lock_rom_area (); } - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } -static grub_command_t cmd_fakebios, cmd_loadbios; +static VasEBoot_command_t cmd_fakebios, cmd_loadbios; -GRUB_MOD_INIT(loadbios) +VasEBoot_MOD_INIT(loadbios) { - cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios, + cmd_fakebios = VasEBoot_register_command ("fakebios", VasEBoot_cmd_fakebios, 0, N_("Create BIOS-like structures for" " backward compatibility with" " existing OS.")); - cmd_loadbios = grub_register_command ("loadbios", grub_cmd_loadbios, + cmd_loadbios = VasEBoot_register_command ("loadbios", VasEBoot_cmd_loadbios, N_("BIOS_DUMP [INT10_DUMP]"), N_("Load BIOS dump.")); } -GRUB_MOD_FINI(loadbios) +VasEBoot_MOD_FINI(loadbios) { - grub_unregister_command (cmd_fakebios); - grub_unregister_command (cmd_loadbios); + VasEBoot_unregister_command (cmd_fakebios); + VasEBoot_unregister_command (cmd_loadbios); } diff --git a/VasEBoot-core/commands/efi/lsefi.c b/VasEBoot-core/commands/efi/lsefi.c index d901c3892..211b9c1d9 100644 --- a/VasEBoot-core/commands/efi/lsefi.c +++ b/VasEBoot-core/commands/efi/lsefi.c @@ -1,126 +1,126 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct known_protocol { - grub_efi_guid_t guid; + VasEBoot_efi_guid_t guid; const char *name; } known_protocols[] = { - { GRUB_EFI_DISK_IO_GUID, "disk" }, - { GRUB_EFI_BLOCK_IO_GUID, "block" }, - { GRUB_EFI_SERIAL_IO_GUID, "serial" }, - { GRUB_EFI_SIMPLE_NETWORK_GUID, "network" }, - { GRUB_EFI_PXE_GUID, "pxe" }, - { GRUB_EFI_DEVICE_PATH_GUID, "device path" }, - { GRUB_EFI_PCI_IO_GUID, "PCI" }, - { GRUB_EFI_PCI_ROOT_IO_GUID, "PCI root" }, - { GRUB_EFI_EDID_ACTIVE_GUID, "active EDID" }, - { GRUB_EFI_EDID_DISCOVERED_GUID, "discovered EDID" }, - { GRUB_EFI_EDID_OVERRIDE_GUID, "override EDID" }, - { GRUB_EFI_GOP_GUID, "GOP" }, - { GRUB_EFI_UGA_DRAW_GUID, "UGA draw" }, - { GRUB_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID, "simple text output" }, - { GRUB_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID, "simple text input" }, - { GRUB_EFI_SIMPLE_POINTER_PROTOCOL_GUID, "simple pointer" }, - { GRUB_EFI_CONSOLE_CONTROL_GUID, "console control" }, - { GRUB_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID, "absolute pointer" }, - { GRUB_EFI_DRIVER_BINDING_PROTOCOL_GUID, "EFI driver binding" }, - { GRUB_EFI_LOAD_FILE_PROTOCOL_GUID, "load file" }, - { GRUB_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, "simple FS" }, - { GRUB_EFI_TAPE_IO_PROTOCOL_GUID, "tape I/O" }, - { GRUB_EFI_UNICODE_COLLATION_PROTOCOL_GUID, "unicode collation" }, - { GRUB_EFI_SCSI_IO_PROTOCOL_GUID, "SCSI I/O" }, - { GRUB_EFI_USB2_HC_PROTOCOL_GUID, "USB host" }, - { GRUB_EFI_DEBUG_SUPPORT_PROTOCOL_GUID, "debug support" }, - { GRUB_EFI_DEBUGPORT_PROTOCOL_GUID, "debug port" }, - { GRUB_EFI_DECOMPRESS_PROTOCOL_GUID, "decompress" }, - { GRUB_EFI_LOADED_IMAGE_PROTOCOL_GUID, "loaded image" }, - { GRUB_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID, "device path to text" }, - { GRUB_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID, "device path utilities" }, - { GRUB_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID, "device path from text" }, - { GRUB_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID, "HII config routing" }, - { GRUB_EFI_HII_DATABASE_PROTOCOL_GUID, "HII database" }, - { GRUB_EFI_HII_STRING_PROTOCOL_GUID, "HII string" }, - { GRUB_EFI_HII_IMAGE_PROTOCOL_GUID, "HII image" }, - { GRUB_EFI_HII_FONT_PROTOCOL_GUID, "HII font" }, - { GRUB_EFI_COMPONENT_NAME2_PROTOCOL_GUID, "component name 2" }, - { GRUB_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID, + { VasEBoot_EFI_DISK_IO_GUID, "disk" }, + { VasEBoot_EFI_BLOCK_IO_GUID, "block" }, + { VasEBoot_EFI_SERIAL_IO_GUID, "serial" }, + { VasEBoot_EFI_SIMPLE_NETWORK_GUID, "network" }, + { VasEBoot_EFI_PXE_GUID, "pxe" }, + { VasEBoot_EFI_DEVICE_PATH_GUID, "device path" }, + { VasEBoot_EFI_PCI_IO_GUID, "PCI" }, + { VasEBoot_EFI_PCI_ROOT_IO_GUID, "PCI root" }, + { VasEBoot_EFI_EDID_ACTIVE_GUID, "active EDID" }, + { VasEBoot_EFI_EDID_DISCOVERED_GUID, "discovered EDID" }, + { VasEBoot_EFI_EDID_OVERRIDE_GUID, "override EDID" }, + { VasEBoot_EFI_GOP_GUID, "GOP" }, + { VasEBoot_EFI_UGA_DRAW_GUID, "UGA draw" }, + { VasEBoot_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID, "simple text output" }, + { VasEBoot_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID, "simple text input" }, + { VasEBoot_EFI_SIMPLE_POINTER_PROTOCOL_GUID, "simple pointer" }, + { VasEBoot_EFI_CONSOLE_CONTROL_GUID, "console control" }, + { VasEBoot_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID, "absolute pointer" }, + { VasEBoot_EFI_DRIVER_BINDING_PROTOCOL_GUID, "EFI driver binding" }, + { VasEBoot_EFI_LOAD_FILE_PROTOCOL_GUID, "load file" }, + { VasEBoot_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, "simple FS" }, + { VasEBoot_EFI_TAPE_IO_PROTOCOL_GUID, "tape I/O" }, + { VasEBoot_EFI_UNICODE_COLLATION_PROTOCOL_GUID, "unicode collation" }, + { VasEBoot_EFI_SCSI_IO_PROTOCOL_GUID, "SCSI I/O" }, + { VasEBoot_EFI_USB2_HC_PROTOCOL_GUID, "USB host" }, + { VasEBoot_EFI_DEBUG_SUPPORT_PROTOCOL_GUID, "debug support" }, + { VasEBoot_EFI_DEBUGPORT_PROTOCOL_GUID, "debug port" }, + { VasEBoot_EFI_DECOMPRESS_PROTOCOL_GUID, "decompress" }, + { VasEBoot_EFI_LOADED_IMAGE_PROTOCOL_GUID, "loaded image" }, + { VasEBoot_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID, "device path to text" }, + { VasEBoot_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID, "device path utilities" }, + { VasEBoot_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID, "device path from text" }, + { VasEBoot_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID, "HII config routing" }, + { VasEBoot_EFI_HII_DATABASE_PROTOCOL_GUID, "HII database" }, + { VasEBoot_EFI_HII_STRING_PROTOCOL_GUID, "HII string" }, + { VasEBoot_EFI_HII_IMAGE_PROTOCOL_GUID, "HII image" }, + { VasEBoot_EFI_HII_FONT_PROTOCOL_GUID, "HII font" }, + { VasEBoot_EFI_COMPONENT_NAME2_PROTOCOL_GUID, "component name 2" }, + { VasEBoot_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID, "HII configuration access" }, - { GRUB_EFI_USB_IO_PROTOCOL_GUID, "USB I/O" }, + { VasEBoot_EFI_USB_IO_PROTOCOL_GUID, "USB I/O" }, }; -static grub_err_t -grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsefi (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_efi_handle_t *handles; - grub_efi_uintn_t num_handles; + VasEBoot_efi_handle_t *handles; + VasEBoot_efi_uintn_t num_handles; unsigned i, j, k; - handles = grub_efi_locate_handle (GRUB_EFI_ALL_HANDLES, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_ALL_HANDLES, NULL, NULL, &num_handles); for (i = 0; i < num_handles; i++) { - grub_efi_handle_t handle = handles[i]; - grub_efi_status_t status; - grub_efi_uintn_t num_protocols; - grub_efi_packed_guid_t **protocols; - grub_efi_device_path_t *dp; + VasEBoot_efi_handle_t handle = handles[i]; + VasEBoot_efi_status_t status; + VasEBoot_efi_uintn_t num_protocols; + VasEBoot_efi_packed_guid_t **protocols; + VasEBoot_efi_device_path_t *dp; - grub_printf ("Handle %p\n", handle); + VasEBoot_printf ("Handle %p\n", handle); - dp = grub_efi_get_device_path (handle); + dp = VasEBoot_efi_get_device_path (handle); if (dp) { - grub_printf (" "); - grub_efi_print_device_path (dp); + VasEBoot_printf (" "); + VasEBoot_efi_print_device_path (dp); } - status = efi_call_3 (grub_efi_system_table->boot_services->protocols_per_handle, + status = efi_call_3 (VasEBoot_efi_system_table->boot_services->protocols_per_handle, handle, &protocols, &num_protocols); - if (status != GRUB_EFI_SUCCESS) - grub_printf ("Unable to retrieve protocols\n"); + if (status != VasEBoot_EFI_SUCCESS) + VasEBoot_printf ("Unable to retrieve protocols\n"); for (j = 0; j < num_protocols; j++) { for (k = 0; k < ARRAY_SIZE (known_protocols); k++) - if (grub_memcmp (protocols[j], &known_protocols[k].guid, + if (VasEBoot_memcmp (protocols[j], &known_protocols[k].guid, sizeof (known_protocols[k].guid)) == 0) break; if (k < ARRAY_SIZE (known_protocols)) - grub_printf (" %s\n", known_protocols[k].name); + VasEBoot_printf (" %s\n", known_protocols[k].name); else - grub_printf (" %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", + VasEBoot_printf (" %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", protocols[j]->data1, protocols[j]->data2, protocols[j]->data3, @@ -139,15 +139,15 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsefi) +VasEBoot_MOD_INIT(lsefi) { - cmd = grub_register_command ("lsefi", grub_cmd_lsefi, + cmd = VasEBoot_register_command ("lsefi", VasEBoot_cmd_lsefi, NULL, "Display EFI handles."); } -GRUB_MOD_FINI(lsefi) +VasEBoot_MOD_FINI(lsefi) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/efi/lsefimmap.c b/VasEBoot-core/commands/efi/lsefimmap.c index c85ff7f36..32d699054 100644 --- a/VasEBoot-core/commands/efi/lsefimmap.c +++ b/VasEBoot-core/commands/efi/lsefimmap.c @@ -1,55 +1,55 @@ /* lsefimemmap.c - Display memory map. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define ADD_MEMORY_DESCRIPTOR(desc, size) \ - ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + ((VasEBoot_efi_memory_descriptor_t *) ((char *) (desc) + (size))) -static grub_err_t -grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsefimmap (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_efi_uintn_t map_size; - grub_efi_memory_descriptor_t *memory_map; - grub_efi_memory_descriptor_t *memory_map_end; - grub_efi_memory_descriptor_t *desc; - grub_efi_uintn_t desc_size; + VasEBoot_efi_uintn_t map_size; + VasEBoot_efi_memory_descriptor_t *memory_map; + VasEBoot_efi_memory_descriptor_t *memory_map_end; + VasEBoot_efi_memory_descriptor_t *desc; + VasEBoot_efi_uintn_t desc_size; map_size = 0; - if (grub_efi_get_memory_map (&map_size, NULL, NULL, &desc_size, 0) < 0) + if (VasEBoot_efi_get_memory_map (&map_size, NULL, NULL, &desc_size, 0) < 0) return 0; - memory_map = grub_malloc (map_size); + memory_map = VasEBoot_malloc (map_size); if (memory_map == NULL) - return grub_errno; - if (grub_efi_get_memory_map (&map_size, memory_map, NULL, &desc_size, 0) <= 0) + return VasEBoot_errno; + if (VasEBoot_efi_get_memory_map (&map_size, memory_map, NULL, &desc_size, 0) <= 0) goto fail; - grub_printf + VasEBoot_printf ("Type Physical start - end #Pages " " Size Attributes\n"); memory_map_end = ADD_MEMORY_DESCRIPTOR (memory_map, map_size); @@ -57,8 +57,8 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), desc < memory_map_end; desc = ADD_MEMORY_DESCRIPTOR (desc, desc_size)) { - grub_efi_uint64_t size; - grub_efi_uint64_t attr; + VasEBoot_efi_uint64_t size; + VasEBoot_efi_uint64_t attr; static const char types_str[][9] = { "reserved", @@ -78,12 +78,12 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), "persist ", }; if (desc->type < ARRAY_SIZE (types_str)) - grub_printf ("%s ", types_str[desc->type]); + VasEBoot_printf ("%s ", types_str[desc->type]); else - grub_printf ("Unk %02x ", desc->type); + VasEBoot_printf ("Unk %02x ", desc->type); - grub_printf (" %016" PRIxGRUB_UINT64_T "-%016" PRIxGRUB_UINT64_T - " %08" PRIxGRUB_UINT64_T, + VasEBoot_printf (" %016" PRIxVasEBoot_UINT64_T "-%016" PRIxVasEBoot_UINT64_T + " %08" PRIxVasEBoot_UINT64_T, desc->physical_start, desc->physical_start + (desc->num_pages << 12) - 1, desc->num_pages); @@ -100,61 +100,61 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), * columns will be off if not, but this is preferable to rounding. */ if (size & 0xfffff) - grub_printf (" %6" PRIuGRUB_UINT64_T "KiB", size >> 10); + VasEBoot_printf (" %6" PRIuVasEBoot_UINT64_T "KiB", size >> 10); else if (size & 0x3fffffff) - grub_printf (" %6" PRIuGRUB_UINT64_T "MiB", size >> 20); + VasEBoot_printf (" %6" PRIuVasEBoot_UINT64_T "MiB", size >> 20); else if (size & 0xffffffffff) - grub_printf (" %6" PRIuGRUB_UINT64_T "GiB", size >> 30); + VasEBoot_printf (" %6" PRIuVasEBoot_UINT64_T "GiB", size >> 30); else if (size & 0x3ffffffffffff) - grub_printf (" %6" PRIuGRUB_UINT64_T "TiB", size >> 40); + VasEBoot_printf (" %6" PRIuVasEBoot_UINT64_T "TiB", size >> 40); else if (size & 0xfffffffffffffff) - grub_printf (" %6" PRIuGRUB_UINT64_T "PiB", size >> 50); + VasEBoot_printf (" %6" PRIuVasEBoot_UINT64_T "PiB", size >> 50); else - grub_printf (" %6" PRIuGRUB_UINT64_T "EiB", size >> 60); + VasEBoot_printf (" %6" PRIuVasEBoot_UINT64_T "EiB", size >> 60); attr = desc->attribute; - if (attr & GRUB_EFI_MEMORY_RUNTIME) - grub_printf (" RT"); - if (attr & GRUB_EFI_MEMORY_UC) - grub_printf (" UC"); - if (attr & GRUB_EFI_MEMORY_WC) - grub_printf (" WC"); - if (attr & GRUB_EFI_MEMORY_WT) - grub_printf (" WT"); - if (attr & GRUB_EFI_MEMORY_WB) - grub_printf (" WB"); - if (attr & GRUB_EFI_MEMORY_UCE) - grub_printf (" UCE"); - if (attr & GRUB_EFI_MEMORY_WP) - grub_printf (" WP"); - if (attr & GRUB_EFI_MEMORY_RP) - grub_printf (" RP"); - if (attr & GRUB_EFI_MEMORY_XP) - grub_printf (" XP"); - if (attr & GRUB_EFI_MEMORY_NV) - grub_printf (" NV"); - if (attr & GRUB_EFI_MEMORY_MORE_RELIABLE) - grub_printf (" MR"); - if (attr & GRUB_EFI_MEMORY_RO) - grub_printf (" RO"); + if (attr & VasEBoot_EFI_MEMORY_RUNTIME) + VasEBoot_printf (" RT"); + if (attr & VasEBoot_EFI_MEMORY_UC) + VasEBoot_printf (" UC"); + if (attr & VasEBoot_EFI_MEMORY_WC) + VasEBoot_printf (" WC"); + if (attr & VasEBoot_EFI_MEMORY_WT) + VasEBoot_printf (" WT"); + if (attr & VasEBoot_EFI_MEMORY_WB) + VasEBoot_printf (" WB"); + if (attr & VasEBoot_EFI_MEMORY_UCE) + VasEBoot_printf (" UCE"); + if (attr & VasEBoot_EFI_MEMORY_WP) + VasEBoot_printf (" WP"); + if (attr & VasEBoot_EFI_MEMORY_RP) + VasEBoot_printf (" RP"); + if (attr & VasEBoot_EFI_MEMORY_XP) + VasEBoot_printf (" XP"); + if (attr & VasEBoot_EFI_MEMORY_NV) + VasEBoot_printf (" NV"); + if (attr & VasEBoot_EFI_MEMORY_MORE_RELIABLE) + VasEBoot_printf (" MR"); + if (attr & VasEBoot_EFI_MEMORY_RO) + VasEBoot_printf (" RO"); - grub_printf ("\n"); + VasEBoot_printf ("\n"); } fail: - grub_free (memory_map); + VasEBoot_free (memory_map); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsefimmap) +VasEBoot_MOD_INIT(lsefimmap) { - cmd = grub_register_command ("lsefimmap", grub_cmd_lsefimmap, + cmd = VasEBoot_register_command ("lsefimmap", VasEBoot_cmd_lsefimmap, "", "Display EFI memory map."); } -GRUB_MOD_FINI(lsefimmap) +VasEBoot_MOD_FINI(lsefimmap) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/efi/lsefisystab.c b/VasEBoot-core/commands/efi/lsefisystab.c index 7c039c509..12046a4e7 100644 --- a/VasEBoot-core/commands/efi/lsefisystab.c +++ b/VasEBoot-core/commands/efi/lsefisystab.c @@ -1,122 +1,122 @@ /* lsefisystab.c - Display EFI systab. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct guid_mapping { - grub_efi_guid_t guid; + VasEBoot_efi_guid_t guid; const char *name; }; static const struct guid_mapping guid_mappings[] = { - { GRUB_EFI_ACPI_20_TABLE_GUID, "ACPI-2.0"}, - { GRUB_EFI_ACPI_TABLE_GUID, "ACPI-1.0"}, - { GRUB_EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID, + { VasEBoot_EFI_ACPI_20_TABLE_GUID, "ACPI-2.0"}, + { VasEBoot_EFI_ACPI_TABLE_GUID, "ACPI-1.0"}, + { VasEBoot_EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID, "CRC32 GUIDED SECTION EXTRACTION"}, - { GRUB_EFI_DEBUG_IMAGE_INFO_TABLE_GUID, "DEBUG IMAGE INFO"}, - { GRUB_EFI_DXE_SERVICES_TABLE_GUID, "DXE SERVICES"}, - { GRUB_EFI_HCDP_TABLE_GUID, "HCDP"}, - { GRUB_EFI_HOB_LIST_GUID, "HOB LIST"}, - { GRUB_EFI_LZMA_CUSTOM_DECOMPRESS_GUID, "LZMA CUSTOM DECOMPRESS"}, - { GRUB_EFI_MEMORY_TYPE_INFORMATION_GUID, "MEMORY TYPE INFO"}, - { GRUB_EFI_MPS_TABLE_GUID, "MPS"}, - { GRUB_EFI_SAL_TABLE_GUID, "SAL"}, - { GRUB_EFI_SMBIOS_TABLE_GUID, "SMBIOS"}, - { GRUB_EFI_SMBIOS3_TABLE_GUID, "SMBIOS3"}, - { GRUB_EFI_SYSTEM_RESOURCE_TABLE_GUID, "SYSTEM RESOURCE TABLE"}, - { GRUB_EFI_TIANO_CUSTOM_DECOMPRESS_GUID, "TIANO CUSTOM DECOMPRESS"}, - { GRUB_EFI_TSC_FREQUENCY_GUID, "TSC FREQUENCY"}, + { VasEBoot_EFI_DEBUG_IMAGE_INFO_TABLE_GUID, "DEBUG IMAGE INFO"}, + { VasEBoot_EFI_DXE_SERVICES_TABLE_GUID, "DXE SERVICES"}, + { VasEBoot_EFI_HCDP_TABLE_GUID, "HCDP"}, + { VasEBoot_EFI_HOB_LIST_GUID, "HOB LIST"}, + { VasEBoot_EFI_LZMA_CUSTOM_DECOMPRESS_GUID, "LZMA CUSTOM DECOMPRESS"}, + { VasEBoot_EFI_MEMORY_TYPE_INFORMATION_GUID, "MEMORY TYPE INFO"}, + { VasEBoot_EFI_MPS_TABLE_GUID, "MPS"}, + { VasEBoot_EFI_SAL_TABLE_GUID, "SAL"}, + { VasEBoot_EFI_SMBIOS_TABLE_GUID, "SMBIOS"}, + { VasEBoot_EFI_SMBIOS3_TABLE_GUID, "SMBIOS3"}, + { VasEBoot_EFI_SYSTEM_RESOURCE_TABLE_GUID, "SYSTEM RESOURCE TABLE"}, + { VasEBoot_EFI_TIANO_CUSTOM_DECOMPRESS_GUID, "TIANO CUSTOM DECOMPRESS"}, + { VasEBoot_EFI_TSC_FREQUENCY_GUID, "TSC FREQUENCY"}, }; -static grub_err_t -grub_cmd_lsefisystab (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsefisystab (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - const grub_efi_system_table_t *st = grub_efi_system_table; - grub_efi_configuration_table_t *t; + const VasEBoot_efi_system_table_t *st = VasEBoot_efi_system_table; + VasEBoot_efi_configuration_table_t *t; unsigned int i; - grub_printf ("Address: %p\n", st); - grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %08x\n", + VasEBoot_printf ("Address: %p\n", st); + VasEBoot_printf ("Signature: %016" PRIxVasEBoot_UINT64_T " revision: %08x\n", st->hdr.signature, st->hdr.revision); { char *vendor; - grub_uint16_t *vendor_utf16; - grub_printf ("Vendor: "); + VasEBoot_uint16_t *vendor_utf16; + VasEBoot_printf ("Vendor: "); for (vendor_utf16 = st->firmware_vendor; *vendor_utf16; vendor_utf16++); - vendor = grub_malloc (4 * (vendor_utf16 - st->firmware_vendor) + 1); + vendor = VasEBoot_malloc (4 * (vendor_utf16 - st->firmware_vendor) + 1); if (!vendor) - return grub_errno; - *grub_utf16_to_utf8 ((grub_uint8_t *) vendor, st->firmware_vendor, + return VasEBoot_errno; + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) vendor, st->firmware_vendor, vendor_utf16 - st->firmware_vendor) = 0; - grub_printf ("%s", vendor); - grub_free (vendor); + VasEBoot_printf ("%s", vendor); + VasEBoot_free (vendor); } - grub_printf (", Version=%x\n", st->firmware_revision); + VasEBoot_printf (", Version=%x\n", st->firmware_revision); - grub_printf ("%lld tables:\n", (long long) st->num_table_entries); + VasEBoot_printf ("%lld tables:\n", (long long) st->num_table_entries); t = st->configuration_table; for (i = 0; i < st->num_table_entries; i++) { unsigned int j; - grub_printf ("%p ", t->vendor_table); + VasEBoot_printf ("%p ", t->vendor_table); - grub_printf ("%08x-%04x-%04x-", + VasEBoot_printf ("%08x-%04x-%04x-", t->vendor_guid.data1, t->vendor_guid.data2, t->vendor_guid.data3); for (j = 0; j < 8; j++) - grub_printf ("%02x", t->vendor_guid.data4[j]); + VasEBoot_printf ("%02x", t->vendor_guid.data4[j]); for (j = 0; j < ARRAY_SIZE (guid_mappings); j++) - if (grub_memcmp (&guid_mappings[j].guid, &t->vendor_guid, - sizeof (grub_efi_guid_t)) == 0) - grub_printf (" %s", guid_mappings[j].name); + if (VasEBoot_memcmp (&guid_mappings[j].guid, &t->vendor_guid, + sizeof (VasEBoot_efi_guid_t)) == 0) + VasEBoot_printf (" %s", guid_mappings[j].name); - grub_printf ("\n"); + VasEBoot_printf ("\n"); t++; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsefisystab) +VasEBoot_MOD_INIT(lsefisystab) { - cmd = grub_register_command ("lsefisystab", grub_cmd_lsefisystab, + cmd = VasEBoot_register_command ("lsefisystab", VasEBoot_cmd_lsefisystab, "", "Display EFI system tables."); } -GRUB_MOD_FINI(lsefisystab) +VasEBoot_MOD_FINI(lsefisystab) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/efi/lssal.c b/VasEBoot-core/commands/efi/lssal.c index 5084ddd8b..1ddeb3a6e 100644 --- a/VasEBoot-core/commands/efi/lssal.c +++ b/VasEBoot-core/commands/efi/lssal.c @@ -1,169 +1,169 @@ /* lssal.c - Display EFI SAL systab. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static void disp_sal (void *table) { - struct grub_efi_sal_system_table *t = table; + struct VasEBoot_efi_sal_system_table *t = table; void *desc; - grub_uint32_t len, l, i; + VasEBoot_uint32_t len, l, i; - grub_printf ("SAL rev: %02x, signature: %x, len:%x\n", + VasEBoot_printf ("SAL rev: %02x, signature: %x, len:%x\n", t->sal_rev, t->signature, t->total_table_len); - grub_printf ("nbr entry: %d, chksum: %02x, SAL version A: %02x B: %02x\n", + VasEBoot_printf ("nbr entry: %d, chksum: %02x, SAL version A: %02x B: %02x\n", t->entry_count, t->checksum, t->sal_a_version, t->sal_b_version); - grub_printf ("OEM-ID: %-32s\n", t->oem_id); - grub_printf ("Product-ID: %-32s\n", t->product_id); + VasEBoot_printf ("OEM-ID: %-32s\n", t->oem_id); + VasEBoot_printf ("Product-ID: %-32s\n", t->product_id); desc = t->entries; - len = t->total_table_len - sizeof (struct grub_efi_sal_system_table); - if (t->total_table_len <= sizeof (struct grub_efi_sal_system_table)) + len = t->total_table_len - sizeof (struct VasEBoot_efi_sal_system_table); + if (t->total_table_len <= sizeof (struct VasEBoot_efi_sal_system_table)) return; for (i = 0; i < t->entry_count; i++) { - switch (*(grub_uint8_t *) desc) + switch (*(VasEBoot_uint8_t *) desc) { - case GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR: + case VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR: { - struct grub_efi_sal_system_table_entrypoint_descriptor *c = desc; + struct VasEBoot_efi_sal_system_table_entrypoint_descriptor *c = desc; l = sizeof (*c); - grub_printf (" Entry point: PAL=%016" PRIxGRUB_UINT64_T - " SAL=%016" PRIxGRUB_UINT64_T " GP=%016" - PRIxGRUB_UINT64_T "\n", + VasEBoot_printf (" Entry point: PAL=%016" PRIxVasEBoot_UINT64_T + " SAL=%016" PRIxVasEBoot_UINT64_T " GP=%016" + PRIxVasEBoot_UINT64_T "\n", c->pal_proc_addr, c->sal_proc_addr, c->global_data_ptr); } break; - case GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR: + case VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR: { - struct grub_efi_sal_system_table_memory_descriptor *c = desc; + struct VasEBoot_efi_sal_system_table_memory_descriptor *c = desc; l = sizeof (*c); - grub_printf (" Memory descriptor entry addr=%016" PRIxGRUB_UINT64_T - " len=%" PRIuGRUB_UINT64_T "KB\n", + VasEBoot_printf (" Memory descriptor entry addr=%016" PRIxVasEBoot_UINT64_T + " len=%" PRIuVasEBoot_UINT64_T "KB\n", c->addr, c->len * 4); - grub_printf (" sal_used=%d attr=%x AR=%x attr_mask=%x " + VasEBoot_printf (" sal_used=%d attr=%x AR=%x attr_mask=%x " "type=%x usage=%x\n", c->sal_used, c->attr, c->ar, c->attr_mask, c->mem_type, c->usage); } break; - case GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES: + case VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES: { - struct grub_efi_sal_system_table_platform_features *c = desc; + struct VasEBoot_efi_sal_system_table_platform_features *c = desc; l = sizeof (*c); - grub_printf (" Platform features: %02x", c->flags); - if (c->flags & GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK) - grub_printf (" BusLock"); - if (c->flags & GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT) - grub_printf (" IrqRedirect"); - if (c->flags & GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT) + VasEBoot_printf (" Platform features: %02x", c->flags); + if (c->flags & VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK) + VasEBoot_printf (" BusLock"); + if (c->flags & VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT) + VasEBoot_printf (" IrqRedirect"); + if (c->flags & VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT) - grub_printf (" IPIRedirect"); - if (c->flags & GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT) + VasEBoot_printf (" IPIRedirect"); + if (c->flags & VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT) - grub_printf (" ITCDrift"); - grub_printf ("\n"); + VasEBoot_printf (" ITCDrift"); + VasEBoot_printf ("\n"); } break; - case GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR: + case VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR: { - struct grub_efi_sal_system_table_translation_register_descriptor *c + struct VasEBoot_efi_sal_system_table_translation_register_descriptor *c = desc; l = sizeof (*c); - grub_printf (" TR type=%d num=%d va=%016" PRIxGRUB_UINT64_T - " pte=%016" PRIxGRUB_UINT64_T "\n", + VasEBoot_printf (" TR type=%d num=%d va=%016" PRIxVasEBoot_UINT64_T + " pte=%016" PRIxVasEBoot_UINT64_T "\n", c->register_type, c->register_number, c->addr, c->page_size); } break; - case GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE: + case VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE: { - struct grub_efi_sal_system_table_purge_translation_coherence *c + struct VasEBoot_efi_sal_system_table_purge_translation_coherence *c = desc; l = sizeof (*c); - grub_printf (" PTC coherence nbr=%d addr=%016" PRIxGRUB_UINT64_T "\n", + VasEBoot_printf (" PTC coherence nbr=%d addr=%016" PRIxVasEBoot_UINT64_T "\n", c->ndomains, c->coherence); } break; - case GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP: + case VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP: { - struct grub_efi_sal_system_table_ap_wakeup *c = desc; + struct VasEBoot_efi_sal_system_table_ap_wakeup *c = desc; l = sizeof (*c); - grub_printf (" AP wake-up: mec=%d vect=%" PRIxGRUB_UINT64_T "\n", + VasEBoot_printf (" AP wake-up: mec=%d vect=%" PRIxVasEBoot_UINT64_T "\n", c->mechanism, c->vector); } break; default: - grub_printf (" unknown entry 0x%x\n", *(grub_uint8_t *)desc); + VasEBoot_printf (" unknown entry 0x%x\n", *(VasEBoot_uint8_t *)desc); return; } - desc = (grub_uint8_t *)desc + l; + desc = (VasEBoot_uint8_t *)desc + l; if (len <= l) return; len -= l; } } -static grub_err_t -grub_cmd_lssal (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lssal (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - const grub_efi_system_table_t *st = grub_efi_system_table; - grub_efi_configuration_table_t *t = st->configuration_table; + const VasEBoot_efi_system_table_t *st = VasEBoot_efi_system_table; + VasEBoot_efi_configuration_table_t *t = st->configuration_table; unsigned int i; - grub_efi_packed_guid_t guid = GRUB_EFI_SAL_TABLE_GUID; + VasEBoot_efi_packed_guid_t guid = VasEBoot_EFI_SAL_TABLE_GUID; for (i = 0; i < st->num_table_entries; i++) { - if (grub_memcmp (&guid, &t->vendor_guid, - sizeof (grub_efi_packed_guid_t)) == 0) + if (VasEBoot_memcmp (&guid, &t->vendor_guid, + sizeof (VasEBoot_efi_packed_guid_t)) == 0) { disp_sal (t->vendor_table); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } t++; } - grub_printf ("SAL not found\n"); - return GRUB_ERR_NONE; + VasEBoot_printf ("SAL not found\n"); + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lssal) +VasEBoot_MOD_INIT(lssal) { - cmd = grub_register_command ("lssal", grub_cmd_lssal, "", + cmd = VasEBoot_register_command ("lssal", VasEBoot_cmd_lssal, "", "Display SAL system table."); } -GRUB_MOD_FINI(lssal) +VasEBoot_MOD_FINI(lssal) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/efi/smbios.c b/VasEBoot-core/commands/efi/smbios.c index 927702209..6901f2fdc 100644 --- a/VasEBoot-core/commands/efi/smbios.c +++ b/VasEBoot-core/commands/efi/smbios.c @@ -1,59 +1,59 @@ /* smbios.c - get smbios tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_smbios_eps * -grub_machine_smbios_get_eps (void) +struct VasEBoot_smbios_eps * +VasEBoot_machine_smbios_get_eps (void) { unsigned i; - static grub_efi_packed_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID; + static VasEBoot_efi_packed_guid_t smbios_guid = VasEBoot_EFI_SMBIOS_TABLE_GUID; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + for (i = 0; i < VasEBoot_efi_system_table->num_table_entries; i++) { - grub_efi_packed_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; + VasEBoot_efi_packed_guid_t *guid = + &VasEBoot_efi_system_table->configuration_table[i].vendor_guid; - if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_efi_packed_guid_t))) - return (struct grub_smbios_eps *) - grub_efi_system_table->configuration_table[i].vendor_table; + if (! VasEBoot_memcmp (guid, &smbios_guid, sizeof (VasEBoot_efi_packed_guid_t))) + return (struct VasEBoot_smbios_eps *) + VasEBoot_efi_system_table->configuration_table[i].vendor_table; } return 0; } -struct grub_smbios_eps3 * -grub_machine_smbios_get_eps3 (void) +struct VasEBoot_smbios_eps3 * +VasEBoot_machine_smbios_get_eps3 (void) { unsigned i; - static grub_efi_packed_guid_t smbios3_guid = GRUB_EFI_SMBIOS3_TABLE_GUID; + static VasEBoot_efi_packed_guid_t smbios3_guid = VasEBoot_EFI_SMBIOS3_TABLE_GUID; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + for (i = 0; i < VasEBoot_efi_system_table->num_table_entries; i++) { - grub_efi_packed_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; + VasEBoot_efi_packed_guid_t *guid = + &VasEBoot_efi_system_table->configuration_table[i].vendor_guid; - if (! grub_memcmp (guid, &smbios3_guid, sizeof (grub_efi_packed_guid_t))) - return (struct grub_smbios_eps3 *) - grub_efi_system_table->configuration_table[i].vendor_table; + if (! VasEBoot_memcmp (guid, &smbios3_guid, sizeof (VasEBoot_efi_packed_guid_t))) + return (struct VasEBoot_smbios_eps3 *) + VasEBoot_efi_system_table->configuration_table[i].vendor_table; } return 0; } diff --git a/VasEBoot-core/commands/eval.c b/VasEBoot-core/commands/eval.c index f826a4f22..808fde9a9 100644 --- a/VasEBoot-core/commands/eval.c +++ b/VasEBoot-core/commands/eval.c @@ -1,71 +1,71 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_eval (grub_command_t cmd __attribute__((__unused__)), +static VasEBoot_err_t +VasEBoot_cmd_eval (VasEBoot_command_t cmd __attribute__((__unused__)), int argc, char *argv[]) { int i; - grub_size_t size = argc; /* +1 for final zero */ + VasEBoot_size_t size = argc; /* +1 for final zero */ char *str, *p; - grub_err_t ret; + VasEBoot_err_t ret; if (argc == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; for (i = 0; i < argc; i++) - size += grub_strlen (argv[i]); + size += VasEBoot_strlen (argv[i]); - str = p = grub_malloc (size); + str = p = VasEBoot_malloc (size); if (!str) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < argc; i++) { - p = grub_stpcpy (p, argv[i]); + p = VasEBoot_stpcpy (p, argv[i]); *p++ = ' '; } *--p = '\0'; - ret = grub_script_execute_sourcecode (str); - grub_free (str); + ret = VasEBoot_script_execute_sourcecode (str); + VasEBoot_free (str); return ret; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(eval) +VasEBoot_MOD_INIT(eval) { - cmd = grub_register_command ("eval", grub_cmd_eval, N_("STRING ..."), - N_("Evaluate arguments as GRUB commands")); + cmd = VasEBoot_register_command ("eval", VasEBoot_cmd_eval, N_("STRING ..."), + N_("Evaluate arguments as VasEBoot commands")); } -GRUB_MOD_FINI(eval) +VasEBoot_MOD_FINI(eval) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/extcmd.c b/VasEBoot-core/commands/extcmd.c index 69574e2b0..b21387081 100644 --- a/VasEBoot-core/commands/extcmd.c +++ b/VasEBoot-core/commands/extcmd.c @@ -1,41 +1,41 @@ /* extcmd.c - support extended command */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_err_t -grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args, - struct grub_script *script) +VasEBoot_err_t +VasEBoot_extcmd_dispatcher (struct VasEBoot_command *cmd, int argc, char **args, + struct VasEBoot_script *script) { int new_argc; char **new_args; - struct grub_arg_list *state; - struct grub_extcmd_context context; - grub_err_t ret; - grub_extcmd_t ext = cmd->data; + struct VasEBoot_arg_list *state; + struct VasEBoot_extcmd_context context; + VasEBoot_err_t ret; + VasEBoot_extcmd_t ext = cmd->data; context.state = 0; context.extcmd = ext; @@ -47,49 +47,49 @@ grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args, return ret; } - state = grub_arg_list_alloc (ext, argc, args); - if (grub_arg_parse (ext, argc, args, state, &new_args, &new_argc)) + state = VasEBoot_arg_list_alloc (ext, argc, args); + if (VasEBoot_arg_parse (ext, argc, args, state, &new_args, &new_argc)) { context.state = state; ret = (ext->func) (&context, new_argc, new_args); - grub_free (new_args); - grub_free (state); + VasEBoot_free (new_args); + VasEBoot_free (state); return ret; } - grub_free (state); - return grub_errno; + VasEBoot_free (state); + return VasEBoot_errno; } -static grub_err_t -grub_extcmd_dispatch (struct grub_command *cmd, int argc, char **args) +static VasEBoot_err_t +VasEBoot_extcmd_dispatch (struct VasEBoot_command *cmd, int argc, char **args) { - return grub_extcmd_dispatcher (cmd, argc, args, 0); + return VasEBoot_extcmd_dispatcher (cmd, argc, args, 0); } -grub_extcmd_t -grub_register_extcmd_prio (const char *name, grub_extcmd_func_t func, - grub_command_flags_t flags, const char *summary, +VasEBoot_extcmd_t +VasEBoot_register_extcmd_prio (const char *name, VasEBoot_extcmd_func_t func, + VasEBoot_command_flags_t flags, const char *summary, const char *description, - const struct grub_arg_option *parser, + const struct VasEBoot_arg_option *parser, int prio) { - grub_extcmd_t ext; - grub_command_t cmd; + VasEBoot_extcmd_t ext; + VasEBoot_command_t cmd; - ext = (grub_extcmd_t) grub_malloc (sizeof (*ext)); + ext = (VasEBoot_extcmd_t) VasEBoot_malloc (sizeof (*ext)); if (! ext) return 0; - cmd = grub_register_command_prio (name, grub_extcmd_dispatch, + cmd = VasEBoot_register_command_prio (name, VasEBoot_extcmd_dispatch, summary, description, prio); if (! cmd) { - grub_free (ext); + VasEBoot_free (ext); return 0; } - cmd->flags = (flags | GRUB_COMMAND_FLAG_EXTCMD); + cmd->flags = (flags | VasEBoot_COMMAND_FLAG_EXTCMD); cmd->data = ext; ext->cmd = cmd; @@ -100,19 +100,19 @@ grub_register_extcmd_prio (const char *name, grub_extcmd_func_t func, return ext; } -grub_extcmd_t -grub_register_extcmd (const char *name, grub_extcmd_func_t func, - grub_command_flags_t flags, const char *summary, +VasEBoot_extcmd_t +VasEBoot_register_extcmd (const char *name, VasEBoot_extcmd_func_t func, + VasEBoot_command_flags_t flags, const char *summary, const char *description, - const struct grub_arg_option *parser) + const struct VasEBoot_arg_option *parser) { - return grub_register_extcmd_prio (name, func, flags, + return VasEBoot_register_extcmd_prio (name, func, flags, summary, description, parser, 1); } void -grub_unregister_extcmd (grub_extcmd_t ext) +VasEBoot_unregister_extcmd (VasEBoot_extcmd_t ext) { - grub_unregister_command (ext->cmd); - grub_free (ext); + VasEBoot_unregister_command (ext->cmd); + VasEBoot_free (ext); } diff --git a/VasEBoot-core/commands/file.c b/VasEBoot-core/commands/file.c index 12fba99e0..a553025ce 100644 --- a/VasEBoot-core/commands/file.c +++ b/VasEBoot-core/commands/file.c @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"is-i386-xen-pae-domu", 0, 0, N_("Check if FILE can be booted as i386 PAE Xen unprivileged guest kernel"), 0, 0}, @@ -138,18 +138,18 @@ enum }; -static grub_err_t -grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_file (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - grub_file_t file = 0; - grub_elf_t elf = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_elf_t elf = 0; + VasEBoot_err_t err; int type = -1, i; int ret = 0; - grub_macho_t macho = 0; + VasEBoot_macho_t macho = 0; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); for (i = OPT_TYPE_MIN; i <= OPT_TYPE_MAX; i++) if (ctxt->state[i].set) { @@ -158,26 +158,26 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) type = i; continue; } - return grub_error (GRUB_ERR_BAD_ARGUMENT, "multiple types specified"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "multiple types specified"); } if (type == -1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no type specified"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no type specified"); - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (!file) - return grub_errno; + return VasEBoot_errno; switch (type) { case IS_BIOS_BOOTSECTOR: { - grub_uint16_t sig; - if (grub_file_size (file) != 512) + VasEBoot_uint16_t sig; + if (VasEBoot_file_size (file) != 512) break; - if (grub_file_seek (file, 510) == (grub_size_t) -1) + if (VasEBoot_file_seek (file, 510) == (VasEBoot_size_t) -1) break; - if (grub_file_read (file, &sig, 2) != 2) + if (VasEBoot_file_read (file, &sig, 2) != 2) break; - if (sig != grub_cpu_to_le16_compile_time (0xaa55)) + if (sig != VasEBoot_cpu_to_le16_compile_time (0xaa55)) break; ret = 1; break; @@ -186,7 +186,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) { Elf64_Ehdr ehdr; - if (grub_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) + if (VasEBoot_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) break; if (ehdr.e_ident[EI_MAG0] != ELFMAG0 @@ -199,7 +199,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) if (ehdr.e_ident[EI_CLASS] != ELFCLASS64 || ehdr.e_ident[EI_DATA] != ELFDATA2LSB - || ehdr.e_machine != grub_cpu_to_le16_compile_time (EM_IA_64)) + || ehdr.e_machine != VasEBoot_cpu_to_le16_compile_time (EM_IA_64)) break; ret = 1; @@ -211,7 +211,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) { Elf64_Ehdr ehdr; - if (grub_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) + if (VasEBoot_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) break; if (ehdr.e_ident[EI_MAG0] != ELFMAG0 @@ -226,8 +226,8 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) || ehdr.e_ident[EI_DATA] != ELFDATA2MSB) break; - if (ehdr.e_machine != grub_cpu_to_le16_compile_time (EM_SPARCV9) - || ehdr.e_type != grub_cpu_to_be16_compile_time (ET_EXEC)) + if (ehdr.e_machine != VasEBoot_cpu_to_le16_compile_time (EM_SPARCV9) + || ehdr.e_type != VasEBoot_cpu_to_be16_compile_time (ET_EXEC)) break; ret = 1; @@ -239,7 +239,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) { Elf32_Ehdr ehdr; - if (grub_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) + if (VasEBoot_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) break; if (ehdr.e_ident[EI_MAG0] != ELFMAG0 @@ -251,13 +251,13 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) break; if (ehdr.e_ident[EI_DATA] != ELFDATA2MSB - || (ehdr.e_machine != grub_cpu_to_le16_compile_time (EM_PPC) + || (ehdr.e_machine != VasEBoot_cpu_to_le16_compile_time (EM_PPC) && ehdr.e_machine != - grub_cpu_to_le16_compile_time (EM_PPC64))) + VasEBoot_cpu_to_le16_compile_time (EM_PPC64))) break; - if (ehdr.e_type != grub_cpu_to_be16_compile_time (ET_EXEC) - && ehdr.e_type != grub_cpu_to_be16_compile_time (ET_DYN)) + if (ehdr.e_type != VasEBoot_cpu_to_be16_compile_time (ET_EXEC) + && ehdr.e_type != VasEBoot_cpu_to_be16_compile_time (ET_DYN)) break; ret = 1; @@ -269,7 +269,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) { Elf32_Ehdr ehdr; - if (grub_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) + if (VasEBoot_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) break; if (ehdr.e_ident[EI_MAG0] != ELFMAG0 @@ -281,8 +281,8 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) break; if (ehdr.e_ident[EI_DATA] != ELFDATA2MSB - || ehdr.e_machine != grub_cpu_to_be16_compile_time (EM_MIPS) - || ehdr.e_type != grub_cpu_to_be16_compile_time (ET_EXEC)) + || ehdr.e_machine != VasEBoot_cpu_to_be16_compile_time (EM_MIPS) + || ehdr.e_type != VasEBoot_cpu_to_be16_compile_time (ET_EXEC)) break; ret = 1; @@ -296,14 +296,14 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) { int is32, is64; - elf = grub_elf_file (file, file->name); + elf = VasEBoot_elf_file (file, file->name); - if (elf->ehdr.ehdr32.e_type != grub_cpu_to_le16_compile_time (ET_EXEC) + if (elf->ehdr.ehdr32.e_type != VasEBoot_cpu_to_le16_compile_time (ET_EXEC) || elf->ehdr.ehdr32.e_ident[EI_DATA] != ELFDATA2LSB) break; - is32 = grub_elf_is_elf32 (elf); - is64 = grub_elf_is_elf64 (elf); + is32 = VasEBoot_elf_is_elf32 (elf); + is64 = VasEBoot_elf_is_elf64 (elf); if (!is32 && !is64) break; if (!is32 && type == IS_X86_KNETBSD32) @@ -311,9 +311,9 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) if (!is64 && type == IS_X86_KNETBSD64) break; if (is64) - ret = grub_file_check_netbsd64 (elf); + ret = VasEBoot_file_check_netbsd64 (elf); if (is32) - ret = grub_file_check_netbsd32 (elf); + ret = VasEBoot_file_check_netbsd32 (elf); break; } @@ -324,7 +324,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) Elf32_Ehdr ehdr; int is32, is64; - if (grub_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) + if (VasEBoot_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) break; if (ehdr.e_ident[EI_MAG0] != ELFMAG0 @@ -335,16 +335,16 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) || ehdr.e_version != EV_CURRENT) break; - if (ehdr.e_type != grub_cpu_to_le16_compile_time (ET_EXEC) + if (ehdr.e_type != VasEBoot_cpu_to_le16_compile_time (ET_EXEC) || ehdr.e_ident[EI_DATA] != ELFDATA2LSB) break; if (ehdr.e_ident[EI_OSABI] != ELFOSABI_FREEBSD) break; - is32 = (ehdr.e_machine == grub_cpu_to_le16_compile_time (EM_386) + is32 = (ehdr.e_machine == VasEBoot_cpu_to_le16_compile_time (EM_386) && ehdr.e_ident[EI_CLASS] == ELFCLASS32); - is64 = (ehdr.e_machine == grub_cpu_to_le16_compile_time (EM_X86_64) + is64 = (ehdr.e_machine == VasEBoot_cpu_to_le16_compile_time (EM_X86_64) && ehdr.e_ident[EI_CLASS] == ELFCLASS64); if (!is32 && !is64) break; @@ -362,7 +362,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) { Elf32_Ehdr ehdr; - if (grub_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) + if (VasEBoot_file_read (file, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) break; if (ehdr.e_ident[EI_MAG0] != ELFMAG0 @@ -373,8 +373,8 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) || ehdr.e_version != EV_CURRENT) break; - if (ehdr.e_machine != grub_cpu_to_le16_compile_time (EM_MIPS) - || ehdr.e_type != grub_cpu_to_le16_compile_time (ET_EXEC)) + if (ehdr.e_machine != VasEBoot_cpu_to_le16_compile_time (EM_MIPS) + || ehdr.e_type != VasEBoot_cpu_to_le16_compile_time (ET_EXEC)) break; ret = 1; @@ -383,21 +383,21 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_ARM_LINUX: { - grub_uint32_t sig, sig_pi; - if (grub_file_read (file, &sig_pi, 4) != 4) + VasEBoot_uint32_t sig, sig_pi; + if (VasEBoot_file_read (file, &sig_pi, 4) != 4) break; /* Raspberry pi. */ - if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006)) + if (sig_pi == VasEBoot_cpu_to_le32_compile_time (0xea000006)) { ret = 1; break; } - if (grub_file_seek (file, 0x24) == (grub_size_t) -1) + if (VasEBoot_file_seek (file, 0x24) == (VasEBoot_size_t) -1) break; - if (grub_file_read (file, &sig, 4) != 4) + if (VasEBoot_file_read (file, &sig, 4) != 4) break; - if (sig == grub_cpu_to_le32_compile_time (0x016f2818)) + if (sig == VasEBoot_cpu_to_le32_compile_time (0x016f2818)) { ret = 1; break; @@ -406,13 +406,13 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_ARM64_LINUX: { - grub_uint32_t sig; + VasEBoot_uint32_t sig; - if (grub_file_seek (file, 0x38) == (grub_size_t) -1) + if (VasEBoot_file_seek (file, 0x38) == (VasEBoot_size_t) -1) break; - if (grub_file_read (file, &sig, 4) != 4) + if (VasEBoot_file_read (file, &sig, 4) != 4) break; - if (sig == grub_cpu_to_le32_compile_time (0x644d5241)) + if (sig == VasEBoot_cpu_to_le32_compile_time (0x644d5241)) { ret = 1; break; @@ -421,54 +421,54 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_PAE_DOMU ... IS_DOM0: { - struct grub_xen_file_info xen_inf; - elf = grub_xen_file (file); + struct VasEBoot_xen_file_info xen_inf; + elf = VasEBoot_xen_file (file); if (!elf) break; - err = grub_xen_get_info (elf, &xen_inf); + err = VasEBoot_xen_get_info (elf, &xen_inf); if (err) break; /* Unfortuntely no way to check if kernel supports dom0. */ if (type == IS_DOM0) ret = 1; if (type == IS_PAE_DOMU) - ret = (xen_inf.arch == GRUB_XEN_FILE_I386_PAE - || xen_inf.arch == GRUB_XEN_FILE_I386_PAE_BIMODE); + ret = (xen_inf.arch == VasEBoot_XEN_FILE_I386_PAE + || xen_inf.arch == VasEBoot_XEN_FILE_I386_PAE_BIMODE); if (type == IS_64_DOMU) - ret = (xen_inf.arch == GRUB_XEN_FILE_X86_64); + ret = (xen_inf.arch == VasEBoot_XEN_FILE_X86_64); break; } case IS_MULTIBOOT: case IS_MULTIBOOT2: { - grub_uint32_t *buffer; - grub_ssize_t len; - grub_size_t search_size; - grub_uint32_t *header; - grub_uint32_t magic; - grub_size_t step; + VasEBoot_uint32_t *buffer; + VasEBoot_ssize_t len; + VasEBoot_size_t search_size; + VasEBoot_uint32_t *header; + VasEBoot_uint32_t magic; + VasEBoot_size_t step; if (type == IS_MULTIBOOT2) { search_size = 32768; - magic = grub_cpu_to_le32_compile_time (0xe85250d6); + magic = VasEBoot_cpu_to_le32_compile_time (0xe85250d6); step = 2; } else { search_size = 8192; - magic = grub_cpu_to_le32_compile_time (0x1BADB002); + magic = VasEBoot_cpu_to_le32_compile_time (0x1BADB002); step = 1; } - buffer = grub_malloc (search_size); + buffer = VasEBoot_malloc (search_size); if (!buffer) break; - len = grub_file_read (file, buffer, search_size); + len = VasEBoot_file_read (file, buffer, search_size); if (len < 32) { - grub_free (buffer); + VasEBoot_free (buffer); break; } @@ -480,36 +480,36 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) header += step) { if (header[0] == magic - && !(grub_le_to_cpu32 (header[0]) - + grub_le_to_cpu32 (header[1]) - + grub_le_to_cpu32 (header[2]) + && !(VasEBoot_le_to_cpu32 (header[0]) + + VasEBoot_le_to_cpu32 (header[1]) + + VasEBoot_le_to_cpu32 (header[2]) + (type == IS_MULTIBOOT2 - ? grub_le_to_cpu32 (header[3]) : 0))) + ? VasEBoot_le_to_cpu32 (header[3]) : 0))) { ret = 1; break; } } - grub_free (buffer); + VasEBoot_free (buffer); break; } case IS_X86_LINUX32: case IS_X86_LINUX: { struct linux_kernel_header lh; - if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) + if (VasEBoot_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) break; - if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)) + if (lh.boot_flag != VasEBoot_cpu_to_le16_compile_time (0xaa55)) break; - if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) + if (lh.setup_sects > VasEBoot_LINUX_MAX_SETUP_SECTS) break; /* FIXME: some really old kernels (< 1.3.73) will fail this. */ if (lh.header != - grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - || grub_le_to_cpu16 (lh.version) < 0x0200) + VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + || VasEBoot_le_to_cpu16 (lh.version) < 0x0200) break; if (type == IS_X86_LINUX) @@ -521,24 +521,24 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and still not support 32-bit boot. */ if (lh.header != - grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - || grub_le_to_cpu16 (lh.version) < 0x0203) + VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + || VasEBoot_le_to_cpu16 (lh.version) < 0x0203) break; - if (!(lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL)) + if (!(lh.loadflags & VasEBoot_LINUX_FLAG_BIG_KERNEL)) break; ret = 1; break; } case IS_HIBERNATED: { - grub_uint8_t hibr_file_magic[4]; - if (grub_file_read (file, &hibr_file_magic, sizeof (hibr_file_magic)) + VasEBoot_uint8_t hibr_file_magic[4]; + if (VasEBoot_file_read (file, &hibr_file_magic, sizeof (hibr_file_magic)) != sizeof (hibr_file_magic)) break; - if (grub_memcmp ("hibr", hibr_file_magic, sizeof (hibr_file_magic)) == + if (VasEBoot_memcmp ("hibr", hibr_file_magic, sizeof (hibr_file_magic)) == 0 - || grub_memcmp ("HIBR", hibr_file_magic, + || VasEBoot_memcmp ("HIBR", hibr_file_magic, sizeof (hibr_file_magic)) == 0) ret = 1; break; @@ -546,7 +546,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) case IS_XNU64: case IS_XNU32: { - macho = grub_macho_open (args[0], (type == IS_XNU64)); + macho = VasEBoot_macho_open (args[0], (type == IS_XNU64)); if (!macho) break; /* FIXME: more checks? */ @@ -555,12 +555,12 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_XNU_HIBR: { - struct grub_xnu_hibernate_header hibhead; - if (grub_file_read (file, &hibhead, sizeof (hibhead)) + struct VasEBoot_xnu_hibernate_header hibhead; + if (VasEBoot_file_read (file, &hibhead, sizeof (hibhead)) != sizeof (hibhead)) break; if (hibhead.magic != - grub_cpu_to_le32_compile_time (GRUB_XNU_HIBERNATE_MAGIC)) + VasEBoot_cpu_to_le32_compile_time (VasEBoot_XNU_HIBERNATE_MAGIC)) break; ret = 1; break; @@ -572,75 +572,75 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) case IS_ARM_EFI: { char signature[4]; - grub_uint32_t pe_offset; - struct grub_pe32_coff_header coff_head; + VasEBoot_uint32_t pe_offset; + struct VasEBoot_pe32_coff_header coff_head; - if (grub_file_read (file, signature, 2) != 2) + if (VasEBoot_file_read (file, signature, 2) != 2) break; if (signature[0] != 'M' || signature[1] != 'Z') break; - if ((grub_ssize_t) grub_file_seek (file, 0x3c) == -1) + if ((VasEBoot_ssize_t) VasEBoot_file_seek (file, 0x3c) == -1) break; - if (grub_file_read (file, &pe_offset, 4) != 4) + if (VasEBoot_file_read (file, &pe_offset, 4) != 4) break; - if ((grub_ssize_t) grub_file_seek (file, grub_le_to_cpu32 (pe_offset)) + if ((VasEBoot_ssize_t) VasEBoot_file_seek (file, VasEBoot_le_to_cpu32 (pe_offset)) == -1) break; - if (grub_file_read (file, signature, 4) != 4) + if (VasEBoot_file_read (file, signature, 4) != 4) break; if (signature[0] != 'P' || signature[1] != 'E' || signature[2] != '\0' || signature[3] != '\0') break; - if (grub_file_read (file, &coff_head, sizeof (coff_head)) + if (VasEBoot_file_read (file, &coff_head, sizeof (coff_head)) != sizeof (coff_head)) break; if (type == IS_32_EFI && coff_head.machine != - grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_I386)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_MACHINE_I386)) break; if (type == IS_64_EFI && coff_head.machine != - grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_X86_64)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_MACHINE_X86_64)) break; if (type == IS_IA_EFI && coff_head.machine != - grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_IA64)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_MACHINE_IA64)) break; if (type == IS_ARM64_EFI && coff_head.machine != - grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_ARM64)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_MACHINE_ARM64)) break; if (type == IS_ARM_EFI && coff_head.machine != - grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_ARMTHUMB_MIXED)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_MACHINE_ARMTHUMB_MIXED)) break; if (type == IS_IA_EFI || type == IS_64_EFI || type == IS_ARM64_EFI) { - struct grub_pe64_optional_header o64; - if (grub_file_read (file, &o64, sizeof (o64)) != sizeof (o64)) + struct VasEBoot_pe64_optional_header o64; + if (VasEBoot_file_read (file, &o64, sizeof (o64)) != sizeof (o64)) break; if (o64.magic != - grub_cpu_to_le16_compile_time (GRUB_PE32_PE64_MAGIC)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_PE64_MAGIC)) break; if (o64.subsystem != - grub_cpu_to_le16_compile_time - (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION)) + VasEBoot_cpu_to_le16_compile_time + (VasEBoot_PE32_SUBSYSTEM_EFI_APPLICATION)) break; ret = 1; break; } if (type == IS_32_EFI || type == IS_ARM_EFI) { - struct grub_pe32_optional_header o32; - if (grub_file_read (file, &o32, sizeof (o32)) != sizeof (o32)) + struct VasEBoot_pe32_optional_header o32; + if (VasEBoot_file_read (file, &o32, sizeof (o32)) != sizeof (o32)) break; if (o32.magic != - grub_cpu_to_le16_compile_time (GRUB_PE32_PE32_MAGIC)) + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PE32_PE32_MAGIC)) break; if (o32.subsystem != - grub_cpu_to_le16_compile_time - (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION)) + VasEBoot_cpu_to_le16_compile_time + (VasEBoot_PE32_SUBSYSTEM_EFI_APPLICATION)) break; ret = 1; break; @@ -650,30 +650,30 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } if (elf) - grub_elf_close (elf); + VasEBoot_elf_close (elf); else if (macho) - grub_macho_close (macho); + VasEBoot_macho_close (macho); else if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (!ret && (grub_errno == GRUB_ERR_BAD_OS || grub_errno == GRUB_ERR_NONE)) + if (!ret && (VasEBoot_errno == VasEBoot_ERR_BAD_OS || VasEBoot_errno == VasEBoot_ERR_NONE)) /* TRANSLATORS: it's a standalone boolean value, opposite of "true". */ - grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); + return VasEBoot_errno; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(file) +VasEBoot_MOD_INIT(file) { - cmd = grub_register_extcmd ("file", grub_cmd_file, 0, + cmd = VasEBoot_register_extcmd ("file", VasEBoot_cmd_file, 0, N_("OPTIONS FILE"), N_("Check if FILE is of specified type."), options); } -GRUB_MOD_FINI(file) +VasEBoot_MOD_FINI(file) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/file32.c b/VasEBoot-core/commands/file32.c index 0861c458d..4f4d58437 100644 --- a/VasEBoot-core/commands/file32.c +++ b/VasEBoot-core/commands/file32.c @@ -1,5 +1,5 @@ -#define GRUB_TARGET_WORDSIZE 32 +#define VasEBoot_TARGET_WORDSIZE 32 #define XX 32 #define ehdrXX ehdr32 -#define grub_file_check_netbsdXX grub_file_check_netbsd32 +#define VasEBoot_file_check_netbsdXX VasEBoot_file_check_netbsd32 #include "fileXX.c" diff --git a/VasEBoot-core/commands/file64.c b/VasEBoot-core/commands/file64.c index 90890d481..a2deea353 100644 --- a/VasEBoot-core/commands/file64.c +++ b/VasEBoot-core/commands/file64.c @@ -1,5 +1,5 @@ -#define GRUB_TARGET_WORDSIZE 64 +#define VasEBoot_TARGET_WORDSIZE 64 #define XX 64 #define ehdrXX ehdr64 -#define grub_file_check_netbsdXX grub_file_check_netbsd64 +#define VasEBoot_file_check_netbsdXX VasEBoot_file_check_netbsd64 #include "fileXX.c" diff --git a/VasEBoot-core/commands/fileXX.c b/VasEBoot-core/commands/fileXX.c index c17d26ce6..8902e4274 100644 --- a/VasEBoot-core/commands/fileXX.c +++ b/VasEBoot-core/commands/fileXX.c @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wcast-align" int -grub_file_check_netbsdXX (grub_elf_t elf) +VasEBoot_file_check_netbsdXX (VasEBoot_elf_t elf) { Elf_Shdr *s, *s0; - grub_size_t shnum = elf->ehdr.ehdrXX.e_shnum; - grub_size_t shentsize = elf->ehdr.ehdrXX.e_shentsize; - grub_size_t shsize = shnum * shentsize; - grub_off_t stroff; + VasEBoot_size_t shnum = elf->ehdr.ehdrXX.e_shnum; + VasEBoot_size_t shentsize = elf->ehdr.ehdrXX.e_shentsize; + VasEBoot_size_t shsize = shnum * shentsize; + VasEBoot_off_t stroff; if (!shnum || !shentsize) return 0; - s0 = grub_malloc (shsize); + s0 = VasEBoot_malloc (shsize); if (!s0) return 0; - if (grub_file_seek (elf->file, elf->ehdr.ehdrXX.e_shoff) == (grub_off_t) -1) + if (VasEBoot_file_seek (elf->file, elf->ehdr.ehdrXX.e_shoff) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (elf->file, s0, shsize) != (grub_ssize_t) shsize) + if (VasEBoot_file_read (elf->file, s0, shsize) != (VasEBoot_ssize_t) shsize) goto fail; s = (Elf_Shdr *) ((char *) s0 + elf->ehdr.ehdrXX.e_shstrndx * shentsize); @@ -52,23 +52,23 @@ grub_file_check_netbsdXX (grub_elf_t elf) s = (Elf_Shdr *) ((char *) s + shentsize)) { char name[sizeof(".note.netbsd.ident")]; - grub_memset (name, 0, sizeof (name)); - if (grub_file_seek (elf->file, stroff + s->sh_name) == (grub_off_t) -1) + VasEBoot_memset (name, 0, sizeof (name)); + if (VasEBoot_file_seek (elf->file, stroff + s->sh_name) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (elf->file, name, sizeof (name)) != (grub_ssize_t) sizeof (name)) + if (VasEBoot_file_read (elf->file, name, sizeof (name)) != (VasEBoot_ssize_t) sizeof (name)) { - if (grub_errno) + if (VasEBoot_errno) goto fail; continue; } - if (grub_memcmp (name, ".note.netbsd.ident", + if (VasEBoot_memcmp (name, ".note.netbsd.ident", sizeof(".note.netbsd.ident")) != 0) continue; - grub_free (s0); + VasEBoot_free (s0); return 1; } fail: - grub_free (s0); + VasEBoot_free (s0); return 0; } diff --git a/VasEBoot-core/commands/fwconfig.c b/VasEBoot-core/commands/fwconfig.c index 3abe59f2b..65b58befc 100644 --- a/VasEBoot-core/commands/fwconfig.c +++ b/VasEBoot-core/commands/fwconfig.c @@ -1,31 +1,31 @@ /* fwconfig.c - command to read config from qemu fwconfig */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 CoreOS, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define SELECTOR 0x510 #define DATA 0x511 @@ -33,90 +33,90 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define SIGNATURE_INDEX 0x00 #define DIRECTORY_INDEX 0x19 -static grub_extcmd_t cmd_read_fwconfig; +static VasEBoot_extcmd_t cmd_read_fwconfig; -struct grub_qemu_fwcfgfile { - grub_uint32_t size; - grub_uint16_t select; - grub_uint16_t reserved; +struct VasEBoot_qemu_fwcfgfile { + VasEBoot_uint32_t size; + VasEBoot_uint16_t select; + VasEBoot_uint16_t reserved; char name[56]; }; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {0, 'v', 0, N_("Save read value into variable VARNAME."), N_("VARNAME"), ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_fwconfig (grub_extcmd_context_t ctxt __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_fwconfig (VasEBoot_extcmd_context_t ctxt __attribute__ ((unused)), int argc, char **argv) { - grub_uint32_t i, j, value = 0; - struct grub_qemu_fwcfgfile file; + VasEBoot_uint32_t i, j, value = 0; + struct VasEBoot_qemu_fwcfgfile file; char fwsig[4], signature[4] = { 'Q', 'E', 'M', 'U' }; if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); /* Verify that we have meaningful hardware here */ - grub_outw(SIGNATURE_INDEX, SELECTOR); + VasEBoot_outw(SIGNATURE_INDEX, SELECTOR); for (i=0; i. + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options_next[] = { +static const struct VasEBoot_arg_option options_next[] = { {"set-device", 'd', 0, N_("Set a variable to the name of selected partition."), N_("VARNAME"), ARG_TYPE_STRING}, @@ -45,67 +45,67 @@ enum options_next }; static unsigned int -grub_gptprio_priority (struct grub_gpt_partentry *entry) +VasEBoot_gptprio_priority (struct VasEBoot_gpt_partentry *entry) { - return (unsigned int) grub_gpt_entry_attribute - (entry, GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_PRIORITY, 4); + return (unsigned int) VasEBoot_gpt_entry_attribute + (entry, VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_PRIORITY, 4); } static unsigned int -grub_gptprio_tries_left (struct grub_gpt_partentry *entry) +VasEBoot_gptprio_tries_left (struct VasEBoot_gpt_partentry *entry) { - return (unsigned int) grub_gpt_entry_attribute - (entry, GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_TRIES_LEFT, 4); + return (unsigned int) VasEBoot_gpt_entry_attribute + (entry, VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_TRIES_LEFT, 4); } static void -grub_gptprio_set_tries_left (struct grub_gpt_partentry *entry, +VasEBoot_gptprio_set_tries_left (struct VasEBoot_gpt_partentry *entry, unsigned int tries_left) { - grub_gpt_entry_set_attribute - (entry, tries_left, GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_TRIES_LEFT, 4); + VasEBoot_gpt_entry_set_attribute + (entry, tries_left, VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_TRIES_LEFT, 4); } static unsigned int -grub_gptprio_successful (struct grub_gpt_partentry *entry) +VasEBoot_gptprio_successful (struct VasEBoot_gpt_partentry *entry) { - return (unsigned int) grub_gpt_entry_attribute - (entry, GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_SUCCESSFUL, 1); + return (unsigned int) VasEBoot_gpt_entry_attribute + (entry, VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_SUCCESSFUL, 1); } -static grub_err_t -grub_find_next (const char *disk_name, - const grub_gpt_part_type_t *part_type, +static VasEBoot_err_t +VasEBoot_find_next (const char *disk_name, + const VasEBoot_gpt_part_type_t *part_type, char **part_name, char **part_guid) { - struct grub_gpt_partentry *part, *part_found = NULL; - grub_device_t dev = NULL; - grub_gpt_t gpt = NULL; - grub_uint32_t i, part_index; + struct VasEBoot_gpt_partentry *part, *part_found = NULL; + VasEBoot_device_t dev = NULL; + VasEBoot_gpt_t gpt = NULL; + VasEBoot_uint32_t i, part_index; - dev = grub_device_open (disk_name); + dev = VasEBoot_device_open (disk_name); if (!dev) goto done; - gpt = grub_gpt_read (dev->disk); + gpt = VasEBoot_gpt_read (dev->disk); if (!gpt) goto done; - if (grub_gpt_repair (dev->disk, gpt)) + if (VasEBoot_gpt_repair (dev->disk, gpt)) goto done; - for (i = 0; (part = grub_gpt_get_partentry (gpt, i)) != NULL; i++) + for (i = 0; (part = VasEBoot_gpt_get_partentry (gpt, i)) != NULL; i++) { - if (grub_memcmp (part_type, &part->type, sizeof (*part_type)) == 0) + if (VasEBoot_memcmp (part_type, &part->type, sizeof (*part_type)) == 0) { unsigned int priority, tries_left, successful, old_priority = 0; - priority = grub_gptprio_priority (part); - tries_left = grub_gptprio_tries_left (part); - successful = grub_gptprio_successful (part); + priority = VasEBoot_gptprio_priority (part); + tries_left = VasEBoot_gptprio_tries_left (part); + successful = VasEBoot_gptprio_successful (part); if (part_found) - old_priority = grub_gptprio_priority (part_found); + old_priority = VasEBoot_gptprio_priority (part_found); if ((tries_left || successful) && priority > old_priority) { @@ -117,66 +117,66 @@ grub_find_next (const char *disk_name, if (!part_found) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("no such partition")); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("no such partition")); goto done; } - if (grub_gptprio_tries_left (part_found)) + if (VasEBoot_gptprio_tries_left (part_found)) { - unsigned int tries_left = grub_gptprio_tries_left (part_found); + unsigned int tries_left = VasEBoot_gptprio_tries_left (part_found); - grub_gptprio_set_tries_left (part_found, tries_left - 1); + VasEBoot_gptprio_set_tries_left (part_found, tries_left - 1); - if (grub_gpt_update (gpt)) + if (VasEBoot_gpt_update (gpt)) goto done; - if (grub_gpt_write (dev->disk, gpt)) + if (VasEBoot_gpt_write (dev->disk, gpt)) goto done; } - *part_name = grub_xasprintf ("%s,gpt%u", disk_name, part_index + 1); + *part_name = VasEBoot_xasprintf ("%s,gpt%u", disk_name, part_index + 1); if (!*part_name) goto done; - *part_guid = grub_gpt_guid_to_str (&part_found->guid); + *part_guid = VasEBoot_gpt_guid_to_str (&part_found->guid); if (!*part_guid) goto done; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; done: - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_next (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_next (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; char *p, *root = NULL, *part_name = NULL, *part_guid = NULL; /* TODO: Add a uuid parser and a command line flag for providing type. */ - grub_gpt_part_type_t part_type = GRUB_GPT_PARTITION_TYPE_USR_X86_64; + VasEBoot_gpt_part_type_t part_type = VasEBoot_GPT_PARTITION_TYPE_USR_X86_64; if (!state[NEXT_SET_DEVICE].set || !state[NEXT_SET_UUID].set) { - grub_error (GRUB_ERR_INVALID_COMMAND, N_("-d and -u are required")); + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, N_("-d and -u are required")); goto done; } if (argc == 0) - root = grub_strdup (grub_env_get ("root")); + root = VasEBoot_strdup (VasEBoot_env_get ("root")); else if (argc == 1) - root = grub_strdup (args[0]); + root = VasEBoot_strdup (args[0]); else { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unexpected arguments")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unexpected arguments")); goto done; } @@ -184,40 +184,40 @@ grub_cmd_next (grub_extcmd_context_t ctxt, int argc, char **args) goto done; /* To make using $root practical strip off the partition name. */ - p = grub_strchr (root, ','); + p = VasEBoot_strchr (root, ','); if (p) *p = '\0'; - if (grub_find_next (root, &part_type, &part_name, &part_guid)) + if (VasEBoot_find_next (root, &part_type, &part_name, &part_guid)) goto done; - if (grub_env_set (state[NEXT_SET_DEVICE].arg, part_name)) + if (VasEBoot_env_set (state[NEXT_SET_DEVICE].arg, part_name)) goto done; - if (grub_env_set (state[NEXT_SET_UUID].arg, part_guid)) + if (VasEBoot_env_set (state[NEXT_SET_UUID].arg, part_guid)) goto done; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; done: - grub_free (root); - grub_free (part_name); - grub_free (part_guid); + VasEBoot_free (root); + VasEBoot_free (part_name); + VasEBoot_free (part_guid); - return grub_errno; + return VasEBoot_errno; } -static grub_extcmd_t cmd_next; +static VasEBoot_extcmd_t cmd_next; -GRUB_MOD_INIT(gptprio) +VasEBoot_MOD_INIT(gptprio) { - cmd_next = grub_register_extcmd ("gptprio.next", grub_cmd_next, 0, + cmd_next = VasEBoot_register_extcmd ("gptprio.next", VasEBoot_cmd_next, 0, N_("-d VARNAME -u VARNAME [DEVICE]"), N_("Select next partition to boot."), options_next); } -GRUB_MOD_FINI(gptprio) +VasEBoot_MOD_FINI(gptprio) { - grub_unregister_extcmd (cmd_next); + VasEBoot_unregister_extcmd (cmd_next); } diff --git a/VasEBoot-core/commands/gptrepair.c b/VasEBoot-core/commands/gptrepair.c index c17c7346c..696794d6a 100644 --- a/VasEBoot-core/commands/gptrepair.c +++ b/VasEBoot-core/commands/gptrepair.c @@ -1,36 +1,36 @@ /* gptrepair.c - verify and restore GPT info from alternate location. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * Copyright (C) 2014 CoreOS, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static char * trim_dev_name (char *name) { - grub_size_t len = grub_strlen (name); + VasEBoot_size_t len = VasEBoot_strlen (name); if (len && name[0] == '(' && name[len - 1] == ')') { name[len - 1] = '\0'; @@ -39,72 +39,72 @@ trim_dev_name (char *name) return name; } -static grub_err_t -grub_cmd_gptrepair (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_gptrepair (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_device_t dev = NULL; - grub_gpt_t gpt = NULL; + VasEBoot_device_t dev = NULL; + VasEBoot_gpt_t gpt = NULL; char *dev_name; - if (argc != 1 || !grub_strlen(args[0])) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + if (argc != 1 || !VasEBoot_strlen(args[0])) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "device name required"); dev_name = trim_dev_name (args[0]); - dev = grub_device_open (dev_name); + dev = VasEBoot_device_open (dev_name); if (!dev) goto done; if (!dev->disk) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "not a disk"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not a disk"); goto done; } - gpt = grub_gpt_read (dev->disk); + gpt = VasEBoot_gpt_read (dev->disk); if (!gpt) goto done; - if (grub_gpt_both_valid (gpt)) + if (VasEBoot_gpt_both_valid (gpt)) { - grub_printf_ (N_("GPT already valid, %s unmodified.\n"), dev_name); + VasEBoot_printf_ (N_("GPT already valid, %s unmodified.\n"), dev_name); goto done; } - if (!grub_gpt_primary_valid (gpt)) - grub_printf_ (N_("Found invalid primary GPT on %s\n"), dev_name); + if (!VasEBoot_gpt_primary_valid (gpt)) + VasEBoot_printf_ (N_("Found invalid primary GPT on %s\n"), dev_name); - if (!grub_gpt_backup_valid (gpt)) - grub_printf_ (N_("Found invalid backup GPT on %s\n"), dev_name); + if (!VasEBoot_gpt_backup_valid (gpt)) + VasEBoot_printf_ (N_("Found invalid backup GPT on %s\n"), dev_name); - if (grub_gpt_repair (dev->disk, gpt)) + if (VasEBoot_gpt_repair (dev->disk, gpt)) goto done; - if (grub_gpt_write (dev->disk, gpt)) + if (VasEBoot_gpt_write (dev->disk, gpt)) goto done; - grub_printf_ (N_("Repaired GPT on %s\n"), dev_name); + VasEBoot_printf_ (N_("Repaired GPT on %s\n"), dev_name); done: if (gpt) - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(gptrepair) +VasEBoot_MOD_INIT(gptrepair) { - cmd = grub_register_command ("gptrepair", grub_cmd_gptrepair, + cmd = VasEBoot_register_command ("gptrepair", VasEBoot_cmd_gptrepair, N_("DEVICE"), N_("Verify and repair GPT on drive DEVICE.")); } -GRUB_MOD_FINI(gptrepair) +VasEBoot_MOD_FINI(gptrepair) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/gptsync.c b/VasEBoot-core/commands/gptsync.c index 444e24874..c68aa7b2d 100644 --- a/VasEBoot-core/commands/gptsync.c +++ b/VasEBoot-core/commands/gptsync.c @@ -1,47 +1,47 @@ /* gptsync.c - fill the mbr based on gpt entries */ /* XXX: I don't know what to do if sector size isn't 512 bytes */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Convert a LBA address to a CHS address in the INT 13 format. */ -/* Taken from grub1. */ +/* Taken from VasEBoot1. */ /* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63. Is it a problem? */ static void -lba_to_chs (grub_uint32_t lba, grub_uint8_t *cl, grub_uint8_t *ch, - grub_uint8_t *dh) +lba_to_chs (VasEBoot_uint32_t lba, VasEBoot_uint8_t *cl, VasEBoot_uint8_t *ch, + VasEBoot_uint8_t *dh) { - grub_uint32_t cylinder, head, sector; - grub_uint32_t sectors = 63, heads = 255, cylinders = 1024; + VasEBoot_uint32_t cylinder, head, sector; + VasEBoot_uint32_t sectors = 63, heads = 255, cylinders = 1024; sector = lba % sectors + 1; head = (lba / sectors) % heads; @@ -58,92 +58,92 @@ lba_to_chs (grub_uint32_t lba, grub_uint8_t *cl, grub_uint8_t *ch, *dh = head; } -static grub_err_t -grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_gptsync (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_device_t dev; - struct grub_msdos_partition_mbr mbr; - struct grub_partition *partition; - grub_disk_addr_t first_sector; + VasEBoot_device_t dev; + struct VasEBoot_msdos_partition_mbr mbr; + struct VasEBoot_partition *partition; + VasEBoot_disk_addr_t first_sector; int numactive = 0; int i; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "device name required"); if (argc > 4) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "only 3 partitions can be " + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only 3 partitions can be " "in hybrid MBR"); - if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') + if (args[0][0] == '(' && args[0][VasEBoot_strlen (args[0]) - 1] == ')') { - args[0][grub_strlen (args[0]) - 1] = 0; - dev = grub_device_open (args[0] + 1); - args[0][grub_strlen (args[0])] = ')'; + args[0][VasEBoot_strlen (args[0]) - 1] = 0; + dev = VasEBoot_device_open (args[0] + 1); + args[0][VasEBoot_strlen (args[0])] = ')'; } else - dev = grub_device_open (args[0]); + dev = VasEBoot_device_open (args[0]); if (! dev) - return grub_errno; + return VasEBoot_errno; if (! dev->disk) { - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a disk"); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not a disk"); } /* Read the protective MBR. */ - if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), &mbr)) + if (VasEBoot_disk_read (dev->disk, 0, 0, sizeof (mbr), &mbr)) { - grub_device_close (dev); - return grub_errno; + VasEBoot_device_close (dev); + return VasEBoot_errno; } /* Check if it is valid. */ - if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) + if (mbr.signature != VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE)) { - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no signature"); } /* Make sure the MBR is a protective MBR and not a normal MBR. */ for (i = 0; i < 4; i++) - if (mbr.entries[i].type == GRUB_PC_PARTITION_TYPE_GPT_DISK) + if (mbr.entries[i].type == VasEBoot_PC_PARTITION_TYPE_GPT_DISK) break; if (i == 4) { - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found"); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no GPT partition map found"); } first_sector = dev->disk->total_sectors; for (i = 1; i < argc; i++) { char *separator, csep = 0; - grub_uint8_t type; - separator = grub_strchr (args[i], '+'); + VasEBoot_uint8_t type; + separator = VasEBoot_strchr (args[i], '+'); if (! separator) - separator = grub_strchr (args[i], '-'); + separator = VasEBoot_strchr (args[i], '-'); if (separator) { csep = *separator; *separator = 0; } - partition = grub_partition_probe (dev->disk, args[i]); + partition = VasEBoot_partition_probe (dev->disk, args[i]); if (separator) *separator = csep; if (! partition) { - grub_device_close (dev); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("no such partition")); } if (partition->start + partition->len > 0xffffffff) { - grub_device_close (dev); - return grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "only partitions residing in the first 2TB " "can be present in hybrid MBR"); } @@ -153,31 +153,31 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), first_sector = partition->start; if (separator && *(separator + 1)) - type = grub_strtoul (separator + 1, 0, 0); + type = VasEBoot_strtoul (separator + 1, 0, 0); else { - grub_fs_t fs = 0; + VasEBoot_fs_t fs = 0; dev->disk->partition = partition; - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); /* Unknown filesystem isn't fatal. */ - if (grub_errno == GRUB_ERR_UNKNOWN_FS) + if (VasEBoot_errno == VasEBoot_ERR_UNKNOWN_FS) { fs = 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - if (fs && grub_strcmp (fs->name, "ntfs") == 0) - type = GRUB_PC_PARTITION_TYPE_NTFS; - else if (fs && grub_strcmp (fs->name, "fat") == 0) + if (fs && VasEBoot_strcmp (fs->name, "ntfs") == 0) + type = VasEBoot_PC_PARTITION_TYPE_NTFS; + else if (fs && VasEBoot_strcmp (fs->name, "fat") == 0) /* FIXME: detect FAT16. */ - type = GRUB_PC_PARTITION_TYPE_FAT32_LBA; - else if (fs && (grub_strcmp (fs->name, "hfsplus") == 0 - || grub_strcmp (fs->name, "hfs") == 0)) - type = GRUB_PC_PARTITION_TYPE_HFS; + type = VasEBoot_PC_PARTITION_TYPE_FAT32_LBA; + else if (fs && (VasEBoot_strcmp (fs->name, "hfsplus") == 0 + || VasEBoot_strcmp (fs->name, "hfs") == 0)) + type = VasEBoot_PC_PARTITION_TYPE_HFS; else /* FIXME: detect more types. */ - type = GRUB_PC_PARTITION_TYPE_EXT2FS; + type = VasEBoot_PC_PARTITION_TYPE_EXT2FS; dev->disk->partition = 0; } @@ -188,13 +188,13 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), numactive++; if (numactive == 2) { - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only one partition can be active"); } } mbr.entries[i].type = type; - mbr.entries[i].start = grub_cpu_to_le32 (partition->start); + mbr.entries[i].start = VasEBoot_cpu_to_le32 (partition->start); lba_to_chs (partition->start, &(mbr.entries[i].start_sector), &(mbr.entries[i].start_cylinder), @@ -203,11 +203,11 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), &(mbr.entries[i].end_sector), &(mbr.entries[i].end_cylinder), &(mbr.entries[i].end_head)); - mbr.entries[i].length = grub_cpu_to_le32 (partition->len); - grub_free (partition); + mbr.entries[i].length = VasEBoot_cpu_to_le32 (partition->len); + VasEBoot_free (partition); } for (; i < 4; i++) - grub_memset (&(mbr.entries[i]), 0, sizeof (mbr.entries[i])); + VasEBoot_memset (&(mbr.entries[i]), 0, sizeof (mbr.entries[i])); /* The protective partition. */ if (first_sector > 0xffffffff) @@ -215,8 +215,8 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), else first_sector--; mbr.entries[0].flag = 0; - mbr.entries[0].type = GRUB_PC_PARTITION_TYPE_GPT_DISK; - mbr.entries[0].start = grub_cpu_to_le32_compile_time (1); + mbr.entries[0].type = VasEBoot_PC_PARTITION_TYPE_GPT_DISK; + mbr.entries[0].start = VasEBoot_cpu_to_le32_compile_time (1); lba_to_chs (1, &(mbr.entries[0].start_sector), &(mbr.entries[0].start_cylinder), @@ -225,30 +225,30 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), &(mbr.entries[0].end_sector), &(mbr.entries[0].end_cylinder), &(mbr.entries[0].end_head)); - mbr.entries[0].length = grub_cpu_to_le32 (first_sector); + mbr.entries[0].length = VasEBoot_cpu_to_le32 (first_sector); - mbr.signature = grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE); + mbr.signature = VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE); - if (grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr)) + if (VasEBoot_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr)) { - grub_device_close (dev); - return grub_errno; + VasEBoot_device_close (dev); + return VasEBoot_errno; } - grub_device_close (dev); + VasEBoot_device_close (dev); - grub_printf_ (N_("New MBR is written to `%s'\n"), args[0]); + VasEBoot_printf_ (N_("New MBR is written to `%s'\n"), args[0]); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(gptsync) +VasEBoot_MOD_INIT(gptsync) { (void) mod; /* To stop warning. */ - cmd = grub_register_command ("gptsync", grub_cmd_gptsync, + cmd = VasEBoot_register_command ("gptsync", VasEBoot_cmd_gptsync, N_("DEVICE [PARTITION[+/-[TYPE]]] ..."), /* TRANSLATORS: MBR type is one-byte partition type id. */ @@ -260,7 +260,7 @@ GRUB_MOD_INIT(gptsync) "Only one partition can be active.")); } -GRUB_MOD_FINI(gptsync) +VasEBoot_MOD_FINI(gptsync) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/halt.c b/VasEBoot-core/commands/halt.c index f8596ecdc..17844fb2f 100644 --- a/VasEBoot-core/commands/halt.c +++ b/VasEBoot-core/commands/halt.c @@ -1,47 +1,47 @@ /* halt.c - command to halt the computer. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t __attribute__ ((noreturn)) -grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t __attribute__ ((noreturn)) +VasEBoot_cmd_halt (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_halt (); + VasEBoot_halt (); } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(halt) +VasEBoot_MOD_INIT(halt) { - cmd = grub_register_command ("halt", grub_cmd_halt, + cmd = VasEBoot_register_command ("halt", VasEBoot_cmd_halt, 0, N_("Halts the computer. This command does" " not work on all firmware implementations.")); } -GRUB_MOD_FINI(halt) +VasEBoot_MOD_FINI(halt) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/hashsum.c b/VasEBoot-core/commands/hashsum.c index d18687351..27a064094 100644 --- a/VasEBoot-core/commands/hashsum.c +++ b/VasEBoot-core/commands/hashsum.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"hash", 'h', 0, N_("Specify hash to use."), N_("HASH"), ARG_TYPE_STRING}, {"check", 'c', 0, N_("Check hashes of files with hash list FILE."), N_("FILE"), ARG_TYPE_STRING}, @@ -60,24 +60,24 @@ hextoval (char c) return -1; } -static grub_err_t -hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result) +static VasEBoot_err_t +hash_file (VasEBoot_file_t file, const gcry_md_spec_t *hash, void *result) { void *context; - grub_uint8_t *readbuf; + VasEBoot_uint8_t *readbuf; #define BUF_SIZE 4096 - readbuf = grub_malloc (BUF_SIZE); + readbuf = VasEBoot_malloc (BUF_SIZE); if (!readbuf) - return grub_errno; - context = grub_zalloc (hash->contextsize); + return VasEBoot_errno; + context = VasEBoot_zalloc (hash->contextsize); if (!readbuf || !context) goto fail; hash->init (context); while (1) { - grub_ssize_t r; - r = grub_file_read (file, readbuf, BUF_SIZE); + VasEBoot_ssize_t r; + r = VasEBoot_file_read (file, readbuf, BUF_SIZE); if (r < 0) goto fail; if (r == 0) @@ -85,42 +85,42 @@ hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result) hash->write (context, readbuf, r); } hash->final (context); - grub_memcpy (result, hash->read (context), hash->mdlen); + VasEBoot_memcpy (result, hash->read (context), hash->mdlen); - grub_free (readbuf); - grub_free (context); + VasEBoot_free (readbuf); + VasEBoot_free (context); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (readbuf); - grub_free (context); - return grub_errno; + VasEBoot_free (readbuf); + VasEBoot_free (context); + return VasEBoot_errno; } -static grub_err_t +static VasEBoot_err_t check_list (const gcry_md_spec_t *hash, const char *hashfilename, const char *prefix, int keep, int uncompress) { - grub_file_t hashlist, file; + VasEBoot_file_t hashlist, file; char *buf = NULL; - grub_uint8_t expected[GRUB_CRYPTO_MAX_MDLEN]; - grub_uint8_t actual[GRUB_CRYPTO_MAX_MDLEN]; - grub_err_t err; + VasEBoot_uint8_t expected[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t actual[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_err_t err; unsigned i; unsigned unread = 0, mismatch = 0; - if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN) - return grub_error (GRUB_ERR_BUG, "mdlen is too long"); + if (hash->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) + return VasEBoot_error (VasEBoot_ERR_BUG, "mdlen is too long"); - hashlist = grub_file_open (hashfilename); + hashlist = VasEBoot_file_open (hashfilename); if (!hashlist) - return grub_errno; + return VasEBoot_errno; - while (grub_free (buf), (buf = grub_file_getline (hashlist))) + while (VasEBoot_free (buf), (buf = VasEBoot_file_getline (hashlist))) { const char *p = buf; - while (grub_isspace (p[0])) + while (VasEBoot_isspace (p[0])) p++; for (i = 0; i < hash->mdlen; i++) { @@ -128,79 +128,79 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename, high = hextoval (*p++); low = hextoval (*p++); if (high < 0 || low < 0) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid hash list"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "invalid hash list"); expected[i] = (high << 4) | low; } if ((p[0] != ' ' && p[0] != '\t') || (p[1] != ' ' && p[1] != '\t')) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid hash list"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "invalid hash list"); p += 2; if (prefix) { char *filename; - filename = grub_xasprintf ("%s/%s", prefix, p); + filename = VasEBoot_xasprintf ("%s/%s", prefix, p); if (!filename) - return grub_errno; + return VasEBoot_errno; if (!uncompress) - grub_file_filter_disable_compression (); - file = grub_file_open (filename); - grub_free (filename); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (filename); + VasEBoot_free (filename); } else { if (!uncompress) - grub_file_filter_disable_compression (); - file = grub_file_open (p); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (p); } if (!file) { - grub_file_close (hashlist); - grub_free (buf); - return grub_errno; + VasEBoot_file_close (hashlist); + VasEBoot_free (buf); + return VasEBoot_errno; } err = hash_file (file, hash, actual); - grub_file_close (file); + VasEBoot_file_close (file); if (err) { - grub_printf_ (N_("%s: READ ERROR\n"), p); + VasEBoot_printf_ (N_("%s: READ ERROR\n"), p); if (!keep) { - grub_file_close (hashlist); - grub_free (buf); + VasEBoot_file_close (hashlist); + VasEBoot_free (buf); return err; } - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; unread++; continue; } - if (grub_crypto_memcmp (expected, actual, hash->mdlen) != 0) + if (VasEBoot_crypto_memcmp (expected, actual, hash->mdlen) != 0) { - grub_printf_ (N_("%s: HASH MISMATCH\n"), p); + VasEBoot_printf_ (N_("%s: HASH MISMATCH\n"), p); if (!keep) { - grub_file_close (hashlist); - grub_free (buf); - return grub_error (GRUB_ERR_TEST_FAILURE, + VasEBoot_file_close (hashlist); + VasEBoot_free (buf); + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, "hash of '%s' mismatches", p); } mismatch++; continue; } - grub_printf_ (N_("%s: OK\n"), p); + VasEBoot_printf_ (N_("%s: OK\n"), p); } if (mismatch || unread) - return grub_error (GRUB_ERR_TEST_FAILURE, + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, "%d files couldn't be read and hash " "of %d files mismatches", unread, mismatch); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_hashsum (struct grub_extcmd_context *ctxt, +static VasEBoot_err_t +VasEBoot_cmd_hashsum (struct VasEBoot_extcmd_context *ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; const char *hashname = NULL; const char *prefix = NULL; const gcry_md_spec_t *hash; @@ -210,20 +210,20 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt, unsigned unread = 0; for (i = 0; i < ARRAY_SIZE (aliases); i++) - if (grub_strcmp (ctxt->extcmd->cmd->name, aliases[i].name) == 0) + if (VasEBoot_strcmp (ctxt->extcmd->cmd->name, aliases[i].name) == 0) hashname = aliases[i].hashname; if (state[0].set) hashname = state[0].arg; if (!hashname) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no hash specified"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no hash specified"); - hash = grub_crypto_lookup_md_by_name (hashname); + hash = VasEBoot_crypto_lookup_md_by_name (hashname); if (!hash) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown hash"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unknown hash"); - if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN) - return grub_error (GRUB_ERR_BUG, "mdlen is too long"); + if (hash->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) + return VasEBoot_error (VasEBoot_ERR_BUG, "mdlen is too long"); if (state[2].set) prefix = state[2].arg; @@ -231,56 +231,56 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt, if (state[1].set) { if (argc != 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "--check is incompatible with file list"); return check_list (hash, state[1].arg, prefix, keep, uncompress); } for (i = 0; i < (unsigned) argc; i++) { - GRUB_PROPERLY_ALIGNED_ARRAY (result, GRUB_CRYPTO_MAX_MDLEN); - grub_file_t file; - grub_err_t err; + VasEBoot_PROPERLY_ALIGNED_ARRAY (result, VasEBoot_CRYPTO_MAX_MDLEN); + VasEBoot_file_t file; + VasEBoot_err_t err; unsigned j; if (!uncompress) - grub_file_filter_disable_compression (); - file = grub_file_open (args[i]); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (args[i]); if (!file) { if (!keep) - return grub_errno; - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + return VasEBoot_errno; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; unread++; continue; } err = hash_file (file, hash, result); - grub_file_close (file); + VasEBoot_file_close (file); if (err) { if (!keep) return err; - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; unread++; continue; } for (j = 0; j < hash->mdlen; j++) - grub_printf ("%02x", ((grub_uint8_t *) result)[j]); - grub_printf (" %s\n", args[i]); + VasEBoot_printf ("%02x", ((VasEBoot_uint8_t *) result)[j]); + VasEBoot_printf (" %s\n", args[i]); } if (unread) - return grub_error (GRUB_ERR_TEST_FAILURE, "%d files couldn't be read", + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, "%d files couldn't be read", unread); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd, cmd_md5, cmd_sha1, cmd_sha256, cmd_sha512, cmd_crc; +static VasEBoot_extcmd_t cmd, cmd_md5, cmd_sha1, cmd_sha256, cmd_sha512, cmd_crc; -GRUB_MOD_INIT(hashsum) +VasEBoot_MOD_INIT(hashsum) { - cmd = grub_register_extcmd ("hashsum", grub_cmd_hashsum, 0, + cmd = VasEBoot_register_extcmd ("hashsum", VasEBoot_cmd_hashsum, 0, N_("-h HASH [-c FILE [-p PREFIX]] " "[FILE1 [FILE2 ...]]"), /* TRANSLATORS: "hash checksum" is just to @@ -288,40 +288,40 @@ GRUB_MOD_INIT(hashsum) just "hash". */ N_("Compute or check hash checksum."), options); - cmd_md5 = grub_register_extcmd ("md5sum", grub_cmd_hashsum, 0, + cmd_md5 = VasEBoot_register_extcmd ("md5sum", VasEBoot_cmd_hashsum, 0, N_("[-c FILE [-p PREFIX]] " "[FILE1 [FILE2 ...]]"), N_("Compute or check hash checksum."), options); - cmd_sha1 = grub_register_extcmd ("sha1sum", grub_cmd_hashsum, 0, + cmd_sha1 = VasEBoot_register_extcmd ("sha1sum", VasEBoot_cmd_hashsum, 0, N_("[-c FILE [-p PREFIX]] " "[FILE1 [FILE2 ...]]"), N_("Compute or check hash checksum."), options); - cmd_sha256 = grub_register_extcmd ("sha256sum", grub_cmd_hashsum, 0, + cmd_sha256 = VasEBoot_register_extcmd ("sha256sum", VasEBoot_cmd_hashsum, 0, N_("[-c FILE [-p PREFIX]] " "[FILE1 [FILE2 ...]]"), N_("Compute or check hash checksum."), options); - cmd_sha512 = grub_register_extcmd ("sha512sum", grub_cmd_hashsum, 0, + cmd_sha512 = VasEBoot_register_extcmd ("sha512sum", VasEBoot_cmd_hashsum, 0, N_("[-c FILE [-p PREFIX]] " "[FILE1 [FILE2 ...]]"), N_("Compute or check hash checksum."), options); - cmd_crc = grub_register_extcmd ("crc", grub_cmd_hashsum, 0, + cmd_crc = VasEBoot_register_extcmd ("crc", VasEBoot_cmd_hashsum, 0, N_("[-c FILE [-p PREFIX]] " "[FILE1 [FILE2 ...]]"), N_("Compute or check hash checksum."), options); } -GRUB_MOD_FINI(hashsum) +VasEBoot_MOD_FINI(hashsum) { - grub_unregister_extcmd (cmd); - grub_unregister_extcmd (cmd_md5); - grub_unregister_extcmd (cmd_sha1); - grub_unregister_extcmd (cmd_sha256); - grub_unregister_extcmd (cmd_sha512); - grub_unregister_extcmd (cmd_crc); + VasEBoot_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd_md5); + VasEBoot_unregister_extcmd (cmd_sha1); + VasEBoot_unregister_extcmd (cmd_sha256); + VasEBoot_unregister_extcmd (cmd_sha512); + VasEBoot_unregister_extcmd (cmd_crc); } diff --git a/VasEBoot-core/commands/hdparm.c b/VasEBoot-core/commands/hdparm.c index d3fa9661e..2218629ae 100644 --- a/VasEBoot-core/commands/hdparm.c +++ b/VasEBoot-core/commands/hdparm.c @@ -1,35 +1,35 @@ /* hdparm.c - command to get/set ATA disk parameters. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"apm", 'B', 0, N_("Set Advanced Power Management\n" "(1=low, ..., 254=high, 255=off)."), 0, ARG_TYPE_INT}, @@ -54,22 +54,22 @@ static const struct grub_arg_option options[] = { {0, 0, 0, 0, 0, 0} }; -enum grub_ata_smart_commands +enum VasEBoot_ata_smart_commands { - GRUB_ATA_FEAT_SMART_ENABLE = 0xd8, - GRUB_ATA_FEAT_SMART_DISABLE = 0xd9, - GRUB_ATA_FEAT_SMART_STATUS = 0xda, + VasEBoot_ATA_FEAT_SMART_ENABLE = 0xd8, + VasEBoot_ATA_FEAT_SMART_DISABLE = 0xd9, + VasEBoot_ATA_FEAT_SMART_STATUS = 0xda, }; static int quiet = 0; -static grub_err_t -grub_hdparm_do_ata_cmd (grub_ata_t ata, grub_uint8_t cmd, - grub_uint8_t features, grub_uint8_t sectors, +static VasEBoot_err_t +VasEBoot_hdparm_do_ata_cmd (VasEBoot_ata_t ata, VasEBoot_uint8_t cmd, + VasEBoot_uint8_t features, VasEBoot_uint8_t sectors, void * buffer, int size) { - struct grub_disk_ata_pass_through_parms apt; - grub_memset (&apt, 0, sizeof (apt)); + struct VasEBoot_disk_ata_pass_through_parms apt; + VasEBoot_memset (&apt, 0, sizeof (apt)); apt.taskfile.cmd = cmd; apt.taskfile.features = features; @@ -80,18 +80,18 @@ grub_hdparm_do_ata_cmd (grub_ata_t ata, grub_uint8_t cmd, apt.size = size; if (ata->dev->readwrite (ata, &apt, 0)) - return grub_errno; + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -grub_hdparm_do_check_powermode_cmd (grub_ata_t ata) +VasEBoot_hdparm_do_check_powermode_cmd (VasEBoot_ata_t ata) { - struct grub_disk_ata_pass_through_parms apt; - grub_memset (&apt, 0, sizeof (apt)); + struct VasEBoot_disk_ata_pass_through_parms apt; + VasEBoot_memset (&apt, 0, sizeof (apt)); - apt.taskfile.cmd = GRUB_ATA_CMD_CHECK_POWER_MODE; + apt.taskfile.cmd = VasEBoot_ATA_CMD_CHECK_POWER_MODE; apt.taskfile.disk = 0xE0; if (ata->dev->readwrite (ata, &apt, 0)) @@ -101,12 +101,12 @@ grub_hdparm_do_check_powermode_cmd (grub_ata_t ata) } static int -grub_hdparm_do_smart_cmd (grub_ata_t ata, grub_uint8_t features) +VasEBoot_hdparm_do_smart_cmd (VasEBoot_ata_t ata, VasEBoot_uint8_t features) { - struct grub_disk_ata_pass_through_parms apt; - grub_memset (&apt, 0, sizeof (apt)); + struct VasEBoot_disk_ata_pass_through_parms apt; + VasEBoot_memset (&apt, 0, sizeof (apt)); - apt.taskfile.cmd = GRUB_ATA_CMD_SMART; + apt.taskfile.cmd = VasEBoot_ATA_CMD_SMART; apt.taskfile.features = features; apt.taskfile.lba_mid = 0x4f; apt.taskfile.lba_high = 0xc2; @@ -115,7 +115,7 @@ grub_hdparm_do_smart_cmd (grub_ata_t ata, grub_uint8_t features) if (ata->dev->readwrite (ata, &apt, 0)) return -1; - if (features == GRUB_ATA_FEAT_SMART_STATUS) + if (features == VasEBoot_ATA_FEAT_SMART_STATUS) { if ( apt.taskfile.lba_mid == 0x4f && apt.taskfile.lba_high == 0xc2) @@ -129,118 +129,118 @@ grub_hdparm_do_smart_cmd (grub_ata_t ata, grub_uint8_t features) return 0; } -static grub_err_t -grub_hdparm_simple_cmd (const char * msg, - grub_ata_t ata, grub_uint8_t cmd) +static VasEBoot_err_t +VasEBoot_hdparm_simple_cmd (const char * msg, + VasEBoot_ata_t ata, VasEBoot_uint8_t cmd) { if (! quiet && msg) - grub_printf ("%s", msg); + VasEBoot_printf ("%s", msg); - grub_err_t err = grub_hdparm_do_ata_cmd (ata, cmd, 0, 0, NULL, 0); + VasEBoot_err_t err = VasEBoot_hdparm_do_ata_cmd (ata, cmd, 0, 0, NULL, 0); if (! quiet && msg) - grub_printf ("%s\n", ! err ? "" : ": not supported"); + VasEBoot_printf ("%s\n", ! err ? "" : ": not supported"); return err; } -static grub_err_t -grub_hdparm_set_val_cmd (const char * msg, int val, - grub_ata_t ata, grub_uint8_t cmd, - grub_uint8_t features, grub_uint8_t sectors) +static VasEBoot_err_t +VasEBoot_hdparm_set_val_cmd (const char * msg, int val, + VasEBoot_ata_t ata, VasEBoot_uint8_t cmd, + VasEBoot_uint8_t features, VasEBoot_uint8_t sectors) { if (! quiet && msg && *msg) { if (val >= 0) - grub_printf ("Set %s to %d", msg, val); + VasEBoot_printf ("Set %s to %d", msg, val); else - grub_printf ("Disable %s", msg); + VasEBoot_printf ("Disable %s", msg); } - grub_err_t err = grub_hdparm_do_ata_cmd (ata, cmd, features, sectors, + VasEBoot_err_t err = VasEBoot_hdparm_do_ata_cmd (ata, cmd, features, sectors, NULL, 0); if (! quiet && msg) - grub_printf ("%s\n", ! err ? "" : ": not supported"); + VasEBoot_printf ("%s\n", ! err ? "" : ": not supported"); return err; } static const char * -le16_to_char (grub_uint16_t *dest, const grub_uint16_t * src16, unsigned bytes) +le16_to_char (VasEBoot_uint16_t *dest, const VasEBoot_uint16_t * src16, unsigned bytes) { unsigned i; for (i = 0; i < bytes / 2; i++) - dest[i] = grub_swap_bytes16 (src16[i]); + dest[i] = VasEBoot_swap_bytes16 (src16[i]); dest[i] = 0; return (char *) dest; } static void -grub_hdparm_print_identify (const grub_uint16_t * idw) +VasEBoot_hdparm_print_identify (const VasEBoot_uint16_t * idw) { /* Print identity strings. */ - grub_uint16_t tmp[21]; - grub_printf ("Model: \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40)); - grub_printf ("Firmware: \"%.8s\"\n", le16_to_char (tmp, &idw[23], 8)); - grub_printf ("Serial: \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20)); + VasEBoot_uint16_t tmp[21]; + VasEBoot_printf ("Model: \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40)); + VasEBoot_printf ("Firmware: \"%.8s\"\n", le16_to_char (tmp, &idw[23], 8)); + VasEBoot_printf ("Serial: \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20)); /* Print AAM, APM and SMART settings. */ - grub_uint16_t features1 = grub_le_to_cpu16 (idw[82]); - grub_uint16_t features2 = grub_le_to_cpu16 (idw[83]); - grub_uint16_t enabled1 = grub_le_to_cpu16 (idw[85]); - grub_uint16_t enabled2 = grub_le_to_cpu16 (idw[86]); + VasEBoot_uint16_t features1 = VasEBoot_le_to_cpu16 (idw[82]); + VasEBoot_uint16_t features2 = VasEBoot_le_to_cpu16 (idw[83]); + VasEBoot_uint16_t enabled1 = VasEBoot_le_to_cpu16 (idw[85]); + VasEBoot_uint16_t enabled2 = VasEBoot_le_to_cpu16 (idw[86]); - grub_printf ("Automatic Acoustic Management: "); + VasEBoot_printf ("Automatic Acoustic Management: "); if (features2 & 0x0200) { if (enabled2 & 0x0200) { - grub_uint16_t aam = grub_le_to_cpu16 (idw[94]); - grub_printf ("%u (128=quiet, ..., 254=fast, recommended=%u)\n", + VasEBoot_uint16_t aam = VasEBoot_le_to_cpu16 (idw[94]); + VasEBoot_printf ("%u (128=quiet, ..., 254=fast, recommended=%u)\n", aam & 0xff, (aam >> 8) & 0xff); } else - grub_printf ("disabled\n"); + VasEBoot_printf ("disabled\n"); } else - grub_printf ("not supported\n"); + VasEBoot_printf ("not supported\n"); - grub_printf ("Advanced Power Management: "); + VasEBoot_printf ("Advanced Power Management: "); if (features2 & 0x0008) { if (enabled2 & 0x0008) - grub_printf ("%u (1=low, ..., 254=high)\n", - grub_le_to_cpu16 (idw[91]) & 0xff); + VasEBoot_printf ("%u (1=low, ..., 254=high)\n", + VasEBoot_le_to_cpu16 (idw[91]) & 0xff); else - grub_printf ("disabled\n"); + VasEBoot_printf ("disabled\n"); } else - grub_printf ("not supported\n"); + VasEBoot_printf ("not supported\n"); - grub_printf ("SMART Feature Set: "); + VasEBoot_printf ("SMART Feature Set: "); if (features1 & 0x0001) - grub_printf ("%sabled\n", (enabled1 & 0x0001 ? "en" : "dis")); + VasEBoot_printf ("%sabled\n", (enabled1 & 0x0001 ? "en" : "dis")); else - grub_printf ("not supported\n"); + VasEBoot_printf ("not supported\n"); /* Print security settings. */ - grub_uint16_t security = grub_le_to_cpu16 (idw[128]); + VasEBoot_uint16_t security = VasEBoot_le_to_cpu16 (idw[128]); - grub_printf ("ATA Security: "); + VasEBoot_printf ("ATA Security: "); if (security & 0x0001) - grub_printf ("%s, %s, %s, %s\n", + VasEBoot_printf ("%s, %s, %s, %s\n", (security & 0x0002 ? "ENABLED" : "disabled"), (security & 0x0004 ? "**LOCKED**" : "not locked"), (security & 0x0008 ? "frozen" : "NOT FROZEN"), (security & 0x0010 ? "COUNT EXPIRED" : "count not expired")); else - grub_printf ("not supported\n"); + VasEBoot_printf ("not supported\n"); } static void -grub_hdparm_print_standby_tout (int timeout) +VasEBoot_hdparm_print_standby_tout (int timeout) { if (timeout == 0) - grub_printf ("off"); + VasEBoot_printf ("off"); else if (timeout <= 252 || timeout == 255) { int h = 0, m = 0 , s = 0; @@ -263,31 +263,31 @@ grub_hdparm_print_standby_tout (int timeout) h = m / 60; m %= 60; } - grub_printf ("%02d:%02d:%02d", h, m, s); + VasEBoot_printf ("%02d:%02d:%02d", h, m, s); } else - grub_printf ("invalid or vendor-specific"); + VasEBoot_printf ("invalid or vendor-specific"); } -static int get_int_arg (const struct grub_arg_list *state) +static int get_int_arg (const struct VasEBoot_arg_list *state) { - return (state->set ? (int)grub_strtoul (state->arg, 0, 0) : -1); + return (state->set ? (int)VasEBoot_strtoul (state->arg, 0, 0) : -1); } -static grub_err_t -grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_hdparm (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - struct grub_ata *ata; + struct VasEBoot_arg_list *state = ctxt->state; + struct VasEBoot_ata *ata; const char *diskname; /* Check command line. */ if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); if (args[0][0] == '(') { - grub_size_t len = grub_strlen (args[0]); + VasEBoot_size_t len = VasEBoot_strlen (args[0]); if (args[0][len - 1] == ')') args[0][len - 1] = 0; diskname = &args[0][1]; @@ -310,41 +310,41 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args) quiet = state[i++].set; /* Open disk. */ - grub_disk_t disk = grub_disk_open (diskname); + VasEBoot_disk_t disk = VasEBoot_disk_open (diskname); if (! disk) - return grub_errno; + return VasEBoot_errno; switch (disk->dev->id) { - case GRUB_DISK_DEVICE_ATA_ID: + case VasEBoot_DISK_DEVICE_ATA_ID: ata = disk->data; break; - case GRUB_DISK_DEVICE_SCSI_ID: - if (((disk->id >> GRUB_SCSI_ID_SUBSYSTEM_SHIFT) & 0xFF) - == GRUB_SCSI_SUBSYSTEM_PATA - || (((disk->id >> GRUB_SCSI_ID_SUBSYSTEM_SHIFT) & 0xFF) - == GRUB_SCSI_SUBSYSTEM_AHCI)) + case VasEBoot_DISK_DEVICE_SCSI_ID: + if (((disk->id >> VasEBoot_SCSI_ID_SUBSYSTEM_SHIFT) & 0xFF) + == VasEBoot_SCSI_SUBSYSTEM_PATA + || (((disk->id >> VasEBoot_SCSI_ID_SUBSYSTEM_SHIFT) & 0xFF) + == VasEBoot_SCSI_SUBSYSTEM_AHCI)) { - ata = ((struct grub_scsi *) disk->data)->data; + ata = ((struct VasEBoot_scsi *) disk->data)->data; break; } /* FALLTHROUGH */ default: - grub_disk_close (disk); - return grub_error (GRUB_ERR_IO, "not an ATA device"); + VasEBoot_disk_close (disk); + return VasEBoot_error (VasEBoot_ERR_IO, "not an ATA device"); } /* Change settings. */ if (aam >= 0) - grub_hdparm_set_val_cmd ("Automatic Acoustic Management", (aam ? aam : -1), - ata, GRUB_ATA_CMD_SET_FEATURES, + VasEBoot_hdparm_set_val_cmd ("Automatic Acoustic Management", (aam ? aam : -1), + ata, VasEBoot_ATA_CMD_SET_FEATURES, (aam ? 0x42 : 0xc2), aam); if (apm >= 0) - grub_hdparm_set_val_cmd ("Advanced Power Management", + VasEBoot_hdparm_set_val_cmd ("Advanced Power Management", (apm != 255 ? apm : -1), ata, - GRUB_ATA_CMD_SET_FEATURES, + VasEBoot_ATA_CMD_SET_FEATURES, (apm != 255 ? 0x05 : 0x85), (apm != 255 ? apm : 0)); @@ -352,39 +352,39 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args) { if (! quiet) { - grub_printf ("Set standby timeout to %d (", standby_tout); - grub_hdparm_print_standby_tout (standby_tout); - grub_printf (")"); + VasEBoot_printf ("Set standby timeout to %d (", standby_tout); + VasEBoot_hdparm_print_standby_tout (standby_tout); + VasEBoot_printf (")"); } /* The IDLE cmd sets disk to idle mode and configures standby timer. */ - grub_hdparm_set_val_cmd ("", -1, ata, GRUB_ATA_CMD_IDLE, 0, standby_tout); + VasEBoot_hdparm_set_val_cmd ("", -1, ata, VasEBoot_ATA_CMD_IDLE, 0, standby_tout); } if (enable_smart >= 0) { if (! quiet) - grub_printf ("%sable SMART operations", (enable_smart ? "En" : "Dis")); - int err = grub_hdparm_do_smart_cmd (ata, (enable_smart ? - GRUB_ATA_FEAT_SMART_ENABLE : GRUB_ATA_FEAT_SMART_DISABLE)); + VasEBoot_printf ("%sable SMART operations", (enable_smart ? "En" : "Dis")); + int err = VasEBoot_hdparm_do_smart_cmd (ata, (enable_smart ? + VasEBoot_ATA_FEAT_SMART_ENABLE : VasEBoot_ATA_FEAT_SMART_DISABLE)); if (! quiet) - grub_printf ("%s\n", err ? ": not supported" : ""); + VasEBoot_printf ("%s\n", err ? ": not supported" : ""); } if (sec_freeze) - grub_hdparm_simple_cmd ("Freeze security settings", ata, - GRUB_ATA_CMD_SECURITY_FREEZE_LOCK); + VasEBoot_hdparm_simple_cmd ("Freeze security settings", ata, + VasEBoot_ATA_CMD_SECURITY_FREEZE_LOCK); /* Print/dump IDENTIFY. */ if (ident || dumpid) { - grub_uint16_t buf[GRUB_DISK_SECTOR_SIZE / 2]; - if (grub_hdparm_do_ata_cmd (ata, GRUB_ATA_CMD_IDENTIFY_DEVICE, + VasEBoot_uint16_t buf[VasEBoot_DISK_SECTOR_SIZE / 2]; + if (VasEBoot_hdparm_do_ata_cmd (ata, VasEBoot_ATA_CMD_IDENTIFY_DEVICE, 0, 0, buf, sizeof (buf))) - grub_printf ("Cannot read ATA IDENTIFY data\n"); + VasEBoot_printf ("Cannot read ATA IDENTIFY data\n"); else { if (ident) - grub_hdparm_print_identify (buf); + VasEBoot_hdparm_print_identify (buf); if (dumpid) hexdump (0, (char *) buf, sizeof (buf)); } @@ -393,12 +393,12 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args) /* Check power mode. */ if (power) { - grub_printf ("Disk power mode is: "); - int mode = grub_hdparm_do_check_powermode_cmd (ata); + VasEBoot_printf ("Disk power mode is: "); + int mode = VasEBoot_hdparm_do_check_powermode_cmd (ata); if (mode < 0) - grub_printf ("unknown\n"); + VasEBoot_printf ("unknown\n"); else - grub_printf ("%s (0x%02x)\n", + VasEBoot_printf ("%s (0x%02x)\n", (mode == 0xff ? "active/idle" : mode == 0x80 ? "idle" : mode == 0x00 ? "standby" : "unknown"), mode); @@ -409,39 +409,39 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args) if (health) { if (! quiet) - grub_printf ("SMART status is: "); - int err = grub_hdparm_do_smart_cmd (ata, GRUB_ATA_FEAT_SMART_STATUS); + VasEBoot_printf ("SMART status is: "); + int err = VasEBoot_hdparm_do_smart_cmd (ata, VasEBoot_ATA_FEAT_SMART_STATUS); if (! quiet) - grub_printf ("%s\n", (err < 0 ? "unknown" : + VasEBoot_printf ("%s\n", (err < 0 ? "unknown" : err == 0 ? "OK" : "*BAD*")); status = (err > 0); } /* Change power mode. */ if (standby_now) - grub_hdparm_simple_cmd ("Set disk to standby mode", ata, - GRUB_ATA_CMD_STANDBY_IMMEDIATE); + VasEBoot_hdparm_simple_cmd ("Set disk to standby mode", ata, + VasEBoot_ATA_CMD_STANDBY_IMMEDIATE); if (sleep_now) - grub_hdparm_simple_cmd ("Set disk to sleep mode", ata, - GRUB_ATA_CMD_SLEEP); + VasEBoot_hdparm_simple_cmd ("Set disk to sleep mode", ata, + VasEBoot_ATA_CMD_SLEEP); - grub_disk_close (disk); + VasEBoot_disk_close (disk); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return status; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(hdparm) +VasEBoot_MOD_INIT(hdparm) { - cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, 0, + cmd = VasEBoot_register_extcmd ("hdparm", VasEBoot_cmd_hdparm, 0, N_("[OPTIONS] DISK"), N_("Get/set ATA disk parameters."), options); } -GRUB_MOD_FINI(hdparm) +VasEBoot_MOD_FINI(hdparm) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/help.c b/VasEBoot-core/commands/help.c index f0be89baa..f0583a9c9 100644 --- a/VasEBoot-core/commands/help.c +++ b/VasEBoot-core/commands/help.c @@ -1,35 +1,35 @@ /* help.c - command to show a help text. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, +static VasEBoot_err_t +VasEBoot_cmd_help (VasEBoot_extcmd_context_t ctxt __attribute__ ((unused)), int argc, char **args) { int cnt = 0; @@ -37,69 +37,69 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, if (argc == 0) { - grub_command_t cmd; + VasEBoot_command_t cmd; FOR_COMMANDS(cmd) { - if ((cmd->prio & GRUB_COMMAND_FLAG_ACTIVE)) + if ((cmd->prio & VasEBoot_COMMAND_FLAG_ACTIVE)) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; const char *summary_translated = _(cmd->summary); char *command_help; - grub_uint32_t *unicode_command_help; - grub_uint32_t *unicode_last_position; + VasEBoot_uint32_t *unicode_command_help; + VasEBoot_uint32_t *unicode_last_position; - command_help = grub_xasprintf ("%s %s", cmd->name, summary_translated); + command_help = VasEBoot_xasprintf ("%s %s", cmd->name, summary_translated); if (!command_help) break; - grub_utf8_to_ucs4_alloc (command_help, &unicode_command_help, + VasEBoot_utf8_to_ucs4_alloc (command_help, &unicode_command_help, &unicode_last_position); FOR_ACTIVE_TERM_OUTPUTS(term) { unsigned stringwidth; - grub_uint32_t *unicode_last_screen_position; + VasEBoot_uint32_t *unicode_last_screen_position; unicode_last_screen_position = unicode_command_help; stringwidth = 0; while (unicode_last_screen_position < unicode_last_position && - stringwidth < ((grub_term_width (term) / 2) - 2)) + stringwidth < ((VasEBoot_term_width (term) / 2) - 2)) { - struct grub_unicode_glyph glyph; + struct VasEBoot_unicode_glyph glyph; unicode_last_screen_position - += grub_unicode_aglomerate_comb (unicode_last_screen_position, + += VasEBoot_unicode_aglomerate_comb (unicode_last_screen_position, unicode_last_position - unicode_last_screen_position, &glyph); stringwidth - += grub_term_getcharwidth (term, &glyph); + += VasEBoot_term_getcharwidth (term, &glyph); } - grub_print_ucs4 (unicode_command_help, + VasEBoot_print_ucs4 (unicode_command_help, unicode_last_screen_position, 0, 0, term); if (!(cnt % 2)) - grub_print_spaces (term, grub_term_width (term) / 2 + VasEBoot_print_spaces (term, VasEBoot_term_width (term) / 2 - stringwidth); } if (cnt % 2) - grub_printf ("\n"); + VasEBoot_printf ("\n"); cnt++; - grub_free (command_help); - grub_free (unicode_command_help); + VasEBoot_free (command_help); + VasEBoot_free (unicode_command_help); } } if (!(cnt % 2)) - grub_printf ("\n"); + VasEBoot_printf ("\n"); } else { int i; - grub_command_t cmd_iter, cmd, cmd_next; + VasEBoot_command_t cmd_iter, cmd, cmd_next; for (i = 0; i < argc; i++) { @@ -107,29 +107,29 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, FOR_COMMANDS_SAFE (cmd_iter, cmd_next) { - if (!(cmd_iter->prio & GRUB_COMMAND_FLAG_ACTIVE)) + if (!(cmd_iter->prio & VasEBoot_COMMAND_FLAG_ACTIVE)) continue; - if (grub_strncmp (cmd_iter->name, currarg, - grub_strlen (currarg)) != 0) + if (VasEBoot_strncmp (cmd_iter->name, currarg, + VasEBoot_strlen (currarg)) != 0) continue; - if (cmd_iter->flags & GRUB_COMMAND_FLAG_DYNCMD) - cmd = grub_dyncmd_get_cmd (cmd_iter); + if (cmd_iter->flags & VasEBoot_COMMAND_FLAG_DYNCMD) + cmd = VasEBoot_dyncmd_get_cmd (cmd_iter); else cmd = cmd_iter; if (!cmd) { - grub_print_error (); + VasEBoot_print_error (); continue; } if (cnt++ > 0) - grub_printf ("\n\n"); + VasEBoot_printf ("\n\n"); - if ((cmd->flags & GRUB_COMMAND_FLAG_EXTCMD) && - ! (cmd->flags & GRUB_COMMAND_FLAG_DYNCMD)) - grub_arg_show_help ((grub_extcmd_t) cmd->data); + if ((cmd->flags & VasEBoot_COMMAND_FLAG_EXTCMD) && + ! (cmd->flags & VasEBoot_COMMAND_FLAG_DYNCMD)) + VasEBoot_arg_show_help ((VasEBoot_extcmd_t) cmd->data); else - grub_printf ("%s %s %s\n%s\n", _("Usage:"), cmd->name, + VasEBoot_printf ("%s %s %s\n%s\n", _("Usage:"), cmd->name, _(cmd->summary), _(cmd->description)); } } @@ -138,16 +138,16 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(help) +VasEBoot_MOD_INIT(help) { - cmd = grub_register_extcmd ("help", grub_cmd_help, 0, + cmd = VasEBoot_register_extcmd ("help", VasEBoot_cmd_help, 0, N_("[PATTERN ...]"), N_("Show a help message."), 0); } -GRUB_MOD_FINI(help) +VasEBoot_MOD_FINI(help) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/hexdump.c b/VasEBoot-core/commands/hexdump.c index 4c884b3a1..089aa564c 100644 --- a/VasEBoot-core/commands/hexdump.c +++ b/VasEBoot-core/commands/hexdump.c @@ -1,79 +1,79 @@ /* hexdump.c - command to dump the contents of a file or memory */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"skip", 's', 0, N_("Skip offset bytes from the beginning of file."), 0, ARG_TYPE_INT}, {"length", 'n', 0, N_("Read only LENGTH bytes."), 0, ARG_TYPE_INT}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_hexdump (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_hexdump (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - char buf[GRUB_DISK_SECTOR_SIZE * 4]; - grub_ssize_t size, length; - grub_disk_addr_t skip; + struct VasEBoot_arg_list *state = ctxt->state; + char buf[VasEBoot_DISK_SECTOR_SIZE * 4]; + VasEBoot_ssize_t size, length; + VasEBoot_disk_addr_t skip; int namelen; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - namelen = grub_strlen (args[0]); - skip = (state[0].set) ? grub_strtoull (state[0].arg, 0, 0) : 0; - length = (state[1].set) ? grub_strtoul (state[1].arg, 0, 0) : 256; + namelen = VasEBoot_strlen (args[0]); + skip = (state[0].set) ? VasEBoot_strtoull (state[0].arg, 0, 0) : 0; + length = (state[1].set) ? VasEBoot_strtoul (state[1].arg, 0, 0) : 256; - if (!grub_strcmp (args[0], "(mem)")) - hexdump (skip, (char *) (grub_addr_t) skip, length); + if (!VasEBoot_strcmp (args[0], "(mem)")) + hexdump (skip, (char *) (VasEBoot_addr_t) skip, length); else if ((args[0][0] == '(') && (args[0][namelen - 1] == ')')) { - grub_disk_t disk; - grub_disk_addr_t sector; - grub_size_t ofs; + VasEBoot_disk_t disk; + VasEBoot_disk_addr_t sector; + VasEBoot_size_t ofs; args[0][namelen - 1] = 0; - disk = grub_disk_open (&args[0][1]); + disk = VasEBoot_disk_open (&args[0][1]); if (! disk) return 0; - sector = (skip >> (GRUB_DISK_SECTOR_BITS + 2)) * 4; - ofs = skip & (GRUB_DISK_SECTOR_SIZE * 4 - 1); + sector = (skip >> (VasEBoot_DISK_SECTOR_BITS + 2)) * 4; + ofs = skip & (VasEBoot_DISK_SECTOR_SIZE * 4 - 1); while (length) { - grub_size_t len; + VasEBoot_size_t len; len = length; if (len > sizeof (buf)) len = sizeof (buf); - if (grub_disk_read (disk, sector, ofs, len, buf)) + if (VasEBoot_disk_read (disk, sector, ofs, len, buf)) break; hexdump (skip, buf, len); @@ -84,19 +84,19 @@ grub_cmd_hexdump (grub_extcmd_context_t ctxt, int argc, char **args) sector += 4; } - grub_disk_close (disk); + VasEBoot_disk_close (disk); } else { - grub_file_t file; + VasEBoot_file_t file; - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) return 0; file->offset = skip; - while ((size = grub_file_read (file, buf, sizeof (buf))) > 0) + while ((size = VasEBoot_file_read (file, buf, sizeof (buf))) > 0) { unsigned long len; @@ -111,23 +111,23 @@ grub_cmd_hexdump (grub_extcmd_context_t ctxt, int argc, char **args) } } - grub_file_close (file); + VasEBoot_file_close (file); } return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT (hexdump) +VasEBoot_MOD_INIT (hexdump) { - cmd = grub_register_extcmd ("hexdump", grub_cmd_hexdump, 0, + cmd = VasEBoot_register_extcmd ("hexdump", VasEBoot_cmd_hexdump, 0, N_("[OPTIONS] FILE_OR_DEVICE"), N_("Show raw contents of a file or memory."), options); } -GRUB_MOD_FINI (hexdump) +VasEBoot_MOD_FINI (hexdump) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/i386/cmosdump.c b/VasEBoot-core/commands/i386/cmosdump.c index 626485ccb..df8fde21b 100644 --- a/VasEBoot-core/commands/i386/cmosdump.c +++ b/VasEBoot-core/commands/i386/cmosdump.c @@ -1,64 +1,64 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_cmosdump (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cmosdump (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { int i; for (i = 0; i < 256; i++) { - grub_err_t err; - grub_uint8_t value; + VasEBoot_err_t err; + VasEBoot_uint8_t value; if ((i & 0xf) == 0) - grub_printf ("%02x: ", i); + VasEBoot_printf ("%02x: ", i); - err = grub_cmos_read (i, &value); + err = VasEBoot_cmos_read (i, &value); if (err) return err; - grub_printf ("%02x ", value); + VasEBoot_printf ("%02x ", value); if ((i & 0xf) == 0xf) - grub_printf ("\n"); + VasEBoot_printf ("\n"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(cmosdump) +VasEBoot_MOD_INIT(cmosdump) { - cmd = grub_register_command ("cmosdump", grub_cmd_cmosdump, + cmd = VasEBoot_register_command ("cmosdump", VasEBoot_cmd_cmosdump, 0, N_("Show raw dump of the CMOS contents.")); } -GRUB_MOD_FINI(cmosdump) +VasEBoot_MOD_FINI(cmosdump) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/i386/cmostest.c b/VasEBoot-core/commands/i386/cmostest.c index c839b704d..2c78008c3 100644 --- a/VasEBoot-core/commands/i386/cmostest.c +++ b/VasEBoot-core/commands/i386/cmostest.c @@ -1,124 +1,124 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t +static VasEBoot_err_t parse_args (int argc, char *argv[], int *byte, int *bit) { char *rest; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "address required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "address required"); - *byte = grub_strtoul (argv[0], &rest, 0); + *byte = VasEBoot_strtoul (argv[0], &rest, 0); if (*rest != ':') - return grub_error (GRUB_ERR_BAD_ARGUMENT, "address required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "address required"); - *bit = grub_strtoul (rest + 1, 0, 0); + *bit = VasEBoot_strtoul (rest + 1, 0, 0); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_cmostest (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cmostest (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { int byte = 0, bit = 0; - grub_err_t err; - grub_uint8_t value; + VasEBoot_err_t err; + VasEBoot_uint8_t value; err = parse_args (argc, argv, &byte, &bit); if (err) return err; - err = grub_cmos_read (byte, &value); + err = VasEBoot_cmos_read (byte, &value); if (err) return err; if (value & (1 << bit)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); } -static grub_err_t -grub_cmd_cmosclean (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cmosclean (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { int byte = 0, bit = 0; - grub_err_t err; - grub_uint8_t value; + VasEBoot_err_t err; + VasEBoot_uint8_t value; err = parse_args (argc, argv, &byte, &bit); if (err) return err; - err = grub_cmos_read (byte, &value); + err = VasEBoot_cmos_read (byte, &value); if (err) return err; - return grub_cmos_write (byte, value & (~(1 << bit))); + return VasEBoot_cmos_write (byte, value & (~(1 << bit))); } -static grub_err_t -grub_cmd_cmosset (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cmosset (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { int byte = 0, bit = 0; - grub_err_t err; - grub_uint8_t value; + VasEBoot_err_t err; + VasEBoot_uint8_t value; err = parse_args (argc, argv, &byte, &bit); if (err) return err; - err = grub_cmos_read (byte, &value); + err = VasEBoot_cmos_read (byte, &value); if (err) return err; - return grub_cmos_write (byte, value | (1 << bit)); + return VasEBoot_cmos_write (byte, value | (1 << bit)); } -static grub_command_t cmd, cmd_clean, cmd_set; +static VasEBoot_command_t cmd, cmd_clean, cmd_set; -GRUB_MOD_INIT(cmostest) +VasEBoot_MOD_INIT(cmostest) { - cmd = grub_register_command ("cmostest", grub_cmd_cmostest, + cmd = VasEBoot_register_command ("cmostest", VasEBoot_cmd_cmostest, N_("BYTE:BIT"), N_("Test bit at BYTE:BIT in CMOS.")); - cmd_clean = grub_register_command ("cmosclean", grub_cmd_cmosclean, + cmd_clean = VasEBoot_register_command ("cmosclean", VasEBoot_cmd_cmosclean, N_("BYTE:BIT"), N_("Clear bit at BYTE:BIT in CMOS.")); - cmd_set = grub_register_command ("cmosset", grub_cmd_cmosset, + cmd_set = VasEBoot_register_command ("cmosset", VasEBoot_cmd_cmosset, N_("BYTE:BIT"), /* TRANSLATORS: A bit may be either set (1) or clear (0). */ N_("Set bit at BYTE:BIT in CMOS.")); } -GRUB_MOD_FINI(cmostest) +VasEBoot_MOD_FINI(cmostest) { - grub_unregister_command (cmd); - grub_unregister_command (cmd_clean); - grub_unregister_command (cmd_set); + VasEBoot_unregister_command (cmd); + VasEBoot_unregister_command (cmd_clean); + VasEBoot_unregister_command (cmd_set); } diff --git a/VasEBoot-core/commands/i386/coreboot/cb_timestamps.c b/VasEBoot-core/commands/i386/coreboot/cb_timestamps.c index e72f38d6e..906e43032 100644 --- a/VasEBoot-core/commands/i386/coreboot/cb_timestamps.c +++ b/VasEBoot-core/commands/i386/coreboot/cb_timestamps.c @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint32_t -tsc2ms (grub_uint64_t tsc) +static VasEBoot_uint32_t +tsc2ms (VasEBoot_uint64_t tsc) { - grub_uint64_t ah = tsc >> 32; - grub_uint64_t al = tsc & 0xffffffff; + VasEBoot_uint64_t ah = tsc >> 32; + VasEBoot_uint64_t al = tsc & 0xffffffff; - return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; + return ((al * VasEBoot_tsc_rate) >> 32) + ah * VasEBoot_tsc_rate; } static const char *descs[] = { @@ -63,28 +63,28 @@ static const char *descs[] = { }; static int -iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, +iterate_linuxbios_table (VasEBoot_linuxbios_table_item_t table_item, void *data) { int *available = data; - grub_uint64_t last_tsc = 0; - struct grub_linuxbios_timestamp_table *ts_table; + VasEBoot_uint64_t last_tsc = 0; + struct VasEBoot_linuxbios_timestamp_table *ts_table; unsigned i; - if (table_item->tag != GRUB_LINUXBIOS_MEMBER_TIMESTAMPS) + if (table_item->tag != VasEBoot_LINUXBIOS_MEMBER_TIMESTAMPS) return 0; *available = 1; - ts_table = (struct grub_linuxbios_timestamp_table *) (grub_addr_t) - *(grub_uint64_t *) (table_item + 1); + ts_table = (struct VasEBoot_linuxbios_timestamp_table *) (VasEBoot_addr_t) + *(VasEBoot_uint64_t *) (table_item + 1); for (i = 0; i < ts_table->used; i++) { - grub_uint32_t tmabs = tsc2ms (ts_table->entries[i].tsc); - grub_uint32_t tmrel = tsc2ms (ts_table->entries[i].tsc - last_tsc); + VasEBoot_uint32_t tmabs = tsc2ms (ts_table->entries[i].tsc); + VasEBoot_uint32_t tmrel = tsc2ms (ts_table->entries[i].tsc - last_tsc); last_tsc = ts_table->entries[i].tsc; - grub_printf ("%3d.%03ds %2d.%03ds %02d %s\n", + VasEBoot_printf ("%3d.%03ds %2d.%03ds %02d %s\n", tmabs / 1000, tmabs % 1000, tmrel / 1000, tmrel % 1000, ts_table->entries[i].id, (ts_table->entries[i].id < ARRAY_SIZE (descs) @@ -95,32 +95,32 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, } -static grub_err_t -grub_cmd_coreboot_boottime (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_coreboot_boottime (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { int available = 0; - grub_linuxbios_table_iterate (iterate_linuxbios_table, &available); + VasEBoot_linuxbios_table_iterate (iterate_linuxbios_table, &available); if (!available) { - grub_puts_ (N_("No boot time statistics is available\n")); + VasEBoot_puts_ (N_("No boot time statistics is available\n")); return 0; } return 0; } -static grub_command_t cmd_boottime; +static VasEBoot_command_t cmd_boottime; -GRUB_MOD_INIT(cbtime) +VasEBoot_MOD_INIT(cbtime) { cmd_boottime = - grub_register_command ("coreboot_boottime", grub_cmd_coreboot_boottime, + VasEBoot_register_command ("coreboot_boottime", VasEBoot_cmd_coreboot_boottime, 0, N_("Show coreboot boot time statistics.")); } -GRUB_MOD_FINI(cbtime) +VasEBoot_MOD_FINI(cbtime) { - grub_unregister_command (cmd_boottime); + VasEBoot_unregister_command (cmd_boottime); } diff --git a/VasEBoot-core/commands/i386/coreboot/cbls.c b/VasEBoot-core/commands/i386/coreboot/cbls.c index e0a10596f..1768a4275 100644 --- a/VasEBoot-core/commands/i386/coreboot/cbls.c +++ b/VasEBoot-core/commands/i386/coreboot/cbls.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static const char *console_descs[] = { "8250 UART", @@ -36,8 +36,8 @@ static const char *console_descs[] = { }; static const char *descs[] = { - [GRUB_LINUXBIOS_MEMBER_MEMORY] = "memory map (`lsmmap' to list)", - [GRUB_LINUXBIOS_MEMBER_MAINBOARD] = "mainboard", + [VasEBoot_LINUXBIOS_MEMBER_MEMORY] = "memory map (`lsmmap' to list)", + [VasEBoot_LINUXBIOS_MEMBER_MAINBOARD] = "mainboard", [4] = "version", [5] = "extra version", [6] = "build", @@ -49,12 +49,12 @@ static const char *descs[] = { [0xc] = "linker", [0xd] = "assembler", [0xf] = "serial", - [GRUB_LINUXBIOS_MEMBER_CONSOLE] = "console", - [GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER] = "framebuffer", + [VasEBoot_LINUXBIOS_MEMBER_CONSOLE] = "console", + [VasEBoot_LINUXBIOS_MEMBER_FRAMEBUFFER] = "framebuffer", [0x13] = "GPIO", [0x15] = "VDAT", - [GRUB_LINUXBIOS_MEMBER_TIMESTAMPS] = "timestamps (`coreboot_boottime' to list)", - [GRUB_LINUXBIOS_MEMBER_CBMEMC] = "CBMEM console (`cbmemc' to list)", + [VasEBoot_LINUXBIOS_MEMBER_TIMESTAMPS] = "timestamps (`coreboot_boottime' to list)", + [VasEBoot_LINUXBIOS_MEMBER_CBMEMC] = "CBMEM console (`cbmemc' to list)", [0x18] = "MRC cache", [0x19] = "VBNV", [0xc8] = "CMOS option table", @@ -65,24 +65,24 @@ static const char *descs[] = { }; static int -iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, +iterate_linuxbios_table (VasEBoot_linuxbios_table_item_t table_item, void *data __attribute__ ((unused))) { if (table_item->tag < ARRAY_SIZE (descs) && descs[table_item->tag]) - grub_printf ("tag=%02x size=%02x %s", + VasEBoot_printf ("tag=%02x size=%02x %s", table_item->tag, table_item->size, descs[table_item->tag]); else - grub_printf ("tag=%02x size=%02x", + VasEBoot_printf ("tag=%02x size=%02x", table_item->tag, table_item->size); switch (table_item->tag) { - case GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER: + case VasEBoot_LINUXBIOS_MEMBER_FRAMEBUFFER: { - struct grub_linuxbios_table_framebuffer *fb; - fb = (struct grub_linuxbios_table_framebuffer *) (table_item + 1); + struct VasEBoot_linuxbios_table_framebuffer *fb; + fb = (struct VasEBoot_linuxbios_table_framebuffer *) (table_item + 1); - grub_printf (": %dx%dx%d pitch=%d lfb=0x%llx %d/%d/%d/%d %d/%d/%d/%d", + VasEBoot_printf (": %dx%dx%d pitch=%d lfb=0x%llx %d/%d/%d/%d %d/%d/%d/%d", fb->width, fb->height, fb->bpp, fb->pitch, (unsigned long long) fb->lfb, @@ -92,52 +92,52 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, fb->blue_field_pos, fb->reserved_field_pos); break; } - case GRUB_LINUXBIOS_MEMBER_MAINBOARD: + case VasEBoot_LINUXBIOS_MEMBER_MAINBOARD: { - struct grub_linuxbios_mainboard *mb; - mb = (struct grub_linuxbios_mainboard *) (table_item + 1); - grub_printf (": vendor=`%s' part_number=`%s'", + struct VasEBoot_linuxbios_mainboard *mb; + mb = (struct VasEBoot_linuxbios_mainboard *) (table_item + 1); + VasEBoot_printf (": vendor=`%s' part_number=`%s'", mb->strings + mb->vendor, mb->strings + mb->part_number); break; } case 0x04 ... 0x0d: - grub_printf (": `%s'", (char *) (table_item + 1)); + VasEBoot_printf (": `%s'", (char *) (table_item + 1)); break; - case GRUB_LINUXBIOS_MEMBER_CONSOLE: + case VasEBoot_LINUXBIOS_MEMBER_CONSOLE: { - grub_uint16_t *val = (grub_uint16_t *) (table_item + 1); - grub_printf (": id=%d", *val); + VasEBoot_uint16_t *val = (VasEBoot_uint16_t *) (table_item + 1); + VasEBoot_printf (": id=%d", *val); if (*val < ARRAY_SIZE (console_descs) && console_descs[*val]) - grub_printf (" %s", console_descs[*val]); + VasEBoot_printf (" %s", console_descs[*val]); } } - grub_printf ("\n"); + VasEBoot_printf ("\n"); return 0; } -static grub_err_t -grub_cmd_lscoreboot (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lscoreboot (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_linuxbios_table_iterate (iterate_linuxbios_table, 0); + VasEBoot_linuxbios_table_iterate (iterate_linuxbios_table, 0); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(cbls) +VasEBoot_MOD_INIT(cbls) { cmd = - grub_register_command ("lscoreboot", grub_cmd_lscoreboot, + VasEBoot_register_command ("lscoreboot", VasEBoot_cmd_lscoreboot, 0, N_("List coreboot tables.")); } -GRUB_MOD_FINI(cbls) +VasEBoot_MOD_FINI(cbls) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/i386/cpuid.c b/VasEBoot-core/commands/i386/cpuid.c index 42b984154..cbac0178f 100644 --- a/VasEBoot-core/commands/i386/cpuid.c +++ b/VasEBoot-core/commands/i386/cpuid.c @@ -1,35 +1,35 @@ /* cpuid.c - test for CPU features */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. * Based on gcc/gcc/config/i386/driver-i386.c * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { /* TRANSLATORS: "(default)" at the end means that this option is used if no argument is specified. */ @@ -53,32 +53,32 @@ enum bit_LM = (1 << 29) }; -unsigned char grub_cpuid_has_longmode = 0, grub_cpuid_has_pae = 0; +unsigned char VasEBoot_cpuid_has_longmode = 0, VasEBoot_cpuid_has_pae = 0; -static grub_err_t -grub_cmd_cpuid (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_cpuid (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { int val = 0; if (ctxt->state[MODE_PAE].set) - val = grub_cpuid_has_pae; + val = VasEBoot_cpuid_has_pae; else - val = grub_cpuid_has_longmode; - return val ? GRUB_ERR_NONE + val = VasEBoot_cpuid_has_longmode; + return val ? VasEBoot_ERR_NONE /* TRANSLATORS: it's a standalone boolean value, opposite of "true". */ - : grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + : VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(cpuid) +VasEBoot_MOD_INIT(cpuid) { #ifdef __x86_64__ - /* grub-emu */ - grub_cpuid_has_longmode = 1; - grub_cpuid_has_pae = 1; + /* VasEBoot-emu */ + VasEBoot_cpuid_has_longmode = 1; + VasEBoot_cpuid_has_pae = 1; #else unsigned int eax, ebx, ecx, edx; unsigned int max_level; @@ -93,7 +93,7 @@ GRUB_MOD_INIT(cpuid) goto done; /* Check the highest input value for eax. */ - grub_cpuid (0, eax, ebx, ecx, edx); + VasEBoot_cpuid (0, eax, ebx, ecx, edx); /* We only look at the first four characters. */ max_level = eax; if (max_level == 0) @@ -101,25 +101,25 @@ GRUB_MOD_INIT(cpuid) if (max_level >= 1) { - grub_cpuid (1, eax, ebx, ecx, edx); - grub_cpuid_has_pae = !!(edx & bit_PAE); + VasEBoot_cpuid (1, eax, ebx, ecx, edx); + VasEBoot_cpuid_has_pae = !!(edx & bit_PAE); } - grub_cpuid (0x80000000, eax, ebx, ecx, edx); + VasEBoot_cpuid (0x80000000, eax, ebx, ecx, edx); ext_level = eax; if (ext_level < 0x80000000) goto done; - grub_cpuid (0x80000001, eax, ebx, ecx, edx); - grub_cpuid_has_longmode = !!(edx & bit_LM); + VasEBoot_cpuid (0x80000001, eax, ebx, ecx, edx); + VasEBoot_cpuid_has_longmode = !!(edx & bit_LM); done: #endif - cmd = grub_register_extcmd ("cpuid", grub_cmd_cpuid, 0, + cmd = VasEBoot_register_extcmd ("cpuid", VasEBoot_cmd_cpuid, 0, "[-l]", N_("Check for CPU features."), options); } -GRUB_MOD_FINI(cpuid) +VasEBoot_MOD_FINI(cpuid) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/i386/pc/drivemap.c b/VasEBoot-core/commands/i386/pc/drivemap.c index 7f7f2d41c..84dc9074e 100644 --- a/VasEBoot-core/commands/i386/pc/drivemap.c +++ b/VasEBoot-core/commands/i386/pc/drivemap.c @@ -1,42 +1,42 @@ /* drivemap.c - command to manage the BIOS drive mappings. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Real mode IVT slot (seg:off far pointer) for interrupt 0x13. */ -static grub_uint32_t *const int13slot = (grub_uint32_t *) (4 * 0x13); +static VasEBoot_uint32_t *const int13slot = (VasEBoot_uint32_t *) (4 * 0x13); /* Remember to update enum opt_idxs accordingly. */ -static const struct grub_arg_option options[] = { - /* TRANSLATORS: In this file "mapping" refers to a change GRUB makes so if +static const struct VasEBoot_arg_option options[] = { + /* TRANSLATORS: In this file "mapping" refers to a change VasEBoot makes so if your language doesn't have an equivalent of "mapping" you can use the word like "rerouting". */ @@ -55,33 +55,33 @@ enum opt_idxs }; /* Realmode far ptr (2 * 16b) to the previous INT13h handler. */ -extern grub_uint32_t grub_drivemap_oldhandler; +extern VasEBoot_uint32_t VasEBoot_drivemap_oldhandler; /* The type "void" is used for imported assembly labels, takes no storage and serves just to take the address with &label. */ /* The assembly function to replace the old INT13h handler. It does not follow any C callspecs and returns with IRET. */ -extern const void grub_drivemap_handler; +extern const void VasEBoot_drivemap_handler; /* Start of the drive mappings area (space reserved at runtime). */ -extern const void grub_drivemap_mapstart; +extern const void VasEBoot_drivemap_mapstart; typedef struct drivemap_node { struct drivemap_node *next; - grub_uint8_t newdrive; - grub_uint8_t redirto; + VasEBoot_uint8_t newdrive; + VasEBoot_uint8_t redirto; } drivemap_node_t; -typedef struct GRUB_PACKED int13map_node +typedef struct VasEBoot_PACKED int13map_node { - grub_uint8_t disknum; - grub_uint8_t mapto; + VasEBoot_uint8_t disknum; + VasEBoot_uint8_t mapto; } int13map_node_t; #define INT13H_OFFSET(x) \ - (((grub_uint8_t *)(x)) - ((grub_uint8_t *)&grub_drivemap_handler)) + (((VasEBoot_uint8_t *)(x)) - ((VasEBoot_uint8_t *)&VasEBoot_drivemap_handler)) static drivemap_node_t *map_head; static void *drivemap_hook; @@ -89,8 +89,8 @@ static int drivemap_mmap; /* Puts the specified mapping into the table, replacing an existing mapping for newdrive or adding a new one if required. */ -static grub_err_t -drivemap_set (grub_uint8_t newdrive, grub_uint8_t redirto) +static VasEBoot_err_t +drivemap_set (VasEBoot_uint8_t newdrive, VasEBoot_uint8_t redirto) { drivemap_node_t *mapping = 0; drivemap_node_t *search = map_head; @@ -109,21 +109,21 @@ drivemap_set (grub_uint8_t newdrive, grub_uint8_t redirto) mapping->redirto = redirto; else { - mapping = grub_malloc (sizeof (drivemap_node_t)); + mapping = VasEBoot_malloc (sizeof (drivemap_node_t)); if (! mapping) - return grub_errno; + return VasEBoot_errno; mapping->newdrive = newdrive; mapping->redirto = redirto; mapping->next = map_head; map_head = mapping; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Removes the mapping for newdrive from the table. If there is no mapping, then this function behaves like a no-op on the map. */ static void -drivemap_remove (grub_uint8_t newdrive) +drivemap_remove (VasEBoot_uint8_t newdrive) { drivemap_node_t *mapping = 0; drivemap_node_t *search = map_head; @@ -146,53 +146,53 @@ drivemap_remove (grub_uint8_t newdrive) previous->next = mapping->next; else map_head = mapping->next; - grub_free (mapping); + VasEBoot_free (mapping); } } -/* Given a GRUB-like device name and a convenient location, stores the +/* Given a VasEBoot-like device name and a convenient location, stores the related BIOS disk number. Accepts devices like \((f|h)dN\), with 0 <= N < 128. */ -static grub_err_t -tryparse_diskstring (const char *str, grub_uint8_t *output) +static VasEBoot_err_t +tryparse_diskstring (const char *str, VasEBoot_uint8_t *output) { /* Skip opening paren in order to allow both (hd0) and hd0. */ if (*str == '(') str++; if ((str[0] == 'f' || str[0] == 'h') && str[1] == 'd') { - grub_uint8_t bios_num = (str[0] == 'h') ? 0x80 : 0x00; - unsigned long drivenum = grub_strtoul (str + 2, 0, 0); - if (grub_errno == GRUB_ERR_NONE && drivenum < 128) + VasEBoot_uint8_t bios_num = (str[0] == 'h') ? 0x80 : 0x00; + unsigned long drivenum = VasEBoot_strtoul (str + 2, 0, 0); + if (VasEBoot_errno == VasEBoot_ERR_NONE && drivenum < 128) { bios_num |= drivenum; if (output) *output = bios_num; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device format \"%s\" " + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "device format \"%s\" " "invalid: must be (f|h)dN, with 0 <= N < 128", str); } -static grub_err_t +static VasEBoot_err_t list_mappings (void) { /* Show: list mappings. */ if (! map_head) { - grub_puts_ (N_("No drives have been remapped")); - return GRUB_ERR_NONE; + VasEBoot_puts_ (N_("No drives have been remapped")); + return VasEBoot_ERR_NONE; } /* TRANSLATORS: This is the header of mapping list. On the left is how OS will see the disks and - on the right current GRUB vision. */ - grub_puts_ (N_("OS disk #num ------> GRUB/BIOS device")); + on the right current VasEBoot vision. */ + VasEBoot_puts_ (N_("OS disk #num ------> VasEBoot/BIOS device")); drivemap_node_t *curnode = map_head; while (curnode) { - grub_printf ("%cD #%-3u (0x%02x) %cd%d\n", + VasEBoot_printf ("%cD #%-3u (0x%02x) %cd%d\n", (curnode->newdrive & 0x80) ? 'H' : 'F', curnode->newdrive & 0x7F, curnode->newdrive, (curnode->redirto & 0x80) ? 'h' : 'f', @@ -200,11 +200,11 @@ list_mappings (void) ); curnode = curnode->next; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_drivemap (struct grub_extcmd_context *ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_drivemap (struct VasEBoot_extcmd_context *ctxt, int argc, char **args) { if (ctxt->state[OPTIDX_LIST].set) { @@ -219,10 +219,10 @@ grub_cmd_drivemap (struct grub_extcmd_context *ctxt, int argc, char **args) { prevnode = curnode; curnode = curnode->next; - grub_free (prevnode); + VasEBoot_free (prevnode); } map_head = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } else if (!ctxt->state[OPTIDX_SWAP].set && argc == 0) { @@ -231,53 +231,53 @@ grub_cmd_drivemap (struct grub_extcmd_context *ctxt, int argc, char **args) } /* Neither flag: put mapping. */ - grub_uint8_t mapfrom = 0; - grub_uint8_t mapto = 0xFF; - grub_err_t err; + VasEBoot_uint8_t mapfrom = 0; + VasEBoot_uint8_t mapto = 0xFF; + VasEBoot_err_t err; if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); err = tryparse_diskstring (args[0], &mapfrom); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; err = tryparse_diskstring (args[1], &mapto); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; if (mapto == mapfrom) { /* Reset to default. */ - grub_dprintf ("drivemap", "Removing mapping for %s (%02x)\n", + VasEBoot_dprintf ("drivemap", "Removing mapping for %s (%02x)\n", args[0], mapfrom); drivemap_remove (mapfrom); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Set the mapping for the disk (overwrites any existing mapping). */ - grub_dprintf ("drivemap", "%s %s (%02x) = %s (%02x)\n", + VasEBoot_dprintf ("drivemap", "%s %s (%02x) = %s (%02x)\n", ctxt->state[OPTIDX_SWAP].set ? "Swapping" : "Mapping", args[1], mapto, args[0], mapfrom); err = drivemap_set (mapto, mapfrom); /* If -s, perform the reverse mapping too (only if the first was OK). */ - if (ctxt->state[OPTIDX_SWAP].set && err == GRUB_ERR_NONE) + if (ctxt->state[OPTIDX_SWAP].set && err == VasEBoot_ERR_NONE) err = drivemap_set (mapfrom, mapto); return err; } /* Int13h handler installer - reserves conventional memory for the handler, copies it over and sets the IVT entry for int13h. - This code rests on the assumption that GRUB does not activate any kind + This code rests on the assumption that VasEBoot does not activate any kind of memory mapping apart from identity paging, since it accesses realmode structures by their absolute addresses, like the IVT at 0; and transforms a pmode pointer into a rmode seg:off far ptr. */ -static grub_err_t +static VasEBoot_err_t install_int13_handler (int noret __attribute__ ((unused))) { /* Size of the full int13 handler "bundle", including code and map. */ - grub_uint32_t total_size; + VasEBoot_uint32_t total_size; /* Base address of the space reserved for the handler bundle. */ - grub_uint8_t *handler_base = 0; + VasEBoot_uint8_t *handler_base = 0; /* Address of the map within the deployed bundle. */ int13map_node_t *handler_map; @@ -294,93 +294,93 @@ install_int13_handler (int noret __attribute__ ((unused))) if (entries == 0) { /* No need to install the int13h handler. */ - grub_dprintf ("drivemap", "No drives marked as remapped, not installing " + VasEBoot_dprintf ("drivemap", "No drives marked as remapped, not installing " "our int13h handler.\n"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - grub_dprintf ("drivemap", "Installing our int13h handler\n"); + VasEBoot_dprintf ("drivemap", "Installing our int13h handler\n"); /* Save the pointer to the old handler. */ - grub_drivemap_oldhandler = *int13slot; - grub_dprintf ("drivemap", "Original int13 handler: %04x:%04x\n", - (grub_drivemap_oldhandler >> 16) & 0x0ffff, - grub_drivemap_oldhandler & 0x0ffff); + VasEBoot_drivemap_oldhandler = *int13slot; + VasEBoot_dprintf ("drivemap", "Original int13 handler: %04x:%04x\n", + (VasEBoot_drivemap_oldhandler >> 16) & 0x0ffff, + VasEBoot_drivemap_oldhandler & 0x0ffff); /* Find a rmode-segment-aligned zone in conventional memory big enough to hold the handler and its data. */ - total_size = INT13H_OFFSET (&grub_drivemap_mapstart) + total_size = INT13H_OFFSET (&VasEBoot_drivemap_mapstart) + (entries + 1) * sizeof (int13map_node_t); - grub_dprintf ("drivemap", "Payload is %u bytes long\n", total_size); - handler_base = grub_mmap_malign_and_register (16, ALIGN_UP (total_size, 16), + VasEBoot_dprintf ("drivemap", "Payload is %u bytes long\n", total_size); + handler_base = VasEBoot_mmap_malign_and_register (16, ALIGN_UP (total_size, 16), &drivemap_mmap, - GRUB_MEMORY_RESERVED, - GRUB_MMAP_MALLOC_LOW); + VasEBoot_MEMORY_RESERVED, + VasEBoot_MMAP_MALLOC_LOW); if (! handler_base) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't reserve " + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't reserve " "memory for the int13h handler"); /* Copy int13h handler bundle to reserved area. */ - grub_dprintf ("drivemap", "Reserved memory at %p, copying handler\n", + VasEBoot_dprintf ("drivemap", "Reserved memory at %p, copying handler\n", handler_base); - grub_memcpy (handler_base, &grub_drivemap_handler, - INT13H_OFFSET (&grub_drivemap_mapstart)); + VasEBoot_memcpy (handler_base, &VasEBoot_drivemap_handler, + INT13H_OFFSET (&VasEBoot_drivemap_mapstart)); /* Copy the mappings to the reserved area. */ curentry = map_head; handler_map = (int13map_node_t *) (handler_base + - INT13H_OFFSET (&grub_drivemap_mapstart)); - grub_dprintf ("drivemap", "Target map at %p, copying mappings\n", handler_map); + INT13H_OFFSET (&VasEBoot_drivemap_mapstart)); + VasEBoot_dprintf ("drivemap", "Target map at %p, copying mappings\n", handler_map); for (i = 0; i < entries; ++i, curentry = curentry->next) { handler_map[i].disknum = curentry->newdrive; handler_map[i].mapto = curentry->redirto; - grub_dprintf ("drivemap", "\t#%d: 0x%02x <- 0x%02x\n", i, + VasEBoot_dprintf ("drivemap", "\t#%d: 0x%02x <- 0x%02x\n", i, handler_map[i].disknum, handler_map[i].mapto); } /* Signal end-of-map. */ handler_map[i].disknum = 0; handler_map[i].mapto = 0; - grub_dprintf ("drivemap", "\t#%d: 0x00 <- 0x00 (end)\n", i); + VasEBoot_dprintf ("drivemap", "\t#%d: 0x00 <- 0x00 (end)\n", i); /* Install our function as the int13h handler in the IVT. */ - *int13slot = ((grub_uint32_t) handler_base) << 12; /* Segment address. */ - grub_dprintf ("drivemap", "New int13 handler: %04x:%04x\n", + *int13slot = ((VasEBoot_uint32_t) handler_base) << 12; /* Segment address. */ + VasEBoot_dprintf ("drivemap", "New int13 handler: %04x:%04x\n", (*int13slot >> 16) & 0x0ffff, *int13slot & 0x0ffff); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t uninstall_int13_handler (void) { - if (! grub_drivemap_oldhandler) - return GRUB_ERR_NONE; + if (! VasEBoot_drivemap_oldhandler) + return VasEBoot_ERR_NONE; - *int13slot = grub_drivemap_oldhandler; - grub_mmap_free_and_unregister (drivemap_mmap); - grub_drivemap_oldhandler = 0; - grub_dprintf ("drivemap", "Restored int13 handler: %04x:%04x\n", + *int13slot = VasEBoot_drivemap_oldhandler; + VasEBoot_mmap_free_and_unregister (drivemap_mmap); + VasEBoot_drivemap_oldhandler = 0; + VasEBoot_dprintf ("drivemap", "Restored int13 handler: %04x:%04x\n", (*int13slot >> 16) & 0x0ffff, *int13slot & 0x0ffff); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -grub_get_root_biosnumber_drivemap (void) +VasEBoot_get_root_biosnumber_drivemap (void) { const char *biosnum; int ret = -1; - grub_device_t dev; + VasEBoot_device_t dev; - biosnum = grub_env_get ("biosnum"); + biosnum = VasEBoot_env_get ("biosnum"); if (biosnum) - return grub_strtoul (biosnum, 0, 0); + return VasEBoot_strtoul (biosnum, 0, 0); - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (dev && dev->disk && dev->disk->dev - && dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) + && dev->disk->dev->id == VasEBoot_DISK_DEVICE_BIOSDISK_ID) { drivemap_node_t *curnode = map_head; ret = (int) dev->disk->id; @@ -397,32 +397,32 @@ grub_get_root_biosnumber_drivemap (void) } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); return ret; } -static grub_extcmd_t cmd; -static int (*grub_get_root_biosnumber_saved) (void); +static VasEBoot_extcmd_t cmd; +static int (*VasEBoot_get_root_biosnumber_saved) (void); -GRUB_MOD_INIT (drivemap) +VasEBoot_MOD_INIT (drivemap) { - grub_get_root_biosnumber_saved = grub_get_root_biosnumber; - grub_get_root_biosnumber = grub_get_root_biosnumber_drivemap; - cmd = grub_register_extcmd ("drivemap", grub_cmd_drivemap, 0, - N_("-l | -r | [-s] grubdev osdisk."), + VasEBoot_get_root_biosnumber_saved = VasEBoot_get_root_biosnumber; + VasEBoot_get_root_biosnumber = VasEBoot_get_root_biosnumber_drivemap; + cmd = VasEBoot_register_extcmd ("drivemap", VasEBoot_cmd_drivemap, 0, + N_("-l | -r | [-s] VasEBootdev osdisk."), N_("Manage the BIOS drive mappings."), options); drivemap_hook = - grub_loader_register_preboot_hook (&install_int13_handler, + VasEBoot_loader_register_preboot_hook (&install_int13_handler, &uninstall_int13_handler, - GRUB_LOADER_PREBOOT_HOOK_PRIO_NORMAL); + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_NORMAL); } -GRUB_MOD_FINI (drivemap) +VasEBoot_MOD_FINI (drivemap) { - grub_get_root_biosnumber = grub_get_root_biosnumber_saved; - grub_loader_unregister_preboot_hook (drivemap_hook); + VasEBoot_get_root_biosnumber = VasEBoot_get_root_biosnumber_saved; + VasEBoot_loader_unregister_preboot_hook (drivemap_hook); drivemap_hook = 0; - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/i386/pc/drivemap_int13h.S b/VasEBoot-core/commands/i386/pc/drivemap_int13h.S index 3c87521b6..ccb46a485 100644 --- a/VasEBoot-core/commands/i386/pc/drivemap_int13h.S +++ b/VasEBoot-core/commands/i386/pc/drivemap_int13h.S @@ -1,23 +1,23 @@ /* drivemap_int13h.S - interrupt handler for the BIOS drive remapper */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include #define INT13H_OFFSET(x) ((x) - LOCAL (base)) @@ -26,7 +26,7 @@ /* Copy starts here. When deployed, this code must be segment-aligned. */ /* The replacement int13 handler. Preserve all registers. */ -FUNCTION(grub_drivemap_handler) +FUNCTION(VasEBoot_drivemap_handler) LOCAL (base): /* Save %dx for future restore. */ push %dx @@ -111,7 +111,7 @@ norestore: /* Far pointer to the old handler. Stored as a CS:IP in the style of real-mode IVT entries (thus PI:SC in mem). */ -VARIABLE(grub_drivemap_oldhandler) +VARIABLE(VasEBoot_drivemap_oldhandler) LOCAL (oldhandler): .word 0x0, 0x0 @@ -119,6 +119,6 @@ LOCAL (oldhandler): reserves additional space for mappings at runtime and copies them over it. */ .align 2 -VARIABLE(grub_drivemap_mapstart) +VARIABLE(VasEBoot_drivemap_mapstart) LOCAL (mapstart): .byte 0 diff --git a/VasEBoot-core/commands/i386/pc/halt.c b/VasEBoot-core/commands/i386/pc/halt.c index 1e7c2c9b3..8529d7bdd 100644 --- a/VasEBoot-core/commands/i386/pc/halt.c +++ b/VasEBoot-core/commands/i386/pc/halt.c @@ -1,32 +1,32 @@ /* halt.c - command to halt the computer. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"no-apm", 'n', 0, N_("Do not use APM to halt the computer."), 0, 0}, {0, 0, 0, 0, 0, 0} @@ -45,11 +45,11 @@ stop (void) * APM even if it is available. */ void __attribute__ ((noreturn)) -grub_halt (int no_apm) +VasEBoot_halt (int no_apm) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; - grub_acpi_halt (); + VasEBoot_acpi_halt (); if (no_apm) stop (); @@ -57,70 +57,70 @@ grub_halt (int no_apm) /* detect APM */ regs.eax = 0x5300; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) stop (); /* disconnect APM first */ regs.eax = 0x5304; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); /* connect APM */ regs.eax = 0x5301; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) stop (); /* set APM protocol level - 1.1 or bust. (this covers APM 1.2 also) */ regs.eax = 0x530E; regs.ebx = 0; regs.ecx = 0x0101; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) stop (); /* set the power state to off */ regs.eax = 0x5307; regs.ebx = 1; regs.ecx = 3; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); /* shouldn't reach here */ stop (); } -static grub_err_t __attribute__ ((noreturn)) -grub_cmd_halt (grub_extcmd_context_t ctxt, +static VasEBoot_err_t __attribute__ ((noreturn)) +VasEBoot_cmd_halt (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; int no_apm = 0; if (state[0].set) no_apm = 1; - grub_halt (no_apm); + VasEBoot_halt (no_apm); } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(halt) +VasEBoot_MOD_INIT(halt) { - cmd = grub_register_extcmd ("halt", grub_cmd_halt, 0, "[-n]", + cmd = VasEBoot_register_extcmd ("halt", VasEBoot_cmd_halt, 0, "[-n]", N_("Halt the system, if possible using APM."), options); } -GRUB_MOD_FINI(halt) +VasEBoot_MOD_FINI(halt) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/i386/pc/lsapm.c b/VasEBoot-core/commands/i386/pc/lsapm.c index c82476df1..b3997ddcb 100644 --- a/VasEBoot-core/commands/i386/pc/lsapm.c +++ b/VasEBoot-core/commands/i386/pc/lsapm.c @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); int -grub_apm_get_info (struct grub_apm_info *info) +VasEBoot_apm_get_info (struct VasEBoot_apm_info *info) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; /* detect APM */ regs.eax = 0x5300; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) return 0; info->version = regs.eax & 0xffff; info->flags = regs.ecx & 0xffff; @@ -43,16 +43,16 @@ grub_apm_get_info (struct grub_apm_info *info) /* disconnect APM first */ regs.eax = 0x5304; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); /* connect APM */ regs.eax = 0x5303; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) return 0; info->cseg = regs.eax & 0xffff; @@ -66,15 +66,15 @@ grub_apm_get_info (struct grub_apm_info *info) return 1; } -static grub_err_t -grub_cmd_lsapm (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsapm (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_apm_info info; - if (!grub_apm_get_info (&info)) - return grub_error (GRUB_ERR_IO, N_("no APM found")); + struct VasEBoot_apm_info info; + if (!VasEBoot_apm_get_info (&info)) + return VasEBoot_error (VasEBoot_ERR_IO, N_("no APM found")); - grub_printf_ (N_("Version %u.%u\n" + VasEBoot_printf_ (N_("Version %u.%u\n" "32-bit CS = 0x%x, len = 0x%x, offset = 0x%x\n" "16-bit CS = 0x%x, len = 0x%x\n" "DS = 0x%x, len = 0x%x\n"), @@ -82,34 +82,34 @@ grub_cmd_lsapm (grub_command_t cmd __attribute__ ((unused)), info.cseg, info.cseg_len, info.offset, info.cseg_16, info.cseg_16_len, info.dseg, info.dseg_len); - grub_xputs (info.flags & GRUB_APM_FLAGS_16BITPROTECTED_SUPPORTED + VasEBoot_xputs (info.flags & VasEBoot_APM_FLAGS_16BITPROTECTED_SUPPORTED ? _("16-bit protected interface supported\n") : _("16-bit protected interface unsupported\n")); - grub_xputs (info.flags & GRUB_APM_FLAGS_32BITPROTECTED_SUPPORTED + VasEBoot_xputs (info.flags & VasEBoot_APM_FLAGS_32BITPROTECTED_SUPPORTED ? _("32-bit protected interface supported\n") : _("32-bit protected interface unsupported\n")); - grub_xputs (info.flags & GRUB_APM_FLAGS_CPUIDLE_SLOWS_DOWN + VasEBoot_xputs (info.flags & VasEBoot_APM_FLAGS_CPUIDLE_SLOWS_DOWN ? _("CPU Idle slows down processor\n") : _("CPU Idle doesn't slow down processor\n")); - grub_xputs (info.flags & GRUB_APM_FLAGS_DISABLED + VasEBoot_xputs (info.flags & VasEBoot_APM_FLAGS_DISABLED ? _("APM disabled\n") : _("APM enabled\n")); - grub_xputs (info.flags & GRUB_APM_FLAGS_DISENGAGED + VasEBoot_xputs (info.flags & VasEBoot_APM_FLAGS_DISENGAGED ? _("APM disengaged\n") : _("APM engaged\n")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsapm) +VasEBoot_MOD_INIT(lsapm) { - cmd = grub_register_command ("lsapm", grub_cmd_lsapm, 0, + cmd = VasEBoot_register_command ("lsapm", VasEBoot_cmd_lsapm, 0, N_("Show APM information.")); } -GRUB_MOD_FINI(lsapm) +VasEBoot_MOD_FINI(lsapm) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/i386/pc/play.c b/VasEBoot-core/commands/i386/pc/play.c index 7712e2a36..c82039b31 100644 --- a/VasEBoot-core/commands/i386/pc/play.c +++ b/VasEBoot-core/commands/i386/pc/play.c @@ -1,86 +1,86 @@ /* play.c - command to play a tune */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Lots of this file is borrowed from GNU/Hurd generic-speaker driver. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define BASE_TEMPO (60 * 1000) -#define T_REST ((grub_uint16_t) 0) -#define T_FINE ((grub_uint16_t) -1) +#define T_REST ((VasEBoot_uint16_t) 0) +#define T_FINE ((VasEBoot_uint16_t) -1) struct note { - grub_uint16_t pitch; - grub_uint16_t duration; + VasEBoot_uint16_t pitch; + VasEBoot_uint16_t duration; }; /* Returns whether playing should continue. */ static int play (unsigned tempo, struct note *note) { - grub_uint64_t to; + VasEBoot_uint64_t to; - if (note->pitch == T_FINE || grub_getkey_noblock () != GRUB_TERM_NO_KEY) + if (note->pitch == T_FINE || VasEBoot_getkey_noblock () != VasEBoot_TERM_NO_KEY) return 1; - grub_dprintf ("play", "pitch = %d, duration = %d\n", note->pitch, + VasEBoot_dprintf ("play", "pitch = %d, duration = %d\n", note->pitch, note->duration); switch (note->pitch) { case T_REST: - grub_speaker_beep_off (); + VasEBoot_speaker_beep_off (); break; default: - grub_speaker_beep_on (note->pitch); + VasEBoot_speaker_beep_on (note->pitch); break; } - to = grub_get_time_ms () + BASE_TEMPO * note->duration / tempo; - while ((grub_get_time_ms () <= to) - && (grub_getkey_noblock () == GRUB_TERM_NO_KEY)); + to = VasEBoot_get_time_ms () + BASE_TEMPO * note->duration / tempo; + while ((VasEBoot_get_time_ms () <= to) + && (VasEBoot_getkey_noblock () == VasEBoot_TERM_NO_KEY)); return 0; } -static grub_err_t -grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_play (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, /* TRANSLATORS: It's musical notes, not the notes you take. Play command expects arguments which can be either a filename or tempo+notes. @@ -90,45 +90,45 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), if (argc == 1) { struct note buf; - grub_uint32_t tempo; - grub_file_t file; + VasEBoot_uint32_t tempo; + VasEBoot_file_t file; - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - if (grub_file_read (file, &tempo, sizeof (tempo)) != sizeof (tempo)) + if (VasEBoot_file_read (file, &tempo, sizeof (tempo)) != sizeof (tempo)) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), args[0]); - return grub_errno; + return VasEBoot_errno; } if (!tempo) { - grub_file_close (file); - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid tempo in %s"), + VasEBoot_file_close (file); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Invalid tempo in %s"), args[0]); - return grub_errno; + return VasEBoot_errno; } - tempo = grub_le_to_cpu32 (tempo); - grub_dprintf ("play","tempo = %d\n", tempo); + tempo = VasEBoot_le_to_cpu32 (tempo); + VasEBoot_dprintf ("play","tempo = %d\n", tempo); - while (grub_file_read (file, &buf, + while (VasEBoot_file_read (file, &buf, sizeof (struct note)) == sizeof (struct note)) { - buf.pitch = grub_le_to_cpu16 (buf.pitch); - buf.duration = grub_le_to_cpu16 (buf.duration); + buf.pitch = VasEBoot_le_to_cpu16 (buf.pitch); + buf.duration = VasEBoot_le_to_cpu16 (buf.duration); if (play (tempo, &buf)) break; } - grub_file_close (file); + VasEBoot_file_close (file); } else { @@ -137,38 +137,38 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), struct note note; int i; - tempo = grub_strtoul (args[0], &end, 0); + tempo = VasEBoot_strtoul (args[0], &end, 0); if (!tempo) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid tempo in %s"), + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Invalid tempo in %s"), args[0]); - return grub_errno; + return VasEBoot_errno; } if (*end) /* Was not a number either, assume it was supposed to be a file name. */ - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), args[0]); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), args[0]); - grub_dprintf ("play","tempo = %d\n", tempo); + VasEBoot_dprintf ("play","tempo = %d\n", tempo); for (i = 1; i + 1 < argc; i += 2) { - note.pitch = grub_strtoul (args[i], &end, 0); - if (grub_errno) + note.pitch = VasEBoot_strtoul (args[i], &end, 0); + if (VasEBoot_errno) break; if (*end) { - grub_error (GRUB_ERR_BAD_NUMBER, N_("unrecognized number")); + VasEBoot_error (VasEBoot_ERR_BAD_NUMBER, N_("unrecognized number")); break; } - note.duration = grub_strtoul (args[i + 1], &end, 0); - if (grub_errno) + note.duration = VasEBoot_strtoul (args[i + 1], &end, 0); + if (VasEBoot_errno) break; if (*end) { - grub_error (GRUB_ERR_BAD_NUMBER, N_("unrecognized number")); + VasEBoot_error (VasEBoot_ERR_BAD_NUMBER, N_("unrecognized number")); break; } @@ -177,21 +177,21 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), } } - grub_speaker_beep_off (); + VasEBoot_speaker_beep_off (); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(play) +VasEBoot_MOD_INIT(play) { - cmd = grub_register_command ("play", grub_cmd_play, + cmd = VasEBoot_register_command ("play", VasEBoot_cmd_play, N_("FILE | TEMPO [PITCH1 DURATION1] [PITCH2 DURATION2] ... "), N_("Play a tune.")); } -GRUB_MOD_FINI(play) +VasEBoot_MOD_FINI(play) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/i386/pc/sendkey.c b/VasEBoot-core/commands/i386/pc/sendkey.c index 26d9acd3d..d7e212d20 100644 --- a/VasEBoot-core/commands/i386/pc/sendkey.c +++ b/VasEBoot-core/commands/i386/pc/sendkey.c @@ -1,6 +1,6 @@ /* sendkey.c - fake keystroke. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -18,23 +18,23 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv2+"); +VasEBoot_MOD_LICENSE ("GPLv2+"); static char sendkey[0x20]; /* Length of sendkey. */ static int keylen = 0; static int noled = 0; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"num", 'n', 0, N_("set numlock mode"), "[on|off]", ARG_TYPE_STRING}, {"caps", 'c', 0, N_("set capslock mode"), "[on|off]", ARG_TYPE_STRING}, @@ -58,7 +58,7 @@ static const struct grub_arg_option options[] = static int simple_flag_offsets[] = {5, 6, 4, 7, 11, 1, 0, 10, 13, 14, 12, 15, 9, 3, 8, 2}; -static grub_uint32_t andmask = 0xffffffff, ormask = 0; +static VasEBoot_uint32_t andmask = 0xffffffff, ormask = 0; struct keysym @@ -71,7 +71,7 @@ keysym }; /* The table for key symbols. If the "shifted" member of an entry is - NULL, the entry does not have shifted state. Copied from GRUB Legacy setkey fuction */ + NULL, the entry does not have shifted state. Copied from VasEBoot Legacy setkey fuction */ static struct keysym keysym_table[] = { {"escape", 0, 0x1b, 0, 0x01}, @@ -176,7 +176,7 @@ static struct keysym keysym_table[] = OP - action id */ static void -grub_sendkey_set_simple_flag (int outoffset, int op) +VasEBoot_sendkey_set_simple_flag (int outoffset, int op) { if (op == 2) { @@ -194,51 +194,51 @@ grub_sendkey_set_simple_flag (int outoffset, int op) } static int -grub_sendkey_parse_op (struct grub_arg_list state) +VasEBoot_sendkey_parse_op (struct VasEBoot_arg_list state) { if (! state.set) return 2; - if (grub_strcmp (state.arg, "off") == 0 || grub_strcmp (state.arg, "0") == 0 - || grub_strcmp (state.arg, "unpress") == 0) + if (VasEBoot_strcmp (state.arg, "off") == 0 || VasEBoot_strcmp (state.arg, "0") == 0 + || VasEBoot_strcmp (state.arg, "unpress") == 0) return 0; - if (grub_strcmp (state.arg, "on") == 0 || grub_strcmp (state.arg, "1") == 0 - || grub_strcmp (state.arg, "press") == 0) + if (VasEBoot_strcmp (state.arg, "on") == 0 || VasEBoot_strcmp (state.arg, "1") == 0 + || VasEBoot_strcmp (state.arg, "press") == 0) return 1; return 2; } -static grub_uint32_t oldflags; +static VasEBoot_uint32_t oldflags; -static grub_err_t -grub_sendkey_postboot (void) +static VasEBoot_err_t +VasEBoot_sendkey_postboot (void) { /* For convention: pointer to flags. */ - grub_uint32_t *flags = (grub_uint32_t *) 0x417; + VasEBoot_uint32_t *flags = (VasEBoot_uint32_t *) 0x417; *flags = oldflags; *((char *) 0x41a) = 0x1e; *((char *) 0x41c) = 0x1e; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Set keyboard buffer to our sendkey */ -static grub_err_t -grub_sendkey_preboot (int noret __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_sendkey_preboot (int noret __attribute__ ((unused))) { /* For convention: pointer to flags. */ - grub_uint32_t *flags = (grub_uint32_t *) 0x417; + VasEBoot_uint32_t *flags = (VasEBoot_uint32_t *) 0x417; oldflags = *flags; /* Set the sendkey. */ *((char *) 0x41a) = 0x1e; *((char *) 0x41c) = keylen + 0x1e; - grub_memcpy ((char *) 0x41e, sendkey, 0x20); + VasEBoot_memcpy ((char *) 0x41e, sendkey, 0x20); /* Transform "any ctrl" to "right ctrl" flag. */ if (*flags & (1 << 8)) @@ -268,25 +268,25 @@ grub_sendkey_preboot (int noret __attribute__ ((unused))) { value = 0; /* Send command change LEDs */ - grub_outb (0xed, 0x60); + VasEBoot_outb (0xed, 0x60); /* Wait */ do - value = grub_inb (0x60); + value = VasEBoot_inb (0x60); while ((value != 0xfa) && (value != 0xfe)); if (value == 0xfa) { /* Set new LEDs*/ - grub_outb ((*flags >> 4) & 7, 0x60); + VasEBoot_outb ((*flags >> 4) & 7, 0x60); break; } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Helper for grub_cmd_sendkey. */ +/* Helper for VasEBoot_cmd_sendkey. */ static int find_key_code (char *key) { @@ -295,17 +295,17 @@ find_key_code (char *key) for (i = 0; i < ARRAY_SIZE(keysym_table); i++) { if (keysym_table[i].unshifted_name - && grub_strcmp (key, keysym_table[i].unshifted_name) == 0) + && VasEBoot_strcmp (key, keysym_table[i].unshifted_name) == 0) return keysym_table[i].keycode; else if (keysym_table[i].shifted_name - && grub_strcmp (key, keysym_table[i].shifted_name) == 0) + && VasEBoot_strcmp (key, keysym_table[i].shifted_name) == 0) return keysym_table[i].keycode; } return 0; } -/* Helper for grub_cmd_sendkey. */ +/* Helper for VasEBoot_cmd_sendkey. */ static int find_ascii_code (char *key) { @@ -314,20 +314,20 @@ find_ascii_code (char *key) for (i = 0; i < ARRAY_SIZE(keysym_table); i++) { if (keysym_table[i].unshifted_name - && grub_strcmp (key, keysym_table[i].unshifted_name) == 0) + && VasEBoot_strcmp (key, keysym_table[i].unshifted_name) == 0) return keysym_table[i].unshifted_ascii; else if (keysym_table[i].shifted_name - && grub_strcmp (key, keysym_table[i].shifted_name) == 0) + && VasEBoot_strcmp (key, keysym_table[i].shifted_name) == 0) return keysym_table[i].shifted_ascii; } return 0; } -static grub_err_t -grub_cmd_sendkey (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_sendkey (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; andmask = 0xffffffff; ormask = 0; @@ -353,35 +353,35 @@ grub_cmd_sendkey (grub_extcmd_context_t ctxt, int argc, char **args) { unsigned i; for (i = 0; i < ARRAY_SIZE(simple_flag_offsets); i++) - grub_sendkey_set_simple_flag (simple_flag_offsets[i], - grub_sendkey_parse_op(state[i])); + VasEBoot_sendkey_set_simple_flag (simple_flag_offsets[i], + VasEBoot_sendkey_parse_op(state[i])); } /* Set noled. */ noled = (state[ARRAY_SIZE(simple_flag_offsets)].set); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; -static struct grub_preboot *preboot_hook; +static VasEBoot_extcmd_t cmd; +static struct VasEBoot_preboot *preboot_hook; -GRUB_MOD_INIT (sendkey) +VasEBoot_MOD_INIT (sendkey) { - cmd = grub_register_extcmd ("sendkey", grub_cmd_sendkey, 0, + cmd = VasEBoot_register_extcmd ("sendkey", VasEBoot_cmd_sendkey, 0, N_("[KEYSTROKE1] [KEYSTROKE2] ..."), /* TRANSLATORS: It can emulate multiple keypresses. */ N_("Emulate a keystroke sequence"), options); preboot_hook - = grub_loader_register_preboot_hook (grub_sendkey_preboot, - grub_sendkey_postboot, - GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE); + = VasEBoot_loader_register_preboot_hook (VasEBoot_sendkey_preboot, + VasEBoot_sendkey_postboot, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_CONSOLE); } -GRUB_MOD_FINI (sendkey) +VasEBoot_MOD_FINI (sendkey) { - grub_unregister_extcmd (cmd); - grub_loader_unregister_preboot_hook (preboot_hook); + VasEBoot_unregister_extcmd (cmd); + VasEBoot_loader_unregister_preboot_hook (preboot_hook); } diff --git a/VasEBoot-core/commands/i386/pc/smbios.c b/VasEBoot-core/commands/i386/pc/smbios.c index 3bdf3d766..b948a51ba 100644 --- a/VasEBoot-core/commands/i386/pc/smbios.c +++ b/VasEBoot-core/commands/i386/pc/smbios.c @@ -1,50 +1,50 @@ /* smbios.c - get smbios tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -struct grub_smbios_eps * -grub_machine_smbios_get_eps (void) +struct VasEBoot_smbios_eps * +VasEBoot_machine_smbios_get_eps (void) { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; - grub_dprintf ("smbios", "Looking for SMBIOS EPS. Scanning BIOS\n"); - for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000; + VasEBoot_dprintf ("smbios", "Looking for SMBIOS EPS. Scanning BIOS\n"); + for (ptr = (VasEBoot_uint8_t *) 0xf0000; ptr < (VasEBoot_uint8_t *) 0x100000; ptr += 16) - if (grub_memcmp (ptr, "_SM_", 4) == 0 - && grub_byte_checksum (ptr, sizeof (struct grub_smbios_eps)) == 0) - return (struct grub_smbios_eps *) ptr; + if (VasEBoot_memcmp (ptr, "_SM_", 4) == 0 + && VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_smbios_eps)) == 0) + return (struct VasEBoot_smbios_eps *) ptr; return 0; } -struct grub_smbios_eps3 * -grub_machine_smbios_get_eps3 (void) +struct VasEBoot_smbios_eps3 * +VasEBoot_machine_smbios_get_eps3 (void) { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; - grub_dprintf ("smbios", "Looking for SMBIOS3 EPS. Scanning BIOS\n"); - for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000; + VasEBoot_dprintf ("smbios", "Looking for SMBIOS3 EPS. Scanning BIOS\n"); + for (ptr = (VasEBoot_uint8_t *) 0xf0000; ptr < (VasEBoot_uint8_t *) 0x100000; ptr += 16) - if (grub_memcmp (ptr, "_SM3_", 5) == 0 - && grub_byte_checksum (ptr, sizeof (struct grub_smbios_eps3)) == 0) - return (struct grub_smbios_eps3 *) ptr; + if (VasEBoot_memcmp (ptr, "_SM3_", 5) == 0 + && VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_smbios_eps3)) == 0) + return (struct VasEBoot_smbios_eps3 *) ptr; return 0; } diff --git a/VasEBoot-core/commands/ieee1275/suspend.c b/VasEBoot-core/commands/ieee1275/suspend.c index b50548574..b30acd3f9 100644 --- a/VasEBoot-core/commands/ieee1275/suspend.c +++ b/VasEBoot-core/commands/ieee1275/suspend.c @@ -1,51 +1,51 @@ -/* suspend.c - command to suspend GRUB and return to Open Firmware */ +/* suspend.c - command to suspend VasEBoot and return to Open Firmware */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_suspend (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_suspend (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_puts_ (N_("Run `go' to resume GRUB.")); - grub_ieee1275_enter (); - grub_cls (); + VasEBoot_puts_ (N_("Run `go' to resume VasEBoot.")); + VasEBoot_ieee1275_enter (); + VasEBoot_cls (); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(ieee1275_suspend) +VasEBoot_MOD_INIT(ieee1275_suspend) { - cmd = grub_register_command ("suspend", grub_cmd_suspend, + cmd = VasEBoot_register_command ("suspend", VasEBoot_cmd_suspend, 0, N_("Return to IEEE1275 prompt.")); } -GRUB_MOD_FINI(ieee1275_suspend) +VasEBoot_MOD_FINI(ieee1275_suspend) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/iorw.c b/VasEBoot-core/commands/iorw.c index a0c164e54..6394a6b43 100644 --- a/VasEBoot-core/commands/iorw.c +++ b/VasEBoot-core/commands/iorw.c @@ -1,35 +1,35 @@ /* memrw.c - command to read / write physical memory */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword; -static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; +static VasEBoot_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword; +static VasEBoot_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {0, 'v', 0, N_("Save read value into variable VARNAME."), N_("VARNAME"), ARG_TYPE_STRING}, @@ -37,119 +37,119 @@ static const struct grub_arg_option options[] = }; -static grub_err_t -grub_cmd_read (grub_extcmd_context_t ctxt, int argc, char **argv) +static VasEBoot_err_t +VasEBoot_cmd_read (VasEBoot_extcmd_context_t ctxt, int argc, char **argv) { - grub_port_t addr; - grub_uint32_t value = 0; + VasEBoot_port_t addr; + VasEBoot_uint32_t value = 0; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - addr = grub_strtoul (argv[0], 0, 0); + addr = VasEBoot_strtoul (argv[0], 0, 0); switch (ctxt->extcmd->cmd->name[sizeof ("in") - 1]) { case 'l': - value = grub_inl (addr); + value = VasEBoot_inl (addr); break; case 'w': - value = grub_inw (addr); + value = VasEBoot_inw (addr); break; case 'b': - value = grub_inb (addr); + value = VasEBoot_inb (addr); break; } if (ctxt->state[0].set) { char buf[sizeof ("XXXXXXXX")]; - grub_snprintf (buf, sizeof (buf), "%x", value); - grub_env_set (ctxt->state[0].arg, buf); + VasEBoot_snprintf (buf, sizeof (buf), "%x", value); + VasEBoot_env_set (ctxt->state[0].arg, buf); } else - grub_printf ("0x%x\n", value); + VasEBoot_printf ("0x%x\n", value); return 0; } -static grub_err_t -grub_cmd_write (grub_command_t cmd, int argc, char **argv) +static VasEBoot_err_t +VasEBoot_cmd_write (VasEBoot_command_t cmd, int argc, char **argv) { - grub_port_t addr; - grub_uint32_t value; - grub_uint32_t mask = 0xffffffff; + VasEBoot_port_t addr; + VasEBoot_uint32_t value; + VasEBoot_uint32_t mask = 0xffffffff; if (argc != 2 && argc != 3) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); - addr = grub_strtoul (argv[0], 0, 0); - value = grub_strtoul (argv[1], 0, 0); + addr = VasEBoot_strtoul (argv[0], 0, 0); + value = VasEBoot_strtoul (argv[1], 0, 0); if (argc == 3) - mask = grub_strtoul (argv[2], 0, 0); + mask = VasEBoot_strtoul (argv[2], 0, 0); value &= mask; switch (cmd->name[sizeof ("out") - 1]) { case 'l': if (mask != 0xffffffff) - grub_outl ((grub_inl (addr) & ~mask) | value, addr); + VasEBoot_outl ((VasEBoot_inl (addr) & ~mask) | value, addr); else - grub_outl (value, addr); + VasEBoot_outl (value, addr); break; case 'w': if ((mask & 0xffff) != 0xffff) - grub_outw ((grub_inw (addr) & ~mask) | value, addr); + VasEBoot_outw ((VasEBoot_inw (addr) & ~mask) | value, addr); else - grub_outw (value, addr); + VasEBoot_outw (value, addr); break; case 'b': if ((mask & 0xff) != 0xff) - grub_outb ((grub_inb (addr) & ~mask) | value, addr); + VasEBoot_outb ((VasEBoot_inb (addr) & ~mask) | value, addr); else - grub_outb (value, addr); + VasEBoot_outb (value, addr); break; } return 0; } -GRUB_MOD_INIT(memrw) +VasEBoot_MOD_INIT(memrw) { cmd_read_byte = - grub_register_extcmd ("inb", grub_cmd_read, 0, + VasEBoot_register_extcmd ("inb", VasEBoot_cmd_read, 0, N_("PORT"), N_("Read 8-bit value from PORT."), options); cmd_read_word = - grub_register_extcmd ("inw", grub_cmd_read, 0, + VasEBoot_register_extcmd ("inw", VasEBoot_cmd_read, 0, N_("PORT"), N_("Read 16-bit value from PORT."), options); cmd_read_dword = - grub_register_extcmd ("inl", grub_cmd_read, 0, + VasEBoot_register_extcmd ("inl", VasEBoot_cmd_read, 0, N_("PORT"), N_("Read 32-bit value from PORT."), options); cmd_write_byte = - grub_register_command ("outb", grub_cmd_write, + VasEBoot_register_command ("outb", VasEBoot_cmd_write, N_("PORT VALUE [MASK]"), N_("Write 8-bit VALUE to PORT.")); cmd_write_word = - grub_register_command ("outw", grub_cmd_write, + VasEBoot_register_command ("outw", VasEBoot_cmd_write, N_("PORT VALUE [MASK]"), N_("Write 16-bit VALUE to PORT.")); cmd_write_dword = - grub_register_command ("outl", grub_cmd_write, + VasEBoot_register_command ("outl", VasEBoot_cmd_write, N_("ADDR VALUE [MASK]"), N_("Write 32-bit VALUE to PORT.")); } -GRUB_MOD_FINI(memrw) +VasEBoot_MOD_FINI(memrw) { - grub_unregister_extcmd (cmd_read_byte); - grub_unregister_extcmd (cmd_read_word); - grub_unregister_extcmd (cmd_read_dword); - grub_unregister_command (cmd_write_byte); - grub_unregister_command (cmd_write_word); - grub_unregister_command (cmd_write_dword); + VasEBoot_unregister_extcmd (cmd_read_byte); + VasEBoot_unregister_extcmd (cmd_read_word); + VasEBoot_unregister_extcmd (cmd_read_dword); + VasEBoot_unregister_command (cmd_write_byte); + VasEBoot_unregister_command (cmd_write_word); + VasEBoot_unregister_command (cmd_write_dword); } diff --git a/VasEBoot-core/commands/keylayouts.c b/VasEBoot-core/commands/keylayouts.c index f4b773020..fbdcd71c8 100644 --- a/VasEBoot-core/commands/keylayouts.c +++ b/VasEBoot-core/commands/keylayouts.c @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static struct grub_keyboard_layout layout_us = { +static struct VasEBoot_keyboard_layout layout_us = { .keyboard_map = { /* Keyboard errors. Handled by driver. */ /* 0x00 */ 0, 0, 0, 0, @@ -47,30 +47,30 @@ static struct grub_keyboard_layout layout_us = { */ /* 0x30 */ ']', 0, '\\', ';', '\'', '`', ',', '.', /* 0x39 is CapsLock. Handled by driver. */ - /* 0x38 */ '/', 0, GRUB_TERM_KEY_F1, GRUB_TERM_KEY_F2, - /* 0x3c */ GRUB_TERM_KEY_F3, GRUB_TERM_KEY_F4, - /* 0x3e */ GRUB_TERM_KEY_F5, GRUB_TERM_KEY_F6, - /* 0x40 */ GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, - /* 0x42 */ GRUB_TERM_KEY_F9, GRUB_TERM_KEY_F10, - /* 0x44 */ GRUB_TERM_KEY_F11, GRUB_TERM_KEY_F12, + /* 0x38 */ '/', 0, VasEBoot_TERM_KEY_F1, VasEBoot_TERM_KEY_F2, + /* 0x3c */ VasEBoot_TERM_KEY_F3, VasEBoot_TERM_KEY_F4, + /* 0x3e */ VasEBoot_TERM_KEY_F5, VasEBoot_TERM_KEY_F6, + /* 0x40 */ VasEBoot_TERM_KEY_F7, VasEBoot_TERM_KEY_F8, + /* 0x42 */ VasEBoot_TERM_KEY_F9, VasEBoot_TERM_KEY_F10, + /* 0x44 */ VasEBoot_TERM_KEY_F11, VasEBoot_TERM_KEY_F12, /* PrtScr and ScrollLock. Not handled yet. */ /* 0x46 */ 0, 0, /* 0x48 is Pause. Not handled yet. */ - /* 0x48 */ 0, GRUB_TERM_KEY_INSERT, - /* 0x4a */ GRUB_TERM_KEY_HOME, GRUB_TERM_KEY_PPAGE, - /* 0x4c */ GRUB_TERM_KEY_DC, GRUB_TERM_KEY_END, - /* 0x4e */ GRUB_TERM_KEY_NPAGE, GRUB_TERM_KEY_RIGHT, - /* 0x50 */ GRUB_TERM_KEY_LEFT, GRUB_TERM_KEY_DOWN, + /* 0x48 */ 0, VasEBoot_TERM_KEY_INSERT, + /* 0x4a */ VasEBoot_TERM_KEY_HOME, VasEBoot_TERM_KEY_PPAGE, + /* 0x4c */ VasEBoot_TERM_KEY_DC, VasEBoot_TERM_KEY_END, + /* 0x4e */ VasEBoot_TERM_KEY_NPAGE, VasEBoot_TERM_KEY_RIGHT, + /* 0x50 */ VasEBoot_TERM_KEY_LEFT, VasEBoot_TERM_KEY_DOWN, /* 0x53 is NumLock. Handled by driver. */ - /* 0x52 */ GRUB_TERM_KEY_UP, 0, + /* 0x52 */ VasEBoot_TERM_KEY_UP, 0, /* 0x54 */ '/', '*', /* 0x56 */ '-', '+', - /* 0x58 */ '\n', GRUB_TERM_KEY_END, - /* 0x5a */ GRUB_TERM_KEY_DOWN, GRUB_TERM_KEY_NPAGE, - /* 0x5c */ GRUB_TERM_KEY_LEFT, GRUB_TERM_KEY_CENTER, - /* 0x5e */ GRUB_TERM_KEY_RIGHT, GRUB_TERM_KEY_HOME, - /* 0x60 */ GRUB_TERM_KEY_UP, GRUB_TERM_KEY_PPAGE, - /* 0x62 */ GRUB_TERM_KEY_INSERT, GRUB_TERM_KEY_DC, + /* 0x58 */ '\n', VasEBoot_TERM_KEY_END, + /* 0x5a */ VasEBoot_TERM_KEY_DOWN, VasEBoot_TERM_KEY_NPAGE, + /* 0x5c */ VasEBoot_TERM_KEY_LEFT, VasEBoot_TERM_KEY_CENTER, + /* 0x5e */ VasEBoot_TERM_KEY_RIGHT, VasEBoot_TERM_KEY_HOME, + /* 0x60 */ VasEBoot_TERM_KEY_UP, VasEBoot_TERM_KEY_PPAGE, + /* 0x62 */ VasEBoot_TERM_KEY_INSERT, VasEBoot_TERM_KEY_DC, /* 0x64 */ '\\' }, .keyboard_map_shift = { @@ -82,9 +82,9 @@ static struct grub_keyboard_layout layout_us = { /* 0x10 */ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', /* 0x18 */ 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '@', /* 0x20 */ '#', '$', '%', '^', '&', '*', '(', ')', - /* 0x28 */ '\n' | GRUB_TERM_SHIFT, '\e' | GRUB_TERM_SHIFT, - /* 0x2a */ '\b' | GRUB_TERM_SHIFT, '\t' | GRUB_TERM_SHIFT, - /* 0x2c */ ' ' | GRUB_TERM_SHIFT, '_', '+', '{', + /* 0x28 */ '\n' | VasEBoot_TERM_SHIFT, '\e' | VasEBoot_TERM_SHIFT, + /* 0x2a */ '\b' | VasEBoot_TERM_SHIFT, '\t' | VasEBoot_TERM_SHIFT, + /* 0x2c */ ' ' | VasEBoot_TERM_SHIFT, '_', '+', '{', /* According to usage table 0x31 should be mapped to '/' but testing with real keyboard shows that 0x32 is remapped to '/'. Map 0x31 to 0. @@ -92,93 +92,93 @@ static struct grub_keyboard_layout layout_us = { /* 0x30 */ '}', 0, '|', ':', '"', '~', '<', '>', /* 0x39 is CapsLock. Handled by driver. */ /* 0x38 */ '?', 0, - /* 0x3a */ GRUB_TERM_KEY_F1 | GRUB_TERM_SHIFT, - /* 0x3b */ GRUB_TERM_KEY_F2 | GRUB_TERM_SHIFT, - /* 0x3c */ GRUB_TERM_KEY_F3 | GRUB_TERM_SHIFT, - /* 0x3d */ GRUB_TERM_KEY_F4 | GRUB_TERM_SHIFT, - /* 0x3e */ GRUB_TERM_KEY_F5 | GRUB_TERM_SHIFT, - /* 0x3f */ GRUB_TERM_KEY_F6 | GRUB_TERM_SHIFT, - /* 0x40 */ GRUB_TERM_KEY_F7 | GRUB_TERM_SHIFT, - /* 0x41 */ GRUB_TERM_KEY_F8 | GRUB_TERM_SHIFT, - /* 0x42 */ GRUB_TERM_KEY_F9 | GRUB_TERM_SHIFT, - /* 0x43 */ GRUB_TERM_KEY_F10 | GRUB_TERM_SHIFT, - /* 0x44 */ GRUB_TERM_KEY_F11 | GRUB_TERM_SHIFT, - /* 0x45 */ GRUB_TERM_KEY_F12 | GRUB_TERM_SHIFT, + /* 0x3a */ VasEBoot_TERM_KEY_F1 | VasEBoot_TERM_SHIFT, + /* 0x3b */ VasEBoot_TERM_KEY_F2 | VasEBoot_TERM_SHIFT, + /* 0x3c */ VasEBoot_TERM_KEY_F3 | VasEBoot_TERM_SHIFT, + /* 0x3d */ VasEBoot_TERM_KEY_F4 | VasEBoot_TERM_SHIFT, + /* 0x3e */ VasEBoot_TERM_KEY_F5 | VasEBoot_TERM_SHIFT, + /* 0x3f */ VasEBoot_TERM_KEY_F6 | VasEBoot_TERM_SHIFT, + /* 0x40 */ VasEBoot_TERM_KEY_F7 | VasEBoot_TERM_SHIFT, + /* 0x41 */ VasEBoot_TERM_KEY_F8 | VasEBoot_TERM_SHIFT, + /* 0x42 */ VasEBoot_TERM_KEY_F9 | VasEBoot_TERM_SHIFT, + /* 0x43 */ VasEBoot_TERM_KEY_F10 | VasEBoot_TERM_SHIFT, + /* 0x44 */ VasEBoot_TERM_KEY_F11 | VasEBoot_TERM_SHIFT, + /* 0x45 */ VasEBoot_TERM_KEY_F12 | VasEBoot_TERM_SHIFT, /* PrtScr and ScrollLock. Not handled yet. */ /* 0x46 */ 0, 0, /* 0x48 is Pause. Not handled yet. */ - /* 0x48 */ 0, GRUB_TERM_KEY_INSERT | GRUB_TERM_SHIFT, - /* 0x4a */ GRUB_TERM_KEY_HOME | GRUB_TERM_SHIFT, - /* 0x4b */ GRUB_TERM_KEY_PPAGE | GRUB_TERM_SHIFT, - /* 0x4c */ GRUB_TERM_KEY_DC | GRUB_TERM_SHIFT, - /* 0x4d */ GRUB_TERM_KEY_END | GRUB_TERM_SHIFT, - /* 0x4e */ GRUB_TERM_KEY_NPAGE | GRUB_TERM_SHIFT, - /* 0x4f */ GRUB_TERM_KEY_RIGHT | GRUB_TERM_SHIFT, - /* 0x50 */ GRUB_TERM_KEY_LEFT | GRUB_TERM_SHIFT, - /* 0x51 */ GRUB_TERM_KEY_DOWN | GRUB_TERM_SHIFT, + /* 0x48 */ 0, VasEBoot_TERM_KEY_INSERT | VasEBoot_TERM_SHIFT, + /* 0x4a */ VasEBoot_TERM_KEY_HOME | VasEBoot_TERM_SHIFT, + /* 0x4b */ VasEBoot_TERM_KEY_PPAGE | VasEBoot_TERM_SHIFT, + /* 0x4c */ VasEBoot_TERM_KEY_DC | VasEBoot_TERM_SHIFT, + /* 0x4d */ VasEBoot_TERM_KEY_END | VasEBoot_TERM_SHIFT, + /* 0x4e */ VasEBoot_TERM_KEY_NPAGE | VasEBoot_TERM_SHIFT, + /* 0x4f */ VasEBoot_TERM_KEY_RIGHT | VasEBoot_TERM_SHIFT, + /* 0x50 */ VasEBoot_TERM_KEY_LEFT | VasEBoot_TERM_SHIFT, + /* 0x51 */ VasEBoot_TERM_KEY_DOWN | VasEBoot_TERM_SHIFT, /* 0x53 is NumLock. Handled by driver. */ - /* 0x52 */ GRUB_TERM_KEY_UP | GRUB_TERM_SHIFT, 0, + /* 0x52 */ VasEBoot_TERM_KEY_UP | VasEBoot_TERM_SHIFT, 0, /* 0x54 */ '/', '*', /* 0x56 */ '-', '+', - /* 0x58 */ '\n' | GRUB_TERM_SHIFT, '1', '2', '3', '4', '5','6', '7', + /* 0x58 */ '\n' | VasEBoot_TERM_SHIFT, '1', '2', '3', '4', '5','6', '7', /* 0x60 */ '8', '9', '0', '.', '|' } }; -static struct grub_keyboard_layout *grub_current_layout = &layout_us; +static struct VasEBoot_keyboard_layout *VasEBoot_current_layout = &layout_us; static int map_key_core (int code, int status, int *alt_gr_consumed) { *alt_gr_consumed = 0; - if (code >= GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE) + if (code >= VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE) return 0; - if (status & GRUB_TERM_STATUS_RALT) + if (status & VasEBoot_TERM_STATUS_RALT) { - if (status & (GRUB_TERM_STATUS_LSHIFT | GRUB_TERM_STATUS_RSHIFT)) + if (status & (VasEBoot_TERM_STATUS_LSHIFT | VasEBoot_TERM_STATUS_RSHIFT)) { - if (grub_current_layout->keyboard_map_shift_l3[code]) + if (VasEBoot_current_layout->keyboard_map_shift_l3[code]) { *alt_gr_consumed = 1; - return grub_current_layout->keyboard_map_shift_l3[code]; + return VasEBoot_current_layout->keyboard_map_shift_l3[code]; } } - else if (grub_current_layout->keyboard_map_l3[code]) + else if (VasEBoot_current_layout->keyboard_map_l3[code]) { *alt_gr_consumed = 1; - return grub_current_layout->keyboard_map_l3[code]; + return VasEBoot_current_layout->keyboard_map_l3[code]; } } - if (status & (GRUB_TERM_STATUS_LSHIFT | GRUB_TERM_STATUS_RSHIFT)) - return grub_current_layout->keyboard_map_shift[code]; + if (status & (VasEBoot_TERM_STATUS_LSHIFT | VasEBoot_TERM_STATUS_RSHIFT)) + return VasEBoot_current_layout->keyboard_map_shift[code]; else - return grub_current_layout->keyboard_map[code]; + return VasEBoot_current_layout->keyboard_map[code]; } unsigned -grub_term_map_key (grub_keyboard_key_t code, int status) +VasEBoot_term_map_key (VasEBoot_keyboard_key_t code, int status) { int alt_gr_consumed = 0; int key; - if (code >= 0x59 && code <= 0x63 && (status & GRUB_TERM_STATUS_NUM)) + if (code >= 0x59 && code <= 0x63 && (status & VasEBoot_TERM_STATUS_NUM)) { - if (status & (GRUB_TERM_STATUS_RSHIFT | GRUB_TERM_STATUS_LSHIFT)) - status &= ~(GRUB_TERM_STATUS_RSHIFT | GRUB_TERM_STATUS_LSHIFT); + if (status & (VasEBoot_TERM_STATUS_RSHIFT | VasEBoot_TERM_STATUS_LSHIFT)) + status &= ~(VasEBoot_TERM_STATUS_RSHIFT | VasEBoot_TERM_STATUS_LSHIFT); else - status |= GRUB_TERM_STATUS_RSHIFT; + status |= VasEBoot_TERM_STATUS_RSHIFT; } key = map_key_core (code, status, &alt_gr_consumed); - if (key == 0 || key == GRUB_TERM_SHIFT) { - grub_printf ("Unknown key 0x%x detected\n", code); - return GRUB_TERM_NO_KEY; + if (key == 0 || key == VasEBoot_TERM_SHIFT) { + VasEBoot_printf ("Unknown key 0x%x detected\n", code); + return VasEBoot_TERM_NO_KEY; } - if (status & GRUB_TERM_STATUS_CAPS) + if (status & VasEBoot_TERM_STATUS_CAPS) { if ((key >= 'a') && (key <= 'z')) key += 'A' - 'a'; @@ -186,122 +186,122 @@ grub_term_map_key (grub_keyboard_key_t code, int status) key += 'a' - 'A'; } - if ((status & GRUB_TERM_STATUS_LALT) || - ((status & GRUB_TERM_STATUS_RALT) && !alt_gr_consumed)) - key |= GRUB_TERM_ALT; - if (status & (GRUB_TERM_STATUS_LCTRL | GRUB_TERM_STATUS_RCTRL)) - key |= GRUB_TERM_CTRL; + if ((status & VasEBoot_TERM_STATUS_LALT) || + ((status & VasEBoot_TERM_STATUS_RALT) && !alt_gr_consumed)) + key |= VasEBoot_TERM_ALT; + if (status & (VasEBoot_TERM_STATUS_LCTRL | VasEBoot_TERM_STATUS_RCTRL)) + key |= VasEBoot_TERM_CTRL; return key; } -static grub_err_t -grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_keymap (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { char *filename; - grub_file_t file; - grub_uint32_t version; - grub_uint8_t magic[GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE]; - struct grub_keyboard_layout *newmap = NULL; + VasEBoot_file_t file; + VasEBoot_uint32_t version; + VasEBoot_uint8_t magic[VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE]; + struct VasEBoot_keyboard_layout *newmap = NULL; unsigned i; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "file or layout name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "file or layout name required"); if (argv[0][0] != '(' && argv[0][0] != '/' && argv[0][0] != '+') { - const char *prefix = grub_env_get ("prefix"); + const char *prefix = VasEBoot_env_get ("prefix"); if (!prefix) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("variable `%s' isn't set"), "prefix"); - filename = grub_xasprintf ("%s/layouts/%s.gkb", prefix, argv[0]); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("variable `%s' isn't set"), "prefix"); + filename = VasEBoot_xasprintf ("%s/layouts/%s.gkb", prefix, argv[0]); if (!filename) - return grub_errno; + return VasEBoot_errno; } else filename = argv[0]; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (! file) goto fail; - if (grub_file_read (file, magic, sizeof (magic)) != sizeof (magic)) + if (VasEBoot_file_read (file, magic, sizeof (magic)) != sizeof (magic)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("premature end of file %s"), filename); goto fail; } - if (grub_memcmp (magic, GRUB_KEYBOARD_LAYOUTS_FILEMAGIC, - GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE) != 0) + if (VasEBoot_memcmp (magic, VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC, + VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE) != 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid magic"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid magic"); goto fail; } - if (grub_file_read (file, &version, sizeof (version)) != sizeof (version)) + if (VasEBoot_file_read (file, &version, sizeof (version)) != sizeof (version)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("premature end of file %s"), filename); goto fail; } - if (version != grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION)) + if (version != VasEBoot_cpu_to_le32_compile_time (VasEBoot_KEYBOARD_LAYOUTS_VERSION)) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid version"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid version"); goto fail; } - newmap = grub_malloc (sizeof (*newmap)); + newmap = VasEBoot_malloc (sizeof (*newmap)); if (!newmap) goto fail; - if (grub_file_read (file, newmap, sizeof (*newmap)) != sizeof (*newmap)) + if (VasEBoot_file_read (file, newmap, sizeof (*newmap)) != sizeof (*newmap)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("premature end of file %s"), filename); goto fail; } for (i = 0; i < ARRAY_SIZE (newmap->keyboard_map); i++) - newmap->keyboard_map[i] = grub_le_to_cpu32(newmap->keyboard_map[i]); + newmap->keyboard_map[i] = VasEBoot_le_to_cpu32(newmap->keyboard_map[i]); for (i = 0; i < ARRAY_SIZE (newmap->keyboard_map_shift); i++) newmap->keyboard_map_shift[i] - = grub_le_to_cpu32(newmap->keyboard_map_shift[i]); + = VasEBoot_le_to_cpu32(newmap->keyboard_map_shift[i]); for (i = 0; i < ARRAY_SIZE (newmap->keyboard_map_l3); i++) newmap->keyboard_map_l3[i] - = grub_le_to_cpu32(newmap->keyboard_map_l3[i]); + = VasEBoot_le_to_cpu32(newmap->keyboard_map_l3[i]); for (i = 0; i < ARRAY_SIZE (newmap->keyboard_map_shift_l3); i++) newmap->keyboard_map_shift_l3[i] - = grub_le_to_cpu32(newmap->keyboard_map_shift_l3[i]); + = VasEBoot_le_to_cpu32(newmap->keyboard_map_shift_l3[i]); - grub_current_layout = newmap; + VasEBoot_current_layout = newmap; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: if (filename != argv[0]) - grub_free (filename); - grub_free (newmap); + VasEBoot_free (filename); + VasEBoot_free (newmap); if (file) - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(keylayouts) +VasEBoot_MOD_INIT(keylayouts) { - cmd = grub_register_command ("keymap", grub_cmd_keymap, + cmd = VasEBoot_register_command ("keymap", VasEBoot_cmd_keymap, 0, N_("Load a keyboard layout.")); } -GRUB_MOD_FINI(keylayouts) +VasEBoot_MOD_FINI(keylayouts) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/keystatus.c b/VasEBoot-core/commands/keystatus.c index 460cf4e7e..c62536c49 100644 --- a/VasEBoot-core/commands/keystatus.c +++ b/VasEBoot-core/commands/keystatus.c @@ -1,31 +1,31 @@ /* keystatus.c - Command to check key modifier status. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { /* TRANSLATORS: "Check" in a sense that if this key is pressed then "true" is returned, otherwise "false". */ @@ -36,13 +36,13 @@ static const struct grub_arg_option options[] = }; static int -grub_getkeystatus (void) +VasEBoot_getkeystatus (void) { int status = 0; - grub_term_input_t term; + VasEBoot_term_input_t term; - if (grub_term_poll_usb) - grub_term_poll_usb (0); + if (VasEBoot_term_poll_usb) + VasEBoot_term_poll_usb (0); FOR_ACTIVE_TERM_INPUTS(term) { @@ -53,61 +53,61 @@ grub_getkeystatus (void) return status; } -static grub_err_t -grub_cmd_keystatus (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_keystatus (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; int expect_mods = 0; int mods; if (state[0].set) - expect_mods |= (GRUB_TERM_STATUS_LSHIFT | GRUB_TERM_STATUS_RSHIFT); + expect_mods |= (VasEBoot_TERM_STATUS_LSHIFT | VasEBoot_TERM_STATUS_RSHIFT); if (state[1].set) - expect_mods |= (GRUB_TERM_STATUS_LCTRL | GRUB_TERM_STATUS_RCTRL); + expect_mods |= (VasEBoot_TERM_STATUS_LCTRL | VasEBoot_TERM_STATUS_RCTRL); if (state[2].set) - expect_mods |= (GRUB_TERM_STATUS_LALT | GRUB_TERM_STATUS_RALT); + expect_mods |= (VasEBoot_TERM_STATUS_LALT | VasEBoot_TERM_STATUS_RALT); - grub_dprintf ("keystatus", "expect_mods: %d\n", expect_mods); + VasEBoot_dprintf ("keystatus", "expect_mods: %d\n", expect_mods); /* Without arguments, just check whether getkeystatus is supported at all. */ if (expect_mods == 0) { - grub_term_input_t term; + VasEBoot_term_input_t term; int nterms = 0; FOR_ACTIVE_TERM_INPUTS (term) if (!term->getkeystatus) - return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); else nterms++; if (!nterms) - return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); return 0; } - mods = grub_getkeystatus (); - grub_dprintf ("keystatus", "mods: %d\n", mods); + mods = VasEBoot_getkeystatus (); + VasEBoot_dprintf ("keystatus", "mods: %d\n", mods); if (mods >= 0 && (mods & expect_mods) != 0) return 0; else - return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(keystatus) +VasEBoot_MOD_INIT(keystatus) { - cmd = grub_register_extcmd ("keystatus", grub_cmd_keystatus, 0, + cmd = VasEBoot_register_extcmd ("keystatus", VasEBoot_cmd_keystatus, 0, "[--shift] [--ctrl] [--alt]", /* TRANSLATORS: there are 3 modifiers. */ N_("Check key modifier status."), options); } -GRUB_MOD_FINI(keystatus) +VasEBoot_MOD_FINI(keystatus) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/legacycfg.c b/VasEBoot-core/commands/legacycfg.c index b32f3c74c..375182d72 100644 --- a/VasEBoot-core/commands/legacycfg.c +++ b/VasEBoot-core/commands/legacycfg.c @@ -1,90 +1,90 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000, 2001, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Helper for legacy_file. */ -static grub_err_t +static VasEBoot_err_t legacy_file_getline (char **line, int cont __attribute__ ((unused)), void *data __attribute__ ((unused))) { *line = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t legacy_file (const char *filename) { - grub_file_t file; + VasEBoot_file_t file; char *entryname = NULL, *entrysrc = NULL; - grub_menu_t menu; - char *suffix = grub_strdup (""); + VasEBoot_menu_t menu; + char *suffix = VasEBoot_strdup (""); if (!suffix) - return grub_errno; + return VasEBoot_errno; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (! file) { - grub_free (suffix); - return grub_errno; + VasEBoot_free (suffix); + return VasEBoot_errno; } - menu = grub_env_get_menu (); + menu = VasEBoot_env_get_menu (); if (! menu) { - menu = grub_zalloc (sizeof (*menu)); + menu = VasEBoot_zalloc (sizeof (*menu)); if (! menu) { - grub_free (suffix); - return grub_errno; + VasEBoot_free (suffix); + return VasEBoot_errno; } - grub_env_set_menu (menu); + VasEBoot_env_set_menu (menu); } while (1) { - char *buf = grub_file_getline (file); + char *buf = VasEBoot_file_getline (file); char *parsed = NULL; - if (!buf && grub_errno) + if (!buf && VasEBoot_errno) { - grub_file_close (file); - grub_free (suffix); - return grub_errno; + VasEBoot_file_close (file); + VasEBoot_free (suffix); + return VasEBoot_errno; } if (!buf) @@ -95,56 +95,56 @@ legacy_file (const char *filename) char *newsuffix; char *ptr; - for (ptr = buf; *ptr && grub_isspace (*ptr); ptr++); + for (ptr = buf; *ptr && VasEBoot_isspace (*ptr); ptr++); oldname = entryname; - parsed = grub_legacy_parse (ptr, &entryname, &newsuffix); - grub_free (buf); + parsed = VasEBoot_legacy_parse (ptr, &entryname, &newsuffix); + VasEBoot_free (buf); buf = NULL; if (newsuffix) { char *t; t = suffix; - suffix = grub_realloc (suffix, grub_strlen (suffix) - + grub_strlen (newsuffix) + 1); + suffix = VasEBoot_realloc (suffix, VasEBoot_strlen (suffix) + + VasEBoot_strlen (newsuffix) + 1); if (!suffix) { - grub_free (t); - grub_free (entrysrc); - grub_free (parsed); - grub_free (newsuffix); - grub_free (suffix); - return grub_errno; + VasEBoot_free (t); + VasEBoot_free (entrysrc); + VasEBoot_free (parsed); + VasEBoot_free (newsuffix); + VasEBoot_free (suffix); + return VasEBoot_errno; } - grub_memcpy (suffix + grub_strlen (suffix), newsuffix, - grub_strlen (newsuffix) + 1); - grub_free (newsuffix); + VasEBoot_memcpy (suffix + VasEBoot_strlen (suffix), newsuffix, + VasEBoot_strlen (newsuffix) + 1); + VasEBoot_free (newsuffix); newsuffix = NULL; } if (oldname != entryname && oldname) { - const char **args = grub_malloc (sizeof (args[0])); + const char **args = VasEBoot_malloc (sizeof (args[0])); if (!args) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } args[0] = oldname; - grub_normal_add_menu_entry (1, args, NULL, NULL, "legacy", + VasEBoot_normal_add_menu_entry (1, args, NULL, NULL, "legacy", NULL, NULL, entrysrc, 0); - grub_free (args); + VasEBoot_free (args); entrysrc[0] = 0; - grub_free (oldname); + VasEBoot_free (oldname); } } if (parsed && !entryname) { - grub_normal_parse_line (parsed, legacy_file_getline, NULL); - grub_print_error (); - grub_free (parsed); + VasEBoot_normal_parse_line (parsed, legacy_file_getline, NULL); + VasEBoot_print_error (); + VasEBoot_free (parsed); parsed = NULL; } else if (parsed) @@ -156,83 +156,83 @@ legacy_file (const char *filename) char *t; t = entrysrc; - entrysrc = grub_realloc (entrysrc, grub_strlen (entrysrc) - + grub_strlen (parsed) + 1); + entrysrc = VasEBoot_realloc (entrysrc, VasEBoot_strlen (entrysrc) + + VasEBoot_strlen (parsed) + 1); if (!entrysrc) { - grub_free (t); - grub_free (parsed); - grub_free (suffix); - return grub_errno; + VasEBoot_free (t); + VasEBoot_free (parsed); + VasEBoot_free (suffix); + return VasEBoot_errno; } - grub_memcpy (entrysrc + grub_strlen (entrysrc), parsed, - grub_strlen (parsed) + 1); - grub_free (parsed); + VasEBoot_memcpy (entrysrc + VasEBoot_strlen (entrysrc), parsed, + VasEBoot_strlen (parsed) + 1); + VasEBoot_free (parsed); parsed = NULL; } } } - grub_file_close (file); + VasEBoot_file_close (file); if (entryname) { - const char **args = grub_malloc (sizeof (args[0])); + const char **args = VasEBoot_malloc (sizeof (args[0])); if (!args) { - grub_file_close (file); - grub_free (suffix); - grub_free (entrysrc); - return grub_errno; + VasEBoot_file_close (file); + VasEBoot_free (suffix); + VasEBoot_free (entrysrc); + return VasEBoot_errno; } args[0] = entryname; - grub_normal_add_menu_entry (1, args, NULL, NULL, NULL, + VasEBoot_normal_add_menu_entry (1, args, NULL, NULL, NULL, NULL, NULL, entrysrc, 0); - grub_free (args); + VasEBoot_free (args); } - grub_normal_parse_line (suffix, legacy_file_getline, NULL); - grub_print_error (); - grub_free (suffix); - grub_free (entrysrc); + VasEBoot_normal_parse_line (suffix, legacy_file_getline, NULL); + VasEBoot_print_error (); + VasEBoot_free (suffix); + VasEBoot_free (entrysrc); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_legacy_source (struct grub_command *cmd, +static VasEBoot_err_t +VasEBoot_cmd_legacy_source (struct VasEBoot_command *cmd, int argc, char **args) { int new_env, extractor; - grub_err_t ret; + VasEBoot_err_t ret; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); extractor = (cmd->name[0] == 'e'); new_env = (cmd->name[extractor ? (sizeof ("extract_legacy_entries_") - 1) : (sizeof ("legacy_") - 1)] == 'c'); if (new_env) - grub_cls (); + VasEBoot_cls (); if (new_env && !extractor) - grub_env_context_open (); + VasEBoot_env_context_open (); if (extractor) - grub_env_extractor_open (!new_env); + VasEBoot_env_extractor_open (!new_env); ret = legacy_file (args[0]); if (new_env) { - grub_menu_t menu; - menu = grub_env_get_menu (); + VasEBoot_menu_t menu; + menu = VasEBoot_env_get_menu (); if (menu && menu->size) - grub_show_menu (menu, 1, 0); + VasEBoot_show_menu (menu, 1, 0); if (!extractor) - grub_env_context_close (); + VasEBoot_env_context_close (); } if (extractor) - grub_env_extractor_close (!new_env); + VasEBoot_env_extractor_close (!new_env); return ret; } @@ -242,23 +242,23 @@ static enum GUESS_IT, LINUX, MULTIBOOT, KFREEBSD, KNETBSD, KOPENBSD } kernel_type; -static grub_err_t -grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_legacy_kernel (struct VasEBoot_command *mycmd __attribute__ ((unused)), int argc, char **args) { int i; #ifdef TODO int no_mem_option = 0; #endif - struct grub_command *cmd; + struct VasEBoot_command *cmd; char **cutargs; int cutargc; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; for (i = 0; i < 2; i++) { /* FIXME: really support this. */ - if (argc >= 1 && grub_strcmp (args[0], "--no-mem-option") == 0) + if (argc >= 1 && VasEBoot_strcmp (args[0], "--no-mem-option") == 0) { #ifdef TODO no_mem_option = 1; @@ -269,8 +269,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), } /* linux16 handles both zImages and bzImages. */ - if (argc >= 1 && (grub_strcmp (args[0], "--type=linux") == 0 - || grub_strcmp (args[0], "--type=biglinux") == 0)) + if (argc >= 1 && (VasEBoot_strcmp (args[0], "--type=linux") == 0 + || VasEBoot_strcmp (args[0], "--type=biglinux") == 0)) { kernel_type = LINUX; argc--; @@ -278,7 +278,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), continue; } - if (argc >= 1 && grub_strcmp (args[0], "--type=multiboot") == 0) + if (argc >= 1 && VasEBoot_strcmp (args[0], "--type=multiboot") == 0) { kernel_type = MULTIBOOT; argc--; @@ -286,7 +286,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), continue; } - if (argc >= 1 && grub_strcmp (args[0], "--type=freebsd") == 0) + if (argc >= 1 && VasEBoot_strcmp (args[0], "--type=freebsd") == 0) { kernel_type = KFREEBSD; argc--; @@ -294,7 +294,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), continue; } - if (argc >= 1 && grub_strcmp (args[0], "--type=openbsd") == 0) + if (argc >= 1 && VasEBoot_strcmp (args[0], "--type=openbsd") == 0) { kernel_type = KOPENBSD; argc--; @@ -302,7 +302,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), continue; } - if (argc >= 1 && grub_strcmp (args[0], "--type=netbsd") == 0) + if (argc >= 1 && VasEBoot_strcmp (args[0], "--type=netbsd") == 0) { kernel_type = KNETBSD; argc--; @@ -312,13 +312,13 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), } if (argc < 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - cutargs = grub_malloc (sizeof (cutargs[0]) * (argc - 1)); + cutargs = VasEBoot_malloc (sizeof (cutargs[0]) * (argc - 1)); if (!cutargs) - return grub_errno; + return VasEBoot_errno; cutargc = argc - 1; - grub_memcpy (cutargs + 1, args + 2, sizeof (cutargs[0]) * (argc - 2)); + VasEBoot_memcpy (cutargs + 1, args + 2, sizeof (cutargs[0]) * (argc - 2)); cutargs[0] = args[0]; do @@ -326,10 +326,10 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), /* First try Linux. */ if (kernel_type == GUESS_IT || kernel_type == LINUX) { -#ifdef GRUB_MACHINE_PCBIOS - cmd = grub_command_find ("linux16"); +#ifdef VasEBoot_MACHINE_PCBIOS + cmd = VasEBoot_command_find ("linux16"); #else - cmd = grub_command_find ("linux"); + cmd = VasEBoot_command_find ("linux"); #endif if (cmd) { @@ -339,13 +339,13 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), goto out; } } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } /* Then multiboot. */ if (kernel_type == GUESS_IT || kernel_type == MULTIBOOT) { - cmd = grub_command_find ("multiboot"); + cmd = VasEBoot_command_find ("multiboot"); if (cmd) { if (!(cmd->func) (cmd, argc, args)) @@ -354,7 +354,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), goto out; } } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } { @@ -362,55 +362,55 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), int bsd_slice = -1; int bsd_part = -1; { - grub_device_t dev; + VasEBoot_device_t dev; const char *hdbiasstr; int hdbias = 0; - hdbiasstr = grub_env_get ("legacy_hdbias"); + hdbiasstr = VasEBoot_env_get ("legacy_hdbias"); if (hdbiasstr) { - hdbias = grub_strtoul (hdbiasstr, 0, 0); - grub_errno = GRUB_ERR_NONE; + hdbias = VasEBoot_strtoul (hdbiasstr, 0, 0); + VasEBoot_errno = VasEBoot_ERR_NONE; } - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (dev && dev->disk - && dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID + && dev->disk->dev->id == VasEBoot_DISK_DEVICE_BIOSDISK_ID && dev->disk->id >= 0x80 && dev->disk->id <= 0x90) { - struct grub_partition *part = dev->disk->partition; + struct VasEBoot_partition *part = dev->disk->partition; bsd_device = dev->disk->id - 0x80 - hdbias; - if (part && (grub_strcmp (part->partmap->name, "netbsd") == 0 - || grub_strcmp (part->partmap->name, "openbsd") == 0 - || grub_strcmp (part->partmap->name, "bsd") == 0)) + if (part && (VasEBoot_strcmp (part->partmap->name, "netbsd") == 0 + || VasEBoot_strcmp (part->partmap->name, "openbsd") == 0 + || VasEBoot_strcmp (part->partmap->name, "bsd") == 0)) { bsd_part = part->number; part = part->parent; } - if (part && grub_strcmp (part->partmap->name, "msdos") == 0) + if (part && VasEBoot_strcmp (part->partmap->name, "msdos") == 0) bsd_slice = part->number; } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); } - /* k*BSD didn't really work well with grub-legacy. */ + /* k*BSD didn't really work well with VasEBoot-legacy. */ if (kernel_type == GUESS_IT || kernel_type == KFREEBSD) { char buf[sizeof("adXXXXXXXXXXXXsXXXXXXXXXXXXYYY")]; if (bsd_device != -1) { if (bsd_slice != -1 && bsd_part != -1) - grub_snprintf(buf, sizeof(buf), "ad%ds%d%c", bsd_device, + VasEBoot_snprintf(buf, sizeof(buf), "ad%ds%d%c", bsd_device, bsd_slice, 'a' + bsd_part); else if (bsd_slice != -1) - grub_snprintf(buf, sizeof(buf), "ad%ds%d", bsd_device, + VasEBoot_snprintf(buf, sizeof(buf), "ad%ds%d", bsd_device, bsd_slice); else - grub_snprintf(buf, sizeof(buf), "ad%d", bsd_device); - grub_env_set ("kFreeBSD.vfs.root.mountfrom", buf); + VasEBoot_snprintf(buf, sizeof(buf), "ad%d", bsd_device); + VasEBoot_env_set ("kFreeBSD.vfs.root.mountfrom", buf); } else - grub_env_unset ("kFreeBSD.vfs.root.mountfrom"); - cmd = grub_command_find ("kfreebsd"); + VasEBoot_env_unset ("kFreeBSD.vfs.root.mountfrom"); + cmd = VasEBoot_command_find ("kfreebsd"); if (cmd) { if (!(cmd->func) (cmd, cutargc, cutargs)) @@ -419,7 +419,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), goto out; } } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } { char **bsdargs; @@ -436,22 +436,22 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), { char rbuf[3] = "-r"; bsdargc = cutargc + 2; - bsdargs = grub_malloc (sizeof (bsdargs[0]) * bsdargc); + bsdargs = VasEBoot_malloc (sizeof (bsdargs[0]) * bsdargc); if (!bsdargs) { - err = grub_errno; + err = VasEBoot_errno; goto out; } - grub_memcpy (bsdargs, args, argc * sizeof (bsdargs[0])); + VasEBoot_memcpy (bsdargs, args, argc * sizeof (bsdargs[0])); bsdargs[argc] = rbuf; bsdargs[argc + 1] = bsddevname; - grub_snprintf (bsddevname, sizeof (bsddevname), + VasEBoot_snprintf (bsddevname, sizeof (bsddevname), "wd%d%c", bsd_device, bsd_part != -1 ? bsd_part + 'a' : 'c'); } if (kernel_type == GUESS_IT || kernel_type == KNETBSD) { - cmd = grub_command_find ("knetbsd"); + cmd = VasEBoot_command_find ("knetbsd"); if (cmd) { if (!(cmd->func) (cmd, bsdargc, bsdargs)) @@ -461,11 +461,11 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), goto free_bsdargs; } } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (kernel_type == GUESS_IT || kernel_type == KOPENBSD) { - cmd = grub_command_find ("kopenbsd"); + cmd = VasEBoot_command_find ("kopenbsd"); if (cmd) { if (!(cmd->func) (cmd, bsdargc, bsdargs)) @@ -475,12 +475,12 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), goto free_bsdargs; } } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } free_bsdargs: if (bsdargs != cutargs) - grub_free (bsdargs); + VasEBoot_free (bsdargs); if (found) goto out; } @@ -488,29 +488,29 @@ free_bsdargs: } while (0); - err = grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s", + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, "couldn't load file %s", args[0]); out: - grub_free (cutargs); + VasEBoot_free (cutargs); return err; } -static grub_err_t -grub_cmd_legacy_initrd (struct grub_command *mycmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_legacy_initrd (struct VasEBoot_command *mycmd __attribute__ ((unused)), int argc, char **args) { - struct grub_command *cmd; + struct VasEBoot_command *cmd; if (kernel_type == LINUX) { -#ifdef GRUB_MACHINE_PCBIOS - cmd = grub_command_find ("initrd16"); +#ifdef VasEBoot_MACHINE_PCBIOS + cmd = VasEBoot_command_find ("initrd16"); #else - cmd = grub_command_find ("initrd"); + cmd = VasEBoot_command_find ("initrd"); #endif if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), -#ifdef GRUB_MACHINE_PCBIOS + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), +#ifdef VasEBoot_MACHINE_PCBIOS "initrd16" #else "initrd" @@ -521,29 +521,29 @@ grub_cmd_legacy_initrd (struct grub_command *mycmd __attribute__ ((unused)), } if (kernel_type == MULTIBOOT) { - cmd = grub_command_find ("module"); + cmd = VasEBoot_command_find ("module"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), "module"); return cmd->func (cmd, argc, args); } - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); } -static grub_err_t -grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_legacy_initrdnounzip (struct VasEBoot_command *mycmd __attribute__ ((unused)), int argc, char **args) { - struct grub_command *cmd; + struct VasEBoot_command *cmd; if (kernel_type == LINUX) { - cmd = grub_command_find ("initrd16"); + cmd = VasEBoot_command_find ("initrd16"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), "initrd16"); return cmd->func (cmd, argc, args); @@ -551,121 +551,121 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused if (kernel_type == MULTIBOOT) { char **newargs; - grub_err_t err; + VasEBoot_err_t err; char nounzipbuf[10] = "--nounzip"; - cmd = grub_command_find ("module"); + cmd = VasEBoot_command_find ("module"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), "module"); - newargs = grub_malloc ((argc + 1) * sizeof (newargs[0])); + newargs = VasEBoot_malloc ((argc + 1) * sizeof (newargs[0])); if (!newargs) - return grub_errno; - grub_memcpy (newargs + 1, args, argc * sizeof (newargs[0])); + return VasEBoot_errno; + VasEBoot_memcpy (newargs + 1, args, argc * sizeof (newargs[0])); newargs[0] = nounzipbuf; err = cmd->func (cmd, argc + 1, newargs); - grub_free (newargs); + VasEBoot_free (newargs); return err; } - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); } -static grub_err_t +static VasEBoot_err_t check_password_deny (const char *user __attribute__ ((unused)), const char *entered __attribute__ ((unused)), void *password __attribute__ ((unused))) { - return GRUB_ACCESS_DENIED; + return VasEBoot_ACCESS_DENIED; } #define MD5_HASHLEN 16 struct legacy_md5_password { - grub_uint8_t *salt; + VasEBoot_uint8_t *salt; int saltlen; - grub_uint8_t hash[MD5_HASHLEN]; + VasEBoot_uint8_t hash[MD5_HASHLEN]; }; static int check_password_md5_real (const char *entered, struct legacy_md5_password *pw) { - grub_size_t enteredlen = grub_strlen (entered); + VasEBoot_size_t enteredlen = VasEBoot_strlen (entered); unsigned char alt_result[MD5_HASHLEN]; unsigned char *digest; - grub_uint8_t *ctx; - grub_size_t i; + VasEBoot_uint8_t *ctx; + VasEBoot_size_t i; int ret; - ctx = grub_zalloc (GRUB_MD_MD5->contextsize); + ctx = VasEBoot_zalloc (VasEBoot_MD_MD5->contextsize); if (!ctx) return 0; - GRUB_MD_MD5->init (ctx); - GRUB_MD_MD5->write (ctx, entered, enteredlen); - GRUB_MD_MD5->write (ctx, pw->salt + 3, pw->saltlen - 3); - GRUB_MD_MD5->write (ctx, entered, enteredlen); - digest = GRUB_MD_MD5->read (ctx); - GRUB_MD_MD5->final (ctx); - grub_memcpy (alt_result, digest, MD5_HASHLEN); + VasEBoot_MD_MD5->init (ctx); + VasEBoot_MD_MD5->write (ctx, entered, enteredlen); + VasEBoot_MD_MD5->write (ctx, pw->salt + 3, pw->saltlen - 3); + VasEBoot_MD_MD5->write (ctx, entered, enteredlen); + digest = VasEBoot_MD_MD5->read (ctx); + VasEBoot_MD_MD5->final (ctx); + VasEBoot_memcpy (alt_result, digest, MD5_HASHLEN); - GRUB_MD_MD5->init (ctx); - GRUB_MD_MD5->write (ctx, entered, enteredlen); - GRUB_MD_MD5->write (ctx, pw->salt, pw->saltlen); /* include the $1$ header */ + VasEBoot_MD_MD5->init (ctx); + VasEBoot_MD_MD5->write (ctx, entered, enteredlen); + VasEBoot_MD_MD5->write (ctx, pw->salt, pw->saltlen); /* include the $1$ header */ for (i = enteredlen; i > 16; i -= 16) - GRUB_MD_MD5->write (ctx, alt_result, 16); - GRUB_MD_MD5->write (ctx, alt_result, i); + VasEBoot_MD_MD5->write (ctx, alt_result, 16); + VasEBoot_MD_MD5->write (ctx, alt_result, i); for (i = enteredlen; i > 0; i >>= 1) - GRUB_MD_MD5->write (ctx, entered + ((i & 1) ? enteredlen : 0), 1); - digest = GRUB_MD_MD5->read (ctx); - GRUB_MD_MD5->final (ctx); + VasEBoot_MD_MD5->write (ctx, entered + ((i & 1) ? enteredlen : 0), 1); + digest = VasEBoot_MD_MD5->read (ctx); + VasEBoot_MD_MD5->final (ctx); for (i = 0; i < 1000; i++) { - grub_memcpy (alt_result, digest, 16); + VasEBoot_memcpy (alt_result, digest, 16); - GRUB_MD_MD5->init (ctx); + VasEBoot_MD_MD5->init (ctx); if ((i & 1) != 0) - GRUB_MD_MD5->write (ctx, entered, enteredlen); + VasEBoot_MD_MD5->write (ctx, entered, enteredlen); else - GRUB_MD_MD5->write (ctx, alt_result, 16); + VasEBoot_MD_MD5->write (ctx, alt_result, 16); if (i % 3 != 0) - GRUB_MD_MD5->write (ctx, pw->salt + 3, pw->saltlen - 3); + VasEBoot_MD_MD5->write (ctx, pw->salt + 3, pw->saltlen - 3); if (i % 7 != 0) - GRUB_MD_MD5->write (ctx, entered, enteredlen); + VasEBoot_MD_MD5->write (ctx, entered, enteredlen); if ((i & 1) != 0) - GRUB_MD_MD5->write (ctx, alt_result, 16); + VasEBoot_MD_MD5->write (ctx, alt_result, 16); else - GRUB_MD_MD5->write (ctx, entered, enteredlen); - digest = GRUB_MD_MD5->read (ctx); - GRUB_MD_MD5->final (ctx); + VasEBoot_MD_MD5->write (ctx, entered, enteredlen); + digest = VasEBoot_MD_MD5->read (ctx); + VasEBoot_MD_MD5->final (ctx); } - ret = (grub_crypto_memcmp (digest, pw->hash, MD5_HASHLEN) == 0); - grub_free (ctx); + ret = (VasEBoot_crypto_memcmp (digest, pw->hash, MD5_HASHLEN) == 0); + VasEBoot_free (ctx); return ret; } -static grub_err_t +static VasEBoot_err_t check_password_md5 (const char *user, const char *entered, void *password) { if (!check_password_md5_real (entered, password)) - return GRUB_ACCESS_DENIED; + return VasEBoot_ACCESS_DENIED; - grub_auth_authenticate (user); + VasEBoot_auth_authenticate (user); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static inline int @@ -692,17 +692,17 @@ parse_legacy_md5 (int argc, char **args) int i; const char *p; - if (grub_memcmp (args[0], "--md5", sizeof ("--md5")) != 0) + if (VasEBoot_memcmp (args[0], "--md5", sizeof ("--md5")) != 0) goto fail; if (argc == 1) goto fail; - if (grub_strlen(args[1]) <= 3) + if (VasEBoot_strlen(args[1]) <= 3) goto fail; salt = args[1]; - saltend = grub_strchr (salt + 3, '$'); + saltend = VasEBoot_strchr (salt + 3, '$'); if (!saltend) goto fail; - pw = grub_malloc (sizeof (*pw)); + pw = VasEBoot_malloc (sizeof (*pw)); if (!pw) goto fail; @@ -710,7 +710,7 @@ parse_legacy_md5 (int argc, char **args) for (i = 0; i < 5; i++) { int n; - grub_uint32_t w = 0; + VasEBoot_uint32_t w = 0; for (n = 0; n < 4; n++) { @@ -725,7 +725,7 @@ parse_legacy_md5 (int argc, char **args) } { int n; - grub_uint32_t w = 0; + VasEBoot_uint32_t w = 0; for (n = 0; n < 2; n++) { int ww = ib64t(*p++); @@ -739,44 +739,44 @@ parse_legacy_md5 (int argc, char **args) } pw->saltlen = saltend - salt; - pw->salt = (grub_uint8_t *) grub_strndup (salt, pw->saltlen); + pw->salt = (VasEBoot_uint8_t *) VasEBoot_strndup (salt, pw->saltlen); if (!pw->salt) goto fail; return pw; fail: - grub_free (pw); + VasEBoot_free (pw); return NULL; } -static grub_err_t -grub_cmd_legacy_password (struct grub_command *mycmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_legacy_password (struct VasEBoot_command *mycmd __attribute__ ((unused)), int argc, char **args) { struct legacy_md5_password *pw = NULL; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); if (args[0][0] != '-' || args[0][1] != '-') - return grub_normal_set_password ("legacy", args[0]); + return VasEBoot_normal_set_password ("legacy", args[0]); pw = parse_legacy_md5 (argc, args); if (pw) - return grub_auth_register_authentication ("legacy", check_password_md5, pw); + return VasEBoot_auth_register_authentication ("legacy", check_password_md5, pw); else - /* This is to imitate minor difference between grub-legacy in GRUB2. + /* This is to imitate minor difference between VasEBoot-legacy in VasEBoot2. If 2 password commands are executed in a row and second one fails - on GRUB2 the password of first one is used, whereas in grub-legacy + on VasEBoot2 the password of first one is used, whereas in VasEBoot-legacy authenthication is denied. In case of no password command was executed early both versions deny any access. */ - return grub_auth_register_authentication ("legacy", check_password_deny, + return VasEBoot_auth_register_authentication ("legacy", check_password_deny, NULL); } int -grub_legacy_check_md5_password (int argc, char **args, +VasEBoot_legacy_check_md5_password (int argc, char **args, char *entered) { struct legacy_md5_password *pw = NULL; @@ -784,12 +784,12 @@ grub_legacy_check_md5_password (int argc, char **args, if (args[0][0] != '-' || args[0][1] != '-') { - char correct[GRUB_AUTH_MAX_PASSLEN]; + char correct[VasEBoot_AUTH_MAX_PASSLEN]; - grub_memset (correct, 0, sizeof (correct)); - grub_strncpy (correct, args[0], sizeof (correct)); + VasEBoot_memset (correct, 0, sizeof (correct)); + VasEBoot_strncpy (correct, args[0], sizeof (correct)); - return grub_crypto_memcmp (entered, correct, GRUB_AUTH_MAX_PASSLEN) == 0; + return VasEBoot_crypto_memcmp (entered, correct, VasEBoot_AUTH_MAX_PASSLEN) == 0; } pw = parse_legacy_md5 (argc, args); @@ -798,96 +798,96 @@ grub_legacy_check_md5_password (int argc, char **args, return 0; ret = check_password_md5_real (entered, pw); - grub_free (pw); + VasEBoot_free (pw); return ret; } -static grub_err_t -grub_cmd_legacy_check_password (struct grub_command *mycmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_legacy_check_password (struct VasEBoot_command *mycmd __attribute__ ((unused)), int argc, char **args) { - char entered[GRUB_AUTH_MAX_PASSLEN]; + char entered[VasEBoot_AUTH_MAX_PASSLEN]; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); - grub_puts_ (N_("Enter password: ")); - if (!grub_password_get (entered, GRUB_AUTH_MAX_PASSLEN)) - return GRUB_ACCESS_DENIED; + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); + VasEBoot_puts_ (N_("Enter password: ")); + if (!VasEBoot_password_get (entered, VasEBoot_AUTH_MAX_PASSLEN)) + return VasEBoot_ACCESS_DENIED; - if (!grub_legacy_check_md5_password (argc, args, + if (!VasEBoot_legacy_check_md5_password (argc, args, entered)) - return GRUB_ACCESS_DENIED; + return VasEBoot_ACCESS_DENIED; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_source, cmd_configfile; -static grub_command_t cmd_source_extract, cmd_configfile_extract; -static grub_command_t cmd_kernel, cmd_initrd, cmd_initrdnounzip; -static grub_command_t cmd_password, cmd_check_password; +static VasEBoot_command_t cmd_source, cmd_configfile; +static VasEBoot_command_t cmd_source_extract, cmd_configfile_extract; +static VasEBoot_command_t cmd_kernel, cmd_initrd, cmd_initrdnounzip; +static VasEBoot_command_t cmd_password, cmd_check_password; -GRUB_MOD_INIT(legacycfg) +VasEBoot_MOD_INIT(legacycfg) { cmd_source - = grub_register_command ("legacy_source", - grub_cmd_legacy_source, + = VasEBoot_register_command ("legacy_source", + VasEBoot_cmd_legacy_source, N_("FILE"), /* TRANSLATORS: "legacy config" means - "config as used by grub-legacy". */ + "config as used by VasEBoot-legacy". */ N_("Parse legacy config in same context")); cmd_configfile - = grub_register_command ("legacy_configfile", - grub_cmd_legacy_source, + = VasEBoot_register_command ("legacy_configfile", + VasEBoot_cmd_legacy_source, N_("FILE"), N_("Parse legacy config in new context")); cmd_source_extract - = grub_register_command ("extract_legacy_entries_source", - grub_cmd_legacy_source, + = VasEBoot_register_command ("extract_legacy_entries_source", + VasEBoot_cmd_legacy_source, N_("FILE"), N_("Parse legacy config in same context taking only menu entries")); cmd_configfile_extract - = grub_register_command ("extract_legacy_entries_configfile", - grub_cmd_legacy_source, + = VasEBoot_register_command ("extract_legacy_entries_configfile", + VasEBoot_cmd_legacy_source, N_("FILE"), N_("Parse legacy config in new context taking only menu entries")); - cmd_kernel = grub_register_command ("legacy_kernel", - grub_cmd_legacy_kernel, + cmd_kernel = VasEBoot_register_command ("legacy_kernel", + VasEBoot_cmd_legacy_kernel, N_("[--no-mem-option] [--type=TYPE] FILE [ARG ...]"), - N_("Simulate grub-legacy `kernel' command")); + N_("Simulate VasEBoot-legacy `kernel' command")); - cmd_initrd = grub_register_command ("legacy_initrd", - grub_cmd_legacy_initrd, + cmd_initrd = VasEBoot_register_command ("legacy_initrd", + VasEBoot_cmd_legacy_initrd, N_("FILE [ARG ...]"), - N_("Simulate grub-legacy `initrd' command")); - cmd_initrdnounzip = grub_register_command ("legacy_initrd_nounzip", - grub_cmd_legacy_initrdnounzip, + N_("Simulate VasEBoot-legacy `initrd' command")); + cmd_initrdnounzip = VasEBoot_register_command ("legacy_initrd_nounzip", + VasEBoot_cmd_legacy_initrdnounzip, N_("FILE [ARG ...]"), - N_("Simulate grub-legacy `modulenounzip' command")); + N_("Simulate VasEBoot-legacy `modulenounzip' command")); - cmd_password = grub_register_command ("legacy_password", - grub_cmd_legacy_password, + cmd_password = VasEBoot_register_command ("legacy_password", + VasEBoot_cmd_legacy_password, N_("[--md5] PASSWD [FILE]"), - N_("Simulate grub-legacy `password' command")); + N_("Simulate VasEBoot-legacy `password' command")); - cmd_check_password = grub_register_command ("legacy_check_password", - grub_cmd_legacy_check_password, + cmd_check_password = VasEBoot_register_command ("legacy_check_password", + VasEBoot_cmd_legacy_check_password, N_("[--md5] PASSWD [FILE]"), - N_("Simulate grub-legacy `password' command in menu entry mode")); + N_("Simulate VasEBoot-legacy `password' command in menu entry mode")); } -GRUB_MOD_FINI(legacycfg) +VasEBoot_MOD_FINI(legacycfg) { - grub_unregister_command (cmd_source); - grub_unregister_command (cmd_configfile); - grub_unregister_command (cmd_source_extract); - grub_unregister_command (cmd_configfile_extract); + VasEBoot_unregister_command (cmd_source); + VasEBoot_unregister_command (cmd_configfile); + VasEBoot_unregister_command (cmd_source_extract); + VasEBoot_unregister_command (cmd_configfile_extract); - grub_unregister_command (cmd_kernel); - grub_unregister_command (cmd_initrd); - grub_unregister_command (cmd_initrdnounzip); + VasEBoot_unregister_command (cmd_kernel); + VasEBoot_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_initrdnounzip); - grub_unregister_command (cmd_password); - grub_unregister_command (cmd_check_password); + VasEBoot_unregister_command (cmd_password); + VasEBoot_unregister_command (cmd_check_password); } diff --git a/VasEBoot-core/commands/loadenv.c b/VasEBoot-core/commands/loadenv.c index acd93d123..f2158e4ed 100644 --- a/VasEBoot-core/commands/loadenv.c +++ b/VasEBoot-core/commands/loadenv.c @@ -1,36 +1,36 @@ /* loadenv.c - command to load/save environment variable. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { /* TRANSLATORS: This option is used to override default filename for loading and storing environment. */ @@ -43,10 +43,10 @@ static const struct grub_arg_option options[] = /* Opens 'filename' with compression filters disabled. Optionally disables the PUBKEY filter (that insists upon properly signed files) as well. PUBKEY filter is restored before the function returns. */ -static grub_file_t +static VasEBoot_file_t open_envblk_file (char *filename, int untrusted) { - grub_file_t file; + VasEBoot_file_t file; char *buf = 0; if (! filename) @@ -54,56 +54,56 @@ open_envblk_file (char *filename, int untrusted) const char *prefix; int len; - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); if (! prefix) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); return 0; } - len = grub_strlen (prefix); - buf = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG)); + len = VasEBoot_strlen (prefix); + buf = VasEBoot_malloc (len + 1 + sizeof (VasEBoot_ENVBLK_DEFCFG)); if (! buf) return 0; filename = buf; - grub_strcpy (filename, prefix); + VasEBoot_strcpy (filename, prefix); filename[len] = '/'; - grub_strcpy (filename + len + 1, GRUB_ENVBLK_DEFCFG); + VasEBoot_strcpy (filename + len + 1, VasEBoot_ENVBLK_DEFCFG); } /* The filters that are disabled will be re-enabled by the call to - grub_file_open() after this particular file is opened. */ - grub_file_filter_disable_compression (); + VasEBoot_file_open() after this particular file is opened. */ + VasEBoot_file_filter_disable_compression (); if (untrusted) - grub_file_filter_disable_pubkey (); + VasEBoot_file_filter_disable_pubkey (); - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); - grub_free (buf); + VasEBoot_free (buf); return file; } -static grub_envblk_t -read_envblk_file (grub_file_t file) +static VasEBoot_envblk_t +read_envblk_file (VasEBoot_file_t file) { - grub_off_t offset = 0; + VasEBoot_off_t offset = 0; char *buf; - grub_size_t size = grub_file_size (file); - grub_envblk_t envblk; + VasEBoot_size_t size = VasEBoot_file_size (file); + VasEBoot_envblk_t envblk; - buf = grub_malloc (size); + buf = VasEBoot_malloc (size); if (! buf) return 0; while (size > 0) { - grub_ssize_t ret; + VasEBoot_ssize_t ret; - ret = grub_file_read (file, buf + offset, size); + ret = VasEBoot_file_read (file, buf + offset, size); if (ret <= 0) { - grub_free (buf); + VasEBoot_free (buf); return 0; } @@ -111,61 +111,61 @@ read_envblk_file (grub_file_t file) offset += ret; } - envblk = grub_envblk_open (buf, offset); + envblk = VasEBoot_envblk_open (buf, offset); if (! envblk) { - grub_free (buf); - grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); + VasEBoot_free (buf); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "invalid environment block"); return 0; } return envblk; } -struct grub_env_whitelist +struct VasEBoot_env_whitelist { - grub_size_t len; + VasEBoot_size_t len; char **list; }; -typedef struct grub_env_whitelist grub_env_whitelist_t; +typedef struct VasEBoot_env_whitelist VasEBoot_env_whitelist_t; static int test_whitelist_membership (const char* name, - const grub_env_whitelist_t* whitelist) + const VasEBoot_env_whitelist_t* whitelist) { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < whitelist->len; i++) - if (grub_strcmp (name, whitelist->list[i]) == 0) + if (VasEBoot_strcmp (name, whitelist->list[i]) == 0) return 1; /* found it */ return 0; /* not found */ } -/* Helper for grub_cmd_load_env. */ +/* Helper for VasEBoot_cmd_load_env. */ static int set_var (const char *name, const char *value, void *whitelist) { if (! whitelist) { - grub_env_set (name, value); + VasEBoot_env_set (name, value); return 0; } if (test_whitelist_membership (name, - (const grub_env_whitelist_t *) whitelist)) - grub_env_set (name, value); + (const VasEBoot_env_whitelist_t *) whitelist)) + VasEBoot_env_set (name, value); return 0; } -static grub_err_t -grub_cmd_load_env (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_load_env (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - grub_file_t file; - grub_envblk_t envblk; - grub_env_whitelist_t whitelist; + struct VasEBoot_arg_list *state = ctxt->state; + VasEBoot_file_t file; + VasEBoot_envblk_t envblk; + VasEBoot_env_whitelist_t whitelist; whitelist.len = argc; whitelist.list = args; @@ -173,19 +173,19 @@ grub_cmd_load_env (grub_extcmd_context_t ctxt, int argc, char **args) /* state[0] is the -f flag; state[1] is the --skip-sig flag */ file = open_envblk_file ((state[0].set) ? state[0].arg : 0, state[1].set); if (! file) - return grub_errno; + return VasEBoot_errno; envblk = read_envblk_file (file); if (! envblk) goto fail; /* argc > 0 indicates caller provided a whitelist of variables to read. */ - grub_envblk_iterate (envblk, argc > 0 ? &whitelist : 0, set_var); - grub_envblk_close (envblk); + VasEBoot_envblk_iterate (envblk, argc > 0 ? &whitelist : 0, set_var); + VasEBoot_envblk_close (envblk); fail: - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } /* Print all variables in current context. */ @@ -193,39 +193,39 @@ static int print_var (const char *name, const char *value, void *hook_data __attribute__ ((unused))) { - grub_printf ("%s=%s\n", name, value); + VasEBoot_printf ("%s=%s\n", name, value); return 0; } -static grub_err_t -grub_cmd_list_env (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_list_env (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_arg_list *state = ctxt->state; - grub_file_t file; - grub_envblk_t envblk; + struct VasEBoot_arg_list *state = ctxt->state; + VasEBoot_file_t file; + VasEBoot_envblk_t envblk; file = open_envblk_file ((state[0].set) ? state[0].arg : 0, 0); if (! file) - return grub_errno; + return VasEBoot_errno; envblk = read_envblk_file (file); if (! envblk) goto fail; - grub_envblk_iterate (envblk, NULL, print_var); - grub_envblk_close (envblk); + VasEBoot_envblk_iterate (envblk, NULL, print_var); + VasEBoot_envblk_close (envblk); fail: - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } /* Used to maintain a variable length of blocklists internally. */ struct blocklist { - grub_disk_addr_t sector; + VasEBoot_disk_addr_t sector; unsigned offset; unsigned length; struct blocklist *next; @@ -239,18 +239,18 @@ free_blocklists (struct blocklist *p) for (; p; p = q) { q = p->next; - grub_free (p); + VasEBoot_free (p); } } -static grub_err_t -check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, - grub_file_t file) +static VasEBoot_err_t +check_blocklists (VasEBoot_envblk_t envblk, struct blocklist *blocklists, + VasEBoot_file_t file) { - grub_size_t total_length; - grub_size_t index; - grub_disk_t disk; - grub_disk_addr_t part_start; + VasEBoot_size_t total_length; + VasEBoot_size_t index; + VasEBoot_disk_t disk; + VasEBoot_disk_addr_t part_start; struct blocklist *p; char *buf; @@ -262,81 +262,81 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, /* Check if any pair of blocks overlap. */ for (q = p->next; q; q = q->next) { - grub_disk_addr_t s1, s2; - grub_disk_addr_t e1, e2; + VasEBoot_disk_addr_t s1, s2; + VasEBoot_disk_addr_t e1, e2; s1 = p->sector; - e1 = s1 + ((p->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); + e1 = s1 + ((p->length + VasEBoot_DISK_SECTOR_SIZE - 1) >> VasEBoot_DISK_SECTOR_BITS); s2 = q->sector; - e2 = s2 + ((q->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); + e2 = s2 + ((q->length + VasEBoot_DISK_SECTOR_SIZE - 1) >> VasEBoot_DISK_SECTOR_BITS); if (s1 < e2 && s2 < e1) { /* This might be actually valid, but it is unbelievable that any filesystem makes such a silly allocation. */ - return grub_error (GRUB_ERR_BAD_FS, "malformed file"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "malformed file"); } } total_length += p->length; } - if (total_length != grub_file_size (file)) + if (total_length != VasEBoot_file_size (file)) { - /* Maybe sparse, unallocated sectors. No way in GRUB. */ - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "sparse file not allowed"); + /* Maybe sparse, unallocated sectors. No way in VasEBoot. */ + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "sparse file not allowed"); } /* One more sanity check. Re-read all sectors by blocklists, and compare those with the data read via a file. */ disk = file->device->disk; - part_start = grub_partition_get_start (disk->partition); + part_start = VasEBoot_partition_get_start (disk->partition); - buf = grub_envblk_buffer (envblk); + buf = VasEBoot_envblk_buffer (envblk); char *blockbuf = NULL; - grub_size_t blockbuf_len = 0; + VasEBoot_size_t blockbuf_len = 0; for (p = blocklists, index = 0; p; index += p->length, p = p->next) { if (p->length > blockbuf_len) { - grub_free (blockbuf); + VasEBoot_free (blockbuf); blockbuf_len = 2 * p->length; - blockbuf = grub_malloc (blockbuf_len); + blockbuf = VasEBoot_malloc (blockbuf_len); if (!blockbuf) - return grub_errno; + return VasEBoot_errno; } - if (grub_disk_read (disk, p->sector - part_start, + if (VasEBoot_disk_read (disk, p->sector - part_start, p->offset, p->length, blockbuf)) - return grub_errno; + return VasEBoot_errno; - if (grub_memcmp (buf + index, blockbuf, p->length) != 0) - return grub_error (GRUB_ERR_FILE_READ_ERROR, "invalid blocklist"); + if (VasEBoot_memcmp (buf + index, blockbuf, p->length) != 0) + return VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, "invalid blocklist"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, - grub_file_t file) +write_blocklists (VasEBoot_envblk_t envblk, struct blocklist *blocklists, + VasEBoot_file_t file) { char *buf; - grub_disk_t disk; - grub_disk_addr_t part_start; + VasEBoot_disk_t disk; + VasEBoot_disk_addr_t part_start; struct blocklist *p; - grub_size_t index; + VasEBoot_size_t index; - buf = grub_envblk_buffer (envblk); + buf = VasEBoot_envblk_buffer (envblk); disk = file->device->disk; - part_start = grub_partition_get_start (disk->partition); + part_start = VasEBoot_partition_get_start (disk->partition); index = 0; for (p = blocklists; p; index += p->length, p = p->next) { - if (grub_disk_write (disk, p->sector - part_start, + if (VasEBoot_disk_write (disk, p->sector - part_start, p->offset, p->length, buf + index)) return 0; } @@ -344,21 +344,21 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, return 1; } -/* Context for grub_cmd_save_env. */ -struct grub_cmd_save_env_ctx +/* Context for VasEBoot_cmd_save_env. */ +struct VasEBoot_cmd_save_env_ctx { struct blocklist *head, *tail; }; /* Store blocklists in a linked list. */ static void -save_env_read_hook (grub_disk_addr_t sector, unsigned offset, unsigned length, +save_env_read_hook (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data) { - struct grub_cmd_save_env_ctx *ctx = data; + struct VasEBoot_cmd_save_env_ctx *ctx = data; struct blocklist *block; - block = grub_malloc (sizeof (*block)); + block = VasEBoot_malloc (sizeof (*block)); if (! block) return; @@ -375,29 +375,29 @@ save_env_read_hook (grub_disk_addr_t sector, unsigned offset, unsigned length, ctx->head = block; } -static grub_err_t -grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_save_env (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - grub_file_t file; - grub_envblk_t envblk; - struct grub_cmd_save_env_ctx ctx = { + struct VasEBoot_arg_list *state = ctxt->state; + VasEBoot_file_t file; + VasEBoot_envblk_t envblk; + struct VasEBoot_cmd_save_env_ctx ctx = { .head = 0, .tail = 0 }; if (! argc) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no variable is specified"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no variable is specified"); file = open_envblk_file ((state[0].set) ? state[0].arg : 0, 1 /* allow untrusted */); if (! file) - return grub_errno; + return VasEBoot_errno; if (! file->device->disk) { - grub_file_close (file); - return grub_error (GRUB_ERR_BAD_DEVICE, "disk device required"); + VasEBoot_file_close (file); + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "disk device required"); } file->read_hook = save_env_read_hook; @@ -414,17 +414,17 @@ grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args) { const char *value; - value = grub_env_get (args[0]); + value = VasEBoot_env_get (args[0]); if (value) { - if (! grub_envblk_set (envblk, args[0], value)) + if (! VasEBoot_envblk_set (envblk, args[0], value)) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "environment block too small"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "environment block too small"); goto fail; } } else - grub_envblk_delete (envblk, args[0]); + VasEBoot_envblk_delete (envblk, args[0]); argc--; args++; @@ -434,35 +434,35 @@ grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args) fail: if (envblk) - grub_envblk_close (envblk); + VasEBoot_envblk_close (envblk); free_blocklists (ctx.head); - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } -static grub_extcmd_t cmd_load, cmd_list, cmd_save; +static VasEBoot_extcmd_t cmd_load, cmd_list, cmd_save; -GRUB_MOD_INIT(loadenv) +VasEBoot_MOD_INIT(loadenv) { cmd_load = - grub_register_extcmd ("load_env", grub_cmd_load_env, 0, + VasEBoot_register_extcmd ("load_env", VasEBoot_cmd_load_env, 0, N_("[-f FILE] [-s|--skip-sig] [variable_name_to_whitelist] [...]"), N_("Load variables from environment block file."), options); cmd_list = - grub_register_extcmd ("list_env", grub_cmd_list_env, 0, N_("[-f FILE]"), + VasEBoot_register_extcmd ("list_env", VasEBoot_cmd_list_env, 0, N_("[-f FILE]"), N_("List variables from environment block file."), options); cmd_save = - grub_register_extcmd ("save_env", grub_cmd_save_env, 0, + VasEBoot_register_extcmd ("save_env", VasEBoot_cmd_save_env, 0, N_("[-f FILE] variable_name [...]"), N_("Save variables to environment block file."), options); } -GRUB_MOD_FINI(loadenv) +VasEBoot_MOD_FINI(loadenv) { - grub_unregister_extcmd (cmd_load); - grub_unregister_extcmd (cmd_list); - grub_unregister_extcmd (cmd_save); + VasEBoot_unregister_extcmd (cmd_load); + VasEBoot_unregister_extcmd (cmd_list); + VasEBoot_unregister_extcmd (cmd_save); } diff --git a/VasEBoot-core/commands/ls.c b/VasEBoot-core/commands/ls.c index 0eaf83652..f7e252350 100644 --- a/VasEBoot-core/commands/ls.c +++ b/VasEBoot-core/commands/ls.c @@ -1,41 +1,41 @@ /* ls.c - command to list files and devices */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"long", 'l', 0, N_("Show a long list with more detailed information."), 0, 0}, {"human-readable", 'h', 0, N_("Print sizes in a human readable format."), 0, 0}, @@ -43,148 +43,148 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; -/* Helper for grub_ls_list_devices. */ +/* Helper for VasEBoot_ls_list_devices. */ static int -grub_ls_print_devices (const char *name, void *data) +VasEBoot_ls_print_devices (const char *name, void *data) { int *longlist = data; if (*longlist) - grub_normal_print_device_info (name); + VasEBoot_normal_print_device_info (name); else - grub_printf ("(%s) ", name); + VasEBoot_printf ("(%s) ", name); return 0; } -static grub_err_t -grub_ls_list_devices (int longlist) +static VasEBoot_err_t +VasEBoot_ls_list_devices (int longlist) { - grub_device_iterate (grub_ls_print_devices, &longlist); - grub_xputs ("\n"); + VasEBoot_device_iterate (VasEBoot_ls_print_devices, &longlist); + VasEBoot_xputs ("\n"); #if 0 { - grub_net_app_level_t proto; + VasEBoot_net_app_level_t proto; int first = 1; FOR_NET_APP_LEVEL (proto) { if (first) - grub_puts_ (N_ ("Network protocols:")); + VasEBoot_puts_ (N_ ("Network protocols:")); first = 0; - grub_printf ("%s ", proto->name); + VasEBoot_printf ("%s ", proto->name); } - grub_xputs ("\n"); + VasEBoot_xputs ("\n"); } #endif - grub_refresh (); + VasEBoot_refresh (); return 0; } -/* Context for grub_ls_list_files. */ -struct grub_ls_list_files_ctx +/* Context for VasEBoot_ls_list_files. */ +struct VasEBoot_ls_list_files_ctx { char *dirname; int all; int human; }; -/* Helper for grub_ls_list_files. */ +/* Helper for VasEBoot_ls_list_files. */ static int -print_files (const char *filename, const struct grub_dirhook_info *info, +print_files (const char *filename, const struct VasEBoot_dirhook_info *info, void *data) { - struct grub_ls_list_files_ctx *ctx = data; + struct VasEBoot_ls_list_files_ctx *ctx = data; if (ctx->all || filename[0] != '.') - grub_printf ("%s%s ", filename, info->dir ? "/" : ""); + VasEBoot_printf ("%s%s ", filename, info->dir ? "/" : ""); return 0; } -/* Helper for grub_ls_list_files. */ +/* Helper for VasEBoot_ls_list_files. */ static int -print_files_long (const char *filename, const struct grub_dirhook_info *info, +print_files_long (const char *filename, const struct VasEBoot_dirhook_info *info, void *data) { - struct grub_ls_list_files_ctx *ctx = data; + struct VasEBoot_ls_list_files_ctx *ctx = data; if ((! ctx->all) && (filename[0] == '.')) return 0; if (! info->dir) { - grub_file_t file; + VasEBoot_file_t file; char *pathname; - if (ctx->dirname[grub_strlen (ctx->dirname) - 1] == '/') - pathname = grub_xasprintf ("%s%s", ctx->dirname, filename); + if (ctx->dirname[VasEBoot_strlen (ctx->dirname) - 1] == '/') + pathname = VasEBoot_xasprintf ("%s%s", ctx->dirname, filename); else - pathname = grub_xasprintf ("%s/%s", ctx->dirname, filename); + pathname = VasEBoot_xasprintf ("%s/%s", ctx->dirname, filename); if (!pathname) return 1; /* XXX: For ext2fs symlinks are detected as files while they should be reported as directories. */ - grub_file_filter_disable_compression (); - file = grub_file_open (pathname); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (pathname); if (! file) { - grub_errno = 0; - grub_free (pathname); + VasEBoot_errno = 0; + VasEBoot_free (pathname); return 0; } if (! ctx->human) - grub_printf ("%-12llu", (unsigned long long) file->size); + VasEBoot_printf ("%-12llu", (unsigned long long) file->size); else - grub_printf ("%-12s", grub_get_human_size (file->size, - GRUB_HUMAN_SIZE_SHORT)); - grub_file_close (file); - grub_free (pathname); + VasEBoot_printf ("%-12s", VasEBoot_get_human_size (file->size, + VasEBoot_HUMAN_SIZE_SHORT)); + VasEBoot_file_close (file); + VasEBoot_free (pathname); } else - grub_printf ("%-12s", _("DIR")); + VasEBoot_printf ("%-12s", _("DIR")); if (info->mtimeset) { - struct grub_datetime datetime; - grub_unixtime2datetime (info->mtime, &datetime); + struct VasEBoot_datetime datetime; + VasEBoot_unixtime2datetime (info->mtime, &datetime); if (ctx->human) - grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ", + VasEBoot_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ", datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second, - grub_get_weekday_name (&datetime)); + VasEBoot_get_weekday_name (&datetime)); else - grub_printf (" %04d%02d%02d%02d%02d%02d ", + VasEBoot_printf (" %04d%02d%02d%02d%02d%02d ", datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second); } - grub_printf ("%s%s\n", filename, info->dir ? "/" : ""); + VasEBoot_printf ("%s%s\n", filename, info->dir ? "/" : ""); return 0; } -static grub_err_t -grub_ls_list_files (char *dirname, int longlist, int all, int human) +static VasEBoot_err_t +VasEBoot_ls_list_files (char *dirname, int longlist, int all, int human) { char *device_name; - grub_fs_t fs; + VasEBoot_fs_t fs; const char *path; - grub_device_t dev; + VasEBoot_device_t dev; - device_name = grub_file_get_device_name (dirname); - dev = grub_device_open (device_name); + device_name = VasEBoot_file_get_device_name (dirname); + dev = VasEBoot_device_open (device_name); if (! dev) goto fail; - fs = grub_fs_probe (dev); - path = grub_strchr (dirname, ')'); + fs = VasEBoot_fs_probe (dev); + path = VasEBoot_strchr (dirname, ')'); if (! path) path = dirname; else @@ -192,20 +192,20 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) if (! path && ! device_name) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid argument"); goto fail; } if (! *path) { - if (grub_errno == GRUB_ERR_UNKNOWN_FS) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_UNKNOWN_FS) + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_normal_print_device_info (device_name); + VasEBoot_normal_print_device_info (device_name); } else if (fs) { - struct grub_ls_list_files_ctx ctx = { + struct VasEBoot_ls_list_files_ctx ctx = { .dirname = dirname, .all = all, .human = human @@ -216,78 +216,78 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) else (fs->dir) (dev, path, print_files, &ctx); - if (grub_errno == GRUB_ERR_BAD_FILE_TYPE - && path[grub_strlen (path) - 1] != '/') + if (VasEBoot_errno == VasEBoot_ERR_BAD_FILE_TYPE + && path[VasEBoot_strlen (path) - 1] != '/') { /* PATH might be a regular file. */ char *p; - grub_file_t file; - struct grub_dirhook_info info; - grub_errno = 0; + VasEBoot_file_t file; + struct VasEBoot_dirhook_info info; + VasEBoot_errno = 0; - grub_file_filter_disable_compression (); - file = grub_file_open (dirname); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (dirname); if (! file) goto fail; - grub_file_close (file); + VasEBoot_file_close (file); - p = grub_strrchr (dirname, '/') + 1; - dirname = grub_strndup (dirname, p - dirname); + p = VasEBoot_strrchr (dirname, '/') + 1; + dirname = VasEBoot_strndup (dirname, p - dirname); if (! dirname) goto fail; all = 1; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); if (longlist) print_files_long (p, &info, &ctx); else print_files (p, &info, &ctx); - grub_free (dirname); + VasEBoot_free (dirname); } - if (grub_errno == GRUB_ERR_NONE) - grub_xputs ("\n"); + if (VasEBoot_errno == VasEBoot_ERR_NONE) + VasEBoot_xputs ("\n"); - grub_refresh (); + VasEBoot_refresh (); } fail: if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - grub_free (device_name); + VasEBoot_free (device_name); return 0; } -static grub_err_t -grub_cmd_ls (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_ls (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; int i; if (argc == 0) - grub_ls_list_devices (state[0].set); + VasEBoot_ls_list_devices (state[0].set); else for (i = 0; i < argc; i++) - grub_ls_list_files (args[i], state[0].set, state[2].set, + VasEBoot_ls_list_files (args[i], state[0].set, state[2].set, state[1].set); return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(ls) +VasEBoot_MOD_INIT(ls) { - cmd = grub_register_extcmd ("ls", grub_cmd_ls, 0, + cmd = VasEBoot_register_extcmd ("ls", VasEBoot_cmd_ls, 0, N_("[-l|-h|-a] [FILE ...]"), N_("List devices and files."), options); } -GRUB_MOD_FINI(ls) +VasEBoot_MOD_FINI(ls) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/lsacpi.c b/VasEBoot-core/commands/lsacpi.c index 082491405..f40046bb6 100644 --- a/VasEBoot-core/commands/lsacpi.c +++ b/VasEBoot-core/commands/lsacpi.c @@ -1,314 +1,314 @@ /* acpi.c - Display acpi tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wcast-align" -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static void -print_strn (grub_uint8_t *str, grub_size_t len) +print_strn (VasEBoot_uint8_t *str, VasEBoot_size_t len) { for (; *str && len; str++, len--) - grub_printf ("%c", *str); + VasEBoot_printf ("%c", *str); for (len++; len; len--) - grub_printf (" "); + VasEBoot_printf (" "); } #define print_field(x) print_strn(x, sizeof (x)) static void -disp_acpi_table (struct grub_acpi_table_header *t) +disp_acpi_table (struct VasEBoot_acpi_table_header *t) { print_field (t->signature); - grub_printf ("%4" PRIuGRUB_UINT32_T "B rev=%u chksum=0x%02x (%s) OEM=", t->length, t->revision, t->checksum, - grub_byte_checksum (t, t->length) == 0 ? "valid" : "invalid"); + VasEBoot_printf ("%4" PRIuVasEBoot_UINT32_T "B rev=%u chksum=0x%02x (%s) OEM=", t->length, t->revision, t->checksum, + VasEBoot_byte_checksum (t, t->length) == 0 ? "valid" : "invalid"); print_field (t->oemid); print_field (t->oemtable); - grub_printf ("OEMrev=%08" PRIxGRUB_UINT32_T " ", t->oemrev); + VasEBoot_printf ("OEMrev=%08" PRIxVasEBoot_UINT32_T " ", t->oemrev); print_field (t->creator_id); - grub_printf (" %08" PRIxGRUB_UINT32_T "\n", t->creator_rev); + VasEBoot_printf (" %08" PRIxVasEBoot_UINT32_T "\n", t->creator_rev); } static void -disp_madt_table (struct grub_acpi_madt *t) +disp_madt_table (struct VasEBoot_acpi_madt *t) { - struct grub_acpi_madt_entry_header *d; - grub_uint32_t len; + struct VasEBoot_acpi_madt_entry_header *d; + VasEBoot_uint32_t len; disp_acpi_table (&t->hdr); - grub_printf ("Local APIC=%08" PRIxGRUB_UINT32_T " Flags=%08" - PRIxGRUB_UINT32_T "\n", + VasEBoot_printf ("Local APIC=%08" PRIxVasEBoot_UINT32_T " Flags=%08" + PRIxVasEBoot_UINT32_T "\n", t->lapic_addr, t->flags); - len = t->hdr.length - sizeof (struct grub_acpi_madt); + len = t->hdr.length - sizeof (struct VasEBoot_acpi_madt); d = t->entries; - for (;len > 0; len -= d->len, d = (void *) ((grub_uint8_t *) d + d->len)) + for (;len > 0; len -= d->len, d = (void *) ((VasEBoot_uint8_t *) d + d->len)) { switch (d->type) { - case GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_LAPIC: { - struct grub_acpi_madt_entry_lapic *dt = (void *) d; - grub_printf (" LAPIC ACPI_ID=%02x APIC_ID=%02x Flags=%08x\n", + struct VasEBoot_acpi_madt_entry_lapic *dt = (void *) d; + VasEBoot_printf (" LAPIC ACPI_ID=%02x APIC_ID=%02x Flags=%08x\n", dt->acpiid, dt->apicid, dt->flags); if (dt->hdr.len != sizeof (*dt)) - grub_printf (" table size mismatch %d != %d\n", dt->hdr.len, + VasEBoot_printf (" table size mismatch %d != %d\n", dt->hdr.len, (int) sizeof (*dt)); break; } - case GRUB_ACPI_MADT_ENTRY_TYPE_IOAPIC: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_IOAPIC: { - struct grub_acpi_madt_entry_ioapic *dt = (void *) d; - grub_printf (" IOAPIC ID=%02x address=%08x GSI=%08x\n", + struct VasEBoot_acpi_madt_entry_ioapic *dt = (void *) d; + VasEBoot_printf (" IOAPIC ID=%02x address=%08x GSI=%08x\n", dt->id, dt->address, dt->global_sys_interrupt); if (dt->hdr.len != sizeof (*dt)) - grub_printf (" table size mismatch %d != %d\n", dt->hdr.len, + VasEBoot_printf (" table size mismatch %d != %d\n", dt->hdr.len, (int) sizeof (*dt)); if (dt->pad) - grub_printf (" non-zero pad: %02x\n", dt->pad); + VasEBoot_printf (" non-zero pad: %02x\n", dt->pad); break; } - case GRUB_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE: { - struct grub_acpi_madt_entry_interrupt_override *dt = (void *) d; - grub_printf (" Int Override bus=%x src=%x GSI=%08x Flags=%04x\n", + struct VasEBoot_acpi_madt_entry_interrupt_override *dt = (void *) d; + VasEBoot_printf (" Int Override bus=%x src=%x GSI=%08x Flags=%04x\n", dt->bus, dt->source, dt->global_sys_interrupt, dt->flags); if (dt->hdr.len != sizeof (*dt)) - grub_printf (" table size mismatch %d != %d\n", dt->hdr.len, + VasEBoot_printf (" table size mismatch %d != %d\n", dt->hdr.len, (int) sizeof (*dt)); } break; - case GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC_NMI: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_LAPIC_NMI: { - struct grub_acpi_madt_entry_lapic_nmi *dt = (void *) d; - grub_printf (" LAPIC_NMI ACPI_ID=%02x Flags=%04x lint=%02x\n", + struct VasEBoot_acpi_madt_entry_lapic_nmi *dt = (void *) d; + VasEBoot_printf (" LAPIC_NMI ACPI_ID=%02x Flags=%04x lint=%02x\n", dt->acpiid, dt->flags, dt->lint); if (dt->hdr.len != sizeof (*dt)) - grub_printf (" table size mismatch %d != %d\n", dt->hdr.len, + VasEBoot_printf (" table size mismatch %d != %d\n", dt->hdr.len, (int) sizeof (*dt)); break; } - case GRUB_ACPI_MADT_ENTRY_TYPE_SAPIC: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_SAPIC: { - struct grub_acpi_madt_entry_sapic *dt = (void *) d; - grub_printf (" IOSAPIC Id=%02x GSI=%08x Addr=%016" PRIxGRUB_UINT64_T + struct VasEBoot_acpi_madt_entry_sapic *dt = (void *) d; + VasEBoot_printf (" IOSAPIC Id=%02x GSI=%08x Addr=%016" PRIxVasEBoot_UINT64_T "\n", dt->id, dt->global_sys_interrupt_base, dt->addr); if (dt->hdr.len != sizeof (*dt)) - grub_printf (" table size mismatch %d != %d\n", dt->hdr.len, + VasEBoot_printf (" table size mismatch %d != %d\n", dt->hdr.len, (int) sizeof (*dt)); if (dt->pad) - grub_printf (" non-zero pad: %02x\n", dt->pad); + VasEBoot_printf (" non-zero pad: %02x\n", dt->pad); } break; - case GRUB_ACPI_MADT_ENTRY_TYPE_LSAPIC: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_LSAPIC: { - struct grub_acpi_madt_entry_lsapic *dt = (void *) d; - grub_printf (" LSAPIC ProcId=%02x ID=%02x EID=%02x Flags=%x", + struct VasEBoot_acpi_madt_entry_lsapic *dt = (void *) d; + VasEBoot_printf (" LSAPIC ProcId=%02x ID=%02x EID=%02x Flags=%x", dt->cpu_id, dt->id, dt->eid, dt->flags); - if (dt->flags & GRUB_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED) - grub_printf (" Enabled\n"); + if (dt->flags & VasEBoot_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED) + VasEBoot_printf (" Enabled\n"); else - grub_printf (" Disabled\n"); - if (d->len > sizeof (struct grub_acpi_madt_entry_sapic)) - grub_printf (" UID val=%08x, Str=%s\n", dt->cpu_uid, + VasEBoot_printf (" Disabled\n"); + if (d->len > sizeof (struct VasEBoot_acpi_madt_entry_sapic)) + VasEBoot_printf (" UID val=%08x, Str=%s\n", dt->cpu_uid, dt->cpu_uid_str); - if (dt->hdr.len != sizeof (*dt) + grub_strlen ((char *) dt->cpu_uid_str) + 1) - grub_printf (" table size mismatch %d != %d\n", dt->hdr.len, + if (dt->hdr.len != sizeof (*dt) + VasEBoot_strlen ((char *) dt->cpu_uid_str) + 1) + VasEBoot_printf (" table size mismatch %d != %d\n", dt->hdr.len, (int) sizeof (*dt)); if (dt->pad[0] || dt->pad[1] || dt->pad[2]) - grub_printf (" non-zero pad: %02x%02x%02x\n", dt->pad[0], dt->pad[1], dt->pad[2]); + VasEBoot_printf (" non-zero pad: %02x%02x%02x\n", dt->pad[0], dt->pad[1], dt->pad[2]); } break; - case GRUB_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE: + case VasEBoot_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE: { - struct grub_acpi_madt_entry_platform_int_source *dt = (void *) d; + struct VasEBoot_acpi_madt_entry_platform_int_source *dt = (void *) d; static const char * const platint_type[] = {"Nul", "PMI", "INIT", "CPEI"}; - grub_printf (" Platform INT flags=%04x type=%02x (%s)" + VasEBoot_printf (" Platform INT flags=%04x type=%02x (%s)" " ID=%02x EID=%02x\n", dt->flags, dt->inttype, (dt->inttype < ARRAY_SIZE (platint_type)) ? platint_type[dt->inttype] : "??", dt->cpu_id, dt->cpu_eid); - grub_printf (" IOSAPIC Vec=%02x GSI=%08x source flags=%08x\n", + VasEBoot_printf (" IOSAPIC Vec=%02x GSI=%08x source flags=%08x\n", dt->sapic_vector, dt->global_sys_int, dt->src_flags); } break; default: - grub_printf (" type=%x l=%u ", d->type, d->len); - grub_printf (" ??\n"); + VasEBoot_printf (" type=%x l=%u ", d->type, d->len); + VasEBoot_printf (" ??\n"); } } } static void -disp_acpi_xsdt_table (struct grub_acpi_table_header *t) +disp_acpi_xsdt_table (struct VasEBoot_acpi_table_header *t) { - grub_uint32_t len; - grub_uint64_t *desc; + VasEBoot_uint32_t len; + VasEBoot_uint64_t *desc; disp_acpi_table (t); len = t->length - sizeof (*t); - desc = (grub_uint64_t *) (t + 1); + desc = (VasEBoot_uint64_t *) (t + 1); for (; len >= sizeof (*desc); desc++, len -= sizeof (*desc)) { -#if GRUB_CPU_SIZEOF_VOID_P == 4 +#if VasEBoot_CPU_SIZEOF_VOID_P == 4 if (*desc >= (1ULL << 32)) { - grub_printf ("Unreachable table\n"); + VasEBoot_printf ("Unreachable table\n"); continue; } #endif - t = (struct grub_acpi_table_header *) (grub_addr_t) *desc; + t = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) *desc; if (t == NULL) continue; - if (grub_memcmp (t->signature, GRUB_ACPI_MADT_SIGNATURE, + if (VasEBoot_memcmp (t->signature, VasEBoot_ACPI_MADT_SIGNATURE, sizeof (t->signature)) == 0) - disp_madt_table ((struct grub_acpi_madt *) t); + disp_madt_table ((struct VasEBoot_acpi_madt *) t); else disp_acpi_table (t); } } static void -disp_acpi_rsdt_table (struct grub_acpi_table_header *t) +disp_acpi_rsdt_table (struct VasEBoot_acpi_table_header *t) { - grub_uint32_t len; - grub_uint32_t *desc; + VasEBoot_uint32_t len; + VasEBoot_uint32_t *desc; disp_acpi_table (t); len = t->length - sizeof (*t); - desc = (grub_uint32_t *) (t + 1); + desc = (VasEBoot_uint32_t *) (t + 1); for (; len >= sizeof (*desc); desc++, len -= sizeof (*desc)) { - t = (struct grub_acpi_table_header *) (grub_addr_t) *desc; + t = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) *desc; if (t == NULL) continue; - if (grub_memcmp (t->signature, GRUB_ACPI_MADT_SIGNATURE, + if (VasEBoot_memcmp (t->signature, VasEBoot_ACPI_MADT_SIGNATURE, sizeof (t->signature)) == 0) - disp_madt_table ((struct grub_acpi_madt *) t); + disp_madt_table ((struct VasEBoot_acpi_madt *) t); else disp_acpi_table (t); } } static void -disp_acpi_rsdpv1 (struct grub_acpi_rsdp_v10 *rsdp) +disp_acpi_rsdpv1 (struct VasEBoot_acpi_rsdp_v10 *rsdp) { print_field (rsdp->signature); - grub_printf ("chksum:%02x (%s), OEM-ID: ", rsdp->checksum, grub_byte_checksum (rsdp, sizeof (*rsdp)) == 0 ? "valid" : "invalid"); + VasEBoot_printf ("chksum:%02x (%s), OEM-ID: ", rsdp->checksum, VasEBoot_byte_checksum (rsdp, sizeof (*rsdp)) == 0 ? "valid" : "invalid"); print_field (rsdp->oemid); - grub_printf ("rev=%d\n", rsdp->revision); - grub_printf ("RSDT=%08" PRIxGRUB_UINT32_T "\n", rsdp->rsdt_addr); + VasEBoot_printf ("rev=%d\n", rsdp->revision); + VasEBoot_printf ("RSDT=%08" PRIxVasEBoot_UINT32_T "\n", rsdp->rsdt_addr); } static void -disp_acpi_rsdpv2 (struct grub_acpi_rsdp_v20 *rsdp) +disp_acpi_rsdpv2 (struct VasEBoot_acpi_rsdp_v20 *rsdp) { disp_acpi_rsdpv1 (&rsdp->rsdpv1); - grub_printf ("len=%d chksum=%02x (%s) XSDT=%016" PRIxGRUB_UINT64_T "\n", rsdp->length, rsdp->checksum, grub_byte_checksum (rsdp, rsdp->length) == 0 ? "valid" : "invalid", + VasEBoot_printf ("len=%d chksum=%02x (%s) XSDT=%016" PRIxVasEBoot_UINT64_T "\n", rsdp->length, rsdp->checksum, VasEBoot_byte_checksum (rsdp, rsdp->length) == 0 ? "valid" : "invalid", rsdp->xsdt_addr); if (rsdp->length != sizeof (*rsdp)) - grub_printf (" length mismatch %d != %d\n", rsdp->length, + VasEBoot_printf (" length mismatch %d != %d\n", rsdp->length, (int) sizeof (*rsdp)); if (rsdp->reserved[0] || rsdp->reserved[1] || rsdp->reserved[2]) - grub_printf (" non-zero reserved %02x%02x%02x\n", rsdp->reserved[0], rsdp->reserved[1], rsdp->reserved[2]); + VasEBoot_printf (" non-zero reserved %02x%02x%02x\n", rsdp->reserved[0], rsdp->reserved[1], rsdp->reserved[2]); } -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"v1", '1', 0, N_("Show version 1 tables only."), 0, ARG_TYPE_NONE}, {"v2", '2', 0, N_("Show version 2 and version 3 tables only."), 0, ARG_TYPE_NONE}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_lsacpi (struct grub_extcmd_context *ctxt, +static VasEBoot_err_t +VasEBoot_cmd_lsacpi (struct VasEBoot_extcmd_context *ctxt, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { if (!ctxt->state[1].set) { - struct grub_acpi_rsdp_v10 *rsdp1 = grub_acpi_get_rsdpv1 (); + struct VasEBoot_acpi_rsdp_v10 *rsdp1 = VasEBoot_acpi_get_rsdpv1 (); if (!rsdp1) - grub_printf ("No RSDPv1\n"); + VasEBoot_printf ("No RSDPv1\n"); else { - grub_printf ("RSDPv1 signature:"); + VasEBoot_printf ("RSDPv1 signature:"); disp_acpi_rsdpv1 (rsdp1); - disp_acpi_rsdt_table ((void *) (grub_addr_t) rsdp1->rsdt_addr); + disp_acpi_rsdt_table ((void *) (VasEBoot_addr_t) rsdp1->rsdt_addr); } } if (!ctxt->state[0].set) { - struct grub_acpi_rsdp_v20 *rsdp2 = grub_acpi_get_rsdpv2 (); + struct VasEBoot_acpi_rsdp_v20 *rsdp2 = VasEBoot_acpi_get_rsdpv2 (); if (!rsdp2) - grub_printf ("No RSDPv2\n"); + VasEBoot_printf ("No RSDPv2\n"); else { -#if GRUB_CPU_SIZEOF_VOID_P == 4 +#if VasEBoot_CPU_SIZEOF_VOID_P == 4 if (rsdp2->xsdt_addr >= (1ULL << 32)) - grub_printf ("Unreachable RSDPv2\n"); + VasEBoot_printf ("Unreachable RSDPv2\n"); else #endif { - grub_printf ("RSDPv2 signature:"); + VasEBoot_printf ("RSDPv2 signature:"); disp_acpi_rsdpv2 (rsdp2); - disp_acpi_xsdt_table ((void *) (grub_addr_t) rsdp2->xsdt_addr); - grub_printf ("\n"); + disp_acpi_xsdt_table ((void *) (VasEBoot_addr_t) rsdp2->xsdt_addr); + VasEBoot_printf ("\n"); } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(lsapi) +VasEBoot_MOD_INIT(lsapi) { - cmd = grub_register_extcmd ("lsacpi", grub_cmd_lsacpi, 0, "[-1|-2]", + cmd = VasEBoot_register_extcmd ("lsacpi", VasEBoot_cmd_lsacpi, 0, "[-1|-2]", N_("Show ACPI information."), options); } -GRUB_MOD_FINI(lsacpi) +VasEBoot_MOD_FINI(lsacpi) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/lsmmap.c b/VasEBoot-core/commands/lsmmap.c index 816ee47d1..24b834c4c 100644 --- a/VasEBoot-core/commands/lsmmap.c +++ b/VasEBoot-core/commands/lsmmap.c @@ -1,85 +1,85 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#ifndef GRUB_MACHINE_EMU +#ifndef VasEBoot_MACHINE_EMU static const char *names[] = { - [GRUB_MEMORY_AVAILABLE] = N_("available RAM"), - [GRUB_MEMORY_RESERVED] = N_("reserved RAM"), + [VasEBoot_MEMORY_AVAILABLE] = N_("available RAM"), + [VasEBoot_MEMORY_RESERVED] = N_("reserved RAM"), /* TRANSLATORS: this refers to memory where ACPI tables are stored and which can be used by OS once it loads ACPI tables. */ - [GRUB_MEMORY_ACPI] = N_("ACPI reclaimable RAM"), + [VasEBoot_MEMORY_ACPI] = N_("ACPI reclaimable RAM"), /* TRANSLATORS: this refers to memory which ACPI-compliant OS is required to save accross hibernations. */ - [GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"), - [GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"), - [GRUB_MEMORY_PERSISTENT] = N_("persistent RAM"), - [GRUB_MEMORY_PERSISTENT_LEGACY] = N_("persistent RAM (legacy)"), - [GRUB_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"), - [GRUB_MEMORY_CODE] = N_("RAM holding firmware code") + [VasEBoot_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"), + [VasEBoot_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"), + [VasEBoot_MEMORY_PERSISTENT] = N_("persistent RAM"), + [VasEBoot_MEMORY_PERSISTENT_LEGACY] = N_("persistent RAM (legacy)"), + [VasEBoot_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"), + [VasEBoot_MEMORY_CODE] = N_("RAM holding firmware code") }; -/* Helper for grub_cmd_lsmmap. */ +/* Helper for VasEBoot_cmd_lsmmap. */ static int -lsmmap_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +lsmmap_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data __attribute__ ((unused))) { if (type < (int) ARRAY_SIZE (names) && type >= 0 && names[type]) - grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, %s\n"), + VasEBoot_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, %s\n"), (long long) addr, (long long) size, _(names[type])); else - grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n"), + VasEBoot_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n"), (long long) addr, (long long) size, type); return 0; } #endif -static grub_err_t -grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsmmap (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { -#ifndef GRUB_MACHINE_EMU - grub_machine_mmap_iterate (lsmmap_hook, NULL); +#ifndef VasEBoot_MACHINE_EMU + VasEBoot_machine_mmap_iterate (lsmmap_hook, NULL); #endif return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsmmap) +VasEBoot_MOD_INIT(lsmmap) { - cmd = grub_register_command ("lsmmap", grub_cmd_lsmmap, + cmd = VasEBoot_register_command ("lsmmap", VasEBoot_cmd_lsmmap, 0, N_("List memory map provided by firmware.")); } -GRUB_MOD_FINI(lsmmap) +VasEBoot_MOD_FINI(lsmmap) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/lspci.c b/VasEBoot-core/commands/lspci.c index 65213a372..93857d813 100644 --- a/VasEBoot-core/commands/lspci.c +++ b/VasEBoot-core/commands/lspci.c @@ -1,39 +1,39 @@ /* lspci.c - List PCI devices. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_pci_classname +struct VasEBoot_pci_classname { int class; int subclass; const char *desc; }; -static const struct grub_pci_classname grub_pci_classes[] = +static const struct VasEBoot_pci_classname VasEBoot_pci_classes[] = { { 0, 0, "" }, { 1, 0, "SCSI Controller" }, @@ -105,9 +105,9 @@ static const struct grub_pci_classname grub_pci_classes[] = }; static const char * -grub_pci_get_class (int class, int subclass) +VasEBoot_pci_get_class (int class, int subclass) { - const struct grub_pci_classname *curr = grub_pci_classes; + const struct VasEBoot_pci_classname *curr = VasEBoot_pci_classes; while (curr->desc) { @@ -119,7 +119,7 @@ grub_pci_get_class (int class, int subclass) return 0; } -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"iospace", 'i', 0, "show I/O spaces", 0, 0}, {0, 0, 0, 0, 0, 0} @@ -128,82 +128,82 @@ static const struct grub_arg_option options[] = static int iospace; static int -grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, +VasEBoot_lspci_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_uint32_t class; + VasEBoot_uint32_t class; const char *sclass; - grub_pci_address_t addr; + VasEBoot_pci_address_t addr; int reg; - grub_printf ("%02x:%02x.%x %04x:%04x", grub_pci_get_bus (dev), - grub_pci_get_device (dev), grub_pci_get_function (dev), + VasEBoot_printf ("%02x:%02x.%x %04x:%04x", VasEBoot_pci_get_bus (dev), + VasEBoot_pci_get_device (dev), VasEBoot_pci_get_function (dev), pciid & 0xFFFF, pciid >> 16); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); /* Lookup the class name, if there isn't a specific one, retry with 0x80 to get the generic class name. */ - sclass = grub_pci_get_class (class >> 24, (class >> 16) & 0xFF); + sclass = VasEBoot_pci_get_class (class >> 24, (class >> 16) & 0xFF); if (! sclass) - sclass = grub_pci_get_class (class >> 24, 0x80); + sclass = VasEBoot_pci_get_class (class >> 24, 0x80); if (! sclass) sclass = ""; - grub_printf (" [%04x] %s", (class >> 16) & 0xffff, sclass); + VasEBoot_printf (" [%04x] %s", (class >> 16) & 0xffff, sclass); - grub_uint8_t pi = (class >> 8) & 0xff; + VasEBoot_uint8_t pi = (class >> 8) & 0xff; if (pi) - grub_printf (" [PI %02x]", pi); + VasEBoot_printf (" [PI %02x]", pi); - grub_printf ("\n"); + VasEBoot_printf ("\n"); if (iospace) { - reg = GRUB_PCI_REG_ADDRESSES; - while (reg < GRUB_PCI_REG_CIS_POINTER) + reg = VasEBoot_PCI_REG_ADDRESSES; + while (reg < VasEBoot_PCI_REG_CIS_POINTER) { - grub_uint64_t space; - addr = grub_pci_make_address (dev, reg); - space = grub_pci_read (addr); + VasEBoot_uint64_t space; + addr = VasEBoot_pci_make_address (dev, reg); + space = VasEBoot_pci_read (addr); - reg += sizeof (grub_uint32_t); + reg += sizeof (VasEBoot_uint32_t); if (space == 0) continue; - switch (space & GRUB_PCI_ADDR_SPACE_MASK) + switch (space & VasEBoot_PCI_ADDR_SPACE_MASK) { - case GRUB_PCI_ADDR_SPACE_IO: - grub_printf ("\tIO space %d at 0x%llx\n", - (unsigned) ((reg - GRUB_PCI_REG_ADDRESSES) - / sizeof (grub_uint32_t)) - 1, + case VasEBoot_PCI_ADDR_SPACE_IO: + VasEBoot_printf ("\tIO space %d at 0x%llx\n", + (unsigned) ((reg - VasEBoot_PCI_REG_ADDRESSES) + / sizeof (VasEBoot_uint32_t)) - 1, (unsigned long long) - (space & GRUB_PCI_ADDR_IO_MASK)); + (space & VasEBoot_PCI_ADDR_IO_MASK)); break; - case GRUB_PCI_ADDR_SPACE_MEMORY: - if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK) - == GRUB_PCI_ADDR_MEM_TYPE_64) + case VasEBoot_PCI_ADDR_SPACE_MEMORY: + if ((space & VasEBoot_PCI_ADDR_MEM_TYPE_MASK) + == VasEBoot_PCI_ADDR_MEM_TYPE_64) { - addr = grub_pci_make_address (dev, reg); - space |= ((grub_uint64_t) grub_pci_read (addr)) << 32; - reg += sizeof (grub_uint32_t); - grub_printf ("\t64-bit memory space %d at 0x%016llx [%s]\n", - (unsigned) ((reg - GRUB_PCI_REG_ADDRESSES) - / sizeof (grub_uint32_t)) - 2, + addr = VasEBoot_pci_make_address (dev, reg); + space |= ((VasEBoot_uint64_t) VasEBoot_pci_read (addr)) << 32; + reg += sizeof (VasEBoot_uint32_t); + VasEBoot_printf ("\t64-bit memory space %d at 0x%016llx [%s]\n", + (unsigned) ((reg - VasEBoot_PCI_REG_ADDRESSES) + / sizeof (VasEBoot_uint32_t)) - 2, (unsigned long long) - (space & GRUB_PCI_ADDR_MEM_MASK), - space & GRUB_PCI_ADDR_MEM_PREFETCH + (space & VasEBoot_PCI_ADDR_MEM_MASK), + space & VasEBoot_PCI_ADDR_MEM_PREFETCH ? "prefetchable" : "non-prefetchable"); } else - grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n", - (unsigned) ((reg - GRUB_PCI_REG_ADDRESSES) - / sizeof (grub_uint32_t)) - 1, + VasEBoot_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n", + (unsigned) ((reg - VasEBoot_PCI_REG_ADDRESSES) + / sizeof (VasEBoot_uint32_t)) - 1, (unsigned long long) - (space & GRUB_PCI_ADDR_MEM_MASK), - space & GRUB_PCI_ADDR_MEM_PREFETCH + (space & VasEBoot_PCI_ADDR_MEM_MASK), + space & VasEBoot_PCI_ADDR_MEM_PREFETCH ? "prefetchable" : "non-prefetchable"); break; } @@ -214,25 +214,25 @@ grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, return 0; } -static grub_err_t -grub_cmd_lspci (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_lspci (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { iospace = ctxt->state[0].set; - grub_pci_iterate (grub_lspci_iter, NULL); - return GRUB_ERR_NONE; + VasEBoot_pci_iterate (VasEBoot_lspci_iter, NULL); + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(lspci) +VasEBoot_MOD_INIT(lspci) { - cmd = grub_register_extcmd ("lspci", grub_cmd_lspci, 0, "[-i]", + cmd = VasEBoot_register_extcmd ("lspci", VasEBoot_cmd_lspci, 0, "[-i]", N_("List PCI devices."), options); } -GRUB_MOD_FINI(lspci) +VasEBoot_MOD_FINI(lspci) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/macbless.c b/VasEBoot-core/commands/macbless.c index 18efa1a84..d806f394d 100644 --- a/VasEBoot-core/commands/macbless.c +++ b/VasEBoot-core/commands/macbless.c @@ -1,40 +1,40 @@ /* hfspbless.c - set the hfs+ boot directory. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2007,2008,2009,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct find_node_context { - grub_uint64_t inode_found; + VasEBoot_uint64_t inode_found; char *dirname; enum { FOUND_NONE, FOUND_FILE, FOUND_DIR } found; @@ -42,15 +42,15 @@ struct find_node_context static int find_inode (const char *filename, - const struct grub_dirhook_info *info, void *data) + const struct VasEBoot_dirhook_info *info, void *data) { struct find_node_context *ctx = data; if (!info->inodeset) return 0; - if ((grub_strcmp (ctx->dirname, filename) == 0 + if ((VasEBoot_strcmp (ctx->dirname, filename) == 0 || (info->case_insensitive - && grub_strcasecmp (ctx->dirname, filename) == 0))) + && VasEBoot_strcasecmp (ctx->dirname, filename) == 0))) { ctx->inode_found = info->inode; ctx->found = info->dir ? FOUND_DIR : FOUND_FILE; @@ -58,100 +58,100 @@ find_inode (const char *filename, return 0; } -grub_err_t -grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir, +VasEBoot_err_t +VasEBoot_mac_bless_inode (VasEBoot_device_t dev, VasEBoot_uint32_t inode, int is_dir, int intel) { - grub_err_t err; + VasEBoot_err_t err; union { - struct grub_hfs_sblock hfs; - struct grub_hfsplus_volheader hfsplus; + struct VasEBoot_hfs_sblock hfs; + struct VasEBoot_hfsplus_volheader hfsplus; } volheader; - grub_disk_addr_t embedded_offset; + VasEBoot_disk_addr_t embedded_offset; if (intel && is_dir) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "can't bless a directory for mactel"); if (!intel && !is_dir) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "can't bless a file for mac PPC"); /* Read the bootblock. */ - err = grub_disk_read (dev->disk, GRUB_HFSPLUS_SBLOCK, 0, sizeof (volheader), + err = VasEBoot_disk_read (dev->disk, VasEBoot_HFSPLUS_SBLOCK, 0, sizeof (volheader), (char *) &volheader); if (err) return err; embedded_offset = 0; - if (grub_be_to_cpu16 (volheader.hfs.magic) == GRUB_HFS_MAGIC) + if (VasEBoot_be_to_cpu16 (volheader.hfs.magic) == VasEBoot_HFS_MAGIC) { int extent_start; int ablk_size; int ablk_start; /* See if there's an embedded HFS+ filesystem. */ - if (grub_be_to_cpu16 (volheader.hfs.embed_sig) != GRUB_HFSPLUS_MAGIC) + if (VasEBoot_be_to_cpu16 (volheader.hfs.embed_sig) != VasEBoot_HFSPLUS_MAGIC) { if (intel) - volheader.hfs.intel_bootfile = grub_be_to_cpu32 (inode); + volheader.hfs.intel_bootfile = VasEBoot_be_to_cpu32 (inode); else - volheader.hfs.ppc_bootdir = grub_be_to_cpu32 (inode); - return GRUB_ERR_NONE; + volheader.hfs.ppc_bootdir = VasEBoot_be_to_cpu32 (inode); + return VasEBoot_ERR_NONE; } /* Calculate the offset needed to translate HFS+ sector numbers. */ extent_start = - grub_be_to_cpu16 (volheader.hfs.embed_extent.first_block); - ablk_size = grub_be_to_cpu32 (volheader.hfs.blksz); - ablk_start = grub_be_to_cpu16 (volheader.hfs.first_block); + VasEBoot_be_to_cpu16 (volheader.hfs.embed_extent.first_block); + ablk_size = VasEBoot_be_to_cpu32 (volheader.hfs.blksz); + ablk_start = VasEBoot_be_to_cpu16 (volheader.hfs.first_block); embedded_offset = (ablk_start - + ((grub_uint64_t) extent_start) - * (ablk_size >> GRUB_DISK_SECTOR_BITS)); + + ((VasEBoot_uint64_t) extent_start) + * (ablk_size >> VasEBoot_DISK_SECTOR_BITS)); err = - grub_disk_read (dev->disk, embedded_offset + GRUB_HFSPLUS_SBLOCK, 0, + VasEBoot_disk_read (dev->disk, embedded_offset + VasEBoot_HFSPLUS_SBLOCK, 0, sizeof (volheader), (char *) &volheader); if (err) return err; } - if ((grub_be_to_cpu16 (volheader.hfsplus.magic) != GRUB_HFSPLUS_MAGIC) - && (grub_be_to_cpu16 (volheader.hfsplus.magic) != GRUB_HFSPLUSX_MAGIC)) - return grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); + if ((VasEBoot_be_to_cpu16 (volheader.hfsplus.magic) != VasEBoot_HFSPLUS_MAGIC) + && (VasEBoot_be_to_cpu16 (volheader.hfsplus.magic) != VasEBoot_HFSPLUSX_MAGIC)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a HFS+ filesystem"); if (intel) - volheader.hfsplus.intel_bootfile = grub_be_to_cpu32 (inode); + volheader.hfsplus.intel_bootfile = VasEBoot_be_to_cpu32 (inode); else - volheader.hfsplus.ppc_bootdir = grub_be_to_cpu32 (inode); + volheader.hfsplus.ppc_bootdir = VasEBoot_be_to_cpu32 (inode); - return grub_disk_write (dev->disk, embedded_offset + GRUB_HFSPLUS_SBLOCK, 0, + return VasEBoot_disk_write (dev->disk, embedded_offset + VasEBoot_HFSPLUS_SBLOCK, 0, sizeof (volheader), (char *) &volheader); } -grub_err_t -grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel) +VasEBoot_err_t +VasEBoot_mac_bless_file (VasEBoot_device_t dev, const char *path_in, int intel) { - grub_fs_t fs; + VasEBoot_fs_t fs; char *path, *tail; struct find_node_context ctx; - fs = grub_fs_probe (dev); - if (!fs || (grub_strcmp (fs->name, "hfsplus") != 0 - && grub_strcmp (fs->name, "hfs") != 0)) - return grub_error (GRUB_ERR_BAD_FS, "no suitable FS found"); + fs = VasEBoot_fs_probe (dev); + if (!fs || (VasEBoot_strcmp (fs->name, "hfsplus") != 0 + && VasEBoot_strcmp (fs->name, "hfs") != 0)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "no suitable FS found"); - path = grub_strdup (path_in); + path = VasEBoot_strdup (path_in); if (!path) - return grub_errno; + return VasEBoot_errno; - tail = path + grub_strlen (path) - 1; + tail = path + VasEBoot_strlen (path) - 1; /* Remove trailing '/'. */ while (tail != path && *tail == '/') *(tail--) = 0; - tail = grub_strrchr (path, '/'); + tail = VasEBoot_strrchr (path, '/'); ctx.found = 0; if (tail) @@ -168,30 +168,30 @@ grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel) } if (!ctx.found) { - grub_free (path); - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), + VasEBoot_free (path); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path_in); } - grub_free (path); + VasEBoot_free (path); - return grub_mac_bless_inode (dev, (grub_uint32_t) ctx.inode_found, + return VasEBoot_mac_bless_inode (dev, (VasEBoot_uint32_t) ctx.inode_found, (ctx.found == FOUND_DIR), intel); } -static grub_err_t -grub_cmd_macbless (grub_command_t cmd, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_macbless (VasEBoot_command_t cmd, int argc, char **args) { char *device_name; char *path = 0; - grub_device_t dev = 0; - grub_err_t err; + VasEBoot_device_t dev = 0; + VasEBoot_err_t err; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); - device_name = grub_file_get_device_name (args[0]); - dev = grub_device_open (device_name); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); + device_name = VasEBoot_file_get_device_name (args[0]); + dev = VasEBoot_device_open (device_name); - path = grub_strchr (args[0], ')'); + path = VasEBoot_strchr (args[0], ')'); if (!path) path = args[0]; else @@ -200,36 +200,36 @@ grub_cmd_macbless (grub_command_t cmd, int argc, char **args) if (!path || *path == 0 || !dev) { if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - grub_free (device_name); + VasEBoot_free (device_name); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid argument"); } - err = grub_mac_bless_file (dev, path, cmd->name[3] == 't'); + err = VasEBoot_mac_bless_file (dev, path, cmd->name[3] == 't'); - grub_device_close (dev); - grub_free (device_name); + VasEBoot_device_close (dev); + VasEBoot_free (device_name); return err; } -static grub_command_t cmd, cmd_ppc; +static VasEBoot_command_t cmd, cmd_ppc; -GRUB_MOD_INIT(macbless) +VasEBoot_MOD_INIT(macbless) { - cmd = grub_register_command ("mactelbless", grub_cmd_macbless, + cmd = VasEBoot_register_command ("mactelbless", VasEBoot_cmd_macbless, N_("FILE"), N_ ("Bless FILE of HFS or HFS+ partition for intel macs.")); cmd_ppc = - grub_register_command ("macppcbless", grub_cmd_macbless, N_("DIR"), + VasEBoot_register_command ("macppcbless", VasEBoot_cmd_macbless, N_("DIR"), N_ ("Bless DIR of HFS or HFS+ partition for PPC macs.")); } -GRUB_MOD_FINI(macbless) +VasEBoot_MOD_FINI(macbless) { - grub_unregister_command (cmd); - grub_unregister_command (cmd_ppc); + VasEBoot_unregister_command (cmd); + VasEBoot_unregister_command (cmd_ppc); } diff --git a/VasEBoot-core/commands/memrw.c b/VasEBoot-core/commands/memrw.c index 98769eadb..fd26796f9 100644 --- a/VasEBoot-core/commands/memrw.c +++ b/VasEBoot-core/commands/memrw.c @@ -1,34 +1,34 @@ /* memrw.c - command to read / write physical memory */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword; -static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; +static VasEBoot_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword; +static VasEBoot_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {0, 'v', 0, N_("Save read value into variable VARNAME."), N_("VARNAME"), ARG_TYPE_STRING}, @@ -36,122 +36,122 @@ static const struct grub_arg_option options[] = }; -static grub_err_t -grub_cmd_read (grub_extcmd_context_t ctxt, int argc, char **argv) +static VasEBoot_err_t +VasEBoot_cmd_read (VasEBoot_extcmd_context_t ctxt, int argc, char **argv) { - grub_addr_t addr; - grub_uint32_t value = 0; + VasEBoot_addr_t addr; + VasEBoot_uint32_t value = 0; char buf[sizeof ("XXXXXXXX")]; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - addr = grub_strtoul (argv[0], 0, 0); + addr = VasEBoot_strtoul (argv[0], 0, 0); switch (ctxt->extcmd->cmd->name[sizeof ("read_") - 1]) { case 'd': - value = *((volatile grub_uint32_t *) addr); + value = *((volatile VasEBoot_uint32_t *) addr); break; case 'w': - value = *((volatile grub_uint16_t *) addr); + value = *((volatile VasEBoot_uint16_t *) addr); break; case 'b': - value = *((volatile grub_uint8_t *) addr); + value = *((volatile VasEBoot_uint8_t *) addr); break; } if (ctxt->state[0].set) { - grub_snprintf (buf, sizeof (buf), "%x", value); - grub_env_set (ctxt->state[0].arg, buf); + VasEBoot_snprintf (buf, sizeof (buf), "%x", value); + VasEBoot_env_set (ctxt->state[0].arg, buf); } else - grub_printf ("0x%x\n", value); + VasEBoot_printf ("0x%x\n", value); return 0; } -static grub_err_t -grub_cmd_write (grub_command_t cmd, int argc, char **argv) +static VasEBoot_err_t +VasEBoot_cmd_write (VasEBoot_command_t cmd, int argc, char **argv) { - grub_addr_t addr; - grub_uint32_t value; - grub_uint32_t mask = 0xffffffff; + VasEBoot_addr_t addr; + VasEBoot_uint32_t value; + VasEBoot_uint32_t mask = 0xffffffff; if (argc != 2 && argc != 3) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); - addr = grub_strtoul (argv[0], 0, 0); - value = grub_strtoul (argv[1], 0, 0); + addr = VasEBoot_strtoul (argv[0], 0, 0); + value = VasEBoot_strtoul (argv[1], 0, 0); if (argc == 3) - mask = grub_strtoul (argv[2], 0, 0); + mask = VasEBoot_strtoul (argv[2], 0, 0); value &= mask; switch (cmd->name[sizeof ("write_") - 1]) { case 'd': if (mask != 0xffffffff) - *((volatile grub_uint32_t *) addr) - = (*((volatile grub_uint32_t *) addr) & ~mask) | value; + *((volatile VasEBoot_uint32_t *) addr) + = (*((volatile VasEBoot_uint32_t *) addr) & ~mask) | value; else - *((volatile grub_uint32_t *) addr) = value; + *((volatile VasEBoot_uint32_t *) addr) = value; break; case 'w': if ((mask & 0xffff) != 0xffff) - *((volatile grub_uint16_t *) addr) - = (*((volatile grub_uint16_t *) addr) & ~mask) | value; + *((volatile VasEBoot_uint16_t *) addr) + = (*((volatile VasEBoot_uint16_t *) addr) & ~mask) | value; else - *((volatile grub_uint16_t *) addr) = value; + *((volatile VasEBoot_uint16_t *) addr) = value; break; case 'b': if ((mask & 0xff) != 0xff) - *((volatile grub_uint8_t *) addr) - = (*((volatile grub_uint8_t *) addr) & ~mask) | value; + *((volatile VasEBoot_uint8_t *) addr) + = (*((volatile VasEBoot_uint8_t *) addr) & ~mask) | value; else - *((volatile grub_uint8_t *) addr) = value; + *((volatile VasEBoot_uint8_t *) addr) = value; break; } return 0; } -GRUB_MOD_INIT(memrw) +VasEBoot_MOD_INIT(memrw) { cmd_read_byte = - grub_register_extcmd ("read_byte", grub_cmd_read, 0, + VasEBoot_register_extcmd ("read_byte", VasEBoot_cmd_read, 0, N_("ADDR"), N_("Read 8-bit value from ADDR."), options); cmd_read_word = - grub_register_extcmd ("read_word", grub_cmd_read, 0, + VasEBoot_register_extcmd ("read_word", VasEBoot_cmd_read, 0, N_("ADDR"), N_("Read 16-bit value from ADDR."), options); cmd_read_dword = - grub_register_extcmd ("read_dword", grub_cmd_read, 0, + VasEBoot_register_extcmd ("read_dword", VasEBoot_cmd_read, 0, N_("ADDR"), N_("Read 32-bit value from ADDR."), options); cmd_write_byte = - grub_register_command ("write_byte", grub_cmd_write, + VasEBoot_register_command ("write_byte", VasEBoot_cmd_write, N_("ADDR VALUE [MASK]"), N_("Write 8-bit VALUE to ADDR.")); cmd_write_word = - grub_register_command ("write_word", grub_cmd_write, + VasEBoot_register_command ("write_word", VasEBoot_cmd_write, N_("ADDR VALUE [MASK]"), N_("Write 16-bit VALUE to ADDR.")); cmd_write_dword = - grub_register_command ("write_dword", grub_cmd_write, + VasEBoot_register_command ("write_dword", VasEBoot_cmd_write, N_("ADDR VALUE [MASK]"), N_("Write 32-bit VALUE to ADDR.")); } -GRUB_MOD_FINI(memrw) +VasEBoot_MOD_FINI(memrw) { - grub_unregister_extcmd (cmd_read_byte); - grub_unregister_extcmd (cmd_read_word); - grub_unregister_extcmd (cmd_read_dword); - grub_unregister_command (cmd_write_byte); - grub_unregister_command (cmd_write_word); - grub_unregister_command (cmd_write_dword); + VasEBoot_unregister_extcmd (cmd_read_byte); + VasEBoot_unregister_extcmd (cmd_read_word); + VasEBoot_unregister_extcmd (cmd_read_dword); + VasEBoot_unregister_command (cmd_write_byte); + VasEBoot_unregister_command (cmd_write_word); + VasEBoot_unregister_command (cmd_write_dword); } diff --git a/VasEBoot-core/commands/menuentry.c b/VasEBoot-core/commands/menuentry.c index 58d4dadf6..7dc4c83d7 100644 --- a/VasEBoot-core/commands/menuentry.c +++ b/VasEBoot-core/commands/menuentry.c @@ -1,33 +1,33 @@ /* menuentry.c - menuentry command */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { - {"class", 1, GRUB_ARG_OPTION_REPEATABLE, + {"class", 1, VasEBoot_ARG_OPTION_REPEATABLE, N_("Menu entry type."), N_("STRING"), ARG_TYPE_STRING}, {"users", 2, 0, N_("List of users allowed to boot this entry."), N_("USERNAME[,USERNAME]"), @@ -54,27 +54,27 @@ static struct { {"backspace", '\b'}, {"tab", '\t'}, - {"delete", GRUB_TERM_KEY_DC}, - {"insert", GRUB_TERM_KEY_INSERT}, - {"f1", GRUB_TERM_KEY_F1}, - {"f2", GRUB_TERM_KEY_F2}, - {"f3", GRUB_TERM_KEY_F3}, - {"f4", GRUB_TERM_KEY_F4}, - {"f5", GRUB_TERM_KEY_F5}, - {"f6", GRUB_TERM_KEY_F6}, - {"f7", GRUB_TERM_KEY_F7}, - {"f8", GRUB_TERM_KEY_F8}, - {"f9", GRUB_TERM_KEY_F9}, - {"f10", GRUB_TERM_KEY_F10}, - {"f11", GRUB_TERM_KEY_F11}, - {"f12", GRUB_TERM_KEY_F12}, + {"delete", VasEBoot_TERM_KEY_DC}, + {"insert", VasEBoot_TERM_KEY_INSERT}, + {"f1", VasEBoot_TERM_KEY_F1}, + {"f2", VasEBoot_TERM_KEY_F2}, + {"f3", VasEBoot_TERM_KEY_F3}, + {"f4", VasEBoot_TERM_KEY_F4}, + {"f5", VasEBoot_TERM_KEY_F5}, + {"f6", VasEBoot_TERM_KEY_F6}, + {"f7", VasEBoot_TERM_KEY_F7}, + {"f8", VasEBoot_TERM_KEY_F8}, + {"f9", VasEBoot_TERM_KEY_F9}, + {"f10", VasEBoot_TERM_KEY_F10}, + {"f11", VasEBoot_TERM_KEY_F11}, + {"f12", VasEBoot_TERM_KEY_F12}, }; /* Add a menu entry to the current menu context (as given by the environment variable data slot `menu'). As the configuration file is read, the script parser calls this when a menu entry is to be created. */ -grub_err_t -grub_normal_add_menu_entry (int argc, const char **args, +VasEBoot_err_t +VasEBoot_normal_add_menu_entry (int argc, const char **args, char **classes, const char *id, const char *users, const char *hotkey, const char *prefix, const char *sourcecode, @@ -86,33 +86,33 @@ grub_normal_add_menu_entry (int argc, const char **args, char *menu_title = NULL; char *menu_sourcecode = NULL; char *menu_id = NULL; - struct grub_menu_entry_class *menu_classes = NULL; + struct VasEBoot_menu_entry_class *menu_classes = NULL; - grub_menu_t menu; - grub_menu_entry_t *last; + VasEBoot_menu_t menu; + VasEBoot_menu_entry_t *last; - menu = grub_env_get_menu (); + menu = VasEBoot_env_get_menu (); if (! menu) - return grub_error (GRUB_ERR_MENU, "no menu context"); + return VasEBoot_error (VasEBoot_ERR_MENU, "no menu context"); last = &menu->entry_list; - menu_sourcecode = grub_xasprintf ("%s%s", prefix ?: "", sourcecode); + menu_sourcecode = VasEBoot_xasprintf ("%s%s", prefix ?: "", sourcecode); if (! menu_sourcecode) - return grub_errno; + return VasEBoot_errno; if (classes && classes[0]) { int i; for (i = 0; classes[i]; i++); /* count # of menuentry classes */ - menu_classes = grub_zalloc (sizeof (struct grub_menu_entry_class) + menu_classes = VasEBoot_zalloc (sizeof (struct VasEBoot_menu_entry_class) * (i + 1)); if (! menu_classes) goto fail; for (i = 0; classes[i]; i++) { - menu_classes[i].name = grub_strdup (classes[i]); + menu_classes[i].name = VasEBoot_strdup (classes[i]); if (! menu_classes[i].name) goto fail; menu_classes[i].next = classes[i + 1] ? &menu_classes[i + 1] : NULL; @@ -121,7 +121,7 @@ grub_normal_add_menu_entry (int argc, const char **args, if (users) { - menu_users = grub_strdup (users); + menu_users = VasEBoot_strdup (users); if (! menu_users) goto fail; } @@ -130,7 +130,7 @@ grub_normal_add_menu_entry (int argc, const char **args, { unsigned i; for (i = 0; i < ARRAY_SIZE (hotkey_aliases); i++) - if (grub_strcmp (hotkey, hotkey_aliases[i].name) == 0) + if (VasEBoot_strcmp (hotkey, hotkey_aliases[i].name) == 0) { menu_hotkey = hotkey_aliases[i].key; break; @@ -141,20 +141,20 @@ grub_normal_add_menu_entry (int argc, const char **args, if (! argc) { - grub_error (GRUB_ERR_MENU, "menuentry is missing title"); + VasEBoot_error (VasEBoot_ERR_MENU, "menuentry is missing title"); goto fail; } - menu_title = grub_strdup (args[0]); + menu_title = VasEBoot_strdup (args[0]); if (! menu_title) goto fail; - menu_id = grub_strdup (id ? : menu_title); + menu_id = VasEBoot_strdup (id ? : menu_title); if (! menu_id) goto fail; /* Save argc, args to pass as parameters to block arg later. */ - menu_args = grub_malloc (sizeof (char*) * (argc + 1)); + menu_args = VasEBoot_malloc (sizeof (char*) * (argc + 1)); if (! menu_args) goto fail; @@ -162,7 +162,7 @@ grub_normal_add_menu_entry (int argc, const char **args, int i; for (i = 0; i < argc; i++) { - menu_args[i] = grub_strdup (args[i]); + menu_args[i] = VasEBoot_strdup (args[i]); if (! menu_args[i]) goto fail; } @@ -173,7 +173,7 @@ grub_normal_add_menu_entry (int argc, const char **args, while (*last) last = &(*last)->next; - *last = grub_zalloc (sizeof (**last)); + *last = VasEBoot_zalloc (sizeof (**last)); if (! *last) goto fail; @@ -190,29 +190,29 @@ grub_normal_add_menu_entry (int argc, const char **args, (*last)->submenu = submenu; menu->size++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (menu_sourcecode); + VasEBoot_free (menu_sourcecode); { int i; for (i = 0; menu_classes && menu_classes[i].name; i++) - grub_free (menu_classes[i].name); - grub_free (menu_classes); + VasEBoot_free (menu_classes[i].name); + VasEBoot_free (menu_classes); } { int i; for (i = 0; menu_args && menu_args[i]; i++) - grub_free (menu_args[i]); - grub_free (menu_args); + VasEBoot_free (menu_args[i]); + VasEBoot_free (menu_args); } - grub_free (menu_users); - grub_free (menu_title); - grub_free (menu_id); - return grub_errno; + VasEBoot_free (menu_users); + VasEBoot_free (menu_title); + VasEBoot_free (menu_id); + return VasEBoot_errno; } static char * @@ -222,7 +222,7 @@ setparams_prefix (int argc, char **args) int j; char *p; char *result; - grub_size_t len = 10; + VasEBoot_size_t len = 10; /* Count resulting string length */ for (i = 0; i < argc; i++) @@ -233,18 +233,18 @@ setparams_prefix (int argc, char **args) len += (*p++ == '\'' ? 3 : 1); } - result = grub_malloc (len + 2); + result = VasEBoot_malloc (len + 2); if (! result) return 0; - grub_strcpy (result, "setparams"); + VasEBoot_strcpy (result, "setparams"); p = result + 9; for (j = 0; j < argc; j++) { *p++ = ' '; *p++ = '\''; - p = grub_strchrsub (p, args[j], '\'', "'\\''"); + p = VasEBoot_strchrsub (p, args[j], '\'', "'\\''"); *p++ = '\''; } *p++ = '\n'; @@ -252,24 +252,24 @@ setparams_prefix (int argc, char **args) return result; } -static grub_err_t -grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_menuentry (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { char ch; char *src; char *prefix; unsigned len; - grub_err_t r; + VasEBoot_err_t r; const char *users; if (! argc) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing arguments"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "missing arguments"); if (ctxt->state[3].set && ctxt->script) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "multiple menuentry definitions"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "multiple menuentry definitions"); if (! ctxt->state[3].set && ! ctxt->script) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no menuentry definition"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no menuentry definition"); if (ctxt->state[1].set) users = ctxt->state[1].arg; @@ -279,7 +279,7 @@ grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args) users = ""; if (! ctxt->script) - return grub_normal_add_menu_entry (argc, (const char **) args, + return VasEBoot_normal_add_menu_entry (argc, (const char **) args, (ctxt->state[0].set ? ctxt->state[0].args : NULL), ctxt->state[4].arg, @@ -291,15 +291,15 @@ grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args) src = args[argc - 1]; args[argc - 1] = NULL; - len = grub_strlen(src); + len = VasEBoot_strlen(src); ch = src[len - 1]; src[len - 1] = '\0'; prefix = setparams_prefix (argc - 1, args); if (! prefix) - return grub_errno; + return VasEBoot_errno; - r = grub_normal_add_menu_entry (argc - 1, (const char **) args, + r = VasEBoot_normal_add_menu_entry (argc - 1, (const char **) args, ctxt->state[0].args, ctxt->state[4].arg, users, ctxt->state[2].arg, prefix, src + 1, @@ -307,31 +307,31 @@ grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args) src[len - 1] = ch; args[argc - 1] = src; - grub_free (prefix); + VasEBoot_free (prefix); return r; } -static grub_extcmd_t cmd, cmd_sub; +static VasEBoot_extcmd_t cmd, cmd_sub; void -grub_menu_init (void) +VasEBoot_menu_init (void) { - cmd = grub_register_extcmd ("menuentry", grub_cmd_menuentry, - GRUB_COMMAND_FLAG_BLOCKS - | GRUB_COMMAND_ACCEPT_DASH - | GRUB_COMMAND_FLAG_EXTRACTOR, + cmd = VasEBoot_register_extcmd ("menuentry", VasEBoot_cmd_menuentry, + VasEBoot_COMMAND_FLAG_BLOCKS + | VasEBoot_COMMAND_ACCEPT_DASH + | VasEBoot_COMMAND_FLAG_EXTRACTOR, N_("BLOCK"), N_("Define a menu entry."), options); - cmd_sub = grub_register_extcmd ("submenu", grub_cmd_menuentry, - GRUB_COMMAND_FLAG_BLOCKS - | GRUB_COMMAND_ACCEPT_DASH - | GRUB_COMMAND_FLAG_EXTRACTOR, + cmd_sub = VasEBoot_register_extcmd ("submenu", VasEBoot_cmd_menuentry, + VasEBoot_COMMAND_FLAG_BLOCKS + | VasEBoot_COMMAND_ACCEPT_DASH + | VasEBoot_COMMAND_FLAG_EXTRACTOR, N_("BLOCK"), N_("Define a submenu."), options); } void -grub_menu_fini (void) +VasEBoot_menu_fini (void) { - grub_unregister_extcmd (cmd); - grub_unregister_extcmd (cmd_sub); + VasEBoot_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd_sub); } diff --git a/VasEBoot-core/commands/minicmd.c b/VasEBoot-core/commands/minicmd.c index a3a118241..15113d663 100644 --- a/VasEBoot-core/commands/minicmd.c +++ b/VasEBoot-core/commands/minicmd.c @@ -1,53 +1,53 @@ /* minicmd.c - commands for the rescue mode */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* cat FILE */ -static grub_err_t -grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_mini_cmd_cat (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file; - char buf[GRUB_DISK_SECTOR_SIZE]; - grub_ssize_t size; + VasEBoot_file_t file; + char buf[VasEBoot_DISK_SECTOR_SIZE]; + VasEBoot_ssize_t size; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - while ((size = grub_file_read (file, buf, sizeof (buf))) > 0) + while ((size = VasEBoot_file_read (file, buf, sizeof (buf))) > 0) { int i; @@ -55,68 +55,68 @@ grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)), { unsigned char c = buf[i]; - if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') - grub_printf ("%c", c); + if ((VasEBoot_isprint (c) || VasEBoot_isspace (c)) && c != '\r') + VasEBoot_printf ("%c", c); else { - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - grub_printf ("<%x>", (int) c); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); + VasEBoot_printf ("<%x>", (int) c); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); } } } - grub_xputs ("\n"); - grub_refresh (); - grub_file_close (file); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); + VasEBoot_file_close (file); return 0; } /* help */ -static grub_err_t -grub_mini_cmd_help (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_mini_cmd_help (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_command_t p; + VasEBoot_command_t p; - for (p = grub_command_list; p; p = p->next) - grub_printf ("%s (%d%c)\t%s\n", p->name, - p->prio & GRUB_COMMAND_PRIO_MASK, - (p->prio & GRUB_COMMAND_FLAG_ACTIVE) ? '+' : '-', + for (p = VasEBoot_command_list; p; p = p->next) + VasEBoot_printf ("%s (%d%c)\t%s\n", p->name, + p->prio & VasEBoot_COMMAND_PRIO_MASK, + (p->prio & VasEBoot_COMMAND_FLAG_ACTIVE) ? '+' : '-', p->description); return 0; } /* dump ADDRESS [SIZE] */ -static grub_err_t -grub_mini_cmd_dump (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_mini_cmd_dump (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_uint8_t *addr; - grub_size_t size = 4; + VasEBoot_uint8_t *addr; + VasEBoot_size_t size = 4; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no address specified"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no address specified"); -#if GRUB_CPU_SIZEOF_VOID_P == GRUB_CPU_SIZEOF_LONG -#define grub_strtoaddr grub_strtoul +#if VasEBoot_CPU_SIZEOF_VOID_P == VasEBoot_CPU_SIZEOF_LONG +#define VasEBoot_strtoaddr VasEBoot_strtoul #else -#define grub_strtoaddr grub_strtoull +#define VasEBoot_strtoaddr VasEBoot_strtoull #endif - addr = (grub_uint8_t *) grub_strtoaddr (argv[0], 0, 0); - if (grub_errno) - return grub_errno; + addr = (VasEBoot_uint8_t *) VasEBoot_strtoaddr (argv[0], 0, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (argc > 1) - size = (grub_size_t) grub_strtoaddr (argv[1], 0, 0); + size = (VasEBoot_size_t) VasEBoot_strtoaddr (argv[1], 0, 0); while (size--) { - grub_printf ("%x%x ", *addr >> 4, *addr & 0xf); + VasEBoot_printf ("%x%x ", *addr >> 4, *addr & 0xf); addr++; } @@ -124,98 +124,98 @@ grub_mini_cmd_dump (struct grub_command *cmd __attribute__ ((unused)), } /* rmmod MODULE */ -static grub_err_t -grub_mini_cmd_rmmod (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_mini_cmd_rmmod (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_dl_t mod; + VasEBoot_dl_t mod; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no module specified"); - mod = grub_dl_get (argv[0]); + mod = VasEBoot_dl_get (argv[0]); if (! mod) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such module"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no such module"); - if (grub_dl_unref (mod) <= 0) - grub_dl_unload (mod); + if (VasEBoot_dl_unref (mod) <= 0) + VasEBoot_dl_unload (mod); return 0; } /* lsmod */ -static grub_err_t -grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_mini_cmd_lsmod (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_dl_t mod; + VasEBoot_dl_t mod; /* TRANSLATORS: this is module list header. Name is module name, Ref Count is a reference counter (how many modules or open descriptors use it). Dependencies are the other modules it uses. */ - grub_printf_ (N_("Name\tRef Count\tDependencies\n")); + VasEBoot_printf_ (N_("Name\tRef Count\tDependencies\n")); FOR_DL_MODULES (mod) { - grub_dl_dep_t dep; + VasEBoot_dl_dep_t dep; - grub_printf ("%s\t%d\t\t", mod->name, mod->ref_count); + VasEBoot_printf ("%s\t%d\t\t", mod->name, mod->ref_count); for (dep = mod->dep; dep; dep = dep->next) { if (dep != mod->dep) - grub_xputs (","); + VasEBoot_xputs (","); - grub_printf ("%s", dep->mod->name); + VasEBoot_printf ("%s", dep->mod->name); } - grub_xputs ("\n"); + VasEBoot_xputs ("\n"); } return 0; } /* exit */ -static grub_err_t __attribute__ ((noreturn)) -grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t __attribute__ ((noreturn)) +VasEBoot_mini_cmd_exit (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_exit (); + VasEBoot_exit (); /* Not reached. */ } -static grub_command_t cmd_cat, cmd_help; -static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit; +static VasEBoot_command_t cmd_cat, cmd_help; +static VasEBoot_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit; -GRUB_MOD_INIT(minicmd) +VasEBoot_MOD_INIT(minicmd) { cmd_cat = - grub_register_command ("cat", grub_mini_cmd_cat, + VasEBoot_register_command ("cat", VasEBoot_mini_cmd_cat, N_("FILE"), N_("Show the contents of a file.")); cmd_help = - grub_register_command ("help", grub_mini_cmd_help, + VasEBoot_register_command ("help", VasEBoot_mini_cmd_help, 0, N_("Show this message.")); cmd_dump = - grub_register_command ("dump", grub_mini_cmd_dump, + VasEBoot_register_command ("dump", VasEBoot_mini_cmd_dump, N_("ADDR [SIZE]"), N_("Show memory contents.")); cmd_rmmod = - grub_register_command ("rmmod", grub_mini_cmd_rmmod, + VasEBoot_register_command ("rmmod", VasEBoot_mini_cmd_rmmod, N_("MODULE"), N_("Remove a module.")); cmd_lsmod = - grub_register_command ("lsmod", grub_mini_cmd_lsmod, + VasEBoot_register_command ("lsmod", VasEBoot_mini_cmd_lsmod, 0, N_("Show loaded modules.")); cmd_exit = - grub_register_command ("exit", grub_mini_cmd_exit, - 0, N_("Exit from GRUB.")); + VasEBoot_register_command ("exit", VasEBoot_mini_cmd_exit, + 0, N_("Exit from VasEBoot.")); } -GRUB_MOD_FINI(minicmd) +VasEBoot_MOD_FINI(minicmd) { - grub_unregister_command (cmd_cat); - grub_unregister_command (cmd_help); - grub_unregister_command (cmd_dump); - grub_unregister_command (cmd_rmmod); - grub_unregister_command (cmd_lsmod); - grub_unregister_command (cmd_exit); + VasEBoot_unregister_command (cmd_cat); + VasEBoot_unregister_command (cmd_help); + VasEBoot_unregister_command (cmd_dump); + VasEBoot_unregister_command (cmd_rmmod); + VasEBoot_unregister_command (cmd_lsmod); + VasEBoot_unregister_command (cmd_exit); } diff --git a/VasEBoot-core/commands/mips/loongson/lsspd.c b/VasEBoot-core/commands/mips/loongson/lsspd.c index a88ab87ac..bb9f35cd9 100644 --- a/VasEBoot-core/commands/mips/loongson/lsspd.c +++ b/VasEBoot-core/commands/mips/loongson/lsspd.c @@ -1,103 +1,103 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_lsspd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsspd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_pci_device_t dev; - grub_port_t smbbase; + VasEBoot_pci_device_t dev; + VasEBoot_port_t smbbase; int i; - grub_err_t err; + VasEBoot_err_t err; - if (!grub_cs5536_find (&dev)) + if (!VasEBoot_cs5536_find (&dev)) { - grub_puts_ (N_("No CS5536 found")); - return GRUB_ERR_NONE; + VasEBoot_puts_ (N_("No CS5536 found")); + return VasEBoot_ERR_NONE; } - grub_printf_ (N_("CS5536 at %d:%d.%d\n"), grub_pci_get_bus (dev), - grub_pci_get_device (dev), grub_pci_get_function (dev)); + VasEBoot_printf_ (N_("CS5536 at %d:%d.%d\n"), VasEBoot_pci_get_bus (dev), + VasEBoot_pci_get_device (dev), VasEBoot_pci_get_function (dev)); - err = grub_cs5536_init_smbus (dev, 0x7fff, &smbbase); + err = VasEBoot_cs5536_init_smbus (dev, 0x7fff, &smbbase); if (err) return err; /* TRANSLATORS: System management bus is often used to access components like RAM (info only, not data) or batteries. I/O space is where in memory its ports are. */ - grub_printf_ (N_("System management bus controller I/O space is at 0x%x\n"), + VasEBoot_printf_ (N_("System management bus controller I/O space is at 0x%x\n"), smbbase); - for (i = GRUB_SMB_RAM_START_ADDR; - i < GRUB_SMB_RAM_START_ADDR + GRUB_SMB_RAM_NUM_MAX; i++) + for (i = VasEBoot_SMB_RAM_START_ADDR; + i < VasEBoot_SMB_RAM_START_ADDR + VasEBoot_SMB_RAM_NUM_MAX; i++) { - struct grub_smbus_spd spd; - grub_memset (&spd, 0, sizeof (spd)); + struct VasEBoot_smbus_spd spd; + VasEBoot_memset (&spd, 0, sizeof (spd)); /* TRANSLATORS: it's shown in a report in a way like number 1: ... number 2: ... */ - grub_printf_ (N_("RAM slot number %d\n"), i); - err = grub_cs5536_read_spd (smbbase, i, &spd); + VasEBoot_printf_ (N_("RAM slot number %d\n"), i); + err = VasEBoot_cs5536_read_spd (smbbase, i, &spd); if (err) { - grub_print_error (); + VasEBoot_print_error (); continue; } - grub_printf_ (N_("Written SPD bytes: %d B.\n"), spd.written_size); - grub_printf_ (N_("Total flash size: %d B.\n"), + VasEBoot_printf_ (N_("Written SPD bytes: %d B.\n"), spd.written_size); + VasEBoot_printf_ (N_("Total flash size: %d B.\n"), 1 << spd.log_total_flash_size); - if (spd.memory_type == GRUB_SMBUS_SPD_MEMORY_TYPE_DDR2) + if (spd.memory_type == VasEBoot_SMBUS_SPD_MEMORY_TYPE_DDR2) { char str[sizeof (spd.ddr2.part_number) + 1]; - grub_puts_ (N_("Memory type: DDR2.")); - grub_memcpy (str, spd.ddr2.part_number, + VasEBoot_puts_ (N_("Memory type: DDR2.")); + VasEBoot_memcpy (str, spd.ddr2.part_number, sizeof (spd.ddr2.part_number)); str[sizeof (spd.ddr2.part_number)] = 0; - grub_printf_ (N_("Part no: %s.\n"), str); + VasEBoot_printf_ (N_("Part no: %s.\n"), str); } else - grub_puts_ (N_("Memory type: Unknown.")); + VasEBoot_puts_ (N_("Memory type: Unknown.")); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(lsspd) +VasEBoot_MOD_INIT(lsspd) { - cmd = grub_register_command ("lsspd", grub_cmd_lsspd, 0, + cmd = VasEBoot_register_command ("lsspd", VasEBoot_cmd_lsspd, 0, N_("Print Memory information.")); } -GRUB_MOD_FINI(lsspd) +VasEBoot_MOD_FINI(lsspd) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/nativedisk.c b/VasEBoot-core/commands/nativedisk.c index 2f56a870e..1121ed2eb 100644 --- a/VasEBoot-core/commands/nativedisk.c +++ b/VasEBoot-core/commands/nativedisk.c @@ -1,125 +1,125 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static const char *modnames_def[] = { /* FIXME: autogenerate this. */ -#if defined (__i386__) || defined (__x86_64__) || defined (GRUB_MACHINE_MIPS_LOONGSON) +#if defined (__i386__) || defined (__x86_64__) || defined (VasEBoot_MACHINE_MIPS_LOONGSON) "pata", "ahci", "usbms", "ohci", "uhci", "ehci" -#elif defined (GRUB_MACHINE_MIPS_QEMU_MIPS) +#elif defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) "pata" #else #error "Fill this" #endif }; -static grub_err_t +static VasEBoot_err_t get_uuid (const char *name, char **uuid, int getnative) { - grub_device_t dev; - grub_fs_t fs = 0; + VasEBoot_device_t dev; + VasEBoot_fs_t fs = 0; *uuid = 0; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (!dev) - return grub_errno; + return VasEBoot_errno; if (!dev->disk) { - grub_dprintf ("nativedisk", "Skipping non-disk\n"); - grub_device_close (dev); + VasEBoot_dprintf ("nativedisk", "Skipping non-disk\n"); + VasEBoot_device_close (dev); return 0; } switch (dev->disk->dev->id) { /* Firmware disks. */ - case GRUB_DISK_DEVICE_BIOSDISK_ID: - case GRUB_DISK_DEVICE_OFDISK_ID: - case GRUB_DISK_DEVICE_EFIDISK_ID: - case GRUB_DISK_DEVICE_NAND_ID: - case GRUB_DISK_DEVICE_ARCDISK_ID: - case GRUB_DISK_DEVICE_HOSTDISK_ID: - case GRUB_DISK_DEVICE_UBOOTDISK_ID: + case VasEBoot_DISK_DEVICE_BIOSDISK_ID: + case VasEBoot_DISK_DEVICE_OFDISK_ID: + case VasEBoot_DISK_DEVICE_EFIDISK_ID: + case VasEBoot_DISK_DEVICE_NAND_ID: + case VasEBoot_DISK_DEVICE_ARCDISK_ID: + case VasEBoot_DISK_DEVICE_HOSTDISK_ID: + case VasEBoot_DISK_DEVICE_UBOOTDISK_ID: break; /* Native disks. */ - case GRUB_DISK_DEVICE_ATA_ID: - case GRUB_DISK_DEVICE_SCSI_ID: - case GRUB_DISK_DEVICE_XEN: + case VasEBoot_DISK_DEVICE_ATA_ID: + case VasEBoot_DISK_DEVICE_SCSI_ID: + case VasEBoot_DISK_DEVICE_XEN: if (getnative) break; /* FALLTHROUGH */ /* Virtual disks. */ - /* GRUB dynamically generated files. */ - case GRUB_DISK_DEVICE_PROCFS_ID: - /* To access through host OS routines (grub-emu only). */ - case GRUB_DISK_DEVICE_HOST_ID: + /* VasEBoot dynamically generated files. */ + case VasEBoot_DISK_DEVICE_PROCFS_ID: + /* To access through host OS routines (VasEBoot-emu only). */ + case VasEBoot_DISK_DEVICE_HOST_ID: /* To access coreboot roms. */ - case GRUB_DISK_DEVICE_CBFSDISK_ID: - /* GRUB-only memdisk. Can't match any of firmware devices. */ - case GRUB_DISK_DEVICE_MEMDISK_ID: - grub_dprintf ("nativedisk", "Skipping native disk %s\n", + case VasEBoot_DISK_DEVICE_CBFSDISK_ID: + /* VasEBoot-only memdisk. Can't match any of firmware devices. */ + case VasEBoot_DISK_DEVICE_MEMDISK_ID: + VasEBoot_dprintf ("nativedisk", "Skipping native disk %s\n", dev->disk->name); - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; /* FIXME: those probably need special handling. */ - case GRUB_DISK_DEVICE_LOOPBACK_ID: - case GRUB_DISK_DEVICE_DISKFILTER_ID: - case GRUB_DISK_DEVICE_CRYPTODISK_ID: + case VasEBoot_DISK_DEVICE_LOOPBACK_ID: + case VasEBoot_DISK_DEVICE_DISKFILTER_ID: + case VasEBoot_DISK_DEVICE_CRYPTODISK_ID: break; } if (dev) - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (!fs) { - grub_device_close (dev); - return grub_errno; + VasEBoot_device_close (dev); + return VasEBoot_errno; } if (!fs->uuid || fs->uuid (dev, uuid) || !*uuid) { - grub_device_close (dev); + VasEBoot_device_close (dev); - if (!grub_errno) - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("%s does not support UUIDs"), fs->name); - return grub_errno; + return VasEBoot_errno; } - grub_device_close (dev); - return GRUB_ERR_NONE; + VasEBoot_device_close (dev); + return VasEBoot_ERR_NONE; } struct search_ctx @@ -138,39 +138,39 @@ iterate_device (const char *name, void *data) if (get_uuid (name, &cur_uuid, 1)) { - if (grub_errno == GRUB_ERR_UNKNOWN_FS) - grub_errno = 0; - grub_print_error (); + if (VasEBoot_errno == VasEBoot_ERR_UNKNOWN_FS) + VasEBoot_errno = 0; + VasEBoot_print_error (); return 0; } - grub_dprintf ("nativedisk", "checking %s: %s\n", name, + VasEBoot_dprintf ("nativedisk", "checking %s: %s\n", name, cur_uuid); - if (ctx->prefix_uuid && grub_strcasecmp (cur_uuid, ctx->prefix_uuid) == 0) + if (ctx->prefix_uuid && VasEBoot_strcasecmp (cur_uuid, ctx->prefix_uuid) == 0) { char *prefix; - prefix = grub_xasprintf ("(%s)/%s", name, ctx->prefix_path); - grub_env_set ("prefix", prefix); - grub_free (prefix); + prefix = VasEBoot_xasprintf ("(%s)/%s", name, ctx->prefix_path); + VasEBoot_env_set ("prefix", prefix); + VasEBoot_free (prefix); ctx->prefix_found = 1; } - if (ctx->root_uuid && grub_strcasecmp (cur_uuid, ctx->root_uuid) == 0) + if (ctx->root_uuid && VasEBoot_strcasecmp (cur_uuid, ctx->root_uuid) == 0) { - grub_env_set ("root", name); + VasEBoot_env_set ("root", name); ctx->root_found = 1; } return ctx->prefix_found && ctx->root_found; } -static grub_err_t -grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_nativedisk (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args_in) { char *uuid_root = 0, *uuid_prefix, *prefdev = 0; const char *prefix = 0; const char *path_prefix = 0; int mods_loaded = 0; - grub_dl_t *mods; + VasEBoot_dl_t *mods; const char **args; int i; @@ -182,105 +182,105 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), else args = (const char **) args_in; - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); if (! prefix) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); if (prefix) - path_prefix = (prefix[0] == '(') ? grub_strchr (prefix, ')') : NULL; + path_prefix = (prefix[0] == '(') ? VasEBoot_strchr (prefix, ')') : NULL; if (path_prefix) path_prefix++; else path_prefix = prefix; - mods = grub_malloc (argc * sizeof (mods[0])); + mods = VasEBoot_malloc (argc * sizeof (mods[0])); if (!mods) - return grub_errno; + return VasEBoot_errno; if (get_uuid (NULL, &uuid_root, 0)) { - grub_free (mods); - return grub_errno; + VasEBoot_free (mods); + return VasEBoot_errno; } - prefdev = grub_file_get_device_name (prefix); - if (grub_errno) + prefdev = VasEBoot_file_get_device_name (prefix); + if (VasEBoot_errno) { - grub_print_error (); + VasEBoot_print_error (); prefdev = 0; } if (get_uuid (prefdev, &uuid_prefix, 0)) { - grub_free (uuid_root); - grub_free (prefdev); - grub_free (mods); - return grub_errno; + VasEBoot_free (uuid_root); + VasEBoot_free (prefdev); + VasEBoot_free (mods); + return VasEBoot_errno; } - grub_dprintf ("nativedisk", "uuid_prefix = %s, uuid_root = %s\n", + VasEBoot_dprintf ("nativedisk", "uuid_prefix = %s, uuid_root = %s\n", uuid_prefix, uuid_root); for (mods_loaded = 0; mods_loaded < argc; mods_loaded++) { char *filename; - grub_dl_t mod; - grub_file_t file = NULL; - grub_ssize_t size; + VasEBoot_dl_t mod; + VasEBoot_file_t file = NULL; + VasEBoot_ssize_t size; void *core = 0; - mod = grub_dl_get (args[mods_loaded]); + mod = VasEBoot_dl_get (args[mods_loaded]); if (mod) { mods[mods_loaded] = 0; continue; } - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM "/%s.mod", + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/%s.mod", prefix, args[mods_loaded]); if (! filename) goto fail; - file = grub_file_open (filename); - grub_free (filename); + file = VasEBoot_file_open (filename); + VasEBoot_free (filename); if (! file) goto fail; - size = grub_file_size (file); - core = grub_malloc (size); + size = VasEBoot_file_size (file); + core = VasEBoot_malloc (size); if (! core) { - grub_file_close (file); + VasEBoot_file_close (file); goto fail; } - if (grub_file_read (file, core, size) != (grub_ssize_t) size) + if (VasEBoot_file_read (file, core, size) != (VasEBoot_ssize_t) size) { - grub_file_close (file); - grub_free (core); + VasEBoot_file_close (file); + VasEBoot_free (core); goto fail; } - grub_file_close (file); + VasEBoot_file_close (file); - mods[mods_loaded] = grub_dl_load_core_noinit (core, size); + mods[mods_loaded] = VasEBoot_dl_load_core_noinit (core, size); if (! mods[mods_loaded]) goto fail; } for (i = 0; i < argc; i++) if (mods[i]) - grub_dl_init (mods[i]); + VasEBoot_dl_init (mods[i]); if (uuid_prefix || uuid_root) { struct search_ctx ctx; - grub_fs_autoload_hook_t saved_autoload; + VasEBoot_fs_autoload_hook_t saved_autoload; /* No need to autoload FS since obviously we already have the necessary fs modules. */ - saved_autoload = grub_fs_autoload_hook; - grub_fs_autoload_hook = 0; + saved_autoload = VasEBoot_fs_autoload_hook; + VasEBoot_fs_autoload_hook = 0; ctx.root_uuid = uuid_root; ctx.prefix_uuid = uuid_prefix; @@ -289,42 +289,42 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), ctx.root_found = !uuid_root; /* FIXME: try to guess the correct values. */ - grub_device_iterate (iterate_device, &ctx); + VasEBoot_device_iterate (iterate_device, &ctx); - grub_fs_autoload_hook = saved_autoload; + VasEBoot_fs_autoload_hook = saved_autoload; } - grub_free (uuid_root); - grub_free (uuid_prefix); - grub_free (prefdev); - grub_free (mods); + VasEBoot_free (uuid_root); + VasEBoot_free (uuid_prefix); + VasEBoot_free (prefdev); + VasEBoot_free (mods); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (uuid_root); - grub_free (uuid_prefix); - grub_free (prefdev); + VasEBoot_free (uuid_root); + VasEBoot_free (uuid_prefix); + VasEBoot_free (prefdev); for (i = 0; i < mods_loaded; i++) if (mods[i]) { mods[i]->fini = 0; - grub_dl_unload (mods[i]); + VasEBoot_dl_unload (mods[i]); } - grub_free (mods); + VasEBoot_free (mods); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(nativedisk) +VasEBoot_MOD_INIT(nativedisk) { - cmd = grub_register_command ("nativedisk", grub_cmd_nativedisk, N_("[MODULE1 MODULE2 ...]"), + cmd = VasEBoot_register_command ("nativedisk", VasEBoot_cmd_nativedisk, N_("[MODULE1 MODULE2 ...]"), N_("Switch to native disk drivers. If no modules are specified default set (pata,ahci,usbms,ohci,uhci,ehci) is used")); } -GRUB_MOD_FINI(nativedisk) +VasEBoot_MOD_FINI(nativedisk) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/parttool.c b/VasEBoot-core/commands/parttool.c index 693e2cb42..579878b98 100644 --- a/VasEBoot-core/commands/parttool.c +++ b/VasEBoot-core/commands/parttool.c @@ -1,6 +1,6 @@ /* parttool.c - common dispatcher and parser for partition operations */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -18,50 +18,50 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv2+"); +VasEBoot_MOD_LICENSE ("GPLv2+"); -static struct grub_parttool *parts = 0; +static struct VasEBoot_parttool *parts = 0; static int curhandle = 0; -static grub_dl_t mymod; +static VasEBoot_dl_t mymod; static char helpmsg[] = N_("Perform COMMANDS on partition.\n" "Use `parttool PARTITION help' for the list " "of available commands."); int -grub_parttool_register(const char *part_name, - const grub_parttool_function_t func, - const struct grub_parttool_argdesc *args) +VasEBoot_parttool_register(const char *part_name, + const VasEBoot_parttool_function_t func, + const struct VasEBoot_parttool_argdesc *args) { - struct grub_parttool *cur; + struct VasEBoot_parttool *cur; int nargs = 0; if (! parts) - grub_dl_ref (mymod); + VasEBoot_dl_ref (mymod); - cur = (struct grub_parttool *) grub_malloc (sizeof (struct grub_parttool)); + cur = (struct VasEBoot_parttool *) VasEBoot_malloc (sizeof (struct VasEBoot_parttool)); cur->next = parts; - cur->name = grub_strdup (part_name); + cur->name = VasEBoot_strdup (part_name); cur->handle = curhandle++; for (nargs = 0; args[nargs].name != 0; nargs++); cur->nargs = nargs; - cur->args = (struct grub_parttool_argdesc *) - grub_malloc ((nargs + 1) * sizeof (struct grub_parttool_argdesc)); - grub_memcpy (cur->args, args, - (nargs + 1) * sizeof (struct grub_parttool_argdesc)); + cur->args = (struct VasEBoot_parttool_argdesc *) + VasEBoot_malloc ((nargs + 1) * sizeof (struct VasEBoot_parttool_argdesc)); + VasEBoot_memcpy (cur->args, args, + (nargs + 1) * sizeof (struct VasEBoot_parttool_argdesc)); cur->func = func; parts = cur; @@ -69,21 +69,21 @@ grub_parttool_register(const char *part_name, } void -grub_parttool_unregister (int handle) +VasEBoot_parttool_unregister (int handle) { - struct grub_parttool *prev = 0, *cur, *t; + struct VasEBoot_parttool *prev = 0, *cur, *t; for (cur = parts; cur; ) if (cur->handle == handle) { - grub_free (cur->args); - grub_free (cur->name); + VasEBoot_free (cur->args); + VasEBoot_free (cur->name); if (prev) prev->next = cur->next; else parts = cur->next; t = cur; cur = cur->next; - grub_free (t); + VasEBoot_free (t); } else { @@ -91,129 +91,129 @@ grub_parttool_unregister (int handle) cur = cur->next; } if (! parts) - grub_dl_unref (mymod); + VasEBoot_dl_unref (mymod); } -static grub_err_t -show_help (grub_device_t dev) +static VasEBoot_err_t +show_help (VasEBoot_device_t dev) { int found = 0; - struct grub_parttool *cur; + struct VasEBoot_parttool *cur; for (cur = parts; cur; cur = cur->next) - if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) + if (VasEBoot_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) { - struct grub_parttool_argdesc *curarg; + struct VasEBoot_parttool_argdesc *curarg; found = 1; for (curarg = cur->args; curarg->name; curarg++) { int spacing = 20; - spacing -= grub_strlen (curarg->name); - grub_printf ("%s", curarg->name); + spacing -= VasEBoot_strlen (curarg->name); + VasEBoot_printf ("%s", curarg->name); switch (curarg->type) { - case GRUB_PARTTOOL_ARG_BOOL: - grub_printf ("+/-"); + case VasEBoot_PARTTOOL_ARG_BOOL: + VasEBoot_printf ("+/-"); spacing -= 3; break; - case GRUB_PARTTOOL_ARG_VAL: - grub_xputs (_("=VAL")); + case VasEBoot_PARTTOOL_ARG_VAL: + VasEBoot_xputs (_("=VAL")); spacing -= 4; break; - case GRUB_PARTTOOL_ARG_END: + case VasEBoot_PARTTOOL_ARG_END: break; } while (spacing-- > 0) - grub_printf (" "); - grub_puts_ (curarg->desc); + VasEBoot_printf (" "); + VasEBoot_puts_ (curarg->desc); } } if (! found) - grub_printf_ (N_("Sorry, no parttool is available for %s\n"), + VasEBoot_printf_ (N_("Sorry, no parttool is available for %s\n"), dev->disk->partition->partmap->name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_parttool (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_device_t dev; - struct grub_parttool *cur, *ptool; + VasEBoot_device_t dev; + struct VasEBoot_parttool *cur, *ptool; int *parsed; int i, j; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; if (argc < 1) { - grub_puts_ (helpmsg); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); + VasEBoot_puts_ (helpmsg); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "too few arguments"); } - if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') + if (args[0][0] == '(' && args[0][VasEBoot_strlen (args[0]) - 1] == ')') { - args[0][grub_strlen (args[0]) - 1] = 0; - dev = grub_device_open (args[0] + 1); - args[0][grub_strlen (args[0]) - 1] = ')'; + args[0][VasEBoot_strlen (args[0]) - 1] = 0; + dev = VasEBoot_device_open (args[0] + 1); + args[0][VasEBoot_strlen (args[0]) - 1] = ')'; } else - dev = grub_device_open (args[0]); + dev = VasEBoot_device_open (args[0]); if (! dev) - return grub_errno; + return VasEBoot_errno; if (! dev->disk) { - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a disk"); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not a disk"); } if (! dev->disk->partition) { - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a partition"); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not a partition"); } /* Load modules. */ - if (! grub_no_modules) + if (! VasEBoot_no_modules) { const char *prefix; - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); if (prefix) { char *filename; - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/parttool.lst", prefix); if (filename) { - grub_file_t file; + VasEBoot_file_t file; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (file) { char *buf = 0; - for (;; grub_free(buf)) + for (;; VasEBoot_free(buf)) { char *p, *name; - buf = grub_file_getline (file); + buf = VasEBoot_file_getline (file); if (! buf) break; name = buf; - while (grub_isspace (name[0])) + while (VasEBoot_isspace (name[0])) name++; - if (! grub_isgraph (name[0])) + if (! VasEBoot_isgraph (name[0])) continue; - p = grub_strchr (name, ':'); + p = VasEBoot_strchr (name, ':'); if (! p) continue; @@ -222,60 +222,60 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), while (*p == ' ' || *p == '\t') p++; - if (! grub_isgraph (*p)) + if (! VasEBoot_isgraph (*p)) continue; - if (grub_strcmp (name, dev->disk->partition->partmap->name) + if (VasEBoot_strcmp (name, dev->disk->partition->partmap->name) != 0) continue; - grub_dl_load (p); + VasEBoot_dl_load (p); } - grub_file_close (file); + VasEBoot_file_close (file); } - grub_free (filename); + VasEBoot_free (filename); } } /* Ignore errors. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (argc == 1) { err = show_help (dev); - grub_device_close (dev); + VasEBoot_device_close (dev); return err; } for (i = 1; i < argc; i++) - if (grub_strcmp (args[i], "help") == 0) + if (VasEBoot_strcmp (args[i], "help") == 0) { err = show_help (dev); - grub_device_close (dev); + VasEBoot_device_close (dev); return err; } - parsed = (int *) grub_zalloc (argc * sizeof (int)); + parsed = (int *) VasEBoot_zalloc (argc * sizeof (int)); for (i = 1; i < argc; i++) if (! parsed[i]) { - struct grub_parttool_argdesc *curarg; - struct grub_parttool_args *pargs; + struct VasEBoot_parttool_argdesc *curarg; + struct VasEBoot_parttool_args *pargs; for (cur = parts; cur; cur = cur->next) - if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) + if (VasEBoot_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) { for (curarg = cur->args; curarg->name; curarg++) - if (grub_strncmp (curarg->name, args[i], - grub_strlen (curarg->name)) == 0 - && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL - && (args[i][grub_strlen (curarg->name)] == '+' - || args[i][grub_strlen (curarg->name)] == '-' - || args[i][grub_strlen (curarg->name)] == 0)) - || (curarg->type == GRUB_PARTTOOL_ARG_VAL - && args[i][grub_strlen (curarg->name)] == '='))) + if (VasEBoot_strncmp (curarg->name, args[i], + VasEBoot_strlen (curarg->name)) == 0 + && ((curarg->type == VasEBoot_PARTTOOL_ARG_BOOL + && (args[i][VasEBoot_strlen (curarg->name)] == '+' + || args[i][VasEBoot_strlen (curarg->name)] == '-' + || args[i][VasEBoot_strlen (curarg->name)] == 0)) + || (curarg->type == VasEBoot_PARTTOOL_ARG_VAL + && args[i][VasEBoot_strlen (curarg->name)] == '='))) break; if (curarg->name) @@ -283,69 +283,69 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), } if (! cur) { - grub_free (parsed); - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), + VasEBoot_free (parsed); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), args[i]); } ptool = cur; - pargs = (struct grub_parttool_args *) - grub_zalloc (ptool->nargs * sizeof (struct grub_parttool_args)); + pargs = (struct VasEBoot_parttool_args *) + VasEBoot_zalloc (ptool->nargs * sizeof (struct VasEBoot_parttool_args)); for (j = i; j < argc; j++) if (! parsed[j]) { for (curarg = ptool->args; curarg->name; curarg++) - if (grub_strncmp (curarg->name, args[j], - grub_strlen (curarg->name)) == 0 - && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL - && (args[j][grub_strlen (curarg->name)] == '+' - || args[j][grub_strlen (curarg->name)] == '-' - || args[j][grub_strlen (curarg->name)] == 0)) - || (curarg->type == GRUB_PARTTOOL_ARG_VAL - && args[j][grub_strlen (curarg->name)] == '='))) + if (VasEBoot_strncmp (curarg->name, args[j], + VasEBoot_strlen (curarg->name)) == 0 + && ((curarg->type == VasEBoot_PARTTOOL_ARG_BOOL + && (args[j][VasEBoot_strlen (curarg->name)] == '+' + || args[j][VasEBoot_strlen (curarg->name)] == '-' + || args[j][VasEBoot_strlen (curarg->name)] == 0)) + || (curarg->type == VasEBoot_PARTTOOL_ARG_VAL + && args[j][VasEBoot_strlen (curarg->name)] == '='))) { parsed[j] = 1; pargs[curarg - ptool->args].set = 1; switch (curarg->type) { - case GRUB_PARTTOOL_ARG_BOOL: + case VasEBoot_PARTTOOL_ARG_BOOL: pargs[curarg - ptool->args].bool - = (args[j][grub_strlen (curarg->name)] != '-'); + = (args[j][VasEBoot_strlen (curarg->name)] != '-'); break; - case GRUB_PARTTOOL_ARG_VAL: + case VasEBoot_PARTTOOL_ARG_VAL: pargs[curarg - ptool->args].str - = (args[j] + grub_strlen (curarg->name) + 1); + = (args[j] + VasEBoot_strlen (curarg->name) + 1); break; - case GRUB_PARTTOOL_ARG_END: + case VasEBoot_PARTTOOL_ARG_END: break; } } } err = ptool->func (dev, pargs); - grub_free (pargs); + VasEBoot_free (pargs); if (err) break; } - grub_free (parsed); - grub_device_close (dev); + VasEBoot_free (parsed); + VasEBoot_device_close (dev); return err; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(parttool) +VasEBoot_MOD_INIT(parttool) { mymod = mod; - cmd = grub_register_command ("parttool", grub_cmd_parttool, + cmd = VasEBoot_register_command ("parttool", VasEBoot_cmd_parttool, N_("PARTITION COMMANDS"), helpmsg); } -GRUB_MOD_FINI(parttool) +VasEBoot_MOD_FINI(parttool) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/password.c b/VasEBoot-core/commands/password.c index 6d42c9b02..e91622cdc 100644 --- a/VasEBoot-core/commands/password.c +++ b/VasEBoot-core/commands/password.c @@ -1,93 +1,93 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_err_t +static VasEBoot_err_t check_password (const char *user, const char *entered, void *password) { - if (grub_crypto_memcmp (entered, password, GRUB_AUTH_MAX_PASSLEN) != 0) - return GRUB_ACCESS_DENIED; + if (VasEBoot_crypto_memcmp (entered, password, VasEBoot_AUTH_MAX_PASSLEN) != 0) + return VasEBoot_ACCESS_DENIED; - grub_auth_authenticate (user); + VasEBoot_auth_authenticate (user); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_normal_set_password (const char *user, const char *password) +VasEBoot_err_t +VasEBoot_normal_set_password (const char *user, const char *password) { - grub_err_t err; + VasEBoot_err_t err; char *pass; int copylen; - pass = grub_zalloc (GRUB_AUTH_MAX_PASSLEN); + pass = VasEBoot_zalloc (VasEBoot_AUTH_MAX_PASSLEN); if (!pass) - return grub_errno; - copylen = grub_strlen (password); - if (copylen >= GRUB_AUTH_MAX_PASSLEN) - copylen = GRUB_AUTH_MAX_PASSLEN - 1; - grub_memcpy (pass, password, copylen); + return VasEBoot_errno; + copylen = VasEBoot_strlen (password); + if (copylen >= VasEBoot_AUTH_MAX_PASSLEN) + copylen = VasEBoot_AUTH_MAX_PASSLEN - 1; + VasEBoot_memcpy (pass, password, copylen); - err = grub_auth_register_authentication (user, check_password, pass); + err = VasEBoot_auth_register_authentication (user, check_password, pass); if (err) { - grub_free (pass); + VasEBoot_free (pass); return err; } - grub_dl_ref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_ref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_password (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); - return grub_normal_set_password (args[0], args[1]); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_normal_set_password (args[0], args[1]); } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(password) +VasEBoot_MOD_INIT(password) { my_mod = mod; - cmd = grub_register_command ("password", grub_cmd_password, + cmd = VasEBoot_register_command ("password", VasEBoot_cmd_password, N_("USER PASSWORD"), N_("Set user password (plaintext). " "Unrecommended and insecure.")); } -GRUB_MOD_FINI(password) +VasEBoot_MOD_FINI(password) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/password_pbkdf2.c b/VasEBoot-core/commands/password_pbkdf2.c index da636e621..757d3b41f 100644 --- a/VasEBoot-core/commands/password_pbkdf2.c +++ b/VasEBoot-core/commands/password_pbkdf2.c @@ -1,71 +1,71 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; struct pbkdf2_password { - grub_uint8_t *salt; - grub_size_t saltlen; + VasEBoot_uint8_t *salt; + VasEBoot_size_t saltlen; unsigned int c; - grub_uint8_t *expected; - grub_size_t buflen; + VasEBoot_uint8_t *expected; + VasEBoot_size_t buflen; }; -static grub_err_t +static VasEBoot_err_t check_password (const char *user, const char *entered, void *pin) { - grub_uint8_t *buf; + VasEBoot_uint8_t *buf; struct pbkdf2_password *pass = pin; gcry_err_code_t err; - grub_err_t ret; + VasEBoot_err_t ret; - buf = grub_malloc (pass->buflen); + buf = VasEBoot_malloc (pass->buflen); if (!buf) - return grub_crypto_gcry_error (GPG_ERR_OUT_OF_MEMORY); + return VasEBoot_crypto_gcry_error (GPG_ERR_OUT_OF_MEMORY); - err = grub_crypto_pbkdf2 (GRUB_MD_SHA512, (grub_uint8_t *) entered, - grub_strlen (entered), + err = VasEBoot_crypto_pbkdf2 (VasEBoot_MD_SHA512, (VasEBoot_uint8_t *) entered, + VasEBoot_strlen (entered), pass->salt, pass->saltlen, pass->c, buf, pass->buflen); if (err) - ret = grub_crypto_gcry_error (err); - else if (grub_crypto_memcmp (buf, pass->expected, pass->buflen) != 0) - ret = GRUB_ACCESS_DENIED; + ret = VasEBoot_crypto_gcry_error (err); + else if (VasEBoot_crypto_memcmp (buf, pass->expected, pass->buflen) != 0) + ret = VasEBoot_ACCESS_DENIED; else { - grub_auth_authenticate (user); - ret = GRUB_ERR_NONE; + VasEBoot_auth_authenticate (user); + ret = VasEBoot_ERR_NONE; } - grub_free (buf); + VasEBoot_free (buf); return ret; } @@ -81,55 +81,55 @@ hex2val (char hex) return -1; } -static grub_err_t -grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_password (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_err_t err; + VasEBoot_err_t err; char *ptr, *ptr2; - grub_uint8_t *ptro; + VasEBoot_uint8_t *ptro; struct pbkdf2_password *pass; if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); - if (grub_memcmp (args[1], "grub.pbkdf2.sha512.", - sizeof ("grub.pbkdf2.sha512.") - 1) != 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); + if (VasEBoot_memcmp (args[1], "VasEBoot.pbkdf2.sha512.", + sizeof ("VasEBoot.pbkdf2.sha512.") - 1) != 0) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); - ptr = args[1] + sizeof ("grub.pbkdf2.sha512.") - 1; + ptr = args[1] + sizeof ("VasEBoot.pbkdf2.sha512.") - 1; - pass = grub_malloc (sizeof (*pass)); + pass = VasEBoot_malloc (sizeof (*pass)); if (!pass) - return grub_errno; + return VasEBoot_errno; - pass->c = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) + pass->c = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) { - grub_free (pass); - return grub_errno; + VasEBoot_free (pass); + return VasEBoot_errno; } if (*ptr != '.') { - grub_free (pass); - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); + VasEBoot_free (pass); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); } ptr++; - ptr2 = grub_strchr (ptr, '.'); - if (!ptr2 || ((ptr2 - ptr) & 1) || grub_strlen (ptr2 + 1) & 1) + ptr2 = VasEBoot_strchr (ptr, '.'); + if (!ptr2 || ((ptr2 - ptr) & 1) || VasEBoot_strlen (ptr2 + 1) & 1) { - grub_free (pass); - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); + VasEBoot_free (pass); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); } pass->saltlen = (ptr2 - ptr) >> 1; - pass->buflen = grub_strlen (ptr2 + 1) >> 1; - ptro = pass->salt = grub_malloc (pass->saltlen); + pass->buflen = VasEBoot_strlen (ptr2 + 1) >> 1; + ptro = pass->salt = VasEBoot_malloc (pass->saltlen); if (!ptro) { - grub_free (pass); - return grub_errno; + VasEBoot_free (pass); + return VasEBoot_errno; } while (ptr < ptr2) { @@ -140,9 +140,9 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), ptr++; if (hex1 < 0 || hex2 < 0) { - grub_free (pass->salt); - grub_free (pass); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_free (pass->salt); + VasEBoot_free (pass); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, /* TRANSLATORS: it means that the string which was supposed to be a password hash doesn't have a correct format, not to password @@ -154,15 +154,15 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), ptro++; } - ptro = pass->expected = grub_malloc (pass->buflen); + ptro = pass->expected = VasEBoot_malloc (pass->buflen); if (!ptro) { - grub_free (pass->salt); - grub_free (pass); - return grub_errno; + VasEBoot_free (pass->salt); + VasEBoot_free (pass); + return VasEBoot_errno; } ptr = ptr2 + 1; - ptr2 += grub_strlen (ptr2); + ptr2 += VasEBoot_strlen (ptr2); while (ptr < ptr2) { int hex1, hex2; @@ -172,10 +172,10 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), ptr++; if (hex1 < 0 || hex2 < 0) { - grub_free (pass->expected); - grub_free (pass->salt); - grub_free (pass); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_free (pass->expected); + VasEBoot_free (pass->salt); + VasEBoot_free (pass); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); } @@ -183,27 +183,27 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), ptro++; } - err = grub_auth_register_authentication (args[0], check_password, pass); + err = VasEBoot_auth_register_authentication (args[0], check_password, pass); if (err) { - grub_free (pass); + VasEBoot_free (pass); return err; } - grub_dl_ref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_ref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(password_pbkdf2) +VasEBoot_MOD_INIT(password_pbkdf2) { my_mod = mod; - cmd = grub_register_command ("password_pbkdf2", grub_cmd_password, + cmd = VasEBoot_register_command ("password_pbkdf2", VasEBoot_cmd_password, N_("USER PBKDF2_PASSWORD"), N_("Set user password (PBKDF2). ")); } -GRUB_MOD_FINI(password_pbkdf2) +VasEBoot_MOD_FINI(password_pbkdf2) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/pcidump.c b/VasEBoot-core/commands/pcidump.c index f99ad4a21..0e3b58463 100644 --- a/VasEBoot-core/commands/pcidump.c +++ b/VasEBoot-core/commands/pcidump.c @@ -1,40 +1,40 @@ /* lspci.c - List PCI devices. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct iter_cxt { - grub_uint32_t pciid_check_mask, pciid_check_value; + VasEBoot_uint32_t pciid_check_mask, pciid_check_value; int bus, device, function; int check_bus, check_device, check_function; }; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {0, 'd', 0, N_("Select device by vendor and device IDs."), N_("[vendor]:[device]"), ARG_TYPE_STRING}, @@ -44,38 +44,38 @@ static const struct grub_arg_option options[] = }; static int -grub_pcidump_iter (grub_pci_device_t dev, grub_pci_id_t pciid, +VasEBoot_pcidump_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { struct iter_cxt *ctx = data; - grub_pci_address_t addr; + VasEBoot_pci_address_t addr; int i; if ((pciid & ctx->pciid_check_mask) != ctx->pciid_check_value) return 0; - if (ctx->check_bus && grub_pci_get_bus (dev) != ctx->bus) + if (ctx->check_bus && VasEBoot_pci_get_bus (dev) != ctx->bus) return 0; - if (ctx->check_device && grub_pci_get_device (dev) != ctx->device) + if (ctx->check_device && VasEBoot_pci_get_device (dev) != ctx->device) return 0; - if (ctx->check_function && grub_pci_get_function (dev) != ctx->function) + if (ctx->check_function && VasEBoot_pci_get_function (dev) != ctx->function) return 0; for (i = 0; i < 256; i += 4) { - addr = grub_pci_make_address (dev, i); - grub_printf ("%08x ", grub_pci_read (addr)); + addr = VasEBoot_pci_make_address (dev, i); + VasEBoot_printf ("%08x ", VasEBoot_pci_read (addr)); if ((i & 0xc) == 0xc) - grub_printf ("\n"); + VasEBoot_printf ("\n"); } return 0; } -static grub_err_t -grub_cmd_pcidump (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_pcidump (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) { @@ -95,23 +95,23 @@ grub_cmd_pcidump (grub_extcmd_context_t ctxt, if (ctxt->state[0].set) { ptr = ctxt->state[0].arg; - ctx.pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + ctx.pciid_check_value |= (VasEBoot_strtoul (ptr, (char **) &ptr, 16) & 0xffff); + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ptr = ctxt->state[0].arg; } else ctx.pciid_check_mask |= 0xffff; - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr != ':') - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); ptr++; - ctx.pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff) + ctx.pciid_check_value |= (VasEBoot_strtoul (ptr, (char **) &ptr, 16) & 0xffff) << 16; - if (grub_errno == GRUB_ERR_BAD_NUMBER) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) + VasEBoot_errno = VasEBoot_ERR_NONE; else ctx.pciid_check_mask |= 0xffff0000; } @@ -124,24 +124,24 @@ grub_cmd_pcidump (grub_extcmd_context_t ctxt, ptr = ctxt->state[1].arg; optr = ptr; - ctx.bus = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + ctx.bus = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ptr = optr; } else ctx.check_bus = 1; - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr != ':') - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); ptr++; optr = ptr; - ctx.device = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + ctx.device = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ptr = optr; } else @@ -149,27 +149,27 @@ grub_cmd_pcidump (grub_extcmd_context_t ctxt, if (*ptr == '.') { ptr++; - ctx.function = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) - return grub_errno; + ctx.function = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) + return VasEBoot_errno; ctx.check_function = 1; } } - grub_pci_iterate (grub_pcidump_iter, &ctx); - return GRUB_ERR_NONE; + VasEBoot_pci_iterate (VasEBoot_pcidump_iter, &ctx); + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(pcidump) +VasEBoot_MOD_INIT(pcidump) { - cmd = grub_register_extcmd ("pcidump", grub_cmd_pcidump, 0, + cmd = VasEBoot_register_extcmd ("pcidump", VasEBoot_cmd_pcidump, 0, N_("[-s POSITION] [-d DEVICE]"), N_("Show raw dump of the PCI configuration space."), options); } -GRUB_MOD_FINI(pcidump) +VasEBoot_MOD_FINI(pcidump) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/probe.c b/VasEBoot-core/commands/probe.c index cf2793e1d..ded4c7ffa 100644 --- a/VasEBoot-core/commands/probe.c +++ b/VasEBoot-core/commands/probe.c @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"set", 's', 0, N_("Set a variable to return value."), N_("VARNAME"), ARG_TYPE_STRING}, @@ -48,29 +48,29 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_probe (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - grub_device_t dev; - grub_fs_t fs; + struct VasEBoot_arg_list *state = ctxt->state; + VasEBoot_device_t dev; + VasEBoot_fs_t fs; char *ptr; - grub_err_t err; + VasEBoot_err_t err; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "device name required"); - ptr = args[0] + grub_strlen (args[0]) - 1; + ptr = args[0] + VasEBoot_strlen (args[0]) - 1; if (args[0][0] == '(' && *ptr == ')') { *ptr = 0; - dev = grub_device_open (args[0] + 1); + dev = VasEBoot_device_open (args[0] + 1); *ptr = ')'; } else - dev = grub_device_open (args[0]); + dev = VasEBoot_device_open (args[0]); if (! dev) - return grub_errno; + return VasEBoot_errno; if (state[1].set) { @@ -80,11 +80,11 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args) if (dev->disk) val = dev->disk->dev->name; if (state[0].set) - grub_env_set (state[0].arg, val); + VasEBoot_env_set (state[0].arg, val); else - grub_printf ("%s", val); - grub_device_close (dev); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s", val); + VasEBoot_device_close (dev); + return VasEBoot_ERR_NONE; } if (state[2].set) { @@ -92,81 +92,81 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args) if (dev->disk && dev->disk->partition) val = dev->disk->partition->partmap->name; if (state[0].set) - grub_env_set (state[0].arg, val); + VasEBoot_env_set (state[0].arg, val); else - grub_printf ("%s", val); - grub_device_close (dev); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s", val); + VasEBoot_device_close (dev); + return VasEBoot_ERR_NONE; } - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) - return grub_errno; + return VasEBoot_errno; if (state[3].set) { if (state[0].set) - grub_env_set (state[0].arg, fs->name); + VasEBoot_env_set (state[0].arg, fs->name); else - grub_printf ("%s", fs->name); - grub_device_close (dev); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s", fs->name); + VasEBoot_device_close (dev); + return VasEBoot_ERR_NONE; } if (state[4].set) { char *uuid; if (! fs->uuid) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("%s does not support UUIDs"), fs->name); err = fs->uuid (dev, &uuid); if (err) return err; if (! uuid) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("%s does not support UUIDs"), fs->name); if (state[0].set) - grub_env_set (state[0].arg, uuid); + VasEBoot_env_set (state[0].arg, uuid); else - grub_printf ("%s", uuid); - grub_free (uuid); - grub_device_close (dev); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s", uuid); + VasEBoot_free (uuid); + VasEBoot_device_close (dev); + return VasEBoot_ERR_NONE; } if (state[5].set) { char *label; if (! fs->label) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("filesystem `%s' does not support labels"), fs->name); err = fs->label (dev, &label); if (err) return err; if (! label) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("filesystem `%s' does not support labels"), fs->name); if (state[0].set) - grub_env_set (state[0].arg, label); + VasEBoot_env_set (state[0].arg, label); else - grub_printf ("%s", label); - grub_free (label); - grub_device_close (dev); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s", label); + VasEBoot_free (label); + VasEBoot_device_close (dev); + return VasEBoot_ERR_NONE; } - grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised target"); + VasEBoot_device_close (dev); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unrecognised target"); } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT (probe) +VasEBoot_MOD_INIT (probe) { - cmd = grub_register_extcmd ("probe", grub_cmd_probe, 0, N_("DEVICE"), + cmd = VasEBoot_register_extcmd ("probe", VasEBoot_cmd_probe, 0, N_("DEVICE"), N_("Retrieve device info."), options); } -GRUB_MOD_FINI (probe) +VasEBoot_MOD_FINI (probe) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/read.c b/VasEBoot-core/commands/read.c index fe3e88b15..d03103362 100644 --- a/VasEBoot-core/commands/read.c +++ b/VasEBoot-core/commands/read.c @@ -1,35 +1,35 @@ /* read.c - Command to read variables from user. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static char * -grub_getline (void) +VasEBoot_getline (void) { int i; char *line; @@ -37,24 +37,24 @@ grub_getline (void) char c; i = 0; - line = grub_malloc (1 + i + sizeof('\0')); + line = VasEBoot_malloc (1 + i + sizeof('\0')); if (! line) return NULL; while (1) { - c = grub_getkey (); + c = VasEBoot_getkey (); if ((c == '\n') || (c == '\r')) break; line[i] = c; - if (grub_isprint (c)) - grub_printf ("%c", c); + if (VasEBoot_isprint (c)) + VasEBoot_printf ("%c", c); i++; - tmp = grub_realloc (line, 1 + i + sizeof('\0')); + tmp = VasEBoot_realloc (line, 1 + i + sizeof('\0')); if (! tmp) { - grub_free (line); + VasEBoot_free (line); return NULL; } line = tmp; @@ -64,29 +64,29 @@ grub_getline (void) return line; } -static grub_err_t -grub_cmd_read (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_read (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - char *line = grub_getline (); + char *line = VasEBoot_getline (); if (! line) - return grub_errno; + return VasEBoot_errno; if (argc > 0) - grub_env_set (args[0], line); + VasEBoot_env_set (args[0], line); - grub_free (line); + VasEBoot_free (line); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(read) +VasEBoot_MOD_INIT(read) { - cmd = grub_register_command ("read", grub_cmd_read, + cmd = VasEBoot_register_command ("read", VasEBoot_cmd_read, N_("[ENVVAR]"), N_("Set variable with user input.")); } -GRUB_MOD_FINI(read) +VasEBoot_MOD_FINI(read) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/reboot.c b/VasEBoot-core/commands/reboot.c index 46d364c99..377f2a898 100644 --- a/VasEBoot-core/commands/reboot.c +++ b/VasEBoot-core/commands/reboot.c @@ -1,46 +1,46 @@ /* reboot.c - command to reboot the computer. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t __attribute__ ((noreturn)) -grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t __attribute__ ((noreturn)) +VasEBoot_cmd_reboot (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_reboot (); + VasEBoot_reboot (); } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(reboot) +VasEBoot_MOD_INIT(reboot) { - cmd = grub_register_command ("reboot", grub_cmd_reboot, + cmd = VasEBoot_register_command ("reboot", VasEBoot_cmd_reboot, 0, N_("Reboot the computer.")); } -GRUB_MOD_FINI(reboot) +VasEBoot_MOD_FINI(reboot) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/regexp.c b/VasEBoot-core/commands/regexp.c index f00b184c8..dcdd4a278 100644 --- a/VasEBoot-core/commands/regexp.c +++ b/VasEBoot-core/commands/regexp.c @@ -1,37 +1,37 @@ /* regexp.c -- The regexp command. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { - { "set", 's', GRUB_ARG_OPTION_REPEATABLE, + { "set", 's', VasEBoot_ARG_OPTION_REPEATABLE, /* TRANSLATORS: in regexp you can mark some groups with parentheses. These groups are then numbered and you can save some of @@ -46,77 +46,77 @@ static const struct grub_arg_option options[] = { 0, 0, 0, 0, 0, 0 } }; -static grub_err_t +static VasEBoot_err_t setvar (char *str, char *v, regmatch_t *m) { char ch; - grub_err_t err; + VasEBoot_err_t err; ch = str[m->rm_eo]; str[m->rm_eo] = '\0'; - err = grub_env_set (v, str + m->rm_so); + err = VasEBoot_env_set (v, str + m->rm_so); str[m->rm_eo] = ch; return err; } -static grub_err_t -set_matches (char **varnames, char *str, grub_size_t nmatches, +static VasEBoot_err_t +set_matches (char **varnames, char *str, VasEBoot_size_t nmatches, regmatch_t *matches) { int i; char *p; char *q; - grub_err_t err; + VasEBoot_err_t err; unsigned long j; for (i = 0; varnames && varnames[i]; i++) { - err = GRUB_ERR_NONE; - p = grub_strchr (varnames[i], ':'); + err = VasEBoot_ERR_NONE; + p = VasEBoot_strchr (varnames[i], ':'); if (! p) { /* varname w/o index defaults to 1 */ if (nmatches < 2 || matches[1].rm_so == -1) - grub_env_unset (varnames[i]); + VasEBoot_env_unset (varnames[i]); else err = setvar (str, varnames[i], &matches[1]); } else { - j = grub_strtoul (varnames[i], &q, 10); + j = VasEBoot_strtoul (varnames[i], &q, 10); if (q != p) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid variable name format %s", varnames[i]); if (nmatches <= j || matches[j].rm_so == -1) - grub_env_unset (p + 1); + VasEBoot_env_unset (p + 1); else err = setvar (str, p + 1, &matches[j]); } - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_regexp (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_regexp (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { regex_t regex; int ret; - grub_size_t s; + VasEBoot_size_t s; char *comperr; - grub_err_t err; + VasEBoot_err_t err; regmatch_t *matches = 0; if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); ret = regcomp (®ex, args[0], REG_EXTENDED); if (ret) goto fail; - matches = grub_zalloc (sizeof (*matches) * (regex.re_nsub + 1)); + matches = VasEBoot_zalloc (sizeof (*matches) * (regex.re_nsub + 1)); if (! matches) goto fail; @@ -126,43 +126,43 @@ grub_cmd_regexp (grub_extcmd_context_t ctxt, int argc, char **args) err = set_matches (ctxt->state[0].args, args[1], regex.re_nsub + 1, matches); regfree (®ex); - grub_free (matches); + VasEBoot_free (matches); return err; } fail: - grub_free (matches); + VasEBoot_free (matches); s = regerror (ret, ®ex, 0, 0); - comperr = grub_malloc (s); + comperr = VasEBoot_malloc (s); if (!comperr) { regfree (®ex); - return grub_errno; + return VasEBoot_errno; } regerror (ret, ®ex, comperr, s); - err = grub_error (GRUB_ERR_TEST_FAILURE, "%s", comperr); + err = VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, "%s", comperr); regfree (®ex); - grub_free (comperr); + VasEBoot_free (comperr); return err; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(regexp) +VasEBoot_MOD_INIT(regexp) { - cmd = grub_register_extcmd ("regexp", grub_cmd_regexp, 0, + cmd = VasEBoot_register_extcmd ("regexp", VasEBoot_cmd_regexp, 0, /* TRANSLATORS: This are two arguments. So it's two separate units to translate and pay attention not to reverse them. */ N_("REGEXP STRING"), N_("Test if REGEXP matches STRING."), options); - /* Setup GRUB script wildcard translator. */ - grub_wildcard_translator = &grub_filename_translator; + /* Setup VasEBoot script wildcard translator. */ + VasEBoot_wildcard_translator = &VasEBoot_filename_translator; } -GRUB_MOD_FINI(regexp) +VasEBoot_MOD_FINI(regexp) { - grub_unregister_extcmd (cmd); - grub_wildcard_translator = 0; + VasEBoot_unregister_extcmd (cmd); + VasEBoot_wildcard_translator = 0; } diff --git a/VasEBoot-core/commands/search.c b/VasEBoot-core/commands/search.c index 83837b564..949344928 100644 --- a/VasEBoot-core/commands/search.c +++ b/VasEBoot-core/commands/search.c @@ -1,41 +1,41 @@ /* search.c - search devices based on a file or a filesystem label */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if defined(DO_SEARCH_PART_UUID) || defined(DO_SEARCH_PART_LABEL) || \ defined(DO_SEARCH_DISK_UUID) -#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct cache_entry { @@ -71,97 +71,97 @@ iterate_device (const char *name, void *data) return 1; #if defined(DO_SEARCH_FS_UUID) || defined(DO_SEARCH_DISK_UUID) -#define compare_fn grub_strcasecmp +#define compare_fn VasEBoot_strcasecmp #else -#define compare_fn grub_strcmp +#define compare_fn VasEBoot_strcmp #endif #ifdef DO_SEARCH_FILE { char *buf; - grub_file_t file; + VasEBoot_file_t file; - buf = grub_xasprintf ("(%s)%s", name, ctx->key); + buf = VasEBoot_xasprintf ("(%s)%s", name, ctx->key); if (! buf) return 1; - grub_file_filter_disable_compression (); - file = grub_file_open (buf); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (buf); if (file) { found = 1; - grub_file_close (file); + VasEBoot_file_close (file); } - grub_free (buf); + VasEBoot_free (buf); } #elif defined(DO_SEARCH_PART_UUID) { - grub_device_t dev; + VasEBoot_device_t dev; char *quid; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (dev) { - if (grub_gpt_part_uuid (dev, &quid) == GRUB_ERR_NONE) + if (VasEBoot_gpt_part_uuid (dev, &quid) == VasEBoot_ERR_NONE) { - if (grub_strcasecmp (quid, ctx->key) == 0) + if (VasEBoot_strcasecmp (quid, ctx->key) == 0) found = 1; - grub_free (quid); + VasEBoot_free (quid); } - grub_device_close (dev); + VasEBoot_device_close (dev); } } #elif defined(DO_SEARCH_PART_LABEL) { - grub_device_t dev; + VasEBoot_device_t dev; char *quid; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (dev) { - if (grub_gpt_part_label (dev, &quid) == GRUB_ERR_NONE) + if (VasEBoot_gpt_part_label (dev, &quid) == VasEBoot_ERR_NONE) { - if (grub_strcmp (quid, ctx->key) == 0) + if (VasEBoot_strcmp (quid, ctx->key) == 0) found = 1; - grub_free (quid); + VasEBoot_free (quid); } - grub_device_close (dev); + VasEBoot_device_close (dev); } } #elif defined(DO_SEARCH_DISK_UUID) { - grub_device_t dev; + VasEBoot_device_t dev; char *quid; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (dev) { - if (grub_gpt_disk_uuid (dev, &quid) == GRUB_ERR_NONE) + if (VasEBoot_gpt_disk_uuid (dev, &quid) == VasEBoot_ERR_NONE) { - if (grub_strcmp (quid, ctx->key) == 0) + if (VasEBoot_strcmp (quid, ctx->key) == 0) found = 1; - grub_free (quid); + VasEBoot_free (quid); } - grub_device_close (dev); + VasEBoot_device_close (dev); } } #else { /* SEARCH_FS_UUID or SEARCH_LABEL */ - grub_device_t dev; - grub_fs_t fs; + VasEBoot_device_t dev; + VasEBoot_fs_t fs; char *quid; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (dev) { - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); #ifdef DO_SEARCH_FS_UUID #define read_fn uuid @@ -173,16 +173,16 @@ iterate_device (const char *name, void *data) { fs->read_fn (dev, &quid); - if (grub_errno == GRUB_ERR_NONE && quid) + if (VasEBoot_errno == VasEBoot_ERR_NONE && quid) { if (compare_fn (quid, ctx->key) == 0) found = 1; - grub_free (quid); + VasEBoot_free (quid); } } - grub_device_close (dev); + VasEBoot_device_close (dev); } } #endif @@ -190,11 +190,11 @@ iterate_device (const char *name, void *data) if (!ctx->is_cache && found && ctx->count == 0) { struct cache_entry *cache_ent; - cache_ent = grub_malloc (sizeof (*cache_ent)); + cache_ent = VasEBoot_malloc (sizeof (*cache_ent)); if (cache_ent) { - cache_ent->key = grub_strdup (ctx->key); - cache_ent->value = grub_strdup (name); + cache_ent->key = VasEBoot_strdup (ctx->key); + cache_ent->value = VasEBoot_strdup (name); if (cache_ent->value && cache_ent->key) { cache_ent->next = cache; @@ -202,47 +202,47 @@ iterate_device (const char *name, void *data) } else { - grub_free (cache_ent->value); - grub_free (cache_ent->key); - grub_free (cache_ent); - grub_errno = GRUB_ERR_NONE; + VasEBoot_free (cache_ent->value); + VasEBoot_free (cache_ent->key); + VasEBoot_free (cache_ent); + VasEBoot_errno = VasEBoot_ERR_NONE; } } else - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (found) { ctx->count++; if (ctx->var) - grub_env_set (ctx->var, name); + VasEBoot_env_set (ctx->var, name); else - grub_printf (" %s", name); + VasEBoot_printf (" %s", name); } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return (found && ctx->var); } /* Helper for FUNC_NAME. */ static int -part_hook (grub_disk_t disk, const grub_partition_t partition, void *data) +part_hook (VasEBoot_disk_t disk, const VasEBoot_partition_t partition, void *data) { struct search_ctx *ctx = data; char *partition_name, *devname; int ret; - partition_name = grub_partition_get_name (partition); + partition_name = VasEBoot_partition_get_name (partition); if (! partition_name) return 1; - devname = grub_xasprintf ("%s,%s", disk->name, partition_name); - grub_free (partition_name); + devname = VasEBoot_xasprintf ("%s,%s", disk->name, partition_name); + VasEBoot_free (partition_name); if (!devname) return 1; ret = iterate_device (devname, ctx); - grub_free (devname); + VasEBoot_free (devname); return ret; } @@ -272,9 +272,9 @@ try (struct search_ctx *ctx) if (!ctx->count) { *prev = cache_ent->next; - grub_free (cache_ent->key); - grub_free (cache_ent->value); - grub_free (cache_ent); + VasEBoot_free (cache_ent->key); + VasEBoot_free (cache_ent->value); + VasEBoot_free (cache_ent); } } @@ -283,7 +283,7 @@ try (struct search_ctx *ctx) char *end; if (!ctx->hints[i][0]) continue; - end = ctx->hints[i] + grub_strlen (ctx->hints[i]) - 1; + end = ctx->hints[i] + VasEBoot_strlen (ctx->hints[i]) - 1; if (*end == ',') *end = 0; if (iterate_device (ctx->hints[i], ctx)) @@ -294,9 +294,9 @@ try (struct search_ctx *ctx) } if (!*end) { - grub_device_t dev; + VasEBoot_device_t dev; int ret; - dev = grub_device_open (ctx->hints[i]); + dev = VasEBoot_device_open (ctx->hints[i]); if (!dev) { if (!*end) @@ -305,20 +305,20 @@ try (struct search_ctx *ctx) } if (!dev->disk) { - grub_device_close (dev); + VasEBoot_device_close (dev); if (!*end) *end = ','; continue; } - ret = grub_partition_iterate (dev->disk, part_hook, ctx); + ret = VasEBoot_partition_iterate (dev->disk, part_hook, ctx); if (!*end) *end = ','; - grub_device_close (dev); + VasEBoot_device_close (dev); if (ret) return; } } - grub_device_iterate (iterate_device, ctx); + VasEBoot_device_iterate (iterate_device, ctx); } void @@ -334,77 +334,77 @@ FUNC_NAME (const char *key, const char *var, int no_floppy, .count = 0, .is_cache = 0 }; - grub_fs_autoload_hook_t saved_autoload; + VasEBoot_fs_autoload_hook_t saved_autoload; /* First try without autoloading if we're setting variable. */ if (var) { - saved_autoload = grub_fs_autoload_hook; - grub_fs_autoload_hook = 0; + saved_autoload = VasEBoot_fs_autoload_hook; + VasEBoot_fs_autoload_hook = 0; try (&ctx); /* Restore autoload hook. */ - grub_fs_autoload_hook = saved_autoload; + VasEBoot_fs_autoload_hook = saved_autoload; /* Retry with autoload if nothing found. */ - if (grub_errno == GRUB_ERR_NONE && ctx.count == 0) + if (VasEBoot_errno == VasEBoot_ERR_NONE && ctx.count == 0) try (&ctx); } else try (&ctx); - if (grub_errno == GRUB_ERR_NONE && ctx.count == 0) - grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); + if (VasEBoot_errno == VasEBoot_ERR_NONE && ctx.count == 0) + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "no such device: %s", key); } -static grub_err_t -grub_cmd_do_search (grub_command_t cmd __attribute__ ((unused)), int argc, +static VasEBoot_err_t +VasEBoot_cmd_do_search (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); FUNC_NAME (args[0], argc == 1 ? 0 : args[1], 0, (args + 2), argc > 2 ? argc - 2 : 0); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; #ifdef DO_SEARCH_FILE -GRUB_MOD_INIT(search_fs_file) +VasEBoot_MOD_INIT(search_fs_file) #elif defined(DO_SEARCH_PART_UUID) -GRUB_MOD_INIT(search_part_uuid) +VasEBoot_MOD_INIT(search_part_uuid) #elif defined(DO_SEARCH_PART_LABEL) -GRUB_MOD_INIT(search_part_label) +VasEBoot_MOD_INIT(search_part_label) #elif defined (DO_SEARCH_FS_UUID) -GRUB_MOD_INIT(search_fs_uuid) +VasEBoot_MOD_INIT(search_fs_uuid) #elif defined (DO_SEARCH_DISK_UUID) -GRUB_MOD_INIT(search_disk_uuid) +VasEBoot_MOD_INIT(search_disk_uuid) #else -GRUB_MOD_INIT(search_label) +VasEBoot_MOD_INIT(search_label) #endif { cmd = - grub_register_command (COMMAND_NAME, grub_cmd_do_search, + VasEBoot_register_command (COMMAND_NAME, VasEBoot_cmd_do_search, N_("NAME [VARIABLE] [HINTS]"), HELP_MESSAGE); } #ifdef DO_SEARCH_FILE -GRUB_MOD_FINI(search_fs_file) +VasEBoot_MOD_FINI(search_fs_file) #elif defined(DO_SEARCH_PART_UUID) -GRUB_MOD_FINI(search_part_uuid) +VasEBoot_MOD_FINI(search_part_uuid) #elif defined(DO_SEARCH_PART_LABEL) -GRUB_MOD_FINI(search_part_label) +VasEBoot_MOD_FINI(search_part_label) #elif defined (DO_SEARCH_FS_UUID) -GRUB_MOD_FINI(search_fs_uuid) +VasEBoot_MOD_FINI(search_fs_uuid) #elif defined (DO_SEARCH_DISK_UUID) -GRUB_MOD_FINI(search_disk_uuid) +VasEBoot_MOD_FINI(search_disk_uuid) #else -GRUB_MOD_FINI(search_label) +VasEBoot_MOD_FINI(search_label) #endif { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/search_disk_uuid.c b/VasEBoot-core/commands/search_disk_uuid.c index fba96f6b8..2a2253855 100644 --- a/VasEBoot-core/commands/search_disk_uuid.c +++ b/VasEBoot-core/commands/search_disk_uuid.c @@ -1,5 +1,5 @@ #define DO_SEARCH_DISK_UUID 1 -#define FUNC_NAME grub_search_disk_uuid +#define FUNC_NAME VasEBoot_search_disk_uuid #define COMMAND_NAME "search.disk_uuid" #define HELP_MESSAGE N_("Search devices by disk UUID. If VARIABLE is specified, the first device found is set to a variable.") #include "search.c" diff --git a/VasEBoot-core/commands/search_file.c b/VasEBoot-core/commands/search_file.c index cc2a5f939..824526ae5 100644 --- a/VasEBoot-core/commands/search_file.c +++ b/VasEBoot-core/commands/search_file.c @@ -1,5 +1,5 @@ #define DO_SEARCH_FILE 1 -#define FUNC_NAME grub_search_fs_file +#define FUNC_NAME VasEBoot_search_fs_file #define COMMAND_NAME "search.file" #define HELP_MESSAGE N_("Search devices by file. If VARIABLE is specified, the first device found is set to a variable.") #include "search.c" diff --git a/VasEBoot-core/commands/search_label.c b/VasEBoot-core/commands/search_label.c index 12e7c1831..5505fe7bd 100644 --- a/VasEBoot-core/commands/search_label.c +++ b/VasEBoot-core/commands/search_label.c @@ -1,5 +1,5 @@ #define DO_SEARCH_FS_LABEL 1 -#define FUNC_NAME grub_search_label +#define FUNC_NAME VasEBoot_search_label #define COMMAND_NAME "search.fs_label" #define HELP_MESSAGE N_("Search devices by label. If VARIABLE is specified, the first device found is set to a variable.") #include "search.c" diff --git a/VasEBoot-core/commands/search_part_label.c b/VasEBoot-core/commands/search_part_label.c index ca906cbd9..b26c53be5 100644 --- a/VasEBoot-core/commands/search_part_label.c +++ b/VasEBoot-core/commands/search_part_label.c @@ -1,5 +1,5 @@ #define DO_SEARCH_PART_LABEL 1 -#define FUNC_NAME grub_search_part_label +#define FUNC_NAME VasEBoot_search_part_label #define COMMAND_NAME "search.part_label" #define HELP_MESSAGE N_("Search devices by partition label. If VARIABLE is specified, the first device found is set to a variable.") #include "search.c" diff --git a/VasEBoot-core/commands/search_part_uuid.c b/VasEBoot-core/commands/search_part_uuid.c index 2d1d3d0d7..829a915b6 100644 --- a/VasEBoot-core/commands/search_part_uuid.c +++ b/VasEBoot-core/commands/search_part_uuid.c @@ -1,5 +1,5 @@ #define DO_SEARCH_PART_UUID 1 -#define FUNC_NAME grub_search_part_uuid +#define FUNC_NAME VasEBoot_search_part_uuid #define COMMAND_NAME "search.part_uuid" #define HELP_MESSAGE N_("Search devices by partition UUID. If VARIABLE is specified, the first device found is set to a variable.") #include "search.c" diff --git a/VasEBoot-core/commands/search_uuid.c b/VasEBoot-core/commands/search_uuid.c index 541bcf54b..fe9a38830 100644 --- a/VasEBoot-core/commands/search_uuid.c +++ b/VasEBoot-core/commands/search_uuid.c @@ -1,5 +1,5 @@ #define DO_SEARCH_FS_UUID 1 -#define FUNC_NAME grub_search_fs_uuid +#define FUNC_NAME VasEBoot_search_fs_uuid #define COMMAND_NAME "search.fs_uuid" #define HELP_MESSAGE N_("Search devices by UUID. If VARIABLE is specified, the first device found is set to a variable.") #include "search.c" diff --git a/VasEBoot-core/commands/search_wrap.c b/VasEBoot-core/commands/search_wrap.c index d931c56c5..bd320048d 100644 --- a/VasEBoot-core/commands/search_wrap.c +++ b/VasEBoot-core/commands/search_wrap.c @@ -1,35 +1,35 @@ /* search.c - search devices based on a file or a filesystem label */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"file", 'f', 0, N_("Search devices by a file."), 0, 0}, {"label", 'l', 0, N_("Search devices by a filesystem label."), @@ -42,30 +42,30 @@ static const struct grub_arg_option options[] = 0, 0}, {"disk-uuid", 'U', 0, N_("Search devices by a disk UUID."), 0, 0}, - {"set", 's', GRUB_ARG_OPTION_OPTIONAL, + {"set", 's', VasEBoot_ARG_OPTION_OPTIONAL, N_("Set a variable to the first device found."), N_("VARNAME"), ARG_TYPE_STRING}, {"no-floppy", 'n', 0, N_("Do not probe any floppy drive."), 0, 0}, - {"hint", 'h', GRUB_ARG_OPTION_REPEATABLE, + {"hint", 'h', VasEBoot_ARG_OPTION_REPEATABLE, N_("First try the device HINT. If HINT ends in comma, " "also try subpartitions"), N_("HINT"), ARG_TYPE_STRING}, - {"hint-ieee1275", 0, GRUB_ARG_OPTION_REPEATABLE, + {"hint-ieee1275", 0, VasEBoot_ARG_OPTION_REPEATABLE, N_("First try the device HINT if currently running on IEEE1275. " "If HINT ends in comma, also try subpartitions"), N_("HINT"), ARG_TYPE_STRING}, - {"hint-bios", 0, GRUB_ARG_OPTION_REPEATABLE, + {"hint-bios", 0, VasEBoot_ARG_OPTION_REPEATABLE, N_("First try the device HINT if currently running on BIOS. " "If HINT ends in comma, also try subpartitions"), N_("HINT"), ARG_TYPE_STRING}, - {"hint-baremetal", 0, GRUB_ARG_OPTION_REPEATABLE, + {"hint-baremetal", 0, VasEBoot_ARG_OPTION_REPEATABLE, N_("First try the device HINT if direct hardware access is supported. " "If HINT ends in comma, also try subpartitions"), N_("HINT"), ARG_TYPE_STRING}, - {"hint-efi", 0, GRUB_ARG_OPTION_REPEATABLE, + {"hint-efi", 0, VasEBoot_ARG_OPTION_REPEATABLE, N_("First try the device HINT if currently running on EFI. " "If HINT ends in comma, also try subpartitions"), N_("HINT"), ARG_TYPE_STRING}, - {"hint-arc", 0, GRUB_ARG_OPTION_REPEATABLE, + {"hint-arc", 0, VasEBoot_ARG_OPTION_REPEATABLE, N_("First try the device HINT if currently running on ARC." " If HINT ends in comma, also try subpartitions"), N_("HINT"), ARG_TYPE_STRING}, @@ -90,10 +90,10 @@ enum options SEARCH_HINT_ARC, }; -static grub_err_t -grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_search (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; const char *var = 0; const char *id = 0; int i = 0, j = 0, nhints = 0; @@ -103,25 +103,25 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args) for (i = 0; state[SEARCH_HINT].args[i]; i++) nhints++; -#ifdef GRUB_MACHINE_IEEE1275 +#ifdef VasEBoot_MACHINE_IEEE1275 if (state[SEARCH_HINT_IEEE1275].set) for (i = 0; state[SEARCH_HINT_IEEE1275].args[i]; i++) nhints++; #endif -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI if (state[SEARCH_HINT_EFI].set) for (i = 0; state[SEARCH_HINT_EFI].args[i]; i++) nhints++; #endif -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS if (state[SEARCH_HINT_BIOS].set) for (i = 0; state[SEARCH_HINT_BIOS].args[i]; i++) nhints++; #endif -#ifdef GRUB_MACHINE_ARC +#ifdef VasEBoot_MACHINE_ARC if (state[SEARCH_HINT_ARC].set) for (i = 0; state[SEARCH_HINT_ARC].args[i]; i++) nhints++; @@ -131,34 +131,34 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args) for (i = 0; state[SEARCH_HINT_BAREMETAL].args[i]; i++) nhints++; - hints = grub_malloc (sizeof (hints[0]) * nhints); + hints = VasEBoot_malloc (sizeof (hints[0]) * nhints); if (!hints) - return grub_errno; + return VasEBoot_errno; j = 0; if (state[SEARCH_HINT].set) for (i = 0; state[SEARCH_HINT].args[i]; i++) hints[j++] = state[SEARCH_HINT].args[i]; -#ifdef GRUB_MACHINE_IEEE1275 +#ifdef VasEBoot_MACHINE_IEEE1275 if (state[SEARCH_HINT_IEEE1275].set) for (i = 0; state[SEARCH_HINT_IEEE1275].args[i]; i++) hints[j++] = state[SEARCH_HINT_IEEE1275].args[i]; #endif -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI if (state[SEARCH_HINT_EFI].set) for (i = 0; state[SEARCH_HINT_EFI].args[i]; i++) hints[j++] = state[SEARCH_HINT_EFI].args[i]; #endif -#ifdef GRUB_MACHINE_ARC +#ifdef VasEBoot_MACHINE_ARC if (state[SEARCH_HINT_ARC].set) for (i = 0; state[SEARCH_HINT_ARC].args[i]; i++) hints[j++] = state[SEARCH_HINT_ARC].args[i]; #endif -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS if (state[SEARCH_HINT_BIOS].set) for (i = 0; state[SEARCH_HINT_BIOS].args[i]; i++) hints[j++] = state[SEARCH_HINT_BIOS].args[i]; @@ -170,7 +170,7 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args) /* Skip hints for future platforms. */ for (j = 0; j < argc; j++) - if (grub_memcmp (args[j], "--hint-", sizeof ("--hint-") - 1) != 0) + if (VasEBoot_memcmp (args[j], "--hint-", sizeof ("--hint-") - 1) != 0) break; if (state[SEARCH_SET].set) @@ -185,43 +185,43 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args) } else { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); goto out; } if (state[SEARCH_LABEL].set) - grub_search_label (id, var, state[SEARCH_NO_FLOPPY].set, + VasEBoot_search_label (id, var, state[SEARCH_NO_FLOPPY].set, hints, nhints); else if (state[SEARCH_FS_UUID].set) - grub_search_fs_uuid (id, var, state[SEARCH_NO_FLOPPY].set, + VasEBoot_search_fs_uuid (id, var, state[SEARCH_NO_FLOPPY].set, hints, nhints); else if (state[SEARCH_PART_LABEL].set) - grub_search_part_label (id, var, state[SEARCH_NO_FLOPPY].set, + VasEBoot_search_part_label (id, var, state[SEARCH_NO_FLOPPY].set, hints, nhints); else if (state[SEARCH_PART_UUID].set) - grub_search_part_uuid (id, var, state[SEARCH_NO_FLOPPY].set, + VasEBoot_search_part_uuid (id, var, state[SEARCH_NO_FLOPPY].set, hints, nhints); else if (state[SEARCH_DISK_UUID].set) - grub_search_disk_uuid (id, var, state[SEARCH_NO_FLOPPY].set, + VasEBoot_search_disk_uuid (id, var, state[SEARCH_NO_FLOPPY].set, hints, nhints); else if (state[SEARCH_FILE].set) - grub_search_fs_file (id, var, state[SEARCH_NO_FLOPPY].set, + VasEBoot_search_fs_file (id, var, state[SEARCH_NO_FLOPPY].set, hints, nhints); else - grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type"); + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "unspecified search type"); out: - grub_free (hints); - return grub_errno; + VasEBoot_free (hints); + return VasEBoot_errno; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(search) +VasEBoot_MOD_INIT(search) { cmd = - grub_register_extcmd ("search", grub_cmd_search, - GRUB_COMMAND_FLAG_EXTRACTOR | GRUB_COMMAND_ACCEPT_DASH, + VasEBoot_register_extcmd ("search", VasEBoot_cmd_search, + VasEBoot_COMMAND_FLAG_EXTRACTOR | VasEBoot_COMMAND_ACCEPT_DASH, N_("[-f|-l|-u|-s|-n] [--hint HINT [--hint HINT] ...]" " NAME"), N_("Search devices by file, filesystem label" @@ -232,7 +232,7 @@ GRUB_MOD_INIT(search) options); } -GRUB_MOD_FINI(search) +VasEBoot_MOD_FINI(search) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/setpci.c b/VasEBoot-core/commands/setpci.c index d5bc97d60..7f1d50f83 100644 --- a/VasEBoot-core/commands/setpci.c +++ b/VasEBoot-core/commands/setpci.c @@ -1,70 +1,70 @@ /* lspci.c - List PCI devices. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct pci_register { const char *name; - grub_uint16_t addr; + VasEBoot_uint16_t addr; unsigned size; }; static struct pci_register pci_registers[] = { - {"VENDOR_ID", GRUB_PCI_REG_VENDOR , 2}, - {"DEVICE_ID", GRUB_PCI_REG_DEVICE , 2}, - {"COMMAND", GRUB_PCI_REG_COMMAND , 2}, - {"STATUS", GRUB_PCI_REG_STATUS , 2}, - {"REVISION", GRUB_PCI_REG_REVISION , 1}, - {"CLASS_PROG", GRUB_PCI_REG_CLASS + 1 , 1}, - {"CLASS_DEVICE", GRUB_PCI_REG_CLASS + 2 , 2}, - {"CACHE_LINE_SIZE", GRUB_PCI_REG_CACHELINE , 1}, - {"LATENCY_TIMER", GRUB_PCI_REG_LAT_TIMER , 1}, - {"HEADER_TYPE", GRUB_PCI_REG_HEADER_TYPE , 1}, - {"BIST", GRUB_PCI_REG_BIST , 1}, - {"BASE_ADDRESS_0", GRUB_PCI_REG_ADDRESS_REG0, 4}, - {"BASE_ADDRESS_1", GRUB_PCI_REG_ADDRESS_REG1, 4}, - {"BASE_ADDRESS_2", GRUB_PCI_REG_ADDRESS_REG2, 4}, - {"BASE_ADDRESS_3", GRUB_PCI_REG_ADDRESS_REG3, 4}, - {"BASE_ADDRESS_4", GRUB_PCI_REG_ADDRESS_REG4, 4}, - {"BASE_ADDRESS_5", GRUB_PCI_REG_ADDRESS_REG5, 4}, - {"CARDBUS_CIS", GRUB_PCI_REG_CIS_POINTER , 4}, - {"SUBVENDOR_ID", GRUB_PCI_REG_SUBVENDOR , 2}, - {"SUBSYSTEM_ID", GRUB_PCI_REG_SUBSYSTEM , 2}, - {"ROM_ADDRESS", GRUB_PCI_REG_ROM_ADDRESS , 4}, - {"CAP_POINTER", GRUB_PCI_REG_CAP_POINTER , 1}, - {"INTERRUPT_LINE", GRUB_PCI_REG_IRQ_LINE , 1}, - {"INTERRUPT_PIN", GRUB_PCI_REG_IRQ_PIN , 1}, - {"MIN_GNT", GRUB_PCI_REG_MIN_GNT , 1}, - {"MAX_LAT", GRUB_PCI_REG_MIN_GNT , 1}, + {"VENDOR_ID", VasEBoot_PCI_REG_VENDOR , 2}, + {"DEVICE_ID", VasEBoot_PCI_REG_DEVICE , 2}, + {"COMMAND", VasEBoot_PCI_REG_COMMAND , 2}, + {"STATUS", VasEBoot_PCI_REG_STATUS , 2}, + {"REVISION", VasEBoot_PCI_REG_REVISION , 1}, + {"CLASS_PROG", VasEBoot_PCI_REG_CLASS + 1 , 1}, + {"CLASS_DEVICE", VasEBoot_PCI_REG_CLASS + 2 , 2}, + {"CACHE_LINE_SIZE", VasEBoot_PCI_REG_CACHELINE , 1}, + {"LATENCY_TIMER", VasEBoot_PCI_REG_LAT_TIMER , 1}, + {"HEADER_TYPE", VasEBoot_PCI_REG_HEADER_TYPE , 1}, + {"BIST", VasEBoot_PCI_REG_BIST , 1}, + {"BASE_ADDRESS_0", VasEBoot_PCI_REG_ADDRESS_REG0, 4}, + {"BASE_ADDRESS_1", VasEBoot_PCI_REG_ADDRESS_REG1, 4}, + {"BASE_ADDRESS_2", VasEBoot_PCI_REG_ADDRESS_REG2, 4}, + {"BASE_ADDRESS_3", VasEBoot_PCI_REG_ADDRESS_REG3, 4}, + {"BASE_ADDRESS_4", VasEBoot_PCI_REG_ADDRESS_REG4, 4}, + {"BASE_ADDRESS_5", VasEBoot_PCI_REG_ADDRESS_REG5, 4}, + {"CARDBUS_CIS", VasEBoot_PCI_REG_CIS_POINTER , 4}, + {"SUBVENDOR_ID", VasEBoot_PCI_REG_SUBVENDOR , 2}, + {"SUBSYSTEM_ID", VasEBoot_PCI_REG_SUBSYSTEM , 2}, + {"ROM_ADDRESS", VasEBoot_PCI_REG_ROM_ADDRESS , 4}, + {"CAP_POINTER", VasEBoot_PCI_REG_CAP_POINTER , 1}, + {"INTERRUPT_LINE", VasEBoot_PCI_REG_IRQ_LINE , 1}, + {"INTERRUPT_PIN", VasEBoot_PCI_REG_IRQ_PIN , 1}, + {"MIN_GNT", VasEBoot_PCI_REG_MIN_GNT , 1}, + {"MAX_LAT", VasEBoot_PCI_REG_MIN_GNT , 1}, }; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {0, 'd', 0, N_("Select device by vendor and device IDs."), N_("[vendor]:[device]"), ARG_TYPE_STRING}, @@ -75,64 +75,64 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; -static grub_uint32_t pciid_check_mask, pciid_check_value; +static VasEBoot_uint32_t pciid_check_mask, pciid_check_value; static int bus, device, function; static int check_bus, check_device, check_function; -static grub_uint32_t write_mask, regwrite; +static VasEBoot_uint32_t write_mask, regwrite; static int regsize; -static grub_uint16_t regaddr; +static VasEBoot_uint16_t regaddr; static const char *varname; static int -grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, +VasEBoot_setpci_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_uint32_t regval = 0; - grub_pci_address_t addr; + VasEBoot_uint32_t regval = 0; + VasEBoot_pci_address_t addr; if ((pciid & pciid_check_mask) != pciid_check_value) return 0; - if (check_bus && grub_pci_get_bus (dev) != bus) + if (check_bus && VasEBoot_pci_get_bus (dev) != bus) return 0; - if (check_device && grub_pci_get_device (dev) != device) + if (check_device && VasEBoot_pci_get_device (dev) != device) return 0; - if (check_function && grub_pci_get_function (dev) != function) + if (check_function && VasEBoot_pci_get_function (dev) != function) return 0; - addr = grub_pci_make_address (dev, regaddr); + addr = VasEBoot_pci_make_address (dev, regaddr); switch (regsize) { case 1: - regval = grub_pci_read_byte (addr); + regval = VasEBoot_pci_read_byte (addr); break; case 2: - regval = grub_pci_read_word (addr); + regval = VasEBoot_pci_read_word (addr); break; case 4: - regval = grub_pci_read (addr); + regval = VasEBoot_pci_read (addr); break; } if (varname) { char buf[sizeof ("XXXXXXXX")]; - grub_snprintf (buf, sizeof (buf), "%x", regval); - grub_env_set (varname, buf); + VasEBoot_snprintf (buf, sizeof (buf), "%x", regval); + VasEBoot_env_set (varname, buf); return 1; } if (!write_mask) { - grub_printf (_("Register %x of %x:%02x.%x is %x\n"), regaddr, - grub_pci_get_bus (dev), - grub_pci_get_device (dev), - grub_pci_get_function (dev), + VasEBoot_printf (_("Register %x of %x:%02x.%x is %x\n"), regaddr, + VasEBoot_pci_get_bus (dev), + VasEBoot_pci_get_device (dev), + VasEBoot_pci_get_function (dev), regval); return 0; } @@ -142,23 +142,23 @@ grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, switch (regsize) { case 1: - grub_pci_write_byte (addr, regval); + VasEBoot_pci_write_byte (addr, regval); break; case 2: - grub_pci_write_word (addr, regval); + VasEBoot_pci_write_word (addr, regval); break; case 4: - grub_pci_write (addr, regval); + VasEBoot_pci_write (addr, regval); break; } return 0; } -static grub_err_t -grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv) +static VasEBoot_err_t +VasEBoot_cmd_setpci (VasEBoot_extcmd_context_t ctxt, int argc, char **argv) { const char *ptr; unsigned i; @@ -169,23 +169,23 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv) if (ctxt->state[0].set) { ptr = ctxt->state[0].arg; - pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + pciid_check_value |= (VasEBoot_strtoul (ptr, (char **) &ptr, 16) & 0xffff); + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ptr = ctxt->state[0].arg; } else pciid_check_mask |= 0xffff; - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr != ':') - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); ptr++; - pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff) + pciid_check_value |= (VasEBoot_strtoul (ptr, (char **) &ptr, 16) & 0xffff) << 16; - if (grub_errno == GRUB_ERR_BAD_NUMBER) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) + VasEBoot_errno = VasEBoot_ERR_NONE; else pciid_check_mask |= 0xffff0000; } @@ -200,24 +200,24 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv) ptr = ctxt->state[1].arg; optr = ptr; - bus = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + bus = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ptr = optr; } else check_bus = 1; - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr != ':') - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':'); ptr++; optr = ptr; - device = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + device = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ptr = optr; } else @@ -225,9 +225,9 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv) if (*ptr == '.') { ptr++; - function = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) - return grub_errno; + function = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) + return VasEBoot_errno; check_function = 1; } } @@ -240,102 +240,102 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv) write_mask = 0; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); ptr = argv[0]; for (i = 0; i < ARRAY_SIZE (pci_registers); i++) { - if (grub_strncmp (ptr, pci_registers[i].name, - grub_strlen (pci_registers[i].name)) == 0) + if (VasEBoot_strncmp (ptr, pci_registers[i].name, + VasEBoot_strlen (pci_registers[i].name)) == 0) break; } if (i == ARRAY_SIZE (pci_registers)) { regsize = 0; - regaddr = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown register"); + regaddr = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unknown register"); } else { regaddr = pci_registers[i].addr; regsize = pci_registers[i].size; - ptr += grub_strlen (pci_registers[i].name); + ptr += VasEBoot_strlen (pci_registers[i].name); } - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr == '+') { ptr++; - regaddr += grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) - return grub_errno; + regaddr += VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) + return VasEBoot_errno; } - if (grub_memcmp (ptr, ".L", sizeof (".L") - 1) == 0 - || grub_memcmp (ptr, ".l", sizeof (".l") - 1) == 0) + if (VasEBoot_memcmp (ptr, ".L", sizeof (".L") - 1) == 0 + || VasEBoot_memcmp (ptr, ".l", sizeof (".l") - 1) == 0) { regsize = 4; ptr += sizeof (".l") - 1; } - else if (grub_memcmp (ptr, ".W", sizeof (".W") - 1) == 0 - || grub_memcmp (ptr, ".w", sizeof (".w") - 1) == 0) + else if (VasEBoot_memcmp (ptr, ".W", sizeof (".W") - 1) == 0 + || VasEBoot_memcmp (ptr, ".w", sizeof (".w") - 1) == 0) { regsize = 2; ptr += sizeof (".w") - 1; } - else if (grub_memcmp (ptr, ".B", sizeof (".B") - 1) == 0 - || grub_memcmp (ptr, ".b", sizeof (".b") - 1) == 0) + else if (VasEBoot_memcmp (ptr, ".B", sizeof (".B") - 1) == 0 + || VasEBoot_memcmp (ptr, ".b", sizeof (".b") - 1) == 0) { regsize = 1; ptr += sizeof (".b") - 1; } if (!regsize) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unknown register size"); write_mask = 0; if (*ptr == '=') { ptr++; - regwrite = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) - return grub_errno; + regwrite = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) + return VasEBoot_errno; write_mask = 0xffffffff; if (*ptr == ':') { ptr++; - write_mask = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) - return grub_errno; + write_mask = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) + return VasEBoot_errno; write_mask = 0xffffffff; } regwrite &= write_mask; } if (write_mask && varname) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "option -v isn't valid for writes"); - grub_pci_iterate (grub_setpci_iter, NULL); - return GRUB_ERR_NONE; + VasEBoot_pci_iterate (VasEBoot_setpci_iter, NULL); + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(setpci) +VasEBoot_MOD_INIT(setpci) { - cmd = grub_register_extcmd ("setpci", grub_cmd_setpci, 0, + cmd = VasEBoot_register_extcmd ("setpci", VasEBoot_cmd_setpci, 0, N_("[-s POSITION] [-d DEVICE] [-v VAR] " "REGISTER[=VALUE[:MASK]]"), N_("Manipulate PCI devices."), options); } -GRUB_MOD_FINI(setpci) +VasEBoot_MOD_FINI(setpci) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/sleep.c b/VasEBoot-core/commands/sleep.c index e77e7900f..aa64c172b 100644 --- a/VasEBoot-core/commands/sleep.c +++ b/VasEBoot-core/commands/sleep.c @@ -1,76 +1,76 @@ /* sleep.c - Command to wait a specified number of seconds. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"verbose", 'v', 0, N_("Verbose countdown."), 0, 0}, {"interruptible", 'i', 0, N_("Allow to interrupt with ESC."), 0, 0}, {0, 0, 0, 0, 0, 0} }; -static struct grub_term_coordinate *pos; +static struct VasEBoot_term_coordinate *pos; static void do_print (int n) { - grub_term_restore_pos (pos); + VasEBoot_term_restore_pos (pos); /* NOTE: Do not remove the trailing space characters. They are required to clear the line. */ - grub_printf ("%d ", n); - grub_refresh (); + VasEBoot_printf ("%d ", n); + VasEBoot_refresh (); } -/* Based on grub_millisleep() from kern/generic/millisleep.c. */ +/* Based on VasEBoot_millisleep() from kern/generic/millisleep.c. */ static int -grub_interruptible_millisleep (grub_uint32_t ms) +VasEBoot_interruptible_millisleep (VasEBoot_uint32_t ms) { - grub_uint64_t start; + VasEBoot_uint64_t start; - start = grub_get_time_ms (); + start = VasEBoot_get_time_ms (); - while (grub_get_time_ms () - start < ms) - if (grub_getkey_noblock () == GRUB_TERM_ESC) + while (VasEBoot_get_time_ms () - start < ms) + if (VasEBoot_getkey_noblock () == VasEBoot_TERM_ESC) return 1; return 0; } -static grub_err_t -grub_cmd_sleep (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_sleep (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; int n; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - n = grub_strtoul (args[0], 0, 10); + n = VasEBoot_strtoul (args[0], 0, 10); if (n == 0) { @@ -78,9 +78,9 @@ grub_cmd_sleep (grub_extcmd_context_t ctxt, int argc, char **args) return 0; } - grub_refresh (); + VasEBoot_refresh (); - pos = grub_term_save_pos (); + pos = VasEBoot_term_save_pos (); for (; n; n--) { @@ -89,11 +89,11 @@ grub_cmd_sleep (grub_extcmd_context_t ctxt, int argc, char **args) if (state[1].set) { - if (grub_interruptible_millisleep (1000)) + if (VasEBoot_interruptible_millisleep (1000)) return 1; } else - grub_millisleep (1000); + VasEBoot_millisleep (1000); } if (state[0].set) do_print (0); @@ -101,17 +101,17 @@ grub_cmd_sleep (grub_extcmd_context_t ctxt, int argc, char **args) return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(sleep) +VasEBoot_MOD_INIT(sleep) { - cmd = grub_register_extcmd ("sleep", grub_cmd_sleep, 0, + cmd = VasEBoot_register_extcmd ("sleep", VasEBoot_cmd_sleep, 0, N_("NUMBER_OF_SECONDS"), N_("Wait for a specified number of seconds."), options); } -GRUB_MOD_FINI(sleep) +VasEBoot_MOD_FINI(sleep) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/smbios.c b/VasEBoot-core/commands/smbios.c index 82186319a..edf5e09b1 100644 --- a/VasEBoot-core/commands/smbios.c +++ b/VasEBoot-core/commands/smbios.c @@ -1,60 +1,60 @@ /* smbios.c - retrieve smbios information. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013,2014,2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Locate the SMBIOS entry point structure depending on the hardware. */ -struct grub_smbios_eps * -grub_smbios_get_eps (void) +struct VasEBoot_smbios_eps * +VasEBoot_smbios_get_eps (void) { - static struct grub_smbios_eps *eps = NULL; + static struct VasEBoot_smbios_eps *eps = NULL; if (eps != NULL) return eps; - eps = grub_machine_smbios_get_eps (); + eps = VasEBoot_machine_smbios_get_eps (); return eps; } /* Locate the SMBIOS3 entry point structure depending on the hardware. */ -struct grub_smbios_eps3 * -grub_smbios_get_eps3 (void) +struct VasEBoot_smbios_eps3 * +VasEBoot_smbios_get_eps3 (void) { - static struct grub_smbios_eps3 *eps = NULL; + static struct VasEBoot_smbios_eps3 *eps = NULL; if (eps != NULL) return eps; - eps = grub_machine_smbios_get_eps3 (); + eps = VasEBoot_machine_smbios_get_eps3 (); return eps; } /* Abstract useful values found in either the SMBIOS3 or SMBIOS EPS. */ static struct { - grub_addr_t start; - grub_addr_t end; - grub_uint16_t structures; + VasEBoot_addr_t start; + VasEBoot_addr_t end; + VasEBoot_uint16_t structures; } table_desc = {0, 0, 0}; @@ -68,50 +68,50 @@ static struct { */ static const char * -grub_smbios_format_byte (char *buffer, grub_size_t size, - const grub_uint8_t *structure, grub_uint8_t offset) +VasEBoot_smbios_format_byte (char *buffer, VasEBoot_size_t size, + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset) { - grub_snprintf (buffer, size, "%u", structure[offset]); + VasEBoot_snprintf (buffer, size, "%u", structure[offset]); return (const char *)buffer; } static const char * -grub_smbios_format_word (char *buffer, grub_size_t size, - const grub_uint8_t *structure, grub_uint8_t offset) +VasEBoot_smbios_format_word (char *buffer, VasEBoot_size_t size, + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset) { - grub_uint16_t value = grub_get_unaligned16 (structure + offset); - grub_snprintf (buffer, size, "%u", value); + VasEBoot_uint16_t value = VasEBoot_get_unaligned16 (structure + offset); + VasEBoot_snprintf (buffer, size, "%u", value); return (const char *)buffer; } static const char * -grub_smbios_format_dword (char *buffer, grub_size_t size, - const grub_uint8_t *structure, grub_uint8_t offset) +VasEBoot_smbios_format_dword (char *buffer, VasEBoot_size_t size, + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset) { - grub_uint32_t value = grub_get_unaligned32 (structure + offset); - grub_snprintf (buffer, size, "%" PRIuGRUB_UINT32_T, value); + VasEBoot_uint32_t value = VasEBoot_get_unaligned32 (structure + offset); + VasEBoot_snprintf (buffer, size, "%" PRIuVasEBoot_UINT32_T, value); return (const char *)buffer; } static const char * -grub_smbios_format_qword (char *buffer, grub_size_t size, - const grub_uint8_t *structure, grub_uint8_t offset) +VasEBoot_smbios_format_qword (char *buffer, VasEBoot_size_t size, + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset) { - grub_uint64_t value = grub_get_unaligned64 (structure + offset); - grub_snprintf (buffer, size, "%" PRIuGRUB_UINT64_T, value); + VasEBoot_uint64_t value = VasEBoot_get_unaligned64 (structure + offset); + VasEBoot_snprintf (buffer, size, "%" PRIuVasEBoot_UINT64_T, value); return (const char *)buffer; } /* The matching string pointer is returned directly to avoid extra copying. */ static const char * -grub_smbios_get_string (char *buffer __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused)), - const grub_uint8_t *structure, grub_uint8_t offset) +VasEBoot_smbios_get_string (char *buffer __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused)), + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset) { - const grub_uint8_t *ptr = structure + structure[1]; - const grub_uint8_t *table_end = (const grub_uint8_t *)table_desc.end; - const grub_uint8_t referenced_string_number = structure[offset]; - grub_uint8_t i; + const VasEBoot_uint8_t *ptr = structure + structure[1]; + const VasEBoot_uint8_t *table_end = (const VasEBoot_uint8_t *)table_desc.end; + const VasEBoot_uint8_t referenced_string_number = structure[offset]; + VasEBoot_uint8_t i; /* A string referenced with zero is interpreted as unset. */ if (referenced_string_number == 0) @@ -135,12 +135,12 @@ grub_smbios_get_string (char *buffer __attribute__ ((unused)), } static const char * -grub_smbios_format_uuid (char *buffer, grub_size_t size, - const grub_uint8_t *structure, grub_uint8_t offset) +VasEBoot_smbios_format_uuid (char *buffer, VasEBoot_size_t size, + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset) { - const grub_uint8_t *f = structure + offset; /* little-endian fields */ - const grub_uint8_t *g = f + 8; /* byte-by-byte fields */ - grub_snprintf (buffer, size, + const VasEBoot_uint8_t *f = structure + offset; /* little-endian fields */ + const VasEBoot_uint8_t *g = f + 8; /* byte-by-byte fields */ + VasEBoot_snprintf (buffer, size, "%02x%02x%02x%02x-%02x%02x-%02x%02x-" "%02x%02x-%02x%02x%02x%02x%02x%02x", f[3], f[2], f[1], f[0], f[5], f[4], f[7], f[6], @@ -152,22 +152,22 @@ grub_smbios_format_uuid (char *buffer, grub_size_t size, /* List the field formatting functions and the number of bytes they need. */ #define MAXIMUM_FORMAT_LENGTH (sizeof ("ffffffff-ffff-ffff-ffff-ffffffffffff")) static const struct { - const char *(*format) (char *buffer, grub_size_t size, - const grub_uint8_t *structure, grub_uint8_t offset); - grub_uint8_t field_length; + const char *(*format) (char *buffer, VasEBoot_size_t size, + const VasEBoot_uint8_t *structure, VasEBoot_uint8_t offset); + VasEBoot_uint8_t field_length; } field_extractors[] = { - {grub_smbios_format_byte, 1}, - {grub_smbios_format_word, 2}, - {grub_smbios_format_dword, 4}, - {grub_smbios_format_qword, 8}, - {grub_smbios_get_string, 1}, - {grub_smbios_format_uuid, 16} + {VasEBoot_smbios_format_byte, 1}, + {VasEBoot_smbios_format_word, 2}, + {VasEBoot_smbios_format_dword, 4}, + {VasEBoot_smbios_format_qword, 8}, + {VasEBoot_smbios_get_string, 1}, + {VasEBoot_smbios_format_uuid, 16} }; /* List command options, with structure field getters ordered as above. */ #define FIRST_GETTER_OPT (3) #define SETTER_OPT (FIRST_GETTER_OPT + ARRAY_SIZE(field_extractors)) -static const struct grub_arg_option options[] = { +static const struct VasEBoot_arg_option options[] = { {"type", 't', 0, N_("Match entries with the given type."), N_("type"), ARG_TYPE_INT}, {"handle", 'h', 0, N_("Match entries with the given handle."), @@ -203,23 +203,23 @@ static const struct grub_arg_option options[] = { * The return value is a pointer to the first matching structure. If no * structures match the given parameters, NULL is returned. */ -static const grub_uint8_t * -grub_smbios_match_structure (const grub_int16_t type, - const grub_int32_t handle, - const grub_uint16_t match) +static const VasEBoot_uint8_t * +VasEBoot_smbios_match_structure (const VasEBoot_int16_t type, + const VasEBoot_int32_t handle, + const VasEBoot_uint16_t match) { - const grub_uint8_t *ptr = (const grub_uint8_t *)table_desc.start; - const grub_uint8_t *table_end = (const grub_uint8_t *)table_desc.end; - grub_uint16_t structures = table_desc.structures; - grub_uint16_t structure_count = 0; - grub_uint16_t matches = 0; + const VasEBoot_uint8_t *ptr = (const VasEBoot_uint8_t *)table_desc.start; + const VasEBoot_uint8_t *table_end = (const VasEBoot_uint8_t *)table_desc.end; + VasEBoot_uint16_t structures = table_desc.structures; + VasEBoot_uint16_t structure_count = 0; + VasEBoot_uint16_t matches = 0; while (ptr < table_end && ptr[1] >= 4 /* Valid structures include the 4-byte header. */ && (structure_count++ < structures || structures == 0)) { - grub_uint16_t structure_handle = grub_get_unaligned16 (ptr + 2); - grub_uint8_t structure_type = ptr[0]; + VasEBoot_uint16_t structure_handle = VasEBoot_get_unaligned16 (ptr + 2); + VasEBoot_uint8_t structure_type = ptr[0]; if ((handle < 0 || handle == structure_handle) && (type < 0 || type == structure_type) @@ -232,7 +232,7 @@ grub_smbios_match_structure (const grub_int16_t type, while ((*ptr++ != 0 || *ptr++ != 0) && ptr < table_end); } - if (structure_type == GRUB_SMBIOS_TYPE_END_OF_TABLE) + if (structure_type == VasEBoot_SMBIOS_TYPE_END_OF_TABLE) break; } @@ -240,53 +240,53 @@ grub_smbios_match_structure (const grub_int16_t type, } -static grub_err_t -grub_cmd_smbios (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_smbios (VasEBoot_extcmd_context_t ctxt, int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; - grub_int16_t type = -1; - grub_int32_t handle = -1; - grub_uint16_t match = 0; - grub_uint8_t offset = 0; + VasEBoot_int16_t type = -1; + VasEBoot_int32_t handle = -1; + VasEBoot_uint16_t match = 0; + VasEBoot_uint8_t offset = 0; - const grub_uint8_t *structure; + const VasEBoot_uint8_t *structure; const char *value; char buffer[MAXIMUM_FORMAT_LENGTH]; - grub_int32_t option; - grub_int8_t field_type = -1; - grub_uint8_t i; + VasEBoot_int32_t option; + VasEBoot_int8_t field_type = -1; + VasEBoot_uint8_t i; if (table_desc.start == 0) - return grub_error (GRUB_ERR_IO, + return VasEBoot_error (VasEBoot_ERR_IO, N_("the SMBIOS entry point structure was not found")); /* Read the given filtering options. */ if (state[0].set) { - option = grub_strtol (state[0].arg, NULL, 0); + option = VasEBoot_strtol (state[0].arg, NULL, 0); if (option < 0 || option > 255) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("the type must be between 0 and 255")); - type = (grub_int16_t)option; + type = (VasEBoot_int16_t)option; } if (state[1].set) { - option = grub_strtol (state[1].arg, NULL, 0); + option = VasEBoot_strtol (state[1].arg, NULL, 0); if (option < 0 || option > 65535) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("the handle must be between 0 and 65535")); - handle = (grub_int32_t)option; + handle = (VasEBoot_int32_t)option; } if (state[2].set) { - option = grub_strtol (state[2].arg, NULL, 0); + option = VasEBoot_strtol (state[2].arg, NULL, 0); if (option <= 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("the match must be a positive integer")); - match = (grub_uint16_t)option; + match = (VasEBoot_uint16_t)option; } /* Determine the data type of the structure field to retrieve. */ @@ -294,79 +294,79 @@ grub_cmd_smbios (grub_extcmd_context_t ctxt, if (state[FIRST_GETTER_OPT + i].set) { if (field_type >= 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("only one --get option is usable at a time")); field_type = i; } /* Require a choice of a structure field to return. */ if (field_type < 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one of the --get options is required")); /* Locate a matching SMBIOS structure. */ - structure = grub_smbios_match_structure (type, handle, match); + structure = VasEBoot_smbios_match_structure (type, handle, match); if (structure == NULL) - return grub_error (GRUB_ERR_IO, + return VasEBoot_error (VasEBoot_ERR_IO, N_("no structure matched the given options")); /* Ensure the requested byte offset is inside the structure. */ - option = grub_strtol (state[FIRST_GETTER_OPT + field_type].arg, NULL, 0); + option = VasEBoot_strtol (state[FIRST_GETTER_OPT + field_type].arg, NULL, 0); if (option < 0 || option >= structure[1]) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("the given offset is outside the structure")); /* Ensure the requested data type at the offset is inside the structure. */ - offset = (grub_uint8_t)option; + offset = (VasEBoot_uint8_t)option; if (offset + field_extractors[field_type].field_length > structure[1]) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("the field ends outside the structure")); /* Format the requested structure field into a readable string. */ value = field_extractors[field_type].format (buffer, sizeof (buffer), structure, offset); if (value == NULL) - return grub_error (GRUB_ERR_IO, + return VasEBoot_error (VasEBoot_ERR_IO, N_("failed to retrieve the structure field")); /* Store or print the formatted value. */ if (state[SETTER_OPT].set) - grub_env_set (state[SETTER_OPT].arg, value); + VasEBoot_env_set (state[SETTER_OPT].arg, value); else - grub_printf ("%s\n", value); + VasEBoot_printf ("%s\n", value); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(smbios) +VasEBoot_MOD_INIT(smbios) { - struct grub_smbios_eps3 *eps3; - struct grub_smbios_eps *eps; + struct VasEBoot_smbios_eps3 *eps3; + struct VasEBoot_smbios_eps *eps; - if ((eps3 = grub_smbios_get_eps3 ())) + if ((eps3 = VasEBoot_smbios_get_eps3 ())) { - table_desc.start = (grub_addr_t)eps3->table_address; + table_desc.start = (VasEBoot_addr_t)eps3->table_address; table_desc.end = table_desc.start + eps3->maximum_table_length; table_desc.structures = 0; /* SMBIOS3 drops the structure count. */ } - else if ((eps = grub_smbios_get_eps ())) + else if ((eps = VasEBoot_smbios_get_eps ())) { - table_desc.start = (grub_addr_t)eps->intermediate.table_address; + table_desc.start = (VasEBoot_addr_t)eps->intermediate.table_address; table_desc.end = table_desc.start + eps->intermediate.table_length; table_desc.structures = eps->intermediate.structures; } - cmd = grub_register_extcmd ("smbios", grub_cmd_smbios, 0, + cmd = VasEBoot_register_extcmd ("smbios", VasEBoot_cmd_smbios, 0, N_("[-t type] [-h handle] [-m match] " "(-b|-w|-d|-q|-s|-u) offset " "[--set variable]"), N_("Retrieve SMBIOS information."), options); } -GRUB_MOD_FINI(smbios) +VasEBoot_MOD_FINI(smbios) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/syslinuxcfg.c b/VasEBoot-core/commands/syslinuxcfg.c index 7be28fada..b8a056996 100644 --- a/VasEBoot-core/commands/syslinuxcfg.c +++ b/VasEBoot-core/commands/syslinuxcfg.c @@ -1,50 +1,50 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Helper for syslinux_file. */ -static grub_err_t +static VasEBoot_err_t syslinux_file_getline (char **line, int cont __attribute__ ((unused)), void *data __attribute__ ((unused))) { *line = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"root", 'r', 0, N_("root directory of the syslinux disk [default=/]."), @@ -67,33 +67,33 @@ enum OPTION_SYSLINUX }; -static grub_err_t -syslinux_file (grub_extcmd_context_t ctxt, const char *filename) +static VasEBoot_err_t +syslinux_file (VasEBoot_extcmd_context_t ctxt, const char *filename) { char *result; const char *root = ctxt->state[OPTION_ROOT].set ? ctxt->state[OPTION_ROOT].arg : "/"; const char *cwd = ctxt->state[OPTION_CWD].set ? ctxt->state[OPTION_CWD].arg : NULL; - grub_syslinux_flavour_t flav = GRUB_SYSLINUX_UNKNOWN; + VasEBoot_syslinux_flavour_t flav = VasEBoot_SYSLINUX_UNKNOWN; char *cwdf = NULL; - grub_menu_t menu; + VasEBoot_menu_t menu; if (ctxt->state[OPTION_ISOLINUX].set) - flav = GRUB_SYSLINUX_ISOLINUX; + flav = VasEBoot_SYSLINUX_ISOLINUX; if (ctxt->state[OPTION_PXELINUX].set) - flav = GRUB_SYSLINUX_PXELINUX; + flav = VasEBoot_SYSLINUX_PXELINUX; if (ctxt->state[OPTION_SYSLINUX].set) - flav = GRUB_SYSLINUX_SYSLINUX; + flav = VasEBoot_SYSLINUX_SYSLINUX; if (!cwd) { char *p; - cwdf = grub_strdup (filename); + cwdf = VasEBoot_strdup (filename); if (!cwdf) - return grub_errno; - p = grub_strrchr (cwdf, '/'); + return VasEBoot_errno; + p = VasEBoot_strrchr (cwdf, '/'); if (!p) { - grub_free (cwdf); + VasEBoot_free (cwdf); cwd = "/"; cwdf = NULL; } @@ -104,114 +104,114 @@ syslinux_file (grub_extcmd_context_t ctxt, const char *filename) } } - grub_dprintf ("syslinux", + VasEBoot_dprintf ("syslinux", "transforming syslinux config %s, root = %s, cwd = %s\n", filename, root, cwd); - result = grub_syslinux_config_file (root, root, cwd, cwd, filename, flav); + result = VasEBoot_syslinux_config_file (root, root, cwd, cwd, filename, flav); if (!result) - return grub_errno; + return VasEBoot_errno; - grub_dprintf ("syslinux", "syslinux config transformed\n"); + VasEBoot_dprintf ("syslinux", "syslinux config transformed\n"); - menu = grub_env_get_menu (); + menu = VasEBoot_env_get_menu (); if (! menu) { - menu = grub_zalloc (sizeof (*menu)); + menu = VasEBoot_zalloc (sizeof (*menu)); if (! menu) { - grub_free (result); - return grub_errno; + VasEBoot_free (result); + return VasEBoot_errno; } - grub_env_set_menu (menu); + VasEBoot_env_set_menu (menu); } - grub_normal_parse_line (result, syslinux_file_getline, NULL); - grub_print_error (); - grub_free (result); - grub_free (cwdf); + VasEBoot_normal_parse_line (result, syslinux_file_getline, NULL); + VasEBoot_print_error (); + VasEBoot_free (result); + VasEBoot_free (cwdf); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_syslinux_source (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_syslinux_source (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { int new_env, extractor; - grub_err_t ret; + VasEBoot_err_t ret; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); extractor = (ctxt->extcmd->cmd->name[0] == 'e'); new_env = (ctxt->extcmd->cmd->name[extractor ? (sizeof ("extract_syslinux_entries_") - 1) : (sizeof ("syslinux_") - 1)] == 'c'); if (new_env) - grub_cls (); + VasEBoot_cls (); if (new_env && !extractor) - grub_env_context_open (); + VasEBoot_env_context_open (); if (extractor) - grub_env_extractor_open (!new_env); + VasEBoot_env_extractor_open (!new_env); ret = syslinux_file (ctxt, args[0]); if (new_env) { - grub_menu_t menu; - menu = grub_env_get_menu (); + VasEBoot_menu_t menu; + menu = VasEBoot_env_get_menu (); if (menu && menu->size) - grub_show_menu (menu, 1, 0); + VasEBoot_show_menu (menu, 1, 0); if (!extractor) - grub_env_context_close (); + VasEBoot_env_context_close (); } if (extractor) - grub_env_extractor_close (!new_env); + VasEBoot_env_extractor_close (!new_env); return ret; } -static grub_extcmd_t cmd_source, cmd_configfile; -static grub_extcmd_t cmd_source_extract, cmd_configfile_extract; +static VasEBoot_extcmd_t cmd_source, cmd_configfile; +static VasEBoot_extcmd_t cmd_source_extract, cmd_configfile_extract; -GRUB_MOD_INIT(syslinuxcfg) +VasEBoot_MOD_INIT(syslinuxcfg) { cmd_source - = grub_register_extcmd ("syslinux_source", - grub_cmd_syslinux_source, 0, + = VasEBoot_register_extcmd ("syslinux_source", + VasEBoot_cmd_syslinux_source, 0, N_("FILE"), /* TRANSLATORS: "syslinux config" means "config as used by syslinux". */ N_("Execute syslinux config in same context"), options); cmd_configfile - = grub_register_extcmd ("syslinux_configfile", - grub_cmd_syslinux_source, 0, + = VasEBoot_register_extcmd ("syslinux_configfile", + VasEBoot_cmd_syslinux_source, 0, N_("FILE"), N_("Execute syslinux config in new context"), options); cmd_source_extract - = grub_register_extcmd ("extract_syslinux_entries_source", - grub_cmd_syslinux_source, 0, + = VasEBoot_register_extcmd ("extract_syslinux_entries_source", + VasEBoot_cmd_syslinux_source, 0, N_("FILE"), N_("Execute syslinux config in same context taking only menu entries"), options); cmd_configfile_extract - = grub_register_extcmd ("extract_syslinux_entries_configfile", - grub_cmd_syslinux_source, 0, + = VasEBoot_register_extcmd ("extract_syslinux_entries_configfile", + VasEBoot_cmd_syslinux_source, 0, N_("FILE"), N_("Execute syslinux config in new context taking only menu entries"), options); } -GRUB_MOD_FINI(syslinuxcfg) +VasEBoot_MOD_FINI(syslinuxcfg) { - grub_unregister_extcmd (cmd_source); - grub_unregister_extcmd (cmd_configfile); - grub_unregister_extcmd (cmd_source_extract); - grub_unregister_extcmd (cmd_configfile_extract); + VasEBoot_unregister_extcmd (cmd_source); + VasEBoot_unregister_extcmd (cmd_configfile); + VasEBoot_unregister_extcmd (cmd_source_extract); + VasEBoot_unregister_extcmd (cmd_configfile_extract); } diff --git a/VasEBoot-core/commands/terminal.c b/VasEBoot-core/commands/terminal.c index 3002186d2..cff89f8b9 100644 --- a/VasEBoot-core/commands/terminal.c +++ b/VasEBoot-core/commands/terminal.c @@ -1,93 +1,93 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_term_autoload *grub_term_input_autoload = NULL; -struct grub_term_autoload *grub_term_output_autoload = NULL; +struct VasEBoot_term_autoload *VasEBoot_term_input_autoload = NULL; +struct VasEBoot_term_autoload *VasEBoot_term_output_autoload = NULL; struct abstract_terminal { struct abstract_terminal *next; struct abstract_terminal *prev; const char *name; - grub_err_t (*init) (struct abstract_terminal *term); - grub_err_t (*fini) (struct abstract_terminal *term); + VasEBoot_err_t (*init) (struct abstract_terminal *term); + VasEBoot_err_t (*fini) (struct abstract_terminal *term); }; -static grub_err_t +static VasEBoot_err_t handle_command (int argc, char **args, struct abstract_terminal **enabled, struct abstract_terminal **disabled, - struct grub_term_autoload *autoloads, + struct VasEBoot_term_autoload *autoloads, const char *active_str, const char *available_str) { int i; struct abstract_terminal *term; - struct grub_term_autoload *aut; + struct VasEBoot_term_autoload *aut; if (argc == 0) { - grub_puts_ (active_str); + VasEBoot_puts_ (active_str); for (term = *enabled; term; term = term->next) - grub_printf ("%s ", term->name); - grub_printf ("\n"); - grub_puts_ (available_str); + VasEBoot_printf ("%s ", term->name); + VasEBoot_printf ("\n"); + VasEBoot_puts_ (available_str); for (term = *disabled; term; term = term->next) - grub_printf ("%s ", term->name); + VasEBoot_printf ("%s ", term->name); /* This is quadratic but we don't expect mode than 30 terminal modules ever. */ for (aut = autoloads; aut; aut = aut->next) { for (term = *disabled; term; term = term->next) - if (grub_strcmp (term->name, aut->name) == 0 - || (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*' - && grub_memcmp (term->name, aut->name, - grub_strlen (aut->name) - 1) == 0)) + if (VasEBoot_strcmp (term->name, aut->name) == 0 + || (aut->name[0] && aut->name[VasEBoot_strlen (aut->name) - 1] == '*' + && VasEBoot_memcmp (term->name, aut->name, + VasEBoot_strlen (aut->name) - 1) == 0)) break; if (!term) for (term = *enabled; term; term = term->next) - if (grub_strcmp (term->name, aut->name) == 0 - || (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*' - && grub_memcmp (term->name, aut->name, - grub_strlen (aut->name) - 1) == 0)) + if (VasEBoot_strcmp (term->name, aut->name) == 0 + || (aut->name[0] && aut->name[VasEBoot_strlen (aut->name) - 1] == '*' + && VasEBoot_memcmp (term->name, aut->name, + VasEBoot_strlen (aut->name) - 1) == 0)) break; if (!term) - grub_printf ("%s ", aut->name); + VasEBoot_printf ("%s ", aut->name); } - grub_printf ("\n"); - return GRUB_ERR_NONE; + VasEBoot_printf ("\n"); + return VasEBoot_ERR_NONE; } i = 0; - if (grub_strcmp (args[0], "--append") == 0 - || grub_strcmp (args[0], "--remove") == 0) + if (VasEBoot_strcmp (args[0], "--append") == 0 + || VasEBoot_strcmp (args[0], "--remove") == 0) i++; if (i == argc) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_ ("no terminal specified")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_ ("no terminal specified")); for (; i < argc; i++) { @@ -95,110 +95,110 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled, while (1) { for (term = *disabled; term; term = term->next) - if (grub_strcmp (args[i], term->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", term->name) == 0)) + if (VasEBoot_strcmp (args[i], term->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", term->name) == 0)) break; if (term == 0) for (term = *enabled; term; term = term->next) - if (grub_strcmp (args[i], term->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", term->name) == 0)) + if (VasEBoot_strcmp (args[i], term->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", term->name) == 0)) break; if (term) break; if (again) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("terminal `%s' isn't found"), args[i]); for (aut = autoloads; aut; aut = aut->next) - if (grub_strcmp (args[i], aut->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", aut->name) == 0) - || (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*' - && grub_memcmp (args[i], aut->name, - grub_strlen (aut->name) - 1) == 0)) + if (VasEBoot_strcmp (args[i], aut->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", aut->name) == 0) + || (aut->name[0] && aut->name[VasEBoot_strlen (aut->name) - 1] == '*' + && VasEBoot_memcmp (args[i], aut->name, + VasEBoot_strlen (aut->name) - 1) == 0)) { - grub_dl_t mod; - mod = grub_dl_load (aut->modname); + VasEBoot_dl_t mod; + mod = VasEBoot_dl_load (aut->modname); if (mod) - grub_dl_ref (mod); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dl_ref (mod); + VasEBoot_errno = VasEBoot_ERR_NONE; break; } - if (grub_memcmp (args[i], "serial_usb", + if (VasEBoot_memcmp (args[i], "serial_usb", sizeof ("serial_usb") - 1) == 0 - && grub_term_poll_usb) + && VasEBoot_term_poll_usb) { - grub_term_poll_usb (1); + VasEBoot_term_poll_usb (1); again = 1; continue; } if (!aut) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("terminal `%s' isn't found"), args[i]); again = 1; } } - if (grub_strcmp (args[0], "--append") == 0) + if (VasEBoot_strcmp (args[0], "--append") == 0) { for (i = 1; i < argc; i++) { for (term = *disabled; term; term = term->next) - if (grub_strcmp (args[i], term->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", term->name) == 0)) + if (VasEBoot_strcmp (args[i], term->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", term->name) == 0)) break; if (term) { - if (term->init && term->init (term) != GRUB_ERR_NONE) - return grub_errno; + if (term->init && term->init (term) != VasEBoot_ERR_NONE) + return VasEBoot_errno; - grub_list_remove (GRUB_AS_LIST (term)); - grub_list_push (GRUB_AS_LIST_P (enabled), GRUB_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (enabled), VasEBoot_AS_LIST (term)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_strcmp (args[0], "--remove") == 0) + if (VasEBoot_strcmp (args[0], "--remove") == 0) { for (i = 1; i < argc; i++) { for (term = *enabled; term; term = term->next) - if (grub_strcmp (args[i], term->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", term->name) == 0)) + if (VasEBoot_strcmp (args[i], term->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", term->name) == 0)) break; if (term) { if (!term->next && term == *enabled) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "can't remove the last terminal"); - grub_list_remove (GRUB_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); if (term->fini) term->fini (term); - grub_list_push (GRUB_AS_LIST_P (disabled), GRUB_AS_LIST (term)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (disabled), VasEBoot_AS_LIST (term)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } for (i = 0; i < argc; i++) { for (term = *disabled; term; term = term->next) - if (grub_strcmp (args[i], term->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", term->name) == 0)) + if (VasEBoot_strcmp (args[i], term->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", term->name) == 0)) break; if (term) { - if (term->init && term->init (term) != GRUB_ERR_NONE) - return grub_errno; + if (term->init && term->init (term) != VasEBoot_ERR_NONE) + return VasEBoot_errno; - grub_list_remove (GRUB_AS_LIST (term)); - grub_list_push (GRUB_AS_LIST_P (enabled), GRUB_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (enabled), VasEBoot_AS_LIST (term)); } } @@ -208,78 +208,78 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled, { next = term->next; for (i = 0; i < argc; i++) - if (grub_strcmp (args[i], term->name) == 0 - || (grub_strcmp (args[i], "ofconsole") == 0 - && grub_strcmp ("console", term->name) == 0)) + if (VasEBoot_strcmp (args[i], term->name) == 0 + || (VasEBoot_strcmp (args[i], "ofconsole") == 0 + && VasEBoot_strcmp ("console", term->name) == 0)) break; if (i == argc) { if (!term->next && term == *enabled) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "can't remove the last terminal"); - grub_list_remove (GRUB_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); if (term->fini) term->fini (term); - grub_list_push (GRUB_AS_LIST_P (disabled), GRUB_AS_LIST (term)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (disabled), VasEBoot_AS_LIST (term)); } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_terminal_input (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_terminal_input (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - (void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, next); - (void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, prev); - (void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, name); - (void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, init); - (void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, fini); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_inputs, struct abstract_terminal *, next); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_inputs, struct abstract_terminal *, prev); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_inputs, struct abstract_terminal *, name); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_inputs, struct abstract_terminal *, init); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_inputs, struct abstract_terminal *, fini); return handle_command (argc, args, - (struct abstract_terminal **) (void *) &grub_term_inputs, - (struct abstract_terminal **) (void *) &grub_term_inputs_disabled, - grub_term_input_autoload, + (struct abstract_terminal **) (void *) &VasEBoot_term_inputs, + (struct abstract_terminal **) (void *) &VasEBoot_term_inputs_disabled, + VasEBoot_term_input_autoload, N_ ("Active input terminals:"), N_ ("Available input terminals:")); } -static grub_err_t -grub_cmd_terminal_output (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_terminal_output (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - (void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, next); - (void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, prev); - (void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, name); - (void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, init); - (void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, fini); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_outputs, struct abstract_terminal *, next); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_outputs, struct abstract_terminal *, prev); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_outputs, struct abstract_terminal *, name); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_outputs, struct abstract_terminal *, init); + (void) VasEBoot_FIELD_MATCH (VasEBoot_term_outputs, struct abstract_terminal *, fini); return handle_command (argc, args, - (struct abstract_terminal **) (void *) &grub_term_outputs, - (struct abstract_terminal **) (void *) &grub_term_outputs_disabled, - grub_term_output_autoload, + (struct abstract_terminal **) (void *) &VasEBoot_term_outputs, + (struct abstract_terminal **) (void *) &VasEBoot_term_outputs_disabled, + VasEBoot_term_output_autoload, N_ ("Active output terminals:"), N_ ("Available output terminals:")); } -static grub_command_t cmd_terminal_input, cmd_terminal_output; +static VasEBoot_command_t cmd_terminal_input, cmd_terminal_output; -GRUB_MOD_INIT(terminal) +VasEBoot_MOD_INIT(terminal) { cmd_terminal_input = - grub_register_command ("terminal_input", grub_cmd_terminal_input, + VasEBoot_register_command ("terminal_input", VasEBoot_cmd_terminal_input, N_("[--append|--remove] " "[TERMINAL1] [TERMINAL2] ..."), N_("List or select an input terminal.")); cmd_terminal_output = - grub_register_command ("terminal_output", grub_cmd_terminal_output, + VasEBoot_register_command ("terminal_output", VasEBoot_cmd_terminal_output, N_("[--append|--remove] " "[TERMINAL1] [TERMINAL2] ..."), N_("List or select an output terminal.")); } -GRUB_MOD_FINI(terminal) +VasEBoot_MOD_FINI(terminal) { - grub_unregister_command (cmd_terminal_input); - grub_unregister_command (cmd_terminal_output); + VasEBoot_unregister_command (cmd_terminal_input); + VasEBoot_unregister_command (cmd_terminal_output); } diff --git a/VasEBoot-core/commands/test.c b/VasEBoot-core/commands/test.c index 5f06642f6..07843fbbb 100644 --- a/VasEBoot-core/commands/test.c +++ b/VasEBoot-core/commands/test.c @@ -1,41 +1,41 @@ /* test.c -- The test command.. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* A simple implementation for signed numbers. */ static int -grub_strtosl (char *arg, char **end, int base) +VasEBoot_strtosl (char *arg, char **end, int base) { if (arg[0] == '-') - return -grub_strtoul (arg + 1, end, base); - return grub_strtoul (arg, end, base); + return -VasEBoot_strtoul (arg + 1, end, base); + return VasEBoot_strtoul (arg, end, base); } /* Context for test_parse. */ @@ -44,7 +44,7 @@ struct test_parse_ctx int invert; int or, and; int file_exists; - struct grub_dirhook_info file_info; + struct VasEBoot_dirhook_info file_info; char *filename; }; @@ -58,13 +58,13 @@ update_val (int val, struct test_parse_ctx *ctx) /* A hook for iterating directories. */ static int -find_file (const char *cur_filename, const struct grub_dirhook_info *info, +find_file (const char *cur_filename, const struct VasEBoot_dirhook_info *info, void *data) { struct test_parse_ctx *ctx = data; - if ((info->case_insensitive ? grub_strcasecmp (cur_filename, ctx->filename) - : grub_strcmp (cur_filename, ctx->filename)) == 0) + if ((info->case_insensitive ? VasEBoot_strcasecmp (cur_filename, ctx->filename) + : VasEBoot_strcmp (cur_filename, ctx->filename)) == 0) { ctx->file_info = *info; ctx->file_exists = 1; @@ -79,47 +79,47 @@ get_fileinfo (char *path, struct test_parse_ctx *ctx) { char *pathname; char *device_name; - grub_fs_t fs; - grub_device_t dev; + VasEBoot_fs_t fs; + VasEBoot_device_t dev; ctx->file_exists = 0; - device_name = grub_file_get_device_name (path); - dev = grub_device_open (device_name); + device_name = VasEBoot_file_get_device_name (path); + dev = VasEBoot_device_open (device_name); if (! dev) { - grub_free (device_name); + VasEBoot_free (device_name); return; } - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) { - grub_free (device_name); - grub_device_close (dev); + VasEBoot_free (device_name); + VasEBoot_device_close (dev); return; } - pathname = grub_strchr (path, ')'); + pathname = VasEBoot_strchr (path, ')'); if (! pathname) pathname = path; else pathname++; /* Remove trailing '/'. */ - while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') - pathname[grub_strlen (pathname) - 1] = 0; + while (*pathname && pathname[VasEBoot_strlen (pathname) - 1] == '/') + pathname[VasEBoot_strlen (pathname) - 1] = 0; /* Split into path and filename. */ - ctx->filename = grub_strrchr (pathname, '/'); + ctx->filename = VasEBoot_strrchr (pathname, '/'); if (! ctx->filename) { - path = grub_strdup ("/"); + path = VasEBoot_strdup ("/"); ctx->filename = pathname; } else { ctx->filename++; - path = grub_strdup (pathname); + path = VasEBoot_strdup (pathname); path[ctx->filename - pathname] = 0; } @@ -127,7 +127,7 @@ get_fileinfo (char *path, struct test_parse_ctx *ctx) if (! *pathname) { ctx->file_exists = 1; - grub_memset (&ctx->file_info, 0, sizeof (ctx->file_info)); + VasEBoot_memset (&ctx->file_info, 0, sizeof (ctx->file_info)); /* Root is always a directory. */ ctx->file_info.dir = 1; @@ -137,15 +137,15 @@ get_fileinfo (char *path, struct test_parse_ctx *ctx) { if (! fs->mtime (dev, &ctx->file_info.mtime)) ctx->file_info.mtimeset = 1; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } } else (fs->dir) (dev, path, find_file, ctx); - grub_device_close (dev); - grub_free (path); - grub_free (device_name); + VasEBoot_device_close (dev); + VasEBoot_free (path); + VasEBoot_free (device_name); } /* Parse a test expression starting from *argn. */ @@ -165,109 +165,109 @@ test_parse (char **args, int *argn, int argc) if (*argn + 2 < argc) { /* String tests. */ - if (grub_strcmp (args[*argn + 1], "=") == 0 - || grub_strcmp (args[*argn + 1], "==") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "=") == 0 + || VasEBoot_strcmp (args[*argn + 1], "==") == 0) { - update_val (grub_strcmp (args[*argn], args[*argn + 2]) == 0, + update_val (VasEBoot_strcmp (args[*argn], args[*argn + 2]) == 0, &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "!=") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "!=") == 0) { - update_val (grub_strcmp (args[*argn], args[*argn + 2]) != 0, + update_val (VasEBoot_strcmp (args[*argn], args[*argn + 2]) != 0, &ctx); (*argn) += 3; continue; } - /* GRUB extension: lexicographical sorting. */ - if (grub_strcmp (args[*argn + 1], "<") == 0) + /* VasEBoot extension: lexicographical sorting. */ + if (VasEBoot_strcmp (args[*argn + 1], "<") == 0) { - update_val (grub_strcmp (args[*argn], args[*argn + 2]) < 0, + update_val (VasEBoot_strcmp (args[*argn], args[*argn + 2]) < 0, &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "<=") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "<=") == 0) { - update_val (grub_strcmp (args[*argn], args[*argn + 2]) <= 0, + update_val (VasEBoot_strcmp (args[*argn], args[*argn + 2]) <= 0, &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], ">") == 0) + if (VasEBoot_strcmp (args[*argn + 1], ">") == 0) { - update_val (grub_strcmp (args[*argn], args[*argn + 2]) > 0, + update_val (VasEBoot_strcmp (args[*argn], args[*argn + 2]) > 0, &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], ">=") == 0) + if (VasEBoot_strcmp (args[*argn + 1], ">=") == 0) { - update_val (grub_strcmp (args[*argn], args[*argn + 2]) >= 0, + update_val (VasEBoot_strcmp (args[*argn], args[*argn + 2]) >= 0, &ctx); (*argn) += 3; continue; } /* Number tests. */ - if (grub_strcmp (args[*argn + 1], "-eq") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-eq") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) - == grub_strtosl (args[*argn + 2], 0, 0), &ctx); + update_val (VasEBoot_strtosl (args[*argn], 0, 0) + == VasEBoot_strtosl (args[*argn + 2], 0, 0), &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "-ge") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-ge") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) - >= grub_strtosl (args[*argn + 2], 0, 0), &ctx); + update_val (VasEBoot_strtosl (args[*argn], 0, 0) + >= VasEBoot_strtosl (args[*argn + 2], 0, 0), &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "-gt") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-gt") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) - > grub_strtosl (args[*argn + 2], 0, 0), &ctx); + update_val (VasEBoot_strtosl (args[*argn], 0, 0) + > VasEBoot_strtosl (args[*argn + 2], 0, 0), &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "-le") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-le") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) - <= grub_strtosl (args[*argn + 2], 0, 0), &ctx); + update_val (VasEBoot_strtosl (args[*argn], 0, 0) + <= VasEBoot_strtosl (args[*argn + 2], 0, 0), &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "-lt") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-lt") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) - < grub_strtosl (args[*argn + 2], 0, 0), &ctx); + update_val (VasEBoot_strtosl (args[*argn], 0, 0) + < VasEBoot_strtosl (args[*argn + 2], 0, 0), &ctx); (*argn) += 3; continue; } - if (grub_strcmp (args[*argn + 1], "-ne") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-ne") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) - != grub_strtosl (args[*argn + 2], 0, 0), &ctx); + update_val (VasEBoot_strtosl (args[*argn], 0, 0) + != VasEBoot_strtosl (args[*argn + 2], 0, 0), &ctx); (*argn) += 3; continue; } - /* GRUB extension: compare numbers skipping prefixes. + /* VasEBoot extension: compare numbers skipping prefixes. Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */ - if (grub_strcmp (args[*argn + 1], "-pgt") == 0 - || grub_strcmp (args[*argn + 1], "-plt") == 0) + if (VasEBoot_strcmp (args[*argn + 1], "-pgt") == 0 + || VasEBoot_strcmp (args[*argn + 1], "-plt") == 0) { int i; /* Skip common prefix. */ @@ -276,26 +276,26 @@ test_parse (char **args, int *argn, int argc) /* Go the digits back. */ i--; - while (grub_isdigit (args[*argn][i]) && i > 0) + while (VasEBoot_isdigit (args[*argn][i]) && i > 0) i--; i++; - if (grub_strcmp (args[*argn + 1], "-pgt") == 0) - update_val (grub_strtoul (args[*argn] + i, 0, 0) - > grub_strtoul (args[*argn + 2] + i, 0, 0), &ctx); + if (VasEBoot_strcmp (args[*argn + 1], "-pgt") == 0) + update_val (VasEBoot_strtoul (args[*argn] + i, 0, 0) + > VasEBoot_strtoul (args[*argn + 2] + i, 0, 0), &ctx); else - update_val (grub_strtoul (args[*argn] + i, 0, 0) - < grub_strtoul (args[*argn + 2] + i, 0, 0), &ctx); + update_val (VasEBoot_strtoul (args[*argn] + i, 0, 0) + < VasEBoot_strtoul (args[*argn + 2] + i, 0, 0), &ctx); (*argn) += 3; continue; } - /* -nt and -ot tests. GRUB extension: when doing -?t bias + /* -nt and -ot tests. VasEBoot extension: when doing -?t bias will be added to the first mtime. */ - if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0 - || grub_memcmp (args[*argn + 1], "-ot", 3) == 0) + if (VasEBoot_memcmp (args[*argn + 1], "-nt", 3) == 0 + || VasEBoot_memcmp (args[*argn + 1], "-ot", 3) == 0) { - struct grub_dirhook_info file1; + struct VasEBoot_dirhook_info file1; int file1exists; int bias = 0; @@ -306,9 +306,9 @@ test_parse (char **args, int *argn, int argc) get_fileinfo (args[*argn + 2], &ctx); if (args[*argn + 1][3]) - bias = grub_strtosl (args[*argn + 1] + 3, 0, 0); + bias = VasEBoot_strtosl (args[*argn + 1] + 3, 0, 0); - if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0) + if (VasEBoot_memcmp (args[*argn + 1], "-nt", 3) == 0) update_val ((file1exists && ! ctx.file_exists) || (file1.mtimeset && ctx.file_info.mtimeset && file1.mtime + bias > ctx.file_info.mtime), @@ -327,7 +327,7 @@ test_parse (char **args, int *argn, int argc) if (*argn + 1 < argc) { /* File tests. */ - if (grub_strcmp (args[*argn], "-d") == 0) + if (VasEBoot_strcmp (args[*argn], "-d") == 0) { get_fileinfo (args[*argn + 1], &ctx); update_val (ctx.file_exists && ctx.file_info.dir, &ctx); @@ -335,7 +335,7 @@ test_parse (char **args, int *argn, int argc) continue; } - if (grub_strcmp (args[*argn], "-e") == 0) + if (VasEBoot_strcmp (args[*argn], "-e") == 0) { get_fileinfo (args[*argn + 1], &ctx); update_val (ctx.file_exists, &ctx); @@ -343,7 +343,7 @@ test_parse (char **args, int *argn, int argc) continue; } - if (grub_strcmp (args[*argn], "-f") == 0) + if (VasEBoot_strcmp (args[*argn], "-f") == 0) { get_fileinfo (args[*argn + 1], &ctx); /* FIXME: check for other types. */ @@ -352,28 +352,28 @@ test_parse (char **args, int *argn, int argc) continue; } - if (grub_strcmp (args[*argn], "-s") == 0) + if (VasEBoot_strcmp (args[*argn], "-s") == 0) { - grub_file_t file; - grub_file_filter_disable_compression (); - file = grub_file_open (args[*argn + 1]); - update_val (file && (grub_file_size (file) != 0), &ctx); + VasEBoot_file_t file; + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (args[*argn + 1]); + update_val (file && (VasEBoot_file_size (file) != 0), &ctx); if (file) - grub_file_close (file); - grub_errno = GRUB_ERR_NONE; + VasEBoot_file_close (file); + VasEBoot_errno = VasEBoot_ERR_NONE; (*argn) += 2; continue; } /* String tests. */ - if (grub_strcmp (args[*argn], "-n") == 0) + if (VasEBoot_strcmp (args[*argn], "-n") == 0) { update_val (args[*argn + 1][0], &ctx); (*argn) += 2; continue; } - if (grub_strcmp (args[*argn], "-z") == 0) + if (VasEBoot_strcmp (args[*argn], "-z") == 0) { update_val (! args[*argn + 1][0], &ctx); (*argn) += 2; @@ -384,31 +384,31 @@ test_parse (char **args, int *argn, int argc) /* Special modifiers. */ /* End of expression. return to parent. */ - if (grub_strcmp (args[*argn], ")") == 0) + if (VasEBoot_strcmp (args[*argn], ")") == 0) { (*argn)++; return ctx.or || ctx.and; } /* Recursively invoke if parenthesis. */ - if (grub_strcmp (args[*argn], "(") == 0) + if (VasEBoot_strcmp (args[*argn], "(") == 0) { (*argn)++; update_val (test_parse (args, argn, argc), &ctx); continue; } - if (grub_strcmp (args[*argn], "!") == 0) + if (VasEBoot_strcmp (args[*argn], "!") == 0) { ctx.invert = ! ctx.invert; (*argn)++; continue; } - if (grub_strcmp (args[*argn], "-a") == 0) + if (VasEBoot_strcmp (args[*argn], "-a") == 0) { (*argn)++; continue; } - if (grub_strcmp (args[*argn], "-o") == 0) + if (VasEBoot_strcmp (args[*argn], "-o") == 0) { ctx.or = ctx.or || ctx.and; ctx.and = 1; @@ -423,33 +423,33 @@ test_parse (char **args, int *argn, int argc) return ctx.or || ctx.and; } -static grub_err_t -grub_cmd_test (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_test (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { int argn = 0; - if (argc >= 1 && grub_strcmp (args[argc - 1], "]") == 0) + if (argc >= 1 && VasEBoot_strcmp (args[argc - 1], "]") == 0) argc--; - return test_parse (args, &argn, argc) ? GRUB_ERR_NONE - : grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + return test_parse (args, &argn, argc) ? VasEBoot_ERR_NONE + : VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); } -static grub_command_t cmd_1, cmd_2; +static VasEBoot_command_t cmd_1, cmd_2; -GRUB_MOD_INIT(test) +VasEBoot_MOD_INIT(test) { - cmd_1 = grub_register_command ("[", grub_cmd_test, + cmd_1 = VasEBoot_register_command ("[", VasEBoot_cmd_test, N_("EXPRESSION ]"), N_("Evaluate an expression.")); - cmd_1->flags |= GRUB_COMMAND_FLAG_EXTRACTOR; - cmd_2 = grub_register_command ("test", grub_cmd_test, + cmd_1->flags |= VasEBoot_COMMAND_FLAG_EXTRACTOR; + cmd_2 = VasEBoot_register_command ("test", VasEBoot_cmd_test, N_("EXPRESSION"), N_("Evaluate an expression.")); - cmd_2->flags |= GRUB_COMMAND_FLAG_EXTRACTOR; + cmd_2->flags |= VasEBoot_COMMAND_FLAG_EXTRACTOR; } -GRUB_MOD_FINI(test) +VasEBoot_MOD_FINI(test) { - grub_unregister_command (cmd_1); - grub_unregister_command (cmd_2); + VasEBoot_unregister_command (cmd_1); + VasEBoot_unregister_command (cmd_2); } diff --git a/VasEBoot-core/commands/testload.c b/VasEBoot-core/commands/testload.c index cfab6763d..af1a3ba94 100644 --- a/VasEBoot-core/commands/testload.c +++ b/VasEBoot-core/commands/testload.c @@ -1,170 +1,170 @@ /* testload.c - load the same file in multiple ways */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -/* Helper for grub_cmd_testload. */ +/* Helper for VasEBoot_cmd_testload. */ static void -read_progress (grub_disk_addr_t sector __attribute__ ((unused)), +read_progress (VasEBoot_disk_addr_t sector __attribute__ ((unused)), unsigned offset __attribute__ ((unused)), unsigned len, void *data __attribute__ ((unused))) { - for (; len >= GRUB_DISK_SECTOR_SIZE; len -= GRUB_DISK_SECTOR_SIZE) - grub_xputs ("."); + for (; len >= VasEBoot_DISK_SECTOR_SIZE; len -= VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_xputs ("."); if (len) - grub_xputs ("."); - grub_refresh (); + VasEBoot_xputs ("."); + VasEBoot_refresh (); } -static grub_err_t -grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_testload (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file; + VasEBoot_file_t file; char *buf; - grub_size_t size; - grub_off_t pos; + VasEBoot_size_t size; + VasEBoot_off_t pos; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - size = grub_file_size (file) & ~(GRUB_DISK_SECTOR_SIZE - 1); + size = VasEBoot_file_size (file) & ~(VasEBoot_DISK_SECTOR_SIZE - 1); if (size == 0) { - grub_file_close (file); - return GRUB_ERR_NONE; + VasEBoot_file_close (file); + return VasEBoot_ERR_NONE; } - buf = grub_malloc (size); + buf = VasEBoot_malloc (size); if (! buf) goto fail; - grub_printf ("Reading %s sequentially", argv[0]); + VasEBoot_printf ("Reading %s sequentially", argv[0]); file->read_hook = read_progress; - if (grub_file_read (file, buf, size) != (grub_ssize_t) size) + if (VasEBoot_file_read (file, buf, size) != (VasEBoot_ssize_t) size) goto fail; - grub_printf (" Done.\n"); + VasEBoot_printf (" Done.\n"); /* Read sequentially again. */ - grub_printf ("Reading %s sequentially again", argv[0]); - grub_file_seek (file, 0); + VasEBoot_printf ("Reading %s sequentially again", argv[0]); + VasEBoot_file_seek (file, 0); for (pos = 0; pos < size;) { - char sector[GRUB_DISK_SECTOR_SIZE]; - grub_size_t curlen = GRUB_DISK_SECTOR_SIZE; + char sector[VasEBoot_DISK_SECTOR_SIZE]; + VasEBoot_size_t curlen = VasEBoot_DISK_SECTOR_SIZE; if (curlen > size - pos) curlen = size - pos; - if (grub_file_read (file, sector, curlen) - != (grub_ssize_t) curlen) + if (VasEBoot_file_read (file, sector, curlen) + != (VasEBoot_ssize_t) curlen) goto fail; - if (grub_memcmp (sector, buf + pos, curlen) != 0) + if (VasEBoot_memcmp (sector, buf + pos, curlen) != 0) { - grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos); + VasEBoot_printf ("\nDiffers in %lld\n", (unsigned long long) pos); goto fail; } pos += curlen; } - grub_printf (" Done.\n"); + VasEBoot_printf (" Done.\n"); /* Read backwards and compare. */ - grub_printf ("Reading %s backwards", argv[0]); + VasEBoot_printf ("Reading %s backwards", argv[0]); pos = size; while (pos > 0) { - char sector[GRUB_DISK_SECTOR_SIZE]; + char sector[VasEBoot_DISK_SECTOR_SIZE]; - if (pos >= GRUB_DISK_SECTOR_SIZE) - pos -= GRUB_DISK_SECTOR_SIZE; + if (pos >= VasEBoot_DISK_SECTOR_SIZE) + pos -= VasEBoot_DISK_SECTOR_SIZE; else pos = 0; - grub_file_seek (file, pos); + VasEBoot_file_seek (file, pos); - if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE) - != GRUB_DISK_SECTOR_SIZE) + if (VasEBoot_file_read (file, sector, VasEBoot_DISK_SECTOR_SIZE) + != VasEBoot_DISK_SECTOR_SIZE) goto fail; - if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0) + if (VasEBoot_memcmp (sector, buf + pos, VasEBoot_DISK_SECTOR_SIZE) != 0) { int i; - grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos); + VasEBoot_printf ("\nDiffers in %lld\n", (unsigned long long) pos); - for (i = 0; i < GRUB_DISK_SECTOR_SIZE; i++) + for (i = 0; i < VasEBoot_DISK_SECTOR_SIZE; i++) { - grub_printf ("%02x ", buf[pos + i]); + VasEBoot_printf ("%02x ", buf[pos + i]); if ((i & 15) == 15) - grub_printf ("\n"); + VasEBoot_printf ("\n"); } if (i) - grub_refresh (); + VasEBoot_refresh (); goto fail; } } - grub_printf (" Done.\n"); + VasEBoot_printf (" Done.\n"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_file_close (file); - grub_free (buf); + VasEBoot_file_close (file); + VasEBoot_free (buf); - if (!grub_errno) - grub_error (GRUB_ERR_IO, "bad read"); - return grub_errno; + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_IO, "bad read"); + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(testload) +VasEBoot_MOD_INIT(testload) { cmd = - grub_register_command ("testload", grub_cmd_testload, + VasEBoot_register_command ("testload", VasEBoot_cmd_testload, N_("FILE"), N_("Load the same file in multiple ways.")); } -GRUB_MOD_FINI(testload) +VasEBoot_MOD_FINI(testload) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/testspeed.c b/VasEBoot-core/commands/testspeed.c index 042645f8d..39606afc3 100644 --- a/VasEBoot-core/commands/testspeed.c +++ b/VasEBoot-core/commands/testspeed.c @@ -1,115 +1,115 @@ /* testspeed.c - Command to test file read speed */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define DEFAULT_BLOCK_SIZE 65536 -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"size", 's', 0, N_("Specify size for each read operation"), 0, ARG_TYPE_INT}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_testspeed (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_testspeed (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - grub_uint64_t start; - grub_uint64_t end; - grub_ssize_t block_size; - grub_disk_addr_t total_size; + struct VasEBoot_arg_list *state = ctxt->state; + VasEBoot_uint64_t start; + VasEBoot_uint64_t end; + VasEBoot_ssize_t block_size; + VasEBoot_disk_addr_t total_size; char *buffer; - grub_file_t file; - grub_uint64_t whole, fraction; + VasEBoot_file_t file; + VasEBoot_uint64_t whole, fraction; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); block_size = (state[0].set) ? - grub_strtoul (state[0].arg, 0, 0) : DEFAULT_BLOCK_SIZE; + VasEBoot_strtoul (state[0].arg, 0, 0) : DEFAULT_BLOCK_SIZE; if (block_size <= 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid block size")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid block size")); - buffer = grub_malloc (block_size); + buffer = VasEBoot_malloc (block_size); if (buffer == NULL) - return grub_errno; + return VasEBoot_errno; - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (file == NULL) goto quit; total_size = 0; - start = grub_get_time_ms (); + start = VasEBoot_get_time_ms (); while (1) { - grub_ssize_t size = grub_file_read (file, buffer, block_size); + VasEBoot_ssize_t size = VasEBoot_file_read (file, buffer, block_size); if (size <= 0) break; total_size += size; } - end = grub_get_time_ms (); - grub_file_close (file); + end = VasEBoot_get_time_ms (); + VasEBoot_file_close (file); - grub_printf_ (N_("File size: %s\n"), - grub_get_human_size (total_size, GRUB_HUMAN_SIZE_NORMAL)); - whole = grub_divmod64 (end - start, 1000, &fraction); - grub_printf_ (N_("Elapsed time: %d.%03d s \n"), + VasEBoot_printf_ (N_("File size: %s\n"), + VasEBoot_get_human_size (total_size, VasEBoot_HUMAN_SIZE_NORMAL)); + whole = VasEBoot_divmod64 (end - start, 1000, &fraction); + VasEBoot_printf_ (N_("Elapsed time: %d.%03d s \n"), (unsigned) whole, (unsigned) fraction); if (end != start) { - grub_uint64_t speed = - grub_divmod64 (total_size * 100ULL * 1000ULL, end - start, 0); + VasEBoot_uint64_t speed = + VasEBoot_divmod64 (total_size * 100ULL * 1000ULL, end - start, 0); - grub_printf_ (N_("Speed: %s \n"), - grub_get_human_size (speed, - GRUB_HUMAN_SIZE_SPEED)); + VasEBoot_printf_ (N_("Speed: %s \n"), + VasEBoot_get_human_size (speed, + VasEBoot_HUMAN_SIZE_SPEED)); } quit: - grub_free (buffer); + VasEBoot_free (buffer); - return grub_errno; + return VasEBoot_errno; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(testspeed) +VasEBoot_MOD_INIT(testspeed) { - cmd = grub_register_extcmd ("testspeed", grub_cmd_testspeed, 0, N_("[-s SIZE] FILENAME"), + cmd = VasEBoot_register_extcmd ("testspeed", VasEBoot_cmd_testspeed, 0, N_("[-s SIZE] FILENAME"), N_("Test file read speed."), options); } -GRUB_MOD_FINI(testspeed) +VasEBoot_MOD_FINI(testspeed) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/time.c b/VasEBoot-core/commands/time.c index 40d496e7b..98c32acd9 100644 --- a/VasEBoot-core/commands/time.c +++ b/VasEBoot-core/commands/time.c @@ -1,68 +1,68 @@ /* echo.c - Command to display a line of text */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_time (grub_command_t ctxt __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_time (VasEBoot_command_t ctxt __attribute__ ((unused)), int argc, char **args) { - grub_command_t cmd; - grub_uint32_t start; - grub_uint32_t end; + VasEBoot_command_t cmd; + VasEBoot_uint32_t start; + VasEBoot_uint32_t end; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("no command is specified")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("no command is specified")); - cmd = grub_command_find (args[0]); + cmd = VasEBoot_command_find (args[0]); if (!cmd) - return grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), args[0]); - start = grub_get_time_ms (); + start = VasEBoot_get_time_ms (); (cmd->func) (cmd, argc - 1, &args[1]); - end = grub_get_time_ms (); + end = VasEBoot_get_time_ms (); - grub_printf_ (N_("Elapsed time: %d.%03d seconds \n"), (end - start) / 1000, + VasEBoot_printf_ (N_("Elapsed time: %d.%03d seconds \n"), (end - start) / 1000, (end - start) % 1000); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(time) +VasEBoot_MOD_INIT(time) { - cmd = grub_register_command ("time", grub_cmd_time, + cmd = VasEBoot_register_command ("time", VasEBoot_cmd_time, N_("COMMAND [ARGS]"), N_("Measure time used by COMMAND")); } -GRUB_MOD_FINI(time) +VasEBoot_MOD_FINI(time) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/tr.c b/VasEBoot-core/commands/tr.c index ef72841a2..dff1ee498 100644 --- a/VasEBoot-core/commands/tr.c +++ b/VasEBoot-core/commands/tr.c @@ -1,33 +1,33 @@ /* tr.c -- The tr command. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { { "set", 's', 0, N_("Set a variable to return value."), N_("VARNAME"), ARG_TYPE_STRING }, { "upcase", 'U', 0, N_("Translate to upper case."), 0, 0 }, @@ -38,8 +38,8 @@ static const struct grub_arg_option options[] = static const char *letters_lowercase = "abcdefghijklmnopqrstuvwxyz"; static const char *letters_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -static grub_err_t -grub_cmd_tr (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_tr (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { char *var = 0; const char *input = 0; @@ -51,7 +51,7 @@ grub_cmd_tr (grub_extcmd_context_t ctxt, int argc, char **args) /* Select the defaults from options. */ if (ctxt->state[0].set) { var = ctxt->state[0].arg; - input = grub_env_get (var); + input = VasEBoot_env_get (var); } if (ctxt->state[1].set) { @@ -78,24 +78,24 @@ grub_cmd_tr (grub_extcmd_context_t ctxt, int argc, char **args) input = args[2]; } else if (argc > 3) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many parameters"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "too many parameters"); if (!s1 || !s2 || !input) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing parameters"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "missing parameters"); - if (grub_strlen (s1) != grub_strlen (s2)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "set sizes did not match"); + if (VasEBoot_strlen (s1) != VasEBoot_strlen (s2)) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "set sizes did not match"); /* Translate input into output buffer. */ - output = grub_malloc (grub_strlen (input) + 1); + output = VasEBoot_malloc (VasEBoot_strlen (input) + 1); if (! output) - return grub_errno; + return VasEBoot_errno; optr = output; for (iptr = input; *iptr; iptr++) { - char *p = grub_strchr (s1, *iptr); + char *p = VasEBoot_strchr (s1, *iptr); if (p) *optr++ = s2[p - s1]; else @@ -104,23 +104,23 @@ grub_cmd_tr (grub_extcmd_context_t ctxt, int argc, char **args) *optr = '\0'; if (ctxt->state[0].set) - grub_env_set (var, output); + VasEBoot_env_set (var, output); else - grub_printf ("%s\n", output); + VasEBoot_printf ("%s\n", output); - grub_free (output); - return GRUB_ERR_NONE; + VasEBoot_free (output); + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(tr) +VasEBoot_MOD_INIT(tr) { - cmd = grub_register_extcmd ("tr", grub_cmd_tr, 0, N_("[OPTIONS] [SET1] [SET2] [STRING]"), + cmd = VasEBoot_register_extcmd ("tr", VasEBoot_cmd_tr, 0, N_("[OPTIONS] [SET1] [SET2] [STRING]"), N_("Translate SET1 characters to SET2 in STRING."), options); } -GRUB_MOD_FINI(tr) +VasEBoot_MOD_FINI(tr) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/commands/true.c b/VasEBoot-core/commands/true.c index 8cbba6583..e5e0e21ee 100644 --- a/VasEBoot-core/commands/true.c +++ b/VasEBoot-core/commands/true.c @@ -1,61 +1,61 @@ /* true.c - true and false commands. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_true (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { return 0; } -static grub_err_t -grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_false (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + return VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); } -static grub_command_t cmd_true, cmd_false; +static VasEBoot_command_t cmd_true, cmd_false; -GRUB_MOD_INIT(true) +VasEBoot_MOD_INIT(true) { cmd_true = - grub_register_command ("true", grub_cmd_true, + VasEBoot_register_command ("true", VasEBoot_cmd_true, /* TRANSLATORS: it's a command description. */ 0, N_("Do nothing, successfully.")); cmd_false = - grub_register_command ("false", grub_cmd_false, + VasEBoot_register_command ("false", VasEBoot_cmd_false, /* TRANSLATORS: it's a command description. */ 0, N_("Do nothing, unsuccessfully.")); } -GRUB_MOD_FINI(true) +VasEBoot_MOD_FINI(true) { - grub_unregister_command (cmd_true); - grub_unregister_command (cmd_false); + VasEBoot_unregister_command (cmd_true); + VasEBoot_unregister_command (cmd_false); } diff --git a/VasEBoot-core/commands/usbtest.c b/VasEBoot-core/commands/usbtest.c index 01cdca934..1c511d0fd 100644 --- a/VasEBoot-core/commands/usbtest.c +++ b/VasEBoot-core/commands/usbtest.c @@ -1,33 +1,33 @@ /* usbtest.c - test module for USB */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static const char *usb_classes[] = { @@ -63,75 +63,75 @@ static const char *usb_devspeed[] = "High" }; -static grub_usb_err_t -grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid, +static VasEBoot_usb_err_t +VasEBoot_usb_get_string (VasEBoot_usb_device_t dev, VasEBoot_uint8_t index, int langid, char **string) { - struct grub_usb_desc_str descstr; - struct grub_usb_desc_str *descstrp; - grub_usb_err_t err; + struct VasEBoot_usb_desc_str descstr; + struct VasEBoot_usb_desc_str *descstrp; + VasEBoot_usb_err_t err; /* Only get the length. */ - err = grub_usb_control_msg (dev, 1 << 7, + err = VasEBoot_usb_control_msg (dev, 1 << 7, 0x06, (3 << 8) | index, langid, 1, (char *) &descstr); if (err) return err; - descstrp = grub_malloc (descstr.length); + descstrp = VasEBoot_malloc (descstr.length); if (! descstrp) - return GRUB_USB_ERR_INTERNAL; - err = grub_usb_control_msg (dev, 1 << 7, + return VasEBoot_USB_ERR_INTERNAL; + err = VasEBoot_usb_control_msg (dev, 1 << 7, 0x06, (3 << 8) | index, langid, descstr.length, (char *) descstrp); if (descstrp->length == 0) { - grub_free (descstrp); - *string = grub_strdup (""); + VasEBoot_free (descstrp); + *string = VasEBoot_strdup (""); if (! *string) - return GRUB_USB_ERR_INTERNAL; - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_INTERNAL; + return VasEBoot_USB_ERR_NONE; } - *string = grub_malloc (descstr.length * 2 + 1); + *string = VasEBoot_malloc (descstr.length * 2 + 1); if (! *string) { - grub_free (descstrp); - return GRUB_USB_ERR_INTERNAL; + VasEBoot_free (descstrp); + return VasEBoot_USB_ERR_INTERNAL; } - *grub_utf16_to_utf8 ((grub_uint8_t *) *string, descstrp->str, + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) *string, descstrp->str, descstrp->length / 2 - 1) = 0; - grub_free (descstrp); + VasEBoot_free (descstrp); - return GRUB_USB_ERR_NONE; + return VasEBoot_USB_ERR_NONE; } static void -usb_print_str (const char *description, grub_usb_device_t dev, int idx) +usb_print_str (const char *description, VasEBoot_usb_device_t dev, int idx) { char *name = NULL; - grub_usb_err_t err; + VasEBoot_usb_err_t err; /* XXX: LANGID */ if (! idx) return; - err = grub_usb_get_string (dev, idx, 0x0409, &name); + err = VasEBoot_usb_get_string (dev, idx, 0x0409, &name); if (err) - grub_printf ("Error %d retrieving %s\n", err, description); + VasEBoot_printf ("Error %d retrieving %s\n", err, description); else { - grub_printf ("%s: `%s'\n", description, name); - grub_free (name); + VasEBoot_printf ("%s: `%s'\n", description, name); + VasEBoot_free (name); } } static int -usb_iterate (grub_usb_device_t dev, void *data __attribute__ ((unused))) +usb_iterate (VasEBoot_usb_device_t dev, void *data __attribute__ ((unused))) { - struct grub_usb_desc_device *descdev; + struct VasEBoot_usb_desc_device *descdev; int i; descdev = &dev->descdev; @@ -140,19 +140,19 @@ usb_iterate (grub_usb_device_t dev, void *data __attribute__ ((unused))) usb_print_str ("Vendor", dev, descdev->strvendor); usb_print_str ("Serial", dev, descdev->strserial); - grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", + VasEBoot_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", descdev->class, descdev->class < ARRAY_SIZE (usb_classes) ? usb_classes[descdev->class] : "Unknown", descdev->subclass, descdev->protocol); - grub_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, #conf: %d\n", + VasEBoot_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, #conf: %d\n", descdev->usbrel >> 8, (descdev->usbrel >> 4) & 0x0F, descdev->vendorid, descdev->prodid, descdev->configcnt); - grub_printf ("%s speed device\n", usb_devspeed[dev->speed]); + VasEBoot_printf ("%s speed device\n", usb_devspeed[dev->speed]); for (i = 0; i < descdev->configcnt; i++) { - struct grub_usb_desc_config *config; + struct VasEBoot_usb_desc_config *config; config = dev->config[i].descconf; usb_print_str ("Configuration:", dev, config->strconfig); @@ -161,12 +161,12 @@ usb_iterate (grub_usb_device_t dev, void *data __attribute__ ((unused))) for (i = 0; i < dev->config[0].descconf->numif; i++) { int j; - struct grub_usb_desc_if *interf; + struct VasEBoot_usb_desc_if *interf; interf = dev->config[0].interf[i].descif; - grub_printf ("Interface #%d: #Endpoints: %d ", + VasEBoot_printf ("Interface #%d: #Endpoints: %d ", i, interf->endpointcnt); - grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", + VasEBoot_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", interf->class, interf->class < ARRAY_SIZE (usb_classes) ? usb_classes[interf->class] : "Unknown", interf->subclass, interf->protocol); @@ -175,10 +175,10 @@ usb_iterate (grub_usb_device_t dev, void *data __attribute__ ((unused))) for (j = 0; j < interf->endpointcnt; j++) { - struct grub_usb_desc_endp *endp; + struct VasEBoot_usb_desc_endp *endp; endp = &dev->config[0].interf[i].descendp[j]; - grub_printf ("Endpoint #%d: %s, max packed size: %d, transfer type: %s, latency: %d\n", + VasEBoot_printf ("Endpoint #%d: %s, max packed size: %d, transfer type: %s, latency: %d\n", endp->endp_addr & 15, (endp->endp_addr & 128) ? "IN" : "OUT", endp->maxpacket, usb_endp_type[endp->attrib & 3], @@ -186,33 +186,33 @@ usb_iterate (grub_usb_device_t dev, void *data __attribute__ ((unused))) } } - grub_printf("\n"); + VasEBoot_printf("\n"); return 0; } -static grub_err_t -grub_cmd_usbtest (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_usbtest (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_usb_poll_devices (1); + VasEBoot_usb_poll_devices (1); - grub_printf ("USB devices:\n\n"); - grub_usb_iterate (usb_iterate, NULL); + VasEBoot_printf ("USB devices:\n\n"); + VasEBoot_usb_iterate (usb_iterate, NULL); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(usbtest) +VasEBoot_MOD_INIT(usbtest) { - cmd = grub_register_command ("usb", grub_cmd_usbtest, + cmd = VasEBoot_register_command ("usb", VasEBoot_cmd_usbtest, 0, N_("Test USB support.")); } -GRUB_MOD_FINI(usbtest) +VasEBoot_MOD_FINI(usbtest) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/commands/verify.c b/VasEBoot-core/commands/verify.c index d72692b97..06f94b9a1 100644 --- a/VasEBoot-core/commands/verify.c +++ b/VasEBoot-core/commands/verify.c @@ -1,81 +1,81 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_verified +struct VasEBoot_verified { - grub_file_t file; + VasEBoot_file_t file; void *buf; }; -typedef struct grub_verified *grub_verified_t; +typedef struct VasEBoot_verified *VasEBoot_verified_t; enum { OPTION_SKIP_SIG = 0 }; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"skip-sig", 's', 0, N_("Skip signature-checking of the public key file."), 0, ARG_TYPE_NONE}, {0, 0, 0, 0, 0, 0} }; -static grub_ssize_t -pseudo_read (struct grub_file *file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +pseudo_read (struct VasEBoot_file *file, char *buf, VasEBoot_size_t len) { - grub_memcpy (buf, (grub_uint8_t *) file->data + file->offset, len); + VasEBoot_memcpy (buf, (VasEBoot_uint8_t *) file->data + file->offset, len); return len; } /* Filesystem descriptor. */ -struct grub_fs pseudo_fs = +struct VasEBoot_fs pseudo_fs = { .name = "pseudo", .read = pseudo_read }; -static grub_err_t -read_packet_header (grub_file_t sig, grub_uint8_t *out_type, grub_size_t *len) +static VasEBoot_err_t +read_packet_header (VasEBoot_file_t sig, VasEBoot_uint8_t *out_type, VasEBoot_size_t *len) { - grub_uint8_t type; - grub_uint8_t l; - grub_uint16_t l16; - grub_uint32_t l32; + VasEBoot_uint8_t type; + VasEBoot_uint8_t l; + VasEBoot_uint16_t l16; + VasEBoot_uint32_t l32; /* New format. */ - switch (grub_file_read (sig, &type, sizeof (type))) + switch (VasEBoot_file_read (sig, &type, sizeof (type))) { case 1: break; @@ -85,10 +85,10 @@ read_packet_header (grub_file_t sig, grub_uint8_t *out_type, grub_size_t *len) return 0; } default: - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; /* TRANSLATORS: it's about GNUPG signatures. */ - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); } if (type == 0) @@ -98,12 +98,12 @@ read_packet_header (grub_file_t sig, grub_uint8_t *out_type, grub_size_t *len) } if (!(type & 0x80)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); if (type & 0x40) { *out_type = (type & 0x3f); - if (grub_file_read (sig, &l, sizeof (l)) != 1) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + if (VasEBoot_file_read (sig, &l, sizeof (l)) != 1) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); if (l < 192) { *len = l; @@ -111,50 +111,50 @@ read_packet_header (grub_file_t sig, grub_uint8_t *out_type, grub_size_t *len) } if (l < 224) { - *len = (l - 192) << GRUB_CHAR_BIT; - if (grub_file_read (sig, &l, sizeof (l)) != 1) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + *len = (l - 192) << VasEBoot_CHAR_BIT; + if (VasEBoot_file_read (sig, &l, sizeof (l)) != 1) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); *len |= l; return 0; } if (l == 255) { - if (grub_file_read (sig, &l32, sizeof (l32)) != sizeof (l32)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - *len = grub_be_to_cpu32 (l32); + if (VasEBoot_file_read (sig, &l32, sizeof (l32)) != sizeof (l32)) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); + *len = VasEBoot_be_to_cpu32 (l32); return 0; } - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); } *out_type = ((type >> 2) & 0xf); switch (type & 0x3) { case 0: - if (grub_file_read (sig, &l, sizeof (l)) != sizeof (l)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + if (VasEBoot_file_read (sig, &l, sizeof (l)) != sizeof (l)) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); *len = l; return 0; case 1: - if (grub_file_read (sig, &l16, sizeof (l16)) != sizeof (l16)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - *len = grub_be_to_cpu16 (l16); + if (VasEBoot_file_read (sig, &l16, sizeof (l16)) != sizeof (l16)) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); + *len = VasEBoot_be_to_cpu16 (l16); return 0; case 2: - if (grub_file_read (sig, &l32, sizeof (l32)) != sizeof (l32)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - *len = grub_be_to_cpu32 (l32); + if (VasEBoot_file_read (sig, &l32, sizeof (l32)) != sizeof (l32)) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); + *len = VasEBoot_be_to_cpu32 (l32); return 0; } - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); } struct signature_v4_header { - grub_uint8_t type; - grub_uint8_t pkeyalgo; - grub_uint8_t hash; - grub_uint16_t hashed_sub; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t pkeyalgo; + VasEBoot_uint8_t hash; + VasEBoot_uint16_t hashed_sub; +} VasEBoot_PACKED; const char *hashes[] = { [0x01] = "md5", @@ -166,83 +166,83 @@ const char *hashes[] = { [0x0b] = "sha224" }; -struct gcry_pk_spec *grub_crypto_pk_dsa; -struct gcry_pk_spec *grub_crypto_pk_ecdsa; -struct gcry_pk_spec *grub_crypto_pk_rsa; +struct gcry_pk_spec *VasEBoot_crypto_pk_dsa; +struct gcry_pk_spec *VasEBoot_crypto_pk_ecdsa; +struct gcry_pk_spec *VasEBoot_crypto_pk_rsa; static int -dsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, - const gcry_md_spec_t *hash, struct grub_public_subkey *sk); +dsa_pad (gcry_mpi_t *hmpi, VasEBoot_uint8_t *hval, + const gcry_md_spec_t *hash, struct VasEBoot_public_subkey *sk); static int -rsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, - const gcry_md_spec_t *hash, struct grub_public_subkey *sk); +rsa_pad (gcry_mpi_t *hmpi, VasEBoot_uint8_t *hval, + const gcry_md_spec_t *hash, struct VasEBoot_public_subkey *sk); struct { const char *name; - grub_size_t nmpisig; - grub_size_t nmpipub; + VasEBoot_size_t nmpisig; + VasEBoot_size_t nmpipub; struct gcry_pk_spec **algo; - int (*pad) (gcry_mpi_t *hmpi, grub_uint8_t *hval, - const gcry_md_spec_t *hash, struct grub_public_subkey *sk); + int (*pad) (gcry_mpi_t *hmpi, VasEBoot_uint8_t *hval, + const gcry_md_spec_t *hash, struct VasEBoot_public_subkey *sk); const char *module; } pkalgos[] = { - [1] = { "rsa", 1, 2, &grub_crypto_pk_rsa, rsa_pad, "gcry_rsa" }, - [3] = { "rsa", 1, 2, &grub_crypto_pk_rsa, rsa_pad, "gcry_rsa" }, - [17] = { "dsa", 2, 4, &grub_crypto_pk_dsa, dsa_pad, "gcry_dsa" }, + [1] = { "rsa", 1, 2, &VasEBoot_crypto_pk_rsa, rsa_pad, "gcry_rsa" }, + [3] = { "rsa", 1, 2, &VasEBoot_crypto_pk_rsa, rsa_pad, "gcry_rsa" }, + [17] = { "dsa", 2, 4, &VasEBoot_crypto_pk_dsa, dsa_pad, "gcry_dsa" }, }; -struct grub_public_key +struct VasEBoot_public_key { - struct grub_public_key *next; - struct grub_public_subkey *subkeys; + struct VasEBoot_public_key *next; + struct VasEBoot_public_subkey *subkeys; }; -struct grub_public_subkey +struct VasEBoot_public_subkey { - struct grub_public_subkey *next; - grub_uint8_t type; - grub_uint32_t fingerprint[5]; + struct VasEBoot_public_subkey *next; + VasEBoot_uint8_t type; + VasEBoot_uint32_t fingerprint[5]; gcry_mpi_t mpis[10]; }; static void -free_pk (struct grub_public_key *pk) +free_pk (struct VasEBoot_public_key *pk) { - struct grub_public_subkey *nsk, *sk; + struct VasEBoot_public_subkey *nsk, *sk; for (sk = pk->subkeys; sk; sk = nsk) { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (sk->mpis); i++) if (sk->mpis[i]) gcry_mpi_release (sk->mpis[i]); nsk = sk->next; - grub_free (sk); + VasEBoot_free (sk); } - grub_free (pk); + VasEBoot_free (pk); } #define READBUF_SIZE 4096 -struct grub_public_key * -grub_load_public_key (grub_file_t f) +struct VasEBoot_public_key * +VasEBoot_load_public_key (VasEBoot_file_t f) { - grub_err_t err; - struct grub_public_key *ret; - struct grub_public_subkey **last = 0; + VasEBoot_err_t err; + struct VasEBoot_public_key *ret; + struct VasEBoot_public_subkey **last = 0; void *fingerprint_context = NULL; - grub_uint8_t *buffer = NULL; + VasEBoot_uint8_t *buffer = NULL; - ret = grub_zalloc (sizeof (*ret)); + ret = VasEBoot_zalloc (sizeof (*ret)); if (!ret) { - grub_free (fingerprint_context); + VasEBoot_free (fingerprint_context); return NULL; } - buffer = grub_zalloc (READBUF_SIZE); - fingerprint_context = grub_zalloc (GRUB_MD_SHA1->contextsize); + buffer = VasEBoot_zalloc (READBUF_SIZE); + fingerprint_context = VasEBoot_zalloc (VasEBoot_MD_SHA1->contextsize); if (!buffer || !fingerprint_context) goto fail; @@ -251,14 +251,14 @@ grub_load_public_key (grub_file_t f) while (1) { - grub_uint8_t type; - grub_size_t len; - grub_uint8_t v, pk; - grub_uint32_t creation_time; - grub_off_t pend; - struct grub_public_subkey *sk; - grub_size_t i; - grub_uint16_t len_be; + VasEBoot_uint8_t type; + VasEBoot_size_t len; + VasEBoot_uint8_t v, pk; + VasEBoot_uint32_t creation_time; + VasEBoot_off_t pend; + struct VasEBoot_public_subkey *sk; + VasEBoot_size_t i; + VasEBoot_uint16_t len_be; err = read_packet_header (f, &type, &len); @@ -268,146 +268,146 @@ grub_load_public_key (grub_file_t f) continue; if (type == 0xff) { - grub_free (fingerprint_context); - grub_free (buffer); + VasEBoot_free (fingerprint_context); + VasEBoot_free (buffer); return ret; } - grub_dprintf ("crypt", "len = %x\n", (int) len); + VasEBoot_dprintf ("crypt", "len = %x\n", (int) len); - pend = grub_file_tell (f) + len; + pend = VasEBoot_file_tell (f) + len; if (type != 6 && type != 14 && type != 5 && type != 7) { - grub_file_seek (f, pend); + VasEBoot_file_seek (f, pend); continue; } - if (grub_file_read (f, &v, sizeof (v)) != sizeof (v)) + if (VasEBoot_file_read (f, &v, sizeof (v)) != sizeof (v)) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); goto fail; } - grub_dprintf ("crypt", "v = %x\n", v); + VasEBoot_dprintf ("crypt", "v = %x\n", v); if (v != 4) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); goto fail; } - if (grub_file_read (f, &creation_time, sizeof (creation_time)) != sizeof (creation_time)) + if (VasEBoot_file_read (f, &creation_time, sizeof (creation_time)) != sizeof (creation_time)) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); goto fail; } - grub_dprintf ("crypt", "time = %x\n", creation_time); + VasEBoot_dprintf ("crypt", "time = %x\n", creation_time); - if (grub_file_read (f, &pk, sizeof (pk)) != sizeof (pk)) + if (VasEBoot_file_read (f, &pk, sizeof (pk)) != sizeof (pk)) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); goto fail; } - grub_dprintf ("crypt", "pk = %x\n", pk); + VasEBoot_dprintf ("crypt", "pk = %x\n", pk); if (pk >= ARRAY_SIZE (pkalgos) || pkalgos[pk].name == NULL) { - grub_file_seek (f, pend); + VasEBoot_file_seek (f, pend); continue; } - sk = grub_zalloc (sizeof (struct grub_public_subkey)); + sk = VasEBoot_zalloc (sizeof (struct VasEBoot_public_subkey)); if (!sk) goto fail; - grub_memset (fingerprint_context, 0, GRUB_MD_SHA1->contextsize); - GRUB_MD_SHA1->init (fingerprint_context); - GRUB_MD_SHA1->write (fingerprint_context, "\x99", 1); - len_be = grub_cpu_to_be16 (len); - GRUB_MD_SHA1->write (fingerprint_context, &len_be, sizeof (len_be)); - GRUB_MD_SHA1->write (fingerprint_context, &v, sizeof (v)); - GRUB_MD_SHA1->write (fingerprint_context, &creation_time, sizeof (creation_time)); - GRUB_MD_SHA1->write (fingerprint_context, &pk, sizeof (pk)); + VasEBoot_memset (fingerprint_context, 0, VasEBoot_MD_SHA1->contextsize); + VasEBoot_MD_SHA1->init (fingerprint_context); + VasEBoot_MD_SHA1->write (fingerprint_context, "\x99", 1); + len_be = VasEBoot_cpu_to_be16 (len); + VasEBoot_MD_SHA1->write (fingerprint_context, &len_be, sizeof (len_be)); + VasEBoot_MD_SHA1->write (fingerprint_context, &v, sizeof (v)); + VasEBoot_MD_SHA1->write (fingerprint_context, &creation_time, sizeof (creation_time)); + VasEBoot_MD_SHA1->write (fingerprint_context, &pk, sizeof (pk)); for (i = 0; i < pkalgos[pk].nmpipub; i++) { - grub_uint16_t l; - grub_size_t lb; - if (grub_file_read (f, &l, sizeof (l)) != sizeof (l)) + VasEBoot_uint16_t l; + VasEBoot_size_t lb; + if (VasEBoot_file_read (f, &l, sizeof (l)) != sizeof (l)) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); break; } - lb = (grub_be_to_cpu16 (l) + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT; - if (lb > READBUF_SIZE - sizeof (grub_uint16_t)) + lb = (VasEBoot_be_to_cpu16 (l) + VasEBoot_CHAR_BIT - 1) / VasEBoot_CHAR_BIT; + if (lb > READBUF_SIZE - sizeof (VasEBoot_uint16_t)) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); break; } - if (grub_file_read (f, buffer + sizeof (grub_uint16_t), lb) != (grub_ssize_t) lb) + if (VasEBoot_file_read (f, buffer + sizeof (VasEBoot_uint16_t), lb) != (VasEBoot_ssize_t) lb) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); break; } - grub_memcpy (buffer, &l, sizeof (l)); + VasEBoot_memcpy (buffer, &l, sizeof (l)); - GRUB_MD_SHA1->write (fingerprint_context, buffer, lb + sizeof (grub_uint16_t)); + VasEBoot_MD_SHA1->write (fingerprint_context, buffer, lb + sizeof (VasEBoot_uint16_t)); if (gcry_mpi_scan (&sk->mpis[i], GCRYMPI_FMT_PGP, - buffer, lb + sizeof (grub_uint16_t), 0)) + buffer, lb + sizeof (VasEBoot_uint16_t), 0)) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); break; } } if (i < pkalgos[pk].nmpipub) { - grub_free (sk); + VasEBoot_free (sk); goto fail; } - GRUB_MD_SHA1->final (fingerprint_context); + VasEBoot_MD_SHA1->final (fingerprint_context); - grub_memcpy (sk->fingerprint, GRUB_MD_SHA1->read (fingerprint_context), 20); + VasEBoot_memcpy (sk->fingerprint, VasEBoot_MD_SHA1->read (fingerprint_context), 20); *last = sk; last = &sk->next; - grub_dprintf ("crypt", "actual pos: %x, expected: %x\n", (int)grub_file_tell (f), (int)pend); + VasEBoot_dprintf ("crypt", "actual pos: %x, expected: %x\n", (int)VasEBoot_file_tell (f), (int)pend); - grub_file_seek (f, pend); + VasEBoot_file_seek (f, pend); } fail: free_pk (ret); - grub_free (fingerprint_context); - grub_free (buffer); + VasEBoot_free (fingerprint_context); + VasEBoot_free (buffer); return NULL; } -struct grub_public_key *grub_pk_trusted; +struct VasEBoot_public_key *VasEBoot_pk_trusted; -struct grub_public_subkey * -grub_crypto_pk_locate_subkey (grub_uint64_t keyid, struct grub_public_key *pkey) +struct VasEBoot_public_subkey * +VasEBoot_crypto_pk_locate_subkey (VasEBoot_uint64_t keyid, struct VasEBoot_public_key *pkey) { - struct grub_public_subkey *sk; + struct VasEBoot_public_subkey *sk; for (sk = pkey->subkeys; sk; sk = sk->next) - if (grub_memcmp (sk->fingerprint + 3, &keyid, 8) == 0) + if (VasEBoot_memcmp (sk->fingerprint + 3, &keyid, 8) == 0) return sk; return 0; } -struct grub_public_subkey * -grub_crypto_pk_locate_subkey_in_trustdb (grub_uint64_t keyid) +struct VasEBoot_public_subkey * +VasEBoot_crypto_pk_locate_subkey_in_trustdb (VasEBoot_uint64_t keyid) { - struct grub_public_key *pkey; - struct grub_public_subkey *sk; - for (pkey = grub_pk_trusted; pkey; pkey = pkey->next) + struct VasEBoot_public_key *pkey; + struct VasEBoot_public_subkey *sk; + for (pkey = VasEBoot_pk_trusted; pkey; pkey = pkey->next) { - sk = grub_crypto_pk_locate_subkey (keyid, pkey); + sk = VasEBoot_crypto_pk_locate_subkey (keyid, pkey); if (sk) return sk; } @@ -416,11 +416,11 @@ grub_crypto_pk_locate_subkey_in_trustdb (grub_uint64_t keyid) static int -dsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, - const gcry_md_spec_t *hash, struct grub_public_subkey *sk) +dsa_pad (gcry_mpi_t *hmpi, VasEBoot_uint8_t *hval, + const gcry_md_spec_t *hash, struct VasEBoot_public_subkey *sk) { unsigned nbits = gcry_mpi_get_nbits (sk->mpis[1]); - grub_dprintf ("crypt", "must be %u bits got %d bits\n", nbits, + VasEBoot_dprintf ("crypt", "must be %u bits got %d bits\n", nbits, (int)(8 * hash->mdlen)); return gcry_mpi_scan (hmpi, GCRYMPI_FMT_USG, hval, nbits / 8 < (unsigned) hash->mdlen ? nbits / 8 @@ -428,11 +428,11 @@ dsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, } static int -rsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, - const gcry_md_spec_t *hash, struct grub_public_subkey *sk) +rsa_pad (gcry_mpi_t *hmpi, VasEBoot_uint8_t *hval, + const gcry_md_spec_t *hash, struct VasEBoot_public_subkey *sk) { - grub_size_t tlen, emlen, fflen; - grub_uint8_t *em, *emptr; + VasEBoot_size_t tlen, emlen, fflen; + VasEBoot_uint8_t *em, *emptr; unsigned nbits = gcry_mpi_get_nbits (sk->mpis[0]); int ret; tlen = hash->mdlen + hash->asnlen; @@ -440,7 +440,7 @@ rsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, if (emlen < tlen + 11) return 1; - em = grub_malloc (emlen); + em = VasEBoot_malloc (emlen); if (!em) return 1; @@ -450,83 +450,83 @@ rsa_pad (gcry_mpi_t *hmpi, grub_uint8_t *hval, for (emptr = em + 2; emptr < em + 2 + fflen; emptr++) *emptr = 0xff; *emptr++ = 0x00; - grub_memcpy (emptr, hash->asnoid, hash->asnlen); + VasEBoot_memcpy (emptr, hash->asnoid, hash->asnlen); emptr += hash->asnlen; - grub_memcpy (emptr, hval, hash->mdlen); + VasEBoot_memcpy (emptr, hval, hash->mdlen); ret = gcry_mpi_scan (hmpi, GCRYMPI_FMT_USG, em, emlen, 0); - grub_free (em); + VasEBoot_free (em); return ret; } -static grub_err_t -grub_verify_signature_real (char *buf, grub_size_t size, - grub_file_t f, grub_file_t sig, - struct grub_public_key *pkey) +static VasEBoot_err_t +VasEBoot_verify_signature_real (char *buf, VasEBoot_size_t size, + VasEBoot_file_t f, VasEBoot_file_t sig, + struct VasEBoot_public_key *pkey) { - grub_size_t len; - grub_uint8_t v; - grub_uint8_t h; - grub_uint8_t t; - grub_uint8_t pk; + VasEBoot_size_t len; + VasEBoot_uint8_t v; + VasEBoot_uint8_t h; + VasEBoot_uint8_t t; + VasEBoot_uint8_t pk; const gcry_md_spec_t *hash; struct signature_v4_header v4; - grub_err_t err; - grub_size_t i; + VasEBoot_err_t err; + VasEBoot_size_t i; gcry_mpi_t mpis[10]; - grub_uint8_t type = 0; + VasEBoot_uint8_t type = 0; err = read_packet_header (sig, &type, &len); if (err) return err; if (type != 0x2) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); - if (grub_file_read (sig, &v, sizeof (v)) != sizeof (v)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + if (VasEBoot_file_read (sig, &v, sizeof (v)) != sizeof (v)) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); if (v != 4) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); - if (grub_file_read (sig, &v4, sizeof (v4)) != sizeof (v4)) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + if (VasEBoot_file_read (sig, &v4, sizeof (v4)) != sizeof (v4)) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); h = v4.hash; t = v4.type; pk = v4.pkeyalgo; if (t != 0) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); if (h >= ARRAY_SIZE (hashes) || hashes[h] == NULL) - return grub_error (GRUB_ERR_BAD_SIGNATURE, "unknown hash"); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, "unknown hash"); if (pk >= ARRAY_SIZE (pkalgos) || pkalgos[pk].name == NULL) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); - hash = grub_crypto_lookup_md_by_name (hashes[h]); + hash = VasEBoot_crypto_lookup_md_by_name (hashes[h]); if (!hash) - return grub_error (GRUB_ERR_BAD_SIGNATURE, "hash `%s' not loaded", hashes[h]); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, "hash `%s' not loaded", hashes[h]); - grub_dprintf ("crypt", "alive\n"); + VasEBoot_dprintf ("crypt", "alive\n"); { void *context = NULL; unsigned char *hval; - grub_ssize_t rem = grub_be_to_cpu16 (v4.hashed_sub); - grub_uint32_t headlen = grub_cpu_to_be32 (rem + 6); - grub_uint8_t s; - grub_uint16_t unhashed_sub; - grub_ssize_t r; - grub_uint8_t hash_start[2]; + VasEBoot_ssize_t rem = VasEBoot_be_to_cpu16 (v4.hashed_sub); + VasEBoot_uint32_t headlen = VasEBoot_cpu_to_be32 (rem + 6); + VasEBoot_uint8_t s; + VasEBoot_uint16_t unhashed_sub; + VasEBoot_ssize_t r; + VasEBoot_uint8_t hash_start[2]; gcry_mpi_t hmpi; - grub_uint64_t keyid = 0; - struct grub_public_subkey *sk; - grub_uint8_t *readbuf = NULL; + VasEBoot_uint64_t keyid = 0; + struct VasEBoot_public_subkey *sk; + VasEBoot_uint8_t *readbuf = NULL; - context = grub_zalloc (hash->contextsize); - readbuf = grub_zalloc (READBUF_SIZE); + context = VasEBoot_zalloc (hash->contextsize); + readbuf = VasEBoot_zalloc (READBUF_SIZE); if (!context || !readbuf) goto fail; @@ -536,7 +536,7 @@ grub_verify_signature_real (char *buf, grub_size_t size, else while (1) { - r = grub_file_read (f, readbuf, READBUF_SIZE); + r = VasEBoot_file_read (f, readbuf, READBUF_SIZE); if (r < 0) goto fail; if (r == 0) @@ -548,7 +548,7 @@ grub_verify_signature_real (char *buf, grub_size_t size, hash->write (context, &v4, sizeof (v4)); while (rem) { - r = grub_file_read (sig, readbuf, + r = VasEBoot_file_read (sig, readbuf, rem < READBUF_SIZE ? rem : READBUF_SIZE); if (r < 0) goto fail; @@ -561,16 +561,16 @@ grub_verify_signature_real (char *buf, grub_size_t size, s = 0xff; hash->write (context, &s, sizeof (s)); hash->write (context, &headlen, sizeof (headlen)); - r = grub_file_read (sig, &unhashed_sub, sizeof (unhashed_sub)); + r = VasEBoot_file_read (sig, &unhashed_sub, sizeof (unhashed_sub)); if (r != sizeof (unhashed_sub)) goto fail; { - grub_uint8_t *ptr; - grub_uint32_t l; - rem = grub_be_to_cpu16 (unhashed_sub); + VasEBoot_uint8_t *ptr; + VasEBoot_uint32_t l; + rem = VasEBoot_be_to_cpu16 (unhashed_sub); if (rem > READBUF_SIZE) goto fail; - r = grub_file_read (sig, readbuf, rem); + r = VasEBoot_file_read (sig, readbuf, rem); if (r != rem) goto fail; for (ptr = readbuf; ptr < readbuf + rem; ptr += l) @@ -581,67 +581,67 @@ grub_verify_signature_real (char *buf, grub_size_t size, { if (ptr + 1 >= readbuf + rem) break; - l = (((ptr[0] & ~192) << GRUB_CHAR_BIT) | ptr[1]) + 192; + l = (((ptr[0] & ~192) << VasEBoot_CHAR_BIT) | ptr[1]) + 192; ptr += 2; } else { if (ptr + 5 >= readbuf + rem) break; - l = grub_be_to_cpu32 (grub_get_unaligned32 (ptr + 1)); + l = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (ptr + 1)); ptr += 5; } if (*ptr == 0x10 && l >= 8) - keyid = grub_get_unaligned64 (ptr + 1); + keyid = VasEBoot_get_unaligned64 (ptr + 1); } } hash->final (context); - grub_dprintf ("crypt", "alive\n"); + VasEBoot_dprintf ("crypt", "alive\n"); hval = hash->read (context); - if (grub_file_read (sig, hash_start, sizeof (hash_start)) != sizeof (hash_start)) + if (VasEBoot_file_read (sig, hash_start, sizeof (hash_start)) != sizeof (hash_start)) goto fail; - if (grub_memcmp (hval, hash_start, sizeof (hash_start)) != 0) + if (VasEBoot_memcmp (hval, hash_start, sizeof (hash_start)) != 0) goto fail; - grub_dprintf ("crypt", "@ %x\n", (int)grub_file_tell (sig)); + VasEBoot_dprintf ("crypt", "@ %x\n", (int)VasEBoot_file_tell (sig)); for (i = 0; i < pkalgos[pk].nmpisig; i++) { - grub_uint16_t l; - grub_size_t lb; - grub_dprintf ("crypt", "alive\n"); - if (grub_file_read (sig, &l, sizeof (l)) != sizeof (l)) + VasEBoot_uint16_t l; + VasEBoot_size_t lb; + VasEBoot_dprintf ("crypt", "alive\n"); + if (VasEBoot_file_read (sig, &l, sizeof (l)) != sizeof (l)) goto fail; - grub_dprintf ("crypt", "alive\n"); - lb = (grub_be_to_cpu16 (l) + 7) / 8; - grub_dprintf ("crypt", "l = 0x%04x\n", grub_be_to_cpu16 (l)); - if (lb > READBUF_SIZE - sizeof (grub_uint16_t)) + VasEBoot_dprintf ("crypt", "alive\n"); + lb = (VasEBoot_be_to_cpu16 (l) + 7) / 8; + VasEBoot_dprintf ("crypt", "l = 0x%04x\n", VasEBoot_be_to_cpu16 (l)); + if (lb > READBUF_SIZE - sizeof (VasEBoot_uint16_t)) goto fail; - grub_dprintf ("crypt", "alive\n"); - if (grub_file_read (sig, readbuf + sizeof (grub_uint16_t), lb) != (grub_ssize_t) lb) + VasEBoot_dprintf ("crypt", "alive\n"); + if (VasEBoot_file_read (sig, readbuf + sizeof (VasEBoot_uint16_t), lb) != (VasEBoot_ssize_t) lb) goto fail; - grub_dprintf ("crypt", "alive\n"); - grub_memcpy (readbuf, &l, sizeof (l)); - grub_dprintf ("crypt", "alive\n"); + VasEBoot_dprintf ("crypt", "alive\n"); + VasEBoot_memcpy (readbuf, &l, sizeof (l)); + VasEBoot_dprintf ("crypt", "alive\n"); if (gcry_mpi_scan (&mpis[i], GCRYMPI_FMT_PGP, - readbuf, lb + sizeof (grub_uint16_t), 0)) + readbuf, lb + sizeof (VasEBoot_uint16_t), 0)) goto fail; - grub_dprintf ("crypt", "alive\n"); + VasEBoot_dprintf ("crypt", "alive\n"); } if (pkey) - sk = grub_crypto_pk_locate_subkey (keyid, pkey); + sk = VasEBoot_crypto_pk_locate_subkey (keyid, pkey); else - sk = grub_crypto_pk_locate_subkey_in_trustdb (keyid); + sk = VasEBoot_crypto_pk_locate_subkey_in_trustdb (keyid); if (!sk) { /* TRANSLATORS: %08x is 32-bit key id. */ - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("public key %08x not found"), + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("public key %08x not found"), keyid); goto fail; } @@ -650,93 +650,93 @@ grub_verify_signature_real (char *buf, grub_size_t size, goto fail; if (!*pkalgos[pk].algo) { - grub_dl_load (pkalgos[pk].module); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dl_load (pkalgos[pk].module); + VasEBoot_errno = VasEBoot_ERR_NONE; } if (!*pkalgos[pk].algo) { - grub_error (GRUB_ERR_BAD_SIGNATURE, N_("module `%s' isn't loaded"), + VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("module `%s' isn't loaded"), pkalgos[pk].module); goto fail; } if ((*pkalgos[pk].algo)->verify (0, hmpi, mpis, sk->mpis, 0, 0)) goto fail; - grub_free (context); - grub_free (readbuf); + VasEBoot_free (context); + VasEBoot_free (readbuf); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (context); - grub_free (readbuf); - if (!grub_errno) - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - return grub_errno; + VasEBoot_free (context); + VasEBoot_free (readbuf); + if (!VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("bad signature")); + return VasEBoot_errno; } } -grub_err_t -grub_verify_signature (grub_file_t f, grub_file_t sig, - struct grub_public_key *pkey) +VasEBoot_err_t +VasEBoot_verify_signature (VasEBoot_file_t f, VasEBoot_file_t sig, + struct VasEBoot_public_key *pkey) { - return grub_verify_signature_real (0, 0, f, sig, pkey); + return VasEBoot_verify_signature_real (0, 0, f, sig, pkey); } -static grub_err_t -grub_cmd_trust (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_trust (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - grub_file_t pkf; - struct grub_public_key *pk = NULL; + VasEBoot_file_t pkf; + struct VasEBoot_public_key *pk = NULL; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - grub_file_filter_disable_compression (); + VasEBoot_file_filter_disable_compression (); if (ctxt->state[OPTION_SKIP_SIG].set) - grub_file_filter_disable_pubkey (); - pkf = grub_file_open (args[0]); + VasEBoot_file_filter_disable_pubkey (); + pkf = VasEBoot_file_open (args[0]); if (!pkf) - return grub_errno; - pk = grub_load_public_key (pkf); + return VasEBoot_errno; + pk = VasEBoot_load_public_key (pkf); if (!pk) { - grub_file_close (pkf); - return grub_errno; + VasEBoot_file_close (pkf); + return VasEBoot_errno; } - grub_file_close (pkf); + VasEBoot_file_close (pkf); - pk->next = grub_pk_trusted; - grub_pk_trusted = pk; + pk->next = VasEBoot_pk_trusted; + VasEBoot_pk_trusted = pk; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_trust_var (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_trust_var (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_file pseudo_file; + struct VasEBoot_file pseudo_file; const char *var; char *data; - struct grub_public_key *pk = NULL; + struct VasEBoot_public_key *pk = NULL; unsigned int i, idx0, idx1; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - var = grub_env_get (args[0]); + var = VasEBoot_env_get (args[0]); if (!var) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown variable")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unknown variable")); - data = grub_zalloc (grub_strlen (var) / 2); + data = VasEBoot_zalloc (VasEBoot_strlen (var) / 2); if (!data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate memory for key")); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("can't allocate memory for key")); /* For the want of sscanf() */ - for (i = 0; i < grub_strlen (var); i += 2) + for (i = 0; i < VasEBoot_strlen (var); i += 2) { if (var[i] < 0x40) idx0 = var[i] - 0x30; @@ -751,135 +751,135 @@ grub_cmd_trust_var (grub_command_t cmd __attribute__ ((unused)), data[i/2] = ((idx0 << 4) & 0xf0) | (idx1 & 0x0f); } - grub_memset (&pseudo_file, 0, sizeof (pseudo_file)); + VasEBoot_memset (&pseudo_file, 0, sizeof (pseudo_file)); pseudo_file.fs = &pseudo_fs; - pseudo_file.size = grub_strlen (var) / 2; + pseudo_file.size = VasEBoot_strlen (var) / 2; pseudo_file.data = data; - pk = grub_load_public_key (&pseudo_file); + pk = VasEBoot_load_public_key (&pseudo_file); if (!pk) { - grub_free(data); - return grub_errno; + VasEBoot_free(data); + return VasEBoot_errno; } - pk->next = grub_pk_trusted; - grub_pk_trusted = pk; + pk->next = VasEBoot_pk_trusted; + VasEBoot_pk_trusted = pk; - grub_free(data); - return GRUB_ERR_NONE; + VasEBoot_free(data); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_list (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_list (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_public_key *pk = NULL; - struct grub_public_subkey *sk = NULL; + struct VasEBoot_public_key *pk = NULL; + struct VasEBoot_public_subkey *sk = NULL; - for (pk = grub_pk_trusted; pk; pk = pk->next) + for (pk = VasEBoot_pk_trusted; pk; pk = pk->next) for (sk = pk->subkeys; sk; sk = sk->next) { unsigned i; for (i = 0; i < 20; i += 2) - grub_printf ("%02x%02x ", ((grub_uint8_t *) sk->fingerprint)[i], - ((grub_uint8_t *) sk->fingerprint)[i + 1]); - grub_printf ("\n"); + VasEBoot_printf ("%02x%02x ", ((VasEBoot_uint8_t *) sk->fingerprint)[i], + ((VasEBoot_uint8_t *) sk->fingerprint)[i + 1]); + VasEBoot_printf ("\n"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_distrust (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_distrust (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_uint32_t keyid, keyid_be; - struct grub_public_key **pkey; - struct grub_public_subkey *sk; + VasEBoot_uint32_t keyid, keyid_be; + struct VasEBoot_public_key **pkey; + struct VasEBoot_public_subkey *sk; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); - keyid = grub_strtoull (args[0], 0, 16); - if (grub_errno) - return grub_errno; - keyid_be = grub_cpu_to_be32 (keyid); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); + keyid = VasEBoot_strtoull (args[0], 0, 16); + if (VasEBoot_errno) + return VasEBoot_errno; + keyid_be = VasEBoot_cpu_to_be32 (keyid); - for (pkey = &grub_pk_trusted; *pkey; pkey = &((*pkey)->next)) + for (pkey = &VasEBoot_pk_trusted; *pkey; pkey = &((*pkey)->next)) { - struct grub_public_key *next; + struct VasEBoot_public_key *next; for (sk = (*pkey)->subkeys; sk; sk = sk->next) - if (grub_memcmp (sk->fingerprint + 4, &keyid_be, 4) == 0) + if (VasEBoot_memcmp (sk->fingerprint + 4, &keyid_be, 4) == 0) break; if (!sk) continue; next = (*pkey)->next; free_pk (*pkey); *pkey = next; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* TRANSLATORS: %08x is 32-bit key id. */ - return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("public key %08x not found"), keyid); + return VasEBoot_error (VasEBoot_ERR_BAD_SIGNATURE, N_("public key %08x not found"), keyid); } -static grub_err_t -grub_cmd_verify_signature (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_verify_signature (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - grub_file_t f = NULL, sig = NULL; - grub_err_t err = GRUB_ERR_NONE; - struct grub_public_key *pk = NULL; + VasEBoot_file_t f = NULL, sig = NULL; + VasEBoot_err_t err = VasEBoot_ERR_NONE; + struct VasEBoot_public_key *pk = NULL; - grub_dprintf ("crypt", "alive\n"); + VasEBoot_dprintf ("crypt", "alive\n"); if (argc < 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); - grub_dprintf ("crypt", "alive\n"); + VasEBoot_dprintf ("crypt", "alive\n"); if (argc > 2) { - grub_file_t pkf; - grub_file_filter_disable_compression (); + VasEBoot_file_t pkf; + VasEBoot_file_filter_disable_compression (); if (ctxt->state[OPTION_SKIP_SIG].set) - grub_file_filter_disable_pubkey (); - pkf = grub_file_open (args[2]); + VasEBoot_file_filter_disable_pubkey (); + pkf = VasEBoot_file_open (args[2]); if (!pkf) - return grub_errno; - pk = grub_load_public_key (pkf); + return VasEBoot_errno; + pk = VasEBoot_load_public_key (pkf); if (!pk) { - grub_file_close (pkf); - return grub_errno; + VasEBoot_file_close (pkf); + return VasEBoot_errno; } - grub_file_close (pkf); + VasEBoot_file_close (pkf); } - grub_file_filter_disable_all (); - f = grub_file_open (args[0]); + VasEBoot_file_filter_disable_all (); + f = VasEBoot_file_open (args[0]); if (!f) { - err = grub_errno; + err = VasEBoot_errno; goto fail; } - grub_file_filter_disable_all (); - sig = grub_file_open (args[1]); + VasEBoot_file_filter_disable_all (); + sig = VasEBoot_file_open (args[1]); if (!sig) { - err = grub_errno; + err = VasEBoot_errno; goto fail; } - err = grub_verify_signature (f, sig, pk); + err = VasEBoot_verify_signature (f, sig, pk); fail: if (sig) - grub_file_close (sig); + VasEBoot_file_close (sig); if (f) - grub_file_close (f); + VasEBoot_file_close (f); if (pk) free_pk (pk); return err; @@ -888,30 +888,30 @@ grub_cmd_verify_signature (grub_extcmd_context_t ctxt, static int sec = 0; static void -verified_free (grub_verified_t verified) +verified_free (VasEBoot_verified_t verified) { if (verified) { - grub_free (verified->buf); - grub_free (verified); + VasEBoot_free (verified->buf); + VasEBoot_free (verified); } } -static grub_ssize_t -verified_read (struct grub_file *file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +verified_read (struct VasEBoot_file *file, char *buf, VasEBoot_size_t len) { - grub_verified_t verified = file->data; + VasEBoot_verified_t verified = file->data; - grub_memcpy (buf, (char *) verified->buf + file->offset, len); + VasEBoot_memcpy (buf, (char *) verified->buf + file->offset, len); return len; } -static grub_err_t -verified_close (struct grub_file *file) +static VasEBoot_err_t +verified_close (struct VasEBoot_file *file) { - grub_verified_t verified = file->data; + VasEBoot_verified_t verified = file->data; - grub_file_close (verified->file); + VasEBoot_file_close (verified->file); verified_free (verified); file->data = 0; @@ -919,98 +919,98 @@ verified_close (struct grub_file *file) file->device = 0; file->name = 0; - return grub_errno; + return VasEBoot_errno; } -struct grub_fs verified_fs = +struct VasEBoot_fs verified_fs = { .name = "verified_read", .read = verified_read, .close = verified_close }; -static grub_file_t -grub_pubkey_open (grub_file_t io, const char *filename) +static VasEBoot_file_t +VasEBoot_pubkey_open (VasEBoot_file_t io, const char *filename) { - grub_file_t sig; + VasEBoot_file_t sig; char *fsuf, *ptr; - grub_err_t err; - grub_file_filter_t curfilt[GRUB_FILE_FILTER_MAX]; - grub_file_t ret; - grub_verified_t verified; + VasEBoot_err_t err; + VasEBoot_file_filter_t curfilt[VasEBoot_FILE_FILTER_MAX]; + VasEBoot_file_t ret; + VasEBoot_verified_t verified; if (!sec) return io; if (io->device->disk && - (io->device->disk->dev->id == GRUB_DISK_DEVICE_MEMDISK_ID - || io->device->disk->dev->id == GRUB_DISK_DEVICE_PROCFS_ID)) + (io->device->disk->dev->id == VasEBoot_DISK_DEVICE_MEMDISK_ID + || io->device->disk->dev->id == VasEBoot_DISK_DEVICE_PROCFS_ID)) return io; - fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); + fsuf = VasEBoot_malloc (VasEBoot_strlen (filename) + sizeof (".sig")); if (!fsuf) return NULL; - ptr = grub_stpcpy (fsuf, filename); - grub_memcpy (ptr, ".sig", sizeof (".sig")); + ptr = VasEBoot_stpcpy (fsuf, filename); + VasEBoot_memcpy (ptr, ".sig", sizeof (".sig")); - grub_memcpy (curfilt, grub_file_filters_enabled, + VasEBoot_memcpy (curfilt, VasEBoot_file_filters_enabled, sizeof (curfilt)); - grub_file_filter_disable_all (); - sig = grub_file_open (fsuf); - grub_memcpy (grub_file_filters_enabled, curfilt, + VasEBoot_file_filter_disable_all (); + sig = VasEBoot_file_open (fsuf); + VasEBoot_memcpy (VasEBoot_file_filters_enabled, curfilt, sizeof (curfilt)); - grub_free (fsuf); + VasEBoot_free (fsuf); if (!sig) return NULL; - ret = grub_malloc (sizeof (*ret)); + ret = VasEBoot_malloc (sizeof (*ret)); if (!ret) { - grub_file_close (sig); + VasEBoot_file_close (sig); return NULL; } *ret = *io; ret->fs = &verified_fs; ret->not_easily_seekable = 0; - if (ret->size >> (sizeof (grub_size_t) * GRUB_CHAR_BIT - 1)) + if (ret->size >> (sizeof (VasEBoot_size_t) * VasEBoot_CHAR_BIT - 1)) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "big file signature isn't implemented yet"); - grub_file_close (sig); - grub_free (ret); + VasEBoot_file_close (sig); + VasEBoot_free (ret); return NULL; } - verified = grub_malloc (sizeof (*verified)); + verified = VasEBoot_malloc (sizeof (*verified)); if (!verified) { - grub_file_close (sig); - grub_free (ret); + VasEBoot_file_close (sig); + VasEBoot_free (ret); return NULL; } - verified->buf = grub_malloc (ret->size); + verified->buf = VasEBoot_malloc (ret->size); if (!verified->buf) { - grub_file_close (sig); - grub_free (verified); - grub_free (ret); + VasEBoot_file_close (sig); + VasEBoot_free (verified); + VasEBoot_free (ret); return NULL; } - if (grub_file_read (io, verified->buf, ret->size) != (grub_ssize_t) ret->size) + if (VasEBoot_file_read (io, verified->buf, ret->size) != (VasEBoot_ssize_t) ret->size) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), filename); - grub_file_close (sig); + VasEBoot_file_close (sig); verified_free (verified); - grub_free (ret); + VasEBoot_free (ret); return NULL; } - err = grub_verify_signature_real (verified->buf, ret->size, 0, sig, NULL); - grub_file_close (sig); + err = VasEBoot_verify_signature_real (verified->buf, ret->size, 0, sig, NULL); + VasEBoot_file_close (sig); if (err) { verified_free (verified); - grub_free (ret); + VasEBoot_free (ret); return NULL; } verified->file = io; @@ -1019,84 +1019,84 @@ grub_pubkey_open (grub_file_t io, const char *filename) } static char * -grub_env_write_sec (struct grub_env_var *var __attribute__ ((unused)), +VasEBoot_env_write_sec (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { sec = (*val == '1') || (*val == 'e'); - return grub_strdup (sec ? "enforce" : "no"); + return VasEBoot_strdup (sec ? "enforce" : "no"); } -static grub_extcmd_t cmd, cmd_trust; -static grub_command_t cmd_trust_var, cmd_distrust, cmd_list; +static VasEBoot_extcmd_t cmd, cmd_trust; +static VasEBoot_command_t cmd_trust_var, cmd_distrust, cmd_list; -GRUB_MOD_INIT(verify) +VasEBoot_MOD_INIT(verify) { const char *val; - struct grub_module_header *header; + struct VasEBoot_module_header *header; - val = grub_env_get ("check_signatures"); + val = VasEBoot_env_get ("check_signatures"); if (val && (val[0] == '1' || val[0] == 'e')) sec = 1; else sec = 0; - grub_file_filter_register (GRUB_FILE_FILTER_PUBKEY, grub_pubkey_open); + VasEBoot_file_filter_register (VasEBoot_FILE_FILTER_PUBKEY, VasEBoot_pubkey_open); - grub_register_variable_hook ("check_signatures", 0, grub_env_write_sec); - grub_env_export ("check_signatures"); + VasEBoot_register_variable_hook ("check_signatures", 0, VasEBoot_env_write_sec); + VasEBoot_env_export ("check_signatures"); - grub_pk_trusted = 0; + VasEBoot_pk_trusted = 0; FOR_MODULES (header) { - struct grub_file pseudo_file; - struct grub_public_key *pk = NULL; + struct VasEBoot_file pseudo_file; + struct VasEBoot_public_key *pk = NULL; - grub_memset (&pseudo_file, 0, sizeof (pseudo_file)); + VasEBoot_memset (&pseudo_file, 0, sizeof (pseudo_file)); /* Not an ELF module, skip. */ if (header->type != OBJ_TYPE_PUBKEY) continue; pseudo_file.fs = &pseudo_fs; - pseudo_file.size = (header->size - sizeof (struct grub_module_header)); - pseudo_file.data = (char *) header + sizeof (struct grub_module_header); + pseudo_file.size = (header->size - sizeof (struct VasEBoot_module_header)); + pseudo_file.data = (char *) header + sizeof (struct VasEBoot_module_header); - pk = grub_load_public_key (&pseudo_file); + pk = VasEBoot_load_public_key (&pseudo_file); if (!pk) - grub_fatal ("error loading initial key: %s\n", grub_errmsg); + VasEBoot_fatal ("error loading initial key: %s\n", VasEBoot_errmsg); - pk->next = grub_pk_trusted; - grub_pk_trusted = pk; + pk->next = VasEBoot_pk_trusted; + VasEBoot_pk_trusted = pk; } if (!val) - grub_env_set ("check_signatures", grub_pk_trusted ? "enforce" : "no"); + VasEBoot_env_set ("check_signatures", VasEBoot_pk_trusted ? "enforce" : "no"); - cmd = grub_register_extcmd ("verify_detached", grub_cmd_verify_signature, 0, + cmd = VasEBoot_register_extcmd ("verify_detached", VasEBoot_cmd_verify_signature, 0, N_("[-s|--skip-sig] FILE SIGNATURE_FILE [PUBKEY_FILE]"), N_("Verify detached signature."), options); - cmd_trust = grub_register_extcmd ("trust", grub_cmd_trust, 0, + cmd_trust = VasEBoot_register_extcmd ("trust", VasEBoot_cmd_trust, 0, N_("[-s|--skip-sig] PUBKEY_FILE"), N_("Add PUBKEY_FILE to trusted keys."), options); - cmd_trust_var = grub_register_command ("trust_var", grub_cmd_trust_var, + cmd_trust_var = VasEBoot_register_command ("trust_var", VasEBoot_cmd_trust_var, N_("PUBKEY_VAR"), N_("Add the contents of PUBKEY_VAR to trusted keys.")); - cmd_list = grub_register_command ("list_trusted", grub_cmd_list, + cmd_list = VasEBoot_register_command ("list_trusted", VasEBoot_cmd_list, 0, N_("Show the list of trusted keys.")); - cmd_distrust = grub_register_command ("distrust", grub_cmd_distrust, + cmd_distrust = VasEBoot_register_command ("distrust", VasEBoot_cmd_distrust, N_("PUBKEY_ID"), N_("Remove PUBKEY_ID from trusted keys.")); } -GRUB_MOD_FINI(verify) +VasEBoot_MOD_FINI(verify) { - grub_file_filter_unregister (GRUB_FILE_FILTER_PUBKEY); - grub_unregister_extcmd (cmd); - grub_unregister_extcmd (cmd_trust); - grub_unregister_command (cmd_trust_var); - grub_unregister_command (cmd_list); - grub_unregister_command (cmd_distrust); + VasEBoot_file_filter_unregister (VasEBoot_FILE_FILTER_PUBKEY); + VasEBoot_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd_trust); + VasEBoot_unregister_command (cmd_trust_var); + VasEBoot_unregister_command (cmd_list); + VasEBoot_unregister_command (cmd_distrust); } diff --git a/VasEBoot-core/commands/videoinfo.c b/VasEBoot-core/commands/videoinfo.c index 4be8107d5..a44abad29 100644 --- a/VasEBoot-core/commands/videoinfo.c +++ b/VasEBoot-core/commands/videoinfo.c @@ -1,40 +1,40 @@ /* videoinfo.c - command to list video modes. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct hook_ctx { unsigned height, width, depth; - struct grub_video_mode_info *current_mode; + struct VasEBoot_video_mode_info *current_mode; }; static int -hook (const struct grub_video_mode_info *info, void *hook_arg) +hook (const struct VasEBoot_video_mode_info *info, void *hook_arg) { struct hook_ctx *ctx = hook_arg; @@ -44,26 +44,26 @@ hook (const struct grub_video_mode_info *info, void *hook_arg) if (ctx->depth && info->bpp != ctx->depth) return 0; - if (info->mode_number == GRUB_VIDEO_MODE_NUMBER_INVALID) - grub_printf (" "); + if (info->mode_number == VasEBoot_VIDEO_MODE_NUMBER_INVALID) + VasEBoot_printf (" "); else { if (ctx->current_mode && info->mode_number == ctx->current_mode->mode_number) - grub_printf ("*"); + VasEBoot_printf ("*"); else - grub_printf (" "); - grub_printf (" 0x%03x ", info->mode_number); + VasEBoot_printf (" "); + VasEBoot_printf (" 0x%03x ", info->mode_number); } - grub_printf ("%4d x %4d x %2d (%4d) ", info->width, info->height, info->bpp, + VasEBoot_printf ("%4d x %4d x %2d (%4d) ", info->width, info->height, info->bpp, info->pitch); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_PURE_TEXT) - grub_xputs (_("Text-only ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT) + VasEBoot_xputs (_("Text-only ")); /* Show mask and position details for direct color modes. */ - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_RGB) + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_RGB) /* TRANSLATORS: "Direct color" is a mode when the color components are written dirrectly into memory. */ - grub_printf_ (N_("Direct color, mask: %d/%d/%d/%d pos: %d/%d/%d/%d"), + VasEBoot_printf_ (N_("Direct color, mask: %d/%d/%d/%d pos: %d/%d/%d/%d"), info->red_mask_size, info->green_mask_size, info->blue_mask_size, @@ -72,65 +72,65 @@ hook (const struct grub_video_mode_info *info, void *hook_arg) info->green_field_pos, info->blue_field_pos, info->reserved_field_pos); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) /* TRANSLATORS: In "paletted color" mode you write the index of the color in the palette. Synonyms include "packed pixel". */ - grub_xputs (_("Paletted ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_YUV) - grub_xputs (_("YUV ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_PLANAR) + VasEBoot_xputs (_("Paletted ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_YUV) + VasEBoot_xputs (_("YUV ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_PLANAR) /* TRANSLATORS: "Planar" is the video memory where you have to write in several different banks "plans" to control the different color components of the same pixel. */ - grub_xputs (_("Planar ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_HERCULES) - grub_xputs (_("Hercules ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_CGA) - grub_xputs (_("CGA ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_NONCHAIN4) + VasEBoot_xputs (_("Planar ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_HERCULES) + VasEBoot_xputs (_("Hercules ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_CGA) + VasEBoot_xputs (_("CGA ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_NONCHAIN4) /* TRANSLATORS: Non-chain 4 is a 256-color planar (unchained) video memory mode. */ - grub_xputs (_("Non-chain 4 ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) - grub_xputs (_("Monochrome ")); - if (info->mode_type & GRUB_VIDEO_MODE_TYPE_UNKNOWN) - grub_xputs (_("Unknown video mode ")); + VasEBoot_xputs (_("Non-chain 4 ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP) + VasEBoot_xputs (_("Monochrome ")); + if (info->mode_type & VasEBoot_VIDEO_MODE_TYPE_UNKNOWN) + VasEBoot_xputs (_("Unknown video mode ")); - grub_xputs ("\n"); + VasEBoot_xputs ("\n"); return 0; } static void -print_edid (struct grub_video_edid_info *edid_info) +print_edid (struct VasEBoot_video_edid_info *edid_info) { unsigned int edid_width, edid_height; - if (grub_video_edid_checksum (edid_info)) + if (VasEBoot_video_edid_checksum (edid_info)) { - grub_puts_ (N_(" EDID checksum invalid")); - grub_errno = GRUB_ERR_NONE; + VasEBoot_puts_ (N_(" EDID checksum invalid")); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - grub_printf_ (N_(" EDID version: %u.%u\n"), + VasEBoot_printf_ (N_(" EDID version: %u.%u\n"), edid_info->version, edid_info->revision); - if (grub_video_edid_preferred_mode (edid_info, &edid_width, &edid_height) - == GRUB_ERR_NONE) - grub_printf_ (N_(" Preferred mode: %ux%u\n"), edid_width, edid_height); + if (VasEBoot_video_edid_preferred_mode (edid_info, &edid_width, &edid_height) + == VasEBoot_ERR_NONE) + VasEBoot_printf_ (N_(" Preferred mode: %ux%u\n"), edid_width, edid_height); else { - grub_printf_ (N_(" No preferred mode available\n")); - grub_errno = GRUB_ERR_NONE; + VasEBoot_printf_ (N_(" No preferred mode available\n")); + VasEBoot_errno = VasEBoot_ERR_NONE; } } -static grub_err_t -grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_videoinfo (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_video_adapter_t adapter; - grub_video_driver_id_t id; + VasEBoot_video_adapter_t adapter; + VasEBoot_video_driver_id_t id; struct hook_ctx ctx; ctx.height = ctx.width = ctx.depth = 0; @@ -138,46 +138,46 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), { char *ptr; ptr = args[0]; - ctx.width = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + ctx.width = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr != 'x') - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid video mode specification `%s'"), args[0]); ptr++; - ctx.height = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + ctx.height = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr == 'x') { ptr++; - ctx.depth = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + ctx.depth = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; } } -#ifdef GRUB_MACHINE_PCBIOS - if (grub_strcmp (cmd->name, "vbeinfo") == 0) - grub_dl_load ("vbe"); +#ifdef VasEBoot_MACHINE_PCBIOS + if (VasEBoot_strcmp (cmd->name, "vbeinfo") == 0) + VasEBoot_dl_load ("vbe"); #endif - id = grub_video_get_driver_id (); + id = VasEBoot_video_get_driver_id (); - grub_puts_ (N_("List of supported video modes:")); - grub_puts_ (N_("Legend: mask/position=red/green/blue/reserved")); + VasEBoot_puts_ (N_("List of supported video modes:")); + VasEBoot_puts_ (N_("Legend: mask/position=red/green/blue/reserved")); FOR_VIDEO_ADAPTERS (adapter) { - struct grub_video_mode_info info; - struct grub_video_edid_info edid_info; + struct VasEBoot_video_mode_info info; + struct VasEBoot_video_edid_info edid_info; - grub_printf_ (N_("Adapter `%s':\n"), adapter->name); + VasEBoot_printf_ (N_("Adapter `%s':\n"), adapter->name); if (!adapter->iterate) { - grub_puts_ (N_(" No info available")); + VasEBoot_puts_ (N_(" No info available")); continue; } @@ -185,18 +185,18 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), if (adapter->id == id) { - if (grub_video_get_info (&info) == GRUB_ERR_NONE) + if (VasEBoot_video_get_info (&info) == VasEBoot_ERR_NONE) ctx.current_mode = &info; else /* Don't worry about errors. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } else { if (adapter->init ()) { - grub_puts_ (N_(" Failed to initialize video adapter")); - grub_errno = GRUB_ERR_NONE; + VasEBoot_puts_ (N_(" Failed to initialize video adapter")); + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } } @@ -206,10 +206,10 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), adapter->iterate (hook, &ctx); - if (adapter->get_edid && adapter->get_edid (&edid_info) == GRUB_ERR_NONE) + if (adapter->get_edid && adapter->get_edid (&edid_info) == VasEBoot_ERR_NONE) print_edid (&edid_info); else - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; ctx.current_mode = NULL; @@ -217,22 +217,22 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), { if (adapter->fini ()) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; -#ifdef GRUB_MACHINE_PCBIOS -static grub_command_t cmd_vbe; +static VasEBoot_command_t cmd; +#ifdef VasEBoot_MACHINE_PCBIOS +static VasEBoot_command_t cmd_vbe; #endif -GRUB_MOD_INIT(videoinfo) +VasEBoot_MOD_INIT(videoinfo) { - cmd = grub_register_command ("videoinfo", grub_cmd_videoinfo, + cmd = VasEBoot_register_command ("videoinfo", VasEBoot_cmd_videoinfo, /* TRANSLATORS: "x" has to be entered in, like an identifier, so please don't use better Unicode codepoints. */ @@ -240,8 +240,8 @@ GRUB_MOD_INIT(videoinfo) N_("List available video modes. If " "resolution is given show only modes" " matching it.")); -#ifdef GRUB_MACHINE_PCBIOS - cmd_vbe = grub_register_command ("vbeinfo", grub_cmd_videoinfo, +#ifdef VasEBoot_MACHINE_PCBIOS + cmd_vbe = VasEBoot_register_command ("vbeinfo", VasEBoot_cmd_videoinfo, /* TRANSLATORS: "x" has to be entered in, like an identifier, so please don't use better Unicode codepoints. */ @@ -252,11 +252,11 @@ GRUB_MOD_INIT(videoinfo) #endif } -GRUB_MOD_FINI(videoinfo) +VasEBoot_MOD_FINI(videoinfo) { - grub_unregister_command (cmd); -#ifdef GRUB_MACHINE_PCBIOS - grub_unregister_command (cmd_vbe); + VasEBoot_unregister_command (cmd); +#ifdef VasEBoot_MACHINE_PCBIOS + VasEBoot_unregister_command (cmd_vbe); #endif } diff --git a/VasEBoot-core/commands/videotest.c b/VasEBoot-core/commands/videotest.c index b6c181b52..f328c0f8a 100644 --- a/VasEBoot-core/commands/videotest.c +++ b/VasEBoot-core/commands/videotest.c @@ -1,105 +1,105 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_videotest (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_err_t err; - grub_video_color_t color; + VasEBoot_err_t err; + VasEBoot_video_color_t color; unsigned int x; unsigned int y; unsigned int width; unsigned int height; int i; - struct grub_video_render_target *text_layer; - grub_video_color_t palette[16]; + struct VasEBoot_video_render_target *text_layer; + VasEBoot_video_color_t palette[16]; const char *mode = NULL; -#ifdef GRUB_MACHINE_PCBIOS - if (grub_strcmp (cmd->name, "vbetest") == 0) - grub_dl_load ("vbe"); +#ifdef VasEBoot_MACHINE_PCBIOS + if (VasEBoot_strcmp (cmd->name, "vbetest") == 0) + VasEBoot_dl_load ("vbe"); #endif - mode = grub_env_get ("gfxmode"); + mode = VasEBoot_env_get ("gfxmode"); if (argc) mode = args[0]; if (!mode) mode = "auto"; - err = grub_video_set_mode (mode, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); + err = VasEBoot_video_set_mode (mode, VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT, 0); if (err) return err; - grub_video_get_viewport (&x, &y, &width, &height); + VasEBoot_video_get_viewport (&x, &y, &width, &height); { const char *str; int texty; - grub_font_t sansbig; - grub_font_t sans; - grub_font_t sanssmall; - grub_font_t fixed; - struct grub_font_glyph *glyph; + VasEBoot_font_t sansbig; + VasEBoot_font_t sans; + VasEBoot_font_t sanssmall; + VasEBoot_font_t fixed; + struct VasEBoot_font_glyph *glyph; - if (grub_video_create_render_target (&text_layer, width, height, - GRUB_VIDEO_MODE_TYPE_RGB - | GRUB_VIDEO_MODE_TYPE_ALPHA) + if (VasEBoot_video_create_render_target (&text_layer, width, height, + VasEBoot_VIDEO_MODE_TYPE_RGB + | VasEBoot_VIDEO_MODE_TYPE_ALPHA) || !text_layer) goto fail; - grub_video_set_active_render_target (text_layer); + VasEBoot_video_set_active_render_target (text_layer); - color = grub_video_map_rgb (0, 255, 255); - sansbig = grub_font_get ("Unknown Regular 16"); - sans = grub_font_get ("Unknown Regular 16"); - sanssmall = grub_font_get ("Unknown Regular 16"); - fixed = grub_font_get ("Fixed 20"); + color = VasEBoot_video_map_rgb (0, 255, 255); + sansbig = VasEBoot_font_get ("Unknown Regular 16"); + sans = VasEBoot_font_get ("Unknown Regular 16"); + sanssmall = VasEBoot_font_get ("Unknown Regular 16"); + fixed = VasEBoot_font_get ("Fixed 20"); if (! sansbig || ! sans || ! sanssmall || ! fixed) - return grub_error (GRUB_ERR_BAD_FONT, "no font loaded"); + return VasEBoot_error (VasEBoot_ERR_BAD_FONT, "no font loaded"); - glyph = grub_font_get_glyph (fixed, '*'); - grub_font_draw_glyph (glyph, color, 200 ,0); + glyph = VasEBoot_font_get_glyph (fixed, '*'); + VasEBoot_font_draw_glyph (glyph, color, 200 ,0); - color = grub_video_map_rgb (255, 255, 255); + color = VasEBoot_video_map_rgb (255, 255, 255); texty = 32; - grub_font_draw_string ("The quick brown fox jumped over the lazy dog.", + VasEBoot_font_draw_string ("The quick brown fox jumped over the lazy dog.", sans, color, 16, texty); - texty += grub_font_get_descent (sans) + grub_font_get_leading (sans); + texty += VasEBoot_font_get_descent (sans) + VasEBoot_font_get_leading (sans); - texty += grub_font_get_ascent (fixed); - grub_font_draw_string ("The quick brown fox jumped over the lazy dog.", + texty += VasEBoot_font_get_ascent (fixed); + VasEBoot_font_draw_string ("The quick brown fox jumped over the lazy dog.", fixed, color, 16, texty); - texty += grub_font_get_descent (fixed) + grub_font_get_leading (fixed); + texty += VasEBoot_font_get_descent (fixed) + VasEBoot_font_get_leading (fixed); /* To convert Unicode characters into UTF-8 for this test, the following command is useful: @@ -122,103 +122,103 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)), "Unicode test: happy\xE2\x98\xBA \xC2\xA3 5.00" " \xC2\xA1\xCF\x84\xC3\xA4u! " " \xE2\x84\xA4\xE2\x8A\x86\xE2\x84\x9D"; - color = grub_video_map_rgb (128, 128, 255); + color = VasEBoot_video_map_rgb (128, 128, 255); /* All characters in the string exist in the 'Fixed 20' (10x20) font. */ - texty += grub_font_get_ascent(fixed); - grub_font_draw_string (str, fixed, color, 16, texty); - texty += grub_font_get_descent (fixed) + grub_font_get_leading (fixed); + texty += VasEBoot_font_get_ascent(fixed); + VasEBoot_font_draw_string (str, fixed, color, 16, texty); + texty += VasEBoot_font_get_descent (fixed) + VasEBoot_font_get_leading (fixed); - texty += grub_font_get_ascent(sansbig); - grub_font_draw_string (str, sansbig, color, 16, texty); - texty += grub_font_get_descent (sansbig) + grub_font_get_leading (sansbig); + texty += VasEBoot_font_get_ascent(sansbig); + VasEBoot_font_draw_string (str, sansbig, color, 16, texty); + texty += VasEBoot_font_get_descent (sansbig) + VasEBoot_font_get_leading (sansbig); - texty += grub_font_get_ascent(sans); - grub_font_draw_string (str, sans, color, 16, texty); - texty += grub_font_get_descent (sans) + grub_font_get_leading (sans); + texty += VasEBoot_font_get_ascent(sans); + VasEBoot_font_draw_string (str, sans, color, 16, texty); + texty += VasEBoot_font_get_descent (sans) + VasEBoot_font_get_leading (sans); - texty += grub_font_get_ascent(sanssmall); - grub_font_draw_string (str, sanssmall, color, 16, texty); - texty += (grub_font_get_descent (sanssmall) - + grub_font_get_leading (sanssmall)); + texty += VasEBoot_font_get_ascent(sanssmall); + VasEBoot_font_draw_string (str, sanssmall, color, 16, texty); + texty += (VasEBoot_font_get_descent (sanssmall) + + VasEBoot_font_get_leading (sanssmall)); - glyph = grub_font_get_glyph (fixed, '*'); + glyph = VasEBoot_font_get_glyph (fixed, '*'); for (i = 0; i < 16; i++) { - color = grub_video_map_color (i); + color = VasEBoot_video_map_color (i); palette[i] = color; - grub_font_draw_glyph (glyph, color, 16 + i * 16, 220); + VasEBoot_font_draw_glyph (glyph, color, 16 + i * 16, 220); } } - grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); + VasEBoot_video_set_active_render_target (VasEBoot_VIDEO_RENDER_TARGET_DISPLAY); for (i = 0; i < 5; i++) { if (i == 0 || i == 1) { - color = grub_video_map_rgb (0, 0, 0); - grub_video_fill_rect (color, 0, 0, width, height); + color = VasEBoot_video_map_rgb (0, 0, 0); + VasEBoot_video_fill_rect (color, 0, 0, width, height); - color = grub_video_map_rgb (255, 0, 0); - grub_video_fill_rect (color, 0, 0, 100, 100); + color = VasEBoot_video_map_rgb (255, 0, 0); + VasEBoot_video_fill_rect (color, 0, 0, 100, 100); - color = grub_video_map_rgb (0, 255, 0); - grub_video_fill_rect (color, 100, 0, 100, 100); + color = VasEBoot_video_map_rgb (0, 255, 0); + VasEBoot_video_fill_rect (color, 100, 0, 100, 100); - color = grub_video_map_rgb (0, 0, 255); - grub_video_fill_rect (color, 200, 0, 100, 100); + color = VasEBoot_video_map_rgb (0, 0, 255); + VasEBoot_video_fill_rect (color, 200, 0, 100, 100); - color = grub_video_map_rgb (0, 255, 255); - grub_video_fill_rect (color, 0, 100, 100, 100); + color = VasEBoot_video_map_rgb (0, 255, 255); + VasEBoot_video_fill_rect (color, 0, 100, 100, 100); - color = grub_video_map_rgb (255, 0, 255); - grub_video_fill_rect (color, 100, 100, 100, 100); + color = VasEBoot_video_map_rgb (255, 0, 255); + VasEBoot_video_fill_rect (color, 100, 100, 100, 100); - color = grub_video_map_rgb (255, 255, 0); - grub_video_fill_rect (color, 200, 100, 100, 100); + color = VasEBoot_video_map_rgb (255, 255, 0); + VasEBoot_video_fill_rect (color, 200, 100, 100, 100); - grub_video_set_viewport (x + 150, y + 150, + VasEBoot_video_set_viewport (x + 150, y + 150, width - 150 * 2, height - 150 * 2); - color = grub_video_map_rgb (77, 33, 77); - grub_video_fill_rect (color, 0, 0, width, height); + color = VasEBoot_video_map_rgb (77, 33, 77); + VasEBoot_video_fill_rect (color, 0, 0, width, height); } - color = grub_video_map_rgb (i, 33, 77); - grub_video_fill_rect (color, 0, 0, width, height); - grub_video_blit_render_target (text_layer, GRUB_VIDEO_BLIT_BLEND, 0, 0, + color = VasEBoot_video_map_rgb (i, 33, 77); + VasEBoot_video_fill_rect (color, 0, 0, width, height); + VasEBoot_video_blit_render_target (text_layer, VasEBoot_VIDEO_BLIT_BLEND, 0, 0, 0, 0, width, height); - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); } - grub_getkey (); + VasEBoot_getkey (); - grub_video_delete_render_target (text_layer); + VasEBoot_video_delete_render_target (text_layer); - grub_video_restore (); + VasEBoot_video_restore (); for (i = 0; i < 16; i++) - grub_printf("color %d: %08x\n", i, palette[i]); + VasEBoot_printf("color %d: %08x\n", i, palette[i]); - grub_errno = GRUB_ERR_NONE; - return grub_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; + return VasEBoot_errno; fail: - grub_video_delete_render_target (text_layer); - grub_video_restore (); - return grub_errno; + VasEBoot_video_delete_render_target (text_layer); + VasEBoot_video_restore (); + return VasEBoot_errno; } -static grub_command_t cmd; -#ifdef GRUB_MACHINE_PCBIOS -static grub_command_t cmd_vbe; +static VasEBoot_command_t cmd; +#ifdef VasEBoot_MACHINE_PCBIOS +static VasEBoot_command_t cmd_vbe; #endif -GRUB_MOD_INIT(videotest) +VasEBoot_MOD_INIT(videotest) { - cmd = grub_register_command ("videotest", grub_cmd_videotest, + cmd = VasEBoot_register_command ("videotest", VasEBoot_cmd_videotest, /* TRANSLATORS: "x" has to be entered in, like an identifier, so please don't use better Unicode codepoints. */ @@ -226,16 +226,16 @@ GRUB_MOD_INIT(videotest) /* TRANSLATORS: Here, on the other hand, it's nicer to use unicode cross instead of x. */ N_("Test video subsystem in mode WxH.")); -#ifdef GRUB_MACHINE_PCBIOS - cmd_vbe = grub_register_command ("vbetest", grub_cmd_videotest, +#ifdef VasEBoot_MACHINE_PCBIOS + cmd_vbe = VasEBoot_register_command ("vbetest", VasEBoot_cmd_videotest, 0, N_("Test video subsystem.")); #endif } -GRUB_MOD_FINI(videotest) +VasEBoot_MOD_FINI(videotest) { - grub_unregister_command (cmd); -#ifdef GRUB_MACHINE_PCBIOS - grub_unregister_command (cmd_vbe); + VasEBoot_unregister_command (cmd); +#ifdef VasEBoot_MACHINE_PCBIOS + VasEBoot_unregister_command (cmd_vbe); #endif } diff --git a/VasEBoot-core/commands/wildcard.c b/VasEBoot-core/commands/wildcard.c index 9b4e72766..2c0bd66e9 100644 --- a/VasEBoot-core/commands/wildcard.c +++ b/VasEBoot-core/commands/wildcard.c @@ -1,28 +1,28 @@ -/* wildcard.c - Wildcard character expansion for GRUB script. */ +/* wildcard.c - Wildcard character expansion for VasEBoot script. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -36,9 +36,9 @@ static char ** match_devices (const regex_t *regexp, int noparts); static char ** match_files (const char *prefix, const char *suffix_start, const char *suffix_end, const regex_t *regexp); -static grub_err_t wildcard_expand (const char *s, char ***strs); +static VasEBoot_err_t wildcard_expand (const char *s, char ***strs); -struct grub_script_wildcard_translator grub_filename_translator = { +struct VasEBoot_script_wildcard_translator VasEBoot_filename_translator = { .expand = wildcard_expand, }; @@ -60,11 +60,11 @@ merge (char **dest, char **ps) for (j = 0; ps[j]; j++) ; - p = grub_realloc (dest, sizeof (char*) * (i + j + 1)); + p = VasEBoot_realloc (dest, sizeof (char*) * (i + j + 1)); if (! p) { - grub_free (dest); - grub_free (ps); + VasEBoot_free (dest); + VasEBoot_free (ps); return 0; } @@ -73,14 +73,14 @@ merge (char **dest, char **ps) dest[i++] = ps[j]; dest[i] = 0; - grub_free (ps); + VasEBoot_free (ps); return dest; } static inline int isregexop (char ch) { - return grub_strchr ("*.\\|+{}[]?", ch) ? 1 : 0; + return VasEBoot_strchr ("*.\\|+{}[]?", ch) ? 1 : 0; } static char * @@ -91,14 +91,14 @@ make_dir (const char *prefix, const char *start, const char *end) unsigned n; char *result; - i = grub_strlen (prefix); + i = VasEBoot_strlen (prefix); n = i + end - start; - result = grub_malloc (n + 1); + result = VasEBoot_malloc (n + 1); if (! result) return 0; - grub_strcpy (result, prefix); + VasEBoot_strcpy (result, prefix); while (start < end && (ch = *start++)) if (ch == '\\' && isregexop (*start)) result[i++] = *start++; @@ -115,7 +115,7 @@ make_regex (const char *start, const char *end, regex_t *regexp) char ch; int i = 0; unsigned len = end - start; - char *buffer = grub_malloc (len * 2 + 2 + 1); /* worst case size. */ + char *buffer = VasEBoot_malloc (len * 2 + 2 + 1); /* worst case size. */ if (! buffer) return 1; @@ -161,15 +161,15 @@ make_regex (const char *start, const char *end, regex_t *regexp) } buffer[i++] = '$'; buffer[i] = '\0'; - grub_dprintf ("expand", "Regexp is %s\n", buffer); + VasEBoot_dprintf ("expand", "Regexp is %s\n", buffer); if (regcomp (regexp, buffer, RE_SYNTAX_GNU_AWK)) { - grub_free (buffer); + VasEBoot_free (buffer); return 1; } - grub_free (buffer); + VasEBoot_free (buffer); return 0; } @@ -228,25 +228,25 @@ match_devices_iter (const char *name, void *data) char *buffer; /* skip partitions if asked to. */ - if (ctx->noparts && grub_strchr (name, ',')) + if (ctx->noparts && VasEBoot_strchr (name, ',')) return 0; - buffer = grub_xasprintf ("(%s)", name); + buffer = VasEBoot_xasprintf ("(%s)", name); if (! buffer) return 1; - grub_dprintf ("expand", "matching: %s\n", buffer); + VasEBoot_dprintf ("expand", "matching: %s\n", buffer); if (regexec (ctx->regexp, buffer, 0, 0, 0)) { - grub_dprintf ("expand", "not matched\n"); - grub_free (buffer); + VasEBoot_dprintf ("expand", "not matched\n"); + VasEBoot_free (buffer); return 0; } - t = grub_realloc (ctx->devs, sizeof (char*) * (ctx->ndev + 2)); + t = VasEBoot_realloc (ctx->devs, sizeof (char*) * (ctx->ndev + 2)); if (! t) { - grub_free (buffer); + VasEBoot_free (buffer); return 1; } @@ -267,7 +267,7 @@ match_devices (const regex_t *regexp, int noparts) }; int i; - if (grub_device_iterate (match_devices_iter, &ctx)) + if (VasEBoot_device_iterate (match_devices_iter, &ctx)) goto fail; return ctx.devs; @@ -275,9 +275,9 @@ match_devices (const regex_t *regexp, int noparts) fail: for (i = 0; ctx.devs && ctx.devs[i]; i++) - grub_free (ctx.devs[i]); + VasEBoot_free (ctx.devs[i]); - grub_free (ctx.devs); + VasEBoot_free (ctx.devs); return 0; } @@ -294,7 +294,7 @@ struct match_files_ctx /* Helper for match_files. */ static int match_files_iter (const char *name, - const struct grub_dirhook_info *info __attribute__((unused)), + const struct VasEBoot_dirhook_info *info __attribute__((unused)), void *data) { struct match_files_ctx *ctx = data; @@ -302,23 +302,23 @@ match_files_iter (const char *name, char *buffer; /* skip . and .. names */ - if (grub_strcmp(".", name) == 0 || grub_strcmp("..", name) == 0) + if (VasEBoot_strcmp(".", name) == 0 || VasEBoot_strcmp("..", name) == 0) return 0; - grub_dprintf ("expand", "matching: %s in %s\n", name, ctx->dir); + VasEBoot_dprintf ("expand", "matching: %s in %s\n", name, ctx->dir); if (regexec (ctx->regexp, name, 0, 0, 0)) return 0; - grub_dprintf ("expand", "matched\n"); + VasEBoot_dprintf ("expand", "matched\n"); - buffer = grub_xasprintf ("%s%s", ctx->dir, name); + buffer = VasEBoot_xasprintf ("%s%s", ctx->dir, name); if (! buffer) return 1; - t = grub_realloc (ctx->files, sizeof (char*) * (ctx->nfile + 2)); + t = VasEBoot_realloc (ctx->files, sizeof (char*) * (ctx->nfile + 2)); if (! t) { - grub_free (buffer); + VasEBoot_free (buffer); return 1; } @@ -340,29 +340,29 @@ match_files (const char *prefix, const char *suffix, const char *end, int i; const char *path; char *device_name; - grub_fs_t fs; - grub_device_t dev; + VasEBoot_fs_t fs; + VasEBoot_device_t dev; dev = 0; device_name = 0; - grub_error_push (); + VasEBoot_error_push (); ctx.dir = make_dir (prefix, suffix, end); if (! ctx.dir) goto fail; - device_name = grub_file_get_device_name (ctx.dir); - dev = grub_device_open (device_name); + device_name = VasEBoot_file_get_device_name (ctx.dir); + dev = VasEBoot_device_open (device_name); if (! dev) goto fail; - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) goto fail; if (ctx.dir[0] == '(') { - path = grub_strchr (ctx.dir, ')'); + path = VasEBoot_strchr (ctx.dir, ')'); if (!path) goto fail; path++; @@ -373,27 +373,27 @@ match_files (const char *prefix, const char *suffix, const char *end, if (fs->dir (dev, path, match_files_iter, &ctx)) goto fail; - grub_free (ctx.dir); - grub_device_close (dev); - grub_free (device_name); - grub_error_pop (); + VasEBoot_free (ctx.dir); + VasEBoot_device_close (dev); + VasEBoot_free (device_name); + VasEBoot_error_pop (); return ctx.files; fail: - grub_free (ctx.dir); + VasEBoot_free (ctx.dir); for (i = 0; ctx.files && ctx.files[i]; i++) - grub_free (ctx.files[i]); + VasEBoot_free (ctx.files[i]); - grub_free (ctx.files); + VasEBoot_free (ctx.files); if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - grub_free (device_name); + VasEBoot_free (device_name); - grub_error_pop (); + VasEBoot_error_pop (); return 0; } @@ -406,14 +406,14 @@ struct check_file_ctx /* Helper for check_file. */ static int -check_file_iter (const char *name, const struct grub_dirhook_info *info, +check_file_iter (const char *name, const struct VasEBoot_dirhook_info *info, void *data) { struct check_file_ctx *ctx = data; if (ctx->basename[0] == 0 - || (info->case_insensitive ? grub_strcasecmp (name, ctx->basename) == 0 - : grub_strcmp (name, ctx->basename) == 0)) + || (info->case_insensitive ? VasEBoot_strcasecmp (name, ctx->basename) == 0 + : VasEBoot_strcmp (name, ctx->basename) == 0)) { ctx->found = 1; return 1; @@ -429,22 +429,22 @@ check_file (const char *dir, const char *basename) .basename = basename, .found = 0 }; - grub_fs_t fs; - grub_device_t dev; + VasEBoot_fs_t fs; + VasEBoot_device_t dev; const char *device_name, *path; - device_name = grub_file_get_device_name (dir); - dev = grub_device_open (device_name); + device_name = VasEBoot_file_get_device_name (dir); + dev = VasEBoot_device_open (device_name); if (! dev) goto fail; - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) goto fail; if (dir[0] == '(') { - path = grub_strchr (dir, ')'); + path = VasEBoot_strchr (dir, ')'); if (!path) goto fail; path++; @@ -453,11 +453,11 @@ check_file (const char *dir, const char *basename) path = dir; fs->dir (dev, path[0] ? path : "/", check_file_iter, &ctx); - if (grub_errno == 0 && basename[0] == 0) + if (VasEBoot_errno == 0 && basename[0] == 0) ctx.found = 1; fail: - grub_errno = 0; + VasEBoot_errno = 0; return ctx.found; } @@ -483,7 +483,7 @@ unescape (char *out, const char *in, const char *end) *optr = 0; } -static grub_err_t +static VasEBoot_err_t wildcard_expand (const char *s, char ***strs) { const char *start; @@ -506,13 +506,13 @@ wildcard_expand (const char *s, char ***strs) if (noregexop == regexop) { - grub_dprintf ("expand", "no expansion needed\n"); + VasEBoot_dprintf ("expand", "no expansion needed\n"); if (paths == 0) { - paths = grub_malloc (sizeof (char *) * 2); + paths = VasEBoot_malloc (sizeof (char *) * 2); if (!paths) goto fail; - paths[0] = grub_malloc (regexop - start + 1); + paths[0] = VasEBoot_malloc (regexop - start + 1); if (!paths[0]) goto fail; unescape (paths[0], start, regexop); @@ -527,45 +527,45 @@ wildcard_expand (const char *s, char ***strs) char *n; char *p; o = paths[i]; - oend = o + grub_strlen (o); - n = grub_malloc ((oend - o) + (regexop - start) + 1); + oend = o + VasEBoot_strlen (o); + n = VasEBoot_malloc ((oend - o) + (regexop - start) + 1); if (!n) goto fail; - grub_memcpy (n, o, oend - o); + VasEBoot_memcpy (n, o, oend - o); unescape (n + (oend - o), start, regexop); if (had_regexp) - p = grub_strrchr (n, '/'); + p = VasEBoot_strrchr (n, '/'); else p = 0; if (!p) { - grub_free (o); + VasEBoot_free (o); paths[j++] = n; continue; } *p = 0; if (!check_file (n, p + 1)) { - grub_dprintf ("expand", "file <%s> in <%s> not found\n", + VasEBoot_dprintf ("expand", "file <%s> in <%s> not found\n", p + 1, n); - grub_free (o); - grub_free (n); + VasEBoot_free (o); + VasEBoot_free (n); continue; } *p = '/'; - grub_free (o); + VasEBoot_free (o); paths[j++] = n; } if (j == 0) { - grub_free (paths); + VasEBoot_free (paths); paths = 0; goto done; } paths[j] = 0; } - grub_dprintf ("expand", "paths[0] = `%s'\n", paths[0]); + VasEBoot_dprintf ("expand", "paths[0] = `%s'\n", paths[0]); start = regexop; continue; } @@ -592,7 +592,7 @@ wildcard_expand (const char *s, char ***strs) char **p; p = match_files (paths[i], start, noregexop, ®exp); - grub_free (paths[i]); + VasEBoot_free (paths[i]); if (! p) continue; @@ -600,7 +600,7 @@ wildcard_expand (const char *s, char ***strs) if (! r) goto fail; } - grub_free (paths); + VasEBoot_free (paths); paths = r; } @@ -619,8 +619,8 @@ wildcard_expand (const char *s, char ***strs) fail: for (i = 0; paths && paths[i]; i++) - grub_free (paths[i]); - grub_free (paths); + VasEBoot_free (paths[i]); + VasEBoot_free (paths); regfree (®exp); - return grub_errno; + return VasEBoot_errno; } diff --git a/VasEBoot-core/commands/xen/lsxen.c b/VasEBoot-core/commands/xen/lsxen.c index 97713102c..215cf6b81 100644 --- a/VasEBoot-core/commands/xen/lsxen.c +++ b/VasEBoot-core/commands/xen/lsxen.c @@ -1,60 +1,60 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static int hook (const char *dir, void *hook_data __attribute__ ((unused))) { - grub_printf ("%s\n", dir); + VasEBoot_printf ("%s\n", dir); return 0; } -static grub_err_t -grub_cmd_lsxen (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_lsxen (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { char *dir; - grub_err_t err; + VasEBoot_err_t err; char *buf; if (argc >= 1) - return grub_xenstore_dir (args[0], hook, NULL); + return VasEBoot_xenstore_dir (args[0], hook, NULL); - buf = grub_xenstore_get_file ("domid", NULL); + buf = VasEBoot_xenstore_get_file ("domid", NULL); if (!buf) - return grub_errno; - dir = grub_xasprintf ("/local/domain/%s", buf); - grub_free (buf); - err = grub_xenstore_dir (dir, hook, NULL); - grub_free (dir); + return VasEBoot_errno; + dir = VasEBoot_xasprintf ("/local/domain/%s", buf); + VasEBoot_free (buf); + err = VasEBoot_xenstore_dir (dir, hook, NULL); + VasEBoot_free (dir); return err; } -static grub_err_t -grub_cmd_catxen (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_catxen (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { const char *dir = "domid"; @@ -63,28 +63,28 @@ grub_cmd_catxen (grub_command_t cmd __attribute__ ((unused)), if (argc >= 1) dir = args[0]; - buf = grub_xenstore_get_file (dir, NULL); + buf = VasEBoot_xenstore_get_file (dir, NULL); if (!buf) - return grub_errno; - grub_xputs (buf); - grub_xputs ("\n"); - grub_free (buf); - return GRUB_ERR_NONE; + return VasEBoot_errno; + VasEBoot_xputs (buf); + VasEBoot_xputs ("\n"); + VasEBoot_free (buf); + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_ls, cmd_cat; +static VasEBoot_command_t cmd_ls, cmd_cat; -GRUB_MOD_INIT (lsxen) +VasEBoot_MOD_INIT (lsxen) { - cmd_ls = grub_register_command ("xen_ls", grub_cmd_lsxen, N_("[DIR]"), + cmd_ls = VasEBoot_register_command ("xen_ls", VasEBoot_cmd_lsxen, N_("[DIR]"), N_("List Xen storage.")); - cmd_cat = grub_register_command ("xen_cat", grub_cmd_catxen, N_("[DIR]"), + cmd_cat = VasEBoot_register_command ("xen_cat", VasEBoot_cmd_catxen, N_("[DIR]"), N_("List Xen storage.")); } -GRUB_MOD_FINI (lsxen) +VasEBoot_MOD_FINI (lsxen) { - grub_unregister_command (cmd_ls); - grub_unregister_command (cmd_cat); + VasEBoot_unregister_command (cmd_ls); + VasEBoot_unregister_command (cmd_cat); } diff --git a/VasEBoot-core/commands/xnu_uuid.c b/VasEBoot-core/commands/xnu_uuid.c index ae4b3a415..e84f6dbd5 100644 --- a/VasEBoot-core/commands/xnu_uuid.c +++ b/VasEBoot-core/commands/xnu_uuid.c @@ -1,80 +1,80 @@ /* xnu_uuid.c - transform 64-bit serial number to 128-bit uuid suitable for xnu. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1995,1996,1998,1999,2001,2002, * 2003, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* This prefix is used by xnu and boot-132 to hash together with volume serial. */ -static grub_uint8_t hash_prefix[16] +static VasEBoot_uint8_t hash_prefix[16] = {0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6, 0x97, 0xA4, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC}; -static grub_err_t -grub_cmd_xnu_uuid (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_uuid (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_uint64_t serial; - grub_uint8_t *xnu_uuid; + VasEBoot_uint64_t serial; + VasEBoot_uint8_t *xnu_uuid; char uuid_string[sizeof ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]; char *ptr; void *ctx; int low = 0; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "UUID required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "UUID required"); - if (argc > 1 && grub_strcmp (args[0], "-l") == 0) + if (argc > 1 && VasEBoot_strcmp (args[0], "-l") == 0) { low = 1; argc--; args++; } - serial = grub_cpu_to_be64 (grub_strtoull (args[0], 0, 16)); + serial = VasEBoot_cpu_to_be64 (VasEBoot_strtoull (args[0], 0, 16)); - ctx = grub_zalloc (GRUB_MD_MD5->contextsize); + ctx = VasEBoot_zalloc (VasEBoot_MD_MD5->contextsize); if (!ctx) - return grub_errno; - GRUB_MD_MD5->init (ctx); - GRUB_MD_MD5->write (ctx, hash_prefix, sizeof (hash_prefix)); - GRUB_MD_MD5->write (ctx, &serial, sizeof (serial)); - GRUB_MD_MD5->final (ctx); - xnu_uuid = GRUB_MD_MD5->read (ctx); + return VasEBoot_errno; + VasEBoot_MD_MD5->init (ctx); + VasEBoot_MD_MD5->write (ctx, hash_prefix, sizeof (hash_prefix)); + VasEBoot_MD_MD5->write (ctx, &serial, sizeof (serial)); + VasEBoot_MD_MD5->final (ctx); + xnu_uuid = VasEBoot_MD_MD5->read (ctx); - grub_snprintf (uuid_string, sizeof (uuid_string), + VasEBoot_snprintf (uuid_string, sizeof (uuid_string), "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", (unsigned int) xnu_uuid[0], (unsigned int) xnu_uuid[1], (unsigned int) xnu_uuid[2], (unsigned int) xnu_uuid[3], @@ -88,32 +88,32 @@ grub_cmd_xnu_uuid (grub_command_t cmd __attribute__ ((unused)), (unsigned int) xnu_uuid[14], (unsigned int) xnu_uuid[15]); if (!low) for (ptr = uuid_string; *ptr; ptr++) - *ptr = grub_toupper (*ptr); + *ptr = VasEBoot_toupper (*ptr); if (argc == 1) - grub_printf ("%s\n", uuid_string); + VasEBoot_printf ("%s\n", uuid_string); if (argc > 1) - grub_env_set (args[1], uuid_string); + VasEBoot_env_set (args[1], uuid_string); - grub_free (ctx); + VasEBoot_free (ctx); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT (xnu_uuid) +VasEBoot_MOD_INIT (xnu_uuid) { - cmd = grub_register_command ("xnu_uuid", grub_cmd_xnu_uuid, - /* TRANSLATORS: GRUBUUID stands for "filesystem - UUID as used in GRUB". */ - N_("[-l] GRUBUUID [VARNAME]"), + cmd = VasEBoot_register_command ("xnu_uuid", VasEBoot_cmd_xnu_uuid, + /* TRANSLATORS: VasEBootUUID stands for "filesystem + UUID as used in VasEBoot". */ + N_("[-l] VasEBootUUID [VARNAME]"), N_("Transform 64-bit UUID to format " "suitable for XNU. If -l is given keep " "it lowercase as done by blkid.")); } -GRUB_MOD_FINI (xnu_uuid) +VasEBoot_MOD_FINI (xnu_uuid) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/disk/AFSplitter.c b/VasEBoot-core/disk/AFSplitter.c index f5a8ddc61..ccbc6abd2 100644 --- a/VasEBoot-core/disk/AFSplitter.c +++ b/VasEBoot-core/disk/AFSplitter.c @@ -5,9 +5,9 @@ * AFsplitter diffuses information over a large stripe of data, * therefor supporting secure data destruction. * - * This program is grub_free software; you can redistribute it and/or modify + * This program is VasEBoot_free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the grub_free Software Foundation; either version 2 of the License, or + * the VasEBoot_free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -16,49 +16,49 @@ * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the grub_free Software + * along with this program; if not, write to the VasEBoot_free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include -gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, - grub_uint8_t * dst, grub_size_t blocksize, - grub_size_t blocknumbers); +gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, VasEBoot_uint8_t * src, + VasEBoot_uint8_t * dst, VasEBoot_size_t blocksize, + VasEBoot_size_t blocknumbers); static void -diffuse (const gcry_md_spec_t * hash, grub_uint8_t * src, - grub_uint8_t * dst, grub_size_t size) +diffuse (const gcry_md_spec_t * hash, VasEBoot_uint8_t * src, + VasEBoot_uint8_t * dst, VasEBoot_size_t size) { - grub_size_t i; - grub_uint32_t IV; /* host byte order independend hash IV */ + VasEBoot_size_t i; + VasEBoot_uint32_t IV; /* host byte order independend hash IV */ - grub_size_t fullblocks = size / hash->mdlen; + VasEBoot_size_t fullblocks = size / hash->mdlen; int padding = size % hash->mdlen; - grub_uint8_t final[GRUB_CRYPTO_MAX_MDLEN]; - grub_uint8_t temp[sizeof (IV) + GRUB_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t final[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t temp[sizeof (IV) + VasEBoot_CRYPTO_MAX_MDLEN]; /* hash block the whole data set with different IVs to produce * more than just a single data block */ for (i = 0; i < fullblocks; i++) { - IV = grub_cpu_to_be32 (i); - grub_memcpy (temp, &IV, sizeof (IV)); - grub_memcpy (temp + sizeof (IV), src + hash->mdlen * i, hash->mdlen); - grub_crypto_hash (hash, dst + hash->mdlen * i, temp, + IV = VasEBoot_cpu_to_be32 (i); + VasEBoot_memcpy (temp, &IV, sizeof (IV)); + VasEBoot_memcpy (temp + sizeof (IV), src + hash->mdlen * i, hash->mdlen); + VasEBoot_crypto_hash (hash, dst + hash->mdlen * i, temp, sizeof (IV) + hash->mdlen); } if (padding) { - IV = grub_cpu_to_be32 (i); - grub_memcpy (temp, &IV, sizeof (IV)); - grub_memcpy (temp + sizeof (IV), src + hash->mdlen * i, padding); - grub_crypto_hash (hash, final, temp, sizeof (IV) + padding); - grub_memcpy (dst + hash->mdlen * i, final, padding); + IV = VasEBoot_cpu_to_be32 (i); + VasEBoot_memcpy (temp, &IV, sizeof (IV)); + VasEBoot_memcpy (temp + sizeof (IV), src + hash->mdlen * i, padding); + VasEBoot_crypto_hash (hash, final, temp, sizeof (IV) + padding); + VasEBoot_memcpy (dst + hash->mdlen * i, final, padding); } } @@ -66,27 +66,27 @@ diffuse (const gcry_md_spec_t * hash, grub_uint8_t * src, * Merges the splitted master key stored on disk into the original key */ gcry_err_code_t -AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, grub_uint8_t * dst, - grub_size_t blocksize, grub_size_t blocknumbers) +AF_merge (const gcry_md_spec_t * hash, VasEBoot_uint8_t * src, VasEBoot_uint8_t * dst, + VasEBoot_size_t blocksize, VasEBoot_size_t blocknumbers) { - grub_size_t i; - grub_uint8_t *bufblock; + VasEBoot_size_t i; + VasEBoot_uint8_t *bufblock; - if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN || hash->mdlen == 0) + if (hash->mdlen > VasEBoot_CRYPTO_MAX_MDLEN || hash->mdlen == 0) return GPG_ERR_INV_ARG; - bufblock = grub_zalloc (blocksize); + bufblock = VasEBoot_zalloc (blocksize); if (bufblock == NULL) return GPG_ERR_OUT_OF_MEMORY; - grub_memset (bufblock, 0, blocksize); + VasEBoot_memset (bufblock, 0, blocksize); for (i = 0; i < blocknumbers - 1; i++) { - grub_crypto_xor (bufblock, src + (blocksize * i), bufblock, blocksize); + VasEBoot_crypto_xor (bufblock, src + (blocksize * i), bufblock, blocksize); diffuse (hash, bufblock, bufblock, blocksize); } - grub_crypto_xor (dst, src + (i * blocksize), bufblock, blocksize); + VasEBoot_crypto_xor (dst, src + (i * blocksize), bufblock, blocksize); - grub_free (bufblock); + VasEBoot_free (bufblock); return GPG_ERR_NO_ERROR; } diff --git a/VasEBoot-core/disk/ahci.c b/VasEBoot-core/disk/ahci.c index 494a1b773..564dfe2c7 100644 --- a/VasEBoot-core/disk/ahci.c +++ b/VasEBoot-core/disk/ahci.c @@ -1,335 +1,335 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_ahci_cmd_head +struct VasEBoot_ahci_cmd_head { - grub_uint32_t config; - grub_uint32_t transferred; - grub_uint64_t command_table_base; - grub_uint32_t unused[4]; + VasEBoot_uint32_t config; + VasEBoot_uint32_t transferred; + VasEBoot_uint64_t command_table_base; + VasEBoot_uint32_t unused[4]; }; -struct grub_ahci_prdt_entry +struct VasEBoot_ahci_prdt_entry { - grub_uint64_t data_base; - grub_uint32_t unused; - grub_uint32_t size; + VasEBoot_uint64_t data_base; + VasEBoot_uint32_t unused; + VasEBoot_uint32_t size; }; -struct grub_ahci_cmd_table +struct VasEBoot_ahci_cmd_table { - grub_uint8_t cfis[0x40]; - grub_uint8_t command[0x10]; - grub_uint8_t reserved[0x30]; - struct grub_ahci_prdt_entry prdt[1]; + VasEBoot_uint8_t cfis[0x40]; + VasEBoot_uint8_t command[0x10]; + VasEBoot_uint8_t reserved[0x30]; + struct VasEBoot_ahci_prdt_entry prdt[1]; }; -struct grub_ahci_hba_port +struct VasEBoot_ahci_hba_port { - grub_uint64_t command_list_base; - grub_uint64_t fis_base; - grub_uint32_t intstatus; - grub_uint32_t inten; - grub_uint32_t command; - grub_uint32_t unused1; - grub_uint32_t task_file_data; - grub_uint32_t sig; - grub_uint32_t status; - grub_uint32_t unused2; - grub_uint32_t sata_error; - grub_uint32_t sata_active; - grub_uint32_t command_issue; - grub_uint32_t unused3; - grub_uint32_t fbs; - grub_uint32_t unused4[15]; + VasEBoot_uint64_t command_list_base; + VasEBoot_uint64_t fis_base; + VasEBoot_uint32_t intstatus; + VasEBoot_uint32_t inten; + VasEBoot_uint32_t command; + VasEBoot_uint32_t unused1; + VasEBoot_uint32_t task_file_data; + VasEBoot_uint32_t sig; + VasEBoot_uint32_t status; + VasEBoot_uint32_t unused2; + VasEBoot_uint32_t sata_error; + VasEBoot_uint32_t sata_active; + VasEBoot_uint32_t command_issue; + VasEBoot_uint32_t unused3; + VasEBoot_uint32_t fbs; + VasEBoot_uint32_t unused4[15]; }; -enum grub_ahci_hba_port_command +enum VasEBoot_ahci_hba_port_command { - GRUB_AHCI_HBA_PORT_CMD_ST = 0x01, - GRUB_AHCI_HBA_PORT_CMD_SPIN_UP = 0x02, - GRUB_AHCI_HBA_PORT_CMD_POWER_ON = 0x04, - GRUB_AHCI_HBA_PORT_CMD_FRE = 0x10, - GRUB_AHCI_HBA_PORT_CMD_CR = 0x8000, - GRUB_AHCI_HBA_PORT_CMD_FR = 0x4000, + VasEBoot_AHCI_HBA_PORT_CMD_ST = 0x01, + VasEBoot_AHCI_HBA_PORT_CMD_SPIN_UP = 0x02, + VasEBoot_AHCI_HBA_PORT_CMD_POWER_ON = 0x04, + VasEBoot_AHCI_HBA_PORT_CMD_FRE = 0x10, + VasEBoot_AHCI_HBA_PORT_CMD_CR = 0x8000, + VasEBoot_AHCI_HBA_PORT_CMD_FR = 0x4000, }; -struct grub_ahci_hba +struct VasEBoot_ahci_hba { - grub_uint32_t cap; - grub_uint32_t global_control; - grub_uint32_t intr_status; - grub_uint32_t ports_implemented; - grub_uint32_t unused1[6]; - grub_uint32_t bios_handoff; - grub_uint32_t unused2[53]; - struct grub_ahci_hba_port ports[32]; + VasEBoot_uint32_t cap; + VasEBoot_uint32_t global_control; + VasEBoot_uint32_t intr_status; + VasEBoot_uint32_t ports_implemented; + VasEBoot_uint32_t unused1[6]; + VasEBoot_uint32_t bios_handoff; + VasEBoot_uint32_t unused2[53]; + struct VasEBoot_ahci_hba_port ports[32]; }; -struct grub_ahci_received_fis +struct VasEBoot_ahci_received_fis { char raw[4096]; }; enum { - GRUB_AHCI_HBA_CAP_NPORTS_MASK = 0x1f + VasEBoot_AHCI_HBA_CAP_NPORTS_MASK = 0x1f }; enum { - GRUB_AHCI_HBA_GLOBAL_CONTROL_RESET = 0x00000001, - GRUB_AHCI_HBA_GLOBAL_CONTROL_INTR_EN = 0x00000002, - GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN = 0x80000000, + VasEBoot_AHCI_HBA_GLOBAL_CONTROL_RESET = 0x00000001, + VasEBoot_AHCI_HBA_GLOBAL_CONTROL_INTR_EN = 0x00000002, + VasEBoot_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN = 0x80000000, }; enum { - GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED = 1, - GRUB_AHCI_BIOS_HANDOFF_OS_OWNED = 2, - GRUB_AHCI_BIOS_HANDOFF_OS_OWNERSHIP_CHANGED = 8, - GRUB_AHCI_BIOS_HANDOFF_RWC = 8 + VasEBoot_AHCI_BIOS_HANDOFF_BIOS_OWNED = 1, + VasEBoot_AHCI_BIOS_HANDOFF_OS_OWNED = 2, + VasEBoot_AHCI_BIOS_HANDOFF_OS_OWNERSHIP_CHANGED = 8, + VasEBoot_AHCI_BIOS_HANDOFF_RWC = 8 }; -struct grub_ahci_device +struct VasEBoot_ahci_device { - struct grub_ahci_device *next; - struct grub_ahci_device **prev; - volatile struct grub_ahci_hba *hba; + struct VasEBoot_ahci_device *next; + struct VasEBoot_ahci_device **prev; + volatile struct VasEBoot_ahci_hba *hba; int port; int num; - struct grub_pci_dma_chunk *command_list_chunk; - volatile struct grub_ahci_cmd_head *command_list; - struct grub_pci_dma_chunk *command_table_chunk; - volatile struct grub_ahci_cmd_table *command_table; - struct grub_pci_dma_chunk *rfis; + struct VasEBoot_pci_dma_chunk *command_list_chunk; + volatile struct VasEBoot_ahci_cmd_head *command_list; + struct VasEBoot_pci_dma_chunk *command_table_chunk; + volatile struct VasEBoot_ahci_cmd_table *command_table; + struct VasEBoot_pci_dma_chunk *rfis; int present; int atapi; }; -static grub_err_t -grub_ahci_readwrite_real (struct grub_ahci_device *dev, - struct grub_disk_ata_pass_through_parms *parms, +static VasEBoot_err_t +VasEBoot_ahci_readwrite_real (struct VasEBoot_ahci_device *dev, + struct VasEBoot_disk_ata_pass_through_parms *parms, int spinup, int reset); enum { - GRUB_AHCI_CONFIG_READ = 0, - GRUB_AHCI_CONFIG_CFIS_LENGTH_MASK = 0x1f, - GRUB_AHCI_CONFIG_ATAPI = 0x20, - GRUB_AHCI_CONFIG_WRITE = 0x40, - GRUB_AHCI_CONFIG_PREFETCH = 0x80, - GRUB_AHCI_CONFIG_RESET = 0x100, - GRUB_AHCI_CONFIG_BIST = 0x200, - GRUB_AHCI_CONFIG_CLEAR_R_OK = 0x400, - GRUB_AHCI_CONFIG_PMP_MASK = 0xf000, - GRUB_AHCI_CONFIG_PRDT_LENGTH_MASK = 0xffff0000, + VasEBoot_AHCI_CONFIG_READ = 0, + VasEBoot_AHCI_CONFIG_CFIS_LENGTH_MASK = 0x1f, + VasEBoot_AHCI_CONFIG_ATAPI = 0x20, + VasEBoot_AHCI_CONFIG_WRITE = 0x40, + VasEBoot_AHCI_CONFIG_PREFETCH = 0x80, + VasEBoot_AHCI_CONFIG_RESET = 0x100, + VasEBoot_AHCI_CONFIG_BIST = 0x200, + VasEBoot_AHCI_CONFIG_CLEAR_R_OK = 0x400, + VasEBoot_AHCI_CONFIG_PMP_MASK = 0xf000, + VasEBoot_AHCI_CONFIG_PRDT_LENGTH_MASK = 0xffff0000, }; -#define GRUB_AHCI_CONFIG_CFIS_LENGTH_SHIFT 0 -#define GRUB_AHCI_CONFIG_PMP_SHIFT 12 -#define GRUB_AHCI_CONFIG_PRDT_LENGTH_SHIFT 16 -#define GRUB_AHCI_INTERRUPT_ON_COMPLETE 0x80000000 +#define VasEBoot_AHCI_CONFIG_CFIS_LENGTH_SHIFT 0 +#define VasEBoot_AHCI_CONFIG_PMP_SHIFT 12 +#define VasEBoot_AHCI_CONFIG_PRDT_LENGTH_SHIFT 16 +#define VasEBoot_AHCI_INTERRUPT_ON_COMPLETE 0x80000000 -#define GRUB_AHCI_PRDT_MAX_CHUNK_LENGTH 0x200000 +#define VasEBoot_AHCI_PRDT_MAX_CHUNK_LENGTH 0x200000 -static struct grub_ahci_device *grub_ahci_devices; +static struct VasEBoot_ahci_device *VasEBoot_ahci_devices; static int numdevs; static int -grub_ahci_pciinit (grub_pci_device_t dev, - grub_pci_id_t pciid __attribute__ ((unused)), +VasEBoot_ahci_pciinit (VasEBoot_pci_device_t dev, + VasEBoot_pci_id_t pciid __attribute__ ((unused)), void *data __attribute__ ((unused))) { - grub_pci_address_t addr; - grub_uint32_t class; - grub_uint32_t bar; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; + VasEBoot_uint32_t bar; unsigned i, nports; - volatile struct grub_ahci_hba *hba; + volatile struct VasEBoot_ahci_hba *hba; /* Read class. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); /* Check if this class ID matches that of a PCI IDE Controller. */ if (class >> 8 != 0x010601) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG5); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG5); - bar = grub_pci_read (addr); + bar = VasEBoot_pci_read (addr); - if ((bar & (GRUB_PCI_ADDR_SPACE_MASK | GRUB_PCI_ADDR_MEM_TYPE_MASK - | GRUB_PCI_ADDR_MEM_PREFETCH)) - != (GRUB_PCI_ADDR_SPACE_MEMORY | GRUB_PCI_ADDR_MEM_TYPE_32)) + if ((bar & (VasEBoot_PCI_ADDR_SPACE_MASK | VasEBoot_PCI_ADDR_MEM_TYPE_MASK + | VasEBoot_PCI_ADDR_MEM_PREFETCH)) + != (VasEBoot_PCI_ADDR_SPACE_MEMORY | VasEBoot_PCI_ADDR_MEM_TYPE_32)) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word (addr, grub_pci_read_word (addr) - | GRUB_PCI_COMMAND_MEM_ENABLED | GRUB_PCI_COMMAND_BUS_MASTER); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word (addr, VasEBoot_pci_read_word (addr) + | VasEBoot_PCI_COMMAND_MEM_ENABLED | VasEBoot_PCI_COMMAND_BUS_MASTER); - hba = grub_pci_device_map_range (dev, bar & GRUB_PCI_ADDR_MEM_MASK, + hba = VasEBoot_pci_device_map_range (dev, bar & VasEBoot_PCI_ADDR_MEM_MASK, sizeof (*hba)); - grub_dprintf ("ahci", "dev: %x:%x.%x\n", dev.bus, dev.device, dev.function); + VasEBoot_dprintf ("ahci", "dev: %x:%x.%x\n", dev.bus, dev.device, dev.function); - grub_dprintf ("ahci", "tfd[0]: %x\n", + VasEBoot_dprintf ("ahci", "tfd[0]: %x\n", hba->ports[0].task_file_data); - grub_dprintf ("ahci", "cmd[0]: %x\n", + VasEBoot_dprintf ("ahci", "cmd[0]: %x\n", hba->ports[0].command); - grub_dprintf ("ahci", "st[0]: %x\n", + VasEBoot_dprintf ("ahci", "st[0]: %x\n", hba->ports[0].status); - grub_dprintf ("ahci", "err[0]: %x\n", + VasEBoot_dprintf ("ahci", "err[0]: %x\n", hba->ports[0].sata_error); - grub_dprintf ("ahci", "tfd[1]: %x\n", + VasEBoot_dprintf ("ahci", "tfd[1]: %x\n", hba->ports[1].task_file_data); - grub_dprintf ("ahci", "cmd[1]: %x\n", + VasEBoot_dprintf ("ahci", "cmd[1]: %x\n", hba->ports[1].command); - grub_dprintf ("ahci", "st[1]: %x\n", + VasEBoot_dprintf ("ahci", "st[1]: %x\n", hba->ports[1].status); - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); hba->ports[1].sata_error = hba->ports[1].sata_error; - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); - grub_dprintf ("ahci", "BH:%x\n", hba->bios_handoff); + VasEBoot_dprintf ("ahci", "BH:%x\n", hba->bios_handoff); - if (! (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_OS_OWNED)) + if (! (hba->bios_handoff & VasEBoot_AHCI_BIOS_HANDOFF_OS_OWNED)) { - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; - grub_dprintf ("ahci", "Requesting AHCI ownership\n"); - hba->bios_handoff = (hba->bios_handoff & ~GRUB_AHCI_BIOS_HANDOFF_RWC) - | GRUB_AHCI_BIOS_HANDOFF_OS_OWNED; - grub_dprintf ("ahci", "Waiting for BIOS to give up ownership\n"); - endtime = grub_get_time_ms () + 1000; - while ((hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED) - && grub_get_time_ms () < endtime); - if (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED) + VasEBoot_dprintf ("ahci", "Requesting AHCI ownership\n"); + hba->bios_handoff = (hba->bios_handoff & ~VasEBoot_AHCI_BIOS_HANDOFF_RWC) + | VasEBoot_AHCI_BIOS_HANDOFF_OS_OWNED; + VasEBoot_dprintf ("ahci", "Waiting for BIOS to give up ownership\n"); + endtime = VasEBoot_get_time_ms () + 1000; + while ((hba->bios_handoff & VasEBoot_AHCI_BIOS_HANDOFF_BIOS_OWNED) + && VasEBoot_get_time_ms () < endtime); + if (hba->bios_handoff & VasEBoot_AHCI_BIOS_HANDOFF_BIOS_OWNED) { - grub_dprintf ("ahci", "Forcibly taking ownership\n"); - hba->bios_handoff = GRUB_AHCI_BIOS_HANDOFF_OS_OWNED; - hba->bios_handoff |= GRUB_AHCI_BIOS_HANDOFF_OS_OWNERSHIP_CHANGED; + VasEBoot_dprintf ("ahci", "Forcibly taking ownership\n"); + hba->bios_handoff = VasEBoot_AHCI_BIOS_HANDOFF_OS_OWNED; + hba->bios_handoff |= VasEBoot_AHCI_BIOS_HANDOFF_OS_OWNERSHIP_CHANGED; } else - grub_dprintf ("ahci", "AHCI ownership obtained\n"); + VasEBoot_dprintf ("ahci", "AHCI ownership obtained\n"); } else - grub_dprintf ("ahci", "AHCI is already in OS mode\n"); + VasEBoot_dprintf ("ahci", "AHCI is already in OS mode\n"); - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + VasEBoot_dprintf ("ahci", "GLC:%x\n", hba->global_control); - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); - if (!(hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN)) - grub_dprintf ("ahci", "AHCI is in compat mode. Switching\n"); + if (!(hba->global_control & VasEBoot_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN)) + VasEBoot_dprintf ("ahci", "AHCI is in compat mode. Switching\n"); else - grub_dprintf ("ahci", "AHCI is in AHCI mode.\n"); + VasEBoot_dprintf ("ahci", "AHCI is in AHCI mode.\n"); - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + VasEBoot_dprintf ("ahci", "GLC:%x\n", hba->global_control); /* { - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; hba->global_control |= 1; - endtime = grub_get_time_ms () + 1000; + endtime = VasEBoot_get_time_ms () + 1000; while (hba->global_control & 1) - if (grub_get_time_ms () > endtime) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't reset AHCI\n"); + VasEBoot_dprintf ("ahci", "couldn't reset AHCI\n"); return 0; } }*/ - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + VasEBoot_dprintf ("ahci", "GLC:%x\n", hba->global_control); - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); for (i = 0; i < 5; i++) { - hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN; - grub_millisleep (1); - if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN) + hba->global_control |= VasEBoot_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN; + VasEBoot_millisleep (1); + if (hba->global_control & VasEBoot_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN) break; } if (i == 5) { - grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n"); + VasEBoot_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n"); return 0; } - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + VasEBoot_dprintf ("ahci", "GLC:%x\n", hba->global_control); - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + VasEBoot_dprintf ("ahci", "GLC:%x\n", hba->global_control); for (i = 0; i < 5; i++) { - hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN; - grub_millisleep (1); - if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN) + hba->global_control |= VasEBoot_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN; + VasEBoot_millisleep (1); + if (hba->global_control & VasEBoot_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN) break; } if (i == 5) { - grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n"); + VasEBoot_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n"); return 0; } - grub_dprintf ("ahci", "err[1]: %x\n", + VasEBoot_dprintf ("ahci", "err[1]: %x\n", hba->ports[1].sata_error); - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + VasEBoot_dprintf ("ahci", "GLC:%x\n", hba->global_control); - nports = (GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1; + nports = (VasEBoot_AHCI_HBA_CAP_NPORTS_MASK) + 1; - grub_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports, + VasEBoot_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports, hba->ports_implemented); - struct grub_ahci_device *adevs[GRUB_AHCI_HBA_CAP_NPORTS_MASK + 1]; - struct grub_ahci_device *failed_adevs[GRUB_AHCI_HBA_CAP_NPORTS_MASK + 1]; - grub_uint32_t fr_running = 0; + struct VasEBoot_ahci_device *adevs[VasEBoot_AHCI_HBA_CAP_NPORTS_MASK + 1]; + struct VasEBoot_ahci_device *failed_adevs[VasEBoot_AHCI_HBA_CAP_NPORTS_MASK + 1]; + VasEBoot_uint32_t fr_running = 0; for (i = 0; i < nports; i++) failed_adevs[i] = 0; @@ -341,7 +341,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, continue; } - adevs[i] = grub_zalloc (sizeof (*adevs[i])); + adevs[i] = VasEBoot_zalloc (sizeof (*adevs[i])); if (!adevs[i]) return 1; @@ -355,81 +355,81 @@ grub_ahci_pciinit (grub_pci_device_t dev, if (adevs[i]) { adevs[i]->hba->ports[adevs[i]->port].sata_error = adevs[i]->hba->ports[adevs[i]->port].sata_error; - grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); - adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head) * 32); + adevs[i]->command_list_chunk = VasEBoot_memalign_dma32 (1024, sizeof (struct VasEBoot_ahci_cmd_head) * 32); if (!adevs[i]->command_list_chunk) { adevs[i] = 0; continue; } - adevs[i]->command_table_chunk = grub_memalign_dma32 (1024, - sizeof (struct grub_ahci_cmd_table)); + adevs[i]->command_table_chunk = VasEBoot_memalign_dma32 (1024, + sizeof (struct VasEBoot_ahci_cmd_table)); if (!adevs[i]->command_table_chunk) { - grub_dma_free (adevs[i]->command_list_chunk); + VasEBoot_dma_free (adevs[i]->command_list_chunk); adevs[i] = 0; continue; } - adevs[i]->command_list = grub_dma_get_virt (adevs[i]->command_list_chunk); - adevs[i]->command_table = grub_dma_get_virt (adevs[i]->command_table_chunk); + adevs[i]->command_list = VasEBoot_dma_get_virt (adevs[i]->command_list_chunk); + adevs[i]->command_table = VasEBoot_dma_get_virt (adevs[i]->command_table_chunk); - grub_memset ((void *) adevs[i]->command_list, 0, - sizeof (struct grub_ahci_cmd_table)); - grub_memset ((void *) adevs[i]->command_table, 0, - sizeof (struct grub_ahci_cmd_head) * 32); + VasEBoot_memset ((void *) adevs[i]->command_list, 0, + sizeof (struct VasEBoot_ahci_cmd_table)); + VasEBoot_memset ((void *) adevs[i]->command_table, 0, + sizeof (struct VasEBoot_ahci_cmd_head) * 32); adevs[i]->command_list->command_table_base - = grub_dma_get_phys (adevs[i]->command_table_chunk); + = VasEBoot_dma_get_phys (adevs[i]->command_table_chunk); - grub_dprintf ("ahci", "found device ahci%d (port %d), command_table = %p, command_list = %p\n", - adevs[i]->num, adevs[i]->port, grub_dma_get_virt (adevs[i]->command_table_chunk), - grub_dma_get_virt (adevs[i]->command_list_chunk)); + VasEBoot_dprintf ("ahci", "found device ahci%d (port %d), command_table = %p, command_list = %p\n", + adevs[i]->num, adevs[i]->port, VasEBoot_dma_get_virt (adevs[i]->command_table_chunk), + VasEBoot_dma_get_virt (adevs[i]->command_list_chunk)); - adevs[i]->hba->ports[adevs[i]->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; + adevs[i]->hba->ports[adevs[i]->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; } - grub_uint64_t endtime; - endtime = grub_get_time_ms () + 1000; + VasEBoot_uint64_t endtime; + endtime = VasEBoot_get_time_ms () + 1000; - while (grub_get_time_ms () < endtime) + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) - if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) + if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) break; if (i == nports) break; } for (i = 0; i < nports; i++) - if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) + if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) { - grub_dprintf ("ahci", "couldn't stop FR on port %d\n", i); + VasEBoot_dprintf ("ahci", "couldn't stop FR on port %d\n", i); failed_adevs[i] = adevs[i]; adevs[i] = 0; } for (i = 0; i < nports; i++) if (adevs[i]) - adevs[i]->hba->ports[adevs[i]->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST; - endtime = grub_get_time_ms () + 1000; + adevs[i]->hba->ports[adevs[i]->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_ST; + endtime = VasEBoot_get_time_ms () + 1000; - while (grub_get_time_ms () < endtime) + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) - if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) + if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) break; if (i == nports) break; } for (i = 0; i < nports; i++) - if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) + if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) { - grub_dprintf ("ahci", "couldn't stop CR on port %d\n", i); + VasEBoot_dprintf ("ahci", "couldn't stop CR on port %d\n", i); failed_adevs[i] = adevs[i]; adevs[i] = 0; } @@ -440,39 +440,39 @@ grub_ahci_pciinit (grub_pci_device_t dev, adevs[i]->hba->ports[adevs[i]->port].intstatus = ~0; // adevs[i]->hba->ports[adevs[i]->port].fbs = 0; - grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); - adevs[i]->rfis = grub_memalign_dma32 (4096, - sizeof (struct grub_ahci_received_fis)); - grub_memset ((char *) grub_dma_get_virt (adevs[i]->rfis), 0, - sizeof (struct grub_ahci_received_fis)); - grub_memset ((char *) grub_dma_get_virt (adevs[i]->command_list_chunk), 0, - sizeof (struct grub_ahci_cmd_head)); - grub_memset ((char *) grub_dma_get_virt (adevs[i]->command_table_chunk), 0, - sizeof (struct grub_ahci_cmd_table)); - adevs[i]->hba->ports[adevs[i]->port].fis_base = grub_dma_get_phys (adevs[i]->rfis); + adevs[i]->rfis = VasEBoot_memalign_dma32 (4096, + sizeof (struct VasEBoot_ahci_received_fis)); + VasEBoot_memset ((char *) VasEBoot_dma_get_virt (adevs[i]->rfis), 0, + sizeof (struct VasEBoot_ahci_received_fis)); + VasEBoot_memset ((char *) VasEBoot_dma_get_virt (adevs[i]->command_list_chunk), 0, + sizeof (struct VasEBoot_ahci_cmd_head)); + VasEBoot_memset ((char *) VasEBoot_dma_get_virt (adevs[i]->command_table_chunk), 0, + sizeof (struct VasEBoot_ahci_cmd_table)); + adevs[i]->hba->ports[adevs[i]->port].fis_base = VasEBoot_dma_get_phys (adevs[i]->rfis); adevs[i]->hba->ports[adevs[i]->port].command_list_base - = grub_dma_get_phys (adevs[i]->command_list_chunk); + = VasEBoot_dma_get_phys (adevs[i]->command_list_chunk); adevs[i]->hba->ports[adevs[i]->port].command_issue = 0; - adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_FRE; + adevs[i]->hba->ports[adevs[i]->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_FRE; } - endtime = grub_get_time_ms () + 1000; + endtime = VasEBoot_get_time_ms () + 1000; - while (grub_get_time_ms () < endtime) + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) - if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) + if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) break; if (i == nports) break; } for (i = 0; i < nports; i++) - if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) + if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) { - grub_dprintf ("ahci", "couldn't start FR on port %d\n", i); + VasEBoot_dprintf ("ahci", "couldn't start FR on port %d\n", i); failed_adevs[i] = adevs[i]; adevs[i] = 0; } @@ -480,22 +480,22 @@ grub_ahci_pciinit (grub_pci_device_t dev, for (i = 0; i < nports; i++) if (adevs[i]) { - grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); fr_running |= (1 << i); - adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_SPIN_UP; - adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_POWER_ON; + adevs[i]->hba->ports[adevs[i]->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_SPIN_UP; + adevs[i]->hba->ports[adevs[i]->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_POWER_ON; adevs[i]->hba->ports[adevs[i]->port].command |= 1 << 28; - grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); } /* 10ms should actually be enough. */ - endtime = grub_get_time_ms () + 100; + endtime = VasEBoot_get_time_ms () + 100; - while (grub_get_time_ms () < endtime) + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].status & 7) != 3) @@ -507,7 +507,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, for (i = 0; i < nports; i++) if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].status & 7) != 3) { - grub_dprintf ("ahci", "couldn't detect device on port %d\n", i); + VasEBoot_dprintf ("ahci", "couldn't detect device on port %d\n", i); failed_adevs[i] = adevs[i]; adevs[i] = 0; } @@ -515,26 +515,26 @@ grub_ahci_pciinit (grub_pci_device_t dev, for (i = 0; i < nports; i++) if (adevs[i]) { - grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); - adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_POWER_ON; - adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_SPIN_UP; + adevs[i]->hba->ports[adevs[i]->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_POWER_ON; + adevs[i]->hba->ports[adevs[i]->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_SPIN_UP; - grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); adevs[i]->hba->ports[adevs[i]->port].sata_error = ~0; - grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); - grub_dprintf ("ahci", "port %d, offset: %x, tfd:%x, CMD: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port %d, offset: %x, tfd:%x, CMD: %x\n", adevs[i]->port, (int) ((char *) &adevs[i]->hba->ports[adevs[i]->port].task_file_data - (char *) adevs[i]->hba), adevs[i]->hba->ports[adevs[i]->port].task_file_data, adevs[i]->hba->ports[adevs[i]->port].command); - grub_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); } @@ -542,79 +542,79 @@ grub_ahci_pciinit (grub_pci_device_t dev, for (i = 0; i < nports; i++) if (adevs[i]) { - grub_dprintf ("ahci", "port %d, offset: %x, tfd:%x, CMD: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port %d, offset: %x, tfd:%x, CMD: %x\n", adevs[i]->port, (int) ((char *) &adevs[i]->hba->ports[adevs[i]->port].task_file_data - (char *) adevs[i]->hba), adevs[i]->hba->ports[adevs[i]->port].task_file_data, adevs[i]->hba->ports[adevs[i]->port].command); - grub_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, + VasEBoot_dprintf ("ahci", "port: %d, err: %x\n", adevs[i]->port, adevs[i]->hba->ports[adevs[i]->port].sata_error); adevs[i]->hba->ports[adevs[i]->port].command = (adevs[i]->hba->ports[adevs[i]->port].command & 0x0fffffff) | (1 << 28) - | GRUB_AHCI_HBA_PORT_CMD_SPIN_UP - | GRUB_AHCI_HBA_PORT_CMD_POWER_ON; + | VasEBoot_AHCI_HBA_PORT_CMD_SPIN_UP + | VasEBoot_AHCI_HBA_PORT_CMD_POWER_ON; - /* struct grub_disk_ata_pass_through_parms parms2; - grub_memset (&parms2, 0, sizeof (parms2)); + /* struct VasEBoot_disk_ata_pass_through_parms parms2; + VasEBoot_memset (&parms2, 0, sizeof (parms2)); parms2.taskfile.cmd = 8; - grub_ahci_readwrite_real (dev, &parms2, 1, 1);*/ + VasEBoot_ahci_readwrite_real (dev, &parms2, 1, 1);*/ } - endtime = grub_get_time_ms () + 10000; + endtime = VasEBoot_get_time_ms () + 10000; - while (grub_get_time_ms () < endtime) + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) - if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ))) + if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (VasEBoot_ATA_STATUS_BUSY | VasEBoot_ATA_STATUS_DRQ))) break; if (i == nports) break; } for (i = 0; i < nports; i++) - if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ))) + if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & (VasEBoot_ATA_STATUS_BUSY | VasEBoot_ATA_STATUS_DRQ))) { - grub_dprintf ("ahci", "port %d is busy\n", i); + VasEBoot_dprintf ("ahci", "port %d is busy\n", i); failed_adevs[i] = adevs[i]; adevs[i] = 0; } for (i = 0; i < nports; i++) if (adevs[i]) - adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST; + adevs[i]->hba->ports[adevs[i]->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_ST; - endtime = grub_get_time_ms () + 1000; + endtime = VasEBoot_get_time_ms () + 1000; - while (grub_get_time_ms () < endtime) + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) - if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) + if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) break; if (i == nports) break; } for (i = 0; i < nports; i++) - if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) + if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) { - grub_dprintf ("ahci", "couldn't start CR on port %d\n", i); + VasEBoot_dprintf ("ahci", "couldn't start CR on port %d\n", i); failed_adevs[i] = adevs[i]; adevs[i] = 0; } - grub_dprintf ("ahci", "cleaning up failed devs\n"); + VasEBoot_dprintf ("ahci", "cleaning up failed devs\n"); for (i = 0; i < nports; i++) if (failed_adevs[i] && (fr_running & (1 << i))) - failed_adevs[i]->hba->ports[failed_adevs[i]->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; + failed_adevs[i]->hba->ports[failed_adevs[i]->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; - endtime = grub_get_time_ms () + 1000; - while (grub_get_time_ms () < endtime) + endtime = VasEBoot_get_time_ms () + 1000; + while (VasEBoot_get_time_ms () < endtime) { for (i = 0; i < nports; i++) - if (failed_adevs[i] && (fr_running & (1 << i)) && (failed_adevs[i]->hba->ports[failed_adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) + if (failed_adevs[i] && (fr_running & (1 << i)) && (failed_adevs[i]->hba->ports[failed_adevs[i]->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) break; if (i == nports) break; @@ -622,134 +622,134 @@ grub_ahci_pciinit (grub_pci_device_t dev, for (i = 0; i < nports; i++) if (failed_adevs[i]) { - grub_dma_free (failed_adevs[i]->command_list_chunk); - grub_dma_free (failed_adevs[i]->command_table_chunk); - grub_dma_free (failed_adevs[i]->rfis); + VasEBoot_dma_free (failed_adevs[i]->command_list_chunk); + VasEBoot_dma_free (failed_adevs[i]->command_table_chunk); + VasEBoot_dma_free (failed_adevs[i]->rfis); } for (i = 0; i < nports; i++) if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].sig >> 16) == 0xeb14) adevs[i]->atapi = 1; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word (addr, grub_pci_read_word (addr) - | GRUB_PCI_COMMAND_BUS_MASTER); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word (addr, VasEBoot_pci_read_word (addr) + | VasEBoot_PCI_COMMAND_BUS_MASTER); for (i = 0; i < nports; i++) if (adevs[i]) { - grub_list_push (GRUB_AS_LIST_P (&grub_ahci_devices), - GRUB_AS_LIST (adevs[i])); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_ahci_devices), + VasEBoot_AS_LIST (adevs[i])); } return 0; } -static grub_err_t -grub_ahci_initialize (void) +static VasEBoot_err_t +VasEBoot_ahci_initialize (void) { - grub_pci_iterate (grub_ahci_pciinit, NULL); - return grub_errno; + VasEBoot_pci_iterate (VasEBoot_ahci_pciinit, NULL); + return VasEBoot_errno; } -static grub_err_t -grub_ahci_fini_hw (int noreturn __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_ahci_fini_hw (int noreturn __attribute__ ((unused))) { - struct grub_ahci_device *dev; + struct VasEBoot_ahci_device *dev; - for (dev = grub_ahci_devices; dev; dev = dev->next) + for (dev = VasEBoot_ahci_devices; dev; dev = dev->next) { - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; - endtime = grub_get_time_ms () + 1000; - while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; + endtime = VasEBoot_get_time_ms () + 1000; + while ((dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop FR\n"); + VasEBoot_dprintf ("ahci", "couldn't stop FR\n"); break; } - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST; - endtime = grub_get_time_ms () + 1000; - while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_ST; + endtime = VasEBoot_get_time_ms () + 1000; + while ((dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop CR\n"); + VasEBoot_dprintf ("ahci", "couldn't stop CR\n"); break; } - grub_dma_free (dev->command_list_chunk); - grub_dma_free (dev->command_table_chunk); - grub_dma_free (dev->rfis); + VasEBoot_dma_free (dev->command_list_chunk); + VasEBoot_dma_free (dev->command_table_chunk); + VasEBoot_dma_free (dev->rfis); dev->command_list_chunk = NULL; dev->command_table_chunk = NULL; dev->rfis = NULL; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -reinit_port (struct grub_ahci_device *dev) +reinit_port (struct VasEBoot_ahci_device *dev) { - struct grub_pci_dma_chunk *command_list; - struct grub_pci_dma_chunk *command_table; - grub_uint64_t endtime; + struct VasEBoot_pci_dma_chunk *command_list; + struct VasEBoot_pci_dma_chunk *command_table; + VasEBoot_uint64_t endtime; - command_list = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head)); + command_list = VasEBoot_memalign_dma32 (1024, sizeof (struct VasEBoot_ahci_cmd_head)); if (!command_list) return 1; - command_table = grub_memalign_dma32 (1024, - sizeof (struct grub_ahci_cmd_table)); + command_table = VasEBoot_memalign_dma32 (1024, + sizeof (struct VasEBoot_ahci_cmd_table)); if (!command_table) { - grub_dma_free (command_list); + VasEBoot_dma_free (command_list); return 1; } - grub_dprintf ("ahci", "found device ahci%d (port %d)\n", dev->num, dev->port); + VasEBoot_dprintf ("ahci", "found device ahci%d (port %d)\n", dev->num, dev->port); - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; - endtime = grub_get_time_ms () + 1000; - while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; + endtime = VasEBoot_get_time_ms () + 1000; + while ((dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop FR\n"); + VasEBoot_dprintf ("ahci", "couldn't stop FR\n"); goto out; } - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST; - endtime = grub_get_time_ms () + 1000; - while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_ST; + endtime = VasEBoot_get_time_ms () + 1000; + while ((dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop CR\n"); + VasEBoot_dprintf ("ahci", "couldn't stop CR\n"); goto out; } dev->hba->ports[dev->port].fbs = 2; - dev->rfis = grub_memalign_dma32 (4096, - sizeof (struct grub_ahci_received_fis)); - grub_memset ((char *) grub_dma_get_virt (dev->rfis), 0, - sizeof (struct grub_ahci_received_fis)); - dev->hba->ports[dev->port].fis_base = grub_dma_get_phys (dev->rfis); + dev->rfis = VasEBoot_memalign_dma32 (4096, + sizeof (struct VasEBoot_ahci_received_fis)); + VasEBoot_memset ((char *) VasEBoot_dma_get_virt (dev->rfis), 0, + sizeof (struct VasEBoot_ahci_received_fis)); + dev->hba->ports[dev->port].fis_base = VasEBoot_dma_get_phys (dev->rfis); dev->hba->ports[dev->port].command_list_base - = grub_dma_get_phys (command_list); - dev->hba->ports[dev->port].command |= GRUB_AHCI_HBA_PORT_CMD_FRE; - while (!(dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) - if (grub_get_time_ms () > endtime) + = VasEBoot_dma_get_phys (command_list); + dev->hba->ports[dev->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_FRE; + while (!(dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't start FR\n"); - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; + VasEBoot_dprintf ("ahci", "couldn't start FR\n"); + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; goto out; } - dev->hba->ports[dev->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST; - while (!(dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_ST; + while (!(dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't start CR\n"); - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_CR; + VasEBoot_dprintf ("ahci", "couldn't start CR\n"); + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_CR; goto out_stop_fr; } @@ -757,59 +757,59 @@ reinit_port (struct grub_ahci_device *dev) = (dev->hba->ports[dev->port].command & 0x0fffffff) | (1 << 28) | 2 | 4; dev->command_list_chunk = command_list; - dev->command_list = grub_dma_get_virt (command_list); + dev->command_list = VasEBoot_dma_get_virt (command_list); dev->command_table_chunk = command_table; - dev->command_table = grub_dma_get_virt (command_table); + dev->command_table = VasEBoot_dma_get_virt (command_table); dev->command_list->command_table_base - = grub_dma_get_phys (command_table); + = VasEBoot_dma_get_phys (command_table); return 0; out_stop_fr: - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; - endtime = grub_get_time_ms () + 1000; - while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_FR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; + endtime = VasEBoot_get_time_ms () + 1000; + while ((dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_FR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop FR\n"); + VasEBoot_dprintf ("ahci", "couldn't stop FR\n"); break; } out: - grub_dma_free (command_list); - grub_dma_free (command_table); - grub_dma_free (dev->rfis); + VasEBoot_dma_free (command_list); + VasEBoot_dma_free (command_table); + VasEBoot_dma_free (dev->rfis); return 1; } -static grub_err_t -grub_ahci_restore_hw (void) +static VasEBoot_err_t +VasEBoot_ahci_restore_hw (void) { - struct grub_ahci_device **pdev; + struct VasEBoot_ahci_device **pdev; - for (pdev = &grub_ahci_devices; *pdev; pdev = &((*pdev)->next)) + for (pdev = &VasEBoot_ahci_devices; *pdev; pdev = &((*pdev)->next)) if (reinit_port (*pdev)) { - struct grub_ahci_device *odev; + struct VasEBoot_ahci_device *odev; odev = *pdev; *pdev = (*pdev)->next; - grub_free (odev); + VasEBoot_free (odev); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -grub_ahci_iterate (grub_ata_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_ahci_iterate (VasEBoot_ata_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_ahci_device *dev; + struct VasEBoot_ahci_device *dev; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; - FOR_LIST_ELEMENTS(dev, grub_ahci_devices) - if (hook (GRUB_SCSI_SUBSYSTEM_AHCI, dev->num, hook_data)) + FOR_LIST_ELEMENTS(dev, VasEBoot_ahci_devices) + if (hook (VasEBoot_SCSI_SUBSYSTEM_AHCI, dev->num, hook_data)) return 1; return 0; @@ -817,7 +817,7 @@ grub_ahci_iterate (grub_ata_dev_iterate_hook_t hook, void *hook_data, #if 0 static int -find_free_cmd_slot (struct grub_ahci_device *dev) +find_free_cmd_slot (struct VasEBoot_ahci_device *dev) { int i; for (i = 0; i < 32; i++) @@ -834,7 +834,7 @@ find_free_cmd_slot (struct grub_ahci_device *dev) enum { - GRUB_AHCI_FIS_REG_H2D = 0x27 + VasEBoot_AHCI_FIS_REG_H2D = 0x27 }; static const int register_map[11] = { 3 /* Features */, @@ -849,297 +849,297 @@ static const int register_map[11] = { 3 /* Features */, 9 /* LBA48 mid */, 10 /* LBA48 high */ }; -static grub_err_t -grub_ahci_reset_port (struct grub_ahci_device *dev, int force) +static VasEBoot_err_t +VasEBoot_ahci_reset_port (struct VasEBoot_ahci_device *dev, int force) { - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; dev->hba->ports[dev->port].sata_error = dev->hba->ports[dev->port].sata_error; if (force || (dev->hba->ports[dev->port].command_issue & 1) || (dev->hba->ports[dev->port].task_file_data & 0x80)) { - struct grub_disk_ata_pass_through_parms parms2; - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST; + struct VasEBoot_disk_ata_pass_through_parms parms2; + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_ST; dev->hba->ports[dev->port].command_issue = 0; dev->command_list[0].config = 0; dev->command_table[0].prdt[0].unused = 0; dev->command_table[0].prdt[0].size = 0; dev->command_table[0].prdt[0].data_base = 0; - endtime = grub_get_time_ms () + 1000; - while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) - if (grub_get_time_ms () > endtime) + endtime = VasEBoot_get_time_ms () + 1000; + while ((dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop CR"); - return grub_error (GRUB_ERR_IO, "couldn't stop CR"); + VasEBoot_dprintf ("ahci", "couldn't stop CR"); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't stop CR"); } dev->hba->ports[dev->port].command |= 8; while (dev->hba->ports[dev->port].command & 8) - if (grub_get_time_ms () > endtime) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't set CLO\n"); - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE; - return grub_error (GRUB_ERR_IO, "couldn't set CLO"); + VasEBoot_dprintf ("ahci", "couldn't set CLO\n"); + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_FRE; + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't set CLO"); } - dev->hba->ports[dev->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST; - while (!(dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) - if (grub_get_time_ms () > endtime) + dev->hba->ports[dev->port].command |= VasEBoot_AHCI_HBA_PORT_CMD_ST; + while (!(dev->hba->ports[dev->port].command & VasEBoot_AHCI_HBA_PORT_CMD_CR)) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "couldn't stop CR"); - dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST; - return grub_error (GRUB_ERR_IO, "couldn't stop CR"); + VasEBoot_dprintf ("ahci", "couldn't stop CR"); + dev->hba->ports[dev->port].command &= ~VasEBoot_AHCI_HBA_PORT_CMD_ST; + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't stop CR"); } dev->hba->ports[dev->port].sata_error = dev->hba->ports[dev->port].sata_error; - grub_memset (&parms2, 0, sizeof (parms2)); + VasEBoot_memset (&parms2, 0, sizeof (parms2)); parms2.taskfile.cmd = 8; - return grub_ahci_readwrite_real (dev, &parms2, 1, 1); + return VasEBoot_ahci_readwrite_real (dev, &parms2, 1, 1); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_ahci_readwrite_real (struct grub_ahci_device *dev, - struct grub_disk_ata_pass_through_parms *parms, +static VasEBoot_err_t +VasEBoot_ahci_readwrite_real (struct VasEBoot_ahci_device *dev, + struct VasEBoot_disk_ata_pass_through_parms *parms, int spinup, int reset) { - struct grub_pci_dma_chunk *bufc; - grub_uint64_t endtime; + struct VasEBoot_pci_dma_chunk *bufc; + VasEBoot_uint64_t endtime; unsigned i; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); if (!reset) - grub_ahci_reset_port (dev, 0); + VasEBoot_ahci_reset_port (dev, 0); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); dev->hba->ports[dev->port].task_file_data = 0; dev->hba->ports[dev->port].command_issue = 0; - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); dev->hba->ports[dev->port].sata_error = dev->hba->ports[dev->port].sata_error; - grub_dprintf("ahci", "grub_ahci_read (size=%llu, cmdsize = %llu)\n", + VasEBoot_dprintf("ahci", "VasEBoot_ahci_read (size=%llu, cmdsize = %llu)\n", (unsigned long long) parms->size, (unsigned long long) parms->cmdsize); if (parms->cmdsize != 0 && parms->cmdsize != 12 && parms->cmdsize != 16) - return grub_error (GRUB_ERR_BUG, "incorrect ATAPI command size"); + return VasEBoot_error (VasEBoot_ERR_BUG, "incorrect ATAPI command size"); - if (parms->size > GRUB_AHCI_PRDT_MAX_CHUNK_LENGTH) - return grub_error (GRUB_ERR_BUG, "too big data buffer"); + if (parms->size > VasEBoot_AHCI_PRDT_MAX_CHUNK_LENGTH) + return VasEBoot_error (VasEBoot_ERR_BUG, "too big data buffer"); if (parms->size) - bufc = grub_memalign_dma32 (1024, parms->size + (parms->size & 1)); + bufc = VasEBoot_memalign_dma32 (1024, parms->size + (parms->size & 1)); else - bufc = grub_memalign_dma32 (1024, 512); + bufc = VasEBoot_memalign_dma32 (1024, 512); - grub_dprintf ("ahci", "AHCI tfd = %x, CL=%p\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x, CL=%p\n", dev->hba->ports[dev->port].task_file_data, dev->command_list); /* FIXME: support port multipliers. */ dev->command_list[0].config - = (5 << GRUB_AHCI_CONFIG_CFIS_LENGTH_SHIFT) - // | GRUB_AHCI_CONFIG_CLEAR_R_OK - | (0 << GRUB_AHCI_CONFIG_PMP_SHIFT) - | ((parms->size ? 1 : 0) << GRUB_AHCI_CONFIG_PRDT_LENGTH_SHIFT) - | (parms->cmdsize ? GRUB_AHCI_CONFIG_ATAPI : 0) - | (parms->write ? GRUB_AHCI_CONFIG_WRITE : GRUB_AHCI_CONFIG_READ) + = (5 << VasEBoot_AHCI_CONFIG_CFIS_LENGTH_SHIFT) + // | VasEBoot_AHCI_CONFIG_CLEAR_R_OK + | (0 << VasEBoot_AHCI_CONFIG_PMP_SHIFT) + | ((parms->size ? 1 : 0) << VasEBoot_AHCI_CONFIG_PRDT_LENGTH_SHIFT) + | (parms->cmdsize ? VasEBoot_AHCI_CONFIG_ATAPI : 0) + | (parms->write ? VasEBoot_AHCI_CONFIG_WRITE : VasEBoot_AHCI_CONFIG_READ) | (parms->taskfile.cmd == 8 ? (1 << 8) : 0); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); dev->command_list[0].transferred = 0; dev->command_list[0].command_table_base - = grub_dma_get_phys (dev->command_table_chunk); + = VasEBoot_dma_get_phys (dev->command_table_chunk); - grub_memset ((char *) dev->command_list[0].unused, 0, + VasEBoot_memset ((char *) dev->command_list[0].unused, 0, sizeof (dev->command_list[0].unused)); - grub_memset ((char *) &dev->command_table[0], 0, + VasEBoot_memset ((char *) &dev->command_table[0], 0, sizeof (dev->command_table[0])); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); if (parms->cmdsize) - grub_memcpy ((char *) dev->command_table[0].command, parms->cmd, + VasEBoot_memcpy ((char *) dev->command_table[0].command, parms->cmd, parms->cmdsize); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); - dev->command_table[0].cfis[0] = GRUB_AHCI_FIS_REG_H2D; + dev->command_table[0].cfis[0] = VasEBoot_AHCI_FIS_REG_H2D; dev->command_table[0].cfis[1] = 0x80; for (i = 0; i < sizeof (parms->taskfile.raw); i++) dev->command_table[0].cfis[register_map[i]] = parms->taskfile.raw[i]; - grub_dprintf ("ahci", "cfis: %02x %02x %02x %02x %02x %02x %02x %02x\n", + VasEBoot_dprintf ("ahci", "cfis: %02x %02x %02x %02x %02x %02x %02x %02x\n", dev->command_table[0].cfis[0], dev->command_table[0].cfis[1], dev->command_table[0].cfis[2], dev->command_table[0].cfis[3], dev->command_table[0].cfis[4], dev->command_table[0].cfis[5], dev->command_table[0].cfis[6], dev->command_table[0].cfis[7]); - grub_dprintf ("ahci", "cfis: %02x %02x %02x %02x %02x %02x %02x %02x\n", + VasEBoot_dprintf ("ahci", "cfis: %02x %02x %02x %02x %02x %02x %02x %02x\n", dev->command_table[0].cfis[8], dev->command_table[0].cfis[9], dev->command_table[0].cfis[10], dev->command_table[0].cfis[11], dev->command_table[0].cfis[12], dev->command_table[0].cfis[13], dev->command_table[0].cfis[14], dev->command_table[0].cfis[15]); - dev->command_table[0].prdt[0].data_base = grub_dma_get_phys (bufc); + dev->command_table[0].prdt[0].data_base = VasEBoot_dma_get_phys (bufc); dev->command_table[0].prdt[0].unused = 0; dev->command_table[0].prdt[0].size = (parms->size - 1); - grub_dprintf ("ahci", "PRDT = %" PRIxGRUB_UINT64_T ", %x, %x (%" - PRIuGRUB_SIZE ")\n", + VasEBoot_dprintf ("ahci", "PRDT = %" PRIxVasEBoot_UINT64_T ", %x, %x (%" + PRIuVasEBoot_SIZE ")\n", dev->command_table[0].prdt[0].data_base, dev->command_table[0].prdt[0].unused, dev->command_table[0].prdt[0].size, - (grub_size_t) ((char *) &dev->command_table[0].prdt[0] + (VasEBoot_size_t) ((char *) &dev->command_table[0].prdt[0] - (char *) &dev->command_table[0])); if (parms->write) - grub_memcpy ((char *) grub_dma_get_virt (bufc), parms->buffer, parms->size); + VasEBoot_memcpy ((char *) VasEBoot_dma_get_virt (bufc), parms->buffer, parms->size); - grub_dprintf ("ahci", "AHCI command scheduled\n"); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI command scheduled\n"); + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); - grub_dprintf ("ahci", "AHCI inten = %x\n", + VasEBoot_dprintf ("ahci", "AHCI inten = %x\n", dev->hba->ports[dev->port].inten); - grub_dprintf ("ahci", "AHCI intstatus = %x\n", + VasEBoot_dprintf ("ahci", "AHCI intstatus = %x\n", dev->hba->ports[dev->port].intstatus); dev->hba->ports[dev->port].inten = 0xffffffff;//(1 << 2) | (1 << 5); dev->hba->ports[dev->port].intstatus = 0xffffffff;//(1 << 2) | (1 << 5); - grub_dprintf ("ahci", "AHCI inten = %x\n", + VasEBoot_dprintf ("ahci", "AHCI inten = %x\n", dev->hba->ports[dev->port].inten); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); dev->hba->ports[dev->port].sata_active = 1; dev->hba->ports[dev->port].command_issue = 1; - grub_dprintf ("ahci", "AHCI sig = %x\n", dev->hba->ports[dev->port].sig); - grub_dprintf ("ahci", "AHCI tfd = %x\n", + VasEBoot_dprintf ("ahci", "AHCI sig = %x\n", dev->hba->ports[dev->port].sig); + VasEBoot_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); - endtime = grub_get_time_ms () + (spinup ? 20000 : 20000); + endtime = VasEBoot_get_time_ms () + (spinup ? 20000 : 20000); while ((dev->hba->ports[dev->port].command_issue & 1)) - if (grub_get_time_ms () > endtime) + if (VasEBoot_get_time_ms () > endtime) { - grub_dprintf ("ahci", "AHCI status <%x %x %x %x>\n", + VasEBoot_dprintf ("ahci", "AHCI status <%x %x %x %x>\n", dev->hba->ports[dev->port].command_issue, dev->hba->ports[dev->port].sata_active, dev->hba->ports[dev->port].intstatus, dev->hba->ports[dev->port].task_file_data); dev->hba->ports[dev->port].command_issue = 0; - err = grub_error (GRUB_ERR_IO, "AHCI transfer timed out"); + err = VasEBoot_error (VasEBoot_ERR_IO, "AHCI transfer timed out"); if (!reset) - grub_ahci_reset_port (dev, 1); + VasEBoot_ahci_reset_port (dev, 1); break; } - grub_dprintf ("ahci", "AHCI command completed <%x %x %x %x %x, %x %x>\n", + VasEBoot_dprintf ("ahci", "AHCI command completed <%x %x %x %x %x, %x %x>\n", dev->hba->ports[dev->port].command_issue, dev->hba->ports[dev->port].intstatus, dev->hba->ports[dev->port].task_file_data, dev->command_list[0].transferred, dev->hba->ports[dev->port].sata_error, - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x00], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x18]); - grub_dprintf ("ahci", + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x00], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x18]); + VasEBoot_dprintf ("ahci", "last PIO FIS %08x %08x %08x %08x %08x %08x %08x %08x\n", - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x08], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x09], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x0a], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x0b], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x0c], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x0d], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x0e], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x0f]); - grub_dprintf ("ahci", + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x08], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x09], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x0a], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x0b], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x0c], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x0d], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x0e], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x0f]); + VasEBoot_dprintf ("ahci", "last REG FIS %08x %08x %08x %08x %08x %08x %08x %08x\n", - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x10], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x11], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x12], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x13], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x14], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x15], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x16], - ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x17]); + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x10], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x11], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x12], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x13], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x14], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x15], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x16], + ((VasEBoot_uint32_t *) VasEBoot_dma_get_virt (dev->rfis))[0x17]); if (!parms->write) - grub_memcpy (parms->buffer, (char *) grub_dma_get_virt (bufc), parms->size); - grub_dma_free (bufc); + VasEBoot_memcpy (parms->buffer, (char *) VasEBoot_dma_get_virt (bufc), parms->size); + VasEBoot_dma_free (bufc); return err; } -static grub_err_t -grub_ahci_readwrite (grub_ata_t disk, - struct grub_disk_ata_pass_through_parms *parms, +static VasEBoot_err_t +VasEBoot_ahci_readwrite (VasEBoot_ata_t disk, + struct VasEBoot_disk_ata_pass_through_parms *parms, int spinup) { - return grub_ahci_readwrite_real (disk->data, parms, spinup, 0); + return VasEBoot_ahci_readwrite_real (disk->data, parms, spinup, 0); } -static grub_err_t -grub_ahci_open (int id, int devnum, struct grub_ata *ata) +static VasEBoot_err_t +VasEBoot_ahci_open (int id, int devnum, struct VasEBoot_ata *ata) { - struct grub_ahci_device *dev; + struct VasEBoot_ahci_device *dev; - if (id != GRUB_SCSI_SUBSYSTEM_AHCI) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an AHCI device"); + if (id != VasEBoot_SCSI_SUBSYSTEM_AHCI) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not an AHCI device"); - FOR_LIST_ELEMENTS(dev, grub_ahci_devices) + FOR_LIST_ELEMENTS(dev, VasEBoot_ahci_devices) if (dev->num == devnum) break; if (! dev) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such AHCI device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such AHCI device"); - grub_dprintf ("ahci", "opening AHCI dev `ahci%d'\n", dev->num); + VasEBoot_dprintf ("ahci", "opening AHCI dev `ahci%d'\n", dev->num); ata->data = dev; ata->dma = 1; ata->atapi = dev->atapi; - ata->maxbuffer = GRUB_AHCI_PRDT_MAX_CHUNK_LENGTH; + ata->maxbuffer = VasEBoot_AHCI_PRDT_MAX_CHUNK_LENGTH; ata->present = &dev->present; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_ata_dev grub_ahci_dev = +static struct VasEBoot_ata_dev VasEBoot_ahci_dev = { - .iterate = grub_ahci_iterate, - .open = grub_ahci_open, - .readwrite = grub_ahci_readwrite, + .iterate = VasEBoot_ahci_iterate, + .open = VasEBoot_ahci_open, + .readwrite = VasEBoot_ahci_readwrite, }; -static struct grub_preboot *fini_hnd; +static struct VasEBoot_preboot *fini_hnd; -GRUB_MOD_INIT(ahci) +VasEBoot_MOD_INIT(ahci) { - grub_stop_disk_firmware (); + VasEBoot_stop_disk_firmware (); /* AHCI initialization. */ - grub_ahci_initialize (); + VasEBoot_ahci_initialize (); /* AHCI devices are handled by scsi.mod. */ - grub_ata_dev_register (&grub_ahci_dev); + VasEBoot_ata_dev_register (&VasEBoot_ahci_dev); - fini_hnd = grub_loader_register_preboot_hook (grub_ahci_fini_hw, - grub_ahci_restore_hw, - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); + fini_hnd = VasEBoot_loader_register_preboot_hook (VasEBoot_ahci_fini_hw, + VasEBoot_ahci_restore_hw, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_DISK); } -GRUB_MOD_FINI(ahci) +VasEBoot_MOD_FINI(ahci) { - grub_ahci_fini_hw (0); - grub_loader_unregister_preboot_hook (fini_hnd); + VasEBoot_ahci_fini_hw (0); + VasEBoot_loader_unregister_preboot_hook (fini_hnd); - grub_ata_dev_unregister (&grub_ahci_dev); + VasEBoot_ata_dev_unregister (&VasEBoot_ahci_dev); } diff --git a/VasEBoot-core/disk/arc/arcdisk.c b/VasEBoot-core/disk/arc/arcdisk.c index 0cc1993e5..b78b73a1a 100644 --- a/VasEBoot-core/disk/arc/arcdisk.c +++ b/VasEBoot-core/disk/arc/arcdisk.c @@ -1,29 +1,29 @@ /* ofdisk.c - Open Firmware disk access. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2006,2007,2008,2009,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -static grub_arc_fileno_t last_handle = 0; +static VasEBoot_arc_fileno_t last_handle = 0; static char *last_path = NULL; static int handle_writable = 0; @@ -55,7 +55,7 @@ arcdisk_hash_find (const char *devpath) while (p) { - if (!grub_strcmp (p->devpath, devpath)) + if (!VasEBoot_strcmp (p->devpath, devpath)) break; p = p->next; } @@ -68,7 +68,7 @@ arcdisk_hash_add (char *devpath) struct arcdisk_hash_ent *p; struct arcdisk_hash_ent **head = &arcdisk_hash[arcdisk_hash_fn(devpath)]; - p = grub_malloc (sizeof (*p)); + p = VasEBoot_malloc (sizeof (*p)); if (!p) return NULL; @@ -80,171 +80,171 @@ arcdisk_hash_add (char *devpath) } -/* Context for grub_arcdisk_iterate. */ -struct grub_arcdisk_iterate_ctx +/* Context for VasEBoot_arcdisk_iterate. */ +struct VasEBoot_arcdisk_iterate_ctx { - grub_disk_dev_iterate_hook_t hook; + VasEBoot_disk_dev_iterate_hook_t hook; void *hook_data; }; -/* Helper for grub_arcdisk_iterate. */ +/* Helper for VasEBoot_arcdisk_iterate. */ static int -grub_arcdisk_iterate_iter (const char *name, - const struct grub_arc_component *comp, void *data) +VasEBoot_arcdisk_iterate_iter (const char *name, + const struct VasEBoot_arc_component *comp, void *data) { - struct grub_arcdisk_iterate_ctx *ctx = data; + struct VasEBoot_arcdisk_iterate_ctx *ctx = data; - if (!(comp->type == GRUB_ARC_COMPONENT_TYPE_DISK - || comp->type == GRUB_ARC_COMPONENT_TYPE_FLOPPY - || comp->type == GRUB_ARC_COMPONENT_TYPE_TAPE)) + if (!(comp->type == VasEBoot_ARC_COMPONENT_TYPE_DISK + || comp->type == VasEBoot_ARC_COMPONENT_TYPE_FLOPPY + || comp->type == VasEBoot_ARC_COMPONENT_TYPE_TAPE)) return 0; return ctx->hook (name, ctx->hook_data); } static int -grub_arcdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_arcdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_arcdisk_iterate_ctx ctx = { hook, hook_data }; + struct VasEBoot_arcdisk_iterate_ctx ctx = { hook, hook_data }; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; - return grub_arc_iterate_devs (grub_arcdisk_iterate_iter, &ctx, 1); + return VasEBoot_arc_iterate_devs (VasEBoot_arcdisk_iterate_iter, &ctx, 1); } -#ifdef GRUB_CPU_MIPSEL +#ifdef VasEBoot_CPU_MIPSEL #define RAW_SUFFIX "partition(0)" #else #define RAW_SUFFIX "partition(10)" #endif -static grub_err_t +static VasEBoot_err_t reopen (const char *name, int writable) { - grub_arc_fileno_t handle; + VasEBoot_arc_fileno_t handle; - if (last_path && grub_strcmp (last_path, name) == 0 + if (last_path && VasEBoot_strcmp (last_path, name) == 0 && (!writable || handle_writable)) { - grub_dprintf ("arcdisk", "using already opened %s\n", name); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("arcdisk", "using already opened %s\n", name); + return VasEBoot_ERR_NONE; } if (last_path) { - GRUB_ARC_FIRMWARE_VECTOR->close (last_handle); - grub_free (last_path); + VasEBoot_ARC_FIRMWARE_VECTOR->close (last_handle); + VasEBoot_free (last_path); last_path = NULL; last_handle = 0; handle_writable = 0; } - if (GRUB_ARC_FIRMWARE_VECTOR->open (name, - writable ? GRUB_ARC_FILE_ACCESS_OPEN_RW - : GRUB_ARC_FILE_ACCESS_OPEN_RO, &handle)) + if (VasEBoot_ARC_FIRMWARE_VECTOR->open (name, + writable ? VasEBoot_ARC_FILE_ACCESS_OPEN_RW + : VasEBoot_ARC_FILE_ACCESS_OPEN_RO, &handle)) { - grub_dprintf ("arcdisk", "couldn't open %s\n", name); - return grub_error (GRUB_ERR_IO, "couldn't open %s", name); + VasEBoot_dprintf ("arcdisk", "couldn't open %s\n", name); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't open %s", name); } handle_writable = writable; - last_path = grub_strdup (name); + last_path = VasEBoot_strdup (name); if (!last_path) - return grub_errno; + return VasEBoot_errno; last_handle = handle; - grub_dprintf ("arcdisk", "opened %s\n", name); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("arcdisk", "opened %s\n", name); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_arcdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_arcdisk_open (const char *name, VasEBoot_disk_t disk) { char *fullname; - grub_err_t err; - grub_arc_err_t r; - struct grub_arc_fileinfo info; + VasEBoot_err_t err; + VasEBoot_arc_err_t r; + struct VasEBoot_arc_fileinfo info; struct arcdisk_hash_ent *hash; - if (grub_memcmp (name, "arc/", 4) != 0) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not arc device"); - fullname = grub_arc_alt_name_to_norm (name, RAW_SUFFIX); + if (VasEBoot_memcmp (name, "arc/", 4) != 0) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not arc device"); + fullname = VasEBoot_arc_alt_name_to_norm (name, RAW_SUFFIX); disk->data = fullname; - grub_dprintf ("arcdisk", "opening %s\n", fullname); + VasEBoot_dprintf ("arcdisk", "opening %s\n", fullname); hash = arcdisk_hash_find (fullname); if (!hash) hash = arcdisk_hash_add (fullname); if (!hash) - return grub_errno; + return VasEBoot_errno; err = reopen (fullname, 0); if (err) return err; - r = GRUB_ARC_FIRMWARE_VECTOR->getfileinformation (last_handle, &info); + r = VasEBoot_ARC_FIRMWARE_VECTOR->getfileinformation (last_handle, &info); if (r) { - grub_uint64_t res = 0; + VasEBoot_uint64_t res = 0; int i; - grub_dprintf ("arcdisk", "couldn't retrieve size: %ld\n", r); + VasEBoot_dprintf ("arcdisk", "couldn't retrieve size: %ld\n", r); for (i = 40; i >= 9; i--) { - grub_uint64_t pos = res | (1ULL << i); + VasEBoot_uint64_t pos = res | (1ULL << i); char buf[512]; long unsigned count = 0; - grub_dprintf ("arcdisk", - "seek to 0x%" PRIxGRUB_UINT64_T "\n", pos); - if (GRUB_ARC_FIRMWARE_VECTOR->seek (last_handle, &pos, 0)) + VasEBoot_dprintf ("arcdisk", + "seek to 0x%" PRIxVasEBoot_UINT64_T "\n", pos); + if (VasEBoot_ARC_FIRMWARE_VECTOR->seek (last_handle, &pos, 0)) continue; - if (GRUB_ARC_FIRMWARE_VECTOR->read (last_handle, buf, + if (VasEBoot_ARC_FIRMWARE_VECTOR->read (last_handle, buf, 0x200, &count)) continue; if (count == 0) continue; res |= (1ULL << i); } - grub_dprintf ("arcdisk", - "determined disk size 0x%" PRIxGRUB_UINT64_T "\n", res); + VasEBoot_dprintf ("arcdisk", + "determined disk size 0x%" PRIxVasEBoot_UINT64_T "\n", res); disk->total_sectors = (res + 0x200) >> 9; } else disk->total_sectors = (info.end >> 9); disk->id = hash->num; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_arcdisk_close (grub_disk_t disk) +VasEBoot_arcdisk_close (VasEBoot_disk_t disk) { - grub_free (disk->data); + VasEBoot_free (disk->data); } -static grub_err_t -grub_arcdisk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_arcdisk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_err_t err; - grub_uint64_t pos = sector << 9; + VasEBoot_err_t err; + VasEBoot_uint64_t pos = sector << 9; unsigned long count; - grub_uint64_t totl = size << 9; - grub_arc_err_t r; + VasEBoot_uint64_t totl = size << 9; + VasEBoot_arc_err_t r; err = reopen (disk->data, 0); if (err) return err; - r = GRUB_ARC_FIRMWARE_VECTOR->seek (last_handle, &pos, 0); + r = VasEBoot_ARC_FIRMWARE_VECTOR->seek (last_handle, &pos, 0); if (r) { - grub_dprintf ("arcdisk", "seek to 0x%" PRIxGRUB_UINT64_T " failed: %ld\n", + VasEBoot_dprintf ("arcdisk", "seek to 0x%" PRIxVasEBoot_UINT64_T " failed: %ld\n", pos, r); - return grub_error (GRUB_ERR_IO, "couldn't seek"); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't seek"); } while (totl) { - if (GRUB_ARC_FIRMWARE_VECTOR->read (last_handle, buf, + if (VasEBoot_ARC_FIRMWARE_VECTOR->read (last_handle, buf, totl, &count)) - return grub_error (GRUB_ERR_READ_ERROR, + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("failure reading sector 0x%llx " "from `%s'"), (unsigned long long) sector, @@ -253,35 +253,35 @@ grub_arcdisk_read (grub_disk_t disk, grub_disk_addr_t sector, buf += count; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_arcdisk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_arcdisk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_err_t err; - grub_uint64_t pos = sector << 9; + VasEBoot_err_t err; + VasEBoot_uint64_t pos = sector << 9; unsigned long count; - grub_uint64_t totl = size << 9; - grub_arc_err_t r; + VasEBoot_uint64_t totl = size << 9; + VasEBoot_arc_err_t r; err = reopen (disk->data, 1); if (err) return err; - r = GRUB_ARC_FIRMWARE_VECTOR->seek (last_handle, &pos, 0); + r = VasEBoot_ARC_FIRMWARE_VECTOR->seek (last_handle, &pos, 0); if (r) { - grub_dprintf ("arcdisk", "seek to 0x%" PRIxGRUB_UINT64_T " failed: %ld\n", + VasEBoot_dprintf ("arcdisk", "seek to 0x%" PRIxVasEBoot_UINT64_T " failed: %ld\n", pos, r); - return grub_error (GRUB_ERR_IO, "couldn't seek"); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't seek"); } while (totl) { - if (GRUB_ARC_FIRMWARE_VECTOR->write (last_handle, buf, + if (VasEBoot_ARC_FIRMWARE_VECTOR->write (last_handle, buf, totl, &count)) - return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " "to `%s'"), (unsigned long long) sector, disk->name); @@ -289,37 +289,37 @@ grub_arcdisk_write (grub_disk_t disk, grub_disk_addr_t sector, buf += count; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_disk_dev grub_arcdisk_dev = +static struct VasEBoot_disk_dev VasEBoot_arcdisk_dev = { .name = "arcdisk", - .id = GRUB_DISK_DEVICE_ARCDISK_ID, - .iterate = grub_arcdisk_iterate, - .open = grub_arcdisk_open, - .close = grub_arcdisk_close, - .read = grub_arcdisk_read, - .write = grub_arcdisk_write, + .id = VasEBoot_DISK_DEVICE_ARCDISK_ID, + .iterate = VasEBoot_arcdisk_iterate, + .open = VasEBoot_arcdisk_open, + .close = VasEBoot_arcdisk_close, + .read = VasEBoot_arcdisk_read, + .write = VasEBoot_arcdisk_write, .next = 0 }; void -grub_arcdisk_init (void) +VasEBoot_arcdisk_init (void) { - grub_disk_dev_register (&grub_arcdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_arcdisk_dev); } void -grub_arcdisk_fini (void) +VasEBoot_arcdisk_fini (void) { if (last_path) { - GRUB_ARC_FIRMWARE_VECTOR->close (last_handle); - grub_free (last_path); + VasEBoot_ARC_FIRMWARE_VECTOR->close (last_handle); + VasEBoot_free (last_path); last_path = NULL; last_handle = 0; } - grub_disk_dev_unregister (&grub_arcdisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_arcdisk_dev); } diff --git a/VasEBoot-core/disk/ata.c b/VasEBoot-core/disk/ata.c index 8ba4e5c50..b15dbd0e3 100644 --- a/VasEBoot-core/disk/ata.c +++ b/VasEBoot-core/disk/ata.c @@ -1,79 +1,79 @@ /* ata.c - ATA disk access. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_ata_dev_t grub_ata_dev_list; +static VasEBoot_ata_dev_t VasEBoot_ata_dev_list; /* Byteorder has to be changed before strings can be read. */ static void -grub_ata_strncpy (grub_uint16_t *dst16, grub_uint16_t *src16, grub_size_t len) +VasEBoot_ata_strncpy (VasEBoot_uint16_t *dst16, VasEBoot_uint16_t *src16, VasEBoot_size_t len) { unsigned int i; for (i = 0; i < len / 2; i++) - *(dst16++) = grub_swap_bytes16 (*(src16++)); + *(dst16++) = VasEBoot_swap_bytes16 (*(src16++)); *dst16 = 0; } static void -grub_ata_dumpinfo (struct grub_ata *dev, grub_uint16_t *info) +VasEBoot_ata_dumpinfo (struct VasEBoot_ata *dev, VasEBoot_uint16_t *info) { - grub_uint16_t text[21]; + VasEBoot_uint16_t text[21]; /* The device information was read, dump it for debugging. */ - grub_ata_strncpy (text, info + 10, 20); - grub_dprintf ("ata", "Serial: %s\n", (char *) text); - grub_ata_strncpy (text, info + 23, 8); - grub_dprintf ("ata", "Firmware: %s\n", (char *) text); - grub_ata_strncpy (text, info + 27, 40); - grub_dprintf ("ata", "Model: %s\n", (char *) text); + VasEBoot_ata_strncpy (text, info + 10, 20); + VasEBoot_dprintf ("ata", "Serial: %s\n", (char *) text); + VasEBoot_ata_strncpy (text, info + 23, 8); + VasEBoot_dprintf ("ata", "Firmware: %s\n", (char *) text); + VasEBoot_ata_strncpy (text, info + 27, 40); + VasEBoot_dprintf ("ata", "Model: %s\n", (char *) text); if (! dev->atapi) { - grub_dprintf ("ata", "Addressing: %d\n", dev->addr); - grub_dprintf ("ata", "Sectors: %lld\n", (unsigned long long) dev->size); - grub_dprintf ("ata", "Sector size: %u\n", 1U << dev->log_sector_size); + VasEBoot_dprintf ("ata", "Addressing: %d\n", dev->addr); + VasEBoot_dprintf ("ata", "Sectors: %lld\n", (unsigned long long) dev->size); + VasEBoot_dprintf ("ata", "Sector size: %u\n", 1U << dev->log_sector_size); } } -static grub_err_t -grub_atapi_identify (struct grub_ata *dev) +static VasEBoot_err_t +VasEBoot_atapi_identify (struct VasEBoot_ata *dev) { - struct grub_disk_ata_pass_through_parms parms; - grub_uint16_t *info; - grub_err_t err; + struct VasEBoot_disk_ata_pass_through_parms parms; + VasEBoot_uint16_t *info; + VasEBoot_err_t err; - info = grub_malloc (GRUB_DISK_SECTOR_SIZE); + info = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE); if (! info) - return grub_errno; + return VasEBoot_errno; - grub_memset (&parms, 0, sizeof (parms)); + VasEBoot_memset (&parms, 0, sizeof (parms)); parms.taskfile.disk = 0xE0; - parms.taskfile.cmd = GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE; - parms.size = GRUB_DISK_SECTOR_SIZE; + parms.taskfile.cmd = VasEBoot_ATA_CMD_IDENTIFY_PACKET_DEVICE; + parms.size = VasEBoot_DISK_SECTOR_SIZE; parms.buffer = info; err = dev->dev->readwrite (dev, &parms, *dev->present); @@ -83,71 +83,71 @@ grub_atapi_identify (struct grub_ata *dev) return err; } - if (parms.size != GRUB_DISK_SECTOR_SIZE) + if (parms.size != VasEBoot_DISK_SECTOR_SIZE) { *dev->present = 0; - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "device cannot be identified"); } dev->atapi = 1; - grub_ata_dumpinfo (dev, info); + VasEBoot_ata_dumpinfo (dev, info); - grub_free (info); + VasEBoot_free (info); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_ata_identify (struct grub_ata *dev) +static VasEBoot_err_t +VasEBoot_ata_identify (struct VasEBoot_ata *dev) { - struct grub_disk_ata_pass_through_parms parms; - grub_uint64_t *info64; - grub_uint32_t *info32; - grub_uint16_t *info16; - grub_err_t err; + struct VasEBoot_disk_ata_pass_through_parms parms; + VasEBoot_uint64_t *info64; + VasEBoot_uint32_t *info32; + VasEBoot_uint16_t *info16; + VasEBoot_err_t err; if (dev->atapi) - return grub_atapi_identify (dev); + return VasEBoot_atapi_identify (dev); - info64 = grub_malloc (GRUB_DISK_SECTOR_SIZE); - info32 = (grub_uint32_t *) info64; - info16 = (grub_uint16_t *) info64; + info64 = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE); + info32 = (VasEBoot_uint32_t *) info64; + info16 = (VasEBoot_uint16_t *) info64; if (! info16) - return grub_errno; + return VasEBoot_errno; - grub_memset (&parms, 0, sizeof (parms)); + VasEBoot_memset (&parms, 0, sizeof (parms)); parms.buffer = info16; - parms.size = GRUB_DISK_SECTOR_SIZE; + parms.size = VasEBoot_DISK_SECTOR_SIZE; parms.taskfile.disk = 0xE0; - parms.taskfile.cmd = GRUB_ATA_CMD_IDENTIFY_DEVICE; + parms.taskfile.cmd = VasEBoot_ATA_CMD_IDENTIFY_DEVICE; err = dev->dev->readwrite (dev, &parms, *dev->present); - if (err || parms.size != GRUB_DISK_SECTOR_SIZE) + if (err || parms.size != VasEBoot_DISK_SECTOR_SIZE) { - grub_uint8_t sts = parms.taskfile.status; - grub_free (info16); - grub_errno = GRUB_ERR_NONE; - if ((sts & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ - | GRUB_ATA_STATUS_ERR)) == GRUB_ATA_STATUS_ERR + VasEBoot_uint8_t sts = parms.taskfile.status; + VasEBoot_free (info16); + VasEBoot_errno = VasEBoot_ERR_NONE; + if ((sts & (VasEBoot_ATA_STATUS_BUSY | VasEBoot_ATA_STATUS_DRQ + | VasEBoot_ATA_STATUS_ERR)) == VasEBoot_ATA_STATUS_ERR && (parms.taskfile.error & 0x04 /* ABRT */)) /* Device without ATA IDENTIFY, try ATAPI. */ - return grub_atapi_identify (dev); + return VasEBoot_atapi_identify (dev); else if (sts == 0x00) { *dev->present = 0; /* No device, return error but don't print message. */ - return GRUB_ERR_UNKNOWN_DEVICE; + return VasEBoot_ERR_UNKNOWN_DEVICE; } else { *dev->present = 0; /* Other Error. */ - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "device cannot be identified"); } } @@ -156,28 +156,28 @@ grub_ata_identify (struct grub_ata *dev) dev->atapi = 0; /* CHS is always supported. */ - dev->addr = GRUB_ATA_CHS; + dev->addr = VasEBoot_ATA_CHS; /* Check if LBA is supported. */ - if (info16[49] & grub_cpu_to_le16_compile_time ((1 << 9))) + if (info16[49] & VasEBoot_cpu_to_le16_compile_time ((1 << 9))) { /* Check if LBA48 is supported. */ - if (info16[83] & grub_cpu_to_le16_compile_time ((1 << 10))) - dev->addr = GRUB_ATA_LBA48; + if (info16[83] & VasEBoot_cpu_to_le16_compile_time ((1 << 10))) + dev->addr = VasEBoot_ATA_LBA48; else - dev->addr = GRUB_ATA_LBA; + dev->addr = VasEBoot_ATA_LBA; } /* Determine the amount of sectors. */ - if (dev->addr != GRUB_ATA_LBA48) - dev->size = grub_le_to_cpu32 (info32[30]); + if (dev->addr != VasEBoot_ATA_LBA48) + dev->size = VasEBoot_le_to_cpu32 (info32[30]); else - dev->size = grub_le_to_cpu64 (info64[25]); + dev->size = VasEBoot_le_to_cpu64 (info64[25]); - if (info16[106] & grub_cpu_to_le16_compile_time ((1 << 12))) + if (info16[106] & VasEBoot_cpu_to_le16_compile_time ((1 << 12))) { - grub_uint32_t secsize; - secsize = grub_le_to_cpu32 (grub_get_unaligned32 (&info16[117])); + VasEBoot_uint32_t secsize; + secsize = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (&info16[117])); if (secsize & (secsize - 1) || !secsize || secsize > 1048576) secsize = 256; @@ -190,27 +190,27 @@ grub_ata_identify (struct grub_ata *dev) dev->log_sector_size = 9; /* Read CHS information. */ - dev->cylinders = grub_le_to_cpu16 (info16[1]); - dev->heads = grub_le_to_cpu16 (info16[3]); - dev->sectors_per_track = grub_le_to_cpu16 (info16[6]); + dev->cylinders = VasEBoot_le_to_cpu16 (info16[1]); + dev->heads = VasEBoot_le_to_cpu16 (info16[3]); + dev->sectors_per_track = VasEBoot_le_to_cpu16 (info16[6]); - grub_ata_dumpinfo (dev, info16); + VasEBoot_ata_dumpinfo (dev, info16); - grub_free (info16); + VasEBoot_free (info16); return 0; } -static grub_err_t -grub_ata_setaddress (struct grub_ata *dev, - struct grub_disk_ata_pass_through_parms *parms, - grub_disk_addr_t sector, - grub_size_t size, - grub_ata_addressing_t addressing) +static VasEBoot_err_t +VasEBoot_ata_setaddress (struct VasEBoot_ata *dev, + struct VasEBoot_disk_ata_pass_through_parms *parms, + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, + VasEBoot_ata_addressing_t addressing) { switch (addressing) { - case GRUB_ATA_CHS: + case VasEBoot_ATA_CHS: { unsigned int cylinder; unsigned int head; @@ -218,20 +218,20 @@ grub_ata_setaddress (struct grub_ata *dev, if (dev->sectors_per_track == 0 || dev->heads == 0) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "sector %d cannot be addressed " "using CHS addressing", sector); /* Calculate the sector, cylinder and head to use. */ - sect = ((grub_uint32_t) sector % dev->sectors_per_track) + 1; - cylinder = (((grub_uint32_t) sector / dev->sectors_per_track) + sect = ((VasEBoot_uint32_t) sector % dev->sectors_per_track) + 1; + cylinder = (((VasEBoot_uint32_t) sector / dev->sectors_per_track) / dev->heads); - head = ((grub_uint32_t) sector / dev->sectors_per_track) % dev->heads; + head = ((VasEBoot_uint32_t) sector / dev->sectors_per_track) % dev->heads; if (sect > dev->sectors_per_track || cylinder > dev->cylinders || head > dev->heads) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "sector %d cannot be addressed " "using CHS addressing", sector); @@ -243,7 +243,7 @@ grub_ata_setaddress (struct grub_ata *dev, break; } - case GRUB_ATA_LBA: + case VasEBoot_ATA_LBA: if (size == 256) size = 0; parms->taskfile.disk = 0xE0 | ((sector >> 24) & 0x0F); @@ -254,7 +254,7 @@ grub_ata_setaddress (struct grub_ata *dev, parms->taskfile.lba_high = (sector >> 16) & 0xFF; break; - case GRUB_ATA_LBA48: + case VasEBoot_ATA_LBA48: if (size == 65536) size = 0; @@ -275,68 +275,68 @@ grub_ata_setaddress (struct grub_ata *dev, break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf, int rw) +static VasEBoot_err_t +VasEBoot_ata_readwrite (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf, int rw) { - struct grub_ata *ata = disk->data; + struct VasEBoot_ata *ata = disk->data; - grub_ata_addressing_t addressing = ata->addr; - grub_size_t batch; + VasEBoot_ata_addressing_t addressing = ata->addr; + VasEBoot_size_t batch; int cmd, cmd_write; - grub_size_t nsectors = 0; + VasEBoot_size_t nsectors = 0; - grub_dprintf("ata", "grub_ata_readwrite (size=%llu, rw=%d)\n", + VasEBoot_dprintf("ata", "VasEBoot_ata_readwrite (size=%llu, rw=%d)\n", (unsigned long long) size, rw); - if (addressing == GRUB_ATA_LBA48 && ((sector + size) >> 28) != 0) + if (addressing == VasEBoot_ATA_LBA48 && ((sector + size) >> 28) != 0) { if (ata->dma) { - cmd = GRUB_ATA_CMD_READ_SECTORS_DMA_EXT; - cmd_write = GRUB_ATA_CMD_WRITE_SECTORS_DMA_EXT; + cmd = VasEBoot_ATA_CMD_READ_SECTORS_DMA_EXT; + cmd_write = VasEBoot_ATA_CMD_WRITE_SECTORS_DMA_EXT; } else { - cmd = GRUB_ATA_CMD_READ_SECTORS_EXT; - cmd_write = GRUB_ATA_CMD_WRITE_SECTORS_EXT; + cmd = VasEBoot_ATA_CMD_READ_SECTORS_EXT; + cmd_write = VasEBoot_ATA_CMD_WRITE_SECTORS_EXT; } } else { - if (addressing == GRUB_ATA_LBA48) - addressing = GRUB_ATA_LBA; + if (addressing == VasEBoot_ATA_LBA48) + addressing = VasEBoot_ATA_LBA; if (ata->dma) { - cmd = GRUB_ATA_CMD_READ_SECTORS_DMA; - cmd_write = GRUB_ATA_CMD_WRITE_SECTORS_DMA; + cmd = VasEBoot_ATA_CMD_READ_SECTORS_DMA; + cmd_write = VasEBoot_ATA_CMD_WRITE_SECTORS_DMA; } else { - cmd = GRUB_ATA_CMD_READ_SECTORS; - cmd_write = GRUB_ATA_CMD_WRITE_SECTORS; + cmd = VasEBoot_ATA_CMD_READ_SECTORS; + cmd_write = VasEBoot_ATA_CMD_WRITE_SECTORS; } } - if (addressing != GRUB_ATA_CHS) + if (addressing != VasEBoot_ATA_CHS) batch = 256; else batch = 1; while (nsectors < size) { - struct grub_disk_ata_pass_through_parms parms; - grub_err_t err; + struct VasEBoot_disk_ata_pass_through_parms parms; + VasEBoot_err_t err; if (size - nsectors < batch) batch = size - nsectors; - grub_dprintf("ata", "rw=%d, sector=%llu, batch=%llu\n", rw, (unsigned long long) sector, (unsigned long long) batch); - grub_memset (&parms, 0, sizeof (parms)); - grub_ata_setaddress (ata, &parms, sector, batch, addressing); + VasEBoot_dprintf("ata", "rw=%d, sector=%llu, batch=%llu\n", rw, (unsigned long long) sector, (unsigned long long) batch); + VasEBoot_memset (&parms, 0, sizeof (parms)); + VasEBoot_ata_setaddress (ata, &parms, sector, batch, addressing); parms.taskfile.cmd = (! rw ? cmd : cmd_write); parms.buffer = buf; parms.size = batch << ata->log_sector_size; @@ -348,135 +348,135 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, if (err) return err; if (parms.size != batch << ata->log_sector_size) - return grub_error (GRUB_ERR_READ_ERROR, "incomplete read"); + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "incomplete read"); buf += batch << ata->log_sector_size; sector += batch; nsectors += batch; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static inline void -grub_ata_real_close (struct grub_ata *ata) +VasEBoot_ata_real_close (struct VasEBoot_ata *ata) { if (ata->dev->close) ata->dev->close (ata); } -static struct grub_ata * -grub_ata_real_open (int id, int bus) +static struct VasEBoot_ata * +VasEBoot_ata_real_open (int id, int bus) { - struct grub_ata *ata; - grub_ata_dev_t p; + struct VasEBoot_ata *ata; + VasEBoot_ata_dev_t p; - ata = grub_zalloc (sizeof (*ata)); + ata = VasEBoot_zalloc (sizeof (*ata)); if (!ata) return NULL; - for (p = grub_ata_dev_list; p; p = p->next) + for (p = VasEBoot_ata_dev_list; p; p = p->next) { - grub_err_t err; + VasEBoot_err_t err; if (p->open (id, bus, ata)) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } ata->dev = p; /* Use the IDENTIFY DEVICE command to query the device. */ - err = grub_ata_identify (ata); + err = VasEBoot_ata_identify (ata); if (err) { - if (!grub_errno) - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such ATA device"); - grub_free (ata); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such ATA device"); + VasEBoot_free (ata); return NULL; } return ata; } - grub_free (ata); - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such ATA device"); + VasEBoot_free (ata); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such ATA device"); return NULL; } -/* Context for grub_ata_iterate. */ -struct grub_ata_iterate_ctx +/* Context for VasEBoot_ata_iterate. */ +struct VasEBoot_ata_iterate_ctx { - grub_disk_dev_iterate_hook_t hook; + VasEBoot_disk_dev_iterate_hook_t hook; void *hook_data; }; -/* Helper for grub_ata_iterate. */ +/* Helper for VasEBoot_ata_iterate. */ static int -grub_ata_iterate_iter (int id, int bus, void *data) +VasEBoot_ata_iterate_iter (int id, int bus, void *data) { - struct grub_ata_iterate_ctx *ctx = data; - struct grub_ata *ata; + struct VasEBoot_ata_iterate_ctx *ctx = data; + struct VasEBoot_ata *ata; int ret; char devname[40]; - ata = grub_ata_real_open (id, bus); + ata = VasEBoot_ata_real_open (id, bus); if (!ata) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } if (ata->atapi) { - grub_ata_real_close (ata); + VasEBoot_ata_real_close (ata); return 0; } - grub_snprintf (devname, sizeof (devname), - "%s%d", grub_scsi_names[id], bus); + VasEBoot_snprintf (devname, sizeof (devname), + "%s%d", VasEBoot_scsi_names[id], bus); ret = ctx->hook (devname, ctx->hook_data); - grub_ata_real_close (ata); + VasEBoot_ata_real_close (ata); return ret; } static int -grub_ata_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_ata_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_ata_iterate_ctx ctx = { hook, hook_data }; - grub_ata_dev_t p; + struct VasEBoot_ata_iterate_ctx ctx = { hook, hook_data }; + VasEBoot_ata_dev_t p; - for (p = grub_ata_dev_list; p; p = p->next) - if (p->iterate && p->iterate (grub_ata_iterate_iter, &ctx, pull)) + for (p = VasEBoot_ata_dev_list; p; p = p->next) + if (p->iterate && p->iterate (VasEBoot_ata_iterate_iter, &ctx, pull)) return 1; return 0; } -static grub_err_t -grub_ata_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_ata_open (const char *name, VasEBoot_disk_t disk) { unsigned id, bus; - struct grub_ata *ata; + struct VasEBoot_ata *ata; - for (id = 0; id < GRUB_SCSI_NUM_SUBSYSTEMS; id++) - if (grub_strncmp (grub_scsi_names[id], name, - grub_strlen (grub_scsi_names[id])) == 0 - && grub_isdigit (name[grub_strlen (grub_scsi_names[id])])) + for (id = 0; id < VasEBoot_SCSI_NUM_SUBSYSTEMS; id++) + if (VasEBoot_strncmp (VasEBoot_scsi_names[id], name, + VasEBoot_strlen (VasEBoot_scsi_names[id])) == 0 + && VasEBoot_isdigit (name[VasEBoot_strlen (VasEBoot_scsi_names[id])])) break; - if (id == GRUB_SCSI_NUM_SUBSYSTEMS) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); - bus = grub_strtoul (name + grub_strlen (grub_scsi_names[id]), 0, 0); - ata = grub_ata_real_open (id, bus); + if (id == VasEBoot_SCSI_NUM_SUBSYSTEMS) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); + bus = VasEBoot_strtoul (name + VasEBoot_strlen (VasEBoot_scsi_names[id]), 0, 0); + ata = VasEBoot_ata_real_open (id, bus); if (!ata) - return grub_errno; + return VasEBoot_errno; if (ata->atapi) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); disk->total_sectors = ata->size; - disk->max_agglomerate = (ata->maxbuffer >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS)); - if (disk->max_agglomerate > (256U >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS - ata->log_sector_size))) - disk->max_agglomerate = (256U >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS - ata->log_sector_size)); + disk->max_agglomerate = (ata->maxbuffer >> (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS)); + if (disk->max_agglomerate > (256U >> (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS - ata->log_sector_size))) + disk->max_agglomerate = (256U >> (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS - ata->log_sector_size)); disk->log_sector_size = ata->log_sector_size; - disk->id = grub_make_scsi_id (id, bus, 0); + disk->id = VasEBoot_make_scsi_id (id, bus, 0); disk->data = ata; @@ -484,37 +484,37 @@ grub_ata_open (const char *name, grub_disk_t disk) } static void -grub_ata_close (grub_disk_t disk) +VasEBoot_ata_close (VasEBoot_disk_t disk) { - struct grub_ata *ata = disk->data; - grub_ata_real_close (ata); + struct VasEBoot_ata *ata = disk->data; + VasEBoot_ata_real_close (ata); } -static grub_err_t -grub_ata_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_ata_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - return grub_ata_readwrite (disk, sector, size, buf, 0); + return VasEBoot_ata_readwrite (disk, sector, size, buf, 0); } -static grub_err_t -grub_ata_write (grub_disk_t disk, - grub_disk_addr_t sector, - grub_size_t size, +static VasEBoot_err_t +VasEBoot_ata_write (VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - return grub_ata_readwrite (disk, sector, size, (char *) buf, 1); + return VasEBoot_ata_readwrite (disk, sector, size, (char *) buf, 1); } -static struct grub_disk_dev grub_atadisk_dev = +static struct VasEBoot_disk_dev VasEBoot_atadisk_dev = { .name = "ATA", - .id = GRUB_DISK_DEVICE_ATA_ID, - .iterate = grub_ata_iterate, - .open = grub_ata_open, - .close = grub_ata_close, - .read = grub_ata_read, - .write = grub_ata_write, + .id = VasEBoot_DISK_DEVICE_ATA_ID, + .iterate = VasEBoot_ata_iterate, + .open = VasEBoot_ata_open, + .close = VasEBoot_ata_close, + .read = VasEBoot_ata_read, + .write = VasEBoot_ata_write, .next = 0 }; @@ -522,23 +522,23 @@ static struct grub_disk_dev grub_atadisk_dev = /* ATAPI code. */ -static grub_err_t -grub_atapi_read (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_atapi_read (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, char *buf) { - struct grub_ata *dev = scsi->data; - struct grub_disk_ata_pass_through_parms parms; - grub_err_t err; + struct VasEBoot_ata *dev = scsi->data; + struct VasEBoot_disk_ata_pass_through_parms parms; + VasEBoot_err_t err; - grub_dprintf("ata", "grub_atapi_read (size=%llu)\n", (unsigned long long) size); - grub_memset (&parms, 0, sizeof (parms)); + VasEBoot_dprintf("ata", "VasEBoot_atapi_read (size=%llu)\n", (unsigned long long) size); + VasEBoot_memset (&parms, 0, sizeof (parms)); parms.taskfile.disk = 0; parms.taskfile.features = 0; parms.taskfile.atapi_ireason = 0; parms.taskfile.atapi_cnthigh = size >> 8; parms.taskfile.atapi_cntlow = size & 0xff; - parms.taskfile.cmd = GRUB_ATA_CMD_PACKET; + parms.taskfile.cmd = VasEBoot_ATA_CMD_PACKET; parms.cmd = cmd; parms.cmdsize = cmdsize; @@ -550,105 +550,105 @@ grub_atapi_read (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, return err; if (parms.size != size) - return grub_error (GRUB_ERR_READ_ERROR, "incomplete ATAPI read"); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "incomplete ATAPI read"); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_atapi_write (struct grub_scsi *scsi __attribute__((unused)), - grub_size_t cmdsize __attribute__((unused)), +static VasEBoot_err_t +VasEBoot_atapi_write (struct VasEBoot_scsi *scsi __attribute__((unused)), + VasEBoot_size_t cmdsize __attribute__((unused)), char *cmd __attribute__((unused)), - grub_size_t size __attribute__((unused)), + VasEBoot_size_t size __attribute__((unused)), const char *buf __attribute__((unused))) { // XXX: scsi.mod does not use write yet. - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ATAPI write not implemented"); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "ATAPI write not implemented"); } -static grub_err_t -grub_atapi_open (int id, int bus, struct grub_scsi *scsi) +static VasEBoot_err_t +VasEBoot_atapi_open (int id, int bus, struct VasEBoot_scsi *scsi) { - struct grub_ata *ata; + struct VasEBoot_ata *ata; - ata = grub_ata_real_open (id, bus); + ata = VasEBoot_ata_real_open (id, bus); if (!ata) - return grub_errno; + return VasEBoot_errno; if (! ata->atapi) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such ATAPI device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such ATAPI device"); scsi->data = ata; scsi->luns = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Context for grub_atapi_iterate. */ -struct grub_atapi_iterate_ctx +/* Context for VasEBoot_atapi_iterate. */ +struct VasEBoot_atapi_iterate_ctx { - grub_scsi_dev_iterate_hook_t hook; + VasEBoot_scsi_dev_iterate_hook_t hook; void *hook_data; }; -/* Helper for grub_atapi_iterate. */ +/* Helper for VasEBoot_atapi_iterate. */ static int -grub_atapi_iterate_iter (int id, int bus, void *data) +VasEBoot_atapi_iterate_iter (int id, int bus, void *data) { - struct grub_atapi_iterate_ctx *ctx = data; - struct grub_ata *ata; + struct VasEBoot_atapi_iterate_ctx *ctx = data; + struct VasEBoot_ata *ata; int ret; - ata = grub_ata_real_open (id, bus); + ata = VasEBoot_ata_real_open (id, bus); if (!ata) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } if (!ata->atapi) { - grub_ata_real_close (ata); + VasEBoot_ata_real_close (ata); return 0; } ret = ctx->hook (id, bus, 1, ctx->hook_data); - grub_ata_real_close (ata); + VasEBoot_ata_real_close (ata); return ret; } static int -grub_atapi_iterate (grub_scsi_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_atapi_iterate (VasEBoot_scsi_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_atapi_iterate_ctx ctx = { hook, hook_data }; - grub_ata_dev_t p; + struct VasEBoot_atapi_iterate_ctx ctx = { hook, hook_data }; + VasEBoot_ata_dev_t p; - for (p = grub_ata_dev_list; p; p = p->next) - if (p->iterate && p->iterate (grub_atapi_iterate_iter, &ctx, pull)) + for (p = VasEBoot_ata_dev_list; p; p = p->next) + if (p->iterate && p->iterate (VasEBoot_atapi_iterate_iter, &ctx, pull)) return 1; return 0; } static void -grub_atapi_close (grub_scsi_t disk) +VasEBoot_atapi_close (VasEBoot_scsi_t disk) { - struct grub_ata *ata = disk->data; - grub_ata_real_close (ata); + struct VasEBoot_ata *ata = disk->data; + VasEBoot_ata_real_close (ata); } void -grub_ata_dev_register (grub_ata_dev_t dev) +VasEBoot_ata_dev_register (VasEBoot_ata_dev_t dev) { - dev->next = grub_ata_dev_list; - grub_ata_dev_list = dev; + dev->next = VasEBoot_ata_dev_list; + VasEBoot_ata_dev_list = dev; } void -grub_ata_dev_unregister (grub_ata_dev_t dev) +VasEBoot_ata_dev_unregister (VasEBoot_ata_dev_t dev) { - grub_ata_dev_t *p, q; + VasEBoot_ata_dev_t *p, q; - for (p = &grub_ata_dev_list, q = *p; q; p = &(q->next), q = q->next) + for (p = &VasEBoot_ata_dev_list, q = *p; q; p = &(q->next), q = q->next) if (q == dev) { *p = q->next; @@ -656,28 +656,28 @@ grub_ata_dev_unregister (grub_ata_dev_t dev) } } -static struct grub_scsi_dev grub_atapi_dev = +static struct VasEBoot_scsi_dev VasEBoot_atapi_dev = { - .iterate = grub_atapi_iterate, - .open = grub_atapi_open, - .close = grub_atapi_close, - .read = grub_atapi_read, - .write = grub_atapi_write, + .iterate = VasEBoot_atapi_iterate, + .open = VasEBoot_atapi_open, + .close = VasEBoot_atapi_close, + .read = VasEBoot_atapi_read, + .write = VasEBoot_atapi_write, .next = 0 }; -GRUB_MOD_INIT(ata) +VasEBoot_MOD_INIT(ata) { - grub_disk_dev_register (&grub_atadisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_atadisk_dev); /* ATAPI devices are handled by scsi.mod. */ - grub_scsi_dev_register (&grub_atapi_dev); + VasEBoot_scsi_dev_register (&VasEBoot_atapi_dev); } -GRUB_MOD_FINI(ata) +VasEBoot_MOD_FINI(ata) { - grub_scsi_dev_unregister (&grub_atapi_dev); - grub_disk_dev_unregister (&grub_atadisk_dev); + VasEBoot_scsi_dev_unregister (&VasEBoot_atapi_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_atadisk_dev); } diff --git a/VasEBoot-core/disk/cryptodisk.c b/VasEBoot-core/disk/cryptodisk.c index bd60a66b3..328ce9410 100644 --- a/VasEBoot-core/disk/cryptodisk.c +++ b/VasEBoot-core/disk/cryptodisk.c @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_cryptodisk_dev_t grub_cryptodisk_list; +VasEBoot_cryptodisk_dev_t VasEBoot_cryptodisk_list; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"uuid", 'u', 0, N_("Mount by UUID."), 0, 0}, /* TRANSLATORS: It's still restricted to cryptodisks only. */ @@ -46,21 +46,21 @@ static const struct grub_arg_option options[] = /* Our irreducible polynom is x^128+x^7+x^2+x+1. Lowest byte of it is: */ #define GF_POLYNOM 0x87 -static inline int GF_PER_SECTOR (const struct grub_cryptodisk *dev) +static inline int GF_PER_SECTOR (const struct VasEBoot_cryptodisk *dev) { - return 1U << (dev->log_sector_size - GRUB_CRYPTODISK_GF_LOG_BYTES); + return 1U << (dev->log_sector_size - VasEBoot_CRYPTODISK_GF_LOG_BYTES); } -static grub_cryptodisk_t cryptodisk_list = NULL; -static grub_uint8_t last_cryptodisk_id = 0; +static VasEBoot_cryptodisk_t cryptodisk_list = NULL; +static VasEBoot_uint8_t last_cryptodisk_id = 0; static void -gf_mul_x (grub_uint8_t *g) +gf_mul_x (VasEBoot_uint8_t *g) { int over = 0, over2 = 0; unsigned j; - for (j = 0; j < GRUB_CRYPTODISK_GF_BYTES; j++) + for (j = 0; j < VasEBoot_CRYPTODISK_GF_BYTES; j++) { over2 = !!(g[j] & 0x80); g[j] <<= 1; @@ -73,12 +73,12 @@ gf_mul_x (grub_uint8_t *g) static void -gf_mul_x_be (grub_uint8_t *g) +gf_mul_x_be (VasEBoot_uint8_t *g) { int over = 0, over2 = 0; int j; - for (j = (int) GRUB_CRYPTODISK_GF_BYTES - 1; j >= 0; j--) + for (j = (int) VasEBoot_CRYPTODISK_GF_BYTES - 1; j >= 0; j--) { over2 = !!(g[j] & 0x80); g[j] <<= 1; @@ -86,167 +86,167 @@ gf_mul_x_be (grub_uint8_t *g) over = over2; } if (over) - g[GRUB_CRYPTODISK_GF_BYTES - 1] ^= GF_POLYNOM; + g[VasEBoot_CRYPTODISK_GF_BYTES - 1] ^= GF_POLYNOM; } static void -gf_mul_be (grub_uint8_t *o, const grub_uint8_t *a, const grub_uint8_t *b) +gf_mul_be (VasEBoot_uint8_t *o, const VasEBoot_uint8_t *a, const VasEBoot_uint8_t *b) { unsigned i; - grub_uint8_t t[GRUB_CRYPTODISK_GF_BYTES]; - grub_memset (o, 0, GRUB_CRYPTODISK_GF_BYTES); - grub_memcpy (t, b, GRUB_CRYPTODISK_GF_BYTES); - for (i = 0; i < GRUB_CRYPTODISK_GF_SIZE; i++) + VasEBoot_uint8_t t[VasEBoot_CRYPTODISK_GF_BYTES]; + VasEBoot_memset (o, 0, VasEBoot_CRYPTODISK_GF_BYTES); + VasEBoot_memcpy (t, b, VasEBoot_CRYPTODISK_GF_BYTES); + for (i = 0; i < VasEBoot_CRYPTODISK_GF_SIZE; i++) { - if (((a[GRUB_CRYPTODISK_GF_BYTES - i / GRUB_CHAR_BIT - 1] >> (i % GRUB_CHAR_BIT))) & 1) - grub_crypto_xor (o, o, t, GRUB_CRYPTODISK_GF_BYTES); + if (((a[VasEBoot_CRYPTODISK_GF_BYTES - i / VasEBoot_CHAR_BIT - 1] >> (i % VasEBoot_CHAR_BIT))) & 1) + VasEBoot_crypto_xor (o, o, t, VasEBoot_CRYPTODISK_GF_BYTES); gf_mul_x_be (t); } } static gcry_err_code_t -grub_crypto_pcbc_decrypt (grub_crypto_cipher_handle_t cipher, - void *out, void *in, grub_size_t size, +VasEBoot_crypto_pcbc_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, void *in, VasEBoot_size_t size, void *iv) { - grub_uint8_t *inptr, *outptr, *end; - grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; - grub_size_t blocksize; + VasEBoot_uint8_t *inptr, *outptr, *end; + VasEBoot_uint8_t ivt[VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE]; + VasEBoot_size_t blocksize; if (!cipher->cipher->decrypt) return GPG_ERR_NOT_SUPPORTED; blocksize = cipher->cipher->blocksize; if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) || ((size & (blocksize - 1)) != 0)) return GPG_ERR_INV_ARG; - if (blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) + if (blocksize > VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE) return GPG_ERR_INV_ARG; - end = (grub_uint8_t *) in + size; + end = (VasEBoot_uint8_t *) in + size; for (inptr = in, outptr = out; inptr < end; inptr += blocksize, outptr += blocksize) { - grub_memcpy (ivt, inptr, blocksize); + VasEBoot_memcpy (ivt, inptr, blocksize); cipher->cipher->decrypt (cipher->ctx, outptr, inptr); - grub_crypto_xor (outptr, outptr, iv, blocksize); - grub_crypto_xor (iv, ivt, outptr, blocksize); + VasEBoot_crypto_xor (outptr, outptr, iv, blocksize); + VasEBoot_crypto_xor (iv, ivt, outptr, blocksize); } return GPG_ERR_NO_ERROR; } static gcry_err_code_t -grub_crypto_pcbc_encrypt (grub_crypto_cipher_handle_t cipher, - void *out, void *in, grub_size_t size, +VasEBoot_crypto_pcbc_encrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, void *in, VasEBoot_size_t size, void *iv) { - grub_uint8_t *inptr, *outptr, *end; - grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; - grub_size_t blocksize; + VasEBoot_uint8_t *inptr, *outptr, *end; + VasEBoot_uint8_t ivt[VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE]; + VasEBoot_size_t blocksize; if (!cipher->cipher->encrypt) return GPG_ERR_NOT_SUPPORTED; blocksize = cipher->cipher->blocksize; - if (blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) + if (blocksize > VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE) return GPG_ERR_INV_ARG; if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) || ((size & (blocksize - 1)) != 0)) return GPG_ERR_INV_ARG; - end = (grub_uint8_t *) in + size; + end = (VasEBoot_uint8_t *) in + size; for (inptr = in, outptr = out; inptr < end; inptr += blocksize, outptr += blocksize) { - grub_memcpy (ivt, inptr, blocksize); - grub_crypto_xor (outptr, outptr, iv, blocksize); + VasEBoot_memcpy (ivt, inptr, blocksize); + VasEBoot_crypto_xor (outptr, outptr, iv, blocksize); cipher->cipher->encrypt (cipher->ctx, outptr, inptr); - grub_crypto_xor (iv, ivt, outptr, blocksize); + VasEBoot_crypto_xor (iv, ivt, outptr, blocksize); } return GPG_ERR_NO_ERROR; } struct lrw_sector { - grub_uint8_t low[GRUB_CRYPTODISK_GF_BYTES]; - grub_uint8_t high[GRUB_CRYPTODISK_GF_BYTES]; - grub_uint8_t low_byte, low_byte_c; + VasEBoot_uint8_t low[VasEBoot_CRYPTODISK_GF_BYTES]; + VasEBoot_uint8_t high[VasEBoot_CRYPTODISK_GF_BYTES]; + VasEBoot_uint8_t low_byte, low_byte_c; }; static void generate_lrw_sector (struct lrw_sector *sec, - const struct grub_cryptodisk *dev, - const grub_uint8_t *iv) + const struct VasEBoot_cryptodisk *dev, + const VasEBoot_uint8_t *iv) { - grub_uint8_t idx[GRUB_CRYPTODISK_GF_BYTES]; - grub_uint16_t c; + VasEBoot_uint8_t idx[VasEBoot_CRYPTODISK_GF_BYTES]; + VasEBoot_uint16_t c; int j; - grub_memcpy (idx, iv, GRUB_CRYPTODISK_GF_BYTES); - sec->low_byte = (idx[GRUB_CRYPTODISK_GF_BYTES - 1] + VasEBoot_memcpy (idx, iv, VasEBoot_CRYPTODISK_GF_BYTES); + sec->low_byte = (idx[VasEBoot_CRYPTODISK_GF_BYTES - 1] & (GF_PER_SECTOR (dev) - 1)); sec->low_byte_c = (((GF_PER_SECTOR (dev) - 1) & ~sec->low_byte) + 1); - idx[GRUB_CRYPTODISK_GF_BYTES - 1] &= ~(GF_PER_SECTOR (dev) - 1); + idx[VasEBoot_CRYPTODISK_GF_BYTES - 1] &= ~(GF_PER_SECTOR (dev) - 1); gf_mul_be (sec->low, dev->lrw_key, idx); if (!sec->low_byte) return; - c = idx[GRUB_CRYPTODISK_GF_BYTES - 1] + GF_PER_SECTOR (dev); + c = idx[VasEBoot_CRYPTODISK_GF_BYTES - 1] + GF_PER_SECTOR (dev); if (c & 0x100) { - for (j = GRUB_CRYPTODISK_GF_BYTES - 2; j >= 0; j--) + for (j = VasEBoot_CRYPTODISK_GF_BYTES - 2; j >= 0; j--) { idx[j]++; if (idx[j] != 0) break; } } - idx[GRUB_CRYPTODISK_GF_BYTES - 1] = c; + idx[VasEBoot_CRYPTODISK_GF_BYTES - 1] = c; gf_mul_be (sec->high, dev->lrw_key, idx); } static void __attribute__ ((unused)) lrw_xor (const struct lrw_sector *sec, - const struct grub_cryptodisk *dev, - grub_uint8_t *b) + const struct VasEBoot_cryptodisk *dev, + VasEBoot_uint8_t *b) { unsigned i; - for (i = 0; i < sec->low_byte_c * GRUB_CRYPTODISK_GF_BYTES; - i += GRUB_CRYPTODISK_GF_BYTES) - grub_crypto_xor (b + i, b + i, sec->low, GRUB_CRYPTODISK_GF_BYTES); - grub_crypto_xor (b, b, dev->lrw_precalc + GRUB_CRYPTODISK_GF_BYTES * sec->low_byte, - sec->low_byte_c * GRUB_CRYPTODISK_GF_BYTES); + for (i = 0; i < sec->low_byte_c * VasEBoot_CRYPTODISK_GF_BYTES; + i += VasEBoot_CRYPTODISK_GF_BYTES) + VasEBoot_crypto_xor (b + i, b + i, sec->low, VasEBoot_CRYPTODISK_GF_BYTES); + VasEBoot_crypto_xor (b, b, dev->lrw_precalc + VasEBoot_CRYPTODISK_GF_BYTES * sec->low_byte, + sec->low_byte_c * VasEBoot_CRYPTODISK_GF_BYTES); if (!sec->low_byte) return; - for (i = sec->low_byte_c * GRUB_CRYPTODISK_GF_BYTES; - i < (1U << dev->log_sector_size); i += GRUB_CRYPTODISK_GF_BYTES) - grub_crypto_xor (b + i, b + i, sec->high, GRUB_CRYPTODISK_GF_BYTES); - grub_crypto_xor (b + sec->low_byte_c * GRUB_CRYPTODISK_GF_BYTES, - b + sec->low_byte_c * GRUB_CRYPTODISK_GF_BYTES, - dev->lrw_precalc, sec->low_byte * GRUB_CRYPTODISK_GF_BYTES); + for (i = sec->low_byte_c * VasEBoot_CRYPTODISK_GF_BYTES; + i < (1U << dev->log_sector_size); i += VasEBoot_CRYPTODISK_GF_BYTES) + VasEBoot_crypto_xor (b + i, b + i, sec->high, VasEBoot_CRYPTODISK_GF_BYTES); + VasEBoot_crypto_xor (b + sec->low_byte_c * VasEBoot_CRYPTODISK_GF_BYTES, + b + sec->low_byte_c * VasEBoot_CRYPTODISK_GF_BYTES, + dev->lrw_precalc, sec->low_byte * VasEBoot_CRYPTODISK_GF_BYTES); } static gcry_err_code_t -grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, - grub_uint8_t * data, grub_size_t len, - grub_disk_addr_t sector, int do_encrypt) +VasEBoot_cryptodisk_endecrypt (struct VasEBoot_cryptodisk *dev, + VasEBoot_uint8_t * data, VasEBoot_size_t len, + VasEBoot_disk_addr_t sector, int do_encrypt) { - grub_size_t i; + VasEBoot_size_t i; gcry_err_code_t err; - if (dev->cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) + if (dev->cipher->cipher->blocksize > VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE) return GPG_ERR_INV_ARG; /* The only mode without IV. */ - if (dev->mode == GRUB_CRYPTODISK_MODE_ECB && !dev->rekey) - return (do_encrypt ? grub_crypto_ecb_encrypt (dev->cipher, data, data, len) - : grub_crypto_ecb_decrypt (dev->cipher, data, data, len)); + if (dev->mode == VasEBoot_CRYPTODISK_MODE_ECB && !dev->rekey) + return (do_encrypt ? VasEBoot_crypto_ecb_encrypt (dev->cipher, data, data, len) + : VasEBoot_crypto_ecb_decrypt (dev->cipher, data, data, len)); for (i = 0; i < len; i += (1U << dev->log_sector_size)) { - grub_size_t sz = ((dev->cipher->cipher->blocksize - + sizeof (grub_uint32_t) - 1) - / sizeof (grub_uint32_t)); - grub_uint32_t iv[(GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE + 3) / 4]; + VasEBoot_size_t sz = ((dev->cipher->cipher->blocksize + + sizeof (VasEBoot_uint32_t) - 1) + / sizeof (VasEBoot_uint32_t)); + VasEBoot_uint32_t iv[(VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE + 3) / 4]; if (dev->rekey) { - grub_uint64_t zone = sector >> dev->rekey_shift; + VasEBoot_uint64_t zone = sector >> dev->rekey_shift; if (zone != dev->last_rekey) { err = dev->rekey (dev, zone); @@ -256,51 +256,51 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, } } - grub_memset (iv, 0, sizeof (iv)); + VasEBoot_memset (iv, 0, sizeof (iv)); switch (dev->mode_iv) { - case GRUB_CRYPTODISK_MODE_IV_NULL: + case VasEBoot_CRYPTODISK_MODE_IV_NULL: break; - case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH: + case VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH: { - grub_uint64_t tmp; + VasEBoot_uint64_t tmp; void *ctx; - ctx = grub_zalloc (dev->iv_hash->contextsize); + ctx = VasEBoot_zalloc (dev->iv_hash->contextsize); if (!ctx) return GPG_ERR_OUT_OF_MEMORY; - tmp = grub_cpu_to_le64 (sector << dev->log_sector_size); + tmp = VasEBoot_cpu_to_le64 (sector << dev->log_sector_size); dev->iv_hash->init (ctx); dev->iv_hash->write (ctx, dev->iv_prefix, dev->iv_prefix_len); dev->iv_hash->write (ctx, &tmp, sizeof (tmp)); dev->iv_hash->final (ctx); - grub_memcpy (iv, dev->iv_hash->read (ctx), sizeof (iv)); - grub_free (ctx); + VasEBoot_memcpy (iv, dev->iv_hash->read (ctx), sizeof (iv)); + VasEBoot_free (ctx); } break; - case GRUB_CRYPTODISK_MODE_IV_PLAIN64: - iv[1] = grub_cpu_to_le32 (sector >> 32); + case VasEBoot_CRYPTODISK_MODE_IV_PLAIN64: + iv[1] = VasEBoot_cpu_to_le32 (sector >> 32); /* FALLTHROUGH */ - case GRUB_CRYPTODISK_MODE_IV_PLAIN: - iv[0] = grub_cpu_to_le32 (sector & 0xFFFFFFFF); + case VasEBoot_CRYPTODISK_MODE_IV_PLAIN: + iv[0] = VasEBoot_cpu_to_le32 (sector & 0xFFFFFFFF); break; - case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64: - iv[1] = grub_cpu_to_le32 (sector >> (32 - dev->log_sector_size)); - iv[0] = grub_cpu_to_le32 ((sector << dev->log_sector_size) + case VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64: + iv[1] = VasEBoot_cpu_to_le32 (sector >> (32 - dev->log_sector_size)); + iv[0] = VasEBoot_cpu_to_le32 ((sector << dev->log_sector_size) & 0xFFFFFFFF); break; - case GRUB_CRYPTODISK_MODE_IV_BENBI: + case VasEBoot_CRYPTODISK_MODE_IV_BENBI: { - grub_uint64_t num = (sector << dev->benbi_log) + 1; - iv[sz - 2] = grub_cpu_to_be32 (num >> 32); - iv[sz - 1] = grub_cpu_to_be32 (num & 0xFFFFFFFF); + VasEBoot_uint64_t num = (sector << dev->benbi_log) + 1; + iv[sz - 2] = VasEBoot_cpu_to_be32 (num >> 32); + iv[sz - 1] = VasEBoot_cpu_to_be32 (num & 0xFFFFFFFF); } break; - case GRUB_CRYPTODISK_MODE_IV_ESSIV: - iv[0] = grub_cpu_to_le32 (sector & 0xFFFFFFFF); - err = grub_crypto_ecb_encrypt (dev->essiv_cipher, iv, iv, + case VasEBoot_CRYPTODISK_MODE_IV_ESSIV: + iv[0] = VasEBoot_cpu_to_le32 (sector & 0xFFFFFFFF); + err = VasEBoot_crypto_ecb_encrypt (dev->essiv_cipher, iv, iv, dev->cipher->cipher->blocksize); if (err) return err; @@ -308,31 +308,31 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, switch (dev->mode) { - case GRUB_CRYPTODISK_MODE_CBC: + case VasEBoot_CRYPTODISK_MODE_CBC: if (do_encrypt) - err = grub_crypto_cbc_encrypt (dev->cipher, data + i, data + i, + err = VasEBoot_crypto_cbc_encrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size), iv); else - err = grub_crypto_cbc_decrypt (dev->cipher, data + i, data + i, + err = VasEBoot_crypto_cbc_decrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size), iv); if (err) return err; break; - case GRUB_CRYPTODISK_MODE_PCBC: + case VasEBoot_CRYPTODISK_MODE_PCBC: if (do_encrypt) - err = grub_crypto_pcbc_encrypt (dev->cipher, data + i, data + i, + err = VasEBoot_crypto_pcbc_encrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size), iv); else - err = grub_crypto_pcbc_decrypt (dev->cipher, data + i, data + i, + err = VasEBoot_crypto_pcbc_decrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size), iv); if (err) return err; break; - case GRUB_CRYPTODISK_MODE_XTS: + case VasEBoot_CRYPTODISK_MODE_XTS: { unsigned j; - err = grub_crypto_ecb_encrypt (dev->secondary_cipher, iv, iv, + err = VasEBoot_crypto_ecb_encrypt (dev->secondary_cipher, iv, iv, dev->cipher->cipher->blocksize); if (err) return err; @@ -340,37 +340,37 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, for (j = 0; j < (1U << dev->log_sector_size); j += dev->cipher->cipher->blocksize) { - grub_crypto_xor (data + i + j, data + i + j, iv, + VasEBoot_crypto_xor (data + i + j, data + i + j, iv, dev->cipher->cipher->blocksize); if (do_encrypt) - err = grub_crypto_ecb_encrypt (dev->cipher, data + i + j, + err = VasEBoot_crypto_ecb_encrypt (dev->cipher, data + i + j, data + i + j, dev->cipher->cipher->blocksize); else - err = grub_crypto_ecb_decrypt (dev->cipher, data + i + j, + err = VasEBoot_crypto_ecb_decrypt (dev->cipher, data + i + j, data + i + j, dev->cipher->cipher->blocksize); if (err) return err; - grub_crypto_xor (data + i + j, data + i + j, iv, + VasEBoot_crypto_xor (data + i + j, data + i + j, iv, dev->cipher->cipher->blocksize); - gf_mul_x ((grub_uint8_t *) iv); + gf_mul_x ((VasEBoot_uint8_t *) iv); } } break; - case GRUB_CRYPTODISK_MODE_LRW: + case VasEBoot_CRYPTODISK_MODE_LRW: { struct lrw_sector sec; - generate_lrw_sector (&sec, dev, (grub_uint8_t *) iv); + generate_lrw_sector (&sec, dev, (VasEBoot_uint8_t *) iv); lrw_xor (&sec, dev, data + i); if (do_encrypt) - err = grub_crypto_ecb_encrypt (dev->cipher, data + i, + err = VasEBoot_crypto_ecb_encrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size)); else - err = grub_crypto_ecb_decrypt (dev->cipher, data + i, + err = VasEBoot_crypto_ecb_decrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size)); if (err) @@ -378,12 +378,12 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, lrw_xor (&sec, dev, data + i); } break; - case GRUB_CRYPTODISK_MODE_ECB: + case VasEBoot_CRYPTODISK_MODE_ECB: if (do_encrypt) - err = grub_crypto_ecb_encrypt (dev->cipher, data + i, data + i, + err = VasEBoot_crypto_ecb_encrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size)); else - err = grub_crypto_ecb_decrypt (dev->cipher, data + i, data + i, + err = VasEBoot_crypto_ecb_decrypt (dev->cipher, data + i, data + i, (1U << dev->log_sector_size)); if (err) return err; @@ -397,71 +397,71 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev, } gcry_err_code_t -grub_cryptodisk_decrypt (struct grub_cryptodisk *dev, - grub_uint8_t * data, grub_size_t len, - grub_disk_addr_t sector) +VasEBoot_cryptodisk_decrypt (struct VasEBoot_cryptodisk *dev, + VasEBoot_uint8_t * data, VasEBoot_size_t len, + VasEBoot_disk_addr_t sector) { - return grub_cryptodisk_endecrypt (dev, data, len, sector, 0); + return VasEBoot_cryptodisk_endecrypt (dev, data, len, sector, 0); } gcry_err_code_t -grub_cryptodisk_setkey (grub_cryptodisk_t dev, grub_uint8_t *key, grub_size_t keysize) +VasEBoot_cryptodisk_setkey (VasEBoot_cryptodisk_t dev, VasEBoot_uint8_t *key, VasEBoot_size_t keysize) { gcry_err_code_t err; int real_keysize; real_keysize = keysize; - if (dev->mode == GRUB_CRYPTODISK_MODE_XTS) + if (dev->mode == VasEBoot_CRYPTODISK_MODE_XTS) real_keysize /= 2; - if (dev->mode == GRUB_CRYPTODISK_MODE_LRW) + if (dev->mode == VasEBoot_CRYPTODISK_MODE_LRW) real_keysize -= dev->cipher->cipher->blocksize; /* Set the PBKDF2 output as the cipher key. */ - err = grub_crypto_cipher_set_key (dev->cipher, key, real_keysize); + err = VasEBoot_crypto_cipher_set_key (dev->cipher, key, real_keysize); if (err) return err; - grub_memcpy (dev->key, key, keysize); + VasEBoot_memcpy (dev->key, key, keysize); dev->keysize = keysize; /* Configure ESSIV if necessary. */ - if (dev->mode_iv == GRUB_CRYPTODISK_MODE_IV_ESSIV) + if (dev->mode_iv == VasEBoot_CRYPTODISK_MODE_IV_ESSIV) { - grub_size_t essiv_keysize = dev->essiv_hash->mdlen; - grub_uint8_t hashed_key[GRUB_CRYPTO_MAX_MDLEN]; - if (essiv_keysize > GRUB_CRYPTO_MAX_MDLEN) + VasEBoot_size_t essiv_keysize = dev->essiv_hash->mdlen; + VasEBoot_uint8_t hashed_key[VasEBoot_CRYPTO_MAX_MDLEN]; + if (essiv_keysize > VasEBoot_CRYPTO_MAX_MDLEN) return GPG_ERR_INV_ARG; - grub_crypto_hash (dev->essiv_hash, hashed_key, key, keysize); - err = grub_crypto_cipher_set_key (dev->essiv_cipher, + VasEBoot_crypto_hash (dev->essiv_hash, hashed_key, key, keysize); + err = VasEBoot_crypto_cipher_set_key (dev->essiv_cipher, hashed_key, essiv_keysize); if (err) return err; } - if (dev->mode == GRUB_CRYPTODISK_MODE_XTS) + if (dev->mode == VasEBoot_CRYPTODISK_MODE_XTS) { - err = grub_crypto_cipher_set_key (dev->secondary_cipher, + err = VasEBoot_crypto_cipher_set_key (dev->secondary_cipher, key + real_keysize, keysize / 2); if (err) return err; } - if (dev->mode == GRUB_CRYPTODISK_MODE_LRW) + if (dev->mode == VasEBoot_CRYPTODISK_MODE_LRW) { unsigned i; - grub_uint8_t idx[GRUB_CRYPTODISK_GF_BYTES]; + VasEBoot_uint8_t idx[VasEBoot_CRYPTODISK_GF_BYTES]; - grub_free (dev->lrw_precalc); - grub_memcpy (dev->lrw_key, key + real_keysize, + VasEBoot_free (dev->lrw_precalc); + VasEBoot_memcpy (dev->lrw_key, key + real_keysize, dev->cipher->cipher->blocksize); - dev->lrw_precalc = grub_malloc ((1U << dev->log_sector_size)); + dev->lrw_precalc = VasEBoot_malloc ((1U << dev->log_sector_size)); if (!dev->lrw_precalc) return GPG_ERR_OUT_OF_MEMORY; - grub_memset (idx, 0, GRUB_CRYPTODISK_GF_BYTES); + VasEBoot_memset (idx, 0, VasEBoot_CRYPTODISK_GF_BYTES); for (i = 0; i < (1U << dev->log_sector_size); - i += GRUB_CRYPTODISK_GF_BYTES) + i += VasEBoot_CRYPTODISK_GF_BYTES) { - idx[GRUB_CRYPTODISK_GF_BYTES - 1] = i / GRUB_CRYPTODISK_GF_BYTES; + idx[VasEBoot_CRYPTODISK_GF_BYTES - 1] = i / VasEBoot_CRYPTODISK_GF_BYTES; gf_mul_be (dev->lrw_precalc + i, idx, dev->lrw_key); } } @@ -469,213 +469,213 @@ grub_cryptodisk_setkey (grub_cryptodisk_t dev, grub_uint8_t *key, grub_size_t ke } static int -grub_cryptodisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_cryptodisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - grub_cryptodisk_t i; + VasEBoot_cryptodisk_t i; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; for (i = cryptodisk_list; i != NULL; i = i->next) { char buf[30]; - grub_snprintf (buf, sizeof (buf), "crypto%lu", i->id); + VasEBoot_snprintf (buf, sizeof (buf), "crypto%lu", i->id); if (hook (buf, hook_data)) return 1; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cryptodisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_cryptodisk_open (const char *name, VasEBoot_disk_t disk) { - grub_cryptodisk_t dev; + VasEBoot_cryptodisk_t dev; - if (grub_memcmp (name, "crypto", sizeof ("crypto") - 1) != 0) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such device"); + if (VasEBoot_memcmp (name, "crypto", sizeof ("crypto") - 1) != 0) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "No such device"); - if (grub_memcmp (name, "cryptouuid/", sizeof ("cryptouuid/") - 1) == 0) + if (VasEBoot_memcmp (name, "cryptouuid/", sizeof ("cryptouuid/") - 1) == 0) { for (dev = cryptodisk_list; dev != NULL; dev = dev->next) - if (grub_strcasecmp (name + sizeof ("cryptouuid/") - 1, dev->uuid) == 0) + if (VasEBoot_strcasecmp (name + sizeof ("cryptouuid/") - 1, dev->uuid) == 0) break; } else { - unsigned long id = grub_strtoul (name + sizeof ("crypto") - 1, 0, 0); - if (grub_errno) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such device"); + unsigned long id = VasEBoot_strtoul (name + sizeof ("crypto") - 1, 0, 0); + if (VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "No such device"); /* Search for requested device in the list of CRYPTODISK devices. */ for (dev = cryptodisk_list; dev != NULL; dev = dev->next) if (dev->id == id) break; } if (!dev) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "No such device"); disk->log_sector_size = dev->log_sector_size; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL if (dev->cheat) { - if (!GRUB_UTIL_FD_IS_VALID (dev->cheat_fd)) - dev->cheat_fd = grub_util_fd_open (dev->cheat, GRUB_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID (dev->cheat_fd)) - return grub_error (GRUB_ERR_IO, N_("cannot open `%s': %s"), - dev->cheat, grub_util_fd_strerror ()); + if (!VasEBoot_UTIL_FD_IS_VALID (dev->cheat_fd)) + dev->cheat_fd = VasEBoot_util_fd_open (dev->cheat, VasEBoot_UTIL_FD_O_RDONLY); + if (!VasEBoot_UTIL_FD_IS_VALID (dev->cheat_fd)) + return VasEBoot_error (VasEBoot_ERR_IO, N_("cannot open `%s': %s"), + dev->cheat, VasEBoot_util_fd_strerror ()); } #endif if (!dev->source_disk) { - grub_dprintf ("cryptodisk", "Opening device %s\n", name); + VasEBoot_dprintf ("cryptodisk", "Opening device %s\n", name); /* Try to open the source disk and populate the requested disk. */ - dev->source_disk = grub_disk_open (dev->source); + dev->source_disk = VasEBoot_disk_open (dev->source); if (!dev->source_disk) - return grub_errno; + return VasEBoot_errno; } disk->data = dev; disk->total_sectors = dev->total_length; - disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; + disk->max_agglomerate = VasEBoot_DISK_MAX_MAX_AGGLOMERATE; disk->id = dev->id; dev->ref++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_cryptodisk_close (grub_disk_t disk) +VasEBoot_cryptodisk_close (VasEBoot_disk_t disk) { - grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data; - grub_dprintf ("cryptodisk", "Closing disk\n"); + VasEBoot_cryptodisk_t dev = (VasEBoot_cryptodisk_t) disk->data; + VasEBoot_dprintf ("cryptodisk", "Closing disk\n"); dev->ref--; if (dev->ref != 0) return; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL if (dev->cheat) { - grub_util_fd_close (dev->cheat_fd); - dev->cheat_fd = GRUB_UTIL_FD_INVALID; + VasEBoot_util_fd_close (dev->cheat_fd); + dev->cheat_fd = VasEBoot_UTIL_FD_INVALID; } #endif - grub_disk_close (dev->source_disk); + VasEBoot_disk_close (dev->source_disk); dev->source_disk = NULL; } -static grub_err_t -grub_cryptodisk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_cryptodisk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data; - grub_err_t err; + VasEBoot_cryptodisk_t dev = (VasEBoot_cryptodisk_t) disk->data; + VasEBoot_err_t err; gcry_err_code_t gcry_err; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL if (dev->cheat) { int r; - r = grub_util_fd_seek (dev->cheat_fd, sector << disk->log_sector_size); + r = VasEBoot_util_fd_seek (dev->cheat_fd, sector << disk->log_sector_size); if (r) - return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), - dev->cheat, grub_util_fd_strerror ()); - if (grub_util_fd_read (dev->cheat_fd, buf, size << disk->log_sector_size) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), + dev->cheat, VasEBoot_util_fd_strerror ()); + if (VasEBoot_util_fd_read (dev->cheat_fd, buf, size << disk->log_sector_size) != (ssize_t) (size << disk->log_sector_size)) - return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read `%s': %s"), - dev->cheat, grub_util_fd_strerror ()); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("cannot read `%s': %s"), + dev->cheat, VasEBoot_util_fd_strerror ()); + return VasEBoot_ERR_NONE; } #endif - grub_dprintf ("cryptodisk", - "Reading %" PRIuGRUB_SIZE " sectors from sector 0x%" - PRIxGRUB_UINT64_T " with offset of %" PRIuGRUB_UINT64_T "\n", + VasEBoot_dprintf ("cryptodisk", + "Reading %" PRIuVasEBoot_SIZE " sectors from sector 0x%" + PRIxVasEBoot_UINT64_T " with offset of %" PRIuVasEBoot_UINT64_T "\n", size, sector, dev->offset); - err = grub_disk_read (dev->source_disk, + err = VasEBoot_disk_read (dev->source_disk, (sector << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS)) + dev->offset, 0, + - VasEBoot_DISK_SECTOR_BITS)) + dev->offset, 0, size << disk->log_sector_size, buf); if (err) { - grub_dprintf ("cryptodisk", "grub_disk_read failed with error %d\n", err); + VasEBoot_dprintf ("cryptodisk", "VasEBoot_disk_read failed with error %d\n", err); return err; } - gcry_err = grub_cryptodisk_endecrypt (dev, (grub_uint8_t *) buf, + gcry_err = VasEBoot_cryptodisk_endecrypt (dev, (VasEBoot_uint8_t *) buf, size << disk->log_sector_size, sector, 0); - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); } -static grub_err_t -grub_cryptodisk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_cryptodisk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data; + VasEBoot_cryptodisk_t dev = (VasEBoot_cryptodisk_t) disk->data; gcry_err_code_t gcry_err; char *tmp; - grub_err_t err; + VasEBoot_err_t err; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL if (dev->cheat) { int r; - r = grub_util_fd_seek (dev->cheat_fd, sector << disk->log_sector_size); + r = VasEBoot_util_fd_seek (dev->cheat_fd, sector << disk->log_sector_size); if (r) - return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), - dev->cheat, grub_util_fd_strerror ()); - if (grub_util_fd_write (dev->cheat_fd, buf, size << disk->log_sector_size) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), + dev->cheat, VasEBoot_util_fd_strerror ()); + if (VasEBoot_util_fd_write (dev->cheat_fd, buf, size << disk->log_sector_size) != (ssize_t) (size << disk->log_sector_size)) - return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read `%s': %s"), - dev->cheat, grub_util_fd_strerror ()); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("cannot read `%s': %s"), + dev->cheat, VasEBoot_util_fd_strerror ()); + return VasEBoot_ERR_NONE; } #endif - tmp = grub_malloc (size << disk->log_sector_size); + tmp = VasEBoot_malloc (size << disk->log_sector_size); if (!tmp) - return grub_errno; - grub_memcpy (tmp, buf, size << disk->log_sector_size); + return VasEBoot_errno; + VasEBoot_memcpy (tmp, buf, size << disk->log_sector_size); - grub_dprintf ("cryptodisk", - "Writing %" PRIuGRUB_SIZE " sectors to sector 0x%" - PRIxGRUB_UINT64_T " with offset of %" PRIuGRUB_UINT64_T "\n", + VasEBoot_dprintf ("cryptodisk", + "Writing %" PRIuVasEBoot_SIZE " sectors to sector 0x%" + PRIxVasEBoot_UINT64_T " with offset of %" PRIuVasEBoot_UINT64_T "\n", size, sector, dev->offset); - gcry_err = grub_cryptodisk_endecrypt (dev, (grub_uint8_t *) tmp, + gcry_err = VasEBoot_cryptodisk_endecrypt (dev, (VasEBoot_uint8_t *) tmp, size << disk->log_sector_size, sector, 1); if (gcry_err) { - grub_free (tmp); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (tmp); + return VasEBoot_crypto_gcry_error (gcry_err); } /* Since ->write was called so disk.mod is loaded but be paranoid */ - if (grub_disk_write_weak) - err = grub_disk_write_weak (dev->source_disk, + if (VasEBoot_disk_write_weak) + err = VasEBoot_disk_write_weak (dev->source_disk, (sector << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS)) + - VasEBoot_DISK_SECTOR_BITS)) + dev->offset, 0, size << disk->log_sector_size, tmp); else - err = grub_error (GRUB_ERR_BUG, "disk.mod not loaded"); - grub_free (tmp); + err = VasEBoot_error (VasEBoot_ERR_BUG, "disk.mod not loaded"); + VasEBoot_free (tmp); return err; } -#ifdef GRUB_UTIL -static grub_disk_memberlist_t -grub_cryptodisk_memberlist (grub_disk_t disk) +#ifdef VasEBoot_UTIL +static VasEBoot_disk_memberlist_t +VasEBoot_cryptodisk_memberlist (VasEBoot_disk_t disk) { - grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data; - grub_disk_memberlist_t list = NULL; + VasEBoot_cryptodisk_t dev = (VasEBoot_cryptodisk_t) disk->data; + VasEBoot_disk_memberlist_t list = NULL; - list = grub_malloc (sizeof (*list)); + list = VasEBoot_malloc (sizeof (*list)); if (list) { list->disk = dev->source_disk; @@ -690,96 +690,96 @@ static void cryptodisk_cleanup (void) { #if 0 - grub_cryptodisk_t dev = cryptodisk_list; - grub_cryptodisk_t tmp; + VasEBoot_cryptodisk_t dev = cryptodisk_list; + VasEBoot_cryptodisk_t tmp; while (dev != NULL) { - grub_free (dev->source); - grub_free (dev->cipher); - grub_free (dev->secondary_cipher); - grub_free (dev->essiv_cipher); + VasEBoot_free (dev->source); + VasEBoot_free (dev->cipher); + VasEBoot_free (dev->secondary_cipher); + VasEBoot_free (dev->essiv_cipher); tmp = dev->next; - grub_free (dev); + VasEBoot_free (dev); dev = tmp; } #endif } -grub_err_t -grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name, - grub_disk_t source) +VasEBoot_err_t +VasEBoot_cryptodisk_insert (VasEBoot_cryptodisk_t newdev, const char *name, + VasEBoot_disk_t source) { - newdev->source = grub_strdup (name); + newdev->source = VasEBoot_strdup (name); if (!newdev->source) { - grub_free (newdev); - return grub_errno; + VasEBoot_free (newdev); + return VasEBoot_errno; } newdev->id = last_cryptodisk_id++; newdev->source_id = source->id; newdev->source_dev_id = source->dev->id; - newdev->partition_start = grub_partition_get_start (source->partition); + newdev->partition_start = VasEBoot_partition_get_start (source->partition); newdev->next = cryptodisk_list; cryptodisk_list = newdev; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_cryptodisk_t -grub_cryptodisk_get_by_uuid (const char *uuid) +VasEBoot_cryptodisk_t +VasEBoot_cryptodisk_get_by_uuid (const char *uuid) { - grub_cryptodisk_t dev; + VasEBoot_cryptodisk_t dev; for (dev = cryptodisk_list; dev != NULL; dev = dev->next) - if (grub_strcasecmp (dev->uuid, uuid) == 0) + if (VasEBoot_strcasecmp (dev->uuid, uuid) == 0) return dev; return NULL; } -grub_cryptodisk_t -grub_cryptodisk_get_by_source_disk (grub_disk_t disk) +VasEBoot_cryptodisk_t +VasEBoot_cryptodisk_get_by_source_disk (VasEBoot_disk_t disk) { - grub_cryptodisk_t dev; + VasEBoot_cryptodisk_t dev; for (dev = cryptodisk_list; dev != NULL; dev = dev->next) if (dev->source_id == disk->id && dev->source_dev_id == disk->dev->id) - if ((disk->partition && grub_partition_get_start (disk->partition) == dev->partition_start) || + if ((disk->partition && VasEBoot_partition_get_start (disk->partition) == dev->partition_start) || (!disk->partition && dev->partition_start == 0)) return dev; return NULL; } -#ifdef GRUB_UTIL -grub_err_t -grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, - grub_disk_t source, const char *cheat) +#ifdef VasEBoot_UTIL +VasEBoot_err_t +VasEBoot_cryptodisk_cheat_insert (VasEBoot_cryptodisk_t newdev, const char *name, + VasEBoot_disk_t source, const char *cheat) { - newdev->cheat = grub_strdup (cheat); - newdev->source = grub_strdup (name); + newdev->cheat = VasEBoot_strdup (cheat); + newdev->source = VasEBoot_strdup (name); if (!newdev->source || !newdev->cheat) { - grub_free (newdev->source); - grub_free (newdev->cheat); - return grub_errno; + VasEBoot_free (newdev->source); + VasEBoot_free (newdev->cheat); + return VasEBoot_errno; } - newdev->cheat_fd = GRUB_UTIL_FD_INVALID; + newdev->cheat_fd = VasEBoot_UTIL_FD_INVALID; newdev->source_id = source->id; newdev->source_dev_id = source->dev->id; - newdev->partition_start = grub_partition_get_start (source->partition); + newdev->partition_start = VasEBoot_partition_get_start (source->partition); newdev->id = last_cryptodisk_id++; newdev->next = cryptodisk_list; cryptodisk_list = newdev; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_util_cryptodisk_get_abstraction (grub_disk_t disk, +VasEBoot_util_cryptodisk_get_abstraction (VasEBoot_disk_t disk, void (*cb) (const char *val, void *data), void *data) { - grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data; + VasEBoot_cryptodisk_t dev = (VasEBoot_cryptodisk_t) disk->data; cb ("cryptodisk", data); cb (dev->modname, data); @@ -799,9 +799,9 @@ grub_util_cryptodisk_get_abstraction (grub_disk_t disk, } const char * -grub_util_cryptodisk_get_uuid (grub_disk_t disk) +VasEBoot_util_cryptodisk_get_uuid (VasEBoot_disk_t disk) { - grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data; + VasEBoot_cryptodisk_t dev = (VasEBoot_cryptodisk_t) disk->data; return dev->uuid; } @@ -811,31 +811,31 @@ static int check_boot, have_it; static char *search_uuid; static void -cryptodisk_close (grub_cryptodisk_t dev) +cryptodisk_close (VasEBoot_cryptodisk_t dev) { - grub_crypto_cipher_close (dev->cipher); - grub_crypto_cipher_close (dev->secondary_cipher); - grub_crypto_cipher_close (dev->essiv_cipher); - grub_free (dev); + VasEBoot_crypto_cipher_close (dev->cipher); + VasEBoot_crypto_cipher_close (dev->secondary_cipher); + VasEBoot_crypto_cipher_close (dev->essiv_cipher); + VasEBoot_free (dev); } -static grub_err_t -grub_cryptodisk_scan_device_real (const char *name, grub_disk_t source) +static VasEBoot_err_t +VasEBoot_cryptodisk_scan_device_real (const char *name, VasEBoot_disk_t source) { - grub_err_t err; - grub_cryptodisk_t dev; - grub_cryptodisk_dev_t cr; + VasEBoot_err_t err; + VasEBoot_cryptodisk_t dev; + VasEBoot_cryptodisk_dev_t cr; - dev = grub_cryptodisk_get_by_source_disk (source); + dev = VasEBoot_cryptodisk_get_by_source_disk (source); if (dev) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; FOR_CRYPTODISK_DEVS (cr) { dev = cr->scan (source, search_uuid, check_boot); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (!dev) continue; @@ -846,137 +846,137 @@ grub_cryptodisk_scan_device_real (const char *name, grub_disk_t source) return err; } - grub_cryptodisk_insert (dev, name, source); + VasEBoot_cryptodisk_insert (dev, name, source); have_it = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -#ifdef GRUB_UTIL -#include -grub_err_t -grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat) +#ifdef VasEBoot_UTIL +#include +VasEBoot_err_t +VasEBoot_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat) { - grub_err_t err; - grub_cryptodisk_t dev; - grub_cryptodisk_dev_t cr; - grub_disk_t source; + VasEBoot_err_t err; + VasEBoot_cryptodisk_t dev; + VasEBoot_cryptodisk_dev_t cr; + VasEBoot_disk_t source; /* Try to open disk. */ - source = grub_disk_open (sourcedev); + source = VasEBoot_disk_open (sourcedev); if (!source) - return grub_errno; + return VasEBoot_errno; - dev = grub_cryptodisk_get_by_source_disk (source); + dev = VasEBoot_cryptodisk_get_by_source_disk (source); if (dev) { - grub_disk_close (source); - return GRUB_ERR_NONE; + VasEBoot_disk_close (source); + return VasEBoot_ERR_NONE; } FOR_CRYPTODISK_DEVS (cr) { dev = cr->scan (source, search_uuid, check_boot); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (!dev) continue; - grub_util_info ("cheatmounted %s (%s) at %s", sourcedev, dev->modname, + VasEBoot_util_info ("cheatmounted %s (%s) at %s", sourcedev, dev->modname, cheat); - err = grub_cryptodisk_cheat_insert (dev, sourcedev, source, cheat); - grub_disk_close (source); + err = VasEBoot_cryptodisk_cheat_insert (dev, sourcedev, source, cheat); + VasEBoot_disk_close (source); if (err) - grub_free (dev); + VasEBoot_free (dev); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - grub_disk_close (source); + VasEBoot_disk_close (source); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif static int -grub_cryptodisk_scan_device (const char *name, +VasEBoot_cryptodisk_scan_device (const char *name, void *data __attribute__ ((unused))) { - grub_err_t err; - grub_disk_t source; + VasEBoot_err_t err; + VasEBoot_disk_t source; /* Try to open disk. */ - source = grub_disk_open (name); + source = VasEBoot_disk_open (name); if (!source) { - grub_print_error (); + VasEBoot_print_error (); return 0; } - err = grub_cryptodisk_scan_device_real (name, source); + err = VasEBoot_cryptodisk_scan_device_real (name, source); - grub_disk_close (source); + VasEBoot_disk_close (source); if (err) - grub_print_error (); + VasEBoot_print_error (); return have_it && search_uuid ? 1 : 0; } -static grub_err_t -grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_cryptomount (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; if (argc < 1 && !state[1].set && !state[2].set) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "device name required"); have_it = 0; if (state[0].set) { - grub_cryptodisk_t dev; + VasEBoot_cryptodisk_t dev; - dev = grub_cryptodisk_get_by_uuid (args[0]); + dev = VasEBoot_cryptodisk_get_by_uuid (args[0]); if (dev) { - grub_dprintf ("cryptodisk", + VasEBoot_dprintf ("cryptodisk", "already mounted as crypto%lu\n", dev->id); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } check_boot = state[2].set; search_uuid = args[0]; - grub_device_iterate (&grub_cryptodisk_scan_device, NULL); + VasEBoot_device_iterate (&VasEBoot_cryptodisk_scan_device, NULL); search_uuid = NULL; if (!have_it) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such cryptodisk found"); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no such cryptodisk found"); + return VasEBoot_ERR_NONE; } else if (state[1].set || (argc == 0 && state[2].set)) { search_uuid = NULL; check_boot = state[2].set; - grub_device_iterate (&grub_cryptodisk_scan_device, NULL); + VasEBoot_device_iterate (&VasEBoot_cryptodisk_scan_device, NULL); search_uuid = NULL; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } else { - grub_err_t err; - grub_disk_t disk; - grub_cryptodisk_t dev; + VasEBoot_err_t err; + VasEBoot_disk_t disk; + VasEBoot_cryptodisk_t dev; char *diskname; char *disklast = NULL; - grub_size_t len; + VasEBoot_size_t len; search_uuid = NULL; check_boot = state[2].set; diskname = args[0]; - len = grub_strlen (diskname); + len = VasEBoot_strlen (diskname); if (len && diskname[0] == '(' && diskname[len - 1] == ')') { disklast = &diskname[len - 1]; @@ -984,27 +984,27 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args) diskname++; } - disk = grub_disk_open (diskname); + disk = VasEBoot_disk_open (diskname); if (!disk) { if (disklast) *disklast = ')'; - return grub_errno; + return VasEBoot_errno; } - dev = grub_cryptodisk_get_by_source_disk (disk); + dev = VasEBoot_cryptodisk_get_by_source_disk (disk); if (dev) { - grub_dprintf ("cryptodisk", "already mounted as crypto%lu\n", dev->id); - grub_disk_close (disk); + VasEBoot_dprintf ("cryptodisk", "already mounted as crypto%lu\n", dev->id); + VasEBoot_disk_close (disk); if (disklast) *disklast = ')'; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - err = grub_cryptodisk_scan_device_real (diskname, disk); + err = VasEBoot_cryptodisk_scan_device_real (diskname, disk); - grub_disk_close (disk); + VasEBoot_disk_close (disk); if (disklast) *disklast = ')'; @@ -1012,22 +1012,22 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args) } } -static struct grub_disk_dev grub_cryptodisk_dev = { +static struct VasEBoot_disk_dev VasEBoot_cryptodisk_dev = { .name = "cryptodisk", - .id = GRUB_DISK_DEVICE_CRYPTODISK_ID, - .iterate = grub_cryptodisk_iterate, - .open = grub_cryptodisk_open, - .close = grub_cryptodisk_close, - .read = grub_cryptodisk_read, - .write = grub_cryptodisk_write, -#ifdef GRUB_UTIL - .memberlist = grub_cryptodisk_memberlist, + .id = VasEBoot_DISK_DEVICE_CRYPTODISK_ID, + .iterate = VasEBoot_cryptodisk_iterate, + .open = VasEBoot_cryptodisk_open, + .close = VasEBoot_cryptodisk_close, + .read = VasEBoot_cryptodisk_read, + .write = VasEBoot_cryptodisk_write, +#ifdef VasEBoot_UTIL + .memberlist = VasEBoot_cryptodisk_memberlist, #endif .next = 0 }; static char -hex (grub_uint8_t val) +hex (VasEBoot_uint8_t val) { if (val < 10) return '0' + val; @@ -1036,84 +1036,84 @@ hex (grub_uint8_t val) /* Open a file named NAME and initialize FILE. */ static char * -luks_script_get (grub_size_t *sz) +luks_script_get (VasEBoot_size_t *sz) { - grub_cryptodisk_t i; - grub_size_t size = 0; + VasEBoot_cryptodisk_t i; + VasEBoot_size_t size = 0; char *ptr, *ret; *sz = 0; for (i = cryptodisk_list; i != NULL; i = i->next) - if (grub_strcmp (i->modname, "luks") == 0) + if (VasEBoot_strcmp (i->modname, "luks") == 0) { size += sizeof ("luks_mount "); - size += grub_strlen (i->uuid); - size += grub_strlen (i->cipher->cipher->name); + size += VasEBoot_strlen (i->uuid); + size += VasEBoot_strlen (i->cipher->cipher->name); size += 54; if (i->essiv_hash) - size += grub_strlen (i->essiv_hash->name); + size += VasEBoot_strlen (i->essiv_hash->name); size += i->keysize * 2; } - ret = grub_malloc (size + 1); + ret = VasEBoot_malloc (size + 1); if (!ret) return 0; ptr = ret; for (i = cryptodisk_list; i != NULL; i = i->next) - if (grub_strcmp (i->modname, "luks") == 0) + if (VasEBoot_strcmp (i->modname, "luks") == 0) { unsigned j; const char *iptr; - ptr = grub_stpcpy (ptr, "luks_mount "); - ptr = grub_stpcpy (ptr, i->uuid); + ptr = VasEBoot_stpcpy (ptr, "luks_mount "); + ptr = VasEBoot_stpcpy (ptr, i->uuid); *ptr++ = ' '; - grub_snprintf (ptr, 21, "%" PRIuGRUB_UINT64_T " ", i->offset); + VasEBoot_snprintf (ptr, 21, "%" PRIuVasEBoot_UINT64_T " ", i->offset); while (*ptr) ptr++; for (iptr = i->cipher->cipher->name; *iptr; iptr++) - *ptr++ = grub_tolower (*iptr); + *ptr++ = VasEBoot_tolower (*iptr); switch (i->mode) { - case GRUB_CRYPTODISK_MODE_ECB: - ptr = grub_stpcpy (ptr, "-ecb"); + case VasEBoot_CRYPTODISK_MODE_ECB: + ptr = VasEBoot_stpcpy (ptr, "-ecb"); break; - case GRUB_CRYPTODISK_MODE_CBC: - ptr = grub_stpcpy (ptr, "-cbc"); + case VasEBoot_CRYPTODISK_MODE_CBC: + ptr = VasEBoot_stpcpy (ptr, "-cbc"); break; - case GRUB_CRYPTODISK_MODE_PCBC: - ptr = grub_stpcpy (ptr, "-pcbc"); + case VasEBoot_CRYPTODISK_MODE_PCBC: + ptr = VasEBoot_stpcpy (ptr, "-pcbc"); break; - case GRUB_CRYPTODISK_MODE_XTS: - ptr = grub_stpcpy (ptr, "-xts"); + case VasEBoot_CRYPTODISK_MODE_XTS: + ptr = VasEBoot_stpcpy (ptr, "-xts"); break; - case GRUB_CRYPTODISK_MODE_LRW: - ptr = grub_stpcpy (ptr, "-lrw"); + case VasEBoot_CRYPTODISK_MODE_LRW: + ptr = VasEBoot_stpcpy (ptr, "-lrw"); break; } switch (i->mode_iv) { - case GRUB_CRYPTODISK_MODE_IV_NULL: - ptr = grub_stpcpy (ptr, "-null"); + case VasEBoot_CRYPTODISK_MODE_IV_NULL: + ptr = VasEBoot_stpcpy (ptr, "-null"); break; - case GRUB_CRYPTODISK_MODE_IV_PLAIN: - ptr = grub_stpcpy (ptr, "-plain"); + case VasEBoot_CRYPTODISK_MODE_IV_PLAIN: + ptr = VasEBoot_stpcpy (ptr, "-plain"); break; - case GRUB_CRYPTODISK_MODE_IV_PLAIN64: - ptr = grub_stpcpy (ptr, "-plain64"); + case VasEBoot_CRYPTODISK_MODE_IV_PLAIN64: + ptr = VasEBoot_stpcpy (ptr, "-plain64"); break; - case GRUB_CRYPTODISK_MODE_IV_BENBI: - ptr = grub_stpcpy (ptr, "-benbi"); + case VasEBoot_CRYPTODISK_MODE_IV_BENBI: + ptr = VasEBoot_stpcpy (ptr, "-benbi"); break; - case GRUB_CRYPTODISK_MODE_IV_ESSIV: - ptr = grub_stpcpy (ptr, "-essiv:"); - ptr = grub_stpcpy (ptr, i->essiv_hash->name); + case VasEBoot_CRYPTODISK_MODE_IV_ESSIV: + ptr = VasEBoot_stpcpy (ptr, "-essiv:"); + ptr = VasEBoot_stpcpy (ptr, i->essiv_hash->name); break; - case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64: - case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH: + case VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64: + case VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH: break; } *ptr++ = ' '; @@ -1129,26 +1129,26 @@ luks_script_get (grub_size_t *sz) return ret; } -struct grub_procfs_entry luks_script = +struct VasEBoot_procfs_entry luks_script = { .name = "luks_script", .get_contents = luks_script_get }; -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT (cryptodisk) +VasEBoot_MOD_INIT (cryptodisk) { - grub_disk_dev_register (&grub_cryptodisk_dev); - cmd = grub_register_extcmd ("cryptomount", grub_cmd_cryptomount, 0, + VasEBoot_disk_dev_register (&VasEBoot_cryptodisk_dev); + cmd = VasEBoot_register_extcmd ("cryptomount", VasEBoot_cmd_cryptomount, 0, N_("SOURCE|-u UUID|-a|-b"), N_("Mount a crypto device."), options); - grub_procfs_register ("luks_script", &luks_script); + VasEBoot_procfs_register ("luks_script", &luks_script); } -GRUB_MOD_FINI (cryptodisk) +VasEBoot_MOD_FINI (cryptodisk) { - grub_disk_dev_unregister (&grub_cryptodisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_cryptodisk_dev); cryptodisk_cleanup (); - grub_procfs_unregister (&luks_script); + VasEBoot_procfs_unregister (&luks_script); } diff --git a/VasEBoot-core/disk/diskfilter.c b/VasEBoot-core/disk/diskfilter.c index 6f901c0ad..2c6d48d99 100644 --- a/VasEBoot-core/disk/diskfilter.c +++ b/VasEBoot-core/disk/diskfilter.c @@ -1,52 +1,52 @@ /* diskfilter.c - module to read RAID arrays. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- 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 + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#ifdef GRUB_UTIL -#include -#include +#include +#include +#include +#include +#include +#include +#include +#ifdef VasEBoot_UTIL +#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Linked list of DISKFILTER arrays. */ -static struct grub_diskfilter_vg *array_list; -grub_raid5_recover_func_t grub_raid5_recover_func; -grub_raid6_recover_func_t grub_raid6_recover_func; -grub_diskfilter_t grub_diskfilter_list; +static struct VasEBoot_diskfilter_vg *array_list; +VasEBoot_raid5_recover_func_t VasEBoot_raid5_recover_func; +VasEBoot_raid6_recover_func_t VasEBoot_raid6_recover_func; +VasEBoot_diskfilter_t VasEBoot_diskfilter_list; static int inscnt = 0; static int lv_num = 0; -static struct grub_diskfilter_lv * +static struct VasEBoot_diskfilter_lv * find_lv (const char *name); -static int is_lv_readable (struct grub_diskfilter_lv *lv, int easily); +static int is_lv_readable (struct VasEBoot_diskfilter_lv *lv, int easily); -static grub_err_t -is_node_readable (const struct grub_diskfilter_node *node, int easily) +static VasEBoot_err_t +is_node_readable (const struct VasEBoot_diskfilter_node *node, int easily) { /* Check whether we actually know the physical volume we want to read from. */ @@ -58,7 +58,7 @@ is_node_readable (const struct grub_diskfilter_node *node, int easily) } static int -is_lv_readable (struct grub_diskfilter_lv *lv, int easily) +is_lv_readable (struct VasEBoot_diskfilter_lv *lv, int easily) { unsigned i, j; if (!lv) @@ -68,23 +68,23 @@ is_lv_readable (struct grub_diskfilter_lv *lv, int easily) int need = lv->segments[i].node_count, have = 0; switch (lv->segments[i].type) { - case GRUB_DISKFILTER_RAID6: + case VasEBoot_DISKFILTER_RAID6: if (!easily) need--; /* Fallthrough. */ - case GRUB_DISKFILTER_RAID4: - case GRUB_DISKFILTER_RAID5: + case VasEBoot_DISKFILTER_RAID4: + case VasEBoot_DISKFILTER_RAID5: if (!easily) need--; /* Fallthrough. */ - case GRUB_DISKFILTER_STRIPED: + case VasEBoot_DISKFILTER_STRIPED: break; - case GRUB_DISKFILTER_MIRROR: + case VasEBoot_DISKFILTER_MIRROR: need = 1; break; - case GRUB_DISKFILTER_RAID10: + case VasEBoot_DISKFILTER_RAID10: { unsigned int n; n = lv->segments[i].layout & 0xFF; @@ -108,54 +108,54 @@ is_lv_readable (struct grub_diskfilter_lv *lv, int easily) return 1; } -static grub_err_t -insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id, - struct grub_diskfilter_vg *array, - grub_disk_addr_t start_sector, - grub_diskfilter_t diskfilter __attribute__ ((unused))); +static VasEBoot_err_t +insert_array (VasEBoot_disk_t disk, const struct VasEBoot_diskfilter_pv_id *id, + struct VasEBoot_diskfilter_vg *array, + VasEBoot_disk_addr_t start_sector, + VasEBoot_diskfilter_t diskfilter __attribute__ ((unused))); static int is_valid_diskfilter_name (const char *name) { - return (grub_memcmp (name, "md", sizeof ("md") - 1) == 0 - || grub_memcmp (name, "lvm/", sizeof ("lvm/") - 1) == 0 - || grub_memcmp (name, "lvmid/", sizeof ("lvmid/") - 1) == 0 - || grub_memcmp (name, "ldm/", sizeof ("ldm/") - 1) == 0); + return (VasEBoot_memcmp (name, "md", sizeof ("md") - 1) == 0 + || VasEBoot_memcmp (name, "lvm/", sizeof ("lvm/") - 1) == 0 + || VasEBoot_memcmp (name, "lvmid/", sizeof ("lvmid/") - 1) == 0 + || VasEBoot_memcmp (name, "ldm/", sizeof ("ldm/") - 1) == 0); } /* Helper for scan_disk. */ static int -scan_disk_partition_iter (grub_disk_t disk, grub_partition_t p, void *data) +scan_disk_partition_iter (VasEBoot_disk_t disk, VasEBoot_partition_t p, void *data) { const char *name = data; - struct grub_diskfilter_vg *arr; - grub_disk_addr_t start_sector; - struct grub_diskfilter_pv_id id; - grub_diskfilter_t diskfilter; + struct VasEBoot_diskfilter_vg *arr; + VasEBoot_disk_addr_t start_sector; + struct VasEBoot_diskfilter_pv_id id; + VasEBoot_diskfilter_t diskfilter; - grub_dprintf ("diskfilter", "Scanning for DISKFILTER devices on disk %s\n", + VasEBoot_dprintf ("diskfilter", "Scanning for DISKFILTER devices on disk %s\n", name); -#ifdef GRUB_UTIL - grub_util_info ("Scanning for DISKFILTER devices on disk %s", name); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("Scanning for DISKFILTER devices on disk %s", name); #endif disk->partition = p; for (arr = array_list; arr != NULL; arr = arr->next) { - struct grub_diskfilter_pv *m; + struct VasEBoot_diskfilter_pv *m; for (m = arr->pvs; m; m = m->next) if (m->disk && m->disk->id == disk->id && m->disk->dev->id == disk->dev->id - && m->part_start == grub_partition_get_start (disk->partition) - && m->part_size == grub_disk_get_size (disk)) + && m->part_start == VasEBoot_partition_get_start (disk->partition) + && m->part_size == VasEBoot_disk_get_size (disk)) return 0; } - for (diskfilter = grub_diskfilter_list; diskfilter; diskfilter = diskfilter->next) + for (diskfilter = VasEBoot_diskfilter_list; diskfilter; diskfilter = diskfilter->next) { -#ifdef GRUB_UTIL - grub_util_info ("Scanning for %s devices on disk %s", +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("Scanning for %s devices on disk %s", diskfilter->name, name); #endif id.uuid = 0; @@ -165,18 +165,18 @@ scan_disk_partition_iter (grub_disk_t disk, grub_partition_t p, void *data) (! insert_array (disk, &id, arr, start_sector, diskfilter))) { if (id.uuidlen) - grub_free (id.uuid); + VasEBoot_free (id.uuid); return 0; } if (arr && id.uuidlen) - grub_free (id.uuid); + VasEBoot_free (id.uuid); /* This error usually means it's not diskfilter, no need to display it. */ - if (grub_errno != GRUB_ERR_OUT_OF_RANGE) - grub_print_error (); + if (VasEBoot_errno != VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } return 0; @@ -185,7 +185,7 @@ scan_disk_partition_iter (grub_disk_t disk, grub_partition_t p, void *data) static int scan_disk (const char *name, int accept_diskfilter) { - grub_disk_t disk; + VasEBoot_disk_t disk; static int scan_depth = 0; if (!accept_diskfilter && is_valid_diskfilter_name (name)) @@ -195,16 +195,16 @@ scan_disk (const char *name, int accept_diskfilter) return 0; scan_depth++; - disk = grub_disk_open (name); + disk = VasEBoot_disk_open (name); if (!disk) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; scan_depth--; return 0; } scan_disk_partition_iter (disk, 0, (void *) name); - grub_partition_iterate (disk, scan_disk_partition_iter, (void *) name); - grub_disk_close (disk); + VasEBoot_partition_iterate (disk, scan_disk_partition_iter, (void *) name); + VasEBoot_disk_close (disk); scan_depth--; return 0; } @@ -218,16 +218,16 @@ scan_disk_hook (const char *name, void *data __attribute__ ((unused))) static void scan_devices (const char *arname) { - grub_disk_dev_t p; - grub_disk_pull_t pull; - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_lv *lv = NULL; + VasEBoot_disk_dev_t p; + VasEBoot_disk_pull_t pull; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_lv *lv = NULL; int scan_depth; int need_rescan; - for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++) - for (p = grub_disk_dev_list; p; p = p->next) - if (p->id != GRUB_DISK_DEVICE_DISKFILTER_ID + for (pull = 0; pull < VasEBoot_DISK_PULL_MAX; pull++) + for (p = VasEBoot_disk_dev_list; p; p = p->next) + if (p->id != VasEBoot_DISK_DEVICE_DISKFILTER_ID && p->iterate) { if ((p->iterate) (scan_disk_hook, NULL, pull)) @@ -255,28 +255,28 @@ scan_devices (const char *arname) } if (need_rescan) - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "DISKFILTER scan depth exceeded"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "DISKFILTER scan depth exceeded"); } static int -grub_diskfilter_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_diskfilter_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_diskfilter_vg *array; + struct VasEBoot_diskfilter_vg *array; int islcnt = 0; - if (pull == GRUB_DISK_PULL_RESCAN) + if (pull == VasEBoot_DISK_PULL_RESCAN) { islcnt = inscnt + 1; scan_devices (NULL); } - if (pull != GRUB_DISK_PULL_NONE && pull != GRUB_DISK_PULL_RESCAN) + if (pull != VasEBoot_DISK_PULL_NONE && pull != VasEBoot_DISK_PULL_RESCAN) return 0; for (array = array_list; array; array = array->next) { - struct grub_diskfilter_lv *lv; + struct VasEBoot_diskfilter_lv *lv; if (array->lvs) for (lv = array->lvs; lv; lv = lv->next) if (lv->visible && lv->fullname && lv->became_readable_at >= islcnt) @@ -289,17 +289,17 @@ grub_diskfilter_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -#ifdef GRUB_UTIL -static grub_disk_memberlist_t -grub_diskfilter_memberlist (grub_disk_t disk) +#ifdef VasEBoot_UTIL +static VasEBoot_disk_memberlist_t +VasEBoot_diskfilter_memberlist (VasEBoot_disk_t disk) { - struct grub_diskfilter_lv *lv = disk->data; - grub_disk_memberlist_t list = NULL, tmp; - struct grub_diskfilter_pv *pv; - grub_disk_pull_t pull; - grub_disk_dev_t p; - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_lv *lv2 = NULL; + struct VasEBoot_diskfilter_lv *lv = disk->data; + VasEBoot_disk_memberlist_t list = NULL, tmp; + struct VasEBoot_diskfilter_pv *pv; + VasEBoot_disk_pull_t pull; + VasEBoot_disk_dev_t p; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_lv *lv2 = NULL; if (!lv->vg->pvs) return NULL; @@ -308,9 +308,9 @@ grub_diskfilter_memberlist (grub_disk_t disk) while (pv && pv->disk) pv = pv->next; - for (pull = 0; pv && pull < GRUB_DISK_PULL_MAX; pull++) - for (p = grub_disk_dev_list; pv && p; p = p->next) - if (p->id != GRUB_DISK_DEVICE_DISKFILTER_ID + for (pull = 0; pv && pull < VasEBoot_DISK_PULL_MAX; pull++) + for (p = VasEBoot_disk_dev_list; pv && p; p = p->next) + if (p->id != VasEBoot_DISK_DEVICE_DISKFILTER_ID && p->iterate) { (p->iterate) (scan_disk_hook, NULL, pull); @@ -340,12 +340,12 @@ grub_diskfilter_memberlist (grub_disk_t disk) in the case of degraded RAID and means that autodetection may fail to include some of modules. It's an installation time message, not runtime message. */ - grub_util_warn (_("Couldn't find physical volume `%s'." + VasEBoot_util_warn (_("Couldn't find physical volume `%s'." " Some modules may be missing from core image."), pv->name); continue; } - tmp = grub_malloc (sizeof (*tmp)); + tmp = VasEBoot_malloc (sizeof (*tmp)); tmp->disk = pv->disk; tmp->next = list; list = tmp; @@ -355,17 +355,17 @@ grub_diskfilter_memberlist (grub_disk_t disk) } void -grub_diskfilter_get_partmap (grub_disk_t disk, +VasEBoot_diskfilter_get_partmap (VasEBoot_disk_t disk, void (*cb) (const char *pm, void *data), void *data) { - struct grub_diskfilter_lv *lv = disk->data; - struct grub_diskfilter_pv *pv; + struct VasEBoot_diskfilter_lv *lv = disk->data; + struct VasEBoot_diskfilter_pv *pv; if (lv->vg->pvs) for (pv = lv->vg->pvs; pv; pv = pv->next) { - grub_size_t s; + VasEBoot_size_t s; if (!pv->disk) { /* TRANSLATORS: This message kicks in during the detection of @@ -373,7 +373,7 @@ grub_diskfilter_get_partmap (grub_disk_t disk, in the case of degraded RAID and means that autodetection may fail to include some of modules. It's an installation time message, not runtime message. */ - grub_util_warn (_("Couldn't find physical volume `%s'." + VasEBoot_util_warn (_("Couldn't find physical volume `%s'." " Some modules may be missing from core image."), pv->name); continue; @@ -384,9 +384,9 @@ grub_diskfilter_get_partmap (grub_disk_t disk, } static const char * -grub_diskfilter_getname (struct grub_disk *disk) +VasEBoot_diskfilter_getname (struct VasEBoot_disk *disk) { - struct grub_diskfilter_lv *array = disk->data; + struct VasEBoot_diskfilter_lv *array = disk->data; return array->vg->driver->name; } @@ -400,31 +400,31 @@ hex2ascii (int c) return c + '0'; } -static struct grub_diskfilter_lv * +static struct VasEBoot_diskfilter_lv * find_lv (const char *name) { - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_lv *lv = NULL; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_lv *lv = NULL; for (vg = array_list; vg; vg = vg->next) { if (vg->lvs) for (lv = vg->lvs; lv; lv = lv->next) - if (((lv->fullname && grub_strcmp (lv->fullname, name) == 0) - || (lv->idname && grub_strcmp (lv->idname, name) == 0)) + if (((lv->fullname && VasEBoot_strcmp (lv->fullname, name) == 0) + || (lv->idname && VasEBoot_strcmp (lv->idname, name) == 0)) && is_lv_readable (lv, 0)) return lv; } return NULL; } -static grub_err_t -grub_diskfilter_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_diskfilter_open (const char *name, VasEBoot_disk_t disk) { - struct grub_diskfilter_lv *lv; + struct VasEBoot_diskfilter_lv *lv; if (!is_valid_diskfilter_name (name)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown DISKFILTER device %s", + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown DISKFILTER device %s", name); lv = find_lv (name); @@ -432,135 +432,135 @@ grub_diskfilter_open (const char *name, grub_disk_t disk) if (! lv) { scan_devices (name); - if (grub_errno) + if (VasEBoot_errno) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } lv = find_lv (name); } if (!lv) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown DISKFILTER device %s", + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown DISKFILTER device %s", name); disk->id = lv->number; disk->data = lv; disk->total_sectors = lv->size; - disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; + disk->max_agglomerate = VasEBoot_DISK_MAX_MAX_AGGLOMERATE; return 0; } static void -grub_diskfilter_close (grub_disk_t disk __attribute ((unused))) +VasEBoot_diskfilter_close (VasEBoot_disk_t disk __attribute ((unused))) { return; } -static grub_err_t -read_lv (struct grub_diskfilter_lv *lv, grub_disk_addr_t sector, - grub_size_t size, char *buf); +static VasEBoot_err_t +read_lv (struct VasEBoot_diskfilter_lv *lv, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf); -grub_err_t -grub_diskfilter_read_node (const struct grub_diskfilter_node *node, - grub_disk_addr_t sector, - grub_size_t size, char *buf) +VasEBoot_err_t +VasEBoot_diskfilter_read_node (const struct VasEBoot_diskfilter_node *node, + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { /* Check whether we actually know the physical volume we want to read from. */ if (node->pv) { if (node->pv->disk) - return grub_disk_read (node->pv->disk, sector + node->start + return VasEBoot_disk_read (node->pv->disk, sector + node->start + node->pv->start_sector, - 0, size << GRUB_DISK_SECTOR_BITS, buf); + 0, size << VasEBoot_DISK_SECTOR_BITS, buf); else - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("physical volume %s not found"), node->pv->name); } if (node->lv) return read_lv (node->lv, sector + node->start, size, buf); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name); } -static grub_err_t -validate_segment (struct grub_diskfilter_segment *seg); +static VasEBoot_err_t +validate_segment (struct VasEBoot_diskfilter_segment *seg); -static grub_err_t -validate_lv (struct grub_diskfilter_lv *lv) +static VasEBoot_err_t +validate_lv (struct VasEBoot_diskfilter_lv *lv) { unsigned int i; if (!lv) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown volume"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown volume"); if (!lv->vg || lv->vg->extent_size == 0) - return grub_error (GRUB_ERR_READ_ERROR, "invalid volume"); + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "invalid volume"); for (i = 0; i < lv->segment_count; i++) { - grub_err_t err; + VasEBoot_err_t err; err = validate_segment (&lv->segments[i]); if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -validate_node (const struct grub_diskfilter_node *node) +static VasEBoot_err_t +validate_node (const struct VasEBoot_diskfilter_node *node) { /* Check whether we actually know the physical volume we want to read from. */ if (node->pv) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (node->lv) return validate_lv (node->lv); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name); } -static grub_err_t -validate_segment (struct grub_diskfilter_segment *seg) +static VasEBoot_err_t +validate_segment (struct VasEBoot_diskfilter_segment *seg) { - grub_err_t err; + VasEBoot_err_t err; if (seg->stripe_size == 0 || seg->node_count == 0) - return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "invalid segment"); switch (seg->type) { - case GRUB_DISKFILTER_RAID10: + case VasEBoot_DISKFILTER_RAID10: { - grub_uint8_t near, far; + VasEBoot_uint8_t near, far; near = seg->layout & 0xFF; far = (seg->layout >> 8) & 0xFF; if ((seg->layout >> 16) == 0 && far == 0) - return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "invalid segment"); if (near > seg->node_count) - return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "invalid segment"); break; } - case GRUB_DISKFILTER_STRIPED: - case GRUB_DISKFILTER_MIRROR: + case VasEBoot_DISKFILTER_STRIPED: + case VasEBoot_DISKFILTER_MIRROR: break; - case GRUB_DISKFILTER_RAID4: - case GRUB_DISKFILTER_RAID5: + case VasEBoot_DISKFILTER_RAID4: + case VasEBoot_DISKFILTER_RAID5: if (seg->node_count <= 1) - return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "invalid segment"); break; - case GRUB_DISKFILTER_RAID6: + case VasEBoot_DISKFILTER_RAID6: if (seg->node_count <= 2) - return grub_error(GRUB_ERR_BAD_FS, "invalid segment"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "invalid segment"); break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported RAID level %d", seg->type); } @@ -571,30 +571,30 @@ validate_segment (struct grub_diskfilter_segment *seg) if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +read_segment (struct VasEBoot_diskfilter_segment *seg, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_err_t err; + VasEBoot_err_t err; switch (seg->type) { - case GRUB_DISKFILTER_STRIPED: + case VasEBoot_DISKFILTER_STRIPED: if (seg->node_count == 1) - return grub_diskfilter_read_node (&seg->nodes[0], + return VasEBoot_diskfilter_read_node (&seg->nodes[0], sector, size, buf); /* Fallthrough. */ - case GRUB_DISKFILTER_MIRROR: - case GRUB_DISKFILTER_RAID10: + case VasEBoot_DISKFILTER_MIRROR: + case VasEBoot_DISKFILTER_RAID10: { - grub_disk_addr_t read_sector, far_ofs; - grub_uint64_t disknr, b, near, far, ofs; + VasEBoot_disk_addr_t read_sector, far_ofs; + VasEBoot_uint64_t disknr, b, near, far, ofs; unsigned int i, j; - read_sector = grub_divmod64 (sector, seg->stripe_size, &b); + read_sector = VasEBoot_divmod64 (sector, seg->stripe_size, &b); far = ofs = near = 1; far_ofs = 0; @@ -610,13 +610,13 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, far_ofs = 1; } else - far_ofs = grub_divmod64 (seg->raid_member_size, + far_ofs = VasEBoot_divmod64 (seg->raid_member_size, far * seg->stripe_size, 0); far_ofs *= seg->stripe_size; } - read_sector = grub_divmod64 (read_sector * near, + read_sector = VasEBoot_divmod64 (read_sector * near, seg->node_count, &disknr); @@ -625,7 +625,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, while (1) { - grub_size_t read_size; + VasEBoot_size_t read_size; read_size = seg->stripe_size - b; if (read_size > size) @@ -640,19 +640,19 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, err = 0; for (j = 0; j < far; j++) { - if (grub_errno == GRUB_ERR_READ_ERROR - || grub_errno == GRUB_ERR_UNKNOWN_DEVICE) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_READ_ERROR + || VasEBoot_errno == VasEBoot_ERR_UNKNOWN_DEVICE) + VasEBoot_errno = VasEBoot_ERR_NONE; - err = grub_diskfilter_read_node (&seg->nodes[k], + err = VasEBoot_diskfilter_read_node (&seg->nodes[k], read_sector + j * far_ofs + b, read_size, buf); if (! err) break; - else if (err != GRUB_ERR_READ_ERROR - && err != GRUB_ERR_UNKNOWN_DEVICE) + else if (err != VasEBoot_ERR_READ_ERROR + && err != VasEBoot_ERR_UNKNOWN_DEVICE) return err; k++; if (k == seg->node_count) @@ -673,10 +673,10 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, if (err) return err; - buf += read_size << GRUB_DISK_SECTOR_BITS; + buf += read_size << VasEBoot_DISK_SECTOR_BITS; size -= read_size; if (! size) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; b = 0; disknr += (near - i); @@ -688,34 +688,34 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, } } - case GRUB_DISKFILTER_RAID4: - case GRUB_DISKFILTER_RAID5: - case GRUB_DISKFILTER_RAID6: + case VasEBoot_DISKFILTER_RAID4: + case VasEBoot_DISKFILTER_RAID5: + case VasEBoot_DISKFILTER_RAID6: { - grub_disk_addr_t read_sector; - grub_uint64_t b, p, n, disknr, e; + VasEBoot_disk_addr_t read_sector; + VasEBoot_uint64_t b, p, n, disknr, e; /* n = 1 for level 4 and 5, 2 for level 6. */ n = seg->type / 3; /* Find the first sector to read. */ - read_sector = grub_divmod64 (sector, seg->stripe_size, &b); - read_sector = grub_divmod64 (read_sector, seg->node_count - n, + read_sector = VasEBoot_divmod64 (sector, seg->stripe_size, &b); + read_sector = VasEBoot_divmod64 (read_sector, seg->node_count - n, &disknr); if (seg->type >= 5) { - grub_divmod64 (read_sector, seg->node_count, &p); + VasEBoot_divmod64 (read_sector, seg->node_count, &p); - if (! (seg->layout & GRUB_RAID_LAYOUT_RIGHT_MASK)) + if (! (seg->layout & VasEBoot_RAID_LAYOUT_RIGHT_MASK)) p = seg->node_count - 1 - p; - if (seg->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + if (seg->layout & VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK) { disknr += p + n; } else { - grub_uint32_t q; + VasEBoot_uint32_t q; q = p + (n - 1); if (q >= seg->node_count) @@ -736,7 +736,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, while (1) { - grub_size_t read_size; + VasEBoot_size_t read_size; int next_level; read_size = seg->stripe_size - b; @@ -745,40 +745,40 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, e = 0; /* Reset read error. */ - if (grub_errno == GRUB_ERR_READ_ERROR - || grub_errno == GRUB_ERR_UNKNOWN_DEVICE) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_READ_ERROR + || VasEBoot_errno == VasEBoot_ERR_UNKNOWN_DEVICE) + VasEBoot_errno = VasEBoot_ERR_NONE; - err = grub_diskfilter_read_node (&seg->nodes[disknr], + err = VasEBoot_diskfilter_read_node (&seg->nodes[disknr], read_sector + b, read_size, buf); - if ((err) && (err != GRUB_ERR_READ_ERROR - && err != GRUB_ERR_UNKNOWN_DEVICE)) + if ((err) && (err != VasEBoot_ERR_READ_ERROR + && err != VasEBoot_ERR_UNKNOWN_DEVICE)) return err; e++; if (err) { - grub_errno = GRUB_ERR_NONE; - if (seg->type == GRUB_DISKFILTER_RAID6) + VasEBoot_errno = VasEBoot_ERR_NONE; + if (seg->type == VasEBoot_DISKFILTER_RAID6) { - err = ((grub_raid6_recover_func) ? - (*grub_raid6_recover_func) (seg, disknr, p, + err = ((VasEBoot_raid6_recover_func) ? + (*VasEBoot_raid6_recover_func) (seg, disknr, p, buf, read_sector + b, read_size) : - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("module `%s' isn't loaded"), "raid6rec")); } else { - err = ((grub_raid5_recover_func) ? - (*grub_raid5_recover_func) (seg, disknr, + err = ((VasEBoot_raid5_recover_func) ? + (*VasEBoot_raid5_recover_func) (seg, disknr, buf, read_sector + b, read_size) : - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("module `%s' isn't loaded"), "raid5rec")); } @@ -787,7 +787,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, return err; } - buf += read_size << GRUB_DISK_SECTOR_BITS; + buf += read_size << VasEBoot_DISK_SECTOR_BITS; size -= read_size; sector += read_size; if (! size) @@ -796,7 +796,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, b = 0; disknr++; - if (seg->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + if (seg->layout & VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK) { if (disknr == seg->node_count) disknr = 0; @@ -817,12 +817,12 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, if (seg->type >= 5) { - if (seg->layout & GRUB_RAID_LAYOUT_RIGHT_MASK) + if (seg->layout & VasEBoot_RAID_LAYOUT_RIGHT_MASK) p = (p == seg->node_count - 1) ? 0 : p + 1; else p = (p == 0) ? seg->node_count - 1 : p - 1; - if (seg->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + if (seg->layout & VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK) { disknr = p + n; if (disknr >= seg->node_count) @@ -844,29 +844,29 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported RAID level %d", seg->type); } } -static grub_err_t -read_lv (struct grub_diskfilter_lv *lv, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +read_lv (struct VasEBoot_diskfilter_lv *lv, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { if (!lv) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown volume"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown volume"); while (size) { - grub_err_t err = 0; - struct grub_diskfilter_vg *vg = lv->vg; - struct grub_diskfilter_segment *seg = lv->segments; - grub_uint64_t extent; - grub_uint64_t to_read; + VasEBoot_err_t err = 0; + struct VasEBoot_diskfilter_vg *vg = lv->vg; + struct VasEBoot_diskfilter_segment *seg = lv->segments; + VasEBoot_uint64_t extent; + VasEBoot_uint64_t to_read; - extent = grub_divmod64 (sector, vg->extent_size, NULL); + extent = VasEBoot_divmod64 (sector, vg->extent_size, NULL); /* Find the right segment. */ { @@ -879,7 +879,7 @@ read_lv (struct grub_diskfilter_lv *lv, grub_disk_addr_t sector, seg++; } if (i == lv->segment_count) - return grub_error (GRUB_ERR_READ_ERROR, "incorrect segment"); + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "incorrect segment"); } to_read = ((seg->start_extent + seg->extent_count) * vg->extent_size) - sector; @@ -893,55 +893,55 @@ read_lv (struct grub_diskfilter_lv *lv, grub_disk_addr_t sector, size -= to_read; sector += to_read; - buf += to_read << GRUB_DISK_SECTOR_BITS; + buf += to_read << VasEBoot_DISK_SECTOR_BITS; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_diskfilter_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_diskfilter_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { return read_lv (disk->data, sector, size, buf); } -static grub_err_t -grub_diskfilter_write (grub_disk_t disk __attribute ((unused)), - grub_disk_addr_t sector __attribute ((unused)), - grub_size_t size __attribute ((unused)), +static VasEBoot_err_t +VasEBoot_diskfilter_write (VasEBoot_disk_t disk __attribute ((unused)), + VasEBoot_disk_addr_t sector __attribute ((unused)), + VasEBoot_size_t size __attribute ((unused)), const char *buf __attribute ((unused))) { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "diskfilter writes are not supported"); } -struct grub_diskfilter_vg * -grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid) +struct VasEBoot_diskfilter_vg * +VasEBoot_diskfilter_get_vg_by_uuid (VasEBoot_size_t uuidlen, char *uuid) { - struct grub_diskfilter_vg *p; + struct VasEBoot_diskfilter_vg *p; for (p = array_list; p != NULL; p = p->next) if ((p->uuid_len == uuidlen) && - (! grub_memcmp (p->uuid, uuid, p->uuid_len))) + (! VasEBoot_memcmp (p->uuid, uuid, p->uuid_len))) return p; return NULL; } -grub_err_t -grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) +VasEBoot_err_t +VasEBoot_diskfilter_vg_register (struct VasEBoot_diskfilter_vg *vg) { - struct grub_diskfilter_lv *lv, *p; - struct grub_diskfilter_vg *vgp; + struct VasEBoot_diskfilter_lv *lv, *p; + struct VasEBoot_diskfilter_vg *vgp; unsigned i; - grub_dprintf ("diskfilter", "Found array %s\n", vg->name); -#ifdef GRUB_UTIL - grub_util_info ("Found array %s", vg->name); + VasEBoot_dprintf ("diskfilter", "Found array %s\n", vg->name); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("Found array %s", vg->name); #endif for (lv = vg->lvs; lv; lv = lv->next) { - grub_err_t err; + VasEBoot_err_t err; /* RAID 1 and single-disk RAID 0 don't use a chunksize but code assumes one so set one. */ @@ -949,7 +949,7 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) { if (lv->segments[i].type == 1) lv->segments[i].stripe_size = 64; - if (lv->segments[i].type == GRUB_DISKFILTER_STRIPED + if (lv->segments[i].type == VasEBoot_DISKFILTER_STRIPED && lv->segments[i].node_count == 1 && lv->segments[i].stripe_size == 0) lv->segments[i].stripe_size = 64; @@ -962,9 +962,9 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) if (lv->fullname) { - grub_size_t len; + VasEBoot_size_t len; int max_used_number = 0, need_new_name = 0; - len = grub_strlen (lv->fullname); + len = VasEBoot_strlen (lv->fullname); for (vgp = array_list; vgp; vgp = vgp->next) for (p = vgp->lvs; p; p = p->next) { @@ -972,7 +972,7 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) char *num, *end; if (!p->fullname) continue; - if (grub_strncmp (p->fullname, lv->fullname, len) != 0) + if (VasEBoot_strncmp (p->fullname, lv->fullname, len) != 0) continue; if (p->fullname[len] == 0) { @@ -980,9 +980,9 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) continue; } num = p->fullname + len + 1; - if (!grub_isdigit (num[0])) + if (!VasEBoot_isdigit (num[0])) continue; - cur_num = grub_strtoul (num, &end, 10); + cur_num = VasEBoot_strtoul (num, &end, 10); if (end[0]) continue; if (cur_num > max_used_number) @@ -991,10 +991,10 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) if (need_new_name) { char *tmp; - tmp = grub_xasprintf ("%s_%d", lv->fullname, max_used_number + 1); + tmp = VasEBoot_xasprintf ("%s_%d", lv->fullname, max_used_number + 1); if (!tmp) - return grub_errno; - grub_free (lv->fullname); + return VasEBoot_errno; + VasEBoot_free (lv->fullname); lv->fullname = tmp; } } @@ -1002,21 +1002,21 @@ grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg) /* Add our new array to the list. */ vg->next = array_list; array_list = vg; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_diskfilter_vg * -grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, - const char *name, grub_uint64_t disk_size, - grub_uint64_t stripe_size, +struct VasEBoot_diskfilter_vg * +VasEBoot_diskfilter_make_raid (VasEBoot_size_t uuidlen, char *uuid, int nmemb, + const char *name, VasEBoot_uint64_t disk_size, + VasEBoot_uint64_t stripe_size, int layout, int level) { - struct grub_diskfilter_vg *array; + struct VasEBoot_diskfilter_vg *array; int i; - grub_size_t j; - grub_uint64_t totsize; - struct grub_diskfilter_pv *pv; - grub_err_t err; + VasEBoot_size_t j; + VasEBoot_uint64_t totsize; + struct VasEBoot_diskfilter_pv *pv; + VasEBoot_err_t err; switch (level) { @@ -1032,11 +1032,11 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, n = (layout >> 8) & 0xFF; if (n == 0) { - grub_free (uuid); + VasEBoot_free (uuid); return NULL; } - totsize = grub_divmod64 (nmemb * disk_size, n, 0); + totsize = VasEBoot_divmod64 (nmemb * disk_size, n, 0); } break; @@ -1048,11 +1048,11 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, break; default: - grub_free (uuid); + VasEBoot_free (uuid); return NULL; } - array = grub_diskfilter_get_vg_by_uuid (uuidlen, uuid); + array = VasEBoot_diskfilter_get_vg_by_uuid (uuidlen, uuid); if (array) { if (array->lvs && array->lvs->size < totsize) @@ -1066,13 +1066,13 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, && array->lvs->segments->raid_member_size > disk_size) array->lvs->segments->raid_member_size = disk_size; - grub_free (uuid); + VasEBoot_free (uuid); return array; } - array = grub_zalloc (sizeof (*array)); + array = VasEBoot_zalloc (sizeof (*array)); if (!array) { - grub_free (uuid); + VasEBoot_free (uuid); return NULL; } array->uuid = uuid; @@ -1080,8 +1080,8 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, if (name) { /* Strip off the homehost if present. */ - char *colon = grub_strchr (name, ':'); - char *new_name = grub_xasprintf ("md/%s", + char *colon = VasEBoot_strchr (name, ':'); + char *new_name = VasEBoot_xasprintf ("md/%s", colon ? colon + 1 : name); if (! new_name) @@ -1091,27 +1091,27 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, } array->extent_size = 1; - array->lvs = grub_zalloc (sizeof (*array->lvs)); + array->lvs = VasEBoot_zalloc (sizeof (*array->lvs)); if (!array->lvs) goto fail; array->lvs->segment_count = 1; array->lvs->visible = 1; if (array->name) { - array->lvs->name = grub_strdup (array->name); + array->lvs->name = VasEBoot_strdup (array->name); if (!array->lvs->name) goto fail; - array->lvs->fullname = grub_strdup (array->name); + array->lvs->fullname = VasEBoot_strdup (array->name); if (!array->lvs->fullname) goto fail; } array->lvs->vg = array; - array->lvs->idname = grub_malloc (sizeof ("mduuid/") + 2 * uuidlen); + array->lvs->idname = VasEBoot_malloc (sizeof ("mduuid/") + 2 * uuidlen); if (!array->lvs->idname) goto fail; - grub_memcpy (array->lvs->idname, "mduuid/", sizeof ("mduuid/") - 1); + VasEBoot_memcpy (array->lvs->idname, "mduuid/", sizeof ("mduuid/") - 1); for (j = 0; j < uuidlen; j++) { array->lvs->idname[sizeof ("mduuid/") - 1 + 2 * j] @@ -1123,7 +1123,7 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, array->lvs->size = totsize; - array->lvs->segments = grub_zalloc (sizeof (*array->lvs->segments)); + array->lvs->segments = VasEBoot_zalloc (sizeof (*array->lvs->segments)); if (!array->lvs->segments) goto fail; array->lvs->segments->stripe_size = stripe_size; @@ -1134,11 +1134,11 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, array->lvs->segments->node_count = nmemb; array->lvs->segments->raid_member_size = disk_size; array->lvs->segments->nodes - = grub_zalloc (nmemb * sizeof (array->lvs->segments->nodes[0])); + = VasEBoot_zalloc (nmemb * sizeof (array->lvs->segments->nodes[0])); array->lvs->segments->stripe_size = stripe_size; for (i = 0; i < nmemb; i++) { - pv = grub_zalloc (sizeof (*pv)); + pv = VasEBoot_zalloc (sizeof (*pv)); if (!pv) goto fail; pv->id.uuidlen = 0; @@ -1148,7 +1148,7 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, array->lvs->segments->nodes[i].pv = pv; } - err = grub_diskfilter_vg_register (array); + err = VasEBoot_diskfilter_vg_register (array); if (err) goto fail; @@ -1157,45 +1157,45 @@ grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, fail: if (array->lvs) { - grub_free (array->lvs->name); - grub_free (array->lvs->fullname); - grub_free (array->lvs->idname); + VasEBoot_free (array->lvs->name); + VasEBoot_free (array->lvs->fullname); + VasEBoot_free (array->lvs->idname); if (array->lvs->segments) { - grub_free (array->lvs->segments->nodes); - grub_free (array->lvs->segments); + VasEBoot_free (array->lvs->segments->nodes); + VasEBoot_free (array->lvs->segments); } - grub_free (array->lvs); + VasEBoot_free (array->lvs); } while (array->pvs) { pv = array->pvs->next; - grub_free (array->pvs); + VasEBoot_free (array->pvs); array->pvs = pv; } - grub_free (array->name); - grub_free (array->uuid); - grub_free (array); + VasEBoot_free (array->name); + VasEBoot_free (array->uuid); + VasEBoot_free (array); return NULL; } -static grub_err_t -insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id, - struct grub_diskfilter_vg *array, - grub_disk_addr_t start_sector, - grub_diskfilter_t diskfilter __attribute__ ((unused))) +static VasEBoot_err_t +insert_array (VasEBoot_disk_t disk, const struct VasEBoot_diskfilter_pv_id *id, + struct VasEBoot_diskfilter_vg *array, + VasEBoot_disk_addr_t start_sector, + VasEBoot_diskfilter_t diskfilter __attribute__ ((unused))) { - struct grub_diskfilter_pv *pv; + struct VasEBoot_diskfilter_pv *pv; - grub_dprintf ("diskfilter", "Inserting %s (+%lld,%lld) into %s (%s)\n", disk->name, - (unsigned long long) grub_partition_get_start (disk->partition), - (unsigned long long) grub_disk_get_size (disk), + VasEBoot_dprintf ("diskfilter", "Inserting %s (+%lld,%lld) into %s (%s)\n", disk->name, + (unsigned long long) VasEBoot_partition_get_start (disk->partition), + (unsigned long long) VasEBoot_disk_get_size (disk), array->name, diskfilter->name); -#ifdef GRUB_UTIL - grub_util_info ("Inserting %s (+%" GRUB_HOST_PRIuLONG_LONG ",%" - GRUB_HOST_PRIuLONG_LONG ") into %s (%s)\n", disk->name, - (unsigned long long) grub_partition_get_start (disk->partition), - (unsigned long long) grub_disk_get_size (disk), +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("Inserting %s (+%" VasEBoot_HOST_PRIuLONG_LONG ",%" + VasEBoot_HOST_PRIuLONG_LONG ") into %s (%s)\n", disk->name, + (unsigned long long) VasEBoot_partition_get_start (disk->partition), + (unsigned long long) VasEBoot_disk_get_size (disk), array->name, diskfilter->name); array->driver = diskfilter; #endif @@ -1203,27 +1203,27 @@ insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id, for (pv = array->pvs; pv; pv = pv->next) if (id->uuidlen == pv->id.uuidlen && id->uuidlen - ? (grub_memcmp (pv->id.uuid, id->uuid, id->uuidlen) == 0) + ? (VasEBoot_memcmp (pv->id.uuid, id->uuid, id->uuidlen) == 0) : (pv->id.id == id->id)) { - struct grub_diskfilter_lv *lv; + struct VasEBoot_diskfilter_lv *lv; /* FIXME: Check whether the update time of the superblocks are the same. */ - if (pv->disk && grub_disk_get_size (disk) >= pv->part_size) - return GRUB_ERR_NONE; - pv->disk = grub_disk_open (disk->name); + if (pv->disk && VasEBoot_disk_get_size (disk) >= pv->part_size) + return VasEBoot_ERR_NONE; + pv->disk = VasEBoot_disk_open (disk->name); if (!pv->disk) - return grub_errno; + return VasEBoot_errno; /* This could happen to LVM on RAID, pv->disk points to the raid device, we shouldn't change it. */ pv->start_sector -= pv->part_start; - pv->part_start = grub_partition_get_start (disk->partition); - pv->part_size = grub_disk_get_size (disk); + pv->part_start = VasEBoot_partition_get_start (disk->partition); + pv->part_size = VasEBoot_disk_get_size (disk); -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL { - grub_size_t s = 1; - grub_partition_t p; + VasEBoot_size_t s = 1; + VasEBoot_partition_t p; for (p = disk->partition; p; p = p->parent) s++; pv->partmaps = xmalloc (s * sizeof (pv->partmaps[0])); @@ -1233,7 +1233,7 @@ insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id, pv->partmaps[s++] = 0; } #endif - if (start_sector != (grub_uint64_t)-1) + if (start_sector != (VasEBoot_uint64_t)-1) pv->start_sector = start_sector; pv->start_sector += pv->part_start; /* Add the device to the array. */ @@ -1251,9 +1251,9 @@ free_array (void) { while (array_list) { - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_pv *pv; - struct grub_diskfilter_lv *lv; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_pv *pv; + struct VasEBoot_diskfilter_lv *lv; vg = array_list; array_list = array_list->next; @@ -1261,47 +1261,47 @@ free_array (void) while ((pv = vg->pvs)) { vg->pvs = pv->next; - grub_free (pv->name); + VasEBoot_free (pv->name); if (pv->disk) - grub_disk_close (pv->disk); + VasEBoot_disk_close (pv->disk); if (pv->id.uuidlen) - grub_free (pv->id.uuid); -#ifdef GRUB_UTIL - grub_free (pv->partmaps); + VasEBoot_free (pv->id.uuid); +#ifdef VasEBoot_UTIL + VasEBoot_free (pv->partmaps); #endif - grub_free (pv->internal_id); - grub_free (pv); + VasEBoot_free (pv->internal_id); + VasEBoot_free (pv); } while ((lv = vg->lvs)) { unsigned i; vg->lvs = lv->next; - grub_free (lv->fullname); - grub_free (lv->name); - grub_free (lv->idname); + VasEBoot_free (lv->fullname); + VasEBoot_free (lv->name); + VasEBoot_free (lv->idname); for (i = 0; i < lv->segment_count; i++) - grub_free (lv->segments[i].nodes); - grub_free (lv->segments); - grub_free (lv->internal_id); - grub_free (lv); + VasEBoot_free (lv->segments[i].nodes); + VasEBoot_free (lv->segments); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv); } - grub_free (vg->uuid); - grub_free (vg->name); - grub_free (vg); + VasEBoot_free (vg->uuid); + VasEBoot_free (vg->name); + VasEBoot_free (vg); } array_list = 0; } -#ifdef GRUB_UTIL -struct grub_diskfilter_pv * -grub_diskfilter_get_pv_from_disk (grub_disk_t disk, - struct grub_diskfilter_vg **vg_out) +#ifdef VasEBoot_UTIL +struct VasEBoot_diskfilter_pv * +VasEBoot_diskfilter_get_pv_from_disk (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_vg **vg_out) { - struct grub_diskfilter_pv *pv; - struct grub_diskfilter_vg *vg; + struct VasEBoot_diskfilter_pv *pv; + struct VasEBoot_diskfilter_vg *vg; scan_disk (disk->name, 1); for (vg = array_list; vg; vg = vg->next) @@ -1309,8 +1309,8 @@ grub_diskfilter_get_pv_from_disk (grub_disk_t disk, { if (pv->disk && pv->disk->id == disk->id && pv->disk->dev->id == disk->dev->id - && pv->part_start == grub_partition_get_start (disk->partition) - && pv->part_size == grub_disk_get_size (disk)) + && pv->part_start == VasEBoot_partition_get_start (disk->partition) + && pv->part_size == VasEBoot_disk_get_size (disk)) { if (vg_out) *vg_out = vg; @@ -1321,30 +1321,30 @@ grub_diskfilter_get_pv_from_disk (grub_disk_t disk, } #endif -static struct grub_disk_dev grub_diskfilter_dev = +static struct VasEBoot_disk_dev VasEBoot_diskfilter_dev = { .name = "diskfilter", - .id = GRUB_DISK_DEVICE_DISKFILTER_ID, - .iterate = grub_diskfilter_iterate, - .open = grub_diskfilter_open, - .close = grub_diskfilter_close, - .read = grub_diskfilter_read, - .write = grub_diskfilter_write, -#ifdef GRUB_UTIL - .memberlist = grub_diskfilter_memberlist, - .raidname = grub_diskfilter_getname, + .id = VasEBoot_DISK_DEVICE_DISKFILTER_ID, + .iterate = VasEBoot_diskfilter_iterate, + .open = VasEBoot_diskfilter_open, + .close = VasEBoot_diskfilter_close, + .read = VasEBoot_diskfilter_read, + .write = VasEBoot_diskfilter_write, +#ifdef VasEBoot_UTIL + .memberlist = VasEBoot_diskfilter_memberlist, + .raidname = VasEBoot_diskfilter_getname, #endif .next = 0 }; -GRUB_MOD_INIT(diskfilter) +VasEBoot_MOD_INIT(diskfilter) { - grub_disk_dev_register (&grub_diskfilter_dev); + VasEBoot_disk_dev_register (&VasEBoot_diskfilter_dev); } -GRUB_MOD_FINI(diskfilter) +VasEBoot_MOD_FINI(diskfilter) { - grub_disk_dev_unregister (&grub_diskfilter_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_diskfilter_dev); free_array (); } diff --git a/VasEBoot-core/disk/dmraid_nvidia.c b/VasEBoot-core/disk/dmraid_nvidia.c index 060279124..237877bc8 100644 --- a/VasEBoot-core/disk/dmraid_nvidia.c +++ b/VasEBoot-core/disk/dmraid_nvidia.c @@ -1,30 +1,30 @@ /* dmraid_nvidia.c - module to handle Nvidia fakeraid. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define NV_SIGNATURES 4 @@ -47,24 +47,24 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define NV_ARRAY_FLAG_ERROR 2 /* Degraded or offline. */ #define NV_ARRAY_FLAG_PARITY_VALID 4 /* RAID-3/5 parity valid. */ -struct grub_nv_array +struct VasEBoot_nv_array { - grub_uint32_t version; - grub_uint32_t signature[NV_SIGNATURES]; - grub_uint8_t raid_job_code; - grub_uint8_t stripe_width; - grub_uint8_t total_volumes; - grub_uint8_t original_width; - grub_uint32_t raid_level; - grub_uint32_t stripe_block_size; - grub_uint32_t stripe_block_size_bytes; - grub_uint32_t stripe_block_size_log2; - grub_uint32_t stripe_mask; - grub_uint32_t stripe_size; - grub_uint32_t stripe_size_bytes; - grub_uint32_t raid_job_mask; - grub_uint32_t original_capacity; - grub_uint32_t flags; + VasEBoot_uint32_t version; + VasEBoot_uint32_t signature[NV_SIGNATURES]; + VasEBoot_uint8_t raid_job_code; + VasEBoot_uint8_t stripe_width; + VasEBoot_uint8_t total_volumes; + VasEBoot_uint8_t original_width; + VasEBoot_uint32_t raid_level; + VasEBoot_uint32_t stripe_block_size; + VasEBoot_uint32_t stripe_block_size_bytes; + VasEBoot_uint32_t stripe_block_size_log2; + VasEBoot_uint32_t stripe_mask; + VasEBoot_uint32_t stripe_size; + VasEBoot_uint32_t stripe_size_bytes; + VasEBoot_uint32_t raid_job_mask; + VasEBoot_uint32_t original_capacity; + VasEBoot_uint32_t flags; }; #define NV_ID_LEN 8 @@ -74,59 +74,59 @@ struct grub_nv_array #define NV_PRODID_LEN 16 #define NV_PRODREV_LEN 4 -struct grub_nv_super +struct VasEBoot_nv_super { char vendor[NV_ID_LEN]; /* 0x00 - 0x07 ID string. */ - grub_uint32_t size; /* 0x08 - 0x0B Size of metadata in dwords. */ - grub_uint32_t chksum; /* 0x0C - 0x0F Checksum of this struct. */ - grub_uint16_t version; /* 0x10 - 0x11 NV version. */ - grub_uint8_t unit_number; /* 0x12 Disk index in array. */ - grub_uint8_t reserved; /* 0x13. */ - grub_uint32_t capacity; /* 0x14 - 0x17 Array capacity in sectors. */ - grub_uint32_t sector_size; /* 0x18 - 0x1B Sector size. */ + VasEBoot_uint32_t size; /* 0x08 - 0x0B Size of metadata in dwords. */ + VasEBoot_uint32_t chksum; /* 0x0C - 0x0F Checksum of this struct. */ + VasEBoot_uint16_t version; /* 0x10 - 0x11 NV version. */ + VasEBoot_uint8_t unit_number; /* 0x12 Disk index in array. */ + VasEBoot_uint8_t reserved; /* 0x13. */ + VasEBoot_uint32_t capacity; /* 0x14 - 0x17 Array capacity in sectors. */ + VasEBoot_uint32_t sector_size; /* 0x18 - 0x1B Sector size. */ char prodid[NV_PRODID_LEN]; /* 0x1C - 0x2B Array product ID. */ char prodrev[NV_PRODREV_LEN]; /* 0x2C - 0x2F Array product revision */ - grub_uint32_t unit_flags; /* 0x30 - 0x33 Flags for this disk */ - struct grub_nv_array array; /* Array information */ -} GRUB_PACKED; + VasEBoot_uint32_t unit_flags; /* 0x30 - 0x33 Flags for this disk */ + struct VasEBoot_nv_array array; /* Array information */ +} VasEBoot_PACKED; -static struct grub_diskfilter_vg * -grub_dmraid_nv_detect (grub_disk_t disk, - struct grub_diskfilter_pv_id *id, - grub_disk_addr_t *start_sector) +static struct VasEBoot_diskfilter_vg * +VasEBoot_dmraid_nv_detect (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_pv_id *id, + VasEBoot_disk_addr_t *start_sector) { - grub_disk_addr_t sector; - struct grub_nv_super sb; + VasEBoot_disk_addr_t sector; + struct VasEBoot_nv_super sb; int level; - grub_uint64_t disk_size; - grub_uint32_t capacity; - grub_uint8_t total_volumes; + VasEBoot_uint64_t disk_size; + VasEBoot_uint32_t capacity; + VasEBoot_uint8_t total_volumes; char *uuid; if (disk->partition) /* Skip partition. */ return NULL; - sector = grub_disk_get_size (disk); - if (sector == GRUB_DISK_SIZE_UNKNOWN) + sector = VasEBoot_disk_get_size (disk); + if (sector == VasEBoot_DISK_SIZE_UNKNOWN) /* Not raid. */ return NULL; sector -= 2; - if (grub_disk_read (disk, sector, 0, sizeof (sb), &sb)) + if (VasEBoot_disk_read (disk, sector, 0, sizeof (sb), &sb)) return NULL; - if (grub_memcmp (sb.vendor, NV_ID_STRING, 6)) + if (VasEBoot_memcmp (sb.vendor, NV_ID_STRING, 6)) /* Not raid. */ return NULL; if (sb.version != NV_VERSION) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unknown version: %d.%d", sb.version); return NULL; } - capacity = grub_le_to_cpu32 (sb.capacity); + capacity = VasEBoot_le_to_cpu32 (sb.capacity); total_volumes = sb.array.total_volumes; switch (sb.array.raid_level) @@ -153,16 +153,16 @@ grub_dmraid_nv_detect (grub_disk_t disk, break; default: - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported RAID level: %d", sb.array.raid_level); return NULL; } - uuid = grub_malloc (sizeof (sb.array.signature)); + uuid = VasEBoot_malloc (sizeof (sb.array.signature)); if (! uuid) return NULL; - grub_memcpy (uuid, (char *) &sb.array.signature, + VasEBoot_memcpy (uuid, (char *) &sb.array.signature, sizeof (sb.array.signature)); id->uuidlen = 0; @@ -170,27 +170,27 @@ grub_dmraid_nv_detect (grub_disk_t disk, *start_sector = 0; - return grub_diskfilter_make_raid (sizeof (sb.array.signature), + return VasEBoot_diskfilter_make_raid (sizeof (sb.array.signature), uuid, sb.array.total_volumes, "nv", disk_size, sb.array.stripe_block_size, - GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC, + VasEBoot_RAID_LAYOUT_LEFT_ASYMMETRIC, level); } -static struct grub_diskfilter grub_dmraid_nv_dev = +static struct VasEBoot_diskfilter VasEBoot_dmraid_nv_dev = { .name = "dmraid_nv", - .detect = grub_dmraid_nv_detect, + .detect = VasEBoot_dmraid_nv_detect, .next = 0 }; -GRUB_MOD_INIT(dm_nv) +VasEBoot_MOD_INIT(dm_nv) { - grub_diskfilter_register_front (&grub_dmraid_nv_dev); + VasEBoot_diskfilter_register_front (&VasEBoot_dmraid_nv_dev); } -GRUB_MOD_FINI(dm_nv) +VasEBoot_MOD_FINI(dm_nv) { - grub_diskfilter_unregister (&grub_dmraid_nv_dev); + VasEBoot_diskfilter_unregister (&VasEBoot_dmraid_nv_dev); } diff --git a/VasEBoot-core/disk/efi/efidisk.c b/VasEBoot-core/disk/efi/efidisk.c index 5d2400f66..cd2695e31 100644 --- a/VasEBoot-core/disk/efi/efidisk.c +++ b/VasEBoot-core/disk/efi/efidisk.c @@ -1,58 +1,58 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -struct grub_efidisk_data +struct VasEBoot_efidisk_data { - grub_efi_handle_t handle; - grub_efi_device_path_t *device_path; - grub_efi_device_path_t *last_device_path; - grub_efi_block_io_t *block_io; - struct grub_efidisk_data *next; + VasEBoot_efi_handle_t handle; + VasEBoot_efi_device_path_t *device_path; + VasEBoot_efi_device_path_t *last_device_path; + VasEBoot_efi_block_io_t *block_io; + struct VasEBoot_efidisk_data *next; }; /* GUID. */ -static grub_efi_guid_t block_io_guid = GRUB_EFI_BLOCK_IO_GUID; +static VasEBoot_efi_guid_t block_io_guid = VasEBoot_EFI_BLOCK_IO_GUID; -static struct grub_efidisk_data *fd_devices; -static struct grub_efidisk_data *hd_devices; -static struct grub_efidisk_data *cd_devices; +static struct VasEBoot_efidisk_data *fd_devices; +static struct VasEBoot_efidisk_data *hd_devices; +static struct VasEBoot_efidisk_data *cd_devices; -static struct grub_efidisk_data * +static struct VasEBoot_efidisk_data * make_devices (void) { - grub_efi_uintn_t num_handles; - grub_efi_handle_t *handles; - grub_efi_handle_t *handle; - struct grub_efidisk_data *devices = 0; + VasEBoot_efi_uintn_t num_handles; + VasEBoot_efi_handle_t *handles; + VasEBoot_efi_handle_t *handle; + struct VasEBoot_efidisk_data *devices = 0; /* Find handles which support the disk io interface. */ - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &block_io_guid, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_BY_PROTOCOL, &block_io_guid, 0, &num_handles); if (! handles) return 0; @@ -60,22 +60,22 @@ make_devices (void) /* Make a linked list of devices. */ for (handle = handles; num_handles--; handle++) { - grub_efi_device_path_t *dp; - grub_efi_device_path_t *ldp; - struct grub_efidisk_data *d; - grub_efi_block_io_t *bio; + VasEBoot_efi_device_path_t *dp; + VasEBoot_efi_device_path_t *ldp; + struct VasEBoot_efidisk_data *d; + VasEBoot_efi_block_io_t *bio; - dp = grub_efi_get_device_path (*handle); + dp = VasEBoot_efi_get_device_path (*handle); if (! dp) continue; - ldp = grub_efi_find_last_device_path (dp); + ldp = VasEBoot_efi_find_last_device_path (dp); if (! ldp) /* This is empty. Why? */ continue; - bio = grub_efi_open_protocol (*handle, &block_io_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + bio = VasEBoot_efi_open_protocol (*handle, &block_io_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (! bio) /* This should not happen... Why? */ continue; @@ -89,15 +89,15 @@ make_devices (void) bio->media->block_size == 1) continue; - d = grub_malloc (sizeof (*d)); + d = VasEBoot_malloc (sizeof (*d)); if (! d) { /* Uggh. */ - grub_free (handles); + VasEBoot_free (handles); while (devices) { d = devices->next; - grub_free (devices); + VasEBoot_free (devices); devices = d; } return 0; @@ -111,26 +111,26 @@ make_devices (void) devices = d; } - grub_free (handles); + VasEBoot_free (handles); return devices; } /* Find the parent device. */ -static struct grub_efidisk_data * -find_parent_device (struct grub_efidisk_data *devices, - struct grub_efidisk_data *d) +static struct VasEBoot_efidisk_data * +find_parent_device (struct VasEBoot_efidisk_data *devices, + struct VasEBoot_efidisk_data *d) { - grub_efi_device_path_t *dp, *ldp; - struct grub_efidisk_data *parent; + VasEBoot_efi_device_path_t *dp, *ldp; + struct VasEBoot_efidisk_data *parent; - dp = grub_efi_duplicate_device_path (d->device_path); + dp = VasEBoot_efi_duplicate_device_path (d->device_path); if (! dp) return 0; - ldp = grub_efi_find_last_device_path (dp); - ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + ldp = VasEBoot_efi_find_last_device_path (dp); + ldp->type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + ldp->subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ldp->length = sizeof (*ldp); for (parent = devices; parent; parent = parent->next) @@ -139,32 +139,32 @@ find_parent_device (struct grub_efidisk_data *devices, if (parent == d) continue; - if (grub_efi_compare_device_paths (parent->device_path, dp) == 0) + if (VasEBoot_efi_compare_device_paths (parent->device_path, dp) == 0) break; } - grub_free (dp); + VasEBoot_free (dp); return parent; } static int -is_child (struct grub_efidisk_data *child, - struct grub_efidisk_data *parent) +is_child (struct VasEBoot_efidisk_data *child, + struct VasEBoot_efidisk_data *parent) { - grub_efi_device_path_t *dp, *ldp; + VasEBoot_efi_device_path_t *dp, *ldp; int ret; - dp = grub_efi_duplicate_device_path (child->device_path); + dp = VasEBoot_efi_duplicate_device_path (child->device_path); if (! dp) return 0; - ldp = grub_efi_find_last_device_path (dp); - ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + ldp = VasEBoot_efi_find_last_device_path (dp); + ldp->type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + ldp->subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ldp->length = sizeof (*ldp); - ret = (grub_efi_compare_device_paths (dp, parent->device_path) == 0); - grub_free (dp); + ret = (VasEBoot_efi_compare_device_paths (dp, parent->device_path) == 0); + VasEBoot_free (dp); return ret; } @@ -172,19 +172,19 @@ is_child (struct grub_efidisk_data *child, /* Add a device into a list of devices in an ascending order. */ static void -add_device (struct grub_efidisk_data **devices, struct grub_efidisk_data *d) +add_device (struct VasEBoot_efidisk_data **devices, struct VasEBoot_efidisk_data *d) { - struct grub_efidisk_data **p; - struct grub_efidisk_data *n; + struct VasEBoot_efidisk_data **p; + struct VasEBoot_efidisk_data *n; for (p = devices; *p; p = &((*p)->next)) { int ret; - ret = grub_efi_compare_device_paths (grub_efi_find_last_device_path ((*p)->device_path), - grub_efi_find_last_device_path (d->device_path)); + ret = VasEBoot_efi_compare_device_paths (VasEBoot_efi_find_last_device_path ((*p)->device_path), + VasEBoot_efi_find_last_device_path (d->device_path)); if (ret == 0) - ret = grub_efi_compare_device_paths ((*p)->device_path, + ret = VasEBoot_efi_compare_device_paths ((*p)->device_path, d->device_path); if (ret == 0) return; @@ -192,49 +192,49 @@ add_device (struct grub_efidisk_data **devices, struct grub_efidisk_data *d) break; } - n = grub_malloc (sizeof (*n)); + n = VasEBoot_malloc (sizeof (*n)); if (! n) return; - grub_memcpy (n, d, sizeof (*n)); + VasEBoot_memcpy (n, d, sizeof (*n)); n->next = (*p); (*p) = n; } /* Name the devices. */ static void -name_devices (struct grub_efidisk_data *devices) +name_devices (struct VasEBoot_efidisk_data *devices) { - struct grub_efidisk_data *d; + struct VasEBoot_efidisk_data *d; /* First, identify devices by media device paths. */ for (d = devices; d; d = d->next) { - grub_efi_device_path_t *dp; + VasEBoot_efi_device_path_t *dp; dp = d->last_device_path; if (! dp) continue; - if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE) + if (VasEBoot_EFI_DEVICE_PATH_TYPE (dp) == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE) { int is_hard_drive = 0; - switch (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)) + switch (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp)) { - case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE: is_hard_drive = 1; /* Intentionally fall through. */ - case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_CDROM_DEVICE_PATH_SUBTYPE: { - struct grub_efidisk_data *parent, *parent2; + struct VasEBoot_efidisk_data *parent, *parent2; parent = find_parent_device (devices, d); if (!parent) { #ifdef DEBUG_NAMES - grub_printf ("skipping orphaned partition: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("skipping orphaned partition: "); + VasEBoot_efi_print_device_path (d->device_path); #endif break; } @@ -242,8 +242,8 @@ name_devices (struct grub_efidisk_data *devices) if (parent2) { #ifdef DEBUG_NAMES - grub_printf ("skipping subpartition: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("skipping subpartition: "); + VasEBoot_efi_print_device_path (d->device_path); #endif /* Mark itself as used. */ d->last_device_path = 0; @@ -257,16 +257,16 @@ name_devices (struct grub_efidisk_data *devices) if (is_hard_drive) { #ifdef DEBUG_NAMES - grub_printf ("adding a hard drive by a partition: "); - grub_efi_print_device_path (parent->device_path); + VasEBoot_printf ("adding a hard drive by a partition: "); + VasEBoot_efi_print_device_path (parent->device_path); #endif add_device (&hd_devices, parent); } else { #ifdef DEBUG_NAMES - grub_printf ("adding a cdrom by a partition: "); - grub_efi_print_device_path (parent->device_path); + VasEBoot_printf ("adding a cdrom by a partition: "); + VasEBoot_efi_print_device_path (parent->device_path); #endif add_device (&cd_devices, parent); } @@ -280,8 +280,8 @@ name_devices (struct grub_efidisk_data *devices) default: #ifdef DEBUG_NAMES - grub_printf ("skipping other type: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("skipping other type: "); + VasEBoot_efi_print_device_path (d->device_path); #endif /* For now, ignore the others. */ break; @@ -290,8 +290,8 @@ name_devices (struct grub_efidisk_data *devices) else { #ifdef DEBUG_NAMES - grub_printf ("skipping non-media: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("skipping non-media: "); + VasEBoot_efi_print_device_path (d->device_path); #endif } } @@ -299,8 +299,8 @@ name_devices (struct grub_efidisk_data *devices) /* Let's see what can be added more. */ for (d = devices; d; d = d->next) { - grub_efi_device_path_t *dp; - grub_efi_block_io_media_t *m; + VasEBoot_efi_device_path_t *dp; + VasEBoot_efi_block_io_media_t *m; int is_floppy = 0; dp = d->last_device_path; @@ -308,27 +308,27 @@ name_devices (struct grub_efidisk_data *devices) continue; /* Ghosts proudly presented by Apple. */ - if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE - && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) - == GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE) + if (VasEBoot_EFI_DEVICE_PATH_TYPE (dp) == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE + && VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp) + == VasEBoot_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE) { - grub_efi_vendor_device_path_t *vendor = (grub_efi_vendor_device_path_t *) dp; - const struct grub_efi_guid apple = GRUB_EFI_VENDOR_APPLE_GUID; + VasEBoot_efi_vendor_device_path_t *vendor = (VasEBoot_efi_vendor_device_path_t *) dp; + const struct VasEBoot_efi_guid apple = VasEBoot_EFI_VENDOR_APPLE_GUID; if (vendor->header.length == sizeof (*vendor) - && grub_memcmp (&vendor->vendor_guid, &apple, + && VasEBoot_memcmp (&vendor->vendor_guid, &apple, sizeof (vendor->vendor_guid)) == 0 && find_parent_device (devices, d)) continue; } m = d->block_io->media; - if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_ACPI_DEVICE_PATH_TYPE - && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) - == GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE) + if (VasEBoot_EFI_DEVICE_PATH_TYPE (dp) == VasEBoot_EFI_ACPI_DEVICE_PATH_TYPE + && VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp) + == VasEBoot_EFI_ACPI_DEVICE_PATH_SUBTYPE) { - grub_efi_acpi_device_path_t *acpi - = (grub_efi_acpi_device_path_t *) dp; + VasEBoot_efi_acpi_device_path_t *acpi + = (VasEBoot_efi_acpi_device_path_t *) dp; /* Floppy EISA ID. */ if (acpi->hid == 0x60441d0 || acpi->hid == 0x70041d0 || acpi->hid == 0x70141d1) @@ -337,18 +337,18 @@ name_devices (struct grub_efidisk_data *devices) if (is_floppy) { #ifdef DEBUG_NAMES - grub_printf ("adding a floppy: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("adding a floppy: "); + VasEBoot_efi_print_device_path (d->device_path); #endif add_device (&fd_devices, d); } - else if (m->read_only && m->block_size > GRUB_DISK_SECTOR_SIZE) + else if (m->read_only && m->block_size > VasEBoot_DISK_SECTOR_SIZE) { /* This check is too heuristic, but assume that this is a CDROM drive. */ #ifdef DEBUG_NAMES - grub_printf ("adding a cdrom by guessing: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("adding a cdrom by guessing: "); + VasEBoot_efi_print_device_path (d->device_path); #endif add_device (&cd_devices, d); } @@ -356,8 +356,8 @@ name_devices (struct grub_efidisk_data *devices) { /* The default is a hard drive. */ #ifdef DEBUG_NAMES - grub_printf ("adding a hard drive by guessing: "); - grub_efi_print_device_path (d->device_path); + VasEBoot_printf ("adding a hard drive by guessing: "); + VasEBoot_efi_print_device_path (d->device_path); #endif add_device (&hd_devices, d); } @@ -365,14 +365,14 @@ name_devices (struct grub_efidisk_data *devices) } static void -free_devices (struct grub_efidisk_data *devices) +free_devices (struct VasEBoot_efidisk_data *devices) { - struct grub_efidisk_data *p, *q; + struct VasEBoot_efidisk_data *p, *q; for (p = devices; p; p = q) { q = p->next; - grub_free (p); + VasEBoot_free (p); } } @@ -380,7 +380,7 @@ free_devices (struct grub_efidisk_data *devices) static void enumerate_disks (void) { - struct grub_efidisk_data *devices; + struct VasEBoot_efidisk_data *devices; devices = make_devices (); if (! devices) @@ -391,37 +391,37 @@ enumerate_disks (void) } static int -grub_efidisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_efidisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_efidisk_data *d; + struct VasEBoot_efidisk_data *d; char buf[16]; int count; switch (pull) { - case GRUB_DISK_PULL_NONE: + case VasEBoot_DISK_PULL_NONE: for (d = hd_devices, count = 0; d; d = d->next, count++) { - grub_snprintf (buf, sizeof (buf), "hd%d", count); - grub_dprintf ("efidisk", "iterating %s\n", buf); + VasEBoot_snprintf (buf, sizeof (buf), "hd%d", count); + VasEBoot_dprintf ("efidisk", "iterating %s\n", buf); if (hook (buf, hook_data)) return 1; } break; - case GRUB_DISK_PULL_REMOVABLE: + case VasEBoot_DISK_PULL_REMOVABLE: for (d = fd_devices, count = 0; d; d = d->next, count++) { - grub_snprintf (buf, sizeof (buf), "fd%d", count); - grub_dprintf ("efidisk", "iterating %s\n", buf); + VasEBoot_snprintf (buf, sizeof (buf), "fd%d", count); + VasEBoot_dprintf ("efidisk", "iterating %s\n", buf); if (hook (buf, hook_data)) return 1; } for (d = cd_devices, count = 0; d; d = d->next, count++) { - grub_snprintf (buf, sizeof (buf), "cd%d", count); - grub_dprintf ("efidisk", "iterating %s\n", buf); + VasEBoot_snprintf (buf, sizeof (buf), "cd%d", count); + VasEBoot_dprintf ("efidisk", "iterating %s\n", buf); if (hook (buf, hook_data)) return 1; } @@ -441,21 +441,21 @@ get_drive_number (const char *name) if ((name[0] != 'f' && name[0] != 'h' && name[0] != 'c') || name[1] != 'd') goto fail; - drive = grub_strtoul (name + 2, 0, 10); - if (grub_errno != GRUB_ERR_NONE) + drive = VasEBoot_strtoul (name + 2, 0, 10); + if (VasEBoot_errno != VasEBoot_ERR_NONE) goto fail; return (int) drive ; fail: - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a efidisk"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a efidisk"); return -1; } -static struct grub_efidisk_data * -get_device (struct grub_efidisk_data *devices, int num) +static struct VasEBoot_efidisk_data * +get_device (struct VasEBoot_efidisk_data *devices, int num) { - struct grub_efidisk_data *d; + struct VasEBoot_efidisk_data *d; for (d = devices; d && num; d = d->next, num--) ; @@ -466,18 +466,18 @@ get_device (struct grub_efidisk_data *devices, int num) return 0; } -static grub_err_t -grub_efidisk_open (const char *name, struct grub_disk *disk) +static VasEBoot_err_t +VasEBoot_efidisk_open (const char *name, struct VasEBoot_disk *disk) { int num; - struct grub_efidisk_data *d = 0; - grub_efi_block_io_media_t *m; + struct VasEBoot_efidisk_data *d = 0; + VasEBoot_efi_block_io_media_t *m; - grub_dprintf ("efidisk", "opening %s\n", name); + VasEBoot_dprintf ("efidisk", "opening %s\n", name); num = get_drive_number (name); if (num < 0) - return grub_errno; + return VasEBoot_errno; switch (name[0]) { @@ -496,52 +496,52 @@ grub_efidisk_open (const char *name, struct grub_disk *disk) } if (! d) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such device"); - disk->id = ((num << GRUB_CHAR_BIT) | name[0]); + disk->id = ((num << VasEBoot_CHAR_BIT) | name[0]); m = d->block_io->media; /* FIXME: Probably it is better to store the block size in the disk, and total sectors should be replaced with total blocks. */ - grub_dprintf ("efidisk", + VasEBoot_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x, io align = %x\n", m, (unsigned long long) m->last_block, m->block_size, m->io_align); /* Ensure required buffer alignment is a power of two (or is zero). */ if (m->io_align & (m->io_align - 1)) - return grub_error (GRUB_ERR_IO, "invalid buffer alignment %d", m->io_align); + return VasEBoot_error (VasEBoot_ERR_IO, "invalid buffer alignment %d", m->io_align); disk->total_sectors = m->last_block + 1; /* Don't increase this value due to bug in some EFI. */ - disk->max_agglomerate = 0xa0000 >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS); + disk->max_agglomerate = 0xa0000 >> (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS); if (m->block_size & (m->block_size - 1) || !m->block_size) - return grub_error (GRUB_ERR_IO, "invalid sector size %d", + return VasEBoot_error (VasEBoot_ERR_IO, "invalid sector size %d", m->block_size); for (disk->log_sector_size = 0; (1U << disk->log_sector_size) < m->block_size; disk->log_sector_size++); disk->data = d; - grub_dprintf ("efidisk", "opening %s succeeded\n", name); + VasEBoot_dprintf ("efidisk", "opening %s succeeded\n", name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_efidisk_close (struct grub_disk *disk __attribute__ ((unused))) +VasEBoot_efidisk_close (struct VasEBoot_disk *disk __attribute__ ((unused))) { /* EFI disks do not allocate extra memory, so nothing to do here. */ - grub_dprintf ("efidisk", "closing %s\n", disk->name); + VasEBoot_dprintf ("efidisk", "closing %s\n", disk->name); } -static grub_efi_status_t -grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector, - grub_size_t size, char *buf, int wr) +static VasEBoot_efi_status_t +VasEBoot_efidisk_readwrite (struct VasEBoot_disk *disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf, int wr) { - struct grub_efidisk_data *d; - grub_efi_block_io_t *bio; - grub_efi_status_t status; - grub_size_t io_align, num_bytes; + struct VasEBoot_efidisk_data *d; + VasEBoot_efi_block_io_t *bio; + VasEBoot_efi_status_t status; + VasEBoot_size_t io_align, num_bytes; char *aligned_buf; d = disk->data; @@ -551,13 +551,13 @@ grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector, io_align = bio->media->io_align ? bio->media->io_align : 1; num_bytes = size << disk->log_sector_size; - if ((grub_addr_t) buf & (io_align - 1)) + if ((VasEBoot_addr_t) buf & (io_align - 1)) { - aligned_buf = grub_memalign (io_align, num_bytes); + aligned_buf = VasEBoot_memalign (io_align, num_bytes); if (! aligned_buf) - return GRUB_EFI_OUT_OF_RESOURCES; + return VasEBoot_EFI_OUT_OF_RESOURCES; if (wr) - grub_memcpy (aligned_buf, buf, num_bytes); + VasEBoot_memcpy (aligned_buf, buf, num_bytes); } else { @@ -565,78 +565,78 @@ grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector, } status = efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio, - bio->media->media_id, (grub_efi_uint64_t) sector, - (grub_efi_uintn_t) num_bytes, aligned_buf); + bio->media->media_id, (VasEBoot_efi_uint64_t) sector, + (VasEBoot_efi_uintn_t) num_bytes, aligned_buf); - if ((grub_addr_t) buf & (io_align - 1)) + if ((VasEBoot_addr_t) buf & (io_align - 1)) { if (!wr) - grub_memcpy (buf, aligned_buf, num_bytes); - grub_free (aligned_buf); + VasEBoot_memcpy (buf, aligned_buf, num_bytes); + VasEBoot_free (aligned_buf); } return status; } -static grub_err_t -grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_efidisk_read (struct VasEBoot_disk *disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_efi_status_t status; + VasEBoot_efi_status_t status; - grub_dprintf ("efidisk", + VasEBoot_dprintf ("efidisk", "reading 0x%lx sectors at the sector 0x%llx from %s\n", (unsigned long) size, (unsigned long long) sector, disk->name); - status = grub_efidisk_readwrite (disk, sector, size, buf, 0); + status = VasEBoot_efidisk_readwrite (disk, sector, size, buf, 0); - if (status == GRUB_EFI_NO_MEDIA) - return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); - else if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_READ_ERROR, + if (status == VasEBoot_EFI_NO_MEDIA) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); + else if (status != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("failure reading sector 0x%llx from `%s'"), (unsigned long long) sector, disk->name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_efidisk_write (struct VasEBoot_disk *disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_efi_status_t status; + VasEBoot_efi_status_t status; - grub_dprintf ("efidisk", + VasEBoot_dprintf ("efidisk", "writing 0x%lx sectors at the sector 0x%llx to %s\n", (unsigned long) size, (unsigned long long) sector, disk->name); - status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1); + status = VasEBoot_efidisk_readwrite (disk, sector, size, (char *) buf, 1); - if (status == GRUB_EFI_NO_MEDIA) - return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); - else if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_WRITE_ERROR, + if (status == VasEBoot_EFI_NO_MEDIA) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); + else if (status != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx to `%s'"), (unsigned long long) sector, disk->name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_disk_dev grub_efidisk_dev = +static struct VasEBoot_disk_dev VasEBoot_efidisk_dev = { .name = "efidisk", - .id = GRUB_DISK_DEVICE_EFIDISK_ID, - .iterate = grub_efidisk_iterate, - .open = grub_efidisk_open, - .close = grub_efidisk_close, - .read = grub_efidisk_read, - .write = grub_efidisk_write, + .id = VasEBoot_DISK_DEVICE_EFIDISK_ID, + .iterate = VasEBoot_efidisk_iterate, + .open = VasEBoot_efidisk_open, + .close = VasEBoot_efidisk_close, + .read = VasEBoot_efidisk_read, + .write = VasEBoot_efidisk_write, .next = 0 }; void -grub_efidisk_fini (void) +VasEBoot_efidisk_fini (void) { free_devices (fd_devices); free_devices (hd_devices); @@ -644,26 +644,26 @@ grub_efidisk_fini (void) fd_devices = 0; hd_devices = 0; cd_devices = 0; - grub_disk_dev_unregister (&grub_efidisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_efidisk_dev); } void -grub_efidisk_init (void) +VasEBoot_efidisk_init (void) { - grub_disk_firmware_fini = grub_efidisk_fini; + VasEBoot_disk_firmware_fini = VasEBoot_efidisk_fini; enumerate_disks (); - grub_disk_dev_register (&grub_efidisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_efidisk_dev); } -/* Some utility functions to map GRUB devices with EFI devices. */ -grub_efi_handle_t -grub_efidisk_get_device_handle (grub_disk_t disk) +/* Some utility functions to map VasEBoot devices with EFI devices. */ +VasEBoot_efi_handle_t +VasEBoot_efidisk_get_device_handle (VasEBoot_disk_t disk) { - struct grub_efidisk_data *d; + struct VasEBoot_efidisk_data *d; char type; - if (disk->dev->id != GRUB_DISK_DEVICE_EFIDISK_ID) + if (disk->dev->id != VasEBoot_DISK_DEVICE_EFIDISK_ID) return 0; d = disk->data; @@ -686,27 +686,27 @@ grub_efidisk_get_device_handle (grub_disk_t disk) /* Otherwise, we must query the corresponding device to the firmware. */ { - struct grub_efidisk_data *devices; - grub_efi_handle_t handle = 0; - struct grub_efidisk_data *c; + struct VasEBoot_efidisk_data *devices; + VasEBoot_efi_handle_t handle = 0; + struct VasEBoot_efidisk_data *c; devices = make_devices (); FOR_CHILDREN (c, devices) { - grub_efi_hard_drive_device_path_t *hd; + VasEBoot_efi_hard_drive_device_path_t *hd; - hd = (grub_efi_hard_drive_device_path_t *) c->last_device_path; + hd = (VasEBoot_efi_hard_drive_device_path_t *) c->last_device_path; - if ((GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path) - == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE) - && (GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path) - == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE) - && (grub_partition_get_start (disk->partition) + if ((VasEBoot_EFI_DEVICE_PATH_TYPE (c->last_device_path) + == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE) + && (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path) + == VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE) + && (VasEBoot_partition_get_start (disk->partition) == (hd->partition_start << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS))) - && (grub_partition_get_len (disk->partition) + - VasEBoot_DISK_SECTOR_BITS))) + && (VasEBoot_partition_get_len (disk->partition) == (hd->partition_size << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS)))) + - VasEBoot_DISK_SECTOR_BITS)))) { handle = c->handle; break; @@ -729,23 +729,23 @@ grub_efidisk_get_device_handle (grub_disk_t disk) #define NEEDED_BUFLEN sizeof ("XdXXXXXXXXXX") static inline int -get_diskname_from_path_real (const grub_efi_device_path_t *path, - struct grub_efidisk_data *head, +get_diskname_from_path_real (const VasEBoot_efi_device_path_t *path, + struct VasEBoot_efidisk_data *head, char *buf) { int count = 0; - struct grub_efidisk_data *d; + struct VasEBoot_efidisk_data *d; for (d = head, count = 0; d; d = d->next, count++) - if (grub_efi_compare_device_paths (d->device_path, path) == 0) + if (VasEBoot_efi_compare_device_paths (d->device_path, path) == 0) { - grub_snprintf (buf, NEEDED_BUFLEN - 1, "d%d", count); + VasEBoot_snprintf (buf, NEEDED_BUFLEN - 1, "d%d", count); return 1; } return 0; } static inline int -get_diskname_from_path (const grub_efi_device_path_t *path, +get_diskname_from_path (const VasEBoot_efi_device_path_t *path, char *buf) { if (get_diskname_from_path_real (path, hd_devices, buf + 1)) @@ -768,29 +768,29 @@ get_diskname_from_path (const grub_efi_device_path_t *path, return 0; } -/* Context for grub_efidisk_get_device_name. */ -struct grub_efidisk_get_device_name_ctx +/* Context for VasEBoot_efidisk_get_device_name. */ +struct VasEBoot_efidisk_get_device_name_ctx { char *partition_name; - grub_efi_hard_drive_device_path_t *hd; + VasEBoot_efi_hard_drive_device_path_t *hd; }; -/* Helper for grub_efidisk_get_device_name. +/* Helper for VasEBoot_efidisk_get_device_name. Find the identical partition. */ static int -grub_efidisk_get_device_name_iter (grub_disk_t disk, - const grub_partition_t part, void *data) +VasEBoot_efidisk_get_device_name_iter (VasEBoot_disk_t disk, + const VasEBoot_partition_t part, void *data) { - struct grub_efidisk_get_device_name_ctx *ctx = data; + struct VasEBoot_efidisk_get_device_name_ctx *ctx = data; - if (grub_partition_get_start (part) + if (VasEBoot_partition_get_start (part) == (ctx->hd->partition_start << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS)) - && grub_partition_get_len (part) + - VasEBoot_DISK_SECTOR_BITS)) + && VasEBoot_partition_get_len (part) == (ctx->hd->partition_size << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS))) + - VasEBoot_DISK_SECTOR_BITS))) { - ctx->partition_name = grub_partition_get_name (part); + ctx->partition_name = VasEBoot_partition_get_name (part); return 1; } @@ -798,96 +798,96 @@ grub_efidisk_get_device_name_iter (grub_disk_t disk, } char * -grub_efidisk_get_device_name (grub_efi_handle_t *handle) +VasEBoot_efidisk_get_device_name (VasEBoot_efi_handle_t *handle) { - grub_efi_device_path_t *dp, *ldp; + VasEBoot_efi_device_path_t *dp, *ldp; char device_name[NEEDED_BUFLEN]; - dp = grub_efi_get_device_path (handle); + dp = VasEBoot_efi_get_device_path (handle); if (! dp) return 0; - ldp = grub_efi_find_last_device_path (dp); + ldp = VasEBoot_efi_find_last_device_path (dp); if (! ldp) return 0; - if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE - && (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE - || GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)) + if (VasEBoot_EFI_DEVICE_PATH_TYPE (ldp) == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE + && (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (ldp) == VasEBoot_EFI_CDROM_DEVICE_PATH_SUBTYPE + || VasEBoot_EFI_DEVICE_PATH_SUBTYPE (ldp) == VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)) { - struct grub_efidisk_get_device_name_ctx ctx; + struct VasEBoot_efidisk_get_device_name_ctx ctx; char *dev_name; - grub_efi_device_path_t *dup_dp; - grub_disk_t parent = 0; + VasEBoot_efi_device_path_t *dup_dp; + VasEBoot_disk_t parent = 0; - /* It is necessary to duplicate the device path so that GRUB + /* It is necessary to duplicate the device path so that VasEBoot can overwrite it. */ - dup_dp = grub_efi_duplicate_device_path (dp); + dup_dp = VasEBoot_efi_duplicate_device_path (dp); if (! dup_dp) return 0; while (1) { - grub_efi_device_path_t *dup_ldp; - dup_ldp = grub_efi_find_last_device_path (dup_dp); - if (!(GRUB_EFI_DEVICE_PATH_TYPE (dup_ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE - && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE - || GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))) + VasEBoot_efi_device_path_t *dup_ldp; + dup_ldp = VasEBoot_efi_find_last_device_path (dup_dp); + if (!(VasEBoot_EFI_DEVICE_PATH_TYPE (dup_ldp) == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE + && (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == VasEBoot_EFI_CDROM_DEVICE_PATH_SUBTYPE + || VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))) break; - dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + dup_ldp->type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + dup_ldp->subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; dup_ldp->length = sizeof (*dup_ldp); } if (!get_diskname_from_path (dup_dp, device_name)) { - grub_free (dup_dp); + VasEBoot_free (dup_dp); return 0; } - parent = grub_disk_open (device_name); - grub_free (dup_dp); + parent = VasEBoot_disk_open (device_name); + VasEBoot_free (dup_dp); if (! parent) return 0; /* Find a partition which matches the hard drive device path. */ ctx.partition_name = NULL; - ctx.hd = (grub_efi_hard_drive_device_path_t *) ldp; + ctx.hd = (VasEBoot_efi_hard_drive_device_path_t *) ldp; if (ctx.hd->partition_start == 0 && (ctx.hd->partition_size << (parent->log_sector_size - - GRUB_DISK_SECTOR_BITS)) - == grub_disk_get_size (parent)) + - VasEBoot_DISK_SECTOR_BITS)) + == VasEBoot_disk_get_size (parent)) { - dev_name = grub_strdup (parent->name); + dev_name = VasEBoot_strdup (parent->name); } else { - grub_partition_iterate (parent, grub_efidisk_get_device_name_iter, + VasEBoot_partition_iterate (parent, VasEBoot_efidisk_get_device_name_iter, &ctx); if (! ctx.partition_name) { /* No partition found. In most cases partition is embed in the root path anyway, so this is not critical. - This happens only if partition is on partmap that GRUB + This happens only if partition is on partmap that VasEBoot doesn't need to access root. */ - grub_disk_close (parent); - return grub_strdup (device_name); + VasEBoot_disk_close (parent); + return VasEBoot_strdup (device_name); } - dev_name = grub_xasprintf ("%s,%s", parent->name, + dev_name = VasEBoot_xasprintf ("%s,%s", parent->name, ctx.partition_name); - grub_free (ctx.partition_name); + VasEBoot_free (ctx.partition_name); } - grub_disk_close (parent); + VasEBoot_disk_close (parent); return dev_name; } /* This may be guessed device - floppy, cdrom or entire disk. */ if (!get_diskname_from_path (dp, device_name)) return 0; - return grub_strdup (device_name); + return VasEBoot_strdup (device_name); } diff --git a/VasEBoot-core/disk/geli.c b/VasEBoot-core/disk/geli.c index e9d23299a..c1e891649 100644 --- a/VasEBoot-core/disk/geli.c +++ b/VasEBoot-core/disk/geli.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* This file is loosely based on FreeBSD geli implementation @@ -45,78 +45,78 @@ * SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Dirty trick to solve circular dependency. */ -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL -#include +#include -#undef GRUB_MD_SHA256 -#undef GRUB_MD_SHA512 +#undef VasEBoot_MD_SHA256 +#undef VasEBoot_MD_SHA512 static const gcry_md_spec_t * -grub_md_sha256_real (void) +VasEBoot_md_sha256_real (void) { const gcry_md_spec_t *ret; - ret = grub_crypto_lookup_md_by_name ("sha256"); + ret = VasEBoot_crypto_lookup_md_by_name ("sha256"); if (!ret) - grub_util_error ("%s", _("Couldn't load sha256")); + VasEBoot_util_error ("%s", _("Couldn't load sha256")); return ret; } static const gcry_md_spec_t * -grub_md_sha512_real (void) +VasEBoot_md_sha512_real (void) { const gcry_md_spec_t *ret; - ret = grub_crypto_lookup_md_by_name ("sha512"); + ret = VasEBoot_crypto_lookup_md_by_name ("sha512"); if (!ret) - grub_util_error ("%s", _("Couldn't load sha512")); + VasEBoot_util_error ("%s", _("Couldn't load sha512")); return ret; } -#define GRUB_MD_SHA256 grub_md_sha256_real() -#define GRUB_MD_SHA512 grub_md_sha512_real() +#define VasEBoot_MD_SHA256 VasEBoot_md_sha256_real() +#define VasEBoot_MD_SHA512 VasEBoot_md_sha512_real() #endif -struct grub_geli_key +struct VasEBoot_geli_key { - grub_uint8_t iv_key[64]; - grub_uint8_t cipher_key[64]; - grub_uint8_t hmac[64]; -} GRUB_PACKED; + VasEBoot_uint8_t iv_key[64]; + VasEBoot_uint8_t cipher_key[64]; + VasEBoot_uint8_t hmac[64]; +} VasEBoot_PACKED; -struct grub_geli_phdr +struct VasEBoot_geli_phdr { - grub_uint8_t magic[16]; + VasEBoot_uint8_t magic[16]; #define GELI_MAGIC "GEOM::ELI" - grub_uint32_t version; - grub_uint32_t flags; - grub_uint16_t alg; - grub_uint16_t keylen; - grub_uint16_t unused3[5]; - grub_uint32_t sector_size; - grub_uint8_t keys_used; - grub_uint32_t niter; - grub_uint8_t salt[64]; - struct grub_geli_key keys[2]; -} GRUB_PACKED; + VasEBoot_uint32_t version; + VasEBoot_uint32_t flags; + VasEBoot_uint16_t alg; + VasEBoot_uint16_t keylen; + VasEBoot_uint16_t unused3[5]; + VasEBoot_uint32_t sector_size; + VasEBoot_uint8_t keys_used; + VasEBoot_uint32_t niter; + VasEBoot_uint8_t salt[64]; + struct VasEBoot_geli_key keys[2]; +} VasEBoot_PACKED; enum { - GRUB_GELI_FLAGS_ONETIME = 1, - GRUB_GELI_FLAGS_BOOT = 2, + VasEBoot_GELI_FLAGS_ONETIME = 1, + VasEBoot_GELI_FLAGS_BOOT = 2, }; /* FIXME: support version 0. */ @@ -138,102 +138,102 @@ const char *algorithms[] = { #define MAX_PASSPHRASE 256 static gcry_err_code_t -geli_rekey (struct grub_cryptodisk *dev, grub_uint64_t zoneno) +geli_rekey (struct VasEBoot_cryptodisk *dev, VasEBoot_uint64_t zoneno) { gcry_err_code_t gcry_err; const struct { char magic[4]; - grub_uint64_t zone; - } GRUB_PACKED tohash - = { {'e', 'k', 'e', 'y'}, grub_cpu_to_le64 (zoneno) }; - GRUB_PROPERLY_ALIGNED_ARRAY (key, GRUB_CRYPTO_MAX_MDLEN); + VasEBoot_uint64_t zone; + } VasEBoot_PACKED tohash + = { {'e', 'k', 'e', 'y'}, VasEBoot_cpu_to_le64 (zoneno) }; + VasEBoot_PROPERLY_ALIGNED_ARRAY (key, VasEBoot_CRYPTO_MAX_MDLEN); - if (dev->hash->mdlen > GRUB_CRYPTO_MAX_MDLEN) + if (dev->hash->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) return GPG_ERR_INV_ARG; - grub_dprintf ("geli", "rekeying %" PRIuGRUB_UINT64_T " keysize=%d\n", + VasEBoot_dprintf ("geli", "rekeying %" PRIuVasEBoot_UINT64_T " keysize=%d\n", zoneno, dev->rekey_derived_size); - gcry_err = grub_crypto_hmac_buffer (dev->hash, dev->rekey_key, 64, + gcry_err = VasEBoot_crypto_hmac_buffer (dev->hash, dev->rekey_key, 64, &tohash, sizeof (tohash), key); if (gcry_err) return gcry_err; - return grub_cryptodisk_setkey (dev, (grub_uint8_t *) key, + return VasEBoot_cryptodisk_setkey (dev, (VasEBoot_uint8_t *) key, dev->rekey_derived_size); } static inline gcry_err_code_t -make_uuid (const struct grub_geli_phdr *header, +make_uuid (const struct VasEBoot_geli_phdr *header, char *uuid) { - grub_uint8_t uuidbin[GRUB_CRYPTODISK_MAX_UUID_LENGTH]; + VasEBoot_uint8_t uuidbin[VasEBoot_CRYPTODISK_MAX_UUID_LENGTH]; gcry_err_code_t err; - grub_uint8_t *iptr; + VasEBoot_uint8_t *iptr; char *optr; - if (2 * GRUB_MD_SHA256->mdlen + 1 > GRUB_CRYPTODISK_MAX_UUID_LENGTH) + if (2 * VasEBoot_MD_SHA256->mdlen + 1 > VasEBoot_CRYPTODISK_MAX_UUID_LENGTH) return GPG_ERR_TOO_LARGE; - err = grub_crypto_hmac_buffer (GRUB_MD_SHA256, + err = VasEBoot_crypto_hmac_buffer (VasEBoot_MD_SHA256, header->salt, sizeof (header->salt), "uuid", sizeof ("uuid") - 1, uuidbin); if (err) return err; optr = uuid; - for (iptr = uuidbin; iptr < &uuidbin[GRUB_MD_SHA256->mdlen]; iptr++) + for (iptr = uuidbin; iptr < &uuidbin[VasEBoot_MD_SHA256->mdlen]; iptr++) { - grub_snprintf (optr, 3, "%02x", *iptr); + VasEBoot_snprintf (optr, 3, "%02x", *iptr); optr += 2; } *optr = 0; return GPG_ERR_NO_ERROR; } -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL -#include -#include +#include +#include char * -grub_util_get_geli_uuid (const char *dev) +VasEBoot_util_get_geli_uuid (const char *dev) { - grub_util_fd_t fd; - grub_uint64_t s; + VasEBoot_util_fd_t fd; + VasEBoot_uint64_t s; unsigned log_secsize; - grub_uint8_t hdr[512]; - struct grub_geli_phdr *header; + VasEBoot_uint8_t hdr[512]; + struct VasEBoot_geli_phdr *header; char *uuid; gcry_err_code_t err; - fd = grub_util_fd_open (dev, GRUB_UTIL_FD_O_RDONLY); + fd = VasEBoot_util_fd_open (dev, VasEBoot_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID (fd)) + if (!VasEBoot_UTIL_FD_IS_VALID (fd)) return NULL; - s = grub_util_get_fd_size (fd, dev, &log_secsize); + s = VasEBoot_util_get_fd_size (fd, dev, &log_secsize); s >>= log_secsize; - if (grub_util_fd_seek (fd, (s << log_secsize) - 512) < 0) - grub_util_error ("%s", _("couldn't read ELI metadata")); + if (VasEBoot_util_fd_seek (fd, (s << log_secsize) - 512) < 0) + VasEBoot_util_error ("%s", _("couldn't read ELI metadata")); - uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1); - if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0) - grub_util_error ("%s", _("couldn't read ELI metadata")); + uuid = xmalloc (VasEBoot_MD_SHA256->mdlen * 2 + 1); + if (VasEBoot_util_fd_read (fd, (void *) &hdr, 512) < 0) + VasEBoot_util_error ("%s", _("couldn't read ELI metadata")); - grub_util_fd_close (fd); + VasEBoot_util_fd_close (fd); COMPILE_TIME_ASSERT (sizeof (header) <= 512); header = (void *) &hdr; /* Look for GELI magic sequence. */ - if (grub_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC)) - || grub_le_to_cpu32 (header->version) > 7 - || grub_le_to_cpu32 (header->version) < 1) - grub_util_error ("%s", _("wrong ELI magic or version")); + if (VasEBoot_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC)) + || VasEBoot_le_to_cpu32 (header->version) > 7 + || VasEBoot_le_to_cpu32 (header->version) < 1) + VasEBoot_util_error ("%s", _("wrong ELI magic or version")); err = make_uuid ((void *) &hdr, uuid); if (err) { - grub_free (uuid); + VasEBoot_free (uuid); return NULL; } @@ -241,122 +241,122 @@ grub_util_get_geli_uuid (const char *dev) } #endif -static grub_cryptodisk_t -configure_ciphers (grub_disk_t disk, const char *check_uuid, +static VasEBoot_cryptodisk_t +configure_ciphers (VasEBoot_disk_t disk, const char *check_uuid, int boot_only) { - grub_cryptodisk_t newdev; - struct grub_geli_phdr header; - grub_crypto_cipher_handle_t cipher = NULL, secondary_cipher = NULL; + VasEBoot_cryptodisk_t newdev; + struct VasEBoot_geli_phdr header; + VasEBoot_crypto_cipher_handle_t cipher = NULL, secondary_cipher = NULL; const struct gcry_cipher_spec *ciph; const char *ciphername = NULL; gcry_err_code_t gcry_err; - char uuid[GRUB_CRYPTODISK_MAX_UUID_LENGTH]; - grub_disk_addr_t sector; - grub_err_t err; + char uuid[VasEBoot_CRYPTODISK_MAX_UUID_LENGTH]; + VasEBoot_disk_addr_t sector; + VasEBoot_err_t err; - if (2 * GRUB_MD_SHA256->mdlen + 1 > GRUB_CRYPTODISK_MAX_UUID_LENGTH) + if (2 * VasEBoot_MD_SHA256->mdlen + 1 > VasEBoot_CRYPTODISK_MAX_UUID_LENGTH) return NULL; - sector = grub_disk_get_size (disk); - if (sector == GRUB_DISK_SIZE_UNKNOWN || sector == 0) + sector = VasEBoot_disk_get_size (disk); + if (sector == VasEBoot_DISK_SIZE_UNKNOWN || sector == 0) return NULL; /* Read the GELI header. */ - err = grub_disk_read (disk, sector - 1, 0, sizeof (header), &header); + err = VasEBoot_disk_read (disk, sector - 1, 0, sizeof (header), &header); if (err) return NULL; /* Look for GELI magic sequence. */ - if (grub_memcmp (header.magic, GELI_MAGIC, sizeof (GELI_MAGIC)) - || grub_le_to_cpu32 (header.version) > 7 - || grub_le_to_cpu32 (header.version) < 1) + if (VasEBoot_memcmp (header.magic, GELI_MAGIC, sizeof (GELI_MAGIC)) + || VasEBoot_le_to_cpu32 (header.version) > 7 + || VasEBoot_le_to_cpu32 (header.version) < 1) { - grub_dprintf ("geli", "wrong magic %02x\n", header.magic[0]); + VasEBoot_dprintf ("geli", "wrong magic %02x\n", header.magic[0]); return NULL; } - if ((grub_le_to_cpu32 (header.sector_size) - & (grub_le_to_cpu32 (header.sector_size) - 1)) - || grub_le_to_cpu32 (header.sector_size) == 0) + if ((VasEBoot_le_to_cpu32 (header.sector_size) + & (VasEBoot_le_to_cpu32 (header.sector_size) - 1)) + || VasEBoot_le_to_cpu32 (header.sector_size) == 0) { - grub_dprintf ("geli", "incorrect sector size %d\n", - grub_le_to_cpu32 (header.sector_size)); + VasEBoot_dprintf ("geli", "incorrect sector size %d\n", + VasEBoot_le_to_cpu32 (header.sector_size)); return NULL; } - if (grub_le_to_cpu32 (header.flags) & GRUB_GELI_FLAGS_ONETIME) + if (VasEBoot_le_to_cpu32 (header.flags) & VasEBoot_GELI_FLAGS_ONETIME) { - grub_dprintf ("geli", "skipping one-time volume\n"); + VasEBoot_dprintf ("geli", "skipping one-time volume\n"); return NULL; } - if (boot_only && !(grub_le_to_cpu32 (header.flags) & GRUB_GELI_FLAGS_BOOT)) + if (boot_only && !(VasEBoot_le_to_cpu32 (header.flags) & VasEBoot_GELI_FLAGS_BOOT)) { - grub_dprintf ("geli", "not a boot volume\n"); + VasEBoot_dprintf ("geli", "not a boot volume\n"); return NULL; } gcry_err = make_uuid (&header, uuid); if (gcry_err) { - grub_crypto_gcry_error (gcry_err); + VasEBoot_crypto_gcry_error (gcry_err); return NULL; } - if (check_uuid && grub_strcasecmp (check_uuid, uuid) != 0) + if (check_uuid && VasEBoot_strcasecmp (check_uuid, uuid) != 0) { - grub_dprintf ("geli", "%s != %s\n", uuid, check_uuid); + VasEBoot_dprintf ("geli", "%s != %s\n", uuid, check_uuid); return NULL; } - if (grub_le_to_cpu16 (header.alg) >= ARRAY_SIZE (algorithms) - || algorithms[grub_le_to_cpu16 (header.alg)] == NULL) + if (VasEBoot_le_to_cpu16 (header.alg) >= ARRAY_SIZE (algorithms) + || algorithms[VasEBoot_le_to_cpu16 (header.alg)] == NULL) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher 0x%x unknown", - grub_le_to_cpu16 (header.alg)); + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "Cipher 0x%x unknown", + VasEBoot_le_to_cpu16 (header.alg)); return NULL; } - ciphername = algorithms[grub_le_to_cpu16 (header.alg)]; - ciph = grub_crypto_lookup_cipher_by_name (ciphername); + ciphername = algorithms[VasEBoot_le_to_cpu16 (header.alg)]; + ciph = VasEBoot_crypto_lookup_cipher_by_name (ciphername); if (!ciph) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher %s isn't available", + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "Cipher %s isn't available", ciphername); return NULL; } /* Configure the cipher used for the bulk data. */ - cipher = grub_crypto_cipher_open (ciph); + cipher = VasEBoot_crypto_cipher_open (ciph); if (!cipher) return NULL; - if (grub_le_to_cpu16 (header.alg) == 0x16) + if (VasEBoot_le_to_cpu16 (header.alg) == 0x16) { - secondary_cipher = grub_crypto_cipher_open (ciph); + secondary_cipher = VasEBoot_crypto_cipher_open (ciph); if (!secondary_cipher) { - grub_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (cipher); return NULL; } } - if (grub_le_to_cpu16 (header.keylen) > 1024) + if (VasEBoot_le_to_cpu16 (header.keylen) > 1024) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid keysize %d", - grub_le_to_cpu16 (header.keylen)); - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (secondary_cipher); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid keysize %d", + VasEBoot_le_to_cpu16 (header.keylen)); + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); return NULL; } - newdev = grub_zalloc (sizeof (struct grub_cryptodisk)); + newdev = VasEBoot_zalloc (sizeof (struct VasEBoot_cryptodisk)); if (!newdev) { - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (secondary_cipher); + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); return NULL; } newdev->cipher = cipher; @@ -364,26 +364,26 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, newdev->offset = 0; newdev->source_disk = NULL; newdev->benbi_log = 0; - if (grub_le_to_cpu16 (header.alg) == 0x16) + if (VasEBoot_le_to_cpu16 (header.alg) == 0x16) { - newdev->mode = GRUB_CRYPTODISK_MODE_XTS; - newdev->mode_iv = GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64; + newdev->mode = VasEBoot_CRYPTODISK_MODE_XTS; + newdev->mode_iv = VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64; } else { - newdev->mode = GRUB_CRYPTODISK_MODE_CBC; - newdev->mode_iv = GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH; + newdev->mode = VasEBoot_CRYPTODISK_MODE_CBC; + newdev->mode_iv = VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH; } newdev->essiv_cipher = NULL; newdev->essiv_hash = NULL; - newdev->hash = GRUB_MD_SHA512; - newdev->iv_hash = GRUB_MD_SHA256; + newdev->hash = VasEBoot_MD_SHA512; + newdev->iv_hash = VasEBoot_MD_SHA256; for (newdev->log_sector_size = 0; - (1U << newdev->log_sector_size) < grub_le_to_cpu32 (header.sector_size); + (1U << newdev->log_sector_size) < VasEBoot_le_to_cpu32 (header.sector_size); newdev->log_sector_size++); - if (grub_le_to_cpu32 (header.version) >= 5) + if (VasEBoot_le_to_cpu32 (header.version) >= 5) { newdev->rekey = geli_rekey; newdev->rekey_shift = 20; @@ -391,175 +391,175 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, newdev->modname = "geli"; - newdev->total_length = grub_disk_get_size (disk) - 1; - grub_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); + newdev->total_length = VasEBoot_disk_get_size (disk) - 1; + VasEBoot_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); COMPILE_TIME_ASSERT (sizeof (newdev->uuid) >= 32 * 2 + 1); return newdev; } -static grub_err_t -recover_key (grub_disk_t source, grub_cryptodisk_t dev) +static VasEBoot_err_t +recover_key (VasEBoot_disk_t source, VasEBoot_cryptodisk_t dev) { - grub_size_t keysize; - grub_uint8_t digest[GRUB_CRYPTO_MAX_MDLEN]; - grub_uint8_t geomkey[GRUB_CRYPTO_MAX_MDLEN]; - grub_uint8_t verify_key[GRUB_CRYPTO_MAX_MDLEN]; - grub_uint8_t zero[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; - grub_uint8_t geli_cipher_key[64]; + VasEBoot_size_t keysize; + VasEBoot_uint8_t digest[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t geomkey[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t verify_key[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t zero[VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE]; + VasEBoot_uint8_t geli_cipher_key[64]; char passphrase[MAX_PASSPHRASE] = ""; unsigned i; gcry_err_code_t gcry_err; - struct grub_geli_phdr header; + struct VasEBoot_geli_phdr header; char *tmp; - grub_disk_addr_t sector; - grub_err_t err; + VasEBoot_disk_addr_t sector; + VasEBoot_err_t err; - if (dev->cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) - return grub_error (GRUB_ERR_BUG, "cipher block is too long"); + if (dev->cipher->cipher->blocksize > VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE) + return VasEBoot_error (VasEBoot_ERR_BUG, "cipher block is too long"); - if (dev->hash->mdlen > GRUB_CRYPTO_MAX_MDLEN) - return grub_error (GRUB_ERR_BUG, "mdlen is too long"); + if (dev->hash->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) + return VasEBoot_error (VasEBoot_ERR_BUG, "mdlen is too long"); - sector = grub_disk_get_size (source); - if (sector == GRUB_DISK_SIZE_UNKNOWN || sector == 0) - return grub_error (GRUB_ERR_BUG, "not a geli"); + sector = VasEBoot_disk_get_size (source); + if (sector == VasEBoot_DISK_SIZE_UNKNOWN || sector == 0) + return VasEBoot_error (VasEBoot_ERR_BUG, "not a geli"); /* Read the GELI header. */ - err = grub_disk_read (source, sector - 1, 0, sizeof (header), &header); + err = VasEBoot_disk_read (source, sector - 1, 0, sizeof (header), &header); if (err) return err; - keysize = grub_le_to_cpu16 (header.keylen) / GRUB_CHAR_BIT; - grub_memset (zero, 0, sizeof (zero)); + keysize = VasEBoot_le_to_cpu16 (header.keylen) / VasEBoot_CHAR_BIT; + VasEBoot_memset (zero, 0, sizeof (zero)); - grub_puts_ (N_("Attempting to decrypt master key...")); + VasEBoot_puts_ (N_("Attempting to decrypt master key...")); /* Get the passphrase from the user. */ tmp = NULL; if (source->partition) - tmp = grub_partition_get_name (source->partition); - grub_printf_ (N_("Enter passphrase for %s%s%s (%s): "), source->name, + tmp = VasEBoot_partition_get_name (source->partition); + VasEBoot_printf_ (N_("Enter passphrase for %s%s%s (%s): "), source->name, source->partition ? "," : "", tmp ? : "", dev->uuid); - grub_free (tmp); - if (!grub_password_get (passphrase, MAX_PASSPHRASE)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); + VasEBoot_free (tmp); + if (!VasEBoot_password_get (passphrase, MAX_PASSPHRASE)) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Passphrase not supplied"); /* Calculate the PBKDF2 of the user supplied passphrase. */ - if (grub_le_to_cpu32 (header.niter) != 0) + if (VasEBoot_le_to_cpu32 (header.niter) != 0) { - grub_uint8_t pbkdf_key[64]; - gcry_err = grub_crypto_pbkdf2 (dev->hash, (grub_uint8_t *) passphrase, - grub_strlen (passphrase), + VasEBoot_uint8_t pbkdf_key[64]; + gcry_err = VasEBoot_crypto_pbkdf2 (dev->hash, (VasEBoot_uint8_t *) passphrase, + VasEBoot_strlen (passphrase), header.salt, sizeof (header.salt), - grub_le_to_cpu32 (header.niter), + VasEBoot_le_to_cpu32 (header.niter), pbkdf_key, sizeof (pbkdf_key)); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); - gcry_err = grub_crypto_hmac_buffer (dev->hash, NULL, 0, pbkdf_key, + gcry_err = VasEBoot_crypto_hmac_buffer (dev->hash, NULL, 0, pbkdf_key, sizeof (pbkdf_key), geomkey); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); } else { - struct grub_crypto_hmac_handle *hnd; + struct VasEBoot_crypto_hmac_handle *hnd; - hnd = grub_crypto_hmac_init (dev->hash, NULL, 0); + hnd = VasEBoot_crypto_hmac_init (dev->hash, NULL, 0); if (!hnd) - return grub_crypto_gcry_error (GPG_ERR_OUT_OF_MEMORY); + return VasEBoot_crypto_gcry_error (GPG_ERR_OUT_OF_MEMORY); - grub_crypto_hmac_write (hnd, header.salt, sizeof (header.salt)); - grub_crypto_hmac_write (hnd, passphrase, grub_strlen (passphrase)); + VasEBoot_crypto_hmac_write (hnd, header.salt, sizeof (header.salt)); + VasEBoot_crypto_hmac_write (hnd, passphrase, VasEBoot_strlen (passphrase)); - gcry_err = grub_crypto_hmac_fini (hnd, geomkey); + gcry_err = VasEBoot_crypto_hmac_fini (hnd, geomkey); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); } - gcry_err = grub_crypto_hmac_buffer (dev->hash, geomkey, + gcry_err = VasEBoot_crypto_hmac_buffer (dev->hash, geomkey, dev->hash->mdlen, "\1", 1, digest); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); - gcry_err = grub_crypto_hmac_buffer (dev->hash, geomkey, + gcry_err = VasEBoot_crypto_hmac_buffer (dev->hash, geomkey, dev->hash->mdlen, "\0", 1, verify_key); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); - grub_dprintf ("geli", "keylen = %" PRIuGRUB_SIZE "\n", keysize); + VasEBoot_dprintf ("geli", "keylen = %" PRIuVasEBoot_SIZE "\n", keysize); /* Try to recover master key from each active keyslot. */ for (i = 0; i < ARRAY_SIZE (header.keys); i++) { - struct grub_geli_key candidate_key; - grub_uint8_t key_hmac[GRUB_CRYPTO_MAX_MDLEN]; + struct VasEBoot_geli_key candidate_key; + VasEBoot_uint8_t key_hmac[VasEBoot_CRYPTO_MAX_MDLEN]; /* Check if keyslot is enabled. */ if (! (header.keys_used & (1 << i))) continue; - grub_dprintf ("geli", "Trying keyslot %d\n", i); + VasEBoot_dprintf ("geli", "Trying keyslot %d\n", i); - gcry_err = grub_crypto_cipher_set_key (dev->cipher, + gcry_err = VasEBoot_crypto_cipher_set_key (dev->cipher, digest, keysize); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); - gcry_err = grub_crypto_cbc_decrypt (dev->cipher, &candidate_key, + gcry_err = VasEBoot_crypto_cbc_decrypt (dev->cipher, &candidate_key, &header.keys[i], sizeof (candidate_key), zero); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); - gcry_err = grub_crypto_hmac_buffer (dev->hash, verify_key, + gcry_err = VasEBoot_crypto_hmac_buffer (dev->hash, verify_key, dev->hash->mdlen, &candidate_key, (sizeof (candidate_key) - sizeof (candidate_key.hmac)), key_hmac); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); - if (grub_memcmp (candidate_key.hmac, key_hmac, dev->hash->mdlen) != 0) + if (VasEBoot_memcmp (candidate_key.hmac, key_hmac, dev->hash->mdlen) != 0) continue; - grub_printf_ (N_("Slot %d opened\n"), i); + VasEBoot_printf_ (N_("Slot %d opened\n"), i); - if (grub_le_to_cpu32 (header.version) >= 7) + if (VasEBoot_le_to_cpu32 (header.version) >= 7) { /* GELI >=7 uses the cipher_key */ - grub_memcpy (geli_cipher_key, candidate_key.cipher_key, + VasEBoot_memcpy (geli_cipher_key, candidate_key.cipher_key, sizeof (candidate_key.cipher_key)); } else { /* GELI <=6 uses the iv_key */ - grub_memcpy (geli_cipher_key, candidate_key.iv_key, + VasEBoot_memcpy (geli_cipher_key, candidate_key.iv_key, sizeof (candidate_key.iv_key)); } /* Set the master key. */ if (!dev->rekey) { - grub_size_t real_keysize = keysize; - if (grub_le_to_cpu16 (header.alg) == 0x16) + VasEBoot_size_t real_keysize = keysize; + if (VasEBoot_le_to_cpu16 (header.alg) == 0x16) real_keysize *= 2; - gcry_err = grub_cryptodisk_setkey (dev, candidate_key.cipher_key, + gcry_err = VasEBoot_cryptodisk_setkey (dev, candidate_key.cipher_key, real_keysize); if (gcry_err) - return grub_crypto_gcry_error (gcry_err); + return VasEBoot_crypto_gcry_error (gcry_err); } else { - grub_size_t real_keysize = keysize; - if (grub_le_to_cpu16 (header.alg) == 0x16) + VasEBoot_size_t real_keysize = keysize; + if (VasEBoot_le_to_cpu16 (header.alg) == 0x16) real_keysize *= 2; - grub_memcpy (dev->rekey_key, geli_cipher_key, + VasEBoot_memcpy (dev->rekey_key, geli_cipher_key, sizeof (geli_cipher_key)); dev->rekey_derived_size = real_keysize; dev->last_rekey = -1; @@ -568,28 +568,28 @@ recover_key (grub_disk_t source, grub_cryptodisk_t dev) } dev->iv_prefix_len = sizeof (candidate_key.iv_key); - grub_memcpy (dev->iv_prefix, candidate_key.iv_key, + VasEBoot_memcpy (dev->iv_prefix, candidate_key.iv_key, sizeof (candidate_key.iv_key)); COMPILE_TIME_ASSERT (sizeof (dev->iv_prefix) >= sizeof (candidate_key.iv_key)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return GRUB_ACCESS_DENIED; + return VasEBoot_ACCESS_DENIED; } -struct grub_cryptodisk_dev geli_crypto = { +struct VasEBoot_cryptodisk_dev geli_crypto = { .scan = configure_ciphers, .recover_key = recover_key }; -GRUB_MOD_INIT (geli) +VasEBoot_MOD_INIT (geli) { - grub_cryptodisk_dev_register (&geli_crypto); + VasEBoot_cryptodisk_dev_register (&geli_crypto); } -GRUB_MOD_FINI (geli) +VasEBoot_MOD_FINI (geli) { - grub_cryptodisk_dev_unregister (&geli_crypto); + VasEBoot_cryptodisk_dev_unregister (&geli_crypto); } diff --git a/VasEBoot-core/disk/host.c b/VasEBoot-core/disk/host.c index 76ef1afb8..beb165f95 100644 --- a/VasEBoot-core/disk/host.c +++ b/VasEBoot-core/disk/host.c @@ -1,20 +1,20 @@ /* host.c - Dummy disk driver to provide access to the hosts filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* When using the disk, make a reference to this module. Otherwise @@ -23,18 +23,18 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -int grub_disk_host_i_want_a_reference; +int VasEBoot_disk_host_i_want_a_reference; static int -grub_host_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_host_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; if (hook ("host", hook_data)) @@ -42,62 +42,62 @@ grub_host_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_host_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_host_open (const char *name, VasEBoot_disk_t disk) { - if (grub_strcmp (name, "host")) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); + if (VasEBoot_strcmp (name, "host")) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a host disk"); disk->total_sectors = 0; disk->id = 0; disk->data = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_host_close (grub_disk_t disk __attribute((unused))) +VasEBoot_host_close (VasEBoot_disk_t disk __attribute((unused))) { } -static grub_err_t -grub_host_read (grub_disk_t disk __attribute((unused)), - grub_disk_addr_t sector __attribute((unused)), - grub_size_t size __attribute((unused)), +static VasEBoot_err_t +VasEBoot_host_read (VasEBoot_disk_t disk __attribute((unused)), + VasEBoot_disk_addr_t sector __attribute((unused)), + VasEBoot_size_t size __attribute((unused)), char *buf __attribute((unused))) { - return GRUB_ERR_OUT_OF_RANGE; + return VasEBoot_ERR_OUT_OF_RANGE; } -static grub_err_t -grub_host_write (grub_disk_t disk __attribute ((unused)), - grub_disk_addr_t sector __attribute ((unused)), - grub_size_t size __attribute ((unused)), +static VasEBoot_err_t +VasEBoot_host_write (VasEBoot_disk_t disk __attribute ((unused)), + VasEBoot_disk_addr_t sector __attribute ((unused)), + VasEBoot_size_t size __attribute ((unused)), const char *buf __attribute ((unused))) { - return GRUB_ERR_OUT_OF_RANGE; + return VasEBoot_ERR_OUT_OF_RANGE; } -static struct grub_disk_dev grub_host_dev = +static struct VasEBoot_disk_dev VasEBoot_host_dev = { /* The only important line in this file :-) */ .name = "host", - .id = GRUB_DISK_DEVICE_HOST_ID, - .iterate = grub_host_iterate, - .open = grub_host_open, - .close = grub_host_close, - .read = grub_host_read, - .write = grub_host_write, + .id = VasEBoot_DISK_DEVICE_HOST_ID, + .iterate = VasEBoot_host_iterate, + .open = VasEBoot_host_open, + .close = VasEBoot_host_close, + .read = VasEBoot_host_read, + .write = VasEBoot_host_write, .next = 0 }; -GRUB_MOD_INIT(host) +VasEBoot_MOD_INIT(host) { - grub_disk_dev_register (&grub_host_dev); + VasEBoot_disk_dev_register (&VasEBoot_host_dev); } -GRUB_MOD_FINI(host) +VasEBoot_MOD_FINI(host) { - grub_disk_dev_unregister (&grub_host_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_host_dev); } diff --git a/VasEBoot-core/disk/i386/pc/biosdisk.c b/VasEBoot-core/disk/i386/pc/biosdisk.c index 0b5826805..4cf1a93d1 100644 --- a/VasEBoot-core/disk/i386/pc/biosdisk.c +++ b/VasEBoot-core/disk/i386/pc/biosdisk.c @@ -1,60 +1,60 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static int cd_drive = 0; -static int grub_biosdisk_rw_int13_extensions (int ah, int drive, void *dap); +static int VasEBoot_biosdisk_rw_int13_extensions (int ah, int drive, void *dap); -static int grub_biosdisk_get_num_floppies (void) +static int VasEBoot_biosdisk_get_num_floppies (void) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; int drive; /* reset the disk system first */ regs.eax = 0; regs.edx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + VasEBoot_bios_interrupt (0x13, ®s); for (drive = 0; drive < 2; drive++) { - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT | GRUB_CPU_INT_FLAGS_CARRY; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT | VasEBoot_CPU_INT_FLAGS_CARRY; regs.edx = drive; /* call GET DISK TYPE */ regs.eax = 0x1500; - grub_bios_interrupt (0x13, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + VasEBoot_bios_interrupt (0x13, ®s); + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) break; /* check if this drive exists */ @@ -72,17 +72,17 @@ static int grub_biosdisk_get_num_floppies (void) */ static int -grub_biosdisk_rw_int13_extensions (int ah, int drive, void *dap) +VasEBoot_biosdisk_rw_int13_extensions (int ah, int drive, void *dap) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = ah << 8; /* compute the address of disk_address_packet */ - regs.ds = (((grub_addr_t) dap) & 0xffff0000) >> 4; - regs.esi = (((grub_addr_t) dap) & 0xffff); + regs.ds = (((VasEBoot_addr_t) dap) & 0xffff0000) >> 4; + regs.esi = (((VasEBoot_addr_t) dap) & 0xffff); regs.edx = drive; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + VasEBoot_bios_interrupt (0x13, ®s); return (regs.eax >> 8) & 0xff; } @@ -92,7 +92,7 @@ grub_biosdisk_rw_int13_extensions (int ah, int drive, void *dap) * return non-zero, otherwise zero. */ static int -grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, +VasEBoot_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, int soff, int nsec, int segment) { int ret, i; @@ -100,7 +100,7 @@ grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, /* Try 3 times. */ for (i = 0; i < 3; i++) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; /* set up CHS information */ /* set %ch to low eight bits of cylinder */ @@ -120,11 +120,11 @@ grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, regs.ebx = 0; regs.es = segment; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + VasEBoot_bios_interrupt (0x13, ®s); /* check if successful */ - if (!(regs.flags & GRUB_CPU_INT_FLAGS_CARRY)) + if (!(regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY)) return 0; /* save return value */ @@ -133,8 +133,8 @@ grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, /* if fail, reset the disk system */ regs.eax = 0; regs.edx = (drive & 0xff); - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x13, ®s); } return ret; } @@ -144,17 +144,17 @@ grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, * the major version of extensions, otherwise zero. */ static int -grub_biosdisk_check_int13_extensions (int drive) +VasEBoot_biosdisk_check_int13_extensions (int drive) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.edx = drive & 0xff; regs.eax = 0x4100; regs.ebx = 0x55aa; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x13, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) + if (regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) return 0; if ((regs.ebx & 0xffff) != 0xaa55) @@ -172,22 +172,22 @@ grub_biosdisk_check_int13_extensions (int drive) * error occurs, then return non-zero, otherwise zero. */ static int -grub_biosdisk_get_diskinfo_standard (int drive, +VasEBoot_biosdisk_get_diskinfo_standard (int drive, unsigned long *cylinders, unsigned long *heads, unsigned long *sectors) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x0800; regs.edx = drive & 0xff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x13, ®s); /* Check if unsuccessful. Ignore return value if carry isn't set to workaround some buggy BIOSes. */ - if ((regs.flags & GRUB_CPU_INT_FLAGS_CARRY) && ((regs.eax & 0xff00) != 0)) + if ((regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) && ((regs.eax & 0xff00) != 0)) return (regs.eax & 0xff00) >> 8; /* bogus BIOSes may not return an error number */ @@ -204,23 +204,23 @@ grub_biosdisk_get_diskinfo_standard (int drive, } static int -grub_biosdisk_get_diskinfo_real (int drive, void *drp, grub_uint16_t ax) +VasEBoot_biosdisk_get_diskinfo_real (int drive, void *drp, VasEBoot_uint16_t ax) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = ax; /* compute the address of drive parameters */ - regs.esi = ((grub_addr_t) drp) & 0xf; - regs.ds = ((grub_addr_t) drp) >> 4; + regs.esi = ((VasEBoot_addr_t) drp) & 0xf; + regs.ds = ((VasEBoot_addr_t) drp) >> 4; regs.edx = drive & 0xff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x13, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x13, ®s); /* Check if unsuccessful. Ignore return value if carry isn't set to workaround some buggy BIOSes. */ - if ((regs.flags & GRUB_CPU_INT_FLAGS_CARRY) && ((regs.eax & 0xff00) != 0)) + if ((regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) && ((regs.eax & 0xff00) != 0)) return (regs.eax & 0xff00) >> 8; return 0; @@ -231,9 +231,9 @@ grub_biosdisk_get_diskinfo_real (int drive, void *drp, grub_uint16_t ax) * then return non-zero, otherwise zero. */ static int -grub_biosdisk_get_cdinfo_int13_extensions (int drive, void *cdrp) +VasEBoot_biosdisk_get_cdinfo_int13_extensions (int drive, void *cdrp) { - return grub_biosdisk_get_diskinfo_real (drive, cdrp, 0x4b01); + return VasEBoot_biosdisk_get_diskinfo_real (drive, cdrp, 0x4b01); } /* @@ -241,13 +241,13 @@ grub_biosdisk_get_cdinfo_int13_extensions (int drive, void *cdrp) * occurs, then return non-zero, otherwise zero. */ static int -grub_biosdisk_get_diskinfo_int13_extensions (int drive, void *drp) +VasEBoot_biosdisk_get_diskinfo_int13_extensions (int drive, void *drp) { - return grub_biosdisk_get_diskinfo_real (drive, drp, 0x4800); + return VasEBoot_biosdisk_get_diskinfo_real (drive, drp, 0x4800); } static int -grub_biosdisk_get_drive (const char *name) +VasEBoot_biosdisk_get_drive (const char *name) { unsigned long drive; @@ -257,8 +257,8 @@ grub_biosdisk_get_drive (const char *name) if ((name[0] != 'f' && name[0] != 'h') || name[1] != 'd') goto fail; - drive = grub_strtoul (name + 2, 0, 10); - if (grub_errno != GRUB_ERR_NONE) + drive = VasEBoot_strtoul (name + 2, 0, 10); + if (VasEBoot_errno != VasEBoot_ERR_NONE) goto fail; if (name[0] == 'h') @@ -267,31 +267,31 @@ grub_biosdisk_get_drive (const char *name) return (int) drive ; fail: - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a biosdisk"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a biosdisk"); return -1; } static int -grub_biosdisk_call_hook (grub_disk_dev_iterate_hook_t hook, void *hook_data, +VasEBoot_biosdisk_call_hook (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, int drive) { char name[10]; if (cd_drive && drive == cd_drive) { - grub_dprintf ("biosdisk", "iterating cd\n"); + VasEBoot_dprintf ("biosdisk", "iterating cd\n"); return hook ("cd", hook_data); } - grub_snprintf (name, sizeof (name), + VasEBoot_snprintf (name, sizeof (name), (drive & 0x80) ? "hd%d" : "fd%d", drive & (~0x80)); - grub_dprintf ("biosdisk", "iterating %s\n", name); + VasEBoot_dprintf ("biosdisk", "iterating %s\n", name); return hook (name, hook_data); } static int -grub_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_biosdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { int num_floppies; int drive; @@ -299,32 +299,32 @@ grub_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, /* For hard disks, attempt to read the MBR. */ switch (pull) { - case GRUB_DISK_PULL_NONE: + case VasEBoot_DISK_PULL_NONE: for (drive = 0x80; drive < 0x90; drive++) { - if (grub_biosdisk_rw_standard (0x02, drive, 0, 0, 1, 1, - GRUB_MEMORY_MACHINE_SCRATCH_SEG) != 0) + if (VasEBoot_biosdisk_rw_standard (0x02, drive, 0, 0, 1, 1, + VasEBoot_MEMORY_MACHINE_SCRATCH_SEG) != 0) { - grub_dprintf ("biosdisk", "Read error when probing drive 0x%2x\n", drive); + VasEBoot_dprintf ("biosdisk", "Read error when probing drive 0x%2x\n", drive); break; } - if (grub_biosdisk_call_hook (hook, hook_data, drive)) + if (VasEBoot_biosdisk_call_hook (hook, hook_data, drive)) return 1; } return 0; - case GRUB_DISK_PULL_REMOVABLE: + case VasEBoot_DISK_PULL_REMOVABLE: if (cd_drive) { - if (grub_biosdisk_call_hook (hook, hook_data, cd_drive)) + if (VasEBoot_biosdisk_call_hook (hook, hook_data, cd_drive)) return 1; } /* For floppy disks, we can get the number safely. */ - num_floppies = grub_biosdisk_get_num_floppies (); + num_floppies = VasEBoot_biosdisk_get_num_floppies (); for (drive = 0; drive < num_floppies; drive++) - if (grub_biosdisk_call_hook (hook, hook_data, drive)) + if (VasEBoot_biosdisk_call_hook (hook, hook_data, drive)) return 1; return 0; default: @@ -333,34 +333,34 @@ grub_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_biosdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_biosdisk_open (const char *name, VasEBoot_disk_t disk) { - grub_uint64_t total_sectors = 0; + VasEBoot_uint64_t total_sectors = 0; int drive; - struct grub_biosdisk_data *data; + struct VasEBoot_biosdisk_data *data; - grub_dprintf ("biosdisk", "opening %s\n", name); + VasEBoot_dprintf ("biosdisk", "opening %s\n", name); - drive = grub_biosdisk_get_drive (name); + drive = VasEBoot_biosdisk_get_drive (name); if (drive < 0) - return grub_errno; + return VasEBoot_errno; disk->id = drive; - data = (struct grub_biosdisk_data *) grub_zalloc (sizeof (*data)); + data = (struct VasEBoot_biosdisk_data *) VasEBoot_zalloc (sizeof (*data)); if (! data) - return grub_errno; + return VasEBoot_errno; data->drive = drive; if ((cd_drive) && (drive == cd_drive)) { - data->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM; + data->flags = VasEBoot_BIOSDISK_FLAG_LBA | VasEBoot_BIOSDISK_FLAG_CDROM; data->sectors = 8; disk->log_sector_size = 11; /* TODO: get the correct size. */ - total_sectors = GRUB_DISK_SIZE_UNKNOWN; + total_sectors = VasEBoot_DISK_SIZE_UNKNOWN; } else { @@ -369,18 +369,18 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->log_sector_size = 9; - version = grub_biosdisk_check_int13_extensions (drive); + version = VasEBoot_biosdisk_check_int13_extensions (drive); if (version) { - struct grub_biosdisk_drp *drp - = (struct grub_biosdisk_drp *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + struct VasEBoot_biosdisk_drp *drp + = (struct VasEBoot_biosdisk_drp *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; /* Clear out the DRP. */ - grub_memset (drp, 0, sizeof (*drp)); + VasEBoot_memset (drp, 0, sizeof (*drp)); drp->size = sizeof (*drp); - if (! grub_biosdisk_get_diskinfo_int13_extensions (drive, drp)) + if (! VasEBoot_biosdisk_get_diskinfo_int13_extensions (drive, drp)) { - data->flags = GRUB_BIOSDISK_FLAG_LBA; + data->flags = VasEBoot_BIOSDISK_FLAG_LBA; if (drp->total_sectors) total_sectors = drp->total_sectors; @@ -388,7 +388,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) /* Some buggy BIOSes doesn't return the total sectors correctly but returns zero. So if it is zero, compute it by C/H/S returned by the LBA BIOS call. */ - total_sectors = ((grub_uint64_t) drp->cylinders) + total_sectors = ((VasEBoot_uint64_t) drp->cylinders) * drp->heads * drp->sectors; if (drp->bytes_per_sector && !(drp->bytes_per_sector & (drp->bytes_per_sector - 1)) @@ -400,7 +400,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->log_sector_size++); } - grub_dprintf ("biosdisk", + VasEBoot_dprintf ("biosdisk", "LBA total = 0x%llx block size = 0x%lx\n", (unsigned long long) total_sectors, 1L << disk->log_sector_size); @@ -408,26 +408,26 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) } } - if (! (data->flags & GRUB_BIOSDISK_FLAG_CDROM)) + if (! (data->flags & VasEBoot_BIOSDISK_FLAG_CDROM)) { - if (grub_biosdisk_get_diskinfo_standard (drive, + if (VasEBoot_biosdisk_get_diskinfo_standard (drive, &data->cylinders, &data->heads, &data->sectors) != 0) { - if (total_sectors && (data->flags & GRUB_BIOSDISK_FLAG_LBA)) + if (total_sectors && (data->flags & VasEBoot_BIOSDISK_FLAG_LBA)) { data->sectors = 63; data->heads = 255; data->cylinders - = grub_divmod64 (total_sectors + = VasEBoot_divmod64 (total_sectors + data->heads * data->sectors - 1, data->heads * data->sectors, 0); } else { - grub_free (data); - return grub_error (GRUB_ERR_BAD_DEVICE, "%s cannot get C/H/S values", disk->name); + VasEBoot_free (data); + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "%s cannot get C/H/S values", disk->name); } } @@ -437,61 +437,61 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) data->heads = 255; if (! total_sectors) - total_sectors = ((grub_uint64_t) data->cylinders) + total_sectors = ((VasEBoot_uint64_t) data->cylinders) * data->heads * data->sectors; - grub_dprintf ("biosdisk", "C/H/S %lu/%lu/%lu\n", + VasEBoot_dprintf ("biosdisk", "C/H/S %lu/%lu/%lu\n", data->cylinders, data->heads, data->sectors); } disk->total_sectors = total_sectors; /* Limit the max to 0x7f because of Phoenix EDD. */ - disk->max_agglomerate = 0x7f >> GRUB_DISK_CACHE_BITS; - COMPILE_TIME_ASSERT ((0x7f >> GRUB_DISK_CACHE_BITS - << (GRUB_DISK_SECTOR_BITS + GRUB_DISK_CACHE_BITS)) - + sizeof (struct grub_biosdisk_dap) - < GRUB_MEMORY_MACHINE_SCRATCH_SIZE); + disk->max_agglomerate = 0x7f >> VasEBoot_DISK_CACHE_BITS; + COMPILE_TIME_ASSERT ((0x7f >> VasEBoot_DISK_CACHE_BITS + << (VasEBoot_DISK_SECTOR_BITS + VasEBoot_DISK_CACHE_BITS)) + + sizeof (struct VasEBoot_biosdisk_dap) + < VasEBoot_MEMORY_MACHINE_SCRATCH_SIZE); disk->data = data; - grub_dprintf ("biosdisk", "opening %s succeeded\n", name); + VasEBoot_dprintf ("biosdisk", "opening %s succeeded\n", name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_biosdisk_close (grub_disk_t disk) +VasEBoot_biosdisk_close (VasEBoot_disk_t disk) { - grub_dprintf ("biosdisk", "closing %s\n", disk->name); - grub_free (disk->data); + VasEBoot_dprintf ("biosdisk", "closing %s\n", disk->name); + VasEBoot_free (disk->data); } /* For readability. */ -#define GRUB_BIOSDISK_READ 0 -#define GRUB_BIOSDISK_WRITE 1 +#define VasEBoot_BIOSDISK_READ 0 +#define VasEBoot_BIOSDISK_WRITE 1 -#define GRUB_BIOSDISK_CDROM_RETRY_COUNT 3 +#define VasEBoot_BIOSDISK_CDROM_RETRY_COUNT 3 -static grub_err_t -grub_biosdisk_rw (int cmd, grub_disk_t disk, - grub_disk_addr_t sector, grub_size_t size, +static VasEBoot_err_t +VasEBoot_biosdisk_rw (int cmd, VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, VasEBoot_size_t size, unsigned segment) { - struct grub_biosdisk_data *data = disk->data; + struct VasEBoot_biosdisk_data *data = disk->data; /* VirtualBox fails with sectors above 2T on CDs. Since even BD-ROMS are never that big anyway, return error. */ - if ((data->flags & GRUB_BIOSDISK_FLAG_CDROM) + if ((data->flags & VasEBoot_BIOSDISK_FLAG_CDROM) && (sector >> 32)) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read or write outside of disk `%s'"), disk->name); - if (data->flags & GRUB_BIOSDISK_FLAG_LBA) + if (data->flags & VasEBoot_BIOSDISK_FLAG_LBA) { - struct grub_biosdisk_dap *dap; + struct VasEBoot_biosdisk_dap *dap; - dap = (struct grub_biosdisk_dap *) (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + dap = (struct VasEBoot_biosdisk_dap *) (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR + (data->sectors << disk->log_sector_size)); dap->length = sizeof (*dap); @@ -500,30 +500,30 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, dap->buffer = segment << 16; /* The format SEGMENT:ADDRESS. */ dap->block = sector; - if (data->flags & GRUB_BIOSDISK_FLAG_CDROM) + if (data->flags & VasEBoot_BIOSDISK_FLAG_CDROM) { int i; if (cmd) - return grub_error (GRUB_ERR_WRITE_ERROR, N_("cannot write to CD-ROM")); + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, N_("cannot write to CD-ROM")); - for (i = 0; i < GRUB_BIOSDISK_CDROM_RETRY_COUNT; i++) - if (! grub_biosdisk_rw_int13_extensions (0x42, data->drive, dap)) + for (i = 0; i < VasEBoot_BIOSDISK_CDROM_RETRY_COUNT; i++) + if (! VasEBoot_biosdisk_rw_int13_extensions (0x42, data->drive, dap)) break; - if (i == GRUB_BIOSDISK_CDROM_RETRY_COUNT) - return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " + if (i == VasEBoot_BIOSDISK_CDROM_RETRY_COUNT) + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("failure reading sector 0x%llx " "from `%s'"), (unsigned long long) sector, disk->name); } else - if (grub_biosdisk_rw_int13_extensions (cmd + 0x42, data->drive, dap)) + if (VasEBoot_biosdisk_rw_int13_extensions (cmd + 0x42, data->drive, dap)) { /* Fall back to the CHS mode. */ - data->flags &= ~GRUB_BIOSDISK_FLAG_LBA; + data->flags &= ~VasEBoot_BIOSDISK_FLAG_LBA; disk->total_sectors = data->cylinders * data->heads * data->sectors; - return grub_biosdisk_rw (cmd, disk, sector, size, segment); + return VasEBoot_biosdisk_rw (cmd, disk, sector, size, segment); } } else @@ -537,32 +537,32 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, 1024 /* cylinders */ * 256 /* heads */ * 63 /* spt */) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read or write outside of disk `%s'"), disk->name); - soff = ((grub_uint32_t) sector) % data->sectors + 1; - head = ((grub_uint32_t) sector) / data->sectors; + soff = ((VasEBoot_uint32_t) sector) % data->sectors + 1; + head = ((VasEBoot_uint32_t) sector) / data->sectors; hoff = head % data->heads; coff = head / data->heads; if (coff >= data->cylinders) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read or write outside of disk `%s'"), disk->name); - if (grub_biosdisk_rw_standard (cmd + 0x02, data->drive, + if (VasEBoot_biosdisk_rw_standard (cmd + 0x02, data->drive, coff, hoff, soff, size, segment)) { switch (cmd) { - case GRUB_BIOSDISK_READ: - return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " + case VasEBoot_BIOSDISK_READ: + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("failure reading sector 0x%llx " "from `%s'"), (unsigned long long) sector, disk->name); - case GRUB_BIOSDISK_WRITE: - return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " + case VasEBoot_BIOSDISK_WRITE: + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " "to `%s'"), (unsigned long long) sector, disk->name); @@ -570,47 +570,47 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Return the number of sectors which can be read safely at a time. */ -static grub_size_t -get_safe_sectors (grub_disk_t disk, grub_disk_addr_t sector) +static VasEBoot_size_t +get_safe_sectors (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector) { - grub_size_t size; - grub_uint64_t offset; - struct grub_biosdisk_data *data = disk->data; - grub_uint32_t sectors = data->sectors; + VasEBoot_size_t size; + VasEBoot_uint64_t offset; + struct VasEBoot_biosdisk_data *data = disk->data; + VasEBoot_uint32_t sectors = data->sectors; /* OFFSET = SECTOR % SECTORS */ - grub_divmod64 (sector, sectors, &offset); + VasEBoot_divmod64 (sector, sectors, &offset); size = sectors - offset; return size; } -static grub_err_t -grub_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_biosdisk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_dprintf ("biosdisk", "reading 0x%lx sectors at 0x%llx from %s\n", + VasEBoot_dprintf ("biosdisk", "reading 0x%lx sectors at 0x%llx from %s\n", (unsigned long) size, (unsigned long long) sector, disk->name); while (size) { - grub_size_t len; + VasEBoot_size_t len; len = get_safe_sectors (disk, sector); if (len > size) len = size; - if (grub_biosdisk_rw (GRUB_BIOSDISK_READ, disk, sector, len, - GRUB_MEMORY_MACHINE_SCRATCH_SEG)) - return grub_errno; + if (VasEBoot_biosdisk_rw (VasEBoot_BIOSDISK_READ, disk, sector, len, + VasEBoot_MEMORY_MACHINE_SCRATCH_SEG)) + return VasEBoot_errno; - grub_memcpy (buf, (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, + VasEBoot_memcpy (buf, (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, len << disk->log_sector_size); buf += len << disk->log_sector_size; @@ -618,83 +618,83 @@ grub_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, size -= len; } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_biosdisk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - struct grub_biosdisk_data *data = disk->data; + struct VasEBoot_biosdisk_data *data = disk->data; - grub_dprintf ("biosdisk", "writing 0x%lx sectors at 0x%llx to %s\n", + VasEBoot_dprintf ("biosdisk", "writing 0x%lx sectors at 0x%llx to %s\n", (unsigned long) size, (unsigned long long) sector, disk->name); - if (data->flags & GRUB_BIOSDISK_FLAG_CDROM) - return grub_error (GRUB_ERR_IO, N_("cannot write to CD-ROM")); + if (data->flags & VasEBoot_BIOSDISK_FLAG_CDROM) + return VasEBoot_error (VasEBoot_ERR_IO, N_("cannot write to CD-ROM")); while (size) { - grub_size_t len; + VasEBoot_size_t len; len = get_safe_sectors (disk, sector); if (len > size) len = size; - grub_memcpy ((void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, buf, + VasEBoot_memcpy ((void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, buf, len << disk->log_sector_size); - if (grub_biosdisk_rw (GRUB_BIOSDISK_WRITE, disk, sector, len, - GRUB_MEMORY_MACHINE_SCRATCH_SEG)) - return grub_errno; + if (VasEBoot_biosdisk_rw (VasEBoot_BIOSDISK_WRITE, disk, sector, len, + VasEBoot_MEMORY_MACHINE_SCRATCH_SEG)) + return VasEBoot_errno; buf += len << disk->log_sector_size; sector += len; size -= len; } - return grub_errno; + return VasEBoot_errno; } -static struct grub_disk_dev grub_biosdisk_dev = +static struct VasEBoot_disk_dev VasEBoot_biosdisk_dev = { .name = "biosdisk", - .id = GRUB_DISK_DEVICE_BIOSDISK_ID, - .iterate = grub_biosdisk_iterate, - .open = grub_biosdisk_open, - .close = grub_biosdisk_close, - .read = grub_biosdisk_read, - .write = grub_biosdisk_write, + .id = VasEBoot_DISK_DEVICE_BIOSDISK_ID, + .iterate = VasEBoot_biosdisk_iterate, + .open = VasEBoot_biosdisk_open, + .close = VasEBoot_biosdisk_close, + .read = VasEBoot_biosdisk_read, + .write = VasEBoot_biosdisk_write, .next = 0 }; static void -grub_disk_biosdisk_fini (void) +VasEBoot_disk_biosdisk_fini (void) { - grub_disk_dev_unregister (&grub_biosdisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_biosdisk_dev); } -GRUB_MOD_INIT(biosdisk) +VasEBoot_MOD_INIT(biosdisk) { - struct grub_biosdisk_cdrp *cdrp - = (struct grub_biosdisk_cdrp *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_uint8_t boot_drive; + struct VasEBoot_biosdisk_cdrp *cdrp + = (struct VasEBoot_biosdisk_cdrp *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_uint8_t boot_drive; - if (grub_disk_firmware_is_tainted) + if (VasEBoot_disk_firmware_is_tainted) { - grub_puts_ (N_("Native disk drivers are in use. " + VasEBoot_puts_ (N_("Native disk drivers are in use. " "Refusing to use firmware disk interface.")); return; } - grub_disk_firmware_fini = grub_disk_biosdisk_fini; + VasEBoot_disk_firmware_fini = VasEBoot_disk_biosdisk_fini; - grub_memset (cdrp, 0, sizeof (*cdrp)); + VasEBoot_memset (cdrp, 0, sizeof (*cdrp)); cdrp->size = sizeof (*cdrp); cdrp->media_type = 0xFF; - boot_drive = (grub_boot_device >> 24); - if ((! grub_biosdisk_get_cdinfo_int13_extensions (boot_drive, cdrp)) - && ((cdrp->media_type & GRUB_BIOSDISK_CDTYPE_MASK) - == GRUB_BIOSDISK_CDTYPE_NO_EMUL)) + boot_drive = (VasEBoot_boot_device >> 24); + if ((! VasEBoot_biosdisk_get_cdinfo_int13_extensions (boot_drive, cdrp)) + && ((cdrp->media_type & VasEBoot_BIOSDISK_CDTYPE_MASK) + == VasEBoot_BIOSDISK_CDTYPE_NO_EMUL)) cd_drive = cdrp->drive_no; /* Since diskboot.S rejects devices over 0x90 it must be a CD booted with cdboot.S @@ -702,10 +702,10 @@ GRUB_MOD_INIT(biosdisk) if (boot_drive >= 0x90) cd_drive = boot_drive; - grub_disk_dev_register (&grub_biosdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_biosdisk_dev); } -GRUB_MOD_FINI(biosdisk) +VasEBoot_MOD_FINI(biosdisk) { - grub_disk_biosdisk_fini (); + VasEBoot_disk_biosdisk_fini (); } diff --git a/VasEBoot-core/disk/ieee1275/nand.c b/VasEBoot-core/disk/ieee1275/nand.c index feffa8c4c..403a87278 100644 --- a/VasEBoot-core/disk/ieee1275/nand.c +++ b/VasEBoot-core/disk/ieee1275/nand.c @@ -1,58 +1,58 @@ /* nand.c - NAND flash disk access. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_nand_data +struct VasEBoot_nand_data { - grub_ieee1275_ihandle_t handle; - grub_uint32_t block_size; + VasEBoot_ieee1275_ihandle_t handle; + VasEBoot_uint32_t block_size; }; static int -grub_nand_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_nand_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { static int have_nand = -1; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; if (have_nand == -1) { - struct grub_ieee1275_devalias alias; + struct VasEBoot_ieee1275_devalias alias; have_nand = 0; FOR_IEEE1275_DEVALIASES(alias) - if (grub_strcmp (alias.name, "nand") == 0) + if (VasEBoot_strcmp (alias.name, "nand") == 0) { have_nand = 1; break; } - grub_ieee1275_devalias_free (&alias); + VasEBoot_ieee1275_devalias_free (&alias); } if (have_nand) @@ -61,79 +61,79 @@ grub_nand_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf); +static VasEBoot_err_t +VasEBoot_nand_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf); -static grub_err_t -grub_nand_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_nand_open (const char *name, VasEBoot_disk_t disk) { - grub_ieee1275_ihandle_t dev_ihandle = 0; - struct grub_nand_data *data = 0; + VasEBoot_ieee1275_ihandle_t dev_ihandle = 0; + struct VasEBoot_nand_data *data = 0; const char *devname; struct size_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t result; - grub_ieee1275_cell_t size1; - grub_ieee1275_cell_t size2; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t result; + VasEBoot_ieee1275_cell_t size1; + VasEBoot_ieee1275_cell_t size2; } args; - if (grub_memcmp (name, "nand/", sizeof ("nand/") - 1) == 0) + if (VasEBoot_memcmp (name, "nand/", sizeof ("nand/") - 1) == 0) devname = name + sizeof ("nand/") - 1; - else if (grub_strcmp (name, "nand") == 0) + else if (VasEBoot_strcmp (name, "nand") == 0) devname = name; else - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a NAND device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a NAND device"); - data = grub_malloc (sizeof (*data)); + data = VasEBoot_malloc (sizeof (*data)); if (! data) goto fail; - grub_ieee1275_open (devname, &dev_ihandle); + VasEBoot_ieee1275_open (devname, &dev_ihandle); if (! dev_ihandle) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't open device"); goto fail; } data->handle = dev_ihandle; INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 2); - args.method = (grub_ieee1275_cell_t) "block-size"; + args.method = (VasEBoot_ieee1275_cell_t) "block-size"; args.ihandle = dev_ihandle; args.result = 1; if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't get block size"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't get block size"); goto fail; } - data->block_size = (args.size1 >> GRUB_DISK_SECTOR_BITS); + data->block_size = (args.size1 >> VasEBoot_DISK_SECTOR_BITS); if (!data->block_size) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "invalid block size"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "invalid block size"); goto fail; } INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); - args.method = (grub_ieee1275_cell_t) "size"; + args.method = (VasEBoot_ieee1275_cell_t) "size"; args.ihandle = dev_ihandle; args.result = 1; if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't get disk size"); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't get disk size"); goto fail; } disk->total_sectors = args.size1; disk->total_sectors <<= 32; disk->total_sectors += args.size2; - disk->total_sectors >>= GRUB_DISK_SECTOR_BITS; + disk->total_sectors >>= VasEBoot_DISK_SECTOR_BITS; disk->id = dev_ihandle; @@ -143,59 +143,59 @@ grub_nand_open (const char *name, grub_disk_t disk) fail: if (dev_ihandle) - grub_ieee1275_close (dev_ihandle); - grub_free (data); - return grub_errno; + VasEBoot_ieee1275_close (dev_ihandle); + VasEBoot_free (data); + return VasEBoot_errno; } static void -grub_nand_close (grub_disk_t disk) +VasEBoot_nand_close (VasEBoot_disk_t disk) { - grub_ieee1275_close (((struct grub_nand_data *) disk->data)->handle); - grub_free (disk->data); + VasEBoot_ieee1275_close (((struct VasEBoot_nand_data *) disk->data)->handle); + VasEBoot_free (disk->data); } -static grub_err_t -grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_nand_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - struct grub_nand_data *data = disk->data; - grub_size_t bsize, ofs; + struct VasEBoot_nand_data *data = disk->data; + VasEBoot_size_t bsize, ofs; struct read_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t ofs; - grub_ieee1275_cell_t page; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t ofs; + VasEBoot_ieee1275_cell_t page; + VasEBoot_ieee1275_cell_t len; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t result; } args; INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); - args.method = (grub_ieee1275_cell_t) "pio-read"; + args.method = (VasEBoot_ieee1275_cell_t) "pio-read"; args.ihandle = data->handle; - args.buf = (grub_ieee1275_cell_t) buf; - args.page = (grub_ieee1275_cell_t) ((grub_size_t) sector / data->block_size); + args.buf = (VasEBoot_ieee1275_cell_t) buf; + args.page = (VasEBoot_ieee1275_cell_t) ((VasEBoot_size_t) sector / data->block_size); - ofs = ((grub_size_t) sector % data->block_size) << GRUB_DISK_SECTOR_BITS; - size <<= GRUB_DISK_SECTOR_BITS; - bsize = (data->block_size << GRUB_DISK_SECTOR_BITS); + ofs = ((VasEBoot_size_t) sector % data->block_size) << VasEBoot_DISK_SECTOR_BITS; + size <<= VasEBoot_DISK_SECTOR_BITS; + bsize = (data->block_size << VasEBoot_DISK_SECTOR_BITS); do { - grub_size_t len; + VasEBoot_size_t len; len = (ofs + size > bsize) ? (bsize - ofs) : size; - args.len = (grub_ieee1275_cell_t) len; - args.ofs = (grub_ieee1275_cell_t) ofs; + args.len = (VasEBoot_ieee1275_cell_t) len; + args.ofs = (VasEBoot_ieee1275_cell_t) ofs; args.result = 1; if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) - return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("failure reading sector 0x%llx " "from `%s'"), (unsigned long long) sector, disk->name); @@ -206,37 +206,37 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, args.page++; } while (size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_nand_write (grub_disk_t disk __attribute ((unused)), - grub_disk_addr_t sector __attribute ((unused)), - grub_size_t size __attribute ((unused)), +static VasEBoot_err_t +VasEBoot_nand_write (VasEBoot_disk_t disk __attribute ((unused)), + VasEBoot_disk_addr_t sector __attribute ((unused)), + VasEBoot_size_t size __attribute ((unused)), const char *buf __attribute ((unused))) { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "nand write is not supported"); } -static struct grub_disk_dev grub_nand_dev = +static struct VasEBoot_disk_dev VasEBoot_nand_dev = { .name = "nand", - .id = GRUB_DISK_DEVICE_NAND_ID, - .iterate = grub_nand_iterate, - .open = grub_nand_open, - .close = grub_nand_close, - .read = grub_nand_read, - .write = grub_nand_write, + .id = VasEBoot_DISK_DEVICE_NAND_ID, + .iterate = VasEBoot_nand_iterate, + .open = VasEBoot_nand_open, + .close = VasEBoot_nand_close, + .read = VasEBoot_nand_read, + .write = VasEBoot_nand_write, .next = 0 }; -GRUB_MOD_INIT(nand) +VasEBoot_MOD_INIT(nand) { - grub_disk_dev_register (&grub_nand_dev); + VasEBoot_disk_dev_register (&VasEBoot_nand_dev); } -GRUB_MOD_FINI(nand) +VasEBoot_MOD_FINI(nand) { - grub_disk_dev_unregister (&grub_nand_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_nand_dev); } diff --git a/VasEBoot-core/disk/ieee1275/ofdisk.c b/VasEBoot-core/disk/ieee1275/ofdisk.c index 235c0fe2c..17bcf1698 100644 --- a/VasEBoot-core/disk/ieee1275/ofdisk.c +++ b/VasEBoot-core/disk/ieee1275/ofdisk.c @@ -1,50 +1,50 @@ /* ofdisk.c - Open Firmware disk access. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include static char *last_devpath; -static grub_ieee1275_ihandle_t last_ihandle; +static VasEBoot_ieee1275_ihandle_t last_ihandle; struct ofdisk_hash_ent { char *devpath; char *open_path; - char *grub_devpath; + char *VasEBoot_devpath; int is_boot; int is_removable; int block_size_fails; /* Pointer to shortest available name on nodes representing canonical names, otherwise NULL. */ const char *shortest; - const char *grub_shortest; + const char *VasEBoot_shortest; struct ofdisk_hash_ent *next; }; -static grub_err_t -grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size, +static VasEBoot_err_t +VasEBoot_ofdisk_get_block_size (const char *device, VasEBoot_uint32_t *block_size, struct ofdisk_hash_ent *op); #define OFDISK_HASH_SZ 8 @@ -66,7 +66,7 @@ ofdisk_hash_find (const char *devpath) while (p) { - if (!grub_strcmp (p->devpath, devpath)) + if (!VasEBoot_strcmp (p->devpath, devpath)) break; p = p->next; } @@ -81,31 +81,31 @@ ofdisk_hash_add_real (char *devpath) const char *iptr; char *optr; - p = grub_zalloc (sizeof (*p)); + p = VasEBoot_zalloc (sizeof (*p)); if (!p) return NULL; p->devpath = devpath; - p->grub_devpath = grub_malloc (sizeof ("ieee1275/") - + 2 * grub_strlen (p->devpath)); + p->VasEBoot_devpath = VasEBoot_malloc (sizeof ("ieee1275/") + + 2 * VasEBoot_strlen (p->devpath)); - if (!p->grub_devpath) + if (!p->VasEBoot_devpath) { - grub_free (p); + VasEBoot_free (p); return NULL; } - if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) + if (! VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_NO_PARTITION_0)) { - p->open_path = grub_malloc (grub_strlen (p->devpath) + 3); + p->open_path = VasEBoot_malloc (VasEBoot_strlen (p->devpath) + 3); if (!p->open_path) { - grub_free (p->grub_devpath); - grub_free (p); + VasEBoot_free (p->VasEBoot_devpath); + VasEBoot_free (p); return NULL; } - optr = grub_stpcpy (p->open_path, p->devpath); + optr = VasEBoot_stpcpy (p->open_path, p->devpath); *optr++ = ':'; *optr++ = '0'; *optr = '\0'; @@ -113,7 +113,7 @@ ofdisk_hash_add_real (char *devpath) else p->open_path = p->devpath; - optr = grub_stpcpy (p->grub_devpath, "ieee1275/"); + optr = VasEBoot_stpcpy (p->VasEBoot_devpath, "ieee1275/"); for (iptr = p->devpath; *iptr; ) { if (*iptr == ',') @@ -130,13 +130,13 @@ ofdisk_hash_add_real (char *devpath) static int check_string_removable (const char *str) { - const char *ptr = grub_strrchr (str, '/'); + const char *ptr = VasEBoot_strrchr (str, '/'); if (ptr) ptr++; else ptr = str; - return (grub_strncmp (ptr, "cdrom", 5) == 0 || grub_strncmp (ptr, "fd", 2) == 0); + return (VasEBoot_strncmp (ptr, "cdrom", 5) == 0 || VasEBoot_strncmp (ptr, "fd", 2) == 0); } static struct ofdisk_hash_ent * @@ -146,12 +146,12 @@ ofdisk_hash_add (char *devpath, char *curcan) p = ofdisk_hash_add_real (devpath); - grub_dprintf ("disk", "devpath = %s, canonical = %s\n", devpath, curcan); + VasEBoot_dprintf ("disk", "devpath = %s, canonical = %s\n", devpath, curcan); if (!curcan) { p->shortest = p->devpath; - p->grub_shortest = p->grub_devpath; + p->VasEBoot_shortest = p->VasEBoot_devpath; if (check_string_removable (devpath)) p->is_removable = 1; return p; @@ -161,20 +161,20 @@ ofdisk_hash_add (char *devpath, char *curcan) if (!pcan) pcan = ofdisk_hash_add_real (curcan); else - grub_free (curcan); + VasEBoot_free (curcan); if (check_string_removable (devpath) || check_string_removable (curcan)) pcan->is_removable = 1; if (!pcan) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; else { if (!pcan->shortest - || grub_strlen (pcan->shortest) > grub_strlen (devpath)) + || VasEBoot_strlen (pcan->shortest) > VasEBoot_strlen (devpath)) { pcan->shortest = p->devpath; - pcan->grub_shortest = p->grub_devpath; + pcan->VasEBoot_shortest = p->VasEBoot_devpath; } } @@ -186,19 +186,19 @@ dev_iterate_real (const char *name, const char *path) { struct ofdisk_hash_ent *op; - grub_dprintf ("disk", "disk name = %s, path = %s\n", name, + VasEBoot_dprintf ("disk", "disk name = %s, path = %s\n", name, path); op = ofdisk_hash_find (path); if (!op) { - char *name_dup = grub_strdup (name); - char *can = grub_strdup (path); + char *name_dup = VasEBoot_strdup (name); + char *can = VasEBoot_strdup (path); if (!name_dup || !can) { - grub_errno = GRUB_ERR_NONE; - grub_free (name_dup); - grub_free (can); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (name_dup); + VasEBoot_free (can); return; } op = ofdisk_hash_add (name_dup, can); @@ -207,63 +207,63 @@ dev_iterate_real (const char *name, const char *path) } static void -dev_iterate (const struct grub_ieee1275_devalias *alias) +dev_iterate (const struct VasEBoot_ieee1275_devalias *alias) { - if (grub_strcmp (alias->type, "vscsi") == 0) + if (VasEBoot_strcmp (alias->type, "vscsi") == 0) { - static grub_ieee1275_ihandle_t ihandle; + static VasEBoot_ieee1275_ihandle_t ihandle; struct set_color_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t catch_result; - grub_ieee1275_cell_t nentries; - grub_ieee1275_cell_t table; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t catch_result; + VasEBoot_ieee1275_cell_t nentries; + VasEBoot_ieee1275_cell_t table; } args; char *buf, *bufptr; unsigned i; - if (grub_ieee1275_open (alias->path, &ihandle)) + if (VasEBoot_ieee1275_open (alias->path, &ihandle)) return; /* This method doesn't need memory allocation for the table. Open firmware takes care of all memory management and the result table stays in memory and is never freed. */ INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); - args.method = (grub_ieee1275_cell_t) "vscsi-report-luns"; + args.method = (VasEBoot_ieee1275_cell_t) "vscsi-report-luns"; args.ihandle = ihandle; args.table = 0; args.nentries = 0; if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || args.catch_result) { - grub_ieee1275_close (ihandle); + VasEBoot_ieee1275_close (ihandle); return; } - buf = grub_malloc (grub_strlen (alias->path) + 32); + buf = VasEBoot_malloc (VasEBoot_strlen (alias->path) + 32); if (!buf) return; - bufptr = grub_stpcpy (buf, alias->path); + bufptr = VasEBoot_stpcpy (buf, alias->path); for (i = 0; i < args.nentries; i++) { - grub_uint64_t *ptr; + VasEBoot_uint64_t *ptr; - ptr = *(grub_uint64_t **) (args.table + 4 + 8 * i); + ptr = *(VasEBoot_uint64_t **) (args.table + 4 + 8 * i); while (*ptr) { - grub_snprintf (bufptr, 32, "/disk@%" PRIxGRUB_UINT64_T, *ptr++); + VasEBoot_snprintf (bufptr, 32, "/disk@%" PRIxVasEBoot_UINT64_T, *ptr++); dev_iterate_real (buf, buf); } } - grub_ieee1275_close (ihandle); - grub_free (buf); + VasEBoot_ieee1275_close (ihandle); + VasEBoot_free (buf); return; } - else if (grub_strcmp (alias->type, "sas_ioa") == 0) + else if (VasEBoot_strcmp (alias->type, "sas_ioa") == 0) { /* The method returns the number of disks and a table where * each ID is 64-bit long. Example of sas paths: @@ -273,82 +273,82 @@ dev_iterate (const struct grub_ieee1275_devalias *alias) struct sas_children { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t max; - grub_ieee1275_cell_t table; - grub_ieee1275_cell_t catch_result; - grub_ieee1275_cell_t nentries; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t max; + VasEBoot_ieee1275_cell_t table; + VasEBoot_ieee1275_cell_t catch_result; + VasEBoot_ieee1275_cell_t nentries; } args; char *buf, *bufptr; unsigned i; - grub_uint64_t *table; - grub_uint16_t table_size; - grub_ieee1275_ihandle_t ihandle; + VasEBoot_uint64_t *table; + VasEBoot_uint16_t table_size; + VasEBoot_ieee1275_ihandle_t ihandle; - buf = grub_malloc (grub_strlen (alias->path) + + buf = VasEBoot_malloc (VasEBoot_strlen (alias->path) + sizeof ("/disk@7766554433221100")); if (!buf) return; - bufptr = grub_stpcpy (buf, alias->path); + bufptr = VasEBoot_stpcpy (buf, alias->path); /* Power machines documentation specify 672 as maximum SAS disks in one system. Using a slightly larger value to be safe. */ table_size = 768; - table = grub_malloc (table_size * sizeof (grub_uint64_t)); + table = VasEBoot_malloc (table_size * sizeof (VasEBoot_uint64_t)); if (!table) { - grub_free (buf); + VasEBoot_free (buf); return; } - if (grub_ieee1275_open (alias->path, &ihandle)) + if (VasEBoot_ieee1275_open (alias->path, &ihandle)) { - grub_free (buf); - grub_free (table); + VasEBoot_free (buf); + VasEBoot_free (table); return; } INIT_IEEE1275_COMMON (&args.common, "call-method", 4, 2); - args.method = (grub_ieee1275_cell_t) "get-sas-children"; + args.method = (VasEBoot_ieee1275_cell_t) "get-sas-children"; args.ihandle = ihandle; args.max = table_size; - args.table = (grub_ieee1275_cell_t) table; + args.table = (VasEBoot_ieee1275_cell_t) table; args.catch_result = 0; args.nentries = 0; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) { - grub_ieee1275_close (ihandle); - grub_free (table); - grub_free (buf); + VasEBoot_ieee1275_close (ihandle); + VasEBoot_free (table); + VasEBoot_free (buf); return; } for (i = 0; i < args.nentries; i++) { - grub_snprintf (bufptr, sizeof ("/disk@7766554433221100"), - "/disk@%" PRIxGRUB_UINT64_T, table[i]); + VasEBoot_snprintf (bufptr, sizeof ("/disk@7766554433221100"), + "/disk@%" PRIxVasEBoot_UINT64_T, table[i]); dev_iterate_real (buf, buf); } - grub_ieee1275_close (ihandle); - grub_free (table); - grub_free (buf); + VasEBoot_ieee1275_close (ihandle); + VasEBoot_free (table); + VasEBoot_free (buf); } - if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS) - && grub_strcmp (alias->type, "block") == 0) + if (!VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS) + && VasEBoot_strcmp (alias->type, "block") == 0) { dev_iterate_real (alias->path, alias->path); return; } { - struct grub_ieee1275_devalias child; + struct VasEBoot_ieee1275_devalias child; FOR_IEEE1275_DEVCHILDREN(alias->path, child) dev_iterate (&child); @@ -358,10 +358,10 @@ dev_iterate (const struct grub_ieee1275_devalias *alias) static void scan (void) { - struct grub_ieee1275_devalias alias; + struct VasEBoot_ieee1275_devalias alias; FOR_IEEE1275_DEVALIASES(alias) { - if (grub_strcmp (alias.type, "block") != 0) + if (VasEBoot_strcmp (alias.type, "block") != 0) continue; dev_iterate_real (alias.name, alias.path); } @@ -371,12 +371,12 @@ scan (void) } static int -grub_ofdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_ofdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { unsigned i; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; scan (); @@ -388,28 +388,28 @@ grub_ofdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, { if (!ent->shortest) continue; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_OFDISK_SDCARD_ONLY)) { - grub_ieee1275_phandle_t dev; + VasEBoot_ieee1275_phandle_t dev; char tmp[8]; - if (grub_ieee1275_finddevice (ent->devpath, &dev)) + if (VasEBoot_ieee1275_finddevice (ent->devpath, &dev)) { - grub_dprintf ("disk", "finddevice (%s) failed\n", + VasEBoot_dprintf ("disk", "finddevice (%s) failed\n", ent->devpath); continue; } - if (grub_ieee1275_get_property (dev, "iconname", tmp, + if (VasEBoot_ieee1275_get_property (dev, "iconname", tmp, sizeof tmp, 0)) { - grub_dprintf ("disk", "get iconname failed\n"); + VasEBoot_dprintf ("disk", "get iconname failed\n"); continue; } - if (grub_strcmp (tmp, "sdmmc") != 0) + if (VasEBoot_strcmp (tmp, "sdmmc") != 0) { - grub_dprintf ("disk", "device is not an SD card\n"); + VasEBoot_dprintf ("disk", "device is not an SD card\n"); continue; } } @@ -417,7 +417,7 @@ grub_ofdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, if (!ent->is_boot && ent->is_removable) continue; - if (hook (ent->grub_shortest, hook_data)) + if (hook (ent->VasEBoot_shortest, hook_data)) return 1; } } @@ -427,7 +427,7 @@ grub_ofdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, static char * compute_dev_path (const char *name) { - char *devpath = grub_malloc (grub_strlen (name) + 3); + char *devpath = VasEBoot_malloc (VasEBoot_strlen (name) + 3); char *p, c; if (!devpath) @@ -451,50 +451,50 @@ compute_dev_path (const char *name) return devpath; } -static grub_err_t -grub_ofdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_ofdisk_open (const char *name, VasEBoot_disk_t disk) { - grub_ieee1275_phandle_t dev; + VasEBoot_ieee1275_phandle_t dev; char *devpath; /* XXX: This should be large enough for any possible case. */ char prop[64]; - grub_ssize_t actual; - grub_uint32_t block_size = 0; - grub_err_t err; + VasEBoot_ssize_t actual; + VasEBoot_uint32_t block_size = 0; + VasEBoot_err_t err; - if (grub_strncmp (name, "ieee1275/", sizeof ("ieee1275/") - 1) != 0) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + if (VasEBoot_strncmp (name, "ieee1275/", sizeof ("ieee1275/") - 1) != 0) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not IEEE1275 device"); devpath = compute_dev_path (name + sizeof ("ieee1275/") - 1); if (! devpath) - return grub_errno; + return VasEBoot_errno; - grub_dprintf ("disk", "Opening `%s'.\n", devpath); + VasEBoot_dprintf ("disk", "Opening `%s'.\n", devpath); - if (grub_ieee1275_finddevice (devpath, &dev)) + if (VasEBoot_ieee1275_finddevice (devpath, &dev)) { - grub_free (devpath); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + VasEBoot_free (devpath); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't read device properties"); } - if (grub_ieee1275_get_property (dev, "device_type", prop, sizeof (prop), + if (VasEBoot_ieee1275_get_property (dev, "device_type", prop, sizeof (prop), &actual)) { - grub_free (devpath); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't read the device type"); + VasEBoot_free (devpath); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't read the device type"); } - if (grub_strcmp (prop, "block")) + if (VasEBoot_strcmp (prop, "block")) { - grub_free (devpath); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a block device"); + VasEBoot_free (devpath); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a block device"); } /* XXX: There is no property to read the number of blocks. There should be a property `#blocks', but it is not there. Perhaps it is possible to use seek for this. */ - disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN; + disk->total_sectors = VasEBoot_DISK_SIZE_UNKNOWN; { struct ofdisk_hash_ent *op; @@ -503,16 +503,16 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) op = ofdisk_hash_add (devpath, NULL); if (!op) { - grub_free (devpath); - return grub_errno; + VasEBoot_free (devpath); + return VasEBoot_errno; } disk->id = (unsigned long) op; disk->data = op->open_path; - err = grub_ofdisk_get_block_size (devpath, &block_size, op); + err = VasEBoot_ofdisk_get_block_size (devpath, &block_size, op); if (err) { - grub_free (devpath); + VasEBoot_free (devpath); return err; } if (block_size != 0) @@ -525,65 +525,65 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) disk->log_sector_size = 9; } - grub_free (devpath); + VasEBoot_free (devpath); return 0; } static void -grub_ofdisk_close (grub_disk_t disk) +VasEBoot_ofdisk_close (VasEBoot_disk_t disk) { if (disk->data == last_devpath) { if (last_ihandle) - grub_ieee1275_close (last_ihandle); + VasEBoot_ieee1275_close (last_ihandle); last_ihandle = 0; last_devpath = NULL; } disk->data = 0; } -static grub_err_t -grub_ofdisk_prepare (grub_disk_t disk, grub_disk_addr_t sector) +static VasEBoot_err_t +VasEBoot_ofdisk_prepare (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector) { - grub_ssize_t status; + VasEBoot_ssize_t status; unsigned long long pos; if (disk->data != last_devpath) { if (last_ihandle) - grub_ieee1275_close (last_ihandle); + VasEBoot_ieee1275_close (last_ihandle); last_ihandle = 0; last_devpath = NULL; - grub_ieee1275_open (disk->data, &last_ihandle); + VasEBoot_ieee1275_open (disk->data, &last_ihandle); if (! last_ihandle) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't open device"); last_devpath = disk->data; } pos = sector << disk->log_sector_size; - grub_ieee1275_seek (last_ihandle, pos, &status); + VasEBoot_ieee1275_seek (last_ihandle, pos, &status); if (status < 0) - return grub_error (GRUB_ERR_READ_ERROR, + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "seek error, can't seek block %llu", (long long) sector); return 0; } -static grub_err_t -grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_ofdisk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_err_t err; - grub_ssize_t actual; - err = grub_ofdisk_prepare (disk, sector); + VasEBoot_err_t err; + VasEBoot_ssize_t actual; + err = VasEBoot_ofdisk_prepare (disk, sector); if (err) return err; - grub_ieee1275_read (last_ihandle, buf, size << disk->log_sector_size, + VasEBoot_ieee1275_read (last_ihandle, buf, size << disk->log_sector_size, &actual); - if (actual != (grub_ssize_t) (size << disk->log_sector_size)) - return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " + if (actual != (VasEBoot_ssize_t) (size << disk->log_sector_size)) + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("failure reading sector 0x%llx " "from `%s'"), (unsigned long long) sector, disk->name); @@ -591,19 +591,19 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector, return 0; } -static grub_err_t -grub_ofdisk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_ofdisk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_err_t err; - grub_ssize_t actual; - err = grub_ofdisk_prepare (disk, sector); + VasEBoot_err_t err; + VasEBoot_ssize_t actual; + err = VasEBoot_ofdisk_prepare (disk, sector); if (err) return err; - grub_ieee1275_write (last_ihandle, buf, size << disk->log_sector_size, + VasEBoot_ieee1275_write (last_ihandle, buf, size << disk->log_sector_size, &actual); - if (actual != (grub_ssize_t) (size << disk->log_sector_size)) - return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " + if (actual != (VasEBoot_ssize_t) (size << disk->log_sector_size)) + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " "to `%s'"), (unsigned long long) sector, disk->name); @@ -611,15 +611,15 @@ grub_ofdisk_write (grub_disk_t disk, grub_disk_addr_t sector, return 0; } -static struct grub_disk_dev grub_ofdisk_dev = +static struct VasEBoot_disk_dev VasEBoot_ofdisk_dev = { .name = "ofdisk", - .id = GRUB_DISK_DEVICE_OFDISK_ID, - .iterate = grub_ofdisk_iterate, - .open = grub_ofdisk_open, - .close = grub_ofdisk_close, - .read = grub_ofdisk_read, - .write = grub_ofdisk_write, + .id = VasEBoot_DISK_DEVICE_OFDISK_ID, + .iterate = VasEBoot_ofdisk_iterate, + .open = VasEBoot_ofdisk_open, + .close = VasEBoot_ofdisk_close, + .read = VasEBoot_ofdisk_read, + .write = VasEBoot_ofdisk_write, .next = 0 }; @@ -627,105 +627,105 @@ static void insert_bootpath (void) { char *bootpath; - grub_ssize_t bootpath_size; + VasEBoot_ssize_t bootpath_size; char *type; - if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath", + if (VasEBoot_ieee1275_get_property_length (VasEBoot_ieee1275_chosen, "bootpath", &bootpath_size) || bootpath_size <= 0) { /* Should never happen. */ - grub_printf ("/chosen/bootpath property missing!\n"); + VasEBoot_printf ("/chosen/bootpath property missing!\n"); return; } - bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64); + bootpath = (char *) VasEBoot_malloc ((VasEBoot_size_t) bootpath_size + 64); if (! bootpath) { - grub_print_error (); + VasEBoot_print_error (); return; } - grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath, - (grub_size_t) bootpath_size + 1, 0); + VasEBoot_ieee1275_get_property (VasEBoot_ieee1275_chosen, "bootpath", bootpath, + (VasEBoot_size_t) bootpath_size + 1, 0); bootpath[bootpath_size] = '\0'; - /* Transform an OF device path to a GRUB path. */ + /* Transform an OF device path to a VasEBoot path. */ - type = grub_ieee1275_get_device_type (bootpath); - if (!(type && grub_strcmp (type, "network") == 0)) + type = VasEBoot_ieee1275_get_device_type (bootpath); + if (!(type && VasEBoot_strcmp (type, "network") == 0)) { struct ofdisk_hash_ent *op; - char *device = grub_ieee1275_get_devname (bootpath); + char *device = VasEBoot_ieee1275_get_devname (bootpath); op = ofdisk_hash_add (device, NULL); op->is_boot = 1; } - grub_free (type); - grub_free (bootpath); + VasEBoot_free (type); + VasEBoot_free (bootpath); } void -grub_ofdisk_fini (void) +VasEBoot_ofdisk_fini (void) { if (last_ihandle) - grub_ieee1275_close (last_ihandle); + VasEBoot_ieee1275_close (last_ihandle); last_ihandle = 0; last_devpath = NULL; - grub_disk_dev_unregister (&grub_ofdisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_ofdisk_dev); } void -grub_ofdisk_init (void) +VasEBoot_ofdisk_init (void) { - grub_disk_firmware_fini = grub_ofdisk_fini; + VasEBoot_disk_firmware_fini = VasEBoot_ofdisk_fini; insert_bootpath (); - grub_disk_dev_register (&grub_ofdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_ofdisk_dev); } -static grub_err_t -grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size, +static VasEBoot_err_t +VasEBoot_ofdisk_get_block_size (const char *device, VasEBoot_uint32_t *block_size, struct ofdisk_hash_ent *op) { struct size_args_ieee1275 { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t result; - grub_ieee1275_cell_t size1; - grub_ieee1275_cell_t size2; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t result; + VasEBoot_ieee1275_cell_t size1; + VasEBoot_ieee1275_cell_t size2; } args_ieee1275; if (last_ihandle) - grub_ieee1275_close (last_ihandle); + VasEBoot_ieee1275_close (last_ihandle); last_ihandle = 0; last_devpath = NULL; - grub_ieee1275_open (device, &last_ihandle); + VasEBoot_ieee1275_open (device, &last_ihandle); if (! last_ihandle) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't open device"); *block_size = 0; if (op->block_size_fails >= 2) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; INIT_IEEE1275_COMMON (&args_ieee1275.common, "call-method", 2, 2); - args_ieee1275.method = (grub_ieee1275_cell_t) "block-size"; + args_ieee1275.method = (VasEBoot_ieee1275_cell_t) "block-size"; args_ieee1275.ihandle = last_ihandle; args_ieee1275.result = 1; if (IEEE1275_CALL_ENTRY_FN (&args_ieee1275) == -1) { - grub_dprintf ("disk", "can't get block size: failed call-method\n"); + VasEBoot_dprintf ("disk", "can't get block size: failed call-method\n"); op->block_size_fails++; } else if (args_ieee1275.result) { - grub_dprintf ("disk", "can't get block size: %lld\n", + VasEBoot_dprintf ("disk", "can't get block size: %lld\n", (long long) args_ieee1275.result); op->block_size_fails++; } diff --git a/VasEBoot-core/disk/ldm.c b/VasEBoot-core/disk/ldm.c index 0f978ad05..0021263a3 100644 --- a/VasEBoot-core/disk/ldm.c +++ b/VasEBoot-core/disk/ldm.c @@ -1,55 +1,55 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_UTIL -#include -#include +#ifdef VasEBoot_UTIL +#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define LDM_GUID_STRLEN 64 #define LDM_NAME_STRLEN 32 -typedef grub_uint8_t *grub_ldm_id_t; +typedef VasEBoot_uint8_t *VasEBoot_ldm_id_t; enum { STRIPE = 1, SPANNED = 2, RAID5 = 3 }; #define LDM_LABEL_SECTOR 6 -struct grub_ldm_vblk { +struct VasEBoot_ldm_vblk { char magic[4]; - grub_uint8_t unused1[12]; - grub_uint16_t update_status; - grub_uint8_t flags; - grub_uint8_t type; - grub_uint32_t unused2; - grub_uint8_t dynamic[104]; -} GRUB_PACKED; + VasEBoot_uint8_t unused1[12]; + VasEBoot_uint16_t update_status; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t type; + VasEBoot_uint32_t unused2; + VasEBoot_uint8_t dynamic[104]; +} VasEBoot_PACKED; #define LDM_VBLK_MAGIC "VBLK" enum @@ -67,34 +67,34 @@ enum ENTRY_VOLUME = 0x51, }; -struct grub_ldm_label +struct VasEBoot_ldm_label { char magic[8]; - grub_uint32_t unused1; - grub_uint16_t ver_major; - grub_uint16_t ver_minor; - grub_uint8_t unused2[32]; + VasEBoot_uint32_t unused1; + VasEBoot_uint16_t ver_major; + VasEBoot_uint16_t ver_minor; + VasEBoot_uint8_t unused2[32]; char disk_guid[LDM_GUID_STRLEN]; char host_guid[LDM_GUID_STRLEN]; char group_guid[LDM_GUID_STRLEN]; char group_name[LDM_NAME_STRLEN]; - grub_uint8_t unused3[11]; - grub_uint64_t pv_start; - grub_uint64_t pv_size; - grub_uint64_t config_start; - grub_uint64_t config_size; -} GRUB_PACKED; + VasEBoot_uint8_t unused3[11]; + VasEBoot_uint64_t pv_start; + VasEBoot_uint64_t pv_size; + VasEBoot_uint64_t config_start; + VasEBoot_uint64_t config_size; +} VasEBoot_PACKED; #define LDM_MAGIC "PRIVHEAD" -static inline grub_uint64_t -read_int (grub_uint8_t *in, grub_size_t s) +static inline VasEBoot_uint64_t +read_int (VasEBoot_uint8_t *in, VasEBoot_size_t s) { - grub_uint8_t *ptr2; - grub_uint64_t ret; + VasEBoot_uint8_t *ptr2; + VasEBoot_uint64_t ret; ret = 0; for (ptr2 = in; ptr2 < in + s; ptr2++) { @@ -105,13 +105,13 @@ read_int (grub_uint8_t *in, grub_size_t s) } static int -check_ldm_partition (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t p, void *data) +check_ldm_partition (VasEBoot_disk_t disk __attribute__ ((unused)), const VasEBoot_partition_t p, void *data) { int *has_ldm = data; if (p->number >= 4) return 1; - if (p->msdostype == GRUB_PC_PARTITION_TYPE_LDM) + if (p->msdostype == VasEBoot_PC_PARTITION_TYPE_LDM) { *has_ldm = 1; return 1; @@ -120,34 +120,34 @@ check_ldm_partition (grub_disk_t disk __attribute__ ((unused)), const grub_parti } static int -msdos_has_ldm_partition (grub_disk_t dsk) +msdos_has_ldm_partition (VasEBoot_disk_t dsk) { - grub_err_t err; + VasEBoot_err_t err; int has_ldm = 0; - err = grub_partition_msdos_iterate (dsk, check_ldm_partition, &has_ldm); + err = VasEBoot_partition_msdos_iterate (dsk, check_ldm_partition, &has_ldm); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } return has_ldm; } -static const grub_gpt_part_type_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM; +static const VasEBoot_gpt_part_type_t ldm_type = VasEBoot_GPT_PARTITION_TYPE_LDM; /* Helper for gpt_ldm_sector. */ static int -gpt_ldm_sector_iter (grub_disk_t disk, const grub_partition_t p, void *data) +gpt_ldm_sector_iter (VasEBoot_disk_t disk, const VasEBoot_partition_t p, void *data) { - grub_disk_addr_t *sector = data; - struct grub_gpt_partentry gptdata; - grub_partition_t p2; + VasEBoot_disk_addr_t *sector = data; + struct VasEBoot_gpt_partentry gptdata; + VasEBoot_partition_t p2; p2 = disk->partition; disk->partition = p->parent; - if (grub_disk_read (disk, p->offset, p->index, + if (VasEBoot_disk_read (disk, p->offset, p->index, sizeof (gptdata), &gptdata)) { disk->partition = p2; @@ -155,7 +155,7 @@ gpt_ldm_sector_iter (grub_disk_t disk, const grub_partition_t p, void *data) } disk->partition = p2; - if (! grub_memcmp (&gptdata.type, &ldm_type, 16)) + if (! VasEBoot_memcmp (&gptdata.type, &ldm_type, 16)) { *sector = p->start + p->len - 1; return 1; @@ -163,81 +163,81 @@ gpt_ldm_sector_iter (grub_disk_t disk, const grub_partition_t p, void *data) return 0; } -static grub_disk_addr_t -gpt_ldm_sector (grub_disk_t dsk) +static VasEBoot_disk_addr_t +gpt_ldm_sector (VasEBoot_disk_t dsk) { - grub_disk_addr_t sector = 0; - grub_err_t err; + VasEBoot_disk_addr_t sector = 0; + VasEBoot_err_t err; - err = grub_gpt_partition_map_iterate (dsk, gpt_ldm_sector_iter, §or); + err = VasEBoot_gpt_partition_map_iterate (dsk, gpt_ldm_sector_iter, §or); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } return sector; } -static struct grub_diskfilter_vg * -make_vg (grub_disk_t disk, - const struct grub_ldm_label *label) +static struct VasEBoot_diskfilter_vg * +make_vg (VasEBoot_disk_t disk, + const struct VasEBoot_ldm_label *label) { - grub_disk_addr_t startsec, endsec, cursec; - struct grub_diskfilter_vg *vg; - grub_err_t err; + VasEBoot_disk_addr_t startsec, endsec, cursec; + struct VasEBoot_diskfilter_vg *vg; + VasEBoot_err_t err; /* First time we see this volume group. We've to create the whole volume group structure. */ - vg = grub_malloc (sizeof (*vg)); + vg = VasEBoot_malloc (sizeof (*vg)); if (! vg) return NULL; vg->extent_size = 1; - vg->name = grub_malloc (LDM_NAME_STRLEN + 1); - vg->uuid = grub_malloc (LDM_GUID_STRLEN + 1); + vg->name = VasEBoot_malloc (LDM_NAME_STRLEN + 1); + vg->uuid = VasEBoot_malloc (LDM_GUID_STRLEN + 1); if (! vg->uuid || !vg->name) { - grub_free (vg->uuid); - grub_free (vg->name); + VasEBoot_free (vg->uuid); + VasEBoot_free (vg->name); return NULL; } - grub_memcpy (vg->uuid, label->group_guid, LDM_GUID_STRLEN); - grub_memcpy (vg->name, label->group_name, LDM_NAME_STRLEN); + VasEBoot_memcpy (vg->uuid, label->group_guid, LDM_GUID_STRLEN); + VasEBoot_memcpy (vg->name, label->group_name, LDM_NAME_STRLEN); vg->name[LDM_NAME_STRLEN] = 0; vg->uuid[LDM_GUID_STRLEN] = 0; - vg->uuid_len = grub_strlen (vg->uuid); + vg->uuid_len = VasEBoot_strlen (vg->uuid); vg->lvs = NULL; vg->pvs = NULL; - startsec = grub_be_to_cpu64 (label->config_start); - endsec = startsec + grub_be_to_cpu64 (label->config_size); + startsec = VasEBoot_be_to_cpu64 (label->config_start); + endsec = startsec + VasEBoot_be_to_cpu64 (label->config_size); /* First find disks. */ for (cursec = startsec + 0x12; cursec < endsec; cursec++) { - struct grub_ldm_vblk vblk[GRUB_DISK_SECTOR_SIZE - / sizeof (struct grub_ldm_vblk)]; + struct VasEBoot_ldm_vblk vblk[VasEBoot_DISK_SECTOR_SIZE + / sizeof (struct VasEBoot_ldm_vblk)]; unsigned i; - err = grub_disk_read (disk, cursec, 0, + err = VasEBoot_disk_read (disk, cursec, 0, sizeof(vblk), &vblk); if (err) goto fail2; for (i = 0; i < ARRAY_SIZE (vblk); i++) { - struct grub_diskfilter_pv *pv; - grub_uint8_t *ptr; - if (grub_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, + struct VasEBoot_diskfilter_pv *pv; + VasEBoot_uint8_t *ptr; + if (VasEBoot_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, sizeof (vblk[i].magic)) != 0) continue; - if (grub_be_to_cpu16 (vblk[i].update_status) + if (VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_CONSISTENT - && grub_be_to_cpu16 (vblk[i].update_status) + && VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_STILL_ACTIVE) continue; if (vblk[i].type != ENTRY_DISK) continue; - pv = grub_zalloc (sizeof (*pv)); + pv = VasEBoot_zalloc (sizeof (*pv)); if (!pv) goto fail2; @@ -246,23 +246,23 @@ make_vg (grub_disk_t disk, if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (pv); + VasEBoot_free (pv); goto fail2; } - pv->internal_id = grub_malloc (ptr[0] + 2); + pv->internal_id = VasEBoot_malloc (ptr[0] + 2); if (!pv->internal_id) { - grub_free (pv); + VasEBoot_free (pv); goto fail2; } - grub_memcpy (pv->internal_id, ptr, (grub_size_t) ptr[0] + 1); - pv->internal_id[(grub_size_t) ptr[0] + 1] = 0; + VasEBoot_memcpy (pv->internal_id, ptr, (VasEBoot_size_t) ptr[0] + 1); + pv->internal_id[(VasEBoot_size_t) ptr[0] + 1] = 0; ptr += *ptr + 1; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (pv); + VasEBoot_free (pv); goto fail2; } /* ptr = name. */ @@ -270,12 +270,12 @@ make_vg (grub_disk_t disk, if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (pv); + VasEBoot_free (pv); goto fail2; } pv->id.uuidlen = *ptr; - pv->id.uuid = grub_malloc (pv->id.uuidlen + 1); - grub_memcpy (pv->id.uuid, ptr + 1, pv->id.uuidlen); + pv->id.uuid = VasEBoot_malloc (pv->id.uuidlen + 1); + VasEBoot_memcpy (pv->id.uuid, ptr + 1, pv->id.uuidlen); pv->id.uuid[pv->id.uuidlen] = 0; pv->next = vg->pvs; @@ -286,29 +286,29 @@ make_vg (grub_disk_t disk, /* Then find LVs. */ for (cursec = startsec + 0x12; cursec < endsec; cursec++) { - struct grub_ldm_vblk vblk[GRUB_DISK_SECTOR_SIZE - / sizeof (struct grub_ldm_vblk)]; + struct VasEBoot_ldm_vblk vblk[VasEBoot_DISK_SECTOR_SIZE + / sizeof (struct VasEBoot_ldm_vblk)]; unsigned i; - err = grub_disk_read (disk, cursec, 0, + err = VasEBoot_disk_read (disk, cursec, 0, sizeof(vblk), &vblk); if (err) goto fail2; for (i = 0; i < ARRAY_SIZE (vblk); i++) { - struct grub_diskfilter_lv *lv; - grub_uint8_t *ptr; - if (grub_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, + struct VasEBoot_diskfilter_lv *lv; + VasEBoot_uint8_t *ptr; + if (VasEBoot_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, sizeof (vblk[i].magic)) != 0) continue; - if (grub_be_to_cpu16 (vblk[i].update_status) + if (VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_CONSISTENT - && grub_be_to_cpu16 (vblk[i].update_status) + && VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_STILL_ACTIVE) continue; if (vblk[i].type != ENTRY_VOLUME) continue; - lv = grub_zalloc (sizeof (*lv)); + lv = VasEBoot_zalloc (sizeof (*lv)); if (!lv) goto fail2; @@ -316,14 +316,14 @@ make_vg (grub_disk_t disk, lv->segment_count = 1; lv->segment_alloc = 1; lv->visible = 1; - lv->segments = grub_zalloc (sizeof (*lv->segments)); + lv->segments = VasEBoot_zalloc (sizeof (*lv->segments)); if (!lv->segments) goto fail2; lv->segments->start_extent = 0; - lv->segments->type = GRUB_DISKFILTER_MIRROR; + lv->segments->type = VasEBoot_DISKFILTER_MIRROR; lv->segments->node_count = 0; lv->segments->node_alloc = 8; - lv->segments->nodes = grub_zalloc (sizeof (*lv->segments->nodes) + lv->segments->nodes = VasEBoot_zalloc (sizeof (*lv->segments->nodes) * lv->segments->node_alloc); if (!lv->segments->nodes) goto fail2; @@ -331,68 +331,68 @@ make_vg (grub_disk_t disk, if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv); + VasEBoot_free (lv); goto fail2; } - lv->internal_id = grub_malloc ((grub_size_t) ptr[0] + 2); + lv->internal_id = VasEBoot_malloc ((VasEBoot_size_t) ptr[0] + 2); if (!lv->internal_id) { - grub_free (lv); + VasEBoot_free (lv); goto fail2; } - grub_memcpy (lv->internal_id, ptr, ptr[0] + 1); + VasEBoot_memcpy (lv->internal_id, ptr, ptr[0] + 1); lv->internal_id[ptr[0] + 1] = 0; ptr += *ptr + 1; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv); + VasEBoot_free (lv); goto fail2; } - lv->name = grub_malloc (*ptr + 1); + lv->name = VasEBoot_malloc (*ptr + 1); if (!lv->name) { - grub_free (lv->internal_id); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv); goto fail2; } - grub_memcpy (lv->name, ptr + 1, *ptr); + VasEBoot_memcpy (lv->name, ptr + 1, *ptr); lv->name[*ptr] = 0; - lv->fullname = grub_xasprintf ("ldm/%s/%s", + lv->fullname = VasEBoot_xasprintf ("ldm/%s/%s", vg->uuid, lv->name); if (!lv->fullname) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } ptr += *ptr + 1; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } /* ptr = volume type. */ ptr += *ptr + 1; if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } /* ptr = flags. */ ptr += *ptr + 1; if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } @@ -401,17 +401,17 @@ make_vg (grub_disk_t disk, /* ptr = number of children. */ if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } ptr += *ptr + 1; if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } @@ -421,9 +421,9 @@ make_vg (grub_disk_t disk, || ptr + *ptr + 1>= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail2; } lv->size = read_int (ptr + 1, *ptr); @@ -437,32 +437,32 @@ make_vg (grub_disk_t disk, /* Now the components. */ for (cursec = startsec + 0x12; cursec < endsec; cursec++) { - struct grub_ldm_vblk vblk[GRUB_DISK_SECTOR_SIZE - / sizeof (struct grub_ldm_vblk)]; + struct VasEBoot_ldm_vblk vblk[VasEBoot_DISK_SECTOR_SIZE + / sizeof (struct VasEBoot_ldm_vblk)]; unsigned i; - err = grub_disk_read (disk, cursec, 0, + err = VasEBoot_disk_read (disk, cursec, 0, sizeof(vblk), &vblk); if (err) goto fail2; for (i = 0; i < ARRAY_SIZE (vblk); i++) { - struct grub_diskfilter_lv *comp; - struct grub_diskfilter_lv *lv; - grub_uint8_t type; + struct VasEBoot_diskfilter_lv *comp; + struct VasEBoot_diskfilter_lv *lv; + VasEBoot_uint8_t type; - grub_uint8_t *ptr; - if (grub_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, + VasEBoot_uint8_t *ptr; + if (VasEBoot_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, sizeof (vblk[i].magic)) != 0) continue; - if (grub_be_to_cpu16 (vblk[i].update_status) + if (VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_CONSISTENT - && grub_be_to_cpu16 (vblk[i].update_status) + && VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_STILL_ACTIVE) continue; if (vblk[i].type != ENTRY_COMPONENT) continue; - comp = grub_zalloc (sizeof (*comp)); + comp = VasEBoot_zalloc (sizeof (*comp)); if (!comp) goto fail2; comp->visible = 0; @@ -474,28 +474,28 @@ make_vg (grub_disk_t disk, { goto fail2; } - comp->internal_id = grub_malloc ((grub_size_t) ptr[0] + 2); + comp->internal_id = VasEBoot_malloc ((VasEBoot_size_t) ptr[0] + 2); if (!comp->internal_id) { - grub_free (comp); + VasEBoot_free (comp); goto fail2; } - grub_memcpy (comp->internal_id, ptr, ptr[0] + 1); + VasEBoot_memcpy (comp->internal_id, ptr, ptr[0] + 1); comp->internal_id[ptr[0] + 1] = 0; ptr += *ptr + 1; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } /* ptr = name. */ ptr += *ptr + 1; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } /* ptr = state. */ @@ -505,8 +505,8 @@ make_vg (grub_disk_t disk, ptr += 4; if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } @@ -514,28 +514,28 @@ make_vg (grub_disk_t disk, ptr += *ptr + 1; if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } ptr += 8 + 8; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } for (lv = vg->lvs; lv; lv = lv->next) { if (lv->internal_id[0] == ptr[0] - && grub_memcmp (lv->internal_id + 1, ptr + 1, ptr[0]) == 0) + && VasEBoot_memcmp (lv->internal_id + 1, ptr + 1, ptr[0]) == 0) break; } if (!lv) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); continue; } comp->size = lv->size; @@ -543,7 +543,7 @@ make_vg (grub_disk_t disk, { comp->segment_alloc = 8; comp->segment_count = 0; - comp->segments = grub_malloc (sizeof (*comp->segments) + comp->segments = VasEBoot_malloc (sizeof (*comp->segments) * comp->segment_alloc); if (!comp->segments) goto fail2; @@ -552,18 +552,18 @@ make_vg (grub_disk_t disk, { comp->segment_alloc = 1; comp->segment_count = 1; - comp->segments = grub_malloc (sizeof (*comp->segments)); + comp->segments = VasEBoot_malloc (sizeof (*comp->segments)); if (!comp->segments) goto fail2; comp->segments->start_extent = 0; comp->segments->extent_count = lv->size; comp->segments->layout = 0; if (type == STRIPE) - comp->segments->type = GRUB_DISKFILTER_STRIPED; + comp->segments->type = VasEBoot_DISKFILTER_STRIPED; else if (type == RAID5) { - comp->segments->type = GRUB_DISKFILTER_RAID5; - comp->segments->layout = GRUB_RAID_LAYOUT_SYMMETRIC_MASK; + comp->segments->type = VasEBoot_DISKFILTER_RAID5; + comp->segments->layout = VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK; } else goto fail2; @@ -575,8 +575,8 @@ make_vg (grub_disk_t disk, || ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } comp->segments->stripe_size = read_int (ptr + 1, *ptr); @@ -584,13 +584,13 @@ make_vg (grub_disk_t disk, if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { - grub_free (comp->internal_id); - grub_free (comp); + VasEBoot_free (comp->internal_id); + VasEBoot_free (comp); goto fail2; } comp->segments->node_count = read_int (ptr + 1, *ptr); comp->segments->node_alloc = comp->segments->node_count; - comp->segments->nodes = grub_zalloc (sizeof (*comp->segments->nodes) + comp->segments->nodes = VasEBoot_zalloc (sizeof (*comp->segments->nodes) * comp->segments->node_alloc); if (!lv->segments->nodes) goto fail2; @@ -600,7 +600,7 @@ make_vg (grub_disk_t disk, { void *t; lv->segments->node_alloc *= 2; - t = grub_realloc (lv->segments->nodes, + t = VasEBoot_realloc (lv->segments->nodes, sizeof (*lv->segments->nodes) * lv->segments->node_alloc); if (!t) @@ -617,28 +617,28 @@ make_vg (grub_disk_t disk, /* Partitions. */ for (cursec = startsec + 0x12; cursec < endsec; cursec++) { - struct grub_ldm_vblk vblk[GRUB_DISK_SECTOR_SIZE - / sizeof (struct grub_ldm_vblk)]; + struct VasEBoot_ldm_vblk vblk[VasEBoot_DISK_SECTOR_SIZE + / sizeof (struct VasEBoot_ldm_vblk)]; unsigned i; - err = grub_disk_read (disk, cursec, 0, + err = VasEBoot_disk_read (disk, cursec, 0, sizeof(vblk), &vblk); if (err) goto fail2; for (i = 0; i < ARRAY_SIZE (vblk); i++) { - struct grub_diskfilter_lv *comp; - struct grub_diskfilter_node part; - grub_disk_addr_t start, size; + struct VasEBoot_diskfilter_lv *comp; + struct VasEBoot_diskfilter_node part; + VasEBoot_disk_addr_t start, size; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; part.name = 0; - if (grub_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, + if (VasEBoot_memcmp (vblk[i].magic, LDM_VBLK_MAGIC, sizeof (vblk[i].magic)) != 0) continue; - if (grub_be_to_cpu16 (vblk[i].update_status) + if (VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_CONSISTENT - && grub_be_to_cpu16 (vblk[i].update_status) + && VasEBoot_be_to_cpu16 (vblk[i].update_status) != STATUS_STILL_ACTIVE) continue; if (vblk[i].type != ENTRY_PARTITION) @@ -688,7 +688,7 @@ make_vg (grub_disk_t disk, for (comp = vg->lvs; comp; comp = comp->next) if (comp->internal_id[0] == ptr[0] - && grub_memcmp (ptr + 1, comp->internal_id + 1, + && VasEBoot_memcmp (ptr + 1, comp->internal_id + 1, comp->internal_id[0]) == 0) goto out; continue; @@ -699,10 +699,10 @@ make_vg (grub_disk_t disk, goto fail2; } ptr += *ptr + 1; - struct grub_diskfilter_pv *pv; + struct VasEBoot_diskfilter_pv *pv; for (pv = vg->pvs; pv; pv = pv->next) if (pv->internal_id[0] == ptr[0] - && grub_memcmp (pv->internal_id + 1, ptr + 1, ptr[0]) == 0) + && VasEBoot_memcmp (pv->internal_id + 1, ptr + 1, ptr[0]) == 0) part.pv = pv; if (comp->segment_alloc == 1) @@ -724,7 +724,7 @@ make_vg (grub_disk_t disk, { void *t; comp->segment_alloc *= 2; - t = grub_realloc (comp->segments, + t = VasEBoot_realloc (comp->segments, comp->segment_alloc * sizeof (*comp->segments)); if (!t) @@ -733,11 +733,11 @@ make_vg (grub_disk_t disk, } comp->segments[comp->segment_count].start_extent = start; comp->segments[comp->segment_count].extent_count = size; - comp->segments[comp->segment_count].type = GRUB_DISKFILTER_STRIPED; + comp->segments[comp->segment_count].type = VasEBoot_DISKFILTER_STRIPED; comp->segments[comp->segment_count].node_count = 1; comp->segments[comp->segment_count].node_alloc = 1; comp->segments[comp->segment_count].nodes - = grub_malloc (sizeof (*comp->segments[comp->segment_count].nodes)); + = VasEBoot_malloc (sizeof (*comp->segments[comp->segment_count].nodes)); if (!comp->segments[comp->segment_count].nodes) goto fail2; comp->segments[comp->segment_count].nodes[0] = part; @@ -745,49 +745,49 @@ make_vg (grub_disk_t disk, } } } - if (grub_diskfilter_vg_register (vg)) + if (VasEBoot_diskfilter_vg_register (vg)) goto fail2; return vg; fail2: { - struct grub_diskfilter_lv *lv, *next_lv; - struct grub_diskfilter_pv *pv, *next_pv; + struct VasEBoot_diskfilter_lv *lv, *next_lv; + struct VasEBoot_diskfilter_pv *pv, *next_pv; for (lv = vg->lvs; lv; lv = next_lv) { unsigned i; for (i = 0; i < lv->segment_count; i++) - grub_free (lv->segments[i].nodes); + VasEBoot_free (lv->segments[i].nodes); next_lv = lv->next; - grub_free (lv->segments); - grub_free (lv->internal_id); - grub_free (lv->name); - grub_free (lv->fullname); - grub_free (lv); + VasEBoot_free (lv->segments); + VasEBoot_free (lv->internal_id); + VasEBoot_free (lv->name); + VasEBoot_free (lv->fullname); + VasEBoot_free (lv); } for (pv = vg->pvs; pv; pv = next_pv) { next_pv = pv->next; - grub_free (pv->id.uuid); - grub_free (pv); + VasEBoot_free (pv->id.uuid); + VasEBoot_free (pv); } } - grub_free (vg->uuid); - grub_free (vg); + VasEBoot_free (vg->uuid); + VasEBoot_free (vg); return NULL; } -static struct grub_diskfilter_vg * -grub_ldm_detect (grub_disk_t disk, - struct grub_diskfilter_pv_id *id, - grub_disk_addr_t *start_sector) +static struct VasEBoot_diskfilter_vg * +VasEBoot_ldm_detect (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_pv_id *id, + VasEBoot_disk_addr_t *start_sector) { - grub_err_t err; - struct grub_ldm_label label; - struct grub_diskfilter_vg *vg; + VasEBoot_err_t err; + struct VasEBoot_ldm_label label; + struct VasEBoot_diskfilter_vg *vg; -#ifdef GRUB_UTIL - grub_util_info ("scanning %s for LDM", disk->name); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("scanning %s for LDM", disk->name); #endif { @@ -795,7 +795,7 @@ grub_ldm_detect (grub_disk_t disk, int has_ldm = msdos_has_ldm_partition (disk); for (i = 0; i < 3; i++) { - grub_disk_addr_t sector = LDM_LABEL_SECTOR; + VasEBoot_disk_addr_t sector = LDM_LABEL_SECTOR; switch (i) { case 0: @@ -807,8 +807,8 @@ grub_ldm_detect (grub_disk_t disk, /* LDM is never inside a partition. */ if (!has_ldm || disk->partition) continue; - sector = grub_disk_get_size (disk); - if (sector == GRUB_DISK_SIZE_UNKNOWN) + sector = VasEBoot_disk_get_size (disk); + if (sector == VasEBoot_DISK_SIZE_UNKNOWN) continue; sector--; break; @@ -819,68 +819,68 @@ grub_ldm_detect (grub_disk_t disk, continue; break; } - err = grub_disk_read (disk, sector, 0, + err = VasEBoot_disk_read (disk, sector, 0, sizeof(label), &label); if (err) return NULL; - if (grub_memcmp (label.magic, LDM_MAGIC, sizeof (label.magic)) == 0 - && grub_be_to_cpu16 (label.ver_major) == 0x02 - && grub_be_to_cpu16 (label.ver_minor) >= 0x0b - && grub_be_to_cpu16 (label.ver_minor) <= 0x0c) + if (VasEBoot_memcmp (label.magic, LDM_MAGIC, sizeof (label.magic)) == 0 + && VasEBoot_be_to_cpu16 (label.ver_major) == 0x02 + && VasEBoot_be_to_cpu16 (label.ver_minor) >= 0x0b + && VasEBoot_be_to_cpu16 (label.ver_minor) <= 0x0c) break; } /* Return if we didn't find a label. */ if (i == 3) { -#ifdef GRUB_UTIL - grub_util_info ("no LDM signature found"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("no LDM signature found"); #endif return NULL; } } - id->uuid = grub_malloc (LDM_GUID_STRLEN + 1); + id->uuid = VasEBoot_malloc (LDM_GUID_STRLEN + 1); if (!id->uuid) return NULL; - grub_memcpy (id->uuid, label.disk_guid, LDM_GUID_STRLEN); + VasEBoot_memcpy (id->uuid, label.disk_guid, LDM_GUID_STRLEN); id->uuid[LDM_GUID_STRLEN] = 0; - id->uuidlen = grub_strlen ((char *) id->uuid); - *start_sector = grub_be_to_cpu64 (label.pv_start); + id->uuidlen = VasEBoot_strlen ((char *) id->uuid); + *start_sector = VasEBoot_be_to_cpu64 (label.pv_start); { - grub_size_t s; + VasEBoot_size_t s; for (s = 0; s < LDM_GUID_STRLEN && label.group_guid[s]; s++); - vg = grub_diskfilter_get_vg_by_uuid (s, label.group_guid); + vg = VasEBoot_diskfilter_get_vg_by_uuid (s, label.group_guid); if (! vg) vg = make_vg (disk, &label); } if (!vg) { - grub_free (id->uuid); + VasEBoot_free (id->uuid); return NULL; } return vg; } -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL char * -grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start) +VasEBoot_util_get_ldm (VasEBoot_disk_t disk, VasEBoot_disk_addr_t start) { - struct grub_diskfilter_pv *pv = NULL; - struct grub_diskfilter_vg *vg = NULL; - struct grub_diskfilter_lv *res = 0, *lv, *res_lv = 0; + struct VasEBoot_diskfilter_pv *pv = NULL; + struct VasEBoot_diskfilter_vg *vg = NULL; + struct VasEBoot_diskfilter_lv *res = 0, *lv, *res_lv = 0; - pv = grub_diskfilter_get_pv_from_disk (disk, &vg); + pv = VasEBoot_diskfilter_get_pv_from_disk (disk, &vg); if (!pv) return NULL; for (lv = vg->lvs; lv; lv = lv->next) if (lv->segment_count == 1 && lv->segments->node_count == 1 - && lv->segments->type == GRUB_DISKFILTER_STRIPED + && lv->segments->type == VasEBoot_DISKFILTER_STRIPED && lv->segments->nodes->pv == pv && lv->segments->nodes->start + pv->start_sector == start) { @@ -891,27 +891,27 @@ grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start) return NULL; for (lv = vg->lvs; lv; lv = lv->next) if (lv->segment_count == 1 && lv->segments->node_count == 1 - && lv->segments->type == GRUB_DISKFILTER_MIRROR + && lv->segments->type == VasEBoot_DISKFILTER_MIRROR && lv->segments->nodes->lv == res_lv) { res = lv; break; } if (res && res->fullname) - return grub_strdup (res->fullname); + return VasEBoot_strdup (res->fullname); return NULL; } int -grub_util_is_ldm (grub_disk_t disk) +VasEBoot_util_is_ldm (VasEBoot_disk_t disk) { int i; int has_ldm = msdos_has_ldm_partition (disk); for (i = 0; i < 3; i++) { - grub_disk_addr_t sector = LDM_LABEL_SECTOR; - grub_err_t err; - struct grub_ldm_label label; + VasEBoot_disk_addr_t sector = LDM_LABEL_SECTOR; + VasEBoot_err_t err; + struct VasEBoot_ldm_label label; switch (i) { @@ -924,8 +924,8 @@ grub_util_is_ldm (grub_disk_t disk) /* LDM is never inside a partition. */ if (!has_ldm || disk->partition) continue; - sector = grub_disk_get_size (disk); - if (sector == GRUB_DISK_SIZE_UNKNOWN) + sector = VasEBoot_disk_get_size (disk); + if (sector == VasEBoot_DISK_SIZE_UNKNOWN) continue; sector--; break; @@ -936,49 +936,49 @@ grub_util_is_ldm (grub_disk_t disk) continue; break; } - err = grub_disk_read (disk, sector, 0, sizeof(label), &label); + err = VasEBoot_disk_read (disk, sector, 0, sizeof(label), &label); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } /* This check is more relaxed on purpose. */ - if (grub_memcmp (label.magic, LDM_MAGIC, sizeof (label.magic)) == 0) + if (VasEBoot_memcmp (label.magic, LDM_MAGIC, sizeof (label.magic)) == 0) return 1; } return 0; } -grub_err_t -grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors, +VasEBoot_err_t +VasEBoot_util_ldm_embed (struct VasEBoot_disk *disk, unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors) + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors) { - struct grub_diskfilter_pv *pv = NULL; - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_lv *lv; + struct VasEBoot_diskfilter_pv *pv = NULL; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_lv *lv; unsigned i; - if (embed_type != GRUB_EMBED_PCBIOS) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (embed_type != VasEBoot_EMBED_PCBIOS) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "LDM currently supports only PC-BIOS embedding"); if (disk->partition) - return grub_error (GRUB_ERR_BUG, "disk isn't LDM"); - pv = grub_diskfilter_get_pv_from_disk (disk, &vg); + return VasEBoot_error (VasEBoot_ERR_BUG, "disk isn't LDM"); + pv = VasEBoot_diskfilter_get_pv_from_disk (disk, &vg); if (!pv) - return grub_error (GRUB_ERR_BUG, "disk isn't LDM"); + return VasEBoot_error (VasEBoot_ERR_BUG, "disk isn't LDM"); for (lv = vg->lvs; lv; lv = lv->next) { - struct grub_diskfilter_lv *comp; + struct VasEBoot_diskfilter_lv *comp; if (!lv->visible || !lv->fullname) continue; if (lv->segment_count != 1) continue; - if (lv->segments->type != GRUB_DISKFILTER_MIRROR + if (lv->segments->type != VasEBoot_DISKFILTER_MIRROR || lv->segments->node_count != 1 || lv->segments->start_extent != 0 || lv->segments->extent_count != lv->size) @@ -990,7 +990,7 @@ grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors, if (comp->segment_count != 1 || comp->size != lv->size) continue; - if (comp->segments->type != GRUB_DISKFILTER_STRIPED + if (comp->segments->type != VasEBoot_DISKFILTER_STRIPED || comp->segments->node_count != 1 || comp->segments->start_extent != 0 || comp->segments->extent_count != lv->size) @@ -1001,13 +1001,13 @@ grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors, if (1) continue; #else - if (grub_strcmp (lv->name, "Volume5") != 0) + if (VasEBoot_strcmp (lv->name, "Volume5") != 0) continue; #endif if (lv->size < *nsectors) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, /* TRANSLATORS: it's a partition for embedding, - not a partition embed into something. GRUB + not a partition embed into something. VasEBoot install tools put core.img into a place usable for bootloaders (called generically "embedding zone") and this operation is @@ -1017,17 +1017,17 @@ grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors, *nsectors = lv->size; if (*nsectors > max_nsectors) *nsectors = max_nsectors; - *sectors = grub_malloc (*nsectors * sizeof (**sectors)); + *sectors = VasEBoot_malloc (*nsectors * sizeof (**sectors)); if (!*sectors) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < *nsectors; i++) (*sectors)[i] = (lv->segments->nodes->start + comp->segments->nodes->start + comp->segments->nodes->pv->start_sector + i); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, /* TRANSLATORS: it's a partition for embedding, not a partition embed into something. */ N_("this LDM has no Embedding Partition;" @@ -1035,18 +1035,18 @@ grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors, } #endif -static struct grub_diskfilter grub_ldm_dev = { +static struct VasEBoot_diskfilter VasEBoot_ldm_dev = { .name = "ldm", - .detect = grub_ldm_detect, + .detect = VasEBoot_ldm_detect, .next = 0 }; -GRUB_MOD_INIT (ldm) +VasEBoot_MOD_INIT (ldm) { - grub_diskfilter_register_back (&grub_ldm_dev); + VasEBoot_diskfilter_register_back (&VasEBoot_ldm_dev); } -GRUB_MOD_FINI (ldm) +VasEBoot_MOD_FINI (ldm) { - grub_diskfilter_unregister (&grub_ldm_dev); + VasEBoot_diskfilter_unregister (&VasEBoot_ldm_dev); } diff --git a/VasEBoot-core/disk/loopback.c b/VasEBoot-core/disk/loopback.c index 2d8deaeaf..7a53f0136 100644 --- a/VasEBoot-core/disk/loopback.c +++ b/VasEBoot-core/disk/loopback.c @@ -1,44 +1,44 @@ /* loopback.c - command to add loopback devices. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_loopback +struct VasEBoot_loopback { char *devname; - grub_file_t file; - struct grub_loopback *next; + VasEBoot_file_t file; + struct VasEBoot_loopback *next; unsigned long id; }; -static struct grub_loopback *loopback_list; +static struct VasEBoot_loopback *loopback_list; static unsigned long last_id = 0; -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { /* TRANSLATORS: The disk is simply removed from the list of available ones, not wiped, avoid to scare user. */ @@ -47,77 +47,77 @@ static const struct grub_arg_option options[] = }; /* Delete the loopback device NAME. */ -static grub_err_t +static VasEBoot_err_t delete_loopback (const char *name) { - struct grub_loopback *dev; - struct grub_loopback **prev; + struct VasEBoot_loopback *dev; + struct VasEBoot_loopback **prev; /* Search for the device. */ for (dev = loopback_list, prev = &loopback_list; dev; prev = &dev->next, dev = dev->next) - if (grub_strcmp (dev->devname, name) == 0) + if (VasEBoot_strcmp (dev->devname, name) == 0) break; if (! dev) - return grub_error (GRUB_ERR_BAD_DEVICE, "device not found"); + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "device not found"); /* Remove the device from the list. */ *prev = dev->next; - grub_free (dev->devname); - grub_file_close (dev->file); - grub_free (dev); + VasEBoot_free (dev->devname); + VasEBoot_file_close (dev->file); + VasEBoot_free (dev); return 0; } /* The command to add and remove loopback devices. */ -static grub_err_t -grub_cmd_loopback (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_loopback (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; - grub_file_t file; - struct grub_loopback *newdev; - grub_err_t ret; + struct VasEBoot_arg_list *state = ctxt->state; + VasEBoot_file_t file; + struct VasEBoot_loopback *newdev; + VasEBoot_err_t ret; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "device name required"); /* Check if `-d' was used. */ if (state[0].set) return delete_loopback (args[0]); if (argc < 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (args[1]); + file = VasEBoot_file_open (args[1]); if (! file) - return grub_errno; + return VasEBoot_errno; /* First try to replace the old device. */ for (newdev = loopback_list; newdev; newdev = newdev->next) - if (grub_strcmp (newdev->devname, args[0]) == 0) + if (VasEBoot_strcmp (newdev->devname, args[0]) == 0) break; if (newdev) { - grub_file_close (newdev->file); + VasEBoot_file_close (newdev->file); newdev->file = file; return 0; } /* Unable to replace it, make a new entry. */ - newdev = grub_malloc (sizeof (struct grub_loopback)); + newdev = VasEBoot_malloc (sizeof (struct VasEBoot_loopback)); if (! newdev) goto fail; - newdev->devname = grub_strdup (args[0]); + newdev->devname = VasEBoot_strdup (args[0]); if (! newdev->devname) { - grub_free (newdev); + VasEBoot_free (newdev); goto fail; } @@ -131,18 +131,18 @@ grub_cmd_loopback (grub_extcmd_context_t ctxt, int argc, char **args) return 0; fail: - ret = grub_errno; - grub_file_close (file); + ret = VasEBoot_errno; + VasEBoot_file_close (file); return ret; } static int -grub_loopback_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_loopback_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_loopback *d; - if (pull != GRUB_DISK_PULL_NONE) + struct VasEBoot_loopback *d; + if (pull != VasEBoot_DISK_PULL_NONE) return 0; for (d = loopback_list; d; d = d->next) { @@ -152,27 +152,27 @@ grub_loopback_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_loopback_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_loopback_open (const char *name, VasEBoot_disk_t disk) { - struct grub_loopback *dev; + struct VasEBoot_loopback *dev; for (dev = loopback_list; dev; dev = dev->next) - if (grub_strcmp (dev->devname, name) == 0) + if (VasEBoot_strcmp (dev->devname, name) == 0) break; if (! dev) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "can't open device"); /* Use the filesize for the disk size, round up to a complete sector. */ - if (dev->file->size != GRUB_FILE_SIZE_UNKNOWN) - disk->total_sectors = ((dev->file->size + GRUB_DISK_SECTOR_SIZE - 1) - / GRUB_DISK_SECTOR_SIZE); + if (dev->file->size != VasEBoot_FILE_SIZE_UNKNOWN) + disk->total_sectors = ((dev->file->size + VasEBoot_DISK_SECTOR_SIZE - 1) + / VasEBoot_DISK_SECTOR_SIZE); else - disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN; + disk->total_sectors = VasEBoot_DISK_SIZE_UNKNOWN; /* Avoid reading more than 512M. */ - disk->max_agglomerate = 1 << (29 - GRUB_DISK_SECTOR_BITS - - GRUB_DISK_CACHE_BITS); + disk->max_agglomerate = 1 << (29 - VasEBoot_DISK_SECTOR_BITS + - VasEBoot_DISK_CACHE_BITS); disk->id = dev->id; @@ -181,67 +181,67 @@ grub_loopback_open (const char *name, grub_disk_t disk) return 0; } -static grub_err_t -grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_loopback_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_file_t file = ((struct grub_loopback *) disk->data)->file; - grub_off_t pos; + VasEBoot_file_t file = ((struct VasEBoot_loopback *) disk->data)->file; + VasEBoot_off_t pos; - grub_file_seek (file, sector << GRUB_DISK_SECTOR_BITS); + VasEBoot_file_seek (file, sector << VasEBoot_DISK_SECTOR_BITS); - grub_file_read (file, buf, size << GRUB_DISK_SECTOR_BITS); - if (grub_errno) - return grub_errno; + VasEBoot_file_read (file, buf, size << VasEBoot_DISK_SECTOR_BITS); + if (VasEBoot_errno) + return VasEBoot_errno; /* In case there is more data read than there is available, in case - of files that are not a multiple of GRUB_DISK_SECTOR_SIZE, fill + of files that are not a multiple of VasEBoot_DISK_SECTOR_SIZE, fill the rest with zeros. */ - pos = (sector + size) << GRUB_DISK_SECTOR_BITS; + pos = (sector + size) << VasEBoot_DISK_SECTOR_BITS; if (pos > file->size) { - grub_size_t amount = pos - file->size; - grub_memset (buf + (size << GRUB_DISK_SECTOR_BITS) - amount, 0, amount); + VasEBoot_size_t amount = pos - file->size; + VasEBoot_memset (buf + (size << VasEBoot_DISK_SECTOR_BITS) - amount, 0, amount); } return 0; } -static grub_err_t -grub_loopback_write (grub_disk_t disk __attribute ((unused)), - grub_disk_addr_t sector __attribute ((unused)), - grub_size_t size __attribute ((unused)), +static VasEBoot_err_t +VasEBoot_loopback_write (VasEBoot_disk_t disk __attribute ((unused)), + VasEBoot_disk_addr_t sector __attribute ((unused)), + VasEBoot_size_t size __attribute ((unused)), const char *buf __attribute ((unused))) { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "loopback write is not supported"); } -static struct grub_disk_dev grub_loopback_dev = +static struct VasEBoot_disk_dev VasEBoot_loopback_dev = { .name = "loopback", - .id = GRUB_DISK_DEVICE_LOOPBACK_ID, - .iterate = grub_loopback_iterate, - .open = grub_loopback_open, - .read = grub_loopback_read, - .write = grub_loopback_write, + .id = VasEBoot_DISK_DEVICE_LOOPBACK_ID, + .iterate = VasEBoot_loopback_iterate, + .open = VasEBoot_loopback_open, + .read = VasEBoot_loopback_read, + .write = VasEBoot_loopback_write, .next = 0 }; -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(loopback) +VasEBoot_MOD_INIT(loopback) { - cmd = grub_register_extcmd ("loopback", grub_cmd_loopback, 0, + cmd = VasEBoot_register_extcmd ("loopback", VasEBoot_cmd_loopback, 0, N_("[-d] DEVICENAME FILE."), /* TRANSLATORS: The file itself is not destroyed or transformed into drive. */ N_("Make a virtual drive from a file."), options); - grub_disk_dev_register (&grub_loopback_dev); + VasEBoot_disk_dev_register (&VasEBoot_loopback_dev); } -GRUB_MOD_FINI(loopback) +VasEBoot_MOD_FINI(loopback) { - grub_unregister_extcmd (cmd); - grub_disk_dev_unregister (&grub_loopback_dev); + VasEBoot_unregister_extcmd (cmd); + VasEBoot_disk_dev_unregister (&VasEBoot_loopback_dev); } diff --git a/VasEBoot-core/disk/luks.c b/VasEBoot-core/disk/luks.c index 86c50c612..c4c390aec 100644 --- a/VasEBoot-core/disk/luks.c +++ b/VasEBoot-core/disk/luks.c @@ -1,106 +1,106 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define MAX_PASSPHRASE 256 #define LUKS_KEY_ENABLED 0x00AC71F3 /* On disk LUKS header */ -struct grub_luks_phdr +struct VasEBoot_luks_phdr { - grub_uint8_t magic[6]; + VasEBoot_uint8_t magic[6]; #define LUKS_MAGIC "LUKS\xBA\xBE" - grub_uint16_t version; + VasEBoot_uint16_t version; char cipherName[32]; char cipherMode[32]; char hashSpec[32]; - grub_uint32_t payloadOffset; - grub_uint32_t keyBytes; - grub_uint8_t mkDigest[20]; - grub_uint8_t mkDigestSalt[32]; - grub_uint32_t mkDigestIterations; + VasEBoot_uint32_t payloadOffset; + VasEBoot_uint32_t keyBytes; + VasEBoot_uint8_t mkDigest[20]; + VasEBoot_uint8_t mkDigestSalt[32]; + VasEBoot_uint32_t mkDigestIterations; char uuid[40]; struct { - grub_uint32_t active; - grub_uint32_t passwordIterations; - grub_uint8_t passwordSalt[32]; - grub_uint32_t keyMaterialOffset; - grub_uint32_t stripes; + VasEBoot_uint32_t active; + VasEBoot_uint32_t passwordIterations; + VasEBoot_uint8_t passwordSalt[32]; + VasEBoot_uint32_t keyMaterialOffset; + VasEBoot_uint32_t stripes; } keyblock[8]; -} GRUB_PACKED; +} VasEBoot_PACKED; -typedef struct grub_luks_phdr *grub_luks_phdr_t; +typedef struct VasEBoot_luks_phdr *VasEBoot_luks_phdr_t; -gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, - grub_uint8_t * dst, grub_size_t blocksize, - grub_size_t blocknumbers); +gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, VasEBoot_uint8_t * src, + VasEBoot_uint8_t * dst, VasEBoot_size_t blocksize, + VasEBoot_size_t blocknumbers); -static grub_cryptodisk_t -configure_ciphers (grub_disk_t disk, const char *check_uuid, +static VasEBoot_cryptodisk_t +configure_ciphers (VasEBoot_disk_t disk, const char *check_uuid, int check_boot) { - grub_cryptodisk_t newdev; + VasEBoot_cryptodisk_t newdev; const char *iptr; - struct grub_luks_phdr header; + struct VasEBoot_luks_phdr header; char *optr; char uuid[sizeof (header.uuid) + 1]; char ciphername[sizeof (header.cipherName) + 1]; char ciphermode[sizeof (header.cipherMode) + 1]; char *cipheriv = NULL; char hashspec[sizeof (header.hashSpec) + 1]; - grub_crypto_cipher_handle_t cipher = NULL, secondary_cipher = NULL; - grub_crypto_cipher_handle_t essiv_cipher = NULL; + VasEBoot_crypto_cipher_handle_t cipher = NULL, secondary_cipher = NULL; + VasEBoot_crypto_cipher_handle_t essiv_cipher = NULL; const gcry_md_spec_t *hash = NULL, *essiv_hash = NULL; const struct gcry_cipher_spec *ciph; - grub_cryptodisk_mode_t mode; - grub_cryptodisk_mode_iv_t mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN64; + VasEBoot_cryptodisk_mode_t mode; + VasEBoot_cryptodisk_mode_iv_t mode_iv = VasEBoot_CRYPTODISK_MODE_IV_PLAIN64; int benbi_log = 0; - grub_err_t err; + VasEBoot_err_t err; if (check_boot) return NULL; /* Read the LUKS header. */ - err = grub_disk_read (disk, 0, 0, sizeof (header), &header); + err = VasEBoot_disk_read (disk, 0, 0, sizeof (header), &header); if (err) { - if (err == GRUB_ERR_OUT_OF_RANGE) - grub_errno = GRUB_ERR_NONE; + if (err == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_errno = VasEBoot_ERR_NONE; return NULL; } /* Look for LUKS magic sequence. */ - if (grub_memcmp (header.magic, LUKS_MAGIC, sizeof (header.magic)) - || grub_be_to_cpu16 (header.version) != 1) + if (VasEBoot_memcmp (header.magic, LUKS_MAGIC, sizeof (header.magic)) + || VasEBoot_be_to_cpu16 (header.version) != 1) return NULL; optr = uuid; @@ -112,185 +112,185 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, } *optr = 0; - if (check_uuid && grub_strcasecmp (check_uuid, uuid) != 0) + if (check_uuid && VasEBoot_strcasecmp (check_uuid, uuid) != 0) { - grub_dprintf ("luks", "%s != %s\n", uuid, check_uuid); + VasEBoot_dprintf ("luks", "%s != %s\n", uuid, check_uuid); return NULL; } /* Make sure that strings are null terminated. */ - grub_memcpy (ciphername, header.cipherName, sizeof (header.cipherName)); + VasEBoot_memcpy (ciphername, header.cipherName, sizeof (header.cipherName)); ciphername[sizeof (header.cipherName)] = 0; - grub_memcpy (ciphermode, header.cipherMode, sizeof (header.cipherMode)); + VasEBoot_memcpy (ciphermode, header.cipherMode, sizeof (header.cipherMode)); ciphermode[sizeof (header.cipherMode)] = 0; - grub_memcpy (hashspec, header.hashSpec, sizeof (header.hashSpec)); + VasEBoot_memcpy (hashspec, header.hashSpec, sizeof (header.hashSpec)); hashspec[sizeof (header.hashSpec)] = 0; - ciph = grub_crypto_lookup_cipher_by_name (ciphername); + ciph = VasEBoot_crypto_lookup_cipher_by_name (ciphername); if (!ciph) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher %s isn't available", + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "Cipher %s isn't available", ciphername); return NULL; } /* Configure the cipher used for the bulk data. */ - cipher = grub_crypto_cipher_open (ciph); + cipher = VasEBoot_crypto_cipher_open (ciph); if (!cipher) return NULL; - if (grub_be_to_cpu32 (header.keyBytes) > 1024) + if (VasEBoot_be_to_cpu32 (header.keyBytes) > 1024) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid keysize %d", - grub_be_to_cpu32 (header.keyBytes)); - grub_crypto_cipher_close (cipher); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid keysize %d", + VasEBoot_be_to_cpu32 (header.keyBytes)); + VasEBoot_crypto_cipher_close (cipher); return NULL; } /* Configure the cipher mode. */ - if (grub_strcmp (ciphermode, "ecb") == 0) + if (VasEBoot_strcmp (ciphermode, "ecb") == 0) { - mode = GRUB_CRYPTODISK_MODE_ECB; - mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN; + mode = VasEBoot_CRYPTODISK_MODE_ECB; + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_PLAIN; cipheriv = NULL; } - else if (grub_strcmp (ciphermode, "plain") == 0) + else if (VasEBoot_strcmp (ciphermode, "plain") == 0) { - mode = GRUB_CRYPTODISK_MODE_CBC; - mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN; + mode = VasEBoot_CRYPTODISK_MODE_CBC; + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_PLAIN; cipheriv = NULL; } - else if (grub_memcmp (ciphermode, "cbc-", sizeof ("cbc-") - 1) == 0) + else if (VasEBoot_memcmp (ciphermode, "cbc-", sizeof ("cbc-") - 1) == 0) { - mode = GRUB_CRYPTODISK_MODE_CBC; + mode = VasEBoot_CRYPTODISK_MODE_CBC; cipheriv = ciphermode + sizeof ("cbc-") - 1; } - else if (grub_memcmp (ciphermode, "pcbc-", sizeof ("pcbc-") - 1) == 0) + else if (VasEBoot_memcmp (ciphermode, "pcbc-", sizeof ("pcbc-") - 1) == 0) { - mode = GRUB_CRYPTODISK_MODE_PCBC; + mode = VasEBoot_CRYPTODISK_MODE_PCBC; cipheriv = ciphermode + sizeof ("pcbc-") - 1; } - else if (grub_memcmp (ciphermode, "xts-", sizeof ("xts-") - 1) == 0) + else if (VasEBoot_memcmp (ciphermode, "xts-", sizeof ("xts-") - 1) == 0) { - mode = GRUB_CRYPTODISK_MODE_XTS; + mode = VasEBoot_CRYPTODISK_MODE_XTS; cipheriv = ciphermode + sizeof ("xts-") - 1; - secondary_cipher = grub_crypto_cipher_open (ciph); + secondary_cipher = VasEBoot_crypto_cipher_open (ciph); if (!secondary_cipher) { - grub_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (cipher); return NULL; } - if (cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) + if (cipher->cipher->blocksize != VasEBoot_CRYPTODISK_GF_BYTES) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", cipher->cipher->blocksize); - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (secondary_cipher); + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); return NULL; } - if (secondary_cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) + if (secondary_cipher->cipher->blocksize != VasEBoot_CRYPTODISK_GF_BYTES) { - grub_crypto_cipher_close (cipher); - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", secondary_cipher->cipher->blocksize); - grub_crypto_cipher_close (secondary_cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); return NULL; } } - else if (grub_memcmp (ciphermode, "lrw-", sizeof ("lrw-") - 1) == 0) + else if (VasEBoot_memcmp (ciphermode, "lrw-", sizeof ("lrw-") - 1) == 0) { - mode = GRUB_CRYPTODISK_MODE_LRW; + mode = VasEBoot_CRYPTODISK_MODE_LRW; cipheriv = ciphermode + sizeof ("lrw-") - 1; - if (cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) + if (cipher->cipher->blocksize != VasEBoot_CRYPTODISK_GF_BYTES) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported LRW block size: %d", + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported LRW block size: %d", cipher->cipher->blocksize); - grub_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (cipher); return NULL; } } else { - grub_crypto_cipher_close (cipher); - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown cipher mode: %s", + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unknown cipher mode: %s", ciphermode); return NULL; } if (cipheriv == NULL); - else if (grub_memcmp (cipheriv, "plain", sizeof ("plain") - 1) == 0) - mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN; - else if (grub_memcmp (cipheriv, "plain64", sizeof ("plain64") - 1) == 0) - mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN64; - else if (grub_memcmp (cipheriv, "benbi", sizeof ("benbi") - 1) == 0) + else if (VasEBoot_memcmp (cipheriv, "plain", sizeof ("plain") - 1) == 0) + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_PLAIN; + else if (VasEBoot_memcmp (cipheriv, "plain64", sizeof ("plain64") - 1) == 0) + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_PLAIN64; + else if (VasEBoot_memcmp (cipheriv, "benbi", sizeof ("benbi") - 1) == 0) { if (cipher->cipher->blocksize & (cipher->cipher->blocksize - 1) || cipher->cipher->blocksize == 0) - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported benbi blocksize: %d", + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported benbi blocksize: %d", cipher->cipher->blocksize); /* FIXME should we return an error here? */ for (benbi_log = 0; - (cipher->cipher->blocksize << benbi_log) < GRUB_DISK_SECTOR_SIZE; + (cipher->cipher->blocksize << benbi_log) < VasEBoot_DISK_SECTOR_SIZE; benbi_log++); - mode_iv = GRUB_CRYPTODISK_MODE_IV_BENBI; + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_BENBI; } - else if (grub_memcmp (cipheriv, "null", sizeof ("null") - 1) == 0) - mode_iv = GRUB_CRYPTODISK_MODE_IV_NULL; - else if (grub_memcmp (cipheriv, "essiv:", sizeof ("essiv:") - 1) == 0) + else if (VasEBoot_memcmp (cipheriv, "null", sizeof ("null") - 1) == 0) + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_NULL; + else if (VasEBoot_memcmp (cipheriv, "essiv:", sizeof ("essiv:") - 1) == 0) { char *hash_str = cipheriv + 6; - mode_iv = GRUB_CRYPTODISK_MODE_IV_ESSIV; + mode_iv = VasEBoot_CRYPTODISK_MODE_IV_ESSIV; /* Configure the hash and cipher used for ESSIV. */ - essiv_hash = grub_crypto_lookup_md_by_name (hash_str); + essiv_hash = VasEBoot_crypto_lookup_md_by_name (hash_str); if (!essiv_hash) { - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (secondary_cipher); - grub_error (GRUB_ERR_FILE_NOT_FOUND, + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "Couldn't load %s hash", hash_str); return NULL; } - essiv_cipher = grub_crypto_cipher_open (ciph); + essiv_cipher = VasEBoot_crypto_cipher_open (ciph); if (!essiv_cipher) { - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (secondary_cipher); + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); return NULL; } } else { - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (secondary_cipher); - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown IV mode: %s", + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unknown IV mode: %s", cipheriv); return NULL; } /* Configure the hash used for the AF splitter and HMAC. */ - hash = grub_crypto_lookup_md_by_name (hashspec); + hash = VasEBoot_crypto_lookup_md_by_name (hashspec); if (!hash) { - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (essiv_cipher); - grub_crypto_cipher_close (secondary_cipher); - grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load %s hash", + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (essiv_cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "Couldn't load %s hash", hashspec); return NULL; } - newdev = grub_zalloc (sizeof (struct grub_cryptodisk)); + newdev = VasEBoot_zalloc (sizeof (struct VasEBoot_cryptodisk)); if (!newdev) { - grub_crypto_cipher_close (cipher); - grub_crypto_cipher_close (essiv_cipher); - grub_crypto_cipher_close (secondary_cipher); + VasEBoot_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (essiv_cipher); + VasEBoot_crypto_cipher_close (secondary_cipher); return NULL; } newdev->cipher = cipher; - newdev->offset = grub_be_to_cpu32 (header.payloadOffset); + newdev->offset = VasEBoot_be_to_cpu32 (header.payloadOffset); newdev->source_disk = NULL; newdev->benbi_log = benbi_log; newdev->mode = mode; @@ -300,186 +300,186 @@ configure_ciphers (grub_disk_t disk, const char *check_uuid, newdev->essiv_hash = essiv_hash; newdev->hash = hash; newdev->log_sector_size = 9; - newdev->total_length = grub_disk_get_size (disk) - newdev->offset; - grub_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); + newdev->total_length = VasEBoot_disk_get_size (disk) - newdev->offset; + VasEBoot_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); newdev->modname = "luks"; COMPILE_TIME_ASSERT (sizeof (newdev->uuid) >= sizeof (uuid)); return newdev; } -static grub_err_t -luks_recover_key (grub_disk_t source, - grub_cryptodisk_t dev) +static VasEBoot_err_t +luks_recover_key (VasEBoot_disk_t source, + VasEBoot_cryptodisk_t dev) { - struct grub_luks_phdr header; - grub_size_t keysize; - grub_uint8_t *split_key = NULL; + struct VasEBoot_luks_phdr header; + VasEBoot_size_t keysize; + VasEBoot_uint8_t *split_key = NULL; char passphrase[MAX_PASSPHRASE] = ""; - grub_uint8_t candidate_digest[sizeof (header.mkDigest)]; + VasEBoot_uint8_t candidate_digest[sizeof (header.mkDigest)]; unsigned i; - grub_size_t length; - grub_err_t err; - grub_size_t max_stripes = 1; + VasEBoot_size_t length; + VasEBoot_err_t err; + VasEBoot_size_t max_stripes = 1; char *tmp; - err = grub_disk_read (source, 0, 0, sizeof (header), &header); + err = VasEBoot_disk_read (source, 0, 0, sizeof (header), &header); if (err) return err; - grub_puts_ (N_("Attempting to decrypt master key...")); - keysize = grub_be_to_cpu32 (header.keyBytes); - if (keysize > GRUB_CRYPTODISK_MAX_KEYLEN) - return grub_error (GRUB_ERR_BAD_FS, "key is too long"); + VasEBoot_puts_ (N_("Attempting to decrypt master key...")); + keysize = VasEBoot_be_to_cpu32 (header.keyBytes); + if (keysize > VasEBoot_CRYPTODISK_MAX_KEYLEN) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "key is too long"); for (i = 0; i < ARRAY_SIZE (header.keyblock); i++) - if (grub_be_to_cpu32 (header.keyblock[i].active) == LUKS_KEY_ENABLED - && grub_be_to_cpu32 (header.keyblock[i].stripes) > max_stripes) - max_stripes = grub_be_to_cpu32 (header.keyblock[i].stripes); + if (VasEBoot_be_to_cpu32 (header.keyblock[i].active) == LUKS_KEY_ENABLED + && VasEBoot_be_to_cpu32 (header.keyblock[i].stripes) > max_stripes) + max_stripes = VasEBoot_be_to_cpu32 (header.keyblock[i].stripes); - split_key = grub_malloc (keysize * max_stripes); + split_key = VasEBoot_malloc (keysize * max_stripes); if (!split_key) - return grub_errno; + return VasEBoot_errno; /* Get the passphrase from the user. */ tmp = NULL; if (source->partition) - tmp = grub_partition_get_name (source->partition); - grub_printf_ (N_("Enter passphrase for %s%s%s (%s): "), source->name, + tmp = VasEBoot_partition_get_name (source->partition); + VasEBoot_printf_ (N_("Enter passphrase for %s%s%s (%s): "), source->name, source->partition ? "," : "", tmp ? : "", dev->uuid); - grub_free (tmp); - if (!grub_password_get (passphrase, MAX_PASSPHRASE)) + VasEBoot_free (tmp); + if (!VasEBoot_password_get (passphrase, MAX_PASSPHRASE)) { - grub_free (split_key); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); + VasEBoot_free (split_key); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Passphrase not supplied"); } /* Try to recover master key from each active keyslot. */ for (i = 0; i < ARRAY_SIZE (header.keyblock); i++) { gcry_err_code_t gcry_err; - grub_uint8_t candidate_key[GRUB_CRYPTODISK_MAX_KEYLEN]; - grub_uint8_t digest[GRUB_CRYPTODISK_MAX_KEYLEN]; + VasEBoot_uint8_t candidate_key[VasEBoot_CRYPTODISK_MAX_KEYLEN]; + VasEBoot_uint8_t digest[VasEBoot_CRYPTODISK_MAX_KEYLEN]; /* Check if keyslot is enabled. */ - if (grub_be_to_cpu32 (header.keyblock[i].active) != LUKS_KEY_ENABLED) + if (VasEBoot_be_to_cpu32 (header.keyblock[i].active) != LUKS_KEY_ENABLED) continue; - grub_dprintf ("luks", "Trying keyslot %d\n", i); + VasEBoot_dprintf ("luks", "Trying keyslot %d\n", i); /* Calculate the PBKDF2 of the user supplied passphrase. */ - gcry_err = grub_crypto_pbkdf2 (dev->hash, (grub_uint8_t *) passphrase, - grub_strlen (passphrase), + gcry_err = VasEBoot_crypto_pbkdf2 (dev->hash, (VasEBoot_uint8_t *) passphrase, + VasEBoot_strlen (passphrase), header.keyblock[i].passwordSalt, sizeof (header.keyblock[i].passwordSalt), - grub_be_to_cpu32 (header.keyblock[i]. + VasEBoot_be_to_cpu32 (header.keyblock[i]. passwordIterations), digest, keysize); if (gcry_err) { - grub_free (split_key); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (split_key); + return VasEBoot_crypto_gcry_error (gcry_err); } - grub_dprintf ("luks", "PBKDF2 done\n"); + VasEBoot_dprintf ("luks", "PBKDF2 done\n"); - gcry_err = grub_cryptodisk_setkey (dev, digest, keysize); + gcry_err = VasEBoot_cryptodisk_setkey (dev, digest, keysize); if (gcry_err) { - grub_free (split_key); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (split_key); + return VasEBoot_crypto_gcry_error (gcry_err); } - length = (keysize * grub_be_to_cpu32 (header.keyblock[i].stripes)); + length = (keysize * VasEBoot_be_to_cpu32 (header.keyblock[i].stripes)); /* Read and decrypt the key material from the disk. */ - err = grub_disk_read (source, - grub_be_to_cpu32 (header.keyblock + err = VasEBoot_disk_read (source, + VasEBoot_be_to_cpu32 (header.keyblock [i].keyMaterialOffset), 0, length, split_key); if (err) { - grub_free (split_key); + VasEBoot_free (split_key); return err; } - gcry_err = grub_cryptodisk_decrypt (dev, split_key, length, 0); + gcry_err = VasEBoot_cryptodisk_decrypt (dev, split_key, length, 0); if (gcry_err) { - grub_free (split_key); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (split_key); + return VasEBoot_crypto_gcry_error (gcry_err); } /* Merge the decrypted key material to get the candidate master key. */ gcry_err = AF_merge (dev->hash, split_key, candidate_key, keysize, - grub_be_to_cpu32 (header.keyblock[i].stripes)); + VasEBoot_be_to_cpu32 (header.keyblock[i].stripes)); if (gcry_err) { - grub_free (split_key); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (split_key); + return VasEBoot_crypto_gcry_error (gcry_err); } - grub_dprintf ("luks", "candidate key recovered\n"); + VasEBoot_dprintf ("luks", "candidate key recovered\n"); /* Calculate the PBKDF2 of the candidate master key. */ - gcry_err = grub_crypto_pbkdf2 (dev->hash, candidate_key, - grub_be_to_cpu32 (header.keyBytes), + gcry_err = VasEBoot_crypto_pbkdf2 (dev->hash, candidate_key, + VasEBoot_be_to_cpu32 (header.keyBytes), header.mkDigestSalt, sizeof (header.mkDigestSalt), - grub_be_to_cpu32 + VasEBoot_be_to_cpu32 (header.mkDigestIterations), candidate_digest, sizeof (candidate_digest)); if (gcry_err) { - grub_free (split_key); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (split_key); + return VasEBoot_crypto_gcry_error (gcry_err); } /* Compare the calculated PBKDF2 to the digest stored in the header to see if it's correct. */ - if (grub_memcmp (candidate_digest, header.mkDigest, + if (VasEBoot_memcmp (candidate_digest, header.mkDigest, sizeof (header.mkDigest)) != 0) { - grub_dprintf ("luks", "bad digest\n"); + VasEBoot_dprintf ("luks", "bad digest\n"); continue; } /* TRANSLATORS: It's a cryptographic key slot: one element of an array where each element is either empty or holds a key. */ - grub_printf_ (N_("Slot %d opened\n"), i); + VasEBoot_printf_ (N_("Slot %d opened\n"), i); /* Set the master key. */ - gcry_err = grub_cryptodisk_setkey (dev, candidate_key, keysize); + gcry_err = VasEBoot_cryptodisk_setkey (dev, candidate_key, keysize); if (gcry_err) { - grub_free (split_key); - return grub_crypto_gcry_error (gcry_err); + VasEBoot_free (split_key); + return VasEBoot_crypto_gcry_error (gcry_err); } - grub_free (split_key); + VasEBoot_free (split_key); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - grub_free (split_key); - return GRUB_ACCESS_DENIED; + VasEBoot_free (split_key); + return VasEBoot_ACCESS_DENIED; } -struct grub_cryptodisk_dev luks_crypto = { +struct VasEBoot_cryptodisk_dev luks_crypto = { .scan = configure_ciphers, .recover_key = luks_recover_key }; -GRUB_MOD_INIT (luks) +VasEBoot_MOD_INIT (luks) { - COMPILE_TIME_ASSERT (sizeof (((struct grub_luks_phdr *) 0)->uuid) - < GRUB_CRYPTODISK_MAX_UUID_LENGTH); - grub_cryptodisk_dev_register (&luks_crypto); + COMPILE_TIME_ASSERT (sizeof (((struct VasEBoot_luks_phdr *) 0)->uuid) + < VasEBoot_CRYPTODISK_MAX_UUID_LENGTH); + VasEBoot_cryptodisk_dev_register (&luks_crypto); } -GRUB_MOD_FINI (luks) +VasEBoot_MOD_FINI (luks) { - grub_cryptodisk_dev_unregister (&luks_crypto); + VasEBoot_cryptodisk_dev_unregister (&luks_crypto); } diff --git a/VasEBoot-core/disk/lvm.c b/VasEBoot-core/disk/lvm.c index 7b265c780..5efdd8745 100644 --- a/VasEBoot-core/disk/lvm.c +++ b/VasEBoot-core/disk/lvm.c @@ -1,89 +1,89 @@ /* lvm.c - module to read Logical Volumes. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_UTIL -#include -#include +#ifdef VasEBoot_UTIL +#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Go the string STR and return the number after STR. *P will point at the number. In case STR is not found, *P will be NULL and the return value will be 0. */ -static grub_uint64_t -grub_lvm_getvalue (char **p, const char *str) +static VasEBoot_uint64_t +VasEBoot_lvm_getvalue (char **p, const char *str) { - *p = grub_strstr (*p, str); + *p = VasEBoot_strstr (*p, str); if (! *p) return 0; - *p += grub_strlen (str); - return grub_strtoull (*p, p, 10); + *p += VasEBoot_strlen (str); + return VasEBoot_strtoull (*p, p, 10); } #if 0 static int -grub_lvm_checkvalue (char **p, char *str, char *tmpl) +VasEBoot_lvm_checkvalue (char **p, char *str, char *tmpl) { - int tmpllen = grub_strlen (tmpl); - *p = grub_strstr (*p, str); + int tmpllen = VasEBoot_strlen (tmpl); + *p = VasEBoot_strstr (*p, str); if (! *p) return 0; - *p += grub_strlen (str); + *p += VasEBoot_strlen (str); if (**p != '"') return 0; - return (grub_memcmp (*p + 1, tmpl, tmpllen) == 0 && (*p)[tmpllen + 1] == '"'); + return (VasEBoot_memcmp (*p + 1, tmpl, tmpllen) == 0 && (*p)[tmpllen + 1] == '"'); } #endif static int -grub_lvm_check_flag (char *p, const char *str, const char *flag) +VasEBoot_lvm_check_flag (char *p, const char *str, const char *flag) { - grub_size_t len_str = grub_strlen (str), len_flag = grub_strlen (flag); + VasEBoot_size_t len_str = VasEBoot_strlen (str), len_flag = VasEBoot_strlen (flag); while (1) { char *q; - p = grub_strstr (p, str); + p = VasEBoot_strstr (p, str); if (! p) return 0; p += len_str; - if (grub_memcmp (p, " = [", sizeof (" = [") - 1) != 0) + if (VasEBoot_memcmp (p, " = [", sizeof (" = [") - 1) != 0) continue; q = p + sizeof (" = [") - 1; while (1) { - while (grub_isspace (*q)) + while (VasEBoot_isspace (*q)) q++; if (*q != '"') return 0; q++; - if (grub_memcmp (q, flag, len_flag) == 0 && q[len_flag] == '"') + if (VasEBoot_memcmp (q, flag, len_flag) == 0 && q[len_flag] == '"') return 1; while (*q != '"') q++; @@ -95,53 +95,53 @@ grub_lvm_check_flag (char *p, const char *str, const char *flag) } } -static struct grub_diskfilter_vg * -grub_lvm_detect (grub_disk_t disk, - struct grub_diskfilter_pv_id *id, - grub_disk_addr_t *start_sector) +static struct VasEBoot_diskfilter_vg * +VasEBoot_lvm_detect (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_pv_id *id, + VasEBoot_disk_addr_t *start_sector) { - grub_err_t err; - grub_uint64_t mda_offset, mda_size; - char buf[GRUB_LVM_LABEL_SIZE]; - char vg_id[GRUB_LVM_ID_STRLEN+1]; - char pv_id[GRUB_LVM_ID_STRLEN+1]; + VasEBoot_err_t err; + VasEBoot_uint64_t mda_offset, mda_size; + char buf[VasEBoot_LVM_LABEL_SIZE]; + char vg_id[VasEBoot_LVM_ID_STRLEN+1]; + char pv_id[VasEBoot_LVM_ID_STRLEN+1]; char *metadatabuf, *p, *q, *vgname; - struct grub_lvm_label_header *lh = (struct grub_lvm_label_header *) buf; - struct grub_lvm_pv_header *pvh; - struct grub_lvm_disk_locn *dlocn; - struct grub_lvm_mda_header *mdah; - struct grub_lvm_raw_locn *rlocn; + struct VasEBoot_lvm_label_header *lh = (struct VasEBoot_lvm_label_header *) buf; + struct VasEBoot_lvm_pv_header *pvh; + struct VasEBoot_lvm_disk_locn *dlocn; + struct VasEBoot_lvm_mda_header *mdah; + struct VasEBoot_lvm_raw_locn *rlocn; unsigned int i, j; - grub_size_t vgname_len; - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_pv *pv; + VasEBoot_size_t vgname_len; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_pv *pv; /* Search for label. */ - for (i = 0; i < GRUB_LVM_LABEL_SCAN_SECTORS; i++) + for (i = 0; i < VasEBoot_LVM_LABEL_SCAN_SECTORS; i++) { - err = grub_disk_read (disk, i, 0, sizeof(buf), buf); + err = VasEBoot_disk_read (disk, i, 0, sizeof(buf), buf); if (err) goto fail; - if ((! grub_strncmp ((char *)lh->id, GRUB_LVM_LABEL_ID, + if ((! VasEBoot_strncmp ((char *)lh->id, VasEBoot_LVM_LABEL_ID, sizeof (lh->id))) - && (! grub_strncmp ((char *)lh->type, GRUB_LVM_LVM2_LABEL, + && (! VasEBoot_strncmp ((char *)lh->type, VasEBoot_LVM_LVM2_LABEL, sizeof (lh->type)))) break; } /* Return if we didn't find a label. */ - if (i == GRUB_LVM_LABEL_SCAN_SECTORS) + if (i == VasEBoot_LVM_LABEL_SCAN_SECTORS) { -#ifdef GRUB_UTIL - grub_util_info ("no LVM signature found"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("no LVM signature found"); #endif goto fail; } - pvh = (struct grub_lvm_pv_header *) (buf + grub_le_to_cpu32(lh->offset_xl)); + pvh = (struct VasEBoot_lvm_pv_header *) (buf + VasEBoot_le_to_cpu32(lh->offset_xl)); - for (i = 0, j = 0; i < GRUB_LVM_ID_LEN; i++) + for (i = 0, j = 0; i < VasEBoot_LVM_ID_LEN; i++) { pv_id[j++] = pvh->pv_uuid[i]; if ((i != 1) && (i != 29) && (i % 4 == 1)) @@ -156,109 +156,109 @@ grub_lvm_detect (grub_disk_t disk, seen devices that have it. */ if (dlocn->offset) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "we don't support multiple LVM data areas"); -#ifdef GRUB_UTIL - grub_util_info ("we don't support multiple LVM data areas"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("we don't support multiple LVM data areas"); #endif goto fail; } dlocn++; - mda_offset = grub_le_to_cpu64 (dlocn->offset); - mda_size = grub_le_to_cpu64 (dlocn->size); + mda_offset = VasEBoot_le_to_cpu64 (dlocn->offset); + mda_size = VasEBoot_le_to_cpu64 (dlocn->size); /* It's possible to have multiple copies of metadata areas, we just use the first one. */ /* Allocate buffer space for the circular worst-case scenario. */ - metadatabuf = grub_malloc (2 * mda_size); + metadatabuf = VasEBoot_malloc (2 * mda_size); if (! metadatabuf) goto fail; - err = grub_disk_read (disk, 0, mda_offset, mda_size, metadatabuf); + err = VasEBoot_disk_read (disk, 0, mda_offset, mda_size, metadatabuf); if (err) goto fail2; - mdah = (struct grub_lvm_mda_header *) metadatabuf; - if ((grub_strncmp ((char *)mdah->magic, GRUB_LVM_FMTT_MAGIC, + mdah = (struct VasEBoot_lvm_mda_header *) metadatabuf; + if ((VasEBoot_strncmp ((char *)mdah->magic, VasEBoot_LVM_FMTT_MAGIC, sizeof (mdah->magic))) - || (grub_le_to_cpu32 (mdah->version) != GRUB_LVM_FMTT_VERSION)) + || (VasEBoot_le_to_cpu32 (mdah->version) != VasEBoot_LVM_FMTT_VERSION)) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unknown LVM metadata header"); -#ifdef GRUB_UTIL - grub_util_info ("unknown LVM metadata header"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown LVM metadata header"); #endif goto fail2; } rlocn = mdah->raw_locns; - if (grub_le_to_cpu64 (rlocn->offset) + grub_le_to_cpu64 (rlocn->size) > - grub_le_to_cpu64 (mdah->size)) + if (VasEBoot_le_to_cpu64 (rlocn->offset) + VasEBoot_le_to_cpu64 (rlocn->size) > + VasEBoot_le_to_cpu64 (mdah->size)) { /* Metadata is circular. Copy the wrap in place. */ - grub_memcpy (metadatabuf + mda_size, - metadatabuf + GRUB_LVM_MDA_HEADER_SIZE, - grub_le_to_cpu64 (rlocn->offset) + - grub_le_to_cpu64 (rlocn->size) - - grub_le_to_cpu64 (mdah->size)); + VasEBoot_memcpy (metadatabuf + mda_size, + metadatabuf + VasEBoot_LVM_MDA_HEADER_SIZE, + VasEBoot_le_to_cpu64 (rlocn->offset) + + VasEBoot_le_to_cpu64 (rlocn->size) - + VasEBoot_le_to_cpu64 (mdah->size)); } - p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset); + p = q = metadatabuf + VasEBoot_le_to_cpu64 (rlocn->offset); while (*q != ' ' && q < metadatabuf + mda_size) q++; if (q == metadatabuf + mda_size) { -#ifdef GRUB_UTIL - grub_util_info ("error parsing metadata"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("error parsing metadata"); #endif goto fail2; } vgname_len = q - p; - vgname = grub_malloc (vgname_len + 1); + vgname = VasEBoot_malloc (vgname_len + 1); if (!vgname) goto fail2; - grub_memcpy (vgname, p, vgname_len); + VasEBoot_memcpy (vgname, p, vgname_len); vgname[vgname_len] = '\0'; - p = grub_strstr (q, "id = \""); + p = VasEBoot_strstr (q, "id = \""); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("couldn't find ID"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("couldn't find ID"); #endif goto fail3; } p += sizeof ("id = \"") - 1; - grub_memcpy (vg_id, p, GRUB_LVM_ID_STRLEN); - vg_id[GRUB_LVM_ID_STRLEN] = '\0'; + VasEBoot_memcpy (vg_id, p, VasEBoot_LVM_ID_STRLEN); + vg_id[VasEBoot_LVM_ID_STRLEN] = '\0'; - vg = grub_diskfilter_get_vg_by_uuid (GRUB_LVM_ID_STRLEN, vg_id); + vg = VasEBoot_diskfilter_get_vg_by_uuid (VasEBoot_LVM_ID_STRLEN, vg_id); if (! vg) { /* First time we see this volume group. We've to create the whole volume group structure. */ - vg = grub_malloc (sizeof (*vg)); + vg = VasEBoot_malloc (sizeof (*vg)); if (! vg) goto fail3; vg->name = vgname; - vg->uuid = grub_malloc (GRUB_LVM_ID_STRLEN); + vg->uuid = VasEBoot_malloc (VasEBoot_LVM_ID_STRLEN); if (! vg->uuid) goto fail3; - grub_memcpy (vg->uuid, vg_id, GRUB_LVM_ID_STRLEN); - vg->uuid_len = GRUB_LVM_ID_STRLEN; + VasEBoot_memcpy (vg->uuid, vg_id, VasEBoot_LVM_ID_STRLEN); + vg->uuid_len = VasEBoot_LVM_ID_STRLEN; - vg->extent_size = grub_lvm_getvalue (&p, "extent_size = "); + vg->extent_size = VasEBoot_lvm_getvalue (&p, "extent_size = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown extent size"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown extent size"); #endif goto fail4; } @@ -266,7 +266,7 @@ grub_lvm_detect (grub_disk_t disk, vg->lvs = NULL; vg->pvs = NULL; - p = grub_strstr (p, "physical_volumes {"); + p = VasEBoot_strstr (p, "physical_volumes {"); if (p) { p += sizeof ("physical_volumes {") - 1; @@ -274,48 +274,48 @@ grub_lvm_detect (grub_disk_t disk, /* Add all the pvs to the volume group. */ while (1) { - grub_ssize_t s; - while (grub_isspace (*p)) + VasEBoot_ssize_t s; + while (VasEBoot_isspace (*p)) p++; if (*p == '}') break; - pv = grub_zalloc (sizeof (*pv)); + pv = VasEBoot_zalloc (sizeof (*pv)); q = p; while (*q != ' ') q++; s = q - p; - pv->name = grub_malloc (s + 1); - grub_memcpy (pv->name, p, s); + pv->name = VasEBoot_malloc (s + 1); + VasEBoot_memcpy (pv->name, p, s); pv->name[s] = '\0'; - p = grub_strstr (p, "id = \""); + p = VasEBoot_strstr (p, "id = \""); if (p == NULL) goto pvs_fail; p += sizeof("id = \"") - 1; - pv->id.uuid = grub_malloc (GRUB_LVM_ID_STRLEN); + pv->id.uuid = VasEBoot_malloc (VasEBoot_LVM_ID_STRLEN); if (!pv->id.uuid) goto pvs_fail; - grub_memcpy (pv->id.uuid, p, GRUB_LVM_ID_STRLEN); - pv->id.uuidlen = GRUB_LVM_ID_STRLEN; + VasEBoot_memcpy (pv->id.uuid, p, VasEBoot_LVM_ID_STRLEN); + pv->id.uuidlen = VasEBoot_LVM_ID_STRLEN; - pv->start_sector = grub_lvm_getvalue (&p, "pe_start = "); + pv->start_sector = VasEBoot_lvm_getvalue (&p, "pe_start = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown pe_start"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown pe_start"); #endif goto pvs_fail; } - p = grub_strchr (p, '}'); + p = VasEBoot_strchr (p, '}'); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("error parsing pe_start"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("error parsing pe_start"); #endif goto pvs_fail; } @@ -327,13 +327,13 @@ grub_lvm_detect (grub_disk_t disk, continue; pvs_fail: - grub_free (pv->name); - grub_free (pv); + VasEBoot_free (pv->name); + VasEBoot_free (pv); goto fail4; } } - p = grub_strstr (p, "logical_volumes {"); + p = VasEBoot_strstr (p, "logical_volumes {"); if (p) { p += sizeof ("logical_volumes {") - 1; @@ -341,38 +341,38 @@ grub_lvm_detect (grub_disk_t disk, /* And add all the lvs to the volume group. */ while (1) { - grub_ssize_t s; + VasEBoot_ssize_t s; int skip_lv = 0; - struct grub_diskfilter_lv *lv; - struct grub_diskfilter_segment *seg; + struct VasEBoot_diskfilter_lv *lv; + struct VasEBoot_diskfilter_segment *seg; int is_pvmove; - while (grub_isspace (*p)) + while (VasEBoot_isspace (*p)) p++; if (*p == '}') break; - lv = grub_zalloc (sizeof (*lv)); + lv = VasEBoot_zalloc (sizeof (*lv)); q = p; while (*q != ' ') q++; s = q - p; - lv->name = grub_strndup (p, s); + lv->name = VasEBoot_strndup (p, s); if (!lv->name) goto lvs_fail; { const char *iptr; char *optr; - lv->fullname = grub_malloc (sizeof ("lvm/") - 1 + 2 * vgname_len + lv->fullname = VasEBoot_malloc (sizeof ("lvm/") - 1 + 2 * vgname_len + 1 + 2 * s + 1); if (!lv->fullname) goto lvs_fail; - grub_memcpy (lv->fullname, "lvm/", sizeof ("lvm/") - 1); + VasEBoot_memcpy (lv->fullname, "lvm/", sizeof ("lvm/") - 1); optr = lv->fullname + sizeof ("lvm/") - 1; for (iptr = vgname; iptr < vgname + vgname_len; iptr++) { @@ -388,110 +388,110 @@ grub_lvm_detect (grub_disk_t disk, *optr++ = '-'; } *optr++ = 0; - lv->idname = grub_malloc (sizeof ("lvmid/") - + 2 * GRUB_LVM_ID_STRLEN + 1); + lv->idname = VasEBoot_malloc (sizeof ("lvmid/") + + 2 * VasEBoot_LVM_ID_STRLEN + 1); if (!lv->idname) goto lvs_fail; - grub_memcpy (lv->idname, "lvmid/", + VasEBoot_memcpy (lv->idname, "lvmid/", sizeof ("lvmid/") - 1); - grub_memcpy (lv->idname + sizeof ("lvmid/") - 1, - vg_id, GRUB_LVM_ID_STRLEN); - lv->idname[sizeof ("lvmid/") - 1 + GRUB_LVM_ID_STRLEN] = '/'; + VasEBoot_memcpy (lv->idname + sizeof ("lvmid/") - 1, + vg_id, VasEBoot_LVM_ID_STRLEN); + lv->idname[sizeof ("lvmid/") - 1 + VasEBoot_LVM_ID_STRLEN] = '/'; - p = grub_strstr (q, "id = \""); + p = VasEBoot_strstr (q, "id = \""); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("couldn't find ID"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("couldn't find ID"); #endif goto lvs_fail; } p += sizeof ("id = \"") - 1; - grub_memcpy (lv->idname + sizeof ("lvmid/") - 1 - + GRUB_LVM_ID_STRLEN + 1, - p, GRUB_LVM_ID_STRLEN); - lv->idname[sizeof ("lvmid/") - 1 + 2 * GRUB_LVM_ID_STRLEN + 1] = '\0'; + VasEBoot_memcpy (lv->idname + sizeof ("lvmid/") - 1 + + VasEBoot_LVM_ID_STRLEN + 1, + p, VasEBoot_LVM_ID_STRLEN); + lv->idname[sizeof ("lvmid/") - 1 + 2 * VasEBoot_LVM_ID_STRLEN + 1] = '\0'; } lv->size = 0; - lv->visible = grub_lvm_check_flag (p, "status", "VISIBLE"); - is_pvmove = grub_lvm_check_flag (p, "status", "PVMOVE"); + lv->visible = VasEBoot_lvm_check_flag (p, "status", "VISIBLE"); + is_pvmove = VasEBoot_lvm_check_flag (p, "status", "PVMOVE"); - lv->segment_count = grub_lvm_getvalue (&p, "segment_count = "); + lv->segment_count = VasEBoot_lvm_getvalue (&p, "segment_count = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown segment_count"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown segment_count"); #endif goto lvs_fail; } - lv->segments = grub_zalloc (sizeof (*seg) * lv->segment_count); + lv->segments = VasEBoot_zalloc (sizeof (*seg) * lv->segment_count); seg = lv->segments; for (i = 0; i < lv->segment_count; i++) { - p = grub_strstr (p, "segment"); + p = VasEBoot_strstr (p, "segment"); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown segment"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown segment"); #endif goto lvs_segment_fail; } - seg->start_extent = grub_lvm_getvalue (&p, "start_extent = "); + seg->start_extent = VasEBoot_lvm_getvalue (&p, "start_extent = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown start_extent"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown start_extent"); #endif goto lvs_segment_fail; } - seg->extent_count = grub_lvm_getvalue (&p, "extent_count = "); + seg->extent_count = VasEBoot_lvm_getvalue (&p, "extent_count = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown extent_count"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown extent_count"); #endif goto lvs_segment_fail; } - p = grub_strstr (p, "type = \""); + p = VasEBoot_strstr (p, "type = \""); if (p == NULL) goto lvs_segment_fail; p += sizeof("type = \"") - 1; lv->size += seg->extent_count * vg->extent_size; - if (grub_memcmp (p, "striped\"", + if (VasEBoot_memcmp (p, "striped\"", sizeof ("striped\"") - 1) == 0) { - struct grub_diskfilter_node *stripe; + struct VasEBoot_diskfilter_node *stripe; - seg->type = GRUB_DISKFILTER_STRIPED; - seg->node_count = grub_lvm_getvalue (&p, "stripe_count = "); + seg->type = VasEBoot_DISKFILTER_STRIPED; + seg->node_count = VasEBoot_lvm_getvalue (&p, "stripe_count = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown stripe_count"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown stripe_count"); #endif goto lvs_segment_fail; } if (seg->node_count != 1) - seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); + seg->stripe_size = VasEBoot_lvm_getvalue (&p, "stripe_size = "); - seg->nodes = grub_zalloc (sizeof (*stripe) + seg->nodes = VasEBoot_zalloc (sizeof (*stripe) * seg->node_count); stripe = seg->nodes; - p = grub_strstr (p, "stripes = ["); + p = VasEBoot_strstr (p, "stripes = ["); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown stripes"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown stripes"); #endif goto lvs_segment_fail2; } @@ -499,7 +499,7 @@ grub_lvm_detect (grub_disk_t disk, for (j = 0; j < seg->node_count; j++) { - p = grub_strchr (p, '"'); + p = VasEBoot_strchr (p, '"'); if (p == NULL) continue; q = ++p; @@ -508,16 +508,16 @@ grub_lvm_detect (grub_disk_t disk, s = q - p; - stripe->name = grub_malloc (s + 1); + stripe->name = VasEBoot_malloc (s + 1); if (stripe->name == NULL) goto lvs_segment_fail2; - grub_memcpy (stripe->name, p, s); + VasEBoot_memcpy (stripe->name, p, s); stripe->name[s] = '\0'; p = q + 1; - stripe->start = grub_lvm_getvalue (&p, ",") + stripe->start = VasEBoot_lvm_getvalue (&p, ",") * vg->extent_size; if (p == NULL) continue; @@ -525,27 +525,27 @@ grub_lvm_detect (grub_disk_t disk, stripe++; } } - else if (grub_memcmp (p, "mirror\"", sizeof ("mirror\"") - 1) + else if (VasEBoot_memcmp (p, "mirror\"", sizeof ("mirror\"") - 1) == 0) { - seg->type = GRUB_DISKFILTER_MIRROR; - seg->node_count = grub_lvm_getvalue (&p, "mirror_count = "); + seg->type = VasEBoot_DISKFILTER_MIRROR; + seg->node_count = VasEBoot_lvm_getvalue (&p, "mirror_count = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown mirror_count"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown mirror_count"); #endif goto lvs_segment_fail; } - seg->nodes = grub_zalloc (sizeof (seg->nodes[0]) + seg->nodes = VasEBoot_zalloc (sizeof (seg->nodes[0]) * seg->node_count); - p = grub_strstr (p, "mirrors = ["); + p = VasEBoot_strstr (p, "mirrors = ["); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown mirrors"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown mirrors"); #endif goto lvs_segment_fail2; } @@ -555,7 +555,7 @@ grub_lvm_detect (grub_disk_t disk, { char *lvname; - p = grub_strchr (p, '"'); + p = VasEBoot_strchr (p, '"'); if (p == NULL) continue; q = ++p; @@ -564,11 +564,11 @@ grub_lvm_detect (grub_disk_t disk, s = q - p; - lvname = grub_malloc (s + 1); + lvname = VasEBoot_malloc (s + 1); if (lvname == NULL) goto lvs_segment_fail2; - grub_memcpy (lvname, p, s); + VasEBoot_memcpy (lvname, p, s); lvname[s] = '\0'; seg->nodes[j].name = lvname; p = q + 1; @@ -577,7 +577,7 @@ grub_lvm_detect (grub_disk_t disk, if (is_pvmove) seg->node_count = 1; } - else if (grub_memcmp (p, "raid", sizeof ("raid") - 1) == 0 + else if (VasEBoot_memcmp (p, "raid", sizeof ("raid") - 1) == 0 && ((p[sizeof ("raid") - 1] >= '4' && p[sizeof ("raid") - 1] <= '6') || p[sizeof ("raid") - 1] == '1') @@ -586,52 +586,52 @@ grub_lvm_detect (grub_disk_t disk, switch (p[sizeof ("raid") - 1]) { case '1': - seg->type = GRUB_DISKFILTER_MIRROR; + seg->type = VasEBoot_DISKFILTER_MIRROR; break; case '4': - seg->type = GRUB_DISKFILTER_RAID4; - seg->layout = GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC; + seg->type = VasEBoot_DISKFILTER_RAID4; + seg->layout = VasEBoot_RAID_LAYOUT_LEFT_ASYMMETRIC; break; case '5': - seg->type = GRUB_DISKFILTER_RAID5; - seg->layout = GRUB_RAID_LAYOUT_LEFT_SYMMETRIC; + seg->type = VasEBoot_DISKFILTER_RAID5; + seg->layout = VasEBoot_RAID_LAYOUT_LEFT_SYMMETRIC; break; case '6': - seg->type = GRUB_DISKFILTER_RAID6; - seg->layout = (GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC - | GRUB_RAID_LAYOUT_MUL_FROM_POS); + seg->type = VasEBoot_DISKFILTER_RAID6; + seg->layout = (VasEBoot_RAID_LAYOUT_RIGHT_ASYMMETRIC + | VasEBoot_RAID_LAYOUT_MUL_FROM_POS); break; } - seg->node_count = grub_lvm_getvalue (&p, "device_count = "); + seg->node_count = VasEBoot_lvm_getvalue (&p, "device_count = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown device_count"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown device_count"); #endif goto lvs_segment_fail; } - if (seg->type != GRUB_DISKFILTER_MIRROR) + if (seg->type != VasEBoot_DISKFILTER_MIRROR) { - seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); + seg->stripe_size = VasEBoot_lvm_getvalue (&p, "stripe_size = "); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown stripe_size"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown stripe_size"); #endif goto lvs_segment_fail; } } - seg->nodes = grub_zalloc (sizeof (seg->nodes[0]) + seg->nodes = VasEBoot_zalloc (sizeof (seg->nodes[0]) * seg->node_count); - p = grub_strstr (p, "raids = ["); + p = VasEBoot_strstr (p, "raids = ["); if (p == NULL) { -#ifdef GRUB_UTIL - grub_util_info ("unknown raids"); +#ifdef VasEBoot_UTIL + VasEBoot_util_info ("unknown raids"); #endif goto lvs_segment_fail2; } @@ -641,9 +641,9 @@ grub_lvm_detect (grub_disk_t disk, { char *lvname; - p = grub_strchr (p, '"'); - p = p ? grub_strchr (p + 1, '"') : 0; - p = p ? grub_strchr (p + 1, '"') : 0; + p = VasEBoot_strchr (p, '"'); + p = p ? VasEBoot_strchr (p + 1, '"') : 0; + p = p ? VasEBoot_strchr (p + 1, '"') : 0; if (p == NULL) continue; q = ++p; @@ -652,20 +652,20 @@ grub_lvm_detect (grub_disk_t disk, s = q - p; - lvname = grub_malloc (s + 1); + lvname = VasEBoot_malloc (s + 1); if (lvname == NULL) goto lvs_segment_fail2; - grub_memcpy (lvname, p, s); + VasEBoot_memcpy (lvname, p, s); lvname[s] = '\0'; seg->nodes[j].name = lvname; p = q + 1; } - if (seg->type == GRUB_DISKFILTER_RAID4) + if (seg->type == VasEBoot_DISKFILTER_RAID4) { char *tmp; tmp = seg->nodes[0].name; - grub_memmove (seg->nodes, seg->nodes + 1, + VasEBoot_memmove (seg->nodes, seg->nodes + 1, sizeof (seg->nodes[0]) * (seg->node_count - 1)); seg->nodes[seg->node_count - 1].name = tmp; @@ -673,12 +673,12 @@ grub_lvm_detect (grub_disk_t disk, } else { -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL char *p2; - p2 = grub_strchr (p, '"'); + p2 = VasEBoot_strchr (p, '"'); if (p2) *p2 = 0; - grub_util_info ("unknown LVM type %s", p); + VasEBoot_util_info ("unknown LVM type %s", p); if (p2) *p2 ='"'; #endif @@ -691,21 +691,21 @@ grub_lvm_detect (grub_disk_t disk, continue; lvs_segment_fail2: - grub_free (seg->nodes); + VasEBoot_free (seg->nodes); lvs_segment_fail: goto fail4; } if (p != NULL) - p = grub_strchr (p, '}'); + p = VasEBoot_strchr (p, '}'); if (p == NULL) goto lvs_fail; p += 3; if (skip_lv) { - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->name); + VasEBoot_free (lv); continue; } @@ -715,16 +715,16 @@ grub_lvm_detect (grub_disk_t disk, continue; lvs_fail: - grub_free (lv->name); - grub_free (lv); + VasEBoot_free (lv->name); + VasEBoot_free (lv); goto fail4; } } /* Match lvs. */ { - struct grub_diskfilter_lv *lv1; - struct grub_diskfilter_lv *lv2; + struct VasEBoot_diskfilter_lv *lv1; + struct VasEBoot_diskfilter_lv *lv2; for (lv1 = vg->lvs; lv1; lv1 = lv1->next) for (i = 0; i < lv1->segment_count; i++) for (j = 0; j < lv1->segments[i].node_count; j++) @@ -732,7 +732,7 @@ grub_lvm_detect (grub_disk_t disk, if (vg->pvs) for (pv = vg->pvs; pv; pv = pv->next) { - if (! grub_strcmp (pv->name, + if (! VasEBoot_strcmp (pv->name, lv1->segments[i].nodes[j].name)) { lv1->segments[i].nodes[j].pv = pv; @@ -741,55 +741,55 @@ grub_lvm_detect (grub_disk_t disk, } if (lv1->segments[i].nodes[j].pv == NULL) for (lv2 = vg->lvs; lv2; lv2 = lv2->next) - if (grub_strcmp (lv2->name, + if (VasEBoot_strcmp (lv2->name, lv1->segments[i].nodes[j].name) == 0) lv1->segments[i].nodes[j].lv = lv2; } } - if (grub_diskfilter_vg_register (vg)) + if (VasEBoot_diskfilter_vg_register (vg)) goto fail4; } else { - grub_free (vgname); + VasEBoot_free (vgname); } - id->uuid = grub_malloc (GRUB_LVM_ID_STRLEN); + id->uuid = VasEBoot_malloc (VasEBoot_LVM_ID_STRLEN); if (!id->uuid) goto fail4; - grub_memcpy (id->uuid, pv_id, GRUB_LVM_ID_STRLEN); - id->uuidlen = GRUB_LVM_ID_STRLEN; - grub_free (metadatabuf); + VasEBoot_memcpy (id->uuid, pv_id, VasEBoot_LVM_ID_STRLEN); + id->uuidlen = VasEBoot_LVM_ID_STRLEN; + VasEBoot_free (metadatabuf); *start_sector = -1; return vg; /* Failure path. */ fail4: - grub_free (vg); + VasEBoot_free (vg); fail3: - grub_free (vgname); + VasEBoot_free (vgname); fail2: - grub_free (metadatabuf); + VasEBoot_free (metadatabuf); fail: return NULL; } -static struct grub_diskfilter grub_lvm_dev = { +static struct VasEBoot_diskfilter VasEBoot_lvm_dev = { .name = "lvm", - .detect = grub_lvm_detect, + .detect = VasEBoot_lvm_detect, .next = 0 }; -GRUB_MOD_INIT (lvm) +VasEBoot_MOD_INIT (lvm) { - grub_diskfilter_register_back (&grub_lvm_dev); + VasEBoot_diskfilter_register_back (&VasEBoot_lvm_dev); } -GRUB_MOD_FINI (lvm) +VasEBoot_MOD_FINI (lvm) { - grub_diskfilter_unregister (&grub_lvm_dev); + VasEBoot_diskfilter_unregister (&VasEBoot_lvm_dev); } diff --git a/VasEBoot-core/disk/mdraid1x_linux.c b/VasEBoot-core/disk/mdraid1x_linux.c index 7cc80d3df..5a2e6d5a7 100644 --- a/VasEBoot-core/disk/mdraid1x_linux.c +++ b/VasEBoot-core/disk/mdraid1x_linux.c @@ -1,30 +1,30 @@ /* mdraid_linux.c - module to handle Linux Software RAID. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Linux RAID on disk structures and constants, copied from include/linux/raid/md_p.h. */ @@ -39,55 +39,55 @@ GRUB_MOD_LICENSE ("GPLv3+"); * 1K allows 384 devices. */ -struct grub_raid_super_1x +struct VasEBoot_raid_super_1x { /* Constant array information - 128 bytes. */ - grub_uint32_t magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian. */ - grub_uint32_t major_version; /* 1. */ - grub_uint32_t feature_map; /* Bit 0 set if 'bitmap_offset' is meaningful. */ - grub_uint32_t pad0; /* Always set to 0 when writing. */ + VasEBoot_uint32_t magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian. */ + VasEBoot_uint32_t major_version; /* 1. */ + VasEBoot_uint32_t feature_map; /* Bit 0 set if 'bitmap_offset' is meaningful. */ + VasEBoot_uint32_t pad0; /* Always set to 0 when writing. */ - grub_uint8_t set_uuid[16]; /* User-space generated. */ + VasEBoot_uint8_t set_uuid[16]; /* User-space generated. */ char set_name[32]; /* Set and interpreted by user-space. */ - grub_uint64_t ctime; /* Lo 40 bits are seconds, top 24 are microseconds or 0. */ - grub_uint32_t level; /* -4 (multipath), -1 (linear), 0,1,4,5. */ - grub_uint32_t layout; /* only for raid5 and raid10 currently. */ - grub_uint64_t size; /* Used size of component devices, in 512byte sectors. */ + VasEBoot_uint64_t ctime; /* Lo 40 bits are seconds, top 24 are microseconds or 0. */ + VasEBoot_uint32_t level; /* -4 (multipath), -1 (linear), 0,1,4,5. */ + VasEBoot_uint32_t layout; /* only for raid5 and raid10 currently. */ + VasEBoot_uint64_t size; /* Used size of component devices, in 512byte sectors. */ - grub_uint32_t chunksize; /* In 512byte sectors. */ - grub_uint32_t raid_disks; - grub_uint32_t bitmap_offset; /* Sectors after start of superblock that bitmap starts + VasEBoot_uint32_t chunksize; /* In 512byte sectors. */ + VasEBoot_uint32_t raid_disks; + VasEBoot_uint32_t bitmap_offset; /* Sectors after start of superblock that bitmap starts * NOTE: signed, so bitmap can be before superblock * only meaningful of feature_map[0] is set. */ /* These are only valid with feature bit '4'. */ - grub_uint32_t new_level; /* New level we are reshaping to. */ - grub_uint64_t reshape_position; /* Next address in array-space for reshape. */ - grub_uint32_t delta_disks; /* Change in number of raid_disks. */ - grub_uint32_t new_layout; /* New layout. */ - grub_uint32_t new_chunk; /* New chunk size (512byte sectors). */ - grub_uint8_t pad1[128 - 124]; /* Set to 0 when written. */ + VasEBoot_uint32_t new_level; /* New level we are reshaping to. */ + VasEBoot_uint64_t reshape_position; /* Next address in array-space for reshape. */ + VasEBoot_uint32_t delta_disks; /* Change in number of raid_disks. */ + VasEBoot_uint32_t new_layout; /* New layout. */ + VasEBoot_uint32_t new_chunk; /* New chunk size (512byte sectors). */ + VasEBoot_uint8_t pad1[128 - 124]; /* Set to 0 when written. */ /* Constant this-device information - 64 bytes. */ - grub_uint64_t data_offset; /* Sector start of data, often 0. */ - grub_uint64_t data_size; /* Sectors in this device that can be used for data. */ - grub_uint64_t super_offset; /* Sector start of this superblock. */ - grub_uint64_t recovery_offset; /* Sectors before this offset (from data_offset) have been recovered. */ - grub_uint32_t dev_number; /* Permanent identifier of this device - not role in raid. */ - grub_uint32_t cnt_corrected_read; /* Number of read errors that were corrected by re-writing. */ - grub_uint8_t device_uuid[16]; /* User-space setable, ignored by kernel. */ - grub_uint8_t devflags; /* Per-device flags. Only one defined... */ - grub_uint8_t pad2[64 - 57]; /* Set to 0 when writing. */ + VasEBoot_uint64_t data_offset; /* Sector start of data, often 0. */ + VasEBoot_uint64_t data_size; /* Sectors in this device that can be used for data. */ + VasEBoot_uint64_t super_offset; /* Sector start of this superblock. */ + VasEBoot_uint64_t recovery_offset; /* Sectors before this offset (from data_offset) have been recovered. */ + VasEBoot_uint32_t dev_number; /* Permanent identifier of this device - not role in raid. */ + VasEBoot_uint32_t cnt_corrected_read; /* Number of read errors that were corrected by re-writing. */ + VasEBoot_uint8_t device_uuid[16]; /* User-space setable, ignored by kernel. */ + VasEBoot_uint8_t devflags; /* Per-device flags. Only one defined... */ + VasEBoot_uint8_t pad2[64 - 57]; /* Set to 0 when writing. */ /* Array state information - 64 bytes. */ - grub_uint64_t utime; /* 40 bits second, 24 btes microseconds. */ - grub_uint64_t events; /* Incremented when superblock updated. */ - grub_uint64_t resync_offset; /* Data before this offset (from data_offset) known to be in sync. */ - grub_uint32_t sb_csum; /* Checksum upto devs[max_dev]. */ - grub_uint32_t max_dev; /* Size of devs[] array to consider. */ - grub_uint8_t pad3[64 - 32]; /* Set to 0 when writing. */ + VasEBoot_uint64_t utime; /* 40 bits second, 24 btes microseconds. */ + VasEBoot_uint64_t events; /* Incremented when superblock updated. */ + VasEBoot_uint64_t resync_offset; /* Data before this offset (from data_offset) known to be in sync. */ + VasEBoot_uint32_t sb_csum; /* Checksum upto devs[max_dev]. */ + VasEBoot_uint32_t max_dev; /* Size of devs[] array to consider. */ + VasEBoot_uint8_t pad3[64 - 32]; /* Set to 0 when writing. */ /* Device state information. Indexed by dev_number. * 2 bytes per device. @@ -95,23 +95,23 @@ struct grub_raid_super_1x * into the 'roles' value. If a device is spare or faulty, then it doesn't * have a meaningful role. */ - grub_uint16_t dev_roles[0]; /* Role in array, or 0xffff for a spare, or 0xfffe for faulty. */ + VasEBoot_uint16_t dev_roles[0]; /* Role in array, or 0xffff for a spare, or 0xfffe for faulty. */ }; -/* Could be GRUB_PACKED, but since all members in this struct +/* Could be VasEBoot_PACKED, but since all members in this struct are already appropriately aligned, we can omit this and avoid suboptimal assembly in some cases. */ #define WriteMostly1 1 /* Mask for writemostly flag in above devflags. */ -static struct grub_diskfilter_vg * -grub_mdraid_detect (grub_disk_t disk, - struct grub_diskfilter_pv_id *id, - grub_disk_addr_t *start_sector) +static struct VasEBoot_diskfilter_vg * +VasEBoot_mdraid_detect (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_pv_id *id, + VasEBoot_disk_addr_t *start_sector) { - grub_uint64_t size; - grub_uint8_t minor_version; + VasEBoot_uint64_t size; + VasEBoot_uint8_t minor_version; - size = grub_disk_get_size (disk); + size = VasEBoot_disk_get_size (disk); /* Check for an 1.x superblock. * It's always aligned to a 4K boundary @@ -123,14 +123,14 @@ grub_mdraid_detect (grub_disk_t disk, for (minor_version = 0; minor_version < 3; ++minor_version) { - grub_disk_addr_t sector = 0; - struct grub_raid_super_1x sb; - grub_uint16_t role; - grub_uint32_t level; - struct grub_diskfilter_vg *array; + VasEBoot_disk_addr_t sector = 0; + struct VasEBoot_raid_super_1x sb; + VasEBoot_uint16_t role; + VasEBoot_uint32_t level; + struct VasEBoot_diskfilter_vg *array; char *uuid; - if (size == GRUB_DISK_SIZE_UNKNOWN && minor_version == 0) + if (size == VasEBoot_DISK_SIZE_UNKNOWN && minor_version == 0) continue; switch (minor_version) @@ -146,19 +146,19 @@ grub_mdraid_detect (grub_disk_t disk, break; } - if (grub_disk_read (disk, sector, 0, sizeof (struct grub_raid_super_1x), + if (VasEBoot_disk_read (disk, sector, 0, sizeof (struct VasEBoot_raid_super_1x), &sb)) return NULL; - if (sb.magic != grub_cpu_to_le32_compile_time (SB_MAGIC) - || grub_le_to_cpu64 (sb.super_offset) != sector) + if (sb.magic != VasEBoot_cpu_to_le32_compile_time (SB_MAGIC) + || VasEBoot_le_to_cpu64 (sb.super_offset) != sector) continue; - if (sb.major_version != grub_cpu_to_le32_compile_time (1)) + if (sb.major_version != VasEBoot_cpu_to_le32_compile_time (1)) /* Unsupported version. */ return NULL; - level = grub_le_to_cpu32 (sb.level); + level = VasEBoot_le_to_cpu32 (sb.level); /* Multipath. */ if ((int) level == -4) @@ -167,47 +167,47 @@ grub_mdraid_detect (grub_disk_t disk, if (level != 0 && level != 1 && level != 4 && level != 5 && level != 6 && level != 10) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "Unsupported RAID level: %d", sb.level); return NULL; } - if (grub_le_to_cpu32 (sb.dev_number) >= - grub_le_to_cpu32 (sb.max_dev)) + if (VasEBoot_le_to_cpu32 (sb.dev_number) >= + VasEBoot_le_to_cpu32 (sb.max_dev)) /* Spares aren't implemented. */ return NULL; - if (grub_disk_read (disk, sector, - (char *) &sb.dev_roles[grub_le_to_cpu32 (sb.dev_number)] + if (VasEBoot_disk_read (disk, sector, + (char *) &sb.dev_roles[VasEBoot_le_to_cpu32 (sb.dev_number)] - (char *) &sb, sizeof (role), &role)) return NULL; - if (grub_le_to_cpu16 (role) - >= grub_le_to_cpu32 (sb.raid_disks)) + if (VasEBoot_le_to_cpu16 (role) + >= VasEBoot_le_to_cpu32 (sb.raid_disks)) /* Spares aren't implemented. */ return NULL; id->uuidlen = 0; - id->id = grub_le_to_cpu16 (role); + id->id = VasEBoot_le_to_cpu16 (role); - uuid = grub_malloc (16); + uuid = VasEBoot_malloc (16); if (!uuid) return NULL; - grub_memcpy (uuid, sb.set_uuid, 16); + VasEBoot_memcpy (uuid, sb.set_uuid, 16); - *start_sector = grub_le_to_cpu64 (sb.data_offset); + *start_sector = VasEBoot_le_to_cpu64 (sb.data_offset); - array = grub_diskfilter_make_raid (16, uuid, - grub_le_to_cpu32 (sb.raid_disks), + array = VasEBoot_diskfilter_make_raid (16, uuid, + VasEBoot_le_to_cpu32 (sb.raid_disks), sb.set_name, (sb.size) - ? grub_le_to_cpu64 (sb.size) - : grub_le_to_cpu64 (sb.data_size), - grub_le_to_cpu32 (sb.chunksize), - grub_le_to_cpu32 (sb.layout), - grub_le_to_cpu32 (sb.level)); + ? VasEBoot_le_to_cpu64 (sb.size) + : VasEBoot_le_to_cpu64 (sb.data_size), + VasEBoot_le_to_cpu32 (sb.chunksize), + VasEBoot_le_to_cpu32 (sb.layout), + VasEBoot_le_to_cpu32 (sb.level)); return array; } @@ -216,18 +216,18 @@ grub_mdraid_detect (grub_disk_t disk, return NULL; } -static struct grub_diskfilter grub_mdraid_dev = { +static struct VasEBoot_diskfilter VasEBoot_mdraid_dev = { .name = "mdraid1x", - .detect = grub_mdraid_detect, + .detect = VasEBoot_mdraid_detect, .next = 0 }; -GRUB_MOD_INIT (mdraid1x) +VasEBoot_MOD_INIT (mdraid1x) { - grub_diskfilter_register_front (&grub_mdraid_dev); + VasEBoot_diskfilter_register_front (&VasEBoot_mdraid_dev); } -GRUB_MOD_FINI (mdraid1x) +VasEBoot_MOD_FINI (mdraid1x) { - grub_diskfilter_unregister (&grub_mdraid_dev); + VasEBoot_diskfilter_unregister (&VasEBoot_mdraid_dev); } diff --git a/VasEBoot-core/disk/mdraid_linux.c b/VasEBoot-core/disk/mdraid_linux.c index 11024ae31..0b2d2ee00 100644 --- a/VasEBoot-core/disk/mdraid_linux.c +++ b/VasEBoot-core/disk/mdraid_linux.c @@ -1,48 +1,48 @@ /* mdraid_linux.c - module to handle Linux Software RAID. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* Linux RAID on disk structures and constants, copied from include/linux/raid/md_p.h. */ -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #ifdef MODE_BIGENDIAN -#define grub_md_to_cpu64 grub_be_to_cpu64 -#define grub_md_to_cpu32 grub_be_to_cpu32 -#define grub_md_to_cpu16 grub_be_to_cpu16 -#define grub_cpu_to_md64_compile_time grub_cpu_to_be64_compile_time -#define grub_cpu_to_md32_compile_time grub_cpu_to_be32_compile_time -#define grub_cpu_to_md16_compile_time grub_cpu_to_be16_compile_time +#define VasEBoot_md_to_cpu64 VasEBoot_be_to_cpu64 +#define VasEBoot_md_to_cpu32 VasEBoot_be_to_cpu32 +#define VasEBoot_md_to_cpu16 VasEBoot_be_to_cpu16 +#define VasEBoot_cpu_to_md64_compile_time VasEBoot_cpu_to_be64_compile_time +#define VasEBoot_cpu_to_md32_compile_time VasEBoot_cpu_to_be32_compile_time +#define VasEBoot_cpu_to_md16_compile_time VasEBoot_cpu_to_be16_compile_time #else -#define grub_md_to_cpu64 grub_le_to_cpu64 -#define grub_md_to_cpu32 grub_le_to_cpu32 -#define grub_md_to_cpu16 grub_le_to_cpu16 -#define grub_cpu_to_md64_compile_time grub_cpu_to_le64_compile_time -#define grub_cpu_to_md32_compile_time grub_cpu_to_le32_compile_time -#define grub_cpu_to_md16_compile_time grub_cpu_to_le16_compile_time +#define VasEBoot_md_to_cpu64 VasEBoot_le_to_cpu64 +#define VasEBoot_md_to_cpu32 VasEBoot_le_to_cpu32 +#define VasEBoot_md_to_cpu16 VasEBoot_le_to_cpu16 +#define VasEBoot_cpu_to_md64_compile_time VasEBoot_cpu_to_le64_compile_time +#define VasEBoot_cpu_to_md32_compile_time VasEBoot_cpu_to_le32_compile_time +#define VasEBoot_cpu_to_md16_compile_time VasEBoot_cpu_to_le16_compile_time #endif #define RESERVED_BYTES (64 * 1024) @@ -104,123 +104,123 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define SB_BITMAP_PRESENT 8 -struct grub_raid_disk_09 +struct VasEBoot_raid_disk_09 { - grub_uint32_t number; /* Device number in the entire set. */ - grub_uint32_t major; /* Device major number. */ - grub_uint32_t minor; /* Device minor number. */ - grub_uint32_t raid_disk; /* The role of the device in the raid set. */ - grub_uint32_t state; /* Operational state. */ - grub_uint32_t reserved[SB_DESCRIPTOR_WORDS - 5]; + VasEBoot_uint32_t number; /* Device number in the entire set. */ + VasEBoot_uint32_t major; /* Device major number. */ + VasEBoot_uint32_t minor; /* Device minor number. */ + VasEBoot_uint32_t raid_disk; /* The role of the device in the raid set. */ + VasEBoot_uint32_t state; /* Operational state. */ + VasEBoot_uint32_t reserved[SB_DESCRIPTOR_WORDS - 5]; }; -struct grub_raid_super_09 +struct VasEBoot_raid_super_09 { /* * Constant generic information */ - grub_uint32_t md_magic; /* MD identifier. */ - grub_uint32_t major_version; /* Major version. */ - grub_uint32_t minor_version; /* Minor version. */ - grub_uint32_t patch_version; /* Patchlevel version. */ - grub_uint32_t gvalid_words; /* Number of used words in this section. */ - grub_uint32_t set_uuid0; /* Raid set identifier. */ - grub_uint32_t ctime; /* Creation time. */ - grub_uint32_t level; /* Raid personality. */ - grub_uint32_t size; /* Apparent size of each individual disk. */ - grub_uint32_t nr_disks; /* Total disks in the raid set. */ - grub_uint32_t raid_disks; /* Disks in a fully functional raid set. */ - grub_uint32_t md_minor; /* Preferred MD minor device number. */ - grub_uint32_t not_persistent; /* Does it have a persistent superblock. */ - grub_uint32_t set_uuid1; /* Raid set identifier #2. */ - grub_uint32_t set_uuid2; /* Raid set identifier #3. */ - grub_uint32_t set_uuid3; /* Raid set identifier #4. */ - grub_uint32_t gstate_creserved[SB_GENERIC_CONSTANT_WORDS - 16]; + VasEBoot_uint32_t md_magic; /* MD identifier. */ + VasEBoot_uint32_t major_version; /* Major version. */ + VasEBoot_uint32_t minor_version; /* Minor version. */ + VasEBoot_uint32_t patch_version; /* Patchlevel version. */ + VasEBoot_uint32_t gvalid_words; /* Number of used words in this section. */ + VasEBoot_uint32_t set_uuid0; /* Raid set identifier. */ + VasEBoot_uint32_t ctime; /* Creation time. */ + VasEBoot_uint32_t level; /* Raid personality. */ + VasEBoot_uint32_t size; /* Apparent size of each individual disk. */ + VasEBoot_uint32_t nr_disks; /* Total disks in the raid set. */ + VasEBoot_uint32_t raid_disks; /* Disks in a fully functional raid set. */ + VasEBoot_uint32_t md_minor; /* Preferred MD minor device number. */ + VasEBoot_uint32_t not_persistent; /* Does it have a persistent superblock. */ + VasEBoot_uint32_t set_uuid1; /* Raid set identifier #2. */ + VasEBoot_uint32_t set_uuid2; /* Raid set identifier #3. */ + VasEBoot_uint32_t set_uuid3; /* Raid set identifier #4. */ + VasEBoot_uint32_t gstate_creserved[SB_GENERIC_CONSTANT_WORDS - 16]; /* * Generic state information */ - grub_uint32_t utime; /* Superblock update time. */ - grub_uint32_t state; /* State bits (clean, ...). */ - grub_uint32_t active_disks; /* Number of currently active disks. */ - grub_uint32_t working_disks; /* Number of working disks. */ - grub_uint32_t failed_disks; /* Number of failed disks. */ - grub_uint32_t spare_disks; /* Number of spare disks. */ - grub_uint32_t sb_csum; /* Checksum of the whole superblock. */ - grub_uint64_t events; /* Superblock update count. */ - grub_uint64_t cp_events; /* Checkpoint update count. */ - grub_uint32_t recovery_cp; /* Recovery checkpoint sector count. */ - grub_uint32_t gstate_sreserved[SB_GENERIC_STATE_WORDS - 12]; + VasEBoot_uint32_t utime; /* Superblock update time. */ + VasEBoot_uint32_t state; /* State bits (clean, ...). */ + VasEBoot_uint32_t active_disks; /* Number of currently active disks. */ + VasEBoot_uint32_t working_disks; /* Number of working disks. */ + VasEBoot_uint32_t failed_disks; /* Number of failed disks. */ + VasEBoot_uint32_t spare_disks; /* Number of spare disks. */ + VasEBoot_uint32_t sb_csum; /* Checksum of the whole superblock. */ + VasEBoot_uint64_t events; /* Superblock update count. */ + VasEBoot_uint64_t cp_events; /* Checkpoint update count. */ + VasEBoot_uint32_t recovery_cp; /* Recovery checkpoint sector count. */ + VasEBoot_uint32_t gstate_sreserved[SB_GENERIC_STATE_WORDS - 12]; /* * Personality information */ - grub_uint32_t layout; /* The array's physical layout. */ - grub_uint32_t chunk_size; /* Chunk size in bytes. */ - grub_uint32_t root_pv; /* LV root PV. */ - grub_uint32_t root_block; /* LV root block. */ - grub_uint32_t pstate_reserved[SB_PERSONALITY_WORDS - 4]; + VasEBoot_uint32_t layout; /* The array's physical layout. */ + VasEBoot_uint32_t chunk_size; /* Chunk size in bytes. */ + VasEBoot_uint32_t root_pv; /* LV root PV. */ + VasEBoot_uint32_t root_block; /* LV root block. */ + VasEBoot_uint32_t pstate_reserved[SB_PERSONALITY_WORDS - 4]; /* * Disks information */ - struct grub_raid_disk_09 disks[SB_DISKS]; + struct VasEBoot_raid_disk_09 disks[SB_DISKS]; /* * Reserved */ - grub_uint32_t reserved[SB_RESERVED_WORDS]; + VasEBoot_uint32_t reserved[SB_RESERVED_WORDS]; /* * Active descriptor */ - struct grub_raid_disk_09 this_disk; -} GRUB_PACKED; + struct VasEBoot_raid_disk_09 this_disk; +} VasEBoot_PACKED; -static struct grub_diskfilter_vg * -grub_mdraid_detect (grub_disk_t disk, - struct grub_diskfilter_pv_id *id, - grub_disk_addr_t *start_sector) +static struct VasEBoot_diskfilter_vg * +VasEBoot_mdraid_detect (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_pv_id *id, + VasEBoot_disk_addr_t *start_sector) { - grub_disk_addr_t sector; - grub_uint64_t size; - struct grub_raid_super_09 *sb = NULL; - grub_uint32_t *uuid; - grub_uint32_t level; - struct grub_diskfilter_vg *ret; + VasEBoot_disk_addr_t sector; + VasEBoot_uint64_t size; + struct VasEBoot_raid_super_09 *sb = NULL; + VasEBoot_uint32_t *uuid; + VasEBoot_uint32_t level; + struct VasEBoot_diskfilter_vg *ret; /* The sector where the mdraid 0.90 superblock is stored, if available. */ - size = grub_disk_get_size (disk); - if (size == GRUB_DISK_SIZE_UNKNOWN) + size = VasEBoot_disk_get_size (disk); + if (size == VasEBoot_DISK_SIZE_UNKNOWN) /* not 0.9x raid. */ return NULL; sector = NEW_SIZE_SECTORS (size); - sb = grub_malloc (sizeof (*sb)); + sb = VasEBoot_malloc (sizeof (*sb)); if (!sb) return NULL; - if (grub_disk_read (disk, sector, 0, SB_BYTES, sb)) + if (VasEBoot_disk_read (disk, sector, 0, SB_BYTES, sb)) goto fail; /* Look whether there is a mdraid 0.90 superblock. */ - if (sb->md_magic != grub_cpu_to_md32_compile_time (SB_MAGIC)) + if (sb->md_magic != VasEBoot_cpu_to_md32_compile_time (SB_MAGIC)) /* not 0.9x raid. */ goto fail; - if (sb->major_version != grub_cpu_to_md32_compile_time (0) - || sb->minor_version != grub_cpu_to_md32_compile_time (90)) + if (sb->major_version != VasEBoot_cpu_to_md32_compile_time (0) + || sb->minor_version != VasEBoot_cpu_to_md32_compile_time (90)) /* Unsupported version. */ goto fail; /* No need for explicit check that sb->size is 0 (unspecified) since 0 >= non-0 is false. */ - if (((grub_disk_addr_t) grub_md_to_cpu32 (sb->size)) * 2 >= size) + if (((VasEBoot_disk_addr_t) VasEBoot_md_to_cpu32 (sb->size)) * 2 >= size) goto fail; /* FIXME: Check the checksum. */ - level = grub_md_to_cpu32 (sb->level); + level = VasEBoot_md_to_cpu32 (sb->level); /* Multipath. */ if ((int) level == -4) level = 1; @@ -228,71 +228,71 @@ grub_mdraid_detect (grub_disk_t disk, if (level != 0 && level != 1 && level != 4 && level != 5 && level != 6 && level != 10) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported RAID level: %d", level); goto fail; } - if (grub_md_to_cpu32 (sb->this_disk.number) == 0xffff - || grub_md_to_cpu32 (sb->this_disk.number) == 0xfffe) + if (VasEBoot_md_to_cpu32 (sb->this_disk.number) == 0xffff + || VasEBoot_md_to_cpu32 (sb->this_disk.number) == 0xfffe) /* Spares aren't implemented. */ goto fail; - uuid = grub_malloc (16); + uuid = VasEBoot_malloc (16); if (!uuid) goto fail; - uuid[0] = grub_swap_bytes32 (sb->set_uuid0); - uuid[1] = grub_swap_bytes32 (sb->set_uuid1); - uuid[2] = grub_swap_bytes32 (sb->set_uuid2); - uuid[3] = grub_swap_bytes32 (sb->set_uuid3); + uuid[0] = VasEBoot_swap_bytes32 (sb->set_uuid0); + uuid[1] = VasEBoot_swap_bytes32 (sb->set_uuid1); + uuid[2] = VasEBoot_swap_bytes32 (sb->set_uuid2); + uuid[3] = VasEBoot_swap_bytes32 (sb->set_uuid3); *start_sector = 0; id->uuidlen = 0; - id->id = grub_md_to_cpu32 (sb->this_disk.number); + id->id = VasEBoot_md_to_cpu32 (sb->this_disk.number); char buf[32]; - grub_snprintf (buf, sizeof (buf), "md%d", grub_md_to_cpu32 (sb->md_minor)); - ret = grub_diskfilter_make_raid (16, (char *) uuid, - grub_md_to_cpu32 (sb->raid_disks), buf, - (sb->size) ? ((grub_disk_addr_t) - grub_md_to_cpu32 (sb->size)) * 2 + VasEBoot_snprintf (buf, sizeof (buf), "md%d", VasEBoot_md_to_cpu32 (sb->md_minor)); + ret = VasEBoot_diskfilter_make_raid (16, (char *) uuid, + VasEBoot_md_to_cpu32 (sb->raid_disks), buf, + (sb->size) ? ((VasEBoot_disk_addr_t) + VasEBoot_md_to_cpu32 (sb->size)) * 2 : sector, - grub_md_to_cpu32 (sb->chunk_size) >> 9, - grub_md_to_cpu32 (sb->layout), + VasEBoot_md_to_cpu32 (sb->chunk_size) >> 9, + VasEBoot_md_to_cpu32 (sb->layout), level); - grub_free (sb); + VasEBoot_free (sb); return ret; fail: - grub_free (sb); + VasEBoot_free (sb); return NULL; } -static struct grub_diskfilter grub_mdraid_dev = { +static struct VasEBoot_diskfilter VasEBoot_mdraid_dev = { #ifdef MODE_BIGENDIAN .name = "mdraid09_be", #else .name = "mdraid09", #endif - .detect = grub_mdraid_detect, + .detect = VasEBoot_mdraid_detect, .next = 0 }; #ifdef MODE_BIGENDIAN -GRUB_MOD_INIT (mdraid09_be) +VasEBoot_MOD_INIT (mdraid09_be) #else -GRUB_MOD_INIT (mdraid09) +VasEBoot_MOD_INIT (mdraid09) #endif { - grub_diskfilter_register_front (&grub_mdraid_dev); + VasEBoot_diskfilter_register_front (&VasEBoot_mdraid_dev); } #ifdef MODE_BIGENDIAN -GRUB_MOD_FINI (mdraid09_be) +VasEBoot_MOD_FINI (mdraid09_be) #else -GRUB_MOD_FINI (mdraid09) +VasEBoot_MOD_FINI (mdraid09) #endif { - grub_diskfilter_unregister (&grub_mdraid_dev); + VasEBoot_diskfilter_unregister (&VasEBoot_mdraid_dev); } diff --git a/VasEBoot-core/disk/memdisk.c b/VasEBoot-core/disk/memdisk.c index e5ffc01bf..d61ab2d6d 100644 --- a/VasEBoot-core/disk/memdisk.c +++ b/VasEBoot-core/disk/memdisk.c @@ -1,116 +1,116 @@ /* memdisk.c - Access embedded memory disk. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static char *memdisk_addr; -static grub_off_t memdisk_size = 0; +static VasEBoot_off_t memdisk_size = 0; static int -grub_memdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_memdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; return hook ("memdisk", hook_data); } -static grub_err_t -grub_memdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_memdisk_open (const char *name, VasEBoot_disk_t disk) { - if (grub_strcmp (name, "memdisk")) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a memdisk"); + if (VasEBoot_strcmp (name, "memdisk")) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a memdisk"); - disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE; - disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; + disk->total_sectors = memdisk_size / VasEBoot_DISK_SECTOR_SIZE; + disk->max_agglomerate = VasEBoot_DISK_MAX_MAX_AGGLOMERATE; disk->id = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_memdisk_close (grub_disk_t disk __attribute((unused))) +VasEBoot_memdisk_close (VasEBoot_disk_t disk __attribute((unused))) { } -static grub_err_t -grub_memdisk_read (grub_disk_t disk __attribute((unused)), grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_memdisk_read (VasEBoot_disk_t disk __attribute((unused)), VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_memcpy (buf, memdisk_addr + (sector << GRUB_DISK_SECTOR_BITS), size << GRUB_DISK_SECTOR_BITS); + VasEBoot_memcpy (buf, memdisk_addr + (sector << VasEBoot_DISK_SECTOR_BITS), size << VasEBoot_DISK_SECTOR_BITS); return 0; } -static grub_err_t -grub_memdisk_write (grub_disk_t disk __attribute((unused)), grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_memdisk_write (VasEBoot_disk_t disk __attribute((unused)), VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_memcpy (memdisk_addr + (sector << GRUB_DISK_SECTOR_BITS), buf, size << GRUB_DISK_SECTOR_BITS); + VasEBoot_memcpy (memdisk_addr + (sector << VasEBoot_DISK_SECTOR_BITS), buf, size << VasEBoot_DISK_SECTOR_BITS); return 0; } -static struct grub_disk_dev grub_memdisk_dev = +static struct VasEBoot_disk_dev VasEBoot_memdisk_dev = { .name = "memdisk", - .id = GRUB_DISK_DEVICE_MEMDISK_ID, - .iterate = grub_memdisk_iterate, - .open = grub_memdisk_open, - .close = grub_memdisk_close, - .read = grub_memdisk_read, - .write = grub_memdisk_write, + .id = VasEBoot_DISK_DEVICE_MEMDISK_ID, + .iterate = VasEBoot_memdisk_iterate, + .open = VasEBoot_memdisk_open, + .close = VasEBoot_memdisk_close, + .read = VasEBoot_memdisk_read, + .write = VasEBoot_memdisk_write, .next = 0 }; -GRUB_MOD_INIT(memdisk) +VasEBoot_MOD_INIT(memdisk) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; FOR_MODULES (header) if (header->type == OBJ_TYPE_MEMDISK) { char *memdisk_orig_addr; - memdisk_orig_addr = (char *) header + sizeof (struct grub_module_header); + memdisk_orig_addr = (char *) header + sizeof (struct VasEBoot_module_header); - grub_dprintf ("memdisk", "Found memdisk image at %p\n", memdisk_orig_addr); + VasEBoot_dprintf ("memdisk", "Found memdisk image at %p\n", memdisk_orig_addr); - memdisk_size = header->size - sizeof (struct grub_module_header); - memdisk_addr = grub_malloc (memdisk_size); + memdisk_size = header->size - sizeof (struct VasEBoot_module_header); + memdisk_addr = VasEBoot_malloc (memdisk_size); - grub_dprintf ("memdisk", "Copying memdisk image to dynamic memory\n"); - grub_memmove (memdisk_addr, memdisk_orig_addr, memdisk_size); + VasEBoot_dprintf ("memdisk", "Copying memdisk image to dynamic memory\n"); + VasEBoot_memmove (memdisk_addr, memdisk_orig_addr, memdisk_size); - grub_disk_dev_register (&grub_memdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_memdisk_dev); break; } } -GRUB_MOD_FINI(memdisk) +VasEBoot_MOD_FINI(memdisk) { if (! memdisk_size) return; - grub_free (memdisk_addr); - grub_disk_dev_unregister (&grub_memdisk_dev); + VasEBoot_free (memdisk_addr); + VasEBoot_disk_dev_unregister (&VasEBoot_memdisk_dev); } diff --git a/VasEBoot-core/disk/pata.c b/VasEBoot-core/disk/pata.c index 23eef2be1..babc7c348 100644 --- a/VasEBoot-core/disk/pata.c +++ b/VasEBoot-core/disk/pata.c @@ -1,49 +1,49 @@ /* ata_pthru.c - ATA pass through for ata.mod. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#ifndef GRUB_MACHINE_MIPS_QEMU_MIPS -#include -#include +#include +#include +#include +#include +#include +#ifndef VasEBoot_MACHINE_MIPS_QEMU_MIPS +#include +#include #else -#define GRUB_MACHINE_PCI_IO_BASE 0xb4000000 +#define VasEBoot_MACHINE_PCI_IO_BASE 0xb4000000 #endif -#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* At the moment, only two IDE ports are supported. */ -static const grub_port_t grub_pata_ioaddress[] = { GRUB_ATA_CH0_PORT1, - GRUB_ATA_CH1_PORT1 }; +static const VasEBoot_port_t VasEBoot_pata_ioaddress[] = { VasEBoot_ATA_CH0_PORT1, + VasEBoot_ATA_CH1_PORT1 }; -struct grub_pata_device +struct VasEBoot_pata_device { /* IDE port to use. */ int port; /* IO addresses on which the registers for this device can be found. */ - grub_port_t ioaddress; + VasEBoot_port_t ioaddress; /* Two devices can be connected to a single cable. Use this field to select device 0 (commonly known as "master") or device 1 @@ -52,249 +52,249 @@ struct grub_pata_device int present; - struct grub_pata_device *next; + struct VasEBoot_pata_device *next; }; -static struct grub_pata_device *grub_pata_devices; +static struct VasEBoot_pata_device *VasEBoot_pata_devices; static inline void -grub_pata_regset (struct grub_pata_device *dev, int reg, int val) +VasEBoot_pata_regset (struct VasEBoot_pata_device *dev, int reg, int val) { - grub_outb (val, dev->ioaddress + reg); + VasEBoot_outb (val, dev->ioaddress + reg); } -static inline grub_uint8_t -grub_pata_regget (struct grub_pata_device *dev, int reg) +static inline VasEBoot_uint8_t +VasEBoot_pata_regget (struct VasEBoot_pata_device *dev, int reg) { - return grub_inb (dev->ioaddress + reg); + return VasEBoot_inb (dev->ioaddress + reg); } /* Wait for !BSY. */ -static grub_err_t -grub_pata_wait_not_busy (struct grub_pata_device *dev, int milliseconds) +static VasEBoot_err_t +VasEBoot_pata_wait_not_busy (struct VasEBoot_pata_device *dev, int milliseconds) { /* ATA requires 400ns (after a write to CMD register) or 1 PIO cycle (after a DRQ block transfer) before first check of BSY. */ - grub_millisleep (1); + VasEBoot_millisleep (1); int i = 1; - grub_uint8_t sts; - while ((sts = grub_pata_regget (dev, GRUB_ATA_REG_STATUS)) - & GRUB_ATA_STATUS_BUSY) + VasEBoot_uint8_t sts; + while ((sts = VasEBoot_pata_regget (dev, VasEBoot_ATA_REG_STATUS)) + & VasEBoot_ATA_STATUS_BUSY) { if (i >= milliseconds) { - grub_dprintf ("pata", "timeout: %dms, status=0x%x\n", + VasEBoot_dprintf ("pata", "timeout: %dms, status=0x%x\n", milliseconds, sts); - return grub_error (GRUB_ERR_TIMEOUT, "PATA timeout"); + return VasEBoot_error (VasEBoot_ERR_TIMEOUT, "PATA timeout"); } - grub_millisleep (1); + VasEBoot_millisleep (1); i++; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_pata_check_ready (struct grub_pata_device *dev, int spinup) +static inline VasEBoot_err_t +VasEBoot_pata_check_ready (struct VasEBoot_pata_device *dev, int spinup) { - if (grub_pata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY) - return grub_pata_wait_not_busy (dev, spinup ? GRUB_ATA_TOUT_SPINUP - : GRUB_ATA_TOUT_STD); + if (VasEBoot_pata_regget (dev, VasEBoot_ATA_REG_STATUS) & VasEBoot_ATA_STATUS_BUSY) + return VasEBoot_pata_wait_not_busy (dev, spinup ? VasEBoot_ATA_TOUT_SPINUP + : VasEBoot_ATA_TOUT_STD); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static inline void -grub_pata_wait (void) +VasEBoot_pata_wait (void) { - grub_millisleep (50); + VasEBoot_millisleep (50); } -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS -#define grub_ata_to_cpu16(x) ((grub_uint16_t) (x)) -#define grub_cpu_to_ata16(x) ((grub_uint16_t) (x)) +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS +#define VasEBoot_ata_to_cpu16(x) ((VasEBoot_uint16_t) (x)) +#define VasEBoot_cpu_to_ata16(x) ((VasEBoot_uint16_t) (x)) #else -#define grub_ata_to_cpu16 grub_le_to_cpu16 -#define grub_cpu_to_ata16 grub_cpu_to_le16 +#define VasEBoot_ata_to_cpu16 VasEBoot_le_to_cpu16 +#define VasEBoot_cpu_to_ata16 VasEBoot_cpu_to_le16 #endif static void -grub_pata_pio_read (struct grub_pata_device *dev, char *buf, grub_size_t size) +VasEBoot_pata_pio_read (struct VasEBoot_pata_device *dev, char *buf, VasEBoot_size_t size) { unsigned int i; /* Read in the data, word by word. */ for (i = 0; i < size / 2; i++) - grub_set_unaligned16 (buf + 2 * i, - grub_ata_to_cpu16 (grub_inw(dev->ioaddress - + GRUB_ATA_REG_DATA))); + VasEBoot_set_unaligned16 (buf + 2 * i, + VasEBoot_ata_to_cpu16 (VasEBoot_inw(dev->ioaddress + + VasEBoot_ATA_REG_DATA))); if (size & 1) - buf[size - 1] = (char) grub_ata_to_cpu16 (grub_inw (dev->ioaddress - + GRUB_ATA_REG_DATA)); + buf[size - 1] = (char) VasEBoot_ata_to_cpu16 (VasEBoot_inw (dev->ioaddress + + VasEBoot_ATA_REG_DATA)); } static void -grub_pata_pio_write (struct grub_pata_device *dev, char *buf, grub_size_t size) +VasEBoot_pata_pio_write (struct VasEBoot_pata_device *dev, char *buf, VasEBoot_size_t size) { unsigned int i; /* Write the data, word by word. */ for (i = 0; i < size / 2; i++) - grub_outw(grub_cpu_to_ata16 (grub_get_unaligned16 (buf + 2 * i)), dev->ioaddress + GRUB_ATA_REG_DATA); + VasEBoot_outw(VasEBoot_cpu_to_ata16 (VasEBoot_get_unaligned16 (buf + 2 * i)), dev->ioaddress + VasEBoot_ATA_REG_DATA); } /* ATA pass through support, used by hdparm.mod. */ -static grub_err_t -grub_pata_readwrite (struct grub_ata *disk, - struct grub_disk_ata_pass_through_parms *parms, +static VasEBoot_err_t +VasEBoot_pata_readwrite (struct VasEBoot_ata *disk, + struct VasEBoot_disk_ata_pass_through_parms *parms, int spinup) { - struct grub_pata_device *dev = (struct grub_pata_device *) disk->data; - grub_size_t nread = 0; + struct VasEBoot_pata_device *dev = (struct VasEBoot_pata_device *) disk->data; + VasEBoot_size_t nread = 0; int i; if (! (parms->cmdsize == 0 || parms->cmdsize == 12)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "ATAPI non-12 byte commands not supported"); - grub_dprintf ("pata", "pata_pass_through: cmd=0x%x, features=0x%x, sectors=0x%x\n", + VasEBoot_dprintf ("pata", "pata_pass_through: cmd=0x%x, features=0x%x, sectors=0x%x\n", parms->taskfile.cmd, parms->taskfile.features, parms->taskfile.sectors); - grub_dprintf ("pata", "lba_high=0x%x, lba_mid=0x%x, lba_low=0x%x, size=%" - PRIuGRUB_SIZE "\n", + VasEBoot_dprintf ("pata", "lba_high=0x%x, lba_mid=0x%x, lba_low=0x%x, size=%" + PRIuVasEBoot_SIZE "\n", parms->taskfile.lba_high, parms->taskfile.lba_mid, parms->taskfile.lba_low, parms->size); /* Set registers. */ - grub_pata_regset (dev, GRUB_ATA_REG_DISK, (dev->device << 4) + VasEBoot_pata_regset (dev, VasEBoot_ATA_REG_DISK, (dev->device << 4) | (parms->taskfile.disk & 0xef)); - if (grub_pata_check_ready (dev, spinup)) - return grub_errno; + if (VasEBoot_pata_check_ready (dev, spinup)) + return VasEBoot_errno; - for (i = GRUB_ATA_REG_SECTORS; i <= GRUB_ATA_REG_LBAHIGH; i++) - grub_pata_regset (dev, i, - parms->taskfile.raw[7 + (i - GRUB_ATA_REG_SECTORS)]); - for (i = GRUB_ATA_REG_FEATURES; i <= GRUB_ATA_REG_LBAHIGH; i++) - grub_pata_regset (dev, i, parms->taskfile.raw[i - GRUB_ATA_REG_FEATURES]); + for (i = VasEBoot_ATA_REG_SECTORS; i <= VasEBoot_ATA_REG_LBAHIGH; i++) + VasEBoot_pata_regset (dev, i, + parms->taskfile.raw[7 + (i - VasEBoot_ATA_REG_SECTORS)]); + for (i = VasEBoot_ATA_REG_FEATURES; i <= VasEBoot_ATA_REG_LBAHIGH; i++) + VasEBoot_pata_regset (dev, i, parms->taskfile.raw[i - VasEBoot_ATA_REG_FEATURES]); /* Start command. */ - grub_pata_regset (dev, GRUB_ATA_REG_CMD, parms->taskfile.cmd); + VasEBoot_pata_regset (dev, VasEBoot_ATA_REG_CMD, parms->taskfile.cmd); /* Wait for !BSY. */ - if (grub_pata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) - return grub_errno; + if (VasEBoot_pata_wait_not_busy (dev, VasEBoot_ATA_TOUT_DATA)) + return VasEBoot_errno; /* Check status. */ - grub_int8_t sts = grub_pata_regget (dev, GRUB_ATA_REG_STATUS); - grub_dprintf ("pata", "status=0x%x\n", sts); + VasEBoot_int8_t sts = VasEBoot_pata_regget (dev, VasEBoot_ATA_REG_STATUS); + VasEBoot_dprintf ("pata", "status=0x%x\n", sts); if (parms->cmdsize) { - grub_uint8_t irs; + VasEBoot_uint8_t irs; /* Wait for !BSY. */ - if (grub_pata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) - return grub_errno; + if (VasEBoot_pata_wait_not_busy (dev, VasEBoot_ATA_TOUT_DATA)) + return VasEBoot_errno; - irs = grub_pata_regget (dev, GRUB_ATAPI_REG_IREASON); + irs = VasEBoot_pata_regget (dev, VasEBoot_ATAPI_REG_IREASON); /* OK if DRQ is asserted and interrupt reason is as expected. */ - if (!((sts & GRUB_ATA_STATUS_DRQ) - && (irs & GRUB_ATAPI_IREASON_MASK) == GRUB_ATAPI_IREASON_CMD_OUT)) - return grub_error (GRUB_ERR_READ_ERROR, "ATAPI protocol error"); + if (!((sts & VasEBoot_ATA_STATUS_DRQ) + && (irs & VasEBoot_ATAPI_IREASON_MASK) == VasEBoot_ATAPI_IREASON_CMD_OUT)) + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "ATAPI protocol error"); /* Write the packet. */ - grub_pata_pio_write (dev, parms->cmd, parms->cmdsize); + VasEBoot_pata_pio_write (dev, parms->cmd, parms->cmdsize); } /* Transfer data. */ while (nread < parms->size - && (sts & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) - == GRUB_ATA_STATUS_DRQ) + && (sts & (VasEBoot_ATA_STATUS_DRQ | VasEBoot_ATA_STATUS_ERR)) + == VasEBoot_ATA_STATUS_DRQ) { unsigned cnt; /* Wait for !BSY. */ - if (grub_pata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) - return grub_errno; + if (VasEBoot_pata_wait_not_busy (dev, VasEBoot_ATA_TOUT_DATA)) + return VasEBoot_errno; if (parms->cmdsize) { - if ((grub_pata_regget (dev, GRUB_ATAPI_REG_IREASON) - & GRUB_ATAPI_IREASON_MASK) != GRUB_ATAPI_IREASON_DATA_IN) - return grub_error (GRUB_ERR_READ_ERROR, "ATAPI protocol error"); + if ((VasEBoot_pata_regget (dev, VasEBoot_ATAPI_REG_IREASON) + & VasEBoot_ATAPI_IREASON_MASK) != VasEBoot_ATAPI_IREASON_DATA_IN) + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "ATAPI protocol error"); - cnt = grub_pata_regget (dev, GRUB_ATAPI_REG_CNTHIGH) << 8 - | grub_pata_regget (dev, GRUB_ATAPI_REG_CNTLOW); - grub_dprintf("pata", "DRQ count=%u\n", cnt); + cnt = VasEBoot_pata_regget (dev, VasEBoot_ATAPI_REG_CNTHIGH) << 8 + | VasEBoot_pata_regget (dev, VasEBoot_ATAPI_REG_CNTLOW); + VasEBoot_dprintf("pata", "DRQ count=%u\n", cnt); /* Count of last transfer may be uneven. */ if (! (0 < cnt && cnt <= parms->size - nread && (! (cnt & 1) || cnt == parms->size - nread))) - return grub_error (GRUB_ERR_READ_ERROR, + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "invalid ATAPI transfer count"); } else - cnt = GRUB_DISK_SECTOR_SIZE; + cnt = VasEBoot_DISK_SECTOR_SIZE; if (cnt > parms->size - nread) cnt = parms->size - nread; if (parms->write) - grub_pata_pio_write (dev, (char *) parms->buffer + nread, cnt); + VasEBoot_pata_pio_write (dev, (char *) parms->buffer + nread, cnt); else - grub_pata_pio_read (dev, (char *) parms->buffer + nread, cnt); + VasEBoot_pata_pio_read (dev, (char *) parms->buffer + nread, cnt); nread += cnt; } if (parms->write) { /* Check for write error. */ - if (grub_pata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) - return grub_errno; + if (VasEBoot_pata_wait_not_busy (dev, VasEBoot_ATA_TOUT_DATA)) + return VasEBoot_errno; - if (grub_pata_regget (dev, GRUB_ATA_REG_STATUS) - & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) - return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); + if (VasEBoot_pata_regget (dev, VasEBoot_ATA_REG_STATUS) + & (VasEBoot_ATA_STATUS_DRQ | VasEBoot_ATA_STATUS_ERR)) + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, "ATA write error"); } parms->size = nread; /* Wait for !BSY. */ - if (grub_pata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) - return grub_errno; + if (VasEBoot_pata_wait_not_busy (dev, VasEBoot_ATA_TOUT_DATA)) + return VasEBoot_errno; /* Return registers. */ - for (i = GRUB_ATA_REG_ERROR; i <= GRUB_ATA_REG_STATUS; i++) - parms->taskfile.raw[i - GRUB_ATA_REG_FEATURES] = grub_pata_regget (dev, i); + for (i = VasEBoot_ATA_REG_ERROR; i <= VasEBoot_ATA_REG_STATUS; i++) + parms->taskfile.raw[i - VasEBoot_ATA_REG_FEATURES] = VasEBoot_pata_regget (dev, i); - grub_dprintf ("pata", "status=0x%x, error=0x%x, sectors=0x%x\n", + VasEBoot_dprintf ("pata", "status=0x%x, error=0x%x, sectors=0x%x\n", parms->taskfile.status, parms->taskfile.error, parms->taskfile.sectors); if (parms->taskfile.status - & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) - return grub_error (GRUB_ERR_READ_ERROR, "PATA passthrough failed"); + & (VasEBoot_ATA_STATUS_DRQ | VasEBoot_ATA_STATUS_ERR)) + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "PATA passthrough failed"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -check_device (struct grub_pata_device *dev) +static VasEBoot_err_t +check_device (struct VasEBoot_pata_device *dev) { - grub_pata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); - grub_pata_wait (); + VasEBoot_pata_regset (dev, VasEBoot_ATA_REG_DISK, dev->device << 4); + VasEBoot_pata_wait (); /* Try to detect if the port is in use by writing to it, waiting for a while and reading it again. If the value was preserved, there is a device connected. */ - grub_pata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); - grub_pata_wait (); - grub_uint8_t sec = grub_pata_regget (dev, GRUB_ATA_REG_SECTORS); - grub_dprintf ("ata", "sectors=0x%x\n", sec); + VasEBoot_pata_regset (dev, VasEBoot_ATA_REG_SECTORS, 0x5A); + VasEBoot_pata_wait (); + VasEBoot_uint8_t sec = VasEBoot_pata_regget (dev, VasEBoot_ATA_REG_SECTORS); + VasEBoot_dprintf ("ata", "sectors=0x%x\n", sec); if (sec != 0x5A) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no device connected"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no device connected"); /* The above test may detect a second (slave) device connected to a SATA controller which supports only one @@ -302,52 +302,52 @@ check_device (struct grub_pata_device *dev) READY bit to check for controller channel existence. Some ATAPI commands (RESET, DIAGNOSTIC) may clear this bit. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_pata_device_initialize (int port, int device, int addr) +static VasEBoot_err_t +VasEBoot_pata_device_initialize (int port, int device, int addr) { - struct grub_pata_device *dev; - struct grub_pata_device **devp; - grub_err_t err; + struct VasEBoot_pata_device *dev; + struct VasEBoot_pata_device **devp; + VasEBoot_err_t err; - grub_dprintf ("pata", "detecting device %d,%d (0x%x)\n", + VasEBoot_dprintf ("pata", "detecting device %d,%d (0x%x)\n", port, device, addr); - dev = grub_malloc (sizeof(*dev)); + dev = VasEBoot_malloc (sizeof(*dev)); if (! dev) - return grub_errno; + return VasEBoot_errno; /* Setup the device information. */ dev->port = port; dev->device = device; - dev->ioaddress = addr + GRUB_MACHINE_PCI_IO_BASE; + dev->ioaddress = addr + VasEBoot_MACHINE_PCI_IO_BASE; dev->present = 1; dev->next = NULL; /* Register the device. */ - for (devp = &grub_pata_devices; *devp; devp = &(*devp)->next); + for (devp = &VasEBoot_pata_devices; *devp; devp = &(*devp)->next); *devp = dev; err = check_device (dev); if (err) - grub_print_error (); + VasEBoot_print_error (); return 0; } -#ifndef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifndef VasEBoot_MACHINE_MIPS_QEMU_MIPS static int -grub_pata_pciinit (grub_pci_device_t dev, - grub_pci_id_t pciid, +VasEBoot_pata_pciinit (VasEBoot_pci_device_t dev, + VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { static int compat_use[2] = { 0 }; - grub_pci_address_t addr; - grub_uint32_t class; - grub_uint32_t bar1; - grub_uint32_t bar2; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; + VasEBoot_uint32_t bar1; + VasEBoot_uint32_t bar2; int rega; int i; static int controller = 0; @@ -355,11 +355,11 @@ grub_pata_pciinit (grub_pci_device_t dev, int nports = 2; /* Read class. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); /* AMD CS5536 Southbridge. */ - if (pciid == GRUB_CS5536_PCIID) + if (pciid == VasEBoot_CS5536_PCIID) { cs5536 = 1; nports = 1; @@ -386,61 +386,61 @@ grub_pata_pciinit (grub_pci_device_t dev, default registers. */ if (compat == 0 && !compat_use[i]) { - rega = grub_pata_ioaddress[i]; + rega = VasEBoot_pata_ioaddress[i]; compat_use[i] = 1; } else if (compat) { /* Read the BARs, which either contain a mmapped IO address or the IO port address. */ - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESSES - + sizeof (grub_uint64_t) * i); - bar1 = grub_pci_read (addr); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESSES - + sizeof (grub_uint64_t) * i - + sizeof (grub_uint32_t)); - bar2 = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESSES + + sizeof (VasEBoot_uint64_t) * i); + bar1 = VasEBoot_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESSES + + sizeof (VasEBoot_uint64_t) * i + + sizeof (VasEBoot_uint32_t)); + bar2 = VasEBoot_pci_read (addr); /* Check if the BARs describe an IO region. */ if ((bar1 & 1) && (bar2 & 1) && (bar1 & ~3)) { rega = bar1 & ~3; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word (addr, grub_pci_read_word (addr) - | GRUB_PCI_COMMAND_IO_ENABLED - | GRUB_PCI_COMMAND_MEM_ENABLED - | GRUB_PCI_COMMAND_BUS_MASTER); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word (addr, VasEBoot_pci_read_word (addr) + | VasEBoot_PCI_COMMAND_IO_ENABLED + | VasEBoot_PCI_COMMAND_MEM_ENABLED + | VasEBoot_PCI_COMMAND_BUS_MASTER); } } - grub_dprintf ("pata", + VasEBoot_dprintf ("pata", "PCI dev (%d,%d,%d) compat=%d rega=0x%x\n", - grub_pci_get_bus (dev), grub_pci_get_device (dev), - grub_pci_get_function (dev), compat, rega); + VasEBoot_pci_get_bus (dev), VasEBoot_pci_get_device (dev), + VasEBoot_pci_get_function (dev), compat, rega); if (rega) { - grub_errno = GRUB_ERR_NONE; - grub_pata_device_initialize (controller * 2 + i, 0, rega); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_pata_device_initialize (controller * 2 + i, 0, rega); - /* Most errors raised by grub_ata_device_initialize() are harmless. + /* Most errors raised by VasEBoot_ata_device_initialize() are harmless. They just indicate this particular drive is not responding, most likely because it doesn't exist. We might want to ignore specific error types here, instead of printing them. */ - if (grub_errno) + if (VasEBoot_errno) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_pata_device_initialize (controller * 2 + i, 1, rega); + VasEBoot_pata_device_initialize (controller * 2 + i, 1, rega); /* Likewise. */ - if (grub_errno) + if (VasEBoot_errno) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } } } @@ -450,37 +450,37 @@ grub_pata_pciinit (grub_pci_device_t dev, return 0; } -static grub_err_t -grub_pata_initialize (void) +static VasEBoot_err_t +VasEBoot_pata_initialize (void) { - grub_pci_iterate (grub_pata_pciinit, NULL); + VasEBoot_pci_iterate (VasEBoot_pata_pciinit, NULL); return 0; } #else -static grub_err_t -grub_pata_initialize (void) +static VasEBoot_err_t +VasEBoot_pata_initialize (void) { int i; for (i = 0; i < 2; i++) { - grub_pata_device_initialize (i, 0, grub_pata_ioaddress[i]); - grub_pata_device_initialize (i, 1, grub_pata_ioaddress[i]); + VasEBoot_pata_device_initialize (i, 0, VasEBoot_pata_ioaddress[i]); + VasEBoot_pata_device_initialize (i, 1, VasEBoot_pata_ioaddress[i]); } return 0; } #endif -static grub_err_t -grub_pata_open (int id, int devnum, struct grub_ata *ata) +static VasEBoot_err_t +VasEBoot_pata_open (int id, int devnum, struct VasEBoot_ata *ata) { - struct grub_pata_device *dev; - struct grub_pata_device *devfnd = 0; - grub_err_t err; + struct VasEBoot_pata_device *dev; + struct VasEBoot_pata_device *devfnd = 0; + VasEBoot_err_t err; - if (id != GRUB_SCSI_SUBSYSTEM_PATA) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a PATA device"); + if (id != VasEBoot_SCSI_SUBSYSTEM_PATA) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a PATA device"); - for (dev = grub_pata_devices; dev; dev = dev->next) + for (dev = VasEBoot_pata_devices; dev; dev = dev->next) { if (dev->port * 2 + dev->device == devnum) { @@ -489,10 +489,10 @@ grub_pata_open (int id, int devnum, struct grub_ata *ata) } } - grub_dprintf ("pata", "opening PATA dev `ata%d'\n", devnum); + VasEBoot_dprintf ("pata", "opening PATA dev `ata%d'\n", devnum); if (! devfnd) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such PATA device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such PATA device"); err = check_device (devfnd); if (err) @@ -503,20 +503,20 @@ grub_pata_open (int id, int devnum, struct grub_ata *ata) ata->maxbuffer = 256 * 512; ata->present = &devfnd->present; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -grub_pata_iterate (grub_ata_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_pata_iterate (VasEBoot_ata_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_pata_device *dev; + struct VasEBoot_pata_device *dev; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; - for (dev = grub_pata_devices; dev; dev = dev->next) - if (hook (GRUB_SCSI_SUBSYSTEM_PATA, dev->port * 2 + dev->device, + for (dev = VasEBoot_pata_devices; dev; dev = dev->next) + if (hook (VasEBoot_SCSI_SUBSYSTEM_PATA, dev->port * 2 + dev->device, hook_data)) return 1; @@ -524,27 +524,27 @@ grub_pata_iterate (grub_ata_dev_iterate_hook_t hook, void *hook_data, } -static struct grub_ata_dev grub_pata_dev = +static struct VasEBoot_ata_dev VasEBoot_pata_dev = { - .iterate = grub_pata_iterate, - .open = grub_pata_open, - .readwrite = grub_pata_readwrite, + .iterate = VasEBoot_pata_iterate, + .open = VasEBoot_pata_open, + .readwrite = VasEBoot_pata_readwrite, }; -GRUB_MOD_INIT(ata_pthru) +VasEBoot_MOD_INIT(ata_pthru) { - grub_stop_disk_firmware (); + VasEBoot_stop_disk_firmware (); /* ATA initialization. */ - grub_pata_initialize (); + VasEBoot_pata_initialize (); - grub_ata_dev_register (&grub_pata_dev); + VasEBoot_ata_dev_register (&VasEBoot_pata_dev); } -GRUB_MOD_FINI(ata_pthru) +VasEBoot_MOD_FINI(ata_pthru) { - grub_ata_dev_unregister (&grub_pata_dev); + VasEBoot_ata_dev_unregister (&VasEBoot_pata_dev); } diff --git a/VasEBoot-core/disk/raid5_recover.c b/VasEBoot-core/disk/raid5_recover.c index 4ace9172e..0fabccbf4 100644 --- a/VasEBoot-core/disk/raid5_recover.c +++ b/VasEBoot-core/disk/raid5_recover.c @@ -1,76 +1,76 @@ /* raid5_recover.c - module to recover from faulty RAID4/5 arrays. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_raid5_recover (struct grub_diskfilter_segment *array, int disknr, - char *buf, grub_disk_addr_t sector, grub_size_t size) +static VasEBoot_err_t +VasEBoot_raid5_recover (struct VasEBoot_diskfilter_segment *array, int disknr, + char *buf, VasEBoot_disk_addr_t sector, VasEBoot_size_t size) { char *buf2; int i; - size <<= GRUB_DISK_SECTOR_BITS; - buf2 = grub_malloc (size); + size <<= VasEBoot_DISK_SECTOR_BITS; + buf2 = VasEBoot_malloc (size); if (!buf2) - return grub_errno; + return VasEBoot_errno; - grub_memset (buf, 0, size); + VasEBoot_memset (buf, 0, size); for (i = 0; i < (int) array->node_count; i++) { - grub_err_t err; + VasEBoot_err_t err; if (i == disknr) continue; - err = grub_diskfilter_read_node (&array->nodes[i], sector, - size >> GRUB_DISK_SECTOR_BITS, buf2); + err = VasEBoot_diskfilter_read_node (&array->nodes[i], sector, + size >> VasEBoot_DISK_SECTOR_BITS, buf2); if (err) { - grub_free (buf2); + VasEBoot_free (buf2); return err; } - grub_crypto_xor (buf, buf, buf2, size); + VasEBoot_crypto_xor (buf, buf, buf2, size); } - grub_free (buf2); + VasEBoot_free (buf2); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -GRUB_MOD_INIT(raid5rec) +VasEBoot_MOD_INIT(raid5rec) { - grub_raid5_recover_func = grub_raid5_recover; + VasEBoot_raid5_recover_func = VasEBoot_raid5_recover; } -GRUB_MOD_FINI(raid5rec) +VasEBoot_MOD_FINI(raid5rec) { - grub_raid5_recover_func = 0; + VasEBoot_raid5_recover_func = 0; } diff --git a/VasEBoot-core/disk/raid6_recover.c b/VasEBoot-core/disk/raid6_recover.c index aa674f6ca..dace1f09f 100644 --- a/VasEBoot-core/disk/raid6_recover.c +++ b/VasEBoot-core/disk/raid6_recover.c @@ -1,56 +1,56 @@ /* raid6_recover.c - module to recover from faulty RAID6 arrays. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* x**y. */ -static grub_uint8_t powx[255 * 2]; +static VasEBoot_uint8_t powx[255 * 2]; /* Such an s that x**s = y */ static unsigned powx_inv[256]; -static const grub_uint8_t poly = 0x1d; +static const VasEBoot_uint8_t poly = 0x1d; static void -grub_raid_block_mulx (unsigned mul, char *buf, grub_size_t size) +VasEBoot_raid_block_mulx (unsigned mul, char *buf, VasEBoot_size_t size) { - grub_size_t i; - grub_uint8_t *p; + VasEBoot_size_t i; + VasEBoot_uint8_t *p; - p = (grub_uint8_t *) buf; + p = (VasEBoot_uint8_t *) buf; for (i = 0; i < size; i++, p++) if (*p) *p = powx[mul + powx_inv[*p]]; } static void -grub_raid6_init_table (void) +VasEBoot_raid6_init_table (void) { unsigned i; - grub_uint8_t cur = 1; + VasEBoot_uint8_t cur = 1; for (i = 0; i < 255; i++) { powx[i] = cur; @@ -73,20 +73,20 @@ mod_255 (unsigned x) return x; } -static grub_err_t -grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, - char *buf, grub_disk_addr_t sector, grub_size_t size) +static VasEBoot_err_t +VasEBoot_raid6_recover (struct VasEBoot_diskfilter_segment *array, int disknr, int p, + char *buf, VasEBoot_disk_addr_t sector, VasEBoot_size_t size) { int i, q, pos; int bad1 = -1, bad2 = -1; char *pbuf = 0, *qbuf = 0; - size <<= GRUB_DISK_SECTOR_BITS; - pbuf = grub_zalloc (size); + size <<= VasEBoot_DISK_SECTOR_BITS; + pbuf = VasEBoot_zalloc (size); if (!pbuf) goto quit; - qbuf = grub_zalloc (size); + qbuf = VasEBoot_zalloc (size); if (!qbuf) goto quit; @@ -101,7 +101,7 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, for (i = 0; i < (int) array->node_count - 2; i++) { int c; - if (array->layout & GRUB_RAID_LAYOUT_MUL_FROM_POS) + if (array->layout & VasEBoot_RAID_LAYOUT_MUL_FROM_POS) c = pos; else c = i; @@ -109,12 +109,12 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, bad1 = c; else { - if (! grub_diskfilter_read_node (&array->nodes[pos], sector, - size >> GRUB_DISK_SECTOR_BITS, buf)) + if (! VasEBoot_diskfilter_read_node (&array->nodes[pos], sector, + size >> VasEBoot_DISK_SECTOR_BITS, buf)) { - grub_crypto_xor (pbuf, pbuf, buf, size); - grub_raid_block_mulx (c, buf, size); - grub_crypto_xor (qbuf, qbuf, buf, size); + VasEBoot_crypto_xor (pbuf, pbuf, buf, size); + VasEBoot_raid_block_mulx (c, buf, size); + VasEBoot_crypto_xor (qbuf, qbuf, buf, size); } else { @@ -123,7 +123,7 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, goto quit; bad2 = c; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } } @@ -139,20 +139,20 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, if (bad2 < 0) { /* One bad device */ - if ((! grub_diskfilter_read_node (&array->nodes[p], sector, - size >> GRUB_DISK_SECTOR_BITS, buf))) + if ((! VasEBoot_diskfilter_read_node (&array->nodes[p], sector, + size >> VasEBoot_DISK_SECTOR_BITS, buf))) { - grub_crypto_xor (buf, buf, pbuf, size); + VasEBoot_crypto_xor (buf, buf, pbuf, size); goto quit; } - grub_errno = GRUB_ERR_NONE; - if (grub_diskfilter_read_node (&array->nodes[q], sector, - size >> GRUB_DISK_SECTOR_BITS, buf)) + VasEBoot_errno = VasEBoot_ERR_NONE; + if (VasEBoot_diskfilter_read_node (&array->nodes[q], sector, + size >> VasEBoot_DISK_SECTOR_BITS, buf)) goto quit; - grub_crypto_xor (buf, buf, qbuf, size); - grub_raid_block_mulx (255 - bad1, buf, + VasEBoot_crypto_xor (buf, buf, qbuf, size); + VasEBoot_raid_block_mulx (255 - bad1, buf, size); } else @@ -160,43 +160,43 @@ grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p, /* Two bad devices */ unsigned c; - if (grub_diskfilter_read_node (&array->nodes[p], sector, - size >> GRUB_DISK_SECTOR_BITS, buf)) + if (VasEBoot_diskfilter_read_node (&array->nodes[p], sector, + size >> VasEBoot_DISK_SECTOR_BITS, buf)) goto quit; - grub_crypto_xor (pbuf, pbuf, buf, size); + VasEBoot_crypto_xor (pbuf, pbuf, buf, size); - if (grub_diskfilter_read_node (&array->nodes[q], sector, - size >> GRUB_DISK_SECTOR_BITS, buf)) + if (VasEBoot_diskfilter_read_node (&array->nodes[q], sector, + size >> VasEBoot_DISK_SECTOR_BITS, buf)) goto quit; - grub_crypto_xor (qbuf, qbuf, buf, size); + VasEBoot_crypto_xor (qbuf, qbuf, buf, size); c = mod_255((255 ^ bad1) + (255 ^ powx_inv[(powx[bad2 + (bad1 ^ 255)] ^ 1)])); - grub_raid_block_mulx (c, qbuf, size); + VasEBoot_raid_block_mulx (c, qbuf, size); c = mod_255((unsigned) bad2 + c); - grub_raid_block_mulx (c, pbuf, size); + VasEBoot_raid_block_mulx (c, pbuf, size); - grub_crypto_xor (pbuf, pbuf, qbuf, size); - grub_memcpy (buf, pbuf, size); + VasEBoot_crypto_xor (pbuf, pbuf, qbuf, size); + VasEBoot_memcpy (buf, pbuf, size); } quit: - grub_free (pbuf); - grub_free (qbuf); + VasEBoot_free (pbuf); + VasEBoot_free (qbuf); - return grub_errno; + return VasEBoot_errno; } -GRUB_MOD_INIT(raid6rec) +VasEBoot_MOD_INIT(raid6rec) { - grub_raid6_init_table (); - grub_raid6_recover_func = grub_raid6_recover; + VasEBoot_raid6_init_table (); + VasEBoot_raid6_recover_func = VasEBoot_raid6_recover; } -GRUB_MOD_FINI(raid6rec) +VasEBoot_MOD_FINI(raid6rec) { - grub_raid6_recover_func = 0; + VasEBoot_raid6_recover_func = 0; } diff --git a/VasEBoot-core/disk/scsi.c b/VasEBoot-core/disk/scsi.c index 4c6923f8b..55118c398 100644 --- a/VasEBoot-core/disk/scsi.c +++ b/VasEBoot-core/disk/scsi.c @@ -1,57 +1,57 @@ /* scsi.c - scsi support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_scsi_dev_t grub_scsi_dev_list; +static VasEBoot_scsi_dev_t VasEBoot_scsi_dev_list; -const char grub_scsi_names[GRUB_SCSI_NUM_SUBSYSTEMS][5] = { - [GRUB_SCSI_SUBSYSTEM_USBMS] = "usb", - [GRUB_SCSI_SUBSYSTEM_PATA] = "ata", - [GRUB_SCSI_SUBSYSTEM_AHCI] = "ahci" +const char VasEBoot_scsi_names[VasEBoot_SCSI_NUM_SUBSYSTEMS][5] = { + [VasEBoot_SCSI_SUBSYSTEM_USBMS] = "usb", + [VasEBoot_SCSI_SUBSYSTEM_PATA] = "ata", + [VasEBoot_SCSI_SUBSYSTEM_AHCI] = "ahci" }; void -grub_scsi_dev_register (grub_scsi_dev_t dev) +VasEBoot_scsi_dev_register (VasEBoot_scsi_dev_t dev) { - dev->next = grub_scsi_dev_list; - grub_scsi_dev_list = dev; + dev->next = VasEBoot_scsi_dev_list; + VasEBoot_scsi_dev_list = dev; } void -grub_scsi_dev_unregister (grub_scsi_dev_t dev) +VasEBoot_scsi_dev_unregister (VasEBoot_scsi_dev_t dev) { - grub_scsi_dev_t *p, q; + VasEBoot_scsi_dev_t *p, q; - for (p = &grub_scsi_dev_list, q = *p; q; p = &(q->next), q = q->next) + for (p = &VasEBoot_scsi_dev_list, q = *p; q; p = &(q->next), q = q->next) if (q == dev) { *p = q->next; @@ -61,108 +61,108 @@ grub_scsi_dev_unregister (grub_scsi_dev_t dev) /* Check result of previous operation. */ -static grub_err_t -grub_scsi_request_sense (grub_scsi_t scsi) +static VasEBoot_err_t +VasEBoot_scsi_request_sense (VasEBoot_scsi_t scsi) { - struct grub_scsi_request_sense rs; - struct grub_scsi_request_sense_data rsd; - grub_err_t err; + struct VasEBoot_scsi_request_sense rs; + struct VasEBoot_scsi_request_sense_data rsd; + VasEBoot_err_t err; - rs.opcode = grub_scsi_cmd_request_sense; - rs.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + rs.opcode = VasEBoot_scsi_cmd_request_sense; + rs.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; rs.reserved1 = 0; rs.reserved2 = 0; rs.alloc_length = 0x12; /* XXX: Hardcoded for now */ rs.control = 0; - grub_memset (rs.pad, 0, sizeof(rs.pad)); + VasEBoot_memset (rs.pad, 0, sizeof(rs.pad)); err = scsi->dev->read (scsi, sizeof (rs), (char *) &rs, sizeof (rsd), (char *) &rsd); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Self commenting... */ -static grub_err_t -grub_scsi_test_unit_ready (grub_scsi_t scsi) +static VasEBoot_err_t +VasEBoot_scsi_test_unit_ready (VasEBoot_scsi_t scsi) { - struct grub_scsi_test_unit_ready tur; - grub_err_t err; - grub_err_t err_sense; + struct VasEBoot_scsi_test_unit_ready tur; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; - tur.opcode = grub_scsi_cmd_test_unit_ready; - tur.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + tur.opcode = VasEBoot_scsi_cmd_test_unit_ready; + tur.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; tur.reserved1 = 0; tur.reserved2 = 0; tur.reserved3 = 0; tur.control = 0; - grub_memset (tur.pad, 0, sizeof(tur.pad)); + VasEBoot_memset (tur.pad, 0, sizeof(tur.pad)); err = scsi->dev->read (scsi, sizeof (tur), (char *) &tur, 0, NULL); /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Determine if the device is removable and the type of the device SCSI. */ -static grub_err_t -grub_scsi_inquiry (grub_scsi_t scsi) +static VasEBoot_err_t +VasEBoot_scsi_inquiry (VasEBoot_scsi_t scsi) { - struct grub_scsi_inquiry iq; - struct grub_scsi_inquiry_data iqd; - grub_err_t err; - grub_err_t err_sense; + struct VasEBoot_scsi_inquiry iq; + struct VasEBoot_scsi_inquiry_data iqd; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; - iq.opcode = grub_scsi_cmd_inquiry; - iq.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + iq.opcode = VasEBoot_scsi_cmd_inquiry; + iq.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; iq.page = 0; iq.reserved = 0; iq.alloc_length = 0x24; /* XXX: Hardcoded for now */ iq.control = 0; - grub_memset (iq.pad, 0, sizeof(iq.pad)); + VasEBoot_memset (iq.pad, 0, sizeof(iq.pad)); err = scsi->dev->read (scsi, sizeof (iq), (char *) &iq, sizeof (iqd), (char *) &iqd); /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ if (err) return err; - scsi->devtype = iqd.devtype & GRUB_SCSI_DEVTYPE_MASK; - scsi->removable = iqd.rmb >> GRUB_SCSI_REMOVABLE_BIT; + scsi->devtype = iqd.devtype & VasEBoot_SCSI_DEVTYPE_MASK; + scsi->removable = iqd.rmb >> VasEBoot_SCSI_REMOVABLE_BIT; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read the capacity and block size of SCSI. */ -static grub_err_t -grub_scsi_read_capacity10 (grub_scsi_t scsi) +static VasEBoot_err_t +VasEBoot_scsi_read_capacity10 (VasEBoot_scsi_t scsi) { - struct grub_scsi_read_capacity10 rc; - struct grub_scsi_read_capacity10_data rcd; - grub_err_t err; - grub_err_t err_sense; + struct VasEBoot_scsi_read_capacity10 rc; + struct VasEBoot_scsi_read_capacity10_data rcd; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; - rc.opcode = grub_scsi_cmd_read_capacity10; - rc.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + rc.opcode = VasEBoot_scsi_cmd_read_capacity10; + rc.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; rc.logical_block_addr = 0; rc.reserved1 = 0; rc.reserved2 = 0; @@ -175,33 +175,33 @@ grub_scsi_read_capacity10 (grub_scsi_t scsi) /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ if (err) return err; - scsi->last_block = grub_be_to_cpu32 (rcd.last_block); - scsi->blocksize = grub_be_to_cpu32 (rcd.blocksize); + scsi->last_block = VasEBoot_be_to_cpu32 (rcd.last_block); + scsi->blocksize = VasEBoot_be_to_cpu32 (rcd.blocksize); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read the capacity and block size of SCSI. */ -static grub_err_t -grub_scsi_read_capacity16 (grub_scsi_t scsi) +static VasEBoot_err_t +VasEBoot_scsi_read_capacity16 (VasEBoot_scsi_t scsi) { - struct grub_scsi_read_capacity16 rc; - struct grub_scsi_read_capacity16_data rcd; - grub_err_t err; - grub_err_t err_sense; + struct VasEBoot_scsi_read_capacity16 rc; + struct VasEBoot_scsi_read_capacity16_data rcd; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; - rc.opcode = grub_scsi_cmd_read_capacity16; - rc.lun = (scsi->lun << GRUB_SCSI_LUN_SHIFT) | 0x10; + rc.opcode = VasEBoot_scsi_cmd_read_capacity16; + rc.lun = (scsi->lun << VasEBoot_SCSI_LUN_SHIFT) | 0x10; rc.logical_block_addr = 0; - rc.alloc_len = grub_cpu_to_be32_compile_time (sizeof (rcd)); + rc.alloc_len = VasEBoot_cpu_to_be32_compile_time (sizeof (rcd)); rc.PMI = 0; rc.control = 0; @@ -210,38 +210,38 @@ grub_scsi_read_capacity16 (grub_scsi_t scsi) /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ if (err) return err; - scsi->last_block = grub_be_to_cpu64 (rcd.last_block); - scsi->blocksize = grub_be_to_cpu32 (rcd.blocksize); + scsi->last_block = VasEBoot_be_to_cpu64 (rcd.last_block); + scsi->blocksize = VasEBoot_be_to_cpu32 (rcd.blocksize); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Send a SCSI request for DISK: read SIZE sectors starting with sector SECTOR to BUF. */ -static grub_err_t -grub_scsi_read10 (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_scsi_read10 (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_scsi_t scsi; - struct grub_scsi_read10 rd; - grub_err_t err; - grub_err_t err_sense; + VasEBoot_scsi_t scsi; + struct VasEBoot_scsi_read10 rd; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; scsi = disk->data; - rd.opcode = grub_scsi_cmd_read10; - rd.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; - rd.lba = grub_cpu_to_be32 (sector); + rd.opcode = VasEBoot_scsi_cmd_read10; + rd.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; + rd.lba = VasEBoot_cpu_to_be32 (sector); rd.reserved = 0; - rd.size = grub_cpu_to_be16 (size); + rd.size = VasEBoot_cpu_to_be16 (size); rd.reserved2 = 0; rd.pad = 0; @@ -249,9 +249,9 @@ grub_scsi_read10 (grub_disk_t disk, grub_disk_addr_t sector, /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ return err; @@ -259,21 +259,21 @@ grub_scsi_read10 (grub_disk_t disk, grub_disk_addr_t sector, /* Send a SCSI request for DISK: read SIZE sectors starting with sector SECTOR to BUF. */ -static grub_err_t -grub_scsi_read12 (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_scsi_read12 (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_scsi_t scsi; - struct grub_scsi_read12 rd; - grub_err_t err; - grub_err_t err_sense; + VasEBoot_scsi_t scsi; + struct VasEBoot_scsi_read12 rd; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; scsi = disk->data; - rd.opcode = grub_scsi_cmd_read12; - rd.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; - rd.lba = grub_cpu_to_be32 (sector); - rd.size = grub_cpu_to_be32 (size); + rd.opcode = VasEBoot_scsi_cmd_read12; + rd.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; + rd.lba = VasEBoot_cpu_to_be32 (sector); + rd.size = VasEBoot_cpu_to_be32 (size); rd.reserved = 0; rd.control = 0; @@ -281,9 +281,9 @@ grub_scsi_read12 (grub_disk_t disk, grub_disk_addr_t sector, /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ return err; @@ -291,21 +291,21 @@ grub_scsi_read12 (grub_disk_t disk, grub_disk_addr_t sector, /* Send a SCSI request for DISK: read SIZE sectors starting with sector SECTOR to BUF. */ -static grub_err_t -grub_scsi_read16 (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_scsi_read16 (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_scsi_t scsi; - struct grub_scsi_read16 rd; - grub_err_t err; - grub_err_t err_sense; + VasEBoot_scsi_t scsi; + struct VasEBoot_scsi_read16 rd; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; scsi = disk->data; - rd.opcode = grub_scsi_cmd_read16; - rd.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; - rd.lba = grub_cpu_to_be64 (sector); - rd.size = grub_cpu_to_be32 (size); + rd.opcode = VasEBoot_scsi_cmd_read16; + rd.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; + rd.lba = VasEBoot_cpu_to_be64 (sector); + rd.size = VasEBoot_cpu_to_be32 (size); rd.reserved = 0; rd.control = 0; @@ -313,9 +313,9 @@ grub_scsi_read16 (grub_disk_t disk, grub_disk_addr_t sector, /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ return err; @@ -323,22 +323,22 @@ grub_scsi_read16 (grub_disk_t disk, grub_disk_addr_t sector, /* Send a SCSI request for DISK: write the data stored in BUF to SIZE sectors starting with SECTOR. */ -static grub_err_t -grub_scsi_write10 (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_scsi_write10 (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_scsi_t scsi; - struct grub_scsi_write10 wr; - grub_err_t err; - grub_err_t err_sense; + VasEBoot_scsi_t scsi; + struct VasEBoot_scsi_write10 wr; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; scsi = disk->data; - wr.opcode = grub_scsi_cmd_write10; - wr.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; - wr.lba = grub_cpu_to_be32 (sector); + wr.opcode = VasEBoot_scsi_cmd_write10; + wr.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; + wr.lba = VasEBoot_cpu_to_be32 (sector); wr.reserved = 0; - wr.size = grub_cpu_to_be16 (size); + wr.size = VasEBoot_cpu_to_be16 (size); wr.reserved2 = 0; wr.pad = 0; @@ -346,9 +346,9 @@ grub_scsi_write10 (grub_disk_t disk, grub_disk_addr_t sector, /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ return err; @@ -358,21 +358,21 @@ grub_scsi_write10 (grub_disk_t disk, grub_disk_addr_t sector, /* Send a SCSI request for DISK: write the data stored in BUF to SIZE sectors starting with SECTOR. */ -static grub_err_t -grub_scsi_write12 (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_scsi_write12 (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_scsi_t scsi; - struct grub_scsi_write12 wr; - grub_err_t err; - grub_err_t err_sense; + VasEBoot_scsi_t scsi; + struct VasEBoot_scsi_write12 wr; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; scsi = disk->data; - wr.opcode = grub_scsi_cmd_write12; - wr.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; - wr.lba = grub_cpu_to_be32 (sector); - wr.size = grub_cpu_to_be32 (size); + wr.opcode = VasEBoot_scsi_cmd_write12; + wr.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; + wr.lba = VasEBoot_cpu_to_be32 (sector); + wr.size = VasEBoot_cpu_to_be32 (size); wr.reserved = 0; wr.control = 0; @@ -380,9 +380,9 @@ grub_scsi_write12 (grub_disk_t disk, grub_disk_addr_t sector, /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ return err; @@ -391,21 +391,21 @@ grub_scsi_write12 (grub_disk_t disk, grub_disk_addr_t sector, /* Send a SCSI request for DISK: write the data stored in BUF to SIZE sectors starting with SECTOR. */ -static grub_err_t -grub_scsi_write16 (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_scsi_write16 (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_scsi_t scsi; - struct grub_scsi_write16 wr; - grub_err_t err; - grub_err_t err_sense; + VasEBoot_scsi_t scsi; + struct VasEBoot_scsi_write16 wr; + VasEBoot_err_t err; + VasEBoot_err_t err_sense; scsi = disk->data; - wr.opcode = grub_scsi_cmd_write16; - wr.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; - wr.lba = grub_cpu_to_be64 (sector); - wr.size = grub_cpu_to_be32 (size); + wr.opcode = VasEBoot_scsi_cmd_write16; + wr.lun = scsi->lun << VasEBoot_SCSI_LUN_SHIFT; + wr.lba = VasEBoot_cpu_to_be64 (sector); + wr.size = VasEBoot_cpu_to_be32 (size); wr.reserved = 0; wr.control = 0; @@ -413,9 +413,9 @@ grub_scsi_write16 (grub_disk_t disk, grub_disk_addr_t sector, /* Each SCSI command should be followed by Request Sense. If not so, many devices STALLs or definitely freezes. */ - err_sense = grub_scsi_request_sense (scsi); - if (err_sense != GRUB_ERR_NONE) - grub_errno = err; + err_sense = VasEBoot_scsi_request_sense (scsi); + if (err_sense != VasEBoot_ERR_NONE) + VasEBoot_errno = err; /* err_sense is ignored for now and Request Sense Data also... */ return err; @@ -423,18 +423,18 @@ grub_scsi_write16 (grub_disk_t disk, grub_disk_addr_t sector, -/* Context for grub_scsi_iterate. */ -struct grub_scsi_iterate_ctx +/* Context for VasEBoot_scsi_iterate. */ +struct VasEBoot_scsi_iterate_ctx { - grub_disk_dev_iterate_hook_t hook; + VasEBoot_disk_dev_iterate_hook_t hook; void *hook_data; }; -/* Helper for grub_scsi_iterate. */ +/* Helper for VasEBoot_scsi_iterate. */ static int scsi_iterate (int id, int bus, int luns, void *data) { - struct grub_scsi_iterate_ctx *ctx = data; + struct VasEBoot_scsi_iterate_ctx *ctx = data; int i; /* In case of a single LUN, just return `usbX'. */ @@ -442,11 +442,11 @@ scsi_iterate (int id, int bus, int luns, void *data) { char *sname; int ret; - sname = grub_xasprintf ("%s%d", grub_scsi_names[id], bus); + sname = VasEBoot_xasprintf ("%s%d", VasEBoot_scsi_names[id], bus); if (!sname) return 1; ret = ctx->hook (sname, ctx->hook_data); - grub_free (sname); + VasEBoot_free (sname); return ret; } @@ -456,11 +456,11 @@ scsi_iterate (int id, int bus, int luns, void *data) { char *sname; int ret; - sname = grub_xasprintf ("%s%d%c", grub_scsi_names[id], bus, 'a' + i); + sname = VasEBoot_xasprintf ("%s%d%c", VasEBoot_scsi_names[id], bus, 'a' + i); if (!sname) return 1; ret = ctx->hook (sname, ctx->hook_data); - grub_free (sname); + VasEBoot_free (sname); if (ret) return 1; } @@ -468,31 +468,31 @@ scsi_iterate (int id, int bus, int luns, void *data) } static int -grub_scsi_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_scsi_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - struct grub_scsi_iterate_ctx ctx = { hook, hook_data }; - grub_scsi_dev_t p; + struct VasEBoot_scsi_iterate_ctx ctx = { hook, hook_data }; + VasEBoot_scsi_dev_t p; - for (p = grub_scsi_dev_list; p; p = p->next) + for (p = VasEBoot_scsi_dev_list; p; p = p->next) if (p->iterate && (p->iterate) (scsi_iterate, &ctx, pull)) return 1; return 0; } -static grub_err_t -grub_scsi_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_scsi_open (const char *name, VasEBoot_disk_t disk) { - grub_scsi_dev_t p; - grub_scsi_t scsi; - grub_err_t err; + VasEBoot_scsi_dev_t p; + VasEBoot_scsi_t scsi; + VasEBoot_err_t err; int lun, bus; - grub_uint64_t maxtime; + VasEBoot_uint64_t maxtime; const char *nameend; unsigned id; - nameend = name + grub_strlen (name) - 1; + nameend = name + VasEBoot_strlen (name) - 1; /* Try to detect a LUN ('a'-'z'), otherwise just use the first LUN. */ if (nameend >= name && *nameend >= 'a' && *nameend <= 'z') @@ -503,104 +503,104 @@ grub_scsi_open (const char *name, grub_disk_t disk) else lun = 0; - while (nameend >= name && grub_isdigit (*nameend)) + while (nameend >= name && VasEBoot_isdigit (*nameend)) nameend--; - if (!nameend[1] || !grub_isdigit (nameend[1])) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); + if (!nameend[1] || !VasEBoot_isdigit (nameend[1])) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); - bus = grub_strtoul (nameend + 1, 0, 0); + bus = VasEBoot_strtoul (nameend + 1, 0, 0); - scsi = grub_malloc (sizeof (*scsi)); + scsi = VasEBoot_malloc (sizeof (*scsi)); if (! scsi) - return grub_errno; + return VasEBoot_errno; - for (id = 0; id < ARRAY_SIZE (grub_scsi_names); id++) - if (grub_strncmp (grub_scsi_names[id], name, nameend - name) == 0) + for (id = 0; id < ARRAY_SIZE (VasEBoot_scsi_names); id++) + if (VasEBoot_strncmp (VasEBoot_scsi_names[id], name, nameend - name) == 0) break; - if (id == ARRAY_SIZE (grub_scsi_names)) + if (id == ARRAY_SIZE (VasEBoot_scsi_names)) { - grub_free (scsi); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); + VasEBoot_free (scsi); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); } - for (p = grub_scsi_dev_list; p; p = p->next) + for (p = VasEBoot_scsi_dev_list; p; p = p->next) { if (p->open (id, bus, scsi)) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - disk->id = grub_make_scsi_id (id, bus, lun); + disk->id = VasEBoot_make_scsi_id (id, bus, lun); disk->data = scsi; scsi->dev = p; scsi->lun = lun; scsi->bus = bus; - grub_dprintf ("scsi", "dev opened\n"); + VasEBoot_dprintf ("scsi", "dev opened\n"); - err = grub_scsi_inquiry (scsi); + err = VasEBoot_scsi_inquiry (scsi); if (err) { - grub_free (scsi); - grub_dprintf ("scsi", "inquiry failed\n"); + VasEBoot_free (scsi); + VasEBoot_dprintf ("scsi", "inquiry failed\n"); return err; } - grub_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", + VasEBoot_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", scsi->devtype, scsi->removable); /* Try to be conservative about the device types supported. */ - if (scsi->devtype != grub_scsi_devtype_direct - && scsi->devtype != grub_scsi_devtype_cdrom) + if (scsi->devtype != VasEBoot_scsi_devtype_direct + && scsi->devtype != VasEBoot_scsi_devtype_cdrom) { - grub_free (scsi); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + VasEBoot_free (scsi); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown SCSI device"); } /* According to USB MS tests specification, issue Test Unit Ready * until OK */ - maxtime = grub_get_time_ms () + 5000; /* It is safer value */ + maxtime = VasEBoot_get_time_ms () + 5000; /* It is safer value */ do { /* Timeout is necessary - for example in case when we have * universal card reader with more LUNs and we have only * one card inserted (or none), so only one LUN (or none) * will be ready - and we want not to hang... */ - if (grub_get_time_ms () > maxtime) + if (VasEBoot_get_time_ms () > maxtime) { - err = GRUB_ERR_READ_ERROR; - grub_free (scsi); - grub_dprintf ("scsi", "LUN is not ready - timeout\n"); + err = VasEBoot_ERR_READ_ERROR; + VasEBoot_free (scsi); + VasEBoot_dprintf ("scsi", "LUN is not ready - timeout\n"); return err; } - err = grub_scsi_test_unit_ready (scsi); + err = VasEBoot_scsi_test_unit_ready (scsi); } - while (err == GRUB_ERR_READ_ERROR); - /* Reset grub_errno ! + while (err == VasEBoot_ERR_READ_ERROR); + /* Reset VasEBoot_errno ! * It is set to some error code in loop before... */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* Read capacity of media */ - err = grub_scsi_read_capacity10 (scsi); + err = VasEBoot_scsi_read_capacity10 (scsi); if (err) { - grub_free (scsi); - grub_dprintf ("scsi", "READ CAPACITY10 failed\n"); + VasEBoot_free (scsi); + VasEBoot_dprintf ("scsi", "READ CAPACITY10 failed\n"); return err; } if (scsi->last_block == 0xffffffff) { - err = grub_scsi_read_capacity16 (scsi); + err = VasEBoot_scsi_read_capacity16 (scsi); if (err) { - grub_free (scsi); - grub_dprintf ("scsi", "READ CAPACITY16 failed\n"); + VasEBoot_free (scsi); + VasEBoot_dprintf ("scsi", "READ CAPACITY16 failed\n"); return err; } } @@ -610,97 +610,97 @@ grub_scsi_open (const char *name, grub_disk_t disk) Not sure about AHCI and USB. If it's confirmed that either of them can do bigger reads reliably this value can be moved to 'scsi' structure. */ - disk->max_agglomerate = 32768 >> (GRUB_DISK_SECTOR_BITS - + GRUB_DISK_CACHE_BITS); + disk->max_agglomerate = 32768 >> (VasEBoot_DISK_SECTOR_BITS + + VasEBoot_DISK_CACHE_BITS); if (scsi->blocksize & (scsi->blocksize - 1) || !scsi->blocksize) { - grub_error (GRUB_ERR_IO, "invalid sector size %d", + VasEBoot_error (VasEBoot_ERR_IO, "invalid sector size %d", scsi->blocksize); - grub_free (scsi); - return grub_errno; + VasEBoot_free (scsi); + return VasEBoot_errno; } for (disk->log_sector_size = 0; (1U << disk->log_sector_size) < scsi->blocksize; disk->log_sector_size++); - grub_dprintf ("scsi", "last_block=%" PRIuGRUB_UINT64_T ", blocksize=%u\n", + VasEBoot_dprintf ("scsi", "last_block=%" PRIuVasEBoot_UINT64_T ", blocksize=%u\n", scsi->last_block, scsi->blocksize); - grub_dprintf ("scsi", "Disk total sectors = %llu\n", + VasEBoot_dprintf ("scsi", "Disk total sectors = %llu\n", (unsigned long long) disk->total_sectors); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - grub_free (scsi); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); + VasEBoot_free (scsi); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); } static void -grub_scsi_close (grub_disk_t disk) +VasEBoot_scsi_close (VasEBoot_disk_t disk) { - grub_scsi_t scsi; + VasEBoot_scsi_t scsi; scsi = disk->data; if (scsi->dev->close) scsi->dev->close (scsi); - grub_free (scsi); + VasEBoot_free (scsi); } -static grub_err_t -grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_scsi_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_scsi_t scsi; + VasEBoot_scsi_t scsi; scsi = disk->data; - grub_err_t err; + VasEBoot_err_t err; /* Depending on the type, select a read function. */ switch (scsi->devtype) { - case grub_scsi_devtype_direct: + case VasEBoot_scsi_devtype_direct: if (sector >> 32) - err = grub_scsi_read16 (disk, sector, size, buf); + err = VasEBoot_scsi_read16 (disk, sector, size, buf); else - err = grub_scsi_read10 (disk, sector, size, buf); + err = VasEBoot_scsi_read10 (disk, sector, size, buf); if (err) return err; break; - case grub_scsi_devtype_cdrom: + case VasEBoot_scsi_devtype_cdrom: if (sector >> 32) - err = grub_scsi_read16 (disk, sector, size, buf); + err = VasEBoot_scsi_read16 (disk, sector, size, buf); else - err = grub_scsi_read12 (disk, sector, size, buf); + err = VasEBoot_scsi_read12 (disk, sector, size, buf); if (err) return err; break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; #if 0 /* Workaround - it works - but very slowly, from some reason * unknown to me (specially on OHCI). Do not use it. */ /* Split transfer requests to device sector size because */ /* some devices are not able to transfer more than 512-1024 bytes */ - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; for ( ; size; size--) { /* Depending on the type, select a read function. */ switch (scsi->devtype) { - case grub_scsi_devtype_direct: - err = grub_scsi_read10 (disk, sector, 1, buf); + case VasEBoot_scsi_devtype_direct: + err = VasEBoot_scsi_read10 (disk, sector, 1, buf); break; - case grub_scsi_devtype_cdrom: - err = grub_scsi_read12 (disk, sector, 1, buf); + case VasEBoot_scsi_devtype_cdrom: + err = VasEBoot_scsi_read12 (disk, sector, 1, buf); break; default: /* This should not happen */ - return GRUB_ERR_READ_ERROR; + return VasEBoot_ERR_READ_ERROR; } if (err) return err; @@ -712,55 +712,55 @@ grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector, #endif } -static grub_err_t -grub_scsi_write (grub_disk_t disk, - grub_disk_addr_t sector, - grub_size_t size, +static VasEBoot_err_t +VasEBoot_scsi_write (VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { - grub_scsi_t scsi; + VasEBoot_scsi_t scsi; scsi = disk->data; - if (scsi->devtype == grub_scsi_devtype_cdrom) - return grub_error (GRUB_ERR_IO, N_("cannot write to CD-ROM")); + if (scsi->devtype == VasEBoot_scsi_devtype_cdrom) + return VasEBoot_error (VasEBoot_ERR_IO, N_("cannot write to CD-ROM")); - grub_err_t err; + VasEBoot_err_t err; /* Depending on the type, select a read function. */ switch (scsi->devtype) { - case grub_scsi_devtype_direct: + case VasEBoot_scsi_devtype_direct: if (sector >> 32) - err = grub_scsi_write16 (disk, sector, size, buf); + err = VasEBoot_scsi_write16 (disk, sector, size, buf); else - err = grub_scsi_write10 (disk, sector, size, buf); + err = VasEBoot_scsi_write10 (disk, sector, size, buf); if (err) return err; break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_disk_dev grub_scsi_dev = +static struct VasEBoot_disk_dev VasEBoot_scsi_dev = { .name = "scsi", - .id = GRUB_DISK_DEVICE_SCSI_ID, - .iterate = grub_scsi_iterate, - .open = grub_scsi_open, - .close = grub_scsi_close, - .read = grub_scsi_read, - .write = grub_scsi_write, + .id = VasEBoot_DISK_DEVICE_SCSI_ID, + .iterate = VasEBoot_scsi_iterate, + .open = VasEBoot_scsi_open, + .close = VasEBoot_scsi_close, + .read = VasEBoot_scsi_read, + .write = VasEBoot_scsi_write, .next = 0 }; -GRUB_MOD_INIT(scsi) +VasEBoot_MOD_INIT(scsi) { - grub_disk_dev_register (&grub_scsi_dev); + VasEBoot_disk_dev_register (&VasEBoot_scsi_dev); } -GRUB_MOD_FINI(scsi) +VasEBoot_MOD_FINI(scsi) { - grub_disk_dev_unregister (&grub_scsi_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_scsi_dev); } diff --git a/VasEBoot-core/disk/uboot/ubootdisk.c b/VasEBoot-core/disk/uboot/ubootdisk.c index a5ce07a99..336bd02a0 100644 --- a/VasEBoot-core/disk/uboot/ubootdisk.c +++ b/VasEBoot-core/disk/uboot/ubootdisk.c @@ -1,44 +1,44 @@ /* ubootdisk.c - disk subsystem support for U-Boot platforms */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static struct ubootdisk_data *hd_devices; static int hd_num; static int hd_max; /* - * grub_ubootdisk_register(): + * VasEBoot_ubootdisk_register(): * Called for each disk device enumerated as part of U-Boot initialization * code. */ -grub_err_t -grub_ubootdisk_register (struct device_info *newdev) +VasEBoot_err_t +VasEBoot_ubootdisk_register (struct device_info *newdev) { struct ubootdisk_data *d; @@ -55,10 +55,10 @@ grub_ubootdisk_register (struct device_info *newdev) { int new_num; new_num = (hd_max ? hd_max * 2 : 1); - d = grub_realloc(hd_devices, + d = VasEBoot_realloc(hd_devices, sizeof (struct ubootdisk_data) * new_num); if (!d) - return grub_errno; + return VasEBoot_errno; hd_devices = d; hd_max = new_num; } @@ -67,7 +67,7 @@ grub_ubootdisk_register (struct device_info *newdev) hd_num++; break; default: - return GRUB_ERR_BAD_DEVICE; + return VasEBoot_ERR_BAD_DEVICE; break; } @@ -83,20 +83,20 @@ grub_ubootdisk_register (struct device_info *newdev) * Iterator over enumerated disk devices. */ static int -uboot_disk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +uboot_disk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { char buf[16]; int count; switch (pull) { - case GRUB_DISK_PULL_NONE: + case VasEBoot_DISK_PULL_NONE: /* "hd" - built-in mass-storage */ for (count = 0 ; count < hd_num; count++) { - grub_snprintf (buf, sizeof (buf) - 1, "hd%d", count); - grub_dprintf ("ubootdisk", "iterating %s\n", buf); + VasEBoot_snprintf (buf, sizeof (buf) - 1, "hd%d", count); + VasEBoot_dprintf ("ubootdisk", "iterating %s\n", buf); if (hook (buf, hook_data)) return 1; } @@ -122,27 +122,27 @@ get_hd_device (int num) * uboot_disk_open(): * Opens a disk device already enumerated. */ -static grub_err_t -uboot_disk_open (const char *name, struct grub_disk *disk) +static VasEBoot_err_t +uboot_disk_open (const char *name, struct VasEBoot_disk *disk) { struct ubootdisk_data *d; struct device_info *devinfo; int num; int retval; - grub_dprintf ("ubootdisk", "Opening '%s'\n", name); + VasEBoot_dprintf ("ubootdisk", "Opening '%s'\n", name); - num = grub_strtoul (name + 2, 0, 10); - if (grub_errno != GRUB_ERR_NONE) + num = VasEBoot_strtoul (name + 2, 0, 10); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_dprintf ("ubootdisk", "Opening '%s' failed, invalid number\n", + VasEBoot_dprintf ("ubootdisk", "Opening '%s' failed, invalid number\n", name); goto fail; } if (name[1] != 'd') { - grub_dprintf ("ubootdisk", "Opening '%s' failed, invalid name\n", name); + VasEBoot_dprintf ("ubootdisk", "Opening '%s' failed, invalid name\n", name); goto fail; } @@ -165,49 +165,49 @@ uboot_disk_open (const char *name, struct grub_disk *disk) */ if (d->opencount > 0) { - grub_dprintf ("ubootdisk", "(%s) already open\n", disk->name); + VasEBoot_dprintf ("ubootdisk", "(%s) already open\n", disk->name); d->opencount++; retval = 0; } else { - retval = grub_uboot_dev_open (d->dev); + retval = VasEBoot_uboot_dev_open (d->dev); if (retval != 0) goto fail; d->opencount = 1; } - grub_dprintf ("ubootdisk", "cookie: 0x%08x\n", (grub_addr_t) d->cookie); - disk->id = (grub_addr_t) d->cookie; + VasEBoot_dprintf ("ubootdisk", "cookie: 0x%08x\n", (VasEBoot_addr_t) d->cookie); + disk->id = (VasEBoot_addr_t) d->cookie; devinfo = d->dev; d->block_size = devinfo->di_stor.block_size; if (d->block_size == 0) - return grub_error (GRUB_ERR_IO, "no block size"); + return VasEBoot_error (VasEBoot_ERR_IO, "no block size"); for (disk->log_sector_size = 0; (1U << disk->log_sector_size) < d->block_size; disk->log_sector_size++); - grub_dprintf ("ubootdisk", "(%s) blocksize=%d, log_sector_size=%d\n", + VasEBoot_dprintf ("ubootdisk", "(%s) blocksize=%d, log_sector_size=%d\n", disk->name, d->block_size, disk->log_sector_size); if (devinfo->di_stor.block_count) disk->total_sectors = devinfo->di_stor.block_count; else - disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN; + disk->total_sectors = VasEBoot_DISK_SIZE_UNKNOWN; disk->data = d; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no such device"); } static void -uboot_disk_close (struct grub_disk *disk) +uboot_disk_close (struct VasEBoot_disk *disk) { struct ubootdisk_data *d; int retval; @@ -220,19 +220,19 @@ uboot_disk_close (struct grub_disk *disk) */ if (d->opencount > 1) { - grub_dprintf ("ubootdisk", "Closed (%s)\n", disk->name); + VasEBoot_dprintf ("ubootdisk", "Closed (%s)\n", disk->name); d->opencount--; } else if (d->opencount == 1) { - retval = grub_uboot_dev_close (d->dev); + retval = VasEBoot_uboot_dev_close (d->dev); d->opencount--; - grub_dprintf ("ubootdisk", "closed %s (%d)\n", disk->name, retval); + VasEBoot_dprintf ("ubootdisk", "closed %s (%d)\n", disk->name, retval); } else { - grub_dprintf ("ubootdisk", "device %s not open!\n", disk->name); + VasEBoot_dprintf ("ubootdisk", "device %s not open!\n", disk->name); } } @@ -242,40 +242,40 @@ uboot_disk_close (struct grub_disk *disk) * disk cache. Maps directly on top of U-Boot API, only wrap in some error * handling. */ -static grub_err_t -uboot_disk_read (struct grub_disk *disk, - grub_disk_addr_t offset, grub_size_t numblocks, char *buf) +static VasEBoot_err_t +uboot_disk_read (struct VasEBoot_disk *disk, + VasEBoot_disk_addr_t offset, VasEBoot_size_t numblocks, char *buf) { struct ubootdisk_data *d; - grub_size_t real_size; + VasEBoot_size_t real_size; int retval; d = disk->data; - retval = grub_uboot_dev_read (d->dev, buf, numblocks, offset, &real_size); - grub_dprintf ("ubootdisk", + retval = VasEBoot_uboot_dev_read (d->dev, buf, numblocks, offset, &real_size); + VasEBoot_dprintf ("ubootdisk", "retval=%d, numblocks=%d, real_size=%llu, sector=%llu\n", - retval, numblocks, (grub_uint64_t) real_size, - (grub_uint64_t) offset); + retval, numblocks, (VasEBoot_uint64_t) real_size, + (VasEBoot_uint64_t) offset); if (retval != 0) - return grub_error (GRUB_ERR_IO, "U-Boot disk read error"); + return VasEBoot_error (VasEBoot_ERR_IO, "U-Boot disk read error"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -uboot_disk_write (struct grub_disk *disk __attribute__ ((unused)), - grub_disk_addr_t sector __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused)), +static VasEBoot_err_t +uboot_disk_write (struct VasEBoot_disk *disk __attribute__ ((unused)), + VasEBoot_disk_addr_t sector __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused)), const char *buf __attribute__ ((unused))) { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "attempt to write (not supported)"); } -static struct grub_disk_dev grub_ubootdisk_dev = { +static struct VasEBoot_disk_dev VasEBoot_ubootdisk_dev = { .name = "ubootdisk", - .id = GRUB_DISK_DEVICE_UBOOTDISK_ID, + .id = VasEBoot_DISK_DEVICE_UBOOTDISK_ID, .iterate = uboot_disk_iterate, .open = uboot_disk_open, .close = uboot_disk_close, @@ -285,13 +285,13 @@ static struct grub_disk_dev grub_ubootdisk_dev = { }; void -grub_ubootdisk_init (void) +VasEBoot_ubootdisk_init (void) { - grub_disk_dev_register (&grub_ubootdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_ubootdisk_dev); } void -grub_ubootdisk_fini (void) +VasEBoot_ubootdisk_fini (void) { - grub_disk_dev_unregister (&grub_ubootdisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_ubootdisk_dev); } diff --git a/VasEBoot-core/disk/usbms.c b/VasEBoot-core/disk/usbms.c index 380ca4c4c..c53b24d17 100644 --- a/VasEBoot-core/disk/usbms.c +++ b/VasEBoot-core/disk/usbms.c @@ -1,102 +1,102 @@ /* usbms.c - USB Mass Storage Support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_USBMS_DIRECTION_BIT 7 +#define VasEBoot_USBMS_DIRECTION_BIT 7 /* Length of CBI command should be always 12 bytes */ -#define GRUB_USBMS_CBI_CMD_SIZE 12 +#define VasEBoot_USBMS_CBI_CMD_SIZE 12 /* CBI class-specific USB request ADSC - it sends CBI (scsi) command to * device in DATA stage */ -#define GRUB_USBMS_CBI_ADSC_REQ 0x00 +#define VasEBoot_USBMS_CBI_ADSC_REQ 0x00 /* The USB Mass Storage Command Block Wrapper. */ -struct grub_usbms_cbw +struct VasEBoot_usbms_cbw { - grub_uint32_t signature; - grub_uint32_t tag; - grub_uint32_t transfer_length; - grub_uint8_t flags; - grub_uint8_t lun; - grub_uint8_t length; - grub_uint8_t cbwcb[16]; -} GRUB_PACKED; + VasEBoot_uint32_t signature; + VasEBoot_uint32_t tag; + VasEBoot_uint32_t transfer_length; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t lun; + VasEBoot_uint8_t length; + VasEBoot_uint8_t cbwcb[16]; +} VasEBoot_PACKED; -struct grub_usbms_csw +struct VasEBoot_usbms_csw { - grub_uint32_t signature; - grub_uint32_t tag; - grub_uint32_t residue; - grub_uint8_t status; -} GRUB_PACKED; + VasEBoot_uint32_t signature; + VasEBoot_uint32_t tag; + VasEBoot_uint32_t residue; + VasEBoot_uint8_t status; +} VasEBoot_PACKED; -struct grub_usbms_dev +struct VasEBoot_usbms_dev { - struct grub_usb_device *dev; + struct VasEBoot_usb_device *dev; int luns; int config; int interface; - struct grub_usb_desc_endp *in; - struct grub_usb_desc_endp *out; + struct VasEBoot_usb_desc_endp *in; + struct VasEBoot_usb_desc_endp *out; int subclass; int protocol; - struct grub_usb_desc_endp *intrpt; + struct VasEBoot_usb_desc_endp *intrpt; }; -typedef struct grub_usbms_dev *grub_usbms_dev_t; +typedef struct VasEBoot_usbms_dev *VasEBoot_usbms_dev_t; /* FIXME: remove limit. */ #define MAX_USBMS_DEVICES 128 -static grub_usbms_dev_t grub_usbms_devices[MAX_USBMS_DEVICES]; +static VasEBoot_usbms_dev_t VasEBoot_usbms_devices[MAX_USBMS_DEVICES]; static int first_available_slot = 0; -static grub_usb_err_t -grub_usbms_cbi_cmd (grub_usb_device_t dev, int interface, - grub_uint8_t *cbicb) +static VasEBoot_usb_err_t +VasEBoot_usbms_cbi_cmd (VasEBoot_usb_device_t dev, int interface, + VasEBoot_uint8_t *cbicb) { - return grub_usb_control_msg (dev, - GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT, - GRUB_USBMS_CBI_ADSC_REQ, 0, interface, - GRUB_USBMS_CBI_CMD_SIZE, (char*)cbicb); + return VasEBoot_usb_control_msg (dev, + VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT, + VasEBoot_USBMS_CBI_ADSC_REQ, 0, interface, + VasEBoot_USBMS_CBI_CMD_SIZE, (char*)cbicb); } -static grub_usb_err_t -grub_usbms_cbi_reset (grub_usb_device_t dev, int interface) +static VasEBoot_usb_err_t +VasEBoot_usbms_cbi_reset (VasEBoot_usb_device_t dev, int interface) { /* Prepare array with Command Block Reset (=CBR) */ /* CBI specific communication reset command should be send to device * via CBI USB class specific request ADCS */ - struct grub_cbi_reset + struct VasEBoot_cbi_reset { - grub_uint8_t opcode; /* 0x1d = SEND DIAGNOSTIC */ - grub_uint8_t lun; /* 7-5 LUN, 4-0 flags - for CBR always = 0x04 */ - grub_uint8_t pad[10]; + VasEBoot_uint8_t opcode; /* 0x1d = SEND DIAGNOSTIC */ + VasEBoot_uint8_t lun; /* 7-5 LUN, 4-0 flags - for CBR always = 0x04 */ + VasEBoot_uint8_t pad[10]; /* XXX: There is collision between CBI and UFI specifications: * CBI says 0xff, UFI says 0x00 ... probably it does * not matter ... (?) */ @@ -105,51 +105,51 @@ grub_usbms_cbi_reset (grub_usb_device_t dev, int interface) 0xff, 0xff, 0xff, 0xff, 0xff } }; - return grub_usbms_cbi_cmd (dev, interface, (grub_uint8_t *)&cbicb); + return VasEBoot_usbms_cbi_cmd (dev, interface, (VasEBoot_uint8_t *)&cbicb); } -static grub_usb_err_t -grub_usbms_bo_reset (grub_usb_device_t dev, int interface) +static VasEBoot_usb_err_t +VasEBoot_usbms_bo_reset (VasEBoot_usb_device_t dev, int interface) { - return grub_usb_control_msg (dev, 0x21, 255, 0, interface, 0, 0); + return VasEBoot_usb_control_msg (dev, 0x21, 255, 0, interface, 0, 0); } -static grub_usb_err_t -grub_usbms_reset (grub_usbms_dev_t dev) +static VasEBoot_usb_err_t +VasEBoot_usbms_reset (VasEBoot_usbms_dev_t dev) { - if (dev->protocol == GRUB_USBMS_PROTOCOL_BULK) - return grub_usbms_bo_reset (dev->dev, dev->interface); + if (dev->protocol == VasEBoot_USBMS_PROTOCOL_BULK) + return VasEBoot_usbms_bo_reset (dev->dev, dev->interface); else - return grub_usbms_cbi_reset (dev->dev, dev->interface); + return VasEBoot_usbms_cbi_reset (dev->dev, dev->interface); } static void -grub_usbms_detach (grub_usb_device_t usbdev, int config, int interface) +VasEBoot_usbms_detach (VasEBoot_usb_device_t usbdev, int config, int interface) { unsigned i; - for (i = 0; i < ARRAY_SIZE (grub_usbms_devices); i++) - if (grub_usbms_devices[i] && grub_usbms_devices[i]->dev == usbdev - && grub_usbms_devices[i]->interface == interface - && grub_usbms_devices[i]->config == config) + for (i = 0; i < ARRAY_SIZE (VasEBoot_usbms_devices); i++) + if (VasEBoot_usbms_devices[i] && VasEBoot_usbms_devices[i]->dev == usbdev + && VasEBoot_usbms_devices[i]->interface == interface + && VasEBoot_usbms_devices[i]->config == config) { - grub_free (grub_usbms_devices[i]); - grub_usbms_devices[i] = 0; + VasEBoot_free (VasEBoot_usbms_devices[i]); + VasEBoot_usbms_devices[i] = 0; } } static int -grub_usbms_attach (grub_usb_device_t usbdev, int configno, int interfno) +VasEBoot_usbms_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno) { - struct grub_usb_desc_if *interf + struct VasEBoot_usb_desc_if *interf = usbdev->config[configno].interf[interfno].descif; int j; - grub_uint8_t luns = 0; + VasEBoot_uint8_t luns = 0; unsigned curnum; - grub_usb_err_t err = GRUB_USB_ERR_NONE; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NONE; - grub_boot_time ("Attaching USB mass storage"); + VasEBoot_boot_time ("Attaching USB mass storage"); - if (first_available_slot == ARRAY_SIZE (grub_usbms_devices)) + if (first_available_slot == ARRAY_SIZE (VasEBoot_usbms_devices)) return 0; curnum = first_available_slot; @@ -157,94 +157,94 @@ grub_usbms_attach (grub_usb_device_t usbdev, int configno, int interfno) interf = usbdev->config[configno].interf[interfno].descif; - if ((interf->subclass != GRUB_USBMS_SUBCLASS_BULK + if ((interf->subclass != VasEBoot_USBMS_SUBCLASS_BULK /* Experimental support of RBC, MMC-2, UFI, SFF-8070i devices */ - && interf->subclass != GRUB_USBMS_SUBCLASS_RBC - && interf->subclass != GRUB_USBMS_SUBCLASS_MMC2 - && interf->subclass != GRUB_USBMS_SUBCLASS_UFI - && interf->subclass != GRUB_USBMS_SUBCLASS_SFF8070 ) - || (interf->protocol != GRUB_USBMS_PROTOCOL_BULK - && interf->protocol != GRUB_USBMS_PROTOCOL_CBI - && interf->protocol != GRUB_USBMS_PROTOCOL_CB)) + && interf->subclass != VasEBoot_USBMS_SUBCLASS_RBC + && interf->subclass != VasEBoot_USBMS_SUBCLASS_MMC2 + && interf->subclass != VasEBoot_USBMS_SUBCLASS_UFI + && interf->subclass != VasEBoot_USBMS_SUBCLASS_SFF8070 ) + || (interf->protocol != VasEBoot_USBMS_PROTOCOL_BULK + && interf->protocol != VasEBoot_USBMS_PROTOCOL_CBI + && interf->protocol != VasEBoot_USBMS_PROTOCOL_CB)) return 0; - grub_usbms_devices[curnum] = grub_zalloc (sizeof (struct grub_usbms_dev)); - if (! grub_usbms_devices[curnum]) + VasEBoot_usbms_devices[curnum] = VasEBoot_zalloc (sizeof (struct VasEBoot_usbms_dev)); + if (! VasEBoot_usbms_devices[curnum]) return 0; - grub_usbms_devices[curnum]->dev = usbdev; - grub_usbms_devices[curnum]->interface = interfno; - grub_usbms_devices[curnum]->subclass = interf->subclass; - grub_usbms_devices[curnum]->protocol = interf->protocol; + VasEBoot_usbms_devices[curnum]->dev = usbdev; + VasEBoot_usbms_devices[curnum]->interface = interfno; + VasEBoot_usbms_devices[curnum]->subclass = interf->subclass; + VasEBoot_usbms_devices[curnum]->protocol = interf->protocol; - grub_dprintf ("usbms", "alive\n"); + VasEBoot_dprintf ("usbms", "alive\n"); /* Iterate over all endpoints of this interface, at least a IN and OUT bulk endpoint are required. */ for (j = 0; j < interf->endpointcnt; j++) { - struct grub_usb_desc_endp *endp; + struct VasEBoot_usb_desc_endp *endp; endp = &usbdev->config[0].interf[interfno].descendp[j]; if ((endp->endp_addr & 128) && (endp->attrib & 3) == 2) /* Bulk IN endpoint. */ - grub_usbms_devices[curnum]->in = endp; + VasEBoot_usbms_devices[curnum]->in = endp; else if (!(endp->endp_addr & 128) && (endp->attrib & 3) == 2) /* Bulk OUT endpoint. */ - grub_usbms_devices[curnum]->out = endp; + VasEBoot_usbms_devices[curnum]->out = endp; else if ((endp->endp_addr & 128) && (endp->attrib & 3) == 3) /* Interrupt (IN) endpoint. */ - grub_usbms_devices[curnum]->intrpt = endp; + VasEBoot_usbms_devices[curnum]->intrpt = endp; } - if (!grub_usbms_devices[curnum]->in || !grub_usbms_devices[curnum]->out - || ((grub_usbms_devices[curnum]->protocol == GRUB_USBMS_PROTOCOL_CBI) - && !grub_usbms_devices[curnum]->intrpt)) + if (!VasEBoot_usbms_devices[curnum]->in || !VasEBoot_usbms_devices[curnum]->out + || ((VasEBoot_usbms_devices[curnum]->protocol == VasEBoot_USBMS_PROTOCOL_CBI) + && !VasEBoot_usbms_devices[curnum]->intrpt)) { - grub_free (grub_usbms_devices[curnum]); - grub_usbms_devices[curnum] = 0; + VasEBoot_free (VasEBoot_usbms_devices[curnum]); + VasEBoot_usbms_devices[curnum] = 0; return 0; } - grub_dprintf ("usbms", "alive\n"); + VasEBoot_dprintf ("usbms", "alive\n"); /* XXX: Activate the first configuration. */ - grub_usb_set_configuration (usbdev, 1); + VasEBoot_usb_set_configuration (usbdev, 1); /* Query the amount of LUNs. */ - if (grub_usbms_devices[curnum]->protocol == GRUB_USBMS_PROTOCOL_BULK) + if (VasEBoot_usbms_devices[curnum]->protocol == VasEBoot_USBMS_PROTOCOL_BULK) { /* Only Bulk only devices support Get Max LUN command */ - err = grub_usb_control_msg (usbdev, 0xA1, 254, 0, interfno, 1, (char *) &luns); + err = VasEBoot_usb_control_msg (usbdev, 0xA1, 254, 0, interfno, 1, (char *) &luns); if (err) { /* In case of a stall, clear the stall. */ - if (err == GRUB_USB_ERR_STALL) + if (err == VasEBoot_USB_ERR_STALL) { - grub_usb_clear_halt (usbdev, grub_usbms_devices[curnum]->in->endp_addr); - grub_usb_clear_halt (usbdev, grub_usbms_devices[curnum]->out->endp_addr); + VasEBoot_usb_clear_halt (usbdev, VasEBoot_usbms_devices[curnum]->in->endp_addr); + VasEBoot_usb_clear_halt (usbdev, VasEBoot_usbms_devices[curnum]->out->endp_addr); } /* Just set the amount of LUNs to one. */ - grub_errno = GRUB_ERR_NONE; - grub_usbms_devices[curnum]->luns = 1; + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_usbms_devices[curnum]->luns = 1; } else /* luns = 0 means one LUN with ID 0 present ! */ /* We get from device not number of LUNs but highest * LUN number. LUNs are numbered from 0, * i.e. number of LUNs is luns+1 ! */ - grub_usbms_devices[curnum]->luns = luns + 1; + VasEBoot_usbms_devices[curnum]->luns = luns + 1; } else /* XXX: Does CBI devices support multiple LUNs ? * I.e., should we detect number of device's LUNs ? (How?) */ - grub_usbms_devices[curnum]->luns = 1; + VasEBoot_usbms_devices[curnum]->luns = 1; - grub_dprintf ("usbms", "alive\n"); + VasEBoot_dprintf ("usbms", "alive\n"); - usbdev->config[configno].interf[interfno].detach_hook = grub_usbms_detach; + usbdev->config[configno].interf[interfno].detach_hook = VasEBoot_usbms_detach; - grub_boot_time ("Attached USB mass storage"); + VasEBoot_boot_time ("Attached USB mass storage"); #if 0 /* All this part should be probably deleted. * This make trouble on some devices if they are not in @@ -254,9 +254,9 @@ grub_usbms_attach (grub_usb_device_t usbdev, int configno, int interfno) /* Reset recovery procedure */ /* Bulk-Only Mass Storage Reset, after the reset commands will be accepted. */ - grub_usbms_reset (usbdev, i); - grub_usb_clear_halt (usbdev, usbms->in->endp_addr); - grub_usb_clear_halt (usbdev, usbms->out->endp_addr); + VasEBoot_usbms_reset (usbdev, i); + VasEBoot_usb_clear_halt (usbdev, usbms->in->endp_addr); + VasEBoot_usb_clear_halt (usbdev, usbms->out->endp_addr); #endif return 1; @@ -265,20 +265,20 @@ grub_usbms_attach (grub_usb_device_t usbdev, int configno, int interfno) static int -grub_usbms_iterate (grub_scsi_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_usbms_iterate (VasEBoot_scsi_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { unsigned i; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; - grub_usb_poll_devices (1); + VasEBoot_usb_poll_devices (1); - for (i = 0; i < ARRAY_SIZE (grub_usbms_devices); i++) - if (grub_usbms_devices[i]) + for (i = 0; i < ARRAY_SIZE (VasEBoot_usbms_devices); i++) + if (VasEBoot_usbms_devices[i]) { - if (hook (GRUB_SCSI_SUBSYSTEM_USBMS, i, grub_usbms_devices[i]->luns, + if (hook (VasEBoot_SCSI_SUBSYSTEM_USBMS, i, VasEBoot_usbms_devices[i]->luns, hook_data)) return 1; } @@ -286,16 +286,16 @@ grub_usbms_iterate (grub_scsi_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf, int read_write) +static VasEBoot_err_t +VasEBoot_usbms_transfer_bo (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, char *buf, int read_write) { - struct grub_usbms_cbw cbw; - grub_usbms_dev_t dev = (grub_usbms_dev_t) scsi->data; - struct grub_usbms_csw status; - static grub_uint32_t tag = 0; - grub_usb_err_t err = GRUB_USB_ERR_NONE; - grub_usb_err_t errCSW = GRUB_USB_ERR_NONE; + struct VasEBoot_usbms_cbw cbw; + VasEBoot_usbms_dev_t dev = (VasEBoot_usbms_dev_t) scsi->data; + struct VasEBoot_usbms_csw status; + static VasEBoot_uint32_t tag = 0; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NONE; + VasEBoot_usb_err_t errCSW = VasEBoot_USB_ERR_NONE; int retrycnt = 3 + 1; tag++; @@ -303,24 +303,24 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, retry: retrycnt--; if (retrycnt == 0) - return grub_error (GRUB_ERR_IO, "USB Mass Storage stalled"); + return VasEBoot_error (VasEBoot_ERR_IO, "USB Mass Storage stalled"); /* Setup the request. */ - grub_memset (&cbw, 0, sizeof (cbw)); - cbw.signature = grub_cpu_to_le32_compile_time (0x43425355); + VasEBoot_memset (&cbw, 0, sizeof (cbw)); + cbw.signature = VasEBoot_cpu_to_le32_compile_time (0x43425355); cbw.tag = tag; - cbw.transfer_length = grub_cpu_to_le32 (size); - cbw.flags = (!read_write) << GRUB_USBMS_DIRECTION_BIT; + cbw.transfer_length = VasEBoot_cpu_to_le32 (size); + cbw.flags = (!read_write) << VasEBoot_USBMS_DIRECTION_BIT; cbw.lun = scsi->lun; /* In USB MS CBW are LUN bits on another place than in SCSI CDB, both should be set correctly. */ cbw.length = cmdsize; - grub_memcpy (cbw.cbwcb, cmd, cmdsize); + VasEBoot_memcpy (cbw.cbwcb, cmd, cmdsize); /* Debug print of CBW content. */ - grub_dprintf ("usb", "CBW: sign=0x%08x tag=0x%08x len=0x%08x\n", + VasEBoot_dprintf ("usb", "CBW: sign=0x%08x tag=0x%08x len=0x%08x\n", cbw.signature, cbw.tag, cbw.transfer_length); - grub_dprintf ("usb", "CBW: flags=0x%02x lun=0x%02x CB_len=0x%02x\n", + VasEBoot_dprintf ("usb", "CBW: flags=0x%02x lun=0x%02x CB_len=0x%02x\n", cbw.flags, cbw.lun, cbw.length); - grub_dprintf ("usb", "CBW: cmd:\n %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + VasEBoot_dprintf ("usb", "CBW: cmd:\n %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", cbw.cbwcb[ 0], cbw.cbwcb[ 1], cbw.cbwcb[ 2], cbw.cbwcb[ 3], cbw.cbwcb[ 4], cbw.cbwcb[ 5], cbw.cbwcb[ 6], cbw.cbwcb[ 7], cbw.cbwcb[ 8], cbw.cbwcb[ 9], cbw.cbwcb[10], cbw.cbwcb[11], @@ -328,13 +328,13 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, /* Write the request. * XXX: Error recovery is maybe still not fully correct. */ - err = grub_usb_bulk_write (dev->dev, dev->out, + err = VasEBoot_usb_bulk_write (dev->dev, dev->out, sizeof (cbw), (char *) &cbw); if (err) { - if (err == GRUB_USB_ERR_STALL) + if (err == VasEBoot_USB_ERR_STALL) { - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); goto CheckCSW; } goto retry; @@ -343,38 +343,38 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, /* Read/write the data, (maybe) according to specification. */ if (size && (read_write == 0)) { - err = grub_usb_bulk_read (dev->dev, dev->in, size, buf); - grub_dprintf ("usb", "read: %d %d\n", err, GRUB_USB_ERR_STALL); + err = VasEBoot_usb_bulk_read (dev->dev, dev->in, size, buf); + VasEBoot_dprintf ("usb", "read: %d %d\n", err, VasEBoot_USB_ERR_STALL); if (err) { - if (err == GRUB_USB_ERR_STALL) - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); + if (err == VasEBoot_USB_ERR_STALL) + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); goto CheckCSW; } /* Debug print of received data. */ - grub_dprintf ("usb", "buf:\n"); + VasEBoot_dprintf ("usb", "buf:\n"); if (size <= 64) { unsigned i; for (i = 0; i < size; i++) - grub_dprintf ("usb", "0x%02x: 0x%02x\n", i, buf[i]); + VasEBoot_dprintf ("usb", "0x%02x: 0x%02x\n", i, buf[i]); } else - grub_dprintf ("usb", "Too much data for debug print...\n"); + VasEBoot_dprintf ("usb", "Too much data for debug print...\n"); } else if (size) { - err = grub_usb_bulk_write (dev->dev, dev->out, size, buf); - grub_dprintf ("usb", "write: %d %d\n", err, GRUB_USB_ERR_STALL); - grub_dprintf ("usb", "First 16 bytes of sent data:\n %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + err = VasEBoot_usb_bulk_write (dev->dev, dev->out, size, buf); + VasEBoot_dprintf ("usb", "write: %d %d\n", err, VasEBoot_USB_ERR_STALL); + VasEBoot_dprintf ("usb", "First 16 bytes of sent data:\n %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", buf[ 0], buf[ 1], buf[ 2], buf[ 3], buf[ 4], buf[ 5], buf[ 6], buf[ 7], buf[ 8], buf[ 9], buf[10], buf[11], buf[12], buf[13], buf[14], buf[15]); if (err) { - if (err == GRUB_USB_ERR_STALL) - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + if (err == VasEBoot_USB_ERR_STALL) + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); goto CheckCSW; } /* Debug print of sent data. */ @@ -382,105 +382,105 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, { unsigned i; for (i=0; idev, dev->in, + errCSW = VasEBoot_usb_bulk_read (dev->dev, dev->in, sizeof (status), (char *) &status); if (errCSW) { - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); - errCSW = grub_usb_bulk_read (dev->dev, dev->in, + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); + errCSW = VasEBoot_usb_bulk_read (dev->dev, dev->in, sizeof (status), (char *) &status); if (errCSW) { /* Bulk-only reset device. */ - grub_dprintf ("usb", "Bulk-only reset device - errCSW\n"); - grub_usbms_reset (dev); - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + VasEBoot_dprintf ("usb", "Bulk-only reset device - errCSW\n"); + VasEBoot_usbms_reset (dev); + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); goto retry; } } /* Debug print of CSW content. */ - grub_dprintf ("usb", "CSW: sign=0x%08x tag=0x%08x resid=0x%08x\n", + VasEBoot_dprintf ("usb", "CSW: sign=0x%08x tag=0x%08x resid=0x%08x\n", status.signature, status.tag, status.residue); - grub_dprintf ("usb", "CSW: status=0x%02x\n", status.status); + VasEBoot_dprintf ("usb", "CSW: status=0x%02x\n", status.status); /* If phase error or not valid signature, do bulk-only reset device. */ if ((status.status == 2) || - (status.signature != grub_cpu_to_le32_compile_time(0x53425355))) + (status.signature != VasEBoot_cpu_to_le32_compile_time(0x53425355))) { /* Bulk-only reset device. */ - grub_dprintf ("usb", "Bulk-only reset device - bad status\n"); - grub_usbms_reset (dev); - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + VasEBoot_dprintf ("usb", "Bulk-only reset device - bad status\n"); + VasEBoot_usbms_reset (dev); + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); goto retry; } /* If "command failed" status or data transfer failed -> error */ if ((status.status || err) && !read_write) - return grub_error (GRUB_ERR_READ_ERROR, + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, "error communication with USB Mass Storage device"); else if ((status.status || err) && read_write) - return grub_error (GRUB_ERR_WRITE_ERROR, + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, "error communication with USB Mass Storage device"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf, int read_write) +static VasEBoot_err_t +VasEBoot_usbms_transfer_cbi (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, char *buf, int read_write) { - grub_usbms_dev_t dev = (grub_usbms_dev_t) scsi->data; + VasEBoot_usbms_dev_t dev = (VasEBoot_usbms_dev_t) scsi->data; int retrycnt = 3 + 1; - grub_usb_err_t err = GRUB_USB_ERR_NONE; - grub_uint8_t cbicb[GRUB_USBMS_CBI_CMD_SIZE]; - grub_uint16_t status; + VasEBoot_usb_err_t err = VasEBoot_USB_ERR_NONE; + VasEBoot_uint8_t cbicb[VasEBoot_USBMS_CBI_CMD_SIZE]; + VasEBoot_uint16_t status; retry: retrycnt--; if (retrycnt == 0) - return grub_error (GRUB_ERR_IO, "USB Mass Storage CBI failed"); + return VasEBoot_error (VasEBoot_ERR_IO, "USB Mass Storage CBI failed"); /* Setup the request. */ - grub_memset (cbicb, 0, sizeof (cbicb)); - grub_memcpy (cbicb, cmd, - cmdsize >= GRUB_USBMS_CBI_CMD_SIZE - ? GRUB_USBMS_CBI_CMD_SIZE + VasEBoot_memset (cbicb, 0, sizeof (cbicb)); + VasEBoot_memcpy (cbicb, cmd, + cmdsize >= VasEBoot_USBMS_CBI_CMD_SIZE + ? VasEBoot_USBMS_CBI_CMD_SIZE : cmdsize); /* Debug print of CBIcb content. */ - grub_dprintf ("usb", "cbicb:\n %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + VasEBoot_dprintf ("usb", "cbicb:\n %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", cbicb[ 0], cbicb[ 1], cbicb[ 2], cbicb[ 3], cbicb[ 4], cbicb[ 5], cbicb[ 6], cbicb[ 7], cbicb[ 8], cbicb[ 9], cbicb[10], cbicb[11]); /* Write the request. * XXX: Error recovery is maybe not correct. */ - err = grub_usbms_cbi_cmd (dev->dev, dev->interface, cbicb); + err = VasEBoot_usbms_cbi_cmd (dev->dev, dev->interface, cbicb); if (err) { - grub_dprintf ("usb", "CBI cmdcb setup err=%d\n", err); - if (err == GRUB_USB_ERR_STALL) + VasEBoot_dprintf ("usb", "CBI cmdcb setup err=%d\n", err); + if (err == VasEBoot_USB_ERR_STALL) { /* Stall in this place probably means bad or unsupported * command, so we will not try it again. */ - return grub_error (GRUB_ERR_IO, "USB Mass Storage CBI request failed"); + return VasEBoot_error (VasEBoot_ERR_IO, "USB Mass Storage CBI request failed"); } - else if (dev->protocol == GRUB_USBMS_PROTOCOL_CBI) + else if (dev->protocol == VasEBoot_USBMS_PROTOCOL_CBI) { /* Try to get status from interrupt pipe */ - err = grub_usb_bulk_read (dev->dev, dev->intrpt, + err = VasEBoot_usb_bulk_read (dev->dev, dev->intrpt, 2, (char*)&status); - grub_dprintf ("usb", "CBI cmdcb setup status: err=%d, status=0x%x\n", err, status); + VasEBoot_dprintf ("usb", "CBI cmdcb setup status: err=%d, status=0x%x\n", err, status); } /* Any other error could be transport problem, try it again */ goto retry; @@ -489,23 +489,23 @@ grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, /* Read/write the data, (maybe) according to specification. */ if (size && (read_write == 0)) { - err = grub_usb_bulk_read (dev->dev, dev->in, size, buf); - grub_dprintf ("usb", "read: %d\n", err); + err = VasEBoot_usb_bulk_read (dev->dev, dev->in, size, buf); + VasEBoot_dprintf ("usb", "read: %d\n", err); if (err) { - if (err == GRUB_USB_ERR_STALL) - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); + if (err == VasEBoot_USB_ERR_STALL) + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); goto retry; } } else if (size) { - err = grub_usb_bulk_write (dev->dev, dev->out, size, buf); - grub_dprintf ("usb", "write: %d\n", err); + err = VasEBoot_usb_bulk_write (dev->dev, dev->out, size, buf); + VasEBoot_dprintf ("usb", "write: %d\n", err); if (err) { - if (err == GRUB_USB_ERR_STALL) - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + if (err == VasEBoot_USB_ERR_STALL) + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); goto retry; } } @@ -517,29 +517,29 @@ grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, * Maybe we should do check on higher level, i.e. issue RequestSense * command (we do it already in scsi.c) and check returned values * (we do not it yet) - ? */ - if (dev->protocol == GRUB_USBMS_PROTOCOL_CBI) + if (dev->protocol == VasEBoot_USBMS_PROTOCOL_CBI) { /* Check status in interrupt pipe */ - err = grub_usb_bulk_read (dev->dev, dev->intrpt, + err = VasEBoot_usb_bulk_read (dev->dev, dev->intrpt, 2, (char*)&status); - grub_dprintf ("usb", "read status: %d\n", err); + VasEBoot_dprintf ("usb", "read status: %d\n", err); if (err) { /* Try to reset device, because it is probably not standard * situation */ - grub_usbms_reset (dev); - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); - grub_usb_clear_halt (dev->dev, dev->intrpt->endp_addr); + VasEBoot_usbms_reset (dev); + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->intrpt->endp_addr); goto retry; } - if (dev->subclass == GRUB_USBMS_SUBCLASS_UFI) + if (dev->subclass == VasEBoot_USBMS_SUBCLASS_UFI) { /* These devices should return bASC and bASCQ */ if (status != 0) /* Some error, currently we don't care what it is... */ goto retry; } - else if (dev->subclass == GRUB_USBMS_SUBCLASS_RBC) + else if (dev->subclass == VasEBoot_USBMS_SUBCLASS_RBC) { /* XXX: I don't understand what returns RBC subclass devices, * so I don't check it - maybe somebody helps ? */ @@ -548,7 +548,7 @@ grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, { /* Any other device should return bType = 0 and some bValue */ if (status & 0xff) - return grub_error (GRUB_ERR_IO, "USB Mass Storage CBI status type != 0"); + return VasEBoot_error (VasEBoot_ERR_IO, "USB Mass Storage CBI status type != 0"); status = (status & 0x0300) >> 8; switch (status) { @@ -559,11 +559,11 @@ grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, break; case 2 : /* Phase error */ case 3 : /* Persistent Failure */ - grub_dprintf ("usb", "CBI reset device - phase error or persistent failure\n"); - grub_usbms_reset (dev); - grub_usb_clear_halt (dev->dev, dev->in->endp_addr); - grub_usb_clear_halt (dev->dev, dev->out->endp_addr); - grub_usb_clear_halt (dev->dev, dev->intrpt->endp_addr); + VasEBoot_dprintf ("usb", "CBI reset device - phase error or persistent failure\n"); + VasEBoot_usbms_reset (dev); + VasEBoot_usb_clear_halt (dev->dev, dev->in->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->out->endp_addr); + VasEBoot_usb_clear_halt (dev->dev, dev->intrpt->endp_addr); goto retry; break; } @@ -571,90 +571,90 @@ grub_usbms_transfer_cbi (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, } if (err) - return grub_error (GRUB_ERR_IO, "USB error %d", err); + return VasEBoot_error (VasEBoot_ERR_IO, "USB error %d", err); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf, int read_write) +static VasEBoot_err_t +VasEBoot_usbms_transfer (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, char *buf, int read_write) { - grub_usbms_dev_t dev = (grub_usbms_dev_t) scsi->data; + VasEBoot_usbms_dev_t dev = (VasEBoot_usbms_dev_t) scsi->data; - if (dev->protocol == GRUB_USBMS_PROTOCOL_BULK) - return grub_usbms_transfer_bo (scsi, cmdsize, cmd, size, buf, + if (dev->protocol == VasEBoot_USBMS_PROTOCOL_BULK) + return VasEBoot_usbms_transfer_bo (scsi, cmdsize, cmd, size, buf, read_write); else - return grub_usbms_transfer_cbi (scsi, cmdsize, cmd, size, buf, + return VasEBoot_usbms_transfer_cbi (scsi, cmdsize, cmd, size, buf, read_write); } -static grub_err_t -grub_usbms_read (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_usbms_read (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, char *buf) { - return grub_usbms_transfer (scsi, cmdsize, cmd, size, buf, 0); + return VasEBoot_usbms_transfer (scsi, cmdsize, cmd, size, buf, 0); } -static grub_err_t -grub_usbms_write (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_usbms_write (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, const char *buf) { - return grub_usbms_transfer (scsi, cmdsize, cmd, size, (char *) buf, 1); + return VasEBoot_usbms_transfer (scsi, cmdsize, cmd, size, (char *) buf, 1); } -static grub_err_t -grub_usbms_open (int id, int devnum, struct grub_scsi *scsi) +static VasEBoot_err_t +VasEBoot_usbms_open (int id, int devnum, struct VasEBoot_scsi *scsi) { - if (id != GRUB_SCSI_SUBSYSTEM_USBMS) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + if (id != VasEBoot_SCSI_SUBSYSTEM_USBMS) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not USB Mass Storage device"); - if (!grub_usbms_devices[devnum]) - grub_usb_poll_devices (1); + if (!VasEBoot_usbms_devices[devnum]) + VasEBoot_usb_poll_devices (1); - if (!grub_usbms_devices[devnum]) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + if (!VasEBoot_usbms_devices[devnum]) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "unknown USB Mass Storage device"); - scsi->data = grub_usbms_devices[devnum]; - scsi->luns = grub_usbms_devices[devnum]->luns; + scsi->data = VasEBoot_usbms_devices[devnum]; + scsi->luns = VasEBoot_usbms_devices[devnum]->luns; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_scsi_dev grub_usbms_dev = +static struct VasEBoot_scsi_dev VasEBoot_usbms_dev = { - .iterate = grub_usbms_iterate, - .open = grub_usbms_open, - .read = grub_usbms_read, - .write = grub_usbms_write + .iterate = VasEBoot_usbms_iterate, + .open = VasEBoot_usbms_open, + .read = VasEBoot_usbms_read, + .write = VasEBoot_usbms_write }; -static struct grub_usb_attach_desc attach_hook = +static struct VasEBoot_usb_attach_desc attach_hook = { - .class = GRUB_USB_CLASS_MASS_STORAGE, - .hook = grub_usbms_attach + .class = VasEBoot_USB_CLASS_MASS_STORAGE, + .hook = VasEBoot_usbms_attach }; -GRUB_MOD_INIT(usbms) +VasEBoot_MOD_INIT(usbms) { - grub_usb_register_attach_hook_class (&attach_hook); - grub_scsi_dev_register (&grub_usbms_dev); + VasEBoot_usb_register_attach_hook_class (&attach_hook); + VasEBoot_scsi_dev_register (&VasEBoot_usbms_dev); } -GRUB_MOD_FINI(usbms) +VasEBoot_MOD_FINI(usbms) { unsigned i; - for (i = 0; i < ARRAY_SIZE (grub_usbms_devices); i++) + for (i = 0; i < ARRAY_SIZE (VasEBoot_usbms_devices); i++) { - grub_usbms_devices[i]->dev->config[grub_usbms_devices[i]->config] - .interf[grub_usbms_devices[i]->interface].detach_hook = 0; - grub_usbms_devices[i]->dev->config[grub_usbms_devices[i]->config] - .interf[grub_usbms_devices[i]->interface].attached = 0; + VasEBoot_usbms_devices[i]->dev->config[VasEBoot_usbms_devices[i]->config] + .interf[VasEBoot_usbms_devices[i]->interface].detach_hook = 0; + VasEBoot_usbms_devices[i]->dev->config[VasEBoot_usbms_devices[i]->config] + .interf[VasEBoot_usbms_devices[i]->interface].attached = 0; } - grub_usb_unregister_attach_hook_class (&attach_hook); - grub_scsi_dev_unregister (&grub_usbms_dev); + VasEBoot_usb_unregister_attach_hook_class (&attach_hook); + VasEBoot_scsi_dev_unregister (&VasEBoot_usbms_dev); } diff --git a/VasEBoot-core/disk/xen/xendisk.c b/VasEBoot-core/disk/xen/xendisk.c index b18a9238d..d2b57e771 100644 --- a/VasEBoot-core/disk/xen/xendisk.c +++ b/VasEBoot-core/disk/xen/xendisk.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include struct virtdisk @@ -36,10 +36,10 @@ struct virtdisk char *frontend_dir; struct blkif_sring *shared_page; struct blkif_front_ring ring; - grub_xen_grant_t grant; - grub_xen_evtchn_t evtchn; + VasEBoot_xen_grant_t grant; + VasEBoot_xen_evtchn_t evtchn; void *dma_page; - grub_xen_grant_t dma_grant; + VasEBoot_xen_grant_t dma_grant; struct virtdisk *compat_next; }; @@ -47,16 +47,16 @@ struct virtdisk #define xen_mb() mb() static struct virtdisk *virtdisks; -static grub_size_t vdiskcnt; +static VasEBoot_size_t vdiskcnt; struct virtdisk *compat_head; static int -grub_virtdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_virtdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - grub_size_t i; + VasEBoot_size_t i; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; for (i = 0; i < vdiskcnt; i++) @@ -65,85 +65,85 @@ grub_virtdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_virtdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_virtdisk_open (const char *name, VasEBoot_disk_t disk) { int i; - grub_uint32_t secsize; + VasEBoot_uint32_t secsize; char fdir[200]; char *buf; int num = -1; struct virtdisk *vd; - /* For compatibility with pv-grub legacy menu.lst accept hdX as disk name */ + /* For compatibility with pv-VasEBoot legacy menu.lst accept hdX as disk name */ if (name[0] == 'h' && name[1] == 'd' && name[2]) { - num = grub_strtoul (name + 2, 0, 10); - if (grub_errno) + num = VasEBoot_strtoul (name + 2, 0, 10); + if (VasEBoot_errno) { - grub_errno = 0; + VasEBoot_errno = 0; num = -1; } } for (i = 0, vd = compat_head; vd; vd = vd->compat_next, i++) - if (i == num || grub_strcmp (name, vd->fullname) == 0) + if (i == num || VasEBoot_strcmp (name, vd->fullname) == 0) break; if (!vd) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a virtdisk"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a virtdisk"); disk->data = vd; disk->id = vd - virtdisks; - grub_snprintf (fdir, sizeof (fdir), "%s/sectors", vd->backend_dir); - buf = grub_xenstore_get_file (fdir, NULL); + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/sectors", vd->backend_dir); + buf = VasEBoot_xenstore_get_file (fdir, NULL); if (!buf) - return grub_errno; - disk->total_sectors = grub_strtoull (buf, 0, 10); - if (grub_errno) - return grub_errno; + return VasEBoot_errno; + disk->total_sectors = VasEBoot_strtoull (buf, 0, 10); + if (VasEBoot_errno) + return VasEBoot_errno; - grub_snprintf (fdir, sizeof (fdir), "%s/sector-size", vd->backend_dir); - buf = grub_xenstore_get_file (fdir, NULL); + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/sector-size", vd->backend_dir); + buf = VasEBoot_xenstore_get_file (fdir, NULL); if (!buf) - return grub_errno; - secsize = grub_strtoull (buf, 0, 10); - if (grub_errno) - return grub_errno; + return VasEBoot_errno; + secsize = VasEBoot_strtoull (buf, 0, 10); + if (VasEBoot_errno) + return VasEBoot_errno; if ((secsize & (secsize - 1)) || !secsize || secsize < 512 - || secsize > GRUB_XEN_PAGE_SIZE) - return grub_error (GRUB_ERR_IO, "unsupported sector size %d", secsize); + || secsize > VasEBoot_XEN_PAGE_SIZE) + return VasEBoot_error (VasEBoot_ERR_IO, "unsupported sector size %d", secsize); for (disk->log_sector_size = 0; (1U << disk->log_sector_size) < secsize; disk->log_sector_size++); disk->total_sectors >>= disk->log_sector_size - 9; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_virtdisk_close (grub_disk_t disk __attribute__ ((unused))) +VasEBoot_virtdisk_close (VasEBoot_disk_t disk __attribute__ ((unused))) { } -static grub_err_t -grub_virtdisk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_virtdisk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { struct virtdisk *data = disk->data; while (size) { - grub_size_t cur; + VasEBoot_size_t cur; struct blkif_request *req; struct blkif_response *resp; int sta = 0; struct evtchn_send send; cur = size; - if (cur > (unsigned) (GRUB_XEN_PAGE_SIZE >> disk->log_sector_size)) - cur = GRUB_XEN_PAGE_SIZE >> disk->log_sector_size; + if (cur > (unsigned) (VasEBoot_XEN_PAGE_SIZE >> disk->log_sector_size)) + cur = VasEBoot_XEN_PAGE_SIZE >> disk->log_sector_size; while (RING_FULL (&data->ring)) - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); req = RING_GET_REQUEST (&data->ring, data->ring.req_prod_pvt); req->operation = BLKIF_OP_READ; req->nr_segments = 1; @@ -157,11 +157,11 @@ grub_virtdisk_read (grub_disk_t disk, grub_disk_addr_t sector, RING_PUSH_REQUESTS (&data->ring); mb (); send.port = data->evtchn; - grub_xen_event_channel_op (EVTCHNOP_send, &send); + VasEBoot_xen_event_channel_op (EVTCHNOP_send, &send); while (!RING_HAS_UNCONSUMED_RESPONSES (&data->ring)) { - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); mb (); } while (1) @@ -176,36 +176,36 @@ grub_virtdisk_read (grub_disk_t disk, grub_disk_addr_t sector, sta = resp->status; } if (sta) - return grub_error (GRUB_ERR_IO, "read failed"); - grub_memcpy (buf, data->dma_page, cur << disk->log_sector_size); + return VasEBoot_error (VasEBoot_ERR_IO, "read failed"); + VasEBoot_memcpy (buf, data->dma_page, cur << disk->log_sector_size); size -= cur; sector += cur; buf += cur << disk->log_sector_size; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_virtdisk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_virtdisk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { struct virtdisk *data = disk->data; while (size) { - grub_size_t cur; + VasEBoot_size_t cur; struct blkif_request *req; struct blkif_response *resp; int sta = 0; struct evtchn_send send; cur = size; - if (cur > (unsigned) (GRUB_XEN_PAGE_SIZE >> disk->log_sector_size)) - cur = GRUB_XEN_PAGE_SIZE >> disk->log_sector_size; + if (cur > (unsigned) (VasEBoot_XEN_PAGE_SIZE >> disk->log_sector_size)) + cur = VasEBoot_XEN_PAGE_SIZE >> disk->log_sector_size; - grub_memcpy (data->dma_page, buf, cur << disk->log_sector_size); + VasEBoot_memcpy (data->dma_page, buf, cur << disk->log_sector_size); while (RING_FULL (&data->ring)) - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); req = RING_GET_REQUEST (&data->ring, data->ring.req_prod_pvt); req->operation = BLKIF_OP_WRITE; req->nr_segments = 1; @@ -219,11 +219,11 @@ grub_virtdisk_write (grub_disk_t disk, grub_disk_addr_t sector, RING_PUSH_REQUESTS (&data->ring); mb (); send.port = data->evtchn; - grub_xen_event_channel_op (EVTCHNOP_send, &send); + VasEBoot_xen_event_channel_op (EVTCHNOP_send, &send); while (!RING_HAS_UNCONSUMED_RESPONSES (&data->ring)) { - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); mb (); } while (1) @@ -238,29 +238,29 @@ grub_virtdisk_write (grub_disk_t disk, grub_disk_addr_t sector, sta = resp->status; } if (sta) - return grub_error (GRUB_ERR_IO, "write failed"); + return VasEBoot_error (VasEBoot_ERR_IO, "write failed"); size -= cur; sector += cur; buf += cur << disk->log_sector_size; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_disk_dev grub_virtdisk_dev = { +static struct VasEBoot_disk_dev VasEBoot_virtdisk_dev = { .name = "xen", - .id = GRUB_DISK_DEVICE_XEN, - .iterate = grub_virtdisk_iterate, - .open = grub_virtdisk_open, - .close = grub_virtdisk_close, - .read = grub_virtdisk_read, - .write = grub_virtdisk_write, + .id = VasEBoot_DISK_DEVICE_XEN, + .iterate = VasEBoot_virtdisk_iterate, + .open = VasEBoot_virtdisk_open, + .close = VasEBoot_virtdisk_close, + .read = VasEBoot_virtdisk_read, + .write = VasEBoot_virtdisk_write, .next = 0 }; static int count (const char *dir __attribute__ ((unused)), void *data) { - grub_size_t *ctr = data; + VasEBoot_size_t *ctr = data; (*ctr)++; return 0; @@ -269,12 +269,12 @@ count (const char *dir __attribute__ ((unused)), void *data) static int fill (const char *dir, void *data) { - grub_size_t *ctr = data; + VasEBoot_size_t *ctr = data; domid_t dom; /* "dir" is just a number, at most 19 characters. */ char fdir[200]; char num[20]; - grub_err_t err; + VasEBoot_err_t err; void *buf; struct evtchn_alloc_unbound alloc_unbound; struct virtdisk **prev = &compat_head, *vd = compat_head; @@ -282,113 +282,113 @@ fill (const char *dir, void *data) /* Shouldn't happen unles some hotplug happened. */ if (vdiskcnt >= *ctr) return 1; - virtdisks[vdiskcnt].handle = grub_strtoul (dir, 0, 10); - if (grub_errno) + virtdisks[vdiskcnt].handle = VasEBoot_strtoul (dir, 0, 10); + if (VasEBoot_errno) { - grub_errno = 0; + VasEBoot_errno = 0; return 0; } virtdisks[vdiskcnt].fullname = 0; virtdisks[vdiskcnt].backend_dir = 0; - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s/backend", dir); - virtdisks[vdiskcnt].backend_dir = grub_xenstore_get_file (fdir, NULL); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s/backend", dir); + virtdisks[vdiskcnt].backend_dir = VasEBoot_xenstore_get_file (fdir, NULL); if (!virtdisks[vdiskcnt].backend_dir) goto out_fail_1; - grub_snprintf (fdir, sizeof (fdir), "%s/dev", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/dev", virtdisks[vdiskcnt].backend_dir); - buf = grub_xenstore_get_file (fdir, NULL); + buf = VasEBoot_xenstore_get_file (fdir, NULL); if (!buf) { - grub_errno = 0; - virtdisks[vdiskcnt].fullname = grub_xasprintf ("xenid/%s", dir); + VasEBoot_errno = 0; + virtdisks[vdiskcnt].fullname = VasEBoot_xasprintf ("xenid/%s", dir); } else { - virtdisks[vdiskcnt].fullname = grub_xasprintf ("xen/%s", (char *) buf); - grub_free (buf); + virtdisks[vdiskcnt].fullname = VasEBoot_xasprintf ("xen/%s", (char *) buf); + VasEBoot_free (buf); } if (!virtdisks[vdiskcnt].fullname) goto out_fail_1; - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s/backend-id", dir); - buf = grub_xenstore_get_file (fdir, NULL); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s/backend-id", dir); + buf = VasEBoot_xenstore_get_file (fdir, NULL); if (!buf) goto out_fail_1; - dom = grub_strtoul (buf, 0, 10); - grub_free (buf); - if (grub_errno) + dom = VasEBoot_strtoul (buf, 0, 10); + VasEBoot_free (buf); + if (VasEBoot_errno) goto out_fail_1; virtdisks[vdiskcnt].shared_page = - grub_xen_alloc_shared_page (dom, &virtdisks[vdiskcnt].grant); + VasEBoot_xen_alloc_shared_page (dom, &virtdisks[vdiskcnt].grant); if (!virtdisks[vdiskcnt].shared_page) goto out_fail_1; virtdisks[vdiskcnt].dma_page = - grub_xen_alloc_shared_page (dom, &virtdisks[vdiskcnt].dma_grant); + VasEBoot_xen_alloc_shared_page (dom, &virtdisks[vdiskcnt].dma_grant); if (!virtdisks[vdiskcnt].dma_page) goto out_fail_2; alloc_unbound.dom = DOMID_SELF; alloc_unbound.remote_dom = dom; - grub_xen_event_channel_op (EVTCHNOP_alloc_unbound, &alloc_unbound); + VasEBoot_xen_event_channel_op (EVTCHNOP_alloc_unbound, &alloc_unbound); virtdisks[vdiskcnt].evtchn = alloc_unbound.port; SHARED_RING_INIT (virtdisks[vdiskcnt].shared_page); FRONT_RING_INIT (&virtdisks[vdiskcnt].ring, virtdisks[vdiskcnt].shared_page, - GRUB_XEN_PAGE_SIZE); + VasEBoot_XEN_PAGE_SIZE); - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s/ring-ref", dir); - grub_snprintf (num, sizeof (num), "%u", virtdisks[vdiskcnt].grant); - err = grub_xenstore_write_file (fdir, num, grub_strlen (num)); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s/ring-ref", dir); + VasEBoot_snprintf (num, sizeof (num), "%u", virtdisks[vdiskcnt].grant); + err = VasEBoot_xenstore_write_file (fdir, num, VasEBoot_strlen (num)); if (err) goto out_fail_3; - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s/event-channel", dir); - grub_snprintf (num, sizeof (num), "%u", virtdisks[vdiskcnt].evtchn); - err = grub_xenstore_write_file (fdir, num, grub_strlen (num)); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s/event-channel", dir); + VasEBoot_snprintf (num, sizeof (num), "%u", virtdisks[vdiskcnt].evtchn); + err = VasEBoot_xenstore_write_file (fdir, num, VasEBoot_strlen (num)); if (err) goto out_fail_3; - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s/protocol", dir); - err = grub_xenstore_write_file (fdir, XEN_IO_PROTO_ABI_NATIVE, - grub_strlen (XEN_IO_PROTO_ABI_NATIVE)); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s/protocol", dir); + err = VasEBoot_xenstore_write_file (fdir, XEN_IO_PROTO_ABI_NATIVE, + VasEBoot_strlen (XEN_IO_PROTO_ABI_NATIVE)); if (err) goto out_fail_3; struct gnttab_dump_table dt; dt.dom = DOMID_SELF; - grub_xen_grant_table_op (GNTTABOP_dump_table, (void *) &dt, 1); + VasEBoot_xen_grant_table_op (GNTTABOP_dump_table, (void *) &dt, 1); - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s/state", dir); - err = grub_xenstore_write_file (fdir, "3", 1); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s/state", dir); + err = VasEBoot_xenstore_write_file (fdir, "3", 1); if (err) goto out_fail_3; while (1) { - grub_snprintf (fdir, sizeof (fdir), "%s/state", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/state", virtdisks[vdiskcnt].backend_dir); - buf = grub_xenstore_get_file (fdir, NULL); + buf = VasEBoot_xenstore_get_file (fdir, NULL); if (!buf) goto out_fail_3; - if (grub_strcmp (buf, "2") != 0) + if (VasEBoot_strcmp (buf, "2") != 0) break; - grub_free (buf); - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_free (buf); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); } - grub_dprintf ("xen", "state=%s\n", (char *) buf); - grub_free (buf); + VasEBoot_dprintf ("xen", "state=%s\n", (char *) buf); + VasEBoot_free (buf); - grub_snprintf (fdir, sizeof (fdir), "device/vbd/%s", dir); + VasEBoot_snprintf (fdir, sizeof (fdir), "device/vbd/%s", dir); - virtdisks[vdiskcnt].frontend_dir = grub_strdup (fdir); + virtdisks[vdiskcnt].frontend_dir = VasEBoot_strdup (fdir); - /* For compatibility with pv-grub maintain linked list sorted by handle + /* For compatibility with pv-VasEBoot maintain linked list sorted by handle value in increasing order. This allows mapping of (hdX) disk names from legacy menu.lst */ while (vd) @@ -405,38 +405,38 @@ fill (const char *dir, void *data) return 0; out_fail_3: - grub_xen_free_shared_page (virtdisks[vdiskcnt].dma_page); + VasEBoot_xen_free_shared_page (virtdisks[vdiskcnt].dma_page); out_fail_2: - grub_xen_free_shared_page (virtdisks[vdiskcnt].shared_page); + VasEBoot_xen_free_shared_page (virtdisks[vdiskcnt].shared_page); out_fail_1: - grub_free (virtdisks[vdiskcnt].backend_dir); - grub_free (virtdisks[vdiskcnt].fullname); + VasEBoot_free (virtdisks[vdiskcnt].backend_dir); + VasEBoot_free (virtdisks[vdiskcnt].fullname); - grub_errno = 0; + VasEBoot_errno = 0; return 0; } void -grub_xendisk_init (void) +VasEBoot_xendisk_init (void) { - grub_size_t ctr = 0; - if (grub_xenstore_dir ("device/vbd", count, &ctr)) - grub_errno = 0; + VasEBoot_size_t ctr = 0; + if (VasEBoot_xenstore_dir ("device/vbd", count, &ctr)) + VasEBoot_errno = 0; if (!ctr) return; - virtdisks = grub_malloc (ctr * sizeof (virtdisks[0])); + virtdisks = VasEBoot_malloc (ctr * sizeof (virtdisks[0])); if (!virtdisks) return; - if (grub_xenstore_dir ("device/vbd", fill, &ctr)) - grub_errno = 0; + if (VasEBoot_xenstore_dir ("device/vbd", fill, &ctr)) + VasEBoot_errno = 0; - grub_disk_dev_register (&grub_virtdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_virtdisk_dev); } void -grub_xendisk_fini (void) +VasEBoot_xendisk_fini (void) { char fdir[200]; unsigned i; @@ -446,40 +446,40 @@ grub_xendisk_fini (void) char *buf; struct evtchn_close close_op = {.port = virtdisks[i].evtchn }; - grub_snprintf (fdir, sizeof (fdir), "%s/state", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/state", virtdisks[i].frontend_dir); - grub_xenstore_write_file (fdir, "6", 1); + VasEBoot_xenstore_write_file (fdir, "6", 1); while (1) { - grub_snprintf (fdir, sizeof (fdir), "%s/state", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/state", virtdisks[i].backend_dir); - buf = grub_xenstore_get_file (fdir, NULL); - grub_dprintf ("xen", "state=%s\n", (char *) buf); + buf = VasEBoot_xenstore_get_file (fdir, NULL); + VasEBoot_dprintf ("xen", "state=%s\n", (char *) buf); - if (!buf || grub_strcmp (buf, "6") == 0) + if (!buf || VasEBoot_strcmp (buf, "6") == 0) break; - grub_free (buf); - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_free (buf); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); } - grub_free (buf); + VasEBoot_free (buf); - grub_snprintf (fdir, sizeof (fdir), "%s/ring-ref", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/ring-ref", virtdisks[i].frontend_dir); - grub_xenstore_write_file (fdir, NULL, 0); + VasEBoot_xenstore_write_file (fdir, NULL, 0); - grub_snprintf (fdir, sizeof (fdir), "%s/event-channel", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/event-channel", virtdisks[i].frontend_dir); - grub_xenstore_write_file (fdir, NULL, 0); + VasEBoot_xenstore_write_file (fdir, NULL, 0); - grub_xen_free_shared_page (virtdisks[i].dma_page); - grub_xen_free_shared_page (virtdisks[i].shared_page); + VasEBoot_xen_free_shared_page (virtdisks[i].dma_page); + VasEBoot_xen_free_shared_page (virtdisks[i].shared_page); - grub_xen_event_channel_op (EVTCHNOP_close, &close_op); + VasEBoot_xen_event_channel_op (EVTCHNOP_close, &close_op); /* Prepare for handoff. */ - grub_snprintf (fdir, sizeof (fdir), "%s/state", + VasEBoot_snprintf (fdir, sizeof (fdir), "%s/state", virtdisks[i].frontend_dir); - grub_xenstore_write_file (fdir, "1", 1); + VasEBoot_xenstore_write_file (fdir, "1", 1); } } diff --git a/VasEBoot-core/efiemu/i386/coredetect.c b/VasEBoot-core/efiemu/i386/coredetect.c index a262b5328..7f3f33ac5 100644 --- a/VasEBoot-core/efiemu/i386/coredetect.c +++ b/VasEBoot-core/efiemu/i386/coredetect.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include const char * -grub_efiemu_get_default_core_name (void) +VasEBoot_efiemu_get_default_core_name (void) { - return grub_cpuid_has_longmode ? "efiemu64.o" : "efiemu32.o"; + return VasEBoot_cpuid_has_longmode ? "efiemu64.o" : "efiemu32.o"; } diff --git a/VasEBoot-core/efiemu/i386/loadcore32.c b/VasEBoot-core/efiemu/i386/loadcore32.c index e746df8df..84613362b 100644 --- a/VasEBoot-core/efiemu/i386/loadcore32.c +++ b/VasEBoot-core/efiemu/i386/loadcore32.c @@ -1,33 +1,33 @@ /* i386 CPU-specific part of loadcore.c for 32-bit mode */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* Check if EHDR is a valid ELF header. */ int -grub_arch_efiemu_check_header32 (void *ehdr) +VasEBoot_arch_efiemu_check_header32 (void *ehdr) { Elf32_Ehdr *e = ehdr; @@ -38,17 +38,17 @@ grub_arch_efiemu_check_header32 (void *ehdr) } /* Relocate symbols. */ -grub_err_t -grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, - struct grub_efiemu_elf_sym *elfsyms, +VasEBoot_err_t +VasEBoot_arch_efiemu_relocate_symbols32 (VasEBoot_efiemu_segment_t segs, + struct VasEBoot_efiemu_elf_sym *elfsyms, void *ehdr) { unsigned i; Elf32_Ehdr *e = ehdr; Elf32_Shdr *s; - grub_err_t err; + VasEBoot_err_t err; - grub_dprintf ("efiemu", "relocating symbols %d %d\n", + VasEBoot_dprintf ("efiemu", "relocating symbols %d %d\n", e->e_shoff, e->e_shnum); for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); @@ -56,8 +56,8 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_REL) { - grub_efiemu_segment_t seg; - grub_dprintf ("efiemu", "shtrel\n"); + VasEBoot_efiemu_segment_t seg; + VasEBoot_dprintf ("efiemu", "shtrel\n"); /* Find the target segment. */ for (seg = segs; seg; seg = seg->next) @@ -74,40 +74,40 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, rel++) { Elf32_Word *addr; - struct grub_efiemu_elf_sym sym; + struct VasEBoot_efiemu_elf_sym sym; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); addr = (Elf32_Word *) - ((char *) grub_efiemu_mm_obtain_request (seg->handle) + ((char *) VasEBoot_efiemu_mm_obtain_request (seg->handle) + seg->off + rel->r_offset); sym = elfsyms[ELF32_R_SYM (rel->r_info)]; switch (ELF32_R_TYPE (rel->r_info)) { case R_386_32: - err = grub_efiemu_write_value (addr, sym.off + *addr, + err = VasEBoot_efiemu_write_value (addr, sym.off + *addr, sym.handle, 0, seg->ptv_rel_needed, - sizeof (grub_uint32_t)); + sizeof (VasEBoot_uint32_t)); if (err) return err; break; case R_386_PC32: - err = grub_efiemu_write_value (addr, sym.off + *addr + err = VasEBoot_efiemu_write_value (addr, sym.off + *addr - rel->r_offset - seg->off, sym.handle, seg->handle, seg->ptv_rel_needed, - sizeof (grub_uint32_t)); + sizeof (VasEBoot_uint32_t)); if (err) return err; break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } @@ -115,7 +115,7 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/i386/loadcore64.c b/VasEBoot-core/efiemu/i386/loadcore64.c index 18facf47f..a647dda6b 100644 --- a/VasEBoot-core/efiemu/i386/loadcore64.c +++ b/VasEBoot-core/efiemu/i386/loadcore64.c @@ -1,33 +1,33 @@ /* i386 CPU-specific part of loadcore.c for 32-bit mode */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* Check if EHDR is a valid ELF header. */ int -grub_arch_efiemu_check_header64 (void *ehdr) +VasEBoot_arch_efiemu_check_header64 (void *ehdr) { Elf64_Ehdr *e = ehdr; @@ -37,23 +37,23 @@ grub_arch_efiemu_check_header64 (void *ehdr) } /* Relocate symbols. */ -grub_err_t -grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, - struct grub_efiemu_elf_sym *elfsyms, +VasEBoot_err_t +VasEBoot_arch_efiemu_relocate_symbols64 (VasEBoot_efiemu_segment_t segs, + struct VasEBoot_efiemu_elf_sym *elfsyms, void *ehdr) { unsigned i; Elf64_Ehdr *e = ehdr; Elf64_Shdr *s; - grub_err_t err; + VasEBoot_err_t err; for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_RELA) { - grub_efiemu_segment_t seg; - grub_dprintf ("efiemu", "shtrel\n"); + VasEBoot_efiemu_segment_t seg; + VasEBoot_dprintf ("efiemu", "shtrel\n"); /* Find the target segment. */ for (seg = segs; seg; seg = seg->next) @@ -71,57 +71,57 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, rel++) { void *addr; - grub_uint32_t *addr32; - grub_uint64_t *addr64; - struct grub_efiemu_elf_sym sym; + VasEBoot_uint32_t *addr32; + VasEBoot_uint64_t *addr64; + struct VasEBoot_efiemu_elf_sym sym; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); addr = - ((char *) grub_efiemu_mm_obtain_request (seg->handle) + ((char *) VasEBoot_efiemu_mm_obtain_request (seg->handle) + seg->off + rel->r_offset); - addr32 = (grub_uint32_t *) addr; - addr64 = (grub_uint64_t *) addr; + addr32 = (VasEBoot_uint32_t *) addr; + addr64 = (VasEBoot_uint64_t *) addr; sym = elfsyms[ELF64_R_SYM (rel->r_info)]; switch (ELF64_R_TYPE (rel->r_info)) { case R_X86_64_64: - err = grub_efiemu_write_value (addr, + err = VasEBoot_efiemu_write_value (addr, *addr64 + rel->r_addend + sym.off, sym.handle, 0, seg->ptv_rel_needed, - sizeof (grub_uint64_t)); + sizeof (VasEBoot_uint64_t)); if (err) return err; break; case R_X86_64_PC32: case R_X86_64_PLT32: - err = grub_efiemu_write_value (addr, + err = VasEBoot_efiemu_write_value (addr, *addr32 + rel->r_addend + sym.off - rel->r_offset - seg->off, sym.handle, seg->handle, seg->ptv_rel_needed, - sizeof (grub_uint32_t)); + sizeof (VasEBoot_uint32_t)); if (err) return err; break; case R_X86_64_32: case R_X86_64_32S: - err = grub_efiemu_write_value (addr, + err = VasEBoot_efiemu_write_value (addr, *addr32 + rel->r_addend + sym.off, sym.handle, 0, seg->ptv_rel_needed, - sizeof (grub_uint32_t)); + sizeof (VasEBoot_uint32_t)); if (err) return err; break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } @@ -129,5 +129,5 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/i386/nocfgtables.c b/VasEBoot-core/efiemu/i386/nocfgtables.c index 775f1d03a..12df5e706 100644 --- a/VasEBoot-core/efiemu/i386/nocfgtables.c +++ b/VasEBoot-core/efiemu/i386/nocfgtables.c @@ -1,30 +1,30 @@ /* Register SMBIOS and ACPI tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -grub_err_t -grub_machine_efiemu_init_tables (void) +VasEBoot_err_t +VasEBoot_machine_efiemu_init_tables (void) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/i386/pc/cfgtables.c b/VasEBoot-core/efiemu/i386/pc/cfgtables.c index 1d8833115..c1f9c89f7 100644 --- a/VasEBoot-core/efiemu/i386/pc/cfgtables.c +++ b/VasEBoot-core/efiemu/i386/pc/cfgtables.c @@ -1,80 +1,80 @@ /* Register SMBIOS and ACPI tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -grub_err_t -grub_machine_efiemu_init_tables (void) +VasEBoot_err_t +VasEBoot_machine_efiemu_init_tables (void) { void *table; - grub_err_t err; - grub_efi_guid_t smbios = GRUB_EFI_SMBIOS_TABLE_GUID; - grub_efi_guid_t smbios3 = GRUB_EFI_SMBIOS3_TABLE_GUID; - grub_efi_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID; - grub_efi_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID; + VasEBoot_err_t err; + VasEBoot_efi_guid_t smbios = VasEBoot_EFI_SMBIOS_TABLE_GUID; + VasEBoot_efi_guid_t smbios3 = VasEBoot_EFI_SMBIOS3_TABLE_GUID; + VasEBoot_efi_guid_t acpi20 = VasEBoot_EFI_ACPI_20_TABLE_GUID; + VasEBoot_efi_guid_t acpi = VasEBoot_EFI_ACPI_TABLE_GUID; - err = grub_efiemu_unregister_configuration_table (smbios); + err = VasEBoot_efiemu_unregister_configuration_table (smbios); if (err) return err; - err = grub_efiemu_unregister_configuration_table (smbios3); + err = VasEBoot_efiemu_unregister_configuration_table (smbios3); if (err) return err; - err = grub_efiemu_unregister_configuration_table (acpi); + err = VasEBoot_efiemu_unregister_configuration_table (acpi); if (err) return err; - err = grub_efiemu_unregister_configuration_table (acpi20); + err = VasEBoot_efiemu_unregister_configuration_table (acpi20); if (err) return err; - table = grub_smbios_get_eps (); + table = VasEBoot_smbios_get_eps (); if (table) { - err = grub_efiemu_register_configuration_table (smbios, 0, 0, table); + err = VasEBoot_efiemu_register_configuration_table (smbios, 0, 0, table); if (err) return err; } - table = grub_smbios_get_eps3 (); + table = VasEBoot_smbios_get_eps3 (); if (table) { - err = grub_efiemu_register_configuration_table (smbios3, 0, 0, table); + err = VasEBoot_efiemu_register_configuration_table (smbios3, 0, 0, table); if (err) return err; } - table = grub_acpi_get_rsdpv1 (); + table = VasEBoot_acpi_get_rsdpv1 (); if (table) { - err = grub_efiemu_register_configuration_table (acpi, 0, 0, table); + err = VasEBoot_efiemu_register_configuration_table (acpi, 0, 0, table); if (err) return err; } - table = grub_acpi_get_rsdpv2 (); + table = VasEBoot_acpi_get_rsdpv2 (); if (table) { - err = grub_efiemu_register_configuration_table (acpi20, 0, 0, table); + err = VasEBoot_efiemu_register_configuration_table (acpi20, 0, 0, table); if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/loadcore.c b/VasEBoot-core/efiemu/loadcore.c index 44085ef81..c2f65cc97 100644 --- a/VasEBoot-core/efiemu/loadcore.c +++ b/VasEBoot-core/efiemu/loadcore.c @@ -1,63 +1,63 @@ /* Load runtime image of EFIemu. Functions specific to 32/64-bit mode */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* ELF symbols and their values */ -static struct grub_efiemu_elf_sym *grub_efiemu_elfsyms = 0; -static int grub_efiemu_nelfsyms = 0; +static struct VasEBoot_efiemu_elf_sym *VasEBoot_efiemu_elfsyms = 0; +static int VasEBoot_efiemu_nelfsyms = 0; /* Return the address of a section whose index is N. */ -static grub_err_t -grub_efiemu_get_section_addr (grub_efiemu_segment_t segs, unsigned n, - int *handle, grub_off_t *off) +static VasEBoot_err_t +VasEBoot_efiemu_get_section_addr (VasEBoot_efiemu_segment_t segs, unsigned n, + int *handle, VasEBoot_off_t *off) { - grub_efiemu_segment_t seg; + VasEBoot_efiemu_segment_t seg; for (seg = segs; seg; seg = seg->next) if (seg->section == n) { *handle = seg->handle; *off = seg->off; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_BAD_OS, "section %d not found", n); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "section %d not found", n); } -grub_err_t -SUFFIX (grub_efiemu_loadcore_unload) (void) +VasEBoot_err_t +SUFFIX (VasEBoot_efiemu_loadcore_unload) (void) { - grub_free (grub_efiemu_elfsyms); - grub_efiemu_elfsyms = 0; - return GRUB_ERR_NONE; + VasEBoot_free (VasEBoot_efiemu_elfsyms); + VasEBoot_efiemu_elfsyms = 0; + return VasEBoot_ERR_NONE; } /* Check if EHDR is a valid ELF header. */ int -SUFFIX (grub_efiemu_check_header) (void *ehdr, grub_size_t size) +SUFFIX (VasEBoot_efiemu_check_header) (void *ehdr, VasEBoot_size_t size) { Elf_Ehdr *e = ehdr; @@ -66,7 +66,7 @@ SUFFIX (grub_efiemu_check_header) (void *ehdr, grub_size_t size) return 0; /* Check the magic numbers. */ - if (!SUFFIX (grub_arch_efiemu_check_header) (ehdr) + if (!SUFFIX (VasEBoot_arch_efiemu_check_header) (ehdr) || e->e_ident[EI_MAG0] != ELFMAG0 || e->e_ident[EI_MAG1] != ELFMAG1 || e->e_ident[EI_MAG2] != ELFMAG2 @@ -79,13 +79,13 @@ SUFFIX (grub_efiemu_check_header) (void *ehdr, grub_size_t size) } /* Load all segments from memory specified by E. */ -static grub_err_t -grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_efiemu_load_segments (VasEBoot_efiemu_segment_t segs, const Elf_Ehdr *e) { Elf_Shdr *s; - grub_efiemu_segment_t cur; + VasEBoot_efiemu_segment_t cur; - grub_dprintf ("efiemu", "loading segments\n"); + VasEBoot_dprintf ("efiemu", "loading segments\n"); for (cur=segs; cur; cur = cur->next) { @@ -95,27 +95,27 @@ grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e) { void *addr; - addr = (grub_uint8_t *) grub_efiemu_mm_obtain_request (cur->handle) + addr = (VasEBoot_uint8_t *) VasEBoot_efiemu_mm_obtain_request (cur->handle) + cur->off; switch (s->sh_type) { case SHT_PROGBITS: - grub_memcpy (addr, (char *) e + s->sh_offset, s->sh_size); + VasEBoot_memcpy (addr, (char *) e + s->sh_offset, s->sh_size); break; case SHT_NOBITS: - grub_memset (addr, 0, s->sh_size); + VasEBoot_memset (addr, 0, s->sh_size); break; } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Get a string at offset OFFSET from strtab */ static char * -grub_efiemu_get_string (unsigned offset, const Elf_Ehdr *e) +VasEBoot_efiemu_get_string (unsigned offset, const Elf_Ehdr *e) { unsigned i; Elf_Shdr *s; @@ -129,8 +129,8 @@ grub_efiemu_get_string (unsigned offset, const Elf_Ehdr *e) } /* Request memory for segments and fill segments info */ -static grub_err_t -grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_efiemu_init_segments (VasEBoot_efiemu_segment_t *segs, const Elf_Ehdr *e) { unsigned i; Elf_Shdr *s; @@ -141,22 +141,22 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) { if (s->sh_flags & SHF_ALLOC) { - grub_efiemu_segment_t seg; - seg = (grub_efiemu_segment_t) grub_malloc (sizeof (*seg)); + VasEBoot_efiemu_segment_t seg; + seg = (VasEBoot_efiemu_segment_t) VasEBoot_malloc (sizeof (*seg)); if (! seg) - return grub_errno; + return VasEBoot_errno; if (s->sh_size) { seg->handle - = grub_efiemu_request_memalign + = VasEBoot_efiemu_request_memalign (s->sh_addralign, s->sh_size, - s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE - : GRUB_EFI_RUNTIME_SERVICES_DATA); + s->sh_flags & SHF_EXECINSTR ? VasEBoot_EFI_RUNTIME_SERVICES_CODE + : VasEBoot_EFI_RUNTIME_SERVICES_DATA); if (seg->handle < 0) { - grub_free (seg); - return grub_errno; + VasEBoot_free (seg); + return VasEBoot_errno; } seg->off = 0; } @@ -165,7 +165,7 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) .text-physical doesn't need to be relocated when switching to virtual mode */ - if (!grub_strcmp (grub_efiemu_get_string (s->sh_name, e), + if (!VasEBoot_strcmp (VasEBoot_efiemu_get_string (s->sh_name, e), ".text-physical")) seg->ptv_rel_needed = 0; else @@ -178,12 +178,12 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Count symbols and relocators and allocate/request memory for them */ -static grub_err_t -grub_efiemu_count_symbols (const Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_efiemu_count_symbols (const Elf_Ehdr *e) { unsigned i; Elf_Shdr *s; @@ -197,11 +197,11 @@ grub_efiemu_count_symbols (const Elf_Ehdr *e) break; if (i == e->e_shnum) - return grub_error (GRUB_ERR_BAD_OS, N_("no symbol table")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("no symbol table")); - grub_efiemu_nelfsyms = (unsigned) s->sh_size / (unsigned) s->sh_entsize; - grub_efiemu_elfsyms = (struct grub_efiemu_elf_sym *) - grub_malloc (sizeof (struct grub_efiemu_elf_sym) * grub_efiemu_nelfsyms); + VasEBoot_efiemu_nelfsyms = (unsigned) s->sh_size / (unsigned) s->sh_entsize; + VasEBoot_efiemu_elfsyms = (struct VasEBoot_efiemu_elf_sym *) + VasEBoot_malloc (sizeof (struct VasEBoot_efiemu_elf_sym) * VasEBoot_efiemu_nelfsyms); /* Relocators */ for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); @@ -210,14 +210,14 @@ grub_efiemu_count_symbols (const Elf_Ehdr *e) if (s->sh_type == SHT_REL || s->sh_type == SHT_RELA) num += ((unsigned) s->sh_size) / ((unsigned) s->sh_entsize); - grub_efiemu_request_symbols (num); + VasEBoot_efiemu_request_symbols (num); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Fill grub_efiemu_elfsyms with symbol values */ -static grub_err_t -grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) +/* Fill VasEBoot_efiemu_elfsyms with symbol values */ +static VasEBoot_err_t +VasEBoot_efiemu_resolve_symbols (VasEBoot_efiemu_segment_t segs, Elf_Ehdr *e) { unsigned i; Elf_Shdr *s; @@ -225,7 +225,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) const char *str; Elf_Word size, entsize; - grub_dprintf ("efiemu", "resolving symbols\n"); + VasEBoot_dprintf ("efiemu", "resolving symbols\n"); for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; @@ -234,7 +234,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) break; if (i == e->e_shnum) - return grub_error (GRUB_ERR_BAD_OS, N_("no symbol table")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("no symbol table")); sym = (Elf_Sym *) ((char *) e + s->sh_offset); size = s->sh_size; @@ -250,28 +250,28 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) unsigned char type = ELF_ST_TYPE (sym->st_info); unsigned char bind = ELF_ST_BIND (sym->st_info); int handle; - grub_off_t off; - grub_err_t err; + VasEBoot_off_t off; + VasEBoot_err_t err; const char *name = str + sym->st_name; - grub_efiemu_elfsyms[i].section = sym->st_shndx; + VasEBoot_efiemu_elfsyms[i].section = sym->st_shndx; switch (type) { case STT_NOTYPE: /* Resolve a global symbol. */ if (sym->st_name != 0 && sym->st_shndx == 0) { - err = grub_efiemu_resolve_symbol (name, &handle, &off); + err = VasEBoot_efiemu_resolve_symbol (name, &handle, &off); if (err) return err; - grub_efiemu_elfsyms[i].handle = handle; - grub_efiemu_elfsyms[i].off = off; + VasEBoot_efiemu_elfsyms[i].handle = handle; + VasEBoot_efiemu_elfsyms[i].off = off; } else sym->st_value = 0; break; case STT_OBJECT: - err = grub_efiemu_get_section_addr (segs, sym->st_shndx, + err = VasEBoot_efiemu_get_section_addr (segs, sym->st_shndx, &handle, &off); if (err) return err; @@ -279,16 +279,16 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) off += sym->st_value; if (bind != STB_LOCAL) { - err = grub_efiemu_register_symbol (name, handle, off); + err = VasEBoot_efiemu_register_symbol (name, handle, off); if (err) return err; } - grub_efiemu_elfsyms[i].handle = handle; - grub_efiemu_elfsyms[i].off = off; + VasEBoot_efiemu_elfsyms[i].handle = handle; + VasEBoot_efiemu_elfsyms[i].off = off; break; case STT_FUNC: - err = grub_efiemu_get_section_addr (segs, sym->st_shndx, + err = VasEBoot_efiemu_get_section_addr (segs, sym->st_shndx, &handle, &off); if (err) return err; @@ -296,92 +296,92 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) off += sym->st_value; if (bind != STB_LOCAL) { - err = grub_efiemu_register_symbol (name, handle, off); + err = VasEBoot_efiemu_register_symbol (name, handle, off); if (err) return err; } - grub_efiemu_elfsyms[i].handle = handle; - grub_efiemu_elfsyms[i].off = off; + VasEBoot_efiemu_elfsyms[i].handle = handle; + VasEBoot_efiemu_elfsyms[i].off = off; break; case STT_SECTION: - err = grub_efiemu_get_section_addr (segs, sym->st_shndx, + err = VasEBoot_efiemu_get_section_addr (segs, sym->st_shndx, &handle, &off); if (err) { - grub_efiemu_elfsyms[i].handle = 0; - grub_efiemu_elfsyms[i].off = 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_efiemu_elfsyms[i].handle = 0; + VasEBoot_efiemu_elfsyms[i].off = 0; + VasEBoot_errno = VasEBoot_ERR_NONE; break; } - grub_efiemu_elfsyms[i].handle = handle; - grub_efiemu_elfsyms[i].off = off; + VasEBoot_efiemu_elfsyms[i].handle = handle; + VasEBoot_efiemu_elfsyms[i].off = off; break; case STT_FILE: - grub_efiemu_elfsyms[i].handle = 0; - grub_efiemu_elfsyms[i].off = 0; + VasEBoot_efiemu_elfsyms[i].handle = 0; + VasEBoot_efiemu_elfsyms[i].off = 0; break; default: - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "unknown symbol type `%d'", (int) type); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Load runtime to the memory and request memory for definitive location*/ -grub_err_t -SUFFIX (grub_efiemu_loadcore_init) (void *core, const char *filename, - grub_size_t core_size, - grub_efiemu_segment_t *segments) +VasEBoot_err_t +SUFFIX (VasEBoot_efiemu_loadcore_init) (void *core, const char *filename, + VasEBoot_size_t core_size, + VasEBoot_efiemu_segment_t *segments) { Elf_Ehdr *e = (Elf_Ehdr *) core; - grub_err_t err; + VasEBoot_err_t err; if (e->e_type != ET_REL) - return grub_error (GRUB_ERR_BAD_MODULE, N_("this ELF file is not of the right type")); + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, N_("this ELF file is not of the right type")); /* Make sure that every section is within the core. */ - if ((grub_size_t) core_size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum) - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if ((VasEBoot_size_t) core_size < e->e_shoff + (VasEBoot_uint32_t) e->e_shentsize * e->e_shnum) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - err = grub_efiemu_init_segments (segments, core); + err = VasEBoot_efiemu_init_segments (segments, core); if (err) return err; - err = grub_efiemu_count_symbols (core); + err = VasEBoot_efiemu_count_symbols (core); if (err) return err; - grub_efiemu_request_symbols (1); - return GRUB_ERR_NONE; + VasEBoot_efiemu_request_symbols (1); + return VasEBoot_ERR_NONE; } /* Load runtime definitively */ -grub_err_t -SUFFIX (grub_efiemu_loadcore_load) (void *core, - grub_size_t core_size +VasEBoot_err_t +SUFFIX (VasEBoot_efiemu_loadcore_load) (void *core, + VasEBoot_size_t core_size __attribute__ ((unused)), - grub_efiemu_segment_t segments) + VasEBoot_efiemu_segment_t segments) { - grub_err_t err; - err = grub_efiemu_load_segments (segments, core); + VasEBoot_err_t err; + err = VasEBoot_efiemu_load_segments (segments, core); if (err) return err; - err = grub_efiemu_resolve_symbols (segments, core); + err = VasEBoot_efiemu_resolve_symbols (segments, core); if (err) return err; - err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, - grub_efiemu_elfsyms, + err = SUFFIX (VasEBoot_arch_efiemu_relocate_symbols) (segments, + VasEBoot_efiemu_elfsyms, core); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/loadcore32.c b/VasEBoot-core/efiemu/loadcore32.c index c1e033b78..49831e094 100644 --- a/VasEBoot-core/efiemu/loadcore32.c +++ b/VasEBoot-core/efiemu/loadcore32.c @@ -1,22 +1,22 @@ /* This file contains definitions so that loadcore.c compiles for 32-bit */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SUFFIX(x) x ## 32 -#define GRUB_TARGET_WORDSIZE 32 +#define VasEBoot_TARGET_WORDSIZE 32 #include "loadcore.c" diff --git a/VasEBoot-core/efiemu/loadcore64.c b/VasEBoot-core/efiemu/loadcore64.c index ce7284fea..a26d58c33 100644 --- a/VasEBoot-core/efiemu/loadcore64.c +++ b/VasEBoot-core/efiemu/loadcore64.c @@ -1,22 +1,22 @@ /* This file contains definitions so that loadcore.c compiles for 64-bit */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SUFFIX(x) x ## 64 -#define GRUB_TARGET_WORDSIZE 64 +#define VasEBoot_TARGET_WORDSIZE 64 #include "loadcore.c" diff --git a/VasEBoot-core/efiemu/loadcore_common.c b/VasEBoot-core/efiemu/loadcore_common.c index 64d79608f..b710654c1 100644 --- a/VasEBoot-core/efiemu/loadcore_common.c +++ b/VasEBoot-core/efiemu/loadcore_common.c @@ -1,196 +1,196 @@ /* Load runtime image of EFIemu. Functions common to 32/64-bit mode */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* Are we in 32 or 64-bit mode?*/ -static grub_efiemu_mode_t grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; +static VasEBoot_efiemu_mode_t VasEBoot_efiemu_mode = VasEBoot_EFIEMU_NOTLOADED; /* Runtime ELF file */ -static grub_ssize_t efiemu_core_size; +static VasEBoot_ssize_t efiemu_core_size; static void *efiemu_core = 0; /* Linked list of segments */ -static grub_efiemu_segment_t efiemu_segments = 0; +static VasEBoot_efiemu_segment_t efiemu_segments = 0; -/* equivalent to sizeof (grub_efi_uintn_t) but taking the mode into account*/ +/* equivalent to sizeof (VasEBoot_efi_uintn_t) but taking the mode into account*/ int -grub_efiemu_sizeof_uintn_t (void) +VasEBoot_efiemu_sizeof_uintn_t (void) { - if (grub_efiemu_mode == GRUB_EFIEMU32) + if (VasEBoot_efiemu_mode == VasEBoot_EFIEMU32) return 4; - if (grub_efiemu_mode == GRUB_EFIEMU64) + if (VasEBoot_efiemu_mode == VasEBoot_EFIEMU64) return 8; return 0; } /* Check the header and set mode */ -static grub_err_t -grub_efiemu_check_header (void *ehdr, grub_size_t size, - grub_efiemu_mode_t *mode) +static VasEBoot_err_t +VasEBoot_efiemu_check_header (void *ehdr, VasEBoot_size_t size, + VasEBoot_efiemu_mode_t *mode) { /* Check the magic numbers. */ - if ((*mode == GRUB_EFIEMU_NOTLOADED || *mode == GRUB_EFIEMU32) - && grub_efiemu_check_header32 (ehdr,size)) + if ((*mode == VasEBoot_EFIEMU_NOTLOADED || *mode == VasEBoot_EFIEMU32) + && VasEBoot_efiemu_check_header32 (ehdr,size)) { - *mode = GRUB_EFIEMU32; - return GRUB_ERR_NONE; + *mode = VasEBoot_EFIEMU32; + return VasEBoot_ERR_NONE; } - if ((*mode == GRUB_EFIEMU_NOTLOADED || *mode == GRUB_EFIEMU64) - && grub_efiemu_check_header64 (ehdr,size)) + if ((*mode == VasEBoot_EFIEMU_NOTLOADED || *mode == VasEBoot_EFIEMU64) + && VasEBoot_efiemu_check_header64 (ehdr,size)) { - *mode = GRUB_EFIEMU64; - return GRUB_ERR_NONE; + *mode = VasEBoot_EFIEMU64; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_BAD_OS, "invalid ELF magic"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid ELF magic"); } /* Unload segments */ static int -grub_efiemu_unload_segs (grub_efiemu_segment_t seg) +VasEBoot_efiemu_unload_segs (VasEBoot_efiemu_segment_t seg) { - grub_efiemu_segment_t segn; + VasEBoot_efiemu_segment_t segn; for (; seg; seg = segn) { segn = seg->next; - grub_efiemu_mm_return_request (seg->handle); - grub_free (seg); + VasEBoot_efiemu_mm_return_request (seg->handle); + VasEBoot_free (seg); } return 1; } -grub_err_t -grub_efiemu_loadcore_unload(void) +VasEBoot_err_t +VasEBoot_efiemu_loadcore_unload(void) { - switch (grub_efiemu_mode) + switch (VasEBoot_efiemu_mode) { - case GRUB_EFIEMU32: - grub_efiemu_loadcore_unload32 (); + case VasEBoot_EFIEMU32: + VasEBoot_efiemu_loadcore_unload32 (); break; - case GRUB_EFIEMU64: - grub_efiemu_loadcore_unload64 (); + case VasEBoot_EFIEMU64: + VasEBoot_efiemu_loadcore_unload64 (); break; default: break; } - grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; + VasEBoot_efiemu_mode = VasEBoot_EFIEMU_NOTLOADED; - grub_free (efiemu_core); + VasEBoot_free (efiemu_core); efiemu_core = 0; - grub_efiemu_unload_segs (efiemu_segments); + VasEBoot_efiemu_unload_segs (efiemu_segments); efiemu_segments = 0; - grub_efiemu_free_syms (); + VasEBoot_efiemu_free_syms (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Load runtime file and do some initial preparations */ -grub_err_t -grub_efiemu_loadcore_init (grub_file_t file, +VasEBoot_err_t +VasEBoot_efiemu_loadcore_init (VasEBoot_file_t file, const char *filename) { - grub_err_t err; + VasEBoot_err_t err; - efiemu_core_size = grub_file_size (file); + efiemu_core_size = VasEBoot_file_size (file); efiemu_core = 0; - efiemu_core = grub_malloc (efiemu_core_size); + efiemu_core = VasEBoot_malloc (efiemu_core_size); if (! efiemu_core) - return grub_errno; + return VasEBoot_errno; - if (grub_file_read (file, efiemu_core, efiemu_core_size) + if (VasEBoot_file_read (file, efiemu_core, efiemu_core_size) != (int) efiemu_core_size) { - grub_free (efiemu_core); + VasEBoot_free (efiemu_core); efiemu_core = 0; - return grub_errno; + return VasEBoot_errno; } - if (grub_efiemu_check_header (efiemu_core, efiemu_core_size, - &grub_efiemu_mode)) + if (VasEBoot_efiemu_check_header (efiemu_core, efiemu_core_size, + &VasEBoot_efiemu_mode)) { - grub_free (efiemu_core); + VasEBoot_free (efiemu_core); efiemu_core = 0; - return GRUB_ERR_BAD_MODULE; + return VasEBoot_ERR_BAD_MODULE; } - switch (grub_efiemu_mode) + switch (VasEBoot_efiemu_mode) { - case GRUB_EFIEMU32: - err = grub_efiemu_loadcore_init32 (efiemu_core, filename, + case VasEBoot_EFIEMU32: + err = VasEBoot_efiemu_loadcore_init32 (efiemu_core, filename, efiemu_core_size, &efiemu_segments); if (err) { - grub_free (efiemu_core); + VasEBoot_free (efiemu_core); efiemu_core = 0; - grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; + VasEBoot_efiemu_mode = VasEBoot_EFIEMU_NOTLOADED; return err; } break; - case GRUB_EFIEMU64: - err = grub_efiemu_loadcore_init64 (efiemu_core, filename, + case VasEBoot_EFIEMU64: + err = VasEBoot_efiemu_loadcore_init64 (efiemu_core, filename, efiemu_core_size, &efiemu_segments); if (err) { - grub_free (efiemu_core); + VasEBoot_free (efiemu_core); efiemu_core = 0; - grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; + VasEBoot_efiemu_mode = VasEBoot_EFIEMU_NOTLOADED; return err; } break; default: - return grub_error (GRUB_ERR_BUG, "unknown EFI runtime"); + return VasEBoot_error (VasEBoot_ERR_BUG, "unknown EFI runtime"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_efiemu_loadcore_load (void) +VasEBoot_err_t +VasEBoot_efiemu_loadcore_load (void) { - grub_err_t err; - switch (grub_efiemu_mode) + VasEBoot_err_t err; + switch (VasEBoot_efiemu_mode) { - case GRUB_EFIEMU32: - err = grub_efiemu_loadcore_load32 (efiemu_core, efiemu_core_size, + case VasEBoot_EFIEMU32: + err = VasEBoot_efiemu_loadcore_load32 (efiemu_core, efiemu_core_size, efiemu_segments); if (err) - grub_efiemu_loadcore_unload (); + VasEBoot_efiemu_loadcore_unload (); return err; - case GRUB_EFIEMU64: - err = grub_efiemu_loadcore_load64 (efiemu_core, efiemu_core_size, + case VasEBoot_EFIEMU64: + err = VasEBoot_efiemu_loadcore_load64 (efiemu_core, efiemu_core_size, efiemu_segments); if (err) - grub_efiemu_loadcore_unload (); + VasEBoot_efiemu_loadcore_unload (); return err; default: - return grub_error (GRUB_ERR_BUG, "unknown EFI runtime"); + return VasEBoot_error (VasEBoot_ERR_BUG, "unknown EFI runtime"); } } diff --git a/VasEBoot-core/efiemu/main.c b/VasEBoot-core/efiemu/main.c index f6813b1ed..5c997bf81 100644 --- a/VasEBoot-core/efiemu/main.c +++ b/VasEBoot-core/efiemu/main.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* This is an emulation of EFI runtime services. @@ -22,43 +22,43 @@ to chainload EFI bootloader on non-EFI system. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* System table. Two version depending on mode */ -grub_efi_system_table32_t *grub_efiemu_system_table32 = 0; -grub_efi_system_table64_t *grub_efiemu_system_table64 = 0; +VasEBoot_efi_system_table32_t *VasEBoot_efiemu_system_table32 = 0; +VasEBoot_efi_system_table64_t *VasEBoot_efiemu_system_table64 = 0; /* Modules may need to execute some actions after memory allocation happens */ -static struct grub_efiemu_prepare_hook *efiemu_prepare_hooks = 0; +static struct VasEBoot_efiemu_prepare_hook *efiemu_prepare_hooks = 0; /* Linked list of configuration tables */ -static struct grub_efiemu_configuration_table *efiemu_config_tables = 0; +static struct VasEBoot_efiemu_configuration_table *efiemu_config_tables = 0; static int prepared = 0; /* Free all allocated space */ -grub_err_t -grub_efiemu_unload (void) +VasEBoot_err_t +VasEBoot_efiemu_unload (void) { - struct grub_efiemu_configuration_table *cur, *d; - struct grub_efiemu_prepare_hook *curhook, *d2; - grub_efiemu_loadcore_unload (); + struct VasEBoot_efiemu_configuration_table *cur, *d; + struct VasEBoot_efiemu_prepare_hook *curhook, *d2; + VasEBoot_efiemu_loadcore_unload (); - grub_efiemu_mm_unload (); + VasEBoot_efiemu_mm_unload (); for (cur = efiemu_config_tables; cur;) { d = cur->next; if (cur->unload) cur->unload (cur->data); - grub_free (cur); + VasEBoot_free (cur); cur = d; } efiemu_config_tables = 0; @@ -68,43 +68,43 @@ grub_efiemu_unload (void) d2 = curhook->next; if (curhook->unload) curhook->unload (curhook->data); - grub_free (curhook); + VasEBoot_free (curhook); curhook = d2; } efiemu_prepare_hooks = 0; prepared = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Remove previously registered table from the list */ -grub_err_t -grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid) +VasEBoot_err_t +VasEBoot_efiemu_unregister_configuration_table (VasEBoot_efi_guid_t guid) { - struct grub_efiemu_configuration_table *cur, *prev; + struct VasEBoot_efiemu_configuration_table *cur, *prev; /* Special treating if head is to remove */ while (efiemu_config_tables - && !grub_memcmp (&(efiemu_config_tables->guid), &guid, sizeof (guid))) + && !VasEBoot_memcmp (&(efiemu_config_tables->guid), &guid, sizeof (guid))) { if (efiemu_config_tables->unload) efiemu_config_tables->unload (efiemu_config_tables->data); cur = efiemu_config_tables->next; - grub_free (efiemu_config_tables); + VasEBoot_free (efiemu_config_tables); efiemu_config_tables = cur; } if (!efiemu_config_tables) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; /* Remove from chain */ for (prev = efiemu_config_tables, cur = prev->next; cur;) - if (grub_memcmp (&(cur->guid), &guid, sizeof (guid)) == 0) + if (VasEBoot_memcmp (&(cur->guid), &guid, sizeof (guid)) == 0) { if (cur->unload) cur->unload (cur->data); prev->next = cur->next; - grub_free (cur); + VasEBoot_free (cur); cur = prev->next; } else @@ -112,45 +112,45 @@ grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid) prev = cur; cur = cur->next; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), +VasEBoot_err_t +VasEBoot_efiemu_register_prepare_hook (VasEBoot_err_t (*hook) (void *data), void (*unload) (void *data), void *data) { - struct grub_efiemu_prepare_hook *nhook; - nhook = (struct grub_efiemu_prepare_hook *) grub_malloc (sizeof (*nhook)); + struct VasEBoot_efiemu_prepare_hook *nhook; + nhook = (struct VasEBoot_efiemu_prepare_hook *) VasEBoot_malloc (sizeof (*nhook)); if (! nhook) - return grub_errno; + return VasEBoot_errno; nhook->hook = hook; nhook->unload = unload; nhook->data = data; nhook->next = efiemu_prepare_hooks; efiemu_prepare_hooks = nhook; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Register a configuration table either supplying the address directly or with a hook */ -grub_err_t -grub_efiemu_register_configuration_table (grub_efi_guid_t guid, +VasEBoot_err_t +VasEBoot_efiemu_register_configuration_table (VasEBoot_efi_guid_t guid, void * (*get_table) (void *data), void (*unload) (void *data), void *data) { - struct grub_efiemu_configuration_table *tbl; - grub_err_t err; + struct VasEBoot_efiemu_configuration_table *tbl; + VasEBoot_err_t err; - err = grub_efiemu_unregister_configuration_table (guid); + err = VasEBoot_efiemu_unregister_configuration_table (guid); if (err) return err; - tbl = (struct grub_efiemu_configuration_table *) grub_malloc (sizeof (*tbl)); + tbl = (struct VasEBoot_efiemu_configuration_table *) VasEBoot_malloc (sizeof (*tbl)); if (! tbl) - return grub_errno; + return VasEBoot_errno; tbl->guid = guid; tbl->get_table = get_table; @@ -159,170 +159,170 @@ grub_efiemu_register_configuration_table (grub_efi_guid_t guid, tbl->next = efiemu_config_tables; efiemu_config_tables = tbl; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_efiemu_unload (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *args[] __attribute__ ((unused))) { - return grub_efiemu_unload (); + return VasEBoot_efiemu_unload (); } -static grub_err_t -grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_efiemu_prepare (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *args[] __attribute__ ((unused))) { - return grub_efiemu_prepare (); + return VasEBoot_efiemu_prepare (); } /* Load the runtime from the file FILENAME. */ -static grub_err_t -grub_efiemu_load_file (const char *filename) +static VasEBoot_err_t +VasEBoot_efiemu_load_file (const char *filename) { - grub_file_t file; - grub_err_t err; + VasEBoot_file_t file; + VasEBoot_err_t err; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (! file) - return grub_errno; + return VasEBoot_errno; - err = grub_efiemu_mm_init (); + err = VasEBoot_efiemu_mm_init (); if (err) { - grub_file_close (file); - grub_efiemu_unload (); + VasEBoot_file_close (file); + VasEBoot_efiemu_unload (); return err; } - grub_dprintf ("efiemu", "mm initialized\n"); + VasEBoot_dprintf ("efiemu", "mm initialized\n"); - err = grub_efiemu_loadcore_init (file, filename); + err = VasEBoot_efiemu_loadcore_init (file, filename); if (err) { - grub_file_close (file); - grub_efiemu_unload (); + VasEBoot_file_close (file); + VasEBoot_efiemu_unload (); return err; } - grub_file_close (file); + VasEBoot_file_close (file); /* For configuration tables entry in system table. */ - grub_efiemu_request_symbols (1); + VasEBoot_efiemu_request_symbols (1); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_efiemu_autocore (void) +VasEBoot_err_t +VasEBoot_efiemu_autocore (void) { const char *prefix; char *filename; const char *suffix; - grub_err_t err; + VasEBoot_err_t err; - if (grub_efiemu_sizeof_uintn_t () != 0) - return GRUB_ERR_NONE; + if (VasEBoot_efiemu_sizeof_uintn_t () != 0) + return VasEBoot_ERR_NONE; - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); if (! prefix) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); - suffix = grub_efiemu_get_default_core_name (); + suffix = VasEBoot_efiemu_get_default_core_name (); - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM "/%s", + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/%s", prefix, suffix); if (! filename) - return grub_errno; + return VasEBoot_errno; - err = grub_efiemu_load_file (filename); - grub_free (filename); + err = VasEBoot_efiemu_load_file (filename); + VasEBoot_free (filename); if (err) return err; -#ifndef GRUB_MACHINE_EMU - err = grub_machine_efiemu_init_tables (); +#ifndef VasEBoot_MACHINE_EMU + err = VasEBoot_machine_efiemu_init_tables (); if (err) return err; #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_efiemu_prepare (void) +VasEBoot_err_t +VasEBoot_efiemu_prepare (void) { - grub_err_t err; + VasEBoot_err_t err; if (prepared) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - err = grub_efiemu_autocore (); + err = VasEBoot_efiemu_autocore (); if (err) return err; - grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n", - 8 * grub_efiemu_sizeof_uintn_t ()); + VasEBoot_dprintf ("efiemu", "Preparing %d-bit efiemu\n", + 8 * VasEBoot_efiemu_sizeof_uintn_t ()); /* Create NVRAM. */ - grub_efiemu_pnvram (); + VasEBoot_efiemu_pnvram (); prepared = 1; - if (grub_efiemu_sizeof_uintn_t () == 4) - return grub_efiemu_prepare32 (efiemu_prepare_hooks, efiemu_config_tables); + if (VasEBoot_efiemu_sizeof_uintn_t () == 4) + return VasEBoot_efiemu_prepare32 (efiemu_prepare_hooks, efiemu_config_tables); else - return grub_efiemu_prepare64 (efiemu_prepare_hooks, efiemu_config_tables); + return VasEBoot_efiemu_prepare64 (efiemu_prepare_hooks, efiemu_config_tables); } -static grub_err_t -grub_cmd_efiemu_load (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_efiemu_load (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_err_t err; + VasEBoot_err_t err; - grub_efiemu_unload (); + VasEBoot_efiemu_unload (); if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - err = grub_efiemu_load_file (args[0]); + err = VasEBoot_efiemu_load_file (args[0]); if (err) return err; -#ifndef GRUB_MACHINE_EMU - err = grub_machine_efiemu_init_tables (); +#ifndef VasEBoot_MACHINE_EMU + err = VasEBoot_machine_efiemu_init_tables (); if (err) return err; #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_loadcore, cmd_prepare, cmd_unload; +static VasEBoot_command_t cmd_loadcore, cmd_prepare, cmd_unload; -GRUB_MOD_INIT(efiemu) +VasEBoot_MOD_INIT(efiemu) { - cmd_loadcore = grub_register_command ("efiemu_loadcore", - grub_cmd_efiemu_load, + cmd_loadcore = VasEBoot_register_command ("efiemu_loadcore", + VasEBoot_cmd_efiemu_load, N_("FILE"), N_("Load and initialize EFI emulator.")); - cmd_prepare = grub_register_command ("efiemu_prepare", - grub_cmd_efiemu_prepare, + cmd_prepare = VasEBoot_register_command ("efiemu_prepare", + VasEBoot_cmd_efiemu_prepare, 0, N_("Finalize loading of EFI emulator.")); - cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload, + cmd_unload = VasEBoot_register_command ("efiemu_unload", VasEBoot_cmd_efiemu_unload, 0, N_("Unload EFI emulator.")); } -GRUB_MOD_FINI(efiemu) +VasEBoot_MOD_FINI(efiemu) { - grub_unregister_command (cmd_loadcore); - grub_unregister_command (cmd_prepare); - grub_unregister_command (cmd_unload); + VasEBoot_unregister_command (cmd_loadcore); + VasEBoot_unregister_command (cmd_prepare); + VasEBoot_unregister_command (cmd_unload); } diff --git a/VasEBoot-core/efiemu/mm.c b/VasEBoot-core/efiemu/mm.c index 52a032f7b..f8e0b7f03 100644 --- a/VasEBoot-core/efiemu/mm.c +++ b/VasEBoot-core/efiemu/mm.c @@ -1,63 +1,63 @@ /* Memory management for efiemu */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* To keep efiemu runtime contiguous this mm is special. It uses deferred allocation. - In the first stage you may request memory with grub_efiemu_request_memalign + In the first stage you may request memory with VasEBoot_efiemu_request_memalign It will give you a handle with which in the second phase you can access your - memory with grub_efiemu_mm_obtain_request (handle). It's guaranteed that + memory with VasEBoot_efiemu_mm_obtain_request (handle). It's guaranteed that subsequent calls with the same handle return the same result. You can't request any additional memory once you're in the second phase */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -struct grub_efiemu_memrequest +struct VasEBoot_efiemu_memrequest { - struct grub_efiemu_memrequest *next; - grub_efi_memory_type_t type; - grub_size_t size; - grub_size_t align_overhead; + struct VasEBoot_efiemu_memrequest *next; + VasEBoot_efi_memory_type_t type; + VasEBoot_size_t size; + VasEBoot_size_t align_overhead; int handle; void *val; }; /* Linked list of requested memory. */ -static struct grub_efiemu_memrequest *memrequests = 0; +static struct VasEBoot_efiemu_memrequest *memrequests = 0; /* Memory map. */ -static grub_efi_memory_descriptor_t *efiemu_mmap = 0; +static VasEBoot_efi_memory_descriptor_t *efiemu_mmap = 0; /* Pointer to allocated memory */ static void *resident_memory = 0; /* Size of requested memory per type */ -static grub_size_t requested_memory[GRUB_EFI_MAX_MEMORY_TYPE]; +static VasEBoot_size_t requested_memory[VasEBoot_EFI_MAX_MEMORY_TYPE]; /* How many slots is allocated for memory_map and how many are already used */ static int mmap_reserved_size = 0, mmap_num = 0; /* Add a memory region to map*/ -static grub_err_t -grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, - grub_efi_memory_type_t type) +static VasEBoot_err_t +VasEBoot_efiemu_add_to_mmap (VasEBoot_uint64_t start, VasEBoot_uint64_t size, + VasEBoot_efi_memory_type_t type) { - grub_uint64_t page_start, npages; + VasEBoot_uint64_t page_start, npages; /* Extend map if necessary*/ if (mmap_num >= mmap_reserved_size) @@ -65,27 +65,27 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, void *old; mmap_reserved_size = 2 * (mmap_reserved_size + 1); old = efiemu_mmap; - efiemu_mmap = (grub_efi_memory_descriptor_t *) - grub_realloc (efiemu_mmap, mmap_reserved_size - * sizeof (grub_efi_memory_descriptor_t)); + efiemu_mmap = (VasEBoot_efi_memory_descriptor_t *) + VasEBoot_realloc (efiemu_mmap, mmap_reserved_size + * sizeof (VasEBoot_efi_memory_descriptor_t)); if (!efiemu_mmap) { - grub_free (old); - return grub_errno; + VasEBoot_free (old); + return VasEBoot_errno; } } /* Fill slot*/ - page_start = start - (start % GRUB_EFIEMU_PAGESIZE); - npages = (size + (start % GRUB_EFIEMU_PAGESIZE) + GRUB_EFIEMU_PAGESIZE - 1) - / GRUB_EFIEMU_PAGESIZE; + page_start = start - (start % VasEBoot_EFIEMU_PAGESIZE); + npages = (size + (start % VasEBoot_EFIEMU_PAGESIZE) + VasEBoot_EFIEMU_PAGESIZE - 1) + / VasEBoot_EFIEMU_PAGESIZE; efiemu_mmap[mmap_num].physical_start = page_start; efiemu_mmap[mmap_num].virtual_start = page_start; efiemu_mmap[mmap_num].num_pages = npages; efiemu_mmap[mmap_num].type = type; mmap_num++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Request a resident memory of type TYPE of size SIZE aligned at ALIGN @@ -93,14 +93,14 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, it should be ok on all platforms) */ int -grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, - grub_efi_memory_type_t type) +VasEBoot_efiemu_request_memalign (VasEBoot_size_t align, VasEBoot_size_t size, + VasEBoot_efi_memory_type_t type) { - grub_size_t align_overhead; - struct grub_efiemu_memrequest *ret, *cur, *prev; + VasEBoot_size_t align_overhead; + struct VasEBoot_efiemu_memrequest *ret, *cur, *prev; /* Check that the request is correct */ - if (type <= GRUB_EFI_LOADER_CODE || type == GRUB_EFI_PERSISTENT_MEMORY || - type >= GRUB_EFI_MAX_MEMORY_TYPE) + if (type <= VasEBoot_EFI_LOADER_CODE || type == VasEBoot_EFI_PERSISTENT_MEMORY || + type >= VasEBoot_EFI_MAX_MEMORY_TYPE) return -2; /* Add new size to requested size */ @@ -110,7 +110,7 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, requested_memory[type] += align_overhead + size; /* Remember the request */ - ret = grub_zalloc (sizeof (*ret)); + ret = VasEBoot_zalloc (sizeof (*ret)); if (!ret) return -1; ret->type = type; @@ -135,61 +135,61 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, } /* Really allocate the memory */ -static grub_err_t +static VasEBoot_err_t efiemu_alloc_requests (void) { - grub_size_t align_overhead = 0; - grub_uint8_t *curptr, *typestart; - struct grub_efiemu_memrequest *cur; - grub_size_t total_alloc = 0; + VasEBoot_size_t align_overhead = 0; + VasEBoot_uint8_t *curptr, *typestart; + struct VasEBoot_efiemu_memrequest *cur; + VasEBoot_size_t total_alloc = 0; unsigned i; /* Order of memory regions */ - grub_efi_memory_type_t reqorder[] = + VasEBoot_efi_memory_type_t reqorder[] = { /* First come regions usable by OS*/ - GRUB_EFI_LOADER_CODE, - GRUB_EFI_LOADER_DATA, - GRUB_EFI_BOOT_SERVICES_CODE, - GRUB_EFI_BOOT_SERVICES_DATA, - GRUB_EFI_CONVENTIONAL_MEMORY, - GRUB_EFI_ACPI_RECLAIM_MEMORY, + VasEBoot_EFI_LOADER_CODE, + VasEBoot_EFI_LOADER_DATA, + VasEBoot_EFI_BOOT_SERVICES_CODE, + VasEBoot_EFI_BOOT_SERVICES_DATA, + VasEBoot_EFI_CONVENTIONAL_MEMORY, + VasEBoot_EFI_ACPI_RECLAIM_MEMORY, /* Then memory used by runtime */ /* This way all our regions are in a single block */ - GRUB_EFI_RUNTIME_SERVICES_CODE, - GRUB_EFI_RUNTIME_SERVICES_DATA, - GRUB_EFI_ACPI_MEMORY_NVS, + VasEBoot_EFI_RUNTIME_SERVICES_CODE, + VasEBoot_EFI_RUNTIME_SERVICES_DATA, + VasEBoot_EFI_ACPI_MEMORY_NVS, /* And then unavailable memory types. This is more for a completeness. You should double think before allocating memory of any of these types */ - GRUB_EFI_UNUSABLE_MEMORY, - GRUB_EFI_MEMORY_MAPPED_IO, - GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, - GRUB_EFI_PAL_CODE + VasEBoot_EFI_UNUSABLE_MEMORY, + VasEBoot_EFI_MEMORY_MAPPED_IO, + VasEBoot_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + VasEBoot_EFI_PAL_CODE /* * These are not allocatable: - * GRUB_EFI_RESERVED_MEMORY_TYPE - * GRUB_EFI_PERSISTENT_MEMORY - * >= GRUB_EFI_MAX_MEMORY_TYPE + * VasEBoot_EFI_RESERVED_MEMORY_TYPE + * VasEBoot_EFI_PERSISTENT_MEMORY + * >= VasEBoot_EFI_MAX_MEMORY_TYPE */ }; /* Compute total memory needed */ for (i = 0; i < sizeof (reqorder) / sizeof (reqorder[0]); i++) { - align_overhead = GRUB_EFIEMU_PAGESIZE - - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE); - if (align_overhead == GRUB_EFIEMU_PAGESIZE) + align_overhead = VasEBoot_EFIEMU_PAGESIZE + - (requested_memory[reqorder[i]] % VasEBoot_EFIEMU_PAGESIZE); + if (align_overhead == VasEBoot_EFIEMU_PAGESIZE) align_overhead = 0; total_alloc += requested_memory[reqorder[i]] + align_overhead; } /* Allocate the whole memory in one block */ - resident_memory = grub_memalign (GRUB_EFIEMU_PAGESIZE, total_alloc); + resident_memory = VasEBoot_memalign (VasEBoot_EFIEMU_PAGESIZE, total_alloc); if (!resident_memory) - return grub_errno; + return VasEBoot_errno; /* Split the memory into blocks by type */ curptr = resident_memory; @@ -203,31 +203,31 @@ efiemu_alloc_requests (void) for (cur = memrequests; cur; cur = cur->next) if (cur->type == reqorder[i]) { - curptr = ((grub_uint8_t *)curptr) + cur->align_overhead; + curptr = ((VasEBoot_uint8_t *)curptr) + cur->align_overhead; cur->val = curptr; - curptr = ((grub_uint8_t *)curptr) + cur->size; + curptr = ((VasEBoot_uint8_t *)curptr) + cur->size; } /* Ensure that the regions are page-aligned */ - align_overhead = GRUB_EFIEMU_PAGESIZE - - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE); - if (align_overhead == GRUB_EFIEMU_PAGESIZE) + align_overhead = VasEBoot_EFIEMU_PAGESIZE + - (requested_memory[reqorder[i]] % VasEBoot_EFIEMU_PAGESIZE); + if (align_overhead == VasEBoot_EFIEMU_PAGESIZE) align_overhead = 0; - curptr = ((grub_uint8_t *) curptr) + align_overhead; + curptr = ((VasEBoot_uint8_t *) curptr) + align_overhead; /* Add the region to memory map */ - grub_efiemu_add_to_mmap ((grub_addr_t) typestart, + VasEBoot_efiemu_add_to_mmap ((VasEBoot_addr_t) typestart, curptr - typestart, reqorder[i]); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Get a pointer to requested memory from handle */ void * -grub_efiemu_mm_obtain_request (int handle) +VasEBoot_efiemu_mm_obtain_request (int handle) { - struct grub_efiemu_memrequest *cur; + struct VasEBoot_efiemu_memrequest *cur; for (cur = memrequests; cur; cur = cur->next) if (cur->handle == handle) return cur->val; @@ -235,10 +235,10 @@ grub_efiemu_mm_obtain_request (int handle) } /* Get type of requested memory by handle */ -grub_efi_memory_type_t -grub_efiemu_mm_get_type (int handle) +VasEBoot_efi_memory_type_t +VasEBoot_efiemu_mm_get_type (int handle) { - struct grub_efiemu_memrequest *cur; + struct VasEBoot_efiemu_memrequest *cur; for (cur = memrequests; cur; cur = cur->next) if (cur->handle == handle) return cur->type; @@ -247,15 +247,15 @@ grub_efiemu_mm_get_type (int handle) /* Free a request */ void -grub_efiemu_mm_return_request (int handle) +VasEBoot_efiemu_mm_return_request (int handle) { - struct grub_efiemu_memrequest *cur, *prev; + struct VasEBoot_efiemu_memrequest *cur, *prev; /* Remove head if necessary */ while (memrequests && memrequests->handle == handle) { cur = memrequests->next; - grub_free (memrequests); + VasEBoot_free (memrequests); memrequests = cur; } if (!memrequests) @@ -266,7 +266,7 @@ grub_efiemu_mm_return_request (int handle) if (cur->handle == handle) { prev->next = cur->next; - grub_free (cur); + VasEBoot_free (cur); cur = prev->next; } else @@ -276,11 +276,11 @@ grub_efiemu_mm_return_request (int handle) } } -/* Helper for grub_efiemu_mmap_init. */ +/* Helper for VasEBoot_efiemu_mmap_init. */ static int -bounds_hook (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - grub_memory_type_t type __attribute__ ((unused)), +bounds_hook (VasEBoot_uint64_t addr __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data __attribute__ ((unused))) { mmap_reserved_size++; @@ -288,46 +288,46 @@ bounds_hook (grub_uint64_t addr __attribute__ ((unused)), } /* Reserve space for memory map */ -static grub_err_t -grub_efiemu_mmap_init (void) +static VasEBoot_err_t +VasEBoot_efiemu_mmap_init (void) { // the place for memory used by efiemu itself - mmap_reserved_size = GRUB_EFI_MAX_MEMORY_TYPE + 1; + mmap_reserved_size = VasEBoot_EFI_MAX_MEMORY_TYPE + 1; -#ifndef GRUB_MACHINE_EMU - grub_machine_mmap_iterate (bounds_hook, NULL); +#ifndef VasEBoot_MACHINE_EMU + VasEBoot_machine_mmap_iterate (bounds_hook, NULL); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* This is a drop-in replacement of grub_efi_get_memory_map */ +/* This is a drop-in replacement of VasEBoot_efi_get_memory_map */ /* Get the memory map as defined in the EFI spec. Return 1 if successful, return 0 if partial, or return -1 if an error occurs. */ int -grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version) +VasEBoot_efiemu_get_memory_map (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version) { if (!efiemu_mmap) { - grub_error (GRUB_ERR_INVALID_COMMAND, + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "you need to first launch efiemu_prepare"); return -1; } - if (*memory_map_size < mmap_num * sizeof (grub_efi_memory_descriptor_t)) + if (*memory_map_size < mmap_num * sizeof (VasEBoot_efi_memory_descriptor_t)) { - *memory_map_size = mmap_num * sizeof (grub_efi_memory_descriptor_t); + *memory_map_size = mmap_num * sizeof (VasEBoot_efi_memory_descriptor_t); return 0; } - *memory_map_size = mmap_num * sizeof (grub_efi_memory_descriptor_t); - grub_memcpy (memory_map, efiemu_mmap, *memory_map_size); + *memory_map_size = mmap_num * sizeof (VasEBoot_efi_memory_descriptor_t); + VasEBoot_memcpy (memory_map, efiemu_mmap, *memory_map_size); if (descriptor_size) - *descriptor_size = sizeof (grub_efi_memory_descriptor_t); + *descriptor_size = sizeof (VasEBoot_efi_memory_descriptor_t); if (descriptor_version) *descriptor_version = 1; if (map_key) @@ -336,155 +336,155 @@ grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, return 1; } -grub_err_t -grub_efiemu_finish_boot_services (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version) +VasEBoot_err_t +VasEBoot_efiemu_finish_boot_services (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version) { - int val = grub_efiemu_get_memory_map (memory_map_size, + int val = VasEBoot_efiemu_get_memory_map (memory_map_size, memory_map, map_key, descriptor_size, descriptor_version); if (val == 1) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (val == -1) - return grub_errno; - return grub_error (GRUB_ERR_IO, "memory map buffer is too small"); + return VasEBoot_errno; + return VasEBoot_error (VasEBoot_ERR_IO, "memory map buffer is too small"); } /* Free everything */ -grub_err_t -grub_efiemu_mm_unload (void) +VasEBoot_err_t +VasEBoot_efiemu_mm_unload (void) { - struct grub_efiemu_memrequest *cur, *d; + struct VasEBoot_efiemu_memrequest *cur, *d; for (cur = memrequests; cur;) { d = cur->next; - grub_free (cur); + VasEBoot_free (cur); cur = d; } memrequests = 0; - grub_memset (&requested_memory, 0, sizeof (requested_memory)); - grub_free (resident_memory); + VasEBoot_memset (&requested_memory, 0, sizeof (requested_memory)); + VasEBoot_free (resident_memory); resident_memory = 0; - grub_free (efiemu_mmap); + VasEBoot_free (efiemu_mmap); efiemu_mmap = 0; mmap_reserved_size = mmap_num = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* This function should be called before doing any requests */ -grub_err_t -grub_efiemu_mm_init (void) +VasEBoot_err_t +VasEBoot_efiemu_mm_init (void) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_efiemu_mm_unload (); + err = VasEBoot_efiemu_mm_unload (); if (err) return err; - grub_efiemu_mmap_init (); + VasEBoot_efiemu_mmap_init (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Helper for grub_efiemu_mmap_fill. */ +/* Helper for VasEBoot_efiemu_mmap_fill. */ static int -fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +fill_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data __attribute__ ((unused))) { switch (type) { - case GRUB_MEMORY_AVAILABLE: - return grub_efiemu_add_to_mmap (addr, size, - GRUB_EFI_CONVENTIONAL_MEMORY); + case VasEBoot_MEMORY_AVAILABLE: + return VasEBoot_efiemu_add_to_mmap (addr, size, + VasEBoot_EFI_CONVENTIONAL_MEMORY); - case GRUB_MEMORY_ACPI: - return grub_efiemu_add_to_mmap (addr, size, - GRUB_EFI_ACPI_RECLAIM_MEMORY); + case VasEBoot_MEMORY_ACPI: + return VasEBoot_efiemu_add_to_mmap (addr, size, + VasEBoot_EFI_ACPI_RECLAIM_MEMORY); - case GRUB_MEMORY_NVS: - return grub_efiemu_add_to_mmap (addr, size, - GRUB_EFI_ACPI_MEMORY_NVS); + case VasEBoot_MEMORY_NVS: + return VasEBoot_efiemu_add_to_mmap (addr, size, + VasEBoot_EFI_ACPI_MEMORY_NVS); - case GRUB_MEMORY_PERSISTENT: - case GRUB_MEMORY_PERSISTENT_LEGACY: - return grub_efiemu_add_to_mmap (addr, size, - GRUB_EFI_PERSISTENT_MEMORY); + case VasEBoot_MEMORY_PERSISTENT: + case VasEBoot_MEMORY_PERSISTENT_LEGACY: + return VasEBoot_efiemu_add_to_mmap (addr, size, + VasEBoot_EFI_PERSISTENT_MEMORY); default: - grub_dprintf ("efiemu", + VasEBoot_dprintf ("efiemu", "Unknown memory type %d. Assuming unusable\n", type); /* FALLTHROUGH */ - case GRUB_MEMORY_RESERVED: - return grub_efiemu_add_to_mmap (addr, size, - GRUB_EFI_UNUSABLE_MEMORY); + case VasEBoot_MEMORY_RESERVED: + return VasEBoot_efiemu_add_to_mmap (addr, size, + VasEBoot_EFI_UNUSABLE_MEMORY); } } /* Copy host memory map */ -static grub_err_t -grub_efiemu_mmap_fill (void) +static VasEBoot_err_t +VasEBoot_efiemu_mmap_fill (void) { -#ifndef GRUB_MACHINE_EMU - grub_machine_mmap_iterate (fill_hook, NULL); +#ifndef VasEBoot_MACHINE_EMU + VasEBoot_machine_mmap_iterate (fill_hook, NULL); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_efiemu_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { unsigned i; for (i = 0; i < (unsigned) mmap_num; i++) switch (efiemu_mmap[i].type) { - case GRUB_EFI_RUNTIME_SERVICES_CODE: + case VasEBoot_EFI_RUNTIME_SERVICES_CODE: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_CODE, hook_data); + VasEBoot_MEMORY_CODE, hook_data); break; - case GRUB_EFI_UNUSABLE_MEMORY: + case VasEBoot_EFI_UNUSABLE_MEMORY: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_BADRAM, hook_data); + VasEBoot_MEMORY_BADRAM, hook_data); break; - case GRUB_EFI_RESERVED_MEMORY_TYPE: - case GRUB_EFI_RUNTIME_SERVICES_DATA: - case GRUB_EFI_MEMORY_MAPPED_IO: - case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: - case GRUB_EFI_PAL_CODE: + case VasEBoot_EFI_RESERVED_MEMORY_TYPE: + case VasEBoot_EFI_RUNTIME_SERVICES_DATA: + case VasEBoot_EFI_MEMORY_MAPPED_IO: + case VasEBoot_EFI_MEMORY_MAPPED_IO_PORT_SPACE: + case VasEBoot_EFI_PAL_CODE: default: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_RESERVED, hook_data); + VasEBoot_MEMORY_RESERVED, hook_data); break; - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: - case GRUB_EFI_BOOT_SERVICES_CODE: - case GRUB_EFI_BOOT_SERVICES_DATA: - case GRUB_EFI_CONVENTIONAL_MEMORY: + case VasEBoot_EFI_LOADER_CODE: + case VasEBoot_EFI_LOADER_DATA: + case VasEBoot_EFI_BOOT_SERVICES_CODE: + case VasEBoot_EFI_BOOT_SERVICES_DATA: + case VasEBoot_EFI_CONVENTIONAL_MEMORY: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_AVAILABLE, hook_data); + VasEBoot_MEMORY_AVAILABLE, hook_data); break; - case GRUB_EFI_ACPI_RECLAIM_MEMORY: + case VasEBoot_EFI_ACPI_RECLAIM_MEMORY: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_ACPI, hook_data); + VasEBoot_MEMORY_ACPI, hook_data); break; - case GRUB_EFI_ACPI_MEMORY_NVS: + case VasEBoot_EFI_ACPI_MEMORY_NVS: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_NVS, hook_data); + VasEBoot_MEMORY_NVS, hook_data); break; - case GRUB_EFI_PERSISTENT_MEMORY: + case VasEBoot_EFI_PERSISTENT_MEMORY: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_PERSISTENT, hook_data); + VasEBoot_MEMORY_PERSISTENT, hook_data); break; } @@ -496,8 +496,8 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) /* This function resolves overlapping regions and sorts the memory map It uses scanline (sweeping) algorithm */ -static grub_err_t -grub_efiemu_mmap_sort_and_uniq (void) +static VasEBoot_err_t +VasEBoot_efiemu_mmap_sort_and_uniq (void) { /* If same page is used by multiple types it's resolved according to priority @@ -507,63 +507,63 @@ grub_efiemu_mmap_sort_and_uniq (void) 3 - efiemu memory 4 - unusable memory */ - int priority[GRUB_EFI_MAX_MEMORY_TYPE] = + int priority[VasEBoot_EFI_MAX_MEMORY_TYPE] = { - [GRUB_EFI_RESERVED_MEMORY_TYPE] = 4, - [GRUB_EFI_LOADER_CODE] = 1, - [GRUB_EFI_LOADER_DATA] = 1, - [GRUB_EFI_BOOT_SERVICES_CODE] = 1, - [GRUB_EFI_BOOT_SERVICES_DATA] = 1, - [GRUB_EFI_RUNTIME_SERVICES_CODE] = 3, - [GRUB_EFI_RUNTIME_SERVICES_DATA] = 3, - [GRUB_EFI_CONVENTIONAL_MEMORY] = 0, - [GRUB_EFI_UNUSABLE_MEMORY] = 4, - [GRUB_EFI_ACPI_RECLAIM_MEMORY] = 2, - [GRUB_EFI_ACPI_MEMORY_NVS] = 3, - [GRUB_EFI_MEMORY_MAPPED_IO] = 4, - [GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, - [GRUB_EFI_PAL_CODE] = 4, - [GRUB_EFI_PERSISTENT_MEMORY] = 4 + [VasEBoot_EFI_RESERVED_MEMORY_TYPE] = 4, + [VasEBoot_EFI_LOADER_CODE] = 1, + [VasEBoot_EFI_LOADER_DATA] = 1, + [VasEBoot_EFI_BOOT_SERVICES_CODE] = 1, + [VasEBoot_EFI_BOOT_SERVICES_DATA] = 1, + [VasEBoot_EFI_RUNTIME_SERVICES_CODE] = 3, + [VasEBoot_EFI_RUNTIME_SERVICES_DATA] = 3, + [VasEBoot_EFI_CONVENTIONAL_MEMORY] = 0, + [VasEBoot_EFI_UNUSABLE_MEMORY] = 4, + [VasEBoot_EFI_ACPI_RECLAIM_MEMORY] = 2, + [VasEBoot_EFI_ACPI_MEMORY_NVS] = 3, + [VasEBoot_EFI_MEMORY_MAPPED_IO] = 4, + [VasEBoot_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, + [VasEBoot_EFI_PAL_CODE] = 4, + [VasEBoot_EFI_PERSISTENT_MEMORY] = 4 }; int i, j, k, done; /* Scanline events */ - struct grub_efiemu_mmap_scan + struct VasEBoot_efiemu_mmap_scan { /* At which memory address*/ - grub_uint64_t pos; + VasEBoot_uint64_t pos; /* 0 = region starts, 1 = region ends */ int type; /* Which type of memory region */ - grub_efi_memory_type_t memtype; + VasEBoot_efi_memory_type_t memtype; }; - struct grub_efiemu_mmap_scan *scanline_events; - struct grub_efiemu_mmap_scan t; + struct VasEBoot_efiemu_mmap_scan *scanline_events; + struct VasEBoot_efiemu_mmap_scan t; /* Previous scanline event */ - grub_uint64_t lastaddr; + VasEBoot_uint64_t lastaddr; int lasttype; /* Current scanline event */ int curtype; /* how many regions of given type overlap at current location */ - int present[GRUB_EFI_MAX_MEMORY_TYPE]; + int present[VasEBoot_EFI_MAX_MEMORY_TYPE]; /* Here is stored the resulting memory map*/ - grub_efi_memory_descriptor_t *result; + VasEBoot_efi_memory_descriptor_t *result; /* Initialize variables*/ - grub_memset (present, 0, sizeof (int) * GRUB_EFI_MAX_MEMORY_TYPE); - scanline_events = (struct grub_efiemu_mmap_scan *) - grub_malloc (sizeof (struct grub_efiemu_mmap_scan) * 2 * mmap_num); + VasEBoot_memset (present, 0, sizeof (int) * VasEBoot_EFI_MAX_MEMORY_TYPE); + scanline_events = (struct VasEBoot_efiemu_mmap_scan *) + VasEBoot_malloc (sizeof (struct VasEBoot_efiemu_mmap_scan) * 2 * mmap_num); /* Number of chunks can't increase more than by factor of 2 */ - result = (grub_efi_memory_descriptor_t *) - grub_malloc (sizeof (grub_efi_memory_descriptor_t) * 2 * mmap_num); + result = (VasEBoot_efi_memory_descriptor_t *) + VasEBoot_malloc (sizeof (VasEBoot_efi_memory_descriptor_t) * 2 * mmap_num); if (!result || !scanline_events) { - grub_free (result); - grub_free (scanline_events); - return grub_errno; + VasEBoot_free (result); + VasEBoot_free (scanline_events); + return VasEBoot_errno; } /* Register scanline events */ @@ -573,7 +573,7 @@ grub_efiemu_mmap_sort_and_uniq (void) scanline_events[2 * i].type = 0; scanline_events[2 * i].memtype = efiemu_mmap[i].type; scanline_events[2 * i + 1].pos = efiemu_mmap[i].physical_start - + efiemu_mmap[i].num_pages * GRUB_EFIEMU_PAGESIZE; + + efiemu_mmap[i].num_pages * VasEBoot_EFIEMU_PAGESIZE; scanline_events[2 * i + 1].type = 1; scanline_events[2 * i + 1].memtype = efiemu_mmap[i].type; } @@ -609,7 +609,7 @@ grub_efiemu_mmap_sort_and_uniq (void) /* Determine current region type */ curtype = -1; - for (k = 0; k < GRUB_EFI_MAX_MEMORY_TYPE; k++) + for (k = 0; k < VasEBoot_EFI_MAX_MEMORY_TYPE; k++) if (present[k] && (curtype == -1 || priority[k] > priority[curtype])) curtype = k; @@ -620,15 +620,15 @@ grub_efiemu_mmap_sort_and_uniq (void) { result[j].virtual_start = result[j].physical_start = lastaddr; result[j].num_pages = (scanline_events[i].pos - lastaddr) - / GRUB_EFIEMU_PAGESIZE; + / VasEBoot_EFIEMU_PAGESIZE; result[j].type = lasttype; /* We set runtime attribute on pages we need to be mapped */ result[j].attribute - = (lasttype == GRUB_EFI_RUNTIME_SERVICES_CODE - || lasttype == GRUB_EFI_RUNTIME_SERVICES_DATA) - ? GRUB_EFI_MEMORY_RUNTIME : 0; - grub_dprintf ("efiemu", + = (lasttype == VasEBoot_EFI_RUNTIME_SERVICES_CODE + || lasttype == VasEBoot_EFI_RUNTIME_SERVICES_DATA) + ? VasEBoot_EFI_MEMORY_RUNTIME : 0; + VasEBoot_dprintf ("efiemu", "mmap entry: type %d start 0x%llx 0x%llx pages\n", result[j].type, result[j].physical_start, result[j].num_pages); @@ -643,35 +643,35 @@ grub_efiemu_mmap_sort_and_uniq (void) } } - grub_free (scanline_events); + VasEBoot_free (scanline_events); /* Shrink resulting memory map to really used size and replace efiemu_mmap by new value */ - grub_free (efiemu_mmap); - efiemu_mmap = grub_realloc (result, j * sizeof (*result)); - return GRUB_ERR_NONE; + VasEBoot_free (efiemu_mmap); + efiemu_mmap = VasEBoot_realloc (result, j * sizeof (*result)); + return VasEBoot_ERR_NONE; } /* This function is called to switch from first to second phase */ -grub_err_t -grub_efiemu_mm_do_alloc (void) +VasEBoot_err_t +VasEBoot_efiemu_mm_do_alloc (void) { - grub_err_t err; + VasEBoot_err_t err; /* Preallocate mmap */ - efiemu_mmap = (grub_efi_memory_descriptor_t *) - grub_malloc (mmap_reserved_size * sizeof (grub_efi_memory_descriptor_t)); + efiemu_mmap = (VasEBoot_efi_memory_descriptor_t *) + VasEBoot_malloc (mmap_reserved_size * sizeof (VasEBoot_efi_memory_descriptor_t)); if (!efiemu_mmap) { - grub_efiemu_unload (); - return grub_errno; + VasEBoot_efiemu_unload (); + return VasEBoot_errno; } err = efiemu_alloc_requests (); if (err) return err; - err = grub_efiemu_mmap_fill (); + err = VasEBoot_efiemu_mmap_fill (); if (err) return err; - return grub_efiemu_mmap_sort_and_uniq (); + return VasEBoot_efiemu_mmap_sort_and_uniq (); } diff --git a/VasEBoot-core/efiemu/pnvram.c b/VasEBoot-core/efiemu/pnvram.c index c5c3d4bd3..2349c4a99 100644 --- a/VasEBoot-core/efiemu/pnvram.c +++ b/VasEBoot-core/efiemu/pnvram.c @@ -1,31 +1,31 @@ /* Export pnvram and some variables for runtime */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Place for final location of variables */ static int nvram_handle = 0; @@ -35,15 +35,15 @@ static int timezone_handle = 0; static int accuracy_handle = 0; static int daylight_handle = 0; -static grub_size_t nvramsize; +static VasEBoot_size_t nvramsize; /* Parse signed value */ static int -grub_strtosl (const char *arg, char **end, int base) +VasEBoot_strtosl (const char *arg, char **end, int base) { if (arg[0] == '-') - return -grub_strtoul (arg + 1, end, base); - return grub_strtoul (arg, end, base); + return -VasEBoot_strtoul (arg + 1, end, base); + return VasEBoot_strtoul (arg, end, base); } static inline int @@ -58,7 +58,7 @@ hextoval (char c) return 0; } -static inline grub_err_t +static inline VasEBoot_err_t unescape (char *in, char *out, char *outmax, int *len) { char *ptr, *dptr; @@ -77,7 +77,7 @@ unescape (char *in, char *out, char *outmax, int *len) dptr++; } if (dptr == outmax) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "too many NVRAM variables for reserved variable space." " Try increasing EfiEmu.pnvram.size"); *len = dptr - out; @@ -85,105 +85,105 @@ unescape (char *in, char *out, char *outmax, int *len) } /* Export stuff for efiemu */ -static grub_err_t +static VasEBoot_err_t nvram_set (void * data __attribute__ ((unused))) { const char *env; /* Take definitive pointers */ - char *nvram = grub_efiemu_mm_obtain_request (nvram_handle); - grub_uint32_t *nvramsize_def - = grub_efiemu_mm_obtain_request (nvramsize_handle); - grub_uint32_t *high_monotonic_count - = grub_efiemu_mm_obtain_request (high_monotonic_count_handle); - grub_int16_t *timezone - = grub_efiemu_mm_obtain_request (timezone_handle); - grub_uint8_t *daylight - = grub_efiemu_mm_obtain_request (daylight_handle); - grub_uint32_t *accuracy - = grub_efiemu_mm_obtain_request (accuracy_handle); + char *nvram = VasEBoot_efiemu_mm_obtain_request (nvram_handle); + VasEBoot_uint32_t *nvramsize_def + = VasEBoot_efiemu_mm_obtain_request (nvramsize_handle); + VasEBoot_uint32_t *high_monotonic_count + = VasEBoot_efiemu_mm_obtain_request (high_monotonic_count_handle); + VasEBoot_int16_t *timezone + = VasEBoot_efiemu_mm_obtain_request (timezone_handle); + VasEBoot_uint8_t *daylight + = VasEBoot_efiemu_mm_obtain_request (daylight_handle); + VasEBoot_uint32_t *accuracy + = VasEBoot_efiemu_mm_obtain_request (accuracy_handle); char *nvramptr; - struct grub_env_var *var; + struct VasEBoot_env_var *var; /* Copy to definitive loaction */ - grub_dprintf ("efiemu", "preparing pnvram\n"); + VasEBoot_dprintf ("efiemu", "preparing pnvram\n"); - env = grub_env_get ("EfiEmu.pnvram.high_monotonic_count"); - *high_monotonic_count = env ? grub_strtoul (env, 0, 0) : 1; - env = grub_env_get ("EfiEmu.pnvram.timezone"); - *timezone = env ? grub_strtosl (env, 0, 0) : GRUB_EFI_UNSPECIFIED_TIMEZONE; - env = grub_env_get ("EfiEmu.pnvram.accuracy"); - *accuracy = env ? grub_strtoul (env, 0, 0) : 50000000; - env = grub_env_get ("EfiEmu.pnvram.daylight"); - *daylight = env ? grub_strtoul (env, 0, 0) : 0; + env = VasEBoot_env_get ("EfiEmu.pnvram.high_monotonic_count"); + *high_monotonic_count = env ? VasEBoot_strtoul (env, 0, 0) : 1; + env = VasEBoot_env_get ("EfiEmu.pnvram.timezone"); + *timezone = env ? VasEBoot_strtosl (env, 0, 0) : VasEBoot_EFI_UNSPECIFIED_TIMEZONE; + env = VasEBoot_env_get ("EfiEmu.pnvram.accuracy"); + *accuracy = env ? VasEBoot_strtoul (env, 0, 0) : 50000000; + env = VasEBoot_env_get ("EfiEmu.pnvram.daylight"); + *daylight = env ? VasEBoot_strtoul (env, 0, 0) : 0; nvramptr = nvram; - grub_memset (nvram, 0, nvramsize); + VasEBoot_memset (nvram, 0, nvramsize); FOR_SORTED_ENV (var) { char *guid, *attr, *name, *varname; struct efi_variable *efivar; int len = 0; int i; - grub_uint64_t guidcomp; + VasEBoot_uint64_t guidcomp; - if (grub_memcmp (var->name, "EfiEmu.pnvram.", + if (VasEBoot_memcmp (var->name, "EfiEmu.pnvram.", sizeof ("EfiEmu.pnvram.") - 1) != 0) continue; guid = var->name + sizeof ("EfiEmu.pnvram.") - 1; - attr = grub_strchr (guid, '.'); + attr = VasEBoot_strchr (guid, '.'); if (!attr) continue; attr++; - name = grub_strchr (attr, '.'); + name = VasEBoot_strchr (attr, '.'); if (!name) continue; name++; efivar = (struct efi_variable *) nvramptr; if (nvramptr - nvram + sizeof (struct efi_variable) > nvramsize) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "too many NVRAM variables for reserved variable space." " Try increasing EfiEmu.pnvram.size"); nvramptr += sizeof (struct efi_variable); - efivar->guid.data1 = grub_cpu_to_le32 (grub_strtoul (guid, &guid, 16)); + efivar->guid.data1 = VasEBoot_cpu_to_le32 (VasEBoot_strtoul (guid, &guid, 16)); if (*guid != '-') continue; guid++; - efivar->guid.data2 = grub_cpu_to_le16 (grub_strtoul (guid, &guid, 16)); + efivar->guid.data2 = VasEBoot_cpu_to_le16 (VasEBoot_strtoul (guid, &guid, 16)); if (*guid != '-') continue; guid++; - efivar->guid.data3 = grub_cpu_to_le16 (grub_strtoul (guid, &guid, 16)); + efivar->guid.data3 = VasEBoot_cpu_to_le16 (VasEBoot_strtoul (guid, &guid, 16)); if (*guid != '-') continue; guid++; - guidcomp = grub_strtoull (guid, 0, 16); + guidcomp = VasEBoot_strtoull (guid, 0, 16); for (i = 0; i < 8; i++) efivar->guid.data4[i] = (guidcomp >> (56 - 8 * i)) & 0xff; - efivar->attributes = grub_strtoull (attr, 0, 16); + efivar->attributes = VasEBoot_strtoull (attr, 0, 16); - varname = grub_malloc (grub_strlen (name) + 1); + varname = VasEBoot_malloc (VasEBoot_strlen (name) + 1); if (! varname) - return grub_errno; + return VasEBoot_errno; - if (unescape (name, varname, varname + grub_strlen (name) + 1, &len)) + if (unescape (name, varname, varname + VasEBoot_strlen (name) + 1, &len)) break; - len = grub_utf8_to_utf16 ((grub_uint16_t *) nvramptr, + len = VasEBoot_utf8_to_utf16 ((VasEBoot_uint16_t *) nvramptr, (nvramsize - (nvramptr - nvram)) / 2, - (grub_uint8_t *) varname, len, NULL); + (VasEBoot_uint8_t *) varname, len, NULL); nvramptr += 2 * len; - *((grub_uint16_t *) nvramptr) = 0; + *((VasEBoot_uint16_t *) nvramptr) = 0; nvramptr += 2; efivar->namelen = 2 * len + 2; @@ -197,72 +197,72 @@ nvram_set (void * data __attribute__ ((unused))) efivar->size = len; } - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; *nvramsize_def = nvramsize; /* Register symbols */ - grub_efiemu_register_symbol ("efiemu_variables", nvram_handle, 0); - grub_efiemu_register_symbol ("efiemu_varsize", nvramsize_handle, 0); - grub_efiemu_register_symbol ("efiemu_high_monotonic_count", + VasEBoot_efiemu_register_symbol ("efiemu_variables", nvram_handle, 0); + VasEBoot_efiemu_register_symbol ("efiemu_varsize", nvramsize_handle, 0); + VasEBoot_efiemu_register_symbol ("efiemu_high_monotonic_count", high_monotonic_count_handle, 0); - grub_efiemu_register_symbol ("efiemu_time_zone", timezone_handle, 0); - grub_efiemu_register_symbol ("efiemu_time_daylight", daylight_handle, 0); - grub_efiemu_register_symbol ("efiemu_time_accuracy", + VasEBoot_efiemu_register_symbol ("efiemu_time_zone", timezone_handle, 0); + VasEBoot_efiemu_register_symbol ("efiemu_time_daylight", daylight_handle, 0); + VasEBoot_efiemu_register_symbol ("efiemu_time_accuracy", accuracy_handle, 0); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void nvram_unload (void * data __attribute__ ((unused))) { - grub_efiemu_mm_return_request (nvram_handle); - grub_efiemu_mm_return_request (nvramsize_handle); - grub_efiemu_mm_return_request (high_monotonic_count_handle); - grub_efiemu_mm_return_request (timezone_handle); - grub_efiemu_mm_return_request (accuracy_handle); - grub_efiemu_mm_return_request (daylight_handle); + VasEBoot_efiemu_mm_return_request (nvram_handle); + VasEBoot_efiemu_mm_return_request (nvramsize_handle); + VasEBoot_efiemu_mm_return_request (high_monotonic_count_handle); + VasEBoot_efiemu_mm_return_request (timezone_handle); + VasEBoot_efiemu_mm_return_request (accuracy_handle); + VasEBoot_efiemu_mm_return_request (daylight_handle); } -grub_err_t -grub_efiemu_pnvram (void) +VasEBoot_err_t +VasEBoot_efiemu_pnvram (void) { const char *size; - grub_err_t err; + VasEBoot_err_t err; nvramsize = 0; - size = grub_env_get ("EfiEmu.pnvram.size"); + size = VasEBoot_env_get ("EfiEmu.pnvram.size"); if (size) - nvramsize = grub_strtoul (size, 0, 0); + nvramsize = VasEBoot_strtoul (size, 0, 0); if (!nvramsize) nvramsize = 2048; - err = grub_efiemu_register_prepare_hook (nvram_set, nvram_unload, 0); + err = VasEBoot_efiemu_register_prepare_hook (nvram_set, nvram_unload, 0); if (err) return err; nvram_handle - = grub_efiemu_request_memalign (1, nvramsize, - GRUB_EFI_RUNTIME_SERVICES_DATA); + = VasEBoot_efiemu_request_memalign (1, nvramsize, + VasEBoot_EFI_RUNTIME_SERVICES_DATA); nvramsize_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), - GRUB_EFI_RUNTIME_SERVICES_DATA); + = VasEBoot_efiemu_request_memalign (1, sizeof (VasEBoot_uint32_t), + VasEBoot_EFI_RUNTIME_SERVICES_DATA); high_monotonic_count_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), - GRUB_EFI_RUNTIME_SERVICES_DATA); + = VasEBoot_efiemu_request_memalign (1, sizeof (VasEBoot_uint32_t), + VasEBoot_EFI_RUNTIME_SERVICES_DATA); timezone_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint16_t), - GRUB_EFI_RUNTIME_SERVICES_DATA); + = VasEBoot_efiemu_request_memalign (1, sizeof (VasEBoot_uint16_t), + VasEBoot_EFI_RUNTIME_SERVICES_DATA); daylight_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint8_t), - GRUB_EFI_RUNTIME_SERVICES_DATA); + = VasEBoot_efiemu_request_memalign (1, sizeof (VasEBoot_uint8_t), + VasEBoot_EFI_RUNTIME_SERVICES_DATA); accuracy_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), - GRUB_EFI_RUNTIME_SERVICES_DATA); + = VasEBoot_efiemu_request_memalign (1, sizeof (VasEBoot_uint32_t), + VasEBoot_EFI_RUNTIME_SERVICES_DATA); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/prepare.c b/VasEBoot-core/efiemu/prepare.c index 99ddb5abb..fae8b0015 100644 --- a/VasEBoot-core/efiemu/prepare.c +++ b/VasEBoot-core/efiemu/prepare.c @@ -1,169 +1,169 @@ /* Prepare efiemu. E.g. allocate memory, load the runtime to appropriate place, etc */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -grub_err_t -SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, - struct grub_efiemu_configuration_table +VasEBoot_err_t +SUFFIX (VasEBoot_efiemu_prepare) (struct VasEBoot_efiemu_prepare_hook *prepare_hooks, + struct VasEBoot_efiemu_configuration_table *config_tables) { - grub_err_t err; + VasEBoot_err_t err; int conftable_handle; - struct grub_efiemu_configuration_table *cur; - struct grub_efiemu_prepare_hook *curhook; + struct VasEBoot_efiemu_configuration_table *cur; + struct VasEBoot_efiemu_prepare_hook *curhook; int cntconftables = 0; - struct SUFFIX (grub_efiemu_configuration_table) *conftables = 0; + struct SUFFIX (VasEBoot_efiemu_configuration_table) *conftables = 0; int i; int handle; - grub_off_t off; + VasEBoot_off_t off; - grub_dprintf ("efiemu", "Preparing EfiEmu\n"); + VasEBoot_dprintf ("efiemu", "Preparing EfiEmu\n"); /* Request space for the list of configuration tables */ for (cur = config_tables; cur; cur = cur->next) cntconftables++; conftable_handle - = grub_efiemu_request_memalign (GRUB_EFIEMU_PAGESIZE, + = VasEBoot_efiemu_request_memalign (VasEBoot_EFIEMU_PAGESIZE, cntconftables * sizeof (*conftables), - GRUB_EFI_RUNTIME_SERVICES_DATA); + VasEBoot_EFI_RUNTIME_SERVICES_DATA); /* Switch from phase 1 (counting) to phase 2 (real job) */ - grub_efiemu_alloc_syms (); - grub_efiemu_mm_do_alloc (); - grub_efiemu_write_sym_markers (); + VasEBoot_efiemu_alloc_syms (); + VasEBoot_efiemu_mm_do_alloc (); + VasEBoot_efiemu_write_sym_markers (); - grub_efiemu_system_table32 = 0; - grub_efiemu_system_table64 = 0; + VasEBoot_efiemu_system_table32 = 0; + VasEBoot_efiemu_system_table64 = 0; /* Execute hooks */ for (curhook = prepare_hooks; curhook; curhook = curhook->next) curhook->hook (curhook->data); /* Move runtime to its due place */ - err = grub_efiemu_loadcore_load (); + err = VasEBoot_efiemu_loadcore_load (); if (err) { - grub_efiemu_unload (); + VasEBoot_efiemu_unload (); return err; } - err = grub_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off); + err = VasEBoot_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off); if (err) { - grub_efiemu_unload (); + VasEBoot_efiemu_unload (); return err; } - SUFFIX (grub_efiemu_system_table) - = (struct SUFFIX (grub_efi_system_table) *) - ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); + SUFFIX (VasEBoot_efiemu_system_table) + = (struct SUFFIX (VasEBoot_efi_system_table) *) + ((VasEBoot_uint8_t *) VasEBoot_efiemu_mm_obtain_request (handle) + off); /* Put pointer to the list of configuration tables in system table */ - err = grub_efiemu_write_value - (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, + err = VasEBoot_efiemu_write_value + (&(SUFFIX (VasEBoot_efiemu_system_table)->configuration_table), 0, conftable_handle, 0, 1, - sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); + sizeof (SUFFIX (VasEBoot_efiemu_system_table)->configuration_table)); if (err) { - grub_efiemu_unload (); + VasEBoot_efiemu_unload (); return err; } - SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables; + SUFFIX(VasEBoot_efiemu_system_table)->num_table_entries = cntconftables; /* Fill the list of configuration tables */ - conftables = (struct SUFFIX (grub_efiemu_configuration_table) *) - grub_efiemu_mm_obtain_request (conftable_handle); + conftables = (struct SUFFIX (VasEBoot_efiemu_configuration_table) *) + VasEBoot_efiemu_mm_obtain_request (conftable_handle); i = 0; for (cur = config_tables; cur; cur = cur->next, i++) { - grub_memcpy (&(conftables[i].vendor_guid), &(cur->guid), + VasEBoot_memcpy (&(conftables[i].vendor_guid), &(cur->guid), sizeof (cur->guid)); if (cur->get_table) - conftables[i].vendor_table = (grub_addr_t) cur->get_table (cur->data); + conftables[i].vendor_table = (VasEBoot_addr_t) cur->get_table (cur->data); else - conftables[i].vendor_table = (grub_addr_t) cur->data; + conftables[i].vendor_table = (VasEBoot_addr_t) cur->data; } - err = SUFFIX (grub_efiemu_crc) (); + err = SUFFIX (VasEBoot_efiemu_crc) (); if (err) { - grub_efiemu_unload (); + VasEBoot_efiemu_unload (); return err; } - grub_dprintf ("efiemu","system_table = %p, conftables = %p (%d entries)\n", - SUFFIX (grub_efiemu_system_table), conftables, cntconftables); + VasEBoot_dprintf ("efiemu","system_table = %p, conftables = %p (%d entries)\n", + SUFFIX (VasEBoot_efiemu_system_table), conftables, cntconftables); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -SUFFIX (grub_efiemu_crc) (void) +VasEBoot_err_t +SUFFIX (VasEBoot_efiemu_crc) (void) { - grub_err_t err; + VasEBoot_err_t err; int handle; - grub_off_t off; - struct SUFFIX (grub_efiemu_runtime_services) *runtime_services; - grub_uint32_t crc32_val; + VasEBoot_off_t off; + struct SUFFIX (VasEBoot_efiemu_runtime_services) *runtime_services; + VasEBoot_uint32_t crc32_val; - if (GRUB_MD_CRC32->mdlen != 4) - return grub_error (GRUB_ERR_BUG, "incorrect mdlen"); + if (VasEBoot_MD_CRC32->mdlen != 4) + return VasEBoot_error (VasEBoot_ERR_BUG, "incorrect mdlen"); /* compute CRC32 of runtime_services */ - err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", + err = VasEBoot_efiemu_resolve_symbol ("efiemu_runtime_services", &handle, &off); if (err) return err; - runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *) - ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); + runtime_services = (struct SUFFIX (VasEBoot_efiemu_runtime_services) *) + ((VasEBoot_uint8_t *) VasEBoot_efiemu_mm_obtain_request (handle) + off); runtime_services->hdr.crc32 = 0; - grub_crypto_hash (GRUB_MD_CRC32, &crc32_val, + VasEBoot_crypto_hash (VasEBoot_MD_CRC32, &crc32_val, runtime_services, runtime_services->hdr.header_size); runtime_services->hdr.crc32 = - grub_be_to_cpu32(crc32_val); + VasEBoot_be_to_cpu32(crc32_val); - err = grub_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off); + err = VasEBoot_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off); if (err) return err; /* compute CRC32 of system table */ - SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0; - grub_crypto_hash (GRUB_MD_CRC32, &crc32_val, - SUFFIX (grub_efiemu_system_table), - SUFFIX (grub_efiemu_system_table)->hdr.header_size); - SUFFIX (grub_efiemu_system_table)->hdr.crc32 = - grub_be_to_cpu32(crc32_val); + SUFFIX (VasEBoot_efiemu_system_table)->hdr.crc32 = 0; + VasEBoot_crypto_hash (VasEBoot_MD_CRC32, &crc32_val, + SUFFIX (VasEBoot_efiemu_system_table), + SUFFIX (VasEBoot_efiemu_system_table)->hdr.header_size); + SUFFIX (VasEBoot_efiemu_system_table)->hdr.crc32 = + VasEBoot_be_to_cpu32(crc32_val); - grub_dprintf ("efiemu","system_table = %p, runtime_services = %p\n", - SUFFIX (grub_efiemu_system_table), runtime_services); + VasEBoot_dprintf ("efiemu","system_table = %p, runtime_services = %p\n", + SUFFIX (VasEBoot_efiemu_system_table), runtime_services); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/efiemu/prepare32.c b/VasEBoot-core/efiemu/prepare32.c index fd6109ea3..55cd4d212 100644 --- a/VasEBoot-core/efiemu/prepare32.c +++ b/VasEBoot-core/efiemu/prepare32.c @@ -1,20 +1,20 @@ /* This file contains definitions so that prepare.c compiles for 32-bit */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SUFFIX(x) x ## 32 diff --git a/VasEBoot-core/efiemu/prepare64.c b/VasEBoot-core/efiemu/prepare64.c index 811f55896..124d20d26 100644 --- a/VasEBoot-core/efiemu/prepare64.c +++ b/VasEBoot-core/efiemu/prepare64.c @@ -1,20 +1,20 @@ /* This file contains definitions so that prepare.c compiles for 64-bit */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SUFFIX(x) x ## 64 diff --git a/VasEBoot-core/efiemu/runtime/efiemu.S b/VasEBoot-core/efiemu/runtime/efiemu.S index b502314ee..ff7167770 100644 --- a/VasEBoot-core/efiemu/runtime/efiemu.S +++ b/VasEBoot-core/efiemu/runtime/efiemu.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include /* * x86_64 uses registry to pass parameters. Unfortunately, gcc and efi use diff --git a/VasEBoot-core/efiemu/runtime/efiemu.c b/VasEBoot-core/efiemu/runtime/efiemu.c index d923e409f..e30df04c0 100644 --- a/VasEBoot-core/efiemu/runtime/efiemu.c +++ b/VasEBoot-core/efiemu/runtime/efiemu.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* This is an emulation of EFI runtime services. @@ -22,29 +22,29 @@ to chainload EFI bootloader on non-EFI system (TODO) */ #ifdef __i386__ -#include +#include #else -#include +#include #endif -#include -#include -#include -#include +#include +#include +#include +#include -grub_efi_status_t -efiemu_get_time (grub_efi_time_t *time, - grub_efi_time_capabilities_t *capabilities); -grub_efi_status_t -efiemu_set_time (grub_efi_time_t *time); +VasEBoot_efi_status_t +efiemu_get_time (VasEBoot_efi_time_t *time, + VasEBoot_efi_time_capabilities_t *capabilities); +VasEBoot_efi_status_t +efiemu_set_time (VasEBoot_efi_time_t *time); -grub_efi_status_t -efiemu_get_wakeup_time (grub_efi_boolean_t *enabled, - grub_efi_boolean_t *pending, - grub_efi_time_t *time); -grub_efi_status_t -efiemu_set_wakeup_time (grub_efi_boolean_t enabled, - grub_efi_time_t *time); +VasEBoot_efi_status_t +efiemu_get_wakeup_time (VasEBoot_efi_boolean_t *enabled, + VasEBoot_efi_boolean_t *pending, + VasEBoot_efi_time_t *time); +VasEBoot_efi_status_t +efiemu_set_wakeup_time (VasEBoot_efi_boolean_t enabled, + VasEBoot_efi_time_t *time); #ifdef __APPLE__ #define PHYSICAL_ATTRIBUTE __attribute__ ((section("_text-physical, _text-physical"))); @@ -52,82 +52,82 @@ efiemu_set_wakeup_time (grub_efi_boolean_t enabled, #define PHYSICAL_ATTRIBUTE __attribute__ ((section(".text-physical"))); #endif -grub_efi_status_t -efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map) +VasEBoot_efi_status_t +efiemu_set_virtual_address_map (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version, + VasEBoot_efi_memory_descriptor_t *virtual_map) PHYSICAL_ATTRIBUTE; -grub_efi_status_t -efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, +VasEBoot_efi_status_t +efiemu_convert_pointer (VasEBoot_efi_uintn_t debug_disposition, void **address) PHYSICAL_ATTRIBUTE; -grub_efi_status_t -efiemu_get_variable (grub_efi_char16_t *variable_name, - const grub_efi_guid_t *vendor_guid, - grub_efi_uint32_t *attributes, - grub_efi_uintn_t *data_size, +VasEBoot_efi_status_t +efiemu_get_variable (VasEBoot_efi_char16_t *variable_name, + const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_uint32_t *attributes, + VasEBoot_efi_uintn_t *data_size, void *data); -grub_efi_status_t -efiemu_get_next_variable_name (grub_efi_uintn_t *variable_name_size, - grub_efi_char16_t *variable_name, - grub_efi_guid_t *vendor_guid); +VasEBoot_efi_status_t +efiemu_get_next_variable_name (VasEBoot_efi_uintn_t *variable_name_size, + VasEBoot_efi_char16_t *variable_name, + VasEBoot_efi_guid_t *vendor_guid); -grub_efi_status_t -efiemu_set_variable (grub_efi_char16_t *variable_name, - const grub_efi_guid_t *vendor_guid, - grub_efi_uint32_t attributes, - grub_efi_uintn_t data_size, +VasEBoot_efi_status_t +efiemu_set_variable (VasEBoot_efi_char16_t *variable_name, + const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_uint32_t attributes, + VasEBoot_efi_uintn_t data_size, void *data); -grub_efi_status_t -efiemu_get_next_high_monotonic_count (grub_efi_uint32_t *high_count); +VasEBoot_efi_status_t +efiemu_get_next_high_monotonic_count (VasEBoot_efi_uint32_t *high_count); void -efiemu_reset_system (grub_efi_reset_type_t reset_type, - grub_efi_status_t reset_status, - grub_efi_uintn_t data_size, - grub_efi_char16_t *reset_data); +efiemu_reset_system (VasEBoot_efi_reset_type_t reset_type, + VasEBoot_efi_status_t reset_status, + VasEBoot_efi_uintn_t data_size, + VasEBoot_efi_char16_t *reset_data); -grub_efi_status_t -EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t, - grub_efi_uintn_t, - grub_efi_uint32_t, - grub_efi_memory_descriptor_t *) +VasEBoot_efi_status_t +EFI_FUNC (efiemu_set_virtual_address_map) (VasEBoot_efi_uintn_t, + VasEBoot_efi_uintn_t, + VasEBoot_efi_uint32_t, + VasEBoot_efi_memory_descriptor_t *) PHYSICAL_ATTRIBUTE; -grub_efi_status_t -EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, +VasEBoot_efi_status_t +EFI_FUNC (efiemu_convert_pointer) (VasEBoot_efi_uintn_t debug_disposition, void **address) PHYSICAL_ATTRIBUTE; -static grub_uint32_t -efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) +static VasEBoot_uint32_t +efiemu_getcrc32 (VasEBoot_uint32_t crc, void *buf, int size) PHYSICAL_ATTRIBUTE; static void init_crc32_table (void) PHYSICAL_ATTRIBUTE; -static grub_uint32_t -reflect (grub_uint32_t ref, int len) +static VasEBoot_uint32_t +reflect (VasEBoot_uint32_t ref, int len) PHYSICAL_ATTRIBUTE; /* The log. It's used when examining memory dump */ -static grub_uint8_t loge[1000] = "EFIEMULOG"; +static VasEBoot_uint8_t loge[1000] = "EFIEMULOG"; static int logn = 9; #define LOG(x) { if (logn<900) loge[logn++]=x; } -/* Interface with grub */ -extern grub_uint8_t efiemu_ptv_relocated; -struct grub_efi_runtime_services efiemu_runtime_services; -struct grub_efi_system_table efiemu_system_table; -extern struct grub_efiemu_ptv_rel efiemu_ptv_relloc[]; -extern grub_uint8_t efiemu_variables[]; -extern grub_uint32_t efiemu_varsize; -extern grub_uint32_t efiemu_high_monotonic_count; -extern grub_int16_t efiemu_time_zone; -extern grub_uint8_t efiemu_time_daylight; -extern grub_uint32_t efiemu_time_accuracy; +/* Interface with VasEBoot */ +extern VasEBoot_uint8_t efiemu_ptv_relocated; +struct VasEBoot_efi_runtime_services efiemu_runtime_services; +struct VasEBoot_efi_system_table efiemu_system_table; +extern struct VasEBoot_efiemu_ptv_rel efiemu_ptv_relloc[]; +extern VasEBoot_uint8_t efiemu_variables[]; +extern VasEBoot_uint32_t efiemu_varsize; +extern VasEBoot_uint32_t efiemu_high_monotonic_count; +extern VasEBoot_int16_t efiemu_time_zone; +extern VasEBoot_uint8_t efiemu_time_daylight; +extern VasEBoot_uint32_t efiemu_time_accuracy; /* Some standard functions because we need to be standalone */ static void @@ -135,54 +135,54 @@ efiemu_memcpy (void *to, const void *from, int count) { int i; for (i = 0; i < count; i++) - ((grub_uint8_t *) to)[i] = ((const grub_uint8_t *) from)[i]; + ((VasEBoot_uint8_t *) to)[i] = ((const VasEBoot_uint8_t *) from)[i]; } static int -efiemu_str16equal (grub_uint16_t *a, grub_uint16_t *b) +efiemu_str16equal (VasEBoot_uint16_t *a, VasEBoot_uint16_t *b) { - grub_uint16_t *ptr1, *ptr2; + VasEBoot_uint16_t *ptr1, *ptr2; for (ptr1=a,ptr2=b; *ptr1 && *ptr2 == *ptr1; ptr1++, ptr2++); return *ptr2 == *ptr1; } -static grub_size_t -efiemu_str16len (grub_uint16_t *a) +static VasEBoot_size_t +efiemu_str16len (VasEBoot_uint16_t *a) { - grub_uint16_t *ptr1; + VasEBoot_uint16_t *ptr1; for (ptr1 = a; *ptr1; ptr1++); return ptr1 - a; } static int -efiemu_memequal (const void *a, const void *b, grub_size_t n) +efiemu_memequal (const void *a, const void *b, VasEBoot_size_t n) { - grub_uint8_t *ptr1, *ptr2; - for (ptr1 = (grub_uint8_t *) a, ptr2 = (grub_uint8_t *)b; - ptr1 < (grub_uint8_t *)a + n && *ptr2 == *ptr1; ptr1++, ptr2++); + VasEBoot_uint8_t *ptr1, *ptr2; + for (ptr1 = (VasEBoot_uint8_t *) a, ptr2 = (VasEBoot_uint8_t *)b; + ptr1 < (VasEBoot_uint8_t *)a + n && *ptr2 == *ptr1; ptr1++, ptr2++); return ptr1 == a + n; } static void -efiemu_memset (grub_uint8_t *a, grub_uint8_t b, grub_size_t n) +efiemu_memset (VasEBoot_uint8_t *a, VasEBoot_uint8_t b, VasEBoot_size_t n) { - grub_uint8_t *ptr1; + VasEBoot_uint8_t *ptr1; for (ptr1=a; ptr1 < a + n; ptr1++) *ptr1 = b; } static inline void -write_cmos (grub_uint8_t addr, grub_uint8_t val) +write_cmos (VasEBoot_uint8_t addr, VasEBoot_uint8_t val) { __asm__ __volatile__ ("outb %%al,$0x70\n" "mov %%cl, %%al\n" "outb %%al,$0x71": :"a" (addr), "c" (val)); } -static inline grub_uint8_t -read_cmos (grub_uint8_t addr) +static inline VasEBoot_uint8_t +read_cmos (VasEBoot_uint8_t addr) { - grub_uint8_t ret; + VasEBoot_uint8_t ret; __asm__ __volatile__ ("outb %%al, $0x70\n" "inb $0x71, %%al": "=a"(ret) :"a" (addr)); return ret; @@ -196,18 +196,18 @@ int __stack_chk_fail () /* The function that implement runtime services as specified in EFI specification */ -static inline grub_uint8_t -bcd_to_hex (grub_uint8_t in) +static inline VasEBoot_uint8_t +bcd_to_hex (VasEBoot_uint8_t in) { return 10 * ((in & 0xf0) >> 4) + (in & 0x0f); } -grub_efi_status_t -EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time, - grub_efi_time_capabilities_t *capabilities) +VasEBoot_efi_status_t +EFI_FUNC (efiemu_get_time) (VasEBoot_efi_time_t *time, + VasEBoot_efi_time_capabilities_t *capabilities) { LOG ('a'); - grub_uint8_t state; + VasEBoot_uint8_t state; state = read_cmos (0xb); if (!(state & (1 << 2))) { @@ -243,14 +243,14 @@ EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time, capabilities->resolution = 1; capabilities->accuracy = efiemu_time_accuracy; capabilities->sets_to_zero = 0; - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } -grub_efi_status_t -EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time) +VasEBoot_efi_status_t +EFI_FUNC (efiemu_set_time) (VasEBoot_efi_time_t *time) { LOG ('b'); - grub_uint8_t state; + VasEBoot_uint8_t state; state = read_cmos (0xb); write_cmos (0xb, state | 0x6); write_cmos (0x9, time->year - 2000); @@ -261,33 +261,33 @@ EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time) write_cmos (0x0, time->second); efiemu_time_zone = time->time_zone; efiemu_time_daylight = time->daylight; - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } /* Following 2 functions are vendor specific. So announce it as unsupported */ -grub_efi_status_t -EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled, - grub_efi_boolean_t *pending, - grub_efi_time_t *time) +VasEBoot_efi_status_t +EFI_FUNC (efiemu_get_wakeup_time) (VasEBoot_efi_boolean_t *enabled, + VasEBoot_efi_boolean_t *pending, + VasEBoot_efi_time_t *time) { LOG ('c'); - return GRUB_EFI_UNSUPPORTED; + return VasEBoot_EFI_UNSUPPORTED; } -grub_efi_status_t -EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled, - grub_efi_time_t *time) +VasEBoot_efi_status_t +EFI_FUNC (efiemu_set_wakeup_time) (VasEBoot_efi_boolean_t enabled, + VasEBoot_efi_time_t *time) { LOG ('d'); - return GRUB_EFI_UNSUPPORTED; + return VasEBoot_EFI_UNSUPPORTED; } -static grub_uint32_t crc32_table [256]; +static VasEBoot_uint32_t crc32_table [256]; -static grub_uint32_t -reflect (grub_uint32_t ref, int len) +static VasEBoot_uint32_t +reflect (VasEBoot_uint32_t ref, int len) { - grub_uint32_t result = 0; + VasEBoot_uint32_t result = 0; int i; for (i = 1; i <= len; i++) @@ -303,7 +303,7 @@ reflect (grub_uint32_t ref, int len) static void init_crc32_table (void) { - grub_uint32_t polynomial = 0x04c11db7; + VasEBoot_uint32_t polynomial = 0x04c11db7; int i, j; for(i = 0; i < 256; i++) @@ -316,11 +316,11 @@ init_crc32_table (void) } } -static grub_uint32_t -efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) +static VasEBoot_uint32_t +efiemu_getcrc32 (VasEBoot_uint32_t crc, void *buf, int size) { int i; - grub_uint8_t *data = buf; + VasEBoot_uint8_t *data = buf; if (! crc32_table[1]) init_crc32_table (); @@ -337,33 +337,33 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) } -grub_efi_status_t EFI_FUNC -(efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map) +VasEBoot_efi_status_t EFI_FUNC +(efiemu_set_virtual_address_map) (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version, + VasEBoot_efi_memory_descriptor_t *virtual_map) { - struct grub_efiemu_ptv_rel *cur_relloc; + struct VasEBoot_efiemu_ptv_rel *cur_relloc; LOG ('e'); /* Ensure that we are called only once */ if (efiemu_ptv_relocated) - return GRUB_EFI_UNSUPPORTED; + return VasEBoot_EFI_UNSUPPORTED; efiemu_ptv_relocated = 1; - /* Correct addresses using information supplied by grub */ + /* Correct addresses using information supplied by VasEBoot */ for (cur_relloc = efiemu_ptv_relloc; cur_relloc->size;cur_relloc++) { - grub_int64_t corr = 0; - grub_efi_memory_descriptor_t *descptr; + VasEBoot_int64_t corr = 0; + VasEBoot_efi_memory_descriptor_t *descptr; /* Compute correction */ for (descptr = virtual_map; - ((grub_uint8_t *) descptr - (grub_uint8_t *) virtual_map) + ((VasEBoot_uint8_t *) descptr - (VasEBoot_uint8_t *) virtual_map) < memory_map_size; - descptr = (grub_efi_memory_descriptor_t *) - ((grub_uint8_t *) descptr + descriptor_size)) + descptr = (VasEBoot_efi_memory_descriptor_t *) + ((VasEBoot_uint8_t *) descptr + descriptor_size)) { if (descptr->type == cur_relloc->plustype) corr += descptr->virtual_start - descptr->physical_start; @@ -375,16 +375,16 @@ grub_efi_status_t EFI_FUNC switch (cur_relloc->size) { case 8: - *((grub_uint64_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint64_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; case 4: - *((grub_uint32_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint32_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; case 2: - *((grub_uint16_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint16_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; case 1: - *((grub_uint8_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint8_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; } } @@ -398,17 +398,17 @@ grub_efi_status_t EFI_FUNC efiemu_runtime_services.hdr.crc32 = efiemu_getcrc32 (0, &efiemu_runtime_services, sizeof (efiemu_runtime_services)); - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } /* since efiemu_set_virtual_address_map corrects all the pointers we don't need efiemu_convert_pointer */ -grub_efi_status_t -EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, +VasEBoot_efi_status_t +EFI_FUNC (efiemu_convert_pointer) (VasEBoot_efi_uintn_t debug_disposition, void **address) { LOG ('f'); - return GRUB_EFI_UNSUPPORTED; + return VasEBoot_EFI_UNSUPPORTED; } /* Next comes variable services. Because we have no vendor-independent @@ -416,10 +416,10 @@ EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, /* Find variable by name and GUID. */ static struct efi_variable * -find_variable (const grub_efi_guid_t *vendor_guid, - grub_efi_char16_t *variable_name) +find_variable (const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_char16_t *variable_name) { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; struct efi_variable *efivar; for (ptr = efiemu_variables; ptr < efiemu_variables + efiemu_varsize; ) @@ -427,7 +427,7 @@ find_variable (const grub_efi_guid_t *vendor_guid, efivar = (struct efi_variable *) ptr; if (!efivar->namelen) return 0; - if (efiemu_str16equal((grub_efi_char16_t *)(efivar + 1), variable_name) + if (efiemu_str16equal((VasEBoot_efi_char16_t *)(efivar + 1), variable_name) && efiemu_memequal (&(efivar->guid), vendor_guid, sizeof (efivar->guid))) return efivar; @@ -436,47 +436,47 @@ find_variable (const grub_efi_guid_t *vendor_guid, return 0; } -grub_efi_status_t -EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name, - const grub_efi_guid_t *vendor_guid, - grub_efi_uint32_t *attributes, - grub_efi_uintn_t *data_size, +VasEBoot_efi_status_t +EFI_FUNC (efiemu_get_variable) (VasEBoot_efi_char16_t *variable_name, + const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_uint32_t *attributes, + VasEBoot_efi_uintn_t *data_size, void *data) { struct efi_variable *efivar; LOG ('g'); efivar = find_variable (vendor_guid, variable_name); if (!efivar) - return GRUB_EFI_NOT_FOUND; + return VasEBoot_EFI_NOT_FOUND; if (*data_size < efivar->size) { *data_size = efivar->size; - return GRUB_EFI_BUFFER_TOO_SMALL; + return VasEBoot_EFI_BUFFER_TOO_SMALL; } *data_size = efivar->size; - efiemu_memcpy (data, (grub_uint8_t *)(efivar + 1) + efivar->namelen, + efiemu_memcpy (data, (VasEBoot_uint8_t *)(efivar + 1) + efivar->namelen, efivar->size); *attributes = efivar->attributes; - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } -grub_efi_status_t EFI_FUNC -(efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size, - grub_efi_char16_t *variable_name, - grub_efi_guid_t *vendor_guid) +VasEBoot_efi_status_t EFI_FUNC +(efiemu_get_next_variable_name) (VasEBoot_efi_uintn_t *variable_name_size, + VasEBoot_efi_char16_t *variable_name, + VasEBoot_efi_guid_t *vendor_guid) { struct efi_variable *efivar; LOG ('l'); if (!variable_name_size || !variable_name || !vendor_guid) - return GRUB_EFI_INVALID_PARAMETER; + return VasEBoot_EFI_INVALID_PARAMETER; if (variable_name[0]) { efivar = find_variable (vendor_guid, variable_name); if (!efivar) - return GRUB_EFI_NOT_FOUND; - efivar = (struct efi_variable *)((grub_uint8_t *)efivar + return VasEBoot_EFI_NOT_FOUND; + efivar = (struct efi_variable *)((VasEBoot_uint8_t *)efivar + efivar->namelen + efivar->size + sizeof (*efivar)); } @@ -484,13 +484,13 @@ grub_efi_status_t EFI_FUNC efivar = (struct efi_variable *) (efiemu_variables); LOG ('m'); - if ((grub_uint8_t *)efivar >= efiemu_variables + efiemu_varsize + if ((VasEBoot_uint8_t *)efivar >= efiemu_variables + efiemu_varsize || !efivar->namelen) - return GRUB_EFI_NOT_FOUND; + return VasEBoot_EFI_NOT_FOUND; if (*variable_name_size < efivar->namelen) { *variable_name_size = efivar->namelen; - return GRUB_EFI_BUFFER_TOO_SMALL; + return VasEBoot_EFI_BUFFER_TOO_SMALL; } efiemu_memcpy (variable_name, efivar + 1, efivar->namelen); @@ -498,30 +498,30 @@ grub_efi_status_t EFI_FUNC sizeof (efivar->guid)); LOG('h'); - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } -grub_efi_status_t -EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, - const grub_efi_guid_t *vendor_guid, - grub_efi_uint32_t attributes, - grub_efi_uintn_t data_size, +VasEBoot_efi_status_t +EFI_FUNC (efiemu_set_variable) (VasEBoot_efi_char16_t *variable_name, + const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_uint32_t attributes, + VasEBoot_efi_uintn_t data_size, void *data) { struct efi_variable *efivar; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; LOG('i'); if (!variable_name[0]) - return GRUB_EFI_INVALID_PARAMETER; + return VasEBoot_EFI_INVALID_PARAMETER; efivar = find_variable (vendor_guid, variable_name); /* Delete variable if any */ if (efivar) { - efiemu_memcpy (efivar, (grub_uint8_t *)(efivar + 1) + efiemu_memcpy (efivar, (VasEBoot_uint8_t *)(efivar + 1) + efivar->namelen + efivar->size, (efiemu_variables + efiemu_varsize) - - ((grub_uint8_t *)(efivar + 1) + - ((VasEBoot_uint8_t *)(efivar + 1) + efivar->namelen + efivar->size)); efiemu_memset (efiemu_variables + efiemu_varsize - (sizeof (*efivar) + efivar->namelen + efivar->size), @@ -529,7 +529,7 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, } if (!data_size) - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; for (ptr = efiemu_variables; ptr < efiemu_variables + efiemu_varsize; ) { @@ -538,10 +538,10 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, if (!efivar->namelen) break; } - if ((grub_uint8_t *)(efivar + 1) + data_size + if ((VasEBoot_uint8_t *)(efivar + 1) + data_size + 2 * (efiemu_str16len (variable_name) + 1) >= efiemu_variables + efiemu_varsize) - return GRUB_EFI_OUT_OF_RESOURCES; + return VasEBoot_EFI_OUT_OF_RESOURCES; efiemu_memcpy (&(efivar->guid), vendor_guid, sizeof (efivar->guid)); efivar->namelen = 2 * (efiemu_str16len (variable_name) + 1); @@ -549,21 +549,21 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, efivar->attributes = attributes; efiemu_memcpy (efivar + 1, variable_name, 2 * (efiemu_str16len (variable_name) + 1)); - efiemu_memcpy ((grub_uint8_t *)(efivar + 1) + efiemu_memcpy ((VasEBoot_uint8_t *)(efivar + 1) + 2 * (efiemu_str16len (variable_name) + 1), data, data_size); - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } -grub_efi_status_t EFI_FUNC -(efiemu_get_next_high_monotonic_count) (grub_efi_uint32_t *high_count) +VasEBoot_efi_status_t EFI_FUNC +(efiemu_get_next_high_monotonic_count) (VasEBoot_efi_uint32_t *high_count) { LOG ('j'); if (!high_count) - return GRUB_EFI_INVALID_PARAMETER; + return VasEBoot_EFI_INVALID_PARAMETER; *high_count = ++efiemu_high_monotonic_count; - return GRUB_EFI_SUCCESS; + return VasEBoot_EFI_SUCCESS; } /* To implement it with APM we need to go to real mode. It's too much hassle @@ -571,21 +571,21 @@ grub_efi_status_t EFI_FUNC on systems supporting ACPI */ void -EFI_FUNC (efiemu_reset_system) (grub_efi_reset_type_t reset_type, - grub_efi_status_t reset_status, - grub_efi_uintn_t data_size, - grub_efi_char16_t *reset_data) +EFI_FUNC (efiemu_reset_system) (VasEBoot_efi_reset_type_t reset_type, + VasEBoot_efi_status_t reset_status, + VasEBoot_efi_uintn_t data_size, + VasEBoot_efi_char16_t *reset_data) { LOG ('k'); } -struct grub_efi_runtime_services efiemu_runtime_services = +struct VasEBoot_efi_runtime_services efiemu_runtime_services = { .hdr = { - .signature = GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE, + .signature = VasEBoot_EFIEMU_RUNTIME_SERVICES_SIGNATURE, .revision = 0x0001000a, - .header_size = sizeof (struct grub_efi_runtime_services), + .header_size = sizeof (struct VasEBoot_efi_runtime_services), .crc32 = 0, /* filled later*/ .reserved = 0 }, @@ -606,17 +606,17 @@ struct grub_efi_runtime_services efiemu_runtime_services = }; -static grub_uint16_t efiemu_vendor[] = +static VasEBoot_uint16_t efiemu_vendor[] = {'G', 'R', 'U', 'B', ' ', 'E', 'F', 'I', ' ', 'R', 'U', 'N', 'T', 'I', 'M', 'E', 0}; -struct grub_efi_system_table efiemu_system_table = +struct VasEBoot_efi_system_table efiemu_system_table = { .hdr = { - .signature = GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE, + .signature = VasEBoot_EFIEMU_SYSTEM_TABLE_SIGNATURE, .revision = 0x0001000a, - .header_size = sizeof (struct grub_efi_system_table), + .header_size = sizeof (struct VasEBoot_efi_system_table), .crc32 = 0, /* filled later*/ .reserved = 0 }, diff --git a/VasEBoot-core/efiemu/symbols.c b/VasEBoot-core/efiemu/symbols.c index cc148552d..fe0870208 100644 --- a/VasEBoot-core/efiemu/symbols.c +++ b/VasEBoot-core/efiemu/symbols.c @@ -1,107 +1,107 @@ /* Code for managing symbols and pointers in efiemu */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static int ptv_written = 0; static int ptv_alloc = 0; static int ptv_handle = 0; static int relocated_handle = 0; static int ptv_requested = 0; -static struct grub_efiemu_sym *efiemu_syms = 0; +static struct VasEBoot_efiemu_sym *efiemu_syms = 0; -struct grub_efiemu_sym +struct VasEBoot_efiemu_sym { - struct grub_efiemu_sym *next; + struct VasEBoot_efiemu_sym *next; char *name; int handle; - grub_off_t off; + VasEBoot_off_t off; }; void -grub_efiemu_free_syms (void) +VasEBoot_efiemu_free_syms (void) { - struct grub_efiemu_sym *cur, *d; + struct VasEBoot_efiemu_sym *cur, *d; for (cur = efiemu_syms; cur;) { d = cur->next; - grub_free (cur->name); - grub_free (cur); + VasEBoot_free (cur->name); + VasEBoot_free (cur); cur = d; } efiemu_syms = 0; ptv_written = 0; ptv_alloc = 0; ptv_requested = 0; - grub_efiemu_mm_return_request (ptv_handle); + VasEBoot_efiemu_mm_return_request (ptv_handle); ptv_handle = 0; - grub_efiemu_mm_return_request (relocated_handle); + VasEBoot_efiemu_mm_return_request (relocated_handle); relocated_handle = 0; } /* Announce that the module will need NUM allocators */ /* Because of deferred memory allocation all the relocators have to be announced during phase 1*/ -grub_err_t -grub_efiemu_request_symbols (int num) +VasEBoot_err_t +VasEBoot_efiemu_request_symbols (int num) { if (ptv_alloc) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "symbols have already been allocated"); if (num < 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "can't request negative symbols"); ptv_requested += num; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Resolve the symbol name NAME and set HANDLE and OFF accordingly */ -grub_err_t -grub_efiemu_resolve_symbol (const char *name, int *handle, grub_off_t *off) +VasEBoot_err_t +VasEBoot_efiemu_resolve_symbol (const char *name, int *handle, VasEBoot_off_t *off) { - struct grub_efiemu_sym *cur; + struct VasEBoot_efiemu_sym *cur; for (cur = efiemu_syms; cur; cur = cur->next) - if (!grub_strcmp (name, cur->name)) + if (!VasEBoot_strcmp (name, cur->name)) { *handle = cur->handle; *off = cur->off; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - grub_dprintf ("efiemu", "%s not found\n", name); - return grub_error (GRUB_ERR_BAD_OS, N_("symbol `%s' not found"), name); + VasEBoot_dprintf ("efiemu", "%s not found\n", name); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("symbol `%s' not found"), name); } /* Register symbol named NAME in memory handle HANDLE at offset OFF */ -grub_err_t -grub_efiemu_register_symbol (const char *name, int handle, grub_off_t off) +VasEBoot_err_t +VasEBoot_efiemu_register_symbol (const char *name, int handle, VasEBoot_off_t off) { - struct grub_efiemu_sym *cur; - cur = (struct grub_efiemu_sym *) grub_malloc (sizeof (*cur)); - grub_dprintf ("efiemu", "registering symbol '%s'\n", name); + struct VasEBoot_efiemu_sym *cur; + cur = (struct VasEBoot_efiemu_sym *) VasEBoot_malloc (sizeof (*cur)); + VasEBoot_dprintf ("efiemu", "registering symbol '%s'\n", name); if (!cur) - return grub_errno; - cur->name = grub_strdup (name); + return VasEBoot_errno; + cur->name = VasEBoot_strdup (name); cur->next = efiemu_syms; cur->handle = handle; cur->off = off; @@ -111,31 +111,31 @@ grub_efiemu_register_symbol (const char *name, int handle, grub_off_t off) } /* Go from phase 1 to phase 2. Must be called before similar function in mm.c */ -grub_err_t -grub_efiemu_alloc_syms (void) +VasEBoot_err_t +VasEBoot_efiemu_alloc_syms (void) { ptv_alloc = ptv_requested; - ptv_handle = grub_efiemu_request_memalign - (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel), - GRUB_EFI_RUNTIME_SERVICES_DATA); - relocated_handle = grub_efiemu_request_memalign - (1, sizeof (grub_uint8_t), GRUB_EFI_RUNTIME_SERVICES_DATA); + ptv_handle = VasEBoot_efiemu_request_memalign + (1, (ptv_requested + 1) * sizeof (struct VasEBoot_efiemu_ptv_rel), + VasEBoot_EFI_RUNTIME_SERVICES_DATA); + relocated_handle = VasEBoot_efiemu_request_memalign + (1, sizeof (VasEBoot_uint8_t), VasEBoot_EFI_RUNTIME_SERVICES_DATA); - grub_efiemu_register_symbol ("efiemu_ptv_relocated", relocated_handle, 0); - grub_efiemu_register_symbol ("efiemu_ptv_relloc", ptv_handle, 0); - return grub_errno; + VasEBoot_efiemu_register_symbol ("efiemu_ptv_relocated", relocated_handle, 0); + VasEBoot_efiemu_register_symbol ("efiemu_ptv_relloc", ptv_handle, 0); + return VasEBoot_errno; } -grub_err_t -grub_efiemu_write_sym_markers (void) +VasEBoot_err_t +VasEBoot_efiemu_write_sym_markers (void) { - struct grub_efiemu_ptv_rel *ptv_rels - = grub_efiemu_mm_obtain_request (ptv_handle); - grub_uint8_t *relocated = grub_efiemu_mm_obtain_request (relocated_handle); - grub_memset (ptv_rels, 0, (ptv_requested + 1) - * sizeof (struct grub_efiemu_ptv_rel)); + struct VasEBoot_efiemu_ptv_rel *ptv_rels + = VasEBoot_efiemu_mm_obtain_request (ptv_handle); + VasEBoot_uint8_t *relocated = VasEBoot_efiemu_mm_obtain_request (relocated_handle); + VasEBoot_memset (ptv_rels, 0, (ptv_requested + 1) + * sizeof (struct VasEBoot_efiemu_ptv_rel)); *relocated = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Write value (pointer to memory PLUS_HANDLE) @@ -143,101 +143,101 @@ grub_efiemu_write_sym_markers (void) size SIZE bytes. If PTV_NEEDED is 1 then announce it to runtime that this value needs to be recomputed before going to virtual mode */ -grub_err_t -grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle, +VasEBoot_err_t +VasEBoot_efiemu_write_value (void *addr, VasEBoot_uint32_t value, int plus_handle, int minus_handle, int ptv_needed, int size) { /* Announce relocator to runtime */ if (ptv_needed) { - struct grub_efiemu_ptv_rel *ptv_rels - = grub_efiemu_mm_obtain_request (ptv_handle); + struct VasEBoot_efiemu_ptv_rel *ptv_rels + = VasEBoot_efiemu_mm_obtain_request (ptv_handle); if (ptv_needed && ptv_written >= ptv_alloc) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "your module didn't declare efiemu " " relocators correctly"); if (minus_handle) ptv_rels[ptv_written].minustype - = grub_efiemu_mm_get_type (minus_handle); + = VasEBoot_efiemu_mm_get_type (minus_handle); else ptv_rels[ptv_written].minustype = 0; if (plus_handle) ptv_rels[ptv_written].plustype - = grub_efiemu_mm_get_type (plus_handle); + = VasEBoot_efiemu_mm_get_type (plus_handle); else ptv_rels[ptv_written].plustype = 0; - ptv_rels[ptv_written].addr = (grub_addr_t) addr; + ptv_rels[ptv_written].addr = (VasEBoot_addr_t) addr; ptv_rels[ptv_written].size = size; ptv_written++; /* memset next value to zero to mark the end */ - grub_memset (&ptv_rels[ptv_written], 0, sizeof (ptv_rels[ptv_written])); + VasEBoot_memset (&ptv_rels[ptv_written], 0, sizeof (ptv_rels[ptv_written])); } /* Compute the value */ if (minus_handle) - value -= (grub_addr_t) grub_efiemu_mm_obtain_request (minus_handle); + value -= (VasEBoot_addr_t) VasEBoot_efiemu_mm_obtain_request (minus_handle); if (plus_handle) - value += (grub_addr_t) grub_efiemu_mm_obtain_request (plus_handle); + value += (VasEBoot_addr_t) VasEBoot_efiemu_mm_obtain_request (plus_handle); /* Write the value */ switch (size) { case 8: - *((grub_uint64_t *) addr) = value; + *((VasEBoot_uint64_t *) addr) = value; break; case 4: - *((grub_uint32_t *) addr) = value; + *((VasEBoot_uint32_t *) addr) = value; break; case 2: - *((grub_uint16_t *) addr) = value; + *((VasEBoot_uint16_t *) addr) = value; break; case 1: - *((grub_uint8_t *) addr) = value; + *((VasEBoot_uint8_t *) addr) = value; break; default: - return grub_error (GRUB_ERR_BUG, "wrong symbol size"); + return VasEBoot_error (VasEBoot_ERR_BUG, "wrong symbol size"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version +VasEBoot_err_t +VasEBoot_efiemu_set_virtual_address_map (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version __attribute__ ((unused)), - grub_efi_memory_descriptor_t *virtual_map) + VasEBoot_efi_memory_descriptor_t *virtual_map) { - grub_uint8_t *ptv_relocated; - struct grub_efiemu_ptv_rel *cur_relloc; - struct grub_efiemu_ptv_rel *ptv_rels; + VasEBoot_uint8_t *ptv_relocated; + struct VasEBoot_efiemu_ptv_rel *cur_relloc; + struct VasEBoot_efiemu_ptv_rel *ptv_rels; - ptv_relocated = grub_efiemu_mm_obtain_request (relocated_handle); - ptv_rels = grub_efiemu_mm_obtain_request (ptv_handle); + ptv_relocated = VasEBoot_efiemu_mm_obtain_request (relocated_handle); + ptv_rels = VasEBoot_efiemu_mm_obtain_request (ptv_handle); /* Ensure that we are called only once */ if (*ptv_relocated) - return grub_error (GRUB_ERR_BUG, "EfiEmu is already relocated"); + return VasEBoot_error (VasEBoot_ERR_BUG, "EfiEmu is already relocated"); *ptv_relocated = 1; - /* Correct addresses using information supplied by grub */ + /* Correct addresses using information supplied by VasEBoot */ for (cur_relloc = ptv_rels; cur_relloc->size; cur_relloc++) { - grub_int64_t corr = 0; - grub_efi_memory_descriptor_t *descptr; + VasEBoot_int64_t corr = 0; + VasEBoot_efi_memory_descriptor_t *descptr; /* Compute correction */ for (descptr = virtual_map; - (grub_size_t) ((grub_uint8_t *) descptr - - (grub_uint8_t *) virtual_map) < memory_map_size; - descptr = (grub_efi_memory_descriptor_t *) - ((grub_uint8_t *) descptr + descriptor_size)) + (VasEBoot_size_t) ((VasEBoot_uint8_t *) descptr + - (VasEBoot_uint8_t *) virtual_map) < memory_map_size; + descptr = (VasEBoot_efi_memory_descriptor_t *) + ((VasEBoot_uint8_t *) descptr + descriptor_size)) { if (descptr->type == cur_relloc->plustype) corr += descptr->virtual_start - descptr->physical_start; @@ -249,24 +249,24 @@ grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, switch (cur_relloc->size) { case 8: - *((grub_uint64_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint64_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; case 4: - *((grub_uint32_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint32_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; case 2: - *((grub_uint16_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint16_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; case 1: - *((grub_uint8_t *) (grub_addr_t) cur_relloc->addr) += corr; + *((VasEBoot_uint8_t *) (VasEBoot_addr_t) cur_relloc->addr) += corr; break; } } /* Recompute crc32 of system table and runtime services */ - if (grub_efiemu_sizeof_uintn_t () == 4) - return grub_efiemu_crc32 (); + if (VasEBoot_efiemu_sizeof_uintn_t () == 4) + return VasEBoot_efiemu_crc32 (); else - return grub_efiemu_crc64 (); + return VasEBoot_efiemu_crc64 (); } diff --git a/VasEBoot-core/font/font.c b/VasEBoot-core/font/font.c index 53d76a64d..acc5e19b7 100644 --- a/VasEBoot-core/font/font.c +++ b/VasEBoot-core/font/font.c @@ -1,37 +1,37 @@ /* font.c - Font API and font file loader. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #if HAVE_FONT_SOURCE #include "ascii.h" @@ -43,12 +43,12 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct char_index_entry { - grub_uint32_t code; - grub_uint8_t storage_flags; - grub_uint32_t offset; + VasEBoot_uint32_t code; + VasEBoot_uint8_t storage_flags; + VasEBoot_uint32_t offset; /* Glyph if loaded, or NULL otherwise. */ - struct grub_font_glyph *glyph; + struct VasEBoot_font_glyph *glyph; }; #define FONT_WEIGHT_NORMAL 100 @@ -56,30 +56,30 @@ struct char_index_entry #define ASCII_BITMAP_SIZE 16 /* Definition of font registry. */ -struct grub_font_node *grub_font_list; +struct VasEBoot_font_node *VasEBoot_font_list; -static int register_font (grub_font_t font); -static void font_init (grub_font_t font); -static void free_font (grub_font_t font); -static void remove_font (grub_font_t font); +static int register_font (VasEBoot_font_t font); +static void font_init (VasEBoot_font_t font); +static void free_font (VasEBoot_font_t font); +static void remove_font (VasEBoot_font_t font); struct font_file_section { /* The file this section is in. */ - grub_file_t file; + VasEBoot_file_t file; /* FOURCC name of the section. */ char name[4]; /* Length of the section contents. */ - grub_uint32_t length; + VasEBoot_uint32_t length; /* Set by open_section() on EOF. */ int eof; }; /* Replace unknown glyphs with a rounded question mark. */ -static grub_uint8_t unknown_glyph_bitmap[] = { +static VasEBoot_uint8_t unknown_glyph_bitmap[] = { /* 76543210 */ 0x7C, /* ooooo */ 0x82, /* o o */ @@ -100,22 +100,22 @@ static grub_uint8_t unknown_glyph_bitmap[] = { }; /* The "unknown glyph" glyph, used as a last resort. */ -static struct grub_font_glyph *unknown_glyph; +static struct VasEBoot_font_glyph *unknown_glyph; /* The font structure used when no other font is loaded. This functions as a "Null Object" pattern, so that code everywhere does not have to - check for a NULL grub_font_t to avoid dereferencing a null pointer. */ -static struct grub_font null_font; + check for a NULL VasEBoot_font_t to avoid dereferencing a null pointer. */ +static struct VasEBoot_font null_font; /* Flag to ensure module is initialized only once. */ -static grub_uint8_t font_loader_initialized; +static VasEBoot_uint8_t font_loader_initialized; #if HAVE_FONT_SOURCE -static struct grub_font_glyph *ascii_font_glyph[0x80]; +static struct VasEBoot_font_glyph *ascii_font_glyph[0x80]; #endif -static struct grub_font_glyph * -ascii_glyph_lookup (grub_uint32_t code) +static struct VasEBoot_font_glyph * +ascii_glyph_lookup (VasEBoot_uint32_t code) { #if HAVE_FONT_SOURCE static int ascii_failback_initialized = 0; @@ -129,7 +129,7 @@ ascii_glyph_lookup (grub_uint32_t code) for (current = 0; current < 0x80; current++) { ascii_font_glyph[current] = - grub_malloc (sizeof (struct grub_font_glyph) + ASCII_BITMAP_SIZE); + VasEBoot_malloc (sizeof (struct VasEBoot_font_glyph) + ASCII_BITMAP_SIZE); ascii_font_glyph[current]->width = 8; ascii_font_glyph[current]->height = 16; @@ -138,7 +138,7 @@ ascii_glyph_lookup (grub_uint32_t code) ascii_font_glyph[current]->device_width = 8; ascii_font_glyph[current]->font = NULL; - grub_memcpy (ascii_font_glyph[current]->bitmap, + VasEBoot_memcpy (ascii_font_glyph[current]->bitmap, &ascii_bitmaps[current * ASCII_BITMAP_SIZE], ASCII_BITMAP_SIZE); } @@ -154,14 +154,14 @@ ascii_glyph_lookup (grub_uint32_t code) } void -grub_font_loader_init (void) +VasEBoot_font_loader_init (void) { /* Only initialize font loader once. */ if (font_loader_initialized) return; /* Make glyph for unknown glyph. */ - unknown_glyph = grub_malloc (sizeof (struct grub_font_glyph) + unknown_glyph = VasEBoot_malloc (sizeof (struct VasEBoot_font_glyph) + sizeof (unknown_glyph_bitmap)); if (!unknown_glyph) return; @@ -171,7 +171,7 @@ grub_font_loader_init (void) unknown_glyph->offset_x = 0; unknown_glyph->offset_y = -3; unknown_glyph->device_width = 8; - grub_memcpy (unknown_glyph->bitmap, + VasEBoot_memcpy (unknown_glyph->bitmap, unknown_glyph_bitmap, sizeof (unknown_glyph_bitmap)); /* Initialize the null font. */ @@ -188,7 +188,7 @@ grub_font_loader_init (void) /* Initialize the font object with initial default values. */ static void -font_init (grub_font_t font) +font_init (VasEBoot_font_t font) { font->name = 0; font->file = 0; @@ -212,21 +212,21 @@ font_init (grub_font_t font) On success, the section name is stored in section->name and the length in section->length, and 0 is returned. On failure, 1 is returned and - grub_errno is set appropriately with an error message. + VasEBoot_errno is set appropriately with an error message. If 1 is returned due to being at the end of the file, then section->eof is set to 1; otherwise, section->eof is set to 0. */ static int -open_section (grub_file_t file, struct font_file_section *section) +open_section (VasEBoot_file_t file, struct font_file_section *section) { - grub_ssize_t retval; - grub_uint32_t raw_length; + VasEBoot_ssize_t retval; + VasEBoot_uint32_t raw_length; section->file = file; section->eof = 0; /* Read the FOURCC section name. */ - retval = grub_file_read (file, section->name, 4); + retval = VasEBoot_file_read (file, section->name, 4); if (retval >= 0 && retval < 4) { /* EOF encountered. */ @@ -240,7 +240,7 @@ open_section (grub_file_t file, struct font_file_section *section) } /* Read the big-endian 32-bit section length. */ - retval = grub_file_read (file, &raw_length, 4); + retval = VasEBoot_file_read (file, &raw_length, 4); if (retval >= 0 && retval < 4) { /* EOF encountered. */ @@ -254,7 +254,7 @@ open_section (grub_file_t file, struct font_file_section *section) } /* Convert byte-order and store in *length. */ - section->length = grub_be_to_cpu32 (raw_length); + section->length = VasEBoot_be_to_cpu32 (raw_length); return 0; } @@ -267,22 +267,22 @@ open_section (grub_file_t file, struct font_file_section *section) presumes that the position of FILE is positioned immediately after the section length for the CHIX section (i.e., at the start of the section contents). Returns 0 upon success, nonzero for failure (in which case - grub_errno is set appropriately). */ + VasEBoot_errno is set appropriately). */ static int -load_font_index (grub_file_t file, grub_uint32_t sect_length, struct - grub_font *font) +load_font_index (VasEBoot_file_t file, VasEBoot_uint32_t sect_length, struct + VasEBoot_font *font) { unsigned i; - grub_uint32_t last_code; + VasEBoot_uint32_t last_code; #if FONT_DEBUG >= 2 - grub_dprintf ("font", "load_font_index(sect_length=%d)\n", sect_length); + VasEBoot_dprintf ("font", "load_font_index(sect_length=%d)\n", sect_length); #endif /* Sanity check: ensure section length is divisible by the entry size. */ if ((sect_length % FONT_CHAR_INDEX_ENTRY_SIZE) != 0) { - grub_error (GRUB_ERR_BAD_FONT, + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "font file format error: character index length %d " "is not a multiple of the entry size %d", sect_length, FONT_CHAR_INDEX_ENTRY_SIZE); @@ -293,18 +293,18 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct font->num_chars = sect_length / FONT_CHAR_INDEX_ENTRY_SIZE; /* Allocate the character index array. */ - font->char_index = grub_malloc (font->num_chars + font->char_index = VasEBoot_malloc (font->num_chars * sizeof (struct char_index_entry)); if (!font->char_index) return 1; - font->bmp_idx = grub_malloc (0x10000 * sizeof (grub_uint16_t)); + font->bmp_idx = VasEBoot_malloc (0x10000 * sizeof (VasEBoot_uint16_t)); if (!font->bmp_idx) return 1; - grub_memset (font->bmp_idx, 0xff, 0x10000 * sizeof (grub_uint16_t)); + VasEBoot_memset (font->bmp_idx, 0xff, 0x10000 * sizeof (VasEBoot_uint16_t)); #if FONT_DEBUG >= 2 - grub_dprintf ("font", "num_chars=%d)\n", font->num_chars); + VasEBoot_dprintf ("font", "num_chars=%d)\n", font->num_chars); #endif last_code = 0; @@ -315,14 +315,14 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct struct char_index_entry *entry = &font->char_index[i]; /* Read code point value; convert to native byte order. */ - if (grub_file_read (file, &entry->code, 4) != 4) + if (VasEBoot_file_read (file, &entry->code, 4) != 4) return 1; - entry->code = grub_be_to_cpu32 (entry->code); + entry->code = VasEBoot_be_to_cpu32 (entry->code); /* Verify that characters are in ascending order. */ if (i != 0 && entry->code <= last_code) { - grub_error (GRUB_ERR_BAD_FONT, + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "font characters not in ascending order: %u <= %u", entry->code, last_code); return 1; @@ -334,13 +334,13 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct last_code = entry->code; /* Read storage flags byte. */ - if (grub_file_read (file, &entry->storage_flags, 1) != 1) + if (VasEBoot_file_read (file, &entry->storage_flags, 1) != 1) return 1; /* Read glyph data offset; convert to native byte order. */ - if (grub_file_read (file, &entry->offset, 4) != 4) + if (VasEBoot_file_read (file, &entry->offset, 4) != 4) return 1; - entry->offset = grub_be_to_cpu32 (entry->offset); + entry->offset = VasEBoot_be_to_cpu32 (entry->offset); /* No glyph loaded. Will be loaded on demand and cached thereafter. */ entry->glyph = 0; @@ -348,7 +348,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct #if FONT_DEBUG >= 5 /* Print the 1st 10 characters. */ if (i < 10) - grub_dprintf ("font", "c=%d o=%d\n", entry->code, entry->offset); + VasEBoot_dprintf ("font", "c=%d o=%d\n", entry->code, entry->offset); #endif } @@ -361,16 +361,16 @@ static char * read_section_as_string (struct font_file_section *section) { char *str; - grub_ssize_t ret; + VasEBoot_ssize_t ret; - str = grub_malloc (section->length + 1); + str = VasEBoot_malloc (section->length + 1); if (!str) return 0; - ret = grub_file_read (section->file, str, section->length); - if (ret < 0 || ret != (grub_ssize_t) section->length) + ret = VasEBoot_file_read (section->file, str, section->length); + if (ret < 0 || ret != (VasEBoot_ssize_t) section->length) { - grub_free (str); + VasEBoot_free (str); return 0; } @@ -383,69 +383,69 @@ read_section_as_string (struct font_file_section *section) Returns 0 upon success, nonzero upon failure. */ static int read_section_as_short (struct font_file_section *section, - grub_int16_t * value) + VasEBoot_int16_t * value) { - grub_uint16_t raw_value; + VasEBoot_uint16_t raw_value; if (section->length != 2) { - grub_error (GRUB_ERR_BAD_FONT, + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "font file format error: section %c%c%c%c length " "is %d but should be 2", section->name[0], section->name[1], section->name[2], section->name[3], section->length); return 1; } - if (grub_file_read (section->file, &raw_value, 2) != 2) + if (VasEBoot_file_read (section->file, &raw_value, 2) != 2) return 1; - *value = grub_be_to_cpu16 (raw_value); + *value = VasEBoot_be_to_cpu16 (raw_value); return 0; } /* Load a font and add it to the beginning of the global font list. Returns 0 upon success, nonzero upon failure. */ -grub_font_t -grub_font_load (const char *filename) +VasEBoot_font_t +VasEBoot_font_load (const char *filename) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; struct font_file_section section; char magic[4]; - grub_font_t font = 0; + VasEBoot_font_t font = 0; #if FONT_DEBUG >= 1 - grub_dprintf ("font", "add_font(%s)\n", filename); + VasEBoot_dprintf ("font", "add_font(%s)\n", filename); #endif if (filename[0] == '(' || filename[0] == '/' || filename[0] == '+') - file = grub_buffile_open (filename, 1024); + file = VasEBoot_buffile_open (filename, 1024); else { - const char *prefix = grub_env_get ("prefix"); + const char *prefix = VasEBoot_env_get ("prefix"); char *fullname, *ptr; if (!prefix) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); goto fail; } - fullname = grub_malloc (grub_strlen (prefix) + grub_strlen (filename) + 1 + fullname = VasEBoot_malloc (VasEBoot_strlen (prefix) + VasEBoot_strlen (filename) + 1 + sizeof ("/fonts/") + sizeof (".pf2")); if (!fullname) goto fail; - ptr = grub_stpcpy (fullname, prefix); - ptr = grub_stpcpy (ptr, "/fonts/"); - ptr = grub_stpcpy (ptr, filename); - ptr = grub_stpcpy (ptr, ".pf2"); + ptr = VasEBoot_stpcpy (fullname, prefix); + ptr = VasEBoot_stpcpy (ptr, "/fonts/"); + ptr = VasEBoot_stpcpy (ptr, filename); + ptr = VasEBoot_stpcpy (ptr, ".pf2"); *ptr = 0; - file = grub_buffile_open (fullname, 1024); - grub_free (fullname); + file = VasEBoot_buffile_open (fullname, 1024); + VasEBoot_free (fullname); } if (!file) goto fail; #if FONT_DEBUG >= 3 - grub_dprintf ("font", "file opened\n"); + VasEBoot_dprintf ("font", "file opened\n"); #endif /* Read the FILE section. It indicates the file format. */ @@ -453,51 +453,51 @@ grub_font_load (const char *filename) goto fail; #if FONT_DEBUG >= 3 - grub_dprintf ("font", "opened FILE section\n"); + VasEBoot_dprintf ("font", "opened FILE section\n"); #endif - if (grub_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_FILE, + if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_FILE, sizeof (FONT_FORMAT_SECTION_NAMES_FILE) - 1) != 0) { - grub_error (GRUB_ERR_BAD_FONT, + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "font file format error: 1st section must be FILE"); goto fail; } #if FONT_DEBUG >= 3 - grub_dprintf ("font", "section name ok\n"); + VasEBoot_dprintf ("font", "section name ok\n"); #endif if (section.length != 4) { - grub_error (GRUB_ERR_BAD_FONT, + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "font file format error (file type ID length is %d " "but should be 4)", section.length); goto fail; } #if FONT_DEBUG >= 3 - grub_dprintf ("font", "section length ok\n"); + VasEBoot_dprintf ("font", "section length ok\n"); #endif /* Check the file format type code. */ - if (grub_file_read (file, magic, 4) != 4) + if (VasEBoot_file_read (file, magic, 4) != 4) goto fail; #if FONT_DEBUG >= 3 - grub_dprintf ("font", "read magic ok\n"); + VasEBoot_dprintf ("font", "read magic ok\n"); #endif - if (grub_memcmp (magic, FONT_FORMAT_PFF2_MAGIC, 4) != 0) + if (VasEBoot_memcmp (magic, FONT_FORMAT_PFF2_MAGIC, 4) != 0) { - grub_error (GRUB_ERR_BAD_FONT, "invalid font magic %x %x %x %x", + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "invalid font magic %x %x %x %x", magic[0], magic[1], magic[2], magic[3]); goto fail; } #if FONT_DEBUG >= 3 - grub_dprintf ("font", "compare magic ok\n"); + VasEBoot_dprintf ("font", "compare magic ok\n"); #endif /* Allocate the font object. */ - font = (grub_font_t) grub_zalloc (sizeof (struct grub_font)); + font = (VasEBoot_font_t) VasEBoot_zalloc (sizeof (struct VasEBoot_font)); if (!font) goto fail; @@ -505,7 +505,7 @@ grub_font_load (const char *filename) font->file = file; #if FONT_DEBUG >= 3 - grub_dprintf ("font", "allocate font ok; loading font info\n"); + VasEBoot_dprintf ("font", "allocate font ok; loading font info\n"); #endif /* Load the font information. */ @@ -520,19 +520,19 @@ grub_font_load (const char *filename) } #if FONT_DEBUG >= 2 - grub_dprintf ("font", "opened section %c%c%c%c ok\n", + VasEBoot_dprintf ("font", "opened section %c%c%c%c ok\n", section.name[0], section.name[1], section.name[2], section.name[3]); #endif - if (grub_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_FONT_NAME, + if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_FONT_NAME, sizeof (FONT_FORMAT_SECTION_NAMES_FONT_NAME) - 1) == 0) { font->name = read_section_as_string (§ion); if (!font->name) goto fail; } - else if (grub_memcmp (section.name, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_POINT_SIZE, sizeof (FONT_FORMAT_SECTION_NAMES_POINT_SIZE) - 1) == 0) @@ -540,7 +540,7 @@ grub_font_load (const char *filename) if (read_section_as_short (§ion, &font->point_size) != 0) goto fail; } - else if (grub_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_WEIGHT, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_WEIGHT, sizeof (FONT_FORMAT_SECTION_NAMES_WEIGHT) - 1) == 0) { @@ -549,13 +549,13 @@ grub_font_load (const char *filename) if (!wt) continue; /* Convert the weight string 'normal' or 'bold' into a number. */ - if (grub_strcmp (wt, "normal") == 0) + if (VasEBoot_strcmp (wt, "normal") == 0) font->weight = FONT_WEIGHT_NORMAL; - else if (grub_strcmp (wt, "bold") == 0) + else if (VasEBoot_strcmp (wt, "bold") == 0) font->weight = FONT_WEIGHT_BOLD; - grub_free (wt); + VasEBoot_free (wt); } - else if (grub_memcmp (section.name, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_MAX_CHAR_WIDTH, sizeof (FONT_FORMAT_SECTION_NAMES_MAX_CHAR_WIDTH) - 1) == 0) @@ -563,7 +563,7 @@ grub_font_load (const char *filename) if (read_section_as_short (§ion, &font->max_char_width) != 0) goto fail; } - else if (grub_memcmp (section.name, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_MAX_CHAR_HEIGHT, sizeof (FONT_FORMAT_SECTION_NAMES_MAX_CHAR_HEIGHT) - 1) == 0) @@ -571,7 +571,7 @@ grub_font_load (const char *filename) if (read_section_as_short (§ion, &font->max_char_height) != 0) goto fail; } - else if (grub_memcmp (section.name, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_ASCENT, sizeof (FONT_FORMAT_SECTION_NAMES_ASCENT) - 1) == 0) @@ -579,14 +579,14 @@ grub_font_load (const char *filename) if (read_section_as_short (§ion, &font->ascent) != 0) goto fail; } - else if (grub_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_DESCENT, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_DESCENT, sizeof (FONT_FORMAT_SECTION_NAMES_DESCENT) - 1) == 0) { if (read_section_as_short (§ion, &font->descent) != 0) goto fail; } - else if (grub_memcmp (section.name, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_CHAR_INDEX, sizeof (FONT_FORMAT_SECTION_NAMES_CHAR_INDEX) - 1) == 0) @@ -594,7 +594,7 @@ grub_font_load (const char *filename) if (load_font_index (file, section.length, font) != 0) goto fail; } - else if (grub_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_DATA, + else if (VasEBoot_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_DATA, sizeof (FONT_FORMAT_SECTION_NAMES_DATA) - 1) == 0) { /* When the DATA section marker is reached, we stop reading. */ @@ -604,22 +604,22 @@ grub_font_load (const char *filename) { /* Unhandled section type, simply skip past it. */ #if FONT_DEBUG >= 3 - grub_dprintf ("font", "Unhandled section type, skipping.\n"); + VasEBoot_dprintf ("font", "Unhandled section type, skipping.\n"); #endif - grub_off_t section_end = grub_file_tell (file) + section.length; - if ((int) grub_file_seek (file, section_end) == -1) + VasEBoot_off_t section_end = VasEBoot_file_tell (file) + section.length; + if ((int) VasEBoot_file_seek (file, section_end) == -1) goto fail; } } if (!font->name) { - grub_dprintf ("font", "Font has no name.\n"); - font->name = grub_strdup ("Unknown"); + VasEBoot_dprintf ("font", "Font has no name.\n"); + font->name = VasEBoot_strdup ("Unknown"); } #if FONT_DEBUG >= 1 - grub_dprintf ("font", "Loaded font `%s'.\n" + VasEBoot_dprintf ("font", "Loaded font `%s'.\n" "Ascent=%d Descent=%d MaxW=%d MaxH=%d Number of characters=%d.\n", font->name, font->ascent, font->descent, @@ -631,7 +631,7 @@ grub_font_load (const char *filename) || font->num_chars == 0 || font->char_index == 0 || font->ascent == 0 || font->descent == 0) { - grub_error (GRUB_ERR_BAD_FONT, + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "invalid font file: missing some required data"); goto fail; } @@ -644,7 +644,7 @@ grub_font_load (const char *filename) fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); if (font) font->file = 0; @@ -656,30 +656,30 @@ fail: order, and store it in *VALUE. Returns 0 on success, 1 on failure. */ static int -read_be_uint16 (grub_file_t file, grub_uint16_t * value) +read_be_uint16 (VasEBoot_file_t file, VasEBoot_uint16_t * value) { - if (grub_file_read (file, value, 2) != 2) + if (VasEBoot_file_read (file, value, 2) != 2) return 1; - *value = grub_be_to_cpu16 (*value); + *value = VasEBoot_be_to_cpu16 (*value); return 0; } static int -read_be_int16 (grub_file_t file, grub_int16_t * value) +read_be_int16 (VasEBoot_file_t file, VasEBoot_int16_t * value) { /* For the signed integer version, use the same code as for unsigned. */ - return read_be_uint16 (file, (grub_uint16_t *) value); + return read_be_uint16 (file, (VasEBoot_uint16_t *) value); } /* Return a pointer to the character index entry for the glyph corresponding to the codepoint CODE in the font FONT. If not found, return zero. */ static inline struct char_index_entry * -find_glyph (const grub_font_t font, grub_uint32_t code) +find_glyph (const VasEBoot_font_t font, VasEBoot_uint32_t code) { struct char_index_entry *table; - grub_size_t lo; - grub_size_t hi; - grub_size_t mid; + VasEBoot_size_t lo; + VasEBoot_size_t hi; + VasEBoot_size_t mid; table = font->char_index; @@ -715,20 +715,20 @@ find_glyph (const grub_font_t font, grub_uint32_t code) /* Get a glyph for the Unicode character CODE in FONT. The glyph is loaded from the font file if has not been loaded yet. Returns a pointer to the glyph if found, or 0 if it is not found. */ -static struct grub_font_glyph * -grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) +static struct VasEBoot_font_glyph * +VasEBoot_font_get_glyph_internal (VasEBoot_font_t font, VasEBoot_uint32_t code) { struct char_index_entry *index_entry; index_entry = find_glyph (font, code); if (index_entry) { - struct grub_font_glyph *glyph = 0; - grub_uint16_t width; - grub_uint16_t height; - grub_int16_t xoff; - grub_int16_t yoff; - grub_int16_t dwidth; + struct VasEBoot_font_glyph *glyph = 0; + VasEBoot_uint16_t width; + VasEBoot_uint16_t height; + VasEBoot_int16_t xoff; + VasEBoot_int16_t yoff; + VasEBoot_int16_t dwidth; int len; if (index_entry->glyph) @@ -741,9 +741,9 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) /* Make sure we can find glyphs for error messages. Push active error message to error stack and reset error message. */ - grub_error_push (); + VasEBoot_error_push (); - grub_file_seek (font->file, index_entry->offset); + VasEBoot_file_seek (font->file, index_entry->offset); /* Read the glyph width, height, and baseline. */ if (read_be_uint16 (font->file, &width) != 0 @@ -757,7 +757,7 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) } len = (width * height + 7) / 8; - glyph = grub_malloc (sizeof (struct grub_font_glyph) + len); + glyph = VasEBoot_malloc (sizeof (struct VasEBoot_font_glyph) + len); if (!glyph) { remove_font (font); @@ -774,16 +774,16 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) /* Don't try to read empty bitmaps (e.g., space characters). */ if (len != 0) { - if (grub_file_read (font->file, glyph->bitmap, len) != len) + if (VasEBoot_file_read (font->file, glyph->bitmap, len) != len) { remove_font (font); - grub_free (glyph); + VasEBoot_free (glyph); return 0; } } /* Restore old error message. */ - grub_error_pop (); + VasEBoot_error_pop (); /* Cache the glyph. */ index_entry->glyph = glyph; @@ -799,17 +799,17 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) users (once it is added to the global font list), since there would be the possibility of a dangling pointer. */ static void -free_font (grub_font_t font) +free_font (VasEBoot_font_t font) { if (font) { if (font->file) - grub_file_close (font->file); - grub_free (font->name); - grub_free (font->family); - grub_free (font->char_index); - grub_free (font->bmp_idx); - grub_free (font); + VasEBoot_file_close (font->file); + VasEBoot_free (font->name); + VasEBoot_free (font->family); + VasEBoot_free (font->char_index); + VasEBoot_free (font->bmp_idx); + VasEBoot_free (font); } } @@ -817,17 +817,17 @@ free_font (grub_font_t font) Returns 0 upon success, nonzero on failure (the font was not registered). */ static int -register_font (grub_font_t font) +register_font (VasEBoot_font_t font) { - struct grub_font_node *node = 0; + struct VasEBoot_font_node *node = 0; - node = grub_malloc (sizeof (struct grub_font_node)); + node = VasEBoot_malloc (sizeof (struct VasEBoot_font_node)); if (!node) return 1; node->value = font; - node->next = grub_font_list; - grub_font_list = node; + node->next = VasEBoot_font_list; + VasEBoot_font_list = node; return 0; } @@ -835,11 +835,11 @@ register_font (grub_font_t font) /* Remove the font from the global font list. We don't actually free the font's memory since users could be holding references to the font. */ static void -remove_font (grub_font_t font) +remove_font (VasEBoot_font_t font) { - struct grub_font_node **nextp, *cur; + struct VasEBoot_font_node **nextp, *cur; - for (nextp = &grub_font_list, cur = *nextp; + for (nextp = &VasEBoot_font_list, cur = *nextp; cur; nextp = &cur->next, cur = cur->next) { if (cur->value == font) @@ -847,7 +847,7 @@ remove_font (grub_font_t font) *nextp = cur->next; /* Free the node, but not the font itself. */ - grub_free (cur); + VasEBoot_free (cur); return; } @@ -858,22 +858,22 @@ remove_font (grub_font_t font) another font if the requested font is not available. If no fonts are loaded, then a special 'null font' is returned, which contains no glyphs, but is not a null pointer so the caller may omit checks for NULL. */ -grub_font_t -grub_font_get (const char *font_name) +VasEBoot_font_t +VasEBoot_font_get (const char *font_name) { - struct grub_font_node *node; + struct VasEBoot_font_node *node; - for (node = grub_font_list; node; node = node->next) + for (node = VasEBoot_font_list; node; node = node->next) { - grub_font_t font = node->value; - if (grub_strcmp (font->name, font_name) == 0) + VasEBoot_font_t font = node->value; + if (VasEBoot_strcmp (font->name, font_name) == 0) return font; } /* If no font by that name is found, return the first font in the list as a fallback. */ - if (grub_font_list && grub_font_list->value) - return grub_font_list->value; + if (VasEBoot_font_list && VasEBoot_font_list->value) + return VasEBoot_font_list->value; else /* The null_font is a last resort. */ return &null_font; @@ -881,14 +881,14 @@ grub_font_get (const char *font_name) /* Get the full name of the font. */ const char * -grub_font_get_name (grub_font_t font) +VasEBoot_font_get_name (VasEBoot_font_t font) { return font->name; } /* Get the maximum width of any character in the font in pixels. */ int -grub_font_get_max_char_width (grub_font_t font) +VasEBoot_font_get_max_char_width (VasEBoot_font_t font) { return font->max_char_width; } @@ -896,14 +896,14 @@ grub_font_get_max_char_width (grub_font_t font) /* Get the distance in pixels from the baseline to the lowest descenders (for instance, in a lowercase 'y', 'g', etc.). */ int -grub_font_get_descent (grub_font_t font) +VasEBoot_font_get_descent (VasEBoot_font_t font) { return font->descent; } /* FIXME: not correct for all fonts. */ int -grub_font_get_xheight (grub_font_t font) +VasEBoot_font_get_xheight (VasEBoot_font_t font) { return font->ascent / 2; } @@ -913,14 +913,14 @@ grub_font_get_xheight (grub_font_t font) descent of one line and the ascent of the next line. This is included in the *height* metric. */ int -grub_font_get_leading (grub_font_t font) +VasEBoot_font_get_leading (VasEBoot_font_t font) { return font->leading; } /* Get the distance in pixels between baselines of adjacent lines of text. */ int -grub_font_get_height (grub_font_t font) +VasEBoot_font_get_height (VasEBoot_font_t font) { return font->ascent + font->descent + font->leading; } @@ -928,12 +928,12 @@ grub_font_get_height (grub_font_t font) /* Get the glyph for FONT corresponding to the Unicode code point CODE. Returns the ASCII glyph for the code if no other fonts are available. The glyphs are cached once loaded. */ -struct grub_font_glyph * -grub_font_get_glyph (grub_font_t font, grub_uint32_t code) +struct VasEBoot_font_glyph * +VasEBoot_font_get_glyph (VasEBoot_font_t font, VasEBoot_uint32_t code) { - struct grub_font_glyph *glyph = 0; + struct VasEBoot_font_glyph *glyph = 0; if (font) - glyph = grub_font_get_glyph_internal (font, code); + glyph = VasEBoot_font_get_glyph_internal (font, code); if (glyph == 0) { glyph = ascii_glyph_lookup (code); @@ -950,20 +950,20 @@ grub_font_get_glyph (grub_font_t font, grub_uint32_t code) sizes are used so that tiny 8 point glyphs are not mixed into a string of 24 point text unless there is no other choice. */ static int -get_font_diversity (grub_font_t a, grub_font_t b) +get_font_diversity (VasEBoot_font_t a, VasEBoot_font_t b) { int d; d = 0; if (a->ascent && b->ascent) - d += grub_abs (a->ascent - b->ascent) * 8; + d += VasEBoot_abs (a->ascent - b->ascent) * 8; else /* Penalty for missing attributes. */ d += 50; if (a->max_char_height && b->max_char_height) - d += grub_abs (a->max_char_height - b->max_char_height) * 8; + d += VasEBoot_abs (a->max_char_height - b->max_char_height) * 8; else /* Penalty for missing attributes. */ d += 50; @@ -982,23 +982,23 @@ get_font_diversity (grub_font_t a, grub_font_t b) This function never returns NULL. The returned glyph is owned by the font manager and should not be freed by the caller. The glyphs are cached. */ -struct grub_font_glyph * -grub_font_get_glyph_with_fallback (grub_font_t font, grub_uint32_t code) +struct VasEBoot_font_glyph * +VasEBoot_font_get_glyph_with_fallback (VasEBoot_font_t font, VasEBoot_uint32_t code) { - struct grub_font_glyph *glyph; - struct grub_font_node *node; + struct VasEBoot_font_glyph *glyph; + struct VasEBoot_font_node *node; /* Keep track of next node, in case there's an I/O error in - grub_font_get_glyph_internal() and the font is removed from the list. */ - struct grub_font_node *next; + VasEBoot_font_get_glyph_internal() and the font is removed from the list. */ + struct VasEBoot_font_node *next; /* Information on the best glyph found so far, to help find the glyph in the best matching to the requested one. */ int best_diversity; - struct grub_font_glyph *best_glyph; + struct VasEBoot_font_glyph *best_glyph; if (font) { /* First try to get the glyph from the specified font. */ - glyph = grub_font_get_glyph_internal (font, code); + glyph = VasEBoot_font_get_glyph_internal (font, code); if (glyph) return glyph; } @@ -1008,14 +1008,14 @@ grub_font_get_glyph_with_fallback (grub_font_t font, grub_uint32_t code) best_diversity = 10000; best_glyph = 0; - for (node = grub_font_list; node; node = next) + for (node = VasEBoot_font_list; node; node = next) { - grub_font_t curfont; + VasEBoot_font_t curfont; curfont = node->value; next = node->next; - glyph = grub_font_get_glyph_internal (curfont, code); + glyph = VasEBoot_font_get_glyph_internal (curfont, code); if (glyph && !font) return glyph; if (glyph) @@ -1035,14 +1035,14 @@ grub_font_get_glyph_with_fallback (grub_font_t font, grub_uint32_t code) } #if 0 -static struct grub_font_glyph * -grub_font_dup_glyph (struct grub_font_glyph *glyph) +static struct VasEBoot_font_glyph * +VasEBoot_font_dup_glyph (struct VasEBoot_font_glyph *glyph) { - static struct grub_font_glyph *ret; - ret = grub_malloc (sizeof (*ret) + (glyph->width * glyph->height + 7) / 8); + static struct VasEBoot_font_glyph *ret; + ret = VasEBoot_malloc (sizeof (*ret) + (glyph->width * glyph->height + 7) / 8); if (!ret) return NULL; - grub_memcpy (ret, glyph, sizeof (*ret) + VasEBoot_memcpy (ret, glyph, sizeof (*ret) + (glyph->width * glyph->height + 7) / 8); return ret; } @@ -1050,8 +1050,8 @@ grub_font_dup_glyph (struct grub_font_glyph *glyph) /* FIXME: suboptimal. */ static void -grub_font_blit_glyph (struct grub_font_glyph *target, - struct grub_font_glyph *src, unsigned dx, unsigned dy) +VasEBoot_font_blit_glyph (struct VasEBoot_font_glyph *target, + struct VasEBoot_font_glyph *src, unsigned dx, unsigned dy) { unsigned src_bit, tgt_bit, src_byte, tgt_byte; unsigned i, j; @@ -1082,8 +1082,8 @@ grub_font_blit_glyph (struct grub_font_glyph *target, } static void -grub_font_blit_glyph_mirror (struct grub_font_glyph *target, - struct grub_font_glyph *src, +VasEBoot_font_blit_glyph_mirror (struct VasEBoot_font_glyph *target, + struct VasEBoot_font_glyph *src, unsigned dx, unsigned dy) { unsigned tgt_bit, src_byte, tgt_byte; @@ -1118,18 +1118,18 @@ grub_font_blit_glyph_mirror (struct grub_font_glyph *target, /* Context for blit_comb. */ struct blit_comb_ctx { - struct grub_font_glyph *glyph; + struct VasEBoot_font_glyph *glyph; int *device_width; - struct grub_video_signed_rect bounds; + struct VasEBoot_video_signed_rect bounds; }; /* Helper for blit_comb. */ static void -do_blit (struct grub_font_glyph *src, signed dx, signed dy, +do_blit (struct VasEBoot_font_glyph *src, signed dx, signed dy, struct blit_comb_ctx *ctx) { if (ctx->glyph) - grub_font_blit_glyph (ctx->glyph, src, dx - ctx->glyph->offset_x, + VasEBoot_font_blit_glyph (ctx->glyph, src, dx - ctx->glyph->offset_x, (ctx->glyph->height + ctx->glyph->offset_y) + dy); if (dx < ctx->bounds.x) { @@ -1159,11 +1159,11 @@ add_device_width (int val, struct blit_comb_ctx *ctx) } static void -blit_comb (const struct grub_unicode_glyph *glyph_id, - struct grub_font_glyph *glyph, - struct grub_video_signed_rect *bounds_out, - struct grub_font_glyph *main_glyph, - struct grub_font_glyph **combining_glyphs, int *device_width) +blit_comb (const struct VasEBoot_unicode_glyph *glyph_id, + struct VasEBoot_font_glyph *glyph, + struct VasEBoot_video_signed_rect *bounds_out, + struct VasEBoot_font_glyph *main_glyph, + struct VasEBoot_font_glyph **combining_glyphs, int *device_width) { struct blit_comb_ctx ctx = { .glyph = glyph, @@ -1174,7 +1174,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, signed above_leftx, above_lefty; signed below_rightx, below_righty; signed min_devwidth = 0; - const struct grub_unicode_combining *comb; + const struct VasEBoot_unicode_combining *comb; if (glyph) glyph->device_width = main_glyph->device_width; @@ -1195,24 +1195,24 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, below_rightx = ctx.bounds.x + ctx.bounds.width; below_righty = ctx.bounds.y; - comb = grub_unicode_get_comb (glyph_id); + comb = VasEBoot_unicode_get_comb (glyph_id); for (i = 0; i < glyph_id->ncomb; i++) { - grub_int16_t space = 0; + VasEBoot_int16_t space = 0; /* Center by default. */ - grub_int16_t targetx; + VasEBoot_int16_t targetx; if (!combining_glyphs[i]) continue; targetx = (ctx.bounds.width - combining_glyphs[i]->width) / 2 + ctx.bounds.x; /* CGJ is to avoid diacritics reordering. */ if (comb[i].code - == GRUB_UNICODE_COMBINING_GRAPHEME_JOINER) + == VasEBoot_UNICODE_COMBINING_GRAPHEME_JOINER) continue; switch (comb[i].type) { - case GRUB_UNICODE_COMB_OVERLAY: + case VasEBoot_UNICODE_COMB_OVERLAY: do_blit (combining_glyphs[i], targetx, (ctx.bounds.height - combining_glyphs[i]->height) / 2 @@ -1221,48 +1221,48 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, min_devwidth = combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT: + case VasEBoot_UNICODE_COMB_ATTACHED_ABOVE_RIGHT: do_blit (combining_glyphs[i], above_rightx, -above_righty, &ctx); above_rightx += combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_ABOVE_RIGHT: + case VasEBoot_UNICODE_COMB_ABOVE_RIGHT: do_blit (combining_glyphs[i], above_rightx, -(above_righty + combining_glyphs[i]->height), &ctx); above_rightx += combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_ABOVE_LEFT: + case VasEBoot_UNICODE_COMB_ABOVE_LEFT: above_leftx -= combining_glyphs[i]->width; do_blit (combining_glyphs[i], above_leftx, -(above_lefty + combining_glyphs[i]->height), &ctx); break; - case GRUB_UNICODE_COMB_BELOW_RIGHT: + case VasEBoot_UNICODE_COMB_BELOW_RIGHT: do_blit (combining_glyphs[i], below_rightx, below_righty, &ctx); below_rightx += combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_HEBREW_HOLAM: - if (glyph_id->base != GRUB_UNICODE_HEBREW_WAW) + case VasEBoot_UNICODE_COMB_HEBREW_HOLAM: + if (glyph_id->base != VasEBoot_UNICODE_HEBREW_WAW) targetx = main_glyph->offset_x - combining_glyphs[i]->width - (combining_glyphs[i]->width + 3) / 4; goto above_on_main; - case GRUB_UNICODE_COMB_HEBREW_SIN_DOT: + case VasEBoot_UNICODE_COMB_HEBREW_SIN_DOT: targetx = main_glyph->offset_x + combining_glyphs[i]->width / 4; goto above_on_main; - case GRUB_UNICODE_COMB_HEBREW_SHIN_DOT: + case VasEBoot_UNICODE_COMB_HEBREW_SHIN_DOT: targetx = main_glyph->width + main_glyph->offset_x - combining_glyphs[i]->width; above_on_main: space = combining_glyphs[i]->offset_y - - grub_font_get_xheight (combining_glyphs[i]->font) - 1; + - VasEBoot_font_get_xheight (combining_glyphs[i]->font) - 1; if (space <= 0) - space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8; + space = 1 + (VasEBoot_font_get_xheight (main_glyph->font)) / 8; do_blit (combining_glyphs[i], targetx, -(main_glyph->height + main_glyph->offset_y + space + combining_glyphs[i]->height), &ctx); @@ -1271,23 +1271,23 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, break; /* TODO: Put dammah, fathah and alif nearer to shadda. */ - case GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH: - case GRUB_UNICODE_COMB_ARABIC_DAMMAH: - case GRUB_UNICODE_COMB_ARABIC_DAMMATAN: - case GRUB_UNICODE_COMB_ARABIC_FATHATAN: - case GRUB_UNICODE_COMB_ARABIC_FATHAH: - case GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF: - case GRUB_UNICODE_COMB_ARABIC_SUKUN: - case GRUB_UNICODE_COMB_ARABIC_SHADDA: - case GRUB_UNICODE_COMB_HEBREW_RAFE: - case GRUB_UNICODE_STACK_ABOVE: + case VasEBoot_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH: + case VasEBoot_UNICODE_COMB_ARABIC_DAMMAH: + case VasEBoot_UNICODE_COMB_ARABIC_DAMMATAN: + case VasEBoot_UNICODE_COMB_ARABIC_FATHATAN: + case VasEBoot_UNICODE_COMB_ARABIC_FATHAH: + case VasEBoot_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF: + case VasEBoot_UNICODE_COMB_ARABIC_SUKUN: + case VasEBoot_UNICODE_COMB_ARABIC_SHADDA: + case VasEBoot_UNICODE_COMB_HEBREW_RAFE: + case VasEBoot_UNICODE_STACK_ABOVE: stacked_above: space = combining_glyphs[i]->offset_y - - grub_font_get_xheight (combining_glyphs[i]->font) - 1; + - VasEBoot_font_get_xheight (combining_glyphs[i]->font) - 1; if (space <= 0) - space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8; + space = 1 + (VasEBoot_font_get_xheight (main_glyph->font)) / 8; /* Fallthrough. */ - case GRUB_UNICODE_STACK_ATTACHED_ABOVE: + case VasEBoot_UNICODE_STACK_ATTACHED_ABOVE: do_blit (combining_glyphs[i], targetx, -(ctx.bounds.height + ctx.bounds.y + space + combining_glyphs[i]->height), &ctx); @@ -1295,7 +1295,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, min_devwidth = combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_HEBREW_DAGESH: + case VasEBoot_UNICODE_COMB_HEBREW_DAGESH: do_blit (combining_glyphs[i], targetx, -(ctx.bounds.height / 2 + ctx.bounds.y + combining_glyphs[i]->height / 2), &ctx); @@ -1303,54 +1303,54 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, min_devwidth = combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_HEBREW_SHEVA: - case GRUB_UNICODE_COMB_HEBREW_HIRIQ: - case GRUB_UNICODE_COMB_HEBREW_QAMATS: - case GRUB_UNICODE_COMB_HEBREW_TSERE: - case GRUB_UNICODE_COMB_HEBREW_SEGOL: + case VasEBoot_UNICODE_COMB_HEBREW_SHEVA: + case VasEBoot_UNICODE_COMB_HEBREW_HIRIQ: + case VasEBoot_UNICODE_COMB_HEBREW_QAMATS: + case VasEBoot_UNICODE_COMB_HEBREW_TSERE: + case VasEBoot_UNICODE_COMB_HEBREW_SEGOL: /* TODO: placement in final kaf and under reish. */ - case GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL: - case GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH: - case GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS: - case GRUB_UNICODE_COMB_HEBREW_PATAH: - case GRUB_UNICODE_COMB_HEBREW_QUBUTS: - case GRUB_UNICODE_COMB_HEBREW_METEG: + case VasEBoot_UNICODE_COMB_HEBREW_HATAF_SEGOL: + case VasEBoot_UNICODE_COMB_HEBREW_HATAF_PATAH: + case VasEBoot_UNICODE_COMB_HEBREW_HATAF_QAMATS: + case VasEBoot_UNICODE_COMB_HEBREW_PATAH: + case VasEBoot_UNICODE_COMB_HEBREW_QUBUTS: + case VasEBoot_UNICODE_COMB_HEBREW_METEG: /* TODO: Put kasra and kasratan under shadda. */ - case GRUB_UNICODE_COMB_ARABIC_KASRA: - case GRUB_UNICODE_COMB_ARABIC_KASRATAN: + case VasEBoot_UNICODE_COMB_ARABIC_KASRA: + case VasEBoot_UNICODE_COMB_ARABIC_KASRATAN: /* I don't know how ypogegrammeni differs from subscript. */ - case GRUB_UNICODE_COMB_YPOGEGRAMMENI: - case GRUB_UNICODE_STACK_BELOW: + case VasEBoot_UNICODE_COMB_YPOGEGRAMMENI: + case VasEBoot_UNICODE_STACK_BELOW: stacked_below: space = -(combining_glyphs[i]->offset_y + combining_glyphs[i]->height); if (space <= 0) - space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8; + space = 1 + (VasEBoot_font_get_xheight (main_glyph->font)) / 8; /* Fallthrough. */ - case GRUB_UNICODE_STACK_ATTACHED_BELOW: + case VasEBoot_UNICODE_STACK_ATTACHED_BELOW: do_blit (combining_glyphs[i], targetx, -(ctx.bounds.y - space), &ctx); if (min_devwidth < combining_glyphs[i]->width) min_devwidth = combining_glyphs[i]->width; break; - case GRUB_UNICODE_COMB_MN: + case VasEBoot_UNICODE_COMB_MN: switch (comb[i].code) { - case GRUB_UNICODE_THAANA_ABAFILI: - case GRUB_UNICODE_THAANA_AABAAFILI: - case GRUB_UNICODE_THAANA_UBUFILI: - case GRUB_UNICODE_THAANA_OOBOOFILI: - case GRUB_UNICODE_THAANA_EBEFILI: - case GRUB_UNICODE_THAANA_EYBEYFILI: - case GRUB_UNICODE_THAANA_OBOFILI: - case GRUB_UNICODE_THAANA_OABOAFILI: - case GRUB_UNICODE_THAANA_SUKUN: + case VasEBoot_UNICODE_THAANA_ABAFILI: + case VasEBoot_UNICODE_THAANA_AABAAFILI: + case VasEBoot_UNICODE_THAANA_UBUFILI: + case VasEBoot_UNICODE_THAANA_OOBOOFILI: + case VasEBoot_UNICODE_THAANA_EBEFILI: + case VasEBoot_UNICODE_THAANA_EYBEYFILI: + case VasEBoot_UNICODE_THAANA_OBOFILI: + case VasEBoot_UNICODE_THAANA_OABOAFILI: + case VasEBoot_UNICODE_THAANA_SUKUN: goto stacked_above; - case GRUB_UNICODE_THAANA_IBIFILI: - case GRUB_UNICODE_THAANA_EEBEEFILI: + case VasEBoot_UNICODE_THAANA_IBIFILI: + case VasEBoot_UNICODE_THAANA_EEBEEFILI: goto stacked_below; } /* Fall through. */ @@ -1382,43 +1382,43 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, *bounds_out = ctx.bounds; } -static struct grub_font_glyph * -grub_font_construct_dry_run (grub_font_t hinted_font, - const struct grub_unicode_glyph *glyph_id, - struct grub_video_signed_rect *bounds, - struct grub_font_glyph **combining_glyphs, +static struct VasEBoot_font_glyph * +VasEBoot_font_construct_dry_run (VasEBoot_font_t hinted_font, + const struct VasEBoot_unicode_glyph *glyph_id, + struct VasEBoot_video_signed_rect *bounds, + struct VasEBoot_font_glyph **combining_glyphs, int *device_width) { - struct grub_font_glyph *main_glyph = NULL; - grub_uint32_t desired_attributes = 0; + struct VasEBoot_font_glyph *main_glyph = NULL; + VasEBoot_uint32_t desired_attributes = 0; unsigned i; - grub_uint32_t base = glyph_id->base; - const struct grub_unicode_combining *comb; + VasEBoot_uint32_t base = glyph_id->base; + const struct VasEBoot_unicode_combining *comb; - if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED) - desired_attributes |= GRUB_FONT_CODE_RIGHT_JOINED; + if (glyph_id->attributes & VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED) + desired_attributes |= VasEBoot_FONT_CODE_RIGHT_JOINED; - if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED) - desired_attributes |= GRUB_FONT_CODE_LEFT_JOINED; + if (glyph_id->attributes & VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED) + desired_attributes |= VasEBoot_FONT_CODE_LEFT_JOINED; - comb = grub_unicode_get_comb (glyph_id); + comb = VasEBoot_unicode_get_comb (glyph_id); if (base == 'i' || base == 'j') { for (i = 0; i < glyph_id->ncomb; i++) - if (comb[i].type == GRUB_UNICODE_STACK_ABOVE) + if (comb[i].type == VasEBoot_UNICODE_STACK_ABOVE) break; if (i < glyph_id->ncomb && base == 'i') - base = GRUB_UNICODE_DOTLESS_LOWERCASE_I; + base = VasEBoot_UNICODE_DOTLESS_LOWERCASE_I; if (i < glyph_id->ncomb && base == 'j') - base = GRUB_UNICODE_DOTLESS_LOWERCASE_J; + base = VasEBoot_UNICODE_DOTLESS_LOWERCASE_J; } - main_glyph = grub_font_get_glyph_with_fallback (hinted_font, base + main_glyph = VasEBoot_font_get_glyph_with_fallback (hinted_font, base | desired_attributes); if (!main_glyph) - main_glyph = grub_font_get_glyph_with_fallback (hinted_font, + main_glyph = VasEBoot_font_get_glyph_with_fallback (hinted_font, base); /* Glyph not available in any font. Use ASCII fallback. */ @@ -1437,13 +1437,13 @@ grub_font_construct_dry_run (grub_font_t hinted_font, if (glyph_id->ncomb && !combining_glyphs) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return main_glyph; } for (i = 0; i < glyph_id->ncomb; i++) combining_glyphs[i] - = grub_font_get_glyph_with_fallback (main_glyph->font, + = VasEBoot_font_get_glyph_with_fallback (main_glyph->font, comb[i].code); blit_comb (glyph_id, NULL, bounds, main_glyph, combining_glyphs, @@ -1452,11 +1452,11 @@ grub_font_construct_dry_run (grub_font_t hinted_font, return main_glyph; } -static struct grub_font_glyph **render_combining_glyphs = 0; -static grub_size_t render_max_comb_glyphs = 0; +static struct VasEBoot_font_glyph **render_combining_glyphs = 0; +static VasEBoot_size_t render_max_comb_glyphs = 0; static void -ensure_comb_space (const struct grub_unicode_glyph *glyph_id) +ensure_comb_space (const struct VasEBoot_unicode_glyph *glyph_id) { if (glyph_id->ncomb <= render_max_comb_glyphs) return; @@ -1464,42 +1464,42 @@ ensure_comb_space (const struct grub_unicode_glyph *glyph_id) render_max_comb_glyphs = 2 * glyph_id->ncomb; if (render_max_comb_glyphs < 8) render_max_comb_glyphs = 8; - grub_free (render_combining_glyphs); - render_combining_glyphs = grub_malloc (render_max_comb_glyphs + VasEBoot_free (render_combining_glyphs); + render_combining_glyphs = VasEBoot_malloc (render_max_comb_glyphs * sizeof (render_combining_glyphs[0])); if (!render_combining_glyphs) - grub_errno = 0; + VasEBoot_errno = 0; } int -grub_font_get_constructed_device_width (grub_font_t hinted_font, - const struct grub_unicode_glyph +VasEBoot_font_get_constructed_device_width (VasEBoot_font_t hinted_font, + const struct VasEBoot_unicode_glyph *glyph_id) { int ret; - struct grub_font_glyph *main_glyph; + struct VasEBoot_font_glyph *main_glyph; ensure_comb_space (glyph_id); - main_glyph = grub_font_construct_dry_run (hinted_font, glyph_id, NULL, + main_glyph = VasEBoot_font_construct_dry_run (hinted_font, glyph_id, NULL, render_combining_glyphs, &ret); if (!main_glyph) return unknown_glyph->device_width; return ret; } -struct grub_font_glyph * -grub_font_construct_glyph (grub_font_t hinted_font, - const struct grub_unicode_glyph *glyph_id) +struct VasEBoot_font_glyph * +VasEBoot_font_construct_glyph (VasEBoot_font_t hinted_font, + const struct VasEBoot_unicode_glyph *glyph_id) { - struct grub_font_glyph *main_glyph; - struct grub_video_signed_rect bounds; - static struct grub_font_glyph *glyph = 0; - static grub_size_t max_glyph_size = 0; + struct VasEBoot_font_glyph *main_glyph; + struct VasEBoot_video_signed_rect bounds; + static struct VasEBoot_font_glyph *glyph = 0; + static VasEBoot_size_t max_glyph_size = 0; ensure_comb_space (glyph_id); - main_glyph = grub_font_construct_dry_run (hinted_font, glyph_id, + main_glyph = VasEBoot_font_construct_dry_run (hinted_font, glyph_id, &bounds, render_combining_glyphs, NULL); @@ -1512,23 +1512,23 @@ grub_font_construct_glyph (grub_font_t hinted_font, if (!glyph_id->ncomb && !glyph_id->attributes) return main_glyph; - if (max_glyph_size < sizeof (*glyph) + (bounds.width * bounds.height + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT) + if (max_glyph_size < sizeof (*glyph) + (bounds.width * bounds.height + VasEBoot_CHAR_BIT - 1) / VasEBoot_CHAR_BIT) { - grub_free (glyph); - max_glyph_size = (sizeof (*glyph) + (bounds.width * bounds.height + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT) * 2; + VasEBoot_free (glyph); + max_glyph_size = (sizeof (*glyph) + (bounds.width * bounds.height + VasEBoot_CHAR_BIT - 1) / VasEBoot_CHAR_BIT) * 2; if (max_glyph_size < 8) max_glyph_size = 8; - glyph = grub_malloc (max_glyph_size); + glyph = VasEBoot_malloc (max_glyph_size); } if (!glyph) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return main_glyph; } - grub_memset (glyph, 0, sizeof (*glyph) + VasEBoot_memset (glyph, 0, sizeof (*glyph) + (bounds.width * bounds.height - + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT); + + VasEBoot_CHAR_BIT - 1) / VasEBoot_CHAR_BIT); glyph->font = main_glyph->font; glyph->width = bounds.width; @@ -1536,14 +1536,14 @@ grub_font_construct_glyph (grub_font_t hinted_font, glyph->offset_x = bounds.x; glyph->offset_y = bounds.y; - if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR) - grub_font_blit_glyph_mirror (glyph, main_glyph, + if (glyph_id->attributes & VasEBoot_UNICODE_GLYPH_ATTRIBUTE_MIRROR) + VasEBoot_font_blit_glyph_mirror (glyph, main_glyph, main_glyph->offset_x - glyph->offset_x, (glyph->height + glyph->offset_y) - (main_glyph->height + main_glyph->offset_y)); else - grub_font_blit_glyph (glyph, main_glyph, + VasEBoot_font_blit_glyph (glyph, main_glyph, main_glyph->offset_x - glyph->offset_x, (glyph->height + glyph->offset_y) - (main_glyph->height + main_glyph->offset_y)); @@ -1556,21 +1556,21 @@ grub_font_construct_glyph (grub_font_t hinted_font, /* Draw the specified glyph at (x, y). The y coordinate designates the baseline of the character, while the x coordinate designates the left side location of the character. */ -grub_err_t -grub_font_draw_glyph (struct grub_font_glyph * glyph, - grub_video_color_t color, int left_x, int baseline_y) +VasEBoot_err_t +VasEBoot_font_draw_glyph (struct VasEBoot_font_glyph * glyph, + VasEBoot_video_color_t color, int left_x, int baseline_y) { - struct grub_video_bitmap glyph_bitmap; + struct VasEBoot_video_bitmap glyph_bitmap; /* Don't try to draw empty glyphs (U+0020, etc.). */ if (glyph->width == 0 || glyph->height == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; glyph_bitmap.mode_info.width = glyph->width; glyph_bitmap.mode_info.height = glyph->height; glyph_bitmap.mode_info.mode_type - = (1 << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP; - glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED; + = (1 << VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS) | VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP; + glyph_bitmap.mode_info.blit_format = VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED; glyph_bitmap.mode_info.bpp = 1; /* Really 1 bit per pixel. */ @@ -1584,7 +1584,7 @@ grub_font_draw_glyph (struct grub_font_glyph * glyph, glyph_bitmap.mode_info.bg_green = 0; glyph_bitmap.mode_info.bg_blue = 0; glyph_bitmap.mode_info.bg_alpha = 0; - grub_video_unmap_color (color, + VasEBoot_video_unmap_color (color, &glyph_bitmap.mode_info.fg_red, &glyph_bitmap.mode_info.fg_green, &glyph_bitmap.mode_info.fg_blue, @@ -1595,7 +1595,7 @@ grub_font_draw_glyph (struct grub_font_glyph * glyph, int bitmap_bottom = baseline_y - glyph->offset_y; int bitmap_top = bitmap_bottom - glyph->height; - return grub_video_blit_bitmap (&glyph_bitmap, GRUB_VIDEO_BLIT_BLEND, + return VasEBoot_video_blit_bitmap (&glyph_bitmap, VasEBoot_VIDEO_BLIT_BLEND, bitmap_left, bitmap_top, 0, 0, glyph->width, glyph->height); } diff --git a/VasEBoot-core/font/font_cmd.c b/VasEBoot-core/font/font_cmd.c index f3b36f2d6..42d07896c 100644 --- a/VasEBoot-core/font/font_cmd.c +++ b/VasEBoot-core/font/font_cmd.c @@ -1,92 +1,92 @@ /* font_cmd.c - Font command definition. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -static grub_err_t -loadfont_command (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +loadfont_command (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); while (argc--) - if (grub_font_load (*args++) == 0) + if (VasEBoot_font_load (*args++) == 0) { - if (!grub_errno) - return grub_error (GRUB_ERR_BAD_FONT, "invalid font"); - return grub_errno; + if (!VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_FONT, "invalid font"); + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -lsfonts_command (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +lsfonts_command (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_font_node *node; + struct VasEBoot_font_node *node; - grub_puts_ (N_("Loaded fonts:")); - for (node = grub_font_list; node; node = node->next) + VasEBoot_puts_ (N_("Loaded fonts:")); + for (node = VasEBoot_font_list; node; node = node->next) { - grub_font_t font = node->value; - grub_printf ("%s\n", grub_font_get_name (font)); + VasEBoot_font_t font = node->value; + VasEBoot_printf ("%s\n", VasEBoot_font_get_name (font)); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_loadfont, cmd_lsfonts; +static VasEBoot_command_t cmd_loadfont, cmd_lsfonts; -#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_COREBOOT) -void grub_font_init (void) +#if defined (VasEBoot_MACHINE_MIPS_LOONGSON) || defined (VasEBoot_MACHINE_COREBOOT) +void VasEBoot_font_init (void) #else -GRUB_MOD_INIT(font) +VasEBoot_MOD_INIT(font) #endif { - grub_font_loader_init (); + VasEBoot_font_loader_init (); cmd_loadfont = - grub_register_command ("loadfont", loadfont_command, + VasEBoot_register_command ("loadfont", loadfont_command, N_("FILE..."), N_("Specify one or more font files to load.")); cmd_lsfonts = - grub_register_command ("lsfonts", lsfonts_command, + VasEBoot_register_command ("lsfonts", lsfonts_command, 0, N_("List the loaded fonts.")); } -#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_COREBOOT) -void grub_font_fini (void) +#if defined (VasEBoot_MACHINE_MIPS_LOONGSON) || defined (VasEBoot_MACHINE_COREBOOT) +void VasEBoot_font_fini (void) #else -GRUB_MOD_FINI(font) +VasEBoot_MOD_FINI(font) #endif { /* TODO: Determine way to free allocated resources. Warning: possible pointer references could be in use. */ - grub_unregister_command (cmd_loadfont); - grub_unregister_command (cmd_lsfonts); + VasEBoot_unregister_command (cmd_loadfont); + VasEBoot_unregister_command (cmd_lsfonts); } diff --git a/VasEBoot-core/fs/affs.c b/VasEBoot-core/fs/affs.c index f673897e0..85f6474dc 100644 --- a/VasEBoot-core/fs/affs.c +++ b/VasEBoot-core/fs/affs.c @@ -1,99 +1,99 @@ /* affs.c - Amiga Fast FileSystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* The affs bootblock. */ -struct grub_affs_bblock +struct VasEBoot_affs_bblock { - grub_uint8_t type[3]; - grub_uint8_t flags; - grub_uint32_t checksum; - grub_uint32_t rootblock; -} GRUB_PACKED; + VasEBoot_uint8_t type[3]; + VasEBoot_uint8_t flags; + VasEBoot_uint32_t checksum; + VasEBoot_uint32_t rootblock; +} VasEBoot_PACKED; /* Set if the filesystem is a AFFS filesystem. Otherwise this is an OFS filesystem. */ -#define GRUB_AFFS_FLAG_FFS 1 +#define VasEBoot_AFFS_FLAG_FFS 1 /* The affs rootblock. */ -struct grub_affs_rblock +struct VasEBoot_affs_rblock { - grub_uint32_t type; - grub_uint8_t unused1[8]; - grub_uint32_t htsize; - grub_uint32_t unused2; - grub_uint32_t checksum; - grub_uint32_t hashtable[1]; -} GRUB_PACKED; + VasEBoot_uint32_t type; + VasEBoot_uint8_t unused1[8]; + VasEBoot_uint32_t htsize; + VasEBoot_uint32_t unused2; + VasEBoot_uint32_t checksum; + VasEBoot_uint32_t hashtable[1]; +} VasEBoot_PACKED; -struct grub_affs_time +struct VasEBoot_affs_time { - grub_int32_t day; - grub_uint32_t min; - grub_uint32_t hz; -} GRUB_PACKED; + VasEBoot_int32_t day; + VasEBoot_uint32_t min; + VasEBoot_uint32_t hz; +} VasEBoot_PACKED; /* The second part of a file header block. */ -struct grub_affs_file +struct VasEBoot_affs_file { - grub_uint8_t unused1[12]; - grub_uint32_t size; - grub_uint8_t unused2[92]; - struct grub_affs_time mtime; - grub_uint8_t namelen; - grub_uint8_t name[30]; - grub_uint8_t unused3[5]; - grub_uint32_t hardlink; - grub_uint32_t unused4[6]; - grub_uint32_t next; - grub_uint32_t parent; - grub_uint32_t extension; - grub_uint32_t type; -} GRUB_PACKED; + VasEBoot_uint8_t unused1[12]; + VasEBoot_uint32_t size; + VasEBoot_uint8_t unused2[92]; + struct VasEBoot_affs_time mtime; + VasEBoot_uint8_t namelen; + VasEBoot_uint8_t name[30]; + VasEBoot_uint8_t unused3[5]; + VasEBoot_uint32_t hardlink; + VasEBoot_uint32_t unused4[6]; + VasEBoot_uint32_t next; + VasEBoot_uint32_t parent; + VasEBoot_uint32_t extension; + VasEBoot_uint32_t type; +} VasEBoot_PACKED; -/* The location of `struct grub_affs_file' relative to the end of a +/* The location of `struct VasEBoot_affs_file' relative to the end of a file header block. */ -#define GRUB_AFFS_FILE_LOCATION 200 +#define VasEBoot_AFFS_FILE_LOCATION 200 /* The offset in both the rootblock and the file header block for the hashtable, symlink and block pointers (all synonyms). */ -#define GRUB_AFFS_HASHTABLE_OFFSET 24 -#define GRUB_AFFS_BLOCKPTR_OFFSET 24 -#define GRUB_AFFS_SYMLINK_OFFSET 24 +#define VasEBoot_AFFS_HASHTABLE_OFFSET 24 +#define VasEBoot_AFFS_BLOCKPTR_OFFSET 24 +#define VasEBoot_AFFS_SYMLINK_OFFSET 24 enum { - GRUB_AFFS_FILETYPE_DIR = 2, - GRUB_AFFS_FILETYPE_SYMLINK = 3, - GRUB_AFFS_FILETYPE_HARDLINK = 0xfffffffc, - GRUB_AFFS_FILETYPE_REG = 0xfffffffd + VasEBoot_AFFS_FILETYPE_DIR = 2, + VasEBoot_AFFS_FILETYPE_SYMLINK = 3, + VasEBoot_AFFS_FILETYPE_HARDLINK = 0xfffffffc, + VasEBoot_AFFS_FILETYPE_REG = 0xfffffffd }; #define AFFS_MAX_LOG_BLOCK_SIZE 4 @@ -101,22 +101,22 @@ enum -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_affs_data *data; - grub_uint32_t block; - struct grub_fshelp_node *parent; - struct grub_affs_file di; - grub_uint32_t *block_cache; - grub_uint32_t last_block_cache; + struct VasEBoot_affs_data *data; + VasEBoot_uint32_t block; + struct VasEBoot_fshelp_node *parent; + struct VasEBoot_affs_file di; + VasEBoot_uint32_t *block_cache; + VasEBoot_uint32_t last_block_cache; }; /* Information about a "mounted" affs filesystem. */ -struct grub_affs_data +struct VasEBoot_affs_data { - struct grub_affs_bblock bblock; - struct grub_fshelp_node diropen; - grub_disk_t disk; + struct VasEBoot_affs_bblock bblock; + struct VasEBoot_fshelp_node diropen; + VasEBoot_disk_t disk; /* Log blocksize in sectors. */ int log_blocksize; @@ -125,21 +125,21 @@ struct grub_affs_data unsigned int htsize; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_disk_addr_t -grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_affs_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { - grub_uint32_t target, curblock; - grub_uint32_t pos; - struct grub_affs_file file; - struct grub_affs_data *data = node->data; - grub_uint64_t mod; + VasEBoot_uint32_t target, curblock; + VasEBoot_uint32_t pos; + struct VasEBoot_affs_file file; + struct VasEBoot_affs_data *data = node->data; + VasEBoot_uint64_t mod; if (!node->block_cache) { - node->block_cache = grub_malloc (((grub_be_to_cpu32 (node->di.size) + node->block_cache = VasEBoot_malloc (((VasEBoot_be_to_cpu32 (node->di.size) >> (9 + node->data->log_blocksize)) / data->htsize + 2) * sizeof (node->block_cache[0])); @@ -150,72 +150,72 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) } /* Files are at most 2G on AFFS, so no need for 64-bit division. */ - target = (grub_uint32_t) fileblock / data->htsize; - mod = (grub_uint32_t) fileblock % data->htsize; + target = (VasEBoot_uint32_t) fileblock / data->htsize; + mod = (VasEBoot_uint32_t) fileblock % data->htsize; /* Find the block that points to the fileblock we are looking up by following the chain until the right table is reached. */ for (curblock = node->last_block_cache + 1; curblock < target + 1; curblock++) { - grub_disk_read (data->disk, - (((grub_uint64_t) node->block_cache[curblock - 1] + 1) + VasEBoot_disk_read (data->disk, + (((VasEBoot_uint64_t) node->block_cache[curblock - 1] + 1) << data->log_blocksize) - 1, - GRUB_DISK_SECTOR_SIZE - GRUB_AFFS_FILE_LOCATION, + VasEBoot_DISK_SECTOR_SIZE - VasEBoot_AFFS_FILE_LOCATION, sizeof (file), &file); - if (grub_errno) + if (VasEBoot_errno) return 0; - node->block_cache[curblock] = grub_be_to_cpu32 (file.extension); + node->block_cache[curblock] = VasEBoot_be_to_cpu32 (file.extension); node->last_block_cache = curblock; } /* Translate the fileblock to the block within the right table. */ - grub_disk_read (data->disk, (grub_uint64_t) node->block_cache[target] + VasEBoot_disk_read (data->disk, (VasEBoot_uint64_t) node->block_cache[target] << data->log_blocksize, - GRUB_AFFS_BLOCKPTR_OFFSET + VasEBoot_AFFS_BLOCKPTR_OFFSET + (data->htsize - mod - 1) * sizeof (pos), sizeof (pos), &pos); - if (grub_errno) + if (VasEBoot_errno) return 0; - return grub_be_to_cpu32 (pos); + return VasEBoot_be_to_cpu32 (pos); } -static struct grub_affs_data * -grub_affs_mount (grub_disk_t disk) +static struct VasEBoot_affs_data * +VasEBoot_affs_mount (VasEBoot_disk_t disk) { - struct grub_affs_data *data; - grub_uint32_t *rootblock = 0; - struct grub_affs_rblock *rblock = 0; + struct VasEBoot_affs_data *data; + VasEBoot_uint32_t *rootblock = 0; + struct VasEBoot_affs_rblock *rblock = 0; int log_blocksize = 0; int bsnum = 0; - data = grub_zalloc (sizeof (struct grub_affs_data)); + data = VasEBoot_zalloc (sizeof (struct VasEBoot_affs_data)); if (!data) return 0; for (bsnum = 0; bsnum < AFFS_MAX_SUPERBLOCK + 1; bsnum++) { /* Read the bootblock. */ - grub_disk_read (disk, bsnum, 0, sizeof (struct grub_affs_bblock), + VasEBoot_disk_read (disk, bsnum, 0, sizeof (struct VasEBoot_affs_bblock), &data->bblock); - if (grub_errno) + if (VasEBoot_errno) goto fail; /* Make sure this is an affs filesystem. */ - if (grub_strncmp ((char *) (data->bblock.type), "DOS", 3) != 0 + if (VasEBoot_strncmp ((char *) (data->bblock.type), "DOS", 3) != 0 /* Test if the filesystem is a OFS filesystem. */ - || !(data->bblock.flags & GRUB_AFFS_FLAG_FFS)) + || !(data->bblock.flags & VasEBoot_AFFS_FLAG_FFS)) continue; /* No sane person uses more than 8KB for a block. At least I hope for that person because in that case this won't work. */ if (!rootblock) - rootblock = grub_malloc (GRUB_DISK_SECTOR_SIZE + rootblock = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE << AFFS_MAX_LOG_BLOCK_SIZE); if (!rootblock) goto fail; - rblock = (struct grub_affs_rblock *) rootblock; + rblock = (struct VasEBoot_affs_rblock *) rootblock; /* The filesystem blocksize is not stored anywhere in the filesystem itself. One way to determine it is try reading blocks for the @@ -223,46 +223,46 @@ grub_affs_mount (grub_disk_t disk) for (log_blocksize = 0; log_blocksize <= AFFS_MAX_LOG_BLOCK_SIZE; log_blocksize++) { - grub_uint32_t *currblock = rootblock; + VasEBoot_uint32_t *currblock = rootblock; unsigned int i; - grub_uint32_t checksum = 0; + VasEBoot_uint32_t checksum = 0; /* Read the rootblock. */ - grub_disk_read (disk, - (grub_uint64_t) grub_be_to_cpu32 (data->bblock.rootblock) + VasEBoot_disk_read (disk, + (VasEBoot_uint64_t) VasEBoot_be_to_cpu32 (data->bblock.rootblock) << log_blocksize, 0, - GRUB_DISK_SECTOR_SIZE << log_blocksize, rootblock); - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) + VasEBoot_DISK_SECTOR_SIZE << log_blocksize, rootblock); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) { - grub_errno = 0; + VasEBoot_errno = 0; break; } - if (grub_errno) + if (VasEBoot_errno) goto fail; - if (rblock->type != grub_cpu_to_be32_compile_time (2) + if (rblock->type != VasEBoot_cpu_to_be32_compile_time (2) || rblock->htsize == 0 - || currblock[(GRUB_DISK_SECTOR_SIZE << log_blocksize) + || currblock[(VasEBoot_DISK_SECTOR_SIZE << log_blocksize) / sizeof (*currblock) - 1] - != grub_cpu_to_be32_compile_time (1)) + != VasEBoot_cpu_to_be32_compile_time (1)) continue; - for (i = 0; i < (GRUB_DISK_SECTOR_SIZE << log_blocksize) + for (i = 0; i < (VasEBoot_DISK_SECTOR_SIZE << log_blocksize) / sizeof (*currblock); i++) - checksum += grub_be_to_cpu32 (currblock[i]); + checksum += VasEBoot_be_to_cpu32 (currblock[i]); if (checksum == 0) { data->log_blocksize = log_blocksize; data->disk = disk; - data->htsize = grub_be_to_cpu32 (rblock->htsize); + data->htsize = VasEBoot_be_to_cpu32 (rblock->htsize); data->diropen.data = data; - data->diropen.block = grub_be_to_cpu32 (data->bblock.rootblock); + data->diropen.block = VasEBoot_be_to_cpu32 (data->bblock.rootblock); data->diropen.parent = NULL; - grub_memcpy (&data->diropen.di, rootblock, + VasEBoot_memcpy (&data->diropen.di, rootblock, sizeof (data->diropen.di)); - grub_free (rootblock); + VasEBoot_free (rootblock); return data; } @@ -270,70 +270,70 @@ grub_affs_mount (grub_disk_t disk) } fail: - if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not an AFFS filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_NONE || VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an AFFS filesystem"); - grub_free (data); - grub_free (rootblock); + VasEBoot_free (data); + VasEBoot_free (rootblock); return 0; } static char * -grub_affs_read_symlink (grub_fshelp_node_t node) +VasEBoot_affs_read_symlink (VasEBoot_fshelp_node_t node) { - struct grub_affs_data *data = node->data; - grub_uint8_t *latin1, *utf8; - const grub_size_t symlink_size = ((GRUB_DISK_SECTOR_SIZE - << data->log_blocksize) - GRUB_AFFS_SYMLINK_OFFSET); + struct VasEBoot_affs_data *data = node->data; + VasEBoot_uint8_t *latin1, *utf8; + const VasEBoot_size_t symlink_size = ((VasEBoot_DISK_SECTOR_SIZE + << data->log_blocksize) - VasEBoot_AFFS_SYMLINK_OFFSET); - latin1 = grub_malloc (symlink_size + 1); + latin1 = VasEBoot_malloc (symlink_size + 1); if (!latin1) return 0; - grub_disk_read (data->disk, - (grub_uint64_t) node->block << data->log_blocksize, - GRUB_AFFS_SYMLINK_OFFSET, + VasEBoot_disk_read (data->disk, + (VasEBoot_uint64_t) node->block << data->log_blocksize, + VasEBoot_AFFS_SYMLINK_OFFSET, symlink_size, latin1); - if (grub_errno) + if (VasEBoot_errno) { - grub_free (latin1); + VasEBoot_free (latin1); return 0; } latin1[symlink_size] = 0; - utf8 = grub_malloc (symlink_size * GRUB_MAX_UTF8_PER_LATIN1 + 1); + utf8 = VasEBoot_malloc (symlink_size * VasEBoot_MAX_UTF8_PER_LATIN1 + 1); if (!utf8) { - grub_free (latin1); + VasEBoot_free (latin1); return 0; } - *grub_latin1_to_utf8 (utf8, latin1, symlink_size) = '\0'; - grub_dprintf ("affs", "Symlink: `%s'\n", utf8); - grub_free (latin1); + *VasEBoot_latin1_to_utf8 (utf8, latin1, symlink_size) = '\0'; + VasEBoot_dprintf ("affs", "Symlink: `%s'\n", utf8); + VasEBoot_free (latin1); if (utf8[0] == ':') utf8[0] = '/'; return (char *) utf8; } -/* Helper for grub_affs_iterate_dir. */ +/* Helper for VasEBoot_affs_iterate_dir. */ static int -grub_affs_create_node (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data, - struct grub_fshelp_node **node, - grub_uint32_t **hashtable, - grub_uint32_t block, const struct grub_affs_file *fil) +VasEBoot_affs_create_node (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data, + struct VasEBoot_fshelp_node **node, + VasEBoot_uint32_t **hashtable, + VasEBoot_uint32_t block, const struct VasEBoot_affs_file *fil) { - struct grub_affs_data *data = dir->data; - int type = GRUB_FSHELP_REG; - grub_uint8_t name_u8[sizeof (fil->name) * GRUB_MAX_UTF8_PER_LATIN1 + 1]; - grub_size_t len; + struct VasEBoot_affs_data *data = dir->data; + int type = VasEBoot_FSHELP_REG; + VasEBoot_uint8_t name_u8[sizeof (fil->name) * VasEBoot_MAX_UTF8_PER_LATIN1 + 1]; + VasEBoot_size_t len; unsigned int nest; - *node = grub_zalloc (sizeof (**node)); + *node = VasEBoot_zalloc (sizeof (**node)); if (!*node) { - grub_free (*hashtable); + VasEBoot_free (*hashtable); return 1; } @@ -344,30 +344,30 @@ grub_affs_create_node (grub_fshelp_node_t dir, len = fil->namelen; if (len > sizeof (fil->name)) len = sizeof (fil->name); - *grub_latin1_to_utf8 (name_u8, fil->name, len) = '\0'; + *VasEBoot_latin1_to_utf8 (name_u8, fil->name, len) = '\0'; (*node)->di = *fil; for (nest = 0; nest < 8; nest++) { switch ((*node)->di.type) { - case grub_cpu_to_be32_compile_time (GRUB_AFFS_FILETYPE_REG): - type = GRUB_FSHELP_REG; + case VasEBoot_cpu_to_be32_compile_time (VasEBoot_AFFS_FILETYPE_REG): + type = VasEBoot_FSHELP_REG; break; - case grub_cpu_to_be32_compile_time (GRUB_AFFS_FILETYPE_DIR): - type = GRUB_FSHELP_DIR; + case VasEBoot_cpu_to_be32_compile_time (VasEBoot_AFFS_FILETYPE_DIR): + type = VasEBoot_FSHELP_DIR; break; - case grub_cpu_to_be32_compile_time (GRUB_AFFS_FILETYPE_SYMLINK): - type = GRUB_FSHELP_SYMLINK; + case VasEBoot_cpu_to_be32_compile_time (VasEBoot_AFFS_FILETYPE_SYMLINK): + type = VasEBoot_FSHELP_SYMLINK; break; - case grub_cpu_to_be32_compile_time (GRUB_AFFS_FILETYPE_HARDLINK): + case VasEBoot_cpu_to_be32_compile_time (VasEBoot_AFFS_FILETYPE_HARDLINK): { - grub_err_t err; - (*node)->block = grub_be_to_cpu32 ((*node)->di.hardlink); - err = grub_disk_read (data->disk, - (((grub_uint64_t) (*node)->block + 1) << data->log_blocksize) + VasEBoot_err_t err; + (*node)->block = VasEBoot_be_to_cpu32 ((*node)->di.hardlink); + err = VasEBoot_disk_read (data->disk, + (((VasEBoot_uint64_t) (*node)->block + 1) << data->log_blocksize) - 1, - GRUB_DISK_SECTOR_SIZE - GRUB_AFFS_FILE_LOCATION, + VasEBoot_DISK_SECTOR_SIZE - VasEBoot_AFFS_FILE_LOCATION, sizeof ((*node)->di), (char *) &(*node)->di); if (err) return 1; @@ -382,11 +382,11 @@ grub_affs_create_node (grub_fshelp_node_t dir, if (nest == 8) return 0; - type |= GRUB_FSHELP_CASE_INSENSITIVE; + type |= VasEBoot_FSHELP_CASE_INSENSITIVE; if (hook ((char *) name_u8, type, *node, hook_data)) { - grub_free (*hashtable); + VasEBoot_free (*hashtable); *node = 0; return 1; } @@ -395,104 +395,104 @@ grub_affs_create_node (grub_fshelp_node_t dir, } static int -grub_affs_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_affs_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { unsigned int i; - struct grub_affs_file file; - struct grub_fshelp_node *node = 0; - struct grub_affs_data *data = dir->data; - grub_uint32_t *hashtable; + struct VasEBoot_affs_file file; + struct VasEBoot_fshelp_node *node = 0; + struct VasEBoot_affs_data *data = dir->data; + VasEBoot_uint32_t *hashtable; /* Create the directory entries for `.' and `..'. */ - node = grub_zalloc (sizeof (*node)); + node = VasEBoot_zalloc (sizeof (*node)); if (!node) return 1; *node = *dir; - if (hook (".", GRUB_FSHELP_DIR, node, hook_data)) + if (hook (".", VasEBoot_FSHELP_DIR, node, hook_data)) return 1; if (dir->parent) { - node = grub_zalloc (sizeof (*node)); + node = VasEBoot_zalloc (sizeof (*node)); if (!node) return 1; *node = *dir->parent; - if (hook ("..", GRUB_FSHELP_DIR, node, hook_data)) + if (hook ("..", VasEBoot_FSHELP_DIR, node, hook_data)) return 1; } - hashtable = grub_zalloc (data->htsize * sizeof (*hashtable)); + hashtable = VasEBoot_zalloc (data->htsize * sizeof (*hashtable)); if (!hashtable) return 1; - grub_disk_read (data->disk, - (grub_uint64_t) dir->block << data->log_blocksize, - GRUB_AFFS_HASHTABLE_OFFSET, + VasEBoot_disk_read (data->disk, + (VasEBoot_uint64_t) dir->block << data->log_blocksize, + VasEBoot_AFFS_HASHTABLE_OFFSET, data->htsize * sizeof (*hashtable), (char *) hashtable); - if (grub_errno) + if (VasEBoot_errno) goto fail; for (i = 0; i < data->htsize; i++) { - grub_uint32_t next; + VasEBoot_uint32_t next; if (!hashtable[i]) continue; /* Every entry in the hashtable can be chained. Read the entire chain. */ - next = grub_be_to_cpu32 (hashtable[i]); + next = VasEBoot_be_to_cpu32 (hashtable[i]); while (next) { - grub_disk_read (data->disk, - (((grub_uint64_t) next + 1) << data->log_blocksize) + VasEBoot_disk_read (data->disk, + (((VasEBoot_uint64_t) next + 1) << data->log_blocksize) - 1, - GRUB_DISK_SECTOR_SIZE - GRUB_AFFS_FILE_LOCATION, + VasEBoot_DISK_SECTOR_SIZE - VasEBoot_AFFS_FILE_LOCATION, sizeof (file), (char *) &file); - if (grub_errno) + if (VasEBoot_errno) goto fail; - if (grub_affs_create_node (dir, hook, hook_data, &node, &hashtable, + if (VasEBoot_affs_create_node (dir, hook, hook_data, &node, &hashtable, next, &file)) return 1; - next = grub_be_to_cpu32 (file.next); + next = VasEBoot_be_to_cpu32 (file.next); } } - grub_free (hashtable); + VasEBoot_free (hashtable); return 0; fail: - grub_free (node); - grub_free (hashtable); + VasEBoot_free (node); + VasEBoot_free (hashtable); return 0; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_affs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_affs_open (struct VasEBoot_file *file, const char *name) { - struct grub_affs_data *data; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_affs_data *data; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_affs_mount (file->device->disk); + data = VasEBoot_affs_mount (file->device->disk); if (!data) goto fail; - grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_affs_iterate_dir, - grub_affs_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &data->diropen, &fdiro, VasEBoot_affs_iterate_dir, + VasEBoot_affs_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; - file->size = grub_be_to_cpu32 (fdiro->di.size); + file->size = VasEBoot_be_to_cpu32 (fdiro->di.size); data->diropen = *fdiro; - grub_free (fdiro); + VasEBoot_free (fdiro); file->data = data; file->offset = 0; @@ -501,211 +501,211 @@ grub_affs_open (struct grub_file *file, const char *name) fail: if (data && fdiro != &data->diropen) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_affs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_affs_close (VasEBoot_file_t file) { - struct grub_affs_data *data = - (struct grub_affs_data *) file->data; + struct VasEBoot_affs_data *data = + (struct VasEBoot_affs_data *) file->data; - grub_free (data->diropen.block_cache); - grub_free (file->data); + VasEBoot_free (data->diropen.block_cache); + VasEBoot_free (file->data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read LEN bytes data from FILE into BUF. */ -static grub_ssize_t -grub_affs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_affs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_affs_data *data = - (struct grub_affs_data *) file->data; + struct VasEBoot_affs_data *data = + (struct VasEBoot_affs_data *) file->data; - return grub_fshelp_read_file (data->diropen.data->disk, &data->diropen, + return VasEBoot_fshelp_read_file (data->diropen.data->disk, &data->diropen, file->read_hook, file->read_hook_data, - file->offset, len, buf, grub_affs_read_block, - grub_be_to_cpu32 (data->diropen.di.size), + file->offset, len, buf, VasEBoot_affs_read_block, + VasEBoot_be_to_cpu32 (data->diropen.di.size), data->log_blocksize, 0); } -static grub_int32_t -aftime2ctime (const struct grub_affs_time *t) +static VasEBoot_int32_t +aftime2ctime (const struct VasEBoot_affs_time *t) { - return grub_be_to_cpu32 (t->day) * 86400 - + grub_be_to_cpu32 (t->min) * 60 - + grub_be_to_cpu32 (t->hz) / 50 + return VasEBoot_be_to_cpu32 (t->day) * 86400 + + VasEBoot_be_to_cpu32 (t->min) * 60 + + VasEBoot_be_to_cpu32 (t->hz) / 50 + 8 * 365 * 86400 + 86400 * 2; } -/* Context for grub_affs_dir. */ -struct grub_affs_dir_ctx +/* Context for VasEBoot_affs_dir. */ +struct VasEBoot_affs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_affs_dir. */ +/* Helper for VasEBoot_affs_dir. */ static int -grub_affs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_affs_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_affs_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_affs_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtimeset = 1; info.mtime = aftime2ctime (&node->di.mtime); - grub_free (node); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_affs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_affs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_affs_dir_ctx ctx = { hook, hook_data }; - struct grub_affs_data *data = 0; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_affs_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_affs_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_affs_mount (device->disk); + data = VasEBoot_affs_mount (device->disk); if (!data) goto fail; - grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_affs_iterate_dir, - grub_affs_read_symlink, GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &data->diropen, &fdiro, VasEBoot_affs_iterate_dir, + VasEBoot_affs_read_symlink, VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_affs_iterate_dir (fdiro, grub_affs_dir_iter, &ctx); + VasEBoot_affs_iterate_dir (fdiro, VasEBoot_affs_dir_iter, &ctx); fail: if (data && fdiro != &data->diropen) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_affs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_affs_label (VasEBoot_device_t device, char **label) { - struct grub_affs_data *data; - struct grub_affs_file file; - grub_disk_t disk = device->disk; + struct VasEBoot_affs_data *data; + struct VasEBoot_affs_file file; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_affs_mount (disk); + data = VasEBoot_affs_mount (disk); if (data) { - grub_size_t len; + VasEBoot_size_t len; /* The rootblock maps quite well on a file header block, it's something we can use here. */ - grub_disk_read (data->disk, - (((grub_uint64_t) - grub_be_to_cpu32 (data->bblock.rootblock) + 1) + VasEBoot_disk_read (data->disk, + (((VasEBoot_uint64_t) + VasEBoot_be_to_cpu32 (data->bblock.rootblock) + 1) << data->log_blocksize) - 1, - GRUB_DISK_SECTOR_SIZE - GRUB_AFFS_FILE_LOCATION, + VasEBoot_DISK_SECTOR_SIZE - VasEBoot_AFFS_FILE_LOCATION, sizeof (file), &file); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; len = file.namelen; if (len > sizeof (file.name)) len = sizeof (file.name); - *label = grub_malloc (len * GRUB_MAX_UTF8_PER_LATIN1 + 1); + *label = VasEBoot_malloc (len * VasEBoot_MAX_UTF8_PER_LATIN1 + 1); if (*label) - *grub_latin1_to_utf8 ((grub_uint8_t *) *label, file.name, len) = '\0'; + *VasEBoot_latin1_to_utf8 ((VasEBoot_uint8_t *) *label, file.name, len) = '\0'; } else *label = 0; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_affs_mtime (grub_device_t device, grub_int32_t *t) +static VasEBoot_err_t +VasEBoot_affs_mtime (VasEBoot_device_t device, VasEBoot_int32_t *t) { - struct grub_affs_data *data; - grub_disk_t disk = device->disk; - struct grub_affs_time af_time; + struct VasEBoot_affs_data *data; + VasEBoot_disk_t disk = device->disk; + struct VasEBoot_affs_time af_time; *t = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_affs_mount (disk); + data = VasEBoot_affs_mount (disk); if (!data) { - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } - grub_disk_read (data->disk, - (((grub_uint64_t) - grub_be_to_cpu32 (data->bblock.rootblock) + 1) + VasEBoot_disk_read (data->disk, + (((VasEBoot_uint64_t) + VasEBoot_be_to_cpu32 (data->bblock.rootblock) + 1) << data->log_blocksize) - 1, - GRUB_DISK_SECTOR_SIZE - 40, + VasEBoot_DISK_SECTOR_SIZE - 40, sizeof (af_time), &af_time); - if (grub_errno) + if (VasEBoot_errno) { - grub_dl_unref (my_mod); - grub_free (data); - return grub_errno; + VasEBoot_dl_unref (my_mod); + VasEBoot_free (data); + return VasEBoot_errno; } *t = aftime2ctime (&af_time); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_fs grub_affs_fs = +static struct VasEBoot_fs VasEBoot_affs_fs = { .name = "affs", - .dir = grub_affs_dir, - .open = grub_affs_open, - .read = grub_affs_read, - .close = grub_affs_close, - .label = grub_affs_label, - .mtime = grub_affs_mtime, + .dir = VasEBoot_affs_dir, + .open = VasEBoot_affs_open, + .read = VasEBoot_affs_read, + .close = VasEBoot_affs_close, + .label = VasEBoot_affs_label, + .mtime = VasEBoot_affs_mtime, -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(affs) +VasEBoot_MOD_INIT(affs) { - grub_fs_register (&grub_affs_fs); + VasEBoot_fs_register (&VasEBoot_affs_fs); my_mod = mod; } -GRUB_MOD_FINI(affs) +VasEBoot_MOD_FINI(affs) { - grub_fs_unregister (&grub_affs_fs); + VasEBoot_fs_unregister (&VasEBoot_affs_fs); } diff --git a/VasEBoot-core/fs/archelp.c b/VasEBoot-core/fs/archelp.c index 0cf544f6f..74c31a914 100644 --- a/VasEBoot-core/fs/archelp.c +++ b/VasEBoot-core/fs/archelp.c @@ -1,5 +1,5 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static inline void canonicalize (char *name) @@ -54,30 +54,30 @@ canonicalize (char *name) *optr = 0; } -static grub_err_t -handle_symlink (struct grub_archelp_data *data, - struct grub_archelp_ops *arcops, +static VasEBoot_err_t +handle_symlink (struct VasEBoot_archelp_data *data, + struct VasEBoot_archelp_ops *arcops, const char *fn, char **name, - grub_uint32_t mode, int *restart) + VasEBoot_uint32_t mode, int *restart) { - grub_size_t flen; + VasEBoot_size_t flen; char *target; char *ptr; char *lastslash; - grub_size_t prefixlen; + VasEBoot_size_t prefixlen; char *rest; char *linktarget; - grub_size_t linktarget_len; + VasEBoot_size_t linktarget_len; *restart = 0; - if ((mode & GRUB_ARCHELP_ATTR_TYPE) != GRUB_ARCHELP_ATTR_LNK + if ((mode & VasEBoot_ARCHELP_ATTR_TYPE) != VasEBoot_ARCHELP_ATTR_LNK || !arcops->get_link_target) - return GRUB_ERR_NONE; - flen = grub_strlen (fn); - if (grub_memcmp (*name, fn, flen) != 0 + return VasEBoot_ERR_NONE; + flen = VasEBoot_strlen (fn); + if (VasEBoot_memcmp (*name, fn, flen) != 0 || ((*name)[flen] != 0 && (*name)[flen] != '/')) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; rest = *name + flen; lastslash = rest; if (*rest) @@ -94,80 +94,80 @@ handle_symlink (struct grub_archelp_data *data, linktarget = arcops->get_link_target (data); if (!linktarget) - return grub_errno; + return VasEBoot_errno; if (linktarget[0] == '\0') - return GRUB_ERR_NONE; - linktarget_len = grub_strlen (linktarget); - target = grub_malloc (linktarget_len + grub_strlen (*name) + 2); + return VasEBoot_ERR_NONE; + linktarget_len = VasEBoot_strlen (linktarget); + target = VasEBoot_malloc (linktarget_len + VasEBoot_strlen (*name) + 2); if (!target) - return grub_errno; + return VasEBoot_errno; - grub_strcpy (target + prefixlen, linktarget); - grub_free (linktarget); + VasEBoot_strcpy (target + prefixlen, linktarget); + VasEBoot_free (linktarget); if (target[prefixlen] == '/') { - ptr = grub_stpcpy (target, target + prefixlen); - ptr = grub_stpcpy (ptr, rest); + ptr = VasEBoot_stpcpy (target, target + prefixlen); + ptr = VasEBoot_stpcpy (ptr, rest); *ptr = 0; - grub_dprintf ("archelp", "symlink redirected %s to %s\n", + VasEBoot_dprintf ("archelp", "symlink redirected %s to %s\n", *name, target); - grub_free (*name); + VasEBoot_free (*name); canonicalize (target); *name = target; *restart = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (prefixlen) { - grub_memcpy (target, *name, prefixlen); + VasEBoot_memcpy (target, *name, prefixlen); target[prefixlen-1] = '/'; } - grub_strcpy (target + prefixlen + linktarget_len, rest); - grub_dprintf ("archelp", "symlink redirected %s to %s\n", + VasEBoot_strcpy (target + prefixlen + linktarget_len, rest); + VasEBoot_dprintf ("archelp", "symlink redirected %s to %s\n", *name, target); - grub_free (*name); + VasEBoot_free (*name); canonicalize (target); *name = target; *restart = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_archelp_dir (struct grub_archelp_data *data, - struct grub_archelp_ops *arcops, +VasEBoot_err_t +VasEBoot_archelp_dir (struct VasEBoot_archelp_data *data, + struct VasEBoot_archelp_ops *arcops, const char *path_in, - grub_fs_dir_hook_t hook, void *hook_data) + VasEBoot_fs_dir_hook_t hook, void *hook_data) { char *prev, *name, *path, *ptr; - grub_size_t len; + VasEBoot_size_t len; int symlinknest = 0; - path = grub_strdup (path_in + 1); + path = VasEBoot_strdup (path_in + 1); if (!path) - return grub_errno; + return VasEBoot_errno; canonicalize (path); - for (ptr = path + grub_strlen (path) - 1; ptr >= path && *ptr == '/'; ptr--) + for (ptr = path + VasEBoot_strlen (path) - 1; ptr >= path && *ptr == '/'; ptr--) *ptr = 0; prev = 0; - len = grub_strlen (path); + len = VasEBoot_strlen (path); while (1) { - grub_int32_t mtime; - grub_uint32_t mode; - grub_err_t err; + VasEBoot_int32_t mtime; + VasEBoot_uint32_t mode; + VasEBoot_err_t err; if (arcops->find_file (data, &name, &mtime, &mode)) goto fail; - if (mode == GRUB_ARCHELP_ATTR_END) + if (mode == VasEBoot_ARCHELP_ATTR_END) break; canonicalize (name); - if (grub_memcmp (path, name, len) == 0 + if (VasEBoot_memcmp (path, name, len) == 0 && (name[len] == 0 || name[len] == '/' || len == 0)) { char *p, *n; @@ -176,27 +176,27 @@ grub_archelp_dir (struct grub_archelp_data *data, while (*n == '/') n++; - p = grub_strchr (n, '/'); + p = VasEBoot_strchr (n, '/'); if (p) *p = 0; - if (((!prev) || (grub_strcmp (prev, name) != 0)) && *n != 0) + if (((!prev) || (VasEBoot_strcmp (prev, name) != 0)) && *n != 0) { - struct grub_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = (p != NULL) || ((mode & GRUB_ARCHELP_ATTR_TYPE) - == GRUB_ARCHELP_ATTR_DIR); - if (!(mode & GRUB_ARCHELP_ATTR_NOTIME)) + struct VasEBoot_dirhook_info info; + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = (p != NULL) || ((mode & VasEBoot_ARCHELP_ATTR_TYPE) + == VasEBoot_ARCHELP_ATTR_DIR); + if (!(mode & VasEBoot_ARCHELP_ATTR_NOTIME)) { info.mtime = mtime; info.mtimeset = 1; } if (hook (n, &info, hook_data)) { - grub_free (name); + VasEBoot_free (name); goto fail; } - grub_free (prev); + VasEBoot_free (prev); prev = name; } else @@ -204,15 +204,15 @@ grub_archelp_dir (struct grub_archelp_data *data, int restart = 0; err = handle_symlink (data, arcops, name, &path, mode, &restart); - grub_free (name); + VasEBoot_free (name); if (err) goto fail; if (restart) { - len = grub_strlen (path); + len = VasEBoot_strlen (path); if (++symlinknest == 8) { - grub_error (GRUB_ERR_SYMLINK_LOOP, + VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); goto fail; } @@ -221,43 +221,43 @@ grub_archelp_dir (struct grub_archelp_data *data, } } else - grub_free (name); + VasEBoot_free (name); } fail: - grub_free (path); - grub_free (prev); + VasEBoot_free (path); + VasEBoot_free (prev); - return grub_errno; + return VasEBoot_errno; } -grub_err_t -grub_archelp_open (struct grub_archelp_data *data, - struct grub_archelp_ops *arcops, +VasEBoot_err_t +VasEBoot_archelp_open (struct VasEBoot_archelp_data *data, + struct VasEBoot_archelp_ops *arcops, const char *name_in) { char *fn; - char *name = grub_strdup (name_in + 1); + char *name = VasEBoot_strdup (name_in + 1); int symlinknest = 0; if (!name) - return grub_errno; + return VasEBoot_errno; canonicalize (name); while (1) { - grub_uint32_t mode; - grub_int32_t mtime; + VasEBoot_uint32_t mode; + VasEBoot_int32_t mtime; int restart; if (arcops->find_file (data, &fn, &mtime, &mode)) goto fail; - if (mode == GRUB_ARCHELP_ATTR_END) + if (mode == VasEBoot_ARCHELP_ATTR_END) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name_in); + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name_in); break; } @@ -265,7 +265,7 @@ grub_archelp_open (struct grub_archelp_data *data, if (handle_symlink (data, arcops, fn, &name, mode, &restart)) { - grub_free (fn); + VasEBoot_free (fn); goto fail; } @@ -274,28 +274,28 @@ grub_archelp_open (struct grub_archelp_data *data, arcops->rewind (data); if (++symlinknest == 8) { - grub_error (GRUB_ERR_SYMLINK_LOOP, + VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); goto fail; } goto no_match; } - if (grub_strcmp (name, fn) != 0) + if (VasEBoot_strcmp (name, fn) != 0) goto no_match; - grub_free (fn); - grub_free (name); + VasEBoot_free (fn); + VasEBoot_free (name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; no_match: - grub_free (fn); + VasEBoot_free (fn); } fail: - grub_free (name); + VasEBoot_free (name); - return grub_errno; + return VasEBoot_errno; } diff --git a/VasEBoot-core/fs/bfs.c b/VasEBoot-core/fs/bfs.c index d2b490bce..b8c34a8fc 100644 --- a/VasEBoot-core/fs/bfs.c +++ b/VasEBoot-core/fs/bfs.c @@ -1,37 +1,37 @@ /* bfs.c - The Bee File System. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Based on the book "Practical File System Design by Dominic Giampaolo with corrections and completitions based on Haiku code. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #ifdef MODE_AFS #define BTREE_ALIGN 4 @@ -41,15 +41,15 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define SUPERBLOCK 1 #endif -#define grub_bfs_to_cpu16 grub_le_to_cpu16 -#define grub_bfs_to_cpu32 grub_le_to_cpu32 -#define grub_bfs_to_cpu64 grub_le_to_cpu64 -#define grub_cpu_to_bfs32_compile_time grub_cpu_to_le32_compile_time +#define VasEBoot_bfs_to_cpu16 VasEBoot_le_to_cpu16 +#define VasEBoot_bfs_to_cpu32 VasEBoot_le_to_cpu32 +#define VasEBoot_bfs_to_cpu64 VasEBoot_le_to_cpu64 +#define VasEBoot_cpu_to_bfs32_compile_time VasEBoot_cpu_to_le32_compile_time #ifdef MODE_AFS -#define grub_bfs_to_cpu_treehead grub_bfs_to_cpu32 +#define VasEBoot_bfs_to_cpu_treehead VasEBoot_bfs_to_cpu32 #else -#define grub_bfs_to_cpu_treehead grub_bfs_to_cpu16 +#define VasEBoot_bfs_to_cpu_treehead VasEBoot_bfs_to_cpu16 #endif #ifdef MODE_AFS @@ -69,177 +69,177 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define DOUBLE_INDIRECT_SHIFT 2 #define LOG_EXTENT_SIZE 3 -struct grub_bfs_extent +struct VasEBoot_bfs_extent { - grub_uint32_t ag; - grub_uint16_t start; - grub_uint16_t len; -} GRUB_PACKED; + VasEBoot_uint32_t ag; + VasEBoot_uint16_t start; + VasEBoot_uint16_t len; +} VasEBoot_PACKED; -struct grub_bfs_superblock +struct VasEBoot_bfs_superblock { char label[32]; - grub_uint32_t magic1; - grub_uint32_t unused1; - grub_uint32_t bsize; - grub_uint32_t log2_bsize; - grub_uint8_t unused[20]; - grub_uint32_t magic2; - grub_uint32_t unused2; - grub_uint32_t log2_ag_size; - grub_uint8_t unused3[32]; - grub_uint32_t magic3; - struct grub_bfs_extent root_dir; -} GRUB_PACKED; + VasEBoot_uint32_t magic1; + VasEBoot_uint32_t unused1; + VasEBoot_uint32_t bsize; + VasEBoot_uint32_t log2_bsize; + VasEBoot_uint8_t unused[20]; + VasEBoot_uint32_t magic2; + VasEBoot_uint32_t unused2; + VasEBoot_uint32_t log2_ag_size; + VasEBoot_uint8_t unused3[32]; + VasEBoot_uint32_t magic3; + struct VasEBoot_bfs_extent root_dir; +} VasEBoot_PACKED; -struct grub_bfs_inode +struct VasEBoot_bfs_inode { - grub_uint8_t unused[20]; - grub_uint32_t mode; - grub_uint32_t flags; + VasEBoot_uint8_t unused[20]; + VasEBoot_uint32_t mode; + VasEBoot_uint32_t flags; #ifdef MODE_AFS - grub_uint8_t unused2[12]; + VasEBoot_uint8_t unused2[12]; #else - grub_uint8_t unused2[8]; + VasEBoot_uint8_t unused2[8]; #endif - grub_uint64_t mtime; - grub_uint8_t unused3[8]; - struct grub_bfs_extent attr; - grub_uint8_t unused4[12]; + VasEBoot_uint64_t mtime; + VasEBoot_uint8_t unused3[8]; + struct VasEBoot_bfs_extent attr; + VasEBoot_uint8_t unused4[12]; union { struct { - struct grub_bfs_extent direct[12]; - grub_uint64_t max_direct_range; - struct grub_bfs_extent indirect; - grub_uint64_t max_indirect_range; - struct grub_bfs_extent double_indirect; - grub_uint64_t max_double_indirect_range; - grub_uint64_t size; - grub_uint32_t pad[4]; - } GRUB_PACKED; + struct VasEBoot_bfs_extent direct[12]; + VasEBoot_uint64_t max_direct_range; + struct VasEBoot_bfs_extent indirect; + VasEBoot_uint64_t max_indirect_range; + struct VasEBoot_bfs_extent double_indirect; + VasEBoot_uint64_t max_double_indirect_range; + VasEBoot_uint64_t size; + VasEBoot_uint32_t pad[4]; + } VasEBoot_PACKED; char inplace_link[144]; - } GRUB_PACKED; - grub_uint8_t small_data[0]; -} GRUB_PACKED; + } VasEBoot_PACKED; + VasEBoot_uint8_t small_data[0]; +} VasEBoot_PACKED; enum { LONG_SYMLINK = 0x40 }; -struct grub_bfs_small_data_element_header +struct VasEBoot_bfs_small_data_element_header { - grub_uint32_t type; - grub_uint16_t name_len; - grub_uint16_t value_len; -} GRUB_PACKED; + VasEBoot_uint32_t type; + VasEBoot_uint16_t name_len; + VasEBoot_uint16_t value_len; +} VasEBoot_PACKED; -struct grub_bfs_btree_header +struct VasEBoot_bfs_btree_header { - grub_uint32_t magic; + VasEBoot_uint32_t magic; #ifdef MODE_AFS - grub_uint64_t root; - grub_uint32_t level; - grub_uint32_t node_size; - grub_uint32_t unused; + VasEBoot_uint64_t root; + VasEBoot_uint32_t level; + VasEBoot_uint32_t node_size; + VasEBoot_uint32_t unused; #else - grub_uint32_t node_size; - grub_uint32_t level; - grub_uint32_t unused; - grub_uint64_t root; + VasEBoot_uint32_t node_size; + VasEBoot_uint32_t level; + VasEBoot_uint32_t unused; + VasEBoot_uint64_t root; #endif - grub_uint32_t unused2[2]; -} GRUB_PACKED; + VasEBoot_uint32_t unused2[2]; +} VasEBoot_PACKED; -struct grub_bfs_btree_node +struct VasEBoot_bfs_btree_node { - grub_uint64_t unused; - grub_uint64_t right; - grub_uint64_t overflow; + VasEBoot_uint64_t unused; + VasEBoot_uint64_t right; + VasEBoot_uint64_t overflow; #ifdef MODE_AFS - grub_uint32_t count_keys; - grub_uint32_t total_key_len; + VasEBoot_uint32_t count_keys; + VasEBoot_uint32_t total_key_len; #else - grub_uint16_t count_keys; - grub_uint16_t total_key_len; + VasEBoot_uint16_t count_keys; + VasEBoot_uint16_t total_key_len; #endif -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_bfs_data +struct VasEBoot_bfs_data { - struct grub_bfs_superblock sb; - struct grub_bfs_inode ino; + struct VasEBoot_bfs_superblock sb; + struct VasEBoot_bfs_inode ino; }; -/* Context for grub_bfs_dir. */ -struct grub_bfs_dir_ctx +/* Context for VasEBoot_bfs_dir. */ +struct VasEBoot_bfs_dir_ctx { - grub_device_t device; - grub_fs_dir_hook_t hook; + VasEBoot_device_t device; + VasEBoot_fs_dir_hook_t hook; void *hook_data; - struct grub_bfs_superblock sb; + struct VasEBoot_bfs_superblock sb; }; -static grub_err_t -read_extent (grub_disk_t disk, - const struct grub_bfs_superblock *sb, - const struct grub_bfs_extent *in, - grub_off_t off, grub_off_t byteoff, void *buf, grub_size_t len) +static VasEBoot_err_t +read_extent (VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, + const struct VasEBoot_bfs_extent *in, + VasEBoot_off_t off, VasEBoot_off_t byteoff, void *buf, VasEBoot_size_t len) { #ifdef MODE_AFS - return grub_disk_read (disk, ((grub_bfs_to_cpu32 (in->ag) - << (grub_bfs_to_cpu32 (sb->log2_ag_size) - - GRUB_DISK_SECTOR_BITS)) - + ((grub_bfs_to_cpu16 (in->start) + off) - << (grub_bfs_to_cpu32 (sb->log2_bsize) - - GRUB_DISK_SECTOR_BITS))), + return VasEBoot_disk_read (disk, ((VasEBoot_bfs_to_cpu32 (in->ag) + << (VasEBoot_bfs_to_cpu32 (sb->log2_ag_size) + - VasEBoot_DISK_SECTOR_BITS)) + + ((VasEBoot_bfs_to_cpu16 (in->start) + off) + << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) + - VasEBoot_DISK_SECTOR_BITS))), byteoff, len, buf); #else - return grub_disk_read (disk, (((grub_bfs_to_cpu32 (in->ag) - << grub_bfs_to_cpu32 (sb->log2_ag_size)) - + grub_bfs_to_cpu16 (in->start) + off) - << (grub_bfs_to_cpu32 (sb->log2_bsize) - - GRUB_DISK_SECTOR_BITS)), + return VasEBoot_disk_read (disk, (((VasEBoot_bfs_to_cpu32 (in->ag) + << VasEBoot_bfs_to_cpu32 (sb->log2_ag_size)) + + VasEBoot_bfs_to_cpu16 (in->start) + off) + << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) + - VasEBoot_DISK_SECTOR_BITS)), byteoff, len, buf); #endif } #ifdef MODE_AFS -#define RANGE_SHIFT grub_bfs_to_cpu32 (sb->log2_bsize) +#define RANGE_SHIFT VasEBoot_bfs_to_cpu32 (sb->log2_bsize) #else #define RANGE_SHIFT 0 #endif -static grub_err_t -read_bfs_file (grub_disk_t disk, - const struct grub_bfs_superblock *sb, - const struct grub_bfs_inode *ino, - grub_off_t off, void *buf, grub_size_t len, - grub_disk_read_hook_t read_hook, void *read_hook_data) +static VasEBoot_err_t +read_bfs_file (VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, + const struct VasEBoot_bfs_inode *ino, + VasEBoot_off_t off, void *buf, VasEBoot_size_t len, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data) { if (len == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - if (off + len > grub_bfs_to_cpu64 (ino->size)) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + if (off + len > VasEBoot_bfs_to_cpu64 (ino->size)) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read past the end of file")); - if (off < (grub_bfs_to_cpu64 (ino->max_direct_range) << RANGE_SHIFT)) + if (off < (VasEBoot_bfs_to_cpu64 (ino->max_direct_range) << RANGE_SHIFT)) { unsigned i; - grub_uint64_t pos = 0; + VasEBoot_uint64_t pos = 0; for (i = 0; i < ARRAY_SIZE (ino->direct); i++) { - grub_uint64_t newpos; - newpos = pos + (((grub_uint64_t) grub_bfs_to_cpu16 (ino->direct[i].len)) - << grub_bfs_to_cpu32 (sb->log2_bsize)); + VasEBoot_uint64_t newpos; + newpos = pos + (((VasEBoot_uint64_t) VasEBoot_bfs_to_cpu16 (ino->direct[i].len)) + << VasEBoot_bfs_to_cpu32 (sb->log2_bsize)); if (newpos > off) { - grub_size_t read_size; - grub_err_t err; + VasEBoot_size_t read_size; + VasEBoot_err_t err; read_size = newpos - off; if (read_size > len) read_size = len; @@ -254,38 +254,38 @@ read_bfs_file (grub_disk_t disk, len -= read_size; buf = (char *) buf + read_size; if (len == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } pos = newpos; } } - if (off < (grub_bfs_to_cpu64 (ino->max_direct_range) << RANGE_SHIFT)) - return grub_error (GRUB_ERR_BAD_FS, "incorrect direct blocks"); + if (off < (VasEBoot_bfs_to_cpu64 (ino->max_direct_range) << RANGE_SHIFT)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect direct blocks"); - if (off < (grub_bfs_to_cpu64 (ino->max_indirect_range) << RANGE_SHIFT)) + if (off < (VasEBoot_bfs_to_cpu64 (ino->max_indirect_range) << RANGE_SHIFT)) { unsigned i; - struct grub_bfs_extent *entries; - grub_size_t nentries; - grub_err_t err; - grub_uint64_t pos = (grub_bfs_to_cpu64 (ino->max_direct_range) + struct VasEBoot_bfs_extent *entries; + VasEBoot_size_t nentries; + VasEBoot_err_t err; + VasEBoot_uint64_t pos = (VasEBoot_bfs_to_cpu64 (ino->max_direct_range) << RANGE_SHIFT); - nentries = (((grub_size_t) grub_bfs_to_cpu16 (ino->indirect.len)) - << (grub_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE)); - entries = grub_malloc (nentries << LOG_EXTENT_SIZE); + nentries = (((VasEBoot_size_t) VasEBoot_bfs_to_cpu16 (ino->indirect.len)) + << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE)); + entries = VasEBoot_malloc (nentries << LOG_EXTENT_SIZE); if (!entries) - return grub_errno; + return VasEBoot_errno; err = read_extent (disk, sb, &ino->indirect, 0, 0, entries, nentries << LOG_EXTENT_SIZE); for (i = 0; i < nentries; i++) { - grub_uint64_t newpos; - newpos = pos + (((grub_uint64_t) grub_bfs_to_cpu16 (entries[i].len)) - << grub_bfs_to_cpu32 (sb->log2_bsize)); + VasEBoot_uint64_t newpos; + newpos = pos + (((VasEBoot_uint64_t) VasEBoot_bfs_to_cpu16 (entries[i].len)) + << VasEBoot_bfs_to_cpu32 (sb->log2_bsize)); if (newpos > off) { - grub_size_t read_size; + VasEBoot_size_t read_size; read_size = newpos - off; if (read_size > len) read_size = len; @@ -296,7 +296,7 @@ read_bfs_file (grub_disk_t disk, disk->read_hook = 0; if (err) { - grub_free (entries); + VasEBoot_free (entries); return err; } off += read_size; @@ -304,100 +304,100 @@ read_bfs_file (grub_disk_t disk, buf = (char *) buf + read_size; if (len == 0) { - grub_free (entries); - return GRUB_ERR_NONE; + VasEBoot_free (entries); + return VasEBoot_ERR_NONE; } } pos = newpos; } - grub_free (entries); + VasEBoot_free (entries); } - if (off < (grub_bfs_to_cpu64 (ino->max_indirect_range) << RANGE_SHIFT)) - return grub_error (GRUB_ERR_BAD_FS, "incorrect indirect blocks"); + if (off < (VasEBoot_bfs_to_cpu64 (ino->max_indirect_range) << RANGE_SHIFT)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect indirect blocks"); { - struct grub_bfs_extent *l1_entries, *l2_entries; - grub_size_t nl1_entries, nl2_entries; - grub_off_t last_l1n = ~0ULL; - grub_err_t err; - nl1_entries = (((grub_uint64_t) grub_bfs_to_cpu16 (ino->double_indirect.len)) - << (grub_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE)); - l1_entries = grub_malloc (nl1_entries << LOG_EXTENT_SIZE); + struct VasEBoot_bfs_extent *l1_entries, *l2_entries; + VasEBoot_size_t nl1_entries, nl2_entries; + VasEBoot_off_t last_l1n = ~0ULL; + VasEBoot_err_t err; + nl1_entries = (((VasEBoot_uint64_t) VasEBoot_bfs_to_cpu16 (ino->double_indirect.len)) + << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE)); + l1_entries = VasEBoot_malloc (nl1_entries << LOG_EXTENT_SIZE); if (!l1_entries) - return grub_errno; + return VasEBoot_errno; nl2_entries = 0; - l2_entries = grub_malloc (1 << (DOUBLE_INDIRECT_SHIFT - + grub_bfs_to_cpu32 (sb->log2_bsize))); + l2_entries = VasEBoot_malloc (1 << (DOUBLE_INDIRECT_SHIFT + + VasEBoot_bfs_to_cpu32 (sb->log2_bsize))); if (!l2_entries) { - grub_free (l1_entries); - return grub_errno; + VasEBoot_free (l1_entries); + return VasEBoot_errno; } err = read_extent (disk, sb, &ino->double_indirect, 0, 0, l1_entries, nl1_entries << LOG_EXTENT_SIZE); if (err) { - grub_free (l1_entries); - grub_free (l2_entries); + VasEBoot_free (l1_entries); + VasEBoot_free (l2_entries); return err; } while (len > 0) { - grub_off_t boff, l2n, l1n; - grub_size_t read_size; - grub_off_t double_indirect_offset; + VasEBoot_off_t boff, l2n, l1n; + VasEBoot_size_t read_size; + VasEBoot_off_t double_indirect_offset; double_indirect_offset = off - - grub_bfs_to_cpu64 (ino->max_indirect_range); + - VasEBoot_bfs_to_cpu64 (ino->max_indirect_range); boff = (double_indirect_offset - & ((1 << (grub_bfs_to_cpu32 (sb->log2_bsize) + & ((1 << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) + DOUBLE_INDIRECT_SHIFT)) - 1)); - l2n = ((double_indirect_offset >> (grub_bfs_to_cpu32 (sb->log2_bsize) + l2n = ((double_indirect_offset >> (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) + DOUBLE_INDIRECT_SHIFT)) - & ((1 << (grub_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE + & ((1 << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE + DOUBLE_INDIRECT_SHIFT)) - 1)); l1n = (double_indirect_offset >> - (2 * grub_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE + + (2 * VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE + 2 * DOUBLE_INDIRECT_SHIFT)); if (l1n > nl1_entries) { - grub_free (l1_entries); - grub_free (l2_entries); - return grub_error (GRUB_ERR_BAD_FS, + VasEBoot_free (l1_entries); + VasEBoot_free (l2_entries); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect double-indirect block"); } if (l1n != last_l1n) { - nl2_entries = (((grub_uint64_t) grub_bfs_to_cpu16 (l1_entries[l1n].len)) - << (grub_bfs_to_cpu32 (sb->log2_bsize) + nl2_entries = (((VasEBoot_uint64_t) VasEBoot_bfs_to_cpu16 (l1_entries[l1n].len)) + << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE)); - if (nl2_entries > (1U << (grub_bfs_to_cpu32 (sb->log2_bsize) + if (nl2_entries > (1U << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE + DOUBLE_INDIRECT_SHIFT))) - nl2_entries = (1 << (grub_bfs_to_cpu32 (sb->log2_bsize) + nl2_entries = (1 << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) - LOG_EXTENT_SIZE + DOUBLE_INDIRECT_SHIFT)); err = read_extent (disk, sb, &l1_entries[l1n], 0, 0, l2_entries, nl2_entries << LOG_EXTENT_SIZE); if (err) { - grub_free (l1_entries); - grub_free (l2_entries); + VasEBoot_free (l1_entries); + VasEBoot_free (l2_entries); return err; } last_l1n = l1n; } if (l2n > nl2_entries) { - grub_free (l1_entries); - grub_free (l2_entries); - return grub_error (GRUB_ERR_BAD_FS, + VasEBoot_free (l1_entries); + VasEBoot_free (l2_entries); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect double-indirect block"); } - read_size = (1 << (grub_bfs_to_cpu32 (sb->log2_bsize) + read_size = (1 << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) + DOUBLE_INDIRECT_SHIFT)) - boff; if (read_size > len) read_size = len; @@ -408,31 +408,31 @@ read_bfs_file (grub_disk_t disk, disk->read_hook = 0; if (err) { - grub_free (l1_entries); - grub_free (l2_entries); + VasEBoot_free (l1_entries); + VasEBoot_free (l2_entries); return err; } off += read_size; len -= read_size; buf = (char *) buf + read_size; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } -static grub_err_t -read_b_node (grub_disk_t disk, - const struct grub_bfs_superblock *sb, - const struct grub_bfs_inode *ino, - grub_uint64_t node_off, - struct grub_bfs_btree_node **node, - char **key_data, grub_uint16_t **keylen_idx, - grub_unaligned_uint64_t **key_values) +static VasEBoot_err_t +read_b_node (VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, + const struct VasEBoot_bfs_inode *ino, + VasEBoot_uint64_t node_off, + struct VasEBoot_bfs_btree_node **node, + char **key_data, VasEBoot_uint16_t **keylen_idx, + VasEBoot_unaligned_uint64_t **key_values) { void *ret; - struct grub_bfs_btree_node node_head; - grub_size_t total_size; - grub_err_t err; + struct VasEBoot_bfs_btree_node node_head; + VasEBoot_size_t total_size; + VasEBoot_err_t err; *node = NULL; *key_data = NULL; @@ -445,87 +445,87 @@ read_b_node (grub_disk_t disk, return err; total_size = ALIGN_UP (sizeof (node_head) + - grub_bfs_to_cpu_treehead + VasEBoot_bfs_to_cpu_treehead (node_head.total_key_len), BTREE_ALIGN) + - grub_bfs_to_cpu_treehead (node_head.count_keys) * - sizeof (grub_uint16_t) - + grub_bfs_to_cpu_treehead (node_head.count_keys) * - sizeof (grub_uint64_t); + VasEBoot_bfs_to_cpu_treehead (node_head.count_keys) * + sizeof (VasEBoot_uint16_t) + + VasEBoot_bfs_to_cpu_treehead (node_head.count_keys) * + sizeof (VasEBoot_uint64_t); - ret = grub_malloc (total_size); + ret = VasEBoot_malloc (total_size); if (!ret) - return grub_errno; + return VasEBoot_errno; err = read_bfs_file (disk, sb, ino, node_off, ret, total_size, 0, 0); if (err) { - grub_free (ret); + VasEBoot_free (ret); return err; } *node = ret; *key_data = (char *) ret + sizeof (node_head); - *keylen_idx = (grub_uint16_t *) ret + *keylen_idx = (VasEBoot_uint16_t *) ret + ALIGN_UP (sizeof (node_head) + - grub_bfs_to_cpu_treehead (node_head.total_key_len), + VasEBoot_bfs_to_cpu_treehead (node_head.total_key_len), BTREE_ALIGN) / 2; - *key_values = (grub_unaligned_uint64_t *) + *key_values = (VasEBoot_unaligned_uint64_t *) (*keylen_idx + - grub_bfs_to_cpu_treehead (node_head.count_keys)); + VasEBoot_bfs_to_cpu_treehead (node_head.count_keys)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -iterate_in_b_tree (grub_disk_t disk, - const struct grub_bfs_superblock *sb, - const struct grub_bfs_inode *ino, - int (*hook) (const char *name, grub_uint64_t value, - struct grub_bfs_dir_ctx *ctx), - struct grub_bfs_dir_ctx *ctx) +iterate_in_b_tree (VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, + const struct VasEBoot_bfs_inode *ino, + int (*hook) (const char *name, VasEBoot_uint64_t value, + struct VasEBoot_bfs_dir_ctx *ctx), + struct VasEBoot_bfs_dir_ctx *ctx) { - struct grub_bfs_btree_header head; - grub_err_t err; + struct VasEBoot_bfs_btree_header head; + VasEBoot_err_t err; int level; - grub_uint64_t node_off; + VasEBoot_uint64_t node_off; err = read_bfs_file (disk, sb, ino, 0, &head, sizeof (head), 0, 0); if (err) return 0; - node_off = grub_bfs_to_cpu64 (head.root); + node_off = VasEBoot_bfs_to_cpu64 (head.root); - level = grub_bfs_to_cpu32 (head.level) - 1; + level = VasEBoot_bfs_to_cpu32 (head.level) - 1; while (level--) { - struct grub_bfs_btree_node node; - grub_uint64_t key_value; + struct VasEBoot_bfs_btree_node node; + VasEBoot_uint64_t key_value; err = read_bfs_file (disk, sb, ino, node_off, &node, sizeof (node), 0, 0); if (err) return 0; err = read_bfs_file (disk, sb, ino, node_off + ALIGN_UP (sizeof (node) + - grub_bfs_to_cpu_treehead (node. + VasEBoot_bfs_to_cpu_treehead (node. total_key_len), BTREE_ALIGN) + - grub_bfs_to_cpu_treehead (node.count_keys) * - sizeof (grub_uint16_t), &key_value, - sizeof (grub_uint64_t), 0, 0); + VasEBoot_bfs_to_cpu_treehead (node.count_keys) * + sizeof (VasEBoot_uint16_t), &key_value, + sizeof (VasEBoot_uint64_t), 0, 0); if (err) return 0; - node_off = grub_bfs_to_cpu64 (key_value); + node_off = VasEBoot_bfs_to_cpu64 (key_value); } while (1) { - struct grub_bfs_btree_node *node; + struct VasEBoot_bfs_btree_node *node; char *key_data; - grub_uint16_t *keylen_idx; - grub_unaligned_uint64_t *key_values; + VasEBoot_uint16_t *keylen_idx; + VasEBoot_unaligned_uint64_t *key_values; unsigned i; - grub_uint16_t start = 0, end = 0; + VasEBoot_uint16_t start = 0, end = 0; err = read_b_node (disk, sb, ino, node_off, @@ -537,32 +537,32 @@ iterate_in_b_tree (grub_disk_t disk, if (err) return 0; - for (i = 0; i < grub_bfs_to_cpu_treehead (node->count_keys); i++) + for (i = 0; i < VasEBoot_bfs_to_cpu_treehead (node->count_keys); i++) { char c; start = end; - end = grub_bfs_to_cpu16 (keylen_idx[i]); - if (grub_bfs_to_cpu_treehead (node->total_key_len) <= end) - end = grub_bfs_to_cpu_treehead (node->total_key_len); + end = VasEBoot_bfs_to_cpu16 (keylen_idx[i]); + if (VasEBoot_bfs_to_cpu_treehead (node->total_key_len) <= end) + end = VasEBoot_bfs_to_cpu_treehead (node->total_key_len); c = key_data[end]; key_data[end] = 0; - if (hook (key_data + start, grub_bfs_to_cpu64 (key_values[i].val), + if (hook (key_data + start, VasEBoot_bfs_to_cpu64 (key_values[i].val), ctx)) { - grub_free (node); + VasEBoot_free (node); return 1; } key_data[end] = c; } - node_off = grub_bfs_to_cpu64 (node->right); - grub_free (node); + node_off = VasEBoot_bfs_to_cpu64 (node->right); + VasEBoot_free (node); if (node_off == POINTER_INVALID) return 0; } } static int -bfs_strcmp (const char *a, const char *b, grub_size_t alen) +bfs_strcmp (const char *a, const char *b, VasEBoot_size_t alen) { char ac, bc; while (*b && alen) @@ -579,35 +579,35 @@ bfs_strcmp (const char *a, const char *b, grub_size_t alen) bc = *b; #ifdef MODE_AFS - return (int) (grub_int8_t) ac - (int) (grub_int8_t) bc; + return (int) (VasEBoot_int8_t) ac - (int) (VasEBoot_int8_t) bc; #else - return (int) (grub_uint8_t) ac - (int) (grub_uint8_t) bc; + return (int) (VasEBoot_uint8_t) ac - (int) (VasEBoot_uint8_t) bc; #endif } -static grub_err_t -find_in_b_tree (grub_disk_t disk, - const struct grub_bfs_superblock *sb, - const struct grub_bfs_inode *ino, const char *name, - grub_uint64_t * res) +static VasEBoot_err_t +find_in_b_tree (VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, + const struct VasEBoot_bfs_inode *ino, const char *name, + VasEBoot_uint64_t * res) { - struct grub_bfs_btree_header head; - grub_err_t err; + struct VasEBoot_bfs_btree_header head; + VasEBoot_err_t err; int level; - grub_uint64_t node_off; + VasEBoot_uint64_t node_off; err = read_bfs_file (disk, sb, ino, 0, &head, sizeof (head), 0, 0); if (err) return err; - node_off = grub_bfs_to_cpu64 (head.root); + node_off = VasEBoot_bfs_to_cpu64 (head.root); - level = grub_bfs_to_cpu32 (head.level) - 1; + level = VasEBoot_bfs_to_cpu32 (head.level) - 1; while (1) { - struct grub_bfs_btree_node *node; + struct VasEBoot_bfs_btree_node *node; char *key_data; - grub_uint16_t *keylen_idx; - grub_unaligned_uint64_t *key_values; + VasEBoot_uint16_t *keylen_idx; + VasEBoot_unaligned_uint64_t *key_values; int lg, j; unsigned i; @@ -617,31 +617,31 @@ find_in_b_tree (grub_disk_t disk, if (node->count_keys == 0) { - grub_free (node); - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), + VasEBoot_free (node); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); } - for (lg = 0; grub_bfs_to_cpu_treehead (node->count_keys) >> lg; lg++); + for (lg = 0; VasEBoot_bfs_to_cpu_treehead (node->count_keys) >> lg; lg++); i = 0; for (j = lg - 1; j >= 0; j--) { int cmp; - grub_uint16_t start = 0, end = 0; - if ((i | (1 << j)) >= grub_bfs_to_cpu_treehead (node->count_keys)) + VasEBoot_uint16_t start = 0, end = 0; + if ((i | (1 << j)) >= VasEBoot_bfs_to_cpu_treehead (node->count_keys)) continue; - start = grub_bfs_to_cpu16 (keylen_idx[(i | (1 << j)) - 1]); - end = grub_bfs_to_cpu16 (keylen_idx[(i | (1 << j))]); - if (grub_bfs_to_cpu_treehead (node->total_key_len) <= end) - end = grub_bfs_to_cpu_treehead (node->total_key_len); + start = VasEBoot_bfs_to_cpu16 (keylen_idx[(i | (1 << j)) - 1]); + end = VasEBoot_bfs_to_cpu16 (keylen_idx[(i | (1 << j))]); + if (VasEBoot_bfs_to_cpu_treehead (node->total_key_len) <= end) + end = VasEBoot_bfs_to_cpu_treehead (node->total_key_len); cmp = bfs_strcmp (key_data + start, name, end - start); if (cmp == 0 && level == 0) { - *res = grub_bfs_to_cpu64 (key_values[i | (1 << j)].val); - grub_free (node); - return GRUB_ERR_NONE; + *res = VasEBoot_bfs_to_cpu64 (key_values[i | (1 << j)].val); + VasEBoot_free (node); + return VasEBoot_ERR_NONE; } #ifdef MODE_AFS if (cmp <= 0) @@ -652,17 +652,17 @@ find_in_b_tree (grub_disk_t disk, } if (i == 0) { - grub_uint16_t end = 0; + VasEBoot_uint16_t end = 0; int cmp; - end = grub_bfs_to_cpu16 (keylen_idx[0]); - if (grub_bfs_to_cpu_treehead (node->total_key_len) <= end) - end = grub_bfs_to_cpu_treehead (node->total_key_len); + end = VasEBoot_bfs_to_cpu16 (keylen_idx[0]); + if (VasEBoot_bfs_to_cpu_treehead (node->total_key_len) <= end) + end = VasEBoot_bfs_to_cpu_treehead (node->total_key_len); cmp = bfs_strcmp (key_data, name, end); if (cmp == 0 && level == 0) { - *res = grub_bfs_to_cpu64 (key_values[0].val); - grub_free (node); - return GRUB_ERR_NONE; + *res = VasEBoot_bfs_to_cpu64 (key_values[0].val); + VasEBoot_free (node); + return VasEBoot_ERR_NONE; } #ifdef MODE_AFS if (cmp > 0 && level != 0) @@ -670,124 +670,124 @@ find_in_b_tree (grub_disk_t disk, if (cmp >= 0 && level != 0) #endif { - node_off = grub_bfs_to_cpu64 (key_values[0].val); + node_off = VasEBoot_bfs_to_cpu64 (key_values[0].val); level--; - grub_free (node); + VasEBoot_free (node); continue; } else if (level != 0 - && grub_bfs_to_cpu_treehead (node->count_keys) >= 2) + && VasEBoot_bfs_to_cpu_treehead (node->count_keys) >= 2) { - node_off = grub_bfs_to_cpu64 (key_values[1].val); + node_off = VasEBoot_bfs_to_cpu64 (key_values[1].val); level--; - grub_free (node); + VasEBoot_free (node); continue; } } else if (level != 0 - && i + 1 < grub_bfs_to_cpu_treehead (node->count_keys)) + && i + 1 < VasEBoot_bfs_to_cpu_treehead (node->count_keys)) { - node_off = grub_bfs_to_cpu64 (key_values[i + 1].val); + node_off = VasEBoot_bfs_to_cpu64 (key_values[i + 1].val); level--; - grub_free (node); + VasEBoot_free (node); continue; } if (node->overflow != POINTER_INVALID) { - node_off = grub_bfs_to_cpu64 (node->overflow); + node_off = VasEBoot_bfs_to_cpu64 (node->overflow); /* This level-- isn't specified but is needed. */ level--; - grub_free (node); + VasEBoot_free (node); continue; } - grub_free (node); - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), + VasEBoot_free (node); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); } } -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - grub_disk_t disk; - const struct grub_bfs_superblock *sb; - struct grub_bfs_inode ino; + VasEBoot_disk_t disk; + const struct VasEBoot_bfs_superblock *sb; + struct VasEBoot_bfs_inode ino; }; -static grub_err_t -lookup_file (grub_fshelp_node_t dir, +static VasEBoot_err_t +lookup_file (VasEBoot_fshelp_node_t dir, const char *name, - grub_fshelp_node_t *foundnode, - enum grub_fshelp_filetype *foundtype) + VasEBoot_fshelp_node_t *foundnode, + enum VasEBoot_fshelp_filetype *foundtype) { - grub_err_t err; - struct grub_bfs_inode *new_ino; - grub_uint64_t res = 0; + VasEBoot_err_t err; + struct VasEBoot_bfs_inode *new_ino; + VasEBoot_uint64_t res = 0; err = find_in_b_tree (dir->disk, dir->sb, &dir->ino, name, &res); if (err) return err; - *foundnode = grub_malloc (sizeof (struct grub_fshelp_node)); + *foundnode = VasEBoot_malloc (sizeof (struct VasEBoot_fshelp_node)); if (!*foundnode) - return grub_errno; + return VasEBoot_errno; (*foundnode)->disk = dir->disk; (*foundnode)->sb = dir->sb; new_ino = &(*foundnode)->ino; - if (grub_disk_read (dir->disk, res - << (grub_bfs_to_cpu32 (dir->sb->log2_bsize) - - GRUB_DISK_SECTOR_BITS), 0, + if (VasEBoot_disk_read (dir->disk, res + << (VasEBoot_bfs_to_cpu32 (dir->sb->log2_bsize) + - VasEBoot_DISK_SECTOR_BITS), 0, sizeof (*new_ino), (char *) new_ino)) { - grub_free (*foundnode); - return grub_errno; + VasEBoot_free (*foundnode); + return VasEBoot_errno; } - switch (grub_bfs_to_cpu32 (new_ino->mode) & ATTR_TYPE) + switch (VasEBoot_bfs_to_cpu32 (new_ino->mode) & ATTR_TYPE) { default: case ATTR_REG: - *foundtype = GRUB_FSHELP_REG; + *foundtype = VasEBoot_FSHELP_REG; break; case ATTR_DIR: - *foundtype = GRUB_FSHELP_DIR; + *foundtype = VasEBoot_FSHELP_DIR; break; case ATTR_LNK: - *foundtype = GRUB_FSHELP_SYMLINK; + *foundtype = VasEBoot_FSHELP_SYMLINK; break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static char * -read_symlink (grub_fshelp_node_t node) +read_symlink (VasEBoot_fshelp_node_t node) { char *alloc = NULL; - grub_err_t err; + VasEBoot_err_t err; #ifndef MODE_AFS - if (!(grub_bfs_to_cpu32 (node->ino.flags) & LONG_SYMLINK)) + if (!(VasEBoot_bfs_to_cpu32 (node->ino.flags) & LONG_SYMLINK)) { - alloc = grub_malloc (sizeof (node->ino.inplace_link) + 1); + alloc = VasEBoot_malloc (sizeof (node->ino.inplace_link) + 1); if (!alloc) { return NULL; } - grub_memcpy (alloc, node->ino.inplace_link, + VasEBoot_memcpy (alloc, node->ino.inplace_link, sizeof (node->ino.inplace_link)); alloc[sizeof (node->ino.inplace_link)] = 0; } else #endif { - grub_size_t symsize = grub_bfs_to_cpu64 (node->ino.size); - alloc = grub_malloc (symsize + 1); + VasEBoot_size_t symsize = VasEBoot_bfs_to_cpu64 (node->ino.size); + alloc = VasEBoot_malloc (symsize + 1); if (!alloc) return NULL; err = read_bfs_file (node->disk, node->sb, &node->ino, 0, alloc, symsize, 0, 0); if (err) { - grub_free (alloc); + VasEBoot_free (alloc); return NULL; } alloc[symsize] = 0; @@ -796,38 +796,38 @@ read_symlink (grub_fshelp_node_t node) return alloc; } -static grub_err_t -find_file (const char *path, grub_disk_t disk, - const struct grub_bfs_superblock *sb, struct grub_bfs_inode *ino, - enum grub_fshelp_filetype exptype) +static VasEBoot_err_t +find_file (const char *path, VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, struct VasEBoot_bfs_inode *ino, + enum VasEBoot_fshelp_filetype exptype) { - grub_err_t err; - struct grub_fshelp_node root = { + VasEBoot_err_t err; + struct VasEBoot_fshelp_node root = { .disk = disk, .sb = sb, }; - struct grub_fshelp_node *found; + struct VasEBoot_fshelp_node *found; err = read_extent (disk, sb, &sb->root_dir, 0, 0, &root.ino, sizeof (root.ino)); if (err) return err; - err = grub_fshelp_find_file_lookup (path, &root, &found, lookup_file, read_symlink, exptype); + err = VasEBoot_fshelp_find_file_lookup (path, &root, &found, lookup_file, read_symlink, exptype); if (!err) - grub_memcpy (ino, &found->ino, sizeof (*ino)); + VasEBoot_memcpy (ino, &found->ino, sizeof (*ino)); if (&root != found) - grub_free (found); + VasEBoot_free (found); return err; } -static grub_err_t -mount (grub_disk_t disk, struct grub_bfs_superblock *sb) +static VasEBoot_err_t +mount (VasEBoot_disk_t disk, struct VasEBoot_bfs_superblock *sb) { - grub_err_t err; - err = grub_disk_read (disk, SUPERBLOCK, 0, sizeof (*sb), sb); - if (err == GRUB_ERR_OUT_OF_RANGE) - return grub_error (GRUB_ERR_BAD_FS, + VasEBoot_err_t err; + err = VasEBoot_disk_read (disk, SUPERBLOCK, 0, sizeof (*sb), sb); + if (err == VasEBoot_ERR_OUT_OF_RANGE) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, #ifdef MODE_AFS "not an AFS filesystem" #else @@ -836,122 +836,122 @@ mount (grub_disk_t disk, struct grub_bfs_superblock *sb) ); if (err) return err; - if (sb->magic1 != grub_cpu_to_bfs32_compile_time (SUPER_BLOCK_MAGIC1) - || sb->magic2 != grub_cpu_to_bfs32_compile_time (SUPER_BLOCK_MAGIC2) - || sb->magic3 != grub_cpu_to_bfs32_compile_time (SUPER_BLOCK_MAGIC3) + if (sb->magic1 != VasEBoot_cpu_to_bfs32_compile_time (SUPER_BLOCK_MAGIC1) + || sb->magic2 != VasEBoot_cpu_to_bfs32_compile_time (SUPER_BLOCK_MAGIC2) + || sb->magic3 != VasEBoot_cpu_to_bfs32_compile_time (SUPER_BLOCK_MAGIC3) || sb->bsize == 0 - || (grub_bfs_to_cpu32 (sb->bsize) - != (1U << grub_bfs_to_cpu32 (sb->log2_bsize))) - || grub_bfs_to_cpu32 (sb->log2_bsize) < GRUB_DISK_SECTOR_BITS) - return grub_error (GRUB_ERR_BAD_FS, + || (VasEBoot_bfs_to_cpu32 (sb->bsize) + != (1U << VasEBoot_bfs_to_cpu32 (sb->log2_bsize))) + || VasEBoot_bfs_to_cpu32 (sb->log2_bsize) < VasEBoot_DISK_SECTOR_BITS) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, #ifdef MODE_AFS "not an AFS filesystem" #else "not a BFS filesystem" #endif ); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Helper for grub_bfs_dir. */ +/* Helper for VasEBoot_bfs_dir. */ static int -grub_bfs_dir_iter (const char *name, grub_uint64_t value, - struct grub_bfs_dir_ctx *ctx) +VasEBoot_bfs_dir_iter (const char *name, VasEBoot_uint64_t value, + struct VasEBoot_bfs_dir_ctx *ctx) { - grub_err_t err2; - struct grub_bfs_inode ino; - struct grub_dirhook_info info; + VasEBoot_err_t err2; + struct VasEBoot_bfs_inode ino; + struct VasEBoot_dirhook_info info; - err2 = grub_disk_read (ctx->device->disk, value - << (grub_bfs_to_cpu32 (ctx->sb.log2_bsize) - - GRUB_DISK_SECTOR_BITS), 0, + err2 = VasEBoot_disk_read (ctx->device->disk, value + << (VasEBoot_bfs_to_cpu32 (ctx->sb.log2_bsize) + - VasEBoot_DISK_SECTOR_BITS), 0, sizeof (ino), (char *) &ino); if (err2) { - grub_print_error (); + VasEBoot_print_error (); return 0; } info.mtimeset = 1; #ifdef MODE_AFS info.mtime = - grub_divmod64 (grub_bfs_to_cpu64 (ino.mtime), 1000000, 0); + VasEBoot_divmod64 (VasEBoot_bfs_to_cpu64 (ino.mtime), 1000000, 0); #else - info.mtime = grub_bfs_to_cpu64 (ino.mtime) >> 16; + info.mtime = VasEBoot_bfs_to_cpu64 (ino.mtime) >> 16; #endif - info.dir = ((grub_bfs_to_cpu32 (ino.mode) & ATTR_TYPE) == ATTR_DIR); + info.dir = ((VasEBoot_bfs_to_cpu32 (ino.mode) & ATTR_TYPE) == ATTR_DIR); return ctx->hook (name, &info, ctx->hook_data); } -static grub_err_t -grub_bfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_bfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_bfs_dir_ctx ctx = { + struct VasEBoot_bfs_dir_ctx ctx = { .device = device, .hook = hook, .hook_data = hook_data }; - grub_err_t err; + VasEBoot_err_t err; err = mount (device->disk, &ctx.sb); if (err) return err; { - struct grub_bfs_inode ino; - err = find_file (path, device->disk, &ctx.sb, &ino, GRUB_FSHELP_DIR); + struct VasEBoot_bfs_inode ino; + err = find_file (path, device->disk, &ctx.sb, &ino, VasEBoot_FSHELP_DIR); if (err) return err; - iterate_in_b_tree (device->disk, &ctx.sb, &ino, grub_bfs_dir_iter, + iterate_in_b_tree (device->disk, &ctx.sb, &ino, VasEBoot_bfs_dir_iter, &ctx); } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_bfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_bfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_bfs_superblock sb; - grub_err_t err; + struct VasEBoot_bfs_superblock sb; + VasEBoot_err_t err; err = mount (file->device->disk, &sb); if (err) return err; { - struct grub_bfs_inode ino; - struct grub_bfs_data *data; - err = find_file (name, file->device->disk, &sb, &ino, GRUB_FSHELP_REG); + struct VasEBoot_bfs_inode ino; + struct VasEBoot_bfs_data *data; + err = find_file (name, file->device->disk, &sb, &ino, VasEBoot_FSHELP_REG); if (err) return err; - data = grub_zalloc (sizeof (struct grub_bfs_data)); + data = VasEBoot_zalloc (sizeof (struct VasEBoot_bfs_data)); if (!data) - return grub_errno; + return VasEBoot_errno; data->sb = sb; - grub_memcpy (&data->ino, &ino, sizeof (data->ino)); + VasEBoot_memcpy (&data->ino, &ino, sizeof (data->ino)); file->data = data; - file->size = grub_bfs_to_cpu64 (ino.size); + file->size = VasEBoot_bfs_to_cpu64 (ino.size); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_bfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_bfs_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -grub_bfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_bfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - grub_err_t err; - struct grub_bfs_data *data = file->data; + VasEBoot_err_t err; + struct VasEBoot_bfs_data *data = file->data; err = read_bfs_file (file->device->disk, &data->sb, &data->ino, file->offset, buf, len, @@ -961,11 +961,11 @@ grub_bfs_read (grub_file_t file, char *buf, grub_size_t len) return len; } -static grub_err_t -grub_bfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_bfs_label (VasEBoot_device_t device, char **label) { - struct grub_bfs_superblock sb; - grub_err_t err; + struct VasEBoot_bfs_superblock sb; + VasEBoot_err_t err; *label = 0; @@ -973,62 +973,62 @@ grub_bfs_label (grub_device_t device, char **label) if (err) return err; - *label = grub_strndup (sb.label, sizeof (sb.label)); - return GRUB_ERR_NONE; + *label = VasEBoot_strndup (sb.label, sizeof (sb.label)); + return VasEBoot_ERR_NONE; } #ifndef MODE_AFS -static grub_ssize_t -read_bfs_attr (grub_disk_t disk, - const struct grub_bfs_superblock *sb, - struct grub_bfs_inode *ino, - const char *name, void *buf, grub_size_t len) +static VasEBoot_ssize_t +read_bfs_attr (VasEBoot_disk_t disk, + const struct VasEBoot_bfs_superblock *sb, + struct VasEBoot_bfs_inode *ino, + const char *name, void *buf, VasEBoot_size_t len) { - grub_uint8_t *ptr = (grub_uint8_t *) ino->small_data; - grub_uint8_t *end = ((grub_uint8_t *) ino + grub_bfs_to_cpu32 (sb->bsize)); + VasEBoot_uint8_t *ptr = (VasEBoot_uint8_t *) ino->small_data; + VasEBoot_uint8_t *end = ((VasEBoot_uint8_t *) ino + VasEBoot_bfs_to_cpu32 (sb->bsize)); - while (ptr + sizeof (struct grub_bfs_small_data_element_header) < end) + while (ptr + sizeof (struct VasEBoot_bfs_small_data_element_header) < end) { - struct grub_bfs_small_data_element_header *el; + struct VasEBoot_bfs_small_data_element_header *el; char *el_name; - grub_uint8_t *data; - el = (struct grub_bfs_small_data_element_header *) ptr; + VasEBoot_uint8_t *data; + el = (struct VasEBoot_bfs_small_data_element_header *) ptr; if (el->name_len == 0) break; el_name = (char *) (el + 1); - data = (grub_uint8_t *) el_name + grub_bfs_to_cpu16 (el->name_len) + 3; - ptr = data + grub_bfs_to_cpu16 (el->value_len) + 1; - if (grub_memcmp (name, el_name, grub_bfs_to_cpu16 (el->name_len)) == 0 + data = (VasEBoot_uint8_t *) el_name + VasEBoot_bfs_to_cpu16 (el->name_len) + 3; + ptr = data + VasEBoot_bfs_to_cpu16 (el->value_len) + 1; + if (VasEBoot_memcmp (name, el_name, VasEBoot_bfs_to_cpu16 (el->name_len)) == 0 && name[el->name_len] == 0) { - grub_size_t copy; + VasEBoot_size_t copy; copy = len; - if (grub_bfs_to_cpu16 (el->value_len) > copy) - copy = grub_bfs_to_cpu16 (el->value_len); - grub_memcpy (buf, data, copy); + if (VasEBoot_bfs_to_cpu16 (el->value_len) > copy) + copy = VasEBoot_bfs_to_cpu16 (el->value_len); + VasEBoot_memcpy (buf, data, copy); return copy; } } if (ino->attr.len != 0) { - grub_size_t read; - grub_err_t err; - grub_uint64_t res; + VasEBoot_size_t read; + VasEBoot_err_t err; + VasEBoot_uint64_t res; err = read_extent (disk, sb, &ino->attr, 0, 0, ino, - grub_bfs_to_cpu32 (sb->bsize)); + VasEBoot_bfs_to_cpu32 (sb->bsize)); if (err) return -1; err = find_in_b_tree (disk, sb, ino, name, &res); if (err) return -1; - grub_disk_read (disk, res - << (grub_bfs_to_cpu32 (sb->log2_bsize) - - GRUB_DISK_SECTOR_BITS), 0, - grub_bfs_to_cpu32 (sb->bsize), (char *) ino); - read = grub_bfs_to_cpu64 (ino->size); + VasEBoot_disk_read (disk, res + << (VasEBoot_bfs_to_cpu32 (sb->log2_bsize) + - VasEBoot_DISK_SECTOR_BITS), 0, + VasEBoot_bfs_to_cpu32 (sb->bsize), (char *) ino); + read = VasEBoot_bfs_to_cpu64 (ino->size); if (read > len) read = len; @@ -1040,13 +1040,13 @@ read_bfs_attr (grub_disk_t disk, return -1; } -static grub_err_t -grub_bfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_bfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_bfs_superblock sb; - grub_err_t err; - struct grub_bfs_inode *ino; - grub_uint64_t vid; + struct VasEBoot_bfs_superblock sb; + VasEBoot_err_t err; + struct VasEBoot_bfs_inode *ino; + VasEBoot_uint64_t vid; *uuid = 0; @@ -1054,64 +1054,64 @@ grub_bfs_uuid (grub_device_t device, char **uuid) if (err) return err; - ino = grub_malloc (grub_bfs_to_cpu32 (sb.bsize)); + ino = VasEBoot_malloc (VasEBoot_bfs_to_cpu32 (sb.bsize)); if (!ino) - return grub_errno; + return VasEBoot_errno; err = read_extent (device->disk, &sb, &sb.root_dir, 0, 0, - ino, grub_bfs_to_cpu32 (sb.bsize)); + ino, VasEBoot_bfs_to_cpu32 (sb.bsize)); if (err) { - grub_free (ino); + VasEBoot_free (ino); return err; } if (read_bfs_attr (device->disk, &sb, ino, "be:volume_id", &vid, sizeof (vid)) == sizeof (vid)) *uuid = - grub_xasprintf ("%016" PRIxGRUB_UINT64_T, grub_bfs_to_cpu64 (vid)); + VasEBoot_xasprintf ("%016" PRIxVasEBoot_UINT64_T, VasEBoot_bfs_to_cpu64 (vid)); - grub_free (ino); + VasEBoot_free (ino); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static struct grub_fs grub_bfs_fs = { +static struct VasEBoot_fs VasEBoot_bfs_fs = { #ifdef MODE_AFS .name = "afs", #else .name = "bfs", #endif - .dir = grub_bfs_dir, - .open = grub_bfs_open, - .read = grub_bfs_read, - .close = grub_bfs_close, - .label = grub_bfs_label, + .dir = VasEBoot_bfs_dir, + .open = VasEBoot_bfs_open, + .read = VasEBoot_bfs_read, + .close = VasEBoot_bfs_close, + .label = VasEBoot_bfs_label, #ifndef MODE_AFS - .uuid = grub_bfs_uuid, + .uuid = VasEBoot_bfs_uuid, #endif -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif }; #ifdef MODE_AFS -GRUB_MOD_INIT (afs) +VasEBoot_MOD_INIT (afs) #else -GRUB_MOD_INIT (bfs) +VasEBoot_MOD_INIT (bfs) #endif { COMPILE_TIME_ASSERT (1 << LOG_EXTENT_SIZE == - sizeof (struct grub_bfs_extent)); - grub_fs_register (&grub_bfs_fs); + sizeof (struct VasEBoot_bfs_extent)); + VasEBoot_fs_register (&VasEBoot_bfs_fs); } #ifdef MODE_AFS -GRUB_MOD_FINI (afs) +VasEBoot_MOD_FINI (afs) #else -GRUB_MOD_FINI (bfs) +VasEBoot_MOD_FINI (bfs) #endif { - grub_fs_unregister (&grub_bfs_fs); + VasEBoot_fs_unregister (&VasEBoot_bfs_fs); } diff --git a/VasEBoot-core/fs/btrfs.c b/VasEBoot-core/fs/btrfs.c index be195448d..5fff22447 100644 --- a/VasEBoot-core/fs/btrfs.c +++ b/VasEBoot-core/fs/btrfs.c @@ -1,38 +1,38 @@ /* btrfs.c - B-tree file system. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_BTRFS_SIGNATURE "_BHRfS_M" +#define VasEBoot_BTRFS_SIGNATURE "_BHRfS_M" /* From http://www.oberhumer.com/opensource/lzo/lzofaq.php * LZO will expand incompressible data by a little amount. I still haven't @@ -41,229 +41,229 @@ GRUB_MOD_LICENSE ("GPLv3+"); * * output_block_size = input_block_size + (input_block_size / 16) + 64 + 3 * */ -#define GRUB_BTRFS_LZO_BLOCK_SIZE 4096 -#define GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE (GRUB_BTRFS_LZO_BLOCK_SIZE + \ - (GRUB_BTRFS_LZO_BLOCK_SIZE / 16) + 64 + 3) +#define VasEBoot_BTRFS_LZO_BLOCK_SIZE 4096 +#define VasEBoot_BTRFS_LZO_BLOCK_MAX_CSIZE (VasEBoot_BTRFS_LZO_BLOCK_SIZE + \ + (VasEBoot_BTRFS_LZO_BLOCK_SIZE / 16) + 64 + 3) -typedef grub_uint8_t grub_btrfs_checksum_t[0x20]; -typedef grub_uint16_t grub_btrfs_uuid_t[8]; +typedef VasEBoot_uint8_t VasEBoot_btrfs_checksum_t[0x20]; +typedef VasEBoot_uint16_t VasEBoot_btrfs_uuid_t[8]; -struct grub_btrfs_device +struct VasEBoot_btrfs_device { - grub_uint64_t device_id; - grub_uint64_t size; - grub_uint8_t dummy[0x62 - 0x10]; -} GRUB_PACKED; + VasEBoot_uint64_t device_id; + VasEBoot_uint64_t size; + VasEBoot_uint8_t dummy[0x62 - 0x10]; +} VasEBoot_PACKED; -struct grub_btrfs_superblock +struct VasEBoot_btrfs_superblock { - grub_btrfs_checksum_t checksum; - grub_btrfs_uuid_t uuid; - grub_uint8_t dummy[0x10]; - grub_uint8_t signature[sizeof (GRUB_BTRFS_SIGNATURE) - 1]; - grub_uint64_t generation; - grub_uint64_t root_tree; - grub_uint64_t chunk_tree; - grub_uint8_t dummy2[0x20]; - grub_uint64_t root_dir_objectid; - grub_uint8_t dummy3[0x41]; - struct grub_btrfs_device this_device; + VasEBoot_btrfs_checksum_t checksum; + VasEBoot_btrfs_uuid_t uuid; + VasEBoot_uint8_t dummy[0x10]; + VasEBoot_uint8_t signature[sizeof (VasEBoot_BTRFS_SIGNATURE) - 1]; + VasEBoot_uint64_t generation; + VasEBoot_uint64_t root_tree; + VasEBoot_uint64_t chunk_tree; + VasEBoot_uint8_t dummy2[0x20]; + VasEBoot_uint64_t root_dir_objectid; + VasEBoot_uint8_t dummy3[0x41]; + struct VasEBoot_btrfs_device this_device; char label[0x100]; - grub_uint8_t dummy4[0x100]; - grub_uint8_t bootstrap_mapping[0x800]; -} GRUB_PACKED; + VasEBoot_uint8_t dummy4[0x100]; + VasEBoot_uint8_t bootstrap_mapping[0x800]; +} VasEBoot_PACKED; struct btrfs_header { - grub_btrfs_checksum_t checksum; - grub_btrfs_uuid_t uuid; - grub_uint8_t dummy[0x30]; - grub_uint32_t nitems; - grub_uint8_t level; -} GRUB_PACKED; + VasEBoot_btrfs_checksum_t checksum; + VasEBoot_btrfs_uuid_t uuid; + VasEBoot_uint8_t dummy[0x30]; + VasEBoot_uint32_t nitems; + VasEBoot_uint8_t level; +} VasEBoot_PACKED; -struct grub_btrfs_device_desc +struct VasEBoot_btrfs_device_desc { - grub_device_t dev; - grub_uint64_t id; + VasEBoot_device_t dev; + VasEBoot_uint64_t id; }; -struct grub_btrfs_data +struct VasEBoot_btrfs_data { - struct grub_btrfs_superblock sblock; - grub_uint64_t tree; - grub_uint64_t inode; + struct VasEBoot_btrfs_superblock sblock; + VasEBoot_uint64_t tree; + VasEBoot_uint64_t inode; - struct grub_btrfs_device_desc *devices_attached; + struct VasEBoot_btrfs_device_desc *devices_attached; unsigned n_devices_attached; unsigned n_devices_allocated; /* Cached extent data. */ - grub_uint64_t extstart; - grub_uint64_t extend; - grub_uint64_t extino; - grub_uint64_t exttree; - grub_size_t extsize; - struct grub_btrfs_extent_data *extent; + VasEBoot_uint64_t extstart; + VasEBoot_uint64_t extend; + VasEBoot_uint64_t extino; + VasEBoot_uint64_t exttree; + VasEBoot_size_t extsize; + struct VasEBoot_btrfs_extent_data *extent; }; -struct grub_btrfs_chunk_item +struct VasEBoot_btrfs_chunk_item { - grub_uint64_t size; - grub_uint64_t dummy; - grub_uint64_t stripe_length; - grub_uint64_t type; -#define GRUB_BTRFS_CHUNK_TYPE_BITS_DONTCARE 0x07 -#define GRUB_BTRFS_CHUNK_TYPE_SINGLE 0x00 -#define GRUB_BTRFS_CHUNK_TYPE_RAID0 0x08 -#define GRUB_BTRFS_CHUNK_TYPE_RAID1 0x10 -#define GRUB_BTRFS_CHUNK_TYPE_DUPLICATED 0x20 -#define GRUB_BTRFS_CHUNK_TYPE_RAID10 0x40 - grub_uint8_t dummy2[0xc]; - grub_uint16_t nstripes; - grub_uint16_t nsubstripes; -} GRUB_PACKED; + VasEBoot_uint64_t size; + VasEBoot_uint64_t dummy; + VasEBoot_uint64_t stripe_length; + VasEBoot_uint64_t type; +#define VasEBoot_BTRFS_CHUNK_TYPE_BITS_DONTCARE 0x07 +#define VasEBoot_BTRFS_CHUNK_TYPE_SINGLE 0x00 +#define VasEBoot_BTRFS_CHUNK_TYPE_RAID0 0x08 +#define VasEBoot_BTRFS_CHUNK_TYPE_RAID1 0x10 +#define VasEBoot_BTRFS_CHUNK_TYPE_DUPLICATED 0x20 +#define VasEBoot_BTRFS_CHUNK_TYPE_RAID10 0x40 + VasEBoot_uint8_t dummy2[0xc]; + VasEBoot_uint16_t nstripes; + VasEBoot_uint16_t nsubstripes; +} VasEBoot_PACKED; -struct grub_btrfs_chunk_stripe +struct VasEBoot_btrfs_chunk_stripe { - grub_uint64_t device_id; - grub_uint64_t offset; - grub_btrfs_uuid_t device_uuid; -} GRUB_PACKED; + VasEBoot_uint64_t device_id; + VasEBoot_uint64_t offset; + VasEBoot_btrfs_uuid_t device_uuid; +} VasEBoot_PACKED; -struct grub_btrfs_leaf_node +struct VasEBoot_btrfs_leaf_node { - struct grub_btrfs_key key; - grub_uint32_t offset; - grub_uint32_t size; -} GRUB_PACKED; + struct VasEBoot_btrfs_key key; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t size; +} VasEBoot_PACKED; -struct grub_btrfs_internal_node +struct VasEBoot_btrfs_internal_node { - struct grub_btrfs_key key; - grub_uint64_t addr; - grub_uint64_t dummy; -} GRUB_PACKED; + struct VasEBoot_btrfs_key key; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t dummy; +} VasEBoot_PACKED; -struct grub_btrfs_dir_item +struct VasEBoot_btrfs_dir_item { - struct grub_btrfs_key key; - grub_uint8_t dummy[8]; - grub_uint16_t m; - grub_uint16_t n; -#define GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR 1 -#define GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY 2 -#define GRUB_BTRFS_DIR_ITEM_TYPE_SYMLINK 7 - grub_uint8_t type; + struct VasEBoot_btrfs_key key; + VasEBoot_uint8_t dummy[8]; + VasEBoot_uint16_t m; + VasEBoot_uint16_t n; +#define VasEBoot_BTRFS_DIR_ITEM_TYPE_REGULAR 1 +#define VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY 2 +#define VasEBoot_BTRFS_DIR_ITEM_TYPE_SYMLINK 7 + VasEBoot_uint8_t type; char name[0]; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_btrfs_leaf_descriptor +struct VasEBoot_btrfs_leaf_descriptor { unsigned depth; unsigned allocated; struct { - grub_disk_addr_t addr; + VasEBoot_disk_addr_t addr; unsigned iter; unsigned maxiter; int leaf; } *data; }; -struct grub_btrfs_time +struct VasEBoot_btrfs_time { - grub_int64_t sec; - grub_uint32_t nanosec; -} GRUB_PACKED; + VasEBoot_int64_t sec; + VasEBoot_uint32_t nanosec; +} VasEBoot_PACKED; -struct grub_btrfs_inode +struct VasEBoot_btrfs_inode { - grub_uint8_t dummy1[0x10]; - grub_uint64_t size; - grub_uint8_t dummy2[0x70]; - struct grub_btrfs_time mtime; -} GRUB_PACKED; + VasEBoot_uint8_t dummy1[0x10]; + VasEBoot_uint64_t size; + VasEBoot_uint8_t dummy2[0x70]; + struct VasEBoot_btrfs_time mtime; +} VasEBoot_PACKED; -struct grub_btrfs_extent_data +struct VasEBoot_btrfs_extent_data { - grub_uint64_t dummy; - grub_uint64_t size; - grub_uint8_t compression; - grub_uint8_t encryption; - grub_uint16_t encoding; - grub_uint8_t type; + VasEBoot_uint64_t dummy; + VasEBoot_uint64_t size; + VasEBoot_uint8_t compression; + VasEBoot_uint8_t encryption; + VasEBoot_uint16_t encoding; + VasEBoot_uint8_t type; union { char inl[0]; struct { - grub_uint64_t laddr; - grub_uint64_t compressed_size; - grub_uint64_t offset; - grub_uint64_t filled; + VasEBoot_uint64_t laddr; + VasEBoot_uint64_t compressed_size; + VasEBoot_uint64_t offset; + VasEBoot_uint64_t filled; }; }; -} GRUB_PACKED; +} VasEBoot_PACKED; -#define GRUB_BTRFS_EXTENT_INLINE 0 -#define GRUB_BTRFS_EXTENT_REGULAR 1 +#define VasEBoot_BTRFS_EXTENT_INLINE 0 +#define VasEBoot_BTRFS_EXTENT_REGULAR 1 -#define GRUB_BTRFS_COMPRESSION_NONE 0 -#define GRUB_BTRFS_COMPRESSION_ZLIB 1 -#define GRUB_BTRFS_COMPRESSION_LZO 2 +#define VasEBoot_BTRFS_COMPRESSION_NONE 0 +#define VasEBoot_BTRFS_COMPRESSION_ZLIB 1 +#define VasEBoot_BTRFS_COMPRESSION_LZO 2 -#define GRUB_BTRFS_OBJECT_ID_CHUNK 0x100 +#define VasEBoot_BTRFS_OBJECT_ID_CHUNK 0x100 -static grub_disk_addr_t superblock_sectors[] = { 64 * 2, 64 * 1024 * 2, +static VasEBoot_disk_addr_t superblock_sectors[] = { 64 * 2, 64 * 1024 * 2, 256 * 1048576 * 2, 1048576ULL * 1048576ULL * 2 }; -static grub_err_t -grub_btrfs_read_logical (struct grub_btrfs_data *data, - grub_disk_addr_t addr, void *buf, grub_size_t size, +static VasEBoot_err_t +VasEBoot_btrfs_read_logical (struct VasEBoot_btrfs_data *data, + VasEBoot_disk_addr_t addr, void *buf, VasEBoot_size_t size, int recursion_depth); -static grub_err_t -read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb) +static VasEBoot_err_t +read_sblock (VasEBoot_disk_t disk, struct VasEBoot_btrfs_superblock *sb) { - struct grub_btrfs_superblock sblock; + struct VasEBoot_btrfs_superblock sblock; unsigned i; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; for (i = 0; i < ARRAY_SIZE (superblock_sectors); i++) { /* Don't try additional superblocks beyond device size. */ - if (i && (grub_le_to_cpu64 (sblock.this_device.size) - >> GRUB_DISK_SECTOR_BITS) <= superblock_sectors[i]) + if (i && (VasEBoot_le_to_cpu64 (sblock.this_device.size) + >> VasEBoot_DISK_SECTOR_BITS) <= superblock_sectors[i]) break; - err = grub_disk_read (disk, superblock_sectors[i], 0, + err = VasEBoot_disk_read (disk, superblock_sectors[i], 0, sizeof (sblock), &sblock); - if (err == GRUB_ERR_OUT_OF_RANGE) + if (err == VasEBoot_ERR_OUT_OF_RANGE) break; - if (grub_memcmp ((char *) sblock.signature, GRUB_BTRFS_SIGNATURE, - sizeof (GRUB_BTRFS_SIGNATURE) - 1) != 0) + if (VasEBoot_memcmp ((char *) sblock.signature, VasEBoot_BTRFS_SIGNATURE, + sizeof (VasEBoot_BTRFS_SIGNATURE) - 1) != 0) break; - if (i == 0 || grub_le_to_cpu64 (sblock.generation) - > grub_le_to_cpu64 (sb->generation)) - grub_memcpy (sb, &sblock, sizeof (sblock)); + if (i == 0 || VasEBoot_le_to_cpu64 (sblock.generation) + > VasEBoot_le_to_cpu64 (sb->generation)) + VasEBoot_memcpy (sb, &sblock, sizeof (sblock)); } - if ((err == GRUB_ERR_OUT_OF_RANGE || !err) && i == 0) - return grub_error (GRUB_ERR_BAD_FS, "not a Btrfs filesystem"); + if ((err == VasEBoot_ERR_OUT_OF_RANGE || !err) && i == 0) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a Btrfs filesystem"); - if (err == GRUB_ERR_OUT_OF_RANGE) - grub_errno = err = GRUB_ERR_NONE; + if (err == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_errno = err = VasEBoot_ERR_NONE; return err; } static int -key_cmp (const struct grub_btrfs_key *a, const struct grub_btrfs_key *b) +key_cmp (const struct VasEBoot_btrfs_key *a, const struct VasEBoot_btrfs_key *b) { - if (grub_le_to_cpu64 (a->object_id) < grub_le_to_cpu64 (b->object_id)) + if (VasEBoot_le_to_cpu64 (a->object_id) < VasEBoot_le_to_cpu64 (b->object_id)) return -1; - if (grub_le_to_cpu64 (a->object_id) > grub_le_to_cpu64 (b->object_id)) + if (VasEBoot_le_to_cpu64 (a->object_id) > VasEBoot_le_to_cpu64 (b->object_id)) return +1; if (a->type < b->type) @@ -271,49 +271,49 @@ key_cmp (const struct grub_btrfs_key *a, const struct grub_btrfs_key *b) if (a->type > b->type) return +1; - if (grub_le_to_cpu64 (a->offset) < grub_le_to_cpu64 (b->offset)) + if (VasEBoot_le_to_cpu64 (a->offset) < VasEBoot_le_to_cpu64 (b->offset)) return -1; - if (grub_le_to_cpu64 (a->offset) > grub_le_to_cpu64 (b->offset)) + if (VasEBoot_le_to_cpu64 (a->offset) > VasEBoot_le_to_cpu64 (b->offset)) return +1; return 0; } static void -free_iterator (struct grub_btrfs_leaf_descriptor *desc) +free_iterator (struct VasEBoot_btrfs_leaf_descriptor *desc) { - grub_free (desc->data); + VasEBoot_free (desc->data); } -static grub_err_t -save_ref (struct grub_btrfs_leaf_descriptor *desc, - grub_disk_addr_t addr, unsigned i, unsigned m, int l) +static VasEBoot_err_t +save_ref (struct VasEBoot_btrfs_leaf_descriptor *desc, + VasEBoot_disk_addr_t addr, unsigned i, unsigned m, int l) { desc->depth++; if (desc->allocated < desc->depth) { void *newdata; desc->allocated *= 2; - newdata = grub_realloc (desc->data, sizeof (desc->data[0]) + newdata = VasEBoot_realloc (desc->data, sizeof (desc->data[0]) * desc->allocated); if (!newdata) - return grub_errno; + return VasEBoot_errno; desc->data = newdata; } desc->data[desc->depth - 1].addr = addr; desc->data[desc->depth - 1].iter = i; desc->data[desc->depth - 1].maxiter = m; desc->data[desc->depth - 1].leaf = l; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -next (struct grub_btrfs_data *data, - struct grub_btrfs_leaf_descriptor *desc, - grub_disk_addr_t * outaddr, grub_size_t * outsize, - struct grub_btrfs_key *key_out) +next (struct VasEBoot_btrfs_data *data, + struct VasEBoot_btrfs_leaf_descriptor *desc, + VasEBoot_disk_addr_t * outaddr, VasEBoot_size_t * outsize, + struct VasEBoot_btrfs_key *key_out) { - grub_err_t err; - struct grub_btrfs_leaf_node leaf; + VasEBoot_err_t err; + struct VasEBoot_btrfs_leaf_node leaf; for (; desc->depth > 0; desc->depth--) { @@ -326,10 +326,10 @@ next (struct grub_btrfs_data *data, return 0; while (!desc->data[desc->depth - 1].leaf) { - struct grub_btrfs_internal_node node; + struct VasEBoot_btrfs_internal_node node; struct btrfs_header head; - err = grub_btrfs_read_logical (data, desc->data[desc->depth - 1].iter + err = VasEBoot_btrfs_read_logical (data, desc->data[desc->depth - 1].iter * sizeof (node) + sizeof (struct btrfs_header) + desc->data[desc->depth - 1].addr, @@ -337,68 +337,68 @@ next (struct grub_btrfs_data *data, if (err) return -err; - err = grub_btrfs_read_logical (data, grub_le_to_cpu64 (node.addr), + err = VasEBoot_btrfs_read_logical (data, VasEBoot_le_to_cpu64 (node.addr), &head, sizeof (head), 0); if (err) return -err; - save_ref (desc, grub_le_to_cpu64 (node.addr), 0, - grub_le_to_cpu32 (head.nitems), !head.level); + save_ref (desc, VasEBoot_le_to_cpu64 (node.addr), 0, + VasEBoot_le_to_cpu32 (head.nitems), !head.level); } - err = grub_btrfs_read_logical (data, desc->data[desc->depth - 1].iter + err = VasEBoot_btrfs_read_logical (data, desc->data[desc->depth - 1].iter * sizeof (leaf) + sizeof (struct btrfs_header) + desc->data[desc->depth - 1].addr, &leaf, sizeof (leaf), 0); if (err) return -err; - *outsize = grub_le_to_cpu32 (leaf.size); + *outsize = VasEBoot_le_to_cpu32 (leaf.size); *outaddr = desc->data[desc->depth - 1].addr + sizeof (struct btrfs_header) - + grub_le_to_cpu32 (leaf.offset); + + VasEBoot_le_to_cpu32 (leaf.offset); *key_out = leaf.key; return 1; } -static grub_err_t -lower_bound (struct grub_btrfs_data *data, - const struct grub_btrfs_key *key_in, - struct grub_btrfs_key *key_out, - grub_uint64_t root, - grub_disk_addr_t *outaddr, grub_size_t *outsize, - struct grub_btrfs_leaf_descriptor *desc, +static VasEBoot_err_t +lower_bound (struct VasEBoot_btrfs_data *data, + const struct VasEBoot_btrfs_key *key_in, + struct VasEBoot_btrfs_key *key_out, + VasEBoot_uint64_t root, + VasEBoot_disk_addr_t *outaddr, VasEBoot_size_t *outsize, + struct VasEBoot_btrfs_leaf_descriptor *desc, int recursion_depth) { - grub_disk_addr_t addr = grub_le_to_cpu64 (root); + VasEBoot_disk_addr_t addr = VasEBoot_le_to_cpu64 (root); int depth = -1; if (desc) { desc->allocated = 16; desc->depth = 0; - desc->data = grub_malloc (sizeof (desc->data[0]) * desc->allocated); + desc->data = VasEBoot_malloc (sizeof (desc->data[0]) * desc->allocated); if (!desc->data) - return grub_errno; + return VasEBoot_errno; } /* > 2 would work as well but be robust and allow a bit more just in case. */ if (recursion_depth > 10) - return grub_error (GRUB_ERR_BAD_FS, "too deep btrfs virtual nesting"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "too deep btrfs virtual nesting"); - grub_dprintf ("btrfs", - "retrieving %" PRIxGRUB_UINT64_T - " %x %" PRIxGRUB_UINT64_T "\n", + VasEBoot_dprintf ("btrfs", + "retrieving %" PRIxVasEBoot_UINT64_T + " %x %" PRIxVasEBoot_UINT64_T "\n", key_in->object_id, key_in->type, key_in->offset); while (1) { - grub_err_t err; + VasEBoot_err_t err; struct btrfs_header head; reiter: depth++; /* FIXME: preread few nodes into buffer. */ - err = grub_btrfs_read_logical (data, addr, &head, sizeof (head), + err = VasEBoot_btrfs_read_logical (data, addr, &head, sizeof (head), recursion_depth + 1); if (err) return err; @@ -406,32 +406,32 @@ lower_bound (struct grub_btrfs_data *data, if (head.level) { unsigned i; - struct grub_btrfs_internal_node node, node_last; + struct VasEBoot_btrfs_internal_node node, node_last; int have_last = 0; - grub_memset (&node_last, 0, sizeof (node_last)); - for (i = 0; i < grub_le_to_cpu32 (head.nitems); i++) + VasEBoot_memset (&node_last, 0, sizeof (node_last)); + for (i = 0; i < VasEBoot_le_to_cpu32 (head.nitems); i++) { - err = grub_btrfs_read_logical (data, addr + i * sizeof (node), + err = VasEBoot_btrfs_read_logical (data, addr + i * sizeof (node), &node, sizeof (node), recursion_depth + 1); if (err) return err; - grub_dprintf ("btrfs", - "internal node (depth %d) %" PRIxGRUB_UINT64_T - " %x %" PRIxGRUB_UINT64_T "\n", depth, + VasEBoot_dprintf ("btrfs", + "internal node (depth %d) %" PRIxVasEBoot_UINT64_T + " %x %" PRIxVasEBoot_UINT64_T "\n", depth, node.key.object_id, node.key.type, node.key.offset); if (key_cmp (&node.key, key_in) == 0) { - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; if (desc) err = save_ref (desc, addr - sizeof (head), i, - grub_le_to_cpu32 (head.nitems), 0); + VasEBoot_le_to_cpu32 (head.nitems), 0); if (err) return err; - addr = grub_le_to_cpu64 (node.addr); + addr = VasEBoot_le_to_cpu64 (node.addr); goto reiter; } if (key_cmp (&node.key, key_in) > 0) @@ -441,49 +441,49 @@ lower_bound (struct grub_btrfs_data *data, } if (have_last) { - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; if (desc) err = save_ref (desc, addr - sizeof (head), i - 1, - grub_le_to_cpu32 (head.nitems), 0); + VasEBoot_le_to_cpu32 (head.nitems), 0); if (err) return err; - addr = grub_le_to_cpu64 (node_last.addr); + addr = VasEBoot_le_to_cpu64 (node_last.addr); goto reiter; } *outsize = 0; *outaddr = 0; - grub_memset (key_out, 0, sizeof (*key_out)); + VasEBoot_memset (key_out, 0, sizeof (*key_out)); if (desc) return save_ref (desc, addr - sizeof (head), -1, - grub_le_to_cpu32 (head.nitems), 0); - return GRUB_ERR_NONE; + VasEBoot_le_to_cpu32 (head.nitems), 0); + return VasEBoot_ERR_NONE; } { unsigned i; - struct grub_btrfs_leaf_node leaf, leaf_last; + struct VasEBoot_btrfs_leaf_node leaf, leaf_last; int have_last = 0; - for (i = 0; i < grub_le_to_cpu32 (head.nitems); i++) + for (i = 0; i < VasEBoot_le_to_cpu32 (head.nitems); i++) { - err = grub_btrfs_read_logical (data, addr + i * sizeof (leaf), + err = VasEBoot_btrfs_read_logical (data, addr + i * sizeof (leaf), &leaf, sizeof (leaf), recursion_depth + 1); if (err) return err; - grub_dprintf ("btrfs", - "leaf (depth %d) %" PRIxGRUB_UINT64_T - " %x %" PRIxGRUB_UINT64_T "\n", depth, + VasEBoot_dprintf ("btrfs", + "leaf (depth %d) %" PRIxVasEBoot_UINT64_T + " %x %" PRIxVasEBoot_UINT64_T "\n", depth, leaf.key.object_id, leaf.key.type, leaf.key.offset); if (key_cmp (&leaf.key, key_in) == 0) { - grub_memcpy (key_out, &leaf.key, sizeof (*key_out)); - *outsize = grub_le_to_cpu32 (leaf.size); - *outaddr = addr + grub_le_to_cpu32 (leaf.offset); + VasEBoot_memcpy (key_out, &leaf.key, sizeof (*key_out)); + *outsize = VasEBoot_le_to_cpu32 (leaf.size); + *outaddr = addr + VasEBoot_le_to_cpu32 (leaf.offset); if (desc) return save_ref (desc, addr - sizeof (head), i, - grub_le_to_cpu32 (head.nitems), 1); - return GRUB_ERR_NONE; + VasEBoot_le_to_cpu32 (head.nitems), 1); + return VasEBoot_ERR_NONE; } if (key_cmp (&leaf.key, key_in) > 0) @@ -495,21 +495,21 @@ lower_bound (struct grub_btrfs_data *data, if (have_last) { - grub_memcpy (key_out, &leaf_last.key, sizeof (*key_out)); - *outsize = grub_le_to_cpu32 (leaf_last.size); - *outaddr = addr + grub_le_to_cpu32 (leaf_last.offset); + VasEBoot_memcpy (key_out, &leaf_last.key, sizeof (*key_out)); + *outsize = VasEBoot_le_to_cpu32 (leaf_last.size); + *outaddr = addr + VasEBoot_le_to_cpu32 (leaf_last.offset); if (desc) return save_ref (desc, addr - sizeof (head), i - 1, - grub_le_to_cpu32 (head.nitems), 1); - return GRUB_ERR_NONE; + VasEBoot_le_to_cpu32 (head.nitems), 1); + return VasEBoot_ERR_NONE; } *outsize = 0; *outaddr = 0; - grub_memset (key_out, 0, sizeof (*key_out)); + VasEBoot_memset (key_out, 0, sizeof (*key_out)); if (desc) return save_ref (desc, addr - sizeof (head), -1, - grub_le_to_cpu32 (head.nitems), 1); - return GRUB_ERR_NONE; + VasEBoot_le_to_cpu32 (head.nitems), 1); + return VasEBoot_ERR_NONE; } } } @@ -517,9 +517,9 @@ lower_bound (struct grub_btrfs_data *data, /* Context for find_device. */ struct find_device_ctx { - struct grub_btrfs_data *data; - grub_uint64_t id; - grub_device_t dev_found; + struct VasEBoot_btrfs_data *data; + VasEBoot_uint64_t id; + VasEBoot_device_t dev_found; }; /* Helper for find_device. */ @@ -527,35 +527,35 @@ static int find_device_iter (const char *name, void *data) { struct find_device_ctx *ctx = data; - grub_device_t dev; - grub_err_t err; - struct grub_btrfs_superblock sb; + VasEBoot_device_t dev; + VasEBoot_err_t err; + struct VasEBoot_btrfs_superblock sb; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (!dev) return 0; if (!dev->disk) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } err = read_sblock (dev->disk, &sb); - if (err == GRUB_ERR_BAD_FS) + if (err == VasEBoot_ERR_BAD_FS) { - grub_device_close (dev); - grub_errno = GRUB_ERR_NONE; + VasEBoot_device_close (dev); + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } if (err) { - grub_device_close (dev); - grub_print_error (); + VasEBoot_device_close (dev); + VasEBoot_print_error (); return 0; } - if (grub_memcmp (ctx->data->sblock.uuid, sb.uuid, sizeof (sb.uuid)) != 0 + if (VasEBoot_memcmp (ctx->data->sblock.uuid, sb.uuid, sizeof (sb.uuid)) != 0 || sb.this_device.device_id != ctx->id) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } @@ -563,8 +563,8 @@ find_device_iter (const char *name, void *data) return 1; } -static grub_device_t -find_device (struct grub_btrfs_data *data, grub_uint64_t id, int do_rescan) +static VasEBoot_device_t +find_device (struct VasEBoot_btrfs_data *data, VasEBoot_uint64_t id, int do_rescan) { struct find_device_ctx ctx = { .data = data, @@ -577,10 +577,10 @@ find_device (struct grub_btrfs_data *data, grub_uint64_t id, int do_rescan) if (id == data->devices_attached[i].id) return data->devices_attached[i].dev; if (do_rescan) - grub_device_iterate (find_device_iter, &ctx); + VasEBoot_device_iterate (find_device_iter, &ctx); if (!ctx.dev_found) { - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, N_("couldn't find a necessary member device " "of multi-device filesystem")); return NULL; @@ -591,12 +591,12 @@ find_device (struct grub_btrfs_data *data, grub_uint64_t id, int do_rescan) void *tmp; data->n_devices_allocated = 2 * data->n_devices_attached + 1; data->devices_attached - = grub_realloc (tmp = data->devices_attached, + = VasEBoot_realloc (tmp = data->devices_attached, data->n_devices_allocated * sizeof (data->devices_attached[0])); if (!data->devices_attached) { - grub_device_close (ctx.dev_found); + VasEBoot_device_close (ctx.dev_found); data->devices_attached = tmp; return NULL; } @@ -606,157 +606,157 @@ find_device (struct grub_btrfs_data *data, grub_uint64_t id, int do_rescan) return ctx.dev_found; } -static grub_err_t -grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, - void *buf, grub_size_t size, int recursion_depth) +static VasEBoot_err_t +VasEBoot_btrfs_read_logical (struct VasEBoot_btrfs_data *data, VasEBoot_disk_addr_t addr, + void *buf, VasEBoot_size_t size, int recursion_depth) { while (size > 0) { - grub_uint8_t *ptr; - struct grub_btrfs_key *key; - struct grub_btrfs_chunk_item *chunk; - grub_uint64_t csize; - grub_err_t err = 0; - struct grub_btrfs_key key_out; + VasEBoot_uint8_t *ptr; + struct VasEBoot_btrfs_key *key; + struct VasEBoot_btrfs_chunk_item *chunk; + VasEBoot_uint64_t csize; + VasEBoot_err_t err = 0; + struct VasEBoot_btrfs_key key_out; int challoc = 0; - grub_device_t dev; - struct grub_btrfs_key key_in; - grub_size_t chsize; - grub_disk_addr_t chaddr; + VasEBoot_device_t dev; + struct VasEBoot_btrfs_key key_in; + VasEBoot_size_t chsize; + VasEBoot_disk_addr_t chaddr; - grub_dprintf ("btrfs", "searching for laddr %" PRIxGRUB_UINT64_T "\n", + VasEBoot_dprintf ("btrfs", "searching for laddr %" PRIxVasEBoot_UINT64_T "\n", addr); for (ptr = data->sblock.bootstrap_mapping; ptr < data->sblock.bootstrap_mapping + sizeof (data->sblock.bootstrap_mapping) - - sizeof (struct grub_btrfs_key);) + - sizeof (struct VasEBoot_btrfs_key);) { - key = (struct grub_btrfs_key *) ptr; - if (key->type != GRUB_BTRFS_ITEM_TYPE_CHUNK) + key = (struct VasEBoot_btrfs_key *) ptr; + if (key->type != VasEBoot_BTRFS_ITEM_TYPE_CHUNK) break; - chunk = (struct grub_btrfs_chunk_item *) (key + 1); - grub_dprintf ("btrfs", - "%" PRIxGRUB_UINT64_T " %" PRIxGRUB_UINT64_T " \n", - grub_le_to_cpu64 (key->offset), - grub_le_to_cpu64 (chunk->size)); - if (grub_le_to_cpu64 (key->offset) <= addr - && addr < grub_le_to_cpu64 (key->offset) - + grub_le_to_cpu64 (chunk->size)) + chunk = (struct VasEBoot_btrfs_chunk_item *) (key + 1); + VasEBoot_dprintf ("btrfs", + "%" PRIxVasEBoot_UINT64_T " %" PRIxVasEBoot_UINT64_T " \n", + VasEBoot_le_to_cpu64 (key->offset), + VasEBoot_le_to_cpu64 (chunk->size)); + if (VasEBoot_le_to_cpu64 (key->offset) <= addr + && addr < VasEBoot_le_to_cpu64 (key->offset) + + VasEBoot_le_to_cpu64 (chunk->size)) goto chunk_found; ptr += sizeof (*key) + sizeof (*chunk) - + sizeof (struct grub_btrfs_chunk_stripe) - * grub_le_to_cpu16 (chunk->nstripes); + + sizeof (struct VasEBoot_btrfs_chunk_stripe) + * VasEBoot_le_to_cpu16 (chunk->nstripes); } - key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_OBJECT_ID_CHUNK); - key_in.type = GRUB_BTRFS_ITEM_TYPE_CHUNK; - key_in.offset = grub_cpu_to_le64 (addr); + key_in.object_id = VasEBoot_cpu_to_le64_compile_time (VasEBoot_BTRFS_OBJECT_ID_CHUNK); + key_in.type = VasEBoot_BTRFS_ITEM_TYPE_CHUNK; + key_in.offset = VasEBoot_cpu_to_le64 (addr); err = lower_bound (data, &key_in, &key_out, data->sblock.chunk_tree, &chaddr, &chsize, NULL, recursion_depth); if (err) return err; key = &key_out; - if (key->type != GRUB_BTRFS_ITEM_TYPE_CHUNK - || !(grub_le_to_cpu64 (key->offset) <= addr)) - return grub_error (GRUB_ERR_BAD_FS, + if (key->type != VasEBoot_BTRFS_ITEM_TYPE_CHUNK + || !(VasEBoot_le_to_cpu64 (key->offset) <= addr)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find the chunk descriptor"); - chunk = grub_malloc (chsize); + chunk = VasEBoot_malloc (chsize); if (!chunk) - return grub_errno; + return VasEBoot_errno; challoc = 1; - err = grub_btrfs_read_logical (data, chaddr, chunk, chsize, + err = VasEBoot_btrfs_read_logical (data, chaddr, chunk, chsize, recursion_depth); if (err) { - grub_free (chunk); + VasEBoot_free (chunk); return err; } chunk_found: { - grub_uint64_t stripen; - grub_uint64_t stripe_offset; - grub_uint64_t off = addr - grub_le_to_cpu64 (key->offset); - grub_uint64_t chunk_stripe_length; - grub_uint16_t nstripes; + VasEBoot_uint64_t stripen; + VasEBoot_uint64_t stripe_offset; + VasEBoot_uint64_t off = addr - VasEBoot_le_to_cpu64 (key->offset); + VasEBoot_uint64_t chunk_stripe_length; + VasEBoot_uint16_t nstripes; unsigned redundancy = 1; unsigned i, j; - if (grub_le_to_cpu64 (chunk->size) <= off) + if (VasEBoot_le_to_cpu64 (chunk->size) <= off) { - grub_dprintf ("btrfs", "no chunk\n"); - return grub_error (GRUB_ERR_BAD_FS, + VasEBoot_dprintf ("btrfs", "no chunk\n"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find the chunk descriptor"); } - nstripes = grub_le_to_cpu16 (chunk->nstripes) ? : 1; - chunk_stripe_length = grub_le_to_cpu64 (chunk->stripe_length) ? : 512; - grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T - "+0x%" PRIxGRUB_UINT64_T + nstripes = VasEBoot_le_to_cpu16 (chunk->nstripes) ? : 1; + chunk_stripe_length = VasEBoot_le_to_cpu64 (chunk->stripe_length) ? : 512; + VasEBoot_dprintf ("btrfs", "chunk 0x%" PRIxVasEBoot_UINT64_T + "+0x%" PRIxVasEBoot_UINT64_T " (%d stripes (%d substripes) of %" - PRIxGRUB_UINT64_T ")\n", - grub_le_to_cpu64 (key->offset), - grub_le_to_cpu64 (chunk->size), + PRIxVasEBoot_UINT64_T ")\n", + VasEBoot_le_to_cpu64 (key->offset), + VasEBoot_le_to_cpu64 (chunk->size), nstripes, - grub_le_to_cpu16 (chunk->nsubstripes), + VasEBoot_le_to_cpu16 (chunk->nsubstripes), chunk_stripe_length); - switch (grub_le_to_cpu64 (chunk->type) - & ~GRUB_BTRFS_CHUNK_TYPE_BITS_DONTCARE) + switch (VasEBoot_le_to_cpu64 (chunk->type) + & ~VasEBoot_BTRFS_CHUNK_TYPE_BITS_DONTCARE) { - case GRUB_BTRFS_CHUNK_TYPE_SINGLE: + case VasEBoot_BTRFS_CHUNK_TYPE_SINGLE: { - grub_uint64_t stripe_length; - grub_dprintf ("btrfs", "single\n"); - stripe_length = grub_divmod64 (grub_le_to_cpu64 (chunk->size), + VasEBoot_uint64_t stripe_length; + VasEBoot_dprintf ("btrfs", "single\n"); + stripe_length = VasEBoot_divmod64 (VasEBoot_le_to_cpu64 (chunk->size), nstripes, NULL); if (stripe_length == 0) stripe_length = 512; - stripen = grub_divmod64 (off, stripe_length, &stripe_offset); + stripen = VasEBoot_divmod64 (off, stripe_length, &stripe_offset); csize = (stripen + 1) * stripe_length - off; break; } - case GRUB_BTRFS_CHUNK_TYPE_DUPLICATED: - case GRUB_BTRFS_CHUNK_TYPE_RAID1: + case VasEBoot_BTRFS_CHUNK_TYPE_DUPLICATED: + case VasEBoot_BTRFS_CHUNK_TYPE_RAID1: { - grub_dprintf ("btrfs", "RAID1\n"); + VasEBoot_dprintf ("btrfs", "RAID1\n"); stripen = 0; stripe_offset = off; - csize = grub_le_to_cpu64 (chunk->size) - off; + csize = VasEBoot_le_to_cpu64 (chunk->size) - off; redundancy = 2; break; } - case GRUB_BTRFS_CHUNK_TYPE_RAID0: + case VasEBoot_BTRFS_CHUNK_TYPE_RAID0: { - grub_uint64_t middle, high; - grub_uint64_t low; - grub_dprintf ("btrfs", "RAID0\n"); - middle = grub_divmod64 (off, + VasEBoot_uint64_t middle, high; + VasEBoot_uint64_t low; + VasEBoot_dprintf ("btrfs", "RAID0\n"); + middle = VasEBoot_divmod64 (off, chunk_stripe_length, &low); - high = grub_divmod64 (middle, nstripes, + high = VasEBoot_divmod64 (middle, nstripes, &stripen); stripe_offset = low + chunk_stripe_length * high; csize = chunk_stripe_length - low; break; } - case GRUB_BTRFS_CHUNK_TYPE_RAID10: + case VasEBoot_BTRFS_CHUNK_TYPE_RAID10: { - grub_uint64_t middle, high; - grub_uint64_t low; - grub_uint16_t nsubstripes; - nsubstripes = grub_le_to_cpu16 (chunk->nsubstripes) ? : 1; - middle = grub_divmod64 (off, + VasEBoot_uint64_t middle, high; + VasEBoot_uint64_t low; + VasEBoot_uint16_t nsubstripes; + nsubstripes = VasEBoot_le_to_cpu16 (chunk->nsubstripes) ? : 1; + middle = VasEBoot_divmod64 (off, chunk_stripe_length, &low); - high = grub_divmod64 (middle, + high = VasEBoot_divmod64 (middle, nstripes / nsubstripes ? : 1, &stripen); stripen *= nsubstripes; @@ -767,105 +767,105 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, break; } default: - grub_dprintf ("btrfs", "unsupported RAID\n"); - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "unsupported RAID flags %" PRIxGRUB_UINT64_T, - grub_le_to_cpu64 (chunk->type)); + VasEBoot_dprintf ("btrfs", "unsupported RAID\n"); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, + "unsupported RAID flags %" PRIxVasEBoot_UINT64_T, + VasEBoot_le_to_cpu64 (chunk->type)); } if (csize == 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "couldn't find the chunk descriptor"); - if (csize > (grub_uint64_t) size) + if (csize > (VasEBoot_uint64_t) size) csize = size; for (j = 0; j < 2; j++) { for (i = 0; i < redundancy; i++) { - struct grub_btrfs_chunk_stripe *stripe; - grub_disk_addr_t paddr; + struct VasEBoot_btrfs_chunk_stripe *stripe; + VasEBoot_disk_addr_t paddr; - stripe = (struct grub_btrfs_chunk_stripe *) (chunk + 1); + stripe = (struct VasEBoot_btrfs_chunk_stripe *) (chunk + 1); /* Right now the redundancy handling is easy. With RAID5-like it will be more difficult. */ stripe += stripen + i; - paddr = grub_le_to_cpu64 (stripe->offset) + stripe_offset; + paddr = VasEBoot_le_to_cpu64 (stripe->offset) + stripe_offset; - grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T - "+0x%" PRIxGRUB_UINT64_T + VasEBoot_dprintf ("btrfs", "chunk 0x%" PRIxVasEBoot_UINT64_T + "+0x%" PRIxVasEBoot_UINT64_T " (%d stripes (%d substripes) of %" - PRIxGRUB_UINT64_T ") stripe %" PRIxGRUB_UINT64_T - " maps to 0x%" PRIxGRUB_UINT64_T "\n", - grub_le_to_cpu64 (key->offset), - grub_le_to_cpu64 (chunk->size), - grub_le_to_cpu16 (chunk->nstripes), - grub_le_to_cpu16 (chunk->nsubstripes), - grub_le_to_cpu64 (chunk->stripe_length), + PRIxVasEBoot_UINT64_T ") stripe %" PRIxVasEBoot_UINT64_T + " maps to 0x%" PRIxVasEBoot_UINT64_T "\n", + VasEBoot_le_to_cpu64 (key->offset), + VasEBoot_le_to_cpu64 (chunk->size), + VasEBoot_le_to_cpu16 (chunk->nstripes), + VasEBoot_le_to_cpu16 (chunk->nsubstripes), + VasEBoot_le_to_cpu64 (chunk->stripe_length), stripen, stripe->offset); - grub_dprintf ("btrfs", "reading paddr 0x%" PRIxGRUB_UINT64_T - " for laddr 0x%" PRIxGRUB_UINT64_T "\n", paddr, + VasEBoot_dprintf ("btrfs", "reading paddr 0x%" PRIxVasEBoot_UINT64_T + " for laddr 0x%" PRIxVasEBoot_UINT64_T "\n", paddr, addr); dev = find_device (data, stripe->device_id, j); if (!dev) { - err = grub_errno; - grub_errno = GRUB_ERR_NONE; + err = VasEBoot_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - err = grub_disk_read (dev->disk, paddr >> GRUB_DISK_SECTOR_BITS, - paddr & (GRUB_DISK_SECTOR_SIZE - 1), + err = VasEBoot_disk_read (dev->disk, paddr >> VasEBoot_DISK_SECTOR_BITS, + paddr & (VasEBoot_DISK_SECTOR_SIZE - 1), csize, buf); if (!err) break; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (i != redundancy) break; } if (err) - return grub_errno = err; + return VasEBoot_errno = err; } size -= csize; - buf = (grub_uint8_t *) buf + csize; + buf = (VasEBoot_uint8_t *) buf + csize; addr += csize; if (challoc) - grub_free (chunk); + VasEBoot_free (chunk); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_btrfs_data * -grub_btrfs_mount (grub_device_t dev) +static struct VasEBoot_btrfs_data * +VasEBoot_btrfs_mount (VasEBoot_device_t dev) { - struct grub_btrfs_data *data; - grub_err_t err; + struct VasEBoot_btrfs_data *data; + VasEBoot_err_t err; if (!dev->disk) { - grub_error (GRUB_ERR_BAD_FS, "not BtrFS"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not BtrFS"); return NULL; } - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) return NULL; err = read_sblock (dev->disk, &data->sblock); if (err) { - grub_free (data); + VasEBoot_free (data); return NULL; } data->n_devices_allocated = 16; - data->devices_attached = grub_malloc (sizeof (data->devices_attached[0]) + data->devices_attached = VasEBoot_malloc (sizeof (data->devices_attached[0]) * data->n_devices_allocated); if (!data->devices_attached) { - grub_free (data); + VasEBoot_free (data); return NULL; } data->n_devices_attached = 1; @@ -876,29 +876,29 @@ grub_btrfs_mount (grub_device_t dev) } static void -grub_btrfs_unmount (struct grub_btrfs_data *data) +VasEBoot_btrfs_unmount (struct VasEBoot_btrfs_data *data) { unsigned i; /* The device 0 is closed one layer upper. */ for (i = 1; i < data->n_devices_attached; i++) - grub_device_close (data->devices_attached[i].dev); - grub_free (data->devices_attached); - grub_free (data->extent); - grub_free (data); + VasEBoot_device_close (data->devices_attached[i].dev); + VasEBoot_free (data->devices_attached); + VasEBoot_free (data->extent); + VasEBoot_free (data); } -static grub_err_t -grub_btrfs_read_inode (struct grub_btrfs_data *data, - struct grub_btrfs_inode *inode, grub_uint64_t num, - grub_uint64_t tree) +static VasEBoot_err_t +VasEBoot_btrfs_read_inode (struct VasEBoot_btrfs_data *data, + struct VasEBoot_btrfs_inode *inode, VasEBoot_uint64_t num, + VasEBoot_uint64_t tree) { - struct grub_btrfs_key key_in, key_out; - grub_disk_addr_t elemaddr; - grub_size_t elemsize; - grub_err_t err; + struct VasEBoot_btrfs_key key_in, key_out; + VasEBoot_disk_addr_t elemaddr; + VasEBoot_size_t elemsize; + VasEBoot_err_t err; key_in.object_id = num; - key_in.type = GRUB_BTRFS_ITEM_TYPE_INODE_ITEM; + key_in.type = VasEBoot_BTRFS_ITEM_TYPE_INODE_ITEM; key_in.offset = 0; err = lower_bound (data, &key_in, &key_out, tree, &elemaddr, &elemsize, NULL, @@ -906,80 +906,80 @@ grub_btrfs_read_inode (struct grub_btrfs_data *data, if (err) return err; if (num != key_out.object_id - || key_out.type != GRUB_BTRFS_ITEM_TYPE_INODE_ITEM) - return grub_error (GRUB_ERR_BAD_FS, "inode not found"); + || key_out.type != VasEBoot_BTRFS_ITEM_TYPE_INODE_ITEM) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "inode not found"); - return grub_btrfs_read_logical (data, elemaddr, inode, sizeof (*inode), 0); + return VasEBoot_btrfs_read_logical (data, elemaddr, inode, sizeof (*inode), 0); } -static grub_ssize_t -grub_btrfs_lzo_decompress(char *ibuf, grub_size_t isize, grub_off_t off, - char *obuf, grub_size_t osize) +static VasEBoot_ssize_t +VasEBoot_btrfs_lzo_decompress(char *ibuf, VasEBoot_size_t isize, VasEBoot_off_t off, + char *obuf, VasEBoot_size_t osize) { - grub_uint32_t total_size, cblock_size; - grub_size_t ret = 0; + VasEBoot_uint32_t total_size, cblock_size; + VasEBoot_size_t ret = 0; char *ibuf0 = ibuf; - total_size = grub_le_to_cpu32 (grub_get_unaligned32 (ibuf)); + total_size = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (ibuf)); ibuf += sizeof (total_size); if (isize < total_size) return -1; /* Jump forward to first block with requested data. */ - while (off >= GRUB_BTRFS_LZO_BLOCK_SIZE) + while (off >= VasEBoot_BTRFS_LZO_BLOCK_SIZE) { /* Don't let following uint32_t cross the page boundary. */ if (((ibuf - ibuf0) & 0xffc) == 0xffc) ibuf = ((ibuf - ibuf0 + 3) & ~3) + ibuf0; - cblock_size = grub_le_to_cpu32 (grub_get_unaligned32 (ibuf)); + cblock_size = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (ibuf)); ibuf += sizeof (cblock_size); - if (cblock_size > GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE) + if (cblock_size > VasEBoot_BTRFS_LZO_BLOCK_MAX_CSIZE) return -1; - off -= GRUB_BTRFS_LZO_BLOCK_SIZE; + off -= VasEBoot_BTRFS_LZO_BLOCK_SIZE; ibuf += cblock_size; } while (osize > 0) { - lzo_uint usize = GRUB_BTRFS_LZO_BLOCK_SIZE; + lzo_uint usize = VasEBoot_BTRFS_LZO_BLOCK_SIZE; /* Don't let following uint32_t cross the page boundary. */ if (((ibuf - ibuf0) & 0xffc) == 0xffc) ibuf = ((ibuf - ibuf0 + 3) & ~3) + ibuf0; - cblock_size = grub_le_to_cpu32 (grub_get_unaligned32 (ibuf)); + cblock_size = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (ibuf)); ibuf += sizeof (cblock_size); - if (cblock_size > GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE) + if (cblock_size > VasEBoot_BTRFS_LZO_BLOCK_MAX_CSIZE) return -1; /* Block partially filled with requested data. */ - if (off > 0 || osize < GRUB_BTRFS_LZO_BLOCK_SIZE) + if (off > 0 || osize < VasEBoot_BTRFS_LZO_BLOCK_SIZE) { - grub_size_t to_copy = GRUB_BTRFS_LZO_BLOCK_SIZE - off; - grub_uint8_t *buf; + VasEBoot_size_t to_copy = VasEBoot_BTRFS_LZO_BLOCK_SIZE - off; + VasEBoot_uint8_t *buf; if (to_copy > osize) to_copy = osize; - buf = grub_malloc (GRUB_BTRFS_LZO_BLOCK_SIZE); + buf = VasEBoot_malloc (VasEBoot_BTRFS_LZO_BLOCK_SIZE); if (!buf) return -1; if (lzo1x_decompress_safe ((lzo_bytep)ibuf, cblock_size, buf, &usize, NULL) != LZO_E_OK) { - grub_free (buf); + VasEBoot_free (buf); return -1; } if (to_copy > usize) to_copy = usize; - grub_memcpy(obuf, buf + off, to_copy); + VasEBoot_memcpy(obuf, buf + off, to_copy); osize -= to_copy; ret += to_copy; @@ -987,7 +987,7 @@ grub_btrfs_lzo_decompress(char *ibuf, grub_size_t isize, grub_off_t off, ibuf += cblock_size; off = 0; - grub_free (buf); + VasEBoot_free (buf); continue; } @@ -1005,71 +1005,71 @@ grub_btrfs_lzo_decompress(char *ibuf, grub_size_t isize, grub_off_t off, return ret; } -static grub_ssize_t -grub_btrfs_extent_read (struct grub_btrfs_data *data, - grub_uint64_t ino, grub_uint64_t tree, - grub_off_t pos0, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_btrfs_extent_read (struct VasEBoot_btrfs_data *data, + VasEBoot_uint64_t ino, VasEBoot_uint64_t tree, + VasEBoot_off_t pos0, char *buf, VasEBoot_size_t len) { - grub_off_t pos = pos0; + VasEBoot_off_t pos = pos0; while (len) { - grub_size_t csize; - grub_err_t err; - grub_off_t extoff; + VasEBoot_size_t csize; + VasEBoot_err_t err; + VasEBoot_off_t extoff; if (!data->extent || data->extstart > pos || data->extino != ino || data->exttree != tree || data->extend <= pos) { - struct grub_btrfs_key key_in, key_out; - grub_disk_addr_t elemaddr; - grub_size_t elemsize; + struct VasEBoot_btrfs_key key_in, key_out; + VasEBoot_disk_addr_t elemaddr; + VasEBoot_size_t elemsize; - grub_free (data->extent); + VasEBoot_free (data->extent); key_in.object_id = ino; - key_in.type = GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM; - key_in.offset = grub_cpu_to_le64 (pos); + key_in.type = VasEBoot_BTRFS_ITEM_TYPE_EXTENT_ITEM; + key_in.offset = VasEBoot_cpu_to_le64 (pos); err = lower_bound (data, &key_in, &key_out, tree, &elemaddr, &elemsize, NULL, 0); if (err) return -1; if (key_out.object_id != ino - || key_out.type != GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM) + || key_out.type != VasEBoot_BTRFS_ITEM_TYPE_EXTENT_ITEM) { - grub_error (GRUB_ERR_BAD_FS, "extent not found"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "extent not found"); return -1; } - if ((grub_ssize_t) elemsize < ((char *) &data->extent->inl + if ((VasEBoot_ssize_t) elemsize < ((char *) &data->extent->inl - (char *) data->extent)) { - grub_error (GRUB_ERR_BAD_FS, "extent descriptor is too short"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "extent descriptor is too short"); return -1; } - data->extstart = grub_le_to_cpu64 (key_out.offset); + data->extstart = VasEBoot_le_to_cpu64 (key_out.offset); data->extsize = elemsize; - data->extent = grub_malloc (elemsize); + data->extent = VasEBoot_malloc (elemsize); data->extino = ino; data->exttree = tree; if (!data->extent) - return grub_errno; + return VasEBoot_errno; - err = grub_btrfs_read_logical (data, elemaddr, data->extent, + err = VasEBoot_btrfs_read_logical (data, elemaddr, data->extent, elemsize, 0); if (err) return err; - data->extend = data->extstart + grub_le_to_cpu64 (data->extent->size); - if (data->extent->type == GRUB_BTRFS_EXTENT_REGULAR + data->extend = data->extstart + VasEBoot_le_to_cpu64 (data->extent->size); + if (data->extent->type == VasEBoot_BTRFS_EXTENT_REGULAR && (char *) data->extent + elemsize >= (char *) &data->extent->filled + sizeof (data->extent->filled)) data->extend = - data->extstart + grub_le_to_cpu64 (data->extent->filled); + data->extstart + VasEBoot_le_to_cpu64 (data->extent->filled); - grub_dprintf ("btrfs", "regular extent 0x%" PRIxGRUB_UINT64_T "+0x%" - PRIxGRUB_UINT64_T "\n", - grub_le_to_cpu64 (key_out.offset), - grub_le_to_cpu64 (data->extent->size)); + VasEBoot_dprintf ("btrfs", "regular extent 0x%" PRIxVasEBoot_UINT64_T "+0x%" + PRIxVasEBoot_UINT64_T "\n", + VasEBoot_le_to_cpu64 (key_out.offset), + VasEBoot_le_to_cpu64 (data->extent->size)); if (data->extend <= pos) { - grub_error (GRUB_ERR_BAD_FS, "extent not found"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "extent not found"); return -1; } } @@ -1080,16 +1080,16 @@ grub_btrfs_extent_read (struct grub_btrfs_data *data, if (data->extent->encryption) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "encryption not supported"); return -1; } - if (data->extent->compression != GRUB_BTRFS_COMPRESSION_NONE - && data->extent->compression != GRUB_BTRFS_COMPRESSION_ZLIB - && data->extent->compression != GRUB_BTRFS_COMPRESSION_LZO) + if (data->extent->compression != VasEBoot_BTRFS_COMPRESSION_NONE + && data->extent->compression != VasEBoot_BTRFS_COMPRESSION_ZLIB + && data->extent->compression != VasEBoot_BTRFS_COMPRESSION_LZO) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "compression type 0x%x not supported", data->extent->compression); return -1; @@ -1097,97 +1097,97 @@ grub_btrfs_extent_read (struct grub_btrfs_data *data, if (data->extent->encoding) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "encoding not supported"); + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "encoding not supported"); return -1; } switch (data->extent->type) { - case GRUB_BTRFS_EXTENT_INLINE: - if (data->extent->compression == GRUB_BTRFS_COMPRESSION_ZLIB) + case VasEBoot_BTRFS_EXTENT_INLINE: + if (data->extent->compression == VasEBoot_BTRFS_COMPRESSION_ZLIB) { - if (grub_zlib_decompress (data->extent->inl, data->extsize - - ((grub_uint8_t *) data->extent->inl - - (grub_uint8_t *) data->extent), + if (VasEBoot_zlib_decompress (data->extent->inl, data->extsize - + ((VasEBoot_uint8_t *) data->extent->inl + - (VasEBoot_uint8_t *) data->extent), extoff, buf, csize) - != (grub_ssize_t) csize) + != (VasEBoot_ssize_t) csize) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); return -1; } } - else if (data->extent->compression == GRUB_BTRFS_COMPRESSION_LZO) + else if (data->extent->compression == VasEBoot_BTRFS_COMPRESSION_LZO) { - if (grub_btrfs_lzo_decompress(data->extent->inl, data->extsize - - ((grub_uint8_t *) data->extent->inl - - (grub_uint8_t *) data->extent), + if (VasEBoot_btrfs_lzo_decompress(data->extent->inl, data->extsize - + ((VasEBoot_uint8_t *) data->extent->inl + - (VasEBoot_uint8_t *) data->extent), extoff, buf, csize) - != (grub_ssize_t) csize) + != (VasEBoot_ssize_t) csize) return -1; } else - grub_memcpy (buf, data->extent->inl + extoff, csize); + VasEBoot_memcpy (buf, data->extent->inl + extoff, csize); break; - case GRUB_BTRFS_EXTENT_REGULAR: + case VasEBoot_BTRFS_EXTENT_REGULAR: if (!data->extent->laddr) { - grub_memset (buf, 0, csize); + VasEBoot_memset (buf, 0, csize); break; } - if (data->extent->compression != GRUB_BTRFS_COMPRESSION_NONE) + if (data->extent->compression != VasEBoot_BTRFS_COMPRESSION_NONE) { char *tmp; - grub_uint64_t zsize; - grub_ssize_t ret; + VasEBoot_uint64_t zsize; + VasEBoot_ssize_t ret; - zsize = grub_le_to_cpu64 (data->extent->compressed_size); - tmp = grub_malloc (zsize); + zsize = VasEBoot_le_to_cpu64 (data->extent->compressed_size); + tmp = VasEBoot_malloc (zsize); if (!tmp) return -1; - err = grub_btrfs_read_logical (data, - grub_le_to_cpu64 (data->extent->laddr), + err = VasEBoot_btrfs_read_logical (data, + VasEBoot_le_to_cpu64 (data->extent->laddr), tmp, zsize, 0); if (err) { - grub_free (tmp); + VasEBoot_free (tmp); return -1; } - if (data->extent->compression == GRUB_BTRFS_COMPRESSION_ZLIB) - ret = grub_zlib_decompress (tmp, zsize, extoff - + grub_le_to_cpu64 (data->extent->offset), + if (data->extent->compression == VasEBoot_BTRFS_COMPRESSION_ZLIB) + ret = VasEBoot_zlib_decompress (tmp, zsize, extoff + + VasEBoot_le_to_cpu64 (data->extent->offset), buf, csize); - else if (data->extent->compression == GRUB_BTRFS_COMPRESSION_LZO) - ret = grub_btrfs_lzo_decompress (tmp, zsize, extoff - + grub_le_to_cpu64 (data->extent->offset), + else if (data->extent->compression == VasEBoot_BTRFS_COMPRESSION_LZO) + ret = VasEBoot_btrfs_lzo_decompress (tmp, zsize, extoff + + VasEBoot_le_to_cpu64 (data->extent->offset), buf, csize); else ret = -1; - grub_free (tmp); + VasEBoot_free (tmp); - if (ret != (grub_ssize_t) csize) + if (ret != (VasEBoot_ssize_t) csize) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); return -1; } break; } - err = grub_btrfs_read_logical (data, - grub_le_to_cpu64 (data->extent->laddr) - + grub_le_to_cpu64 (data->extent->offset) + err = VasEBoot_btrfs_read_logical (data, + VasEBoot_le_to_cpu64 (data->extent->laddr) + + VasEBoot_le_to_cpu64 (data->extent->offset) + extoff, buf, csize, 0); if (err) return -1; break; default: - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported extent type 0x%x", data->extent->type); return -1; } @@ -1198,19 +1198,19 @@ grub_btrfs_extent_read (struct grub_btrfs_data *data, return pos - pos0; } -static grub_err_t -get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key, - grub_uint64_t *tree, grub_uint8_t *type) +static VasEBoot_err_t +get_root (struct VasEBoot_btrfs_data *data, struct VasEBoot_btrfs_key *key, + VasEBoot_uint64_t *tree, VasEBoot_uint8_t *type) { - grub_err_t err; - grub_disk_addr_t elemaddr; - grub_size_t elemsize; - struct grub_btrfs_key key_out, key_in; - struct grub_btrfs_root_item ri; + VasEBoot_err_t err; + VasEBoot_disk_addr_t elemaddr; + VasEBoot_size_t elemsize; + struct VasEBoot_btrfs_key key_out, key_in; + struct VasEBoot_btrfs_root_item ri; - key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_ROOT_VOL_OBJECTID); + key_in.object_id = VasEBoot_cpu_to_le64_compile_time (VasEBoot_BTRFS_ROOT_VOL_OBJECTID); key_in.offset = 0; - key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM; + key_in.type = VasEBoot_BTRFS_ITEM_TYPE_ROOT_ITEM; err = lower_bound (data, &key_in, &key_out, data->sblock.root_tree, &elemaddr, &elemsize, NULL, 0); @@ -1219,33 +1219,33 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key, if (key_in.object_id != key_out.object_id || key_in.type != key_out.type || key_in.offset != key_out.offset) - return grub_error (GRUB_ERR_BAD_FS, "no root"); - err = grub_btrfs_read_logical (data, elemaddr, &ri, + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "no root"); + err = VasEBoot_btrfs_read_logical (data, elemaddr, &ri, sizeof (ri), 0); if (err) return err; - key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM; + key->type = VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM; key->offset = 0; - key->object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_OBJECT_ID_CHUNK); + key->object_id = VasEBoot_cpu_to_le64_compile_time (VasEBoot_BTRFS_OBJECT_ID_CHUNK); *tree = ri.tree; - *type = GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY; - return GRUB_ERR_NONE; + *type = VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY; + return VasEBoot_ERR_NONE; } -static grub_err_t -find_path (struct grub_btrfs_data *data, - const char *path, struct grub_btrfs_key *key, - grub_uint64_t *tree, grub_uint8_t *type) +static VasEBoot_err_t +find_path (struct VasEBoot_btrfs_data *data, + const char *path, struct VasEBoot_btrfs_key *key, + VasEBoot_uint64_t *tree, VasEBoot_uint8_t *type) { const char *slash = path; - grub_err_t err; - grub_disk_addr_t elemaddr; - grub_size_t elemsize; - grub_size_t allocated = 0; - struct grub_btrfs_dir_item *direl = NULL; - struct grub_btrfs_key key_out; + VasEBoot_err_t err; + VasEBoot_disk_addr_t elemaddr; + VasEBoot_size_t elemsize; + VasEBoot_size_t allocated = 0; + struct VasEBoot_btrfs_dir_item *direl = NULL; + struct VasEBoot_btrfs_key key_out; const char *ctoken; - grub_size_t ctokenlen; + VasEBoot_size_t ctokenlen; char *path_alloc = NULL; char *origpath = NULL; unsigned symlinks_max = 32; @@ -1254,9 +1254,9 @@ find_path (struct grub_btrfs_data *data, if (err) return err; - origpath = grub_strdup (path); + origpath = VasEBoot_strdup (path); if (!origpath) - return grub_errno; + return VasEBoot_errno; while (1) { @@ -1264,17 +1264,17 @@ find_path (struct grub_btrfs_data *data, path++; if (!path[0]) break; - slash = grub_strchr (path, '/'); + slash = VasEBoot_strchr (path, '/'); if (!slash) - slash = path + grub_strlen (path); + slash = path + VasEBoot_strlen (path); ctoken = path; ctokenlen = slash - path; - if (*type != GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY) + if (*type != VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY) { - grub_free (path_alloc); - grub_free (origpath); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); } if (ctokenlen == 1 && ctoken[0] == '.') @@ -1284,30 +1284,30 @@ find_path (struct grub_btrfs_data *data, } if (ctokenlen == 2 && ctoken[0] == '.' && ctoken[1] == '.') { - key->type = GRUB_BTRFS_ITEM_TYPE_INODE_REF; + key->type = VasEBoot_BTRFS_ITEM_TYPE_INODE_REF; key->offset = -1; err = lower_bound (data, key, &key_out, *tree, &elemaddr, &elemsize, NULL, 0); if (err) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); return err; } if (key_out.type != key->type || key->object_id != key_out.object_id) { - grub_free (direl); - grub_free (path_alloc); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); + VasEBoot_free (origpath); return err; } - *type = GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY; + *type = VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY; key->object_id = key_out.offset; path = slash; @@ -1315,118 +1315,118 @@ find_path (struct grub_btrfs_data *data, continue; } - key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM; - key->offset = grub_cpu_to_le64 (~grub_getcrc32c (1, ctoken, ctokenlen)); + key->type = VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM; + key->offset = VasEBoot_cpu_to_le64 (~VasEBoot_getcrc32c (1, ctoken, ctokenlen)); err = lower_bound (data, key, &key_out, *tree, &elemaddr, &elemsize, NULL, 0); if (err) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); return err; } if (key_cmp (key, &key_out) != 0) { - grub_free (direl); - grub_free (path_alloc); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); + VasEBoot_free (origpath); return err; } - struct grub_btrfs_dir_item *cdirel; + struct VasEBoot_btrfs_dir_item *cdirel; if (elemsize > allocated) { allocated = 2 * elemsize; - grub_free (direl); - direl = grub_malloc (allocated + 1); + VasEBoot_free (direl); + direl = VasEBoot_malloc (allocated + 1); if (!direl) { - grub_free (path_alloc); - grub_free (origpath); - return grub_errno; + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); + return VasEBoot_errno; } } - err = grub_btrfs_read_logical (data, elemaddr, direl, elemsize, 0); + err = VasEBoot_btrfs_read_logical (data, elemaddr, direl, elemsize, 0); if (err) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); return err; } for (cdirel = direl; - (grub_uint8_t *) cdirel - (grub_uint8_t *) direl - < (grub_ssize_t) elemsize; - cdirel = (void *) ((grub_uint8_t *) (direl + 1) - + grub_le_to_cpu16 (cdirel->n) - + grub_le_to_cpu16 (cdirel->m))) + (VasEBoot_uint8_t *) cdirel - (VasEBoot_uint8_t *) direl + < (VasEBoot_ssize_t) elemsize; + cdirel = (void *) ((VasEBoot_uint8_t *) (direl + 1) + + VasEBoot_le_to_cpu16 (cdirel->n) + + VasEBoot_le_to_cpu16 (cdirel->m))) { - if (ctokenlen == grub_le_to_cpu16 (cdirel->n) - && grub_memcmp (cdirel->name, ctoken, ctokenlen) == 0) + if (ctokenlen == VasEBoot_le_to_cpu16 (cdirel->n) + && VasEBoot_memcmp (cdirel->name, ctoken, ctokenlen) == 0) break; } - if ((grub_uint8_t *) cdirel - (grub_uint8_t *) direl - >= (grub_ssize_t) elemsize) + if ((VasEBoot_uint8_t *) cdirel - (VasEBoot_uint8_t *) direl + >= (VasEBoot_ssize_t) elemsize) { - grub_free (direl); - grub_free (path_alloc); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); + VasEBoot_free (origpath); return err; } path = slash; - if (cdirel->type == GRUB_BTRFS_DIR_ITEM_TYPE_SYMLINK) + if (cdirel->type == VasEBoot_BTRFS_DIR_ITEM_TYPE_SYMLINK) { - struct grub_btrfs_inode inode; + struct VasEBoot_btrfs_inode inode; char *tmp; if (--symlinks_max == 0) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); - return grub_error (GRUB_ERR_SYMLINK_LOOP, + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); + return VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); } - err = grub_btrfs_read_inode (data, &inode, + err = VasEBoot_btrfs_read_inode (data, &inode, cdirel->key.object_id, *tree); if (err) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); return err; } - tmp = grub_malloc (grub_le_to_cpu64 (inode.size) - + grub_strlen (path) + 1); + tmp = VasEBoot_malloc (VasEBoot_le_to_cpu64 (inode.size) + + VasEBoot_strlen (path) + 1); if (!tmp) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); - return grub_errno; + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); + return VasEBoot_errno; } - if (grub_btrfs_extent_read (data, cdirel->key.object_id, + if (VasEBoot_btrfs_extent_read (data, cdirel->key.object_id, *tree, 0, tmp, - grub_le_to_cpu64 (inode.size)) - != (grub_ssize_t) grub_le_to_cpu64 (inode.size)) + VasEBoot_le_to_cpu64 (inode.size)) + != (VasEBoot_ssize_t) VasEBoot_le_to_cpu64 (inode.size)) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); - grub_free (tmp); - return grub_errno; + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); + VasEBoot_free (tmp); + return VasEBoot_errno; } - grub_memcpy (tmp + grub_le_to_cpu64 (inode.size), path, - grub_strlen (path) + 1); - grub_free (path_alloc); + VasEBoot_memcpy (tmp + VasEBoot_le_to_cpu64 (inode.size), path, + VasEBoot_strlen (path) + 1); + VasEBoot_free (path_alloc); path = path_alloc = tmp; if (path[0] == '/') { @@ -1440,110 +1440,110 @@ find_path (struct grub_btrfs_data *data, switch (cdirel->key.type) { - case GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM: + case VasEBoot_BTRFS_ITEM_TYPE_ROOT_ITEM: { - struct grub_btrfs_root_item ri; + struct VasEBoot_btrfs_root_item ri; err = lower_bound (data, &cdirel->key, &key_out, data->sblock.root_tree, &elemaddr, &elemsize, NULL, 0); if (err) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); return err; } if (cdirel->key.object_id != key_out.object_id || cdirel->key.type != key_out.type) { - grub_free (direl); - grub_free (path_alloc); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); + VasEBoot_free (origpath); return err; } - err = grub_btrfs_read_logical (data, elemaddr, &ri, + err = VasEBoot_btrfs_read_logical (data, elemaddr, &ri, sizeof (ri), 0); if (err) { - grub_free (direl); - grub_free (path_alloc); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); return err; } - key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM; + key->type = VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM; key->offset = 0; - key->object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_OBJECT_ID_CHUNK); + key->object_id = VasEBoot_cpu_to_le64_compile_time (VasEBoot_BTRFS_OBJECT_ID_CHUNK); *tree = ri.tree; break; } - case GRUB_BTRFS_ITEM_TYPE_INODE_ITEM: - if (*slash && *type == GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR) + case VasEBoot_BTRFS_ITEM_TYPE_INODE_ITEM: + if (*slash && *type == VasEBoot_BTRFS_DIR_ITEM_TYPE_REGULAR) { - grub_free (direl); - grub_free (path_alloc); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); - grub_free (origpath); + VasEBoot_free (direl); + VasEBoot_free (path_alloc); + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath); + VasEBoot_free (origpath); return err; } *key = cdirel->key; - if (*type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY) - key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM; + if (*type == VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY) + key->type = VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM; break; default: - grub_free (path_alloc); - grub_free (origpath); - grub_free (direl); - return grub_error (GRUB_ERR_BAD_FS, "unrecognised object type 0x%x", + VasEBoot_free (path_alloc); + VasEBoot_free (origpath); + VasEBoot_free (direl); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "unrecognised object type 0x%x", cdirel->key.type); } } - grub_free (direl); - grub_free (origpath); - grub_free (path_alloc); - return GRUB_ERR_NONE; + VasEBoot_free (direl); + VasEBoot_free (origpath); + VasEBoot_free (path_alloc); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_btrfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_btrfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_btrfs_data *data = grub_btrfs_mount (device); - struct grub_btrfs_key key_in, key_out; - grub_err_t err; - grub_disk_addr_t elemaddr; - grub_size_t elemsize; - grub_size_t allocated = 0; - struct grub_btrfs_dir_item *direl = NULL; - struct grub_btrfs_leaf_descriptor desc; + struct VasEBoot_btrfs_data *data = VasEBoot_btrfs_mount (device); + struct VasEBoot_btrfs_key key_in, key_out; + VasEBoot_err_t err; + VasEBoot_disk_addr_t elemaddr; + VasEBoot_size_t elemsize; + VasEBoot_size_t allocated = 0; + struct VasEBoot_btrfs_dir_item *direl = NULL; + struct VasEBoot_btrfs_leaf_descriptor desc; int r = 0; - grub_uint64_t tree; - grub_uint8_t type; + VasEBoot_uint64_t tree; + VasEBoot_uint8_t type; if (!data) - return grub_errno; + return VasEBoot_errno; err = find_path (data, path, &key_in, &tree, &type); if (err) { - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); return err; } - if (type != GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY) + if (type != VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY) { - grub_btrfs_unmount (data); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_btrfs_unmount (data); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); } err = lower_bound (data, &key_in, &key_out, tree, &elemaddr, &elemsize, &desc, 0); if (err) { - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); return err; } - if (key_out.type != GRUB_BTRFS_ITEM_TYPE_DIR_ITEM + if (key_out.type != VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM || key_out.object_id != key_in.object_id) { r = next (data, &desc, &elemaddr, &elemsize, &key_out); @@ -1552,8 +1552,8 @@ grub_btrfs_dir (grub_device_t device, const char *path, } do { - struct grub_btrfs_dir_item *cdirel; - if (key_out.type != GRUB_BTRFS_ITEM_TYPE_DIR_ITEM + struct VasEBoot_btrfs_dir_item *cdirel; + if (key_out.type != VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM || key_out.object_id != key_in.object_id) { r = 0; @@ -1562,16 +1562,16 @@ grub_btrfs_dir (grub_device_t device, const char *path, if (elemsize > allocated) { allocated = 2 * elemsize; - grub_free (direl); - direl = grub_malloc (allocated + 1); + VasEBoot_free (direl); + direl = VasEBoot_malloc (allocated + 1); if (!direl) { - r = -grub_errno; + r = -VasEBoot_errno; break; } } - err = grub_btrfs_read_logical (data, elemaddr, direl, elemsize, 0); + err = VasEBoot_btrfs_read_logical (data, elemaddr, direl, elemsize, 0); if (err) { r = -err; @@ -1579,197 +1579,197 @@ grub_btrfs_dir (grub_device_t device, const char *path, } for (cdirel = direl; - (grub_uint8_t *) cdirel - (grub_uint8_t *) direl - < (grub_ssize_t) elemsize; - cdirel = (void *) ((grub_uint8_t *) (direl + 1) - + grub_le_to_cpu16 (cdirel->n) - + grub_le_to_cpu16 (cdirel->m))) + (VasEBoot_uint8_t *) cdirel - (VasEBoot_uint8_t *) direl + < (VasEBoot_ssize_t) elemsize; + cdirel = (void *) ((VasEBoot_uint8_t *) (direl + 1) + + VasEBoot_le_to_cpu16 (cdirel->n) + + VasEBoot_le_to_cpu16 (cdirel->m))) { char c; - struct grub_btrfs_inode inode; - struct grub_dirhook_info info; - err = grub_btrfs_read_inode (data, &inode, cdirel->key.object_id, + struct VasEBoot_btrfs_inode inode; + struct VasEBoot_dirhook_info info; + err = VasEBoot_btrfs_read_inode (data, &inode, cdirel->key.object_id, tree); - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); if (err) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; else { - info.mtime = grub_le_to_cpu64 (inode.mtime.sec); + info.mtime = VasEBoot_le_to_cpu64 (inode.mtime.sec); info.mtimeset = 1; } - c = cdirel->name[grub_le_to_cpu16 (cdirel->n)]; - cdirel->name[grub_le_to_cpu16 (cdirel->n)] = 0; - info.dir = (cdirel->type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY); + c = cdirel->name[VasEBoot_le_to_cpu16 (cdirel->n)]; + cdirel->name[VasEBoot_le_to_cpu16 (cdirel->n)] = 0; + info.dir = (cdirel->type == VasEBoot_BTRFS_DIR_ITEM_TYPE_DIRECTORY); if (hook (cdirel->name, &info, hook_data)) goto out; - cdirel->name[grub_le_to_cpu16 (cdirel->n)] = c; + cdirel->name[VasEBoot_le_to_cpu16 (cdirel->n)] = c; } r = next (data, &desc, &elemaddr, &elemsize, &key_out); } while (r > 0); out: - grub_free (direl); + VasEBoot_free (direl); free_iterator (&desc); - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); return -r; } -static grub_err_t -grub_btrfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_btrfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_btrfs_data *data = grub_btrfs_mount (file->device); - grub_err_t err; - struct grub_btrfs_inode inode; - grub_uint8_t type; - struct grub_btrfs_key key_in; + struct VasEBoot_btrfs_data *data = VasEBoot_btrfs_mount (file->device); + VasEBoot_err_t err; + struct VasEBoot_btrfs_inode inode; + VasEBoot_uint8_t type; + struct VasEBoot_btrfs_key key_in; if (!data) - return grub_errno; + return VasEBoot_errno; err = find_path (data, name, &key_in, &data->tree, &type); if (err) { - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); return err; } - if (type != GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR) + if (type != VasEBoot_BTRFS_DIR_ITEM_TYPE_REGULAR) { - grub_btrfs_unmount (data); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file")); + VasEBoot_btrfs_unmount (data); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a regular file")); } data->inode = key_in.object_id; - err = grub_btrfs_read_inode (data, &inode, data->inode, data->tree); + err = VasEBoot_btrfs_read_inode (data, &inode, data->inode, data->tree); if (err) { - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); return err; } file->data = data; - file->size = grub_le_to_cpu64 (inode.size); + file->size = VasEBoot_le_to_cpu64 (inode.size); return err; } -static grub_err_t -grub_btrfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_btrfs_close (VasEBoot_file_t file) { - grub_btrfs_unmount (file->data); + VasEBoot_btrfs_unmount (file->data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_btrfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_btrfs_data *data = file->data; + struct VasEBoot_btrfs_data *data = file->data; - return grub_btrfs_extent_read (data, data->inode, + return VasEBoot_btrfs_extent_read (data, data->inode, data->tree, file->offset, buf, len); } -static grub_err_t -grub_btrfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_btrfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_btrfs_data *data; + struct VasEBoot_btrfs_data *data; *uuid = NULL; - data = grub_btrfs_mount (device); + data = VasEBoot_btrfs_mount (device); if (!data) - return grub_errno; + return VasEBoot_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])); + *uuid = VasEBoot_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + VasEBoot_be_to_cpu16 (data->sblock.uuid[0]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[1]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[2]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[3]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[4]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[5]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[6]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[7])); - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_btrfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_btrfs_label (VasEBoot_device_t device, char **label) { - struct grub_btrfs_data *data; + struct VasEBoot_btrfs_data *data; *label = NULL; - data = grub_btrfs_mount (device); + data = VasEBoot_btrfs_mount (device); if (!data) - return grub_errno; + return VasEBoot_errno; - *label = grub_strndup (data->sblock.label, sizeof (data->sblock.label)); + *label = VasEBoot_strndup (data->sblock.label, sizeof (data->sblock.label)); - grub_btrfs_unmount (data); + VasEBoot_btrfs_unmount (data); - return grub_errno; + return VasEBoot_errno; } -#ifdef GRUB_UTIL -static grub_err_t -grub_btrfs_embed (grub_device_t device __attribute__ ((unused)), +#ifdef VasEBoot_UTIL +static VasEBoot_err_t +VasEBoot_btrfs_embed (VasEBoot_device_t device __attribute__ ((unused)), unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors) + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors) { unsigned i; - if (embed_type != GRUB_EMBED_PCBIOS) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (embed_type != VasEBoot_EMBED_PCBIOS) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "BtrFS currently supports only PC-BIOS embedding"); if (64 * 2 - 1 < *nsectors) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("your core.img is unusually large. " "It won't fit in the embedding area")); *nsectors = 64 * 2 - 1; if (*nsectors > max_nsectors) *nsectors = max_nsectors; - *sectors = grub_malloc (*nsectors * sizeof (**sectors)); + *sectors = VasEBoot_malloc (*nsectors * sizeof (**sectors)); if (!*sectors) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < *nsectors; i++) (*sectors)[i] = i + 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static struct grub_fs grub_btrfs_fs = { +static struct VasEBoot_fs VasEBoot_btrfs_fs = { .name = "btrfs", - .dir = grub_btrfs_dir, - .open = grub_btrfs_open, - .read = grub_btrfs_read, - .close = grub_btrfs_close, - .uuid = grub_btrfs_uuid, - .label = grub_btrfs_label, -#ifdef GRUB_UTIL - .embed = grub_btrfs_embed, + .dir = VasEBoot_btrfs_dir, + .open = VasEBoot_btrfs_open, + .read = VasEBoot_btrfs_read, + .close = VasEBoot_btrfs_close, + .uuid = VasEBoot_btrfs_uuid, + .label = VasEBoot_btrfs_label, +#ifdef VasEBoot_UTIL + .embed = VasEBoot_btrfs_embed, .reserved_first_sector = 1, .blocklist_install = 0, #endif }; -GRUB_MOD_INIT (btrfs) +VasEBoot_MOD_INIT (btrfs) { - grub_fs_register (&grub_btrfs_fs); + VasEBoot_fs_register (&VasEBoot_btrfs_fs); } -GRUB_MOD_FINI (btrfs) +VasEBoot_MOD_FINI (btrfs) { - grub_fs_unregister (&grub_btrfs_fs); + VasEBoot_fs_unregister (&VasEBoot_btrfs_fs); } diff --git a/VasEBoot-core/fs/cbfs.c b/VasEBoot-core/fs/cbfs.c index 0842701a6..7a9840b71 100644 --- a/VasEBoot-core/fs/cbfs.c +++ b/VasEBoot-core/fs/cbfs.c @@ -1,6 +1,6 @@ /* cbfs.c - cbfs and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,84 +17,84 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_archelp_data +struct VasEBoot_archelp_data { - grub_disk_t disk; - grub_off_t hofs, next_hofs; - grub_off_t dofs; - grub_off_t size; - grub_off_t cbfs_start; - grub_off_t cbfs_end; - grub_off_t cbfs_align; + VasEBoot_disk_t disk; + VasEBoot_off_t hofs, next_hofs; + VasEBoot_off_t dofs; + VasEBoot_off_t size; + VasEBoot_off_t cbfs_start; + VasEBoot_off_t cbfs_end; + VasEBoot_off_t cbfs_align; }; -static grub_err_t -grub_cbfs_find_file (struct grub_archelp_data *data, char **name, - grub_int32_t *mtime, - grub_uint32_t *mode) +static VasEBoot_err_t +VasEBoot_cbfs_find_file (struct VasEBoot_archelp_data *data, char **name, + VasEBoot_int32_t *mtime, + VasEBoot_uint32_t *mode) { - grub_size_t offset; + VasEBoot_size_t offset; for (;; data->dofs = data->hofs + offset, data->next_hofs = ALIGN_UP (data->dofs + data->size, data->cbfs_align)) { struct cbfs_file hd; - grub_size_t namesize; + VasEBoot_size_t namesize; data->hofs = data->next_hofs; if (data->hofs >= data->cbfs_end) { - *mode = GRUB_ARCHELP_ATTR_END; - return GRUB_ERR_NONE; + *mode = VasEBoot_ARCHELP_ATTR_END; + return VasEBoot_ERR_NONE; } - if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) - return grub_errno; + if (VasEBoot_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) + return VasEBoot_errno; - if (grub_memcmp (hd.magic, CBFS_FILE_MAGIC, sizeof (hd.magic)) != 0) + if (VasEBoot_memcmp (hd.magic, CBFS_FILE_MAGIC, sizeof (hd.magic)) != 0) { - *mode = GRUB_ARCHELP_ATTR_END; - return GRUB_ERR_NONE; + *mode = VasEBoot_ARCHELP_ATTR_END; + return VasEBoot_ERR_NONE; } - data->size = grub_be_to_cpu32 (hd.len); + data->size = VasEBoot_be_to_cpu32 (hd.len); (void) mtime; - offset = grub_be_to_cpu32 (hd.offset); + offset = VasEBoot_be_to_cpu32 (hd.offset); - *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME; + *mode = VasEBoot_ARCHELP_ATTR_FILE | VasEBoot_ARCHELP_ATTR_NOTIME; namesize = offset; if (namesize >= sizeof (hd)) namesize -= sizeof (hd); if (namesize == 0) continue; - *name = grub_malloc (namesize + 1); + *name = VasEBoot_malloc (namesize + 1); if (*name == NULL) - return grub_errno; + return VasEBoot_errno; - if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd), + if (VasEBoot_disk_read (data->disk, 0, data->hofs + sizeof (hd), namesize, *name)) { - grub_free (*name); - return grub_errno; + VasEBoot_free (*name); + return VasEBoot_errno; } if ((*name)[0] == '\0') { - grub_free (*name); + VasEBoot_free (*name); *name = NULL; continue; } @@ -103,91 +103,91 @@ grub_cbfs_find_file (struct grub_archelp_data *data, char **name, data->dofs = data->hofs + offset; data->next_hofs = ALIGN_UP (data->dofs + data->size, data->cbfs_align); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } static void -grub_cbfs_rewind (struct grub_archelp_data *data) +VasEBoot_cbfs_rewind (struct VasEBoot_archelp_data *data) { data->next_hofs = data->cbfs_start; } -static struct grub_archelp_ops arcops = +static struct VasEBoot_archelp_ops arcops = { - .find_file = grub_cbfs_find_file, - .rewind = grub_cbfs_rewind + .find_file = VasEBoot_cbfs_find_file, + .rewind = VasEBoot_cbfs_rewind }; static int validate_head (struct cbfs_header *head) { - return (head->magic == grub_cpu_to_be32_compile_time (CBFS_HEADER_MAGIC) + return (head->magic == VasEBoot_cpu_to_be32_compile_time (CBFS_HEADER_MAGIC) && (head->version - == grub_cpu_to_be32_compile_time (CBFS_HEADER_VERSION1) + == VasEBoot_cpu_to_be32_compile_time (CBFS_HEADER_VERSION1) || head->version - == grub_cpu_to_be32_compile_time (CBFS_HEADER_VERSION2)) - && (grub_be_to_cpu32 (head->bootblocksize) - < grub_be_to_cpu32 (head->romsize)) - && (grub_be_to_cpu32 (head->offset) - < grub_be_to_cpu32 (head->romsize)) - && (grub_be_to_cpu32 (head->offset) - + grub_be_to_cpu32 (head->bootblocksize) - < grub_be_to_cpu32 (head->romsize)) + == VasEBoot_cpu_to_be32_compile_time (CBFS_HEADER_VERSION2)) + && (VasEBoot_be_to_cpu32 (head->bootblocksize) + < VasEBoot_be_to_cpu32 (head->romsize)) + && (VasEBoot_be_to_cpu32 (head->offset) + < VasEBoot_be_to_cpu32 (head->romsize)) + && (VasEBoot_be_to_cpu32 (head->offset) + + VasEBoot_be_to_cpu32 (head->bootblocksize) + < VasEBoot_be_to_cpu32 (head->romsize)) && head->align != 0 && (head->align & (head->align - 1)) == 0 && head->romsize != 0); } -static struct grub_archelp_data * -grub_cbfs_mount (grub_disk_t disk) +static struct VasEBoot_archelp_data * +VasEBoot_cbfs_mount (VasEBoot_disk_t disk) { struct cbfs_file hd; - struct grub_archelp_data *data = NULL; - grub_uint32_t ptr; - grub_off_t header_off; + struct VasEBoot_archelp_data *data = NULL; + VasEBoot_uint32_t ptr; + VasEBoot_off_t header_off; struct cbfs_header head; - if (grub_disk_get_size (disk) == GRUB_DISK_SIZE_UNKNOWN) + if (VasEBoot_disk_get_size (disk) == VasEBoot_DISK_SIZE_UNKNOWN) goto fail; - if (grub_disk_read (disk, grub_disk_get_size (disk) - 1, - GRUB_DISK_SECTOR_SIZE - sizeof (ptr), + if (VasEBoot_disk_read (disk, VasEBoot_disk_get_size (disk) - 1, + VasEBoot_DISK_SECTOR_SIZE - sizeof (ptr), sizeof (ptr), &ptr)) goto fail; - ptr = grub_cpu_to_le32 (ptr); - header_off = (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS) - + (grub_int32_t) ptr; + ptr = VasEBoot_cpu_to_le32 (ptr); + header_off = (VasEBoot_disk_get_size (disk) << VasEBoot_DISK_SECTOR_BITS) + + (VasEBoot_int32_t) ptr; - if (grub_disk_read (disk, 0, header_off, + if (VasEBoot_disk_read (disk, 0, header_off, sizeof (head), &head)) goto fail; if (!validate_head (&head)) goto fail; - data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data)); + data = (struct VasEBoot_archelp_data *) VasEBoot_zalloc (sizeof (*data)); if (!data) goto fail; - data->cbfs_start = (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS) - - (grub_be_to_cpu32 (head.romsize) - grub_be_to_cpu32 (head.offset)); - data->cbfs_end = (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS) - - grub_be_to_cpu32 (head.bootblocksize); - data->cbfs_align = grub_be_to_cpu32 (head.align); + data->cbfs_start = (VasEBoot_disk_get_size (disk) << VasEBoot_DISK_SECTOR_BITS) + - (VasEBoot_be_to_cpu32 (head.romsize) - VasEBoot_be_to_cpu32 (head.offset)); + data->cbfs_end = (VasEBoot_disk_get_size (disk) << VasEBoot_DISK_SECTOR_BITS) + - VasEBoot_be_to_cpu32 (head.bootblocksize); + data->cbfs_align = VasEBoot_be_to_cpu32 (head.align); - if (data->cbfs_start >= (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS)) + if (data->cbfs_start >= (VasEBoot_disk_get_size (disk) << VasEBoot_DISK_SECTOR_BITS)) goto fail; - if (data->cbfs_end > (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS)) - data->cbfs_end = (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS); + if (data->cbfs_end > (VasEBoot_disk_get_size (disk) << VasEBoot_DISK_SECTOR_BITS)) + data->cbfs_end = (VasEBoot_disk_get_size (disk) << VasEBoot_DISK_SECTOR_BITS); data->next_hofs = data->cbfs_start; - if (grub_disk_read (disk, 0, data->cbfs_start, sizeof (hd), &hd)) + if (VasEBoot_disk_read (disk, 0, data->cbfs_start, sizeof (hd), &hd)) goto fail; - if (grub_memcmp (hd.magic, CBFS_FILE_MAGIC, sizeof (CBFS_FILE_MAGIC) - 1)) + if (VasEBoot_memcmp (hd.magic, CBFS_FILE_MAGIC, sizeof (CBFS_FILE_MAGIC) - 1)) goto fail; data->disk = disk; @@ -195,44 +195,44 @@ grub_cbfs_mount (grub_disk_t disk) return data; fail: - grub_free (data); - grub_error (GRUB_ERR_BAD_FS, "not a cbfs filesystem"); + VasEBoot_free (data); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a cbfs filesystem"); return 0; } -static grub_err_t -grub_cbfs_dir (grub_device_t device, const char *path_in, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_cbfs_dir (VasEBoot_device_t device, const char *path_in, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_archelp_data *data; - grub_err_t err; + struct VasEBoot_archelp_data *data; + VasEBoot_err_t err; - data = grub_cbfs_mount (device->disk); + data = VasEBoot_cbfs_mount (device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - err = grub_archelp_dir (data, &arcops, + err = VasEBoot_archelp_dir (data, &arcops, path_in, hook, hook_data); - grub_free (data); + VasEBoot_free (data); return err; } -static grub_err_t -grub_cbfs_open (grub_file_t file, const char *name_in) +static VasEBoot_err_t +VasEBoot_cbfs_open (VasEBoot_file_t file, const char *name_in) { - struct grub_archelp_data *data; - grub_err_t err; + struct VasEBoot_archelp_data *data; + VasEBoot_err_t err; - data = grub_cbfs_mount (file->device->disk); + data = VasEBoot_cbfs_mount (file->device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - err = grub_archelp_open (data, &arcops, name_in); + err = VasEBoot_archelp_open (data, &arcops, name_in); if (err) { - grub_free (data); + VasEBoot_free (data); } else { @@ -242,109 +242,109 @@ grub_cbfs_open (grub_file_t file, const char *name_in) return err; } -static grub_ssize_t -grub_cbfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_cbfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_archelp_data *data; - grub_ssize_t ret; + struct VasEBoot_archelp_data *data; + VasEBoot_ssize_t ret; data = file->data; data->disk->read_hook = file->read_hook; data->disk->read_hook_data = file->read_hook_data; - ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset, - len, buf)) ? -1 : (grub_ssize_t) len; + ret = (VasEBoot_disk_read (data->disk, 0, data->dofs + file->offset, + len, buf)) ? -1 : (VasEBoot_ssize_t) len; data->disk->read_hook = 0; return ret; } -static grub_err_t -grub_cbfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_cbfs_close (VasEBoot_file_t file) { - struct grub_archelp_data *data; + struct VasEBoot_archelp_data *data; data = file->data; - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -#if (defined (__i386__) || defined (__x86_64__)) && !defined (GRUB_UTIL) \ - && !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_XEN) +#if (defined (__i386__) || defined (__x86_64__)) && !defined (VasEBoot_UTIL) \ + && !defined (VasEBoot_MACHINE_EMU) && !defined (VasEBoot_MACHINE_XEN) static char *cbfsdisk_addr; -static grub_off_t cbfsdisk_size = 0; +static VasEBoot_off_t cbfsdisk_size = 0; static int -grub_cbfsdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_cbfsdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; return hook ("cbfsdisk", hook_data); } -static grub_err_t -grub_cbfsdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_cbfsdisk_open (const char *name, VasEBoot_disk_t disk) { - if (grub_strcmp (name, "cbfsdisk")) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a cbfsdisk"); + if (VasEBoot_strcmp (name, "cbfsdisk")) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a cbfsdisk"); - disk->total_sectors = cbfsdisk_size / GRUB_DISK_SECTOR_SIZE; - disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; + disk->total_sectors = cbfsdisk_size / VasEBoot_DISK_SECTOR_SIZE; + disk->max_agglomerate = VasEBoot_DISK_MAX_MAX_AGGLOMERATE; disk->id = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_cbfsdisk_close (grub_disk_t disk __attribute((unused))) +VasEBoot_cbfsdisk_close (VasEBoot_disk_t disk __attribute((unused))) { } -static grub_err_t -grub_cbfsdisk_read (grub_disk_t disk __attribute((unused)), - grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_cbfsdisk_read (VasEBoot_disk_t disk __attribute((unused)), + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { - grub_memcpy (buf, cbfsdisk_addr + (sector << GRUB_DISK_SECTOR_BITS), - size << GRUB_DISK_SECTOR_BITS); + VasEBoot_memcpy (buf, cbfsdisk_addr + (sector << VasEBoot_DISK_SECTOR_BITS), + size << VasEBoot_DISK_SECTOR_BITS); return 0; } -static grub_err_t -grub_cbfsdisk_write (grub_disk_t disk __attribute__ ((unused)), - grub_disk_addr_t sector __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cbfsdisk_write (VasEBoot_disk_t disk __attribute__ ((unused)), + VasEBoot_disk_addr_t sector __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused)), const char *buf __attribute__ ((unused))) { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "rom flashing isn't implemented yet"); } -static struct grub_disk_dev grub_cbfsdisk_dev = +static struct VasEBoot_disk_dev VasEBoot_cbfsdisk_dev = { .name = "cbfsdisk", - .id = GRUB_DISK_DEVICE_CBFSDISK_ID, - .iterate = grub_cbfsdisk_iterate, - .open = grub_cbfsdisk_open, - .close = grub_cbfsdisk_close, - .read = grub_cbfsdisk_read, - .write = grub_cbfsdisk_write, + .id = VasEBoot_DISK_DEVICE_CBFSDISK_ID, + .iterate = VasEBoot_cbfsdisk_iterate, + .open = VasEBoot_cbfsdisk_open, + .close = VasEBoot_cbfsdisk_close, + .read = VasEBoot_cbfsdisk_read, + .write = VasEBoot_cbfsdisk_write, .next = 0 }; static void init_cbfsdisk (void) { - grub_uint32_t ptr; + VasEBoot_uint32_t ptr; struct cbfs_header *head; - ptr = *(grub_uint32_t *) 0xfffffffc; - head = (struct cbfs_header *) (grub_addr_t) ptr; - grub_dprintf ("cbfs", "head=%p\n", head); + ptr = *(VasEBoot_uint32_t *) 0xfffffffc; + head = (struct cbfs_header *) (VasEBoot_addr_t) ptr; + VasEBoot_dprintf ("cbfs", "head=%p\n", head); /* coreboot current supports only ROMs <= 16 MiB. Bigger ROMs will have problems as RCBA is 18 MiB below end of 32-bit typically, @@ -352,15 +352,15 @@ init_cbfsdisk (void) reading ROMs through controller directly. */ if (ptr < 0xff000000 - || 0xffffffff - ptr < (grub_uint32_t) sizeof (*head) + 0xf + || 0xffffffff - ptr < (VasEBoot_uint32_t) sizeof (*head) + 0xf || !validate_head (head)) return; - cbfsdisk_size = ALIGN_UP (grub_be_to_cpu32 (head->romsize), - GRUB_DISK_SECTOR_SIZE); - cbfsdisk_addr = (void *) (grub_addr_t) (0x100000000ULL - cbfsdisk_size); + cbfsdisk_size = ALIGN_UP (VasEBoot_be_to_cpu32 (head->romsize), + VasEBoot_DISK_SECTOR_SIZE); + cbfsdisk_addr = (void *) (VasEBoot_addr_t) (0x100000000ULL - cbfsdisk_size); - grub_disk_dev_register (&grub_cbfsdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_cbfsdisk_dev); } static void @@ -368,35 +368,35 @@ fini_cbfsdisk (void) { if (! cbfsdisk_size) return; - grub_disk_dev_unregister (&grub_cbfsdisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_cbfsdisk_dev); } #endif -static struct grub_fs grub_cbfs_fs = { +static struct VasEBoot_fs VasEBoot_cbfs_fs = { .name = "cbfs", - .dir = grub_cbfs_dir, - .open = grub_cbfs_open, - .read = grub_cbfs_read, - .close = grub_cbfs_close, -#ifdef GRUB_UTIL + .dir = VasEBoot_cbfs_dir, + .open = VasEBoot_cbfs_open, + .read = VasEBoot_cbfs_read, + .close = VasEBoot_cbfs_close, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 0, #endif }; -GRUB_MOD_INIT (cbfs) +VasEBoot_MOD_INIT (cbfs) { -#if (defined (__i386__) || defined (__x86_64__)) && !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_XEN) +#if (defined (__i386__) || defined (__x86_64__)) && !defined (VasEBoot_UTIL) && !defined (VasEBoot_MACHINE_EMU) && !defined (VasEBoot_MACHINE_XEN) init_cbfsdisk (); #endif - grub_fs_register (&grub_cbfs_fs); + VasEBoot_fs_register (&VasEBoot_cbfs_fs); } -GRUB_MOD_FINI (cbfs) +VasEBoot_MOD_FINI (cbfs) { - grub_fs_unregister (&grub_cbfs_fs); -#if (defined (__i386__) || defined (__x86_64__)) && !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_XEN) + VasEBoot_fs_unregister (&VasEBoot_cbfs_fs); +#if (defined (__i386__) || defined (__x86_64__)) && !defined (VasEBoot_UTIL) && !defined (VasEBoot_MACHINE_EMU) && !defined (VasEBoot_MACHINE_XEN) fini_cbfsdisk (); #endif } diff --git a/VasEBoot-core/fs/cpio.c b/VasEBoot-core/fs/cpio.c index dab5f9898..9e20d7b86 100644 --- a/VasEBoot-core/fs/cpio.c +++ b/VasEBoot-core/fs/cpio.c @@ -1,6 +1,6 @@ /* cpio.c - cpio and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,32 +17,32 @@ * along with this program. If not, see . */ -#include +#include /* cpio support */ #define ALIGN_CPIO(x) (ALIGN_UP ((x), 2)) #define MAGIC "\xc7\x71" struct head { - grub_uint16_t magic[1]; - grub_uint16_t dev; - grub_uint16_t ino; - grub_uint16_t mode[1]; - grub_uint16_t uid; - grub_uint16_t gid; - grub_uint16_t nlink; - grub_uint16_t rdev; - grub_uint16_t mtime[2]; - grub_uint16_t namesize[1]; - grub_uint16_t filesize[2]; -} GRUB_PACKED; + VasEBoot_uint16_t magic[1]; + VasEBoot_uint16_t dev; + VasEBoot_uint16_t ino; + VasEBoot_uint16_t mode[1]; + VasEBoot_uint16_t uid; + VasEBoot_uint16_t gid; + VasEBoot_uint16_t nlink; + VasEBoot_uint16_t rdev; + VasEBoot_uint16_t mtime[2]; + VasEBoot_uint16_t namesize[1]; + VasEBoot_uint16_t filesize[2]; +} VasEBoot_PACKED; static inline unsigned long long -read_number (const grub_uint16_t *arr, grub_size_t size) +read_number (const VasEBoot_uint16_t *arr, VasEBoot_size_t size) { long long ret = 0; while (size--) - ret = (ret << 16) | grub_le_to_cpu16 (*arr++); + ret = (ret << 16) | VasEBoot_le_to_cpu16 (*arr++); return ret; } @@ -50,12 +50,12 @@ read_number (const grub_uint16_t *arr, grub_size_t size) #include "cpio_common.c" -GRUB_MOD_INIT (cpio) +VasEBoot_MOD_INIT (cpio) { - grub_fs_register (&grub_cpio_fs); + VasEBoot_fs_register (&VasEBoot_cpio_fs); } -GRUB_MOD_FINI (cpio) +VasEBoot_MOD_FINI (cpio) { - grub_fs_unregister (&grub_cpio_fs); + VasEBoot_fs_unregister (&VasEBoot_cpio_fs); } diff --git a/VasEBoot-core/fs/cpio_be.c b/VasEBoot-core/fs/cpio_be.c index 846548892..8a63acfee 100644 --- a/VasEBoot-core/fs/cpio_be.c +++ b/VasEBoot-core/fs/cpio_be.c @@ -1,6 +1,6 @@ /* cpio.c - cpio and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,32 +17,32 @@ * along with this program. If not, see . */ -#include +#include #define ALIGN_CPIO(x) (ALIGN_UP ((x), 2)) #define MAGIC "\x71\xc7" struct head { - grub_uint16_t magic[1]; - grub_uint16_t dev; - grub_uint16_t ino; - grub_uint16_t mode[1]; - grub_uint16_t uid; - grub_uint16_t gid; - grub_uint16_t nlink; - grub_uint16_t rdev; - grub_uint16_t mtime[2]; - grub_uint16_t namesize[1]; - grub_uint16_t filesize[2]; -} GRUB_PACKED; + VasEBoot_uint16_t magic[1]; + VasEBoot_uint16_t dev; + VasEBoot_uint16_t ino; + VasEBoot_uint16_t mode[1]; + VasEBoot_uint16_t uid; + VasEBoot_uint16_t gid; + VasEBoot_uint16_t nlink; + VasEBoot_uint16_t rdev; + VasEBoot_uint16_t mtime[2]; + VasEBoot_uint16_t namesize[1]; + VasEBoot_uint16_t filesize[2]; +} VasEBoot_PACKED; static inline unsigned long long -read_number (const grub_uint16_t *arr, grub_size_t size) +read_number (const VasEBoot_uint16_t *arr, VasEBoot_size_t size) { long long ret = 0; while (size--) - ret = (ret << 16) | grub_be_to_cpu16 (*arr++); + ret = (ret << 16) | VasEBoot_be_to_cpu16 (*arr++); return ret; } @@ -50,12 +50,12 @@ read_number (const grub_uint16_t *arr, grub_size_t size) #include "cpio_common.c" -GRUB_MOD_INIT (cpio_be) +VasEBoot_MOD_INIT (cpio_be) { - grub_fs_register (&grub_cpio_fs); + VasEBoot_fs_register (&VasEBoot_cpio_fs); } -GRUB_MOD_FINI (cpio_be) +VasEBoot_MOD_FINI (cpio_be) { - grub_fs_unregister (&grub_cpio_fs); + VasEBoot_fs_unregister (&VasEBoot_cpio_fs); } diff --git a/VasEBoot-core/fs/cpio_common.c b/VasEBoot-core/fs/cpio_common.c index 50fea47d1..240eccd27 100644 --- a/VasEBoot-core/fs/cpio_common.c +++ b/VasEBoot-core/fs/cpio_common.c @@ -1,6 +1,6 @@ /* cpio.c - cpio and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,44 +17,44 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_archelp_data +struct VasEBoot_archelp_data { - grub_disk_t disk; - grub_off_t hofs; - grub_off_t next_hofs; - grub_off_t dofs; - grub_off_t size; + VasEBoot_disk_t disk; + VasEBoot_off_t hofs; + VasEBoot_off_t next_hofs; + VasEBoot_off_t dofs; + VasEBoot_off_t size; }; -static grub_err_t -grub_cpio_find_file (struct grub_archelp_data *data, char **name, - grub_int32_t *mtime, grub_uint32_t *mode) +static VasEBoot_err_t +VasEBoot_cpio_find_file (struct VasEBoot_archelp_data *data, char **name, + VasEBoot_int32_t *mtime, VasEBoot_uint32_t *mode) { struct head hd; - grub_size_t namesize; - grub_uint32_t modeval; + VasEBoot_size_t namesize; + VasEBoot_uint32_t modeval; data->hofs = data->next_hofs; - if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) - return grub_errno; + if (VasEBoot_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) + return VasEBoot_errno; - if (grub_memcmp (hd.magic, MAGIC, sizeof (hd.magic)) != 0 + if (VasEBoot_memcmp (hd.magic, MAGIC, sizeof (hd.magic)) != 0 #ifdef MAGIC2 - && grub_memcmp (hd.magic, MAGIC2, sizeof (hd.magic)) != 0 + && VasEBoot_memcmp (hd.magic, MAGIC2, sizeof (hd.magic)) != 0 #endif ) - return grub_error (GRUB_ERR_BAD_FS, "invalid cpio archive"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid cpio archive"); data->size = read_number (hd.filesize, ARRAY_SIZE (hd.filesize)); if (mtime) *mtime = read_number (hd.mtime, ARRAY_SIZE (hd.mtime)); @@ -65,54 +65,54 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name, if (namesize >= 0x80000000) { /* Probably a corruption, don't attempt to recover. */ - *mode = GRUB_ARCHELP_ATTR_END; - return GRUB_ERR_NONE; + *mode = VasEBoot_ARCHELP_ATTR_END; + return VasEBoot_ERR_NONE; } *mode = modeval; - *name = grub_malloc (namesize + 1); + *name = VasEBoot_malloc (namesize + 1); if (*name == NULL) - return grub_errno; + return VasEBoot_errno; - if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd), + if (VasEBoot_disk_read (data->disk, 0, data->hofs + sizeof (hd), namesize, *name)) { - grub_free (*name); - return grub_errno; + VasEBoot_free (*name); + return VasEBoot_errno; } (*name)[namesize] = 0; if (data->size == 0 && modeval == 0 && namesize == 11 - && grub_memcmp(*name, "TRAILER!!!", 11) == 0) + && VasEBoot_memcmp(*name, "TRAILER!!!", 11) == 0) { - *mode = GRUB_ARCHELP_ATTR_END; - grub_free (*name); - return GRUB_ERR_NONE; + *mode = VasEBoot_ARCHELP_ATTR_END; + VasEBoot_free (*name); + return VasEBoot_ERR_NONE; } data->dofs = data->hofs + ALIGN_CPIO (sizeof (hd) + namesize); data->next_hofs = data->dofs + ALIGN_CPIO (data->size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static char * -grub_cpio_get_link_target (struct grub_archelp_data *data) +VasEBoot_cpio_get_link_target (struct VasEBoot_archelp_data *data) { char *ret; - grub_err_t err; + VasEBoot_err_t err; if (data->size == 0) - return grub_strdup (""); - ret = grub_malloc (data->size + 1); + return VasEBoot_strdup (""); + ret = VasEBoot_malloc (data->size + 1); if (!ret) return NULL; - err = grub_disk_read (data->disk, 0, data->dofs, data->size, + err = VasEBoot_disk_read (data->disk, 0, data->dofs, data->size, ret); if (err) { - grub_free (ret); + VasEBoot_free (ret); return NULL; } ret[data->size] = '\0'; @@ -120,35 +120,35 @@ grub_cpio_get_link_target (struct grub_archelp_data *data) } static void -grub_cpio_rewind (struct grub_archelp_data *data) +VasEBoot_cpio_rewind (struct VasEBoot_archelp_data *data) { data->next_hofs = 0; } -static struct grub_archelp_ops arcops = +static struct VasEBoot_archelp_ops arcops = { - .find_file = grub_cpio_find_file, - .get_link_target = grub_cpio_get_link_target, - .rewind = grub_cpio_rewind + .find_file = VasEBoot_cpio_find_file, + .get_link_target = VasEBoot_cpio_get_link_target, + .rewind = VasEBoot_cpio_rewind }; -static struct grub_archelp_data * -grub_cpio_mount (grub_disk_t disk) +static struct VasEBoot_archelp_data * +VasEBoot_cpio_mount (VasEBoot_disk_t disk) { struct head hd; - struct grub_archelp_data *data; + struct VasEBoot_archelp_data *data; - if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd)) + if (VasEBoot_disk_read (disk, 0, 0, sizeof (hd), &hd)) goto fail; - if (grub_memcmp (hd.magic, MAGIC, sizeof (MAGIC) - 1) + if (VasEBoot_memcmp (hd.magic, MAGIC, sizeof (MAGIC) - 1) #ifdef MAGIC2 - && grub_memcmp (hd.magic, MAGIC2, sizeof (MAGIC2) - 1) + && VasEBoot_memcmp (hd.magic, MAGIC2, sizeof (MAGIC2) - 1) #endif ) goto fail; - data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data)); + data = (struct VasEBoot_archelp_data *) VasEBoot_zalloc (sizeof (*data)); if (!data) goto fail; @@ -157,43 +157,43 @@ grub_cpio_mount (grub_disk_t disk) return data; fail: - grub_error (GRUB_ERR_BAD_FS, "not a " FSNAME " filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a " FSNAME " filesystem"); return 0; } -static grub_err_t -grub_cpio_dir (grub_device_t device, const char *path_in, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_cpio_dir (VasEBoot_device_t device, const char *path_in, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_archelp_data *data; - grub_err_t err; + struct VasEBoot_archelp_data *data; + VasEBoot_err_t err; - data = grub_cpio_mount (device->disk); + data = VasEBoot_cpio_mount (device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - err = grub_archelp_dir (data, &arcops, + err = VasEBoot_archelp_dir (data, &arcops, path_in, hook, hook_data); - grub_free (data); + VasEBoot_free (data); return err; } -static grub_err_t -grub_cpio_open (grub_file_t file, const char *name_in) +static VasEBoot_err_t +VasEBoot_cpio_open (VasEBoot_file_t file, const char *name_in) { - struct grub_archelp_data *data; - grub_err_t err; + struct VasEBoot_archelp_data *data; + VasEBoot_err_t err; - data = grub_cpio_mount (file->device->disk); + data = VasEBoot_cpio_mount (file->device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - err = grub_archelp_open (data, &arcops, name_in); + err = VasEBoot_archelp_open (data, &arcops, name_in); if (err) { - grub_free (data); + VasEBoot_free (data); } else { @@ -203,41 +203,41 @@ grub_cpio_open (grub_file_t file, const char *name_in) return err; } -static grub_ssize_t -grub_cpio_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_cpio_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_archelp_data *data; - grub_ssize_t ret; + struct VasEBoot_archelp_data *data; + VasEBoot_ssize_t ret; data = file->data; data->disk->read_hook = file->read_hook; data->disk->read_hook_data = file->read_hook_data; - ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset, - len, buf)) ? -1 : (grub_ssize_t) len; + ret = (VasEBoot_disk_read (data->disk, 0, data->dofs + file->offset, + len, buf)) ? -1 : (VasEBoot_ssize_t) len; data->disk->read_hook = 0; return ret; } -static grub_err_t -grub_cpio_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_cpio_close (VasEBoot_file_t file) { - struct grub_archelp_data *data; + struct VasEBoot_archelp_data *data; data = file->data; - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_cpio_fs = { +static struct VasEBoot_fs VasEBoot_cpio_fs = { .name = FSNAME, - .dir = grub_cpio_dir, - .open = grub_cpio_open, - .read = grub_cpio_read, - .close = grub_cpio_close, -#ifdef GRUB_UTIL + .dir = VasEBoot_cpio_dir, + .open = VasEBoot_cpio_open, + .read = VasEBoot_cpio_read, + .close = VasEBoot_cpio_close, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 0, #endif diff --git a/VasEBoot-core/fs/ext2.c b/VasEBoot-core/fs/ext2.c index cdce63bcc..b4fb47a9e 100644 --- a/VasEBoot-core/fs/ext2.c +++ b/VasEBoot-core/fs/ext2.c @@ -1,20 +1,20 @@ /* ext2.c - Second Extended filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Magic value used to identify an ext2 filesystem. */ @@ -38,37 +38,37 @@ #define FILETYPE_INO_DIRECTORY 0040000 #define FILETYPE_INO_SYMLINK 0120000 -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Log2 size of ext2 block in 512 blocks. */ #define LOG2_EXT2_BLOCK_SIZE(data) \ - (grub_le_to_cpu32 (data->sblock.log2_block_size) + 1) + (VasEBoot_le_to_cpu32 (data->sblock.log2_block_size) + 1) /* Log2 size of ext2 block in bytes. */ #define LOG2_BLOCK_SIZE(data) \ - (grub_le_to_cpu32 (data->sblock.log2_block_size) + 10) + (VasEBoot_le_to_cpu32 (data->sblock.log2_block_size) + 10) /* The size of an ext2 block in bytes. */ #define EXT2_BLOCK_SIZE(data) (1U << LOG2_BLOCK_SIZE (data)) /* The revision level. */ -#define EXT2_REVISION(data) grub_le_to_cpu32 (data->sblock.revision_level) +#define EXT2_REVISION(data) VasEBoot_le_to_cpu32 (data->sblock.revision_level) /* The inode size. */ #define EXT2_INODE_SIZE(data) \ (data->sblock.revision_level \ - == grub_cpu_to_le32_compile_time (EXT2_GOOD_OLD_REVISION) \ + == VasEBoot_cpu_to_le32_compile_time (EXT2_GOOD_OLD_REVISION) \ ? EXT2_GOOD_OLD_INODE_SIZE \ - : grub_le_to_cpu16 (data->sblock.inode_size)) + : VasEBoot_le_to_cpu16 (data->sblock.inode_size)) /* Superblock filesystem feature flags (RW compatible) * A filesystem with any of these enabled can be read and written by a driver @@ -141,208 +141,208 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define EXT4_EXTENTS_FLAG 0x80000 /* The ext2 superblock. */ -struct grub_ext2_sblock +struct VasEBoot_ext2_sblock { - grub_uint32_t total_inodes; - grub_uint32_t total_blocks; - grub_uint32_t reserved_blocks; - grub_uint32_t free_blocks; - grub_uint32_t free_inodes; - grub_uint32_t first_data_block; - grub_uint32_t log2_block_size; - grub_uint32_t log2_fragment_size; - grub_uint32_t blocks_per_group; - grub_uint32_t fragments_per_group; - grub_uint32_t inodes_per_group; - grub_uint32_t mtime; - grub_uint32_t utime; - grub_uint16_t mnt_count; - grub_uint16_t max_mnt_count; - grub_uint16_t magic; - grub_uint16_t fs_state; - grub_uint16_t error_handling; - grub_uint16_t minor_revision_level; - grub_uint32_t lastcheck; - grub_uint32_t checkinterval; - grub_uint32_t creator_os; - grub_uint32_t revision_level; - grub_uint16_t uid_reserved; - grub_uint16_t gid_reserved; - grub_uint32_t first_inode; - grub_uint16_t inode_size; - grub_uint16_t block_group_number; - grub_uint32_t feature_compatibility; - grub_uint32_t feature_incompat; - grub_uint32_t feature_ro_compat; - grub_uint16_t uuid[8]; + VasEBoot_uint32_t total_inodes; + VasEBoot_uint32_t total_blocks; + VasEBoot_uint32_t reserved_blocks; + VasEBoot_uint32_t free_blocks; + VasEBoot_uint32_t free_inodes; + VasEBoot_uint32_t first_data_block; + VasEBoot_uint32_t log2_block_size; + VasEBoot_uint32_t log2_fragment_size; + VasEBoot_uint32_t blocks_per_group; + VasEBoot_uint32_t fragments_per_group; + VasEBoot_uint32_t inodes_per_group; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t utime; + VasEBoot_uint16_t mnt_count; + VasEBoot_uint16_t max_mnt_count; + VasEBoot_uint16_t magic; + VasEBoot_uint16_t fs_state; + VasEBoot_uint16_t error_handling; + VasEBoot_uint16_t minor_revision_level; + VasEBoot_uint32_t lastcheck; + VasEBoot_uint32_t checkinterval; + VasEBoot_uint32_t creator_os; + VasEBoot_uint32_t revision_level; + VasEBoot_uint16_t uid_reserved; + VasEBoot_uint16_t gid_reserved; + VasEBoot_uint32_t first_inode; + VasEBoot_uint16_t inode_size; + VasEBoot_uint16_t block_group_number; + VasEBoot_uint32_t feature_compatibility; + VasEBoot_uint32_t feature_incompat; + VasEBoot_uint32_t feature_ro_compat; + VasEBoot_uint16_t uuid[8]; char volume_name[16]; char last_mounted_on[64]; - grub_uint32_t compression_info; - grub_uint8_t prealloc_blocks; - grub_uint8_t prealloc_dir_blocks; - grub_uint16_t reserved_gdt_blocks; - grub_uint8_t journal_uuid[16]; - grub_uint32_t journal_inum; - grub_uint32_t journal_dev; - grub_uint32_t last_orphan; - grub_uint32_t hash_seed[4]; - grub_uint8_t def_hash_version; - grub_uint8_t jnl_backup_type; - grub_uint16_t group_desc_size; - grub_uint32_t default_mount_opts; - grub_uint32_t first_meta_bg; - grub_uint32_t mkfs_time; - grub_uint32_t jnl_blocks[17]; + VasEBoot_uint32_t compression_info; + VasEBoot_uint8_t prealloc_blocks; + VasEBoot_uint8_t prealloc_dir_blocks; + VasEBoot_uint16_t reserved_gdt_blocks; + VasEBoot_uint8_t journal_uuid[16]; + VasEBoot_uint32_t journal_inum; + VasEBoot_uint32_t journal_dev; + VasEBoot_uint32_t last_orphan; + VasEBoot_uint32_t hash_seed[4]; + VasEBoot_uint8_t def_hash_version; + VasEBoot_uint8_t jnl_backup_type; + VasEBoot_uint16_t group_desc_size; + VasEBoot_uint32_t default_mount_opts; + VasEBoot_uint32_t first_meta_bg; + VasEBoot_uint32_t mkfs_time; + VasEBoot_uint32_t jnl_blocks[17]; }; /* The ext2 blockgroup. */ -struct grub_ext2_block_group +struct VasEBoot_ext2_block_group { - grub_uint32_t block_id; - grub_uint32_t inode_id; - grub_uint32_t inode_table_id; - grub_uint16_t free_blocks; - grub_uint16_t free_inodes; - grub_uint16_t used_dirs; - grub_uint16_t pad; - grub_uint32_t reserved[3]; - grub_uint32_t block_id_hi; - grub_uint32_t inode_id_hi; - grub_uint32_t inode_table_id_hi; - grub_uint16_t free_blocks_hi; - grub_uint16_t free_inodes_hi; - grub_uint16_t used_dirs_hi; - grub_uint16_t pad2; - grub_uint32_t reserved2[3]; + VasEBoot_uint32_t block_id; + VasEBoot_uint32_t inode_id; + VasEBoot_uint32_t inode_table_id; + VasEBoot_uint16_t free_blocks; + VasEBoot_uint16_t free_inodes; + VasEBoot_uint16_t used_dirs; + VasEBoot_uint16_t pad; + VasEBoot_uint32_t reserved[3]; + VasEBoot_uint32_t block_id_hi; + VasEBoot_uint32_t inode_id_hi; + VasEBoot_uint32_t inode_table_id_hi; + VasEBoot_uint16_t free_blocks_hi; + VasEBoot_uint16_t free_inodes_hi; + VasEBoot_uint16_t used_dirs_hi; + VasEBoot_uint16_t pad2; + VasEBoot_uint32_t reserved2[3]; }; /* The ext2 inode. */ -struct grub_ext2_inode +struct VasEBoot_ext2_inode { - grub_uint16_t mode; - grub_uint16_t uid; - grub_uint32_t size; - grub_uint32_t atime; - grub_uint32_t ctime; - grub_uint32_t mtime; - grub_uint32_t dtime; - grub_uint16_t gid; - grub_uint16_t nlinks; - grub_uint32_t blockcnt; /* Blocks of 512 bytes!! */ - grub_uint32_t flags; - grub_uint32_t osd1; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t uid; + VasEBoot_uint32_t size; + VasEBoot_uint32_t atime; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t dtime; + VasEBoot_uint16_t gid; + VasEBoot_uint16_t nlinks; + VasEBoot_uint32_t blockcnt; /* Blocks of 512 bytes!! */ + VasEBoot_uint32_t flags; + VasEBoot_uint32_t osd1; union { struct datablocks { - grub_uint32_t dir_blocks[INDIRECT_BLOCKS]; - grub_uint32_t indir_block; - grub_uint32_t double_indir_block; - grub_uint32_t triple_indir_block; + VasEBoot_uint32_t dir_blocks[INDIRECT_BLOCKS]; + VasEBoot_uint32_t indir_block; + VasEBoot_uint32_t double_indir_block; + VasEBoot_uint32_t triple_indir_block; } blocks; char symlink[60]; }; - grub_uint32_t version; - grub_uint32_t acl; - grub_uint32_t size_high; - grub_uint32_t fragment_addr; - grub_uint32_t osd2[3]; + VasEBoot_uint32_t version; + VasEBoot_uint32_t acl; + VasEBoot_uint32_t size_high; + VasEBoot_uint32_t fragment_addr; + VasEBoot_uint32_t osd2[3]; }; /* The header of an ext2 directory entry. */ struct ext2_dirent { - grub_uint32_t inode; - grub_uint16_t direntlen; + VasEBoot_uint32_t inode; + VasEBoot_uint16_t direntlen; #define MAX_NAMELEN 255 - grub_uint8_t namelen; - grub_uint8_t filetype; + VasEBoot_uint8_t namelen; + VasEBoot_uint8_t filetype; }; -struct grub_ext3_journal_header +struct VasEBoot_ext3_journal_header { - grub_uint32_t magic; - grub_uint32_t block_type; - grub_uint32_t sequence; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t block_type; + VasEBoot_uint32_t sequence; }; -struct grub_ext3_journal_revoke_header +struct VasEBoot_ext3_journal_revoke_header { - struct grub_ext3_journal_header header; - grub_uint32_t count; - grub_uint32_t data[0]; + struct VasEBoot_ext3_journal_header header; + VasEBoot_uint32_t count; + VasEBoot_uint32_t data[0]; }; -struct grub_ext3_journal_block_tag +struct VasEBoot_ext3_journal_block_tag { - grub_uint32_t block; - grub_uint32_t flags; + VasEBoot_uint32_t block; + VasEBoot_uint32_t flags; }; -struct grub_ext3_journal_sblock +struct VasEBoot_ext3_journal_sblock { - struct grub_ext3_journal_header header; - grub_uint32_t block_size; - grub_uint32_t maxlen; - grub_uint32_t first; - grub_uint32_t sequence; - grub_uint32_t start; + struct VasEBoot_ext3_journal_header header; + VasEBoot_uint32_t block_size; + VasEBoot_uint32_t maxlen; + VasEBoot_uint32_t first; + VasEBoot_uint32_t sequence; + VasEBoot_uint32_t start; }; #define EXT4_EXT_MAGIC 0xf30a -struct grub_ext4_extent_header +struct VasEBoot_ext4_extent_header { - grub_uint16_t magic; - grub_uint16_t entries; - grub_uint16_t max; - grub_uint16_t depth; - grub_uint32_t generation; + VasEBoot_uint16_t magic; + VasEBoot_uint16_t entries; + VasEBoot_uint16_t max; + VasEBoot_uint16_t depth; + VasEBoot_uint32_t generation; }; -struct grub_ext4_extent +struct VasEBoot_ext4_extent { - grub_uint32_t block; - grub_uint16_t len; - grub_uint16_t start_hi; - grub_uint32_t start; + VasEBoot_uint32_t block; + VasEBoot_uint16_t len; + VasEBoot_uint16_t start_hi; + VasEBoot_uint32_t start; }; -struct grub_ext4_extent_idx +struct VasEBoot_ext4_extent_idx { - grub_uint32_t block; - grub_uint32_t leaf; - grub_uint16_t leaf_hi; - grub_uint16_t unused; + VasEBoot_uint32_t block; + VasEBoot_uint32_t leaf; + VasEBoot_uint16_t leaf_hi; + VasEBoot_uint16_t unused; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_ext2_data *data; - struct grub_ext2_inode inode; + struct VasEBoot_ext2_data *data; + struct VasEBoot_ext2_inode inode; int ino; int inode_read; }; /* Information about a "mounted" ext2 filesystem. */ -struct grub_ext2_data +struct VasEBoot_ext2_data { - struct grub_ext2_sblock sblock; + struct VasEBoot_ext2_sblock sblock; int log_group_desc_size; - grub_disk_t disk; - struct grub_ext2_inode *inode; - struct grub_fshelp_node diropen; + VasEBoot_disk_t disk; + struct VasEBoot_ext2_inode *inode; + struct VasEBoot_fshelp_node diropen; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; /* Check is a = b^x for some x. */ static inline int -is_power_of (grub_uint64_t a, grub_uint32_t b) +is_power_of (VasEBoot_uint64_t a, VasEBoot_uint32_t b) { - grub_uint64_t c; + VasEBoot_uint64_t c; /* Prevent overflow assuming b < 8. */ if (a >= (1LL << 60)) return 0; @@ -352,10 +352,10 @@ is_power_of (grub_uint64_t a, grub_uint32_t b) static inline int -group_has_super_block (struct grub_ext2_data *data, grub_uint64_t group) +group_has_super_block (struct VasEBoot_ext2_data *data, VasEBoot_uint64_t group) { if (!(data->sblock.feature_ro_compat - & grub_cpu_to_le32_compile_time(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER))) + & VasEBoot_cpu_to_le32_compile_time(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER))) return 1; /* Algorithm looked up in Linux source. */ if (group <= 1) @@ -369,26 +369,26 @@ group_has_super_block (struct grub_ext2_data *data, grub_uint64_t group) /* Read into BLKGRP the blockgroup descriptor of blockgroup GROUP of the mounted filesystem DATA. */ -inline static grub_err_t -grub_ext2_blockgroup (struct grub_ext2_data *data, grub_uint64_t group, - struct grub_ext2_block_group *blkgrp) +inline static VasEBoot_err_t +VasEBoot_ext2_blockgroup (struct VasEBoot_ext2_data *data, VasEBoot_uint64_t group, + struct VasEBoot_ext2_block_group *blkgrp) { - grub_uint64_t full_offset = (group << data->log_group_desc_size); - grub_uint64_t block, offset; + VasEBoot_uint64_t full_offset = (group << data->log_group_desc_size); + VasEBoot_uint64_t block, offset; block = (full_offset >> LOG2_BLOCK_SIZE (data)); offset = (full_offset & ((1 << LOG2_BLOCK_SIZE (data)) - 1)); if ((data->sblock.feature_incompat - & grub_cpu_to_le32_compile_time (EXT2_FEATURE_INCOMPAT_META_BG)) - && block >= grub_le_to_cpu32(data->sblock.first_meta_bg)) + & VasEBoot_cpu_to_le32_compile_time (EXT2_FEATURE_INCOMPAT_META_BG)) + && block >= VasEBoot_le_to_cpu32(data->sblock.first_meta_bg)) { - grub_uint64_t first_block_group; + VasEBoot_uint64_t first_block_group; /* Find the first block group for which a descriptor is stored in given block. */ first_block_group = (block << (LOG2_BLOCK_SIZE (data) - data->log_group_desc_size)); block = (first_block_group - * grub_le_to_cpu32(data->sblock.blocks_per_group)); + * VasEBoot_le_to_cpu32(data->sblock.blocks_per_group)); if (group_has_super_block (data, first_block_group)) block++; @@ -396,50 +396,50 @@ grub_ext2_blockgroup (struct grub_ext2_data *data, grub_uint64_t group, else /* Superblock. */ block++; - return grub_disk_read (data->disk, - ((grub_le_to_cpu32 (data->sblock.first_data_block) + return VasEBoot_disk_read (data->disk, + ((VasEBoot_le_to_cpu32 (data->sblock.first_data_block) + block) << LOG2_EXT2_BLOCK_SIZE (data)), offset, - sizeof (struct grub_ext2_block_group), blkgrp); + sizeof (struct VasEBoot_ext2_block_group), blkgrp); } -static struct grub_ext4_extent_header * -grub_ext4_find_leaf (struct grub_ext2_data *data, - struct grub_ext4_extent_header *ext_block, - grub_uint32_t fileblock) +static struct VasEBoot_ext4_extent_header * +VasEBoot_ext4_find_leaf (struct VasEBoot_ext2_data *data, + struct VasEBoot_ext4_extent_header *ext_block, + VasEBoot_uint32_t fileblock) { - struct grub_ext4_extent_idx *index; + struct VasEBoot_ext4_extent_idx *index; void *buf = NULL; while (1) { int i; - grub_disk_addr_t block; + VasEBoot_disk_addr_t block; - index = (struct grub_ext4_extent_idx *) (ext_block + 1); + index = (struct VasEBoot_ext4_extent_idx *) (ext_block + 1); - if (ext_block->magic != grub_cpu_to_le16_compile_time (EXT4_EXT_MAGIC)) + if (ext_block->magic != VasEBoot_cpu_to_le16_compile_time (EXT4_EXT_MAGIC)) goto fail; if (ext_block->depth == 0) return ext_block; - for (i = 0; i < grub_le_to_cpu16 (ext_block->entries); i++) + for (i = 0; i < VasEBoot_le_to_cpu16 (ext_block->entries); i++) { - if (fileblock < grub_le_to_cpu32(index[i].block)) + if (fileblock < VasEBoot_le_to_cpu32(index[i].block)) break; } if (--i < 0) goto fail; - block = grub_le_to_cpu16 (index[i].leaf_hi); - block = (block << 32) | grub_le_to_cpu32 (index[i].leaf); + block = VasEBoot_le_to_cpu16 (index[i].leaf_hi); + block = (block << 32) | VasEBoot_le_to_cpu32 (index[i].leaf); if (!buf) - buf = grub_malloc (EXT2_BLOCK_SIZE(data)); + buf = VasEBoot_malloc (EXT2_BLOCK_SIZE(data)); if (!buf) goto fail; - if (grub_disk_read (data->disk, + if (VasEBoot_disk_read (data->disk, block << LOG2_EXT2_BLOCK_SIZE (data), 0, EXT2_BLOCK_SIZE(data), buf)) goto fail; @@ -447,73 +447,73 @@ grub_ext4_find_leaf (struct grub_ext2_data *data, ext_block = buf; } fail: - grub_free (buf); + VasEBoot_free (buf); return 0; } -static grub_disk_addr_t -grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_ext2_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { - struct grub_ext2_data *data = node->data; - struct grub_ext2_inode *inode = &node->inode; + struct VasEBoot_ext2_data *data = node->data; + struct VasEBoot_ext2_inode *inode = &node->inode; unsigned int blksz = EXT2_BLOCK_SIZE (data); - grub_disk_addr_t blksz_quarter = blksz / 4; + VasEBoot_disk_addr_t blksz_quarter = blksz / 4; int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); int log_perblock = log2_blksz + 9 - 2; - grub_uint32_t indir; + VasEBoot_uint32_t indir; int shift; - if (inode->flags & grub_cpu_to_le32_compile_time (EXT4_EXTENTS_FLAG)) + if (inode->flags & VasEBoot_cpu_to_le32_compile_time (EXT4_EXTENTS_FLAG)) { - struct grub_ext4_extent_header *leaf; - struct grub_ext4_extent *ext; + struct VasEBoot_ext4_extent_header *leaf; + struct VasEBoot_ext4_extent *ext; int i; - grub_disk_addr_t ret; + VasEBoot_disk_addr_t ret; - leaf = grub_ext4_find_leaf (data, (struct grub_ext4_extent_header *) inode->blocks.dir_blocks, fileblock); + leaf = VasEBoot_ext4_find_leaf (data, (struct VasEBoot_ext4_extent_header *) inode->blocks.dir_blocks, fileblock); if (! leaf) { - grub_error (GRUB_ERR_BAD_FS, "invalid extent"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid extent"); return -1; } - ext = (struct grub_ext4_extent *) (leaf + 1); - for (i = 0; i < grub_le_to_cpu16 (leaf->entries); i++) + ext = (struct VasEBoot_ext4_extent *) (leaf + 1); + for (i = 0; i < VasEBoot_le_to_cpu16 (leaf->entries); i++) { - if (fileblock < grub_le_to_cpu32 (ext[i].block)) + if (fileblock < VasEBoot_le_to_cpu32 (ext[i].block)) break; } if (--i >= 0) { - fileblock -= grub_le_to_cpu32 (ext[i].block); - if (fileblock >= grub_le_to_cpu16 (ext[i].len)) + fileblock -= VasEBoot_le_to_cpu32 (ext[i].block); + if (fileblock >= VasEBoot_le_to_cpu16 (ext[i].len)) ret = 0; else { - grub_disk_addr_t start; + VasEBoot_disk_addr_t start; - start = grub_le_to_cpu16 (ext[i].start_hi); - start = (start << 32) + grub_le_to_cpu32 (ext[i].start); + start = VasEBoot_le_to_cpu16 (ext[i].start_hi); + start = (start << 32) + VasEBoot_le_to_cpu32 (ext[i].start); ret = fileblock + start; } } else { - grub_error (GRUB_ERR_BAD_FS, "something wrong with extent"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "something wrong with extent"); ret = -1; } - if (leaf != (struct grub_ext4_extent_header *) inode->blocks.dir_blocks) - grub_free (leaf); + if (leaf != (struct VasEBoot_ext4_extent_header *) inode->blocks.dir_blocks) + VasEBoot_free (leaf); return ret; } /* Direct blocks. */ if (fileblock < INDIRECT_BLOCKS) - return grub_le_to_cpu32 (inode->blocks.dir_blocks[fileblock]); + return VasEBoot_le_to_cpu32 (inode->blocks.dir_blocks[fileblock]); fileblock -= INDIRECT_BLOCKS; /* Indirect. */ if (fileblock < blksz_quarter) @@ -538,7 +538,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) shift = 2; goto indirect; } - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, "ext2fs doesn't support quadruple indirect blocks"); return -1; @@ -548,8 +548,8 @@ indirect: (i.e. filled with zeros.) */ if (indir == 0) return 0; - if (grub_disk_read (data->disk, - ((grub_disk_addr_t) grub_le_to_cpu32 (indir)) + if (VasEBoot_disk_read (data->disk, + ((VasEBoot_disk_addr_t) VasEBoot_le_to_cpu32 (indir)) << log2_blksz, ((fileblock >> (log_perblock * shift)) & ((1 << log_perblock) - 1)) @@ -558,115 +558,115 @@ indirect: return -1; } while (shift--); - return grub_le_to_cpu32 (indir); + return VasEBoot_le_to_cpu32 (indir); } /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_ext2_read_file (grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_ext2_read_file (VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - return grub_fshelp_read_file (node->data->disk, node, + return VasEBoot_fshelp_read_file (node->data->disk, node, read_hook, read_hook_data, - pos, len, buf, grub_ext2_read_block, - grub_cpu_to_le32 (node->inode.size) - | (((grub_off_t) grub_cpu_to_le32 (node->inode.size_high)) << 32), + pos, len, buf, VasEBoot_ext2_read_block, + VasEBoot_cpu_to_le32 (node->inode.size) + | (((VasEBoot_off_t) VasEBoot_cpu_to_le32 (node->inode.size_high)) << 32), LOG2_EXT2_BLOCK_SIZE (node->data), 0); } /* Read the inode INO for the file described by DATA into INODE. */ -static grub_err_t -grub_ext2_read_inode (struct grub_ext2_data *data, - int ino, struct grub_ext2_inode *inode) +static VasEBoot_err_t +VasEBoot_ext2_read_inode (struct VasEBoot_ext2_data *data, + int ino, struct VasEBoot_ext2_inode *inode) { - struct grub_ext2_block_group blkgrp; - struct grub_ext2_sblock *sblock = &data->sblock; + struct VasEBoot_ext2_block_group blkgrp; + struct VasEBoot_ext2_sblock *sblock = &data->sblock; int inodes_per_block; unsigned int blkno; unsigned int blkoff; - grub_disk_addr_t base; + VasEBoot_disk_addr_t base; /* It is easier to calculate if the first inode is 0. */ ino--; - grub_ext2_blockgroup (data, - ino / grub_le_to_cpu32 (sblock->inodes_per_group), + VasEBoot_ext2_blockgroup (data, + ino / VasEBoot_le_to_cpu32 (sblock->inodes_per_group), &blkgrp); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; inodes_per_block = EXT2_BLOCK_SIZE (data) / EXT2_INODE_SIZE (data); - blkno = (ino % grub_le_to_cpu32 (sblock->inodes_per_group)) + blkno = (ino % VasEBoot_le_to_cpu32 (sblock->inodes_per_group)) / inodes_per_block; - blkoff = (ino % grub_le_to_cpu32 (sblock->inodes_per_group)) + blkoff = (ino % VasEBoot_le_to_cpu32 (sblock->inodes_per_group)) % inodes_per_block; - base = grub_le_to_cpu32 (blkgrp.inode_table_id); + base = VasEBoot_le_to_cpu32 (blkgrp.inode_table_id); if (data->log_group_desc_size >= 6) - base |= (((grub_disk_addr_t) grub_le_to_cpu32 (blkgrp.inode_table_id_hi)) + base |= (((VasEBoot_disk_addr_t) VasEBoot_le_to_cpu32 (blkgrp.inode_table_id_hi)) << 32); /* Read the inode. */ - if (grub_disk_read (data->disk, + if (VasEBoot_disk_read (data->disk, ((base + blkno) << LOG2_EXT2_BLOCK_SIZE (data)), EXT2_INODE_SIZE (data) * blkoff, - sizeof (struct grub_ext2_inode), inode)) - return grub_errno; + sizeof (struct VasEBoot_ext2_inode), inode)) + return VasEBoot_errno; return 0; } -static struct grub_ext2_data * -grub_ext2_mount (grub_disk_t disk) +static struct VasEBoot_ext2_data * +VasEBoot_ext2_mount (VasEBoot_disk_t disk) { - struct grub_ext2_data *data; + struct VasEBoot_ext2_data *data; - data = grub_malloc (sizeof (struct grub_ext2_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_ext2_data)); if (!data) return 0; /* Read the superblock. */ - grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_ext2_sblock), + VasEBoot_disk_read (disk, 1 * 2, 0, sizeof (struct VasEBoot_ext2_sblock), &data->sblock); - if (grub_errno) + if (VasEBoot_errno) goto fail; /* Make sure this is an ext2 filesystem. */ - if (data->sblock.magic != grub_cpu_to_le16_compile_time (EXT2_MAGIC) - || grub_le_to_cpu32 (data->sblock.log2_block_size) >= 16 + if (data->sblock.magic != VasEBoot_cpu_to_le16_compile_time (EXT2_MAGIC) + || VasEBoot_le_to_cpu32 (data->sblock.log2_block_size) >= 16 || data->sblock.inodes_per_group == 0 /* 20 already means 1GiB blocks. We don't want to deal with blocks overflowing int32. */ - || grub_le_to_cpu32 (data->sblock.log2_block_size) > 20 + || VasEBoot_le_to_cpu32 (data->sblock.log2_block_size) > 20 || EXT2_INODE_SIZE (data) == 0 || EXT2_BLOCK_SIZE (data) / EXT2_INODE_SIZE (data) == 0) { - grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an ext2 filesystem"); goto fail; } /* Check the FS doesn't have feature bits enabled that we don't support. */ - if (data->sblock.revision_level != grub_cpu_to_le32_compile_time (EXT2_GOOD_OLD_REVISION) + if (data->sblock.revision_level != VasEBoot_cpu_to_le32_compile_time (EXT2_GOOD_OLD_REVISION) && (data->sblock.feature_incompat - & grub_cpu_to_le32_compile_time (~(EXT2_DRIVER_SUPPORTED_INCOMPAT + & VasEBoot_cpu_to_le32_compile_time (~(EXT2_DRIVER_SUPPORTED_INCOMPAT | EXT2_DRIVER_IGNORED_INCOMPAT)))) { - grub_error (GRUB_ERR_BAD_FS, "filesystem has unsupported incompatible features"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "filesystem has unsupported incompatible features"); goto fail; } - if (data->sblock.revision_level != grub_cpu_to_le32_compile_time (EXT2_GOOD_OLD_REVISION) + if (data->sblock.revision_level != VasEBoot_cpu_to_le32_compile_time (EXT2_GOOD_OLD_REVISION) && (data->sblock.feature_incompat - & grub_cpu_to_le32_compile_time (EXT4_FEATURE_INCOMPAT_64BIT)) + & VasEBoot_cpu_to_le32_compile_time (EXT4_FEATURE_INCOMPAT_64BIT)) && data->sblock.group_desc_size != 0 && ((data->sblock.group_desc_size & (data->sblock.group_desc_size - 1)) == 0) - && (data->sblock.group_desc_size & grub_cpu_to_le16_compile_time (0x1fe0))) + && (data->sblock.group_desc_size & VasEBoot_cpu_to_le16_compile_time (0x1fe0))) { - grub_uint16_t b = grub_le_to_cpu16 (data->sblock.group_desc_size); + VasEBoot_uint16_t b = VasEBoot_le_to_cpu16 (data->sblock.group_desc_size); for (data->log_group_desc_size = 0; b != (1 << data->log_group_desc_size); data->log_group_desc_size++); } @@ -681,82 +681,82 @@ grub_ext2_mount (grub_disk_t disk) data->inode = &data->diropen.inode; - grub_ext2_read_inode (data, 2, data->inode); - if (grub_errno) + VasEBoot_ext2_read_inode (data, 2, data->inode); + if (VasEBoot_errno) goto fail; return data; fail: - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an ext2 filesystem"); - grub_free (data); + VasEBoot_free (data); return 0; } static char * -grub_ext2_read_symlink (grub_fshelp_node_t node) +VasEBoot_ext2_read_symlink (VasEBoot_fshelp_node_t node) { char *symlink; - struct grub_fshelp_node *diro = node; + struct VasEBoot_fshelp_node *diro = node; if (! diro->inode_read) { - grub_ext2_read_inode (diro->data, diro->ino, &diro->inode); - if (grub_errno) + VasEBoot_ext2_read_inode (diro->data, diro->ino, &diro->inode); + if (VasEBoot_errno) return 0; } - symlink = grub_malloc (grub_le_to_cpu32 (diro->inode.size) + 1); + symlink = VasEBoot_malloc (VasEBoot_le_to_cpu32 (diro->inode.size) + 1); if (! symlink) return 0; /* If the filesize of the symlink is bigger than 60 the symlink is stored in a separate block, otherwise it is stored in the inode. */ - if (grub_le_to_cpu32 (diro->inode.size) <= sizeof (diro->inode.symlink)) - grub_memcpy (symlink, + if (VasEBoot_le_to_cpu32 (diro->inode.size) <= sizeof (diro->inode.symlink)) + VasEBoot_memcpy (symlink, diro->inode.symlink, - grub_le_to_cpu32 (diro->inode.size)); + VasEBoot_le_to_cpu32 (diro->inode.size)); else { - grub_ext2_read_file (diro, 0, 0, 0, - grub_le_to_cpu32 (diro->inode.size), + VasEBoot_ext2_read_file (diro, 0, 0, 0, + VasEBoot_le_to_cpu32 (diro->inode.size), symlink); - if (grub_errno) + if (VasEBoot_errno) { - grub_free (symlink); + VasEBoot_free (symlink); return 0; } } - symlink[grub_le_to_cpu32 (diro->inode.size)] = '\0'; + symlink[VasEBoot_le_to_cpu32 (diro->inode.size)] = '\0'; return symlink; } static int -grub_ext2_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_ext2_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { unsigned int fpos = 0; - struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; + struct VasEBoot_fshelp_node *diro = (struct VasEBoot_fshelp_node *) dir; if (! diro->inode_read) { - grub_ext2_read_inode (diro->data, diro->ino, &diro->inode); - if (grub_errno) + VasEBoot_ext2_read_inode (diro->data, diro->ino, &diro->inode); + if (VasEBoot_errno) return 0; } /* Search the file. */ - while (fpos < grub_le_to_cpu32 (diro->inode.size)) + while (fpos < VasEBoot_le_to_cpu32 (diro->inode.size)) { struct ext2_dirent dirent; - grub_ext2_read_file (diro, 0, 0, fpos, sizeof (struct ext2_dirent), + VasEBoot_ext2_read_file (diro, 0, 0, fpos, sizeof (struct ext2_dirent), (char *) &dirent); - if (grub_errno) + if (VasEBoot_errno) return 0; if (dirent.direntlen == 0) @@ -765,20 +765,20 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, if (dirent.inode != 0 && dirent.namelen != 0) { char filename[MAX_NAMELEN + 1]; - struct grub_fshelp_node *fdiro; - enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN; + struct VasEBoot_fshelp_node *fdiro; + enum VasEBoot_fshelp_filetype type = VasEBoot_FSHELP_UNKNOWN; - grub_ext2_read_file (diro, 0, 0, fpos + sizeof (struct ext2_dirent), + VasEBoot_ext2_read_file (diro, 0, 0, fpos + sizeof (struct ext2_dirent), dirent.namelen, filename); - if (grub_errno) + if (VasEBoot_errno) return 0; - fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); + fdiro = VasEBoot_malloc (sizeof (struct VasEBoot_fshelp_node)); if (! fdiro) return 0; fdiro->data = diro->data; - fdiro->ino = grub_le_to_cpu32 (dirent.inode); + fdiro->ino = VasEBoot_le_to_cpu32 (dirent.inode); filename[dirent.namelen] = '\0'; @@ -787,83 +787,83 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, fdiro->inode_read = 0; if (dirent.filetype == FILETYPE_DIRECTORY) - type = GRUB_FSHELP_DIR; + type = VasEBoot_FSHELP_DIR; else if (dirent.filetype == FILETYPE_SYMLINK) - type = GRUB_FSHELP_SYMLINK; + type = VasEBoot_FSHELP_SYMLINK; else if (dirent.filetype == FILETYPE_REG) - type = GRUB_FSHELP_REG; + type = VasEBoot_FSHELP_REG; } else { /* The filetype can not be read from the dirent, read the inode to get more information. */ - grub_ext2_read_inode (diro->data, - grub_le_to_cpu32 (dirent.inode), + VasEBoot_ext2_read_inode (diro->data, + VasEBoot_le_to_cpu32 (dirent.inode), &fdiro->inode); - if (grub_errno) + if (VasEBoot_errno) { - grub_free (fdiro); + VasEBoot_free (fdiro); return 0; } fdiro->inode_read = 1; - if ((grub_le_to_cpu16 (fdiro->inode.mode) + if ((VasEBoot_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY) - type = GRUB_FSHELP_DIR; - else if ((grub_le_to_cpu16 (fdiro->inode.mode) + type = VasEBoot_FSHELP_DIR; + else if ((VasEBoot_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_SYMLINK) - type = GRUB_FSHELP_SYMLINK; - else if ((grub_le_to_cpu16 (fdiro->inode.mode) + type = VasEBoot_FSHELP_SYMLINK; + else if ((VasEBoot_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_REG) - type = GRUB_FSHELP_REG; + type = VasEBoot_FSHELP_REG; } if (hook (filename, type, fdiro, hook_data)) return 1; } - fpos += grub_le_to_cpu16 (dirent.direntlen); + fpos += VasEBoot_le_to_cpu16 (dirent.direntlen); } return 0; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_ext2_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_ext2_open (struct VasEBoot_file *file, const char *name) { - struct grub_ext2_data *data; - struct grub_fshelp_node *fdiro = 0; - grub_err_t err; + struct VasEBoot_ext2_data *data; + struct VasEBoot_fshelp_node *fdiro = 0; + VasEBoot_err_t err; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ext2_mount (file->device->disk); + data = VasEBoot_ext2_mount (file->device->disk); if (! data) { - err = grub_errno; + err = VasEBoot_errno; goto fail; } - err = grub_fshelp_find_file (name, &data->diropen, &fdiro, - grub_ext2_iterate_dir, - grub_ext2_read_symlink, GRUB_FSHELP_REG); + err = VasEBoot_fshelp_find_file (name, &data->diropen, &fdiro, + VasEBoot_ext2_iterate_dir, + VasEBoot_ext2_read_symlink, VasEBoot_FSHELP_REG); if (err) goto fail; if (! fdiro->inode_read) { - err = grub_ext2_read_inode (data, fdiro->ino, &fdiro->inode); + err = VasEBoot_ext2_read_inode (data, fdiro->ino, &fdiro->inode); if (err) goto fail; } - grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_ext2_inode)); - grub_free (fdiro); + VasEBoot_memcpy (data->inode, &fdiro->inode, sizeof (struct VasEBoot_ext2_inode)); + VasEBoot_free (fdiro); - file->size = grub_le_to_cpu32 (data->inode->size); - file->size |= ((grub_off_t) grub_le_to_cpu32 (data->inode->size_high)) << 32; + file->size = VasEBoot_le_to_cpu32 (data->inode->size); + file->size |= ((VasEBoot_off_t) VasEBoot_le_to_cpu32 (data->inode->size_high)) << 32; file->data = data; file->offset = 0; @@ -871,207 +871,207 @@ grub_ext2_open (struct grub_file *file, const char *name) fail: if (fdiro != &data->diropen) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); return err; } -static grub_err_t -grub_ext2_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_ext2_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read LEN bytes data from FILE into BUF. */ -static grub_ssize_t -grub_ext2_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_ext2_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_ext2_data *data = (struct grub_ext2_data *) file->data; + struct VasEBoot_ext2_data *data = (struct VasEBoot_ext2_data *) file->data; - return grub_ext2_read_file (&data->diropen, + return VasEBoot_ext2_read_file (&data->diropen, file->read_hook, file->read_hook_data, file->offset, len, buf); } -/* Context for grub_ext2_dir. */ -struct grub_ext2_dir_ctx +/* Context for VasEBoot_ext2_dir. */ +struct VasEBoot_ext2_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; - struct grub_ext2_data *data; + struct VasEBoot_ext2_data *data; }; -/* Helper for grub_ext2_dir. */ +/* Helper for VasEBoot_ext2_dir. */ static int -grub_ext2_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_ext2_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_ext2_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_ext2_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); if (! node->inode_read) { - grub_ext2_read_inode (ctx->data, node->ino, &node->inode); - if (!grub_errno) + VasEBoot_ext2_read_inode (ctx->data, node->ino, &node->inode); + if (!VasEBoot_errno) node->inode_read = 1; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (node->inode_read) { info.mtimeset = 1; - info.mtime = grub_le_to_cpu32 (node->inode.mtime); + info.mtime = VasEBoot_le_to_cpu32 (node->inode.mtime); } - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); - grub_free (node); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_ext2_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, +static VasEBoot_err_t +VasEBoot_ext2_dir (VasEBoot_device_t device, const char *path, VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_ext2_dir_ctx ctx = { + struct VasEBoot_ext2_dir_ctx ctx = { .hook = hook, .hook_data = hook_data }; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - ctx.data = grub_ext2_mount (device->disk); + ctx.data = VasEBoot_ext2_mount (device->disk); if (! ctx.data) goto fail; - grub_fshelp_find_file (path, &ctx.data->diropen, &fdiro, - grub_ext2_iterate_dir, grub_ext2_read_symlink, - GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &ctx.data->diropen, &fdiro, + VasEBoot_ext2_iterate_dir, VasEBoot_ext2_read_symlink, + VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_ext2_iterate_dir (fdiro, grub_ext2_dir_iter, &ctx); + VasEBoot_ext2_iterate_dir (fdiro, VasEBoot_ext2_dir_iter, &ctx); fail: if (fdiro != &ctx.data->diropen) - grub_free (fdiro); - grub_free (ctx.data); + VasEBoot_free (fdiro); + VasEBoot_free (ctx.data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_ext2_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_ext2_label (VasEBoot_device_t device, char **label) { - struct grub_ext2_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_ext2_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ext2_mount (disk); + data = VasEBoot_ext2_mount (disk); if (data) - *label = grub_strndup (data->sblock.volume_name, + *label = VasEBoot_strndup (data->sblock.volume_name, sizeof (data->sblock.volume_name)); else *label = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_ext2_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_ext2_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_ext2_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_ext2_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ext2_mount (disk); + data = VasEBoot_ext2_mount (disk); if (data) { - *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])); + *uuid = VasEBoot_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + VasEBoot_be_to_cpu16 (data->sblock.uuid[0]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[1]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[2]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[3]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[4]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[5]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[6]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[7])); } else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } /* Get mtime. */ -static grub_err_t -grub_ext2_mtime (grub_device_t device, grub_int32_t *tm) +static VasEBoot_err_t +VasEBoot_ext2_mtime (VasEBoot_device_t device, VasEBoot_int32_t *tm) { - struct grub_ext2_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_ext2_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ext2_mount (disk); + data = VasEBoot_ext2_mount (disk); if (!data) *tm = 0; else - *tm = grub_le_to_cpu32 (data->sblock.utime); + *tm = VasEBoot_le_to_cpu32 (data->sblock.utime); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_ext2_fs = +static struct VasEBoot_fs VasEBoot_ext2_fs = { .name = "ext2", - .dir = grub_ext2_dir, - .open = grub_ext2_open, - .read = grub_ext2_read, - .close = grub_ext2_close, - .label = grub_ext2_label, - .uuid = grub_ext2_uuid, - .mtime = grub_ext2_mtime, -#ifdef GRUB_UTIL + .dir = VasEBoot_ext2_dir, + .open = VasEBoot_ext2_open, + .read = VasEBoot_ext2_read, + .close = VasEBoot_ext2_close, + .label = VasEBoot_ext2_label, + .uuid = VasEBoot_ext2_uuid, + .mtime = VasEBoot_ext2_mtime, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(ext2) +VasEBoot_MOD_INIT(ext2) { - grub_fs_register (&grub_ext2_fs); + VasEBoot_fs_register (&VasEBoot_ext2_fs); my_mod = mod; } -GRUB_MOD_FINI(ext2) +VasEBoot_MOD_FINI(ext2) { - grub_fs_unregister (&grub_ext2_fs); + VasEBoot_fs_unregister (&VasEBoot_ext2_fs); } diff --git a/VasEBoot-core/fs/fat.c b/VasEBoot-core/fs/fat.c index 8d8dc35ce..47f792099 100644 --- a/VasEBoot-core/fs/fat.c +++ b/VasEBoot-core/fs/fat.c @@ -1,73 +1,73 @@ /* fat.c - FAT filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifndef MODE_EXFAT -#include +#include #else -#include +#include #endif -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); enum { - GRUB_FAT_ATTR_READ_ONLY = 0x01, - GRUB_FAT_ATTR_HIDDEN = 0x02, - GRUB_FAT_ATTR_SYSTEM = 0x04, + VasEBoot_FAT_ATTR_READ_ONLY = 0x01, + VasEBoot_FAT_ATTR_HIDDEN = 0x02, + VasEBoot_FAT_ATTR_SYSTEM = 0x04, #ifndef MODE_EXFAT - GRUB_FAT_ATTR_VOLUME_ID = 0x08, + VasEBoot_FAT_ATTR_VOLUME_ID = 0x08, #endif - GRUB_FAT_ATTR_DIRECTORY = 0x10, - GRUB_FAT_ATTR_ARCHIVE = 0x20, + VasEBoot_FAT_ATTR_DIRECTORY = 0x10, + VasEBoot_FAT_ATTR_ARCHIVE = 0x20, #ifndef MODE_EXFAT - GRUB_FAT_ATTR_LONG_NAME = (GRUB_FAT_ATTR_READ_ONLY - | GRUB_FAT_ATTR_HIDDEN - | GRUB_FAT_ATTR_SYSTEM - | GRUB_FAT_ATTR_VOLUME_ID), + VasEBoot_FAT_ATTR_LONG_NAME = (VasEBoot_FAT_ATTR_READ_ONLY + | VasEBoot_FAT_ATTR_HIDDEN + | VasEBoot_FAT_ATTR_SYSTEM + | VasEBoot_FAT_ATTR_VOLUME_ID), #endif - GRUB_FAT_ATTR_VALID = (GRUB_FAT_ATTR_READ_ONLY - | GRUB_FAT_ATTR_HIDDEN - | GRUB_FAT_ATTR_SYSTEM - | GRUB_FAT_ATTR_DIRECTORY - | GRUB_FAT_ATTR_ARCHIVE + VasEBoot_FAT_ATTR_VALID = (VasEBoot_FAT_ATTR_READ_ONLY + | VasEBoot_FAT_ATTR_HIDDEN + | VasEBoot_FAT_ATTR_SYSTEM + | VasEBoot_FAT_ATTR_DIRECTORY + | VasEBoot_FAT_ATTR_ARCHIVE #ifndef MODE_EXFAT - | GRUB_FAT_ATTR_VOLUME_ID + | VasEBoot_FAT_ATTR_VOLUME_ID #endif ) }; #ifdef MODE_EXFAT -typedef struct grub_exfat_bpb grub_current_fat_bpb_t; +typedef struct VasEBoot_exfat_bpb VasEBoot_current_fat_bpb_t; #else -typedef struct grub_fat_bpb grub_current_fat_bpb_t; +typedef struct VasEBoot_fat_bpb VasEBoot_current_fat_bpb_t; #endif #ifdef MODE_EXFAT @@ -75,135 +75,135 @@ enum { FLAG_CONTIGUOUS = 2 }; -struct grub_fat_dir_entry +struct VasEBoot_fat_dir_entry { - grub_uint8_t entry_type; + VasEBoot_uint8_t entry_type; union { - grub_uint8_t placeholder[31]; + VasEBoot_uint8_t placeholder[31]; struct { - grub_uint8_t secondary_count; - grub_uint16_t checksum; - grub_uint16_t attr; - grub_uint16_t reserved1; - grub_uint32_t c_time; - grub_uint32_t m_time; - grub_uint32_t a_time; - grub_uint8_t c_time_tenth; - grub_uint8_t m_time_tenth; - grub_uint8_t a_time_tenth; - grub_uint8_t reserved2[9]; - } GRUB_PACKED file; + VasEBoot_uint8_t secondary_count; + VasEBoot_uint16_t checksum; + VasEBoot_uint16_t attr; + VasEBoot_uint16_t reserved1; + VasEBoot_uint32_t c_time; + VasEBoot_uint32_t m_time; + VasEBoot_uint32_t a_time; + VasEBoot_uint8_t c_time_tenth; + VasEBoot_uint8_t m_time_tenth; + VasEBoot_uint8_t a_time_tenth; + VasEBoot_uint8_t reserved2[9]; + } VasEBoot_PACKED file; struct { - grub_uint8_t flags; - grub_uint8_t reserved1; - grub_uint8_t name_length; - grub_uint16_t name_hash; - grub_uint16_t reserved2; - grub_uint64_t valid_size; - grub_uint32_t reserved3; - grub_uint32_t first_cluster; - grub_uint64_t file_size; - } GRUB_PACKED stream_extension; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t reserved1; + VasEBoot_uint8_t name_length; + VasEBoot_uint16_t name_hash; + VasEBoot_uint16_t reserved2; + VasEBoot_uint64_t valid_size; + VasEBoot_uint32_t reserved3; + VasEBoot_uint32_t first_cluster; + VasEBoot_uint64_t file_size; + } VasEBoot_PACKED stream_extension; struct { - grub_uint8_t flags; - grub_uint16_t str[15]; - } GRUB_PACKED file_name; + VasEBoot_uint8_t flags; + VasEBoot_uint16_t str[15]; + } VasEBoot_PACKED file_name; struct { - grub_uint8_t character_count; - grub_uint16_t str[15]; - } GRUB_PACKED volume_label; - } GRUB_PACKED type_specific; -} GRUB_PACKED; + VasEBoot_uint8_t character_count; + VasEBoot_uint16_t str[15]; + } VasEBoot_PACKED volume_label; + } VasEBoot_PACKED type_specific; +} VasEBoot_PACKED; -struct grub_fat_dir_node +struct VasEBoot_fat_dir_node { - grub_uint32_t attr; - grub_uint32_t first_cluster; - grub_uint64_t file_size; - grub_uint64_t valid_size; + VasEBoot_uint32_t attr; + VasEBoot_uint32_t first_cluster; + VasEBoot_uint64_t file_size; + VasEBoot_uint64_t valid_size; int have_stream; int is_contiguous; }; -typedef struct grub_fat_dir_node grub_fat_dir_node_t; +typedef struct VasEBoot_fat_dir_node VasEBoot_fat_dir_node_t; #else -struct grub_fat_dir_entry +struct VasEBoot_fat_dir_entry { - grub_uint8_t name[11]; - grub_uint8_t attr; - grub_uint8_t nt_reserved; - grub_uint8_t c_time_tenth; - grub_uint16_t c_time; - grub_uint16_t c_date; - grub_uint16_t a_date; - grub_uint16_t first_cluster_high; - grub_uint16_t w_time; - grub_uint16_t w_date; - grub_uint16_t first_cluster_low; - grub_uint32_t file_size; -} GRUB_PACKED; + VasEBoot_uint8_t name[11]; + VasEBoot_uint8_t attr; + VasEBoot_uint8_t nt_reserved; + VasEBoot_uint8_t c_time_tenth; + VasEBoot_uint16_t c_time; + VasEBoot_uint16_t c_date; + VasEBoot_uint16_t a_date; + VasEBoot_uint16_t first_cluster_high; + VasEBoot_uint16_t w_time; + VasEBoot_uint16_t w_date; + VasEBoot_uint16_t first_cluster_low; + VasEBoot_uint32_t file_size; +} VasEBoot_PACKED; -struct grub_fat_long_name_entry +struct VasEBoot_fat_long_name_entry { - grub_uint8_t id; - grub_uint16_t name1[5]; - grub_uint8_t attr; - grub_uint8_t reserved; - grub_uint8_t checksum; - grub_uint16_t name2[6]; - grub_uint16_t first_cluster; - grub_uint16_t name3[2]; -} GRUB_PACKED; + VasEBoot_uint8_t id; + VasEBoot_uint16_t name1[5]; + VasEBoot_uint8_t attr; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t checksum; + VasEBoot_uint16_t name2[6]; + VasEBoot_uint16_t first_cluster; + VasEBoot_uint16_t name3[2]; +} VasEBoot_PACKED; -typedef struct grub_fat_dir_entry grub_fat_dir_node_t; +typedef struct VasEBoot_fat_dir_entry VasEBoot_fat_dir_node_t; #endif -struct grub_fat_data +struct VasEBoot_fat_data { int logical_sector_bits; - grub_uint32_t num_sectors; + VasEBoot_uint32_t num_sectors; - grub_uint32_t fat_sector; - grub_uint32_t sectors_per_fat; + VasEBoot_uint32_t fat_sector; + VasEBoot_uint32_t sectors_per_fat; int fat_size; - grub_uint32_t root_cluster; + VasEBoot_uint32_t root_cluster; #ifndef MODE_EXFAT - grub_uint32_t root_sector; - grub_uint32_t num_root_sectors; + VasEBoot_uint32_t root_sector; + VasEBoot_uint32_t num_root_sectors; #endif int cluster_bits; - grub_uint32_t cluster_eof_mark; - grub_uint32_t cluster_sector; - grub_uint32_t num_clusters; + VasEBoot_uint32_t cluster_eof_mark; + VasEBoot_uint32_t cluster_sector; + VasEBoot_uint32_t num_clusters; - grub_uint32_t uuid; + VasEBoot_uint32_t uuid; }; -struct grub_fshelp_node { - grub_disk_t disk; - struct grub_fat_data *data; +struct VasEBoot_fshelp_node { + VasEBoot_disk_t disk; + struct VasEBoot_fat_data *data; - grub_uint8_t attr; + VasEBoot_uint8_t attr; #ifndef MODE_EXFAT - grub_uint32_t file_size; + VasEBoot_uint32_t file_size; #else - grub_uint64_t file_size; + VasEBoot_uint64_t file_size; #endif - grub_uint32_t file_cluster; - grub_uint32_t cur_cluster_num; - grub_uint32_t cur_cluster; + VasEBoot_uint32_t file_cluster; + VasEBoot_uint32_t cur_cluster_num; + VasEBoot_uint32_t cur_cluster; #ifdef MODE_EXFAT int is_contiguous; #endif }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; #ifndef MODE_EXFAT static int @@ -224,26 +224,26 @@ fat_log2 (unsigned x) } #endif -static struct grub_fat_data * -grub_fat_mount (grub_disk_t disk) +static struct VasEBoot_fat_data * +VasEBoot_fat_mount (VasEBoot_disk_t disk) { - grub_current_fat_bpb_t bpb; - struct grub_fat_data *data = 0; - grub_uint32_t first_fat, magic; + VasEBoot_current_fat_bpb_t bpb; + struct VasEBoot_fat_data *data = 0; + VasEBoot_uint32_t first_fat, magic; if (! disk) goto fail; - data = (struct grub_fat_data *) grub_malloc (sizeof (*data)); + data = (struct VasEBoot_fat_data *) VasEBoot_malloc (sizeof (*data)); if (! data) goto fail; /* Read the BPB. */ - if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) + if (VasEBoot_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) goto fail; #ifdef MODE_EXFAT - if (grub_memcmp ((const char *) bpb.oem_name, "EXFAT ", + if (VasEBoot_memcmp ((const char *) bpb.oem_name, "EXFAT ", sizeof (bpb.oem_name)) != 0) goto fail; #endif @@ -253,12 +253,12 @@ grub_fat_mount (grub_disk_t disk) data->logical_sector_bits = bpb.bytes_per_sector_shift; #else data->logical_sector_bits = - fat_log2 (grub_le_to_cpu16 (bpb.bytes_per_sector)); + fat_log2 (VasEBoot_le_to_cpu16 (bpb.bytes_per_sector)); #endif - if (data->logical_sector_bits < GRUB_DISK_SECTOR_BITS + if (data->logical_sector_bits < VasEBoot_DISK_SECTOR_BITS || data->logical_sector_bits >= 16) goto fail; - data->logical_sector_bits -= GRUB_DISK_SECTOR_BITS; + data->logical_sector_bits -= VasEBoot_DISK_SECTOR_BITS; #ifdef MODE_EXFAT data->cluster_bits = bpb.sectors_per_cluster_shift; @@ -271,22 +271,22 @@ grub_fat_mount (grub_disk_t disk) /* Get information about FATs. */ #ifdef MODE_EXFAT - data->fat_sector = (grub_le_to_cpu32 (bpb.num_reserved_sectors) + data->fat_sector = (VasEBoot_le_to_cpu32 (bpb.num_reserved_sectors) << data->logical_sector_bits); #else - data->fat_sector = (grub_le_to_cpu16 (bpb.num_reserved_sectors) + data->fat_sector = (VasEBoot_le_to_cpu16 (bpb.num_reserved_sectors) << data->logical_sector_bits); #endif if (data->fat_sector == 0) goto fail; #ifdef MODE_EXFAT - data->sectors_per_fat = (grub_le_to_cpu32 (bpb.sectors_per_fat) + data->sectors_per_fat = (VasEBoot_le_to_cpu32 (bpb.sectors_per_fat) << data->logical_sector_bits); #else data->sectors_per_fat = ((bpb.sectors_per_fat_16 - ? grub_le_to_cpu16 (bpb.sectors_per_fat_16) - : grub_le_to_cpu32 (bpb.version_specific.fat32.sectors_per_fat_32)) + ? VasEBoot_le_to_cpu16 (bpb.sectors_per_fat_16) + : VasEBoot_le_to_cpu32 (bpb.version_specific.fat32.sectors_per_fat_32)) << data->logical_sector_bits); #endif if (data->sectors_per_fat == 0) @@ -294,12 +294,12 @@ grub_fat_mount (grub_disk_t disk) /* Get the number of sectors in this volume. */ #ifdef MODE_EXFAT - data->num_sectors = ((grub_le_to_cpu64 (bpb.num_total_sectors)) + data->num_sectors = ((VasEBoot_le_to_cpu64 (bpb.num_total_sectors)) << data->logical_sector_bits); #else data->num_sectors = ((bpb.num_total_sectors_16 - ? grub_le_to_cpu16 (bpb.num_total_sectors_16) - : grub_le_to_cpu32 (bpb.num_total_sectors_32)) + ? VasEBoot_le_to_cpu16 (bpb.num_total_sectors_16) + : VasEBoot_le_to_cpu32 (bpb.num_total_sectors_32)) << data->logical_sector_bits); #endif if (data->num_sectors == 0) @@ -312,17 +312,17 @@ grub_fat_mount (grub_disk_t disk) #ifndef MODE_EXFAT data->root_sector = data->fat_sector + bpb.num_fats * data->sectors_per_fat; data->num_root_sectors - = ((((grub_uint32_t) grub_le_to_cpu16 (bpb.num_root_entries) - * sizeof (struct grub_fat_dir_entry) - + grub_le_to_cpu16 (bpb.bytes_per_sector) - 1) - >> (data->logical_sector_bits + GRUB_DISK_SECTOR_BITS)) + = ((((VasEBoot_uint32_t) VasEBoot_le_to_cpu16 (bpb.num_root_entries) + * sizeof (struct VasEBoot_fat_dir_entry) + + VasEBoot_le_to_cpu16 (bpb.bytes_per_sector) - 1) + >> (data->logical_sector_bits + VasEBoot_DISK_SECTOR_BITS)) << (data->logical_sector_bits)); #endif #ifdef MODE_EXFAT - data->cluster_sector = (grub_le_to_cpu32 (bpb.cluster_offset) + data->cluster_sector = (VasEBoot_le_to_cpu32 (bpb.cluster_offset) << data->logical_sector_bits); - data->num_clusters = (grub_le_to_cpu32 (bpb.cluster_count) + data->num_clusters = (VasEBoot_le_to_cpu32 (bpb.cluster_count) << data->logical_sector_bits); #else data->cluster_sector = data->root_sector + data->num_root_sectors; @@ -337,11 +337,11 @@ grub_fat_mount (grub_disk_t disk) #ifdef MODE_EXFAT { /* exFAT. */ - data->root_cluster = grub_le_to_cpu32 (bpb.root_cluster); + data->root_cluster = VasEBoot_le_to_cpu32 (bpb.root_cluster); data->fat_size = 32; data->cluster_eof_mark = 0xffffffff; - if ((bpb.volume_flags & grub_cpu_to_le16_compile_time (0x1)) + if ((bpb.volume_flags & VasEBoot_cpu_to_le16_compile_time (0x1)) && bpb.num_fats > 1) data->fat_sector += data->sectors_per_fat; } @@ -349,9 +349,9 @@ grub_fat_mount (grub_disk_t disk) if (! bpb.sectors_per_fat_16) { /* FAT32. */ - grub_uint16_t flags = grub_le_to_cpu16 (bpb.version_specific.fat32.extended_flags); + VasEBoot_uint16_t flags = VasEBoot_le_to_cpu16 (bpb.version_specific.fat32.extended_flags); - data->root_cluster = grub_le_to_cpu32 (bpb.version_specific.fat32.root_cluster); + data->root_cluster = VasEBoot_le_to_cpu32 (bpb.version_specific.fat32.root_cluster); data->fat_size = 32; data->cluster_eof_mark = 0x0ffffff8; @@ -393,14 +393,14 @@ grub_fat_mount (grub_disk_t disk) if (data->num_sectors <= data->fat_sector) goto fail; - if (grub_disk_read (disk, + if (VasEBoot_disk_read (disk, data->fat_sector, 0, sizeof (first_fat), &first_fat)) goto fail; - first_fat = grub_le_to_cpu32 (first_fat); + first_fat = VasEBoot_le_to_cpu32 (first_fat); if (data->fat_size == 32) { @@ -420,12 +420,12 @@ grub_fat_mount (grub_disk_t disk) /* Serial number. */ #ifdef MODE_EXFAT - data->uuid = grub_le_to_cpu32 (bpb.num_serial); + data->uuid = VasEBoot_le_to_cpu32 (bpb.num_serial); #else if (bpb.sectors_per_fat_16) - data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial); + data->uuid = VasEBoot_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial); else - data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat32.num_serial); + data->uuid = VasEBoot_le_to_cpu32 (bpb.version_specific.fat32.num_serial); #endif #ifndef MODE_EXFAT @@ -443,20 +443,20 @@ grub_fat_mount (grub_disk_t disk) fail: - grub_free (data); - grub_error (GRUB_ERR_BAD_FS, "not a FAT filesystem"); + VasEBoot_free (data); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a FAT filesystem"); return 0; } -static grub_ssize_t -grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t offset, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_fat_read_data (VasEBoot_disk_t disk, VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t offset, VasEBoot_size_t len, char *buf) { - grub_size_t size; - grub_uint32_t logical_cluster; + VasEBoot_size_t size; + VasEBoot_uint32_t logical_cluster; unsigned logical_cluster_bits; - grub_ssize_t ret = 0; + VasEBoot_ssize_t ret = 0; unsigned long sector; #ifndef MODE_EXFAT @@ -464,11 +464,11 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, in clusters. */ if (node->file_cluster == ~0U) { - size = (node->data->num_root_sectors << GRUB_DISK_SECTOR_BITS) - offset; + size = (node->data->num_root_sectors << VasEBoot_DISK_SECTOR_BITS) - offset; if (size > len) size = len; - if (grub_disk_read (disk, node->data->root_sector, offset, size, buf)) + if (VasEBoot_disk_read (disk, node->data->root_sector, offset, size, buf)) return -1; return size; @@ -485,10 +485,10 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, disk->read_hook = read_hook; disk->read_hook_data = read_hook_data; - grub_disk_read (disk, sector + (offset >> GRUB_DISK_SECTOR_BITS), - offset & (GRUB_DISK_SECTOR_SIZE - 1), len, buf); + VasEBoot_disk_read (disk, sector + (offset >> VasEBoot_DISK_SECTOR_BITS), + offset & (VasEBoot_DISK_SECTOR_SIZE - 1), len, buf); disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; return len; @@ -497,7 +497,7 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, /* Calculate the logical cluster number and offset. */ logical_cluster_bits = (node->data->cluster_bits - + GRUB_DISK_SECTOR_BITS); + + VasEBoot_DISK_SECTOR_BITS); logical_cluster = offset >> logical_cluster_bits; offset &= (1ULL << logical_cluster_bits) - 1; @@ -512,8 +512,8 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, while (logical_cluster > node->cur_cluster_num) { /* Find next cluster. */ - grub_uint32_t next_cluster; - grub_uint32_t fat_offset; + VasEBoot_uint32_t next_cluster; + VasEBoot_uint32_t fat_offset; switch (node->data->fat_size) { @@ -530,12 +530,12 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, } /* Read the FAT. */ - if (grub_disk_read (disk, node->data->fat_sector, fat_offset, + if (VasEBoot_disk_read (disk, node->data->fat_sector, fat_offset, (node->data->fat_size + 7) >> 3, (char *) &next_cluster)) return -1; - next_cluster = grub_le_to_cpu32 (next_cluster); + next_cluster = VasEBoot_le_to_cpu32 (next_cluster); switch (node->data->fat_size) { case 16: @@ -549,7 +549,7 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, break; } - grub_dprintf ("fat", "fat_size=%d, next_cluster=%u\n", + VasEBoot_dprintf ("fat", "fat_size=%d, next_cluster=%u\n", node->data->fat_size, next_cluster); /* Check the end. */ @@ -558,7 +558,7 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, if (next_cluster < 2 || next_cluster >= node->data->num_clusters) { - grub_error (GRUB_ERR_BAD_FS, "invalid cluster %u", + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid cluster %u", next_cluster); return -1; } @@ -577,9 +577,9 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, disk->read_hook = read_hook; disk->read_hook_data = read_hook_data; - grub_disk_read (disk, sector, offset, size, buf); + VasEBoot_disk_read (disk, sector, offset, size, buf); disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; len -= size; @@ -592,61 +592,61 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, return ret; } -struct grub_fat_iterate_context +struct VasEBoot_fat_iterate_context { #ifdef MODE_EXFAT - struct grub_fat_dir_node dir; + struct VasEBoot_fat_dir_node dir; #else - struct grub_fat_dir_entry dir; + struct VasEBoot_fat_dir_entry dir; #endif char *filename; - grub_uint16_t *unibuf; - grub_ssize_t offset; + VasEBoot_uint16_t *unibuf; + VasEBoot_ssize_t offset; }; -static grub_err_t -grub_fat_iterate_init (struct grub_fat_iterate_context *ctxt) +static VasEBoot_err_t +VasEBoot_fat_iterate_init (struct VasEBoot_fat_iterate_context *ctxt) { - ctxt->offset = -sizeof (struct grub_fat_dir_entry); + ctxt->offset = -sizeof (struct VasEBoot_fat_dir_entry); #ifndef MODE_EXFAT /* Allocate space enough to hold a long name. */ - ctxt->filename = grub_malloc (0x40 * 13 * GRUB_MAX_UTF8_PER_UTF16 + 1); - ctxt->unibuf = (grub_uint16_t *) grub_malloc (0x40 * 13 * 2); + ctxt->filename = VasEBoot_malloc (0x40 * 13 * VasEBoot_MAX_UTF8_PER_UTF16 + 1); + ctxt->unibuf = (VasEBoot_uint16_t *) VasEBoot_malloc (0x40 * 13 * 2); #else - ctxt->unibuf = grub_malloc (15 * 256 * 2); - ctxt->filename = grub_malloc (15 * 256 * GRUB_MAX_UTF8_PER_UTF16 + 1); + ctxt->unibuf = VasEBoot_malloc (15 * 256 * 2); + ctxt->filename = VasEBoot_malloc (15 * 256 * VasEBoot_MAX_UTF8_PER_UTF16 + 1); #endif if (! ctxt->filename || ! ctxt->unibuf) { - grub_free (ctxt->filename); - grub_free (ctxt->unibuf); - return grub_errno; + VasEBoot_free (ctxt->filename); + VasEBoot_free (ctxt->unibuf); + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_fat_iterate_fini (struct grub_fat_iterate_context *ctxt) +VasEBoot_fat_iterate_fini (struct VasEBoot_fat_iterate_context *ctxt) { - grub_free (ctxt->filename); - grub_free (ctxt->unibuf); + VasEBoot_free (ctxt->filename); + VasEBoot_free (ctxt->unibuf); } #ifdef MODE_EXFAT -static grub_err_t -grub_fat_iterate_dir_next (grub_fshelp_node_t node, - struct grub_fat_iterate_context *ctxt) +static VasEBoot_err_t +VasEBoot_fat_iterate_dir_next (VasEBoot_fshelp_node_t node, + struct VasEBoot_fat_iterate_context *ctxt) { - grub_memset (&ctxt->dir, 0, sizeof (ctxt->dir)); + VasEBoot_memset (&ctxt->dir, 0, sizeof (ctxt->dir)); while (1) { - struct grub_fat_dir_entry dir; + struct VasEBoot_fat_dir_entry dir; ctxt->offset += sizeof (dir); - if (grub_fat_read_data (node->disk, node, 0, 0, ctxt->offset, sizeof (dir), + if (VasEBoot_fat_read_data (node->disk, node, 0, 0, ctxt->offset, sizeof (dir), (char *) &dir) != sizeof (dir)) break; @@ -662,13 +662,13 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, nsec = dir.type_specific.file.secondary_count; - ctxt->dir.attr = grub_cpu_to_le16 (dir.type_specific.file.attr); + ctxt->dir.attr = VasEBoot_cpu_to_le16 (dir.type_specific.file.attr); ctxt->dir.have_stream = 0; for (i = 0; i < nsec; i++) { - struct grub_fat_dir_entry sec; + struct VasEBoot_fat_dir_entry sec; ctxt->offset += sizeof (sec); - if (grub_fat_read_data (node->disk, node, 0, 0, + if (VasEBoot_fat_read_data (node->disk, node, 0, 0, ctxt->offset, sizeof (sec), (char *) &sec) != sizeof (sec)) break; @@ -679,26 +679,26 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, switch (sec.entry_type) { case 0xc0: - ctxt->dir.first_cluster = grub_cpu_to_le32 (sec.type_specific.stream_extension.first_cluster); + ctxt->dir.first_cluster = VasEBoot_cpu_to_le32 (sec.type_specific.stream_extension.first_cluster); ctxt->dir.valid_size - = grub_cpu_to_le64 (sec.type_specific.stream_extension.valid_size); + = VasEBoot_cpu_to_le64 (sec.type_specific.stream_extension.valid_size); ctxt->dir.file_size - = grub_cpu_to_le64 (sec.type_specific.stream_extension.file_size); + = VasEBoot_cpu_to_le64 (sec.type_specific.stream_extension.file_size); ctxt->dir.have_stream = 1; ctxt->dir.is_contiguous = !!(sec.type_specific.stream_extension.flags - & grub_cpu_to_le16_compile_time (FLAG_CONTIGUOUS)); + & VasEBoot_cpu_to_le16_compile_time (FLAG_CONTIGUOUS)); break; case 0xc1: { int j; for (j = 0; j < 15; j++) ctxt->unibuf[slots * 15 + j] - = grub_le_to_cpu16 (sec.type_specific.file_name.str[j]); + = VasEBoot_le_to_cpu16 (sec.type_specific.file_name.str[j]); slots++; } break; default: - grub_dprintf ("exfat", "unknown secondary type 0x%02x\n", + VasEBoot_dprintf ("exfat", "unknown secondary type 0x%02x\n", sec.entry_type); } } @@ -709,7 +709,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, continue; } - *grub_utf16_to_utf8 ((grub_uint8_t *) ctxt->filename, ctxt->unibuf, + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) ctxt->filename, ctxt->unibuf, slots * 15) = '\0'; return 0; @@ -723,17 +723,17 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, /* Volume label. */ if (dir.entry_type == 0x83) continue; - grub_dprintf ("exfat", "unknown primary type 0x%02x\n", + VasEBoot_dprintf ("exfat", "unknown primary type 0x%02x\n", dir.entry_type); } - return grub_errno ? : GRUB_ERR_EOF; + return VasEBoot_errno ? : VasEBoot_ERR_EOF; } #else -static grub_err_t -grub_fat_iterate_dir_next (grub_fshelp_node_t node, - struct grub_fat_iterate_context *ctxt) +static VasEBoot_err_t +VasEBoot_fat_iterate_dir_next (VasEBoot_fshelp_node_t node, + struct VasEBoot_fat_iterate_context *ctxt) { char *filep = 0; int checksum = -1; @@ -747,18 +747,18 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, ctxt->offset += sizeof (ctxt->dir); /* Read a directory entry. */ - if (grub_fat_read_data (node->disk, node, 0, 0, + if (VasEBoot_fat_read_data (node->disk, node, 0, 0, ctxt->offset, sizeof (ctxt->dir), (char *) &ctxt->dir) != sizeof (ctxt->dir) || ctxt->dir.name[0] == 0) break; /* Handle long name entries. */ - if (ctxt->dir.attr == GRUB_FAT_ATTR_LONG_NAME) + if (ctxt->dir.attr == VasEBoot_FAT_ATTR_LONG_NAME) { - struct grub_fat_long_name_entry *long_name - = (struct grub_fat_long_name_entry *) &ctxt->dir; - grub_uint8_t id = long_name->id; + struct VasEBoot_fat_long_name_entry *long_name + = (struct VasEBoot_fat_long_name_entry *) &ctxt->dir; + VasEBoot_uint8_t id = long_name->id; if (id & 0x40) { @@ -774,14 +774,14 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, } slot--; - grub_memcpy (ctxt->unibuf + slot * 13, long_name->name1, 5 * 2); - grub_memcpy (ctxt->unibuf + slot * 13 + 5, long_name->name2, 6 * 2); - grub_memcpy (ctxt->unibuf + slot * 13 + 11, long_name->name3, 2 * 2); + VasEBoot_memcpy (ctxt->unibuf + slot * 13, long_name->name1, 5 * 2); + VasEBoot_memcpy (ctxt->unibuf + slot * 13 + 5, long_name->name2, 6 * 2); + VasEBoot_memcpy (ctxt->unibuf + slot * 13 + 11, long_name->name3, 2 * 2); continue; } /* Check if this entry is valid. */ - if (ctxt->dir.name[0] == 0xe5 || (ctxt->dir.attr & ~GRUB_FAT_ATTR_VALID)) + if (ctxt->dir.name[0] == 0xe5 || (ctxt->dir.attr & ~VasEBoot_FAT_ATTR_VALID)) continue; /* This is a workaround for Japanese. */ @@ -790,7 +790,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, if (checksum != -1 && slot == 0) { - grub_uint8_t sum; + VasEBoot_uint8_t sum; for (sum = 0, i = 0; i < sizeof (ctxt->dir.name); i++) sum = ((sum >> 1) | (sum << 7)) + ctxt->dir.name[i]; @@ -800,13 +800,13 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, int u; for (u = 0; u < slots * 13; u++) - ctxt->unibuf[u] = grub_le_to_cpu16 (ctxt->unibuf[u]); + ctxt->unibuf[u] = VasEBoot_le_to_cpu16 (ctxt->unibuf[u]); - *grub_utf16_to_utf8 ((grub_uint8_t *) ctxt->filename, + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) ctxt->filename, ctxt->unibuf, slots * 13) = '\0'; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } checksum = -1; @@ -814,7 +814,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, /* Convert the 8.3 file name. */ filep = ctxt->filename; - if (ctxt->dir.attr & GRUB_FAT_ATTR_VOLUME_ID) + if (ctxt->dir.attr & VasEBoot_FAT_ATTR_VOLUME_ID) { for (i = 0; i < sizeof (ctxt->dir.name) && ctxt->dir.name[i]; i++) *filep++ = ctxt->dir.name[i]; @@ -827,7 +827,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, else { for (i = 0; i < 8 && ctxt->dir.name[i]; i++) - *filep++ = grub_tolower (ctxt->dir.name[i]); + *filep++ = VasEBoot_tolower (ctxt->dir.name[i]); while (i > 0 && ctxt->dir.name[i - 1] == ' ') { filep--; @@ -839,7 +839,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, *filep++ = '.'; for (i = 8; i < 11 && ctxt->dir.name[i]; i++) - *filep++ = grub_tolower (ctxt->dir.name[i]); + *filep++ = VasEBoot_tolower (ctxt->dir.name[i]); while (i > 8 && ctxt->dir.name[i - 1] == ' ') { filep--; @@ -850,51 +850,51 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, filep--; } *filep = '\0'; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_errno ? : GRUB_ERR_EOF; + return VasEBoot_errno ? : VasEBoot_ERR_EOF; } #endif -static grub_err_t lookup_file (grub_fshelp_node_t node, +static VasEBoot_err_t lookup_file (VasEBoot_fshelp_node_t node, const char *name, - grub_fshelp_node_t *foundnode, - enum grub_fshelp_filetype *foundtype) + VasEBoot_fshelp_node_t *foundnode, + enum VasEBoot_fshelp_filetype *foundtype) { - grub_err_t err; - struct grub_fat_iterate_context ctxt; + VasEBoot_err_t err; + struct VasEBoot_fat_iterate_context ctxt; - err = grub_fat_iterate_init (&ctxt); + err = VasEBoot_fat_iterate_init (&ctxt); if (err) return err; - while (!(err = grub_fat_iterate_dir_next (node, &ctxt))) + while (!(err = VasEBoot_fat_iterate_dir_next (node, &ctxt))) { #ifdef MODE_EXFAT if (!ctxt.dir.have_stream) continue; #else - if (ctxt.dir.attr & GRUB_FAT_ATTR_VOLUME_ID) + if (ctxt.dir.attr & VasEBoot_FAT_ATTR_VOLUME_ID) continue; #endif - if (grub_strcasecmp (name, ctxt.filename) == 0) + if (VasEBoot_strcasecmp (name, ctxt.filename) == 0) { - *foundnode = grub_malloc (sizeof (struct grub_fshelp_node)); + *foundnode = VasEBoot_malloc (sizeof (struct VasEBoot_fshelp_node)); if (!*foundnode) - return grub_errno; + return VasEBoot_errno; (*foundnode)->attr = ctxt.dir.attr; #ifdef MODE_EXFAT (*foundnode)->file_size = ctxt.dir.file_size; (*foundnode)->file_cluster = ctxt.dir.first_cluster; (*foundnode)->is_contiguous = ctxt.dir.is_contiguous; #else - (*foundnode)->file_size = grub_le_to_cpu32 (ctxt.dir.file_size); - (*foundnode)->file_cluster = ((grub_le_to_cpu16 (ctxt.dir.first_cluster_high) << 16) - | grub_le_to_cpu16 (ctxt.dir.first_cluster_low)); + (*foundnode)->file_size = VasEBoot_le_to_cpu32 (ctxt.dir.file_size); + (*foundnode)->file_cluster = ((VasEBoot_le_to_cpu16 (ctxt.dir.first_cluster_high) << 16) + | VasEBoot_le_to_cpu16 (ctxt.dir.first_cluster_low)); /* If directory points to root, starting cluster is 0 */ if (!(*foundnode)->file_cluster) (*foundnode)->file_cluster = node->data->root_cluster; @@ -903,41 +903,41 @@ static grub_err_t lookup_file (grub_fshelp_node_t node, (*foundnode)->data = node->data; (*foundnode)->disk = node->disk; - *foundtype = ((*foundnode)->attr & GRUB_FAT_ATTR_DIRECTORY) ? GRUB_FSHELP_DIR : GRUB_FSHELP_REG; + *foundtype = ((*foundnode)->attr & VasEBoot_FAT_ATTR_DIRECTORY) ? VasEBoot_FSHELP_DIR : VasEBoot_FSHELP_REG; - grub_fat_iterate_fini (&ctxt); - return GRUB_ERR_NONE; + VasEBoot_fat_iterate_fini (&ctxt); + return VasEBoot_ERR_NONE; } } - grub_fat_iterate_fini (&ctxt); - if (err == GRUB_ERR_EOF) + VasEBoot_fat_iterate_fini (&ctxt); + if (err == VasEBoot_ERR_EOF) err = 0; return err; } -static grub_err_t -grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, +static VasEBoot_err_t +VasEBoot_fat_dir (VasEBoot_device_t device, const char *path, VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_fat_data *data = 0; - grub_disk_t disk = device->disk; - grub_fshelp_node_t found = NULL; - grub_err_t err; - struct grub_fat_iterate_context ctxt; + struct VasEBoot_fat_data *data = 0; + VasEBoot_disk_t disk = device->disk; + VasEBoot_fshelp_node_t found = NULL; + VasEBoot_err_t err; + struct VasEBoot_fat_iterate_context ctxt; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_fat_mount (disk); + data = VasEBoot_fat_mount (disk); if (! data) goto fail; - struct grub_fshelp_node root = { + struct VasEBoot_fshelp_node root = { .data = data, .disk = disk, - .attr = GRUB_FAT_ATTR_DIRECTORY, + .attr = VasEBoot_FAT_ATTR_DIRECTORY, .file_size = 0, .file_cluster = data->root_cluster, .cur_cluster_num = ~0U, @@ -947,65 +947,65 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, #endif }; - err = grub_fshelp_find_file_lookup (path, &root, &found, lookup_file, NULL, GRUB_FSHELP_DIR); + err = VasEBoot_fshelp_find_file_lookup (path, &root, &found, lookup_file, NULL, VasEBoot_FSHELP_DIR); if (err) goto fail; - err = grub_fat_iterate_init (&ctxt); + err = VasEBoot_fat_iterate_init (&ctxt); if (err) goto fail; - while (!(err = grub_fat_iterate_dir_next (found, &ctxt))) + while (!(err = VasEBoot_fat_iterate_dir_next (found, &ctxt))) { - struct grub_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + struct VasEBoot_dirhook_info info; + VasEBoot_memset (&info, 0, sizeof (info)); - info.dir = !! (ctxt.dir.attr & GRUB_FAT_ATTR_DIRECTORY); + info.dir = !! (ctxt.dir.attr & VasEBoot_FAT_ATTR_DIRECTORY); info.case_insensitive = 1; #ifdef MODE_EXFAT if (!ctxt.dir.have_stream) continue; #else - if (ctxt.dir.attr & GRUB_FAT_ATTR_VOLUME_ID) + if (ctxt.dir.attr & VasEBoot_FAT_ATTR_VOLUME_ID) continue; #endif if (hook (ctxt.filename, &info, hook_data)) break; } - grub_fat_iterate_fini (&ctxt); - if (err == GRUB_ERR_EOF) + VasEBoot_fat_iterate_fini (&ctxt); + if (err == VasEBoot_ERR_EOF) err = 0; fail: if (found != &root) - grub_free (found); + VasEBoot_free (found); - grub_free (data); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_fat_open (grub_file_t file, const char *name) +static VasEBoot_err_t +VasEBoot_fat_open (VasEBoot_file_t file, const char *name) { - struct grub_fat_data *data = 0; - grub_fshelp_node_t found = NULL; - grub_err_t err; - grub_disk_t disk = file->device->disk; + struct VasEBoot_fat_data *data = 0; + VasEBoot_fshelp_node_t found = NULL; + VasEBoot_err_t err; + VasEBoot_disk_t disk = file->device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_fat_mount (disk); + data = VasEBoot_fat_mount (disk); if (! data) goto fail; - struct grub_fshelp_node root = { + struct VasEBoot_fshelp_node root = { .data = data, .disk = disk, - .attr = GRUB_FAT_ATTR_DIRECTORY, + .attr = VasEBoot_FAT_ATTR_DIRECTORY, .file_size = 0, .file_cluster = data->root_cluster, .cur_cluster_num = ~0U, @@ -1015,67 +1015,67 @@ grub_fat_open (grub_file_t file, const char *name) #endif }; - err = grub_fshelp_find_file_lookup (name, &root, &found, lookup_file, NULL, GRUB_FSHELP_REG); + err = VasEBoot_fshelp_find_file_lookup (name, &root, &found, lookup_file, NULL, VasEBoot_FSHELP_REG); if (err) goto fail; file->data = found; file->size = found->file_size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: if (found != &root) - grub_free (found); + VasEBoot_free (found); - grub_free (data); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_fat_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_fat_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - return grub_fat_read_data (file->device->disk, file->data, + return VasEBoot_fat_read_data (file->device->disk, file->data, file->read_hook, file->read_hook_data, file->offset, len, buf); } -static grub_err_t -grub_fat_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_fat_close (VasEBoot_file_t file) { - grub_fshelp_node_t node = file->data; + VasEBoot_fshelp_node_t node = file->data; - grub_free (node->data); - grub_free (node); + VasEBoot_free (node->data); + VasEBoot_free (node); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } #ifdef MODE_EXFAT -static grub_err_t -grub_fat_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_fat_label (VasEBoot_device_t device, char **label) { - struct grub_fat_dir_entry dir; - grub_ssize_t offset = -sizeof(dir); - grub_disk_t disk = device->disk; - struct grub_fshelp_node root = { + struct VasEBoot_fat_dir_entry dir; + VasEBoot_ssize_t offset = -sizeof(dir); + VasEBoot_disk_t disk = device->disk; + struct VasEBoot_fshelp_node root = { .disk = disk, - .attr = GRUB_FAT_ATTR_DIRECTORY, + .attr = VasEBoot_FAT_ATTR_DIRECTORY, .file_size = 0, .cur_cluster_num = ~0U, .cur_cluster = 0, .is_contiguous = 0, }; - root.data = grub_fat_mount (disk); + root.data = VasEBoot_fat_mount (disk); if (! root.data) - return grub_errno; + return VasEBoot_errno; root.file_cluster = root.data->root_cluster; @@ -1085,7 +1085,7 @@ grub_fat_label (grub_device_t device, char **label) { offset += sizeof (dir); - if (grub_fat_read_data (disk, &root, 0, 0, + if (VasEBoot_fat_read_data (disk, &root, 0, 0, offset, sizeof (dir), (char *) &dir) != sizeof (dir)) break; @@ -1098,40 +1098,40 @@ grub_fat_label (grub_device_t device, char **label) /* Volume label. */ if (dir.entry_type == 0x83) { - grub_size_t chc; - grub_uint16_t t[ARRAY_SIZE (dir.type_specific.volume_label.str)]; - grub_size_t i; - *label = grub_malloc (ARRAY_SIZE (dir.type_specific.volume_label.str) - * GRUB_MAX_UTF8_PER_UTF16 + 1); + VasEBoot_size_t chc; + VasEBoot_uint16_t t[ARRAY_SIZE (dir.type_specific.volume_label.str)]; + VasEBoot_size_t i; + *label = VasEBoot_malloc (ARRAY_SIZE (dir.type_specific.volume_label.str) + * VasEBoot_MAX_UTF8_PER_UTF16 + 1); if (!*label) { - grub_free (root.data); - return grub_errno; + VasEBoot_free (root.data); + return VasEBoot_errno; } chc = dir.type_specific.volume_label.character_count; if (chc > ARRAY_SIZE (dir.type_specific.volume_label.str)) chc = ARRAY_SIZE (dir.type_specific.volume_label.str); for (i = 0; i < chc; i++) - t[i] = grub_le_to_cpu16 (dir.type_specific.volume_label.str[i]); - *grub_utf16_to_utf8 ((grub_uint8_t *) *label, t, chc) = '\0'; + t[i] = VasEBoot_le_to_cpu16 (dir.type_specific.volume_label.str[i]); + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) *label, t, chc) = '\0'; } } - grub_free (root.data); - return grub_errno; + VasEBoot_free (root.data); + return VasEBoot_errno; } #else -static grub_err_t -grub_fat_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_fat_label (VasEBoot_device_t device, char **label) { - grub_disk_t disk = device->disk; - grub_err_t err; - struct grub_fat_iterate_context ctxt; - struct grub_fshelp_node root = { + VasEBoot_disk_t disk = device->disk; + VasEBoot_err_t err; + struct VasEBoot_fat_iterate_context ctxt; + struct VasEBoot_fshelp_node root = { .disk = disk, - .attr = GRUB_FAT_ATTR_DIRECTORY, + .attr = VasEBoot_FAT_ATTR_DIRECTORY, .file_size = 0, .cur_cluster_num = ~0U, .cur_cluster = 0, @@ -1139,103 +1139,103 @@ grub_fat_label (grub_device_t device, char **label) *label = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - root.data = grub_fat_mount (disk); + root.data = VasEBoot_fat_mount (disk); if (! root.data) goto fail; root.file_cluster = root.data->root_cluster; - err = grub_fat_iterate_init (&ctxt); + err = VasEBoot_fat_iterate_init (&ctxt); if (err) goto fail; - while (!(err = grub_fat_iterate_dir_next (&root, &ctxt))) - if ((ctxt.dir.attr & ~GRUB_FAT_ATTR_ARCHIVE) == GRUB_FAT_ATTR_VOLUME_ID) + while (!(err = VasEBoot_fat_iterate_dir_next (&root, &ctxt))) + if ((ctxt.dir.attr & ~VasEBoot_FAT_ATTR_ARCHIVE) == VasEBoot_FAT_ATTR_VOLUME_ID) { - *label = grub_strdup (ctxt.filename); + *label = VasEBoot_strdup (ctxt.filename); break; } - grub_fat_iterate_fini (&ctxt); + VasEBoot_fat_iterate_fini (&ctxt); fail: - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (root.data); + VasEBoot_free (root.data); - return grub_errno; + return VasEBoot_errno; } #endif -static grub_err_t -grub_fat_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_fat_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_fat_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_fat_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_fat_mount (disk); + data = VasEBoot_fat_mount (disk); if (data) { char *ptr; - *uuid = grub_xasprintf ("%04x-%04x", - (grub_uint16_t) (data->uuid >> 16), - (grub_uint16_t) data->uuid); + *uuid = VasEBoot_xasprintf ("%04x-%04x", + (VasEBoot_uint16_t) (data->uuid >> 16), + (VasEBoot_uint16_t) data->uuid); for (ptr = *uuid; ptr && *ptr; ptr++) - *ptr = grub_toupper (*ptr); + *ptr = VasEBoot_toupper (*ptr); } else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL #ifndef MODE_EXFAT -grub_disk_addr_t -grub_fat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn) +VasEBoot_disk_addr_t +VasEBoot_fat_get_cluster_sector (VasEBoot_disk_t disk, VasEBoot_uint64_t *sec_per_lcn) #else -grub_disk_addr_t - grub_exfat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn) +VasEBoot_disk_addr_t + VasEBoot_exfat_get_cluster_sector (VasEBoot_disk_t disk, VasEBoot_uint64_t *sec_per_lcn) #endif { - grub_disk_addr_t ret; - struct grub_fat_data *data; - data = grub_fat_mount (disk); + VasEBoot_disk_addr_t ret; + struct VasEBoot_fat_data *data; + data = VasEBoot_fat_mount (disk); if (!data) return 0; ret = data->cluster_sector; *sec_per_lcn = 1ULL << data->cluster_bits; - grub_free (data); + VasEBoot_free (data); return ret; } #endif -static struct grub_fs grub_fat_fs = +static struct VasEBoot_fs VasEBoot_fat_fs = { #ifdef MODE_EXFAT .name = "exfat", #else .name = "fat", #endif - .dir = grub_fat_dir, - .open = grub_fat_open, - .read = grub_fat_read, - .close = grub_fat_close, - .label = grub_fat_label, - .uuid = grub_fat_uuid, -#ifdef GRUB_UTIL + .dir = VasEBoot_fat_dir, + .open = VasEBoot_fat_open, + .read = VasEBoot_fat_read, + .close = VasEBoot_fat_close, + .label = VasEBoot_fat_label, + .uuid = VasEBoot_fat_uuid, +#ifdef VasEBoot_UTIL #ifdef MODE_EXFAT /* ExFAT BPB is 30 larger than FAT32 one. */ .reserved_first_sector = 0, @@ -1248,21 +1248,21 @@ static struct grub_fs grub_fat_fs = }; #ifdef MODE_EXFAT -GRUB_MOD_INIT(exfat) +VasEBoot_MOD_INIT(exfat) #else -GRUB_MOD_INIT(fat) +VasEBoot_MOD_INIT(fat) #endif { - COMPILE_TIME_ASSERT (sizeof (struct grub_fat_dir_entry) == 32); - grub_fs_register (&grub_fat_fs); + COMPILE_TIME_ASSERT (sizeof (struct VasEBoot_fat_dir_entry) == 32); + VasEBoot_fs_register (&VasEBoot_fat_fs); my_mod = mod; } #ifdef MODE_EXFAT -GRUB_MOD_FINI(exfat) +VasEBoot_MOD_FINI(exfat) #else -GRUB_MOD_FINI(fat) +VasEBoot_MOD_FINI(fat) #endif { - grub_fs_unregister (&grub_fat_fs); + VasEBoot_fs_unregister (&VasEBoot_fat_fs); } diff --git a/VasEBoot-core/fs/fshelp.c b/VasEBoot-core/fs/fshelp.c index 4c902adf3..fedc74c40 100644 --- a/VasEBoot-core/fs/fshelp.c +++ b/VasEBoot-core/fs/fshelp.c @@ -1,53 +1,53 @@ /* fshelp.c -- Filesystem helper functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -typedef int (*iterate_dir_func) (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, +typedef int (*iterate_dir_func) (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *data); -typedef grub_err_t (*lookup_file_func) (grub_fshelp_node_t dir, +typedef VasEBoot_err_t (*lookup_file_func) (VasEBoot_fshelp_node_t dir, const char *name, - grub_fshelp_node_t *foundnode, - enum grub_fshelp_filetype *foundtype); -typedef char *(*read_symlink_func) (grub_fshelp_node_t node); + VasEBoot_fshelp_node_t *foundnode, + enum VasEBoot_fshelp_filetype *foundtype); +typedef char *(*read_symlink_func) (VasEBoot_fshelp_node_t node); struct stack_element { struct stack_element *parent; - grub_fshelp_node_t node; - enum grub_fshelp_filetype type; + VasEBoot_fshelp_node_t node; + enum VasEBoot_fshelp_filetype type; }; -/* Context for grub_fshelp_find_file. */ -struct grub_fshelp_find_file_ctx +/* Context for VasEBoot_fshelp_find_file. */ +struct VasEBoot_fshelp_find_file_ctx { /* Inputs. */ const char *path; - grub_fshelp_node_t rootnode; + VasEBoot_fshelp_node_t rootnode; /* Global options. */ int symlinknest; @@ -58,78 +58,78 @@ struct grub_fshelp_find_file_ctx /* Helper for find_file_iter. */ static void -free_node (grub_fshelp_node_t node, struct grub_fshelp_find_file_ctx *ctx) +free_node (VasEBoot_fshelp_node_t node, struct VasEBoot_fshelp_find_file_ctx *ctx) { if (node != ctx->rootnode) - grub_free (node); + VasEBoot_free (node); } static void -pop_element (struct grub_fshelp_find_file_ctx *ctx) +pop_element (struct VasEBoot_fshelp_find_file_ctx *ctx) { struct stack_element *el; el = ctx->currnode; ctx->currnode = el->parent; free_node (el->node, ctx); - grub_free (el); + VasEBoot_free (el); } static void -free_stack (struct grub_fshelp_find_file_ctx *ctx) +free_stack (struct VasEBoot_fshelp_find_file_ctx *ctx) { while (ctx->currnode) pop_element (ctx); } static void -go_up_a_level (struct grub_fshelp_find_file_ctx *ctx) +go_up_a_level (struct VasEBoot_fshelp_find_file_ctx *ctx) { if (!ctx->currnode->parent) return; pop_element (ctx); } -static grub_err_t -push_node (struct grub_fshelp_find_file_ctx *ctx, grub_fshelp_node_t node, enum grub_fshelp_filetype filetype) +static VasEBoot_err_t +push_node (struct VasEBoot_fshelp_find_file_ctx *ctx, VasEBoot_fshelp_node_t node, enum VasEBoot_fshelp_filetype filetype) { struct stack_element *nst; - nst = grub_malloc (sizeof (*nst)); + nst = VasEBoot_malloc (sizeof (*nst)); if (!nst) - return grub_errno; + return VasEBoot_errno; nst->node = node; - nst->type = filetype & ~GRUB_FSHELP_CASE_INSENSITIVE; + nst->type = filetype & ~VasEBoot_FSHELP_CASE_INSENSITIVE; nst->parent = ctx->currnode; ctx->currnode = nst; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -go_to_root (struct grub_fshelp_find_file_ctx *ctx) +static VasEBoot_err_t +go_to_root (struct VasEBoot_fshelp_find_file_ctx *ctx) { free_stack (ctx); - return push_node (ctx, ctx->rootnode, GRUB_FSHELP_DIR); + return push_node (ctx, ctx->rootnode, VasEBoot_FSHELP_DIR); } -struct grub_fshelp_find_file_iter_ctx +struct VasEBoot_fshelp_find_file_iter_ctx { const char *name; - grub_fshelp_node_t *foundnode; - enum grub_fshelp_filetype *foundtype; + VasEBoot_fshelp_node_t *foundnode; + enum VasEBoot_fshelp_filetype *foundtype; }; -/* Helper for grub_fshelp_find_file. */ +/* Helper for VasEBoot_fshelp_find_file. */ static int -find_file_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +find_file_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_fshelp_find_file_iter_ctx *ctx = data; + struct VasEBoot_fshelp_find_file_iter_ctx *ctx = data; - if (filetype == GRUB_FSHELP_UNKNOWN || - ((filetype & GRUB_FSHELP_CASE_INSENSITIVE) - ? grub_strcasecmp (ctx->name, filename) - : grub_strcmp (ctx->name, filename))) + if (filetype == VasEBoot_FSHELP_UNKNOWN || + ((filetype & VasEBoot_FSHELP_CASE_INSENSITIVE) + ? VasEBoot_strcasecmp (ctx->name, filename) + : VasEBoot_strcmp (ctx->name, filename))) { - grub_free (node); + VasEBoot_free (node); return 0; } @@ -139,12 +139,12 @@ find_file_iter (const char *filename, enum grub_fshelp_filetype filetype, return 1; } -static grub_err_t -directory_find_file (grub_fshelp_node_t node, const char *name, grub_fshelp_node_t *foundnode, - enum grub_fshelp_filetype *foundtype, iterate_dir_func iterate_dir) +static VasEBoot_err_t +directory_find_file (VasEBoot_fshelp_node_t node, const char *name, VasEBoot_fshelp_node_t *foundnode, + enum VasEBoot_fshelp_filetype *foundtype, iterate_dir_func iterate_dir) { int found; - struct grub_fshelp_find_file_iter_ctx ctx = { + struct VasEBoot_fshelp_find_file_iter_ctx ctx = { .foundnode = foundnode, .foundtype = foundtype, .name = name @@ -152,25 +152,25 @@ directory_find_file (grub_fshelp_node_t node, const char *name, grub_fshelp_node found = iterate_dir (node, find_file_iter, &ctx); if (! found) { - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t find_file (char *currpath, iterate_dir_func iterate_dir, lookup_file_func lookup_file, read_symlink_func read_symlink, - struct grub_fshelp_find_file_ctx *ctx) + struct VasEBoot_fshelp_find_file_ctx *ctx) { char *name, *next; - grub_err_t err; + VasEBoot_err_t err; for (name = currpath; ; name = next) { char c; - grub_fshelp_node_t foundnode = NULL; - enum grub_fshelp_filetype foundtype = 0; + VasEBoot_fshelp_node_t foundnode = NULL; + enum VasEBoot_fshelp_filetype foundtype = 0; /* Remove all leading slashes. */ while (*name == '/') @@ -185,8 +185,8 @@ find_file (char *currpath, /* At this point it is expected that the current node is a directory, check if this is true. */ - if (ctx->currnode->type != GRUB_FSHELP_DIR) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + if (ctx->currnode->type != VasEBoot_FSHELP_DIR) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); /* Don't rely on fs providing actual . in the listing. */ if (next - name == 1 && name[0] == '.') @@ -217,19 +217,19 @@ find_file (char *currpath, push_node (ctx, foundnode, foundtype); /* Read in the symlink and follow it. */ - if (ctx->currnode->type == GRUB_FSHELP_SYMLINK) + if (ctx->currnode->type == VasEBoot_FSHELP_SYMLINK) { char *symlink; /* Test if the symlink does not loop. */ if (++ctx->symlinknest == 8) - return grub_error (GRUB_ERR_SYMLINK_LOOP, + return VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); symlink = read_symlink (ctx->currnode->node); if (!symlink) - return grub_errno; + return VasEBoot_errno; /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') @@ -247,49 +247,49 @@ find_file (char *currpath, /* Lookup the node the symlink points to. */ find_file (symlink, iterate_dir, lookup_file, read_symlink, ctx); - grub_free (symlink); + VasEBoot_free (symlink); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; } } - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), ctx->path); } -static grub_err_t -grub_fshelp_find_file_real (const char *path, grub_fshelp_node_t rootnode, - grub_fshelp_node_t *foundnode, +static VasEBoot_err_t +VasEBoot_fshelp_find_file_real (const char *path, VasEBoot_fshelp_node_t rootnode, + VasEBoot_fshelp_node_t *foundnode, iterate_dir_func iterate_dir, lookup_file_func lookup_file, read_symlink_func read_symlink, - enum grub_fshelp_filetype expecttype) + enum VasEBoot_fshelp_filetype expecttype) { - struct grub_fshelp_find_file_ctx ctx = { + struct VasEBoot_fshelp_find_file_ctx ctx = { .path = path, .rootnode = rootnode, .symlinknest = 0, .currnode = 0 }; - grub_err_t err; - enum grub_fshelp_filetype foundtype; + VasEBoot_err_t err; + enum VasEBoot_fshelp_filetype foundtype; char *duppath; if (!path || path[0] != '/') { - return grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path); + return VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path); } err = go_to_root (&ctx); if (err) return err; - duppath = grub_strdup (path); + duppath = VasEBoot_strdup (path); if (!duppath) - return grub_errno; + return VasEBoot_errno; err = find_file (duppath, iterate_dir, lookup_file, read_symlink, &ctx); - grub_free (duppath); + VasEBoot_free (duppath); if (err) { free_stack (&ctx); @@ -303,10 +303,10 @@ grub_fshelp_find_file_real (const char *path, grub_fshelp_node_t rootnode, free_stack (&ctx); /* Check if the node that was found was of the expected type. */ - if (expecttype == GRUB_FSHELP_REG && foundtype != expecttype) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file")); - else if (expecttype == GRUB_FSHELP_DIR && foundtype != expecttype) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + if (expecttype == VasEBoot_FSHELP_REG && foundtype != expecttype) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a regular file")); + else if (expecttype == VasEBoot_FSHELP_DIR && foundtype != expecttype) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); return 0; } @@ -318,27 +318,27 @@ grub_fshelp_find_file_real (const char *path, grub_fshelp_node_t rootnode, READ_SYMLINK is used to read the symlink if a node is a symlink. EXPECTTYPE is the type node that is expected by the called, an error is generated if the node is not of the expected type. */ -grub_err_t -grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, - grub_fshelp_node_t *foundnode, +VasEBoot_err_t +VasEBoot_fshelp_find_file (const char *path, VasEBoot_fshelp_node_t rootnode, + VasEBoot_fshelp_node_t *foundnode, iterate_dir_func iterate_dir, read_symlink_func read_symlink, - enum grub_fshelp_filetype expecttype) + enum VasEBoot_fshelp_filetype expecttype) { - return grub_fshelp_find_file_real (path, rootnode, foundnode, + return VasEBoot_fshelp_find_file_real (path, rootnode, foundnode, iterate_dir, NULL, read_symlink, expecttype); } -grub_err_t -grub_fshelp_find_file_lookup (const char *path, grub_fshelp_node_t rootnode, - grub_fshelp_node_t *foundnode, +VasEBoot_err_t +VasEBoot_fshelp_find_file_lookup (const char *path, VasEBoot_fshelp_node_t rootnode, + VasEBoot_fshelp_node_t *foundnode, lookup_file_func lookup_file, read_symlink_func read_symlink, - enum grub_fshelp_filetype expecttype) + enum VasEBoot_fshelp_filetype expecttype) { - return grub_fshelp_find_file_real (path, rootnode, foundnode, + return VasEBoot_fshelp_find_file_real (path, rootnode, foundnode, NULL, lookup_file, read_symlink, expecttype); @@ -350,21 +350,21 @@ grub_fshelp_find_file_lookup (const char *path, grub_fshelp_node_t rootnode, the DATA argument to READ_HOOK. GET_BLOCK is used to translate file blocks to disk blocks. The file is FILESIZE bytes big and the blocks have a size of LOG2BLOCKSIZE (in log2). */ -grub_ssize_t -grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf, - grub_disk_addr_t (*get_block) (grub_fshelp_node_t node, - grub_disk_addr_t block), - grub_off_t filesize, int log2blocksize, - grub_disk_addr_t blocks_start) +VasEBoot_ssize_t +VasEBoot_fshelp_read_file (VasEBoot_disk_t disk, VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf, + VasEBoot_disk_addr_t (*get_block) (VasEBoot_fshelp_node_t node, + VasEBoot_disk_addr_t block), + VasEBoot_off_t filesize, int log2blocksize, + VasEBoot_disk_addr_t blocks_start) { - grub_disk_addr_t i, blockcnt; - int blocksize = 1 << (log2blocksize + GRUB_DISK_SECTOR_BITS); + VasEBoot_disk_addr_t i, blockcnt; + int blocksize = 1 << (log2blocksize + VasEBoot_DISK_SECTOR_BITS); if (pos > filesize) { - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read past the end of file")); return -1; } @@ -373,18 +373,18 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, if (pos + len > filesize) len = filesize - pos; - blockcnt = ((len + pos) + blocksize - 1) >> (log2blocksize + GRUB_DISK_SECTOR_BITS); + blockcnt = ((len + pos) + blocksize - 1) >> (log2blocksize + VasEBoot_DISK_SECTOR_BITS); - for (i = pos >> (log2blocksize + GRUB_DISK_SECTOR_BITS); i < blockcnt; i++) + for (i = pos >> (log2blocksize + VasEBoot_DISK_SECTOR_BITS); i < blockcnt; i++) { - grub_disk_addr_t blknr; + VasEBoot_disk_addr_t blknr; int blockoff = pos & (blocksize - 1); int blockend = blocksize; int skipfirst = 0; blknr = get_block (node, i); - if (grub_errno) + if (VasEBoot_errno) return -1; blknr = blknr << log2blocksize; @@ -400,7 +400,7 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, } /* First block. */ - if (i == (pos >> (log2blocksize + GRUB_DISK_SECTOR_BITS))) + if (i == (pos >> (log2blocksize + VasEBoot_DISK_SECTOR_BITS))) { skipfirst = blockoff; blockend -= skipfirst; @@ -413,14 +413,14 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, disk->read_hook = read_hook; disk->read_hook_data = read_hook_data; - grub_disk_read (disk, blknr + blocks_start, skipfirst, + VasEBoot_disk_read (disk, blknr + blocks_start, skipfirst, blockend, buf); disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; } else - grub_memset (buf, 0, blockend); + VasEBoot_memset (buf, 0, blockend); buf += blocksize - skipfirst; } diff --git a/VasEBoot-core/fs/hfs.c b/VasEBoot-core/fs/hfs.c index fc3683178..21fd53e5e 100644 --- a/VasEBoot-core/fs/hfs.c +++ b/VasEBoot-core/fs/hfs.c @@ -1,95 +1,95 @@ /* hfs.c - HFS. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* HFS is documented at http://developer.apple.com/documentation/mac/Files/Files-2.html */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_HFS_SBLOCK 2 -#define GRUB_HFS_EMBED_HFSPLUS_SIG 0x482B +#define VasEBoot_HFS_SBLOCK 2 +#define VasEBoot_HFS_EMBED_HFSPLUS_SIG 0x482B -#define GRUB_HFS_BLKS (data->blksz >> 9) +#define VasEBoot_HFS_BLKS (data->blksz >> 9) -#define GRUB_HFS_NODE_LEAF 0xFF +#define VasEBoot_HFS_NODE_LEAF 0xFF /* The two supported filesystems a record can have. */ enum { - GRUB_HFS_FILETYPE_DIR = 1, - GRUB_HFS_FILETYPE_FILE = 2 + VasEBoot_HFS_FILETYPE_DIR = 1, + VasEBoot_HFS_FILETYPE_FILE = 2 }; /* Catalog node ID (CNID). */ -enum grub_hfs_cnid_type +enum VasEBoot_hfs_cnid_type { - GRUB_HFS_CNID_ROOT_PARENT = 1, - GRUB_HFS_CNID_ROOT = 2, - GRUB_HFS_CNID_EXT = 3, - GRUB_HFS_CNID_CAT = 4, - GRUB_HFS_CNID_BAD = 5 + VasEBoot_HFS_CNID_ROOT_PARENT = 1, + VasEBoot_HFS_CNID_ROOT = 2, + VasEBoot_HFS_CNID_EXT = 3, + VasEBoot_HFS_CNID_CAT = 4, + VasEBoot_HFS_CNID_BAD = 5 }; /* A node descriptor. This is the header of every node. */ -struct grub_hfs_node +struct VasEBoot_hfs_node { - grub_uint32_t next; - grub_uint32_t prev; - grub_uint8_t type; - grub_uint8_t level; - grub_uint16_t reccnt; - grub_uint16_t unused; -} GRUB_PACKED; + VasEBoot_uint32_t next; + VasEBoot_uint32_t prev; + VasEBoot_uint8_t type; + VasEBoot_uint8_t level; + VasEBoot_uint16_t reccnt; + VasEBoot_uint16_t unused; +} VasEBoot_PACKED; /* The head of the B*-Tree. */ -struct grub_hfs_treeheader +struct VasEBoot_hfs_treeheader { - grub_uint16_t tree_depth; + VasEBoot_uint16_t tree_depth; /* The number of the first node. */ - grub_uint32_t root_node; - grub_uint32_t leaves; - grub_uint32_t first_leaf; - grub_uint32_t last_leaf; - grub_uint16_t node_size; - grub_uint16_t key_size; - grub_uint32_t nodes; - grub_uint32_t free_nodes; - grub_uint8_t unused[76]; -} GRUB_PACKED; + VasEBoot_uint32_t root_node; + VasEBoot_uint32_t leaves; + VasEBoot_uint32_t first_leaf; + VasEBoot_uint32_t last_leaf; + VasEBoot_uint16_t node_size; + VasEBoot_uint16_t key_size; + VasEBoot_uint32_t nodes; + VasEBoot_uint32_t free_nodes; + VasEBoot_uint8_t unused[76]; +} VasEBoot_PACKED; /* The state of a mounted HFS filesystem. */ -struct grub_hfs_data +struct VasEBoot_hfs_data { - struct grub_hfs_sblock sblock; - grub_disk_t disk; - grub_hfs_datarecord_t extents; + struct VasEBoot_hfs_sblock sblock; + VasEBoot_disk_t disk; + VasEBoot_hfs_datarecord_t extents; int fileid; int size; int ext_root; @@ -103,101 +103,101 @@ struct grub_hfs_data /* The key as used on disk in a catalog tree. This is used to lookup file/directory nodes by parent directory ID and filename. */ -struct grub_hfs_catalog_key +struct VasEBoot_hfs_catalog_key { - grub_uint8_t unused; - grub_uint32_t parent_dir; + VasEBoot_uint8_t unused; + VasEBoot_uint32_t parent_dir; /* Filename length. */ - grub_uint8_t strlen; + VasEBoot_uint8_t strlen; /* Filename. */ - grub_uint8_t str[31]; -} GRUB_PACKED; + VasEBoot_uint8_t str[31]; +} VasEBoot_PACKED; /* The key as used on disk in a extent overflow tree. Using this key the extents can be looked up using a fileid and logical start block as index. */ -struct grub_hfs_extent_key +struct VasEBoot_hfs_extent_key { /* The kind of fork. This is used to store meta information like icons, attributes, etc. We will only use the datafork, which is 0. */ - grub_uint8_t forktype; - grub_uint32_t fileid; - grub_uint16_t first_block; -} GRUB_PACKED; + VasEBoot_uint8_t forktype; + VasEBoot_uint32_t fileid; + VasEBoot_uint16_t first_block; +} VasEBoot_PACKED; /* A directory record. This is used to find out the directory ID. */ -struct grub_hfs_dirrec +struct VasEBoot_hfs_dirrec { /* For a directory, type == 1. */ - grub_uint8_t type; - grub_uint8_t unused[5]; - grub_uint32_t dirid; - grub_uint32_t ctime; - grub_uint32_t mtime; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t unused[5]; + VasEBoot_uint32_t dirid; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t mtime; +} VasEBoot_PACKED; /* Information about a file. */ -struct grub_hfs_filerec +struct VasEBoot_hfs_filerec { /* For a file, type == 2. */ - grub_uint8_t type; - grub_uint8_t unused[19]; - grub_uint32_t fileid; - grub_uint8_t unused2[2]; - grub_uint32_t size; - grub_uint8_t unused3[18]; - grub_uint32_t mtime; - grub_uint8_t unused4[22]; + VasEBoot_uint8_t type; + VasEBoot_uint8_t unused[19]; + VasEBoot_uint32_t fileid; + VasEBoot_uint8_t unused2[2]; + VasEBoot_uint32_t size; + VasEBoot_uint8_t unused3[18]; + VasEBoot_uint32_t mtime; + VasEBoot_uint8_t unused4[22]; /* The first 3 extents of the file. The other extents can be found in the extent overflow file. */ - grub_hfs_datarecord_t extents; -} GRUB_PACKED; + VasEBoot_hfs_datarecord_t extents; +} VasEBoot_PACKED; /* A record descriptor, both key and data, used to pass to call back functions. */ -struct grub_hfs_record +struct VasEBoot_hfs_record { void *key; - grub_size_t keylen; + VasEBoot_size_t keylen; void *data; - grub_size_t datalen; + VasEBoot_size_t datalen; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static int grub_hfs_find_node (struct grub_hfs_data *, char *, - grub_uint32_t, int, char *, grub_size_t); +static int VasEBoot_hfs_find_node (struct VasEBoot_hfs_data *, char *, + VasEBoot_uint32_t, int, char *, VasEBoot_size_t); /* Find block BLOCK of the file FILE in the mounted UFS filesystem DATA. The first 3 extents are described by DAT. If cache is set, using caching to improve non-random reads. */ static unsigned int -grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, +VasEBoot_hfs_block (struct VasEBoot_hfs_data *data, VasEBoot_hfs_datarecord_t dat, int file, int block, int cache) { - grub_hfs_datarecord_t dr; + VasEBoot_hfs_datarecord_t dr; int pos = 0; - struct grub_hfs_extent_key key; + struct VasEBoot_hfs_extent_key key; int tree = 0; static int cache_file = 0; static int cache_pos = 0; - static grub_hfs_datarecord_t cache_dr; + static VasEBoot_hfs_datarecord_t cache_dr; - grub_memcpy (dr, dat, sizeof (dr)); + VasEBoot_memcpy (dr, dat, sizeof (dr)); key.forktype = 0; - key.fileid = grub_cpu_to_be32 (file); + key.fileid = VasEBoot_cpu_to_be32 (file); if (cache && cache_file == file && block > cache_pos) { pos = cache_pos; - key.first_block = grub_cpu_to_be16 (pos); - grub_memcpy (dr, cache_dr, sizeof (cache_dr)); + key.first_block = VasEBoot_cpu_to_be16 (pos); + VasEBoot_memcpy (dr, cache_dr, sizeof (cache_dr)); } for (;;) @@ -208,9 +208,9 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, for (i = 0; i < 3; i++) { /* Check if the block is stored in this extent. */ - if (grub_be_to_cpu16 (dr[i].count) + pos > block) + if (VasEBoot_be_to_cpu16 (dr[i].count) + pos > block) { - int first = grub_be_to_cpu16 (dr[i].first_block); + int first = VasEBoot_be_to_cpu16 (dr[i].first_block); /* If the cache is enabled, store the current position in the tree. */ @@ -218,23 +218,23 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, { cache_file = file; cache_pos = pos; - grub_memcpy (cache_dr, dr, sizeof (cache_dr)); + VasEBoot_memcpy (cache_dr, dr, sizeof (cache_dr)); } - return (grub_be_to_cpu16 (data->sblock.first_block) - + (first + block - pos) * GRUB_HFS_BLKS); + return (VasEBoot_be_to_cpu16 (data->sblock.first_block) + + (first + block - pos) * VasEBoot_HFS_BLKS); } /* Try the next extent. */ - pos += grub_be_to_cpu16 (dr[i].count); + pos += VasEBoot_be_to_cpu16 (dr[i].count); } /* Lookup the block in the extent overflow file. */ - key.first_block = grub_cpu_to_be16 (pos); + key.first_block = VasEBoot_cpu_to_be16 (pos); tree = 1; - grub_hfs_find_node (data, (char *) &key, data->ext_root, + VasEBoot_hfs_find_node (data, (char *) &key, data->ext_root, 1, (char *) &dr, sizeof (dr)); - if (grub_errno) + if (VasEBoot_errno) return 0; } } @@ -242,13 +242,13 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_hfs_read_file (struct grub_hfs_data *data, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_uint32_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_hfs_read_file (struct VasEBoot_hfs_data *data, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_uint32_t pos, VasEBoot_size_t len, char *buf) { - grub_off_t i; - grub_off_t blockcnt; + VasEBoot_off_t i; + VasEBoot_off_t blockcnt; /* Files are at most 2G/4G - 1 bytes on hfs. Avoid 64-bit division. Moreover len > 0 as checked in upper layer. */ @@ -256,16 +256,16 @@ grub_hfs_read_file (struct grub_hfs_data *data, for (i = pos / data->blksz; i < blockcnt; i++) { - grub_disk_addr_t blknr; - grub_off_t blockoff; - grub_off_t blockend = data->blksz; + VasEBoot_disk_addr_t blknr; + VasEBoot_off_t blockoff; + VasEBoot_off_t blockend = data->blksz; int skipfirst = 0; blockoff = pos % data->blksz; - blknr = grub_hfs_block (data, data->extents, data->fileid, i, 1); - if (grub_errno) + blknr = VasEBoot_hfs_block (data, data->extents, data->fileid, i, 1); + if (VasEBoot_errno) return -1; /* Last block. */ @@ -291,10 +291,10 @@ grub_hfs_read_file (struct grub_hfs_data *data, { data->disk->read_hook = read_hook; data->disk->read_hook_data = read_hook_data; - grub_disk_read (data->disk, blknr, skipfirst, + VasEBoot_disk_read (data->disk, blknr, skipfirst, blockend, buf); data->disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; } @@ -306,68 +306,68 @@ grub_hfs_read_file (struct grub_hfs_data *data, /* Mount the filesystem on the disk DISK. */ -static struct grub_hfs_data * -grub_hfs_mount (grub_disk_t disk) +static struct VasEBoot_hfs_data * +VasEBoot_hfs_mount (VasEBoot_disk_t disk) { - struct grub_hfs_data *data; - struct grub_hfs_catalog_key key; - struct grub_hfs_dirrec dir; + struct VasEBoot_hfs_data *data; + struct VasEBoot_hfs_catalog_key key; + struct VasEBoot_hfs_dirrec dir; int first_block; struct { - struct grub_hfs_node node; - struct grub_hfs_treeheader head; + struct VasEBoot_hfs_node node; + struct VasEBoot_hfs_treeheader head; } treehead; - data = grub_malloc (sizeof (struct grub_hfs_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_hfs_data)); if (!data) return 0; /* Read the superblock. */ - if (grub_disk_read (disk, GRUB_HFS_SBLOCK, 0, - sizeof (struct grub_hfs_sblock), &data->sblock)) + if (VasEBoot_disk_read (disk, VasEBoot_HFS_SBLOCK, 0, + sizeof (struct VasEBoot_hfs_sblock), &data->sblock)) goto fail; /* Check if this is a HFS filesystem. */ - if (grub_be_to_cpu16 (data->sblock.magic) != GRUB_HFS_MAGIC + if (VasEBoot_be_to_cpu16 (data->sblock.magic) != VasEBoot_HFS_MAGIC || data->sblock.blksz == 0 - || (data->sblock.blksz & grub_cpu_to_be32_compile_time (0xc00001ff))) + || (data->sblock.blksz & VasEBoot_cpu_to_be32_compile_time (0xc00001ff))) { - grub_error (GRUB_ERR_BAD_FS, "not an HFS filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an HFS filesystem"); goto fail; } /* Check if this is an embedded HFS+ filesystem. */ - if (grub_be_to_cpu16 (data->sblock.embed_sig) == GRUB_HFS_EMBED_HFSPLUS_SIG) + if (VasEBoot_be_to_cpu16 (data->sblock.embed_sig) == VasEBoot_HFS_EMBED_HFSPLUS_SIG) { - grub_error (GRUB_ERR_BAD_FS, "embedded HFS+ filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "embedded HFS+ filesystem"); goto fail; } - data->blksz = grub_be_to_cpu32 (data->sblock.blksz); + data->blksz = VasEBoot_be_to_cpu32 (data->sblock.blksz); data->disk = disk; /* Lookup the root node of the extent overflow tree. */ - first_block = ((grub_be_to_cpu16 (data->sblock.extent_recs[0].first_block) - * GRUB_HFS_BLKS) - + grub_be_to_cpu16 (data->sblock.first_block)); + first_block = ((VasEBoot_be_to_cpu16 (data->sblock.extent_recs[0].first_block) + * VasEBoot_HFS_BLKS) + + VasEBoot_be_to_cpu16 (data->sblock.first_block)); - if (grub_disk_read (data->disk, first_block, 0, + if (VasEBoot_disk_read (data->disk, first_block, 0, sizeof (treehead), &treehead)) goto fail; - data->ext_root = grub_be_to_cpu32 (treehead.head.root_node); - data->ext_size = grub_be_to_cpu16 (treehead.head.node_size); + data->ext_root = VasEBoot_be_to_cpu32 (treehead.head.root_node); + data->ext_size = VasEBoot_be_to_cpu16 (treehead.head.node_size); /* Lookup the root node of the catalog tree. */ - first_block = ((grub_be_to_cpu16 (data->sblock.catalog_recs[0].first_block) - * GRUB_HFS_BLKS) - + grub_be_to_cpu16 (data->sblock.first_block)); - if (grub_disk_read (data->disk, first_block, 0, + first_block = ((VasEBoot_be_to_cpu16 (data->sblock.catalog_recs[0].first_block) + * VasEBoot_HFS_BLKS) + + VasEBoot_be_to_cpu16 (data->sblock.first_block)); + if (VasEBoot_disk_read (data->disk, first_block, 0, sizeof (treehead), &treehead)) goto fail; - data->cat_root = grub_be_to_cpu32 (treehead.head.root_node); - data->cat_size = grub_be_to_cpu16 (treehead.head.node_size); + data->cat_root = VasEBoot_be_to_cpu32 (treehead.head.root_node); + data->cat_size = VasEBoot_be_to_cpu16 (treehead.head.node_size); if (data->cat_size == 0 || data->blksz < data->cat_size @@ -376,36 +376,36 @@ grub_hfs_mount (grub_disk_t disk) /* Lookup the root directory node in the catalog tree using the volume name. */ - key.parent_dir = grub_cpu_to_be32_compile_time (1); + key.parent_dir = VasEBoot_cpu_to_be32_compile_time (1); key.strlen = data->sblock.volname[0]; - grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1)); + VasEBoot_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1)); - if (grub_hfs_find_node (data, (char *) &key, data->cat_root, + if (VasEBoot_hfs_find_node (data, (char *) &key, data->cat_root, 0, (char *) &dir, sizeof (dir)) == 0) { - grub_error (GRUB_ERR_BAD_FS, "cannot find the HFS root directory"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "cannot find the HFS root directory"); goto fail; } - if (grub_errno) + if (VasEBoot_errno) goto fail; - data->rootdir = grub_be_to_cpu32 (dir.dirid); + data->rootdir = VasEBoot_be_to_cpu32 (dir.dirid); return data; fail: - grub_free (data); + VasEBoot_free (data); - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a HFS filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a HFS filesystem"); return 0; } /* Compare the K1 and K2 catalog file keys using HFS character ordering. */ static int -grub_hfs_cmp_catkeys (const struct grub_hfs_catalog_key *k1, - const struct grub_hfs_catalog_key *k2) +VasEBoot_hfs_cmp_catkeys (const struct VasEBoot_hfs_catalog_key *k1, + const struct VasEBoot_hfs_catalog_key *k2) { /* Taken from hfsutils 3.2.6 and converted to a readable form */ static const unsigned char hfs_charorder[256] = { @@ -630,7 +630,7 @@ grub_hfs_cmp_catkeys (const struct grub_hfs_catalog_key *k1, int cmp; int minlen = (k1->strlen < k2->strlen) ? k1->strlen : k2->strlen; - cmp = (grub_be_to_cpu32 (k1->parent_dir) - grub_be_to_cpu32 (k2->parent_dir)); + cmp = (VasEBoot_be_to_cpu32 (k1->parent_dir) - VasEBoot_be_to_cpu32 (k2->parent_dir)); if (cmp != 0) return cmp; @@ -648,15 +648,15 @@ grub_hfs_cmp_catkeys (const struct grub_hfs_catalog_key *k1, /* Compare the K1 and K2 extent overflow file keys. */ static int -grub_hfs_cmp_extkeys (const struct grub_hfs_extent_key *k1, - const struct grub_hfs_extent_key *k2) +VasEBoot_hfs_cmp_extkeys (const struct VasEBoot_hfs_extent_key *k1, + const struct VasEBoot_hfs_extent_key *k2) { int cmp = k1->forktype - k2->forktype; if (cmp == 0) - cmp = grub_be_to_cpu32 (k1->fileid) - grub_be_to_cpu32 (k2->fileid); + cmp = VasEBoot_be_to_cpu32 (k1->fileid) - VasEBoot_be_to_cpu32 (k2->fileid); if (cmp == 0) - cmp = (grub_be_to_cpu16 (k1->first_block) - - grub_be_to_cpu16 (k2->first_block)); + cmp = (VasEBoot_be_to_cpu16 (k1->first_block) + - VasEBoot_be_to_cpu16 (k2->first_block)); return cmp; } @@ -665,54 +665,54 @@ grub_hfs_cmp_extkeys (const struct grub_hfs_extent_key *k1, filesystem DATA. This node holds data of the type TYPE (0 = catalog node, 1 = extent overflow node). If this is set, continue iterating to the next node. For every records, call NODE_HOOK. */ -static grub_err_t -grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, - int this, int (*node_hook) (struct grub_hfs_node *hnd, - struct grub_hfs_record *, +static VasEBoot_err_t +VasEBoot_hfs_iterate_records (struct VasEBoot_hfs_data *data, int type, int idx, + int this, int (*node_hook) (struct VasEBoot_hfs_node *hnd, + struct VasEBoot_hfs_record *, void *hook_arg), void *hook_arg) { - grub_size_t nodesize = type == 0 ? data->cat_size : data->ext_size; + VasEBoot_size_t nodesize = type == 0 ? data->cat_size : data->ext_size; union node_union { - struct grub_hfs_node node; + struct VasEBoot_hfs_node node; char rawnode[0]; - grub_uint16_t offsets[0]; + VasEBoot_uint16_t offsets[0]; } *node; - if (nodesize < sizeof (struct grub_hfs_node)) - nodesize = sizeof (struct grub_hfs_node); + if (nodesize < sizeof (struct VasEBoot_hfs_node)) + nodesize = sizeof (struct VasEBoot_hfs_node); - node = grub_malloc (nodesize); + node = VasEBoot_malloc (nodesize); if (!node) - return grub_errno; + return VasEBoot_errno; do { int i; - struct grub_hfs_extent *dat; + struct VasEBoot_hfs_extent *dat; int blk; - grub_uint16_t reccnt; + VasEBoot_uint16_t reccnt; - dat = (struct grub_hfs_extent *) (type == 0 + dat = (struct VasEBoot_hfs_extent *) (type == 0 ? (&data->sblock.catalog_recs) : (&data->sblock.extent_recs)); /* Read the node into memory. */ - blk = grub_hfs_block (data, dat, - (type == 0) ? GRUB_HFS_CNID_CAT : GRUB_HFS_CNID_EXT, + blk = VasEBoot_hfs_block (data, dat, + (type == 0) ? VasEBoot_HFS_CNID_CAT : VasEBoot_HFS_CNID_EXT, idx / (data->blksz / nodesize), 0); blk += (idx % (data->blksz / nodesize)); - if (grub_errno || grub_disk_read (data->disk, blk, 0, + if (VasEBoot_errno || VasEBoot_disk_read (data->disk, blk, 0, nodesize, node)) { - grub_free (node); - return grub_errno; + VasEBoot_free (node); + return VasEBoot_errno; } - reccnt = grub_be_to_cpu16 (node->node.reccnt); + reccnt = VasEBoot_be_to_cpu16 (node->node.reccnt); if (reccnt > (nodesize >> 1)) reccnt = (nodesize >> 1); @@ -722,17 +722,17 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, int pos = (nodesize >> 1) - 1 - i; struct pointer { - grub_uint8_t keylen; - grub_uint8_t key; - } GRUB_PACKED *pnt; - grub_uint16_t off = grub_be_to_cpu16 (node->offsets[pos]); + VasEBoot_uint8_t keylen; + VasEBoot_uint8_t key; + } VasEBoot_PACKED *pnt; + VasEBoot_uint16_t off = VasEBoot_be_to_cpu16 (node->offsets[pos]); if (off > nodesize - sizeof(*pnt)) continue; pnt = (struct pointer *) (off + node->rawnode); - if (nodesize < (grub_size_t) off + pnt->keylen + 1) + if (nodesize < (VasEBoot_size_t) off + pnt->keylen + 1) continue; - struct grub_hfs_record rec = + struct VasEBoot_hfs_record rec = { &pnt->key, pnt->keylen, @@ -742,18 +742,18 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, if (node_hook (&node->node, &rec, hook_arg)) { - grub_free (node); + VasEBoot_free (node); return 0; } } - idx = grub_be_to_cpu32 (node->node.next); + idx = VasEBoot_be_to_cpu32 (node->node.next); } while (idx && this); - grub_free (node); + VasEBoot_free (node); return 0; } -struct grub_hfs_find_node_node_found_ctx +struct VasEBoot_hfs_find_node_node_found_ctx { int found; int isleaf; @@ -761,31 +761,31 @@ struct grub_hfs_find_node_node_found_ctx int type; const char *key; char *datar; - grub_size_t datalen; + VasEBoot_size_t datalen; }; static int -grub_hfs_find_node_node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec, +VasEBoot_hfs_find_node_node_found (struct VasEBoot_hfs_node *hnd, struct VasEBoot_hfs_record *rec, void *hook_arg) { - struct grub_hfs_find_node_node_found_ctx *ctx = hook_arg; + struct VasEBoot_hfs_find_node_node_found_ctx *ctx = hook_arg; int cmp = 1; if (ctx->type == 0) - cmp = grub_hfs_cmp_catkeys (rec->key, (const void *) ctx->key); + cmp = VasEBoot_hfs_cmp_catkeys (rec->key, (const void *) ctx->key); else - cmp = grub_hfs_cmp_extkeys (rec->key, (const void *) ctx->key); + cmp = VasEBoot_hfs_cmp_extkeys (rec->key, (const void *) ctx->key); /* If the key is smaller or equal to the current node, mark the entry. In case of a non-leaf mode it will be used to lookup the rest of the tree. */ if (cmp <= 0) - ctx->found = grub_be_to_cpu32 (grub_get_unaligned32 (rec->data)); + ctx->found = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (rec->data)); else /* The key can not be found in the tree. */ return 1; /* Check if this node is a leaf node. */ - if (hnd->type == GRUB_HFS_NODE_LEAF) + if (hnd->type == VasEBoot_HFS_NODE_LEAF) { ctx->isleaf = 1; @@ -794,7 +794,7 @@ grub_hfs_find_node_node_found (struct grub_hfs_node *hnd, struct grub_hfs_record { ctx->done = 1; - grub_memcpy (ctx->datar, rec->data, + VasEBoot_memcpy (ctx->datar, rec->data, rec->datalen < ctx->datalen ? rec->datalen : ctx->datalen); return 1; } @@ -809,10 +809,10 @@ grub_hfs_find_node_node_found (struct grub_hfs_node *hnd, struct grub_hfs_record the type TYPE (0 = catalog node, 1 = extent overflow node). Return the data in DATAR with a maximum length of DATALEN. */ static int -grub_hfs_find_node (struct grub_hfs_data *data, char *key, - grub_uint32_t idx, int type, char *datar, grub_size_t datalen) +VasEBoot_hfs_find_node (struct VasEBoot_hfs_data *data, char *key, + VasEBoot_uint32_t idx, int type, char *datar, VasEBoot_size_t datalen) { - struct grub_hfs_find_node_node_found_ctx ctx = + struct VasEBoot_hfs_find_node_node_found_ctx ctx = { .found = -1, .isleaf = 0, @@ -827,7 +827,7 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, { ctx.found = -1; - if (grub_hfs_iterate_records (data, type, idx, 0, grub_hfs_find_node_node_found, &ctx)) + if (VasEBoot_hfs_iterate_records (data, type, idx, 0, VasEBoot_hfs_find_node_node_found, &ctx)) return 0; if (ctx.found == -1) @@ -839,33 +839,33 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, return ctx.done; } -struct grub_hfs_iterate_dir_node_found_ctx +struct VasEBoot_hfs_iterate_dir_node_found_ctx { - grub_uint32_t dir_be; + VasEBoot_uint32_t dir_be; int found; int isleaf; - grub_uint32_t next; - int (*hook) (struct grub_hfs_record *, void *hook_arg); + VasEBoot_uint32_t next; + int (*hook) (struct VasEBoot_hfs_record *, void *hook_arg); void *hook_arg; }; static int -grub_hfs_iterate_dir_node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec, +VasEBoot_hfs_iterate_dir_node_found (struct VasEBoot_hfs_node *hnd, struct VasEBoot_hfs_record *rec, void *hook_arg) { - struct grub_hfs_iterate_dir_node_found_ctx *ctx = hook_arg; - struct grub_hfs_catalog_key *ckey = rec->key; + struct VasEBoot_hfs_iterate_dir_node_found_ctx *ctx = hook_arg; + struct VasEBoot_hfs_catalog_key *ckey = rec->key; /* The lowest key possible with DIR as root directory. */ - const struct grub_hfs_catalog_key key = {0, ctx->dir_be, 0, ""}; + const struct VasEBoot_hfs_catalog_key key = {0, ctx->dir_be, 0, ""}; - if (grub_hfs_cmp_catkeys (rec->key, &key) <= 0) - ctx->found = grub_be_to_cpu32 (grub_get_unaligned32 (rec->data)); + if (VasEBoot_hfs_cmp_catkeys (rec->key, &key) <= 0) + ctx->found = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (rec->data)); if (hnd->type == 0xFF && ckey->strlen > 0) { ctx->isleaf = 1; - ctx->next = grub_be_to_cpu32 (hnd->next); + ctx->next = VasEBoot_be_to_cpu32 (hnd->next); /* An entry was found. */ if (ckey->parent_dir == ctx->dir_be) @@ -876,12 +876,12 @@ grub_hfs_iterate_dir_node_found (struct grub_hfs_node *hnd, struct grub_hfs_reco } static int -grub_hfs_iterate_dir_it_dir (struct grub_hfs_node *hnd __attribute ((unused)), - struct grub_hfs_record *rec, +VasEBoot_hfs_iterate_dir_it_dir (struct VasEBoot_hfs_node *hnd __attribute ((unused)), + struct VasEBoot_hfs_record *rec, void *hook_arg) { - struct grub_hfs_catalog_key *ckey = rec->key; - struct grub_hfs_iterate_dir_node_found_ctx *ctx = hook_arg; + struct VasEBoot_hfs_catalog_key *ckey = rec->key; + struct VasEBoot_hfs_iterate_dir_node_found_ctx *ctx = hook_arg; /* Stop when the entries do not match anymore. */ if (ckey->parent_dir != ctx->dir_be) @@ -894,14 +894,14 @@ grub_hfs_iterate_dir_it_dir (struct grub_hfs_node *hnd __attribute ((unused)), /* Iterate over the directory with the id DIR. The tree is searched starting with the node ROOT_IDX. For every entry in this directory call HOOK. */ -static grub_err_t -grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, - grub_uint32_t dir, int (*hook) (struct grub_hfs_record *, void *hook_arg), +static VasEBoot_err_t +VasEBoot_hfs_iterate_dir (struct VasEBoot_hfs_data *data, VasEBoot_uint32_t root_idx, + VasEBoot_uint32_t dir, int (*hook) (struct VasEBoot_hfs_record *, void *hook_arg), void *hook_arg) { - struct grub_hfs_iterate_dir_node_found_ctx ctx = + struct VasEBoot_hfs_iterate_dir_node_found_ctx ctx = { - .dir_be = grub_cpu_to_be32 (dir), + .dir_be = VasEBoot_cpu_to_be32 (dir), .found = -1, .isleaf = 0, .next = 0, @@ -913,8 +913,8 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, { ctx.found = -1; - if (grub_hfs_iterate_records (data, 0, root_idx, 0, grub_hfs_iterate_dir_node_found, &ctx)) - return grub_errno; + if (VasEBoot_hfs_iterate_records (data, 0, root_idx, 0, VasEBoot_hfs_iterate_dir_node_found, &ctx)) + return VasEBoot_errno; if (ctx.found == -1) return 0; @@ -924,8 +924,8 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, /* If there was a matching record in this leaf node, continue the iteration until the last record was found. */ - grub_hfs_iterate_records (data, 0, ctx.next, 1, grub_hfs_iterate_dir_it_dir, &ctx); - return grub_errno; + VasEBoot_hfs_iterate_records (data, 0, ctx.next, 1, VasEBoot_hfs_iterate_dir_it_dir, &ctx); + return VasEBoot_errno; } #define MAX_UTF8_PER_MAC_ROMAN 3 @@ -1063,11 +1063,11 @@ static const char macroman[0x80][MAX_UTF8_PER_MAC_ROMAN + 1] = }; static void -macroman_to_utf8 (char *to, const grub_uint8_t *from, grub_size_t len, +macroman_to_utf8 (char *to, const VasEBoot_uint8_t *from, VasEBoot_size_t len, int translate_slash) { char *optr = to; - const grub_uint8_t *iptr; + const VasEBoot_uint8_t *iptr; for (iptr = from; iptr < from + len && *iptr; iptr++) { @@ -1082,16 +1082,16 @@ macroman_to_utf8 (char *to, const grub_uint8_t *from, grub_size_t len, *optr++ = *iptr; continue; } - optr = grub_stpcpy (optr, macroman[*iptr & 0x7f]); + optr = VasEBoot_stpcpy (optr, macroman[*iptr & 0x7f]); } *optr = 0; } -static grub_ssize_t -utf8_to_macroman (grub_uint8_t *to, const char *from) +static VasEBoot_ssize_t +utf8_to_macroman (VasEBoot_uint8_t *to, const char *from) { - grub_uint8_t *end = to + 31; - grub_uint8_t *optr = to; + VasEBoot_uint8_t *end = to + 31; + VasEBoot_uint8_t *optr = to; const char *iptr = from; while (*iptr && optr < end) @@ -1113,7 +1113,7 @@ utf8_to_macroman (grub_uint8_t *to, const char *from) if ((*iptr & 0xf0) == 0xe0) clen++; for (i = 0; i < 0x80; i++) - if (grub_memcmp (macroman[i], iptr, clen) == 0) + if (VasEBoot_memcmp (macroman[i], iptr, clen) == 0) break; if (i == 0x80) break; @@ -1126,103 +1126,103 @@ utf8_to_macroman (grub_uint8_t *to, const char *from) return optr - to; } -union grub_hfs_anyrec { - struct grub_hfs_filerec frec; - struct grub_hfs_dirrec dir; +union VasEBoot_hfs_anyrec { + struct VasEBoot_hfs_filerec frec; + struct VasEBoot_hfs_dirrec dir; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_hfs_data *data; - union grub_hfs_anyrec fdrec; - grub_uint32_t inode; + struct VasEBoot_hfs_data *data; + union VasEBoot_hfs_anyrec fdrec; + VasEBoot_uint32_t inode; }; -static grub_err_t -lookup_file (grub_fshelp_node_t dir, +static VasEBoot_err_t +lookup_file (VasEBoot_fshelp_node_t dir, const char *name, - grub_fshelp_node_t *foundnode, - enum grub_fshelp_filetype *foundtype) + VasEBoot_fshelp_node_t *foundnode, + enum VasEBoot_fshelp_filetype *foundtype) { - struct grub_hfs_catalog_key key; - grub_ssize_t slen; - union grub_hfs_anyrec fdrec; + struct VasEBoot_hfs_catalog_key key; + VasEBoot_ssize_t slen; + union VasEBoot_hfs_anyrec fdrec; - key.parent_dir = grub_cpu_to_be32 (dir->inode); + key.parent_dir = VasEBoot_cpu_to_be32 (dir->inode); slen = utf8_to_macroman (key.str, name); if (slen < 0) /* Not found */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; key.strlen = slen; /* Lookup this node. */ - if (! grub_hfs_find_node (dir->data, (char *) &key, dir->data->cat_root, + if (! VasEBoot_hfs_find_node (dir->data, (char *) &key, dir->data->cat_root, 0, (char *) &fdrec.frec, sizeof (fdrec.frec))) /* Not found */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - *foundnode = grub_malloc (sizeof (struct grub_fshelp_node)); + *foundnode = VasEBoot_malloc (sizeof (struct VasEBoot_fshelp_node)); if (!*foundnode) - return grub_errno; + return VasEBoot_errno; - (*foundnode)->inode = grub_be_to_cpu32 (fdrec.dir.dirid); + (*foundnode)->inode = VasEBoot_be_to_cpu32 (fdrec.dir.dirid); (*foundnode)->fdrec = fdrec; (*foundnode)->data = dir->data; - *foundtype = (fdrec.frec.type == GRUB_HFS_FILETYPE_DIR) ? GRUB_FSHELP_DIR : GRUB_FSHELP_REG; - return GRUB_ERR_NONE; + *foundtype = (fdrec.frec.type == VasEBoot_HFS_FILETYPE_DIR) ? VasEBoot_FSHELP_DIR : VasEBoot_FSHELP_REG; + return VasEBoot_ERR_NONE; } /* Find a file or directory with the pathname PATH in the filesystem DATA. Return the file record in RETDATA when it is non-zero. Return the directory number in RETINODE when it is non-zero. */ -static grub_err_t -grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, - grub_fshelp_node_t *found, - enum grub_fshelp_filetype exptype) +static VasEBoot_err_t +VasEBoot_hfs_find_dir (struct VasEBoot_hfs_data *data, const char *path, + VasEBoot_fshelp_node_t *found, + enum VasEBoot_fshelp_filetype exptype) { - struct grub_fshelp_node root = { + struct VasEBoot_fshelp_node root = { .data = data, .inode = data->rootdir, .fdrec = { .frec = { - .type = GRUB_HFS_FILETYPE_DIR + .type = VasEBoot_HFS_FILETYPE_DIR } } }; - grub_err_t err; + VasEBoot_err_t err; - err = grub_fshelp_find_file_lookup (path, &root, found, lookup_file, NULL, exptype); + err = VasEBoot_fshelp_find_file_lookup (path, &root, found, lookup_file, NULL, exptype); if (&root == *found) { - *found = grub_malloc (sizeof (root)); + *found = VasEBoot_malloc (sizeof (root)); if (!*found) - return grub_errno; - grub_memcpy (*found, &root, sizeof (root)); + return VasEBoot_errno; + VasEBoot_memcpy (*found, &root, sizeof (root)); } return err; } -struct grub_hfs_dir_hook_ctx +struct VasEBoot_hfs_dir_hook_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; static int -grub_hfs_dir_hook (struct grub_hfs_record *rec, void *hook_arg) +VasEBoot_hfs_dir_hook (struct VasEBoot_hfs_record *rec, void *hook_arg) { - struct grub_hfs_dir_hook_ctx *ctx = hook_arg; - struct grub_hfs_dirrec *drec = rec->data; - struct grub_hfs_filerec *frec = rec->data; - struct grub_hfs_catalog_key *ckey = rec->key; + struct VasEBoot_hfs_dir_hook_ctx *ctx = hook_arg; + struct VasEBoot_hfs_dirrec *drec = rec->data; + struct VasEBoot_hfs_filerec *frec = rec->data; + struct VasEBoot_hfs_catalog_key *ckey = rec->key; char fname[sizeof (ckey->str) * MAX_UTF8_PER_MAC_ROMAN + 1]; - struct grub_dirhook_info info; - grub_size_t len; + struct VasEBoot_dirhook_info info; + VasEBoot_size_t len; - grub_memset (fname, 0, sizeof (fname)); + VasEBoot_memset (fname, 0, sizeof (fname)); - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); len = ckey->strlen; if (len > sizeof (ckey->str)) @@ -1231,22 +1231,22 @@ grub_hfs_dir_hook (struct grub_hfs_record *rec, void *hook_arg) info.case_insensitive = 1; - if (drec->type == GRUB_HFS_FILETYPE_DIR) + if (drec->type == VasEBoot_HFS_FILETYPE_DIR) { info.dir = 1; info.mtimeset = 1; info.inodeset = 1; - info.mtime = grub_be_to_cpu32 (drec->mtime) - 2082844800; - info.inode = grub_be_to_cpu32 (drec->dirid); + info.mtime = VasEBoot_be_to_cpu32 (drec->mtime) - 2082844800; + info.inode = VasEBoot_be_to_cpu32 (drec->dirid); return ctx->hook (fname, &info, ctx->hook_data); } - if (frec->type == GRUB_HFS_FILETYPE_FILE) + if (frec->type == VasEBoot_HFS_FILETYPE_FILE) { info.dir = 0; info.mtimeset = 1; info.inodeset = 1; - info.mtime = grub_be_to_cpu32 (frec->mtime) - 2082844800; - info.inode = grub_be_to_cpu32 (frec->fileid); + info.mtime = VasEBoot_be_to_cpu32 (frec->mtime) - 2082844800; + info.inode = VasEBoot_be_to_cpu32 (frec->fileid); return ctx->hook (fname, &info, ctx->hook_data); } @@ -1254,113 +1254,113 @@ grub_hfs_dir_hook (struct grub_hfs_record *rec, void *hook_arg) } -static grub_err_t -grub_hfs_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, +static VasEBoot_err_t +VasEBoot_hfs_dir (VasEBoot_device_t device, const char *path, VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_hfs_data *data; - struct grub_hfs_dir_hook_ctx ctx = + struct VasEBoot_hfs_data *data; + struct VasEBoot_hfs_dir_hook_ctx ctx = { .hook = hook, .hook_data = hook_data }; - grub_fshelp_node_t found = NULL; + VasEBoot_fshelp_node_t found = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfs_mount (device->disk); + data = VasEBoot_hfs_mount (device->disk); if (!data) goto fail; /* First the directory ID for the directory. */ - if (grub_hfs_find_dir (data, path, &found, GRUB_FSHELP_DIR)) + if (VasEBoot_hfs_find_dir (data, path, &found, VasEBoot_FSHELP_DIR)) goto fail; - grub_hfs_iterate_dir (data, data->cat_root, found->inode, grub_hfs_dir_hook, &ctx); + VasEBoot_hfs_iterate_dir (data, data->cat_root, found->inode, VasEBoot_hfs_dir_hook, &ctx); fail: - grub_free (found); - grub_free (data); + VasEBoot_free (found); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_hfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_hfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_hfs_data *data; - grub_fshelp_node_t found = NULL; + struct VasEBoot_hfs_data *data; + VasEBoot_fshelp_node_t found = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfs_mount (file->device->disk); + data = VasEBoot_hfs_mount (file->device->disk); if (!data) { - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } - if (grub_hfs_find_dir (data, name, &found, GRUB_FSHELP_REG)) + if (VasEBoot_hfs_find_dir (data, name, &found, VasEBoot_FSHELP_REG)) { - grub_free (data); - grub_free (found); - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_free (data); + VasEBoot_free (found); + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } - grub_memcpy (data->extents, found->fdrec.frec.extents, sizeof (grub_hfs_datarecord_t)); - file->size = grub_be_to_cpu32 (found->fdrec.frec.size); - data->size = grub_be_to_cpu32 (found->fdrec.frec.size); - data->fileid = grub_be_to_cpu32 (found->fdrec.frec.fileid); + VasEBoot_memcpy (data->extents, found->fdrec.frec.extents, sizeof (VasEBoot_hfs_datarecord_t)); + file->size = VasEBoot_be_to_cpu32 (found->fdrec.frec.size); + data->size = VasEBoot_be_to_cpu32 (found->fdrec.frec.size); + data->fileid = VasEBoot_be_to_cpu32 (found->fdrec.frec.fileid); file->offset = 0; file->data = data; - grub_free (found); + VasEBoot_free (found); return 0; } -static grub_ssize_t -grub_hfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_hfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_hfs_data *data = - (struct grub_hfs_data *) file->data; + struct VasEBoot_hfs_data *data = + (struct VasEBoot_hfs_data *) file->data; - return grub_hfs_read_file (data, file->read_hook, file->read_hook_data, + return VasEBoot_hfs_read_file (data, file->read_hook, file->read_hook_data, file->offset, len, buf); } -static grub_err_t -grub_hfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_hfs_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); return 0; } -static grub_err_t -grub_hfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_hfs_label (VasEBoot_device_t device, char **label) { - struct grub_hfs_data *data; + struct VasEBoot_hfs_data *data; - data = grub_hfs_mount (device->disk); + data = VasEBoot_hfs_mount (device->disk); if (data) { - grub_size_t len = data->sblock.volname[0]; + VasEBoot_size_t len = data->sblock.volname[0]; if (len > sizeof (data->sblock.volname) - 1) len = sizeof (data->sblock.volname) - 1; - *label = grub_malloc (len * MAX_UTF8_PER_MAC_ROMAN + 1); + *label = VasEBoot_malloc (len * MAX_UTF8_PER_MAC_ROMAN + 1); if (*label) macroman_to_utf8 (*label, data->sblock.volname + 1, len + 1, 0); @@ -1368,76 +1368,76 @@ grub_hfs_label (grub_device_t device, char **label) else *label = 0; - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } -static grub_err_t -grub_hfs_mtime (grub_device_t device, grub_int32_t *tm) +static VasEBoot_err_t +VasEBoot_hfs_mtime (VasEBoot_device_t device, VasEBoot_int32_t *tm) { - struct grub_hfs_data *data; + struct VasEBoot_hfs_data *data; - data = grub_hfs_mount (device->disk); + data = VasEBoot_hfs_mount (device->disk); if (data) - *tm = grub_be_to_cpu32 (data->sblock.mtime) - 2082844800; + *tm = VasEBoot_be_to_cpu32 (data->sblock.mtime) - 2082844800; else *tm = 0; - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } -static grub_err_t -grub_hfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_hfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_hfs_data *data; + struct VasEBoot_hfs_data *data; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfs_mount (device->disk); + data = VasEBoot_hfs_mount (device->disk); if (data && data->sblock.num_serial != 0) { - *uuid = grub_xasprintf ("%016llx", + *uuid = VasEBoot_xasprintf ("%016llx", (unsigned long long) - grub_be_to_cpu64 (data->sblock.num_serial)); + VasEBoot_be_to_cpu64 (data->sblock.num_serial)); } else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_hfs_fs = +static struct VasEBoot_fs VasEBoot_hfs_fs = { .name = "hfs", - .dir = grub_hfs_dir, - .open = grub_hfs_open, - .read = grub_hfs_read, - .close = grub_hfs_close, - .label = grub_hfs_label, - .uuid = grub_hfs_uuid, - .mtime = grub_hfs_mtime, -#ifdef GRUB_UTIL + .dir = VasEBoot_hfs_dir, + .open = VasEBoot_hfs_open, + .read = VasEBoot_hfs_read, + .close = VasEBoot_hfs_close, + .label = VasEBoot_hfs_label, + .uuid = VasEBoot_hfs_uuid, + .mtime = VasEBoot_hfs_mtime, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(hfs) +VasEBoot_MOD_INIT(hfs) { - grub_fs_register (&grub_hfs_fs); + VasEBoot_fs_register (&VasEBoot_hfs_fs); my_mod = mod; } -GRUB_MOD_FINI(hfs) +VasEBoot_MOD_FINI(hfs) { - grub_fs_unregister (&grub_hfs_fs); + VasEBoot_fs_unregister (&VasEBoot_hfs_fs); } diff --git a/VasEBoot-core/fs/hfsplus.c b/VasEBoot-core/fs/hfsplus.c index 21159e858..5cd632a1f 100644 --- a/VasEBoot-core/fs/hfsplus.c +++ b/VasEBoot-core/fs/hfsplus.c @@ -1,166 +1,166 @@ /* hfsplus.c - HFS+ Filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* HFS+ is documented at http://developer.apple.com/technotes/tn/tn1150.html */ -#define grub_fshelp_node grub_hfsplus_file -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#define VasEBoot_fshelp_node VasEBoot_hfsplus_file +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* The type of node. */ -enum grub_hfsplus_btnode_type +enum VasEBoot_hfsplus_btnode_type { - GRUB_HFSPLUS_BTNODE_TYPE_LEAF = -1, - GRUB_HFSPLUS_BTNODE_TYPE_INDEX = 0, - GRUB_HFSPLUS_BTNODE_TYPE_HEADER = 1, - GRUB_HFSPLUS_BTNODE_TYPE_MAP = 2, + VasEBoot_HFSPLUS_BTNODE_TYPE_LEAF = -1, + VasEBoot_HFSPLUS_BTNODE_TYPE_INDEX = 0, + VasEBoot_HFSPLUS_BTNODE_TYPE_HEADER = 1, + VasEBoot_HFSPLUS_BTNODE_TYPE_MAP = 2, }; /* The header of a HFS+ B+ Tree. */ -struct grub_hfsplus_btheader +struct VasEBoot_hfsplus_btheader { - grub_uint16_t depth; - grub_uint32_t root; - grub_uint32_t leaf_records; - grub_uint32_t first_leaf_node; - grub_uint32_t last_leaf_node; - grub_uint16_t nodesize; - grub_uint16_t keysize; - grub_uint32_t total_nodes; - grub_uint32_t free_nodes; - grub_uint16_t reserved1; - grub_uint32_t clump_size; /* ignored */ - grub_uint8_t btree_type; - grub_uint8_t key_compare; - grub_uint32_t attributes; -} GRUB_PACKED; + VasEBoot_uint16_t depth; + VasEBoot_uint32_t root; + VasEBoot_uint32_t leaf_records; + VasEBoot_uint32_t first_leaf_node; + VasEBoot_uint32_t last_leaf_node; + VasEBoot_uint16_t nodesize; + VasEBoot_uint16_t keysize; + VasEBoot_uint32_t total_nodes; + VasEBoot_uint32_t free_nodes; + VasEBoot_uint16_t reserved1; + VasEBoot_uint32_t clump_size; /* ignored */ + VasEBoot_uint8_t btree_type; + VasEBoot_uint8_t key_compare; + VasEBoot_uint32_t attributes; +} VasEBoot_PACKED; -struct grub_hfsplus_catfile +struct VasEBoot_hfsplus_catfile { - grub_uint16_t type; - grub_uint16_t flags; - grub_uint32_t parentid; /* Thread only. */ - grub_uint32_t fileid; - grub_uint8_t unused1[4]; - grub_uint32_t mtime; - grub_uint8_t unused2[22]; - grub_uint16_t mode; - grub_uint8_t unused3[44]; - struct grub_hfsplus_forkdata data; - struct grub_hfsplus_forkdata resource; -} GRUB_PACKED; + VasEBoot_uint16_t type; + VasEBoot_uint16_t flags; + VasEBoot_uint32_t parentid; /* Thread only. */ + VasEBoot_uint32_t fileid; + VasEBoot_uint8_t unused1[4]; + VasEBoot_uint32_t mtime; + VasEBoot_uint8_t unused2[22]; + VasEBoot_uint16_t mode; + VasEBoot_uint8_t unused3[44]; + struct VasEBoot_hfsplus_forkdata data; + struct VasEBoot_hfsplus_forkdata resource; +} VasEBoot_PACKED; /* Filetype information as used in inodes. */ -#define GRUB_HFSPLUS_FILEMODE_MASK 0170000 -#define GRUB_HFSPLUS_FILEMODE_REG 0100000 -#define GRUB_HFSPLUS_FILEMODE_DIRECTORY 0040000 -#define GRUB_HFSPLUS_FILEMODE_SYMLINK 0120000 +#define VasEBoot_HFSPLUS_FILEMODE_MASK 0170000 +#define VasEBoot_HFSPLUS_FILEMODE_REG 0100000 +#define VasEBoot_HFSPLUS_FILEMODE_DIRECTORY 0040000 +#define VasEBoot_HFSPLUS_FILEMODE_SYMLINK 0120000 /* Some pre-defined file IDs. */ enum { - GRUB_HFSPLUS_FILEID_ROOTDIR = 2, - GRUB_HFSPLUS_FILEID_OVERFLOW = 3, - GRUB_HFSPLUS_FILEID_CATALOG = 4, - GRUB_HFSPLUS_FILEID_ATTR = 8 + VasEBoot_HFSPLUS_FILEID_ROOTDIR = 2, + VasEBoot_HFSPLUS_FILEID_OVERFLOW = 3, + VasEBoot_HFSPLUS_FILEID_CATALOG = 4, + VasEBoot_HFSPLUS_FILEID_ATTR = 8 }; -enum grub_hfsplus_filetype +enum VasEBoot_hfsplus_filetype { - GRUB_HFSPLUS_FILETYPE_DIR = 1, - GRUB_HFSPLUS_FILETYPE_REG = 2, - GRUB_HFSPLUS_FILETYPE_DIR_THREAD = 3, - GRUB_HFSPLUS_FILETYPE_REG_THREAD = 4 + VasEBoot_HFSPLUS_FILETYPE_DIR = 1, + VasEBoot_HFSPLUS_FILETYPE_REG = 2, + VasEBoot_HFSPLUS_FILETYPE_DIR_THREAD = 3, + VasEBoot_HFSPLUS_FILETYPE_REG_THREAD = 4 }; -#define GRUB_HFSPLUSX_BINARYCOMPARE 0xBC -#define GRUB_HFSPLUSX_CASEFOLDING 0xCF +#define VasEBoot_HFSPLUSX_BINARYCOMPARE 0xBC +#define VasEBoot_HFSPLUSX_CASEFOLDING 0xCF -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -grub_err_t (*grub_hfsplus_open_compressed) (struct grub_fshelp_node *node); -grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node, - grub_off_t pos, - grub_size_t len, +VasEBoot_err_t (*VasEBoot_hfsplus_open_compressed) (struct VasEBoot_fshelp_node *node); +VasEBoot_ssize_t (*VasEBoot_hfsplus_read_compressed) (struct VasEBoot_hfsplus_file *node, + VasEBoot_off_t pos, + VasEBoot_size_t len, char *buf); /* Find the extent that points to FILEBLOCK. If it is not in one of the 8 extents described by EXTENT, return -1. In that case set FILEBLOCK to the next block. */ -static grub_disk_addr_t -grub_hfsplus_find_block (struct grub_hfsplus_extent *extent, - grub_disk_addr_t *fileblock) +static VasEBoot_disk_addr_t +VasEBoot_hfsplus_find_block (struct VasEBoot_hfsplus_extent *extent, + VasEBoot_disk_addr_t *fileblock) { int i; - grub_disk_addr_t blksleft = *fileblock; + VasEBoot_disk_addr_t blksleft = *fileblock; /* First lookup the file in the given extents. */ for (i = 0; i < 8; i++) { - if (blksleft < grub_be_to_cpu32 (extent[i].count)) - return grub_be_to_cpu32 (extent[i].start) + blksleft; - blksleft -= grub_be_to_cpu32 (extent[i].count); + if (blksleft < VasEBoot_be_to_cpu32 (extent[i].count)) + return VasEBoot_be_to_cpu32 (extent[i].start) + blksleft; + blksleft -= VasEBoot_be_to_cpu32 (extent[i].count); } *fileblock = blksleft; return 0xffffffffffffffffULL; } -static int grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb); +static int VasEBoot_hfsplus_cmp_extkey (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb); /* Search for the block FILEBLOCK inside the file NODE. Return the blocknumber of this block on disk. */ -static grub_disk_addr_t -grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_hfsplus_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { - struct grub_hfsplus_btnode *nnode = 0; - grub_disk_addr_t blksleft = fileblock; - struct grub_hfsplus_extent *extents = node->compressed + struct VasEBoot_hfsplus_btnode *nnode = 0; + VasEBoot_disk_addr_t blksleft = fileblock; + struct VasEBoot_hfsplus_extent *extents = node->compressed ? &node->resource_extents[0] : &node->extents[0]; while (1) { - struct grub_hfsplus_extkey *key; - struct grub_hfsplus_key_internal extoverflow; - grub_disk_addr_t blk; - grub_off_t ptr; + struct VasEBoot_hfsplus_extkey *key; + struct VasEBoot_hfsplus_key_internal extoverflow; + VasEBoot_disk_addr_t blk; + VasEBoot_off_t ptr; /* Try to find this block in the current set of extents. */ - blk = grub_hfsplus_find_block (extents, &blksleft); + blk = VasEBoot_hfsplus_find_block (extents, &blksleft); /* The previous iteration of this loop allocated memory. The code above used this memory, it can be freed now. */ - grub_free (nnode); + VasEBoot_free (nnode); nnode = 0; if (blk != 0xffffffffffffffffULL) @@ -169,9 +169,9 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) /* For the extent overflow file, extra extents can't be found in the extent overflow file. If this happens, you found a bug... */ - if (node->fileid == GRUB_HFSPLUS_FILEID_OVERFLOW) + if (node->fileid == VasEBoot_HFSPLUS_FILEID_OVERFLOW) { - grub_error (GRUB_ERR_READ_ERROR, + VasEBoot_error (VasEBoot_ERR_READ_ERROR, "extra extents found in an extend overflow file"); break; } @@ -181,27 +181,27 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) extoverflow.extkey.type = 0; extoverflow.extkey.start = fileblock - blksleft; extoverflow.extkey.type = node->compressed ? 0xff : 0; - if (grub_hfsplus_btree_search (&node->data->extoverflow_tree, + if (VasEBoot_hfsplus_btree_search (&node->data->extoverflow_tree, &extoverflow, - grub_hfsplus_cmp_extkey, &nnode, &ptr) + VasEBoot_hfsplus_cmp_extkey, &nnode, &ptr) || !nnode) { - grub_error (GRUB_ERR_READ_ERROR, + VasEBoot_error (VasEBoot_ERR_READ_ERROR, "no block found for the file id 0x%x and the block offset 0x%x", node->fileid, fileblock); break; } /* The extent overflow file has 8 extents right after the key. */ - key = (struct grub_hfsplus_extkey *) - grub_hfsplus_btree_recptr (&node->data->extoverflow_tree, nnode, ptr); - extents = (struct grub_hfsplus_extent *) (key + 1); + key = (struct VasEBoot_hfsplus_extkey *) + VasEBoot_hfsplus_btree_recptr (&node->data->extoverflow_tree, nnode, ptr); + extents = (struct VasEBoot_hfsplus_extent *) (key + 1); /* The block wasn't found. Perhaps the next iteration will find it. The last block we found is stored in BLKSLEFT now. */ } - grub_free (nnode); + VasEBoot_free (nnode); /* Too bad, you lose. */ return -1; @@ -210,207 +210,207 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -grub_ssize_t -grub_hfsplus_read_file (grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +VasEBoot_ssize_t +VasEBoot_hfsplus_read_file (VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - return grub_fshelp_read_file (node->data->disk, node, + return VasEBoot_fshelp_read_file (node->data->disk, node, read_hook, read_hook_data, - pos, len, buf, grub_hfsplus_read_block, + pos, len, buf, VasEBoot_hfsplus_read_block, node->size, - node->data->log2blksize - GRUB_DISK_SECTOR_BITS, + node->data->log2blksize - VasEBoot_DISK_SECTOR_BITS, node->data->embedded_offset); } -static struct grub_hfsplus_data * -grub_hfsplus_mount (grub_disk_t disk) +static struct VasEBoot_hfsplus_data * +VasEBoot_hfsplus_mount (VasEBoot_disk_t disk) { - struct grub_hfsplus_data *data; - struct grub_hfsplus_btheader header; - struct grub_hfsplus_btnode node; - grub_uint16_t magic; + struct VasEBoot_hfsplus_data *data; + struct VasEBoot_hfsplus_btheader header; + struct VasEBoot_hfsplus_btnode node; + VasEBoot_uint16_t magic; union { - struct grub_hfs_sblock hfs; - struct grub_hfsplus_volheader hfsplus; + struct VasEBoot_hfs_sblock hfs; + struct VasEBoot_hfsplus_volheader hfsplus; } volheader; - data = grub_malloc (sizeof (*data)); + data = VasEBoot_malloc (sizeof (*data)); if (!data) return 0; data->disk = disk; /* Read the bootblock. */ - grub_disk_read (disk, GRUB_HFSPLUS_SBLOCK, 0, sizeof (volheader), + VasEBoot_disk_read (disk, VasEBoot_HFSPLUS_SBLOCK, 0, sizeof (volheader), &volheader); - if (grub_errno) + if (VasEBoot_errno) goto fail; data->embedded_offset = 0; - if (grub_be_to_cpu16 (volheader.hfs.magic) == GRUB_HFS_MAGIC) + if (VasEBoot_be_to_cpu16 (volheader.hfs.magic) == VasEBoot_HFS_MAGIC) { - grub_disk_addr_t extent_start; - grub_disk_addr_t ablk_size; - grub_disk_addr_t ablk_start; + VasEBoot_disk_addr_t extent_start; + VasEBoot_disk_addr_t ablk_size; + VasEBoot_disk_addr_t ablk_start; /* See if there's an embedded HFS+ filesystem. */ - if (grub_be_to_cpu16 (volheader.hfs.embed_sig) != GRUB_HFSPLUS_MAGIC) + if (VasEBoot_be_to_cpu16 (volheader.hfs.embed_sig) != VasEBoot_HFSPLUS_MAGIC) { - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a HFS+ filesystem"); goto fail; } /* Calculate the offset needed to translate HFS+ sector numbers. */ - extent_start = grub_be_to_cpu16 (volheader.hfs.embed_extent.first_block); - ablk_size = grub_be_to_cpu32 (volheader.hfs.blksz); - ablk_start = grub_be_to_cpu16 (volheader.hfs.first_block); + extent_start = VasEBoot_be_to_cpu16 (volheader.hfs.embed_extent.first_block); + ablk_size = VasEBoot_be_to_cpu32 (volheader.hfs.blksz); + ablk_start = VasEBoot_be_to_cpu16 (volheader.hfs.first_block); data->embedded_offset = (ablk_start + extent_start - * (ablk_size >> GRUB_DISK_SECTOR_BITS)); + * (ablk_size >> VasEBoot_DISK_SECTOR_BITS)); - grub_disk_read (disk, data->embedded_offset + GRUB_HFSPLUS_SBLOCK, 0, + VasEBoot_disk_read (disk, data->embedded_offset + VasEBoot_HFSPLUS_SBLOCK, 0, sizeof (volheader), &volheader); - if (grub_errno) + if (VasEBoot_errno) goto fail; } /* Make sure this is an HFS+ filesystem. XXX: Do we really support HFX? */ - magic = grub_be_to_cpu16 (volheader.hfsplus.magic); - if (((magic != GRUB_HFSPLUS_MAGIC) && (magic != GRUB_HFSPLUSX_MAGIC)) + magic = VasEBoot_be_to_cpu16 (volheader.hfsplus.magic); + if (((magic != VasEBoot_HFSPLUS_MAGIC) && (magic != VasEBoot_HFSPLUSX_MAGIC)) || volheader.hfsplus.blksize == 0 || ((volheader.hfsplus.blksize & (volheader.hfsplus.blksize - 1)) != 0) - || grub_be_to_cpu32 (volheader.hfsplus.blksize) < GRUB_DISK_SECTOR_SIZE) + || VasEBoot_be_to_cpu32 (volheader.hfsplus.blksize) < VasEBoot_DISK_SECTOR_SIZE) { - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a HFS+ filesystem"); goto fail; } - grub_memcpy (&data->volheader, &volheader.hfsplus, + VasEBoot_memcpy (&data->volheader, &volheader.hfsplus, sizeof (volheader.hfsplus)); for (data->log2blksize = 0; - (1U << data->log2blksize) < grub_be_to_cpu32 (data->volheader.blksize); + (1U << data->log2blksize) < VasEBoot_be_to_cpu32 (data->volheader.blksize); data->log2blksize++); /* Make a new node for the catalog tree. */ data->catalog_tree.file.data = data; - data->catalog_tree.file.fileid = GRUB_HFSPLUS_FILEID_CATALOG; + data->catalog_tree.file.fileid = VasEBoot_HFSPLUS_FILEID_CATALOG; data->catalog_tree.file.compressed = 0; - grub_memcpy (&data->catalog_tree.file.extents, + VasEBoot_memcpy (&data->catalog_tree.file.extents, data->volheader.catalog_file.extents, sizeof data->volheader.catalog_file.extents); data->catalog_tree.file.size = - grub_be_to_cpu64 (data->volheader.catalog_file.size); + VasEBoot_be_to_cpu64 (data->volheader.catalog_file.size); data->attr_tree.file.data = data; - data->attr_tree.file.fileid = GRUB_HFSPLUS_FILEID_ATTR; - grub_memcpy (&data->attr_tree.file.extents, + data->attr_tree.file.fileid = VasEBoot_HFSPLUS_FILEID_ATTR; + VasEBoot_memcpy (&data->attr_tree.file.extents, data->volheader.attr_file.extents, sizeof data->volheader.attr_file.extents); data->attr_tree.file.size = - grub_be_to_cpu64 (data->volheader.attr_file.size); + VasEBoot_be_to_cpu64 (data->volheader.attr_file.size); data->attr_tree.file.compressed = 0; /* Make a new node for the extent overflow file. */ data->extoverflow_tree.file.data = data; - data->extoverflow_tree.file.fileid = GRUB_HFSPLUS_FILEID_OVERFLOW; + data->extoverflow_tree.file.fileid = VasEBoot_HFSPLUS_FILEID_OVERFLOW; data->extoverflow_tree.file.compressed = 0; - grub_memcpy (&data->extoverflow_tree.file.extents, + VasEBoot_memcpy (&data->extoverflow_tree.file.extents, data->volheader.extents_file.extents, sizeof data->volheader.catalog_file.extents); data->extoverflow_tree.file.size = - grub_be_to_cpu64 (data->volheader.extents_file.size); + VasEBoot_be_to_cpu64 (data->volheader.extents_file.size); /* Read the essential information about the trees. */ - if (grub_hfsplus_read_file (&data->catalog_tree.file, 0, 0, - sizeof (struct grub_hfsplus_btnode), + if (VasEBoot_hfsplus_read_file (&data->catalog_tree.file, 0, 0, + sizeof (struct VasEBoot_hfsplus_btnode), sizeof (header), (char *) &header) <= 0) goto fail; - data->catalog_tree.root = grub_be_to_cpu32 (header.root); - data->catalog_tree.nodesize = grub_be_to_cpu16 (header.nodesize); - data->case_sensitive = ((magic == GRUB_HFSPLUSX_MAGIC) && - (header.key_compare == GRUB_HFSPLUSX_BINARYCOMPARE)); + data->catalog_tree.root = VasEBoot_be_to_cpu32 (header.root); + data->catalog_tree.nodesize = VasEBoot_be_to_cpu16 (header.nodesize); + data->case_sensitive = ((magic == VasEBoot_HFSPLUSX_MAGIC) && + (header.key_compare == VasEBoot_HFSPLUSX_BINARYCOMPARE)); if (data->catalog_tree.nodesize < 2) goto fail; - if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, - sizeof (struct grub_hfsplus_btnode), + if (VasEBoot_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, + sizeof (struct VasEBoot_hfsplus_btnode), sizeof (header), (char *) &header) <= 0) goto fail; - data->extoverflow_tree.root = grub_be_to_cpu32 (header.root); + data->extoverflow_tree.root = VasEBoot_be_to_cpu32 (header.root); - if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, 0, + if (VasEBoot_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, 0, sizeof (node), (char *) &node) <= 0) goto fail; - data->extoverflow_tree.root = grub_be_to_cpu32 (header.root); - data->extoverflow_tree.nodesize = grub_be_to_cpu16 (header.nodesize); + data->extoverflow_tree.root = VasEBoot_be_to_cpu32 (header.root); + data->extoverflow_tree.nodesize = VasEBoot_be_to_cpu16 (header.nodesize); if (data->extoverflow_tree.nodesize < 2) goto fail; - if (grub_hfsplus_read_file (&data->attr_tree.file, 0, 0, - sizeof (struct grub_hfsplus_btnode), + if (VasEBoot_hfsplus_read_file (&data->attr_tree.file, 0, 0, + sizeof (struct VasEBoot_hfsplus_btnode), sizeof (header), (char *) &header) <= 0) { - grub_errno = 0; + VasEBoot_errno = 0; data->attr_tree.root = 0; data->attr_tree.nodesize = 0; } else { - data->attr_tree.root = grub_be_to_cpu32 (header.root); - data->attr_tree.nodesize = grub_be_to_cpu16 (header.nodesize); + data->attr_tree.root = VasEBoot_be_to_cpu32 (header.root); + data->attr_tree.nodesize = VasEBoot_be_to_cpu16 (header.nodesize); } data->dirroot.data = data; - data->dirroot.fileid = GRUB_HFSPLUS_FILEID_ROOTDIR; + data->dirroot.fileid = VasEBoot_HFSPLUS_FILEID_ROOTDIR; return data; fail: - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a HFS+ filesystem"); - grub_free (data); + VasEBoot_free (data); return 0; } /* Compare the on disk catalog key KEYA with the catalog key we are looking for (KEYB). */ static int -grub_hfsplus_cmp_catkey (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb) +VasEBoot_hfsplus_cmp_catkey (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb) { - struct grub_hfsplus_catkey *catkey_a = &keya->catkey; - struct grub_hfsplus_catkey_internal *catkey_b = &keyb->catkey; + struct VasEBoot_hfsplus_catkey *catkey_a = &keya->catkey; + struct VasEBoot_hfsplus_catkey_internal *catkey_b = &keyb->catkey; int diff; - grub_size_t len; + VasEBoot_size_t len; /* Safe unsigned comparison */ - grub_uint32_t aparent = grub_be_to_cpu32 (catkey_a->parent); + VasEBoot_uint32_t aparent = VasEBoot_be_to_cpu32 (catkey_a->parent); if (aparent > catkey_b->parent) return 1; if (aparent < catkey_b->parent) return -1; - len = grub_be_to_cpu16 (catkey_a->namelen); + len = VasEBoot_be_to_cpu16 (catkey_a->namelen); if (len > catkey_b->namelen) len = catkey_b->namelen; /* Since it's big-endian memcmp gives the same result as manually comparing uint16_t but may be faster. */ - diff = grub_memcmp (catkey_a->name, catkey_b->name, + diff = VasEBoot_memcmp (catkey_a->name, catkey_b->name, len * sizeof (catkey_a->name[0])); if (diff == 0) - diff = grub_be_to_cpu16 (catkey_a->namelen) - catkey_b->namelen; + diff = VasEBoot_be_to_cpu16 (catkey_a->namelen) - catkey_b->namelen; return diff; } @@ -418,14 +418,14 @@ grub_hfsplus_cmp_catkey (struct grub_hfsplus_key *keya, /* Compare the on disk catalog key KEYA with the catalog key we are looking for (KEYB). */ static int -grub_hfsplus_cmp_catkey_id (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb) +VasEBoot_hfsplus_cmp_catkey_id (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb) { - struct grub_hfsplus_catkey *catkey_a = &keya->catkey; - struct grub_hfsplus_catkey_internal *catkey_b = &keyb->catkey; + struct VasEBoot_hfsplus_catkey *catkey_a = &keya->catkey; + struct VasEBoot_hfsplus_catkey_internal *catkey_b = &keyb->catkey; /* Safe unsigned comparison */ - grub_uint32_t aparent = grub_be_to_cpu32 (catkey_a->parent); + VasEBoot_uint32_t aparent = VasEBoot_be_to_cpu32 (catkey_a->parent); if (aparent > catkey_b->parent) return 1; if (aparent < catkey_b->parent) @@ -437,15 +437,15 @@ grub_hfsplus_cmp_catkey_id (struct grub_hfsplus_key *keya, /* Compare the on disk extent overflow key KEYA with the extent overflow key we are looking for (KEYB). */ static int -grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb) +VasEBoot_hfsplus_cmp_extkey (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb) { - struct grub_hfsplus_extkey *extkey_a = &keya->extkey; - struct grub_hfsplus_extkey_internal *extkey_b = &keyb->extkey; - grub_uint32_t akey; + struct VasEBoot_hfsplus_extkey *extkey_a = &keya->extkey; + struct VasEBoot_hfsplus_extkey_internal *extkey_b = &keyb->extkey; + VasEBoot_uint32_t akey; /* Safe unsigned comparison */ - akey = grub_be_to_cpu32 (extkey_a->fileid); + akey = VasEBoot_be_to_cpu32 (extkey_a->fileid); if (akey > extkey_b->fileid) return 1; if (akey < extkey_b->fileid) @@ -462,7 +462,7 @@ grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya, if (extkey_a->type < extkey_b->type) return -1; - akey = grub_be_to_cpu32 (extkey_a->start); + akey = VasEBoot_be_to_cpu32 (extkey_a->start); if (akey > extkey_b->start) return 1; if (akey < extkey_b->start) @@ -471,19 +471,19 @@ grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya, } static char * -grub_hfsplus_read_symlink (grub_fshelp_node_t node) +VasEBoot_hfsplus_read_symlink (VasEBoot_fshelp_node_t node) { char *symlink; - grub_ssize_t numread; + VasEBoot_ssize_t numread; - symlink = grub_malloc (node->size + 1); + symlink = VasEBoot_malloc (node->size + 1); if (!symlink) return 0; - numread = grub_hfsplus_read_file (node, 0, 0, 0, node->size, symlink); - if (numread != (grub_ssize_t) node->size) + numread = VasEBoot_hfsplus_read_file (node, 0, 0, 0, node->size, symlink); + if (numread != (VasEBoot_ssize_t) node->size) { - grub_free (symlink); + VasEBoot_free (symlink); return 0; } symlink[node->size] = '\0'; @@ -492,24 +492,24 @@ grub_hfsplus_read_symlink (grub_fshelp_node_t node) } static int -grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree, - struct grub_hfsplus_btnode *first_node, - grub_disk_addr_t first_rec, +VasEBoot_hfsplus_btree_iterate_node (struct VasEBoot_hfsplus_btree *btree, + struct VasEBoot_hfsplus_btnode *first_node, + VasEBoot_disk_addr_t first_rec, int (*hook) (void *record, void *hook_arg), void *hook_arg) { - grub_disk_addr_t rec; - grub_uint64_t saved_node = -1; - grub_uint64_t node_count = 0; + VasEBoot_disk_addr_t rec; + VasEBoot_uint64_t saved_node = -1; + VasEBoot_uint64_t node_count = 0; for (;;) { char *cnode = (char *) first_node; /* Iterate over all records in this node. */ - for (rec = first_rec; rec < grub_be_to_cpu16 (first_node->count); rec++) + for (rec = first_rec; rec < VasEBoot_be_to_cpu16 (first_node->count); rec++) { - if (hook (grub_hfsplus_btree_recptr (btree, first_node, rec), hook_arg)) + if (hook (VasEBoot_hfsplus_btree_recptr (btree, first_node, rec), hook_arg)) return 1; } @@ -518,16 +518,16 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree, if (node_count && first_node->next == saved_node) { - grub_error (GRUB_ERR_BAD_FS, "HFS+ btree loop"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "HFS+ btree loop"); return 0; } if (!(node_count & (node_count - 1))) saved_node = first_node->next; node_count++; - if (grub_hfsplus_read_file (&btree->file, 0, 0, - (((grub_disk_addr_t) - grub_be_to_cpu32 (first_node->next)) + if (VasEBoot_hfsplus_read_file (&btree->file, 0, 0, + (((VasEBoot_disk_addr_t) + VasEBoot_be_to_cpu32 (first_node->next)) * btree->nodesize), btree->nodesize, cnode) <= 0) return 1; @@ -543,20 +543,20 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree, keys using the function COMPARE_KEYS. When a match is found, return the node in MATCHNODE and a pointer to the data in this node in KEYOFFSET. MATCHNODE should be freed by the caller. */ -grub_err_t -grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, - struct grub_hfsplus_key_internal *key, - int (*compare_keys) (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb), - struct grub_hfsplus_btnode **matchnode, - grub_off_t *keyoffset) +VasEBoot_err_t +VasEBoot_hfsplus_btree_search (struct VasEBoot_hfsplus_btree *btree, + struct VasEBoot_hfsplus_key_internal *key, + int (*compare_keys) (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb), + struct VasEBoot_hfsplus_btnode **matchnode, + VasEBoot_off_t *keyoffset) { - grub_uint64_t currnode; + VasEBoot_uint64_t currnode; char *node; - struct grub_hfsplus_btnode *nodedesc; - grub_disk_addr_t rec; - grub_uint64_t save_node; - grub_uint64_t node_count = 0; + struct VasEBoot_hfsplus_btnode *nodedesc; + VasEBoot_disk_addr_t rec; + VasEBoot_uint64_t save_node; + VasEBoot_uint64_t node_count = 0; if (!btree->nodesize) { @@ -564,9 +564,9 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, return 0; } - node = grub_malloc (btree->nodesize); + node = VasEBoot_malloc (btree->nodesize); if (! node) - return grub_errno; + return VasEBoot_errno; currnode = btree->root; save_node = currnode - 1; @@ -576,34 +576,34 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, if (save_node == currnode) { - grub_free (node); - return grub_error (GRUB_ERR_BAD_FS, "HFS+ btree loop"); + VasEBoot_free (node); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "HFS+ btree loop"); } if (!(node_count & (node_count - 1))) save_node = currnode; node_count++; /* Read a node. */ - if (grub_hfsplus_read_file (&btree->file, 0, 0, - (grub_disk_addr_t) currnode - * (grub_disk_addr_t) btree->nodesize, + if (VasEBoot_hfsplus_read_file (&btree->file, 0, 0, + (VasEBoot_disk_addr_t) currnode + * (VasEBoot_disk_addr_t) btree->nodesize, btree->nodesize, (char *) node) <= 0) { - grub_free (node); - return grub_error (GRUB_ERR_BAD_FS, "couldn't read i-node"); + VasEBoot_free (node); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't read i-node"); } - nodedesc = (struct grub_hfsplus_btnode *) node; + nodedesc = (struct VasEBoot_hfsplus_btnode *) node; /* Find the record in this tree. */ - for (rec = 0; rec < grub_be_to_cpu16 (nodedesc->count); rec++) + for (rec = 0; rec < VasEBoot_be_to_cpu16 (nodedesc->count); rec++) { - struct grub_hfsplus_key *currkey; - currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec); + struct VasEBoot_hfsplus_key *currkey; + currkey = VasEBoot_hfsplus_btree_recptr (btree, nodedesc, rec); /* The action that has to be taken depend on the type of record. */ - if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_LEAF + if (nodedesc->type == VasEBoot_HFSPLUS_BTNODE_TYPE_LEAF && compare_keys (currkey, key) == 0) { /* An exact match was found! */ @@ -613,7 +613,7 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, return 0; } - else if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_INDEX) + else if (nodedesc->type == VasEBoot_HFSPLUS_BTNODE_TYPE_INDEX) { void *pointer; @@ -628,9 +628,9 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, found will be used to locate the child which can contain the record. */ pointer = ((char *) currkey - + grub_be_to_cpu16 (currkey->keylen) + + VasEBoot_be_to_cpu16 (currkey->keylen) + 2); - currnode = grub_be_to_cpu32 (grub_get_unaligned32 (pointer)); + currnode = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (pointer)); match = 1; } } @@ -640,7 +640,7 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, if (! match) { *matchnode = 0; - grub_free (node); + VasEBoot_free (node); return 0; } } @@ -649,80 +649,80 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, struct list_nodes_ctx { int ret; - grub_fshelp_node_t dir; - grub_fshelp_iterate_dir_hook_t hook; + VasEBoot_fshelp_node_t dir; + VasEBoot_fshelp_iterate_dir_hook_t hook; void *hook_data; }; static int list_nodes (void *record, void *hook_arg) { - struct grub_hfsplus_catkey *catkey; + struct VasEBoot_hfsplus_catkey *catkey; char *filename; int i; - struct grub_fshelp_node *node; - struct grub_hfsplus_catfile *fileinfo; - enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN; + struct VasEBoot_fshelp_node *node; + struct VasEBoot_hfsplus_catfile *fileinfo; + enum VasEBoot_fshelp_filetype type = VasEBoot_FSHELP_UNKNOWN; struct list_nodes_ctx *ctx = hook_arg; - catkey = (struct grub_hfsplus_catkey *) record; + catkey = (struct VasEBoot_hfsplus_catkey *) record; fileinfo = - (struct grub_hfsplus_catfile *) ((char *) record - + grub_be_to_cpu16 (catkey->keylen) - + 2 + (grub_be_to_cpu16(catkey->keylen) + (struct VasEBoot_hfsplus_catfile *) ((char *) record + + VasEBoot_be_to_cpu16 (catkey->keylen) + + 2 + (VasEBoot_be_to_cpu16(catkey->keylen) % 2)); /* Stop iterating when the last directory entry is found. */ - if (grub_be_to_cpu32 (catkey->parent) != ctx->dir->fileid) + if (VasEBoot_be_to_cpu32 (catkey->parent) != ctx->dir->fileid) return 1; /* Determine the type of the node that is found. */ switch (fileinfo->type) { - case grub_cpu_to_be16_compile_time (GRUB_HFSPLUS_FILETYPE_REG): + case VasEBoot_cpu_to_be16_compile_time (VasEBoot_HFSPLUS_FILETYPE_REG): { - int mode = (grub_be_to_cpu16 (fileinfo->mode) - & GRUB_HFSPLUS_FILEMODE_MASK); + int mode = (VasEBoot_be_to_cpu16 (fileinfo->mode) + & VasEBoot_HFSPLUS_FILEMODE_MASK); - if (mode == GRUB_HFSPLUS_FILEMODE_REG) - type = GRUB_FSHELP_REG; - else if (mode == GRUB_HFSPLUS_FILEMODE_SYMLINK) - type = GRUB_FSHELP_SYMLINK; + if (mode == VasEBoot_HFSPLUS_FILEMODE_REG) + type = VasEBoot_FSHELP_REG; + else if (mode == VasEBoot_HFSPLUS_FILEMODE_SYMLINK) + type = VasEBoot_FSHELP_SYMLINK; else - type = GRUB_FSHELP_UNKNOWN; + type = VasEBoot_FSHELP_UNKNOWN; break; } - case grub_cpu_to_be16_compile_time (GRUB_HFSPLUS_FILETYPE_DIR): - type = GRUB_FSHELP_DIR; + case VasEBoot_cpu_to_be16_compile_time (VasEBoot_HFSPLUS_FILETYPE_DIR): + type = VasEBoot_FSHELP_DIR; break; - case grub_cpu_to_be16_compile_time (GRUB_HFSPLUS_FILETYPE_DIR_THREAD): + case VasEBoot_cpu_to_be16_compile_time (VasEBoot_HFSPLUS_FILETYPE_DIR_THREAD): if (ctx->dir->fileid == 2) return 0; - node = grub_malloc (sizeof (*node)); + node = VasEBoot_malloc (sizeof (*node)); if (!node) return 1; node->data = ctx->dir->data; node->mtime = 0; node->size = 0; - node->fileid = grub_be_to_cpu32 (fileinfo->parentid); + node->fileid = VasEBoot_be_to_cpu32 (fileinfo->parentid); - ctx->ret = ctx->hook ("..", GRUB_FSHELP_DIR, node, ctx->hook_data); + ctx->ret = ctx->hook ("..", VasEBoot_FSHELP_DIR, node, ctx->hook_data); return ctx->ret; } - if (type == GRUB_FSHELP_UNKNOWN) + if (type == VasEBoot_FSHELP_UNKNOWN) return 0; - filename = grub_malloc (grub_be_to_cpu16 (catkey->namelen) - * GRUB_MAX_UTF8_PER_UTF16 + 1); + filename = VasEBoot_malloc (VasEBoot_be_to_cpu16 (catkey->namelen) + * VasEBoot_MAX_UTF8_PER_UTF16 + 1); if (! filename) return 0; /* Make sure the byte order of the UTF16 string is correct. */ - for (i = 0; i < grub_be_to_cpu16 (catkey->namelen); i++) + for (i = 0; i < VasEBoot_be_to_cpu16 (catkey->namelen); i++) { - catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]); + catkey->name[i] = VasEBoot_be_to_cpu16 (catkey->name[i]); if (catkey->name[i] == '/') catkey->name[i] = ':'; @@ -730,32 +730,32 @@ list_nodes (void *record, void *hook_arg) /* If the name is obviously invalid, skip this node. */ if (catkey->name[i] == 0) { - grub_free (filename); + VasEBoot_free (filename); return 0; } } - *grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name, - grub_be_to_cpu16 (catkey->namelen)) = '\0'; + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) filename, catkey->name, + VasEBoot_be_to_cpu16 (catkey->namelen)) = '\0'; /* Restore the byte order to what it was previously. */ - for (i = 0; i < grub_be_to_cpu16 (catkey->namelen); i++) + for (i = 0; i < VasEBoot_be_to_cpu16 (catkey->namelen); i++) { if (catkey->name[i] == ':') catkey->name[i] = '/'; - catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]); + catkey->name[i] = VasEBoot_be_to_cpu16 (catkey->name[i]); } /* hfs+ is case insensitive. */ if (! ctx->dir->data->case_sensitive) - type |= GRUB_FSHELP_CASE_INSENSITIVE; + type |= VasEBoot_FSHELP_CASE_INSENSITIVE; /* A valid node is found; setup the node and call the callback function. */ - node = grub_malloc (sizeof (*node)); + node = VasEBoot_malloc (sizeof (*node)); if (!node) { - grub_free (filename); + VasEBoot_free (filename); return 1; } node->data = ctx->dir->data; @@ -763,25 +763,25 @@ list_nodes (void *record, void *hook_arg) node->cbuf = 0; node->compress_index = 0; - grub_memcpy (node->extents, fileinfo->data.extents, + VasEBoot_memcpy (node->extents, fileinfo->data.extents, sizeof (node->extents)); - grub_memcpy (node->resource_extents, fileinfo->resource.extents, + VasEBoot_memcpy (node->resource_extents, fileinfo->resource.extents, sizeof (node->resource_extents)); - node->mtime = grub_be_to_cpu32 (fileinfo->mtime) - 2082844800; - node->size = grub_be_to_cpu64 (fileinfo->data.size); - node->resource_size = grub_be_to_cpu64 (fileinfo->resource.size); - node->fileid = grub_be_to_cpu32 (fileinfo->fileid); + node->mtime = VasEBoot_be_to_cpu32 (fileinfo->mtime) - 2082844800; + node->size = VasEBoot_be_to_cpu64 (fileinfo->data.size); + node->resource_size = VasEBoot_be_to_cpu64 (fileinfo->resource.size); + node->fileid = VasEBoot_be_to_cpu32 (fileinfo->fileid); ctx->ret = ctx->hook (filename, type, node, ctx->hook_data); - grub_free (filename); + VasEBoot_free (filename); return ctx->ret; } static int -grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_hfsplus_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { struct list_nodes_ctx ctx = { @@ -791,17 +791,17 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, .hook_data = hook_data }; - struct grub_hfsplus_key_internal intern; - struct grub_hfsplus_btnode *node = NULL; - grub_disk_addr_t ptr = 0; + struct VasEBoot_hfsplus_key_internal intern; + struct VasEBoot_hfsplus_btnode *node = NULL; + VasEBoot_disk_addr_t ptr = 0; { - struct grub_fshelp_node *fsnode; - fsnode = grub_malloc (sizeof (*fsnode)); + struct VasEBoot_fshelp_node *fsnode; + fsnode = VasEBoot_malloc (sizeof (*fsnode)); if (!fsnode) return 1; *fsnode = *dir; - if (hook (".", GRUB_FSHELP_DIR, fsnode, hook_data)) + if (hook (".", VasEBoot_FSHELP_DIR, fsnode, hook_data)) return 1; } @@ -811,50 +811,50 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, intern.catkey.namelen = 0; /* First lookup the first entry. */ - if (grub_hfsplus_btree_search (&dir->data->catalog_tree, &intern, - grub_hfsplus_cmp_catkey, &node, &ptr) + if (VasEBoot_hfsplus_btree_search (&dir->data->catalog_tree, &intern, + VasEBoot_hfsplus_cmp_catkey, &node, &ptr) || !node) return 0; /* Iterate over all entries in this directory. */ - grub_hfsplus_btree_iterate_node (&dir->data->catalog_tree, node, ptr, + VasEBoot_hfsplus_btree_iterate_node (&dir->data->catalog_tree, node, ptr, list_nodes, &ctx); - grub_free (node); + VasEBoot_free (node); return ctx.ret; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_hfsplus_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_hfsplus_open (struct VasEBoot_file *file, const char *name) { - struct grub_hfsplus_data *data; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_hfsplus_data *data; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfsplus_mount (file->device->disk); + data = VasEBoot_hfsplus_mount (file->device->disk); if (!data) goto fail; - grub_fshelp_find_file (name, &data->dirroot, &fdiro, - grub_hfsplus_iterate_dir, - grub_hfsplus_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &data->dirroot, &fdiro, + VasEBoot_hfsplus_iterate_dir, + VasEBoot_hfsplus_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; - if (grub_hfsplus_open_compressed) + if (VasEBoot_hfsplus_open_compressed) { - grub_err_t err; - err = grub_hfsplus_open_compressed (fdiro); + VasEBoot_err_t err; + err = VasEBoot_hfsplus_open_compressed (fdiro); if (err) goto fail; } file->size = fdiro->size; data->opened_file = *fdiro; - grub_free (fdiro); + VasEBoot_free (fdiro); file->data = data; file->offset = 0; @@ -863,127 +863,127 @@ grub_hfsplus_open (struct grub_file *file, const char *name) fail: if (data && fdiro != &data->dirroot) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_hfsplus_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_hfsplus_close (VasEBoot_file_t file) { - struct grub_hfsplus_data *data = - (struct grub_hfsplus_data *) file->data; + struct VasEBoot_hfsplus_data *data = + (struct VasEBoot_hfsplus_data *) file->data; - grub_free (data->opened_file.cbuf); - grub_free (data->opened_file.compress_index); + VasEBoot_free (data->opened_file.cbuf); + VasEBoot_free (data->opened_file.compress_index); - grub_free (data); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read LEN bytes data from FILE into BUF. */ -static grub_ssize_t -grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_hfsplus_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_hfsplus_data *data = - (struct grub_hfsplus_data *) file->data; + struct VasEBoot_hfsplus_data *data = + (struct VasEBoot_hfsplus_data *) file->data; data->opened_file.file = file; - if (grub_hfsplus_read_compressed && data->opened_file.compressed) - return grub_hfsplus_read_compressed (&data->opened_file, + if (VasEBoot_hfsplus_read_compressed && data->opened_file.compressed) + return VasEBoot_hfsplus_read_compressed (&data->opened_file, file->offset, len, buf); - return grub_hfsplus_read_file (&data->opened_file, + return VasEBoot_hfsplus_read_file (&data->opened_file, file->read_hook, file->read_hook_data, file->offset, len, buf); } -/* Context for grub_hfsplus_dir. */ -struct grub_hfsplus_dir_ctx +/* Context for VasEBoot_hfsplus_dir. */ +struct VasEBoot_hfsplus_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_hfsplus_dir. */ +/* Helper for VasEBoot_hfsplus_dir. */ static int -grub_hfsplus_dir_iter (const char *filename, - enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_hfsplus_dir_iter (const char *filename, + enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_hfsplus_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_hfsplus_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtimeset = 1; info.mtime = node->mtime; info.inodeset = 1; info.inode = node->fileid; - info.case_insensitive = !! (filetype & GRUB_FSHELP_CASE_INSENSITIVE); - grub_free (node); + info.case_insensitive = !! (filetype & VasEBoot_FSHELP_CASE_INSENSITIVE); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_hfsplus_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_hfsplus_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_hfsplus_dir_ctx ctx = { hook, hook_data }; - struct grub_hfsplus_data *data = 0; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_hfsplus_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_hfsplus_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfsplus_mount (device->disk); + data = VasEBoot_hfsplus_mount (device->disk); if (!data) goto fail; /* Find the directory that should be opened. */ - grub_fshelp_find_file (path, &data->dirroot, &fdiro, - grub_hfsplus_iterate_dir, - grub_hfsplus_read_symlink, GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &data->dirroot, &fdiro, + VasEBoot_hfsplus_iterate_dir, + VasEBoot_hfsplus_read_symlink, VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; /* Iterate over all entries in this directory. */ - grub_hfsplus_iterate_dir (fdiro, grub_hfsplus_dir_iter, &ctx); + VasEBoot_hfsplus_iterate_dir (fdiro, VasEBoot_hfsplus_dir_iter, &ctx); fail: if (data && fdiro != &data->dirroot) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_hfsplus_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_hfsplus_label (VasEBoot_device_t device, char **label) { - struct grub_hfsplus_data *data; - grub_disk_t disk = device->disk; - struct grub_hfsplus_catkey *catkey; + struct VasEBoot_hfsplus_data *data; + VasEBoot_disk_t disk = device->disk; + struct VasEBoot_hfsplus_catkey *catkey; int i, label_len; - struct grub_hfsplus_key_internal intern; - struct grub_hfsplus_btnode *node = NULL; - grub_disk_addr_t ptr = 0; + struct VasEBoot_hfsplus_key_internal intern; + struct VasEBoot_hfsplus_btnode *node = NULL; + VasEBoot_disk_addr_t ptr = 0; *label = 0; - data = grub_hfsplus_mount (disk); + data = VasEBoot_hfsplus_mount (disk); if (!data) - return grub_errno; + return VasEBoot_errno; /* Create a key that points to the label. */ intern.catkey.parent = 1; @@ -991,114 +991,114 @@ grub_hfsplus_label (grub_device_t device, char **label) intern.catkey.namelen = 0; /* First lookup the first entry. */ - if (grub_hfsplus_btree_search (&data->catalog_tree, &intern, - grub_hfsplus_cmp_catkey_id, &node, &ptr) + if (VasEBoot_hfsplus_btree_search (&data->catalog_tree, &intern, + VasEBoot_hfsplus_cmp_catkey_id, &node, &ptr) || !node) { - grub_free (data); + VasEBoot_free (data); return 0; } - catkey = (struct grub_hfsplus_catkey *) - grub_hfsplus_btree_recptr (&data->catalog_tree, node, ptr); + catkey = (struct VasEBoot_hfsplus_catkey *) + VasEBoot_hfsplus_btree_recptr (&data->catalog_tree, node, ptr); - label_len = grub_be_to_cpu16 (catkey->namelen); + label_len = VasEBoot_be_to_cpu16 (catkey->namelen); for (i = 0; i < label_len; i++) { - catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]); + catkey->name[i] = VasEBoot_be_to_cpu16 (catkey->name[i]); /* If the name is obviously invalid, skip this node. */ if (catkey->name[i] == 0) return 0; } - *label = grub_malloc (label_len * GRUB_MAX_UTF8_PER_UTF16 + 1); + *label = VasEBoot_malloc (label_len * VasEBoot_MAX_UTF8_PER_UTF16 + 1); if (! *label) - return grub_errno; + return VasEBoot_errno; - *grub_utf16_to_utf8 ((grub_uint8_t *) (*label), catkey->name, + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) (*label), catkey->name, label_len) = '\0'; - grub_free (node); - grub_free (data); + VasEBoot_free (node); + VasEBoot_free (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Get mtime. */ -static grub_err_t -grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) +static VasEBoot_err_t +VasEBoot_hfsplus_mtime (VasEBoot_device_t device, VasEBoot_int32_t *tm) { - struct grub_hfsplus_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_hfsplus_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfsplus_mount (disk); + data = VasEBoot_hfsplus_mount (disk); if (!data) *tm = 0; else - *tm = grub_be_to_cpu32 (data->volheader.utime) - 2082844800; + *tm = VasEBoot_be_to_cpu32 (data->volheader.utime) - 2082844800; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_hfsplus_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_hfsplus_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_hfsplus_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_hfsplus_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_hfsplus_mount (disk); + data = VasEBoot_hfsplus_mount (disk); if (data) { - *uuid = grub_xasprintf ("%016llx", + *uuid = VasEBoot_xasprintf ("%016llx", (unsigned long long) - grub_be_to_cpu64 (data->volheader.num_serial)); + VasEBoot_be_to_cpu64 (data->volheader.num_serial)); } else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_hfsplus_fs = +static struct VasEBoot_fs VasEBoot_hfsplus_fs = { .name = "hfsplus", - .dir = grub_hfsplus_dir, - .open = grub_hfsplus_open, - .read = grub_hfsplus_read, - .close = grub_hfsplus_close, - .label = grub_hfsplus_label, - .mtime = grub_hfsplus_mtime, - .uuid = grub_hfsplus_uuid, -#ifdef GRUB_UTIL + .dir = VasEBoot_hfsplus_dir, + .open = VasEBoot_hfsplus_open, + .read = VasEBoot_hfsplus_read, + .close = VasEBoot_hfsplus_close, + .label = VasEBoot_hfsplus_label, + .mtime = VasEBoot_hfsplus_mtime, + .uuid = VasEBoot_hfsplus_uuid, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(hfsplus) +VasEBoot_MOD_INIT(hfsplus) { - grub_fs_register (&grub_hfsplus_fs); + VasEBoot_fs_register (&VasEBoot_hfsplus_fs); my_mod = mod; } -GRUB_MOD_FINI(hfsplus) +VasEBoot_MOD_FINI(hfsplus) { - grub_fs_unregister (&grub_hfsplus_fs); + VasEBoot_fs_unregister (&VasEBoot_hfsplus_fs); } diff --git a/VasEBoot-core/fs/hfspluscomp.c b/VasEBoot-core/fs/hfspluscomp.c index d76f3f137..b63d16a21 100644 --- a/VasEBoot-core/fs/hfspluscomp.c +++ b/VasEBoot-core/fs/hfspluscomp.c @@ -1,81 +1,81 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* HFS+ is documented at http://developer.apple.com/technotes/tn/tn1150.html */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* big-endian. */ -struct grub_hfsplus_compress_header1 +struct VasEBoot_hfsplus_compress_header1 { - grub_uint32_t header_size; - grub_uint32_t end_descriptor_offset; - grub_uint32_t total_compressed_size_including_seek_blocks_and_header2; - grub_uint32_t value_0x32; - grub_uint8_t unused[0xf0]; -} GRUB_PACKED; + VasEBoot_uint32_t header_size; + VasEBoot_uint32_t end_descriptor_offset; + VasEBoot_uint32_t total_compressed_size_including_seek_blocks_and_header2; + VasEBoot_uint32_t value_0x32; + VasEBoot_uint8_t unused[0xf0]; +} VasEBoot_PACKED; /* big-endian. */ -struct grub_hfsplus_compress_header2 +struct VasEBoot_hfsplus_compress_header2 { - grub_uint32_t total_compressed_size_including_seek_blocks; -} GRUB_PACKED; + VasEBoot_uint32_t total_compressed_size_including_seek_blocks; +} VasEBoot_PACKED; /* little-endian. */ -struct grub_hfsplus_compress_header3 +struct VasEBoot_hfsplus_compress_header3 { - grub_uint32_t num_chunks; -} GRUB_PACKED; + VasEBoot_uint32_t num_chunks; +} VasEBoot_PACKED; /* little-endian. */ -struct grub_hfsplus_compress_block_descriptor +struct VasEBoot_hfsplus_compress_block_descriptor { - grub_uint32_t offset; - grub_uint32_t size; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t size; }; -struct grub_hfsplus_compress_end_descriptor +struct VasEBoot_hfsplus_compress_end_descriptor { - grub_uint8_t always_the_same[50]; -} GRUB_PACKED; + VasEBoot_uint8_t always_the_same[50]; +} VasEBoot_PACKED; -struct grub_hfsplus_attr_header +struct VasEBoot_hfsplus_attr_header { - grub_uint8_t unused[3]; - grub_uint8_t type; - grub_uint32_t unknown[1]; - grub_uint64_t size; -} GRUB_PACKED; + VasEBoot_uint8_t unused[3]; + VasEBoot_uint8_t type; + VasEBoot_uint32_t unknown[1]; + VasEBoot_uint64_t size; +} VasEBoot_PACKED; -struct grub_hfsplus_compress_attr +struct VasEBoot_hfsplus_compress_attr { - grub_uint32_t magic; - grub_uint32_t type; - grub_uint32_t uncompressed_inline_size; - grub_uint32_t always_0; -} GRUB_PACKED; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t type; + VasEBoot_uint32_t uncompressed_inline_size; + VasEBoot_uint32_t always_0; +} VasEBoot_PACKED; enum { @@ -84,13 +84,13 @@ enum }; static int -grub_hfsplus_cmp_attrkey (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb) +VasEBoot_hfsplus_cmp_attrkey (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb) { - struct grub_hfsplus_attrkey *attrkey_a = &keya->attrkey; - struct grub_hfsplus_attrkey_internal *attrkey_b = &keyb->attrkey; - grub_uint32_t aparent = grub_be_to_cpu32 (attrkey_a->cnid); - grub_size_t len; + struct VasEBoot_hfsplus_attrkey *attrkey_a = &keya->attrkey; + struct VasEBoot_hfsplus_attrkey_internal *attrkey_b = &keyb->attrkey; + VasEBoot_uint32_t aparent = VasEBoot_be_to_cpu32 (attrkey_a->cnid); + VasEBoot_size_t len; int diff; if (aparent > attrkey_b->cnid) @@ -98,39 +98,39 @@ grub_hfsplus_cmp_attrkey (struct grub_hfsplus_key *keya, if (aparent < attrkey_b->cnid) return -1; - len = grub_be_to_cpu16 (attrkey_a->namelen); + len = VasEBoot_be_to_cpu16 (attrkey_a->namelen); if (len > attrkey_b->namelen) len = attrkey_b->namelen; /* Since it's big-endian memcmp gives the same result as manually comparing uint16_t but may be faster. */ - diff = grub_memcmp (attrkey_a->name, attrkey_b->name, + diff = VasEBoot_memcmp (attrkey_a->name, attrkey_b->name, len * sizeof (attrkey_a->name[0])); if (diff == 0) - diff = grub_be_to_cpu16 (attrkey_a->namelen) - attrkey_b->namelen; + diff = VasEBoot_be_to_cpu16 (attrkey_a->namelen) - attrkey_b->namelen; return diff; } #define HFSPLUS_COMPRESS_BLOCK_SIZE 65536 -static grub_ssize_t -hfsplus_read_compressed_real (struct grub_hfsplus_file *node, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +hfsplus_read_compressed_real (struct VasEBoot_hfsplus_file *node, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { char *tmp_buf = 0; - grub_size_t len0 = len; + VasEBoot_size_t len0 = len; if (node->compressed == 1) { - grub_memcpy (buf, node->cbuf + pos, len); - if (grub_file_progress_hook && node->file) - grub_file_progress_hook (0, 0, len, node->file); + VasEBoot_memcpy (buf, node->cbuf + pos, len); + if (VasEBoot_file_progress_hook && node->file) + VasEBoot_file_progress_hook (0, 0, len, node->file); return len; } while (len) { - grub_uint32_t block = pos / HFSPLUS_COMPRESS_BLOCK_SIZE; - grub_size_t curlen = HFSPLUS_COMPRESS_BLOCK_SIZE + VasEBoot_uint32_t block = pos / HFSPLUS_COMPRESS_BLOCK_SIZE; + VasEBoot_size_t curlen = HFSPLUS_COMPRESS_BLOCK_SIZE - (pos % HFSPLUS_COMPRESS_BLOCK_SIZE); if (curlen > len) @@ -138,58 +138,58 @@ hfsplus_read_compressed_real (struct grub_hfsplus_file *node, if (node->cbuf_block != block) { - grub_uint32_t sz = grub_le_to_cpu32 (node->compress_index[block].size); - grub_size_t ts; + VasEBoot_uint32_t sz = VasEBoot_le_to_cpu32 (node->compress_index[block].size); + VasEBoot_size_t ts; if (!tmp_buf) - tmp_buf = grub_malloc (HFSPLUS_COMPRESS_BLOCK_SIZE); + tmp_buf = VasEBoot_malloc (HFSPLUS_COMPRESS_BLOCK_SIZE); if (!tmp_buf) return -1; - if (grub_hfsplus_read_file (node, 0, 0, - grub_le_to_cpu32 (node->compress_index[block].start) + 0x104, + if (VasEBoot_hfsplus_read_file (node, 0, 0, + VasEBoot_le_to_cpu32 (node->compress_index[block].start) + 0x104, sz, tmp_buf) - != (grub_ssize_t) sz) + != (VasEBoot_ssize_t) sz) { - grub_free (tmp_buf); + VasEBoot_free (tmp_buf); return -1; } ts = HFSPLUS_COMPRESS_BLOCK_SIZE; if (ts > node->size - (pos & ~(HFSPLUS_COMPRESS_BLOCK_SIZE))) ts = node->size - (pos & ~(HFSPLUS_COMPRESS_BLOCK_SIZE)); - if (grub_zlib_decompress (tmp_buf, sz, 0, - node->cbuf, ts) != (grub_ssize_t) ts) + if (VasEBoot_zlib_decompress (tmp_buf, sz, 0, + node->cbuf, ts) != (VasEBoot_ssize_t) ts) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); - grub_free (tmp_buf); + VasEBoot_free (tmp_buf); return -1; } node->cbuf_block = block; } - grub_memcpy (buf, node->cbuf + (pos % HFSPLUS_COMPRESS_BLOCK_SIZE), + VasEBoot_memcpy (buf, node->cbuf + (pos % HFSPLUS_COMPRESS_BLOCK_SIZE), curlen); - if (grub_file_progress_hook && node->file) - grub_file_progress_hook (0, 0, curlen, node->file); + if (VasEBoot_file_progress_hook && node->file) + VasEBoot_file_progress_hook (0, 0, curlen, node->file); buf += curlen; pos += curlen; len -= curlen; } - grub_free (tmp_buf); + VasEBoot_free (tmp_buf); return len0; } -static grub_err_t -hfsplus_open_compressed_real (struct grub_hfsplus_file *node) +static VasEBoot_err_t +hfsplus_open_compressed_real (struct VasEBoot_hfsplus_file *node) { - grub_err_t err; - struct grub_hfsplus_btnode *attr_node; - grub_off_t attr_off; - struct grub_hfsplus_key_internal key; - struct grub_hfsplus_attr_header *attr_head; - struct grub_hfsplus_compress_attr *cmp_head; -#define c grub_cpu_to_be16_compile_time - const grub_uint16_t compress_attr_name[] = + VasEBoot_err_t err; + struct VasEBoot_hfsplus_btnode *attr_node; + VasEBoot_off_t attr_off; + struct VasEBoot_hfsplus_key_internal key; + struct VasEBoot_hfsplus_attr_header *attr_head; + struct VasEBoot_hfsplus_compress_attr *cmp_head; +#define c VasEBoot_cpu_to_be16_compile_time + const VasEBoot_uint16_t compress_attr_name[] = { c('c'), c('o'), c('m'), c('.'), c('a'), c('p'), c('p'), c('l'), c('e'), c('.'), c('d'), c('e'), c('c'), c('m'), c('p'), c('f'), c('s') }; @@ -201,117 +201,117 @@ hfsplus_open_compressed_real (struct grub_hfsplus_file *node) key.attrkey.namelen = sizeof (compress_attr_name) / sizeof (compress_attr_name[0]); key.attrkey.name = compress_attr_name; - err = grub_hfsplus_btree_search (&node->data->attr_tree, &key, - grub_hfsplus_cmp_attrkey, + err = VasEBoot_hfsplus_btree_search (&node->data->attr_tree, &key, + VasEBoot_hfsplus_cmp_attrkey, &attr_node, &attr_off); if (err || !attr_node) { - grub_errno = 0; + VasEBoot_errno = 0; return 0; } - attr_head = (struct grub_hfsplus_attr_header *) - ((char *) grub_hfsplus_btree_recptr (&node->data->attr_tree, + attr_head = (struct VasEBoot_hfsplus_attr_header *) + ((char *) VasEBoot_hfsplus_btree_recptr (&node->data->attr_tree, attr_node, attr_off) - + sizeof (struct grub_hfsplus_attrkey) + sizeof (compress_attr_name)); + + sizeof (struct VasEBoot_hfsplus_attrkey) + sizeof (compress_attr_name)); if (attr_head->type != 0x10 - || !(attr_head->size & grub_cpu_to_be64_compile_time(~0xfULL))) + || !(attr_head->size & VasEBoot_cpu_to_be64_compile_time(~0xfULL))) { - grub_free (attr_node); + VasEBoot_free (attr_node); return 0; } - cmp_head = (struct grub_hfsplus_compress_attr *) (attr_head + 1); - if (cmp_head->magic != grub_cpu_to_be32_compile_time (0x66706d63)) + cmp_head = (struct VasEBoot_hfsplus_compress_attr *) (attr_head + 1); + if (cmp_head->magic != VasEBoot_cpu_to_be32_compile_time (0x66706d63)) { - grub_free (attr_node); + VasEBoot_free (attr_node); return 0; } - node->size = grub_le_to_cpu32 (cmp_head->uncompressed_inline_size); + node->size = VasEBoot_le_to_cpu32 (cmp_head->uncompressed_inline_size); - if (cmp_head->type == grub_cpu_to_le32_compile_time (HFSPLUS_COMPRESSION_RESOURCE)) + if (cmp_head->type == VasEBoot_cpu_to_le32_compile_time (HFSPLUS_COMPRESSION_RESOURCE)) { - grub_uint32_t index_size; + VasEBoot_uint32_t index_size; node->compressed = 2; - if (grub_hfsplus_read_file (node, 0, 0, + if (VasEBoot_hfsplus_read_file (node, 0, 0, 0x104, sizeof (index_size), (char *) &index_size) != 4) { node->compressed = 0; - grub_free (attr_node); - grub_errno = 0; + VasEBoot_free (attr_node); + VasEBoot_errno = 0; return 0; } - node->compress_index_size = grub_le_to_cpu32 (index_size); - node->compress_index = grub_malloc (node->compress_index_size + node->compress_index_size = VasEBoot_le_to_cpu32 (index_size); + node->compress_index = VasEBoot_malloc (node->compress_index_size * sizeof (node->compress_index[0])); if (!node->compress_index) { node->compressed = 0; - grub_free (attr_node); - return grub_errno; + VasEBoot_free (attr_node); + return VasEBoot_errno; } - if (grub_hfsplus_read_file (node, 0, 0, + if (VasEBoot_hfsplus_read_file (node, 0, 0, 0x104 + sizeof (index_size), node->compress_index_size * sizeof (node->compress_index[0]), (char *) node->compress_index) - != (grub_ssize_t) (node->compress_index_size + != (VasEBoot_ssize_t) (node->compress_index_size * sizeof (node->compress_index[0]))) { node->compressed = 0; - grub_free (attr_node); - grub_free (node->compress_index); - grub_errno = 0; + VasEBoot_free (attr_node); + VasEBoot_free (node->compress_index); + VasEBoot_errno = 0; return 0; } node->cbuf_block = -1; - node->cbuf = grub_malloc (HFSPLUS_COMPRESS_BLOCK_SIZE); - grub_free (attr_node); + node->cbuf = VasEBoot_malloc (HFSPLUS_COMPRESS_BLOCK_SIZE); + VasEBoot_free (attr_node); if (!node->cbuf) { node->compressed = 0; - grub_free (node->compress_index); - return grub_errno; + VasEBoot_free (node->compress_index); + return VasEBoot_errno; } return 0; } if (cmp_head->type != HFSPLUS_COMPRESSION_INLINE) { - grub_free (attr_node); + VasEBoot_free (attr_node); return 0; } - node->cbuf = grub_malloc (node->size); + node->cbuf = VasEBoot_malloc (node->size); if (!node->cbuf) - return grub_errno; + return VasEBoot_errno; - if (grub_zlib_decompress ((char *) (cmp_head + 1), - grub_cpu_to_be64 (attr_head->size) + if (VasEBoot_zlib_decompress ((char *) (cmp_head + 1), + VasEBoot_cpu_to_be64 (attr_head->size) - sizeof (*cmp_head), 0, node->cbuf, node->size) - != (grub_ssize_t) node->size) + != (VasEBoot_ssize_t) node->size) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); - return grub_errno; + return VasEBoot_errno; } node->compressed = 1; return 0; } -GRUB_MOD_INIT(hfspluscomp) +VasEBoot_MOD_INIT(hfspluscomp) { - grub_hfsplus_open_compressed = hfsplus_open_compressed_real; - grub_hfsplus_read_compressed = hfsplus_read_compressed_real; + VasEBoot_hfsplus_open_compressed = hfsplus_open_compressed_real; + VasEBoot_hfsplus_read_compressed = hfsplus_read_compressed_real; } -GRUB_MOD_FINI(hfspluscomp) +VasEBoot_MOD_FINI(hfspluscomp) { - grub_hfsplus_open_compressed = 0; - grub_hfsplus_read_compressed = 0; + VasEBoot_hfsplus_open_compressed = 0; + VasEBoot_hfsplus_read_compressed = 0; } diff --git a/VasEBoot-core/fs/iso9660.c b/VasEBoot-core/fs/iso9660.c index c9c8374bf..1a3acbf55 100644 --- a/VasEBoot-core/fs/iso9660.c +++ b/VasEBoot-core/fs/iso9660.c @@ -1,167 +1,167 @@ /* iso9660.c - iso9660 implementation with extensions: SUSP, Rock Ridge. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_ISO9660_FSTYPE_DIR 0040000 -#define GRUB_ISO9660_FSTYPE_REG 0100000 -#define GRUB_ISO9660_FSTYPE_SYMLINK 0120000 -#define GRUB_ISO9660_FSTYPE_MASK 0170000 +#define VasEBoot_ISO9660_FSTYPE_DIR 0040000 +#define VasEBoot_ISO9660_FSTYPE_REG 0100000 +#define VasEBoot_ISO9660_FSTYPE_SYMLINK 0120000 +#define VasEBoot_ISO9660_FSTYPE_MASK 0170000 -#define GRUB_ISO9660_LOG2_BLKSZ 2 -#define GRUB_ISO9660_BLKSZ 2048 +#define VasEBoot_ISO9660_LOG2_BLKSZ 2 +#define VasEBoot_ISO9660_BLKSZ 2048 -#define GRUB_ISO9660_RR_DOT 2 -#define GRUB_ISO9660_RR_DOTDOT 4 +#define VasEBoot_ISO9660_RR_DOT 2 +#define VasEBoot_ISO9660_RR_DOTDOT 4 -#define GRUB_ISO9660_VOLDESC_BOOT 0 -#define GRUB_ISO9660_VOLDESC_PRIMARY 1 -#define GRUB_ISO9660_VOLDESC_SUPP 2 -#define GRUB_ISO9660_VOLDESC_PART 3 -#define GRUB_ISO9660_VOLDESC_END 255 +#define VasEBoot_ISO9660_VOLDESC_BOOT 0 +#define VasEBoot_ISO9660_VOLDESC_PRIMARY 1 +#define VasEBoot_ISO9660_VOLDESC_SUPP 2 +#define VasEBoot_ISO9660_VOLDESC_PART 3 +#define VasEBoot_ISO9660_VOLDESC_END 255 /* The head of a volume descriptor. */ -struct grub_iso9660_voldesc +struct VasEBoot_iso9660_voldesc { - grub_uint8_t type; - grub_uint8_t magic[5]; - grub_uint8_t version; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t magic[5]; + VasEBoot_uint8_t version; +} VasEBoot_PACKED; -struct grub_iso9660_date2 +struct VasEBoot_iso9660_date2 { - grub_uint8_t year; - grub_uint8_t month; - grub_uint8_t day; - grub_uint8_t hour; - grub_uint8_t minute; - grub_uint8_t second; - grub_uint8_t offset; -} GRUB_PACKED; + VasEBoot_uint8_t year; + VasEBoot_uint8_t month; + VasEBoot_uint8_t day; + VasEBoot_uint8_t hour; + VasEBoot_uint8_t minute; + VasEBoot_uint8_t second; + VasEBoot_uint8_t offset; +} VasEBoot_PACKED; /* A directory entry. */ -struct grub_iso9660_dir +struct VasEBoot_iso9660_dir { - grub_uint8_t len; - grub_uint8_t ext_sectors; - grub_uint32_t first_sector; - grub_uint32_t first_sector_be; - grub_uint32_t size; - grub_uint32_t size_be; - struct grub_iso9660_date2 mtime; - grub_uint8_t flags; - grub_uint8_t unused2[6]; + VasEBoot_uint8_t len; + VasEBoot_uint8_t ext_sectors; + VasEBoot_uint32_t first_sector; + VasEBoot_uint32_t first_sector_be; + VasEBoot_uint32_t size; + VasEBoot_uint32_t size_be; + struct VasEBoot_iso9660_date2 mtime; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t unused2[6]; #define MAX_NAMELEN 255 - grub_uint8_t namelen; -} GRUB_PACKED; + VasEBoot_uint8_t namelen; +} VasEBoot_PACKED; -struct grub_iso9660_date +struct VasEBoot_iso9660_date { - grub_uint8_t year[4]; - grub_uint8_t month[2]; - grub_uint8_t day[2]; - grub_uint8_t hour[2]; - grub_uint8_t minute[2]; - grub_uint8_t second[2]; - grub_uint8_t hundredth[2]; - grub_uint8_t offset; -} GRUB_PACKED; + VasEBoot_uint8_t year[4]; + VasEBoot_uint8_t month[2]; + VasEBoot_uint8_t day[2]; + VasEBoot_uint8_t hour[2]; + VasEBoot_uint8_t minute[2]; + VasEBoot_uint8_t second[2]; + VasEBoot_uint8_t hundredth[2]; + VasEBoot_uint8_t offset; +} VasEBoot_PACKED; /* The primary volume descriptor. Only little endian is used. */ -struct grub_iso9660_primary_voldesc +struct VasEBoot_iso9660_primary_voldesc { - struct grub_iso9660_voldesc voldesc; - grub_uint8_t unused1[33]; - grub_uint8_t volname[32]; - grub_uint8_t unused2[16]; - grub_uint8_t escape[32]; - grub_uint8_t unused3[12]; - grub_uint32_t path_table_size; - grub_uint8_t unused4[4]; - grub_uint32_t path_table; - grub_uint8_t unused5[12]; - struct grub_iso9660_dir rootdir; - grub_uint8_t unused6[624]; - struct grub_iso9660_date created; - struct grub_iso9660_date modified; -} GRUB_PACKED; + struct VasEBoot_iso9660_voldesc voldesc; + VasEBoot_uint8_t unused1[33]; + VasEBoot_uint8_t volname[32]; + VasEBoot_uint8_t unused2[16]; + VasEBoot_uint8_t escape[32]; + VasEBoot_uint8_t unused3[12]; + VasEBoot_uint32_t path_table_size; + VasEBoot_uint8_t unused4[4]; + VasEBoot_uint32_t path_table; + VasEBoot_uint8_t unused5[12]; + struct VasEBoot_iso9660_dir rootdir; + VasEBoot_uint8_t unused6[624]; + struct VasEBoot_iso9660_date created; + struct VasEBoot_iso9660_date modified; +} VasEBoot_PACKED; /* A single entry in the path table. */ -struct grub_iso9660_path +struct VasEBoot_iso9660_path { - grub_uint8_t len; - grub_uint8_t sectors; - grub_uint32_t first_sector; - grub_uint16_t parentdir; - grub_uint8_t name[0]; -} GRUB_PACKED; + VasEBoot_uint8_t len; + VasEBoot_uint8_t sectors; + VasEBoot_uint32_t first_sector; + VasEBoot_uint16_t parentdir; + VasEBoot_uint8_t name[0]; +} VasEBoot_PACKED; /* An entry in the System Usage area of the directory entry. */ -struct grub_iso9660_susp_entry +struct VasEBoot_iso9660_susp_entry { - grub_uint8_t sig[2]; - grub_uint8_t len; - grub_uint8_t version; - grub_uint8_t data[0]; -} GRUB_PACKED; + VasEBoot_uint8_t sig[2]; + VasEBoot_uint8_t len; + VasEBoot_uint8_t version; + VasEBoot_uint8_t data[0]; +} VasEBoot_PACKED; /* The CE entry. This is used to describe the next block where data can be found. */ -struct grub_iso9660_susp_ce +struct VasEBoot_iso9660_susp_ce { - struct grub_iso9660_susp_entry entry; - grub_uint32_t blk; - grub_uint32_t blk_be; - grub_uint32_t off; - grub_uint32_t off_be; - grub_uint32_t len; - grub_uint32_t len_be; -} GRUB_PACKED; + struct VasEBoot_iso9660_susp_entry entry; + VasEBoot_uint32_t blk; + VasEBoot_uint32_t blk_be; + VasEBoot_uint32_t off; + VasEBoot_uint32_t off_be; + VasEBoot_uint32_t len; + VasEBoot_uint32_t len_be; +} VasEBoot_PACKED; -struct grub_iso9660_data +struct VasEBoot_iso9660_data { - struct grub_iso9660_primary_voldesc voldesc; - grub_disk_t disk; + struct VasEBoot_iso9660_primary_voldesc voldesc; + VasEBoot_disk_t disk; int rockridge; int susp_skip; int joliet; - struct grub_fshelp_node *node; + struct VasEBoot_fshelp_node *node; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_iso9660_data *data; - grub_size_t have_dirents, alloc_dirents; + struct VasEBoot_iso9660_data *data; + VasEBoot_size_t have_dirents, alloc_dirents; int have_symlink; - struct grub_iso9660_dir dirents[8]; + struct VasEBoot_iso9660_dir dirents[8]; char symlink[0]; }; @@ -173,13 +173,13 @@ enum FLAG_MORE_EXTENTS = 0x80 }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_err_t -iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) +static VasEBoot_err_t +iso9660_to_unixtime (const struct VasEBoot_iso9660_date *i, VasEBoot_int32_t *nix) { - struct grub_datetime datetime; + struct VasEBoot_datetime datetime; if (! i->year[0] && ! i->year[1] && ! i->year[2] && ! i->year[3] @@ -189,7 +189,7 @@ iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) && ! i->minute[0] && ! i->minute[1] && ! i->second[0] && ! i->second[1] && ! i->hundredth[0] && ! i->hundredth[1]) - return grub_error (GRUB_ERR_BAD_NUMBER, "empty date"); + return VasEBoot_error (VasEBoot_ERR_BAD_NUMBER, "empty date"); datetime.year = (i->year[0] - '0') * 1000 + (i->year[1] - '0') * 100 + (i->year[2] - '0') * 10 + (i->year[3] - '0'); datetime.month = (i->month[0] - '0') * 10 + (i->month[1] - '0'); @@ -198,16 +198,16 @@ iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) datetime.minute = (i->minute[0] - '0') * 10 + (i->minute[1] - '0'); datetime.second = (i->second[0] - '0') * 10 + (i->second[1] - '0'); - if (!grub_datetime2unixtime (&datetime, nix)) - return grub_error (GRUB_ERR_BAD_NUMBER, "incorrect date"); + if (!VasEBoot_datetime2unixtime (&datetime, nix)) + return VasEBoot_error (VasEBoot_ERR_BAD_NUMBER, "incorrect date"); *nix -= i->offset * 60 * 15; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -iso9660_to_unixtime2 (const struct grub_iso9660_date2 *i, grub_int32_t *nix) +iso9660_to_unixtime2 (const struct VasEBoot_iso9660_date2 *i, VasEBoot_int32_t *nix) { - struct grub_datetime datetime; + struct VasEBoot_datetime datetime; datetime.year = i->year + 1900; datetime.month = i->month; @@ -216,34 +216,34 @@ iso9660_to_unixtime2 (const struct grub_iso9660_date2 *i, grub_int32_t *nix) datetime.minute = i->minute; datetime.second = i->second; - if (!grub_datetime2unixtime (&datetime, nix)) + if (!VasEBoot_datetime2unixtime (&datetime, nix)) return 0; *nix -= i->offset * 60 * 15; return 1; } -static grub_err_t -read_node (grub_fshelp_node_t node, grub_off_t off, grub_size_t len, char *buf) +static VasEBoot_err_t +read_node (VasEBoot_fshelp_node_t node, VasEBoot_off_t off, VasEBoot_size_t len, char *buf) { - grub_size_t i = 0; + VasEBoot_size_t i = 0; while (len > 0) { - grub_size_t toread; - grub_err_t err; + VasEBoot_size_t toread; + VasEBoot_err_t err; while (i < node->have_dirents - && off >= grub_le_to_cpu32 (node->dirents[i].size)) + && off >= VasEBoot_le_to_cpu32 (node->dirents[i].size)) { - off -= grub_le_to_cpu32 (node->dirents[i].size); + off -= VasEBoot_le_to_cpu32 (node->dirents[i].size); i++; } if (i == node->have_dirents) - return grub_error (GRUB_ERR_OUT_OF_RANGE, "read out of range"); - toread = grub_le_to_cpu32 (node->dirents[i].size); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "read out of range"); + toread = VasEBoot_le_to_cpu32 (node->dirents[i].size); if (toread > len) toread = len; - err = grub_disk_read (node->data->disk, - ((grub_disk_addr_t) grub_le_to_cpu32 (node->dirents[i].first_sector)) << GRUB_ISO9660_LOG2_BLKSZ, + err = VasEBoot_disk_read (node->data->disk, + ((VasEBoot_disk_addr_t) VasEBoot_le_to_cpu32 (node->dirents[i].first_sector)) << VasEBoot_ISO9660_LOG2_BLKSZ, off, toread, buf); if (err) return err; @@ -251,106 +251,106 @@ read_node (grub_fshelp_node_t node, grub_off_t off, grub_size_t len, char *buf) off += toread; buf += toread; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Iterate over the susp entries, starting with block SUA_BLOCK on the offset SUA_POS with a size of SUA_SIZE bytes. Hook is called for every entry. */ -static grub_err_t -grub_iso9660_susp_iterate (grub_fshelp_node_t node, grub_off_t off, - grub_ssize_t sua_size, - grub_err_t (*hook) - (struct grub_iso9660_susp_entry *entry, void *hook_arg), +static VasEBoot_err_t +VasEBoot_iso9660_susp_iterate (VasEBoot_fshelp_node_t node, VasEBoot_off_t off, + VasEBoot_ssize_t sua_size, + VasEBoot_err_t (*hook) + (struct VasEBoot_iso9660_susp_entry *entry, void *hook_arg), void *hook_arg) { char *sua; - struct grub_iso9660_susp_entry *entry; - grub_err_t err; + struct VasEBoot_iso9660_susp_entry *entry; + VasEBoot_err_t err; if (sua_size <= 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - sua = grub_malloc (sua_size); + sua = VasEBoot_malloc (sua_size); if (!sua) - return grub_errno; + return VasEBoot_errno; /* Load a part of the System Usage Area. */ err = read_node (node, off, sua_size, sua); if (err) return err; - for (entry = (struct grub_iso9660_susp_entry *) sua; (char *) entry < (char *) sua + sua_size - 1 && entry->len > 0; - entry = (struct grub_iso9660_susp_entry *) + for (entry = (struct VasEBoot_iso9660_susp_entry *) sua; (char *) entry < (char *) sua + sua_size - 1 && entry->len > 0; + entry = (struct VasEBoot_iso9660_susp_entry *) ((char *) entry + entry->len)) { /* The last entry. */ - if (grub_strncmp ((char *) entry->sig, "ST", 2) == 0) + if (VasEBoot_strncmp ((char *) entry->sig, "ST", 2) == 0) break; /* Additional entries are stored elsewhere. */ - if (grub_strncmp ((char *) entry->sig, "CE", 2) == 0) + if (VasEBoot_strncmp ((char *) entry->sig, "CE", 2) == 0) { - struct grub_iso9660_susp_ce *ce; - grub_disk_addr_t ce_block; + struct VasEBoot_iso9660_susp_ce *ce; + VasEBoot_disk_addr_t ce_block; - ce = (struct grub_iso9660_susp_ce *) entry; - sua_size = grub_le_to_cpu32 (ce->len); - off = grub_le_to_cpu32 (ce->off); - ce_block = grub_le_to_cpu32 (ce->blk) << GRUB_ISO9660_LOG2_BLKSZ; + ce = (struct VasEBoot_iso9660_susp_ce *) entry; + sua_size = VasEBoot_le_to_cpu32 (ce->len); + off = VasEBoot_le_to_cpu32 (ce->off); + ce_block = VasEBoot_le_to_cpu32 (ce->blk) << VasEBoot_ISO9660_LOG2_BLKSZ; - grub_free (sua); - sua = grub_malloc (sua_size); + VasEBoot_free (sua); + sua = VasEBoot_malloc (sua_size); if (!sua) - return grub_errno; + return VasEBoot_errno; /* Load a part of the System Usage Area. */ - err = grub_disk_read (node->data->disk, ce_block, off, + err = VasEBoot_disk_read (node->data->disk, ce_block, off, sua_size, sua); if (err) return err; - entry = (struct grub_iso9660_susp_entry *) sua; + entry = (struct VasEBoot_iso9660_susp_entry *) sua; } if (hook (entry, hook_arg)) { - grub_free (sua); + VasEBoot_free (sua); return 0; } } - grub_free (sua); + VasEBoot_free (sua); return 0; } static char * -grub_iso9660_convert_string (grub_uint8_t *us, int len) +VasEBoot_iso9660_convert_string (VasEBoot_uint8_t *us, int len) { char *p; int i; - grub_uint16_t t[MAX_NAMELEN / 2 + 1]; + VasEBoot_uint16_t t[MAX_NAMELEN / 2 + 1]; - p = grub_malloc (len * GRUB_MAX_UTF8_PER_UTF16 + 1); + p = VasEBoot_malloc (len * VasEBoot_MAX_UTF8_PER_UTF16 + 1); if (! p) return NULL; for (i=0; isig, "ER", 2) == 0) + if (VasEBoot_strncmp ((char *) susp_entry->sig, "ER", 2) == 0) { data->rockridge = 1; return 1; @@ -358,51 +358,51 @@ susp_iterate_set_rockridge (struct grub_iso9660_susp_entry *susp_entry, return 0; } -static grub_err_t -set_rockridge (struct grub_iso9660_data *data) +static VasEBoot_err_t +set_rockridge (struct VasEBoot_iso9660_data *data) { int sua_pos; int sua_size; char *sua; - struct grub_iso9660_dir rootdir; - struct grub_iso9660_susp_entry *entry; + struct VasEBoot_iso9660_dir rootdir; + struct VasEBoot_iso9660_susp_entry *entry; data->rockridge = 0; /* Read the system use area and test it to see if SUSP is supported. */ - if (grub_disk_read (data->disk, - (grub_le_to_cpu32 (data->voldesc.rootdir.first_sector) - << GRUB_ISO9660_LOG2_BLKSZ), 0, + if (VasEBoot_disk_read (data->disk, + (VasEBoot_le_to_cpu32 (data->voldesc.rootdir.first_sector) + << VasEBoot_ISO9660_LOG2_BLKSZ), 0, sizeof (rootdir), (char *) &rootdir)) - return grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a ISO9660 filesystem"); sua_pos = (sizeof (rootdir) + rootdir.namelen + (rootdir.namelen % 2) - 1); sua_size = rootdir.len - sua_pos; if (!sua_size) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - sua = grub_malloc (sua_size); + sua = VasEBoot_malloc (sua_size); if (! sua) - return grub_errno; + return VasEBoot_errno; - if (grub_disk_read (data->disk, - (grub_le_to_cpu32 (data->voldesc.rootdir.first_sector) - << GRUB_ISO9660_LOG2_BLKSZ), sua_pos, + if (VasEBoot_disk_read (data->disk, + (VasEBoot_le_to_cpu32 (data->voldesc.rootdir.first_sector) + << VasEBoot_ISO9660_LOG2_BLKSZ), sua_pos, sua_size, sua)) { - grub_free (sua); - return grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem"); + VasEBoot_free (sua); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a ISO9660 filesystem"); } - entry = (struct grub_iso9660_susp_entry *) sua; + entry = (struct VasEBoot_iso9660_susp_entry *) sua; /* Test if the SUSP protocol is used on this filesystem. */ - if (grub_strncmp ((char *) entry->sig, "SP", 2) == 0) + if (VasEBoot_strncmp ((char *) entry->sig, "SP", 2) == 0) { - struct grub_fshelp_node rootnode; + struct VasEBoot_fshelp_node rootnode; rootnode.data = data; rootnode.alloc_dirents = ARRAY_SIZE (rootnode.dirents); @@ -413,30 +413,30 @@ set_rockridge (struct grub_iso9660_data *data) /* The 2nd data byte stored how many bytes are skipped every time to get to the SUA (System Usage Area). */ data->susp_skip = entry->data[2]; - entry = (struct grub_iso9660_susp_entry *) ((char *) entry + entry->len); + entry = (struct VasEBoot_iso9660_susp_entry *) ((char *) entry + entry->len); /* Iterate over the entries in the SUA area to detect extensions. */ - if (grub_iso9660_susp_iterate (&rootnode, + if (VasEBoot_iso9660_susp_iterate (&rootnode, sua_pos, sua_size, susp_iterate_set_rockridge, data)) { - grub_free (sua); - return grub_errno; + VasEBoot_free (sua); + return VasEBoot_errno; } } - grub_free (sua); - return GRUB_ERR_NONE; + VasEBoot_free (sua); + return VasEBoot_ERR_NONE; } -static struct grub_iso9660_data * -grub_iso9660_mount (grub_disk_t disk) +static struct VasEBoot_iso9660_data * +VasEBoot_iso9660_mount (VasEBoot_disk_t disk) { - struct grub_iso9660_data *data = 0; - struct grub_iso9660_primary_voldesc voldesc; + struct VasEBoot_iso9660_data *data = 0; + struct VasEBoot_iso9660_primary_voldesc voldesc; int block; - data = grub_zalloc (sizeof (struct grub_iso9660_data)); + data = VasEBoot_zalloc (sizeof (struct VasEBoot_iso9660_data)); if (! data) return 0; @@ -448,24 +448,24 @@ grub_iso9660_mount (grub_disk_t disk) int copy_voldesc = 0; /* Read the superblock. */ - if (grub_disk_read (disk, block << GRUB_ISO9660_LOG2_BLKSZ, 0, - sizeof (struct grub_iso9660_primary_voldesc), + if (VasEBoot_disk_read (disk, block << VasEBoot_ISO9660_LOG2_BLKSZ, 0, + sizeof (struct VasEBoot_iso9660_primary_voldesc), (char *) &voldesc)) { - grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a ISO9660 filesystem"); goto fail; } - if (grub_strncmp ((char *) voldesc.voldesc.magic, "CD001", 5) != 0) + if (VasEBoot_strncmp ((char *) voldesc.voldesc.magic, "CD001", 5) != 0) { - grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a ISO9660 filesystem"); goto fail; } - if (voldesc.voldesc.type == GRUB_ISO9660_VOLDESC_PRIMARY) + if (voldesc.voldesc.type == VasEBoot_ISO9660_VOLDESC_PRIMARY) copy_voldesc = 1; else if (!data->rockridge - && (voldesc.voldesc.type == GRUB_ISO9660_VOLDESC_SUPP) + && (voldesc.voldesc.type == VasEBoot_ISO9660_VOLDESC_SUPP) && (voldesc.escape[0] == 0x25) && (voldesc.escape[1] == 0x2f) && ((voldesc.escape[2] == 0x40) || /* UCS-2 Level 1. */ @@ -478,40 +478,40 @@ grub_iso9660_mount (grub_disk_t disk) if (copy_voldesc) { - grub_memcpy((char *) &data->voldesc, (char *) &voldesc, - sizeof (struct grub_iso9660_primary_voldesc)); + VasEBoot_memcpy((char *) &data->voldesc, (char *) &voldesc, + sizeof (struct VasEBoot_iso9660_primary_voldesc)); if (set_rockridge (data)) goto fail; } block++; - } while (voldesc.voldesc.type != GRUB_ISO9660_VOLDESC_END); + } while (voldesc.voldesc.type != VasEBoot_ISO9660_VOLDESC_END); return data; fail: - grub_free (data); + VasEBoot_free (data); return 0; } static char * -grub_iso9660_read_symlink (grub_fshelp_node_t node) +VasEBoot_iso9660_read_symlink (VasEBoot_fshelp_node_t node) { return node->have_symlink - ? grub_strdup (node->symlink + ? VasEBoot_strdup (node->symlink + (node->have_dirents) * sizeof (node->dirents[0]) - - sizeof (node->dirents)) : grub_strdup (""); + - sizeof (node->dirents)) : VasEBoot_strdup (""); } -static grub_off_t -get_node_size (grub_fshelp_node_t node) +static VasEBoot_off_t +get_node_size (VasEBoot_fshelp_node_t node) { - grub_off_t ret = 0; - grub_size_t i; + VasEBoot_off_t ret = 0; + VasEBoot_size_t i; for (i = 0; i < node->have_dirents; i++) - ret += grub_le_to_cpu32 (node->dirents[i].size); + ret += VasEBoot_le_to_cpu32 (node->dirents[i].size); return ret; } @@ -519,7 +519,7 @@ struct iterate_dir_ctx { char *filename; int filename_alloc; - enum grub_fshelp_filetype type; + enum VasEBoot_fshelp_filetype type; char *symlink; int was_continue; }; @@ -530,82 +530,82 @@ add_part (struct iterate_dir_ctx *ctx, const char *part, int len2) { - int size = ctx->symlink ? grub_strlen (ctx->symlink) : 0; + int size = ctx->symlink ? VasEBoot_strlen (ctx->symlink) : 0; - ctx->symlink = grub_realloc (ctx->symlink, size + len2 + 1); + ctx->symlink = VasEBoot_realloc (ctx->symlink, size + len2 + 1); if (! ctx->symlink) return; - grub_memcpy (ctx->symlink + size, part, len2); + VasEBoot_memcpy (ctx->symlink + size, part, len2); ctx->symlink[size + len2] = 0; } -static grub_err_t -susp_iterate_dir (struct grub_iso9660_susp_entry *entry, +static VasEBoot_err_t +susp_iterate_dir (struct VasEBoot_iso9660_susp_entry *entry, void *_ctx) { struct iterate_dir_ctx *ctx = _ctx; /* The filename in the rock ridge entry. */ - if (grub_strncmp ("NM", (char *) entry->sig, 2) == 0) + if (VasEBoot_strncmp ("NM", (char *) entry->sig, 2) == 0) { /* The flags are stored at the data position 0, here the filename type is stored. */ /* FIXME: Fix this slightly improper cast. */ - if (entry->data[0] & GRUB_ISO9660_RR_DOT) + if (entry->data[0] & VasEBoot_ISO9660_RR_DOT) ctx->filename = (char *) "."; - else if (entry->data[0] & GRUB_ISO9660_RR_DOTDOT) + else if (entry->data[0] & VasEBoot_ISO9660_RR_DOTDOT) ctx->filename = (char *) ".."; else if (entry->len >= 5) { - grub_size_t off = 0, csize = 1; + VasEBoot_size_t off = 0, csize = 1; char *old; csize = entry->len - 5; old = ctx->filename; if (ctx->filename_alloc) { - off = grub_strlen (ctx->filename); - ctx->filename = grub_realloc (ctx->filename, csize + off + 1); + off = VasEBoot_strlen (ctx->filename); + ctx->filename = VasEBoot_realloc (ctx->filename, csize + off + 1); } else { off = 0; - ctx->filename = grub_zalloc (csize + 1); + ctx->filename = VasEBoot_zalloc (csize + 1); } if (!ctx->filename) { ctx->filename = old; - return grub_errno; + return VasEBoot_errno; } ctx->filename_alloc = 1; - grub_memcpy (ctx->filename + off, (char *) &entry->data[1], csize); + VasEBoot_memcpy (ctx->filename + off, (char *) &entry->data[1], csize); ctx->filename[off + csize] = '\0'; } } /* The mode information (st_mode). */ - else if (grub_strncmp ((char *) entry->sig, "PX", 2) == 0) + else if (VasEBoot_strncmp ((char *) entry->sig, "PX", 2) == 0) { /* At position 0 of the PX record the st_mode information is stored (little-endian). */ - grub_uint32_t mode = ((entry->data[0] + (entry->data[1] << 8)) - & GRUB_ISO9660_FSTYPE_MASK); + VasEBoot_uint32_t mode = ((entry->data[0] + (entry->data[1] << 8)) + & VasEBoot_ISO9660_FSTYPE_MASK); switch (mode) { - case GRUB_ISO9660_FSTYPE_DIR: - ctx->type = GRUB_FSHELP_DIR; + case VasEBoot_ISO9660_FSTYPE_DIR: + ctx->type = VasEBoot_FSHELP_DIR; break; - case GRUB_ISO9660_FSTYPE_REG: - ctx->type = GRUB_FSHELP_REG; + case VasEBoot_ISO9660_FSTYPE_REG: + ctx->type = VasEBoot_FSHELP_REG; break; - case GRUB_ISO9660_FSTYPE_SYMLINK: - ctx->type = GRUB_FSHELP_SYMLINK; + case VasEBoot_ISO9660_FSTYPE_SYMLINK: + ctx->type = VasEBoot_FSHELP_SYMLINK; break; default: - ctx->type = GRUB_FSHELP_UNKNOWN; + ctx->type = VasEBoot_FSHELP_UNKNOWN; } } - else if (grub_strncmp ("SL", (char *) entry->sig, 2) == 0) + else if (VasEBoot_strncmp ("SL", (char *) entry->sig, 2) == 0) { unsigned int pos = 1; @@ -645,21 +645,21 @@ susp_iterate_dir (struct grub_iso9660_susp_entry *entry, pos += entry->data[pos + 1] + 2; } - /* Check if `grub_realloc' failed. */ - if (grub_errno) - return grub_errno; + /* Check if `VasEBoot_realloc' failed. */ + if (VasEBoot_errno) + return VasEBoot_errno; } return 0; } static int -grub_iso9660_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_iso9660_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - struct grub_iso9660_dir dirent; - grub_off_t offset = 0; - grub_off_t len; + struct VasEBoot_iso9660_dir dirent; + VasEBoot_off_t offset = 0; + VasEBoot_off_t len; struct iterate_dir_ctx ctx; len = get_node_size (dir); @@ -675,14 +675,14 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, /* The end of the block, skip to the next one. */ if (!dirent.len) { - offset = (offset / GRUB_ISO9660_BLKSZ + 1) * GRUB_ISO9660_BLKSZ; + offset = (offset / VasEBoot_ISO9660_BLKSZ + 1) * VasEBoot_ISO9660_BLKSZ; continue; } { char name[MAX_NAMELEN + 1]; int nameoffset = offset + sizeof (dirent); - struct grub_fshelp_node *node; + struct VasEBoot_fshelp_node *node; int sua_off = (sizeof (dirent) + dirent.namelen + 1 - (dirent.namelen % 2)); int sua_size = dirent.len - sua_off; @@ -691,10 +691,10 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, ctx.filename = 0; ctx.filename_alloc = 0; - ctx.type = GRUB_FSHELP_UNKNOWN; + ctx.type = VasEBoot_FSHELP_UNKNOWN; if (dir->data->rockridge - && grub_iso9660_susp_iterate (dir, sua_off, sua_size, + && VasEBoot_iso9660_susp_iterate (dir, sua_off, sua_size, susp_iterate_dir, &ctx)) return 0; @@ -702,7 +702,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, if (read_node (dir, nameoffset, dirent.namelen, (char *) name)) return 0; - node = grub_malloc (sizeof (struct grub_fshelp_node)); + node = VasEBoot_malloc (sizeof (struct VasEBoot_fshelp_node)); if (!node) return 0; @@ -715,12 +715,12 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, /* If the filetype was not stored using rockridge, use whatever is stored in the iso9660 filesystem. */ - if (ctx.type == GRUB_FSHELP_UNKNOWN) + if (ctx.type == VasEBoot_FSHELP_UNKNOWN) { if ((dirent.flags & FLAG_TYPE) == FLAG_TYPE_DIR) - ctx.type = GRUB_FSHELP_DIR; + ctx.type = VasEBoot_FSHELP_DIR; else - ctx.type = GRUB_FSHELP_REG; + ctx.type = VasEBoot_FSHELP_REG; } /* . and .. */ @@ -736,13 +736,13 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, { char *ptr; name[dirent.namelen] = '\0'; - ctx.filename = grub_strrchr (name, ';'); + ctx.filename = VasEBoot_strrchr (name, ';'); if (ctx.filename) *ctx.filename = '\0'; /* ISO9660 names are not case-preserving. */ - ctx.type |= GRUB_FSHELP_CASE_INSENSITIVE; + ctx.type |= VasEBoot_FSHELP_CASE_INSENSITIVE; for (ptr = name; *ptr; ptr++) - *ptr = grub_tolower (*ptr); + *ptr = VasEBoot_tolower (*ptr); if (ptr != name && *(ptr - 1) == '.') *(ptr - 1) = 0; ctx.filename = name; @@ -752,10 +752,10 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, { char *semicolon; - ctx.filename = grub_iso9660_convert_string - ((grub_uint8_t *) name, dirent.namelen >> 1); + ctx.filename = VasEBoot_iso9660_convert_string + ((VasEBoot_uint8_t *) name, dirent.namelen >> 1); - semicolon = grub_strrchr (ctx.filename, ';'); + semicolon = VasEBoot_strrchr (ctx.filename, ';'); if (semicolon) *semicolon = '\0'; @@ -769,24 +769,24 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, if (read_node (dir, offset, sizeof (dirent), (char *) &dirent)) { if (ctx.filename_alloc) - grub_free (ctx.filename); - grub_free (node); + VasEBoot_free (ctx.filename); + VasEBoot_free (node); return 0; } if (node->have_dirents >= node->alloc_dirents) { - struct grub_fshelp_node *new_node; + struct VasEBoot_fshelp_node *new_node; node->alloc_dirents *= 2; - new_node = grub_realloc (node, - sizeof (struct grub_fshelp_node) + new_node = VasEBoot_realloc (node, + sizeof (struct VasEBoot_fshelp_node) + ((node->alloc_dirents - ARRAY_SIZE (node->dirents)) * sizeof (node->dirents[0]))); if (!new_node) { if (ctx.filename_alloc) - grub_free (ctx.filename); - grub_free (node); + VasEBoot_free (ctx.filename); + VasEBoot_free (node); return 0; } node = new_node; @@ -796,40 +796,40 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, if (ctx.symlink) { if ((node->alloc_dirents - node->have_dirents) - * sizeof (node->dirents[0]) < grub_strlen (ctx.symlink) + 1) + * sizeof (node->dirents[0]) < VasEBoot_strlen (ctx.symlink) + 1) { - struct grub_fshelp_node *new_node; - new_node = grub_realloc (node, - sizeof (struct grub_fshelp_node) + struct VasEBoot_fshelp_node *new_node; + new_node = VasEBoot_realloc (node, + sizeof (struct VasEBoot_fshelp_node) + ((node->alloc_dirents - ARRAY_SIZE (node->dirents)) * sizeof (node->dirents[0])) - + grub_strlen (ctx.symlink) + 1); + + VasEBoot_strlen (ctx.symlink) + 1); if (!new_node) { if (ctx.filename_alloc) - grub_free (ctx.filename); - grub_free (node); + VasEBoot_free (ctx.filename); + VasEBoot_free (node); return 0; } node = new_node; } node->have_symlink = 1; - grub_strcpy (node->symlink + VasEBoot_strcpy (node->symlink + node->have_dirents * sizeof (node->dirents[0]) - sizeof (node->dirents), ctx.symlink); - grub_free (ctx.symlink); + VasEBoot_free (ctx.symlink); ctx.symlink = 0; ctx.was_continue = 0; } if (hook (ctx.filename, ctx.type, node, hook_data)) { if (ctx.filename_alloc) - grub_free (ctx.filename); + VasEBoot_free (ctx.filename); return 1; } if (ctx.filename_alloc) - grub_free (ctx.filename); + VasEBoot_free (ctx.filename); } } @@ -838,42 +838,42 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, -/* Context for grub_iso9660_dir. */ -struct grub_iso9660_dir_ctx +/* Context for VasEBoot_iso9660_dir. */ +struct VasEBoot_iso9660_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_iso9660_dir. */ +/* Helper for VasEBoot_iso9660_dir. */ static int -grub_iso9660_dir_iter (const char *filename, - enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_iso9660_dir_iter (const char *filename, + enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_iso9660_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_iso9660_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtimeset = !!iso9660_to_unixtime2 (&node->dirents[0].mtime, &info.mtime); - grub_free (node); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_iso9660_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_iso9660_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_iso9660_dir_ctx ctx = { hook, hook_data }; - struct grub_iso9660_data *data = 0; - struct grub_fshelp_node rootnode; - struct grub_fshelp_node *foundnode; + struct VasEBoot_iso9660_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_iso9660_data *data = 0; + struct VasEBoot_fshelp_node rootnode; + struct VasEBoot_fshelp_node *foundnode; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_iso9660_mount (device->disk); + data = VasEBoot_iso9660_mount (device->disk); if (! data) goto fail; @@ -884,39 +884,39 @@ grub_iso9660_dir (grub_device_t device, const char *path, rootnode.dirents[0] = data->voldesc.rootdir; /* Use the fshelp function to traverse the path. */ - if (grub_fshelp_find_file (path, &rootnode, + if (VasEBoot_fshelp_find_file (path, &rootnode, &foundnode, - grub_iso9660_iterate_dir, - grub_iso9660_read_symlink, - GRUB_FSHELP_DIR)) + VasEBoot_iso9660_iterate_dir, + VasEBoot_iso9660_read_symlink, + VasEBoot_FSHELP_DIR)) goto fail; /* List the files in the directory. */ - grub_iso9660_iterate_dir (foundnode, grub_iso9660_dir_iter, &ctx); + VasEBoot_iso9660_iterate_dir (foundnode, VasEBoot_iso9660_dir_iter, &ctx); if (foundnode != &rootnode) - grub_free (foundnode); + VasEBoot_free (foundnode); fail: - grub_free (data); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_iso9660_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_iso9660_open (struct VasEBoot_file *file, const char *name) { - struct grub_iso9660_data *data; - struct grub_fshelp_node rootnode; - struct grub_fshelp_node *foundnode; + struct VasEBoot_iso9660_data *data; + struct VasEBoot_fshelp_node rootnode; + struct VasEBoot_fshelp_node *foundnode; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_iso9660_mount (file->device->disk); + data = VasEBoot_iso9660_mount (file->device->disk); if (!data) goto fail; @@ -927,11 +927,11 @@ grub_iso9660_open (struct grub_file *file, const char *name) rootnode.dirents[0] = data->voldesc.rootdir; /* Use the fshelp function to traverse the path. */ - if (grub_fshelp_find_file (name, &rootnode, + if (VasEBoot_fshelp_find_file (name, &rootnode, &foundnode, - grub_iso9660_iterate_dir, - grub_iso9660_read_symlink, - GRUB_FSHELP_REG)) + VasEBoot_iso9660_iterate_dir, + VasEBoot_iso9660_read_symlink, + VasEBoot_FSHELP_REG)) goto fail; data->node = foundnode; @@ -942,20 +942,20 @@ grub_iso9660_open (struct grub_file *file, const char *name) return 0; fail: - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_iso9660_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_iso9660_data *data = - (struct grub_iso9660_data *) file->data; - grub_err_t err; + struct VasEBoot_iso9660_data *data = + (struct VasEBoot_iso9660_data *) file->data; + VasEBoot_err_t err; /* XXX: The file is stored in as a single extent. */ data->disk->read_hook = file->read_hook; @@ -963,39 +963,39 @@ grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len) err = read_node (data->node, file->offset, len, buf); data->disk->read_hook = NULL; - if (err || grub_errno) + if (err || VasEBoot_errno) return -1; return len; } -static grub_err_t -grub_iso9660_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_iso9660_close (VasEBoot_file_t file) { - struct grub_iso9660_data *data = - (struct grub_iso9660_data *) file->data; - grub_free (data->node); - grub_free (data); + struct VasEBoot_iso9660_data *data = + (struct VasEBoot_iso9660_data *) file->data; + VasEBoot_free (data->node); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_iso9660_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_iso9660_label (VasEBoot_device_t device, char **label) { - struct grub_iso9660_data *data; - data = grub_iso9660_mount (device->disk); + struct VasEBoot_iso9660_data *data; + data = VasEBoot_iso9660_mount (device->disk); if (data) { if (data->joliet) - *label = grub_iso9660_convert_string (data->voldesc.volname, 16); + *label = VasEBoot_iso9660_convert_string (data->voldesc.volname, 16); else - *label = grub_strndup ((char *) data->voldesc.volname, 32); + *label = VasEBoot_strndup ((char *) data->voldesc.volname, 32); if (*label) { char *ptr; @@ -1005,24 +1005,24 @@ grub_iso9660_label (grub_device_t device, char **label) *ptr-- = 0; } - grub_free (data); + VasEBoot_free (data); } else *label = 0; - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_iso9660_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_iso9660_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_iso9660_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_iso9660_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_iso9660_mount (disk); + data = VasEBoot_iso9660_mount (disk); if (data) { if (! data->voldesc.modified.year[0] && ! data->voldesc.modified.year[1] @@ -1034,12 +1034,12 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) && ! data->voldesc.modified.second[0] && ! data->voldesc.modified.second[1] && ! data->voldesc.modified.hundredth[0] && ! data->voldesc.modified.hundredth[1]) { - grub_error (GRUB_ERR_BAD_NUMBER, "no creation date in filesystem to generate UUID"); + VasEBoot_error (VasEBoot_ERR_BAD_NUMBER, "no creation date in filesystem to generate UUID"); *uuid = NULL; } else { - *uuid = grub_xasprintf ("%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c", + *uuid = VasEBoot_xasprintf ("%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c", data->voldesc.modified.year[0], data->voldesc.modified.year[1], data->voldesc.modified.year[2], @@ -1061,34 +1061,34 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } /* Get writing time of filesystem. */ -static grub_err_t -grub_iso9660_mtime (grub_device_t device, grub_int32_t *timebuf) +static VasEBoot_err_t +VasEBoot_iso9660_mtime (VasEBoot_device_t device, VasEBoot_int32_t *timebuf) { - struct grub_iso9660_data *data; - grub_disk_t disk = device->disk; - grub_err_t err; + struct VasEBoot_iso9660_data *data; + VasEBoot_disk_t disk = device->disk; + VasEBoot_err_t err; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_iso9660_mount (disk); + data = VasEBoot_iso9660_mount (disk); if (!data) { - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } err = iso9660_to_unixtime (&data->voldesc.modified, timebuf); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); return err; } @@ -1096,30 +1096,30 @@ grub_iso9660_mtime (grub_device_t device, grub_int32_t *timebuf) -static struct grub_fs grub_iso9660_fs = +static struct VasEBoot_fs VasEBoot_iso9660_fs = { .name = "iso9660", - .dir = grub_iso9660_dir, - .open = grub_iso9660_open, - .read = grub_iso9660_read, - .close = grub_iso9660_close, - .label = grub_iso9660_label, - .uuid = grub_iso9660_uuid, - .mtime = grub_iso9660_mtime, -#ifdef GRUB_UTIL + .dir = VasEBoot_iso9660_dir, + .open = VasEBoot_iso9660_open, + .read = VasEBoot_iso9660_read, + .close = VasEBoot_iso9660_close, + .label = VasEBoot_iso9660_label, + .uuid = VasEBoot_iso9660_uuid, + .mtime = VasEBoot_iso9660_mtime, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(iso9660) +VasEBoot_MOD_INIT(iso9660) { - grub_fs_register (&grub_iso9660_fs); + VasEBoot_fs_register (&VasEBoot_iso9660_fs); my_mod = mod; } -GRUB_MOD_FINI(iso9660) +VasEBoot_MOD_FINI(iso9660) { - grub_fs_unregister (&grub_iso9660_fs); + VasEBoot_fs_unregister (&VasEBoot_iso9660_fs); } diff --git a/VasEBoot-core/fs/jfs.c b/VasEBoot-core/fs/jfs.c index aab3e8c7b..0fdf7a3f9 100644 --- a/VasEBoot-core/fs/jfs.c +++ b/VasEBoot-core/fs/jfs.c @@ -1,309 +1,309 @@ /* jfs.c - JFS. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_JFS_MAX_SYMLNK_CNT 8 -#define GRUB_JFS_FILETYPE_MASK 0170000 -#define GRUB_JFS_FILETYPE_REG 0100000 -#define GRUB_JFS_FILETYPE_LNK 0120000 -#define GRUB_JFS_FILETYPE_DIR 0040000 +#define VasEBoot_JFS_MAX_SYMLNK_CNT 8 +#define VasEBoot_JFS_FILETYPE_MASK 0170000 +#define VasEBoot_JFS_FILETYPE_REG 0100000 +#define VasEBoot_JFS_FILETYPE_LNK 0120000 +#define VasEBoot_JFS_FILETYPE_DIR 0040000 -#define GRUB_JFS_SBLOCK 64 -#define GRUB_JFS_AGGR_INODE 2 -#define GRUB_JFS_FS1_INODE_BLK 104 +#define VasEBoot_JFS_SBLOCK 64 +#define VasEBoot_JFS_AGGR_INODE 2 +#define VasEBoot_JFS_FS1_INODE_BLK 104 -#define GRUB_JFS_TREE_LEAF 2 +#define VasEBoot_JFS_TREE_LEAF 2 -struct grub_jfs_sblock +struct VasEBoot_jfs_sblock { /* The magic for JFS. It should contain the string "JFS1". */ - grub_uint8_t magic[4]; - grub_uint32_t version; - grub_uint64_t ag_size; + VasEBoot_uint8_t magic[4]; + VasEBoot_uint32_t version; + VasEBoot_uint64_t ag_size; /* The size of a filesystem block in bytes. XXX: currently only 4096 was tested. */ - grub_uint32_t blksz; - grub_uint16_t log2_blksz; - grub_uint8_t unused[14]; - grub_uint32_t flags; - grub_uint8_t unused3[61]; + VasEBoot_uint32_t blksz; + VasEBoot_uint16_t log2_blksz; + VasEBoot_uint8_t unused[14]; + VasEBoot_uint32_t flags; + VasEBoot_uint8_t unused3[61]; char volname[11]; - grub_uint8_t unused2[24]; - grub_uint8_t uuid[16]; + VasEBoot_uint8_t unused2[24]; + VasEBoot_uint8_t uuid[16]; char volname2[16]; }; -struct grub_jfs_extent +struct VasEBoot_jfs_extent { /* The length of the extent in filesystem blocks. */ - grub_uint16_t length; - grub_uint8_t length2; + VasEBoot_uint16_t length; + VasEBoot_uint8_t length2; /* The physical offset of the first block on the disk. */ - grub_uint8_t blk1; - grub_uint32_t blk2; -} GRUB_PACKED; + VasEBoot_uint8_t blk1; + VasEBoot_uint32_t blk2; +} VasEBoot_PACKED; -#define GRUB_JFS_IAG_INODES_OFFSET 3072 -#define GRUB_JFS_IAG_INODES_COUNT 128 +#define VasEBoot_JFS_IAG_INODES_OFFSET 3072 +#define VasEBoot_JFS_IAG_INODES_COUNT 128 -struct grub_jfs_iag +struct VasEBoot_jfs_iag { - grub_uint8_t unused[GRUB_JFS_IAG_INODES_OFFSET]; - struct grub_jfs_extent inodes[GRUB_JFS_IAG_INODES_COUNT]; -} GRUB_PACKED; + VasEBoot_uint8_t unused[VasEBoot_JFS_IAG_INODES_OFFSET]; + struct VasEBoot_jfs_extent inodes[VasEBoot_JFS_IAG_INODES_COUNT]; +} VasEBoot_PACKED; /* The head of the tree used to find extents. */ -struct grub_jfs_treehead +struct VasEBoot_jfs_treehead { - grub_uint64_t next; - grub_uint64_t prev; + VasEBoot_uint64_t next; + VasEBoot_uint64_t prev; - grub_uint8_t flags; - grub_uint8_t unused; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t unused; - grub_uint16_t count; - grub_uint16_t max; - grub_uint8_t unused2[10]; -} GRUB_PACKED; + VasEBoot_uint16_t count; + VasEBoot_uint16_t max; + VasEBoot_uint8_t unused2[10]; +} VasEBoot_PACKED; /* A node in the extent tree. */ -struct grub_jfs_tree_extent +struct VasEBoot_jfs_tree_extent { - grub_uint8_t flags; - grub_uint16_t unused; + VasEBoot_uint8_t flags; + VasEBoot_uint16_t unused; /* The offset is the key used to lookup an extent. */ - grub_uint8_t offset1; - grub_uint32_t offset2; + VasEBoot_uint8_t offset1; + VasEBoot_uint32_t offset2; - struct grub_jfs_extent extent; -} GRUB_PACKED; + struct VasEBoot_jfs_extent extent; +} VasEBoot_PACKED; /* The tree of directory entries. */ -struct grub_jfs_tree_dir +struct VasEBoot_jfs_tree_dir { /* Pointers to the previous and next tree headers of other nodes on this level. */ - grub_uint64_t nextb; - grub_uint64_t prevb; + VasEBoot_uint64_t nextb; + VasEBoot_uint64_t prevb; - grub_uint8_t flags; + VasEBoot_uint8_t flags; /* The amount of dirents in this node. */ - grub_uint8_t count; - grub_uint8_t freecnt; - grub_uint8_t freelist; - grub_uint8_t maxslot; + VasEBoot_uint8_t count; + VasEBoot_uint8_t freecnt; + VasEBoot_uint8_t freelist; + VasEBoot_uint8_t maxslot; /* The location of the sorted array of pointers to dirents. */ - grub_uint8_t sindex; - grub_uint8_t unused[10]; -} GRUB_PACKED; + VasEBoot_uint8_t sindex; + VasEBoot_uint8_t unused[10]; +} VasEBoot_PACKED; /* An internal node in the dirents tree. */ -struct grub_jfs_internal_dirent +struct VasEBoot_jfs_internal_dirent { - struct grub_jfs_extent ex; - grub_uint8_t next; - grub_uint8_t len; - grub_uint16_t namepart[11]; -} GRUB_PACKED; + struct VasEBoot_jfs_extent ex; + VasEBoot_uint8_t next; + VasEBoot_uint8_t len; + VasEBoot_uint16_t namepart[11]; +} VasEBoot_PACKED; /* A leaf node in the dirents tree. */ -struct grub_jfs_leaf_dirent +struct VasEBoot_jfs_leaf_dirent { /* The inode for this dirent. */ - grub_uint32_t inode; - grub_uint8_t next; + VasEBoot_uint32_t inode; + VasEBoot_uint8_t next; /* The size of the name. */ - grub_uint8_t len; - grub_uint16_t namepart[11]; - grub_uint32_t index; -} GRUB_PACKED; + VasEBoot_uint8_t len; + VasEBoot_uint16_t namepart[11]; + VasEBoot_uint32_t index; +} VasEBoot_PACKED; /* A leaf in the dirents tree. This one is used if the previously dirent was not big enough to store the name. */ -struct grub_jfs_leaf_next_dirent +struct VasEBoot_jfs_leaf_next_dirent { - grub_uint8_t next; - grub_uint8_t len; - grub_uint16_t namepart[15]; -} GRUB_PACKED; + VasEBoot_uint8_t next; + VasEBoot_uint8_t len; + VasEBoot_uint16_t namepart[15]; +} VasEBoot_PACKED; -struct grub_jfs_time +struct VasEBoot_jfs_time { - grub_int32_t sec; - grub_int32_t nanosec; -} GRUB_PACKED; + VasEBoot_int32_t sec; + VasEBoot_int32_t nanosec; +} VasEBoot_PACKED; -struct grub_jfs_inode +struct VasEBoot_jfs_inode { - grub_uint32_t stamp; - grub_uint32_t fileset; - grub_uint32_t inode; - grub_uint8_t unused[12]; - grub_uint64_t size; - grub_uint8_t unused2[20]; - grub_uint32_t mode; - struct grub_jfs_time atime; - struct grub_jfs_time ctime; - struct grub_jfs_time mtime; - grub_uint8_t unused3[48]; - grub_uint8_t unused4[96]; + VasEBoot_uint32_t stamp; + VasEBoot_uint32_t fileset; + VasEBoot_uint32_t inode; + VasEBoot_uint8_t unused[12]; + VasEBoot_uint64_t size; + VasEBoot_uint8_t unused2[20]; + VasEBoot_uint32_t mode; + struct VasEBoot_jfs_time atime; + struct VasEBoot_jfs_time ctime; + struct VasEBoot_jfs_time mtime; + VasEBoot_uint8_t unused3[48]; + VasEBoot_uint8_t unused4[96]; union { /* The tree describing the extents of the file. */ - struct GRUB_PACKED + struct VasEBoot_PACKED { - struct grub_jfs_treehead tree; - struct grub_jfs_tree_extent extents[16]; + struct VasEBoot_jfs_treehead tree; + struct VasEBoot_jfs_tree_extent extents[16]; } file; union { /* The tree describing the dirents. */ struct { - grub_uint8_t unused[16]; - grub_uint8_t flags; + VasEBoot_uint8_t unused[16]; + VasEBoot_uint8_t flags; /* Amount of dirents in this node. */ - grub_uint8_t count; - grub_uint8_t freecnt; - grub_uint8_t freelist; - grub_uint32_t idotdot; - grub_uint8_t sorted[8]; + VasEBoot_uint8_t count; + VasEBoot_uint8_t freecnt; + VasEBoot_uint8_t freelist; + VasEBoot_uint32_t idotdot; + VasEBoot_uint8_t sorted[8]; } header; - struct grub_jfs_leaf_dirent dirents[8]; - } GRUB_PACKED dir; + struct VasEBoot_jfs_leaf_dirent dirents[8]; + } VasEBoot_PACKED dir; /* Fast symlink. */ struct { - grub_uint8_t unused[32]; - grub_uint8_t path[256]; + VasEBoot_uint8_t unused[32]; + VasEBoot_uint8_t path[256]; } symlink; - } GRUB_PACKED; -} GRUB_PACKED; + } VasEBoot_PACKED; +} VasEBoot_PACKED; -struct grub_jfs_data +struct VasEBoot_jfs_data { - struct grub_jfs_sblock sblock; - grub_disk_t disk; - struct grub_jfs_inode fileset; - struct grub_jfs_inode currinode; + struct VasEBoot_jfs_sblock sblock; + VasEBoot_disk_t disk; + struct VasEBoot_jfs_inode fileset; + struct VasEBoot_jfs_inode currinode; int caseins; int pos; int linknest; int namecomponentlen; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_jfs_diropen +struct VasEBoot_jfs_diropen { int index; union { - struct grub_jfs_tree_dir header; - struct grub_jfs_leaf_dirent dirent[0]; - struct grub_jfs_leaf_next_dirent next_dirent[0]; - grub_uint8_t sorted[0]; - } GRUB_PACKED *dirpage; - struct grub_jfs_data *data; - struct grub_jfs_inode *inode; + struct VasEBoot_jfs_tree_dir header; + struct VasEBoot_jfs_leaf_dirent dirent[0]; + struct VasEBoot_jfs_leaf_next_dirent next_dirent[0]; + VasEBoot_uint8_t sorted[0]; + } VasEBoot_PACKED *dirpage; + struct VasEBoot_jfs_data *data; + struct VasEBoot_jfs_inode *inode; int count; - grub_uint8_t *sorted; - struct grub_jfs_leaf_dirent *leaf; - struct grub_jfs_leaf_next_dirent *next_leaf; + VasEBoot_uint8_t *sorted; + struct VasEBoot_jfs_leaf_dirent *leaf; + struct VasEBoot_jfs_leaf_next_dirent *next_leaf; /* The filename and inode of the last read dirent. */ /* On-disk name is at most 255 UTF-16 codepoints. Every UTF-16 codepoint is at most 4 UTF-8 bytes. */ - char name[256 * GRUB_MAX_UTF8_PER_UTF16 + 1]; - grub_uint32_t ino; -} GRUB_PACKED; + char name[256 * VasEBoot_MAX_UTF8_PER_UTF16 + 1]; + VasEBoot_uint32_t ino; +} VasEBoot_PACKED; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_err_t grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino); +static VasEBoot_err_t VasEBoot_jfs_lookup_symlink (struct VasEBoot_jfs_data *data, VasEBoot_uint32_t ino); -static grub_int64_t -getblk (struct grub_jfs_treehead *treehead, - struct grub_jfs_tree_extent *extents, - struct grub_jfs_data *data, - grub_uint64_t blk) +static VasEBoot_int64_t +getblk (struct VasEBoot_jfs_treehead *treehead, + struct VasEBoot_jfs_tree_extent *extents, + struct VasEBoot_jfs_data *data, + VasEBoot_uint64_t blk) { int found = -1; int i; - for (i = 0; i < grub_le_to_cpu16 (treehead->count) - 2; i++) + for (i = 0; i < VasEBoot_le_to_cpu16 (treehead->count) - 2; i++) { - if (treehead->flags & GRUB_JFS_TREE_LEAF) + if (treehead->flags & VasEBoot_JFS_TREE_LEAF) { /* Read the leafnode. */ - if (grub_le_to_cpu32 (extents[i].offset2) <= blk - && ((grub_le_to_cpu16 (extents[i].extent.length)) + if (VasEBoot_le_to_cpu32 (extents[i].offset2) <= blk + && ((VasEBoot_le_to_cpu16 (extents[i].extent.length)) + (extents[i].extent.length2 << 16) - + grub_le_to_cpu32 (extents[i].offset2)) > blk) - return (blk - grub_le_to_cpu32 (extents[i].offset2) - + grub_le_to_cpu32 (extents[i].extent.blk2)); + + VasEBoot_le_to_cpu32 (extents[i].offset2)) > blk) + return (blk - VasEBoot_le_to_cpu32 (extents[i].offset2) + + VasEBoot_le_to_cpu32 (extents[i].extent.blk2)); } else - if (blk >= grub_le_to_cpu32 (extents[i].offset2)) + if (blk >= VasEBoot_le_to_cpu32 (extents[i].offset2)) found = i; } if (found != -1) { - grub_int64_t ret = -1; + VasEBoot_int64_t ret = -1; struct { - struct grub_jfs_treehead treehead; - struct grub_jfs_tree_extent extents[254]; + struct VasEBoot_jfs_treehead treehead; + struct VasEBoot_jfs_tree_extent extents[254]; } *tree; - tree = grub_zalloc (sizeof (*tree)); + tree = VasEBoot_zalloc (sizeof (*tree)); if (!tree) return -1; - if (!grub_disk_read (data->disk, - ((grub_disk_addr_t) grub_le_to_cpu32 (extents[found].extent.blk2)) - << (grub_le_to_cpu16 (data->sblock.log2_blksz) - - GRUB_DISK_SECTOR_BITS), 0, + if (!VasEBoot_disk_read (data->disk, + ((VasEBoot_disk_addr_t) VasEBoot_le_to_cpu32 (extents[found].extent.blk2)) + << (VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) + - VasEBoot_DISK_SECTOR_BITS), 0, sizeof (*tree), (char *) tree)) ret = getblk (&tree->treehead, &tree->extents[0], data, blk); - grub_free (tree); + VasEBoot_free (tree); return ret; } @@ -312,76 +312,76 @@ getblk (struct grub_jfs_treehead *treehead, /* Get the block number for the block BLK in the node INODE in the mounted filesystem DATA. */ -static grub_int64_t -grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode, - grub_uint64_t blk) +static VasEBoot_int64_t +VasEBoot_jfs_blkno (struct VasEBoot_jfs_data *data, struct VasEBoot_jfs_inode *inode, + VasEBoot_uint64_t blk) { return getblk (&inode->file.tree, &inode->file.extents[0], data, blk); } -static grub_err_t -grub_jfs_read_inode (struct grub_jfs_data *data, grub_uint32_t ino, - struct grub_jfs_inode *inode) +static VasEBoot_err_t +VasEBoot_jfs_read_inode (struct VasEBoot_jfs_data *data, VasEBoot_uint32_t ino, + struct VasEBoot_jfs_inode *inode) { - struct grub_jfs_extent iag_inodes[GRUB_JFS_IAG_INODES_COUNT]; - grub_uint32_t iagnum = ino / 4096; + struct VasEBoot_jfs_extent iag_inodes[VasEBoot_JFS_IAG_INODES_COUNT]; + VasEBoot_uint32_t iagnum = ino / 4096; unsigned inoext = (ino % 4096) / 32; unsigned inonum = (ino % 4096) % 32; - grub_uint64_t iagblk; - grub_uint64_t inoblk; + VasEBoot_uint64_t iagblk; + VasEBoot_uint64_t inoblk; - iagblk = grub_jfs_blkno (data, &data->fileset, iagnum + 1); - if (grub_errno) - return grub_errno; + iagblk = VasEBoot_jfs_blkno (data, &data->fileset, iagnum + 1); + if (VasEBoot_errno) + return VasEBoot_errno; /* Read in the IAG. */ - if (grub_disk_read (data->disk, - iagblk << (grub_le_to_cpu16 (data->sblock.log2_blksz) - - GRUB_DISK_SECTOR_BITS), - GRUB_JFS_IAG_INODES_OFFSET, + if (VasEBoot_disk_read (data->disk, + iagblk << (VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) + - VasEBoot_DISK_SECTOR_BITS), + VasEBoot_JFS_IAG_INODES_OFFSET, sizeof (iag_inodes), &iag_inodes)) - return grub_errno; + return VasEBoot_errno; - inoblk = grub_le_to_cpu32 (iag_inodes[inoext].blk2); - inoblk <<= (grub_le_to_cpu16 (data->sblock.log2_blksz) - - GRUB_DISK_SECTOR_BITS); + inoblk = VasEBoot_le_to_cpu32 (iag_inodes[inoext].blk2); + inoblk <<= (VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) + - VasEBoot_DISK_SECTOR_BITS); inoblk += inonum; - if (grub_disk_read (data->disk, inoblk, 0, - sizeof (struct grub_jfs_inode), inode)) - return grub_errno; + if (VasEBoot_disk_read (data->disk, inoblk, 0, + sizeof (struct VasEBoot_jfs_inode), inode)) + return VasEBoot_errno; return 0; } -static struct grub_jfs_data * -grub_jfs_mount (grub_disk_t disk) +static struct VasEBoot_jfs_data * +VasEBoot_jfs_mount (VasEBoot_disk_t disk) { - struct grub_jfs_data *data = 0; + struct VasEBoot_jfs_data *data = 0; - data = grub_malloc (sizeof (struct grub_jfs_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_jfs_data)); if (!data) return 0; /* Read the superblock. */ - if (grub_disk_read (disk, GRUB_JFS_SBLOCK, 0, - sizeof (struct grub_jfs_sblock), &data->sblock)) + if (VasEBoot_disk_read (disk, VasEBoot_JFS_SBLOCK, 0, + sizeof (struct VasEBoot_jfs_sblock), &data->sblock)) goto fail; - if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4)) + if (VasEBoot_strncmp ((char *) (data->sblock.magic), "JFS1", 4)) { - grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a JFS filesystem"); goto fail; } if (data->sblock.blksz == 0 - || grub_le_to_cpu32 (data->sblock.blksz) - != (1U << grub_le_to_cpu16 (data->sblock.log2_blksz)) - || grub_le_to_cpu16 (data->sblock.log2_blksz) < GRUB_DISK_SECTOR_BITS) + || VasEBoot_le_to_cpu32 (data->sblock.blksz) + != (1U << VasEBoot_le_to_cpu16 (data->sblock.log2_blksz)) + || VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) < VasEBoot_DISK_SECTOR_BITS) { - grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a JFS filesystem"); goto fail; } @@ -390,16 +390,16 @@ grub_jfs_mount (grub_disk_t disk) data->linknest = 0; /* Read the inode of the first fileset. */ - if (grub_disk_read (data->disk, GRUB_JFS_FS1_INODE_BLK, 0, - sizeof (struct grub_jfs_inode), &data->fileset)) + if (VasEBoot_disk_read (data->disk, VasEBoot_JFS_FS1_INODE_BLK, 0, + sizeof (struct VasEBoot_jfs_inode), &data->fileset)) goto fail; - if (data->sblock.flags & grub_cpu_to_le32_compile_time (0x00200000)) + if (data->sblock.flags & VasEBoot_cpu_to_le32_compile_time (0x00200000)) data->namecomponentlen = 11; else data->namecomponentlen = 13; - if (data->sblock.flags & grub_cpu_to_le32_compile_time (0x40000000)) + if (data->sblock.flags & VasEBoot_cpu_to_le32_compile_time (0x40000000)) data->caseins = 1; else data->caseins = 0; @@ -407,32 +407,32 @@ grub_jfs_mount (grub_disk_t disk) return data; fail: - grub_free (data); + VasEBoot_free (data); - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a JFS filesystem"); return 0; } -static struct grub_jfs_diropen * -grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) +static struct VasEBoot_jfs_diropen * +VasEBoot_jfs_opendir (struct VasEBoot_jfs_data *data, struct VasEBoot_jfs_inode *inode) { - struct grub_jfs_internal_dirent *de; - struct grub_jfs_diropen *diro; - grub_disk_addr_t blk; + struct VasEBoot_jfs_internal_dirent *de; + struct VasEBoot_jfs_diropen *diro; + VasEBoot_disk_addr_t blk; - de = (struct grub_jfs_internal_dirent *) inode->dir.dirents; + de = (struct VasEBoot_jfs_internal_dirent *) inode->dir.dirents; - if (!((grub_le_to_cpu32 (inode->mode) - & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR)) + if (!((VasEBoot_le_to_cpu32 (inode->mode) + & VasEBoot_JFS_FILETYPE_MASK) == VasEBoot_JFS_FILETYPE_DIR)) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); return 0; } - diro = grub_zalloc (sizeof (struct grub_jfs_diropen)); + diro = VasEBoot_zalloc (sizeof (struct VasEBoot_jfs_diropen)); if (!diro) return 0; @@ -440,45 +440,45 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) diro->inode = inode; /* Check if the entire tree is contained within the inode. */ - if (inode->file.tree.flags & GRUB_JFS_TREE_LEAF) + if (inode->file.tree.flags & VasEBoot_JFS_TREE_LEAF) { diro->leaf = inode->dir.dirents; - diro->next_leaf = (struct grub_jfs_leaf_next_dirent *) de; + diro->next_leaf = (struct VasEBoot_jfs_leaf_next_dirent *) de; diro->sorted = inode->dir.header.sorted; diro->count = inode->dir.header.count; return diro; } - diro->dirpage = grub_malloc (grub_le_to_cpu32 (data->sblock.blksz)); + diro->dirpage = VasEBoot_malloc (VasEBoot_le_to_cpu32 (data->sblock.blksz)); if (!diro->dirpage) { - grub_free (diro); + VasEBoot_free (diro); return 0; } - blk = grub_le_to_cpu32 (de[inode->dir.header.sorted[0]].ex.blk2); - blk <<= (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS); + blk = VasEBoot_le_to_cpu32 (de[inode->dir.header.sorted[0]].ex.blk2); + blk <<= (VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) - VasEBoot_DISK_SECTOR_BITS); /* Read in the nodes until we are on the leaf node level. */ do { int index; - if (grub_disk_read (data->disk, blk, 0, - grub_le_to_cpu32 (data->sblock.blksz), + if (VasEBoot_disk_read (data->disk, blk, 0, + VasEBoot_le_to_cpu32 (data->sblock.blksz), diro->dirpage->sorted)) { - grub_free (diro->dirpage); - grub_free (diro); + VasEBoot_free (diro->dirpage); + VasEBoot_free (diro); return 0; } - de = (struct grub_jfs_internal_dirent *) diro->dirpage->dirent; + de = (struct VasEBoot_jfs_internal_dirent *) diro->dirpage->dirent; index = diro->dirpage->sorted[diro->dirpage->header.sindex * 32]; - blk = (grub_le_to_cpu32 (de[index].ex.blk2) - << (grub_le_to_cpu16 (data->sblock.log2_blksz) - - GRUB_DISK_SECTOR_BITS)); - } while (!(diro->dirpage->header.flags & GRUB_JFS_TREE_LEAF)); + blk = (VasEBoot_le_to_cpu32 (de[index].ex.blk2) + << (VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) + - VasEBoot_DISK_SECTOR_BITS)); + } while (!(diro->dirpage->header.flags & VasEBoot_JFS_TREE_LEAF)); diro->leaf = diro->dirpage->dirent; diro->next_leaf = diro->dirpage->next_dirent; @@ -490,52 +490,52 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) static void -grub_jfs_closedir (struct grub_jfs_diropen *diro) +VasEBoot_jfs_closedir (struct VasEBoot_jfs_diropen *diro) { if (!diro) return; - grub_free (diro->dirpage); - grub_free (diro); + VasEBoot_free (diro->dirpage); + VasEBoot_free (diro); } static void -le_to_cpu16_copy (grub_uint16_t *out, grub_uint16_t *in, grub_size_t len) +le_to_cpu16_copy (VasEBoot_uint16_t *out, VasEBoot_uint16_t *in, VasEBoot_size_t len) { while (len--) - *out++ = grub_le_to_cpu16 (*in++); + *out++ = VasEBoot_le_to_cpu16 (*in++); } /* Read in the next dirent from the directory described by DIRO. */ -static grub_err_t -grub_jfs_getent (struct grub_jfs_diropen *diro) +static VasEBoot_err_t +VasEBoot_jfs_getent (struct VasEBoot_jfs_diropen *diro) { int strpos = 0; - struct grub_jfs_leaf_dirent *leaf; - struct grub_jfs_leaf_next_dirent *next_leaf; + struct VasEBoot_jfs_leaf_dirent *leaf; + struct VasEBoot_jfs_leaf_next_dirent *next_leaf; int len; int nextent; - grub_uint16_t filename[256]; + VasEBoot_uint16_t filename[256]; /* The last node, read in more. */ if (diro->index == diro->count) { - grub_disk_addr_t next; + VasEBoot_disk_addr_t next; /* If the inode contains the entry tree or if this was the last node, there is nothing to read. */ - if ((diro->inode->file.tree.flags & GRUB_JFS_TREE_LEAF) - || !grub_le_to_cpu64 (diro->dirpage->header.nextb)) - return GRUB_ERR_OUT_OF_RANGE; + if ((diro->inode->file.tree.flags & VasEBoot_JFS_TREE_LEAF) + || !VasEBoot_le_to_cpu64 (diro->dirpage->header.nextb)) + return VasEBoot_ERR_OUT_OF_RANGE; - next = grub_le_to_cpu64 (diro->dirpage->header.nextb); - next <<= (grub_le_to_cpu16 (diro->data->sblock.log2_blksz) - - GRUB_DISK_SECTOR_BITS); + next = VasEBoot_le_to_cpu64 (diro->dirpage->header.nextb); + next <<= (VasEBoot_le_to_cpu16 (diro->data->sblock.log2_blksz) + - VasEBoot_DISK_SECTOR_BITS); - if (grub_disk_read (diro->data->disk, next, 0, - grub_le_to_cpu32 (diro->data->sblock.blksz), + if (VasEBoot_disk_read (diro->data->disk, next, 0, + VasEBoot_le_to_cpu32 (diro->data->sblock.blksz), diro->dirpage->sorted)) - return grub_errno; + return VasEBoot_errno; diro->leaf = diro->dirpage->dirent; diro->next_leaf = diro->dirpage->next_dirent; @@ -551,14 +551,14 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) if (!len) { diro->index++; - return grub_jfs_getent (diro); + return VasEBoot_jfs_getent (diro); } le_to_cpu16_copy (filename + strpos, leaf->namepart, len < diro->data->namecomponentlen ? len : diro->data->namecomponentlen); strpos += len < diro->data->namecomponentlen ? len : diro->data->namecomponentlen; - diro->ino = grub_le_to_cpu32 (leaf->inode); + diro->ino = VasEBoot_le_to_cpu32 (leaf->inode); len -= diro->data->namecomponentlen; /* Move down to the leaf level. */ @@ -577,7 +577,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) diro->index++; /* Convert the temporary UTF16 filename to UTF8. */ - *grub_utf16_to_utf8 ((grub_uint8_t *) (diro->name), filename, strpos) = '\0'; + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) (diro->name), filename, strpos) = '\0'; return 0; } @@ -585,40 +585,40 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_jfs_read_file (struct grub_jfs_data *data, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_jfs_read_file (struct VasEBoot_jfs_data *data, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - grub_off_t i; - grub_off_t blockcnt; + VasEBoot_off_t i; + VasEBoot_off_t blockcnt; - blockcnt = (len + pos + grub_le_to_cpu32 (data->sblock.blksz) - 1) - >> grub_le_to_cpu16 (data->sblock.log2_blksz); + blockcnt = (len + pos + VasEBoot_le_to_cpu32 (data->sblock.blksz) - 1) + >> VasEBoot_le_to_cpu16 (data->sblock.log2_blksz); - for (i = pos >> grub_le_to_cpu16 (data->sblock.log2_blksz); i < blockcnt; i++) + for (i = pos >> VasEBoot_le_to_cpu16 (data->sblock.log2_blksz); i < blockcnt; i++) { - grub_disk_addr_t blknr; - grub_uint32_t blockoff = pos & (grub_le_to_cpu32 (data->sblock.blksz) - 1); - grub_uint32_t blockend = grub_le_to_cpu32 (data->sblock.blksz); + VasEBoot_disk_addr_t blknr; + VasEBoot_uint32_t blockoff = pos & (VasEBoot_le_to_cpu32 (data->sblock.blksz) - 1); + VasEBoot_uint32_t blockend = VasEBoot_le_to_cpu32 (data->sblock.blksz); - grub_uint64_t skipfirst = 0; + VasEBoot_uint64_t skipfirst = 0; - blknr = grub_jfs_blkno (data, &data->currinode, i); - if (grub_errno) + blknr = VasEBoot_jfs_blkno (data, &data->currinode, i); + if (VasEBoot_errno) return -1; /* Last block. */ if (i == blockcnt - 1) { - blockend = (len + pos) & (grub_le_to_cpu32 (data->sblock.blksz) - 1); + blockend = (len + pos) & (VasEBoot_le_to_cpu32 (data->sblock.blksz) - 1); if (!blockend) - blockend = grub_le_to_cpu32 (data->sblock.blksz); + blockend = VasEBoot_le_to_cpu32 (data->sblock.blksz); } /* First block. */ - if (i == (pos >> grub_le_to_cpu16 (data->sblock.log2_blksz))) + if (i == (pos >> VasEBoot_le_to_cpu16 (data->sblock.log2_blksz))) { skipfirst = blockoff; blockend -= skipfirst; @@ -626,16 +626,16 @@ grub_jfs_read_file (struct grub_jfs_data *data, data->disk->read_hook = read_hook; data->disk->read_hook_data = read_hook_data; - grub_disk_read (data->disk, - blknr << (grub_le_to_cpu16 (data->sblock.log2_blksz) - - GRUB_DISK_SECTOR_BITS), + VasEBoot_disk_read (data->disk, + blknr << (VasEBoot_le_to_cpu16 (data->sblock.log2_blksz) + - VasEBoot_DISK_SECTOR_BITS), skipfirst, blockend, buf); data->disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; - buf += grub_le_to_cpu32 (data->sblock.blksz) - skipfirst; + buf += VasEBoot_le_to_cpu32 (data->sblock.blksz) - skipfirst; } return len; @@ -644,16 +644,16 @@ grub_jfs_read_file (struct grub_jfs_data *data, /* Find the file with the pathname PATH on the filesystem described by DATA. */ -static grub_err_t -grub_jfs_find_file (struct grub_jfs_data *data, const char *path, - grub_uint32_t start_ino) +static VasEBoot_err_t +VasEBoot_jfs_find_file (struct VasEBoot_jfs_data *data, const char *path, + VasEBoot_uint32_t start_ino) { const char *name; const char *next = path; - struct grub_jfs_diropen *diro = NULL; + struct VasEBoot_jfs_diropen *diro = NULL; - if (grub_jfs_read_inode (data, start_ino, &data->currinode)) - return grub_errno; + if (VasEBoot_jfs_read_inode (data, start_ino, &data->currinode)) + return VasEBoot_errno; while (1) { @@ -661,7 +661,7 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path, while (*name == '/') name++; if (name[0] == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; for (next = name; *next && *next != '/'; next++); if (name[0] == '.' && name + 1 == next) @@ -669,47 +669,47 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path, if (name[0] == '.' && name[1] == '.' && name + 2 == next) { - grub_uint32_t ino = grub_le_to_cpu32 (data->currinode.dir.header.idotdot); + VasEBoot_uint32_t ino = VasEBoot_le_to_cpu32 (data->currinode.dir.header.idotdot); - if (grub_jfs_read_inode (data, ino, &data->currinode)) - return grub_errno; + if (VasEBoot_jfs_read_inode (data, ino, &data->currinode)) + return VasEBoot_errno; continue; } - diro = grub_jfs_opendir (data, &data->currinode); + diro = VasEBoot_jfs_opendir (data, &data->currinode); if (!diro) - return grub_errno; + return VasEBoot_errno; for (;;) { - if (grub_jfs_getent (diro) == GRUB_ERR_OUT_OF_RANGE) + if (VasEBoot_jfs_getent (diro) == VasEBoot_ERR_OUT_OF_RANGE) { - grub_jfs_closedir (diro); - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path); + VasEBoot_jfs_closedir (diro); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path); } /* Check if the current direntry matches the current part of the pathname. */ - if ((data->caseins ? grub_strncasecmp (name, diro->name, next - name) == 0 - : grub_strncmp (name, diro->name, next - name) == 0) && !diro->name[next - name]) + if ((data->caseins ? VasEBoot_strncasecmp (name, diro->name, next - name) == 0 + : VasEBoot_strncmp (name, diro->name, next - name) == 0) && !diro->name[next - name]) { - grub_uint32_t ino = diro->ino; - grub_uint32_t dirino = grub_le_to_cpu32 (data->currinode.inode); + VasEBoot_uint32_t ino = diro->ino; + VasEBoot_uint32_t dirino = VasEBoot_le_to_cpu32 (data->currinode.inode); - grub_jfs_closedir (diro); + VasEBoot_jfs_closedir (diro); diro = 0; - if (grub_jfs_read_inode (data, ino, &data->currinode)) + if (VasEBoot_jfs_read_inode (data, ino, &data->currinode)) break; /* Check if this is a symlink. */ - if ((grub_le_to_cpu32 (data->currinode.mode) - & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_LNK) + if ((VasEBoot_le_to_cpu32 (data->currinode.mode) + & VasEBoot_JFS_FILETYPE_MASK) == VasEBoot_JFS_FILETYPE_LNK) { - grub_jfs_lookup_symlink (data, dirino); - if (grub_errno) - return grub_errno; + VasEBoot_jfs_lookup_symlink (data, dirino); + if (VasEBoot_errno) + return VasEBoot_errno; } break; @@ -719,24 +719,24 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path, } -static grub_err_t -grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino) +static VasEBoot_err_t +VasEBoot_jfs_lookup_symlink (struct VasEBoot_jfs_data *data, VasEBoot_uint32_t ino) { - grub_size_t size = grub_le_to_cpu64 (data->currinode.size); + VasEBoot_size_t size = VasEBoot_le_to_cpu64 (data->currinode.size); char *symlink; - if (++data->linknest > GRUB_JFS_MAX_SYMLNK_CNT) - return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); + if (++data->linknest > VasEBoot_JFS_MAX_SYMLNK_CNT) + return VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); - symlink = grub_malloc (size + 1); + symlink = VasEBoot_malloc (size + 1); if (!symlink) - return grub_errno; + return VasEBoot_errno; if (size <= sizeof (data->currinode.symlink.path)) - grub_memcpy (symlink, (char *) (data->currinode.symlink.path), size); - else if (grub_jfs_read_file (data, 0, 0, 0, size, symlink) < 0) + VasEBoot_memcpy (symlink, (char *) (data->currinode.symlink.path), size); + else if (VasEBoot_jfs_read_file (data, 0, 0, 0, size, symlink) < 0) { - grub_free (symlink); - return grub_errno; + VasEBoot_free (symlink); + return VasEBoot_errno; } symlink[size] = '\0'; @@ -745,138 +745,138 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino) if (symlink[0] == '/') ino = 2; - grub_jfs_find_file (data, symlink, ino); + VasEBoot_jfs_find_file (data, symlink, ino); - grub_free (symlink); + VasEBoot_free (symlink); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_jfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_jfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_jfs_data *data = 0; - struct grub_jfs_diropen *diro = 0; + struct VasEBoot_jfs_data *data = 0; + struct VasEBoot_jfs_diropen *diro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_jfs_mount (device->disk); + data = VasEBoot_jfs_mount (device->disk); if (!data) goto fail; - if (grub_jfs_find_file (data, path, GRUB_JFS_AGGR_INODE)) + if (VasEBoot_jfs_find_file (data, path, VasEBoot_JFS_AGGR_INODE)) goto fail; - diro = grub_jfs_opendir (data, &data->currinode); + diro = VasEBoot_jfs_opendir (data, &data->currinode); if (!diro) goto fail; /* Iterate over the dirents in the directory that was found. */ - while (grub_jfs_getent (diro) != GRUB_ERR_OUT_OF_RANGE) + while (VasEBoot_jfs_getent (diro) != VasEBoot_ERR_OUT_OF_RANGE) { - struct grub_jfs_inode inode; - struct grub_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + struct VasEBoot_jfs_inode inode; + struct VasEBoot_dirhook_info info; + VasEBoot_memset (&info, 0, sizeof (info)); - if (grub_jfs_read_inode (data, diro->ino, &inode)) + if (VasEBoot_jfs_read_inode (data, diro->ino, &inode)) goto fail; - info.dir = (grub_le_to_cpu32 (inode.mode) - & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR; + info.dir = (VasEBoot_le_to_cpu32 (inode.mode) + & VasEBoot_JFS_FILETYPE_MASK) == VasEBoot_JFS_FILETYPE_DIR; info.mtimeset = 1; - info.mtime = grub_le_to_cpu32 (inode.mtime.sec); + info.mtime = VasEBoot_le_to_cpu32 (inode.mtime.sec); if (hook (diro->name, &info, hook_data)) goto fail; } - /* XXX: GRUB_ERR_OUT_OF_RANGE is used for the last dirent. */ - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_errno = 0; + /* XXX: VasEBoot_ERR_OUT_OF_RANGE is used for the last dirent. */ + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_errno = 0; fail: - grub_jfs_closedir (diro); - grub_free (data); + VasEBoot_jfs_closedir (diro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_jfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_jfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_jfs_data *data; + struct VasEBoot_jfs_data *data; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_jfs_mount (file->device->disk); + data = VasEBoot_jfs_mount (file->device->disk); if (!data) goto fail; - grub_jfs_find_file (data, name, GRUB_JFS_AGGR_INODE); - if (grub_errno) + VasEBoot_jfs_find_file (data, name, VasEBoot_JFS_AGGR_INODE); + if (VasEBoot_errno) goto fail; /* It is only possible for open regular files. */ - if (! ((grub_le_to_cpu32 (data->currinode.mode) - & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_REG)) + if (! ((VasEBoot_le_to_cpu32 (data->currinode.mode) + & VasEBoot_JFS_FILETYPE_MASK) == VasEBoot_JFS_FILETYPE_REG)) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a regular file")); goto fail; } file->data = data; - file->size = grub_le_to_cpu64 (data->currinode.size); + file->size = VasEBoot_le_to_cpu64 (data->currinode.size); return 0; fail: - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_jfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_jfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_jfs_data *data = - (struct grub_jfs_data *) file->data; + struct VasEBoot_jfs_data *data = + (struct VasEBoot_jfs_data *) file->data; - return grub_jfs_read_file (data, file->read_hook, file->read_hook_data, + return VasEBoot_jfs_read_file (data, file->read_hook, file->read_hook_data, file->offset, len, buf); } -static grub_err_t -grub_jfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_jfs_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_jfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_jfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_jfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_jfs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_jfs_mount (disk); + data = VasEBoot_jfs_mount (disk); if (data) { - *uuid = grub_xasprintf ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" + *uuid = VasEBoot_xasprintf ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" "%02x%02x%02x%02x%02x%02x", data->sblock.uuid[0], data->sblock.uuid[1], data->sblock.uuid[2], data->sblock.uuid[3], @@ -890,18 +890,18 @@ grub_jfs_uuid (grub_device_t device, char **uuid) else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_jfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_jfs_label (VasEBoot_device_t device, char **label) { - struct grub_jfs_data *data; - data = grub_jfs_mount (device->disk); + struct VasEBoot_jfs_data *data; + data = VasEBoot_jfs_mount (device->disk); if (data) { @@ -911,45 +911,45 @@ grub_jfs_label (grub_device_t device, char **label) ptr = data->sblock.volname + sizeof (data->sblock.volname) - 1; while (ptr >= data->sblock.volname && *ptr == ' ') ptr--; - *label = grub_strndup (data->sblock.volname, + *label = VasEBoot_strndup (data->sblock.volname, ptr - data->sblock.volname + 1); } else - *label = grub_strndup (data->sblock.volname2, + *label = VasEBoot_strndup (data->sblock.volname2, sizeof (data->sblock.volname2)); } else *label = 0; - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_jfs_fs = +static struct VasEBoot_fs VasEBoot_jfs_fs = { .name = "jfs", - .dir = grub_jfs_dir, - .open = grub_jfs_open, - .read = grub_jfs_read, - .close = grub_jfs_close, - .label = grub_jfs_label, - .uuid = grub_jfs_uuid, -#ifdef GRUB_UTIL + .dir = VasEBoot_jfs_dir, + .open = VasEBoot_jfs_open, + .read = VasEBoot_jfs_read, + .close = VasEBoot_jfs_close, + .label = VasEBoot_jfs_label, + .uuid = VasEBoot_jfs_uuid, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(jfs) +VasEBoot_MOD_INIT(jfs) { - grub_fs_register (&grub_jfs_fs); + VasEBoot_fs_register (&VasEBoot_jfs_fs); my_mod = mod; } -GRUB_MOD_FINI(jfs) +VasEBoot_MOD_FINI(jfs) { - grub_fs_unregister (&grub_jfs_fs); + VasEBoot_fs_unregister (&VasEBoot_jfs_fs); } diff --git a/VasEBoot-core/fs/minix.c b/VasEBoot-core/fs/minix.c index d451b3426..c6889a2d7 100644 --- a/VasEBoot-core/fs/minix.c +++ b/VasEBoot-core/fs/minix.c @@ -1,148 +1,148 @@ /* minix.c - The minix filesystem, version 1 and 2. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #ifdef MODE_MINIX3 -#define GRUB_MINIX_MAGIC 0x4D5A +#define VasEBoot_MINIX_MAGIC 0x4D5A #elif defined(MODE_MINIX2) -#define GRUB_MINIX_MAGIC 0x2468 -#define GRUB_MINIX_MAGIC_30 0x2478 +#define VasEBoot_MINIX_MAGIC 0x2468 +#define VasEBoot_MINIX_MAGIC_30 0x2478 #else -#define GRUB_MINIX_MAGIC 0x137F -#define GRUB_MINIX_MAGIC_30 0x138F +#define VasEBoot_MINIX_MAGIC 0x137F +#define VasEBoot_MINIX_MAGIC_30 0x138F #endif -#define GRUB_MINIX_INODE_DIR_BLOCKS 7 -#define GRUB_MINIX_LOG2_BSIZE 1 -#define GRUB_MINIX_ROOT_INODE 1 -#define GRUB_MINIX_MAX_SYMLNK_CNT 8 -#define GRUB_MINIX_SBLOCK 2 +#define VasEBoot_MINIX_INODE_DIR_BLOCKS 7 +#define VasEBoot_MINIX_LOG2_BSIZE 1 +#define VasEBoot_MINIX_ROOT_INODE 1 +#define VasEBoot_MINIX_MAX_SYMLNK_CNT 8 +#define VasEBoot_MINIX_SBLOCK 2 -#define GRUB_MINIX_IFDIR 0040000U -#define GRUB_MINIX_IFLNK 0120000U +#define VasEBoot_MINIX_IFDIR 0040000U +#define VasEBoot_MINIX_IFLNK 0120000U #ifdef MODE_BIGENDIAN -#define grub_cpu_to_minix16_compile_time grub_cpu_to_be16_compile_time -#define grub_minix_to_cpu16 grub_be_to_cpu16 -#define grub_minix_to_cpu32 grub_be_to_cpu32 +#define VasEBoot_cpu_to_minix16_compile_time VasEBoot_cpu_to_be16_compile_time +#define VasEBoot_minix_to_cpu16 VasEBoot_be_to_cpu16 +#define VasEBoot_minix_to_cpu32 VasEBoot_be_to_cpu32 #else -#define grub_cpu_to_minix16_compile_time grub_cpu_to_le16_compile_time -#define grub_minix_to_cpu16 grub_le_to_cpu16 -#define grub_minix_to_cpu32 grub_le_to_cpu32 +#define VasEBoot_cpu_to_minix16_compile_time VasEBoot_cpu_to_le16_compile_time +#define VasEBoot_minix_to_cpu16 VasEBoot_le_to_cpu16 +#define VasEBoot_minix_to_cpu32 VasEBoot_le_to_cpu32 #endif #if defined(MODE_MINIX2) || defined(MODE_MINIX3) -typedef grub_uint32_t grub_minix_uintn_t; -#define grub_minix_to_cpu_n grub_minix_to_cpu32 +typedef VasEBoot_uint32_t VasEBoot_minix_uintn_t; +#define VasEBoot_minix_to_cpu_n VasEBoot_minix_to_cpu32 #else -typedef grub_uint16_t grub_minix_uintn_t; -#define grub_minix_to_cpu_n grub_minix_to_cpu16 +typedef VasEBoot_uint16_t VasEBoot_minix_uintn_t; +#define VasEBoot_minix_to_cpu_n VasEBoot_minix_to_cpu16 #endif #ifdef MODE_MINIX3 -typedef grub_uint32_t grub_minix_ino_t; -#define grub_minix_to_cpu_ino grub_minix_to_cpu32 +typedef VasEBoot_uint32_t VasEBoot_minix_ino_t; +#define VasEBoot_minix_to_cpu_ino VasEBoot_minix_to_cpu32 #else -typedef grub_uint16_t grub_minix_ino_t; -#define grub_minix_to_cpu_ino grub_minix_to_cpu16 +typedef VasEBoot_uint16_t VasEBoot_minix_ino_t; +#define VasEBoot_minix_to_cpu_ino VasEBoot_minix_to_cpu16 #endif -#define GRUB_MINIX_INODE_SIZE(data) (grub_minix_to_cpu32 (data->inode.size)) -#define GRUB_MINIX_INODE_MODE(data) (grub_minix_to_cpu16 (data->inode.mode)) -#define GRUB_MINIX_INODE_DIR_ZONES(data,blk) (grub_minix_to_cpu_n \ +#define VasEBoot_MINIX_INODE_SIZE(data) (VasEBoot_minix_to_cpu32 (data->inode.size)) +#define VasEBoot_MINIX_INODE_MODE(data) (VasEBoot_minix_to_cpu16 (data->inode.mode)) +#define VasEBoot_MINIX_INODE_DIR_ZONES(data,blk) (VasEBoot_minix_to_cpu_n \ (data->inode.dir_zones[blk])) -#define GRUB_MINIX_INODE_INDIR_ZONE(data) (grub_minix_to_cpu_n \ +#define VasEBoot_MINIX_INODE_INDIR_ZONE(data) (VasEBoot_minix_to_cpu_n \ (data->inode.indir_zone)) -#define GRUB_MINIX_INODE_DINDIR_ZONE(data) (grub_minix_to_cpu_n \ +#define VasEBoot_MINIX_INODE_DINDIR_ZONE(data) (VasEBoot_minix_to_cpu_n \ (data->inode.double_indir_zone)) #ifdef MODE_MINIX3 -struct grub_minix_sblock +struct VasEBoot_minix_sblock { - grub_uint32_t inode_cnt; - grub_uint16_t zone_cnt; - grub_uint16_t inode_bmap_size; - grub_uint16_t zone_bmap_size; - grub_uint16_t first_data_zone; - grub_uint16_t log2_zone_size; - grub_uint16_t pad; - grub_uint32_t max_file_size; - grub_uint32_t zones; - grub_uint16_t magic; + VasEBoot_uint32_t inode_cnt; + VasEBoot_uint16_t zone_cnt; + VasEBoot_uint16_t inode_bmap_size; + VasEBoot_uint16_t zone_bmap_size; + VasEBoot_uint16_t first_data_zone; + VasEBoot_uint16_t log2_zone_size; + VasEBoot_uint16_t pad; + VasEBoot_uint32_t max_file_size; + VasEBoot_uint32_t zones; + VasEBoot_uint16_t magic; - grub_uint16_t pad2; - grub_uint16_t block_size; - grub_uint8_t disk_version; + VasEBoot_uint16_t pad2; + VasEBoot_uint16_t block_size; + VasEBoot_uint8_t disk_version; }; #else -struct grub_minix_sblock +struct VasEBoot_minix_sblock { - grub_uint16_t inode_cnt; - grub_uint16_t zone_cnt; - grub_uint16_t inode_bmap_size; - grub_uint16_t zone_bmap_size; - grub_uint16_t first_data_zone; - grub_uint16_t log2_zone_size; - grub_uint32_t max_file_size; - grub_uint16_t magic; + VasEBoot_uint16_t inode_cnt; + VasEBoot_uint16_t zone_cnt; + VasEBoot_uint16_t inode_bmap_size; + VasEBoot_uint16_t zone_bmap_size; + VasEBoot_uint16_t first_data_zone; + VasEBoot_uint16_t log2_zone_size; + VasEBoot_uint32_t max_file_size; + VasEBoot_uint16_t magic; }; #endif #if defined(MODE_MINIX3) || defined(MODE_MINIX2) -struct grub_minix_inode +struct VasEBoot_minix_inode { - grub_uint16_t mode; - grub_uint16_t nlinks; - grub_uint16_t uid; - grub_uint16_t gid; - grub_uint32_t size; - grub_uint32_t atime; - grub_uint32_t mtime; - grub_uint32_t ctime; - grub_uint32_t dir_zones[7]; - grub_uint32_t indir_zone; - grub_uint32_t double_indir_zone; - grub_uint32_t triple_indir_zone; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t nlinks; + VasEBoot_uint16_t uid; + VasEBoot_uint16_t gid; + VasEBoot_uint32_t size; + VasEBoot_uint32_t atime; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t dir_zones[7]; + VasEBoot_uint32_t indir_zone; + VasEBoot_uint32_t double_indir_zone; + VasEBoot_uint32_t triple_indir_zone; }; #else -struct grub_minix_inode +struct VasEBoot_minix_inode { - grub_uint16_t mode; - grub_uint16_t uid; - grub_uint32_t size; - grub_uint32_t mtime; - grub_uint8_t gid; - grub_uint8_t nlinks; - grub_uint16_t dir_zones[7]; - grub_uint16_t indir_zone; - grub_uint16_t double_indir_zone; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t uid; + VasEBoot_uint32_t size; + VasEBoot_uint32_t mtime; + VasEBoot_uint8_t gid; + VasEBoot_uint8_t nlinks; + VasEBoot_uint16_t dir_zones[7]; + VasEBoot_uint16_t indir_zone; + VasEBoot_uint16_t double_indir_zone; }; #endif @@ -154,99 +154,99 @@ struct grub_minix_inode #endif /* Information about a "mounted" minix filesystem. */ -struct grub_minix_data +struct VasEBoot_minix_data { - struct grub_minix_sblock sblock; - struct grub_minix_inode inode; - grub_uint32_t block_per_zone; - grub_minix_ino_t ino; + struct VasEBoot_minix_sblock sblock; + struct VasEBoot_minix_inode inode; + VasEBoot_uint32_t block_per_zone; + VasEBoot_minix_ino_t ino; int linknest; - grub_disk_t disk; + VasEBoot_disk_t disk; int filename_size; - grub_size_t block_size; + VasEBoot_size_t block_size; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_err_t grub_minix_find_file (struct grub_minix_data *data, +static VasEBoot_err_t VasEBoot_minix_find_file (struct VasEBoot_minix_data *data, const char *path); #ifdef MODE_MINIX3 -static inline grub_disk_addr_t -grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone) +static inline VasEBoot_disk_addr_t +VasEBoot_minix_zone2sect (struct VasEBoot_minix_data *data, VasEBoot_minix_uintn_t zone) { - return ((grub_disk_addr_t) zone) * data->block_size; + return ((VasEBoot_disk_addr_t) zone) * data->block_size; } #else -static inline grub_disk_addr_t -grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone) +static inline VasEBoot_disk_addr_t +VasEBoot_minix_zone2sect (struct VasEBoot_minix_data *data, VasEBoot_minix_uintn_t zone) { - int log2_zonesz = (GRUB_MINIX_LOG2_BSIZE - + grub_minix_to_cpu16 (data->sblock.log2_zone_size)); - return (((grub_disk_addr_t) zone) << log2_zonesz); + int log2_zonesz = (VasEBoot_MINIX_LOG2_BSIZE + + VasEBoot_minix_to_cpu16 (data->sblock.log2_zone_size)); + return (((VasEBoot_disk_addr_t) zone) << log2_zonesz); } #endif /* Read the block pointer in ZONE, on the offset NUM. */ -static grub_minix_uintn_t -grub_get_indir (struct grub_minix_data *data, - grub_minix_uintn_t zone, - grub_minix_uintn_t num) +static VasEBoot_minix_uintn_t +VasEBoot_get_indir (struct VasEBoot_minix_data *data, + VasEBoot_minix_uintn_t zone, + VasEBoot_minix_uintn_t num) { - grub_minix_uintn_t indirn; - grub_disk_read (data->disk, - grub_minix_zone2sect(data, zone), - sizeof (grub_minix_uintn_t) * num, - sizeof (grub_minix_uintn_t), (char *) &indirn); - return grub_minix_to_cpu_n (indirn); + VasEBoot_minix_uintn_t indirn; + VasEBoot_disk_read (data->disk, + VasEBoot_minix_zone2sect(data, zone), + sizeof (VasEBoot_minix_uintn_t) * num, + sizeof (VasEBoot_minix_uintn_t), (char *) &indirn); + return VasEBoot_minix_to_cpu_n (indirn); } -static grub_minix_uintn_t -grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) +static VasEBoot_minix_uintn_t +VasEBoot_minix_get_file_block (struct VasEBoot_minix_data *data, unsigned int blk) { - grub_minix_uintn_t indir; + VasEBoot_minix_uintn_t indir; /* Direct block. */ - if (blk < GRUB_MINIX_INODE_DIR_BLOCKS) - return GRUB_MINIX_INODE_DIR_ZONES (data, blk); + if (blk < VasEBoot_MINIX_INODE_DIR_BLOCKS) + return VasEBoot_MINIX_INODE_DIR_ZONES (data, blk); /* Indirect block. */ - blk -= GRUB_MINIX_INODE_DIR_BLOCKS; + blk -= VasEBoot_MINIX_INODE_DIR_BLOCKS; if (blk < data->block_per_zone) { - indir = grub_get_indir (data, GRUB_MINIX_INODE_INDIR_ZONE (data), blk); + indir = VasEBoot_get_indir (data, VasEBoot_MINIX_INODE_INDIR_ZONE (data), blk); return indir; } /* Double indirect block. */ blk -= data->block_per_zone; - if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone) + if (blk < (VasEBoot_uint64_t) data->block_per_zone * (VasEBoot_uint64_t) data->block_per_zone) { - indir = grub_get_indir (data, GRUB_MINIX_INODE_DINDIR_ZONE (data), + indir = VasEBoot_get_indir (data, VasEBoot_MINIX_INODE_DINDIR_ZONE (data), blk / data->block_per_zone); - indir = grub_get_indir (data, indir, blk % data->block_per_zone); + indir = VasEBoot_get_indir (data, indir, blk % data->block_per_zone); return indir; } #if defined (MODE_MINIX3) || defined (MODE_MINIX2) blk -= data->block_per_zone * data->block_per_zone; - if (blk < ((grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone - * (grub_uint64_t) data->block_per_zone)) + if (blk < ((VasEBoot_uint64_t) data->block_per_zone * (VasEBoot_uint64_t) data->block_per_zone + * (VasEBoot_uint64_t) data->block_per_zone)) { - indir = grub_get_indir (data, grub_minix_to_cpu_n (data->inode.triple_indir_zone), + indir = VasEBoot_get_indir (data, VasEBoot_minix_to_cpu_n (data->inode.triple_indir_zone), (blk / data->block_per_zone) / data->block_per_zone); - indir = grub_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone); - indir = grub_get_indir (data, indir, blk % data->block_per_zone); + indir = VasEBoot_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone); + indir = VasEBoot_get_indir (data, indir, blk % data->block_per_zone); return indir; } #endif /* This should never happen. */ - grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "file bigger than maximum size"); return 0; } @@ -254,56 +254,56 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_minix_read_file (struct grub_minix_data *data, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_minix_read_file (struct VasEBoot_minix_data *data, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - grub_uint32_t i; - grub_uint32_t blockcnt; - grub_uint32_t posblock; - grub_uint32_t blockoff; + VasEBoot_uint32_t i; + VasEBoot_uint32_t blockcnt; + VasEBoot_uint32_t posblock; + VasEBoot_uint32_t blockoff; - if (pos > GRUB_MINIX_INODE_SIZE (data)) + if (pos > VasEBoot_MINIX_INODE_SIZE (data)) { - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read past the end of file")); return -1; } /* Adjust len so it we can't read past the end of the file. */ - if (len + pos > GRUB_MINIX_INODE_SIZE (data)) - len = GRUB_MINIX_INODE_SIZE (data) - pos; + if (len + pos > VasEBoot_MINIX_INODE_SIZE (data)) + len = VasEBoot_MINIX_INODE_SIZE (data) - pos; if (len == 0) return 0; /* Files are at most 2G/4G - 1 bytes on minixfs. Avoid 64-bit division. */ - blockcnt = ((grub_uint32_t) ((len + pos - 1) - >> GRUB_DISK_SECTOR_BITS)) / data->block_size + 1; - posblock = (((grub_uint32_t) pos) - / (data->block_size << GRUB_DISK_SECTOR_BITS)); - blockoff = (((grub_uint32_t) pos) - % (data->block_size << GRUB_DISK_SECTOR_BITS)); + blockcnt = ((VasEBoot_uint32_t) ((len + pos - 1) + >> VasEBoot_DISK_SECTOR_BITS)) / data->block_size + 1; + posblock = (((VasEBoot_uint32_t) pos) + / (data->block_size << VasEBoot_DISK_SECTOR_BITS)); + blockoff = (((VasEBoot_uint32_t) pos) + % (data->block_size << VasEBoot_DISK_SECTOR_BITS)); for (i = posblock; i < blockcnt; i++) { - grub_minix_uintn_t blknr; - grub_uint64_t blockend = data->block_size << GRUB_DISK_SECTOR_BITS; - grub_off_t skipfirst = 0; + VasEBoot_minix_uintn_t blknr; + VasEBoot_uint64_t blockend = data->block_size << VasEBoot_DISK_SECTOR_BITS; + VasEBoot_off_t skipfirst = 0; - blknr = grub_minix_get_file_block (data, i); - if (grub_errno) + blknr = VasEBoot_minix_get_file_block (data, i); + if (VasEBoot_errno) return -1; /* Last block. */ if (i == blockcnt - 1) { /* len + pos < 4G (checked above), so it doesn't overflow. */ - blockend = (((grub_uint32_t) (len + pos)) - % (data->block_size << GRUB_DISK_SECTOR_BITS)); + blockend = (((VasEBoot_uint32_t) (len + pos)) + % (data->block_size << VasEBoot_DISK_SECTOR_BITS)); if (!blockend) - blockend = data->block_size << GRUB_DISK_SECTOR_BITS; + blockend = data->block_size << VasEBoot_DISK_SECTOR_BITS; } /* First block. */ @@ -315,14 +315,14 @@ grub_minix_read_file (struct grub_minix_data *data, data->disk->read_hook = read_hook; data->disk->read_hook_data = read_hook_data; - grub_disk_read (data->disk, - grub_minix_zone2sect(data, blknr), + VasEBoot_disk_read (data->disk, + VasEBoot_minix_zone2sect(data, blknr), skipfirst, blockend, buf); data->disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; - buf += (data->block_size << GRUB_DISK_SECTOR_BITS) - skipfirst; + buf += (data->block_size << VasEBoot_DISK_SECTOR_BITS) - skipfirst; } return len; @@ -331,74 +331,74 @@ grub_minix_read_file (struct grub_minix_data *data, /* Read inode INO from the mounted filesystem described by DATA. This inode is used by default now. */ -static grub_err_t -grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino) +static VasEBoot_err_t +VasEBoot_minix_read_inode (struct VasEBoot_minix_data *data, VasEBoot_minix_ino_t ino) { - struct grub_minix_sblock *sblock = &data->sblock; + struct VasEBoot_minix_sblock *sblock = &data->sblock; /* Block in which the inode is stored. */ - grub_disk_addr_t block; + VasEBoot_disk_addr_t block; data->ino = ino; /* The first inode in minix is inode 1. */ ino--; - block = grub_minix_zone2sect (data, - 2 + grub_minix_to_cpu16 (sblock->inode_bmap_size) - + grub_minix_to_cpu16 (sblock->zone_bmap_size)); - block += ino / (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix_inode)); - int offs = (ino % (GRUB_DISK_SECTOR_SIZE - / sizeof (struct grub_minix_inode)) - * sizeof (struct grub_minix_inode)); + block = VasEBoot_minix_zone2sect (data, + 2 + VasEBoot_minix_to_cpu16 (sblock->inode_bmap_size) + + VasEBoot_minix_to_cpu16 (sblock->zone_bmap_size)); + block += ino / (VasEBoot_DISK_SECTOR_SIZE / sizeof (struct VasEBoot_minix_inode)); + int offs = (ino % (VasEBoot_DISK_SECTOR_SIZE + / sizeof (struct VasEBoot_minix_inode)) + * sizeof (struct VasEBoot_minix_inode)); - grub_disk_read (data->disk, block, offs, - sizeof (struct grub_minix_inode), &data->inode); + VasEBoot_disk_read (data->disk, block, offs, + sizeof (struct VasEBoot_minix_inode), &data->inode); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Lookup the symlink the current inode points to. INO is the inode number of the directory the symlink is relative to. */ -static grub_err_t -grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino) +static VasEBoot_err_t +VasEBoot_minix_lookup_symlink (struct VasEBoot_minix_data *data, VasEBoot_minix_ino_t ino) { char *symlink; - grub_size_t sz = GRUB_MINIX_INODE_SIZE (data); + VasEBoot_size_t sz = VasEBoot_MINIX_INODE_SIZE (data); - if (++data->linknest > GRUB_MINIX_MAX_SYMLNK_CNT) - return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); + if (++data->linknest > VasEBoot_MINIX_MAX_SYMLNK_CNT) + return VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); - symlink = grub_malloc (sz + 1); + symlink = VasEBoot_malloc (sz + 1); if (!symlink) - return grub_errno; - if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0) - return grub_errno; + return VasEBoot_errno; + if (VasEBoot_minix_read_file (data, 0, 0, 0, sz, symlink) < 0) + return VasEBoot_errno; symlink[sz] = '\0'; /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') - ino = GRUB_MINIX_ROOT_INODE; + ino = VasEBoot_MINIX_ROOT_INODE; /* Now load in the old inode. */ - if (grub_minix_read_inode (data, ino)) - return grub_errno; + if (VasEBoot_minix_read_inode (data, ino)) + return VasEBoot_errno; - grub_minix_find_file (data, symlink); + VasEBoot_minix_find_file (data, symlink); - return grub_errno; + return VasEBoot_errno; } /* Find the file with the pathname PATH on the filesystem described by DATA. */ -static grub_err_t -grub_minix_find_file (struct grub_minix_data *data, const char *path) +static VasEBoot_err_t +VasEBoot_minix_find_file (struct VasEBoot_minix_data *data, const char *path) { const char *name; const char *next = path; unsigned int pos = 0; - grub_minix_ino_t dirino; + VasEBoot_minix_ino_t dirino; while (1) { @@ -407,32 +407,32 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) while (*name == '/') name++; if (!*name) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - if ((GRUB_MINIX_INODE_MODE (data) - & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + if ((VasEBoot_MINIX_INODE_MODE (data) + & VasEBoot_MINIX_IFDIR) != VasEBoot_MINIX_IFDIR) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); /* Extract the actual part from the pathname. */ for (next = name; *next && *next != '/'; next++); for (pos = 0; ; ) { - grub_minix_ino_t ino; + VasEBoot_minix_ino_t ino; char filename[MAX_MINIX_FILENAME_SIZE + 1]; - if (pos >= GRUB_MINIX_INODE_SIZE (data)) + if (pos >= VasEBoot_MINIX_INODE_SIZE (data)) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path); + return VasEBoot_errno; } - if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino), + if (VasEBoot_minix_read_file (data, 0, 0, pos, sizeof (ino), (char *) &ino) < 0) - return grub_errno; - if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino), + return VasEBoot_errno; + if (VasEBoot_minix_read_file (data, 0, 0, pos + sizeof (ino), data->filename_size, (char *) filename)< 0) - return grub_errno; + return VasEBoot_errno; pos += sizeof (ino) + data->filename_size; @@ -440,19 +440,19 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) /* Check if the current direntry matches the current part of the pathname. */ - if (grub_strncmp (name, filename, next - name) == 0 + if (VasEBoot_strncmp (name, filename, next - name) == 0 && filename[next - name] == '\0') { dirino = data->ino; - grub_minix_read_inode (data, grub_minix_to_cpu_ino (ino)); + VasEBoot_minix_read_inode (data, VasEBoot_minix_to_cpu_ino (ino)); /* Follow the symlink. */ - if ((GRUB_MINIX_INODE_MODE (data) - & GRUB_MINIX_IFLNK) == GRUB_MINIX_IFLNK) + if ((VasEBoot_MINIX_INODE_MODE (data) + & VasEBoot_MINIX_IFLNK) == VasEBoot_MINIX_IFLNK) { - grub_minix_lookup_symlink (data, dirino); - if (grub_errno) - return grub_errno; + VasEBoot_minix_lookup_symlink (data, dirino); + if (VasEBoot_errno) + return VasEBoot_errno; } break; @@ -463,22 +463,22 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) /* Mount the filesystem on the disk DISK. */ -static struct grub_minix_data * -grub_minix_mount (grub_disk_t disk) +static struct VasEBoot_minix_data * +VasEBoot_minix_mount (VasEBoot_disk_t disk) { - struct grub_minix_data *data; + struct VasEBoot_minix_data *data; - data = grub_malloc (sizeof (struct grub_minix_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_minix_data)); if (!data) return 0; /* Read the superblock. */ - grub_disk_read (disk, GRUB_MINIX_SBLOCK, 0, - sizeof (struct grub_minix_sblock),&data->sblock); - if (grub_errno) + VasEBoot_disk_read (disk, VasEBoot_MINIX_SBLOCK, 0, + sizeof (struct VasEBoot_minix_sblock),&data->sblock); + if (VasEBoot_errno) goto fail; - if (data->sblock.magic == grub_cpu_to_minix16_compile_time (GRUB_MINIX_MAGIC)) + if (data->sblock.magic == VasEBoot_cpu_to_minix16_compile_time (VasEBoot_MINIX_MAGIC)) { #if !defined(MODE_MINIX3) data->filename_size = 14; @@ -488,7 +488,7 @@ grub_minix_mount (grub_disk_t disk) } #if !defined(MODE_MINIX3) else if (data->sblock.magic - == grub_cpu_to_minix16_compile_time (GRUB_MINIX_MAGIC_30)) + == VasEBoot_cpu_to_minix16_compile_time (VasEBoot_MINIX_MAGIC_30)) data->filename_size = 30; #endif else @@ -496,7 +496,7 @@ grub_minix_mount (grub_disk_t disk) /* 20 means 1G zones. We could support up to 31 but already 1G isn't supported by anything else. */ - if (grub_minix_to_cpu16 (data->sblock.log2_zone_size) >= 20) + if (VasEBoot_minix_to_cpu16 (data->sblock.log2_zone_size) >= 20) goto fail; data->disk = disk; @@ -507,79 +507,79 @@ grub_minix_mount (grub_disk_t disk) data->block_size = 2; else { - if ((data->sblock.block_size == grub_cpu_to_minix16_compile_time (0x200)) + if ((data->sblock.block_size == VasEBoot_cpu_to_minix16_compile_time (0x200)) || (data->sblock.block_size == 0) - || (data->sblock.block_size & grub_cpu_to_minix16_compile_time (0x1ff))) + || (data->sblock.block_size & VasEBoot_cpu_to_minix16_compile_time (0x1ff))) goto fail; - data->block_size = grub_minix_to_cpu16 (data->sblock.block_size) - >> GRUB_DISK_SECTOR_BITS; + data->block_size = VasEBoot_minix_to_cpu16 (data->sblock.block_size) + >> VasEBoot_DISK_SECTOR_BITS; } #else data->block_size = 2; #endif - data->block_per_zone = (((grub_uint64_t) data->block_size << \ - (GRUB_DISK_SECTOR_BITS + grub_minix_to_cpu16 (data->sblock.log2_zone_size))) - / sizeof (grub_minix_uintn_t)); + data->block_per_zone = (((VasEBoot_uint64_t) data->block_size << \ + (VasEBoot_DISK_SECTOR_BITS + VasEBoot_minix_to_cpu16 (data->sblock.log2_zone_size))) + / sizeof (VasEBoot_minix_uintn_t)); if (!data->block_per_zone) goto fail; return data; fail: - grub_free (data); + VasEBoot_free (data); #if defined(MODE_MINIX3) - grub_error (GRUB_ERR_BAD_FS, "not a minix3 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a minix3 filesystem"); #elif defined(MODE_MINIX2) - grub_error (GRUB_ERR_BAD_FS, "not a minix2 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a minix2 filesystem"); #else - grub_error (GRUB_ERR_BAD_FS, "not a minix filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a minix filesystem"); #endif return 0; } -static grub_err_t -grub_minix_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_minix_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_minix_data *data = 0; + struct VasEBoot_minix_data *data = 0; unsigned int pos = 0; - data = grub_minix_mount (device->disk); + data = VasEBoot_minix_mount (device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - grub_minix_read_inode (data, GRUB_MINIX_ROOT_INODE); - if (grub_errno) + VasEBoot_minix_read_inode (data, VasEBoot_MINIX_ROOT_INODE); + if (VasEBoot_errno) goto fail; - grub_minix_find_file (data, path); - if (grub_errno) + VasEBoot_minix_find_file (data, path); + if (VasEBoot_errno) goto fail; - if ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR) + if ((VasEBoot_MINIX_INODE_MODE (data) & VasEBoot_MINIX_IFDIR) != VasEBoot_MINIX_IFDIR) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); goto fail; } - while (pos < GRUB_MINIX_INODE_SIZE (data)) + while (pos < VasEBoot_MINIX_INODE_SIZE (data)) { - grub_minix_ino_t ino; + VasEBoot_minix_ino_t ino; char filename[MAX_MINIX_FILENAME_SIZE + 1]; - grub_minix_ino_t dirino = data->ino; - struct grub_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_minix_ino_t dirino = data->ino; + struct VasEBoot_dirhook_info info; + VasEBoot_memset (&info, 0, sizeof (info)); - if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino), + if (VasEBoot_minix_read_file (data, 0, 0, pos, sizeof (ino), (char *) &ino) < 0) - return grub_errno; + return VasEBoot_errno; - if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino), + if (VasEBoot_minix_read_file (data, 0, 0, pos + sizeof (ino), data->filename_size, (char *) filename) < 0) - return grub_errno; + return VasEBoot_errno; filename[data->filename_size] = '\0'; if (!ino) { @@ -587,88 +587,88 @@ grub_minix_dir (grub_device_t device, const char *path, continue; } - grub_minix_read_inode (data, grub_minix_to_cpu_ino (ino)); - info.dir = ((GRUB_MINIX_INODE_MODE (data) - & GRUB_MINIX_IFDIR) == GRUB_MINIX_IFDIR); + VasEBoot_minix_read_inode (data, VasEBoot_minix_to_cpu_ino (ino)); + info.dir = ((VasEBoot_MINIX_INODE_MODE (data) + & VasEBoot_MINIX_IFDIR) == VasEBoot_MINIX_IFDIR); info.mtimeset = 1; - info.mtime = grub_minix_to_cpu32 (data->inode.mtime); + info.mtime = VasEBoot_minix_to_cpu32 (data->inode.mtime); if (hook (filename, &info, hook_data) ? 1 : 0) break; /* Load the old inode back in. */ - grub_minix_read_inode (data, dirino); + VasEBoot_minix_read_inode (data, dirino); pos += sizeof (ino) + data->filename_size; } fail: - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_minix_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_minix_open (struct VasEBoot_file *file, const char *name) { - struct grub_minix_data *data; - data = grub_minix_mount (file->device->disk); + struct VasEBoot_minix_data *data; + data = VasEBoot_minix_mount (file->device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; /* Open the inode op the root directory. */ - grub_minix_read_inode (data, GRUB_MINIX_ROOT_INODE); - if (grub_errno) + VasEBoot_minix_read_inode (data, VasEBoot_MINIX_ROOT_INODE); + if (VasEBoot_errno) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } if (!name || name[0] != '/') { - grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name); + return VasEBoot_errno; } /* Traverse the directory tree to the node that should be opened. */ - grub_minix_find_file (data, name); - if (grub_errno) + VasEBoot_minix_find_file (data, name); + if (VasEBoot_errno) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } file->data = data; - file->size = GRUB_MINIX_INODE_SIZE (data); + file->size = VasEBoot_MINIX_INODE_SIZE (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -grub_minix_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_minix_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_minix_data *data = - (struct grub_minix_data *) file->data; + struct VasEBoot_minix_data *data = + (struct VasEBoot_minix_data *) file->data; - return grub_minix_read_file (data, file->read_hook, file->read_hook_data, + return VasEBoot_minix_read_file (data, file->read_hook, file->read_hook_data, file->offset, len, buf); } -static grub_err_t -grub_minix_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_minix_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_fs grub_minix_fs = +static struct VasEBoot_fs VasEBoot_minix_fs = { #ifdef MODE_BIGENDIAN #if defined(MODE_MINIX3) @@ -687,11 +687,11 @@ static struct grub_fs grub_minix_fs = .name = "minix", #endif #endif - .dir = grub_minix_dir, - .open = grub_minix_open, - .read = grub_minix_read, - .close = grub_minix_close, -#ifdef GRUB_UTIL + .dir = VasEBoot_minix_dir, + .open = VasEBoot_minix_open, + .read = VasEBoot_minix_read, + .close = VasEBoot_minix_close, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif @@ -700,43 +700,43 @@ static struct grub_fs grub_minix_fs = #ifdef MODE_BIGENDIAN #if defined(MODE_MINIX3) -GRUB_MOD_INIT(minix3_be) +VasEBoot_MOD_INIT(minix3_be) #elif defined(MODE_MINIX2) -GRUB_MOD_INIT(minix2_be) +VasEBoot_MOD_INIT(minix2_be) #else -GRUB_MOD_INIT(minix_be) +VasEBoot_MOD_INIT(minix_be) #endif #else #if defined(MODE_MINIX3) -GRUB_MOD_INIT(minix3) +VasEBoot_MOD_INIT(minix3) #elif defined(MODE_MINIX2) -GRUB_MOD_INIT(minix2) +VasEBoot_MOD_INIT(minix2) #else -GRUB_MOD_INIT(minix) +VasEBoot_MOD_INIT(minix) #endif #endif { - grub_fs_register (&grub_minix_fs); + VasEBoot_fs_register (&VasEBoot_minix_fs); my_mod = mod; } #ifdef MODE_BIGENDIAN #if defined(MODE_MINIX3) -GRUB_MOD_FINI(minix3_be) +VasEBoot_MOD_FINI(minix3_be) #elif defined(MODE_MINIX2) -GRUB_MOD_FINI(minix2_be) +VasEBoot_MOD_FINI(minix2_be) #else -GRUB_MOD_FINI(minix_be) +VasEBoot_MOD_FINI(minix_be) #endif #else #if defined(MODE_MINIX3) -GRUB_MOD_FINI(minix3) +VasEBoot_MOD_FINI(minix3) #elif defined(MODE_MINIX2) -GRUB_MOD_FINI(minix2) +VasEBoot_MOD_FINI(minix2) #else -GRUB_MOD_FINI(minix) +VasEBoot_MOD_FINI(minix) #endif #endif { - grub_fs_unregister (&grub_minix_fs); + VasEBoot_fs_unregister (&VasEBoot_minix_fs); } diff --git a/VasEBoot-core/fs/newc.c b/VasEBoot-core/fs/newc.c index 4fb8b2e3d..9819b356e 100644 --- a/VasEBoot-core/fs/newc.c +++ b/VasEBoot-core/fs/newc.c @@ -1,6 +1,6 @@ /* cpio.c - cpio and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #define ALIGN_CPIO(x) (ALIGN_UP ((x), 4)) #define MAGIC "070701" @@ -38,13 +38,13 @@ struct head char rdevminor[8]; char namesize[8]; char check[8]; -} GRUB_PACKED; +} VasEBoot_PACKED; static inline unsigned long long -read_number (const char *str, grub_size_t size) +read_number (const char *str, VasEBoot_size_t size) { unsigned long long ret = 0; - while (size-- && grub_isxdigit (*str)) + while (size-- && VasEBoot_isxdigit (*str)) { char dig = *str++; if (dig >= '0' && dig <= '9') @@ -62,12 +62,12 @@ read_number (const char *str, grub_size_t size) #include "cpio_common.c" -GRUB_MOD_INIT (newc) +VasEBoot_MOD_INIT (newc) { - grub_fs_register (&grub_cpio_fs); + VasEBoot_fs_register (&VasEBoot_cpio_fs); } -GRUB_MOD_FINI (newc) +VasEBoot_MOD_FINI (newc) { - grub_fs_unregister (&grub_cpio_fs); + VasEBoot_fs_unregister (&VasEBoot_cpio_fs); } diff --git a/VasEBoot-core/fs/nilfs2.c b/VasEBoot-core/fs/nilfs2.c index 598a2a55b..3de507c51 100644 --- a/VasEBoot-core/fs/nilfs2.c +++ b/VasEBoot-core/fs/nilfs2.c @@ -5,18 +5,18 @@ * * Copyright (C) 2003,2004,2005,2007,2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ @@ -26,16 +26,16 @@ #define FILETYPE_INO_DIRECTORY 0040000 #define FILETYPE_INO_SYMLINK 0120000 -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define NILFS_INODE_BMAP_SIZE 7 @@ -58,92 +58,92 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define NILFS_2ND_SUPER_BLOCK(devsize) (((devsize >> 3) - 1) << 3) #define LOG_INODE_SIZE 7 -struct grub_nilfs2_inode +struct VasEBoot_nilfs2_inode { - grub_uint64_t i_blocks; - grub_uint64_t i_size; - grub_uint64_t i_ctime; - grub_uint64_t i_mtime; - grub_uint32_t i_ctime_nsec; - grub_uint32_t i_mtime_nsec; - grub_uint32_t i_uid; - grub_uint32_t i_gid; - grub_uint16_t i_mode; - grub_uint16_t i_links_count; - grub_uint32_t i_flags; - grub_uint64_t i_bmap[NILFS_INODE_BMAP_SIZE]; + VasEBoot_uint64_t i_blocks; + VasEBoot_uint64_t i_size; + VasEBoot_uint64_t i_ctime; + VasEBoot_uint64_t i_mtime; + VasEBoot_uint32_t i_ctime_nsec; + VasEBoot_uint32_t i_mtime_nsec; + VasEBoot_uint32_t i_uid; + VasEBoot_uint32_t i_gid; + VasEBoot_uint16_t i_mode; + VasEBoot_uint16_t i_links_count; + VasEBoot_uint32_t i_flags; + VasEBoot_uint64_t i_bmap[NILFS_INODE_BMAP_SIZE]; #define i_device_code i_bmap[0] - grub_uint64_t i_xattr; - grub_uint32_t i_generation; - grub_uint32_t i_pad; + VasEBoot_uint64_t i_xattr; + VasEBoot_uint32_t i_generation; + VasEBoot_uint32_t i_pad; }; -struct grub_nilfs2_super_root +struct VasEBoot_nilfs2_super_root { - grub_uint32_t sr_sum; - grub_uint16_t sr_bytes; - grub_uint16_t sr_flags; - grub_uint64_t sr_nongc_ctime; - struct grub_nilfs2_inode sr_dat; - struct grub_nilfs2_inode sr_cpfile; - struct grub_nilfs2_inode sr_sufile; + VasEBoot_uint32_t sr_sum; + VasEBoot_uint16_t sr_bytes; + VasEBoot_uint16_t sr_flags; + VasEBoot_uint64_t sr_nongc_ctime; + struct VasEBoot_nilfs2_inode sr_dat; + struct VasEBoot_nilfs2_inode sr_cpfile; + struct VasEBoot_nilfs2_inode sr_sufile; }; -struct grub_nilfs2_super_block +struct VasEBoot_nilfs2_super_block { - grub_uint32_t s_rev_level; - grub_uint16_t s_minor_rev_level; - grub_uint16_t s_magic; - grub_uint16_t s_bytes; - grub_uint16_t s_flags; - grub_uint32_t s_crc_seed; - grub_uint32_t s_sum; - grub_uint32_t s_log_block_size; - grub_uint64_t s_nsegments; - grub_uint64_t s_dev_size; - grub_uint64_t s_first_data_block; - grub_uint32_t s_blocks_per_segment; - grub_uint32_t s_r_segments_percentage; - grub_uint64_t s_last_cno; - grub_uint64_t s_last_pseg; - grub_uint64_t s_last_seq; - grub_uint64_t s_free_blocks_count; - grub_uint64_t s_ctime; - grub_uint64_t s_mtime; - grub_uint64_t s_wtime; - grub_uint16_t s_mnt_count; - grub_uint16_t s_max_mnt_count; - grub_uint16_t s_state; - grub_uint16_t s_errors; - grub_uint64_t s_lastcheck; - grub_uint32_t s_checkinterval; - grub_uint32_t s_creator_os; - grub_uint16_t s_def_resuid; - grub_uint16_t s_def_resgid; - grub_uint32_t s_first_ino; - grub_uint16_t s_inode_size; - grub_uint16_t s_dat_entry_size; - grub_uint16_t s_checkpoint_size; - grub_uint16_t s_segment_usage_size; - grub_uint8_t s_uuid[16]; + VasEBoot_uint32_t s_rev_level; + VasEBoot_uint16_t s_minor_rev_level; + VasEBoot_uint16_t s_magic; + VasEBoot_uint16_t s_bytes; + VasEBoot_uint16_t s_flags; + VasEBoot_uint32_t s_crc_seed; + VasEBoot_uint32_t s_sum; + VasEBoot_uint32_t s_log_block_size; + VasEBoot_uint64_t s_nsegments; + VasEBoot_uint64_t s_dev_size; + VasEBoot_uint64_t s_first_data_block; + VasEBoot_uint32_t s_blocks_per_segment; + VasEBoot_uint32_t s_r_segments_percentage; + VasEBoot_uint64_t s_last_cno; + VasEBoot_uint64_t s_last_pseg; + VasEBoot_uint64_t s_last_seq; + VasEBoot_uint64_t s_free_blocks_count; + VasEBoot_uint64_t s_ctime; + VasEBoot_uint64_t s_mtime; + VasEBoot_uint64_t s_wtime; + VasEBoot_uint16_t s_mnt_count; + VasEBoot_uint16_t s_max_mnt_count; + VasEBoot_uint16_t s_state; + VasEBoot_uint16_t s_errors; + VasEBoot_uint64_t s_lastcheck; + VasEBoot_uint32_t s_checkinterval; + VasEBoot_uint32_t s_creator_os; + VasEBoot_uint16_t s_def_resuid; + VasEBoot_uint16_t s_def_resgid; + VasEBoot_uint32_t s_first_ino; + VasEBoot_uint16_t s_inode_size; + VasEBoot_uint16_t s_dat_entry_size; + VasEBoot_uint16_t s_checkpoint_size; + VasEBoot_uint16_t s_segment_usage_size; + VasEBoot_uint8_t s_uuid[16]; char s_volume_name[80]; - grub_uint32_t s_c_interval; - grub_uint32_t s_c_block_max; - grub_uint32_t s_reserved[192]; + VasEBoot_uint32_t s_c_interval; + VasEBoot_uint32_t s_c_block_max; + VasEBoot_uint32_t s_reserved[192]; }; -struct grub_nilfs2_dir_entry +struct VasEBoot_nilfs2_dir_entry { - grub_uint64_t inode; - grub_uint16_t rec_len; + VasEBoot_uint64_t inode; + VasEBoot_uint16_t rec_len; #define MAX_NAMELEN 255 - grub_uint8_t name_len; - grub_uint8_t file_type; + VasEBoot_uint8_t name_len; + VasEBoot_uint8_t file_type; #if 0 /* followed by file name. */ char name[NILFS_NAME_LEN]; char pad; #endif -} GRUB_PACKED; +} VasEBoot_PACKED; enum { @@ -158,278 +158,278 @@ enum NILFS_FT_MAX }; -struct grub_nilfs2_finfo +struct VasEBoot_nilfs2_finfo { - grub_uint64_t fi_ino; - grub_uint64_t fi_cno; - grub_uint32_t fi_nblocks; - grub_uint32_t fi_ndatablk; + VasEBoot_uint64_t fi_ino; + VasEBoot_uint64_t fi_cno; + VasEBoot_uint32_t fi_nblocks; + VasEBoot_uint32_t fi_ndatablk; }; -struct grub_nilfs2_binfo_v +struct VasEBoot_nilfs2_binfo_v { - grub_uint64_t bi_vblocknr; - grub_uint64_t bi_blkoff; + VasEBoot_uint64_t bi_vblocknr; + VasEBoot_uint64_t bi_blkoff; }; -struct grub_nilfs2_binfo_dat +struct VasEBoot_nilfs2_binfo_dat { - grub_uint64_t bi_blkoff; - grub_uint8_t bi_level; - grub_uint8_t bi_pad[7]; + VasEBoot_uint64_t bi_blkoff; + VasEBoot_uint8_t bi_level; + VasEBoot_uint8_t bi_pad[7]; }; -union grub_nilfs2_binfo +union VasEBoot_nilfs2_binfo { - struct grub_nilfs2_binfo_v bi_v; - struct grub_nilfs2_binfo_dat bi_dat; + struct VasEBoot_nilfs2_binfo_v bi_v; + struct VasEBoot_nilfs2_binfo_dat bi_dat; }; -struct grub_nilfs2_segment_summary +struct VasEBoot_nilfs2_segment_summary { - grub_uint32_t ss_datasum; - grub_uint32_t ss_sumsum; - grub_uint32_t ss_magic; - grub_uint16_t ss_bytes; - grub_uint16_t ss_flags; - grub_uint64_t ss_seq; - grub_uint64_t ss_create; - grub_uint64_t ss_next; - grub_uint32_t ss_nblocks; - grub_uint32_t ss_nfinfo; - grub_uint32_t ss_sumbytes; - grub_uint32_t ss_pad; + VasEBoot_uint32_t ss_datasum; + VasEBoot_uint32_t ss_sumsum; + VasEBoot_uint32_t ss_magic; + VasEBoot_uint16_t ss_bytes; + VasEBoot_uint16_t ss_flags; + VasEBoot_uint64_t ss_seq; + VasEBoot_uint64_t ss_create; + VasEBoot_uint64_t ss_next; + VasEBoot_uint32_t ss_nblocks; + VasEBoot_uint32_t ss_nfinfo; + VasEBoot_uint32_t ss_sumbytes; + VasEBoot_uint32_t ss_pad; }; -struct grub_nilfs2_btree_node +struct VasEBoot_nilfs2_btree_node { - grub_uint8_t bn_flags; - grub_uint8_t bn_level; - grub_uint16_t bn_nchildren; - grub_uint32_t bn_pad; - grub_uint64_t keys[0]; + VasEBoot_uint8_t bn_flags; + VasEBoot_uint8_t bn_level; + VasEBoot_uint16_t bn_nchildren; + VasEBoot_uint32_t bn_pad; + VasEBoot_uint64_t keys[0]; }; -struct grub_nilfs2_palloc_group_desc +struct VasEBoot_nilfs2_palloc_group_desc { - grub_uint32_t pg_nfrees; + VasEBoot_uint32_t pg_nfrees; }; #define LOG_SIZE_GROUP_DESC 2 #define LOG_NILFS_DAT_ENTRY_SIZE 5 -struct grub_nilfs2_dat_entry +struct VasEBoot_nilfs2_dat_entry { - grub_uint64_t de_blocknr; - grub_uint64_t de_start; - grub_uint64_t de_end; - grub_uint64_t de_rsv; + VasEBoot_uint64_t de_blocknr; + VasEBoot_uint64_t de_start; + VasEBoot_uint64_t de_end; + VasEBoot_uint64_t de_rsv; }; -struct grub_nilfs2_snapshot_list +struct VasEBoot_nilfs2_snapshot_list { - grub_uint64_t ssl_next; - grub_uint64_t ssl_prev; + VasEBoot_uint64_t ssl_next; + VasEBoot_uint64_t ssl_prev; }; -struct grub_nilfs2_cpfile_header +struct VasEBoot_nilfs2_cpfile_header { - grub_uint64_t ch_ncheckpoints; - grub_uint64_t ch_nsnapshots; - struct grub_nilfs2_snapshot_list ch_snapshot_list; + VasEBoot_uint64_t ch_ncheckpoints; + VasEBoot_uint64_t ch_nsnapshots; + struct VasEBoot_nilfs2_snapshot_list ch_snapshot_list; }; -struct grub_nilfs2_checkpoint +struct VasEBoot_nilfs2_checkpoint { - grub_uint32_t cp_flags; - grub_uint32_t cp_checkpoints_count; - struct grub_nilfs2_snapshot_list cp_snapshot_list; - grub_uint64_t cp_cno; - grub_uint64_t cp_create; - grub_uint64_t cp_nblk_inc; - grub_uint64_t cp_inodes_count; - grub_uint64_t cp_blocks_count; - struct grub_nilfs2_inode cp_ifile_inode; + VasEBoot_uint32_t cp_flags; + VasEBoot_uint32_t cp_checkpoints_count; + struct VasEBoot_nilfs2_snapshot_list cp_snapshot_list; + VasEBoot_uint64_t cp_cno; + VasEBoot_uint64_t cp_create; + VasEBoot_uint64_t cp_nblk_inc; + VasEBoot_uint64_t cp_inodes_count; + VasEBoot_uint64_t cp_blocks_count; + struct VasEBoot_nilfs2_inode cp_ifile_inode; }; #define NILFS_BMAP_LARGE 0x1 -#define NILFS_BMAP_SIZE (NILFS_INODE_BMAP_SIZE * sizeof(grub_uint64_t)) +#define NILFS_BMAP_SIZE (NILFS_INODE_BMAP_SIZE * sizeof(VasEBoot_uint64_t)) /* nilfs extra padding for nonroot btree node. */ -#define NILFS_BTREE_NODE_EXTRA_PAD_SIZE (sizeof(grub_uint64_t)) +#define NILFS_BTREE_NODE_EXTRA_PAD_SIZE (sizeof(VasEBoot_uint64_t)) #define NILFS_BTREE_ROOT_SIZE NILFS_BMAP_SIZE #define NILFS_BTREE_ROOT_NCHILDREN_MAX \ ((NILFS_BTREE_ROOT_SIZE - sizeof(struct nilfs_btree_node)) / \ - (sizeof(grub_uint64_t) + sizeof(grub_uint64_t)) ) + (sizeof(VasEBoot_uint64_t) + sizeof(VasEBoot_uint64_t)) ) -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_nilfs2_data *data; - struct grub_nilfs2_inode inode; - grub_uint64_t ino; + struct VasEBoot_nilfs2_data *data; + struct VasEBoot_nilfs2_inode inode; + VasEBoot_uint64_t ino; int inode_read; }; -struct grub_nilfs2_data +struct VasEBoot_nilfs2_data { - struct grub_nilfs2_super_block sblock; - struct grub_nilfs2_super_root sroot; - struct grub_nilfs2_inode ifile; - grub_disk_t disk; - struct grub_nilfs2_inode *inode; - struct grub_fshelp_node diropen; + struct VasEBoot_nilfs2_super_block sblock; + struct VasEBoot_nilfs2_super_root sroot; + struct VasEBoot_nilfs2_inode ifile; + VasEBoot_disk_t disk; + struct VasEBoot_nilfs2_inode *inode; + struct VasEBoot_fshelp_node diropen; }; /* Log2 size of nilfs2 block in 512 blocks. */ #define LOG2_NILFS2_BLOCK_SIZE(data) \ - (grub_le_to_cpu32 (data->sblock.s_log_block_size) + 1) + (VasEBoot_le_to_cpu32 (data->sblock.s_log_block_size) + 1) /* Log2 size of nilfs2 block in bytes. */ #define LOG2_BLOCK_SIZE(data) \ - (grub_le_to_cpu32 (data->sblock.s_log_block_size) + 10) + (VasEBoot_le_to_cpu32 (data->sblock.s_log_block_size) + 10) /* The size of an nilfs2 block in bytes. */ #define NILFS2_BLOCK_SIZE(data) (1 << LOG2_BLOCK_SIZE (data)) -static grub_uint64_t -grub_nilfs2_dat_translate (struct grub_nilfs2_data *data, grub_uint64_t key); -static grub_dl_t my_mod; +static VasEBoot_uint64_t +VasEBoot_nilfs2_dat_translate (struct VasEBoot_nilfs2_data *data, VasEBoot_uint64_t key); +static VasEBoot_dl_t my_mod; static inline unsigned long -grub_nilfs2_log_palloc_entries_per_group (struct grub_nilfs2_data *data) +VasEBoot_nilfs2_log_palloc_entries_per_group (struct VasEBoot_nilfs2_data *data) { return LOG2_BLOCK_SIZE (data) + 3; } -static inline grub_uint64_t -grub_nilfs2_palloc_group (struct grub_nilfs2_data *data, - grub_uint64_t nr, grub_uint64_t * offset) +static inline VasEBoot_uint64_t +VasEBoot_nilfs2_palloc_group (struct VasEBoot_nilfs2_data *data, + VasEBoot_uint64_t nr, VasEBoot_uint64_t * offset) { - *offset = nr & ((1 << grub_nilfs2_log_palloc_entries_per_group (data)) - 1); - return nr >> grub_nilfs2_log_palloc_entries_per_group (data); + *offset = nr & ((1 << VasEBoot_nilfs2_log_palloc_entries_per_group (data)) - 1); + return nr >> VasEBoot_nilfs2_log_palloc_entries_per_group (data); } -static inline grub_uint32_t -grub_nilfs2_palloc_log_groups_per_desc_block (struct grub_nilfs2_data *data) +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_palloc_log_groups_per_desc_block (struct VasEBoot_nilfs2_data *data) { return LOG2_BLOCK_SIZE (data) - LOG_SIZE_GROUP_DESC; - COMPILE_TIME_ASSERT (sizeof (struct grub_nilfs2_palloc_group_desc) + COMPILE_TIME_ASSERT (sizeof (struct VasEBoot_nilfs2_palloc_group_desc) == (1 << LOG_SIZE_GROUP_DESC)); } -static inline grub_uint32_t -grub_nilfs2_log_entries_per_block_log (struct grub_nilfs2_data *data, +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_log_entries_per_block_log (struct VasEBoot_nilfs2_data *data, unsigned long log_entry_size) { return LOG2_BLOCK_SIZE (data) - log_entry_size; } -static inline grub_uint32_t -grub_nilfs2_blocks_per_group_log (struct grub_nilfs2_data *data, +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_blocks_per_group_log (struct VasEBoot_nilfs2_data *data, unsigned long log_entry_size) { - return (1 << (grub_nilfs2_log_palloc_entries_per_group (data) - - grub_nilfs2_log_entries_per_block_log (data, + return (1 << (VasEBoot_nilfs2_log_palloc_entries_per_group (data) + - VasEBoot_nilfs2_log_entries_per_block_log (data, log_entry_size))) + 1; } -static inline grub_uint32_t -grub_nilfs2_blocks_per_desc_block_log (struct grub_nilfs2_data *data, +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_blocks_per_desc_block_log (struct VasEBoot_nilfs2_data *data, unsigned long log_entry_size) { - return(grub_nilfs2_blocks_per_group_log (data, log_entry_size) - << grub_nilfs2_palloc_log_groups_per_desc_block (data)) + 1; + return(VasEBoot_nilfs2_blocks_per_group_log (data, log_entry_size) + << VasEBoot_nilfs2_palloc_log_groups_per_desc_block (data)) + 1; } -static inline grub_uint32_t -grub_nilfs2_palloc_desc_block_offset_log (struct grub_nilfs2_data *data, +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_palloc_desc_block_offset_log (struct VasEBoot_nilfs2_data *data, unsigned long group, unsigned long log_entry_size) { - grub_uint32_t desc_block = - group >> grub_nilfs2_palloc_log_groups_per_desc_block (data); - return desc_block * grub_nilfs2_blocks_per_desc_block_log (data, + VasEBoot_uint32_t desc_block = + group >> VasEBoot_nilfs2_palloc_log_groups_per_desc_block (data); + return desc_block * VasEBoot_nilfs2_blocks_per_desc_block_log (data, log_entry_size); } -static inline grub_uint32_t -grub_nilfs2_palloc_bitmap_block_offset (struct grub_nilfs2_data *data, +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_palloc_bitmap_block_offset (struct VasEBoot_nilfs2_data *data, unsigned long group, unsigned long log_entry_size) { unsigned long desc_offset = group - & ((1 << grub_nilfs2_palloc_log_groups_per_desc_block (data)) - 1); + & ((1 << VasEBoot_nilfs2_palloc_log_groups_per_desc_block (data)) - 1); - return grub_nilfs2_palloc_desc_block_offset_log (data, group, log_entry_size) + return VasEBoot_nilfs2_palloc_desc_block_offset_log (data, group, log_entry_size) + 1 - + desc_offset * grub_nilfs2_blocks_per_group_log (data, log_entry_size); + + desc_offset * VasEBoot_nilfs2_blocks_per_group_log (data, log_entry_size); } -static inline grub_uint32_t -grub_nilfs2_palloc_entry_offset_log (struct grub_nilfs2_data *data, - grub_uint64_t nr, +static inline VasEBoot_uint32_t +VasEBoot_nilfs2_palloc_entry_offset_log (struct VasEBoot_nilfs2_data *data, + VasEBoot_uint64_t nr, unsigned long log_entry_size) { unsigned long group; - grub_uint64_t group_offset; + VasEBoot_uint64_t group_offset; - group = grub_nilfs2_palloc_group (data, nr, &group_offset); + group = VasEBoot_nilfs2_palloc_group (data, nr, &group_offset); - return grub_nilfs2_palloc_bitmap_block_offset (data, group, + return VasEBoot_nilfs2_palloc_bitmap_block_offset (data, group, log_entry_size) + 1 + - (group_offset >> grub_nilfs2_log_entries_per_block_log (data, + (group_offset >> VasEBoot_nilfs2_log_entries_per_block_log (data, log_entry_size)); } -static inline struct grub_nilfs2_btree_node * -grub_nilfs2_btree_get_root (struct grub_nilfs2_inode *inode) +static inline struct VasEBoot_nilfs2_btree_node * +VasEBoot_nilfs2_btree_get_root (struct VasEBoot_nilfs2_inode *inode) { - return (struct grub_nilfs2_btree_node *) &inode->i_bmap[0]; + return (struct VasEBoot_nilfs2_btree_node *) &inode->i_bmap[0]; } static inline int -grub_nilfs2_btree_get_level (struct grub_nilfs2_btree_node *node) +VasEBoot_nilfs2_btree_get_level (struct VasEBoot_nilfs2_btree_node *node) { return node->bn_level; } -static inline grub_uint64_t * -grub_nilfs2_btree_node_dkeys (struct grub_nilfs2_btree_node *node) +static inline VasEBoot_uint64_t * +VasEBoot_nilfs2_btree_node_dkeys (struct VasEBoot_nilfs2_btree_node *node) { return (node->keys + ((node->bn_flags & NILFS_BTREE_NODE_ROOT) ? - 0 : (NILFS_BTREE_NODE_EXTRA_PAD_SIZE / sizeof (grub_uint64_t)))); + 0 : (NILFS_BTREE_NODE_EXTRA_PAD_SIZE / sizeof (VasEBoot_uint64_t)))); } -static inline grub_uint64_t -grub_nilfs2_btree_node_get_key (struct grub_nilfs2_btree_node *node, +static inline VasEBoot_uint64_t +VasEBoot_nilfs2_btree_node_get_key (struct VasEBoot_nilfs2_btree_node *node, int index) { - return grub_le_to_cpu64 (*(grub_nilfs2_btree_node_dkeys (node) + index)); + return VasEBoot_le_to_cpu64 (*(VasEBoot_nilfs2_btree_node_dkeys (node) + index)); } static inline int -grub_nilfs2_btree_node_lookup (struct grub_nilfs2_btree_node *node, - grub_uint64_t key, int *indexp) +VasEBoot_nilfs2_btree_node_lookup (struct VasEBoot_nilfs2_btree_node *node, + VasEBoot_uint64_t key, int *indexp) { - grub_uint64_t nkey; + VasEBoot_uint64_t nkey; int index, low, high, s; low = 0; - high = grub_le_to_cpu16 (node->bn_nchildren) - 1; + high = VasEBoot_le_to_cpu16 (node->bn_nchildren) - 1; index = 0; s = 0; while (low <= high) { index = (low + high) / 2; - nkey = grub_nilfs2_btree_node_get_key (node, index); + nkey = VasEBoot_nilfs2_btree_node_get_key (node, index); if (nkey == key) { *indexp = index; @@ -460,176 +460,176 @@ grub_nilfs2_btree_node_lookup (struct grub_nilfs2_btree_node *node, } static inline int -grub_nilfs2_btree_node_nchildren_max (struct grub_nilfs2_data *data, - struct grub_nilfs2_btree_node *node) +VasEBoot_nilfs2_btree_node_nchildren_max (struct VasEBoot_nilfs2_data *data, + struct VasEBoot_nilfs2_btree_node *node) { int node_children_max = ((NILFS2_BLOCK_SIZE (data) - - sizeof (struct grub_nilfs2_btree_node) - + sizeof (struct VasEBoot_nilfs2_btree_node) - NILFS_BTREE_NODE_EXTRA_PAD_SIZE) / - (sizeof (grub_uint64_t) + sizeof (grub_uint64_t))); + (sizeof (VasEBoot_uint64_t) + sizeof (VasEBoot_uint64_t))); return (node->bn_flags & NILFS_BTREE_NODE_ROOT) ? 3 : node_children_max; } -static inline grub_uint64_t * -grub_nilfs2_btree_node_dptrs (struct grub_nilfs2_data *data, - struct grub_nilfs2_btree_node *node) +static inline VasEBoot_uint64_t * +VasEBoot_nilfs2_btree_node_dptrs (struct VasEBoot_nilfs2_data *data, + struct VasEBoot_nilfs2_btree_node *node) { - return (grub_uint64_t *) (grub_nilfs2_btree_node_dkeys (node) + - grub_nilfs2_btree_node_nchildren_max (data, + return (VasEBoot_uint64_t *) (VasEBoot_nilfs2_btree_node_dkeys (node) + + VasEBoot_nilfs2_btree_node_nchildren_max (data, node)); } -static inline grub_uint64_t -grub_nilfs2_btree_node_get_ptr (struct grub_nilfs2_data *data, - struct grub_nilfs2_btree_node *node, +static inline VasEBoot_uint64_t +VasEBoot_nilfs2_btree_node_get_ptr (struct VasEBoot_nilfs2_data *data, + struct VasEBoot_nilfs2_btree_node *node, int index) { return - grub_le_to_cpu64 (*(grub_nilfs2_btree_node_dptrs (data, node) + index)); + VasEBoot_le_to_cpu64 (*(VasEBoot_nilfs2_btree_node_dptrs (data, node) + index)); } static inline int -grub_nilfs2_btree_get_nonroot_node (struct grub_nilfs2_data *data, - grub_uint64_t ptr, void *block) +VasEBoot_nilfs2_btree_get_nonroot_node (struct VasEBoot_nilfs2_data *data, + VasEBoot_uint64_t ptr, void *block) { - grub_disk_t disk = data->disk; + VasEBoot_disk_t disk = data->disk; unsigned int nilfs2_block_count = (1 << LOG2_NILFS2_BLOCK_SIZE (data)); - return grub_disk_read (disk, ptr * nilfs2_block_count, 0, + return VasEBoot_disk_read (disk, ptr * nilfs2_block_count, 0, NILFS2_BLOCK_SIZE (data), block); } -static grub_uint64_t -grub_nilfs2_btree_lookup (struct grub_nilfs2_data *data, - struct grub_nilfs2_inode *inode, - grub_uint64_t key, int need_translate) +static VasEBoot_uint64_t +VasEBoot_nilfs2_btree_lookup (struct VasEBoot_nilfs2_data *data, + struct VasEBoot_nilfs2_inode *inode, + VasEBoot_uint64_t key, int need_translate) { - struct grub_nilfs2_btree_node *node; + struct VasEBoot_nilfs2_btree_node *node; void *block; - grub_uint64_t ptr; + VasEBoot_uint64_t ptr; int level, found = 0, index; - block = grub_malloc (NILFS2_BLOCK_SIZE (data)); + block = VasEBoot_malloc (NILFS2_BLOCK_SIZE (data)); if (!block) return -1; - node = grub_nilfs2_btree_get_root (inode); - level = grub_nilfs2_btree_get_level (node); + node = VasEBoot_nilfs2_btree_get_root (inode); + level = VasEBoot_nilfs2_btree_get_level (node); - found = grub_nilfs2_btree_node_lookup (node, key, &index); - ptr = grub_nilfs2_btree_node_get_ptr (data, node, index); + found = VasEBoot_nilfs2_btree_node_lookup (node, key, &index); + ptr = VasEBoot_nilfs2_btree_node_get_ptr (data, node, index); if (need_translate) - ptr = grub_nilfs2_dat_translate (data, ptr); + ptr = VasEBoot_nilfs2_dat_translate (data, ptr); for (level--; level >= NILFS_BTREE_LEVEL_NODE_MIN; level--) { - grub_nilfs2_btree_get_nonroot_node (data, ptr, block); - if (grub_errno) + VasEBoot_nilfs2_btree_get_nonroot_node (data, ptr, block); + if (VasEBoot_errno) { goto fail; } - node = (struct grub_nilfs2_btree_node *) block; + node = (struct VasEBoot_nilfs2_btree_node *) block; if (node->bn_level != level) { - grub_error (GRUB_ERR_BAD_FS, "btree level mismatch\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "btree level mismatch\n"); goto fail; } if (!found) - found = grub_nilfs2_btree_node_lookup (node, key, &index); + found = VasEBoot_nilfs2_btree_node_lookup (node, key, &index); else index = 0; - if (index < grub_nilfs2_btree_node_nchildren_max (data, node)) + if (index < VasEBoot_nilfs2_btree_node_nchildren_max (data, node)) { - ptr = grub_nilfs2_btree_node_get_ptr (data, node, index); + ptr = VasEBoot_nilfs2_btree_node_get_ptr (data, node, index); if (need_translate) - ptr = grub_nilfs2_dat_translate (data, ptr); + ptr = VasEBoot_nilfs2_dat_translate (data, ptr); } else { - grub_error (GRUB_ERR_BAD_FS, "btree corruption\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "btree corruption\n"); goto fail; } } - grub_free (block); + VasEBoot_free (block); if (!found) return -1; return ptr; fail: - grub_free (block); + VasEBoot_free (block); return -1; } -static inline grub_uint64_t -grub_nilfs2_direct_lookup (struct grub_nilfs2_inode *inode, grub_uint64_t key) +static inline VasEBoot_uint64_t +VasEBoot_nilfs2_direct_lookup (struct VasEBoot_nilfs2_inode *inode, VasEBoot_uint64_t key) { - return grub_le_to_cpu64 (inode->i_bmap[1 + key]); + return VasEBoot_le_to_cpu64 (inode->i_bmap[1 + key]); } -static inline grub_uint64_t -grub_nilfs2_bmap_lookup (struct grub_nilfs2_data *data, - struct grub_nilfs2_inode *inode, - grub_uint64_t key, int need_translate) +static inline VasEBoot_uint64_t +VasEBoot_nilfs2_bmap_lookup (struct VasEBoot_nilfs2_data *data, + struct VasEBoot_nilfs2_inode *inode, + VasEBoot_uint64_t key, int need_translate) { - struct grub_nilfs2_btree_node *root = grub_nilfs2_btree_get_root (inode); + struct VasEBoot_nilfs2_btree_node *root = VasEBoot_nilfs2_btree_get_root (inode); if (root->bn_flags & NILFS_BMAP_LARGE) - return grub_nilfs2_btree_lookup (data, inode, key, need_translate); + return VasEBoot_nilfs2_btree_lookup (data, inode, key, need_translate); else { - grub_uint64_t ptr; - ptr = grub_nilfs2_direct_lookup (inode, key); + VasEBoot_uint64_t ptr; + ptr = VasEBoot_nilfs2_direct_lookup (inode, key); if (need_translate) - ptr = grub_nilfs2_dat_translate (data, ptr); + ptr = VasEBoot_nilfs2_dat_translate (data, ptr); return ptr; } } -static grub_uint64_t -grub_nilfs2_dat_translate (struct grub_nilfs2_data *data, grub_uint64_t key) +static VasEBoot_uint64_t +VasEBoot_nilfs2_dat_translate (struct VasEBoot_nilfs2_data *data, VasEBoot_uint64_t key) { - struct grub_nilfs2_dat_entry entry; - grub_disk_t disk = data->disk; - grub_uint64_t pptr; - grub_uint64_t blockno, offset; + struct VasEBoot_nilfs2_dat_entry entry; + VasEBoot_disk_t disk = data->disk; + VasEBoot_uint64_t pptr; + VasEBoot_uint64_t blockno, offset; unsigned int nilfs2_block_count = (1 << LOG2_NILFS2_BLOCK_SIZE (data)); - blockno = grub_nilfs2_palloc_entry_offset_log (data, key, + blockno = VasEBoot_nilfs2_palloc_entry_offset_log (data, key, LOG_NILFS_DAT_ENTRY_SIZE); - offset = ((key * sizeof (struct grub_nilfs2_dat_entry)) + offset = ((key * sizeof (struct VasEBoot_nilfs2_dat_entry)) & ((1 << LOG2_BLOCK_SIZE (data)) - 1)); - pptr = grub_nilfs2_bmap_lookup (data, &data->sroot.sr_dat, blockno, 0); - if (pptr == (grub_uint64_t) - 1) + pptr = VasEBoot_nilfs2_bmap_lookup (data, &data->sroot.sr_dat, blockno, 0); + if (pptr == (VasEBoot_uint64_t) - 1) { - grub_error (GRUB_ERR_BAD_FS, "btree lookup failure"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "btree lookup failure"); return -1; } - grub_disk_read (disk, pptr * nilfs2_block_count, offset, - sizeof (struct grub_nilfs2_dat_entry), &entry); + VasEBoot_disk_read (disk, pptr * nilfs2_block_count, offset, + sizeof (struct VasEBoot_nilfs2_dat_entry), &entry); - return grub_le_to_cpu64 (entry.de_blocknr); + return VasEBoot_le_to_cpu64 (entry.de_blocknr); } -static grub_disk_addr_t -grub_nilfs2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_nilfs2_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { - struct grub_nilfs2_data *data = node->data; - struct grub_nilfs2_inode *inode = &node->inode; - grub_uint64_t pptr = -1; + struct VasEBoot_nilfs2_data *data = node->data; + struct VasEBoot_nilfs2_inode *inode = &node->inode; + VasEBoot_uint64_t pptr = -1; - pptr = grub_nilfs2_bmap_lookup (data, inode, fileblock, 1); - if (pptr == (grub_uint64_t) - 1) + pptr = VasEBoot_nilfs2_bmap_lookup (data, inode, fileblock, 1); + if (pptr == (VasEBoot_uint64_t) - 1) { - grub_error (GRUB_ERR_BAD_FS, "btree lookup failure"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "btree lookup failure"); return -1; } @@ -638,271 +638,271 @@ grub_nilfs2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_nilfs2_read_file (grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_nilfs2_read_file (VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - return grub_fshelp_read_file (node->data->disk, node, + return VasEBoot_fshelp_read_file (node->data->disk, node, read_hook, read_hook_data, - pos, len, buf, grub_nilfs2_read_block, - grub_le_to_cpu64 (node->inode.i_size), + pos, len, buf, VasEBoot_nilfs2_read_block, + VasEBoot_le_to_cpu64 (node->inode.i_size), LOG2_NILFS2_BLOCK_SIZE (node->data), 0); } -static grub_err_t -grub_nilfs2_read_checkpoint (struct grub_nilfs2_data *data, - grub_uint64_t cpno, - struct grub_nilfs2_checkpoint *cpp) +static VasEBoot_err_t +VasEBoot_nilfs2_read_checkpoint (struct VasEBoot_nilfs2_data *data, + VasEBoot_uint64_t cpno, + struct VasEBoot_nilfs2_checkpoint *cpp) { - grub_uint64_t blockno; - grub_uint64_t offset; - grub_uint64_t pptr; - grub_disk_t disk = data->disk; + VasEBoot_uint64_t blockno; + VasEBoot_uint64_t offset; + VasEBoot_uint64_t pptr; + VasEBoot_disk_t disk = data->disk; unsigned int nilfs2_block_count = (1 << LOG2_NILFS2_BLOCK_SIZE (data)); - /* Assume sizeof(struct grub_nilfs2_cpfile_header) < - sizeof(struct grub_nilfs2_checkpoint). + /* Assume sizeof(struct VasEBoot_nilfs2_cpfile_header) < + sizeof(struct VasEBoot_nilfs2_checkpoint). */ - blockno = grub_divmod64 (cpno, NILFS2_BLOCK_SIZE (data) / - sizeof (struct grub_nilfs2_checkpoint), &offset); + blockno = VasEBoot_divmod64 (cpno, NILFS2_BLOCK_SIZE (data) / + sizeof (struct VasEBoot_nilfs2_checkpoint), &offset); - pptr = grub_nilfs2_bmap_lookup (data, &data->sroot.sr_cpfile, blockno, 1); - if (pptr == (grub_uint64_t) - 1) + pptr = VasEBoot_nilfs2_bmap_lookup (data, &data->sroot.sr_cpfile, blockno, 1); + if (pptr == (VasEBoot_uint64_t) - 1) { - return grub_error (GRUB_ERR_BAD_FS, "btree lookup failure"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "btree lookup failure"); } - return grub_disk_read (disk, pptr * nilfs2_block_count, - offset * sizeof (struct grub_nilfs2_checkpoint), - sizeof (struct grub_nilfs2_checkpoint), cpp); + return VasEBoot_disk_read (disk, pptr * nilfs2_block_count, + offset * sizeof (struct VasEBoot_nilfs2_checkpoint), + sizeof (struct VasEBoot_nilfs2_checkpoint), cpp); } -static inline grub_err_t -grub_nilfs2_read_last_checkpoint (struct grub_nilfs2_data *data, - struct grub_nilfs2_checkpoint *cpp) +static inline VasEBoot_err_t +VasEBoot_nilfs2_read_last_checkpoint (struct VasEBoot_nilfs2_data *data, + struct VasEBoot_nilfs2_checkpoint *cpp) { - return grub_nilfs2_read_checkpoint (data, - grub_le_to_cpu64 (data-> + return VasEBoot_nilfs2_read_checkpoint (data, + VasEBoot_le_to_cpu64 (data-> sblock.s_last_cno), cpp); } /* Read the inode INO for the file described by DATA into INODE. */ -static grub_err_t -grub_nilfs2_read_inode (struct grub_nilfs2_data *data, - grub_uint64_t ino, struct grub_nilfs2_inode *inodep) +static VasEBoot_err_t +VasEBoot_nilfs2_read_inode (struct VasEBoot_nilfs2_data *data, + VasEBoot_uint64_t ino, struct VasEBoot_nilfs2_inode *inodep) { - grub_uint64_t blockno; - grub_uint64_t offset; - grub_uint64_t pptr; - grub_disk_t disk = data->disk; + VasEBoot_uint64_t blockno; + VasEBoot_uint64_t offset; + VasEBoot_uint64_t pptr; + VasEBoot_disk_t disk = data->disk; unsigned int nilfs2_block_count = (1 << LOG2_NILFS2_BLOCK_SIZE (data)); - blockno = grub_nilfs2_palloc_entry_offset_log (data, ino, + blockno = VasEBoot_nilfs2_palloc_entry_offset_log (data, ino, LOG_INODE_SIZE); - offset = ((sizeof (struct grub_nilfs2_inode) * ino) + offset = ((sizeof (struct VasEBoot_nilfs2_inode) * ino) & ((1 << LOG2_BLOCK_SIZE (data)) - 1)); - pptr = grub_nilfs2_bmap_lookup (data, &data->ifile, blockno, 1); - if (pptr == (grub_uint64_t) - 1) + pptr = VasEBoot_nilfs2_bmap_lookup (data, &data->ifile, blockno, 1); + if (pptr == (VasEBoot_uint64_t) - 1) { - return grub_error (GRUB_ERR_BAD_FS, "btree lookup failure"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "btree lookup failure"); } - return grub_disk_read (disk, pptr * nilfs2_block_count, offset, - sizeof (struct grub_nilfs2_inode), inodep); + return VasEBoot_disk_read (disk, pptr * nilfs2_block_count, offset, + sizeof (struct VasEBoot_nilfs2_inode), inodep); } static int -grub_nilfs2_valid_sb (struct grub_nilfs2_super_block *sbp) +VasEBoot_nilfs2_valid_sb (struct VasEBoot_nilfs2_super_block *sbp) { - if (grub_le_to_cpu16 (sbp->s_magic) != NILFS2_SUPER_MAGIC) + if (VasEBoot_le_to_cpu16 (sbp->s_magic) != NILFS2_SUPER_MAGIC) return 0; - if (grub_le_to_cpu32 (sbp->s_rev_level) != NILFS_SUPORT_REV) + if (VasEBoot_le_to_cpu32 (sbp->s_rev_level) != NILFS_SUPORT_REV) return 0; /* 20 already means 1GiB blocks. We don't want to deal with blocks overflowing int32. */ - if (grub_le_to_cpu32 (sbp->s_log_block_size) > 20) + if (VasEBoot_le_to_cpu32 (sbp->s_log_block_size) > 20) return 0; return 1; } -static grub_err_t -grub_nilfs2_load_sb (struct grub_nilfs2_data *data) +static VasEBoot_err_t +VasEBoot_nilfs2_load_sb (struct VasEBoot_nilfs2_data *data) { - grub_disk_t disk = data->disk; - struct grub_nilfs2_super_block sb2; - grub_uint64_t partition_size; + VasEBoot_disk_t disk = data->disk; + struct VasEBoot_nilfs2_super_block sb2; + VasEBoot_uint64_t partition_size; int valid[2]; int swp = 0; - grub_err_t err; + VasEBoot_err_t err; /* Read first super block. */ - err = grub_disk_read (disk, NILFS_1ST_SUPER_BLOCK, 0, - sizeof (struct grub_nilfs2_super_block), &data->sblock); + err = VasEBoot_disk_read (disk, NILFS_1ST_SUPER_BLOCK, 0, + sizeof (struct VasEBoot_nilfs2_super_block), &data->sblock); if (err) return err; /* Make sure if 1st super block is valid. */ - valid[0] = grub_nilfs2_valid_sb (&data->sblock); + valid[0] = VasEBoot_nilfs2_valid_sb (&data->sblock); if (valid[0]) - partition_size = (grub_le_to_cpu64 (data->sblock.s_dev_size) - >> GRUB_DISK_SECTOR_BITS); + partition_size = (VasEBoot_le_to_cpu64 (data->sblock.s_dev_size) + >> VasEBoot_DISK_SECTOR_BITS); else - partition_size = grub_disk_get_size (disk); - if (partition_size != GRUB_DISK_SIZE_UNKNOWN) + partition_size = VasEBoot_disk_get_size (disk); + if (partition_size != VasEBoot_DISK_SIZE_UNKNOWN) { /* Read second super block. */ - err = grub_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0, - sizeof (struct grub_nilfs2_super_block), &sb2); + err = VasEBoot_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0, + sizeof (struct VasEBoot_nilfs2_super_block), &sb2); if (err) { valid[1] = 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } else /* Make sure if 2nd super block is valid. */ - valid[1] = grub_nilfs2_valid_sb (&sb2); + valid[1] = VasEBoot_nilfs2_valid_sb (&sb2); } else /* 2nd super block may not exist, so it's invalid. */ valid[1] = 0; if (!valid[0] && !valid[1]) - return grub_error (GRUB_ERR_BAD_FS, "not a nilfs2 filesystem"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a nilfs2 filesystem"); swp = valid[1] && (!valid[0] || - grub_le_to_cpu64 (data->sblock.s_last_cno) < - grub_le_to_cpu64 (sb2.s_last_cno)); + VasEBoot_le_to_cpu64 (data->sblock.s_last_cno) < + VasEBoot_le_to_cpu64 (sb2.s_last_cno)); /* swap if first super block is invalid or older than second one. */ if (swp) - grub_memcpy (&data->sblock, &sb2, - sizeof (struct grub_nilfs2_super_block)); + VasEBoot_memcpy (&data->sblock, &sb2, + sizeof (struct VasEBoot_nilfs2_super_block)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_nilfs2_data * -grub_nilfs2_mount (grub_disk_t disk) +static struct VasEBoot_nilfs2_data * +VasEBoot_nilfs2_mount (VasEBoot_disk_t disk) { - struct grub_nilfs2_data *data; - struct grub_nilfs2_segment_summary ss; - struct grub_nilfs2_checkpoint last_checkpoint; - grub_uint64_t last_pseg; - grub_uint32_t nblocks; + struct VasEBoot_nilfs2_data *data; + struct VasEBoot_nilfs2_segment_summary ss; + struct VasEBoot_nilfs2_checkpoint last_checkpoint; + VasEBoot_uint64_t last_pseg; + VasEBoot_uint32_t nblocks; unsigned int nilfs2_block_count; - data = grub_malloc (sizeof (struct grub_nilfs2_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_nilfs2_data)); if (!data) return 0; data->disk = disk; /* Read the superblock. */ - grub_nilfs2_load_sb (data); - if (grub_errno) + VasEBoot_nilfs2_load_sb (data); + if (VasEBoot_errno) goto fail; nilfs2_block_count = (1 << LOG2_NILFS2_BLOCK_SIZE (data)); /* Read the last segment summary. */ - last_pseg = grub_le_to_cpu64 (data->sblock.s_last_pseg); - grub_disk_read (disk, last_pseg * nilfs2_block_count, 0, - sizeof (struct grub_nilfs2_segment_summary), &ss); + last_pseg = VasEBoot_le_to_cpu64 (data->sblock.s_last_pseg); + VasEBoot_disk_read (disk, last_pseg * nilfs2_block_count, 0, + sizeof (struct VasEBoot_nilfs2_segment_summary), &ss); - if (grub_errno) + if (VasEBoot_errno) goto fail; /* Read the super root block. */ - nblocks = grub_le_to_cpu32 (ss.ss_nblocks); - grub_disk_read (disk, (last_pseg + (nblocks - 1)) * nilfs2_block_count, 0, - sizeof (struct grub_nilfs2_super_root), &data->sroot); + nblocks = VasEBoot_le_to_cpu32 (ss.ss_nblocks); + VasEBoot_disk_read (disk, (last_pseg + (nblocks - 1)) * nilfs2_block_count, 0, + sizeof (struct VasEBoot_nilfs2_super_root), &data->sroot); - if (grub_errno) + if (VasEBoot_errno) goto fail; - grub_nilfs2_read_last_checkpoint (data, &last_checkpoint); + VasEBoot_nilfs2_read_last_checkpoint (data, &last_checkpoint); - if (grub_errno) + if (VasEBoot_errno) goto fail; - grub_memcpy (&data->ifile, &last_checkpoint.cp_ifile_inode, - sizeof (struct grub_nilfs2_inode)); + VasEBoot_memcpy (&data->ifile, &last_checkpoint.cp_ifile_inode, + sizeof (struct VasEBoot_nilfs2_inode)); data->diropen.data = data; data->diropen.ino = 2; data->diropen.inode_read = 1; data->inode = &data->diropen.inode; - grub_nilfs2_read_inode (data, 2, data->inode); + VasEBoot_nilfs2_read_inode (data, 2, data->inode); return data; fail: - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a nilfs2 filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a nilfs2 filesystem"); - grub_free (data); + VasEBoot_free (data); return 0; } static char * -grub_nilfs2_read_symlink (grub_fshelp_node_t node) +VasEBoot_nilfs2_read_symlink (VasEBoot_fshelp_node_t node) { char *symlink; - struct grub_fshelp_node *diro = node; + struct VasEBoot_fshelp_node *diro = node; if (!diro->inode_read) { - grub_nilfs2_read_inode (diro->data, diro->ino, &diro->inode); - if (grub_errno) + VasEBoot_nilfs2_read_inode (diro->data, diro->ino, &diro->inode); + if (VasEBoot_errno) return 0; } - symlink = grub_malloc (grub_le_to_cpu64 (diro->inode.i_size) + 1); + symlink = VasEBoot_malloc (VasEBoot_le_to_cpu64 (diro->inode.i_size) + 1); if (!symlink) return 0; - grub_nilfs2_read_file (diro, 0, 0, 0, - grub_le_to_cpu64 (diro->inode.i_size), symlink); - if (grub_errno) + VasEBoot_nilfs2_read_file (diro, 0, 0, 0, + VasEBoot_le_to_cpu64 (diro->inode.i_size), symlink); + if (VasEBoot_errno) { - grub_free (symlink); + VasEBoot_free (symlink); return 0; } - symlink[grub_le_to_cpu64 (diro->inode.i_size)] = '\0'; + symlink[VasEBoot_le_to_cpu64 (diro->inode.i_size)] = '\0'; return symlink; } static int -grub_nilfs2_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_nilfs2_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_off_t fpos = 0; - struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; + VasEBoot_off_t fpos = 0; + struct VasEBoot_fshelp_node *diro = (struct VasEBoot_fshelp_node *) dir; if (!diro->inode_read) { - grub_nilfs2_read_inode (diro->data, diro->ino, &diro->inode); - if (grub_errno) + VasEBoot_nilfs2_read_inode (diro->data, diro->ino, &diro->inode); + if (VasEBoot_errno) return 0; } /* Iterate files. */ - while (fpos < grub_le_to_cpu64 (diro->inode.i_size)) + while (fpos < VasEBoot_le_to_cpu64 (diro->inode.i_size)) { - struct grub_nilfs2_dir_entry dirent; + struct VasEBoot_nilfs2_dir_entry dirent; - grub_nilfs2_read_file (diro, 0, 0, fpos, - sizeof (struct grub_nilfs2_dir_entry), + VasEBoot_nilfs2_read_file (diro, 0, 0, fpos, + sizeof (struct VasEBoot_nilfs2_dir_entry), (char *) &dirent); - if (grub_errno) + if (VasEBoot_errno) return 0; if (dirent.rec_len == 0) @@ -911,21 +911,21 @@ grub_nilfs2_iterate_dir (grub_fshelp_node_t dir, if (dirent.name_len != 0) { char filename[MAX_NAMELEN + 1]; - struct grub_fshelp_node *fdiro; - enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN; + struct VasEBoot_fshelp_node *fdiro; + enum VasEBoot_fshelp_filetype type = VasEBoot_FSHELP_UNKNOWN; - grub_nilfs2_read_file (diro, 0, 0, - fpos + sizeof (struct grub_nilfs2_dir_entry), + VasEBoot_nilfs2_read_file (diro, 0, 0, + fpos + sizeof (struct VasEBoot_nilfs2_dir_entry), dirent.name_len, filename); - if (grub_errno) + if (VasEBoot_errno) return 0; - fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); + fdiro = VasEBoot_malloc (sizeof (struct VasEBoot_fshelp_node)); if (!fdiro) return 0; fdiro->data = diro->data; - fdiro->ino = grub_le_to_cpu64 (dirent.inode); + fdiro->ino = VasEBoot_le_to_cpu64 (dirent.inode); filename[dirent.name_len] = '\0'; @@ -934,78 +934,78 @@ grub_nilfs2_iterate_dir (grub_fshelp_node_t dir, fdiro->inode_read = 0; if (dirent.file_type == NILFS_FT_DIR) - type = GRUB_FSHELP_DIR; + type = VasEBoot_FSHELP_DIR; else if (dirent.file_type == NILFS_FT_SYMLINK) - type = GRUB_FSHELP_SYMLINK; + type = VasEBoot_FSHELP_SYMLINK; else if (dirent.file_type == NILFS_FT_REG_FILE) - type = GRUB_FSHELP_REG; + type = VasEBoot_FSHELP_REG; } else { /* The filetype can not be read from the dirent, read the inode to get more information. */ - grub_nilfs2_read_inode (diro->data, - grub_le_to_cpu64 (dirent.inode), + VasEBoot_nilfs2_read_inode (diro->data, + VasEBoot_le_to_cpu64 (dirent.inode), &fdiro->inode); - if (grub_errno) + if (VasEBoot_errno) { - grub_free (fdiro); + VasEBoot_free (fdiro); return 0; } fdiro->inode_read = 1; - if ((grub_le_to_cpu16 (fdiro->inode.i_mode) + if ((VasEBoot_le_to_cpu16 (fdiro->inode.i_mode) & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY) - type = GRUB_FSHELP_DIR; - else if ((grub_le_to_cpu16 (fdiro->inode.i_mode) + type = VasEBoot_FSHELP_DIR; + else if ((VasEBoot_le_to_cpu16 (fdiro->inode.i_mode) & FILETYPE_INO_MASK) == FILETYPE_INO_SYMLINK) - type = GRUB_FSHELP_SYMLINK; - else if ((grub_le_to_cpu16 (fdiro->inode.i_mode) + type = VasEBoot_FSHELP_SYMLINK; + else if ((VasEBoot_le_to_cpu16 (fdiro->inode.i_mode) & FILETYPE_INO_MASK) == FILETYPE_INO_REG) - type = GRUB_FSHELP_REG; + type = VasEBoot_FSHELP_REG; } if (hook (filename, type, fdiro, hook_data)) return 1; } - fpos += grub_le_to_cpu16 (dirent.rec_len); + fpos += VasEBoot_le_to_cpu16 (dirent.rec_len); } return 0; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_nilfs2_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_nilfs2_open (struct VasEBoot_file *file, const char *name) { - struct grub_nilfs2_data *data = NULL; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_nilfs2_data *data = NULL; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_nilfs2_mount (file->device->disk); + data = VasEBoot_nilfs2_mount (file->device->disk); if (!data) goto fail; - grub_fshelp_find_file (name, &data->diropen, &fdiro, - grub_nilfs2_iterate_dir, grub_nilfs2_read_symlink, - GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &data->diropen, &fdiro, + VasEBoot_nilfs2_iterate_dir, VasEBoot_nilfs2_read_symlink, + VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; if (!fdiro->inode_read) { - grub_nilfs2_read_inode (data, fdiro->ino, &fdiro->inode); - if (grub_errno) + VasEBoot_nilfs2_read_inode (data, fdiro->ino, &fdiro->inode); + if (VasEBoot_errno) goto fail; } - grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_nilfs2_inode)); - grub_free (fdiro); + VasEBoot_memcpy (data->inode, &fdiro->inode, sizeof (struct VasEBoot_nilfs2_inode)); + VasEBoot_free (fdiro); - file->size = grub_le_to_cpu64 (data->inode->i_size); + file->size = VasEBoot_le_to_cpu64 (data->inode->i_size); file->data = data; file->offset = 0; @@ -1013,139 +1013,139 @@ grub_nilfs2_open (struct grub_file *file, const char *name) fail: if (fdiro != &data->diropen) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_nilfs2_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_nilfs2_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read LEN bytes data from FILE into BUF. */ -static grub_ssize_t -grub_nilfs2_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_nilfs2_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_nilfs2_data *data = (struct grub_nilfs2_data *) file->data; + struct VasEBoot_nilfs2_data *data = (struct VasEBoot_nilfs2_data *) file->data; - return grub_nilfs2_read_file (&data->diropen, + return VasEBoot_nilfs2_read_file (&data->diropen, file->read_hook, file->read_hook_data, file->offset, len, buf); } -/* Context for grub_nilfs2_dir. */ -struct grub_nilfs2_dir_ctx +/* Context for VasEBoot_nilfs2_dir. */ +struct VasEBoot_nilfs2_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; - struct grub_nilfs2_data *data; + struct VasEBoot_nilfs2_data *data; }; -/* Helper for grub_nilfs2_dir. */ +/* Helper for VasEBoot_nilfs2_dir. */ static int -grub_nilfs2_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_nilfs2_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_nilfs2_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_nilfs2_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); if (!node->inode_read) { - grub_nilfs2_read_inode (ctx->data, node->ino, &node->inode); - if (!grub_errno) + VasEBoot_nilfs2_read_inode (ctx->data, node->ino, &node->inode); + if (!VasEBoot_errno) node->inode_read = 1; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (node->inode_read) { info.mtimeset = 1; - info.mtime = grub_le_to_cpu64 (node->inode.i_mtime); + info.mtime = VasEBoot_le_to_cpu64 (node->inode.i_mtime); } - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); - grub_free (node); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_nilfs2_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_nilfs2_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_nilfs2_dir_ctx ctx = { + struct VasEBoot_nilfs2_dir_ctx ctx = { .hook = hook, .hook_data = hook_data }; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - ctx.data = grub_nilfs2_mount (device->disk); + ctx.data = VasEBoot_nilfs2_mount (device->disk); if (!ctx.data) goto fail; - grub_fshelp_find_file (path, &ctx.data->diropen, &fdiro, - grub_nilfs2_iterate_dir, grub_nilfs2_read_symlink, - GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &ctx.data->diropen, &fdiro, + VasEBoot_nilfs2_iterate_dir, VasEBoot_nilfs2_read_symlink, + VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_nilfs2_iterate_dir (fdiro, grub_nilfs2_dir_iter, &ctx); + VasEBoot_nilfs2_iterate_dir (fdiro, VasEBoot_nilfs2_dir_iter, &ctx); fail: if (fdiro != &ctx.data->diropen) - grub_free (fdiro); - grub_free (ctx.data); + VasEBoot_free (fdiro); + VasEBoot_free (ctx.data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_nilfs2_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_nilfs2_label (VasEBoot_device_t device, char **label) { - struct grub_nilfs2_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_nilfs2_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_nilfs2_mount (disk); + data = VasEBoot_nilfs2_mount (disk); if (data) - *label = grub_strndup (data->sblock.s_volume_name, + *label = VasEBoot_strndup (data->sblock.s_volume_name, sizeof (data->sblock.s_volume_name)); else *label = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_nilfs2_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_nilfs2_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_nilfs2_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_nilfs2_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_nilfs2_mount (disk); + data = VasEBoot_nilfs2_mount (disk); if (data) { *uuid = - grub_xasprintf + VasEBoot_xasprintf ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", data->sblock.s_uuid[0], data->sblock.s_uuid[1], data->sblock.s_uuid[2], data->sblock.s_uuid[3], @@ -1159,65 +1159,65 @@ grub_nilfs2_uuid (grub_device_t device, char **uuid) else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } /* Get mtime. */ -static grub_err_t -grub_nilfs2_mtime (grub_device_t device, grub_int32_t * tm) +static VasEBoot_err_t +VasEBoot_nilfs2_mtime (VasEBoot_device_t device, VasEBoot_int32_t * tm) { - struct grub_nilfs2_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_nilfs2_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_nilfs2_mount (disk); + data = VasEBoot_nilfs2_mount (disk); if (!data) *tm = 0; else - *tm = (grub_int32_t) grub_le_to_cpu64 (data->sblock.s_wtime); + *tm = (VasEBoot_int32_t) VasEBoot_le_to_cpu64 (data->sblock.s_wtime); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_nilfs2_fs = { +static struct VasEBoot_fs VasEBoot_nilfs2_fs = { .name = "nilfs2", - .dir = grub_nilfs2_dir, - .open = grub_nilfs2_open, - .read = grub_nilfs2_read, - .close = grub_nilfs2_close, - .label = grub_nilfs2_label, - .uuid = grub_nilfs2_uuid, - .mtime = grub_nilfs2_mtime, -#ifdef GRUB_UTIL + .dir = VasEBoot_nilfs2_dir, + .open = VasEBoot_nilfs2_open, + .read = VasEBoot_nilfs2_read, + .close = VasEBoot_nilfs2_close, + .label = VasEBoot_nilfs2_label, + .uuid = VasEBoot_nilfs2_uuid, + .mtime = VasEBoot_nilfs2_mtime, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 0, #endif .next = 0 }; -GRUB_MOD_INIT (nilfs2) +VasEBoot_MOD_INIT (nilfs2) { COMPILE_TIME_ASSERT ((1 << LOG_NILFS_DAT_ENTRY_SIZE) == sizeof (struct - grub_nilfs2_dat_entry)); + VasEBoot_nilfs2_dat_entry)); COMPILE_TIME_ASSERT (1 << LOG_INODE_SIZE - == sizeof (struct grub_nilfs2_inode)); - grub_fs_register (&grub_nilfs2_fs); + == sizeof (struct VasEBoot_nilfs2_inode)); + VasEBoot_fs_register (&VasEBoot_nilfs2_fs); my_mod = mod; } -GRUB_MOD_FINI (nilfs2) +VasEBoot_MOD_FINI (nilfs2) { - grub_fs_unregister (&grub_nilfs2_fs); + VasEBoot_fs_unregister (&VasEBoot_nilfs2_fs); } diff --git a/VasEBoot-core/fs/ntfs.c b/VasEBoot-core/fs/ntfs.c index 6f8468862..f7433d2e4 100644 --- a/VasEBoot-core/fs/ntfs.c +++ b/VasEBoot-core/fs/ntfs.c @@ -1,6 +1,6 @@ /* ntfs.c - NTFS filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,67 +17,67 @@ * along with this program. If not, see . */ -#define grub_fshelp_node grub_ntfs_file +#define VasEBoot_fshelp_node VasEBoot_ntfs_file -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -#define grub_fshelp_node grub_ntfs_file +#define VasEBoot_fshelp_node VasEBoot_ntfs_file -static inline grub_uint16_t -u16at (void *ptr, grub_size_t ofs) +static inline VasEBoot_uint16_t +u16at (void *ptr, VasEBoot_size_t ofs) { - return grub_le_to_cpu16 (grub_get_unaligned16 ((char *) ptr + ofs)); + return VasEBoot_le_to_cpu16 (VasEBoot_get_unaligned16 ((char *) ptr + ofs)); } -static inline grub_uint32_t -u32at (void *ptr, grub_size_t ofs) +static inline VasEBoot_uint32_t +u32at (void *ptr, VasEBoot_size_t ofs) { - return grub_le_to_cpu32 (grub_get_unaligned32 ((char *) ptr + ofs)); + return VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 ((char *) ptr + ofs)); } -static inline grub_uint64_t -u64at (void *ptr, grub_size_t ofs) +static inline VasEBoot_uint64_t +u64at (void *ptr, VasEBoot_size_t ofs) { - return grub_le_to_cpu64 (grub_get_unaligned64 ((char *) ptr + ofs)); + return VasEBoot_le_to_cpu64 (VasEBoot_get_unaligned64 ((char *) ptr + ofs)); } -grub_ntfscomp_func_t grub_ntfscomp_func; +VasEBoot_ntfscomp_func_t VasEBoot_ntfscomp_func; -static grub_err_t -fixup (grub_uint8_t *buf, grub_size_t len, const grub_uint8_t *magic) +static VasEBoot_err_t +fixup (VasEBoot_uint8_t *buf, VasEBoot_size_t len, const VasEBoot_uint8_t *magic) { - grub_uint16_t ss; - grub_uint8_t *pu; - grub_uint16_t us; + VasEBoot_uint16_t ss; + VasEBoot_uint8_t *pu; + VasEBoot_uint16_t us; - COMPILE_TIME_ASSERT ((1 << GRUB_NTFS_BLK_SHR) == GRUB_DISK_SECTOR_SIZE); + COMPILE_TIME_ASSERT ((1 << VasEBoot_NTFS_BLK_SHR) == VasEBoot_DISK_SECTOR_SIZE); - if (grub_memcmp (buf, magic, 4)) - return grub_error (GRUB_ERR_BAD_FS, "%s label not found", magic); + if (VasEBoot_memcmp (buf, magic, 4)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "%s label not found", magic); ss = u16at (buf, 6) - 1; if (ss != len) - return grub_error (GRUB_ERR_BAD_FS, "size not match"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "size not match"); pu = buf + u16at (buf, 4); us = u16at (pu, 0); buf -= 2; while (ss > 0) { - buf += GRUB_DISK_SECTOR_SIZE; + buf += VasEBoot_DISK_SECTOR_SIZE; pu += 2; if (u16at (buf, 0) != us) - return grub_error (GRUB_ERR_BAD_FS, "fixup signature not match"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "fixup signature not match"); buf[0] = pu[0]; buf[1] = pu[1]; ss--; @@ -86,42 +86,42 @@ fixup (grub_uint8_t *buf, grub_size_t len, const grub_uint8_t *magic) return 0; } -static grub_err_t read_mft (struct grub_ntfs_data *data, grub_uint8_t *buf, - grub_uint64_t mftno); -static grub_err_t read_attr (struct grub_ntfs_attr *at, grub_uint8_t *dest, - grub_disk_addr_t ofs, grub_size_t len, +static VasEBoot_err_t read_mft (struct VasEBoot_ntfs_data *data, VasEBoot_uint8_t *buf, + VasEBoot_uint64_t mftno); +static VasEBoot_err_t read_attr (struct VasEBoot_ntfs_attr *at, VasEBoot_uint8_t *dest, + VasEBoot_disk_addr_t ofs, VasEBoot_size_t len, int cached, - grub_disk_read_hook_t read_hook, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data); -static grub_err_t read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, - grub_uint8_t *dest, - grub_disk_addr_t ofs, grub_size_t len, +static VasEBoot_err_t read_data (struct VasEBoot_ntfs_attr *at, VasEBoot_uint8_t *pa, + VasEBoot_uint8_t *dest, + VasEBoot_disk_addr_t ofs, VasEBoot_size_t len, int cached, - grub_disk_read_hook_t read_hook, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data); static void -init_attr (struct grub_ntfs_attr *at, struct grub_ntfs_file *mft) +init_attr (struct VasEBoot_ntfs_attr *at, struct VasEBoot_ntfs_file *mft) { at->mft = mft; - at->flags = (mft == &mft->data->mmft) ? GRUB_NTFS_AF_MMFT : 0; + at->flags = (mft == &mft->data->mmft) ? VasEBoot_NTFS_AF_MMFT : 0; at->attr_nxt = mft->buf + u16at (mft->buf, 0x14); at->attr_end = at->emft_buf = at->edat_buf = at->sbuf = NULL; } static void -free_attr (struct grub_ntfs_attr *at) +free_attr (struct VasEBoot_ntfs_attr *at) { - grub_free (at->emft_buf); - grub_free (at->edat_buf); - grub_free (at->sbuf); + VasEBoot_free (at->emft_buf); + VasEBoot_free (at->edat_buf); + VasEBoot_free (at->sbuf); } -static grub_uint8_t * -find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) +static VasEBoot_uint8_t * +find_attr (struct VasEBoot_ntfs_attr *at, VasEBoot_uint8_t attr) { - if (at->flags & GRUB_NTFS_AF_ALST) + if (at->flags & VasEBoot_NTFS_AF_ALST) { retry: while (at->attr_nxt < at->attr_end) @@ -130,21 +130,21 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) at->attr_nxt += u16at (at->attr_cur, 4); if ((*at->attr_cur == attr) || (attr == 0)) { - grub_uint8_t *new_pos; + VasEBoot_uint8_t *new_pos; - if (at->flags & GRUB_NTFS_AF_MMFT) + if (at->flags & VasEBoot_NTFS_AF_MMFT) { - if ((grub_disk_read + if ((VasEBoot_disk_read (at->mft->data->disk, u32at (at->attr_cur, 0x10), 0, 512, at->emft_buf)) || - (grub_disk_read + (VasEBoot_disk_read (at->mft->data->disk, u32at (at->attr_cur, 0x14), 0, 512, at->emft_buf + 512))) return NULL; if (fixup (at->emft_buf, at->mft->data->mft_size, - (const grub_uint8_t *) "FILE")) + (const VasEBoot_uint8_t *) "FILE")) return NULL; } else @@ -164,7 +164,7 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) } new_pos += u16at (new_pos, 4); } - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, "can\'t find 0x%X in attribute list", (unsigned char) *at->attr_cur); return NULL; @@ -176,7 +176,7 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) while (*at->attr_cur != 0xFF) { at->attr_nxt += u16at (at->attr_cur, 4); - if (*at->attr_cur == GRUB_NTFS_AT_ATTRIBUTE_LIST) + if (*at->attr_cur == VasEBoot_NTFS_AT_ATTRIBUTE_LIST) at->attr_end = at->attr_cur; if ((*at->attr_cur == attr) || (attr == 0)) return at->attr_cur; @@ -184,26 +184,26 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) } if (at->attr_end) { - grub_uint8_t *pa; + VasEBoot_uint8_t *pa; - at->emft_buf = grub_malloc (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR); + at->emft_buf = VasEBoot_malloc (at->mft->data->mft_size << VasEBoot_NTFS_BLK_SHR); if (at->emft_buf == NULL) return NULL; pa = at->attr_end; if (pa[8]) { - grub_uint32_t n; + VasEBoot_uint32_t n; - n = ((u32at (pa, 0x30) + GRUB_DISK_SECTOR_SIZE - 1) - & (~(GRUB_DISK_SECTOR_SIZE - 1))); + n = ((u32at (pa, 0x30) + VasEBoot_DISK_SECTOR_SIZE - 1) + & (~(VasEBoot_DISK_SECTOR_SIZE - 1))); at->attr_cur = at->attr_end; - at->edat_buf = grub_malloc (n); + at->edat_buf = VasEBoot_malloc (n); if (!at->edat_buf) return NULL; if (read_data (at, pa, at->edat_buf, 0, n, 0, 0, 0)) { - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, "fail to read non-resident attribute list"); return NULL; } @@ -215,7 +215,7 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) at->attr_nxt = at->attr_end + u16at (pa, 0x14); at->attr_end = at->attr_end + u32at (pa, 4); } - at->flags |= GRUB_NTFS_AF_ALST; + at->flags |= VasEBoot_NTFS_AF_ALST; while (at->attr_nxt < at->attr_end) { if ((*at->attr_nxt == attr) || (attr == 0)) @@ -225,15 +225,15 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) if (at->attr_nxt >= at->attr_end) return NULL; - if ((at->flags & GRUB_NTFS_AF_MMFT) && (attr == GRUB_NTFS_AT_DATA)) + if ((at->flags & VasEBoot_NTFS_AF_MMFT) && (attr == VasEBoot_NTFS_AT_DATA)) { - at->flags |= GRUB_NTFS_AF_GPOS; + at->flags |= VasEBoot_NTFS_AF_GPOS; at->attr_cur = at->attr_nxt; pa = at->attr_cur; - grub_set_unaligned32 ((char *) pa + 0x10, - grub_cpu_to_le32 (at->mft->data->mft_start)); - grub_set_unaligned32 ((char *) pa + 0x14, - grub_cpu_to_le32 (at->mft->data->mft_start + VasEBoot_set_unaligned32 ((char *) pa + 0x10, + VasEBoot_cpu_to_le32 (at->mft->data->mft_start)); + VasEBoot_set_unaligned32 ((char *) pa + 0x14, + VasEBoot_cpu_to_le32 (at->mft->data->mft_start + 1)); pa = at->attr_nxt + u16at (pa, 4); while (pa < at->attr_end) @@ -242,40 +242,40 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr) break; if (read_attr (at, pa + 0x10, - u32at (pa, 0x10) * (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR), - at->mft->data->mft_size << GRUB_NTFS_BLK_SHR, 0, 0, 0)) + u32at (pa, 0x10) * (at->mft->data->mft_size << VasEBoot_NTFS_BLK_SHR), + at->mft->data->mft_size << VasEBoot_NTFS_BLK_SHR, 0, 0, 0)) return NULL; pa += u16at (pa, 4); } at->attr_nxt = at->attr_cur; - at->flags &= ~GRUB_NTFS_AF_GPOS; + at->flags &= ~VasEBoot_NTFS_AF_GPOS; } goto retry; } return NULL; } -static grub_uint8_t * -locate_attr (struct grub_ntfs_attr *at, struct grub_ntfs_file *mft, - grub_uint8_t attr) +static VasEBoot_uint8_t * +locate_attr (struct VasEBoot_ntfs_attr *at, struct VasEBoot_ntfs_file *mft, + VasEBoot_uint8_t attr) { - grub_uint8_t *pa; + VasEBoot_uint8_t *pa; init_attr (at, mft); pa = find_attr (at, attr); if (pa == NULL) return NULL; - if ((at->flags & GRUB_NTFS_AF_ALST) == 0) + if ((at->flags & VasEBoot_NTFS_AF_ALST) == 0) { while (1) { pa = find_attr (at, attr); if (pa == NULL) break; - if (at->flags & GRUB_NTFS_AF_ALST) + if (at->flags & VasEBoot_NTFS_AF_ALST) return pa; } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; free_attr (at); init_attr (at, mft); pa = find_attr (at, attr); @@ -283,25 +283,25 @@ locate_attr (struct grub_ntfs_attr *at, struct grub_ntfs_file *mft, return pa; } -static grub_disk_addr_t -read_run_data (const grub_uint8_t *run, int nn, int sig) +static VasEBoot_disk_addr_t +read_run_data (const VasEBoot_uint8_t *run, int nn, int sig) { - grub_uint64_t r = 0; + VasEBoot_uint64_t r = 0; if (sig && nn && (run[nn - 1] & 0x80)) r = -1; - grub_memcpy (&r, run, nn); + VasEBoot_memcpy (&r, run, nn); - return grub_le_to_cpu64 (r); + return VasEBoot_le_to_cpu64 (r); } -grub_err_t -grub_ntfs_read_run_list (struct grub_ntfs_rlst * ctx) +VasEBoot_err_t +VasEBoot_ntfs_read_run_list (struct VasEBoot_ntfs_rlst * ctx) { - grub_uint8_t c1, c2; - grub_disk_addr_t val; - grub_uint8_t *run; + VasEBoot_uint8_t c1, c2; + VasEBoot_disk_addr_t val; + VasEBoot_uint8_t *run; run = ctx->cur_run; retry: @@ -310,9 +310,9 @@ retry: run++; if (!c1) { - if ((ctx->attr) && (ctx->attr->flags & GRUB_NTFS_AF_ALST)) + if ((ctx->attr) && (ctx->attr->flags & VasEBoot_NTFS_AF_ALST)) { - grub_disk_read_hook_t save_hook; + VasEBoot_disk_read_hook_t save_hook; save_hook = ctx->comp.disk->read_hook; ctx->comp.disk->read_hook = 0; @@ -321,7 +321,7 @@ retry: if (run) { if (run[8] == 0) - return grub_error (GRUB_ERR_BAD_FS, + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "$DATA should be non-resident"); run += u16at (run, 0x20); @@ -329,7 +329,7 @@ retry: goto retry; } } - return grub_error (GRUB_ERR_BAD_FS, "run list overflown"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "run list overflown"); } ctx->curr_vcn = ctx->next_vcn; ctx->next_vcn += read_run_data (run, c1, 0); /* length of current VCN */ @@ -338,54 +338,54 @@ retry: run += c2; ctx->curr_lcn += val; if (val == 0) - ctx->flags |= GRUB_NTFS_RF_BLNK; + ctx->flags |= VasEBoot_NTFS_RF_BLNK; else - ctx->flags &= ~GRUB_NTFS_RF_BLNK; + ctx->flags &= ~VasEBoot_NTFS_RF_BLNK; ctx->cur_run = run; return 0; } -static grub_disk_addr_t -grub_ntfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t block) +static VasEBoot_disk_addr_t +VasEBoot_ntfs_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t block) { - struct grub_ntfs_rlst *ctx; + struct VasEBoot_ntfs_rlst *ctx; - ctx = (struct grub_ntfs_rlst *) node; + ctx = (struct VasEBoot_ntfs_rlst *) node; if (block >= ctx->next_vcn) { - if (grub_ntfs_read_run_list (ctx)) + if (VasEBoot_ntfs_read_run_list (ctx)) return -1; return ctx->curr_lcn; } else - return (ctx->flags & GRUB_NTFS_RF_BLNK) ? 0 : (block - + return (ctx->flags & VasEBoot_NTFS_RF_BLNK) ? 0 : (block - ctx->curr_vcn + ctx->curr_lcn); } -static grub_err_t -read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, grub_uint8_t *dest, - grub_disk_addr_t ofs, grub_size_t len, int cached, - grub_disk_read_hook_t read_hook, void *read_hook_data) +static VasEBoot_err_t +read_data (struct VasEBoot_ntfs_attr *at, VasEBoot_uint8_t *pa, VasEBoot_uint8_t *dest, + VasEBoot_disk_addr_t ofs, VasEBoot_size_t len, int cached, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data) { - struct grub_ntfs_rlst cc, *ctx; + struct VasEBoot_ntfs_rlst cc, *ctx; if (len == 0) return 0; - grub_memset (&cc, 0, sizeof (cc)); + VasEBoot_memset (&cc, 0, sizeof (cc)); ctx = &cc; ctx->attr = at; ctx->comp.log_spc = at->mft->data->log_spc; ctx->comp.disk = at->mft->data->disk; - if (read_hook == grub_file_progress_hook) + if (read_hook == VasEBoot_file_progress_hook) ctx->file = read_hook_data; if (pa[8] == 0) { if (ofs + len > u32at (pa, 0x10)) - return grub_error (GRUB_ERR_BAD_FS, "read out of range"); - grub_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "read out of range"); + VasEBoot_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len); return 0; } @@ -394,30 +394,30 @@ read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, grub_uint8_t *dest, ctx->next_vcn = u32at (pa, 0x10); ctx->curr_lcn = 0; - if ((pa[0xC] & GRUB_NTFS_FLAG_COMPRESSED) - && !(at->flags & GRUB_NTFS_AF_GPOS)) + if ((pa[0xC] & VasEBoot_NTFS_FLAG_COMPRESSED) + && !(at->flags & VasEBoot_NTFS_AF_GPOS)) { if (!cached) - return grub_error (GRUB_ERR_BAD_FS, "attribute can\'t be compressed"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "attribute can\'t be compressed"); - return (grub_ntfscomp_func) ? grub_ntfscomp_func (dest, ofs, len, ctx) - : grub_error (GRUB_ERR_BAD_FS, N_("module `%s' isn't loaded"), + return (VasEBoot_ntfscomp_func) ? VasEBoot_ntfscomp_func (dest, ofs, len, ctx) + : VasEBoot_error (VasEBoot_ERR_BAD_FS, N_("module `%s' isn't loaded"), "ntfscomp"); } - ctx->target_vcn = ofs >> (GRUB_NTFS_BLK_SHR + ctx->comp.log_spc); + ctx->target_vcn = ofs >> (VasEBoot_NTFS_BLK_SHR + ctx->comp.log_spc); while (ctx->next_vcn <= ctx->target_vcn) { - if (grub_ntfs_read_run_list (ctx)) - return grub_errno; + if (VasEBoot_ntfs_read_run_list (ctx)) + return VasEBoot_errno; } - if (at->flags & GRUB_NTFS_AF_GPOS) + if (at->flags & VasEBoot_NTFS_AF_GPOS) { - grub_disk_addr_t st0, st1; - grub_uint64_t m; + VasEBoot_disk_addr_t st0, st1; + VasEBoot_uint64_t m; - m = (ofs >> GRUB_NTFS_BLK_SHR) & ((1 << ctx->comp.log_spc) - 1); + m = (ofs >> VasEBoot_NTFS_BLK_SHR) & ((1 << ctx->comp.log_spc) - 1); st0 = ((ctx->target_vcn - ctx->curr_vcn + ctx->curr_lcn) << ctx->comp.log_spc) + m; @@ -425,48 +425,48 @@ read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, grub_uint8_t *dest, if (st1 == (ctx->next_vcn - ctx->curr_vcn + ctx->curr_lcn) << ctx->comp.log_spc) { - if (grub_ntfs_read_run_list (ctx)) - return grub_errno; + if (VasEBoot_ntfs_read_run_list (ctx)) + return VasEBoot_errno; st1 = ctx->curr_lcn << ctx->comp.log_spc; } - grub_set_unaligned32 (dest, grub_cpu_to_le32 (st0)); - grub_set_unaligned32 (dest + 4, grub_cpu_to_le32 (st1)); + VasEBoot_set_unaligned32 (dest, VasEBoot_cpu_to_le32 (st0)); + VasEBoot_set_unaligned32 (dest + 4, VasEBoot_cpu_to_le32 (st1)); return 0; } - grub_fshelp_read_file (ctx->comp.disk, (grub_fshelp_node_t) ctx, + VasEBoot_fshelp_read_file (ctx->comp.disk, (VasEBoot_fshelp_node_t) ctx, read_hook, read_hook_data, ofs, len, (char *) dest, - grub_ntfs_read_block, ofs + len, + VasEBoot_ntfs_read_block, ofs + len, ctx->comp.log_spc, 0); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -read_attr (struct grub_ntfs_attr *at, grub_uint8_t *dest, grub_disk_addr_t ofs, - grub_size_t len, int cached, - grub_disk_read_hook_t read_hook, void *read_hook_data) +static VasEBoot_err_t +read_attr (struct VasEBoot_ntfs_attr *at, VasEBoot_uint8_t *dest, VasEBoot_disk_addr_t ofs, + VasEBoot_size_t len, int cached, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data) { - grub_uint8_t *save_cur; - grub_uint8_t attr; - grub_uint8_t *pp; - grub_err_t ret; + VasEBoot_uint8_t *save_cur; + VasEBoot_uint8_t attr; + VasEBoot_uint8_t *pp; + VasEBoot_err_t ret; save_cur = at->attr_cur; at->attr_nxt = at->attr_cur; attr = *at->attr_nxt; - if (at->flags & GRUB_NTFS_AF_ALST) + if (at->flags & VasEBoot_NTFS_AF_ALST) { - grub_uint8_t *pa; - grub_disk_addr_t vcn; + VasEBoot_uint8_t *pa; + VasEBoot_disk_addr_t vcn; /* If compression is possible make sure that we include possible compressed block size. */ - if (GRUB_NTFS_LOG_COM_SEC >= at->mft->data->log_spc) - vcn = ((ofs >> GRUB_NTFS_COM_LOG_LEN) - << (GRUB_NTFS_LOG_COM_SEC - at->mft->data->log_spc)) & ~0xFULL; + if (VasEBoot_NTFS_LOG_COM_SEC >= at->mft->data->log_spc) + vcn = ((ofs >> VasEBoot_NTFS_COM_LOG_LEN) + << (VasEBoot_NTFS_LOG_COM_SEC - at->mft->data->log_spc)) & ~0xFULL; else - vcn = ofs >> (at->mft->data->log_spc + GRUB_NTFS_BLK_SHR); + vcn = ofs >> (at->mft->data->log_spc + VasEBoot_NTFS_BLK_SHR); pa = at->attr_nxt + u16at (at->attr_nxt, 4); while (pa < at->attr_end) { @@ -484,48 +484,48 @@ read_attr (struct grub_ntfs_attr *at, grub_uint8_t *dest, grub_disk_addr_t ofs, read_hook, read_hook_data); else ret = - (grub_errno) ? grub_errno : grub_error (GRUB_ERR_BAD_FS, + (VasEBoot_errno) ? VasEBoot_errno : VasEBoot_error (VasEBoot_ERR_BAD_FS, "attribute not found"); at->attr_cur = save_cur; return ret; } -static grub_err_t -read_mft (struct grub_ntfs_data *data, grub_uint8_t *buf, grub_uint64_t mftno) +static VasEBoot_err_t +read_mft (struct VasEBoot_ntfs_data *data, VasEBoot_uint8_t *buf, VasEBoot_uint64_t mftno) { if (read_attr - (&data->mmft.attr, buf, mftno * ((grub_disk_addr_t) data->mft_size << GRUB_NTFS_BLK_SHR), - data->mft_size << GRUB_NTFS_BLK_SHR, 0, 0, 0)) - return grub_error (GRUB_ERR_BAD_FS, "read MFT 0x%llx fails", (unsigned long long) mftno); - return fixup (buf, data->mft_size, (const grub_uint8_t *) "FILE"); + (&data->mmft.attr, buf, mftno * ((VasEBoot_disk_addr_t) data->mft_size << VasEBoot_NTFS_BLK_SHR), + data->mft_size << VasEBoot_NTFS_BLK_SHR, 0, 0, 0)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "read MFT 0x%llx fails", (unsigned long long) mftno); + return fixup (buf, data->mft_size, (const VasEBoot_uint8_t *) "FILE"); } -static grub_err_t -init_file (struct grub_ntfs_file *mft, grub_uint64_t mftno) +static VasEBoot_err_t +init_file (struct VasEBoot_ntfs_file *mft, VasEBoot_uint64_t mftno) { unsigned short flag; mft->inode_read = 1; - mft->buf = grub_malloc (mft->data->mft_size << GRUB_NTFS_BLK_SHR); + mft->buf = VasEBoot_malloc (mft->data->mft_size << VasEBoot_NTFS_BLK_SHR); if (mft->buf == NULL) - return grub_errno; + return VasEBoot_errno; if (read_mft (mft->data, mft->buf, mftno)) - return grub_errno; + return VasEBoot_errno; flag = u16at (mft->buf, 0x16); if ((flag & 1) == 0) - return grub_error (GRUB_ERR_BAD_FS, "MFT 0x%llx is not in use", + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "MFT 0x%llx is not in use", (unsigned long long) mftno); if ((flag & 2) == 0) { - grub_uint8_t *pa; + VasEBoot_uint8_t *pa; - pa = locate_attr (&mft->attr, mft, GRUB_NTFS_AT_DATA); + pa = locate_attr (&mft->attr, mft, VasEBoot_NTFS_AT_DATA); if (pa == NULL) - return grub_error (GRUB_ERR_BAD_FS, "no $DATA in MFT 0x%llx", + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "no $DATA in MFT 0x%llx", (unsigned long long) mftno); if (!pa[8]) @@ -533,7 +533,7 @@ init_file (struct grub_ntfs_file *mft, grub_uint64_t mftno) else mft->size = u64at (pa, 0x30); - if ((mft->attr.flags & GRUB_NTFS_AF_ALST) == 0) + if ((mft->attr.flags & VasEBoot_NTFS_AF_ALST) == 0) mft->attr.attr_end = 0; /* Don't jump to attribute list */ } else @@ -543,44 +543,44 @@ init_file (struct grub_ntfs_file *mft, grub_uint64_t mftno) } static void -free_file (struct grub_ntfs_file *mft) +free_file (struct VasEBoot_ntfs_file *mft) { free_attr (&mft->attr); - grub_free (mft->buf); + VasEBoot_free (mft->buf); } static char * -get_utf8 (grub_uint8_t *in, grub_size_t len) +get_utf8 (VasEBoot_uint8_t *in, VasEBoot_size_t len) { - grub_uint8_t *buf; - grub_uint16_t *tmp; - grub_size_t i; + VasEBoot_uint8_t *buf; + VasEBoot_uint16_t *tmp; + VasEBoot_size_t i; - buf = grub_malloc (len * GRUB_MAX_UTF8_PER_UTF16 + 1); - tmp = grub_malloc (len * sizeof (tmp[0])); + buf = VasEBoot_malloc (len * VasEBoot_MAX_UTF8_PER_UTF16 + 1); + tmp = VasEBoot_malloc (len * sizeof (tmp[0])); if (!buf || !tmp) { - grub_free (buf); - grub_free (tmp); + VasEBoot_free (buf); + VasEBoot_free (tmp); return NULL; } for (i = 0; i < len; i++) - tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 (in + 2 * i)); - *grub_utf16_to_utf8 (buf, tmp, len) = '\0'; - grub_free (tmp); + tmp[i] = VasEBoot_le_to_cpu16 (VasEBoot_get_unaligned16 (in + 2 * i)); + *VasEBoot_utf16_to_utf8 (buf, tmp, len) = '\0'; + VasEBoot_free (tmp); return (char *) buf; } static int -list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +list_file (struct VasEBoot_ntfs_file *diro, VasEBoot_uint8_t *pos, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_uint8_t *np; + VasEBoot_uint8_t *np; int ns; while (1) { - grub_uint8_t namespace; + VasEBoot_uint8_t namespace; char *ustr; if (pos[0xC] & 2) /* end signature */ @@ -596,19 +596,19 @@ list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos, */ if ((ns) && (namespace != 2)) { - enum grub_fshelp_filetype type; - struct grub_ntfs_file *fdiro; - grub_uint32_t attr; + enum VasEBoot_fshelp_filetype type; + struct VasEBoot_ntfs_file *fdiro; + VasEBoot_uint32_t attr; attr = u32at (pos, 0x48); - if (attr & GRUB_NTFS_ATTR_REPARSE) - type = GRUB_FSHELP_SYMLINK; - else if (attr & GRUB_NTFS_ATTR_DIRECTORY) - type = GRUB_FSHELP_DIR; + if (attr & VasEBoot_NTFS_ATTR_REPARSE) + type = VasEBoot_FSHELP_SYMLINK; + else if (attr & VasEBoot_NTFS_ATTR_DIRECTORY) + type = VasEBoot_FSHELP_DIR; else - type = GRUB_FSHELP_REG; + type = VasEBoot_FSHELP_REG; - fdiro = grub_zalloc (sizeof (struct grub_ntfs_file)); + fdiro = VasEBoot_zalloc (sizeof (struct VasEBoot_ntfs_file)); if (!fdiro) return 0; @@ -619,19 +619,19 @@ list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos, ustr = get_utf8 (np, ns); if (ustr == NULL) { - grub_free (fdiro); + VasEBoot_free (fdiro); return 0; } if (namespace) - type |= GRUB_FSHELP_CASE_INSENSITIVE; + type |= VasEBoot_FSHELP_CASE_INSENSITIVE; if (hook (ustr, type, fdiro, hook_data)) { - grub_free (ustr); + VasEBoot_free (ustr); return 1; } - grub_free (ustr); + VasEBoot_free (ustr); } pos += u16at (pos, 8); } @@ -640,67 +640,67 @@ list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos, struct symlink_descriptor { - grub_uint32_t type; - grub_uint32_t total_len; - grub_uint16_t off1; - grub_uint16_t len1; - grub_uint16_t off2; - grub_uint16_t len2; -} GRUB_PACKED; + VasEBoot_uint32_t type; + VasEBoot_uint32_t total_len; + VasEBoot_uint16_t off1; + VasEBoot_uint16_t len1; + VasEBoot_uint16_t off2; + VasEBoot_uint16_t len2; +} VasEBoot_PACKED; static char * -grub_ntfs_read_symlink (grub_fshelp_node_t node) +VasEBoot_ntfs_read_symlink (VasEBoot_fshelp_node_t node) { - struct grub_ntfs_file *mft; + struct VasEBoot_ntfs_file *mft; struct symlink_descriptor symdesc; - grub_err_t err; - grub_uint8_t *buf16; + VasEBoot_err_t err; + VasEBoot_uint8_t *buf16; char *buf, *end; - grub_size_t len; - grub_uint8_t *pa; - grub_size_t off; + VasEBoot_size_t len; + VasEBoot_uint8_t *pa; + VasEBoot_size_t off; - mft = (struct grub_ntfs_file *) node; + mft = (struct VasEBoot_ntfs_file *) node; - mft->buf = grub_malloc (mft->data->mft_size << GRUB_NTFS_BLK_SHR); + mft->buf = VasEBoot_malloc (mft->data->mft_size << VasEBoot_NTFS_BLK_SHR); if (mft->buf == NULL) return NULL; if (read_mft (mft->data, mft->buf, mft->ino)) return NULL; - pa = locate_attr (&mft->attr, mft, GRUB_NTFS_AT_SYMLINK); + pa = locate_attr (&mft->attr, mft, VasEBoot_NTFS_AT_SYMLINK); if (pa == NULL) { - grub_error (GRUB_ERR_BAD_FS, "no $SYMLINK in MFT 0x%llx", + VasEBoot_error (VasEBoot_ERR_BAD_FS, "no $SYMLINK in MFT 0x%llx", (unsigned long long) mft->ino); return NULL; } - err = read_attr (&mft->attr, (grub_uint8_t *) &symdesc, 0, + err = read_attr (&mft->attr, (VasEBoot_uint8_t *) &symdesc, 0, sizeof (struct symlink_descriptor), 1, 0, 0); if (err) return NULL; - switch (grub_cpu_to_le32 (symdesc.type)) + switch (VasEBoot_cpu_to_le32 (symdesc.type)) { case 0xa000000c: off = (sizeof (struct symlink_descriptor) + 4 - + grub_cpu_to_le32 (symdesc.off1)); - len = grub_cpu_to_le32 (symdesc.len1); + + VasEBoot_cpu_to_le32 (symdesc.off1)); + len = VasEBoot_cpu_to_le32 (symdesc.len1); break; case 0xa0000003: off = (sizeof (struct symlink_descriptor) - + grub_cpu_to_le32 (symdesc.off1)); - len = grub_cpu_to_le32 (symdesc.len1); + + VasEBoot_cpu_to_le32 (symdesc.off1)); + len = VasEBoot_cpu_to_le32 (symdesc.len1); break; default: - grub_error (GRUB_ERR_BAD_FS, "symlink type invalid (%x)", - grub_cpu_to_le32 (symdesc.type)); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "symlink type invalid (%x)", + VasEBoot_cpu_to_le32 (symdesc.type)); return NULL; } - buf16 = grub_malloc (len); + buf16 = VasEBoot_malloc (len); if (!buf16) return NULL; @@ -711,37 +711,37 @@ grub_ntfs_read_symlink (grub_fshelp_node_t node) buf = get_utf8 (buf16, len / 2); if (!buf) { - grub_free (buf16); + VasEBoot_free (buf16); return NULL; } - grub_free (buf16); + VasEBoot_free (buf16); for (end = buf; *end; end++) if (*end == '\\') *end = '/'; /* Split the sequence to avoid GCC thinking that this is a trigraph. */ - if (grub_memcmp (buf, "/?" "?/", 4) == 0 && buf[5] == ':' && buf[6] == '/' - && grub_isalpha (buf[4])) + if (VasEBoot_memcmp (buf, "/?" "?/", 4) == 0 && buf[5] == ':' && buf[6] == '/' + && VasEBoot_isalpha (buf[4])) { - grub_memmove (buf, buf + 6, end - buf + 1 - 6); + VasEBoot_memmove (buf, buf + 6, end - buf + 1 - 6); end -= 6; } return buf; } static int -grub_ntfs_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_ntfs_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_uint8_t *bitmap; - struct grub_ntfs_attr attr, *at; - grub_uint8_t *cur_pos, *indx, *bmp; + VasEBoot_uint8_t *bitmap; + struct VasEBoot_ntfs_attr attr, *at; + VasEBoot_uint8_t *cur_pos, *indx, *bmp; int ret = 0; - grub_size_t bitmap_len; - struct grub_ntfs_file *mft; + VasEBoot_size_t bitmap_len; + struct VasEBoot_ntfs_file *mft; - mft = (struct grub_ntfs_file *) dir; + mft = (struct VasEBoot_ntfs_file *) dir; if (!mft->inode_read) { @@ -756,10 +756,10 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, init_attr (at, mft); while (1) { - cur_pos = find_attr (at, GRUB_NTFS_AT_INDEX_ROOT); + cur_pos = find_attr (at, VasEBoot_NTFS_AT_INDEX_ROOT); if (cur_pos == NULL) { - grub_error (GRUB_ERR_BAD_FS, "no $INDEX_ROOT"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "no $INDEX_ROOT"); goto done; } @@ -783,7 +783,7 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, bitmap_len = 0; free_attr (at); init_attr (at, mft); - while ((cur_pos = find_attr (at, GRUB_NTFS_AT_BITMAP)) != NULL) + while ((cur_pos = find_attr (at, VasEBoot_NTFS_AT_BITMAP)) != NULL) { int ofs; @@ -798,20 +798,20 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, bitmap_len = ((is_resident) ? u32at (cur_pos, 0x10) : u32at (cur_pos, 0x28)); - bmp = grub_malloc (bitmap_len); + bmp = VasEBoot_malloc (bitmap_len); if (bmp == NULL) goto done; if (is_resident) { - grub_memcpy (bmp, cur_pos + u16at (cur_pos, 0x14), + VasEBoot_memcpy (bmp, cur_pos + u16at (cur_pos, 0x14), bitmap_len); } else { if (read_data (at, cur_pos, bmp, 0, bitmap_len, 0, 0, 0)) { - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, "fails to read non-resident $BITMAP"); goto done; } @@ -824,7 +824,7 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, } free_attr (at); - cur_pos = locate_attr (at, mft, GRUB_NTFS_AT_INDEX_ALLOCATION); + cur_pos = locate_attr (at, mft, VasEBoot_NTFS_AT_INDEX_ALLOCATION); while (cur_pos != NULL) { /* Non-resident, Namelen=4, Offset=0x40, Flags=0, Name="$I30" */ @@ -832,34 +832,34 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, (u32at (cur_pos, 0x40) == 0x490024) && (u32at (cur_pos, 0x44) == 0x300033)) break; - cur_pos = find_attr (at, GRUB_NTFS_AT_INDEX_ALLOCATION); + cur_pos = find_attr (at, VasEBoot_NTFS_AT_INDEX_ALLOCATION); } if ((!cur_pos) && (bitmap)) { - grub_error (GRUB_ERR_BAD_FS, "$BITMAP without $INDEX_ALLOCATION"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "$BITMAP without $INDEX_ALLOCATION"); goto done; } if (bitmap) { - grub_disk_addr_t i; - grub_uint8_t v; + VasEBoot_disk_addr_t i; + VasEBoot_uint8_t v; - indx = grub_malloc (mft->data->idx_size << GRUB_NTFS_BLK_SHR); + indx = VasEBoot_malloc (mft->data->idx_size << VasEBoot_NTFS_BLK_SHR); if (indx == NULL) goto done; v = 1; - for (i = 0; i < (grub_disk_addr_t)bitmap_len * 8; i++) + for (i = 0; i < (VasEBoot_disk_addr_t)bitmap_len * 8; i++) { if (*bitmap & v) { if ((read_attr - (at, indx, i * (mft->data->idx_size << GRUB_NTFS_BLK_SHR), - (mft->data->idx_size << GRUB_NTFS_BLK_SHR), 0, 0, 0)) + (at, indx, i * (mft->data->idx_size << VasEBoot_NTFS_BLK_SHR), + (mft->data->idx_size << VasEBoot_NTFS_BLK_SHR), 0, 0, 0)) || (fixup (indx, mft->data->idx_size, - (const grub_uint8_t *) "INDX"))) + (const VasEBoot_uint8_t *) "INDX"))) goto done; ret = list_file (mft, &indx[0x18 + u16at (indx, 0x18)], hook, hook_data); @@ -877,191 +877,191 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, done: free_attr (at); - grub_free (indx); - grub_free (bmp); + VasEBoot_free (indx); + VasEBoot_free (bmp); return ret; } -static struct grub_ntfs_data * -grub_ntfs_mount (grub_disk_t disk) +static struct VasEBoot_ntfs_data * +VasEBoot_ntfs_mount (VasEBoot_disk_t disk) { - struct grub_ntfs_bpb bpb; - struct grub_ntfs_data *data = 0; - grub_uint32_t spc; + struct VasEBoot_ntfs_bpb bpb; + struct VasEBoot_ntfs_data *data = 0; + VasEBoot_uint32_t spc; if (!disk) goto fail; - data = (struct grub_ntfs_data *) grub_zalloc (sizeof (*data)); + data = (struct VasEBoot_ntfs_data *) VasEBoot_zalloc (sizeof (*data)); if (!data) goto fail; data->disk = disk; /* Read the BPB. */ - if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) + if (VasEBoot_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) goto fail; - if (grub_memcmp ((char *) &bpb.oem_name, "NTFS", 4) != 0 + if (VasEBoot_memcmp ((char *) &bpb.oem_name, "NTFS", 4) != 0 || bpb.sectors_per_cluster == 0 || (bpb.sectors_per_cluster & (bpb.sectors_per_cluster - 1)) != 0 || bpb.bytes_per_sector == 0 || (bpb.bytes_per_sector & (bpb.bytes_per_sector - 1)) != 0) goto fail; - spc = (((grub_uint32_t) bpb.sectors_per_cluster - * (grub_uint32_t) grub_le_to_cpu16 (bpb.bytes_per_sector)) - >> GRUB_NTFS_BLK_SHR); + spc = (((VasEBoot_uint32_t) bpb.sectors_per_cluster + * (VasEBoot_uint32_t) VasEBoot_le_to_cpu16 (bpb.bytes_per_sector)) + >> VasEBoot_NTFS_BLK_SHR); if (spc == 0) goto fail; for (data->log_spc = 0; (1U << data->log_spc) < spc; data->log_spc++); if (bpb.clusters_per_mft > 0) - data->mft_size = ((grub_disk_addr_t) bpb.clusters_per_mft) << data->log_spc; - else if (-bpb.clusters_per_mft < GRUB_NTFS_BLK_SHR || -bpb.clusters_per_mft >= 31) + data->mft_size = ((VasEBoot_disk_addr_t) bpb.clusters_per_mft) << data->log_spc; + else if (-bpb.clusters_per_mft < VasEBoot_NTFS_BLK_SHR || -bpb.clusters_per_mft >= 31) goto fail; else - data->mft_size = 1ULL << (-bpb.clusters_per_mft - GRUB_NTFS_BLK_SHR); + data->mft_size = 1ULL << (-bpb.clusters_per_mft - VasEBoot_NTFS_BLK_SHR); if (bpb.clusters_per_index > 0) - data->idx_size = (((grub_disk_addr_t) bpb.clusters_per_index) + data->idx_size = (((VasEBoot_disk_addr_t) bpb.clusters_per_index) << data->log_spc); - else if (-bpb.clusters_per_index < GRUB_NTFS_BLK_SHR || -bpb.clusters_per_index >= 31) + else if (-bpb.clusters_per_index < VasEBoot_NTFS_BLK_SHR || -bpb.clusters_per_index >= 31) goto fail; else - data->idx_size = 1ULL << (-bpb.clusters_per_index - GRUB_NTFS_BLK_SHR); + data->idx_size = 1ULL << (-bpb.clusters_per_index - VasEBoot_NTFS_BLK_SHR); - data->mft_start = grub_le_to_cpu64 (bpb.mft_lcn) << data->log_spc; + data->mft_start = VasEBoot_le_to_cpu64 (bpb.mft_lcn) << data->log_spc; - if ((data->mft_size > GRUB_NTFS_MAX_MFT) || (data->idx_size > GRUB_NTFS_MAX_IDX)) + if ((data->mft_size > VasEBoot_NTFS_MAX_MFT) || (data->idx_size > VasEBoot_NTFS_MAX_IDX)) goto fail; data->mmft.data = data; data->cmft.data = data; - data->mmft.buf = grub_malloc (data->mft_size << GRUB_NTFS_BLK_SHR); + data->mmft.buf = VasEBoot_malloc (data->mft_size << VasEBoot_NTFS_BLK_SHR); if (!data->mmft.buf) goto fail; - if (grub_disk_read - (disk, data->mft_start, 0, data->mft_size << GRUB_NTFS_BLK_SHR, data->mmft.buf)) + if (VasEBoot_disk_read + (disk, data->mft_start, 0, data->mft_size << VasEBoot_NTFS_BLK_SHR, data->mmft.buf)) goto fail; - data->uuid = grub_le_to_cpu64 (bpb.num_serial); + data->uuid = VasEBoot_le_to_cpu64 (bpb.num_serial); - if (fixup (data->mmft.buf, data->mft_size, (const grub_uint8_t *) "FILE")) + if (fixup (data->mmft.buf, data->mft_size, (const VasEBoot_uint8_t *) "FILE")) goto fail; - if (!locate_attr (&data->mmft.attr, &data->mmft, GRUB_NTFS_AT_DATA)) + if (!locate_attr (&data->mmft.attr, &data->mmft, VasEBoot_NTFS_AT_DATA)) goto fail; - if (init_file (&data->cmft, GRUB_NTFS_FILE_ROOT)) + if (init_file (&data->cmft, VasEBoot_NTFS_FILE_ROOT)) goto fail; return data; fail: - grub_error (GRUB_ERR_BAD_FS, "not an ntfs filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an ntfs filesystem"); if (data) { free_file (&data->mmft); free_file (&data->cmft); - grub_free (data); + VasEBoot_free (data); } return 0; } -/* Context for grub_ntfs_dir. */ -struct grub_ntfs_dir_ctx +/* Context for VasEBoot_ntfs_dir. */ +struct VasEBoot_ntfs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_ntfs_dir. */ +/* Helper for VasEBoot_ntfs_dir. */ static int -grub_ntfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_ntfs_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_ntfs_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_ntfs_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtimeset = 1; - info.mtime = grub_divmod64 (node->mtime, 10000000, 0) + info.mtime = VasEBoot_divmod64 (node->mtime, 10000000, 0) - 86400ULL * 365 * (1970 - 1601) - 86400ULL * ((1970 - 1601) / 4) + 86400ULL * ((1970 - 1601) / 100); - grub_free (node); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_ntfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_ntfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_ntfs_dir_ctx ctx = { hook, hook_data }; - struct grub_ntfs_data *data = 0; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_ntfs_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_ntfs_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ntfs_mount (device->disk); + data = VasEBoot_ntfs_mount (device->disk); if (!data) goto fail; - grub_fshelp_find_file (path, &data->cmft, &fdiro, grub_ntfs_iterate_dir, - grub_ntfs_read_symlink, GRUB_FSHELP_DIR); + VasEBoot_fshelp_find_file (path, &data->cmft, &fdiro, VasEBoot_ntfs_iterate_dir, + VasEBoot_ntfs_read_symlink, VasEBoot_FSHELP_DIR); - if (grub_errno) + if (VasEBoot_errno) goto fail; - grub_ntfs_iterate_dir (fdiro, grub_ntfs_dir_iter, &ctx); + VasEBoot_ntfs_iterate_dir (fdiro, VasEBoot_ntfs_dir_iter, &ctx); fail: if ((fdiro) && (fdiro != &data->cmft)) { free_file (fdiro); - grub_free (fdiro); + VasEBoot_free (fdiro); } if (data) { free_file (&data->mmft); free_file (&data->cmft); - grub_free (data); + VasEBoot_free (data); } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_ntfs_open (grub_file_t file, const char *name) +static VasEBoot_err_t +VasEBoot_ntfs_open (VasEBoot_file_t file, const char *name) { - struct grub_ntfs_data *data = 0; - struct grub_fshelp_node *mft = 0; + struct VasEBoot_ntfs_data *data = 0; + struct VasEBoot_fshelp_node *mft = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ntfs_mount (file->device->disk); + data = VasEBoot_ntfs_mount (file->device->disk); if (!data) goto fail; - grub_fshelp_find_file (name, &data->cmft, &mft, grub_ntfs_iterate_dir, - grub_ntfs_read_symlink, GRUB_FSHELP_REG); + VasEBoot_fshelp_find_file (name, &data->cmft, &mft, VasEBoot_ntfs_iterate_dir, + VasEBoot_ntfs_read_symlink, VasEBoot_FSHELP_REG); - if (grub_errno) + if (VasEBoot_errno) goto fail; if (mft != &data->cmft) { free_file (&data->cmft); - grub_memcpy (&data->cmft, mft, sizeof (*mft)); - grub_free (mft); + VasEBoot_memcpy (&data->cmft, mft, sizeof (*mft)); + VasEBoot_free (mft); if (!data->cmft.inode_read) { if (init_file (&data->cmft, data->cmft.ino)) @@ -1080,32 +1080,32 @@ fail: { free_file (&data->mmft); free_file (&data->cmft); - grub_free (data); + VasEBoot_free (data); } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_ntfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_ntfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_ntfs_file *mft; + struct VasEBoot_ntfs_file *mft; - mft = &((struct grub_ntfs_data *) file->data)->cmft; + mft = &((struct VasEBoot_ntfs_data *) file->data)->cmft; if (file->read_hook) mft->attr.save_pos = 1; - read_attr (&mft->attr, (grub_uint8_t *) buf, file->offset, len, 1, + read_attr (&mft->attr, (VasEBoot_uint8_t *) buf, file->offset, len, 1, file->read_hook, file->read_hook_data); - return (grub_errno) ? -1 : (grub_ssize_t) len; + return (VasEBoot_errno) ? -1 : (VasEBoot_ssize_t) len; } -static grub_err_t -grub_ntfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_ntfs_close (VasEBoot_file_t file) { - struct grub_ntfs_data *data; + struct VasEBoot_ntfs_data *data; data = file->data; @@ -1113,38 +1113,38 @@ grub_ntfs_close (grub_file_t file) { free_file (&data->mmft); free_file (&data->cmft); - grub_free (data); + VasEBoot_free (data); } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_ntfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_ntfs_label (VasEBoot_device_t device, char **label) { - struct grub_ntfs_data *data = 0; - struct grub_fshelp_node *mft = 0; - grub_uint8_t *pa; + struct VasEBoot_ntfs_data *data = 0; + struct VasEBoot_fshelp_node *mft = 0; + VasEBoot_uint8_t *pa; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); *label = 0; - data = grub_ntfs_mount (device->disk); + data = VasEBoot_ntfs_mount (device->disk); if (!data) goto fail; - grub_fshelp_find_file ("/$Volume", &data->cmft, &mft, grub_ntfs_iterate_dir, - 0, GRUB_FSHELP_REG); + VasEBoot_fshelp_find_file ("/$Volume", &data->cmft, &mft, VasEBoot_ntfs_iterate_dir, + 0, VasEBoot_FSHELP_REG); - if (grub_errno) + if (VasEBoot_errno) goto fail; if (!mft->inode_read) { - mft->buf = grub_malloc (mft->data->mft_size << GRUB_NTFS_BLK_SHR); + mft->buf = VasEBoot_malloc (mft->data->mft_size << VasEBoot_NTFS_BLK_SHR); if (mft->buf == NULL) goto fail; @@ -1153,7 +1153,7 @@ grub_ntfs_label (grub_device_t device, char **label) } init_attr (&mft->attr, mft); - pa = find_attr (&mft->attr, GRUB_NTFS_AT_VOLUME_NAME); + pa = find_attr (&mft->attr, VasEBoot_NTFS_AT_VOLUME_NAME); if ((pa) && (pa[8] == 0) && (u32at (pa, 0x10))) { int len; @@ -1167,71 +1167,71 @@ fail: if ((mft) && (mft != &data->cmft)) { free_file (mft); - grub_free (mft); + VasEBoot_free (mft); } if (data) { free_file (&data->mmft); free_file (&data->cmft); - grub_free (data); + VasEBoot_free (data); } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_ntfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_ntfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_ntfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_ntfs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ntfs_mount (disk); + data = VasEBoot_ntfs_mount (disk); if (data) { char *ptr; - *uuid = grub_xasprintf ("%016llx", (unsigned long long) data->uuid); + *uuid = VasEBoot_xasprintf ("%016llx", (unsigned long long) data->uuid); if (*uuid) for (ptr = *uuid; *ptr; ptr++) - *ptr = grub_toupper (*ptr); + *ptr = VasEBoot_toupper (*ptr); free_file (&data->mmft); free_file (&data->cmft); - grub_free (data); + VasEBoot_free (data); } else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_ntfs_fs = +static struct VasEBoot_fs VasEBoot_ntfs_fs = { .name = "ntfs", - .dir = grub_ntfs_dir, - .open = grub_ntfs_open, - .read = grub_ntfs_read, - .close = grub_ntfs_close, - .label = grub_ntfs_label, - .uuid = grub_ntfs_uuid, -#ifdef GRUB_UTIL + .dir = VasEBoot_ntfs_dir, + .open = VasEBoot_ntfs_open, + .read = VasEBoot_ntfs_read, + .close = VasEBoot_ntfs_close, + .label = VasEBoot_ntfs_label, + .uuid = VasEBoot_ntfs_uuid, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT (ntfs) +VasEBoot_MOD_INIT (ntfs) { - grub_fs_register (&grub_ntfs_fs); + VasEBoot_fs_register (&VasEBoot_ntfs_fs); my_mod = mod; } -GRUB_MOD_FINI (ntfs) +VasEBoot_MOD_FINI (ntfs) { - grub_fs_unregister (&grub_ntfs_fs); + VasEBoot_fs_unregister (&VasEBoot_ntfs_fs); } diff --git a/VasEBoot-core/fs/ntfscomp.c b/VasEBoot-core/fs/ntfscomp.c index 3cd97d337..1d2146527 100644 --- a/VasEBoot-core/fs/ntfscomp.c +++ b/VasEBoot-core/fs/ntfscomp.c @@ -16,27 +16,27 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -decomp_nextvcn (struct grub_ntfs_comp *cc) +static VasEBoot_err_t +decomp_nextvcn (struct VasEBoot_ntfs_comp *cc) { if (cc->comp_head >= cc->comp_tail) - return grub_error (GRUB_ERR_BAD_FS, "compression block overflown"); - if (grub_disk_read + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "compression block overflown"); + if (VasEBoot_disk_read (cc->disk, (cc->comp_table[cc->comp_head].next_lcn - (cc->comp_table[cc->comp_head].next_vcn - cc->cbuf_vcn)) << cc->log_spc, 0, - 1 << (cc->log_spc + GRUB_NTFS_BLK_SHR), cc->cbuf)) - return grub_errno; + 1 << (cc->log_spc + VasEBoot_NTFS_BLK_SHR), cc->cbuf)) + return VasEBoot_errno; cc->cbuf_vcn++; if ((cc->cbuf_vcn >= cc->comp_table[cc->comp_head].next_vcn)) cc->comp_head++; @@ -44,57 +44,57 @@ decomp_nextvcn (struct grub_ntfs_comp *cc) return 0; } -static grub_err_t -decomp_getch (struct grub_ntfs_comp *cc, grub_uint8_t *res) +static VasEBoot_err_t +decomp_getch (struct VasEBoot_ntfs_comp *cc, VasEBoot_uint8_t *res) { - if (cc->cbuf_ofs >= (1U << (cc->log_spc + GRUB_NTFS_BLK_SHR))) + if (cc->cbuf_ofs >= (1U << (cc->log_spc + VasEBoot_NTFS_BLK_SHR))) { if (decomp_nextvcn (cc)) - return grub_errno; + return VasEBoot_errno; } *res = cc->cbuf[cc->cbuf_ofs++]; return 0; } -static grub_err_t -decomp_get16 (struct grub_ntfs_comp *cc, grub_uint16_t * res) +static VasEBoot_err_t +decomp_get16 (struct VasEBoot_ntfs_comp *cc, VasEBoot_uint16_t * res) { - grub_uint8_t c1 = 0, c2 = 0; + VasEBoot_uint8_t c1 = 0, c2 = 0; if ((decomp_getch (cc, &c1)) || (decomp_getch (cc, &c2))) - return grub_errno; - *res = ((grub_uint16_t) c2) * 256 + ((grub_uint16_t) c1); + return VasEBoot_errno; + *res = ((VasEBoot_uint16_t) c2) * 256 + ((VasEBoot_uint16_t) c1); return 0; } /* Decompress a block (4096 bytes) */ -static grub_err_t -decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) +static VasEBoot_err_t +decomp_block (struct VasEBoot_ntfs_comp *cc, VasEBoot_uint8_t *dest) { - grub_uint16_t flg, cnt; + VasEBoot_uint16_t flg, cnt; if (decomp_get16 (cc, &flg)) - return grub_errno; + return VasEBoot_errno; cnt = (flg & 0xFFF) + 1; if (dest) { if (flg & 0x8000) { - grub_uint8_t tag; - grub_uint32_t bits, copied; + VasEBoot_uint8_t tag; + VasEBoot_uint32_t bits, copied; bits = copied = tag = 0; while (cnt > 0) { - if (copied > GRUB_NTFS_COM_LEN) - return grub_error (GRUB_ERR_BAD_FS, + if (copied > VasEBoot_NTFS_COM_LEN) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "compression block too large"); if (!bits) { if (decomp_getch (cc, &tag)) - return grub_errno; + return VasEBoot_errno; bits = 8; cnt--; @@ -103,18 +103,18 @@ decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) } if (tag & 1) { - grub_uint32_t i, len, delta, code, lmask, dshift; - grub_uint16_t word = 0; + VasEBoot_uint32_t i, len, delta, code, lmask, dshift; + VasEBoot_uint16_t word = 0; if (decomp_get16 (cc, &word)) - return grub_errno; + return VasEBoot_errno; code = word; cnt -= 2; if (!copied) { - grub_error (GRUB_ERR_BAD_FS, "nontext window empty"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "nontext window empty"); return 0; } @@ -136,10 +136,10 @@ decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) } else { - grub_uint8_t ch = 0; + VasEBoot_uint8_t ch = 0; if (decomp_getch (cc, &ch)) - return grub_errno; + return VasEBoot_errno; dest[copied++] = ch; cnt--; } @@ -150,8 +150,8 @@ decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) } else { - if (cnt != GRUB_NTFS_COM_LEN) - return grub_error (GRUB_ERR_BAD_FS, + if (cnt != VasEBoot_NTFS_COM_LEN) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid compression block size"); } } @@ -160,55 +160,55 @@ decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) { int n; - n = (1 << (cc->log_spc + GRUB_NTFS_BLK_SHR)) - cc->cbuf_ofs; + n = (1 << (cc->log_spc + VasEBoot_NTFS_BLK_SHR)) - cc->cbuf_ofs; if (n > cnt) n = cnt; if ((dest) && (n)) { - grub_memcpy (dest, &cc->cbuf[cc->cbuf_ofs], n); + VasEBoot_memcpy (dest, &cc->cbuf[cc->cbuf_ofs], n); dest += n; } cnt -= n; cc->cbuf_ofs += n; if ((cnt) && (decomp_nextvcn (cc))) - return grub_errno; + return VasEBoot_errno; } return 0; } -static grub_err_t -read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) +static VasEBoot_err_t +read_block (struct VasEBoot_ntfs_rlst *ctx, VasEBoot_uint8_t *buf, VasEBoot_size_t num) { - int log_cpb = GRUB_NTFS_LOG_COM_SEC - ctx->comp.log_spc; + int log_cpb = VasEBoot_NTFS_LOG_COM_SEC - ctx->comp.log_spc; while (num) { - grub_size_t nn; + VasEBoot_size_t nn; if ((ctx->target_vcn & 0xF) == 0) { if (ctx->comp.comp_head != ctx->comp.comp_tail - && !(ctx->flags & GRUB_NTFS_RF_BLNK)) - return grub_error (GRUB_ERR_BAD_FS, "invalid compression block"); + && !(ctx->flags & VasEBoot_NTFS_RF_BLNK)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid compression block"); ctx->comp.comp_head = ctx->comp.comp_tail = 0; ctx->comp.cbuf_vcn = ctx->target_vcn; - ctx->comp.cbuf_ofs = (1 << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR)); + ctx->comp.cbuf_ofs = (1 << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR)); if (ctx->target_vcn >= ctx->next_vcn) { - if (grub_ntfs_read_run_list (ctx)) - return grub_errno; + if (VasEBoot_ntfs_read_run_list (ctx)) + return VasEBoot_errno; } while (ctx->target_vcn + 16 > ctx->next_vcn) { - if (ctx->flags & GRUB_NTFS_RF_BLNK) + if (ctx->flags & VasEBoot_NTFS_RF_BLNK) break; ctx->comp.comp_table[ctx->comp.comp_tail].next_vcn = ctx->next_vcn; ctx->comp.comp_table[ctx->comp.comp_tail].next_lcn = ctx->curr_lcn + ctx->next_vcn - ctx->curr_vcn; ctx->comp.comp_tail++; - if (grub_ntfs_read_run_list (ctx)) - return grub_errno; + if (VasEBoot_ntfs_read_run_list (ctx)) + return VasEBoot_errno; } } @@ -217,17 +217,17 @@ read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) nn = num; num -= nn; - if (ctx->flags & GRUB_NTFS_RF_BLNK) + if (ctx->flags & VasEBoot_NTFS_RF_BLNK) { ctx->target_vcn += nn << log_cpb; if (ctx->comp.comp_tail == 0) { if (buf) { - grub_memset (buf, 0, nn * GRUB_NTFS_COM_LEN); - buf += nn * GRUB_NTFS_COM_LEN; - if (grub_file_progress_hook && ctx->file) - grub_file_progress_hook (0, 0, nn * GRUB_NTFS_COM_LEN, + VasEBoot_memset (buf, 0, nn * VasEBoot_NTFS_COM_LEN); + buf += nn * VasEBoot_NTFS_COM_LEN; + if (VasEBoot_file_progress_hook && ctx->file) + VasEBoot_file_progress_hook (0, 0, nn * VasEBoot_NTFS_COM_LEN, ctx->file); } } @@ -236,11 +236,11 @@ read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) while (nn) { if (decomp_block (&ctx->comp, buf)) - return grub_errno; + return VasEBoot_errno; if (buf) - buf += GRUB_NTFS_COM_LEN; - if (grub_file_progress_hook && ctx->file) - grub_file_progress_hook (0, 0, GRUB_NTFS_COM_LEN, + buf += VasEBoot_NTFS_COM_LEN; + if (VasEBoot_file_progress_hook && ctx->file) + VasEBoot_file_progress_hook (0, 0, VasEBoot_NTFS_COM_LEN, ctx->file); nn--; } @@ -251,7 +251,7 @@ read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) nn <<= log_cpb; while ((ctx->comp.comp_head < ctx->comp.comp_tail) && (nn)) { - grub_disk_addr_t tt; + VasEBoot_disk_addr_t tt; tt = ctx->comp.comp_table[ctx->comp.comp_head].next_vcn - @@ -261,19 +261,19 @@ read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) ctx->target_vcn += tt; if (buf) { - if (grub_disk_read + if (VasEBoot_disk_read (ctx->comp.disk, (ctx->comp.comp_table[ctx->comp.comp_head].next_lcn - (ctx->comp.comp_table[ctx->comp.comp_head].next_vcn - ctx->target_vcn)) << ctx->comp.log_spc, 0, - tt << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR), buf)) - return grub_errno; - if (grub_file_progress_hook && ctx->file) - grub_file_progress_hook (0, 0, + tt << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR), buf)) + return VasEBoot_errno; + if (VasEBoot_file_progress_hook && ctx->file) + VasEBoot_file_progress_hook (0, 0, tt << (ctx->comp.log_spc - + GRUB_NTFS_BLK_SHR), + + VasEBoot_NTFS_BLK_SHR), ctx->file); - buf += tt << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR); + buf += tt << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR); } nn -= tt; if (ctx->target_vcn >= @@ -284,17 +284,17 @@ read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) { if (buf) { - if (grub_disk_read + if (VasEBoot_disk_read (ctx->comp.disk, (ctx->target_vcn - ctx->curr_vcn + ctx->curr_lcn) << ctx->comp.log_spc, 0, - nn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR), buf)) - return grub_errno; - buf += nn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR); - if (grub_file_progress_hook && ctx->file) - grub_file_progress_hook (0, 0, + nn << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR), buf)) + return VasEBoot_errno; + buf += nn << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR); + if (VasEBoot_file_progress_hook && ctx->file) + VasEBoot_file_progress_hook (0, 0, nn << (ctx->comp.log_spc - + GRUB_NTFS_BLK_SHR), + + VasEBoot_NTFS_BLK_SHR), ctx->file); } ctx->target_vcn += nn; @@ -304,26 +304,26 @@ read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num) return 0; } -static grub_err_t -ntfscomp (grub_uint8_t *dest, grub_disk_addr_t ofs, - grub_size_t len, struct grub_ntfs_rlst *ctx) +static VasEBoot_err_t +ntfscomp (VasEBoot_uint8_t *dest, VasEBoot_disk_addr_t ofs, + VasEBoot_size_t len, struct VasEBoot_ntfs_rlst *ctx) { - grub_err_t ret; - grub_disk_addr_t vcn; + VasEBoot_err_t ret; + VasEBoot_disk_addr_t vcn; if (ctx->attr->sbuf) { - if ((ofs & (~(GRUB_NTFS_COM_LEN - 1))) == ctx->attr->save_pos) + if ((ofs & (~(VasEBoot_NTFS_COM_LEN - 1))) == ctx->attr->save_pos) { - grub_disk_addr_t n; + VasEBoot_disk_addr_t n; - n = GRUB_NTFS_COM_LEN - (ofs - ctx->attr->save_pos); + n = VasEBoot_NTFS_COM_LEN - (ofs - ctx->attr->save_pos); if (n > len) n = len; - grub_memcpy (dest, ctx->attr->sbuf + ofs - ctx->attr->save_pos, n); - if (grub_file_progress_hook && ctx->file) - grub_file_progress_hook (0, 0, n, ctx->file); + VasEBoot_memcpy (dest, ctx->attr->sbuf + ofs - ctx->attr->save_pos, n); + if (VasEBoot_file_progress_hook && ctx->file) + VasEBoot_file_progress_hook (0, 0, n, ctx->file); if (n == len) return 0; @@ -334,22 +334,22 @@ ntfscomp (grub_uint8_t *dest, grub_disk_addr_t ofs, } else { - ctx->attr->sbuf = grub_malloc (GRUB_NTFS_COM_LEN); + ctx->attr->sbuf = VasEBoot_malloc (VasEBoot_NTFS_COM_LEN); if (ctx->attr->sbuf == NULL) - return grub_errno; + return VasEBoot_errno; ctx->attr->save_pos = 1; } - vcn = ctx->target_vcn = (ofs >> GRUB_NTFS_COM_LOG_LEN) * (GRUB_NTFS_COM_SEC >> ctx->comp.log_spc); + vcn = ctx->target_vcn = (ofs >> VasEBoot_NTFS_COM_LOG_LEN) * (VasEBoot_NTFS_COM_SEC >> ctx->comp.log_spc); ctx->target_vcn &= ~0xFULL; while (ctx->next_vcn <= ctx->target_vcn) { - if (grub_ntfs_read_run_list (ctx)) - return grub_errno; + if (VasEBoot_ntfs_read_run_list (ctx)) + return VasEBoot_errno; } ctx->comp.comp_head = ctx->comp.comp_tail = 0; - ctx->comp.cbuf = grub_malloc (1 << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR)); + ctx->comp.cbuf = VasEBoot_malloc (1 << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR)); if (!ctx->comp.cbuf) return 0; @@ -360,23 +360,23 @@ ntfscomp (grub_uint8_t *dest, grub_disk_addr_t ofs, if ((vcn > ctx->target_vcn) && (read_block - (ctx, NULL, (vcn - ctx->target_vcn) >> (GRUB_NTFS_LOG_COM_SEC - ctx->comp.log_spc)))) + (ctx, NULL, (vcn - ctx->target_vcn) >> (VasEBoot_NTFS_LOG_COM_SEC - ctx->comp.log_spc)))) { - ret = grub_errno; + ret = VasEBoot_errno; goto quit; } - if (ofs % GRUB_NTFS_COM_LEN) + if (ofs % VasEBoot_NTFS_COM_LEN) { - grub_uint32_t t, n, o; + VasEBoot_uint32_t t, n, o; void *file = ctx->file; ctx->file = 0; - t = ctx->target_vcn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR); + t = ctx->target_vcn << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR); if (read_block (ctx, ctx->attr->sbuf, 1)) { - ret = grub_errno; + ret = VasEBoot_errno; goto quit; } @@ -384,60 +384,60 @@ ntfscomp (grub_uint8_t *dest, grub_disk_addr_t ofs, ctx->attr->save_pos = t; - o = ofs % GRUB_NTFS_COM_LEN; - n = GRUB_NTFS_COM_LEN - o; + o = ofs % VasEBoot_NTFS_COM_LEN; + n = VasEBoot_NTFS_COM_LEN - o; if (n > len) n = len; - grub_memcpy (dest, &ctx->attr->sbuf[o], n); - if (grub_file_progress_hook && ctx->file) - grub_file_progress_hook (0, 0, n, ctx->file); + VasEBoot_memcpy (dest, &ctx->attr->sbuf[o], n); + if (VasEBoot_file_progress_hook && ctx->file) + VasEBoot_file_progress_hook (0, 0, n, ctx->file); if (n == len) goto quit; dest += n; len -= n; } - if (read_block (ctx, dest, len / GRUB_NTFS_COM_LEN)) + if (read_block (ctx, dest, len / VasEBoot_NTFS_COM_LEN)) { - ret = grub_errno; + ret = VasEBoot_errno; goto quit; } - dest += (len / GRUB_NTFS_COM_LEN) * GRUB_NTFS_COM_LEN; - len = len % GRUB_NTFS_COM_LEN; + dest += (len / VasEBoot_NTFS_COM_LEN) * VasEBoot_NTFS_COM_LEN; + len = len % VasEBoot_NTFS_COM_LEN; if (len) { - grub_uint32_t t; + VasEBoot_uint32_t t; void *file = ctx->file; ctx->file = 0; - t = ctx->target_vcn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR); + t = ctx->target_vcn << (ctx->comp.log_spc + VasEBoot_NTFS_BLK_SHR); if (read_block (ctx, ctx->attr->sbuf, 1)) { - ret = grub_errno; + ret = VasEBoot_errno; goto quit; } ctx->attr->save_pos = t; - grub_memcpy (dest, ctx->attr->sbuf, len); - if (grub_file_progress_hook && file) - grub_file_progress_hook (0, 0, len, file); + VasEBoot_memcpy (dest, ctx->attr->sbuf, len); + if (VasEBoot_file_progress_hook && file) + VasEBoot_file_progress_hook (0, 0, len, file); } quit: //ctx->comp.disk->read_hook = 0; if (ctx->comp.cbuf) - grub_free (ctx->comp.cbuf); + VasEBoot_free (ctx->comp.cbuf); return ret; } -GRUB_MOD_INIT (ntfscomp) +VasEBoot_MOD_INIT (ntfscomp) { - grub_ntfscomp_func = ntfscomp; + VasEBoot_ntfscomp_func = ntfscomp; } -GRUB_MOD_FINI (ntfscomp) +VasEBoot_MOD_FINI (ntfscomp) { - grub_ntfscomp_func = NULL; + VasEBoot_ntfscomp_func = NULL; } diff --git a/VasEBoot-core/fs/odc.c b/VasEBoot-core/fs/odc.c index 790000622..dfc2dfeb2 100644 --- a/VasEBoot-core/fs/odc.c +++ b/VasEBoot-core/fs/odc.c @@ -1,6 +1,6 @@ /* cpio.c - cpio and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #define ALIGN_CPIO(x) x @@ -35,10 +35,10 @@ struct head char mtime[11]; char namesize[6]; char filesize[11]; -} GRUB_PACKED; +} VasEBoot_PACKED; static inline unsigned long long -read_number (const char *str, grub_size_t size) +read_number (const char *str, VasEBoot_size_t size) { unsigned long long ret = 0; while (size-- && *str >= '0' && *str <= '7') @@ -50,12 +50,12 @@ read_number (const char *str, grub_size_t size) #include "cpio_common.c" -GRUB_MOD_INIT (odc) +VasEBoot_MOD_INIT (odc) { - grub_fs_register (&grub_cpio_fs); + VasEBoot_fs_register (&VasEBoot_cpio_fs); } -GRUB_MOD_FINI (odc) +VasEBoot_MOD_FINI (odc) { - grub_fs_unregister (&grub_cpio_fs); + VasEBoot_fs_unregister (&VasEBoot_cpio_fs); } diff --git a/VasEBoot-core/fs/proc.c b/VasEBoot-core/fs/proc.c index 31f3aa9a4..a77d2c3de 100644 --- a/VasEBoot-core/fs/proc.c +++ b/VasEBoot-core/fs/proc.c @@ -1,203 +1,203 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_procfs_entry *grub_procfs_entries; +struct VasEBoot_procfs_entry *VasEBoot_procfs_entries; static int -grub_procdev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_procdev_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; return hook ("proc", hook_data); } -static grub_err_t -grub_procdev_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_procdev_open (const char *name, VasEBoot_disk_t disk) { - if (grub_strcmp (name, "proc")) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a procfs disk"); + if (VasEBoot_strcmp (name, "proc")) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "not a procfs disk"); disk->total_sectors = 0; disk->id = 0; disk->data = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_procdev_close (grub_disk_t disk __attribute((unused))) +VasEBoot_procdev_close (VasEBoot_disk_t disk __attribute((unused))) { } -static grub_err_t -grub_procdev_read (grub_disk_t disk __attribute((unused)), - grub_disk_addr_t sector __attribute((unused)), - grub_size_t size __attribute((unused)), +static VasEBoot_err_t +VasEBoot_procdev_read (VasEBoot_disk_t disk __attribute((unused)), + VasEBoot_disk_addr_t sector __attribute((unused)), + VasEBoot_size_t size __attribute((unused)), char *buf __attribute((unused))) { - return GRUB_ERR_OUT_OF_RANGE; + return VasEBoot_ERR_OUT_OF_RANGE; } -static grub_err_t -grub_procdev_write (grub_disk_t disk __attribute ((unused)), - grub_disk_addr_t sector __attribute ((unused)), - grub_size_t size __attribute ((unused)), +static VasEBoot_err_t +VasEBoot_procdev_write (VasEBoot_disk_t disk __attribute ((unused)), + VasEBoot_disk_addr_t sector __attribute ((unused)), + VasEBoot_size_t size __attribute ((unused)), const char *buf __attribute ((unused))) { - return GRUB_ERR_OUT_OF_RANGE; + return VasEBoot_ERR_OUT_OF_RANGE; } -struct grub_archelp_data +struct VasEBoot_archelp_data { - struct grub_procfs_entry *entry, *next_entry; + struct VasEBoot_procfs_entry *entry, *next_entry; }; static void -grub_procfs_rewind (struct grub_archelp_data *data) +VasEBoot_procfs_rewind (struct VasEBoot_archelp_data *data) { data->entry = NULL; - data->next_entry = grub_procfs_entries; + data->next_entry = VasEBoot_procfs_entries; } -static grub_err_t -grub_procfs_find_file (struct grub_archelp_data *data, char **name, - grub_int32_t *mtime, - grub_uint32_t *mode) +static VasEBoot_err_t +VasEBoot_procfs_find_file (struct VasEBoot_archelp_data *data, char **name, + VasEBoot_int32_t *mtime, + VasEBoot_uint32_t *mode) { data->entry = data->next_entry; if (!data->entry) { - *mode = GRUB_ARCHELP_ATTR_END; - return GRUB_ERR_NONE; + *mode = VasEBoot_ARCHELP_ATTR_END; + return VasEBoot_ERR_NONE; } data->next_entry = data->entry->next; - *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME; - *name = grub_strdup (data->entry->name); + *mode = VasEBoot_ARCHELP_ATTR_FILE | VasEBoot_ARCHELP_ATTR_NOTIME; + *name = VasEBoot_strdup (data->entry->name); *mtime = 0; if (!*name) - return grub_errno; - return GRUB_ERR_NONE; + return VasEBoot_errno; + return VasEBoot_ERR_NONE; } -static struct grub_archelp_ops arcops = +static struct VasEBoot_archelp_ops arcops = { - .find_file = grub_procfs_find_file, - .rewind = grub_procfs_rewind + .find_file = VasEBoot_procfs_find_file, + .rewind = VasEBoot_procfs_rewind }; -static grub_ssize_t -grub_procfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_procfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { char *data = file->data; - grub_memcpy (buf, data + file->offset, len); + VasEBoot_memcpy (buf, data + file->offset, len); return len; } -static grub_err_t -grub_procfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_procfs_close (VasEBoot_file_t file) { char *data; data = file->data; - grub_free (data); + VasEBoot_free (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_procfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_procfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_archelp_data data; + struct VasEBoot_archelp_data data; /* Check if the disk is our dummy disk. */ - if (grub_strcmp (device->disk->name, "proc")) - return grub_error (GRUB_ERR_BAD_FS, "not a procfs"); + if (VasEBoot_strcmp (device->disk->name, "proc")) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a procfs"); - grub_procfs_rewind (&data); + VasEBoot_procfs_rewind (&data); - return grub_archelp_dir (&data, &arcops, + return VasEBoot_archelp_dir (&data, &arcops, path, hook, hook_data); } -static grub_err_t -grub_procfs_open (struct grub_file *file, const char *path) +static VasEBoot_err_t +VasEBoot_procfs_open (struct VasEBoot_file *file, const char *path) { - grub_err_t err; - struct grub_archelp_data data; - grub_size_t sz; + VasEBoot_err_t err; + struct VasEBoot_archelp_data data; + VasEBoot_size_t sz; - grub_procfs_rewind (&data); + VasEBoot_procfs_rewind (&data); - err = grub_archelp_open (&data, &arcops, path); + err = VasEBoot_archelp_open (&data, &arcops, path); if (err) return err; file->data = data.entry->get_contents (&sz); if (!file->data) - return grub_errno; + return VasEBoot_errno; file->size = sz; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_disk_dev grub_procfs_dev = { +static struct VasEBoot_disk_dev VasEBoot_procfs_dev = { .name = "proc", - .id = GRUB_DISK_DEVICE_PROCFS_ID, - .iterate = grub_procdev_iterate, - .open = grub_procdev_open, - .close = grub_procdev_close, - .read = grub_procdev_read, - .write = grub_procdev_write, + .id = VasEBoot_DISK_DEVICE_PROCFS_ID, + .iterate = VasEBoot_procdev_iterate, + .open = VasEBoot_procdev_open, + .close = VasEBoot_procdev_close, + .read = VasEBoot_procdev_read, + .write = VasEBoot_procdev_write, .next = 0 }; -static struct grub_fs grub_procfs_fs = +static struct VasEBoot_fs VasEBoot_procfs_fs = { .name = "procfs", - .dir = grub_procfs_dir, - .open = grub_procfs_open, - .read = grub_procfs_read, - .close = grub_procfs_close, + .dir = VasEBoot_procfs_dir, + .open = VasEBoot_procfs_open, + .read = VasEBoot_procfs_read, + .close = VasEBoot_procfs_close, .next = 0 }; -GRUB_MOD_INIT (procfs) +VasEBoot_MOD_INIT (procfs) { - grub_disk_dev_register (&grub_procfs_dev); - grub_fs_register (&grub_procfs_fs); + VasEBoot_disk_dev_register (&VasEBoot_procfs_dev); + VasEBoot_fs_register (&VasEBoot_procfs_fs); } -GRUB_MOD_FINI (procfs) +VasEBoot_MOD_FINI (procfs) { - grub_disk_dev_unregister (&grub_procfs_dev); - grub_fs_unregister (&grub_procfs_fs); + VasEBoot_disk_dev_unregister (&VasEBoot_procfs_dev); + VasEBoot_fs_unregister (&VasEBoot_procfs_fs); } diff --git a/VasEBoot-core/fs/reiserfs.c b/VasEBoot-core/fs/reiserfs.c index 39736f63c..81384eb94 100644 --- a/VasEBoot-core/fs/reiserfs.c +++ b/VasEBoot-core/fs/reiserfs.c @@ -1,20 +1,20 @@ /* reiserfs.c - ReiserFS versions up to 3.6 */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* @@ -25,22 +25,22 @@ */ #if 0 -# define GRUB_REISERFS_DEBUG -# define GRUB_REISERFS_JOURNALING -# define GRUB_HEXDUMP +# define VasEBoot_REISERFS_DEBUG +# define VasEBoot_REISERFS_JOURNALING +# define VasEBoot_HEXDUMP #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define MIN(a, b) \ ({ typeof (a) _a = (a); \ @@ -57,268 +57,268 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define REISERFS_MAGIC_STRING "ReIsEr" #define REISERFS_MAGIC_DESC_BLOCK "ReIsErLB" /* If the 3rd bit of an item state is set, then it's visible. */ -#define GRUB_REISERFS_VISIBLE_MASK ((grub_uint16_t) 0x04) +#define VasEBoot_REISERFS_VISIBLE_MASK ((VasEBoot_uint16_t) 0x04) #define S_IFLNK 0xA000 -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -#define assert(boolean) real_assert (boolean, GRUB_FILE, __LINE__) +#define assert(boolean) real_assert (boolean, VasEBoot_FILE, __LINE__) static inline void real_assert (int boolean, const char *file, const int line) { if (! boolean) - grub_printf ("Assertion failed at %s:%d\n", file, line); + VasEBoot_printf ("Assertion failed at %s:%d\n", file, line); } -enum grub_reiserfs_item_type +enum VasEBoot_reiserfs_item_type { - GRUB_REISERFS_STAT, - GRUB_REISERFS_DIRECTORY, - GRUB_REISERFS_DIRECT, - GRUB_REISERFS_INDIRECT, + VasEBoot_REISERFS_STAT, + VasEBoot_REISERFS_DIRECTORY, + VasEBoot_REISERFS_DIRECT, + VasEBoot_REISERFS_INDIRECT, /* Matches both _DIRECT and _INDIRECT when searching. */ - GRUB_REISERFS_ANY, - GRUB_REISERFS_UNKNOWN + VasEBoot_REISERFS_ANY, + VasEBoot_REISERFS_UNKNOWN }; -struct grub_reiserfs_superblock +struct VasEBoot_reiserfs_superblock { - grub_uint32_t block_count; - grub_uint32_t block_free_count; - grub_uint32_t root_block; - grub_uint32_t journal_block; - grub_uint32_t journal_device; - grub_uint32_t journal_original_size; - grub_uint32_t journal_max_transaction_size; - grub_uint32_t journal_block_count; - grub_uint32_t journal_max_batch; - grub_uint32_t journal_max_commit_age; - grub_uint32_t journal_max_transaction_age; - grub_uint16_t block_size; - grub_uint16_t oid_max_size; - grub_uint16_t oid_current_size; - grub_uint16_t state; - grub_uint8_t magic_string[REISERFS_MAGIC_LEN]; - grub_uint32_t function_hash_code; - grub_uint16_t tree_height; - grub_uint16_t bitmap_number; - grub_uint16_t version; - grub_uint16_t reserved; - grub_uint32_t inode_generation; - grub_uint8_t unused[4]; - grub_uint16_t uuid[8]; + VasEBoot_uint32_t block_count; + VasEBoot_uint32_t block_free_count; + VasEBoot_uint32_t root_block; + VasEBoot_uint32_t journal_block; + VasEBoot_uint32_t journal_device; + VasEBoot_uint32_t journal_original_size; + VasEBoot_uint32_t journal_max_transaction_size; + VasEBoot_uint32_t journal_block_count; + VasEBoot_uint32_t journal_max_batch; + VasEBoot_uint32_t journal_max_commit_age; + VasEBoot_uint32_t journal_max_transaction_age; + VasEBoot_uint16_t block_size; + VasEBoot_uint16_t oid_max_size; + VasEBoot_uint16_t oid_current_size; + VasEBoot_uint16_t state; + VasEBoot_uint8_t magic_string[REISERFS_MAGIC_LEN]; + VasEBoot_uint32_t function_hash_code; + VasEBoot_uint16_t tree_height; + VasEBoot_uint16_t bitmap_number; + VasEBoot_uint16_t version; + VasEBoot_uint16_t reserved; + VasEBoot_uint32_t inode_generation; + VasEBoot_uint8_t unused[4]; + VasEBoot_uint16_t uuid[8]; char label[16]; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_reiserfs_journal_header +struct VasEBoot_reiserfs_journal_header { - grub_uint32_t last_flush_uid; - grub_uint32_t unflushed_offset; - grub_uint32_t mount_id; -} GRUB_PACKED; + VasEBoot_uint32_t last_flush_uid; + VasEBoot_uint32_t unflushed_offset; + VasEBoot_uint32_t mount_id; +} VasEBoot_PACKED; -struct grub_reiserfs_description_block +struct VasEBoot_reiserfs_description_block { - grub_uint32_t id; - grub_uint32_t len; - grub_uint32_t mount_id; - grub_uint32_t real_blocks[0]; -} GRUB_PACKED; + VasEBoot_uint32_t id; + VasEBoot_uint32_t len; + VasEBoot_uint32_t mount_id; + VasEBoot_uint32_t real_blocks[0]; +} VasEBoot_PACKED; -struct grub_reiserfs_commit_block +struct VasEBoot_reiserfs_commit_block { - grub_uint32_t id; - grub_uint32_t len; - grub_uint32_t real_blocks[0]; -} GRUB_PACKED; + VasEBoot_uint32_t id; + VasEBoot_uint32_t len; + VasEBoot_uint32_t real_blocks[0]; +} VasEBoot_PACKED; -struct grub_reiserfs_stat_item_v1 +struct VasEBoot_reiserfs_stat_item_v1 { - grub_uint16_t mode; - grub_uint16_t hardlink_count; - grub_uint16_t uid; - grub_uint16_t gid; - grub_uint32_t size; - grub_uint32_t atime; - grub_uint32_t mtime; - grub_uint32_t ctime; - grub_uint32_t rdev; - grub_uint32_t first_direct_byte; -} GRUB_PACKED; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t hardlink_count; + VasEBoot_uint16_t uid; + VasEBoot_uint16_t gid; + VasEBoot_uint32_t size; + VasEBoot_uint32_t atime; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t rdev; + VasEBoot_uint32_t first_direct_byte; +} VasEBoot_PACKED; -struct grub_reiserfs_stat_item_v2 +struct VasEBoot_reiserfs_stat_item_v2 { - grub_uint16_t mode; - grub_uint16_t reserved; - grub_uint32_t hardlink_count; - grub_uint64_t size; - grub_uint32_t uid; - grub_uint32_t gid; - grub_uint32_t atime; - grub_uint32_t mtime; - grub_uint32_t ctime; - grub_uint32_t blocks; - grub_uint32_t first_direct_byte; -} GRUB_PACKED; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t reserved; + VasEBoot_uint32_t hardlink_count; + VasEBoot_uint64_t size; + VasEBoot_uint32_t uid; + VasEBoot_uint32_t gid; + VasEBoot_uint32_t atime; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t blocks; + VasEBoot_uint32_t first_direct_byte; +} VasEBoot_PACKED; -struct grub_reiserfs_key +struct VasEBoot_reiserfs_key { - grub_uint32_t directory_id; - grub_uint32_t object_id; + VasEBoot_uint32_t directory_id; + VasEBoot_uint32_t object_id; union { struct { - grub_uint32_t offset; - grub_uint32_t type; - } GRUB_PACKED v1; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t type; + } VasEBoot_PACKED v1; struct { - grub_uint64_t offset_type; - } GRUB_PACKED v2; + VasEBoot_uint64_t offset_type; + } VasEBoot_PACKED v2; } u; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_reiserfs_item_header +struct VasEBoot_reiserfs_item_header { - struct grub_reiserfs_key key; + struct VasEBoot_reiserfs_key key; union { - grub_uint16_t free_space; - grub_uint16_t entry_count; - } GRUB_PACKED u; - grub_uint16_t item_size; - grub_uint16_t item_location; - grub_uint16_t version; -} GRUB_PACKED; + VasEBoot_uint16_t free_space; + VasEBoot_uint16_t entry_count; + } VasEBoot_PACKED u; + VasEBoot_uint16_t item_size; + VasEBoot_uint16_t item_location; + VasEBoot_uint16_t version; +} VasEBoot_PACKED; -struct grub_reiserfs_block_header +struct VasEBoot_reiserfs_block_header { - grub_uint16_t level; - grub_uint16_t item_count; - grub_uint16_t free_space; - grub_uint16_t reserved; - struct grub_reiserfs_key block_right_delimiting_key; -} GRUB_PACKED; + VasEBoot_uint16_t level; + VasEBoot_uint16_t item_count; + VasEBoot_uint16_t free_space; + VasEBoot_uint16_t reserved; + struct VasEBoot_reiserfs_key block_right_delimiting_key; +} VasEBoot_PACKED; -struct grub_reiserfs_disk_child +struct VasEBoot_reiserfs_disk_child { - grub_uint32_t block_number; - grub_uint16_t size; - grub_uint16_t reserved; -} GRUB_PACKED; + VasEBoot_uint32_t block_number; + VasEBoot_uint16_t size; + VasEBoot_uint16_t reserved; +} VasEBoot_PACKED; -struct grub_reiserfs_directory_header +struct VasEBoot_reiserfs_directory_header { - grub_uint32_t offset; - grub_uint32_t directory_id; - grub_uint32_t object_id; - grub_uint16_t location; - grub_uint16_t state; -} GRUB_PACKED; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t directory_id; + VasEBoot_uint32_t object_id; + VasEBoot_uint16_t location; + VasEBoot_uint16_t state; +} VasEBoot_PACKED; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_reiserfs_data *data; - grub_uint32_t block_number; /* 0 if node is not found. */ - grub_uint16_t block_position; - grub_uint64_t next_offset; - grub_int32_t mtime; - grub_off_t size; - enum grub_reiserfs_item_type type; /* To know how to read the header. */ - struct grub_reiserfs_item_header header; + struct VasEBoot_reiserfs_data *data; + VasEBoot_uint32_t block_number; /* 0 if node is not found. */ + VasEBoot_uint16_t block_position; + VasEBoot_uint64_t next_offset; + VasEBoot_int32_t mtime; + VasEBoot_off_t size; + enum VasEBoot_reiserfs_item_type type; /* To know how to read the header. */ + struct VasEBoot_reiserfs_item_header header; }; /* Returned when opening a file. */ -struct grub_reiserfs_data +struct VasEBoot_reiserfs_data { - struct grub_reiserfs_superblock superblock; - grub_disk_t disk; + struct VasEBoot_reiserfs_superblock superblock; + VasEBoot_disk_t disk; }; -static grub_ssize_t -grub_reiserfs_read_real (struct grub_fshelp_node *node, - grub_off_t off, char *buf, grub_size_t len, - grub_disk_read_hook_t read_hook, +static VasEBoot_ssize_t +VasEBoot_reiserfs_read_real (struct VasEBoot_fshelp_node *node, + VasEBoot_off_t off, char *buf, VasEBoot_size_t len, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data); /* Internal-only functions. Not to be used outside of this file. */ /* Return the type of given v2 key. */ -static enum grub_reiserfs_item_type -grub_reiserfs_get_key_v2_type (const struct grub_reiserfs_key *key) +static enum VasEBoot_reiserfs_item_type +VasEBoot_reiserfs_get_key_v2_type (const struct VasEBoot_reiserfs_key *key) { - switch (grub_le_to_cpu64 (key->u.v2.offset_type) >> 60) + switch (VasEBoot_le_to_cpu64 (key->u.v2.offset_type) >> 60) { case 0: - return GRUB_REISERFS_STAT; + return VasEBoot_REISERFS_STAT; case 15: - return GRUB_REISERFS_ANY; + return VasEBoot_REISERFS_ANY; case 3: - return GRUB_REISERFS_DIRECTORY; + return VasEBoot_REISERFS_DIRECTORY; case 2: - return GRUB_REISERFS_DIRECT; + return VasEBoot_REISERFS_DIRECT; case 1: - return GRUB_REISERFS_INDIRECT; + return VasEBoot_REISERFS_INDIRECT; } - return GRUB_REISERFS_UNKNOWN; + return VasEBoot_REISERFS_UNKNOWN; } /* Return the type of given v1 key. */ -static enum grub_reiserfs_item_type -grub_reiserfs_get_key_v1_type (const struct grub_reiserfs_key *key) +static enum VasEBoot_reiserfs_item_type +VasEBoot_reiserfs_get_key_v1_type (const struct VasEBoot_reiserfs_key *key) { - switch (grub_le_to_cpu32 (key->u.v1.type)) + switch (VasEBoot_le_to_cpu32 (key->u.v1.type)) { case 0: - return GRUB_REISERFS_STAT; + return VasEBoot_REISERFS_STAT; case 555: - return GRUB_REISERFS_ANY; + return VasEBoot_REISERFS_ANY; case 500: - return GRUB_REISERFS_DIRECTORY; + return VasEBoot_REISERFS_DIRECTORY; case 0x20000000: case 0xFFFFFFFF: - return GRUB_REISERFS_DIRECT; + return VasEBoot_REISERFS_DIRECT; case 0x10000000: case 0xFFFFFFFE: - return GRUB_REISERFS_INDIRECT; + return VasEBoot_REISERFS_INDIRECT; } - return GRUB_REISERFS_UNKNOWN; + return VasEBoot_REISERFS_UNKNOWN; } /* Return 1 if the given key is version 1 key, 2 otherwise. */ static int -grub_reiserfs_get_key_version (const struct grub_reiserfs_key *key) +VasEBoot_reiserfs_get_key_version (const struct VasEBoot_reiserfs_key *key) { - return grub_reiserfs_get_key_v1_type (key) == GRUB_REISERFS_UNKNOWN ? 2 : 1; + return VasEBoot_reiserfs_get_key_v1_type (key) == VasEBoot_REISERFS_UNKNOWN ? 2 : 1; } -#ifdef GRUB_HEXDUMP +#ifdef VasEBoot_HEXDUMP static void -grub_hexdump (char *buffer, grub_size_t len) +VasEBoot_hexdump (char *buffer, VasEBoot_size_t len) { - grub_size_t a; + VasEBoot_size_t a; for (a = 0; a < len; a++) { if (! (a & 0x0F)) - grub_printf ("\n%08x ", a); - grub_printf ("%02x ", + VasEBoot_printf ("\n%08x ", a); + VasEBoot_printf ("%02x ", ((unsigned int) ((unsigned char *) buffer)[a]) & 0xFF); } - grub_printf ("\n"); + VasEBoot_printf ("\n"); } #endif -#ifdef GRUB_REISERFS_DEBUG -static grub_uint64_t -grub_reiserfs_get_key_offset (const struct grub_reiserfs_key *key); +#ifdef VasEBoot_REISERFS_DEBUG +static VasEBoot_uint64_t +VasEBoot_reiserfs_get_key_offset (const struct VasEBoot_reiserfs_key *key); -static enum grub_reiserfs_item_type -grub_reiserfs_get_key_type (const struct grub_reiserfs_key *key); +static enum VasEBoot_reiserfs_item_type +VasEBoot_reiserfs_get_key_type (const struct VasEBoot_reiserfs_key *key); static void -grub_reiserfs_print_key (const struct grub_reiserfs_key *key) +VasEBoot_reiserfs_print_key (const struct VasEBoot_reiserfs_key *key) { unsigned int a; char *reiserfs_type_strings[] = { @@ -330,78 +330,78 @@ grub_reiserfs_print_key (const struct grub_reiserfs_key *key) "unknown " }; - for (a = 0; a < sizeof (struct grub_reiserfs_key); a++) - grub_printf ("%02x ", ((unsigned int) ((unsigned char *) key)[a]) & 0xFF); - grub_printf ("parent id = 0x%08x, self id = 0x%08x, type = %s, offset = ", - grub_le_to_cpu32 (key->directory_id), - grub_le_to_cpu32 (key->object_id), - reiserfs_type_strings [grub_reiserfs_get_key_type (key)]); - if (grub_reiserfs_get_key_version (key) == 1) - grub_printf("%08x", (unsigned int) grub_reiserfs_get_key_offset (key)); + for (a = 0; a < sizeof (struct VasEBoot_reiserfs_key); a++) + VasEBoot_printf ("%02x ", ((unsigned int) ((unsigned char *) key)[a]) & 0xFF); + VasEBoot_printf ("parent id = 0x%08x, self id = 0x%08x, type = %s, offset = ", + VasEBoot_le_to_cpu32 (key->directory_id), + VasEBoot_le_to_cpu32 (key->object_id), + reiserfs_type_strings [VasEBoot_reiserfs_get_key_type (key)]); + if (VasEBoot_reiserfs_get_key_version (key) == 1) + VasEBoot_printf("%08x", (unsigned int) VasEBoot_reiserfs_get_key_offset (key)); else - grub_printf("0x%07x%08x", - (unsigned) (grub_reiserfs_get_key_offset (key) >> 32), - (unsigned) (grub_reiserfs_get_key_offset (key) & 0xFFFFFFFF)); - grub_printf ("\n"); + VasEBoot_printf("0x%07x%08x", + (unsigned) (VasEBoot_reiserfs_get_key_offset (key) >> 32), + (unsigned) (VasEBoot_reiserfs_get_key_offset (key) & 0xFFFFFFFF)); + VasEBoot_printf ("\n"); } #endif /* Return the offset of given key. */ -static grub_uint64_t -grub_reiserfs_get_key_offset (const struct grub_reiserfs_key *key) +static VasEBoot_uint64_t +VasEBoot_reiserfs_get_key_offset (const struct VasEBoot_reiserfs_key *key) { - if (grub_reiserfs_get_key_version (key) == 1) - return grub_le_to_cpu32 (key->u.v1.offset); + if (VasEBoot_reiserfs_get_key_version (key) == 1) + return VasEBoot_le_to_cpu32 (key->u.v1.offset); else - return grub_le_to_cpu64 (key->u.v2.offset_type) & (~0ULL >> 4); + return VasEBoot_le_to_cpu64 (key->u.v2.offset_type) & (~0ULL >> 4); } /* Set the offset of given key. */ static void -grub_reiserfs_set_key_offset (struct grub_reiserfs_key *key, - grub_uint64_t value) +VasEBoot_reiserfs_set_key_offset (struct VasEBoot_reiserfs_key *key, + VasEBoot_uint64_t value) { - if (grub_reiserfs_get_key_version (key) == 1) - key->u.v1.offset = grub_cpu_to_le32 (value); + if (VasEBoot_reiserfs_get_key_version (key) == 1) + key->u.v1.offset = VasEBoot_cpu_to_le32 (value); else key->u.v2.offset_type \ - = ((key->u.v2.offset_type & grub_cpu_to_le64_compile_time (15ULL << 60)) - | grub_cpu_to_le64 (value & (~0ULL >> 4))); + = ((key->u.v2.offset_type & VasEBoot_cpu_to_le64_compile_time (15ULL << 60)) + | VasEBoot_cpu_to_le64 (value & (~0ULL >> 4))); } /* Return the type of given key. */ -static enum grub_reiserfs_item_type -grub_reiserfs_get_key_type (const struct grub_reiserfs_key *key) +static enum VasEBoot_reiserfs_item_type +VasEBoot_reiserfs_get_key_type (const struct VasEBoot_reiserfs_key *key) { - if (grub_reiserfs_get_key_version (key) == 1) - return grub_reiserfs_get_key_v1_type (key); + if (VasEBoot_reiserfs_get_key_version (key) == 1) + return VasEBoot_reiserfs_get_key_v1_type (key); else - return grub_reiserfs_get_key_v2_type (key); + return VasEBoot_reiserfs_get_key_v2_type (key); } /* Set the type of given key, with given version number. */ static void -grub_reiserfs_set_key_type (struct grub_reiserfs_key *key, - enum grub_reiserfs_item_type grub_type, +VasEBoot_reiserfs_set_key_type (struct VasEBoot_reiserfs_key *key, + enum VasEBoot_reiserfs_item_type VasEBoot_type, int version) { - grub_uint32_t type; + VasEBoot_uint32_t type; - switch (grub_type) + switch (VasEBoot_type) { - case GRUB_REISERFS_STAT: + case VasEBoot_REISERFS_STAT: type = 0; break; - case GRUB_REISERFS_ANY: + case VasEBoot_REISERFS_ANY: type = (version == 1) ? 555 : 15; break; - case GRUB_REISERFS_DIRECTORY: + case VasEBoot_REISERFS_DIRECTORY: type = (version == 1) ? 500 : 3; break; - case GRUB_REISERFS_DIRECT: + case VasEBoot_REISERFS_DIRECT: type = (version == 1) ? 0xFFFFFFFF : 2; break; - case GRUB_REISERFS_INDIRECT: + case VasEBoot_REISERFS_INDIRECT: type = (version == 1) ? 0xFFFFFFFE : 1; break; default: @@ -409,58 +409,58 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key, } if (version == 1) - key->u.v1.type = grub_cpu_to_le32 (type); + key->u.v1.type = VasEBoot_cpu_to_le32 (type); else key->u.v2.offset_type - = ((key->u.v2.offset_type & grub_cpu_to_le64_compile_time (~0ULL >> 4)) - | grub_cpu_to_le64 ((grub_uint64_t) type << 60)); + = ((key->u.v2.offset_type & VasEBoot_cpu_to_le64_compile_time (~0ULL >> 4)) + | VasEBoot_cpu_to_le64 ((VasEBoot_uint64_t) type << 60)); - assert (grub_reiserfs_get_key_type (key) == grub_type); + assert (VasEBoot_reiserfs_get_key_type (key) == VasEBoot_type); } /* -1 if key 1 if lower than key 2. 0 if key 1 is equal to key 2. 1 if key 1 is higher than key 2. */ static int -grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1, - const struct grub_reiserfs_key *key2) +VasEBoot_reiserfs_compare_keys (const struct VasEBoot_reiserfs_key *key1, + const struct VasEBoot_reiserfs_key *key2) { - grub_uint64_t offset1, offset2; - enum grub_reiserfs_item_type type1, type2; - grub_uint32_t id1, id2; + VasEBoot_uint64_t offset1, offset2; + enum VasEBoot_reiserfs_item_type type1, type2; + VasEBoot_uint32_t id1, id2; if (! key1 || ! key2) return -2; - id1 = grub_le_to_cpu32 (key1->directory_id); - id2 = grub_le_to_cpu32 (key2->directory_id); + id1 = VasEBoot_le_to_cpu32 (key1->directory_id); + id2 = VasEBoot_le_to_cpu32 (key2->directory_id); if (id1 < id2) return -1; if (id1 > id2) return 1; - id1 = grub_le_to_cpu32 (key1->object_id); - id2 = grub_le_to_cpu32 (key2->object_id); + id1 = VasEBoot_le_to_cpu32 (key1->object_id); + id2 = VasEBoot_le_to_cpu32 (key2->object_id); if (id1 < id2) return -1; if (id1 > id2) return 1; - offset1 = grub_reiserfs_get_key_offset (key1); - offset2 = grub_reiserfs_get_key_offset (key2); + offset1 = VasEBoot_reiserfs_get_key_offset (key1); + offset2 = VasEBoot_reiserfs_get_key_offset (key2); if (offset1 < offset2) return -1; if (offset1 > offset2) return 1; - type1 = grub_reiserfs_get_key_type (key1); - type2 = grub_reiserfs_get_key_type (key2); - if ((type1 == GRUB_REISERFS_ANY - && (type2 == GRUB_REISERFS_DIRECT - || type2 == GRUB_REISERFS_INDIRECT)) - || (type2 == GRUB_REISERFS_ANY - && (type1 == GRUB_REISERFS_DIRECT - || type1 == GRUB_REISERFS_INDIRECT))) + type1 = VasEBoot_reiserfs_get_key_type (key1); + type2 = VasEBoot_reiserfs_get_key_type (key2); + if ((type1 == VasEBoot_REISERFS_ANY + && (type2 == VasEBoot_REISERFS_DIRECT + || type2 == VasEBoot_REISERFS_INDIRECT)) + || (type2 == VasEBoot_REISERFS_ANY + && (type1 == VasEBoot_REISERFS_DIRECT + || type1 == VasEBoot_REISERFS_INDIRECT))) return 0; if (type1 < type2) return -1; @@ -472,113 +472,113 @@ grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1, /* Find the item identified by KEY in mounted filesystem DATA, and fill ITEM accordingly to what was found. */ -static grub_err_t -grub_reiserfs_get_item (struct grub_reiserfs_data *data, - const struct grub_reiserfs_key *key, - struct grub_fshelp_node *item, int exact) +static VasEBoot_err_t +VasEBoot_reiserfs_get_item (struct VasEBoot_reiserfs_data *data, + const struct VasEBoot_reiserfs_key *key, + struct VasEBoot_fshelp_node *item, int exact) { - grub_uint32_t block_number; - struct grub_reiserfs_block_header *block_header = 0; - struct grub_reiserfs_key *block_key = 0; - grub_uint16_t block_size, item_count, current_level; - grub_uint16_t i; - grub_uint16_t previous_level = ~0; - struct grub_reiserfs_item_header *item_headers = 0; + VasEBoot_uint32_t block_number; + struct VasEBoot_reiserfs_block_header *block_header = 0; + struct VasEBoot_reiserfs_key *block_key = 0; + VasEBoot_uint16_t block_size, item_count, current_level; + VasEBoot_uint16_t i; + VasEBoot_uint16_t previous_level = ~0; + struct VasEBoot_reiserfs_item_header *item_headers = 0; #if 0 if (! data) { - grub_error (GRUB_ERR_BAD_FS, "data is NULL"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "data is NULL"); goto fail; } if (! key) { - grub_error (GRUB_ERR_BAD_FS, "key is NULL"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "key is NULL"); goto fail; } if (! item) { - grub_error (GRUB_ERR_BAD_FS, "item is NULL"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "item is NULL"); goto fail; } #endif - block_size = grub_le_to_cpu16 (data->superblock.block_size); - block_number = grub_le_to_cpu32 (data->superblock.root_block); -#ifdef GRUB_REISERFS_DEBUG - grub_printf("Searching for "); - grub_reiserfs_print_key (key); + block_size = VasEBoot_le_to_cpu16 (data->superblock.block_size); + block_number = VasEBoot_le_to_cpu32 (data->superblock.root_block); +#ifdef VasEBoot_REISERFS_DEBUG + VasEBoot_printf("Searching for "); + VasEBoot_reiserfs_print_key (key); #endif - block_header = grub_malloc (block_size); + block_header = VasEBoot_malloc (block_size); if (! block_header) goto fail; item->next_offset = 0; do { - grub_disk_read (data->disk, - block_number * (block_size >> GRUB_DISK_SECTOR_BITS), - (((grub_off_t) block_number * block_size) - & (GRUB_DISK_SECTOR_SIZE - 1)), + VasEBoot_disk_read (data->disk, + block_number * (block_size >> VasEBoot_DISK_SECTOR_BITS), + (((VasEBoot_off_t) block_number * block_size) + & (VasEBoot_DISK_SECTOR_SIZE - 1)), block_size, block_header); - if (grub_errno) + if (VasEBoot_errno) goto fail; - current_level = grub_le_to_cpu16 (block_header->level); - grub_dprintf ("reiserfs_tree", " at level %d\n", current_level); + current_level = VasEBoot_le_to_cpu16 (block_header->level); + VasEBoot_dprintf ("reiserfs_tree", " at level %d\n", current_level); if (current_level >= previous_level) { - grub_dprintf ("reiserfs_tree", "level loop detected, aborting\n"); - grub_error (GRUB_ERR_BAD_FS, "level loop"); + VasEBoot_dprintf ("reiserfs_tree", "level loop detected, aborting\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "level loop"); goto fail; } previous_level = current_level; - item_count = grub_le_to_cpu16 (block_header->item_count); - grub_dprintf ("reiserfs_tree", " number of contained items : %d\n", + item_count = VasEBoot_le_to_cpu16 (block_header->item_count); + VasEBoot_dprintf ("reiserfs_tree", " number of contained items : %d\n", item_count); if (current_level > 1) { /* Internal node. Navigate to the child that should contain the searched key. */ - struct grub_reiserfs_key *keys - = (struct grub_reiserfs_key *) (block_header + 1); - struct grub_reiserfs_disk_child *children - = ((struct grub_reiserfs_disk_child *) + struct VasEBoot_reiserfs_key *keys + = (struct VasEBoot_reiserfs_key *) (block_header + 1); + struct VasEBoot_reiserfs_disk_child *children + = ((struct VasEBoot_reiserfs_disk_child *) (keys + item_count)); for (i = 0; i < item_count - && grub_reiserfs_compare_keys (key, &(keys[i])) >= 0; + && VasEBoot_reiserfs_compare_keys (key, &(keys[i])) >= 0; i++) { -#ifdef GRUB_REISERFS_DEBUG - grub_printf("i %03d/%03d ", i + 1, item_count + 1); - grub_reiserfs_print_key (&(keys[i])); +#ifdef VasEBoot_REISERFS_DEBUG + VasEBoot_printf("i %03d/%03d ", i + 1, item_count + 1); + VasEBoot_reiserfs_print_key (&(keys[i])); #endif } - block_number = grub_le_to_cpu32 (children[i].block_number); + block_number = VasEBoot_le_to_cpu32 (children[i].block_number); if ((i < item_count) && (key->directory_id == keys[i].directory_id) && (key->object_id == keys[i].object_id)) - item->next_offset = grub_reiserfs_get_key_offset(&(keys[i])); -#ifdef GRUB_REISERFS_DEBUG + item->next_offset = VasEBoot_reiserfs_get_key_offset(&(keys[i])); +#ifdef VasEBoot_REISERFS_DEBUG if (i == item_count - || grub_reiserfs_compare_keys (key, &(keys[i])) == 0) - grub_printf(">"); + || VasEBoot_reiserfs_compare_keys (key, &(keys[i])) == 0) + VasEBoot_printf(">"); else - grub_printf("<"); + VasEBoot_printf("<"); if (i < item_count) { - grub_printf (" %03d/%03d ", i + 1, item_count + 1); - grub_reiserfs_print_key (&(keys[i])); + VasEBoot_printf (" %03d/%03d ", i + 1, item_count + 1); + VasEBoot_reiserfs_print_key (&(keys[i])); if (i + 1 < item_count) { - grub_printf ("+ %03d/%03d ", i + 2, item_count); - grub_reiserfs_print_key (&(keys[i + 1])); + VasEBoot_printf ("+ %03d/%03d ", i + 2, item_count); + VasEBoot_reiserfs_print_key (&(keys[i + 1])); } } else - grub_printf ("Accessing rightmost child at block %d.\n", + VasEBoot_printf ("Accessing rightmost child at block %d.\n", block_number); #endif } @@ -586,13 +586,13 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, { /* Leaf node. Check that the key is actually present. */ item_headers - = (struct grub_reiserfs_item_header *) (block_header + 1); + = (struct VasEBoot_reiserfs_item_header *) (block_header + 1); for (i = 0; i < item_count; i++) { int val; - val = grub_reiserfs_compare_keys (key, &(item_headers[i].key)); + val = VasEBoot_reiserfs_compare_keys (key, &(item_headers[i].key)); if (val == 0) { block_key = &(item_headers[i].key); @@ -604,7 +604,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, { if (i == 0) { - grub_error (GRUB_ERR_READ_ERROR, "unexpected btree node"); + VasEBoot_error (VasEBoot_ERR_READ_ERROR, "unexpected btree node"); goto fail; } i--; @@ -616,7 +616,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, { if (i == 0) { - grub_error (GRUB_ERR_READ_ERROR, "unexpected btree node"); + VasEBoot_error (VasEBoot_ERR_READ_ERROR, "unexpected btree node"); goto fail; } i--; @@ -632,51 +632,51 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, { item->block_number = 0; item->block_position = 0; - item->type = GRUB_REISERFS_UNKNOWN; -#ifdef GRUB_REISERFS_DEBUG - grub_printf("Not found.\n"); + item->type = VasEBoot_REISERFS_UNKNOWN; +#ifdef VasEBoot_REISERFS_DEBUG + VasEBoot_printf("Not found.\n"); #endif } else { item->block_number = block_number; item->block_position = i; - item->type = grub_reiserfs_get_key_type (block_key); - grub_memcpy (&(item->header), &(item_headers[i]), - sizeof (struct grub_reiserfs_item_header)); -#ifdef GRUB_REISERFS_DEBUG - grub_printf ("F %03d/%03d ", i + 1, item_count); - grub_reiserfs_print_key (block_key); + item->type = VasEBoot_reiserfs_get_key_type (block_key); + VasEBoot_memcpy (&(item->header), &(item_headers[i]), + sizeof (struct VasEBoot_reiserfs_item_header)); +#ifdef VasEBoot_REISERFS_DEBUG + VasEBoot_printf ("F %03d/%03d ", i + 1, item_count); + VasEBoot_reiserfs_print_key (block_key); #endif } - assert (grub_errno == GRUB_ERR_NONE); - grub_free (block_header); - return GRUB_ERR_NONE; + assert (VasEBoot_errno == VasEBoot_ERR_NONE); + VasEBoot_free (block_header); + return VasEBoot_ERR_NONE; fail: - assert (grub_errno != GRUB_ERR_NONE); - grub_free (block_header); - assert (grub_errno != GRUB_ERR_NONE); - return grub_errno; + assert (VasEBoot_errno != VasEBoot_ERR_NONE); + VasEBoot_free (block_header); + assert (VasEBoot_errno != VasEBoot_ERR_NONE); + return VasEBoot_errno; } /* Return the path of the file which is pointed at by symlink NODE. */ static char * -grub_reiserfs_read_symlink (grub_fshelp_node_t node) +VasEBoot_reiserfs_read_symlink (VasEBoot_fshelp_node_t node) { char *symlink_buffer = 0; - grub_size_t len = node->size; - grub_ssize_t ret; + VasEBoot_size_t len = node->size; + VasEBoot_ssize_t ret; - symlink_buffer = grub_malloc (len + 1); + symlink_buffer = VasEBoot_malloc (len + 1); if (! symlink_buffer) return 0; - ret = grub_reiserfs_read_real (node, 0, symlink_buffer, len, 0, 0); + ret = VasEBoot_reiserfs_read_real (node, 0, symlink_buffer, len, 0, 0); if (ret < 0) { - grub_free (symlink_buffer); + VasEBoot_free (symlink_buffer); return 0; } @@ -685,21 +685,21 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) } /* Fill the mounted filesystem structure and return it. */ -static struct grub_reiserfs_data * -grub_reiserfs_mount (grub_disk_t disk) +static struct VasEBoot_reiserfs_data * +VasEBoot_reiserfs_mount (VasEBoot_disk_t disk) { - struct grub_reiserfs_data *data = 0; - data = grub_malloc (sizeof (*data)); + struct VasEBoot_reiserfs_data *data = 0; + data = VasEBoot_malloc (sizeof (*data)); if (! data) goto fail; - grub_disk_read (disk, REISERFS_SUPER_BLOCK_OFFSET / GRUB_DISK_SECTOR_SIZE, + VasEBoot_disk_read (disk, REISERFS_SUPER_BLOCK_OFFSET / VasEBoot_DISK_SECTOR_SIZE, 0, sizeof (data->superblock), &(data->superblock)); - if (grub_errno) + if (VasEBoot_errno) goto fail; - if (grub_memcmp (data->superblock.magic_string, + if (VasEBoot_memcmp (data->superblock.magic_string, REISERFS_MAGIC_STRING, sizeof (REISERFS_MAGIC_STRING) - 1)) { - grub_error (GRUB_ERR_BAD_FS, "not a ReiserFS filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a ReiserFS filesystem"); goto fail; } data->disk = disk; @@ -707,100 +707,100 @@ grub_reiserfs_mount (grub_disk_t disk) fail: /* Disk is too small to contain a ReiserFS. */ - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a ReiserFS filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a ReiserFS filesystem"); - grub_free (data); + VasEBoot_free (data); return 0; } /* Call HOOK for each file in directory ITEM. */ static int -grub_reiserfs_iterate_dir (grub_fshelp_node_t item, - grub_fshelp_iterate_dir_hook_t hook, +VasEBoot_reiserfs_iterate_dir (VasEBoot_fshelp_node_t item, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - struct grub_reiserfs_data *data = item->data; - struct grub_reiserfs_block_header *block_header = 0; - grub_uint16_t block_size, block_position; - grub_uint32_t block_number; - grub_uint64_t next_offset = item->next_offset; + struct VasEBoot_reiserfs_data *data = item->data; + struct VasEBoot_reiserfs_block_header *block_header = 0; + VasEBoot_uint16_t block_size, block_position; + VasEBoot_uint32_t block_number; + VasEBoot_uint64_t next_offset = item->next_offset; int ret = 0; - if (item->type != GRUB_REISERFS_DIRECTORY) + if (item->type != VasEBoot_REISERFS_DIRECTORY) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); goto fail; } - block_size = grub_le_to_cpu16 (data->superblock.block_size); - block_header = grub_malloc (block_size + 1); + block_size = VasEBoot_le_to_cpu16 (data->superblock.block_size); + block_header = VasEBoot_malloc (block_size + 1); if (! block_header) goto fail; block_number = item->block_number; block_position = item->block_position; - grub_dprintf ("reiserfs", "Iterating directory...\n"); + VasEBoot_dprintf ("reiserfs", "Iterating directory...\n"); do { - struct grub_reiserfs_directory_header *directory_headers; - struct grub_fshelp_node directory_item; - grub_uint16_t entry_count, entry_number; - struct grub_reiserfs_item_header *item_headers; + struct VasEBoot_reiserfs_directory_header *directory_headers; + struct VasEBoot_fshelp_node directory_item; + VasEBoot_uint16_t entry_count, entry_number; + struct VasEBoot_reiserfs_item_header *item_headers; - grub_disk_read (data->disk, - block_number * (block_size >> GRUB_DISK_SECTOR_BITS), - (((grub_off_t) block_number * block_size) - & (GRUB_DISK_SECTOR_SIZE - 1)), + VasEBoot_disk_read (data->disk, + block_number * (block_size >> VasEBoot_DISK_SECTOR_BITS), + (((VasEBoot_off_t) block_number * block_size) + & (VasEBoot_DISK_SECTOR_SIZE - 1)), block_size, (char *) block_header); - if (grub_errno) + if (VasEBoot_errno) goto fail; ((char *) block_header)[block_size] = 0; #if 0 - if (grub_le_to_cpu16 (block_header->level) != 1) + if (VasEBoot_le_to_cpu16 (block_header->level) != 1) { - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, "reiserfs: block %d is not a leaf block", block_number); goto fail; } #endif - item_headers = (struct grub_reiserfs_item_header *) (block_header + 1); + item_headers = (struct VasEBoot_reiserfs_item_header *) (block_header + 1); directory_headers - = ((struct grub_reiserfs_directory_header *) + = ((struct VasEBoot_reiserfs_directory_header *) ((char *) block_header - + grub_le_to_cpu16 (item_headers[block_position].item_location))); + + VasEBoot_le_to_cpu16 (item_headers[block_position].item_location))); entry_count - = grub_le_to_cpu16 (item_headers[block_position].u.entry_count); + = VasEBoot_le_to_cpu16 (item_headers[block_position].u.entry_count); for (entry_number = 0; entry_number < entry_count; entry_number++) { - struct grub_reiserfs_directory_header *directory_header + struct VasEBoot_reiserfs_directory_header *directory_header = &directory_headers[entry_number]; - grub_uint16_t entry_state - = grub_le_to_cpu16 (directory_header->state); - grub_fshelp_node_t entry_item; - struct grub_reiserfs_key entry_key; - enum grub_fshelp_filetype entry_type; + VasEBoot_uint16_t entry_state + = VasEBoot_le_to_cpu16 (directory_header->state); + VasEBoot_fshelp_node_t entry_item; + struct VasEBoot_reiserfs_key entry_key; + enum VasEBoot_fshelp_filetype entry_type; char *entry_name; char *entry_name_end = 0; char c; - if (!(entry_state & GRUB_REISERFS_VISIBLE_MASK)) + if (!(entry_state & VasEBoot_REISERFS_VISIBLE_MASK)) continue; entry_name = (((char *) directory_headers) - + grub_le_to_cpu16 (directory_header->location)); + + VasEBoot_le_to_cpu16 (directory_header->location)); if (entry_number == 0) { entry_name_end = (char *) block_header - + grub_le_to_cpu16 (item_headers[block_position].item_location) - + grub_le_to_cpu16 (item_headers[block_position].item_size); + + VasEBoot_le_to_cpu16 (item_headers[block_position].item_location) + + VasEBoot_le_to_cpu16 (item_headers[block_position].item_size); } else { entry_name_end = (((char *) directory_headers) - + grub_le_to_cpu16 (directory_headers[entry_number - 1].location)); + + VasEBoot_le_to_cpu16 (directory_headers[entry_number - 1].location)); } if (entry_name_end < entry_name || entry_name_end > (char *) block_header + block_size) { @@ -810,77 +810,77 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, entry_key.directory_id = directory_header->directory_id; entry_key.object_id = directory_header->object_id; entry_key.u.v2.offset_type = 0; - grub_reiserfs_set_key_type (&entry_key, GRUB_REISERFS_DIRECTORY, + VasEBoot_reiserfs_set_key_type (&entry_key, VasEBoot_REISERFS_DIRECTORY, 2); - grub_reiserfs_set_key_offset (&entry_key, 1); + VasEBoot_reiserfs_set_key_offset (&entry_key, 1); - entry_item = grub_malloc (sizeof (*entry_item)); + entry_item = VasEBoot_malloc (sizeof (*entry_item)); if (! entry_item) goto fail; - if (grub_reiserfs_get_item (data, &entry_key, entry_item, 1) - != GRUB_ERR_NONE) + if (VasEBoot_reiserfs_get_item (data, &entry_key, entry_item, 1) + != VasEBoot_ERR_NONE) { - grub_free (entry_item); + VasEBoot_free (entry_item); goto fail; } - if (entry_item->type == GRUB_REISERFS_DIRECTORY) - entry_type = GRUB_FSHELP_DIR; + if (entry_item->type == VasEBoot_REISERFS_DIRECTORY) + entry_type = VasEBoot_FSHELP_DIR; else { - grub_uint32_t entry_block_number; + VasEBoot_uint32_t entry_block_number; /* Order is very important here. First set the offset to 0 using current key version. Then change the key type, which affects key version detection. */ - grub_reiserfs_set_key_offset (&entry_key, 0); - grub_reiserfs_set_key_type (&entry_key, GRUB_REISERFS_STAT, + VasEBoot_reiserfs_set_key_offset (&entry_key, 0); + VasEBoot_reiserfs_set_key_type (&entry_key, VasEBoot_REISERFS_STAT, 2); - if (grub_reiserfs_get_item (data, &entry_key, entry_item, 1) - != GRUB_ERR_NONE) + if (VasEBoot_reiserfs_get_item (data, &entry_key, entry_item, 1) + != VasEBoot_ERR_NONE) { - grub_free (entry_item); + VasEBoot_free (entry_item); goto fail; } if (entry_item->block_number != 0) { - grub_uint16_t entry_version; + VasEBoot_uint16_t entry_version; entry_version - = grub_le_to_cpu16 (entry_item->header.version); + = VasEBoot_le_to_cpu16 (entry_item->header.version); entry_block_number = entry_item->block_number; #if 0 - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "version %04x block %08x (%08x) position %08x\n", entry_version, entry_block_number, - ((grub_disk_addr_t) entry_block_number * block_size) / GRUB_DISK_SECTOR_SIZE, - grub_le_to_cpu16 (entry_item->header.item_location)); + ((VasEBoot_disk_addr_t) entry_block_number * block_size) / VasEBoot_DISK_SECTOR_SIZE, + VasEBoot_le_to_cpu16 (entry_item->header.item_location)); #endif if (entry_version == 0) /* Version 1 stat item. */ { - struct grub_reiserfs_stat_item_v1 entry_v1_stat; - grub_disk_read (data->disk, - entry_block_number * (block_size >> GRUB_DISK_SECTOR_BITS), - grub_le_to_cpu16 (entry_item->header.item_location), + struct VasEBoot_reiserfs_stat_item_v1 entry_v1_stat; + VasEBoot_disk_read (data->disk, + entry_block_number * (block_size >> VasEBoot_DISK_SECTOR_BITS), + VasEBoot_le_to_cpu16 (entry_item->header.item_location), sizeof (entry_v1_stat), (char *) &entry_v1_stat); - if (grub_errno) + if (VasEBoot_errno) goto fail; #if 0 - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "%04x %04x %04x %04x %08x %08x | %08x %08x %08x %08x\n", - grub_le_to_cpu16 (entry_v1_stat.mode), - grub_le_to_cpu16 (entry_v1_stat.hardlink_count), - grub_le_to_cpu16 (entry_v1_stat.uid), - grub_le_to_cpu16 (entry_v1_stat.gid), - grub_le_to_cpu32 (entry_v1_stat.size), - grub_le_to_cpu32 (entry_v1_stat.atime), - grub_le_to_cpu32 (entry_v1_stat.mtime), - grub_le_to_cpu32 (entry_v1_stat.ctime), - grub_le_to_cpu32 (entry_v1_stat.rdev), - grub_le_to_cpu32 (entry_v1_stat.first_direct_byte)); - grub_dprintf ("reiserfs", + VasEBoot_le_to_cpu16 (entry_v1_stat.mode), + VasEBoot_le_to_cpu16 (entry_v1_stat.hardlink_count), + VasEBoot_le_to_cpu16 (entry_v1_stat.uid), + VasEBoot_le_to_cpu16 (entry_v1_stat.gid), + VasEBoot_le_to_cpu32 (entry_v1_stat.size), + VasEBoot_le_to_cpu32 (entry_v1_stat.atime), + VasEBoot_le_to_cpu32 (entry_v1_stat.mtime), + VasEBoot_le_to_cpu32 (entry_v1_stat.ctime), + VasEBoot_le_to_cpu32 (entry_v1_stat.rdev), + VasEBoot_le_to_cpu32 (entry_v1_stat.first_direct_byte)); + VasEBoot_dprintf ("reiserfs", "%04x %04x %04x %04x %08x %08x | %08x %08x %08x %08x\n", entry_v1_stat.mode, entry_v1_stat.hardlink_count, @@ -893,40 +893,40 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, entry_v1_stat.rdev, entry_v1_stat.first_direct_byte); #endif - entry_item->mtime = grub_le_to_cpu32 (entry_v1_stat.mtime); - if ((grub_le_to_cpu16 (entry_v1_stat.mode) & S_IFLNK) + entry_item->mtime = VasEBoot_le_to_cpu32 (entry_v1_stat.mtime); + if ((VasEBoot_le_to_cpu16 (entry_v1_stat.mode) & S_IFLNK) == S_IFLNK) - entry_type = GRUB_FSHELP_SYMLINK; + entry_type = VasEBoot_FSHELP_SYMLINK; else - entry_type = GRUB_FSHELP_REG; - entry_item->size = (grub_off_t) grub_le_to_cpu32 (entry_v1_stat.size); + entry_type = VasEBoot_FSHELP_REG; + entry_item->size = (VasEBoot_off_t) VasEBoot_le_to_cpu32 (entry_v1_stat.size); } else { - struct grub_reiserfs_stat_item_v2 entry_v2_stat; - grub_disk_read (data->disk, - entry_block_number * (block_size >> GRUB_DISK_SECTOR_BITS), - grub_le_to_cpu16 (entry_item->header.item_location), + struct VasEBoot_reiserfs_stat_item_v2 entry_v2_stat; + VasEBoot_disk_read (data->disk, + entry_block_number * (block_size >> VasEBoot_DISK_SECTOR_BITS), + VasEBoot_le_to_cpu16 (entry_item->header.item_location), sizeof (entry_v2_stat), (char *) &entry_v2_stat); - if (grub_errno) + if (VasEBoot_errno) goto fail; #if 0 - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "%04x %04x %08x %08x%08x | %08x %08x %08x %08x | %08x %08x %08x\n", - grub_le_to_cpu16 (entry_v2_stat.mode), - grub_le_to_cpu16 (entry_v2_stat.reserved), - grub_le_to_cpu32 (entry_v2_stat.hardlink_count), - (unsigned int) (grub_le_to_cpu64 (entry_v2_stat.size) >> 32), - (unsigned int) (grub_le_to_cpu64 (entry_v2_stat.size) && 0xFFFFFFFF), - grub_le_to_cpu32 (entry_v2_stat.uid), - grub_le_to_cpu32 (entry_v2_stat.gid), - grub_le_to_cpu32 (entry_v2_stat.atime), - grub_le_to_cpu32 (entry_v2_stat.mtime), - grub_le_to_cpu32 (entry_v2_stat.ctime), - grub_le_to_cpu32 (entry_v2_stat.blocks), - grub_le_to_cpu32 (entry_v2_stat.first_direct_byte)); - grub_dprintf ("reiserfs", + VasEBoot_le_to_cpu16 (entry_v2_stat.mode), + VasEBoot_le_to_cpu16 (entry_v2_stat.reserved), + VasEBoot_le_to_cpu32 (entry_v2_stat.hardlink_count), + (unsigned int) (VasEBoot_le_to_cpu64 (entry_v2_stat.size) >> 32), + (unsigned int) (VasEBoot_le_to_cpu64 (entry_v2_stat.size) && 0xFFFFFFFF), + VasEBoot_le_to_cpu32 (entry_v2_stat.uid), + VasEBoot_le_to_cpu32 (entry_v2_stat.gid), + VasEBoot_le_to_cpu32 (entry_v2_stat.atime), + VasEBoot_le_to_cpu32 (entry_v2_stat.mtime), + VasEBoot_le_to_cpu32 (entry_v2_stat.ctime), + VasEBoot_le_to_cpu32 (entry_v2_stat.blocks), + VasEBoot_le_to_cpu32 (entry_v2_stat.first_direct_byte)); + VasEBoot_dprintf ("reiserfs", "%04x %04x %08x %08x%08x | %08x %08x %08x %08x | %08x %08x %08x\n", entry_v2_stat.mode, entry_v2_stat.reserved, @@ -941,23 +941,23 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, entry_v2_stat.blocks, entry_v2_stat.first_direct_byte); #endif - entry_item->mtime = grub_le_to_cpu32 (entry_v2_stat.mtime); - entry_item->size = (grub_off_t) grub_le_to_cpu64 (entry_v2_stat.size); - if ((grub_le_to_cpu16 (entry_v2_stat.mode) & S_IFLNK) + entry_item->mtime = VasEBoot_le_to_cpu32 (entry_v2_stat.mtime); + entry_item->size = (VasEBoot_off_t) VasEBoot_le_to_cpu64 (entry_v2_stat.size); + if ((VasEBoot_le_to_cpu16 (entry_v2_stat.mode) & S_IFLNK) == S_IFLNK) - entry_type = GRUB_FSHELP_SYMLINK; + entry_type = VasEBoot_FSHELP_SYMLINK; else - entry_type = GRUB_FSHELP_REG; + entry_type = VasEBoot_FSHELP_REG; } } else { /* Pseudo file ".." never has stat block. */ - if (entry_name_end == entry_name + 2 && grub_memcmp (entry_name, "..", 2) != 0) - grub_dprintf ("reiserfs", + if (entry_name_end == entry_name + 2 && VasEBoot_memcmp (entry_name, "..", 2) != 0) + VasEBoot_dprintf ("reiserfs", "Warning : %s has no stat block !\n", entry_name); - grub_free (entry_item); + VasEBoot_free (entry_item); goto next; } } @@ -967,7 +967,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, if (hook (entry_name, entry_type, entry_item, hook_data)) { *entry_name_end = c; - grub_dprintf ("reiserfs", "Found : %s, type=%d\n", + VasEBoot_dprintf ("reiserfs", "Found : %s, type=%d\n", entry_name, entry_type); ret = 1; goto found; @@ -981,10 +981,10 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, if (next_offset == 0) break; - grub_reiserfs_set_key_offset (&(item_headers[block_position].key), + VasEBoot_reiserfs_set_key_offset (&(item_headers[block_position].key), next_offset); - if (grub_reiserfs_get_item (data, &(item_headers[block_position].key), - &directory_item, 1) != GRUB_ERR_NONE) + if (VasEBoot_reiserfs_get_item (data, &(item_headers[block_position].key), + &directory_item, 1) != VasEBoot_ERR_NONE) goto fail; block_number = directory_item.block_number; block_position = directory_item.block_position; @@ -993,144 +993,144 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, while (block_number); found: - assert (grub_errno == GRUB_ERR_NONE); - grub_free (block_header); + assert (VasEBoot_errno == VasEBoot_ERR_NONE); + VasEBoot_free (block_header); return ret; fail: - assert (grub_errno != GRUB_ERR_NONE); - grub_free (block_header); + assert (VasEBoot_errno != VasEBoot_ERR_NONE); + VasEBoot_free (block_header); return 0; } /****************************************************************************/ -/* grub api functions */ +/* VasEBoot api functions */ /****************************************************************************/ /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_reiserfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_reiserfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_reiserfs_data *data = 0; - struct grub_fshelp_node root, *found = 0; - struct grub_reiserfs_key key; + struct VasEBoot_reiserfs_data *data = 0; + struct VasEBoot_fshelp_node root, *found = 0; + struct VasEBoot_reiserfs_key key; - grub_dl_ref (my_mod); - data = grub_reiserfs_mount (file->device->disk); + VasEBoot_dl_ref (my_mod); + data = VasEBoot_reiserfs_mount (file->device->disk); if (! data) goto fail; - key.directory_id = grub_cpu_to_le32_compile_time (1); - key.object_id = grub_cpu_to_le32_compile_time (2); + key.directory_id = VasEBoot_cpu_to_le32_compile_time (1); + key.object_id = VasEBoot_cpu_to_le32_compile_time (2); key.u.v2.offset_type = 0; - grub_reiserfs_set_key_type (&key, GRUB_REISERFS_DIRECTORY, 2); - grub_reiserfs_set_key_offset (&key, 1); - if (grub_reiserfs_get_item (data, &key, &root, 1) != GRUB_ERR_NONE) + VasEBoot_reiserfs_set_key_type (&key, VasEBoot_REISERFS_DIRECTORY, 2); + VasEBoot_reiserfs_set_key_offset (&key, 1); + if (VasEBoot_reiserfs_get_item (data, &key, &root, 1) != VasEBoot_ERR_NONE) goto fail; if (root.block_number == 0) { - grub_error (GRUB_ERR_BAD_FS, "unable to find root item"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "unable to find root item"); goto fail; /* Should never happen since checked at mount. */ } - grub_fshelp_find_file (name, &root, &found, - grub_reiserfs_iterate_dir, - grub_reiserfs_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &root, &found, + VasEBoot_reiserfs_iterate_dir, + VasEBoot_reiserfs_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; file->size = found->size; - grub_dprintf ("reiserfs", "file size : %d (%08x%08x)\n", + VasEBoot_dprintf ("reiserfs", "file size : %d (%08x%08x)\n", (unsigned int) file->size, (unsigned int) (file->size >> 32), (unsigned int) file->size); file->offset = 0; file->data = found; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - assert (grub_errno != GRUB_ERR_NONE); + assert (VasEBoot_errno != VasEBoot_ERR_NONE); if (found != &root) - grub_free (found); - grub_free (data); - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_free (found); + VasEBoot_free (data); + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } -static grub_ssize_t -grub_reiserfs_read_real (struct grub_fshelp_node *node, - grub_off_t off, char *buf, grub_size_t len, - grub_disk_read_hook_t read_hook, void *read_hook_data) +static VasEBoot_ssize_t +VasEBoot_reiserfs_read_real (struct VasEBoot_fshelp_node *node, + VasEBoot_off_t off, char *buf, VasEBoot_size_t len, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data) { unsigned int indirect_block, indirect_block_count; - struct grub_reiserfs_key key; - struct grub_reiserfs_data *data = node->data; - struct grub_fshelp_node found; - grub_uint16_t block_size = grub_le_to_cpu16 (data->superblock.block_size); - grub_uint16_t item_size; - grub_uint32_t *indirect_block_ptr = 0; - grub_uint64_t current_key_offset = 1; - grub_off_t initial_position, current_position, final_position, length; - grub_disk_addr_t block; - grub_off_t offset; + struct VasEBoot_reiserfs_key key; + struct VasEBoot_reiserfs_data *data = node->data; + struct VasEBoot_fshelp_node found; + VasEBoot_uint16_t block_size = VasEBoot_le_to_cpu16 (data->superblock.block_size); + VasEBoot_uint16_t item_size; + VasEBoot_uint32_t *indirect_block_ptr = 0; + VasEBoot_uint64_t current_key_offset = 1; + VasEBoot_off_t initial_position, current_position, final_position, length; + VasEBoot_disk_addr_t block; + VasEBoot_off_t offset; key.directory_id = node->header.key.directory_id; key.object_id = node->header.key.object_id; key.u.v2.offset_type = 0; - grub_reiserfs_set_key_type (&key, GRUB_REISERFS_ANY, 2); + VasEBoot_reiserfs_set_key_type (&key, VasEBoot_REISERFS_ANY, 2); initial_position = off; current_position = 0; final_position = MIN (len + initial_position, node->size); - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "Reading from %lld to %lld (%lld instead of requested %ld)\n", (unsigned long long) initial_position, (unsigned long long) final_position, (unsigned long long) (final_position - initial_position), (unsigned long) len); - grub_reiserfs_set_key_offset (&key, initial_position + 1); + VasEBoot_reiserfs_set_key_offset (&key, initial_position + 1); - if (grub_reiserfs_get_item (data, &key, &found, 0) != GRUB_ERR_NONE) + if (VasEBoot_reiserfs_get_item (data, &key, &found, 0) != VasEBoot_ERR_NONE) goto fail; if (found.block_number == 0) { - grub_error (GRUB_ERR_READ_ERROR, "offset %lld not found", + VasEBoot_error (VasEBoot_ERR_READ_ERROR, "offset %lld not found", (unsigned long long) initial_position); goto fail; } - current_key_offset = grub_reiserfs_get_key_offset (&found.header.key); + current_key_offset = VasEBoot_reiserfs_get_key_offset (&found.header.key); current_position = current_key_offset - 1; while (current_position < final_position) { - grub_reiserfs_set_key_offset (&key, current_key_offset); + VasEBoot_reiserfs_set_key_offset (&key, current_key_offset); - if (grub_reiserfs_get_item (data, &key, &found, 1) != GRUB_ERR_NONE) + if (VasEBoot_reiserfs_get_item (data, &key, &found, 1) != VasEBoot_ERR_NONE) goto fail; if (found.block_number == 0) goto fail; - item_size = grub_le_to_cpu16 (found.header.item_size); + item_size = VasEBoot_le_to_cpu16 (found.header.item_size); switch (found.type) { - case GRUB_REISERFS_DIRECT: - block = ((grub_disk_addr_t) found.block_number) * (block_size >> GRUB_DISK_SECTOR_BITS); - grub_dprintf ("reiserfs_blocktype", "D: %u\n", (unsigned) block); + case VasEBoot_REISERFS_DIRECT: + block = ((VasEBoot_disk_addr_t) found.block_number) * (block_size >> VasEBoot_DISK_SECTOR_BITS); + VasEBoot_dprintf ("reiserfs_blocktype", "D: %u\n", (unsigned) block); if (initial_position < current_position + item_size) { offset = MAX ((signed) (initial_position - current_position), 0); length = (MIN (item_size, final_position - current_position) - offset); - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "Reading direct block %u from %u to %u...\n", (unsigned) block, (unsigned) offset, (unsigned) (offset + length)); found.data->disk->read_hook = read_hook; found.data->disk->read_hook_data = read_hook_data; - grub_disk_read (found.data->disk, + VasEBoot_disk_read (found.data->disk, block, offset - + grub_le_to_cpu16 (found.header.item_location), + + VasEBoot_le_to_cpu16 (found.header.item_location), length, buf); found.data->disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) goto fail; buf += length; current_position += offset + length; @@ -1138,16 +1138,16 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, else current_position += item_size; break; - case GRUB_REISERFS_INDIRECT: + case VasEBoot_REISERFS_INDIRECT: indirect_block_count = item_size / sizeof (*indirect_block_ptr); - indirect_block_ptr = grub_malloc (item_size); + indirect_block_ptr = VasEBoot_malloc (item_size); if (! indirect_block_ptr) goto fail; - grub_disk_read (found.data->disk, - found.block_number * (block_size >> GRUB_DISK_SECTOR_BITS), - grub_le_to_cpu16 (found.header.item_location), + VasEBoot_disk_read (found.data->disk, + found.block_number * (block_size >> VasEBoot_DISK_SECTOR_BITS), + VasEBoot_le_to_cpu16 (found.header.item_location), item_size, indirect_block_ptr); - if (grub_errno) + if (VasEBoot_errno) goto fail; found.data->disk->read_hook = read_hook; found.data->disk->read_hook_data = read_hook_data; @@ -1156,28 +1156,28 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, && current_position < final_position; indirect_block++) { - block = grub_le_to_cpu32 (indirect_block_ptr[indirect_block]) * - (block_size >> GRUB_DISK_SECTOR_BITS); - grub_dprintf ("reiserfs_blocktype", "I: %u\n", (unsigned) block); + block = VasEBoot_le_to_cpu32 (indirect_block_ptr[indirect_block]) * + (block_size >> VasEBoot_DISK_SECTOR_BITS); + VasEBoot_dprintf ("reiserfs_blocktype", "I: %u\n", (unsigned) block); if (current_position + block_size >= initial_position) { offset = MAX ((signed) (initial_position - current_position), 0); length = (MIN (block_size, final_position - current_position) - offset); - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "Reading indirect block %u from %u to %u...\n", (unsigned) block, (unsigned) offset, (unsigned) (offset + length)); #if 0 - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "\nib=%04d/%04d, ip=%d, cp=%d, fp=%d, off=%d, l=%d, tl=%d\n", indirect_block + 1, indirect_block_count, initial_position, current_position, final_position, offset, length, len); #endif - grub_disk_read (found.data->disk, block, offset, length, buf); - if (grub_errno) + VasEBoot_disk_read (found.data->disk, block, offset, length, buf); + if (VasEBoot_errno) goto fail; buf += length; current_position += offset + length; @@ -1186,7 +1186,7 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, current_position += block_size; } found.data->disk->read_hook = 0; - grub_free (indirect_block_ptr); + VasEBoot_free (indirect_block_ptr); indirect_block_ptr = 0; break; default: @@ -1195,7 +1195,7 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, current_key_offset = current_position + 1; } - grub_dprintf ("reiserfs", + VasEBoot_dprintf ("reiserfs", "Have successfully read %lld bytes (%ld requested)\n", (unsigned long long) (current_position - initial_position), (unsigned long) len); @@ -1204,25 +1204,25 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, #if 0 switch (found.type) { - case GRUB_REISERFS_DIRECT: + case VasEBoot_REISERFS_DIRECT: read_length = MIN (len, item_size - file->offset); - grub_disk_read (found.data->disk, - (found.block_number * block_size) / GRUB_DISK_SECTOR_SIZE, - grub_le_to_cpu16 (found.header.item_location) + file->offset, + VasEBoot_disk_read (found.data->disk, + (found.block_number * block_size) / VasEBoot_DISK_SECTOR_SIZE, + VasEBoot_le_to_cpu16 (found.header.item_location) + file->offset, read_length, buf); - if (grub_errno) + if (VasEBoot_errno) goto fail; break; - case GRUB_REISERFS_INDIRECT: + case VasEBoot_REISERFS_INDIRECT: indirect_block_count = item_size / sizeof (*indirect_block_ptr); - indirect_block_ptr = grub_malloc (item_size); + indirect_block_ptr = VasEBoot_malloc (item_size); if (!indirect_block_ptr) goto fail; - grub_disk_read (found.data->disk, - (found.block_number * block_size) / GRUB_DISK_SECTOR_SIZE, - grub_le_to_cpu16 (found.header.item_location), + VasEBoot_disk_read (found.data->disk, + (found.block_number * block_size) / VasEBoot_DISK_SECTOR_SIZE, + VasEBoot_le_to_cpu16 (found.header.item_location), item_size, (char *) indirect_block_ptr); - if (grub_errno) + if (VasEBoot_errno) goto fail; len = MIN (len, file->size - file->offset); for (indirect_block = file->offset / block_size; @@ -1230,15 +1230,15 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, indirect_block++) { read = MIN (block_size, len - read_length); - grub_disk_read (found.data->disk, - (grub_le_to_cpu32 (indirect_block_ptr[indirect_block]) * block_size) / GRUB_DISK_SECTOR_SIZE, + VasEBoot_disk_read (found.data->disk, + (VasEBoot_le_to_cpu32 (indirect_block_ptr[indirect_block]) * block_size) / VasEBoot_DISK_SECTOR_SIZE, file->offset % block_size, read, ((void *) buf) + read_length); - if (grub_errno) + if (VasEBoot_errno) goto fail; read_length += read; } - grub_free (indirect_block_ptr); + VasEBoot_free (indirect_block_ptr); break; default: goto fail; @@ -1248,132 +1248,132 @@ grub_reiserfs_read_real (struct grub_fshelp_node *node, #endif fail: - grub_free (indirect_block_ptr); + VasEBoot_free (indirect_block_ptr); return -1; } -static grub_ssize_t -grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_reiserfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - return grub_reiserfs_read_real (file->data, file->offset, buf, len, + return VasEBoot_reiserfs_read_real (file->data, file->offset, buf, len, file->read_hook, file->read_hook_data); } /* Close the file FILE. */ -static grub_err_t -grub_reiserfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_reiserfs_close (VasEBoot_file_t file) { - struct grub_fshelp_node *node = file->data; - struct grub_reiserfs_data *data = node->data; + struct VasEBoot_fshelp_node *node = file->data; + struct VasEBoot_reiserfs_data *data = node->data; - grub_free (data); - grub_free (node); - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_free (data); + VasEBoot_free (node); + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -/* Context for grub_reiserfs_dir. */ -struct grub_reiserfs_dir_ctx +/* Context for VasEBoot_reiserfs_dir. */ +struct VasEBoot_reiserfs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_reiserfs_dir. */ +/* Helper for VasEBoot_reiserfs_dir. */ static int -grub_reiserfs_dir_iter (const char *filename, - enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_reiserfs_dir_iter (const char *filename, + enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_reiserfs_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_reiserfs_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtimeset = 1; info.mtime = node->mtime; - grub_free (node); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } /* Call HOOK with each file under DIR. */ -static grub_err_t -grub_reiserfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_reiserfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_reiserfs_dir_ctx ctx = { hook, hook_data }; - struct grub_reiserfs_data *data = 0; - struct grub_fshelp_node root, *found; - struct grub_reiserfs_key root_key; + struct VasEBoot_reiserfs_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_reiserfs_data *data = 0; + struct VasEBoot_fshelp_node root, *found; + struct VasEBoot_reiserfs_key root_key; - grub_dl_ref (my_mod); - data = grub_reiserfs_mount (device->disk); + VasEBoot_dl_ref (my_mod); + data = VasEBoot_reiserfs_mount (device->disk); if (! data) goto fail; - root_key.directory_id = grub_cpu_to_le32_compile_time (1); - root_key.object_id = grub_cpu_to_le32_compile_time (2); + root_key.directory_id = VasEBoot_cpu_to_le32_compile_time (1); + root_key.object_id = VasEBoot_cpu_to_le32_compile_time (2); root_key.u.v2.offset_type = 0; - grub_reiserfs_set_key_type (&root_key, GRUB_REISERFS_DIRECTORY, 2); - grub_reiserfs_set_key_offset (&root_key, 1); - if (grub_reiserfs_get_item (data, &root_key, &root, 1) != GRUB_ERR_NONE) + VasEBoot_reiserfs_set_key_type (&root_key, VasEBoot_REISERFS_DIRECTORY, 2); + VasEBoot_reiserfs_set_key_offset (&root_key, 1); + if (VasEBoot_reiserfs_get_item (data, &root_key, &root, 1) != VasEBoot_ERR_NONE) goto fail; if (root.block_number == 0) { - grub_error(GRUB_ERR_BAD_FS, "root not found"); + VasEBoot_error(VasEBoot_ERR_BAD_FS, "root not found"); goto fail; } - grub_fshelp_find_file (path, &root, &found, grub_reiserfs_iterate_dir, - grub_reiserfs_read_symlink, GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &root, &found, VasEBoot_reiserfs_iterate_dir, + VasEBoot_reiserfs_read_symlink, VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_reiserfs_iterate_dir (found, grub_reiserfs_dir_iter, &ctx); - grub_free (data); - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_reiserfs_iterate_dir (found, VasEBoot_reiserfs_dir_iter, &ctx); + VasEBoot_free (data); + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; fail: - grub_free (data); - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_free (data); + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } /* Return the label of the device DEVICE in LABEL. The label is - returned in a grub_malloc'ed buffer and should be freed by the + returned in a VasEBoot_malloc'ed buffer and should be freed by the caller. */ -static grub_err_t -grub_reiserfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_reiserfs_label (VasEBoot_device_t device, char **label) { - struct grub_reiserfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_reiserfs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_reiserfs_mount (disk); + data = VasEBoot_reiserfs_mount (disk); if (data) { - *label = grub_strndup (data->superblock.label, + *label = VasEBoot_strndup (data->superblock.label, sizeof (data->superblock.label)); } else *label = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_reiserfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_reiserfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_reiserfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_reiserfs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); *uuid = NULL; - data = grub_reiserfs_mount (disk); + data = VasEBoot_reiserfs_mount (disk); if (data) { unsigned i; @@ -1381,47 +1381,47 @@ grub_reiserfs_uuid (grub_device_t device, char **uuid) if (data->superblock.uuid[i]) break; if (i < ARRAY_SIZE (data->superblock.uuid)) - *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", - grub_be_to_cpu16 (data->superblock.uuid[0]), - grub_be_to_cpu16 (data->superblock.uuid[1]), - grub_be_to_cpu16 (data->superblock.uuid[2]), - grub_be_to_cpu16 (data->superblock.uuid[3]), - grub_be_to_cpu16 (data->superblock.uuid[4]), - grub_be_to_cpu16 (data->superblock.uuid[5]), - grub_be_to_cpu16 (data->superblock.uuid[6]), - grub_be_to_cpu16 (data->superblock.uuid[7])); + *uuid = VasEBoot_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + VasEBoot_be_to_cpu16 (data->superblock.uuid[0]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[1]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[2]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[3]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[4]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[5]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[6]), + VasEBoot_be_to_cpu16 (data->superblock.uuid[7])); } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_reiserfs_fs = +static struct VasEBoot_fs VasEBoot_reiserfs_fs = { .name = "reiserfs", - .dir = grub_reiserfs_dir, - .open = grub_reiserfs_open, - .read = grub_reiserfs_read, - .close = grub_reiserfs_close, - .label = grub_reiserfs_label, - .uuid = grub_reiserfs_uuid, -#ifdef GRUB_UTIL + .dir = VasEBoot_reiserfs_dir, + .open = VasEBoot_reiserfs_open, + .read = VasEBoot_reiserfs_read, + .close = VasEBoot_reiserfs_close, + .label = VasEBoot_reiserfs_label, + .uuid = VasEBoot_reiserfs_uuid, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(reiserfs) +VasEBoot_MOD_INIT(reiserfs) { - grub_fs_register (&grub_reiserfs_fs); + VasEBoot_fs_register (&VasEBoot_reiserfs_fs); my_mod = mod; } -GRUB_MOD_FINI(reiserfs) +VasEBoot_MOD_FINI(reiserfs) { - grub_fs_unregister (&grub_reiserfs_fs); + VasEBoot_fs_unregister (&VasEBoot_reiserfs_fs); } diff --git a/VasEBoot-core/fs/romfs.c b/VasEBoot-core/fs/romfs.c index 2e3544408..0519f5c8a 100644 --- a/VasEBoot-core/fs/romfs.c +++ b/VasEBoot-core/fs/romfs.c @@ -1,219 +1,219 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_romfs_superblock +struct VasEBoot_romfs_superblock { char magic[8]; -#define GRUB_ROMFS_MAGIC "-rom1fs-" - grub_uint32_t total_size; - grub_uint32_t chksum; +#define VasEBoot_ROMFS_MAGIC "-rom1fs-" + VasEBoot_uint32_t total_size; + VasEBoot_uint32_t chksum; char label[0]; }; -struct grub_romfs_file_header +struct VasEBoot_romfs_file_header { - grub_uint32_t next_file; - grub_uint32_t spec; - grub_uint32_t size; - grub_uint32_t chksum; + VasEBoot_uint32_t next_file; + VasEBoot_uint32_t spec; + VasEBoot_uint32_t size; + VasEBoot_uint32_t chksum; char name[0]; }; -struct grub_romfs_data +struct VasEBoot_romfs_data { - grub_disk_addr_t first_file; - grub_disk_t disk; + VasEBoot_disk_addr_t first_file; + VasEBoot_disk_t disk; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - grub_disk_addr_t addr; - struct grub_romfs_data *data; - grub_disk_addr_t data_addr; + VasEBoot_disk_addr_t addr; + struct VasEBoot_romfs_data *data; + VasEBoot_disk_addr_t data_addr; /* Not filled for root. */ - struct grub_romfs_file_header file; + struct VasEBoot_romfs_file_header file; }; -#define GRUB_ROMFS_ALIGN 16 -#define GRUB_ROMFS_TYPE_MASK 7 -#define GRUB_ROMFS_TYPE_HARDLINK 0 -#define GRUB_ROMFS_TYPE_DIRECTORY 1 -#define GRUB_ROMFS_TYPE_REGULAR 2 -#define GRUB_ROMFS_TYPE_SYMLINK 3 +#define VasEBoot_ROMFS_ALIGN 16 +#define VasEBoot_ROMFS_TYPE_MASK 7 +#define VasEBoot_ROMFS_TYPE_HARDLINK 0 +#define VasEBoot_ROMFS_TYPE_DIRECTORY 1 +#define VasEBoot_ROMFS_TYPE_REGULAR 2 +#define VasEBoot_ROMFS_TYPE_SYMLINK 3 -static grub_err_t -do_checksum (void *in, grub_size_t insize) +static VasEBoot_err_t +do_checksum (void *in, VasEBoot_size_t insize) { - grub_uint32_t *a = in; - grub_size_t sz = insize / 4; - grub_uint32_t *b = a + sz; - grub_uint32_t csum = 0; + VasEBoot_uint32_t *a = in; + VasEBoot_size_t sz = insize / 4; + VasEBoot_uint32_t *b = a + sz; + VasEBoot_uint32_t csum = 0; while (a < b) - csum += grub_be_to_cpu32 (*a++); + csum += VasEBoot_be_to_cpu32 (*a++); if (csum) - return grub_error (GRUB_ERR_BAD_FS, "invalid checksum"); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid checksum"); + return VasEBoot_ERR_NONE; } -static struct grub_romfs_data * -grub_romfs_mount (grub_device_t dev) +static struct VasEBoot_romfs_data * +VasEBoot_romfs_mount (VasEBoot_device_t dev) { union { - struct grub_romfs_superblock sb; + struct VasEBoot_romfs_superblock sb; char d[512]; } sb; - grub_err_t err; + VasEBoot_err_t err; char *ptr; - grub_disk_addr_t sec = 0; - struct grub_romfs_data *data; + VasEBoot_disk_addr_t sec = 0; + struct VasEBoot_romfs_data *data; if (!dev->disk) { - grub_error (GRUB_ERR_BAD_FS, "not a disk"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a disk"); return NULL; } - err = grub_disk_read (dev->disk, 0, 0, sizeof (sb), &sb); - if (err == GRUB_ERR_OUT_OF_RANGE) - err = grub_errno = GRUB_ERR_BAD_FS; + err = VasEBoot_disk_read (dev->disk, 0, 0, sizeof (sb), &sb); + if (err == VasEBoot_ERR_OUT_OF_RANGE) + err = VasEBoot_errno = VasEBoot_ERR_BAD_FS; if (err) return NULL; - if (grub_be_to_cpu32 (sb.sb.total_size) < sizeof (sb)) + if (VasEBoot_be_to_cpu32 (sb.sb.total_size) < sizeof (sb)) { - grub_error (GRUB_ERR_BAD_FS, "too short filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "too short filesystem"); return NULL; } - if (grub_memcmp (sb.sb.magic, GRUB_ROMFS_MAGIC, + if (VasEBoot_memcmp (sb.sb.magic, VasEBoot_ROMFS_MAGIC, sizeof (sb.sb.magic)) != 0) { - grub_error (GRUB_ERR_BAD_FS, "not romfs"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not romfs"); return NULL; } - err = do_checksum (&sb, sizeof (sb) < grub_be_to_cpu32 (sb.sb.total_size) ? - sizeof (sb) : grub_be_to_cpu32 (sb.sb.total_size)); + err = do_checksum (&sb, sizeof (sb) < VasEBoot_be_to_cpu32 (sb.sb.total_size) ? + sizeof (sb) : VasEBoot_be_to_cpu32 (sb.sb.total_size)); if (err) { - grub_error (GRUB_ERR_BAD_FS, "checksum incorrect"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "checksum incorrect"); return NULL; } for (ptr = sb.sb.label; (void *) ptr < (void *) (&sb + 1) - && ptr - sb.d < (grub_ssize_t) grub_be_to_cpu32 (sb.sb.total_size); ptr++) + && ptr - sb.d < (VasEBoot_ssize_t) VasEBoot_be_to_cpu32 (sb.sb.total_size); ptr++) if (!*ptr) break; while ((void *) ptr == &sb + 1) { sec++; - err = grub_disk_read (dev->disk, sec, 0, sizeof (sb), &sb); - if (err == GRUB_ERR_OUT_OF_RANGE) - err = grub_errno = GRUB_ERR_BAD_FS; + err = VasEBoot_disk_read (dev->disk, sec, 0, sizeof (sb), &sb); + if (err == VasEBoot_ERR_OUT_OF_RANGE) + err = VasEBoot_errno = VasEBoot_ERR_BAD_FS; if (err) return NULL; for (ptr = sb.d; (void *) ptr < (void *) (&sb + 1) - && (ptr - sb.d + (sec << GRUB_DISK_SECTOR_BITS) - < grub_be_to_cpu32 (sb.sb.total_size)); + && (ptr - sb.d + (sec << VasEBoot_DISK_SECTOR_BITS) + < VasEBoot_be_to_cpu32 (sb.sb.total_size)); ptr++) if (!*ptr) break; } - data = grub_malloc (sizeof (*data)); + data = VasEBoot_malloc (sizeof (*data)); if (!data) return NULL; - data->first_file = ALIGN_UP (ptr + 1 - sb.d, GRUB_ROMFS_ALIGN) - + (sec << GRUB_DISK_SECTOR_BITS); + data->first_file = ALIGN_UP (ptr + 1 - sb.d, VasEBoot_ROMFS_ALIGN) + + (sec << VasEBoot_DISK_SECTOR_BITS); data->disk = dev->disk; return data; } static char * -grub_romfs_read_symlink (grub_fshelp_node_t node) +VasEBoot_romfs_read_symlink (VasEBoot_fshelp_node_t node) { char *ret; - grub_err_t err; - ret = grub_malloc (grub_be_to_cpu32 (node->file.size) + 1); + VasEBoot_err_t err; + ret = VasEBoot_malloc (VasEBoot_be_to_cpu32 (node->file.size) + 1); if (!ret) return NULL; - err = grub_disk_read (node->data->disk, - (node->data_addr) >> GRUB_DISK_SECTOR_BITS, - (node->data_addr) & (GRUB_DISK_SECTOR_SIZE - 1), - grub_be_to_cpu32 (node->file.size), ret); + err = VasEBoot_disk_read (node->data->disk, + (node->data_addr) >> VasEBoot_DISK_SECTOR_BITS, + (node->data_addr) & (VasEBoot_DISK_SECTOR_SIZE - 1), + VasEBoot_be_to_cpu32 (node->file.size), ret); if (err) { - grub_free (ret); + VasEBoot_free (ret); return NULL; } - ret[grub_be_to_cpu32 (node->file.size)] = 0; + ret[VasEBoot_be_to_cpu32 (node->file.size)] = 0; return ret; } static int -grub_romfs_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_romfs_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_disk_addr_t caddr; - struct grub_romfs_file_header hdr; + VasEBoot_disk_addr_t caddr; + struct VasEBoot_romfs_file_header hdr; unsigned nptr; unsigned i, j; - grub_size_t a = 0; - grub_properly_aligned_t *name = NULL; + VasEBoot_size_t a = 0; + VasEBoot_properly_aligned_t *name = NULL; for (caddr = dir->data_addr; caddr; - caddr = grub_be_to_cpu32 (hdr.next_file) & ~(GRUB_ROMFS_ALIGN - 1)) + caddr = VasEBoot_be_to_cpu32 (hdr.next_file) & ~(VasEBoot_ROMFS_ALIGN - 1)) { - grub_disk_addr_t naddr = caddr + sizeof (hdr); - grub_uint32_t csum = 0; - enum grub_fshelp_filetype filetype = GRUB_FSHELP_UNKNOWN; - struct grub_fshelp_node *node = NULL; - grub_err_t err; + VasEBoot_disk_addr_t naddr = caddr + sizeof (hdr); + VasEBoot_uint32_t csum = 0; + enum VasEBoot_fshelp_filetype filetype = VasEBoot_FSHELP_UNKNOWN; + struct VasEBoot_fshelp_node *node = NULL; + VasEBoot_err_t err; - err = grub_disk_read (dir->data->disk, caddr >> GRUB_DISK_SECTOR_BITS, - caddr & (GRUB_DISK_SECTOR_SIZE - 1), + err = VasEBoot_disk_read (dir->data->disk, caddr >> VasEBoot_DISK_SECTOR_BITS, + caddr & (VasEBoot_DISK_SECTOR_SIZE - 1), sizeof (hdr), &hdr); if (err) { - grub_free (name); + VasEBoot_free (name); return 1; } for (nptr = 0; ; nptr++, naddr += 16) { if (a <= nptr) { - grub_properly_aligned_t *on; + VasEBoot_properly_aligned_t *on; a = 2 * (nptr + 1); on = name; - name = grub_realloc (name, a * 16); + name = VasEBoot_realloc (name, a * 16); if (!name) { - grub_free (on); + VasEBoot_free (on); return 1; } } COMPILE_TIME_ASSERT (16 % sizeof (name[0]) == 0); - err = grub_disk_read (dir->data->disk, naddr >> GRUB_DISK_SECTOR_BITS, - naddr & (GRUB_DISK_SECTOR_SIZE - 1), + err = VasEBoot_disk_read (dir->data->disk, naddr >> VasEBoot_DISK_SECTOR_BITS, + naddr & (VasEBoot_DISK_SECTOR_SIZE - 1), 16, name + (16 / sizeof (name[0])) * nptr); if (err) return 1; @@ -223,57 +223,57 @@ grub_romfs_iterate_dir (grub_fshelp_node_t dir, if (j != 16) break; } - for (i = 0; i < sizeof (hdr) / sizeof (grub_uint32_t); i++) - csum += grub_be_to_cpu32 (((grub_uint32_t *) &hdr)[i]); + for (i = 0; i < sizeof (hdr) / sizeof (VasEBoot_uint32_t); i++) + csum += VasEBoot_be_to_cpu32 (((VasEBoot_uint32_t *) &hdr)[i]); for (i = 0; i < (nptr + 1) * 4; i++) - csum += grub_be_to_cpu32 (((grub_uint32_t *) name)[i]); + csum += VasEBoot_be_to_cpu32 (((VasEBoot_uint32_t *) name)[i]); if (csum != 0) { - grub_error (GRUB_ERR_BAD_FS, "invalid checksum"); - grub_free (name); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid checksum"); + VasEBoot_free (name); return 1; } - node = grub_malloc (sizeof (*node)); + node = VasEBoot_malloc (sizeof (*node)); if (!node) return 1; node->addr = caddr; node->data_addr = caddr + (nptr + 1) * 16 + sizeof (hdr); node->data = dir->data; node->file = hdr; - switch (grub_be_to_cpu32 (hdr.next_file) & GRUB_ROMFS_TYPE_MASK) + switch (VasEBoot_be_to_cpu32 (hdr.next_file) & VasEBoot_ROMFS_TYPE_MASK) { - case GRUB_ROMFS_TYPE_REGULAR: - filetype = GRUB_FSHELP_REG; + case VasEBoot_ROMFS_TYPE_REGULAR: + filetype = VasEBoot_FSHELP_REG; break; - case GRUB_ROMFS_TYPE_SYMLINK: - filetype = GRUB_FSHELP_SYMLINK; + case VasEBoot_ROMFS_TYPE_SYMLINK: + filetype = VasEBoot_FSHELP_SYMLINK; break; - case GRUB_ROMFS_TYPE_DIRECTORY: - node->data_addr = grub_be_to_cpu32 (hdr.spec); - filetype = GRUB_FSHELP_DIR; + case VasEBoot_ROMFS_TYPE_DIRECTORY: + node->data_addr = VasEBoot_be_to_cpu32 (hdr.spec); + filetype = VasEBoot_FSHELP_DIR; break; - case GRUB_ROMFS_TYPE_HARDLINK: + case VasEBoot_ROMFS_TYPE_HARDLINK: { - grub_disk_addr_t laddr; - node->addr = laddr = grub_be_to_cpu32 (hdr.spec); - err = grub_disk_read (dir->data->disk, - laddr >> GRUB_DISK_SECTOR_BITS, - laddr & (GRUB_DISK_SECTOR_SIZE - 1), + VasEBoot_disk_addr_t laddr; + node->addr = laddr = VasEBoot_be_to_cpu32 (hdr.spec); + err = VasEBoot_disk_read (dir->data->disk, + laddr >> VasEBoot_DISK_SECTOR_BITS, + laddr & (VasEBoot_DISK_SECTOR_SIZE - 1), sizeof (node->file), &node->file); if (err) return 1; - if ((grub_be_to_cpu32 (node->file.next_file) & GRUB_ROMFS_TYPE_MASK) - == GRUB_ROMFS_TYPE_REGULAR - || (grub_be_to_cpu32 (node->file.next_file) - & GRUB_ROMFS_TYPE_MASK) == GRUB_ROMFS_TYPE_SYMLINK) + if ((VasEBoot_be_to_cpu32 (node->file.next_file) & VasEBoot_ROMFS_TYPE_MASK) + == VasEBoot_ROMFS_TYPE_REGULAR + || (VasEBoot_be_to_cpu32 (node->file.next_file) + & VasEBoot_ROMFS_TYPE_MASK) == VasEBoot_ROMFS_TYPE_SYMLINK) { laddr += sizeof (hdr); while (1) { char buf[16]; - err = grub_disk_read (dir->data->disk, - laddr >> GRUB_DISK_SECTOR_BITS, - laddr & (GRUB_DISK_SECTOR_SIZE - 1), + err = VasEBoot_disk_read (dir->data->disk, + laddr >> VasEBoot_DISK_SECTOR_BITS, + laddr & (VasEBoot_DISK_SECTOR_SIZE - 1), 16, buf); if (err) return 1; @@ -286,17 +286,17 @@ grub_romfs_iterate_dir (grub_fshelp_node_t dir, } node->data_addr = laddr + 16; } - if ((grub_be_to_cpu32 (node->file.next_file) - & GRUB_ROMFS_TYPE_MASK) == GRUB_ROMFS_TYPE_REGULAR) - filetype = GRUB_FSHELP_REG; - if ((grub_be_to_cpu32 (node->file.next_file) - & GRUB_ROMFS_TYPE_MASK) == GRUB_ROMFS_TYPE_SYMLINK) - filetype = GRUB_FSHELP_SYMLINK; - if ((grub_be_to_cpu32 (node->file.next_file) & GRUB_ROMFS_TYPE_MASK) - == GRUB_ROMFS_TYPE_DIRECTORY) + if ((VasEBoot_be_to_cpu32 (node->file.next_file) + & VasEBoot_ROMFS_TYPE_MASK) == VasEBoot_ROMFS_TYPE_REGULAR) + filetype = VasEBoot_FSHELP_REG; + if ((VasEBoot_be_to_cpu32 (node->file.next_file) + & VasEBoot_ROMFS_TYPE_MASK) == VasEBoot_ROMFS_TYPE_SYMLINK) + filetype = VasEBoot_FSHELP_SYMLINK; + if ((VasEBoot_be_to_cpu32 (node->file.next_file) & VasEBoot_ROMFS_TYPE_MASK) + == VasEBoot_ROMFS_TYPE_DIRECTORY) { - node->data_addr = grub_be_to_cpu32 (node->file.spec); - filetype = GRUB_FSHELP_DIR; + node->data_addr = VasEBoot_be_to_cpu32 (node->file.spec); + filetype = VasEBoot_FSHELP_DIR; } break; @@ -305,71 +305,71 @@ grub_romfs_iterate_dir (grub_fshelp_node_t dir, if (hook ((char *) name, filetype, node, hook_data)) { - grub_free (name); + VasEBoot_free (name); return 1; } } - grub_free (name); + VasEBoot_free (name); return 0; } -/* Context for grub_romfs_dir. */ -struct grub_romfs_dir_ctx +/* Context for VasEBoot_romfs_dir. */ +struct VasEBoot_romfs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_romfs_dir. */ +/* Helper for VasEBoot_romfs_dir. */ static int -grub_romfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_romfs_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_romfs_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_romfs_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); - grub_free (node); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_romfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_romfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_romfs_dir_ctx ctx = { hook, hook_data }; - struct grub_romfs_data *data = 0; - struct grub_fshelp_node *fdiro = 0, start; + struct VasEBoot_romfs_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_romfs_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0, start; - data = grub_romfs_mount (device); + data = VasEBoot_romfs_mount (device); if (! data) goto fail; start.addr = data->first_file; start.data_addr = data->first_file; start.data = data; - grub_fshelp_find_file (path, &start, &fdiro, grub_romfs_iterate_dir, - grub_romfs_read_symlink, GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &start, &fdiro, VasEBoot_romfs_iterate_dir, + VasEBoot_romfs_read_symlink, VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_romfs_iterate_dir (fdiro, grub_romfs_dir_iter, &ctx); + VasEBoot_romfs_iterate_dir (fdiro, VasEBoot_romfs_dir_iter, &ctx); fail: - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_romfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_romfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_romfs_data *data = 0; - struct grub_fshelp_node *fdiro = 0, start; + struct VasEBoot_romfs_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0, start; - data = grub_romfs_mount (file->device); + data = VasEBoot_romfs_mount (file->device); if (! data) goto fail; @@ -377,108 +377,108 @@ grub_romfs_open (struct grub_file *file, const char *name) start.data_addr = data->first_file; start.data = data; - grub_fshelp_find_file (name, &start, &fdiro, grub_romfs_iterate_dir, - grub_romfs_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &start, &fdiro, VasEBoot_romfs_iterate_dir, + VasEBoot_romfs_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; - file->size = grub_be_to_cpu32 (fdiro->file.size); + file->size = VasEBoot_be_to_cpu32 (fdiro->file.size); file->data = fdiro; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_romfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_romfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_fshelp_node *data = file->data; + struct VasEBoot_fshelp_node *data = file->data; /* XXX: The file is stored in as a single extent. */ data->data->disk->read_hook = file->read_hook; data->data->disk->read_hook_data = file->read_hook_data; - grub_disk_read (data->data->disk, - (data->data_addr + file->offset) >> GRUB_DISK_SECTOR_BITS, - (data->data_addr + file->offset) & (GRUB_DISK_SECTOR_SIZE - 1), + VasEBoot_disk_read (data->data->disk, + (data->data_addr + file->offset) >> VasEBoot_DISK_SECTOR_BITS, + (data->data_addr + file->offset) & (VasEBoot_DISK_SECTOR_SIZE - 1), len, buf); data->data->disk->read_hook = NULL; - if (grub_errno) + if (VasEBoot_errno) return -1; return len; } -static grub_err_t -grub_romfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_romfs_close (VasEBoot_file_t file) { - struct grub_fshelp_node *data = file->data; + struct VasEBoot_fshelp_node *data = file->data; - grub_free (data->data); - grub_free (data); + VasEBoot_free (data->data); + VasEBoot_free (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_romfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_romfs_label (VasEBoot_device_t device, char **label) { - struct grub_romfs_data *data; - grub_err_t err; + struct VasEBoot_romfs_data *data; + VasEBoot_err_t err; *label = NULL; - data = grub_romfs_mount (device); + data = VasEBoot_romfs_mount (device); if (!data) - return grub_errno; - *label = grub_malloc (data->first_file + 1 - - sizeof (struct grub_romfs_superblock)); + return VasEBoot_errno; + *label = VasEBoot_malloc (data->first_file + 1 + - sizeof (struct VasEBoot_romfs_superblock)); if (!*label) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } - err = grub_disk_read (device->disk, 0, sizeof (struct grub_romfs_superblock), + err = VasEBoot_disk_read (device->disk, 0, sizeof (struct VasEBoot_romfs_superblock), data->first_file - - sizeof (struct grub_romfs_superblock), + - sizeof (struct VasEBoot_romfs_superblock), *label); if (err) { - grub_free (data); - grub_free (*label); + VasEBoot_free (data); + VasEBoot_free (*label); *label = NULL; return err; } - (*label)[data->first_file - sizeof (struct grub_romfs_superblock)] = 0; - grub_free (data); - return GRUB_ERR_NONE; + (*label)[data->first_file - sizeof (struct VasEBoot_romfs_superblock)] = 0; + VasEBoot_free (data); + return VasEBoot_ERR_NONE; } -static struct grub_fs grub_romfs_fs = +static struct VasEBoot_fs VasEBoot_romfs_fs = { .name = "romfs", - .dir = grub_romfs_dir, - .open = grub_romfs_open, - .read = grub_romfs_read, - .close = grub_romfs_close, - .label = grub_romfs_label, -#ifdef GRUB_UTIL + .dir = VasEBoot_romfs_dir, + .open = VasEBoot_romfs_open, + .read = VasEBoot_romfs_read, + .close = VasEBoot_romfs_close, + .label = VasEBoot_romfs_label, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 0, #endif .next = 0 }; -GRUB_MOD_INIT(romfs) +VasEBoot_MOD_INIT(romfs) { - grub_fs_register (&grub_romfs_fs); + VasEBoot_fs_register (&VasEBoot_romfs_fs); } -GRUB_MOD_FINI(romfs) +VasEBoot_MOD_FINI(romfs) { - grub_fs_unregister (&grub_romfs_fs); + VasEBoot_fs_unregister (&VasEBoot_romfs_fs); } diff --git a/VasEBoot-core/fs/sfs.c b/VasEBoot-core/fs/sfs.c index 57b8d8da6..8f91fad7b 100644 --- a/VasEBoot-core/fs/sfs.c +++ b/VasEBoot-core/fs/sfs.c @@ -1,56 +1,56 @@ /* sfs.c - Amiga Smart FileSystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* The common header for a block. */ -struct grub_sfs_bheader +struct VasEBoot_sfs_bheader { - grub_uint8_t magic[4]; - grub_uint32_t chksum; - grub_uint32_t ipointtomyself; -} GRUB_PACKED; + VasEBoot_uint8_t magic[4]; + VasEBoot_uint32_t chksum; + VasEBoot_uint32_t ipointtomyself; +} VasEBoot_PACKED; /* The sfs rootblock. */ -struct grub_sfs_rblock +struct VasEBoot_sfs_rblock { - struct grub_sfs_bheader header; - grub_uint32_t version; - grub_uint32_t createtime; - grub_uint8_t flags; - grub_uint8_t unused1[31]; - grub_uint32_t blocksize; - grub_uint8_t unused2[40]; - grub_uint8_t unused3[8]; - grub_uint32_t rootobject; - grub_uint32_t btree; -} GRUB_PACKED; + struct VasEBoot_sfs_bheader header; + VasEBoot_uint32_t version; + VasEBoot_uint32_t createtime; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t unused1[31]; + VasEBoot_uint32_t blocksize; + VasEBoot_uint8_t unused2[40]; + VasEBoot_uint8_t unused3[8]; + VasEBoot_uint32_t rootobject; + VasEBoot_uint32_t btree; +} VasEBoot_PACKED; enum { @@ -58,97 +58,97 @@ enum }; /* A SFS object container. */ -struct grub_sfs_obj +struct VasEBoot_sfs_obj { - grub_uint8_t unused1[4]; - grub_uint32_t nodeid; - grub_uint8_t unused2[4]; + VasEBoot_uint8_t unused1[4]; + VasEBoot_uint32_t nodeid; + VasEBoot_uint8_t unused2[4]; union { struct { - grub_uint32_t first_block; - grub_uint32_t size; - } GRUB_PACKED file; + VasEBoot_uint32_t first_block; + VasEBoot_uint32_t size; + } VasEBoot_PACKED file; struct { - grub_uint32_t hashtable; - grub_uint32_t dir_objc; - } GRUB_PACKED dir; + VasEBoot_uint32_t hashtable; + VasEBoot_uint32_t dir_objc; + } VasEBoot_PACKED dir; } file_dir; - grub_uint32_t mtime; - grub_uint8_t type; - grub_uint8_t filename[1]; - grub_uint8_t comment[1]; -} GRUB_PACKED; + VasEBoot_uint32_t mtime; + VasEBoot_uint8_t type; + VasEBoot_uint8_t filename[1]; + VasEBoot_uint8_t comment[1]; +} VasEBoot_PACKED; -#define GRUB_SFS_TYPE_DELETED 32 -#define GRUB_SFS_TYPE_SYMLINK 64 -#define GRUB_SFS_TYPE_DIR 128 +#define VasEBoot_SFS_TYPE_DELETED 32 +#define VasEBoot_SFS_TYPE_SYMLINK 64 +#define VasEBoot_SFS_TYPE_DIR 128 /* A SFS object container. */ -struct grub_sfs_objc +struct VasEBoot_sfs_objc { - struct grub_sfs_bheader header; - grub_uint32_t parent; - grub_uint32_t next; - grub_uint32_t prev; + struct VasEBoot_sfs_bheader header; + VasEBoot_uint32_t parent; + VasEBoot_uint32_t next; + VasEBoot_uint32_t prev; /* The amount of objects depends on the blocksize. */ - struct grub_sfs_obj objects[1]; -} GRUB_PACKED; + struct VasEBoot_sfs_obj objects[1]; +} VasEBoot_PACKED; -struct grub_sfs_btree_node +struct VasEBoot_sfs_btree_node { - grub_uint32_t key; - grub_uint32_t data; -} GRUB_PACKED; + VasEBoot_uint32_t key; + VasEBoot_uint32_t data; +} VasEBoot_PACKED; -struct grub_sfs_btree_extent +struct VasEBoot_sfs_btree_extent { - grub_uint32_t key; - grub_uint32_t next; - grub_uint32_t prev; - grub_uint16_t size; -} GRUB_PACKED; + VasEBoot_uint32_t key; + VasEBoot_uint32_t next; + VasEBoot_uint32_t prev; + VasEBoot_uint16_t size; +} VasEBoot_PACKED; -struct grub_sfs_btree +struct VasEBoot_sfs_btree { - struct grub_sfs_bheader header; - grub_uint16_t nodes; - grub_uint8_t leaf; - grub_uint8_t nodesize; + struct VasEBoot_sfs_bheader header; + VasEBoot_uint16_t nodes; + VasEBoot_uint8_t leaf; + VasEBoot_uint8_t nodesize; /* Normally this can be kind of node, but just extents are supported. */ - struct grub_sfs_btree_node node[1]; -} GRUB_PACKED; + struct VasEBoot_sfs_btree_node node[1]; +} VasEBoot_PACKED; struct cache_entry { - grub_uint32_t off; - grub_uint32_t block; + VasEBoot_uint32_t off; + VasEBoot_uint32_t block; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_sfs_data *data; - grub_uint32_t block; - grub_uint32_t size; - grub_uint32_t mtime; - grub_uint32_t cache_off; - grub_uint32_t next_extent; - grub_size_t cache_allocated; - grub_size_t cache_size; + struct VasEBoot_sfs_data *data; + VasEBoot_uint32_t block; + VasEBoot_uint32_t size; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t cache_off; + VasEBoot_uint32_t next_extent; + VasEBoot_size_t cache_allocated; + VasEBoot_size_t cache_size; struct cache_entry *cache; }; /* Information about a "mounted" sfs filesystem. */ -struct grub_sfs_data +struct VasEBoot_sfs_data { - struct grub_sfs_rblock rblock; - struct grub_fshelp_node diropen; - grub_disk_t disk; + struct VasEBoot_sfs_rblock rblock; + struct VasEBoot_fshelp_node diropen; + VasEBoot_disk_t disk; /* Log of blocksize in sectors. */ int log_blocksize; @@ -159,72 +159,72 @@ struct grub_sfs_data char *label; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; /* Lookup the extent starting with BLOCK in the filesystem described by DATA. Return the extent size in SIZE and the following extent in NEXTEXT. */ -static grub_err_t -grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, - grub_uint32_t *size, grub_uint32_t *nextext) +static VasEBoot_err_t +VasEBoot_sfs_read_extent (struct VasEBoot_sfs_data *data, unsigned int block, + VasEBoot_uint32_t *size, VasEBoot_uint32_t *nextext) { char *treeblock; - struct grub_sfs_btree *tree; + struct VasEBoot_sfs_btree *tree; int i; - grub_uint32_t next; - grub_size_t blocksize = GRUB_DISK_SECTOR_SIZE << data->log_blocksize; + VasEBoot_uint32_t next; + VasEBoot_size_t blocksize = VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize; - treeblock = grub_malloc (blocksize); + treeblock = VasEBoot_malloc (blocksize); if (!treeblock) - return grub_errno; + return VasEBoot_errno; - next = grub_be_to_cpu32 (data->rblock.btree); - tree = (struct grub_sfs_btree *) treeblock; + next = VasEBoot_be_to_cpu32 (data->rblock.btree); + tree = (struct VasEBoot_sfs_btree *) treeblock; /* Handle this level in the btree. */ do { - grub_uint16_t nnodes; - grub_disk_read (data->disk, - ((grub_disk_addr_t) next) << data->log_blocksize, + VasEBoot_uint16_t nnodes; + VasEBoot_disk_read (data->disk, + ((VasEBoot_disk_addr_t) next) << data->log_blocksize, 0, blocksize, treeblock); - if (grub_errno) + if (VasEBoot_errno) { - grub_free (treeblock); - return grub_errno; + VasEBoot_free (treeblock); + return VasEBoot_errno; } - nnodes = grub_be_to_cpu16 (tree->nodes); - if (nnodes * (grub_uint32_t) (tree)->nodesize > blocksize) + nnodes = VasEBoot_be_to_cpu16 (tree->nodes); + if (nnodes * (VasEBoot_uint32_t) (tree)->nodesize > blocksize) break; for (i = (int) nnodes - 1; i >= 0; i--) { #define EXTNODE(tree, index) \ - ((struct grub_sfs_btree_node *) (((char *) &(tree)->node[0]) \ + ((struct VasEBoot_sfs_btree_node *) (((char *) &(tree)->node[0]) \ + (index) * (tree)->nodesize)) /* Follow the tree down to the leaf level. */ - if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) <= block) + if ((VasEBoot_be_to_cpu32 (EXTNODE(tree, i)->key) <= block) && !tree->leaf) { - next = grub_be_to_cpu32 (EXTNODE (tree, i)->data); + next = VasEBoot_be_to_cpu32 (EXTNODE (tree, i)->data); break; } /* If the leaf level is reached, just find the correct extent. */ - if (grub_be_to_cpu32 (EXTNODE (tree, i)->key) == block && tree->leaf) + if (VasEBoot_be_to_cpu32 (EXTNODE (tree, i)->key) == block && tree->leaf) { - struct grub_sfs_btree_extent *extent; - extent = (struct grub_sfs_btree_extent *) EXTNODE (tree, i); + struct VasEBoot_sfs_btree_extent *extent; + extent = (struct VasEBoot_sfs_btree_extent *) EXTNODE (tree, i); /* We found a correct leaf. */ - *size = grub_be_to_cpu16 (extent->size); - *nextext = grub_be_to_cpu32 (extent->next); + *size = VasEBoot_be_to_cpu16 (extent->size); + *nextext = VasEBoot_be_to_cpu32 (extent->next); - grub_free (treeblock); + VasEBoot_free (treeblock); return 0; } @@ -233,19 +233,19 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, } } while (!tree->leaf); - grub_free (treeblock); + VasEBoot_free (treeblock); - return grub_error (GRUB_ERR_FILE_READ_ERROR, "SFS extent not found"); + return VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, "SFS extent not found"); } -static grub_disk_addr_t -grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_sfs_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { - grub_uint32_t blk; - grub_uint32_t size = 0; - grub_uint32_t next = 0; - grub_disk_addr_t off; - struct grub_sfs_data *data = node->data; + VasEBoot_uint32_t blk; + VasEBoot_uint32_t size = 0; + VasEBoot_uint32_t next = 0; + VasEBoot_disk_addr_t off; + struct VasEBoot_sfs_data *data = node->data; /* In case of the first block we don't have to lookup the extent, the minimum size is always 1. */ @@ -254,9 +254,9 @@ grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) if (!node->cache) { - grub_size_t cache_size; + VasEBoot_size_t cache_size; /* Assume half-max extents (32768 sectors). */ - cache_size = ((node->size >> (data->log_blocksize + GRUB_DISK_SECTOR_BITS + cache_size = ((node->size >> (data->log_blocksize + VasEBoot_DISK_SECTOR_BITS + 15)) + 3); if (cache_size < 8) @@ -266,10 +266,10 @@ grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) node->next_extent = node->block; node->cache_size = 0; - node->cache = grub_malloc (sizeof (node->cache[0]) * cache_size); + node->cache = VasEBoot_malloc (sizeof (node->cache[0]) * cache_size); if (!node->cache) { - grub_errno = 0; + VasEBoot_errno = 0; node->cache_allocated = 0; } else @@ -298,21 +298,21 @@ grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) while (blk) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_sfs_read_extent (node->data, blk, &size, &next); + err = VasEBoot_sfs_read_extent (node->data, blk, &size, &next); if (err) return 0; if (node->cache && node->cache_size >= node->cache_allocated) { struct cache_entry *e = node->cache; - e = grub_realloc (node->cache,node->cache_allocated * 2 + e = VasEBoot_realloc (node->cache,node->cache_allocated * 2 * sizeof (e[0])); if (!e) { - grub_errno = 0; - grub_free (node->cache); + VasEBoot_errno = 0; + VasEBoot_free (node->cache); node->cache = 0; } else @@ -339,7 +339,7 @@ grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) blk = next; } - grub_error (GRUB_ERR_FILE_READ_ERROR, + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, "reading a SFS block outside the extent"); return 0; @@ -348,142 +348,142 @@ grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_sfs_read_file (grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_sfs_read_file (VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - return grub_fshelp_read_file (node->data->disk, node, + return VasEBoot_fshelp_read_file (node->data->disk, node, read_hook, read_hook_data, - pos, len, buf, grub_sfs_read_block, + pos, len, buf, VasEBoot_sfs_read_block, node->size, node->data->log_blocksize, 0); } -static struct grub_sfs_data * -grub_sfs_mount (grub_disk_t disk) +static struct VasEBoot_sfs_data * +VasEBoot_sfs_mount (VasEBoot_disk_t disk) { - struct grub_sfs_data *data; - struct grub_sfs_objc *rootobjc; + struct VasEBoot_sfs_data *data; + struct VasEBoot_sfs_objc *rootobjc; char *rootobjc_data = 0; - grub_uint32_t blk; + VasEBoot_uint32_t blk; - data = grub_malloc (sizeof (*data)); + data = VasEBoot_malloc (sizeof (*data)); if (!data) return 0; /* Read the rootblock. */ - grub_disk_read (disk, 0, 0, sizeof (struct grub_sfs_rblock), + VasEBoot_disk_read (disk, 0, 0, sizeof (struct VasEBoot_sfs_rblock), &data->rblock); - if (grub_errno) + if (VasEBoot_errno) goto fail; /* Make sure this is a sfs filesystem. */ - if (grub_strncmp ((char *) (data->rblock.header.magic), "SFS", 4) + if (VasEBoot_strncmp ((char *) (data->rblock.header.magic), "SFS", 4) || data->rblock.blocksize == 0 || (data->rblock.blocksize & (data->rblock.blocksize - 1)) != 0 - || (data->rblock.blocksize & grub_cpu_to_be32_compile_time (0xf00001ff))) + || (data->rblock.blocksize & VasEBoot_cpu_to_be32_compile_time (0xf00001ff))) { - grub_error (GRUB_ERR_BAD_FS, "not a SFS filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a SFS filesystem"); goto fail; } for (data->log_blocksize = 9; - (1U << data->log_blocksize) < grub_be_to_cpu32 (data->rblock.blocksize); + (1U << data->log_blocksize) < VasEBoot_be_to_cpu32 (data->rblock.blocksize); data->log_blocksize++); - data->log_blocksize -= GRUB_DISK_SECTOR_BITS; + data->log_blocksize -= VasEBoot_DISK_SECTOR_BITS; if (data->rblock.flags & FLAGS_CASE_SENSITIVE) data->fshelp_flags = 0; else - data->fshelp_flags = GRUB_FSHELP_CASE_INSENSITIVE; - rootobjc_data = grub_malloc (GRUB_DISK_SECTOR_SIZE << data->log_blocksize); + data->fshelp_flags = VasEBoot_FSHELP_CASE_INSENSITIVE; + rootobjc_data = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize); if (! rootobjc_data) goto fail; /* Read the root object container. */ - grub_disk_read (disk, ((grub_disk_addr_t) grub_be_to_cpu32 (data->rblock.rootobject)) + VasEBoot_disk_read (disk, ((VasEBoot_disk_addr_t) VasEBoot_be_to_cpu32 (data->rblock.rootobject)) << data->log_blocksize, 0, - GRUB_DISK_SECTOR_SIZE << data->log_blocksize, rootobjc_data); - if (grub_errno) + VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize, rootobjc_data); + if (VasEBoot_errno) goto fail; - rootobjc = (struct grub_sfs_objc *) rootobjc_data; + rootobjc = (struct VasEBoot_sfs_objc *) rootobjc_data; - blk = grub_be_to_cpu32 (rootobjc->objects[0].file_dir.dir.dir_objc); + blk = VasEBoot_be_to_cpu32 (rootobjc->objects[0].file_dir.dir.dir_objc); data->diropen.size = 0; data->diropen.block = blk; data->diropen.data = data; data->diropen.cache = 0; data->disk = disk; - data->label = grub_strdup ((char *) (rootobjc->objects[0].filename)); + data->label = VasEBoot_strdup ((char *) (rootobjc->objects[0].filename)); - grub_free (rootobjc_data); + VasEBoot_free (rootobjc_data); return data; fail: - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not an SFS filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an SFS filesystem"); - grub_free (data); - grub_free (rootobjc_data); + VasEBoot_free (data); + VasEBoot_free (rootobjc_data); return 0; } static char * -grub_sfs_read_symlink (grub_fshelp_node_t node) +VasEBoot_sfs_read_symlink (VasEBoot_fshelp_node_t node) { - struct grub_sfs_data *data = node->data; + struct VasEBoot_sfs_data *data = node->data; char *symlink; char *block; - block = grub_malloc (GRUB_DISK_SECTOR_SIZE << data->log_blocksize); + block = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize); if (!block) return 0; - grub_disk_read (data->disk, ((grub_disk_addr_t) node->block) + VasEBoot_disk_read (data->disk, ((VasEBoot_disk_addr_t) node->block) << data->log_blocksize, - 0, GRUB_DISK_SECTOR_SIZE << data->log_blocksize, block); - if (grub_errno) + 0, VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize, block); + if (VasEBoot_errno) { - grub_free (block); + VasEBoot_free (block); return 0; } /* This is just a wild guess, but it always worked for me. How the SLNK block looks like is not documented in the SFS docs. */ - symlink = grub_malloc (((GRUB_DISK_SECTOR_SIZE << data->log_blocksize) - - 24) * GRUB_MAX_UTF8_PER_LATIN1 + 1); + symlink = VasEBoot_malloc (((VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize) + - 24) * VasEBoot_MAX_UTF8_PER_LATIN1 + 1); if (!symlink) { - grub_free (block); + VasEBoot_free (block); return 0; } - *grub_latin1_to_utf8 ((grub_uint8_t *) symlink, (grub_uint8_t *) &block[24], - (GRUB_DISK_SECTOR_SIZE << data->log_blocksize) - 24) = '\0'; - grub_free (block); + *VasEBoot_latin1_to_utf8 ((VasEBoot_uint8_t *) symlink, (VasEBoot_uint8_t *) &block[24], + (VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize) - 24) = '\0'; + VasEBoot_free (block); return symlink; } -/* Helper for grub_sfs_iterate_dir. */ +/* Helper for VasEBoot_sfs_iterate_dir. */ static int -grub_sfs_create_node (struct grub_fshelp_node **node, - struct grub_sfs_data *data, +VasEBoot_sfs_create_node (struct VasEBoot_fshelp_node **node, + struct VasEBoot_sfs_data *data, const char *name, - grub_uint32_t block, grub_uint32_t size, int type, - grub_uint32_t mtime, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) + VasEBoot_uint32_t block, VasEBoot_uint32_t size, int type, + VasEBoot_uint32_t mtime, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_size_t len = grub_strlen (name); - grub_uint8_t *name_u8; + VasEBoot_size_t len = VasEBoot_strlen (name); + VasEBoot_uint8_t *name_u8; int ret; - *node = grub_malloc (sizeof (**node)); + *node = VasEBoot_malloc (sizeof (**node)); if (!*node) return 1; - name_u8 = grub_malloc (len * GRUB_MAX_UTF8_PER_LATIN1 + 1); + name_u8 = VasEBoot_malloc (len * VasEBoot_MAX_UTF8_PER_LATIN1 + 1); if (!name_u8) { - grub_free (*node); + VasEBoot_free (*node); return 1; } @@ -497,25 +497,25 @@ grub_sfs_create_node (struct grub_fshelp_node **node, (*node)->cache_size = 0; (*node)->cache_allocated = 0; - *grub_latin1_to_utf8 (name_u8, (const grub_uint8_t *) name, len) = '\0'; + *VasEBoot_latin1_to_utf8 (name_u8, (const VasEBoot_uint8_t *) name, len) = '\0'; ret = hook ((char *) name_u8, type | data->fshelp_flags, *node, hook_data); - grub_free (name_u8); + VasEBoot_free (name_u8); return ret; } static int -grub_sfs_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_sfs_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - struct grub_fshelp_node *node = 0; - struct grub_sfs_data *data = dir->data; + struct VasEBoot_fshelp_node *node = 0; + struct VasEBoot_sfs_data *data = dir->data; char *objc_data; - struct grub_sfs_objc *objc; + struct VasEBoot_sfs_objc *objc; unsigned int next = dir->block; - grub_uint32_t pos; + VasEBoot_uint32_t pos; - objc_data = grub_malloc (GRUB_DISK_SECTOR_SIZE << data->log_blocksize); + objc_data = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize); if (!objc_data) goto fail; @@ -523,31 +523,31 @@ grub_sfs_iterate_dir (grub_fshelp_node_t dir, every block. */ while (next) { - grub_disk_read (data->disk, ((grub_disk_addr_t) next) + VasEBoot_disk_read (data->disk, ((VasEBoot_disk_addr_t) next) << data->log_blocksize, 0, - GRUB_DISK_SECTOR_SIZE << data->log_blocksize, objc_data); - if (grub_errno) + VasEBoot_DISK_SECTOR_SIZE << data->log_blocksize, objc_data); + if (VasEBoot_errno) goto fail; - objc = (struct grub_sfs_objc *) objc_data; + objc = (struct VasEBoot_sfs_objc *) objc_data; pos = (char *) &objc->objects[0] - (char *) objc; /* Iterate over all entries in this block. */ - while (pos + sizeof (struct grub_sfs_obj) - < (1U << (GRUB_DISK_SECTOR_BITS + data->log_blocksize))) + while (pos + sizeof (struct VasEBoot_sfs_obj) + < (1U << (VasEBoot_DISK_SECTOR_BITS + data->log_blocksize))) { - struct grub_sfs_obj *obj; - obj = (struct grub_sfs_obj *) ((char *) objc + pos); + struct VasEBoot_sfs_obj *obj; + obj = (struct VasEBoot_sfs_obj *) ((char *) objc + pos); const char *filename = (const char *) obj->filename; - grub_size_t len; - enum grub_fshelp_filetype type; - grub_uint32_t block; + VasEBoot_size_t len; + enum VasEBoot_fshelp_filetype type; + VasEBoot_uint32_t block; /* The filename and comment dynamically increase the size of the object. */ - len = grub_strlen (filename); - len += grub_strlen (filename + len + 1); + len = VasEBoot_strlen (filename); + len += VasEBoot_strlen (filename + len + 1); pos += sizeof (*obj) + len; /* Round up to a multiple of two bytes. */ @@ -557,60 +557,60 @@ grub_sfs_iterate_dir (grub_fshelp_node_t dir, continue; /* First check if the file was not deleted. */ - if (obj->type & GRUB_SFS_TYPE_DELETED) + if (obj->type & VasEBoot_SFS_TYPE_DELETED) continue; - else if (obj->type & GRUB_SFS_TYPE_SYMLINK) - type = GRUB_FSHELP_SYMLINK; - else if (obj->type & GRUB_SFS_TYPE_DIR) - type = GRUB_FSHELP_DIR; + else if (obj->type & VasEBoot_SFS_TYPE_SYMLINK) + type = VasEBoot_FSHELP_SYMLINK; + else if (obj->type & VasEBoot_SFS_TYPE_DIR) + type = VasEBoot_FSHELP_DIR; else - type = GRUB_FSHELP_REG; + type = VasEBoot_FSHELP_REG; - if (type == GRUB_FSHELP_DIR) - block = grub_be_to_cpu32 (obj->file_dir.dir.dir_objc); + if (type == VasEBoot_FSHELP_DIR) + block = VasEBoot_be_to_cpu32 (obj->file_dir.dir.dir_objc); else - block = grub_be_to_cpu32 (obj->file_dir.file.first_block); + block = VasEBoot_be_to_cpu32 (obj->file_dir.file.first_block); - if (grub_sfs_create_node (&node, data, filename, block, - grub_be_to_cpu32 (obj->file_dir.file.size), - type, grub_be_to_cpu32 (obj->mtime), + if (VasEBoot_sfs_create_node (&node, data, filename, block, + VasEBoot_be_to_cpu32 (obj->file_dir.file.size), + type, VasEBoot_be_to_cpu32 (obj->mtime), hook, hook_data)) { - grub_free (objc_data); + VasEBoot_free (objc_data); return 1; } } - next = grub_be_to_cpu32 (objc->next); + next = VasEBoot_be_to_cpu32 (objc->next); } fail: - grub_free (objc_data); + VasEBoot_free (objc_data); return 0; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_sfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_sfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_sfs_data *data; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_sfs_data *data; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_sfs_mount (file->device->disk); + data = VasEBoot_sfs_mount (file->device->disk); if (!data) goto fail; - grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_sfs_iterate_dir, - grub_sfs_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &data->diropen, &fdiro, VasEBoot_sfs_iterate_dir, + VasEBoot_sfs_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; file->size = fdiro->size; data->diropen = *fdiro; - grub_free (fdiro); + VasEBoot_free (fdiro); file->data = data; file->offset = 0; @@ -619,147 +619,147 @@ grub_sfs_open (struct grub_file *file, const char *name) fail: if (data && fdiro != &data->diropen) - grub_free (fdiro); + VasEBoot_free (fdiro); if (data) - grub_free (data->label); - grub_free (data); + VasEBoot_free (data->label); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_sfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_sfs_close (VasEBoot_file_t file) { - struct grub_sfs_data *data = (struct grub_sfs_data *) file->data; + struct VasEBoot_sfs_data *data = (struct VasEBoot_sfs_data *) file->data; - grub_free (data->diropen.cache); - grub_free (data->label); - grub_free (data); + VasEBoot_free (data->diropen.cache); + VasEBoot_free (data->label); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read LEN bytes data from FILE into BUF. */ -static grub_ssize_t -grub_sfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_sfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_sfs_data *data = (struct grub_sfs_data *) file->data; + struct VasEBoot_sfs_data *data = (struct VasEBoot_sfs_data *) file->data; - return grub_sfs_read_file (&data->diropen, + return VasEBoot_sfs_read_file (&data->diropen, file->read_hook, file->read_hook_data, file->offset, len, buf); } -/* Context for grub_sfs_dir. */ -struct grub_sfs_dir_ctx +/* Context for VasEBoot_sfs_dir. */ +struct VasEBoot_sfs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_sfs_dir. */ +/* Helper for VasEBoot_sfs_dir. */ static int -grub_sfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_sfs_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_sfs_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_sfs_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtime = node->mtime + 8 * 365 * 86400 + 86400 * 2; info.mtimeset = 1; - grub_free (node->cache); - grub_free (node); + VasEBoot_free (node->cache); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_sfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_sfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_sfs_dir_ctx ctx = { hook, hook_data }; - struct grub_sfs_data *data = 0; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_sfs_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_sfs_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_sfs_mount (device->disk); + data = VasEBoot_sfs_mount (device->disk); if (!data) goto fail; - grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_sfs_iterate_dir, - grub_sfs_read_symlink, GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &data->diropen, &fdiro, VasEBoot_sfs_iterate_dir, + VasEBoot_sfs_read_symlink, VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_sfs_iterate_dir (fdiro, grub_sfs_dir_iter, &ctx); + VasEBoot_sfs_iterate_dir (fdiro, VasEBoot_sfs_dir_iter, &ctx); fail: if (data && fdiro != &data->diropen) - grub_free (fdiro); + VasEBoot_free (fdiro); if (data) - grub_free (data->label); - grub_free (data); + VasEBoot_free (data->label); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_sfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_sfs_label (VasEBoot_device_t device, char **label) { - struct grub_sfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_sfs_data *data; + VasEBoot_disk_t disk = device->disk; - data = grub_sfs_mount (disk); + data = VasEBoot_sfs_mount (disk); if (data) { - grub_size_t len = grub_strlen (data->label); - *label = grub_malloc (len * GRUB_MAX_UTF8_PER_LATIN1 + 1); + VasEBoot_size_t len = VasEBoot_strlen (data->label); + *label = VasEBoot_malloc (len * VasEBoot_MAX_UTF8_PER_LATIN1 + 1); if (*label) - *grub_latin1_to_utf8 ((grub_uint8_t *) *label, - (const grub_uint8_t *) data->label, + *VasEBoot_latin1_to_utf8 ((VasEBoot_uint8_t *) *label, + (const VasEBoot_uint8_t *) data->label, len) = '\0'; - grub_free (data->label); + VasEBoot_free (data->label); } - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_sfs_fs = +static struct VasEBoot_fs VasEBoot_sfs_fs = { .name = "sfs", - .dir = grub_sfs_dir, - .open = grub_sfs_open, - .read = grub_sfs_read, - .close = grub_sfs_close, - .label = grub_sfs_label, -#ifdef GRUB_UTIL + .dir = VasEBoot_sfs_dir, + .open = VasEBoot_sfs_open, + .read = VasEBoot_sfs_read, + .close = VasEBoot_sfs_close, + .label = VasEBoot_sfs_label, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(sfs) +VasEBoot_MOD_INIT(sfs) { - grub_fs_register (&grub_sfs_fs); + VasEBoot_fs_register (&VasEBoot_sfs_fs); my_mod = mod; } -GRUB_MOD_FINI(sfs) +VasEBoot_MOD_FINI(sfs) { - grub_fs_unregister (&grub_sfs_fs); + VasEBoot_fs_unregister (&VasEBoot_sfs_fs); } diff --git a/VasEBoot-core/fs/squash4.c b/VasEBoot-core/fs/squash4.c index 2c967c65a..a6812ec89 100644 --- a/VasEBoot-core/fs/squash4.c +++ b/VasEBoot-core/fs/squash4.c @@ -1,37 +1,37 @@ /* squash4.c - SquashFS */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "xz.h" #include "xz_stream.h" -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* object format Pointed by @@ -50,104 +50,104 @@ GRUB_MOD_LICENSE ("GPLv3+"); unk2 containts one uint64_t */ -struct grub_squash_super +struct VasEBoot_squash_super { - grub_uint32_t magic; + VasEBoot_uint32_t magic; #define SQUASH_MAGIC 0x73717368 - grub_uint32_t dummy1; - grub_uint32_t creation_time; - grub_uint32_t block_size; - grub_uint32_t dummy2; - grub_uint16_t compression; - grub_uint16_t dummy3; - grub_uint64_t dummy4; - grub_uint16_t root_ino_offset; - grub_uint32_t root_ino_chunk; - grub_uint16_t dummy5; - grub_uint64_t total_size; - grub_uint64_t exttbloffset; - grub_uint64_t dummy6; - grub_uint64_t inodeoffset; - grub_uint64_t diroffset; - grub_uint64_t unk1offset; - grub_uint64_t unk2offset; -} GRUB_PACKED; + VasEBoot_uint32_t dummy1; + VasEBoot_uint32_t creation_time; + VasEBoot_uint32_t block_size; + VasEBoot_uint32_t dummy2; + VasEBoot_uint16_t compression; + VasEBoot_uint16_t dummy3; + VasEBoot_uint64_t dummy4; + VasEBoot_uint16_t root_ino_offset; + VasEBoot_uint32_t root_ino_chunk; + VasEBoot_uint16_t dummy5; + VasEBoot_uint64_t total_size; + VasEBoot_uint64_t exttbloffset; + VasEBoot_uint64_t dummy6; + VasEBoot_uint64_t inodeoffset; + VasEBoot_uint64_t diroffset; + VasEBoot_uint64_t unk1offset; + VasEBoot_uint64_t unk2offset; +} VasEBoot_PACKED; /* Chunk-based */ -struct grub_squash_inode +struct VasEBoot_squash_inode { /* Same values as direlem types. */ - grub_uint16_t type; - grub_uint16_t dummy[3]; - grub_uint32_t mtime; - grub_uint32_t dummy2; + VasEBoot_uint16_t type; + VasEBoot_uint16_t dummy[3]; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t dummy2; union { struct { - grub_uint32_t chunk; - grub_uint32_t fragment; - grub_uint32_t offset; - grub_uint32_t size; - grub_uint32_t block_size[0]; - } GRUB_PACKED file; + VasEBoot_uint32_t chunk; + VasEBoot_uint32_t fragment; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t size; + VasEBoot_uint32_t block_size[0]; + } VasEBoot_PACKED file; struct { - grub_uint64_t chunk; - grub_uint64_t size; - grub_uint32_t dummy1[3]; - grub_uint32_t fragment; - grub_uint32_t offset; - grub_uint32_t dummy3; - grub_uint32_t block_size[0]; - } GRUB_PACKED long_file; + VasEBoot_uint64_t chunk; + VasEBoot_uint64_t size; + VasEBoot_uint32_t dummy1[3]; + VasEBoot_uint32_t fragment; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t dummy3; + VasEBoot_uint32_t block_size[0]; + } VasEBoot_PACKED long_file; struct { - grub_uint32_t chunk; - grub_uint32_t dummy; - grub_uint16_t size; - grub_uint16_t offset; - } GRUB_PACKED dir; + VasEBoot_uint32_t chunk; + VasEBoot_uint32_t dummy; + VasEBoot_uint16_t size; + VasEBoot_uint16_t offset; + } VasEBoot_PACKED dir; struct { - grub_uint32_t dummy1; - grub_uint32_t size; - grub_uint32_t chunk; - grub_uint32_t dummy2; - grub_uint16_t dummy3; - grub_uint16_t offset; - } GRUB_PACKED long_dir; + VasEBoot_uint32_t dummy1; + VasEBoot_uint32_t size; + VasEBoot_uint32_t chunk; + VasEBoot_uint32_t dummy2; + VasEBoot_uint16_t dummy3; + VasEBoot_uint16_t offset; + } VasEBoot_PACKED long_dir; struct { - grub_uint32_t dummy; - grub_uint32_t namelen; + VasEBoot_uint32_t dummy; + VasEBoot_uint32_t namelen; char name[0]; - } GRUB_PACKED symlink; - } GRUB_PACKED; -} GRUB_PACKED; + } VasEBoot_PACKED symlink; + } VasEBoot_PACKED; +} VasEBoot_PACKED; -struct grub_squash_cache_inode +struct VasEBoot_squash_cache_inode { - struct grub_squash_inode ino; - grub_disk_addr_t ino_chunk; - grub_uint16_t ino_offset; - grub_uint32_t *block_sizes; - grub_disk_addr_t *cumulated_block_sizes; + struct VasEBoot_squash_inode ino; + VasEBoot_disk_addr_t ino_chunk; + VasEBoot_uint16_t ino_offset; + VasEBoot_uint32_t *block_sizes; + VasEBoot_disk_addr_t *cumulated_block_sizes; }; /* Chunk-based. */ -struct grub_squash_dirent_header +struct VasEBoot_squash_dirent_header { /* Actually the value is the number of elements - 1. */ - grub_uint32_t nelems; - grub_uint32_t ino_chunk; - grub_uint32_t dummy; -} GRUB_PACKED; + VasEBoot_uint32_t nelems; + VasEBoot_uint32_t ino_chunk; + VasEBoot_uint32_t dummy; +} VasEBoot_PACKED; -struct grub_squash_dirent +struct VasEBoot_squash_dirent { - grub_uint16_t ino_offset; - grub_uint16_t dummy; - grub_uint16_t type; + VasEBoot_uint16_t ino_offset; + VasEBoot_uint16_t dummy; + VasEBoot_uint16_t type; /* Actually the value is the length of name - 1. */ - grub_uint16_t namelen; + VasEBoot_uint16_t namelen; char name[0]; -} GRUB_PACKED; +} VasEBoot_PACKED; enum { @@ -159,12 +159,12 @@ enum }; -struct grub_squash_frag_desc +struct VasEBoot_squash_frag_desc { - grub_uint64_t offset; - grub_uint32_t size; - grub_uint32_t dummy; -} GRUB_PACKED; + VasEBoot_uint64_t offset; + VasEBoot_uint32_t size; + VasEBoot_uint32_t dummy; +} VasEBoot_PACKED; enum { @@ -189,65 +189,65 @@ enum #define SQUASH_CHUNK_SIZE 0x2000 #define XZBUFSIZ 0x2000 -struct grub_squash_data +struct VasEBoot_squash_data { - grub_disk_t disk; - struct grub_squash_super sb; - struct grub_squash_cache_inode ino; - grub_uint64_t fragments; + VasEBoot_disk_t disk; + struct VasEBoot_squash_super sb; + struct VasEBoot_squash_cache_inode ino; + VasEBoot_uint64_t fragments; int log2_blksz; - grub_size_t blksz; - grub_ssize_t (*decompress) (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t outsize, - struct grub_squash_data *data); + VasEBoot_size_t blksz; + VasEBoot_ssize_t (*decompress) (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t outsize, + struct VasEBoot_squash_data *data); struct xz_dec *xzdec; char *xzbuf; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_squash_data *data; - struct grub_squash_inode ino; - grub_size_t stsize; + struct VasEBoot_squash_data *data; + struct VasEBoot_squash_inode ino; + VasEBoot_size_t stsize; struct { - grub_disk_addr_t ino_chunk; - grub_uint16_t ino_offset; + VasEBoot_disk_addr_t ino_chunk; + VasEBoot_uint16_t ino_offset; } stack[1]; }; -static grub_err_t -read_chunk (struct grub_squash_data *data, void *buf, grub_size_t len, - grub_uint64_t chunk_start, grub_off_t offset) +static VasEBoot_err_t +read_chunk (struct VasEBoot_squash_data *data, void *buf, VasEBoot_size_t len, + VasEBoot_uint64_t chunk_start, VasEBoot_off_t offset) { while (len > 0) { - grub_uint64_t csize; - grub_uint16_t d; - grub_err_t err; + VasEBoot_uint64_t csize; + VasEBoot_uint16_t d; + VasEBoot_err_t err; while (1) { - err = grub_disk_read (data->disk, - chunk_start >> GRUB_DISK_SECTOR_BITS, - chunk_start & (GRUB_DISK_SECTOR_SIZE - 1), + err = VasEBoot_disk_read (data->disk, + chunk_start >> VasEBoot_DISK_SECTOR_BITS, + chunk_start & (VasEBoot_DISK_SECTOR_SIZE - 1), sizeof (d), &d); if (err) return err; if (offset < SQUASH_CHUNK_SIZE) break; offset -= SQUASH_CHUNK_SIZE; - chunk_start += 2 + (grub_le_to_cpu16 (d) & ~SQUASH_CHUNK_FLAGS); + chunk_start += 2 + (VasEBoot_le_to_cpu16 (d) & ~SQUASH_CHUNK_FLAGS); } csize = SQUASH_CHUNK_SIZE - offset; if (csize > len) csize = len; - if (grub_le_to_cpu16 (d) & SQUASH_CHUNK_UNCOMPRESSED) + if (VasEBoot_le_to_cpu16 (d) & SQUASH_CHUNK_UNCOMPRESSED) { - grub_disk_addr_t a = chunk_start + 2 + offset; - err = grub_disk_read (data->disk, (a >> GRUB_DISK_SECTOR_BITS), - a & (GRUB_DISK_SECTOR_SIZE - 1), + VasEBoot_disk_addr_t a = chunk_start + 2 + offset; + err = VasEBoot_disk_read (data->disk, (a >> VasEBoot_DISK_SECTOR_BITS), + a & (VasEBoot_DISK_SECTOR_SIZE - 1), csize, buf); if (err) return err; @@ -255,83 +255,83 @@ read_chunk (struct grub_squash_data *data, void *buf, grub_size_t len, else { char *tmp; - grub_size_t bsize = grub_le_to_cpu16 (d) & ~SQUASH_CHUNK_FLAGS; - grub_disk_addr_t a = chunk_start + 2; - tmp = grub_malloc (bsize); + VasEBoot_size_t bsize = VasEBoot_le_to_cpu16 (d) & ~SQUASH_CHUNK_FLAGS; + VasEBoot_disk_addr_t a = chunk_start + 2; + tmp = VasEBoot_malloc (bsize); if (!tmp) - return grub_errno; + return VasEBoot_errno; /* FIXME: buffer uncompressed data. */ - err = grub_disk_read (data->disk, (a >> GRUB_DISK_SECTOR_BITS), - a & (GRUB_DISK_SECTOR_SIZE - 1), + err = VasEBoot_disk_read (data->disk, (a >> VasEBoot_DISK_SECTOR_BITS), + a & (VasEBoot_DISK_SECTOR_SIZE - 1), bsize, tmp); if (err) { - grub_free (tmp); + VasEBoot_free (tmp); return err; } if (data->decompress (tmp, bsize, offset, buf, csize, data) < 0) { - grub_free (tmp); - return grub_errno; + VasEBoot_free (tmp); + return VasEBoot_errno; } - grub_free (tmp); + VasEBoot_free (tmp); } len -= csize; offset += csize; buf = (char *) buf + csize; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t outsize, - struct grub_squash_data *data __attribute__ ((unused))) +static VasEBoot_ssize_t +zlib_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t outsize, + struct VasEBoot_squash_data *data __attribute__ ((unused))) { - return grub_zlib_decompress (inbuf, insize, off, outbuf, outsize); + return VasEBoot_zlib_decompress (inbuf, insize, off, outbuf, outsize); } -static grub_ssize_t -lzo_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t len, struct grub_squash_data *data) +static VasEBoot_ssize_t +lzo_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t len, struct VasEBoot_squash_data *data) { lzo_uint usize = data->blksz; - grub_uint8_t *udata; + VasEBoot_uint8_t *udata; if (usize < 8192) usize = 8192; - udata = grub_malloc (usize); + udata = VasEBoot_malloc (usize); if (!udata) return -1; - if (lzo1x_decompress_safe ((grub_uint8_t *) inbuf, + if (lzo1x_decompress_safe ((VasEBoot_uint8_t *) inbuf, insize, udata, &usize, NULL) != LZO_E_OK) { - grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk"); - grub_free (udata); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect compressed chunk"); + VasEBoot_free (udata); return -1; } - grub_memcpy (outbuf, udata + off, len); - grub_free (udata); + VasEBoot_memcpy (outbuf, udata + off, len); + VasEBoot_free (udata); return len; } -static grub_ssize_t -xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t len, struct grub_squash_data *data) +static VasEBoot_ssize_t +xz_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t len, struct VasEBoot_squash_data *data) { - grub_size_t ret = 0; - grub_off_t pos = 0; + VasEBoot_size_t ret = 0; + VasEBoot_off_t pos = 0; struct xz_buf buf; xz_dec_reset (data->xzdec); - buf.in = (grub_uint8_t *) inbuf; + buf.in = (VasEBoot_uint8_t *) inbuf; buf.in_pos = 0; buf.in_size = insize; - buf.out = (grub_uint8_t *) data->xzbuf; + buf.out = (VasEBoot_uint8_t *) data->xzbuf; buf.out_pos = 0; buf.out_size = XZBUFSIZ; @@ -345,19 +345,19 @@ xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off, if (xzret != XZ_OK && xzret != XZ_STREAM_END) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "invalid xz chunk"); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "invalid xz chunk"); return -1; } if (pos + buf.out_pos >= off) { - grub_ssize_t outoff = pos - off; - grub_size_t l; + VasEBoot_ssize_t outoff = pos - off; + VasEBoot_size_t l; if (outoff >= 0) { l = buf.out_pos; if (l > len) l = len; - grub_memcpy (outbuf + outoff, buf.out, l); + VasEBoot_memcpy (outbuf + outoff, buf.out, l); } else { @@ -365,7 +365,7 @@ xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off, l = buf.out_pos - outoff; if (l > len) l = len; - grub_memcpy (outbuf, buf.out + outoff, l); + VasEBoot_memcpy (outbuf, buf.out + outoff, l); } ret += l; len -= l; @@ -377,76 +377,76 @@ xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off, return ret; } -static struct grub_squash_data * -squash_mount (grub_disk_t disk) +static struct VasEBoot_squash_data * +squash_mount (VasEBoot_disk_t disk) { - struct grub_squash_super sb; - grub_err_t err; - struct grub_squash_data *data; - grub_uint64_t frag; + struct VasEBoot_squash_super sb; + VasEBoot_err_t err; + struct VasEBoot_squash_data *data; + VasEBoot_uint64_t frag; - err = grub_disk_read (disk, 0, 0, sizeof (sb), &sb); - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a squash4"); + err = VasEBoot_disk_read (disk, 0, 0, sizeof (sb), &sb); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a squash4"); if (err) return NULL; - if (sb.magic != grub_cpu_to_le32_compile_time (SQUASH_MAGIC) + if (sb.magic != VasEBoot_cpu_to_le32_compile_time (SQUASH_MAGIC) || sb.block_size == 0 || ((sb.block_size - 1) & sb.block_size)) { - grub_error (GRUB_ERR_BAD_FS, "not squash4"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not squash4"); return NULL; } - err = grub_disk_read (disk, - grub_le_to_cpu64 (sb.unk1offset) - >> GRUB_DISK_SECTOR_BITS, - grub_le_to_cpu64 (sb.unk1offset) - & (GRUB_DISK_SECTOR_SIZE - 1), sizeof (frag), &frag); - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a squash4"); + err = VasEBoot_disk_read (disk, + VasEBoot_le_to_cpu64 (sb.unk1offset) + >> VasEBoot_DISK_SECTOR_BITS, + VasEBoot_le_to_cpu64 (sb.unk1offset) + & (VasEBoot_DISK_SECTOR_SIZE - 1), sizeof (frag), &frag); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a squash4"); if (err) return NULL; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) return NULL; data->sb = sb; data->disk = disk; - data->fragments = grub_le_to_cpu64 (frag); + data->fragments = VasEBoot_le_to_cpu64 (frag); switch (sb.compression) { - case grub_cpu_to_le16_compile_time (COMPRESSION_ZLIB): + case VasEBoot_cpu_to_le16_compile_time (COMPRESSION_ZLIB): data->decompress = zlib_decompress; break; - case grub_cpu_to_le16_compile_time (COMPRESSION_LZO): + case VasEBoot_cpu_to_le16_compile_time (COMPRESSION_LZO): data->decompress = lzo_decompress; break; - case grub_cpu_to_le16_compile_time (COMPRESSION_XZ): + case VasEBoot_cpu_to_le16_compile_time (COMPRESSION_XZ): data->decompress = xz_decompress; - data->xzbuf = grub_malloc (XZBUFSIZ); + data->xzbuf = VasEBoot_malloc (XZBUFSIZ); if (!data->xzbuf) { - grub_free (data); + VasEBoot_free (data); return NULL; } data->xzdec = xz_dec_init (1 << 16); if (!data->xzdec) { - grub_free (data->xzbuf); - grub_free (data); + VasEBoot_free (data->xzbuf); + VasEBoot_free (data); return NULL; } break; default: - grub_free (data); - grub_error (GRUB_ERR_BAD_FS, "unsupported compression %d", - grub_le_to_cpu16 (sb.compression)); + VasEBoot_free (data); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "unsupported compression %d", + VasEBoot_le_to_cpu16 (sb.compression)); return NULL; } - data->blksz = grub_le_to_cpu32 (data->sb.block_size); + data->blksz = VasEBoot_le_to_cpu32 (data->sb.block_size); for (data->log2_blksz = 0; (1U << data->log2_blksz) < data->blksz; data->log2_blksz++); @@ -455,155 +455,155 @@ squash_mount (grub_disk_t disk) } static char * -grub_squash_read_symlink (grub_fshelp_node_t node) +VasEBoot_squash_read_symlink (VasEBoot_fshelp_node_t node) { char *ret; - grub_err_t err; - ret = grub_malloc (grub_le_to_cpu32 (node->ino.symlink.namelen) + 1); + VasEBoot_err_t err; + ret = VasEBoot_malloc (VasEBoot_le_to_cpu32 (node->ino.symlink.namelen) + 1); err = read_chunk (node->data, ret, - grub_le_to_cpu32 (node->ino.symlink.namelen), - grub_le_to_cpu64 (node->data->sb.inodeoffset) + VasEBoot_le_to_cpu32 (node->ino.symlink.namelen), + VasEBoot_le_to_cpu64 (node->data->sb.inodeoffset) + node->stack[node->stsize - 1].ino_chunk, node->stack[node->stsize - 1].ino_offset + (node->ino.symlink.name - (char *) &node->ino)); if (err) { - grub_free (ret); + VasEBoot_free (ret); return NULL; } - ret[grub_le_to_cpu32 (node->ino.symlink.namelen)] = 0; + ret[VasEBoot_le_to_cpu32 (node->ino.symlink.namelen)] = 0; return ret; } static int -grub_squash_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_squash_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_uint32_t off; - grub_uint32_t endoff; - grub_uint64_t chunk; + VasEBoot_uint32_t off; + VasEBoot_uint32_t endoff; + VasEBoot_uint64_t chunk; unsigned i; /* FIXME: why - 3 ? */ switch (dir->ino.type) { - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_DIR): - off = grub_le_to_cpu16 (dir->ino.dir.offset); - endoff = grub_le_to_cpu16 (dir->ino.dir.size) + off - 3; - chunk = grub_le_to_cpu32 (dir->ino.dir.chunk); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_DIR): + off = VasEBoot_le_to_cpu16 (dir->ino.dir.offset); + endoff = VasEBoot_le_to_cpu16 (dir->ino.dir.size) + off - 3; + chunk = VasEBoot_le_to_cpu32 (dir->ino.dir.chunk); break; - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_DIR): - off = grub_le_to_cpu16 (dir->ino.long_dir.offset); - endoff = grub_le_to_cpu16 (dir->ino.long_dir.size) + off - 3; - chunk = grub_le_to_cpu32 (dir->ino.long_dir.chunk); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_DIR): + off = VasEBoot_le_to_cpu16 (dir->ino.long_dir.offset); + endoff = VasEBoot_le_to_cpu16 (dir->ino.long_dir.size) + off - 3; + chunk = VasEBoot_le_to_cpu32 (dir->ino.long_dir.chunk); break; default: - grub_error (GRUB_ERR_BAD_FS, "unexpected ino type 0x%x", - grub_le_to_cpu16 (dir->ino.type)); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "unexpected ino type 0x%x", + VasEBoot_le_to_cpu16 (dir->ino.type)); return 0; } { - grub_fshelp_node_t node; - node = grub_malloc (sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); + VasEBoot_fshelp_node_t node; + node = VasEBoot_malloc (sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); if (!node) return 0; - grub_memcpy (node, dir, + VasEBoot_memcpy (node, dir, sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); - if (hook (".", GRUB_FSHELP_DIR, node, hook_data)) + if (hook (".", VasEBoot_FSHELP_DIR, node, hook_data)) return 1; if (dir->stsize != 1) { - grub_err_t err; + VasEBoot_err_t err; - node = grub_malloc (sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); + node = VasEBoot_malloc (sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); if (!node) return 0; - grub_memcpy (node, dir, + VasEBoot_memcpy (node, dir, sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); node->stsize--; err = read_chunk (dir->data, &node->ino, sizeof (node->ino), - grub_le_to_cpu64 (dir->data->sb.inodeoffset) + VasEBoot_le_to_cpu64 (dir->data->sb.inodeoffset) + node->stack[node->stsize - 1].ino_chunk, node->stack[node->stsize - 1].ino_offset); if (err) return 0; - if (hook ("..", GRUB_FSHELP_DIR, node, hook_data)) + if (hook ("..", VasEBoot_FSHELP_DIR, node, hook_data)) return 1; } } while (off < endoff) { - struct grub_squash_dirent_header dh; - grub_err_t err; + struct VasEBoot_squash_dirent_header dh; + VasEBoot_err_t err; err = read_chunk (dir->data, &dh, sizeof (dh), - grub_le_to_cpu64 (dir->data->sb.diroffset) + VasEBoot_le_to_cpu64 (dir->data->sb.diroffset) + chunk, off); if (err) return 0; off += sizeof (dh); - for (i = 0; i < (unsigned) grub_le_to_cpu32 (dh.nelems) + 1; i++) + for (i = 0; i < (unsigned) VasEBoot_le_to_cpu32 (dh.nelems) + 1; i++) { char *buf; int r; - struct grub_fshelp_node *node; - enum grub_fshelp_filetype filetype = GRUB_FSHELP_REG; - struct grub_squash_dirent di; - struct grub_squash_inode ino; + struct VasEBoot_fshelp_node *node; + enum VasEBoot_fshelp_filetype filetype = VasEBoot_FSHELP_REG; + struct VasEBoot_squash_dirent di; + struct VasEBoot_squash_inode ino; err = read_chunk (dir->data, &di, sizeof (di), - grub_le_to_cpu64 (dir->data->sb.diroffset) + VasEBoot_le_to_cpu64 (dir->data->sb.diroffset) + chunk, off); if (err) return 0; off += sizeof (di); err = read_chunk (dir->data, &ino, sizeof (ino), - grub_le_to_cpu64 (dir->data->sb.inodeoffset) - + grub_le_to_cpu32 (dh.ino_chunk), - grub_cpu_to_le16 (di.ino_offset)); + VasEBoot_le_to_cpu64 (dir->data->sb.inodeoffset) + + VasEBoot_le_to_cpu32 (dh.ino_chunk), + VasEBoot_cpu_to_le16 (di.ino_offset)); if (err) return 0; - buf = grub_malloc (grub_le_to_cpu16 (di.namelen) + 2); + buf = VasEBoot_malloc (VasEBoot_le_to_cpu16 (di.namelen) + 2); if (!buf) return 0; err = read_chunk (dir->data, buf, - grub_le_to_cpu16 (di.namelen) + 1, - grub_le_to_cpu64 (dir->data->sb.diroffset) + VasEBoot_le_to_cpu16 (di.namelen) + 1, + VasEBoot_le_to_cpu64 (dir->data->sb.diroffset) + chunk, off); if (err) return 0; - off += grub_le_to_cpu16 (di.namelen) + 1; - buf[grub_le_to_cpu16 (di.namelen) + 1] = 0; - if (grub_le_to_cpu16 (di.type) == SQUASH_TYPE_DIR) - filetype = GRUB_FSHELP_DIR; - if (grub_le_to_cpu16 (di.type) == SQUASH_TYPE_SYMLINK) - filetype = GRUB_FSHELP_SYMLINK; + off += VasEBoot_le_to_cpu16 (di.namelen) + 1; + buf[VasEBoot_le_to_cpu16 (di.namelen) + 1] = 0; + if (VasEBoot_le_to_cpu16 (di.type) == SQUASH_TYPE_DIR) + filetype = VasEBoot_FSHELP_DIR; + if (VasEBoot_le_to_cpu16 (di.type) == SQUASH_TYPE_SYMLINK) + filetype = VasEBoot_FSHELP_SYMLINK; - node = grub_malloc (sizeof (*node) + node = VasEBoot_malloc (sizeof (*node) + (dir->stsize + 1) * sizeof (dir->stack[0])); if (! node) return 0; - grub_memcpy (node, dir, + VasEBoot_memcpy (node, dir, sizeof (*node) + dir->stsize * sizeof (dir->stack[0])); node->ino = ino; - node->stack[node->stsize].ino_chunk = grub_le_to_cpu32 (dh.ino_chunk); - node->stack[node->stsize].ino_offset = grub_le_to_cpu16 (di.ino_offset); + node->stack[node->stsize].ino_chunk = VasEBoot_le_to_cpu32 (dh.ino_chunk); + node->stack[node->stsize].ino_offset = VasEBoot_le_to_cpu16 (di.ino_offset); node->stsize++; r = hook (buf, filetype, node, hook_data); - grub_free (buf); + VasEBoot_free (buf); if (r) return r; } @@ -611,105 +611,105 @@ grub_squash_iterate_dir (grub_fshelp_node_t dir, return 0; } -static grub_err_t -make_root_node (struct grub_squash_data *data, struct grub_fshelp_node *root) +static VasEBoot_err_t +make_root_node (struct VasEBoot_squash_data *data, struct VasEBoot_fshelp_node *root) { - grub_memset (root, 0, sizeof (*root)); + VasEBoot_memset (root, 0, sizeof (*root)); root->data = data; root->stsize = 1; - root->stack[0].ino_chunk = grub_le_to_cpu32 (data->sb.root_ino_chunk); - root->stack[0].ino_offset = grub_cpu_to_le16 (data->sb.root_ino_offset); + root->stack[0].ino_chunk = VasEBoot_le_to_cpu32 (data->sb.root_ino_chunk); + root->stack[0].ino_offset = VasEBoot_cpu_to_le16 (data->sb.root_ino_offset); return read_chunk (data, &root->ino, sizeof (root->ino), - grub_le_to_cpu64 (data->sb.inodeoffset) + VasEBoot_le_to_cpu64 (data->sb.inodeoffset) + root->stack[0].ino_chunk, root->stack[0].ino_offset); } static void -squash_unmount (struct grub_squash_data *data) +squash_unmount (struct VasEBoot_squash_data *data) { if (data->xzdec) xz_dec_end (data->xzdec); - grub_free (data->xzbuf); - grub_free (data->ino.cumulated_block_sizes); - grub_free (data->ino.block_sizes); - grub_free (data); + VasEBoot_free (data->xzbuf); + VasEBoot_free (data->ino.cumulated_block_sizes); + VasEBoot_free (data->ino.block_sizes); + VasEBoot_free (data); } -/* Context for grub_squash_dir. */ -struct grub_squash_dir_ctx +/* Context for VasEBoot_squash_dir. */ +struct VasEBoot_squash_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_squash_dir. */ +/* Helper for VasEBoot_squash_dir. */ static int -grub_squash_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_squash_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_squash_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_squash_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); info.mtimeset = 1; - info.mtime = grub_le_to_cpu32 (node->ino.mtime); - grub_free (node); + info.mtime = VasEBoot_le_to_cpu32 (node->ino.mtime); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_squash_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_squash_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_squash_dir_ctx ctx = { hook, hook_data }; - struct grub_squash_data *data = 0; - struct grub_fshelp_node *fdiro = 0; - struct grub_fshelp_node root; - grub_err_t err; + struct VasEBoot_squash_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_squash_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; + struct VasEBoot_fshelp_node root; + VasEBoot_err_t err; data = squash_mount (device->disk); if (! data) - return grub_errno; + return VasEBoot_errno; err = make_root_node (data, &root); if (err) return err; - grub_fshelp_find_file (path, &root, &fdiro, grub_squash_iterate_dir, - grub_squash_read_symlink, GRUB_FSHELP_DIR); - if (!grub_errno) - grub_squash_iterate_dir (fdiro, grub_squash_dir_iter, &ctx); + VasEBoot_fshelp_find_file (path, &root, &fdiro, VasEBoot_squash_iterate_dir, + VasEBoot_squash_read_symlink, VasEBoot_FSHELP_DIR); + if (!VasEBoot_errno) + VasEBoot_squash_iterate_dir (fdiro, VasEBoot_squash_dir_iter, &ctx); squash_unmount (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_squash_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_squash_open (struct VasEBoot_file *file, const char *name) { - struct grub_squash_data *data = 0; - struct grub_fshelp_node *fdiro = 0; - struct grub_fshelp_node root; - grub_err_t err; + struct VasEBoot_squash_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; + struct VasEBoot_fshelp_node root; + VasEBoot_err_t err; data = squash_mount (file->device->disk); if (! data) - return grub_errno; + return VasEBoot_errno; err = make_root_node (data, &root); if (err) return err; - grub_fshelp_find_file (name, &root, &fdiro, grub_squash_iterate_dir, - grub_squash_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &root, &fdiro, VasEBoot_squash_iterate_dir, + VasEBoot_squash_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) { squash_unmount (data); - return grub_errno; + return VasEBoot_errno; } file->data = data; @@ -721,87 +721,87 @@ grub_squash_open (struct grub_file *file, const char *name) switch (fdiro->ino.type) { - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): - file->size = grub_le_to_cpu64 (fdiro->ino.long_file.size); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): + file->size = VasEBoot_le_to_cpu64 (fdiro->ino.long_file.size); break; - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): - file->size = grub_le_to_cpu32 (fdiro->ino.file.size); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): + file->size = VasEBoot_le_to_cpu32 (fdiro->ino.file.size); break; default: { - grub_uint16_t type = grub_le_to_cpu16 (fdiro->ino.type); - grub_free (fdiro); + VasEBoot_uint16_t type = VasEBoot_le_to_cpu16 (fdiro->ino.type); + VasEBoot_free (fdiro); squash_unmount (data); - return grub_error (GRUB_ERR_BAD_FS, "unexpected ino type 0x%x", type); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "unexpected ino type 0x%x", type); } } - grub_free (fdiro); + VasEBoot_free (fdiro); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -direct_read (struct grub_squash_data *data, - struct grub_squash_cache_inode *ino, - grub_off_t off, char *buf, grub_size_t len) +static VasEBoot_ssize_t +direct_read (struct VasEBoot_squash_data *data, + struct VasEBoot_squash_cache_inode *ino, + VasEBoot_off_t off, char *buf, VasEBoot_size_t len) { - grub_err_t err; - grub_off_t cumulated_uncompressed_size = 0; - grub_uint64_t a = 0; - grub_size_t i; - grub_size_t origlen = len; + VasEBoot_err_t err; + VasEBoot_off_t cumulated_uncompressed_size = 0; + VasEBoot_uint64_t a = 0; + VasEBoot_size_t i; + VasEBoot_size_t origlen = len; switch (ino->ino.type) { - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): - a = grub_le_to_cpu64 (ino->ino.long_file.chunk); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): + a = VasEBoot_le_to_cpu64 (ino->ino.long_file.chunk); break; - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): - a = grub_le_to_cpu32 (ino->ino.file.chunk); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): + a = VasEBoot_le_to_cpu32 (ino->ino.file.chunk); break; } if (!ino->block_sizes) { - grub_off_t total_size = 0; - grub_size_t total_blocks; - grub_size_t block_offset = 0; + VasEBoot_off_t total_size = 0; + VasEBoot_size_t total_blocks; + VasEBoot_size_t block_offset = 0; switch (ino->ino.type) { - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): - total_size = grub_le_to_cpu64 (ino->ino.long_file.size); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): + total_size = VasEBoot_le_to_cpu64 (ino->ino.long_file.size); block_offset = ((char *) &ino->ino.long_file.block_size - (char *) &ino->ino); break; - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): - total_size = grub_le_to_cpu32 (ino->ino.file.size); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): + total_size = VasEBoot_le_to_cpu32 (ino->ino.file.size); block_offset = ((char *) &ino->ino.file.block_size - (char *) &ino->ino); break; } total_blocks = ((total_size + data->blksz - 1) >> data->log2_blksz); - ino->block_sizes = grub_malloc (total_blocks + ino->block_sizes = VasEBoot_malloc (total_blocks * sizeof (ino->block_sizes[0])); - ino->cumulated_block_sizes = grub_malloc (total_blocks + ino->cumulated_block_sizes = VasEBoot_malloc (total_blocks * sizeof (ino->cumulated_block_sizes[0])); if (!ino->block_sizes || !ino->cumulated_block_sizes) { - grub_free (ino->block_sizes); - grub_free (ino->cumulated_block_sizes); + VasEBoot_free (ino->block_sizes); + VasEBoot_free (ino->cumulated_block_sizes); ino->block_sizes = 0; ino->cumulated_block_sizes = 0; return -1; } err = read_chunk (data, ino->block_sizes, total_blocks * sizeof (ino->block_sizes[0]), - grub_le_to_cpu64 (data->sb.inodeoffset) + VasEBoot_le_to_cpu64 (data->sb.inodeoffset) + ino->ino_chunk, ino->ino_offset + block_offset); if (err) { - grub_free (ino->block_sizes); - grub_free (ino->cumulated_block_sizes); + VasEBoot_free (ino->block_sizes); + VasEBoot_free (ino->cumulated_block_sizes); ino->block_sizes = 0; ino->cumulated_block_sizes = 0; return -1; @@ -809,16 +809,16 @@ direct_read (struct grub_squash_data *data, ino->cumulated_block_sizes[0] = 0; for (i = 1; i < total_blocks; i++) ino->cumulated_block_sizes[i] = ino->cumulated_block_sizes[i - 1] - + (grub_le_to_cpu32 (ino->block_sizes[i - 1]) & ~SQUASH_BLOCK_FLAGS); + + (VasEBoot_le_to_cpu32 (ino->block_sizes[i - 1]) & ~SQUASH_BLOCK_FLAGS); } if (a == 0) - a = sizeof (struct grub_squash_super); + a = sizeof (struct VasEBoot_squash_super); i = off >> data->log2_blksz; - cumulated_uncompressed_size = data->blksz * (grub_disk_addr_t) i; + cumulated_uncompressed_size = data->blksz * (VasEBoot_disk_addr_t) i; while (cumulated_uncompressed_size < off + len) { - grub_size_t boff, curread; + VasEBoot_size_t boff, curread; boff = off - cumulated_uncompressed_size; curread = data->blksz - boff; if (curread > len) @@ -826,79 +826,79 @@ direct_read (struct grub_squash_data *data, if (!ino->block_sizes[i]) { /* Sparse block */ - grub_memset (buf, '\0', curread); + VasEBoot_memset (buf, '\0', curread); } else if (!(ino->block_sizes[i] - & grub_cpu_to_le32_compile_time (SQUASH_BLOCK_UNCOMPRESSED))) + & VasEBoot_cpu_to_le32_compile_time (SQUASH_BLOCK_UNCOMPRESSED))) { char *block; - grub_size_t csize; - csize = grub_le_to_cpu32 (ino->block_sizes[i]) & ~SQUASH_BLOCK_FLAGS; - block = grub_malloc (csize); + VasEBoot_size_t csize; + csize = VasEBoot_le_to_cpu32 (ino->block_sizes[i]) & ~SQUASH_BLOCK_FLAGS; + block = VasEBoot_malloc (csize); if (!block) return -1; - err = grub_disk_read (data->disk, + err = VasEBoot_disk_read (data->disk, (ino->cumulated_block_sizes[i] + a) - >> GRUB_DISK_SECTOR_BITS, + >> VasEBoot_DISK_SECTOR_BITS, (ino->cumulated_block_sizes[i] + a) - & (GRUB_DISK_SECTOR_SIZE - 1), + & (VasEBoot_DISK_SECTOR_SIZE - 1), csize, block); if (err) { - grub_free (block); + VasEBoot_free (block); return -1; } if (data->decompress (block, csize, boff, buf, curread, data) - != (grub_ssize_t) curread) + != (VasEBoot_ssize_t) curread) { - grub_free (block); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk"); + VasEBoot_free (block); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect compressed chunk"); return -1; } - grub_free (block); + VasEBoot_free (block); } else - err = grub_disk_read (data->disk, + err = VasEBoot_disk_read (data->disk, (ino->cumulated_block_sizes[i] + a + boff) - >> GRUB_DISK_SECTOR_BITS, + >> VasEBoot_DISK_SECTOR_BITS, (ino->cumulated_block_sizes[i] + a + boff) - & (GRUB_DISK_SECTOR_SIZE - 1), + & (VasEBoot_DISK_SECTOR_SIZE - 1), curread, buf); if (err) return -1; off += curread; len -= curread; buf += curread; - cumulated_uncompressed_size += grub_le_to_cpu32 (data->sb.block_size); + cumulated_uncompressed_size += VasEBoot_le_to_cpu32 (data->sb.block_size); i++; } return origlen; } -static grub_ssize_t -grub_squash_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_squash_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_squash_data *data = file->data; - struct grub_squash_cache_inode *ino = &data->ino; - grub_off_t off = file->offset; - grub_err_t err; - grub_uint64_t a, b; - grub_uint32_t fragment = 0; + struct VasEBoot_squash_data *data = file->data; + struct VasEBoot_squash_cache_inode *ino = &data->ino; + VasEBoot_off_t off = file->offset; + VasEBoot_err_t err; + VasEBoot_uint64_t a, b; + VasEBoot_uint32_t fragment = 0; int compressed = 0; - struct grub_squash_frag_desc frag; - grub_off_t direct_len; - grub_uint64_t mask = grub_le_to_cpu32 (data->sb.block_size) - 1; - grub_size_t orig_len = len; + struct VasEBoot_squash_frag_desc frag; + VasEBoot_off_t direct_len; + VasEBoot_uint64_t mask = VasEBoot_le_to_cpu32 (data->sb.block_size) - 1; + VasEBoot_size_t orig_len = len; switch (ino->ino.type) { - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): - fragment = grub_le_to_cpu32 (ino->ino.long_file.fragment); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR): + fragment = VasEBoot_le_to_cpu32 (ino->ino.long_file.fragment); break; - case grub_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): - fragment = grub_le_to_cpu32 (ino->ino.file.fragment); + case VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_REGULAR): + fragment = VasEBoot_le_to_cpu32 (ino->ino.file.fragment); break; } @@ -907,13 +907,13 @@ grub_squash_read (grub_file_t file, char *buf, grub_size_t len) direct_len = fragment == 0xffffffff ? file->size : file->size & ~mask; if (off < direct_len) { - grub_size_t read_len = direct_len - off; - grub_ssize_t res; + VasEBoot_size_t read_len = direct_len - off; + VasEBoot_ssize_t res; if (read_len > len) read_len = len; res = direct_read (data, ino, off, buf, read_len); - if ((grub_size_t) res != read_len) + if ((VasEBoot_size_t) res != read_len) return -1; /* FIXME: is short read possible here? */ len -= read_len; if (!len) @@ -928,92 +928,92 @@ grub_squash_read (grub_file_t file, char *buf, grub_size_t len) data->fragments, sizeof (frag) * fragment); if (err) return -1; - a = grub_le_to_cpu64 (frag.offset); - compressed = !(frag.size & grub_cpu_to_le32_compile_time (SQUASH_BLOCK_UNCOMPRESSED)); - if (ino->ino.type == grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR)) - b = grub_le_to_cpu32 (ino->ino.long_file.offset) + off; + a = VasEBoot_le_to_cpu64 (frag.offset); + compressed = !(frag.size & VasEBoot_cpu_to_le32_compile_time (SQUASH_BLOCK_UNCOMPRESSED)); + if (ino->ino.type == VasEBoot_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR)) + b = VasEBoot_le_to_cpu32 (ino->ino.long_file.offset) + off; else - b = grub_le_to_cpu32 (ino->ino.file.offset) + off; + b = VasEBoot_le_to_cpu32 (ino->ino.file.offset) + off; /* FIXME: cache uncompressed chunks. */ if (compressed) { char *block; - block = grub_malloc (grub_le_to_cpu32 (frag.size)); + block = VasEBoot_malloc (VasEBoot_le_to_cpu32 (frag.size)); if (!block) return -1; - err = grub_disk_read (data->disk, - a >> GRUB_DISK_SECTOR_BITS, - a & (GRUB_DISK_SECTOR_SIZE - 1), - grub_le_to_cpu32 (frag.size), block); + err = VasEBoot_disk_read (data->disk, + a >> VasEBoot_DISK_SECTOR_BITS, + a & (VasEBoot_DISK_SECTOR_SIZE - 1), + VasEBoot_le_to_cpu32 (frag.size), block); if (err) { - grub_free (block); + VasEBoot_free (block); return -1; } - if (data->decompress (block, grub_le_to_cpu32 (frag.size), + if (data->decompress (block, VasEBoot_le_to_cpu32 (frag.size), b, buf, len, data) - != (grub_ssize_t) len) + != (VasEBoot_ssize_t) len) { - grub_free (block); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk"); + VasEBoot_free (block); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect compressed chunk"); return -1; } - grub_free (block); + VasEBoot_free (block); } else { - err = grub_disk_read (data->disk, (a + b) >> GRUB_DISK_SECTOR_BITS, - (a + b) & (GRUB_DISK_SECTOR_SIZE - 1), len, buf); + err = VasEBoot_disk_read (data->disk, (a + b) >> VasEBoot_DISK_SECTOR_BITS, + (a + b) & (VasEBoot_DISK_SECTOR_SIZE - 1), len, buf); if (err) return -1; } return orig_len; } -static grub_err_t -grub_squash_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_squash_close (VasEBoot_file_t file) { squash_unmount (file->data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_squash_mtime (grub_device_t dev, grub_int32_t *tm) +static VasEBoot_err_t +VasEBoot_squash_mtime (VasEBoot_device_t dev, VasEBoot_int32_t *tm) { - struct grub_squash_data *data = 0; + struct VasEBoot_squash_data *data = 0; data = squash_mount (dev->disk); if (! data) - return grub_errno; - *tm = grub_le_to_cpu32 (data->sb.creation_time); + return VasEBoot_errno; + *tm = VasEBoot_le_to_cpu32 (data->sb.creation_time); squash_unmount (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_fs grub_squash_fs = +static struct VasEBoot_fs VasEBoot_squash_fs = { .name = "squash4", - .dir = grub_squash_dir, - .open = grub_squash_open, - .read = grub_squash_read, - .close = grub_squash_close, - .mtime = grub_squash_mtime, -#ifdef GRUB_UTIL + .dir = VasEBoot_squash_dir, + .open = VasEBoot_squash_open, + .read = VasEBoot_squash_read, + .close = VasEBoot_squash_close, + .mtime = VasEBoot_squash_mtime, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 0, #endif .next = 0 }; -GRUB_MOD_INIT(squash4) +VasEBoot_MOD_INIT(squash4) { - grub_fs_register (&grub_squash_fs); + VasEBoot_fs_register (&VasEBoot_squash_fs); } -GRUB_MOD_FINI(squash4) +VasEBoot_MOD_FINI(squash4) { - grub_fs_unregister (&grub_squash_fs); + VasEBoot_fs_unregister (&VasEBoot_squash_fs); } diff --git a/VasEBoot-core/fs/tar.c b/VasEBoot-core/fs/tar.c index 39bf197aa..95ba3352c 100644 --- a/VasEBoot-core/fs/tar.c +++ b/VasEBoot-core/fs/tar.c @@ -1,6 +1,6 @@ /* cpio.c - cpio and tar filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2013 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify @@ -17,16 +17,16 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* tar support */ #define MAGIC "ustar" @@ -48,10 +48,10 @@ struct head char devmajor[8]; char devminor[8]; char prefix[155]; -} GRUB_PACKED; +} VasEBoot_PACKED; static inline unsigned long long -read_number (const char *str, grub_size_t size) +read_number (const char *str, VasEBoot_size_t size) { unsigned long long ret = 0; while (size-- && *str >= '0' && *str <= '7') @@ -59,20 +59,20 @@ read_number (const char *str, grub_size_t size) return ret; } -struct grub_archelp_data +struct VasEBoot_archelp_data { - grub_disk_t disk; - grub_off_t hofs, next_hofs; - grub_off_t dofs; - grub_off_t size; + VasEBoot_disk_t disk; + VasEBoot_off_t hofs, next_hofs; + VasEBoot_off_t dofs; + VasEBoot_off_t size; char *linkname; - grub_size_t linkname_alloc; + VasEBoot_size_t linkname_alloc; }; -static grub_err_t -grub_cpio_find_file (struct grub_archelp_data *data, char **name, - grub_int32_t *mtime, - grub_uint32_t *mode) +static VasEBoot_err_t +VasEBoot_cpio_find_file (struct VasEBoot_archelp_data *data, char **name, + VasEBoot_int32_t *mtime, + VasEBoot_uint32_t *mode) { struct head hd; int reread = 0, have_longname = 0, have_longlink = 0; @@ -81,89 +81,89 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name, for (reread = 0; reread < 3; reread++) { - if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) - return grub_errno; + if (VasEBoot_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) + return VasEBoot_errno; if (!hd.name[0] && !hd.prefix[0]) { - *mode = GRUB_ARCHELP_ATTR_END; - return GRUB_ERR_NONE; + *mode = VasEBoot_ARCHELP_ATTR_END; + return VasEBoot_ERR_NONE; } - if (grub_memcmp (hd.magic, MAGIC, sizeof (MAGIC) - 1)) - return grub_error (GRUB_ERR_BAD_FS, "invalid tar archive"); + if (VasEBoot_memcmp (hd.magic, MAGIC, sizeof (MAGIC) - 1)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid tar archive"); if (hd.typeflag == 'L') { - grub_err_t err; - grub_size_t namesize = read_number (hd.size, sizeof (hd.size)); - *name = grub_malloc (namesize + 1); + VasEBoot_err_t err; + VasEBoot_size_t namesize = read_number (hd.size, sizeof (hd.size)); + *name = VasEBoot_malloc (namesize + 1); if (*name == NULL) - return grub_errno; - err = grub_disk_read (data->disk, 0, - data->hofs + GRUB_DISK_SECTOR_SIZE, namesize, + return VasEBoot_errno; + err = VasEBoot_disk_read (data->disk, 0, + data->hofs + VasEBoot_DISK_SECTOR_SIZE, namesize, *name); (*name)[namesize] = 0; if (err) return err; - data->hofs += GRUB_DISK_SECTOR_SIZE - + ((namesize + GRUB_DISK_SECTOR_SIZE - 1) & - ~(GRUB_DISK_SECTOR_SIZE - 1)); + data->hofs += VasEBoot_DISK_SECTOR_SIZE + + ((namesize + VasEBoot_DISK_SECTOR_SIZE - 1) & + ~(VasEBoot_DISK_SECTOR_SIZE - 1)); have_longname = 1; continue; } if (hd.typeflag == 'K') { - grub_err_t err; - grub_size_t linksize = read_number (hd.size, sizeof (hd.size)); + VasEBoot_err_t err; + VasEBoot_size_t linksize = read_number (hd.size, sizeof (hd.size)); if (data->linkname_alloc < linksize + 1) { char *n; - n = grub_malloc (2 * (linksize + 1)); + n = VasEBoot_malloc (2 * (linksize + 1)); if (!n) - return grub_errno; - grub_free (data->linkname); + return VasEBoot_errno; + VasEBoot_free (data->linkname); data->linkname = n; data->linkname_alloc = 2 * (linksize + 1); } - err = grub_disk_read (data->disk, 0, - data->hofs + GRUB_DISK_SECTOR_SIZE, linksize, + err = VasEBoot_disk_read (data->disk, 0, + data->hofs + VasEBoot_DISK_SECTOR_SIZE, linksize, data->linkname); if (err) return err; data->linkname[linksize] = 0; - data->hofs += GRUB_DISK_SECTOR_SIZE - + ((linksize + GRUB_DISK_SECTOR_SIZE - 1) & - ~(GRUB_DISK_SECTOR_SIZE - 1)); + data->hofs += VasEBoot_DISK_SECTOR_SIZE + + ((linksize + VasEBoot_DISK_SECTOR_SIZE - 1) & + ~(VasEBoot_DISK_SECTOR_SIZE - 1)); have_longlink = 1; continue; } if (!have_longname) { - grub_size_t extra_size = 0; + VasEBoot_size_t extra_size = 0; while (extra_size < sizeof (hd.prefix) && hd.prefix[extra_size]) extra_size++; - *name = grub_malloc (sizeof (hd.name) + extra_size + 2); + *name = VasEBoot_malloc (sizeof (hd.name) + extra_size + 2); if (*name == NULL) - return grub_errno; + return VasEBoot_errno; if (hd.prefix[0]) { - grub_memcpy (*name, hd.prefix, extra_size); + VasEBoot_memcpy (*name, hd.prefix, extra_size); (*name)[extra_size++] = '/'; } - grub_memcpy (*name + extra_size, hd.name, sizeof (hd.name)); + VasEBoot_memcpy (*name + extra_size, hd.name, sizeof (hd.name)); (*name)[extra_size + sizeof (hd.name)] = 0; } data->size = read_number (hd.size, sizeof (hd.size)); - data->dofs = data->hofs + GRUB_DISK_SECTOR_SIZE; - data->next_hofs = data->dofs + ((data->size + GRUB_DISK_SECTOR_SIZE - 1) & - ~(GRUB_DISK_SECTOR_SIZE - 1)); + data->dofs = data->hofs + VasEBoot_DISK_SECTOR_SIZE; + data->next_hofs = data->dofs + ((data->size + VasEBoot_DISK_SECTOR_SIZE - 1) & + ~(VasEBoot_DISK_SECTOR_SIZE - 1)); if (mtime) *mtime = read_number (hd.mtime, sizeof (hd.mtime)); if (mode) @@ -175,13 +175,13 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name, case '1': /* Symlink. */ case '2': - *mode |= GRUB_ARCHELP_ATTR_LNK; + *mode |= VasEBoot_ARCHELP_ATTR_LNK; break; case '0': - *mode |= GRUB_ARCHELP_ATTR_FILE; + *mode |= VasEBoot_ARCHELP_ATTR_FILE; break; case '5': - *mode |= GRUB_ARCHELP_ATTR_DIR; + *mode |= VasEBoot_ARCHELP_ATTR_DIR; break; } } @@ -190,53 +190,53 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name, if (data->linkname_alloc < 101) { char *n; - n = grub_malloc (101); + n = VasEBoot_malloc (101); if (!n) - return grub_errno; - grub_free (data->linkname); + return VasEBoot_errno; + VasEBoot_free (data->linkname); data->linkname = n; data->linkname_alloc = 101; } - grub_memcpy (data->linkname, hd.linkname, sizeof (hd.linkname)); + VasEBoot_memcpy (data->linkname, hd.linkname, sizeof (hd.linkname)); data->linkname[100] = 0; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static char * -grub_cpio_get_link_target (struct grub_archelp_data *data) +VasEBoot_cpio_get_link_target (struct VasEBoot_archelp_data *data) { - return grub_strdup (data->linkname); + return VasEBoot_strdup (data->linkname); } static void -grub_cpio_rewind (struct grub_archelp_data *data) +VasEBoot_cpio_rewind (struct VasEBoot_archelp_data *data) { data->next_hofs = 0; } -static struct grub_archelp_ops arcops = +static struct VasEBoot_archelp_ops arcops = { - .find_file = grub_cpio_find_file, - .get_link_target = grub_cpio_get_link_target, - .rewind = grub_cpio_rewind + .find_file = VasEBoot_cpio_find_file, + .get_link_target = VasEBoot_cpio_get_link_target, + .rewind = VasEBoot_cpio_rewind }; -static struct grub_archelp_data * -grub_cpio_mount (grub_disk_t disk) +static struct VasEBoot_archelp_data * +VasEBoot_cpio_mount (VasEBoot_disk_t disk) { struct head hd; - struct grub_archelp_data *data; + struct VasEBoot_archelp_data *data; - if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd)) + if (VasEBoot_disk_read (disk, 0, 0, sizeof (hd), &hd)) goto fail; - if (grub_memcmp (hd.magic, MAGIC, sizeof (MAGIC) - 1)) + if (VasEBoot_memcmp (hd.magic, MAGIC, sizeof (MAGIC) - 1)) goto fail; - data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data)); + data = (struct VasEBoot_archelp_data *) VasEBoot_zalloc (sizeof (*data)); if (!data) goto fail; @@ -245,45 +245,45 @@ grub_cpio_mount (grub_disk_t disk) return data; fail: - grub_error (GRUB_ERR_BAD_FS, "not a tarfs filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a tarfs filesystem"); return 0; } -static grub_err_t -grub_cpio_dir (grub_device_t device, const char *path_in, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_cpio_dir (VasEBoot_device_t device, const char *path_in, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_archelp_data *data; - grub_err_t err; + struct VasEBoot_archelp_data *data; + VasEBoot_err_t err; - data = grub_cpio_mount (device->disk); + data = VasEBoot_cpio_mount (device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - err = grub_archelp_dir (data, &arcops, + err = VasEBoot_archelp_dir (data, &arcops, path_in, hook, hook_data); - grub_free (data->linkname); - grub_free (data); + VasEBoot_free (data->linkname); + VasEBoot_free (data); return err; } -static grub_err_t -grub_cpio_open (grub_file_t file, const char *name_in) +static VasEBoot_err_t +VasEBoot_cpio_open (VasEBoot_file_t file, const char *name_in) { - struct grub_archelp_data *data; - grub_err_t err; + struct VasEBoot_archelp_data *data; + VasEBoot_err_t err; - data = grub_cpio_mount (file->device->disk); + data = VasEBoot_cpio_mount (file->device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - err = grub_archelp_open (data, &arcops, name_in); + err = VasEBoot_archelp_open (data, &arcops, name_in); if (err) { - grub_free (data->linkname); - grub_free (data); + VasEBoot_free (data->linkname); + VasEBoot_free (data); } else { @@ -293,53 +293,53 @@ grub_cpio_open (grub_file_t file, const char *name_in) return err; } -static grub_ssize_t -grub_cpio_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_cpio_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_archelp_data *data; - grub_ssize_t ret; + struct VasEBoot_archelp_data *data; + VasEBoot_ssize_t ret; data = file->data; data->disk->read_hook = file->read_hook; data->disk->read_hook_data = file->read_hook_data; - ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset, - len, buf)) ? -1 : (grub_ssize_t) len; + ret = (VasEBoot_disk_read (data->disk, 0, data->dofs + file->offset, + len, buf)) ? -1 : (VasEBoot_ssize_t) len; data->disk->read_hook = 0; return ret; } -static grub_err_t -grub_cpio_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_cpio_close (VasEBoot_file_t file) { - struct grub_archelp_data *data; + struct VasEBoot_archelp_data *data; data = file->data; - grub_free (data->linkname); - grub_free (data); + VasEBoot_free (data->linkname); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_cpio_fs = { +static struct VasEBoot_fs VasEBoot_cpio_fs = { .name = "tarfs", - .dir = grub_cpio_dir, - .open = grub_cpio_open, - .read = grub_cpio_read, - .close = grub_cpio_close, -#ifdef GRUB_UTIL + .dir = VasEBoot_cpio_dir, + .open = VasEBoot_cpio_open, + .read = VasEBoot_cpio_read, + .close = VasEBoot_cpio_close, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 0, #endif }; -GRUB_MOD_INIT (tar) +VasEBoot_MOD_INIT (tar) { - grub_fs_register (&grub_cpio_fs); + VasEBoot_fs_register (&VasEBoot_cpio_fs); } -GRUB_MOD_FINI (tar) +VasEBoot_MOD_FINI (tar) { - grub_fs_unregister (&grub_cpio_fs); + VasEBoot_fs_unregister (&VasEBoot_cpio_fs); } diff --git a/VasEBoot-core/fs/udf.c b/VasEBoot-core/fs/udf.c index 839bff889..82b93ffa3 100644 --- a/VasEBoot-core/fs/udf.c +++ b/VasEBoot-core/fs/udf.c @@ -1,392 +1,392 @@ /* udf.c - Universal Disk Format filesystem. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_UDF_MAX_PDS 2 -#define GRUB_UDF_MAX_PMS 6 +#define VasEBoot_UDF_MAX_PDS 2 +#define VasEBoot_UDF_MAX_PMS 6 -#define U16 grub_le_to_cpu16 -#define U32 grub_le_to_cpu32 -#define U64 grub_le_to_cpu64 +#define U16 VasEBoot_le_to_cpu16 +#define U32 VasEBoot_le_to_cpu32 +#define U64 VasEBoot_le_to_cpu64 -#define GRUB_UDF_TAG_IDENT_PVD 0x0001 -#define GRUB_UDF_TAG_IDENT_AVDP 0x0002 -#define GRUB_UDF_TAG_IDENT_VDP 0x0003 -#define GRUB_UDF_TAG_IDENT_IUVD 0x0004 -#define GRUB_UDF_TAG_IDENT_PD 0x0005 -#define GRUB_UDF_TAG_IDENT_LVD 0x0006 -#define GRUB_UDF_TAG_IDENT_USD 0x0007 -#define GRUB_UDF_TAG_IDENT_TD 0x0008 -#define GRUB_UDF_TAG_IDENT_LVID 0x0009 +#define VasEBoot_UDF_TAG_IDENT_PVD 0x0001 +#define VasEBoot_UDF_TAG_IDENT_AVDP 0x0002 +#define VasEBoot_UDF_TAG_IDENT_VDP 0x0003 +#define VasEBoot_UDF_TAG_IDENT_IUVD 0x0004 +#define VasEBoot_UDF_TAG_IDENT_PD 0x0005 +#define VasEBoot_UDF_TAG_IDENT_LVD 0x0006 +#define VasEBoot_UDF_TAG_IDENT_USD 0x0007 +#define VasEBoot_UDF_TAG_IDENT_TD 0x0008 +#define VasEBoot_UDF_TAG_IDENT_LVID 0x0009 -#define GRUB_UDF_TAG_IDENT_FSD 0x0100 -#define GRUB_UDF_TAG_IDENT_FID 0x0101 -#define GRUB_UDF_TAG_IDENT_AED 0x0102 -#define GRUB_UDF_TAG_IDENT_IE 0x0103 -#define GRUB_UDF_TAG_IDENT_TE 0x0104 -#define GRUB_UDF_TAG_IDENT_FE 0x0105 -#define GRUB_UDF_TAG_IDENT_EAHD 0x0106 -#define GRUB_UDF_TAG_IDENT_USE 0x0107 -#define GRUB_UDF_TAG_IDENT_SBD 0x0108 -#define GRUB_UDF_TAG_IDENT_PIE 0x0109 -#define GRUB_UDF_TAG_IDENT_EFE 0x010A +#define VasEBoot_UDF_TAG_IDENT_FSD 0x0100 +#define VasEBoot_UDF_TAG_IDENT_FID 0x0101 +#define VasEBoot_UDF_TAG_IDENT_AED 0x0102 +#define VasEBoot_UDF_TAG_IDENT_IE 0x0103 +#define VasEBoot_UDF_TAG_IDENT_TE 0x0104 +#define VasEBoot_UDF_TAG_IDENT_FE 0x0105 +#define VasEBoot_UDF_TAG_IDENT_EAHD 0x0106 +#define VasEBoot_UDF_TAG_IDENT_USE 0x0107 +#define VasEBoot_UDF_TAG_IDENT_SBD 0x0108 +#define VasEBoot_UDF_TAG_IDENT_PIE 0x0109 +#define VasEBoot_UDF_TAG_IDENT_EFE 0x010A -#define GRUB_UDF_ICBTAG_TYPE_UNDEF 0x00 -#define GRUB_UDF_ICBTAG_TYPE_USE 0x01 -#define GRUB_UDF_ICBTAG_TYPE_PIE 0x02 -#define GRUB_UDF_ICBTAG_TYPE_IE 0x03 -#define GRUB_UDF_ICBTAG_TYPE_DIRECTORY 0x04 -#define GRUB_UDF_ICBTAG_TYPE_REGULAR 0x05 -#define GRUB_UDF_ICBTAG_TYPE_BLOCK 0x06 -#define GRUB_UDF_ICBTAG_TYPE_CHAR 0x07 -#define GRUB_UDF_ICBTAG_TYPE_EA 0x08 -#define GRUB_UDF_ICBTAG_TYPE_FIFO 0x09 -#define GRUB_UDF_ICBTAG_TYPE_SOCKET 0x0A -#define GRUB_UDF_ICBTAG_TYPE_TE 0x0B -#define GRUB_UDF_ICBTAG_TYPE_SYMLINK 0x0C -#define GRUB_UDF_ICBTAG_TYPE_STREAMDIR 0x0D +#define VasEBoot_UDF_ICBTAG_TYPE_UNDEF 0x00 +#define VasEBoot_UDF_ICBTAG_TYPE_USE 0x01 +#define VasEBoot_UDF_ICBTAG_TYPE_PIE 0x02 +#define VasEBoot_UDF_ICBTAG_TYPE_IE 0x03 +#define VasEBoot_UDF_ICBTAG_TYPE_DIRECTORY 0x04 +#define VasEBoot_UDF_ICBTAG_TYPE_REGULAR 0x05 +#define VasEBoot_UDF_ICBTAG_TYPE_BLOCK 0x06 +#define VasEBoot_UDF_ICBTAG_TYPE_CHAR 0x07 +#define VasEBoot_UDF_ICBTAG_TYPE_EA 0x08 +#define VasEBoot_UDF_ICBTAG_TYPE_FIFO 0x09 +#define VasEBoot_UDF_ICBTAG_TYPE_SOCKET 0x0A +#define VasEBoot_UDF_ICBTAG_TYPE_TE 0x0B +#define VasEBoot_UDF_ICBTAG_TYPE_SYMLINK 0x0C +#define VasEBoot_UDF_ICBTAG_TYPE_STREAMDIR 0x0D -#define GRUB_UDF_ICBTAG_FLAG_AD_MASK 0x0007 -#define GRUB_UDF_ICBTAG_FLAG_AD_SHORT 0x0000 -#define GRUB_UDF_ICBTAG_FLAG_AD_LONG 0x0001 -#define GRUB_UDF_ICBTAG_FLAG_AD_EXT 0x0002 -#define GRUB_UDF_ICBTAG_FLAG_AD_IN_ICB 0x0003 +#define VasEBoot_UDF_ICBTAG_FLAG_AD_MASK 0x0007 +#define VasEBoot_UDF_ICBTAG_FLAG_AD_SHORT 0x0000 +#define VasEBoot_UDF_ICBTAG_FLAG_AD_LONG 0x0001 +#define VasEBoot_UDF_ICBTAG_FLAG_AD_EXT 0x0002 +#define VasEBoot_UDF_ICBTAG_FLAG_AD_IN_ICB 0x0003 -#define GRUB_UDF_EXT_NORMAL 0x00000000 -#define GRUB_UDF_EXT_NREC_ALLOC 0x40000000 -#define GRUB_UDF_EXT_NREC_NALLOC 0x80000000 -#define GRUB_UDF_EXT_MASK 0xC0000000 +#define VasEBoot_UDF_EXT_NORMAL 0x00000000 +#define VasEBoot_UDF_EXT_NREC_ALLOC 0x40000000 +#define VasEBoot_UDF_EXT_NREC_NALLOC 0x80000000 +#define VasEBoot_UDF_EXT_MASK 0xC0000000 -#define GRUB_UDF_FID_CHAR_HIDDEN 0x01 -#define GRUB_UDF_FID_CHAR_DIRECTORY 0x02 -#define GRUB_UDF_FID_CHAR_DELETED 0x04 -#define GRUB_UDF_FID_CHAR_PARENT 0x08 -#define GRUB_UDF_FID_CHAR_METADATA 0x10 +#define VasEBoot_UDF_FID_CHAR_HIDDEN 0x01 +#define VasEBoot_UDF_FID_CHAR_DIRECTORY 0x02 +#define VasEBoot_UDF_FID_CHAR_DELETED 0x04 +#define VasEBoot_UDF_FID_CHAR_PARENT 0x08 +#define VasEBoot_UDF_FID_CHAR_METADATA 0x10 -#define GRUB_UDF_STD_IDENT_BEA01 "BEA01" -#define GRUB_UDF_STD_IDENT_BOOT2 "BOOT2" -#define GRUB_UDF_STD_IDENT_CD001 "CD001" -#define GRUB_UDF_STD_IDENT_CDW02 "CDW02" -#define GRUB_UDF_STD_IDENT_NSR02 "NSR02" -#define GRUB_UDF_STD_IDENT_NSR03 "NSR03" -#define GRUB_UDF_STD_IDENT_TEA01 "TEA01" +#define VasEBoot_UDF_STD_IDENT_BEA01 "BEA01" +#define VasEBoot_UDF_STD_IDENT_BOOT2 "BOOT2" +#define VasEBoot_UDF_STD_IDENT_CD001 "CD001" +#define VasEBoot_UDF_STD_IDENT_CDW02 "CDW02" +#define VasEBoot_UDF_STD_IDENT_NSR02 "NSR02" +#define VasEBoot_UDF_STD_IDENT_NSR03 "NSR03" +#define VasEBoot_UDF_STD_IDENT_TEA01 "TEA01" -#define GRUB_UDF_CHARSPEC_TYPE_CS0 0x00 -#define GRUB_UDF_CHARSPEC_TYPE_CS1 0x01 -#define GRUB_UDF_CHARSPEC_TYPE_CS2 0x02 -#define GRUB_UDF_CHARSPEC_TYPE_CS3 0x03 -#define GRUB_UDF_CHARSPEC_TYPE_CS4 0x04 -#define GRUB_UDF_CHARSPEC_TYPE_CS5 0x05 -#define GRUB_UDF_CHARSPEC_TYPE_CS6 0x06 -#define GRUB_UDF_CHARSPEC_TYPE_CS7 0x07 -#define GRUB_UDF_CHARSPEC_TYPE_CS8 0x08 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS0 0x00 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS1 0x01 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS2 0x02 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS3 0x03 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS4 0x04 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS5 0x05 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS6 0x06 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS7 0x07 +#define VasEBoot_UDF_CHARSPEC_TYPE_CS8 0x08 -#define GRUB_UDF_PARTMAP_TYPE_1 1 -#define GRUB_UDF_PARTMAP_TYPE_2 2 +#define VasEBoot_UDF_PARTMAP_TYPE_1 1 +#define VasEBoot_UDF_PARTMAP_TYPE_2 2 -struct grub_udf_lb_addr +struct VasEBoot_udf_lb_addr { - grub_uint32_t block_num; - grub_uint16_t part_ref; -} GRUB_PACKED; + VasEBoot_uint32_t block_num; + VasEBoot_uint16_t part_ref; +} VasEBoot_PACKED; -struct grub_udf_short_ad +struct VasEBoot_udf_short_ad { - grub_uint32_t length; - grub_uint32_t position; -} GRUB_PACKED; + VasEBoot_uint32_t length; + VasEBoot_uint32_t position; +} VasEBoot_PACKED; -struct grub_udf_long_ad +struct VasEBoot_udf_long_ad { - grub_uint32_t length; - struct grub_udf_lb_addr block; - grub_uint8_t imp_use[6]; -} GRUB_PACKED; + VasEBoot_uint32_t length; + struct VasEBoot_udf_lb_addr block; + VasEBoot_uint8_t imp_use[6]; +} VasEBoot_PACKED; -struct grub_udf_extent_ad +struct VasEBoot_udf_extent_ad { - grub_uint32_t length; - grub_uint32_t start; -} GRUB_PACKED; + VasEBoot_uint32_t length; + VasEBoot_uint32_t start; +} VasEBoot_PACKED; -struct grub_udf_charspec +struct VasEBoot_udf_charspec { - grub_uint8_t charset_type; - grub_uint8_t charset_info[63]; -} GRUB_PACKED; + VasEBoot_uint8_t charset_type; + VasEBoot_uint8_t charset_info[63]; +} VasEBoot_PACKED; -struct grub_udf_timestamp +struct VasEBoot_udf_timestamp { - grub_uint16_t type_and_timezone; - grub_uint16_t year; - grub_uint8_t month; - grub_uint8_t day; - grub_uint8_t hour; - grub_uint8_t minute; - grub_uint8_t second; - grub_uint8_t centi_seconds; - grub_uint8_t hundreds_of_micro_seconds; - grub_uint8_t micro_seconds; -} GRUB_PACKED; + VasEBoot_uint16_t type_and_timezone; + VasEBoot_uint16_t year; + VasEBoot_uint8_t month; + VasEBoot_uint8_t day; + VasEBoot_uint8_t hour; + VasEBoot_uint8_t minute; + VasEBoot_uint8_t second; + VasEBoot_uint8_t centi_seconds; + VasEBoot_uint8_t hundreds_of_micro_seconds; + VasEBoot_uint8_t micro_seconds; +} VasEBoot_PACKED; -struct grub_udf_regid +struct VasEBoot_udf_regid { - grub_uint8_t flags; - grub_uint8_t ident[23]; - grub_uint8_t ident_suffix[8]; -} GRUB_PACKED; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t ident[23]; + VasEBoot_uint8_t ident_suffix[8]; +} VasEBoot_PACKED; -struct grub_udf_tag +struct VasEBoot_udf_tag { - grub_uint16_t tag_ident; - grub_uint16_t desc_version; - grub_uint8_t tag_checksum; - grub_uint8_t reserved; - grub_uint16_t tag_serial_number; - grub_uint16_t desc_crc; - grub_uint16_t desc_crc_length; - grub_uint32_t tag_location; -} GRUB_PACKED; + VasEBoot_uint16_t tag_ident; + VasEBoot_uint16_t desc_version; + VasEBoot_uint8_t tag_checksum; + VasEBoot_uint8_t reserved; + VasEBoot_uint16_t tag_serial_number; + VasEBoot_uint16_t desc_crc; + VasEBoot_uint16_t desc_crc_length; + VasEBoot_uint32_t tag_location; +} VasEBoot_PACKED; -struct grub_udf_fileset +struct VasEBoot_udf_fileset { - struct grub_udf_tag tag; - struct grub_udf_timestamp datetime; - grub_uint16_t interchange_level; - grub_uint16_t max_interchange_level; - grub_uint32_t charset_list; - grub_uint32_t max_charset_list; - grub_uint32_t fileset_num; - grub_uint32_t fileset_desc_num; - struct grub_udf_charspec vol_charset; - grub_uint8_t vol_ident[128]; - struct grub_udf_charspec fileset_charset; - grub_uint8_t fileset_ident[32]; - grub_uint8_t copyright_file_ident[32]; - grub_uint8_t abstract_file_ident[32]; - struct grub_udf_long_ad root_icb; - struct grub_udf_regid domain_ident; - struct grub_udf_long_ad next_ext; - struct grub_udf_long_ad streamdir_icb; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + struct VasEBoot_udf_timestamp datetime; + VasEBoot_uint16_t interchange_level; + VasEBoot_uint16_t max_interchange_level; + VasEBoot_uint32_t charset_list; + VasEBoot_uint32_t max_charset_list; + VasEBoot_uint32_t fileset_num; + VasEBoot_uint32_t fileset_desc_num; + struct VasEBoot_udf_charspec vol_charset; + VasEBoot_uint8_t vol_ident[128]; + struct VasEBoot_udf_charspec fileset_charset; + VasEBoot_uint8_t fileset_ident[32]; + VasEBoot_uint8_t copyright_file_ident[32]; + VasEBoot_uint8_t abstract_file_ident[32]; + struct VasEBoot_udf_long_ad root_icb; + struct VasEBoot_udf_regid domain_ident; + struct VasEBoot_udf_long_ad next_ext; + struct VasEBoot_udf_long_ad streamdir_icb; +} VasEBoot_PACKED; -struct grub_udf_icbtag +struct VasEBoot_udf_icbtag { - grub_uint32_t prior_recorded_num_direct_entries; - grub_uint16_t strategy_type; - grub_uint16_t strategy_parameter; - grub_uint16_t num_entries; - grub_uint8_t reserved; - grub_uint8_t file_type; - struct grub_udf_lb_addr parent_idb; - grub_uint16_t flags; -} GRUB_PACKED; + VasEBoot_uint32_t prior_recorded_num_direct_entries; + VasEBoot_uint16_t strategy_type; + VasEBoot_uint16_t strategy_parameter; + VasEBoot_uint16_t num_entries; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t file_type; + struct VasEBoot_udf_lb_addr parent_idb; + VasEBoot_uint16_t flags; +} VasEBoot_PACKED; -struct grub_udf_file_ident +struct VasEBoot_udf_file_ident { - struct grub_udf_tag tag; - grub_uint16_t version_num; - grub_uint8_t characteristics; + struct VasEBoot_udf_tag tag; + VasEBoot_uint16_t version_num; + VasEBoot_uint8_t characteristics; #define MAX_FILE_IDENT_LENGTH 256 - grub_uint8_t file_ident_length; - struct grub_udf_long_ad icb; - grub_uint16_t imp_use_length; -} GRUB_PACKED; + VasEBoot_uint8_t file_ident_length; + struct VasEBoot_udf_long_ad icb; + VasEBoot_uint16_t imp_use_length; +} VasEBoot_PACKED; -struct grub_udf_file_entry +struct VasEBoot_udf_file_entry { - struct grub_udf_tag tag; - struct grub_udf_icbtag icbtag; - grub_uint32_t uid; - grub_uint32_t gid; - grub_uint32_t permissions; - grub_uint16_t link_count; - grub_uint8_t record_format; - grub_uint8_t record_display_attr; - grub_uint32_t record_length; - grub_uint64_t file_size; - grub_uint64_t blocks_recorded; - struct grub_udf_timestamp access_time; - struct grub_udf_timestamp modification_time; - struct grub_udf_timestamp attr_time; - grub_uint32_t checkpoint; - struct grub_udf_long_ad extended_attr_idb; - struct grub_udf_regid imp_ident; - grub_uint64_t unique_id; - grub_uint32_t ext_attr_length; - grub_uint32_t alloc_descs_length; - grub_uint8_t ext_attr[0]; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + struct VasEBoot_udf_icbtag icbtag; + VasEBoot_uint32_t uid; + VasEBoot_uint32_t gid; + VasEBoot_uint32_t permissions; + VasEBoot_uint16_t link_count; + VasEBoot_uint8_t record_format; + VasEBoot_uint8_t record_display_attr; + VasEBoot_uint32_t record_length; + VasEBoot_uint64_t file_size; + VasEBoot_uint64_t blocks_recorded; + struct VasEBoot_udf_timestamp access_time; + struct VasEBoot_udf_timestamp modification_time; + struct VasEBoot_udf_timestamp attr_time; + VasEBoot_uint32_t checkpoint; + struct VasEBoot_udf_long_ad extended_attr_idb; + struct VasEBoot_udf_regid imp_ident; + VasEBoot_uint64_t unique_id; + VasEBoot_uint32_t ext_attr_length; + VasEBoot_uint32_t alloc_descs_length; + VasEBoot_uint8_t ext_attr[0]; +} VasEBoot_PACKED; -struct grub_udf_extended_file_entry +struct VasEBoot_udf_extended_file_entry { - struct grub_udf_tag tag; - struct grub_udf_icbtag icbtag; - grub_uint32_t uid; - grub_uint32_t gid; - grub_uint32_t permissions; - grub_uint16_t link_count; - grub_uint8_t record_format; - grub_uint8_t record_display_attr; - grub_uint32_t record_length; - grub_uint64_t file_size; - grub_uint64_t object_size; - grub_uint64_t blocks_recorded; - struct grub_udf_timestamp access_time; - struct grub_udf_timestamp modification_time; - struct grub_udf_timestamp create_time; - struct grub_udf_timestamp attr_time; - grub_uint32_t checkpoint; - grub_uint32_t reserved; - struct grub_udf_long_ad extended_attr_icb; - struct grub_udf_long_ad streamdir_icb; - struct grub_udf_regid imp_ident; - grub_uint64_t unique_id; - grub_uint32_t ext_attr_length; - grub_uint32_t alloc_descs_length; - grub_uint8_t ext_attr[0]; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + struct VasEBoot_udf_icbtag icbtag; + VasEBoot_uint32_t uid; + VasEBoot_uint32_t gid; + VasEBoot_uint32_t permissions; + VasEBoot_uint16_t link_count; + VasEBoot_uint8_t record_format; + VasEBoot_uint8_t record_display_attr; + VasEBoot_uint32_t record_length; + VasEBoot_uint64_t file_size; + VasEBoot_uint64_t object_size; + VasEBoot_uint64_t blocks_recorded; + struct VasEBoot_udf_timestamp access_time; + struct VasEBoot_udf_timestamp modification_time; + struct VasEBoot_udf_timestamp create_time; + struct VasEBoot_udf_timestamp attr_time; + VasEBoot_uint32_t checkpoint; + VasEBoot_uint32_t reserved; + struct VasEBoot_udf_long_ad extended_attr_icb; + struct VasEBoot_udf_long_ad streamdir_icb; + struct VasEBoot_udf_regid imp_ident; + VasEBoot_uint64_t unique_id; + VasEBoot_uint32_t ext_attr_length; + VasEBoot_uint32_t alloc_descs_length; + VasEBoot_uint8_t ext_attr[0]; +} VasEBoot_PACKED; -struct grub_udf_vrs +struct VasEBoot_udf_vrs { - grub_uint8_t type; - grub_uint8_t magic[5]; - grub_uint8_t version; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t magic[5]; + VasEBoot_uint8_t version; +} VasEBoot_PACKED; -struct grub_udf_avdp +struct VasEBoot_udf_avdp { - struct grub_udf_tag tag; - struct grub_udf_extent_ad vds; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + struct VasEBoot_udf_extent_ad vds; +} VasEBoot_PACKED; -struct grub_udf_pd +struct VasEBoot_udf_pd { - struct grub_udf_tag tag; - grub_uint32_t seq_num; - grub_uint16_t flags; - grub_uint16_t part_num; - struct grub_udf_regid contents; - grub_uint8_t contents_use[128]; - grub_uint32_t access_type; - grub_uint32_t start; - grub_uint32_t length; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + VasEBoot_uint32_t seq_num; + VasEBoot_uint16_t flags; + VasEBoot_uint16_t part_num; + struct VasEBoot_udf_regid contents; + VasEBoot_uint8_t contents_use[128]; + VasEBoot_uint32_t access_type; + VasEBoot_uint32_t start; + VasEBoot_uint32_t length; +} VasEBoot_PACKED; -struct grub_udf_partmap +struct VasEBoot_udf_partmap { - grub_uint8_t type; - grub_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint8_t length; union { struct { - grub_uint16_t seq_num; - grub_uint16_t part_num; + VasEBoot_uint16_t seq_num; + VasEBoot_uint16_t part_num; } type1; struct { - grub_uint8_t ident[62]; + VasEBoot_uint8_t ident[62]; } type2; }; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_udf_lvd +struct VasEBoot_udf_lvd { - struct grub_udf_tag tag; - grub_uint32_t seq_num; - struct grub_udf_charspec charset; - grub_uint8_t ident[128]; - grub_uint32_t bsize; - struct grub_udf_regid domain_ident; - struct grub_udf_long_ad root_fileset; - grub_uint32_t map_table_length; - grub_uint32_t num_part_maps; - struct grub_udf_regid imp_ident; - grub_uint8_t imp_use[128]; - struct grub_udf_extent_ad integrity_seq_ext; - grub_uint8_t part_maps[1608]; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + VasEBoot_uint32_t seq_num; + struct VasEBoot_udf_charspec charset; + VasEBoot_uint8_t ident[128]; + VasEBoot_uint32_t bsize; + struct VasEBoot_udf_regid domain_ident; + struct VasEBoot_udf_long_ad root_fileset; + VasEBoot_uint32_t map_table_length; + VasEBoot_uint32_t num_part_maps; + struct VasEBoot_udf_regid imp_ident; + VasEBoot_uint8_t imp_use[128]; + struct VasEBoot_udf_extent_ad integrity_seq_ext; + VasEBoot_uint8_t part_maps[1608]; +} VasEBoot_PACKED; -struct grub_udf_aed +struct VasEBoot_udf_aed { - struct grub_udf_tag tag; - grub_uint32_t prev_ae; - grub_uint32_t ae_len; -} GRUB_PACKED; + struct VasEBoot_udf_tag tag; + VasEBoot_uint32_t prev_ae; + VasEBoot_uint32_t ae_len; +} VasEBoot_PACKED; -struct grub_udf_data +struct VasEBoot_udf_data { - grub_disk_t disk; - struct grub_udf_lvd lvd; - struct grub_udf_pd pds[GRUB_UDF_MAX_PDS]; - struct grub_udf_partmap *pms[GRUB_UDF_MAX_PMS]; - struct grub_udf_long_ad root_icb; + VasEBoot_disk_t disk; + struct VasEBoot_udf_lvd lvd; + struct VasEBoot_udf_pd pds[VasEBoot_UDF_MAX_PDS]; + struct VasEBoot_udf_partmap *pms[VasEBoot_UDF_MAX_PMS]; + struct VasEBoot_udf_long_ad root_icb; int npd, npm, lbshift; }; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_udf_data *data; + struct VasEBoot_udf_data *data; int part_ref; union { - struct grub_udf_file_entry fe; - struct grub_udf_extended_file_entry efe; + struct VasEBoot_udf_file_entry fe; + struct VasEBoot_udf_extended_file_entry efe; char raw[0]; } block; }; -static inline grub_size_t -get_fshelp_size (struct grub_udf_data *data) +static inline VasEBoot_size_t +get_fshelp_size (struct VasEBoot_udf_data *data) { - struct grub_fshelp_node *x = NULL; + struct VasEBoot_fshelp_node *x = NULL; return sizeof (*x) - + (1 << (GRUB_DISK_SECTOR_BITS + + (1 << (VasEBoot_DISK_SECTOR_BITS + data->lbshift)) - sizeof (x->block); } -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_uint32_t -grub_udf_get_block (struct grub_udf_data *data, - grub_uint16_t part_ref, grub_uint32_t block) +static VasEBoot_uint32_t +VasEBoot_udf_get_block (struct VasEBoot_udf_data *data, + VasEBoot_uint16_t part_ref, VasEBoot_uint32_t block) { part_ref = U16 (part_ref); if (part_ref >= data->npm) { - grub_error (GRUB_ERR_BAD_FS, "invalid part ref"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid part ref"); return 0; } @@ -394,222 +394,222 @@ grub_udf_get_block (struct grub_udf_data *data, + U32 (block)); } -static grub_err_t -grub_udf_read_icb (struct grub_udf_data *data, - struct grub_udf_long_ad *icb, - struct grub_fshelp_node *node) +static VasEBoot_err_t +VasEBoot_udf_read_icb (struct VasEBoot_udf_data *data, + struct VasEBoot_udf_long_ad *icb, + struct VasEBoot_fshelp_node *node) { - grub_uint32_t block; + VasEBoot_uint32_t block; - block = grub_udf_get_block (data, + block = VasEBoot_udf_get_block (data, icb->block.part_ref, icb->block.block_num); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; - if (grub_disk_read (data->disk, block << data->lbshift, 0, - 1 << (GRUB_DISK_SECTOR_BITS + if (VasEBoot_disk_read (data->disk, block << data->lbshift, 0, + 1 << (VasEBoot_DISK_SECTOR_BITS + data->lbshift), &node->block)) - return grub_errno; + return VasEBoot_errno; - if ((U16 (node->block.fe.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FE) && - (U16 (node->block.fe.tag.tag_ident) != GRUB_UDF_TAG_IDENT_EFE)) - return grub_error (GRUB_ERR_BAD_FS, "invalid fe/efe descriptor"); + if ((U16 (node->block.fe.tag.tag_ident) != VasEBoot_UDF_TAG_IDENT_FE) && + (U16 (node->block.fe.tag.tag_ident) != VasEBoot_UDF_TAG_IDENT_EFE)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid fe/efe descriptor"); node->part_ref = icb->block.part_ref; node->data = data; return 0; } -static grub_disk_addr_t -grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_udf_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { char *buf = NULL; char *ptr; - grub_ssize_t len; - grub_disk_addr_t filebytes; + VasEBoot_ssize_t len; + VasEBoot_disk_addr_t filebytes; switch (U16 (node->block.fe.tag.tag_ident)) { - case GRUB_UDF_TAG_IDENT_FE: + case VasEBoot_UDF_TAG_IDENT_FE: ptr = (char *) &node->block.fe.ext_attr[0] + U32 (node->block.fe.ext_attr_length); len = U32 (node->block.fe.alloc_descs_length); break; - case GRUB_UDF_TAG_IDENT_EFE: + case VasEBoot_UDF_TAG_IDENT_EFE: ptr = (char *) &node->block.efe.ext_attr[0] + U32 (node->block.efe.ext_attr_length); len = U32 (node->block.efe.alloc_descs_length); break; default: - grub_error (GRUB_ERR_BAD_FS, "invalid file entry"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid file entry"); return 0; } - if ((U16 (node->block.fe.icbtag.flags) & GRUB_UDF_ICBTAG_FLAG_AD_MASK) - == GRUB_UDF_ICBTAG_FLAG_AD_SHORT) + if ((U16 (node->block.fe.icbtag.flags) & VasEBoot_UDF_ICBTAG_FLAG_AD_MASK) + == VasEBoot_UDF_ICBTAG_FLAG_AD_SHORT) { - struct grub_udf_short_ad *ad = (struct grub_udf_short_ad *) ptr; + struct VasEBoot_udf_short_ad *ad = (struct VasEBoot_udf_short_ad *) ptr; filebytes = fileblock * U32 (node->data->lvd.bsize); - while (len >= (grub_ssize_t) sizeof (struct grub_udf_short_ad)) + while (len >= (VasEBoot_ssize_t) sizeof (struct VasEBoot_udf_short_ad)) { - grub_uint32_t adlen = U32 (ad->length) & 0x3fffffff; - grub_uint32_t adtype = U32 (ad->length) >> 30; + VasEBoot_uint32_t adlen = U32 (ad->length) & 0x3fffffff; + VasEBoot_uint32_t adtype = U32 (ad->length) >> 30; if (adtype == 3) { - struct grub_udf_aed *extension; - grub_disk_addr_t sec = grub_udf_get_block(node->data, + struct VasEBoot_udf_aed *extension; + VasEBoot_disk_addr_t sec = VasEBoot_udf_get_block(node->data, node->part_ref, ad->position); if (!buf) { - buf = grub_malloc (U32 (node->data->lvd.bsize)); + buf = VasEBoot_malloc (U32 (node->data->lvd.bsize)); if (!buf) return 0; } - if (grub_disk_read (node->data->disk, sec << node->data->lbshift, + if (VasEBoot_disk_read (node->data->disk, sec << node->data->lbshift, 0, adlen, buf)) goto fail; - extension = (struct grub_udf_aed *) buf; - if (U16 (extension->tag.tag_ident) != GRUB_UDF_TAG_IDENT_AED) + extension = (struct VasEBoot_udf_aed *) buf; + if (U16 (extension->tag.tag_ident) != VasEBoot_UDF_TAG_IDENT_AED) { - grub_error (GRUB_ERR_BAD_FS, "invalid aed tag"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid aed tag"); goto fail; } len = U32 (extension->ae_len); - ad = (struct grub_udf_short_ad *) - (buf + sizeof (struct grub_udf_aed)); + ad = (struct VasEBoot_udf_short_ad *) + (buf + sizeof (struct VasEBoot_udf_aed)); continue; } if (filebytes < adlen) { - grub_uint32_t ad_pos = ad->position; - grub_free (buf); - return ((U32 (ad_pos) & GRUB_UDF_EXT_MASK) ? 0 : - (grub_udf_get_block (node->data, node->part_ref, ad_pos) - + (filebytes >> (GRUB_DISK_SECTOR_BITS + VasEBoot_uint32_t ad_pos = ad->position; + VasEBoot_free (buf); + return ((U32 (ad_pos) & VasEBoot_UDF_EXT_MASK) ? 0 : + (VasEBoot_udf_get_block (node->data, node->part_ref, ad_pos) + + (filebytes >> (VasEBoot_DISK_SECTOR_BITS + node->data->lbshift)))); } filebytes -= adlen; ad++; - len -= sizeof (struct grub_udf_short_ad); + len -= sizeof (struct VasEBoot_udf_short_ad); } } else { - struct grub_udf_long_ad *ad = (struct grub_udf_long_ad *) ptr; + struct VasEBoot_udf_long_ad *ad = (struct VasEBoot_udf_long_ad *) ptr; filebytes = fileblock * U32 (node->data->lvd.bsize); - while (len >= (grub_ssize_t) sizeof (struct grub_udf_long_ad)) + while (len >= (VasEBoot_ssize_t) sizeof (struct VasEBoot_udf_long_ad)) { - grub_uint32_t adlen = U32 (ad->length) & 0x3fffffff; - grub_uint32_t adtype = U32 (ad->length) >> 30; + VasEBoot_uint32_t adlen = U32 (ad->length) & 0x3fffffff; + VasEBoot_uint32_t adtype = U32 (ad->length) >> 30; if (adtype == 3) { - struct grub_udf_aed *extension; - grub_disk_addr_t sec = grub_udf_get_block(node->data, + struct VasEBoot_udf_aed *extension; + VasEBoot_disk_addr_t sec = VasEBoot_udf_get_block(node->data, ad->block.part_ref, ad->block.block_num); if (!buf) { - buf = grub_malloc (U32 (node->data->lvd.bsize)); + buf = VasEBoot_malloc (U32 (node->data->lvd.bsize)); if (!buf) return 0; } - if (grub_disk_read (node->data->disk, sec << node->data->lbshift, + if (VasEBoot_disk_read (node->data->disk, sec << node->data->lbshift, 0, adlen, buf)) goto fail; - extension = (struct grub_udf_aed *) buf; - if (U16 (extension->tag.tag_ident) != GRUB_UDF_TAG_IDENT_AED) + extension = (struct VasEBoot_udf_aed *) buf; + if (U16 (extension->tag.tag_ident) != VasEBoot_UDF_TAG_IDENT_AED) { - grub_error (GRUB_ERR_BAD_FS, "invalid aed tag"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid aed tag"); goto fail; } len = U32 (extension->ae_len); - ad = (struct grub_udf_long_ad *) - (buf + sizeof (struct grub_udf_aed)); + ad = (struct VasEBoot_udf_long_ad *) + (buf + sizeof (struct VasEBoot_udf_aed)); continue; } if (filebytes < adlen) { - grub_uint32_t ad_block_num = ad->block.block_num; - grub_uint32_t ad_part_ref = ad->block.part_ref; - grub_free (buf); - return ((U32 (ad_block_num) & GRUB_UDF_EXT_MASK) ? 0 : - (grub_udf_get_block (node->data, ad_part_ref, + VasEBoot_uint32_t ad_block_num = ad->block.block_num; + VasEBoot_uint32_t ad_part_ref = ad->block.part_ref; + VasEBoot_free (buf); + return ((U32 (ad_block_num) & VasEBoot_UDF_EXT_MASK) ? 0 : + (VasEBoot_udf_get_block (node->data, ad_part_ref, ad_block_num) - + (filebytes >> (GRUB_DISK_SECTOR_BITS + + (filebytes >> (VasEBoot_DISK_SECTOR_BITS + node->data->lbshift)))); } filebytes -= adlen; ad++; - len -= sizeof (struct grub_udf_long_ad); + len -= sizeof (struct VasEBoot_udf_long_ad); } } fail: - grub_free (buf); + VasEBoot_free (buf); return 0; } -static grub_ssize_t -grub_udf_read_file (grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_udf_read_file (VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - switch (U16 (node->block.fe.icbtag.flags) & GRUB_UDF_ICBTAG_FLAG_AD_MASK) + switch (U16 (node->block.fe.icbtag.flags) & VasEBoot_UDF_ICBTAG_FLAG_AD_MASK) { - case GRUB_UDF_ICBTAG_FLAG_AD_IN_ICB: + case VasEBoot_UDF_ICBTAG_FLAG_AD_IN_ICB: { char *ptr; - ptr = ((U16 (node->block.fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_FE) ? + ptr = ((U16 (node->block.fe.tag.tag_ident) == VasEBoot_UDF_TAG_IDENT_FE) ? ((char *) &node->block.fe.ext_attr[0] + U32 (node->block.fe.ext_attr_length)) : ((char *) &node->block.efe.ext_attr[0] + U32 (node->block.efe.ext_attr_length))); - grub_memcpy (buf, ptr + pos, len); + VasEBoot_memcpy (buf, ptr + pos, len); return len; } - case GRUB_UDF_ICBTAG_FLAG_AD_EXT: - grub_error (GRUB_ERR_BAD_FS, "invalid extent type"); + case VasEBoot_UDF_ICBTAG_FLAG_AD_EXT: + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid extent type"); return 0; } - return grub_fshelp_read_file (node->data->disk, node, + return VasEBoot_fshelp_read_file (node->data->disk, node, read_hook, read_hook_data, - pos, len, buf, grub_udf_read_block, + pos, len, buf, VasEBoot_udf_read_block, U64 (node->block.fe.file_size), node->data->lbshift, 0); } static unsigned sblocklist[] = { 256, 512, 0 }; -static struct grub_udf_data * -grub_udf_mount (grub_disk_t disk) +static struct VasEBoot_udf_data * +VasEBoot_udf_mount (VasEBoot_disk_t disk) { - struct grub_udf_data *data = 0; - struct grub_udf_fileset root_fs; + struct VasEBoot_udf_data *data = 0; + struct VasEBoot_udf_fileset root_fs; unsigned *sblklist; - grub_uint32_t block, vblock; + VasEBoot_uint32_t block, vblock; int i, lbshift; - data = grub_malloc (sizeof (struct grub_udf_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_udf_data)); if (!data) return 0; @@ -622,16 +622,16 @@ grub_udf_mount (grub_disk_t disk) { for (sblklist = sblocklist; *sblklist; sblklist++) { - struct grub_udf_avdp avdp; + struct VasEBoot_udf_avdp avdp; - if (grub_disk_read (disk, *sblklist << lbshift, 0, - sizeof (struct grub_udf_avdp), &avdp)) + if (VasEBoot_disk_read (disk, *sblklist << lbshift, 0, + sizeof (struct VasEBoot_udf_avdp), &avdp)) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } - if (U16 (avdp.tag.tag_ident) == GRUB_UDF_TAG_IDENT_AVDP && + if (U16 (avdp.tag.tag_ident) == VasEBoot_UDF_TAG_IDENT_AVDP && U32 (avdp.tag.tag_location) == *sblklist) { block = U32 (avdp.vds.start); @@ -645,35 +645,35 @@ grub_udf_mount (grub_disk_t disk) if (!block) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } data->lbshift = lbshift; /* Search for Volume Recognition Sequence (VRS). */ - for (vblock = (32767 >> (lbshift + GRUB_DISK_SECTOR_BITS)) + 1;; - vblock += (2047 >> (lbshift + GRUB_DISK_SECTOR_BITS)) + 1) + for (vblock = (32767 >> (lbshift + VasEBoot_DISK_SECTOR_BITS)) + 1;; + vblock += (2047 >> (lbshift + VasEBoot_DISK_SECTOR_BITS)) + 1) { - struct grub_udf_vrs vrs; + struct VasEBoot_udf_vrs vrs; - if (grub_disk_read (disk, vblock << lbshift, 0, - sizeof (struct grub_udf_vrs), &vrs)) + if (VasEBoot_disk_read (disk, vblock << lbshift, 0, + sizeof (struct VasEBoot_udf_vrs), &vrs)) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } - if ((!grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_NSR03, 5)) || - (!grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_NSR02, 5))) + if ((!VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_NSR03, 5)) || + (!VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_NSR02, 5))) break; - if ((grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_BEA01, 5)) && - (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_BOOT2, 5)) && - (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_CD001, 5)) && - (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_CDW02, 5)) && - (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_TEA01, 5))) + if ((VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_BEA01, 5)) && + (VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_BOOT2, 5)) && + (VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_CD001, 5)) && + (VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_CDW02, 5)) && + (VasEBoot_memcmp (vrs.magic, VasEBoot_UDF_STD_IDENT_TEA01, 5))) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } } @@ -682,74 +682,74 @@ grub_udf_mount (grub_disk_t disk) /* Locate Partition Descriptor (PD) and Logical Volume Descriptor (LVD). */ while (1) { - struct grub_udf_tag tag; + struct VasEBoot_udf_tag tag; - if (grub_disk_read (disk, block << lbshift, 0, - sizeof (struct grub_udf_tag), &tag)) + if (VasEBoot_disk_read (disk, block << lbshift, 0, + sizeof (struct VasEBoot_udf_tag), &tag)) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } tag.tag_ident = U16 (tag.tag_ident); - if (tag.tag_ident == GRUB_UDF_TAG_IDENT_PD) + if (tag.tag_ident == VasEBoot_UDF_TAG_IDENT_PD) { - if (data->npd >= GRUB_UDF_MAX_PDS) + if (data->npd >= VasEBoot_UDF_MAX_PDS) { - grub_error (GRUB_ERR_BAD_FS, "too many PDs"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "too many PDs"); goto fail; } - if (grub_disk_read (disk, block << lbshift, 0, - sizeof (struct grub_udf_pd), + if (VasEBoot_disk_read (disk, block << lbshift, 0, + sizeof (struct VasEBoot_udf_pd), &data->pds[data->npd])) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } data->npd++; } - else if (tag.tag_ident == GRUB_UDF_TAG_IDENT_LVD) + else if (tag.tag_ident == VasEBoot_UDF_TAG_IDENT_LVD) { int k; - struct grub_udf_partmap *ppm; + struct VasEBoot_udf_partmap *ppm; - if (grub_disk_read (disk, block << lbshift, 0, - sizeof (struct grub_udf_lvd), + if (VasEBoot_disk_read (disk, block << lbshift, 0, + sizeof (struct VasEBoot_udf_lvd), &data->lvd)) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } - if (data->npm + U32 (data->lvd.num_part_maps) > GRUB_UDF_MAX_PMS) + if (data->npm + U32 (data->lvd.num_part_maps) > VasEBoot_UDF_MAX_PMS) { - grub_error (GRUB_ERR_BAD_FS, "too many partition maps"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "too many partition maps"); goto fail; } - ppm = (struct grub_udf_partmap *) &data->lvd.part_maps; + ppm = (struct VasEBoot_udf_partmap *) &data->lvd.part_maps; for (k = U32 (data->lvd.num_part_maps); k > 0; k--) { - if (ppm->type != GRUB_UDF_PARTMAP_TYPE_1) + if (ppm->type != VasEBoot_UDF_PARTMAP_TYPE_1) { - grub_error (GRUB_ERR_BAD_FS, "partmap type not supported"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "partmap type not supported"); goto fail; } data->pms[data->npm++] = ppm; - ppm = (struct grub_udf_partmap *) ((char *) ppm + + ppm = (struct VasEBoot_udf_partmap *) ((char *) ppm + U32 (ppm->length)); } } - else if (tag.tag_ident > GRUB_UDF_TAG_IDENT_TD) + else if (tag.tag_ident > VasEBoot_UDF_TAG_IDENT_TD) { - grub_error (GRUB_ERR_BAD_FS, "invalid tag ident"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid tag ident"); goto fail; } - else if (tag.tag_ident == GRUB_UDF_TAG_IDENT_TD) + else if (tag.tag_ident == VasEBoot_UDF_TAG_IDENT_TD) break; block++; @@ -768,28 +768,28 @@ grub_udf_mount (grub_disk_t disk) if (j == data->npd) { - grub_error (GRUB_ERR_BAD_FS, "can\'t find PD"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "can\'t find PD"); goto fail; } } - block = grub_udf_get_block (data, + block = VasEBoot_udf_get_block (data, data->lvd.root_fileset.block.part_ref, data->lvd.root_fileset.block.block_num); - if (grub_errno) + if (VasEBoot_errno) goto fail; - if (grub_disk_read (disk, block << lbshift, 0, - sizeof (struct grub_udf_fileset), &root_fs)) + if (VasEBoot_disk_read (disk, block << lbshift, 0, + sizeof (struct VasEBoot_udf_fileset), &root_fs)) { - grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an UDF filesystem"); goto fail; } - if (U16 (root_fs.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FSD) + if (U16 (root_fs.tag.tag_ident) != VasEBoot_UDF_TAG_IDENT_FSD) { - grub_error (GRUB_ERR_BAD_FS, "invalid fileset descriptor"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid fileset descriptor"); goto fail; } @@ -798,33 +798,33 @@ grub_udf_mount (grub_disk_t disk) return data; fail: - grub_free (data); + VasEBoot_free (data); return 0; } -#ifdef GRUB_UTIL -grub_disk_addr_t -grub_udf_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn) +#ifdef VasEBoot_UTIL +VasEBoot_disk_addr_t +VasEBoot_udf_get_cluster_sector (VasEBoot_disk_t disk, VasEBoot_uint64_t *sec_per_lcn) { - grub_disk_addr_t ret; - static struct grub_udf_data *data; + VasEBoot_disk_addr_t ret; + static struct VasEBoot_udf_data *data; - data = grub_udf_mount (disk); + data = VasEBoot_udf_mount (disk); if (!data) return 0; ret = U32 (data->pds[data->pms[0]->type1.part_num].start); *sec_per_lcn = 1ULL << data->lbshift; - grub_free (data); + VasEBoot_free (data); return ret; } #endif static char * -read_string (const grub_uint8_t *raw, grub_size_t sz, char *outbuf) +read_string (const VasEBoot_uint8_t *raw, VasEBoot_size_t sz, char *outbuf) { - grub_uint16_t *utf16 = NULL; - grub_size_t utf16len = 0; + VasEBoot_uint16_t *utf16 = NULL; + VasEBoot_size_t utf16len = 0; if (sz == 0) return NULL; @@ -836,7 +836,7 @@ read_string (const grub_uint8_t *raw, grub_size_t sz, char *outbuf) { unsigned i; utf16len = sz - 1; - utf16 = grub_malloc (utf16len * sizeof (utf16[0])); + utf16 = VasEBoot_malloc (utf16len * sizeof (utf16[0])); if (!utf16) return NULL; for (i = 0; i < utf16len; i++) @@ -846,78 +846,78 @@ read_string (const grub_uint8_t *raw, grub_size_t sz, char *outbuf) { unsigned i; utf16len = (sz - 1) / 2; - utf16 = grub_malloc (utf16len * sizeof (utf16[0])); + utf16 = VasEBoot_malloc (utf16len * sizeof (utf16[0])); if (!utf16) return NULL; for (i = 0; i < utf16len; i++) utf16[i] = (raw[2 * i + 1] << 8) | raw[2*i + 2]; } if (!outbuf) - outbuf = grub_malloc (utf16len * GRUB_MAX_UTF8_PER_UTF16 + 1); + outbuf = VasEBoot_malloc (utf16len * VasEBoot_MAX_UTF8_PER_UTF16 + 1); if (outbuf) - *grub_utf16_to_utf8 ((grub_uint8_t *) outbuf, utf16, utf16len) = '\0'; - grub_free (utf16); + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) outbuf, utf16, utf16len) = '\0'; + VasEBoot_free (utf16); return outbuf; } static int -grub_udf_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_udf_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - grub_fshelp_node_t child; - struct grub_udf_file_ident dirent; - grub_off_t offset = 0; + VasEBoot_fshelp_node_t child; + struct VasEBoot_udf_file_ident dirent; + VasEBoot_off_t offset = 0; - child = grub_malloc (get_fshelp_size (dir->data)); + child = VasEBoot_malloc (get_fshelp_size (dir->data)); if (!child) return 0; /* The current directory is not stored. */ - grub_memcpy (child, dir, get_fshelp_size (dir->data)); + VasEBoot_memcpy (child, dir, get_fshelp_size (dir->data)); - if (hook (".", GRUB_FSHELP_DIR, child, hook_data)) + if (hook (".", VasEBoot_FSHELP_DIR, child, hook_data)) return 1; while (offset < U64 (dir->block.fe.file_size)) { - if (grub_udf_read_file (dir, 0, 0, offset, sizeof (dirent), + if (VasEBoot_udf_read_file (dir, 0, 0, offset, sizeof (dirent), (char *) &dirent) != sizeof (dirent)) return 0; - if (U16 (dirent.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FID) + if (U16 (dirent.tag.tag_ident) != VasEBoot_UDF_TAG_IDENT_FID) { - grub_error (GRUB_ERR_BAD_FS, "invalid fid tag"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid fid tag"); return 0; } offset += sizeof (dirent) + U16 (dirent.imp_use_length); - if (!(dirent.characteristics & GRUB_UDF_FID_CHAR_DELETED)) + if (!(dirent.characteristics & VasEBoot_UDF_FID_CHAR_DELETED)) { - child = grub_malloc (get_fshelp_size (dir->data)); + child = VasEBoot_malloc (get_fshelp_size (dir->data)); if (!child) return 0; - if (grub_udf_read_icb (dir->data, &dirent.icb, child)) + if (VasEBoot_udf_read_icb (dir->data, &dirent.icb, child)) return 0; - if (dirent.characteristics & GRUB_UDF_FID_CHAR_PARENT) + if (dirent.characteristics & VasEBoot_UDF_FID_CHAR_PARENT) { /* This is the parent directory. */ - if (hook ("..", GRUB_FSHELP_DIR, child, hook_data)) + if (hook ("..", VasEBoot_FSHELP_DIR, child, hook_data)) return 1; } else { - enum grub_fshelp_filetype type; + enum VasEBoot_fshelp_filetype type; char *filename; - grub_uint8_t raw[MAX_FILE_IDENT_LENGTH]; + VasEBoot_uint8_t raw[MAX_FILE_IDENT_LENGTH]; - type = ((dirent.characteristics & GRUB_UDF_FID_CHAR_DIRECTORY) ? - (GRUB_FSHELP_DIR) : (GRUB_FSHELP_REG)); - if (child->block.fe.icbtag.file_type == GRUB_UDF_ICBTAG_TYPE_SYMLINK) - type = GRUB_FSHELP_SYMLINK; + type = ((dirent.characteristics & VasEBoot_UDF_FID_CHAR_DIRECTORY) ? + (VasEBoot_FSHELP_DIR) : (VasEBoot_FSHELP_REG)); + if (child->block.fe.icbtag.file_type == VasEBoot_UDF_ICBTAG_TYPE_SYMLINK) + type = VasEBoot_FSHELP_SYMLINK; - if ((grub_udf_read_file (dir, 0, 0, offset, + if ((VasEBoot_udf_read_file (dir, 0, 0, offset, dirent.file_ident_length, (char *) raw)) != dirent.file_ident_length) @@ -925,14 +925,14 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir, filename = read_string (raw, dirent.file_ident_length, 0); if (!filename) - grub_print_error (); + VasEBoot_print_error (); if (filename && hook (filename, type, child, hook_data)) { - grub_free (filename); + VasEBoot_free (filename); return 1; } - grub_free (filename); + VasEBoot_free (filename); } } @@ -944,28 +944,28 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir, } static char * -grub_udf_read_symlink (grub_fshelp_node_t node) +VasEBoot_udf_read_symlink (VasEBoot_fshelp_node_t node) { - grub_size_t sz = U64 (node->block.fe.file_size); - grub_uint8_t *raw; - const grub_uint8_t *ptr; + VasEBoot_size_t sz = U64 (node->block.fe.file_size); + VasEBoot_uint8_t *raw; + const VasEBoot_uint8_t *ptr; char *out, *optr; if (sz < 4) return NULL; - raw = grub_malloc (sz); + raw = VasEBoot_malloc (sz); if (!raw) return NULL; - if (grub_udf_read_file (node, NULL, NULL, 0, sz, (char *) raw) < 0) + if (VasEBoot_udf_read_file (node, NULL, NULL, 0, sz, (char *) raw) < 0) { - grub_free (raw); + VasEBoot_free (raw); return NULL; } - out = grub_malloc (sz * 2 + 1); + out = VasEBoot_malloc (sz * 2 + 1); if (!out) { - grub_free (raw); + VasEBoot_free (raw); return NULL; } @@ -973,13 +973,13 @@ grub_udf_read_symlink (grub_fshelp_node_t node) for (ptr = raw; ptr < raw + sz; ) { - grub_size_t s; - if ((grub_size_t) (ptr - raw + 4) > sz) + VasEBoot_size_t s; + if ((VasEBoot_size_t) (ptr - raw + 4) > sz) goto fail; if (!(ptr[2] == 0 && ptr[3] == 0)) goto fail; s = 4 + ptr[1]; - if ((grub_size_t) (ptr - raw + s) > sz) + if ((VasEBoot_size_t) (ptr - raw + s) > sz) goto fail; switch (*ptr) { @@ -1011,7 +1011,7 @@ grub_udf_read_symlink (grub_fshelp_node_t node) *optr++ = '/'; if (!read_string (ptr + 4, s - 4, optr)) goto fail; - optr += grub_strlen (optr); + optr += VasEBoot_strlen (optr); break; default: goto fail; @@ -1019,43 +1019,43 @@ grub_udf_read_symlink (grub_fshelp_node_t node) ptr += s; } *optr = 0; - grub_free (raw); + VasEBoot_free (raw); return out; fail: - grub_free (raw); - grub_free (out); - grub_error (GRUB_ERR_BAD_FS, "invalid symlink"); + VasEBoot_free (raw); + VasEBoot_free (out); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid symlink"); return NULL; } -/* Context for grub_udf_dir. */ -struct grub_udf_dir_ctx +/* Context for VasEBoot_udf_dir. */ +struct VasEBoot_udf_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_udf_dir. */ +/* Helper for VasEBoot_udf_dir. */ static int -grub_udf_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_udf_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_udf_dir_ctx *ctx = data; - struct grub_dirhook_info info; - const struct grub_udf_timestamp *tstamp = NULL; + struct VasEBoot_udf_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; + const struct VasEBoot_udf_timestamp *tstamp = NULL; - grub_memset (&info, 0, sizeof (info)); - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); - if (U16 (node->block.fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_FE) + VasEBoot_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); + if (U16 (node->block.fe.tag.tag_ident) == VasEBoot_UDF_TAG_IDENT_FE) tstamp = &node->block.fe.modification_time; - else if (U16 (node->block.fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_EFE) + else if (U16 (node->block.fe.tag.tag_ident) == VasEBoot_UDF_TAG_IDENT_EFE) tstamp = &node->block.efe.modification_time; if (tstamp && (U16 (tstamp->type_and_timezone) & 0xf000) == 0x1000) { - grub_int16_t tz; - struct grub_datetime datetime; + VasEBoot_int16_t tz; + struct VasEBoot_datetime datetime; datetime.year = U16 (tstamp->year); datetime.month = tstamp->month; @@ -1070,163 +1070,163 @@ grub_udf_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, if (tz == -2047) tz = 0; - info.mtimeset = !!grub_datetime2unixtime (&datetime, &info.mtime); + info.mtimeset = !!VasEBoot_datetime2unixtime (&datetime, &info.mtime); info.mtime -= 60 * tz; } - grub_free (node); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_udf_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_udf_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_udf_dir_ctx ctx = { hook, hook_data }; - struct grub_udf_data *data = 0; - struct grub_fshelp_node *rootnode = 0; - struct grub_fshelp_node *foundnode = 0; + struct VasEBoot_udf_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_udf_data *data = 0; + struct VasEBoot_fshelp_node *rootnode = 0; + struct VasEBoot_fshelp_node *foundnode = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_udf_mount (device->disk); + data = VasEBoot_udf_mount (device->disk); if (!data) goto fail; - rootnode = grub_malloc (get_fshelp_size (data)); + rootnode = VasEBoot_malloc (get_fshelp_size (data)); if (!rootnode) goto fail; - if (grub_udf_read_icb (data, &data->root_icb, rootnode)) + if (VasEBoot_udf_read_icb (data, &data->root_icb, rootnode)) goto fail; - if (grub_fshelp_find_file (path, rootnode, + if (VasEBoot_fshelp_find_file (path, rootnode, &foundnode, - grub_udf_iterate_dir, grub_udf_read_symlink, - GRUB_FSHELP_DIR)) + VasEBoot_udf_iterate_dir, VasEBoot_udf_read_symlink, + VasEBoot_FSHELP_DIR)) goto fail; - grub_udf_iterate_dir (foundnode, grub_udf_dir_iter, &ctx); + VasEBoot_udf_iterate_dir (foundnode, VasEBoot_udf_dir_iter, &ctx); if (foundnode != rootnode) - grub_free (foundnode); + VasEBoot_free (foundnode); fail: - grub_free (rootnode); + VasEBoot_free (rootnode); - grub_free (data); + VasEBoot_free (data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_udf_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_udf_open (struct VasEBoot_file *file, const char *name) { - struct grub_udf_data *data; - struct grub_fshelp_node *rootnode = 0; - struct grub_fshelp_node *foundnode; + struct VasEBoot_udf_data *data; + struct VasEBoot_fshelp_node *rootnode = 0; + struct VasEBoot_fshelp_node *foundnode; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_udf_mount (file->device->disk); + data = VasEBoot_udf_mount (file->device->disk); if (!data) goto fail; - rootnode = grub_malloc (get_fshelp_size (data)); + rootnode = VasEBoot_malloc (get_fshelp_size (data)); if (!rootnode) goto fail; - if (grub_udf_read_icb (data, &data->root_icb, rootnode)) + if (VasEBoot_udf_read_icb (data, &data->root_icb, rootnode)) goto fail; - if (grub_fshelp_find_file (name, rootnode, + if (VasEBoot_fshelp_find_file (name, rootnode, &foundnode, - grub_udf_iterate_dir, grub_udf_read_symlink, - GRUB_FSHELP_REG)) + VasEBoot_udf_iterate_dir, VasEBoot_udf_read_symlink, + VasEBoot_FSHELP_REG)) goto fail; file->data = foundnode; file->offset = 0; file->size = U64 (foundnode->block.fe.file_size); - grub_free (rootnode); + VasEBoot_free (rootnode); return 0; fail: - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); - grub_free (rootnode); + VasEBoot_free (data); + VasEBoot_free (rootnode); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_udf_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_udf_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_fshelp_node *node = (struct grub_fshelp_node *) file->data; + struct VasEBoot_fshelp_node *node = (struct VasEBoot_fshelp_node *) file->data; - return grub_udf_read_file (node, file->read_hook, file->read_hook_data, + return VasEBoot_udf_read_file (node, file->read_hook, file->read_hook_data, file->offset, len, buf); } -static grub_err_t -grub_udf_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_udf_close (VasEBoot_file_t file) { if (file->data) { - struct grub_fshelp_node *node = (struct grub_fshelp_node *) file->data; + struct VasEBoot_fshelp_node *node = (struct VasEBoot_fshelp_node *) file->data; - grub_free (node->data); - grub_free (node); + VasEBoot_free (node->data); + VasEBoot_free (node); } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_udf_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_udf_label (VasEBoot_device_t device, char **label) { - struct grub_udf_data *data; - data = grub_udf_mount (device->disk); + struct VasEBoot_udf_data *data; + data = VasEBoot_udf_mount (device->disk); if (data) { *label = read_string (data->lvd.ident, sizeof (data->lvd.ident), 0); - grub_free (data); + VasEBoot_free (data); } else *label = 0; - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_udf_fs = { +static struct VasEBoot_fs VasEBoot_udf_fs = { .name = "udf", - .dir = grub_udf_dir, - .open = grub_udf_open, - .read = grub_udf_read, - .close = grub_udf_close, - .label = grub_udf_label, -#ifdef GRUB_UTIL + .dir = VasEBoot_udf_dir, + .open = VasEBoot_udf_open, + .read = VasEBoot_udf_read, + .close = VasEBoot_udf_close, + .label = VasEBoot_udf_label, +#ifdef VasEBoot_UTIL .reserved_first_sector = 1, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT (udf) +VasEBoot_MOD_INIT (udf) { - grub_fs_register (&grub_udf_fs); + VasEBoot_fs_register (&VasEBoot_udf_fs); my_mod = mod; } -GRUB_MOD_FINI (udf) +VasEBoot_MOD_FINI (udf) { - grub_fs_unregister (&grub_udf_fs); + VasEBoot_fs_unregister (&VasEBoot_udf_fs); } diff --git a/VasEBoot-core/fs/ufs.c b/VasEBoot-core/fs/ufs.c index 293f027aa..d57af216a 100644 --- a/VasEBoot-core/fs/ufs.c +++ b/VasEBoot-core/fs/ufs.c @@ -1,94 +1,94 @@ /* ufs.c - Unix File System */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #ifdef MODE_UFS2 -#define GRUB_UFS_MAGIC 0x19540119 +#define VasEBoot_UFS_MAGIC 0x19540119 #else -#define GRUB_UFS_MAGIC 0x11954 +#define VasEBoot_UFS_MAGIC 0x11954 #endif -#define GRUB_UFS_INODE 2 -#define GRUB_UFS_FILETYPE_DIR 4 -#define GRUB_UFS_FILETYPE_LNK 10 -#define GRUB_UFS_MAX_SYMLNK_CNT 8 +#define VasEBoot_UFS_INODE 2 +#define VasEBoot_UFS_FILETYPE_DIR 4 +#define VasEBoot_UFS_FILETYPE_LNK 10 +#define VasEBoot_UFS_MAX_SYMLNK_CNT 8 -#define GRUB_UFS_DIRBLKS 12 -#define GRUB_UFS_INDIRBLKS 3 +#define VasEBoot_UFS_DIRBLKS 12 +#define VasEBoot_UFS_INDIRBLKS 3 -#define GRUB_UFS_ATTR_TYPE 0160000 -#define GRUB_UFS_ATTR_FILE 0100000 -#define GRUB_UFS_ATTR_DIR 0040000 -#define GRUB_UFS_ATTR_LNK 0120000 +#define VasEBoot_UFS_ATTR_TYPE 0160000 +#define VasEBoot_UFS_ATTR_FILE 0100000 +#define VasEBoot_UFS_ATTR_DIR 0040000 +#define VasEBoot_UFS_ATTR_LNK 0120000 -#define GRUB_UFS_VOLNAME_LEN 32 +#define VasEBoot_UFS_VOLNAME_LEN 32 #ifdef MODE_BIGENDIAN -#define grub_ufs_to_cpu16 grub_be_to_cpu16 -#define grub_ufs_to_cpu32 grub_be_to_cpu32 -#define grub_ufs_to_cpu64 grub_be_to_cpu64 -#define grub_cpu_to_ufs32_compile_time grub_cpu_to_be32_compile_time +#define VasEBoot_ufs_to_cpu16 VasEBoot_be_to_cpu16 +#define VasEBoot_ufs_to_cpu32 VasEBoot_be_to_cpu32 +#define VasEBoot_ufs_to_cpu64 VasEBoot_be_to_cpu64 +#define VasEBoot_cpu_to_ufs32_compile_time VasEBoot_cpu_to_be32_compile_time #else -#define grub_ufs_to_cpu16 grub_le_to_cpu16 -#define grub_ufs_to_cpu32 grub_le_to_cpu32 -#define grub_ufs_to_cpu64 grub_le_to_cpu64 -#define grub_cpu_to_ufs32_compile_time grub_cpu_to_le32_compile_time +#define VasEBoot_ufs_to_cpu16 VasEBoot_le_to_cpu16 +#define VasEBoot_ufs_to_cpu32 VasEBoot_le_to_cpu32 +#define VasEBoot_ufs_to_cpu64 VasEBoot_le_to_cpu64 +#define VasEBoot_cpu_to_ufs32_compile_time VasEBoot_cpu_to_le32_compile_time #endif #ifdef MODE_UFS2 -typedef grub_uint64_t grub_ufs_blk_t; -static inline grub_disk_addr_t -grub_ufs_to_cpu_blk (grub_ufs_blk_t blk) +typedef VasEBoot_uint64_t VasEBoot_ufs_blk_t; +static inline VasEBoot_disk_addr_t +VasEBoot_ufs_to_cpu_blk (VasEBoot_ufs_blk_t blk) { - return grub_ufs_to_cpu64 (blk); + return VasEBoot_ufs_to_cpu64 (blk); } #else -typedef grub_uint32_t grub_ufs_blk_t; -static inline grub_disk_addr_t -grub_ufs_to_cpu_blk (grub_ufs_blk_t blk) +typedef VasEBoot_uint32_t VasEBoot_ufs_blk_t; +static inline VasEBoot_disk_addr_t +VasEBoot_ufs_to_cpu_blk (VasEBoot_ufs_blk_t blk) { - return grub_ufs_to_cpu32 (blk); + return VasEBoot_ufs_to_cpu32 (blk); } #endif /* Calculate in which group the inode can be found. */ -#define UFS_BLKSZ(sblock) (grub_ufs_to_cpu32 (sblock->bsize)) +#define UFS_BLKSZ(sblock) (VasEBoot_ufs_to_cpu32 (sblock->bsize)) #define UFS_LOG_BLKSZ(sblock) (data->log2_blksz) #ifdef MODE_UFS2 -#define INODE_ENDIAN(data,field,bits1,bits2) grub_ufs_to_cpu##bits2 (data->inode.field) +#define INODE_ENDIAN(data,field,bits1,bits2) VasEBoot_ufs_to_cpu##bits2 (data->inode.field) #else -#define INODE_ENDIAN(data,field,bits1,bits2) grub_ufs_to_cpu##bits1 (data->inode.field) +#define INODE_ENDIAN(data,field,bits1,bits2) VasEBoot_ufs_to_cpu##bits1 (data->inode.field) #endif -#define INODE_SIZE(data) grub_ufs_to_cpu64 (data->inode.size) -#define INODE_MODE(data) grub_ufs_to_cpu16 (data->inode.mode) +#define INODE_SIZE(data) VasEBoot_ufs_to_cpu64 (data->inode.size) +#define INODE_MODE(data) VasEBoot_ufs_to_cpu16 (data->inode.mode) #ifdef MODE_UFS2 #define LOG_INODE_BLKSZ 3 #else @@ -107,166 +107,166 @@ grub_ufs_to_cpu_blk (grub_ufs_blk_t blk) /* The blocks on which the superblock can be found. */ static int sblocklist[] = { 128, 16, 0, 512, -1 }; -struct grub_ufs_sblock +struct VasEBoot_ufs_sblock { - grub_uint8_t unused[16]; + VasEBoot_uint8_t unused[16]; /* The offset of the inodes in the cylinder group. */ - grub_uint32_t inoblk_offs; + VasEBoot_uint32_t inoblk_offs; - grub_uint8_t unused2[4]; + VasEBoot_uint8_t unused2[4]; /* The start of the cylinder group. */ - grub_uint32_t cylg_offset; - grub_uint32_t cylg_mask; + VasEBoot_uint32_t cylg_offset; + VasEBoot_uint32_t cylg_mask; - grub_uint32_t mtime; - grub_uint8_t unused4[12]; + VasEBoot_uint32_t mtime; + VasEBoot_uint8_t unused4[12]; /* The size of a block in bytes. */ - grub_int32_t bsize; - grub_uint8_t unused5[48]; + VasEBoot_int32_t bsize; + VasEBoot_uint8_t unused5[48]; /* The size of filesystem blocks to disk blocks. */ - grub_uint32_t log2_blksz; - grub_uint8_t unused6[40]; - grub_uint32_t uuidhi; - grub_uint32_t uuidlow; - grub_uint8_t unused7[32]; + VasEBoot_uint32_t log2_blksz; + VasEBoot_uint8_t unused6[40]; + VasEBoot_uint32_t uuidhi; + VasEBoot_uint32_t uuidlow; + VasEBoot_uint8_t unused7[32]; /* Inodes stored per cylinder group. */ - grub_uint32_t ino_per_group; + VasEBoot_uint32_t ino_per_group; /* The frags per cylinder group. */ - grub_uint32_t frags_per_group; + VasEBoot_uint32_t frags_per_group; - grub_uint8_t unused8[488]; + VasEBoot_uint8_t unused8[488]; /* Volume name for UFS2. */ - grub_uint8_t volume_name[GRUB_UFS_VOLNAME_LEN]; - grub_uint8_t unused9[360]; + VasEBoot_uint8_t volume_name[VasEBoot_UFS_VOLNAME_LEN]; + VasEBoot_uint8_t unused9[360]; - grub_uint64_t mtime2; - grub_uint8_t unused10[292]; + VasEBoot_uint64_t mtime2; + VasEBoot_uint8_t unused10[292]; /* Magic value to check if this is really a UFS filesystem. */ - grub_uint32_t magic; + VasEBoot_uint32_t magic; }; #ifdef MODE_UFS2 /* UFS inode. */ -struct grub_ufs_inode +struct VasEBoot_ufs_inode { - grub_uint16_t mode; - grub_uint16_t nlinks; - grub_uint32_t uid; - grub_uint32_t gid; - grub_uint32_t blocksize; - grub_uint64_t size; - grub_int64_t nblocks; - grub_uint64_t atime; - grub_uint64_t mtime; - grub_uint64_t ctime; - grub_uint64_t create_time; - grub_uint32_t atime_usec; - grub_uint32_t mtime_usec; - grub_uint32_t ctime_usec; - grub_uint32_t create_time_sec; - grub_uint32_t gen; - grub_uint32_t kernel_flags; - grub_uint32_t flags; - grub_uint32_t extsz; - grub_uint64_t ext[2]; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t nlinks; + VasEBoot_uint32_t uid; + VasEBoot_uint32_t gid; + VasEBoot_uint32_t blocksize; + VasEBoot_uint64_t size; + VasEBoot_int64_t nblocks; + VasEBoot_uint64_t atime; + VasEBoot_uint64_t mtime; + VasEBoot_uint64_t ctime; + VasEBoot_uint64_t create_time; + VasEBoot_uint32_t atime_usec; + VasEBoot_uint32_t mtime_usec; + VasEBoot_uint32_t ctime_usec; + VasEBoot_uint32_t create_time_sec; + VasEBoot_uint32_t gen; + VasEBoot_uint32_t kernel_flags; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t extsz; + VasEBoot_uint64_t ext[2]; union { struct { - grub_uint64_t dir_blocks[GRUB_UFS_DIRBLKS]; - grub_uint64_t indir_blocks[GRUB_UFS_INDIRBLKS]; + VasEBoot_uint64_t dir_blocks[VasEBoot_UFS_DIRBLKS]; + VasEBoot_uint64_t indir_blocks[VasEBoot_UFS_INDIRBLKS]; } blocks; - grub_uint8_t symlink[(GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS) * 8]; + VasEBoot_uint8_t symlink[(VasEBoot_UFS_DIRBLKS + VasEBoot_UFS_INDIRBLKS) * 8]; }; - grub_uint8_t unused[24]; -} GRUB_PACKED; + VasEBoot_uint8_t unused[24]; +} VasEBoot_PACKED; #else /* UFS inode. */ -struct grub_ufs_inode +struct VasEBoot_ufs_inode { - grub_uint16_t mode; - grub_uint16_t nlinks; - grub_uint16_t uid; - grub_uint16_t gid; - grub_uint64_t size; - grub_uint32_t atime; - grub_uint32_t atime_usec; - grub_uint32_t mtime; - grub_uint32_t mtime_usec; - grub_uint32_t ctime; - grub_uint32_t ctime_usec; + VasEBoot_uint16_t mode; + VasEBoot_uint16_t nlinks; + VasEBoot_uint16_t uid; + VasEBoot_uint16_t gid; + VasEBoot_uint64_t size; + VasEBoot_uint32_t atime; + VasEBoot_uint32_t atime_usec; + VasEBoot_uint32_t mtime; + VasEBoot_uint32_t mtime_usec; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t ctime_usec; union { struct { - grub_uint32_t dir_blocks[GRUB_UFS_DIRBLKS]; - grub_uint32_t indir_blocks[GRUB_UFS_INDIRBLKS]; + VasEBoot_uint32_t dir_blocks[VasEBoot_UFS_DIRBLKS]; + VasEBoot_uint32_t indir_blocks[VasEBoot_UFS_INDIRBLKS]; } blocks; - grub_uint8_t symlink[(GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS) * 4]; + VasEBoot_uint8_t symlink[(VasEBoot_UFS_DIRBLKS + VasEBoot_UFS_INDIRBLKS) * 4]; }; - grub_uint32_t flags; - grub_uint32_t nblocks; - grub_uint32_t gen; - grub_uint32_t unused; - grub_uint8_t pad[12]; -} GRUB_PACKED; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t nblocks; + VasEBoot_uint32_t gen; + VasEBoot_uint32_t unused; + VasEBoot_uint8_t pad[12]; +} VasEBoot_PACKED; #endif /* Directory entry. */ -struct grub_ufs_dirent +struct VasEBoot_ufs_dirent { - grub_uint32_t ino; - grub_uint16_t direntlen; + VasEBoot_uint32_t ino; + VasEBoot_uint16_t direntlen; union { - grub_uint16_t namelen; + VasEBoot_uint16_t namelen; struct { - grub_uint8_t filetype_bsd; - grub_uint8_t namelen_bsd; + VasEBoot_uint8_t filetype_bsd; + VasEBoot_uint8_t namelen_bsd; }; }; -} GRUB_PACKED; +} VasEBoot_PACKED; /* Information about a "mounted" ufs filesystem. */ -struct grub_ufs_data +struct VasEBoot_ufs_data { - struct grub_ufs_sblock sblock; - grub_disk_t disk; - struct grub_ufs_inode inode; + struct VasEBoot_ufs_sblock sblock; + VasEBoot_disk_t disk; + struct VasEBoot_ufs_inode inode; int ino; int linknest; int log2_blksz; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; /* Forward declaration. */ -static grub_err_t grub_ufs_find_file (struct grub_ufs_data *data, +static VasEBoot_err_t VasEBoot_ufs_find_file (struct VasEBoot_ufs_data *data, const char *path); -static grub_disk_addr_t -grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk) +static VasEBoot_disk_addr_t +VasEBoot_ufs_get_file_block (struct VasEBoot_ufs_data *data, VasEBoot_disk_addr_t blk) { unsigned long indirsz; int log2_blksz, log_indirsz; /* Direct. */ - if (blk < GRUB_UFS_DIRBLKS) + if (blk < VasEBoot_UFS_DIRBLKS) return INODE_DIRBLOCKS (data, blk); - log2_blksz = grub_ufs_to_cpu32 (data->sblock.log2_blksz); + log2_blksz = VasEBoot_ufs_to_cpu32 (data->sblock.log2_blksz); - blk -= GRUB_UFS_DIRBLKS; + blk -= VasEBoot_UFS_DIRBLKS; log_indirsz = data->log2_blksz - LOG_INODE_BLKSZ; indirsz = 1 << log_indirsz; @@ -274,9 +274,9 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk) /* Single indirect block. */ if (blk < indirsz) { - grub_ufs_blk_t indir; - grub_disk_read (data->disk, - ((grub_disk_addr_t) INODE_INDIRBLOCKS (data, 0)) + VasEBoot_ufs_blk_t indir; + VasEBoot_disk_read (data->disk, + ((VasEBoot_disk_addr_t) INODE_INDIRBLOCKS (data, 0)) << log2_blksz, blk * sizeof (indir), sizeof (indir), &indir); return indir; @@ -284,50 +284,50 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk) blk -= indirsz; /* Double indirect block. */ - if (blk < (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz) + if (blk < (VasEBoot_disk_addr_t) indirsz * (VasEBoot_disk_addr_t) indirsz) { - grub_ufs_blk_t indir; + VasEBoot_ufs_blk_t indir; - grub_disk_read (data->disk, - ((grub_disk_addr_t) INODE_INDIRBLOCKS (data, 1)) + VasEBoot_disk_read (data->disk, + ((VasEBoot_disk_addr_t) INODE_INDIRBLOCKS (data, 1)) << log2_blksz, (blk >> log_indirsz) * sizeof (indir), sizeof (indir), &indir); - grub_disk_read (data->disk, - grub_ufs_to_cpu_blk (indir) << log2_blksz, + VasEBoot_disk_read (data->disk, + VasEBoot_ufs_to_cpu_blk (indir) << log2_blksz, (blk & ((1 << log_indirsz) - 1)) * sizeof (indir), sizeof (indir), &indir); return indir; } - blk -= (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz; + blk -= (VasEBoot_disk_addr_t) indirsz * (VasEBoot_disk_addr_t) indirsz; /* Triple indirect block. */ if (!(blk >> (3 * log_indirsz))) { - grub_ufs_blk_t indir; + VasEBoot_ufs_blk_t indir; - grub_disk_read (data->disk, - ((grub_disk_addr_t) INODE_INDIRBLOCKS (data, 2)) + VasEBoot_disk_read (data->disk, + ((VasEBoot_disk_addr_t) INODE_INDIRBLOCKS (data, 2)) << log2_blksz, (blk >> (2 * log_indirsz)) * sizeof (indir), sizeof (indir), &indir); - grub_disk_read (data->disk, - grub_ufs_to_cpu_blk (indir) << log2_blksz, + VasEBoot_disk_read (data->disk, + VasEBoot_ufs_to_cpu_blk (indir) << log2_blksz, ((blk >> log_indirsz) & ((1 << log_indirsz) - 1)) * sizeof (indir), sizeof (indir), &indir); - grub_disk_read (data->disk, - grub_ufs_to_cpu_blk (indir) << log2_blksz, + VasEBoot_disk_read (data->disk, + VasEBoot_ufs_to_cpu_blk (indir) << log2_blksz, (blk & ((1 << log_indirsz) - 1)) * sizeof (indir), sizeof (indir), &indir); return indir; } - grub_error (GRUB_ERR_BAD_FS, + VasEBoot_error (VasEBoot_ERR_BAD_FS, "ufs does not support quadruple indirect blocks"); return 0; } @@ -335,14 +335,14 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk) /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_ufs_read_file (struct grub_ufs_data *data, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf) +static VasEBoot_ssize_t +VasEBoot_ufs_read_file (struct VasEBoot_ufs_data *data, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf) { - struct grub_ufs_sblock *sblock = &data->sblock; - grub_off_t i; - grub_off_t blockcnt; + struct VasEBoot_ufs_sblock *sblock = &data->sblock; + VasEBoot_off_t i; + VasEBoot_off_t blockcnt; /* Adjust len so it we can't read past the end of the file. */ if (len + pos > INODE_SIZE (data)) @@ -352,16 +352,16 @@ grub_ufs_read_file (struct grub_ufs_data *data, for (i = pos >> UFS_LOG_BLKSZ (sblock); i < blockcnt; i++) { - grub_disk_addr_t blknr; - grub_off_t blockoff; - grub_off_t blockend = UFS_BLKSZ (sblock); + VasEBoot_disk_addr_t blknr; + VasEBoot_off_t blockoff; + VasEBoot_off_t blockend = UFS_BLKSZ (sblock); int skipfirst = 0; blockoff = pos & (UFS_BLKSZ (sblock) - 1); - blknr = grub_ufs_get_file_block (data, i); - if (grub_errno) + blknr = VasEBoot_ufs_get_file_block (data, i); + if (VasEBoot_errno) return -1; /* Last block. */ @@ -386,15 +386,15 @@ grub_ufs_read_file (struct grub_ufs_data *data, { data->disk->read_hook = read_hook; data->disk->read_hook_data = read_hook_data; - grub_disk_read (data->disk, - blknr << grub_ufs_to_cpu32 (data->sblock.log2_blksz), + VasEBoot_disk_read (data->disk, + blknr << VasEBoot_ufs_to_cpu32 (data->sblock.log2_blksz), skipfirst, blockend, buf); data->disk->read_hook = 0; - if (grub_errno) + if (VasEBoot_errno) return -1; } else - grub_memset (buf, 0, blockend); + VasEBoot_memset (buf, 0, blockend); buf += UFS_BLKSZ (sblock) - skipfirst; } @@ -404,23 +404,23 @@ grub_ufs_read_file (struct grub_ufs_data *data, /* Read inode INO from the mounted filesystem described by DATA. This inode is used by default now. */ -static grub_err_t -grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) +static VasEBoot_err_t +VasEBoot_ufs_read_inode (struct VasEBoot_ufs_data *data, int ino, char *inode) { - struct grub_ufs_sblock *sblock = &data->sblock; + struct VasEBoot_ufs_sblock *sblock = &data->sblock; /* Determine the group the inode is in. */ - int group = ino / grub_ufs_to_cpu32 (sblock->ino_per_group); + int group = ino / VasEBoot_ufs_to_cpu32 (sblock->ino_per_group); /* Determine the inode within the group. */ - int grpino = ino % grub_ufs_to_cpu32 (sblock->ino_per_group); + int grpino = ino % VasEBoot_ufs_to_cpu32 (sblock->ino_per_group); /* The first block of the group. */ - int grpblk = group * (grub_ufs_to_cpu32 (sblock->frags_per_group)); + int grpblk = group * (VasEBoot_ufs_to_cpu32 (sblock->frags_per_group)); #ifndef MODE_UFS2 - grpblk += grub_ufs_to_cpu32 (sblock->cylg_offset) - * (group & (~grub_ufs_to_cpu32 (sblock->cylg_mask))); + grpblk += VasEBoot_ufs_to_cpu32 (sblock->cylg_offset) + * (group & (~VasEBoot_ufs_to_cpu32 (sblock->cylg_mask))); #endif if (!inode) @@ -429,33 +429,33 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) data->ino = ino; } - grub_disk_read (data->disk, - ((grub_ufs_to_cpu32 (sblock->inoblk_offs) + grpblk) - << grub_ufs_to_cpu32 (data->sblock.log2_blksz)) + VasEBoot_disk_read (data->disk, + ((VasEBoot_ufs_to_cpu32 (sblock->inoblk_offs) + grpblk) + << VasEBoot_ufs_to_cpu32 (data->sblock.log2_blksz)) + grpino / UFS_INODE_PER_BLOCK, (grpino % UFS_INODE_PER_BLOCK) - * sizeof (struct grub_ufs_inode), - sizeof (struct grub_ufs_inode), + * sizeof (struct VasEBoot_ufs_inode), + sizeof (struct VasEBoot_ufs_inode), inode); - return grub_errno; + return VasEBoot_errno; } /* Lookup the symlink the current inode points to. INO is the inode number of the directory the symlink is relative to. */ -static grub_err_t -grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) +static VasEBoot_err_t +VasEBoot_ufs_lookup_symlink (struct VasEBoot_ufs_data *data, int ino) { char *symlink; - grub_size_t sz = INODE_SIZE (data); + VasEBoot_size_t sz = INODE_SIZE (data); - if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT) - return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); + if (++data->linknest > VasEBoot_UFS_MAX_SYMLNK_CNT) + return VasEBoot_error (VasEBoot_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks")); - symlink = grub_malloc (sz + 1); + symlink = VasEBoot_malloc (sz + 1); if (!symlink) - return grub_errno; + return VasEBoot_errno; /* Normally we should just check that data->inode.nblocks == 0. However old Linux doesn't maintain nblocks correctly and so it's always 0. If size is bigger than inline space then the symlink is surely not @@ -463,40 +463,40 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) /* Check against zero is paylindromic, no need to swap. */ if (data->inode.nblocks == 0 && INODE_SIZE (data) <= sizeof (data->inode.symlink)) - grub_strcpy (symlink, (char *) data->inode.symlink); + VasEBoot_strcpy (symlink, (char *) data->inode.symlink); else { - if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0) + if (VasEBoot_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0) { - grub_free(symlink); - return grub_errno; + VasEBoot_free(symlink); + return VasEBoot_errno; } } symlink[sz] = '\0'; /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') - ino = GRUB_UFS_INODE; + ino = VasEBoot_UFS_INODE; /* Now load in the old inode. */ - if (grub_ufs_read_inode (data, ino, 0)) + if (VasEBoot_ufs_read_inode (data, ino, 0)) { - grub_free (symlink); - return grub_errno; + VasEBoot_free (symlink); + return VasEBoot_errno; } - grub_ufs_find_file (data, symlink); + VasEBoot_ufs_find_file (data, symlink); - grub_free (symlink); + VasEBoot_free (symlink); - return grub_errno; + return VasEBoot_errno; } /* Find the file with the pathname PATH on the filesystem described by DATA. */ -static grub_err_t -grub_ufs_find_file (struct grub_ufs_data *data, const char *path) +static VasEBoot_err_t +VasEBoot_ufs_find_file (struct VasEBoot_ufs_data *data, const char *path) { const char *name; const char *next = path; @@ -506,13 +506,13 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) /* We reject filenames longer than the one we're looking for without reading, so this allocation is enough. */ - filename = grub_malloc (grub_strlen (path) + 2); + filename = VasEBoot_malloc (VasEBoot_strlen (path) + 2); if (!filename) - return grub_errno; + return VasEBoot_errno; while (1) { - struct grub_ufs_dirent dirent; + struct VasEBoot_ufs_dirent dirent; name = next; /* Skip the first slash. */ @@ -520,60 +520,60 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) name++; if (*name == 0) { - grub_free (filename); - return GRUB_ERR_NONE; + VasEBoot_free (filename); + return VasEBoot_ERR_NONE; } - if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) - != GRUB_UFS_ATTR_DIR) + if ((INODE_MODE(data) & VasEBoot_UFS_ATTR_TYPE) + != VasEBoot_UFS_ATTR_DIR) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); goto fail; } /* Extract the actual part from the pathname. */ for (next = name; *next && *next != '/'; next++); - for (pos = 0; ; pos += grub_ufs_to_cpu16 (dirent.direntlen)) + for (pos = 0; ; pos += VasEBoot_ufs_to_cpu16 (dirent.direntlen)) { int namelen; if (pos >= INODE_SIZE (data)) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path); goto fail; } - if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent), + if (VasEBoot_ufs_read_file (data, 0, 0, pos, sizeof (dirent), (char *) &dirent) < 0) goto fail; #ifdef MODE_UFS2 namelen = dirent.namelen_bsd; #else - namelen = grub_ufs_to_cpu16 (dirent.namelen); + namelen = VasEBoot_ufs_to_cpu16 (dirent.namelen); #endif if (namelen < next - name) continue; - if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent), + if (VasEBoot_ufs_read_file (data, 0, 0, pos + sizeof (dirent), next - name + (namelen != next - name), filename) < 0) goto fail; - if (grub_strncmp (name, filename, next - name) == 0 + if (VasEBoot_strncmp (name, filename, next - name) == 0 && (namelen == next - name || filename[next - name] == '\0')) { dirino = data->ino; - grub_ufs_read_inode (data, grub_ufs_to_cpu32 (dirent.ino), 0); + VasEBoot_ufs_read_inode (data, VasEBoot_ufs_to_cpu32 (dirent.ino), 0); - if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) - == GRUB_UFS_ATTR_LNK) + if ((INODE_MODE(data) & VasEBoot_UFS_ATTR_TYPE) + == VasEBoot_UFS_ATTR_LNK) { - grub_ufs_lookup_symlink (data, dirino); - if (grub_errno) + VasEBoot_ufs_lookup_symlink (data, dirino); + if (VasEBoot_errno) goto fail; } @@ -582,39 +582,39 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) } } fail: - grub_free (filename); - return grub_errno; + VasEBoot_free (filename); + return VasEBoot_errno; } /* Mount the filesystem on the disk DISK. */ -static struct grub_ufs_data * -grub_ufs_mount (grub_disk_t disk) +static struct VasEBoot_ufs_data * +VasEBoot_ufs_mount (VasEBoot_disk_t disk) { - struct grub_ufs_data *data; + struct VasEBoot_ufs_data *data; int *sblklist = sblocklist; - data = grub_malloc (sizeof (struct grub_ufs_data)); + data = VasEBoot_malloc (sizeof (struct VasEBoot_ufs_data)); if (!data) return 0; /* Find a UFS sblock. */ while (*sblklist != -1) { - grub_disk_read (disk, *sblklist, 0, sizeof (struct grub_ufs_sblock), + VasEBoot_disk_read (disk, *sblklist, 0, sizeof (struct VasEBoot_ufs_sblock), &data->sblock); - if (grub_errno) + if (VasEBoot_errno) goto fail; /* No need to byteswap bsize in this check. It works the same on both endiannesses. */ - if (data->sblock.magic == grub_cpu_to_ufs32_compile_time (GRUB_UFS_MAGIC) + if (data->sblock.magic == VasEBoot_cpu_to_ufs32_compile_time (VasEBoot_UFS_MAGIC) && data->sblock.bsize != 0 && ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0) && data->sblock.ino_per_group != 0) { for (data->log2_blksz = 0; - (1U << data->log2_blksz) < grub_ufs_to_cpu32 (data->sblock.bsize); + (1U << data->log2_blksz) < VasEBoot_ufs_to_cpu32 (data->sblock.bsize); data->log2_blksz++); data->disk = disk; @@ -626,58 +626,58 @@ grub_ufs_mount (grub_disk_t disk) fail: - if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE) + if (VasEBoot_errno == VasEBoot_ERR_NONE || VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) { #ifdef MODE_UFS2 - grub_error (GRUB_ERR_BAD_FS, "not an ufs2 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an ufs2 filesystem"); #else - grub_error (GRUB_ERR_BAD_FS, "not an ufs1 filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an ufs1 filesystem"); #endif } - grub_free (data); + VasEBoot_free (data); return 0; } -static grub_err_t -grub_ufs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_ufs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_ufs_data *data; + struct VasEBoot_ufs_data *data; unsigned int pos = 0; - data = grub_ufs_mount (device->disk); + data = VasEBoot_ufs_mount (device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - grub_ufs_read_inode (data, GRUB_UFS_INODE, 0); - if (grub_errno) - return grub_errno; + VasEBoot_ufs_read_inode (data, VasEBoot_UFS_INODE, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (!path || path[0] != '/') { - grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path); + return VasEBoot_errno; } - grub_ufs_find_file (data, path); - if (grub_errno) + VasEBoot_ufs_find_file (data, path); + if (VasEBoot_errno) goto fail; - if ((INODE_MODE (data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR) + if ((INODE_MODE (data) & VasEBoot_UFS_ATTR_TYPE) != VasEBoot_UFS_ATTR_DIR) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); goto fail; } while (pos < INODE_SIZE (data)) { - struct grub_ufs_dirent dirent; + struct VasEBoot_ufs_dirent dirent; int namelen; - if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent), + if (VasEBoot_ufs_read_file (data, 0, 0, pos, sizeof (dirent), (char *) &dirent) < 0) break; @@ -687,184 +687,184 @@ grub_ufs_dir (grub_device_t device, const char *path, #ifdef MODE_UFS2 namelen = dirent.namelen_bsd; #else - namelen = grub_ufs_to_cpu16 (dirent.namelen); + namelen = VasEBoot_ufs_to_cpu16 (dirent.namelen); #endif - char *filename = grub_malloc (namelen + 1); + char *filename = VasEBoot_malloc (namelen + 1); if (!filename) goto fail; - struct grub_dirhook_info info; - struct grub_ufs_inode inode; + struct VasEBoot_dirhook_info info; + struct VasEBoot_ufs_inode inode; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); - if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent), + if (VasEBoot_ufs_read_file (data, 0, 0, pos + sizeof (dirent), namelen, filename) < 0) { - grub_free (filename); + VasEBoot_free (filename); break; } filename[namelen] = '\0'; - grub_ufs_read_inode (data, grub_ufs_to_cpu32 (dirent.ino), + VasEBoot_ufs_read_inode (data, VasEBoot_ufs_to_cpu32 (dirent.ino), (char *) &inode); - info.dir = ((grub_ufs_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE) - == GRUB_UFS_ATTR_DIR); + info.dir = ((VasEBoot_ufs_to_cpu16 (inode.mode) & VasEBoot_UFS_ATTR_TYPE) + == VasEBoot_UFS_ATTR_DIR); #ifdef MODE_UFS2 - info.mtime = grub_ufs_to_cpu64 (inode.mtime); + info.mtime = VasEBoot_ufs_to_cpu64 (inode.mtime); #else - info.mtime = grub_ufs_to_cpu32 (inode.mtime); + info.mtime = VasEBoot_ufs_to_cpu32 (inode.mtime); #endif info.mtimeset = 1; if (hook (filename, &info, hook_data)) { - grub_free (filename); + VasEBoot_free (filename); break; } - grub_free (filename); + VasEBoot_free (filename); - pos += grub_ufs_to_cpu16 (dirent.direntlen); + pos += VasEBoot_ufs_to_cpu16 (dirent.direntlen); } fail: - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_ufs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_ufs_open (struct VasEBoot_file *file, const char *name) { - struct grub_ufs_data *data; - data = grub_ufs_mount (file->device->disk); + struct VasEBoot_ufs_data *data; + data = VasEBoot_ufs_mount (file->device->disk); if (!data) - return grub_errno; + return VasEBoot_errno; - grub_ufs_read_inode (data, 2, 0); - if (grub_errno) + VasEBoot_ufs_read_inode (data, 2, 0); + if (VasEBoot_errno) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } if (!name || name[0] != '/') { - grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name); + return VasEBoot_errno; } - grub_ufs_find_file (data, name); - if (grub_errno) + VasEBoot_ufs_find_file (data, name); + if (VasEBoot_errno) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } file->data = data; file->size = INODE_SIZE (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -grub_ufs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_ufs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_ufs_data *data = - (struct grub_ufs_data *) file->data; + struct VasEBoot_ufs_data *data = + (struct VasEBoot_ufs_data *) file->data; - return grub_ufs_read_file (data, file->read_hook, file->read_hook_data, + return VasEBoot_ufs_read_file (data, file->read_hook, file->read_hook_data, file->offset, len, buf); } -static grub_err_t -grub_ufs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_ufs_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_ufs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_ufs_label (VasEBoot_device_t device, char **label) { - struct grub_ufs_data *data = 0; + struct VasEBoot_ufs_data *data = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); *label = 0; - data = grub_ufs_mount (device->disk); + data = VasEBoot_ufs_mount (device->disk); if (data) - *label = grub_strdup ((char *) data->sblock.volume_name); + *label = VasEBoot_strdup ((char *) data->sblock.volume_name); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_ufs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_ufs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_ufs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_ufs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ufs_mount (disk); + data = VasEBoot_ufs_mount (disk); if (data && (data->sblock.uuidhi != 0 || data->sblock.uuidlow != 0)) - *uuid = grub_xasprintf ("%08x%08x", - (unsigned) grub_ufs_to_cpu32 (data->sblock.uuidhi), - (unsigned) grub_ufs_to_cpu32 (data->sblock.uuidlow)); + *uuid = VasEBoot_xasprintf ("%08x%08x", + (unsigned) VasEBoot_ufs_to_cpu32 (data->sblock.uuidhi), + (unsigned) VasEBoot_ufs_to_cpu32 (data->sblock.uuidlow)); else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } /* Get mtime. */ -static grub_err_t -grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) +static VasEBoot_err_t +VasEBoot_ufs_mtime (VasEBoot_device_t device, VasEBoot_int32_t *tm) { - struct grub_ufs_data *data = 0; + struct VasEBoot_ufs_data *data = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_ufs_mount (device->disk); + data = VasEBoot_ufs_mount (device->disk); if (!data) *tm = 0; else { - *tm = grub_ufs_to_cpu32 (data->sblock.mtime); + *tm = VasEBoot_ufs_to_cpu32 (data->sblock.mtime); #ifdef MODE_UFS2 - if (*tm < (grub_int64_t) grub_ufs_to_cpu64 (data->sblock.mtime2)) - *tm = grub_ufs_to_cpu64 (data->sblock.mtime2); + if (*tm < (VasEBoot_int64_t) VasEBoot_ufs_to_cpu64 (data->sblock.mtime2)) + *tm = VasEBoot_ufs_to_cpu64 (data->sblock.mtime2); #endif } - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_ufs_fs = +static struct VasEBoot_fs VasEBoot_ufs_fs = { #ifdef MODE_UFS2 .name = "ufs2", @@ -875,44 +875,44 @@ static struct grub_fs grub_ufs_fs = .name = "ufs1", #endif #endif - .dir = grub_ufs_dir, - .open = grub_ufs_open, - .read = grub_ufs_read, - .close = grub_ufs_close, - .label = grub_ufs_label, - .uuid = grub_ufs_uuid, - .mtime = grub_ufs_mtime, + .dir = VasEBoot_ufs_dir, + .open = VasEBoot_ufs_open, + .read = VasEBoot_ufs_read, + .close = VasEBoot_ufs_close, + .label = VasEBoot_ufs_label, + .uuid = VasEBoot_ufs_uuid, + .mtime = VasEBoot_ufs_mtime, /* FIXME: set reserved_first_sector. */ -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL .blocklist_install = 1, #endif .next = 0 }; #ifdef MODE_UFS2 -GRUB_MOD_INIT(ufs2) +VasEBoot_MOD_INIT(ufs2) #else #ifdef MODE_BIGENDIAN -GRUB_MOD_INIT(ufs1_be) +VasEBoot_MOD_INIT(ufs1_be) #else -GRUB_MOD_INIT(ufs1) +VasEBoot_MOD_INIT(ufs1) #endif #endif { - grub_fs_register (&grub_ufs_fs); + VasEBoot_fs_register (&VasEBoot_ufs_fs); my_mod = mod; } #ifdef MODE_UFS2 -GRUB_MOD_FINI(ufs2) +VasEBoot_MOD_FINI(ufs2) #else #ifdef MODE_BIGENDIAN -GRUB_MOD_FINI(ufs1_be) +VasEBoot_MOD_FINI(ufs1_be) #else -GRUB_MOD_FINI(ufs1) +VasEBoot_MOD_FINI(ufs1) #endif #endif { - grub_fs_unregister (&grub_ufs_fs); + VasEBoot_fs_unregister (&VasEBoot_ufs_fs); } diff --git a/VasEBoot-core/fs/xfs.c b/VasEBoot-core/fs/xfs.c index 9f66dd6e4..ff02b5da9 100644 --- a/VasEBoot-core/fs/xfs.c +++ b/VasEBoot-core/fs/xfs.c @@ -1,32 +1,32 @@ /* xfs.c - XFS. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define XFS_INODE_EXTENTS 9 @@ -84,204 +84,204 @@ GRUB_MOD_LICENSE ("GPLv3+"); (XFS_SB_FEAT_INCOMPAT_FTYPE | \ XFS_SB_FEAT_INCOMPAT_META_UUID) -struct grub_xfs_sblock +struct VasEBoot_xfs_sblock { - grub_uint8_t magic[4]; - grub_uint32_t bsize; - grub_uint8_t unused1[24]; - grub_uint16_t uuid[8]; - grub_uint8_t unused2[8]; - grub_uint64_t rootino; - grub_uint8_t unused3[20]; - grub_uint32_t agsize; - grub_uint8_t unused4[12]; - grub_uint16_t version; - grub_uint8_t unused5[6]; - grub_uint8_t label[12]; - grub_uint8_t log2_bsize; - grub_uint8_t log2_sect; - grub_uint8_t log2_inode; - grub_uint8_t log2_inop; - grub_uint8_t log2_agblk; - grub_uint8_t unused6[67]; - grub_uint8_t log2_dirblk; - grub_uint8_t unused7[7]; - grub_uint32_t features2; - grub_uint8_t unused8[4]; - grub_uint32_t sb_features_compat; - grub_uint32_t sb_features_ro_compat; - grub_uint32_t sb_features_incompat; - grub_uint32_t sb_features_log_incompat; -} GRUB_PACKED; + VasEBoot_uint8_t magic[4]; + VasEBoot_uint32_t bsize; + VasEBoot_uint8_t unused1[24]; + VasEBoot_uint16_t uuid[8]; + VasEBoot_uint8_t unused2[8]; + VasEBoot_uint64_t rootino; + VasEBoot_uint8_t unused3[20]; + VasEBoot_uint32_t agsize; + VasEBoot_uint8_t unused4[12]; + VasEBoot_uint16_t version; + VasEBoot_uint8_t unused5[6]; + VasEBoot_uint8_t label[12]; + VasEBoot_uint8_t log2_bsize; + VasEBoot_uint8_t log2_sect; + VasEBoot_uint8_t log2_inode; + VasEBoot_uint8_t log2_inop; + VasEBoot_uint8_t log2_agblk; + VasEBoot_uint8_t unused6[67]; + VasEBoot_uint8_t log2_dirblk; + VasEBoot_uint8_t unused7[7]; + VasEBoot_uint32_t features2; + VasEBoot_uint8_t unused8[4]; + VasEBoot_uint32_t sb_features_compat; + VasEBoot_uint32_t sb_features_ro_compat; + VasEBoot_uint32_t sb_features_incompat; + VasEBoot_uint32_t sb_features_log_incompat; +} VasEBoot_PACKED; -struct grub_xfs_dir_header +struct VasEBoot_xfs_dir_header { - grub_uint8_t count; - grub_uint8_t largeino; + VasEBoot_uint8_t count; + VasEBoot_uint8_t largeino; union { - grub_uint32_t i4; - grub_uint64_t i8; - } GRUB_PACKED parent; -} GRUB_PACKED; + VasEBoot_uint32_t i4; + VasEBoot_uint64_t i8; + } VasEBoot_PACKED parent; +} VasEBoot_PACKED; /* Structure for directory entry inlined in the inode */ -struct grub_xfs_dir_entry +struct VasEBoot_xfs_dir_entry { - grub_uint8_t len; - grub_uint16_t offset; + VasEBoot_uint8_t len; + VasEBoot_uint16_t offset; char name[1]; /* Inode number follows, 32 / 64 bits. */ -} GRUB_PACKED; +} VasEBoot_PACKED; /* Structure for directory entry in a block */ -struct grub_xfs_dir2_entry +struct VasEBoot_xfs_dir2_entry { - grub_uint64_t inode; - grub_uint8_t len; -} GRUB_PACKED; + VasEBoot_uint64_t inode; + VasEBoot_uint8_t len; +} VasEBoot_PACKED; -struct grub_xfs_extent +struct VasEBoot_xfs_extent { /* This should be a bitfield but bietfields are unportable, so just have a raw array and functions extracting useful info from it. */ - grub_uint32_t raw[4]; -} GRUB_PACKED; + VasEBoot_uint32_t raw[4]; +} VasEBoot_PACKED; -struct grub_xfs_btree_node +struct VasEBoot_xfs_btree_node { - grub_uint8_t magic[4]; - grub_uint16_t level; - grub_uint16_t numrecs; - grub_uint64_t left; - grub_uint64_t right; + VasEBoot_uint8_t magic[4]; + VasEBoot_uint16_t level; + VasEBoot_uint16_t numrecs; + VasEBoot_uint64_t left; + VasEBoot_uint64_t right; /* In V5 here follow crc, uuid, etc. */ /* Then follow keys and block pointers */ -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_xfs_btree_root +struct VasEBoot_xfs_btree_root { - grub_uint16_t level; - grub_uint16_t numrecs; - grub_uint64_t keys[1]; -} GRUB_PACKED; + VasEBoot_uint16_t level; + VasEBoot_uint16_t numrecs; + VasEBoot_uint64_t keys[1]; +} VasEBoot_PACKED; -struct grub_xfs_time +struct VasEBoot_xfs_time { - grub_uint32_t sec; - grub_uint32_t nanosec; -} GRUB_PACKED; + VasEBoot_uint32_t sec; + VasEBoot_uint32_t nanosec; +} VasEBoot_PACKED; -struct grub_xfs_inode +struct VasEBoot_xfs_inode { - grub_uint8_t magic[2]; - grub_uint16_t mode; - grub_uint8_t version; - grub_uint8_t format; - grub_uint8_t unused2[26]; - struct grub_xfs_time atime; - struct grub_xfs_time mtime; - struct grub_xfs_time ctime; - grub_uint64_t size; - grub_uint64_t nblocks; - grub_uint32_t extsize; - grub_uint32_t nextents; - grub_uint16_t unused3; - grub_uint8_t fork_offset; - grub_uint8_t unused4[17]; -} GRUB_PACKED; + VasEBoot_uint8_t magic[2]; + VasEBoot_uint16_t mode; + VasEBoot_uint8_t version; + VasEBoot_uint8_t format; + VasEBoot_uint8_t unused2[26]; + struct VasEBoot_xfs_time atime; + struct VasEBoot_xfs_time mtime; + struct VasEBoot_xfs_time ctime; + VasEBoot_uint64_t size; + VasEBoot_uint64_t nblocks; + VasEBoot_uint32_t extsize; + VasEBoot_uint32_t nextents; + VasEBoot_uint16_t unused3; + VasEBoot_uint8_t fork_offset; + VasEBoot_uint8_t unused4[17]; +} VasEBoot_PACKED; -#define XFS_V2_INODE_SIZE sizeof(struct grub_xfs_inode) +#define XFS_V2_INODE_SIZE sizeof(struct VasEBoot_xfs_inode) #define XFS_V3_INODE_SIZE (XFS_V2_INODE_SIZE + 76) -struct grub_xfs_dirblock_tail +struct VasEBoot_xfs_dirblock_tail { - grub_uint32_t leaf_count; - grub_uint32_t leaf_stale; -} GRUB_PACKED; + VasEBoot_uint32_t leaf_count; + VasEBoot_uint32_t leaf_stale; +} VasEBoot_PACKED; -struct grub_fshelp_node +struct VasEBoot_fshelp_node { - struct grub_xfs_data *data; - grub_uint64_t ino; + struct VasEBoot_xfs_data *data; + VasEBoot_uint64_t ino; int inode_read; - struct grub_xfs_inode inode; + struct VasEBoot_xfs_inode inode; }; -struct grub_xfs_data +struct VasEBoot_xfs_data { - struct grub_xfs_sblock sblock; - grub_disk_t disk; + struct VasEBoot_xfs_sblock sblock; + VasEBoot_disk_t disk; int pos; int bsize; - grub_uint32_t agsize; + VasEBoot_uint32_t agsize; unsigned int hasftype:1; unsigned int hascrc:1; - struct grub_fshelp_node diropen; + struct VasEBoot_fshelp_node diropen; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static int grub_xfs_sb_hascrc(struct grub_xfs_data *data) +static int VasEBoot_xfs_sb_hascrc(struct VasEBoot_xfs_data *data) { - return (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == - grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5); + return (data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == + VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_5); } -static int grub_xfs_sb_hasftype(struct grub_xfs_data *data) +static int VasEBoot_xfs_sb_hasftype(struct VasEBoot_xfs_data *data) { - if ((data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == - grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5) && - data->sblock.sb_features_incompat & grub_cpu_to_be32_compile_time(XFS_SB_FEAT_INCOMPAT_FTYPE)) + if ((data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == + VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_5) && + data->sblock.sb_features_incompat & VasEBoot_cpu_to_be32_compile_time(XFS_SB_FEAT_INCOMPAT_FTYPE)) return 1; - if (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_MOREBITSBIT) && - data->sblock.features2 & grub_cpu_to_be32_compile_time(XFS_SB_VERSION2_FTYPE)) + if (data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_MOREBITSBIT) && + data->sblock.features2 & VasEBoot_cpu_to_be32_compile_time(XFS_SB_VERSION2_FTYPE)) return 1; return 0; } -static int grub_xfs_sb_valid(struct grub_xfs_data *data) +static int VasEBoot_xfs_sb_valid(struct VasEBoot_xfs_data *data) { - grub_dprintf("xfs", "Validating superblock\n"); - if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4) - || data->sblock.log2_bsize < GRUB_DISK_SECTOR_BITS + VasEBoot_dprintf("xfs", "Validating superblock\n"); + if (VasEBoot_strncmp ((char *) (data->sblock.magic), "XFSB", 4) + || data->sblock.log2_bsize < VasEBoot_DISK_SECTOR_BITS || ((int) data->sblock.log2_bsize + (int) data->sblock.log2_dirblk) >= 27) { - grub_error (GRUB_ERR_BAD_FS, "not a XFS filesystem"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a XFS filesystem"); return 0; } - if ((data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == - grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5)) + if ((data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == + VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_5)) { - grub_dprintf("xfs", "XFS v5 superblock detected\n"); + VasEBoot_dprintf("xfs", "XFS v5 superblock detected\n"); if (data->sblock.sb_features_incompat & - grub_cpu_to_be32_compile_time(~XFS_SB_FEAT_INCOMPAT_SUPPORTED)) + VasEBoot_cpu_to_be32_compile_time(~XFS_SB_FEAT_INCOMPAT_SUPPORTED)) { - grub_error (GRUB_ERR_BAD_FS, "XFS filesystem has unsupported " + VasEBoot_error (VasEBoot_ERR_BAD_FS, "XFS filesystem has unsupported " "incompatible features"); return 0; } return 1; } - else if ((data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == - grub_cpu_to_be16_compile_time(XFS_SB_VERSION_4)) + else if ((data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) == + VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_4)) { - grub_dprintf("xfs", "XFS v4 superblock detected\n"); - if (!(data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_DIRV2BIT))) + VasEBoot_dprintf("xfs", "XFS v4 superblock detected\n"); + if (!(data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_DIRV2BIT))) { - grub_error (GRUB_ERR_BAD_FS, "XFS filesystem without V2 directories " + VasEBoot_error (VasEBoot_ERR_BAD_FS, "XFS filesystem without V2 directories " "is unsupported"); return 0; } - if (data->sblock.version & grub_cpu_to_be16_compile_time(~XFS_SB_VERSION_BITS_SUPPORTED) || - (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_MOREBITSBIT) && - data->sblock.features2 & grub_cpu_to_be16_compile_time(~XFS_SB_VERSION2_BITS_SUPPORTED))) + if (data->sblock.version & VasEBoot_cpu_to_be16_compile_time(~XFS_SB_VERSION_BITS_SUPPORTED) || + (data->sblock.version & VasEBoot_cpu_to_be16_compile_time(XFS_SB_VERSION_MOREBITSBIT) && + data->sblock.features2 & VasEBoot_cpu_to_be16_compile_time(~XFS_SB_VERSION2_BITS_SUPPORTED))) { - grub_error (GRUB_ERR_BAD_FS, "XFS filesystem has unsupported version " + VasEBoot_error (VasEBoot_ERR_BAD_FS, "XFS filesystem has unsupported version " "bits"); return 0; } @@ -297,174 +297,174 @@ static int grub_xfs_sb_valid(struct grub_xfs_data *data) #define FILETYPE_INO_SYMLINK 0120000 static inline int -GRUB_XFS_INO_AGBITS(struct grub_xfs_data *data) +VasEBoot_XFS_INO_AGBITS(struct VasEBoot_xfs_data *data) { return ((data)->sblock.log2_agblk + (data)->sblock.log2_inop); } -static inline grub_uint64_t -GRUB_XFS_INO_INOINAG (struct grub_xfs_data *data, - grub_uint64_t ino) +static inline VasEBoot_uint64_t +VasEBoot_XFS_INO_INOINAG (struct VasEBoot_xfs_data *data, + VasEBoot_uint64_t ino) { - return (ino & ((1LL << GRUB_XFS_INO_AGBITS (data)) - 1)); + return (ino & ((1LL << VasEBoot_XFS_INO_AGBITS (data)) - 1)); } -static inline grub_uint64_t -GRUB_XFS_INO_AG (struct grub_xfs_data *data, - grub_uint64_t ino) +static inline VasEBoot_uint64_t +VasEBoot_XFS_INO_AG (struct VasEBoot_xfs_data *data, + VasEBoot_uint64_t ino) { - return (ino >> GRUB_XFS_INO_AGBITS (data)); + return (ino >> VasEBoot_XFS_INO_AGBITS (data)); } -static inline grub_disk_addr_t -GRUB_XFS_FSB_TO_BLOCK (struct grub_xfs_data *data, grub_disk_addr_t fsb) +static inline VasEBoot_disk_addr_t +VasEBoot_XFS_FSB_TO_BLOCK (struct VasEBoot_xfs_data *data, VasEBoot_disk_addr_t fsb) { return ((fsb >> data->sblock.log2_agblk) * data->agsize + (fsb & ((1LL << data->sblock.log2_agblk) - 1))); } -static inline grub_uint64_t -GRUB_XFS_EXTENT_OFFSET (struct grub_xfs_extent *exts, int ex) +static inline VasEBoot_uint64_t +VasEBoot_XFS_EXTENT_OFFSET (struct VasEBoot_xfs_extent *exts, int ex) { - return ((grub_be_to_cpu32 (exts[ex].raw[0]) & ~(1 << 31)) << 23 - | grub_be_to_cpu32 (exts[ex].raw[1]) >> 9); + return ((VasEBoot_be_to_cpu32 (exts[ex].raw[0]) & ~(1 << 31)) << 23 + | VasEBoot_be_to_cpu32 (exts[ex].raw[1]) >> 9); } -static inline grub_uint64_t -GRUB_XFS_EXTENT_BLOCK (struct grub_xfs_extent *exts, int ex) +static inline VasEBoot_uint64_t +VasEBoot_XFS_EXTENT_BLOCK (struct VasEBoot_xfs_extent *exts, int ex) { - return ((grub_uint64_t) (grub_be_to_cpu32 (exts[ex].raw[1]) + return ((VasEBoot_uint64_t) (VasEBoot_be_to_cpu32 (exts[ex].raw[1]) & (0x1ff)) << 43 - | (grub_uint64_t) grub_be_to_cpu32 (exts[ex].raw[2]) << 11 - | grub_be_to_cpu32 (exts[ex].raw[3]) >> 21); + | (VasEBoot_uint64_t) VasEBoot_be_to_cpu32 (exts[ex].raw[2]) << 11 + | VasEBoot_be_to_cpu32 (exts[ex].raw[3]) >> 21); } -static inline grub_uint64_t -GRUB_XFS_EXTENT_SIZE (struct grub_xfs_extent *exts, int ex) +static inline VasEBoot_uint64_t +VasEBoot_XFS_EXTENT_SIZE (struct VasEBoot_xfs_extent *exts, int ex) { - return (grub_be_to_cpu32 (exts[ex].raw[3]) & ((1 << 21) - 1)); + return (VasEBoot_be_to_cpu32 (exts[ex].raw[3]) & ((1 << 21) - 1)); } -static inline grub_uint64_t -grub_xfs_inode_block (struct grub_xfs_data *data, - grub_uint64_t ino) +static inline VasEBoot_uint64_t +VasEBoot_xfs_inode_block (struct VasEBoot_xfs_data *data, + VasEBoot_uint64_t ino) { - long long int inoinag = GRUB_XFS_INO_INOINAG (data, ino); - long long ag = GRUB_XFS_INO_AG (data, ino); + long long int inoinag = VasEBoot_XFS_INO_INOINAG (data, ino); + long long ag = VasEBoot_XFS_INO_AG (data, ino); long long block; block = (inoinag >> data->sblock.log2_inop) + ag * data->agsize; - block <<= (data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS); + block <<= (data->sblock.log2_bsize - VasEBoot_DISK_SECTOR_BITS); return block; } static inline int -grub_xfs_inode_offset (struct grub_xfs_data *data, - grub_uint64_t ino) +VasEBoot_xfs_inode_offset (struct VasEBoot_xfs_data *data, + VasEBoot_uint64_t ino) { - int inoag = GRUB_XFS_INO_INOINAG (data, ino); + int inoag = VasEBoot_XFS_INO_INOINAG (data, ino); return ((inoag & ((1 << data->sblock.log2_inop) - 1)) << data->sblock.log2_inode); } -static inline grub_size_t -grub_xfs_inode_size(struct grub_xfs_data *data) +static inline VasEBoot_size_t +VasEBoot_xfs_inode_size(struct VasEBoot_xfs_data *data) { - return (grub_size_t)1 << data->sblock.log2_inode; + return (VasEBoot_size_t)1 << data->sblock.log2_inode; } /* * Returns size occupied by XFS inode stored in memory - we store struct - * grub_fshelp_node there but on disk inode size may be actually larger than - * struct grub_xfs_inode so we need to account for that so that we can read + * VasEBoot_fshelp_node there but on disk inode size may be actually larger than + * struct VasEBoot_xfs_inode so we need to account for that so that we can read * from disk directly into in-memory structure. */ -static inline grub_size_t -grub_xfs_fshelp_size(struct grub_xfs_data *data) +static inline VasEBoot_size_t +VasEBoot_xfs_fshelp_size(struct VasEBoot_xfs_data *data) { - return sizeof (struct grub_fshelp_node) - sizeof (struct grub_xfs_inode) - + grub_xfs_inode_size(data); + return sizeof (struct VasEBoot_fshelp_node) - sizeof (struct VasEBoot_xfs_inode) + + VasEBoot_xfs_inode_size(data); } /* This should return void * but XFS code is error-prone with alignment, so return char to retain cast-align. */ static char * -grub_xfs_inode_data(struct grub_xfs_inode *inode) +VasEBoot_xfs_inode_data(struct VasEBoot_xfs_inode *inode) { if (inode->version <= 2) return ((char *)inode) + XFS_V2_INODE_SIZE; return ((char *)inode) + XFS_V3_INODE_SIZE; } -static struct grub_xfs_dir_entry * -grub_xfs_inline_de(struct grub_xfs_dir_header *head) +static struct VasEBoot_xfs_dir_entry * +VasEBoot_xfs_inline_de(struct VasEBoot_xfs_dir_header *head) { /* With small inode numbers the header is 4 bytes smaller because of smaller parent pointer */ - return (struct grub_xfs_dir_entry *) - (((char *) head) + sizeof(struct grub_xfs_dir_header) - - (head->largeino ? 0 : sizeof(grub_uint32_t))); + return (struct VasEBoot_xfs_dir_entry *) + (((char *) head) + sizeof(struct VasEBoot_xfs_dir_header) - + (head->largeino ? 0 : sizeof(VasEBoot_uint32_t))); } -static grub_uint8_t * -grub_xfs_inline_de_inopos(struct grub_xfs_data *data, - struct grub_xfs_dir_entry *de) +static VasEBoot_uint8_t * +VasEBoot_xfs_inline_de_inopos(struct VasEBoot_xfs_data *data, + struct VasEBoot_xfs_dir_entry *de) { - return ((grub_uint8_t *)(de + 1)) + de->len - 1 + (data->hasftype ? 1 : 0); + return ((VasEBoot_uint8_t *)(de + 1)) + de->len - 1 + (data->hasftype ? 1 : 0); } -static struct grub_xfs_dir_entry * -grub_xfs_inline_next_de(struct grub_xfs_data *data, - struct grub_xfs_dir_header *head, - struct grub_xfs_dir_entry *de) +static struct VasEBoot_xfs_dir_entry * +VasEBoot_xfs_inline_next_de(struct VasEBoot_xfs_data *data, + struct VasEBoot_xfs_dir_header *head, + struct VasEBoot_xfs_dir_entry *de) { - char *p = (char *)de + sizeof(struct grub_xfs_dir_entry) - 1 + de->len; + char *p = (char *)de + sizeof(struct VasEBoot_xfs_dir_entry) - 1 + de->len; - p += head->largeino ? sizeof(grub_uint64_t) : sizeof(grub_uint32_t); + p += head->largeino ? sizeof(VasEBoot_uint64_t) : sizeof(VasEBoot_uint32_t); if (data->hasftype) p++; - return (struct grub_xfs_dir_entry *)p; + return (struct VasEBoot_xfs_dir_entry *)p; } -static struct grub_xfs_dirblock_tail * -grub_xfs_dir_tail(struct grub_xfs_data *data, void *dirblock) +static struct VasEBoot_xfs_dirblock_tail * +VasEBoot_xfs_dir_tail(struct VasEBoot_xfs_data *data, void *dirblock) { int dirblksize = 1 << (data->sblock.log2_bsize + data->sblock.log2_dirblk); - return (struct grub_xfs_dirblock_tail *) - ((char *)dirblock + dirblksize - sizeof (struct grub_xfs_dirblock_tail)); + return (struct VasEBoot_xfs_dirblock_tail *) + ((char *)dirblock + dirblksize - sizeof (struct VasEBoot_xfs_dirblock_tail)); } -static struct grub_xfs_dir2_entry * -grub_xfs_first_de(struct grub_xfs_data *data, void *dirblock) +static struct VasEBoot_xfs_dir2_entry * +VasEBoot_xfs_first_de(struct VasEBoot_xfs_data *data, void *dirblock) { if (data->hascrc) - return (struct grub_xfs_dir2_entry *)((char *)dirblock + 64); - return (struct grub_xfs_dir2_entry *)((char *)dirblock + 16); + return (struct VasEBoot_xfs_dir2_entry *)((char *)dirblock + 64); + return (struct VasEBoot_xfs_dir2_entry *)((char *)dirblock + 16); } -static struct grub_xfs_dir2_entry * -grub_xfs_next_de(struct grub_xfs_data *data, struct grub_xfs_dir2_entry *de) +static struct VasEBoot_xfs_dir2_entry * +VasEBoot_xfs_next_de(struct VasEBoot_xfs_data *data, struct VasEBoot_xfs_dir2_entry *de) { - int size = sizeof (struct grub_xfs_dir2_entry) + de->len + 2 /* Tag */; + int size = sizeof (struct VasEBoot_xfs_dir2_entry) + de->len + 2 /* Tag */; if (data->hasftype) size++; /* File type */ - return (struct grub_xfs_dir2_entry *)(((char *)de) + ALIGN_UP(size, 8)); + return (struct VasEBoot_xfs_dir2_entry *)(((char *)de) + ALIGN_UP(size, 8)); } /* This should return void * but XFS code is error-prone with alignment, so return char to retain cast-align. */ static char * -grub_xfs_btree_keys(struct grub_xfs_data *data, - struct grub_xfs_btree_node *leaf) +VasEBoot_xfs_btree_keys(struct VasEBoot_xfs_data *data, + struct VasEBoot_xfs_btree_node *leaf) { char *keys = (char *)(leaf + 1); @@ -473,60 +473,60 @@ grub_xfs_btree_keys(struct grub_xfs_data *data, return keys; } -static grub_err_t -grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, - struct grub_xfs_inode *inode) +static VasEBoot_err_t +VasEBoot_xfs_read_inode (struct VasEBoot_xfs_data *data, VasEBoot_uint64_t ino, + struct VasEBoot_xfs_inode *inode) { - grub_uint64_t block = grub_xfs_inode_block (data, ino); - int offset = grub_xfs_inode_offset (data, ino); + VasEBoot_uint64_t block = VasEBoot_xfs_inode_block (data, ino); + int offset = VasEBoot_xfs_inode_offset (data, ino); - grub_dprintf("xfs", "Reading inode (%"PRIuGRUB_UINT64_T") - %"PRIuGRUB_UINT64_T", %d\n", + VasEBoot_dprintf("xfs", "Reading inode (%"PRIuVasEBoot_UINT64_T") - %"PRIuVasEBoot_UINT64_T", %d\n", ino, block, offset); /* Read the inode. */ - if (grub_disk_read (data->disk, block, offset, grub_xfs_inode_size(data), + if (VasEBoot_disk_read (data->disk, block, offset, VasEBoot_xfs_inode_size(data), inode)) - return grub_errno; + return VasEBoot_errno; - if (grub_strncmp ((char *) inode->magic, "IN", 2)) - return grub_error (GRUB_ERR_BAD_FS, "not a correct XFS inode"); + if (VasEBoot_strncmp ((char *) inode->magic, "IN", 2)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a correct XFS inode"); return 0; } -static grub_uint64_t +static VasEBoot_uint64_t get_fsb (const void *keys, int idx) { - const char *p = (const char *) keys + sizeof(grub_uint64_t) * idx; - return grub_be_to_cpu64 (grub_get_unaligned64 (p)); + const char *p = (const char *) keys + sizeof(VasEBoot_uint64_t) * idx; + return VasEBoot_be_to_cpu64 (VasEBoot_get_unaligned64 (p)); } -static grub_disk_addr_t -grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) +static VasEBoot_disk_addr_t +VasEBoot_xfs_read_block (VasEBoot_fshelp_node_t node, VasEBoot_disk_addr_t fileblock) { - struct grub_xfs_btree_node *leaf = 0; + struct VasEBoot_xfs_btree_node *leaf = 0; int ex, nrec; - struct grub_xfs_extent *exts; - grub_uint64_t ret = 0; + struct VasEBoot_xfs_extent *exts; + VasEBoot_uint64_t ret = 0; if (node->inode.format == XFS_INODE_FORMAT_BTREE) { - struct grub_xfs_btree_root *root; + struct VasEBoot_xfs_btree_root *root; const char *keys; int recoffset; - leaf = grub_malloc (node->data->bsize); + leaf = VasEBoot_malloc (node->data->bsize); if (leaf == 0) return 0; - root = (struct grub_xfs_btree_root *) grub_xfs_inode_data(&node->inode); - nrec = grub_be_to_cpu16 (root->numrecs); + root = (struct VasEBoot_xfs_btree_root *) VasEBoot_xfs_inode_data(&node->inode); + nrec = VasEBoot_be_to_cpu16 (root->numrecs); keys = (char *) &root->keys[0]; if (node->inode.fork_offset) recoffset = (node->inode.fork_offset - 1) / 2; else - recoffset = (grub_xfs_inode_size(node->data) + recoffset = (VasEBoot_xfs_inode_size(node->data) - ((char *) keys - (char *) &node->inode)) - / (2 * sizeof (grub_uint64_t)); + / (2 * sizeof (VasEBoot_uint64_t)); do { int i; @@ -540,42 +540,42 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) /* Sparse block. */ if (i == 0) { - grub_free (leaf); + VasEBoot_free (leaf); return 0; } - if (grub_disk_read (node->data->disk, - GRUB_XFS_FSB_TO_BLOCK (node->data, get_fsb (keys, i - 1 + recoffset)) << (node->data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS), + if (VasEBoot_disk_read (node->data->disk, + VasEBoot_XFS_FSB_TO_BLOCK (node->data, get_fsb (keys, i - 1 + recoffset)) << (node->data->sblock.log2_bsize - VasEBoot_DISK_SECTOR_BITS), 0, node->data->bsize, leaf)) return 0; if ((!node->data->hascrc && - grub_strncmp ((char *) leaf->magic, "BMAP", 4)) || + VasEBoot_strncmp ((char *) leaf->magic, "BMAP", 4)) || (node->data->hascrc && - grub_strncmp ((char *) leaf->magic, "BMA3", 4))) + VasEBoot_strncmp ((char *) leaf->magic, "BMA3", 4))) { - grub_free (leaf); - grub_error (GRUB_ERR_BAD_FS, "not a correct XFS BMAP node"); + VasEBoot_free (leaf); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a correct XFS BMAP node"); return 0; } - nrec = grub_be_to_cpu16 (leaf->numrecs); - keys = grub_xfs_btree_keys(node->data, leaf); + nrec = VasEBoot_be_to_cpu16 (leaf->numrecs); + keys = VasEBoot_xfs_btree_keys(node->data, leaf); recoffset = ((node->data->bsize - ((char *) keys - (char *) leaf)) - / (2 * sizeof (grub_uint64_t))); + / (2 * sizeof (VasEBoot_uint64_t))); } while (leaf->level); - exts = (struct grub_xfs_extent *) keys; + exts = (struct VasEBoot_xfs_extent *) keys; } else if (node->inode.format == XFS_INODE_FORMAT_EXT) { - nrec = grub_be_to_cpu32 (node->inode.nextents); - exts = (struct grub_xfs_extent *) grub_xfs_inode_data(&node->inode); + nrec = VasEBoot_be_to_cpu32 (node->inode.nextents); + exts = (struct VasEBoot_xfs_extent *) VasEBoot_xfs_inode_data(&node->inode); } else { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "XFS does not support inode format %d yet", node->inode.format); return 0; @@ -585,9 +585,9 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) the block we are looking for. */ for (ex = 0; ex < nrec; ex++) { - grub_uint64_t start = GRUB_XFS_EXTENT_BLOCK (exts, ex); - grub_uint64_t offset = GRUB_XFS_EXTENT_OFFSET (exts, ex); - grub_uint64_t size = GRUB_XFS_EXTENT_SIZE (exts, ex); + VasEBoot_uint64_t start = VasEBoot_XFS_EXTENT_BLOCK (exts, ex); + VasEBoot_uint64_t offset = VasEBoot_XFS_EXTENT_OFFSET (exts, ex); + VasEBoot_uint64_t size = VasEBoot_XFS_EXTENT_SIZE (exts, ex); /* Sparse block. */ if (fileblock < offset) @@ -599,62 +599,62 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) } } - grub_free (leaf); + VasEBoot_free (leaf); - return GRUB_XFS_FSB_TO_BLOCK(node->data, ret); + return VasEBoot_XFS_FSB_TO_BLOCK(node->data, ret); } /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ -static grub_ssize_t -grub_xfs_read_file (grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf, grub_uint32_t header_size) +static VasEBoot_ssize_t +VasEBoot_xfs_read_file (VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf, VasEBoot_uint32_t header_size) { - return grub_fshelp_read_file (node->data->disk, node, + return VasEBoot_fshelp_read_file (node->data->disk, node, read_hook, read_hook_data, - pos, len, buf, grub_xfs_read_block, - grub_be_to_cpu64 (node->inode.size) + header_size, + pos, len, buf, VasEBoot_xfs_read_block, + VasEBoot_be_to_cpu64 (node->inode.size) + header_size, node->data->sblock.log2_bsize - - GRUB_DISK_SECTOR_BITS, 0); + - VasEBoot_DISK_SECTOR_BITS, 0); } static char * -grub_xfs_read_symlink (grub_fshelp_node_t node) +VasEBoot_xfs_read_symlink (VasEBoot_fshelp_node_t node) { - grub_ssize_t size = grub_be_to_cpu64 (node->inode.size); + VasEBoot_ssize_t size = VasEBoot_be_to_cpu64 (node->inode.size); if (size < 0) { - grub_error (GRUB_ERR_BAD_FS, "invalid symlink"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid symlink"); return 0; } switch (node->inode.format) { case XFS_INODE_FORMAT_INO: - return grub_strndup (grub_xfs_inode_data(&node->inode), size); + return VasEBoot_strndup (VasEBoot_xfs_inode_data(&node->inode), size); case XFS_INODE_FORMAT_EXT: { char *symlink; - grub_ssize_t numread; + VasEBoot_ssize_t numread; int off = 0; if (node->data->hascrc) off = 56; - symlink = grub_malloc (size + 1); + symlink = VasEBoot_malloc (size + 1); if (!symlink) return 0; - node->inode.size = grub_be_to_cpu64 (size + off); - numread = grub_xfs_read_file (node, 0, 0, off, size, symlink, off); + node->inode.size = VasEBoot_be_to_cpu64 (size + off); + numread = VasEBoot_xfs_read_file (node, 0, 0, off, size, symlink, off); if (numread != size) { - grub_free (symlink); + VasEBoot_free (symlink); return 0; } symlink[size] = '\0'; @@ -666,41 +666,41 @@ grub_xfs_read_symlink (grub_fshelp_node_t node) } -static enum grub_fshelp_filetype -grub_xfs_mode_to_filetype (grub_uint16_t mode) +static enum VasEBoot_fshelp_filetype +VasEBoot_xfs_mode_to_filetype (VasEBoot_uint16_t mode) { - if ((grub_be_to_cpu16 (mode) + if ((VasEBoot_be_to_cpu16 (mode) & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY) - return GRUB_FSHELP_DIR; - else if ((grub_be_to_cpu16 (mode) + return VasEBoot_FSHELP_DIR; + else if ((VasEBoot_be_to_cpu16 (mode) & FILETYPE_INO_MASK) == FILETYPE_INO_SYMLINK) - return GRUB_FSHELP_SYMLINK; - else if ((grub_be_to_cpu16 (mode) + return VasEBoot_FSHELP_SYMLINK; + else if ((VasEBoot_be_to_cpu16 (mode) & FILETYPE_INO_MASK) == FILETYPE_INO_REG) - return GRUB_FSHELP_REG; - return GRUB_FSHELP_UNKNOWN; + return VasEBoot_FSHELP_REG; + return VasEBoot_FSHELP_UNKNOWN; } -/* Context for grub_xfs_iterate_dir. */ -struct grub_xfs_iterate_dir_ctx +/* Context for VasEBoot_xfs_iterate_dir. */ +struct VasEBoot_xfs_iterate_dir_ctx { - grub_fshelp_iterate_dir_hook_t hook; + VasEBoot_fshelp_iterate_dir_hook_t hook; void *hook_data; - struct grub_fshelp_node *diro; + struct VasEBoot_fshelp_node *diro; }; -/* Helper for grub_xfs_iterate_dir. */ -static int iterate_dir_call_hook (grub_uint64_t ino, const char *filename, - struct grub_xfs_iterate_dir_ctx *ctx) +/* Helper for VasEBoot_xfs_iterate_dir. */ +static int iterate_dir_call_hook (VasEBoot_uint64_t ino, const char *filename, + struct VasEBoot_xfs_iterate_dir_ctx *ctx) { - struct grub_fshelp_node *fdiro; - grub_err_t err; + struct VasEBoot_fshelp_node *fdiro; + VasEBoot_err_t err; - fdiro = grub_malloc (grub_xfs_fshelp_size(ctx->diro->data) + 1); + fdiro = VasEBoot_malloc (VasEBoot_xfs_fshelp_size(ctx->diro->data) + 1); if (!fdiro) { - grub_print_error (); + VasEBoot_print_error (); return 0; } @@ -709,23 +709,23 @@ static int iterate_dir_call_hook (grub_uint64_t ino, const char *filename, fdiro->ino = ino; fdiro->inode_read = 1; fdiro->data = ctx->diro->data; - err = grub_xfs_read_inode (ctx->diro->data, ino, &fdiro->inode); + err = VasEBoot_xfs_read_inode (ctx->diro->data, ino, &fdiro->inode); if (err) { - grub_print_error (); + VasEBoot_print_error (); return 0; } - return ctx->hook (filename, grub_xfs_mode_to_filetype (fdiro->inode.mode), + return ctx->hook (filename, VasEBoot_xfs_mode_to_filetype (fdiro->inode.mode), fdiro, ctx->hook_data); } static int -grub_xfs_iterate_dir (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, void *hook_data) +VasEBoot_xfs_iterate_dir (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data) { - struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; - struct grub_xfs_iterate_dir_ctx ctx = { + struct VasEBoot_fshelp_node *diro = (struct VasEBoot_fshelp_node *) dir; + struct VasEBoot_xfs_iterate_dir_ctx ctx = { .hook = hook, .hook_data = hook_data, .diro = diro @@ -735,18 +735,18 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, { case XFS_INODE_FORMAT_INO: { - struct grub_xfs_dir_header *head = (struct grub_xfs_dir_header *) grub_xfs_inode_data(&diro->inode); - struct grub_xfs_dir_entry *de = grub_xfs_inline_de(head); + struct VasEBoot_xfs_dir_header *head = (struct VasEBoot_xfs_dir_header *) VasEBoot_xfs_inode_data(&diro->inode); + struct VasEBoot_xfs_dir_entry *de = VasEBoot_xfs_inline_de(head); int smallino = !head->largeino; int i; - grub_uint64_t parent; + VasEBoot_uint64_t parent; /* If small inode numbers are used to pack the direntry, the parent inode number is small too. */ if (smallino) - parent = grub_be_to_cpu32 (head->parent.i4); + parent = VasEBoot_be_to_cpu32 (head->parent.i4); else - parent = grub_be_to_cpu64 (head->parent.i8); + parent = VasEBoot_be_to_cpu64 (head->parent.i8); /* Synthesize the direntries for `.' and `..'. */ if (iterate_dir_call_hook (diro->ino, ".", &ctx)) @@ -757,25 +757,25 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, for (i = 0; i < head->count; i++) { - grub_uint64_t ino; - grub_uint8_t *inopos = grub_xfs_inline_de_inopos(dir->data, de); - grub_uint8_t c; + VasEBoot_uint64_t ino; + VasEBoot_uint8_t *inopos = VasEBoot_xfs_inline_de_inopos(dir->data, de); + VasEBoot_uint8_t c; /* inopos might be unaligned. */ if (smallino) - ino = (((grub_uint32_t) inopos[0]) << 24) - | (((grub_uint32_t) inopos[1]) << 16) - | (((grub_uint32_t) inopos[2]) << 8) - | (((grub_uint32_t) inopos[3]) << 0); + ino = (((VasEBoot_uint32_t) inopos[0]) << 24) + | (((VasEBoot_uint32_t) inopos[1]) << 16) + | (((VasEBoot_uint32_t) inopos[2]) << 8) + | (((VasEBoot_uint32_t) inopos[3]) << 0); else - ino = (((grub_uint64_t) inopos[0]) << 56) - | (((grub_uint64_t) inopos[1]) << 48) - | (((grub_uint64_t) inopos[2]) << 40) - | (((grub_uint64_t) inopos[3]) << 32) - | (((grub_uint64_t) inopos[4]) << 24) - | (((grub_uint64_t) inopos[5]) << 16) - | (((grub_uint64_t) inopos[6]) << 8) - | (((grub_uint64_t) inopos[7]) << 0); + ino = (((VasEBoot_uint64_t) inopos[0]) << 56) + | (((VasEBoot_uint64_t) inopos[1]) << 48) + | (((VasEBoot_uint64_t) inopos[2]) << 40) + | (((VasEBoot_uint64_t) inopos[3]) << 32) + | (((VasEBoot_uint64_t) inopos[4]) << 24) + | (((VasEBoot_uint64_t) inopos[5]) << 16) + | (((VasEBoot_uint64_t) inopos[6]) << 8) + | (((VasEBoot_uint64_t) inopos[7]) << 0); c = de->name[de->len]; de->name[de->len] = '\0'; @@ -786,7 +786,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, } de->name[de->len] = c; - de = grub_xfs_inline_next_de(dir->data, head, de); + de = VasEBoot_xfs_inline_next_de(dir->data, head, de); } break; } @@ -794,69 +794,69 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, case XFS_INODE_FORMAT_BTREE: case XFS_INODE_FORMAT_EXT: { - grub_ssize_t numread; + VasEBoot_ssize_t numread; char *dirblock; - grub_uint64_t blk; + VasEBoot_uint64_t blk; int dirblk_size, dirblk_log2; dirblk_log2 = (dir->data->sblock.log2_bsize + dir->data->sblock.log2_dirblk); dirblk_size = 1 << dirblk_log2; - dirblock = grub_malloc (dirblk_size); + dirblock = VasEBoot_malloc (dirblk_size); if (! dirblock) return 0; /* Iterate over every block the directory has. */ for (blk = 0; - blk < (grub_be_to_cpu64 (dir->inode.size) + blk < (VasEBoot_be_to_cpu64 (dir->inode.size) >> dirblk_log2); blk++) { - struct grub_xfs_dir2_entry *direntry = - grub_xfs_first_de(dir->data, dirblock); + struct VasEBoot_xfs_dir2_entry *direntry = + VasEBoot_xfs_first_de(dir->data, dirblock); int entries; - struct grub_xfs_dirblock_tail *tail = - grub_xfs_dir_tail(dir->data, dirblock); + struct VasEBoot_xfs_dirblock_tail *tail = + VasEBoot_xfs_dir_tail(dir->data, dirblock); - numread = grub_xfs_read_file (dir, 0, 0, + numread = VasEBoot_xfs_read_file (dir, 0, 0, blk << dirblk_log2, dirblk_size, dirblock, 0); if (numread != dirblk_size) return 0; - entries = (grub_be_to_cpu32 (tail->leaf_count) - - grub_be_to_cpu32 (tail->leaf_stale)); + entries = (VasEBoot_be_to_cpu32 (tail->leaf_count) + - VasEBoot_be_to_cpu32 (tail->leaf_stale)); /* Iterate over all entries within this block. */ while ((char *)direntry < (char *)tail) { - grub_uint8_t *freetag; + VasEBoot_uint8_t *freetag; char *filename; - freetag = (grub_uint8_t *) direntry; + freetag = (VasEBoot_uint8_t *) direntry; - if (grub_get_unaligned16 (freetag) == 0XFFFF) + if (VasEBoot_get_unaligned16 (freetag) == 0XFFFF) { - grub_uint8_t *skip = (freetag + sizeof (grub_uint16_t)); + VasEBoot_uint8_t *skip = (freetag + sizeof (VasEBoot_uint16_t)); /* This entry is not used, go to the next one. */ - direntry = (struct grub_xfs_dir2_entry *) + direntry = (struct VasEBoot_xfs_dir2_entry *) (((char *)direntry) + - grub_be_to_cpu16 (grub_get_unaligned16 (skip))); + VasEBoot_be_to_cpu16 (VasEBoot_get_unaligned16 (skip))); continue; } filename = (char *)(direntry + 1); /* The byte after the filename is for the filetype, padding, or - tag, which is not used by GRUB. So it can be overwritten. */ + tag, which is not used by VasEBoot. So it can be overwritten. */ filename[direntry->len] = '\0'; - if (iterate_dir_call_hook (grub_be_to_cpu64(direntry->inode), + if (iterate_dir_call_hook (VasEBoot_be_to_cpu64(direntry->inode), filename, &ctx)) { - grub_free (dirblock); + VasEBoot_free (dirblock); return 1; } @@ -867,15 +867,15 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, break; /* Select the next directory entry. */ - direntry = grub_xfs_next_de(dir->data, direntry); + direntry = VasEBoot_xfs_next_de(dir->data, direntry); } } - grub_free (dirblock); + VasEBoot_free (dirblock); break; } default: - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "XFS does not support inode format %d yet", diro->inode.format); } @@ -883,151 +883,151 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, } -static struct grub_xfs_data * -grub_xfs_mount (grub_disk_t disk) +static struct VasEBoot_xfs_data * +VasEBoot_xfs_mount (VasEBoot_disk_t disk) { - struct grub_xfs_data *data = 0; + struct VasEBoot_xfs_data *data = 0; - data = grub_zalloc (sizeof (struct grub_xfs_data)); + data = VasEBoot_zalloc (sizeof (struct VasEBoot_xfs_data)); if (!data) return 0; - grub_dprintf("xfs", "Reading sb\n"); + VasEBoot_dprintf("xfs", "Reading sb\n"); /* Read the superblock. */ - if (grub_disk_read (disk, 0, 0, - sizeof (struct grub_xfs_sblock), &data->sblock)) + if (VasEBoot_disk_read (disk, 0, 0, + sizeof (struct VasEBoot_xfs_sblock), &data->sblock)) goto fail; - if (!grub_xfs_sb_valid(data)) + if (!VasEBoot_xfs_sb_valid(data)) goto fail; - data = grub_realloc (data, - sizeof (struct grub_xfs_data) - - sizeof (struct grub_xfs_inode) - + grub_xfs_inode_size(data) + 1); + data = VasEBoot_realloc (data, + sizeof (struct VasEBoot_xfs_data) + - sizeof (struct VasEBoot_xfs_inode) + + VasEBoot_xfs_inode_size(data) + 1); if (! data) goto fail; data->diropen.data = data; - data->diropen.ino = grub_be_to_cpu64(data->sblock.rootino); + data->diropen.ino = VasEBoot_be_to_cpu64(data->sblock.rootino); data->diropen.inode_read = 1; - data->bsize = grub_be_to_cpu32 (data->sblock.bsize); - data->agsize = grub_be_to_cpu32 (data->sblock.agsize); - data->hasftype = grub_xfs_sb_hasftype(data); - data->hascrc = grub_xfs_sb_hascrc(data); + data->bsize = VasEBoot_be_to_cpu32 (data->sblock.bsize); + data->agsize = VasEBoot_be_to_cpu32 (data->sblock.agsize); + data->hasftype = VasEBoot_xfs_sb_hasftype(data); + data->hascrc = VasEBoot_xfs_sb_hascrc(data); data->disk = disk; data->pos = 0; - grub_dprintf("xfs", "Reading root ino %"PRIuGRUB_UINT64_T"\n", - grub_cpu_to_be64(data->sblock.rootino)); + VasEBoot_dprintf("xfs", "Reading root ino %"PRIuVasEBoot_UINT64_T"\n", + VasEBoot_cpu_to_be64(data->sblock.rootino)); - grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode); + VasEBoot_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode); return data; fail: - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not an XFS filesystem"); + if (VasEBoot_errno == VasEBoot_ERR_OUT_OF_RANGE) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "not an XFS filesystem"); - grub_free (data); + VasEBoot_free (data); return 0; } -/* Context for grub_xfs_dir. */ -struct grub_xfs_dir_ctx +/* Context for VasEBoot_xfs_dir. */ +struct VasEBoot_xfs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; }; -/* Helper for grub_xfs_dir. */ +/* Helper for VasEBoot_xfs_dir. */ static int -grub_xfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, void *data) +VasEBoot_xfs_dir_iter (const char *filename, enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data) { - struct grub_xfs_dir_ctx *ctx = data; - struct grub_dirhook_info info; + struct VasEBoot_xfs_dir_ctx *ctx = data; + struct VasEBoot_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); if (node->inode_read) { info.mtimeset = 1; - info.mtime = grub_be_to_cpu32 (node->inode.mtime.sec); + info.mtime = VasEBoot_be_to_cpu32 (node->inode.mtime.sec); } - info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); - grub_free (node); + info.dir = ((filetype & VasEBoot_FSHELP_TYPE_MASK) == VasEBoot_FSHELP_DIR); + VasEBoot_free (node); return ctx->hook (filename, &info, ctx->hook_data); } -static grub_err_t -grub_xfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_xfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_xfs_dir_ctx ctx = { hook, hook_data }; - struct grub_xfs_data *data = 0; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_xfs_dir_ctx ctx = { hook, hook_data }; + struct VasEBoot_xfs_data *data = 0; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_xfs_mount (device->disk); + data = VasEBoot_xfs_mount (device->disk); if (!data) goto mount_fail; - grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_xfs_iterate_dir, - grub_xfs_read_symlink, GRUB_FSHELP_DIR); - if (grub_errno) + VasEBoot_fshelp_find_file (path, &data->diropen, &fdiro, VasEBoot_xfs_iterate_dir, + VasEBoot_xfs_read_symlink, VasEBoot_FSHELP_DIR); + if (VasEBoot_errno) goto fail; - grub_xfs_iterate_dir (fdiro, grub_xfs_dir_iter, &ctx); + VasEBoot_xfs_iterate_dir (fdiro, VasEBoot_xfs_dir_iter, &ctx); fail: if (fdiro != &data->diropen) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); mount_fail: - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_xfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_xfs_open (struct VasEBoot_file *file, const char *name) { - struct grub_xfs_data *data; - struct grub_fshelp_node *fdiro = 0; + struct VasEBoot_xfs_data *data; + struct VasEBoot_fshelp_node *fdiro = 0; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_xfs_mount (file->device->disk); + data = VasEBoot_xfs_mount (file->device->disk); if (!data) goto mount_fail; - grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_xfs_iterate_dir, - grub_xfs_read_symlink, GRUB_FSHELP_REG); - if (grub_errno) + VasEBoot_fshelp_find_file (name, &data->diropen, &fdiro, VasEBoot_xfs_iterate_dir, + VasEBoot_xfs_read_symlink, VasEBoot_FSHELP_REG); + if (VasEBoot_errno) goto fail; if (!fdiro->inode_read) { - grub_xfs_read_inode (data, fdiro->ino, &fdiro->inode); - if (grub_errno) + VasEBoot_xfs_read_inode (data, fdiro->ino, &fdiro->inode); + if (VasEBoot_errno) goto fail; } if (fdiro != &data->diropen) { - grub_memcpy (&data->diropen, fdiro, grub_xfs_fshelp_size(data)); - grub_free (fdiro); + VasEBoot_memcpy (&data->diropen, fdiro, VasEBoot_xfs_fshelp_size(data)); + VasEBoot_free (fdiro); } - file->size = grub_be_to_cpu64 (data->diropen.inode.size); + file->size = VasEBoot_be_to_cpu64 (data->diropen.inode.size); file->data = data; file->offset = 0; @@ -1035,116 +1035,116 @@ grub_xfs_open (struct grub_file *file, const char *name) fail: if (fdiro != &data->diropen) - grub_free (fdiro); - grub_free (data); + VasEBoot_free (fdiro); + VasEBoot_free (data); mount_fail: - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_ssize_t -grub_xfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_xfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_xfs_data *data = - (struct grub_xfs_data *) file->data; + struct VasEBoot_xfs_data *data = + (struct VasEBoot_xfs_data *) file->data; - return grub_xfs_read_file (&data->diropen, + return VasEBoot_xfs_read_file (&data->diropen, file->read_hook, file->read_hook_data, file->offset, len, buf, 0); } -static grub_err_t -grub_xfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_xfs_close (VasEBoot_file_t file) { - grub_free (file->data); + VasEBoot_free (file->data); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_xfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +VasEBoot_xfs_label (VasEBoot_device_t device, char **label) { - struct grub_xfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_xfs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_xfs_mount (disk); + data = VasEBoot_xfs_mount (disk); if (data) - *label = grub_strndup ((char *) (data->sblock.label), 12); + *label = VasEBoot_strndup ((char *) (data->sblock.label), 12); else *label = 0; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_xfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +VasEBoot_xfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_xfs_data *data; - grub_disk_t disk = device->disk; + struct VasEBoot_xfs_data *data; + VasEBoot_disk_t disk = device->disk; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - data = grub_xfs_mount (disk); + data = VasEBoot_xfs_mount (disk); if (data) { - *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])); + *uuid = VasEBoot_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + VasEBoot_be_to_cpu16 (data->sblock.uuid[0]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[1]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[2]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[3]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[4]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[5]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[6]), + VasEBoot_be_to_cpu16 (data->sblock.uuid[7])); } else *uuid = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (data); + VasEBoot_free (data); - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_xfs_fs = +static struct VasEBoot_fs VasEBoot_xfs_fs = { .name = "xfs", - .dir = grub_xfs_dir, - .open = grub_xfs_open, - .read = grub_xfs_read, - .close = grub_xfs_close, - .label = grub_xfs_label, - .uuid = grub_xfs_uuid, -#ifdef GRUB_UTIL + .dir = VasEBoot_xfs_dir, + .open = VasEBoot_xfs_open, + .read = VasEBoot_xfs_read, + .close = VasEBoot_xfs_close, + .label = VasEBoot_xfs_label, + .uuid = VasEBoot_xfs_uuid, +#ifdef VasEBoot_UTIL .reserved_first_sector = 0, .blocklist_install = 1, #endif .next = 0 }; -GRUB_MOD_INIT(xfs) +VasEBoot_MOD_INIT(xfs) { - grub_fs_register (&grub_xfs_fs); + VasEBoot_fs_register (&VasEBoot_xfs_fs); my_mod = mod; } -GRUB_MOD_FINI(xfs) +VasEBoot_MOD_FINI(xfs) { - grub_fs_unregister (&grub_xfs_fs); + VasEBoot_fs_unregister (&VasEBoot_xfs_fs); } diff --git a/VasEBoot-core/fs/zfs/zfs.c b/VasEBoot-core/fs/zfs/zfs.c index 6e1fff9e9..db8daf71a 100644 --- a/VasEBoot-core/fs/zfs/zfs.c +++ b/VasEBoot-core/fs/zfs/zfs.c @@ -1,24 +1,24 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009,2010,2011 Free Software Foundation, Inc. * Copyright 2010 Sun Microsystems, Inc. * Copyright (c) 2012 by Delphix. All rights reserved. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* - * The zfs plug-in routines for GRUB are: + * The zfs plug-in routines for VasEBoot are: * * zfs_mount() - locates a valid uberblock of the root pool and reads * in its MOS at the memory address MOS. @@ -30,33 +30,33 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define ZPOOL_PROP_BOOTFS "bootfs" @@ -72,14 +72,14 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define DATA_TYPE_NVLIST 19 #define DATA_TYPE_NVLIST_ARRAY 20 -#ifndef GRUB_UTIL -static grub_dl_t my_mod; +#ifndef VasEBoot_UTIL +static VasEBoot_dl_t my_mod; #endif #define P2PHASE(x, align) ((x) & ((align) - 1)) -static inline grub_disk_addr_t -DVA_OFFSET_TO_PHYS_SECTOR (grub_disk_addr_t offset) +static inline VasEBoot_disk_addr_t +DVA_OFFSET_TO_PHYS_SECTOR (VasEBoot_disk_addr_t offset) { return ((offset + VDEV_LABEL_START_SIZE) >> SPA_MINBLOCKSHIFT); } @@ -88,8 +88,8 @@ DVA_OFFSET_TO_PHYS_SECTOR (grub_disk_addr_t offset) * FAT ZAP data structures */ #define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */ -static inline grub_uint64_t -ZAP_HASH_IDX (grub_uint64_t hash, grub_uint64_t n) +static inline VasEBoot_uint64_t +ZAP_HASH_IDX (VasEBoot_uint64_t hash, VasEBoot_uint64_t n) { return (((n) == 0) ? 0 : ((hash) >> (64 - (n)))); } @@ -114,8 +114,8 @@ ZAP_LEAF_HASH_NUMENTRIES (int bs) return 1 << ZAP_LEAF_HASH_SHIFT(bs); } -static inline grub_size_t -LEAF_HASH (int bs, grub_uint64_t h, zap_leaf_phys_t *l) +static inline VasEBoot_size_t +LEAF_HASH (int bs, VasEBoot_uint64_t h, zap_leaf_phys_t *l) { return ((ZAP_LEAF_HASH_NUMENTRIES (bs)-1) & ((h) >> (64 - ZAP_LEAF_HASH_SHIFT (bs) - l->l_hdr.lh_prefix_len))); @@ -143,7 +143,7 @@ ZAP_LEAF_CHUNK (zap_leaf_phys_t *l, int bs, int idx) { return &((zap_leaf_chunk_t *) (l->l_entries + (ZAP_LEAF_HASH_NUMENTRIES(bs) * 2) - / sizeof (grub_properly_aligned_t)))[idx]; + / sizeof (VasEBoot_properly_aligned_t)))[idx]; } static inline struct zap_leaf_entry * @@ -157,12 +157,12 @@ ZAP_LEAF_ENTRY(zap_leaf_phys_t *l, int bs, int idx) * Decompression Entry - lzjb & lz4 */ -extern grub_err_t lzjb_decompress (void *, void *, grub_size_t, grub_size_t); +extern VasEBoot_err_t lzjb_decompress (void *, void *, VasEBoot_size_t, VasEBoot_size_t); -extern grub_err_t lz4_decompress (void *, void *, grub_size_t, grub_size_t); +extern VasEBoot_err_t lz4_decompress (void *, void *, VasEBoot_size_t, VasEBoot_size_t); -typedef grub_err_t zfs_decomp_func_t (void *s_start, void *d_start, - grub_size_t s_len, grub_size_t d_len); +typedef VasEBoot_err_t zfs_decomp_func_t (void *s_start, void *d_start, + VasEBoot_size_t s_len, VasEBoot_size_t d_len); typedef struct decomp_entry { const char *name; @@ -172,8 +172,8 @@ typedef struct decomp_entry /* * Signature for checksum functions. */ -typedef void zio_checksum_t(const void *data, grub_uint64_t size, - grub_zfs_endian_t endian, zio_cksum_t *zcp); +typedef void zio_checksum_t(const void *data, VasEBoot_uint64_t size, + VasEBoot_zfs_endian_t endian, zio_cksum_t *zcp); /* * Information about each checksum function. @@ -188,27 +188,27 @@ typedef struct zio_checksum_info { typedef struct dnode_end { dnode_phys_t dn; - grub_zfs_endian_t endian; + VasEBoot_zfs_endian_t endian; } dnode_end_t; -struct grub_zfs_device_desc +struct VasEBoot_zfs_device_desc { enum { DEVICE_LEAF, DEVICE_MIRROR, DEVICE_RAIDZ } type; - grub_uint64_t id; - grub_uint64_t guid; + VasEBoot_uint64_t id; + VasEBoot_uint64_t guid; unsigned ashift; unsigned max_children_ashift; /* Valid only for non-leafs. */ unsigned n_children; - struct grub_zfs_device_desc *children; + struct VasEBoot_zfs_device_desc *children; /* Valid only for RAIDZ. */ unsigned nparity; /* Valid only for leaf devices. */ - grub_device_t dev; - grub_disk_addr_t vdev_phys_sector; + VasEBoot_device_t dev; + VasEBoot_disk_addr_t vdev_phys_sector; uberblock_t current_uberblock; int original; }; @@ -216,67 +216,67 @@ struct grub_zfs_device_desc struct subvolume { dnode_end_t mdn; - grub_uint64_t obj; - grub_uint64_t case_insensitive; - grub_size_t nkeys; + VasEBoot_uint64_t obj; + VasEBoot_uint64_t case_insensitive; + VasEBoot_size_t nkeys; struct { - grub_crypto_cipher_handle_t cipher; - grub_uint64_t txg; - grub_uint64_t algo; + VasEBoot_crypto_cipher_handle_t cipher; + VasEBoot_uint64_t txg; + VasEBoot_uint64_t algo; } *keyring; }; -struct grub_zfs_data +struct VasEBoot_zfs_data { /* cache for a file block of the currently zfs_open()-ed file */ char *file_buf; - grub_uint64_t file_start; - grub_uint64_t file_end; + VasEBoot_uint64_t file_start; + VasEBoot_uint64_t file_end; /* cache for a dnode block */ dnode_phys_t *dnode_buf; dnode_phys_t *dnode_mdn; - grub_uint64_t dnode_start; - grub_uint64_t dnode_end; - grub_zfs_endian_t dnode_endian; + VasEBoot_uint64_t dnode_start; + VasEBoot_uint64_t dnode_end; + VasEBoot_zfs_endian_t dnode_endian; dnode_end_t mos; dnode_end_t dnode; struct subvolume subvol; - struct grub_zfs_device_desc *devices_attached; + struct VasEBoot_zfs_device_desc *devices_attached; unsigned n_devices_attached; unsigned n_devices_allocated; - struct grub_zfs_device_desc *device_original; + struct VasEBoot_zfs_device_desc *device_original; uberblock_t current_uberblock; - grub_uint64_t guid; + VasEBoot_uint64_t guid; }; -/* Context for grub_zfs_dir. */ -struct grub_zfs_dir_ctx +/* Context for VasEBoot_zfs_dir. */ +struct VasEBoot_zfs_dir_ctx { - grub_fs_dir_hook_t hook; + VasEBoot_fs_dir_hook_t hook; void *hook_data; - struct grub_zfs_data *data; + struct VasEBoot_zfs_data *data; }; -grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher, - grub_uint64_t algo, +VasEBoot_err_t (*VasEBoot_zfs_decrypt) (VasEBoot_crypto_cipher_handle_t cipher, + VasEBoot_uint64_t algo, void *nonce, - char *buf, grub_size_t size, - const grub_uint32_t *expected_mac, - grub_zfs_endian_t endian) = NULL; -grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key, - grub_size_t keysize, - grub_uint64_t salt, - grub_uint64_t algo) = NULL; + char *buf, VasEBoot_size_t size, + const VasEBoot_uint32_t *expected_mac, + VasEBoot_zfs_endian_t endian) = NULL; +VasEBoot_crypto_cipher_handle_t (*VasEBoot_zfs_load_key) (const struct VasEBoot_zfs_key *key, + VasEBoot_size_t keysize, + VasEBoot_uint64_t salt, + VasEBoot_uint64_t algo) = NULL; /* - * List of pool features that the grub implementation of ZFS supports for + * List of pool features that the VasEBoot implementation of ZFS supports for * read. Note that features that are only required for write do not need - * to be listed here since grub opens pools in read-only mode. + * to be listed here since VasEBoot opens pools in read-only mode. */ #define MAX_SUPPORTED_FEATURE_STRLEN 50 static const char *spa_feature_names[] = { @@ -289,54 +289,54 @@ static const char *spa_feature_names[] = { }; static int -check_feature(const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx); -static grub_err_t -check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct grub_zfs_data* data ); +check_feature(const char *name, VasEBoot_uint64_t val, struct VasEBoot_zfs_dir_ctx *ctx); +static VasEBoot_err_t +check_mos_features(dnode_phys_t *mosmdn_phys,VasEBoot_zfs_endian_t endian,struct VasEBoot_zfs_data* data ); -static grub_err_t +static VasEBoot_err_t zlib_decompress (void *s, void *d, - grub_size_t slen, grub_size_t dlen) + VasEBoot_size_t slen, VasEBoot_size_t dlen) { - if (grub_zlib_decompress (s, slen, 0, d, dlen) == (grub_ssize_t) dlen) - return GRUB_ERR_NONE; + if (VasEBoot_zlib_decompress (s, slen, 0, d, dlen) == (VasEBoot_ssize_t) dlen) + return VasEBoot_ERR_NONE; - if (!grub_errno) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t +static VasEBoot_err_t zle_decompress (void *s, void *d, - grub_size_t slen, grub_size_t dlen) + VasEBoot_size_t slen, VasEBoot_size_t dlen) { - grub_uint8_t *iptr, *optr; - grub_size_t clen; - for (iptr = s, optr = d; iptr < (grub_uint8_t *) s + slen - && optr < (grub_uint8_t *) d + dlen;) + VasEBoot_uint8_t *iptr, *optr; + VasEBoot_size_t clen; + for (iptr = s, optr = d; iptr < (VasEBoot_uint8_t *) s + slen + && optr < (VasEBoot_uint8_t *) d + dlen;) { if (*iptr & 0x80) clen = ((*iptr) & 0x7f) + 0x41; else clen = ((*iptr) & 0x3f) + 1; - if ((grub_ssize_t) clen > (grub_uint8_t *) d + dlen - optr) - clen = (grub_uint8_t *) d + dlen - optr; + if ((VasEBoot_ssize_t) clen > (VasEBoot_uint8_t *) d + dlen - optr) + clen = (VasEBoot_uint8_t *) d + dlen - optr; if (*iptr & 0x40 || *iptr & 0x80) { - grub_memset (optr, 0, clen); + VasEBoot_memset (optr, 0, clen); iptr++; optr += clen; continue; } - if ((grub_ssize_t) clen > (grub_uint8_t *) s + slen - iptr - 1) - clen = (grub_uint8_t *) s + slen - iptr - 1; - grub_memcpy (optr, iptr + 1, clen); + if ((VasEBoot_ssize_t) clen > (VasEBoot_uint8_t *) s + slen - iptr - 1) + clen = (VasEBoot_uint8_t *) s + slen - iptr - 1; + VasEBoot_memcpy (optr, iptr + 1, clen); optr += clen; iptr += clen + 1; } - if (optr < (grub_uint8_t *) d + dlen) - grub_memset (optr, 0, (grub_uint8_t *) d + dlen - optr); - return GRUB_ERR_NONE; + if (optr < (VasEBoot_uint8_t *) d + dlen) + VasEBoot_memset (optr, 0, (VasEBoot_uint8_t *) d + dlen - optr); + return VasEBoot_ERR_NONE; } static decomp_entry_t decomp_table[ZIO_COMPRESS_FUNCTIONS] = { @@ -358,14 +358,14 @@ static decomp_entry_t decomp_table[ZIO_COMPRESS_FUNCTIONS] = { {"lz4", lz4_decompress}, /* ZIO_COMPRESS_LZ4 */ }; -static grub_err_t zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, - void *buf, struct grub_zfs_data *data); +static VasEBoot_err_t zio_read_data (blkptr_t * bp, VasEBoot_zfs_endian_t endian, + void *buf, struct VasEBoot_zfs_data *data); /* * Our own version of log2(). Same thing as highbit()-1. */ static int -zfs_log2 (grub_uint64_t num) +zfs_log2 (VasEBoot_uint64_t num) { int i = 0; @@ -381,8 +381,8 @@ zfs_log2 (grub_uint64_t num) /* Checksum Functions */ static void zio_checksum_off (const void *buf __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - grub_zfs_endian_t endian __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), + VasEBoot_zfs_endian_t endian __attribute__ ((unused)), zio_cksum_t * zcp) { ZIO_SET_CHECKSUM (zcp, 0, 0, 0, 0); @@ -409,10 +409,10 @@ static zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = { * Fletcher2, Fletcher4, and SHA256 are supported. * */ -static grub_err_t -zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum, - grub_zfs_endian_t endian, - char *buf, grub_size_t size) +static VasEBoot_err_t +zio_checksum_verify (zio_cksum_t zc, VasEBoot_uint32_t checksum, + VasEBoot_zfs_endian_t endian, + char *buf, VasEBoot_size_t size) { zio_eck_t *zec = (zio_eck_t *) (buf + size) - 1; zio_checksum_info_t *ci = &zio_checksum_table[checksum]; @@ -420,8 +420,8 @@ zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum, if (checksum >= ZIO_CHECKSUM_FUNCTIONS || ci->ci_func == NULL) { - grub_dprintf ("zfs", "unknown checksum function %d\n", checksum); - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_dprintf ("zfs", "unknown checksum function %d\n", checksum); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unknown checksum function %d", checksum); } @@ -436,24 +436,24 @@ zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum, else ci->ci_func (buf, size, endian, &actual_cksum); - if (grub_memcmp (&actual_cksum, &zc, + if (VasEBoot_memcmp (&actual_cksum, &zc, checksum != ZIO_CHECKSUM_SHA256_MAC ? 32 : 20) != 0) { - grub_dprintf ("zfs", "checksum %s verification failed\n", ci->ci_name); - grub_dprintf ("zfs", "actual checksum %016llx %016llx %016llx %016llx\n", + VasEBoot_dprintf ("zfs", "checksum %s verification failed\n", ci->ci_name); + VasEBoot_dprintf ("zfs", "actual checksum %016llx %016llx %016llx %016llx\n", (unsigned long long) actual_cksum.zc_word[0], (unsigned long long) actual_cksum.zc_word[1], (unsigned long long) actual_cksum.zc_word[2], (unsigned long long) actual_cksum.zc_word[3]); - grub_dprintf ("zfs", "expected checksum %016llx %016llx %016llx %016llx\n", + VasEBoot_dprintf ("zfs", "expected checksum %016llx %016llx %016llx %016llx\n", (unsigned long long) zc.zc_word[0], (unsigned long long) zc.zc_word[1], (unsigned long long) zc.zc_word[2], (unsigned long long) zc.zc_word[3]); - return grub_error (GRUB_ERR_BAD_FS, N_("checksum verification failed")); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, N_("checksum verification failed")); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* @@ -469,30 +469,30 @@ zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum, static int vdev_uberblock_compare (uberblock_t * ub1, uberblock_t * ub2) { - grub_zfs_endian_t ub1_endian, ub2_endian; - if (grub_zfs_to_cpu64 (ub1->ub_magic, GRUB_ZFS_LITTLE_ENDIAN) + VasEBoot_zfs_endian_t ub1_endian, ub2_endian; + if (VasEBoot_zfs_to_cpu64 (ub1->ub_magic, VasEBoot_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC) - ub1_endian = GRUB_ZFS_LITTLE_ENDIAN; + ub1_endian = VasEBoot_ZFS_LITTLE_ENDIAN; else - ub1_endian = GRUB_ZFS_BIG_ENDIAN; - if (grub_zfs_to_cpu64 (ub2->ub_magic, GRUB_ZFS_LITTLE_ENDIAN) + ub1_endian = VasEBoot_ZFS_BIG_ENDIAN; + if (VasEBoot_zfs_to_cpu64 (ub2->ub_magic, VasEBoot_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC) - ub2_endian = GRUB_ZFS_LITTLE_ENDIAN; + ub2_endian = VasEBoot_ZFS_LITTLE_ENDIAN; else - ub2_endian = GRUB_ZFS_BIG_ENDIAN; + ub2_endian = VasEBoot_ZFS_BIG_ENDIAN; - if (grub_zfs_to_cpu64 (ub1->ub_txg, ub1_endian) - < grub_zfs_to_cpu64 (ub2->ub_txg, ub2_endian)) + if (VasEBoot_zfs_to_cpu64 (ub1->ub_txg, ub1_endian) + < VasEBoot_zfs_to_cpu64 (ub2->ub_txg, ub2_endian)) return -1; - if (grub_zfs_to_cpu64 (ub1->ub_txg, ub1_endian) - > grub_zfs_to_cpu64 (ub2->ub_txg, ub2_endian)) + if (VasEBoot_zfs_to_cpu64 (ub1->ub_txg, ub1_endian) + > VasEBoot_zfs_to_cpu64 (ub2->ub_txg, ub2_endian)) return 1; - if (grub_zfs_to_cpu64 (ub1->ub_timestamp, ub1_endian) - < grub_zfs_to_cpu64 (ub2->ub_timestamp, ub2_endian)) + if (VasEBoot_zfs_to_cpu64 (ub1->ub_timestamp, ub1_endian) + < VasEBoot_zfs_to_cpu64 (ub2->ub_timestamp, ub2_endian)) return -1; - if (grub_zfs_to_cpu64 (ub1->ub_timestamp, ub1_endian) - > grub_zfs_to_cpu64 (ub2->ub_timestamp, ub2_endian)) + if (VasEBoot_zfs_to_cpu64 (ub1->ub_timestamp, ub1_endian) + > VasEBoot_zfs_to_cpu64 (ub2->ub_timestamp, ub2_endian)) return 1; return 0; @@ -505,30 +505,30 @@ vdev_uberblock_compare (uberblock_t * ub1, uberblock_t * ub2) * Currently Implemented: version number, magic number, checksum * */ -static grub_err_t -uberblock_verify (uberblock_phys_t * ub, grub_uint64_t offset, - grub_size_t s) +static VasEBoot_err_t +uberblock_verify (uberblock_phys_t * ub, VasEBoot_uint64_t offset, + VasEBoot_size_t s) { uberblock_t *uber = &ub->ubp_uberblock; - grub_err_t err; - grub_zfs_endian_t endian = GRUB_ZFS_UNKNOWN_ENDIAN; + VasEBoot_err_t err; + VasEBoot_zfs_endian_t endian = VasEBoot_ZFS_UNKNOWN_ENDIAN; zio_cksum_t zc; - if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_LITTLE_ENDIAN) + if (VasEBoot_zfs_to_cpu64 (uber->ub_magic, VasEBoot_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC - && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN))) - endian = GRUB_ZFS_LITTLE_ENDIAN; + && SPA_VERSION_IS_SUPPORTED(VasEBoot_zfs_to_cpu64 (uber->ub_version, VasEBoot_ZFS_LITTLE_ENDIAN))) + endian = VasEBoot_ZFS_LITTLE_ENDIAN; - if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_BIG_ENDIAN) == UBERBLOCK_MAGIC - && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN))) - endian = GRUB_ZFS_BIG_ENDIAN; + if (VasEBoot_zfs_to_cpu64 (uber->ub_magic, VasEBoot_ZFS_BIG_ENDIAN) == UBERBLOCK_MAGIC + && SPA_VERSION_IS_SUPPORTED(VasEBoot_zfs_to_cpu64 (uber->ub_version, VasEBoot_ZFS_BIG_ENDIAN))) + endian = VasEBoot_ZFS_BIG_ENDIAN; - if (endian == GRUB_ZFS_UNKNOWN_ENDIAN) - return grub_error (GRUB_ERR_BAD_FS, "invalid uberblock magic"); + if (endian == VasEBoot_ZFS_UNKNOWN_ENDIAN) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid uberblock magic"); - grub_memset (&zc, 0, sizeof (zc)); + VasEBoot_memset (&zc, 0, sizeof (zc)); - zc.zc_word[0] = grub_cpu_to_zfs64 (offset, endian); + zc.zc_word[0] = VasEBoot_cpu_to_zfs64 (offset, endian); err = zio_checksum_verify (zc, ZIO_CHECKSUM_LABEL, endian, (char *) ub, s); @@ -543,12 +543,12 @@ uberblock_verify (uberblock_phys_t * ub, grub_uint64_t offset, */ static uberblock_phys_t * find_bestub (uberblock_phys_t * ub_array, - const struct grub_zfs_device_desc *desc) + const struct VasEBoot_zfs_device_desc *desc) { uberblock_phys_t *ubbest = NULL, *ubptr; int i; - grub_disk_addr_t offset; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_disk_addr_t offset; + VasEBoot_err_t err = VasEBoot_ERR_NONE; int ub_shift; ub_shift = desc->ashift; @@ -560,13 +560,13 @@ find_bestub (uberblock_phys_t * ub_array, offset = (desc->vdev_phys_sector << SPA_MINBLOCKSHIFT) + VDEV_PHYS_SIZE + (i << ub_shift); - ubptr = (uberblock_phys_t *) ((grub_properly_aligned_t *) ub_array + ubptr = (uberblock_phys_t *) ((VasEBoot_properly_aligned_t *) ub_array + ((i << ub_shift) - / sizeof (grub_properly_aligned_t))); + / sizeof (VasEBoot_properly_aligned_t))); err = uberblock_verify (ubptr, offset, 1 << ub_shift); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } if (ubbest == NULL @@ -575,96 +575,96 @@ find_bestub (uberblock_phys_t * ub_array, ubbest = ubptr; } if (!ubbest) - grub_errno = err; + VasEBoot_errno = err; return ubbest; } -static inline grub_size_t -get_psize (blkptr_t * bp, grub_zfs_endian_t endian) +static inline VasEBoot_size_t +get_psize (blkptr_t * bp, VasEBoot_zfs_endian_t endian) { - return ((((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) >> 16) & 0xffff) + 1) + return ((((VasEBoot_zfs_to_cpu64 ((bp)->blk_prop, endian) >> 16) & 0xffff) + 1) << SPA_MINBLOCKSHIFT); } -static grub_uint64_t -dva_get_offset (const dva_t *dva, grub_zfs_endian_t endian) +static VasEBoot_uint64_t +dva_get_offset (const dva_t *dva, VasEBoot_zfs_endian_t endian) { - grub_dprintf ("zfs", "dva=%llx, %llx\n", + VasEBoot_dprintf ("zfs", "dva=%llx, %llx\n", (unsigned long long) dva->dva_word[0], (unsigned long long) dva->dva_word[1]); - return grub_zfs_to_cpu64 ((dva)->dva_word[1], + return VasEBoot_zfs_to_cpu64 ((dva)->dva_word[1], endian) << SPA_MINBLOCKSHIFT; } -static grub_err_t -zfs_fetch_nvlist (struct grub_zfs_device_desc *diskdesc, char **nvlist) +static VasEBoot_err_t +zfs_fetch_nvlist (struct VasEBoot_zfs_device_desc *diskdesc, char **nvlist) { - grub_err_t err; + VasEBoot_err_t err; *nvlist = 0; if (!diskdesc->dev) - return grub_error (GRUB_ERR_BUG, "member drive unknown"); + return VasEBoot_error (VasEBoot_ERR_BUG, "member drive unknown"); - *nvlist = grub_malloc (VDEV_PHYS_SIZE); + *nvlist = VasEBoot_malloc (VDEV_PHYS_SIZE); /* Read in the vdev name-value pair list (112K). */ - err = grub_disk_read (diskdesc->dev->disk, diskdesc->vdev_phys_sector, 0, + err = VasEBoot_disk_read (diskdesc->dev->disk, diskdesc->vdev_phys_sector, 0, VDEV_PHYS_SIZE, *nvlist); if (err) { - grub_free (*nvlist); + VasEBoot_free (*nvlist); *nvlist = 0; return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -fill_vdev_info_real (struct grub_zfs_data *data, +static VasEBoot_err_t +fill_vdev_info_real (struct VasEBoot_zfs_data *data, const char *nvlist, - struct grub_zfs_device_desc *fill, - struct grub_zfs_device_desc *insert, + struct VasEBoot_zfs_device_desc *fill, + struct VasEBoot_zfs_device_desc *insert, int *inserted, unsigned ashift) { char *type; - type = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); + type = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); if (!type) - return grub_errno; + return VasEBoot_errno; - if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "id", &(fill->id))) + if (!VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, "id", &(fill->id))) { - grub_free (type); - return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev id"); + VasEBoot_free (type); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find vdev id"); } - if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "guid", &(fill->guid))) + if (!VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, "guid", &(fill->guid))) { - grub_free (type); - return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev id"); + VasEBoot_free (type); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find vdev id"); } { - grub_uint64_t par; - if (grub_zfs_nvlist_lookup_uint64 (nvlist, "ashift", &par)) + VasEBoot_uint64_t par; + if (VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, "ashift", &par)) fill->ashift = par; else if (ashift != 0xffffffff) fill->ashift = ashift; else { - grub_free (type); - return grub_error (GRUB_ERR_BAD_FS, "couldn't find ashift"); + VasEBoot_free (type); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find ashift"); } } fill->max_children_ashift = 0; - if (grub_strcmp (type, VDEV_TYPE_DISK) == 0 - || grub_strcmp (type, VDEV_TYPE_FILE) == 0) + if (VasEBoot_strcmp (type, VDEV_TYPE_DISK) == 0 + || VasEBoot_strcmp (type, VDEV_TYPE_FILE) == 0) { fill->type = DEVICE_LEAF; @@ -680,89 +680,89 @@ fill_vdev_info_real (struct grub_zfs_data *data, *inserted = 1; } - grub_free (type); + VasEBoot_free (type); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_strcmp (type, VDEV_TYPE_MIRROR) == 0 - || grub_strcmp (type, VDEV_TYPE_RAIDZ) == 0) + if (VasEBoot_strcmp (type, VDEV_TYPE_MIRROR) == 0 + || VasEBoot_strcmp (type, VDEV_TYPE_RAIDZ) == 0) { int nelm, i; - if (grub_strcmp (type, VDEV_TYPE_MIRROR) == 0) + if (VasEBoot_strcmp (type, VDEV_TYPE_MIRROR) == 0) fill->type = DEVICE_MIRROR; else { - grub_uint64_t par; + VasEBoot_uint64_t par; fill->type = DEVICE_RAIDZ; - if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "nparity", &par)) + if (!VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, "nparity", &par)) { - grub_free (type); - return grub_error (GRUB_ERR_BAD_FS, "couldn't find raidz parity"); + VasEBoot_free (type); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find raidz parity"); } fill->nparity = par; } - nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm (nvlist, + nelm = VasEBoot_zfs_nvlist_lookup_nvlist_array_get_nelm (nvlist, ZPOOL_CONFIG_CHILDREN); if (nelm <= 0) { - grub_free (type); - return grub_error (GRUB_ERR_BAD_FS, "incorrect mirror VDEV"); + VasEBoot_free (type); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect mirror VDEV"); } if (!fill->children) { fill->n_children = nelm; - fill->children = grub_zalloc (fill->n_children + fill->children = VasEBoot_zalloc (fill->n_children * sizeof (fill->children[0])); } for (i = 0; i < nelm; i++) { char *child; - grub_err_t err; + VasEBoot_err_t err; - child = grub_zfs_nvlist_lookup_nvlist_array + child = VasEBoot_zfs_nvlist_lookup_nvlist_array (nvlist, ZPOOL_CONFIG_CHILDREN, i); err = fill_vdev_info_real (data, child, &fill->children[i], insert, inserted, fill->ashift); - grub_free (child); + VasEBoot_free (child); if (err) { - grub_free (type); + VasEBoot_free (type); return err; } if (fill->children[i].ashift > fill->max_children_ashift) fill->max_children_ashift = fill->children[i].ashift; } - grub_free (type); - return GRUB_ERR_NONE; + VasEBoot_free (type); + return VasEBoot_ERR_NONE; } - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "vdev %s isn't supported", type); - grub_free (type); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "vdev %s isn't supported", type); + VasEBoot_free (type); + return VasEBoot_errno; } -static grub_err_t -fill_vdev_info (struct grub_zfs_data *data, - char *nvlist, struct grub_zfs_device_desc *diskdesc, +static VasEBoot_err_t +fill_vdev_info (struct VasEBoot_zfs_data *data, + char *nvlist, struct VasEBoot_zfs_device_desc *diskdesc, int *inserted) { - grub_uint64_t id; + VasEBoot_uint64_t id; unsigned i; *inserted = 0; - if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "id", &id)) - return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev id"); + if (!VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, "id", &id)) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find vdev id"); for (i = 0; i < data->n_devices_attached; i++) if (data->devices_attached[i].id == id) @@ -775,17 +775,17 @@ fill_vdev_info (struct grub_zfs_data *data, void *tmp; data->n_devices_allocated = 2 * data->n_devices_attached + 1; data->devices_attached - = grub_realloc (tmp = data->devices_attached, + = VasEBoot_realloc (tmp = data->devices_attached, data->n_devices_allocated * sizeof (data->devices_attached[0])); if (!data->devices_attached) { data->devices_attached = tmp; - return grub_errno; + return VasEBoot_errno; } } - grub_memset (&data->devices_attached[data->n_devices_attached - 1], + VasEBoot_memset (&data->devices_attached[data->n_devices_attached - 1], 0, sizeof (data->devices_attached[data->n_devices_attached - 1])); return fill_vdev_info_real (data, nvlist, @@ -836,7 +836,7 @@ nvlist_next_nvpair (const char *nvl, const char *nvpair) else { /* skip to the next nvpair */ - encode_size = grub_be_to_cpu32 (grub_get_unaligned32(nvpair)); + encode_size = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32(nvpair)); nvpair += encode_size; /*If encode_size equals 0 nvlist_next_nvpair would return * the same pair received in input, leading to an infinite loop. @@ -845,25 +845,25 @@ nvlist_next_nvpair (const char *nvl, const char *nvpair) * and potentially getting into an infinite loop. */ if(encode_size <= 0) { - grub_dprintf ("zfs", "nvpair with size <= 0\n"); - grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist"); + VasEBoot_dprintf ("zfs", "nvpair with size <= 0\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect nvlist"); return NULL; } } /* 8 bytes of 0 marks the end of the list */ - if (grub_get_unaligned64 (nvpair) == 0) + if (VasEBoot_get_unaligned64 (nvpair) == 0) return NULL; /*consistency checks*/ if (nvpair + 4 * 3 >= nvl + VDEV_PHYS_SIZE) { - grub_dprintf ("zfs", "nvlist overflow\n"); - grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist"); + VasEBoot_dprintf ("zfs", "nvlist overflow\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect nvlist"); return NULL; } - encode_size = grub_be_to_cpu32 (grub_get_unaligned32(nvpair)); + encode_size = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32(nvpair)); nvp = nvpair + 4*2; - name_len = grub_be_to_cpu32 (grub_get_unaligned32 (nvp)); + name_len = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvp)); nvp += 4; nvp = nvp + ((name_len + 3) & ~3); // align @@ -871,8 +871,8 @@ nvlist_next_nvpair (const char *nvl, const char *nvpair) || encode_size < 0 || nvp + 4 + encode_size > nvl + VDEV_PHYS_SIZE) { - grub_dprintf ("zfs", "nvlist overflow\n"); - grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist"); + VasEBoot_dprintf ("zfs", "nvlist overflow\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect nvlist"); return NULL; } /* end consistency checks */ @@ -885,13 +885,13 @@ nvlist_next_nvpair (const char *nvl, const char *nvpair) * containing the name of nvpair is saved in buf. */ static int -nvpair_name (const char *nvp, char **buf, grub_size_t *buflen) +nvpair_name (const char *nvp, char **buf, VasEBoot_size_t *buflen) { /* skip over encode/decode size */ nvp += 4 * 2; *buf = (char *) (nvp + 4); - *buflen = grub_be_to_cpu32 (grub_get_unaligned32 (nvp)); + *buflen = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvp)); return 0; } @@ -909,29 +909,29 @@ nvpair_type (const char *nvp) nvp += 4 * 2; /* skip over name_len */ - name_len = grub_be_to_cpu32 (grub_get_unaligned32 (nvp)); + name_len = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvp)); nvp += 4; /* skip over name */ nvp = nvp + ((name_len + 3) & ~3); /* align */ - type = grub_be_to_cpu32 (grub_get_unaligned32 (nvp)); + type = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvp)); return type; } static int nvpair_value (const char *nvp,char **val, - grub_size_t *size_out, grub_size_t *nelm_out) + VasEBoot_size_t *size_out, VasEBoot_size_t *nelm_out) { int name_len,nelm,encode_size; /* skip over encode/decode size */ - encode_size = grub_be_to_cpu32 (grub_get_unaligned32(nvp)); + encode_size = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32(nvp)); nvp += 8; /* skip over name_len */ - name_len = grub_be_to_cpu32 (grub_get_unaligned32 (nvp)); + name_len = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvp)); nvp += 4; /* skip over name */ @@ -939,11 +939,11 @@ nvpair_value (const char *nvp,char **val, /* skip over type */ nvp += 4; - nelm = grub_be_to_cpu32 (grub_get_unaligned32 (nvp)); + nelm = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvp)); nvp +=4; if (nelm < 1) { - grub_error (GRUB_ERR_BAD_FS, "empty nvpair"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "empty nvpair"); return 0; } *val = (char *) nvp; @@ -958,21 +958,21 @@ nvpair_value (const char *nvp,char **val, * Check the disk label information and retrieve needed vdev name-value pairs. * */ -static grub_err_t -check_pool_label (struct grub_zfs_data *data, - struct grub_zfs_device_desc *diskdesc, +static VasEBoot_err_t +check_pool_label (struct VasEBoot_zfs_data *data, + struct VasEBoot_zfs_device_desc *diskdesc, int *inserted, int original) { - grub_uint64_t pool_state, txg = 0; + VasEBoot_uint64_t pool_state, txg = 0; char *nvlist,*features; #if 0 char *nv; #endif - grub_uint64_t poolguid; - grub_uint64_t version; + VasEBoot_uint64_t poolguid; + VasEBoot_uint64_t version; int found; - grub_err_t err; - grub_zfs_endian_t endian; + VasEBoot_err_t err; + VasEBoot_zfs_endian_t endian; vdev_phys_t *phys; zio_cksum_t emptycksum; @@ -983,18 +983,18 @@ check_pool_label (struct grub_zfs_data *data, return err; phys = (vdev_phys_t*) nvlist; - if (grub_zfs_to_cpu64 (phys->vp_zbt.zec_magic, - GRUB_ZFS_LITTLE_ENDIAN) + if (VasEBoot_zfs_to_cpu64 (phys->vp_zbt.zec_magic, + VasEBoot_ZFS_LITTLE_ENDIAN) == ZEC_MAGIC) - endian = GRUB_ZFS_LITTLE_ENDIAN; - else if (grub_zfs_to_cpu64 (phys->vp_zbt.zec_magic, - GRUB_ZFS_BIG_ENDIAN) + endian = VasEBoot_ZFS_LITTLE_ENDIAN; + else if (VasEBoot_zfs_to_cpu64 (phys->vp_zbt.zec_magic, + VasEBoot_ZFS_BIG_ENDIAN) == ZEC_MAGIC) - endian = GRUB_ZFS_BIG_ENDIAN; + endian = VasEBoot_ZFS_BIG_ENDIAN; else { - grub_free (nvlist); - return grub_error (GRUB_ERR_BAD_FS, + VasEBoot_free (nvlist); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "bad vdev_phys_t.vp_zbt.zec_magic number"); } /* Now check the integrity of the vdev_phys_t structure though checksum. */ @@ -1004,162 +1004,162 @@ check_pool_label (struct grub_zfs_data *data, if (err) return err; - grub_dprintf ("zfs", "check 2 passed\n"); + VasEBoot_dprintf ("zfs", "check 2 passed\n"); - found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE, + found = VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE, &pool_state); if (! found) { - grub_free (nvlist); - if (! grub_errno) - grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_POOL_STATE " not found"); - return grub_errno; + VasEBoot_free (nvlist); + if (! VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, ZPOOL_CONFIG_POOL_STATE " not found"); + return VasEBoot_errno; } - grub_dprintf ("zfs", "check 3 passed\n"); + VasEBoot_dprintf ("zfs", "check 3 passed\n"); if (pool_state == POOL_STATE_DESTROYED) { - grub_free (nvlist); - return grub_error (GRUB_ERR_BAD_FS, "zpool is marked as destroyed"); + VasEBoot_free (nvlist); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "zpool is marked as destroyed"); } - grub_dprintf ("zfs", "check 4 passed\n"); + VasEBoot_dprintf ("zfs", "check 4 passed\n"); - found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_TXG, &txg); + found = VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_TXG, &txg); if (!found) { - grub_free (nvlist); - if (! grub_errno) - grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_POOL_TXG " not found"); - return grub_errno; + VasEBoot_free (nvlist); + if (! VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, ZPOOL_CONFIG_POOL_TXG " not found"); + return VasEBoot_errno; } - grub_dprintf ("zfs", "check 6 passed\n"); + VasEBoot_dprintf ("zfs", "check 6 passed\n"); /* not an active device */ if (txg == 0) { - grub_free (nvlist); - return grub_error (GRUB_ERR_BAD_FS, "zpool isn't active"); + VasEBoot_free (nvlist); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "zpool isn't active"); } - grub_dprintf ("zfs", "check 7 passed\n"); + VasEBoot_dprintf ("zfs", "check 7 passed\n"); - found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_VERSION, + found = VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_VERSION, &version); if (! found) { - grub_free (nvlist); - if (! grub_errno) - grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_VERSION " not found"); - return grub_errno; + VasEBoot_free (nvlist); + if (! VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, ZPOOL_CONFIG_VERSION " not found"); + return VasEBoot_errno; } - grub_dprintf ("zfs", "check 8 passed\n"); + VasEBoot_dprintf ("zfs", "check 8 passed\n"); if (!SPA_VERSION_IS_SUPPORTED(version)) { - grub_free (nvlist); - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_free (nvlist); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "too new version %llu > %llu", (unsigned long long) version, (unsigned long long) SPA_VERSION_BEFORE_FEATURES); } - grub_dprintf ("zfs", "check 9 passed\n"); + VasEBoot_dprintf ("zfs", "check 9 passed\n"); - found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_GUID, + found = VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_GUID, &(diskdesc->guid)); if (! found) { - grub_free (nvlist); - if (! grub_errno) - grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_GUID " not found"); - return grub_errno; + VasEBoot_free (nvlist); + if (! VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, ZPOOL_CONFIG_GUID " not found"); + return VasEBoot_errno; } - found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, + found = VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, &poolguid); if (! found) { - grub_free (nvlist); - if (! grub_errno) - grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_POOL_GUID " not found"); - return grub_errno; + VasEBoot_free (nvlist); + if (! VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, ZPOOL_CONFIG_POOL_GUID " not found"); + return VasEBoot_errno; } - grub_dprintf ("zfs", "check 11 passed\n"); + VasEBoot_dprintf ("zfs", "check 11 passed\n"); if (original) data->guid = poolguid; if (data->guid != poolguid) - return grub_error (GRUB_ERR_BAD_FS, "another zpool"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "another zpool"); { char *nv; - nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); + nv = VasEBoot_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); if (!nv) { - grub_free (nvlist); - return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev tree"); + VasEBoot_free (nvlist); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find vdev tree"); } err = fill_vdev_info (data, nv, diskdesc, inserted); if (err) { - grub_free (nv); - grub_free (nvlist); + VasEBoot_free (nv); + VasEBoot_free (nvlist); return err; } - grub_free (nv); + VasEBoot_free (nv); } - grub_dprintf ("zfs", "check 10 passed\n"); - features = grub_zfs_nvlist_lookup_nvlist(nvlist, + VasEBoot_dprintf ("zfs", "check 10 passed\n"); + features = VasEBoot_zfs_nvlist_lookup_nvlist(nvlist, ZPOOL_CONFIG_FEATURES_FOR_READ); if (features) { const char *nvp=NULL; char name[MAX_SUPPORTED_FEATURE_STRLEN + 1]; char *nameptr; - grub_size_t namelen; + VasEBoot_size_t namelen; while ((nvp = nvlist_next_nvpair(features, nvp)) != NULL) { nvpair_name (nvp, &nameptr, &namelen); if(namelen > MAX_SUPPORTED_FEATURE_STRLEN) namelen = MAX_SUPPORTED_FEATURE_STRLEN; - grub_memcpy (name, nameptr, namelen); + VasEBoot_memcpy (name, nameptr, namelen); name[namelen] = '\0'; - grub_dprintf("zfs","str=%s\n",name); + VasEBoot_dprintf("zfs","str=%s\n",name); if (check_feature(name,1, NULL) != 0) { - grub_dprintf("zfs","feature missing in check_pool_label:%s\n",name); - err= grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET," check_pool_label missing feature '%s' for read",name); + VasEBoot_dprintf("zfs","feature missing in check_pool_label:%s\n",name); + err= VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET," check_pool_label missing feature '%s' for read",name); return err; } } } - grub_dprintf ("zfs", "check 12 passed (feature flags)\n"); - grub_free (nvlist); + VasEBoot_dprintf ("zfs", "check 12 passed (feature flags)\n"); + VasEBoot_free (nvlist); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -scan_disk (grub_device_t dev, struct grub_zfs_data *data, +static VasEBoot_err_t +scan_disk (VasEBoot_device_t dev, struct VasEBoot_zfs_data *data, int original, int *inserted) { int label = 0; uberblock_phys_t *ub_array, *ubbest = NULL; vdev_boot_header_t *bh; - grub_err_t err; + VasEBoot_err_t err; int vdevnum; - struct grub_zfs_device_desc desc; + struct VasEBoot_zfs_device_desc desc; - ub_array = grub_malloc (VDEV_UBERBLOCK_RING); + ub_array = VasEBoot_malloc (VDEV_UBERBLOCK_RING); if (!ub_array) - return grub_errno; + return VasEBoot_errno; - bh = grub_malloc (VDEV_BOOT_HEADER_SIZE); + bh = VasEBoot_malloc (VDEV_BOOT_HEADER_SIZE); if (!bh) { - grub_free (ub_array); - return grub_errno; + VasEBoot_free (ub_array); + return VasEBoot_errno; } vdevnum = VDEV_LABELS; @@ -1168,7 +1168,7 @@ scan_disk (grub_device_t dev, struct grub_zfs_data *data, desc.original = original; /* Don't check back labels on CDROM. */ - if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN) + if (VasEBoot_disk_get_size (dev->disk) == VasEBoot_DISK_SIZE_UNKNOWN) vdevnum = VDEV_LABELS / 2; for (label = 0; ubbest == NULL && label < vdevnum; label++) @@ -1177,39 +1177,39 @@ scan_disk (grub_device_t dev, struct grub_zfs_data *data, = label * (sizeof (vdev_label_t) >> SPA_MINBLOCKSHIFT) + ((VDEV_SKIP_SIZE + VDEV_BOOT_HEADER_SIZE) >> SPA_MINBLOCKSHIFT) + (label < VDEV_LABELS / 2 ? 0 : - ALIGN_DOWN (grub_disk_get_size (dev->disk), sizeof (vdev_label_t)) + ALIGN_DOWN (VasEBoot_disk_get_size (dev->disk), sizeof (vdev_label_t)) - VDEV_LABELS * (sizeof (vdev_label_t) >> SPA_MINBLOCKSHIFT)); /* Read in the uberblock ring (128K). */ - err = grub_disk_read (dev->disk, desc.vdev_phys_sector + err = VasEBoot_disk_read (dev->disk, desc.vdev_phys_sector + (VDEV_PHYS_SIZE >> SPA_MINBLOCKSHIFT), 0, VDEV_UBERBLOCK_RING, (char *) ub_array); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - grub_dprintf ("zfs", "label ok %d\n", label); + VasEBoot_dprintf ("zfs", "label ok %d\n", label); err = check_pool_label (data, &desc, inserted, original); if (err || !*inserted) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } ubbest = find_bestub (ub_array, &desc); if (!ubbest) { - grub_dprintf ("zfs", "No uberblock found\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dprintf ("zfs", "No uberblock found\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - grub_memmove (&(desc.current_uberblock), + VasEBoot_memmove (&(desc.current_uberblock), &ubbest->ubp_uberblock, sizeof (uberblock_t)); if (original) - grub_memmove (&(data->current_uberblock), + VasEBoot_memmove (&(data->current_uberblock), &ubbest->ubp_uberblock, sizeof (uberblock_t)); #if 0 @@ -1218,70 +1218,70 @@ scan_disk (grub_device_t dev, struct grub_zfs_data *data, &(current_uberblock)) <= 0) continue; #endif - grub_free (ub_array); - grub_free (bh); - return GRUB_ERR_NONE; + VasEBoot_free (ub_array); + VasEBoot_free (bh); + return VasEBoot_ERR_NONE; } - grub_free (ub_array); - grub_free (bh); + VasEBoot_free (ub_array); + VasEBoot_free (bh); - return grub_error (GRUB_ERR_BAD_FS, "couldn't find a valid label"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find a valid label"); } /* Helper for scan_devices. */ static int scan_devices_iter (const char *name, void *hook_data) { - struct grub_zfs_data *data = hook_data; - grub_device_t dev; - grub_err_t err; + struct VasEBoot_zfs_data *data = hook_data; + VasEBoot_device_t dev; + VasEBoot_err_t err; int inserted; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (!dev) return 0; if (!dev->disk) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } err = scan_disk (dev, data, 0, &inserted); - if (err == GRUB_ERR_BAD_FS) + if (err == VasEBoot_ERR_BAD_FS) { - grub_device_close (dev); - grub_errno = GRUB_ERR_NONE; + VasEBoot_device_close (dev); + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } if (err) { - grub_device_close (dev); - grub_print_error (); + VasEBoot_device_close (dev); + VasEBoot_print_error (); return 0; } if (!inserted) - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } -static grub_err_t -scan_devices (struct grub_zfs_data *data) +static VasEBoot_err_t +scan_devices (struct VasEBoot_zfs_data *data) { - grub_device_iterate (scan_devices_iter, data); - return GRUB_ERR_NONE; + VasEBoot_device_iterate (scan_devices_iter, data); + return VasEBoot_ERR_NONE; } /* x**y. */ -static grub_uint8_t powx[255 * 2]; +static VasEBoot_uint8_t powx[255 * 2]; /* Such an s that x**s = y */ static int powx_inv[256]; -static const grub_uint8_t poly = 0x1d; +static const VasEBoot_uint8_t poly = 0x1d; /* perform the operation a ^= b * (x ** (known_idx * recovery_pow) ) */ static inline void -xor_out (grub_uint8_t *a, const grub_uint8_t *b, grub_size_t s, +xor_out (VasEBoot_uint8_t *a, const VasEBoot_uint8_t *b, VasEBoot_size_t s, unsigned known_idx, unsigned recovery_pow) { unsigned add; @@ -1289,7 +1289,7 @@ xor_out (grub_uint8_t *a, const grub_uint8_t *b, grub_size_t s, /* Simple xor. */ if (known_idx == 0 || recovery_pow == 0) { - grub_crypto_xor (a, a, b, s); + VasEBoot_crypto_xor (a, a, b, s); return; } add = (known_idx * recovery_pow) % 255; @@ -1298,8 +1298,8 @@ xor_out (grub_uint8_t *a, const grub_uint8_t *b, grub_size_t s, *a ^= powx[powx_inv[*b] + add]; } -static inline grub_uint8_t -gf_mul (grub_uint8_t a, grub_uint8_t b) +static inline VasEBoot_uint8_t +gf_mul (VasEBoot_uint8_t a, VasEBoot_uint8_t b) { if (a == 0 || b == 0) return 0; @@ -1308,12 +1308,12 @@ gf_mul (grub_uint8_t a, grub_uint8_t b) #define MAX_NBUFS 4 -static grub_err_t -recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, +static VasEBoot_err_t +recovery (VasEBoot_uint8_t *bufs[4], VasEBoot_size_t s, const int nbufs, const unsigned *powers, const unsigned *idx) { - grub_dprintf ("zfs", "recovering %u buffers\n", nbufs); + VasEBoot_dprintf ("zfs", "recovering %u buffers\n", nbufs); /* Now we have */ /* b_i = sum (r_j* (x ** (powers[i] * idx[j])))*/ /* Let's invert the matrix in question. */ @@ -1323,26 +1323,26 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, case 1: { int add; - grub_uint8_t *a; + VasEBoot_uint8_t *a; if (powers[0] == 0 || idx[0] == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; add = 255 - ((powers[0] * idx[0]) % 255); for (a = bufs[0]; s--; a++) if (*a) *a = powx[powx_inv[*a] + add]; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Case 2x2: Let's use the determinant formula. */ case 2: { - grub_uint8_t det, det_inv; - grub_uint8_t matrixinv[2][2]; + VasEBoot_uint8_t det, det_inv; + VasEBoot_uint8_t matrixinv[2][2]; unsigned i; /* The determinant is: */ det = (powx[(powers[0] * idx[0] + powers[1] * idx[1]) % 255] ^ powx[(powers[0] * idx[1] + powers[1] * idx[0]) % 255]); if (det == 0) - return grub_error (GRUB_ERR_BAD_FS, "singular recovery matrix"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "singular recovery matrix"); det_inv = powx[255 - powx_inv[det]]; matrixinv[0][0] = gf_mul (powx[(powers[1] * idx[1]) % 255], det_inv); matrixinv[1][1] = gf_mul (powx[(powers[0] * idx[0]) % 255], det_inv); @@ -1350,7 +1350,7 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, matrixinv[1][0] = gf_mul (powx[(powers[1] * idx[0]) % 255], det_inv); for (i = 0; i < s; i++) { - grub_uint8_t b0, b1; + VasEBoot_uint8_t b0, b1; b0 = bufs[0][i]; b1 = bufs[1][i]; @@ -1359,12 +1359,12 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, bufs[1][i] = (gf_mul (b0, matrixinv[1][0]) ^ gf_mul (b1, matrixinv[1][1])); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Otherwise use Gauss. */ case 3: { - grub_uint8_t matrix1[MAX_NBUFS][MAX_NBUFS], matrix2[MAX_NBUFS][MAX_NBUFS]; + VasEBoot_uint8_t matrix1[MAX_NBUFS][MAX_NBUFS], matrix2[MAX_NBUFS][MAX_NBUFS]; int i, j, k; for (i = 0; i < nbufs; i++) @@ -1378,26 +1378,26 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, for (i = 0; i < nbufs; i++) { - grub_uint8_t mul; + VasEBoot_uint8_t mul; for (j = i; j < nbufs; j++) if (matrix1[i][j]) break; if (j == nbufs) - return grub_error (GRUB_ERR_BAD_FS, "singular recovery matrix"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "singular recovery matrix"); if (j != i) { int xchng; xchng = j; for (j = 0; j < nbufs; j++) { - grub_uint8_t t; + VasEBoot_uint8_t t; t = matrix1[xchng][j]; matrix1[xchng][j] = matrix1[i][j]; matrix1[i][j] = t; } for (j = 0; j < nbufs; j++) { - grub_uint8_t t; + VasEBoot_uint8_t t; t = matrix2[xchng][j]; matrix2[xchng][j] = matrix2[i][j]; matrix2[i][j] = t; @@ -1421,7 +1421,7 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, { for (j = 0; j < i; j++) { - grub_uint8_t mul; + VasEBoot_uint8_t mul; mul = matrix1[j][i]; for (k = 0; k < nbufs; k++) matrix1[j][k] ^= gf_mul (matrix1[i][k], mul); @@ -1432,7 +1432,7 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, for (i = 0; i < (int) s; i++) { - grub_uint8_t b[MAX_NBUFS]; + VasEBoot_uint8_t b[MAX_NBUFS]; for (j = 0; j < nbufs; j++) b[j] = bufs[j][i]; for (j = 0; j < nbufs; j++) @@ -1442,38 +1442,38 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs, bufs[j][i] ^= gf_mul (matrix2[j][k], b[k]); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } default: - return grub_error (GRUB_ERR_BUG, "too big matrix"); + return VasEBoot_error (VasEBoot_ERR_BUG, "too big matrix"); } } -static grub_err_t -read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, - grub_size_t len, void *buf) +static VasEBoot_err_t +read_device (VasEBoot_uint64_t offset, struct VasEBoot_zfs_device_desc *desc, + VasEBoot_size_t len, void *buf) { switch (desc->type) { case DEVICE_LEAF: { - grub_uint64_t sector; + VasEBoot_uint64_t sector; sector = DVA_OFFSET_TO_PHYS_SECTOR (offset); if (!desc->dev) { - return grub_error (GRUB_ERR_BAD_FS, + return VasEBoot_error (VasEBoot_ERR_BAD_FS, N_("couldn't find a necessary member device " "of multi-device filesystem")); } /* read in a data block */ - return grub_disk_read (desc->dev->disk, sector, 0, len, buf); + return VasEBoot_disk_read (desc->dev->disk, sector, 0, len, buf); } case DEVICE_MIRROR: { - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; unsigned i; if (desc->n_children <= 0) - return grub_error (GRUB_ERR_BAD_FS, + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "non-positive number of mirror children"); for (i = 0; i < desc->n_children; i++) { @@ -1481,39 +1481,39 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, len, buf); if (!err) break; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_errno = err; + VasEBoot_errno = err; return err; } case DEVICE_RAIDZ: { unsigned c = 0; - grub_uint64_t high; - grub_uint64_t devn; - grub_uint64_t m; - grub_uint32_t s, orig_s; + VasEBoot_uint64_t high; + VasEBoot_uint64_t devn; + VasEBoot_uint64_t m; + VasEBoot_uint32_t s, orig_s; void *orig_buf = buf; - grub_size_t orig_len = len; - grub_uint8_t *recovery_buf[4]; - grub_size_t recovery_len[4]; + VasEBoot_size_t orig_len = len; + VasEBoot_uint8_t *recovery_buf[4]; + VasEBoot_size_t recovery_len[4]; unsigned recovery_idx[4]; unsigned failed_devices = 0; int idx, orig_idx; if (desc->nparity < 1 || desc->nparity > 3) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "raidz%d is not supported", desc->nparity); if (desc->n_children <= desc->nparity || desc->n_children < 1) - return grub_error(GRUB_ERR_BAD_FS, "too little devices for given parity"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "too little devices for given parity"); orig_s = (((len + (1 << desc->ashift) - 1) >> desc->ashift) + (desc->n_children - desc->nparity) - 1); s = orig_s; - high = grub_divmod64 ((offset >> desc->ashift), + high = VasEBoot_divmod64 ((offset >> desc->ashift), desc->n_children, &m); if (desc->nparity == 2) c = 2; @@ -1527,9 +1527,9 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, orig_idx = idx; while (len > 0) { - grub_size_t csize; - grub_uint32_t bsize; - grub_err_t err; + VasEBoot_size_t csize; + VasEBoot_uint32_t bsize; + VasEBoot_err_t err; bsize = s / (desc->n_children - desc->nparity); if (desc->nparity == 1 @@ -1537,16 +1537,16 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, & 1) == c) c++; - high = grub_divmod64 ((offset >> desc->ashift) + c, + high = VasEBoot_divmod64 ((offset >> desc->ashift) + c, desc->n_children, &devn); csize = bsize << desc->ashift; if (csize > len) csize = len; - grub_dprintf ("zfs", "RAIDZ mapping 0x%" PRIxGRUB_UINT64_T - "+%u (%" PRIxGRUB_SIZE ", %" PRIxGRUB_UINT32_T - ") -> (0x%" PRIxGRUB_UINT64_T ", 0x%" - PRIxGRUB_UINT64_T ")\n", + VasEBoot_dprintf ("zfs", "RAIDZ mapping 0x%" PRIxVasEBoot_UINT64_T + "+%u (%" PRIxVasEBoot_SIZE ", %" PRIxVasEBoot_UINT32_T + ") -> (0x%" PRIxVasEBoot_UINT64_T ", 0x%" + PRIxVasEBoot_UINT64_T ")\n", offset >> desc->ashift, c, len, bsize, high, devn); err = read_device ((high << desc->ashift) @@ -1559,7 +1559,7 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, recovery_len[failed_devices] = csize; recovery_idx[failed_devices] = idx; failed_devices++; - grub_errno = err = 0; + VasEBoot_errno = err = 0; } if (err) return err; @@ -1576,12 +1576,12 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, unsigned cur_redundancy_pow = 0; unsigned n_redundancy = 0; unsigned i, j; - grub_err_t err; + VasEBoot_err_t err; /* Compute mul. x**s has a period of 255. */ if (powx[0] == 0) { - grub_uint8_t cur = 1; + VasEBoot_uint8_t cur = 1; for (i = 0; i < 255; i++) { powx[i] = cur; @@ -1599,7 +1599,7 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, n_redundancy < failed_devices; cur_redundancy_pow++) { - high = grub_divmod64 ((offset >> desc->ashift) + high = VasEBoot_divmod64 ((offset >> desc->ashift) + cur_redundancy_pow + ((desc->nparity == 1) && ((offset >> (desc->ashift + 20 @@ -1615,7 +1615,7 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, if (err && n_redundancy + desc->nparity - cur_redundancy_pow - 1 >= failed_devices) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } if (err) @@ -1631,7 +1631,7 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, while (len > 0) { - grub_size_t csize; + VasEBoot_size_t csize; csize = ((s / (desc->n_children - desc->nparity)) << desc->ashift); if (csize > len) @@ -1659,7 +1659,7 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, separately. */ if (i != failed_devices) { - grub_uint8_t *tmp_recovery_buf[4]; + VasEBoot_uint8_t *tmp_recovery_buf[4]; for (j = 0; j < i; j++) tmp_recovery_buf[j] = recovery_buf[j] + recovery_len[failed_devices - 1]; err = recovery (tmp_recovery_buf, recovery_len[0] - recovery_len[failed_devices - 1], i, redundancy_pow, @@ -1672,20 +1672,20 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } - return grub_error (GRUB_ERR_BAD_FS, "unsupported device type"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "unsupported device type"); } -static grub_err_t +static VasEBoot_err_t read_dva (const dva_t *dva, - grub_zfs_endian_t endian, struct grub_zfs_data *data, - void *buf, grub_size_t len) + VasEBoot_zfs_endian_t endian, struct VasEBoot_zfs_data *data, + void *buf, VasEBoot_size_t len) { - grub_uint64_t offset; + VasEBoot_uint64_t offset; unsigned i; - grub_err_t err = 0; + VasEBoot_err_t err = 0; int try = 0; offset = dva_get_offset (dva, endian); @@ -1696,7 +1696,7 @@ read_dva (const dva_t *dva, { err = read_device (offset, &data->devices_attached[i], len, buf); if (!err) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; break; } if (try == 1) @@ -1706,7 +1706,7 @@ read_dva (const dva_t *dva, return err; } if (!err) - return grub_error (GRUB_ERR_BAD_FS, "unknown device %d", + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "unknown device %d", (int) DVA_GET_VDEV (dva)); return err; } @@ -1716,27 +1716,27 @@ read_dva (const dva_t *dva, * and put its data in buf. * */ -static grub_err_t -zio_read_gang (blkptr_t * bp, grub_zfs_endian_t endian, dva_t * dva, void *buf, - struct grub_zfs_data *data) +static VasEBoot_err_t +zio_read_gang (blkptr_t * bp, VasEBoot_zfs_endian_t endian, dva_t * dva, void *buf, + struct VasEBoot_zfs_data *data) { zio_gbh_phys_t *zio_gb; unsigned i; - grub_err_t err; + VasEBoot_err_t err; zio_cksum_t zc; - grub_memset (&zc, 0, sizeof (zc)); + VasEBoot_memset (&zc, 0, sizeof (zc)); - zio_gb = grub_malloc (SPA_GANGBLOCKSIZE); + zio_gb = VasEBoot_malloc (SPA_GANGBLOCKSIZE); if (!zio_gb) - return grub_errno; - grub_dprintf ("zfs", endian == GRUB_ZFS_LITTLE_ENDIAN ? "little-endian gang\n" + return VasEBoot_errno; + VasEBoot_dprintf ("zfs", endian == VasEBoot_ZFS_LITTLE_ENDIAN ? "little-endian gang\n" :"big-endian gang\n"); err = read_dva (dva, endian, data, zio_gb, SPA_GANGBLOCKSIZE); if (err) { - grub_free (zio_gb); + VasEBoot_free (zio_gb); return err; } @@ -1748,11 +1748,11 @@ zio_read_gang (blkptr_t * bp, grub_zfs_endian_t endian, dva_t * dva, void *buf, (char *) zio_gb, SPA_GANGBLOCKSIZE); if (err) { - grub_free (zio_gb); + VasEBoot_free (zio_gb); return err; } - endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + endian = (VasEBoot_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { @@ -1762,24 +1762,24 @@ zio_read_gang (blkptr_t * bp, grub_zfs_endian_t endian, dva_t * dva, void *buf, err = zio_read_data (&zio_gb->zg_blkptr[i], endian, buf, data); if (err) { - grub_free (zio_gb); + VasEBoot_free (zio_gb); return err; } buf = (char *) buf + get_psize (&zio_gb->zg_blkptr[i], endian); } - grub_free (zio_gb); - return GRUB_ERR_NONE; + VasEBoot_free (zio_gb); + return VasEBoot_ERR_NONE; } /* * Read in a block of raw data to buf. */ -static grub_err_t -zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, void *buf, - struct grub_zfs_data *data) +static VasEBoot_err_t +zio_read_data (blkptr_t * bp, VasEBoot_zfs_endian_t endian, void *buf, + struct VasEBoot_zfs_data *data) { int i, psize; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; psize = get_psize (bp, endian); @@ -1789,18 +1789,18 @@ zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, void *buf, if (bp->blk_dva[i].dva_word[0] == 0 && bp->blk_dva[i].dva_word[1] == 0) continue; - if ((grub_zfs_to_cpu64 (bp->blk_dva[i].dva_word[1], endian)>>63) & 1) + if ((VasEBoot_zfs_to_cpu64 (bp->blk_dva[i].dva_word[1], endian)>>63) & 1) err = zio_read_gang (bp, endian, &bp->blk_dva[i], buf, data); else err = read_dva (&bp->blk_dva[i], endian, data, buf, psize); if (!err) - return GRUB_ERR_NONE; - grub_errno = GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (!err) - err = grub_error (GRUB_ERR_BAD_FS, "couldn't find a valid DVA"); - grub_errno = err; + err = VasEBoot_error (VasEBoot_ERR_BAD_FS, "couldn't find a valid DVA"); + VasEBoot_errno = err; return err; } @@ -1809,13 +1809,13 @@ zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, void *buf, * buf must be at least BPE_GET_PSIZE(bp) bytes long (which will never be * more than BPE_PAYLOAD_SIZE bytes). */ -static grub_err_t +static VasEBoot_err_t decode_embedded_bp_compressed(const blkptr_t *bp, void *buf) { - grub_size_t psize, i; - grub_uint8_t *buf8 = buf; - grub_uint64_t w = 0; - const grub_uint64_t *bp64 = (const grub_uint64_t *)bp; + VasEBoot_size_t psize, i; + VasEBoot_uint8_t *buf8 = buf; + VasEBoot_uint64_t w = 0; + const VasEBoot_uint64_t *bp64 = (const VasEBoot_uint64_t *)bp; psize = BPE_GET_PSIZE(bp); @@ -1835,68 +1835,68 @@ decode_embedded_bp_compressed(const blkptr_t *bp, void *buf) } buf8[i] = BF64_GET(w, (i % sizeof (w)) * 8, 8); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* * Read in a block of data, verify its checksum, decompress if needed, * and put the uncompressed data in buf. */ -static grub_err_t -zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, - grub_size_t *size, struct grub_zfs_data *data) +static VasEBoot_err_t +zio_read (blkptr_t *bp, VasEBoot_zfs_endian_t endian, void **buf, + VasEBoot_size_t *size, struct VasEBoot_zfs_data *data) { - grub_size_t lsize, psize; + VasEBoot_size_t lsize, psize; unsigned int comp, encrypted; char *compbuf = NULL; - grub_err_t err; + VasEBoot_err_t err; zio_cksum_t zc = bp->blk_cksum; - grub_uint32_t checksum; + VasEBoot_uint32_t checksum; *buf = NULL; - checksum = (grub_zfs_to_cpu64((bp)->blk_prop, endian) >> 40) & 0xff; - comp = (grub_zfs_to_cpu64((bp)->blk_prop, endian)>>32) & 0x7f; - encrypted = ((grub_zfs_to_cpu64((bp)->blk_prop, endian) >> 60) & 3); + checksum = (VasEBoot_zfs_to_cpu64((bp)->blk_prop, endian) >> 40) & 0xff; + comp = (VasEBoot_zfs_to_cpu64((bp)->blk_prop, endian)>>32) & 0x7f; + encrypted = ((VasEBoot_zfs_to_cpu64((bp)->blk_prop, endian) >> 60) & 3); if (BP_IS_EMBEDDED(bp)) { if (BPE_GET_ETYPE(bp) != BP_EMBEDDED_TYPE_DATA) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported embedded BP (type=%u)\n", BPE_GET_ETYPE(bp)); lsize = BPE_GET_LSIZE(bp); - psize = BF64_GET_SB(grub_zfs_to_cpu64 ((bp)->blk_prop, endian), 25, 7, 0, 1); + psize = BF64_GET_SB(VasEBoot_zfs_to_cpu64 ((bp)->blk_prop, endian), 25, 7, 0, 1); } else { lsize = (BP_IS_HOLE(bp) ? 0 : - (((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) & 0xffff) + 1) + (((VasEBoot_zfs_to_cpu64 ((bp)->blk_prop, endian) & 0xffff) + 1) << SPA_MINBLOCKSHIFT)); psize = get_psize (bp, endian); } - grub_dprintf("zfs", "zio_read: E %d: size %" PRIdGRUB_SSIZE "/%" - PRIdGRUB_SSIZE "\n", (int)BP_IS_EMBEDDED(bp), lsize, psize); + VasEBoot_dprintf("zfs", "zio_read: E %d: size %" PRIdVasEBoot_SSIZE "/%" + PRIdVasEBoot_SSIZE "\n", (int)BP_IS_EMBEDDED(bp), lsize, psize); if (size) *size = lsize; if (comp >= ZIO_COMPRESS_FUNCTIONS) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "compression algorithm %u not supported\n", (unsigned int) comp); if (comp != ZIO_COMPRESS_OFF && decomp_table[comp].decomp_func == NULL) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "compression algorithm %s not supported\n", decomp_table[comp].name); if (comp != ZIO_COMPRESS_OFF) /* It's not really necessary to align to 16, just for safety. */ - compbuf = grub_malloc (ALIGN_UP (psize, 16)); + compbuf = VasEBoot_malloc (ALIGN_UP (psize, 16)); else - compbuf = *buf = grub_malloc (lsize); + compbuf = *buf = VasEBoot_malloc (lsize); if (! compbuf) - return grub_errno; + return VasEBoot_errno; - grub_dprintf ("zfs", "endian = %d\n", endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", endian); if (BP_IS_EMBEDDED(bp)) err = decode_embedded_bp_compressed(bp, compbuf); else @@ -1904,11 +1904,11 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, err = zio_read_data (bp, endian, compbuf, data); /* FIXME is it really necessary? */ if (comp != ZIO_COMPRESS_OFF) - grub_memset (compbuf + psize, 0, ALIGN_UP (psize, 16) - psize); + VasEBoot_memset (compbuf + psize, 0, ALIGN_UP (psize, 16) - psize); } if (err) { - grub_free (compbuf); + VasEBoot_free (compbuf); *buf = NULL; return err; } @@ -1919,8 +1919,8 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, compbuf, psize); if (err) { - grub_dprintf ("zfs", "incorrect checksum\n"); - grub_free (compbuf); + VasEBoot_dprintf ("zfs", "incorrect checksum\n"); + VasEBoot_free (compbuf); *buf = NULL; return err; } @@ -1928,16 +1928,16 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, if (encrypted) { - if (!grub_zfs_decrypt) - err = grub_error (GRUB_ERR_BAD_FS, + if (!VasEBoot_zfs_decrypt) + err = VasEBoot_error (VasEBoot_ERR_BAD_FS, N_("module `%s' isn't loaded"), "zfscrypt"); else { unsigned i, besti = 0; - grub_uint64_t bestval = 0; + VasEBoot_uint64_t bestval = 0; for (i = 0; i < data->subvol.nkeys; i++) - if (data->subvol.keyring[i].txg <= grub_zfs_to_cpu64 (bp->blk_birth, + if (data->subvol.keyring[i].txg <= VasEBoot_zfs_to_cpu64 (bp->blk_birth, endian) && data->subvol.keyring[i].txg > bestval) { @@ -1946,20 +1946,20 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, } if (bestval == 0) { - grub_free (compbuf); + VasEBoot_free (compbuf); *buf = NULL; - grub_dprintf ("zfs", "no key for txg %" PRIxGRUB_UINT64_T "\n", - grub_zfs_to_cpu64 (bp->blk_birth, + VasEBoot_dprintf ("zfs", "no key for txg %" PRIxVasEBoot_UINT64_T "\n", + VasEBoot_zfs_to_cpu64 (bp->blk_birth, endian)); - return grub_error (GRUB_ERR_BAD_FS, "no key found in keychain"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "no key found in keychain"); } - grub_dprintf ("zfs", "using key %u (%" PRIxGRUB_UINT64_T - ", %p) for txg %" PRIxGRUB_UINT64_T "\n", + VasEBoot_dprintf ("zfs", "using key %u (%" PRIxVasEBoot_UINT64_T + ", %p) for txg %" PRIxVasEBoot_UINT64_T "\n", besti, data->subvol.keyring[besti].txg, data->subvol.keyring[besti].cipher, - grub_zfs_to_cpu64 (bp->blk_birth, + VasEBoot_zfs_to_cpu64 (bp->blk_birth, endian)); - err = grub_zfs_decrypt (data->subvol.keyring[besti].cipher, + err = VasEBoot_zfs_decrypt (data->subvol.keyring[besti].cipher, data->subvol.keyring[besti].algo, &(bp)->blk_dva[encrypted], compbuf, psize, zc.zc_mac, @@ -1967,7 +1967,7 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, } if (err) { - grub_free (compbuf); + VasEBoot_free (compbuf); *buf = NULL; return err; } @@ -1975,24 +1975,24 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, if (comp != ZIO_COMPRESS_OFF) { - *buf = grub_malloc (lsize); + *buf = VasEBoot_malloc (lsize); if (!*buf) { - grub_free (compbuf); - return grub_errno; + VasEBoot_free (compbuf); + return VasEBoot_errno; } err = decomp_table[comp].decomp_func (compbuf, *buf, psize, lsize); - grub_free (compbuf); + VasEBoot_free (compbuf); if (err) { - grub_free (*buf); + VasEBoot_free (*buf); *buf = NULL; return err; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* @@ -2000,70 +2000,70 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, * push the block onto the stack. * */ -static grub_err_t -dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, - grub_zfs_endian_t *endian_out, struct grub_zfs_data *data) +static VasEBoot_err_t +dmu_read (dnode_end_t * dn, VasEBoot_uint64_t blkid, void **buf, + VasEBoot_zfs_endian_t *endian_out, struct VasEBoot_zfs_data *data) { int level; - grub_off_t idx; + VasEBoot_off_t idx; blkptr_t *bp_array = dn->dn.dn_blkptr; int epbs = dn->dn.dn_indblkshift - SPA_BLKPTRSHIFT; blkptr_t *bp; void *tmpbuf = 0; - grub_zfs_endian_t endian; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_zfs_endian_t endian; + VasEBoot_err_t err = VasEBoot_ERR_NONE; - bp = grub_malloc (sizeof (blkptr_t)); + bp = VasEBoot_malloc (sizeof (blkptr_t)); if (!bp) - return grub_errno; + return VasEBoot_errno; endian = dn->endian; for (level = dn->dn.dn_nlevels - 1; level >= 0; level--) { - grub_dprintf ("zfs", "endian = %d\n", endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", endian); idx = (blkid >> (epbs * level)) & ((1 << epbs) - 1); *bp = bp_array[idx]; if (bp_array != dn->dn.dn_blkptr) { - grub_free (bp_array); + VasEBoot_free (bp_array); bp_array = 0; } if (BP_IS_HOLE (bp)) { - grub_size_t size = grub_zfs_to_cpu16 (dn->dn.dn_datablkszsec, + VasEBoot_size_t size = VasEBoot_zfs_to_cpu16 (dn->dn.dn_datablkszsec, dn->endian) << SPA_MINBLOCKSHIFT; - *buf = grub_malloc (size); + *buf = VasEBoot_malloc (size); if (!*buf) { - err = grub_errno; + err = VasEBoot_errno; break; } - grub_memset (*buf, 0, size); - endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + VasEBoot_memset (*buf, 0, size); + endian = (VasEBoot_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; break; } if (level == 0) { - grub_dprintf ("zfs", "endian = %d\n", endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", endian); err = zio_read (bp, endian, buf, 0, data); - endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + endian = (VasEBoot_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; break; } - grub_dprintf ("zfs", "endian = %d\n", endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", endian); err = zio_read (bp, endian, &tmpbuf, 0, data); - endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + endian = (VasEBoot_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; if (err) break; bp_array = tmpbuf; } if (bp_array != dn->dn.dn_blkptr) - grub_free (bp_array); + VasEBoot_free (bp_array); if (endian_out) *endian_out = endian; - grub_free (bp); + VasEBoot_free (bp); return err; } @@ -2071,35 +2071,35 @@ dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, * mzap_lookup: Looks up property described by "name" and returns the value * in "value". */ -static grub_err_t -mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian, - grub_uint32_t objsize, const char *name, grub_uint64_t * value, +static VasEBoot_err_t +mzap_lookup (mzap_phys_t * zapobj, VasEBoot_zfs_endian_t endian, + VasEBoot_uint32_t objsize, const char *name, VasEBoot_uint64_t * value, int case_insensitive) { - grub_uint32_t i, chunks; + VasEBoot_uint32_t i, chunks; mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; if (objsize < MZAP_ENT_LEN) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); chunks = objsize / MZAP_ENT_LEN - 1; for (i = 0; i < chunks; i++) { - if (case_insensitive ? (grub_strcasecmp (mzap_ent[i].mze_name, name) == 0) - : (grub_strcmp (mzap_ent[i].mze_name, name) == 0)) + if (case_insensitive ? (VasEBoot_strcasecmp (mzap_ent[i].mze_name, name) == 0) + : (VasEBoot_strcmp (mzap_ent[i].mze_name, name) == 0)) { - *value = grub_zfs_to_cpu64 (mzap_ent[i].mze_value, endian); - return GRUB_ERR_NONE; + *value = VasEBoot_zfs_to_cpu64 (mzap_ent[i].mze_value, endian); + return VasEBoot_ERR_NONE; } } - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); } static int -mzap_iterate (mzap_phys_t * zapobj, grub_zfs_endian_t endian, int objsize, - int (*hook) (const char *name, grub_uint64_t val, - struct grub_zfs_dir_ctx *ctx), - struct grub_zfs_dir_ctx *ctx) +mzap_iterate (mzap_phys_t * zapobj, VasEBoot_zfs_endian_t endian, int objsize, + int (*hook) (const char *name, VasEBoot_uint64_t val, + struct VasEBoot_zfs_dir_ctx *ctx), + struct VasEBoot_zfs_dir_ctx *ctx) { int i, chunks; mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; @@ -2107,29 +2107,29 @@ mzap_iterate (mzap_phys_t * zapobj, grub_zfs_endian_t endian, int objsize, chunks = objsize / MZAP_ENT_LEN - 1; for (i = 0; i < chunks; i++) { - grub_dprintf ("zfs", "zap: name = %s, value = %llx, cd = %x\n", + VasEBoot_dprintf ("zfs", "zap: name = %s, value = %llx, cd = %x\n", mzap_ent[i].mze_name, (long long)mzap_ent[i].mze_value, (int)mzap_ent[i].mze_cd); if (hook (mzap_ent[i].mze_name, - grub_zfs_to_cpu64 (mzap_ent[i].mze_value, endian), ctx)) + VasEBoot_zfs_to_cpu64 (mzap_ent[i].mze_value, endian), ctx)) return 1; } return 0; } -static grub_uint64_t -zap_hash (grub_uint64_t salt, const char *name, +static VasEBoot_uint64_t +zap_hash (VasEBoot_uint64_t salt, const char *name, int case_insensitive) { - static grub_uint64_t table[256]; - const grub_uint8_t *cp; - grub_uint8_t c; - grub_uint64_t crc = salt; + static VasEBoot_uint64_t table[256]; + const VasEBoot_uint8_t *cp; + VasEBoot_uint8_t c; + VasEBoot_uint64_t crc = salt; if (table[128] == 0) { - grub_uint64_t *ct; + VasEBoot_uint64_t *ct; int i, j; for (i = 0; i < 256; i++) { @@ -2139,10 +2139,10 @@ zap_hash (grub_uint64_t salt, const char *name, } if (case_insensitive) - for (cp = (const grub_uint8_t *) name; (c = *cp) != '\0'; cp++) - crc = (crc >> 8) ^ table[(crc ^ grub_toupper (c)) & 0xFF]; + for (cp = (const VasEBoot_uint8_t *) name; (c = *cp) != '\0'; cp++) + crc = (crc >> 8) ^ table[(crc ^ VasEBoot_toupper (c)) & 0xFF]; else - for (cp = (const grub_uint8_t *) name; (c = *cp) != '\0'; cp++) + for (cp = (const VasEBoot_uint8_t *) name; (c = *cp) != '\0'; cp++) crc = (crc >> 8) ^ table[(crc ^ c) & 0xFF]; /* @@ -2163,19 +2163,19 @@ zap_hash (grub_uint64_t salt, const char *name, */ static inline int -name_cmp (const char *s1, const char *s2, grub_size_t n, +name_cmp (const char *s1, const char *s2, VasEBoot_size_t n, int case_insensitive) { const char *t1 = (const char *) s1; const char *t2 = (const char *) s2; if (!case_insensitive) - return grub_memcmp (t1, t2, n); + return VasEBoot_memcmp (t1, t2, n); while (n--) { - if (grub_toupper (*t1) != grub_toupper (*t2)) - return (int) grub_toupper (*t1) - (int) grub_toupper (*t2); + if (VasEBoot_toupper (*t1) != VasEBoot_toupper (*t2)) + return (int) VasEBoot_toupper (*t1) - (int) VasEBoot_toupper (*t2); t1++; t2++; @@ -2186,16 +2186,16 @@ name_cmp (const char *s1, const char *s2, grub_size_t n, /* XXX */ static int -zap_leaf_array_equal (zap_leaf_phys_t * l, grub_zfs_endian_t endian, - int blksft, int chunk, grub_size_t array_len, +zap_leaf_array_equal (zap_leaf_phys_t * l, VasEBoot_zfs_endian_t endian, + int blksft, int chunk, VasEBoot_size_t array_len, const char *buf, int case_insensitive) { - grub_size_t bseen = 0; + VasEBoot_size_t bseen = 0; while (bseen < array_len) { struct zap_leaf_array *la = &ZAP_LEAF_CHUNK (l, blksft, chunk)->l_array; - grub_size_t toread = array_len - bseen; + VasEBoot_size_t toread = array_len - bseen; if (toread > ZAP_LEAF_ARRAY_BYTES) toread = ZAP_LEAF_ARRAY_BYTES; @@ -2206,36 +2206,36 @@ zap_leaf_array_equal (zap_leaf_phys_t * l, grub_zfs_endian_t endian, if (name_cmp ((char *) la->la_array, buf + bseen, toread, case_insensitive) != 0) break; - chunk = grub_zfs_to_cpu16 (la->la_next, endian); + chunk = VasEBoot_zfs_to_cpu16 (la->la_next, endian); bseen += toread; } return (bseen == array_len); } /* XXX */ -static grub_err_t -zap_leaf_array_get (zap_leaf_phys_t * l, grub_zfs_endian_t endian, int blksft, - int chunk, grub_size_t array_len, char *buf) +static VasEBoot_err_t +zap_leaf_array_get (zap_leaf_phys_t * l, VasEBoot_zfs_endian_t endian, int blksft, + int chunk, VasEBoot_size_t array_len, char *buf) { - grub_size_t bseen = 0; + VasEBoot_size_t bseen = 0; while (bseen < array_len) { struct zap_leaf_array *la = &ZAP_LEAF_CHUNK (l, blksft, chunk)->l_array; - grub_size_t toread = array_len - bseen; + VasEBoot_size_t toread = array_len - bseen; if (toread > ZAP_LEAF_ARRAY_BYTES) toread = ZAP_LEAF_ARRAY_BYTES; if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft)) - /* Don't use grub_error because this error is to be ignored. */ - return GRUB_ERR_BAD_FS; + /* Don't use VasEBoot_error because this error is to be ignored. */ + return VasEBoot_ERR_BAD_FS; - grub_memcpy (buf + bseen,la->la_array, toread); - chunk = grub_zfs_to_cpu16 (la->la_next, endian); + VasEBoot_memcpy (buf + bseen,la->la_array, toread); + chunk = VasEBoot_zfs_to_cpu16 (la->la_next, endian); bseen += toread; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } @@ -2245,74 +2245,74 @@ zap_leaf_array_get (zap_leaf_phys_t * l, grub_zfs_endian_t endian, int blksft, * */ /* XXX */ -static grub_err_t -zap_leaf_lookup (zap_leaf_phys_t * l, grub_zfs_endian_t endian, - int blksft, grub_uint64_t h, - const char *name, grub_uint64_t * value, +static VasEBoot_err_t +zap_leaf_lookup (zap_leaf_phys_t * l, VasEBoot_zfs_endian_t endian, + int blksft, VasEBoot_uint64_t h, + const char *name, VasEBoot_uint64_t * value, int case_insensitive) { - grub_uint16_t chunk; + VasEBoot_uint16_t chunk; struct zap_leaf_entry *le; /* Verify if this is a valid leaf block */ - if (grub_zfs_to_cpu64 (l->l_hdr.lh_block_type, endian) != ZBT_LEAF) - return grub_error (GRUB_ERR_BAD_FS, "invalid leaf type"); - if (grub_zfs_to_cpu32 (l->l_hdr.lh_magic, endian) != ZAP_LEAF_MAGIC) - return grub_error (GRUB_ERR_BAD_FS, "invalid leaf magic"); + if (VasEBoot_zfs_to_cpu64 (l->l_hdr.lh_block_type, endian) != ZBT_LEAF) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid leaf type"); + if (VasEBoot_zfs_to_cpu32 (l->l_hdr.lh_magic, endian) != ZAP_LEAF_MAGIC) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid leaf magic"); - for (chunk = grub_zfs_to_cpu16 (l->l_hash[LEAF_HASH (blksft, h, l)], endian); - chunk != CHAIN_END; chunk = grub_zfs_to_cpu16 (le->le_next, endian)) + for (chunk = VasEBoot_zfs_to_cpu16 (l->l_hash[LEAF_HASH (blksft, h, l)], endian); + chunk != CHAIN_END; chunk = VasEBoot_zfs_to_cpu16 (le->le_next, endian)) { if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft)) - return grub_error (GRUB_ERR_BAD_FS, "invalid chunk number"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid chunk number"); le = ZAP_LEAF_ENTRY (l, blksft, chunk); /* Verify the chunk entry */ if (le->le_type != ZAP_CHUNK_ENTRY) - return grub_error (GRUB_ERR_BAD_FS, "invalid chunk entry"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid chunk entry"); - if (grub_zfs_to_cpu64 (le->le_hash,endian) != h) + if (VasEBoot_zfs_to_cpu64 (le->le_hash,endian) != h) continue; - grub_dprintf ("zfs", "fzap: length %d\n", (int) le->le_name_length); + VasEBoot_dprintf ("zfs", "fzap: length %d\n", (int) le->le_name_length); if (zap_leaf_array_equal (l, endian, blksft, - grub_zfs_to_cpu16 (le->le_name_chunk,endian), - grub_zfs_to_cpu16 (le->le_name_length, endian), + VasEBoot_zfs_to_cpu16 (le->le_name_chunk,endian), + VasEBoot_zfs_to_cpu16 (le->le_name_length, endian), name, case_insensitive)) { struct zap_leaf_array *la; - if (le->le_int_size != 8 || grub_zfs_to_cpu16 (le->le_value_length, + if (le->le_int_size != 8 || VasEBoot_zfs_to_cpu16 (le->le_value_length, endian) != 1) - return grub_error (GRUB_ERR_BAD_FS, "invalid leaf chunk entry"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid leaf chunk entry"); /* get the uint64_t property value */ la = &ZAP_LEAF_CHUNK (l, blksft, le->le_value_chunk)->l_array; - *value = grub_be_to_cpu64 (la->la_array64); + *value = VasEBoot_be_to_cpu64 (la->la_array64); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); } /* Verify if this is a fat zap header block */ -static grub_err_t -zap_verify (zap_phys_t *zap, grub_zfs_endian_t endian) +static VasEBoot_err_t +zap_verify (zap_phys_t *zap, VasEBoot_zfs_endian_t endian) { - if (grub_zfs_to_cpu64 (zap->zap_magic, endian) != (grub_uint64_t) ZAP_MAGIC) - return grub_error (GRUB_ERR_BAD_FS, "bad ZAP magic"); + if (VasEBoot_zfs_to_cpu64 (zap->zap_magic, endian) != (VasEBoot_uint64_t) ZAP_MAGIC) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "bad ZAP magic"); if (zap->zap_salt == 0) - return grub_error (GRUB_ERR_BAD_FS, "bad ZAP salt"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "bad ZAP salt"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* @@ -2320,17 +2320,17 @@ zap_verify (zap_phys_t *zap, grub_zfs_endian_t endian) * */ /* XXX */ -static grub_err_t +static VasEBoot_err_t fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap, - const char *name, grub_uint64_t * value, - struct grub_zfs_data *data, int case_insensitive) + const char *name, VasEBoot_uint64_t * value, + struct VasEBoot_zfs_data *data, int case_insensitive) { void *l; - grub_uint64_t hash, idx, blkid; - int blksft = zfs_log2 (grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + VasEBoot_uint64_t hash, idx, blkid; + int blksft = zfs_log2 (VasEBoot_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, zap_dnode->endian) << DNODE_SHIFT); - grub_err_t err; - grub_zfs_endian_t leafendian; + VasEBoot_err_t err; + VasEBoot_zfs_endian_t leafendian; err = zap_verify (zap, zap_dnode->endian); if (err) @@ -2340,42 +2340,42 @@ fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap, /* get block id from index */ if (zap->zap_ptrtbl.zt_numblks != 0) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "external pointer tables not supported"); idx = ZAP_HASH_IDX (hash, zap->zap_ptrtbl.zt_shift); - blkid = grub_zfs_to_cpu64 (((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))], zap_dnode->endian); + blkid = VasEBoot_zfs_to_cpu64 (((VasEBoot_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))], zap_dnode->endian); /* Get the leaf block */ if ((1U << blksft) < sizeof (zap_leaf_phys_t)) - return grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "ZAP leaf is too small"); err = dmu_read (zap_dnode, blkid, &l, &leafendian, data); if (err) return err; err = zap_leaf_lookup (l, leafendian, blksft, hash, name, value, case_insensitive); - grub_free (l); + VasEBoot_free (l); return err; } /* XXX */ static int fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap, - grub_size_t name_elem_length, - int (*hook) (const void *name, grub_size_t name_length, + VasEBoot_size_t name_elem_length, + int (*hook) (const void *name, VasEBoot_size_t name_length, const void *val_in, - grub_size_t nelem, grub_size_t elemsize, + VasEBoot_size_t nelem, VasEBoot_size_t elemsize, void *data), - void *hook_data, struct grub_zfs_data *data) + void *hook_data, struct VasEBoot_zfs_data *data) { zap_leaf_phys_t *l; void *l_in; - grub_uint64_t idx, idx2, blkid; - grub_uint16_t chunk; - int blksft = zfs_log2 (grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + VasEBoot_uint64_t idx, idx2, blkid; + VasEBoot_uint16_t chunk; + int blksft = zfs_log2 (VasEBoot_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, zap_dnode->endian) << DNODE_SHIFT); - grub_err_t err; - grub_zfs_endian_t endian; + VasEBoot_err_t err; + VasEBoot_zfs_endian_t endian; if (zap_verify (zap, zap_dnode->endian)) return 0; @@ -2383,23 +2383,23 @@ fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap, /* get block id from index */ if (zap->zap_ptrtbl.zt_numblks != 0) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "external pointer tables not supported"); return 0; } /* Get the leaf block */ if ((1U << blksft) < sizeof (zap_leaf_phys_t)) { - grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "ZAP leaf is too small"); return 0; } for (idx = 0; idx < (1ULL << zap->zap_ptrtbl.zt_shift); idx++) { - blkid = grub_zfs_to_cpu64 (((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))], + blkid = VasEBoot_zfs_to_cpu64 (((VasEBoot_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))], zap_dnode->endian); for (idx2 = 0; idx2 < idx; idx2++) - if (blkid == grub_zfs_to_cpu64 (((grub_uint64_t *) zap)[idx2 + (1 << (blksft - 3 - 1))], + if (blkid == VasEBoot_zfs_to_cpu64 (((VasEBoot_uint64_t *) zap)[idx2 + (1 << (blksft - 3 - 1))], zap_dnode->endian)) break; if (idx2 != idx) @@ -2409,19 +2409,19 @@ fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap, l = l_in; if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } /* Verify if this is a valid leaf block */ - if (grub_zfs_to_cpu64 (l->l_hdr.lh_block_type, endian) != ZBT_LEAF) + if (VasEBoot_zfs_to_cpu64 (l->l_hdr.lh_block_type, endian) != ZBT_LEAF) { - grub_free (l); + VasEBoot_free (l); continue; } - if (grub_zfs_to_cpu32 (l->l_hdr.lh_magic, endian) != ZAP_LEAF_MAGIC) + if (VasEBoot_zfs_to_cpu32 (l->l_hdr.lh_magic, endian) != ZAP_LEAF_MAGIC) { - grub_free (l); + VasEBoot_free (l); continue; } @@ -2430,50 +2430,50 @@ fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap, char *buf; struct zap_leaf_entry *le; char *val; - grub_size_t val_length; + VasEBoot_size_t val_length; le = ZAP_LEAF_ENTRY (l, blksft, chunk); /* Verify the chunk entry */ if (le->le_type != ZAP_CHUNK_ENTRY) continue; - buf = grub_malloc (grub_zfs_to_cpu16 (le->le_name_length, endian) + buf = VasEBoot_malloc (VasEBoot_zfs_to_cpu16 (le->le_name_length, endian) * name_elem_length + 1); if (zap_leaf_array_get (l, endian, blksft, - grub_zfs_to_cpu16 (le->le_name_chunk, + VasEBoot_zfs_to_cpu16 (le->le_name_chunk, endian), - grub_zfs_to_cpu16 (le->le_name_length, + VasEBoot_zfs_to_cpu16 (le->le_name_length, endian) * name_elem_length, buf)) { - grub_free (buf); + VasEBoot_free (buf); continue; } buf[le->le_name_length * name_elem_length] = 0; val_length = ((int) le->le_value_length * (int) le->le_int_size); - val = grub_malloc (grub_zfs_to_cpu16 (val_length, endian)); + val = VasEBoot_malloc (VasEBoot_zfs_to_cpu16 (val_length, endian)); if (zap_leaf_array_get (l, endian, blksft, - grub_zfs_to_cpu16 (le->le_value_chunk, + VasEBoot_zfs_to_cpu16 (le->le_value_chunk, endian), val_length, val)) { - grub_free (buf); - grub_free (val); + VasEBoot_free (buf); + VasEBoot_free (val); continue; } if (hook (buf, le->le_name_length, val, le->le_value_length, le->le_int_size, hook_data)) { - grub_free (l); + VasEBoot_free (l); return 1; } - grub_free (buf); - grub_free (val); + VasEBoot_free (buf); + VasEBoot_free (val); } - grub_free (l); + VasEBoot_free (l); } return 0; } @@ -2483,102 +2483,102 @@ fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap, * property name. * */ -static grub_err_t -zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val, - struct grub_zfs_data *data, int case_insensitive) +static VasEBoot_err_t +zap_lookup (dnode_end_t * zap_dnode, const char *name, VasEBoot_uint64_t *val, + struct VasEBoot_zfs_data *data, int case_insensitive) { - grub_uint64_t block_type; - grub_uint32_t size; + VasEBoot_uint64_t block_type; + VasEBoot_uint32_t size; void *zapbuf; - grub_err_t err; - grub_zfs_endian_t endian; + VasEBoot_err_t err; + VasEBoot_zfs_endian_t endian; - grub_dprintf ("zfs", "looking for '%s'\n", name); + VasEBoot_dprintf ("zfs", "looking for '%s'\n", name); /* Read in the first block of the zap object data. */ - size = (grub_uint32_t) grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + size = (VasEBoot_uint32_t) VasEBoot_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, zap_dnode->endian) << SPA_MINBLOCKSHIFT; err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data); if (err) return err; - block_type = grub_zfs_to_cpu64 (*((grub_uint64_t *) zapbuf), endian); + block_type = VasEBoot_zfs_to_cpu64 (*((VasEBoot_uint64_t *) zapbuf), endian); - grub_dprintf ("zfs", "zap read\n"); + VasEBoot_dprintf ("zfs", "zap read\n"); if (block_type == ZBT_MICRO) { - grub_dprintf ("zfs", "micro zap\n"); + VasEBoot_dprintf ("zfs", "micro zap\n"); err = mzap_lookup (zapbuf, endian, size, name, val, case_insensitive); - grub_dprintf ("zfs", "returned %d\n", err); - grub_free (zapbuf); + VasEBoot_dprintf ("zfs", "returned %d\n", err); + VasEBoot_free (zapbuf); return err; } else if (block_type == ZBT_HEADER) { - grub_dprintf ("zfs", "fat zap\n"); + VasEBoot_dprintf ("zfs", "fat zap\n"); /* this is a fat zap */ err = fzap_lookup (zap_dnode, zapbuf, name, val, data, case_insensitive); - grub_dprintf ("zfs", "returned %d\n", err); - grub_free (zapbuf); + VasEBoot_dprintf ("zfs", "returned %d\n", err); + VasEBoot_free (zapbuf); return err; } - return grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "unknown ZAP type"); } /* Context for zap_iterate_u64. */ struct zap_iterate_u64_ctx { - int (*hook) (const char *, grub_uint64_t, struct grub_zfs_dir_ctx *); - struct grub_zfs_dir_ctx *dir_ctx; + int (*hook) (const char *, VasEBoot_uint64_t, struct VasEBoot_zfs_dir_ctx *); + struct VasEBoot_zfs_dir_ctx *dir_ctx; }; /* Helper for zap_iterate_u64. */ static int zap_iterate_u64_transform (const void *name, - grub_size_t namelen __attribute__ ((unused)), + VasEBoot_size_t namelen __attribute__ ((unused)), const void *val_in, - grub_size_t nelem, - grub_size_t elemsize, + VasEBoot_size_t nelem, + VasEBoot_size_t elemsize, void *data) { struct zap_iterate_u64_ctx *ctx = data; - if (elemsize != sizeof (grub_uint64_t) || nelem != 1) + if (elemsize != sizeof (VasEBoot_uint64_t) || nelem != 1) return 0; - return ctx->hook (name, grub_be_to_cpu64 (*(const grub_uint64_t *) val_in), + return ctx->hook (name, VasEBoot_be_to_cpu64 (*(const VasEBoot_uint64_t *) val_in), ctx->dir_ctx); } static int zap_iterate_u64 (dnode_end_t * zap_dnode, - int (*hook) (const char *name, grub_uint64_t val, - struct grub_zfs_dir_ctx *ctx), - struct grub_zfs_data *data, struct grub_zfs_dir_ctx *ctx) + int (*hook) (const char *name, VasEBoot_uint64_t val, + struct VasEBoot_zfs_dir_ctx *ctx), + struct VasEBoot_zfs_data *data, struct VasEBoot_zfs_dir_ctx *ctx) { - grub_uint64_t block_type; + VasEBoot_uint64_t block_type; int size; void *zapbuf; - grub_err_t err; + VasEBoot_err_t err; int ret; - grub_zfs_endian_t endian; + VasEBoot_zfs_endian_t endian; /* Read in the first block of the zap object data. */ - size = grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, zap_dnode->endian) << SPA_MINBLOCKSHIFT; + size = VasEBoot_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, zap_dnode->endian) << SPA_MINBLOCKSHIFT; err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data); if (err) return 0; - block_type = grub_zfs_to_cpu64 (*((grub_uint64_t *) zapbuf), endian); + block_type = VasEBoot_zfs_to_cpu64 (*((VasEBoot_uint64_t *) zapbuf), endian); - grub_dprintf ("zfs", "zap iterate\n"); + VasEBoot_dprintf ("zfs", "zap iterate\n"); if (block_type == ZBT_MICRO) { - grub_dprintf ("zfs", "micro zap\n"); + VasEBoot_dprintf ("zfs", "micro zap\n"); ret = mzap_iterate (zapbuf, endian, size, hook, ctx); - grub_free (zapbuf); + VasEBoot_free (zapbuf); return ret; } else if (block_type == ZBT_HEADER) @@ -2588,55 +2588,55 @@ zap_iterate_u64 (dnode_end_t * zap_dnode, .dir_ctx = ctx }; - grub_dprintf ("zfs", "fat zap\n"); + VasEBoot_dprintf ("zfs", "fat zap\n"); /* this is a fat zap */ ret = fzap_iterate (zap_dnode, zapbuf, 1, zap_iterate_u64_transform, &transform_ctx, data); - grub_free (zapbuf); + VasEBoot_free (zapbuf); return ret; } - grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "unknown ZAP type"); return 0; } static int zap_iterate (dnode_end_t * zap_dnode, - grub_size_t nameelemlen, - int (*hook) (const void *name, grub_size_t namelen, + VasEBoot_size_t nameelemlen, + int (*hook) (const void *name, VasEBoot_size_t namelen, const void *val_in, - grub_size_t nelem, grub_size_t elemsize, + VasEBoot_size_t nelem, VasEBoot_size_t elemsize, void *data), - void *hook_data, struct grub_zfs_data *data) + void *hook_data, struct VasEBoot_zfs_data *data) { - grub_uint64_t block_type; + VasEBoot_uint64_t block_type; void *zapbuf; - grub_err_t err; + VasEBoot_err_t err; int ret; - grub_zfs_endian_t endian; + VasEBoot_zfs_endian_t endian; /* Read in the first block of the zap object data. */ err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data); if (err) return 0; - block_type = grub_zfs_to_cpu64 (*((grub_uint64_t *) zapbuf), endian); + block_type = VasEBoot_zfs_to_cpu64 (*((VasEBoot_uint64_t *) zapbuf), endian); - grub_dprintf ("zfs", "zap iterate\n"); + VasEBoot_dprintf ("zfs", "zap iterate\n"); if (block_type == ZBT_MICRO) { - grub_error (GRUB_ERR_BAD_FS, "micro ZAP where FAT ZAP expected"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "micro ZAP where FAT ZAP expected"); return 0; } if (block_type == ZBT_HEADER) { - grub_dprintf ("zfs", "fat zap\n"); + VasEBoot_dprintf ("zfs", "fat zap\n"); /* this is a fat zap */ ret = fzap_iterate (zap_dnode, zapbuf, nameelemlen, hook, hook_data, data); - grub_free (zapbuf); + VasEBoot_free (zapbuf); return ret; } - grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "unknown ZAP type"); return 0; } @@ -2649,64 +2649,64 @@ zap_iterate (dnode_end_t * zap_dnode, * objnum - object number for the object dnode * buf - data buffer that holds the returning dnode */ -static grub_err_t -dnode_get (dnode_end_t * mdn, grub_uint64_t objnum, grub_uint8_t type, - dnode_end_t * buf, struct grub_zfs_data *data) +static VasEBoot_err_t +dnode_get (dnode_end_t * mdn, VasEBoot_uint64_t objnum, VasEBoot_uint8_t type, + dnode_end_t * buf, struct VasEBoot_zfs_data *data) { - grub_uint64_t blkid, blksz; /* the block id this object dnode is in */ + VasEBoot_uint64_t blkid, blksz; /* the block id this object dnode is in */ int epbs; /* shift of number of dnodes in a block */ int idx; /* index within a block */ void *dnbuf; - grub_err_t err; - grub_zfs_endian_t endian; + VasEBoot_err_t err; + VasEBoot_zfs_endian_t endian; - blksz = grub_zfs_to_cpu16 (mdn->dn.dn_datablkszsec, + blksz = VasEBoot_zfs_to_cpu16 (mdn->dn.dn_datablkszsec, mdn->endian) << SPA_MINBLOCKSHIFT; epbs = zfs_log2 (blksz) - DNODE_SHIFT; blkid = objnum >> epbs; idx = objnum & ((1 << epbs) - 1); - if (data->dnode_buf != NULL && grub_memcmp (data->dnode_mdn, mdn, + if (data->dnode_buf != NULL && VasEBoot_memcmp (data->dnode_mdn, mdn, sizeof (*mdn)) == 0 && objnum >= data->dnode_start && objnum < data->dnode_end) { - grub_memmove (&(buf->dn), &(data->dnode_buf)[idx], DNODE_SIZE); + VasEBoot_memmove (&(buf->dn), &(data->dnode_buf)[idx], DNODE_SIZE); buf->endian = data->dnode_endian; if (type && buf->dn.dn_type != type) - return grub_error(GRUB_ERR_BAD_FS, "incorrect dnode type"); - return GRUB_ERR_NONE; + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "incorrect dnode type"); + return VasEBoot_ERR_NONE; } - grub_dprintf ("zfs", "endian = %d, blkid=%llx\n", mdn->endian, + VasEBoot_dprintf ("zfs", "endian = %d, blkid=%llx\n", mdn->endian, (unsigned long long) blkid); err = dmu_read (mdn, blkid, &dnbuf, &endian, data); if (err) return err; - grub_dprintf ("zfs", "alive\n"); + VasEBoot_dprintf ("zfs", "alive\n"); - grub_free (data->dnode_buf); - grub_free (data->dnode_mdn); - data->dnode_mdn = grub_malloc (sizeof (*mdn)); + VasEBoot_free (data->dnode_buf); + VasEBoot_free (data->dnode_mdn); + data->dnode_mdn = VasEBoot_malloc (sizeof (*mdn)); if (! data->dnode_mdn) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; data->dnode_buf = 0; } else { - grub_memcpy (data->dnode_mdn, mdn, sizeof (*mdn)); + VasEBoot_memcpy (data->dnode_mdn, mdn, sizeof (*mdn)); data->dnode_buf = dnbuf; data->dnode_start = blkid << epbs; data->dnode_end = (blkid + 1) << epbs; data->dnode_endian = endian; } - grub_memmove (&(buf->dn), (dnode_phys_t *) dnbuf + idx, DNODE_SIZE); + VasEBoot_memmove (&(buf->dn), (dnode_phys_t *) dnbuf + idx, DNODE_SIZE); buf->endian = endian; if (type && buf->dn.dn_type != type) - return grub_error(GRUB_ERR_BAD_FS, "incorrect dnode type"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "incorrect dnode type"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -2717,13 +2717,13 @@ dnode_get (dnode_end_t * mdn, grub_uint64_t objnum, grub_uint8_t type, * The 'path' argument will be mangled. * */ -static grub_err_t +static VasEBoot_err_t dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, - struct grub_zfs_data *data) + struct VasEBoot_zfs_data *data) { - grub_uint64_t objnum, version; + VasEBoot_uint64_t objnum, version; char *cname, ch; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; char *path, *path_buf; struct dnode_chain { @@ -2732,9 +2732,9 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, }; struct dnode_chain *dnode_path = 0, *dn_new, *root; - dn_new = grub_malloc (sizeof (*dn_new)); + dn_new = VasEBoot_malloc (sizeof (*dn_new)); if (! dn_new) - return grub_errno; + return VasEBoot_errno; dn_new->next = 0; dnode_path = root = dn_new; @@ -2742,7 +2742,7 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, &(dnode_path->dn), data); if (err) { - grub_free (dn_new); + VasEBoot_free (dn_new); return err; } @@ -2750,44 +2750,44 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, data, 0); if (err) { - grub_free (dn_new); + VasEBoot_free (dn_new); return err; } if (version > ZPL_VERSION) { - grub_free (dn_new); - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "too new ZPL version"); + VasEBoot_free (dn_new); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "too new ZPL version"); } err = zap_lookup (&(dnode_path->dn), "casesensitivity", &subvol->case_insensitive, data, 0); - if (err == GRUB_ERR_FILE_NOT_FOUND) + if (err == VasEBoot_ERR_FILE_NOT_FOUND) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; subvol->case_insensitive = 0; } err = zap_lookup (&(dnode_path->dn), ZFS_ROOT_OBJ, &objnum, data, 0); if (err) { - grub_free (dn_new); + VasEBoot_free (dn_new); return err; } err = dnode_get (&subvol->mdn, objnum, 0, &(dnode_path->dn), data); if (err) { - grub_free (dn_new); + VasEBoot_free (dn_new); return err; } - path = path_buf = grub_strdup (path_in); + path = path_buf = VasEBoot_strdup (path_in); if (!path_buf) { - grub_free (dn_new); - return grub_errno; + VasEBoot_free (dn_new); + return VasEBoot_errno; } while (1) @@ -2811,11 +2811,11 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, { dn_new = dnode_path; dnode_path = dn_new->next; - grub_free (dn_new); + VasEBoot_free (dn_new); } else { - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "can't resolve .."); break; } @@ -2827,18 +2827,18 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, if (dnode_path->dn.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS) { - grub_free (path_buf); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + VasEBoot_free (path_buf); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); } err = zap_lookup (&(dnode_path->dn), cname, &objnum, data, subvol->case_insensitive); if (err) break; - dn_new = grub_malloc (sizeof (*dn_new)); + dn_new = VasEBoot_malloc (sizeof (*dn_new)); if (! dn_new) { - err = grub_errno; + err = VasEBoot_errno; break; } dn_new->next = dnode_path; @@ -2851,39 +2851,39 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, *path = ch; if (dnode_path->dn.dn.dn_bonustype == DMU_OT_ZNODE - && ((grub_zfs_to_cpu64(((znode_phys_t *) DN_BONUS (&dnode_path->dn.dn))->zp_mode, dnode_path->dn.endian) >> 12) & 0xf) == 0xa) + && ((VasEBoot_zfs_to_cpu64(((znode_phys_t *) DN_BONUS (&dnode_path->dn.dn))->zp_mode, dnode_path->dn.endian) >> 12) & 0xf) == 0xa) { char *sym_value; - grub_size_t sym_sz; + VasEBoot_size_t sym_sz; int free_symval = 0; char *oldpath = path, *oldpathbuf = path_buf; sym_value = ((char *) DN_BONUS (&dnode_path->dn.dn) + sizeof (struct znode_phys)); - sym_sz = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dnode_path->dn.dn))->zp_size, dnode_path->dn.endian); + sym_sz = VasEBoot_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dnode_path->dn.dn))->zp_size, dnode_path->dn.endian); if (dnode_path->dn.dn.dn_flags & 1) { - grub_size_t block; - grub_size_t blksz; - blksz = (grub_zfs_to_cpu16 (dnode_path->dn.dn.dn_datablkszsec, + VasEBoot_size_t block; + VasEBoot_size_t blksz; + blksz = (VasEBoot_zfs_to_cpu16 (dnode_path->dn.dn.dn_datablkszsec, dnode_path->dn.endian) << SPA_MINBLOCKSHIFT); if (blksz == 0) - return grub_error(GRUB_ERR_BAD_FS, "0-sized block"); + return VasEBoot_error(VasEBoot_ERR_BAD_FS, "0-sized block"); - sym_value = grub_malloc (sym_sz); + sym_value = VasEBoot_malloc (sym_sz); if (!sym_value) - return grub_errno; + return VasEBoot_errno; for (block = 0; block < (sym_sz + blksz - 1) / blksz; block++) { void *t; - grub_size_t movesize; + VasEBoot_size_t movesize; err = dmu_read (&(dnode_path->dn), block, &t, 0, data); if (err) { - grub_free (sym_value); + VasEBoot_free (sym_value); return err; } @@ -2891,38 +2891,38 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, if (movesize > blksz) movesize = blksz; - grub_memcpy (sym_value + block * blksz, t, movesize); - grub_free (t); + VasEBoot_memcpy (sym_value + block * blksz, t, movesize); + VasEBoot_free (t); } free_symval = 1; } - path = path_buf = grub_malloc (sym_sz + grub_strlen (oldpath) + 1); + path = path_buf = VasEBoot_malloc (sym_sz + VasEBoot_strlen (oldpath) + 1); if (!path_buf) { - grub_free (oldpathbuf); + VasEBoot_free (oldpathbuf); if (free_symval) - grub_free (sym_value); - return grub_errno; + VasEBoot_free (sym_value); + return VasEBoot_errno; } - grub_memcpy (path, sym_value, sym_sz); + VasEBoot_memcpy (path, sym_value, sym_sz); if (free_symval) - grub_free (sym_value); + VasEBoot_free (sym_value); path [sym_sz] = 0; - grub_memcpy (path + grub_strlen (path), oldpath, - grub_strlen (oldpath) + 1); + VasEBoot_memcpy (path + VasEBoot_strlen (path), oldpath, + VasEBoot_strlen (oldpath) + 1); - grub_free (oldpathbuf); + VasEBoot_free (oldpathbuf); if (path[0] != '/') { dn_new = dnode_path; dnode_path = dn_new->next; - grub_free (dn_new); + VasEBoot_free (dn_new); } else while (dnode_path != root) { dn_new = dnode_path; dnode_path = dn_new->next; - grub_free (dn_new); + VasEBoot_free (dn_new); } } if (dnode_path->dn.dn.dn_bonustype == DMU_OT_SA) @@ -2944,61 +2944,61 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, } else { - return grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "filesystem is corrupt"); } hdrsize = SA_HDR_SIZE (((sa_hdr_phys_t *) sahdrp)); - if (((grub_zfs_to_cpu64 (grub_get_unaligned64 ((char *) sahdrp + if (((VasEBoot_zfs_to_cpu64 (VasEBoot_get_unaligned64 ((char *) sahdrp + hdrsize + SA_TYPE_OFFSET), dnode_path->dn.endian) >> 12) & 0xf) == 0xa) { char *sym_value = (char *) sahdrp + hdrsize + SA_SYMLINK_OFFSET; - grub_size_t sym_sz = - grub_zfs_to_cpu64 (grub_get_unaligned64 ((char *) sahdrp + VasEBoot_size_t sym_sz = + VasEBoot_zfs_to_cpu64 (VasEBoot_get_unaligned64 ((char *) sahdrp + hdrsize + SA_SIZE_OFFSET), dnode_path->dn.endian); char *oldpath = path, *oldpathbuf = path_buf; - path = path_buf = grub_malloc (sym_sz + grub_strlen (oldpath) + 1); + path = path_buf = VasEBoot_malloc (sym_sz + VasEBoot_strlen (oldpath) + 1); if (!path_buf) { - grub_free (oldpathbuf); - return grub_errno; + VasEBoot_free (oldpathbuf); + return VasEBoot_errno; } - grub_memcpy (path, sym_value, sym_sz); + VasEBoot_memcpy (path, sym_value, sym_sz); path [sym_sz] = 0; - grub_memcpy (path + grub_strlen (path), oldpath, - grub_strlen (oldpath) + 1); + VasEBoot_memcpy (path + VasEBoot_strlen (path), oldpath, + VasEBoot_strlen (oldpath) + 1); - grub_free (oldpathbuf); + VasEBoot_free (oldpathbuf); if (path[0] != '/') { dn_new = dnode_path; dnode_path = dn_new->next; - grub_free (dn_new); + VasEBoot_free (dn_new); } else while (dnode_path != root) { dn_new = dnode_path; dnode_path = dn_new->next; - grub_free (dn_new); + VasEBoot_free (dn_new); } } } } if (!err) - grub_memcpy (dn, &(dnode_path->dn), sizeof (*dn)); + VasEBoot_memcpy (dn, &(dnode_path->dn), sizeof (*dn)); while (dnode_path) { dn_new = dnode_path->next; - grub_free (dnode_path); + VasEBoot_free (dnode_path); dnode_path = dn_new; } - grub_free (path_buf); + VasEBoot_free (path_buf); return err; } @@ -3007,20 +3007,20 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn, * Get the default 'bootfs' property value from the rootpool. * */ -static grub_err_t -get_default_bootfsobj (dnode_phys_t * mosmdn, grub_uint64_t * obj, - struct grub_zfs_data *data) +static VasEBoot_err_t +get_default_bootfsobj (dnode_phys_t * mosmdn, VasEBoot_uint64_t * obj, + struct VasEBoot_zfs_data *data) { - grub_uint64_t objnum = 0; + VasEBoot_uint64_t objnum = 0; dnode_phys_t *dn; if (!dn) - return grub_errno; + return VasEBoot_errno; - if ((grub_errno = dnode_get (mosmdn, DMU_POOL_DIRECTORY_OBJECT, + if ((VasEBoot_errno = dnode_get (mosmdn, DMU_POOL_DIRECTORY_OBJECT, DMU_OT_OBJECT_DIRECTORY, dn, data))) { - grub_free (dn); - return (grub_errno); + VasEBoot_free (dn); + return (VasEBoot_errno); } /* @@ -3029,24 +3029,24 @@ get_default_bootfsobj (dnode_phys_t * mosmdn, grub_uint64_t * obj, */ if (zap_lookup (dn, DMU_POOL_PROPS, &objnum, data)) { - grub_free (dn); - return (GRUB_ERR_BAD_FS); + VasEBoot_free (dn); + return (VasEBoot_ERR_BAD_FS); } - if ((grub_errno = dnode_get (mosmdn, objnum, DMU_OT_POOL_PROPS, dn, data))) + if ((VasEBoot_errno = dnode_get (mosmdn, objnum, DMU_OT_POOL_PROPS, dn, data))) { - grub_free (dn); - return (grub_errno); + VasEBoot_free (dn); + return (VasEBoot_errno); } if (zap_lookup (dn, ZPOOL_PROP_BOOTFS, &objnum, data)) { - grub_free (dn); - return (GRUB_ERR_BAD_FS); + VasEBoot_free (dn); + return (VasEBoot_ERR_BAD_FS); } if (!objnum) { - grub_free (dn); - return (GRUB_ERR_BAD_FS); + VasEBoot_free (dn); + return (VasEBoot_ERR_BAD_FS); } *obj = objnum; @@ -3063,37 +3063,37 @@ get_default_bootfsobj (dnode_phys_t * mosmdn, grub_uint64_t * obj, * If only obj is given, return the metadnode for this object number. * */ -static grub_err_t +static VasEBoot_err_t get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname, - dnode_end_t * mdn, struct grub_zfs_data *data) + dnode_end_t * mdn, struct VasEBoot_zfs_data *data) { - grub_uint64_t objnum; - grub_err_t err; + VasEBoot_uint64_t objnum; + VasEBoot_err_t err; - grub_dprintf ("zfs", "endian = %d\n", mosmdn->endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", mosmdn->endian); err = dnode_get (mosmdn, DMU_POOL_DIRECTORY_OBJECT, DMU_OT_OBJECT_DIRECTORY, mdn, data); if (err) return err; - grub_dprintf ("zfs", "alive\n"); + VasEBoot_dprintf ("zfs", "alive\n"); err = zap_lookup (mdn, DMU_POOL_ROOT_DATASET, &objnum, data, 0); if (err) return err; - grub_dprintf ("zfs", "alive\n"); + VasEBoot_dprintf ("zfs", "alive\n"); err = dnode_get (mosmdn, objnum, 0, mdn, data); if (err) return err; - grub_dprintf ("zfs", "alive\n"); + VasEBoot_dprintf ("zfs", "alive\n"); while (*fsname) { - grub_uint64_t childobj; + VasEBoot_uint64_t childobj; char *cname, ch; while (*fsname == '/') @@ -3108,7 +3108,7 @@ get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname, ch = *fsname; *fsname = 0; - childobj = grub_zfs_to_cpu64 ((((dsl_dir_phys_t *) DN_BONUS (&mdn->dn)))->dd_child_dir_zapobj, mdn->endian); + childobj = VasEBoot_zfs_to_cpu64 ((((dsl_dir_phys_t *) DN_BONUS (&mdn->dn)))->dd_child_dir_zapobj, mdn->endian); err = dnode_get (mosmdn, childobj, DMU_OT_DSL_DIR_CHILD_MAP, mdn, data); if (err) @@ -3124,18 +3124,18 @@ get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname, *fsname = ch; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -make_mdn (dnode_end_t * mdn, struct grub_zfs_data *data) +static VasEBoot_err_t +make_mdn (dnode_end_t * mdn, struct VasEBoot_zfs_data *data) { void *osp; blkptr_t *bp; - grub_size_t ospsize = 0; - grub_err_t err; + VasEBoot_size_t ospsize = 0; + VasEBoot_err_t err; - grub_dprintf ("zfs", "endian = %d\n", mdn->endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", mdn->endian); bp = &(((dsl_dataset_phys_t *) DN_BONUS (&mdn->dn))->ds_bp); err = zio_read (bp, mdn->endian, &osp, &ospsize, data); @@ -3143,32 +3143,32 @@ make_mdn (dnode_end_t * mdn, struct grub_zfs_data *data) return err; if (ospsize < OBJSET_PHYS_SIZE_V14) { - grub_free (osp); - return grub_error (GRUB_ERR_BAD_FS, "too small osp"); + VasEBoot_free (osp); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "too small osp"); } - mdn->endian = (grub_zfs_to_cpu64 (bp->blk_prop, mdn->endian)>>63) & 1; - grub_memmove ((char *) &(mdn->dn), + mdn->endian = (VasEBoot_zfs_to_cpu64 (bp->blk_prop, mdn->endian)>>63) & 1; + VasEBoot_memmove ((char *) &(mdn->dn), (char *) &((objset_phys_t *) osp)->os_meta_dnode, DNODE_SIZE); - grub_free (osp); - return GRUB_ERR_NONE; + VasEBoot_free (osp); + return VasEBoot_ERR_NONE; } /* Context for dnode_get_fullpath. */ struct dnode_get_fullpath_ctx { struct subvolume *subvol; - grub_uint64_t salt; + VasEBoot_uint64_t salt; int keyn; }; /* Helper for dnode_get_fullpath. */ static int count_zap_keys (const void *name __attribute__ ((unused)), - grub_size_t namelen __attribute__ ((unused)), + VasEBoot_size_t namelen __attribute__ ((unused)), const void *val_in __attribute__ ((unused)), - grub_size_t nelem __attribute__ ((unused)), - grub_size_t elemsize __attribute__ ((unused)), + VasEBoot_size_t nelem __attribute__ ((unused)), + VasEBoot_size_t elemsize __attribute__ ((unused)), void *data) { struct dnode_get_fullpath_ctx *ctx = data; @@ -3179,74 +3179,74 @@ count_zap_keys (const void *name __attribute__ ((unused)), /* Helper for dnode_get_fullpath. */ static int -load_zap_key (const void *name, grub_size_t namelen, const void *val_in, - grub_size_t nelem, grub_size_t elemsize, void *data) +load_zap_key (const void *name, VasEBoot_size_t namelen, const void *val_in, + VasEBoot_size_t nelem, VasEBoot_size_t elemsize, void *data) { struct dnode_get_fullpath_ctx *ctx = data; if (namelen != 1) { - grub_dprintf ("zfs", "Unexpected key index size %" PRIuGRUB_SIZE "\n", + VasEBoot_dprintf ("zfs", "Unexpected key index size %" PRIuVasEBoot_SIZE "\n", namelen); return 0; } if (elemsize != 1) { - grub_dprintf ("zfs", "Unexpected key element size %" PRIuGRUB_SIZE "\n", + VasEBoot_dprintf ("zfs", "Unexpected key element size %" PRIuVasEBoot_SIZE "\n", elemsize); return 0; } ctx->subvol->keyring[ctx->keyn].txg = - grub_be_to_cpu64 (*(grub_uint64_t *) name); + VasEBoot_be_to_cpu64 (*(VasEBoot_uint64_t *) name); ctx->subvol->keyring[ctx->keyn].algo = - grub_le_to_cpu64 (*(grub_uint64_t *) val_in); + VasEBoot_le_to_cpu64 (*(VasEBoot_uint64_t *) val_in); ctx->subvol->keyring[ctx->keyn].cipher = - grub_zfs_load_key (val_in, nelem, ctx->salt, + VasEBoot_zfs_load_key (val_in, nelem, ctx->salt, ctx->subvol->keyring[ctx->keyn].algo); ctx->keyn++; return 0; } -static grub_err_t +static VasEBoot_err_t dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, dnode_end_t * dn, int *isfs, - struct grub_zfs_data *data) + struct VasEBoot_zfs_data *data) { char *fsname, *snapname; const char *ptr_at, *filename; - grub_uint64_t headobj; - grub_uint64_t keychainobj; - grub_err_t err; + VasEBoot_uint64_t headobj; + VasEBoot_uint64_t keychainobj; + VasEBoot_err_t err; - ptr_at = grub_strchr (fullpath, '@'); + ptr_at = VasEBoot_strchr (fullpath, '@'); if (! ptr_at) { *isfs = 1; filename = 0; snapname = 0; - fsname = grub_strdup (fullpath); + fsname = VasEBoot_strdup (fullpath); } else { - const char *ptr_slash = grub_strchr (ptr_at, '/'); + const char *ptr_slash = VasEBoot_strchr (ptr_at, '/'); *isfs = 0; - fsname = grub_malloc (ptr_at - fullpath + 1); + fsname = VasEBoot_malloc (ptr_at - fullpath + 1); if (!fsname) - return grub_errno; - grub_memcpy (fsname, fullpath, ptr_at - fullpath); + return VasEBoot_errno; + VasEBoot_memcpy (fsname, fullpath, ptr_at - fullpath); fsname[ptr_at - fullpath] = 0; if (ptr_at[1] && ptr_at[1] != '/') { - snapname = grub_malloc (ptr_slash - ptr_at); + snapname = VasEBoot_malloc (ptr_slash - ptr_at); if (!snapname) { - grub_free (fsname); - return grub_errno; + VasEBoot_free (fsname); + return VasEBoot_errno; } - grub_memcpy (snapname, ptr_at + 1, ptr_slash - ptr_at - 1); + VasEBoot_memcpy (snapname, ptr_at + 1, ptr_slash - ptr_at - 1); snapname[ptr_slash - ptr_at - 1] = 0; } else @@ -3255,63 +3255,63 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, filename = ptr_slash; else filename = "/"; - grub_dprintf ("zfs", "fsname = '%s' snapname='%s' filename = '%s'\n", + VasEBoot_dprintf ("zfs", "fsname = '%s' snapname='%s' filename = '%s'\n", fsname, snapname, filename); } - grub_dprintf ("zfs", "alive\n"); + VasEBoot_dprintf ("zfs", "alive\n"); err = get_filesystem_dnode (&(data->mos), fsname, dn, data); if (err) { - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } - grub_dprintf ("zfs", "alive\n"); + VasEBoot_dprintf ("zfs", "alive\n"); - headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->dd_head_dataset_obj, dn->endian); + headobj = VasEBoot_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->dd_head_dataset_obj, dn->endian); - grub_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); err = dnode_get (&(data->mos), headobj, 0, &subvol->mdn, data); if (err) { - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } - grub_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); - keychainobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->keychain, dn->endian); - if (grub_zfs_load_key && keychainobj) + keychainobj = VasEBoot_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->keychain, dn->endian); + if (VasEBoot_zfs_load_key && keychainobj) { struct dnode_get_fullpath_ctx ctx = { .subvol = subvol, .keyn = 0 }; dnode_end_t keychain_dn, props_dn; - grub_uint64_t propsobj; - propsobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->dd_props_zapobj, dn->endian); + VasEBoot_uint64_t propsobj; + propsobj = VasEBoot_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->dd_props_zapobj, dn->endian); err = dnode_get (&(data->mos), propsobj, DMU_OT_DSL_PROPS, &props_dn, data); if (err) { - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } err = zap_lookup (&props_dn, "salt", &ctx.salt, data, 0); - if (err == GRUB_ERR_FILE_NOT_FOUND) + if (err == VasEBoot_ERR_FILE_NOT_FOUND) { err = 0; - grub_errno = 0; + VasEBoot_errno = 0; ctx.salt = 0; } if (err) { - grub_dprintf ("zfs", "failed here\n"); + VasEBoot_dprintf ("zfs", "failed here\n"); return err; } @@ -3319,17 +3319,17 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, &keychain_dn, data); if (err) { - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } subvol->nkeys = 0; zap_iterate (&keychain_dn, 8, count_zap_keys, &ctx, data); - subvol->keyring = grub_zalloc (subvol->nkeys * sizeof (subvol->keyring[0])); + subvol->keyring = VasEBoot_zalloc (subvol->nkeys * sizeof (subvol->keyring[0])); if (!subvol->keyring) { - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } zap_iterate (&keychain_dn, 8, load_zap_key, &ctx, data); @@ -3337,9 +3337,9 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, if (snapname) { - grub_uint64_t snapobj; + VasEBoot_uint64_t snapobj; - snapobj = grub_zfs_to_cpu64 (((dsl_dataset_phys_t *) DN_BONUS (&subvol->mdn.dn))->ds_snapnames_zapobj, subvol->mdn.endian); + snapobj = VasEBoot_zfs_to_cpu64 (((dsl_dataset_phys_t *) DN_BONUS (&subvol->mdn.dn))->ds_snapnames_zapobj, subvol->mdn.endian); err = dnode_get (&(data->mos), snapobj, DMU_OT_DSL_DS_SNAP_MAP, &subvol->mdn, data); @@ -3350,8 +3350,8 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, &subvol->mdn, data); if (err) { - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } } @@ -3360,26 +3360,26 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol, make_mdn (&subvol->mdn, data); - grub_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); + VasEBoot_dprintf ("zfs", "endian = %d\n", subvol->mdn.endian); if (*isfs) { - grub_free (fsname); - grub_free (snapname); - return GRUB_ERR_NONE; + VasEBoot_free (fsname); + VasEBoot_free (snapname); + return VasEBoot_ERR_NONE; } err = dnode_get_path (subvol, filename, dn, data); - grub_free (fsname); - grub_free (snapname); + VasEBoot_free (fsname); + VasEBoot_free (snapname); return err; } static int nvlist_find_value (const char *nvlist_in, const char *name, int valtype, char **val, - grub_size_t *size_out, grub_size_t *nelm_out) + VasEBoot_size_t *size_out, VasEBoot_size_t *nelm_out) { - grub_size_t nvp_name_len, name_len = grub_strlen(name); + VasEBoot_size_t nvp_name_len, name_len = VasEBoot_strlen(name); int type; const char *nvpair=NULL,*nvlist=nvlist_in; char *nvp_name; @@ -3390,8 +3390,8 @@ nvlist_find_value (const char *nvlist_in, const char *name, if (nvlist[0] != NV_ENCODE_XDR || (nvlist[1] != NV_LITTLE_ENDIAN && nvlist[1] != NV_BIG_ENDIAN)) { - grub_dprintf ("zfs", "incorrect nvlist header\n"); - grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist"); + VasEBoot_dprintf ("zfs", "incorrect nvlist header\n"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect nvlist"); return 0; } @@ -3406,7 +3406,7 @@ nvlist_find_value (const char *nvlist_in, const char *name, if (type == valtype && (nvp_name_len == name_len || (nvp_name_len > name_len && nvp_name[name_len] == '\0')) - && grub_memcmp (nvp_name, name, name_len) == 0) + && VasEBoot_memcmp (nvp_name, name, name_len) == 0) { return nvpair_value(nvpair,val,size_out,nelm_out); } @@ -3415,33 +3415,33 @@ nvlist_find_value (const char *nvlist_in, const char *name, } int -grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name, - grub_uint64_t * out) +VasEBoot_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name, + VasEBoot_uint64_t * out) { char *nvpair; - grub_size_t size; + VasEBoot_size_t size; int found; found = nvlist_find_value (nvlist, name, DATA_TYPE_UINT64, &nvpair, &size, 0); if (!found) return 0; - if (size < sizeof (grub_uint64_t)) + if (size < sizeof (VasEBoot_uint64_t)) { - grub_error (GRUB_ERR_BAD_FS, "invalid uint64"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid uint64"); return 0; } - *out = grub_be_to_cpu64 (grub_get_unaligned64 (nvpair)); + *out = VasEBoot_be_to_cpu64 (VasEBoot_get_unaligned64 (nvpair)); return 1; } char * -grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name) +VasEBoot_zfs_nvlist_lookup_string (const char *nvlist, const char *name) { char *nvpair; char *ret; - grub_size_t slen; - grub_size_t size; + VasEBoot_size_t slen; + VasEBoot_size_t size; int found; found = nvlist_find_value (nvlist, name, DATA_TYPE_STRING, &nvpair, &size, 0); @@ -3449,47 +3449,47 @@ grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name) return 0; if (size < 4) { - grub_error (GRUB_ERR_BAD_FS, "invalid string"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "invalid string"); return 0; } - slen = grub_be_to_cpu32 (grub_get_unaligned32 (nvpair)); + slen = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (nvpair)); if (slen > size - 4) slen = size - 4; - ret = grub_malloc (slen + 1); + ret = VasEBoot_malloc (slen + 1); if (!ret) return 0; - grub_memcpy (ret, nvpair + 4, slen); + VasEBoot_memcpy (ret, nvpair + 4, slen); ret[slen] = 0; return ret; } char * -grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name) +VasEBoot_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name) { char *nvpair; char *ret; - grub_size_t size; + VasEBoot_size_t size; int found; found = nvlist_find_value (nvlist, name, DATA_TYPE_NVLIST, &nvpair, &size, 0); if (!found) return 0; - ret = grub_zalloc (size + 3 * sizeof (grub_uint32_t)); + ret = VasEBoot_zalloc (size + 3 * sizeof (VasEBoot_uint32_t)); if (!ret) return 0; - grub_memcpy (ret, nvlist, sizeof (grub_uint32_t)); + VasEBoot_memcpy (ret, nvlist, sizeof (VasEBoot_uint32_t)); - grub_memcpy (ret + sizeof (grub_uint32_t), nvpair, size); + VasEBoot_memcpy (ret + sizeof (VasEBoot_uint32_t), nvpair, size); return ret; } int -grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist, +VasEBoot_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist, const char *name) { char *nvpair; - grub_size_t nelm, size; + VasEBoot_size_t nelm, size; int found; found = nvlist_find_value (nvlist, name, DATA_TYPE_NVLIST_ARRAY, &nvpair, @@ -3503,27 +3503,27 @@ static int get_nvlist_size (const char *beg, const char *limit) { const char *ptr; - grub_uint32_t encode_size; + VasEBoot_uint32_t encode_size; ptr = beg + 8; while (ptr < limit - && (encode_size = grub_be_to_cpu32 (grub_get_unaligned32 (ptr)))) + && (encode_size = VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (ptr)))) ptr += encode_size; /* goto the next nvpair */ ptr += 8; return (ptr > limit) ? -1 : (ptr - beg); } char * -grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, - grub_size_t index) +VasEBoot_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, + VasEBoot_size_t index) { char *nvpair, *nvpairptr; int found; char *ret; - grub_size_t size; + VasEBoot_size_t size; unsigned i; - grub_size_t nelm; + VasEBoot_size_t nelm; int elemsize = 0; found = nvlist_find_value (nvlist, name, DATA_TYPE_NVLIST_ARRAY, &nvpair, @@ -3532,7 +3532,7 @@ grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, return 0; if (index >= nelm) { - grub_error (GRUB_ERR_OUT_OF_RANGE, "trying to lookup past nvlist array"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "trying to lookup past nvlist array"); return 0; } @@ -3545,7 +3545,7 @@ grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, if (r < 0) { - grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist array"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect nvlist array"); return NULL; } nvpairptr += r; @@ -3555,52 +3555,52 @@ grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, if (elemsize < 0) { - grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist array"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "incorrect nvlist array"); return 0; } - ret = grub_zalloc (elemsize + sizeof (grub_uint32_t)); + ret = VasEBoot_zalloc (elemsize + sizeof (VasEBoot_uint32_t)); if (!ret) return 0; - grub_memcpy (ret, nvlist, sizeof (grub_uint32_t)); + VasEBoot_memcpy (ret, nvlist, sizeof (VasEBoot_uint32_t)); - grub_memcpy (ret + sizeof (grub_uint32_t), nvpairptr, elemsize); + VasEBoot_memcpy (ret + sizeof (VasEBoot_uint32_t), nvpairptr, elemsize); return ret; } static void -unmount_device (struct grub_zfs_device_desc *desc) +unmount_device (struct VasEBoot_zfs_device_desc *desc) { unsigned i; switch (desc->type) { case DEVICE_LEAF: if (!desc->original && desc->dev) - grub_device_close (desc->dev); + VasEBoot_device_close (desc->dev); return; case DEVICE_RAIDZ: case DEVICE_MIRROR: for (i = 0; i < desc->n_children; i++) unmount_device (&desc->children[i]); - grub_free (desc->children); + VasEBoot_free (desc->children); return; } } static void -zfs_unmount (struct grub_zfs_data *data) +zfs_unmount (struct VasEBoot_zfs_data *data) { unsigned i; for (i = 0; i < data->n_devices_attached; i++) unmount_device (&data->devices_attached[i]); - grub_free (data->devices_attached); - grub_free (data->dnode_buf); - grub_free (data->dnode_mdn); - grub_free (data->file_buf); + VasEBoot_free (data->devices_attached); + VasEBoot_free (data->dnode_buf); + VasEBoot_free (data->dnode_mdn); + VasEBoot_free (data->file_buf); for (i = 0; i < data->subvol.nkeys; i++) - grub_crypto_cipher_close (data->subvol.keyring[i].cipher); - grub_free (data->subvol.keyring); - grub_free (data); + VasEBoot_crypto_cipher_close (data->subvol.keyring[i].cipher); + VasEBoot_free (data->subvol.keyring); + VasEBoot_free (data); } /* @@ -3608,34 +3608,34 @@ zfs_unmount (struct grub_zfs_data *data) * to the memory address MOS. * */ -static struct grub_zfs_data * -zfs_mount (grub_device_t dev) +static struct VasEBoot_zfs_data * +zfs_mount (VasEBoot_device_t dev) { - struct grub_zfs_data *data = 0; - grub_err_t err; + struct VasEBoot_zfs_data *data = 0; + VasEBoot_err_t err; void *osp = 0; - grub_size_t ospsize; - grub_zfs_endian_t ub_endian = GRUB_ZFS_UNKNOWN_ENDIAN; + VasEBoot_size_t ospsize; + VasEBoot_zfs_endian_t ub_endian = VasEBoot_ZFS_UNKNOWN_ENDIAN; uberblock_t *ub; int inserted; if (! dev->disk) { - grub_error (GRUB_ERR_BAD_DEVICE, "not a disk"); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "not a disk"); return 0; } - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) return 0; #if 0 /* if it's our first time here, zero the best uberblock out */ if (data->best_drive == 0 && data->best_part == 0 && find_best_root) - grub_memset (¤t_uberblock, 0, sizeof (uberblock_t)); + VasEBoot_memset (¤t_uberblock, 0, sizeof (uberblock_t)); #endif data->n_devices_allocated = 16; - data->devices_attached = grub_malloc (sizeof (data->devices_attached[0]) + data->devices_attached = VasEBoot_malloc (sizeof (data->devices_attached[0]) * data->n_devices_allocated); data->n_devices_attached = 0; err = scan_disk (dev, data, 1, &inserted); @@ -3646,9 +3646,9 @@ zfs_mount (grub_device_t dev) } ub = &(data->current_uberblock); - ub_endian = (grub_zfs_to_cpu64 (ub->ub_magic, - GRUB_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC - ? GRUB_ZFS_LITTLE_ENDIAN : GRUB_ZFS_BIG_ENDIAN); + ub_endian = (VasEBoot_zfs_to_cpu64 (ub->ub_magic, + VasEBoot_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC + ? VasEBoot_ZFS_LITTLE_ENDIAN : VasEBoot_ZFS_BIG_ENDIAN); err = zio_read (&ub->ub_rootbp, ub_endian, &osp, &ospsize, data); @@ -3660,8 +3660,8 @@ zfs_mount (grub_device_t dev) if (ospsize < OBJSET_PHYS_SIZE_V14) { - grub_error (GRUB_ERR_BAD_FS, "OSP too small"); - grub_free (osp); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "OSP too small"); + VasEBoot_free (osp); zfs_unmount (data); return NULL; } @@ -3670,46 +3670,46 @@ zfs_mount (grub_device_t dev) check_mos_features(&((objset_phys_t *) osp)->os_meta_dnode,ub_endian, data) != 0) { - grub_error (GRUB_ERR_BAD_FS, "Unsupported features in pool"); - grub_free (osp); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "Unsupported features in pool"); + VasEBoot_free (osp); zfs_unmount (data); return NULL; } /* Got the MOS. Save it at the memory addr MOS. */ - grub_memmove (&(data->mos.dn), &((objset_phys_t *) osp)->os_meta_dnode, + VasEBoot_memmove (&(data->mos.dn), &((objset_phys_t *) osp)->os_meta_dnode, DNODE_SIZE); - data->mos.endian = (grub_zfs_to_cpu64 (ub->ub_rootbp.blk_prop, + data->mos.endian = (VasEBoot_zfs_to_cpu64 (ub->ub_rootbp.blk_prop, ub_endian) >> 63) & 1; - grub_free (osp); + VasEBoot_free (osp); return data; } -grub_err_t -grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist) +VasEBoot_err_t +VasEBoot_zfs_fetch_nvlist (VasEBoot_device_t dev, char **nvlist) { - struct grub_zfs_data *zfs; - grub_err_t err; + struct VasEBoot_zfs_data *zfs; + VasEBoot_err_t err; zfs = zfs_mount (dev); if (!zfs) - return grub_errno; + return VasEBoot_errno; err = zfs_fetch_nvlist (zfs->device_original, nvlist); zfs_unmount (zfs); return err; } -static grub_err_t -zfs_label (grub_device_t device, char **label) +static VasEBoot_err_t +zfs_label (VasEBoot_device_t device, char **label) { char *nvlist; - grub_err_t err; - struct grub_zfs_data *data; + VasEBoot_err_t err; + struct VasEBoot_zfs_data *data; data = zfs_mount (device); if (! data) - return grub_errno; + return VasEBoot_errno; err = zfs_fetch_nvlist (data->device_original, &nvlist); if (err) @@ -3718,67 +3718,67 @@ zfs_label (grub_device_t device, char **label) return err; } - *label = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); - grub_free (nvlist); + *label = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); + VasEBoot_free (nvlist); zfs_unmount (data); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -zfs_uuid (grub_device_t device, char **uuid) +static VasEBoot_err_t +zfs_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_zfs_data *data; + struct VasEBoot_zfs_data *data; *uuid = 0; data = zfs_mount (device); if (! data) - return grub_errno; + return VasEBoot_errno; - *uuid = grub_xasprintf ("%016llx", (long long unsigned) data->guid); + *uuid = VasEBoot_xasprintf ("%016llx", (long long unsigned) data->guid); zfs_unmount (data); if (! *uuid) - return grub_errno; - return GRUB_ERR_NONE; + return VasEBoot_errno; + return VasEBoot_ERR_NONE; } -static grub_err_t -zfs_mtime (grub_device_t device, grub_int32_t *mt) +static VasEBoot_err_t +zfs_mtime (VasEBoot_device_t device, VasEBoot_int32_t *mt) { - struct grub_zfs_data *data; - grub_zfs_endian_t ub_endian = GRUB_ZFS_UNKNOWN_ENDIAN; + struct VasEBoot_zfs_data *data; + VasEBoot_zfs_endian_t ub_endian = VasEBoot_ZFS_UNKNOWN_ENDIAN; uberblock_t *ub; *mt = 0; data = zfs_mount (device); if (! data) - return grub_errno; + return VasEBoot_errno; ub = &(data->current_uberblock); - ub_endian = (grub_zfs_to_cpu64 (ub->ub_magic, - GRUB_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC - ? GRUB_ZFS_LITTLE_ENDIAN : GRUB_ZFS_BIG_ENDIAN); + ub_endian = (VasEBoot_zfs_to_cpu64 (ub->ub_magic, + VasEBoot_ZFS_LITTLE_ENDIAN) == UBERBLOCK_MAGIC + ? VasEBoot_ZFS_LITTLE_ENDIAN : VasEBoot_ZFS_BIG_ENDIAN); - *mt = grub_zfs_to_cpu64 (ub->ub_timestamp, ub_endian); + *mt = VasEBoot_zfs_to_cpu64 (ub->ub_timestamp, ub_endian); zfs_unmount (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* * zfs_open() locates a file in the rootpool by following the * MOS and places the dnode of the file in the memory address DNODE. */ -static grub_err_t -grub_zfs_open (struct grub_file *file, const char *fsfilename) +static VasEBoot_err_t +VasEBoot_zfs_open (struct VasEBoot_file *file, const char *fsfilename) { - struct grub_zfs_data *data; - grub_err_t err; + struct VasEBoot_zfs_data *data; + VasEBoot_err_t err; int isfs; data = zfs_mount (file->device); if (! data) - return grub_errno; + return VasEBoot_errno; err = dnode_get_fullpath (fsfilename, &(data->subvol), &(data->dnode), &isfs, data); @@ -3791,14 +3791,14 @@ grub_zfs_open (struct grub_file *file, const char *fsfilename) if (isfs) { zfs_unmount (data); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("missing `%c' symbol"), '@'); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("missing `%c' symbol"), '@'); } /* We found the dnode for this file. Verify if it is a plain file. */ if (data->dnode.dn.dn_type != DMU_OT_PLAIN_FILE_CONTENTS) { zfs_unmount (data); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file")); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a regular file")); } /* get the file size and set the file position to 0 */ @@ -3827,37 +3827,37 @@ grub_zfs_open (struct grub_file *file, const char *fsfilename) } else { - return grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "filesystem is corrupt"); } hdrsize = SA_HDR_SIZE (((sa_hdr_phys_t *) sahdrp)); - file->size = grub_zfs_to_cpu64 (grub_get_unaligned64 ((char *) sahdrp + hdrsize + SA_SIZE_OFFSET), data->dnode.endian); + file->size = VasEBoot_zfs_to_cpu64 (VasEBoot_get_unaligned64 ((char *) sahdrp + hdrsize + SA_SIZE_OFFSET), data->dnode.endian); } else if (data->dnode.dn.dn_bonustype == DMU_OT_ZNODE) { - file->size = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&data->dnode.dn))->zp_size, data->dnode.endian); + file->size = VasEBoot_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&data->dnode.dn))->zp_size, data->dnode.endian); } else - return grub_error (GRUB_ERR_BAD_FS, "bad bonus type"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "bad bonus type"); file->data = data; file->offset = 0; -#ifndef GRUB_UTIL - grub_dl_ref (my_mod); +#ifndef VasEBoot_UTIL + VasEBoot_dl_ref (my_mod); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_zfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_zfs_data *data = (struct grub_zfs_data *) file->data; - grub_size_t blksz, movesize; - grub_size_t length; - grub_size_t read; - grub_err_t err; + struct VasEBoot_zfs_data *data = (struct VasEBoot_zfs_data *) file->data; + VasEBoot_size_t blksz, movesize; + VasEBoot_size_t length; + VasEBoot_size_t read; + VasEBoot_err_t err; /* * If offset is in memory, move it into the buffer provided and return. @@ -3865,17 +3865,17 @@ grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) if (file->offset >= data->file_start && file->offset + len <= data->file_end) { - grub_memmove (buf, data->file_buf + file->offset - data->file_start, + VasEBoot_memmove (buf, data->file_buf + file->offset - data->file_start, len); return len; } - blksz = grub_zfs_to_cpu16 (data->dnode.dn.dn_datablkszsec, + blksz = VasEBoot_zfs_to_cpu16 (data->dnode.dn.dn_datablkszsec, data->dnode.endian) << SPA_MINBLOCKSHIFT; if (blksz == 0) { - grub_error (GRUB_ERR_BAD_FS, "0-sized block"); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "0-sized block"); return -1; } @@ -3893,8 +3893,8 @@ grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) /* * Find requested blkid and the offset within that block. */ - grub_uint64_t blkid = grub_divmod64 (file->offset + read, blksz, 0); - grub_free (data->file_buf); + VasEBoot_uint64_t blkid = VasEBoot_divmod64 (file->offset + read, blksz, 0); + VasEBoot_free (data->file_buf); data->file_buf = 0; err = dmu_read (&(data->dnode), blkid, &t, @@ -3914,7 +3914,7 @@ grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) if (movesize > length) movesize = length; - grub_memmove (buf, data->file_buf + file->offset + read + VasEBoot_memmove (buf, data->file_buf + file->offset + read - data->file_start, movesize); buf += movesize; length -= movesize; @@ -3924,29 +3924,29 @@ grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) return len; } -static grub_err_t -grub_zfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_zfs_close (VasEBoot_file_t file) { - zfs_unmount ((struct grub_zfs_data *) file->data); + zfs_unmount ((struct VasEBoot_zfs_data *) file->data); -#ifndef GRUB_UTIL - grub_dl_unref (my_mod); +#ifndef VasEBoot_UTIL + VasEBoot_dl_unref (my_mod); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename, - grub_uint64_t *mdnobj) +VasEBoot_err_t +VasEBoot_zfs_getmdnobj (VasEBoot_device_t dev, const char *fsfilename, + VasEBoot_uint64_t *mdnobj) { - struct grub_zfs_data *data; - grub_err_t err; + struct VasEBoot_zfs_data *data; + VasEBoot_err_t err; int isfs; data = zfs_mount (dev); if (! data) - return grub_errno; + return VasEBoot_errno; err = dnode_get_fullpath (fsfilename, &(data->subvol), &(data->dnode), &isfs, data); @@ -3955,27 +3955,27 @@ grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename, return err; } -static grub_err_t -fill_fs_info (struct grub_dirhook_info *info, - dnode_end_t mdn, struct grub_zfs_data *data) +static VasEBoot_err_t +fill_fs_info (struct VasEBoot_dirhook_info *info, + dnode_end_t mdn, struct VasEBoot_zfs_data *data) { - grub_err_t err; + VasEBoot_err_t err; dnode_end_t dn; - grub_uint64_t objnum; - grub_uint64_t headobj; + VasEBoot_uint64_t objnum; + VasEBoot_uint64_t headobj; - grub_memset (info, 0, sizeof (*info)); + VasEBoot_memset (info, 0, sizeof (*info)); info->dir = 1; if (mdn.dn.dn_type == DMU_OT_DSL_DIR) { - headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&mdn.dn))->dd_head_dataset_obj, mdn.endian); + headobj = VasEBoot_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&mdn.dn))->dd_head_dataset_obj, mdn.endian); err = dnode_get (&(data->mos), headobj, 0, &mdn, data); if (err) { - grub_dprintf ("zfs", "failed here\n"); + VasEBoot_dprintf ("zfs", "failed here\n"); return err; } } @@ -3986,21 +3986,21 @@ fill_fs_info (struct grub_dirhook_info *info, &dn, data); if (err) { - grub_dprintf ("zfs", "failed here\n"); + VasEBoot_dprintf ("zfs", "failed here\n"); return err; } err = zap_lookup (&dn, ZFS_ROOT_OBJ, &objnum, data, 0); if (err) { - grub_dprintf ("zfs", "failed here\n"); + VasEBoot_dprintf ("zfs", "failed here\n"); return err; } err = dnode_get (&mdn, objnum, 0, &dn, data); if (err) { - grub_dprintf ("zfs", "failed here\n"); + VasEBoot_dprintf ("zfs", "failed here\n"); return err; } @@ -4023,37 +4023,37 @@ fill_fs_info (struct grub_dirhook_info *info, } else { - grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt"); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_BAD_FS, "filesystem is corrupt"); + return VasEBoot_errno; } hdrsize = SA_HDR_SIZE (((sa_hdr_phys_t *) sahdrp)); info->mtimeset = 1; - info->mtime = grub_zfs_to_cpu64 (grub_get_unaligned64 ((char *) sahdrp + hdrsize + SA_MTIME_OFFSET), dn.endian); + info->mtime = VasEBoot_zfs_to_cpu64 (VasEBoot_get_unaligned64 ((char *) sahdrp + hdrsize + SA_MTIME_OFFSET), dn.endian); } if (dn.dn.dn_bonustype == DMU_OT_ZNODE) { info->mtimeset = 1; - info->mtime = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dn.dn))->zp_mtime[0], dn.endian); + info->mtime = VasEBoot_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dn.dn))->zp_mtime[0], dn.endian); } return 0; } -/* Helper for grub_zfs_dir. */ +/* Helper for VasEBoot_zfs_dir. */ static int -iterate_zap (const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx) +iterate_zap (const char *name, VasEBoot_uint64_t val, struct VasEBoot_zfs_dir_ctx *ctx) { - grub_err_t err; - struct grub_dirhook_info info; + VasEBoot_err_t err; + struct VasEBoot_dirhook_info info; dnode_end_t dn; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_memset (&info, 0, sizeof (info)); err = dnode_get (&(ctx->data->subvol.mdn), val, 0, &dn, ctx->data); if (err) { - grub_print_error (); + VasEBoot_print_error (); return 0; } @@ -4073,48 +4073,48 @@ iterate_zap (const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx) err = zio_read (bp, dn.endian, &sahdrp, NULL, ctx->data); if (err) { - grub_print_error (); + VasEBoot_print_error (); return 0; } } else { - grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt"); - grub_print_error (); + VasEBoot_error (VasEBoot_ERR_BAD_FS, "filesystem is corrupt"); + VasEBoot_print_error (); return 0; } hdrsize = SA_HDR_SIZE (((sa_hdr_phys_t *) sahdrp)); info.mtimeset = 1; - info.mtime = grub_zfs_to_cpu64 (grub_get_unaligned64 ((char *) sahdrp + hdrsize + SA_MTIME_OFFSET), dn.endian); + info.mtime = VasEBoot_zfs_to_cpu64 (VasEBoot_get_unaligned64 ((char *) sahdrp + hdrsize + SA_MTIME_OFFSET), dn.endian); info.case_insensitive = ctx->data->subvol.case_insensitive; } if (dn.dn.dn_bonustype == DMU_OT_ZNODE) { info.mtimeset = 1; - info.mtime = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dn.dn))->zp_mtime[0], + info.mtime = VasEBoot_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dn.dn))->zp_mtime[0], dn.endian); } info.dir = (dn.dn.dn_type == DMU_OT_DIRECTORY_CONTENTS); - grub_dprintf ("zfs", "type=%d, name=%s\n", + VasEBoot_dprintf ("zfs", "type=%d, name=%s\n", (int)dn.dn.dn_type, (char *)name); return ctx->hook (name, &info, ctx->hook_data); } -/* Helper for grub_zfs_dir. */ +/* Helper for VasEBoot_zfs_dir. */ static int -iterate_zap_fs (const char *name, grub_uint64_t val, - struct grub_zfs_dir_ctx *ctx) +iterate_zap_fs (const char *name, VasEBoot_uint64_t val, + struct VasEBoot_zfs_dir_ctx *ctx) { - grub_err_t err; - struct grub_dirhook_info info; + VasEBoot_err_t err; + struct VasEBoot_dirhook_info info; dnode_end_t mdn; err = dnode_get (&(ctx->data->mos), val, 0, &mdn, ctx->data); if (err) { - grub_errno = 0; + VasEBoot_errno = 0; return 0; } if (mdn.dn.dn_type != DMU_OT_DSL_DIR) @@ -4123,19 +4123,19 @@ iterate_zap_fs (const char *name, grub_uint64_t val, err = fill_fs_info (&info, mdn, ctx->data); if (err) { - grub_errno = 0; + VasEBoot_errno = 0; return 0; } return ctx->hook (name, &info, ctx->hook_data); } -/* Helper for grub_zfs_dir. */ +/* Helper for VasEBoot_zfs_dir. */ static int -iterate_zap_snap (const char *name, grub_uint64_t val, - struct grub_zfs_dir_ctx *ctx) +iterate_zap_snap (const char *name, VasEBoot_uint64_t val, + struct VasEBoot_zfs_dir_ctx *ctx) { - grub_err_t err; - struct grub_dirhook_info info; + VasEBoot_err_t err; + struct VasEBoot_dirhook_info info; char *name2; int ret; @@ -4144,7 +4144,7 @@ iterate_zap_snap (const char *name, grub_uint64_t val, err = dnode_get (&(ctx->data->mos), val, 0, &mdn, ctx->data); if (err) { - grub_errno = 0; + VasEBoot_errno = 0; return 0; } @@ -4154,33 +4154,33 @@ iterate_zap_snap (const char *name, grub_uint64_t val, err = fill_fs_info (&info, mdn, ctx->data); if (err) { - grub_errno = 0; + VasEBoot_errno = 0; return 0; } - name2 = grub_malloc (grub_strlen (name) + 2); + name2 = VasEBoot_malloc (VasEBoot_strlen (name) + 2); name2[0] = '@'; - grub_memcpy (name2 + 1, name, grub_strlen (name) + 1); + VasEBoot_memcpy (name2 + 1, name, VasEBoot_strlen (name) + 1); ret = ctx->hook (name2, &info, ctx->hook_data); - grub_free (name2); + VasEBoot_free (name2); return ret; } -static grub_err_t -grub_zfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_zfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - struct grub_zfs_dir_ctx ctx = { + struct VasEBoot_zfs_dir_ctx ctx = { .hook = hook, .hook_data = hook_data }; - struct grub_zfs_data *data; - grub_err_t err; + struct VasEBoot_zfs_data *data; + VasEBoot_err_t err; int isfs; data = zfs_mount (device); if (! data) - return grub_errno; + return VasEBoot_errno; err = dnode_get_fullpath (path, &(data->subvol), &(data->dnode), &isfs, data); if (err) { @@ -4191,10 +4191,10 @@ grub_zfs_dir (grub_device_t device, const char *path, if (isfs) { - grub_uint64_t childobj, headobj; - grub_uint64_t snapobj; + VasEBoot_uint64_t childobj, headobj; + VasEBoot_uint64_t snapobj; dnode_end_t dn; - struct grub_dirhook_info info; + struct VasEBoot_dirhook_info info; err = fill_fs_info (&info, data->dnode, data); if (err) @@ -4205,11 +4205,11 @@ grub_zfs_dir (grub_device_t device, const char *path, if (hook ("@", &info, hook_data)) { zfs_unmount (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - childobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&data->dnode.dn))->dd_child_dir_zapobj, data->dnode.endian); - headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&data->dnode.dn))->dd_head_dataset_obj, data->dnode.endian); + childobj = VasEBoot_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&data->dnode.dn))->dd_child_dir_zapobj, data->dnode.endian); + headobj = VasEBoot_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&data->dnode.dn))->dd_head_dataset_obj, data->dnode.endian); err = dnode_get (&(data->mos), childobj, DMU_OT_DSL_DIR_CHILD_MAP, &dn, data); if (err) @@ -4227,7 +4227,7 @@ grub_zfs_dir (grub_device_t device, const char *path, return err; } - snapobj = grub_zfs_to_cpu64 (((dsl_dataset_phys_t *) DN_BONUS (&dn.dn))->ds_snapnames_zapobj, dn.endian); + snapobj = VasEBoot_zfs_to_cpu64 (((dsl_dataset_phys_t *) DN_BONUS (&dn.dn))->ds_snapnames_zapobj, dn.endian); err = dnode_get (&(data->mos), snapobj, DMU_OT_DSL_DS_SNAP_MAP, &dn, data); @@ -4244,17 +4244,17 @@ grub_zfs_dir (grub_device_t device, const char *path, if (data->dnode.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS) { zfs_unmount (data); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory")); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("not a directory")); } zap_iterate_u64 (&(data->dnode), iterate_zap, data, &ctx); } zfs_unmount (data); - return grub_errno; + return VasEBoot_errno; } static int -check_feature (const char *name, grub_uint64_t val, - struct grub_zfs_dir_ctx *ctx __attribute__((unused))) +check_feature (const char *name, VasEBoot_uint64_t val, + struct VasEBoot_zfs_dir_ctx *ctx __attribute__((unused))) { int i; if (val == 0) @@ -4262,30 +4262,30 @@ check_feature (const char *name, grub_uint64_t val, if (name[0] == 0) return 0; for (i = 0; spa_feature_names[i] != NULL; i++) - if (grub_strcmp (name, spa_feature_names[i]) == 0) + if (VasEBoot_strcmp (name, spa_feature_names[i]) == 0) return 0; return 1; } /* * Checks whether the MOS features that are active are supported by this - * (GRUB's) implementation of ZFS. + * (VasEBoot's) implementation of ZFS. * * Return: * 0: Success. * errnum: Failure. */ -static grub_err_t -check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct grub_zfs_data* data ) +static VasEBoot_err_t +check_mos_features(dnode_phys_t *mosmdn_phys,VasEBoot_zfs_endian_t endian,struct VasEBoot_zfs_data* data ) { - grub_uint64_t objnum; - grub_err_t errnum = 0; + VasEBoot_uint64_t objnum; + VasEBoot_err_t errnum = 0; dnode_end_t dn,mosmdn; mzap_phys_t* mzp; - grub_zfs_endian_t endianzap; + VasEBoot_zfs_endian_t endianzap; int size; - grub_memmove(&(mosmdn.dn),mosmdn_phys,sizeof(dnode_phys_t)); + VasEBoot_memmove(&(mosmdn.dn),mosmdn_phys,sizeof(dnode_phys_t)); mosmdn.endian=endian; errnum = dnode_get(&mosmdn, DMU_POOL_DIRECTORY_OBJECT, DMU_OT_OBJECT_DIRECTORY, &dn,data); @@ -4295,7 +4295,7 @@ check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct gru /* * Find the object number for 'features_for_read' and retrieve its * corresponding dnode. Note that we don't check features_for_write - * because GRUB is not opening the pool for write. + * because VasEBoot is not opening the pool for write. */ errnum = zap_lookup(&dn, DMU_POOL_FEATURES_FOR_READ, &objnum, data,0); if (errnum != 0) @@ -4309,70 +4309,70 @@ check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct gru if (errnum != 0) return errnum; - size = grub_zfs_to_cpu16 (dn.dn.dn_datablkszsec, dn.endian) << SPA_MINBLOCKSHIFT; + size = VasEBoot_zfs_to_cpu16 (dn.dn.dn_datablkszsec, dn.endian) << SPA_MINBLOCKSHIFT; return mzap_iterate (mzp,endianzap, size, check_feature,NULL); } -#ifdef GRUB_UTIL -static grub_err_t -grub_zfs_embed (grub_device_t device __attribute__ ((unused)), +#ifdef VasEBoot_UTIL +static VasEBoot_err_t +VasEBoot_zfs_embed (VasEBoot_device_t device __attribute__ ((unused)), unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors) + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors) { unsigned i; - if (embed_type != GRUB_EMBED_PCBIOS) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (embed_type != VasEBoot_EMBED_PCBIOS) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "ZFS currently supports only PC-BIOS embedding"); - if ((VDEV_BOOT_SIZE >> GRUB_DISK_SECTOR_BITS) < *nsectors) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + if ((VDEV_BOOT_SIZE >> VasEBoot_DISK_SECTOR_BITS) < *nsectors) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("your core.img is unusually large. " "It won't fit in the embedding area")); - *nsectors = (VDEV_BOOT_SIZE >> GRUB_DISK_SECTOR_BITS); + *nsectors = (VDEV_BOOT_SIZE >> VasEBoot_DISK_SECTOR_BITS); if (*nsectors > max_nsectors) *nsectors = max_nsectors; - *sectors = grub_malloc (*nsectors * sizeof (**sectors)); + *sectors = VasEBoot_malloc (*nsectors * sizeof (**sectors)); if (!*sectors) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < *nsectors; i++) - (*sectors)[i] = i + (VDEV_BOOT_OFFSET >> GRUB_DISK_SECTOR_BITS); + (*sectors)[i] = i + (VDEV_BOOT_OFFSET >> VasEBoot_DISK_SECTOR_BITS); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static struct grub_fs grub_zfs_fs = { +static struct VasEBoot_fs VasEBoot_zfs_fs = { .name = "zfs", - .dir = grub_zfs_dir, - .open = grub_zfs_open, - .read = grub_zfs_read, - .close = grub_zfs_close, + .dir = VasEBoot_zfs_dir, + .open = VasEBoot_zfs_open, + .read = VasEBoot_zfs_read, + .close = VasEBoot_zfs_close, .label = zfs_label, .uuid = zfs_uuid, .mtime = zfs_mtime, -#ifdef GRUB_UTIL - .embed = grub_zfs_embed, +#ifdef VasEBoot_UTIL + .embed = VasEBoot_zfs_embed, .reserved_first_sector = 1, .blocklist_install = 0, #endif .next = 0 }; -GRUB_MOD_INIT (zfs) +VasEBoot_MOD_INIT (zfs) { COMPILE_TIME_ASSERT (sizeof (zap_leaf_chunk_t) == ZAP_LEAF_CHUNKSIZE); - grub_fs_register (&grub_zfs_fs); -#ifndef GRUB_UTIL + VasEBoot_fs_register (&VasEBoot_zfs_fs); +#ifndef VasEBoot_UTIL my_mod = mod; #endif } -GRUB_MOD_FINI (zfs) +VasEBoot_MOD_FINI (zfs) { - grub_fs_unregister (&grub_zfs_fs); + VasEBoot_fs_unregister (&VasEBoot_zfs_fs); } diff --git a/VasEBoot-core/fs/zfs/zfs_fletcher.c b/VasEBoot-core/fs/zfs/zfs_fletcher.c index 7d27b053d..6442341a1 100644 --- a/VasEBoot-core/fs/zfs/zfs_fletcher.c +++ b/VasEBoot-core/fs/zfs/zfs_fletcher.c @@ -1,84 +1,84 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009 Free Software Foundation, Inc. * Copyright 2007 Sun Microsystems, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include void -fletcher_2(const void *buf, grub_uint64_t size, grub_zfs_endian_t endian, +fletcher_2(const void *buf, VasEBoot_uint64_t size, VasEBoot_zfs_endian_t endian, zio_cksum_t *zcp) { - const grub_uint64_t *ip = buf; - const grub_uint64_t *ipend = ip + (size / sizeof (grub_uint64_t)); - grub_uint64_t a0, b0, a1, b1; + const VasEBoot_uint64_t *ip = buf; + const VasEBoot_uint64_t *ipend = ip + (size / sizeof (VasEBoot_uint64_t)); + VasEBoot_uint64_t a0, b0, a1, b1; for (a0 = b0 = a1 = b1 = 0; ip < ipend; ip += 2) { - a0 += grub_zfs_to_cpu64 (ip[0], endian); - a1 += grub_zfs_to_cpu64 (ip[1], endian); + a0 += VasEBoot_zfs_to_cpu64 (ip[0], endian); + a1 += VasEBoot_zfs_to_cpu64 (ip[1], endian); b0 += a0; b1 += a1; } - zcp->zc_word[0] = grub_cpu_to_zfs64 (a0, endian); - zcp->zc_word[1] = grub_cpu_to_zfs64 (a1, endian); - zcp->zc_word[2] = grub_cpu_to_zfs64 (b0, endian); - zcp->zc_word[3] = grub_cpu_to_zfs64 (b1, endian); + zcp->zc_word[0] = VasEBoot_cpu_to_zfs64 (a0, endian); + zcp->zc_word[1] = VasEBoot_cpu_to_zfs64 (a1, endian); + zcp->zc_word[2] = VasEBoot_cpu_to_zfs64 (b0, endian); + zcp->zc_word[3] = VasEBoot_cpu_to_zfs64 (b1, endian); } void -fletcher_4 (const void *buf, grub_uint64_t size, grub_zfs_endian_t endian, +fletcher_4 (const void *buf, VasEBoot_uint64_t size, VasEBoot_zfs_endian_t endian, zio_cksum_t *zcp) { - const grub_uint32_t *ip = buf; - const grub_uint32_t *ipend = ip + (size / sizeof (grub_uint32_t)); - grub_uint64_t a, b, c, d; + const VasEBoot_uint32_t *ip = buf; + const VasEBoot_uint32_t *ipend = ip + (size / sizeof (VasEBoot_uint32_t)); + VasEBoot_uint64_t a, b, c, d; for (a = b = c = d = 0; ip < ipend; ip++) { - a += grub_zfs_to_cpu32 (ip[0], endian);; + a += VasEBoot_zfs_to_cpu32 (ip[0], endian);; b += a; c += b; d += c; } - zcp->zc_word[0] = grub_cpu_to_zfs64 (a, endian); - zcp->zc_word[1] = grub_cpu_to_zfs64 (b, endian); - zcp->zc_word[2] = grub_cpu_to_zfs64 (c, endian); - zcp->zc_word[3] = grub_cpu_to_zfs64 (d, endian); + zcp->zc_word[0] = VasEBoot_cpu_to_zfs64 (a, endian); + zcp->zc_word[1] = VasEBoot_cpu_to_zfs64 (b, endian); + zcp->zc_word[2] = VasEBoot_cpu_to_zfs64 (c, endian); + zcp->zc_word[3] = VasEBoot_cpu_to_zfs64 (d, endian); } diff --git a/VasEBoot-core/fs/zfs/zfs_lz4.c b/VasEBoot-core/fs/zfs/zfs_lz4.c index 2f73449f0..65a5cf128 100644 --- a/VasEBoot-core/fs/zfs/zfs_lz4.c +++ b/VasEBoot-core/fs/zfs/zfs_lz4.c @@ -32,10 +32,10 @@ * - LZ4 source repository : http://code.google.com/p/lz4/ */ -#include -#include -#include -#include +#include +#include +#include +#include static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); @@ -45,7 +45,7 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, */ /* 32 or 64 bits ? */ -#if (GRUB_CPU_SIZEOF_VOID_P == 8) +#if (VasEBoot_CPU_SIZEOF_VOID_P == 8) #define LZ4_ARCH64 1 #else #define LZ4_ARCH64 0 @@ -68,22 +68,22 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, #define unlikely(expr) expect((expr) != 0, 0) /* Basic types */ -#define BYTE grub_uint8_t -#define U16 grub_uint16_t -#define U32 grub_uint32_t -#define S32 grub_int32_t -#define U64 grub_uint64_t -typedef grub_size_t size_t; +#define BYTE VasEBoot_uint8_t +#define U16 VasEBoot_uint16_t +#define U32 VasEBoot_uint32_t +#define S32 VasEBoot_int32_t +#define U64 VasEBoot_uint64_t +typedef VasEBoot_size_t size_t; typedef struct _U16_S { U16 v; -} GRUB_PACKED U16_S; +} VasEBoot_PACKED U16_S; typedef struct _U32_S { U32 v; -} GRUB_PACKED U32_S; +} VasEBoot_PACKED U32_S; typedef struct _U64_S { U64 v; -} GRUB_PACKED U64_S; +} VasEBoot_PACKED U64_S; #define A64(x) (((U64_S *)(x))->v) #define A32(x) (((U32_S *)(x))->v) @@ -125,17 +125,17 @@ typedef struct _U64_S { #define INITBASE(base) const int base = 0 #endif -#define LZ4_READ_LITTLEENDIAN_16(d, s, p) { d = (s) - grub_le_to_cpu16 (A16 (p)); } -#define LZ4_WRITE_LITTLEENDIAN_16(p, v) { A16(p) = grub_cpu_to_le16 (v); p += 2; } +#define LZ4_READ_LITTLEENDIAN_16(d, s, p) { d = (s) - VasEBoot_le_to_cpu16 (A16 (p)); } +#define LZ4_WRITE_LITTLEENDIAN_16(p, v) { A16(p) = VasEBoot_cpu_to_le16 (v); p += 2; } /* Macros */ #define LZ4_WILDCOPY(s, d, e) do { LZ4_COPYPACKET(s, d) } while (d < e); /* Decompression functions */ -grub_err_t +VasEBoot_err_t lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len); -grub_err_t +VasEBoot_err_t lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len) { const BYTE *src = s_start; @@ -144,14 +144,14 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len) /* invalid compressed buffer size encoded at start */ if (bufsiz + 4 > s_len) - return grub_error(GRUB_ERR_BAD_FS,"lz4 decompression failed."); + return VasEBoot_error(VasEBoot_ERR_BAD_FS,"lz4 decompression failed."); /* * Returns 0 on success (decompression function returned non-negative) * and appropriate error on failure (decompression function returned negative). */ return (LZ4_uncompress_unknownOutputSize((char*)s_start + 4, d_start, bufsiz, - d_len) < 0)?grub_error(GRUB_ERR_BAD_FS,"lz4 decompression failed."):0; + d_len) < 0)?VasEBoot_error(VasEBoot_ERR_BAD_FS,"lz4 decompression failed."):0; } static int @@ -184,7 +184,7 @@ LZ4_uncompress_unknownOutputSize(const char *source, } } /* copy literals */ - if ((grub_addr_t) length > ~(grub_addr_t)op) + if ((VasEBoot_addr_t) length > ~(VasEBoot_addr_t)op) goto _output_error; cpy = op + length; if ((cpy > oend - COPYLENGTH) || @@ -201,7 +201,7 @@ LZ4_uncompress_unknownOutputSize(const char *source, * buffer. */ goto _output_error; - grub_memcpy(op, ip, length); + VasEBoot_memcpy(op, ip, length); op += length; ip += length; if (ip < iend) diff --git a/VasEBoot-core/fs/zfs/zfs_lzjb.c b/VasEBoot-core/fs/zfs/zfs_lzjb.c index 62b5ea6a0..357470a5c 100644 --- a/VasEBoot-core/fs/zfs/zfs_lzjb.c +++ b/VasEBoot-core/fs/zfs/zfs_lzjb.c @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009 Free Software Foundation, Inc. * Copyright 2007 Sun Microsystems, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define MATCH_BITS 6 #define MATCH_MIN 3 @@ -49,19 +49,19 @@ #define NBBY 8 #endif -grub_err_t -lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len, - grub_size_t d_len); +VasEBoot_err_t +lzjb_decompress (void *s_start, void *d_start, VasEBoot_size_t s_len, + VasEBoot_size_t d_len); -grub_err_t -lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len, - grub_size_t d_len) +VasEBoot_err_t +lzjb_decompress (void *s_start, void *d_start, VasEBoot_size_t s_len, + VasEBoot_size_t d_len) { - grub_uint8_t *src = s_start; - grub_uint8_t *dst = d_start; - grub_uint8_t *d_end = (grub_uint8_t *) d_start + d_len; - grub_uint8_t *s_end = (grub_uint8_t *) s_start + s_len; - grub_uint8_t *cpy, copymap = 0; + VasEBoot_uint8_t *src = s_start; + VasEBoot_uint8_t *dst = d_start; + VasEBoot_uint8_t *d_end = (VasEBoot_uint8_t *) d_start + d_len; + VasEBoot_uint8_t *s_end = (VasEBoot_uint8_t *) s_start + s_len; + VasEBoot_uint8_t *cpy, copymap = 0; int copymask = 1 << (NBBY - 1); while (dst < d_end && src < s_end) @@ -72,15 +72,15 @@ lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len, copymap = *src++; } if (src >= s_end) - return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed"); + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "lzjb decompression failed"); if (copymap & copymask) { int mlen = (src[0] >> (NBBY - MATCH_BITS)) + MATCH_MIN; int offset = ((src[0] << NBBY) | src[1]) & OFFSET_MASK; src += 2; cpy = dst - offset; - if (src > s_end || cpy < (grub_uint8_t *) d_start) - return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed"); + if (src > s_end || cpy < (VasEBoot_uint8_t *) d_start) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "lzjb decompression failed"); while (--mlen >= 0 && dst < d_end) *dst++ = *cpy++; } @@ -88,6 +88,6 @@ lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len, *dst++ = *src++; } if (dst < d_end) - return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed"); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "lzjb decompression failed"); + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/fs/zfs/zfs_sha256.c b/VasEBoot-core/fs/zfs/zfs_sha256.c index a181f076c..e7e597dbe 100644 --- a/VasEBoot-core/fs/zfs/zfs_sha256.c +++ b/VasEBoot-core/fs/zfs/zfs_sha256.c @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009 Free Software Foundation, Inc. * Copyright 2007 Sun Microsystems, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * SHA-256 checksum, as specified in FIPS 180-2, available at: @@ -62,7 +62,7 @@ #define sigma0(x) (Rot32(x, 7) ^ Rot32(x, 18) ^ ((x) >> 3)) #define sigma1(x) (Rot32(x, 17) ^ Rot32(x, 19) ^ ((x) >> 10)) -static const grub_uint32_t SHA256_K[64] = { +static const VasEBoot_uint32_t SHA256_K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, @@ -82,9 +82,9 @@ static const grub_uint32_t SHA256_K[64] = { }; static void -SHA256Transform(grub_uint32_t *H, const grub_uint8_t *cp) +SHA256Transform(VasEBoot_uint32_t *H, const VasEBoot_uint8_t *cp) { - grub_uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64]; + VasEBoot_uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64]; for (t = 0; t < 16; t++, cp += 4) W[t] = (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3]; @@ -108,20 +108,20 @@ SHA256Transform(grub_uint32_t *H, const grub_uint8_t *cp) } void -zio_checksum_SHA256(const void *buf, grub_uint64_t size, - grub_zfs_endian_t endian, zio_cksum_t *zcp) +zio_checksum_SHA256(const void *buf, VasEBoot_uint64_t size, + VasEBoot_zfs_endian_t endian, zio_cksum_t *zcp) { - grub_uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + VasEBoot_uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; - grub_uint8_t pad[128]; + VasEBoot_uint8_t pad[128]; unsigned padsize = size & 63; unsigned i; for (i = 0; i < size - padsize; i += 64) - SHA256Transform(H, (grub_uint8_t *)buf + i); + SHA256Transform(H, (VasEBoot_uint8_t *)buf + i); for (i = 0; i < padsize; i++) - pad[i] = ((grub_uint8_t *)buf)[i]; + pad[i] = ((VasEBoot_uint8_t *)buf)[i]; for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) pad[padsize] = 0; @@ -132,12 +132,12 @@ zio_checksum_SHA256(const void *buf, grub_uint64_t size, for (i = 0; i < padsize && i <= 64; i += 64) SHA256Transform(H, pad + i); - zcp->zc_word[0] = grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1], + zcp->zc_word[0] = VasEBoot_cpu_to_zfs64 ((VasEBoot_uint64_t)H[0] << 32 | H[1], endian); - zcp->zc_word[1] = grub_cpu_to_zfs64 ((grub_uint64_t)H[2] << 32 | H[3], + zcp->zc_word[1] = VasEBoot_cpu_to_zfs64 ((VasEBoot_uint64_t)H[2] << 32 | H[3], endian); - zcp->zc_word[2] = grub_cpu_to_zfs64 ((grub_uint64_t)H[4] << 32 | H[5], + zcp->zc_word[2] = VasEBoot_cpu_to_zfs64 ((VasEBoot_uint64_t)H[4] << 32 | H[5], endian); - zcp->zc_word[3] = grub_cpu_to_zfs64 ((grub_uint64_t)H[6] << 32 | H[7], + zcp->zc_word[3] = VasEBoot_cpu_to_zfs64 ((VasEBoot_uint64_t)H[6] << 32 | H[7], endian); } diff --git a/VasEBoot-core/fs/zfs/zfscrypt.c b/VasEBoot-core/fs/zfs/zfscrypt.c index 87eef621d..8cb8f5c8b 100644 --- a/VasEBoot-core/fs/zfs/zfscrypt.c +++ b/VasEBoot-core/fs/zfs/zfscrypt.c @@ -1,119 +1,119 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Mostly based on following article: https://blogs.oracle.com/darren/entry/zfs_encryption_what_is_on */ -enum grub_zfs_algo +enum VasEBoot_zfs_algo { - GRUB_ZFS_ALGO_CCM, - GRUB_ZFS_ALGO_GCM, + VasEBoot_ZFS_ALGO_CCM, + VasEBoot_ZFS_ALGO_GCM, }; -struct grub_zfs_key +struct VasEBoot_zfs_key { - grub_uint64_t algo; - grub_uint8_t enc_nonce[13]; - grub_uint8_t unused[3]; - grub_uint8_t enc_key[48]; - grub_uint8_t unknown_purpose_nonce[13]; - grub_uint8_t unused2[3]; - grub_uint8_t unknown_purpose_key[48]; + VasEBoot_uint64_t algo; + VasEBoot_uint8_t enc_nonce[13]; + VasEBoot_uint8_t unused[3]; + VasEBoot_uint8_t enc_key[48]; + VasEBoot_uint8_t unknown_purpose_nonce[13]; + VasEBoot_uint8_t unused2[3]; + VasEBoot_uint8_t unknown_purpose_key[48]; }; -struct grub_zfs_wrap_key +struct VasEBoot_zfs_wrap_key { - struct grub_zfs_wrap_key *next; - grub_size_t keylen; + struct VasEBoot_zfs_wrap_key *next; + VasEBoot_size_t keylen; int is_passphrase; - grub_uint64_t key[0]; + VasEBoot_uint64_t key[0]; }; -static struct grub_zfs_wrap_key *zfs_wrap_keys; +static struct VasEBoot_zfs_wrap_key *zfs_wrap_keys; -grub_err_t -grub_zfs_add_key (grub_uint8_t *key_in, - grub_size_t keylen, +VasEBoot_err_t +VasEBoot_zfs_add_key (VasEBoot_uint8_t *key_in, + VasEBoot_size_t keylen, int passphrase) { - struct grub_zfs_wrap_key *key; + struct VasEBoot_zfs_wrap_key *key; if (!passphrase && keylen > 32) keylen = 32; - key = grub_malloc (sizeof (*key) + keylen); + key = VasEBoot_malloc (sizeof (*key) + keylen); if (!key) - return grub_errno; + return VasEBoot_errno; key->is_passphrase = passphrase; key->keylen = keylen; - grub_memcpy (key->key, key_in, keylen); + VasEBoot_memcpy (key->key, key_in, keylen); key->next = zfs_wrap_keys; zfs_wrap_keys = key; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static gcry_err_code_t -grub_ccm_decrypt (grub_crypto_cipher_handle_t cipher, - grub_uint8_t *out, const grub_uint8_t *in, - grub_size_t psize, +VasEBoot_ccm_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + VasEBoot_uint8_t *out, const VasEBoot_uint8_t *in, + VasEBoot_size_t psize, void *mac_out, const void *nonce, unsigned l, unsigned m) { - grub_uint8_t iv[16]; - grub_uint8_t mul[16]; - grub_uint32_t mac[4]; + VasEBoot_uint8_t iv[16]; + VasEBoot_uint8_t mul[16]; + VasEBoot_uint32_t mac[4]; unsigned i, j; gcry_err_code_t err; - grub_memcpy (iv + 1, nonce, 15 - l); + VasEBoot_memcpy (iv + 1, nonce, 15 - l); iv[0] = (l - 1) | (((m-2) / 2) << 3); for (j = 0; j < l; j++) iv[15 - j] = psize >> (8 * j); - err = grub_crypto_ecb_encrypt (cipher, mac, iv, 16); + err = VasEBoot_crypto_ecb_encrypt (cipher, mac, iv, 16); if (err) return err; @@ -121,33 +121,33 @@ grub_ccm_decrypt (grub_crypto_cipher_handle_t cipher, for (i = 0; i < (psize + 15) / 16; i++) { - grub_size_t csize; + VasEBoot_size_t csize; csize = 16; if (csize > psize - 16 * i) csize = psize - 16 * i; for (j = 0; j < l; j++) iv[15 - j] = (i + 1) >> (8 * j); - err = grub_crypto_ecb_encrypt (cipher, mul, iv, 16); + err = VasEBoot_crypto_ecb_encrypt (cipher, mul, iv, 16); if (err) return err; - grub_crypto_xor (out + 16 * i, in + 16 * i, mul, csize); - grub_crypto_xor (mac, mac, out + 16 * i, csize); - err = grub_crypto_ecb_encrypt (cipher, mac, mac, 16); + VasEBoot_crypto_xor (out + 16 * i, in + 16 * i, mul, csize); + VasEBoot_crypto_xor (mac, mac, out + 16 * i, csize); + err = VasEBoot_crypto_ecb_encrypt (cipher, mac, mac, 16); if (err) return err; } for (j = 0; j < l; j++) iv[15 - j] = 0; - err = grub_crypto_ecb_encrypt (cipher, mul, iv, 16); + err = VasEBoot_crypto_ecb_encrypt (cipher, mul, iv, 16); if (err) return err; if (mac_out) - grub_crypto_xor (mac_out, mac, mul, m); + VasEBoot_crypto_xor (mac_out, mac, mul, m); return GPG_ERR_NO_ERROR; } static void -grub_gcm_mul_x (grub_uint8_t *a) +VasEBoot_gcm_mul_x (VasEBoot_uint8_t *a) { int i; int c = 0, d = 0; @@ -162,44 +162,44 @@ grub_gcm_mul_x (grub_uint8_t *a) } static void -grub_gcm_mul (grub_uint8_t *a, const grub_uint8_t *b) +VasEBoot_gcm_mul (VasEBoot_uint8_t *a, const VasEBoot_uint8_t *b) { - grub_uint8_t res[16], bs[16]; + VasEBoot_uint8_t res[16], bs[16]; int i; - grub_memcpy (bs, b, 16); - grub_memset (res, 0, 16); + VasEBoot_memcpy (bs, b, 16); + VasEBoot_memset (res, 0, 16); for (i = 0; i < 128; i++) { if ((a[i / 8] << (i % 8)) & 0x80) - grub_crypto_xor (res, res, bs, 16); - grub_gcm_mul_x (bs); + VasEBoot_crypto_xor (res, res, bs, 16); + VasEBoot_gcm_mul_x (bs); } - grub_memcpy (a, res, 16); + VasEBoot_memcpy (a, res, 16); } static gcry_err_code_t -grub_gcm_decrypt (grub_crypto_cipher_handle_t cipher, - grub_uint8_t *out, const grub_uint8_t *in, - grub_size_t psize, +VasEBoot_gcm_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + VasEBoot_uint8_t *out, const VasEBoot_uint8_t *in, + VasEBoot_size_t psize, void *mac_out, const void *nonce, unsigned nonce_len, unsigned m) { - grub_uint8_t iv[16]; - grub_uint8_t mul[16]; - grub_uint8_t mac[16], h[16], mac_xor[16]; + VasEBoot_uint8_t iv[16]; + VasEBoot_uint8_t mul[16]; + VasEBoot_uint8_t mac[16], h[16], mac_xor[16]; unsigned i, j; gcry_err_code_t err; - grub_memset (mac, 0, sizeof (mac)); + VasEBoot_memset (mac, 0, sizeof (mac)); - err = grub_crypto_ecb_encrypt (cipher, h, mac, 16); + err = VasEBoot_crypto_ecb_encrypt (cipher, h, mac, 16); if (err) return err; if (nonce_len == 12) { - grub_memcpy (iv, nonce, 12); + VasEBoot_memcpy (iv, nonce, 12); iv[12] = 0; iv[13] = 0; iv[14] = 0; @@ -207,20 +207,20 @@ grub_gcm_decrypt (grub_crypto_cipher_handle_t cipher, } else { - grub_memset (iv, 0, sizeof (iv)); - grub_memcpy (iv, nonce, nonce_len); - grub_gcm_mul (iv, h); + VasEBoot_memset (iv, 0, sizeof (iv)); + VasEBoot_memcpy (iv, nonce, nonce_len); + VasEBoot_gcm_mul (iv, h); iv[15] ^= nonce_len * 8; - grub_gcm_mul (iv, h); + VasEBoot_gcm_mul (iv, h); } - err = grub_crypto_ecb_encrypt (cipher, mac_xor, iv, 16); + err = VasEBoot_crypto_ecb_encrypt (cipher, mac_xor, iv, 16); if (err) return err; for (i = 0; i < (psize + 15) / 16; i++) { - grub_size_t csize; + VasEBoot_size_t csize; csize = 16; if (csize > psize - 16 * i) csize = psize - 16 * i; @@ -230,38 +230,38 @@ grub_gcm_decrypt (grub_crypto_cipher_handle_t cipher, if (iv[15 - j] != 0) break; } - grub_crypto_xor (mac, mac, in + 16 * i, csize); - grub_gcm_mul (mac, h); - err = grub_crypto_ecb_encrypt (cipher, mul, iv, 16); + VasEBoot_crypto_xor (mac, mac, in + 16 * i, csize); + VasEBoot_gcm_mul (mac, h); + err = VasEBoot_crypto_ecb_encrypt (cipher, mul, iv, 16); if (err) return err; - grub_crypto_xor (out + 16 * i, in + 16 * i, mul, csize); + VasEBoot_crypto_xor (out + 16 * i, in + 16 * i, mul, csize); } for (j = 0; j < 8; j++) - mac[15 - j] ^= ((((grub_uint64_t) psize) * 8) >> (8 * j)); - grub_gcm_mul (mac, h); + mac[15 - j] ^= ((((VasEBoot_uint64_t) psize) * 8) >> (8 * j)); + VasEBoot_gcm_mul (mac, h); if (mac_out) - grub_crypto_xor (mac_out, mac, mac_xor, m); + VasEBoot_crypto_xor (mac_out, mac, mac_xor, m); return GPG_ERR_NO_ERROR; } static gcry_err_code_t -algo_decrypt (grub_crypto_cipher_handle_t cipher, grub_uint64_t algo, - grub_uint8_t *out, const grub_uint8_t *in, - grub_size_t psize, +algo_decrypt (VasEBoot_crypto_cipher_handle_t cipher, VasEBoot_uint64_t algo, + VasEBoot_uint8_t *out, const VasEBoot_uint8_t *in, + VasEBoot_size_t psize, void *mac_out, const void *nonce, unsigned l, unsigned m) { switch (algo) { case 0: - return grub_ccm_decrypt (cipher, out, in, psize, + return VasEBoot_ccm_decrypt (cipher, out, in, psize, mac_out, nonce, l, m); case 1: - return grub_gcm_decrypt (cipher, out, in, psize, + return VasEBoot_gcm_decrypt (cipher, out, in, psize, mac_out, nonce, 15 - l, m); default: @@ -269,146 +269,146 @@ algo_decrypt (grub_crypto_cipher_handle_t cipher, grub_uint64_t algo, } } -static grub_err_t -grub_zfs_decrypt_real (grub_crypto_cipher_handle_t cipher, - grub_uint64_t algo, +static VasEBoot_err_t +VasEBoot_zfs_decrypt_real (VasEBoot_crypto_cipher_handle_t cipher, + VasEBoot_uint64_t algo, void *nonce, - char *buf, grub_size_t size, - const grub_uint32_t *expected_mac, - grub_zfs_endian_t endian) + char *buf, VasEBoot_size_t size, + const VasEBoot_uint32_t *expected_mac, + VasEBoot_zfs_endian_t endian) { - grub_uint32_t mac[4]; + VasEBoot_uint32_t mac[4]; unsigned i; - grub_uint32_t sw[4]; + VasEBoot_uint32_t sw[4]; gcry_err_code_t err; - grub_memcpy (sw, nonce, 16); - if (endian != GRUB_ZFS_BIG_ENDIAN) + VasEBoot_memcpy (sw, nonce, 16); + if (endian != VasEBoot_ZFS_BIG_ENDIAN) for (i = 0; i < 4; i++) - sw[i] = grub_swap_bytes32 (sw[i]); + sw[i] = VasEBoot_swap_bytes32 (sw[i]); if (!cipher) - return grub_error (GRUB_ERR_ACCESS_DENIED, + return VasEBoot_error (VasEBoot_ERR_ACCESS_DENIED, N_("no decryption key available")); err = algo_decrypt (cipher, algo, - (grub_uint8_t *) buf, - (grub_uint8_t *) buf, + (VasEBoot_uint8_t *) buf, + (VasEBoot_uint8_t *) buf, size, mac, sw + 1, 3, 12); if (err) - return grub_crypto_gcry_error (err); + return VasEBoot_crypto_gcry_error (err); for (i = 0; i < 3; i++) - if (grub_zfs_to_cpu32 (expected_mac[i], endian) - != grub_be_to_cpu32 (mac[i])) - return grub_error (GRUB_ERR_BAD_FS, N_("MAC verification failed")); - return GRUB_ERR_NONE; + if (VasEBoot_zfs_to_cpu32 (expected_mac[i], endian) + != VasEBoot_be_to_cpu32 (mac[i])) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, N_("MAC verification failed")); + return VasEBoot_ERR_NONE; } -static grub_crypto_cipher_handle_t -grub_zfs_load_key_real (const struct grub_zfs_key *key, - grub_size_t keysize, - grub_uint64_t salt, - grub_uint64_t algo) +static VasEBoot_crypto_cipher_handle_t +VasEBoot_zfs_load_key_real (const struct VasEBoot_zfs_key *key, + VasEBoot_size_t keysize, + VasEBoot_uint64_t salt, + VasEBoot_uint64_t algo) { unsigned keylen; - struct grub_zfs_wrap_key *wrap_key; - grub_crypto_cipher_handle_t ret = NULL; + struct VasEBoot_zfs_wrap_key *wrap_key; + VasEBoot_crypto_cipher_handle_t ret = NULL; if (keysize != sizeof (*key)) { - grub_dprintf ("zfs", "Unexpected key size %" PRIuGRUB_SIZE "\n", keysize); + VasEBoot_dprintf ("zfs", "Unexpected key size %" PRIuVasEBoot_SIZE "\n", keysize); return 0; } - if (grub_memcmp (key->enc_key + 32, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) + if (VasEBoot_memcmp (key->enc_key + 32, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) == 0) keylen = 16; - else if (grub_memcmp (key->enc_key + 40, "\0\0\0\0\0\0\0\0", 8) == 0) + else if (VasEBoot_memcmp (key->enc_key + 40, "\0\0\0\0\0\0\0\0", 8) == 0) keylen = 24; else keylen = 32; for (wrap_key = zfs_wrap_keys; wrap_key; wrap_key = wrap_key->next) { - grub_crypto_cipher_handle_t cipher; - grub_uint8_t decrypted[32], mac[32], wrap_key_real[32]; + VasEBoot_crypto_cipher_handle_t cipher; + VasEBoot_uint8_t decrypted[32], mac[32], wrap_key_real[32]; gcry_err_code_t err; - cipher = grub_crypto_cipher_open (GRUB_CIPHER_AES); + cipher = VasEBoot_crypto_cipher_open (VasEBoot_CIPHER_AES); if (!cipher) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } - grub_memset (wrap_key_real, 0, sizeof (wrap_key_real)); + VasEBoot_memset (wrap_key_real, 0, sizeof (wrap_key_real)); err = 0; if (!wrap_key->is_passphrase) - grub_memcpy(wrap_key_real, wrap_key->key, + VasEBoot_memcpy(wrap_key_real, wrap_key->key, wrap_key->keylen < keylen ? wrap_key->keylen : keylen); else - err = grub_crypto_pbkdf2 (GRUB_MD_SHA1, - (const grub_uint8_t *) wrap_key->key, + err = VasEBoot_crypto_pbkdf2 (VasEBoot_MD_SHA1, + (const VasEBoot_uint8_t *) wrap_key->key, wrap_key->keylen, - (const grub_uint8_t *) &salt, sizeof (salt), + (const VasEBoot_uint8_t *) &salt, sizeof (salt), 1000, wrap_key_real, keylen); if (err) { - grub_errno = GRUB_ERR_NONE; - grub_crypto_cipher_close (cipher); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_crypto_cipher_close (cipher); continue; } - err = grub_crypto_cipher_set_key (cipher, wrap_key_real, + err = VasEBoot_crypto_cipher_set_key (cipher, wrap_key_real, keylen); if (err) { - grub_errno = GRUB_ERR_NONE; - grub_crypto_cipher_close (cipher); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_crypto_cipher_close (cipher); continue; } err = algo_decrypt (cipher, algo, decrypted, key->unknown_purpose_key, 32, mac, key->unknown_purpose_nonce, 2, 16); - if (err || (grub_crypto_memcmp (mac, key->unknown_purpose_key + 32, 16) + if (err || (VasEBoot_crypto_memcmp (mac, key->unknown_purpose_key + 32, 16) != 0)) { - grub_dprintf ("zfs", "key loading failed\n"); - grub_errno = GRUB_ERR_NONE; - grub_crypto_cipher_close (cipher); + VasEBoot_dprintf ("zfs", "key loading failed\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_crypto_cipher_close (cipher); continue; } err = algo_decrypt (cipher, algo, decrypted, key->enc_key, keylen, mac, key->enc_nonce, 2, 16); - if (err || grub_crypto_memcmp (mac, key->enc_key + keylen, 16) != 0) + if (err || VasEBoot_crypto_memcmp (mac, key->enc_key + keylen, 16) != 0) { - grub_dprintf ("zfs", "key loading failed\n"); - grub_errno = GRUB_ERR_NONE; - grub_crypto_cipher_close (cipher); + VasEBoot_dprintf ("zfs", "key loading failed\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_crypto_cipher_close (cipher); continue; } - ret = grub_crypto_cipher_open (GRUB_CIPHER_AES); + ret = VasEBoot_crypto_cipher_open (VasEBoot_CIPHER_AES); if (!ret) { - grub_errno = GRUB_ERR_NONE; - grub_crypto_cipher_close (cipher); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_crypto_cipher_close (cipher); continue; } - err = grub_crypto_cipher_set_key (ret, decrypted, keylen); + err = VasEBoot_crypto_cipher_set_key (ret, decrypted, keylen); if (err) { - grub_errno = GRUB_ERR_NONE; - grub_crypto_cipher_close (ret); - grub_crypto_cipher_close (cipher); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_crypto_cipher_close (ret); + VasEBoot_crypto_cipher_close (cipher); continue; } - grub_crypto_cipher_close (cipher); + VasEBoot_crypto_cipher_close (cipher); return ret; } return NULL; } -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"raw", 'r', 0, N_("Assume input is raw."), 0, 0}, {"hex", 'h', 0, N_("Assume input is hex."), 0, 0}, @@ -416,71 +416,71 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_zfs_key (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_zfs_key (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - grub_uint8_t buf[1024]; - grub_ssize_t real_size; + VasEBoot_uint8_t buf[1024]; + VasEBoot_ssize_t real_size; if (argc > 0) { - grub_file_t file; - file = grub_file_open (args[0]); + VasEBoot_file_t file; + file = VasEBoot_file_open (args[0]); if (!file) - return grub_errno; - real_size = grub_file_read (file, buf, 1024); + return VasEBoot_errno; + real_size = VasEBoot_file_read (file, buf, 1024); if (real_size < 0) - return grub_errno; + return VasEBoot_errno; } else { - grub_xputs (_("Enter ZFS password: ")); - if (!grub_password_get ((char *) buf, 1023)) - return grub_errno; - real_size = grub_strlen ((char *) buf); + VasEBoot_xputs (_("Enter ZFS password: ")); + if (!VasEBoot_password_get ((char *) buf, 1023)) + return VasEBoot_errno; + real_size = VasEBoot_strlen ((char *) buf); } if (ctxt->state[1].set) { int i; - grub_err_t err; + VasEBoot_err_t err; for (i = 0; i < real_size / 2; i++) { - char c1 = grub_tolower (buf[2 * i]) - '0'; - char c2 = grub_tolower (buf[2 * i + 1]) - '0'; + char c1 = VasEBoot_tolower (buf[2 * i]) - '0'; + char c2 = VasEBoot_tolower (buf[2 * i + 1]) - '0'; if (c1 > 9) c1 += '0' - 'a' + 10; if (c2 > 9) c2 += '0' - 'a' + 10; buf[i] = (c1 << 4) | c2; } - err = grub_zfs_add_key (buf, real_size / 2, 0); + err = VasEBoot_zfs_add_key (buf, real_size / 2, 0); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_zfs_add_key (buf, real_size, + return VasEBoot_zfs_add_key (buf, real_size, ctxt->state[2].set || (argc == 0 && !ctxt->state[0].set && !ctxt->state[1].set)); } -static grub_extcmd_t cmd_key; +static VasEBoot_extcmd_t cmd_key; -GRUB_MOD_INIT(zfscrypt) +VasEBoot_MOD_INIT(zfscrypt) { - grub_zfs_decrypt = grub_zfs_decrypt_real; - grub_zfs_load_key = grub_zfs_load_key_real; - cmd_key = grub_register_extcmd ("zfskey", grub_cmd_zfs_key, 0, + VasEBoot_zfs_decrypt = VasEBoot_zfs_decrypt_real; + VasEBoot_zfs_load_key = VasEBoot_zfs_load_key_real; + cmd_key = VasEBoot_register_extcmd ("zfskey", VasEBoot_cmd_zfs_key, 0, N_("[-h|-p|-r] [FILE]"), N_("Import ZFS wrapping key stored in FILE."), options); } -GRUB_MOD_FINI(zfscrypt) +VasEBoot_MOD_FINI(zfscrypt) { - grub_zfs_decrypt = 0; - grub_zfs_load_key = 0; - grub_unregister_extcmd (cmd_key); + VasEBoot_zfs_decrypt = 0; + VasEBoot_zfs_load_key = 0; + VasEBoot_unregister_extcmd (cmd_key); } diff --git a/VasEBoot-core/fs/zfs/zfsinfo.c b/VasEBoot-core/fs/zfs/zfsinfo.c index c8a28acf5..520f7f047 100644 --- a/VasEBoot-core/fs/zfs/zfsinfo.c +++ b/VasEBoot-core/fs/zfs/zfsinfo.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009 Free Software Foundation, Inc. * Copyright 2008 Sun Microsystems, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static inline void print_tabs (int n) @@ -35,62 +35,62 @@ print_tabs (int n) int i; for (i = 0; i < n; i++) - grub_printf (" "); + VasEBoot_printf (" "); } -static grub_err_t +static VasEBoot_err_t print_state (char *nvlist, int tab) { - grub_uint64_t ival; + VasEBoot_uint64_t ival; int isok = 1; print_tabs (tab); - if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_REMOVED, &ival)) + if (VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_REMOVED, &ival)) { - grub_puts_ (N_("Virtual device is removed")); + VasEBoot_puts_ (N_("Virtual device is removed")); isok = 0; } - if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival)) + if (VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival)) { - grub_puts_ (N_("Virtual device is faulted")); + VasEBoot_puts_ (N_("Virtual device is faulted")); isok = 0; } - if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_OFFLINE, &ival)) + if (VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_OFFLINE, &ival)) { - grub_puts_ (N_("Virtual device is offline")); + VasEBoot_puts_ (N_("Virtual device is offline")); isok = 0; } - if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival)) + if (VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival)) /* TRANSLATORS: degraded doesn't mean broken but that some of component are missing but virtual device as whole is still usable. */ - grub_puts_ (N_("Virtual device is degraded")); + VasEBoot_puts_ (N_("Virtual device is degraded")); if (isok) - grub_puts_ (N_("Virtual device is online")); - grub_xputs ("\n"); + VasEBoot_puts_ (N_("Virtual device is online")); + VasEBoot_xputs ("\n"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t print_vdev_info (char *nvlist, int tab) { char *type = 0; - type = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); + type = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); if (!type) { print_tabs (tab); - grub_puts_ (N_("Incorrect virtual device: no type available")); - return grub_errno; + VasEBoot_puts_ (N_("Incorrect virtual device: no type available")); + return VasEBoot_errno; } - if (grub_strcmp (type, VDEV_TYPE_DISK) == 0) + if (VasEBoot_strcmp (type, VDEV_TYPE_DISK) == 0) { char *bootpath = 0; char *path = 0; @@ -102,69 +102,69 @@ print_vdev_info (char *nvlist, int tab) The "real" devices which actually store data are called "leafs" (again borrowed from graph theory) and can be either disks (or partitions) or files. */ - grub_puts_ (N_("Leaf virtual device (file or disk)")); + VasEBoot_puts_ (N_("Leaf virtual device (file or disk)")); print_state (nvlist, tab); bootpath = - grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_PHYS_PATH); + VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_PHYS_PATH); print_tabs (tab); if (!bootpath) - grub_puts_ (N_("Bootpath: unavailable\n")); + VasEBoot_puts_ (N_("Bootpath: unavailable\n")); else - grub_printf_ (N_("Bootpath: %s\n"), bootpath); + VasEBoot_printf_ (N_("Bootpath: %s\n"), bootpath); - path = grub_zfs_nvlist_lookup_string (nvlist, "path"); + path = VasEBoot_zfs_nvlist_lookup_string (nvlist, "path"); print_tabs (tab); if (!path) - grub_puts_ (N_("Path: unavailable")); + VasEBoot_puts_ (N_("Path: unavailable")); else - grub_printf_ (N_("Path: %s\n"), path); + VasEBoot_printf_ (N_("Path: %s\n"), path); - devid = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID); + devid = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID); print_tabs (tab); if (!devid) - grub_puts_ (N_("Devid: unavailable")); + VasEBoot_puts_ (N_("Devid: unavailable")); else - grub_printf_ (N_("Devid: %s\n"), devid); - grub_free (bootpath); - grub_free (devid); - grub_free (path); - grub_free (type); - return GRUB_ERR_NONE; + VasEBoot_printf_ (N_("Devid: %s\n"), devid); + VasEBoot_free (bootpath); + VasEBoot_free (devid); + VasEBoot_free (path); + VasEBoot_free (type); + return VasEBoot_ERR_NONE; } - char is_mirror=(grub_strcmp(type,VDEV_TYPE_MIRROR) == 0); - char is_raidz=(grub_strcmp(type,VDEV_TYPE_RAIDZ) == 0); - grub_free (type); + char is_mirror=(VasEBoot_strcmp(type,VDEV_TYPE_MIRROR) == 0); + char is_raidz=(VasEBoot_strcmp(type,VDEV_TYPE_RAIDZ) == 0); + VasEBoot_free (type); if (is_mirror || is_raidz) { int nelm, i; - nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm + nelm = VasEBoot_zfs_nvlist_lookup_nvlist_array_get_nelm (nvlist, ZPOOL_CONFIG_CHILDREN); if(is_mirror){ - grub_puts_ (N_("This VDEV is a mirror")); + VasEBoot_puts_ (N_("This VDEV is a mirror")); } else if(is_raidz){ - grub_uint64_t parity; - grub_zfs_nvlist_lookup_uint64(nvlist,"nparity",&parity); - grub_printf_ (N_("This VDEV is a RAIDZ%llu\n"),(unsigned long long)parity); + VasEBoot_uint64_t parity; + VasEBoot_zfs_nvlist_lookup_uint64(nvlist,"nparity",&parity); + VasEBoot_printf_ (N_("This VDEV is a RAIDZ%llu\n"),(unsigned long long)parity); } print_tabs (tab); if (nelm <= 0) { - grub_puts_ (N_("Incorrect VDEV")); - return GRUB_ERR_NONE; + VasEBoot_puts_ (N_("Incorrect VDEV")); + return VasEBoot_ERR_NONE; } - grub_printf_ (N_("VDEV with %d children\n"), nelm); + VasEBoot_printf_ (N_("VDEV with %d children\n"), nelm); print_state (nvlist, tab); for (i = 0; i < nelm; i++) { char *child; - child = grub_zfs_nvlist_lookup_nvlist_array + child = VasEBoot_zfs_nvlist_lookup_nvlist_array (nvlist, ZPOOL_CONFIG_CHILDREN, i); print_tabs (tab); @@ -174,77 +174,77 @@ print_vdev_info (char *nvlist, int tab) total element number. And the number itself is fine, only the element isn't. */ - grub_printf_ (N_("VDEV element number %d isn't correct\n"), i); + VasEBoot_printf_ (N_("VDEV element number %d isn't correct\n"), i); continue; } /* TRANSLATORS: it's the element carying the number %d, not total element number. This is used in enumeration "Element number 1", "Element number 2", ... */ - grub_printf_ (N_("VDEV element number %d:\n"), i); + VasEBoot_printf_ (N_("VDEV element number %d:\n"), i); print_vdev_info (child, tab + 1); - grub_free (child); + VasEBoot_free (child); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } print_tabs (tab); - grub_printf_ (N_("Unknown virtual device type: %s\n"), type); + VasEBoot_printf_ (N_("Unknown virtual device type: %s\n"), type); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t get_bootpath (char *nvlist, char **bootpath, char **devid) { char *type = 0; - type = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); + type = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); if (!type) - return grub_errno; + return VasEBoot_errno; - if (grub_strcmp (type, VDEV_TYPE_DISK) == 0) + if (VasEBoot_strcmp (type, VDEV_TYPE_DISK) == 0) { - *bootpath = grub_zfs_nvlist_lookup_string (nvlist, + *bootpath = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_PHYS_PATH); - *devid = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID); + *devid = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID); if (!*bootpath || !*devid) { - grub_free (*bootpath); - grub_free (*devid); + VasEBoot_free (*bootpath); + VasEBoot_free (*devid); *bootpath = 0; *devid = 0; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_strcmp (type, VDEV_TYPE_MIRROR) == 0) + if (VasEBoot_strcmp (type, VDEV_TYPE_MIRROR) == 0) { int nelm, i; - nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm + nelm = VasEBoot_zfs_nvlist_lookup_nvlist_array_get_nelm (nvlist, ZPOOL_CONFIG_CHILDREN); for (i = 0; i < nelm; i++) { char *child; - child = grub_zfs_nvlist_lookup_nvlist_array (nvlist, + child = VasEBoot_zfs_nvlist_lookup_nvlist_array (nvlist, ZPOOL_CONFIG_CHILDREN, i); get_bootpath (child, bootpath, devid); - grub_free (child); + VasEBoot_free (child); if (*bootpath && *devid) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static const char *poolstates[] = { @@ -261,144 +261,144 @@ static const char *poolstates[] = { [POOL_STATE_POTENTIALLY_ACTIVE] = N_("Pool state: potentially active") }; -static grub_err_t -grub_cmd_zfsinfo (grub_command_t cmd __attribute__ ((unused)), int argc, +static VasEBoot_err_t +VasEBoot_cmd_zfsinfo (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_device_t dev; + VasEBoot_device_t dev; char *devname; - grub_err_t err; + VasEBoot_err_t err; char *nvlist = 0; char *nv = 0; char *poolname; - grub_uint64_t guid; - grub_uint64_t pool_state; + VasEBoot_uint64_t guid; + VasEBoot_uint64_t pool_state; int found; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') + if (args[0][0] == '(' && args[0][VasEBoot_strlen (args[0]) - 1] == ')') { - devname = grub_strdup (args[0] + 1); + devname = VasEBoot_strdup (args[0] + 1); if (devname) - devname[grub_strlen (devname) - 1] = 0; + devname[VasEBoot_strlen (devname) - 1] = 0; } else - devname = grub_strdup (args[0]); + devname = VasEBoot_strdup (args[0]); if (!devname) - return grub_errno; + return VasEBoot_errno; - dev = grub_device_open (devname); - grub_free (devname); + dev = VasEBoot_device_open (devname); + VasEBoot_free (devname); if (!dev) - return grub_errno; + return VasEBoot_errno; - err = grub_zfs_fetch_nvlist (dev, &nvlist); + err = VasEBoot_zfs_fetch_nvlist (dev, &nvlist); - grub_device_close (dev); + VasEBoot_device_close (dev); if (err) return err; - poolname = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); + poolname = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); if (!poolname) - grub_puts_ (N_("Pool name: unavailable")); + VasEBoot_puts_ (N_("Pool name: unavailable")); else - grub_printf_ (N_("Pool name: %s\n"), poolname); + VasEBoot_printf_ (N_("Pool name: %s\n"), poolname); found = - grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, &guid); + VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, &guid); if (!found) - grub_puts_ (N_("Pool GUID: unavailable")); + VasEBoot_puts_ (N_("Pool GUID: unavailable")); else - grub_printf_ (N_("Pool GUID: %016llx\n"), (long long unsigned) guid); + VasEBoot_printf_ (N_("Pool GUID: %016llx\n"), (long long unsigned) guid); - found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE, + found = VasEBoot_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE, &pool_state); if (!found) - grub_puts_ (N_("Unable to retrieve pool state")); + VasEBoot_puts_ (N_("Unable to retrieve pool state")); else if (pool_state >= ARRAY_SIZE (poolstates)) - grub_puts_ (N_("Unrecognized pool state")); + VasEBoot_puts_ (N_("Unrecognized pool state")); else - grub_puts_ (poolstates[pool_state]); + VasEBoot_puts_ (poolstates[pool_state]); - nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); + nv = VasEBoot_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); if (!nv) /* TRANSLATORS: There are undetermined number of virtual devices in a device tree, not just one. */ - grub_puts_ (N_("No virtual device tree available")); + VasEBoot_puts_ (N_("No virtual device tree available")); else print_vdev_info (nv, 1); - grub_free (nv); - grub_free (nvlist); + VasEBoot_free (nv); + VasEBoot_free (nvlist); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc, +static VasEBoot_err_t +VasEBoot_cmd_zfs_bootfs (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_device_t dev; + VasEBoot_device_t dev; char *devname; - grub_err_t err; + VasEBoot_err_t err; char *nvlist = 0; char *nv = 0; char *bootpath = 0, *devid = 0; char *fsname; char *bootfs; char *poolname; - grub_uint64_t mdnobj; + VasEBoot_uint64_t mdnobj; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - devname = grub_file_get_device_name (args[0]); - if (grub_errno) - return grub_errno; + devname = VasEBoot_file_get_device_name (args[0]); + if (VasEBoot_errno) + return VasEBoot_errno; - dev = grub_device_open (devname); - grub_free (devname); + dev = VasEBoot_device_open (devname); + VasEBoot_free (devname); if (!dev) - return grub_errno; + return VasEBoot_errno; - err = grub_zfs_fetch_nvlist (dev, &nvlist); + err = VasEBoot_zfs_fetch_nvlist (dev, &nvlist); - fsname = grub_strchr (args[0], ')'); + fsname = VasEBoot_strchr (args[0], ')'); if (fsname) fsname++; else fsname = args[0]; if (!err) - err = grub_zfs_getmdnobj (dev, fsname, &mdnobj); + err = VasEBoot_zfs_getmdnobj (dev, fsname, &mdnobj); - grub_device_close (dev); + VasEBoot_device_close (dev); if (err) return err; - poolname = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); + poolname = VasEBoot_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); if (!poolname) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_FS, "No poolname found"); - return grub_errno; + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_FS, "No poolname found"); + return VasEBoot_errno; } - nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); + nv = VasEBoot_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); if (nv) get_bootpath (nv, &bootpath, &devid); - grub_free (nv); - grub_free (nvlist); + VasEBoot_free (nv); + VasEBoot_free (nvlist); - bootfs = grub_xasprintf ("zfs-bootfs=%s/%llu%s%s%s%s%s%s", + bootfs = VasEBoot_xasprintf ("zfs-bootfs=%s/%llu%s%s%s%s%s%s", poolname, (unsigned long long) mdnobj, bootpath ? ",bootpath=\"" : "", bootpath ? : "", @@ -407,35 +407,35 @@ grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc, devid ? : "", devid ? "\"" : ""); if (!bootfs) - return grub_errno; + return VasEBoot_errno; if (argc >= 2) - grub_env_set (args[1], bootfs); + VasEBoot_env_set (args[1], bootfs); else - grub_printf ("%s\n", bootfs); + VasEBoot_printf ("%s\n", bootfs); - grub_free (bootfs); - grub_free (poolname); - grub_free (bootpath); - grub_free (devid); + VasEBoot_free (bootfs); + VasEBoot_free (poolname); + VasEBoot_free (bootpath); + VasEBoot_free (devid); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_info, cmd_bootfs; +static VasEBoot_command_t cmd_info, cmd_bootfs; -GRUB_MOD_INIT (zfsinfo) +VasEBoot_MOD_INIT (zfsinfo) { - cmd_info = grub_register_command ("zfsinfo", grub_cmd_zfsinfo, + cmd_info = VasEBoot_register_command ("zfsinfo", VasEBoot_cmd_zfsinfo, N_("DEVICE"), N_("Print ZFS info about DEVICE.")); - cmd_bootfs = grub_register_command ("zfs-bootfs", grub_cmd_zfs_bootfs, + cmd_bootfs = VasEBoot_register_command ("zfs-bootfs", VasEBoot_cmd_zfs_bootfs, N_("FILESYSTEM [VARIABLE]"), N_("Print ZFS-BOOTFSOBJ or store it into VARIABLE")); } -GRUB_MOD_FINI (zfsinfo) +VasEBoot_MOD_FINI (zfsinfo) { - grub_unregister_command (cmd_info); - grub_unregister_command (cmd_bootfs); + VasEBoot_unregister_command (cmd_info); + VasEBoot_unregister_command (cmd_bootfs); } diff --git a/VasEBoot-core/gdb/cstub.c b/VasEBoot-core/gdb/cstub.c index b64acd70f..5689c2af4 100644 --- a/VasEBoot-core/gdb/cstub.c +++ b/VasEBoot-core/gdb/cstub.c @@ -17,21 +17,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static const char hexchars[] = "0123456789abcdef"; -int grub_gdb_regs[GRUB_MACHINE_NR_REGS]; +int VasEBoot_gdb_regs[VasEBoot_MACHINE_NR_REGS]; -#define GRUB_GDB_COMBUF_SIZE 400 /* At least sizeof(grub_gdb_regs)*2 are needed for +#define VasEBoot_GDB_COMBUF_SIZE 400 /* At least sizeof(VasEBoot_gdb_regs)*2 are needed for register packets. */ -static char grub_gdb_inbuf[GRUB_GDB_COMBUF_SIZE + 1]; -static char grub_gdb_outbuf[GRUB_GDB_COMBUF_SIZE + 1]; +static char VasEBoot_gdb_inbuf[VasEBoot_GDB_COMBUF_SIZE + 1]; +static char VasEBoot_gdb_outbuf[VasEBoot_GDB_COMBUF_SIZE + 1]; -struct grub_serial_port *grub_gdb_port; +struct VasEBoot_serial_port *VasEBoot_gdb_port; static int hex (char ch) @@ -47,9 +47,9 @@ hex (char ch) /* Scan for the sequence $#. */ static char * -grub_gdb_getpacket (void) +VasEBoot_gdb_getpacket (void) { - char *buffer = &grub_gdb_inbuf[0]; + char *buffer = &VasEBoot_gdb_inbuf[0]; unsigned char checksum; unsigned char xmitcsum; int count; @@ -59,7 +59,7 @@ grub_gdb_getpacket (void) { /* Wait around for the start character, ignore all other characters. */ - while ((ch = grub_serial_port_fetch (grub_gdb_port)) != '$'); + while ((ch = VasEBoot_serial_port_fetch (VasEBoot_gdb_port)) != '$'); retry: checksum = 0; @@ -67,10 +67,10 @@ grub_gdb_getpacket (void) count = 0; /* Now read until a # or end of buffer is found. */ - while (count < GRUB_GDB_COMBUF_SIZE) + while (count < VasEBoot_GDB_COMBUF_SIZE) { do - ch = grub_serial_port_fetch (grub_gdb_port); + ch = VasEBoot_serial_port_fetch (VasEBoot_gdb_port); while (ch < 0); if (ch == '$') goto retry; @@ -84,25 +84,25 @@ grub_gdb_getpacket (void) if (ch == '#') { do - ch = grub_serial_port_fetch (grub_gdb_port); + ch = VasEBoot_serial_port_fetch (VasEBoot_gdb_port); while (ch < 0); xmitcsum = hex (ch) << 4; do - ch = grub_serial_port_fetch (grub_gdb_port); + ch = VasEBoot_serial_port_fetch (VasEBoot_gdb_port); while (ch < 0); xmitcsum += hex (ch); if (checksum != xmitcsum) - grub_serial_port_put (grub_gdb_port, '-'); /* Failed checksum. */ + VasEBoot_serial_port_put (VasEBoot_gdb_port, '-'); /* Failed checksum. */ else { - grub_serial_port_put (grub_gdb_port, '+'); /* Successful transfer. */ + VasEBoot_serial_port_put (VasEBoot_gdb_port, '+'); /* Successful transfer. */ /* If a sequence char is present, reply the sequence ID. */ if (buffer[2] == ':') { - grub_serial_port_put (grub_gdb_port, buffer[0]); - grub_serial_port_put (grub_gdb_port, buffer[1]); + VasEBoot_serial_port_put (VasEBoot_gdb_port, buffer[0]); + VasEBoot_serial_port_put (VasEBoot_gdb_port, buffer[1]); return &buffer[3]; } @@ -114,36 +114,36 @@ grub_gdb_getpacket (void) /* Send the packet in buffer. */ static void -grub_gdb_putpacket (char *buffer) +VasEBoot_gdb_putpacket (char *buffer) { - grub_uint8_t checksum; + VasEBoot_uint8_t checksum; /* $#. */ do { char *ptr; - grub_serial_port_put (grub_gdb_port, '$'); + VasEBoot_serial_port_put (VasEBoot_gdb_port, '$'); checksum = 0; for (ptr = buffer; *ptr; ptr++) { - grub_serial_port_put (grub_gdb_port, *ptr); + VasEBoot_serial_port_put (VasEBoot_gdb_port, *ptr); checksum += *ptr; } - grub_serial_port_put (grub_gdb_port, '#'); - grub_serial_port_put (grub_gdb_port, hexchars[checksum >> 4]); - grub_serial_port_put (grub_gdb_port, hexchars[checksum & 0xf]); + VasEBoot_serial_port_put (VasEBoot_gdb_port, '#'); + VasEBoot_serial_port_put (VasEBoot_gdb_port, hexchars[checksum >> 4]); + VasEBoot_serial_port_put (VasEBoot_gdb_port, hexchars[checksum & 0xf]); } - while (grub_serial_port_fetch (grub_gdb_port) != '+'); + while (VasEBoot_serial_port_fetch (VasEBoot_gdb_port) != '+'); } /* Convert the memory pointed to by mem into hex, placing result in buf. Return a pointer to the last char put in buf (NULL). */ static char * -grub_gdb_mem2hex (char *mem, char *buf, grub_size_t count) +VasEBoot_gdb_mem2hex (char *mem, char *buf, VasEBoot_size_t count) { - grub_size_t i; + VasEBoot_size_t i; unsigned char ch; for (i = 0; i < count; i++) @@ -159,7 +159,7 @@ grub_gdb_mem2hex (char *mem, char *buf, grub_size_t count) /* Convert the hex array pointed to by buf into binary to be placed in mem. Return a pointer to the character after the last byte written. */ static char * -grub_gdb_hex2mem (char *buf, char *mem, int count) +VasEBoot_gdb_hex2mem (char *buf, char *mem, int count) { int i; unsigned char ch; @@ -176,7 +176,7 @@ grub_gdb_hex2mem (char *buf, char *mem, int count) /* Convert hex characters to int and return the number of characters processed. */ static int -grub_gdb_hex2int (char **ptr, grub_uint64_t *int_value) +VasEBoot_gdb_hex2int (char **ptr, VasEBoot_uint64_t *int_value) { int num_chars = 0; int hex_value; @@ -202,26 +202,26 @@ grub_gdb_hex2int (char **ptr, grub_uint64_t *int_value) /* This function does all command procesing for interfacing to gdb. */ void __attribute__ ((regparm(3))) -grub_gdb_trap (int trap_no) +VasEBoot_gdb_trap (int trap_no) { unsigned int sig_no; int stepping; - grub_uint64_t addr; - grub_uint64_t length; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t length; char *ptr; - if (!grub_gdb_port) + if (!VasEBoot_gdb_port) { - grub_printf ("Unhandled exception 0x%x at ", trap_no); - grub_backtrace_print_address ((void *) grub_gdb_regs[PC]); - grub_printf ("\n"); - grub_backtrace_pointer ((void *) grub_gdb_regs[EBP]); - grub_fatal ("Unhandled exception"); + VasEBoot_printf ("Unhandled exception 0x%x at ", trap_no); + VasEBoot_backtrace_print_address ((void *) VasEBoot_gdb_regs[PC]); + VasEBoot_printf ("\n"); + VasEBoot_backtrace_pointer ((void *) VasEBoot_gdb_regs[EBP]); + VasEBoot_fatal ("Unhandled exception"); } - sig_no = grub_gdb_trap2sig (trap_no); + sig_no = VasEBoot_gdb_trap2sig (trap_no); - ptr = grub_gdb_outbuf; + ptr = VasEBoot_gdb_outbuf; /* Reply to host that an exception has occurred. */ @@ -233,103 +233,103 @@ grub_gdb_trap (int trap_no) /* Stack pointer. */ *ptr++ = hexchars[SP]; *ptr++ = ':'; - ptr = grub_gdb_mem2hex ((char *) &grub_gdb_regs[ESP], ptr, 4); + ptr = VasEBoot_gdb_mem2hex ((char *) &VasEBoot_gdb_regs[ESP], ptr, 4); *ptr++ = ';'; /* Frame pointer. */ *ptr++ = hexchars[FP]; *ptr++ = ':'; - ptr = grub_gdb_mem2hex ((char *) &grub_gdb_regs[EBP], ptr, 4); + ptr = VasEBoot_gdb_mem2hex ((char *) &VasEBoot_gdb_regs[EBP], ptr, 4); *ptr++ = ';'; /* Program counter. */ *ptr++ = hexchars[PC]; *ptr++ = ':'; - ptr = grub_gdb_mem2hex ((char *) &grub_gdb_regs[PC], ptr, 4); + ptr = VasEBoot_gdb_mem2hex ((char *) &VasEBoot_gdb_regs[PC], ptr, 4); *ptr++ = ';'; *ptr = '\0'; - grub_gdb_putpacket (grub_gdb_outbuf); + VasEBoot_gdb_putpacket (VasEBoot_gdb_outbuf); stepping = 0; while (1) { - grub_gdb_outbuf[0] = 0; - ptr = grub_gdb_getpacket (); + VasEBoot_gdb_outbuf[0] = 0; + ptr = VasEBoot_gdb_getpacket (); switch (*ptr++) { case '?': - grub_gdb_outbuf[0] = 'S'; - grub_gdb_outbuf[1] = hexchars[sig_no >> 4]; - grub_gdb_outbuf[2] = hexchars[sig_no & 0xf]; - grub_gdb_outbuf[3] = 0; + VasEBoot_gdb_outbuf[0] = 'S'; + VasEBoot_gdb_outbuf[1] = hexchars[sig_no >> 4]; + VasEBoot_gdb_outbuf[2] = hexchars[sig_no & 0xf]; + VasEBoot_gdb_outbuf[3] = 0; break; /* Return values of the CPU registers. */ case 'g': - grub_gdb_mem2hex ((char *) grub_gdb_regs, grub_gdb_outbuf, - sizeof (grub_gdb_regs)); + VasEBoot_gdb_mem2hex ((char *) VasEBoot_gdb_regs, VasEBoot_gdb_outbuf, + sizeof (VasEBoot_gdb_regs)); break; /* Set values of the CPU registers -- return OK. */ case 'G': - grub_gdb_hex2mem (ptr, (char *) grub_gdb_regs, - sizeof (grub_gdb_regs)); - grub_strcpy (grub_gdb_outbuf, "OK"); + VasEBoot_gdb_hex2mem (ptr, (char *) VasEBoot_gdb_regs, + sizeof (VasEBoot_gdb_regs)); + VasEBoot_strcpy (VasEBoot_gdb_outbuf, "OK"); break; /* Set the value of a single CPU register -- return OK. */ case 'P': { - grub_uint64_t regno; + VasEBoot_uint64_t regno; - if (grub_gdb_hex2int (&ptr, ®no) && *ptr++ == '=') - if (regno < GRUB_MACHINE_NR_REGS) + if (VasEBoot_gdb_hex2int (&ptr, ®no) && *ptr++ == '=') + if (regno < VasEBoot_MACHINE_NR_REGS) { - grub_gdb_hex2mem (ptr, (char *) &grub_gdb_regs[regno], 4); - grub_strcpy (grub_gdb_outbuf, "OK"); + VasEBoot_gdb_hex2mem (ptr, (char *) &VasEBoot_gdb_regs[regno], 4); + VasEBoot_strcpy (VasEBoot_gdb_outbuf, "OK"); break; } /* FIXME: GDB requires setting orig_eax. I don't know what's this register is about. For now just simulate setting any registers. */ - grub_strcpy (grub_gdb_outbuf, /*"E01"*/ "OK"); + VasEBoot_strcpy (VasEBoot_gdb_outbuf, /*"E01"*/ "OK"); break; } /* mAA..AA,LLLL: Read LLLL bytes at address AA..AA. */ case 'm': /* Try to read %x,%x. Set ptr = 0 if successful. */ - if (grub_gdb_hex2int (&ptr, &addr)) + if (VasEBoot_gdb_hex2int (&ptr, &addr)) if (*(ptr++) == ',') - if (grub_gdb_hex2int (&ptr, &length)) + if (VasEBoot_gdb_hex2int (&ptr, &length)) { ptr = 0; - grub_gdb_mem2hex ((char *) (grub_addr_t) addr, - grub_gdb_outbuf, length); + VasEBoot_gdb_mem2hex ((char *) (VasEBoot_addr_t) addr, + VasEBoot_gdb_outbuf, length); } if (ptr) - grub_strcpy (grub_gdb_outbuf, "E01"); + VasEBoot_strcpy (VasEBoot_gdb_outbuf, "E01"); break; /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA -- return OK. */ case 'M': /* Try to read %x,%x. Set ptr = 0 if successful. */ - if (grub_gdb_hex2int (&ptr, &addr)) + if (VasEBoot_gdb_hex2int (&ptr, &addr)) if (*(ptr++) == ',') - if (grub_gdb_hex2int (&ptr, &length)) + if (VasEBoot_gdb_hex2int (&ptr, &length)) if (*(ptr++) == ':') { - grub_gdb_hex2mem (ptr, (char *) (grub_addr_t) addr, length); - grub_strcpy (grub_gdb_outbuf, "OK"); + VasEBoot_gdb_hex2mem (ptr, (char *) (VasEBoot_addr_t) addr, length); + VasEBoot_strcpy (VasEBoot_gdb_outbuf, "OK"); ptr = 0; } if (ptr) { - grub_strcpy (grub_gdb_outbuf, "E02"); + VasEBoot_strcpy (VasEBoot_gdb_outbuf, "E02"); } break; @@ -341,15 +341,15 @@ grub_gdb_trap (int trap_no) /* cAA..AA: Continue at address AA..AA(optional). */ case 'c': /* try to read optional parameter, pc unchanged if no parm */ - if (grub_gdb_hex2int (&ptr, &addr)) - grub_gdb_regs[PC] = addr; + if (VasEBoot_gdb_hex2int (&ptr, &addr)) + VasEBoot_gdb_regs[PC] = addr; /* Clear the trace bit. */ - grub_gdb_regs[PS] &= 0xfffffeff; + VasEBoot_gdb_regs[PS] &= 0xfffffeff; /* Set the trace bit if we're stepping. */ if (stepping) - grub_gdb_regs[PS] |= 0x100; + VasEBoot_gdb_regs[PS] |= 0x100; return; @@ -360,7 +360,7 @@ grub_gdb_trap (int trap_no) } /* Reply to the request. */ - grub_gdb_putpacket (grub_gdb_outbuf); + VasEBoot_gdb_putpacket (VasEBoot_gdb_outbuf); } } diff --git a/VasEBoot-core/gdb/gdb.c b/VasEBoot-core/gdb/gdb.c index 847a1e1e3..1bf198154 100644 --- a/VasEBoot-core/gdb/gdb.c +++ b/VasEBoot-core/gdb/gdb.c @@ -18,83 +18,83 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_gdbstub (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_gdbstub (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_serial_port *port; + struct VasEBoot_serial_port *port; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "port required"); - port = grub_serial_find (args[0]); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "port required"); + port = VasEBoot_serial_find (args[0]); if (!port) - return grub_errno; - grub_gdb_port = port; - /* TRANSLATORS: at this position GRUB waits for the user to do an action + return VasEBoot_errno; + VasEBoot_gdb_port = port; + /* TRANSLATORS: at this position VasEBoot waits for the user to do an action in remote debugger, namely to tell it to establish connection. */ - grub_puts_ (N_("Now connect the remote debugger, please.")); - grub_gdb_breakpoint (); + VasEBoot_puts_ (N_("Now connect the remote debugger, please.")); + VasEBoot_gdb_breakpoint (); return 0; } -static grub_err_t -grub_cmd_gdbstop (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_gdbstop (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_gdb_port = NULL; + VasEBoot_gdb_port = NULL; return 0; } -static grub_err_t -grub_cmd_gdb_break (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_gdb_break (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - if (!grub_gdb_port) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "No GDB stub is running"); - grub_gdb_breakpoint (); + if (!VasEBoot_gdb_port) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "No GDB stub is running"); + VasEBoot_gdb_breakpoint (); return 0; } -static grub_command_t cmd, cmd_stop, cmd_break; +static VasEBoot_command_t cmd, cmd_stop, cmd_break; -GRUB_MOD_INIT (gdb) +VasEBoot_MOD_INIT (gdb) { - grub_gdb_idtinit (); - cmd = grub_register_command ("gdbstub", grub_cmd_gdbstub, + VasEBoot_gdb_idtinit (); + cmd = VasEBoot_register_command ("gdbstub", VasEBoot_cmd_gdbstub, N_("PORT"), /* TRANSLATORS: GDB stub is a small part of GDB functionality running on local host which allows remote debugger to connect to it. */ N_("Start GDB stub on given port")); - cmd_break = grub_register_command ("gdbstub_break", grub_cmd_gdb_break, + cmd_break = VasEBoot_register_command ("gdbstub_break", VasEBoot_cmd_gdb_break, /* TRANSLATORS: this refers to triggering a breakpoint so that the user will land into GDB. */ 0, N_("Break into GDB")); - cmd_stop = grub_register_command ("gdbstub_stop", grub_cmd_gdbstop, + cmd_stop = VasEBoot_register_command ("gdbstub_stop", VasEBoot_cmd_gdbstop, 0, N_("Stop GDB stub")); } -GRUB_MOD_FINI (gdb) +VasEBoot_MOD_FINI (gdb) { - grub_unregister_command (cmd); - grub_unregister_command (cmd_stop); - grub_gdb_idtrestore (); + VasEBoot_unregister_command (cmd); + VasEBoot_unregister_command (cmd_stop); + VasEBoot_gdb_idtrestore (); } diff --git a/VasEBoot-core/gdb/i386/idt.c b/VasEBoot-core/gdb/i386/idt.c index 69bfcb089..55fca6f57 100644 --- a/VasEBoot-core/gdb/i386/idt.c +++ b/VasEBoot-core/gdb/i386/idt.c @@ -17,18 +17,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include -static struct grub_cpu_interrupt_gate grub_gdb_idt[GRUB_GDB_LAST_TRAP + 1] +static struct VasEBoot_cpu_interrupt_gate VasEBoot_gdb_idt[VasEBoot_GDB_LAST_TRAP + 1] __attribute__ ((aligned(16))); /* Sets up a gate descriptor in the IDT table. */ static void -grub_idt_gate (struct grub_cpu_interrupt_gate *gate, void (*offset) (void), - grub_uint16_t selector, grub_uint8_t type, grub_uint8_t dpl) +VasEBoot_idt_gate (struct VasEBoot_cpu_interrupt_gate *gate, void (*offset) (void), + VasEBoot_uint16_t selector, VasEBoot_uint8_t type, VasEBoot_uint8_t dpl) { gate->offset_lo = (int) offset & 0xffff; gate->selector = selector & 0xffff; @@ -37,42 +37,42 @@ grub_idt_gate (struct grub_cpu_interrupt_gate *gate, void (*offset) (void), gate->offset_hi = ((int) offset >> 16) & 0xffff; } -static struct grub_cpu_idt_descriptor grub_gdb_orig_idt_desc +static struct VasEBoot_cpu_idt_descriptor VasEBoot_gdb_orig_idt_desc __attribute__ ((aligned(16))); -static struct grub_cpu_idt_descriptor grub_gdb_idt_desc +static struct VasEBoot_cpu_idt_descriptor VasEBoot_gdb_idt_desc __attribute__ ((aligned(16))); /* Set up interrupt and trap handler descriptors in IDT. */ void -grub_gdb_idtinit (void) +VasEBoot_gdb_idtinit (void) { int i; - grub_uint16_t seg; + VasEBoot_uint16_t seg; asm volatile ("xorl %%eax, %%eax\n" "mov %%cs, %%ax\n" :"=a" (seg)); - for (i = 0; i <= GRUB_GDB_LAST_TRAP; i++) + for (i = 0; i <= VasEBoot_GDB_LAST_TRAP; i++) { - grub_idt_gate (&grub_gdb_idt[i], - grub_gdb_trapvec[i], seg, - GRUB_CPU_TRAP_GATE, 0); + VasEBoot_idt_gate (&VasEBoot_gdb_idt[i], + VasEBoot_gdb_trapvec[i], seg, + VasEBoot_CPU_TRAP_GATE, 0); } - grub_gdb_idt_desc.base = (grub_addr_t) grub_gdb_idt; - grub_gdb_idt_desc.limit = sizeof (grub_gdb_idt) - 1; - asm volatile ("sidt %0" : : "m" (grub_gdb_orig_idt_desc)); - asm volatile ("lidt %0" : : "m" (grub_gdb_idt_desc)); + VasEBoot_gdb_idt_desc.base = (VasEBoot_addr_t) VasEBoot_gdb_idt; + VasEBoot_gdb_idt_desc.limit = sizeof (VasEBoot_gdb_idt) - 1; + asm volatile ("sidt %0" : : "m" (VasEBoot_gdb_orig_idt_desc)); + asm volatile ("lidt %0" : : "m" (VasEBoot_gdb_idt_desc)); } void -grub_gdb_idtrestore (void) +VasEBoot_gdb_idtrestore (void) { - asm volatile ("lidt %0" : : "m" (grub_gdb_orig_idt_desc)); + asm volatile ("lidt %0" : : "m" (VasEBoot_gdb_orig_idt_desc)); } void -grub_gdb_breakpoint (void) +VasEBoot_gdb_breakpoint (void) { asm volatile ("int $3"); } diff --git a/VasEBoot-core/gdb/i386/machdep.S b/VasEBoot-core/gdb/i386/machdep.S index f96d2b9c4..bc9a0efc5 100644 --- a/VasEBoot-core/gdb/i386/machdep.S +++ b/VasEBoot-core/gdb/i386/machdep.S @@ -17,19 +17,19 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include +#include +#include #define EC_PRESENT 1 #define EC_ABSENT 0 -#define GRUB_GDB_STACKSIZE 40000 +#define VasEBoot_GDB_STACKSIZE 40000 #define SEP , #ifdef __APPLE__ - .zerofill __DATA, __bss, LOCAL(grub_gdb_stack_end), GRUB_GDB_STACKSIZE, 4 - LOCAL(grub_gdb_stack) = LOCAL(grub_gdb_stack_end) + .zerofill __DATA, __bss, LOCAL(VasEBoot_gdb_stack_end), VasEBoot_GDB_STACKSIZE, 4 + LOCAL(VasEBoot_gdb_stack) = LOCAL(VasEBoot_gdb_stack_end) #else /* * The .data index for the address vector. @@ -38,8 +38,8 @@ #define VECTOR 1 .bss - .space GRUB_GDB_STACKSIZE -VARIABLE(grub_gdb_stack) + .space VasEBoot_GDB_STACKSIZE +VARIABLE(VasEBoot_gdb_stack) #endif /* @@ -56,7 +56,7 @@ VARIABLE(grub_gdb_stack) #define REG \reg #define NDX \ndx #endif - movl REG, EXT_C(grub_gdb_regs)+(NDX * 4) + movl REG, EXT_C(VasEBoot_gdb_regs)+(NDX * 4) .endm #undef REG @@ -72,9 +72,9 @@ VARIABLE(grub_gdb_stack) #define NDX \ndx #endif xorl %eax, %eax - movw REG, EXT_C(grub_gdb_regs)+(NDX * 4) - movw %ax, EXT_C(grub_gdb_regs)+(NDX * 4 + 2) - movl EXT_C(grub_gdb_regs)+(EAX * 4), %eax + movw REG, EXT_C(VasEBoot_gdb_regs)+(NDX * 4) + movw %ax, EXT_C(VasEBoot_gdb_regs)+(NDX * 4 + 2) + movl EXT_C(VasEBoot_gdb_regs)+(EAX * 4), %eax .endm #undef REG @@ -89,7 +89,7 @@ VARIABLE(grub_gdb_stack) #define REG \reg #define NDX \ndx #endif - movl EXT_C(grub_gdb_regs)+(NDX * 4), REG + movl EXT_C(VasEBoot_gdb_regs)+(NDX * 4), REG .endm #undef REG @@ -104,7 +104,7 @@ VARIABLE(grub_gdb_stack) #define NDX \ndx #define REG \reg #endif - movw EXT_C(grub_gdb_regs)+(NDX * 4), REG + movw EXT_C(VasEBoot_gdb_regs)+(NDX * 4), REG .endm #undef REG @@ -164,7 +164,7 @@ VARIABLE(grub_gdb_stack) /* * This macro creates handlers for a given range of exception numbers - * and adds their addresses to the grub_gdb_trapvec array. + * and adds their addresses to the VasEBoot_gdb_trapvec array. */ #ifdef __APPLE__ @@ -191,12 +191,12 @@ VARIABLE(grub_gdb_stack) save_context #ifdef __APPLE__ - mov $LOCAL(grub_gdb_stack), %esp + mov $LOCAL(VasEBoot_gdb_stack), %esp #else - mov $EXT_C(grub_gdb_stack), %esp + mov $EXT_C(VasEBoot_gdb_stack), %esp #endif mov $(BEG), %eax /* trap number */ - call EXT_C(grub_gdb_trap) + call EXT_C(VasEBoot_gdb_trap) load_context iret @@ -233,7 +233,7 @@ VARIABLE(grub_gdb_stack) #else .data VECTOR #endif -VARIABLE(grub_gdb_trapvec) +VARIABLE(VasEBoot_gdb_trapvec) ent EC_ABSENT, 0, 7 ent EC_PRESENT, 8 ent EC_ABSENT, 9 @@ -242,4 +242,4 @@ VARIABLE(grub_gdb_trapvec) * You may have to split this further or as(1) * will complain about nesting being too deep. */ - ent EC_ABSENT, 15, GRUB_GDB_LAST_TRAP + ent EC_ABSENT, 15, VasEBoot_GDB_LAST_TRAP diff --git a/VasEBoot-core/gdb/i386/signal.c b/VasEBoot-core/gdb/i386/signal.c index 1ac3bbd18..4edf715a3 100644 --- a/VasEBoot-core/gdb/i386/signal.c +++ b/VasEBoot-core/gdb/i386/signal.c @@ -17,15 +17,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include /* Converting CPU trap number to UNIX signal number as described in System V ABI i386 Processor Supplement, 3-25. */ unsigned int -grub_gdb_trap2sig (int trap_no) +VasEBoot_gdb_trap2sig (int trap_no) { const int signals[] = { SIGFPE, /* 0: Divide error fault */ diff --git a/VasEBoot-core/gdb_VasEBoot.in b/VasEBoot-core/gdb_VasEBoot.in index e322d3dc1..3b94f0505 100644 --- a/VasEBoot-core/gdb_VasEBoot.in +++ b/VasEBoot-core/gdb_VasEBoot.in @@ -1,5 +1,5 @@ ### -### Load debuging information about GNU GRUB 2 modules into GDB +### Load debuging information about GNU VasEBoot 2 modules into GDB ### automatically. Needs readelf, Perl and gmodule.pl script ### ### Has to be launched from the writable and trusted @@ -59,7 +59,7 @@ document load_module end define load_all_modules - set $this = grub_dl_head + set $this = VasEBoot_dl_head while ($this != 0) dump_module_sections $this set $this = $this->next @@ -77,7 +77,7 @@ file kernel.exec target remote :1234 # inform when module is loaded -break grub_dl_add +break VasEBoot_dl_add commands silent load_module mod diff --git a/VasEBoot-core/genemuinit.sh b/VasEBoot-core/genemuinit.sh index 8c6bb1c18..e2362a335 100644 --- a/VasEBoot-core/genemuinit.sh +++ b/VasEBoot-core/genemuinit.sh @@ -17,37 +17,37 @@ shift cat <. + * along with VasEBoot. If not, see . */ -#include "grub_emu_init.h" +#include "VasEBoot_emu_init.h" EOF cat < /dev/null; then - echo "grub_${line%%.*}_init ();" + if ${nm} --defined-only -P -p ${line} | grep VasEBoot_mod_init > /dev/null; then + echo "VasEBoot_${line%%.*}_init ();" fi done @@ -57,13 +57,13 @@ EOF cat < /dev/null; then - echo "grub_${line%%.*}_fini ();" + if ${nm} --defined-only -P -p ${line} | grep VasEBoot_mod_fini > /dev/null; then + echo "VasEBoot_${line%%.*}_fini ();" fi done diff --git a/VasEBoot-core/genemuinitheader.sh b/VasEBoot-core/genemuinitheader.sh index a99a15d06..ab2fa4dc3 100644 --- a/VasEBoot-core/genemuinitheader.sh +++ b/VasEBoot-core/genemuinitheader.sh @@ -17,36 +17,36 @@ shift cat <. + * along with VasEBoot. If not, see . */ EOF cat < /dev/null; then - echo "void grub_${line%%.*}_init (void);" + if ${nm} --defined-only -P -p ${line} | grep VasEBoot_mod_init > /dev/null; then + echo "void VasEBoot_${line%%.*}_init (void);" fi - if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then - echo "void grub_${line%%.*}_fini (void);" + if ${nm} --defined-only -P -p ${line} | grep VasEBoot_mod_fini > /dev/null; then + echo "void VasEBoot_${line%%.*}_fini (void);" fi done diff --git a/VasEBoot-core/genmod.sh.in b/VasEBoot-core/genmod.sh.in index 03cc3b7f6..6864e5910 100644 --- a/VasEBoot-core/genmod.sh.in +++ b/VasEBoot-core/genmod.sh.in @@ -15,7 +15,7 @@ set -e # # Example: # -# genmod.sh moddep.lst normal.module build-grub-module-verifier normal.mod +# genmod.sh moddep.lst normal.module build-VasEBoot-module-verifier normal.mod # moddep=$1 @@ -55,8 +55,8 @@ if test x@TARGET_APPLE_LINKER@ != x1; then if test x@platform@ != xemu; then @TARGET_STRIP@ --strip-unneeded \ - -K grub_mod_init -K grub_mod_fini \ - -K _grub_mod_init -K _grub_mod_fini \ + -K VasEBoot_mod_init -K VasEBoot_mod_fini \ + -K _VasEBoot_mod_init -K _VasEBoot_mod_fini \ -R .note.gnu.gold-version -R .note.GNU-stack \ -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 fi @@ -88,12 +88,12 @@ else cp $tmpfile $tmpfile.bin @TARGET_OBJCONV@ -f@TARGET_MODULE_FORMAT@ \ - -nr:_grub_mod_init:grub_mod_init \ - -nr:_grub_mod_fini:grub_mod_fini \ + -nr:_VasEBoot_mod_init:VasEBoot_mod_init \ + -nr:_VasEBoot_mod_fini:VasEBoot_mod_fini \ -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 rm -f $tmpfile.bin fi if test x@platform@ != xemu; then - ./build-grub-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@ @platform@ + ./build-VasEBoot-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@ @platform@ fi mv $tmpfile $outfile diff --git a/VasEBoot-core/gentrigtables.c b/VasEBoot-core/gentrigtables.c index fface6efc..f7f24c64f 100644 --- a/VasEBoot-core/gentrigtables.c +++ b/VasEBoot-core/gentrigtables.c @@ -1,25 +1,25 @@ /* Generate trigonometric function tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define _GNU_SOURCE 1 -#include +#include #include #include @@ -29,24 +29,24 @@ main (int argc __attribute__ ((unused)), { int i; - printf ("#include \n"); - printf ("#include \n"); + printf ("#include \n"); + printf ("#include \n"); printf ("\n"); printf ("/* Under copyright legislature such automated output isn't\n"); printf ("covered by any copyright. Hence it's public domain. Public\n"); printf ("domain works can be dual-licenced with any license. */\n"); - printf ("GRUB_MOD_LICENSE (\"GPLv3+\");"); - printf ("GRUB_MOD_DUAL_LICENSE (\"Public Domain\");"); + printf ("VasEBoot_MOD_LICENSE (\"GPLv3+\");"); + printf ("VasEBoot_MOD_DUAL_LICENSE (\"Public Domain\");"); #define TAB(op) \ - printf ("const grub_int16_t grub_trig_" #op "tab[] =\n{"); \ - for (i = 0; i < GRUB_TRIG_ANGLE_MAX; i++) \ + printf ("const VasEBoot_int16_t VasEBoot_trig_" #op "tab[] =\n{"); \ + for (i = 0; i < VasEBoot_TRIG_ANGLE_MAX; i++) \ { \ - double x = i * 2 * M_PI / GRUB_TRIG_ANGLE_MAX; \ + double x = i * 2 * M_PI / VasEBoot_TRIG_ANGLE_MAX; \ if (i % 10 == 0) \ printf ("\n "); \ - printf ("%d,", (int) (round (op (x) * GRUB_TRIG_FRACTION_SCALE))); \ + printf ("%d,", (int) (round (op (x) * VasEBoot_TRIG_FRACTION_SCALE))); \ } \ printf ("\n};\n") diff --git a/VasEBoot-core/gettext/gettext.c b/VasEBoot-core/gettext/gettext.c index 4880cefe3..529842064 100644 --- a/VasEBoot-core/gettext/gettext.c +++ b/VasEBoot-core/gettext/gettext.c @@ -1,42 +1,42 @@ /* gettext.c - gettext module */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* .mo file information from: http://www.gnu.org/software/autoconf/manual/gettext/MO-Files.html . */ -static const char *(*grub_gettext_original) (const char *s); +static const char *(*VasEBoot_gettext_original) (const char *s); -struct grub_gettext_msg +struct VasEBoot_gettext_msg { char *name; char *translated; @@ -44,79 +44,79 @@ struct grub_gettext_msg struct header { - grub_uint32_t magic; - grub_uint32_t version; - grub_uint32_t number_of_strings; - grub_uint32_t offset_original; - grub_uint32_t offset_translation; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t version; + VasEBoot_uint32_t number_of_strings; + VasEBoot_uint32_t offset_original; + VasEBoot_uint32_t offset_translation; }; struct string_descriptor { - grub_uint32_t length; - grub_uint32_t offset; + VasEBoot_uint32_t length; + VasEBoot_uint32_t offset; }; -struct grub_gettext_context +struct VasEBoot_gettext_context { - grub_file_t fd_mo; - grub_off_t grub_gettext_offset_original; - grub_off_t grub_gettext_offset_translation; - grub_size_t grub_gettext_max; - int grub_gettext_max_log; - struct grub_gettext_msg *grub_gettext_msg_list; + VasEBoot_file_t fd_mo; + VasEBoot_off_t VasEBoot_gettext_offset_original; + VasEBoot_off_t VasEBoot_gettext_offset_translation; + VasEBoot_size_t VasEBoot_gettext_max; + int VasEBoot_gettext_max_log; + struct VasEBoot_gettext_msg *VasEBoot_gettext_msg_list; }; -static struct grub_gettext_context main_context, secondary_context; +static struct VasEBoot_gettext_context main_context, secondary_context; #define MO_MAGIC_NUMBER 0x950412de -static grub_err_t -grub_gettext_pread (grub_file_t file, void *buf, grub_size_t len, - grub_off_t offset) +static VasEBoot_err_t +VasEBoot_gettext_pread (VasEBoot_file_t file, void *buf, VasEBoot_size_t len, + VasEBoot_off_t offset) { if (len == 0) - return GRUB_ERR_NONE; - if (grub_file_seek (file, offset) == (grub_off_t) - 1) - return grub_errno; - if (grub_file_read (file, buf, len) != (grub_ssize_t) len) + return VasEBoot_ERR_NONE; + if (VasEBoot_file_seek (file, offset) == (VasEBoot_off_t) - 1) + return VasEBoot_errno; + if (VasEBoot_file_read (file, buf, len) != (VasEBoot_ssize_t) len) { - if (!grub_errno) - grub_error (GRUB_ERR_READ_ERROR, N_("premature end of file")); - return grub_errno; + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("premature end of file")); + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static char * -grub_gettext_getstr_from_position (struct grub_gettext_context *ctx, - grub_off_t off, - grub_size_t position) +VasEBoot_gettext_getstr_from_position (struct VasEBoot_gettext_context *ctx, + VasEBoot_off_t off, + VasEBoot_size_t position) { - grub_off_t internal_position; - grub_size_t length; - grub_off_t offset; + VasEBoot_off_t internal_position; + VasEBoot_size_t length; + VasEBoot_off_t offset; char *translation; struct string_descriptor desc; - grub_err_t err; + VasEBoot_err_t err; internal_position = (off + position * sizeof (desc)); - err = grub_gettext_pread (ctx->fd_mo, (char *) &desc, + err = VasEBoot_gettext_pread (ctx->fd_mo, (char *) &desc, sizeof (desc), internal_position); if (err) return NULL; - length = grub_cpu_to_le32 (desc.length); - offset = grub_cpu_to_le32 (desc.offset); + length = VasEBoot_cpu_to_le32 (desc.length); + offset = VasEBoot_cpu_to_le32 (desc.offset); - translation = grub_malloc (length + 1); + translation = VasEBoot_malloc (length + 1); if (!translation) return NULL; - err = grub_gettext_pread (ctx->fd_mo, translation, length, offset); + err = VasEBoot_gettext_pread (ctx->fd_mo, translation, length, offset); if (err) { - grub_free (translation); + VasEBoot_free (translation); return NULL; } translation[length] = '\0'; @@ -125,39 +125,39 @@ grub_gettext_getstr_from_position (struct grub_gettext_context *ctx, } static const char * -grub_gettext_gettranslation_from_position (struct grub_gettext_context *ctx, - grub_size_t position) +VasEBoot_gettext_gettranslation_from_position (struct VasEBoot_gettext_context *ctx, + VasEBoot_size_t position) { - if (!ctx->grub_gettext_msg_list[position].translated) - ctx->grub_gettext_msg_list[position].translated - = grub_gettext_getstr_from_position (ctx, - ctx->grub_gettext_offset_translation, + if (!ctx->VasEBoot_gettext_msg_list[position].translated) + ctx->VasEBoot_gettext_msg_list[position].translated + = VasEBoot_gettext_getstr_from_position (ctx, + ctx->VasEBoot_gettext_offset_translation, position); - return ctx->grub_gettext_msg_list[position].translated; + return ctx->VasEBoot_gettext_msg_list[position].translated; } static const char * -grub_gettext_getstring_from_position (struct grub_gettext_context *ctx, - grub_size_t position) +VasEBoot_gettext_getstring_from_position (struct VasEBoot_gettext_context *ctx, + VasEBoot_size_t position) { - if (!ctx->grub_gettext_msg_list[position].name) - ctx->grub_gettext_msg_list[position].name - = grub_gettext_getstr_from_position (ctx, - ctx->grub_gettext_offset_original, + if (!ctx->VasEBoot_gettext_msg_list[position].name) + ctx->VasEBoot_gettext_msg_list[position].name + = VasEBoot_gettext_getstr_from_position (ctx, + ctx->VasEBoot_gettext_offset_original, position); - return ctx->grub_gettext_msg_list[position].name; + return ctx->VasEBoot_gettext_msg_list[position].name; } static const char * -grub_gettext_translate_real (struct grub_gettext_context *ctx, +VasEBoot_gettext_translate_real (struct VasEBoot_gettext_context *ctx, const char *orig) { - grub_size_t current = 0; + VasEBoot_size_t current = 0; int i; const char *current_string; static int depth = 0; - if (!ctx->grub_gettext_msg_list || !ctx->fd_mo) + if (!ctx->VasEBoot_gettext_msg_list || !ctx->fd_mo) return NULL; /* Shouldn't happen. Just a precaution if our own code @@ -166,231 +166,231 @@ grub_gettext_translate_real (struct grub_gettext_context *ctx, return NULL; depth++; - /* Make sure we can use grub_gettext_translate for error messages. Push + /* Make sure we can use VasEBoot_gettext_translate for error messages. Push active error message to error stack and reset error message. */ - grub_error_push (); + VasEBoot_error_push (); - for (i = ctx->grub_gettext_max_log; i >= 0; i--) + for (i = ctx->VasEBoot_gettext_max_log; i >= 0; i--) { - grub_size_t test; + VasEBoot_size_t test; int cmp; test = current | (1 << i); - if (test >= ctx->grub_gettext_max) + if (test >= ctx->VasEBoot_gettext_max) continue; - current_string = grub_gettext_getstring_from_position (ctx, test); + current_string = VasEBoot_gettext_getstring_from_position (ctx, test); if (!current_string) { - grub_errno = GRUB_ERR_NONE; - grub_error_pop (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_error_pop (); depth--; return NULL; } /* Search by bisection. */ - cmp = grub_strcmp (current_string, orig); + cmp = VasEBoot_strcmp (current_string, orig); if (cmp <= 0) current = test; if (cmp == 0) { const char *ret = 0; - ret = grub_gettext_gettranslation_from_position (ctx, current); + ret = VasEBoot_gettext_gettranslation_from_position (ctx, current); if (!ret) { - grub_errno = GRUB_ERR_NONE; - grub_error_pop (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_error_pop (); depth--; return NULL; } - grub_error_pop (); + VasEBoot_error_pop (); depth--; return ret; } } - if (current == 0 && ctx->grub_gettext_max != 0) + if (current == 0 && ctx->VasEBoot_gettext_max != 0) { - current_string = grub_gettext_getstring_from_position (ctx, 0); + current_string = VasEBoot_gettext_getstring_from_position (ctx, 0); if (!current_string) { - grub_errno = GRUB_ERR_NONE; - grub_error_pop (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_error_pop (); depth--; return NULL; } - if (grub_strcmp (current_string, orig) == 0) + if (VasEBoot_strcmp (current_string, orig) == 0) { const char *ret = 0; - ret = grub_gettext_gettranslation_from_position (ctx, current); + ret = VasEBoot_gettext_gettranslation_from_position (ctx, current); if (!ret) { - grub_errno = GRUB_ERR_NONE; - grub_error_pop (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_error_pop (); depth--; return NULL; } - grub_error_pop (); + VasEBoot_error_pop (); depth--; return ret; } } - grub_error_pop (); + VasEBoot_error_pop (); depth--; return NULL; } static const char * -grub_gettext_translate (const char *orig) +VasEBoot_gettext_translate (const char *orig) { const char *ret; if (orig[0] == 0) return orig; - ret = grub_gettext_translate_real (&main_context, orig); + ret = VasEBoot_gettext_translate_real (&main_context, orig); if (ret) return ret; - ret = grub_gettext_translate_real (&secondary_context, orig); + ret = VasEBoot_gettext_translate_real (&secondary_context, orig); if (ret) return ret; return orig; } static void -grub_gettext_delete_list (struct grub_gettext_context *ctx) +VasEBoot_gettext_delete_list (struct VasEBoot_gettext_context *ctx) { - struct grub_gettext_msg *l = ctx->grub_gettext_msg_list; - grub_size_t i; + struct VasEBoot_gettext_msg *l = ctx->VasEBoot_gettext_msg_list; + VasEBoot_size_t i; if (!l) return; - ctx->grub_gettext_msg_list = 0; - for (i = 0; i < ctx->grub_gettext_max; i++) - grub_free (l[i].name); + ctx->VasEBoot_gettext_msg_list = 0; + for (i = 0; i < ctx->VasEBoot_gettext_max; i++) + VasEBoot_free (l[i].name); /* Don't delete the translated message because could be in use. */ - grub_free (l); + VasEBoot_free (l); if (ctx->fd_mo) - grub_file_close (ctx->fd_mo); + VasEBoot_file_close (ctx->fd_mo); ctx->fd_mo = 0; - grub_memset (ctx, 0, sizeof (*ctx)); + VasEBoot_memset (ctx, 0, sizeof (*ctx)); } -/* This is similar to grub_file_open. */ -static grub_err_t -grub_mofile_open (struct grub_gettext_context *ctx, +/* This is similar to VasEBoot_file_open. */ +static VasEBoot_err_t +VasEBoot_mofile_open (struct VasEBoot_gettext_context *ctx, const char *filename) { struct header head; - grub_err_t err; - grub_file_t fd; + VasEBoot_err_t err; + VasEBoot_file_t fd; /* Using fd_mo and not another variable because - it's needed for grub_gettext_get_info. */ + it's needed for VasEBoot_gettext_get_info. */ - fd = grub_file_open (filename); + fd = VasEBoot_file_open (filename); if (!fd) - return grub_errno; + return VasEBoot_errno; - err = grub_gettext_pread (fd, &head, sizeof (head), 0); + err = VasEBoot_gettext_pread (fd, &head, sizeof (head), 0); if (err) { - grub_file_close (fd); + VasEBoot_file_close (fd); return err; } - if (head.magic != grub_cpu_to_le32_compile_time (MO_MAGIC_NUMBER)) + if (head.magic != VasEBoot_cpu_to_le32_compile_time (MO_MAGIC_NUMBER)) { - grub_file_close (fd); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_file_close (fd); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "mo: invalid mo magic in file: %s", filename); } if (head.version != 0) { - grub_file_close (fd); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_file_close (fd); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "mo: invalid mo version in file: %s", filename); } - ctx->grub_gettext_offset_original = grub_le_to_cpu32 (head.offset_original); - ctx->grub_gettext_offset_translation = grub_le_to_cpu32 (head.offset_translation); - ctx->grub_gettext_max = grub_le_to_cpu32 (head.number_of_strings); - for (ctx->grub_gettext_max_log = 0; ctx->grub_gettext_max >> ctx->grub_gettext_max_log; - ctx->grub_gettext_max_log++); + ctx->VasEBoot_gettext_offset_original = VasEBoot_le_to_cpu32 (head.offset_original); + ctx->VasEBoot_gettext_offset_translation = VasEBoot_le_to_cpu32 (head.offset_translation); + ctx->VasEBoot_gettext_max = VasEBoot_le_to_cpu32 (head.number_of_strings); + for (ctx->VasEBoot_gettext_max_log = 0; ctx->VasEBoot_gettext_max >> ctx->VasEBoot_gettext_max_log; + ctx->VasEBoot_gettext_max_log++); - ctx->grub_gettext_msg_list = grub_zalloc (ctx->grub_gettext_max - * sizeof (ctx->grub_gettext_msg_list[0])); - if (!ctx->grub_gettext_msg_list) + ctx->VasEBoot_gettext_msg_list = VasEBoot_zalloc (ctx->VasEBoot_gettext_max + * sizeof (ctx->VasEBoot_gettext_msg_list[0])); + if (!ctx->VasEBoot_gettext_msg_list) { - grub_file_close (fd); - return grub_errno; + VasEBoot_file_close (fd); + return VasEBoot_errno; } ctx->fd_mo = fd; - if (grub_gettext != grub_gettext_translate) + if (VasEBoot_gettext != VasEBoot_gettext_translate) { - grub_gettext_original = grub_gettext; - grub_gettext = grub_gettext_translate; + VasEBoot_gettext_original = VasEBoot_gettext; + VasEBoot_gettext = VasEBoot_gettext_translate; } return 0; } -/* Returning grub_file_t would be more natural, but grub_mofile_open assigns +/* Returning VasEBoot_file_t would be more natural, but VasEBoot_mofile_open assigns to fd_mo anyway ... */ -static grub_err_t -grub_mofile_open_lang (struct grub_gettext_context *ctx, +static VasEBoot_err_t +VasEBoot_mofile_open_lang (struct VasEBoot_gettext_context *ctx, const char *part1, const char *part2, const char *locale) { char *mo_file; - grub_err_t err; + VasEBoot_err_t err; - /* mo_file e.g.: /boot/grub/locale/ca.mo */ + /* mo_file e.g.: /boot/VasEBoot/locale/ca.mo */ - mo_file = grub_xasprintf ("%s%s/%s.mo", part1, part2, locale); + mo_file = VasEBoot_xasprintf ("%s%s/%s.mo", part1, part2, locale); if (!mo_file) - return grub_errno; + return VasEBoot_errno; - err = grub_mofile_open (ctx, mo_file); - grub_free (mo_file); + err = VasEBoot_mofile_open (ctx, mo_file); + VasEBoot_free (mo_file); /* Will try adding .gz as well. */ if (err) { - grub_errno = GRUB_ERR_NONE; - mo_file = grub_xasprintf ("%s%s/%s.mo.gz", part1, part2, locale); + VasEBoot_errno = VasEBoot_ERR_NONE; + mo_file = VasEBoot_xasprintf ("%s%s/%s.mo.gz", part1, part2, locale); if (!mo_file) - return grub_errno; - err = grub_mofile_open (ctx, mo_file); - grub_free (mo_file); + return VasEBoot_errno; + err = VasEBoot_mofile_open (ctx, mo_file); + VasEBoot_free (mo_file); } /* Will try adding .gmo as well. */ if (err) { - grub_errno = GRUB_ERR_NONE; - mo_file = grub_xasprintf ("%s%s/%s.gmo", part1, part2, locale); + VasEBoot_errno = VasEBoot_ERR_NONE; + mo_file = VasEBoot_xasprintf ("%s%s/%s.gmo", part1, part2, locale); if (!mo_file) - return grub_errno; - err = grub_mofile_open (ctx, mo_file); - grub_free (mo_file); + return VasEBoot_errno; + err = VasEBoot_mofile_open (ctx, mo_file); + VasEBoot_free (mo_file); } return err; } -static grub_err_t -grub_gettext_init_ext (struct grub_gettext_context *ctx, +static VasEBoot_err_t +VasEBoot_gettext_init_ext (struct VasEBoot_gettext_context *ctx, const char *locale, const char *locale_dir, const char *prefix) { const char *part1, *part2; - grub_err_t err; + VasEBoot_err_t err; - grub_gettext_delete_list (ctx); + VasEBoot_gettext_delete_list (ctx); if (!locale || locale[0] == 0) return 0; @@ -406,117 +406,117 @@ grub_gettext_init_ext (struct grub_gettext_context *ctx, if (!part1 || part1[0] == 0) return 0; - err = grub_mofile_open_lang (ctx, part1, part2, locale); + err = VasEBoot_mofile_open_lang (ctx, part1, part2, locale); /* ll_CC didn't work, so try ll. */ if (err) { - char *lang = grub_strdup (locale); - char *underscore = lang ? grub_strchr (lang, '_') : 0; + char *lang = VasEBoot_strdup (locale); + char *underscore = lang ? VasEBoot_strchr (lang, '_') : 0; if (underscore) { *underscore = '\0'; - grub_errno = GRUB_ERR_NONE; - err = grub_mofile_open_lang (ctx, part1, part2, lang); + VasEBoot_errno = VasEBoot_ERR_NONE; + err = VasEBoot_mofile_open_lang (ctx, part1, part2, lang); } - grub_free (lang); + VasEBoot_free (lang); } if (locale[0] == 'e' && locale[1] == 'n' && (locale[2] == '\0' || locale[2] == '_')) - grub_errno = err = GRUB_ERR_NONE; + VasEBoot_errno = err = VasEBoot_ERR_NONE; return err; } static char * -grub_gettext_env_write_lang (struct grub_env_var *var +VasEBoot_gettext_env_write_lang (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - grub_err_t err; - err = grub_gettext_init_ext (&main_context, val, grub_env_get ("locale_dir"), - grub_env_get ("prefix")); + VasEBoot_err_t err; + err = VasEBoot_gettext_init_ext (&main_context, val, VasEBoot_env_get ("locale_dir"), + VasEBoot_env_get ("prefix")); if (err) - grub_print_error (); + VasEBoot_print_error (); - err = grub_gettext_init_ext (&secondary_context, val, - grub_env_get ("secondary_locale_dir"), 0); + err = VasEBoot_gettext_init_ext (&secondary_context, val, + VasEBoot_env_get ("secondary_locale_dir"), 0); if (err) - grub_print_error (); + VasEBoot_print_error (); - return grub_strdup (val); + return VasEBoot_strdup (val); } void -grub_gettext_reread_prefix (const char *val) +VasEBoot_gettext_reread_prefix (const char *val) { - grub_err_t err; - err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), - grub_env_get ("locale_dir"), + VasEBoot_err_t err; + err = VasEBoot_gettext_init_ext (&main_context, VasEBoot_env_get ("lang"), + VasEBoot_env_get ("locale_dir"), val); if (err) - grub_print_error (); + VasEBoot_print_error (); } static char * -read_main (struct grub_env_var *var +read_main (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - grub_err_t err; - err = grub_gettext_init_ext (&main_context, grub_env_get ("lang"), val, - grub_env_get ("prefix")); + VasEBoot_err_t err; + err = VasEBoot_gettext_init_ext (&main_context, VasEBoot_env_get ("lang"), val, + VasEBoot_env_get ("prefix")); if (err) - grub_print_error (); - return grub_strdup (val); + VasEBoot_print_error (); + return VasEBoot_strdup (val); } static char * -read_secondary (struct grub_env_var *var +read_secondary (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - grub_err_t err; - err = grub_gettext_init_ext (&secondary_context, grub_env_get ("lang"), val, + VasEBoot_err_t err; + err = VasEBoot_gettext_init_ext (&secondary_context, VasEBoot_env_get ("lang"), val, 0); if (err) - grub_print_error (); + VasEBoot_print_error (); - return grub_strdup (val); + return VasEBoot_strdup (val); } -static grub_err_t -grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_translate (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); const char *translation; - translation = grub_gettext_translate (args[0]); - grub_printf ("%s\n", translation); + translation = VasEBoot_gettext_translate (args[0]); + VasEBoot_printf ("%s\n", translation); return 0; } -GRUB_MOD_INIT (gettext) +VasEBoot_MOD_INIT (gettext) { const char *lang; - grub_err_t err; + VasEBoot_err_t err; - lang = grub_env_get ("lang"); + lang = VasEBoot_env_get ("lang"); - err = grub_gettext_init_ext (&main_context, lang, grub_env_get ("locale_dir"), - grub_env_get ("prefix")); + err = VasEBoot_gettext_init_ext (&main_context, lang, VasEBoot_env_get ("locale_dir"), + VasEBoot_env_get ("prefix")); if (err) - grub_print_error (); - err = grub_gettext_init_ext (&secondary_context, lang, - grub_env_get ("secondary_locale_dir"), 0); + VasEBoot_print_error (); + err = VasEBoot_gettext_init_ext (&secondary_context, lang, + VasEBoot_env_get ("secondary_locale_dir"), 0); if (err) - grub_print_error (); + VasEBoot_print_error (); - grub_register_variable_hook ("locale_dir", NULL, read_main); - grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary); + VasEBoot_register_variable_hook ("locale_dir", NULL, read_main); + VasEBoot_register_variable_hook ("secondary_locale_dir", NULL, read_secondary); - grub_register_command_p1 ("gettext", grub_cmd_translate, + VasEBoot_register_command_p1 ("gettext", VasEBoot_cmd_translate, N_("STRING"), /* TRANSLATORS: It refers to passing the string through gettext. So it's "translate" in the same meaning as in what you're @@ -525,18 +525,18 @@ GRUB_MOD_INIT (gettext) N_("Translates the string with the current settings.")); /* Reload .mo file information if lang changes. */ - grub_register_variable_hook ("lang", NULL, grub_gettext_env_write_lang); + VasEBoot_register_variable_hook ("lang", NULL, VasEBoot_gettext_env_write_lang); /* Preserve hooks after context changes. */ - grub_env_export ("lang"); - grub_env_export ("locale_dir"); - grub_env_export ("secondary_locale_dir"); + VasEBoot_env_export ("lang"); + VasEBoot_env_export ("locale_dir"); + VasEBoot_env_export ("secondary_locale_dir"); } -GRUB_MOD_FINI (gettext) +VasEBoot_MOD_FINI (gettext) { - grub_gettext_delete_list (&main_context); - grub_gettext_delete_list (&secondary_context); + VasEBoot_gettext_delete_list (&main_context); + VasEBoot_gettext_delete_list (&secondary_context); - grub_gettext = grub_gettext_original; + VasEBoot_gettext = VasEBoot_gettext_original; } diff --git a/VasEBoot-core/gfxmenu/font.c b/VasEBoot-core/gfxmenu/font.c index 756c24f20..815fd2bdd 100644 --- a/VasEBoot-core/gfxmenu/font.c +++ b/VasEBoot-core/gfxmenu/font.c @@ -1,73 +1,73 @@ /* font.c - Font API and font file loader. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Draw a UTF-8 string of text on the current video render target. The x coordinate specifies the starting x position for the first character, while the y coordinate specifies the baseline position. If the string contains a character that FONT does not contain, then a glyph from another loaded font may be used instead. */ -grub_err_t -grub_font_draw_string (const char *str, grub_font_t font, - grub_video_color_t color, +VasEBoot_err_t +VasEBoot_font_draw_string (const char *str, VasEBoot_font_t font, + VasEBoot_video_color_t color, int left_x, int baseline_y) { int x; - grub_uint32_t *logical; - grub_ssize_t logical_len, visual_len; - struct grub_unicode_glyph *visual, *ptr; - grub_err_t err; + VasEBoot_uint32_t *logical; + VasEBoot_ssize_t logical_len, visual_len; + struct VasEBoot_unicode_glyph *visual, *ptr; + VasEBoot_err_t err; - logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0); + logical_len = VasEBoot_utf8_to_ucs4_alloc (str, &logical, 0); if (logical_len < 0) - return grub_errno; + return VasEBoot_errno; - visual_len = grub_bidi_logical_to_visual (logical, logical_len, &visual, + visual_len = VasEBoot_bidi_logical_to_visual (logical, logical_len, &visual, 0, 0, 0, 0, 0, 0, 0); - grub_free (logical); + VasEBoot_free (logical); if (visual_len < 0) - return grub_errno; + return VasEBoot_errno; - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; for (ptr = visual, x = left_x; ptr < visual + visual_len; ptr++) { - struct grub_font_glyph *glyph; - glyph = grub_font_construct_glyph (font, ptr); + struct VasEBoot_font_glyph *glyph; + glyph = VasEBoot_font_construct_glyph (font, ptr); if (!glyph) { - err = grub_errno; + err = VasEBoot_errno; goto out; } - err = grub_font_draw_glyph (glyph, color, x, baseline_y); + err = VasEBoot_font_draw_glyph (glyph, color, x, baseline_y); if (err) goto out; x += glyph->device_width; @@ -75,8 +75,8 @@ grub_font_draw_string (const char *str, grub_font_t font, out: for (ptr = visual; ptr < visual + visual_len; ptr++) - grub_unicode_destroy_glyph (ptr); - grub_free (visual); + VasEBoot_unicode_destroy_glyph (ptr); + VasEBoot_free (visual); return err; } @@ -85,32 +85,32 @@ out: in the specified font (but falling back on other fonts for glyphs that are missing). */ int -grub_font_get_string_width (grub_font_t font, const char *str) +VasEBoot_font_get_string_width (VasEBoot_font_t font, const char *str) { int width = 0; - grub_uint32_t *ptr; - grub_ssize_t logical_len; - grub_uint32_t *logical; + VasEBoot_uint32_t *ptr; + VasEBoot_ssize_t logical_len; + VasEBoot_uint32_t *logical; - logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0); + logical_len = VasEBoot_utf8_to_ucs4_alloc (str, &logical, 0); if (logical_len < 0) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } for (ptr = logical; ptr < logical + logical_len;) { - struct grub_unicode_glyph glyph; + struct VasEBoot_unicode_glyph glyph; - ptr += grub_unicode_aglomerate_comb (ptr, + ptr += VasEBoot_unicode_aglomerate_comb (ptr, logical_len - (ptr - logical), &glyph); - width += grub_font_get_constructed_device_width (font, &glyph); + width += VasEBoot_font_get_constructed_device_width (font, &glyph); - grub_unicode_destroy_glyph (&glyph); + VasEBoot_unicode_destroy_glyph (&glyph); } - grub_free (logical); + VasEBoot_free (logical); return width; } diff --git a/VasEBoot-core/gfxmenu/gfxmenu.c b/VasEBoot-core/gfxmenu/gfxmenu.c index 8a17dda2c..deae4b971 100644 --- a/VasEBoot-core/gfxmenu/gfxmenu.c +++ b/VasEBoot-core/gfxmenu/gfxmenu.c @@ -1,150 +1,150 @@ /* gfxmenu.c - Graphical menu interface controller. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_gfxmenu_view_t cached_view; +static VasEBoot_gfxmenu_view_t cached_view; static void -grub_gfxmenu_viewer_fini (void *data __attribute__ ((unused))) +VasEBoot_gfxmenu_viewer_fini (void *data __attribute__ ((unused))) { } /* FIXME: Previously 't' changed to text menu is it necessary? */ -static grub_err_t -grub_gfxmenu_try (int entry, grub_menu_t menu, int nested) +static VasEBoot_err_t +VasEBoot_gfxmenu_try (int entry, VasEBoot_menu_t menu, int nested) { - grub_gfxmenu_view_t view = NULL; + VasEBoot_gfxmenu_view_t view = NULL; const char *theme_path; char *full_theme_path = 0; - struct grub_menu_viewer *instance; - grub_err_t err; - struct grub_video_mode_info mode_info; + struct VasEBoot_menu_viewer *instance; + VasEBoot_err_t err; + struct VasEBoot_video_mode_info mode_info; - theme_path = grub_env_get ("theme"); + theme_path = VasEBoot_env_get ("theme"); if (! theme_path) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "theme"); - err = grub_video_get_info (&mode_info); + err = VasEBoot_video_get_info (&mode_info); if (err) return err; - instance = grub_zalloc (sizeof (*instance)); + instance = VasEBoot_zalloc (sizeof (*instance)); if (!instance) - return grub_errno; + return VasEBoot_errno; if (theme_path[0] != '/' && theme_path[0] != '(') { const char *prefix; - prefix = grub_env_get ("prefix"); - full_theme_path = grub_xasprintf ("%s/themes/%s", + prefix = VasEBoot_env_get ("prefix"); + full_theme_path = VasEBoot_xasprintf ("%s/themes/%s", prefix, theme_path); } - if (!cached_view || grub_strcmp (cached_view->theme_path, + if (!cached_view || VasEBoot_strcmp (cached_view->theme_path, full_theme_path ? : theme_path) != 0 || cached_view->screen.width != mode_info.width || cached_view->screen.height != mode_info.height) { - grub_gfxmenu_view_destroy (cached_view); + VasEBoot_gfxmenu_view_destroy (cached_view); /* Create the view. */ - cached_view = grub_gfxmenu_view_new (full_theme_path ? : theme_path, + cached_view = VasEBoot_gfxmenu_view_new (full_theme_path ? : theme_path, mode_info.width, mode_info.height); } - grub_free (full_theme_path); + VasEBoot_free (full_theme_path); if (! cached_view) { - grub_free (instance); - return grub_errno; + VasEBoot_free (instance); + return VasEBoot_errno; } view = cached_view; view->double_repaint = (mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED) - && !(mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED) + && !(mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); view->selected = entry; view->menu = menu; view->nested = nested; view->first_timeout = -1; - grub_video_set_viewport (0, 0, mode_info.width, mode_info.height); + VasEBoot_video_set_viewport (0, 0, mode_info.width, mode_info.height); if (view->double_repaint) { - grub_video_swap_buffers (); - grub_video_set_viewport (0, 0, mode_info.width, mode_info.height); + VasEBoot_video_swap_buffers (); + VasEBoot_video_set_viewport (0, 0, mode_info.width, mode_info.height); } - grub_gfxmenu_view_draw (view); + VasEBoot_gfxmenu_view_draw (view); instance->data = view; - instance->set_chosen_entry = grub_gfxmenu_set_chosen_entry; - instance->fini = grub_gfxmenu_viewer_fini; - instance->print_timeout = grub_gfxmenu_print_timeout; - instance->clear_timeout = grub_gfxmenu_clear_timeout; + instance->set_chosen_entry = VasEBoot_gfxmenu_set_chosen_entry; + instance->fini = VasEBoot_gfxmenu_viewer_fini; + instance->print_timeout = VasEBoot_gfxmenu_print_timeout; + instance->clear_timeout = VasEBoot_gfxmenu_clear_timeout; - grub_menu_register_viewer (instance); + VasEBoot_menu_register_viewer (instance); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -GRUB_MOD_INIT (gfxmenu) +VasEBoot_MOD_INIT (gfxmenu) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; FOR_ACTIVE_TERM_OUTPUTS(term) - if (grub_gfxmenu_try_hook && term->fullscreen) + if (VasEBoot_gfxmenu_try_hook && term->fullscreen) { term->fullscreen (); break; } - grub_gfxmenu_try_hook = grub_gfxmenu_try; + VasEBoot_gfxmenu_try_hook = VasEBoot_gfxmenu_try; } -GRUB_MOD_FINI (gfxmenu) +VasEBoot_MOD_FINI (gfxmenu) { - grub_gfxmenu_view_destroy (cached_view); - grub_gfxmenu_try_hook = NULL; + VasEBoot_gfxmenu_view_destroy (cached_view); + VasEBoot_gfxmenu_try_hook = NULL; } diff --git a/VasEBoot-core/gfxmenu/gui_box.c b/VasEBoot-core/gfxmenu/gui_box.c index 37bab3fbb..172875001 100644 --- a/VasEBoot-core/gfxmenu/gui_box.c +++ b/VasEBoot-core/gfxmenu/gui_box.c @@ -1,46 +1,46 @@ /* gui_box.c - GUI container that stack components. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include struct component_node { - grub_gui_component_t component; + VasEBoot_gui_component_t component; struct component_node *next; struct component_node *prev; }; -typedef struct grub_gui_box *grub_gui_box_t; +typedef struct VasEBoot_gui_box *VasEBoot_gui_box_t; -typedef void (*layout_func_t) (grub_gui_box_t self, int modify_layout, +typedef void (*layout_func_t) (VasEBoot_gui_box_t self, int modify_layout, unsigned *minimal_width, unsigned *minimal_height); -struct grub_gui_box +struct VasEBoot_gui_box { - struct grub_gui_container container; + struct VasEBoot_gui_container container; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; /* Doubly linked list of components with dummy head & tail nodes. */ @@ -54,7 +54,7 @@ struct grub_gui_box static void box_destroy (void *vself) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; struct component_node *cur; struct component_node *next; for (cur = self->chead.next; cur != &self->ctail; cur = next) @@ -65,27 +65,27 @@ box_destroy (void *vself) /* Destroy the child component. */ cur->component->ops->destroy (cur->component); /* Free the linked list node. */ - grub_free (cur); + VasEBoot_free (cur); } - grub_free (self); + VasEBoot_free (self); } static const char * box_get_id (void *vself) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; return self->id; } static int box_is_instance (void *vself __attribute__((unused)), const char *type) { - return (grub_strcmp (type, "component") == 0 - || grub_strcmp (type, "container") == 0); + return (VasEBoot_strcmp (type, "component") == 0 + || VasEBoot_strcmp (type, "container") == 0); } static void -layout_horizontally (grub_gui_box_t self, int modify_layout, +layout_horizontally (VasEBoot_gui_box_t self, int modify_layout, unsigned *min_width, unsigned *min_height) { /* Start at the left (chead) and set the x coordinates as we go right. */ @@ -93,12 +93,12 @@ layout_horizontally (grub_gui_box_t self, int modify_layout, struct component_node *cur; unsigned w = 0, mwfrac = 0, h = 0, x = 0; - grub_fixed_signed_t wfrac = 0; + VasEBoot_fixed_signed_t wfrac = 0; int bogus_frac = 0; for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) { - grub_gui_component_t c = cur->component; + VasEBoot_gui_component_t c = cur->component; unsigned mw = 0, mh = 0; if (c->ops->get_minimal_size) @@ -113,13 +113,13 @@ layout_horizontally (grub_gui_box_t self, int modify_layout, if (mw - c->w > 0) mwfrac += mw - c->w; } - if (wfrac > GRUB_FIXED_1 || (w > 0 && wfrac == GRUB_FIXED_1)) + if (wfrac > VasEBoot_FIXED_1 || (w > 0 && wfrac == VasEBoot_FIXED_1)) bogus_frac = 1; if (min_width) { - if (wfrac < GRUB_FIXED_1) - *min_width = grub_fixed_sfs_divide (w, GRUB_FIXED_1 - wfrac); + if (wfrac < VasEBoot_FIXED_1) + *min_width = VasEBoot_fixed_sfs_divide (w, VasEBoot_FIXED_1 - wfrac); else *min_width = w; if (*min_width < w + mwfrac) @@ -133,8 +133,8 @@ layout_horizontally (grub_gui_box_t self, int modify_layout, for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) { - grub_video_rect_t r; - grub_gui_component_t c = cur->component; + VasEBoot_video_rect_t r; + VasEBoot_gui_component_t c = cur->component; unsigned mw = 0, mh = 0; r.x = x; @@ -146,7 +146,7 @@ layout_horizontally (grub_gui_box_t self, int modify_layout, r.width = c->w; if (!bogus_frac) - r.width += grub_fixed_sfs_multiply (self->bounds.width, c->wfrac); + r.width += VasEBoot_fixed_sfs_multiply (self->bounds.width, c->wfrac); if (r.width < mw) r.width = mw; @@ -158,7 +158,7 @@ layout_horizontally (grub_gui_box_t self, int modify_layout, } static void -layout_vertically (grub_gui_box_t self, int modify_layout, +layout_vertically (VasEBoot_gui_box_t self, int modify_layout, unsigned *min_width, unsigned *min_height) { /* Start at the top (chead) and set the y coordinates as we go rdown. */ @@ -166,12 +166,12 @@ layout_vertically (grub_gui_box_t self, int modify_layout, struct component_node *cur; unsigned h = 0, mhfrac = 0, w = 0, y = 0; - grub_fixed_signed_t hfrac = 0; + VasEBoot_fixed_signed_t hfrac = 0; int bogus_frac = 0; for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) { - grub_gui_component_t c = cur->component; + VasEBoot_gui_component_t c = cur->component; unsigned mw = 0, mh = 0; if (c->ops->get_minimal_size) @@ -186,13 +186,13 @@ layout_vertically (grub_gui_box_t self, int modify_layout, if (mh - c->h > 0) mhfrac += mh - c->h; } - if (hfrac > GRUB_FIXED_1 || (h > 0 && hfrac == GRUB_FIXED_1)) + if (hfrac > VasEBoot_FIXED_1 || (h > 0 && hfrac == VasEBoot_FIXED_1)) bogus_frac = 1; if (min_height) { - if (hfrac < GRUB_FIXED_1) - *min_height = grub_fixed_sfs_divide (h, GRUB_FIXED_1 - hfrac); + if (hfrac < VasEBoot_FIXED_1) + *min_height = VasEBoot_fixed_sfs_divide (h, VasEBoot_FIXED_1 - hfrac); else *min_height = h; if (*min_height < h + mhfrac) @@ -206,8 +206,8 @@ layout_vertically (grub_gui_box_t self, int modify_layout, for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) { - grub_video_rect_t r; - grub_gui_component_t c = cur->component; + VasEBoot_video_rect_t r; + VasEBoot_gui_component_t c = cur->component; unsigned mw = 0, mh = 0; r.x = 0; @@ -219,7 +219,7 @@ layout_vertically (grub_gui_box_t self, int modify_layout, r.height = c->h; if (!bogus_frac) - r.height += grub_fixed_sfs_multiply (self->bounds.height, c->hfrac); + r.height += VasEBoot_fixed_sfs_multiply (self->bounds.height, c->hfrac); if (r.height < mh) r.height = mh; @@ -231,63 +231,63 @@ layout_vertically (grub_gui_box_t self, int modify_layout, } static void -box_paint (void *vself, const grub_video_rect_t *region) +box_paint (void *vself, const VasEBoot_video_rect_t *region) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; struct component_node *cur; - grub_video_rect_t vpsave; + VasEBoot_video_rect_t vpsave; - grub_video_area_status_t box_area_status; - grub_video_get_area_status (&box_area_status); + VasEBoot_video_area_status_t box_area_status; + VasEBoot_video_get_area_status (&box_area_status); - grub_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) { - grub_gui_component_t comp = cur->component; - grub_video_rect_t r; + VasEBoot_gui_component_t comp = cur->component; + VasEBoot_video_rect_t r; comp->ops->get_bounds(comp, &r); - if (!grub_video_have_common_points (region, &r)) + if (!VasEBoot_video_have_common_points (region, &r)) continue; /* Paint the child. */ - if (box_area_status == GRUB_VIDEO_AREA_ENABLED - && grub_video_bounds_inside_region (&r, region)) - grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED); + if (box_area_status == VasEBoot_VIDEO_AREA_ENABLED + && VasEBoot_video_bounds_inside_region (&r, region)) + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_DISABLED); comp->ops->paint (comp, region); - if (box_area_status == GRUB_VIDEO_AREA_ENABLED) - grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED); + if (box_area_status == VasEBoot_VIDEO_AREA_ENABLED) + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_ENABLED); } - grub_gui_restore_viewport (&vpsave); + VasEBoot_gui_restore_viewport (&vpsave); } static void -box_set_parent (void *vself, grub_gui_container_t parent) +box_set_parent (void *vself, VasEBoot_gui_container_t parent) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t box_get_parent (void *vself) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; return self->parent; } static void -box_set_bounds (void *vself, const grub_video_rect_t *bounds) +box_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; self->bounds = *bounds; self->layout_func (self, 1, 0, 0); /* Relayout the children. */ } static void -box_get_bounds (void *vself, grub_video_rect_t *bounds) +box_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; *bounds = self->bounds; } @@ -296,36 +296,36 @@ box_get_bounds (void *vself, grub_video_rect_t *bounds) static void box_get_minimal_size (void *vself, unsigned *width, unsigned *height) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; self->layout_func (self, 0, width, height); /* Just calculate the size. */ } -static grub_err_t +static VasEBoot_err_t box_set_property (void *vself, const char *name, const char *value) { - grub_gui_box_t self = vself; - if (grub_strcmp (name, "id") == 0) + VasEBoot_gui_box_t self = vself; + if (VasEBoot_strcmp (name, "id") == 0) { - grub_free (self->id); + VasEBoot_free (self->id); if (value) { - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); if (! self->id) - return grub_errno; + return VasEBoot_errno; } else self->id = 0; } - return grub_errno; + return VasEBoot_errno; } static void -box_add (void *vself, grub_gui_component_t comp) +box_add (void *vself, VasEBoot_gui_component_t comp) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; struct component_node *node; - node = grub_malloc (sizeof (*node)); + node = VasEBoot_malloc (sizeof (*node)); if (! node) return; /* Note: probably should handle the error. */ node->component = comp; @@ -335,14 +335,14 @@ box_add (void *vself, grub_gui_component_t comp) node->next = &self->ctail; node->next->prev = node; - comp->ops->set_parent (comp, (grub_gui_container_t) self); + comp->ops->set_parent (comp, (VasEBoot_gui_container_t) self); self->layout_func (self, 1, 0, 0); /* Relayout the children. */ } static void -box_remove (void *vself, grub_gui_component_t comp) +box_remove (void *vself, VasEBoot_gui_component_t comp) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; struct component_node *cur; for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) { @@ -352,7 +352,7 @@ box_remove (void *vself, grub_gui_component_t comp) cur->prev->next = cur->next; cur->next->prev = cur->prev; /* Free the node's memory (but don't destroy the component). */ - grub_free (cur); + VasEBoot_free (cur); /* Must not loop again, since 'cur' would be dereferenced! */ return; } @@ -361,15 +361,15 @@ box_remove (void *vself, grub_gui_component_t comp) static void box_iterate_children (void *vself, - grub_gui_component_callback cb, void *userdata) + VasEBoot_gui_component_callback cb, void *userdata) { - grub_gui_box_t self = vself; + VasEBoot_gui_box_t self = vself; struct component_node *cur; for (cur = self->chead.next; cur != &self->ctail; cur = cur->next) cb (cur->component, userdata); } -static struct grub_gui_component_ops box_comp_ops = +static struct VasEBoot_gui_component_ops box_comp_ops = { .destroy = box_destroy, .get_id = box_get_id, @@ -383,7 +383,7 @@ static struct grub_gui_component_ops box_comp_ops = .set_property = box_set_property }; -static struct grub_gui_container_ops box_ops = +static struct VasEBoot_gui_container_ops box_ops = { .add = box_add, .remove = box_remove, @@ -392,11 +392,11 @@ static struct grub_gui_container_ops box_ops = /* Box constructor. Specify the appropriate layout function to create a horizontal or vertical stacking box. */ -static grub_gui_box_t +static VasEBoot_gui_box_t box_new (layout_func_t layout_func) { - grub_gui_box_t box; - box = grub_zalloc (sizeof (*box)); + VasEBoot_gui_box_t box; + box = VasEBoot_zalloc (sizeof (*box)); if (! box) return 0; box->container.ops = &box_ops; @@ -411,18 +411,18 @@ box_new (layout_func_t layout_func) from left to right. Each child get a width corresponding to its preferred width. The height of each child is set the maximum of the preferred heights of all children. */ -grub_gui_container_t -grub_gui_hbox_new (void) +VasEBoot_gui_container_t +VasEBoot_gui_hbox_new (void) { - return (grub_gui_container_t) box_new (layout_horizontally); + return (VasEBoot_gui_container_t) box_new (layout_horizontally); } /* Create a new container that stacks its child components verticallyj, from top to bottom. Each child get a height corresponding to its preferred height. The width of each child is set the maximum of the preferred widths of all children. */ -grub_gui_container_t -grub_gui_vbox_new (void) +VasEBoot_gui_container_t +VasEBoot_gui_vbox_new (void) { - return (grub_gui_container_t) box_new (layout_vertically); + return (VasEBoot_gui_container_t) box_new (layout_vertically); } diff --git a/VasEBoot-core/gfxmenu/gui_canvas.c b/VasEBoot-core/gfxmenu/gui_canvas.c index a05491242..9016aef53 100644 --- a/VasEBoot-core/gfxmenu/gui_canvas.c +++ b/VasEBoot-core/gfxmenu/gui_canvas.c @@ -1,52 +1,52 @@ /* gui_canvas.c - GUI container allowing manually placed components. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* TODO Add layering so that components can be properly overlaid. */ struct component_node { - grub_gui_component_t component; + VasEBoot_gui_component_t component; struct component_node *next; }; -struct grub_gui_canvas +struct VasEBoot_gui_canvas { - struct grub_gui_container container; + struct VasEBoot_gui_container container; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; /* Component list (dummy head node). */ struct component_node components; }; -typedef struct grub_gui_canvas *grub_gui_canvas_t; +typedef struct VasEBoot_gui_canvas *VasEBoot_gui_canvas_t; static void canvas_destroy (void *vself) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; struct component_node *cur; struct component_node *next; for (cur = self->components.next; cur; cur = next) @@ -57,49 +57,49 @@ canvas_destroy (void *vself) /* Destroy the child component. */ cur->component->ops->destroy (cur->component); /* Free the linked list node. */ - grub_free (cur); + VasEBoot_free (cur); } - grub_free (self); + VasEBoot_free (self); } static const char * canvas_get_id (void *vself) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; return self->id; } static int canvas_is_instance (void *vself __attribute__((unused)), const char *type) { - return (grub_strcmp (type, "component") == 0 - || grub_strcmp (type, "container") == 0); + return (VasEBoot_strcmp (type, "component") == 0 + || VasEBoot_strcmp (type, "container") == 0); } static void -canvas_paint (void *vself, const grub_video_rect_t *region) +canvas_paint (void *vself, const VasEBoot_video_rect_t *region) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; struct component_node *cur; - grub_video_rect_t vpsave; + VasEBoot_video_rect_t vpsave; - grub_video_area_status_t canvas_area_status; - grub_video_get_area_status (&canvas_area_status); + VasEBoot_video_area_status_t canvas_area_status; + VasEBoot_video_get_area_status (&canvas_area_status); - grub_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); for (cur = self->components.next; cur; cur = cur->next) { - grub_video_rect_t r; - grub_gui_component_t comp; + VasEBoot_video_rect_t r; + VasEBoot_gui_component_t comp; signed x, y, w, h; comp = cur->component; - w = grub_fixed_sfs_multiply (self->bounds.width, comp->wfrac) + comp->w; - h = grub_fixed_sfs_multiply (self->bounds.height, comp->hfrac) + comp->h; - x = grub_fixed_sfs_multiply (self->bounds.width, comp->xfrac) + comp->x; - y = grub_fixed_sfs_multiply (self->bounds.height, comp->yfrac) + comp->y; + w = VasEBoot_fixed_sfs_multiply (self->bounds.width, comp->wfrac) + comp->w; + h = VasEBoot_fixed_sfs_multiply (self->bounds.height, comp->hfrac) + comp->h; + x = VasEBoot_fixed_sfs_multiply (self->bounds.width, comp->xfrac) + comp->x; + y = VasEBoot_fixed_sfs_multiply (self->bounds.height, comp->yfrac) + comp->y; if (comp->ops->get_minimal_size) { @@ -139,85 +139,85 @@ canvas_paint (void *vself, const grub_video_rect_t *region) r.height = h; comp->ops->set_bounds (comp, &r); - if (!grub_video_have_common_points (region, &r)) + if (!VasEBoot_video_have_common_points (region, &r)) continue; /* Paint the child. */ - if (canvas_area_status == GRUB_VIDEO_AREA_ENABLED - && grub_video_bounds_inside_region (&r, region)) - grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED); + if (canvas_area_status == VasEBoot_VIDEO_AREA_ENABLED + && VasEBoot_video_bounds_inside_region (&r, region)) + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_DISABLED); comp->ops->paint (comp, region); - if (canvas_area_status == GRUB_VIDEO_AREA_ENABLED) - grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED); + if (canvas_area_status == VasEBoot_VIDEO_AREA_ENABLED) + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_ENABLED); } - grub_gui_restore_viewport (&vpsave); + VasEBoot_gui_restore_viewport (&vpsave); } static void -canvas_set_parent (void *vself, grub_gui_container_t parent) +canvas_set_parent (void *vself, VasEBoot_gui_container_t parent) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t canvas_get_parent (void *vself) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; return self->parent; } static void -canvas_set_bounds (void *vself, const grub_video_rect_t *bounds) +canvas_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; self->bounds = *bounds; } static void -canvas_get_bounds (void *vself, grub_video_rect_t *bounds) +canvas_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; *bounds = self->bounds; } -static grub_err_t +static VasEBoot_err_t canvas_set_property (void *vself, const char *name, const char *value) { - grub_gui_canvas_t self = vself; - if (grub_strcmp (name, "id") == 0) + VasEBoot_gui_canvas_t self = vself; + if (VasEBoot_strcmp (name, "id") == 0) { - grub_free (self->id); + VasEBoot_free (self->id); if (value) { - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); if (! self->id) - return grub_errno; + return VasEBoot_errno; } else self->id = 0; } - return grub_errno; + return VasEBoot_errno; } static void -canvas_add (void *vself, grub_gui_component_t comp) +canvas_add (void *vself, VasEBoot_gui_component_t comp) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; struct component_node *node; - node = grub_malloc (sizeof (*node)); + node = VasEBoot_malloc (sizeof (*node)); if (! node) return; /* Note: probably should handle the error. */ node->component = comp; node->next = self->components.next; self->components.next = node; - comp->ops->set_parent (comp, (grub_gui_container_t) self); + comp->ops->set_parent (comp, (VasEBoot_gui_container_t) self); } static void -canvas_remove (void *vself, grub_gui_component_t comp) +canvas_remove (void *vself, VasEBoot_gui_component_t comp) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; struct component_node *cur; struct component_node *prev; prev = &self->components; @@ -228,7 +228,7 @@ canvas_remove (void *vself, grub_gui_component_t comp) /* Unlink 'cur' from the list. */ prev->next = cur->next; /* Free the node's memory (but don't destroy the component). */ - grub_free (cur); + VasEBoot_free (cur); /* Must not loop again, since 'cur' would be dereferenced! */ return; } @@ -237,15 +237,15 @@ canvas_remove (void *vself, grub_gui_component_t comp) static void canvas_iterate_children (void *vself, - grub_gui_component_callback cb, void *userdata) + VasEBoot_gui_component_callback cb, void *userdata) { - grub_gui_canvas_t self = vself; + VasEBoot_gui_canvas_t self = vself; struct component_node *cur; for (cur = self->components.next; cur; cur = cur->next) cb (cur->component, userdata); } -static struct grub_gui_component_ops canvas_comp_ops = +static struct VasEBoot_gui_component_ops canvas_comp_ops = { .destroy = canvas_destroy, .get_id = canvas_get_id, @@ -258,21 +258,21 @@ static struct grub_gui_component_ops canvas_comp_ops = .set_property = canvas_set_property }; -static struct grub_gui_container_ops canvas_ops = +static struct VasEBoot_gui_container_ops canvas_ops = { .add = canvas_add, .remove = canvas_remove, .iterate_children = canvas_iterate_children }; -grub_gui_container_t -grub_gui_canvas_new (void) +VasEBoot_gui_container_t +VasEBoot_gui_canvas_new (void) { - grub_gui_canvas_t canvas; - canvas = grub_zalloc (sizeof (*canvas)); + VasEBoot_gui_canvas_t canvas; + canvas = VasEBoot_zalloc (sizeof (*canvas)); if (! canvas) return 0; canvas->container.ops = &canvas_ops; canvas->container.component.ops = &canvas_comp_ops; - return (grub_gui_container_t) canvas; + return (VasEBoot_gui_container_t) canvas; } diff --git a/VasEBoot-core/gfxmenu/gui_circular_progress.c b/VasEBoot-core/gfxmenu/gui_circular_progress.c index 354dd7b73..9b27f4eaf 100644 --- a/VasEBoot-core/gfxmenu/gui_circular_progress.c +++ b/VasEBoot-core/gfxmenu/gui_circular_progress.c @@ -1,37 +1,37 @@ /* gui_circular_process.c - GUI circular progress indicator component. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -struct grub_gui_circular_progress +struct VasEBoot_gui_circular_progress { - struct grub_gui_progress progress; + struct VasEBoot_gui_progress progress; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; int visible; int start; @@ -44,18 +44,18 @@ struct grub_gui_circular_progress int need_to_load_pixmaps; char *center_file; char *tick_file; - struct grub_video_bitmap *center_bitmap; - struct grub_video_bitmap *tick_bitmap; + struct VasEBoot_video_bitmap *center_bitmap; + struct VasEBoot_video_bitmap *tick_bitmap; }; -typedef struct grub_gui_circular_progress *circular_progress_t; +typedef struct VasEBoot_gui_circular_progress *circular_progress_t; static void circprog_destroy (void *vself) { circular_progress_t self = vself; - grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self); - grub_free (self); + VasEBoot_gfxmenu_timeout_unregister ((VasEBoot_gui_component_t) self); + VasEBoot_free (self); } static const char * @@ -68,13 +68,13 @@ circprog_get_id (void *vself) static int circprog_is_instance (void *vself __attribute__((unused)), const char *type) { - return grub_strcmp (type, "component") == 0; + return VasEBoot_strcmp (type, "component") == 0; } -static struct grub_video_bitmap * +static struct VasEBoot_video_bitmap * load_bitmap (const char *dir, const char *file) { - struct grub_video_bitmap *bitmap; + struct VasEBoot_video_bitmap *bitmap; char *abspath; /* Check arguments. */ @@ -82,16 +82,16 @@ load_bitmap (const char *dir, const char *file) return 0; /* Resolve to an absolute path. */ - abspath = grub_resolve_relative_path (dir, file); + abspath = VasEBoot_resolve_relative_path (dir, file); if (! abspath) return 0; /* Load the image. */ - grub_errno = GRUB_ERR_NONE; - grub_video_bitmap_load (&bitmap, abspath); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_video_bitmap_load (&bitmap, abspath); + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_free (abspath); + VasEBoot_free (abspath); return bitmap; } @@ -101,7 +101,7 @@ check_pixmaps (circular_progress_t self) if (self->need_to_load_pixmaps) { if (self->center_bitmap) - grub_video_bitmap_destroy (self->center_bitmap); + VasEBoot_video_bitmap_destroy (self->center_bitmap); self->center_bitmap = load_bitmap (self->theme_dir, self->center_file); self->tick_bitmap = load_bitmap (self->theme_dir, self->tick_file); self->need_to_load_pixmaps = 0; @@ -111,36 +111,36 @@ check_pixmaps (circular_progress_t self) } static void -circprog_paint (void *vself, const grub_video_rect_t *region) +circprog_paint (void *vself, const VasEBoot_video_rect_t *region) { circular_progress_t self = vself; if (! self->visible) return; - if (!grub_video_have_common_points (region, &self->bounds)) + if (!VasEBoot_video_have_common_points (region, &self->bounds)) return; if (! check_pixmaps (self)) return; - grub_video_rect_t vpsave; - grub_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_video_rect_t vpsave; + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); int width = self->bounds.width; int height = self->bounds.height; - int center_width = grub_video_bitmap_get_width (self->center_bitmap); - int center_height = grub_video_bitmap_get_height (self->center_bitmap); - int tick_width = grub_video_bitmap_get_width (self->tick_bitmap); - int tick_height = grub_video_bitmap_get_height (self->tick_bitmap); - grub_video_blit_bitmap (self->center_bitmap, GRUB_VIDEO_BLIT_BLEND, + int center_width = VasEBoot_video_bitmap_get_width (self->center_bitmap); + int center_height = VasEBoot_video_bitmap_get_height (self->center_bitmap); + int tick_width = VasEBoot_video_bitmap_get_width (self->tick_bitmap); + int tick_height = VasEBoot_video_bitmap_get_height (self->tick_bitmap); + VasEBoot_video_blit_bitmap (self->center_bitmap, VasEBoot_VIDEO_BLIT_BLEND, (width - center_width) / 2, (height - center_height) / 2, 0, 0, center_width, center_height); if (self->num_ticks) { - int radius = grub_min (height, width) / 2 - grub_max (tick_height, tick_width) / 2 - 1; + int radius = VasEBoot_min (height, width) / 2 - VasEBoot_max (tick_height, tick_width) / 2 - 1; unsigned nticks; unsigned tick_begin; unsigned tick_end; @@ -172,30 +172,30 @@ circprog_paint (void *vself, const grub_video_rect_t *region) /* Calculate the location of the tick. */ angle = self->start_angle - + i * GRUB_TRIG_ANGLE_MAX / self->num_ticks; - x = width / 2 + (grub_cos (angle) * radius / GRUB_TRIG_FRACTION_SCALE); - y = height / 2 + (grub_sin (angle) * radius / GRUB_TRIG_FRACTION_SCALE); + + i * VasEBoot_TRIG_ANGLE_MAX / self->num_ticks; + x = width / 2 + (VasEBoot_cos (angle) * radius / VasEBoot_TRIG_FRACTION_SCALE); + y = height / 2 + (VasEBoot_sin (angle) * radius / VasEBoot_TRIG_FRACTION_SCALE); /* Adjust (x,y) so the tick is centered. */ x -= tick_width / 2; y -= tick_height / 2; /* Draw the tick. */ - grub_video_blit_bitmap (self->tick_bitmap, GRUB_VIDEO_BLIT_BLEND, + VasEBoot_video_blit_bitmap (self->tick_bitmap, VasEBoot_VIDEO_BLIT_BLEND, x, y, 0, 0, tick_width, tick_height); } } - grub_gui_restore_viewport (&vpsave); + VasEBoot_gui_restore_viewport (&vpsave); } static void -circprog_set_parent (void *vself, grub_gui_container_t parent) +circprog_set_parent (void *vself, VasEBoot_gui_container_t parent) { circular_progress_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t circprog_get_parent (void *vself) { circular_progress_t self = vself; @@ -203,14 +203,14 @@ circprog_get_parent (void *vself) } static void -circprog_set_bounds (void *vself, const grub_video_rect_t *bounds) +circprog_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { circular_progress_t self = vself; self->bounds = *bounds; } static void -circprog_get_bounds (void *vself, grub_video_rect_t *bounds) +circprog_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { circular_progress_t self = vself; *bounds = self->bounds; @@ -233,70 +233,70 @@ parse_angle (const char *value) char *ptr; int angle; - angle = grub_strtol (value, &ptr, 10); - if (grub_errno) + angle = VasEBoot_strtol (value, &ptr, 10); + if (VasEBoot_errno) return 0; - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; - if (grub_strcmp (ptr, "deg") == 0 + if (VasEBoot_strcmp (ptr, "deg") == 0 /* Unicode symbol of degrees (a circle, U+b0). Put here in UTF-8 to avoid potential problem with text file reesncoding */ - || grub_strcmp (ptr, "\xc2\xb0") == 0) - angle = grub_divide_round (angle * 64, 90); + || VasEBoot_strcmp (ptr, "\xc2\xb0") == 0) + angle = VasEBoot_divide_round (angle * 64, 90); return angle; } -static grub_err_t +static VasEBoot_err_t circprog_set_property (void *vself, const char *name, const char *value) { circular_progress_t self = vself; - if (grub_strcmp (name, "num_ticks") == 0) + if (VasEBoot_strcmp (name, "num_ticks") == 0) { - self->num_ticks = grub_strtoul (value, 0, 10); + self->num_ticks = VasEBoot_strtoul (value, 0, 10); } - else if (grub_strcmp (name, "start_angle") == 0) + else if (VasEBoot_strcmp (name, "start_angle") == 0) { self->start_angle = parse_angle (value); } - else if (grub_strcmp (name, "ticks_disappear") == 0) + else if (VasEBoot_strcmp (name, "ticks_disappear") == 0) { - self->ticks_disappear = grub_strcmp (value, "false") != 0; + self->ticks_disappear = VasEBoot_strcmp (value, "false") != 0; } - else if (grub_strcmp (name, "center_bitmap") == 0) + else if (VasEBoot_strcmp (name, "center_bitmap") == 0) { self->need_to_load_pixmaps = 1; - grub_free (self->center_file); - self->center_file = value ? grub_strdup (value) : 0; + VasEBoot_free (self->center_file); + self->center_file = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "tick_bitmap") == 0) + else if (VasEBoot_strcmp (name, "tick_bitmap") == 0) { self->need_to_load_pixmaps = 1; - grub_free (self->tick_file); - self->tick_file = value ? grub_strdup (value) : 0; + VasEBoot_free (self->tick_file); + self->tick_file = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "theme_dir") == 0) + else if (VasEBoot_strcmp (name, "theme_dir") == 0) { self->need_to_load_pixmaps = 1; - grub_free (self->theme_dir); - self->theme_dir = value ? grub_strdup (value) : 0; + VasEBoot_free (self->theme_dir); + self->theme_dir = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "id") == 0) + else if (VasEBoot_strcmp (name, "id") == 0) { - grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self); - grub_free (self->id); + VasEBoot_gfxmenu_timeout_unregister ((VasEBoot_gui_component_t) self); + VasEBoot_free (self->id); if (value) - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); else self->id = 0; - if (self->id && grub_strcmp (self->id, GRUB_GFXMENU_TIMEOUT_COMPONENT_ID) + if (self->id && VasEBoot_strcmp (self->id, VasEBoot_GFXMENU_TIMEOUT_COMPONENT_ID) == 0) - grub_gfxmenu_timeout_register ((grub_gui_component_t) self, + VasEBoot_gfxmenu_timeout_register ((VasEBoot_gui_component_t) self, circprog_set_state); } - return grub_errno; + return VasEBoot_errno; } -static struct grub_gui_component_ops circprog_ops = +static struct VasEBoot_gui_component_ops circprog_ops = { .destroy = circprog_destroy, .get_id = circprog_get_id, @@ -309,16 +309,16 @@ static struct grub_gui_component_ops circprog_ops = .set_property = circprog_set_property }; -static struct grub_gui_progress_ops circprog_prog_ops = +static struct VasEBoot_gui_progress_ops circprog_prog_ops = { .set_state = circprog_set_state }; -grub_gui_component_t -grub_gui_circular_progress_new (void) +VasEBoot_gui_component_t +VasEBoot_gui_circular_progress_new (void) { circular_progress_t self; - self = grub_zalloc (sizeof (*self)); + self = VasEBoot_zalloc (sizeof (*self)); if (! self) return 0; self->progress.ops = &circprog_prog_ops; @@ -327,5 +327,5 @@ grub_gui_circular_progress_new (void) self->num_ticks = 64; self->start_angle = -64; - return (grub_gui_component_t) self; + return (VasEBoot_gui_component_t) self; } diff --git a/VasEBoot-core/gfxmenu/gui_image.c b/VasEBoot-core/gfxmenu/gui_image.c index 29784ed2d..137434626 100644 --- a/VasEBoot-core/gfxmenu/gui_image.c +++ b/VasEBoot-core/gfxmenu/gui_image.c @@ -1,105 +1,105 @@ /* gui_image.c - GUI component to display an image. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -struct grub_gui_image +struct VasEBoot_gui_image { - struct grub_gui_component component; + struct VasEBoot_gui_component component; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; char *theme_dir; - struct grub_video_bitmap *raw_bitmap; - struct grub_video_bitmap *bitmap; + struct VasEBoot_video_bitmap *raw_bitmap; + struct VasEBoot_video_bitmap *bitmap; }; -typedef struct grub_gui_image *grub_gui_image_t; +typedef struct VasEBoot_gui_image *VasEBoot_gui_image_t; static void image_destroy (void *vself) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; /* Free the scaled bitmap, unless it's a reference to the raw bitmap. */ if (self->bitmap && (self->bitmap != self->raw_bitmap)) - grub_video_bitmap_destroy (self->bitmap); + VasEBoot_video_bitmap_destroy (self->bitmap); if (self->raw_bitmap) - grub_video_bitmap_destroy (self->raw_bitmap); + VasEBoot_video_bitmap_destroy (self->raw_bitmap); - grub_free (self); + VasEBoot_free (self); } static const char * image_get_id (void *vself) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; return self->id; } static int image_is_instance (void *vself __attribute__((unused)), const char *type) { - return grub_strcmp (type, "component") == 0; + return VasEBoot_strcmp (type, "component") == 0; } static void -image_paint (void *vself, const grub_video_rect_t *region) +image_paint (void *vself, const VasEBoot_video_rect_t *region) { - grub_gui_image_t self = vself; - grub_video_rect_t vpsave; + VasEBoot_gui_image_t self = vself; + VasEBoot_video_rect_t vpsave; if (! self->bitmap) return; - if (!grub_video_have_common_points (region, &self->bounds)) + if (!VasEBoot_video_have_common_points (region, &self->bounds)) return; - grub_gui_set_viewport (&self->bounds, &vpsave); - grub_video_blit_bitmap (self->bitmap, GRUB_VIDEO_BLIT_BLEND, + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_video_blit_bitmap (self->bitmap, VasEBoot_VIDEO_BLIT_BLEND, 0, 0, 0, 0, - grub_video_bitmap_get_width (self->bitmap), - grub_video_bitmap_get_height (self->bitmap)); - grub_gui_restore_viewport (&vpsave); + VasEBoot_video_bitmap_get_width (self->bitmap), + VasEBoot_video_bitmap_get_height (self->bitmap)); + VasEBoot_gui_restore_viewport (&vpsave); } static void -image_set_parent (void *vself, grub_gui_container_t parent) +image_set_parent (void *vself, VasEBoot_gui_container_t parent) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t image_get_parent (void *vself) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; return self->parent; } -static grub_err_t -rescale_image (grub_gui_image_t self) +static VasEBoot_err_t +rescale_image (VasEBoot_gui_image_t self) { signed width; signed height; @@ -108,64 +108,64 @@ rescale_image (grub_gui_image_t self) { if (self->bitmap) { - grub_video_bitmap_destroy (self->bitmap); + VasEBoot_video_bitmap_destroy (self->bitmap); self->bitmap = 0; } - return grub_errno; + return VasEBoot_errno; } width = self->bounds.width; height = self->bounds.height; if (self->bitmap - && ((signed) grub_video_bitmap_get_width (self->bitmap) == width) - && ((signed) grub_video_bitmap_get_height (self->bitmap) == height)) + && ((signed) VasEBoot_video_bitmap_get_width (self->bitmap) == width) + && ((signed) VasEBoot_video_bitmap_get_height (self->bitmap) == height)) { /* Nothing to do; already the right size. */ - return grub_errno; + return VasEBoot_errno; } /* Free any old scaled bitmap, *unless* it's a reference to the raw bitmap. */ if (self->bitmap && (self->bitmap != self->raw_bitmap)) - grub_video_bitmap_destroy (self->bitmap); + VasEBoot_video_bitmap_destroy (self->bitmap); self->bitmap = 0; /* Create a scaled bitmap, unless the requested size is the same as the raw size -- in that case a reference is made. */ - if ((signed) grub_video_bitmap_get_width (self->raw_bitmap) == width - && (signed) grub_video_bitmap_get_height (self->raw_bitmap) == height) + if ((signed) VasEBoot_video_bitmap_get_width (self->raw_bitmap) == width + && (signed) VasEBoot_video_bitmap_get_height (self->raw_bitmap) == height) { self->bitmap = self->raw_bitmap; - return grub_errno; + return VasEBoot_errno; } /* Don't scale to an invalid size. */ if (width <= 0 || height <= 0) - return grub_errno; + return VasEBoot_errno; /* Create the scaled bitmap. */ - grub_video_bitmap_create_scaled (&self->bitmap, + VasEBoot_video_bitmap_create_scaled (&self->bitmap, width, height, self->raw_bitmap, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); - return grub_errno; + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); + return VasEBoot_errno; } static void -image_set_bounds (void *vself, const grub_video_rect_t *bounds) +image_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; self->bounds = *bounds; rescale_image (self); } static void -image_get_bounds (void *vself, grub_video_rect_t *bounds) +image_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; *bounds = self->bounds; } @@ -173,12 +173,12 @@ image_get_bounds (void *vself, grub_video_rect_t *bounds) static void image_get_minimal_size (void *vself, unsigned *width, unsigned *height) { - grub_gui_image_t self = vself; + VasEBoot_gui_image_t self = vself; if (self->raw_bitmap) { - *width = grub_video_bitmap_get_width (self->raw_bitmap); - *height = grub_video_bitmap_get_height (self->raw_bitmap); + *width = VasEBoot_video_bitmap_get_width (self->raw_bitmap); + *height = VasEBoot_video_bitmap_get_height (self->raw_bitmap); } else { @@ -187,60 +187,60 @@ image_get_minimal_size (void *vself, unsigned *width, unsigned *height) } } -static grub_err_t -load_image (grub_gui_image_t self, const char *path) +static VasEBoot_err_t +load_image (VasEBoot_gui_image_t self, const char *path) { - struct grub_video_bitmap *bitmap; - if (grub_video_bitmap_load (&bitmap, path) != GRUB_ERR_NONE) - return grub_errno; + struct VasEBoot_video_bitmap *bitmap; + if (VasEBoot_video_bitmap_load (&bitmap, path) != VasEBoot_ERR_NONE) + return VasEBoot_errno; if (self->bitmap && (self->bitmap != self->raw_bitmap)) - grub_video_bitmap_destroy (self->bitmap); + VasEBoot_video_bitmap_destroy (self->bitmap); if (self->raw_bitmap) - grub_video_bitmap_destroy (self->raw_bitmap); + VasEBoot_video_bitmap_destroy (self->raw_bitmap); self->raw_bitmap = bitmap; return rescale_image (self); } -static grub_err_t +static VasEBoot_err_t image_set_property (void *vself, const char *name, const char *value) { - grub_gui_image_t self = vself; - if (grub_strcmp (name, "theme_dir") == 0) + VasEBoot_gui_image_t self = vself; + if (VasEBoot_strcmp (name, "theme_dir") == 0) { - grub_free (self->theme_dir); - self->theme_dir = grub_strdup (value); + VasEBoot_free (self->theme_dir); + self->theme_dir = VasEBoot_strdup (value); } - else if (grub_strcmp (name, "file") == 0) + else if (VasEBoot_strcmp (name, "file") == 0) { char *absvalue; - grub_err_t err; + VasEBoot_err_t err; /* Resolve to an absolute path. */ if (! self->theme_dir) - return grub_error (GRUB_ERR_BUG, "unspecified theme_dir"); - absvalue = grub_resolve_relative_path (self->theme_dir, value); + return VasEBoot_error (VasEBoot_ERR_BUG, "unspecified theme_dir"); + absvalue = VasEBoot_resolve_relative_path (self->theme_dir, value); if (! absvalue) - return grub_errno; + return VasEBoot_errno; err = load_image (self, absvalue); - grub_free (absvalue); + VasEBoot_free (absvalue); return err; } - else if (grub_strcmp (name, "id") == 0) + else if (VasEBoot_strcmp (name, "id") == 0) { - grub_free (self->id); + VasEBoot_free (self->id); if (value) - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); else self->id = 0; } - return grub_errno; + return VasEBoot_errno; } -static struct grub_gui_component_ops image_ops = +static struct VasEBoot_gui_component_ops image_ops = { .destroy = image_destroy, .get_id = image_get_id, @@ -254,14 +254,14 @@ static struct grub_gui_component_ops image_ops = .set_property = image_set_property }; -grub_gui_component_t -grub_gui_image_new (void) +VasEBoot_gui_component_t +VasEBoot_gui_image_new (void) { - grub_gui_image_t image; - image = grub_zalloc (sizeof (*image)); + VasEBoot_gui_image_t image; + image = VasEBoot_zalloc (sizeof (*image)); if (! image) return 0; image->component.ops = &image_ops; - return (grub_gui_component_t) image; + return (VasEBoot_gui_component_t) image; } diff --git a/VasEBoot-core/gfxmenu/gui_label.c b/VasEBoot-core/gfxmenu/gui_label.c index a4c817891..cd8f8bc04 100644 --- a/VasEBoot-core/gfxmenu/gui_label.c +++ b/VasEBoot-core/gfxmenu/gui_label.c @@ -1,29 +1,29 @@ /* gui_label.c - GUI component to display a line of text. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include static const char *align_options[] = { @@ -39,56 +39,56 @@ enum align_mode { align_right }; -struct grub_gui_label +struct VasEBoot_gui_label { - struct grub_gui_component comp; + struct VasEBoot_gui_component comp; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; int visible; char *text; char *template; - grub_font_t font; - grub_video_rgba_color_t color; + VasEBoot_font_t font; + VasEBoot_video_rgba_color_t color; int value; enum align_mode align; }; -typedef struct grub_gui_label *grub_gui_label_t; +typedef struct VasEBoot_gui_label *VasEBoot_gui_label_t; static void label_destroy (void *vself) { - grub_gui_label_t self = vself; - grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self); - grub_free (self->text); - grub_free (self->template); - grub_free (self); + VasEBoot_gui_label_t self = vself; + VasEBoot_gfxmenu_timeout_unregister ((VasEBoot_gui_component_t) self); + VasEBoot_free (self->text); + VasEBoot_free (self->template); + VasEBoot_free (self); } static const char * label_get_id (void *vself) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; return self->id; } static int label_is_instance (void *vself __attribute__((unused)), const char *type) { - return grub_strcmp (type, "component") == 0; + return VasEBoot_strcmp (type, "component") == 0; } static void -label_paint (void *vself, const grub_video_rect_t *region) +label_paint (void *vself, const VasEBoot_video_rect_t *region) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; if (! self->visible) return; - if (!grub_video_have_common_points (region, &self->bounds)) + if (!VasEBoot_video_have_common_points (region, &self->bounds)) return; /* Calculate the starting x coordinate. */ @@ -97,61 +97,61 @@ label_paint (void *vself, const grub_video_rect_t *region) left_x = 0; else if (self->align == align_center) left_x = (self->bounds.width - - grub_font_get_string_width (self->font, self->text)) / 2; + - VasEBoot_font_get_string_width (self->font, self->text)) / 2; else if (self->align == align_right) left_x = (self->bounds.width - - grub_font_get_string_width (self->font, self->text)); + - VasEBoot_font_get_string_width (self->font, self->text)); else return; /* Invalid alignment. */ if (left_x < 0 || left_x > (int) self->bounds.width) left_x = 0; - grub_video_rect_t vpsave; - grub_gui_set_viewport (&self->bounds, &vpsave); - grub_font_draw_string (self->text, + VasEBoot_video_rect_t vpsave; + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_font_draw_string (self->text, self->font, - grub_video_map_rgba_color (self->color), + VasEBoot_video_map_rgba_color (self->color), left_x, - grub_font_get_ascent (self->font)); - grub_gui_restore_viewport (&vpsave); + VasEBoot_font_get_ascent (self->font)); + VasEBoot_gui_restore_viewport (&vpsave); } static void -label_set_parent (void *vself, grub_gui_container_t parent) +label_set_parent (void *vself, VasEBoot_gui_container_t parent) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t label_get_parent (void *vself) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; return self->parent; } static void -label_set_bounds (void *vself, const grub_video_rect_t *bounds) +label_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; self->bounds = *bounds; } static void -label_get_bounds (void *vself, grub_video_rect_t *bounds) +label_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; *bounds = self->bounds; } static void label_get_minimal_size (void *vself, unsigned *width, unsigned *height) { - grub_gui_label_t self = vself; - *width = grub_font_get_string_width (self->font, self->text); - *height = (grub_font_get_ascent (self->font) - + grub_font_get_descent (self->font)); + VasEBoot_gui_label_t self = vself; + *width = VasEBoot_font_get_string_width (self->font, self->text); + *height = (VasEBoot_font_get_ascent (self->font) + + VasEBoot_font_get_descent (self->font)); } #pragma GCC diagnostic ignored "-Wformat-nonliteral" @@ -160,86 +160,86 @@ static void label_set_state (void *vself, int visible, int start __attribute__ ((unused)), int current, int end __attribute__ ((unused))) { - grub_gui_label_t self = vself; + VasEBoot_gui_label_t self = vself; self->value = -current; self->visible = visible; - grub_free (self->text); - self->text = grub_xasprintf (self->template ? : "%d", self->value); + VasEBoot_free (self->text); + self->text = VasEBoot_xasprintf (self->template ? : "%d", self->value); } -static grub_err_t +static VasEBoot_err_t label_set_property (void *vself, const char *name, const char *value) { - grub_gui_label_t self = vself; - if (grub_strcmp (name, "text") == 0) + VasEBoot_gui_label_t self = vself; + if (VasEBoot_strcmp (name, "text") == 0) { - grub_free (self->text); - grub_free (self->template); + VasEBoot_free (self->text); + VasEBoot_free (self->template); if (! value) { self->template = NULL; - self->text = grub_strdup (""); + self->text = VasEBoot_strdup (""); } else { - if (grub_strcmp (value, "@KEYMAP_LONG@") == 0) + if (VasEBoot_strcmp (value, "@KEYMAP_LONG@") == 0) value = _("Press enter to boot the selected OS, " "`e' to edit the commands before booting " "or `c' for a command-line. ESC to return previous menu."); - else if (grub_strcmp (value, "@KEYMAP_MIDDLE@") == 0) + else if (VasEBoot_strcmp (value, "@KEYMAP_MIDDLE@") == 0) value = _("Press enter to boot the selected OS, " "`e' to edit the commands before booting " "or `c' for a command-line."); - else if (grub_strcmp (value, "@KEYMAP_SHORT@") == 0) + else if (VasEBoot_strcmp (value, "@KEYMAP_SHORT@") == 0) value = _("enter: boot, `e': options, `c': cmd-line"); /* FIXME: Add more templates here if needed. */ - self->template = grub_strdup (value); - self->text = grub_xasprintf (value, self->value); + self->template = VasEBoot_strdup (value); + self->text = VasEBoot_xasprintf (value, self->value); } } - else if (grub_strcmp (name, "font") == 0) + else if (VasEBoot_strcmp (name, "font") == 0) { - self->font = grub_font_get (value); + self->font = VasEBoot_font_get (value); } - else if (grub_strcmp (name, "color") == 0) + else if (VasEBoot_strcmp (name, "color") == 0) { - grub_video_parse_color (value, &self->color); + VasEBoot_video_parse_color (value, &self->color); } - else if (grub_strcmp (name, "align") == 0) + else if (VasEBoot_strcmp (name, "align") == 0) { int i; for (i = 0; align_options[i]; i++) { - if (grub_strcmp (align_options[i], value) == 0) + if (VasEBoot_strcmp (align_options[i], value) == 0) { self->align = i; /* Set the alignment mode. */ break; } } } - else if (grub_strcmp (name, "visible") == 0) + else if (VasEBoot_strcmp (name, "visible") == 0) { - self->visible = grub_strcmp (value, "false") != 0; + self->visible = VasEBoot_strcmp (value, "false") != 0; } - else if (grub_strcmp (name, "id") == 0) + else if (VasEBoot_strcmp (name, "id") == 0) { - grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self); - grub_free (self->id); + VasEBoot_gfxmenu_timeout_unregister ((VasEBoot_gui_component_t) self); + VasEBoot_free (self->id); if (value) - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); else self->id = 0; - if (self->id && grub_strcmp (self->id, GRUB_GFXMENU_TIMEOUT_COMPONENT_ID) + if (self->id && VasEBoot_strcmp (self->id, VasEBoot_GFXMENU_TIMEOUT_COMPONENT_ID) == 0) - grub_gfxmenu_timeout_register ((grub_gui_component_t) self, + VasEBoot_gfxmenu_timeout_register ((VasEBoot_gui_component_t) self, label_set_state); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #pragma GCC diagnostic error "-Wformat-nonliteral" -static struct grub_gui_component_ops label_ops = +static struct VasEBoot_gui_component_ops label_ops = { .destroy = label_destroy, .get_id = label_get_id, @@ -253,21 +253,21 @@ static struct grub_gui_component_ops label_ops = .set_property = label_set_property }; -grub_gui_component_t -grub_gui_label_new (void) +VasEBoot_gui_component_t +VasEBoot_gui_label_new (void) { - grub_gui_label_t label; - label = grub_zalloc (sizeof (*label)); + VasEBoot_gui_label_t label; + label = VasEBoot_zalloc (sizeof (*label)); if (! label) return 0; label->comp.ops = &label_ops; label->visible = 1; - label->text = grub_strdup (""); - label->font = grub_font_get ("Unknown Regular 16"); + label->text = VasEBoot_strdup (""); + label->font = VasEBoot_font_get ("Unknown Regular 16"); label->color.red = 0; label->color.green = 0; label->color.blue = 0; label->color.alpha = 255; label->align = align_left; - return (grub_gui_component_t) label; + return (VasEBoot_gui_component_t) label; } diff --git a/VasEBoot-core/gfxmenu/gui_list.c b/VasEBoot-core/gfxmenu/gui_list.c index 01477cdf2..5618022d8 100644 --- a/VasEBoot-core/gfxmenu/gui_list.c +++ b/VasEBoot-core/gfxmenu/gui_list.c @@ -1,29 +1,29 @@ /* gui_list.c - GUI component to display a selectable list of items. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include enum scrollbar_slice_mode { SCROLLBAR_SLICE_WEST, @@ -31,12 +31,12 @@ enum scrollbar_slice_mode { SCROLLBAR_SLICE_EAST }; -struct grub_gui_list_impl +struct VasEBoot_gui_list_impl { - struct grub_gui_list list; + struct VasEBoot_gui_list list; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; int visible; @@ -46,19 +46,19 @@ struct grub_gui_list_impl int item_padding; int item_icon_space; int item_spacing; - grub_font_t item_font; + VasEBoot_font_t item_font; int selected_item_font_inherit; - grub_font_t selected_item_font; - grub_video_rgba_color_t item_color; + VasEBoot_font_t selected_item_font; + VasEBoot_video_rgba_color_t item_color; int selected_item_color_inherit; - grub_video_rgba_color_t selected_item_color; + VasEBoot_video_rgba_color_t selected_item_color; int draw_scrollbar; int need_to_recreate_scrollbar; char *scrollbar_frame_pattern; char *scrollbar_thumb_pattern; - grub_gfxmenu_box_t scrollbar_frame; - grub_gfxmenu_box_t scrollbar_thumb; + VasEBoot_gfxmenu_box_t scrollbar_frame; + VasEBoot_gfxmenu_box_t scrollbar_thumb; int scrollbar_thumb_overlay; int scrollbar_width; enum scrollbar_slice_mode scrollbar_slice; @@ -75,26 +75,26 @@ struct grub_gui_list_impl char *item_box_pattern; int selected_item_box_pattern_inherit; char *selected_item_box_pattern; - grub_gfxmenu_box_t menu_box; - grub_gfxmenu_box_t selected_item_box; - grub_gfxmenu_box_t item_box; + VasEBoot_gfxmenu_box_t menu_box; + VasEBoot_gfxmenu_box_t selected_item_box; + VasEBoot_gfxmenu_box_t item_box; - grub_gfxmenu_icon_manager_t icon_manager; + VasEBoot_gfxmenu_icon_manager_t icon_manager; - grub_gfxmenu_view_t view; + VasEBoot_gfxmenu_view_t view; }; -typedef struct grub_gui_list_impl *list_impl_t; +typedef struct VasEBoot_gui_list_impl *list_impl_t; static void list_destroy (void *vself) { list_impl_t self = vself; - grub_free (self->theme_dir); - grub_free (self->menu_box_pattern); - grub_free (self->item_box_pattern); - grub_free (self->selected_item_box_pattern); + VasEBoot_free (self->theme_dir); + VasEBoot_free (self->menu_box_pattern); + VasEBoot_free (self->item_box_pattern); + VasEBoot_free (self->selected_item_box_pattern); if (self->menu_box) self->menu_box->destroy (self->menu_box); if (self->item_box) @@ -102,14 +102,14 @@ list_destroy (void *vself) if (self->selected_item_box) self->selected_item_box->destroy (self->selected_item_box); if (self->icon_manager) - grub_gfxmenu_icon_manager_destroy (self->icon_manager); + VasEBoot_gfxmenu_icon_manager_destroy (self->icon_manager); if (self->scrollbar_thumb) self->scrollbar_thumb->destroy (self->scrollbar_thumb); if (self->scrollbar_frame) self->scrollbar_frame->destroy (self->scrollbar_frame); - grub_free (self->scrollbar_thumb_pattern); - grub_free (self->scrollbar_frame_pattern); - grub_free (self); + VasEBoot_free (self->scrollbar_thumb_pattern); + VasEBoot_free (self->scrollbar_frame_pattern); + VasEBoot_free (self); } static int @@ -119,17 +119,17 @@ get_num_shown_items (list_impl_t self) int item_vspace = self->item_spacing; int item_height = self->item_height; - grub_gfxmenu_box_t box = self->menu_box; + VasEBoot_gfxmenu_box_t box = self->menu_box; int box_top_pad = box->get_top_pad (box); int box_bottom_pad = box->get_bottom_pad (box); - grub_gfxmenu_box_t itembox = self->item_box; - grub_gfxmenu_box_t selbox = self->selected_item_box; + VasEBoot_gfxmenu_box_t itembox = self->item_box; + VasEBoot_gfxmenu_box_t selbox = self->selected_item_box; int item_top_pad = itembox->get_top_pad (itembox); int item_bottom_pad = itembox->get_bottom_pad (itembox); int sel_top_pad = selbox->get_top_pad (selbox); int sel_bottom_pad = selbox->get_bottom_pad (selbox); - int max_top_pad = grub_max (item_top_pad, sel_top_pad); - int max_bottom_pad = grub_max (item_bottom_pad, sel_bottom_pad); + int max_top_pad = VasEBoot_max (item_top_pad, sel_top_pad); + int max_bottom_pad = VasEBoot_max (item_bottom_pad, sel_bottom_pad); if (item_height + item_vspace <= 0) return 1; @@ -144,15 +144,15 @@ check_boxes (list_impl_t self) { if (self->need_to_recreate_boxes) { - grub_gui_recreate_box (&self->menu_box, + VasEBoot_gui_recreate_box (&self->menu_box, self->menu_box_pattern, self->theme_dir); - grub_gui_recreate_box (&self->item_box, + VasEBoot_gui_recreate_box (&self->item_box, self->item_box_pattern, self->theme_dir); - grub_gui_recreate_box (&self->selected_item_box, + VasEBoot_gui_recreate_box (&self->selected_item_box, self->selected_item_box_pattern, self->theme_dir); @@ -168,11 +168,11 @@ check_scrollbar (list_impl_t self) { if (self->need_to_recreate_scrollbar) { - grub_gui_recreate_box (&self->scrollbar_frame, + VasEBoot_gui_recreate_box (&self->scrollbar_frame, self->scrollbar_frame_pattern, self->theme_dir); - grub_gui_recreate_box (&self->scrollbar_thumb, + VasEBoot_gui_recreate_box (&self->scrollbar_thumb, self->scrollbar_thumb_pattern, self->theme_dir); @@ -183,9 +183,9 @@ check_scrollbar (list_impl_t self) return 0; /* Sanity checks. */ - grub_gfxmenu_box_t frame = self->scrollbar_frame; - grub_gfxmenu_box_t thumb = self->scrollbar_thumb; - grub_gfxmenu_box_t menu = self->menu_box; + VasEBoot_gfxmenu_box_t frame = self->scrollbar_frame; + VasEBoot_gfxmenu_box_t thumb = self->scrollbar_thumb; + VasEBoot_gfxmenu_box_t menu = self->menu_box; int min_width = frame->get_left_pad (frame) + frame->get_right_pad (frame); int min_height = frame->get_top_pad (frame) @@ -219,19 +219,19 @@ list_get_id (void *vself) static int list_is_instance (void *vself __attribute__((unused)), const char *type) { - return (grub_strcmp (type, "component") == 0 - || grub_strcmp (type, "list") == 0); + return (VasEBoot_strcmp (type, "component") == 0 + || VasEBoot_strcmp (type, "list") == 0); } -static struct grub_video_bitmap * +static struct VasEBoot_video_bitmap * get_item_icon (list_impl_t self, int item_index) { - grub_menu_entry_t entry; - entry = grub_menu_get_entry (self->view->menu, item_index); + VasEBoot_menu_entry_t entry; + entry = VasEBoot_menu_get_entry (self->view->menu, item_index); if (! entry) return 0; - return grub_gfxmenu_icon_manager_get_icon (self->icon_manager, entry); + return VasEBoot_gfxmenu_icon_manager_get_icon (self->icon_manager, entry); } static void @@ -256,8 +256,8 @@ draw_scrollbar (list_impl_t self, { unsigned thumby, thumbheight; - grub_gfxmenu_box_t frame = self->scrollbar_frame; - grub_gfxmenu_box_t thumb = self->scrollbar_thumb; + VasEBoot_gfxmenu_box_t frame = self->scrollbar_frame; + VasEBoot_gfxmenu_box_t thumb = self->scrollbar_thumb; int frame_vertical_pad = (frame->get_top_pad (frame) + frame->get_bottom_pad (frame)); int frame_horizontal_pad = (frame->get_left_pad (frame) @@ -325,16 +325,16 @@ draw_menu (list_impl_t self, int num_shown_items) int icon_text_space = self->item_icon_space; int item_vspace = self->item_spacing; - int ascent = grub_font_get_ascent (self->item_font); - int descent = grub_font_get_descent (self->item_font); - int selected_ascent = grub_font_get_ascent (self->selected_item_font); - int selected_descent = grub_font_get_descent (self->selected_item_font); + int ascent = VasEBoot_font_get_ascent (self->item_font); + int descent = VasEBoot_font_get_descent (self->item_font); + int selected_ascent = VasEBoot_font_get_ascent (self->selected_item_font); + int selected_descent = VasEBoot_font_get_descent (self->selected_item_font); int text_box_height = self->item_height; make_selected_item_visible (self); - grub_gfxmenu_box_t itembox = self->item_box; - grub_gfxmenu_box_t selbox = self->selected_item_box; + VasEBoot_gfxmenu_box_t itembox = self->item_box; + VasEBoot_gfxmenu_box_t selbox = self->selected_item_box; int item_leftpad = itembox->get_left_pad (itembox); int item_rightpad = itembox->get_right_pad (itembox); int item_border_width = item_leftpad + item_rightpad; @@ -344,16 +344,16 @@ draw_menu (list_impl_t self, int num_shown_items) int sel_border_width = sel_leftpad + sel_rightpad; int sel_toppad = selbox->get_top_pad (selbox); - int max_leftpad = grub_max (item_leftpad, sel_leftpad); - int max_toppad = grub_max (item_toppad, sel_toppad); + int max_leftpad = VasEBoot_max (item_leftpad, sel_leftpad); + int max_toppad = VasEBoot_max (item_toppad, sel_toppad); int item_top = 0; int menu_index; int visible_index; - struct grub_video_rect oviewport; + struct VasEBoot_video_rect oviewport; - grub_video_get_viewport (&oviewport.x, &oviewport.y, + VasEBoot_video_get_viewport (&oviewport.x, &oviewport.y, &oviewport.width, &oviewport.height); - grub_video_set_viewport (oviewport.x + boxpad, + VasEBoot_video_set_viewport (oviewport.x + boxpad, oviewport.y + boxpad, oviewport.width - 2 * boxpad, oviewport.height - 2 * boxpad); @@ -371,15 +371,15 @@ draw_menu (list_impl_t self, int num_shown_items) + selected_descent)) / 2 + selected_ascent; - grub_video_rect_t svpsave, sviewport; + VasEBoot_video_rect_t svpsave, sviewport; sviewport.x = max_leftpad + text_left_offset; int text_viewport_width = cwidth - sviewport.x; sviewport.height = text_box_height; - grub_video_color_t item_color; - grub_video_color_t sel_color; - item_color = grub_video_map_rgba_color (self->item_color); - sel_color = grub_video_map_rgba_color (self->selected_item_color); + VasEBoot_video_color_t item_color; + VasEBoot_video_color_t sel_color; + item_color = VasEBoot_video_map_rgba_color (self->item_color); + sel_color = VasEBoot_video_map_rgba_color (self->selected_item_color); int item_box_top_offset = max_toppad - item_toppad; int sel_box_top_offset = max_toppad - sel_toppad; @@ -394,9 +394,9 @@ draw_menu (list_impl_t self, int num_shown_items) visible_index++, menu_index++) { int is_selected = (menu_index == self->view->selected); - struct grub_video_bitmap *icon; - grub_font_t font; - grub_video_color_t color; + struct VasEBoot_video_bitmap *icon; + VasEBoot_font_t font; + VasEBoot_video_color_t color; int text_top_offset; int top_pad; int icon_top_offset; @@ -425,41 +425,41 @@ draw_menu (list_impl_t self, int num_shown_items) icon = get_item_icon (self, menu_index); if (icon != 0) - grub_video_blit_bitmap (icon, GRUB_VIDEO_BLIT_BLEND, + VasEBoot_video_blit_bitmap (icon, VasEBoot_VIDEO_BLIT_BLEND, max_leftpad, item_top + icon_top_offset, 0, 0, self->icon_width, self->icon_height); const char *item_title = - grub_menu_get_entry (self->view->menu, menu_index)->title; + VasEBoot_menu_get_entry (self->view->menu, menu_index)->title; sviewport.y = item_top + top_pad; sviewport.width = viewport_width; - grub_gui_set_viewport (&sviewport, &svpsave); - grub_font_draw_string (item_title, + VasEBoot_gui_set_viewport (&sviewport, &svpsave); + VasEBoot_font_draw_string (item_title, font, color, 0, text_top_offset); - grub_gui_restore_viewport (&svpsave); + VasEBoot_gui_restore_viewport (&svpsave); item_top += text_box_height + item_vspace; } - grub_video_set_viewport (oviewport.x, + VasEBoot_video_set_viewport (oviewport.x, oviewport.y, oviewport.width, oviewport.height); } static void -list_paint (void *vself, const grub_video_rect_t *region) +list_paint (void *vself, const VasEBoot_video_rect_t *region) { list_impl_t self = vself; - grub_video_rect_t vpsave; + VasEBoot_video_rect_t vpsave; if (! self->visible) return; - if (!grub_video_have_common_points (region, &self->bounds)) + if (!VasEBoot_video_have_common_points (region, &self->bounds)) return; check_boxes (self); @@ -467,14 +467,14 @@ list_paint (void *vself, const grub_video_rect_t *region) if (! self->menu_box || ! self->selected_item_box || ! self->item_box) return; - grub_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); { - grub_gfxmenu_box_t box = self->menu_box; + VasEBoot_gfxmenu_box_t box = self->menu_box; int box_left_pad = box->get_left_pad (box); int box_top_pad = box->get_top_pad (box); int box_right_pad = box->get_right_pad (box); int box_bottom_pad = box->get_bottom_pad (box); - grub_video_rect_t vpsave2, content_rect; + VasEBoot_video_rect_t vpsave2, content_rect; int num_shown_items = get_num_shown_items (self); int drawing_scrollbar = (self->draw_scrollbar && (num_shown_items < self->view->menu->size) @@ -506,9 +506,9 @@ list_paint (void *vself, const grub_video_rect_t *region) break; } - grub_gui_set_viewport (&content_rect, &vpsave2); + VasEBoot_gui_set_viewport (&content_rect, &vpsave2); draw_menu (self, num_shown_items); - grub_gui_restore_viewport (&vpsave2); + VasEBoot_gui_restore_viewport (&vpsave2); if (drawing_scrollbar) { @@ -541,27 +541,27 @@ list_paint (void *vself, const grub_video_rect_t *region) break; } - grub_gui_set_viewport (&content_rect, &vpsave2); + VasEBoot_gui_set_viewport (&content_rect, &vpsave2); draw_scrollbar (self, self->first_shown_index, num_shown_items, 0, self->view->menu->size, scrollbar_width, content_rect.height); - grub_gui_restore_viewport (&vpsave2); + VasEBoot_gui_restore_viewport (&vpsave2); } } - grub_gui_restore_viewport (&vpsave); + VasEBoot_gui_restore_viewport (&vpsave); } static void -list_set_parent (void *vself, grub_gui_container_t parent) +list_set_parent (void *vself, VasEBoot_gui_container_t parent) { list_impl_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t list_get_parent (void *vself) { list_impl_t self = vself; @@ -569,14 +569,14 @@ list_get_parent (void *vself) } static void -list_set_bounds (void *vself, const grub_video_rect_t *bounds) +list_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { list_impl_t self = vself; self->bounds = *bounds; } static void -list_get_bounds (void *vself, grub_video_rect_t *bounds) +list_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { list_impl_t self = vself; *bounds = self->bounds; @@ -594,32 +594,32 @@ list_get_minimal_size (void *vself, unsigned *width, unsigned *height) int item_height = self->item_height; int num_items = 3; - grub_gfxmenu_box_t box = self->menu_box; + VasEBoot_gfxmenu_box_t box = self->menu_box; int box_left_pad = box->get_left_pad (box); int box_top_pad = box->get_top_pad (box); int box_right_pad = box->get_right_pad (box); int box_bottom_pad = box->get_bottom_pad (box); unsigned width_s; - grub_gfxmenu_box_t selbox = self->selected_item_box; + VasEBoot_gfxmenu_box_t selbox = self->selected_item_box; int sel_top_pad = selbox->get_top_pad (selbox); int sel_bottom_pad = selbox->get_bottom_pad (selbox); int sel_left_pad = selbox->get_left_pad (selbox); int sel_right_pad = selbox->get_right_pad (selbox); - grub_gfxmenu_box_t itembox = self->item_box; + VasEBoot_gfxmenu_box_t itembox = self->item_box; int item_top_pad = itembox->get_top_pad (itembox); int item_bottom_pad = itembox->get_bottom_pad (itembox); int item_left_pad = itembox->get_left_pad (itembox); int item_right_pad = itembox->get_right_pad (itembox); - int max_left_pad = grub_max (item_left_pad, sel_left_pad); - int max_right_pad = grub_max (item_right_pad, sel_right_pad); - int max_top_pad = grub_max (item_top_pad, sel_top_pad); - int max_bottom_pad = grub_max (item_bottom_pad, sel_bottom_pad); + int max_left_pad = VasEBoot_max (item_left_pad, sel_left_pad); + int max_right_pad = VasEBoot_max (item_right_pad, sel_right_pad); + int max_top_pad = VasEBoot_max (item_top_pad, sel_top_pad); + int max_bottom_pad = VasEBoot_max (item_bottom_pad, sel_bottom_pad); - *width = grub_font_get_string_width (self->item_font, "Typical OS"); - width_s = grub_font_get_string_width (self->selected_item_font, + *width = VasEBoot_font_get_string_width (self->item_font, "Typical OS"); + width_s = VasEBoot_font_get_string_width (self->selected_item_font, "Typical OS"); if (*width < width_s) *width = width_s; @@ -656,198 +656,198 @@ list_get_minimal_size (void *vself, unsigned *width, unsigned *height) } } -static grub_err_t +static VasEBoot_err_t list_set_property (void *vself, const char *name, const char *value) { list_impl_t self = vself; - if (grub_strcmp (name, "item_font") == 0) + if (VasEBoot_strcmp (name, "item_font") == 0) { - self->item_font = grub_font_get (value); + self->item_font = VasEBoot_font_get (value); if (self->selected_item_font_inherit) self->selected_item_font = self->item_font; } - else if (grub_strcmp (name, "selected_item_font") == 0) + else if (VasEBoot_strcmp (name, "selected_item_font") == 0) { - if (! value || grub_strcmp (value, "inherit") == 0) + if (! value || VasEBoot_strcmp (value, "inherit") == 0) { self->selected_item_font = self->item_font; self->selected_item_font_inherit = 1; } else { - self->selected_item_font = grub_font_get (value); + self->selected_item_font = VasEBoot_font_get (value); self->selected_item_font_inherit = 0; } } - else if (grub_strcmp (name, "item_color") == 0) + else if (VasEBoot_strcmp (name, "item_color") == 0) { - grub_video_rgba_color_t color; - if (grub_video_parse_color (value, &color) == GRUB_ERR_NONE) + VasEBoot_video_rgba_color_t color; + if (VasEBoot_video_parse_color (value, &color) == VasEBoot_ERR_NONE) { self->item_color = color; if (self->selected_item_color_inherit) self->selected_item_color = self->item_color; } } - else if (grub_strcmp (name, "selected_item_color") == 0) + else if (VasEBoot_strcmp (name, "selected_item_color") == 0) { - if (! value || grub_strcmp (value, "inherit") == 0) + if (! value || VasEBoot_strcmp (value, "inherit") == 0) { self->selected_item_color = self->item_color; self->selected_item_color_inherit = 1; } else { - grub_video_rgba_color_t color; - if (grub_video_parse_color (value, &color) - == GRUB_ERR_NONE) + VasEBoot_video_rgba_color_t color; + if (VasEBoot_video_parse_color (value, &color) + == VasEBoot_ERR_NONE) { self->selected_item_color = color; self->selected_item_color_inherit = 0; } } } - else if (grub_strcmp (name, "icon_width") == 0) + else if (VasEBoot_strcmp (name, "icon_width") == 0) { - self->icon_width = grub_strtol (value, 0, 10); - grub_gfxmenu_icon_manager_set_icon_size (self->icon_manager, + self->icon_width = VasEBoot_strtol (value, 0, 10); + VasEBoot_gfxmenu_icon_manager_set_icon_size (self->icon_manager, self->icon_width, self->icon_height); } - else if (grub_strcmp (name, "icon_height") == 0) + else if (VasEBoot_strcmp (name, "icon_height") == 0) { - self->icon_height = grub_strtol (value, 0, 10); - grub_gfxmenu_icon_manager_set_icon_size (self->icon_manager, + self->icon_height = VasEBoot_strtol (value, 0, 10); + VasEBoot_gfxmenu_icon_manager_set_icon_size (self->icon_manager, self->icon_width, self->icon_height); } - else if (grub_strcmp (name, "item_height") == 0) + else if (VasEBoot_strcmp (name, "item_height") == 0) { - self->item_height = grub_strtol (value, 0, 10); + self->item_height = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "item_padding") == 0) + else if (VasEBoot_strcmp (name, "item_padding") == 0) { - self->item_padding = grub_strtol (value, 0, 10); + self->item_padding = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "item_icon_space") == 0) + else if (VasEBoot_strcmp (name, "item_icon_space") == 0) { - self->item_icon_space = grub_strtol (value, 0, 10); + self->item_icon_space = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "item_spacing") == 0) + else if (VasEBoot_strcmp (name, "item_spacing") == 0) { - self->item_spacing = grub_strtol (value, 0, 10); + self->item_spacing = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "visible") == 0) + else if (VasEBoot_strcmp (name, "visible") == 0) { - self->visible = grub_strcmp (value, "false") != 0; + self->visible = VasEBoot_strcmp (value, "false") != 0; } - else if (grub_strcmp (name, "menu_pixmap_style") == 0) + else if (VasEBoot_strcmp (name, "menu_pixmap_style") == 0) { self->need_to_recreate_boxes = 1; - grub_free (self->menu_box_pattern); - self->menu_box_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->menu_box_pattern); + self->menu_box_pattern = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "item_pixmap_style") == 0) + else if (VasEBoot_strcmp (name, "item_pixmap_style") == 0) { self->need_to_recreate_boxes = 1; - grub_free (self->item_box_pattern); - self->item_box_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->item_box_pattern); + self->item_box_pattern = value ? VasEBoot_strdup (value) : 0; if (self->selected_item_box_pattern_inherit) { - grub_free (self->selected_item_box_pattern); - self->selected_item_box_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->selected_item_box_pattern); + self->selected_item_box_pattern = value ? VasEBoot_strdup (value) : 0; } } - else if (grub_strcmp (name, "selected_item_pixmap_style") == 0) + else if (VasEBoot_strcmp (name, "selected_item_pixmap_style") == 0) { - if (!value || grub_strcmp (value, "inherit") == 0) + if (!value || VasEBoot_strcmp (value, "inherit") == 0) { - grub_free (self->selected_item_box_pattern); + VasEBoot_free (self->selected_item_box_pattern); char *tmp = self->item_box_pattern; - self->selected_item_box_pattern = tmp ? grub_strdup (tmp) : 0; + self->selected_item_box_pattern = tmp ? VasEBoot_strdup (tmp) : 0; self->selected_item_box_pattern_inherit = 1; } else { self->need_to_recreate_boxes = 1; - grub_free (self->selected_item_box_pattern); - self->selected_item_box_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->selected_item_box_pattern); + self->selected_item_box_pattern = value ? VasEBoot_strdup (value) : 0; self->selected_item_box_pattern_inherit = 0; } } - else if (grub_strcmp (name, "scrollbar_frame") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_frame") == 0) { self->need_to_recreate_scrollbar = 1; - grub_free (self->scrollbar_frame_pattern); - self->scrollbar_frame_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->scrollbar_frame_pattern); + self->scrollbar_frame_pattern = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "scrollbar_thumb") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_thumb") == 0) { self->need_to_recreate_scrollbar = 1; - grub_free (self->scrollbar_thumb_pattern); - self->scrollbar_thumb_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->scrollbar_thumb_pattern); + self->scrollbar_thumb_pattern = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "scrollbar_thumb_overlay") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_thumb_overlay") == 0) { - self->scrollbar_thumb_overlay = grub_strcmp (value, "true") == 0; + self->scrollbar_thumb_overlay = VasEBoot_strcmp (value, "true") == 0; } - else if (grub_strcmp (name, "scrollbar_width") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_width") == 0) { - self->scrollbar_width = grub_strtol (value, 0, 10); + self->scrollbar_width = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "scrollbar_slice") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_slice") == 0) { - if (grub_strcmp (value, "west") == 0) + if (VasEBoot_strcmp (value, "west") == 0) self->scrollbar_slice = SCROLLBAR_SLICE_WEST; - else if (grub_strcmp (value, "center") == 0) + else if (VasEBoot_strcmp (value, "center") == 0) self->scrollbar_slice = SCROLLBAR_SLICE_CENTER; - else if (grub_strcmp (value, "east") == 0) + else if (VasEBoot_strcmp (value, "east") == 0) self->scrollbar_slice = SCROLLBAR_SLICE_EAST; } - else if (grub_strcmp (name, "scrollbar_left_pad") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_left_pad") == 0) { - self->scrollbar_left_pad = grub_strtol (value, 0, 10); + self->scrollbar_left_pad = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "scrollbar_right_pad") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_right_pad") == 0) { - self->scrollbar_right_pad = grub_strtol (value, 0, 10); + self->scrollbar_right_pad = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "scrollbar_top_pad") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_top_pad") == 0) { - self->scrollbar_top_pad = grub_strtol (value, 0, 10); + self->scrollbar_top_pad = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "scrollbar_bottom_pad") == 0) + else if (VasEBoot_strcmp (name, "scrollbar_bottom_pad") == 0) { - self->scrollbar_bottom_pad = grub_strtol (value, 0, 10); + self->scrollbar_bottom_pad = VasEBoot_strtol (value, 0, 10); } - else if (grub_strcmp (name, "scrollbar") == 0) + else if (VasEBoot_strcmp (name, "scrollbar") == 0) { - self->draw_scrollbar = grub_strcmp (value, "false") != 0; + self->draw_scrollbar = VasEBoot_strcmp (value, "false") != 0; } - else if (grub_strcmp (name, "theme_dir") == 0) + else if (VasEBoot_strcmp (name, "theme_dir") == 0) { self->need_to_recreate_boxes = 1; - grub_free (self->theme_dir); - self->theme_dir = value ? grub_strdup (value) : 0; + VasEBoot_free (self->theme_dir); + self->theme_dir = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "id") == 0) + else if (VasEBoot_strcmp (name, "id") == 0) { - grub_free (self->id); + VasEBoot_free (self->id); if (value) - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); else self->id = 0; } - return grub_errno; + return VasEBoot_errno; } /* Set necessary information that the gfxmenu view provides. */ static void list_set_view_info (void *vself, - grub_gfxmenu_view_t view) + VasEBoot_gfxmenu_view_t view) { list_impl_t self = vself; - grub_gfxmenu_icon_manager_set_theme_path (self->icon_manager, + VasEBoot_gfxmenu_icon_manager_set_theme_path (self->icon_manager, view->theme_path); self->view = view; } @@ -855,14 +855,14 @@ list_set_view_info (void *vself, /* Refresh list variables */ static void list_refresh_info (void *vself, - grub_gfxmenu_view_t view) + VasEBoot_gfxmenu_view_t view) { list_impl_t self = vself; if (view->nested) self->first_shown_index = 0; } -static struct grub_gui_component_ops list_comp_ops = +static struct VasEBoot_gui_component_ops list_comp_ops = { .destroy = list_destroy, .get_id = list_get_id, @@ -876,20 +876,20 @@ static struct grub_gui_component_ops list_comp_ops = .set_property = list_set_property }; -static struct grub_gui_list_ops list_ops = +static struct VasEBoot_gui_list_ops list_ops = { .set_view_info = list_set_view_info, .refresh_list = list_refresh_info }; -grub_gui_component_t -grub_gui_list_new (void) +VasEBoot_gui_component_t +VasEBoot_gui_list_new (void) { list_impl_t self; - grub_font_t default_font; - grub_video_rgba_color_t default_fg_color; + VasEBoot_font_t default_font; + VasEBoot_video_rgba_color_t default_fg_color; - self = grub_zalloc (sizeof (*self)); + self = VasEBoot_zalloc (sizeof (*self)); if (! self) return 0; @@ -898,8 +898,8 @@ grub_gui_list_new (void) self->visible = 1; - default_font = grub_font_get ("Unknown Regular 16"); - default_fg_color = grub_video_rgba_color_rgb (0, 0, 0); + default_font = VasEBoot_font_get ("Unknown Regular 16"); + default_fg_color = VasEBoot_video_rgba_color_rgb (0, 0, 0); self->icon_width = 32; self->icon_height = 32; @@ -936,18 +936,18 @@ grub_gui_list_new (void) self->item_box_pattern = 0; self->selected_item_box_pattern_inherit = 1;/*Default to using the item_box.*/ self->selected_item_box_pattern = 0; - self->menu_box = grub_gfxmenu_create_box (0, 0); - self->item_box = grub_gfxmenu_create_box (0, 0); - self->selected_item_box = grub_gfxmenu_create_box (0, 0); + self->menu_box = VasEBoot_gfxmenu_create_box (0, 0); + self->item_box = VasEBoot_gfxmenu_create_box (0, 0); + self->selected_item_box = VasEBoot_gfxmenu_create_box (0, 0); - self->icon_manager = grub_gfxmenu_icon_manager_new (); + self->icon_manager = VasEBoot_gfxmenu_icon_manager_new (); if (! self->icon_manager) { self->list.component.ops->destroy (self); return 0; } - grub_gfxmenu_icon_manager_set_icon_size (self->icon_manager, + VasEBoot_gfxmenu_icon_manager_set_icon_size (self->icon_manager, self->icon_width, self->icon_height); - return (grub_gui_component_t) self; + return (VasEBoot_gui_component_t) self; } diff --git a/VasEBoot-core/gfxmenu/gui_progress_bar.c b/VasEBoot-core/gfxmenu/gui_progress_bar.c index b128f0866..36afbf566 100644 --- a/VasEBoot-core/gfxmenu/gui_progress_bar.c +++ b/VasEBoot-core/gfxmenu/gui_progress_bar.c @@ -1,98 +1,98 @@ /* gui_progress_bar.c - GUI progress bar component. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -struct grub_gui_progress_bar +struct VasEBoot_gui_progress_bar { - struct grub_gui_progress progress; + struct VasEBoot_gui_progress progress; - grub_gui_container_t parent; - grub_video_rect_t bounds; + VasEBoot_gui_container_t parent; + VasEBoot_video_rect_t bounds; char *id; int visible; int start; int end; int value; char *template; - grub_font_t font; - grub_video_rgba_color_t text_color; - grub_video_rgba_color_t border_color; - grub_video_rgba_color_t bg_color; - grub_video_rgba_color_t fg_color; + VasEBoot_font_t font; + VasEBoot_video_rgba_color_t text_color; + VasEBoot_video_rgba_color_t border_color; + VasEBoot_video_rgba_color_t bg_color; + VasEBoot_video_rgba_color_t fg_color; char *theme_dir; int need_to_recreate_pixmaps; int pixmapbar_available; char *bar_pattern; char *highlight_pattern; - grub_gfxmenu_box_t bar_box; - grub_gfxmenu_box_t highlight_box; + VasEBoot_gfxmenu_box_t bar_box; + VasEBoot_gfxmenu_box_t highlight_box; int highlight_overlay; }; -typedef struct grub_gui_progress_bar *grub_gui_progress_bar_t; +typedef struct VasEBoot_gui_progress_bar *VasEBoot_gui_progress_bar_t; static void progress_bar_destroy (void *vself) { - grub_gui_progress_bar_t self = vself; - grub_free (self->theme_dir); - grub_free (self->template); - grub_free (self->id); - grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self); - grub_free (self); + VasEBoot_gui_progress_bar_t self = vself; + VasEBoot_free (self->theme_dir); + VasEBoot_free (self->template); + VasEBoot_free (self->id); + VasEBoot_gfxmenu_timeout_unregister ((VasEBoot_gui_component_t) self); + VasEBoot_free (self); } static const char * progress_bar_get_id (void *vself) { - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; return self->id; } static int progress_bar_is_instance (void *vself __attribute__((unused)), const char *type) { - return grub_strcmp (type, "component") == 0; + return VasEBoot_strcmp (type, "component") == 0; } static int -check_pixmaps (grub_gui_progress_bar_t self) +check_pixmaps (VasEBoot_gui_progress_bar_t self) { if (!self->pixmapbar_available) return 0; if (self->need_to_recreate_pixmaps) { - grub_gui_recreate_box (&self->bar_box, + VasEBoot_gui_recreate_box (&self->bar_box, self->bar_pattern, self->theme_dir); - grub_gui_recreate_box (&self->highlight_box, + VasEBoot_gui_recreate_box (&self->highlight_box, self->highlight_pattern, self->theme_dir); @@ -103,17 +103,17 @@ check_pixmaps (grub_gui_progress_bar_t self) } static void -draw_filled_rect_bar (grub_gui_progress_bar_t self) +draw_filled_rect_bar (VasEBoot_gui_progress_bar_t self) { /* Set the progress bar's frame. */ - grub_video_rect_t f; + VasEBoot_video_rect_t f; f.x = 1; f.y = 1; f.width = self->bounds.width - 2; f.height = self->bounds.height - 2; /* Border. */ - grub_video_fill_rect (grub_video_map_rgba_color (self->border_color), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgba_color (self->border_color), f.x - 1, f.y - 1, f.width + 2, f.height + 2); @@ -127,21 +127,21 @@ draw_filled_rect_bar (grub_gui_progress_bar_t self) barwidth = (f.width * (self->value - self->start) / (self->end - self->start)); - grub_video_fill_rect (grub_video_map_rgba_color (self->bg_color), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgba_color (self->bg_color), f.x + barwidth, f.y, f.width - barwidth, f.height); /* Bar foreground. */ - grub_video_fill_rect (grub_video_map_rgba_color (self->fg_color), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgba_color (self->fg_color), f.x, f.y, barwidth, f.height); } static void -draw_pixmap_bar (grub_gui_progress_bar_t self) +draw_pixmap_bar (VasEBoot_gui_progress_bar_t self) { - grub_gfxmenu_box_t bar = self->bar_box; - grub_gfxmenu_box_t hl = self->highlight_box; + VasEBoot_gfxmenu_box_t bar = self->bar_box; + VasEBoot_gfxmenu_box_t hl = self->highlight_box; int w = self->bounds.width; int h = self->bounds.height; int bar_l_pad = bar->get_left_pad (bar); @@ -192,51 +192,51 @@ draw_pixmap_bar (grub_gui_progress_bar_t self) #pragma GCC diagnostic ignored "-Wformat-nonliteral" static void -draw_text (grub_gui_progress_bar_t self) +draw_text (VasEBoot_gui_progress_bar_t self) { if (self->template) { - grub_font_t font = self->font; - grub_video_color_t text_color = - grub_video_map_rgba_color (self->text_color); + VasEBoot_font_t font = self->font; + VasEBoot_video_color_t text_color = + VasEBoot_video_map_rgba_color (self->text_color); int width = self->bounds.width; int height = self->bounds.height; char *text; - text = grub_xasprintf (self->template, + text = VasEBoot_xasprintf (self->template, self->value > 0 ? self->value : -self->value); if (!text) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } /* Center the text. */ - int text_width = grub_font_get_string_width (font, text); + int text_width = VasEBoot_font_get_string_width (font, text); int x = (width - text_width) / 2; - int y = ((height - grub_font_get_descent (font)) / 2 - + grub_font_get_ascent (font) / 2); - grub_font_draw_string (text, font, text_color, x, y); - grub_free (text); + int y = ((height - VasEBoot_font_get_descent (font)) / 2 + + VasEBoot_font_get_ascent (font) / 2); + VasEBoot_font_draw_string (text, font, text_color, x, y); + VasEBoot_free (text); } } #pragma GCC diagnostic error "-Wformat-nonliteral" static void -progress_bar_paint (void *vself, const grub_video_rect_t *region) +progress_bar_paint (void *vself, const VasEBoot_video_rect_t *region) { - grub_gui_progress_bar_t self = vself; - grub_video_rect_t vpsave; + VasEBoot_gui_progress_bar_t self = vself; + VasEBoot_video_rect_t vpsave; if (! self->visible) return; - if (!grub_video_have_common_points (region, &self->bounds)) + if (!VasEBoot_video_have_common_points (region, &self->bounds)) return; if (self->end == self->start) return; - grub_gui_set_viewport (&self->bounds, &vpsave); + VasEBoot_gui_set_viewport (&self->bounds, &vpsave); if (check_pixmaps (self)) draw_pixmap_bar (self); @@ -245,34 +245,34 @@ progress_bar_paint (void *vself, const grub_video_rect_t *region) draw_text (self); - grub_gui_restore_viewport (&vpsave); + VasEBoot_gui_restore_viewport (&vpsave); } static void -progress_bar_set_parent (void *vself, grub_gui_container_t parent) +progress_bar_set_parent (void *vself, VasEBoot_gui_container_t parent) { - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; self->parent = parent; } -static grub_gui_container_t +static VasEBoot_gui_container_t progress_bar_get_parent (void *vself) { - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; return self->parent; } static void -progress_bar_set_bounds (void *vself, const grub_video_rect_t *bounds) +progress_bar_set_bounds (void *vself, const VasEBoot_video_rect_t *bounds) { - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; self->bounds = *bounds; } static void -progress_bar_get_bounds (void *vself, grub_video_rect_t *bounds) +progress_bar_get_bounds (void *vself, VasEBoot_video_rect_t *bounds) { - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; *bounds = self->bounds; } @@ -282,19 +282,19 @@ progress_bar_get_minimal_size (void *vself, { unsigned min_width = 0; unsigned min_height = 0; - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; if (self->template) { - min_width = grub_font_get_string_width (self->font, self->template); - min_width += grub_font_get_string_width (self->font, "XXXXXXXXXX"); - min_height = grub_font_get_descent (self->font) - + grub_font_get_ascent (self->font); + min_width = VasEBoot_font_get_string_width (self->font, self->template); + min_width += VasEBoot_font_get_string_width (self->font, "XXXXXXXXXX"); + min_height = VasEBoot_font_get_descent (self->font) + + VasEBoot_font_get_ascent (self->font); } if (check_pixmaps (self)) { - grub_gfxmenu_box_t bar = self->bar_box; - grub_gfxmenu_box_t hl = self->highlight_box; + VasEBoot_gfxmenu_box_t bar = self->bar_box; + VasEBoot_gfxmenu_box_t hl = self->highlight_box; min_width += bar->get_left_pad (bar) + bar->get_right_pad (bar); min_height += bar->get_top_pad (bar) + bar->get_bottom_pad (bar); if (!self->highlight_overlay) @@ -320,97 +320,97 @@ static void progress_bar_set_state (void *vself, int visible, int start, int current, int end) { - grub_gui_progress_bar_t self = vself; + VasEBoot_gui_progress_bar_t self = vself; self->visible = visible; self->start = start; self->value = current; self->end = end; } -static grub_err_t +static VasEBoot_err_t progress_bar_set_property (void *vself, const char *name, const char *value) { - grub_gui_progress_bar_t self = vself; - if (grub_strcmp (name, "text") == 0) + VasEBoot_gui_progress_bar_t self = vself; + if (VasEBoot_strcmp (name, "text") == 0) { - grub_free (self->template); - if (grub_strcmp (value, "@TIMEOUT_NOTIFICATION_LONG@") == 0) + VasEBoot_free (self->template); + if (VasEBoot_strcmp (value, "@TIMEOUT_NOTIFICATION_LONG@") == 0) value = _("The highlighted entry will be executed automatically in %ds."); - else if (grub_strcmp (value, "@TIMEOUT_NOTIFICATION_MIDDLE@") == 0) + else if (VasEBoot_strcmp (value, "@TIMEOUT_NOTIFICATION_MIDDLE@") == 0) /* TRANSLATORS: 's' stands for seconds. It's a standalone timeout notification. Please use the short form in your language. */ value = _("%ds remaining."); - else if (grub_strcmp (value, "@TIMEOUT_NOTIFICATION_SHORT@") == 0) + else if (VasEBoot_strcmp (value, "@TIMEOUT_NOTIFICATION_SHORT@") == 0) /* TRANSLATORS: 's' stands for seconds. It's a standalone timeout notification. Please use the shortest form available in you language. */ value = _("%ds"); - self->template = grub_strdup (value); + self->template = VasEBoot_strdup (value); } - else if (grub_strcmp (name, "font") == 0) + else if (VasEBoot_strcmp (name, "font") == 0) { - self->font = grub_font_get (value); + self->font = VasEBoot_font_get (value); } - else if (grub_strcmp (name, "text_color") == 0) + else if (VasEBoot_strcmp (name, "text_color") == 0) { - grub_video_parse_color (value, &self->text_color); + VasEBoot_video_parse_color (value, &self->text_color); } - else if (grub_strcmp (name, "border_color") == 0) + else if (VasEBoot_strcmp (name, "border_color") == 0) { - grub_video_parse_color (value, &self->border_color); + VasEBoot_video_parse_color (value, &self->border_color); } - else if (grub_strcmp (name, "bg_color") == 0) + else if (VasEBoot_strcmp (name, "bg_color") == 0) { - grub_video_parse_color (value, &self->bg_color); + VasEBoot_video_parse_color (value, &self->bg_color); } - else if (grub_strcmp (name, "fg_color") == 0) + else if (VasEBoot_strcmp (name, "fg_color") == 0) { - grub_video_parse_color (value, &self->fg_color); + VasEBoot_video_parse_color (value, &self->fg_color); } - else if (grub_strcmp (name, "bar_style") == 0) + else if (VasEBoot_strcmp (name, "bar_style") == 0) { self->need_to_recreate_pixmaps = 1; self->pixmapbar_available = 1; - grub_free (self->bar_pattern); - self->bar_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->bar_pattern); + self->bar_pattern = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "highlight_style") == 0) + else if (VasEBoot_strcmp (name, "highlight_style") == 0) { self->need_to_recreate_pixmaps = 1; self->pixmapbar_available = 1; - grub_free (self->highlight_pattern); - self->highlight_pattern = value ? grub_strdup (value) : 0; + VasEBoot_free (self->highlight_pattern); + self->highlight_pattern = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "highlight_overlay") == 0) + else if (VasEBoot_strcmp (name, "highlight_overlay") == 0) { - self->highlight_overlay = grub_strcmp (value, "true") == 0; + self->highlight_overlay = VasEBoot_strcmp (value, "true") == 0; } - else if (grub_strcmp (name, "theme_dir") == 0) + else if (VasEBoot_strcmp (name, "theme_dir") == 0) { self->need_to_recreate_pixmaps = 1; - grub_free (self->theme_dir); - self->theme_dir = value ? grub_strdup (value) : 0; + VasEBoot_free (self->theme_dir); + self->theme_dir = value ? VasEBoot_strdup (value) : 0; } - else if (grub_strcmp (name, "id") == 0) + else if (VasEBoot_strcmp (name, "id") == 0) { - grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self); - grub_free (self->id); + VasEBoot_gfxmenu_timeout_unregister ((VasEBoot_gui_component_t) self); + VasEBoot_free (self->id); if (value) - self->id = grub_strdup (value); + self->id = VasEBoot_strdup (value); else self->id = 0; - if (self->id && grub_strcmp (self->id, GRUB_GFXMENU_TIMEOUT_COMPONENT_ID) + if (self->id && VasEBoot_strcmp (self->id, VasEBoot_GFXMENU_TIMEOUT_COMPONENT_ID) == 0) - grub_gfxmenu_timeout_register ((grub_gui_component_t) self, + VasEBoot_gfxmenu_timeout_register ((VasEBoot_gui_component_t) self, progress_bar_set_state); } - return grub_errno; + return VasEBoot_errno; } -static struct grub_gui_component_ops progress_bar_ops = +static struct VasEBoot_gui_component_ops progress_bar_ops = { .destroy = progress_bar_destroy, .get_id = progress_bar_get_id, @@ -424,31 +424,31 @@ static struct grub_gui_component_ops progress_bar_ops = .set_property = progress_bar_set_property }; -static struct grub_gui_progress_ops progress_bar_pb_ops = +static struct VasEBoot_gui_progress_ops progress_bar_pb_ops = { .set_state = progress_bar_set_state }; -grub_gui_component_t -grub_gui_progress_bar_new (void) +VasEBoot_gui_component_t +VasEBoot_gui_progress_bar_new (void) { - grub_gui_progress_bar_t self; - self = grub_zalloc (sizeof (*self)); + VasEBoot_gui_progress_bar_t self; + self = VasEBoot_zalloc (sizeof (*self)); if (! self) return 0; self->progress.ops = &progress_bar_pb_ops; self->progress.component.ops = &progress_bar_ops; self->visible = 1; - self->font = grub_font_get ("Unknown Regular 16"); - grub_video_rgba_color_t black = { .red = 0, .green = 0, .blue = 0, .alpha = 255 }; - grub_video_rgba_color_t gray = { .red = 128, .green = 128, .blue = 128, .alpha = 255 }; - grub_video_rgba_color_t lightgray = { .red = 200, .green = 200, .blue = 200, .alpha = 255 }; + self->font = VasEBoot_font_get ("Unknown Regular 16"); + VasEBoot_video_rgba_color_t black = { .red = 0, .green = 0, .blue = 0, .alpha = 255 }; + VasEBoot_video_rgba_color_t gray = { .red = 128, .green = 128, .blue = 128, .alpha = 255 }; + VasEBoot_video_rgba_color_t lightgray = { .red = 200, .green = 200, .blue = 200, .alpha = 255 }; self->text_color = black; self->border_color = black; self->bg_color = gray; self->fg_color = lightgray; self->highlight_overlay = 0; - return (grub_gui_component_t) self; + return (VasEBoot_gui_component_t) self; } diff --git a/VasEBoot-core/gfxmenu/gui_string_util.c b/VasEBoot-core/gfxmenu/gui_string_util.c index a9a415e31..12f28ea8e 100644 --- a/VasEBoot-core/gfxmenu/gui_string_util.c +++ b/VasEBoot-core/gfxmenu/gui_string_util.c @@ -1,41 +1,41 @@ /* gui_string_util.c - String utilities used by the GUI system. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* Create a new NUL-terminated string on the heap as a substring of BUF. The range of buf included is the half-open interval [START,END). The index START is inclusive, END is exclusive. */ char * -grub_new_substring (const char *buf, - grub_size_t start, grub_size_t end) +VasEBoot_new_substring (const char *buf, + VasEBoot_size_t start, VasEBoot_size_t end) { if (end < start) return 0; - grub_size_t len = end - start; - char *s = grub_malloc (len + 1); + VasEBoot_size_t len = end - start; + char *s = VasEBoot_malloc (len + 1); if (! s) return 0; - grub_memcpy (s, buf + start, len); + VasEBoot_memcpy (s, buf + start, len); s[len] = '\0'; return s; } @@ -55,12 +55,12 @@ canonicalize_path (const char *path) if (*p == '/') components++; - char **path_array = grub_malloc (components * sizeof (*path_array)); + char **path_array = VasEBoot_malloc (components * sizeof (*path_array)); if (! path_array) return 0; /* Initialize array elements to NULL pointers; in case once of the - allocations fails, the cleanup code can just call grub_free() for all + allocations fails, the cleanup code can just call VasEBoot_free() for all pointers in the array. */ for (i = 0; i < components; i++) path_array[i] = 0; @@ -70,12 +70,12 @@ canonicalize_path (const char *path) for (i = 0; i < components && p; i++) { /* Find the end of the path element. */ - const char *end = grub_strchr (p, '/'); + const char *end = VasEBoot_strchr (p, '/'); if (!end) - end = p + grub_strlen (p); + end = p + VasEBoot_strlen (p); /* Copy the element. */ - path_array[i] = grub_new_substring (p, 0, end - p); + path_array[i] = VasEBoot_new_substring (p, 0, end - p); if (! path_array[i]) goto cleanup; @@ -90,29 +90,29 @@ canonicalize_path (const char *path) int newpath_length = 0; for (i = components - 1; i >= 0; --i) { - if (! grub_strcmp (path_array[i], ".")) + if (! VasEBoot_strcmp (path_array[i], ".")) { - grub_free (path_array[i]); + VasEBoot_free (path_array[i]); path_array[i] = 0; } - else if (! grub_strcmp (path_array[i], "..") + else if (! VasEBoot_strcmp (path_array[i], "..") && i > 0) { /* Delete the '..' and the prior path element. */ - grub_free (path_array[i]); + VasEBoot_free (path_array[i]); path_array[i] = 0; --i; - grub_free (path_array[i]); + VasEBoot_free (path_array[i]); path_array[i] = 0; } else { - newpath_length += grub_strlen (path_array[i]) + 1; + newpath_length += VasEBoot_strlen (path_array[i]) + 1; } } /* Construct a new path string. */ - newpath = grub_malloc (newpath_length + 1); + newpath = VasEBoot_malloc (newpath_length + 1); if (! newpath) goto cleanup; @@ -126,16 +126,16 @@ canonicalize_path (const char *path) { /* For all components but the first, prefix with a slash. */ if (! first) - newpath_end = grub_stpcpy (newpath_end, "/"); - newpath_end = grub_stpcpy (newpath_end, element); + newpath_end = VasEBoot_stpcpy (newpath_end, "/"); + newpath_end = VasEBoot_stpcpy (newpath_end, element); first = 0; } } cleanup: for (i = 0; i < components; i++) - grub_free (path_array[i]); - grub_free (path_array); + VasEBoot_free (path_array[i]); + VasEBoot_free (path_array); return newpath; } @@ -145,53 +145,53 @@ cleanup: the returned path is a copy of PATH. If PATH is a relative path, then BASE is with PATH used to construct the absolute path. */ char * -grub_resolve_relative_path (const char *base, const char *path) +VasEBoot_resolve_relative_path (const char *base, const char *path) { char *abspath; char *canonpath; char *p; - grub_size_t l; + VasEBoot_size_t l; /* If PATH is an absolute path, then just use it as is. */ if (path[0] == '/' || path[0] == '(') return canonicalize_path (path); - abspath = grub_malloc (grub_strlen (base) + grub_strlen (path) + 3); + abspath = VasEBoot_malloc (VasEBoot_strlen (base) + VasEBoot_strlen (path) + 3); if (! abspath) return 0; /* Concatenate BASE and PATH. */ - p = grub_stpcpy (abspath, base); - l = grub_strlen (abspath); + p = VasEBoot_stpcpy (abspath, base); + l = VasEBoot_strlen (abspath); if (l == 0 || abspath[l-1] != '/') { *p = '/'; p++; *p = 0; } - grub_stpcpy (p, path); + VasEBoot_stpcpy (p, path); canonpath = canonicalize_path (abspath); if (! canonpath) return abspath; - grub_free (abspath); + VasEBoot_free (abspath); return canonpath; } /* Get the path of the directory where the file at FILE_PATH is located. FILE_PATH should refer to a file, not a directory. The returned path includes a trailing slash. - This does not handle GRUB "(hd0,0)" paths properly yet since it only + This does not handle VasEBoot "(hd0,0)" paths properly yet since it only looks at slashes. */ char * -grub_get_dirname (const char *file_path) +VasEBoot_get_dirname (const char *file_path) { int i; int last_slash; last_slash = -1; - for (i = grub_strlen (file_path) - 1; i >= 0; --i) + for (i = VasEBoot_strlen (file_path) - 1; i >= 0; --i) { if (file_path[i] == '/') { @@ -200,7 +200,7 @@ grub_get_dirname (const char *file_path) } } if (last_slash == -1) - return grub_strdup ("/"); + return VasEBoot_strdup ("/"); - return grub_new_substring (file_path, 0, last_slash + 1); + return VasEBoot_new_substring (file_path, 0, last_slash + 1); } diff --git a/VasEBoot-core/gfxmenu/gui_util.c b/VasEBoot-core/gfxmenu/gui_util.c index eba7bb39e..bea208224 100644 --- a/VasEBoot-core/gfxmenu/gui_util.c +++ b/VasEBoot-core/gfxmenu/gui_util.c @@ -1,50 +1,50 @@ /* gui_util.c - GUI utility functions. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include struct find_by_id_state { const char *match_id; - grub_gui_component_callback match_callback; + VasEBoot_gui_component_callback match_callback; void *match_userdata; }; static void -find_by_id_recursively (grub_gui_component_t component, void *userdata) +find_by_id_recursively (VasEBoot_gui_component_t component, void *userdata) { struct find_by_id_state *state; const char *id; state = (struct find_by_id_state *) userdata; id = component->ops->get_id (component); - if (id && grub_strcmp (id, state->match_id) == 0) + if (id && VasEBoot_strcmp (id, state->match_id) == 0) state->match_callback (component, state->match_userdata); if (component->ops->is_instance (component, "container")) { - grub_gui_container_t container; - container = (grub_gui_container_t) component; + VasEBoot_gui_container_t container; + container = (VasEBoot_gui_container_t) component; container->ops->iterate_children (container, find_by_id_recursively, state); @@ -52,9 +52,9 @@ find_by_id_recursively (grub_gui_component_t component, void *userdata) } void -grub_gui_find_by_id (grub_gui_component_t root, +VasEBoot_gui_find_by_id (VasEBoot_gui_component_t root, const char *id, - grub_gui_component_callback cb, + VasEBoot_gui_component_callback cb, void *userdata) { struct find_by_id_state state; @@ -67,12 +67,12 @@ grub_gui_find_by_id (grub_gui_component_t root, struct iterate_recursively_state { - grub_gui_component_callback callback; + VasEBoot_gui_component_callback callback; void *userdata; }; static -void iterate_recursively_cb (grub_gui_component_t component, void *userdata) +void iterate_recursively_cb (VasEBoot_gui_component_t component, void *userdata) { struct iterate_recursively_state *state; @@ -81,8 +81,8 @@ void iterate_recursively_cb (grub_gui_component_t component, void *userdata) if (component->ops->is_instance (component, "container")) { - grub_gui_container_t container; - container = (grub_gui_container_t) component; + VasEBoot_gui_container_t container; + container = (VasEBoot_gui_container_t) component; container->ops->iterate_children (container, iterate_recursively_cb, state); @@ -90,8 +90,8 @@ void iterate_recursively_cb (grub_gui_component_t component, void *userdata) } void -grub_gui_iterate_recursively (grub_gui_component_t root, - grub_gui_component_callback cb, +VasEBoot_gui_iterate_recursively (VasEBoot_gui_component_t root, + VasEBoot_gui_component_callback cb, void *userdata) { struct iterate_recursively_state state; diff --git a/VasEBoot-core/gfxmenu/icon_manager.c b/VasEBoot-core/gfxmenu/icon_manager.c index 1894682ef..21ee10596 100644 --- a/VasEBoot-core/gfxmenu/icon_manager.c +++ b/VasEBoot-core/gfxmenu/icon_manager.c @@ -1,32 +1,32 @@ /* icon_manager.c - gfxmenu icon manager. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Currently hard coded to '.png' extension. */ static const char icon_extension[] = ".png"; @@ -34,11 +34,11 @@ static const char icon_extension[] = ".png"; typedef struct icon_entry { char *class_name; - struct grub_video_bitmap *bitmap; + struct VasEBoot_video_bitmap *bitmap; struct icon_entry *next; } *icon_entry_t; -struct grub_gfxmenu_icon_manager +struct VasEBoot_gfxmenu_icon_manager { char *theme_path; int icon_width; @@ -50,11 +50,11 @@ struct grub_gfxmenu_icon_manager /* Create a new icon manager and return a point to it. */ -grub_gfxmenu_icon_manager_t -grub_gfxmenu_icon_manager_new (void) +VasEBoot_gfxmenu_icon_manager_t +VasEBoot_gfxmenu_icon_manager_new (void) { - grub_gfxmenu_icon_manager_t mgr; - mgr = grub_malloc (sizeof (*mgr)); + VasEBoot_gfxmenu_icon_manager_t mgr; + mgr = VasEBoot_malloc (sizeof (*mgr)); if (! mgr) return 0; @@ -72,29 +72,29 @@ grub_gfxmenu_icon_manager_new (void) /* Destroy the icon manager MGR, freeing all resources used by it. -Note: Any bitmaps returned by grub_gfxmenu_icon_manager_get_icon() +Note: Any bitmaps returned by VasEBoot_gfxmenu_icon_manager_get_icon() are destroyed and must not be used by the caller after this function is called. */ void -grub_gfxmenu_icon_manager_destroy (grub_gfxmenu_icon_manager_t mgr) +VasEBoot_gfxmenu_icon_manager_destroy (VasEBoot_gfxmenu_icon_manager_t mgr) { - grub_gfxmenu_icon_manager_clear_cache (mgr); - grub_free (mgr->theme_path); - grub_free (mgr); + VasEBoot_gfxmenu_icon_manager_clear_cache (mgr); + VasEBoot_free (mgr->theme_path); + VasEBoot_free (mgr); } /* Clear the icon cache. */ void -grub_gfxmenu_icon_manager_clear_cache (grub_gfxmenu_icon_manager_t mgr) +VasEBoot_gfxmenu_icon_manager_clear_cache (VasEBoot_gfxmenu_icon_manager_t mgr) { icon_entry_t cur; icon_entry_t next; for (cur = mgr->cache.next; cur; cur = next) { next = cur->next; - grub_free (cur->class_name); - grub_video_bitmap_destroy (cur->bitmap); - grub_free (cur); + VasEBoot_free (cur->class_name); + VasEBoot_video_bitmap_destroy (cur->bitmap); + VasEBoot_free (cur); } mgr->cache.next = 0; } @@ -102,31 +102,31 @@ grub_gfxmenu_icon_manager_clear_cache (grub_gfxmenu_icon_manager_t mgr) /* Set the theme path. If the theme path is changed, the icon cache is cleared. */ void -grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr, +VasEBoot_gfxmenu_icon_manager_set_theme_path (VasEBoot_gfxmenu_icon_manager_t mgr, const char *path) { /* Clear the cache if the theme path has changed. */ if (mgr->theme_path == 0 && path == 0) return; if (mgr->theme_path == 0 || path == 0 - || grub_strcmp (mgr->theme_path, path) != 0) - grub_gfxmenu_icon_manager_clear_cache (mgr); + || VasEBoot_strcmp (mgr->theme_path, path) != 0) + VasEBoot_gfxmenu_icon_manager_clear_cache (mgr); - grub_free (mgr->theme_path); - mgr->theme_path = path ? grub_strdup (path) : 0; + VasEBoot_free (mgr->theme_path); + mgr->theme_path = path ? VasEBoot_strdup (path) : 0; } /* Set the icon size. When icons are requested from the icon manager, they are scaled to this size before being returned. If the size is changed, the icon cache is cleared. */ void -grub_gfxmenu_icon_manager_set_icon_size (grub_gfxmenu_icon_manager_t mgr, +VasEBoot_gfxmenu_icon_manager_set_icon_size (VasEBoot_gfxmenu_icon_manager_t mgr, int width, int height) { /* If the width or height is changed, we must clear the cache, since the scaled bitmaps are stored in the cache. */ if (width != mgr->icon_width || height != mgr->icon_height) - grub_gfxmenu_icon_manager_clear_cache (mgr); + VasEBoot_gfxmenu_icon_manager_clear_cache (mgr); mgr->icon_width = width; mgr->icon_height = height; @@ -135,37 +135,37 @@ grub_gfxmenu_icon_manager_set_icon_size (grub_gfxmenu_icon_manager_t mgr, /* Try to load an icon for the specified CLASS_NAME in the directory DIR. Returns 0 if the icon could not be loaded, or returns a pointer to a new bitmap if it was successful. */ -static struct grub_video_bitmap * -try_loading_icon (grub_gfxmenu_icon_manager_t mgr, +static struct VasEBoot_video_bitmap * +try_loading_icon (VasEBoot_gfxmenu_icon_manager_t mgr, const char *dir, const char *class_name) { char *path, *ptr; - path = grub_malloc (grub_strlen (dir) + grub_strlen (class_name) - + grub_strlen (icon_extension) + 3); + path = VasEBoot_malloc (VasEBoot_strlen (dir) + VasEBoot_strlen (class_name) + + VasEBoot_strlen (icon_extension) + 3); if (! path) return 0; - ptr = grub_stpcpy (path, dir); + ptr = VasEBoot_stpcpy (path, dir); if (path == ptr || ptr[-1] != '/') *ptr++ = '/'; - ptr = grub_stpcpy (ptr, class_name); - ptr = grub_stpcpy (ptr, icon_extension); + ptr = VasEBoot_stpcpy (ptr, class_name); + ptr = VasEBoot_stpcpy (ptr, icon_extension); *ptr = '\0'; - struct grub_video_bitmap *raw_bitmap; - grub_video_bitmap_load (&raw_bitmap, path); - grub_free (path); - grub_errno = GRUB_ERR_NONE; /* Critical to clear the error!! */ + struct VasEBoot_video_bitmap *raw_bitmap; + VasEBoot_video_bitmap_load (&raw_bitmap, path); + VasEBoot_free (path); + VasEBoot_errno = VasEBoot_ERR_NONE; /* Critical to clear the error!! */ if (! raw_bitmap) return 0; - struct grub_video_bitmap *scaled_bitmap; - grub_video_bitmap_create_scaled (&scaled_bitmap, + struct VasEBoot_video_bitmap *scaled_bitmap; + VasEBoot_video_bitmap_create_scaled (&scaled_bitmap, mgr->icon_width, mgr->icon_height, raw_bitmap, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); - grub_video_bitmap_destroy (raw_bitmap); + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); + VasEBoot_video_bitmap_destroy (raw_bitmap); if (! scaled_bitmap) return 0; @@ -176,14 +176,14 @@ try_loading_icon (grub_gfxmenu_icon_manager_t mgr, CLASS_NAME already exists in the cache, then a reference to the cached bitmap is returned. If it is not cached, then it is loaded and cached. If no icon could be could for CLASS_NAME, then 0 is returned. */ -static struct grub_video_bitmap * -get_icon_by_class (grub_gfxmenu_icon_manager_t mgr, const char *class_name) +static struct VasEBoot_video_bitmap * +get_icon_by_class (VasEBoot_gfxmenu_icon_manager_t mgr, const char *class_name) { /* First check the icon cache. */ icon_entry_t entry; for (entry = mgr->cache.next; entry; entry = entry->next) { - if (grub_strcmp (entry->class_name, class_name) == 0) + if (VasEBoot_strcmp (entry->class_name, class_name) == 0) return entry->bitmap; } @@ -191,24 +191,24 @@ get_icon_by_class (grub_gfxmenu_icon_manager_t mgr, const char *class_name) return 0; /* Otherwise, we search for an icon to load. */ - char *theme_dir = grub_get_dirname (mgr->theme_path); + char *theme_dir = VasEBoot_get_dirname (mgr->theme_path); char *icons_dir; - struct grub_video_bitmap *icon; + struct VasEBoot_video_bitmap *icon; icon = 0; - /* First try the theme's own icons, from "grub/themes/NAME/icons/" */ - icons_dir = grub_resolve_relative_path (theme_dir, "icons/"); + /* First try the theme's own icons, from "VasEBoot/themes/NAME/icons/" */ + icons_dir = VasEBoot_resolve_relative_path (theme_dir, "icons/"); if (icons_dir) { icon = try_loading_icon (mgr, icons_dir, class_name); - grub_free (icons_dir); + VasEBoot_free (icons_dir); } - grub_free (theme_dir); + VasEBoot_free (theme_dir); if (! icon) { const char *icondir; - icondir = grub_env_get ("icondir"); + icondir = VasEBoot_env_get ("icondir"); if (icondir) icon = try_loading_icon (mgr, icondir, class_name); } @@ -220,13 +220,13 @@ get_icon_by_class (grub_gfxmenu_icon_manager_t mgr, const char *class_name) return 0; /* Insert a new cache entry for this icon. */ - entry = grub_malloc (sizeof (*entry)); + entry = VasEBoot_malloc (sizeof (*entry)); if (! entry) { - grub_video_bitmap_destroy (icon); + VasEBoot_video_bitmap_destroy (icon); return 0; } - entry->class_name = grub_strdup (class_name); + entry->class_name = VasEBoot_strdup (class_name); entry->bitmap = icon; entry->next = mgr->cache.next; mgr->cache.next = entry; /* Link it into the cache. */ @@ -237,17 +237,17 @@ get_icon_by_class (grub_gfxmenu_icon_manager_t mgr, const char *class_name) listed in the menu entry and proceeding forward, an icon for each class is searched for. The first icon found is returned. The returned icon is scaled to the size specified by - grub_gfxmenu_icon_manager_set_icon_size(). + VasEBoot_gfxmenu_icon_manager_set_icon_size(). Note: Bitmaps returned by this function are destroyed when the icon manager is destroyed. */ -struct grub_video_bitmap * -grub_gfxmenu_icon_manager_get_icon (grub_gfxmenu_icon_manager_t mgr, - grub_menu_entry_t entry) +struct VasEBoot_video_bitmap * +VasEBoot_gfxmenu_icon_manager_get_icon (VasEBoot_gfxmenu_icon_manager_t mgr, + VasEBoot_menu_entry_t entry) { - struct grub_menu_entry_class *c; - struct grub_video_bitmap *icon; + struct VasEBoot_menu_entry_class *c; + struct VasEBoot_video_bitmap *icon; /* Try each class in succession. */ icon = 0; diff --git a/VasEBoot-core/gfxmenu/theme_loader.c b/VasEBoot-core/gfxmenu/theme_loader.c index 02978392c..3e9cdf27d 100644 --- a/VasEBoot-core/gfxmenu/theme_loader.c +++ b/VasEBoot-core/gfxmenu/theme_loader.c @@ -1,78 +1,78 @@ /* theme_loader.c - Theme file loader for gfxmenu. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_err_t -parse_proportional_spec (const char *value, signed *abs, grub_fixed_signed_t *prop); +static VasEBoot_err_t +parse_proportional_spec (const char *value, signed *abs, VasEBoot_fixed_signed_t *prop); /* Construct a new box widget using ABSPATTERN to find the pixmap files for it, storing the new box instance at *BOXPTR. PATTERN should be of the form: "(hd0,0)/somewhere/style*.png". The '*' then gets substituted with the various pixmap names that the box uses. */ -static grub_err_t -recreate_box_absolute (grub_gfxmenu_box_t *boxptr, const char *abspattern) +static VasEBoot_err_t +recreate_box_absolute (VasEBoot_gfxmenu_box_t *boxptr, const char *abspattern) { char *prefix; char *suffix; char *star; - grub_gfxmenu_box_t box; + VasEBoot_gfxmenu_box_t box; - star = grub_strchr (abspattern, '*'); + star = VasEBoot_strchr (abspattern, '*'); if (! star) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "missing `*' in box pixmap pattern `%s'", abspattern); /* Prefix: Get the part before the '*'. */ - prefix = grub_malloc (star - abspattern + 1); + prefix = VasEBoot_malloc (star - abspattern + 1); if (! prefix) - return grub_errno; + return VasEBoot_errno; - grub_memcpy (prefix, abspattern, star - abspattern); + VasEBoot_memcpy (prefix, abspattern, star - abspattern); prefix[star - abspattern] = '\0'; /* Suffix: Everything after the '*' is the suffix. */ suffix = star + 1; - box = grub_gfxmenu_create_box (prefix, suffix); - grub_free (prefix); + box = VasEBoot_gfxmenu_create_box (prefix, suffix); + VasEBoot_free (prefix); if (! box) - return grub_errno; + return VasEBoot_errno; if (*boxptr) (*boxptr)->destroy (*boxptr); *boxptr = box; - return grub_errno; + return VasEBoot_errno; } @@ -83,10 +83,10 @@ recreate_box_absolute (grub_gfxmenu_box_t *boxptr, const char *abspattern) Important! The value of *BOXPTR must be initialized! It must either (1) Be 0 (a NULL pointer), or - (2) Be a pointer to a valid 'grub_gfxmenu_box_t' instance. + (2) Be a pointer to a valid 'VasEBoot_gfxmenu_box_t' instance. In this case, the previous instance is destroyed. */ -grub_err_t -grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr, +VasEBoot_err_t +VasEBoot_gui_recreate_box (VasEBoot_gfxmenu_box_t *boxptr, const char *pattern, const char *theme_dir) { char *abspattern; @@ -97,47 +97,47 @@ grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr, /* If no pixmap pattern is given, then just create an empty box. */ if (*boxptr) (*boxptr)->destroy (*boxptr); - *boxptr = grub_gfxmenu_create_box (0, 0); - return grub_errno; + *boxptr = VasEBoot_gfxmenu_create_box (0, 0); + return VasEBoot_errno; } if (! theme_dir) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "styled box missing theme directory"); /* Resolve to an absolute path. */ - abspattern = grub_resolve_relative_path (theme_dir, pattern); + abspattern = VasEBoot_resolve_relative_path (theme_dir, pattern); if (! abspattern) - return grub_errno; + return VasEBoot_errno; /* Create the box. */ recreate_box_absolute (boxptr, abspattern); - grub_free (abspattern); - return grub_errno; + VasEBoot_free (abspattern); + return VasEBoot_errno; } -static grub_err_t +static VasEBoot_err_t theme_get_unsigned_int_from_proportional (const char *value, unsigned absolute_value, unsigned int *parsed_value) { - grub_err_t err; - grub_fixed_signed_t frac; + VasEBoot_err_t err; + VasEBoot_fixed_signed_t frac; signed pixels; err = parse_proportional_spec (value, &pixels, &frac); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; - int result = grub_fixed_sfs_multiply (absolute_value, frac) + pixels; + int result = VasEBoot_fixed_sfs_multiply (absolute_value, frac) + pixels; if (result < 0) result = 0; *parsed_value = result; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Set the specified property NAME on the view to the given string VALUE. The caller is responsible for the lifetimes of NAME and VALUE. */ -static grub_err_t -theme_set_string (grub_gfxmenu_view_t view, +static VasEBoot_err_t +theme_set_string (VasEBoot_gfxmenu_view_t view, const char *name, const char *value, const char *theme_dir, @@ -145,156 +145,156 @@ theme_set_string (grub_gfxmenu_view_t view, int line_num, int col_num) { - if (! grub_strcmp ("title-font", name)) - view->title_font = grub_font_get (value); - else if (! grub_strcmp ("message-font", name)) - view->message_font = grub_font_get (value); - else if (! grub_strcmp ("terminal-font", name)) + if (! VasEBoot_strcmp ("title-font", name)) + view->title_font = VasEBoot_font_get (value); + else if (! VasEBoot_strcmp ("message-font", name)) + view->message_font = VasEBoot_font_get (value); + else if (! VasEBoot_strcmp ("terminal-font", name)) { - grub_free (view->terminal_font_name); - view->terminal_font_name = grub_strdup (value); + VasEBoot_free (view->terminal_font_name); + view->terminal_font_name = VasEBoot_strdup (value); if (! view->terminal_font_name) - return grub_errno; + return VasEBoot_errno; } - else if (! grub_strcmp ("title-color", name)) - grub_video_parse_color (value, &view->title_color); - else if (! grub_strcmp ("message-color", name)) - grub_video_parse_color (value, &view->message_color); - else if (! grub_strcmp ("message-bg-color", name)) - grub_video_parse_color (value, &view->message_bg_color); - else if (! grub_strcmp ("desktop-image", name)) + else if (! VasEBoot_strcmp ("title-color", name)) + VasEBoot_video_parse_color (value, &view->title_color); + else if (! VasEBoot_strcmp ("message-color", name)) + VasEBoot_video_parse_color (value, &view->message_color); + else if (! VasEBoot_strcmp ("message-bg-color", name)) + VasEBoot_video_parse_color (value, &view->message_bg_color); + else if (! VasEBoot_strcmp ("desktop-image", name)) { - struct grub_video_bitmap *raw_bitmap; + struct VasEBoot_video_bitmap *raw_bitmap; char *path; - path = grub_resolve_relative_path (theme_dir, value); + path = VasEBoot_resolve_relative_path (theme_dir, value); if (! path) - return grub_errno; - if (grub_video_bitmap_load (&raw_bitmap, path) != GRUB_ERR_NONE) + return VasEBoot_errno; + if (VasEBoot_video_bitmap_load (&raw_bitmap, path) != VasEBoot_ERR_NONE) { - grub_free (path); - return grub_errno; + VasEBoot_free (path); + return VasEBoot_errno; } - grub_free(path); - grub_video_bitmap_destroy (view->raw_desktop_image); + VasEBoot_free(path); + VasEBoot_video_bitmap_destroy (view->raw_desktop_image); view->raw_desktop_image = raw_bitmap; } - else if (! grub_strcmp ("desktop-image-scale-method", name)) + else if (! VasEBoot_strcmp ("desktop-image-scale-method", name)) { - if (! value || ! grub_strcmp ("stretch", value)) + if (! value || ! VasEBoot_strcmp ("stretch", value)) view->desktop_image_scale_method = - GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH; - else if (! grub_strcmp ("crop", value)) + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_STRETCH; + else if (! VasEBoot_strcmp ("crop", value)) view->desktop_image_scale_method = - GRUB_VIDEO_BITMAP_SELECTION_METHOD_CROP; - else if (! grub_strcmp ("padding", value)) + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_CROP; + else if (! VasEBoot_strcmp ("padding", value)) view->desktop_image_scale_method = - GRUB_VIDEO_BITMAP_SELECTION_METHOD_PADDING; - else if (! grub_strcmp ("fitwidth", value)) + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_PADDING; + else if (! VasEBoot_strcmp ("fitwidth", value)) view->desktop_image_scale_method = - GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH; - else if (! grub_strcmp ("fitheight", value)) + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH; + else if (! VasEBoot_strcmp ("fitheight", value)) view->desktop_image_scale_method = - GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT; + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported scale method: %s", value); } - else if (! grub_strcmp ("desktop-image-h-align", name)) + else if (! VasEBoot_strcmp ("desktop-image-h-align", name)) { - if (! grub_strcmp ("left", value)) - view->desktop_image_h_align = GRUB_VIDEO_BITMAP_H_ALIGN_LEFT; - else if (! grub_strcmp ("center", value)) - view->desktop_image_h_align = GRUB_VIDEO_BITMAP_H_ALIGN_CENTER; - else if (! grub_strcmp ("right", value)) - view->desktop_image_h_align = GRUB_VIDEO_BITMAP_H_ALIGN_RIGHT; + if (! VasEBoot_strcmp ("left", value)) + view->desktop_image_h_align = VasEBoot_VIDEO_BITMAP_H_ALIGN_LEFT; + else if (! VasEBoot_strcmp ("center", value)) + view->desktop_image_h_align = VasEBoot_VIDEO_BITMAP_H_ALIGN_CENTER; + else if (! VasEBoot_strcmp ("right", value)) + view->desktop_image_h_align = VasEBoot_VIDEO_BITMAP_H_ALIGN_RIGHT; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported horizontal align method: %s", value); } - else if (! grub_strcmp ("desktop-image-v-align", name)) + else if (! VasEBoot_strcmp ("desktop-image-v-align", name)) { - if (! grub_strcmp ("top", value)) - view->desktop_image_v_align = GRUB_VIDEO_BITMAP_V_ALIGN_TOP; - else if (! grub_strcmp ("center", value)) - view->desktop_image_v_align = GRUB_VIDEO_BITMAP_V_ALIGN_CENTER; - else if (! grub_strcmp ("bottom", value)) - view->desktop_image_v_align = GRUB_VIDEO_BITMAP_V_ALIGN_BOTTOM; + if (! VasEBoot_strcmp ("top", value)) + view->desktop_image_v_align = VasEBoot_VIDEO_BITMAP_V_ALIGN_TOP; + else if (! VasEBoot_strcmp ("center", value)) + view->desktop_image_v_align = VasEBoot_VIDEO_BITMAP_V_ALIGN_CENTER; + else if (! VasEBoot_strcmp ("bottom", value)) + view->desktop_image_v_align = VasEBoot_VIDEO_BITMAP_V_ALIGN_BOTTOM; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "Unsupported vertical align method: %s", value); } - else if (! grub_strcmp ("desktop-color", name)) - grub_video_parse_color (value, &view->desktop_color); - else if (! grub_strcmp ("terminal-box", name)) + else if (! VasEBoot_strcmp ("desktop-color", name)) + VasEBoot_video_parse_color (value, &view->desktop_color); + else if (! VasEBoot_strcmp ("terminal-box", name)) { - grub_err_t err; - err = grub_gui_recreate_box (&view->terminal_box, value, theme_dir); - if (err != GRUB_ERR_NONE) + VasEBoot_err_t err; + err = VasEBoot_gui_recreate_box (&view->terminal_box, value, theme_dir); + if (err != VasEBoot_ERR_NONE) return err; } - else if (! grub_strcmp ("terminal-border", name)) + else if (! VasEBoot_strcmp ("terminal-border", name)) { - view->terminal_border = grub_strtoul (value, 0, 10); - if (grub_errno) - return grub_errno; + view->terminal_border = VasEBoot_strtoul (value, 0, 10); + if (VasEBoot_errno) + return VasEBoot_errno; } - else if (! grub_strcmp ("terminal-left", name)) + else if (! VasEBoot_strcmp ("terminal-left", name)) { unsigned int tmp; int err = theme_get_unsigned_int_from_proportional (value, view->screen.width, &tmp); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; view->terminal_rect.x = tmp; } - else if (! grub_strcmp ("terminal-top", name)) + else if (! VasEBoot_strcmp ("terminal-top", name)) { unsigned int tmp; int err = theme_get_unsigned_int_from_proportional (value, view->screen.height, &tmp); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; view->terminal_rect.y = tmp; } - else if (! grub_strcmp ("terminal-width", name)) + else if (! VasEBoot_strcmp ("terminal-width", name)) { unsigned int tmp; int err = theme_get_unsigned_int_from_proportional (value, view->screen.width, &tmp); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; view->terminal_rect.width = tmp; } - else if (! grub_strcmp ("terminal-height", name)) + else if (! VasEBoot_strcmp ("terminal-height", name)) { unsigned int tmp; int err = theme_get_unsigned_int_from_proportional (value, view->screen.height, &tmp); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; view->terminal_rect.height = tmp; } - else if (! grub_strcmp ("title-text", name)) + else if (! VasEBoot_strcmp ("title-text", name)) { - grub_free (view->title_text); - view->title_text = grub_strdup (value); + VasEBoot_free (view->title_text); + view->title_text = VasEBoot_strdup (value); if (! view->title_text) - return grub_errno; + return VasEBoot_errno; } else { - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "%s:%d:%d unknown property `%s'", filename, line_num, col_num, name); } - return grub_errno; + return VasEBoot_errno; } struct parsebuf @@ -306,7 +306,7 @@ struct parsebuf int col_num; const char *filename; char *theme_dir; - grub_gfxmenu_view_t view; + VasEBoot_gfxmenu_view_t view; }; static int @@ -380,8 +380,8 @@ static int is_identifier_char (int c) { return (c != -1 - && (grub_isalpha(c) - || grub_isdigit(c) + && (VasEBoot_isalpha(c) + || VasEBoot_isdigit(c) || c == '_' || c == '-')); } @@ -407,7 +407,7 @@ read_identifier (struct parsebuf *p) if (end - start < 1) return 0; - return grub_new_substring (p->buf, start, end); + return VasEBoot_new_substring (p->buf, start, end); } static char * @@ -456,16 +456,16 @@ read_expression (struct parsebuf *p) else { /* The end of the theme file has been reached. */ - grub_error (GRUB_ERR_IO, "%s:%d:%d expression expected in theme file", + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d expression expected in theme file", p->filename, p->line_num, p->col_num); return 0; } - return grub_new_substring (p->buf, start, end); + return VasEBoot_new_substring (p->buf, start, end); } -static grub_err_t -parse_proportional_spec (const char *value, signed *abs, grub_fixed_signed_t *prop) +static VasEBoot_err_t +parse_proportional_spec (const char *value, signed *abs, VasEBoot_fixed_signed_t *prop) { signed num; const char *ptr; @@ -484,72 +484,72 @@ parse_proportional_spec (const char *value, signed *abs, grub_fixed_signed_t *pr ptr++; } - num = grub_strtoul (ptr, (char **) &ptr, 0); - if (grub_errno) - return grub_errno; + num = VasEBoot_strtoul (ptr, (char **) &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (sig) num = -num; if (*ptr == '%') { - *prop += grub_fixed_fsf_divide (grub_signed_to_fixed (num), 100); + *prop += VasEBoot_fixed_fsf_divide (VasEBoot_signed_to_fixed (num), 100); ptr++; } else *abs += num; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read a GUI object specification from the theme file. Any components created will be added to the GUI container PARENT. */ -static grub_err_t -read_object (struct parsebuf *p, grub_gui_container_t parent) +static VasEBoot_err_t +read_object (struct parsebuf *p, VasEBoot_gui_container_t parent) { - grub_video_rect_t bounds; + VasEBoot_video_rect_t bounds; char *name; name = read_identifier (p); if (! name) goto cleanup; - grub_gui_component_t component = 0; - if (grub_strcmp (name, "label") == 0) + VasEBoot_gui_component_t component = 0; + if (VasEBoot_strcmp (name, "label") == 0) { - component = grub_gui_label_new (); + component = VasEBoot_gui_label_new (); } - else if (grub_strcmp (name, "image") == 0) + else if (VasEBoot_strcmp (name, "image") == 0) { - component = grub_gui_image_new (); + component = VasEBoot_gui_image_new (); } - else if (grub_strcmp (name, "vbox") == 0) + else if (VasEBoot_strcmp (name, "vbox") == 0) { - component = (grub_gui_component_t) grub_gui_vbox_new (); + component = (VasEBoot_gui_component_t) VasEBoot_gui_vbox_new (); } - else if (grub_strcmp (name, "hbox") == 0) + else if (VasEBoot_strcmp (name, "hbox") == 0) { - component = (grub_gui_component_t) grub_gui_hbox_new (); + component = (VasEBoot_gui_component_t) VasEBoot_gui_hbox_new (); } - else if (grub_strcmp (name, "canvas") == 0) + else if (VasEBoot_strcmp (name, "canvas") == 0) { - component = (grub_gui_component_t) grub_gui_canvas_new (); + component = (VasEBoot_gui_component_t) VasEBoot_gui_canvas_new (); } - else if (grub_strcmp (name, "progress_bar") == 0) + else if (VasEBoot_strcmp (name, "progress_bar") == 0) { - component = grub_gui_progress_bar_new (); + component = VasEBoot_gui_progress_bar_new (); } - else if (grub_strcmp (name, "circular_progress") == 0) + else if (VasEBoot_strcmp (name, "circular_progress") == 0) { - component = grub_gui_circular_progress_new (); + component = VasEBoot_gui_circular_progress_new (); } - else if (grub_strcmp (name, "boot_menu") == 0) + else if (VasEBoot_strcmp (name, "boot_menu") == 0) { - component = grub_gui_list_new (); + component = VasEBoot_gui_list_new (); } else { /* Unknown type. */ - grub_error (GRUB_ERR_IO, "%s:%d:%d unknown object type `%s'", + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d unknown object type `%s'", p->filename, p->line_num, p->col_num, name); goto cleanup; } @@ -572,7 +572,7 @@ read_object (struct parsebuf *p, grub_gui_container_t parent) skip_whitespace (p); if (read_char (p) != '{') { - grub_error (GRUB_ERR_IO, + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d expected `{' after object type name `%s'", p->filename, p->line_num, p->col_num, name); goto cleanup; @@ -606,7 +606,7 @@ read_object (struct parsebuf *p, grub_gui_container_t parent) if (component->ops->is_instance (component, "container")) { /* Read the sub-object recursively and add it as a child. */ - if (read_object (p, (grub_gui_container_t) component) != 0) + if (read_object (p, (VasEBoot_gui_container_t) component) != 0) goto cleanup; /* After reading the sub-object, resume parsing, expecting another property assignment or sub-object definition. */ @@ -614,7 +614,7 @@ read_object (struct parsebuf *p, grub_gui_container_t parent) } else { - grub_error (GRUB_ERR_IO, + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d attempted to add object to non-container", p->filename, p->line_num, p->col_num); goto cleanup; @@ -625,7 +625,7 @@ read_object (struct parsebuf *p, grub_gui_container_t parent) property = read_identifier (p); if (! property) { - grub_error (GRUB_ERR_IO, "%s:%d:%d identifier expected in theme file", + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d identifier expected in theme file", p->filename, p->line_num, p->col_num); goto cleanup; } @@ -633,10 +633,10 @@ read_object (struct parsebuf *p, grub_gui_container_t parent) skip_whitespace (p); if (read_char (p) != '=') { - grub_error (GRUB_ERR_IO, + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d expected `=' after property name `%s'", p->filename, p->line_num, p->col_num, property); - grub_free (property); + VasEBoot_free (property); goto cleanup; } skip_whitespace (p); @@ -645,35 +645,35 @@ read_object (struct parsebuf *p, grub_gui_container_t parent) value = read_expression (p); if (! value) { - grub_free (property); + VasEBoot_free (property); goto cleanup; } /* Handle the property value. */ - if (grub_strcmp (property, "left") == 0) + if (VasEBoot_strcmp (property, "left") == 0) parse_proportional_spec (value, &component->x, &component->xfrac); - else if (grub_strcmp (property, "top") == 0) + else if (VasEBoot_strcmp (property, "top") == 0) parse_proportional_spec (value, &component->y, &component->yfrac); - else if (grub_strcmp (property, "width") == 0) + else if (VasEBoot_strcmp (property, "width") == 0) parse_proportional_spec (value, &component->w, &component->wfrac); - else if (grub_strcmp (property, "height") == 0) + else if (VasEBoot_strcmp (property, "height") == 0) parse_proportional_spec (value, &component->h, &component->hfrac); else /* General property handling. */ component->ops->set_property (component, property, value); - grub_free (value); - grub_free (property); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_free (value); + VasEBoot_free (property); + if (VasEBoot_errno != VasEBoot_ERR_NONE) goto cleanup; } cleanup: - grub_free (name); - return grub_errno; + VasEBoot_free (name); + return VasEBoot_errno; } -static grub_err_t +static VasEBoot_err_t read_property (struct parsebuf *p) { char *name; @@ -683,7 +683,7 @@ read_property (struct parsebuf *p) if (! name) { advance_to_next_line (p); - return grub_errno; + return VasEBoot_errno; } /* Skip whitespace before separator. */ @@ -692,7 +692,7 @@ read_property (struct parsebuf *p) /* Read separator. */ if (read_char (p) != ':') { - grub_error (GRUB_ERR_IO, + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d missing separator after property name `%s'", p->filename, p->line_num, p->col_num, name); goto done; @@ -708,19 +708,19 @@ read_property (struct parsebuf *p) char *value = read_expression (p); if (! value) { - grub_error (GRUB_ERR_IO, "%s:%d:%d missing property value", + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d missing property value", p->filename, p->line_num, p->col_num); goto done; } - /* If theme_set_string results in an error, grub_errno will be returned + /* If theme_set_string results in an error, VasEBoot_errno will be returned below. */ theme_set_string (p->view, name, value, p->theme_dir, p->filename, p->line_num, p->col_num); - grub_free (value); + VasEBoot_free (value); } else { - grub_error (GRUB_ERR_IO, + VasEBoot_error (VasEBoot_ERR_IO, "%s:%d:%d property value invalid; " "enclose literal values in quotes (\")", p->filename, p->line_num, p->col_num); @@ -728,56 +728,56 @@ read_property (struct parsebuf *p) } done: - grub_free (name); - return grub_errno; + VasEBoot_free (name); + return VasEBoot_errno; } /* Set properties on the view based on settings from the specified theme file. */ -grub_err_t -grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view, const char *theme_path) +VasEBoot_err_t +VasEBoot_gfxmenu_view_load_theme (VasEBoot_gfxmenu_view_t view, const char *theme_path) { - grub_file_t file; + VasEBoot_file_t file; struct parsebuf p; p.view = view; - p.theme_dir = grub_get_dirname (theme_path); + p.theme_dir = VasEBoot_get_dirname (theme_path); - file = grub_file_open (theme_path); + file = VasEBoot_file_open (theme_path); if (! file) { - grub_free (p.theme_dir); - return grub_errno; + VasEBoot_free (p.theme_dir); + return VasEBoot_errno; } - p.len = grub_file_size (file); - p.buf = grub_malloc (p.len); + p.len = VasEBoot_file_size (file); + p.buf = VasEBoot_malloc (p.len); p.pos = 0; p.line_num = 1; p.col_num = 1; p.filename = theme_path; if (! p.buf) { - grub_file_close (file); - grub_free (p.theme_dir); - return grub_errno; + VasEBoot_file_close (file); + VasEBoot_free (p.theme_dir); + return VasEBoot_errno; } - if (grub_file_read (file, p.buf, p.len) != p.len) + if (VasEBoot_file_read (file, p.buf, p.len) != p.len) { - grub_free (p.buf); - grub_file_close (file); - grub_free (p.theme_dir); - return grub_errno; + VasEBoot_free (p.buf); + VasEBoot_file_close (file); + VasEBoot_free (p.theme_dir); + return VasEBoot_errno; } if (view->canvas) view->canvas->component.ops->destroy (view->canvas); - view->canvas = grub_gui_canvas_new (); + view->canvas = VasEBoot_gui_canvas_new (); if (!view->canvas) goto fail; - ((grub_gui_component_t) view->canvas) - ->ops->set_bounds ((grub_gui_component_t) view->canvas, + ((VasEBoot_gui_component_t) view->canvas) + ->ops->set_bounds ((VasEBoot_gui_component_t) view->canvas, &view->screen); while (has_more (&p)) @@ -804,13 +804,13 @@ grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view, const char *theme_path) read_property (&p); } - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) goto fail; } /* Set the new theme path. */ - grub_free (view->theme_path); - view->theme_path = grub_strdup (theme_path); + VasEBoot_free (view->theme_path); + view->theme_path = VasEBoot_strdup (theme_path); goto cleanup; fail: @@ -821,8 +821,8 @@ fail: } cleanup: - grub_free (p.buf); - grub_file_close (file); - grub_free (p.theme_dir); - return grub_errno; + VasEBoot_free (p.buf); + VasEBoot_file_close (file); + VasEBoot_free (p.theme_dir); + return VasEBoot_errno; } diff --git a/VasEBoot-core/gfxmenu/view.c b/VasEBoot-core/gfxmenu/view.c index ad5e82b81..f49212cb2 100644 --- a/VasEBoot-core/gfxmenu/view.c +++ b/VasEBoot-core/gfxmenu/view.c @@ -1,70 +1,70 @@ /* view.c - Graphical menu interface MVC view. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static void -init_terminal (grub_gfxmenu_view_t view); +init_terminal (VasEBoot_gfxmenu_view_t view); static void -init_background (grub_gfxmenu_view_t view); -static grub_gfxmenu_view_t term_view; +init_background (VasEBoot_gfxmenu_view_t view); +static VasEBoot_gfxmenu_view_t term_view; /* Create a new view object, loading the theme specified by THEME_PATH and associating MODEL with the view. */ -grub_gfxmenu_view_t -grub_gfxmenu_view_new (const char *theme_path, +VasEBoot_gfxmenu_view_t +VasEBoot_gfxmenu_view_new (const char *theme_path, int width, int height) { - grub_gfxmenu_view_t view; - grub_font_t default_font; - grub_video_rgba_color_t default_fg_color; - grub_video_rgba_color_t default_bg_color; + VasEBoot_gfxmenu_view_t view; + VasEBoot_font_t default_font; + VasEBoot_video_rgba_color_t default_fg_color; + VasEBoot_video_rgba_color_t default_bg_color; - view = grub_malloc (sizeof (*view)); + view = VasEBoot_malloc (sizeof (*view)); if (! view) return 0; - while (grub_gfxmenu_timeout_notifications) + while (VasEBoot_gfxmenu_timeout_notifications) { - struct grub_gfxmenu_timeout_notify *p; - p = grub_gfxmenu_timeout_notifications; - grub_gfxmenu_timeout_notifications = grub_gfxmenu_timeout_notifications->next; - grub_free (p); + struct VasEBoot_gfxmenu_timeout_notify *p; + p = VasEBoot_gfxmenu_timeout_notifications; + VasEBoot_gfxmenu_timeout_notifications = VasEBoot_gfxmenu_timeout_notifications->next; + VasEBoot_free (p); } view->screen.x = 0; @@ -81,26 +81,26 @@ grub_gfxmenu_view_new (const char *theme_path, view->terminal_rect.y = view->screen.y + (view->screen.height - view->terminal_rect.height) / 2; - default_font = grub_font_get ("Unknown Regular 16"); - default_fg_color = grub_video_rgba_color_rgb (0, 0, 0); - default_bg_color = grub_video_rgba_color_rgb (255, 255, 255); + default_font = VasEBoot_font_get ("Unknown Regular 16"); + default_fg_color = VasEBoot_video_rgba_color_rgb (0, 0, 0); + default_bg_color = VasEBoot_video_rgba_color_rgb (255, 255, 255); view->canvas = 0; view->title_font = default_font; view->message_font = default_font; - view->terminal_font_name = grub_strdup ("Fixed 10"); + view->terminal_font_name = VasEBoot_strdup ("Fixed 10"); view->title_color = default_fg_color; view->message_color = default_bg_color; view->message_bg_color = default_fg_color; view->raw_desktop_image = 0; view->scaled_desktop_image = 0; - view->desktop_image_scale_method = GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH; - view->desktop_image_h_align = GRUB_VIDEO_BITMAP_H_ALIGN_CENTER; - view->desktop_image_v_align = GRUB_VIDEO_BITMAP_V_ALIGN_CENTER; + view->desktop_image_scale_method = VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_STRETCH; + view->desktop_image_h_align = VasEBoot_VIDEO_BITMAP_H_ALIGN_CENTER; + view->desktop_image_v_align = VasEBoot_VIDEO_BITMAP_V_ALIGN_CENTER; view->desktop_color = default_bg_color; - view->terminal_box = grub_gfxmenu_create_box (0, 0); - view->title_text = grub_strdup (_("GRUB Boot Menu")); + view->terminal_box = VasEBoot_gfxmenu_create_box (0, 0); + view->title_text = VasEBoot_strdup (_("VasEBoot Boot Menu")); view->progress_message_text = 0; view->theme_path = 0; @@ -112,9 +112,9 @@ grub_gfxmenu_view_new (const char *theme_path, view->progress_message_frame.y = view->screen.y + view->screen.height - 90 - 20 - view->progress_message_frame.height; - if (grub_gfxmenu_view_load_theme (view, theme_path) != 0) + if (VasEBoot_gfxmenu_view_load_theme (view, theme_path) != 0) { - grub_gfxmenu_view_destroy (view); + VasEBoot_gfxmenu_view_destroy (view); return 0; } @@ -123,38 +123,38 @@ grub_gfxmenu_view_new (const char *theme_path, /* Destroy the view object. All used memory is freed. */ void -grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view) +VasEBoot_gfxmenu_view_destroy (VasEBoot_gfxmenu_view_t view) { if (!view) return; - while (grub_gfxmenu_timeout_notifications) + while (VasEBoot_gfxmenu_timeout_notifications) { - struct grub_gfxmenu_timeout_notify *p; - p = grub_gfxmenu_timeout_notifications; - grub_gfxmenu_timeout_notifications = grub_gfxmenu_timeout_notifications->next; - grub_free (p); + struct VasEBoot_gfxmenu_timeout_notify *p; + p = VasEBoot_gfxmenu_timeout_notifications; + VasEBoot_gfxmenu_timeout_notifications = VasEBoot_gfxmenu_timeout_notifications->next; + VasEBoot_free (p); } - grub_video_bitmap_destroy (view->raw_desktop_image); - grub_video_bitmap_destroy (view->scaled_desktop_image); + VasEBoot_video_bitmap_destroy (view->raw_desktop_image); + VasEBoot_video_bitmap_destroy (view->scaled_desktop_image); if (view->terminal_box) view->terminal_box->destroy (view->terminal_box); - grub_free (view->terminal_font_name); - grub_free (view->title_text); - grub_free (view->progress_message_text); - grub_free (view->theme_path); + VasEBoot_free (view->terminal_font_name); + VasEBoot_free (view->title_text); + VasEBoot_free (view->progress_message_text); + VasEBoot_free (view->theme_path); if (view->canvas) view->canvas->component.ops->destroy (view->canvas); - grub_free (view); + VasEBoot_free (view); } static void -redraw_background (grub_gfxmenu_view_t view, - const grub_video_rect_t *bounds) +redraw_background (VasEBoot_gfxmenu_view_t view, + const VasEBoot_video_rect_t *bounds) { if (view->scaled_desktop_image) { - struct grub_video_bitmap *img = view->scaled_desktop_image; - grub_video_blit_bitmap (img, GRUB_VIDEO_BLIT_REPLACE, + struct VasEBoot_video_bitmap *img = view->scaled_desktop_image; + VasEBoot_video_blit_bitmap (img, VasEBoot_VIDEO_BLIT_REPLACE, bounds->x, bounds->y, bounds->x - view->screen.x, bounds->y - view->screen.y, @@ -162,26 +162,26 @@ redraw_background (grub_gfxmenu_view_t view, } else { - grub_video_fill_rect (grub_video_map_rgba_color (view->desktop_color), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgba_color (view->desktop_color), bounds->x, bounds->y, bounds->width, bounds->height); } } static void -draw_title (grub_gfxmenu_view_t view) +draw_title (VasEBoot_gfxmenu_view_t view) { if (! view->title_text) return; /* Center the title. */ - int title_width = grub_font_get_string_width (view->title_font, + int title_width = VasEBoot_font_get_string_width (view->title_font, view->title_text); int x = (view->screen.width - title_width) / 2; - int y = 40 + grub_font_get_ascent (view->title_font); - grub_font_draw_string (view->title_text, + int y = 40 + VasEBoot_font_get_ascent (view->title_font); + VasEBoot_font_draw_string (view->title_text, view->title_font, - grub_video_map_rgba_color (view->title_color), + VasEBoot_video_map_rgba_color (view->title_color), x, y); } @@ -193,67 +193,67 @@ struct progress_value_data int value; }; -struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications; +struct VasEBoot_gfxmenu_timeout_notify *VasEBoot_gfxmenu_timeout_notifications; static void update_timeouts (int visible, int start, int value, int end) { - struct grub_gfxmenu_timeout_notify *cur; + struct VasEBoot_gfxmenu_timeout_notify *cur; - for (cur = grub_gfxmenu_timeout_notifications; cur; cur = cur->next) + for (cur = VasEBoot_gfxmenu_timeout_notifications; cur; cur = cur->next) cur->set_state (cur->self, visible, start, value, end); } static void -redraw_timeouts (struct grub_gfxmenu_view *view) +redraw_timeouts (struct VasEBoot_gfxmenu_view *view) { - struct grub_gfxmenu_timeout_notify *cur; + struct VasEBoot_gfxmenu_timeout_notify *cur; - for (cur = grub_gfxmenu_timeout_notifications; cur; cur = cur->next) + for (cur = VasEBoot_gfxmenu_timeout_notifications; cur; cur = cur->next) { - grub_video_rect_t bounds; + VasEBoot_video_rect_t bounds; cur->self->ops->get_bounds (cur->self, &bounds); - grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED); - grub_gfxmenu_view_redraw (view, &bounds); + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_ENABLED); + VasEBoot_gfxmenu_view_redraw (view, &bounds); } } void -grub_gfxmenu_print_timeout (int timeout, void *data) +VasEBoot_gfxmenu_print_timeout (int timeout, void *data) { - struct grub_gfxmenu_view *view = data; + struct VasEBoot_gfxmenu_view *view = data; if (view->first_timeout == -1) view->first_timeout = timeout; update_timeouts (1, -view->first_timeout, -timeout, 0); redraw_timeouts (view); - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); if (view->double_repaint) redraw_timeouts (view); } void -grub_gfxmenu_clear_timeout (void *data) +VasEBoot_gfxmenu_clear_timeout (void *data) { - struct grub_gfxmenu_view *view = data; + struct VasEBoot_gfxmenu_view *view = data; update_timeouts (0, 1, 0, 0); redraw_timeouts (view); - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); if (view->double_repaint) redraw_timeouts (view); } static void -update_menu_visit (grub_gui_component_t component, +update_menu_visit (VasEBoot_gui_component_t component, void *userdata) { - grub_gfxmenu_view_t view; + VasEBoot_gfxmenu_view_t view; view = userdata; if (component->ops->is_instance (component, "list")) { - grub_gui_list_t list = (grub_gui_list_t) component; + VasEBoot_gui_list_t list = (VasEBoot_gui_list_t) component; list->ops->set_view_info (list, view); } } @@ -261,165 +261,165 @@ update_menu_visit (grub_gui_component_t component, /* Update any boot menu components with the current menu model and theme path. */ static void -update_menu_components (grub_gfxmenu_view_t view) +update_menu_components (VasEBoot_gfxmenu_view_t view) { - grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas, + VasEBoot_gui_iterate_recursively ((VasEBoot_gui_component_t) view->canvas, update_menu_visit, view); } static void -refresh_menu_visit (grub_gui_component_t component, +refresh_menu_visit (VasEBoot_gui_component_t component, void *userdata) { - grub_gfxmenu_view_t view; + VasEBoot_gfxmenu_view_t view; view = userdata; if (component->ops->is_instance (component, "list")) { - grub_gui_list_t list = (grub_gui_list_t) component; + VasEBoot_gui_list_t list = (VasEBoot_gui_list_t) component; list->ops->refresh_list (list, view); } } /* Refresh list information (useful for submenus) */ static void -refresh_menu_components (grub_gfxmenu_view_t view) +refresh_menu_components (VasEBoot_gfxmenu_view_t view) { - grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas, + VasEBoot_gui_iterate_recursively ((VasEBoot_gui_component_t) view->canvas, refresh_menu_visit, view); } static void -draw_message (grub_gfxmenu_view_t view) +draw_message (VasEBoot_gfxmenu_view_t view) { char *text = view->progress_message_text; - grub_video_rect_t f = view->progress_message_frame; + VasEBoot_video_rect_t f = view->progress_message_frame; if (! text) return; - grub_font_t font = view->message_font; - grub_video_color_t color = grub_video_map_rgba_color (view->message_color); + VasEBoot_font_t font = view->message_font; + VasEBoot_video_color_t color = VasEBoot_video_map_rgba_color (view->message_color); /* Border. */ - grub_video_fill_rect (color, + VasEBoot_video_fill_rect (color, f.x-1, f.y-1, f.width+2, f.height+2); /* Fill. */ - grub_video_fill_rect (grub_video_map_rgba_color (view->message_bg_color), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgba_color (view->message_bg_color), f.x, f.y, f.width, f.height); /* Center the text. */ - int text_width = grub_font_get_string_width (font, text); + int text_width = VasEBoot_font_get_string_width (font, text); int x = f.x + (f.width - text_width) / 2; - int y = (f.y + (f.height - grub_font_get_descent (font)) / 2 - + grub_font_get_ascent (font) / 2); - grub_font_draw_string (text, font, color, x, y); + int y = (f.y + (f.height - VasEBoot_font_get_descent (font)) / 2 + + VasEBoot_font_get_ascent (font) / 2); + VasEBoot_font_draw_string (text, font, color, x, y); } void -grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view, - const grub_video_rect_t *region) +VasEBoot_gfxmenu_view_redraw (VasEBoot_gfxmenu_view_t view, + const VasEBoot_video_rect_t *region) { - if (grub_video_have_common_points (&view->terminal_rect, region)) - grub_gfxterm_schedule_repaint (); + if (VasEBoot_video_have_common_points (&view->terminal_rect, region)) + VasEBoot_gfxterm_schedule_repaint (); - grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); - grub_video_area_status_t area_status; - grub_video_get_area_status (&area_status); - if (area_status == GRUB_VIDEO_AREA_ENABLED) - grub_video_set_region (region->x, region->y, + VasEBoot_video_set_active_render_target (VasEBoot_VIDEO_RENDER_TARGET_DISPLAY); + VasEBoot_video_area_status_t area_status; + VasEBoot_video_get_area_status (&area_status); + if (area_status == VasEBoot_VIDEO_AREA_ENABLED) + VasEBoot_video_set_region (region->x, region->y, region->width, region->height); redraw_background (view, region); if (view->canvas) view->canvas->component.ops->paint (view->canvas, region); draw_title (view); - if (grub_video_have_common_points (&view->progress_message_frame, region)) + if (VasEBoot_video_have_common_points (&view->progress_message_frame, region)) draw_message (view); - if (area_status == GRUB_VIDEO_AREA_ENABLED) - grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED); + if (area_status == VasEBoot_VIDEO_AREA_ENABLED) + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_ENABLED); } void -grub_gfxmenu_view_draw (grub_gfxmenu_view_t view) +VasEBoot_gfxmenu_view_draw (VasEBoot_gfxmenu_view_t view) { init_terminal (view); init_background (view); /* Clear the screen; there may be garbage left over in video memory. */ - grub_video_fill_rect (grub_video_map_rgb (0, 0, 0), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgb (0, 0, 0), view->screen.x, view->screen.y, view->screen.width, view->screen.height); - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); if (view->double_repaint) - grub_video_fill_rect (grub_video_map_rgb (0, 0, 0), + VasEBoot_video_fill_rect (VasEBoot_video_map_rgb (0, 0, 0), view->screen.x, view->screen.y, view->screen.width, view->screen.height); refresh_menu_components (view); update_menu_components (view); - grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED); - grub_gfxmenu_view_redraw (view, &view->screen); - grub_video_swap_buffers (); + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_DISABLED); + VasEBoot_gfxmenu_view_redraw (view, &view->screen); + VasEBoot_video_swap_buffers (); if (view->double_repaint) { - grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED); - grub_gfxmenu_view_redraw (view, &view->screen); + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_DISABLED); + VasEBoot_gfxmenu_view_redraw (view, &view->screen); } } static void -redraw_menu_visit (grub_gui_component_t component, +redraw_menu_visit (VasEBoot_gui_component_t component, void *userdata) { - grub_gfxmenu_view_t view; + VasEBoot_gfxmenu_view_t view; view = userdata; if (component->ops->is_instance (component, "list")) { - grub_video_rect_t bounds; + VasEBoot_video_rect_t bounds; component->ops->get_bounds (component, &bounds); - grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED); - grub_gfxmenu_view_redraw (view, &bounds); + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_ENABLED); + VasEBoot_gfxmenu_view_redraw (view, &bounds); } } void -grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view) +VasEBoot_gfxmenu_redraw_menu (VasEBoot_gfxmenu_view_t view) { update_menu_components (view); - grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas, + VasEBoot_gui_iterate_recursively ((VasEBoot_gui_component_t) view->canvas, redraw_menu_visit, view); - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); if (view->double_repaint) { - grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas, + VasEBoot_gui_iterate_recursively ((VasEBoot_gui_component_t) view->canvas, redraw_menu_visit, view); } } void -grub_gfxmenu_set_chosen_entry (int entry, void *data) +VasEBoot_gfxmenu_set_chosen_entry (int entry, void *data) { - grub_gfxmenu_view_t view = data; + VasEBoot_gfxmenu_view_t view = data; view->selected = entry; - grub_gfxmenu_redraw_menu (view); + VasEBoot_gfxmenu_redraw_menu (view); } static void -grub_gfxmenu_draw_terminal_box (void) +VasEBoot_gfxmenu_draw_terminal_box (void) { - grub_gfxmenu_box_t term_box; + VasEBoot_gfxmenu_box_t term_box; term_box = term_view->terminal_box; if (!term_box) return; - grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED); + VasEBoot_video_set_area_status (VasEBoot_VIDEO_AREA_DISABLED); term_box->set_content_size (term_box, term_view->terminal_rect.width, term_view->terminal_rect.height); @@ -430,27 +430,27 @@ grub_gfxmenu_draw_terminal_box (void) } static void -get_min_terminal (grub_font_t terminal_font, +get_min_terminal (VasEBoot_font_t terminal_font, unsigned int border_width, unsigned int *min_terminal_width, unsigned int *min_terminal_height) { - struct grub_font_glyph *glyph; - glyph = grub_font_get_glyph (terminal_font, 'M'); + struct VasEBoot_font_glyph *glyph; + glyph = VasEBoot_font_get_glyph (terminal_font, 'M'); *min_terminal_width = (glyph? glyph->device_width : 8) * 80 + 2 * border_width; - *min_terminal_height = grub_font_get_max_char_height (terminal_font) * 24 + *min_terminal_height = VasEBoot_font_get_max_char_height (terminal_font) * 24 + 2 * border_width; } static void -terminal_sanity_check (grub_gfxmenu_view_t view) +terminal_sanity_check (VasEBoot_gfxmenu_view_t view) { if (!view->need_to_check_sanity) return; /* terminal_font was checked before in the init_terminal function. */ - grub_font_t terminal_font = grub_font_get (view->terminal_font_name); + VasEBoot_font_t terminal_font = VasEBoot_font_get (view->terminal_font_name); /* Non-negative numbers below. */ int scr_x = view->screen.x; @@ -520,14 +520,14 @@ terminal_sanity_check (grub_gfxmenu_view_t view) } static void -init_terminal (grub_gfxmenu_view_t view) +init_terminal (VasEBoot_gfxmenu_view_t view) { - grub_font_t terminal_font; + VasEBoot_font_t terminal_font; - terminal_font = grub_font_get (view->terminal_font_name); + terminal_font = VasEBoot_font_get (view->terminal_font_name); if (!terminal_font) { - grub_error (GRUB_ERR_BAD_FONT, "no font loaded"); + VasEBoot_error (VasEBoot_ERR_BAD_FONT, "no font loaded"); return; } @@ -539,7 +539,7 @@ init_terminal (grub_gfxmenu_view_t view) /* Note: currently there is no API for changing the gfxterm font on the fly, so whatever font the initially loaded theme specifies will be permanent. */ - grub_gfxterm_set_window (GRUB_VIDEO_RENDER_TARGET_DISPLAY, + VasEBoot_gfxterm_set_window (VasEBoot_VIDEO_RENDER_TARGET_DISPLAY, view->terminal_rect.x, view->terminal_rect.y, view->terminal_rect.width, @@ -547,29 +547,29 @@ init_terminal (grub_gfxmenu_view_t view) view->double_repaint, terminal_font, view->terminal_border); - grub_gfxterm_decorator_hook = grub_gfxmenu_draw_terminal_box; + VasEBoot_gfxterm_decorator_hook = VasEBoot_gfxmenu_draw_terminal_box; } static void -init_background (grub_gfxmenu_view_t view) +init_background (VasEBoot_gfxmenu_view_t view) { if (view->scaled_desktop_image) return; - struct grub_video_bitmap *scaled_bitmap; + struct VasEBoot_video_bitmap *scaled_bitmap; if (view->desktop_image_scale_method == - GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH) - grub_video_bitmap_create_scaled (&scaled_bitmap, + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_STRETCH) + VasEBoot_video_bitmap_create_scaled (&scaled_bitmap, view->screen.width, view->screen.height, view->raw_desktop_image, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); else - grub_video_bitmap_scale_proportional (&scaled_bitmap, + VasEBoot_video_bitmap_scale_proportional (&scaled_bitmap, view->screen.width, view->screen.height, view->raw_desktop_image, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST, view->desktop_image_scale_method, view->desktop_image_v_align, view->desktop_image_h_align); @@ -586,49 +586,49 @@ init_background (grub_gfxmenu_view_t view) /* Sets MESSAGE as the progress message for the view. MESSAGE can be 0, in which case no message is displayed. */ static void -set_progress_message (grub_gfxmenu_view_t view, const char *message) +set_progress_message (VasEBoot_gfxmenu_view_t view, const char *message) { - grub_free (view->progress_message_text); + VasEBoot_free (view->progress_message_text); if (message) - view->progress_message_text = grub_strdup (message); + view->progress_message_text = VasEBoot_strdup (message); else view->progress_message_text = 0; } static void -notify_booting (grub_menu_entry_t entry, void *userdata) +notify_booting (VasEBoot_menu_entry_t entry, void *userdata) { - grub_gfxmenu_view_t view = (grub_gfxmenu_view_t) userdata; + VasEBoot_gfxmenu_view_t view = (VasEBoot_gfxmenu_view_t) userdata; - char *s = grub_malloc (100 + grub_strlen (entry->title)); + char *s = VasEBoot_malloc (100 + VasEBoot_strlen (entry->title)); if (!s) return; - grub_sprintf (s, "Booting '%s'", entry->title); + VasEBoot_sprintf (s, "Booting '%s'", entry->title); set_progress_message (view, s); - grub_free (s); - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); - grub_video_swap_buffers (); + VasEBoot_free (s); + VasEBoot_gfxmenu_view_redraw (view, &view->progress_message_frame); + VasEBoot_video_swap_buffers (); if (view->double_repaint) - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); + VasEBoot_gfxmenu_view_redraw (view, &view->progress_message_frame); } static void -notify_fallback (grub_menu_entry_t entry, void *userdata) +notify_fallback (VasEBoot_menu_entry_t entry, void *userdata) { - grub_gfxmenu_view_t view = (grub_gfxmenu_view_t) userdata; + VasEBoot_gfxmenu_view_t view = (VasEBoot_gfxmenu_view_t) userdata; - char *s = grub_malloc (100 + grub_strlen (entry->title)); + char *s = VasEBoot_malloc (100 + VasEBoot_strlen (entry->title)); if (!s) return; - grub_sprintf (s, "Falling back to '%s'", entry->title); + VasEBoot_sprintf (s, "Falling back to '%s'", entry->title); set_progress_message (view, s); - grub_free (s); - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); - grub_video_swap_buffers (); + VasEBoot_free (s); + VasEBoot_gfxmenu_view_redraw (view, &view->progress_message_frame); + VasEBoot_video_swap_buffers (); if (view->double_repaint) - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); + VasEBoot_gfxmenu_view_redraw (view, &view->progress_message_frame); } static void @@ -637,7 +637,7 @@ notify_execution_failure (void *userdata __attribute__ ((unused))) } -static struct grub_menu_execute_callback execute_callback = +static struct VasEBoot_menu_execute_callback execute_callback = { .notify_booting = notify_booting, .notify_fallback = notify_fallback, diff --git a/VasEBoot-core/gfxmenu/widget-box.c b/VasEBoot-core/gfxmenu/widget-box.c index b60602889..130e364c6 100644 --- a/VasEBoot-core/gfxmenu/widget-box.c +++ b/VasEBoot-core/gfxmenu/widget-box.c @@ -1,30 +1,30 @@ /* widget_box.c - Pixmap-stylized box widget. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include enum box_pixmaps { @@ -45,38 +45,38 @@ static const char *box_pixmap_names[] = { #define BOX_NUM_PIXMAPS (sizeof(box_pixmap_names)/sizeof(*box_pixmap_names)) static int -get_height (struct grub_video_bitmap *bitmap) +get_height (struct VasEBoot_video_bitmap *bitmap) { if (bitmap) - return grub_video_bitmap_get_height (bitmap); + return VasEBoot_video_bitmap_get_height (bitmap); else return 0; } static int -get_width (struct grub_video_bitmap *bitmap) +get_width (struct VasEBoot_video_bitmap *bitmap) { if (bitmap) - return grub_video_bitmap_get_width (bitmap); + return VasEBoot_video_bitmap_get_width (bitmap); else return 0; } static void -blit (grub_gfxmenu_box_t self, int pixmap_index, int x, int y) +blit (VasEBoot_gfxmenu_box_t self, int pixmap_index, int x, int y) { - struct grub_video_bitmap *bitmap; + struct VasEBoot_video_bitmap *bitmap; bitmap = self->scaled_pixmaps[pixmap_index]; if (! bitmap) return; - grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_BLEND, + VasEBoot_video_blit_bitmap (bitmap, VasEBoot_VIDEO_BLIT_BLEND, x, y, 0, 0, - grub_video_bitmap_get_width (bitmap), - grub_video_bitmap_get_height (bitmap)); + VasEBoot_video_bitmap_get_width (bitmap), + VasEBoot_video_bitmap_get_height (bitmap)); } static void -draw (grub_gfxmenu_box_t self, int x, int y) +draw (VasEBoot_gfxmenu_box_t self, int x, int y) { int height_n; int width_w; @@ -118,41 +118,41 @@ draw (grub_gfxmenu_box_t self, int x, int y) blit (self, BOX_PIXMAP_CENTER, x + width_w, y + height_n); } -static grub_err_t -scale_pixmap (grub_gfxmenu_box_t self, int i, int w, int h) +static VasEBoot_err_t +scale_pixmap (VasEBoot_gfxmenu_box_t self, int i, int w, int h) { - struct grub_video_bitmap **scaled = &self->scaled_pixmaps[i]; - struct grub_video_bitmap *raw = self->raw_pixmaps[i]; + struct VasEBoot_video_bitmap **scaled = &self->scaled_pixmaps[i]; + struct VasEBoot_video_bitmap *raw = self->raw_pixmaps[i]; if (raw == 0) - return grub_errno; + return VasEBoot_errno; if (w == -1) - w = grub_video_bitmap_get_width (raw); + w = VasEBoot_video_bitmap_get_width (raw); if (h == -1) - h = grub_video_bitmap_get_height (raw); + h = VasEBoot_video_bitmap_get_height (raw); if (*scaled == 0 - || ((int) grub_video_bitmap_get_width (*scaled) != w) - || ((int) grub_video_bitmap_get_height (*scaled) != h)) + || ((int) VasEBoot_video_bitmap_get_width (*scaled) != w) + || ((int) VasEBoot_video_bitmap_get_height (*scaled) != h)) { if (*scaled) { - grub_video_bitmap_destroy (*scaled); + VasEBoot_video_bitmap_destroy (*scaled); *scaled = 0; } /* Don't try to create a bitmap with a zero dimension. */ if (w != 0 && h != 0) - grub_video_bitmap_create_scaled (scaled, w, h, raw, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + VasEBoot_video_bitmap_create_scaled (scaled, w, h, raw, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); } - return grub_errno; + return VasEBoot_errno; } static void -set_content_size (grub_gfxmenu_box_t self, +set_content_size (VasEBoot_gfxmenu_box_t self, int width, int height) { self->content_width = width; @@ -162,41 +162,41 @@ set_content_size (grub_gfxmenu_box_t self, /* It is assumed that the corners width/height match the adjacent sides. */ /* Resize N and S sides to match width. */ - if (scale_pixmap(self, BOX_PIXMAP_N, width, -1) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_N, width, -1) != VasEBoot_ERR_NONE) return; - if (scale_pixmap(self, BOX_PIXMAP_S, width, -1) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_S, width, -1) != VasEBoot_ERR_NONE) return; /* Resize E and W sides to match height. */ - if (scale_pixmap(self, BOX_PIXMAP_E, -1, height) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_E, -1, height) != VasEBoot_ERR_NONE) return; - if (scale_pixmap(self, BOX_PIXMAP_W, -1, height) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_W, -1, height) != VasEBoot_ERR_NONE) return; /* Don't scale the corners--they are assumed to match the sides. */ - if (scale_pixmap(self, BOX_PIXMAP_NW, -1, -1) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_NW, -1, -1) != VasEBoot_ERR_NONE) return; - if (scale_pixmap(self, BOX_PIXMAP_SW, -1, -1) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_SW, -1, -1) != VasEBoot_ERR_NONE) return; - if (scale_pixmap(self, BOX_PIXMAP_NE, -1, -1) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_NE, -1, -1) != VasEBoot_ERR_NONE) return; - if (scale_pixmap(self, BOX_PIXMAP_SE, -1, -1) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_SE, -1, -1) != VasEBoot_ERR_NONE) return; /* Scale the center area. */ - if (scale_pixmap(self, BOX_PIXMAP_CENTER, width, height) != GRUB_ERR_NONE) + if (scale_pixmap(self, BOX_PIXMAP_CENTER, width, height) != VasEBoot_ERR_NONE) return; } static int -get_border_width (grub_gfxmenu_box_t self) +get_border_width (VasEBoot_gfxmenu_box_t self) { return (get_width (self->raw_pixmaps[BOX_PIXMAP_E]) + get_width (self->raw_pixmaps[BOX_PIXMAP_W])); } static int -get_left_pad (grub_gfxmenu_box_t self) +get_left_pad (VasEBoot_gfxmenu_box_t self) { int v, c; @@ -212,7 +212,7 @@ get_left_pad (grub_gfxmenu_box_t self) } static int -get_top_pad (grub_gfxmenu_box_t self) +get_top_pad (VasEBoot_gfxmenu_box_t self) { int v, c; @@ -228,7 +228,7 @@ get_top_pad (grub_gfxmenu_box_t self) } static int -get_right_pad (grub_gfxmenu_box_t self) +get_right_pad (VasEBoot_gfxmenu_box_t self) { int v, c; @@ -244,7 +244,7 @@ get_right_pad (grub_gfxmenu_box_t self) } static int -get_bottom_pad (grub_gfxmenu_box_t self) +get_bottom_pad (VasEBoot_gfxmenu_box_t self) { int v, c; @@ -260,26 +260,26 @@ get_bottom_pad (grub_gfxmenu_box_t self) } static void -destroy (grub_gfxmenu_box_t self) +destroy (VasEBoot_gfxmenu_box_t self) { unsigned i; for (i = 0; i < BOX_NUM_PIXMAPS; i++) { if (self->raw_pixmaps[i]) - grub_video_bitmap_destroy(self->raw_pixmaps[i]); + VasEBoot_video_bitmap_destroy(self->raw_pixmaps[i]); self->raw_pixmaps[i] = 0; if (self->scaled_pixmaps[i]) - grub_video_bitmap_destroy(self->scaled_pixmaps[i]); + VasEBoot_video_bitmap_destroy(self->scaled_pixmaps[i]); self->scaled_pixmaps[i] = 0; } - grub_free (self->raw_pixmaps); + VasEBoot_free (self->raw_pixmaps); self->raw_pixmaps = 0; - grub_free (self->scaled_pixmaps); + VasEBoot_free (self->scaled_pixmaps); self->scaled_pixmaps = 0; /* Free self: must be the last step! */ - grub_free (self); + VasEBoot_free (self); } @@ -288,25 +288,25 @@ destroy (grub_gfxmenu_box_t self) northeast, southeast, southwest, and center pixmaps. If either PIXMAPS_PREFIX or PIXMAPS_SUFFIX is 0, then no pixmaps are loaded, and the box has zero-width borders and is drawn transparent. */ -grub_gfxmenu_box_t -grub_gfxmenu_create_box (const char *pixmaps_prefix, +VasEBoot_gfxmenu_box_t +VasEBoot_gfxmenu_create_box (const char *pixmaps_prefix, const char *pixmaps_suffix) { unsigned i; - grub_gfxmenu_box_t box; + VasEBoot_gfxmenu_box_t box; - box = (grub_gfxmenu_box_t) grub_malloc (sizeof (*box)); + box = (VasEBoot_gfxmenu_box_t) VasEBoot_malloc (sizeof (*box)); if (! box) return 0; box->content_width = 0; box->content_height = 0; box->raw_pixmaps = - (struct grub_video_bitmap **) - grub_malloc (BOX_NUM_PIXMAPS * sizeof (struct grub_video_bitmap *)); + (struct VasEBoot_video_bitmap **) + VasEBoot_malloc (BOX_NUM_PIXMAPS * sizeof (struct VasEBoot_video_bitmap *)); box->scaled_pixmaps = - (struct grub_video_bitmap **) - grub_malloc (BOX_NUM_PIXMAPS * sizeof (struct grub_video_bitmap *)); + (struct VasEBoot_video_bitmap **) + VasEBoot_malloc (BOX_NUM_PIXMAPS * sizeof (struct VasEBoot_video_bitmap *)); /* Initialize all pixmap pointers to NULL so that proper destruction can be performed if an error is encountered partway through construction. */ @@ -323,23 +323,23 @@ grub_gfxmenu_create_box (const char *pixmaps_prefix, char *path; char *path_end; - path = grub_malloc (grub_strlen (pixmaps_prefix) - + grub_strlen (box_pixmap_names[i]) - + grub_strlen (pixmaps_suffix) + path = VasEBoot_malloc (VasEBoot_strlen (pixmaps_prefix) + + VasEBoot_strlen (box_pixmap_names[i]) + + VasEBoot_strlen (pixmaps_suffix) + 1); if (! path) goto fail_and_destroy; /* Construct the specific path for this pixmap. */ - path_end = grub_stpcpy (path, pixmaps_prefix); - path_end = grub_stpcpy (path_end, box_pixmap_names[i]); - path_end = grub_stpcpy (path_end, pixmaps_suffix); + path_end = VasEBoot_stpcpy (path, pixmaps_prefix); + path_end = VasEBoot_stpcpy (path_end, box_pixmap_names[i]); + path_end = VasEBoot_stpcpy (path_end, pixmaps_suffix); - grub_video_bitmap_load (&box->raw_pixmaps[i], path); - grub_free (path); + VasEBoot_video_bitmap_load (&box->raw_pixmaps[i], path); + VasEBoot_free (path); /* Ignore missing pixmaps. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } } diff --git a/VasEBoot-core/gnulib-fix-gcc7-fallthrough.diff b/VasEBoot-core/gnulib-fix-gcc7-fallthrough.diff index 9802e2d24..04dee6845 100644 --- a/VasEBoot-core/gnulib-fix-gcc7-fallthrough.diff +++ b/VasEBoot-core/gnulib-fix-gcc7-fallthrough.diff @@ -1,7 +1,7 @@ -diff --git grub-core/gnulib/regexec.c grub-core/gnulib/regexec.c +diff --git VasEBoot-core/gnulib/regexec.c VasEBoot-core/gnulib/regexec.c index f632cd4..a7776f0 100644 ---- grub-core/gnulib/regexec.c -+++ grub-core/gnulib/regexec.c +--- VasEBoot-core/gnulib/regexec.c ++++ VasEBoot-core/gnulib/regexec.c @@ -4099,6 +4099,9 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node, case OP_UTF8_PERIOD: if (ch >= ASCII_CHARS) diff --git a/VasEBoot-core/gnulib-fix-null-deref.diff b/VasEBoot-core/gnulib-fix-null-deref.diff index a2fba8c3b..15164806e 100644 --- a/VasEBoot-core/gnulib-fix-null-deref.diff +++ b/VasEBoot-core/gnulib-fix-null-deref.diff @@ -1,6 +1,6 @@ -=== modified file 'grub-core/gnulib/argp-parse.c' ---- grub-core/gnulib/argp-parse.c 2010-04-02 22:45:01 +0000 -+++ grub-core/gnulib/argp-parse.c 2011-04-10 13:25:52 +0000 +=== modified file 'VasEBoot-core/gnulib/argp-parse.c' +--- VasEBoot-core/gnulib/argp-parse.c 2010-04-02 22:45:01 +0000 ++++ VasEBoot-core/gnulib/argp-parse.c 2011-04-10 13:25:52 +0000 @@ -935,7 +935,7 @@ void * __argp_input (const struct argp *argp, const struct argp_state *state) diff --git a/VasEBoot-core/gnulib-no-abort.diff b/VasEBoot-core/gnulib-no-abort.diff index 8377338f7..deb58ed10 100644 --- a/VasEBoot-core/gnulib-no-abort.diff +++ b/VasEBoot-core/gnulib-no-abort.diff @@ -1,6 +1,6 @@ -=== modified file 'grub-core/gnulib/regcomp.c' ---- grub-core/gnulib/regcomp.c 2010-09-20 10:35:33 +0000 -+++ grub-core/gnulib/regcomp.c 2012-03-10 11:31:42 +0000 +=== modified file 'VasEBoot-core/gnulib/regcomp.c' +--- VasEBoot-core/gnulib/regcomp.c 2010-09-20 10:35:33 +0000 ++++ VasEBoot-core/gnulib/regcomp.c 2012-03-10 11:31:42 +0000 @@ -549,13 +549,9 @@ regerror (int errcode, const regex_t *_R if (BE (errcode < 0 || errcode >= (int) (sizeof (__re_error_msgid_idx) diff --git a/VasEBoot-core/gnulib-no-gets.diff b/VasEBoot-core/gnulib-no-gets.diff index 1a9487e84..bb6b214bb 100644 --- a/VasEBoot-core/gnulib-no-gets.diff +++ b/VasEBoot-core/gnulib-no-gets.diff @@ -1,5 +1,5 @@ --- /tmp/x.diff 2013-04-11 16:51:42.777873536 +0200 -+++ grub-core/gnulib/stdio.in.h 2013-04-11 16:51:49.917873298 +0200 ++++ VasEBoot-core/gnulib/stdio.in.h 2013-04-11 16:51:49.917873298 +0200 @@ -700,7 +700,6 @@ removed it. */ #undef gets diff --git a/VasEBoot-core/gnulib/Makefile.am b/VasEBoot-core/gnulib/Makefile.am index 3444397fe..5a791f175 100644 --- a/VasEBoot-core/gnulib/Makefile.am +++ b/VasEBoot-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=VasEBoot-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 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects diff --git a/VasEBoot-core/hello/hello.c b/VasEBoot-core/hello/hello.c index 456b7c322..dd985585f 100644 --- a/VasEBoot-core/hello/hello.c +++ b/VasEBoot-core/hello/hello.c @@ -1,51 +1,51 @@ /* hello.c - test module for dynamic loading */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007 Free Software Foundation, Inc. * Copyright (C) 2003 NIIBE Yutaka * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_cmd_hello (grub_extcmd_context_t ctxt __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_hello (VasEBoot_extcmd_context_t ctxt __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_printf ("%s\n", _("Hello World")); + VasEBoot_printf ("%s\n", _("Hello World")); return 0; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(hello) +VasEBoot_MOD_INIT(hello) { - cmd = grub_register_extcmd ("hello", grub_cmd_hello, 0, 0, + cmd = VasEBoot_register_extcmd ("hello", VasEBoot_cmd_hello, 0, 0, N_("Say `Hello World'."), 0); } -GRUB_MOD_FINI(hello) +VasEBoot_MOD_FINI(hello) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/hook/datehook.c b/VasEBoot-core/hook/datehook.c index ac75908ef..791f0a779 100644 --- a/VasEBoot-core/hook/datehook.c +++ b/VasEBoot-core/hook/datehook.c @@ -1,32 +1,32 @@ /* datehook.c - Module to install datetime hooks. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static const char *grub_datetime_names[] = +static const char *VasEBoot_datetime_names[] = { "YEAR", "MONTH", @@ -38,19 +38,19 @@ static const char *grub_datetime_names[] = }; static const char * -grub_read_hook_datetime (struct grub_env_var *var, +VasEBoot_read_hook_datetime (struct VasEBoot_env_var *var, const char *val __attribute__ ((unused))) { - struct grub_datetime datetime; + struct VasEBoot_datetime datetime; static char buf[6]; buf[0] = 0; - if (! grub_get_datetime (&datetime)) + if (! VasEBoot_get_datetime (&datetime)) { int i; for (i = 0; i < 7; i++) - if (grub_strcmp (var->name, grub_datetime_names[i]) == 0) + if (VasEBoot_strcmp (var->name, VasEBoot_datetime_names[i]) == 0) { int n; @@ -75,10 +75,10 @@ grub_read_hook_datetime (struct grub_env_var *var, n = datetime.second; break; default: - return grub_get_weekday_name (&datetime); + return VasEBoot_get_weekday_name (&datetime); } - grub_snprintf (buf, sizeof (buf), "%d", n); + VasEBoot_snprintf (buf, sizeof (buf), "%d", n); break; } } @@ -86,25 +86,25 @@ grub_read_hook_datetime (struct grub_env_var *var, return buf; } -GRUB_MOD_INIT(datehook) +VasEBoot_MOD_INIT(datehook) { unsigned i; - for (i = 0; i < ARRAY_SIZE (grub_datetime_names); i++) + for (i = 0; i < ARRAY_SIZE (VasEBoot_datetime_names); i++) { - grub_register_variable_hook (grub_datetime_names[i], - grub_read_hook_datetime, 0); - grub_env_export (grub_datetime_names[i]); + VasEBoot_register_variable_hook (VasEBoot_datetime_names[i], + VasEBoot_read_hook_datetime, 0); + VasEBoot_env_export (VasEBoot_datetime_names[i]); } } -GRUB_MOD_FINI(datehook) +VasEBoot_MOD_FINI(datehook) { unsigned i; - for (i = 0; i < ARRAY_SIZE (grub_datetime_names); i++) + for (i = 0; i < ARRAY_SIZE (VasEBoot_datetime_names); i++) { - grub_register_variable_hook (grub_datetime_names[i], 0, 0); - grub_env_unset (grub_datetime_names[i]); + VasEBoot_register_variable_hook (VasEBoot_datetime_names[i], 0, 0); + VasEBoot_env_unset (VasEBoot_datetime_names[i]); } } diff --git a/VasEBoot-core/io/bufio.c b/VasEBoot-core/io/bufio.c index 22438277d..a3cc23a6c 100644 --- a/VasEBoot-core/io/bufio.c +++ b/VasEBoot-core/io/bufio.c @@ -1,70 +1,70 @@ /* bufio.c - buffered io access */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_BUFIO_DEF_SIZE 8192 -#define GRUB_BUFIO_MAX_SIZE 1048576 +#define VasEBoot_BUFIO_DEF_SIZE 8192 +#define VasEBoot_BUFIO_MAX_SIZE 1048576 -struct grub_bufio +struct VasEBoot_bufio { - grub_file_t file; - grub_size_t block_size; - grub_size_t buffer_len; - grub_off_t buffer_at; + VasEBoot_file_t file; + VasEBoot_size_t block_size; + VasEBoot_size_t buffer_len; + VasEBoot_off_t buffer_at; char buffer[0]; }; -typedef struct grub_bufio *grub_bufio_t; +typedef struct VasEBoot_bufio *VasEBoot_bufio_t; -static struct grub_fs grub_bufio_fs; +static struct VasEBoot_fs VasEBoot_bufio_fs; -grub_file_t -grub_bufio_open (grub_file_t io, int size) +VasEBoot_file_t +VasEBoot_bufio_open (VasEBoot_file_t io, int size) { - grub_file_t file; - grub_bufio_t bufio = 0; + VasEBoot_file_t file; + VasEBoot_bufio_t bufio = 0; - file = (grub_file_t) grub_zalloc (sizeof (*file)); + file = (VasEBoot_file_t) VasEBoot_zalloc (sizeof (*file)); if (! file) return 0; if (size == 0) - size = GRUB_BUFIO_DEF_SIZE; - else if (size > GRUB_BUFIO_MAX_SIZE) - size = GRUB_BUFIO_MAX_SIZE; + size = VasEBoot_BUFIO_DEF_SIZE; + else if (size > VasEBoot_BUFIO_MAX_SIZE) + size = VasEBoot_BUFIO_MAX_SIZE; if ((size < 0) || ((unsigned) size > io->size)) - size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE : + size = ((io->size > VasEBoot_BUFIO_MAX_SIZE) ? VasEBoot_BUFIO_MAX_SIZE : io->size); - bufio = grub_zalloc (sizeof (struct grub_bufio) + size); + bufio = VasEBoot_zalloc (sizeof (struct VasEBoot_bufio) + size); if (! bufio) { - grub_free (file); + VasEBoot_free (file); return 0; } @@ -74,55 +74,55 @@ grub_bufio_open (grub_file_t io, int size) file->device = io->device; file->size = io->size; file->data = bufio; - file->fs = &grub_bufio_fs; + file->fs = &VasEBoot_bufio_fs; file->not_easily_seekable = io->not_easily_seekable; return file; } -grub_file_t -grub_buffile_open (const char *name, int size) +VasEBoot_file_t +VasEBoot_buffile_open (const char *name, int size) { - grub_file_t io, file; + VasEBoot_file_t io, file; - io = grub_file_open (name); + io = VasEBoot_file_open (name); if (! io) return 0; - file = grub_bufio_open (io, size); + file = VasEBoot_bufio_open (io, size); if (! file) { - grub_file_close (io); + VasEBoot_file_close (io); return 0; } return file; } -static grub_ssize_t -grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_bufio_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - grub_size_t res = 0; - grub_off_t next_buf; - grub_bufio_t bufio = file->data; - grub_ssize_t really_read; + VasEBoot_size_t res = 0; + VasEBoot_off_t next_buf; + VasEBoot_bufio_t bufio = file->data; + VasEBoot_ssize_t really_read; - if (file->size == GRUB_FILE_SIZE_UNKNOWN) + if (file->size == VasEBoot_FILE_SIZE_UNKNOWN) file->size = bufio->file->size; /* First part: use whatever we already have in the buffer. */ if ((file->offset >= bufio->buffer_at) && (file->offset < bufio->buffer_at + bufio->buffer_len)) { - grub_size_t n; - grub_uint64_t pos; + VasEBoot_size_t n; + VasEBoot_uint64_t pos; pos = file->offset - bufio->buffer_at; n = bufio->buffer_len - pos; if (n > len) n = len; - grub_memcpy (buf, &bufio->buffer[pos], n); + VasEBoot_memcpy (buf, &bufio->buffer[pos], n); len -= n; res += n; @@ -132,17 +132,17 @@ grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) return res; /* Need to read some more. */ - next_buf = (file->offset + res + len - 1) & ~((grub_off_t) bufio->block_size - 1); + next_buf = (file->offset + res + len - 1) & ~((VasEBoot_off_t) bufio->block_size - 1); /* Now read between file->offset + res and bufio->buffer_at. */ if (file->offset + res < next_buf) { - grub_size_t read_now; + VasEBoot_size_t read_now; read_now = next_buf - (file->offset + res); - grub_file_seek (bufio->file, file->offset + res); - really_read = grub_file_read (bufio->file, buf, read_now); + VasEBoot_file_seek (bufio->file, file->offset + res); + really_read = VasEBoot_file_read (bufio->file, buf, read_now); if (really_read < 0) return -1; - if (file->size == GRUB_FILE_SIZE_UNKNOWN) + if (file->size == VasEBoot_FILE_SIZE_UNKNOWN) file->size = bufio->file->size; len -= really_read; buf += really_read; @@ -150,58 +150,58 @@ grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) /* Partial read. File ended unexpectedly. Save the last chunk in buffer. */ - if (really_read != (grub_ssize_t) read_now) + if (really_read != (VasEBoot_ssize_t) read_now) { bufio->buffer_len = really_read; if (bufio->buffer_len > bufio->block_size) bufio->buffer_len = bufio->block_size; bufio->buffer_at = file->offset + res - bufio->buffer_len; - grub_memcpy (&bufio->buffer[0], buf - bufio->buffer_len, + VasEBoot_memcpy (&bufio->buffer[0], buf - bufio->buffer_len, bufio->buffer_len); return res; } } /* Read into buffer. */ - grub_file_seek (bufio->file, next_buf); - really_read = grub_file_read (bufio->file, bufio->buffer, + VasEBoot_file_seek (bufio->file, next_buf); + really_read = VasEBoot_file_read (bufio->file, bufio->buffer, bufio->block_size); if (really_read < 0) return -1; bufio->buffer_at = next_buf; bufio->buffer_len = really_read; - if (file->size == GRUB_FILE_SIZE_UNKNOWN) + if (file->size == VasEBoot_FILE_SIZE_UNKNOWN) file->size = bufio->file->size; if (len > bufio->buffer_len) len = bufio->buffer_len; - grub_memcpy (buf, &bufio->buffer[file->offset + res - next_buf], len); + VasEBoot_memcpy (buf, &bufio->buffer[file->offset + res - next_buf], len); res += len; return res; } -static grub_err_t -grub_bufio_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_bufio_close (VasEBoot_file_t file) { - grub_bufio_t bufio = file->data; + VasEBoot_bufio_t bufio = file->data; - grub_file_close (bufio->file); - grub_free (bufio); + VasEBoot_file_close (bufio->file); + VasEBoot_free (bufio); file->device = 0; - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_bufio_fs = +static struct VasEBoot_fs VasEBoot_bufio_fs = { .name = "bufio", .dir = 0, .open = 0, - .read = grub_bufio_read, - .close = grub_bufio_close, + .read = VasEBoot_bufio_read, + .close = VasEBoot_bufio_close, .label = 0, .next = 0 }; diff --git a/VasEBoot-core/io/gzio.c b/VasEBoot-core/io/gzio.c index 0f2ea6bd8..946e88def 100644 --- a/VasEBoot-core/io/gzio.c +++ b/VasEBoot-core/io/gzio.c @@ -1,20 +1,20 @@ /* gzio.c - decompression support for gzip */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* @@ -34,17 +34,17 @@ comments to that effect with your name and the date. Thank you. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* * Window Size @@ -58,15 +58,15 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define INBUFSIZ 0x2000 /* The state stored in filesystem-specific data. */ -struct grub_gzio +struct VasEBoot_gzio { /* The underlying file object. */ - grub_file_t file; + VasEBoot_file_t file; /* If input is in memory following fields are used instead of file. */ - grub_size_t mem_input_size, mem_input_off; - grub_uint8_t *mem_input; + VasEBoot_size_t mem_input_size, mem_input_off; + VasEBoot_uint8_t *mem_input; /* The offset at which the data starts in the underlying file. */ - grub_off_t data_offset; + VasEBoot_off_t data_offset; /* The type of current block. */ int block_type; /* The length of current block. */ @@ -80,14 +80,14 @@ struct grub_gzio /* The index of a copy. */ unsigned inflate_d; /* The input buffer. */ - grub_uint8_t inbuf[INBUFSIZ]; + VasEBoot_uint8_t inbuf[INBUFSIZ]; int inbuf_d; /* The bit buffer. */ unsigned long bb; /* The bits in the bit buffer. */ unsigned bk; /* The sliding window in uncompressed data. */ - grub_uint8_t slide[WSIZE]; + VasEBoot_uint8_t slide[WSIZE]; /* Current position in the slide. */ unsigned wp; /* The literal/length code table. */ @@ -99,19 +99,19 @@ struct grub_gzio /* The lookup bits for the distance code table. */ int bd; /* The original offset value. */ - grub_off_t saved_offset; + VasEBoot_off_t saved_offset; }; -typedef struct grub_gzio *grub_gzio_t; +typedef struct VasEBoot_gzio *VasEBoot_gzio_t; -/* Declare the filesystem structure for grub_gzio_open. */ -static struct grub_fs grub_gzio_fs; +/* Declare the filesystem structure for VasEBoot_gzio_open. */ +static struct VasEBoot_fs VasEBoot_gzio_fs; /* Function prototypes */ -static void initialize_tables (grub_gzio_t); +static void initialize_tables (VasEBoot_gzio_t); /* Eat variable-length header fields. */ static int -eat_field (grub_file_t file, int len) +eat_field (VasEBoot_file_t file, int len) { char ch = 1; int not_retval = 1; @@ -129,15 +129,15 @@ eat_field (grub_file_t file, int len) break; } } - while ((not_retval = grub_file_read (file, &ch, 1)) == 1); + while ((not_retval = VasEBoot_file_read (file, &ch, 1)) == 1); return ! not_retval; } /* Little-Endian defines for the 2-byte magic numbers for gzip files. */ -#define GZIP_MAGIC grub_le_to_cpu16 (0x8B1F) -#define OLD_GZIP_MAGIC grub_le_to_cpu16 (0x9E1F) +#define GZIP_MAGIC VasEBoot_le_to_cpu16 (0x8B1F) +#define OLD_GZIP_MAGIC VasEBoot_le_to_cpu16 (0x9E1F) /* Compression methods (see algorithm.doc) */ #define STORED 0 @@ -169,29 +169,29 @@ typedef unsigned short ush; typedef unsigned long ulg; static int -test_gzip_header (grub_file_t file) +test_gzip_header (VasEBoot_file_t file) { struct { - grub_uint16_t magic; - grub_uint8_t method; - grub_uint8_t flags; - grub_uint32_t timestamp; - grub_uint8_t extra_flags; - grub_uint8_t os_type; + VasEBoot_uint16_t magic; + VasEBoot_uint8_t method; + VasEBoot_uint8_t flags; + VasEBoot_uint32_t timestamp; + VasEBoot_uint8_t extra_flags; + VasEBoot_uint8_t os_type; } hdr; - grub_uint16_t extra_len; - grub_uint32_t orig_len; - grub_gzio_t gzio = file->data; + VasEBoot_uint16_t extra_len; + VasEBoot_uint32_t orig_len; + VasEBoot_gzio_t gzio = file->data; - if (grub_file_tell (gzio->file) != 0) - grub_file_seek (gzio->file, 0); + if (VasEBoot_file_tell (gzio->file) != 0) + VasEBoot_file_seek (gzio->file, 0); /* * This checks if the file is gzipped. If a problem occurs here * (other than a real error with the disk) then we don't think it * is a compressed file, and simply mark it as such. */ - if (grub_file_read (gzio->file, &hdr, 10) != 10 + if (VasEBoot_file_read (gzio->file, &hdr, 10) != 10 || ((hdr.magic != GZIP_MAGIC) && (hdr.magic != OLD_GZIP_MAGIC))) return 0; @@ -204,23 +204,23 @@ test_gzip_header (grub_file_t file) if (hdr.method != DEFLATED || (hdr.flags & UNSUPPORTED_FLAGS) || ((hdr.flags & EXTRA_FIELD) - && (grub_file_read (gzio->file, &extra_len, 2) != 2 + && (VasEBoot_file_read (gzio->file, &extra_len, 2) != 2 || eat_field (gzio->file, - grub_le_to_cpu16 (extra_len)))) + VasEBoot_le_to_cpu16 (extra_len)))) || ((hdr.flags & ORIG_NAME) && eat_field (gzio->file, -1)) || ((hdr.flags & COMMENT) && eat_field (gzio->file, -1))) return 0; - gzio->data_offset = grub_file_tell (gzio->file); + gzio->data_offset = VasEBoot_file_tell (gzio->file); /* FIXME: don't do this on not easily seekable files. */ { - grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4); - if (grub_file_read (gzio->file, &orig_len, 4) != 4) + VasEBoot_file_seek (gzio->file, VasEBoot_file_size (gzio->file) - 4); + if (VasEBoot_file_read (gzio->file, &orig_len, 4) != 4) return 0; /* FIXME: this does not handle files whose original size is over 4GB. But how can we know the real original size? */ - file->size = grub_le_to_cpu32 (orig_len); + file->size = VasEBoot_le_to_cpu32 (orig_len); } initialize_tables (gzio); @@ -367,7 +367,7 @@ static ush mask_bits[] = #define DUMPBITS(n) do {b>>=(n);k-=(n);} while (0) static int -get_byte (grub_gzio_t gzio) +get_byte (VasEBoot_gzio_t gzio) { if (gzio->mem_input) { @@ -376,37 +376,37 @@ get_byte (grub_gzio_t gzio) return 0; } - if (gzio->file && (grub_file_tell (gzio->file) - == (grub_off_t) gzio->data_offset + if (gzio->file && (VasEBoot_file_tell (gzio->file) + == (VasEBoot_off_t) gzio->data_offset || gzio->inbuf_d == INBUFSIZ)) { gzio->inbuf_d = 0; - grub_file_read (gzio->file, gzio->inbuf, INBUFSIZ); + VasEBoot_file_read (gzio->file, gzio->inbuf, INBUFSIZ); } return gzio->inbuf[gzio->inbuf_d++]; } static void -gzio_seek (grub_gzio_t gzio, grub_off_t off) +gzio_seek (VasEBoot_gzio_t gzio, VasEBoot_off_t off) { if (gzio->mem_input) { if (off > gzio->mem_input_size) - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to seek outside of the file")); else gzio->mem_input_off = off; } else - grub_file_seek (gzio->file, off); + VasEBoot_file_seek (gzio->file, off); } /* more function prototypes */ static int huft_build (unsigned *, unsigned, unsigned, ush *, ush *, struct huft **, int *); static int huft_free (struct huft *); -static int inflate_codes_in_window (grub_gzio_t); +static int inflate_codes_in_window (VasEBoot_gzio_t); /* Given a list of code lengths and a maximum table size, make a set of @@ -445,7 +445,7 @@ huft_build (unsigned *b, /* code lengths in bits (all assumed <= BMAX) */ unsigned z; /* number of entries in current table */ /* Generate counts for each bit length */ - grub_memset ((char *) c, 0, sizeof (c)); + VasEBoot_memset ((char *) c, 0, sizeof (c)); p = b; i = n; do @@ -542,7 +542,7 @@ huft_build (unsigned *b, /* code lengths in bits (all assumed <= BMAX) */ z = 1 << j; /* table entries for j-bit table */ /* allocate and link in new table */ - q = (struct huft *) grub_zalloc ((z + 1) * sizeof (struct huft)); + q = (struct huft *) VasEBoot_zalloc ((z + 1) * sizeof (struct huft)); if (! q) { if (h) @@ -620,7 +620,7 @@ huft_free (struct huft *t) while (p != (struct huft *) NULL) { q = (--p)->v.t; - grub_free ((char *) p); + VasEBoot_free ((char *) p); p = q; } return 0; @@ -633,7 +633,7 @@ huft_free (struct huft *t) */ static int -inflate_codes_in_window (grub_gzio_t gzio) +inflate_codes_in_window (VasEBoot_gzio_t gzio) { register unsigned e; /* table entry flag/number of extra bits */ unsigned n, d; /* length and index for copy */ @@ -663,7 +663,7 @@ inflate_codes_in_window (grub_gzio_t gzio) { if (e == 99) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "an unused code found"); return 1; } @@ -702,7 +702,7 @@ inflate_codes_in_window (grub_gzio_t gzio) { if (e == 99) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "an unused code found"); return 1; } @@ -730,7 +730,7 @@ inflate_codes_in_window (grub_gzio_t gzio) if (w - d >= e) { - grub_memmove (gzio->slide + w, gzio->slide + d, e); + VasEBoot_memmove (gzio->slide + w, gzio->slide + d, e); w += e; d += e; } @@ -769,7 +769,7 @@ inflate_codes_in_window (grub_gzio_t gzio) /* get header for an inflated type 0 (stored) block. */ static void -init_stored_block (grub_gzio_t gzio) +init_stored_block (VasEBoot_gzio_t gzio) { register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ @@ -787,7 +787,7 @@ init_stored_block (grub_gzio_t gzio) DUMPBITS (16); NEEDBITS (16); if (gzio->block_len != (int) ((~b) & 0xffff)) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "the length of a stored block does not match"); DUMPBITS (16); @@ -802,7 +802,7 @@ init_stored_block (grub_gzio_t gzio) Huffman tables. */ static void -init_fixed_block (grub_gzio_t gzio) +init_fixed_block (VasEBoot_gzio_t gzio) { int i; /* temporary variable */ unsigned l[288]; /* length list for huft_build */ @@ -819,8 +819,8 @@ init_fixed_block (grub_gzio_t gzio) gzio->bl = 7; if (huft_build (l, 288, 257, cplens, cplext, &gzio->tl, &gzio->bl) != 0) { - if (grub_errno == GRUB_ERR_NONE) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (VasEBoot_errno == VasEBoot_ERR_NONE) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "failed in building a Huffman code table"); return; } @@ -831,8 +831,8 @@ init_fixed_block (grub_gzio_t gzio) gzio->bd = 5; if (huft_build (l, 30, 0, cpdist, cpdext, &gzio->td, &gzio->bd) > 1) { - if (grub_errno == GRUB_ERR_NONE) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + if (VasEBoot_errno == VasEBoot_ERR_NONE) + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "failed in building a Huffman code table"); huft_free (gzio->tl); gzio->tl = 0; @@ -848,7 +848,7 @@ init_fixed_block (grub_gzio_t gzio) /* get header for an inflated type 2 (dynamic Huffman codes) block. */ static void -init_dynamic_block (grub_gzio_t gzio) +init_dynamic_block (VasEBoot_gzio_t gzio) { int i; /* temporary variables */ unsigned j; @@ -878,7 +878,7 @@ init_dynamic_block (grub_gzio_t gzio) DUMPBITS (4); if (nl > 286 || nd > 30) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too much data"); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "too much data"); return; } @@ -896,7 +896,7 @@ init_dynamic_block (grub_gzio_t gzio) gzio->bl = 7; if (huft_build (ll, 19, 19, NULL, NULL, &gzio->tl, &gzio->bl) != 0) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "failed in building a Huffman code table"); return; } @@ -920,7 +920,7 @@ init_dynamic_block (grub_gzio_t gzio) DUMPBITS (2); if ((unsigned) i + j > n) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too many codes found"); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "too many codes found"); return; } while (j--) @@ -933,7 +933,7 @@ init_dynamic_block (grub_gzio_t gzio) DUMPBITS (3); if ((unsigned) i + j > n) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too many codes found"); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "too many codes found"); return; } while (j--) @@ -948,7 +948,7 @@ init_dynamic_block (grub_gzio_t gzio) DUMPBITS (7); if ((unsigned) i + j > n) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too many codes found"); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "too many codes found"); return; } while (j--) @@ -970,7 +970,7 @@ init_dynamic_block (grub_gzio_t gzio) gzio->bl = lbits; if (huft_build (ll, nl, 257, cplens, cplext, &gzio->tl, &gzio->bl) != 0) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "failed in building a Huffman code table"); return; } @@ -979,7 +979,7 @@ init_dynamic_block (grub_gzio_t gzio) { huft_free (gzio->tl); gzio->tl = 0; - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "failed in building a Huffman code table"); return; } @@ -991,7 +991,7 @@ init_dynamic_block (grub_gzio_t gzio) static void -get_new_block (grub_gzio_t gzio) +get_new_block (VasEBoot_gzio_t gzio) { register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ @@ -1032,7 +1032,7 @@ get_new_block (grub_gzio_t gzio) static void -inflate_window (grub_gzio_t gzio) +inflate_window (VasEBoot_gzio_t gzio) { /* initialize window */ gzio->wp = 0; @@ -1041,7 +1041,7 @@ inflate_window (grub_gzio_t gzio) * Main decompression loop. */ - while (gzio->wp < WSIZE && grub_errno == GRUB_ERR_NONE) + while (gzio->wp < WSIZE && VasEBoot_errno == VasEBoot_ERR_NONE) { if (! gzio->block_len) { @@ -1052,10 +1052,10 @@ inflate_window (grub_gzio_t gzio) } if (gzio->block_type > INFLATE_DYNAMIC) - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "unknown block type %d", gzio->block_type); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) return; /* @@ -1069,7 +1069,7 @@ inflate_window (grub_gzio_t gzio) * This is basically a glorified pass-through */ - while (gzio->block_len && w < WSIZE && grub_errno == GRUB_ERR_NONE) + while (gzio->block_len && w < WSIZE && VasEBoot_errno == VasEBoot_ERR_NONE) { gzio->slide[w++] = get_byte (gzio); gzio->block_len--; @@ -1100,7 +1100,7 @@ inflate_window (grub_gzio_t gzio) static void -initialize_tables (grub_gzio_t gzio) +initialize_tables (VasEBoot_gzio_t gzio) { gzio->saved_offset = 0; gzio_seek (gzio, gzio->data_offset); @@ -1124,20 +1124,20 @@ initialize_tables (grub_gzio_t gzio) /* Open a new decompressing object on the top of IO. If TRANSPARENT is true, even if IO does not contain data compressed by gzip, return a valid file object. Note that this function won't close IO, even if an error occurs. */ -static grub_file_t -grub_gzio_open (grub_file_t io, const char *name __attribute__ ((unused))) +static VasEBoot_file_t +VasEBoot_gzio_open (VasEBoot_file_t io, const char *name __attribute__ ((unused))) { - grub_file_t file; - grub_gzio_t gzio = 0; + VasEBoot_file_t file; + VasEBoot_gzio_t gzio = 0; - file = (grub_file_t) grub_zalloc (sizeof (*file)); + file = (VasEBoot_file_t) VasEBoot_zalloc (sizeof (*file)); if (! file) return 0; - gzio = grub_zalloc (sizeof (*gzio)); + gzio = VasEBoot_zalloc (sizeof (*gzio)); if (! gzio) { - grub_free (file); + VasEBoot_free (file); return 0; } @@ -1145,15 +1145,15 @@ grub_gzio_open (grub_file_t io, const char *name __attribute__ ((unused))) file->device = io->device; file->data = gzio; - file->fs = &grub_gzio_fs; + file->fs = &VasEBoot_gzio_fs; file->not_easily_seekable = 1; if (! test_gzip_header (file)) { - grub_errno = GRUB_ERR_NONE; - grub_free (gzio); - grub_free (file); - grub_file_seek (io, 0); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (gzio); + VasEBoot_free (file); + VasEBoot_file_seek (io, 0); return io; } @@ -1161,8 +1161,8 @@ grub_gzio_open (grub_file_t io, const char *name __attribute__ ((unused))) return file; } -static grub_uint8_t -mod_31 (grub_uint16_t v) +static VasEBoot_uint8_t +mod_31 (VasEBoot_uint16_t v) { /* At most 2 iterations for any number that we can get here. @@ -1175,9 +1175,9 @@ mod_31 (grub_uint16_t v) } static int -test_zlib_header (grub_gzio_t gzio) +test_zlib_header (VasEBoot_gzio_t gzio) { - grub_uint8_t cmf, flg; + VasEBoot_uint8_t cmf, flg; cmf = get_byte (gzio); flg = get_byte (gzio); @@ -1187,7 +1187,7 @@ test_zlib_header (grub_gzio_t gzio) { /* TRANSLATORS: It's about given file having some strange format, not complete lack of gzip support. */ - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); return 0; } @@ -1196,14 +1196,14 @@ test_zlib_header (grub_gzio_t gzio) /* By multiplying by 4 and using 32 == 1 (31). We get our formula. */ if (mod_31 (cmf + flg * 4) != 0) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); return 0; } /* Dictionary isn't supported. */ if (flg & 0x20) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); return 0; } @@ -1213,11 +1213,11 @@ test_zlib_header (grub_gzio_t gzio) return 1; } -static grub_ssize_t -grub_gzio_read_real (grub_gzio_t gzio, grub_off_t offset, - char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_gzio_read_real (VasEBoot_gzio_t gzio, VasEBoot_off_t offset, + char *buf, VasEBoot_size_t len) { - grub_ssize_t ret = 0; + VasEBoot_ssize_t ret = 0; /* Do we reset decompression to the beginning of the file? */ if (gzio->saved_offset > offset + WSIZE) @@ -1229,9 +1229,9 @@ grub_gzio_read_real (grub_gzio_t gzio, grub_off_t offset, * window is within the range of data it needs. */ - while (len > 0 && grub_errno == GRUB_ERR_NONE) + while (len > 0 && VasEBoot_errno == VasEBoot_ERR_NONE) { - register grub_size_t size; + register VasEBoot_size_t size; register char *srcaddr; while (offset >= gzio->saved_offset) @@ -1249,7 +1249,7 @@ grub_gzio_read_real (grub_gzio_t gzio, grub_off_t offset, if (size > len) size = len; - grub_memmove (buf, srcaddr, size); + VasEBoot_memmove (buf, srcaddr, size); buf += size; len -= size; @@ -1258,112 +1258,112 @@ grub_gzio_read_real (grub_gzio_t gzio, grub_off_t offset, } out: - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) ret = -1; return ret; } -static grub_ssize_t -grub_gzio_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_gzio_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - grub_ssize_t ret; - ret = grub_gzio_read_real (file->data, file->offset, buf, len); + VasEBoot_ssize_t ret; + ret = VasEBoot_gzio_read_real (file->data, file->offset, buf, len); - if (!grub_errno && ret != (grub_ssize_t) len) + if (!VasEBoot_errno && ret != (VasEBoot_ssize_t) len) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, "premature end of compressed"); ret = -1; } return ret; } /* Release everything, including the underlying file object. */ -static grub_err_t -grub_gzio_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_gzio_close (VasEBoot_file_t file) { - grub_gzio_t gzio = file->data; + VasEBoot_gzio_t gzio = file->data; - grub_file_close (gzio->file); + VasEBoot_file_close (gzio->file); huft_free (gzio->tl); huft_free (gzio->td); - grub_free (gzio); + VasEBoot_free (gzio); /* No need to close the same device twice. */ file->device = 0; file->name = 0; - return grub_errno; + return VasEBoot_errno; } -grub_ssize_t -grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t outsize) +VasEBoot_ssize_t +VasEBoot_zlib_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t outsize) { - grub_gzio_t gzio = 0; - grub_ssize_t ret; + VasEBoot_gzio_t gzio = 0; + VasEBoot_ssize_t ret; - gzio = grub_zalloc (sizeof (*gzio)); + gzio = VasEBoot_zalloc (sizeof (*gzio)); if (! gzio) return -1; - gzio->mem_input = (grub_uint8_t *) inbuf; + gzio->mem_input = (VasEBoot_uint8_t *) inbuf; gzio->mem_input_size = insize; gzio->mem_input_off = 0; if (!test_zlib_header (gzio)) { - grub_free (gzio); + VasEBoot_free (gzio); return -1; } - ret = grub_gzio_read_real (gzio, off, outbuf, outsize); - grub_free (gzio); + ret = VasEBoot_gzio_read_real (gzio, off, outbuf, outsize); + VasEBoot_free (gzio); /* FIXME: Check Adler. */ return ret; } -grub_ssize_t -grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t outsize) +VasEBoot_ssize_t +VasEBoot_deflate_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t outsize) { - grub_gzio_t gzio = 0; - grub_ssize_t ret; + VasEBoot_gzio_t gzio = 0; + VasEBoot_ssize_t ret; - gzio = grub_zalloc (sizeof (*gzio)); + gzio = VasEBoot_zalloc (sizeof (*gzio)); if (! gzio) return -1; - gzio->mem_input = (grub_uint8_t *) inbuf; + gzio->mem_input = (VasEBoot_uint8_t *) inbuf; gzio->mem_input_size = insize; gzio->mem_input_off = 0; initialize_tables (gzio); - ret = grub_gzio_read_real (gzio, off, outbuf, outsize); - grub_free (gzio); + ret = VasEBoot_gzio_read_real (gzio, off, outbuf, outsize); + VasEBoot_free (gzio); return ret; } -static struct grub_fs grub_gzio_fs = +static struct VasEBoot_fs VasEBoot_gzio_fs = { .name = "gzio", .dir = 0, .open = 0, - .read = grub_gzio_read, - .close = grub_gzio_close, + .read = VasEBoot_gzio_read, + .close = VasEBoot_gzio_close, .label = 0, .next = 0 }; -GRUB_MOD_INIT(gzio) +VasEBoot_MOD_INIT(gzio) { - grub_file_filter_register (GRUB_FILE_FILTER_GZIO, grub_gzio_open); + VasEBoot_file_filter_register (VasEBoot_FILE_FILTER_GZIO, VasEBoot_gzio_open); } -GRUB_MOD_FINI(gzio) +VasEBoot_MOD_FINI(gzio) { - grub_file_filter_unregister (GRUB_FILE_FILTER_GZIO); + VasEBoot_file_filter_unregister (VasEBoot_FILE_FILTER_GZIO); } diff --git a/VasEBoot-core/io/lzopio.c b/VasEBoot-core/io/lzopio.c index 7559c6c9c..236848fb5 100644 --- a/VasEBoot-core/io/lzopio.c +++ b/VasEBoot-core/io/lzopio.c @@ -1,31 +1,31 @@ /* lzopio.c - decompression support for lzop */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define LZOP_MAGIC "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a" #define LZOP_MAGIC_SIZE 9 @@ -51,28 +51,28 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct block_header { - grub_uint32_t usize; - grub_uint32_t csize; - grub_uint32_t ucheck; - grub_uint32_t ccheck; + VasEBoot_uint32_t usize; + VasEBoot_uint32_t csize; + VasEBoot_uint32_t ucheck; + VasEBoot_uint32_t ccheck; unsigned char *cdata; unsigned char *udata; }; -struct grub_lzopio +struct VasEBoot_lzopio { - grub_file_t file; + VasEBoot_file_t file; int has_ccheck; int has_ucheck; const gcry_md_spec_t *ucheck_fun; const gcry_md_spec_t *ccheck_fun; - grub_off_t saved_off; /* Rounded down to block boundary. */ - grub_off_t start_block_off; + VasEBoot_off_t saved_off; /* Rounded down to block boundary. */ + VasEBoot_off_t start_block_off; struct block_header block; }; -typedef struct grub_lzopio *grub_lzopio_t; -static struct grub_fs grub_lzopio_fs; +typedef struct VasEBoot_lzopio *VasEBoot_lzopio_t; +static struct VasEBoot_fs VasEBoot_lzopio_fs; /* Some helper functions. On errors memory allocated by those function is free * either on close() so no risk of leaks. This makes functions simpler. */ @@ -80,39 +80,39 @@ static struct grub_fs grub_lzopio_fs; /* Read block header from file, after successful exit file points to * beginning of block data. */ static int -read_block_header (struct grub_lzopio *lzopio) +read_block_header (struct VasEBoot_lzopio *lzopio) { lzopio->saved_off += lzopio->block.usize; /* Free cached block data if any. */ - grub_free (lzopio->block.udata); - grub_free (lzopio->block.cdata); + VasEBoot_free (lzopio->block.udata); + VasEBoot_free (lzopio->block.cdata); lzopio->block.udata = NULL; lzopio->block.cdata = NULL; - if (grub_file_read (lzopio->file, &lzopio->block.usize, + if (VasEBoot_file_read (lzopio->file, &lzopio->block.usize, sizeof (lzopio->block.usize)) != sizeof (lzopio->block.usize)) return -1; - lzopio->block.usize = grub_be_to_cpu32 (lzopio->block.usize); + lzopio->block.usize = VasEBoot_be_to_cpu32 (lzopio->block.usize); /* Last block has uncompressed data size == 0 and no other fields. */ if (lzopio->block.usize == 0) { - if (grub_file_tell (lzopio->file) == grub_file_size (lzopio->file)) + if (VasEBoot_file_tell (lzopio->file) == VasEBoot_file_size (lzopio->file)) return 0; else return -1; } /* Read compressed data block size. */ - if (grub_file_read (lzopio->file, &lzopio->block.csize, + if (VasEBoot_file_read (lzopio->file, &lzopio->block.csize, sizeof (lzopio->block.csize)) != sizeof (lzopio->block.csize)) return -1; - lzopio->block.csize = grub_be_to_cpu32 (lzopio->block.csize); + lzopio->block.csize = VasEBoot_be_to_cpu32 (lzopio->block.csize); /* Corrupted. */ if (lzopio->block.csize > lzopio->block.usize) @@ -121,7 +121,7 @@ read_block_header (struct grub_lzopio *lzopio) /* Read checksum of uncompressed data. */ if (lzopio->has_ucheck) { - if (grub_file_read (lzopio->file, &lzopio->block.ucheck, + if (VasEBoot_file_read (lzopio->file, &lzopio->block.ucheck, sizeof (lzopio->block.ucheck)) != sizeof (lzopio->block.ucheck)) return -1; @@ -139,7 +139,7 @@ read_block_header (struct grub_lzopio *lzopio) } else { - if (grub_file_read (lzopio->file, &lzopio->block.ccheck, + if (VasEBoot_file_read (lzopio->file, &lzopio->block.ccheck, sizeof (lzopio->block.ccheck)) != sizeof (lzopio->block.ccheck)) return -1; @@ -154,28 +154,28 @@ read_block_header (struct grub_lzopio *lzopio) /* Read block data into memory. File must be set to beginning of block data. * Can't be called on last block. */ static int -read_block_data (struct grub_lzopio *lzopio) +read_block_data (struct VasEBoot_lzopio *lzopio) { - lzopio->block.cdata = grub_malloc (lzopio->block.csize); + lzopio->block.cdata = VasEBoot_malloc (lzopio->block.csize); if (!lzopio->block.cdata) return -1; - if (grub_file_read (lzopio->file, lzopio->block.cdata, lzopio->block.csize) - != (grub_ssize_t) lzopio->block.csize) + if (VasEBoot_file_read (lzopio->file, lzopio->block.cdata, lzopio->block.csize) + != (VasEBoot_ssize_t) lzopio->block.csize) return -1; if (lzopio->ccheck_fun) { - grub_uint8_t computed_hash[GRUB_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t computed_hash[VasEBoot_CRYPTO_MAX_MDLEN]; - if (lzopio->ccheck_fun->mdlen > GRUB_CRYPTO_MAX_MDLEN) + if (lzopio->ccheck_fun->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) return -1; - grub_crypto_hash (lzopio->ccheck_fun, computed_hash, + VasEBoot_crypto_hash (lzopio->ccheck_fun, computed_hash, lzopio->block.cdata, lzopio->block.csize); - if (grub_memcmp + if (VasEBoot_memcmp (computed_hash, &lzopio->block.ccheck, sizeof (lzopio->block.ccheck)) != 0) return -1; @@ -188,7 +188,7 @@ read_block_data (struct grub_lzopio *lzopio) /* XXX Investigate possibility of in-place decompression to reduce memory * footprint. Or try to uncompress directly to buf if possible. */ static int -uncompress_block (struct grub_lzopio *lzopio) +uncompress_block (struct VasEBoot_lzopio *lzopio) { lzo_uint usize = lzopio->block.usize; @@ -203,7 +203,7 @@ uncompress_block (struct grub_lzopio *lzopio) } else { - lzopio->block.udata = grub_malloc (lzopio->block.usize); + lzopio->block.udata = VasEBoot_malloc (lzopio->block.usize); if (!lzopio->block.udata) return -1; @@ -214,23 +214,23 @@ uncompress_block (struct grub_lzopio *lzopio) if (lzopio->ucheck_fun) { - grub_uint8_t computed_hash[GRUB_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t computed_hash[VasEBoot_CRYPTO_MAX_MDLEN]; - if (lzopio->ucheck_fun->mdlen > GRUB_CRYPTO_MAX_MDLEN) + if (lzopio->ucheck_fun->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) return -1; - grub_crypto_hash (lzopio->ucheck_fun, computed_hash, + VasEBoot_crypto_hash (lzopio->ucheck_fun, computed_hash, lzopio->block.udata, lzopio->block.usize); - if (grub_memcmp + if (VasEBoot_memcmp (computed_hash, &lzopio->block.ucheck, sizeof (lzopio->block.ucheck)) != 0) return -1; } /* Compressed data can be free now. */ - grub_free (lzopio->block.cdata); + VasEBoot_free (lzopio->block.cdata); lzopio->block.cdata = NULL; } @@ -239,14 +239,14 @@ uncompress_block (struct grub_lzopio *lzopio) /* Jump to next block and read its header. */ static int -jump_block (struct grub_lzopio *lzopio) +jump_block (struct VasEBoot_lzopio *lzopio) { /* only jump if block was not decompressed (and read from disk) */ if (!lzopio->block.udata) { - grub_off_t off = grub_file_tell (lzopio->file) + lzopio->block.csize; + VasEBoot_off_t off = VasEBoot_file_tell (lzopio->file) + lzopio->block.csize; - if (grub_file_seek (lzopio->file, off) == ((grub_off_t) - 1)) + if (VasEBoot_file_seek (lzopio->file, off) == ((VasEBoot_off_t) - 1)) return -1; } @@ -254,10 +254,10 @@ jump_block (struct grub_lzopio *lzopio) } static int -calculate_uncompressed_size (grub_file_t file) +calculate_uncompressed_size (VasEBoot_file_t file) { - grub_lzopio_t lzopio = file->data; - grub_off_t usize_total = 0; + VasEBoot_lzopio_t lzopio = file->data; + VasEBoot_off_t usize_total = 0; if (read_block_header (lzopio) < 0) return -1; @@ -278,74 +278,74 @@ calculate_uncompressed_size (grub_file_t file) struct lzop_header { - grub_uint8_t magic[LZOP_MAGIC_SIZE]; - grub_uint16_t lzop_version; - grub_uint16_t lib_version; - grub_uint16_t lib_version_ext; - grub_uint8_t method; - grub_uint8_t level; - grub_uint32_t flags; - /* grub_uint32_t filter; */ /* No filters support. Rarely used anyway. */ - grub_uint32_t mode; - grub_uint32_t mtime_lo; - grub_uint32_t mtime_hi; - grub_uint8_t name_len; -} GRUB_PACKED; + VasEBoot_uint8_t magic[LZOP_MAGIC_SIZE]; + VasEBoot_uint16_t lzop_version; + VasEBoot_uint16_t lib_version; + VasEBoot_uint16_t lib_version_ext; + VasEBoot_uint8_t method; + VasEBoot_uint8_t level; + VasEBoot_uint32_t flags; + /* VasEBoot_uint32_t filter; */ /* No filters support. Rarely used anyway. */ + VasEBoot_uint32_t mode; + VasEBoot_uint32_t mtime_lo; + VasEBoot_uint32_t mtime_hi; + VasEBoot_uint8_t name_len; +} VasEBoot_PACKED; static int -test_header (grub_file_t file) +test_header (VasEBoot_file_t file) { - grub_lzopio_t lzopio = file->data; + VasEBoot_lzopio_t lzopio = file->data; struct lzop_header header; - grub_uint32_t flags, checksum; + VasEBoot_uint32_t flags, checksum; const gcry_md_spec_t *hcheck; - grub_uint8_t *context = NULL; - grub_uint8_t *name = NULL; + VasEBoot_uint8_t *context = NULL; + VasEBoot_uint8_t *name = NULL; - if (grub_file_read (lzopio->file, &header, sizeof (header)) != sizeof (header)) + if (VasEBoot_file_read (lzopio->file, &header, sizeof (header)) != sizeof (header)) return 0; - if (grub_memcmp (header.magic, LZOP_MAGIC, LZOP_MAGIC_SIZE) != 0) + if (VasEBoot_memcmp (header.magic, LZOP_MAGIC, LZOP_MAGIC_SIZE) != 0) return 0; - if (grub_be_to_cpu16(header.lib_version) < LZOP_NEW_LIB) + if (VasEBoot_be_to_cpu16(header.lib_version) < LZOP_NEW_LIB) return 0; /* Too new version, should upgrade minilzo? */ - if (grub_be_to_cpu16 (header.lib_version_ext) > MINILZO_VERSION) + if (VasEBoot_be_to_cpu16 (header.lib_version_ext) > MINILZO_VERSION) return 0; - flags = grub_be_to_cpu32 (header.flags); + flags = VasEBoot_be_to_cpu32 (header.flags); if (flags & F_CRC32_D) { lzopio->has_ucheck = 1; - lzopio->ucheck_fun = grub_crypto_lookup_md_by_name ("crc32"); + lzopio->ucheck_fun = VasEBoot_crypto_lookup_md_by_name ("crc32"); } else if (flags & F_ADLER32_D) { lzopio->has_ucheck = 1; - lzopio->ucheck_fun = grub_crypto_lookup_md_by_name ("adler32"); + lzopio->ucheck_fun = VasEBoot_crypto_lookup_md_by_name ("adler32"); } if (flags & F_CRC32_C) { lzopio->has_ccheck = 1; - lzopio->ccheck_fun = grub_crypto_lookup_md_by_name ("crc32"); + lzopio->ccheck_fun = VasEBoot_crypto_lookup_md_by_name ("crc32"); } else if (flags & F_ADLER32_C) { lzopio->has_ccheck = 1; - lzopio->ccheck_fun = grub_crypto_lookup_md_by_name ("adler32"); + lzopio->ccheck_fun = VasEBoot_crypto_lookup_md_by_name ("adler32"); } if (flags & F_H_CRC32) - hcheck = grub_crypto_lookup_md_by_name ("crc32"); + hcheck = VasEBoot_crypto_lookup_md_by_name ("crc32"); else - hcheck = grub_crypto_lookup_md_by_name ("adler32"); + hcheck = VasEBoot_crypto_lookup_md_by_name ("adler32"); if (hcheck) { - context = grub_malloc(hcheck->contextsize); + context = VasEBoot_malloc(hcheck->contextsize); if (! context) return 0; @@ -357,45 +357,45 @@ test_header (grub_file_t file) if (header.name_len != 0) { - name = grub_malloc (header.name_len); + name = VasEBoot_malloc (header.name_len); if (! name) { - grub_free (context); + VasEBoot_free (context); return 0; } - if (grub_file_read (lzopio->file, name, header.name_len) != + if (VasEBoot_file_read (lzopio->file, name, header.name_len) != header.name_len) { - grub_free(name); + VasEBoot_free(name); goto CORRUPTED; } if (hcheck) hcheck->write(context, name, header.name_len); - grub_free(name); + VasEBoot_free(name); } if (hcheck) hcheck->final(context); - if (grub_file_read (lzopio->file, &checksum, sizeof (checksum)) != + if (VasEBoot_file_read (lzopio->file, &checksum, sizeof (checksum)) != sizeof (checksum)) goto CORRUPTED; - if (hcheck && grub_memcmp (&checksum, hcheck->read(context), sizeof(checksum)) != 0) + if (hcheck && VasEBoot_memcmp (&checksum, hcheck->read(context), sizeof(checksum)) != 0) goto CORRUPTED; - lzopio->start_block_off = grub_file_tell (lzopio->file); + lzopio->start_block_off = VasEBoot_file_tell (lzopio->file); if (calculate_uncompressed_size (file) < 0) goto CORRUPTED; /* Get back to start block. */ - grub_file_seek (lzopio->file, lzopio->start_block_off); + VasEBoot_file_seek (lzopio->file, lzopio->start_block_off); - /* Read first block - grub_lzopio_read() expects valid block. */ + /* Read first block - VasEBoot_lzopio_read() expects valid block. */ if (read_block_header (lzopio) < 0) goto CORRUPTED; @@ -406,21 +406,21 @@ CORRUPTED: return 0; } -static grub_file_t -grub_lzopio_open (grub_file_t io, +static VasEBoot_file_t +VasEBoot_lzopio_open (VasEBoot_file_t io, const char *name __attribute__ ((unused))) { - grub_file_t file; - grub_lzopio_t lzopio; + VasEBoot_file_t file; + VasEBoot_lzopio_t lzopio; - file = (grub_file_t) grub_zalloc (sizeof (*file)); + file = (VasEBoot_file_t) VasEBoot_zalloc (sizeof (*file)); if (!file) return 0; - lzopio = grub_zalloc (sizeof (*lzopio)); + lzopio = VasEBoot_zalloc (sizeof (*lzopio)); if (!lzopio) { - grub_free (file); + VasEBoot_free (file); return 0; } @@ -428,19 +428,19 @@ grub_lzopio_open (grub_file_t io, file->device = io->device; file->data = lzopio; - file->fs = &grub_lzopio_fs; - file->size = GRUB_FILE_SIZE_UNKNOWN; + file->fs = &VasEBoot_lzopio_fs; + file->size = VasEBoot_FILE_SIZE_UNKNOWN; file->not_easily_seekable = 1; - if (grub_file_tell (lzopio->file) != 0) - grub_file_seek (lzopio->file, 0); + if (VasEBoot_file_tell (lzopio->file) != 0) + VasEBoot_file_seek (lzopio->file, 0); if (!test_header (file)) { - grub_errno = GRUB_ERR_NONE; - grub_file_seek (io, 0); - grub_free (lzopio); - grub_free (file); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_file_seek (io, 0); + VasEBoot_free (lzopio); + VasEBoot_free (file); return io; } @@ -448,17 +448,17 @@ grub_lzopio_open (grub_file_t io, return file; } -static grub_ssize_t -grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_lzopio_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - grub_lzopio_t lzopio = file->data; - grub_ssize_t ret = 0; - grub_off_t off; + VasEBoot_lzopio_t lzopio = file->data; + VasEBoot_ssize_t ret = 0; + VasEBoot_off_t off; /* Backward seek before last read block. */ - if (lzopio->saved_off > grub_file_tell (file)) + if (lzopio->saved_off > VasEBoot_file_tell (file)) { - grub_file_seek (lzopio->file, lzopio->start_block_off); + VasEBoot_file_seek (lzopio->file, lzopio->start_block_off); if (read_block_header (lzopio) < 0) goto CORRUPTED; @@ -467,7 +467,7 @@ grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len) } /* Forward to first block with requested data. */ - while (lzopio->saved_off + lzopio->block.usize <= grub_file_tell (file)) + while (lzopio->saved_off + lzopio->block.usize <= VasEBoot_file_tell (file)) { /* EOF, could be possible files with unknown size. */ if (lzopio->block.usize == 0) @@ -477,11 +477,11 @@ grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len) goto CORRUPTED; } - off = grub_file_tell (file) - lzopio->saved_off; + off = VasEBoot_file_tell (file) - lzopio->saved_off; while (len != 0 && lzopio->block.usize != 0) { - grub_size_t to_copy; + VasEBoot_size_t to_copy; /* Block not decompressed yet. */ if (!lzopio->block.udata && uncompress_block (lzopio) < 0) @@ -491,7 +491,7 @@ grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len) to_copy = lzopio->block.usize - off; if (to_copy > len) to_copy = len; - grub_memcpy (buf, lzopio->block.udata + off, to_copy); + VasEBoot_memcpy (buf, lzopio->block.udata + off, to_copy); len -= to_copy; buf += to_copy; @@ -506,43 +506,43 @@ grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len) return ret; CORRUPTED: - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("lzop file corrupted")); + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, N_("lzop file corrupted")); return -1; } /* Release everything, including the underlying file object. */ -static grub_err_t -grub_lzopio_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_lzopio_close (VasEBoot_file_t file) { - grub_lzopio_t lzopio = file->data; + VasEBoot_lzopio_t lzopio = file->data; - grub_file_close (lzopio->file); - grub_free (lzopio->block.cdata); - grub_free (lzopio->block.udata); - grub_free (lzopio); + VasEBoot_file_close (lzopio->file); + VasEBoot_free (lzopio->block.cdata); + VasEBoot_free (lzopio->block.udata); + VasEBoot_free (lzopio); /* Device must not be closed twice. */ file->device = 0; file->name = 0; - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_lzopio_fs = { +static struct VasEBoot_fs VasEBoot_lzopio_fs = { .name = "lzopio", .dir = 0, .open = 0, - .read = grub_lzopio_read, - .close = grub_lzopio_close, + .read = VasEBoot_lzopio_read, + .close = VasEBoot_lzopio_close, .label = 0, .next = 0 }; -GRUB_MOD_INIT (lzopio) +VasEBoot_MOD_INIT (lzopio) { - grub_file_filter_register (GRUB_FILE_FILTER_LZOPIO, grub_lzopio_open); + VasEBoot_file_filter_register (VasEBoot_FILE_FILTER_LZOPIO, VasEBoot_lzopio_open); } -GRUB_MOD_FINI (lzopio) +VasEBoot_MOD_FINI (lzopio) { - grub_file_filter_unregister (GRUB_FILE_FILTER_LZOPIO); + VasEBoot_file_filter_unregister (VasEBoot_FILE_FILTER_LZOPIO); } diff --git a/VasEBoot-core/io/offset.c b/VasEBoot-core/io/offset.c index ebed0ebe6..1c134ec9c 100644 --- a/VasEBoot-core/io/offset.c +++ b/VasEBoot-core/io/offset.c @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_offset_file +struct VasEBoot_offset_file { - grub_file_t parent; - grub_off_t off; + VasEBoot_file_t parent; + VasEBoot_off_t off; }; -static grub_ssize_t -grub_offset_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_offset_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_offset_file *data = file->data; - if (grub_file_seek (data->parent, data->off + file->offset) == (grub_off_t) -1) + struct VasEBoot_offset_file *data = file->data; + if (VasEBoot_file_seek (data->parent, data->off + file->offset) == (VasEBoot_off_t) -1) return -1; - return grub_file_read (data->parent, buf, len); + return VasEBoot_file_read (data->parent, buf, len); } -static grub_err_t -grub_offset_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_offset_close (VasEBoot_file_t file) { - struct grub_offset_file *data = file->data; + struct VasEBoot_offset_file *data = file->data; if (data->parent) - grub_file_close (data->parent); + VasEBoot_file_close (data->parent); /* No need to close the same device twice. */ file->device = 0; @@ -50,37 +50,37 @@ grub_offset_close (grub_file_t file) return 0; } -static struct grub_fs grub_offset_fs = { +static struct VasEBoot_fs VasEBoot_offset_fs = { .name = "offset", .dir = 0, .open = 0, - .read = grub_offset_read, - .close = grub_offset_close, + .read = VasEBoot_offset_read, + .close = VasEBoot_offset_close, .label = 0, .next = 0 }; void -grub_file_offset_close (grub_file_t file) +VasEBoot_file_offset_close (VasEBoot_file_t file) { - struct grub_offset_file *off_data = file->data; + struct VasEBoot_offset_file *off_data = file->data; off_data->parent = NULL; - grub_file_close (file); + VasEBoot_file_close (file); } -grub_file_t -grub_file_offset_open (grub_file_t parent, grub_off_t start, grub_off_t size) +VasEBoot_file_t +VasEBoot_file_offset_open (VasEBoot_file_t parent, VasEBoot_off_t start, VasEBoot_off_t size) { - struct grub_offset_file *off_data; - grub_file_t off_file, last_off_file; - grub_file_filter_id_t filter; + struct VasEBoot_offset_file *off_data; + VasEBoot_file_t off_file, last_off_file; + VasEBoot_file_filter_id_t filter; - off_file = grub_zalloc (sizeof (*off_file)); - off_data = grub_zalloc (sizeof (*off_data)); + off_file = VasEBoot_zalloc (sizeof (*off_file)); + off_data = VasEBoot_zalloc (sizeof (*off_data)); if (!off_file || !off_data) { - grub_free (off_file); - grub_free (off_data); + VasEBoot_free (off_file); + VasEBoot_free (off_data); return 0; } @@ -89,22 +89,22 @@ grub_file_offset_open (grub_file_t parent, grub_off_t start, grub_off_t size) off_file->device = parent->device; off_file->data = off_data; - off_file->fs = &grub_offset_fs; + off_file->fs = &VasEBoot_offset_fs; off_file->size = size; last_off_file = NULL; - for (filter = GRUB_FILE_FILTER_COMPRESSION_FIRST; - off_file && filter <= GRUB_FILE_FILTER_COMPRESSION_LAST; filter++) - if (grub_file_filters_enabled[filter]) + for (filter = VasEBoot_FILE_FILTER_COMPRESSION_FIRST; + off_file && filter <= VasEBoot_FILE_FILTER_COMPRESSION_LAST; filter++) + if (VasEBoot_file_filters_enabled[filter]) { last_off_file = off_file; - off_file = grub_file_filters_enabled[filter] (off_file, parent->name); + off_file = VasEBoot_file_filters_enabled[filter] (off_file, parent->name); } if (!off_file) { off_data->parent = NULL; - grub_file_close (last_off_file); + VasEBoot_file_close (last_off_file); return 0; } return off_file; diff --git a/VasEBoot-core/io/xzio.c b/VasEBoot-core/io/xzio.c index a3536ad73..324fc5176 100644 --- a/VasEBoot-core/io/xzio.c +++ b/VasEBoot-core/io/xzio.c @@ -1,30 +1,30 @@ /* xzio.c - decompression support for xz */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #include "xz.h" #include "xz_stream.h" @@ -33,22 +33,22 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define VLI_MAX_DIGITS 9 #define XZ_STREAM_FOOTER_SIZE 12 -struct grub_xzio +struct VasEBoot_xzio { - grub_file_t file; + VasEBoot_file_t file; struct xz_buf buf; struct xz_dec *dec; - grub_uint8_t inbuf[XZBUFSIZ]; - grub_uint8_t outbuf[XZBUFSIZ]; - grub_off_t saved_offset; + VasEBoot_uint8_t inbuf[XZBUFSIZ]; + VasEBoot_uint8_t outbuf[XZBUFSIZ]; + VasEBoot_off_t saved_offset; }; -typedef struct grub_xzio *grub_xzio_t; -static struct grub_fs grub_xzio_fs; +typedef struct VasEBoot_xzio *VasEBoot_xzio_t; +static struct VasEBoot_fs VasEBoot_xzio_fs; -static grub_size_t -decode_vli (const grub_uint8_t buf[], grub_size_t size_max, - grub_uint64_t *num) +static VasEBoot_size_t +decode_vli (const VasEBoot_uint8_t buf[], VasEBoot_size_t size_max, + VasEBoot_uint64_t *num) { if (size_max == 0) return 0; @@ -57,7 +57,7 @@ decode_vli (const grub_uint8_t buf[], grub_size_t size_max, size_max = VLI_MAX_DIGITS; *num = buf[0] & 0x7F; - grub_size_t i = 0; + VasEBoot_size_t i = 0; while (buf[i++] & 0x80) { @@ -70,31 +70,31 @@ decode_vli (const grub_uint8_t buf[], grub_size_t size_max, return i; } -static grub_ssize_t -read_vli (grub_file_t file, grub_uint64_t *num) +static VasEBoot_ssize_t +read_vli (VasEBoot_file_t file, VasEBoot_uint64_t *num) { - grub_uint8_t buf[VLI_MAX_DIGITS]; - grub_ssize_t read_bytes; - grub_size_t dec; + VasEBoot_uint8_t buf[VLI_MAX_DIGITS]; + VasEBoot_ssize_t read_bytes; + VasEBoot_size_t dec; - read_bytes = grub_file_read (file, buf, VLI_MAX_DIGITS); + read_bytes = VasEBoot_file_read (file, buf, VLI_MAX_DIGITS); if (read_bytes < 0) return -1; dec = decode_vli (buf, read_bytes, num); - grub_file_seek (file, file->offset - (read_bytes - dec)); + VasEBoot_file_seek (file, file->offset - (read_bytes - dec)); return dec; } /* Function xz_dec_run() should consume header and ask for more (XZ_OK) * else file is corrupted (or options not supported) or not xz. */ static int -test_header (grub_file_t file) +test_header (VasEBoot_file_t file) { - grub_xzio_t xzio = file->data; + VasEBoot_xzio_t xzio = file->data; enum xz_ret ret; - xzio->buf.in_size = grub_file_read (xzio->file, xzio->inbuf, + xzio->buf.in_size = VasEBoot_file_read (xzio->file, xzio->inbuf, STREAM_HEADER_SIZE); if (xzio->buf.in_size != STREAM_HEADER_SIZE) @@ -114,36 +114,36 @@ test_header (grub_file_t file) /* Try to find out size of uncompressed data, * also do some footer sanity checks. */ static int -test_footer (grub_file_t file) +test_footer (VasEBoot_file_t file) { - grub_xzio_t xzio = file->data; - grub_uint8_t footer[FOOTER_MAGIC_SIZE]; - grub_uint32_t backsize; - grub_uint8_t imarker; - grub_uint64_t uncompressed_size_total = 0; - grub_uint64_t uncompressed_size; - grub_uint64_t records; + VasEBoot_xzio_t xzio = file->data; + VasEBoot_uint8_t footer[FOOTER_MAGIC_SIZE]; + VasEBoot_uint32_t backsize; + VasEBoot_uint8_t imarker; + VasEBoot_uint64_t uncompressed_size_total = 0; + VasEBoot_uint64_t uncompressed_size; + VasEBoot_uint64_t records; - grub_file_seek (xzio->file, xzio->file->size - FOOTER_MAGIC_SIZE); - if (grub_file_read (xzio->file, footer, FOOTER_MAGIC_SIZE) + VasEBoot_file_seek (xzio->file, xzio->file->size - FOOTER_MAGIC_SIZE); + if (VasEBoot_file_read (xzio->file, footer, FOOTER_MAGIC_SIZE) != FOOTER_MAGIC_SIZE - || grub_memcmp (footer, FOOTER_MAGIC, FOOTER_MAGIC_SIZE) != 0) + || VasEBoot_memcmp (footer, FOOTER_MAGIC, FOOTER_MAGIC_SIZE) != 0) goto ERROR; - grub_file_seek (xzio->file, xzio->file->size - 8); - if (grub_file_read (xzio->file, &backsize, sizeof (backsize)) + VasEBoot_file_seek (xzio->file, xzio->file->size - 8); + if (VasEBoot_file_read (xzio->file, &backsize, sizeof (backsize)) != sizeof (backsize)) goto ERROR; /* Calculate real backward size. */ - backsize = (grub_le_to_cpu32 (backsize) + 1) * 4; + backsize = (VasEBoot_le_to_cpu32 (backsize) + 1) * 4; /* Set file to the beginning of stream index. */ - grub_file_seek (xzio->file, + VasEBoot_file_seek (xzio->file, xzio->file->size - XZ_STREAM_FOOTER_SIZE - backsize); /* Test index marker. */ - if (grub_file_read (xzio->file, &imarker, sizeof (imarker)) + if (VasEBoot_file_read (xzio->file, &imarker, sizeof (imarker)) != sizeof (imarker) && imarker != 0x00) goto ERROR; @@ -161,28 +161,28 @@ test_footer (grub_file_t file) } file->size = uncompressed_size_total; - grub_file_seek (xzio->file, STREAM_HEADER_SIZE); + VasEBoot_file_seek (xzio->file, STREAM_HEADER_SIZE); return 1; ERROR: return 0; } -static grub_file_t -grub_xzio_open (grub_file_t io, +static VasEBoot_file_t +VasEBoot_xzio_open (VasEBoot_file_t io, const char *name __attribute__ ((unused))) { - grub_file_t file; - grub_xzio_t xzio; + VasEBoot_file_t file; + VasEBoot_xzio_t xzio; - file = (grub_file_t) grub_zalloc (sizeof (*file)); + file = (VasEBoot_file_t) VasEBoot_zalloc (sizeof (*file)); if (!file) return 0; - xzio = grub_zalloc (sizeof (*xzio)); + xzio = VasEBoot_zalloc (sizeof (*xzio)); if (!xzio) { - grub_free (file); + VasEBoot_free (file); return 0; } @@ -190,20 +190,20 @@ grub_xzio_open (grub_file_t io, file->device = io->device; file->data = xzio; - file->fs = &grub_xzio_fs; - file->size = GRUB_FILE_SIZE_UNKNOWN; + file->fs = &VasEBoot_xzio_fs; + file->size = VasEBoot_FILE_SIZE_UNKNOWN; file->not_easily_seekable = 1; - if (grub_file_tell (xzio->file) != 0) - grub_file_seek (xzio->file, 0); + if (VasEBoot_file_tell (xzio->file) != 0) + VasEBoot_file_seek (xzio->file, 0); /* Allocated 64KiB for dictionary. * Decoder will relocate if bigger is needed. */ xzio->dec = xz_dec_init (1 << 16); if (!xzio->dec) { - grub_free (file); - grub_free (xzio); + VasEBoot_free (file); + VasEBoot_free (xzio); return 0; } @@ -214,11 +214,11 @@ grub_xzio_open (grub_file_t io, /* FIXME: don't test footer on not easily seekable files. */ if (!test_header (file) || !test_footer (file)) { - grub_errno = GRUB_ERR_NONE; - grub_file_seek (io, 0); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_file_seek (io, 0); xz_dec_end (xzio->dec); - grub_free (xzio); - grub_free (file); + VasEBoot_free (xzio); + VasEBoot_free (file); return io; } @@ -226,14 +226,14 @@ grub_xzio_open (grub_file_t io, return file; } -static grub_ssize_t -grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_xzio_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - grub_ssize_t ret = 0; - grub_ssize_t readret; + VasEBoot_ssize_t ret = 0; + VasEBoot_ssize_t readret; enum xz_ret xzret; - grub_xzio_t xzio = file->data; - grub_off_t current_offset; + VasEBoot_xzio_t xzio = file->data; + VasEBoot_off_t current_offset; /* If seek backward need to reset decoder and start from beginning of file. TODO Possible improvement by jumping blocks. */ @@ -244,7 +244,7 @@ grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) xzio->buf.out_pos = 0; xzio->buf.in_pos = 0; xzio->buf.in_size = 0; - grub_file_seek (xzio->file, 0); + VasEBoot_file_seek (xzio->file, 0); } current_offset = xzio->saved_offset; @@ -257,7 +257,7 @@ grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) /* Feed input. */ if (xzio->buf.in_pos == xzio->buf.in_size) { - readret = grub_file_read (xzio->file, xzio->inbuf, XZBUFSIZ); + readret = VasEBoot_file_read (xzio->file, xzio->inbuf, XZBUFSIZ); if (readret < 0) return -1; xzio->buf.in_size = readret; @@ -272,7 +272,7 @@ grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) case XZ_OPTIONS_ERROR: case XZ_DATA_ERROR: case XZ_BUF_ERROR: - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, + VasEBoot_error (VasEBoot_ERR_BAD_COMPRESSED_DATA, N_("xz file corrupted or unsupported block options")); return -1; default: @@ -280,13 +280,13 @@ grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) } { - grub_off_t new_offset = current_offset + xzio->buf.out_pos; + VasEBoot_off_t new_offset = current_offset + xzio->buf.out_pos; if (file->offset <= new_offset) /* Store first chunk of data in buffer. */ { - grub_size_t delta = new_offset - (file->offset + ret); - grub_memmove (buf, xzio->buf.out + (xzio->buf.out_pos - delta), + VasEBoot_size_t delta = new_offset - (file->offset + ret); + VasEBoot_memmove (buf, xzio->buf.out + (xzio->buf.out_pos - delta), delta); len -= delta; buf += delta; @@ -307,38 +307,38 @@ grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) } /* Release everything, including the underlying file object. */ -static grub_err_t -grub_xzio_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_xzio_close (VasEBoot_file_t file) { - grub_xzio_t xzio = file->data; + VasEBoot_xzio_t xzio = file->data; xz_dec_end (xzio->dec); - grub_file_close (xzio->file); - grub_free (xzio); + VasEBoot_file_close (xzio->file); + VasEBoot_free (xzio); /* Device must not be closed twice. */ file->device = 0; file->name = 0; - return grub_errno; + return VasEBoot_errno; } -static struct grub_fs grub_xzio_fs = { +static struct VasEBoot_fs VasEBoot_xzio_fs = { .name = "xzio", .dir = 0, .open = 0, - .read = grub_xzio_read, - .close = grub_xzio_close, + .read = VasEBoot_xzio_read, + .close = VasEBoot_xzio_close, .label = 0, .next = 0 }; -GRUB_MOD_INIT (xzio) +VasEBoot_MOD_INIT (xzio) { - grub_file_filter_register (GRUB_FILE_FILTER_XZIO, grub_xzio_open); + VasEBoot_file_filter_register (VasEBoot_FILE_FILTER_XZIO, VasEBoot_xzio_open); } -GRUB_MOD_FINI (xzio) +VasEBoot_MOD_FINI (xzio) { - grub_file_filter_unregister (GRUB_FILE_FILTER_XZIO); + VasEBoot_file_filter_unregister (VasEBoot_FILE_FILTER_XZIO); } diff --git a/VasEBoot-core/kern/acpi.c b/VasEBoot-core/kern/acpi.c index 5746ac00c..078e70284 100644 --- a/VasEBoot-core/kern/acpi.c +++ b/VasEBoot-core/kern/acpi.c @@ -1,118 +1,118 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */ -grub_uint8_t -grub_byte_checksum (void *base, grub_size_t size) +VasEBoot_uint8_t +VasEBoot_byte_checksum (void *base, VasEBoot_size_t size) { - grub_uint8_t *ptr; - grub_uint8_t ret = 0; - for (ptr = (grub_uint8_t *) base; ptr < ((grub_uint8_t *) base) + size; + VasEBoot_uint8_t *ptr; + VasEBoot_uint8_t ret = 0; + for (ptr = (VasEBoot_uint8_t *) base; ptr < ((VasEBoot_uint8_t *) base) + size; ptr++) ret += *ptr; return ret; } static void * -grub_acpi_rsdt_find_table (struct grub_acpi_table_header *rsdt, const char *sig) +VasEBoot_acpi_rsdt_find_table (struct VasEBoot_acpi_table_header *rsdt, const char *sig) { - grub_size_t s; - grub_unaligned_uint32_t *ptr; + VasEBoot_size_t s; + VasEBoot_unaligned_uint32_t *ptr; if (!rsdt) return 0; - if (grub_memcmp (rsdt->signature, "RSDT", 4) != 0) + if (VasEBoot_memcmp (rsdt->signature, "RSDT", 4) != 0) return 0; - ptr = (grub_unaligned_uint32_t *) (rsdt + 1); - s = (rsdt->length - sizeof (*rsdt)) / sizeof (grub_uint32_t); + ptr = (VasEBoot_unaligned_uint32_t *) (rsdt + 1); + s = (rsdt->length - sizeof (*rsdt)) / sizeof (VasEBoot_uint32_t); for (; s; s--, ptr++) { - struct grub_acpi_table_header *tbl; - tbl = (struct grub_acpi_table_header *) (grub_addr_t) ptr->val; - if (grub_memcmp (tbl->signature, sig, 4) == 0) + struct VasEBoot_acpi_table_header *tbl; + tbl = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) ptr->val; + if (VasEBoot_memcmp (tbl->signature, sig, 4) == 0) return tbl; } return 0; } static void * -grub_acpi_xsdt_find_table (struct grub_acpi_table_header *xsdt, const char *sig) +VasEBoot_acpi_xsdt_find_table (struct VasEBoot_acpi_table_header *xsdt, const char *sig) { - grub_size_t s; - grub_unaligned_uint64_t *ptr; + VasEBoot_size_t s; + VasEBoot_unaligned_uint64_t *ptr; if (!xsdt) return 0; - if (grub_memcmp (xsdt->signature, "XSDT", 4) != 0) + if (VasEBoot_memcmp (xsdt->signature, "XSDT", 4) != 0) return 0; - ptr = (grub_unaligned_uint64_t *) (xsdt + 1); - s = (xsdt->length - sizeof (*xsdt)) / sizeof (grub_uint32_t); + ptr = (VasEBoot_unaligned_uint64_t *) (xsdt + 1); + s = (xsdt->length - sizeof (*xsdt)) / sizeof (VasEBoot_uint32_t); for (; s; s--, ptr++) { - struct grub_acpi_table_header *tbl; -#if GRUB_CPU_SIZEOF_VOID_P != 8 + struct VasEBoot_acpi_table_header *tbl; +#if VasEBoot_CPU_SIZEOF_VOID_P != 8 if (ptr->val >> 32) continue; #endif - tbl = (struct grub_acpi_table_header *) (grub_addr_t) ptr->val; - if (grub_memcmp (tbl->signature, sig, 4) == 0) + tbl = (struct VasEBoot_acpi_table_header *) (VasEBoot_addr_t) ptr->val; + if (VasEBoot_memcmp (tbl->signature, sig, 4) == 0) return tbl; } return 0; } -struct grub_acpi_fadt * -grub_acpi_find_fadt (void) +struct VasEBoot_acpi_fadt * +VasEBoot_acpi_find_fadt (void) { - struct grub_acpi_fadt *fadt = 0; - struct grub_acpi_rsdp_v10 *rsdpv1; - struct grub_acpi_rsdp_v20 *rsdpv2; - rsdpv1 = grub_machine_acpi_get_rsdpv1 (); + struct VasEBoot_acpi_fadt *fadt = 0; + struct VasEBoot_acpi_rsdp_v10 *rsdpv1; + struct VasEBoot_acpi_rsdp_v20 *rsdpv2; + rsdpv1 = VasEBoot_machine_acpi_get_rsdpv1 (); if (rsdpv1) - fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv1->rsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); + fadt = VasEBoot_acpi_rsdt_find_table ((struct VasEBoot_acpi_table_header *) + (VasEBoot_addr_t) rsdpv1->rsdt_addr, + VasEBoot_ACPI_FADT_SIGNATURE); if (fadt) return fadt; - rsdpv2 = grub_machine_acpi_get_rsdpv2 (); + rsdpv2 = VasEBoot_machine_acpi_get_rsdpv2 (); if (rsdpv2) - fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); + fadt = VasEBoot_acpi_rsdt_find_table ((struct VasEBoot_acpi_table_header *) + (VasEBoot_addr_t) rsdpv2->rsdpv1.rsdt_addr, + VasEBoot_ACPI_FADT_SIGNATURE); if (fadt) return fadt; if (rsdpv2 -#if GRUB_CPU_SIZEOF_VOID_P != 8 +#if VasEBoot_CPU_SIZEOF_VOID_P != 8 && !(rsdpv2->xsdt_addr >> 32) #endif ) - fadt = grub_acpi_xsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv2->xsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); + fadt = VasEBoot_acpi_xsdt_find_table ((struct VasEBoot_acpi_table_header *) + (VasEBoot_addr_t) rsdpv2->xsdt_addr, + VasEBoot_ACPI_FADT_SIGNATURE); if (fadt) return fadt; return 0; diff --git a/VasEBoot-core/kern/arm/cache.S b/VasEBoot-core/kern/arm/cache.S index 354a069fe..ef34e038f 100644 --- a/VasEBoot-core/kern/arm/cache.S +++ b/VasEBoot-core/kern/arm/cache.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "cache.S" .text @@ -39,11 +39,11 @@ @ r0 - *beg (inclusive) @ r1 - *end (exclusive) -@void grub_arm_clean_dcache_range (grub_addr_t start, grub_addr_t end, grub_addr_t dlinesz) +@void VasEBoot_arm_clean_dcache_range (VasEBoot_addr_t start, VasEBoot_addr_t end, VasEBoot_addr_t dlinesz) #ifdef ARMV6 -FUNCTION(grub_arm_clean_dcache_range_armv6) +FUNCTION(VasEBoot_arm_clean_dcache_range_armv6) #else -FUNCTION(grub_arm_clean_dcache_range_armv7) +FUNCTION(VasEBoot_arm_clean_dcache_range_armv7) #endif DSB @ Clean data cache for range to point-of-unification @@ -62,9 +62,9 @@ FUNCTION(grub_arm_clean_dcache_range_armv7) @ r0 - *beg (inclusive) @ r1 - *end (exclusive) #ifdef ARMV6 -FUNCTION(grub_arm_invalidate_icache_range_armv6) +FUNCTION(VasEBoot_arm_invalidate_icache_range_armv6) #else -FUNCTION(grub_arm_invalidate_icache_range_armv7) +FUNCTION(VasEBoot_arm_invalidate_icache_range_armv7) #endif @ Invalidate instruction cache for range to point-of-unification 1: cmp r0, r1 @@ -79,9 +79,9 @@ FUNCTION(grub_arm_invalidate_icache_range_armv7) bx lr #ifdef ARMV6 -FUNCTION(grub_arm_disable_caches_mmu_armv6) +FUNCTION(VasEBoot_arm_disable_caches_mmu_armv6) #else -FUNCTION(grub_arm_disable_caches_mmu_armv7) +FUNCTION(VasEBoot_arm_disable_caches_mmu_armv7) #endif push {r4, lr} diff --git a/VasEBoot-core/kern/arm/cache.c b/VasEBoot-core/kern/arm/cache.c index 34154ccdb..4bd5570c3 100644 --- a/VasEBoot-core/kern/arm/cache.c +++ b/VasEBoot-core/kern/arm/cache.c @@ -1,10 +1,10 @@ -#include -#include -#include -#ifdef GRUB_MACHINE_UBOOT -#include -#include -#include +#include +#include +#include +#ifdef VasEBoot_MACHINE_UBOOT +#include +#include +#include #endif /* This is only about cache architecture. It doesn't imply @@ -20,31 +20,31 @@ static enum static int is_v6_mmu; -static grub_uint32_t grub_arch_cache_dlinesz; -static grub_uint32_t grub_arch_cache_ilinesz; -static grub_uint32_t grub_arch_cache_max_linesz; +static VasEBoot_uint32_t VasEBoot_arch_cache_dlinesz; +static VasEBoot_uint32_t VasEBoot_arch_cache_ilinesz; +static VasEBoot_uint32_t VasEBoot_arch_cache_max_linesz; /* Prototypes for asm functions. */ -void grub_arm_clean_dcache_range_armv6 (grub_addr_t start, grub_addr_t end, - grub_addr_t dlinesz); -void grub_arm_clean_dcache_range_armv7 (grub_addr_t start, grub_addr_t end, - grub_addr_t dlinesz); -void grub_arm_invalidate_icache_range_armv6 (grub_addr_t start, grub_addr_t end, - grub_addr_t dlinesz); -void grub_arm_invalidate_icache_range_armv7 (grub_addr_t start, grub_addr_t end, - grub_addr_t dlinesz); -void grub_arm_disable_caches_mmu_armv6 (void); -void grub_arm_disable_caches_mmu_armv7 (void); -grub_uint32_t grub_arm_main_id (void); -grub_uint32_t grub_arm_cache_type (void); +void VasEBoot_arm_clean_dcache_range_armv6 (VasEBoot_addr_t start, VasEBoot_addr_t end, + VasEBoot_addr_t dlinesz); +void VasEBoot_arm_clean_dcache_range_armv7 (VasEBoot_addr_t start, VasEBoot_addr_t end, + VasEBoot_addr_t dlinesz); +void VasEBoot_arm_invalidate_icache_range_armv6 (VasEBoot_addr_t start, VasEBoot_addr_t end, + VasEBoot_addr_t dlinesz); +void VasEBoot_arm_invalidate_icache_range_armv7 (VasEBoot_addr_t start, VasEBoot_addr_t end, + VasEBoot_addr_t dlinesz); +void VasEBoot_arm_disable_caches_mmu_armv6 (void); +void VasEBoot_arm_disable_caches_mmu_armv7 (void); +VasEBoot_uint32_t VasEBoot_arm_main_id (void); +VasEBoot_uint32_t VasEBoot_arm_cache_type (void); static void probe_caches (void) { - grub_uint32_t main_id, cache_type; + VasEBoot_uint32_t main_id, cache_type; /* Read main ID Register */ - main_id = grub_arm_main_id (); + main_id = VasEBoot_arm_main_id (); switch ((main_id >> 16) & 0xf) { @@ -59,18 +59,18 @@ probe_caches (void) is_v6_mmu = 1; break; default: - grub_fatal ("Unsupported ARM ID 0x%x", main_id); + VasEBoot_fatal ("Unsupported ARM ID 0x%x", main_id); } /* Read Cache Type Register */ - cache_type = grub_arm_cache_type (); + cache_type = VasEBoot_arm_cache_type (); switch (cache_type >> 24) { case 0x00: case 0x01: - grub_arch_cache_dlinesz = 8 << ((cache_type >> 12) & 3); - grub_arch_cache_ilinesz = 8 << (cache_type & 3); + VasEBoot_arch_cache_dlinesz = 8 << ((cache_type >> 12) & 3); + VasEBoot_arch_cache_ilinesz = 8 << (cache_type & 3); type = ARCH_ARMV5_WRITE_THROUGH; break; case 0x04: @@ -78,8 +78,8 @@ probe_caches (void) case 0x0c: case 0x0e: case 0x1c: - grub_arch_cache_dlinesz = 8 << ((cache_type >> 12) & 3); - grub_arch_cache_ilinesz = 8 << (cache_type & 3); + VasEBoot_arch_cache_dlinesz = 8 << ((cache_type >> 12) & 3); + VasEBoot_arch_cache_ilinesz = 8 << (cache_type & 3); type = ARCH_ARMV6_UNIFIED; break; case 0x05: @@ -87,32 +87,32 @@ probe_caches (void) case 0x0d: case 0x0f: case 0x1d: - grub_arch_cache_dlinesz = 8 << ((cache_type >> 12) & 3); - grub_arch_cache_ilinesz = 8 << (cache_type & 3); + VasEBoot_arch_cache_dlinesz = 8 << ((cache_type >> 12) & 3); + VasEBoot_arch_cache_ilinesz = 8 << (cache_type & 3); type = ARCH_ARMV6; break; case 0x80 ... 0x8f: - grub_arch_cache_dlinesz = 4 << ((cache_type >> 16) & 0xf); - grub_arch_cache_ilinesz = 4 << (cache_type & 0xf); + VasEBoot_arch_cache_dlinesz = 4 << ((cache_type >> 16) & 0xf); + VasEBoot_arch_cache_ilinesz = 4 << (cache_type & 0xf); type = ARCH_ARMV7; break; default: - grub_fatal ("Unsupported cache type 0x%x", cache_type); + VasEBoot_fatal ("Unsupported cache type 0x%x", cache_type); } - if (grub_arch_cache_dlinesz > grub_arch_cache_ilinesz) - grub_arch_cache_max_linesz = grub_arch_cache_dlinesz; + if (VasEBoot_arch_cache_dlinesz > VasEBoot_arch_cache_ilinesz) + VasEBoot_arch_cache_max_linesz = VasEBoot_arch_cache_dlinesz; else - grub_arch_cache_max_linesz = grub_arch_cache_ilinesz; + VasEBoot_arch_cache_max_linesz = VasEBoot_arch_cache_ilinesz; } -#ifdef GRUB_MACHINE_UBOOT +#ifdef VasEBoot_MACHINE_UBOOT -static void subdivide (grub_uint32_t *table, grub_uint32_t *subtable, - grub_uint32_t addr) +static void subdivide (VasEBoot_uint32_t *table, VasEBoot_uint32_t *subtable, + VasEBoot_uint32_t addr) { - grub_uint32_t j; + VasEBoot_uint32_t j; addr = addr >> 20 << 20; - table[addr >> 20] = (grub_addr_t) subtable | 1; + table[addr >> 20] = (VasEBoot_addr_t) subtable | 1; for (j = 0; j < 256; j++) subtable[j] = addr | (j << 12) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 10) @@ -120,18 +120,18 @@ static void subdivide (grub_uint32_t *table, grub_uint32_t *subtable, } void -grub_arm_enable_caches_mmu (void) +VasEBoot_arm_enable_caches_mmu (void) { - grub_uint32_t *table; - grub_uint32_t i; - grub_uint32_t border_crossing = 0; - grub_uint32_t *subtable; - struct sys_info *si = grub_uboot_get_sys_info (); + VasEBoot_uint32_t *table; + VasEBoot_uint32_t i; + VasEBoot_uint32_t border_crossing = 0; + VasEBoot_uint32_t *subtable; + struct sys_info *si = VasEBoot_uboot_get_sys_info (); if (!si || (si->mr_no == 0)) { - grub_printf ("couldn't get memory map, not enabling caches"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_printf ("couldn't get memory map, not enabling caches"); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } @@ -146,13 +146,13 @@ grub_arm_enable_caches_mmu (void) border_crossing++; } - grub_printf ("%d crossers\n", border_crossing); + VasEBoot_printf ("%d crossers\n", border_crossing); - table = grub_memalign (1 << 14, (1 << 14) + (border_crossing << 10)); + table = VasEBoot_memalign (1 << 14, (1 << 14) + (border_crossing << 10)); if (!table) { - grub_printf ("couldn't allocate place for MMU table, not enabling caches"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_printf ("couldn't allocate place for MMU table, not enabling caches"); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } @@ -187,12 +187,12 @@ grub_arm_enable_caches_mmu (void) || (si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_SRAM || (si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_FLASH) { - grub_uint32_t cur, end; + VasEBoot_uint32_t cur, end; cur = si->mr[i].start; end = si->mr[i].start + si->mr[i].size; while (cur < end) { - grub_uint32_t *st; + VasEBoot_uint32_t *st; if ((table[cur >> 20] & 3) == 2) { cur = cur >> 20 << 20; @@ -201,7 +201,7 @@ grub_arm_enable_caches_mmu (void) continue; } cur = cur >> 12 << 12; - st = (grub_uint32_t *) (table[cur >> 20] & ~0x3ff); + st = (VasEBoot_uint32_t *) (table[cur >> 20] & ~0x3ff); st[(cur >> 12) & 0xff] = cur | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 10) | (1 << 3) | (1 << 2) | 2; @@ -209,38 +209,38 @@ grub_arm_enable_caches_mmu (void) } } - grub_printf ("MMU tables generated\n"); + VasEBoot_printf ("MMU tables generated\n"); if (is_v6_mmu) - grub_arm_clear_mmu_v6 (); + VasEBoot_arm_clear_mmu_v6 (); - grub_printf ("enabling MMU\n"); - grub_arm_enable_mmu (table); - grub_printf ("MMU enabled\n"); + VasEBoot_printf ("enabling MMU\n"); + VasEBoot_arm_enable_mmu (table); + VasEBoot_printf ("MMU enabled\n"); } #endif void -grub_arch_sync_caches (void *address, grub_size_t len) +VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) { - grub_addr_t start = (grub_addr_t) address; - grub_addr_t end = start + len; + VasEBoot_addr_t start = (VasEBoot_addr_t) address; + VasEBoot_addr_t end = start + len; if (type == ARCH_UNKNOWN) probe_caches (); - start = ALIGN_DOWN (start, grub_arch_cache_max_linesz); - end = ALIGN_UP (end, grub_arch_cache_max_linesz); + start = ALIGN_DOWN (start, VasEBoot_arch_cache_max_linesz); + end = ALIGN_UP (end, VasEBoot_arch_cache_max_linesz); switch (type) { case ARCH_ARMV6: - grub_arm_clean_dcache_range_armv6 (start, end, grub_arch_cache_dlinesz); - grub_arm_invalidate_icache_range_armv6 (start, end, - grub_arch_cache_ilinesz); + VasEBoot_arm_clean_dcache_range_armv6 (start, end, VasEBoot_arch_cache_dlinesz); + VasEBoot_arm_invalidate_icache_range_armv6 (start, end, + VasEBoot_arch_cache_ilinesz); break; case ARCH_ARMV7: - grub_arm_clean_dcache_range_armv7 (start, end, grub_arch_cache_dlinesz); - grub_arm_invalidate_icache_range_armv7 (start, end, - grub_arch_cache_ilinesz); + VasEBoot_arm_clean_dcache_range_armv7 (start, end, VasEBoot_arch_cache_dlinesz); + VasEBoot_arm_invalidate_icache_range_armv7 (start, end, + VasEBoot_arch_cache_ilinesz); break; /* Nothing to do. */ case ARCH_ARMV5_WRITE_THROUGH: @@ -253,7 +253,7 @@ grub_arch_sync_caches (void *address, grub_size_t len) } void -grub_arm_disable_caches_mmu (void) +VasEBoot_arm_disable_caches_mmu (void) { if (type == ARCH_UNKNOWN) probe_caches (); @@ -262,10 +262,10 @@ grub_arm_disable_caches_mmu (void) case ARCH_ARMV5_WRITE_THROUGH: case ARCH_ARMV6_UNIFIED: case ARCH_ARMV6: - grub_arm_disable_caches_mmu_armv6 (); + VasEBoot_arm_disable_caches_mmu_armv6 (); break; case ARCH_ARMV7: - grub_arm_disable_caches_mmu_armv7 (); + VasEBoot_arm_disable_caches_mmu_armv7 (); break; /* Pacify GCC. */ case ARCH_UNKNOWN: diff --git a/VasEBoot-core/kern/arm/cache_armv6.S b/VasEBoot-core/kern/arm/cache_armv6.S index dfaded0eb..268a03d93 100644 --- a/VasEBoot-core/kern/arm/cache_armv6.S +++ b/VasEBoot-core/kern/arm/cache_armv6.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "cache_armv6.S" .text @@ -34,20 +34,20 @@ clean_invalidate_dcache: #include "cache.S" -FUNCTION(grub_arm_main_id) +FUNCTION(VasEBoot_arm_main_id) mrc p15, 0, r0, c0, c0, 0 bx lr -FUNCTION(grub_arm_cache_type) +FUNCTION(VasEBoot_arm_cache_type) mrc p15, 0, r0, c0, c0, 1 bx lr -FUNCTION(grub_arm_clear_mmu_v6) +FUNCTION(VasEBoot_arm_clear_mmu_v6) mov r0, #0 mcr p15, 0, r0, c2, c0, 2 bx lr -FUNCTION(grub_arm_enable_mmu) +FUNCTION(VasEBoot_arm_enable_mmu) mcr p15, 0, r0, c2, c0, 0 mvn r0, #0 diff --git a/VasEBoot-core/kern/arm/cache_armv7.S b/VasEBoot-core/kern/arm/cache_armv7.S index 1ef2754af..d01c8d1fc 100644 --- a/VasEBoot-core/kern/arm/cache_armv7.S +++ b/VasEBoot-core/kern/arm/cache_armv7.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "cache_armv7.S" .text diff --git a/VasEBoot-core/kern/arm/compiler-rt.S b/VasEBoot-core/kern/arm/compiler-rt.S index 645b42f50..f4348ebec 100644 --- a/VasEBoot-core/kern/arm/compiler-rt.S +++ b/VasEBoot-core/kern/arm/compiler-rt.S @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "misc.S" .text @@ -71,9 +71,9 @@ FUNCTION(__aeabi_lmul) .endm FUNCTION(__aeabi_uidivmod) - division32 grub_divmod32 + division32 VasEBoot_divmod32 FUNCTION(__aeabi_idivmod) - division32 grub_divmod32s + division32 VasEBoot_divmod32s /* * Null divide-by-zero handler diff --git a/VasEBoot-core/kern/arm/dl.c b/VasEBoot-core/kern/arm/dl.c index eab9d17ff..c2af3cbd6 100644 --- a/VasEBoot-core/kern/arm/dl.c +++ b/VasEBoot-core/kern/arm/dl.c @@ -1,41 +1,41 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include struct trampoline_arm { #define ARM_LOAD_IP 0xe59fc000 #define ARM_BX 0xe12fff1c #define ARM_MOV_PC 0xe1a0f00c - grub_uint32_t load_ip; /* ldr ip, [pc] */ - grub_uint32_t bx; /* bx ip or mov pc, ip*/ - grub_uint32_t addr; + VasEBoot_uint32_t load_ip; /* ldr ip, [pc] */ + VasEBoot_uint32_t bx; /* bx ip or mov pc, ip*/ + VasEBoot_uint32_t addr; }; -static grub_uint16_t thumb_template[8] = +static VasEBoot_uint16_t thumb_template[8] = { 0x468c, /* mov ip, r1 */ 0x4903, /* ldr r1, [pc, #12] ; (10 <.text+0x10>) */ @@ -53,15 +53,15 @@ static grub_uint16_t thumb_template[8] = struct trampoline_thumb { - grub_uint16_t template[8]; - grub_uint32_t neg_addr; + VasEBoot_uint16_t template[8]; + VasEBoot_uint32_t neg_addr; }; #pragma GCC diagnostic ignored "-Wcast-align" -grub_err_t -grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got) +VasEBoot_err_t +VasEBoot_arch_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got) { const Elf_Ehdr *e = ehdr; const Elf_Shdr *s; @@ -70,17 +70,17 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, *tramp = 0; *got = 0; - for (i = 0, s = (const Elf_Shdr *) ((grub_addr_t) e + e->e_shoff); + for (i = 0, s = (const Elf_Shdr *) ((VasEBoot_addr_t) e + e->e_shoff); i < e->e_shnum; - i++, s = (const Elf_Shdr *) ((grub_addr_t) s + e->e_shentsize)) + i++, s = (const Elf_Shdr *) ((VasEBoot_addr_t) s + e->e_shentsize)) if (s->sh_type == SHT_REL) { const Elf_Rel *rel, *max; - for (rel = (const Elf_Rel *) ((grub_addr_t) e + s->sh_offset), - max = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_size); + for (rel = (const Elf_Rel *) ((VasEBoot_addr_t) e + s->sh_offset), + max = (const Elf_Rel *) ((VasEBoot_addr_t) rel + s->sh_size); rel + 1 <= max; - rel = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_entsize)) + rel = (const Elf_Rel *) ((VasEBoot_addr_t) rel + s->sh_entsize)) switch (ELF_R_TYPE (rel->r_info)) { case R_ARM_CALL: @@ -99,17 +99,17 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, } } - grub_dprintf ("dl", "trampoline size %x\n", *tramp); + VasEBoot_dprintf ("dl", "trampoline size %x\n", *tramp); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /************************************************* * Runtime dynamic linker with helper functions. * *************************************************/ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf_Rel *rel, *max; @@ -119,11 +119,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, rel = (Elf_Rel *) ((char *) rel + s->sh_entsize)) { Elf_Addr *target, sym_addr; - grub_err_t retval; + VasEBoot_err_t retval; Elf_Sym *sym; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); target = (void *) ((char *) seg->addr + rel->r_offset); sym = (Elf_Sym *) ((char *) mod->symtab @@ -136,69 +136,69 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, case R_ARM_ABS32: { /* Data will be naturally aligned */ - retval = grub_arm_reloc_abs32 (target, sym_addr); - if (retval != GRUB_ERR_NONE) + retval = VasEBoot_arm_reloc_abs32 (target, sym_addr); + if (retval != VasEBoot_ERR_NONE) return retval; } break; case R_ARM_CALL: case R_ARM_JUMP24: { - grub_int32_t offset; + VasEBoot_int32_t offset; - sym_addr += grub_arm_jump24_get_offset (target); - offset = sym_addr - (grub_uint32_t) target; + sym_addr += VasEBoot_arm_jump24_get_offset (target); + offset = sym_addr - (VasEBoot_uint32_t) target; - if ((sym_addr & 1) || !grub_arm_jump24_check_offset (offset)) + if ((sym_addr & 1) || !VasEBoot_arm_jump24_check_offset (offset)) { struct trampoline_arm *tp = mod->trampptr; mod->trampptr = tp + 1; tp->load_ip = ARM_LOAD_IP; tp->bx = (sym_addr & 1) ? ARM_BX : ARM_MOV_PC; tp->addr = sym_addr + 8; - offset = (grub_uint8_t *) tp - (grub_uint8_t *) target - 8; + offset = (VasEBoot_uint8_t *) tp - (VasEBoot_uint8_t *) target - 8; } - if (!grub_arm_jump24_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm_jump24_check_offset (offset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "trampoline out of range"); - grub_arm_jump24_set_offset (target, offset); + VasEBoot_arm_jump24_set_offset (target, offset); } break; case R_ARM_THM_CALL: case R_ARM_THM_JUMP24: { /* Thumb instructions can be 16-bit aligned */ - grub_int32_t offset; + VasEBoot_int32_t offset; - sym_addr += grub_arm_thm_call_get_offset ((grub_uint16_t *) target); + sym_addr += VasEBoot_arm_thm_call_get_offset ((VasEBoot_uint16_t *) target); - grub_dprintf ("dl", " sym_addr = 0x%08x\n", sym_addr); + VasEBoot_dprintf ("dl", " sym_addr = 0x%08x\n", sym_addr); if (ELF_ST_TYPE (sym->st_info) != STT_FUNC) sym_addr |= 1; - offset = sym_addr - (grub_uint32_t) target; + offset = sym_addr - (VasEBoot_uint32_t) target; - grub_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", + VasEBoot_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", target, sym_addr, offset); if (!(sym_addr & 1) || (offset < -0x200000 || offset >= 0x200000)) { struct trampoline_thumb *tp = mod->trampptr; mod->trampptr = tp + 1; - grub_memcpy (tp->template, thumb_template, sizeof (tp->template)); + VasEBoot_memcpy (tp->template, thumb_template, sizeof (tp->template)); tp->neg_addr = -sym_addr - 4; - offset = ((grub_uint8_t *) tp - (grub_uint8_t *) target - 4) | 1; + offset = ((VasEBoot_uint8_t *) tp - (VasEBoot_uint8_t *) target - 4) | 1; } if (offset < -0x200000 || offset >= 0x200000) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "trampoline out of range"); - grub_dprintf ("dl", " relative destination = %p\n", + VasEBoot_dprintf ("dl", " relative destination = %p\n", (char *) target + offset); - retval = grub_arm_thm_call_set_offset ((grub_uint16_t *) target, offset); - if (retval != GRUB_ERR_NONE) + retval = VasEBoot_arm_thm_call_set_offset ((VasEBoot_uint16_t *) target, offset); + if (retval != VasEBoot_ERR_NONE) return retval; } break; @@ -210,8 +210,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, case R_ARM_THM_MOVW_ABS_NC: case R_ARM_THM_MOVT_ABS: { - grub_uint32_t offset; - offset = grub_arm_thm_movw_movt_get_value((grub_uint16_t *) target); + VasEBoot_uint32_t offset; + offset = VasEBoot_arm_thm_movw_movt_get_value((VasEBoot_uint16_t *) target); offset += sym_addr; if (ELF_R_TYPE (rel->r_info) == R_ARM_THM_MOVT_ABS) @@ -219,62 +219,62 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, else offset &= 0xffff; - grub_arm_thm_movw_movt_set_value((grub_uint16_t *) target, offset); + VasEBoot_arm_thm_movw_movt_set_value((VasEBoot_uint16_t *) target, offset); } break; case R_ARM_THM_JUMP19: { /* Thumb instructions can be 16-bit aligned */ - grub_int32_t offset; + VasEBoot_int32_t offset; - sym_addr += grub_arm_thm_jump19_get_offset ((grub_uint16_t *) target); + sym_addr += VasEBoot_arm_thm_jump19_get_offset ((VasEBoot_uint16_t *) target); if (ELF_ST_TYPE (sym->st_info) != STT_FUNC) sym_addr |= 1; - offset = sym_addr - (grub_uint32_t) target; + offset = sym_addr - (VasEBoot_uint32_t) target; - if (!grub_arm_thm_jump19_check_offset (offset) + if (!VasEBoot_arm_thm_jump19_check_offset (offset) || !(sym_addr & 1)) { struct trampoline_thumb *tp = mod->trampptr; mod->trampptr = tp + 1; - grub_memcpy (tp->template, thumb_template, sizeof (tp->template)); + VasEBoot_memcpy (tp->template, thumb_template, sizeof (tp->template)); tp->neg_addr = -sym_addr - 4; - offset = ((grub_uint8_t *) tp - (grub_uint8_t *) target - 4) | 1; + offset = ((VasEBoot_uint8_t *) tp - (VasEBoot_uint8_t *) target - 4) | 1; } - if (!grub_arm_thm_jump19_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm_thm_jump19_check_offset (offset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "trampoline out of range"); - grub_arm_thm_jump19_set_offset ((grub_uint16_t *) target, offset); + VasEBoot_arm_thm_jump19_set_offset ((VasEBoot_uint16_t *) target, offset); } break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* * Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; /* Check the magic numbers. */ if (e->e_ident[EI_CLASS] != ELFCLASS32 || e->e_ident[EI_DATA] != ELFDATA2LSB || e->e_machine != EM_ARM) - return grub_error (GRUB_ERR_BAD_OS, + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/arm/dl_helper.c b/VasEBoot-core/kern/arm/dl_helper.c index 21d77f763..cfb61afc7 100644 --- a/VasEBoot-core/kern/arm/dl_helper.c +++ b/VasEBoot-core/kern/arm/dl_helper.c @@ -1,42 +1,42 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -static inline grub_uint32_t -thumb_get_instruction_word (grub_uint16_t *target) +static inline VasEBoot_uint32_t +thumb_get_instruction_word (VasEBoot_uint16_t *target) { /* Extract instruction word in alignment-safe manner */ - return grub_le_to_cpu16 ((*target)) << 16 | grub_le_to_cpu16 (*(target + 1)); + return VasEBoot_le_to_cpu16 ((*target)) << 16 | VasEBoot_le_to_cpu16 (*(target + 1)); } static inline void -thumb_set_instruction_word (grub_uint16_t *target, grub_uint32_t insword) +thumb_set_instruction_word (VasEBoot_uint16_t *target, VasEBoot_uint32_t insword) { - *target = grub_cpu_to_le16 (insword >> 16); - *(target + 1) = grub_cpu_to_le16 (insword & 0xffff); + *target = VasEBoot_cpu_to_le16 (insword >> 16); + *(target + 1) = VasEBoot_cpu_to_le16 (insword & 0xffff); } /* @@ -44,16 +44,16 @@ thumb_set_instruction_word (grub_uint16_t *target, grub_uint32_t insword) * * Simple relocation of 32-bit value (in literal pool) */ -grub_err_t -grub_arm_reloc_abs32 (Elf32_Word *target, Elf32_Addr sym_addr) +VasEBoot_err_t +VasEBoot_arm_reloc_abs32 (Elf32_Word *target, Elf32_Addr sym_addr) { Elf32_Addr tmp; - tmp = grub_le_to_cpu32 (*target); + tmp = VasEBoot_le_to_cpu32 (*target); tmp += sym_addr; - *target = grub_cpu_to_le32 (tmp); + *target = VasEBoot_cpu_to_le32 (tmp); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /******************************************************************** @@ -63,12 +63,12 @@ grub_arm_reloc_abs32 (Elf32_Word *target, Elf32_Addr sym_addr) * little-endian, requiring some additional fiddling. * ********************************************************************/ -grub_int32_t -grub_arm_thm_call_get_offset (grub_uint16_t *target) +VasEBoot_int32_t +VasEBoot_arm_thm_call_get_offset (VasEBoot_uint16_t *target) { - grub_uint32_t sign, j1, j2; - grub_uint32_t insword; - grub_int32_t offset; + VasEBoot_uint32_t sign, j1, j2; + VasEBoot_uint32_t insword; + VasEBoot_int32_t offset; insword = thumb_get_instruction_word (target); @@ -87,12 +87,12 @@ grub_arm_thm_call_get_offset (grub_uint16_t *target) return offset; } -grub_err_t -grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset) +VasEBoot_err_t +VasEBoot_arm_thm_call_set_offset (VasEBoot_uint16_t *target, VasEBoot_int32_t offset) { - grub_uint32_t sign, j1, j2; - const grub_uint32_t insmask = 0xf800d000; - grub_uint32_t insword; + VasEBoot_uint32_t sign, j1, j2; + const VasEBoot_uint32_t insmask = 0xf800d000; + VasEBoot_uint32_t insword; int is_blx; insword = thumb_get_instruction_word (target); @@ -103,7 +103,7 @@ grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset) is_blx = 0; if (!is_blx && !(offset & 1)) - return grub_error (GRUB_ERR_BAD_MODULE, "bl/b.w targettting ARM"); + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "bl/b.w targettting ARM"); /* Transform blx into bl if necessarry. */ if (is_blx && (offset & 1)) @@ -120,16 +120,16 @@ grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset) thumb_set_instruction_word (target, insword); - grub_dprintf ("dl", " *insword = 0x%08x", insword); + VasEBoot_dprintf ("dl", " *insword = 0x%08x", insword); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_int32_t -grub_arm_thm_jump19_get_offset (grub_uint16_t *target) +VasEBoot_int32_t +VasEBoot_arm_thm_jump19_get_offset (VasEBoot_uint16_t *target) { - grub_int32_t offset; - grub_uint32_t insword; + VasEBoot_int32_t offset; + VasEBoot_uint32_t insword; insword = thumb_get_instruction_word (target); @@ -147,10 +147,10 @@ grub_arm_thm_jump19_get_offset (grub_uint16_t *target) } void -grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset) +VasEBoot_arm_thm_jump19_set_offset (VasEBoot_uint16_t *target, VasEBoot_int32_t offset) { - grub_uint32_t insword; - const grub_uint32_t insmask = 0xfbc0d000; + VasEBoot_uint32_t insword; + const VasEBoot_uint32_t insmask = 0xfbc0d000; offset >>= 1; offset &= 0xfffff; @@ -168,17 +168,17 @@ grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset) } int -grub_arm_thm_jump19_check_offset (grub_int32_t offset) +VasEBoot_arm_thm_jump19_check_offset (VasEBoot_int32_t offset) { if ((offset > 1048574) || (offset < -1048576)) return 0; return 1; } -grub_uint16_t -grub_arm_thm_movw_movt_get_value (grub_uint16_t *target) +VasEBoot_uint16_t +VasEBoot_arm_thm_movw_movt_get_value (VasEBoot_uint16_t *target) { - grub_uint32_t insword; + VasEBoot_uint32_t insword; insword = thumb_get_instruction_word (target); @@ -187,10 +187,10 @@ grub_arm_thm_movw_movt_get_value (grub_uint16_t *target) } void -grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value) +VasEBoot_arm_thm_movw_movt_set_value (VasEBoot_uint16_t *target, VasEBoot_uint16_t value) { - grub_uint32_t insword; - const grub_uint32_t insmask = 0xfbf08f00; + VasEBoot_uint32_t insword; + const VasEBoot_uint32_t insmask = 0xfbf08f00; insword = thumb_get_instruction_word (target); insword &= insmask; @@ -208,13 +208,13 @@ grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value) * ARM instructions are 32-bit in size and 32-bit aligned. * ***********************************************************/ -grub_int32_t -grub_arm_jump24_get_offset (grub_uint32_t *target) +VasEBoot_int32_t +VasEBoot_arm_jump24_get_offset (VasEBoot_uint32_t *target) { - grub_int32_t offset; - grub_uint32_t insword; + VasEBoot_int32_t offset; + VasEBoot_uint32_t insword; - insword = grub_le_to_cpu32 (*target); + insword = VasEBoot_le_to_cpu32 (*target); offset = (insword & 0x00ffffff) << 2; if (offset & 0x02000000) @@ -223,7 +223,7 @@ grub_arm_jump24_get_offset (grub_uint32_t *target) } int -grub_arm_jump24_check_offset (grub_int32_t offset) +VasEBoot_arm_jump24_check_offset (VasEBoot_int32_t offset) { if (offset >= 0x02000000 || offset < -0x02000000) return 0; @@ -231,15 +231,15 @@ grub_arm_jump24_check_offset (grub_int32_t offset) } void -grub_arm_jump24_set_offset (grub_uint32_t *target, - grub_int32_t offset) +VasEBoot_arm_jump24_set_offset (VasEBoot_uint32_t *target, + VasEBoot_int32_t offset) { - grub_uint32_t insword; + VasEBoot_uint32_t insword; - insword = grub_le_to_cpu32 (*target); + insword = VasEBoot_le_to_cpu32 (*target); insword &= 0xff000000; insword |= (offset >> 2) & 0x00ffffff; - *target = grub_cpu_to_le32 (insword); + *target = VasEBoot_cpu_to_le32 (insword); } diff --git a/VasEBoot-core/kern/arm/efi/init.c b/VasEBoot-core/kern/arm/efi/init.c index 06df60e2f..7ee7c84c5 100644 --- a/VasEBoot-core/kern/arm/efi/init.c +++ b/VasEBoot-core/kern/arm/efi/init.c @@ -1,74 +1,74 @@ /* init.c - initialize an arm-based EFI system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -static grub_uint64_t tmr; -static grub_efi_event_t tmr_evt; +static VasEBoot_uint64_t tmr; +static VasEBoot_efi_event_t tmr_evt; -static grub_uint64_t -grub_efi_get_time_ms (void) +static VasEBoot_uint64_t +VasEBoot_efi_get_time_ms (void) { return tmr; } static void -increment_timer (grub_efi_event_t event __attribute__ ((unused)), +increment_timer (VasEBoot_efi_event_t event __attribute__ ((unused)), void *context __attribute__ ((unused))) { tmr += 10; } void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - grub_efi_init (); + VasEBoot_efi_init (); - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; - efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL, - GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt); - efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000); + efi_call_5 (b->create_event, VasEBoot_EFI_EVT_TIMER | VasEBoot_EFI_EVT_NOTIFY_SIGNAL, + VasEBoot_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt); + efi_call_3 (b->set_timer, tmr_evt, VasEBoot_EFI_TIMER_PERIODIC, 100000); - grub_install_get_time_ms (grub_efi_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_efi_get_time_ms); } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - if (!(flags & GRUB_LOADER_FLAG_NORETURN)) + if (!(flags & VasEBoot_LOADER_FLAG_NORETURN)) return; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; - efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0); + efi_call_3 (b->set_timer, tmr_evt, VasEBoot_EFI_TIMER_CANCEL, 0); efi_call_1 (b->close_event, tmr_evt); - grub_efi_fini (); + VasEBoot_efi_fini (); } diff --git a/VasEBoot-core/kern/arm/efi/misc.c b/VasEBoot-core/kern/arm/efi/misc.c index 7cd41842a..961cdbe17 100644 --- a/VasEBoot-core/kern/arm/efi/misc.c +++ b/VasEBoot-core/kern/arm/efi/misc.c @@ -1,41 +1,41 @@ /* misc.c - various system functions for an arm-based EFI system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -static inline grub_size_t -page_align (grub_size_t size) +static inline VasEBoot_size_t +page_align (VasEBoot_size_t size) { return (size + (1 << 12) - 1) & (~((1 << 12) - 1)); } /* Find the optimal number of pages for the memory map. Is it better to move this code to efi/mm.c? */ -static grub_efi_uintn_t +static VasEBoot_efi_uintn_t find_mmap_size (void) { - static grub_efi_uintn_t mmap_size = 0; + static VasEBoot_efi_uintn_t mmap_size = 0; if (mmap_size != 0) return mmap_size; @@ -44,19 +44,19 @@ find_mmap_size (void) while (1) { int ret; - grub_efi_memory_descriptor_t *mmap; - grub_efi_uintn_t desc_size; + VasEBoot_efi_memory_descriptor_t *mmap; + VasEBoot_efi_uintn_t desc_size; - mmap = grub_malloc (mmap_size); + mmap = VasEBoot_malloc (mmap_size); if (! mmap) return 0; - ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0); - grub_free (mmap); + ret = VasEBoot_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0); + VasEBoot_free (mmap); if (ret < 0) { - grub_error (GRUB_ERR_IO, "cannot get memory map"); + VasEBoot_error (VasEBoot_ERR_IO, "cannot get memory map"); return 0; } else if (ret > 0) @@ -65,7 +65,7 @@ find_mmap_size (void) mmap_size += (1 << 12); } - /* Increase the size a bit for safety, because GRUB allocates more on + /* Increase the size a bit for safety, because VasEBoot allocates more on later, and EFI itself may allocate more. */ mmap_size += (1 << 12); @@ -73,31 +73,31 @@ find_mmap_size (void) } #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ - ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + ((VasEBoot_efi_memory_descriptor_t *) ((char *) (desc) + (size))) #define PAGE_SHIFT 12 void * -grub_efi_allocate_loader_memory (grub_uint32_t min_offset, grub_uint32_t size) +VasEBoot_efi_allocate_loader_memory (VasEBoot_uint32_t min_offset, VasEBoot_uint32_t size) { - grub_efi_uintn_t desc_size; - grub_efi_memory_descriptor_t *mmap, *mmap_end; - grub_efi_uintn_t mmap_size, tmp_mmap_size; - grub_efi_memory_descriptor_t *desc; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_memory_descriptor_t *mmap, *mmap_end; + VasEBoot_efi_uintn_t mmap_size, tmp_mmap_size; + VasEBoot_efi_memory_descriptor_t *desc; void *mem = NULL; - grub_addr_t min_start = 0; + VasEBoot_addr_t min_start = 0; mmap_size = find_mmap_size(); if (!mmap_size) return NULL; - mmap = grub_malloc(mmap_size); + mmap = VasEBoot_malloc(mmap_size); if (!mmap) return NULL; tmp_mmap_size = mmap_size; - if (grub_efi_get_memory_map (&tmp_mmap_size, mmap, 0, &desc_size, 0) <= 0) + if (VasEBoot_efi_get_memory_map (&tmp_mmap_size, mmap, 0, &desc_size, 0) <= 0) { - grub_error (GRUB_ERR_IO, "cannot get memory map"); + VasEBoot_error (VasEBoot_ERR_IO, "cannot get memory map"); goto fail; } @@ -110,9 +110,9 @@ grub_efi_allocate_loader_memory (grub_uint32_t min_offset, grub_uint32_t size) { switch (desc->type) { - case GRUB_EFI_CONVENTIONAL_MEMORY: - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: + case VasEBoot_EFI_CONVENTIONAL_MEMORY: + case VasEBoot_EFI_LOADER_CODE: + case VasEBoot_EFI_LOADER_DATA: min_start = desc->physical_start + min_offset; found = 1; break; @@ -127,31 +127,31 @@ grub_efi_allocate_loader_memory (grub_uint32_t min_offset, grub_uint32_t size) for (desc = mmap ; desc < mmap_end ; desc = NEXT_MEMORY_DESCRIPTOR(desc, desc_size)) { - grub_uint64_t start, end; + VasEBoot_uint64_t start, end; - grub_dprintf("mm", "%s: 0x%08x bytes @ 0x%08x\n", + VasEBoot_dprintf("mm", "%s: 0x%08x bytes @ 0x%08x\n", __FUNCTION__, - (grub_uint32_t) (desc->num_pages << PAGE_SHIFT), - (grub_uint32_t) (desc->physical_start)); + (VasEBoot_uint32_t) (desc->num_pages << PAGE_SHIFT), + (VasEBoot_uint32_t) (desc->physical_start)); - if (desc->type != GRUB_EFI_CONVENTIONAL_MEMORY) + if (desc->type != VasEBoot_EFI_CONVENTIONAL_MEMORY) continue; start = desc->physical_start; end = start + (desc->num_pages << PAGE_SHIFT); - grub_dprintf("mm", "%s: start=0x%016llx, end=0x%016llx\n", + VasEBoot_dprintf("mm", "%s: start=0x%016llx, end=0x%016llx\n", __FUNCTION__, start, end); start = start < min_start ? min_start : start; if (start + size > end) continue; - grub_dprintf("mm", "%s: let's allocate some (0x%x) pages @ 0x%08x...\n", - __FUNCTION__, (size >> PAGE_SHIFT), (grub_addr_t) start); - mem = grub_efi_allocate_pages (start, (size >> PAGE_SHIFT) + 1); - grub_dprintf("mm", "%s: retval=0x%08x\n", - __FUNCTION__, (grub_addr_t) mem); + VasEBoot_dprintf("mm", "%s: let's allocate some (0x%x) pages @ 0x%08x...\n", + __FUNCTION__, (size >> PAGE_SHIFT), (VasEBoot_addr_t) start); + mem = VasEBoot_efi_allocate_pages (start, (size >> PAGE_SHIFT) + 1); + VasEBoot_dprintf("mm", "%s: retval=0x%08x\n", + __FUNCTION__, (VasEBoot_addr_t) mem); if (! mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate memory"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate memory"); goto fail; } break; @@ -159,44 +159,44 @@ grub_efi_allocate_loader_memory (grub_uint32_t min_offset, grub_uint32_t size) if (! mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate memory"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate memory"); goto fail; } - grub_free (mmap); + VasEBoot_free (mmap); return mem; fail: - grub_free (mmap); + VasEBoot_free (mmap); return NULL; } -grub_err_t -grub_efi_prepare_platform (void) +VasEBoot_err_t +VasEBoot_efi_prepare_platform (void) { - grub_efi_uintn_t mmap_size; - grub_efi_uintn_t map_key; - grub_efi_uintn_t desc_size; - grub_efi_uint32_t desc_version; - grub_efi_memory_descriptor_t *mmap_buf; - grub_err_t err; + VasEBoot_efi_uintn_t mmap_size; + VasEBoot_efi_uintn_t map_key; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_uint32_t desc_version; + VasEBoot_efi_memory_descriptor_t *mmap_buf; + VasEBoot_err_t err; /* * Cloned from IA64 - * Must be done after grub_machine_fini because map_key is used by + * Must be done after VasEBoot_machine_fini because map_key is used by *exit_boot_services. */ mmap_size = find_mmap_size (); if (! mmap_size) - return GRUB_ERR_OUT_OF_MEMORY; - mmap_buf = grub_efi_allocate_pages (0, page_align (mmap_size) >> 12); + return VasEBoot_ERR_OUT_OF_MEMORY; + mmap_buf = VasEBoot_efi_allocate_pages (0, page_align (mmap_size) >> 12); if (! mmap_buf) - return GRUB_ERR_OUT_OF_MEMORY; + return VasEBoot_ERR_OUT_OF_MEMORY; - err = grub_efi_finish_boot_services (&mmap_size, mmap_buf, &map_key, + err = VasEBoot_efi_finish_boot_services (&mmap_size, mmap_buf, &map_key, &desc_size, &desc_version); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/arm/efi/startup.S b/VasEBoot-core/kern/arm/efi/startup.S index 9f8265315..deb3b8f78 100644 --- a/VasEBoot-core/kern/arm/efi/startup.S +++ b/VasEBoot-core/kern/arm/efi/startup.S @@ -18,7 +18,7 @@ * */ -#include +#include .file "startup.S" .text @@ -27,10 +27,10 @@ FUNCTION(_start) /* * EFI_SYSTEM_TABLE and EFI_HANDLE are passed in r1/r0. */ - ldr ip, =EXT_C(grub_efi_image_handle) + ldr ip, =EXT_C(VasEBoot_efi_image_handle) str r0, [ip] - ldr ip, =EXT_C(grub_efi_system_table) + ldr ip, =EXT_C(VasEBoot_efi_system_table) str r1, [ip] - ldr ip, =EXT_C(grub_main) + ldr ip, =EXT_C(VasEBoot_main) bx ip END diff --git a/VasEBoot-core/kern/arm/uboot/startup.S b/VasEBoot-core/kern/arm/uboot/startup.S index 5efaae16e..8786112d0 100644 --- a/VasEBoot-core/kern/arm/uboot/startup.S +++ b/VasEBoot-core/kern/arm/uboot/startup.S @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include /* - * GRUB is called from U-Boot as a Linux Kernel type image, which + * VasEBoot is called from U-Boot as a Linux Kernel type image, which * means among other things that it always enters in ARM state. * * - * Overview of GRUB image layout: + * Overview of VasEBoot image layout: * * _start: * Entry point (1 ARM branch instruction, to "codestart") - * grub_total_module_size: + * VasEBoot_total_module_size: * Data field: Size of included module blob - * (when generated by grub-mkimage) + * (when generated by VasEBoot-mkimage) * codestart: * Remainder of statically-linked executable code and data. * __bss_start: @@ -50,12 +50,12 @@ FUNCTION(_start) b codestart - @ Size of final image integrated module blob - set by grub-mkimage - .org _start + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE -VARIABLE(grub_total_module_size) + @ Size of final image integrated module blob - set by VasEBoot-mkimage + .org _start + VasEBoot_KERNEL_MACHINE_TOTAL_MODULE_SIZE +VARIABLE(VasEBoot_total_module_size) .long 0 -VARIABLE(grub_modbase) +VARIABLE(VasEBoot_modbase) .long 0 bss_start_ptr: .long EXT_C(__bss_start) @@ -92,8 +92,8 @@ FUNCTION(codestart) ldr r0, bss_start_ptr @ src add r0, r0, r1 - add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - mvn r2, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + add r0, r0, #(VasEBoot_KERNEL_MACHINE_MOD_ALIGN - 1) + mvn r2, #(VasEBoot_KERNEL_MACHINE_MOD_ALIGN - 1) and r0, r0, r2 1: ldr r3, [r0], #4 @load next offset @@ -112,20 +112,20 @@ reloc_done: @ Modules have been stored as a blob @ they need to be manually relocated to _end - add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - mvn r1, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + add r0, r0, #(VasEBoot_KERNEL_MACHINE_MOD_ALIGN - 1) + mvn r1, #(VasEBoot_KERNEL_MACHINE_MOD_ALIGN - 1) and r0, r0, r1 @ src = aligned end of relocations ldr r1, end_ptr @ dst = End of BSS - ldr r2, grub_total_module_size @ blob size + ldr r2, VasEBoot_total_module_size @ blob size - add r1, r1, #GRUB_KERNEL_MACHINE_STACK_SIZE + add r1, r1, #VasEBoot_KERNEL_MACHINE_STACK_SIZE and r1, r1, #~0x7 @ Ensure 8-byte alignment sub sp, r1, #8 add r1, r1, #1024 - str r1, EXT_C(grub_modbase) + str r1, EXT_C(VasEBoot_modbase) add r1, r1, r2 add r0, r0, r2 @@ -151,16 +151,16 @@ reloc_done: cmp r0, r1 bne 1b - b EXT_C(grub_main) + b EXT_C(VasEBoot_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. + * U-Boot (Global Data Pointer) and preserve it for VasEBoot. */ -FUNCTION(grub_uboot_syscall) +FUNCTION(VasEBoot_uboot_syscall) str r8, transition_space str lr, transition_space + 4 str r9, transition_space + 8 @@ -177,10 +177,10 @@ FUNCTION(grub_uboot_syscall) bx lr do_syscall: - ldr ip, grub_uboot_syscall_ptr + ldr ip, VasEBoot_uboot_syscall_ptr bx ip -FUNCTION(grub_uboot_return) +FUNCTION(VasEBoot_uboot_return) adr sp, entry_state_end pop {r4-r12, lr} mov sp, r12 @@ -190,9 +190,9 @@ FUNCTION(grub_uboot_return) .align 3 @ U-boot context stack space entry_state_end: -VARIABLE(grub_uboot_machine_type) +VARIABLE(VasEBoot_uboot_machine_type) .long 0 @ r1 -VARIABLE(grub_uboot_boot_data) +VARIABLE(VasEBoot_uboot_boot_data) .long 0 @ r2 .long 0 @ r3 .long 0 @ r4 @@ -204,18 +204,18 @@ gd_backup: .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 - +VARIABLE(VasEBoot_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 +@ VasEBoot context stack space transition_space: .long 0 @ r8 .long 0 @ lr .long 0 @ r9 -VARIABLE(grub_uboot_syscall_ptr) +VARIABLE(VasEBoot_uboot_syscall_ptr) .long 0 @ END diff --git a/VasEBoot-core/kern/arm64/cache.c b/VasEBoot-core/kern/arm64/cache.c index b84383da1..050eb1902 100644 --- a/VasEBoot-core/kern/arm64/cache.c +++ b/VasEBoot-core/kern/arm64/cache.c @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -static grub_int64_t dlinesz; -static grub_int64_t ilinesz; +static VasEBoot_int64_t dlinesz; +static VasEBoot_int64_t ilinesz; /* Prototypes for asm functions. */ -void grub_arch_clean_dcache_range (grub_addr_t beg, grub_addr_t end, - grub_uint64_t line_size); -void grub_arch_invalidate_icache_range (grub_addr_t beg, grub_addr_t end, - grub_uint64_t line_size); +void VasEBoot_arch_clean_dcache_range (VasEBoot_addr_t beg, VasEBoot_addr_t end, + VasEBoot_uint64_t line_size); +void VasEBoot_arch_invalidate_icache_range (VasEBoot_addr_t beg, VasEBoot_addr_t end, + VasEBoot_uint64_t line_size); static void probe_caches (void) { - grub_uint64_t cache_type; + VasEBoot_uint64_t cache_type; /* Read Cache Type Register */ asm volatile ("mrs %0, ctr_el0": "=r"(cache_type)); @@ -39,25 +39,25 @@ probe_caches (void) dlinesz = 4 << ((cache_type >> 16) & 0xf); ilinesz = 4 << (cache_type & 0xf); - grub_dprintf("cache", "D$ line size: %lld\n", (long long) dlinesz); - grub_dprintf("cache", "I$ line size: %lld\n", (long long) ilinesz); + VasEBoot_dprintf("cache", "D$ line size: %lld\n", (long long) dlinesz); + VasEBoot_dprintf("cache", "I$ line size: %lld\n", (long long) ilinesz); } void -grub_arch_sync_caches (void *address, grub_size_t len) +VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) { - grub_uint64_t start, end, max_align; + VasEBoot_uint64_t start, end, max_align; if (dlinesz == 0) probe_caches(); if (dlinesz == 0) - grub_fatal ("Unknown cache line size!"); + VasEBoot_fatal ("Unknown cache line size!"); max_align = dlinesz > ilinesz ? dlinesz : ilinesz; - start = ALIGN_DOWN ((grub_uint64_t) address, max_align); - end = ALIGN_UP ((grub_uint64_t) address + len, max_align); + start = ALIGN_DOWN ((VasEBoot_uint64_t) address, max_align); + end = ALIGN_UP ((VasEBoot_uint64_t) address + len, max_align); - grub_arch_clean_dcache_range (start, end, dlinesz); - grub_arch_invalidate_icache_range (start, end, ilinesz); + VasEBoot_arch_clean_dcache_range (start, end, dlinesz); + VasEBoot_arch_invalidate_icache_range (start, end, ilinesz); } diff --git a/VasEBoot-core/kern/arm64/cache_flush.S b/VasEBoot-core/kern/arm64/cache_flush.S index e064f7ece..e740c81cf 100644 --- a/VasEBoot-core/kern/arm64/cache_flush.S +++ b/VasEBoot-core/kern/arm64/cache_flush.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "cache_flush.S" .text @@ -28,7 +28,7 @@ // x0 - *beg (inclusive) // x1 - *end (exclusive) // x2 - line size -FUNCTION(grub_arch_clean_dcache_range) +FUNCTION(VasEBoot_arch_clean_dcache_range) // Clean data cache for range to point-of-unification 1: cmp x0, x1 b.ge 2f @@ -42,7 +42,7 @@ FUNCTION(grub_arch_clean_dcache_range) // x0 - *beg (inclusive) // x1 - *end (exclusive) // x2 - line size -FUNCTION(grub_arch_invalidate_icache_range) +FUNCTION(VasEBoot_arch_invalidate_icache_range) // Invalidate instruction cache for range to point-of-unification 1: cmp x0, x1 b.ge 2f diff --git a/VasEBoot-core/kern/arm64/dl.c b/VasEBoot-core/kern/arm64/dl.c index fb0337319..81d5a1ea9 100644 --- a/VasEBoot-core/kern/arm64/dl.c +++ b/VasEBoot-core/kern/arm64/dl.c @@ -1,29 +1,29 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define LDR 0x58000050 #define BR 0xd61f0200 @@ -32,18 +32,18 @@ /* * Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; /* Check the magic numbers. */ if (e->e_ident[EI_CLASS] != ELFCLASS64 || e->e_ident[EI_DATA] != ELFDATA2LSB || e->e_machine != EM_AARCH64) - return grub_error (GRUB_ERR_BAD_OS, + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #pragma GCC diagnostic ignored "-Wcast-align" @@ -51,9 +51,9 @@ grub_arch_dl_check_header (void *ehdr) /* * Unified function for both REL and RELA */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf_Rel *rel, *max; unsigned unmatched_adr_got_page = 0; @@ -65,10 +65,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { Elf_Sym *sym; void *place; - grub_uint64_t sym_addr; + VasEBoot_uint64_t sym_addr; if (rel->r_offset >= seg->size) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); sym = (Elf_Sym *) ((char *) mod->symtab @@ -78,75 +78,75 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, if (s->sh_type == SHT_RELA) sym_addr += ((Elf_Rela *) rel)->r_addend; - place = (void *) ((grub_addr_t) seg->addr + rel->r_offset); + place = (void *) ((VasEBoot_addr_t) seg->addr + rel->r_offset); switch (ELF_R_TYPE (rel->r_info)) { case R_AARCH64_ABS64: { - grub_uint64_t *abs_place = place; + VasEBoot_uint64_t *abs_place = place; - grub_dprintf ("dl", " reloc_abs64 %p => 0x%016llx\n", + VasEBoot_dprintf ("dl", " reloc_abs64 %p => 0x%016llx\n", place, (unsigned long long) sym_addr); - *abs_place = (grub_uint64_t) sym_addr; + *abs_place = (VasEBoot_uint64_t) sym_addr; } break; case R_AARCH64_ADD_ABS_LO12_NC: - grub_arm64_set_abs_lo12 (place, sym_addr); + VasEBoot_arm64_set_abs_lo12 (place, sym_addr); break; case R_AARCH64_LDST64_ABS_LO12_NC: - grub_arm64_set_abs_lo12_ldst64 (place, sym_addr); + VasEBoot_arm64_set_abs_lo12_ldst64 (place, sym_addr); break; case R_AARCH64_CALL26: case R_AARCH64_JUMP26: { - grub_int64_t offset = sym_addr - (grub_uint64_t) place; + VasEBoot_int64_t offset = sym_addr - (VasEBoot_uint64_t) place; - if (!grub_arm_64_check_xxxx26_offset (offset)) + if (!VasEBoot_arm_64_check_xxxx26_offset (offset)) { - struct grub_arm64_trampoline *tp = mod->trampptr; + struct VasEBoot_arm64_trampoline *tp = mod->trampptr; mod->trampptr = tp + 1; tp->ldr = LDR; tp->br = BR; tp->addr = sym_addr; - offset = (grub_uint8_t *) tp - (grub_uint8_t *) place; + offset = (VasEBoot_uint8_t *) tp - (VasEBoot_uint8_t *) place; } - if (!grub_arm_64_check_xxxx26_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm_64_check_xxxx26_offset (offset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "trampoline out of range"); - grub_arm64_set_xxxx26_offset (place, offset); + VasEBoot_arm64_set_xxxx26_offset (place, offset); } break; case R_AARCH64_PREL32: { - grub_int64_t value; + VasEBoot_int64_t value; Elf64_Word *addr32 = place; - value = ((grub_int32_t) *addr32) + sym_addr - - (Elf64_Xword) (grub_addr_t) seg->addr - rel->r_offset; - if (value != (grub_int32_t) value) - return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); - grub_dprintf("dl", " reloc_prel32 %p => 0x%016llx\n", + value = ((VasEBoot_int32_t) *addr32) + sym_addr - + (Elf64_Xword) (VasEBoot_addr_t) seg->addr - rel->r_offset; + if (value != (VasEBoot_int32_t) value) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "relocation out of range"); + VasEBoot_dprintf("dl", " reloc_prel32 %p => 0x%016llx\n", place, (unsigned long long) sym_addr); *addr32 = value; } break; case R_AARCH64_ADR_GOT_PAGE: { - grub_uint64_t *gp = mod->gotptr; + VasEBoot_uint64_t *gp = mod->gotptr; Elf_Rela *rel2; - grub_int64_t gpoffset = ((grub_uint64_t) gp & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL); - *gp = (grub_uint64_t) sym_addr; + VasEBoot_int64_t gpoffset = ((VasEBoot_uint64_t) gp & ~0xfffULL) - (((VasEBoot_uint64_t) place) & ~0xfffULL); + *gp = (VasEBoot_uint64_t) sym_addr; mod->gotptr = gp + 1; unmatched_adr_got_page++; - grub_dprintf("dl", " reloc_got %p => 0x%016llx (0x%016llx)\n", + VasEBoot_dprintf("dl", " reloc_got %p => 0x%016llx (0x%016llx)\n", place, (unsigned long long) sym_addr, (unsigned long long) gp); - if (!grub_arm64_check_hi21_signed (gpoffset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm64_check_hi21_signed (gpoffset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "HI21 out of range"); - grub_arm64_set_hi21(place, gpoffset); + VasEBoot_arm64_set_hi21(place, gpoffset); for (rel2 = (Elf_Rela *) ((char *) rel + s->sh_entsize); rel2 < (Elf_Rela *) max; rel2 = (Elf_Rela *) ((char *) rel2 + s->sh_entsize)) @@ -155,39 +155,39 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, && ((Elf_Rela *) rel)->r_addend == rel2->r_addend && ELF_R_TYPE (rel2->r_info) == R_AARCH64_LD64_GOT_LO12_NC) { - grub_arm64_set_abs_lo12_ldst64 ((void *) ((grub_addr_t) seg->addr + rel2->r_offset), - (grub_uint64_t)gp); + VasEBoot_arm64_set_abs_lo12_ldst64 ((void *) ((VasEBoot_addr_t) seg->addr + rel2->r_offset), + (VasEBoot_uint64_t)gp); break; } if (rel2 >= (Elf_Rela *) max) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "ADR_GOT_PAGE without matching LD64_GOT_LO12_NC"); } break; case R_AARCH64_LD64_GOT_LO12_NC: if (unmatched_adr_got_page == 0) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "LD64_GOT_LO12_NC without matching ADR_GOT_PAGE"); unmatched_adr_got_page--; break; case R_AARCH64_ADR_PREL_PG_HI21: { - grub_int64_t offset = (sym_addr & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL); + VasEBoot_int64_t offset = (sym_addr & ~0xfffULL) - (((VasEBoot_uint64_t) place) & ~0xfffULL); - if (!grub_arm64_check_hi21_signed (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm64_check_hi21_signed (offset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "HI21 out of range"); - grub_arm64_set_hi21 (place, offset); + VasEBoot_arm64_set_hi21 (place, offset); } break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/arm64/dl_helper.c b/VasEBoot-core/kern/arm64/dl_helper.c index e00c198db..eb66828d0 100644 --- a/VasEBoot-core/kern/arm64/dl_helper.c +++ b/VasEBoot-core/kern/arm64/dl_helper.c @@ -1,40 +1,40 @@ -/* dl_helper.c - relocation helper functions for modules and grub-mkimage */ +/* dl_helper.c - relocation helper functions for modules and VasEBoot-mkimage */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* - * grub_arm64_reloc_xxxx26(): + * VasEBoot_arm64_reloc_xxxx26(): * * JUMP26/CALL26 relocations for B and BL instructions. */ int -grub_arm_64_check_xxxx26_offset (grub_int64_t offset) +VasEBoot_arm_64_check_xxxx26_offset (VasEBoot_int64_t offset) { - const grub_ssize_t offset_low = -(1 << 27), offset_high = (1 << 27) - 1; + const VasEBoot_ssize_t offset_low = -(1 << 27), offset_high = (1 << 27) - 1; if ((offset < offset_low) || (offset > offset_high)) return 0; @@ -42,63 +42,63 @@ grub_arm_64_check_xxxx26_offset (grub_int64_t offset) } void -grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset) +VasEBoot_arm64_set_xxxx26_offset (VasEBoot_uint32_t *place, VasEBoot_int64_t offset) { - const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfc000000); + const VasEBoot_uint32_t insmask = VasEBoot_cpu_to_le32_compile_time (0xfc000000); - grub_dprintf ("dl", " reloc_xxxx64 %p %c= 0x%llx\n", + VasEBoot_dprintf ("dl", " reloc_xxxx64 %p %c= 0x%llx\n", place, offset > 0 ? '+' : '-', offset < 0 ? (long long) -(unsigned long long) offset : offset); *place &= insmask; - *place |= grub_cpu_to_le32 (offset >> 2) & ~insmask; + *place |= VasEBoot_cpu_to_le32 (offset >> 2) & ~insmask; } int -grub_arm64_check_hi21_signed (grub_int64_t offset) +VasEBoot_arm64_check_hi21_signed (VasEBoot_int64_t offset) { - if (offset != (grub_int64_t)(grub_int32_t)offset) + if (offset != (VasEBoot_int64_t)(VasEBoot_int32_t)offset) return 0; return 1; } void -grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset) +VasEBoot_arm64_set_hi21 (VasEBoot_uint32_t *place, VasEBoot_int64_t offset) { - const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0x9f00001f); - grub_uint32_t val; + const VasEBoot_uint32_t insmask = VasEBoot_cpu_to_le32_compile_time (0x9f00001f); + VasEBoot_uint32_t val; offset >>= 12; val = ((offset & 3) << 29) | (((offset >> 2) & 0x7ffff) << 5); *place &= insmask; - *place |= grub_cpu_to_le32 (val) & ~insmask; + *place |= VasEBoot_cpu_to_le32 (val) & ~insmask; } void -grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target) +VasEBoot_arm64_set_abs_lo12 (VasEBoot_uint32_t *place, VasEBoot_int64_t target) { - const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xffc003ff); + const VasEBoot_uint32_t insmask = VasEBoot_cpu_to_le32_compile_time (0xffc003ff); *place &= insmask; - *place |= grub_cpu_to_le32 (target << 10) & ~insmask; + *place |= VasEBoot_cpu_to_le32 (target << 10) & ~insmask; } void -grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target) +VasEBoot_arm64_set_abs_lo12_ldst64 (VasEBoot_uint32_t *place, VasEBoot_int64_t target) { - const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfff803ff); + const VasEBoot_uint32_t insmask = VasEBoot_cpu_to_le32_compile_time (0xfff803ff); *place &= insmask; - *place |= grub_cpu_to_le32 (target << 7) & ~insmask; + *place |= VasEBoot_cpu_to_le32 (target << 7) & ~insmask; } #pragma GCC diagnostic ignored "-Wcast-align" -grub_err_t -grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got) +VasEBoot_err_t +VasEBoot_arm64_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got) { const Elf64_Ehdr *e = ehdr; const Elf64_Shdr *s; @@ -107,22 +107,22 @@ grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, *tramp = 0; *got = 0; - for (i = 0, s = (Elf64_Shdr *) ((char *) e + grub_le_to_cpu64 (e->e_shoff)); - i < grub_le_to_cpu16 (e->e_shnum); - i++, s = (Elf64_Shdr *) ((char *) s + grub_le_to_cpu16 (e->e_shentsize))) - if (s->sh_type == grub_cpu_to_le32_compile_time (SHT_REL) - || s->sh_type == grub_cpu_to_le32_compile_time (SHT_RELA)) + for (i = 0, s = (Elf64_Shdr *) ((char *) e + VasEBoot_le_to_cpu64 (e->e_shoff)); + i < VasEBoot_le_to_cpu16 (e->e_shnum); + i++, s = (Elf64_Shdr *) ((char *) s + VasEBoot_le_to_cpu16 (e->e_shentsize))) + if (s->sh_type == VasEBoot_cpu_to_le32_compile_time (SHT_REL) + || s->sh_type == VasEBoot_cpu_to_le32_compile_time (SHT_RELA)) { const Elf64_Rela *rel, *max; - for (rel = (Elf64_Rela *) ((char *) e + grub_le_to_cpu64 (s->sh_offset)), - max = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_size)); - rel < max; rel = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_entsize))) + for (rel = (Elf64_Rela *) ((char *) e + VasEBoot_le_to_cpu64 (s->sh_offset)), + max = (const Elf64_Rela *) ((char *) rel + VasEBoot_le_to_cpu64 (s->sh_size)); + rel < max; rel = (const Elf64_Rela *) ((char *) rel + VasEBoot_le_to_cpu64 (s->sh_entsize))) switch (ELF64_R_TYPE (rel->r_info)) { case R_AARCH64_CALL26: case R_AARCH64_JUMP26: - *tramp += sizeof (struct grub_arm64_trampoline); + *tramp += sizeof (struct VasEBoot_arm64_trampoline); break; case R_AARCH64_ADR_GOT_PAGE: *got += 8; @@ -130,5 +130,5 @@ grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/arm64/efi/init.c b/VasEBoot-core/kern/arm64/efi/init.c index 6224999ec..7d24a4db5 100644 --- a/VasEBoot-core/kern/arm64/efi/init.c +++ b/VasEBoot-core/kern/arm64/efi/init.c @@ -1,36 +1,36 @@ /* init.c - initialize an arm-based EFI system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -static grub_uint64_t timer_frequency_in_khz; +static VasEBoot_uint64_t timer_frequency_in_khz; -static grub_uint64_t -grub_efi_get_time_ms (void) +static VasEBoot_uint64_t +VasEBoot_efi_get_time_ms (void) { - grub_uint64_t tmr; + VasEBoot_uint64_t tmr; asm volatile("mrs %0, cntvct_el0" : "=r" (tmr)); return tmr / timer_frequency_in_khz; @@ -38,23 +38,23 @@ grub_efi_get_time_ms (void) void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_uint64_t timer_frequency; + VasEBoot_uint64_t timer_frequency; - grub_efi_init (); + VasEBoot_efi_init (); asm volatile("mrs %0, cntfrq_el0" : "=r" (timer_frequency)); timer_frequency_in_khz = timer_frequency / 1000; - grub_install_get_time_ms (grub_efi_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_efi_get_time_ms); } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (!(flags & GRUB_LOADER_FLAG_NORETURN)) + if (!(flags & VasEBoot_LOADER_FLAG_NORETURN)) return; - grub_efi_fini (); + VasEBoot_efi_fini (); } diff --git a/VasEBoot-core/kern/arm64/efi/startup.S b/VasEBoot-core/kern/arm64/efi/startup.S index 666a7ee3c..8bc51a496 100644 --- a/VasEBoot-core/kern/arm64/efi/startup.S +++ b/VasEBoot-core/kern/arm64/efi/startup.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "startup.S" .text @@ -28,12 +28,12 @@ FUNCTION(_start) str x0, [x2] ldr x2, efi_system_table_val str x1, [x2] - ldr x2, grub_main_val + ldr x2, VasEBoot_main_val br x2 -grub_main_val: - .quad EXT_C(grub_main) +VasEBoot_main_val: + .quad EXT_C(VasEBoot_main) efi_system_table_val: - .quad EXT_C(grub_efi_system_table) + .quad EXT_C(VasEBoot_efi_system_table) efi_image_handle_val: - .quad EXT_C(grub_efi_image_handle) + .quad EXT_C(VasEBoot_efi_image_handle) diff --git a/VasEBoot-core/kern/command.c b/VasEBoot-core/kern/command.c index acd721879..8f09c8191 100644 --- a/VasEBoot-core/kern/command.c +++ b/VasEBoot-core/kern/command.c @@ -1,40 +1,40 @@ /* command.c - support basic command */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -grub_command_t grub_command_list; +VasEBoot_command_t VasEBoot_command_list; -grub_command_t -grub_register_command_prio (const char *name, - grub_command_func_t func, +VasEBoot_command_t +VasEBoot_register_command_prio (const char *name, + VasEBoot_command_func_t func, const char *summary, const char *description, int prio) { - grub_command_t cmd; + VasEBoot_command_t cmd; int inactive = 0; - grub_command_t *p, q; + VasEBoot_command_t *p, q; - cmd = (grub_command_t) grub_zalloc (sizeof (*cmd)); + cmd = (VasEBoot_command_t) VasEBoot_zalloc (sizeof (*cmd)); if (! cmd) return 0; @@ -46,19 +46,19 @@ grub_register_command_prio (const char *name, cmd->flags = 0; cmd->prio = prio; - for (p = &grub_command_list, q = *p; q; p = &(q->next), q = q->next) + for (p = &VasEBoot_command_list, q = *p; q; p = &(q->next), q = q->next) { int r; - r = grub_strcmp (cmd->name, q->name); + r = VasEBoot_strcmp (cmd->name, q->name); if (r < 0) break; if (r > 0) continue; - if (cmd->prio >= (q->prio & GRUB_COMMAND_PRIO_MASK)) + if (cmd->prio >= (q->prio & VasEBoot_COMMAND_PRIO_MASK)) { - q->prio &= ~GRUB_COMMAND_FLAG_ACTIVE; + q->prio &= ~VasEBoot_COMMAND_FLAG_ACTIVE; break; } @@ -72,16 +72,16 @@ grub_register_command_prio (const char *name, cmd->prev = p; if (! inactive) - cmd->prio |= GRUB_COMMAND_FLAG_ACTIVE; + cmd->prio |= VasEBoot_COMMAND_FLAG_ACTIVE; return cmd; } void -grub_unregister_command (grub_command_t cmd) +VasEBoot_unregister_command (VasEBoot_command_t cmd) { - if ((cmd->prio & GRUB_COMMAND_FLAG_ACTIVE) && (cmd->next)) - cmd->next->prio |= GRUB_COMMAND_FLAG_ACTIVE; - grub_list_remove (GRUB_AS_LIST (cmd)); - grub_free (cmd); + if ((cmd->prio & VasEBoot_COMMAND_FLAG_ACTIVE) && (cmd->next)) + cmd->next->prio |= VasEBoot_COMMAND_FLAG_ACTIVE; + VasEBoot_list_remove (VasEBoot_AS_LIST (cmd)); + VasEBoot_free (cmd); } diff --git a/VasEBoot-core/kern/compiler-rt.c b/VasEBoot-core/kern/compiler-rt.c index 5cfcb3907..f9e05aeaf 100644 --- a/VasEBoot-core/kern/compiler-rt.c +++ b/VasEBoot-core/kern/compiler-rt.c @@ -1,112 +1,112 @@ /* compiler-rt.c - compiler helpers. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010-2014 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#ifndef GRUB_EMBED_DECOMPRESSOR -void * GRUB_BUILTIN_ATTR -memcpy (void *dest, const void *src, grub_size_t n) +#ifndef VasEBoot_EMBED_DECOMPRESSOR +void * VasEBoot_BUILTIN_ATTR +memcpy (void *dest, const void *src, VasEBoot_size_t n) { - return grub_memmove (dest, src, n); + return VasEBoot_memmove (dest, src, n); } -void * GRUB_BUILTIN_ATTR -memmove (void *dest, const void *src, grub_size_t n) +void * VasEBoot_BUILTIN_ATTR +memmove (void *dest, const void *src, VasEBoot_size_t n) { - return grub_memmove (dest, src, n); + return VasEBoot_memmove (dest, src, n); } -int GRUB_BUILTIN_ATTR -memcmp (const void *s1, const void *s2, grub_size_t n) +int VasEBoot_BUILTIN_ATTR +memcmp (const void *s1, const void *s2, VasEBoot_size_t n) { - return grub_memcmp (s1, s2, n); + return VasEBoot_memcmp (s1, s2, n); } -void * GRUB_BUILTIN_ATTR -memset (void *s, int c, grub_size_t n) +void * VasEBoot_BUILTIN_ATTR +memset (void *s, int c, VasEBoot_size_t n) { - return grub_memset (s, c, n); + return VasEBoot_memset (s, c, n); } #ifdef __APPLE__ -void GRUB_BUILTIN_ATTR -__bzero (void *s, grub_size_t n) +void VasEBoot_BUILTIN_ATTR +__bzero (void *s, VasEBoot_size_t n) { - grub_memset (s, 0, n); + VasEBoot_memset (s, 0, n); } #endif -#if GRUB_DIVISION_IN_SOFTWARE +#if VasEBoot_DIVISION_IN_SOFTWARE -grub_uint32_t -__udivsi3 (grub_uint32_t a, grub_uint32_t b) +VasEBoot_uint32_t +__udivsi3 (VasEBoot_uint32_t a, VasEBoot_uint32_t b) { - return grub_divmod64 (a, b, 0); + return VasEBoot_divmod64 (a, b, 0); } -grub_int32_t -__divsi3 (grub_int32_t a, grub_int32_t b) +VasEBoot_int32_t +__divsi3 (VasEBoot_int32_t a, VasEBoot_int32_t b) { - return grub_divmod64s (a, b, 0); + return VasEBoot_divmod64s (a, b, 0); } -grub_uint32_t -__umodsi3 (grub_uint32_t a, grub_uint32_t b) +VasEBoot_uint32_t +__umodsi3 (VasEBoot_uint32_t a, VasEBoot_uint32_t b) { - grub_uint64_t ret; - grub_divmod64 (a, b, &ret); + VasEBoot_uint64_t ret; + VasEBoot_divmod64 (a, b, &ret); return ret; } -grub_int32_t -__modsi3 (grub_int32_t a, grub_int32_t b) +VasEBoot_int32_t +__modsi3 (VasEBoot_int32_t a, VasEBoot_int32_t b) { - grub_int64_t ret; - grub_divmod64s (a, b, &ret); + VasEBoot_int64_t ret; + VasEBoot_divmod64s (a, b, &ret); return ret; } -grub_uint64_t -__udivdi3 (grub_uint64_t a, grub_uint64_t b) +VasEBoot_uint64_t +__udivdi3 (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { - return grub_divmod64 (a, b, 0); + return VasEBoot_divmod64 (a, b, 0); } -grub_uint64_t -__umoddi3 (grub_uint64_t a, grub_uint64_t b) +VasEBoot_uint64_t +__umoddi3 (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { - grub_uint64_t ret; - grub_divmod64 (a, b, &ret); + VasEBoot_uint64_t ret; + VasEBoot_divmod64 (a, b, &ret); return ret; } -grub_int64_t -__divdi3 (grub_int64_t a, grub_int64_t b) +VasEBoot_int64_t +__divdi3 (VasEBoot_int64_t a, VasEBoot_int64_t b) { - return grub_divmod64s (a, b, 0); + return VasEBoot_divmod64s (a, b, 0); } -grub_int64_t -__moddi3 (grub_int64_t a, grub_int64_t b) +VasEBoot_int64_t +__moddi3 (VasEBoot_int64_t a, VasEBoot_int64_t b) { - grub_int64_t ret; - grub_divmod64s (a, b, &ret); + VasEBoot_int64_t ret; + VasEBoot_divmod64s (a, b, &ret); return ret; } @@ -117,7 +117,7 @@ __moddi3 (grub_int64_t a, grub_int64_t b) #ifdef NEED_CTZDI2 unsigned -__ctzdi2 (grub_uint64_t x) +__ctzdi2 (VasEBoot_uint64_t x) { unsigned ret = 0; if (!x) @@ -158,7 +158,7 @@ __ctzdi2 (grub_uint64_t x) #ifdef NEED_CTZSI2 unsigned -__ctzsi2 (grub_uint32_t x) +__ctzsi2 (VasEBoot_uint32_t x) { unsigned ret = 0; if (!x) @@ -195,12 +195,12 @@ __ctzsi2 (grub_uint32_t x) #endif -#if defined (__clang__) && !defined(GRUB_EMBED_DECOMPRESSOR) +#if defined (__clang__) && !defined(VasEBoot_EMBED_DECOMPRESSOR) /* clang emits references to abort(). */ void __attribute__ ((noreturn)) abort (void) { - grub_fatal ("compiler abort"); + VasEBoot_fatal ("compiler abort"); } #endif @@ -224,15 +224,15 @@ void __chkstk_ms (void) union component64 { - grub_uint64_t full; + VasEBoot_uint64_t full; struct { -#ifdef GRUB_CPU_WORDS_BIGENDIAN - grub_uint32_t high; - grub_uint32_t low; +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_uint32_t high; + VasEBoot_uint32_t low; #else - grub_uint32_t low; - grub_uint32_t high; + VasEBoot_uint32_t low; + VasEBoot_uint32_t high; #endif }; }; @@ -240,8 +240,8 @@ union component64 #if defined (__powerpc__) || defined (__arm__) || defined(__mips__) /* Based on libgcc2.c from gcc suite. */ -grub_uint64_t -__lshrdi3 (grub_uint64_t u, int b) +VasEBoot_uint64_t +__lshrdi3 (VasEBoot_uint64_t u, int b) { if (b == 0) return u; @@ -253,22 +253,22 @@ __lshrdi3 (grub_uint64_t u, int b) if (bm <= 0) { w.high = 0; - w.low = (grub_uint32_t) uu.high >> -bm; + w.low = (VasEBoot_uint32_t) uu.high >> -bm; } else { - const grub_uint32_t carries = (grub_uint32_t) uu.high << bm; + const VasEBoot_uint32_t carries = (VasEBoot_uint32_t) uu.high << bm; - w.high = (grub_uint32_t) uu.high >> b; - w.low = ((grub_uint32_t) uu.low >> b) | carries; + w.high = (VasEBoot_uint32_t) uu.high >> b; + w.low = ((VasEBoot_uint32_t) uu.low >> b) | carries; } return w.full; } /* Based on libgcc2.c from gcc suite. */ -grub_uint64_t -__ashrdi3 (grub_uint64_t u, int b) +VasEBoot_uint64_t +__ashrdi3 (VasEBoot_uint64_t u, int b) { if (b == 0) return u; @@ -280,23 +280,23 @@ __ashrdi3 (grub_uint64_t u, int b) if (bm <= 0) { /* w.high = 1..1 or 0..0 */ - w.high = ((grub_int32_t) uu.high) >> (32 - 1); - w.low = ((grub_int32_t) uu.high) >> -bm; + w.high = ((VasEBoot_int32_t) uu.high) >> (32 - 1); + w.low = ((VasEBoot_int32_t) uu.high) >> -bm; } else { - const grub_uint32_t carries = ((grub_uint32_t) uu.high) << bm; + const VasEBoot_uint32_t carries = ((VasEBoot_uint32_t) uu.high) << bm; - w.high = ((grub_int32_t) uu.high) >> b; - w.low = ((grub_uint32_t) uu.low >> b) | carries; + w.high = ((VasEBoot_int32_t) uu.high) >> b; + w.low = ((VasEBoot_uint32_t) uu.low >> b) | carries; } return w.full; } /* Based on libgcc2.c from gcc suite. */ -grub_uint64_t -__ashldi3 (grub_uint64_t u, int b) +VasEBoot_uint64_t +__ashldi3 (VasEBoot_uint64_t u, int b) { if (b == 0) return u; @@ -308,14 +308,14 @@ __ashldi3 (grub_uint64_t u, int b) if (bm <= 0) { w.low = 0; - w.high = (grub_uint32_t) uu.low << -bm; + w.high = (VasEBoot_uint32_t) uu.low << -bm; } else { - const grub_uint32_t carries = (grub_uint32_t) uu.low >> bm; + const VasEBoot_uint32_t carries = (VasEBoot_uint32_t) uu.low >> bm; - w.low = (grub_uint32_t) uu.low << b; - w.high = ((grub_uint32_t) uu.high << b) | carries; + w.low = (VasEBoot_uint32_t) uu.low << b; + w.high = ((VasEBoot_uint32_t) uu.high << b) | carries; } return w.full; @@ -323,7 +323,7 @@ __ashldi3 (grub_uint64_t u, int b) /* Based on libgcc2.c from gcc suite. */ int -__ucmpdi2 (grub_uint64_t a, grub_uint64_t b) +__ucmpdi2 (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { union component64 ac, bc; ac.full = a; @@ -346,8 +346,8 @@ __ucmpdi2 (grub_uint64_t a, grub_uint64_t b) #if defined (__powerpc__) || defined(__mips__) || defined(__sparc__) || defined(__arm__) /* Based on libgcc2.c from gcc suite. */ -grub_uint32_t -__bswapsi2 (grub_uint32_t u) +VasEBoot_uint32_t +__bswapsi2 (VasEBoot_uint32_t u) { return ((((u) & 0xff000000) >> 24) | (((u) & 0x00ff0000) >> 8) @@ -356,8 +356,8 @@ __bswapsi2 (grub_uint32_t u) } /* Based on libgcc2.c from gcc suite. */ -grub_uint64_t -__bswapdi2 (grub_uint64_t u) +VasEBoot_uint64_t +__bswapdi2 (VasEBoot_uint64_t u) { return ((((u) & 0xff00000000000000ull) >> 56) | (((u) & 0x00ff000000000000ull) >> 40) @@ -373,47 +373,47 @@ __bswapdi2 (grub_uint64_t u) #endif #ifdef __arm__ -grub_uint32_t -__aeabi_uidiv (grub_uint32_t a, grub_uint32_t b) +VasEBoot_uint32_t +__aeabi_uidiv (VasEBoot_uint32_t a, VasEBoot_uint32_t b) __attribute__ ((alias ("__udivsi3"))); -grub_int32_t -__aeabi_idiv (grub_int32_t a, grub_int32_t b) +VasEBoot_int32_t +__aeabi_idiv (VasEBoot_int32_t a, VasEBoot_int32_t b) __attribute__ ((alias ("__divsi3"))); -void *__aeabi_memcpy (void *dest, const void *src, grub_size_t n) - __attribute__ ((alias ("grub_memcpy"))); -void *__aeabi_memcpy4 (void *dest, const void *src, grub_size_t n) - __attribute__ ((alias ("grub_memcpy"))); -void *__aeabi_memcpy8 (void *dest, const void *src, grub_size_t n) - __attribute__ ((alias ("grub_memcpy"))); -void *__aeabi_memset (void *s, int c, grub_size_t n) +void *__aeabi_memcpy (void *dest, const void *src, VasEBoot_size_t n) + __attribute__ ((alias ("VasEBoot_memcpy"))); +void *__aeabi_memcpy4 (void *dest, const void *src, VasEBoot_size_t n) + __attribute__ ((alias ("VasEBoot_memcpy"))); +void *__aeabi_memcpy8 (void *dest, const void *src, VasEBoot_size_t n) + __attribute__ ((alias ("VasEBoot_memcpy"))); +void *__aeabi_memset (void *s, int c, VasEBoot_size_t n) __attribute__ ((alias ("memset"))); void -__aeabi_memclr (void *s, grub_size_t n) +__aeabi_memclr (void *s, VasEBoot_size_t n) { - grub_memset (s, 0, n); + VasEBoot_memset (s, 0, n); } -void __aeabi_memclr4 (void *s, grub_size_t n) +void __aeabi_memclr4 (void *s, VasEBoot_size_t n) __attribute__ ((alias ("__aeabi_memclr"))); -void __aeabi_memclr8 (void *s, grub_size_t n) +void __aeabi_memclr8 (void *s, VasEBoot_size_t n) __attribute__ ((alias ("__aeabi_memclr"))); int -__aeabi_ulcmp (grub_uint64_t a, grub_uint64_t b) +__aeabi_ulcmp (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { return __ucmpdi2 (a, b) - 1; } -grub_uint64_t -__aeabi_lasr (grub_uint64_t u, int b) +VasEBoot_uint64_t +__aeabi_lasr (VasEBoot_uint64_t u, int b) __attribute__ ((alias ("__ashrdi3"))); -grub_uint64_t -__aeabi_llsr (grub_uint64_t u, int b) +VasEBoot_uint64_t +__aeabi_llsr (VasEBoot_uint64_t u, int b) __attribute__ ((alias ("__lshrdi3"))); -grub_uint64_t -__aeabi_llsl (grub_uint64_t u, int b) +VasEBoot_uint64_t +__aeabi_llsl (VasEBoot_uint64_t u, int b) __attribute__ ((alias ("__ashldi3"))); #endif diff --git a/VasEBoot-core/kern/corecmd.c b/VasEBoot-core/kern/corecmd.c index d9412a316..6027b6f3c 100644 --- a/VasEBoot-core/kern/corecmd.c +++ b/VasEBoot-core/kern/corecmd.c @@ -1,36 +1,36 @@ /* corecmd.c - critical commands which are registered in kernel */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* set ENVVAR=VALUE */ -static grub_err_t -grub_core_cmd_set (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_core_cmd_set (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { char *var; @@ -38,102 +38,102 @@ grub_core_cmd_set (struct grub_command *cmd __attribute__ ((unused)), if (argc < 1) { - struct grub_env_var *env; + struct VasEBoot_env_var *env; FOR_SORTED_ENV (env) - grub_printf ("%s=%s\n", env->name, grub_env_get (env->name)); + VasEBoot_printf ("%s=%s\n", env->name, VasEBoot_env_get (env->name)); return 0; } var = argv[0]; - val = grub_strchr (var, '='); + val = VasEBoot_strchr (var, '='); if (! val) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not an assignment"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not an assignment"); val[0] = 0; - grub_env_set (var, val + 1); + VasEBoot_env_set (var, val + 1); val[0] = '='; return 0; } -static grub_err_t -grub_core_cmd_unset (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_core_cmd_unset (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - grub_env_unset (argv[0]); + VasEBoot_env_unset (argv[0]); return 0; } /* insmod MODULE */ -static grub_err_t -grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_core_cmd_insmod (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_dl_t mod; + VasEBoot_dl_t mod; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); if (argv[0][0] == '/' || argv[0][0] == '(' || argv[0][0] == '+') - mod = grub_dl_load_file (argv[0]); + mod = VasEBoot_dl_load_file (argv[0]); else - mod = grub_dl_load (argv[0]); + mod = VasEBoot_dl_load (argv[0]); if (mod) - grub_dl_ref (mod); + VasEBoot_dl_ref (mod); return 0; } static int -grub_mini_print_devices (const char *name, void *data __attribute__ ((unused))) +VasEBoot_mini_print_devices (const char *name, void *data __attribute__ ((unused))) { - grub_printf ("(%s) ", name); + VasEBoot_printf ("(%s) ", name); return 0; } static int -grub_mini_print_files (const char *filename, - const struct grub_dirhook_info *info, +VasEBoot_mini_print_files (const char *filename, + const struct VasEBoot_dirhook_info *info, void *data __attribute__ ((unused))) { - grub_printf ("%s%s ", filename, info->dir ? "/" : ""); + VasEBoot_printf ("%s%s ", filename, info->dir ? "/" : ""); return 0; } /* ls [ARG] */ -static grub_err_t -grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_core_cmd_ls (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { if (argc < 1) { - grub_device_iterate (grub_mini_print_devices, NULL); - grub_xputs ("\n"); - grub_refresh (); + VasEBoot_device_iterate (VasEBoot_mini_print_devices, NULL); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); } else { char *device_name; - grub_device_t dev = 0; - grub_fs_t fs; + VasEBoot_device_t dev = 0; + VasEBoot_fs_t fs; char *path; - device_name = grub_file_get_device_name (argv[0]); - if (grub_errno) + device_name = VasEBoot_file_get_device_name (argv[0]); + if (VasEBoot_errno) goto fail; - dev = grub_device_open (device_name); + dev = VasEBoot_device_open (device_name); if (! dev) goto fail; - fs = grub_fs_probe (dev); - path = grub_strchr (argv[0], ')'); + fs = VasEBoot_fs_probe (dev); + path = VasEBoot_strchr (argv[0], ')'); if (! path) path = argv[0]; else @@ -141,49 +141,49 @@ grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)), if (! *path && ! device_name) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "invalid argument"); goto fail; } if (! *path) { - if (grub_errno == GRUB_ERR_UNKNOWN_FS) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_UNKNOWN_FS) + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_printf ("(%s): Filesystem is %s.\n", + VasEBoot_printf ("(%s): Filesystem is %s.\n", device_name, fs ? fs->name : "unknown"); } else if (fs) { - (fs->dir) (dev, path, grub_mini_print_files, NULL); - grub_xputs ("\n"); - grub_refresh (); + (fs->dir) (dev, path, VasEBoot_mini_print_files, NULL); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); } fail: if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - grub_free (device_name); + VasEBoot_free (device_name); } - return grub_errno; + return VasEBoot_errno; } void -grub_register_core_commands (void) +VasEBoot_register_core_commands (void) { - grub_command_t cmd; - cmd = grub_register_command ("set", grub_core_cmd_set, + VasEBoot_command_t cmd; + cmd = VasEBoot_register_command ("set", VasEBoot_core_cmd_set, N_("[ENVVAR=VALUE]"), N_("Set an environment variable.")); if (cmd) - cmd->flags |= GRUB_COMMAND_FLAG_EXTRACTOR; - grub_register_command ("unset", grub_core_cmd_unset, + cmd->flags |= VasEBoot_COMMAND_FLAG_EXTRACTOR; + VasEBoot_register_command ("unset", VasEBoot_core_cmd_unset, N_("ENVVAR"), N_("Remove an environment variable.")); - grub_register_command ("ls", grub_core_cmd_ls, + VasEBoot_register_command ("ls", VasEBoot_core_cmd_ls, N_("[ARG]"), N_("List devices or files.")); - grub_register_command ("insmod", grub_core_cmd_insmod, + VasEBoot_register_command ("insmod", VasEBoot_core_cmd_insmod, N_("MODULE"), N_("Insert a module.")); } diff --git a/VasEBoot-core/kern/device.c b/VasEBoot-core/kern/device.c index 73b8ecc0c..4a3a61d68 100644 --- a/VasEBoot-core/kern/device.c +++ b/VasEBoot-core/kern/device.c @@ -1,88 +1,88 @@ /* device.c - device manager */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_net_t (*grub_net_open) (const char *name) = NULL; +VasEBoot_net_t (*VasEBoot_net_open) (const char *name) = NULL; -grub_device_t -grub_device_open (const char *name) +VasEBoot_device_t +VasEBoot_device_open (const char *name) { - grub_device_t dev = 0; + VasEBoot_device_t dev = 0; if (! name) { - name = grub_env_get ("root"); + name = VasEBoot_env_get ("root"); if (name == NULL || *name == '\0') { - grub_error (GRUB_ERR_BAD_DEVICE, N_("variable `%s' isn't set"), "root"); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("variable `%s' isn't set"), "root"); goto fail; } } - dev = grub_malloc (sizeof (*dev)); + dev = VasEBoot_malloc (sizeof (*dev)); if (! dev) goto fail; dev->net = NULL; /* Try to open a disk. */ - dev->disk = grub_disk_open (name); + dev->disk = VasEBoot_disk_open (name); if (dev->disk) return dev; - if (grub_net_open && grub_errno == GRUB_ERR_UNKNOWN_DEVICE) + if (VasEBoot_net_open && VasEBoot_errno == VasEBoot_ERR_UNKNOWN_DEVICE) { - grub_errno = GRUB_ERR_NONE; - dev->net = grub_net_open (name); + VasEBoot_errno = VasEBoot_ERR_NONE; + dev->net = VasEBoot_net_open (name); } if (dev->net) return dev; fail: - grub_free (dev); + VasEBoot_free (dev); return 0; } -grub_err_t -grub_device_close (grub_device_t device) +VasEBoot_err_t +VasEBoot_device_close (VasEBoot_device_t device) { if (device->disk) - grub_disk_close (device->disk); + VasEBoot_disk_close (device->disk); if (device->net) { - grub_free (device->net->server); - grub_free (device->net); + VasEBoot_free (device->net->server); + VasEBoot_free (device->net); } - grub_free (device); + VasEBoot_free (device); - return grub_errno; + return VasEBoot_errno; } struct part_ent @@ -91,40 +91,40 @@ struct part_ent char *name; }; -/* Context for grub_device_iterate. */ -struct grub_device_iterate_ctx +/* Context for VasEBoot_device_iterate. */ +struct VasEBoot_device_iterate_ctx { - grub_device_iterate_hook_t hook; + VasEBoot_device_iterate_hook_t hook; void *hook_data; struct part_ent *ents; }; -/* Helper for grub_device_iterate. */ +/* Helper for VasEBoot_device_iterate. */ static int -iterate_partition (grub_disk_t disk, const grub_partition_t partition, +iterate_partition (VasEBoot_disk_t disk, const VasEBoot_partition_t partition, void *data) { - struct grub_device_iterate_ctx *ctx = data; + struct VasEBoot_device_iterate_ctx *ctx = data; struct part_ent *p; char *part_name; - p = grub_malloc (sizeof (*p)); + p = VasEBoot_malloc (sizeof (*p)); if (!p) { return 1; } - part_name = grub_partition_get_name (partition); + part_name = VasEBoot_partition_get_name (partition); if (!part_name) { - grub_free (p); + VasEBoot_free (p); return 1; } - p->name = grub_xasprintf ("%s,%s", disk->name, part_name); - grub_free (part_name); + p->name = VasEBoot_xasprintf ("%s,%s", disk->name, part_name); + VasEBoot_free (part_name); if (!p->name) { - grub_free (p); + VasEBoot_free (p); return 1; } @@ -134,20 +134,20 @@ iterate_partition (grub_disk_t disk, const grub_partition_t partition, return 0; } -/* Helper for grub_device_iterate. */ +/* Helper for VasEBoot_device_iterate. */ static int iterate_disk (const char *disk_name, void *data) { - struct grub_device_iterate_ctx *ctx = data; - grub_device_t dev; + struct VasEBoot_device_iterate_ctx *ctx = data; + VasEBoot_device_t dev; if (ctx->hook (disk_name, ctx->hook_data)) return 1; - dev = grub_device_open (disk_name); + dev = VasEBoot_device_open (disk_name); if (! dev) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } @@ -157,10 +157,10 @@ iterate_disk (const char *disk_name, void *data) int ret = 0; ctx->ents = NULL; - (void) grub_partition_iterate (dev->disk, iterate_partition, ctx); - grub_device_close (dev); + (void) VasEBoot_partition_iterate (dev->disk, iterate_partition, ctx); + VasEBoot_device_close (dev); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; p = ctx->ents; while (p != NULL) @@ -169,23 +169,23 @@ iterate_disk (const char *disk_name, void *data) if (!ret) ret = ctx->hook (p->name, ctx->hook_data); - grub_free (p->name); - grub_free (p); + VasEBoot_free (p->name); + VasEBoot_free (p); p = next; } return ret; } - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } int -grub_device_iterate (grub_device_iterate_hook_t hook, void *hook_data) +VasEBoot_device_iterate (VasEBoot_device_iterate_hook_t hook, void *hook_data) { - struct grub_device_iterate_ctx ctx = { hook, hook_data, NULL }; + struct VasEBoot_device_iterate_ctx ctx = { hook, hook_data, NULL }; /* Only disk devices are supported at the moment. */ - return grub_disk_dev_iterate (iterate_disk, &ctx); + return VasEBoot_disk_dev_iterate (iterate_disk, &ctx); } diff --git a/VasEBoot-core/kern/disk.c b/VasEBoot-core/kern/disk.c index 789f8c052..bba76622d 100644 --- a/VasEBoot-core/kern/disk.c +++ b/VasEBoot-core/kern/disk.c @@ -1,164 +1,164 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#define GRUB_CACHE_TIMEOUT 2 +#define VasEBoot_CACHE_TIMEOUT 2 /* The last time the disk was used. */ -static grub_uint64_t grub_last_time = 0; +static VasEBoot_uint64_t VasEBoot_last_time = 0; -struct grub_disk_cache grub_disk_cache_table[GRUB_DISK_CACHE_NUM]; +struct VasEBoot_disk_cache VasEBoot_disk_cache_table[VasEBoot_DISK_CACHE_NUM]; -void (*grub_disk_firmware_fini) (void); -int grub_disk_firmware_is_tainted; +void (*VasEBoot_disk_firmware_fini) (void); +int VasEBoot_disk_firmware_is_tainted; #if DISK_CACHE_STATS -static unsigned long grub_disk_cache_hits; -static unsigned long grub_disk_cache_misses; +static unsigned long VasEBoot_disk_cache_hits; +static unsigned long VasEBoot_disk_cache_misses; void -grub_disk_cache_get_performance (unsigned long *hits, unsigned long *misses) +VasEBoot_disk_cache_get_performance (unsigned long *hits, unsigned long *misses) { - *hits = grub_disk_cache_hits; - *misses = grub_disk_cache_misses; + *hits = VasEBoot_disk_cache_hits; + *misses = VasEBoot_disk_cache_misses; } #endif -grub_err_t (*grub_disk_write_weak) (grub_disk_t disk, - grub_disk_addr_t sector, - grub_off_t offset, - grub_size_t size, +VasEBoot_err_t (*VasEBoot_disk_write_weak) (VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, + VasEBoot_size_t size, const void *buf); #include "disk_common.c" void -grub_disk_cache_invalidate_all (void) +VasEBoot_disk_cache_invalidate_all (void) { unsigned i; - for (i = 0; i < GRUB_DISK_CACHE_NUM; i++) + for (i = 0; i < VasEBoot_DISK_CACHE_NUM; i++) { - struct grub_disk_cache *cache = grub_disk_cache_table + i; + struct VasEBoot_disk_cache *cache = VasEBoot_disk_cache_table + i; if (cache->data && ! cache->lock) { - grub_free (cache->data); + VasEBoot_free (cache->data); cache->data = 0; } } } static char * -grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id, - grub_disk_addr_t sector) +VasEBoot_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id, + VasEBoot_disk_addr_t sector) { - struct grub_disk_cache *cache; + struct VasEBoot_disk_cache *cache; unsigned cache_index; - cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + cache_index; + cache_index = VasEBoot_disk_cache_get_index (dev_id, disk_id, sector); + cache = VasEBoot_disk_cache_table + cache_index; if (cache->dev_id == dev_id && cache->disk_id == disk_id && cache->sector == sector) { cache->lock = 1; #if DISK_CACHE_STATS - grub_disk_cache_hits++; + VasEBoot_disk_cache_hits++; #endif return cache->data; } #if DISK_CACHE_STATS - grub_disk_cache_misses++; + VasEBoot_disk_cache_misses++; #endif return 0; } static void -grub_disk_cache_unlock (unsigned long dev_id, unsigned long disk_id, - grub_disk_addr_t sector) +VasEBoot_disk_cache_unlock (unsigned long dev_id, unsigned long disk_id, + VasEBoot_disk_addr_t sector) { - struct grub_disk_cache *cache; + struct VasEBoot_disk_cache *cache; unsigned cache_index; - cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + cache_index; + cache_index = VasEBoot_disk_cache_get_index (dev_id, disk_id, sector); + cache = VasEBoot_disk_cache_table + cache_index; if (cache->dev_id == dev_id && cache->disk_id == disk_id && cache->sector == sector) cache->lock = 0; } -static grub_err_t -grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id, - grub_disk_addr_t sector, const char *data) +static VasEBoot_err_t +VasEBoot_disk_cache_store (unsigned long dev_id, unsigned long disk_id, + VasEBoot_disk_addr_t sector, const char *data) { unsigned cache_index; - struct grub_disk_cache *cache; + struct VasEBoot_disk_cache *cache; - cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + cache_index; + cache_index = VasEBoot_disk_cache_get_index (dev_id, disk_id, sector); + cache = VasEBoot_disk_cache_table + cache_index; cache->lock = 1; - grub_free (cache->data); + VasEBoot_free (cache->data); cache->data = 0; cache->lock = 0; - cache->data = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); + cache->data = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE << VasEBoot_DISK_CACHE_BITS); if (! cache->data) - return grub_errno; + return VasEBoot_errno; - grub_memcpy (cache->data, data, - GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); + VasEBoot_memcpy (cache->data, data, + VasEBoot_DISK_SECTOR_SIZE << VasEBoot_DISK_CACHE_BITS); cache->dev_id = dev_id; cache->disk_id = disk_id; cache->sector = sector; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_disk_dev_t grub_disk_dev_list; +VasEBoot_disk_dev_t VasEBoot_disk_dev_list; void -grub_disk_dev_register (grub_disk_dev_t dev) +VasEBoot_disk_dev_register (VasEBoot_disk_dev_t dev) { - dev->next = grub_disk_dev_list; - grub_disk_dev_list = dev; + dev->next = VasEBoot_disk_dev_list; + VasEBoot_disk_dev_list = dev; } void -grub_disk_dev_unregister (grub_disk_dev_t dev) +VasEBoot_disk_dev_unregister (VasEBoot_disk_dev_t dev) { - grub_disk_dev_t *p, q; + VasEBoot_disk_dev_t *p, q; - for (p = &grub_disk_dev_list, q = *p; q; p = &(q->next), q = q->next) + for (p = &VasEBoot_disk_dev_list, q = *p; q; p = &(q->next), q = q->next) if (q == dev) { *p = q->next; @@ -184,63 +184,63 @@ find_part_sep (const char *name) return NULL; } -grub_disk_t -grub_disk_open (const char *name) +VasEBoot_disk_t +VasEBoot_disk_open (const char *name) { const char *p; - grub_disk_t disk; - grub_disk_dev_t dev; + VasEBoot_disk_t disk; + VasEBoot_disk_dev_t dev; char *raw = (char *) name; - grub_uint64_t current_time; + VasEBoot_uint64_t current_time; - grub_dprintf ("disk", "Opening `%s'...\n", name); + VasEBoot_dprintf ("disk", "Opening `%s'...\n", name); - disk = (grub_disk_t) grub_zalloc (sizeof (*disk)); + disk = (VasEBoot_disk_t) VasEBoot_zalloc (sizeof (*disk)); if (! disk) return 0; - disk->log_sector_size = GRUB_DISK_SECTOR_BITS; + disk->log_sector_size = VasEBoot_DISK_SECTOR_BITS; /* Default 1MiB of maximum agglomerate. */ - disk->max_agglomerate = 1048576 >> (GRUB_DISK_SECTOR_BITS - + GRUB_DISK_CACHE_BITS); + disk->max_agglomerate = 1048576 >> (VasEBoot_DISK_SECTOR_BITS + + VasEBoot_DISK_CACHE_BITS); p = find_part_sep (name); if (p) { - grub_size_t len = p - name; + VasEBoot_size_t len = p - name; - raw = grub_malloc (len + 1); + raw = VasEBoot_malloc (len + 1); if (! raw) goto fail; - grub_memcpy (raw, name, len); + VasEBoot_memcpy (raw, name, len); raw[len] = '\0'; - disk->name = grub_strdup (raw); + disk->name = VasEBoot_strdup (raw); } else - disk->name = grub_strdup (name); + disk->name = VasEBoot_strdup (name); if (! disk->name) goto fail; - for (dev = grub_disk_dev_list; dev; dev = dev->next) + for (dev = VasEBoot_disk_dev_list; dev; dev = dev->next) { - if ((dev->open) (raw, disk) == GRUB_ERR_NONE) + if ((dev->open) (raw, disk) == VasEBoot_ERR_NONE) break; - else if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE) - grub_errno = GRUB_ERR_NONE; + else if (VasEBoot_errno == VasEBoot_ERR_UNKNOWN_DEVICE) + VasEBoot_errno = VasEBoot_ERR_NONE; else goto fail; } if (! dev) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), name); goto fail; } - if (disk->log_sector_size > GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS - || disk->log_sector_size < GRUB_DISK_SECTOR_BITS) + if (disk->log_sector_size > VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS + || disk->log_sector_size < VasEBoot_DISK_SECTOR_BITS) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "sector sizes of %d bytes aren't supported yet", (1 << disk->log_sector_size)); goto fail; @@ -250,38 +250,38 @@ grub_disk_open (const char *name) if (p) { - disk->partition = grub_partition_probe (disk, p + 1); + disk->partition = VasEBoot_partition_probe (disk, p + 1); if (! disk->partition) { /* TRANSLATORS: It means that the specified partition e.g. hd0,msdos1=/dev/sda1 doesn't exist. */ - grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("no such partition")); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("no such partition")); goto fail; } } /* The cache will be invalidated about 2 seconds after a device was closed. */ - current_time = grub_get_time_ms (); + current_time = VasEBoot_get_time_ms (); - if (current_time > (grub_last_time - + GRUB_CACHE_TIMEOUT * 1000)) - grub_disk_cache_invalidate_all (); + if (current_time > (VasEBoot_last_time + + VasEBoot_CACHE_TIMEOUT * 1000)) + VasEBoot_disk_cache_invalidate_all (); - grub_last_time = current_time; + VasEBoot_last_time = current_time; fail: if (raw && raw != name) - grub_free (raw); + VasEBoot_free (raw); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_error_push (); - grub_dprintf ("disk", "Opening `%s' failed.\n", name); - grub_error_pop (); + VasEBoot_error_push (); + VasEBoot_dprintf ("disk", "Opening `%s' failed.\n", name); + VasEBoot_error_pop (); - grub_disk_close (disk); + VasEBoot_disk_close (disk); return 0; } @@ -289,256 +289,256 @@ grub_disk_open (const char *name) } void -grub_disk_close (grub_disk_t disk) +VasEBoot_disk_close (VasEBoot_disk_t disk) { - grub_partition_t part; - grub_dprintf ("disk", "Closing `%s'.\n", disk->name); + VasEBoot_partition_t part; + VasEBoot_dprintf ("disk", "Closing `%s'.\n", disk->name); if (disk->dev && disk->dev->close) (disk->dev->close) (disk); /* Reset the timer. */ - grub_last_time = grub_get_time_ms (); + VasEBoot_last_time = VasEBoot_get_time_ms (); while (disk->partition) { part = disk->partition->parent; - grub_free (disk->partition); + VasEBoot_free (disk->partition); disk->partition = part; } - grub_free ((void *) disk->name); - grub_free (disk); + VasEBoot_free ((void *) disk->name); + VasEBoot_free (disk); } /* Small read (less than cache size and not pass across cache unit boundaries). sector is already adjusted and is divisible by cache unit size. */ -static grub_err_t -grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector, - grub_off_t offset, grub_size_t size, void *buf) +static VasEBoot_err_t +VasEBoot_disk_read_small_real (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, VasEBoot_size_t size, void *buf) { char *data; char *tmp_buf; /* Fetch the cache. */ - data = grub_disk_cache_fetch (disk->dev->id, disk->id, sector); + data = VasEBoot_disk_cache_fetch (disk->dev->id, disk->id, sector); if (data) { /* Just copy it! */ - grub_memcpy (buf, data + offset, size); - grub_disk_cache_unlock (disk->dev->id, disk->id, sector); - return GRUB_ERR_NONE; + VasEBoot_memcpy (buf, data + offset, size); + VasEBoot_disk_cache_unlock (disk->dev->id, disk->id, sector); + return VasEBoot_ERR_NONE; } /* Allocate a temporary buffer. */ - tmp_buf = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); + tmp_buf = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE << VasEBoot_DISK_CACHE_BITS); if (! tmp_buf) - return grub_errno; + return VasEBoot_errno; /* Otherwise read data from the disk actually. */ - if (disk->total_sectors == GRUB_DISK_SIZE_UNKNOWN - || sector + GRUB_DISK_CACHE_SIZE - < (disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS))) + if (disk->total_sectors == VasEBoot_DISK_SIZE_UNKNOWN + || sector + VasEBoot_DISK_CACHE_SIZE + < (disk->total_sectors << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS))) { - grub_err_t err; + VasEBoot_err_t err; err = (disk->dev->read) (disk, transform_sector (disk, sector), - 1U << (GRUB_DISK_CACHE_BITS - + GRUB_DISK_SECTOR_BITS + 1U << (VasEBoot_DISK_CACHE_BITS + + VasEBoot_DISK_SECTOR_BITS - disk->log_sector_size), tmp_buf); if (!err) { /* Copy it and store it in the disk cache. */ - grub_memcpy (buf, tmp_buf + offset, size); - grub_disk_cache_store (disk->dev->id, disk->id, + VasEBoot_memcpy (buf, tmp_buf + offset, size); + VasEBoot_disk_cache_store (disk->dev->id, disk->id, sector, tmp_buf); - grub_free (tmp_buf); - return GRUB_ERR_NONE; + VasEBoot_free (tmp_buf); + return VasEBoot_ERR_NONE; } } - grub_free (tmp_buf); - grub_errno = GRUB_ERR_NONE; + VasEBoot_free (tmp_buf); + VasEBoot_errno = VasEBoot_ERR_NONE; { /* Uggh... Failed. Instead, just read necessary data. */ unsigned num; - grub_disk_addr_t aligned_sector; + VasEBoot_disk_addr_t aligned_sector; - sector += (offset >> GRUB_DISK_SECTOR_BITS); - offset &= ((1 << GRUB_DISK_SECTOR_BITS) - 1); + sector += (offset >> VasEBoot_DISK_SECTOR_BITS); + offset &= ((1 << VasEBoot_DISK_SECTOR_BITS) - 1); aligned_sector = (sector & ~((1ULL << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS)) + - VasEBoot_DISK_SECTOR_BITS)) - 1)); - offset += ((sector - aligned_sector) << GRUB_DISK_SECTOR_BITS); + offset += ((sector - aligned_sector) << VasEBoot_DISK_SECTOR_BITS); num = ((size + offset + (1ULL << (disk->log_sector_size)) - 1) >> (disk->log_sector_size)); - tmp_buf = grub_malloc (num << disk->log_sector_size); + tmp_buf = VasEBoot_malloc (num << disk->log_sector_size); if (!tmp_buf) - return grub_errno; + return VasEBoot_errno; if ((disk->dev->read) (disk, transform_sector (disk, aligned_sector), num, tmp_buf)) { - grub_error_push (); - grub_dprintf ("disk", "%s read failed\n", disk->name); - grub_error_pop (); - grub_free (tmp_buf); - return grub_errno; + VasEBoot_error_push (); + VasEBoot_dprintf ("disk", "%s read failed\n", disk->name); + VasEBoot_error_pop (); + VasEBoot_free (tmp_buf); + return VasEBoot_errno; } - grub_memcpy (buf, tmp_buf + offset, size); - grub_free (tmp_buf); - return GRUB_ERR_NONE; + VasEBoot_memcpy (buf, tmp_buf + offset, size); + VasEBoot_free (tmp_buf); + return VasEBoot_ERR_NONE; } } -static grub_err_t -grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector, - grub_off_t offset, grub_size_t size, void *buf) +static VasEBoot_err_t +VasEBoot_disk_read_small (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, VasEBoot_size_t size, void *buf) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_disk_read_small_real (disk, sector, offset, size, buf); + err = VasEBoot_disk_read_small_real (disk, sector, offset, size, buf); if (err) return err; if (disk->read_hook) - (disk->read_hook) (sector + (offset >> GRUB_DISK_SECTOR_BITS), - offset & (GRUB_DISK_SECTOR_SIZE - 1), + (disk->read_hook) (sector + (offset >> VasEBoot_DISK_SECTOR_BITS), + offset & (VasEBoot_DISK_SECTOR_SIZE - 1), size, disk->read_hook_data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Read data from the disk. */ -grub_err_t -grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_off_t offset, grub_size_t size, void *buf) +VasEBoot_err_t +VasEBoot_disk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, VasEBoot_size_t size, void *buf) { /* First of all, check if the region is within the disk. */ - if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE) + if (VasEBoot_disk_adjust_range (disk, §or, &offset, size) != VasEBoot_ERR_NONE) { - grub_error_push (); - grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n", - (unsigned long long) sector, grub_errmsg); - grub_error_pop (); - return grub_errno; + VasEBoot_error_push (); + VasEBoot_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n", + (unsigned long long) sector, VasEBoot_errmsg); + VasEBoot_error_pop (); + return VasEBoot_errno; } /* First read until first cache boundary. */ - if (offset || (sector & (GRUB_DISK_CACHE_SIZE - 1))) + if (offset || (sector & (VasEBoot_DISK_CACHE_SIZE - 1))) { - grub_disk_addr_t start_sector; - grub_size_t pos; - grub_err_t err; - grub_size_t len; + VasEBoot_disk_addr_t start_sector; + VasEBoot_size_t pos; + VasEBoot_err_t err; + VasEBoot_size_t len; - start_sector = sector & ~((grub_disk_addr_t) GRUB_DISK_CACHE_SIZE - 1); - pos = (sector - start_sector) << GRUB_DISK_SECTOR_BITS; - len = ((GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS) + start_sector = sector & ~((VasEBoot_disk_addr_t) VasEBoot_DISK_CACHE_SIZE - 1); + pos = (sector - start_sector) << VasEBoot_DISK_SECTOR_BITS; + len = ((VasEBoot_DISK_SECTOR_SIZE << VasEBoot_DISK_CACHE_BITS) - pos - offset); if (len > size) len = size; - err = grub_disk_read_small (disk, start_sector, + err = VasEBoot_disk_read_small (disk, start_sector, offset + pos, len, buf); if (err) return err; buf = (char *) buf + len; size -= len; offset += len; - sector += (offset >> GRUB_DISK_SECTOR_BITS); - offset &= ((1 << GRUB_DISK_SECTOR_BITS) - 1); + sector += (offset >> VasEBoot_DISK_SECTOR_BITS); + offset &= ((1 << VasEBoot_DISK_SECTOR_BITS) - 1); } /* Until SIZE is zero... */ - while (size >= (GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS)) + while (size >= (VasEBoot_DISK_CACHE_SIZE << VasEBoot_DISK_SECTOR_BITS)) { char *data = NULL; - grub_disk_addr_t agglomerate; - grub_err_t err; + VasEBoot_disk_addr_t agglomerate; + VasEBoot_err_t err; /* agglomerate read until we find a first cached entry. */ for (agglomerate = 0; agglomerate - < (size >> (GRUB_DISK_SECTOR_BITS + GRUB_DISK_CACHE_BITS)) + < (size >> (VasEBoot_DISK_SECTOR_BITS + VasEBoot_DISK_CACHE_BITS)) && agglomerate < disk->max_agglomerate; agglomerate++) { - data = grub_disk_cache_fetch (disk->dev->id, disk->id, + data = VasEBoot_disk_cache_fetch (disk->dev->id, disk->id, sector + (agglomerate - << GRUB_DISK_CACHE_BITS)); + << VasEBoot_DISK_CACHE_BITS)); if (data) break; } if (data) { - grub_memcpy ((char *) buf - + (agglomerate << (GRUB_DISK_CACHE_BITS - + GRUB_DISK_SECTOR_BITS)), - data, GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS); - grub_disk_cache_unlock (disk->dev->id, disk->id, + VasEBoot_memcpy ((char *) buf + + (agglomerate << (VasEBoot_DISK_CACHE_BITS + + VasEBoot_DISK_SECTOR_BITS)), + data, VasEBoot_DISK_CACHE_SIZE << VasEBoot_DISK_SECTOR_BITS); + VasEBoot_disk_cache_unlock (disk->dev->id, disk->id, sector + (agglomerate - << GRUB_DISK_CACHE_BITS)); + << VasEBoot_DISK_CACHE_BITS)); } if (agglomerate) { - grub_disk_addr_t i; + VasEBoot_disk_addr_t i; err = (disk->dev->read) (disk, transform_sector (disk, sector), - agglomerate << (GRUB_DISK_CACHE_BITS - + GRUB_DISK_SECTOR_BITS + agglomerate << (VasEBoot_DISK_CACHE_BITS + + VasEBoot_DISK_SECTOR_BITS - disk->log_sector_size), buf); if (err) return err; for (i = 0; i < agglomerate; i ++) - grub_disk_cache_store (disk->dev->id, disk->id, - sector + (i << GRUB_DISK_CACHE_BITS), + VasEBoot_disk_cache_store (disk->dev->id, disk->id, + sector + (i << VasEBoot_DISK_CACHE_BITS), (char *) buf - + (i << (GRUB_DISK_CACHE_BITS - + GRUB_DISK_SECTOR_BITS))); + + (i << (VasEBoot_DISK_CACHE_BITS + + VasEBoot_DISK_SECTOR_BITS))); if (disk->read_hook) - (disk->read_hook) (sector, 0, agglomerate << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS), + (disk->read_hook) (sector, 0, agglomerate << (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS), disk->read_hook_data); - sector += agglomerate << GRUB_DISK_CACHE_BITS; - size -= agglomerate << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS); + sector += agglomerate << VasEBoot_DISK_CACHE_BITS; + size -= agglomerate << (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS); buf = (char *) buf - + (agglomerate << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS)); + + (agglomerate << (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS)); } if (data) { if (disk->read_hook) - (disk->read_hook) (sector, 0, (GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS), + (disk->read_hook) (sector, 0, (VasEBoot_DISK_CACHE_SIZE << VasEBoot_DISK_SECTOR_BITS), disk->read_hook_data); - sector += GRUB_DISK_CACHE_SIZE; - buf = (char *) buf + (GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS); - size -= (GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS); + sector += VasEBoot_DISK_CACHE_SIZE; + buf = (char *) buf + (VasEBoot_DISK_CACHE_SIZE << VasEBoot_DISK_SECTOR_BITS); + size -= (VasEBoot_DISK_CACHE_SIZE << VasEBoot_DISK_SECTOR_BITS); } } /* And now read the last part. */ if (size) { - grub_err_t err; - err = grub_disk_read_small (disk, sector, 0, size, buf); + VasEBoot_err_t err; + err = VasEBoot_disk_read_small (disk, sector, 0, size, buf); if (err) return err; } - return grub_errno; + return VasEBoot_errno; } -grub_uint64_t -grub_disk_get_size (grub_disk_t disk) +VasEBoot_uint64_t +VasEBoot_disk_get_size (VasEBoot_disk_t disk) { if (disk->partition) - return grub_partition_get_len (disk->partition); - else if (disk->total_sectors != GRUB_DISK_SIZE_UNKNOWN) - return disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + return VasEBoot_partition_get_len (disk->partition); + else if (disk->total_sectors != VasEBoot_DISK_SIZE_UNKNOWN) + return disk->total_sectors << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); else - return GRUB_DISK_SIZE_UNKNOWN; + return VasEBoot_DISK_SIZE_UNKNOWN; } diff --git a/VasEBoot-core/kern/disk_common.c b/VasEBoot-core/kern/disk_common.c index 2ca12b5f8..370b5f025 100644 --- a/VasEBoot-core/kern/disk_common.c +++ b/VasEBoot-core/kern/disk_common.c @@ -2,64 +2,64 @@ - Make sectors disk relative from partition relative. - Normalize offset to be less than the sector size. - Verify that the range is inside the partition. */ -static grub_err_t -grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector, - grub_off_t *offset, grub_size_t size) +static VasEBoot_err_t +VasEBoot_disk_adjust_range (VasEBoot_disk_t disk, VasEBoot_disk_addr_t *sector, + VasEBoot_off_t *offset, VasEBoot_size_t size) { - grub_partition_t part; - grub_disk_addr_t total_sectors; + VasEBoot_partition_t part; + VasEBoot_disk_addr_t total_sectors; - *sector += *offset >> GRUB_DISK_SECTOR_BITS; - *offset &= GRUB_DISK_SECTOR_SIZE - 1; + *sector += *offset >> VasEBoot_DISK_SECTOR_BITS; + *offset &= VasEBoot_DISK_SECTOR_SIZE - 1; for (part = disk->partition; part; part = part->parent) { - grub_disk_addr_t start; - grub_uint64_t len; + VasEBoot_disk_addr_t start; + VasEBoot_uint64_t len; start = part->start; len = part->len; if (*sector >= len - || len - *sector < ((*offset + size + GRUB_DISK_SECTOR_SIZE - 1) - >> GRUB_DISK_SECTOR_BITS)) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + || len - *sector < ((*offset + size + VasEBoot_DISK_SECTOR_SIZE - 1) + >> VasEBoot_DISK_SECTOR_BITS)) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read or write outside of partition")); *sector += start; } /* Transform total_sectors to number of 512B blocks. */ - total_sectors = disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + total_sectors = disk->total_sectors << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); /* Some drivers have problems with disks above reasonable. Treat unknown as 1EiB disk. While on it, clamp the size to 1EiB. - Just one condition is enough since GRUB_DISK_UNKNOWN_SIZE << ls is always + Just one condition is enough since VasEBoot_DISK_UNKNOWN_SIZE << ls is always above 9EiB. */ if (total_sectors > (1ULL << 51)) total_sectors = (1ULL << 51); if ((total_sectors <= *sector - || ((*offset + size + GRUB_DISK_SECTOR_SIZE - 1) - >> GRUB_DISK_SECTOR_BITS) > total_sectors - *sector)) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + || ((*offset + size + VasEBoot_DISK_SECTOR_SIZE - 1) + >> VasEBoot_DISK_SECTOR_BITS) > total_sectors - *sector)) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read or write outside of disk `%s'"), disk->name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_disk_addr_t -transform_sector (grub_disk_t disk, grub_disk_addr_t sector) +static inline VasEBoot_disk_addr_t +transform_sector (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector) { - return sector >> (disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + return sector >> (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); } static unsigned -grub_disk_cache_get_index (unsigned long dev_id, unsigned long disk_id, - grub_disk_addr_t sector) +VasEBoot_disk_cache_get_index (unsigned long dev_id, unsigned long disk_id, + VasEBoot_disk_addr_t sector) { return ((dev_id * 524287UL + disk_id * 2606459UL - + ((unsigned) (sector >> GRUB_DISK_CACHE_BITS))) - % GRUB_DISK_CACHE_NUM); + + ((unsigned) (sector >> VasEBoot_DISK_CACHE_BITS))) + % VasEBoot_DISK_CACHE_NUM); } diff --git a/VasEBoot-core/kern/dl.c b/VasEBoot-core/kern/dl.c index d41343843..549771816 100644 --- a/VasEBoot-core/kern/dl.c +++ b/VasEBoot-core/kern/dl.c @@ -1,78 +1,78 @@ /* dl.c - loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Force native word size */ -#define GRUB_TARGET_WORDSIZE (8 * GRUB_CPU_SIZEOF_VOID_P) +#define VasEBoot_TARGET_WORDSIZE (8 * VasEBoot_CPU_SIZEOF_VOID_P) #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Platforms where modules are in a readonly area of memory. */ -#if defined(GRUB_MACHINE_QEMU) -#define GRUB_MODULES_MACHINE_READONLY +#if defined(VasEBoot_MACHINE_QEMU) +#define VasEBoot_MODULES_MACHINE_READONLY #endif -#ifdef GRUB_MACHINE_EMU +#ifdef VasEBoot_MACHINE_EMU #include #endif -#ifdef GRUB_MACHINE_EFI -#include +#ifdef VasEBoot_MACHINE_EFI +#include #endif #pragma GCC diagnostic ignored "-Wcast-align" -grub_dl_t grub_dl_head = 0; +VasEBoot_dl_t VasEBoot_dl_head = 0; -grub_err_t -grub_dl_add (grub_dl_t mod); +VasEBoot_err_t +VasEBoot_dl_add (VasEBoot_dl_t mod); /* Keep global so that GDB scripts work. */ -grub_err_t -grub_dl_add (grub_dl_t mod) +VasEBoot_err_t +VasEBoot_dl_add (VasEBoot_dl_t mod) { - if (grub_dl_get (mod->name)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (VasEBoot_dl_get (mod->name)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "`%s' is already loaded", mod->name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_dl_remove (grub_dl_t mod) +VasEBoot_dl_remove (VasEBoot_dl_t mod) { - grub_dl_t *p, q; + VasEBoot_dl_t *p, q; - for (p = &grub_dl_head, q = *p; q; p = &q->next, q = *p) + for (p = &VasEBoot_dl_head, q = *p; q; p = &q->next, q = *p) if (q == mod) { *p = q->next; @@ -82,67 +82,67 @@ grub_dl_remove (grub_dl_t mod) -struct grub_symbol +struct VasEBoot_symbol { - struct grub_symbol *next; + struct VasEBoot_symbol *next; const char *name; void *addr; int isfunc; - grub_dl_t mod; /* The module to which this symbol belongs. */ + VasEBoot_dl_t mod; /* The module to which this symbol belongs. */ }; -typedef struct grub_symbol *grub_symbol_t; +typedef struct VasEBoot_symbol *VasEBoot_symbol_t; /* The size of the symbol table. */ -#define GRUB_SYMTAB_SIZE 509 +#define VasEBoot_SYMTAB_SIZE 509 /* The symbol table (using an open-hash). */ -static struct grub_symbol *grub_symtab[GRUB_SYMTAB_SIZE]; +static struct VasEBoot_symbol *VasEBoot_symtab[VasEBoot_SYMTAB_SIZE]; /* Simple hash function. */ static unsigned -grub_symbol_hash (const char *s) +VasEBoot_symbol_hash (const char *s) { unsigned key = 0; while (*s) key = key * 65599 + *s++; - return (key + (key >> 5)) % GRUB_SYMTAB_SIZE; + return (key + (key >> 5)) % VasEBoot_SYMTAB_SIZE; } /* Resolve the symbol name NAME and return the address. Return NULL, if not found. */ -static grub_symbol_t -grub_dl_resolve_symbol (const char *name) +static VasEBoot_symbol_t +VasEBoot_dl_resolve_symbol (const char *name) { - grub_symbol_t sym; + VasEBoot_symbol_t sym; - for (sym = grub_symtab[grub_symbol_hash (name)]; sym; sym = sym->next) - if (grub_strcmp (sym->name, name) == 0) + for (sym = VasEBoot_symtab[VasEBoot_symbol_hash (name)]; sym; sym = sym->next) + if (VasEBoot_strcmp (sym->name, name) == 0) return sym; return 0; } /* Register a symbol with the name NAME and the address ADDR. */ -grub_err_t -grub_dl_register_symbol (const char *name, void *addr, int isfunc, - grub_dl_t mod) +VasEBoot_err_t +VasEBoot_dl_register_symbol (const char *name, void *addr, int isfunc, + VasEBoot_dl_t mod) { - grub_symbol_t sym; + VasEBoot_symbol_t sym; unsigned k; - sym = (grub_symbol_t) grub_malloc (sizeof (*sym)); + sym = (VasEBoot_symbol_t) VasEBoot_malloc (sizeof (*sym)); if (! sym) - return grub_errno; + return VasEBoot_errno; if (mod) { - sym->name = grub_strdup (name); + sym->name = VasEBoot_strdup (name); if (! sym->name) { - grub_free (sym); - return grub_errno; + VasEBoot_free (sym); + return VasEBoot_errno; } } else @@ -152,34 +152,34 @@ grub_dl_register_symbol (const char *name, void *addr, int isfunc, sym->mod = mod; sym->isfunc = isfunc; - k = grub_symbol_hash (name); - sym->next = grub_symtab[k]; - grub_symtab[k] = sym; + k = VasEBoot_symbol_hash (name); + sym->next = VasEBoot_symtab[k]; + VasEBoot_symtab[k] = sym; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Unregister all the symbols defined in the module MOD. */ static void -grub_dl_unregister_symbols (grub_dl_t mod) +VasEBoot_dl_unregister_symbols (VasEBoot_dl_t mod) { unsigned i; if (! mod) - grub_fatal ("core symbols cannot be unregistered"); + VasEBoot_fatal ("core symbols cannot be unregistered"); - for (i = 0; i < GRUB_SYMTAB_SIZE; i++) + for (i = 0; i < VasEBoot_SYMTAB_SIZE; i++) { - grub_symbol_t sym, *p, q; + VasEBoot_symbol_t sym, *p, q; - for (p = &grub_symtab[i], sym = *p; sym; sym = q) + for (p = &VasEBoot_symtab[i], sym = *p; sym; sym = q) { q = sym->next; if (sym->mod == mod) { *p = q; - grub_free ((void *) sym->name); - grub_free (sym); + VasEBoot_free ((void *) sym->name); + VasEBoot_free (sym); } else p = &sym->next; @@ -189,9 +189,9 @@ grub_dl_unregister_symbols (grub_dl_t mod) /* Return the address of a section whose index is N. */ static void * -grub_dl_get_section_addr (grub_dl_t mod, unsigned n) +VasEBoot_dl_get_section_addr (VasEBoot_dl_t mod, unsigned n) { - grub_dl_segment_t seg; + VasEBoot_dl_segment_t seg; for (seg = mod->segment; seg; seg = seg->next) if (seg->section == n) @@ -201,15 +201,15 @@ grub_dl_get_section_addr (grub_dl_t mod, unsigned n) } /* Check if EHDR is a valid ELF header. */ -static grub_err_t -grub_dl_check_header (void *ehdr, grub_size_t size) +static VasEBoot_err_t +VasEBoot_dl_check_header (void *ehdr, VasEBoot_size_t size) { Elf_Ehdr *e = ehdr; - grub_err_t err; + VasEBoot_err_t err; /* Check the header size. */ if (size < sizeof (Elf_Ehdr)) - return grub_error (GRUB_ERR_BAD_OS, "ELF header smaller than expected"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "ELF header smaller than expected"); /* Check the magic numbers. */ if (e->e_ident[EI_MAG0] != ELFMAG0 @@ -218,26 +218,26 @@ grub_dl_check_header (void *ehdr, grub_size_t size) || e->e_ident[EI_MAG3] != ELFMAG3 || e->e_ident[EI_VERSION] != EV_CURRENT || e->e_version != EV_CURRENT) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); - err = grub_arch_dl_check_header (ehdr); + err = VasEBoot_arch_dl_check_header (ehdr); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Load all segments from memory specified by E. */ -static grub_err_t -grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_dl_load_segments (VasEBoot_dl_t mod, const Elf_Ehdr *e) { unsigned i; const Elf_Shdr *s; - grub_size_t tsize = 0, talign = 1; + VasEBoot_size_t tsize = 0, talign = 1; #if !defined (__i386__) && !defined (__x86_64__) - grub_size_t tramp; - grub_size_t got; - grub_err_t err; + VasEBoot_size_t tramp; + VasEBoot_size_t got; + VasEBoot_err_t err; #endif char *ptr; @@ -251,24 +251,24 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) } #if !defined (__i386__) && !defined (__x86_64__) - err = grub_arch_dl_get_tramp_got_size (e, &tramp, &got); + err = VasEBoot_arch_dl_get_tramp_got_size (e, &tramp, &got); if (err) return err; - tsize += ALIGN_UP (tramp, GRUB_ARCH_DL_TRAMP_ALIGN); - if (talign < GRUB_ARCH_DL_TRAMP_ALIGN) - talign = GRUB_ARCH_DL_TRAMP_ALIGN; - tsize += ALIGN_UP (got, GRUB_ARCH_DL_GOT_ALIGN); - if (talign < GRUB_ARCH_DL_GOT_ALIGN) - talign = GRUB_ARCH_DL_GOT_ALIGN; + tsize += ALIGN_UP (tramp, VasEBoot_ARCH_DL_TRAMP_ALIGN); + if (talign < VasEBoot_ARCH_DL_TRAMP_ALIGN) + talign = VasEBoot_ARCH_DL_TRAMP_ALIGN; + tsize += ALIGN_UP (got, VasEBoot_ARCH_DL_GOT_ALIGN); + if (talign < VasEBoot_ARCH_DL_GOT_ALIGN) + talign = VasEBoot_ARCH_DL_GOT_ALIGN; #endif -#ifdef GRUB_MACHINE_EMU - mod->base = grub_osdep_dl_memalign (talign, tsize); +#ifdef VasEBoot_MACHINE_EMU + mod->base = VasEBoot_osdep_dl_memalign (talign, tsize); #else - mod->base = grub_memalign (talign, tsize); + mod->base = VasEBoot_memalign (talign, tsize); #endif if (!mod->base) - return grub_errno; + return VasEBoot_errno; mod->sz = tsize; ptr = mod->base; @@ -278,27 +278,27 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) { if (s->sh_flags & SHF_ALLOC) { - grub_dl_segment_t seg; + VasEBoot_dl_segment_t seg; - seg = (grub_dl_segment_t) grub_malloc (sizeof (*seg)); + seg = (VasEBoot_dl_segment_t) VasEBoot_malloc (sizeof (*seg)); if (! seg) - return grub_errno; + return VasEBoot_errno; if (s->sh_size) { void *addr; - ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, s->sh_addralign); + ptr = (char *) ALIGN_UP ((VasEBoot_addr_t) ptr, s->sh_addralign); addr = ptr; ptr += s->sh_size; switch (s->sh_type) { case SHT_PROGBITS: - grub_memcpy (addr, (char *) e + s->sh_offset, s->sh_size); + VasEBoot_memcpy (addr, (char *) e + s->sh_offset, s->sh_size); break; case SHT_NOBITS: - grub_memset (addr, 0, s->sh_size); + VasEBoot_memset (addr, 0, s->sh_size); break; } @@ -314,21 +314,21 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) } } #if !defined (__i386__) && !defined (__x86_64__) - ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, GRUB_ARCH_DL_TRAMP_ALIGN); + ptr = (char *) ALIGN_UP ((VasEBoot_addr_t) ptr, VasEBoot_ARCH_DL_TRAMP_ALIGN); mod->tramp = ptr; mod->trampptr = ptr; ptr += tramp; - ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, GRUB_ARCH_DL_GOT_ALIGN); + ptr = (char *) ALIGN_UP ((VasEBoot_addr_t) ptr, VasEBoot_ARCH_DL_GOT_ALIGN); mod->got = ptr; mod->gotptr = ptr; ptr += got; #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_dl_resolve_symbols (VasEBoot_dl_t mod, Elf_Ehdr *e) { unsigned i; Elf_Shdr *s; @@ -346,13 +346,13 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) We verify at build time that such modules do not contain any relocations that may reference symbol table. */ if (i == e->e_shnum) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; -#ifdef GRUB_MODULES_MACHINE_READONLY - mod->symtab = grub_malloc (s->sh_size); +#ifdef VasEBoot_MODULES_MACHINE_READONLY + mod->symtab = VasEBoot_malloc (s->sh_size); if (!mod->symtab) - return grub_errno; - grub_memcpy (mod->symtab, (char *) e + s->sh_offset, s->sh_size); + return VasEBoot_errno; + VasEBoot_memcpy (mod->symtab, (char *) e + s->sh_offset, s->sh_size); #else mod->symtab = (Elf_Sym *) ((char *) e + s->sh_offset); #endif @@ -379,9 +379,9 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) /* Resolve a global symbol. */ if (sym->st_name != 0 && sym->st_shndx == 0) { - grub_symbol_t nsym = grub_dl_resolve_symbol (name); + VasEBoot_symbol_t nsym = VasEBoot_dl_resolve_symbol (name); if (! nsym) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, N_("symbol `%s' not found"), name); sym->st_value = (Elf_Addr) nsym->addr; if (nsym->isfunc) @@ -389,40 +389,40 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) } else { - sym->st_value += (Elf_Addr) grub_dl_get_section_addr (mod, + sym->st_value += (Elf_Addr) VasEBoot_dl_get_section_addr (mod, sym->st_shndx); if (bind != STB_LOCAL) - if (grub_dl_register_symbol (name, (void *) sym->st_value, 0, mod)) - return grub_errno; + if (VasEBoot_dl_register_symbol (name, (void *) sym->st_value, 0, mod)) + return VasEBoot_errno; } break; case STT_FUNC: - sym->st_value += (Elf_Addr) grub_dl_get_section_addr (mod, + sym->st_value += (Elf_Addr) VasEBoot_dl_get_section_addr (mod, sym->st_shndx); #ifdef __ia64__ { /* FIXME: free descriptor once it's not used anymore. */ char **desc; - desc = grub_malloc (2 * sizeof (char *)); + desc = VasEBoot_malloc (2 * sizeof (char *)); if (!desc) - return grub_errno; + return VasEBoot_errno; desc[0] = (void *) sym->st_value; desc[1] = mod->base; - sym->st_value = (grub_addr_t) desc; + sym->st_value = (VasEBoot_addr_t) desc; } #endif if (bind != STB_LOCAL) - if (grub_dl_register_symbol (name, (void *) sym->st_value, 1, mod)) - return grub_errno; - if (grub_strcmp (name, "grub_mod_init") == 0) - mod->init = (void (*) (grub_dl_t)) sym->st_value; - else if (grub_strcmp (name, "grub_mod_fini") == 0) + if (VasEBoot_dl_register_symbol (name, (void *) sym->st_value, 1, mod)) + return VasEBoot_errno; + if (VasEBoot_strcmp (name, "VasEBoot_mod_init") == 0) + mod->init = (void (*) (VasEBoot_dl_t)) sym->st_value; + else if (VasEBoot_strcmp (name, "VasEBoot_mod_fini") == 0) mod->fini = (void (*) (void)) sym->st_value; break; case STT_SECTION: - sym->st_value = (Elf_Addr) grub_dl_get_section_addr (mod, + sym->st_value = (Elf_Addr) VasEBoot_dl_get_section_addr (mod, sym->st_shndx); break; @@ -431,16 +431,16 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) break; default: - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "unknown symbol type `%d'", (int) type); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static Elf_Shdr * -grub_dl_find_section (Elf_Ehdr *e, const char *name) +VasEBoot_dl_find_section (Elf_Ehdr *e, const char *name) { Elf_Shdr *s; const char *str; @@ -452,7 +452,7 @@ grub_dl_find_section (Elf_Ehdr *e, const char *name) for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) - if (grub_strcmp (str + s->sh_name, name) == 0) + if (VasEBoot_strcmp (str + s->sh_name, name) == 0) return s; return NULL; } @@ -461,113 +461,113 @@ grub_dl_find_section (Elf_Ehdr *e, const char *name) GNU module policy. Note that this license check is informative only. Modules have to be licensed under GPLv3 or GPLv3+ (optionally multi-licensed under other licences as well) independently of the - presence of this check and solely by linking (module loading in GRUB - constitutes linking) and GRUB core being licensed under GPLv3+. + presence of this check and solely by linking (module loading in VasEBoot + constitutes linking) and VasEBoot core being licensed under GPLv3+. Be sure to understand your license obligations. */ -static grub_err_t -grub_dl_check_license (Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_dl_check_license (Elf_Ehdr *e) { - Elf_Shdr *s = grub_dl_find_section (e, ".module_license"); - if (s && (grub_strcmp ((char *) e + s->sh_offset, "LICENSE=GPLv3") == 0 - || grub_strcmp ((char *) e + s->sh_offset, "LICENSE=GPLv3+") == 0 - || grub_strcmp ((char *) e + s->sh_offset, "LICENSE=GPLv2+") == 0)) - return GRUB_ERR_NONE; - return grub_error (GRUB_ERR_BAD_MODULE, "incompatible license"); + Elf_Shdr *s = VasEBoot_dl_find_section (e, ".module_license"); + if (s && (VasEBoot_strcmp ((char *) e + s->sh_offset, "LICENSE=GPLv3") == 0 + || VasEBoot_strcmp ((char *) e + s->sh_offset, "LICENSE=GPLv3+") == 0 + || VasEBoot_strcmp ((char *) e + s->sh_offset, "LICENSE=GPLv2+") == 0)) + return VasEBoot_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "incompatible license"); } -static grub_err_t -grub_dl_resolve_name (grub_dl_t mod, Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_dl_resolve_name (VasEBoot_dl_t mod, Elf_Ehdr *e) { Elf_Shdr *s; - s = grub_dl_find_section (e, ".modname"); + s = VasEBoot_dl_find_section (e, ".modname"); if (!s) - return grub_error (GRUB_ERR_BAD_MODULE, "no module name found"); + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "no module name found"); - mod->name = grub_strdup ((char *) e + s->sh_offset); + mod->name = VasEBoot_strdup ((char *) e + s->sh_offset); if (! mod->name) - return grub_errno; + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e) +static VasEBoot_err_t +VasEBoot_dl_resolve_dependencies (VasEBoot_dl_t mod, Elf_Ehdr *e) { Elf_Shdr *s; - s = grub_dl_find_section (e, ".moddeps"); + s = VasEBoot_dl_find_section (e, ".moddeps"); if (!s) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; const char *name = (char *) e + s->sh_offset; const char *max = name + s->sh_size; while ((name < max) && (*name)) { - grub_dl_t m; - grub_dl_dep_t dep; + VasEBoot_dl_t m; + VasEBoot_dl_dep_t dep; - m = grub_dl_load (name); + m = VasEBoot_dl_load (name); if (! m) - return grub_errno; + return VasEBoot_errno; - grub_dl_ref (m); + VasEBoot_dl_ref (m); - dep = (grub_dl_dep_t) grub_malloc (sizeof (*dep)); + dep = (VasEBoot_dl_dep_t) VasEBoot_malloc (sizeof (*dep)); if (! dep) - return grub_errno; + return VasEBoot_errno; dep->mod = m; dep->next = mod->dep; mod->dep = dep; - name += grub_strlen (name) + 1; + name += VasEBoot_strlen (name) + 1; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } int -grub_dl_ref (grub_dl_t mod) +VasEBoot_dl_ref (VasEBoot_dl_t mod) { - grub_dl_dep_t dep; + VasEBoot_dl_dep_t dep; if (!mod) return 0; for (dep = mod->dep; dep; dep = dep->next) - grub_dl_ref (dep->mod); + VasEBoot_dl_ref (dep->mod); return ++mod->ref_count; } int -grub_dl_unref (grub_dl_t mod) +VasEBoot_dl_unref (VasEBoot_dl_t mod) { - grub_dl_dep_t dep; + VasEBoot_dl_dep_t dep; if (!mod) return 0; for (dep = mod->dep; dep; dep = dep->next) - grub_dl_unref (dep->mod); + VasEBoot_dl_unref (dep->mod); return --mod->ref_count; } static void -grub_dl_flush_cache (grub_dl_t mod) +VasEBoot_dl_flush_cache (VasEBoot_dl_t mod) { - grub_dprintf ("modules", "flushing 0x%lx bytes at %p\n", + VasEBoot_dprintf ("modules", "flushing 0x%lx bytes at %p\n", (unsigned long) mod->sz, mod->base); - grub_arch_sync_caches (mod->base, mod->sz); + VasEBoot_arch_sync_caches (mod->base, mod->sz); } -static grub_err_t -grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr) +static VasEBoot_err_t +VasEBoot_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr) { Elf_Ehdr *e = ehdr; Elf_Shdr *s; @@ -578,8 +578,8 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr) i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_REL || s->sh_type == SHT_RELA) { - grub_dl_segment_t seg; - grub_err_t err; + VasEBoot_dl_segment_t seg; + VasEBoot_err_t err; /* Find the target segment. */ for (seg = mod->segment; seg; seg = seg->next) @@ -589,152 +589,152 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { if (!mod->symtab) - return grub_error (GRUB_ERR_BAD_MODULE, "relocation without symbol table"); + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "relocation without symbol table"); - err = grub_arch_dl_relocate_symbols (mod, ehdr, s, seg); + err = VasEBoot_arch_dl_relocate_symbols (mod, ehdr, s, seg); if (err) return err; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Load a module from core memory. */ -grub_dl_t -grub_dl_load_core_noinit (void *addr, grub_size_t size) +VasEBoot_dl_t +VasEBoot_dl_load_core_noinit (void *addr, VasEBoot_size_t size) { Elf_Ehdr *e; - grub_dl_t mod; + VasEBoot_dl_t mod; - grub_dprintf ("modules", "module at %p, size 0x%lx\n", addr, + VasEBoot_dprintf ("modules", "module at %p, size 0x%lx\n", addr, (unsigned long) size); e = addr; - if (grub_dl_check_header (e, size)) + if (VasEBoot_dl_check_header (e, size)) return 0; if (e->e_type != ET_REL) { - grub_error (GRUB_ERR_BAD_MODULE, N_("this ELF file is not of the right type")); + VasEBoot_error (VasEBoot_ERR_BAD_MODULE, N_("this ELF file is not of the right type")); return 0; } /* Make sure that every section is within the core. */ - if (size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum) + if (size < e->e_shoff + (VasEBoot_uint32_t) e->e_shentsize * e->e_shnum) { - grub_error (GRUB_ERR_BAD_OS, "ELF sections outside core"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "ELF sections outside core"); return 0; } - mod = (grub_dl_t) grub_zalloc (sizeof (*mod)); + mod = (VasEBoot_dl_t) VasEBoot_zalloc (sizeof (*mod)); if (! mod) return 0; mod->ref_count = 1; - grub_dprintf ("modules", "relocating to %p\n", mod); + VasEBoot_dprintf ("modules", "relocating to %p\n", mod); /* Me, Vladimir Serbinenko, hereby I add this module check as per new GNU module policy. Note that this license check is informative only. Modules have to be licensed under GPLv3 or GPLv3+ (optionally multi-licensed under other licences as well) independently of the - presence of this check and solely by linking (module loading in GRUB - constitutes linking) and GRUB core being licensed under GPLv3+. + presence of this check and solely by linking (module loading in VasEBoot + constitutes linking) and VasEBoot core being licensed under GPLv3+. Be sure to understand your license obligations. */ - if (grub_dl_check_license (e) - || grub_dl_resolve_name (mod, e) - || grub_dl_resolve_dependencies (mod, e) - || grub_dl_load_segments (mod, e) - || grub_dl_resolve_symbols (mod, e) - || grub_dl_relocate_symbols (mod, e)) + if (VasEBoot_dl_check_license (e) + || VasEBoot_dl_resolve_name (mod, e) + || VasEBoot_dl_resolve_dependencies (mod, e) + || VasEBoot_dl_load_segments (mod, e) + || VasEBoot_dl_resolve_symbols (mod, e) + || VasEBoot_dl_relocate_symbols (mod, e)) { mod->fini = 0; - grub_dl_unload (mod); + VasEBoot_dl_unload (mod); return 0; } - grub_dl_flush_cache (mod); + VasEBoot_dl_flush_cache (mod); - grub_dprintf ("modules", "module name: %s\n", mod->name); - grub_dprintf ("modules", "init function: %p\n", mod->init); + VasEBoot_dprintf ("modules", "module name: %s\n", mod->name); + VasEBoot_dprintf ("modules", "init function: %p\n", mod->init); - if (grub_dl_add (mod)) + if (VasEBoot_dl_add (mod)) { - grub_dl_unload (mod); + VasEBoot_dl_unload (mod); return 0; } return mod; } -grub_dl_t -grub_dl_load_core (void *addr, grub_size_t size) +VasEBoot_dl_t +VasEBoot_dl_load_core (void *addr, VasEBoot_size_t size) { - grub_dl_t mod; + VasEBoot_dl_t mod; - grub_boot_time ("Parsing module"); + VasEBoot_boot_time ("Parsing module"); - mod = grub_dl_load_core_noinit (addr, size); + mod = VasEBoot_dl_load_core_noinit (addr, size); if (!mod) return NULL; - grub_boot_time ("Initing module %s", mod->name); - grub_dl_init (mod); - grub_boot_time ("Module %s inited", mod->name); + VasEBoot_boot_time ("Initing module %s", mod->name); + VasEBoot_dl_init (mod); + VasEBoot_boot_time ("Module %s inited", mod->name); return mod; } /* Load a module from the file FILENAME. */ -grub_dl_t -grub_dl_load_file (const char *filename) +VasEBoot_dl_t +VasEBoot_dl_load_file (const char *filename) { - grub_file_t file = NULL; - grub_ssize_t size; + VasEBoot_file_t file = NULL; + VasEBoot_ssize_t size; void *core = 0; - grub_dl_t mod = 0; + VasEBoot_dl_t mod = 0; -#ifdef GRUB_MACHINE_EFI - if (grub_efi_secure_boot ()) +#ifdef VasEBoot_MACHINE_EFI + if (VasEBoot_efi_secure_boot ()) { - grub_error (GRUB_ERR_ACCESS_DENIED, + VasEBoot_error (VasEBoot_ERR_ACCESS_DENIED, "Secure Boot forbids loading module from %s", filename); return 0; } #endif - grub_boot_time ("Loading module %s", filename); + VasEBoot_boot_time ("Loading module %s", filename); - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (! file) return 0; - size = grub_file_size (file); - core = grub_malloc (size); + size = VasEBoot_file_size (file); + core = VasEBoot_malloc (size); if (! core) { - grub_file_close (file); + VasEBoot_file_close (file); return 0; } - if (grub_file_read (file, core, size) != (int) size) + if (VasEBoot_file_read (file, core, size) != (int) size) { - grub_file_close (file); - grub_free (core); + VasEBoot_file_close (file); + VasEBoot_free (core); return 0; } /* We must close this before we try to process dependencies. Some disk backends do not handle gracefully multiple concurrent opens of the same device. */ - grub_file_close (file); + VasEBoot_file_close (file); - grub_tpm_measure(core, size, GRUB_BINARY_PCR, "grub_module", filename); - grub_print_error(); + VasEBoot_tpm_measure(core, size, VasEBoot_BINARY_PCR, "VasEBoot_module", filename); + VasEBoot_print_error(); - mod = grub_dl_load_core (core, size); - grub_free (core); + mod = VasEBoot_dl_load_core (core, size); + VasEBoot_free (core); if (! mod) return 0; @@ -743,47 +743,47 @@ grub_dl_load_file (const char *filename) } /* Load a module using a symbolic name. */ -grub_dl_t -grub_dl_load (const char *name) +VasEBoot_dl_t +VasEBoot_dl_load (const char *name) { char *filename; - grub_dl_t mod; - const char *grub_dl_dir = grub_env_get ("prefix"); + VasEBoot_dl_t mod; + const char *VasEBoot_dl_dir = VasEBoot_env_get ("prefix"); - mod = grub_dl_get (name); + mod = VasEBoot_dl_get (name); if (mod) return mod; - if (grub_no_modules) + if (VasEBoot_no_modules) return 0; - if (! grub_dl_dir) { - grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); + if (! VasEBoot_dl_dir) { + VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix"); return 0; } - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM "/%s.mod", - grub_dl_dir, name); + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/%s.mod", + VasEBoot_dl_dir, name); if (! filename) return 0; - mod = grub_dl_load_file (filename); - grub_free (filename); + mod = VasEBoot_dl_load_file (filename); + VasEBoot_free (filename); if (! mod) return 0; - if (grub_strcmp (mod->name, name) != 0) - grub_error (GRUB_ERR_BAD_MODULE, "mismatched names"); + if (VasEBoot_strcmp (mod->name, name) != 0) + VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "mismatched names"); return mod; } /* Unload the module MOD. */ int -grub_dl_unload (grub_dl_t mod) +VasEBoot_dl_unload (VasEBoot_dl_t mod) { - grub_dl_dep_t dep, depn; + VasEBoot_dl_dep_t dep, depn; if (mod->ref_count > 0) return 0; @@ -791,44 +791,44 @@ grub_dl_unload (grub_dl_t mod) if (mod->fini) (mod->fini) (); - grub_dl_remove (mod); - grub_dl_unregister_symbols (mod); + VasEBoot_dl_remove (mod); + VasEBoot_dl_unregister_symbols (mod); for (dep = mod->dep; dep; dep = depn) { depn = dep->next; - grub_dl_unload (dep->mod); + VasEBoot_dl_unload (dep->mod); - grub_free (dep); + VasEBoot_free (dep); } -#ifdef GRUB_MACHINE_EMU - grub_dl_osdep_dl_free (mod->base); +#ifdef VasEBoot_MACHINE_EMU + VasEBoot_dl_osdep_dl_free (mod->base); #else - grub_free (mod->base); + VasEBoot_free (mod->base); #endif - grub_free (mod->name); -#ifdef GRUB_MODULES_MACHINE_READONLY - grub_free (mod->symtab); + VasEBoot_free (mod->name); +#ifdef VasEBoot_MODULES_MACHINE_READONLY + VasEBoot_free (mod->symtab); #endif - grub_free (mod); + VasEBoot_free (mod); return 1; } /* Unload unneeded modules. */ void -grub_dl_unload_unneeded (void) +VasEBoot_dl_unload_unneeded (void) { - /* Because grub_dl_remove modifies the list of modules, this + /* Because VasEBoot_dl_remove modifies the list of modules, this implementation is tricky. */ - grub_dl_t p = grub_dl_head; + VasEBoot_dl_t p = VasEBoot_dl_head; while (p) { - if (grub_dl_unload (p)) + if (VasEBoot_dl_unload (p)) { - p = grub_dl_head; + p = VasEBoot_dl_head; continue; } diff --git a/VasEBoot-core/kern/efi/acpi.c b/VasEBoot-core/kern/efi/acpi.c index 74f8cd1a9..a34e57a9a 100644 --- a/VasEBoot-core/kern/efi/acpi.c +++ b/VasEBoot-core/kern/efi/acpi.c @@ -1,59 +1,59 @@ /* acpi.c - get acpi tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_acpi_rsdp_v10 * -grub_machine_acpi_get_rsdpv1 (void) +struct VasEBoot_acpi_rsdp_v10 * +VasEBoot_machine_acpi_get_rsdpv1 (void) { unsigned i; - static grub_efi_packed_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; + static VasEBoot_efi_packed_guid_t acpi_guid = VasEBoot_EFI_ACPI_TABLE_GUID; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + for (i = 0; i < VasEBoot_efi_system_table->num_table_entries; i++) { - grub_efi_packed_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; + VasEBoot_efi_packed_guid_t *guid = + &VasEBoot_efi_system_table->configuration_table[i].vendor_guid; - if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_packed_guid_t))) - return (struct grub_acpi_rsdp_v10 *) - grub_efi_system_table->configuration_table[i].vendor_table; + if (! VasEBoot_memcmp (guid, &acpi_guid, sizeof (VasEBoot_efi_packed_guid_t))) + return (struct VasEBoot_acpi_rsdp_v10 *) + VasEBoot_efi_system_table->configuration_table[i].vendor_table; } return 0; } -struct grub_acpi_rsdp_v20 * -grub_machine_acpi_get_rsdpv2 (void) +struct VasEBoot_acpi_rsdp_v20 * +VasEBoot_machine_acpi_get_rsdpv2 (void) { unsigned i; - static grub_efi_packed_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID; + static VasEBoot_efi_packed_guid_t acpi20_guid = VasEBoot_EFI_ACPI_20_TABLE_GUID; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + for (i = 0; i < VasEBoot_efi_system_table->num_table_entries; i++) { - grub_efi_packed_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; + VasEBoot_efi_packed_guid_t *guid = + &VasEBoot_efi_system_table->configuration_table[i].vendor_guid; - if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_packed_guid_t))) - return (struct grub_acpi_rsdp_v20 *) - grub_efi_system_table->configuration_table[i].vendor_table; + if (! VasEBoot_memcmp (guid, &acpi20_guid, sizeof (VasEBoot_efi_packed_guid_t))) + return (struct VasEBoot_acpi_rsdp_v20 *) + VasEBoot_efi_system_table->configuration_table[i].vendor_table; } return 0; } diff --git a/VasEBoot-core/kern/efi/efi.c b/VasEBoot-core/kern/efi/efi.c index bce251df9..5d89d3ce7 100644 --- a/VasEBoot-core/kern/efi/efi.c +++ b/VasEBoot-core/kern/efi/efi.c @@ -1,53 +1,53 @@ /* efi.c - generic EFI support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- 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 + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -/* The handle of GRUB itself. Filled in by the startup code. */ -grub_efi_handle_t grub_efi_image_handle; +/* The handle of VasEBoot itself. Filled in by the startup code. */ +VasEBoot_efi_handle_t VasEBoot_efi_image_handle; /* The pointer to a system table. Filled in by the startup code. */ -grub_efi_system_table_t *grub_efi_system_table; +VasEBoot_efi_system_table_t *VasEBoot_efi_system_table; -static grub_efi_guid_t console_control_guid = GRUB_EFI_CONSOLE_CONTROL_GUID; -static grub_efi_guid_t loaded_image_guid = GRUB_EFI_LOADED_IMAGE_GUID; -static grub_efi_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID; +static VasEBoot_efi_guid_t console_control_guid = VasEBoot_EFI_CONSOLE_CONTROL_GUID; +static VasEBoot_efi_guid_t loaded_image_guid = VasEBoot_EFI_LOADED_IMAGE_GUID; +static VasEBoot_efi_guid_t device_path_guid = VasEBoot_EFI_DEVICE_PATH_GUID; void * -grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration) +VasEBoot_efi_locate_protocol (VasEBoot_efi_guid_t *protocol, void *registration) { void *interface; - grub_efi_status_t status; + VasEBoot_efi_status_t status; - status = efi_call_3 (grub_efi_system_table->boot_services->locate_protocol, + status = efi_call_3 (VasEBoot_efi_system_table->boot_services->locate_protocol, protocol, registration, &interface); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) return 0; return interface; @@ -56,28 +56,28 @@ grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration) /* Return the array of handles which meet the requirement. If successful, the number of handles is stored in NUM_HANDLES. The array is allocated from the heap. */ -grub_efi_handle_t * -grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, - grub_efi_guid_t *protocol, +VasEBoot_efi_handle_t * +VasEBoot_efi_locate_handle (VasEBoot_efi_locate_search_type_t search_type, + VasEBoot_efi_guid_t *protocol, void *search_key, - grub_efi_uintn_t *num_handles) + VasEBoot_efi_uintn_t *num_handles) { - grub_efi_boot_services_t *b; - grub_efi_status_t status; - grub_efi_handle_t *buffer; - grub_efi_uintn_t buffer_size = 8 * sizeof (grub_efi_handle_t); + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_status_t status; + VasEBoot_efi_handle_t *buffer; + VasEBoot_efi_uintn_t buffer_size = 8 * sizeof (VasEBoot_efi_handle_t); - buffer = grub_malloc (buffer_size); + buffer = VasEBoot_malloc (buffer_size); if (! buffer) return 0; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; status = efi_call_5 (b->locate_handle, search_type, protocol, search_key, &buffer_size, buffer); - if (status == GRUB_EFI_BUFFER_TOO_SMALL) + if (status == VasEBoot_EFI_BUFFER_TOO_SMALL) { - grub_free (buffer); - buffer = grub_malloc (buffer_size); + VasEBoot_free (buffer); + buffer = VasEBoot_malloc (buffer_size); if (! buffer) return 0; @@ -85,200 +85,200 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, &buffer_size, buffer); } - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - grub_free (buffer); + VasEBoot_free (buffer); return 0; } - *num_handles = buffer_size / sizeof (grub_efi_handle_t); + *num_handles = buffer_size / sizeof (VasEBoot_efi_handle_t); return buffer; } void * -grub_efi_open_protocol (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, - grub_efi_uint32_t attributes) +VasEBoot_efi_open_protocol (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_uint32_t attributes) { - grub_efi_boot_services_t *b; - grub_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_status_t status; void *interface; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; status = efi_call_6 (b->open_protocol, handle, protocol, &interface, - grub_efi_image_handle, + VasEBoot_efi_image_handle, 0, attributes); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) return 0; return interface; } int -grub_efi_set_text_mode (int on) +VasEBoot_efi_set_text_mode (int on) { - grub_efi_console_control_protocol_t *c; - grub_efi_screen_mode_t mode, new_mode; + VasEBoot_efi_console_control_protocol_t *c; + VasEBoot_efi_screen_mode_t mode, new_mode; - c = grub_efi_locate_protocol (&console_control_guid, 0); + c = VasEBoot_efi_locate_protocol (&console_control_guid, 0); if (! c) /* No console control protocol instance available, assume it is already in text mode. */ return 1; - if (efi_call_4 (c->get_mode, c, &mode, 0, 0) != GRUB_EFI_SUCCESS) + if (efi_call_4 (c->get_mode, c, &mode, 0, 0) != VasEBoot_EFI_SUCCESS) return 0; - new_mode = on ? GRUB_EFI_SCREEN_TEXT : GRUB_EFI_SCREEN_GRAPHICS; + new_mode = on ? VasEBoot_EFI_SCREEN_TEXT : VasEBoot_EFI_SCREEN_GRAPHICS; if (mode != new_mode) - if (efi_call_2 (c->set_mode, c, new_mode) != GRUB_EFI_SUCCESS) + if (efi_call_2 (c->set_mode, c, new_mode) != VasEBoot_EFI_SUCCESS) return 0; return 1; } void -grub_efi_stall (grub_efi_uintn_t microseconds) +VasEBoot_efi_stall (VasEBoot_efi_uintn_t microseconds) { - efi_call_1 (grub_efi_system_table->boot_services->stall, microseconds); + efi_call_1 (VasEBoot_efi_system_table->boot_services->stall, microseconds); } -grub_efi_loaded_image_t * -grub_efi_get_loaded_image (grub_efi_handle_t image_handle) +VasEBoot_efi_loaded_image_t * +VasEBoot_efi_get_loaded_image (VasEBoot_efi_handle_t image_handle) { - return grub_efi_open_protocol (image_handle, + return VasEBoot_efi_open_protocol (image_handle, &loaded_image_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); } void -grub_exit (void) +VasEBoot_exit (void) { - grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); - efi_call_4 (grub_efi_system_table->boot_services->exit, - grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0); + VasEBoot_machine_fini (VasEBoot_LOADER_FLAG_NORETURN); + efi_call_4 (VasEBoot_efi_system_table->boot_services->exit, + VasEBoot_efi_image_handle, VasEBoot_EFI_SUCCESS, 0, 0); for (;;) ; } -grub_err_t -grub_efi_set_virtual_address_map (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map) +VasEBoot_err_t +VasEBoot_efi_set_virtual_address_map (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version, + VasEBoot_efi_memory_descriptor_t *virtual_map) { - grub_efi_runtime_services_t *r; - grub_efi_status_t status; + VasEBoot_efi_runtime_services_t *r; + VasEBoot_efi_status_t status; - r = grub_efi_system_table->runtime_services; + r = VasEBoot_efi_system_table->runtime_services; status = efi_call_4 (r->set_virtual_address_map, memory_map_size, descriptor_size, descriptor_version, virtual_map); - if (status == GRUB_EFI_SUCCESS) - return GRUB_ERR_NONE; + if (status == VasEBoot_EFI_SUCCESS) + return VasEBoot_ERR_NONE; - return grub_error (GRUB_ERR_IO, "set_virtual_address_map failed"); + return VasEBoot_error (VasEBoot_ERR_IO, "set_virtual_address_map failed"); } -grub_err_t -grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid, - void *data, grub_size_t datasize) +VasEBoot_err_t +VasEBoot_efi_set_variable(const char *var, const VasEBoot_efi_guid_t *guid, + void *data, VasEBoot_size_t datasize) { - grub_efi_status_t status; - grub_efi_runtime_services_t *r; - grub_efi_char16_t *var16; - grub_size_t len, len16; + VasEBoot_efi_status_t status; + VasEBoot_efi_runtime_services_t *r; + VasEBoot_efi_char16_t *var16; + VasEBoot_size_t len, len16; - len = grub_strlen (var); - len16 = len * GRUB_MAX_UTF16_PER_UTF8; - var16 = grub_malloc ((len16 + 1) * sizeof (var16[0])); + len = VasEBoot_strlen (var); + len16 = len * VasEBoot_MAX_UTF16_PER_UTF8; + var16 = VasEBoot_malloc ((len16 + 1) * sizeof (var16[0])); if (!var16) - return grub_errno; - len16 = grub_utf8_to_utf16 (var16, len16, (grub_uint8_t *) var, len, NULL); + return VasEBoot_errno; + len16 = VasEBoot_utf8_to_utf16 (var16, len16, (VasEBoot_uint8_t *) var, len, NULL); var16[len16] = 0; - r = grub_efi_system_table->runtime_services; + r = VasEBoot_efi_system_table->runtime_services; status = efi_call_5 (r->set_variable, var16, guid, - (GRUB_EFI_VARIABLE_NON_VOLATILE - | GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS - | GRUB_EFI_VARIABLE_RUNTIME_ACCESS), + (VasEBoot_EFI_VARIABLE_NON_VOLATILE + | VasEBoot_EFI_VARIABLE_BOOTSERVICE_ACCESS + | VasEBoot_EFI_VARIABLE_RUNTIME_ACCESS), datasize, data); - grub_free (var16); - if (status == GRUB_EFI_SUCCESS) - return GRUB_ERR_NONE; + VasEBoot_free (var16); + if (status == VasEBoot_EFI_SUCCESS) + return VasEBoot_ERR_NONE; - return grub_error (GRUB_ERR_IO, "could not set EFI variable `%s'", var); + return VasEBoot_error (VasEBoot_ERR_IO, "could not set EFI variable `%s'", var); } void * -grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, - grub_size_t *datasize_out) +VasEBoot_efi_get_variable (const char *var, const VasEBoot_efi_guid_t *guid, + VasEBoot_size_t *datasize_out) { - grub_efi_status_t status; - grub_efi_uintn_t datasize = 0; - grub_efi_runtime_services_t *r; - grub_efi_char16_t *var16; + VasEBoot_efi_status_t status; + VasEBoot_efi_uintn_t datasize = 0; + VasEBoot_efi_runtime_services_t *r; + VasEBoot_efi_char16_t *var16; void *data; - grub_size_t len, len16; + VasEBoot_size_t len, len16; *datasize_out = 0; - len = grub_strlen (var); - len16 = len * GRUB_MAX_UTF16_PER_UTF8; - var16 = grub_malloc ((len16 + 1) * sizeof (var16[0])); + len = VasEBoot_strlen (var); + len16 = len * VasEBoot_MAX_UTF16_PER_UTF8; + var16 = VasEBoot_malloc ((len16 + 1) * sizeof (var16[0])); if (!var16) return NULL; - len16 = grub_utf8_to_utf16 (var16, len16, (grub_uint8_t *) var, len, NULL); + len16 = VasEBoot_utf8_to_utf16 (var16, len16, (VasEBoot_uint8_t *) var, len, NULL); var16[len16] = 0; - r = grub_efi_system_table->runtime_services; + r = VasEBoot_efi_system_table->runtime_services; status = efi_call_5 (r->get_variable, var16, guid, NULL, &datasize, NULL); - if (status != GRUB_EFI_BUFFER_TOO_SMALL || !datasize) + if (status != VasEBoot_EFI_BUFFER_TOO_SMALL || !datasize) { - grub_free (var16); + VasEBoot_free (var16); return NULL; } - data = grub_malloc (datasize); + data = VasEBoot_malloc (datasize); if (!data) { - grub_free (var16); + VasEBoot_free (var16); return NULL; } status = efi_call_5 (r->get_variable, var16, guid, NULL, &datasize, data); - grub_free (var16); + VasEBoot_free (var16); - if (status == GRUB_EFI_SUCCESS) + if (status == VasEBoot_EFI_SUCCESS) { *datasize_out = datasize; return data; } - grub_free (data); + VasEBoot_free (data); return NULL; } -grub_efi_boolean_t -grub_efi_secure_boot (void) +VasEBoot_efi_boolean_t +VasEBoot_efi_secure_boot (void) { - grub_efi_guid_t efi_var_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID; - grub_size_t datasize; + VasEBoot_efi_guid_t efi_var_guid = VasEBoot_EFI_GLOBAL_VARIABLE_GUID; + VasEBoot_size_t datasize; char *secure_boot = NULL; char *setup_mode = NULL; - grub_efi_boolean_t ret = 0; + VasEBoot_efi_boolean_t ret = 0; - secure_boot = grub_efi_get_variable("SecureBoot", &efi_var_guid, &datasize); + secure_boot = VasEBoot_efi_get_variable("SecureBoot", &efi_var_guid, &datasize); if (datasize != 1 || !secure_boot) goto out; - setup_mode = grub_efi_get_variable("SetupMode", &efi_var_guid, &datasize); + setup_mode = VasEBoot_efi_get_variable("SetupMode", &efi_var_guid, &datasize); if (datasize != 1 || !setup_mode) goto out; @@ -287,8 +287,8 @@ grub_efi_secure_boot (void) ret = 1; out: - grub_free (secure_boot); - grub_free (setup_mode); + VasEBoot_free (secure_boot); + VasEBoot_free (setup_mode); return ret; } @@ -296,25 +296,25 @@ grub_efi_secure_boot (void) /* Search the mods section from the PE32/PE32+ image. This code uses a PE32 header, but should work with PE32+ as well. */ -grub_addr_t -grub_efi_modules_addr (void) +VasEBoot_addr_t +VasEBoot_efi_modules_addr (void) { - grub_efi_loaded_image_t *image; - struct grub_pe32_header *header; - struct grub_pe32_coff_header *coff_header; - struct grub_pe32_section_table *sections; - struct grub_pe32_section_table *section; - struct grub_module_info *info; - grub_uint16_t i; + VasEBoot_efi_loaded_image_t *image; + struct VasEBoot_pe32_header *header; + struct VasEBoot_pe32_coff_header *coff_header; + struct VasEBoot_pe32_section_table *sections; + struct VasEBoot_pe32_section_table *section; + struct VasEBoot_module_info *info; + VasEBoot_uint16_t i; - image = grub_efi_get_loaded_image (grub_efi_image_handle); + image = VasEBoot_efi_get_loaded_image (VasEBoot_efi_image_handle); if (! image) return 0; header = image->image_base; coff_header = &(header->coff_header); sections - = (struct grub_pe32_section_table *) ((char *) coff_header + = (struct VasEBoot_pe32_section_table *) ((char *) coff_header + sizeof (*coff_header) + coff_header->optional_header_size); @@ -322,49 +322,49 @@ grub_efi_modules_addr (void) i < coff_header->num_sections; i++, section++) { - if (grub_strcmp (section->name, "mods") == 0) + if (VasEBoot_strcmp (section->name, "mods") == 0) break; } if (i == coff_header->num_sections) return 0; - info = (struct grub_module_info *) ((char *) image->image_base + info = (struct VasEBoot_module_info *) ((char *) image->image_base + section->virtual_address); - if (info->magic != GRUB_MODULE_MAGIC) + if (info->magic != VasEBoot_MODULE_MAGIC) return 0; - return (grub_addr_t) info; + return (VasEBoot_addr_t) info; } #pragma GCC diagnostic error "-Wcast-align" char * -grub_efi_get_filename (grub_efi_device_path_t *dp0) +VasEBoot_efi_get_filename (VasEBoot_efi_device_path_t *dp0) { char *name = 0, *p, *pi; - grub_size_t filesize = 0; - grub_efi_device_path_t *dp; + VasEBoot_size_t filesize = 0; + VasEBoot_efi_device_path_t *dp; dp = dp0; while (1) { - grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); - grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); + VasEBoot_efi_uint8_t type = VasEBoot_EFI_DEVICE_PATH_TYPE (dp); + VasEBoot_efi_uint8_t subtype = VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp); - if (type == GRUB_EFI_END_DEVICE_PATH_TYPE) + if (type == VasEBoot_EFI_END_DEVICE_PATH_TYPE) break; - if (type == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE - && subtype == GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE) + if (type == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE + && subtype == VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE) { - grub_efi_uint16_t len; - len = ((GRUB_EFI_DEVICE_PATH_LENGTH (dp) - 4) - / sizeof (grub_efi_char16_t)); - filesize += GRUB_MAX_UTF8_PER_UTF16 * len + 2; + VasEBoot_efi_uint16_t len; + len = ((VasEBoot_EFI_DEVICE_PATH_LENGTH (dp) - 4) + / sizeof (VasEBoot_efi_char16_t)); + filesize += VasEBoot_MAX_UTF8_PER_UTF16 * len + 2; } - dp = GRUB_EFI_NEXT_DEVICE_PATH (dp); + dp = VasEBoot_EFI_NEXT_DEVICE_PATH (dp); } if (!filesize) @@ -372,36 +372,36 @@ grub_efi_get_filename (grub_efi_device_path_t *dp0) dp = dp0; - p = name = grub_malloc (filesize); + p = name = VasEBoot_malloc (filesize); if (!name) return NULL; while (1) { - grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); - grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); + VasEBoot_efi_uint8_t type = VasEBoot_EFI_DEVICE_PATH_TYPE (dp); + VasEBoot_efi_uint8_t subtype = VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp); - if (type == GRUB_EFI_END_DEVICE_PATH_TYPE) + if (type == VasEBoot_EFI_END_DEVICE_PATH_TYPE) break; - else if (type == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE - && subtype == GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE) + else if (type == VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE + && subtype == VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE) { - grub_efi_file_path_device_path_t *fp; - grub_efi_uint16_t len; + VasEBoot_efi_file_path_device_path_t *fp; + VasEBoot_efi_uint16_t len; *p++ = '/'; - len = ((GRUB_EFI_DEVICE_PATH_LENGTH (dp) - 4) - / sizeof (grub_efi_char16_t)); - fp = (grub_efi_file_path_device_path_t *) dp; + len = ((VasEBoot_EFI_DEVICE_PATH_LENGTH (dp) - 4) + / sizeof (VasEBoot_efi_char16_t)); + fp = (VasEBoot_efi_file_path_device_path_t *) dp; /* According to EFI spec Path Name is NULL terminated */ while (len > 0 && fp->path_name[len - 1] == 0) len--; - p = (char *) grub_utf16_to_utf8 ((unsigned char *) p, fp->path_name, len); + p = (char *) VasEBoot_utf16_to_utf8 ((unsigned char *) p, fp->path_name, len); } - dp = GRUB_EFI_NEXT_DEVICE_PATH (dp); + dp = VasEBoot_EFI_NEXT_DEVICE_PATH (dp); } *p = '\0'; @@ -423,59 +423,59 @@ grub_efi_get_filename (grub_efi_device_path_t *dp0) return name; } -grub_efi_device_path_t * -grub_efi_get_device_path (grub_efi_handle_t handle) +VasEBoot_efi_device_path_t * +VasEBoot_efi_get_device_path (VasEBoot_efi_handle_t handle) { - return grub_efi_open_protocol (handle, &device_path_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + return VasEBoot_efi_open_protocol (handle, &device_path_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); } /* Return the device path node right before the end node. */ -grub_efi_device_path_t * -grub_efi_find_last_device_path (const grub_efi_device_path_t *dp) +VasEBoot_efi_device_path_t * +VasEBoot_efi_find_last_device_path (const VasEBoot_efi_device_path_t *dp) { - grub_efi_device_path_t *next, *p; + VasEBoot_efi_device_path_t *next, *p; - if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) + if (VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (dp)) return 0; - for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); - ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); - p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) + for (p = (VasEBoot_efi_device_path_t *) dp, next = VasEBoot_EFI_NEXT_DEVICE_PATH (p); + ! VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (next); + p = next, next = VasEBoot_EFI_NEXT_DEVICE_PATH (next)) ; return p; } /* Duplicate a device path. */ -grub_efi_device_path_t * -grub_efi_duplicate_device_path (const grub_efi_device_path_t *dp) +VasEBoot_efi_device_path_t * +VasEBoot_efi_duplicate_device_path (const VasEBoot_efi_device_path_t *dp) { - grub_efi_device_path_t *p; - grub_size_t total_size = 0; + VasEBoot_efi_device_path_t *p; + VasEBoot_size_t total_size = 0; - for (p = (grub_efi_device_path_t *) dp; + for (p = (VasEBoot_efi_device_path_t *) dp; ; - p = GRUB_EFI_NEXT_DEVICE_PATH (p)) + p = VasEBoot_EFI_NEXT_DEVICE_PATH (p)) { - total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); - if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) + total_size += VasEBoot_EFI_DEVICE_PATH_LENGTH (p); + if (VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (p)) break; } - p = grub_malloc (total_size); + p = VasEBoot_malloc (total_size); if (! p) return 0; - grub_memcpy (p, dp, total_size); + VasEBoot_memcpy (p, dp, total_size); return p; } static void -dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor) +dump_vendor_path (const char *type, VasEBoot_efi_vendor_device_path_t *vendor) { - grub_uint32_t vendor_data_len = vendor->header.length - sizeof (*vendor); - grub_printf ("/%sVendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)[%x: ", + VasEBoot_uint32_t vendor_data_len = vendor->header.length - sizeof (*vendor); + VasEBoot_printf ("/%sVendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)[%x: ", type, (unsigned) vendor->vendor_guid.data1, (unsigned) vendor->vendor_guid.data2, @@ -491,183 +491,183 @@ dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor) vendor_data_len); if (vendor->header.length > sizeof (*vendor)) { - grub_uint32_t i; + VasEBoot_uint32_t i; for (i = 0; i < vendor_data_len; i++) - grub_printf ("%02x ", vendor->vendor_defined_data[i]); + VasEBoot_printf ("%02x ", vendor->vendor_defined_data[i]); } - grub_printf ("]"); + VasEBoot_printf ("]"); } /* Print the chain of Device Path nodes. This is mainly for debugging. */ void -grub_efi_print_device_path (grub_efi_device_path_t *dp) +VasEBoot_efi_print_device_path (VasEBoot_efi_device_path_t *dp) { while (1) { - grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); - grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); - grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp); + VasEBoot_efi_uint8_t type = VasEBoot_EFI_DEVICE_PATH_TYPE (dp); + VasEBoot_efi_uint8_t subtype = VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp); + VasEBoot_efi_uint16_t len = VasEBoot_EFI_DEVICE_PATH_LENGTH (dp); switch (type) { - case GRUB_EFI_END_DEVICE_PATH_TYPE: + case VasEBoot_EFI_END_DEVICE_PATH_TYPE: switch (subtype) { - case GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE: - grub_printf ("/EndEntire\n"); - //grub_putchar ('\n'); + case VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE: + VasEBoot_printf ("/EndEntire\n"); + //VasEBoot_putchar ('\n'); break; - case GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE: - grub_printf ("/EndThis\n"); - //grub_putchar ('\n'); + case VasEBoot_EFI_END_THIS_DEVICE_PATH_SUBTYPE: + VasEBoot_printf ("/EndThis\n"); + //VasEBoot_putchar ('\n'); break; default: - grub_printf ("/EndUnknown(%x)\n", (unsigned) subtype); + VasEBoot_printf ("/EndUnknown(%x)\n", (unsigned) subtype); break; } break; - case GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE: + case VasEBoot_EFI_HARDWARE_DEVICE_PATH_TYPE: switch (subtype) { - case GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_PCI_DEVICE_PATH_SUBTYPE: { - grub_efi_pci_device_path_t *pci - = (grub_efi_pci_device_path_t *) dp; - grub_printf ("/PCI(%x,%x)", + VasEBoot_efi_pci_device_path_t *pci + = (VasEBoot_efi_pci_device_path_t *) dp; + VasEBoot_printf ("/PCI(%x,%x)", (unsigned) pci->function, (unsigned) pci->device); } break; - case GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_PCCARD_DEVICE_PATH_SUBTYPE: { - grub_efi_pccard_device_path_t *pccard - = (grub_efi_pccard_device_path_t *) dp; - grub_printf ("/PCCARD(%x)", + VasEBoot_efi_pccard_device_path_t *pccard + = (VasEBoot_efi_pccard_device_path_t *) dp; + VasEBoot_printf ("/PCCARD(%x)", (unsigned) pccard->function); } break; - case GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE: { - grub_efi_memory_mapped_device_path_t *mmapped - = (grub_efi_memory_mapped_device_path_t *) dp; - grub_printf ("/MMap(%x,%llx,%llx)", + VasEBoot_efi_memory_mapped_device_path_t *mmapped + = (VasEBoot_efi_memory_mapped_device_path_t *) dp; + VasEBoot_printf ("/MMap(%x,%llx,%llx)", (unsigned) mmapped->memory_type, (unsigned long long) mmapped->start_address, (unsigned long long) mmapped->end_address); } break; - case GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_VENDOR_DEVICE_PATH_SUBTYPE: dump_vendor_path ("Hardware", - (grub_efi_vendor_device_path_t *) dp); + (VasEBoot_efi_vendor_device_path_t *) dp); break; - case GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE: { - grub_efi_controller_device_path_t *controller - = (grub_efi_controller_device_path_t *) dp; - grub_printf ("/Ctrl(%x)", + VasEBoot_efi_controller_device_path_t *controller + = (VasEBoot_efi_controller_device_path_t *) dp; + VasEBoot_printf ("/Ctrl(%x)", (unsigned) controller->controller_number); } break; default: - grub_printf ("/UnknownHW(%x)", (unsigned) subtype); + VasEBoot_printf ("/UnknownHW(%x)", (unsigned) subtype); break; } break; - case GRUB_EFI_ACPI_DEVICE_PATH_TYPE: + case VasEBoot_EFI_ACPI_DEVICE_PATH_TYPE: switch (subtype) { - case GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_ACPI_DEVICE_PATH_SUBTYPE: { - grub_efi_acpi_device_path_t *acpi - = (grub_efi_acpi_device_path_t *) dp; - grub_printf ("/ACPI(%x,%x)", + VasEBoot_efi_acpi_device_path_t *acpi + = (VasEBoot_efi_acpi_device_path_t *) dp; + VasEBoot_printf ("/ACPI(%x,%x)", (unsigned) acpi->hid, (unsigned) acpi->uid); } break; - case GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE: { - grub_efi_expanded_acpi_device_path_t *eacpi - = (grub_efi_expanded_acpi_device_path_t *) dp; - grub_printf ("/ACPI("); + VasEBoot_efi_expanded_acpi_device_path_t *eacpi + = (VasEBoot_efi_expanded_acpi_device_path_t *) dp; + VasEBoot_printf ("/ACPI("); - if (GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)[0] == '\0') - grub_printf ("%x,", (unsigned) eacpi->hid); + if (VasEBoot_EFI_EXPANDED_ACPI_HIDSTR (dp)[0] == '\0') + VasEBoot_printf ("%x,", (unsigned) eacpi->hid); else - grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)); + VasEBoot_printf ("%s,", VasEBoot_EFI_EXPANDED_ACPI_HIDSTR (dp)); - if (GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)[0] == '\0') - grub_printf ("%x,", (unsigned) eacpi->uid); + if (VasEBoot_EFI_EXPANDED_ACPI_UIDSTR (dp)[0] == '\0') + VasEBoot_printf ("%x,", (unsigned) eacpi->uid); else - grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)); + VasEBoot_printf ("%s,", VasEBoot_EFI_EXPANDED_ACPI_UIDSTR (dp)); - if (GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp)[0] == '\0') - grub_printf ("%x)", (unsigned) eacpi->cid); + if (VasEBoot_EFI_EXPANDED_ACPI_CIDSTR (dp)[0] == '\0') + VasEBoot_printf ("%x)", (unsigned) eacpi->cid); else - grub_printf ("%s)", GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp)); + VasEBoot_printf ("%s)", VasEBoot_EFI_EXPANDED_ACPI_CIDSTR (dp)); } break; default: - grub_printf ("/UnknownACPI(%x)", (unsigned) subtype); + VasEBoot_printf ("/UnknownACPI(%x)", (unsigned) subtype); break; } break; - case GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE: + case VasEBoot_EFI_MESSAGING_DEVICE_PATH_TYPE: switch (subtype) { - case GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_ATAPI_DEVICE_PATH_SUBTYPE: { - grub_efi_atapi_device_path_t *atapi - = (grub_efi_atapi_device_path_t *) dp; - grub_printf ("/ATAPI(%x,%x,%x)", + VasEBoot_efi_atapi_device_path_t *atapi + = (VasEBoot_efi_atapi_device_path_t *) dp; + VasEBoot_printf ("/ATAPI(%x,%x,%x)", (unsigned) atapi->primary_secondary, (unsigned) atapi->slave_master, (unsigned) atapi->lun); } break; - case GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_SCSI_DEVICE_PATH_SUBTYPE: { - grub_efi_scsi_device_path_t *scsi - = (grub_efi_scsi_device_path_t *) dp; - grub_printf ("/SCSI(%x,%x)", + VasEBoot_efi_scsi_device_path_t *scsi + = (VasEBoot_efi_scsi_device_path_t *) dp; + VasEBoot_printf ("/SCSI(%x,%x)", (unsigned) scsi->pun, (unsigned) scsi->lun); } break; - case GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE: { - grub_efi_fibre_channel_device_path_t *fc - = (grub_efi_fibre_channel_device_path_t *) dp; - grub_printf ("/FibreChannel(%llx,%llx)", + VasEBoot_efi_fibre_channel_device_path_t *fc + = (VasEBoot_efi_fibre_channel_device_path_t *) dp; + VasEBoot_printf ("/FibreChannel(%llx,%llx)", (unsigned long long) fc->wwn, (unsigned long long) fc->lun); } break; - case GRUB_EFI_1394_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_1394_DEVICE_PATH_SUBTYPE: { - grub_efi_1394_device_path_t *firewire - = (grub_efi_1394_device_path_t *) dp; - grub_printf ("/1394(%llx)", + VasEBoot_efi_1394_device_path_t *firewire + = (VasEBoot_efi_1394_device_path_t *) dp; + VasEBoot_printf ("/1394(%llx)", (unsigned long long) firewire->guid); } break; - case GRUB_EFI_USB_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_USB_DEVICE_PATH_SUBTYPE: { - grub_efi_usb_device_path_t *usb - = (grub_efi_usb_device_path_t *) dp; - grub_printf ("/USB(%x,%x)", + VasEBoot_efi_usb_device_path_t *usb + = (VasEBoot_efi_usb_device_path_t *) dp; + VasEBoot_printf ("/USB(%x,%x)", (unsigned) usb->parent_port_number, (unsigned) usb->usb_interface); } break; - case GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE: { - grub_efi_usb_class_device_path_t *usb_class - = (grub_efi_usb_class_device_path_t *) dp; - grub_printf ("/USBClass(%x,%x,%x,%x,%x)", + VasEBoot_efi_usb_class_device_path_t *usb_class + = (VasEBoot_efi_usb_class_device_path_t *) dp; + VasEBoot_printf ("/USBClass(%x,%x,%x,%x,%x)", (unsigned) usb_class->vendor_id, (unsigned) usb_class->product_id, (unsigned) usb_class->device_class, @@ -675,18 +675,18 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) (unsigned) usb_class->device_protocol); } break; - case GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_I2O_DEVICE_PATH_SUBTYPE: { - grub_efi_i2o_device_path_t *i2o - = (grub_efi_i2o_device_path_t *) dp; - grub_printf ("/I2O(%x)", (unsigned) i2o->tid); + VasEBoot_efi_i2o_device_path_t *i2o + = (VasEBoot_efi_i2o_device_path_t *) dp; + VasEBoot_printf ("/I2O(%x)", (unsigned) i2o->tid); } break; - case GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE: { - grub_efi_mac_address_device_path_t *mac - = (grub_efi_mac_address_device_path_t *) dp; - grub_printf ("/MacAddr(%02x:%02x:%02x:%02x:%02x:%02x,%x)", + VasEBoot_efi_mac_address_device_path_t *mac + = (VasEBoot_efi_mac_address_device_path_t *) dp; + VasEBoot_printf ("/MacAddr(%02x:%02x:%02x:%02x:%02x:%02x,%x)", (unsigned) mac->mac_address[0], (unsigned) mac->mac_address[1], (unsigned) mac->mac_address[2], @@ -696,11 +696,11 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) (unsigned) mac->if_type); } break; - case GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_IPV4_DEVICE_PATH_SUBTYPE: { - grub_efi_ipv4_device_path_t *ipv4 - = (grub_efi_ipv4_device_path_t *) dp; - grub_printf ("/IPv4(%u.%u.%u.%u,%u.%u.%u.%u,%u,%u,%x,%x)", + VasEBoot_efi_ipv4_device_path_t *ipv4 + = (VasEBoot_efi_ipv4_device_path_t *) dp; + VasEBoot_printf ("/IPv4(%u.%u.%u.%u,%u.%u.%u.%u,%u,%u,%x,%x)", (unsigned) ipv4->local_ip_address[0], (unsigned) ipv4->local_ip_address[1], (unsigned) ipv4->local_ip_address[2], @@ -715,11 +715,11 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) (unsigned) ipv4->static_ip_address); } break; - case GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_IPV6_DEVICE_PATH_SUBTYPE: { - grub_efi_ipv6_device_path_t *ipv6 - = (grub_efi_ipv6_device_path_t *) dp; - grub_printf ("/IPv6(%x:%x:%x:%x:%x:%x:%x:%x,%x:%x:%x:%x:%x:%x:%x:%x,%u,%u,%x,%x)", + VasEBoot_efi_ipv6_device_path_t *ipv6 + = (VasEBoot_efi_ipv6_device_path_t *) dp; + VasEBoot_printf ("/IPv6(%x:%x:%x:%x:%x:%x:%x:%x,%x:%x:%x:%x:%x:%x:%x:%x,%u,%u,%x,%x)", (unsigned) ipv6->local_ip_address[0], (unsigned) ipv6->local_ip_address[1], (unsigned) ipv6->local_ip_address[2], @@ -742,56 +742,56 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) (unsigned) ipv6->static_ip_address); } break; - case GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE: { - grub_efi_infiniband_device_path_t *ib - = (grub_efi_infiniband_device_path_t *) dp; - grub_printf ("/InfiniBand(%x,%llx,%llx,%llx)", + VasEBoot_efi_infiniband_device_path_t *ib + = (VasEBoot_efi_infiniband_device_path_t *) dp; + VasEBoot_printf ("/InfiniBand(%x,%llx,%llx,%llx)", (unsigned) ib->port_gid[0], /* XXX */ (unsigned long long) ib->remote_id, (unsigned long long) ib->target_port_id, (unsigned long long) ib->device_id); } break; - case GRUB_EFI_UART_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_UART_DEVICE_PATH_SUBTYPE: { - grub_efi_uart_device_path_t *uart - = (grub_efi_uart_device_path_t *) dp; - grub_printf ("/UART(%llu,%u,%x,%x)", + VasEBoot_efi_uart_device_path_t *uart + = (VasEBoot_efi_uart_device_path_t *) dp; + VasEBoot_printf ("/UART(%llu,%u,%x,%x)", (unsigned long long) uart->baud_rate, uart->data_bits, uart->parity, uart->stop_bits); } break; - case GRUB_EFI_SATA_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_SATA_DEVICE_PATH_SUBTYPE: { - grub_efi_sata_device_path_t *sata; - sata = (grub_efi_sata_device_path_t *) dp; - grub_printf ("/Sata(%x,%x,%x)", + VasEBoot_efi_sata_device_path_t *sata; + sata = (VasEBoot_efi_sata_device_path_t *) dp; + VasEBoot_printf ("/Sata(%x,%x,%x)", sata->hba_port, sata->multiplier_port, sata->lun); } break; - case GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE: dump_vendor_path ("Messaging", - (grub_efi_vendor_device_path_t *) dp); + (VasEBoot_efi_vendor_device_path_t *) dp); break; default: - grub_printf ("/UnknownMessaging(%x)", (unsigned) subtype); + VasEBoot_printf ("/UnknownMessaging(%x)", (unsigned) subtype); break; } break; - case GRUB_EFI_MEDIA_DEVICE_PATH_TYPE: + case VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE: switch (subtype) { - case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE: { - grub_efi_hard_drive_device_path_t *hd = (grub_efi_hard_drive_device_path_t *) dp; - grub_printf ("/HD(%u,%llx,%llx,%02x%02x%02x%02x%02x%02x%02x%02x,%x,%x)", + VasEBoot_efi_hard_drive_device_path_t *hd = (VasEBoot_efi_hard_drive_device_path_t *) dp; + VasEBoot_printf ("/HD(%u,%llx,%llx,%02x%02x%02x%02x%02x%02x%02x%02x,%x,%x)", hd->partition_number, (unsigned long long) hd->partition_start, (unsigned long long) hd->partition_size, @@ -807,41 +807,41 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) (unsigned) hd->signature_type); } break; - case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_CDROM_DEVICE_PATH_SUBTYPE: { - grub_efi_cdrom_device_path_t *cd - = (grub_efi_cdrom_device_path_t *) dp; - grub_printf ("/CD(%u,%llx,%llx)", + VasEBoot_efi_cdrom_device_path_t *cd + = (VasEBoot_efi_cdrom_device_path_t *) dp; + VasEBoot_printf ("/CD(%u,%llx,%llx)", cd->boot_entry, (unsigned long long) cd->partition_start, (unsigned long long) cd->partition_size); } break; - case GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE: dump_vendor_path ("Media", - (grub_efi_vendor_device_path_t *) dp); + (VasEBoot_efi_vendor_device_path_t *) dp); break; - case GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE: { - grub_efi_file_path_device_path_t *fp; - grub_uint8_t *buf; - fp = (grub_efi_file_path_device_path_t *) dp; - buf = grub_malloc ((len - 4) * 2 + 1); + VasEBoot_efi_file_path_device_path_t *fp; + VasEBoot_uint8_t *buf; + fp = (VasEBoot_efi_file_path_device_path_t *) dp; + buf = VasEBoot_malloc ((len - 4) * 2 + 1); if (buf) - *grub_utf16_to_utf8 (buf, fp->path_name, - (len - 4) / sizeof (grub_efi_char16_t)) + *VasEBoot_utf16_to_utf8 (buf, fp->path_name, + (len - 4) / sizeof (VasEBoot_efi_char16_t)) = '\0'; else - grub_errno = GRUB_ERR_NONE; - grub_printf ("/File(%s)", buf); - grub_free (buf); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_printf ("/File(%s)", buf); + VasEBoot_free (buf); } break; - case GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE: { - grub_efi_protocol_device_path_t *proto - = (grub_efi_protocol_device_path_t *) dp; - grub_printf ("/Protocol(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)", + VasEBoot_efi_protocol_device_path_t *proto + = (VasEBoot_efi_protocol_device_path_t *) dp; + VasEBoot_printf ("/Protocol(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)", (unsigned) proto->guid.data1, (unsigned) proto->guid.data2, (unsigned) proto->guid.data3, @@ -856,49 +856,49 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) } break; default: - grub_printf ("/UnknownMedia(%x)", (unsigned) subtype); + VasEBoot_printf ("/UnknownMedia(%x)", (unsigned) subtype); break; } break; - case GRUB_EFI_BIOS_DEVICE_PATH_TYPE: + case VasEBoot_EFI_BIOS_DEVICE_PATH_TYPE: switch (subtype) { - case GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE: + case VasEBoot_EFI_BIOS_DEVICE_PATH_SUBTYPE: { - grub_efi_bios_device_path_t *bios - = (grub_efi_bios_device_path_t *) dp; - grub_printf ("/BIOS(%x,%x,%s)", + VasEBoot_efi_bios_device_path_t *bios + = (VasEBoot_efi_bios_device_path_t *) dp; + VasEBoot_printf ("/BIOS(%x,%x,%s)", (unsigned) bios->device_type, (unsigned) bios->status_flags, (char *) (dp + 1)); } break; default: - grub_printf ("/UnknownBIOS(%x)", (unsigned) subtype); + VasEBoot_printf ("/UnknownBIOS(%x)", (unsigned) subtype); break; } break; default: - grub_printf ("/UnknownType(%x,%x)\n", + VasEBoot_printf ("/UnknownType(%x,%x)\n", (unsigned) type, (unsigned) subtype); return; break; } - if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) + if (VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (dp)) break; - dp = (grub_efi_device_path_t *) ((char *) dp + len); + dp = (VasEBoot_efi_device_path_t *) ((char *) dp + len); } } /* Compare device paths. */ int -grub_efi_compare_device_paths (const grub_efi_device_path_t *dp1, - const grub_efi_device_path_t *dp2) +VasEBoot_efi_compare_device_paths (const VasEBoot_efi_device_path_t *dp1, + const VasEBoot_efi_device_path_t *dp2) { if (! dp1 || ! dp2) /* Return non-zero. */ @@ -906,38 +906,38 @@ grub_efi_compare_device_paths (const grub_efi_device_path_t *dp1, while (1) { - grub_efi_uint8_t type1, type2; - grub_efi_uint8_t subtype1, subtype2; - grub_efi_uint16_t len1, len2; + VasEBoot_efi_uint8_t type1, type2; + VasEBoot_efi_uint8_t subtype1, subtype2; + VasEBoot_efi_uint16_t len1, len2; int ret; - type1 = GRUB_EFI_DEVICE_PATH_TYPE (dp1); - type2 = GRUB_EFI_DEVICE_PATH_TYPE (dp2); + type1 = VasEBoot_EFI_DEVICE_PATH_TYPE (dp1); + type2 = VasEBoot_EFI_DEVICE_PATH_TYPE (dp2); if (type1 != type2) return (int) type2 - (int) type1; - subtype1 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp1); - subtype2 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp2); + subtype1 = VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp1); + subtype2 = VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp2); if (subtype1 != subtype2) return (int) subtype1 - (int) subtype2; - len1 = GRUB_EFI_DEVICE_PATH_LENGTH (dp1); - len2 = GRUB_EFI_DEVICE_PATH_LENGTH (dp2); + len1 = VasEBoot_EFI_DEVICE_PATH_LENGTH (dp1); + len2 = VasEBoot_EFI_DEVICE_PATH_LENGTH (dp2); if (len1 != len2) return (int) len1 - (int) len2; - ret = grub_memcmp (dp1, dp2, len1); + ret = VasEBoot_memcmp (dp1, dp2, len1); if (ret != 0) return ret; - if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp1)) + if (VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (dp1)) break; - dp1 = (grub_efi_device_path_t *) ((char *) dp1 + len1); - dp2 = (grub_efi_device_path_t *) ((char *) dp2 + len2); + dp1 = (VasEBoot_efi_device_path_t *) ((char *) dp1 + len1); + dp2 = (VasEBoot_efi_device_path_t *) ((char *) dp2 + len2); } return 0; diff --git a/VasEBoot-core/kern/efi/fdt.c b/VasEBoot-core/kern/efi/fdt.c index 30100c61c..32e0ea9ad 100644 --- a/VasEBoot-core/kern/efi/fdt.c +++ b/VasEBoot-core/kern/efi/fdt.c @@ -1,41 +1,41 @@ /* fdt.c - EFI Flattened Device Tree interaction */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include void * -grub_efi_get_firmware_fdt (void) +VasEBoot_efi_get_firmware_fdt (void) { - grub_efi_configuration_table_t *tables; - grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; + VasEBoot_efi_configuration_table_t *tables; + VasEBoot_efi_guid_t fdt_guid = VasEBoot_EFI_DEVICE_TREE_GUID; void *firmware_fdt = NULL; unsigned int i; /* Look for FDT in UEFI config tables. */ - tables = grub_efi_system_table->configuration_table; + tables = VasEBoot_efi_system_table->configuration_table; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) + for (i = 0; i < VasEBoot_efi_system_table->num_table_entries; i++) + if (VasEBoot_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) { firmware_fdt = tables[i].vendor_table; - grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); + VasEBoot_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); break; } diff --git a/VasEBoot-core/kern/efi/init.c b/VasEBoot-core/kern/efi/init.c index 2c31847bf..928872fb1 100644 --- a/VasEBoot-core/kern/efi/init.c +++ b/VasEBoot-core/kern/efi/init.c @@ -1,83 +1,83 @@ /* init.c - generic EFI initialization and finalization */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_addr_t grub_modbase; +VasEBoot_addr_t VasEBoot_modbase; void -grub_efi_init (void) +VasEBoot_efi_init (void) { - grub_modbase = grub_efi_modules_addr (); - /* First of all, initialize the console so that GRUB can display + VasEBoot_modbase = VasEBoot_efi_modules_addr (); + /* First of all, initialize the console so that VasEBoot can display messages. */ - grub_console_init (); + VasEBoot_console_init (); /* Initialize the memory management system. */ - grub_efi_mm_init (); + VasEBoot_efi_mm_init (); - efi_call_4 (grub_efi_system_table->boot_services->set_watchdog_timer, + efi_call_4 (VasEBoot_efi_system_table->boot_services->set_watchdog_timer, 0, 0, 0, NULL); - grub_efidisk_init (); + VasEBoot_efidisk_init (); } -void (*grub_efi_net_config) (grub_efi_handle_t hnd, +void (*VasEBoot_efi_net_config) (VasEBoot_efi_handle_t hnd, char **device, char **path); void -grub_machine_get_bootlocation (char **device, char **path) +VasEBoot_machine_get_bootlocation (char **device, char **path) { - grub_efi_loaded_image_t *image = NULL; + VasEBoot_efi_loaded_image_t *image = NULL; char *p; - image = grub_efi_get_loaded_image (grub_efi_image_handle); + image = VasEBoot_efi_get_loaded_image (VasEBoot_efi_image_handle); if (!image) return; - *device = grub_efidisk_get_device_name (image->device_handle); - if (!*device && grub_efi_net_config) + *device = VasEBoot_efidisk_get_device_name (image->device_handle); + if (!*device && VasEBoot_efi_net_config) { - grub_efi_net_config (image->device_handle, device, path); + VasEBoot_efi_net_config (image->device_handle, device, path); return; } - *path = grub_efi_get_filename (image->file_path); + *path = VasEBoot_efi_get_filename (image->file_path); if (*path) { /* Get the directory. */ - p = grub_strrchr (*path, '/'); + p = VasEBoot_strrchr (*path, '/'); if (p) *p = '\0'; } } void -grub_efi_fini (void) +VasEBoot_efi_fini (void) { - grub_efidisk_fini (); - grub_console_fini (); + VasEBoot_efidisk_fini (); + VasEBoot_console_fini (); } diff --git a/VasEBoot-core/kern/efi/mm.c b/VasEBoot-core/kern/efi/mm.c index efb15cc1b..8373564f1 100644 --- a/VasEBoot-core/kern/efi/mm.c +++ b/VasEBoot-core/kern/efi/mm.c @@ -1,34 +1,34 @@ /* mm.c - generic EFI memory management */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #if defined (__i386__) || defined (__x86_64__) -#include +#include #endif #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ - ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + ((VasEBoot_efi_memory_descriptor_t *) ((char *) (desc) + (size))) #define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12) #define BYTES_TO_PAGES_DOWN(bytes) ((bytes) >> 12) @@ -38,33 +38,33 @@ a multiplier of 4KB. */ #define MEMORY_MAP_SIZE 0x3000 -/* The minimum and maximum heap size for GRUB itself. */ +/* The minimum and maximum heap size for VasEBoot itself. */ #define MIN_HEAP_SIZE 0x100000 #define MAX_HEAP_SIZE (1600 * 0x100000) static void *finish_mmap_buf = 0; -static grub_efi_uintn_t finish_mmap_size = 0; -static grub_efi_uintn_t finish_key = 0; -static grub_efi_uintn_t finish_desc_size; -static grub_efi_uint32_t finish_desc_version; -int grub_efi_is_finished = 0; +static VasEBoot_efi_uintn_t finish_mmap_size = 0; +static VasEBoot_efi_uintn_t finish_key = 0; +static VasEBoot_efi_uintn_t finish_desc_size; +static VasEBoot_efi_uint32_t finish_desc_version; +int VasEBoot_efi_is_finished = 0; /* Allocate pages below a specified address */ void * -grub_efi_allocate_pages_max (grub_efi_physical_address_t max, - grub_efi_uintn_t pages) +VasEBoot_efi_allocate_pages_max (VasEBoot_efi_physical_address_t max, + VasEBoot_efi_uintn_t pages) { - grub_efi_status_t status; - grub_efi_boot_services_t *b; - grub_efi_physical_address_t address = max; + VasEBoot_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_physical_address_t address = max; if (max > 0xffffffff) return 0; - b = grub_efi_system_table->boot_services; - status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, GRUB_EFI_LOADER_DATA, pages, &address); + b = VasEBoot_efi_system_table->boot_services; + status = efi_call_4 (b->allocate_pages, VasEBoot_EFI_ALLOCATE_MAX_ADDRESS, VasEBoot_EFI_LOADER_DATA, pages, &address); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) return 0; if (address == 0) @@ -72,72 +72,72 @@ grub_efi_allocate_pages_max (grub_efi_physical_address_t max, /* Uggh, the address 0 was allocated... This is too annoying, so reallocate another one. */ address = max; - status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, GRUB_EFI_LOADER_DATA, pages, &address); - grub_efi_free_pages (0, pages); - if (status != GRUB_EFI_SUCCESS) + status = efi_call_4 (b->allocate_pages, VasEBoot_EFI_ALLOCATE_MAX_ADDRESS, VasEBoot_EFI_LOADER_DATA, pages, &address); + VasEBoot_efi_free_pages (0, pages); + if (status != VasEBoot_EFI_SUCCESS) return 0; } - return (void *) ((grub_addr_t) address); + return (void *) ((VasEBoot_addr_t) address); } /* Allocate pages. Return the pointer to the first of allocated pages. */ void * -grub_efi_allocate_pages (grub_efi_physical_address_t address, - grub_efi_uintn_t pages) +VasEBoot_efi_allocate_pages (VasEBoot_efi_physical_address_t address, + VasEBoot_efi_uintn_t pages) { - grub_efi_allocate_type_t type; - grub_efi_status_t status; - grub_efi_boot_services_t *b; + VasEBoot_efi_allocate_type_t type; + VasEBoot_efi_status_t status; + VasEBoot_efi_boot_services_t *b; #if 1 /* Limit the memory access to less than 4GB for 32-bit platforms. */ - if (address > GRUB_EFI_MAX_USABLE_ADDRESS) + if (address > VasEBoot_EFI_MAX_USABLE_ADDRESS) return 0; #endif #if 1 if (address == 0) { - type = GRUB_EFI_ALLOCATE_MAX_ADDRESS; - address = GRUB_EFI_MAX_USABLE_ADDRESS; + type = VasEBoot_EFI_ALLOCATE_MAX_ADDRESS; + address = VasEBoot_EFI_MAX_USABLE_ADDRESS; } else - type = GRUB_EFI_ALLOCATE_ADDRESS; + type = VasEBoot_EFI_ALLOCATE_ADDRESS; #else if (address == 0) - type = GRUB_EFI_ALLOCATE_ANY_PAGES; + type = VasEBoot_EFI_ALLOCATE_ANY_PAGES; else - type = GRUB_EFI_ALLOCATE_ADDRESS; + type = VasEBoot_EFI_ALLOCATE_ADDRESS; #endif - b = grub_efi_system_table->boot_services; - status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address); - if (status != GRUB_EFI_SUCCESS) + b = VasEBoot_efi_system_table->boot_services; + status = efi_call_4 (b->allocate_pages, type, VasEBoot_EFI_LOADER_DATA, pages, &address); + if (status != VasEBoot_EFI_SUCCESS) return 0; if (address == 0) { /* Uggh, the address 0 was allocated... This is too annoying, so reallocate another one. */ - address = GRUB_EFI_MAX_USABLE_ADDRESS; - status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address); - grub_efi_free_pages (0, pages); - if (status != GRUB_EFI_SUCCESS) + address = VasEBoot_EFI_MAX_USABLE_ADDRESS; + status = efi_call_4 (b->allocate_pages, type, VasEBoot_EFI_LOADER_DATA, pages, &address); + VasEBoot_efi_free_pages (0, pages); + if (status != VasEBoot_EFI_SUCCESS) return 0; } - return (void *) ((grub_addr_t) address); + return (void *) ((VasEBoot_addr_t) address); } /* Free pages starting from ADDRESS. */ void -grub_efi_free_pages (grub_efi_physical_address_t address, - grub_efi_uintn_t pages) +VasEBoot_efi_free_pages (VasEBoot_efi_physical_address_t address, + VasEBoot_efi_uintn_t pages) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; efi_call_2 (b->free_pages, address, pages); } @@ -145,95 +145,95 @@ grub_efi_free_pages (grub_efi_physical_address_t address, /* Helper for stop_broadcom. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_pci_address_t addr; - grub_uint8_t cap; - grub_uint16_t pm_state; + VasEBoot_pci_address_t addr; + VasEBoot_uint8_t cap; + VasEBoot_uint16_t pm_state; - if ((pciid & 0xffff) != GRUB_PCI_VENDOR_BROADCOM) + if ((pciid & 0xffff) != VasEBoot_PCI_VENDOR_BROADCOM) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - if (grub_pci_read (addr) >> 24 != GRUB_PCI_CLASS_NETWORK) + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + if (VasEBoot_pci_read (addr) >> 24 != VasEBoot_PCI_CLASS_NETWORK) return 0; - cap = grub_pci_find_capability (dev, GRUB_PCI_CAP_POWER_MANAGEMENT); + cap = VasEBoot_pci_find_capability (dev, VasEBoot_PCI_CAP_POWER_MANAGEMENT); if (!cap) return 0; - addr = grub_pci_make_address (dev, cap + 4); - pm_state = grub_pci_read_word (addr); + addr = VasEBoot_pci_make_address (dev, cap + 4); + pm_state = VasEBoot_pci_read_word (addr); pm_state = pm_state | 0x03; - grub_pci_write_word (addr, pm_state); - grub_pci_read_word (addr); + VasEBoot_pci_write_word (addr, pm_state); + VasEBoot_pci_read_word (addr); return 0; } static void stop_broadcom (void) { - grub_pci_iterate (find_card, NULL); + VasEBoot_pci_iterate (find_card, NULL); } #endif -grub_err_t -grub_efi_finish_boot_services (grub_efi_uintn_t *outbuf_size, void *outbuf, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *efi_desc_size, - grub_efi_uint32_t *efi_desc_version) +VasEBoot_err_t +VasEBoot_efi_finish_boot_services (VasEBoot_efi_uintn_t *outbuf_size, void *outbuf, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *efi_desc_size, + VasEBoot_efi_uint32_t *efi_desc_version) { - grub_efi_boot_services_t *b; - grub_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_status_t status; #if defined (__i386__) || defined (__x86_64__) - const grub_uint16_t apple[] = { 'A', 'p', 'p', 'l', 'e' }; + const VasEBoot_uint16_t apple[] = { 'A', 'p', 'p', 'l', 'e' }; int is_apple; - is_apple = (grub_memcmp (grub_efi_system_table->firmware_vendor, + is_apple = (VasEBoot_memcmp (VasEBoot_efi_system_table->firmware_vendor, apple, sizeof (apple)) == 0); #endif while (1) { - if (grub_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key, + if (VasEBoot_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key, &finish_desc_size, &finish_desc_version) < 0) - return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map"); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't retrieve memory map"); if (outbuf && *outbuf_size < finish_mmap_size) - return grub_error (GRUB_ERR_IO, "memory map buffer is too small"); + return VasEBoot_error (VasEBoot_ERR_IO, "memory map buffer is too small"); - finish_mmap_buf = grub_malloc (finish_mmap_size); + finish_mmap_buf = VasEBoot_malloc (finish_mmap_size); if (!finish_mmap_buf) - return grub_errno; + return VasEBoot_errno; - if (grub_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key, + if (VasEBoot_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key, &finish_desc_size, &finish_desc_version) <= 0) { - grub_free (finish_mmap_buf); - return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map"); + VasEBoot_free (finish_mmap_buf); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't retrieve memory map"); } - b = grub_efi_system_table->boot_services; - status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle, + b = VasEBoot_efi_system_table->boot_services; + status = efi_call_2 (b->exit_boot_services, VasEBoot_efi_image_handle, finish_key); - if (status == GRUB_EFI_SUCCESS) + if (status == VasEBoot_EFI_SUCCESS) break; - if (status != GRUB_EFI_INVALID_PARAMETER) + if (status != VasEBoot_EFI_INVALID_PARAMETER) { - grub_free (finish_mmap_buf); - return grub_error (GRUB_ERR_IO, "couldn't terminate EFI services"); + VasEBoot_free (finish_mmap_buf); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't terminate EFI services"); } - grub_free (finish_mmap_buf); - grub_printf ("Trying to terminate EFI services again\n"); + VasEBoot_free (finish_mmap_buf); + VasEBoot_printf ("Trying to terminate EFI services again\n"); } - grub_efi_is_finished = 1; + VasEBoot_efi_is_finished = 1; if (outbuf_size) *outbuf_size = finish_mmap_size; if (outbuf) - grub_memcpy (outbuf, finish_mmap_buf, finish_mmap_size); + VasEBoot_memcpy (outbuf, finish_mmap_buf, finish_mmap_size); if (map_key) *map_key = finish_key; if (efi_desc_size) @@ -246,35 +246,35 @@ grub_efi_finish_boot_services (grub_efi_uintn_t *outbuf_size, void *outbuf, stop_broadcom (); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Get the memory map as defined in the EFI spec. Return 1 if successful, return 0 if partial, or return -1 if an error occurs. */ int -grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version) +VasEBoot_efi_get_memory_map (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version) { - grub_efi_status_t status; - grub_efi_boot_services_t *b; - grub_efi_uintn_t key; - grub_efi_uint32_t version; - grub_efi_uintn_t size; + VasEBoot_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_uintn_t key; + VasEBoot_efi_uint32_t version; + VasEBoot_efi_uintn_t size; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) { int ret = 1; if (*memory_map_size < finish_mmap_size) { - grub_memcpy (memory_map, finish_mmap_buf, *memory_map_size); + VasEBoot_memcpy (memory_map, finish_mmap_buf, *memory_map_size); ret = 0; } else { - grub_memcpy (memory_map, finish_mmap_buf, finish_mmap_size); + VasEBoot_memcpy (memory_map, finish_mmap_buf, finish_mmap_size); ret = 1; } *memory_map_size = finish_mmap_size; @@ -295,14 +295,14 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, if (! descriptor_size) descriptor_size = &size; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; status = efi_call_5 (b->get_memory_map, memory_map_size, memory_map, map_key, descriptor_size, descriptor_version); if (*descriptor_size == 0) - *descriptor_size = sizeof (grub_efi_memory_descriptor_t); - if (status == GRUB_EFI_SUCCESS) + *descriptor_size = sizeof (VasEBoot_efi_memory_descriptor_t); + if (status == VasEBoot_EFI_SUCCESS) return 1; - else if (status == GRUB_EFI_BUFFER_TOO_SMALL) + else if (status == VasEBoot_EFI_BUFFER_TOO_SMALL) return 0; else return -1; @@ -310,18 +310,18 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, /* Sort the memory map in place. */ static void -sort_memory_map (grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t desc_size, - grub_efi_memory_descriptor_t *memory_map_end) +sort_memory_map (VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t desc_size, + VasEBoot_efi_memory_descriptor_t *memory_map_end) { - grub_efi_memory_descriptor_t *d1; - grub_efi_memory_descriptor_t *d2; + VasEBoot_efi_memory_descriptor_t *d1; + VasEBoot_efi_memory_descriptor_t *d2; for (d1 = memory_map; d1 < memory_map_end; d1 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size)) { - grub_efi_memory_descriptor_t *max_desc = d1; + VasEBoot_efi_memory_descriptor_t *max_desc = d1; for (d2 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size); d2 < memory_map_end; @@ -333,7 +333,7 @@ sort_memory_map (grub_efi_memory_descriptor_t *memory_map, if (max_desc != d1) { - grub_efi_memory_descriptor_t tmp; + VasEBoot_efi_memory_descriptor_t tmp; tmp = *d1; *d1 = *max_desc; @@ -342,28 +342,28 @@ sort_memory_map (grub_efi_memory_descriptor_t *memory_map, } } -/* Filter the descriptors. GRUB needs only available memory. */ -static grub_efi_memory_descriptor_t * -filter_memory_map (grub_efi_memory_descriptor_t *memory_map, - grub_efi_memory_descriptor_t *filtered_memory_map, - grub_efi_uintn_t desc_size, - grub_efi_memory_descriptor_t *memory_map_end) +/* Filter the descriptors. VasEBoot needs only available memory. */ +static VasEBoot_efi_memory_descriptor_t * +filter_memory_map (VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_memory_descriptor_t *filtered_memory_map, + VasEBoot_efi_uintn_t desc_size, + VasEBoot_efi_memory_descriptor_t *memory_map_end) { - grub_efi_memory_descriptor_t *desc; - grub_efi_memory_descriptor_t *filtered_desc; + VasEBoot_efi_memory_descriptor_t *desc; + VasEBoot_efi_memory_descriptor_t *filtered_desc; for (desc = memory_map, filtered_desc = filtered_memory_map; desc < memory_map_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { - if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY + if (desc->type == VasEBoot_EFI_CONVENTIONAL_MEMORY #if 1 - && desc->physical_start <= GRUB_EFI_MAX_USABLE_ADDRESS + && desc->physical_start <= VasEBoot_EFI_MAX_USABLE_ADDRESS #endif && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000 && desc->num_pages != 0) { - grub_memcpy (filtered_desc, desc, desc_size); + VasEBoot_memcpy (filtered_desc, desc, desc_size); /* Avoid less than 1MB, because some loaders seem to be confused. */ if (desc->physical_start < 0x100000) @@ -376,9 +376,9 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, #if 1 if (BYTES_TO_PAGES (filtered_desc->physical_start) + filtered_desc->num_pages - > BYTES_TO_PAGES_DOWN (GRUB_EFI_MAX_USABLE_ADDRESS)) + > BYTES_TO_PAGES_DOWN (VasEBoot_EFI_MAX_USABLE_ADDRESS)) filtered_desc->num_pages - = (BYTES_TO_PAGES_DOWN (GRUB_EFI_MAX_USABLE_ADDRESS) + = (BYTES_TO_PAGES_DOWN (VasEBoot_EFI_MAX_USABLE_ADDRESS) - BYTES_TO_PAGES (filtered_desc->physical_start)); #endif @@ -393,13 +393,13 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, } /* Return the total number of pages. */ -static grub_efi_uint64_t -get_total_pages (grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t desc_size, - grub_efi_memory_descriptor_t *memory_map_end) +static VasEBoot_efi_uint64_t +get_total_pages (VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t desc_size, + VasEBoot_efi_memory_descriptor_t *memory_map_end) { - grub_efi_memory_descriptor_t *desc; - grub_efi_uint64_t total = 0; + VasEBoot_efi_memory_descriptor_t *desc; + VasEBoot_efi_uint64_t total = 0; for (desc = memory_map; desc < memory_map_end; @@ -411,19 +411,19 @@ get_total_pages (grub_efi_memory_descriptor_t *memory_map, /* Add memory regions. */ static void -add_memory_regions (grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t desc_size, - grub_efi_memory_descriptor_t *memory_map_end, - grub_efi_uint64_t required_pages) +add_memory_regions (VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t desc_size, + VasEBoot_efi_memory_descriptor_t *memory_map_end, + VasEBoot_efi_uint64_t required_pages) { - grub_efi_memory_descriptor_t *desc; + VasEBoot_efi_memory_descriptor_t *desc; for (desc = memory_map; desc < memory_map_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { - grub_efi_uint64_t pages; - grub_efi_physical_address_t start; + VasEBoot_efi_uint64_t pages; + VasEBoot_efi_physical_address_t start; void *addr; start = desc->physical_start; @@ -434,13 +434,13 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, pages = required_pages; } - addr = grub_efi_allocate_pages (start, pages); + addr = VasEBoot_efi_allocate_pages (start, pages); if (! addr) - grub_fatal ("cannot allocate conventional memory %p with %u pages", - (void *) ((grub_addr_t) start), + VasEBoot_fatal ("cannot allocate conventional memory %p with %u pages", + (void *) ((VasEBoot_addr_t) start), (unsigned) pages); - grub_mm_init_region (addr, PAGES_TO_BYTES (pages)); + VasEBoot_mm_init_region (addr, PAGES_TO_BYTES (pages)); required_pages -= pages; if (required_pages == 0) @@ -448,24 +448,24 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, } if (required_pages > 0) - grub_fatal ("too little memory"); + VasEBoot_fatal ("too little memory"); } #if 0 /* Print the memory map. */ static void -print_memory_map (grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t desc_size, - grub_efi_memory_descriptor_t *memory_map_end) +print_memory_map (VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t desc_size, + VasEBoot_efi_memory_descriptor_t *memory_map_end) { - grub_efi_memory_descriptor_t *desc; + VasEBoot_efi_memory_descriptor_t *desc; int i; for (desc = memory_map, i = 0; desc < memory_map_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size), i++) { - grub_printf ("MD: t=%x, p=%llx, v=%llx, n=%llx, a=%llx\n", + VasEBoot_printf ("MD: t=%x, p=%llx, v=%llx, n=%llx, a=%llx\n", desc->type, desc->physical_start, desc->virtual_start, desc->num_pages, desc->attribute); } @@ -473,48 +473,48 @@ print_memory_map (grub_efi_memory_descriptor_t *memory_map, #endif void -grub_efi_mm_init (void) +VasEBoot_efi_mm_init (void) { - grub_efi_memory_descriptor_t *memory_map; - grub_efi_memory_descriptor_t *memory_map_end; - grub_efi_memory_descriptor_t *filtered_memory_map; - grub_efi_memory_descriptor_t *filtered_memory_map_end; - grub_efi_uintn_t map_size; - grub_efi_uintn_t desc_size; - grub_efi_uint64_t total_pages; - grub_efi_uint64_t required_pages; + VasEBoot_efi_memory_descriptor_t *memory_map; + VasEBoot_efi_memory_descriptor_t *memory_map_end; + VasEBoot_efi_memory_descriptor_t *filtered_memory_map; + VasEBoot_efi_memory_descriptor_t *filtered_memory_map_end; + VasEBoot_efi_uintn_t map_size; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_uint64_t total_pages; + VasEBoot_efi_uint64_t required_pages; int mm_status; /* Prepare a memory region to store two memory maps. */ - memory_map = grub_efi_allocate_pages (0, + memory_map = VasEBoot_efi_allocate_pages (0, 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); if (! memory_map) - grub_fatal ("cannot allocate memory"); + VasEBoot_fatal ("cannot allocate memory"); /* Obtain descriptors for available memory. */ map_size = MEMORY_MAP_SIZE; - mm_status = grub_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0); + mm_status = VasEBoot_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0); if (mm_status == 0) { - grub_efi_free_pages - ((grub_efi_physical_address_t) ((grub_addr_t) memory_map), + VasEBoot_efi_free_pages + ((VasEBoot_efi_physical_address_t) ((VasEBoot_addr_t) memory_map), 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); /* Freeing/allocating operations may increase memory map size. */ map_size += desc_size * 32; - memory_map = grub_efi_allocate_pages (0, 2 * BYTES_TO_PAGES (map_size)); + memory_map = VasEBoot_efi_allocate_pages (0, 2 * BYTES_TO_PAGES (map_size)); if (! memory_map) - grub_fatal ("cannot allocate memory"); + VasEBoot_fatal ("cannot allocate memory"); - mm_status = grub_efi_get_memory_map (&map_size, memory_map, 0, + mm_status = VasEBoot_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0); } if (mm_status < 0) - grub_fatal ("cannot get memory map"); + VasEBoot_fatal ("cannot get memory map"); memory_map_end = NEXT_MEMORY_DESCRIPTOR (memory_map, map_size); @@ -532,11 +532,11 @@ grub_efi_mm_init (void) else if (required_pages > BYTES_TO_PAGES (MAX_HEAP_SIZE)) required_pages = BYTES_TO_PAGES (MAX_HEAP_SIZE); - /* Sort the filtered descriptors, so that GRUB can allocate pages + /* Sort the filtered descriptors, so that VasEBoot can allocate pages from smaller regions. */ sort_memory_map (filtered_memory_map, desc_size, filtered_memory_map_end); - /* Allocate memory regions for GRUB's memory management. */ + /* Allocate memory regions for VasEBoot's memory management. */ add_memory_regions (filtered_memory_map, desc_size, filtered_memory_map_end, required_pages); @@ -544,16 +544,16 @@ grub_efi_mm_init (void) /* For debug. */ map_size = MEMORY_MAP_SIZE; - if (grub_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0) < 0) - grub_fatal ("cannot get memory map"); + if (VasEBoot_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0) < 0) + VasEBoot_fatal ("cannot get memory map"); - grub_printf ("printing memory map\n"); + VasEBoot_printf ("printing memory map\n"); print_memory_map (memory_map, desc_size, NEXT_MEMORY_DESCRIPTOR (memory_map, map_size)); - grub_fatal ("Debug. "); + VasEBoot_fatal ("Debug. "); #endif /* Release the memory maps. */ - grub_efi_free_pages ((grub_addr_t) memory_map, + VasEBoot_efi_free_pages ((VasEBoot_addr_t) memory_map, 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); } diff --git a/VasEBoot-core/kern/efi/tpm.c b/VasEBoot-core/kern/efi/tpm.c index 532e534e4..653306e2a 100644 --- a/VasEBoot-core/kern/efi/tpm.c +++ b/VasEBoot-core/kern/efi/tpm.c @@ -1,56 +1,56 @@ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_efi_guid_t tpm_guid = EFI_TPM_GUID; -static grub_efi_guid_t tpm2_guid = EFI_TPM2_GUID; +static VasEBoot_efi_guid_t tpm_guid = EFI_TPM_GUID; +static VasEBoot_efi_guid_t tpm2_guid = EFI_TPM2_GUID; -static grub_efi_boolean_t grub_tpm_present(grub_efi_tpm_protocol_t *tpm) +static VasEBoot_efi_boolean_t VasEBoot_tpm_present(VasEBoot_efi_tpm_protocol_t *tpm) { - grub_efi_status_t status; + VasEBoot_efi_status_t status; TCG_EFI_BOOT_SERVICE_CAPABILITY caps; - grub_uint32_t flags; - grub_efi_physical_address_t eventlog, lastevent; + VasEBoot_uint32_t flags; + VasEBoot_efi_physical_address_t eventlog, lastevent; - caps.Size = (grub_uint8_t)sizeof(caps); + caps.Size = (VasEBoot_uint8_t)sizeof(caps); status = efi_call_5(tpm->status_check, tpm, &caps, &flags, &eventlog, &lastevent); - if (status != GRUB_EFI_SUCCESS || caps.TPMDeactivatedFlag + if (status != VasEBoot_EFI_SUCCESS || caps.TPMDeactivatedFlag || !caps.TPMPresentFlag) return 0; return 1; } -static grub_efi_boolean_t grub_tpm2_present(grub_efi_tpm2_protocol_t *tpm) +static VasEBoot_efi_boolean_t VasEBoot_tpm2_present(VasEBoot_efi_tpm2_protocol_t *tpm) { - grub_efi_status_t status; + VasEBoot_efi_status_t status; EFI_TCG2_BOOT_SERVICE_CAPABILITY caps; - caps.Size = (grub_uint8_t)sizeof(caps); + caps.Size = (VasEBoot_uint8_t)sizeof(caps); status = efi_call_2(tpm->get_capability, tpm, &caps); - if (status != GRUB_EFI_SUCCESS || !caps.TPMPresentFlag) + if (status != VasEBoot_EFI_SUCCESS || !caps.TPMPresentFlag) return 0; return 1; } -static grub_efi_boolean_t grub_tpm_handle_find(grub_efi_handle_t *tpm_handle, - grub_efi_uint8_t *protocol_version) +static VasEBoot_efi_boolean_t VasEBoot_tpm_handle_find(VasEBoot_efi_handle_t *tpm_handle, + VasEBoot_efi_uint8_t *protocol_version) { - grub_efi_handle_t *handles; - grub_efi_uintn_t num_handles; + VasEBoot_efi_handle_t *handles; + VasEBoot_efi_uintn_t num_handles; - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &tpm_guid, NULL, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_BY_PROTOCOL, &tpm_guid, NULL, &num_handles); if (handles && num_handles > 0) { *tpm_handle = handles[0]; @@ -58,7 +58,7 @@ static grub_efi_boolean_t grub_tpm_handle_find(grub_efi_handle_t *tpm_handle, return 1; } - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &tpm2_guid, NULL, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_BY_PROTOCOL, &tpm2_guid, NULL, &num_handles); if (handles && num_handles > 0) { *tpm_handle = handles[0]; @@ -69,20 +69,20 @@ static grub_efi_boolean_t grub_tpm_handle_find(grub_efi_handle_t *tpm_handle, return 0; } -static grub_err_t -grub_tpm1_execute(grub_efi_handle_t tpm_handle, +static VasEBoot_err_t +VasEBoot_tpm1_execute(VasEBoot_efi_handle_t tpm_handle, PassThroughToTPM_InputParamBlock *inbuf, PassThroughToTPM_OutputParamBlock *outbuf) { - grub_efi_status_t status; - grub_efi_tpm_protocol_t *tpm; - grub_uint32_t inhdrsize = sizeof(*inbuf) - sizeof(inbuf->TPMOperandIn); - grub_uint32_t outhdrsize = sizeof(*outbuf) - sizeof(outbuf->TPMOperandOut); + VasEBoot_efi_status_t status; + VasEBoot_efi_tpm_protocol_t *tpm; + VasEBoot_uint32_t inhdrsize = sizeof(*inbuf) - sizeof(inbuf->TPMOperandIn); + VasEBoot_uint32_t outhdrsize = sizeof(*outbuf) - sizeof(outbuf->TPMOperandOut); - tpm = grub_efi_open_protocol (tpm_handle, &tpm_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + tpm = VasEBoot_efi_open_protocol (tpm_handle, &tpm_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (!grub_tpm_present(tpm)) + if (!VasEBoot_tpm_present(tpm)) return 0; /* UEFI TPM protocol takes the raw operand block, no param block header */ @@ -91,35 +91,35 @@ grub_tpm1_execute(grub_efi_handle_t tpm_handle, outbuf->OPBLength - outhdrsize, outbuf->TPMOperandOut); switch (status) { - case GRUB_EFI_SUCCESS: + case VasEBoot_EFI_SUCCESS: return 0; - case GRUB_EFI_DEVICE_ERROR: - return grub_error (GRUB_ERR_IO, N_("Command failed")); - case GRUB_EFI_INVALID_PARAMETER: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid parameter")); - case GRUB_EFI_BUFFER_TOO_SMALL: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Output buffer too small")); - case GRUB_EFI_NOT_FOUND: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); + case VasEBoot_EFI_DEVICE_ERROR: + return VasEBoot_error (VasEBoot_ERR_IO, N_("Command failed")); + case VasEBoot_EFI_INVALID_PARAMETER: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Invalid parameter")); + case VasEBoot_EFI_BUFFER_TOO_SMALL: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Output buffer too small")); + case VasEBoot_EFI_NOT_FOUND: + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); default: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); } } -static grub_err_t -grub_tpm2_execute(grub_efi_handle_t tpm_handle, +static VasEBoot_err_t +VasEBoot_tpm2_execute(VasEBoot_efi_handle_t tpm_handle, PassThroughToTPM_InputParamBlock *inbuf, PassThroughToTPM_OutputParamBlock *outbuf) { - grub_efi_status_t status; - grub_efi_tpm2_protocol_t *tpm; - grub_uint32_t inhdrsize = sizeof(*inbuf) - sizeof(inbuf->TPMOperandIn); - grub_uint32_t outhdrsize = sizeof(*outbuf) - sizeof(outbuf->TPMOperandOut); + VasEBoot_efi_status_t status; + VasEBoot_efi_tpm2_protocol_t *tpm; + VasEBoot_uint32_t inhdrsize = sizeof(*inbuf) - sizeof(inbuf->TPMOperandIn); + VasEBoot_uint32_t outhdrsize = sizeof(*outbuf) - sizeof(outbuf->TPMOperandOut); - tpm = grub_efi_open_protocol (tpm_handle, &tpm2_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + tpm = VasEBoot_efi_open_protocol (tpm_handle, &tpm2_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (!grub_tpm2_present(tpm)) + if (!VasEBoot_tpm2_present(tpm)) return 0; /* UEFI TPM protocol takes the raw operand block, no param block header */ @@ -128,146 +128,146 @@ grub_tpm2_execute(grub_efi_handle_t tpm_handle, outbuf->OPBLength - outhdrsize, outbuf->TPMOperandOut); switch (status) { - case GRUB_EFI_SUCCESS: + case VasEBoot_EFI_SUCCESS: return 0; - case GRUB_EFI_DEVICE_ERROR: - return grub_error (GRUB_ERR_IO, N_("Command failed")); - case GRUB_EFI_INVALID_PARAMETER: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid parameter")); - case GRUB_EFI_BUFFER_TOO_SMALL: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Output buffer too small")); - case GRUB_EFI_NOT_FOUND: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); + case VasEBoot_EFI_DEVICE_ERROR: + return VasEBoot_error (VasEBoot_ERR_IO, N_("Command failed")); + case VasEBoot_EFI_INVALID_PARAMETER: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Invalid parameter")); + case VasEBoot_EFI_BUFFER_TOO_SMALL: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Output buffer too small")); + case VasEBoot_EFI_NOT_FOUND: + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); default: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); } } -grub_err_t -grub_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, +VasEBoot_err_t +VasEBoot_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, PassThroughToTPM_OutputParamBlock *outbuf) { - grub_efi_handle_t tpm_handle; - grub_uint8_t protocol_version; + VasEBoot_efi_handle_t tpm_handle; + VasEBoot_uint8_t protocol_version; /* It's not a hard failure for there to be no TPM */ - if (!grub_tpm_handle_find(&tpm_handle, &protocol_version)) + if (!VasEBoot_tpm_handle_find(&tpm_handle, &protocol_version)) return 0; if (protocol_version == 1) { - return grub_tpm1_execute(tpm_handle, inbuf, outbuf); + return VasEBoot_tpm1_execute(tpm_handle, inbuf, outbuf); } else { - return grub_tpm2_execute(tpm_handle, inbuf, outbuf); + return VasEBoot_tpm2_execute(tpm_handle, inbuf, outbuf); } } -static grub_err_t -grub_tpm1_log_event(grub_efi_handle_t tpm_handle, unsigned char *buf, - grub_size_t size, grub_uint8_t pcr, +static VasEBoot_err_t +VasEBoot_tpm1_log_event(VasEBoot_efi_handle_t tpm_handle, unsigned char *buf, + VasEBoot_size_t size, VasEBoot_uint8_t pcr, const char *description) { TCG_PCR_EVENT *event; - grub_efi_status_t status; - grub_efi_tpm_protocol_t *tpm; - grub_efi_physical_address_t lastevent; - grub_uint32_t algorithm; - grub_uint32_t eventnum = 0; + VasEBoot_efi_status_t status; + VasEBoot_efi_tpm_protocol_t *tpm; + VasEBoot_efi_physical_address_t lastevent; + VasEBoot_uint32_t algorithm; + VasEBoot_uint32_t eventnum = 0; - tpm = grub_efi_open_protocol (tpm_handle, &tpm_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + tpm = VasEBoot_efi_open_protocol (tpm_handle, &tpm_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (!grub_tpm_present(tpm)) + if (!VasEBoot_tpm_present(tpm)) return 0; - event = grub_zalloc(sizeof (TCG_PCR_EVENT) + grub_strlen(description) + 1); + event = VasEBoot_zalloc(sizeof (TCG_PCR_EVENT) + VasEBoot_strlen(description) + 1); if (!event) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate TPM event buffer")); event->PCRIndex = pcr; event->EventType = EV_IPL; - event->EventSize = grub_strlen(description) + 1; - grub_memcpy(event->Event, description, event->EventSize); + event->EventSize = VasEBoot_strlen(description) + 1; + VasEBoot_memcpy(event->Event, description, event->EventSize); algorithm = TCG_ALG_SHA; - status = efi_call_7 (tpm->log_extend_event, tpm, (grub_efi_physical_address_t)buf, (grub_uint64_t) size, + status = efi_call_7 (tpm->log_extend_event, tpm, (VasEBoot_efi_physical_address_t)buf, (VasEBoot_uint64_t) size, algorithm, event, &eventnum, &lastevent); switch (status) { - case GRUB_EFI_SUCCESS: + case VasEBoot_EFI_SUCCESS: return 0; - case GRUB_EFI_DEVICE_ERROR: - return grub_error (GRUB_ERR_IO, N_("Command failed")); - case GRUB_EFI_INVALID_PARAMETER: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid parameter")); - case GRUB_EFI_BUFFER_TOO_SMALL: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Output buffer too small")); - case GRUB_EFI_NOT_FOUND: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); + case VasEBoot_EFI_DEVICE_ERROR: + return VasEBoot_error (VasEBoot_ERR_IO, N_("Command failed")); + case VasEBoot_EFI_INVALID_PARAMETER: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Invalid parameter")); + case VasEBoot_EFI_BUFFER_TOO_SMALL: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Output buffer too small")); + case VasEBoot_EFI_NOT_FOUND: + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); default: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); } } -static grub_err_t -grub_tpm2_log_event(grub_efi_handle_t tpm_handle, unsigned char *buf, - grub_size_t size, grub_uint8_t pcr, +static VasEBoot_err_t +VasEBoot_tpm2_log_event(VasEBoot_efi_handle_t tpm_handle, unsigned char *buf, + VasEBoot_size_t size, VasEBoot_uint8_t pcr, const char *description) { EFI_TCG2_EVENT *event; - grub_efi_status_t status; - grub_efi_tpm2_protocol_t *tpm; + VasEBoot_efi_status_t status; + VasEBoot_efi_tpm2_protocol_t *tpm; - tpm = grub_efi_open_protocol (tpm_handle, &tpm2_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + tpm = VasEBoot_efi_open_protocol (tpm_handle, &tpm2_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (!grub_tpm2_present(tpm)) + if (!VasEBoot_tpm2_present(tpm)) return 0; - event = grub_zalloc(sizeof (EFI_TCG2_EVENT) + grub_strlen(description) + 1); + event = VasEBoot_zalloc(sizeof (EFI_TCG2_EVENT) + VasEBoot_strlen(description) + 1); if (!event) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate TPM event buffer")); event->Header.HeaderSize = sizeof(EFI_TCG2_EVENT_HEADER); event->Header.HeaderVersion = 1; event->Header.PCRIndex = pcr; event->Header.EventType = EV_IPL; - event->Size = sizeof(*event) - sizeof(event->Event) + grub_strlen(description) + 1; - grub_memcpy(event->Event, description, grub_strlen(description) + 1); + event->Size = sizeof(*event) - sizeof(event->Event) + VasEBoot_strlen(description) + 1; + VasEBoot_memcpy(event->Event, description, VasEBoot_strlen(description) + 1); - status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (grub_efi_physical_address_t)buf, - (grub_uint64_t) size, event); + status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (VasEBoot_efi_physical_address_t)buf, + (VasEBoot_uint64_t) size, event); switch (status) { - case GRUB_EFI_SUCCESS: + case VasEBoot_EFI_SUCCESS: return 0; - case GRUB_EFI_DEVICE_ERROR: - return grub_error (GRUB_ERR_IO, N_("Command failed")); - case GRUB_EFI_INVALID_PARAMETER: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid parameter")); - case GRUB_EFI_BUFFER_TOO_SMALL: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Output buffer too small")); - case GRUB_EFI_NOT_FOUND: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); + case VasEBoot_EFI_DEVICE_ERROR: + return VasEBoot_error (VasEBoot_ERR_IO, N_("Command failed")); + case VasEBoot_EFI_INVALID_PARAMETER: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Invalid parameter")); + case VasEBoot_EFI_BUFFER_TOO_SMALL: + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("Output buffer too small")); + case VasEBoot_EFI_NOT_FOUND: + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("TPM unavailable")); default: - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error")); } } -grub_err_t -grub_tpm_log_event(unsigned char *buf, grub_size_t size, grub_uint8_t pcr, +VasEBoot_err_t +VasEBoot_tpm_log_event(unsigned char *buf, VasEBoot_size_t size, VasEBoot_uint8_t pcr, const char *description) { - grub_efi_handle_t tpm_handle; - grub_efi_uint8_t protocol_version; + VasEBoot_efi_handle_t tpm_handle; + VasEBoot_efi_uint8_t protocol_version; - if (!grub_tpm_handle_find(&tpm_handle, &protocol_version)) + if (!VasEBoot_tpm_handle_find(&tpm_handle, &protocol_version)) return 0; if (protocol_version == 1) { - return grub_tpm1_log_event(tpm_handle, buf, size, pcr, description); + return VasEBoot_tpm1_log_event(tpm_handle, buf, size, pcr, description); } else { - return grub_tpm2_log_event(tpm_handle, buf, size, pcr, description); + return VasEBoot_tpm2_log_event(tpm_handle, buf, size, pcr, description); } } diff --git a/VasEBoot-core/kern/elf.c b/VasEBoot-core/kern/elf.c index 4f282c9cf..63a092a04 100644 --- a/VasEBoot-core/kern/elf.c +++ b/VasEBoot-core/kern/elf.c @@ -1,55 +1,55 @@ /* elf.c - load ELF files */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #pragma GCC diagnostic ignored "-Wcast-align" -#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275) -#define GRUB_ELF_ENABLE_BI_ENDIAN 1 +#if defined(__powerpc__) && defined(VasEBoot_MACHINE_IEEE1275) +#define VasEBoot_ELF_ENABLE_BI_ENDIAN 1 #else -#define GRUB_ELF_ENABLE_BI_ENDIAN 0 +#define VasEBoot_ELF_ENABLE_BI_ENDIAN 0 #endif -#if defined(GRUB_CPU_WORDS_BIGENDIAN) -#define GRUB_ELF_NATIVE_ENDIANNESS ELFDATA2MSB -#define GRUB_ELF_OPPOSITE_ENDIANNESS ELFDATA2LSB +#if defined(VasEBoot_CPU_WORDS_BIGENDIAN) +#define VasEBoot_ELF_NATIVE_ENDIANNESS ELFDATA2MSB +#define VasEBoot_ELF_OPPOSITE_ENDIANNESS ELFDATA2LSB #else -#define GRUB_ELF_NATIVE_ENDIANNESS ELFDATA2LSB -#define GRUB_ELF_OPPOSITE_ENDIANNESS ELFDATA2MSB +#define VasEBoot_ELF_NATIVE_ENDIANNESS ELFDATA2LSB +#define VasEBoot_ELF_OPPOSITE_ENDIANNESS ELFDATA2MSB #endif -static int grub_elf32_check_endianess_and_bswap_ehdr (grub_elf_t elf); -static int grub_elf64_check_endianess_and_bswap_ehdr (grub_elf_t elf); +static int VasEBoot_elf32_check_endianess_and_bswap_ehdr (VasEBoot_elf_t elf); +static int VasEBoot_elf64_check_endianess_and_bswap_ehdr (VasEBoot_elf_t elf); /* Check if EHDR is a valid ELF header. */ -static grub_err_t -grub_elf_check_header (grub_elf_t elf) +static VasEBoot_err_t +VasEBoot_elf_check_header (VasEBoot_elf_t elf) { Elf32_Ehdr *e = &elf->ehdr.ehdr32; @@ -58,155 +58,155 @@ grub_elf_check_header (grub_elf_t elf) || e->e_ident[EI_MAG2] != ELFMAG2 || e->e_ident[EI_MAG3] != ELFMAG3 || e->e_ident[EI_VERSION] != EV_CURRENT) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); - if (grub_elf_is_elf32 (elf)) + if (VasEBoot_elf_is_elf32 (elf)) { - if (!grub_elf32_check_endianess_and_bswap_ehdr (elf)) { - return grub_error (GRUB_ERR_BAD_OS, "invalid ELF endianness magic"); + if (!VasEBoot_elf32_check_endianess_and_bswap_ehdr (elf)) { + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid ELF endianness magic"); } } - else if (grub_elf_is_elf64 (elf)) + else if (VasEBoot_elf_is_elf64 (elf)) { - if (!grub_elf64_check_endianess_and_bswap_ehdr (elf)) { - return grub_error (GRUB_ERR_BAD_OS, "invalid ELF endianness magic"); + if (!VasEBoot_elf64_check_endianess_and_bswap_ehdr (elf)) { + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid ELF endianness magic"); } } else - return grub_error (GRUB_ERR_BAD_OS, "unknown ELF class"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "unknown ELF class"); if (e->e_version != EV_CURRENT) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_elf_close (grub_elf_t elf) +VasEBoot_err_t +VasEBoot_elf_close (VasEBoot_elf_t elf) { - grub_file_t file = elf->file; + VasEBoot_file_t file = elf->file; - grub_free (elf->phdrs); - grub_free (elf->filename); - grub_free (elf); + VasEBoot_free (elf->phdrs); + VasEBoot_free (elf->filename); + VasEBoot_free (elf); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -grub_elf_t -grub_elf_file (grub_file_t file, const char *filename) +VasEBoot_elf_t +VasEBoot_elf_file (VasEBoot_file_t file, const char *filename) { - grub_elf_t elf; + VasEBoot_elf_t elf; - elf = grub_zalloc (sizeof (*elf)); + elf = VasEBoot_zalloc (sizeof (*elf)); if (! elf) return 0; elf->file = file; - if (grub_file_seek (elf->file, 0) == (grub_off_t) -1) + if (VasEBoot_file_seek (elf->file, 0) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (elf->file, &elf->ehdr, sizeof (elf->ehdr)) + if (VasEBoot_file_read (elf->file, &elf->ehdr, sizeof (elf->ehdr)) != sizeof (elf->ehdr)) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), filename); goto fail; } - if (grub_elf_check_header (elf)) + if (VasEBoot_elf_check_header (elf)) goto fail; - elf->filename = grub_strdup (filename); + elf->filename = VasEBoot_strdup (filename); if (!elf->filename) goto fail; return elf; fail: - grub_free (elf->filename); - grub_free (elf->phdrs); - grub_free (elf); + VasEBoot_free (elf->filename); + VasEBoot_free (elf->phdrs); + VasEBoot_free (elf); return 0; } -grub_elf_t -grub_elf_open (const char *name) +VasEBoot_elf_t +VasEBoot_elf_open (const char *name) { - grub_file_t file; - grub_elf_t elf; + VasEBoot_file_t file; + VasEBoot_elf_t elf; - file = grub_file_open (name); + file = VasEBoot_file_open (name); if (! file) return 0; - elf = grub_elf_file (file, name); + elf = VasEBoot_elf_file (file, name); if (! elf) - grub_file_close (file); + VasEBoot_file_close (file); return elf; } -#define grub_swap_bytes_halfXX grub_swap_bytes16 -#define grub_swap_bytes_wordXX grub_swap_bytes32 +#define VasEBoot_swap_bytes_halfXX VasEBoot_swap_bytes16 +#define VasEBoot_swap_bytes_wordXX VasEBoot_swap_bytes32 /* 32-bit */ #define ehdrXX ehdr32 #define ELFCLASSXX ELFCLASS32 #define ElfXX_Addr Elf32_Addr -#define grub_elfXX_size grub_elf32_size -#define grub_elfXX_load grub_elf32_load +#define VasEBoot_elfXX_size VasEBoot_elf32_size +#define VasEBoot_elfXX_load VasEBoot_elf32_load #define FOR_ELFXX_PHDRS FOR_ELF32_PHDRS -#define grub_elf_is_elfXX grub_elf_is_elf32 -#define grub_elfXX_load_phdrs grub_elf32_load_phdrs +#define VasEBoot_elf_is_elfXX VasEBoot_elf_is_elf32 +#define VasEBoot_elfXX_load_phdrs VasEBoot_elf32_load_phdrs #define ElfXX_Phdr Elf32_Phdr #define ElfXX_Ehdr Elf32_Ehdr -#define grub_uintXX_t grub_uint32_t -#define grub_swap_bytes_addrXX grub_swap_bytes32 -#define grub_swap_bytes_offXX grub_swap_bytes32 -#define grub_swap_bytes_XwordXX grub_swap_bytes32 -#define grub_elfXX_check_endianess_and_bswap_ehdr grub_elf32_check_endianess_and_bswap_ehdr +#define VasEBoot_uintXX_t VasEBoot_uint32_t +#define VasEBoot_swap_bytes_addrXX VasEBoot_swap_bytes32 +#define VasEBoot_swap_bytes_offXX VasEBoot_swap_bytes32 +#define VasEBoot_swap_bytes_XwordXX VasEBoot_swap_bytes32 +#define VasEBoot_elfXX_check_endianess_and_bswap_ehdr VasEBoot_elf32_check_endianess_and_bswap_ehdr #include "elfXX.c" #undef ehdrXX #undef ELFCLASSXX #undef ElfXX_Addr -#undef grub_elfXX_size -#undef grub_elfXX_load +#undef VasEBoot_elfXX_size +#undef VasEBoot_elfXX_load #undef FOR_ELFXX_PHDRS -#undef grub_elf_is_elfXX -#undef grub_elfXX_load_phdrs +#undef VasEBoot_elf_is_elfXX +#undef VasEBoot_elfXX_load_phdrs #undef ElfXX_Phdr #undef ElfXX_Ehdr -#undef grub_uintXX_t -#undef grub_swap_bytes_addrXX -#undef grub_swap_bytes_offXX -#undef grub_swap_bytes_XwordXX -#undef grub_elfXX_check_endianess_and_bswap_ehdr +#undef VasEBoot_uintXX_t +#undef VasEBoot_swap_bytes_addrXX +#undef VasEBoot_swap_bytes_offXX +#undef VasEBoot_swap_bytes_XwordXX +#undef VasEBoot_elfXX_check_endianess_and_bswap_ehdr /* 64-bit */ #define ehdrXX ehdr64 #define ELFCLASSXX ELFCLASS64 #define ElfXX_Addr Elf64_Addr -#define grub_elfXX_size grub_elf64_size -#define grub_elfXX_load grub_elf64_load +#define VasEBoot_elfXX_size VasEBoot_elf64_size +#define VasEBoot_elfXX_load VasEBoot_elf64_load #define FOR_ELFXX_PHDRS FOR_ELF64_PHDRS -#define grub_elf_is_elfXX grub_elf_is_elf64 -#define grub_elfXX_load_phdrs grub_elf64_load_phdrs +#define VasEBoot_elf_is_elfXX VasEBoot_elf_is_elf64 +#define VasEBoot_elfXX_load_phdrs VasEBoot_elf64_load_phdrs #define ElfXX_Phdr Elf64_Phdr #define ElfXX_Ehdr Elf64_Ehdr -#define grub_uintXX_t grub_uint64_t -#define grub_swap_bytes_addrXX grub_swap_bytes64 -#define grub_swap_bytes_offXX grub_swap_bytes64 -#define grub_swap_bytes_XwordXX grub_swap_bytes64 -#define grub_elfXX_check_endianess_and_bswap_ehdr grub_elf64_check_endianess_and_bswap_ehdr +#define VasEBoot_uintXX_t VasEBoot_uint64_t +#define VasEBoot_swap_bytes_addrXX VasEBoot_swap_bytes64 +#define VasEBoot_swap_bytes_offXX VasEBoot_swap_bytes64 +#define VasEBoot_swap_bytes_XwordXX VasEBoot_swap_bytes64 +#define VasEBoot_elfXX_check_endianess_and_bswap_ehdr VasEBoot_elf64_check_endianess_and_bswap_ehdr #include "elfXX.c" diff --git a/VasEBoot-core/kern/elfXX.c b/VasEBoot-core/kern/elfXX.c index 1859d1880..3d8ff04d6 100644 --- a/VasEBoot-core/kern/elfXX.c +++ b/VasEBoot-core/kern/elfXX.c @@ -1,67 +1,67 @@ int -grub_elf_is_elfXX (grub_elf_t elf) +VasEBoot_elf_is_elfXX (VasEBoot_elf_t elf) { return elf->ehdr.ehdrXX.e_ident[EI_CLASS] == ELFCLASSXX; } -grub_err_t -grub_elfXX_load_phdrs (grub_elf_t elf) +VasEBoot_err_t +VasEBoot_elfXX_load_phdrs (VasEBoot_elf_t elf) { - grub_ssize_t phdrs_size; + VasEBoot_ssize_t phdrs_size; if (elf->phdrs) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - phdrs_size = (grub_uint32_t) elf->ehdr.ehdrXX.e_phnum * elf->ehdr.ehdrXX.e_phentsize; + phdrs_size = (VasEBoot_uint32_t) elf->ehdr.ehdrXX.e_phnum * elf->ehdr.ehdrXX.e_phentsize; - grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%lx.\n", + VasEBoot_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%lx.\n", (unsigned long long) elf->ehdr.ehdrXX.e_phoff, (unsigned long) phdrs_size); - elf->phdrs = grub_malloc (phdrs_size); + elf->phdrs = VasEBoot_malloc (phdrs_size); if (! elf->phdrs) - return grub_errno; + return VasEBoot_errno; - if ((grub_file_seek (elf->file, elf->ehdr.ehdrXX.e_phoff) == (grub_off_t) -1) - || (grub_file_read (elf->file, elf->phdrs, phdrs_size) != phdrs_size)) + if ((VasEBoot_file_seek (elf->file, elf->ehdr.ehdrXX.e_phoff) == (VasEBoot_off_t) -1) + || (VasEBoot_file_read (elf->file, elf->phdrs, phdrs_size) != phdrs_size)) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), elf->filename); - return grub_errno; + return VasEBoot_errno; } -#if GRUB_ELF_ENABLE_BI_ENDIAN - if (elf->ehdr.ehdrXX.e_ident[EI_DATA] == GRUB_ELF_OPPOSITE_ENDIANNESS) +#if VasEBoot_ELF_ENABLE_BI_ENDIAN + if (elf->ehdr.ehdrXX.e_ident[EI_DATA] == VasEBoot_ELF_OPPOSITE_ENDIANNESS) { ElfXX_Phdr *phdr; for (phdr = elf->phdrs; (char *) phdr < (char *) elf->phdrs + phdrs_size; phdr = (ElfXX_Phdr *) ((char *) phdr + elf->ehdr.ehdrXX.e_phentsize)) { - phdr->p_type = grub_swap_bytes_wordXX (phdr->p_type); - phdr->p_flags = grub_swap_bytes_wordXX (phdr->p_flags); - phdr->p_offset = grub_swap_bytes_offXX (phdr->p_offset); - phdr->p_vaddr = grub_swap_bytes_addrXX (phdr->p_vaddr); - phdr->p_paddr = grub_swap_bytes_addrXX (phdr->p_paddr); - phdr->p_filesz = grub_swap_bytes_XwordXX (phdr->p_filesz); - phdr->p_memsz = grub_swap_bytes_XwordXX (phdr->p_memsz); - phdr->p_align = grub_swap_bytes_XwordXX (phdr->p_align); + phdr->p_type = VasEBoot_swap_bytes_wordXX (phdr->p_type); + phdr->p_flags = VasEBoot_swap_bytes_wordXX (phdr->p_flags); + phdr->p_offset = VasEBoot_swap_bytes_offXX (phdr->p_offset); + phdr->p_vaddr = VasEBoot_swap_bytes_addrXX (phdr->p_vaddr); + phdr->p_paddr = VasEBoot_swap_bytes_addrXX (phdr->p_paddr); + phdr->p_filesz = VasEBoot_swap_bytes_XwordXX (phdr->p_filesz); + phdr->p_memsz = VasEBoot_swap_bytes_XwordXX (phdr->p_memsz); + phdr->p_align = VasEBoot_swap_bytes_XwordXX (phdr->p_align); } } -#endif /* GRUB_ELF_ENABLE_BI_ENDIAN */ +#endif /* VasEBoot_ELF_ENABLE_BI_ENDIAN */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Calculate the amount of memory spanned by the segments. */ -grub_size_t -grub_elfXX_size (grub_elf_t elf, - ElfXX_Addr *base, grub_uintXX_t *max_align) +VasEBoot_size_t +VasEBoot_elfXX_size (VasEBoot_elf_t elf, + ElfXX_Addr *base, VasEBoot_uintXX_t *max_align) { ElfXX_Addr segments_start = (ElfXX_Addr) -1; ElfXX_Addr segments_end = 0; int nr_phdrs = 0; - grub_uint32_t curr_align = 1; + VasEBoot_uint32_t curr_align = 1; ElfXX_Phdr *phdr; /* Run through the program headers to calculate the total memory size we @@ -85,14 +85,14 @@ grub_elfXX_size (grub_elf_t elf, if (nr_phdrs == 0) { - grub_error (GRUB_ERR_BAD_OS, "no program headers present"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "no program headers present"); return 0; } if (segments_end < segments_start) { /* Very bad addresses. */ - grub_error (GRUB_ERR_BAD_OS, "bad program header load addresses"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "bad program header load addresses"); return 0; } @@ -103,64 +103,64 @@ grub_elfXX_size (grub_elf_t elf, return segments_end - segments_start; } -grub_err_t -grub_elfXX_load (grub_elf_t elf, const char *filename, - void *load_offset, enum grub_elf_load_flags load_flags, - grub_addr_t *base, grub_size_t *size) +VasEBoot_err_t +VasEBoot_elfXX_load (VasEBoot_elf_t elf, const char *filename, + void *load_offset, enum VasEBoot_elf_load_flags load_flags, + VasEBoot_addr_t *base, VasEBoot_size_t *size) { - grub_addr_t load_base = (grub_addr_t) -1ULL; - grub_size_t load_size = 0; + VasEBoot_addr_t load_base = (VasEBoot_addr_t) -1ULL; + VasEBoot_size_t load_size = 0; ElfXX_Phdr *phdr; FOR_ELFXX_PHDRS(elf, phdr) { - grub_addr_t load_addr; + VasEBoot_addr_t load_addr; - if (phdr->p_type != PT_LOAD && !((load_flags & GRUB_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC) && phdr->p_type == PT_DYNAMIC)) + if (phdr->p_type != PT_LOAD && !((load_flags & VasEBoot_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC) && phdr->p_type == PT_DYNAMIC)) continue; - load_addr = (grub_addr_t) phdr->p_paddr; - switch (load_flags & GRUB_ELF_LOAD_FLAGS_BITS) + load_addr = (VasEBoot_addr_t) phdr->p_paddr; + switch (load_flags & VasEBoot_ELF_LOAD_FLAGS_BITS) { - case GRUB_ELF_LOAD_FLAGS_ALL_BITS: + case VasEBoot_ELF_LOAD_FLAGS_ALL_BITS: break; - case GRUB_ELF_LOAD_FLAGS_28BITS: + case VasEBoot_ELF_LOAD_FLAGS_28BITS: load_addr &= 0xFFFFFFF; break; - case GRUB_ELF_LOAD_FLAGS_30BITS: + case VasEBoot_ELF_LOAD_FLAGS_30BITS: load_addr &= 0x3FFFFFFF; break; - case GRUB_ELF_LOAD_FLAGS_62BITS: + case VasEBoot_ELF_LOAD_FLAGS_62BITS: load_addr &= 0x3FFFFFFFFFFFFFFFULL; break; } - load_addr += (grub_addr_t) load_offset; + load_addr += (VasEBoot_addr_t) load_offset; if (load_addr < load_base) load_base = load_addr; - grub_dprintf ("elf", "Loading segment at 0x%llx, size 0x%llx\n", + VasEBoot_dprintf ("elf", "Loading segment at 0x%llx, size 0x%llx\n", (unsigned long long) load_addr, (unsigned long long) phdr->p_memsz); - if (grub_file_seek (elf->file, phdr->p_offset) == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (elf->file, phdr->p_offset) == (VasEBoot_off_t) -1) + return VasEBoot_errno; if (phdr->p_filesz) { - grub_ssize_t read; - read = grub_file_read (elf->file, (void *) load_addr, phdr->p_filesz); - if (read != (grub_ssize_t) phdr->p_filesz) + VasEBoot_ssize_t read; + read = VasEBoot_file_read (elf->file, (void *) load_addr, phdr->p_filesz); + if (read != (VasEBoot_ssize_t) phdr->p_filesz) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } } if (phdr->p_filesz < phdr->p_memsz) - grub_memset ((void *) (grub_addr_t) (load_addr + phdr->p_filesz), + VasEBoot_memset ((void *) (VasEBoot_addr_t) (load_addr + phdr->p_filesz), 0, phdr->p_memsz - phdr->p_filesz); load_size += phdr->p_memsz; @@ -171,37 +171,37 @@ grub_elfXX_load (grub_elf_t elf, const char *filename, if (size) *size = load_size; - return grub_errno; + return VasEBoot_errno; } static int -grub_elfXX_check_endianess_and_bswap_ehdr (grub_elf_t elf) +VasEBoot_elfXX_check_endianess_and_bswap_ehdr (VasEBoot_elf_t elf) { ElfXX_Ehdr *e = &(elf->ehdr.ehdrXX); - if (e->e_ident[EI_DATA] == GRUB_ELF_NATIVE_ENDIANNESS) + if (e->e_ident[EI_DATA] == VasEBoot_ELF_NATIVE_ENDIANNESS) { return 1; } -#if GRUB_ELF_ENABLE_BI_ENDIAN - if (e->e_ident[EI_DATA] == GRUB_ELF_OPPOSITE_ENDIANNESS) +#if VasEBoot_ELF_ENABLE_BI_ENDIAN + if (e->e_ident[EI_DATA] == VasEBoot_ELF_OPPOSITE_ENDIANNESS) { - e->e_type = grub_swap_bytes_halfXX (e->e_type); - e->e_machine = grub_swap_bytes_halfXX (e->e_machine); - e->e_version = grub_swap_bytes_wordXX (e->e_version); - e->e_entry = grub_swap_bytes_addrXX (e->e_entry); - e->e_phoff = grub_swap_bytes_offXX (e->e_phoff); - e->e_shoff = grub_swap_bytes_offXX (e->e_shoff); - e->e_flags = grub_swap_bytes_wordXX (e->e_flags); - e->e_ehsize = grub_swap_bytes_halfXX (e->e_ehsize); - e->e_phentsize = grub_swap_bytes_halfXX (e->e_phentsize); - e->e_phnum = grub_swap_bytes_halfXX (e->e_phnum); - e->e_shentsize = grub_swap_bytes_halfXX (e->e_shentsize); - e->e_shnum = grub_swap_bytes_halfXX (e->e_shnum); - e->e_shstrndx = grub_swap_bytes_halfXX (e->e_shstrndx); + e->e_type = VasEBoot_swap_bytes_halfXX (e->e_type); + e->e_machine = VasEBoot_swap_bytes_halfXX (e->e_machine); + e->e_version = VasEBoot_swap_bytes_wordXX (e->e_version); + e->e_entry = VasEBoot_swap_bytes_addrXX (e->e_entry); + e->e_phoff = VasEBoot_swap_bytes_offXX (e->e_phoff); + e->e_shoff = VasEBoot_swap_bytes_offXX (e->e_shoff); + e->e_flags = VasEBoot_swap_bytes_wordXX (e->e_flags); + e->e_ehsize = VasEBoot_swap_bytes_halfXX (e->e_ehsize); + e->e_phentsize = VasEBoot_swap_bytes_halfXX (e->e_phentsize); + e->e_phnum = VasEBoot_swap_bytes_halfXX (e->e_phnum); + e->e_shentsize = VasEBoot_swap_bytes_halfXX (e->e_shentsize); + e->e_shnum = VasEBoot_swap_bytes_halfXX (e->e_shnum); + e->e_shstrndx = VasEBoot_swap_bytes_halfXX (e->e_shstrndx); return 1; } -#endif /* GRUB_ELF_ENABLE_BI_ENDIAN */ +#endif /* VasEBoot_ELF_ENABLE_BI_ENDIAN */ return 0; } diff --git a/VasEBoot-core/kern/emu/argp_common.c b/VasEBoot-core/kern/emu/argp_common.c index 166885870..d75fc352b 100644 --- a/VasEBoot-core/kern/emu/argp_common.c +++ b/VasEBoot-core/kern/emu/argp_common.c @@ -1,20 +1,20 @@ -/* grub-setup.c - make GRUB usable */ +/* VasEBoot-setup.c - make VasEBoot usable */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include diff --git a/VasEBoot-core/kern/emu/cache.c b/VasEBoot-core/kern/emu/cache.c index 6f89e871a..2ce91480c 100644 --- a/VasEBoot-core/kern/emu/cache.c +++ b/VasEBoot-core/kern/emu/cache.c @@ -1,8 +1,8 @@ -#ifndef GRUB_MACHINE_EMU -#error "This source is only meant for grub-emu platform" +#ifndef VasEBoot_MACHINE_EMU +#error "This source is only meant for VasEBoot-emu platform" #endif -#include +#include #if defined(__ia64__) #include "../ia64/cache.c" @@ -11,16 +11,16 @@ void __clear_cache (void *beg, void *end); void -grub_arch_sync_caches (void *address, grub_size_t len) +VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) { __clear_cache (address, (char *) address + len); } #elif defined (__mips__) -void _flush_cache (void *address, grub_size_t len, int type); +void _flush_cache (void *address, VasEBoot_size_t len, int type); void -grub_arch_sync_caches (void *address, grub_size_t len) +VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) { return _flush_cache (address, len, 0); } diff --git a/VasEBoot-core/kern/emu/cache_s.S b/VasEBoot-core/kern/emu/cache_s.S index 76cf7560d..178a9adfe 100644 --- a/VasEBoot-core/kern/emu/cache_s.S +++ b/VasEBoot-core/kern/emu/cache_s.S @@ -1,5 +1,5 @@ -#ifndef GRUB_MACHINE_EMU -#error "This source is only meant for grub-emu platform" +#ifndef VasEBoot_MACHINE_EMU +#error "This source is only meant for VasEBoot-emu platform" #endif #if defined(__i386__) || defined(__x86_64__) diff --git a/VasEBoot-core/kern/emu/full.c b/VasEBoot-core/kern/emu/full.c index e8d63b1f5..9c82f6a4f 100644 --- a/VasEBoot-core/kern/emu/full.c +++ b/VasEBoot-core/kern/emu/full.c @@ -1,68 +1,68 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -const int grub_no_modules = 1; +const int VasEBoot_no_modules = 1; void -grub_register_exported_symbols (void) +VasEBoot_register_exported_symbols (void) { } -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { (void) ehdr; - return GRUB_ERR_BAD_MODULE; + return VasEBoot_ERR_BAD_MODULE; } -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { (void) mod; (void) ehdr; (void) s; (void) seg; - return GRUB_ERR_BAD_MODULE; + return VasEBoot_ERR_BAD_MODULE; } #if !defined (__i386__) && !defined (__x86_64__) -grub_err_t -grub_arch_dl_get_tramp_got_size (const void *ehdr __attribute__ ((unused)), - grub_size_t *tramp, grub_size_t *got) +VasEBoot_err_t +VasEBoot_arch_dl_get_tramp_got_size (const void *ehdr __attribute__ ((unused)), + VasEBoot_size_t *tramp, VasEBoot_size_t *got) { *tramp = 0; *got = 0; - return GRUB_ERR_BAD_MODULE; + return VasEBoot_ERR_BAD_MODULE; } #endif -#ifdef GRUB_LINKER_HAVE_INIT +#ifdef VasEBoot_LINKER_HAVE_INIT void -grub_arch_dl_init_linker (void) +VasEBoot_arch_dl_init_linker (void) { } #endif diff --git a/VasEBoot-core/kern/emu/hostdisk.c b/VasEBoot-core/kern/emu/hostdisk.c index 87e3e2512..f3c299571 100644 --- a/VasEBoot-core/kern/emu/hostdisk.c +++ b/VasEBoot-core/kern/emu/hostdisk.c @@ -1,35 +1,35 @@ /* hostdisk.c - emulate biosdisk */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -80,7 +80,7 @@ unescape_cmp (const char *a, const char *b_escaped) } static int -find_grub_drive (const char *name) +find_VasEBoot_drive (const char *name) { unsigned int i; @@ -107,12 +107,12 @@ find_free_slot (void) } static int -grub_util_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull) +VasEBoot_util_biosdisk_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull) { unsigned i; - if (pull != GRUB_DISK_PULL_NONE) + if (pull != VasEBoot_DISK_PULL_NONE) return 0; for (i = 0; i < ARRAY_SIZE (map); i++) @@ -122,45 +122,45 @@ grub_util_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, return 0; } -static grub_err_t -grub_util_biosdisk_open (const char *name, grub_disk_t disk) +static VasEBoot_err_t +VasEBoot_util_biosdisk_open (const char *name, VasEBoot_disk_t disk) { int drive; - struct grub_util_hostdisk_data *data; + struct VasEBoot_util_hostdisk_data *data; - drive = find_grub_drive (name); - grub_util_info ("drive = %d", drive); + drive = find_VasEBoot_drive (name); + VasEBoot_util_info ("drive = %d", drive); if (drive < 0) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no mapping exists for `%s'", name); disk->id = drive; - disk->data = data = xmalloc (sizeof (struct grub_util_hostdisk_data)); + disk->data = data = xmalloc (sizeof (struct VasEBoot_util_hostdisk_data)); data->dev = NULL; data->access_mode = 0; - data->fd = GRUB_UTIL_FD_INVALID; + data->fd = VasEBoot_UTIL_FD_INVALID; data->is_disk = 0; data->device_map = map[drive].device_map; /* Get the size. */ { - grub_util_fd_t fd; + VasEBoot_util_fd_t fd; - fd = grub_util_fd_open (map[drive].device, GRUB_UTIL_FD_O_RDONLY); + fd = VasEBoot_util_fd_open (map[drive].device, VasEBoot_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID(fd)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("cannot open `%s': %s"), - map[drive].device, grub_util_fd_strerror ()); + if (!VasEBoot_UTIL_FD_IS_VALID(fd)) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("cannot open `%s': %s"), + map[drive].device, VasEBoot_util_fd_strerror ()); - disk->total_sectors = grub_util_get_fd_size (fd, map[drive].device, + disk->total_sectors = VasEBoot_util_get_fd_size (fd, map[drive].device, &disk->log_sector_size); disk->total_sectors >>= disk->log_sector_size; - disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; + disk->max_agglomerate = VasEBoot_DISK_MAX_MAX_AGGLOMERATE; -#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL +#if VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL { struct stat st; -# if GRUB_DISK_DEVS_ARE_CHAR +# if VasEBoot_DISK_DEVS_ARE_CHAR if (fstat (fd, &st) >= 0 && S_ISCHR (st.st_mode)) # else if (fstat (fd, &st) >= 0 && S_ISBLK (st.st_mode)) @@ -169,22 +169,22 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) } #endif - grub_util_fd_close (fd); + VasEBoot_util_fd_close (fd); - grub_util_info ("the size of %s is %" GRUB_HOST_PRIuLONG_LONG, + VasEBoot_util_info ("the size of %s is %" VasEBoot_HOST_PRIuLONG_LONG, name, (unsigned long long) disk->total_sectors); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } const char * -grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add) +VasEBoot_hostdisk_os_dev_to_VasEBoot_drive (const char *os_disk, int add) { unsigned int i; char *canon; - canon = grub_canonicalize_file_name (os_disk); + canon = VasEBoot_canonicalize_file_name (os_disk); if (!canon) canon = xstrdup (os_disk); @@ -205,7 +205,7 @@ grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add) if (i == ARRAY_SIZE (map)) /* TRANSLATORS: it refers to the lack of free slots. */ - grub_util_error ("%s", _("device count exceeds limit")); + VasEBoot_util_error ("%s", _("device count exceeds limit")); map[i].device = canon; map[i].drive = xmalloc (sizeof ("hostdisk/") + strlen (os_disk)); @@ -213,43 +213,43 @@ grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add) strcpy (map[i].drive + sizeof ("hostdisk/") - 1, os_disk); map[i].device_map = 0; - grub_hostdisk_flush_initial_buffer (os_disk); + VasEBoot_hostdisk_flush_initial_buffer (os_disk); return map[i].drive; } #ifndef __linux__ -grub_util_fd_t -grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags, - grub_disk_addr_t *max) +VasEBoot_util_fd_t +VasEBoot_util_fd_open_device (const VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, int flags, + VasEBoot_disk_addr_t *max) { - grub_util_fd_t fd; - struct grub_util_hostdisk_data *data = disk->data; + VasEBoot_util_fd_t fd; + struct VasEBoot_util_hostdisk_data *data = disk->data; *max = ~0ULL; - flags |= GRUB_UTIL_FD_O_SYNC; + flags |= VasEBoot_UTIL_FD_O_SYNC; if (data->dev && strcmp (data->dev, map[disk->id].device) == 0 && data->access_mode == (flags & O_ACCMODE)) { - grub_dprintf ("hostdisk", "reusing open device `%s'\n", data->dev); + VasEBoot_dprintf ("hostdisk", "reusing open device `%s'\n", data->dev); fd = data->fd; } else { free (data->dev); data->dev = 0; - if (GRUB_UTIL_FD_IS_VALID(data->fd)) + if (VasEBoot_UTIL_FD_IS_VALID(data->fd)) { if (data->access_mode == O_RDWR || data->access_mode == O_WRONLY) - grub_util_fd_sync (data->fd); - grub_util_fd_close (data->fd); - data->fd = GRUB_UTIL_FD_INVALID; + VasEBoot_util_fd_sync (data->fd); + VasEBoot_util_fd_close (data->fd); + data->fd = VasEBoot_UTIL_FD_INVALID; } - fd = grub_util_fd_open (map[disk->id].device, flags); - if (GRUB_UTIL_FD_IS_VALID(fd)) + fd = VasEBoot_util_fd_open (map[disk->id].device, flags); + if (VasEBoot_UTIL_FD_IS_VALID(fd)) { data->dev = xstrdup (map[disk->id].device); data->access_mode = (flags & O_ACCMODE); @@ -257,20 +257,20 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f } } - if (!GRUB_UTIL_FD_IS_VALID(data->fd)) + if (!VasEBoot_UTIL_FD_IS_VALID(data->fd)) { - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), - map[disk->id].device, grub_util_fd_strerror ()); - return GRUB_UTIL_FD_INVALID; + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), + map[disk->id].device, VasEBoot_util_fd_strerror ()); + return VasEBoot_UTIL_FD_INVALID; } - if (grub_util_fd_seek (fd, sector << disk->log_sector_size)) + if (VasEBoot_util_fd_seek (fd, sector << disk->log_sector_size)) { - grub_util_fd_close (fd); - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), - map[disk->id].device, grub_util_fd_strerror ()); + VasEBoot_util_fd_close (fd); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), + map[disk->id].device, VasEBoot_util_fd_strerror ()); - return GRUB_UTIL_FD_INVALID; + return VasEBoot_UTIL_FD_INVALID; } return fd; @@ -278,17 +278,17 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f #endif -static grub_err_t -grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) +static VasEBoot_err_t +VasEBoot_util_biosdisk_read (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf) { while (size) { - grub_util_fd_t fd; - grub_disk_addr_t max = ~0ULL; - fd = grub_util_fd_open_device (disk, sector, GRUB_UTIL_FD_O_RDONLY, &max); - if (!GRUB_UTIL_FD_IS_VALID (fd)) - return grub_errno; + VasEBoot_util_fd_t fd; + VasEBoot_disk_addr_t max = ~0ULL; + fd = VasEBoot_util_fd_open_device (disk, sector, VasEBoot_UTIL_FD_O_RDONLY, &max); + if (!VasEBoot_UTIL_FD_IS_VALID (fd)) + return VasEBoot_errno; #ifdef __linux__ if (sector == 0) @@ -302,28 +302,28 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, if (max > size) max = size; - if (grub_util_fd_read (fd, buf, max << disk->log_sector_size) + if (VasEBoot_util_fd_read (fd, buf, max << disk->log_sector_size) != (ssize_t) (max << disk->log_sector_size)) - return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read `%s': %s"), - map[disk->id].device, grub_util_fd_strerror ()); + return VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("cannot read `%s': %s"), + map[disk->id].device, VasEBoot_util_fd_strerror ()); size -= max; buf += (max << disk->log_sector_size); sector += max; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) +static VasEBoot_err_t +VasEBoot_util_biosdisk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf) { while (size) { - grub_util_fd_t fd; - grub_disk_addr_t max = ~0ULL; - fd = grub_util_fd_open_device (disk, sector, GRUB_UTIL_FD_O_WRONLY, &max); - if (!GRUB_UTIL_FD_IS_VALID (fd)) - return grub_errno; + VasEBoot_util_fd_t fd; + VasEBoot_disk_addr_t max = ~0ULL; + fd = VasEBoot_util_fd_open_device (disk, sector, VasEBoot_UTIL_FD_O_WRONLY, &max); + if (!VasEBoot_UTIL_FD_IS_VALID (fd)) + return VasEBoot_errno; #ifdef __linux__ if (sector == 0) @@ -337,74 +337,74 @@ grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, if (max > size) max = size; - if (grub_util_fd_write (fd, buf, max << disk->log_sector_size) + if (VasEBoot_util_fd_write (fd, buf, max << disk->log_sector_size) != (ssize_t) (max << disk->log_sector_size)) - return grub_error (GRUB_ERR_WRITE_ERROR, N_("cannot write to `%s': %s"), - map[disk->id].device, grub_util_fd_strerror ()); + return VasEBoot_error (VasEBoot_ERR_WRITE_ERROR, N_("cannot write to `%s': %s"), + map[disk->id].device, VasEBoot_util_fd_strerror ()); size -= max; buf += (max << disk->log_sector_size); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_util_biosdisk_flush (struct grub_disk *disk) +VasEBoot_err_t +VasEBoot_util_biosdisk_flush (struct VasEBoot_disk *disk) { - struct grub_util_hostdisk_data *data = disk->data; + struct VasEBoot_util_hostdisk_data *data = disk->data; - if (disk->dev->id != GRUB_DISK_DEVICE_BIOSDISK_ID) - return GRUB_ERR_NONE; - if (!GRUB_UTIL_FD_IS_VALID (data->fd)) + if (disk->dev->id != VasEBoot_DISK_DEVICE_BIOSDISK_ID) + return VasEBoot_ERR_NONE; + if (!VasEBoot_UTIL_FD_IS_VALID (data->fd)) { - grub_disk_addr_t max; - data->fd = grub_util_fd_open_device (disk, 0, GRUB_UTIL_FD_O_RDONLY, &max); - if (!GRUB_UTIL_FD_IS_VALID (data->fd)) - return grub_errno; + VasEBoot_disk_addr_t max; + data->fd = VasEBoot_util_fd_open_device (disk, 0, VasEBoot_UTIL_FD_O_RDONLY, &max); + if (!VasEBoot_UTIL_FD_IS_VALID (data->fd)) + return VasEBoot_errno; } - grub_util_fd_sync (data->fd); + VasEBoot_util_fd_sync (data->fd); #ifdef __linux__ if (data->is_disk) ioctl (data->fd, BLKFLSBUF, 0); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_util_biosdisk_close (struct grub_disk *disk) +VasEBoot_util_biosdisk_close (struct VasEBoot_disk *disk) { - struct grub_util_hostdisk_data *data = disk->data; + struct VasEBoot_util_hostdisk_data *data = disk->data; free (data->dev); - if (GRUB_UTIL_FD_IS_VALID (data->fd)) + if (VasEBoot_UTIL_FD_IS_VALID (data->fd)) { if (data->access_mode == O_RDWR || data->access_mode == O_WRONLY) - grub_util_biosdisk_flush (disk); - grub_util_fd_close (data->fd); + VasEBoot_util_biosdisk_flush (disk); + VasEBoot_util_fd_close (data->fd); } free (data); } -static struct grub_disk_dev grub_util_biosdisk_dev = +static struct VasEBoot_disk_dev VasEBoot_util_biosdisk_dev = { .name = "hostdisk", - .id = GRUB_DISK_DEVICE_HOSTDISK_ID, - .iterate = grub_util_biosdisk_iterate, - .open = grub_util_biosdisk_open, - .close = grub_util_biosdisk_close, - .read = grub_util_biosdisk_read, - .write = grub_util_biosdisk_write, + .id = VasEBoot_DISK_DEVICE_HOSTDISK_ID, + .iterate = VasEBoot_util_biosdisk_iterate, + .open = VasEBoot_util_biosdisk_open, + .close = VasEBoot_util_biosdisk_close, + .read = VasEBoot_util_biosdisk_read, + .write = VasEBoot_util_biosdisk_write, .next = 0 }; static int -grub_util_check_file_presence (const char *p) +VasEBoot_util_check_file_presence (const char *p) { -#if !GRUB_UTIL_FD_STAT_IS_FUNCTIONAL - grub_util_fd_t h; - h = grub_util_fd_open (p, GRUB_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID(h)) +#if !VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL + VasEBoot_util_fd_t h; + h = VasEBoot_util_fd_open (p, VasEBoot_UTIL_FD_O_RDONLY); + if (!VasEBoot_UTIL_FD_IS_VALID(h)) return 0; - grub_util_fd_close (h); + VasEBoot_util_fd_close (h); return 1; #else struct stat st; @@ -424,14 +424,14 @@ read_device_map (const char *dev_map) if (!dev_map || dev_map[0] == '\0') { - grub_util_info ("no device.map"); + VasEBoot_util_info ("no device.map"); return; } - fp = grub_util_fopen (dev_map, "r"); + fp = VasEBoot_util_fopen (dev_map, "r"); if (! fp) { - grub_util_info (_("cannot open `%s': %s"), dev_map, strerror (errno)); + VasEBoot_util_info (_("cannot open `%s': %s"), dev_map, strerror (errno)); return; } @@ -445,7 +445,7 @@ read_device_map (const char *dev_map) lineno++; /* Skip leading spaces. */ - while (*p && grub_isspace (*p)) + while (*p && VasEBoot_isspace (*p)) p++; /* If the first character is `#' or NUL, skip this line. */ @@ -456,14 +456,14 @@ read_device_map (const char *dev_map) { char *tmp; tmp = xasprintf (_("missing `%c' symbol"), '('); - grub_util_error ("%s:%d: %s", dev_map, lineno, tmp); + VasEBoot_util_error ("%s:%d: %s", dev_map, lineno, tmp); } p++; /* Find a free slot. */ drive = find_free_slot (); if (drive < 0) - grub_util_error ("%s:%d: %s", dev_map, lineno, _("device count exceeds limit")); + VasEBoot_util_error ("%s:%d: %s", dev_map, lineno, _("device count exceeds limit")); e = p; p = strchr (p, ')'); @@ -471,7 +471,7 @@ read_device_map (const char *dev_map) { char *tmp; tmp = xasprintf (_("missing `%c' symbol"), ')'); - grub_util_error ("%s:%d: %s", dev_map, lineno, tmp); + VasEBoot_util_error ("%s:%d: %s", dev_map, lineno, tmp); } map[drive].drive = 0; @@ -479,7 +479,7 @@ read_device_map (const char *dev_map) { char *ptr; for (ptr = e + 2; ptr < p; ptr++) - if (!grub_isdigit (*ptr)) + if (!VasEBoot_isdigit (*ptr)) break; if (ptr == p) { @@ -497,10 +497,10 @@ read_device_map (const char *dev_map) devices are available at boot time. Fedora populated it with entries like (hd0,1) /dev/sda1 which would mean that every partition is a separate disk for BIOS. Such entries were - inactive in GRUB due to its bug which is now gone. Without + inactive in VasEBoot due to its bug which is now gone. Without this additional check these entries would be harmful now. */ - grub_util_warn (_("the device.map entry `%s' is invalid. " + VasEBoot_util_warn (_("the device.map entry `%s' is invalid. " "Ignoring it. Please correct or " "delete your device.map"), e); continue; @@ -512,30 +512,30 @@ read_device_map (const char *dev_map) p++; /* Skip leading spaces. */ - while (*p && grub_isspace (*p)) + while (*p && VasEBoot_isspace (*p)) p++; if (*p == '\0') - grub_util_error ("%s:%d: %s", dev_map, lineno, _("filename expected")); + VasEBoot_util_error ("%s:%d: %s", dev_map, lineno, _("filename expected")); /* NUL-terminate the filename. */ e = p; - while (*e && ! grub_isspace (*e)) + while (*e && ! VasEBoot_isspace (*e)) e++; *e = '\0'; - if (!grub_util_check_file_presence (p)) + if (!VasEBoot_util_check_file_presence (p)) { free (map[drive].drive); map[drive].drive = NULL; - grub_util_info ("Cannot stat `%s', skipping", p); + VasEBoot_util_info ("Cannot stat `%s', skipping", p); continue; } /* On Linux, the devfs uses symbolic links horribly, and that confuses the interface very much, so use realpath to expand symbolic links. */ - map[drive].device = grub_canonicalize_file_name (p); + map[drive].device = VasEBoot_canonicalize_file_name (p); if (! map[drive].device) map[drive].device = xstrdup (p); @@ -552,7 +552,7 @@ read_device_map (const char *dev_map) one could create any kind of device name with this. Due to some problems we decided to limit it to just a handful possibilities. */ - grub_util_warn (_("the drive name `%s' in device.map is incorrect. " + VasEBoot_util_warn (_("the drive name `%s' in device.map is incorrect. " "Using %s instead. " "Please use the form [hfc]d[0-9]* " "(E.g. `hd0' or `cd')"), @@ -560,24 +560,24 @@ read_device_map (const char *dev_map) *drive_p = c; } - grub_util_info ("adding `%s' -> `%s' from device.map", map[drive].drive, + VasEBoot_util_info ("adding `%s' -> `%s' from device.map", map[drive].drive, map[drive].device); - grub_hostdisk_flush_initial_buffer (map[drive].device); + VasEBoot_hostdisk_flush_initial_buffer (map[drive].device); } fclose (fp); } void -grub_util_biosdisk_init (const char *dev_map) +VasEBoot_util_biosdisk_init (const char *dev_map) { read_device_map (dev_map); - grub_disk_dev_register (&grub_util_biosdisk_dev); + VasEBoot_disk_dev_register (&VasEBoot_util_biosdisk_dev); } void -grub_util_biosdisk_fini (void) +VasEBoot_util_biosdisk_fini (void) { unsigned i; @@ -590,21 +590,21 @@ grub_util_biosdisk_fini (void) map[i].drive = map[i].device = NULL; } - grub_disk_dev_unregister (&grub_util_biosdisk_dev); + VasEBoot_disk_dev_unregister (&VasEBoot_util_biosdisk_dev); } const char * -grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk) +VasEBoot_util_biosdisk_get_compatibility_hint (VasEBoot_disk_t disk) { - if (disk->dev != &grub_util_biosdisk_dev || map[disk->id].device_map) + if (disk->dev != &VasEBoot_util_biosdisk_dev || map[disk->id].device_map) return disk->name; return 0; } const char * -grub_util_biosdisk_get_osdev (grub_disk_t disk) +VasEBoot_util_biosdisk_get_osdev (VasEBoot_disk_t disk) { - if (disk->dev != &grub_util_biosdisk_dev) + if (disk->dev != &VasEBoot_util_biosdisk_dev) return 0; return map[disk->id].device; @@ -612,7 +612,7 @@ grub_util_biosdisk_get_osdev (grub_disk_t disk) static char * -grub_util_path_concat_real (size_t n, int ext, va_list ap) +VasEBoot_util_path_concat_real (size_t n, int ext, va_list ap) { size_t totlen = 0; char **l = xmalloc ((n + ext) * sizeof (l[0])); @@ -640,13 +640,13 @@ grub_util_path_concat_real (size_t n, int ext, va_list ap) if ((p != r || (pi != l[i] && first)) && (p == r || *(p - 1) != '/')) *p++ = '/'; first = 0; - p = grub_stpcpy (p, pi); + p = VasEBoot_stpcpy (p, pi); while (p != r && p != r + 1 && *(p - 1) == '/') p--; } if (ext && l[i]) - p = grub_stpcpy (p, l[i]); + p = VasEBoot_stpcpy (p, l[i]); *p = '\0'; @@ -656,14 +656,14 @@ grub_util_path_concat_real (size_t n, int ext, va_list ap) } char * -grub_util_path_concat (size_t n, ...) +VasEBoot_util_path_concat (size_t n, ...) { va_list ap; char *r; va_start (ap, n); - r = grub_util_path_concat_real (n, 0, ap); + r = VasEBoot_util_path_concat_real (n, 0, ap); va_end (ap); @@ -671,14 +671,14 @@ grub_util_path_concat (size_t n, ...) } char * -grub_util_path_concat_ext (size_t n, ...) +VasEBoot_util_path_concat_ext (size_t n, ...) { va_list ap; char *r; va_start (ap, n); - r = grub_util_path_concat_real (n, 1, ap); + r = VasEBoot_util_path_concat_real (n, 1, ap); va_end (ap); diff --git a/VasEBoot-core/kern/emu/hostfs.c b/VasEBoot-core/kern/emu/hostfs.c index 7b28c001f..de21d1716 100644 --- a/VasEBoot-core/kern/emu/hostfs.c +++ b/VasEBoot-core/kern/emu/hostfs.c @@ -1,33 +1,33 @@ /* hostfs.c - Dummy filesystem to provide access to the hosts filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -49,40 +49,40 @@ is_dir (const char *path, const char *name) strcat (pathname, name); - ret = grub_util_is_directory (pathname); + ret = VasEBoot_util_is_directory (pathname); free (pathname); return ret; } -struct grub_hostfs_data +struct VasEBoot_hostfs_data { char *filename; - grub_util_fd_t f; + VasEBoot_util_fd_t f; }; -static grub_err_t -grub_hostfs_dir (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data) +static VasEBoot_err_t +VasEBoot_hostfs_dir (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data) { - grub_util_fd_dir_t dir; + VasEBoot_util_fd_dir_t dir; /* Check if the disk is our dummy disk. */ - if (grub_strcmp (device->disk->name, "host")) - return grub_error (GRUB_ERR_BAD_FS, "not a hostfs"); + if (VasEBoot_strcmp (device->disk->name, "host")) + return VasEBoot_error (VasEBoot_ERR_BAD_FS, "not a hostfs"); - dir = grub_util_fd_opendir (path); + dir = VasEBoot_util_fd_opendir (path); if (! dir) - return grub_error (GRUB_ERR_BAD_FILENAME, + return VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("can't open `%s': %s"), path, - grub_util_fd_strerror ()); + VasEBoot_util_fd_strerror ()); while (1) { - grub_util_fd_dirent_t de; - struct grub_dirhook_info info; - grub_memset (&info, 0, sizeof (info)); + VasEBoot_util_fd_dirent_t de; + struct VasEBoot_dirhook_info info; + VasEBoot_memset (&info, 0, sizeof (info)); - de = grub_util_fd_readdir (dir); + de = VasEBoot_util_fd_readdir (dir); if (! de) break; @@ -91,107 +91,107 @@ grub_hostfs_dir (grub_device_t device, const char *path, } - grub_util_fd_closedir (dir); + VasEBoot_util_fd_closedir (dir); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Open a file named NAME and initialize FILE. */ -static grub_err_t -grub_hostfs_open (struct grub_file *file, const char *name) +static VasEBoot_err_t +VasEBoot_hostfs_open (struct VasEBoot_file *file, const char *name) { - grub_util_fd_t f; - struct grub_hostfs_data *data; + VasEBoot_util_fd_t f; + struct VasEBoot_hostfs_data *data; - f = grub_util_fd_open (name, GRUB_UTIL_FD_O_RDONLY); - if (! GRUB_UTIL_FD_IS_VALID (f)) - return grub_error (GRUB_ERR_BAD_FILENAME, + f = VasEBoot_util_fd_open (name, VasEBoot_UTIL_FD_O_RDONLY); + if (! VasEBoot_UTIL_FD_IS_VALID (f)) + return VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("can't open `%s': %s"), name, strerror (errno)); - data = grub_malloc (sizeof (*data)); + data = VasEBoot_malloc (sizeof (*data)); if (!data) { - grub_util_fd_close (f); - return grub_errno; + VasEBoot_util_fd_close (f); + return VasEBoot_errno; } - data->filename = grub_strdup (name); + data->filename = VasEBoot_strdup (name); if (!data->filename) { - grub_free (data); - grub_util_fd_close (f); - return grub_errno; + VasEBoot_free (data); + VasEBoot_util_fd_close (f); + return VasEBoot_errno; } data->f = f; file->data = data; - file->size = grub_util_get_fd_size (f, name, NULL); + file->size = VasEBoot_util_get_fd_size (f, name, NULL); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_ssize_t -grub_hostfs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_hostfs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_hostfs_data *data; + struct VasEBoot_hostfs_data *data; data = file->data; - if (grub_util_fd_seek (data->f, file->offset) != 0) + if (VasEBoot_util_fd_seek (data->f, file->offset) != 0) { - grub_error (GRUB_ERR_OUT_OF_RANGE, N_("cannot seek `%s': %s"), - data->filename, grub_util_fd_strerror ()); + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("cannot seek `%s': %s"), + data->filename, VasEBoot_util_fd_strerror ()); return -1; } - unsigned int s = grub_util_fd_read (data->f, buf, len); + unsigned int s = VasEBoot_util_fd_read (data->f, buf, len); if (s != len) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("cannot read `%s': %s"), - data->filename, grub_util_fd_strerror ()); + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("cannot read `%s': %s"), + data->filename, VasEBoot_util_fd_strerror ()); return (signed) s; } -static grub_err_t -grub_hostfs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_hostfs_close (VasEBoot_file_t file) { - struct grub_hostfs_data *data; + struct VasEBoot_hostfs_data *data; data = file->data; - grub_util_fd_close (data->f); - grub_free (data->filename); - grub_free (data); + VasEBoot_util_fd_close (data->f); + VasEBoot_free (data->filename); + VasEBoot_free (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_hostfs_label (grub_device_t device __attribute ((unused)), +static VasEBoot_err_t +VasEBoot_hostfs_label (VasEBoot_device_t device __attribute ((unused)), char **label __attribute ((unused))) { *label = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_fs grub_hostfs_fs = +static struct VasEBoot_fs VasEBoot_hostfs_fs = { .name = "hostfs", - .dir = grub_hostfs_dir, - .open = grub_hostfs_open, - .read = grub_hostfs_read, - .close = grub_hostfs_close, - .label = grub_hostfs_label, + .dir = VasEBoot_hostfs_dir, + .open = VasEBoot_hostfs_open, + .read = VasEBoot_hostfs_read, + .close = VasEBoot_hostfs_close, + .label = VasEBoot_hostfs_label, .next = 0 }; -GRUB_MOD_INIT(hostfs) +VasEBoot_MOD_INIT(hostfs) { - grub_fs_register (&grub_hostfs_fs); + VasEBoot_fs_register (&VasEBoot_hostfs_fs); } -GRUB_MOD_FINI(hostfs) +VasEBoot_MOD_FINI(hostfs) { - grub_fs_unregister (&grub_hostfs_fs); + VasEBoot_fs_unregister (&VasEBoot_hostfs_fs); } diff --git a/VasEBoot-core/kern/emu/lite.c b/VasEBoot-core/kern/emu/lite.c index b2fc93d7f..267d4d6bc 100644 --- a/VasEBoot-core/kern/emu/lite.c +++ b/VasEBoot-core/kern/emu/lite.c @@ -1,8 +1,8 @@ #include -#include +#include -#ifndef GRUB_MACHINE_EMU -#error "This source is only meant for grub-emu platform" +#ifndef VasEBoot_MACHINE_EMU +#error "This source is only meant for VasEBoot-emu platform" #endif #if defined(__i386__) @@ -28,18 +28,18 @@ #error "No target cpu type is defined" #endif -const int grub_no_modules = 0; +const int VasEBoot_no_modules = 0; -/* grub-emu-lite supports dynamic module loading, so it won't have any +/* VasEBoot-emu-lite supports dynamic module loading, so it won't have any embedded modules. */ void -grub_init_all (void) +VasEBoot_init_all (void) { return; } void -grub_fini_all (void) +VasEBoot_fini_all (void) { return; } diff --git a/VasEBoot-core/kern/emu/main.c b/VasEBoot-core/kern/emu/main.c index 425bb9603..52c0991bc 100644 --- a/VasEBoot-core/kern/emu/main.c +++ b/VasEBoot-core/kern/emu/main.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -27,22 +27,22 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wmissing-prototypes" @@ -57,38 +57,38 @@ static jmp_buf main_env; /* Store the prefix specified by an argument. */ static char *root_dev = NULL, *dir = NULL; -grub_addr_t grub_modbase = 0; +VasEBoot_addr_t VasEBoot_modbase = 0; void -grub_reboot (void) +VasEBoot_reboot (void) { longjmp (main_env, 1); - grub_fatal ("longjmp failed"); + VasEBoot_fatal ("longjmp failed"); } void -grub_exit (void) +VasEBoot_exit (void) { - grub_reboot (); + VasEBoot_reboot (); } void -grub_machine_init (void) +VasEBoot_machine_init (void) { } void -grub_machine_get_bootlocation (char **device, char **path) +VasEBoot_machine_get_bootlocation (char **device, char **path) { *device = root_dev; *path = dir; } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) - grub_console_fini (); + if (flags & VasEBoot_LOADER_FLAG_NORETURN) + VasEBoot_console_fini (); } @@ -104,7 +104,7 @@ static struct argp_option options[] = { /* TRANSLATORS: There are many devices in device map. */ N_("use FILE as memdisk"), 0}, {"directory", 'd', N_("DIR"), 0, - N_("use GRUB files in the directory DIR [default=%s]"), 0}, + N_("use VasEBoot 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}, { 0, 0, 0, 0, 0, 0 } @@ -182,7 +182,7 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp argp = { options, argp_parser, NULL, - N_("GRUB emulator."), + N_("VasEBoot emulator."), NULL, help_filter, NULL }; @@ -200,11 +200,11 @@ main (int argc, char *argv[]) .mem_disk = 0, }; volatile int hold = 0; - size_t total_module_size = sizeof (struct grub_module_info), memdisk_size = 0; - struct grub_module_info *modinfo; + size_t total_module_size = sizeof (struct VasEBoot_module_info), memdisk_size = 0; + struct VasEBoot_module_info *modinfo; void *mods; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); dir = xstrdup (DEFAULT_DIRECTORY); @@ -216,35 +216,35 @@ main (int argc, char *argv[]) if (arguments.mem_disk) { - memdisk_size = ALIGN_UP(grub_util_get_image_size (arguments.mem_disk), 512); - total_module_size += memdisk_size + sizeof (struct grub_module_header); + memdisk_size = ALIGN_UP(VasEBoot_util_get_image_size (arguments.mem_disk), 512); + total_module_size += memdisk_size + sizeof (struct VasEBoot_module_header); } mods = xmalloc (total_module_size); - modinfo = grub_memset (mods, 0, total_module_size); + modinfo = VasEBoot_memset (mods, 0, total_module_size); mods = (char *) (modinfo + 1); - modinfo->magic = GRUB_MODULE_MAGIC; - modinfo->offset = sizeof (struct grub_module_info); + modinfo->magic = VasEBoot_MODULE_MAGIC; + modinfo->offset = sizeof (struct VasEBoot_module_info); modinfo->size = total_module_size; if (arguments.mem_disk) { - struct grub_module_header *header = (struct grub_module_header *) mods; + struct VasEBoot_module_header *header = (struct VasEBoot_module_header *) mods; header->type = OBJ_TYPE_MEMDISK; header->size = memdisk_size + sizeof (*header); mods = header + 1; - grub_util_load_image (arguments.mem_disk, mods); + VasEBoot_util_load_image (arguments.mem_disk, mods); mods = (char *) mods + memdisk_size; } - grub_modbase = (grub_addr_t) modinfo; + VasEBoot_modbase = (VasEBoot_addr_t) modinfo; hold = arguments.hold; /* Wait until the ARGS.HOLD variable is cleared by an attached debugger. */ if (hold && verbosity > 0) - /* TRANSLATORS: In this case GRUB tells user what he has to do. */ + /* TRANSLATORS: In this case VasEBoot tells user what he has to do. */ printf (_("Run `gdb %s %d', and set ARGS.HOLD to zero.\n"), program_name, (int) getpid ()); while (hold) @@ -256,31 +256,31 @@ main (int argc, char *argv[]) } signal (SIGINT, SIG_IGN); - grub_console_init (); - grub_host_init (); + VasEBoot_console_init (); + VasEBoot_host_init (); /* XXX: This is a bit unportable. */ - grub_util_biosdisk_init (arguments.dev_map); + VasEBoot_util_biosdisk_init (arguments.dev_map); - grub_init_all (); + VasEBoot_init_all (); - grub_hostfs_init (); + VasEBoot_hostfs_init (); /* Make sure that there is a root device. */ if (! root_dev) - root_dev = grub_strdup ("host"); + root_dev = VasEBoot_strdup ("host"); dir = xstrdup (dir); - /* Start GRUB! */ + /* Start VasEBoot! */ if (setjmp (main_env) == 0) - grub_main (); + VasEBoot_main (); - grub_fini_all (); - grub_hostfs_fini (); - grub_host_fini (); + VasEBoot_fini_all (); + VasEBoot_hostfs_fini (); + VasEBoot_host_fini (); - grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + VasEBoot_machine_fini (VasEBoot_LOADER_FLAG_NORETURN); return 0; } diff --git a/VasEBoot-core/kern/emu/misc.c b/VasEBoot-core/kern/emu/misc.c index 76661337f..4fe96ecbf 100644 --- a/VasEBoot-core/kern/emu/misc.c +++ b/VasEBoot-core/kern/emu/misc.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -27,19 +27,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include int verbosity; void -grub_util_warn (const char *fmt, ...) +VasEBoot_util_warn (const char *fmt, ...) { va_list ap; @@ -53,7 +53,7 @@ grub_util_warn (const char *fmt, ...) } void -grub_util_info (const char *fmt, ...) +VasEBoot_util_info (const char *fmt, ...) { if (verbosity > 0) { @@ -70,7 +70,7 @@ grub_util_info (const char *fmt, ...) } void -grub_util_error (const char *fmt, ...) +VasEBoot_util_error (const char *fmt, ...) { va_list ap; @@ -84,23 +84,23 @@ grub_util_error (const char *fmt, ...) } void * -xmalloc (grub_size_t size) +xmalloc (VasEBoot_size_t size) { void *p; p = malloc (size); if (! p) - grub_util_error ("%s", _("out of memory")); + VasEBoot_util_error ("%s", _("out of memory")); return p; } void * -xrealloc (void *ptr, grub_size_t size) +xrealloc (void *ptr, VasEBoot_size_t size) { ptr = realloc (ptr, size); if (! ptr) - grub_util_error ("%s", _("out of memory")); + VasEBoot_util_error ("%s", _("out of memory")); return ptr; } @@ -118,7 +118,7 @@ xstrdup (const char *str) return newstr; } -#if !defined (GRUB_MKFONT) && !defined (GRUB_BUILD) +#if !defined (VasEBoot_MKFONT) && !defined (VasEBoot_BUILD) char * xasprintf (const char *fmt, ...) { @@ -126,25 +126,25 @@ xasprintf (const char *fmt, ...) char *result; va_start (ap, fmt); - result = grub_xvasprintf (fmt, ap); + result = VasEBoot_xvasprintf (fmt, ap); va_end (ap); if (!result) - grub_util_error ("%s", _("out of memory")); + VasEBoot_util_error ("%s", _("out of memory")); return result; } #endif -#if !defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL) +#if !defined (VasEBoot_MACHINE_EMU) || defined (VasEBoot_UTIL) void -grub_exit (void) +VasEBoot_exit (void) { exit (1); } #endif -grub_uint64_t -grub_get_time_ms (void) +VasEBoot_uint64_t +VasEBoot_get_time_ms (void) { struct timeval tv; @@ -154,24 +154,24 @@ grub_get_time_ms (void) } size_t -grub_util_get_image_size (const char *path) +VasEBoot_util_get_image_size (const char *path) { FILE *f; size_t ret; off_t sz; - f = grub_util_fopen (path, "rb"); + f = VasEBoot_util_fopen (path, "rb"); if (!f) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); fseeko (f, 0, SEEK_END); sz = ftello (f); if (sz < 0) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); if (sz != (size_t) sz) - grub_util_error (_("file `%s' is too big"), path); + VasEBoot_util_error (_("file `%s' is too big"), path); ret = (size_t) sz; fclose (f); @@ -180,22 +180,22 @@ grub_util_get_image_size (const char *path) } void -grub_util_load_image (const char *path, char *buf) +VasEBoot_util_load_image (const char *path, char *buf) { FILE *fp; size_t size; - grub_util_info ("reading %s", path); + VasEBoot_util_info ("reading %s", path); - size = grub_util_get_image_size (path); + size = VasEBoot_util_get_image_size (path); - fp = grub_util_fopen (path, "rb"); + fp = VasEBoot_util_fopen (path, "rb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), path, + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); if (fread (buf, 1, size, fp) != size) - grub_util_error (_("cannot read `%s': %s"), path, + VasEBoot_util_error (_("cannot read `%s': %s"), path, strerror (errno)); fclose (fp); diff --git a/VasEBoot-core/kern/emu/mm.c b/VasEBoot-core/kern/emu/mm.c index f262e95e3..bd6e9a6d8 100644 --- a/VasEBoot-core/kern/emu/mm.c +++ b/VasEBoot-core/kern/emu/mm.c @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include +#include +#include +#include #include #include -#include +#include void * -grub_malloc (grub_size_t size) +VasEBoot_malloc (VasEBoot_size_t size) { void *ret; ret = malloc (size); if (!ret) - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return ret; } void * -grub_zalloc (grub_size_t size) +VasEBoot_zalloc (VasEBoot_size_t size) { void *ret; - ret = grub_malloc (size); + ret = VasEBoot_malloc (size); if (!ret) return NULL; memset (ret, 0, size); @@ -48,17 +48,17 @@ grub_zalloc (grub_size_t size) } void -grub_free (void *ptr) +VasEBoot_free (void *ptr) { free (ptr); } void * -grub_realloc (void *ptr, grub_size_t size) +VasEBoot_realloc (void *ptr, VasEBoot_size_t size) { void *ret; ret = realloc (ptr, size); if (!ret) - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return ret; } diff --git a/VasEBoot-core/kern/emu/time.c b/VasEBoot-core/kern/emu/time.c index 5da8092a9..b1fe57d8f 100644 --- a/VasEBoot-core/kern/emu/time.c +++ b/VasEBoot-core/kern/emu/time.c @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include #include -grub_err_t -grub_get_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_get_datetime (struct VasEBoot_datetime *datetime) { struct tm *mytm; time_t mytime; @@ -35,12 +35,12 @@ grub_get_datetime (struct grub_datetime *datetime) datetime->minute = mytm->tm_min; datetime->second = mytm->tm_sec; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_set_datetime (struct grub_datetime *datetime __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_set_datetime (struct VasEBoot_datetime *datetime __attribute__ ((unused))) { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "no clock setting routine available"); } diff --git a/VasEBoot-core/kern/env.c b/VasEBoot-core/kern/env.c index c40862642..e9360bf55 100644 --- a/VasEBoot-core/kern/env.c +++ b/VasEBoot-core/kern/env.c @@ -1,36 +1,36 @@ /* env.c - Environment variables */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* The initial context. */ -static struct grub_env_context initial_context; +static struct VasEBoot_env_context initial_context; /* The current context. */ -struct grub_env_context *grub_current_context = &initial_context; +struct VasEBoot_env_context *VasEBoot_current_context = &initial_context; /* Return the hash representation of the string S. */ static unsigned int -grub_env_hashval (const char *s) +VasEBoot_env_hashval (const char *s) { unsigned int i = 0; @@ -41,25 +41,25 @@ grub_env_hashval (const char *s) return i % HASHSZ; } -static struct grub_env_var * -grub_env_find (const char *name) +static struct VasEBoot_env_var * +VasEBoot_env_find (const char *name) { - struct grub_env_var *var; - int idx = grub_env_hashval (name); + struct VasEBoot_env_var *var; + int idx = VasEBoot_env_hashval (name); /* Look for the variable in the current context. */ - for (var = grub_current_context->vars[idx]; var; var = var->next) - if (grub_strcmp (var->name, name) == 0) + for (var = VasEBoot_current_context->vars[idx]; var; var = var->next) + if (VasEBoot_strcmp (var->name, name) == 0) return var; return 0; } static void -grub_env_insert (struct grub_env_context *context, - struct grub_env_var *var) +VasEBoot_env_insert (struct VasEBoot_env_context *context, + struct VasEBoot_env_var *var) { - int idx = grub_env_hashval (var->name); + int idx = VasEBoot_env_hashval (var->name); /* Insert the variable into the hashtable. */ var->prevp = &context->vars[idx]; @@ -70,7 +70,7 @@ grub_env_insert (struct grub_env_context *context, } static void -grub_env_remove (struct grub_env_var *var) +VasEBoot_env_remove (struct VasEBoot_env_var *var) { /* Remove the entry from the variable table. */ *var->prevp = var->next; @@ -78,13 +78,13 @@ grub_env_remove (struct grub_env_var *var) var->next->prevp = var->prevp; } -grub_err_t -grub_env_set (const char *name, const char *val) +VasEBoot_err_t +VasEBoot_env_set (const char *name, const char *val) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; /* If the variable does already exist, just update the variable. */ - var = grub_env_find (name); + var = VasEBoot_env_find (name); if (var) { char *old = var->value; @@ -92,49 +92,49 @@ grub_env_set (const char *name, const char *val) if (var->write_hook) var->value = var->write_hook (var, val); else - var->value = grub_strdup (val); + var->value = VasEBoot_strdup (val); if (! var->value) { var->value = old; - return grub_errno; + return VasEBoot_errno; } - grub_free (old); - return GRUB_ERR_NONE; + VasEBoot_free (old); + return VasEBoot_ERR_NONE; } /* The variable does not exist, so create a new one. */ - var = grub_zalloc (sizeof (*var)); + var = VasEBoot_zalloc (sizeof (*var)); if (! var) - return grub_errno; + return VasEBoot_errno; - var->name = grub_strdup (name); + var->name = VasEBoot_strdup (name); if (! var->name) goto fail; - var->value = grub_strdup (val); + var->value = VasEBoot_strdup (val); if (! var->value) goto fail; - grub_env_insert (grub_current_context, var); + VasEBoot_env_insert (VasEBoot_current_context, var); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (var->name); - grub_free (var->value); - grub_free (var); + VasEBoot_free (var->name); + VasEBoot_free (var->value); + VasEBoot_free (var); - return grub_errno; + return VasEBoot_errno; } const char * -grub_env_get (const char *name) +VasEBoot_env_get (const char *name) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; - var = grub_env_find (name); + var = VasEBoot_env_find (name); if (! var) return 0; @@ -145,45 +145,45 @@ grub_env_get (const char *name) } void -grub_env_unset (const char *name) +VasEBoot_env_unset (const char *name) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; - var = grub_env_find (name); + var = VasEBoot_env_find (name); if (! var) return; if (var->read_hook || var->write_hook) { - grub_env_set (name, ""); + VasEBoot_env_set (name, ""); return; } - grub_env_remove (var); + VasEBoot_env_remove (var); - grub_free (var->name); - grub_free (var->value); - grub_free (var); + VasEBoot_free (var->name); + VasEBoot_free (var->value); + VasEBoot_free (var); } -struct grub_env_var * -grub_env_update_get_sorted (void) +struct VasEBoot_env_var * +VasEBoot_env_update_get_sorted (void) { - struct grub_env_var *sorted_list = 0; + struct VasEBoot_env_var *sorted_list = 0; int i; /* Add variables associated with this context into a sorted list. */ for (i = 0; i < HASHSZ; i++) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; - for (var = grub_current_context->vars[i]; var; var = var->next) + for (var = VasEBoot_current_context->vars[i]; var; var = var->next) { - struct grub_env_var *p, **q; + struct VasEBoot_env_var *p, **q; for (q = &sorted_list, p = *q; p; q = &((*q)->sorted_next), p = *q) { - if (grub_strcmp (p->name, var->name) > 0) + if (VasEBoot_strcmp (p->name, var->name) > 0) break; } @@ -195,44 +195,44 @@ grub_env_update_get_sorted (void) return sorted_list; } -grub_err_t -grub_register_variable_hook (const char *name, - grub_env_read_hook_t read_hook, - grub_env_write_hook_t write_hook) +VasEBoot_err_t +VasEBoot_register_variable_hook (const char *name, + VasEBoot_env_read_hook_t read_hook, + VasEBoot_env_write_hook_t write_hook) { - struct grub_env_var *var = grub_env_find (name); + struct VasEBoot_env_var *var = VasEBoot_env_find (name); if (! var) { - if (grub_env_set (name, "") != GRUB_ERR_NONE) - return grub_errno; + if (VasEBoot_env_set (name, "") != VasEBoot_ERR_NONE) + return VasEBoot_errno; - var = grub_env_find (name); + var = VasEBoot_env_find (name); /* XXX Insert an assertion? */ } var->read_hook = read_hook; var->write_hook = write_hook; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_env_export (const char *name) +VasEBoot_err_t +VasEBoot_env_export (const char *name) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; - var = grub_env_find (name); + var = VasEBoot_env_find (name); if (! var) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_env_set (name, ""); + err = VasEBoot_env_set (name, ""); if (err) return err; - var = grub_env_find (name); + var = VasEBoot_env_find (name); } var->global = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/err.c b/VasEBoot-core/kern/err.c index 53c734de7..de5d24a92 100644 --- a/VasEBoot-core/kern/err.c +++ b/VasEBoot-core/kern/err.c @@ -1,122 +1,122 @@ /* err.c - error handling routines */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include #include -#include +#include -#define GRUB_ERROR_STACK_SIZE 10 +#define VasEBoot_ERROR_STACK_SIZE 10 -grub_err_t grub_errno; -char grub_errmsg[GRUB_MAX_ERRMSG]; -int grub_err_printed_errors; +VasEBoot_err_t VasEBoot_errno; +char VasEBoot_errmsg[VasEBoot_MAX_ERRMSG]; +int VasEBoot_err_printed_errors; -static struct grub_error_saved grub_error_stack_items[GRUB_ERROR_STACK_SIZE]; +static struct VasEBoot_error_saved VasEBoot_error_stack_items[VasEBoot_ERROR_STACK_SIZE]; -static int grub_error_stack_pos; -static int grub_error_stack_assert; +static int VasEBoot_error_stack_pos; +static int VasEBoot_error_stack_assert; -grub_err_t -grub_error (grub_err_t n, const char *fmt, ...) +VasEBoot_err_t +VasEBoot_error (VasEBoot_err_t n, const char *fmt, ...) { va_list ap; - grub_errno = n; + VasEBoot_errno = n; va_start (ap, fmt); - grub_vsnprintf (grub_errmsg, sizeof (grub_errmsg), _(fmt), ap); + VasEBoot_vsnprintf (VasEBoot_errmsg, sizeof (VasEBoot_errmsg), _(fmt), ap); va_end (ap); return n; } void -grub_error_push (void) +VasEBoot_error_push (void) { /* Only add items to stack, if there is enough room. */ - if (grub_error_stack_pos < GRUB_ERROR_STACK_SIZE) + if (VasEBoot_error_stack_pos < VasEBoot_ERROR_STACK_SIZE) { /* Copy active error message to stack. */ - grub_error_stack_items[grub_error_stack_pos].grub_errno = grub_errno; - grub_memcpy (grub_error_stack_items[grub_error_stack_pos].errmsg, - grub_errmsg, - sizeof (grub_errmsg)); + VasEBoot_error_stack_items[VasEBoot_error_stack_pos].VasEBoot_errno = VasEBoot_errno; + VasEBoot_memcpy (VasEBoot_error_stack_items[VasEBoot_error_stack_pos].errmsg, + VasEBoot_errmsg, + sizeof (VasEBoot_errmsg)); /* Advance to next error stack position. */ - grub_error_stack_pos++; + VasEBoot_error_stack_pos++; } else { /* There is no room for new error message. Discard new error message and mark error stack assertion flag. */ - grub_error_stack_assert = 1; + VasEBoot_error_stack_assert = 1; } /* Allow further operation of other components by resetting - active errno to GRUB_ERR_NONE. */ - grub_errno = GRUB_ERR_NONE; + active errno to VasEBoot_ERR_NONE. */ + VasEBoot_errno = VasEBoot_ERR_NONE; } int -grub_error_pop (void) +VasEBoot_error_pop (void) { - if (grub_error_stack_pos > 0) + if (VasEBoot_error_stack_pos > 0) { /* Pop error message from error stack to current active error. */ - grub_error_stack_pos--; + VasEBoot_error_stack_pos--; - grub_errno = grub_error_stack_items[grub_error_stack_pos].grub_errno; - grub_memcpy (grub_errmsg, - grub_error_stack_items[grub_error_stack_pos].errmsg, - sizeof (grub_errmsg)); + VasEBoot_errno = VasEBoot_error_stack_items[VasEBoot_error_stack_pos].VasEBoot_errno; + VasEBoot_memcpy (VasEBoot_errmsg, + VasEBoot_error_stack_items[VasEBoot_error_stack_pos].errmsg, + sizeof (VasEBoot_errmsg)); return 1; } else { /* There is no more items on error stack, reset to no error state. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } } void -grub_print_error (void) +VasEBoot_print_error (void) { /* Print error messages in reverse order. First print active error message and then empty error stack. */ do { - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_err_printf (_("error: %s.\n"), grub_errmsg); - grub_err_printed_errors++; + VasEBoot_err_printf (_("error: %s.\n"), VasEBoot_errmsg); + VasEBoot_err_printed_errors++; } } - while (grub_error_pop ()); + while (VasEBoot_error_pop ()); /* If there was an assert while using error stack, report about it. */ - if (grub_error_stack_assert) + if (VasEBoot_error_stack_assert) { - grub_err_printf ("assert: error stack overflow detected!\n"); - grub_error_stack_assert = 0; + VasEBoot_err_printf ("assert: error stack overflow detected!\n"); + VasEBoot_error_stack_assert = 0; } } diff --git a/VasEBoot-core/kern/file.c b/VasEBoot-core/kern/file.c index 668f8930b..6e7eb29ba 100644 --- a/VasEBoot-core/kern/file.c +++ b/VasEBoot-core/kern/file.c @@ -1,56 +1,56 @@ /* file.c - file I/O functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -void (*EXPORT_VAR (grub_grubnet_fini)) (void); +void (*EXPORT_VAR (VasEBoot_VasEBootnet_fini)) (void); -grub_file_filter_t grub_file_filters_all[GRUB_FILE_FILTER_MAX]; -grub_file_filter_t grub_file_filters_enabled[GRUB_FILE_FILTER_MAX]; +VasEBoot_file_filter_t VasEBoot_file_filters_all[VasEBoot_FILE_FILTER_MAX]; +VasEBoot_file_filter_t VasEBoot_file_filters_enabled[VasEBoot_FILE_FILTER_MAX]; /* Get the device part of the filename NAME. It is enclosed by parentheses. */ char * -grub_file_get_device_name (const char *name) +VasEBoot_file_get_device_name (const char *name) { if (name[0] == '(') { - char *p = grub_strchr (name, ')'); + char *p = VasEBoot_strchr (name, ')'); char *ret; if (! p) { - grub_error (GRUB_ERR_BAD_FILENAME, N_("missing `%c' symbol"), ')'); + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("missing `%c' symbol"), ')'); return 0; } - ret = (char *) grub_malloc (p - name); + ret = (char *) VasEBoot_malloc (p - name); if (! ret) return 0; - grub_memcpy (ret, name + 1, p - name - 1); + VasEBoot_memcpy (ret, name + 1, p - name - 1); ret[p - name - 1] = '\0'; return ret; } @@ -58,32 +58,32 @@ grub_file_get_device_name (const char *name) return 0; } -grub_file_t -grub_file_open (const char *name) +VasEBoot_file_t +VasEBoot_file_open (const char *name) { - grub_device_t device = 0; - grub_file_t file = 0, last_file = 0; + VasEBoot_device_t device = 0; + VasEBoot_file_t file = 0, last_file = 0; char *device_name; const char *file_name; - grub_file_filter_id_t filter; + VasEBoot_file_filter_id_t filter; - device_name = grub_file_get_device_name (name); - if (grub_errno) + device_name = VasEBoot_file_get_device_name (name); + if (VasEBoot_errno) goto fail; /* Get the file part of NAME. */ - file_name = (name[0] == '(') ? grub_strchr (name, ')') : NULL; + file_name = (name[0] == '(') ? VasEBoot_strchr (name, ')') : NULL; if (file_name) file_name++; else file_name = name; - device = grub_device_open (device_name); - grub_free (device_name); + device = VasEBoot_device_open (device_name); + VasEBoot_free (device_name); if (! device) goto fail; - file = (grub_file_t) grub_zalloc (sizeof (*file)); + file = (VasEBoot_file_t) VasEBoot_zalloc (sizeof (*file)); if (! file) goto fail; @@ -95,66 +95,66 @@ grub_file_open (const char *name) * access - it is just a marker). So skip host disk in this case. */ if (device->disk && file_name[0] != '/' -#if defined(GRUB_UTIL) || defined(GRUB_MACHINE_EMU) - && grub_strcmp (device->disk->name, "host") +#if defined(VasEBoot_UTIL) || defined(VasEBoot_MACHINE_EMU) + && VasEBoot_strcmp (device->disk->name, "host") #endif ) /* This is a block list. */ - file->fs = &grub_fs_blocklist; + file->fs = &VasEBoot_fs_blocklist; else { - file->fs = grub_fs_probe (device); + file->fs = VasEBoot_fs_probe (device); if (! file->fs) goto fail; } - if ((file->fs->open) (file, file_name) != GRUB_ERR_NONE) + if ((file->fs->open) (file, file_name) != VasEBoot_ERR_NONE) goto fail; - file->name = grub_strdup (name); - grub_errno = GRUB_ERR_NONE; + file->name = VasEBoot_strdup (name); + VasEBoot_errno = VasEBoot_ERR_NONE; - for (filter = 0; file && filter < ARRAY_SIZE (grub_file_filters_enabled); + for (filter = 0; file && filter < ARRAY_SIZE (VasEBoot_file_filters_enabled); filter++) - if (grub_file_filters_enabled[filter]) + if (VasEBoot_file_filters_enabled[filter]) { last_file = file; - file = grub_file_filters_enabled[filter] (file, name); + file = VasEBoot_file_filters_enabled[filter] (file, name); } if (!file) - grub_file_close (last_file); + VasEBoot_file_close (last_file); - grub_memcpy (grub_file_filters_enabled, grub_file_filters_all, - sizeof (grub_file_filters_enabled)); + VasEBoot_memcpy (VasEBoot_file_filters_enabled, VasEBoot_file_filters_all, + sizeof (VasEBoot_file_filters_enabled)); return file; fail: if (device) - grub_device_close (device); + VasEBoot_device_close (device); - /* if (net) grub_net_close (net); */ + /* if (net) VasEBoot_net_close (net); */ - grub_free (file); + VasEBoot_free (file); - grub_memcpy (grub_file_filters_enabled, grub_file_filters_all, - sizeof (grub_file_filters_enabled)); + VasEBoot_memcpy (VasEBoot_file_filters_enabled, VasEBoot_file_filters_all, + sizeof (VasEBoot_file_filters_enabled)); return 0; } -grub_disk_read_hook_t grub_file_progress_hook; +VasEBoot_disk_read_hook_t VasEBoot_file_progress_hook; -grub_ssize_t -grub_file_read (grub_file_t file, void *buf, grub_size_t len) +VasEBoot_ssize_t +VasEBoot_file_read (VasEBoot_file_t file, void *buf, VasEBoot_size_t len) { - grub_ssize_t res; - grub_disk_read_hook_t read_hook; + VasEBoot_ssize_t res; + VasEBoot_disk_read_hook_t read_hook; void *read_hook_data; if (file->offset > file->size) { - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to read past the end of file")); return -1; } @@ -166,7 +166,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) len = file->size - file->offset; /* Prevent an overflow. */ - if ((grub_ssize_t) len < 0) + if ((VasEBoot_ssize_t) len < 0) len >>= 1; if (len == 0) @@ -175,7 +175,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) read_hook_data = file->read_hook_data; if (!file->read_hook) { - file->read_hook = grub_file_progress_hook; + file->read_hook = VasEBoot_file_progress_hook; file->read_hook_data = file; file->progress_offset = file->offset; } @@ -188,27 +188,27 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) return res; } -grub_err_t -grub_file_close (grub_file_t file) +VasEBoot_err_t +VasEBoot_file_close (VasEBoot_file_t file) { if (file->fs->close) (file->fs->close) (file); if (file->device) - grub_device_close (file->device); - grub_free (file->name); - grub_free (file); - return grub_errno; + VasEBoot_device_close (file->device); + VasEBoot_free (file->name); + VasEBoot_free (file); + return VasEBoot_errno; } -grub_off_t -grub_file_seek (grub_file_t file, grub_off_t offset) +VasEBoot_off_t +VasEBoot_file_seek (VasEBoot_file_t file, VasEBoot_off_t offset) { - grub_off_t old; + VasEBoot_off_t old; if (offset > file->size) { - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("attempt to seek outside of the file")); return -1; } diff --git a/VasEBoot-core/kern/fs.c b/VasEBoot-core/kern/fs.c index 9085895b6..0c22a5a7a 100644 --- a/VasEBoot-core/kern/fs.c +++ b/VasEBoot-core/kern/fs.c @@ -1,114 +1,114 @@ /* fs.c - filesystem manager */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_fs_t grub_fs_list = 0; +VasEBoot_fs_t VasEBoot_fs_list = 0; -grub_fs_autoload_hook_t grub_fs_autoload_hook = 0; +VasEBoot_fs_autoload_hook_t VasEBoot_fs_autoload_hook = 0; -/* Helper for grub_fs_probe. */ +/* Helper for VasEBoot_fs_probe. */ static int probe_dummy_iter (const char *filename __attribute__ ((unused)), - const struct grub_dirhook_info *info __attribute__ ((unused)), + const struct VasEBoot_dirhook_info *info __attribute__ ((unused)), void *data __attribute__ ((unused))) { return 1; } -grub_fs_t -grub_fs_probe (grub_device_t device) +VasEBoot_fs_t +VasEBoot_fs_probe (VasEBoot_device_t device) { - grub_fs_t p; + VasEBoot_fs_t p; if (device->disk) { /* Make it sure not to have an infinite recursive calls. */ static int count = 0; - for (p = grub_fs_list; p; p = p->next) + for (p = VasEBoot_fs_list; p; p = p->next) { - grub_dprintf ("fs", "Detecting %s...\n", p->name); + VasEBoot_dprintf ("fs", "Detecting %s...\n", p->name); /* This is evil: newly-created just mounted BtrFS after copying all - GRUB files has a very peculiar unrecoverable corruption which + VasEBoot files has a very peculiar unrecoverable corruption which will be fixed at sync but we'd rather not do a global sync and syncing just files doesn't seem to help. Relax the check for this time. */ -#ifdef GRUB_UTIL - if (grub_strcmp (p->name, "btrfs") == 0) +#ifdef VasEBoot_UTIL + if (VasEBoot_strcmp (p->name, "btrfs") == 0) { char *label = 0; p->uuid (device, &label); if (label) - grub_free (label); + VasEBoot_free (label); } else #endif (p->dir) (device, "/", probe_dummy_iter, NULL); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) return p; - grub_error_push (); - grub_dprintf ("fs", "%s detection failed.\n", p->name); - grub_error_pop (); + VasEBoot_error_push (); + VasEBoot_dprintf ("fs", "%s detection failed.\n", p->name); + VasEBoot_error_pop (); - if (grub_errno != GRUB_ERR_BAD_FS - && grub_errno != GRUB_ERR_OUT_OF_RANGE) + if (VasEBoot_errno != VasEBoot_ERR_BAD_FS + && VasEBoot_errno != VasEBoot_ERR_OUT_OF_RANGE) return 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } /* Let's load modules automatically. */ - if (grub_fs_autoload_hook && count == 0) + if (VasEBoot_fs_autoload_hook && count == 0) { count++; - while (grub_fs_autoload_hook ()) + while (VasEBoot_fs_autoload_hook ()) { - p = grub_fs_list; + p = VasEBoot_fs_list; (p->dir) (device, "/", probe_dummy_iter, NULL); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { count--; return p; } - if (grub_errno != GRUB_ERR_BAD_FS - && grub_errno != GRUB_ERR_OUT_OF_RANGE) + if (VasEBoot_errno != VasEBoot_ERR_BAD_FS + && VasEBoot_errno != VasEBoot_ERR_OUT_OF_RANGE) { count--; return 0; } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } count--; @@ -117,7 +117,7 @@ grub_fs_probe (grub_device_t device) else if (device->net && device->net->fs) return device->net->fs; - grub_error (GRUB_ERR_UNKNOWN_FS, N_("unknown filesystem")); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_FS, N_("unknown filesystem")); return 0; } @@ -125,33 +125,33 @@ grub_fs_probe (grub_device_t device) /* Block list support routines. */ -struct grub_fs_block +struct VasEBoot_fs_block { - grub_disk_addr_t offset; + VasEBoot_disk_addr_t offset; unsigned long length; }; -static grub_err_t -grub_fs_blocklist_open (grub_file_t file, const char *name) +static VasEBoot_err_t +VasEBoot_fs_blocklist_open (VasEBoot_file_t file, const char *name) { char *p = (char *) name; unsigned num = 0; unsigned i; - grub_disk_t disk = file->device->disk; - struct grub_fs_block *blocks; + VasEBoot_disk_t disk = file->device->disk; + struct VasEBoot_fs_block *blocks; /* First, count the number of blocks. */ do { num++; - p = grub_strchr (p, ','); + p = VasEBoot_strchr (p, ','); if (p) p++; } while (p); /* Allocate a block list. */ - blocks = grub_zalloc (sizeof (struct grub_fs_block) * (num + 1)); + blocks = VasEBoot_zalloc (sizeof (struct VasEBoot_fs_block) * (num + 1)); if (! blocks) return 0; @@ -161,77 +161,77 @@ grub_fs_blocklist_open (grub_file_t file, const char *name) { if (*p != '+') { - blocks[i].offset = grub_strtoull (p, &p, 0); - if (grub_errno != GRUB_ERR_NONE || *p != '+') + blocks[i].offset = VasEBoot_strtoull (p, &p, 0); + if (VasEBoot_errno != VasEBoot_ERR_NONE || *p != '+') { - grub_error (GRUB_ERR_BAD_FILENAME, + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name); goto fail; } } p++; - blocks[i].length = grub_strtoul (p, &p, 0); - if (grub_errno != GRUB_ERR_NONE + blocks[i].length = VasEBoot_strtoul (p, &p, 0); + if (VasEBoot_errno != VasEBoot_ERR_NONE || blocks[i].length == 0 - || (*p && *p != ',' && ! grub_isspace (*p))) + || (*p && *p != ',' && ! VasEBoot_isspace (*p))) { - grub_error (GRUB_ERR_BAD_FILENAME, + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name); goto fail; } if (disk->total_sectors < blocks[i].offset + blocks[i].length) { - grub_error (GRUB_ERR_BAD_FILENAME, "beyond the total sectors"); + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, "beyond the total sectors"); goto fail; } - file->size += (blocks[i].length << GRUB_DISK_SECTOR_BITS); + file->size += (blocks[i].length << VasEBoot_DISK_SECTOR_BITS); p++; } file->data = blocks; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (blocks); - return grub_errno; + VasEBoot_free (blocks); + return VasEBoot_errno; } -static grub_ssize_t -grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_fs_blocklist_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - struct grub_fs_block *p; - grub_disk_addr_t sector; - grub_off_t offset; - grub_ssize_t ret = 0; + struct VasEBoot_fs_block *p; + VasEBoot_disk_addr_t sector; + VasEBoot_off_t offset; + VasEBoot_ssize_t ret = 0; if (len > file->size - file->offset) len = file->size - file->offset; - sector = (file->offset >> GRUB_DISK_SECTOR_BITS); - offset = (file->offset & (GRUB_DISK_SECTOR_SIZE - 1)); + sector = (file->offset >> VasEBoot_DISK_SECTOR_BITS); + offset = (file->offset & (VasEBoot_DISK_SECTOR_SIZE - 1)); for (p = file->data; p->length && len > 0; p++) { if (sector < p->length) { - grub_size_t size; + VasEBoot_size_t size; size = len; - if (((size + offset + GRUB_DISK_SECTOR_SIZE - 1) - >> GRUB_DISK_SECTOR_BITS) > p->length - sector) - size = ((p->length - sector) << GRUB_DISK_SECTOR_BITS) - offset; + if (((size + offset + VasEBoot_DISK_SECTOR_SIZE - 1) + >> VasEBoot_DISK_SECTOR_BITS) > p->length - sector) + size = ((p->length - sector) << VasEBoot_DISK_SECTOR_BITS) - offset; - if (grub_disk_read (file->device->disk, p->offset + sector, offset, - size, buf) != GRUB_ERR_NONE) + if (VasEBoot_disk_read (file->device->disk, p->offset + sector, offset, + size, buf) != VasEBoot_ERR_NONE) return -1; ret += size; len -= size; - sector -= ((size + offset) >> GRUB_DISK_SECTOR_BITS); - offset = ((size + offset) & (GRUB_DISK_SECTOR_SIZE - 1)); + sector -= ((size + offset) >> VasEBoot_DISK_SECTOR_BITS); + offset = ((size + offset) & (VasEBoot_DISK_SECTOR_SIZE - 1)); } else sector -= p->length; @@ -240,12 +240,12 @@ grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len) return ret; } -struct grub_fs grub_fs_blocklist = +struct VasEBoot_fs VasEBoot_fs_blocklist = { .name = "blocklist", .dir = 0, - .open = grub_fs_blocklist_open, - .read = grub_fs_blocklist_read, + .open = VasEBoot_fs_blocklist_open, + .read = VasEBoot_fs_blocklist_read, .close = 0, .next = 0 }; diff --git a/VasEBoot-core/kern/generic/millisleep.c b/VasEBoot-core/kern/generic/millisleep.c index 9d5971f21..d99182309 100644 --- a/VasEBoot-core/kern/generic/millisleep.c +++ b/VasEBoot-core/kern/generic/millisleep.c @@ -2,38 +2,38 @@ * The generic implementation of these functions can be used for architectures * or platforms that do not have a more specialized implementation. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include void -grub_millisleep (grub_uint32_t ms) +VasEBoot_millisleep (VasEBoot_uint32_t ms) { - grub_uint64_t start; + VasEBoot_uint64_t start; - start = grub_get_time_ms (); + start = VasEBoot_get_time_ms (); /* Instead of setting an end time and looping while the current time is less than that, comparing the elapsed sleep time with the desired sleep time handles the (unlikely!) case that the timer would wrap around during the sleep. */ - while (grub_get_time_ms () - start < ms) - grub_cpu_idle (); + while (VasEBoot_get_time_ms () - start < ms) + VasEBoot_cpu_idle (); } diff --git a/VasEBoot-core/kern/generic/rtc_get_time_ms.c b/VasEBoot-core/kern/generic/rtc_get_time_ms.c index 3e39c8fe1..5d3195223 100644 --- a/VasEBoot-core/kern/generic/rtc_get_time_ms.c +++ b/VasEBoot-core/kern/generic/rtc_get_time_ms.c @@ -2,30 +2,30 @@ * The generic implementation of these functions can be used for architectures * or platforms that do not have a more specialized implementation. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include /* Calculate the time in milliseconds since the epoch based on the RTC. */ -grub_uint64_t -grub_rtc_get_time_ms (void) +VasEBoot_uint64_t +VasEBoot_rtc_get_time_ms (void) { /* By dimensional analysis: @@ -33,6 +33,6 @@ grub_rtc_get_time_ms (void) ------- * ----------- * ----------- = 1000*N/T ms 1 s 1 T rtc ticks */ - grub_uint64_t ticks_ms_per_sec = ((grub_uint64_t) 1000) * grub_get_rtc (); - return grub_divmod64 (ticks_ms_per_sec, GRUB_TICKS_PER_SECOND ? : 1000, 0); + VasEBoot_uint64_t ticks_ms_per_sec = ((VasEBoot_uint64_t) 1000) * VasEBoot_get_rtc (); + return VasEBoot_divmod64 (ticks_ms_per_sec, VasEBoot_TICKS_PER_SECOND ? : 1000, 0); } diff --git a/VasEBoot-core/kern/i386/coreboot/cbtable.c b/VasEBoot-core/kern/i386/coreboot/cbtable.c index 1669bc0ca..942158df1 100644 --- a/VasEBoot-core/kern/i386/coreboot/cbtable.c +++ b/VasEBoot-core/kern/i386/coreboot/cbtable.c @@ -1,57 +1,57 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -/* Helper for grub_linuxbios_table_iterate. */ +/* Helper for VasEBoot_linuxbios_table_iterate. */ static int -check_signature (grub_linuxbios_table_header_t tbl_header) +check_signature (VasEBoot_linuxbios_table_header_t tbl_header) { - if (! grub_memcmp (tbl_header->signature, "LBIO", 4)) + if (! VasEBoot_memcmp (tbl_header->signature, "LBIO", 4)) return 1; return 0; } -grub_err_t -grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t, +VasEBoot_err_t +VasEBoot_linuxbios_table_iterate (int (*hook) (VasEBoot_linuxbios_table_item_t, void *), void *hook_data) { - grub_linuxbios_table_header_t table_header; - grub_linuxbios_table_item_t table_item; + VasEBoot_linuxbios_table_header_t table_header; + VasEBoot_linuxbios_table_item_t table_item; /* Assuming table_header is aligned to its size (8 bytes). */ - for (table_header = (grub_linuxbios_table_header_t) 0x500; - table_header < (grub_linuxbios_table_header_t) 0x1000; table_header++) + for (table_header = (VasEBoot_linuxbios_table_header_t) 0x500; + table_header < (VasEBoot_linuxbios_table_header_t) 0x1000; table_header++) if (check_signature (table_header)) goto signature_found; - for (table_header = (grub_linuxbios_table_header_t) 0xf0000; - table_header < (grub_linuxbios_table_header_t) 0x100000; table_header++) + for (table_header = (VasEBoot_linuxbios_table_header_t) 0xf0000; + table_header < (VasEBoot_linuxbios_table_header_t) 0x100000; table_header++) if (check_signature (table_header)) goto signature_found; @@ -60,19 +60,19 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t, signature_found: table_item = - (grub_linuxbios_table_item_t) ((char *) table_header + + (VasEBoot_linuxbios_table_item_t) ((char *) table_header + table_header->header_size); - for (; table_item < (grub_linuxbios_table_item_t) ((char *) table_header + for (; table_item < (VasEBoot_linuxbios_table_item_t) ((char *) table_header + table_header->header_size + table_header->table_size); - table_item = (grub_linuxbios_table_item_t) ((char *) table_item + table_item->size)) + table_item = (VasEBoot_linuxbios_table_item_t) ((char *) table_item + table_item->size)) { - if (table_item->tag == GRUB_LINUXBIOS_MEMBER_LINK - && check_signature ((grub_linuxbios_table_header_t) (grub_addr_t) - *(grub_uint64_t *) (table_item + 1))) + if (table_item->tag == VasEBoot_LINUXBIOS_MEMBER_LINK + && check_signature ((VasEBoot_linuxbios_table_header_t) (VasEBoot_addr_t) + *(VasEBoot_uint64_t *) (table_item + 1))) { - table_header = (grub_linuxbios_table_header_t) (grub_addr_t) - *(grub_uint64_t *) (table_item + 1); + table_header = (VasEBoot_linuxbios_table_header_t) (VasEBoot_addr_t) + *(VasEBoot_uint64_t *) (table_item + 1); goto signature_found; } if (hook (table_item, hook_data)) diff --git a/VasEBoot-core/kern/i386/coreboot/init.c b/VasEBoot-core/kern/i386/coreboot/init.c index 3314f027f..750b21aca 100644 --- a/VasEBoot-core/kern/i386/coreboot/init.c +++ b/VasEBoot-core/kern/i386/coreboot/init.c @@ -1,79 +1,79 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -extern grub_uint8_t _start[]; -extern grub_uint8_t _end[]; -extern grub_uint8_t _edata[]; +extern VasEBoot_uint8_t _start[]; +extern VasEBoot_uint8_t _end[]; +extern VasEBoot_uint8_t _edata[]; void __attribute__ ((noreturn)) -grub_exit (void) +VasEBoot_exit (void) { - /* 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(). */ + /* We can't use VasEBoot_fatal() in this function. This would create an infinite + loop, since VasEBoot_fatal() calls VasEBoot_abort() which in turn calls VasEBoot_exit(). */ while (1) - grub_cpu_idle (); + VasEBoot_cpu_idle (); } -grub_addr_t grub_modbase = GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR; -static grub_uint64_t modend; +VasEBoot_addr_t VasEBoot_modbase = VasEBoot_KERNEL_I386_COREBOOT_MODULES_ADDR; +static VasEBoot_uint64_t modend; static int have_memory = 0; -/* Helper for grub_machine_init. */ +/* Helper for VasEBoot_machine_init. */ static int -heap_init (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +heap_init (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data __attribute__ ((unused))) { - grub_uint64_t begin = addr, end = addr + size; + VasEBoot_uint64_t begin = addr, end = addr + size; -#if GRUB_CPU_SIZEOF_VOID_P == 4 +#if VasEBoot_CPU_SIZEOF_VOID_P == 4 /* Restrict ourselves to 32-bit memory space. */ - if (begin > GRUB_ULONG_MAX) + if (begin > VasEBoot_ULONG_MAX) return 0; - if (end > GRUB_ULONG_MAX) - end = GRUB_ULONG_MAX; + if (end > VasEBoot_ULONG_MAX) + end = VasEBoot_ULONG_MAX; #endif - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; /* Avoid the lower memory. */ - if (begin < GRUB_MEMORY_MACHINE_LOWER_SIZE) - begin = GRUB_MEMORY_MACHINE_LOWER_SIZE; + if (begin < VasEBoot_MEMORY_MACHINE_LOWER_SIZE) + begin = VasEBoot_MEMORY_MACHINE_LOWER_SIZE; if (modend && begin < modend) begin = modend; @@ -81,63 +81,63 @@ heap_init (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, if (end <= begin) return 0; - grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) (end - begin)); + VasEBoot_mm_init_region ((void *) (VasEBoot_addr_t) begin, (VasEBoot_size_t) (end - begin)); have_memory = 1; return 0; } -#ifndef GRUB_MACHINE_MULTIBOOT +#ifndef VasEBoot_MACHINE_MULTIBOOT void -grub_machine_init (void) +VasEBoot_machine_init (void) { - modend = grub_modules_get_end (); + modend = VasEBoot_modules_get_end (); - grub_video_coreboot_fb_early_init (); + VasEBoot_video_coreboot_fb_early_init (); - grub_vga_text_init (); + VasEBoot_vga_text_init (); - grub_machine_mmap_iterate (heap_init, NULL); + VasEBoot_machine_mmap_iterate (heap_init, NULL); if (!have_memory) - grub_fatal ("No memory found"); + VasEBoot_fatal ("No memory found"); - grub_video_coreboot_fb_late_init (); + VasEBoot_video_coreboot_fb_late_init (); - grub_font_init (); - grub_gfxterm_init (); + VasEBoot_font_init (); + VasEBoot_gfxterm_init (); - grub_tsc_init (); + VasEBoot_tsc_init (); } #else void -grub_machine_init (void) +VasEBoot_machine_init (void) { - modend = grub_modules_get_end (); + modend = VasEBoot_modules_get_end (); - grub_vga_text_init (); + VasEBoot_vga_text_init (); - grub_machine_mmap_init (); - grub_machine_mmap_iterate (heap_init, NULL); + VasEBoot_machine_mmap_init (); + VasEBoot_machine_mmap_iterate (heap_init, NULL); - grub_tsc_init (); + VasEBoot_tsc_init (); } #endif void -grub_machine_get_bootlocation (char **device __attribute__ ((unused)), +VasEBoot_machine_get_bootlocation (char **device __attribute__ ((unused)), char **path __attribute__ ((unused))) { } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) - grub_vga_text_fini (); - grub_stop_floppy (); + if (flags & VasEBoot_LOADER_FLAG_NORETURN) + VasEBoot_vga_text_fini (); + VasEBoot_stop_floppy (); } diff --git a/VasEBoot-core/kern/i386/coreboot/mmap.c b/VasEBoot-core/kern/i386/coreboot/mmap.c index 4d29f6b7d..8eee29526 100644 --- a/VasEBoot-core/kern/i386/coreboot/mmap.c +++ b/VasEBoot-core/kern/i386/coreboot/mmap.c @@ -1,57 +1,57 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -/* Context for grub_machine_mmap_iterate. */ -struct grub_machine_mmap_iterate_ctx +/* Context for VasEBoot_machine_mmap_iterate. */ +struct VasEBoot_machine_mmap_iterate_ctx { - grub_memory_hook_t hook; + VasEBoot_memory_hook_t hook; void *hook_data; }; -#define GRUB_MACHINE_MEMORY_BADRAM 5 +#define VasEBoot_MACHINE_MEMORY_BADRAM 5 -/* Helper for grub_machine_mmap_iterate. */ +/* Helper for VasEBoot_machine_mmap_iterate. */ static int -iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) +iterate_linuxbios_table (VasEBoot_linuxbios_table_item_t table_item, void *data) { - struct grub_machine_mmap_iterate_ctx *ctx = data; + struct VasEBoot_machine_mmap_iterate_ctx *ctx = data; mem_region_t mem_region; - if (table_item->tag != GRUB_LINUXBIOS_MEMBER_MEMORY) + if (table_item->tag != VasEBoot_LINUXBIOS_MEMBER_MEMORY) return 0; mem_region = (mem_region_t) ((long) table_item + - sizeof (struct grub_linuxbios_table_item)); + sizeof (struct VasEBoot_linuxbios_table_item)); for (; (long) mem_region < (long) table_item + (long) table_item->size; mem_region++) { - grub_uint64_t start = mem_region->addr; - grub_uint64_t end = mem_region->addr + mem_region->size; + VasEBoot_uint64_t start = mem_region->addr; + VasEBoot_uint64_t end = mem_region->addr + mem_region->size; /* Mark region 0xa0000 - 0x100000 as reserved. */ if (start < 0x100000 && end >= 0xa0000 - && mem_region->type == GRUB_MACHINE_MEMORY_AVAILABLE) + && mem_region->type == VasEBoot_MACHINE_MEMORY_AVAILABLE) { if (start < 0xa0000 && ctx->hook (start, 0xa0000 - start, @@ -67,7 +67,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) continue; if (ctx->hook (start, (end > 0x100000 ? 0x100000 : end) - start, - GRUB_MEMORY_RESERVED, + VasEBoot_MEMORY_RESERVED, ctx->hook_data)) return 1; start = 0x100000; @@ -87,12 +87,12 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) return 0; } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - struct grub_machine_mmap_iterate_ctx ctx = { hook, hook_data }; + struct VasEBoot_machine_mmap_iterate_ctx ctx = { hook, hook_data }; - grub_linuxbios_table_iterate (iterate_linuxbios_table, &ctx); + VasEBoot_linuxbios_table_iterate (iterate_linuxbios_table, &ctx); return 0; } diff --git a/VasEBoot-core/kern/i386/coreboot/startup.S b/VasEBoot-core/kern/i386/coreboot/startup.S index c8486548d..faeed63a4 100644 --- a/VasEBoot-core/kern/i386/coreboot/startup.S +++ b/VasEBoot-core/kern/i386/coreboot/startup.S @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include /* - * Note: GRUB is compiled with the options -mrtd and -mregparm=3. + * Note: VasEBoot is compiled with the options -mrtd and -mregparm=3. * So the first three arguments are passed in %eax, %edx, and %ecx, * respectively, and if a function has a fixed number of arguments * and the number if greater than three, the function must return @@ -36,7 +36,7 @@ .globl start, _start start: _start: -#ifdef GRUB_MACHINE_MULTIBOOT +#ifdef VasEBoot_MACHINE_MULTIBOOT cmpl $MULTIBOOT_BOOTLOADER_MAGIC, %eax jne 0f movl %ebx, EXT_C(startup_multiboot_info) @@ -44,13 +44,13 @@ _start: #endif /* initialize the stack */ - movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp + movl $VasEBoot_MEMORY_MACHINE_PROT_STACK, %esp /* jump to the main body of C code */ - jmp EXT_C(grub_main) + jmp EXT_C(VasEBoot_main) /* - * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). + * Support for booting VasEBoot from a Multiboot boot loader (e.g. VasEBoot itself). */ .p2align 2 /* force 4-byte alignment */ multiboot_header: diff --git a/VasEBoot-core/kern/i386/dl.c b/VasEBoot-core/kern/i386/dl.c index 1346da5cc..2d909aa6d 100644 --- a/VasEBoot-core/kern/i386/dl.c +++ b/VasEBoot-core/kern/i386/dl.c @@ -1,31 +1,31 @@ /* dl-386.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; @@ -33,15 +33,15 @@ grub_arch_dl_check_header (void *ehdr) if (e->e_ident[EI_CLASS] != ELFCLASS32 || e->e_ident[EI_DATA] != ELFDATA2LSB || e->e_machine != EM_386) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Relocate symbols. */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf_Rel *rel, *max; @@ -54,7 +54,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, Elf_Sym *sym; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); addr = (Elf_Word *) ((char *) seg->addr + rel->r_offset); @@ -68,14 +68,14 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, break; case R_386_PC32: - *addr += (sym->st_value - (grub_addr_t) addr); + *addr += (sym->st_value - (VasEBoot_addr_t) addr); break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/i386/efi/init.c b/VasEBoot-core/kern/i386/efi/init.c index a28316cc6..dc1e41b62 100644 --- a/VasEBoot-core/kern/i386/efi/init.c +++ b/VasEBoot-core/kern/i386/efi/init.c @@ -1,43 +1,43 @@ /* init.c - initialize an x86-based EFI system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_efi_init (); - grub_tsc_init (); + VasEBoot_efi_init (); + VasEBoot_tsc_init (); } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) - grub_efi_fini (); + if (flags & VasEBoot_LOADER_FLAG_NORETURN) + VasEBoot_efi_fini (); } diff --git a/VasEBoot-core/kern/i386/efi/startup.S b/VasEBoot-core/kern/i386/efi/startup.S index fc5ea3dac..b27cc574a 100644 --- a/VasEBoot-core/kern/i386/efi/startup.S +++ b/VasEBoot-core/kern/i386/efi/startup.S @@ -1,24 +1,24 @@ -/* startup.S - bootstrap GRUB itself */ +/* startup.S - bootstrap VasEBoot itself */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include .file "startup.S" .text @@ -29,8 +29,8 @@ _start: * EFI_SYSTEM_TABLE * and EFI_HANDLE are passed on the stack. */ movl 4(%esp), %eax - movl %eax, EXT_C(grub_efi_image_handle) + movl %eax, EXT_C(VasEBoot_efi_image_handle) movl 8(%esp), %eax - movl %eax, EXT_C(grub_efi_system_table) - call EXT_C(grub_main) + movl %eax, EXT_C(VasEBoot_efi_system_table) + call EXT_C(VasEBoot_main) ret diff --git a/VasEBoot-core/kern/i386/efi/tsc.c b/VasEBoot-core/kern/i386/efi/tsc.c index 4b93ba8e1..529540ab3 100644 --- a/VasEBoot-core/kern/i386/efi/tsc.c +++ b/VasEBoot-core/kern/i386/efi/tsc.c @@ -3,38 +3,38 @@ * This module uses the PIT to calibrate the TSC to * real time. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include int -grub_tsc_calibrate_from_efi (void) +VasEBoot_tsc_calibrate_from_efi (void) { - grub_uint64_t start_tsc, end_tsc; + VasEBoot_uint64_t start_tsc, end_tsc; /* Use EFI Time Service to calibrate TSC */ - start_tsc = grub_get_tsc (); - efi_call_1 (grub_efi_system_table->boot_services->stall, 1000); - end_tsc = grub_get_tsc (); - grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); + start_tsc = VasEBoot_get_tsc (); + efi_call_1 (VasEBoot_efi_system_table->boot_services->stall, 1000); + end_tsc = VasEBoot_get_tsc (); + VasEBoot_tsc_rate = VasEBoot_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); return 1; } diff --git a/VasEBoot-core/kern/i386/ieee1275/startup.S b/VasEBoot-core/kern/i386/ieee1275/startup.S index 245583bdb..d0d4b03c4 100644 --- a/VasEBoot-core/kern/i386/ieee1275/startup.S +++ b/VasEBoot-core/kern/i386/ieee1275/startup.S @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include /* - * Note: GRUB is compiled with the options -mrtd and -mregparm=3. + * Note: VasEBoot is compiled with the options -mrtd and -mregparm=3. * So the first three arguments are passed in %eax, %edx, and %ecx, * respectively, and if a function has a fixed number of arguments * and the number if greater than three, the function must return @@ -36,6 +36,6 @@ start: _start: - movl %eax, EXT_C(grub_ieee1275_entry_fn) - jmp EXT_C(grub_main) + movl %eax, EXT_C(VasEBoot_ieee1275_entry_fn) + jmp EXT_C(VasEBoot_main) diff --git a/VasEBoot-core/kern/i386/int.S b/VasEBoot-core/kern/i386/int.S index 862a54202..3f4956901 100644 --- a/VasEBoot-core/kern/i386/int.S +++ b/VasEBoot-core/kern/i386/int.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -FUNCTION(grub_bios_interrupt) +FUNCTION(VasEBoot_bios_interrupt) pushf cli popf @@ -48,7 +48,7 @@ FUNCTION(grub_bios_interrupt) Via C3 CPUs have cache coherence problems, so we need to call wbinvd at these 2 points. As wbinvd slows down boot, don't do it on non-VIA. 9090 is nop nop. */ -VARIABLE(grub_bios_via_workaround1) +VARIABLE(VasEBoot_bios_via_workaround1) .byte 0x90, 0x90 PROT_TO_REAL @@ -100,7 +100,7 @@ intno: popf -VARIABLE(grub_bios_via_workaround2) +VARIABLE(VasEBoot_bios_via_workaround2) .byte 0x90, 0x90 REAL_TO_PROT diff --git a/VasEBoot-core/kern/i386/multiboot_mmap.c b/VasEBoot-core/kern/i386/multiboot_mmap.c index e8f4f34b9..fccadc4af 100644 --- a/VasEBoot-core/kern/i386/multiboot_mmap.c +++ b/VasEBoot-core/kern/i386/multiboot_mmap.c @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* A pointer to the MBI in its initial location. */ struct multiboot_info *startup_multiboot_info; @@ -31,33 +31,33 @@ static struct multiboot_info kern_multiboot_info; /* Unfortunately we can't use heap at this point. But 32 looks like a sane limit (used by memtest86). */ -static grub_uint8_t mmap_entries[sizeof (struct multiboot_mmap_entry) * 32]; +static VasEBoot_uint8_t mmap_entries[sizeof (struct multiboot_mmap_entry) * 32]; void -grub_machine_mmap_init (void) +VasEBoot_machine_mmap_init (void) { if (! startup_multiboot_info) - grub_fatal ("Unable to find Multiboot Information (is CONFIG_MULTIBOOT disabled in coreboot?)"); + VasEBoot_fatal ("Unable to find Multiboot Information (is CONFIG_MULTIBOOT disabled in coreboot?)"); /* Move MBI to a safe place. */ - grub_memmove (&kern_multiboot_info, startup_multiboot_info, sizeof (struct multiboot_info)); + VasEBoot_memmove (&kern_multiboot_info, startup_multiboot_info, sizeof (struct multiboot_info)); if ((kern_multiboot_info.flags & MULTIBOOT_INFO_MEM_MAP) == 0) - grub_fatal ("Missing Multiboot memory information"); + VasEBoot_fatal ("Missing Multiboot memory information"); /* Move the memory map to a safe place. */ if (kern_multiboot_info.mmap_length > sizeof (mmap_entries)) { - grub_printf ("WARNING: Memory map size exceeds limit (0x%x > 0x%x); it will be truncated\n", + VasEBoot_printf ("WARNING: Memory map size exceeds limit (0x%x > 0x%x); it will be truncated\n", kern_multiboot_info.mmap_length, sizeof (mmap_entries)); kern_multiboot_info.mmap_length = sizeof (mmap_entries); } - grub_memmove (mmap_entries, (void *) kern_multiboot_info.mmap_addr, kern_multiboot_info.mmap_length); - kern_multiboot_info.mmap_addr = (grub_uint32_t) mmap_entries; + VasEBoot_memmove (mmap_entries, (void *) kern_multiboot_info.mmap_addr, kern_multiboot_info.mmap_length); + kern_multiboot_info.mmap_addr = (VasEBoot_uint32_t) mmap_entries; } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { struct multiboot_mmap_entry *entry = (void *) kern_multiboot_info.mmap_addr; @@ -66,7 +66,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) if (hook (entry->addr, entry->len, entry->type, hook_data)) break; - entry = (void *) ((grub_addr_t) entry + entry->size + sizeof (entry->size)); + entry = (void *) ((VasEBoot_addr_t) entry + entry->size + sizeof (entry->size)); } return 0; diff --git a/VasEBoot-core/kern/i386/pc/acpi.c b/VasEBoot-core/kern/i386/pc/acpi.c index 297f5d05f..2e1e65fe3 100644 --- a/VasEBoot-core/kern/i386/pc/acpi.c +++ b/VasEBoot-core/kern/i386/pc/acpi.c @@ -1,83 +1,83 @@ /* acpi.c - get acpi tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -struct grub_acpi_rsdp_v10 * -grub_machine_acpi_get_rsdpv1 (void) +struct VasEBoot_acpi_rsdp_v10 * +VasEBoot_machine_acpi_get_rsdpv1 (void) { int ebda_len; - grub_uint8_t *ebda, *ptr; + VasEBoot_uint8_t *ebda, *ptr; - grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); - ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); - ebda_len = * (grub_uint16_t *) ebda; + VasEBoot_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + ebda = (VasEBoot_uint8_t *) ((* ((VasEBoot_uint16_t *) 0x40e)) << 4); + ebda_len = * (VasEBoot_uint16_t *) ebda; if (! ebda_len) /* FIXME do we really need this check? */ goto scan_bios; for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) - if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 - && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) - return (struct grub_acpi_rsdp_v10 *) ptr; + if (VasEBoot_memcmp (ptr, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0 + && ((struct VasEBoot_acpi_rsdp_v10 *) ptr)->revision == 0) + return (struct VasEBoot_acpi_rsdp_v10 *) ptr; scan_bios: - grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); - for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; + VasEBoot_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + for (ptr = (VasEBoot_uint8_t *) 0xe0000; ptr < (VasEBoot_uint8_t *) 0x100000; ptr += 16) - if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 - && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) - return (struct grub_acpi_rsdp_v10 *) ptr; + if (VasEBoot_memcmp (ptr, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0 + && ((struct VasEBoot_acpi_rsdp_v10 *) ptr)->revision == 0) + return (struct VasEBoot_acpi_rsdp_v10 *) ptr; return 0; } -struct grub_acpi_rsdp_v20 * -grub_machine_acpi_get_rsdpv2 (void) +struct VasEBoot_acpi_rsdp_v20 * +VasEBoot_machine_acpi_get_rsdpv2 (void) { int ebda_len; - grub_uint8_t *ebda, *ptr; + VasEBoot_uint8_t *ebda, *ptr; - grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); - ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); - ebda_len = * (grub_uint16_t *) ebda; + VasEBoot_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + ebda = (VasEBoot_uint8_t *) ((* ((VasEBoot_uint16_t *) 0x40e)) << 4); + ebda_len = * (VasEBoot_uint16_t *) ebda; if (! ebda_len) /* FIXME do we really need this check? */ goto scan_bios; for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) - if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 - && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0 - && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024 - && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length) + if (VasEBoot_memcmp (ptr, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0 + && ((struct VasEBoot_acpi_rsdp_v10 *) ptr)->revision != 0 + && ((struct VasEBoot_acpi_rsdp_v20 *) ptr)->length < 1024 + && VasEBoot_byte_checksum (ptr, ((struct VasEBoot_acpi_rsdp_v20 *) ptr)->length) == 0) - return (struct grub_acpi_rsdp_v20 *) ptr; + return (struct VasEBoot_acpi_rsdp_v20 *) ptr; scan_bios: - grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); - for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; + VasEBoot_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + for (ptr = (VasEBoot_uint8_t *) 0xe0000; ptr < (VasEBoot_uint8_t *) 0x100000; ptr += 16) - if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 - && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 - && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0 - && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024 - && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length) + if (VasEBoot_memcmp (ptr, VasEBoot_RSDP_SIGNATURE, VasEBoot_RSDP_SIGNATURE_SIZE) == 0 + && VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_acpi_rsdp_v10)) == 0 + && ((struct VasEBoot_acpi_rsdp_v10 *) ptr)->revision != 0 + && ((struct VasEBoot_acpi_rsdp_v20 *) ptr)->length < 1024 + && VasEBoot_byte_checksum (ptr, ((struct VasEBoot_acpi_rsdp_v20 *) ptr)->length) == 0) - return (struct grub_acpi_rsdp_v20 *) ptr; + return (struct VasEBoot_acpi_rsdp_v20 *) ptr; return 0; } diff --git a/VasEBoot-core/kern/i386/pc/init.c b/VasEBoot-core/kern/i386/pc/init.c index 27bc68b8a..73a44c0e3 100644 --- a/VasEBoot-core/kern/i386/pc/init.c +++ b/VasEBoot-core/kern/i386/pc/init.c @@ -1,45 +1,45 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include struct mem_region { - grub_addr_t addr; - grub_size_t size; + VasEBoot_addr_t addr; + VasEBoot_size_t size; }; #define MAX_REGIONS 32 @@ -47,67 +47,67 @@ struct mem_region static struct mem_region mem_regions[MAX_REGIONS]; static int num_regions; -void (*grub_pc_net_config) (char **device, char **path); +void (*VasEBoot_pc_net_config) (char **device, char **path); /* * return the real time in ticks, of which there are about * 18-20 per second */ -grub_uint64_t -grub_rtc_get_time_ms (void) +VasEBoot_uint64_t +VasEBoot_rtc_get_time_ms (void) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x1a, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x1a, ®s); return ((regs.ecx << 16) | (regs.edx & 0xffff)) * 55ULL; } void -grub_machine_get_bootlocation (char **device, char **path) +VasEBoot_machine_get_bootlocation (char **device, char **path) { char *ptr; - grub_uint8_t boot_drive, dos_part, bsd_part; + VasEBoot_uint8_t boot_drive, dos_part, bsd_part; - boot_drive = (grub_boot_device >> 24); - dos_part = (grub_boot_device >> 16); - bsd_part = (grub_boot_device >> 8); + boot_drive = (VasEBoot_boot_device >> 24); + dos_part = (VasEBoot_boot_device >> 16); + bsd_part = (VasEBoot_boot_device >> 8); /* No hardcoded root partition - make it from the boot drive and the partition number encoded at the install time. */ - if (boot_drive == GRUB_BOOT_MACHINE_PXE_DL) + if (boot_drive == VasEBoot_BOOT_MACHINE_PXE_DL) { - if (grub_pc_net_config) - grub_pc_net_config (device, path); + if (VasEBoot_pc_net_config) + VasEBoot_pc_net_config (device, path); return; } /* XXX: This should be enough. */ #define DEV_SIZE 100 - *device = grub_malloc (DEV_SIZE); + *device = VasEBoot_malloc (DEV_SIZE); ptr = *device; - grub_snprintf (*device, DEV_SIZE, + VasEBoot_snprintf (*device, DEV_SIZE, "%cd%u", (boot_drive & 0x80) ? 'h' : 'f', boot_drive & 0x7f); - ptr += grub_strlen (ptr); + ptr += VasEBoot_strlen (ptr); if (dos_part != 0xff) - grub_snprintf (ptr, DEV_SIZE - (ptr - *device), + VasEBoot_snprintf (ptr, DEV_SIZE - (ptr - *device), ",%u", dos_part + 1); - ptr += grub_strlen (ptr); + ptr += VasEBoot_strlen (ptr); if (bsd_part != 0xff) - grub_snprintf (ptr, DEV_SIZE - (ptr - *device), ",%u", + VasEBoot_snprintf (ptr, DEV_SIZE - (ptr - *device), ",%u", bsd_part + 1); - ptr += grub_strlen (ptr); + ptr += VasEBoot_strlen (ptr); *ptr = 0; } /* Add a memory region. */ static void -add_mem_region (grub_addr_t addr, grub_size_t size) +add_mem_region (VasEBoot_addr_t addr, VasEBoot_size_t size) { if (num_regions == MAX_REGIONS) /* Ignore. */ @@ -145,38 +145,38 @@ compact_mem_regions (void) mem_regions[i].size = (mem_regions[j].addr + mem_regions[j].size - mem_regions[i].addr); - grub_memmove (mem_regions + j, mem_regions + j + 1, + VasEBoot_memmove (mem_regions + j, mem_regions + j + 1, (num_regions - j - 1) * sizeof (struct mem_region)); i--; num_regions--; } } -grub_addr_t grub_modbase; -extern grub_uint8_t _start[], _edata[]; +VasEBoot_addr_t VasEBoot_modbase; +extern VasEBoot_uint8_t _start[], _edata[]; -/* Helper for grub_machine_init. */ +/* Helper for VasEBoot_machine_init. */ static int -mmap_iterate_hook (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, +mmap_iterate_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data __attribute__ ((unused))) { /* Avoid the lower memory. */ - if (addr < GRUB_MEMORY_MACHINE_UPPER_START) + if (addr < VasEBoot_MEMORY_MACHINE_UPPER_START) { - if (size <= GRUB_MEMORY_MACHINE_UPPER_START - addr) + if (size <= VasEBoot_MEMORY_MACHINE_UPPER_START - addr) return 0; - size -= GRUB_MEMORY_MACHINE_UPPER_START - addr; - addr = GRUB_MEMORY_MACHINE_UPPER_START; + size -= VasEBoot_MEMORY_MACHINE_UPPER_START - addr; + addr = VasEBoot_MEMORY_MACHINE_UPPER_START; } /* Ignore >4GB. */ - if (addr <= 0xFFFFFFFF && type == GRUB_MEMORY_AVAILABLE) + if (addr <= 0xFFFFFFFF && type == VasEBoot_MEMORY_AVAILABLE) { - grub_size_t len; + VasEBoot_size_t len; - len = (grub_size_t) ((addr + size > 0xFFFFFFFF) + len = (VasEBoot_size_t) ((addr + size > 0xFFFFFFFF) ? 0xFFFFFFFF - addr : size); add_mem_region (addr, len); @@ -185,52 +185,52 @@ mmap_iterate_hook (grub_uint64_t addr, grub_uint64_t size, return 0; } -extern grub_uint16_t grub_bios_via_workaround1, grub_bios_via_workaround2; +extern VasEBoot_uint16_t VasEBoot_bios_via_workaround1, VasEBoot_bios_via_workaround2; /* Via needs additional wbinvd. */ static void -grub_via_workaround_init (void) +VasEBoot_via_workaround_init (void) { - grub_uint32_t manufacturer[3], max_cpuid; - if (! grub_cpu_is_cpuid_supported ()) + VasEBoot_uint32_t manufacturer[3], max_cpuid; + if (! VasEBoot_cpu_is_cpuid_supported ()) return; - grub_cpuid (0, max_cpuid, manufacturer[0], manufacturer[2], manufacturer[1]); + VasEBoot_cpuid (0, max_cpuid, manufacturer[0], manufacturer[2], manufacturer[1]); - if (grub_memcmp (manufacturer, "CentaurHauls", 12) != 0) + if (VasEBoot_memcmp (manufacturer, "CentaurHauls", 12) != 0) return; - grub_bios_via_workaround1 = 0x090f; - grub_bios_via_workaround2 = 0x090f; + VasEBoot_bios_via_workaround1 = 0x090f; + VasEBoot_bios_via_workaround2 = 0x090f; asm volatile ("wbinvd"); } void -grub_machine_init (void) +VasEBoot_machine_init (void) { int i; #if 0 - int grub_lower_mem; + int VasEBoot_lower_mem; #endif - grub_addr_t modend; + VasEBoot_addr_t modend; /* This has to happen before any BIOS calls. */ - grub_via_workaround_init (); + VasEBoot_via_workaround_init (); - grub_modbase = GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR + (_edata - _start); + VasEBoot_modbase = VasEBoot_MEMORY_MACHINE_DECOMPRESSION_ADDR + (_edata - _start); /* Initialize the console as early as possible. */ - grub_console_init (); + VasEBoot_console_init (); - /* This sanity check is useless since top of GRUB_MEMORY_MACHINE_RESERVED_END + /* This sanity check is useless since top of VasEBoot_MEMORY_MACHINE_RESERVED_END is used for stack and if it's unavailable we wouldn't have gotten so far. */ #if 0 - grub_lower_mem = grub_get_conv_memsize () << 10; + VasEBoot_lower_mem = VasEBoot_get_conv_memsize () << 10; /* Sanity check. */ - if (grub_lower_mem < GRUB_MEMORY_MACHINE_RESERVED_END) - grub_fatal ("too small memory"); + if (VasEBoot_lower_mem < VasEBoot_MEMORY_MACHINE_RESERVED_END) + VasEBoot_fatal ("too small memory"); #endif /* FIXME: This prevents loader/i386/linux.c from using low memory. When our @@ -238,34 +238,34 @@ grub_machine_init (void) no longer be a problem. */ #if 0 /* Add the lower memory into free memory. */ - if (grub_lower_mem >= GRUB_MEMORY_MACHINE_RESERVED_END) - add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END, - grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END); + if (VasEBoot_lower_mem >= VasEBoot_MEMORY_MACHINE_RESERVED_END) + add_mem_region (VasEBoot_MEMORY_MACHINE_RESERVED_END, + VasEBoot_lower_mem - VasEBoot_MEMORY_MACHINE_RESERVED_END); #endif - grub_machine_mmap_iterate (mmap_iterate_hook, NULL); + VasEBoot_machine_mmap_iterate (mmap_iterate_hook, NULL); compact_mem_regions (); - modend = grub_modules_get_end (); + modend = VasEBoot_modules_get_end (); for (i = 0; i < num_regions; i++) { - grub_addr_t beg = mem_regions[i].addr; - grub_addr_t fin = mem_regions[i].addr + mem_regions[i].size; + VasEBoot_addr_t beg = mem_regions[i].addr; + VasEBoot_addr_t fin = mem_regions[i].addr + mem_regions[i].size; if (modend && beg < modend) beg = modend; if (beg >= fin) continue; - grub_mm_init_region ((void *) beg, fin - beg); + VasEBoot_mm_init_region ((void *) beg, fin - beg); } - grub_tsc_init (); + VasEBoot_tsc_init (); } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) - grub_console_fini (); - grub_stop_floppy (); + if (flags & VasEBoot_LOADER_FLAG_NORETURN) + VasEBoot_console_fini (); + VasEBoot_stop_floppy (); } diff --git a/VasEBoot-core/kern/i386/pc/mmap.c b/VasEBoot-core/kern/i386/pc/mmap.c index c0c3c3585..b4d9f81a2 100644 --- a/VasEBoot-core/kern/i386/pc/mmap.c +++ b/VasEBoot-core/kern/i386/pc/mmap.c @@ -1,71 +1,71 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -struct grub_machine_mmap_entry +struct VasEBoot_machine_mmap_entry { - grub_uint32_t size; - grub_uint64_t addr; - grub_uint64_t len; -#define GRUB_MACHINE_MEMORY_AVAILABLE 1 -#define GRUB_MACHINE_MEMORY_RESERVED 2 -#define GRUB_MACHINE_MEMORY_ACPI 3 -#define GRUB_MACHINE_MEMORY_NVS 4 -#define GRUB_MACHINE_MEMORY_BADRAM 5 - grub_uint32_t type; -} GRUB_PACKED; + VasEBoot_uint32_t size; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t len; +#define VasEBoot_MACHINE_MEMORY_AVAILABLE 1 +#define VasEBoot_MACHINE_MEMORY_RESERVED 2 +#define VasEBoot_MACHINE_MEMORY_ACPI 3 +#define VasEBoot_MACHINE_MEMORY_NVS 4 +#define VasEBoot_MACHINE_MEMORY_BADRAM 5 + VasEBoot_uint32_t type; +} VasEBoot_PACKED; /* * - * grub_get_conv_memsize(i) : return the conventional memory size in KB. + * VasEBoot_get_conv_memsize(i) : return the conventional memory size in KB. * BIOS call "INT 12H" to get conventional memory size * The return value in AX. */ -static inline grub_uint16_t -grub_get_conv_memsize (void) +static inline VasEBoot_uint16_t +VasEBoot_get_conv_memsize (void) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x12, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x12, ®s); return regs.eax & 0xffff; } /* - * grub_get_ext_memsize() : return the extended memory size in KB. + * VasEBoot_get_ext_memsize() : return the extended memory size in KB. * BIOS call "INT 15H, AH=88H" to get extended memory size * The return value in AX. * */ -static inline grub_uint16_t -grub_get_ext_memsize (void) +static inline VasEBoot_uint16_t +VasEBoot_get_ext_memsize (void) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x8800; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x15, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x15, ®s); return regs.eax & 0xffff; } @@ -76,14 +76,14 @@ grub_get_ext_memsize (void) BX = memory above 16M in 64K parts. */ -static inline grub_uint32_t -grub_get_eisa_mmap (void) +static inline VasEBoot_uint32_t +VasEBoot_get_eisa_mmap (void) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.eax = 0xe801; - grub_bios_interrupt (0x15, ®s); + VasEBoot_bios_interrupt (0x15, ®s); if ((regs.eax & 0xff00) == 0x8600) return 0; @@ -93,7 +93,7 @@ grub_get_eisa_mmap (void) /* * - * grub_get_mmap_entry(addr, cont) : address and old continuation value (zero to + * VasEBoot_get_mmap_entry(addr, cont) : address and old continuation value (zero to * start), for the Query System Address Map BIOS call. * * Sets the first 4-byte int value of "addr" to the size returned by @@ -103,17 +103,17 @@ grub_get_eisa_mmap (void) */ /* Get a memory map entry. Return next continuation value. Zero means the end. */ -static grub_uint32_t -grub_get_mmap_entry (struct grub_machine_mmap_entry *entry, - grub_uint32_t cont) +static VasEBoot_uint32_t +VasEBoot_get_mmap_entry (struct VasEBoot_machine_mmap_entry *entry, + VasEBoot_uint32_t cont) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; /* place address (+4) in ES:DI */ - regs.es = ((grub_addr_t) &entry->addr) >> 4; - regs.edi = ((grub_addr_t) &entry->addr) & 0xf; + regs.es = ((VasEBoot_addr_t) &entry->addr) >> 4; + regs.edi = ((VasEBoot_addr_t) &entry->addr) & 0xf; /* set continuation value */ regs.ebx = cont; @@ -125,10 +125,10 @@ grub_get_mmap_entry (struct grub_machine_mmap_entry *entry, regs.edx = 0x534d4150; regs.eax = 0xe820; - grub_bios_interrupt (0x15, ®s); + VasEBoot_bios_interrupt (0x15, ®s); /* write length of buffer (zero if error) into ADDR */ - if ((regs.flags & GRUB_CPU_INT_FLAGS_CARRY) || regs.eax != 0x534d4150 + if ((regs.flags & VasEBoot_CPU_INT_FLAGS_CARRY) || regs.eax != 0x534d4150 || regs.ecx < 0x14 || regs.ecx > 0x400) entry->size = 0; else @@ -138,19 +138,19 @@ grub_get_mmap_entry (struct grub_machine_mmap_entry *entry, return regs.ebx; } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - grub_uint32_t cont = 0; - struct grub_machine_mmap_entry *entry - = (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_uint32_t cont = 0; + struct VasEBoot_machine_mmap_entry *entry + = (struct VasEBoot_machine_mmap_entry *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; int e820_works = 0; while (1) { - grub_memset (entry, 0, sizeof (*entry)); + VasEBoot_memset (entry, 0, sizeof (*entry)); - cont = grub_get_mmap_entry (entry, cont); + cont = VasEBoot_get_mmap_entry (entry, cont); if (!entry->size) break; @@ -159,7 +159,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) e820_works = 1; if (entry->len && hook (entry->addr, entry->len, - /* GRUB mmaps have been defined to match with + /* VasEBoot mmaps have been defined to match with the E820 definition. Therefore, we can just pass type through. */ entry->type, hook_data)) @@ -171,22 +171,22 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) if (!e820_works) { - grub_uint32_t eisa_mmap = grub_get_eisa_mmap (); + VasEBoot_uint32_t eisa_mmap = VasEBoot_get_eisa_mmap (); - if (hook (0x0, ((grub_uint32_t) grub_get_conv_memsize ()) << 10, - GRUB_MEMORY_AVAILABLE, hook_data)) + if (hook (0x0, ((VasEBoot_uint32_t) VasEBoot_get_conv_memsize ()) << 10, + VasEBoot_MEMORY_AVAILABLE, hook_data)) return 0; if (eisa_mmap) { if (hook (0x100000, (eisa_mmap & 0xFFFF) << 10, - GRUB_MEMORY_AVAILABLE, hook_data) == 0) - hook (0x1000000, eisa_mmap & ~0xFFFF, GRUB_MEMORY_AVAILABLE, + VasEBoot_MEMORY_AVAILABLE, hook_data) == 0) + hook (0x1000000, eisa_mmap & ~0xFFFF, VasEBoot_MEMORY_AVAILABLE, hook_data); } else - hook (0x100000, ((grub_uint32_t) grub_get_ext_memsize ()) << 10, - GRUB_MEMORY_AVAILABLE, hook_data); + hook (0x100000, ((VasEBoot_uint32_t) VasEBoot_get_ext_memsize ()) << 10, + VasEBoot_MEMORY_AVAILABLE, hook_data); } return 0; diff --git a/VasEBoot-core/kern/i386/pc/startup.S b/VasEBoot-core/kern/i386/pc/startup.S index b8a9b33b4..22d16e7b5 100644 --- a/VasEBoot-core/kern/i386/pc/startup.S +++ b/VasEBoot-core/kern/i386/pc/startup.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ @@ -34,7 +34,7 @@ */ /* - * Note: GRUB is compiled with the options -mrtd and -mregparm=3. + * Note: VasEBoot is compiled with the options -mrtd and -mregparm=3. * So the first three arguments are passed in %eax, %edx, and %ecx, * respectively, and if a function has a fixed number of arguments * and the number is greater than three, the function must return @@ -42,10 +42,10 @@ */ #include -#include +#include #include #ifdef __APPLE__ -#include +#include #endif .file "startup.S" @@ -63,7 +63,7 @@ LOCAL(start): movl %ecx, (LOCAL(real_to_prot_addr) - _start) (%esi) movl %edi, (LOCAL(prot_to_real_addr) - _start) (%esi) - movl %eax, (EXT_C(grub_realidt) - _start) (%esi) + movl %eax, (EXT_C(VasEBoot_realidt) - _start) (%esi) /* copy back the decompressed part (except the modules) */ #ifdef __APPLE__ @@ -82,8 +82,8 @@ LOCAL(cont): #if 0 /* copy modules before cleaning out the bss */ - movl EXT_C(grub_total_module_size), %ecx - movl EXT_C(grub_kernel_image_size), %esi + movl EXT_C(VasEBoot_total_module_size), %ecx + movl EXT_C(VasEBoot_kernel_image_size), %esi addl %ecx, %esi addl $_start, %esi decl %esi @@ -100,7 +100,7 @@ LOCAL(cont): movl $EXT_C(_edata), %edi /* compute the bss length */ - movl $GRUB_MEMORY_MACHINE_SCRATCH_ADDR, %ecx + movl $VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, %ecx #else /* clean out the bss */ movl $BSS_START_SYMBOL, %edi @@ -116,12 +116,12 @@ LOCAL(cont): rep stosb - movl %edx, EXT_C(grub_boot_device) + movl %edx, EXT_C(VasEBoot_boot_device) /* * Call the start of main body of C code. */ - call EXT_C(grub_main) + call EXT_C(VasEBoot_main) LOCAL(real_to_prot_addr): .long 0 @@ -139,11 +139,11 @@ LOCAL(prot_to_real_addr): .endm /* - * grub_exit() + * VasEBoot_exit() * * Exit the system. */ -FUNCTION(grub_exit) +FUNCTION(VasEBoot_exit) PROT_TO_REAL .code16 /* Tell the BIOS a boot failure. If this does not work, reboot. */ @@ -156,9 +156,9 @@ FUNCTION(grub_exit) .code32 /* - * int grub_pxe_call (int func, void* data, grub_uint32_t pxe_rm_entry); + * int VasEBoot_pxe_call (int func, void* data, VasEBoot_uint32_t pxe_rm_entry); */ -FUNCTION(grub_pxe_call) +FUNCTION(VasEBoot_pxe_call) pushl %ebp movl %esp, %ebp pushl %esi @@ -198,7 +198,7 @@ FUNCTION(grub_pxe_call) #include "../int.S" -VARIABLE(grub_realidt) +VARIABLE(VasEBoot_realidt) .long 0 #ifdef __APPLE__ @@ -207,11 +207,11 @@ VARIABLE(grub_realidt) .section __TEXT, __zz_dummy .byte 0 .globl EXT_C(_edata) - .globl EXT_C(grub_boot_device) + .globl EXT_C(VasEBoot_boot_device) .zerofill __DATA, __aa_before_bss, EXT_C(_edata), 1, 0 - .zerofill __DATA, __bss, EXT_C(grub_boot_device), 4, 2 + .zerofill __DATA, __bss, EXT_C(VasEBoot_boot_device), 4, 2 #else .bss -VARIABLE(grub_boot_device) +VARIABLE(VasEBoot_boot_device) .long 0 #endif diff --git a/VasEBoot-core/kern/i386/pc/tpm.c b/VasEBoot-core/kern/i386/pc/tpm.c index f6f264aff..95fd109e7 100644 --- a/VasEBoot-core/kern/i386/pc/tpm.c +++ b/VasEBoot-core/kern/i386/pc/tpm.c @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define TCPA_MAGIC 0x41504354 @@ -13,15 +13,15 @@ int tpm_present(void); int tpm_present(void) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; if (tpm_presence != -1) return tpm_presence; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.eax = 0xbb00; regs.ebx = TCPA_MAGIC; - grub_bios_interrupt (0x1a, ®s); + VasEBoot_bios_interrupt (0x1a, ®s); if (regs.eax == 0) tpm_presence = 1; @@ -31,19 +31,19 @@ int tpm_present(void) return tpm_presence; } -grub_err_t -grub_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, +VasEBoot_err_t +VasEBoot_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, PassThroughToTPM_OutputParamBlock *outbuf) { - struct grub_bios_int_registers regs; - grub_addr_t inaddr, outaddr; + struct VasEBoot_bios_int_registers regs; + VasEBoot_addr_t inaddr, outaddr; if (!tpm_present()) return 0; - inaddr = (grub_addr_t) inbuf; - outaddr = (grub_addr_t) outbuf; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + inaddr = (VasEBoot_addr_t) inbuf; + outaddr = (VasEBoot_addr_t) outbuf; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.eax = 0xbb02; regs.ebx = TCPA_MAGIC; regs.ecx = 0; @@ -53,92 +53,92 @@ grub_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, regs.ds = outaddr >> 4; regs.esi = outaddr & 0xf; - grub_bios_interrupt (0x1a, ®s); + VasEBoot_bios_interrupt (0x1a, ®s); if (regs.eax) { tpm_presence = 0; - return grub_error (GRUB_ERR_IO, N_("TPM error %x, disabling TPM"), regs.eax); + return VasEBoot_error (VasEBoot_ERR_IO, N_("TPM error %x, disabling TPM"), regs.eax); } return 0; } typedef struct { - grub_uint32_t pcrindex; - grub_uint32_t eventtype; - grub_uint8_t digest[20]; - grub_uint32_t eventdatasize; - grub_uint8_t event[0]; -} GRUB_PACKED Event; + VasEBoot_uint32_t pcrindex; + VasEBoot_uint32_t eventtype; + VasEBoot_uint8_t digest[20]; + VasEBoot_uint32_t eventdatasize; + VasEBoot_uint8_t event[0]; +} VasEBoot_PACKED Event; typedef struct { - grub_uint16_t ipblength; - grub_uint16_t reserved; - grub_uint32_t hashdataptr; - grub_uint32_t hashdatalen; - grub_uint32_t pcr; - grub_uint32_t reserved2; - grub_uint32_t logdataptr; - grub_uint32_t logdatalen; -} GRUB_PACKED EventIncoming; + VasEBoot_uint16_t ipblength; + VasEBoot_uint16_t reserved; + VasEBoot_uint32_t hashdataptr; + VasEBoot_uint32_t hashdatalen; + VasEBoot_uint32_t pcr; + VasEBoot_uint32_t reserved2; + VasEBoot_uint32_t logdataptr; + VasEBoot_uint32_t logdatalen; +} VasEBoot_PACKED EventIncoming; typedef struct { - grub_uint16_t opblength; - grub_uint16_t reserved; - grub_uint32_t eventnum; - grub_uint8_t hashvalue[20]; -} GRUB_PACKED EventOutgoing; + VasEBoot_uint16_t opblength; + VasEBoot_uint16_t reserved; + VasEBoot_uint32_t eventnum; + VasEBoot_uint8_t hashvalue[20]; +} VasEBoot_PACKED EventOutgoing; -grub_err_t -grub_tpm_log_event(unsigned char *buf, grub_size_t size, grub_uint8_t pcr, +VasEBoot_err_t +VasEBoot_tpm_log_event(unsigned char *buf, VasEBoot_size_t size, VasEBoot_uint8_t pcr, const char *description) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; EventIncoming incoming; EventOutgoing outgoing; Event *event; - grub_uint32_t datalength; + VasEBoot_uint32_t datalength; if (!tpm_present()) return 0; - datalength = grub_strlen(description); - event = grub_zalloc(datalength + sizeof(Event)); + datalength = VasEBoot_strlen(description); + event = VasEBoot_zalloc(datalength + sizeof(Event)); if (!event) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate TPM event buffer")); event->pcrindex = pcr; event->eventtype = 0x0d; - event->eventdatasize = grub_strlen(description); - grub_memcpy(event->event, description, datalength); + event->eventdatasize = VasEBoot_strlen(description); + VasEBoot_memcpy(event->event, description, datalength); incoming.ipblength = sizeof(incoming); - incoming.hashdataptr = (grub_uint32_t)buf; + incoming.hashdataptr = (VasEBoot_uint32_t)buf; incoming.hashdatalen = size; incoming.pcr = pcr; - incoming.logdataptr = (grub_uint32_t)event; + incoming.logdataptr = (VasEBoot_uint32_t)event; incoming.logdatalen = datalength + sizeof(Event); - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.eax = 0xbb01; regs.ebx = TCPA_MAGIC; regs.ecx = 0; regs.edx = 0; - regs.es = (((grub_addr_t) &incoming) & 0xffff0000) >> 4; - regs.edi = ((grub_addr_t) &incoming) & 0xffff; - regs.ds = (((grub_addr_t) &outgoing) & 0xffff0000) >> 4; - regs.esi = ((grub_addr_t) &outgoing) & 0xffff; + regs.es = (((VasEBoot_addr_t) &incoming) & 0xffff0000) >> 4; + regs.edi = ((VasEBoot_addr_t) &incoming) & 0xffff; + regs.ds = (((VasEBoot_addr_t) &outgoing) & 0xffff0000) >> 4; + regs.esi = ((VasEBoot_addr_t) &outgoing) & 0xffff; - grub_bios_interrupt (0x1a, ®s); + VasEBoot_bios_interrupt (0x1a, ®s); - grub_free(event); + VasEBoot_free(event); if (regs.eax) { tpm_presence = 0; - return grub_error (GRUB_ERR_IO, N_("TPM error %x, disabling TPM"), regs.eax); + return VasEBoot_error (VasEBoot_ERR_IO, N_("TPM error %x, disabling TPM"), regs.eax); } return 0; diff --git a/VasEBoot-core/kern/i386/qemu/init.c b/VasEBoot-core/kern/i386/qemu/init.c index 271b6fbfa..de2f1d0a4 100644 --- a/VasEBoot-core/kern/i386/qemu/init.c +++ b/VasEBoot-core/kern/i386/qemu/init.c @@ -1,91 +1,91 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -extern grub_uint8_t _start[]; -extern grub_uint8_t _end[]; -extern grub_uint8_t _edata[]; +extern VasEBoot_uint8_t _start[]; +extern VasEBoot_uint8_t _end[]; +extern VasEBoot_uint8_t _edata[]; void __attribute__ ((noreturn)) -grub_exit (void) +VasEBoot_exit (void) { - /* 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(). */ + /* We can't use VasEBoot_fatal() in this function. This would create an infinite + loop, since VasEBoot_fatal() calls VasEBoot_abort() which in turn calls VasEBoot_exit(). */ while (1) - grub_cpu_idle (); + VasEBoot_cpu_idle (); } -grub_addr_t grub_modbase; +VasEBoot_addr_t VasEBoot_modbase; -/* Helper for grub_machine_init. */ +/* Helper for VasEBoot_machine_init. */ static int -heap_init (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +heap_init (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data __attribute__ ((unused))) { - grub_uint64_t begin = addr, end = addr + size; + VasEBoot_uint64_t begin = addr, end = addr + size; -#if GRUB_CPU_SIZEOF_VOID_P == 4 +#if VasEBoot_CPU_SIZEOF_VOID_P == 4 /* Restrict ourselves to 32-bit memory space. */ - if (begin > GRUB_ULONG_MAX) + if (begin > VasEBoot_ULONG_MAX) return 0; - if (end > GRUB_ULONG_MAX) - end = GRUB_ULONG_MAX; + if (end > VasEBoot_ULONG_MAX) + end = VasEBoot_ULONG_MAX; #endif - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; /* Avoid the lower memory. */ - if (begin < GRUB_MEMORY_MACHINE_LOWER_SIZE) - begin = GRUB_MEMORY_MACHINE_LOWER_SIZE; + if (begin < VasEBoot_MEMORY_MACHINE_LOWER_SIZE) + begin = VasEBoot_MEMORY_MACHINE_LOWER_SIZE; if (end <= begin) return 0; - grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) (end - begin)); + VasEBoot_mm_init_region ((void *) (VasEBoot_addr_t) begin, (VasEBoot_size_t) (end - begin)); return 0; } struct resource { - grub_pci_device_t dev; - grub_size_t size; + VasEBoot_pci_device_t dev; + VasEBoot_size_t size; unsigned type:4; unsigned bar:3; }; @@ -93,15 +93,15 @@ struct resource struct iterator_ctx { struct resource *resources; - grub_size_t nresources; + VasEBoot_size_t nresources; }; /* We don't support bridges, so can't have more than 32 devices. */ #define MAX_DEVICES 32 static int -find_resources (grub_pci_device_t dev, - grub_pci_id_t pciid __attribute__ ((unused)), +find_resources (VasEBoot_pci_device_t dev, + VasEBoot_pci_id_t pciid __attribute__ ((unused)), void *data) { struct iterator_ctx *ctx = data; @@ -112,77 +112,77 @@ find_resources (grub_pci_device_t dev, for (bar = 0; bar < 6; bar++) { - grub_pci_address_t addr; - grub_uint32_t ones, zeros, mask; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t ones, zeros, mask; struct resource *res; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0 + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0 + 4 * bar); - grub_pci_write (addr, 0xffffffff); - grub_pci_read (addr); - ones = grub_pci_read (addr); - grub_pci_write (addr, 0); - grub_pci_read (addr); - zeros = grub_pci_read (addr); + VasEBoot_pci_write (addr, 0xffffffff); + VasEBoot_pci_read (addr); + ones = VasEBoot_pci_read (addr); + VasEBoot_pci_write (addr, 0); + VasEBoot_pci_read (addr); + zeros = VasEBoot_pci_read (addr); if (ones == zeros) continue; res = &ctx->resources[ctx->nresources++]; - if ((zeros & GRUB_PCI_ADDR_SPACE_MASK) == GRUB_PCI_ADDR_SPACE_IO) - mask = GRUB_PCI_ADDR_SPACE_MASK; + if ((zeros & VasEBoot_PCI_ADDR_SPACE_MASK) == VasEBoot_PCI_ADDR_SPACE_IO) + mask = VasEBoot_PCI_ADDR_SPACE_MASK; else - mask = (GRUB_PCI_ADDR_MEM_TYPE_MASK | GRUB_PCI_ADDR_SPACE_MASK | GRUB_PCI_ADDR_MEM_PREFETCH); + mask = (VasEBoot_PCI_ADDR_MEM_TYPE_MASK | VasEBoot_PCI_ADDR_SPACE_MASK | VasEBoot_PCI_ADDR_MEM_PREFETCH); res->type = ones & mask; res->dev = dev; res->bar = bar; res->size = (~((zeros ^ ones)) | mask) + 1; - if ((zeros & (GRUB_PCI_ADDR_MEM_TYPE_MASK | GRUB_PCI_ADDR_SPACE_MASK)) - == (GRUB_PCI_ADDR_SPACE_MEMORY | GRUB_PCI_ADDR_MEM_TYPE_64)) + if ((zeros & (VasEBoot_PCI_ADDR_MEM_TYPE_MASK | VasEBoot_PCI_ADDR_SPACE_MASK)) + == (VasEBoot_PCI_ADDR_SPACE_MEMORY | VasEBoot_PCI_ADDR_MEM_TYPE_64)) bar++; } return 0; } static int -enable_cards (grub_pci_device_t dev, - grub_pci_id_t pciid __attribute__ ((unused)), +enable_cards (VasEBoot_pci_device_t dev, + VasEBoot_pci_id_t pciid __attribute__ ((unused)), void *data __attribute__ ((unused))) { - grub_uint16_t cmd = 0; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_uint16_t cmd = 0; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; int bar; for (bar = 0; bar < 6; bar++) { - grub_uint32_t val; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0 + VasEBoot_uint32_t val; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0 + 4 * bar); - val = grub_pci_read (addr); + val = VasEBoot_pci_read (addr); if (!val) continue; - if ((val & GRUB_PCI_ADDR_SPACE_MASK) == GRUB_PCI_ADDR_SPACE_IO) - cmd |= GRUB_PCI_COMMAND_IO_ENABLED; + if ((val & VasEBoot_PCI_ADDR_SPACE_MASK) == VasEBoot_PCI_ADDR_SPACE_IO) + cmd |= VasEBoot_PCI_COMMAND_IO_ENABLED; else - cmd |= GRUB_PCI_COMMAND_MEM_ENABLED; + cmd |= VasEBoot_PCI_COMMAND_MEM_ENABLED; } - class = (grub_pci_read (addr) >> 16) & 0xffff; + class = (VasEBoot_pci_read (addr) >> 16) & 0xffff; - if (class == GRUB_PCI_CLASS_SUBCLASS_VGA) - cmd |= GRUB_PCI_COMMAND_IO_ENABLED - | GRUB_PCI_COMMAND_MEM_ENABLED; + if (class == VasEBoot_PCI_CLASS_SUBCLASS_VGA) + cmd |= VasEBoot_PCI_COMMAND_IO_ENABLED + | VasEBoot_PCI_COMMAND_MEM_ENABLED; - if (class == GRUB_PCI_CLASS_SUBCLASS_USB) + if (class == VasEBoot_PCI_CLASS_SUBCLASS_USB) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write (addr, cmd); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write (addr, cmd); return 0; } static void -grub_pci_assign_addresses (void) +VasEBoot_pci_assign_addresses (void) { struct iterator_ctx ctx; @@ -192,10 +192,10 @@ grub_pci_assign_addresses (void) unsigned i; ctx.nresources = 0; ctx.resources = resources; - grub_uint32_t memptr = 0xf0000000; - grub_uint16_t ioptr = 0x1000; + VasEBoot_uint32_t memptr = 0xf0000000; + VasEBoot_uint16_t ioptr = 0x1000; - grub_pci_iterate (find_resources, &ctx); + VasEBoot_pci_iterate (find_resources, &ctx); /* FIXME: do we need a better sort here? */ do { @@ -214,63 +214,63 @@ grub_pci_assign_addresses (void) for (i = 0; i < ctx.nresources; i++) { - grub_pci_address_t addr; - addr = grub_pci_make_address (resources[i].dev, - GRUB_PCI_REG_ADDRESS_REG0 + VasEBoot_pci_address_t addr; + addr = VasEBoot_pci_make_address (resources[i].dev, + VasEBoot_PCI_REG_ADDRESS_REG0 + 4 * resources[i].bar); - if ((resources[i].type & GRUB_PCI_ADDR_SPACE_MASK) - == GRUB_PCI_ADDR_SPACE_IO) + if ((resources[i].type & VasEBoot_PCI_ADDR_SPACE_MASK) + == VasEBoot_PCI_ADDR_SPACE_IO) { - grub_pci_write (addr, ioptr | resources[i].type); + VasEBoot_pci_write (addr, ioptr | resources[i].type); ioptr += resources[i].size; } else { - grub_pci_write (addr, memptr | resources[i].type); + VasEBoot_pci_write (addr, memptr | resources[i].type); memptr += resources[i].size; - if ((resources[i].type & (GRUB_PCI_ADDR_MEM_TYPE_MASK - | GRUB_PCI_ADDR_SPACE_MASK)) - == (GRUB_PCI_ADDR_SPACE_MEMORY | GRUB_PCI_ADDR_MEM_TYPE_64)) + if ((resources[i].type & (VasEBoot_PCI_ADDR_MEM_TYPE_MASK + | VasEBoot_PCI_ADDR_SPACE_MASK)) + == (VasEBoot_PCI_ADDR_SPACE_MEMORY | VasEBoot_PCI_ADDR_MEM_TYPE_64)) { - addr = grub_pci_make_address (resources[i].dev, - GRUB_PCI_REG_ADDRESS_REG0 + addr = VasEBoot_pci_make_address (resources[i].dev, + VasEBoot_PCI_REG_ADDRESS_REG0 + 4 * resources[i].bar + 4); - grub_pci_write (addr, 0); + VasEBoot_pci_write (addr, 0); } } } - grub_pci_iterate (enable_cards, NULL); + VasEBoot_pci_iterate (enable_cards, NULL); } } void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_modbase = grub_core_entry_addr + (_edata - _start); + VasEBoot_modbase = VasEBoot_core_entry_addr + (_edata - _start); - grub_pci_assign_addresses (); + VasEBoot_pci_assign_addresses (); - grub_qemu_init_cirrus (); + VasEBoot_qemu_init_cirrus (); - grub_vga_text_init (); + VasEBoot_vga_text_init (); - grub_machine_mmap_init (); - grub_machine_mmap_iterate (heap_init, NULL); + VasEBoot_machine_mmap_init (); + VasEBoot_machine_mmap_iterate (heap_init, NULL); - grub_tsc_init (); + VasEBoot_tsc_init (); } void -grub_machine_get_bootlocation (char **device __attribute__ ((unused)), +VasEBoot_machine_get_bootlocation (char **device __attribute__ ((unused)), char **path __attribute__ ((unused))) { } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) - grub_vga_text_fini (); - grub_stop_floppy (); + if (flags & VasEBoot_LOADER_FLAG_NORETURN) + VasEBoot_vga_text_fini (); + VasEBoot_stop_floppy (); } diff --git a/VasEBoot-core/kern/i386/qemu/mmap.c b/VasEBoot-core/kern/i386/qemu/mmap.c index f449637ef..e8068477f 100644 --- a/VasEBoot-core/kern/i386/qemu/mmap.c +++ b/VasEBoot-core/kern/i386/qemu/mmap.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #define QEMU_CMOS_MEMSIZE_HIGH 0x35 #define QEMU_CMOS_MEMSIZE_LOW 0x34 @@ -36,16 +36,16 @@ extern char _start[]; extern char _end[]; -static grub_uint64_t mem_size, above_4g; +static VasEBoot_uint64_t mem_size, above_4g; void -grub_machine_mmap_init (void) +VasEBoot_machine_mmap_init (void) { - grub_uint8_t high, low, b, c, d; - grub_cmos_read (QEMU_CMOS_MEMSIZE_HIGH, &high); - grub_cmos_read (QEMU_CMOS_MEMSIZE_LOW, &low); - mem_size = ((grub_uint64_t) high) << 24 - | ((grub_uint64_t) low) << 16; + VasEBoot_uint8_t high, low, b, c, d; + VasEBoot_cmos_read (QEMU_CMOS_MEMSIZE_HIGH, &high); + VasEBoot_cmos_read (QEMU_CMOS_MEMSIZE_LOW, &low); + mem_size = ((VasEBoot_uint64_t) high) << 24 + | ((VasEBoot_uint64_t) low) << 16; if (mem_size > 0) { /* Don't ask... */ @@ -53,54 +53,54 @@ grub_machine_mmap_init (void) } else { - grub_cmos_read (QEMU_CMOS_MEMSIZE2_HIGH, &high); - grub_cmos_read (QEMU_CMOS_MEMSIZE2_LOW, &low); + VasEBoot_cmos_read (QEMU_CMOS_MEMSIZE2_HIGH, &high); + VasEBoot_cmos_read (QEMU_CMOS_MEMSIZE2_LOW, &low); mem_size - = ((((grub_uint64_t) high) << 18) | (((grub_uint64_t) low) << 10)) + = ((((VasEBoot_uint64_t) high) << 18) | (((VasEBoot_uint64_t) low) << 10)) + 1024 * 1024; } - grub_cmos_read (0x5b, &b); - grub_cmos_read (0x5c, &c); - grub_cmos_read (0x5d, &d); - above_4g = (((grub_uint64_t) b) << 16) - | (((grub_uint64_t) c) << 24) - | (((grub_uint64_t) d) << 32); + VasEBoot_cmos_read (0x5b, &b); + VasEBoot_cmos_read (0x5c, &c); + VasEBoot_cmos_read (0x5d, &d); + above_4g = (((VasEBoot_uint64_t) b) << 16) + | (((VasEBoot_uint64_t) c) << 24) + | (((VasEBoot_uint64_t) d) << 32); } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { if (hook (0x0, - (grub_addr_t) _start, - GRUB_MEMORY_AVAILABLE, hook_data)) + (VasEBoot_addr_t) _start, + VasEBoot_MEMORY_AVAILABLE, hook_data)) return 1; - if (hook ((grub_addr_t) _end, - 0xa0000 - (grub_addr_t) _end, - GRUB_MEMORY_AVAILABLE, hook_data)) + if (hook ((VasEBoot_addr_t) _end, + 0xa0000 - (VasEBoot_addr_t) _end, + VasEBoot_MEMORY_AVAILABLE, hook_data)) return 1; - if (hook (GRUB_MEMORY_MACHINE_UPPER, - 0x100000 - GRUB_MEMORY_MACHINE_UPPER, - GRUB_MEMORY_RESERVED, hook_data)) + if (hook (VasEBoot_MEMORY_MACHINE_UPPER, + 0x100000 - VasEBoot_MEMORY_MACHINE_UPPER, + VasEBoot_MEMORY_RESERVED, hook_data)) return 1; /* Everything else is free. */ if (hook (0x100000, - min (mem_size, (grub_uint32_t) -GRUB_BOOT_MACHINE_SIZE) - 0x100000, - GRUB_MEMORY_AVAILABLE, hook_data)) + min (mem_size, (VasEBoot_uint32_t) -VasEBoot_BOOT_MACHINE_SIZE) - 0x100000, + VasEBoot_MEMORY_AVAILABLE, hook_data)) return 1; /* Protect boot.img, which contains the gdt. It is mapped at the top of memory (it is also mapped below 0x100000, but we already reserved that area). */ - if (hook ((grub_uint32_t) -GRUB_BOOT_MACHINE_SIZE, - GRUB_BOOT_MACHINE_SIZE, - GRUB_MEMORY_RESERVED, hook_data)) + if (hook ((VasEBoot_uint32_t) -VasEBoot_BOOT_MACHINE_SIZE, + VasEBoot_BOOT_MACHINE_SIZE, + VasEBoot_MEMORY_RESERVED, hook_data)) return 1; if (above_4g != 0 && hook (0x100000000ULL, above_4g, - GRUB_MEMORY_AVAILABLE, hook_data)) + VasEBoot_MEMORY_AVAILABLE, hook_data)) return 1; return 0; diff --git a/VasEBoot-core/kern/i386/qemu/startup.S b/VasEBoot-core/kern/i386/qemu/startup.S index 0d89858d9..8799f1b46 100644 --- a/VasEBoot-core/kern/i386/qemu/startup.S +++ b/VasEBoot-core/kern/i386/qemu/startup.S @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include -#include -#include +#include +#include .text .code32 @@ -28,8 +28,8 @@ _start: jmp codestart - .org GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR -VARIABLE(grub_core_entry_addr) + .org VasEBoot_KERNEL_I386_QEMU_CORE_ENTRY_ADDR +VARIABLE(VasEBoot_core_entry_addr) .long 0 codestart: @@ -39,7 +39,7 @@ codestart: 1: popl %esi /* Rom size is a multiple of 64 kiB. With this we get the - value of `grub_core_entry_addr' in %esi. */ + value of `VasEBoot_core_entry_addr' in %esi. */ xorw %si, %si movl $(_edata - _start), %ecx @@ -47,7 +47,7 @@ codestart: cld rep movsb - ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $1f + ljmp $VasEBoot_MEMORY_MACHINE_PROT_MODE_CSEG, $1f 1: /* clean out the bss */ @@ -66,7 +66,7 @@ codestart: /* * Call the start of main body of C code. */ - call EXT_C(grub_main) + call EXT_C(VasEBoot_main) /* This should never happen. */ cli diff --git a/VasEBoot-core/kern/i386/realmode.S b/VasEBoot-core/kern/i386/realmode.S index 998fdc756..8324909d5 100644 --- a/VasEBoot-core/kern/i386/realmode.S +++ b/VasEBoot-core/kern/i386/realmode.S @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include /* * Note: These functions defined in this file may be called from C. @@ -35,7 +35,7 @@ */ /* - * Note: GRUB is compiled with the options -mrtd and -mregparm=3. + * Note: VasEBoot is compiled with the options -mrtd and -mregparm=3. * So the first three arguments are passed in %eax, %edx, and %ecx, * respectively, and if a function has a fixed number of arguments * and the number if greater than three, the function must return @@ -47,7 +47,7 @@ */ protstack: - .long GRUB_MEMORY_MACHINE_PROT_STACK + .long VasEBoot_MEMORY_MACHINE_PROT_STACK .macro PROT_TO_REAL call prot_to_real @@ -137,35 +137,35 @@ real_to_prot: /* load the GDT register */ xorw %ax, %ax movw %ax, %ds -#ifdef GRUB_MACHINE_QEMU +#ifdef VasEBoot_MACHINE_QEMU /* qemu is special: gdtdesc is in ROM. %cs = 0xf000 - _start + GRUB_BOOT_MACHINE_SIZE = 0x100000 + _start + VasEBoot_BOOT_MACHINE_SIZE = 0x100000 So - _start + GRUB_BOOT_MACHINE_SIZE - 0x10000 points to the same point + _start + VasEBoot_BOOT_MACHINE_SIZE - 0x10000 points to the same point as %cs. - gdtdesc - (_start + GRUB_BOOT_MACHINE_SIZE - 0x10000) - = gdtdesc - _start - GRUB_BOOT_MACHINE_SIZE + 0x10000 + gdtdesc - (_start + VasEBoot_BOOT_MACHINE_SIZE - 0x10000) + = gdtdesc - _start - VasEBoot_BOOT_MACHINE_SIZE + 0x10000 but the later can be computed by assembly. */ - lgdtl %cs:(gdtdesc - _start - GRUB_BOOT_MACHINE_SIZE + 0x10000) + lgdtl %cs:(gdtdesc - _start - VasEBoot_BOOT_MACHINE_SIZE + 0x10000) #else lgdtl gdtdesc #endif /* turn on protected mode */ movl %cr0, %eax - orl $GRUB_MEMORY_CPU_CR0_PE_ON, %eax + orl $VasEBoot_MEMORY_CPU_CR0_PE_ON, %eax movl %eax, %cr0 /* jump to relocation, flush prefetch queue, and reload %cs */ - ljmpl $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg + ljmpl $VasEBoot_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg .code32 protcseg: /* reload other segment registers */ - movw $GRUB_MEMORY_MACHINE_PROT_MODE_DSEG, %ax + movw $VasEBoot_MEMORY_MACHINE_PROT_MODE_DSEG, %ax movw %ax, %ds movw %ax, %es movw %ax, %fs @@ -174,7 +174,7 @@ protcseg: /* put the return address in a known safe location */ movl (%esp), %eax - movl %eax, GRUB_MEMORY_MACHINE_REAL_STACK + movl %eax, VasEBoot_MEMORY_MACHINE_REAL_STACK /* get protected mode stack */ movl protstack, %eax @@ -182,7 +182,7 @@ protcseg: movl %eax, %ebp /* get return address onto the right stack */ - movl GRUB_MEMORY_MACHINE_REAL_STACK, %eax + movl VasEBoot_MEMORY_MACHINE_REAL_STACK, %eax movl %eax, (%esp) /* zero %eax */ @@ -195,23 +195,23 @@ protcseg: ret /* prot_to_real assumes that this code is under 64K which is not true for qemu. */ -#ifndef GRUB_MACHINE_QEMU +#ifndef VasEBoot_MACHINE_QEMU /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ prot_to_real: @@ -227,15 +227,15 @@ prot_to_real: /* get the return address */ movl (%esp), %eax - movl %eax, GRUB_MEMORY_MACHINE_REAL_STACK + movl %eax, VasEBoot_MEMORY_MACHINE_REAL_STACK /* set up new stack */ - movl $GRUB_MEMORY_MACHINE_REAL_STACK, %eax + movl $VasEBoot_MEMORY_MACHINE_REAL_STACK, %eax movl %eax, %esp movl %eax, %ebp /* set up segment limits */ - movw $GRUB_MEMORY_MACHINE_PSEUDO_REAL_DSEG, %ax + movw $VasEBoot_MEMORY_MACHINE_PSEUDO_REAL_DSEG, %ax movw %ax, %ds movw %ax, %es movw %ax, %fs @@ -244,14 +244,14 @@ prot_to_real: /* this might be an extra step */ /* jump to a 16 bit segment */ - ljmp $GRUB_MEMORY_MACHINE_PSEUDO_REAL_CSEG, $tmpcseg + ljmp $VasEBoot_MEMORY_MACHINE_PSEUDO_REAL_CSEG, $tmpcseg tmpcseg: .code16 /* clear the PE bit of CR0 */ movl %cr0, %eax - andl $(~GRUB_MEMORY_CPU_CR0_PE_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_CR0_PE_ON), %eax movl %eax, %cr0 /* flush prefetch queue, reload %cs */ @@ -270,7 +270,7 @@ realcseg: movw %ax, %gs movw %ax, %ss -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS /* restore interrupts */ sti #endif diff --git a/VasEBoot-core/kern/i386/tsc.c b/VasEBoot-core/kern/i386/tsc.c index 2e85289d8..84303ac3e 100644 --- a/VasEBoot-core/kern/i386/tsc.c +++ b/VasEBoot-core/kern/i386/tsc.c @@ -2,77 +2,77 @@ * Requires Pentium or better x86 CPU that supports the RDTSC instruction. * This module calibrates the TSC to real time. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* This defines the value TSC had at the epoch (that is, when we calibrated it). */ -static grub_uint64_t tsc_boot_time; +static VasEBoot_uint64_t tsc_boot_time; /* Calibrated TSC rate. (In ms per 2^32 ticks) */ /* We assume that the tick is less than 1 ms and hence this value fits in 32-bit. */ -grub_uint32_t grub_tsc_rate; +VasEBoot_uint32_t VasEBoot_tsc_rate; -static grub_uint64_t -grub_tsc_get_time_ms (void) +static VasEBoot_uint64_t +VasEBoot_tsc_get_time_ms (void) { - grub_uint64_t a = grub_get_tsc () - tsc_boot_time; - grub_uint64_t ah = a >> 32; - grub_uint64_t al = a & 0xffffffff; + VasEBoot_uint64_t a = VasEBoot_get_tsc () - tsc_boot_time; + VasEBoot_uint64_t ah = a >> 32; + VasEBoot_uint64_t al = a & 0xffffffff; - return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; + return ((al * VasEBoot_tsc_rate) >> 32) + ah * VasEBoot_tsc_rate; } static int calibrate_tsc_hardcode (void) { - grub_tsc_rate = 5368;/* 800 MHz */ + VasEBoot_tsc_rate = 5368;/* 800 MHz */ return 1; } void -grub_tsc_init (void) +VasEBoot_tsc_init (void) { - if (!grub_cpu_is_tsc_supported ()) + if (!VasEBoot_cpu_is_tsc_supported ()) { -#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_IEEE1275) - grub_install_get_time_ms (grub_rtc_get_time_ms); +#if defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_IEEE1275) + VasEBoot_install_get_time_ms (VasEBoot_rtc_get_time_ms); #else - grub_fatal ("no TSC found"); + VasEBoot_fatal ("no TSC found"); #endif return; } - tsc_boot_time = grub_get_tsc (); + tsc_boot_time = VasEBoot_get_tsc (); -#ifdef GRUB_MACHINE_XEN - (void) (grub_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); -#elif defined (GRUB_MACHINE_EFI) - (void) (grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); -#elif defined (GRUB_MACHINE_COREBOOT) - (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); +#ifdef VasEBoot_MACHINE_XEN + (void) (VasEBoot_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); +#elif defined (VasEBoot_MACHINE_EFI) + (void) (VasEBoot_tsc_calibrate_from_pit () || VasEBoot_tsc_calibrate_from_pmtimer () || VasEBoot_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); +#elif defined (VasEBoot_MACHINE_COREBOOT) + (void) (VasEBoot_tsc_calibrate_from_pmtimer () || VasEBoot_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); #else - (void) (grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); + (void) (VasEBoot_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); #endif - grub_install_get_time_ms (grub_tsc_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_tsc_get_time_ms); } diff --git a/VasEBoot-core/kern/i386/tsc_pit.c b/VasEBoot-core/kern/i386/tsc_pit.c index 67990bfa6..6bc2f2e09 100644 --- a/VasEBoot-core/kern/i386/tsc_pit.c +++ b/VasEBoot-core/kern/i386/tsc_pit.c @@ -3,82 +3,82 @@ * This module uses the PIT to calibrate the TSC to * real time. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static int -grub_pit_wait (void) +VasEBoot_pit_wait (void) { int ret = 0; /* Disable timer2 gate and speaker. */ - grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) - & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), - GRUB_PIT_SPEAKER_PORT); + VasEBoot_outb (VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT) + & ~ (VasEBoot_PIT_SPK_DATA | VasEBoot_PIT_SPK_TMR2), + VasEBoot_PIT_SPEAKER_PORT); /* Set tics. */ - grub_outb (GRUB_PIT_CTRL_SELECT_2 | GRUB_PIT_CTRL_READLOAD_WORD, - GRUB_PIT_CTRL); + VasEBoot_outb (VasEBoot_PIT_CTRL_SELECT_2 | VasEBoot_PIT_CTRL_READLOAD_WORD, + VasEBoot_PIT_CTRL); /* 0xffff ticks: 55ms. */ - grub_outb (0xff, GRUB_PIT_COUNTER_2); - grub_outb (0xff, GRUB_PIT_COUNTER_2); + VasEBoot_outb (0xff, VasEBoot_PIT_COUNTER_2); + VasEBoot_outb (0xff, VasEBoot_PIT_COUNTER_2); /* Enable timer2 gate, keep speaker disabled. */ - grub_outb ((grub_inb (GRUB_PIT_SPEAKER_PORT) & ~ GRUB_PIT_SPK_DATA) - | GRUB_PIT_SPK_TMR2, - GRUB_PIT_SPEAKER_PORT); + VasEBoot_outb ((VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT) & ~ VasEBoot_PIT_SPK_DATA) + | VasEBoot_PIT_SPK_TMR2, + VasEBoot_PIT_SPEAKER_PORT); - if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00) { + if ((VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT) & VasEBoot_PIT_SPK_TMR2_LATCH) == 0x00) { ret = 1; /* Wait. */ - while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00); + while ((VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT) & VasEBoot_PIT_SPK_TMR2_LATCH) == 0x00); } /* Disable timer2 gate and speaker. */ - grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) - & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), - GRUB_PIT_SPEAKER_PORT); + VasEBoot_outb (VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT) + & ~ (VasEBoot_PIT_SPK_DATA | VasEBoot_PIT_SPK_TMR2), + VasEBoot_PIT_SPEAKER_PORT); return ret; } /* Calibrate the TSC based on the RTC. */ int -grub_tsc_calibrate_from_pit (void) +VasEBoot_tsc_calibrate_from_pit (void) { /* First calibrate the TSC rate (relative, not absolute time). */ - grub_uint64_t start_tsc, end_tsc; + VasEBoot_uint64_t start_tsc, end_tsc; - start_tsc = grub_get_tsc (); - if (!grub_pit_wait ()) + start_tsc = VasEBoot_get_tsc (); + if (!VasEBoot_pit_wait ()) return 0; - end_tsc = grub_get_tsc (); + end_tsc = VasEBoot_get_tsc (); - grub_tsc_rate = 0; + VasEBoot_tsc_rate = 0; if (end_tsc > start_tsc) - grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - start_tsc, 0); - if (grub_tsc_rate == 0) + VasEBoot_tsc_rate = VasEBoot_divmod64 ((55ULL << 32), end_tsc - start_tsc, 0); + if (VasEBoot_tsc_rate == 0) return 0; return 1; } diff --git a/VasEBoot-core/kern/i386/tsc_pmtimer.c b/VasEBoot-core/kern/i386/tsc_pmtimer.c index c9c361699..c3233e176 100644 --- a/VasEBoot-core/kern/i386/tsc_pmtimer.c +++ b/VasEBoot-core/kern/i386/tsc_pmtimer.c @@ -3,55 +3,55 @@ * This module uses the PIT to calibrate the TSC to * real time. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -grub_uint64_t -grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, - grub_uint16_t num_pm_ticks) +VasEBoot_uint64_t +VasEBoot_pmtimer_wait_count_tsc (VasEBoot_port_t pmtimer, + VasEBoot_uint16_t num_pm_ticks) { - grub_uint32_t start; - grub_uint32_t last; - grub_uint32_t cur, end; - grub_uint64_t start_tsc; - grub_uint64_t end_tsc; + VasEBoot_uint32_t start; + VasEBoot_uint32_t last; + VasEBoot_uint32_t cur, end; + VasEBoot_uint64_t start_tsc; + VasEBoot_uint64_t end_tsc; int num_iter = 0; - start = grub_inl (pmtimer) & 0xffffff; + start = VasEBoot_inl (pmtimer) & 0xffffff; last = start; end = start + num_pm_ticks; - start_tsc = grub_get_tsc (); + start_tsc = VasEBoot_get_tsc (); while (1) { - cur = grub_inl (pmtimer) & 0xffffff; + cur = VasEBoot_inl (pmtimer) & 0xffffff; if (cur < last) cur |= 0x1000000; num_iter++; if (cur >= end) { - end_tsc = grub_get_tsc (); + end_tsc = VasEBoot_get_tsc (); return end_tsc - start_tsc; } /* Check for broken PM timer. @@ -59,20 +59,20 @@ grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, if after this time we still don't have 1 ms on pmtimer, then pmtimer is broken. */ - if ((num_iter & 0xffffff) == 0 && grub_get_tsc () - start_tsc > 5000000) { + if ((num_iter & 0xffffff) == 0 && VasEBoot_get_tsc () - start_tsc > 5000000) { return 0; } } } int -grub_tsc_calibrate_from_pmtimer (void) +VasEBoot_tsc_calibrate_from_pmtimer (void) { - struct grub_acpi_fadt *fadt; - grub_port_t pmtimer; - grub_uint64_t tsc_diff; + struct VasEBoot_acpi_fadt *fadt; + VasEBoot_port_t pmtimer; + VasEBoot_uint64_t tsc_diff; - fadt = grub_acpi_find_fadt (); + fadt = VasEBoot_acpi_find_fadt (); if (!fadt) return 0; pmtimer = fadt->pmtimer; @@ -80,9 +80,9 @@ grub_tsc_calibrate_from_pmtimer (void) return 0; /* It's 3.579545 MHz clock. Wait 1 ms. */ - tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer, 3580); + tsc_diff = VasEBoot_pmtimer_wait_count_tsc (pmtimer, 3580); if (tsc_diff == 0) return 0; - grub_tsc_rate = grub_divmod64 ((1ULL << 32), tsc_diff, 0); + VasEBoot_tsc_rate = VasEBoot_divmod64 ((1ULL << 32), tsc_diff, 0); return 1; } diff --git a/VasEBoot-core/kern/i386/xen/hypercall.S b/VasEBoot-core/kern/i386/xen/hypercall.S index 09d75c3a5..6d6234c51 100644 --- a/VasEBoot-core/kern/i386/xen/hypercall.S +++ b/VasEBoot-core/kern/i386/xen/hypercall.S @@ -1,26 +1,26 @@ /* hypercall.S - wrappers for Xen hypercalls */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -FUNCTION(grub_xen_hypercall) +FUNCTION(VasEBoot_xen_hypercall) pushl %ebp movl %esp, %ebp pushl %esi diff --git a/VasEBoot-core/kern/i386/xen/startup.S b/VasEBoot-core/kern/i386/xen/startup.S index fbe8300a7..82056245a 100644 --- a/VasEBoot-core/kern/i386/xen/startup.S +++ b/VasEBoot-core/kern/i386/xen/startup.S @@ -1,24 +1,24 @@ -/* startup.S - bootstrap GRUB itself */ +/* startup.S - bootstrap VasEBoot itself */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include .file "startup.S" .text @@ -28,9 +28,9 @@ start: _start: leal LOCAL(stack_end), %esp - movl %esi, EXT_C(grub_xen_start_page_addr) + movl %esi, EXT_C(VasEBoot_xen_start_page_addr) - call EXT_C(grub_main) + call EXT_C(VasEBoot_main) /* Doesn't return. */ .bss diff --git a/VasEBoot-core/kern/i386/xen/tsc.c b/VasEBoot-core/kern/i386/xen/tsc.c index 8792b308d..f04cd6537 100644 --- a/VasEBoot-core/kern/i386/xen/tsc.c +++ b/VasEBoot-core/kern/i386/xen/tsc.c @@ -3,38 +3,38 @@ * This module uses the PIT to calibrate the TSC to * real time. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include int -grub_tsc_calibrate_from_xen (void) +VasEBoot_tsc_calibrate_from_xen (void) { - grub_uint64_t t; - t = grub_xen_shared_info->vcpu_info[0].time.tsc_to_system_mul; - if (grub_xen_shared_info->vcpu_info[0].time.tsc_shift > 0) - t <<= grub_xen_shared_info->vcpu_info[0].time.tsc_shift; + VasEBoot_uint64_t t; + t = VasEBoot_xen_shared_info->vcpu_info[0].time.tsc_to_system_mul; + if (VasEBoot_xen_shared_info->vcpu_info[0].time.tsc_shift > 0) + t <<= VasEBoot_xen_shared_info->vcpu_info[0].time.tsc_shift; else - t >>= -grub_xen_shared_info->vcpu_info[0].time.tsc_shift; - grub_tsc_rate = grub_divmod64 (t, 1000000, 0); + t >>= -VasEBoot_xen_shared_info->vcpu_info[0].time.tsc_shift; + VasEBoot_tsc_rate = VasEBoot_divmod64 (t, 1000000, 0); return 1; } diff --git a/VasEBoot-core/kern/ia64/cache.c b/VasEBoot-core/kern/ia64/cache.c index 13efd308f..86cf9ceca 100644 --- a/VasEBoot-core/kern/ia64/cache.c +++ b/VasEBoot-core/kern/ia64/cache.c @@ -1,31 +1,31 @@ /* init.c - initialize an ia64-based EFI system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include void -grub_arch_sync_caches (void *address, grub_size_t len) +VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) { /* Cache line length is at least 32. */ - len += (grub_uint64_t)address & 0x1f; - grub_uint64_t a = (grub_uint64_t)address & ~0x1f; + len += (VasEBoot_uint64_t)address & 0x1f; + VasEBoot_uint64_t a = (VasEBoot_uint64_t)address & ~0x1f; /* Flush data. */ for (len = (len + 31) & ~0x1f; len > 0; len -= 0x20, a += 0x20) diff --git a/VasEBoot-core/kern/ia64/dl.c b/VasEBoot-core/kern/ia64/dl.c index ebcf31629..f287266b8 100644 --- a/VasEBoot-core/kern/ia64/dl.c +++ b/VasEBoot-core/kern/ia64/dl.c @@ -1,36 +1,36 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define MASK19 ((1 << 19) - 1) #define MASK20 ((1 << 20) - 1) /* Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; @@ -38,17 +38,17 @@ grub_arch_dl_check_header (void *ehdr) if (e->e_ident[EI_CLASS] != ELFCLASS64 || e->e_ident[EI_DATA] != ELFDATA2LSB || e->e_machine != EM_IA_64) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #pragma GCC diagnostic ignored "-Wcast-align" /* Relocate symbols. */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf_Rela *rel, *max; @@ -57,15 +57,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, rel < max; rel = (Elf_Rela *) ((char *) rel + s->sh_entsize)) { - grub_addr_t addr; + VasEBoot_addr_t addr; Elf_Sym *sym; - grub_uint64_t value; + VasEBoot_uint64_t value; if (seg->size < (rel->r_offset & ~3)) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); - addr = (grub_addr_t) seg->addr + rel->r_offset; + addr = (VasEBoot_addr_t) seg->addr + rel->r_offset; sym = (Elf_Sym *) ((char *) mod->symtab + mod->symsize * ELF_R_SYM (rel->r_info)); @@ -77,11 +77,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { case R_IA64_PCREL21B: { - grub_int64_t noff; + VasEBoot_int64_t noff; if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) { - struct grub_ia64_trampoline *tr = mod->trampptr; - grub_ia64_make_trampoline (tr, value); + struct VasEBoot_ia64_trampoline *tr = mod->trampptr; + VasEBoot_ia64_make_trampoline (tr, value); noff = ((char *) tr - (char *) (addr & ~3)) >> 4; mod->trampptr = tr + 1; } @@ -89,46 +89,46 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, noff = ((char *) value - (char *) (addr & ~3)) >> 4; if ((noff & ~MASK19) && ((-noff) & ~MASK19)) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "jump offset too big (%lx)", noff); - grub_ia64_add_value_to_slot_20b (addr, noff); + VasEBoot_ia64_add_value_to_slot_20b (addr, noff); } break; case R_IA64_SEGREL64LSB: - *(grub_uint64_t *) addr += value - (grub_addr_t) seg->addr; + *(VasEBoot_uint64_t *) addr += value - (VasEBoot_addr_t) seg->addr; break; case R_IA64_FPTR64LSB: case R_IA64_DIR64LSB: - *(grub_uint64_t *) addr += value; + *(VasEBoot_uint64_t *) addr += value; break; case R_IA64_PCREL64LSB: - *(grub_uint64_t *) addr += value - addr; + *(VasEBoot_uint64_t *) addr += value - addr; break; case R_IA64_GPREL64I: - grub_ia64_set_immu64 (addr, value - (grub_addr_t) mod->base); + VasEBoot_ia64_set_immu64 (addr, value - (VasEBoot_addr_t) mod->base); break; case R_IA64_GPREL22: - if ((value - (grub_addr_t) mod->base) & ~MASK20) - return grub_error (GRUB_ERR_BAD_MODULE, + if ((value - (VasEBoot_addr_t) mod->base) & ~MASK20) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "gprel offset too big (%lx)", - value - (grub_addr_t) mod->base); - grub_ia64_add_value_to_slot_21 (addr, value - (grub_addr_t) mod->base); + value - (VasEBoot_addr_t) mod->base); + VasEBoot_ia64_add_value_to_slot_21 (addr, value - (VasEBoot_addr_t) mod->base); break; case R_IA64_LTOFF22X: case R_IA64_LTOFF22: if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) - value = *(grub_uint64_t *) sym->st_value + rel->r_addend; + value = *(VasEBoot_uint64_t *) sym->st_value + rel->r_addend; /* Fallthrough. */ case R_IA64_LTOFF_FPTR22: { - grub_uint64_t *gpptr = mod->gotptr; + VasEBoot_uint64_t *gpptr = mod->gotptr; *gpptr = value; - if (((grub_addr_t) gpptr - (grub_addr_t) mod->base) & ~MASK20) - return grub_error (GRUB_ERR_BAD_MODULE, + if (((VasEBoot_addr_t) gpptr - (VasEBoot_addr_t) mod->base) & ~MASK20) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "gprel offset too big (%lx)", - (grub_addr_t) gpptr - (grub_addr_t) mod->base); - grub_ia64_add_value_to_slot_21 (addr, (grub_addr_t) gpptr - (grub_addr_t) mod->base); + (VasEBoot_addr_t) gpptr - (VasEBoot_addr_t) mod->base); + VasEBoot_ia64_add_value_to_slot_21 (addr, (VasEBoot_addr_t) gpptr - (VasEBoot_addr_t) mod->base); mod->gotptr = gpptr + 1; break; } @@ -136,10 +136,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, case R_IA64_LDXMOV: break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/ia64/dl_helper.c b/VasEBoot-core/kern/ia64/dl_helper.c index c60159573..e1e231daa 100644 --- a/VasEBoot-core/kern/ia64/dl_helper.c +++ b/VasEBoot-core/kern/ia64/dl_helper.c @@ -1,44 +1,44 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wcast-align" #define MASK20 ((1 << 20) - 1) -#define MASK3 (~(grub_addr_t) 3) +#define MASK3 (~(VasEBoot_addr_t) 3) void -grub_ia64_set_immu64 (grub_addr_t addr, grub_uint64_t val) +VasEBoot_ia64_set_immu64 (VasEBoot_addr_t addr, VasEBoot_uint64_t val) { /* Copied from binutils. */ - grub_uint64_t *ptr = ((grub_uint64_t *) (addr & MASK3)); - grub_uint64_t t0, t1; + VasEBoot_uint64_t *ptr = ((VasEBoot_uint64_t *) (addr & MASK3)); + VasEBoot_uint64_t t0, t1; - t0 = grub_le_to_cpu64 (ptr[0]); - t1 = grub_le_to_cpu64 (ptr[1]); + t0 = VasEBoot_le_to_cpu64 (ptr[0]); + t1 = VasEBoot_le_to_cpu64 (ptr[1]); /* tmpl/s: bits 0.. 5 in t0 slot 0: bits 5..45 in t0 @@ -65,44 +65,44 @@ grub_ia64_set_immu64 (grub_addr_t addr, grub_uint64_t val) } void -grub_ia64_add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value) +VasEBoot_ia64_add_value_to_slot_20b (VasEBoot_addr_t addr, VasEBoot_uint32_t value) { - grub_uint32_t val; + VasEBoot_uint32_t val; switch (addr & 3) { case 0: - val = grub_le_to_cpu32 (grub_get_unaligned32 (((grub_uint8_t *) + val = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 2))); val = (((((val & MASK20) + value) & MASK20) << 2) | (val & ~(MASK20 << 2))); - grub_set_unaligned32 (((grub_uint8_t *) (addr & MASK3) + 2), - grub_cpu_to_le32 (val)); + VasEBoot_set_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 2), + VasEBoot_cpu_to_le32 (val)); break; case 1: - val = grub_le_to_cpu32 (grub_get_unaligned32 (((grub_uint8_t *) + val = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 7))); val = ((((((val >> 3) & MASK20) + value) & MASK20) << 3) | (val & ~(MASK20 << 3))); - grub_set_unaligned32 (((grub_uint8_t *) (addr & MASK3) + 7), - grub_cpu_to_le32 (val)); + VasEBoot_set_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 7), + VasEBoot_cpu_to_le32 (val)); break; case 2: - val = grub_le_to_cpu32 (grub_get_unaligned32 (((grub_uint8_t *) + val = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 12))); val = ((((((val >> 4) & MASK20) + value) & MASK20) << 4) | (val & ~(MASK20 << 4))); - grub_set_unaligned32 (((grub_uint8_t *) (addr & MASK3) + 12), - grub_cpu_to_le32 (val)); + VasEBoot_set_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 12), + VasEBoot_cpu_to_le32 (val)); break; } } #define MASKF21 ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) ) -static grub_uint32_t -add_value_to_slot_21_real (grub_uint32_t a, grub_uint32_t value) +static VasEBoot_uint32_t +add_value_to_slot_21_real (VasEBoot_uint32_t a, VasEBoot_uint32_t value) { - grub_uint32_t high, mid, low, c; + VasEBoot_uint32_t high, mid, low, c; low = (a & 0x00007f); mid = (a & 0x7fc000) >> 7; high = (a & 0x003e00) << 7; @@ -111,46 +111,46 @@ add_value_to_slot_21_real (grub_uint32_t a, grub_uint32_t value) } void -grub_ia64_add_value_to_slot_21 (grub_addr_t addr, grub_uint32_t value) +VasEBoot_ia64_add_value_to_slot_21 (VasEBoot_addr_t addr, VasEBoot_uint32_t value) { - grub_uint32_t val; + VasEBoot_uint32_t val; switch (addr & 3) { case 0: - val = grub_le_to_cpu32 (grub_get_unaligned32 (((grub_uint8_t *) + val = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 2))); val = ((add_value_to_slot_21_real (((val >> 2) & MASKF21), value) & MASKF21) << 2) | (val & ~(MASKF21 << 2)); - grub_set_unaligned32 (((grub_uint8_t *) (addr & MASK3) + 2), - grub_cpu_to_le32 (val)); + VasEBoot_set_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 2), + VasEBoot_cpu_to_le32 (val)); break; case 1: - val = grub_le_to_cpu32 (grub_get_unaligned32 (((grub_uint8_t *) + val = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 7))); val = ((add_value_to_slot_21_real (((val >> 3) & MASKF21), value) & MASKF21) << 3) | (val & ~(MASKF21 << 3)); - grub_set_unaligned32 (((grub_uint8_t *) (addr & MASK3) + 7), - grub_cpu_to_le32 (val)); + VasEBoot_set_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 7), + VasEBoot_cpu_to_le32 (val)); break; case 2: - val = grub_le_to_cpu32 (grub_get_unaligned32 (((grub_uint8_t *) + val = VasEBoot_le_to_cpu32 (VasEBoot_get_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 12))); val = ((add_value_to_slot_21_real (((val >> 4) & MASKF21), value) & MASKF21) << 4) | (val & ~(MASKF21 << 4)); - grub_set_unaligned32 (((grub_uint8_t *) (addr & MASK3) + 12), - grub_cpu_to_le32 (val)); + VasEBoot_set_unaligned32 (((VasEBoot_uint8_t *) (addr & MASK3) + 12), + VasEBoot_cpu_to_le32 (val)); break; } } -static const grub_uint8_t nopm[5] = +static const VasEBoot_uint8_t nopm[5] = { /* [MLX] nop.m 0x0 */ 0x05, 0x00, 0x00, 0x00, 0x01 }; -#ifdef GRUB_UTIL -static grub_uint8_t jump[0x20] = +#ifdef VasEBoot_UTIL +static VasEBoot_uint8_t jump[0x20] = { /* [MMI] add r15=r15,r1;; */ 0x0b, 0x78, 0x3c, 0x02, 0x00, 0x20, @@ -166,7 +166,7 @@ static grub_uint8_t jump[0x20] = 0x60, 0x00, 0x80, 0x00 }; #else -static const grub_uint8_t jump[0x20] = +static const VasEBoot_uint8_t jump[0x20] = { /* ld8 r16=[r15],8 */ 0x02, 0x80, 0x20, 0x1e, 0x18, 0x14, @@ -184,9 +184,9 @@ static const grub_uint8_t jump[0x20] = #endif void -grub_ia64_make_trampoline (struct grub_ia64_trampoline *tr, grub_uint64_t addr) +VasEBoot_ia64_make_trampoline (struct VasEBoot_ia64_trampoline *tr, VasEBoot_uint64_t addr) { - grub_memcpy (tr->nop, nopm, sizeof (tr->nop)); + VasEBoot_memcpy (tr->nop, nopm, sizeof (tr->nop)); tr->addr_hi[0] = ((addr & 0xc00000) >> 16); tr->addr_hi[1] = (addr >> 24) & 0xff; tr->addr_hi[2] = (addr >> 32) & 0xff; @@ -199,29 +199,29 @@ grub_ia64_make_trampoline (struct grub_ia64_trampoline *tr, grub_uint64_t addr) | ((addr & 0x200000) >> 17)); tr->addr_lo[2] = ((addr & 0x1f80) >> 5) | ((addr & 0x180000) >> 19); tr->addr_lo[3] = ((addr & 0xe000) >> 13) | 0x60; - grub_memcpy (tr->jump, jump, sizeof (tr->jump)); + VasEBoot_memcpy (tr->jump, jump, sizeof (tr->jump)); } -grub_err_t -grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got) +VasEBoot_err_t +VasEBoot_ia64_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got) { const Elf64_Ehdr *e = ehdr; - grub_size_t cntt = 0, cntg = 0; + VasEBoot_size_t cntt = 0, cntg = 0; const Elf64_Shdr *s; unsigned i; - for (i = 0, s = (Elf64_Shdr *) ((char *) e + grub_le_to_cpu64 (e->e_shoff)); - i < grub_le_to_cpu16 (e->e_shnum); - i++, s = (Elf64_Shdr *) ((char *) s + grub_le_to_cpu16 (e->e_shentsize))) - if (s->sh_type == grub_cpu_to_le32_compile_time (SHT_RELA)) + for (i = 0, s = (Elf64_Shdr *) ((char *) e + VasEBoot_le_to_cpu64 (e->e_shoff)); + i < VasEBoot_le_to_cpu16 (e->e_shnum); + i++, s = (Elf64_Shdr *) ((char *) s + VasEBoot_le_to_cpu16 (e->e_shentsize))) + if (s->sh_type == VasEBoot_cpu_to_le32_compile_time (SHT_RELA)) { const Elf64_Rela *rel, *max; - for (rel = (Elf64_Rela *) ((char *) e + grub_le_to_cpu64 (s->sh_offset)), - max = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_size)); - rel < max; rel = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_entsize))) - switch (ELF64_R_TYPE (grub_le_to_cpu64 (rel->r_info))) + for (rel = (Elf64_Rela *) ((char *) e + VasEBoot_le_to_cpu64 (s->sh_offset)), + max = (const Elf64_Rela *) ((char *) rel + VasEBoot_le_to_cpu64 (s->sh_size)); + rel < max; rel = (const Elf64_Rela *) ((char *) rel + VasEBoot_le_to_cpu64 (s->sh_entsize))) + switch (ELF64_R_TYPE (VasEBoot_le_to_cpu64 (rel->r_info))) { case R_IA64_PCREL21B: cntt++; @@ -233,9 +233,9 @@ grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, break; } } - *tramp = cntt * sizeof (struct grub_ia64_trampoline); - *got = cntg * sizeof (grub_uint64_t); + *tramp = cntt * sizeof (struct VasEBoot_ia64_trampoline); + *got = cntg * sizeof (VasEBoot_uint64_t); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/ia64/efi/init.c b/VasEBoot-core/kern/ia64/efi/init.c index b5ecbd091..2cd97c2aa 100644 --- a/VasEBoot-core/kern/ia64/efi/init.c +++ b/VasEBoot-core/kern/ia64/efi/init.c @@ -1,75 +1,75 @@ /* init.c - initialize an ia64-based EFI system */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_uint64_t divisor = 1; +static VasEBoot_uint64_t divisor = 1; -static grub_uint64_t +static VasEBoot_uint64_t get_itc (void) { - grub_uint64_t ret; + VasEBoot_uint64_t ret; asm volatile ("mov %0=ar.itc" : "=r" (ret)); return ret; } -grub_uint64_t -grub_rtc_get_time_ms (void) +VasEBoot_uint64_t +VasEBoot_rtc_get_time_ms (void) { return get_itc () / divisor; } void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_efi_event_t event; - grub_uint64_t before, after; - grub_efi_uintn_t idx; - grub_efi_init (); + VasEBoot_efi_event_t event; + VasEBoot_uint64_t before, after; + VasEBoot_efi_uintn_t idx; + VasEBoot_efi_init (); - efi_call_5 (grub_efi_system_table->boot_services->create_event, - GRUB_EFI_EVT_TIMER, GRUB_EFI_TPL_CALLBACK, 0, 0, &event); + efi_call_5 (VasEBoot_efi_system_table->boot_services->create_event, + VasEBoot_EFI_EVT_TIMER, VasEBoot_EFI_TPL_CALLBACK, 0, 0, &event); before = get_itc (); - efi_call_3 (grub_efi_system_table->boot_services->set_timer, event, - GRUB_EFI_TIMER_RELATIVE, 200000); - efi_call_3 (grub_efi_system_table->boot_services->wait_for_event, 1, + efi_call_3 (VasEBoot_efi_system_table->boot_services->set_timer, event, + VasEBoot_EFI_TIMER_RELATIVE, 200000); + efi_call_3 (VasEBoot_efi_system_table->boot_services->wait_for_event, 1, &event, &idx); after = get_itc (); - efi_call_1 (grub_efi_system_table->boot_services->close_event, event); + efi_call_1 (VasEBoot_efi_system_table->boot_services->close_event, event); divisor = (after - before + 5) / 20; if (divisor == 0) divisor = 800000; - grub_install_get_time_ms (grub_rtc_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_rtc_get_time_ms); } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) - grub_efi_fini (); + if (flags & VasEBoot_LOADER_FLAG_NORETURN) + VasEBoot_efi_fini (); } diff --git a/VasEBoot-core/kern/ia64/efi/startup.S b/VasEBoot-core/kern/ia64/efi/startup.S index d75c6d7cc..47b9fe444 100644 --- a/VasEBoot-core/kern/ia64/efi/startup.S +++ b/VasEBoot-core/kern/ia64/efi/startup.S @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include +#include +#include .text .psr abi64 @@ -29,12 +29,12 @@ _start: alloc loc0=ar.pfs,2,4,0,0 mov loc1=rp - addl loc2=@gprel(grub_efi_image_handle),gp - addl loc3=@gprel(grub_efi_system_table),gp + addl loc2=@gprel(VasEBoot_efi_image_handle),gp + addl loc3=@gprel(VasEBoot_efi_system_table),gp ;; st8 [loc2]=in0 st8 [loc3]=in1 - br.call.sptk.few rp=grub_main + br.call.sptk.few rp=VasEBoot_main ;; mov ar.pfs=loc0 mov rp=loc1 diff --git a/VasEBoot-core/kern/ieee1275/cmain.c b/VasEBoot-core/kern/ieee1275/cmain.c index 3e12e6b24..42fa80db8 100644 --- a/VasEBoot-core/kern/ieee1275/cmain.c +++ b/VasEBoot-core/kern/ieee1275/cmain.c @@ -1,96 +1,96 @@ /* cmain.c - Startup code for the PowerPC. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -int (*grub_ieee1275_entry_fn) (void *) GRUB_IEEE1275_ENTRY_FN_ATTRIBUTE; +int (*VasEBoot_ieee1275_entry_fn) (void *) VasEBoot_IEEE1275_ENTRY_FN_ATTRIBUTE; -grub_ieee1275_phandle_t grub_ieee1275_chosen; -grub_ieee1275_ihandle_t grub_ieee1275_mmu; +VasEBoot_ieee1275_phandle_t VasEBoot_ieee1275_chosen; +VasEBoot_ieee1275_ihandle_t VasEBoot_ieee1275_mmu; -static grub_uint32_t grub_ieee1275_flags; +static VasEBoot_uint32_t VasEBoot_ieee1275_flags; int -grub_ieee1275_test_flag (enum grub_ieee1275_flag flag) +VasEBoot_ieee1275_test_flag (enum VasEBoot_ieee1275_flag flag) { - return (grub_ieee1275_flags & (1 << flag)); + return (VasEBoot_ieee1275_flags & (1 << flag)); } void -grub_ieee1275_set_flag (enum grub_ieee1275_flag flag) +VasEBoot_ieee1275_set_flag (enum VasEBoot_ieee1275_flag flag) { - grub_ieee1275_flags |= (1 << flag); + VasEBoot_ieee1275_flags |= (1 << flag); } static void -grub_ieee1275_find_options (void) +VasEBoot_ieee1275_find_options (void) { - grub_ieee1275_phandle_t root; - grub_ieee1275_phandle_t options; - grub_ieee1275_phandle_t openprom; - grub_ieee1275_phandle_t bootrom; + VasEBoot_ieee1275_phandle_t root; + VasEBoot_ieee1275_phandle_t options; + VasEBoot_ieee1275_phandle_t openprom; + VasEBoot_ieee1275_phandle_t bootrom; int rc; - grub_uint32_t realmode = 0; + VasEBoot_uint32_t realmode = 0; char tmp[256]; int is_smartfirmware = 0; int is_olpc = 0; int is_qemu = 0; - grub_ssize_t actual; + VasEBoot_ssize_t actual; #ifdef __sparc__ - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_NO_PARTITION_0); #endif - grub_ieee1275_finddevice ("/", &root); - grub_ieee1275_finddevice ("/options", &options); - grub_ieee1275_finddevice ("/openprom", &openprom); + VasEBoot_ieee1275_finddevice ("/", &root); + VasEBoot_ieee1275_finddevice ("/options", &options); + VasEBoot_ieee1275_finddevice ("/openprom", &openprom); - rc = grub_ieee1275_get_integer_property (options, "real-mode?", &realmode, + rc = VasEBoot_ieee1275_get_integer_property (options, "real-mode?", &realmode, sizeof realmode, 0); - if (((rc >= 0) && realmode) || (grub_ieee1275_mmu == 0)) - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_REAL_MODE); + if (((rc >= 0) && realmode) || (VasEBoot_ieee1275_mmu == 0)) + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_REAL_MODE); - rc = grub_ieee1275_get_property (openprom, "CodeGen-copyright", + rc = VasEBoot_ieee1275_get_property (openprom, "CodeGen-copyright", tmp, sizeof (tmp), 0); - if (rc >= 0 && !grub_strncmp (tmp, "SmartFirmware(tm)", + if (rc >= 0 && !VasEBoot_strncmp (tmp, "SmartFirmware(tm)", sizeof ("SmartFirmware(tm)") - 1)) is_smartfirmware = 1; - rc = grub_ieee1275_get_property (root, "architecture", + rc = VasEBoot_ieee1275_get_property (root, "architecture", tmp, sizeof (tmp), 0); - if (rc >= 0 && !grub_strcmp (tmp, "OLPC")) + if (rc >= 0 && !VasEBoot_strcmp (tmp, "OLPC")) is_olpc = 1; - rc = grub_ieee1275_get_property (root, "model", + rc = VasEBoot_ieee1275_get_property (root, "model", tmp, sizeof (tmp), 0); - if (rc >= 0 && (!grub_strcmp (tmp, "Emulated PC") - || !grub_strcmp (tmp, "IBM pSeries (emulated by qemu)"))) { + if (rc >= 0 && (!VasEBoot_strcmp (tmp, "Emulated PC") + || !VasEBoot_strcmp (tmp, "IBM pSeries (emulated by qemu)"))) { is_qemu = 1; } - if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0) - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS); + if (rc >= 0 && VasEBoot_strncmp (tmp, "IBM", 3) == 0) + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS); /* Old Macs have no key repeat, newer ones have fully working one. The ones inbetween when repeated key generates an escaoe sequence @@ -100,24 +100,24 @@ grub_ieee1275_find_options (void) the current window on arrow repeat. To avoid unaffected users suffering from this workaround match only exact models known to have this bug. */ - if (rc >= 0 && grub_strcmp (tmp, "PowerBook3,3") == 0) - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT); + if (rc >= 0 && VasEBoot_strcmp (tmp, "PowerBook3,3") == 0) + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_BROKEN_REPEAT); - rc = grub_ieee1275_get_property (root, "compatible", + rc = VasEBoot_ieee1275_get_property (root, "compatible", tmp, sizeof (tmp), &actual); if (rc >= 0) { char *ptr; - for (ptr = tmp; ptr - tmp < actual; ptr += grub_strlen (ptr) + 1) + for (ptr = tmp; ptr - tmp < actual; ptr += VasEBoot_strlen (ptr) + 1) { - if (grub_memcmp (ptr, "MacRISC", sizeof ("MacRISC") - 1) == 0 + if (VasEBoot_memcmp (ptr, "MacRISC", sizeof ("MacRISC") - 1) == 0 && (ptr[sizeof ("MacRISC") - 1] == 0 - || grub_isdigit (ptr[sizeof ("MacRISC") - 1]))) + || VasEBoot_isdigit (ptr[sizeof ("MacRISC") - 1]))) { - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_NO_OFNET_SUFFIX); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN); break; } } @@ -126,14 +126,14 @@ grub_ieee1275_find_options (void) if (is_smartfirmware) { /* Broken in all versions */ - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_BROKEN_OUTPUT); /* There are two incompatible ways of checking the version number. Try both. */ - rc = grub_ieee1275_get_property (openprom, "SmartFirmware-version", + rc = VasEBoot_ieee1275_get_property (openprom, "SmartFirmware-version", tmp, sizeof (tmp), 0); if (rc < 0) - rc = grub_ieee1275_get_property (openprom, "firmware-version", + rc = VasEBoot_ieee1275_get_property (openprom, "firmware-version", tmp, sizeof (tmp), 0); if (rc >= 0) { @@ -144,13 +144,13 @@ grub_ieee1275_find_options (void) example we know that 1.2 and 1.3 are broken, but there's 1.2.99 and 1.3.99 which are known good (and applying this workaround would cause breakage). */ - if (!grub_strcmp (tmp, "1.0") - || !grub_strcmp (tmp, "1.1") - || !grub_strcmp (tmp, "1.2") - || !grub_strcmp (tmp, "1.3")) + if (!VasEBoot_strcmp (tmp, "1.0") + || !VasEBoot_strcmp (tmp, "1.1") + || !VasEBoot_strcmp (tmp, "1.2") + || !VasEBoot_strcmp (tmp, "1.3")) { - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_NO_PARTITION_0); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS); } } } @@ -162,7 +162,7 @@ grub_ieee1275_find_options (void) - NAND flash. These are accessible via OFW callbacks, but: - Follow strange semantics, imposed by hardware constraints. - Its ABI is undocumented, and not stable. - They lack "device_type" property, which conveniently makes GRUB + They lack "device_type" property, which conveniently makes VasEBoot skip them. - USB drives. Not accessible, because OFW shuts down the controller @@ -176,42 +176,42 @@ grub_ieee1275_find_options (void) since detecting SD cards is more reliable, we do that instead. */ - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_HAS_CURSORONOFF); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_OFDISK_SDCARD_ONLY); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_HAS_CURSORONOFF); } if (is_qemu) { /* OpenFirmware hangs on qemu if one requests any memory below 1.5 MiB. */ - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_HAS_CURSORONOFF); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_HAS_CURSORONOFF); } - if (! grub_ieee1275_finddevice ("/rom/boot-rom", &bootrom) - || ! grub_ieee1275_finddevice ("/boot-rom", &bootrom)) + if (! VasEBoot_ieee1275_finddevice ("/rom/boot-rom", &bootrom) + || ! VasEBoot_ieee1275_finddevice ("/boot-rom", &bootrom)) { - rc = grub_ieee1275_get_property (bootrom, "model", tmp, sizeof (tmp), 0); - if (rc >= 0 && !grub_strncmp (tmp, "PPC Open Hack'Ware", + rc = VasEBoot_ieee1275_get_property (bootrom, "model", tmp, sizeof (tmp), 0); + if (rc >= 0 && !VasEBoot_strncmp (tmp, "PPC Open Hack'Ware", sizeof ("PPC Open Hack'Ware") - 1)) { - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM); - grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_ANSI); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_BROKEN_OUTPUT); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_CANNOT_SET_COLORS); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_FORCE_CLAIM); + VasEBoot_ieee1275_set_flag (VasEBoot_IEEE1275_FLAG_NO_ANSI); } } } void -grub_ieee1275_init (void) +VasEBoot_ieee1275_init (void) { - grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); + VasEBoot_ieee1275_finddevice ("/chosen", &VasEBoot_ieee1275_chosen); - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "mmu", &grub_ieee1275_mmu, - sizeof grub_ieee1275_mmu, 0) < 0) - grub_ieee1275_mmu = 0; + if (VasEBoot_ieee1275_get_integer_property (VasEBoot_ieee1275_chosen, "mmu", &VasEBoot_ieee1275_mmu, + sizeof VasEBoot_ieee1275_mmu, 0) < 0) + VasEBoot_ieee1275_mmu = 0; - grub_ieee1275_find_options (); + VasEBoot_ieee1275_find_options (); } diff --git a/VasEBoot-core/kern/ieee1275/ieee1275.c b/VasEBoot-core/kern/ieee1275/ieee1275.c index 98217029f..858d7995b 100644 --- a/VasEBoot-core/kern/ieee1275/ieee1275.c +++ b/VasEBoot-core/kern/ieee1275/ieee1275.c @@ -1,44 +1,44 @@ /* of.c - Access the Open Firmware client interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_cell_t) -1) -#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0) -#define IEEE1275_CELL_INVALID ((grub_ieee1275_cell_t) -1) +#define IEEE1275_PHANDLE_INVALID ((VasEBoot_ieee1275_cell_t) -1) +#define IEEE1275_IHANDLE_INVALID ((VasEBoot_ieee1275_cell_t) 0) +#define IEEE1275_CELL_INVALID ((VasEBoot_ieee1275_cell_t) -1) int -grub_ieee1275_finddevice (const char *name, grub_ieee1275_phandle_t *phandlep) +VasEBoot_ieee1275_finddevice (const char *name, VasEBoot_ieee1275_phandle_t *phandlep) { struct find_device_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t device; - grub_ieee1275_cell_t phandle; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t device; + VasEBoot_ieee1275_cell_t phandle; } args; INIT_IEEE1275_COMMON (&args.common, "finddevice", 1, 1); - args.device = (grub_ieee1275_cell_t) name; + args.device = (VasEBoot_ieee1275_cell_t) name; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -49,75 +49,75 @@ grub_ieee1275_finddevice (const char *name, grub_ieee1275_phandle_t *phandlep) } int -grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle, +VasEBoot_ieee1275_get_property (VasEBoot_ieee1275_phandle_t phandle, const char *property, void *buf, - grub_size_t size, grub_ssize_t *actual) + VasEBoot_size_t size, VasEBoot_ssize_t *actual) { struct get_property_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t phandle; - grub_ieee1275_cell_t prop; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t buflen; - grub_ieee1275_cell_t size; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t phandle; + VasEBoot_ieee1275_cell_t prop; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t buflen; + VasEBoot_ieee1275_cell_t size; } args; INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1); args.phandle = phandle; - args.prop = (grub_ieee1275_cell_t) property; - args.buf = (grub_ieee1275_cell_t) buf; - args.buflen = (grub_ieee1275_cell_t) size; + args.prop = (VasEBoot_ieee1275_cell_t) property; + args.buf = (VasEBoot_ieee1275_cell_t) buf; + args.buflen = (VasEBoot_ieee1275_cell_t) size; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; if (actual) - *actual = (grub_ssize_t) args.size; + *actual = (VasEBoot_ssize_t) args.size; if (args.size == IEEE1275_CELL_INVALID) return -1; return 0; } int -grub_ieee1275_get_integer_property (grub_ieee1275_phandle_t phandle, - const char *property, grub_uint32_t *buf, - grub_size_t size, grub_ssize_t *actual) +VasEBoot_ieee1275_get_integer_property (VasEBoot_ieee1275_phandle_t phandle, + const char *property, VasEBoot_uint32_t *buf, + VasEBoot_size_t size, VasEBoot_ssize_t *actual) { int ret; - ret = grub_ieee1275_get_property (phandle, property, (void *) buf, size, actual); -#ifndef GRUB_CPU_WORDS_BIGENDIAN + ret = VasEBoot_ieee1275_get_property (phandle, property, (void *) buf, size, actual); +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN /* Integer properties are always in big endian. */ if (ret == 0) { unsigned int i; - size /= sizeof (grub_uint32_t); + size /= sizeof (VasEBoot_uint32_t); for (i = 0; i < size; i++) - buf[i] = grub_be_to_cpu32 (buf[i]); + buf[i] = VasEBoot_be_to_cpu32 (buf[i]); } #endif return ret; } int -grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop, +VasEBoot_ieee1275_next_property (VasEBoot_ieee1275_phandle_t phandle, char *prev_prop, char *prop) { struct get_property_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t phandle; - grub_ieee1275_cell_t prev_prop; - grub_ieee1275_cell_t next_prop; - grub_ieee1275_cell_t flags; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t phandle; + VasEBoot_ieee1275_cell_t prev_prop; + VasEBoot_ieee1275_cell_t next_prop; + VasEBoot_ieee1275_cell_t flags; } args; INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1); args.phandle = phandle; - args.prev_prop = (grub_ieee1275_cell_t) prev_prop; - args.next_prop = (grub_ieee1275_cell_t) prop; - args.flags = (grub_ieee1275_cell_t) -1; + args.prev_prop = (VasEBoot_ieee1275_cell_t) prev_prop; + args.next_prop = (VasEBoot_ieee1275_cell_t) prop; + args.flags = (VasEBoot_ieee1275_cell_t) -1; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -125,22 +125,22 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop, } int -grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, - const char *prop, grub_ssize_t *length) +VasEBoot_ieee1275_get_property_length (VasEBoot_ieee1275_phandle_t phandle, + const char *prop, VasEBoot_ssize_t *length) { struct get_property_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t phandle; - grub_ieee1275_cell_t prop; - grub_ieee1275_cell_t length; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t phandle; + VasEBoot_ieee1275_cell_t prop; + VasEBoot_ieee1275_cell_t length; } args; INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1); args.phandle = phandle; - args.prop = (grub_ieee1275_cell_t) prop; - args.length = (grub_ieee1275_cell_t) -1; + args.prop = (VasEBoot_ieee1275_cell_t) prop; + args.length = (VasEBoot_ieee1275_cell_t) -1; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -151,14 +151,14 @@ grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, } int -grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle, - grub_ieee1275_phandle_t *phandlep) +VasEBoot_ieee1275_instance_to_package (VasEBoot_ieee1275_ihandle_t ihandle, + VasEBoot_ieee1275_phandle_t *phandlep) { struct instance_to_package_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t phandle; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t phandle; } args; @@ -174,24 +174,24 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle, } int -grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle, - char *path, grub_size_t len, - grub_ssize_t *actual) +VasEBoot_ieee1275_package_to_path (VasEBoot_ieee1275_phandle_t phandle, + char *path, VasEBoot_size_t len, + VasEBoot_ssize_t *actual) { struct instance_to_package_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t phandle; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t buflen; - grub_ieee1275_cell_t actual; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t phandle; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t buflen; + VasEBoot_ieee1275_cell_t actual; } args; INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1); args.phandle = phandle; - args.buf = (grub_ieee1275_cell_t) path; - args.buflen = (grub_ieee1275_cell_t) len; + args.buf = (VasEBoot_ieee1275_cell_t) path; + args.buflen = (VasEBoot_ieee1275_cell_t) len; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -203,24 +203,24 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle, } int -grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle, - char *path, grub_size_t len, - grub_ssize_t *actual) +VasEBoot_ieee1275_instance_to_path (VasEBoot_ieee1275_ihandle_t ihandle, + char *path, VasEBoot_size_t len, + VasEBoot_ssize_t *actual) { struct instance_to_path_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t buflen; - grub_ieee1275_cell_t actual; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t buflen; + VasEBoot_ieee1275_cell_t actual; } args; INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1); args.ihandle = ihandle; - args.buf = (grub_ieee1275_cell_t) path; - args.buflen = (grub_ieee1275_cell_t) len; + args.buf = (VasEBoot_ieee1275_cell_t) path; + args.buflen = (VasEBoot_ieee1275_cell_t) len; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -232,23 +232,23 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle, } int -grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, const void *buffer, - grub_size_t len, grub_ssize_t *actualp) +VasEBoot_ieee1275_write (VasEBoot_ieee1275_ihandle_t ihandle, const void *buffer, + VasEBoot_size_t len, VasEBoot_ssize_t *actualp) { struct write_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t actual; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t len; + VasEBoot_ieee1275_cell_t actual; } args; INIT_IEEE1275_COMMON (&args.common, "write", 3, 1); args.ihandle = ihandle; - args.buf = (grub_ieee1275_cell_t) buffer; - args.len = (grub_ieee1275_cell_t) len; + args.buf = (VasEBoot_ieee1275_cell_t) buffer; + args.len = (VasEBoot_ieee1275_cell_t) len; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -258,23 +258,23 @@ grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, const void *buffer, } int -grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer, - grub_size_t len, grub_ssize_t *actualp) +VasEBoot_ieee1275_read (VasEBoot_ieee1275_ihandle_t ihandle, void *buffer, + VasEBoot_size_t len, VasEBoot_ssize_t *actualp) { struct write_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t actual; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t len; + VasEBoot_ieee1275_cell_t actual; } args; INIT_IEEE1275_COMMON (&args.common, "read", 3, 1); args.ihandle = ihandle; - args.buf = (grub_ieee1275_cell_t) buffer; - args.len = (grub_ieee1275_cell_t) len; + args.buf = (VasEBoot_ieee1275_cell_t) buffer; + args.len = (VasEBoot_ieee1275_cell_t) len; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -284,29 +284,29 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer, } int -grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, grub_disk_addr_t pos, - grub_ssize_t *result) +VasEBoot_ieee1275_seek (VasEBoot_ieee1275_ihandle_t ihandle, VasEBoot_disk_addr_t pos, + VasEBoot_ssize_t *result) { struct write_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t pos_hi; - grub_ieee1275_cell_t pos_lo; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t pos_hi; + VasEBoot_ieee1275_cell_t pos_lo; + VasEBoot_ieee1275_cell_t result; } args; INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1); args.ihandle = ihandle; /* To prevent stupid gcc warning. */ -#if GRUB_IEEE1275_CELL_SIZEOF >= 8 +#if VasEBoot_IEEE1275_CELL_SIZEOF >= 8 args.pos_hi = 0; args.pos_lo = pos; #else - args.pos_hi = (grub_ieee1275_cell_t) (pos >> (8 * GRUB_IEEE1275_CELL_SIZEOF)); - args.pos_lo = (grub_ieee1275_cell_t) - (pos & ((1ULL << (8 * GRUB_IEEE1275_CELL_SIZEOF)) - 1)); + args.pos_hi = (VasEBoot_ieee1275_cell_t) (pos >> (8 * VasEBoot_IEEE1275_CELL_SIZEOF)); + args.pos_lo = (VasEBoot_ieee1275_cell_t) + (pos & ((1ULL << (8 * VasEBoot_IEEE1275_CELL_SIZEOF)) - 1)); #endif if (IEEE1275_CALL_ENTRY_FN (&args) == -1) @@ -318,14 +318,14 @@ grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, grub_disk_addr_t pos, } int -grub_ieee1275_peer (grub_ieee1275_phandle_t node, - grub_ieee1275_phandle_t *result) +VasEBoot_ieee1275_peer (VasEBoot_ieee1275_phandle_t node, + VasEBoot_ieee1275_phandle_t *result) { struct peer_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t node; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t node; + VasEBoot_ieee1275_cell_t result; } args; @@ -341,14 +341,14 @@ grub_ieee1275_peer (grub_ieee1275_phandle_t node, } int -grub_ieee1275_child (grub_ieee1275_phandle_t node, - grub_ieee1275_phandle_t *result) +VasEBoot_ieee1275_child (VasEBoot_ieee1275_phandle_t node, + VasEBoot_ieee1275_phandle_t *result) { struct child_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t node; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t node; + VasEBoot_ieee1275_cell_t result; } args; @@ -365,14 +365,14 @@ grub_ieee1275_child (grub_ieee1275_phandle_t node, } int -grub_ieee1275_parent (grub_ieee1275_phandle_t node, - grub_ieee1275_phandle_t *result) +VasEBoot_ieee1275_parent (VasEBoot_ieee1275_phandle_t node, + VasEBoot_ieee1275_phandle_t *result) { struct parent_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t node; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t node; + VasEBoot_ieee1275_cell_t result; } args; @@ -387,21 +387,21 @@ grub_ieee1275_parent (grub_ieee1275_phandle_t node, } int -grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch) +VasEBoot_ieee1275_interpret (const char *command, VasEBoot_ieee1275_cell_t *catch) { struct enter_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t command; - grub_ieee1275_cell_t catch; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t command; + VasEBoot_ieee1275_cell_t catch; } args; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET)) return -1; INIT_IEEE1275_COMMON (&args.common, "interpret", 1, 1); - args.command = (grub_ieee1275_cell_t) command; + args.command = (VasEBoot_ieee1275_cell_t) command; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -411,11 +411,11 @@ grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch) } int -grub_ieee1275_enter (void) +VasEBoot_ieee1275_enter (void) { struct enter_args { - struct grub_ieee1275_common_hdr common; + struct VasEBoot_ieee1275_common_hdr common; } args; @@ -427,11 +427,11 @@ grub_ieee1275_enter (void) } void -grub_ieee1275_exit (void) +VasEBoot_ieee1275_exit (void) { struct exit_args { - struct grub_ieee1275_common_hdr common; + struct VasEBoot_ieee1275_common_hdr common; } args; @@ -442,18 +442,18 @@ grub_ieee1275_exit (void) } int -grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result) +VasEBoot_ieee1275_open (const char *path, VasEBoot_ieee1275_ihandle_t *result) { struct open_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t path; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t path; + VasEBoot_ieee1275_cell_t result; } args; INIT_IEEE1275_COMMON (&args.common, "open", 1, 1); - args.path = (grub_ieee1275_cell_t) path; + args.path = (VasEBoot_ieee1275_cell_t) path; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -464,12 +464,12 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result) } int -grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle) +VasEBoot_ieee1275_close (VasEBoot_ieee1275_ihandle_t ihandle) { struct close_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t ihandle; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t ihandle; } args; @@ -483,23 +483,23 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle) } int -grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, - grub_addr_t *result) +VasEBoot_ieee1275_claim (VasEBoot_addr_t addr, VasEBoot_size_t size, unsigned int align, + VasEBoot_addr_t *result) { struct claim_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t addr; - grub_ieee1275_cell_t size; - grub_ieee1275_cell_t align; - grub_ieee1275_cell_t base; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t addr; + VasEBoot_ieee1275_cell_t size; + VasEBoot_ieee1275_cell_t align; + VasEBoot_ieee1275_cell_t base; } args; INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1); - args.addr = (grub_ieee1275_cell_t) addr; - args.size = (grub_ieee1275_cell_t) size; - args.align = (grub_ieee1275_cell_t) align; + args.addr = (VasEBoot_ieee1275_cell_t) addr; + args.size = (VasEBoot_ieee1275_cell_t) size; + args.align = (VasEBoot_ieee1275_cell_t) align; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -511,13 +511,13 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, } int -grub_ieee1275_release (grub_addr_t addr, grub_size_t size) +VasEBoot_ieee1275_release (VasEBoot_addr_t addr, VasEBoot_size_t size) { struct release_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t addr; - grub_ieee1275_cell_t size; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t addr; + VasEBoot_ieee1275_cell_t size; } args; @@ -531,26 +531,26 @@ grub_ieee1275_release (grub_addr_t addr, grub_size_t size) } int -grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle, +VasEBoot_ieee1275_set_property (VasEBoot_ieee1275_phandle_t phandle, const char *propname, const void *buf, - grub_size_t size, grub_ssize_t *actual) + VasEBoot_size_t size, VasEBoot_ssize_t *actual) { struct set_property_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t phandle; - grub_ieee1275_cell_t propname; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t size; - grub_ieee1275_cell_t actual; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t phandle; + VasEBoot_ieee1275_cell_t propname; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t size; + VasEBoot_ieee1275_cell_t actual; } args; INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1); - args.size = (grub_ieee1275_cell_t) size; - args.buf = (grub_ieee1275_cell_t) buf; - args.propname = (grub_ieee1275_cell_t) propname; - args.phandle = (grub_ieee1275_cell_t) phandle; + args.size = (VasEBoot_ieee1275_cell_t) size; + args.buf = (VasEBoot_ieee1275_cell_t) buf; + args.propname = (VasEBoot_ieee1275_cell_t) propname; + args.phandle = (VasEBoot_ieee1275_cell_t) phandle; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -561,24 +561,24 @@ grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle, } int -grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, +VasEBoot_ieee1275_set_color (VasEBoot_ieee1275_ihandle_t ihandle, int index, int r, int g, int b) { struct set_color_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t index; - grub_ieee1275_cell_t b; - grub_ieee1275_cell_t g; - grub_ieee1275_cell_t r; - grub_ieee1275_cell_t catch_result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t index; + VasEBoot_ieee1275_cell_t b; + VasEBoot_ieee1275_cell_t g; + VasEBoot_ieee1275_cell_t r; + VasEBoot_ieee1275_cell_t catch_result; } args; INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); - args.method = (grub_ieee1275_cell_t) "color!"; + args.method = (VasEBoot_ieee1275_cell_t) "color!"; args.ihandle = ihandle; args.index = index; args.r = r; @@ -591,12 +591,12 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, } int -grub_ieee1275_milliseconds (grub_uint32_t *msecs) +VasEBoot_ieee1275_milliseconds (VasEBoot_uint32_t *msecs) { struct milliseconds_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t msecs; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t msecs; } args; diff --git a/VasEBoot-core/kern/ieee1275/init.c b/VasEBoot-core/kern/ieee1275/init.c index 12590225e..a5c0c8c09 100644 --- a/VasEBoot-core/kern/ieee1275/init.c +++ b/VasEBoot-core/kern/ieee1275/init.c @@ -1,45 +1,45 @@ -/* init.c -- Initialize GRUB on the newworld mac (PPC). */ +/* init.c -- Initialize VasEBoot on the newworld mac (PPC). */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef __i386__ -#include +#include #endif #ifdef __sparc__ -#include +#include #endif /* The minimal heap size we can live with. */ @@ -64,120 +64,120 @@ extern char _start[]; extern char _end[]; #ifdef __sparc__ -grub_addr_t grub_ieee1275_original_stack; +VasEBoot_addr_t VasEBoot_ieee1275_original_stack; #endif void -grub_exit (void) +VasEBoot_exit (void) { - grub_ieee1275_exit (); + VasEBoot_ieee1275_exit (); } -/* Translate an OF filesystem path (separated by backslashes), into a GRUB +/* Translate an OF filesystem path (separated by backslashes), into a VasEBoot path (separated by forward slashes). */ static void -grub_translate_ieee1275_path (char *filepath) +VasEBoot_translate_ieee1275_path (char *filepath) { char *backslash; - backslash = grub_strchr (filepath, '\\'); + backslash = VasEBoot_strchr (filepath, '\\'); while (backslash != 0) { *backslash = '/'; - backslash = grub_strchr (filepath, '\\'); + backslash = VasEBoot_strchr (filepath, '\\'); } } -void (*grub_ieee1275_net_config) (const char *dev, char **device, char **path, +void (*VasEBoot_ieee1275_net_config) (const char *dev, char **device, char **path, char *bootpath); void -grub_machine_get_bootlocation (char **device, char **path) +VasEBoot_machine_get_bootlocation (char **device, char **path) { char *bootpath; - grub_ssize_t bootpath_size; + VasEBoot_ssize_t bootpath_size; char *filename; char *type; - if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath", + if (VasEBoot_ieee1275_get_property_length (VasEBoot_ieee1275_chosen, "bootpath", &bootpath_size) || bootpath_size <= 0) { /* Should never happen. */ - grub_printf ("/chosen/bootpath property missing!\n"); + VasEBoot_printf ("/chosen/bootpath property missing!\n"); return; } - bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64); + bootpath = (char *) VasEBoot_malloc ((VasEBoot_size_t) bootpath_size + 64); if (! bootpath) { - grub_print_error (); + VasEBoot_print_error (); return; } - grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath, - (grub_size_t) bootpath_size + 1, 0); + VasEBoot_ieee1275_get_property (VasEBoot_ieee1275_chosen, "bootpath", bootpath, + (VasEBoot_size_t) bootpath_size + 1, 0); bootpath[bootpath_size] = '\0'; - /* Transform an OF device path to a GRUB path. */ + /* Transform an OF device path to a VasEBoot path. */ - type = grub_ieee1275_get_device_type (bootpath); - if (type && grub_strcmp (type, "network") == 0) + type = VasEBoot_ieee1275_get_device_type (bootpath); + if (type && VasEBoot_strcmp (type, "network") == 0) { char *dev, *canon; char *ptr; - dev = grub_ieee1275_get_aliasdevname (bootpath); - canon = grub_ieee1275_canonicalise_devname (dev); - ptr = canon + grub_strlen (canon) - 1; + dev = VasEBoot_ieee1275_get_aliasdevname (bootpath); + canon = VasEBoot_ieee1275_canonicalise_devname (dev); + ptr = canon + VasEBoot_strlen (canon) - 1; while (ptr > canon && (*ptr == ',' || *ptr == ':')) ptr--; ptr++; *ptr = 0; - if (grub_ieee1275_net_config) - grub_ieee1275_net_config (canon, device, path, bootpath); - grub_free (dev); - grub_free (canon); + if (VasEBoot_ieee1275_net_config) + VasEBoot_ieee1275_net_config (canon, device, path, bootpath); + VasEBoot_free (dev); + VasEBoot_free (canon); } else - *device = grub_ieee1275_encode_devname (bootpath); - grub_free (type); + *device = VasEBoot_ieee1275_encode_devname (bootpath); + VasEBoot_free (type); - filename = grub_ieee1275_get_filename (bootpath); + filename = VasEBoot_ieee1275_get_filename (bootpath); if (filename) { - char *lastslash = grub_strrchr (filename, '\\'); + char *lastslash = VasEBoot_strrchr (filename, '\\'); /* Truncate at last directory. */ if (lastslash) { *lastslash = '\0'; - grub_translate_ieee1275_path (filename); + VasEBoot_translate_ieee1275_path (filename); *path = filename; } } - grub_free (bootpath); + VasEBoot_free (bootpath); } /* Claim some available memory in the first /memory node. */ #ifdef __sparc__ static void -grub_claim_heap (void) +VasEBoot_claim_heap (void) { - grub_mm_init_region ((void *) (grub_modules_get_end () - + GRUB_KERNEL_MACHINE_STACK_SIZE), 0x200000); + VasEBoot_mm_init_region ((void *) (VasEBoot_modules_get_end () + + VasEBoot_KERNEL_MACHINE_STACK_SIZE), 0x200000); } #else -/* Helper for grub_claim_heap. */ +/* Helper for VasEBoot_claim_heap. */ static int -heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, +heap_init (VasEBoot_uint64_t addr, VasEBoot_uint64_t len, VasEBoot_memory_type_t type, void *data) { unsigned long *total = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM)) { if (addr + len <= 0x180000) return 0; @@ -205,20 +205,20 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, as a safeguard in case that doesn't happen. However, it doesn't protect us from corrupting our module area, which extends up to a yet-undetermined region above _end. */ - if ((addr < (grub_addr_t) _end) && ((addr + len) > (grub_addr_t) _start)) + if ((addr < (VasEBoot_addr_t) _end) && ((addr + len) > (VasEBoot_addr_t) _start)) { - grub_printf ("Warning: attempt to claim over our own code!\n"); + VasEBoot_printf ("Warning: attempt to claim over our own code!\n"); len = 0; } if (len) { - grub_err_t err; + VasEBoot_err_t err; /* Claim and use it. */ - err = grub_claimmap (addr, len); + err = VasEBoot_claimmap (addr, len); if (err) return err; - grub_mm_init_region ((void *) (grub_addr_t) addr, len); + VasEBoot_mm_init_region ((void *) (VasEBoot_addr_t) addr, len); } *total += len; @@ -229,25 +229,25 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, } static void -grub_claim_heap (void) +VasEBoot_claim_heap (void) { unsigned long total = 0; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) - heap_init (GRUB_IEEE1275_STATIC_HEAP_START, GRUB_IEEE1275_STATIC_HEAP_LEN, + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_FORCE_CLAIM)) + heap_init (VasEBoot_IEEE1275_STATIC_HEAP_START, VasEBoot_IEEE1275_STATIC_HEAP_LEN, 1, &total); else - grub_machine_mmap_iterate (heap_init, &total); + VasEBoot_machine_mmap_iterate (heap_init, &total); } #endif static void -grub_parse_cmdline (void) +VasEBoot_parse_cmdline (void) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; char args[256]; - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args, + if (VasEBoot_ieee1275_get_property (VasEBoot_ieee1275_chosen, "bootargs", &args, sizeof args, &actual) == 0 && actual > 1) { @@ -259,68 +259,68 @@ grub_parse_cmdline (void) char *end; char *val; - end = grub_strchr (command, ';'); + end = VasEBoot_strchr (command, ';'); if (end == 0) i = actual; /* No more commands after this one. */ else { *end = '\0'; i += end - command + 1; - while (grub_isspace(args[i])) + while (VasEBoot_isspace(args[i])) i++; } /* Process command. */ - val = grub_strchr (command, '='); + val = VasEBoot_strchr (command, '='); if (val) { *val = '\0'; - grub_env_set (command, val + 1); + VasEBoot_env_set (command, val + 1); } } } } -grub_addr_t grub_modbase; +VasEBoot_addr_t VasEBoot_modbase; void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_modbase = ALIGN_UP((grub_addr_t) _end - + GRUB_KERNEL_MACHINE_MOD_GAP, - GRUB_KERNEL_MACHINE_MOD_ALIGN); - grub_ieee1275_init (); + VasEBoot_modbase = ALIGN_UP((VasEBoot_addr_t) _end + + VasEBoot_KERNEL_MACHINE_MOD_GAP, + VasEBoot_KERNEL_MACHINE_MOD_ALIGN); + VasEBoot_ieee1275_init (); - grub_console_init_early (); - grub_claim_heap (); - grub_console_init_lately (); - grub_ofdisk_init (); + VasEBoot_console_init_early (); + VasEBoot_claim_heap (); + VasEBoot_console_init_lately (); + VasEBoot_ofdisk_init (); - grub_parse_cmdline (); + VasEBoot_parse_cmdline (); #ifdef __i386__ - grub_tsc_init (); + VasEBoot_tsc_init (); #else - grub_install_get_time_ms (grub_rtc_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_rtc_get_time_ms); #endif } void -grub_machine_fini (int flags) +VasEBoot_machine_fini (int flags) { - if (flags & GRUB_LOADER_FLAG_NORETURN) + if (flags & VasEBoot_LOADER_FLAG_NORETURN) { - grub_ofdisk_fini (); - grub_console_fini (); + VasEBoot_ofdisk_fini (); + VasEBoot_console_fini (); } } -grub_uint64_t -grub_rtc_get_time_ms (void) +VasEBoot_uint64_t +VasEBoot_rtc_get_time_ms (void) { - grub_uint32_t msecs = 0; + VasEBoot_uint32_t msecs = 0; - grub_ieee1275_milliseconds (&msecs); + VasEBoot_ieee1275_milliseconds (&msecs); return msecs; } diff --git a/VasEBoot-core/kern/ieee1275/mmap.c b/VasEBoot-core/kern/ieee1275/mmap.c index bf325eadf..9ee689963 100644 --- a/VasEBoot-core/kern/ieee1275/mmap.c +++ b/VasEBoot-core/kern/ieee1275/mmap.c @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - grub_ieee1275_phandle_t root; - grub_ieee1275_phandle_t memory; - grub_uint32_t available[128]; - grub_ssize_t available_size; - grub_uint32_t address_cells = 1; - grub_uint32_t size_cells = 1; + VasEBoot_ieee1275_phandle_t root; + VasEBoot_ieee1275_phandle_t memory; + VasEBoot_uint32_t available[128]; + VasEBoot_ssize_t available_size; + VasEBoot_uint32_t address_cells = 1; + VasEBoot_uint32_t size_cells = 1; int i; /* Determine the format of each entry in `available'. */ - grub_ieee1275_finddevice ("/", &root); - grub_ieee1275_get_integer_property (root, "#address-cells", &address_cells, + VasEBoot_ieee1275_finddevice ("/", &root); + VasEBoot_ieee1275_get_integer_property (root, "#address-cells", &address_cells, sizeof address_cells, 0); - grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, + VasEBoot_ieee1275_get_integer_property (root, "#size-cells", &size_cells, sizeof size_cells, 0); if (size_cells > address_cells) address_cells = size_cells; /* Load `/memory/available'. */ - if (grub_ieee1275_finddevice ("/memory", &memory)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + if (VasEBoot_ieee1275_finddevice ("/memory", &memory)) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "couldn't find /memory node"); - if (grub_ieee1275_get_integer_property (memory, "available", available, + if (VasEBoot_ieee1275_get_integer_property (memory, "available", available, sizeof available, &available_size)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "couldn't examine /memory/available property"); - if (available_size < 0 || (grub_size_t) available_size > sizeof (available)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + if (available_size < 0 || (VasEBoot_size_t) available_size > sizeof (available)) + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "/memory response buffer exceeded"); - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS)) { address_cells = 1; size_cells = 1; @@ -61,11 +61,11 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) /* Decode each entry and call `hook'. */ i = 0; - available_size /= sizeof (grub_uint32_t); + available_size /= sizeof (VasEBoot_uint32_t); while (i < available_size) { - grub_uint64_t address; - grub_uint64_t size; + VasEBoot_uint64_t address; + VasEBoot_uint64_t size; address = available[i++]; if (address_cells == 2) @@ -75,9 +75,9 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) if (size_cells == 2) size = (size << 32) | available[i++]; - if (hook (address, size, GRUB_MEMORY_AVAILABLE, hook_data)) + if (hook (address, size, VasEBoot_MEMORY_AVAILABLE, hook_data)) break; } - return grub_errno; + return VasEBoot_errno; } diff --git a/VasEBoot-core/kern/ieee1275/openfw.c b/VasEBoot-core/kern/ieee1275/openfw.c index ddb778340..cdeff73c0 100644 --- a/VasEBoot-core/kern/ieee1275/openfw.c +++ b/VasEBoot-core/kern/ieee1275/openfw.c @@ -1,93 +1,93 @@ /* openfw.c -- Open firmware support functions. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -enum grub_ieee1275_parse_type +enum VasEBoot_ieee1275_parse_type { - GRUB_PARSE_FILENAME, - GRUB_PARSE_PARTITION, - GRUB_PARSE_DEVICE, - GRUB_PARSE_DEVICE_TYPE + VasEBoot_PARSE_FILENAME, + VasEBoot_PARSE_PARTITION, + VasEBoot_PARSE_DEVICE, + VasEBoot_PARSE_DEVICE_TYPE }; static int -fill_alias (struct grub_ieee1275_devalias *alias) +fill_alias (struct VasEBoot_ieee1275_devalias *alias) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; - if (grub_ieee1275_get_property (alias->phandle, "device_type", alias->type, + if (VasEBoot_ieee1275_get_property (alias->phandle, "device_type", alias->type, IEEE1275_MAX_PROP_LEN, &actual)) alias->type[0] = 0; if (alias->parent_dev == alias->phandle) return 0; - if (grub_ieee1275_package_to_path (alias->phandle, alias->path, + if (VasEBoot_ieee1275_package_to_path (alias->phandle, alias->path, IEEE1275_MAX_PATH_LEN, &actual)) return 0; - if (grub_strcmp (alias->parent_path, alias->path) == 0) + if (VasEBoot_strcmp (alias->parent_path, alias->path) == 0) return 0; - if (grub_ieee1275_get_property (alias->phandle, "name", alias->name, + if (VasEBoot_ieee1275_get_property (alias->phandle, "name", alias->name, IEEE1275_MAX_PROP_LEN, &actual)) return 0; - grub_dprintf ("devalias", "device path=%s\n", alias->path); + VasEBoot_dprintf ("devalias", "device path=%s\n", alias->path); return 1; } void -grub_ieee1275_devalias_free (struct grub_ieee1275_devalias *alias) +VasEBoot_ieee1275_devalias_free (struct VasEBoot_ieee1275_devalias *alias) { - grub_free (alias->name); - grub_free (alias->type); - grub_free (alias->path); - grub_free (alias->parent_path); + VasEBoot_free (alias->name); + VasEBoot_free (alias->type); + VasEBoot_free (alias->path); + VasEBoot_free (alias->parent_path); alias->name = 0; alias->type = 0; alias->path = 0; alias->parent_path = 0; - alias->phandle = GRUB_IEEE1275_PHANDLE_INVALID; + alias->phandle = VasEBoot_IEEE1275_PHANDLE_INVALID; } void -grub_ieee1275_children_peer (struct grub_ieee1275_devalias *alias) +VasEBoot_ieee1275_children_peer (struct VasEBoot_ieee1275_devalias *alias) { - while (grub_ieee1275_peer (alias->phandle, &alias->phandle) != -1) + while (VasEBoot_ieee1275_peer (alias->phandle, &alias->phandle) != -1) if (fill_alias (alias)) return; - grub_ieee1275_devalias_free (alias); + VasEBoot_ieee1275_devalias_free (alias); } void -grub_ieee1275_children_first (const char *devpath, - struct grub_ieee1275_devalias *alias) +VasEBoot_ieee1275_children_first (const char *devpath, + struct VasEBoot_ieee1275_devalias *alias) { - grub_ieee1275_phandle_t dev; + VasEBoot_ieee1275_phandle_t dev; - grub_dprintf ("devalias", "iterating children of %s\n", + VasEBoot_dprintf ("devalias", "iterating children of %s\n", devpath); alias->name = 0; @@ -95,46 +95,46 @@ grub_ieee1275_children_first (const char *devpath, alias->parent_path = 0; alias->type = 0; - if (grub_ieee1275_finddevice (devpath, &dev)) + if (VasEBoot_ieee1275_finddevice (devpath, &dev)) return; - if (grub_ieee1275_child (dev, &alias->phandle)) + if (VasEBoot_ieee1275_child (dev, &alias->phandle)) return; - alias->type = grub_malloc (IEEE1275_MAX_PROP_LEN); + alias->type = VasEBoot_malloc (IEEE1275_MAX_PROP_LEN); if (!alias->type) return; - alias->path = grub_malloc (IEEE1275_MAX_PATH_LEN); + alias->path = VasEBoot_malloc (IEEE1275_MAX_PATH_LEN); if (!alias->path) { - grub_free (alias->type); + VasEBoot_free (alias->type); return; } - alias->parent_path = grub_strdup (devpath); + alias->parent_path = VasEBoot_strdup (devpath); if (!alias->parent_path) { - grub_free (alias->path); - grub_free (alias->type); + VasEBoot_free (alias->path); + VasEBoot_free (alias->type); return; } - alias->name = grub_malloc (IEEE1275_MAX_PROP_LEN); + alias->name = VasEBoot_malloc (IEEE1275_MAX_PROP_LEN); if (!alias->name) { - grub_free (alias->path); - grub_free (alias->type); - grub_free (alias->parent_path); + VasEBoot_free (alias->path); + VasEBoot_free (alias->type); + VasEBoot_free (alias->parent_path); return; } if (!fill_alias (alias)) - grub_ieee1275_children_peer (alias); + VasEBoot_ieee1275_children_peer (alias); } static int iterate_recursively (const char *path, - int (*hook) (struct grub_ieee1275_devalias *alias)) + int (*hook) (struct VasEBoot_ieee1275_devalias *alias)) { - struct grub_ieee1275_devalias alias; + struct VasEBoot_ieee1275_devalias alias; int ret = 0; FOR_IEEE1275_DEVCHILDREN(path, alias) @@ -146,37 +146,37 @@ iterate_recursively (const char *path, if (ret) break; } - grub_ieee1275_devalias_free (&alias); + VasEBoot_ieee1275_devalias_free (&alias); return ret; } int -grub_ieee1275_devices_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) +VasEBoot_ieee1275_devices_iterate (int (*hook) (struct VasEBoot_ieee1275_devalias *alias)) { return iterate_recursively ("/", hook); } void -grub_ieee1275_devalias_init_iterator (struct grub_ieee1275_devalias *alias) +VasEBoot_ieee1275_devalias_init_iterator (struct VasEBoot_ieee1275_devalias *alias) { alias->name = 0; alias->path = 0; alias->parent_path = 0; alias->type = 0; - grub_dprintf ("devalias", "iterating aliases\n"); + VasEBoot_dprintf ("devalias", "iterating aliases\n"); - if (grub_ieee1275_finddevice ("/aliases", &alias->parent_dev)) + if (VasEBoot_ieee1275_finddevice ("/aliases", &alias->parent_dev)) return; - alias->name = grub_malloc (IEEE1275_MAX_PROP_LEN); + alias->name = VasEBoot_malloc (IEEE1275_MAX_PROP_LEN); if (!alias->name) return; - alias->type = grub_malloc (IEEE1275_MAX_PROP_LEN); + alias->type = VasEBoot_malloc (IEEE1275_MAX_PROP_LEN); if (!alias->type) { - grub_free (alias->name); + VasEBoot_free (alias->name); alias->name = 0; return; } @@ -185,55 +185,55 @@ grub_ieee1275_devalias_init_iterator (struct grub_ieee1275_devalias *alias) } int -grub_ieee1275_devalias_next (struct grub_ieee1275_devalias *alias) +VasEBoot_ieee1275_devalias_next (struct VasEBoot_ieee1275_devalias *alias) { if (!alias->name) return 0; while (1) { - grub_ssize_t pathlen; - grub_ssize_t actual; + VasEBoot_ssize_t pathlen; + VasEBoot_ssize_t actual; char *tmp; if (alias->path) { - grub_free (alias->path); + VasEBoot_free (alias->path); alias->path = 0; } - tmp = grub_strdup (alias->name); - if (grub_ieee1275_next_property (alias->parent_dev, tmp, + tmp = VasEBoot_strdup (alias->name); + if (VasEBoot_ieee1275_next_property (alias->parent_dev, tmp, alias->name) <= 0) { - grub_free (tmp); - grub_ieee1275_devalias_free (alias); + VasEBoot_free (tmp); + VasEBoot_ieee1275_devalias_free (alias); return 0; } - grub_free (tmp); + VasEBoot_free (tmp); - grub_dprintf ("devalias", "devalias name = %s\n", alias->name); + VasEBoot_dprintf ("devalias", "devalias name = %s\n", alias->name); - grub_ieee1275_get_property_length (alias->parent_dev, alias->name, &pathlen); + VasEBoot_ieee1275_get_property_length (alias->parent_dev, alias->name, &pathlen); /* The property `name' is a special case we should skip. */ - if (grub_strcmp (alias->name, "name") == 0) + if (VasEBoot_strcmp (alias->name, "name") == 0) continue; /* Sun's OpenBoot often doesn't zero terminate the device alias strings, so we will add a NULL byte at the end explicitly. */ pathlen += 1; - alias->path = grub_malloc (pathlen + 1); + alias->path = VasEBoot_malloc (pathlen + 1); if (! alias->path) { - grub_ieee1275_devalias_free (alias); + VasEBoot_ieee1275_devalias_free (alias); return 0; } - if (grub_ieee1275_get_property (alias->parent_dev, alias->name, alias->path, + if (VasEBoot_ieee1275_get_property (alias->parent_dev, alias->name, alias->path, pathlen, &actual) || actual < 0) { - grub_dprintf ("devalias", "get_property (%s) failed\n", alias->name); - grub_free (alias->path); + VasEBoot_dprintf ("devalias", "get_property (%s) failed\n", alias->name); + VasEBoot_free (alias->path); continue; } if (actual > pathlen) @@ -241,15 +241,15 @@ grub_ieee1275_devalias_next (struct grub_ieee1275_devalias *alias) alias->path[actual] = '\0'; alias->path[pathlen] = '\0'; - if (grub_ieee1275_finddevice (alias->path, &alias->phandle)) + if (VasEBoot_ieee1275_finddevice (alias->path, &alias->phandle)) { - grub_dprintf ("devalias", "finddevice (%s) failed\n", alias->path); - grub_free (alias->path); + VasEBoot_dprintf ("devalias", "finddevice (%s) failed\n", alias->path); + VasEBoot_free (alias->path); alias->path = 0; continue; } - if (grub_ieee1275_get_property (alias->phandle, "device_type", alias->type, + if (VasEBoot_ieee1275_get_property (alias->phandle, "device_type", alias->type, IEEE1275_MAX_PROP_LEN, &actual)) { /* NAND device don't have device_type property. */ @@ -261,21 +261,21 @@ grub_ieee1275_devalias_next (struct grub_ieee1275_devalias *alias) /* Call the "map" method of /chosen/mmu. */ int -grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size, - grub_uint32_t mode) +VasEBoot_ieee1275_map (VasEBoot_addr_t phys, VasEBoot_addr_t virt, VasEBoot_size_t size, + VasEBoot_uint32_t mode) { struct map_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t mode; - grub_ieee1275_cell_t size; - grub_ieee1275_cell_t virt; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t mode; + VasEBoot_ieee1275_cell_t size; + VasEBoot_ieee1275_cell_t virt; #ifdef __sparc__ - grub_ieee1275_cell_t phys_high; + VasEBoot_ieee1275_cell_t phys_high; #endif - grub_ieee1275_cell_t phys_low; - grub_ieee1275_cell_t catch_result; + VasEBoot_ieee1275_cell_t phys_low; + VasEBoot_ieee1275_cell_t catch_result; } args; INIT_IEEE1275_COMMON (&args.common, "call-method", @@ -285,8 +285,8 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size, 6, #endif 1); - args.method = (grub_ieee1275_cell_t) "map"; - args.ihandle = grub_ieee1275_mmu; + args.method = (VasEBoot_ieee1275_cell_t) "map"; + args.ihandle = VasEBoot_ieee1275_mmu; #ifdef __sparc__ args.phys_high = 0; #endif @@ -294,7 +294,7 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size, args.virt = virt; args.size = size; args.mode = mode; /* Format is WIMG0PP. */ - args.catch_result = (grub_ieee1275_cell_t) -1; + args.catch_result = (VasEBoot_ieee1275_cell_t) -1; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -302,104 +302,104 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size, return args.catch_result; } -grub_err_t -grub_claimmap (grub_addr_t addr, grub_size_t size) +VasEBoot_err_t +VasEBoot_claimmap (VasEBoot_addr_t addr, VasEBoot_size_t size) { - if (grub_ieee1275_claim (addr, size, 0, 0)) + if (VasEBoot_ieee1275_claim (addr, size, 0, 0)) return -1; - if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE) - && grub_ieee1275_map (addr, addr, size, 0x00)) + if (! VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_REAL_MODE) + && VasEBoot_ieee1275_map (addr, addr, size, 0x00)) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "map failed: address 0x%llx, size 0x%llx\n", + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "map failed: address 0x%llx, size 0x%llx\n", (long long) addr, (long long) size); - grub_ieee1275_release (addr, size); - return grub_errno; + VasEBoot_ieee1275_release (addr, size); + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Get the device arguments of the Open Firmware node name `path'. */ static char * -grub_ieee1275_get_devargs (const char *path) +VasEBoot_ieee1275_get_devargs (const char *path) { - char *colon = grub_strchr (path, ':'); + char *colon = VasEBoot_strchr (path, ':'); if (! colon) return 0; - return grub_strdup (colon + 1); + return VasEBoot_strdup (colon + 1); } /* Get the device path of the Open Firmware node name `path'. */ char * -grub_ieee1275_get_devname (const char *path) +VasEBoot_ieee1275_get_devname (const char *path) { - char *colon = grub_strchr (path, ':'); - int pathlen = grub_strlen (path); - struct grub_ieee1275_devalias curalias; + char *colon = VasEBoot_strchr (path, ':'); + int pathlen = VasEBoot_strlen (path); + struct VasEBoot_ieee1275_devalias curalias; if (colon) pathlen = (int)(colon - path); /* Try to find an alias for this device. */ FOR_IEEE1275_DEVALIASES (curalias) /* briQ firmware can change capitalization in /chosen/bootpath. */ - if (grub_strncasecmp (curalias.path, path, pathlen) == 0 + if (VasEBoot_strncasecmp (curalias.path, path, pathlen) == 0 && curalias.path[pathlen] == 0) { char *newpath; - newpath = grub_strdup (curalias.name); - grub_ieee1275_devalias_free (&curalias); + newpath = VasEBoot_strdup (curalias.name); + VasEBoot_ieee1275_devalias_free (&curalias); return newpath; } - return grub_strndup (path, pathlen); + return VasEBoot_strndup (path, pathlen); } static char * -grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) +VasEBoot_ieee1275_parse_args (const char *path, enum VasEBoot_ieee1275_parse_type ptype) { char type[64]; /* XXX check size. */ - char *device = grub_ieee1275_get_devname (path); + char *device = VasEBoot_ieee1275_get_devname (path); char *ret = 0; - grub_ieee1275_phandle_t dev; + VasEBoot_ieee1275_phandle_t dev; /* We need to know what type of device it is in order to parse the full file path properly. */ - if (grub_ieee1275_finddevice (device, &dev)) + if (VasEBoot_ieee1275_finddevice (device, &dev)) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "device %s not found", device); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "device %s not found", device); goto fail; } - if (grub_ieee1275_get_property (dev, "device_type", &type, sizeof type, 0)) + if (VasEBoot_ieee1275_get_property (dev, "device_type", &type, sizeof type, 0)) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "device %s lacks a device_type property", device); goto fail; } switch (ptype) { - case GRUB_PARSE_DEVICE: - ret = grub_strdup (device); + case VasEBoot_PARSE_DEVICE: + ret = VasEBoot_strdup (device); break; - case GRUB_PARSE_DEVICE_TYPE: - ret = grub_strdup (type); + case VasEBoot_PARSE_DEVICE_TYPE: + ret = VasEBoot_strdup (type); break; - case GRUB_PARSE_FILENAME: + case VasEBoot_PARSE_FILENAME: { char *comma; char *args; - args = grub_ieee1275_get_devargs (path); + args = VasEBoot_ieee1275_get_devargs (path); if (!args) /* Shouldn't happen. */ return 0; /* The syntax of the device arguments is defined in the CHRP and PReP IEEE1275 bindings: "[partition][,[filename]]". */ - comma = grub_strchr (args, ','); + comma = VasEBoot_strchr (args, ','); if (comma) { @@ -407,89 +407,89 @@ grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) /* Make sure filepath has leading backslash. */ if (filepath[0] != '\\') - ret = grub_xasprintf ("\\%s", filepath); + ret = VasEBoot_xasprintf ("\\%s", filepath); else - ret = grub_strdup (filepath); + ret = VasEBoot_strdup (filepath); } - grub_free (args); + VasEBoot_free (args); } break; - case GRUB_PARSE_PARTITION: + case VasEBoot_PARSE_PARTITION: { char *comma; char *args; - if (grub_strcmp ("block", type) != 0) + if (VasEBoot_strcmp ("block", type) != 0) goto unknown; - args = grub_ieee1275_get_devargs (path); + args = VasEBoot_ieee1275_get_devargs (path); if (!args) /* Shouldn't happen. */ return 0; - comma = grub_strchr (args, ','); + comma = VasEBoot_strchr (args, ','); if (!comma) - ret = grub_strdup (args); + ret = VasEBoot_strdup (args); else - ret = grub_strndup (args, (grub_size_t)(comma - args)); - /* Consistently provide numbered partitions to GRUB. + ret = VasEBoot_strndup (args, (VasEBoot_size_t)(comma - args)); + /* Consistently provide numbered partitions to VasEBoot. OpenBOOT traditionally uses alphabetical partition specifiers. */ if (ret[0] >= 'a' && ret[0] <= 'z') ret[0] = '1' + (ret[0] - 'a'); - grub_free (args); + VasEBoot_free (args); } break; default: unknown: - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported type %s for device %s", type, device); } fail: - grub_free (device); + VasEBoot_free (device); return ret; } char * -grub_ieee1275_get_device_type (const char *path) +VasEBoot_ieee1275_get_device_type (const char *path) { - return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE_TYPE); + return VasEBoot_ieee1275_parse_args (path, VasEBoot_PARSE_DEVICE_TYPE); } char * -grub_ieee1275_get_aliasdevname (const char *path) +VasEBoot_ieee1275_get_aliasdevname (const char *path) { - return grub_ieee1275_parse_args (path, GRUB_PARSE_DEVICE); + return VasEBoot_ieee1275_parse_args (path, VasEBoot_PARSE_DEVICE); } char * -grub_ieee1275_get_filename (const char *path) +VasEBoot_ieee1275_get_filename (const char *path) { - return grub_ieee1275_parse_args (path, GRUB_PARSE_FILENAME); + return VasEBoot_ieee1275_parse_args (path, VasEBoot_PARSE_FILENAME); } -/* Convert a device name from IEEE1275 syntax to GRUB syntax. */ +/* Convert a device name from IEEE1275 syntax to VasEBoot syntax. */ char * -grub_ieee1275_encode_devname (const char *path) +VasEBoot_ieee1275_encode_devname (const char *path) { - char *device = grub_ieee1275_get_devname (path); + char *device = VasEBoot_ieee1275_get_devname (path); char *partition; char *encoding; char *optr; const char *iptr; - encoding = grub_malloc (sizeof ("ieee1275/") + 2 * grub_strlen (device) + encoding = VasEBoot_malloc (sizeof ("ieee1275/") + 2 * VasEBoot_strlen (device) + sizeof (",XXXXXXXXXXXX")); if (!encoding) { - grub_free (device); + VasEBoot_free (device); return 0; } - partition = grub_ieee1275_parse_args (path, GRUB_PARSE_PARTITION); + partition = VasEBoot_ieee1275_parse_args (path, VasEBoot_PARSE_PARTITION); - optr = grub_stpcpy (encoding, "ieee1275/"); + optr = VasEBoot_stpcpy (encoding, "ieee1275/"); for (iptr = device; *iptr; ) { if (*iptr == ',') @@ -498,54 +498,54 @@ grub_ieee1275_encode_devname (const char *path) } if (partition && partition[0]) { - unsigned int partno = grub_strtoul (partition, 0, 0); + unsigned int partno = VasEBoot_strtoul (partition, 0, 0); *optr++ = ','; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS)) - /* GRUB partition 1 is OF partition 0. */ + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS)) + /* VasEBoot partition 1 is OF partition 0. */ partno++; - grub_snprintf (optr, sizeof ("XXXXXXXXXXXX"), "%d", partno); + VasEBoot_snprintf (optr, sizeof ("XXXXXXXXXXXX"), "%d", partno); } else *optr = '\0'; - grub_free (partition); - grub_free (device); + VasEBoot_free (partition); + VasEBoot_free (device); return encoding; } /* Resolve aliases. */ char * -grub_ieee1275_canonicalise_devname (const char *path) +VasEBoot_ieee1275_canonicalise_devname (const char *path) { struct canon_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t path; - grub_ieee1275_cell_t buf; - grub_ieee1275_cell_t inlen; - grub_ieee1275_cell_t outlen; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t path; + VasEBoot_ieee1275_cell_t buf; + VasEBoot_ieee1275_cell_t inlen; + VasEBoot_ieee1275_cell_t outlen; } args; char *buf = NULL; - grub_size_t bufsize = 64; + VasEBoot_size_t bufsize = 64; int i; for (i = 0; i < 2; i++) { - grub_free (buf); + VasEBoot_free (buf); - buf = grub_malloc (bufsize); + buf = VasEBoot_malloc (bufsize); if (!buf) return NULL; INIT_IEEE1275_COMMON (&args.common, "canon", 3, 1); - args.path = (grub_ieee1275_cell_t) path; - args.buf = (grub_ieee1275_cell_t) buf; - args.inlen = (grub_ieee1275_cell_t) (bufsize - 1); + args.path = (VasEBoot_ieee1275_cell_t) path; + args.buf = (VasEBoot_ieee1275_cell_t) buf; + args.inlen = (VasEBoot_ieee1275_cell_t) (bufsize - 1); if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return 0; @@ -557,7 +557,7 @@ grub_ieee1275_canonicalise_devname (const char *path) return buf; } /* Shouldn't reach here. */ - grub_free (buf); + VasEBoot_free (buf); return NULL; } diff --git a/VasEBoot-core/kern/list.c b/VasEBoot-core/kern/list.c index a256bb3f8..af325c783 100644 --- a/VasEBoot-core/kern/list.c +++ b/VasEBoot-core/kern/list.c @@ -1,40 +1,40 @@ -/* list.c - grub list function */ +/* list.c - VasEBoot list function */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include void * -grub_named_list_find (grub_named_list_t head, const char *name) +VasEBoot_named_list_find (VasEBoot_named_list_t head, const char *name) { - grub_named_list_t item; + VasEBoot_named_list_t item; FOR_LIST_ELEMENTS (item, head) - if (grub_strcmp (item->name, name) == 0) + if (VasEBoot_strcmp (item->name, name) == 0) return item; return NULL; } void -grub_list_push (grub_list_t *head, grub_list_t item) +VasEBoot_list_push (VasEBoot_list_t *head, VasEBoot_list_t item) { item->prev = head; if (*head) @@ -44,7 +44,7 @@ grub_list_push (grub_list_t *head, grub_list_t item) } void -grub_list_remove (grub_list_t item) +VasEBoot_list_remove (VasEBoot_list_t item) { if (item->prev) *item->prev = item->next; diff --git a/VasEBoot-core/kern/main.c b/VasEBoot-core/kern/main.c index 682d598f1..0ac5e7b8c 100644 --- a/VasEBoot-core/kern/main.c +++ b/VasEBoot-core/kern/main.c @@ -1,95 +1,95 @@ /* main.c - the kernel main routine */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_MACHINE_PCBIOS -#include +#ifdef VasEBoot_MACHINE_PCBIOS +#include #endif -grub_addr_t -grub_modules_get_end (void) +VasEBoot_addr_t +VasEBoot_modules_get_end (void) { - struct grub_module_info *modinfo; + struct VasEBoot_module_info *modinfo; - modinfo = (struct grub_module_info *) grub_modbase; + modinfo = (struct VasEBoot_module_info *) VasEBoot_modbase; /* Check if there are any modules. */ - if ((modinfo == 0) || modinfo->magic != GRUB_MODULE_MAGIC) - return grub_modbase; + if ((modinfo == 0) || modinfo->magic != VasEBoot_MODULE_MAGIC) + return VasEBoot_modbase; - return grub_modbase + modinfo->size; + return VasEBoot_modbase + modinfo->size; } /* Load all modules in core. */ static void -grub_load_modules (void) +VasEBoot_load_modules (void) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; FOR_MODULES (header) { /* Not an ELF module, skip. */ if (header->type != OBJ_TYPE_ELF) continue; - if (! grub_dl_load_core ((char *) header + sizeof (struct grub_module_header), - (header->size - sizeof (struct grub_module_header)))) - grub_fatal ("%s", grub_errmsg); + if (! VasEBoot_dl_load_core ((char *) header + sizeof (struct VasEBoot_module_header), + (header->size - sizeof (struct VasEBoot_module_header)))) + VasEBoot_fatal ("%s", VasEBoot_errmsg); - if (grub_errno) - grub_print_error (); + if (VasEBoot_errno) + VasEBoot_print_error (); } } static char *load_config; static void -grub_load_config (void) +VasEBoot_load_config (void) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; FOR_MODULES (header) { /* Not an embedded config, skip. */ if (header->type != OBJ_TYPE_CONFIG) continue; - load_config = grub_malloc (header->size - sizeof (struct grub_module_header) + 1); + load_config = VasEBoot_malloc (header->size - sizeof (struct VasEBoot_module_header) + 1); if (!load_config) { - grub_print_error (); + VasEBoot_print_error (); break; } - grub_memcpy (load_config, (char *) header + - sizeof (struct grub_module_header), - header->size - sizeof (struct grub_module_header)); - load_config[header->size - sizeof (struct grub_module_header)] = 0; + VasEBoot_memcpy (load_config, (char *) header + + sizeof (struct VasEBoot_module_header), + header->size - sizeof (struct VasEBoot_module_header)); + load_config[header->size - sizeof (struct VasEBoot_module_header)] = 0; break; } } @@ -97,49 +97,49 @@ grub_load_config (void) /* Write hook for the environment variables of root. Remove surrounding parentheses, if any. */ static char * -grub_env_write_root (struct grub_env_var *var __attribute__ ((unused)), +VasEBoot_env_write_root (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { /* XXX Is it better to check the existence of the device? */ - grub_size_t len = grub_strlen (val); + VasEBoot_size_t len = VasEBoot_strlen (val); if (val[0] == '(' && val[len - 1] == ')') - return grub_strndup (val + 1, len - 2); + return VasEBoot_strndup (val + 1, len - 2); - return grub_strdup (val); + return VasEBoot_strdup (val); } static void -grub_set_prefix_and_root (void) +VasEBoot_set_prefix_and_root (void) { char *device = NULL; char *path = NULL; char *fwdevice = NULL; char *fwpath = NULL; char *prefix = NULL; - struct grub_module_header *header; + struct VasEBoot_module_header *header; FOR_MODULES (header) if (header->type == OBJ_TYPE_PREFIX) - prefix = (char *) header + sizeof (struct grub_module_header); + prefix = (char *) header + sizeof (struct VasEBoot_module_header); - grub_register_variable_hook ("root", 0, grub_env_write_root); + VasEBoot_register_variable_hook ("root", 0, VasEBoot_env_write_root); - grub_machine_get_bootlocation (&fwdevice, &fwpath); + VasEBoot_machine_get_bootlocation (&fwdevice, &fwpath); if (fwdevice) { char *cmdpath; - grub_env_set ("cmddevice", fwdevice); - grub_env_export ("cmddevice"); + VasEBoot_env_set ("cmddevice", fwdevice); + VasEBoot_env_export ("cmddevice"); - cmdpath = grub_xasprintf ("(%s)%s", fwdevice, fwpath ? : ""); + cmdpath = VasEBoot_xasprintf ("(%s)%s", fwdevice, fwpath ? : ""); if (cmdpath) { - grub_env_set ("cmdpath", cmdpath); - grub_env_export ("cmdpath"); - grub_free (cmdpath); + VasEBoot_env_set ("cmdpath", cmdpath); + VasEBoot_env_export ("cmdpath"); + VasEBoot_free (cmdpath); } } @@ -148,17 +148,17 @@ grub_set_prefix_and_root (void) char *pptr = NULL; if (prefix[0] == '(') { - pptr = grub_strrchr (prefix, ')'); + pptr = VasEBoot_strrchr (prefix, ')'); if (pptr) { - device = grub_strndup (prefix + 1, pptr - prefix - 1); + device = VasEBoot_strndup (prefix + 1, pptr - prefix - 1); pptr++; } } if (!pptr) pptr = prefix; if (pptr[0]) - path = grub_strdup (pptr); + path = VasEBoot_strdup (pptr); } if (!device && fwdevice) @@ -181,82 +181,82 @@ grub_set_prefix_and_root (void) } if (*comma) { - char *drive = grub_strndup (fwdevice, comma - fwdevice); - new_device = grub_xasprintf ("%s%s", drive, device); - grub_free (drive); + char *drive = VasEBoot_strndup (fwdevice, comma - fwdevice); + new_device = VasEBoot_xasprintf ("%s%s", drive, device); + VasEBoot_free (drive); } else - new_device = grub_xasprintf ("%s%s", fwdevice, device); + new_device = VasEBoot_xasprintf ("%s%s", fwdevice, device); - grub_free (fwdevice); - grub_free (device); + VasEBoot_free (fwdevice); + VasEBoot_free (device); device = new_device; } else - grub_free (fwdevice); + VasEBoot_free (fwdevice); if (fwpath && !path) { - grub_size_t len = grub_strlen (fwpath); + VasEBoot_size_t len = VasEBoot_strlen (fwpath); while (len > 1 && fwpath[len - 1] == '/') fwpath[--len] = 0; - if (len >= sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1 - && grub_memcmp (fwpath + len - (sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1), GRUB_TARGET_CPU "-" GRUB_PLATFORM, - sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1) == 0) - fwpath[len - (sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1)] = 0; + if (len >= sizeof (VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM) - 1 + && VasEBoot_memcmp (fwpath + len - (sizeof (VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM) - 1), VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM, + sizeof (VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM) - 1) == 0) + fwpath[len - (sizeof (VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM) - 1)] = 0; path = fwpath; } else - grub_free (fwpath); + VasEBoot_free (fwpath); if (device) { char *prefix_set; - prefix_set = grub_xasprintf ("(%s)%s", device, path ? : ""); + prefix_set = VasEBoot_xasprintf ("(%s)%s", device, path ? : ""); if (prefix_set) { - grub_env_set ("prefix", prefix_set); - grub_free (prefix_set); + VasEBoot_env_set ("prefix", prefix_set); + VasEBoot_free (prefix_set); } - grub_env_set ("root", device); + VasEBoot_env_set ("root", device); } - grub_free (device); - grub_free (path); - grub_print_error (); + VasEBoot_free (device); + VasEBoot_free (path); + VasEBoot_print_error (); } /* Load the normal mode module and execute the normal mode if possible. */ static void -grub_load_normal_mode (void) +VasEBoot_load_normal_mode (void) { /* Load the module. */ - grub_dl_load ("normal"); + VasEBoot_dl_load ("normal"); /* Print errors if any. */ - grub_print_error (); - grub_errno = 0; + VasEBoot_print_error (); + VasEBoot_errno = 0; - grub_command_execute ("normal", 0, 0); + VasEBoot_command_execute ("normal", 0, 0); } static void reclaim_module_space (void) { - grub_addr_t modstart, modend; + VasEBoot_addr_t modstart, modend; - if (!grub_modbase) + if (!VasEBoot_modbase) return; -#ifdef GRUB_MACHINE_PCBIOS - modstart = GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR; +#ifdef VasEBoot_MACHINE_PCBIOS + modstart = VasEBoot_MEMORY_MACHINE_DECOMPRESSION_ADDR; #else - modstart = grub_modbase; + modstart = VasEBoot_modbase; #endif - modend = grub_modules_get_end (); - grub_modbase = 0; + modend = VasEBoot_modules_get_end (); + VasEBoot_modbase = 0; -#if GRUB_KERNEL_PRELOAD_SPACE_REUSABLE - grub_mm_init_region ((void *) modstart, modend - modstart); +#if VasEBoot_KERNEL_PRELOAD_SPACE_REUSABLE + VasEBoot_mm_init_region ((void *) modstart, modend - modstart); #else (void) modstart; (void) modend; @@ -265,51 +265,51 @@ reclaim_module_space (void) /* The main routine. */ void __attribute__ ((noreturn)) -grub_main (void) +VasEBoot_main (void) { /* First of all, initialize the machine. */ - grub_machine_init (); + VasEBoot_machine_init (); - grub_boot_time ("After machine init."); + VasEBoot_boot_time ("After machine init."); /* Hello. */ - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - grub_printf ("Welcome to GRUB!\n\n"); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); + VasEBoot_printf ("Welcome to VasEBoot!\n\n"); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_STANDARD); - grub_load_config (); + VasEBoot_load_config (); - grub_boot_time ("Before loading embedded modules."); + VasEBoot_boot_time ("Before loading embedded modules."); /* Load pre-loaded modules and free the space. */ - grub_register_exported_symbols (); -#ifdef GRUB_LINKER_HAVE_INIT - grub_arch_dl_init_linker (); + VasEBoot_register_exported_symbols (); +#ifdef VasEBoot_LINKER_HAVE_INIT + VasEBoot_arch_dl_init_linker (); #endif - grub_load_modules (); + VasEBoot_load_modules (); - grub_boot_time ("After loading embedded modules."); + VasEBoot_boot_time ("After loading embedded modules."); /* It is better to set the root device as soon as possible, for convenience. */ - grub_set_prefix_and_root (); - grub_env_export ("root"); - grub_env_export ("prefix"); + VasEBoot_set_prefix_and_root (); + VasEBoot_env_export ("root"); + VasEBoot_env_export ("prefix"); /* Reclaim space used for modules. */ reclaim_module_space (); - grub_boot_time ("After reclaiming module space."); + VasEBoot_boot_time ("After reclaiming module space."); - grub_register_core_commands (); + VasEBoot_register_core_commands (); - grub_boot_time ("Before execution of embedded config."); + VasEBoot_boot_time ("Before execution of embedded config."); if (load_config) - grub_parser_execute (load_config); + VasEBoot_parser_execute (load_config); - grub_boot_time ("After execution of embedded config. Attempt to go to normal mode"); + VasEBoot_boot_time ("After execution of embedded config. Attempt to go to normal mode"); - grub_load_normal_mode (); - grub_rescue_run (); + VasEBoot_load_normal_mode (); + VasEBoot_rescue_run (); } diff --git a/VasEBoot-core/kern/mips/arc/init.c b/VasEBoot-core/kern/mips/arc/init.c index 3834a1490..9afbe54bf 100644 --- a/VasEBoot-core/kern/mips/arc/init.c +++ b/VasEBoot-core/kern/mips/arc/init.c @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const char *type_names[] = { -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN NULL, #endif NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -46,18 +46,18 @@ const char *type_names[] = { "serial", "net", "video", "par", "point", "key", "audio", "other", "rdisk", "fdisk", "tape", "modem", "monitor", "print", "pointer", "keyboard", "term", -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN "other", #endif "line", "network", NULL }; static int -iterate_rec (const char *prefix, const struct grub_arc_component *parent, - grub_arc_iterate_devs_hook_t hook, void *hook_data, +iterate_rec (const char *prefix, const struct VasEBoot_arc_component *parent, + VasEBoot_arc_iterate_devs_hook_t hook, void *hook_data, int alt_names) { - const struct grub_arc_component *comp; + const struct VasEBoot_arc_component *comp; FOR_ARC_CHILDREN(comp, parent) { char *name; @@ -67,76 +67,76 @@ iterate_rec (const char *prefix, const struct grub_arc_component *parent, if (!cname) cname = "unknown"; if (alt_names) - name = grub_xasprintf ("%s/%s%lu", prefix, cname, comp->key); + name = VasEBoot_xasprintf ("%s/%s%lu", prefix, cname, comp->key); else - name = grub_xasprintf ("%s%s(%lu)", prefix, cname, comp->key); + name = VasEBoot_xasprintf ("%s%s(%lu)", prefix, cname, comp->key); if (!name) return 1; if (hook (name, comp, hook_data)) { - grub_free (name); + VasEBoot_free (name); return 1; } if (iterate_rec ((parent ? name : prefix), comp, hook, hook_data, alt_names)) { - grub_free (name); + VasEBoot_free (name); return 1; } - grub_free (name); + VasEBoot_free (name); } return 0; } int -grub_arc_iterate_devs (grub_arc_iterate_devs_hook_t hook, void *hook_data, +VasEBoot_arc_iterate_devs (VasEBoot_arc_iterate_devs_hook_t hook, void *hook_data, int alt_names) { return iterate_rec ((alt_names ? "arc" : ""), NULL, hook, hook_data, alt_names); } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - struct grub_arc_memory_descriptor *cur = NULL; + struct VasEBoot_arc_memory_descriptor *cur = NULL; while (1) { - grub_memory_type_t type; - cur = GRUB_ARC_FIRMWARE_VECTOR->getmemorydescriptor (cur); + VasEBoot_memory_type_t type; + cur = VasEBoot_ARC_FIRMWARE_VECTOR->getmemorydescriptor (cur); if (!cur) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; switch (cur->type) { - case GRUB_ARC_MEMORY_EXCEPTION_BLOCK: - case GRUB_ARC_MEMORY_SYSTEM_PARAMETER_BLOCK: - case GRUB_ARC_MEMORY_FW_PERMANENT: + case VasEBoot_ARC_MEMORY_EXCEPTION_BLOCK: + case VasEBoot_ARC_MEMORY_SYSTEM_PARAMETER_BLOCK: + case VasEBoot_ARC_MEMORY_FW_PERMANENT: default: - type = GRUB_MEMORY_RESERVED; + type = VasEBoot_MEMORY_RESERVED; break; - case GRUB_ARC_MEMORY_FW_TEMPORARY: - case GRUB_ARC_MEMORY_FREE: - case GRUB_ARC_MEMORY_LOADED: - case GRUB_ARC_MEMORY_FREE_CONTIGUOUS: - type = GRUB_MEMORY_AVAILABLE; + case VasEBoot_ARC_MEMORY_FW_TEMPORARY: + case VasEBoot_ARC_MEMORY_FREE: + case VasEBoot_ARC_MEMORY_LOADED: + case VasEBoot_ARC_MEMORY_FREE_CONTIGUOUS: + type = VasEBoot_MEMORY_AVAILABLE; break; - case GRUB_ARC_MEMORY_BADRAM: - type = GRUB_MEMORY_BADRAM; + case VasEBoot_ARC_MEMORY_BADRAM: + type = VasEBoot_MEMORY_BADRAM; break; } - if (hook (((grub_uint64_t) cur->start_page) << 12, - ((grub_uint64_t) cur->num_pages) << 12, type, hook_data)) - return GRUB_ERR_NONE; + if (hook (((VasEBoot_uint64_t) cur->start_page) << 12, + ((VasEBoot_uint64_t) cur->num_pages) << 12, type, hook_data)) + return VasEBoot_ERR_NONE; } } char * -grub_arc_alt_name_to_norm (const char *name, const char *suffix) +VasEBoot_arc_alt_name_to_norm (const char *name, const char *suffix) { char *optr; const char *iptr; - char * ret = grub_malloc (2 * grub_strlen (name) + grub_strlen (suffix)); + char * ret = VasEBoot_malloc (2 * VasEBoot_strlen (name) + VasEBoot_strlen (suffix)); int state = 0; if (!ret) @@ -145,7 +145,7 @@ grub_arc_alt_name_to_norm (const char *name, const char *suffix) for (iptr = name + 4; *iptr; iptr++) if (state == 0) { - if (!grub_isdigit (*iptr)) + if (!VasEBoot_isdigit (*iptr)) *optr++ = *iptr; else { @@ -156,7 +156,7 @@ grub_arc_alt_name_to_norm (const char *name, const char *suffix) } else { - if (grub_isdigit (*iptr)) + if (VasEBoot_isdigit (*iptr)) *optr++ = *iptr; else { @@ -166,7 +166,7 @@ grub_arc_alt_name_to_norm (const char *name, const char *suffix) } if (state) *optr++ = ')'; - grub_strcpy (optr, suffix); + VasEBoot_strcpy (optr, suffix); return ret; } @@ -176,11 +176,11 @@ norm_name_to_alt (const char *name) char *optr; const char *iptr; int state = 0; - char * ret = grub_malloc (grub_strlen (name) + sizeof ("arc/")); + char * ret = VasEBoot_malloc (VasEBoot_strlen (name) + sizeof ("arc/")); if (!ret) return NULL; - optr = grub_stpcpy (ret, "arc/"); + optr = VasEBoot_stpcpy (ret, "arc/"); for (iptr = name; *iptr; iptr++) { if (state == 3) @@ -208,82 +208,82 @@ norm_name_to_alt (const char *name) return ret; } -extern grub_uint32_t grub_total_modules_size __attribute__ ((section(".text"))); -grub_addr_t grub_modbase; +extern VasEBoot_uint32_t VasEBoot_total_modules_size __attribute__ ((section(".text"))); +VasEBoot_addr_t VasEBoot_modbase; extern char _end[]; static char boot_location[256]; void -grub_machine_init (void) +VasEBoot_machine_init (void) { - struct grub_arc_memory_descriptor *cur = NULL; - grub_addr_t modend; + struct VasEBoot_arc_memory_descriptor *cur = NULL; + VasEBoot_addr_t modend; - grub_memcpy (boot_location, - (char *) (GRUB_DECOMPRESSOR_LINK_ADDR - 256), 256); + VasEBoot_memcpy (boot_location, + (char *) (VasEBoot_DECOMPRESSOR_LINK_ADDR - 256), 256); - grub_modbase = ALIGN_UP ((grub_addr_t) _end, GRUB_KERNEL_MACHINE_MOD_ALIGN); - modend = grub_modbase + grub_total_modules_size; - grub_console_init_early (); + VasEBoot_modbase = ALIGN_UP ((VasEBoot_addr_t) _end, VasEBoot_KERNEL_MACHINE_MOD_ALIGN); + modend = VasEBoot_modbase + VasEBoot_total_modules_size; + VasEBoot_console_init_early (); /* FIXME: measure this. */ - grub_arch_cpuclock = 150000000; - grub_install_get_time_ms (grub_rtc_get_time_ms); + VasEBoot_arch_cpuclock = 150000000; + VasEBoot_install_get_time_ms (VasEBoot_rtc_get_time_ms); while (1) { - grub_uint64_t start, end; - cur = GRUB_ARC_FIRMWARE_VECTOR->getmemorydescriptor (cur); + VasEBoot_uint64_t start, end; + cur = VasEBoot_ARC_FIRMWARE_VECTOR->getmemorydescriptor (cur); if (!cur) break; - if (cur->type != GRUB_ARC_MEMORY_FREE - && cur->type != GRUB_ARC_MEMORY_LOADED - && cur->type != GRUB_ARC_MEMORY_FREE_CONTIGUOUS) + if (cur->type != VasEBoot_ARC_MEMORY_FREE + && cur->type != VasEBoot_ARC_MEMORY_LOADED + && cur->type != VasEBoot_ARC_MEMORY_FREE_CONTIGUOUS) continue; - start = ((grub_uint64_t) cur->start_page) << 12; - end = ((grub_uint64_t) cur->num_pages) << 12; + start = ((VasEBoot_uint64_t) cur->start_page) << 12; + end = ((VasEBoot_uint64_t) cur->num_pages) << 12; end += start; - if ((grub_uint64_t) start < (modend & 0x1fffffff)) + if ((VasEBoot_uint64_t) start < (modend & 0x1fffffff)) start = (modend & 0x1fffffff); - if ((grub_uint64_t) end > 0x20000000) + if ((VasEBoot_uint64_t) end > 0x20000000) end = 0x20000000; if (end > start) - grub_mm_init_region ((void *) (grub_addr_t) (start | 0x80000000), + VasEBoot_mm_init_region ((void *) (VasEBoot_addr_t) (start | 0x80000000), end - start); } - grub_console_init_lately (); + VasEBoot_console_init_lately (); - grub_arcdisk_init (); + VasEBoot_arcdisk_init (); } void -grub_machine_fini (int flags __attribute__ ((unused))) +VasEBoot_machine_fini (int flags __attribute__ ((unused))) { } void -grub_halt (void) +VasEBoot_halt (void) { - GRUB_ARC_FIRMWARE_VECTOR->powerdown (); + VasEBoot_ARC_FIRMWARE_VECTOR->powerdown (); - grub_millisleep (1500); + VasEBoot_millisleep (1500); - grub_puts_ (N_("Shutdown failed")); - grub_refresh (); + VasEBoot_puts_ (N_("Shutdown failed")); + VasEBoot_refresh (); while (1); } void -grub_exit (void) +VasEBoot_exit (void) { - GRUB_ARC_FIRMWARE_VECTOR->exit (); + VasEBoot_ARC_FIRMWARE_VECTOR->exit (); - grub_millisleep (1500); + VasEBoot_millisleep (1500); - grub_puts_ (N_("Exit failed")); - grub_refresh (); + VasEBoot_puts_ (N_("Exit failed")); + VasEBoot_refresh (); while (1); } @@ -293,11 +293,11 @@ get_part (char *dev) char *ptr; if (!*dev) return 0; - ptr = dev + grub_strlen (dev) - 1; + ptr = dev + VasEBoot_strlen (dev) - 1; if (ptr == dev || *ptr != ')') return 0; ptr--; - while (grub_isdigit (*ptr) && ptr > dev) + while (VasEBoot_isdigit (*ptr) && ptr > dev) ptr--; if (*ptr != '(' || ptr == dev) return 0; @@ -305,49 +305,49 @@ get_part (char *dev) if (ptr - dev < (int) sizeof ("partition") - 2) return 0; ptr -= sizeof ("partition") - 2; - if (grub_memcmp (ptr, "partition", sizeof ("partition") - 1) != 0) + if (VasEBoot_memcmp (ptr, "partition", sizeof ("partition") - 1) != 0) return 0; return ptr; } -static grub_disk_addr_t -get_partition_offset (char *part, grub_disk_addr_t *en) +static VasEBoot_disk_addr_t +get_partition_offset (char *part, VasEBoot_disk_addr_t *en) { - grub_arc_fileno_t handle; - grub_disk_addr_t ret = -1; - struct grub_arc_fileinfo info; - grub_arc_err_t r; + VasEBoot_arc_fileno_t handle; + VasEBoot_disk_addr_t ret = -1; + struct VasEBoot_arc_fileinfo info; + VasEBoot_arc_err_t r; - if (GRUB_ARC_FIRMWARE_VECTOR->open (part, GRUB_ARC_FILE_ACCESS_OPEN_RO, + if (VasEBoot_ARC_FIRMWARE_VECTOR->open (part, VasEBoot_ARC_FILE_ACCESS_OPEN_RO, &handle)) return -1; - r = GRUB_ARC_FIRMWARE_VECTOR->getfileinformation (handle, &info); + r = VasEBoot_ARC_FIRMWARE_VECTOR->getfileinformation (handle, &info); if (!r) { ret = (info.start >> 9); *en = (info.end >> 9); } - GRUB_ARC_FIRMWARE_VECTOR->close (handle); + VasEBoot_ARC_FIRMWARE_VECTOR->close (handle); return ret; } struct get_device_name_ctx { char *partition_name; - grub_disk_addr_t poff, pend; + VasEBoot_disk_addr_t poff, pend; }; static int -get_device_name_iter (grub_disk_t disk __attribute__ ((unused)), - const grub_partition_t part, void *data) +get_device_name_iter (VasEBoot_disk_t disk __attribute__ ((unused)), + const VasEBoot_partition_t part, void *data) { struct get_device_name_ctx *ctx = data; - if (grub_partition_get_start (part) == ctx->poff - && grub_partition_get_len (part) == ctx->pend) + if (VasEBoot_partition_get_start (part) == ctx->poff + && VasEBoot_partition_get_len (part) == ctx->pend) { - ctx->partition_name = grub_partition_get_name (part); + ctx->partition_name = VasEBoot_partition_get_name (part); return 1; } @@ -355,20 +355,20 @@ get_device_name_iter (grub_disk_t disk __attribute__ ((unused)), } void -grub_machine_get_bootlocation (char **device, char **path) +VasEBoot_machine_get_bootlocation (char **device, char **path) { char *loaddev = boot_location; char *pptr, *partptr; char *dname; - grub_disk_addr_t poff = -1, pend = -1; + VasEBoot_disk_addr_t poff = -1, pend = -1; struct get_device_name_ctx ctx; - grub_disk_t parent = 0; + VasEBoot_disk_t parent = 0; unsigned i; for (i = 0; i < ARRAY_SIZE (type_names); i++) if (type_names[i] - && grub_memcmp (loaddev, type_names[i], grub_strlen (type_names[i])) == 0 - && loaddev[grub_strlen (type_names[i])] == '(') + && VasEBoot_memcmp (loaddev, type_names[i], VasEBoot_strlen (type_names[i])) == 0 + && loaddev[VasEBoot_strlen (type_names[i])] == '(') break; if (i == ARRAY_SIZE (type_names)) pptr = loaddev; @@ -378,7 +378,7 @@ grub_machine_get_bootlocation (char **device, char **path) { char *iptr, *optr; char sep = *pptr; - *path = grub_malloc (grub_strlen (pptr) + 1); + *path = VasEBoot_malloc (VasEBoot_strlen (pptr) + 1); if (!*path) return; for (iptr = pptr, optr = *path; *iptr; iptr++, optr++) @@ -387,7 +387,7 @@ grub_machine_get_bootlocation (char **device, char **path) else *optr = *iptr; *optr = '\0'; - *path = grub_strdup (pptr); + *path = VasEBoot_strdup (pptr); *pptr = '\0'; } @@ -395,14 +395,14 @@ grub_machine_get_bootlocation (char **device, char **path) { const char *syspart = 0; - if (GRUB_ARC_SYSTEM_PARAMETER_BLOCK->firmware_vector_length - >= (unsigned) ((char *) (&GRUB_ARC_FIRMWARE_VECTOR->getenvironmentvariable + 1) - - (char *) GRUB_ARC_FIRMWARE_VECTOR) - && GRUB_ARC_FIRMWARE_VECTOR->getenvironmentvariable) - syspart = GRUB_ARC_FIRMWARE_VECTOR->getenvironmentvariable ("SystemPartition"); + if (VasEBoot_ARC_SYSTEM_PARAMETER_BLOCK->firmware_vector_length + >= (unsigned) ((char *) (&VasEBoot_ARC_FIRMWARE_VECTOR->getenvironmentvariable + 1) + - (char *) VasEBoot_ARC_FIRMWARE_VECTOR) + && VasEBoot_ARC_FIRMWARE_VECTOR->getenvironmentvariable) + syspart = VasEBoot_ARC_FIRMWARE_VECTOR->getenvironmentvariable ("SystemPartition"); if (!syspart) return; - loaddev = grub_strdup (syspart); + loaddev = VasEBoot_strdup (syspart); } partptr = get_part (loaddev); @@ -412,30 +412,30 @@ grub_machine_get_bootlocation (char **device, char **path) *partptr = '\0'; } dname = norm_name_to_alt (loaddev); - if (poff == (grub_addr_t) -1) + if (poff == (VasEBoot_addr_t) -1) { *device = dname; if (loaddev != boot_location) - grub_free (loaddev); + VasEBoot_free (loaddev); return; } - parent = grub_disk_open (dname); + parent = VasEBoot_disk_open (dname); if (!parent) { *device = dname; if (loaddev != boot_location) - grub_free (loaddev); + VasEBoot_free (loaddev); return; } if (poff == 0 - && pend == grub_disk_get_size (parent)) + && pend == VasEBoot_disk_get_size (parent)) { - grub_disk_close (parent); + VasEBoot_disk_close (parent); *device = dname; if (loaddev != boot_location) - grub_free (loaddev); + VasEBoot_free (loaddev); return; } @@ -443,21 +443,21 @@ grub_machine_get_bootlocation (char **device, char **path) ctx.poff = poff; ctx.pend = pend; - grub_partition_iterate (parent, get_device_name_iter, &ctx); - grub_disk_close (parent); + VasEBoot_partition_iterate (parent, get_device_name_iter, &ctx); + VasEBoot_disk_close (parent); if (! ctx.partition_name) { *device = dname; if (loaddev != boot_location) - grub_free (loaddev); + VasEBoot_free (loaddev); return; } - *device = grub_xasprintf ("%s,%s", dname, + *device = VasEBoot_xasprintf ("%s,%s", dname, ctx.partition_name); - grub_free (ctx.partition_name); - grub_free (dname); + VasEBoot_free (ctx.partition_name); + VasEBoot_free (dname); if (loaddev != boot_location) - grub_free (loaddev); + VasEBoot_free (loaddev); } diff --git a/VasEBoot-core/kern/mips/cache.S b/VasEBoot-core/kern/mips/cache.S index fa6897e14..d22c852c1 100644 --- a/VasEBoot-core/kern/mips/cache.S +++ b/VasEBoot-core/kern/mips/cache.S @@ -1,14 +1,14 @@ -#include +#include .set noreorder .set nomacro -FUNCTION (grub_arch_sync_caches) +FUNCTION (VasEBoot_arch_sync_caches) #include "cache_flush.S" j $ra -FUNCTION (grub_arch_sync_dma_caches) +FUNCTION (VasEBoot_arch_sync_dma_caches) move $t2, $a0 addu $t3, $a0, $a1 srl $t2, $t2, 5 @@ -20,7 +20,7 @@ FUNCTION (grub_arch_sync_dma_caches) subu $t1, $t3, $t2 1: cache_op 1, 0($t0) -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON cache_op 1, 1($t0) cache_op 1, 2($t0) cache_op 1, 3($t0) @@ -37,7 +37,7 @@ FUNCTION (grub_arch_sync_dma_caches) move $t0, $t2 subu $t1, $t3, $t2 2: -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON cache_op 0, 0($t0) addiu $t1, $t1, -0x20 bne $t1, $zero, 2b @@ -52,7 +52,7 @@ FUNCTION (grub_arch_sync_dma_caches) move $t0, $t2 subu $t1, $t3, $t2 2: -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON cache_op 23, 0($t0) addiu $t1, $t1, -0x20 bne $t1, $zero, 2b diff --git a/VasEBoot-core/kern/mips/cache_flush.S b/VasEBoot-core/kern/mips/cache_flush.S index 89961a0f7..57009248e 100644 --- a/VasEBoot-core/kern/mips/cache_flush.S +++ b/VasEBoot-core/kern/mips/cache_flush.S @@ -24,7 +24,7 @@ 1: cache_op 1, 0($t0) /* All four ways. */ -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON cache_op 1, 1($t0) cache_op 1, 2($t0) cache_op 1, 3($t0) @@ -42,7 +42,7 @@ subu $t1, $t3, $t2 2: cache_op 0, 0($t0) -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON addiu $t1, $t1, -0x20 bne $t1, $zero, 2b addiu $t0, $t0, 0x20 diff --git a/VasEBoot-core/kern/mips/dl.c b/VasEBoot-core/kern/mips/dl.c index 5d7d299c7..801599a04 100644 --- a/VasEBoot-core/kern/mips/dl.c +++ b/VasEBoot-core/kern/mips/dl.c @@ -1,42 +1,42 @@ /* dl-386.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* Dummy __gnu_local_gp. Resolved by linker. */ static char __gnu_local_gp_dummy; static char _gp_disp_dummy; /* Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; /* Check the magic numbers. */ -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN if (e->e_ident[EI_CLASS] != ELFCLASS32 || e->e_ident[EI_DATA] != ELFDATA2MSB || e->e_machine != EM_MIPS) @@ -45,21 +45,21 @@ grub_arch_dl_check_header (void *ehdr) || e->e_ident[EI_DATA] != ELFDATA2LSB || e->e_machine != EM_MIPS) #endif - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #pragma GCC diagnostic ignored "-Wcast-align" -grub_err_t -grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got) +VasEBoot_err_t +VasEBoot_arch_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got) { const Elf_Ehdr *e = ehdr; const Elf_Shdr *s; /* FIXME: suboptimal. */ - grub_size_t gp_size = 0; + VasEBoot_size_t gp_size = 0; unsigned i; *tramp = 0; @@ -87,19 +87,19 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, } if (gp_size > 0x08000) - return grub_error (GRUB_ERR_OUT_OF_RANGE, "__gnu_local_gp is too big\n"); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "__gnu_local_gp is too big\n"); *got = gp_size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Relocate symbols. */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { - grub_uint32_t gp0; + VasEBoot_uint32_t gp0; Elf_Ehdr *e = ehdr; if (!mod->reginfo) @@ -114,8 +114,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, if (ri->sh_type == SHT_MIPS_REGINFO) break; if (i == e->e_shnum) - return grub_error (GRUB_ERR_BAD_MODULE, "no reginfo found"); - mod->reginfo = (grub_uint32_t *)((char *) ehdr + ri->sh_offset); + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "no reginfo found"); + mod->reginfo = (VasEBoot_uint32_t *)((char *) ehdr + ri->sh_offset); } gp0 = mod->reginfo[5]; @@ -126,15 +126,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, rel < max; rel = (Elf_Rel *) ((char *) rel + s->sh_entsize)) { - grub_uint8_t *addr; + VasEBoot_uint8_t *addr; Elf_Sym *sym; - grub_uint32_t sym_value; + VasEBoot_uint32_t sym_value; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); - addr = (grub_uint8_t *) ((char *) seg->addr + rel->r_offset); + addr = (VasEBoot_uint8_t *) ((char *) seg->addr + rel->r_offset); sym = (Elf_Sym *) ((char *) mod->symtab + mod->symsize * ELF_R_SYM (rel->r_info)); sym_value = sym->st_value; @@ -142,11 +142,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { sym_value += ((Elf_Rela *) rel)->r_addend; } - if (sym_value == (grub_addr_t) &__gnu_local_gp_dummy) - sym_value = (grub_addr_t) mod->got; - else if (sym_value == (grub_addr_t) &_gp_disp_dummy) + if (sym_value == (VasEBoot_addr_t) &__gnu_local_gp_dummy) + sym_value = (VasEBoot_addr_t) mod->got; + else if (sym_value == (VasEBoot_addr_t) &_gp_disp_dummy) { - sym_value = (grub_addr_t) mod->got - (grub_addr_t) addr; + sym_value = (VasEBoot_addr_t) mod->got - (VasEBoot_addr_t) addr; if (ELF_R_TYPE (rel->r_info) == R_MIPS_LO16) /* ABI mandates +4 even if partner lui doesn't immediately precede addiu. */ @@ -156,59 +156,59 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { case R_MIPS_HI16: { - grub_uint32_t value; + VasEBoot_uint32_t value; Elf_Rel *rel2; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN addr += 2; #endif /* Handle partner lo16 relocation. Lower part is treated as signed. Hence add 0x8000 to compensate. */ - value = (*(grub_uint16_t *) addr << 16) + value = (*(VasEBoot_uint16_t *) addr << 16) + sym_value + 0x8000; for (rel2 = rel + 1; rel2 < max; rel2++) if (ELF_R_SYM (rel2->r_info) == ELF_R_SYM (rel->r_info) && ELF_R_TYPE (rel2->r_info) == R_MIPS_LO16) { - value += *(grub_int16_t *) + value += *(VasEBoot_int16_t *) ((char *) seg->addr + rel2->r_offset -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + 2 #endif ); break; } - *(grub_uint16_t *) addr = (value >> 16) & 0xffff; + *(VasEBoot_uint16_t *) addr = (value >> 16) & 0xffff; } break; case R_MIPS_LO16: -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN addr += 2; #endif - *(grub_uint16_t *) addr += sym_value & 0xffff; + *(VasEBoot_uint16_t *) addr += sym_value & 0xffff; break; case R_MIPS_32: - *(grub_uint32_t *) addr += sym_value; + *(VasEBoot_uint32_t *) addr += sym_value; break; case R_MIPS_GPREL32: - *(grub_uint32_t *) addr = sym_value - + *(grub_uint32_t *) addr + gp0 - (grub_uint32_t)mod->got; + *(VasEBoot_uint32_t *) addr = sym_value + + *(VasEBoot_uint32_t *) addr + gp0 - (VasEBoot_uint32_t)mod->got; break; case R_MIPS_26: { - grub_uint32_t value; - grub_uint32_t raw; - raw = (*(grub_uint32_t *) addr) & 0x3ffffff; + VasEBoot_uint32_t value; + VasEBoot_uint32_t raw; + raw = (*(VasEBoot_uint32_t *) addr) & 0x3ffffff; value = raw << 2; value += sym_value; raw = (value >> 2) & 0x3ffffff; - *(grub_uint32_t *) addr = - raw | ((*(grub_uint32_t *) addr) & 0xfc000000); + *(VasEBoot_uint32_t *) addr = + raw | ((*(VasEBoot_uint32_t *) addr) & 0xfc000000); } break; case R_MIPS_GOT16: @@ -218,35 +218,35 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, /* Handle partner lo16 relocation. Lower part is treated as signed. Hence add 0x8000 to compensate. */ - sym_value += (*(grub_uint16_t *) addr << 16) + sym_value += (*(VasEBoot_uint16_t *) addr << 16) + 0x8000; for (rel2 = rel + 1; rel2 < max; rel2++) if (ELF_R_SYM (rel2->r_info) == ELF_R_SYM (rel->r_info) && ELF_R_TYPE (rel2->r_info) == R_MIPS_LO16) { - sym_value += *(grub_int16_t *) + sym_value += *(VasEBoot_int16_t *) ((char *) seg->addr + rel2->r_offset -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + 2 #endif ); break; } sym_value &= 0xffff0000; - *(grub_uint16_t *) addr = 0; + *(VasEBoot_uint16_t *) addr = 0; } /* Fallthrough. */ case R_MIPS_CALL16: { - grub_uint32_t *gpptr = mod->gotptr; + VasEBoot_uint32_t *gpptr = mod->gotptr; /* FIXME: reuse*/ -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN addr += 2; #endif - *gpptr = sym_value + *(grub_uint16_t *) addr; - *(grub_uint16_t *) addr - = sizeof (grub_uint32_t) * (gpptr - (grub_uint32_t *) mod->got); + *gpptr = sym_value + *(VasEBoot_uint16_t *) addr; + *(VasEBoot_uint16_t *) addr + = sizeof (VasEBoot_uint32_t) * (gpptr - (VasEBoot_uint32_t *) mod->got); mod->gotptr = gpptr + 1; break; } @@ -254,7 +254,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, break; default: { - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } @@ -262,13 +262,13 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_arch_dl_init_linker (void) +VasEBoot_arch_dl_init_linker (void) { - grub_dl_register_symbol ("__gnu_local_gp", &__gnu_local_gp_dummy, 0, 0); - grub_dl_register_symbol ("_gp_disp", &_gp_disp_dummy, 0, 0); + VasEBoot_dl_register_symbol ("__gnu_local_gp", &__gnu_local_gp_dummy, 0, 0); + VasEBoot_dl_register_symbol ("_gp_disp", &_gp_disp_dummy, 0, 0); } diff --git a/VasEBoot-core/kern/mips/init.c b/VasEBoot-core/kern/mips/init.c index 14b8752ec..4e98379a8 100644 --- a/VasEBoot-core/kern/mips/init.c +++ b/VasEBoot-core/kern/mips/init.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* FIXME: use interrupt to count high. */ -grub_uint64_t -grub_get_rtc (void) +VasEBoot_uint64_t +VasEBoot_get_rtc (void) { - static grub_uint32_t high = 0; - static grub_uint32_t last = 0; - grub_uint32_t low; + static VasEBoot_uint32_t high = 0; + static VasEBoot_uint32_t last = 0; + VasEBoot_uint32_t low; - asm volatile ("mfc0 %0, " GRUB_CPU_MIPS_COP0_TIMER_COUNT : "=r" (low)); + asm volatile ("mfc0 %0, " VasEBoot_CPU_MIPS_COP0_TIMER_COUNT : "=r" (low)); if (low < last) high++; last = low; - return (((grub_uint64_t) high) << 32) | low; + return (((VasEBoot_uint64_t) high) << 32) | low; } diff --git a/VasEBoot-core/kern/mips/loongson/init.c b/VasEBoot-core/kern/mips/loongson/init.c index 7b96531b9..1fdba45f2 100644 --- a/VasEBoot-core/kern/mips/loongson/init.c +++ b/VasEBoot-core/kern/mips/loongson/init.c @@ -1,88 +1,88 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - hook (GRUB_ARCH_LOWMEMPSTART, grub_arch_memsize << 20, - GRUB_MEMORY_AVAILABLE, hook_data); - hook (GRUB_ARCH_HIGHMEMPSTART, grub_arch_highmemsize << 20, - GRUB_MEMORY_AVAILABLE, hook_data); - return GRUB_ERR_NONE; + hook (VasEBoot_ARCH_LOWMEMPSTART, VasEBoot_arch_memsize << 20, + VasEBoot_MEMORY_AVAILABLE, hook_data); + hook (VasEBoot_ARCH_HIGHMEMPSTART, VasEBoot_arch_highmemsize << 20, + VasEBoot_MEMORY_AVAILABLE, hook_data); + return VasEBoot_ERR_NONE; } /* Helper for init_pci. */ static int -set_card (grub_pci_device_t dev, grub_pci_id_t pciid, +set_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_pci_address_t addr; - /* We could use grub_pci_assign_addresses for this but we prefer to + VasEBoot_pci_address_t addr; + /* We could use VasEBoot_pci_assign_addresses for this but we prefer to have exactly same memory map as on pmon. */ switch (pciid) { - case GRUB_LOONGSON_OHCI_PCIID: - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - grub_pci_write (addr, 0x5025000); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word (addr, GRUB_PCI_COMMAND_SERR_ENABLE - | GRUB_PCI_COMMAND_PARITY_ERROR - | GRUB_PCI_COMMAND_BUS_MASTER - | GRUB_PCI_COMMAND_MEM_ENABLED); + case VasEBoot_LOONGSON_OHCI_PCIID: + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + VasEBoot_pci_write (addr, 0x5025000); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word (addr, VasEBoot_PCI_COMMAND_SERR_ENABLE + | VasEBoot_PCI_COMMAND_PARITY_ERROR + | VasEBoot_PCI_COMMAND_BUS_MASTER + | VasEBoot_PCI_COMMAND_MEM_ENABLED); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_STATUS); - grub_pci_write_word (addr, 0x0200 | GRUB_PCI_STATUS_CAPABILITIES); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_STATUS); + VasEBoot_pci_write_word (addr, 0x0200 | VasEBoot_PCI_STATUS_CAPABILITIES); break; - case GRUB_LOONGSON_EHCI_PCIID: - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - grub_pci_write (addr, 0x5026000); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word (addr, GRUB_PCI_COMMAND_SERR_ENABLE - | GRUB_PCI_COMMAND_PARITY_ERROR - | GRUB_PCI_COMMAND_BUS_MASTER - | GRUB_PCI_COMMAND_MEM_ENABLED); + case VasEBoot_LOONGSON_EHCI_PCIID: + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + VasEBoot_pci_write (addr, 0x5026000); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word (addr, VasEBoot_PCI_COMMAND_SERR_ENABLE + | VasEBoot_PCI_COMMAND_PARITY_ERROR + | VasEBoot_PCI_COMMAND_BUS_MASTER + | VasEBoot_PCI_COMMAND_MEM_ENABLED); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_STATUS); - grub_pci_write_word (addr, (1 << GRUB_PCI_STATUS_DEVSEL_TIMING_SHIFT) - | GRUB_PCI_STATUS_CAPABILITIES); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_STATUS); + VasEBoot_pci_write_word (addr, (1 << VasEBoot_PCI_STATUS_DEVSEL_TIMING_SHIFT) + | VasEBoot_PCI_STATUS_CAPABILITIES); break; } return 0; @@ -91,89 +91,89 @@ set_card (grub_pci_device_t dev, grub_pci_id_t pciid, static void init_pci (void) { - *((volatile grub_uint32_t *) GRUB_CPU_LOONGSON_PCI_HIT1_SEL_LO) = 0x8000000c; - *((volatile grub_uint32_t *) GRUB_CPU_LOONGSON_PCI_HIT1_SEL_HI) = 0xffffffff; + *((volatile VasEBoot_uint32_t *) VasEBoot_CPU_LOONGSON_PCI_HIT1_SEL_LO) = 0x8000000c; + *((volatile VasEBoot_uint32_t *) VasEBoot_CPU_LOONGSON_PCI_HIT1_SEL_HI) = 0xffffffff; /* Setup PCI controller. */ - *((volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONTROLLER_HEADER - + GRUB_PCI_REG_COMMAND)) - = GRUB_PCI_COMMAND_PARITY_ERROR | GRUB_PCI_COMMAND_BUS_MASTER - | GRUB_PCI_COMMAND_MEM_ENABLED; - *((volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONTROLLER_HEADER - + GRUB_PCI_REG_STATUS)) - = (1 << GRUB_PCI_STATUS_DEVSEL_TIMING_SHIFT) - | GRUB_PCI_STATUS_FAST_B2B_CAPABLE | GRUB_PCI_STATUS_66MHZ_CAPABLE - | GRUB_PCI_STATUS_CAPABILITIES; + *((volatile VasEBoot_uint16_t *) (VasEBoot_MACHINE_PCI_CONTROLLER_HEADER + + VasEBoot_PCI_REG_COMMAND)) + = VasEBoot_PCI_COMMAND_PARITY_ERROR | VasEBoot_PCI_COMMAND_BUS_MASTER + | VasEBoot_PCI_COMMAND_MEM_ENABLED; + *((volatile VasEBoot_uint16_t *) (VasEBoot_MACHINE_PCI_CONTROLLER_HEADER + + VasEBoot_PCI_REG_STATUS)) + = (1 << VasEBoot_PCI_STATUS_DEVSEL_TIMING_SHIFT) + | VasEBoot_PCI_STATUS_FAST_B2B_CAPABLE | VasEBoot_PCI_STATUS_66MHZ_CAPABLE + | VasEBoot_PCI_STATUS_CAPABILITIES; - *((volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONTROLLER_HEADER - + GRUB_PCI_REG_CACHELINE)) = 0xff; - *((volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONTROLLER_HEADER - + GRUB_PCI_REG_ADDRESS_REG0)) - = 0x80000000 | GRUB_PCI_ADDR_MEM_TYPE_64 | GRUB_PCI_ADDR_MEM_PREFETCH; - *((volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONTROLLER_HEADER - + GRUB_PCI_REG_ADDRESS_REG1)) = 0; + *((volatile VasEBoot_uint32_t *) (VasEBoot_MACHINE_PCI_CONTROLLER_HEADER + + VasEBoot_PCI_REG_CACHELINE)) = 0xff; + *((volatile VasEBoot_uint32_t *) (VasEBoot_MACHINE_PCI_CONTROLLER_HEADER + + VasEBoot_PCI_REG_ADDRESS_REG0)) + = 0x80000000 | VasEBoot_PCI_ADDR_MEM_TYPE_64 | VasEBoot_PCI_ADDR_MEM_PREFETCH; + *((volatile VasEBoot_uint32_t *) (VasEBoot_MACHINE_PCI_CONTROLLER_HEADER + + VasEBoot_PCI_REG_ADDRESS_REG1)) = 0; - grub_pci_iterate (set_card, NULL); + VasEBoot_pci_iterate (set_card, NULL); } void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_addr_t modend; - grub_uint32_t prid; + VasEBoot_addr_t modend; + VasEBoot_uint32_t prid; - asm volatile ("mfc0 %0, " GRUB_CPU_LOONGSON_COP0_PRID : "=r" (prid)); + asm volatile ("mfc0 %0, " VasEBoot_CPU_LOONGSON_COP0_PRID : "=r" (prid)); switch (prid) { /* Loongson 2E. */ case 0x6302: - grub_arch_machine = GRUB_ARCH_MACHINE_FULOONG2E; - grub_bonito_type = GRUB_BONITO_2F; + VasEBoot_arch_machine = VasEBoot_ARCH_MACHINE_FULOONG2E; + VasEBoot_bonito_type = VasEBoot_BONITO_2F; break; /* Loongson 2F. */ case 0x6303: - if (grub_arch_machine != GRUB_ARCH_MACHINE_FULOONG2F - && grub_arch_machine != GRUB_ARCH_MACHINE_YEELOONG) - grub_arch_machine = GRUB_ARCH_MACHINE_YEELOONG; - grub_bonito_type = GRUB_BONITO_2F; + if (VasEBoot_arch_machine != VasEBoot_ARCH_MACHINE_FULOONG2F + && VasEBoot_arch_machine != VasEBoot_ARCH_MACHINE_YEELOONG) + VasEBoot_arch_machine = VasEBoot_ARCH_MACHINE_YEELOONG; + VasEBoot_bonito_type = VasEBoot_BONITO_2F; break; /* Loongson 3A. */ case 0x6305: - grub_arch_machine = GRUB_ARCH_MACHINE_YEELOONG_3A; - grub_bonito_type = GRUB_BONITO_3A; + VasEBoot_arch_machine = VasEBoot_ARCH_MACHINE_YEELOONG_3A; + VasEBoot_bonito_type = VasEBoot_BONITO_3A; break; } /* FIXME: measure this. */ - if (grub_arch_busclock == 0) + if (VasEBoot_arch_busclock == 0) { - grub_arch_busclock = 66000000; - grub_arch_cpuclock = 797000000; + VasEBoot_arch_busclock = 66000000; + VasEBoot_arch_cpuclock = 797000000; } - grub_install_get_time_ms (grub_rtc_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_rtc_get_time_ms); - if (grub_arch_memsize == 0) + if (VasEBoot_arch_memsize == 0) { - grub_port_t smbbase; - grub_err_t err; - grub_pci_device_t dev; - struct grub_smbus_spd spd; + VasEBoot_port_t smbbase; + VasEBoot_err_t err; + VasEBoot_pci_device_t dev; + struct VasEBoot_smbus_spd spd; unsigned totalmem; int i; - if (!grub_cs5536_find (&dev)) - grub_fatal ("No CS5536 found\n"); + if (!VasEBoot_cs5536_find (&dev)) + VasEBoot_fatal ("No CS5536 found\n"); - err = grub_cs5536_init_smbus (dev, 0x7ff, &smbbase); + err = VasEBoot_cs5536_init_smbus (dev, 0x7ff, &smbbase); if (err) - grub_fatal ("Couldn't init SMBus: %s\n", grub_errmsg); + VasEBoot_fatal ("Couldn't init SMBus: %s\n", VasEBoot_errmsg); /* Yeeloong and Fuloong have only one memory slot. */ - err = grub_cs5536_read_spd (smbbase, GRUB_SMB_RAM_START_ADDR, &spd); + err = VasEBoot_cs5536_read_spd (smbbase, VasEBoot_SMB_RAM_START_ADDR, &spd); if (err) - grub_fatal ("Couldn't read SPD: %s\n", grub_errmsg); + VasEBoot_fatal ("Couldn't read SPD: %s\n", VasEBoot_errmsg); for (i = 5; i < 13; i++) if (spd.ddr2.rank_capacity & (1 << (i & 7))) break; @@ -182,139 +182,139 @@ grub_machine_init (void) totalmem = 256; else totalmem = ((spd.ddr2.num_of_ranks - & GRUB_SMBUS_SPD_MEMORY_NUM_OF_RANKS_MASK) + 1) << (i + 2); + & VasEBoot_SMBUS_SPD_MEMORY_NUM_OF_RANKS_MASK) + 1) << (i + 2); if (totalmem >= 256) { - grub_arch_memsize = 256; - grub_arch_highmemsize = totalmem - 256; + VasEBoot_arch_memsize = 256; + VasEBoot_arch_highmemsize = totalmem - 256; } else { - grub_arch_memsize = totalmem; - grub_arch_highmemsize = 0; + VasEBoot_arch_memsize = totalmem; + VasEBoot_arch_highmemsize = 0; } - grub_cs5536_init_geode (dev); + VasEBoot_cs5536_init_geode (dev); init_pci (); } - modend = grub_modules_get_end (); - grub_mm_init_region ((void *) modend, (grub_arch_memsize << 20) - - (modend - GRUB_ARCH_LOWMEMVSTART)); + modend = VasEBoot_modules_get_end (); + VasEBoot_mm_init_region ((void *) modend, (VasEBoot_arch_memsize << 20) + - (modend - VasEBoot_ARCH_LOWMEMVSTART)); /* FIXME: use upper memory as well. */ /* Initialize output terminal (can't be done earlier, as gfxterm relies on a working heap. */ - grub_video_sm712_init (); - grub_video_sis315pro_init (); - grub_video_radeon_fuloong2e_init (); - grub_video_radeon_yeeloong3a_init (); - grub_font_init (); - grub_gfxterm_init (); + VasEBoot_video_sm712_init (); + VasEBoot_video_sis315pro_init (); + VasEBoot_video_radeon_fuloong2e_init (); + VasEBoot_video_radeon_yeeloong3a_init (); + VasEBoot_font_init (); + VasEBoot_gfxterm_init (); - grub_keylayouts_init (); - if (grub_arch_machine == GRUB_ARCH_MACHINE_YEELOONG - || grub_arch_machine == GRUB_ARCH_MACHINE_YEELOONG_3A) - grub_at_keyboard_init (); + VasEBoot_keylayouts_init (); + if (VasEBoot_arch_machine == VasEBoot_ARCH_MACHINE_YEELOONG + || VasEBoot_arch_machine == VasEBoot_ARCH_MACHINE_YEELOONG_3A) + VasEBoot_at_keyboard_init (); - grub_terminfo_init (); - grub_serial_init (); + VasEBoot_terminfo_init (); + VasEBoot_serial_init (); - grub_boot_init (); + VasEBoot_boot_init (); } void -grub_machine_fini (int flags __attribute__ ((unused))) +VasEBoot_machine_fini (int flags __attribute__ ((unused))) { } static int -halt_via (grub_pci_device_t dev, grub_pci_id_t pciid, +halt_via (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { - grub_uint16_t pm; - grub_pci_address_t addr; + VasEBoot_uint16_t pm; + VasEBoot_pci_address_t addr; if (pciid != 0x30571106) return 0; - addr = grub_pci_make_address (dev, 0x40); - pm = grub_pci_read (addr) & ~1; + addr = VasEBoot_pci_make_address (dev, 0x40); + pm = VasEBoot_pci_read (addr) & ~1; if (pm == 0) { - grub_pci_write (addr, 0x1801); + VasEBoot_pci_write (addr, 0x1801); pm = 0x1800; } - addr = grub_pci_make_address (dev, 0x80); - grub_pci_write_byte (addr, 0xff); + addr = VasEBoot_pci_make_address (dev, 0x80); + VasEBoot_pci_write_byte (addr, 0xff); - addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); - grub_pci_write_word (addr, grub_pci_read_word (addr) | GRUB_PCI_COMMAND_IO_ENABLED); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write_word (addr, VasEBoot_pci_read_word (addr) | VasEBoot_PCI_COMMAND_IO_ENABLED); /* FIXME: This one is derived from qemu. Check on real hardware. */ - grub_outw (0x2000, pm + 4 + GRUB_MACHINE_PCI_IO_BASE); - grub_millisleep (5000); + VasEBoot_outw (0x2000, pm + 4 + VasEBoot_MACHINE_PCI_IO_BASE); + VasEBoot_millisleep (5000); return 0; } void -grub_halt (void) +VasEBoot_halt (void) { - switch (grub_arch_machine) + switch (VasEBoot_arch_machine) { - case GRUB_ARCH_MACHINE_FULOONG2E: - grub_pci_iterate (halt_via, NULL); + case VasEBoot_ARCH_MACHINE_FULOONG2E: + VasEBoot_pci_iterate (halt_via, NULL); break; - case GRUB_ARCH_MACHINE_FULOONG2F: + case VasEBoot_ARCH_MACHINE_FULOONG2F: { - grub_pci_device_t dev; - grub_port_t p; - if (grub_cs5536_find (&dev)) + VasEBoot_pci_device_t dev; + VasEBoot_port_t p; + if (VasEBoot_cs5536_find (&dev)) { - p = (grub_cs5536_read_msr (dev, GRUB_CS5536_MSR_GPIO_BAR) - & GRUB_CS5536_LBAR_ADDR_MASK) + GRUB_MACHINE_PCI_IO_BASE; - grub_outl ((1 << 13), p + 4); - grub_outl ((1 << 29), p); - grub_millisleep (5000); + p = (VasEBoot_cs5536_read_msr (dev, VasEBoot_CS5536_MSR_GPIO_BAR) + & VasEBoot_CS5536_LBAR_ADDR_MASK) + VasEBoot_MACHINE_PCI_IO_BASE; + VasEBoot_outl ((1 << 13), p + 4); + VasEBoot_outl ((1 << 29), p); + VasEBoot_millisleep (5000); } } break; - case GRUB_ARCH_MACHINE_YEELOONG: - grub_outb (grub_inb (GRUB_CPU_LOONGSON_GPIOCFG) - & ~GRUB_CPU_YEELOONG_SHUTDOWN_GPIO, GRUB_CPU_LOONGSON_GPIOCFG); - grub_millisleep (1500); + case VasEBoot_ARCH_MACHINE_YEELOONG: + VasEBoot_outb (VasEBoot_inb (VasEBoot_CPU_LOONGSON_GPIOCFG) + & ~VasEBoot_CPU_YEELOONG_SHUTDOWN_GPIO, VasEBoot_CPU_LOONGSON_GPIOCFG); + VasEBoot_millisleep (1500); break; - case GRUB_ARCH_MACHINE_YEELOONG_3A: - grub_millisleep (1); - grub_outb (0x4e, GRUB_MACHINE_PCI_IO_BASE_3A | 0x66); - grub_millisleep (1); - grub_outb (2, GRUB_MACHINE_PCI_IO_BASE_3A | 0x62); - grub_millisleep (5000); + case VasEBoot_ARCH_MACHINE_YEELOONG_3A: + VasEBoot_millisleep (1); + VasEBoot_outb (0x4e, VasEBoot_MACHINE_PCI_IO_BASE_3A | 0x66); + VasEBoot_millisleep (1); + VasEBoot_outb (2, VasEBoot_MACHINE_PCI_IO_BASE_3A | 0x62); + VasEBoot_millisleep (5000); break; } - grub_puts_ (N_("Shutdown failed")); - grub_refresh (); + VasEBoot_puts_ (N_("Shutdown failed")); + VasEBoot_refresh (); while (1); } void -grub_exit (void) +VasEBoot_exit (void) { - grub_halt (); + VasEBoot_halt (); } void -grub_machine_get_bootlocation (char **device __attribute__ ((unused)), +VasEBoot_machine_get_bootlocation (char **device __attribute__ ((unused)), char **path __attribute__ ((unused))) { } extern char _end[]; -grub_addr_t grub_modbase = (grub_addr_t) _end; +VasEBoot_addr_t VasEBoot_modbase = (VasEBoot_addr_t) _end; diff --git a/VasEBoot-core/kern/mips/qemu_mips/init.c b/VasEBoot-core/kern/mips/qemu_mips/init.c index be88b77d2..c0ce77dbb 100644 --- a/VasEBoot-core/kern/mips/qemu_mips/init.c +++ b/VasEBoot-core/kern/mips/qemu_mips/init.c @@ -1,28 +1,28 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static inline int -probe_mem (grub_addr_t addr) +probe_mem (VasEBoot_addr_t addr) { - volatile grub_uint8_t *ptr = (grub_uint8_t *) (0xa0000000 | addr); - grub_uint8_t c = *ptr; + volatile VasEBoot_uint8_t *ptr = (VasEBoot_uint8_t *) (0xa0000000 | addr); + VasEBoot_uint8_t c = *ptr; *ptr = 0xAA; if (*ptr != 0xAA) return 0; @@ -34,72 +34,72 @@ probe_mem (grub_addr_t addr) } void -grub_machine_init (void) +VasEBoot_machine_init (void) { - grub_addr_t modend; + VasEBoot_addr_t modend; - if (grub_arch_memsize == 0) + if (VasEBoot_arch_memsize == 0) { int i; for (i = 27; i >= 0; i--) - if (probe_mem (grub_arch_memsize | (1 << i))) - grub_arch_memsize |= (1 << i); - grub_arch_memsize++; + if (probe_mem (VasEBoot_arch_memsize | (1 << i))) + VasEBoot_arch_memsize |= (1 << i); + VasEBoot_arch_memsize++; } /* FIXME: measure this. */ - grub_arch_cpuclock = 200000000; + VasEBoot_arch_cpuclock = 200000000; - modend = grub_modules_get_end (); - grub_mm_init_region ((void *) modend, grub_arch_memsize - - (modend - GRUB_ARCH_LOWMEMVSTART)); + modend = VasEBoot_modules_get_end (); + VasEBoot_mm_init_region ((void *) modend, VasEBoot_arch_memsize + - (modend - VasEBoot_ARCH_LOWMEMVSTART)); - grub_install_get_time_ms (grub_rtc_get_time_ms); + VasEBoot_install_get_time_ms (VasEBoot_rtc_get_time_ms); - grub_keylayouts_init (); - grub_at_keyboard_init (); + VasEBoot_keylayouts_init (); + VasEBoot_at_keyboard_init (); - grub_qemu_init_cirrus (); - grub_vga_text_init (); + VasEBoot_qemu_init_cirrus (); + VasEBoot_vga_text_init (); - grub_terminfo_init (); - grub_serial_init (); + VasEBoot_terminfo_init (); + VasEBoot_serial_init (); - grub_boot_init (); + VasEBoot_boot_init (); } void -grub_machine_fini (int flags __attribute__ ((unused))) +VasEBoot_machine_fini (int flags __attribute__ ((unused))) { } void -grub_exit (void) +VasEBoot_exit (void) { - grub_halt (); + VasEBoot_halt (); } void -grub_halt (void) +VasEBoot_halt (void) { - grub_outl (42, 0xbfbf0004); + VasEBoot_outl (42, 0xbfbf0004); while (1); } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - hook (0, grub_arch_memsize, GRUB_MEMORY_AVAILABLE, hook_data); - return GRUB_ERR_NONE; + hook (0, VasEBoot_arch_memsize, VasEBoot_MEMORY_AVAILABLE, hook_data); + return VasEBoot_ERR_NONE; } void -grub_machine_get_bootlocation (char **device __attribute__ ((unused)), +VasEBoot_machine_get_bootlocation (char **device __attribute__ ((unused)), char **path __attribute__ ((unused))) { } extern char _end[]; -grub_addr_t grub_modbase = (grub_addr_t) _end; +VasEBoot_addr_t VasEBoot_modbase = (VasEBoot_addr_t) _end; diff --git a/VasEBoot-core/kern/mips/startup.S b/VasEBoot-core/kern/mips/startup.S index 1fdb58aca..2063cc288 100644 --- a/VasEBoot-core/kern/mips/startup.S +++ b/VasEBoot-core/kern/mips/startup.S @@ -1,28 +1,28 @@ /* startup.S - Startup code for the MIPS. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define BASE_ADDR 8 @@ -37,35 +37,35 @@ start: bal cont nop - .org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE -VARIABLE(grub_total_modules_size) + .org VasEBoot_KERNEL_MACHINE_TOTAL_MODULE_SIZE +VARIABLE(VasEBoot_total_modules_size) .long 0 -VARIABLE (grub_arch_busclock) +VARIABLE (VasEBoot_arch_busclock) .long 0 -VARIABLE (grub_arch_cpuclock) +VARIABLE (VasEBoot_arch_cpuclock) .long 0 -VARIABLE (grub_arch_memsize) +VARIABLE (VasEBoot_arch_memsize) .long 0 -VARIABLE (grub_arch_highmemsize) +VARIABLE (VasEBoot_arch_highmemsize) .long 0 -#ifdef GRUB_MACHINE_MIPS_LOONGSON -VARIABLE (grub_arch_machine) - .long GRUB_ARCH_MACHINE_FULOONG2F +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON +VARIABLE (VasEBoot_arch_machine) + .long VasEBoot_ARCH_MACHINE_FULOONG2F #endif cont: /* Save our base. */ move $s0, $ra -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS - lui $t1, %hi(grub_arch_busclock) - addiu $t1, %lo(grub_arch_busclock) +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS + lui $t1, %hi(VasEBoot_arch_busclock) + addiu $t1, %lo(VasEBoot_arch_busclock) sw $s4, 8($t1) #endif -#ifdef GRUB_MACHINE_MIPS_LOONGSON - lui $t1, %hi(grub_arch_busclock) - addiu $t1, %lo(grub_arch_busclock) +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON + lui $t1, %hi(VasEBoot_arch_busclock) + addiu $t1, %lo(VasEBoot_arch_busclock) sw $s2, 0($t1) sw $s3, 4($t1) sw $s4, 8($t1) @@ -79,12 +79,12 @@ cont: lui $t1, %hi(_end) addiu $t1, %lo(_end) - addiu $t1, (GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - li $t3, (GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + addiu $t1, (VasEBoot_KERNEL_MACHINE_MOD_ALIGN - 1) + li $t3, (VasEBoot_KERNEL_MACHINE_MOD_ALIGN - 1) nor $t3, $t3, $0 and $t1, $t1, $t3 - lw $t3, (GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE - BASE_ADDR)($s0) + lw $t3, (VasEBoot_KERNEL_MACHINE_TOTAL_MODULE_SIZE - BASE_ADDR)($s0) /* Backward copy. */ add $t1, $t1, $t3 @@ -96,8 +96,8 @@ cont: modulesmovcont: beq $t3, $0, modulesmovdone nop - lb GRUB_ASM_T4, 0($t2) - sb GRUB_ASM_T4, 0($t1) + lb VasEBoot_ASM_T4, 0($t2) + sb VasEBoot_ASM_T4, 0($t1) addiu $t2, $t2, -1 addiu $t1, $t1, -1 b modulesmovcont @@ -117,10 +117,10 @@ bsscont: bne $t3, $0, bsscont nop - lui $t9, %hi(grub_main) - addiu $t9, %lo(grub_main) + lui $t9, %hi(VasEBoot_main) + addiu $t9, %lo(VasEBoot_main) - lui $sp, %hi(GRUB_MACHINE_MEMORY_STACK_HIGH) + lui $sp, %hi(VasEBoot_MACHINE_MEMORY_STACK_HIGH) jr $t9 - addiu $sp, $sp, %lo(GRUB_MACHINE_MEMORY_STACK_HIGH) + addiu $sp, $sp, %lo(VasEBoot_MACHINE_MEMORY_STACK_HIGH) diff --git a/VasEBoot-core/kern/misc.c b/VasEBoot-core/kern/misc.c index d1a54df6c..1919bddba 100644 --- a/VasEBoot-core/kern/misc.c +++ b/VasEBoot-core/kern/misc.c @@ -1,29 +1,29 @@ /* misc.c - definitions of misc functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include union printf_arg { @@ -42,40 +42,40 @@ struct printf_args { union printf_arg prealloc[32]; union printf_arg *ptr; - grub_size_t count; + VasEBoot_size_t count; }; static void parse_printf_args (const char *fmt0, struct printf_args *args, va_list args_in); static int -grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, +VasEBoot_vsnprintf_real (char *str, VasEBoot_size_t max_len, const char *fmt0, struct printf_args *args); static void free_printf_args (struct printf_args *args) { if (args->ptr != args->prealloc) - grub_free (args->ptr); + VasEBoot_free (args->ptr); } static int -grub_iswordseparator (int c) +VasEBoot_iswordseparator (int c) { - return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&'); + return (VasEBoot_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&'); } -/* grub_gettext_dummy is not translating anything. */ +/* VasEBoot_gettext_dummy is not translating anything. */ static const char * -grub_gettext_dummy (const char *s) +VasEBoot_gettext_dummy (const char *s) { return s; } -const char* (*grub_gettext) (const char *s) = grub_gettext_dummy; +const char* (*VasEBoot_gettext) (const char *s) = VasEBoot_gettext_dummy; void * -grub_memmove (void *dest, const void *src, grub_size_t n) +VasEBoot_memmove (void *dest, const void *src, VasEBoot_size_t n) { char *d = (char *) dest; const char *s = (const char *) src; @@ -96,7 +96,7 @@ grub_memmove (void *dest, const void *src, grub_size_t n) } char * -grub_strcpy (char *dest, const char *src) +VasEBoot_strcpy (char *dest, const char *src) { char *p = dest; @@ -107,96 +107,96 @@ grub_strcpy (char *dest, const char *src) } int -grub_printf (const char *fmt, ...) +VasEBoot_printf (const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); - ret = grub_vprintf (fmt, ap); + ret = VasEBoot_vprintf (fmt, ap); va_end (ap); return ret; } int -grub_printf_ (const char *fmt, ...) +VasEBoot_printf_ (const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); - ret = grub_vprintf (_(fmt), ap); + ret = VasEBoot_vprintf (_(fmt), ap); va_end (ap); return ret; } int -grub_puts_ (const char *s) +VasEBoot_puts_ (const char *s) { - return grub_puts (_(s)); + return VasEBoot_puts (_(s)); } -#if defined (__APPLE__) && ! defined (GRUB_UTIL) +#if defined (__APPLE__) && ! defined (VasEBoot_UTIL) int -grub_err_printf (const char *fmt, ...) +VasEBoot_err_printf (const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); - ret = grub_vprintf (fmt, ap); + ret = VasEBoot_vprintf (fmt, ap); va_end (ap); return ret; } #endif -#if ! defined (__APPLE__) && ! defined (GRUB_UTIL) -int grub_err_printf (const char *fmt, ...) -__attribute__ ((alias("grub_printf"))); +#if ! defined (__APPLE__) && ! defined (VasEBoot_UTIL) +int VasEBoot_err_printf (const char *fmt, ...) +__attribute__ ((alias("VasEBoot_printf"))); #endif void -grub_real_dprintf (const char *file, const int line, const char *condition, +VasEBoot_real_dprintf (const char *file, const int line, const char *condition, const char *fmt, ...) { va_list args; - const char *debug = grub_env_get ("debug"); + const char *debug = VasEBoot_env_get ("debug"); if (! debug) return; - if (grub_strword (debug, "all") || grub_strword (debug, condition)) + if (VasEBoot_strword (debug, "all") || VasEBoot_strword (debug, condition)) { - grub_printf ("%s:%d: ", file, line); + VasEBoot_printf ("%s:%d: ", file, line); va_start (args, fmt); - grub_vprintf (fmt, args); + VasEBoot_vprintf (fmt, args); va_end (args); - grub_refresh (); + VasEBoot_refresh (); } } #define PREALLOC_SIZE 255 int -grub_vprintf (const char *fmt, va_list ap) +VasEBoot_vprintf (const char *fmt, va_list ap) { - grub_size_t s; + VasEBoot_size_t s; static char buf[PREALLOC_SIZE + 1]; char *curbuf = buf; struct printf_args args; parse_printf_args (fmt, &args, ap); - s = grub_vsnprintf_real (buf, PREALLOC_SIZE, fmt, &args); + s = VasEBoot_vsnprintf_real (buf, PREALLOC_SIZE, fmt, &args); if (s > PREALLOC_SIZE) { - curbuf = grub_malloc (s + 1); + curbuf = VasEBoot_malloc (s + 1); if (!curbuf) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; buf[PREALLOC_SIZE - 3] = '.'; buf[PREALLOC_SIZE - 2] = '.'; buf[PREALLOC_SIZE - 1] = '.'; @@ -204,24 +204,24 @@ grub_vprintf (const char *fmt, va_list ap) curbuf = buf; } else - s = grub_vsnprintf_real (curbuf, s, fmt, &args); + s = VasEBoot_vsnprintf_real (curbuf, s, fmt, &args); } free_printf_args (&args); - grub_xputs (curbuf); + VasEBoot_xputs (curbuf); if (curbuf != buf) - grub_free (curbuf); + VasEBoot_free (curbuf); return s; } int -grub_memcmp (const void *s1, const void *s2, grub_size_t n) +VasEBoot_memcmp (const void *s1, const void *s2, VasEBoot_size_t n) { - const grub_uint8_t *t1 = s1; - const grub_uint8_t *t2 = s2; + const VasEBoot_uint8_t *t1 = s1; + const VasEBoot_uint8_t *t2 = s2; while (n--) { @@ -236,7 +236,7 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n) } int -grub_strcmp (const char *s1, const char *s2) +VasEBoot_strcmp (const char *s1, const char *s2) { while (*s1 && *s2) { @@ -247,11 +247,11 @@ grub_strcmp (const char *s1, const char *s2) s2++; } - return (int) (grub_uint8_t) *s1 - (int) (grub_uint8_t) *s2; + return (int) (VasEBoot_uint8_t) *s1 - (int) (VasEBoot_uint8_t) *s2; } int -grub_strncmp (const char *s1, const char *s2, grub_size_t n) +VasEBoot_strncmp (const char *s1, const char *s2, VasEBoot_size_t n) { if (n == 0) return 0; @@ -265,11 +265,11 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n) s2++; } - return (int) (grub_uint8_t) *s1 - (int) (grub_uint8_t) *s2; + return (int) (VasEBoot_uint8_t) *s1 - (int) (VasEBoot_uint8_t) *s2; } char * -grub_strchr (const char *s, int c) +VasEBoot_strchr (const char *s, int c) { do { @@ -282,7 +282,7 @@ grub_strchr (const char *s, int c) } char * -grub_strrchr (const char *s, int c) +VasEBoot_strrchr (const char *s, int c) { char *p = NULL; @@ -297,17 +297,17 @@ grub_strrchr (const char *s, int c) } int -grub_strword (const char *haystack, const char *needle) +VasEBoot_strword (const char *haystack, const char *needle) { const char *n_pos = needle; - while (grub_iswordseparator (*haystack)) + while (VasEBoot_iswordseparator (*haystack)) haystack++; while (*haystack) { /* Crawl both the needle and the haystack word we're on. */ - while(*haystack && !grub_iswordseparator (*haystack) + while(*haystack && !VasEBoot_iswordseparator (*haystack) && *haystack == *n_pos) { haystack++; @@ -317,15 +317,15 @@ grub_strword (const char *haystack, const char *needle) /* If we reached the end of both words at the same time, the word is found. If not, eat everything in the haystack that isn't the next word (or the end of string) and "reset" the needle. */ - if ( (!*haystack || grub_iswordseparator (*haystack)) - && (!*n_pos || grub_iswordseparator (*n_pos))) + if ( (!*haystack || VasEBoot_iswordseparator (*haystack)) + && (!*n_pos || VasEBoot_iswordseparator (*n_pos))) return 1; else { n_pos = needle; - while (*haystack && !grub_iswordseparator (*haystack)) + while (*haystack && !VasEBoot_iswordseparator (*haystack)) haystack++; - while (grub_iswordseparator (*haystack)) + while (VasEBoot_iswordseparator (*haystack)) haystack++; } } @@ -334,21 +334,21 @@ grub_strword (const char *haystack, const char *needle) } int -grub_isspace (int c) +VasEBoot_isspace (int c) { return (c == '\n' || c == '\r' || c == ' ' || c == '\t'); } unsigned long -grub_strtoul (const char *str, char **end, int base) +VasEBoot_strtoul (const char *str, char **end, int base) { unsigned long long num; - num = grub_strtoull (str, end, base); -#if GRUB_CPU_SIZEOF_LONG != 8 + num = VasEBoot_strtoull (str, end, base); +#if VasEBoot_CPU_SIZEOF_LONG != 8 if (num > ~0UL) { - grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("overflow is detected")); return ~0UL; } #endif @@ -357,14 +357,14 @@ grub_strtoul (const char *str, char **end, int base) } unsigned long long -grub_strtoull (const char *str, char **end, int base) +VasEBoot_strtoull (const char *str, char **end, int base) { unsigned long long num = 0; int found = 0; /* Skip white spaces. */ - /* grub_isspace checks that *str != '\0'. */ - while (grub_isspace (*str)) + /* VasEBoot_isspace checks that *str != '\0'. */ + while (VasEBoot_isspace (*str)) str++; /* Guess the base, if not specified. The prefix `0x' means 16, and @@ -390,7 +390,7 @@ grub_strtoull (const char *str, char **end, int base) { unsigned long digit; - digit = grub_tolower (*str) - '0'; + digit = VasEBoot_tolower (*str) - '0'; if (digit > 9) { digit += '0' - 'a' + 10; @@ -401,9 +401,9 @@ grub_strtoull (const char *str, char **end, int base) found = 1; /* NUM * BASE + DIGIT > ~0ULL */ - if (num > grub_divmod64 (~0ULL - digit, base, 0)) + if (num > VasEBoot_divmod64 (~0ULL - digit, base, 0)) { - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("overflow is detected")); return ~0ULL; } @@ -414,7 +414,7 @@ grub_strtoull (const char *str, char **end, int base) if (! found) { - grub_error (GRUB_ERR_BAD_NUMBER, + VasEBoot_error (VasEBoot_ERR_BAD_NUMBER, N_("unrecognized number")); return 0; } @@ -426,33 +426,33 @@ grub_strtoull (const char *str, char **end, int base) } char * -grub_strdup (const char *s) +VasEBoot_strdup (const char *s) { - grub_size_t len; + VasEBoot_size_t len; char *p; - len = grub_strlen (s) + 1; - p = (char *) grub_malloc (len); + len = VasEBoot_strlen (s) + 1; + p = (char *) VasEBoot_malloc (len); if (! p) return 0; - return grub_memcpy (p, s, len); + return VasEBoot_memcpy (p, s, len); } char * -grub_strndup (const char *s, grub_size_t n) +VasEBoot_strndup (const char *s, VasEBoot_size_t n) { - grub_size_t len; + VasEBoot_size_t len; char *p; - len = grub_strlen (s); + len = VasEBoot_strlen (s); if (len > n) len = n; - p = (char *) grub_malloc (len + 1); + p = (char *) VasEBoot_malloc (len + 1); if (! p) return 0; - grub_memcpy (p, s, len); + VasEBoot_memcpy (p, s, len); p[len] = '\0'; return p; } @@ -467,23 +467,23 @@ grub_strndup (const char *s, grub_size_t n) #endif void * -grub_memset (void *s, int c, grub_size_t len) +VasEBoot_memset (void *s, int c, VasEBoot_size_t len) { void *p = s; - grub_uint8_t pattern8 = c; + VasEBoot_uint8_t pattern8 = c; if (len >= 3 * sizeof (unsigned long)) { unsigned long patternl = 0; - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < sizeof (unsigned long); i++) patternl |= ((unsigned long) pattern8) << (8 * i); - while (len > 0 && (((grub_addr_t) p) & (sizeof (unsigned long) - 1))) + while (len > 0 && (((VasEBoot_addr_t) p) & (sizeof (unsigned long) - 1))) { - *(VOLATILE_CLANG grub_uint8_t *) p = pattern8; - p = (grub_uint8_t *) p + 1; + *(VOLATILE_CLANG VasEBoot_uint8_t *) p = pattern8; + p = (VasEBoot_uint8_t *) p + 1; len--; } while (len >= sizeof (unsigned long)) @@ -496,16 +496,16 @@ grub_memset (void *s, int c, grub_size_t len) while (len > 0) { - *(VOLATILE_CLANG grub_uint8_t *) p = pattern8; - p = (grub_uint8_t *) p + 1; + *(VOLATILE_CLANG VasEBoot_uint8_t *) p = pattern8; + p = (VasEBoot_uint8_t *) p + 1; len--; } return s; } -grub_size_t -grub_strlen (const char *s) +VasEBoot_size_t +VasEBoot_strlen (const char *s) { const char *p = s; @@ -516,9 +516,9 @@ grub_strlen (const char *s) } static inline void -grub_reverse (char *str) +VasEBoot_reverse (char *str) { - char *p = str + grub_strlen (str) - 1; + char *p = str + VasEBoot_strlen (str) - 1; while (str < p) { @@ -533,29 +533,29 @@ grub_reverse (char *str) } /* Divide N by D, return the quotient, and store the remainder in *R. */ -grub_uint64_t -grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) +VasEBoot_uint64_t +VasEBoot_divmod64 (VasEBoot_uint64_t n, VasEBoot_uint64_t d, VasEBoot_uint64_t *r) { /* This algorithm is typically implemented by hardware. The idea is to get the highest bit in N, 64 times, by keeping upper(N * 2^i) = (Q * D + M), where upper represents the high 64 bits in 128-bits space. */ unsigned bits = 64; - grub_uint64_t q = 0; - grub_uint64_t m = 0; + VasEBoot_uint64_t q = 0; + VasEBoot_uint64_t m = 0; /* ARM and IA64 don't have a fast 32-bit division. Using that code would just make us use software division routines, calling ourselves indirectly and hence getting infinite recursion. */ -#if !GRUB_DIVISION_IN_SOFTWARE +#if !VasEBoot_DIVISION_IN_SOFTWARE /* Skip the slow computation if 32-bit arithmetic is possible. */ if (n < 0xffffffff && d < 0xffffffff) { if (r) - *r = ((grub_uint32_t) n) % (grub_uint32_t) d; + *r = ((VasEBoot_uint32_t) n) % (VasEBoot_uint32_t) d; - return ((grub_uint32_t) n) / (grub_uint32_t) d; + return ((VasEBoot_uint32_t) n) / (VasEBoot_uint32_t) d; } #endif @@ -585,7 +585,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) /* Convert a long long value to a string. This function avoids 64-bit modular arithmetic or divisions. */ static inline char * -grub_lltoa (char *str, int c, unsigned long long n) +VasEBoot_lltoa (char *str, int c, unsigned long long n) { unsigned base = (c == 'x') ? 16 : 10; char *p; @@ -609,16 +609,16 @@ grub_lltoa (char *str, int c, unsigned long long n) /* BASE == 10 */ do { - grub_uint64_t m; + VasEBoot_uint64_t m; - n = grub_divmod64 (n, 10, &m); + n = VasEBoot_divmod64 (n, 10, &m); *p++ = m + '0'; } while (n); *p = 0; - grub_reverse (str); + VasEBoot_reverse (str); return p; } @@ -628,11 +628,11 @@ parse_printf_args (const char *fmt0, struct printf_args *args, { const char *fmt; char c; - grub_size_t n = 0; + VasEBoot_size_t n = 0; args->count = 0; - COMPILE_TIME_ASSERT (sizeof (int) == sizeof (grub_uint32_t)); + COMPILE_TIME_ASSERT (sizeof (int) == sizeof (VasEBoot_uint32_t)); COMPILE_TIME_ASSERT (sizeof (int) <= sizeof (long long)); COMPILE_TIME_ASSERT (sizeof (long) <= sizeof (long long)); COMPILE_TIME_ASSERT (sizeof (long long) == sizeof (void *) @@ -647,7 +647,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, if (*fmt =='-') fmt++; - while (grub_isdigit (*fmt)) + while (VasEBoot_isdigit (*fmt)) fmt++; if (*fmt == '$') @@ -656,13 +656,13 @@ parse_printf_args (const char *fmt0, struct printf_args *args, if (*fmt =='-') fmt++; - while (grub_isdigit (*fmt)) + while (VasEBoot_isdigit (*fmt)) fmt++; if (*fmt =='.') fmt++; - while (grub_isdigit (*fmt)) + while (VasEBoot_isdigit (*fmt)) fmt++; c = *fmt++; @@ -689,23 +689,23 @@ parse_printf_args (const char *fmt0, struct printf_args *args, args->ptr = args->prealloc; else { - args->ptr = grub_malloc (args->count * sizeof (args->ptr[0])); + args->ptr = VasEBoot_malloc (args->count * sizeof (args->ptr[0])); if (!args->ptr) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; args->ptr = args->prealloc; args->count = ARRAY_SIZE (args->prealloc); } } - grub_memset (args->ptr, 0, args->count * sizeof (args->ptr[0])); + VasEBoot_memset (args->ptr, 0, args->count * sizeof (args->ptr[0])); fmt = fmt0; n = 0; while ((c = *fmt++) != 0) { int longfmt = 0; - grub_size_t curn; + VasEBoot_size_t curn; const char *p; if (c != '%') @@ -718,25 +718,25 @@ parse_printf_args (const char *fmt0, struct printf_args *args, p = fmt; - while (grub_isdigit (*fmt)) + while (VasEBoot_isdigit (*fmt)) fmt++; if (*fmt == '$') { - curn = grub_strtoull (p, 0, 10) - 1; + curn = VasEBoot_strtoull (p, 0, 10) - 1; fmt++; } if (*fmt =='-') fmt++; - while (grub_isdigit (*fmt)) + while (VasEBoot_isdigit (*fmt)) fmt++; if (*fmt =='.') fmt++; - while (grub_isdigit (*fmt)) + while (VasEBoot_isdigit (*fmt)) fmt++; c = *fmt++; @@ -804,7 +804,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, } static inline void __attribute__ ((always_inline)) -write_char (char *str, grub_size_t *count, grub_size_t max_len, unsigned char ch) +write_char (char *str, VasEBoot_size_t *count, VasEBoot_size_t max_len, unsigned char ch) { if (*count < max_len) str[*count] = ch; @@ -813,12 +813,12 @@ write_char (char *str, grub_size_t *count, grub_size_t max_len, unsigned char ch } static int -grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, +VasEBoot_vsnprintf_real (char *str, VasEBoot_size_t max_len, const char *fmt0, struct printf_args *args) { char c; - grub_size_t n = 0; - grub_size_t count = 0; + VasEBoot_size_t n = 0; + VasEBoot_size_t count = 0; const char *fmt; fmt = fmt0; @@ -829,7 +829,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, unsigned int format2 = ~ 0U; char zerofill = ' '; char rightfill = 0; - grub_size_t curn; + VasEBoot_size_t curn; if (c != '%') { @@ -848,18 +848,18 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, } /* Read formatting parameters. */ - if (grub_isdigit (*fmt)) + if (VasEBoot_isdigit (*fmt)) { if (fmt[0] == '0') zerofill = '0'; - format1 = grub_strtoul (fmt, (char **) &fmt, 10); + format1 = VasEBoot_strtoul (fmt, (char **) &fmt, 10); } if (*fmt == '.') fmt++; - if (grub_isdigit (*fmt)) - format2 = grub_strtoul (fmt, (char **) &fmt, 10); + if (VasEBoot_isdigit (*fmt)) + format2 = VasEBoot_strtoul (fmt, (char **) &fmt, 10); if (*fmt == '$') { @@ -904,10 +904,10 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, { char tmp[32]; const char *p = tmp; - grub_size_t len; - grub_size_t fill; + VasEBoot_size_t len; + VasEBoot_size_t fill; - len = grub_lltoa (tmp, c, curarg) - tmp; + len = VasEBoot_lltoa (tmp, c, curarg) - tmp; fill = len < format1 ? format1 - len : 0; if (! rightfill) while (fill--) @@ -926,7 +926,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, case 'C': { - grub_uint32_t code = curarg; + VasEBoot_uint32_t code = curarg; int shift; unsigned mask; @@ -966,10 +966,10 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, case 's': { - grub_size_t len = 0; - grub_size_t fill; - const char *p = ((char *) (grub_addr_t) curarg) ? : "(null)"; - grub_size_t i; + VasEBoot_size_t len = 0; + VasEBoot_size_t fill; + const char *p = ((char *) (VasEBoot_addr_t) curarg) ? : "(null)"; + VasEBoot_size_t i; while (len < format2 && p[len]) len++; @@ -1004,9 +1004,9 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, } int -grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap) +VasEBoot_vsnprintf (char *str, VasEBoot_size_t n, const char *fmt, va_list ap) { - grub_size_t ret; + VasEBoot_size_t ret; struct printf_args args; if (!n) @@ -1016,7 +1016,7 @@ grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap) parse_printf_args (fmt, &args, ap); - ret = grub_vsnprintf_real (str, n, fmt, &args); + ret = VasEBoot_vsnprintf_real (str, n, fmt, &args); free_printf_args (&args); @@ -1024,22 +1024,22 @@ grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap) } int -grub_snprintf (char *str, grub_size_t n, const char *fmt, ...) +VasEBoot_snprintf (char *str, VasEBoot_size_t n, const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); - ret = grub_vsnprintf (str, n, fmt, ap); + ret = VasEBoot_vsnprintf (str, n, fmt, ap); va_end (ap); return ret; } char * -grub_xvasprintf (const char *fmt, va_list ap) +VasEBoot_xvasprintf (const char *fmt, va_list ap) { - grub_size_t s, as = PREALLOC_SIZE; + VasEBoot_size_t s, as = PREALLOC_SIZE; char *ret; struct printf_args args; @@ -1047,14 +1047,14 @@ grub_xvasprintf (const char *fmt, va_list ap) while (1) { - ret = grub_malloc (as + 1); + ret = VasEBoot_malloc (as + 1); if (!ret) { free_printf_args (&args); return NULL; } - s = grub_vsnprintf_real (ret, as, fmt, &args); + s = VasEBoot_vsnprintf_real (ret, as, fmt, &args); if (s <= as) { @@ -1062,91 +1062,91 @@ grub_xvasprintf (const char *fmt, va_list ap) return ret; } - grub_free (ret); + VasEBoot_free (ret); as = s; } } char * -grub_xasprintf (const char *fmt, ...) +VasEBoot_xasprintf (const char *fmt, ...) { va_list ap; char *ret; va_start (ap, fmt); - ret = grub_xvasprintf (fmt, ap); + ret = VasEBoot_xvasprintf (fmt, ap); va_end (ap); return ret; } -/* Abort GRUB. This function does not return. */ +/* Abort VasEBoot. This function does not return. */ static void __attribute__ ((noreturn)) -grub_abort (void) +VasEBoot_abort (void) { - grub_printf ("\nAborted."); + VasEBoot_printf ("\nAborted."); -#ifndef GRUB_UTIL - if (grub_term_inputs) +#ifndef VasEBoot_UTIL + if (VasEBoot_term_inputs) #endif { - grub_printf (" Press any key to exit."); - grub_getkey (); + VasEBoot_printf (" Press any key to exit."); + VasEBoot_getkey (); } - grub_exit (); + VasEBoot_exit (); } void -grub_fatal (const char *fmt, ...) +VasEBoot_fatal (const char *fmt, ...) { va_list ap; va_start (ap, fmt); - grub_vprintf (_(fmt), ap); + VasEBoot_vprintf (_(fmt), ap); va_end (ap); - grub_refresh (); + VasEBoot_refresh (); - grub_abort (); + VasEBoot_abort (); } #if BOOT_TIME_STATS -#include +#include -struct grub_boot_time *grub_boot_time_head; -static struct grub_boot_time **boot_time_last = &grub_boot_time_head; +struct VasEBoot_boot_time *VasEBoot_boot_time_head; +static struct VasEBoot_boot_time **boot_time_last = &VasEBoot_boot_time_head; void -grub_real_boot_time (const char *file, +VasEBoot_real_boot_time (const char *file, const int line, const char *fmt, ...) { - struct grub_boot_time *n; + struct VasEBoot_boot_time *n; va_list args; - grub_error_push (); - n = grub_malloc (sizeof (*n)); + VasEBoot_error_push (); + n = VasEBoot_malloc (sizeof (*n)); if (!n) { - grub_errno = 0; - grub_error_pop (); + VasEBoot_errno = 0; + VasEBoot_error_pop (); return; } n->file = file; n->line = line; - n->tp = grub_get_time_ms (); + n->tp = VasEBoot_get_time_ms (); n->next = 0; va_start (args, fmt); - n->msg = grub_xvasprintf (fmt, args); + n->msg = VasEBoot_xvasprintf (fmt, args); va_end (args); *boot_time_last = n; boot_time_last = &n->next; - grub_errno = 0; - grub_error_pop (); + VasEBoot_errno = 0; + VasEBoot_error_pop (); } #endif diff --git a/VasEBoot-core/kern/mm.c b/VasEBoot-core/kern/mm.c index ee88ff611..009ef0523 100644 --- a/VasEBoot-core/kern/mm.c +++ b/VasEBoot-core/kern/mm.c @@ -1,20 +1,20 @@ /* mm.c - functions for memory manager */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* @@ -36,7 +36,7 @@ is important for some CPUs which may not access multiple bytes at a time when the first byte is not aligned at a certain boundary (typically, 4-byte or 8-byte). The size of each cell is equal to the size of struct - grub_mm_header, so the header of each allocated/free block fits into one + VasEBoot_mm_header, so the header of each allocated/free block fits into one cell precisely. One cell is 16 bytes on 32-bit platforms and 32 bytes on 64-bit platforms. @@ -54,120 +54,120 @@ implementation a bit easier. For safety, both allocated blocks and free ones are marked by magic - numbers. Whenever anything unexpected is detected, GRUB aborts the + numbers. Whenever anything unexpected is detected, VasEBoot aborts the operation. */ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef MM_DEBUG -# undef grub_malloc -# undef grub_zalloc -# undef grub_realloc -# undef grub_free -# undef grub_memalign +# undef VasEBoot_malloc +# undef VasEBoot_zalloc +# undef VasEBoot_realloc +# undef VasEBoot_free +# undef VasEBoot_memalign #endif -grub_mm_region_t grub_mm_base; +VasEBoot_mm_region_t VasEBoot_mm_base; /* Get a header from the pointer PTR, and set *P and *R to a pointer to the header and a pointer to its region, respectively. PTR must be allocated. */ static void -get_header_from_pointer (void *ptr, grub_mm_header_t *p, grub_mm_region_t *r) +get_header_from_pointer (void *ptr, VasEBoot_mm_header_t *p, VasEBoot_mm_region_t *r) { - if ((grub_addr_t) ptr & (GRUB_MM_ALIGN - 1)) - grub_fatal ("unaligned pointer %p", ptr); + if ((VasEBoot_addr_t) ptr & (VasEBoot_MM_ALIGN - 1)) + VasEBoot_fatal ("unaligned pointer %p", ptr); - for (*r = grub_mm_base; *r; *r = (*r)->next) - if ((grub_addr_t) ptr > (grub_addr_t) ((*r) + 1) - && (grub_addr_t) ptr <= (grub_addr_t) ((*r) + 1) + (*r)->size) + for (*r = VasEBoot_mm_base; *r; *r = (*r)->next) + if ((VasEBoot_addr_t) ptr > (VasEBoot_addr_t) ((*r) + 1) + && (VasEBoot_addr_t) ptr <= (VasEBoot_addr_t) ((*r) + 1) + (*r)->size) break; if (! *r) - grub_fatal ("out of range pointer %p", ptr); + VasEBoot_fatal ("out of range pointer %p", ptr); - *p = (grub_mm_header_t) ptr - 1; - if ((*p)->magic == GRUB_MM_FREE_MAGIC) - grub_fatal ("double free at %p", *p); - if ((*p)->magic != GRUB_MM_ALLOC_MAGIC) - grub_fatal ("alloc magic is broken at %p: %lx", *p, + *p = (VasEBoot_mm_header_t) ptr - 1; + if ((*p)->magic == VasEBoot_MM_FREE_MAGIC) + VasEBoot_fatal ("double free at %p", *p); + if ((*p)->magic != VasEBoot_MM_ALLOC_MAGIC) + VasEBoot_fatal ("alloc magic is broken at %p: %lx", *p, (unsigned long) (*p)->magic); } /* Initialize a region starting from ADDR and whose size is SIZE, to use it as free space. */ void -grub_mm_init_region (void *addr, grub_size_t size) +VasEBoot_mm_init_region (void *addr, VasEBoot_size_t size) { - grub_mm_header_t h; - grub_mm_region_t r, *p, q; + VasEBoot_mm_header_t h; + VasEBoot_mm_region_t r, *p, q; #if 0 - grub_printf ("Using memory for heap: start=%p, end=%p\n", addr, addr + (unsigned int) size); + VasEBoot_printf ("Using memory for heap: start=%p, end=%p\n", addr, addr + (unsigned int) size); #endif /* Exclude last 4K to avoid overflows. */ /* If addr + 0x1000 overflows then whole region is in excluded zone. */ - if ((grub_addr_t) addr > ~((grub_addr_t) 0x1000)) + if ((VasEBoot_addr_t) addr > ~((VasEBoot_addr_t) 0x1000)) return; /* If addr + 0x1000 + size overflows then decrease size. */ - if (((grub_addr_t) addr + 0x1000) > ~(grub_addr_t) size) - size = ((grub_addr_t) -0x1000) - (grub_addr_t) addr; + if (((VasEBoot_addr_t) addr + 0x1000) > ~(VasEBoot_addr_t) size) + size = ((VasEBoot_addr_t) -0x1000) - (VasEBoot_addr_t) addr; - for (p = &grub_mm_base, q = *p; q; p = &(q->next), q = *p) - if ((grub_uint8_t *) addr + size + q->pre_size == (grub_uint8_t *) q) + for (p = &VasEBoot_mm_base, q = *p; q; p = &(q->next), q = *p) + if ((VasEBoot_uint8_t *) addr + size + q->pre_size == (VasEBoot_uint8_t *) q) { - r = (grub_mm_region_t) ALIGN_UP ((grub_addr_t) addr, GRUB_MM_ALIGN); + r = (VasEBoot_mm_region_t) ALIGN_UP ((VasEBoot_addr_t) addr, VasEBoot_MM_ALIGN); *r = *q; r->pre_size += size; - if (r->pre_size >> GRUB_MM_ALIGN_LOG2) + if (r->pre_size >> VasEBoot_MM_ALIGN_LOG2) { - h = (grub_mm_header_t) (r + 1); - h->size = (r->pre_size >> GRUB_MM_ALIGN_LOG2); - h->magic = GRUB_MM_ALLOC_MAGIC; - r->size += h->size << GRUB_MM_ALIGN_LOG2; - r->pre_size &= (GRUB_MM_ALIGN - 1); + h = (VasEBoot_mm_header_t) (r + 1); + h->size = (r->pre_size >> VasEBoot_MM_ALIGN_LOG2); + h->magic = VasEBoot_MM_ALLOC_MAGIC; + r->size += h->size << VasEBoot_MM_ALIGN_LOG2; + r->pre_size &= (VasEBoot_MM_ALIGN - 1); *p = r; - grub_free (h + 1); + VasEBoot_free (h + 1); } *p = r; return; } /* Allocate a region from the head. */ - r = (grub_mm_region_t) ALIGN_UP ((grub_addr_t) addr, GRUB_MM_ALIGN); + r = (VasEBoot_mm_region_t) ALIGN_UP ((VasEBoot_addr_t) addr, VasEBoot_MM_ALIGN); /* If this region is too small, ignore it. */ - if (size < GRUB_MM_ALIGN + (char *) r - (char *) addr + sizeof (*r)) + if (size < VasEBoot_MM_ALIGN + (char *) r - (char *) addr + sizeof (*r)) return; size -= (char *) r - (char *) addr + sizeof (*r); - h = (grub_mm_header_t) (r + 1); + h = (VasEBoot_mm_header_t) (r + 1); h->next = h; - h->magic = GRUB_MM_FREE_MAGIC; - h->size = (size >> GRUB_MM_ALIGN_LOG2); + h->magic = VasEBoot_MM_FREE_MAGIC; + h->size = (size >> VasEBoot_MM_ALIGN_LOG2); r->first = h; - r->pre_size = (grub_addr_t) r - (grub_addr_t) addr; - r->size = (h->size << GRUB_MM_ALIGN_LOG2); + r->pre_size = (VasEBoot_addr_t) r - (VasEBoot_addr_t) addr; + r->size = (h->size << VasEBoot_MM_ALIGN_LOG2); /* Find where to insert this region. Put a smaller one before bigger ones, to prevent fragmentation. */ - for (p = &grub_mm_base, q = *p; q; p = &(q->next), q = *p) + for (p = &VasEBoot_mm_base, q = *p; q; p = &(q->next), q = *p) if (q->size > r->size) break; @@ -177,32 +177,32 @@ grub_mm_init_region (void *addr, grub_size_t size) /* Allocate the number of units N with the alignment ALIGN from the ring buffer starting from *FIRST. ALIGN must be a power of two. Both N and - ALIGN are in units of GRUB_MM_ALIGN. Return a non-NULL if successful, + ALIGN are in units of VasEBoot_MM_ALIGN. Return a non-NULL if successful, otherwise return NULL. */ static void * -grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) +VasEBoot_real_malloc (VasEBoot_mm_header_t *first, VasEBoot_size_t n, VasEBoot_size_t align) { - grub_mm_header_t p, q; + VasEBoot_mm_header_t p, q; /* When everything is allocated side effect is that *first will have alloc magic marked, meaning that there is no room in this region. */ - if ((*first)->magic == GRUB_MM_ALLOC_MAGIC) + if ((*first)->magic == VasEBoot_MM_ALLOC_MAGIC) return 0; /* Try to search free slot for allocation in this memory region. */ for (q = *first, p = q->next; ; q = p, p = p->next) { - grub_off_t extra; + VasEBoot_off_t extra; - extra = ((grub_addr_t) (p + 1) >> GRUB_MM_ALIGN_LOG2) & (align - 1); + extra = ((VasEBoot_addr_t) (p + 1) >> VasEBoot_MM_ALIGN_LOG2) & (align - 1); if (extra) extra = align - extra; if (! p) - grub_fatal ("null in the ring"); + VasEBoot_fatal ("null in the ring"); - if (p->magic != GRUB_MM_FREE_MAGIC) - grub_fatal ("free magic is broken at %p: 0x%x", p, p->magic); + if (p->magic != VasEBoot_MM_FREE_MAGIC) + VasEBoot_fatal ("free magic is broken at %p: 0x%x", p, p->magic); if (p->size >= n + extra) { @@ -245,10 +245,10 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) } else if (extra == 0) { - grub_mm_header_t r; + VasEBoot_mm_header_t r; r = p + extra + n; - r->magic = GRUB_MM_FREE_MAGIC; + r->magic = VasEBoot_MM_FREE_MAGIC; r->size = p->size - extra - n; r->next = p->next; q->next = r; @@ -280,10 +280,10 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) | free, size=orig.size-extra-n | <------+, next --+ +------------------------------+ v */ - grub_mm_header_t r; + VasEBoot_mm_header_t r; r = p + extra + n; - r->magic = GRUB_MM_FREE_MAGIC; + r->magic = VasEBoot_MM_FREE_MAGIC; r->size = p->size - extra - n; r->next = p; @@ -292,14 +292,14 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) p += extra; } - p->magic = GRUB_MM_ALLOC_MAGIC; + p->magic = VasEBoot_MM_ALLOC_MAGIC; p->size = n; /* Mark find as a start marker for next allocation to fasten it. This will have side effect of fragmenting memory as small pieces before this will be un-used. */ /* So do it only for chunks under 64K. */ - if (n < (0x8000 >> GRUB_MM_ALIGN_LOG2) + if (n < (0x8000 >> VasEBoot_MM_ALIGN_LOG2) || *first == p) *first = q; @@ -316,35 +316,35 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) /* Allocate SIZE bytes with the alignment ALIGN and return the pointer. */ void * -grub_memalign (grub_size_t align, grub_size_t size) +VasEBoot_memalign (VasEBoot_size_t align, VasEBoot_size_t size) { - grub_mm_region_t r; - grub_size_t n = ((size + GRUB_MM_ALIGN - 1) >> GRUB_MM_ALIGN_LOG2) + 1; + VasEBoot_mm_region_t r; + VasEBoot_size_t n = ((size + VasEBoot_MM_ALIGN - 1) >> VasEBoot_MM_ALIGN_LOG2) + 1; int count = 0; - if (!grub_mm_base) + if (!VasEBoot_mm_base) goto fail; - if (size > ~(grub_size_t) align) + if (size > ~(VasEBoot_size_t) align) goto fail; - /* We currently assume at least a 32-bit grub_size_t, + /* We currently assume at least a 32-bit VasEBoot_size_t, so limiting allocations to - 1MiB in name of sanity is beneficial. */ - if ((size + align) > ~(grub_size_t) 0x100000) + if ((size + align) > ~(VasEBoot_size_t) 0x100000) goto fail; - align = (align >> GRUB_MM_ALIGN_LOG2); + align = (align >> VasEBoot_MM_ALIGN_LOG2); if (align == 0) align = 1; again: - for (r = grub_mm_base; r; r = r->next) + for (r = VasEBoot_mm_base; r; r = r->next) { void *p; - p = grub_real_malloc (&(r->first), n, align); + p = VasEBoot_real_malloc (&(r->first), n, align); if (p) return p; } @@ -354,14 +354,14 @@ grub_memalign (grub_size_t align, grub_size_t size) { case 0: /* Invalidate disk caches. */ - grub_disk_cache_invalidate_all (); + VasEBoot_disk_cache_invalidate_all (); count++; goto again; #if 0 case 1: /* Unload unneeded modules. */ - grub_dl_unload_unneeded (); + VasEBoot_dl_unload_unneeded (); count++; goto again; #endif @@ -371,57 +371,57 @@ grub_memalign (grub_size_t align, grub_size_t size) } fail: - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return 0; } /* Allocate SIZE bytes and return the pointer. */ void * -grub_malloc (grub_size_t size) +VasEBoot_malloc (VasEBoot_size_t size) { - return grub_memalign (0, size); + return VasEBoot_memalign (0, size); } /* Allocate SIZE bytes, clear them and return the pointer. */ void * -grub_zalloc (grub_size_t size) +VasEBoot_zalloc (VasEBoot_size_t size) { void *ret; - ret = grub_memalign (0, size); + ret = VasEBoot_memalign (0, size); if (ret) - grub_memset (ret, 0, size); + VasEBoot_memset (ret, 0, size); return ret; } /* Deallocate the pointer PTR. */ void -grub_free (void *ptr) +VasEBoot_free (void *ptr) { - grub_mm_header_t p; - grub_mm_region_t r; + VasEBoot_mm_header_t p; + VasEBoot_mm_region_t r; if (! ptr) return; get_header_from_pointer (ptr, &p, &r); - if (r->first->magic == GRUB_MM_ALLOC_MAGIC) + if (r->first->magic == VasEBoot_MM_ALLOC_MAGIC) { - p->magic = GRUB_MM_FREE_MAGIC; + p->magic = VasEBoot_MM_FREE_MAGIC; r->first = p->next = p; } else { - grub_mm_header_t q, s; + VasEBoot_mm_header_t q, s; #if 0 q = r->first; do { - grub_printf ("%s:%d: q=%p, q->size=0x%x, q->magic=0x%x\n", - GRUB_FILE, __LINE__, q, q->size, q->magic); + VasEBoot_printf ("%s:%d: q=%p, q->size=0x%x, q->magic=0x%x\n", + VasEBoot_FILE, __LINE__, q, q->size, q->magic); q = q->next; } while (q != r->first); @@ -429,14 +429,14 @@ grub_free (void *ptr) for (s = r->first, q = s->next; q <= p || q->next >= p; s = q, q = s->next) { - if (q->magic != GRUB_MM_FREE_MAGIC) - grub_fatal ("free magic is broken at %p: 0x%x", q, q->magic); + if (q->magic != VasEBoot_MM_FREE_MAGIC) + VasEBoot_fatal ("free magic is broken at %p: 0x%x", q, q->magic); if (q <= q->next && (q > p || q->next < p)) break; } - p->magic = GRUB_MM_FREE_MAGIC; + p->magic = VasEBoot_MM_FREE_MAGIC; p->next = q->next; q->next = p; @@ -468,156 +468,156 @@ grub_free (void *ptr) /* Reallocate SIZE bytes and return the pointer. The contents will be the same as that of PTR. */ void * -grub_realloc (void *ptr, grub_size_t size) +VasEBoot_realloc (void *ptr, VasEBoot_size_t size) { - grub_mm_header_t p; - grub_mm_region_t r; + VasEBoot_mm_header_t p; + VasEBoot_mm_region_t r; void *q; - grub_size_t n; + VasEBoot_size_t n; if (! ptr) - return grub_malloc (size); + return VasEBoot_malloc (size); if (! size) { - grub_free (ptr); + VasEBoot_free (ptr); return 0; } /* FIXME: Not optimal. */ - n = ((size + GRUB_MM_ALIGN - 1) >> GRUB_MM_ALIGN_LOG2) + 1; + n = ((size + VasEBoot_MM_ALIGN - 1) >> VasEBoot_MM_ALIGN_LOG2) + 1; get_header_from_pointer (ptr, &p, &r); if (p->size >= n) return ptr; - q = grub_malloc (size); + q = VasEBoot_malloc (size); if (! q) return q; /* We've already checked that p->size < n. */ - grub_memcpy (q, ptr, p->size << GRUB_MM_ALIGN_LOG2); - grub_free (ptr); + VasEBoot_memcpy (q, ptr, p->size << VasEBoot_MM_ALIGN_LOG2); + VasEBoot_free (ptr); return q; } #ifdef MM_DEBUG -int grub_mm_debug = 0; +int VasEBoot_mm_debug = 0; void -grub_mm_dump_free (void) +VasEBoot_mm_dump_free (void) { - grub_mm_region_t r; + VasEBoot_mm_region_t r; - for (r = grub_mm_base; r; r = r->next) + for (r = VasEBoot_mm_base; r; r = r->next) { - grub_mm_header_t p; + VasEBoot_mm_header_t p; /* Follow the free list. */ p = r->first; do { - if (p->magic != GRUB_MM_FREE_MAGIC) - grub_fatal ("free magic is broken at %p: 0x%x", p, p->magic); + if (p->magic != VasEBoot_MM_FREE_MAGIC) + VasEBoot_fatal ("free magic is broken at %p: 0x%x", p, p->magic); - grub_printf ("F:%p:%u:%p\n", - p, (unsigned int) p->size << GRUB_MM_ALIGN_LOG2, p->next); + VasEBoot_printf ("F:%p:%u:%p\n", + p, (unsigned int) p->size << VasEBoot_MM_ALIGN_LOG2, p->next); p = p->next; } while (p != r->first); } - grub_printf ("\n"); + VasEBoot_printf ("\n"); } void -grub_mm_dump (unsigned lineno) +VasEBoot_mm_dump (unsigned lineno) { - grub_mm_region_t r; + VasEBoot_mm_region_t r; - grub_printf ("called at line %u\n", lineno); - for (r = grub_mm_base; r; r = r->next) + VasEBoot_printf ("called at line %u\n", lineno); + for (r = VasEBoot_mm_base; r; r = r->next) { - grub_mm_header_t p; + VasEBoot_mm_header_t p; - for (p = (grub_mm_header_t) ALIGN_UP ((grub_addr_t) (r + 1), - GRUB_MM_ALIGN); - (grub_addr_t) p < (grub_addr_t) (r+1) + r->size; + for (p = (VasEBoot_mm_header_t) ALIGN_UP ((VasEBoot_addr_t) (r + 1), + VasEBoot_MM_ALIGN); + (VasEBoot_addr_t) p < (VasEBoot_addr_t) (r+1) + r->size; p++) { switch (p->magic) { - case GRUB_MM_FREE_MAGIC: - grub_printf ("F:%p:%u:%p\n", - p, (unsigned int) p->size << GRUB_MM_ALIGN_LOG2, p->next); + case VasEBoot_MM_FREE_MAGIC: + VasEBoot_printf ("F:%p:%u:%p\n", + p, (unsigned int) p->size << VasEBoot_MM_ALIGN_LOG2, p->next); break; - case GRUB_MM_ALLOC_MAGIC: - grub_printf ("A:%p:%u\n", p, (unsigned int) p->size << GRUB_MM_ALIGN_LOG2); + case VasEBoot_MM_ALLOC_MAGIC: + VasEBoot_printf ("A:%p:%u\n", p, (unsigned int) p->size << VasEBoot_MM_ALIGN_LOG2); break; } } } - grub_printf ("\n"); + VasEBoot_printf ("\n"); } void * -grub_debug_malloc (const char *file, int line, grub_size_t size) +VasEBoot_debug_malloc (const char *file, int line, VasEBoot_size_t size) { void *ptr; - if (grub_mm_debug) - grub_printf ("%s:%d: malloc (0x%" PRIxGRUB_SIZE ") = ", file, line, size); - ptr = grub_malloc (size); - if (grub_mm_debug) - grub_printf ("%p\n", ptr); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%s:%d: malloc (0x%" PRIxVasEBoot_SIZE ") = ", file, line, size); + ptr = VasEBoot_malloc (size); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%p\n", ptr); return ptr; } void * -grub_debug_zalloc (const char *file, int line, grub_size_t size) +VasEBoot_debug_zalloc (const char *file, int line, VasEBoot_size_t size) { void *ptr; - if (grub_mm_debug) - grub_printf ("%s:%d: zalloc (0x%" PRIxGRUB_SIZE ") = ", file, line, size); - ptr = grub_zalloc (size); - if (grub_mm_debug) - grub_printf ("%p\n", ptr); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%s:%d: zalloc (0x%" PRIxVasEBoot_SIZE ") = ", file, line, size); + ptr = VasEBoot_zalloc (size); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%p\n", ptr); return ptr; } void -grub_debug_free (const char *file, int line, void *ptr) +VasEBoot_debug_free (const char *file, int line, void *ptr) { - if (grub_mm_debug) - grub_printf ("%s:%d: free (%p)\n", file, line, ptr); - grub_free (ptr); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%s:%d: free (%p)\n", file, line, ptr); + VasEBoot_free (ptr); } void * -grub_debug_realloc (const char *file, int line, void *ptr, grub_size_t size) +VasEBoot_debug_realloc (const char *file, int line, void *ptr, VasEBoot_size_t size) { - if (grub_mm_debug) - grub_printf ("%s:%d: realloc (%p, 0x%" PRIxGRUB_SIZE ") = ", file, line, ptr, size); - ptr = grub_realloc (ptr, size); - if (grub_mm_debug) - grub_printf ("%p\n", ptr); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%s:%d: realloc (%p, 0x%" PRIxVasEBoot_SIZE ") = ", file, line, ptr, size); + ptr = VasEBoot_realloc (ptr, size); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%p\n", ptr); return ptr; } void * -grub_debug_memalign (const char *file, int line, grub_size_t align, - grub_size_t size) +VasEBoot_debug_memalign (const char *file, int line, VasEBoot_size_t align, + VasEBoot_size_t size) { void *ptr; - if (grub_mm_debug) - grub_printf ("%s:%d: memalign (0x%" PRIxGRUB_SIZE ", 0x%" PRIxGRUB_SIZE + if (VasEBoot_mm_debug) + VasEBoot_printf ("%s:%d: memalign (0x%" PRIxVasEBoot_SIZE ", 0x%" PRIxVasEBoot_SIZE ") = ", file, line, align, size); - ptr = grub_memalign (align, size); - if (grub_mm_debug) - grub_printf ("%p\n", ptr); + ptr = VasEBoot_memalign (align, size); + if (VasEBoot_mm_debug) + VasEBoot_printf ("%p\n", ptr); return ptr; } diff --git a/VasEBoot-core/kern/parser.c b/VasEBoot-core/kern/parser.c index 78175aac2..cfab70f38 100644 --- a/VasEBoot-core/kern/parser.c +++ b/VasEBoot-core/kern/parser.c @@ -1,67 +1,67 @@ /* parser.c - the part of the parser that can return partial tokens */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* All the possible state transitions on the command line. If a transition can not be found, it is assumed that there is no transition and keep_value is assumed to be 1. */ -static struct grub_parser_state_transition state_transitions[] = { - {GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_QUOTE, '\'', 0}, - {GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_DQUOTE, '\"', 0}, - {GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_VAR, '$', 0}, - {GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_ESC, '\\', 0}, +static struct VasEBoot_parser_state_transition state_transitions[] = { + {VasEBoot_PARSER_STATE_TEXT, VasEBoot_PARSER_STATE_QUOTE, '\'', 0}, + {VasEBoot_PARSER_STATE_TEXT, VasEBoot_PARSER_STATE_DQUOTE, '\"', 0}, + {VasEBoot_PARSER_STATE_TEXT, VasEBoot_PARSER_STATE_VAR, '$', 0}, + {VasEBoot_PARSER_STATE_TEXT, VasEBoot_PARSER_STATE_ESC, '\\', 0}, - {GRUB_PARSER_STATE_ESC, GRUB_PARSER_STATE_TEXT, 0, 1}, + {VasEBoot_PARSER_STATE_ESC, VasEBoot_PARSER_STATE_TEXT, 0, 1}, - {GRUB_PARSER_STATE_QUOTE, GRUB_PARSER_STATE_TEXT, '\'', 0}, + {VasEBoot_PARSER_STATE_QUOTE, VasEBoot_PARSER_STATE_TEXT, '\'', 0}, - {GRUB_PARSER_STATE_DQUOTE, GRUB_PARSER_STATE_TEXT, '\"', 0}, - {GRUB_PARSER_STATE_DQUOTE, GRUB_PARSER_STATE_QVAR, '$', 0}, + {VasEBoot_PARSER_STATE_DQUOTE, VasEBoot_PARSER_STATE_TEXT, '\"', 0}, + {VasEBoot_PARSER_STATE_DQUOTE, VasEBoot_PARSER_STATE_QVAR, '$', 0}, - {GRUB_PARSER_STATE_VAR, GRUB_PARSER_STATE_VARNAME2, '{', 0}, - {GRUB_PARSER_STATE_VAR, GRUB_PARSER_STATE_VARNAME, 0, 1}, - {GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, ' ', 1}, - {GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, '\t', 1}, - {GRUB_PARSER_STATE_VARNAME2, GRUB_PARSER_STATE_TEXT, '}', 0}, + {VasEBoot_PARSER_STATE_VAR, VasEBoot_PARSER_STATE_VARNAME2, '{', 0}, + {VasEBoot_PARSER_STATE_VAR, VasEBoot_PARSER_STATE_VARNAME, 0, 1}, + {VasEBoot_PARSER_STATE_VARNAME, VasEBoot_PARSER_STATE_TEXT, ' ', 1}, + {VasEBoot_PARSER_STATE_VARNAME, VasEBoot_PARSER_STATE_TEXT, '\t', 1}, + {VasEBoot_PARSER_STATE_VARNAME2, VasEBoot_PARSER_STATE_TEXT, '}', 0}, - {GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME2, '{', 0}, - {GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME, 0, 1}, - {GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_TEXT, '\"', 0}, - {GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, ' ', 1}, - {GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, '\t', 1}, - {GRUB_PARSER_STATE_QVARNAME2, GRUB_PARSER_STATE_DQUOTE, '}', 0}, + {VasEBoot_PARSER_STATE_QVAR, VasEBoot_PARSER_STATE_QVARNAME2, '{', 0}, + {VasEBoot_PARSER_STATE_QVAR, VasEBoot_PARSER_STATE_QVARNAME, 0, 1}, + {VasEBoot_PARSER_STATE_QVARNAME, VasEBoot_PARSER_STATE_TEXT, '\"', 0}, + {VasEBoot_PARSER_STATE_QVARNAME, VasEBoot_PARSER_STATE_DQUOTE, ' ', 1}, + {VasEBoot_PARSER_STATE_QVARNAME, VasEBoot_PARSER_STATE_DQUOTE, '\t', 1}, + {VasEBoot_PARSER_STATE_QVARNAME2, VasEBoot_PARSER_STATE_DQUOTE, '}', 0}, {0, 0, 0, 0} }; /* Determines the state following STATE, determined by C. */ -grub_parser_state_t -grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) +VasEBoot_parser_state_t +VasEBoot_parser_cmdline_state (VasEBoot_parser_state_t state, char c, char *result) { - struct grub_parser_state_transition *transition; - struct grub_parser_state_transition default_transition; + struct VasEBoot_parser_state_transition *transition; + struct VasEBoot_parser_state_transition default_transition; default_transition.to_state = state; default_transition.keep_value = 1; @@ -75,8 +75,8 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) if (transition->input == c) break; - if (grub_isspace (transition->input) && !grub_isalpha (c) - && !grub_isdigit (c) && c != '_') + if (VasEBoot_isspace (transition->input) && !VasEBoot_isalpha (c) + && !VasEBoot_isdigit (c) && c != '_') break; /* A less perfect match was found, use this one if no exact @@ -96,20 +96,20 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) } -/* Helper for grub_parser_split_cmdline. */ +/* Helper for VasEBoot_parser_split_cmdline. */ static inline int -check_varstate (grub_parser_state_t s) +check_varstate (VasEBoot_parser_state_t s) { - return (s == GRUB_PARSER_STATE_VARNAME - || s == GRUB_PARSER_STATE_VARNAME2 - || s == GRUB_PARSER_STATE_QVARNAME - || s == GRUB_PARSER_STATE_QVARNAME2); + return (s == VasEBoot_PARSER_STATE_VARNAME + || s == VasEBoot_PARSER_STATE_VARNAME2 + || s == VasEBoot_PARSER_STATE_QVARNAME + || s == VasEBoot_PARSER_STATE_QVARNAME2); } static void add_var (char *varname, char **bp, char **vp, - grub_parser_state_t state, grub_parser_state_t newstate) + VasEBoot_parser_state_t state, VasEBoot_parser_state_t newstate) { const char *val; @@ -119,7 +119,7 @@ add_var (char *varname, char **bp, char **vp, return; *((*vp)++) = '\0'; - val = grub_env_get (varname); + val = VasEBoot_env_get (varname); *vp = varname; if (!val) return; @@ -129,12 +129,12 @@ add_var (char *varname, char **bp, char **vp, *((*bp)++) = *val; } -grub_err_t -grub_parser_split_cmdline (const char *cmdline, - grub_reader_getline_t getline, void *getline_data, +VasEBoot_err_t +VasEBoot_parser_split_cmdline (const char *cmdline, + VasEBoot_reader_getline_t getline, void *getline_data, int *argc, char ***argv) { - grub_parser_state_t state = GRUB_PARSER_STATE_TEXT; + VasEBoot_parser_state_t state = VasEBoot_PARSER_STATE_TEXT; /* XXX: Fixed size buffer, perhaps this buffer should be dynamically allocated. */ char buffer[1024]; @@ -161,10 +161,10 @@ grub_parser_split_cmdline (const char *cmdline, for (; *rd; rd++) { - grub_parser_state_t newstate; + VasEBoot_parser_state_t newstate; char use; - newstate = grub_parser_cmdline_state (state, *rd, &use); + newstate = VasEBoot_parser_cmdline_state (state, *rd, &use); /* If a variable was being processed and this character does not describe the variable anymore, write the variable to @@ -178,8 +178,8 @@ grub_parser_split_cmdline (const char *cmdline, } else { - if (newstate == GRUB_PARSER_STATE_TEXT - && state != GRUB_PARSER_STATE_ESC && grub_isspace (use)) + if (newstate == VasEBoot_PARSER_STATE_TEXT + && state != VasEBoot_PARSER_STATE_ESC && VasEBoot_isspace (use)) { /* Don't add more than one argument if multiple spaces are used. */ @@ -195,11 +195,11 @@ grub_parser_split_cmdline (const char *cmdline, state = newstate; } } - while (state != GRUB_PARSER_STATE_TEXT && !check_varstate (state)); + while (state != VasEBoot_PARSER_STATE_TEXT && !check_varstate (state)); /* A special case for when the last character was part of a variable. */ - add_var (varname, &bp, &vp, state, GRUB_PARSER_STATE_TEXT); + add_var (varname, &bp, &vp, state, VasEBoot_PARSER_STATE_TEXT); if (bp != buffer && *(bp - 1)) { @@ -208,16 +208,16 @@ grub_parser_split_cmdline (const char *cmdline, } /* Reserve memory for the return values. */ - args = grub_malloc (bp - buffer); + args = VasEBoot_malloc (bp - buffer); if (!args) - return grub_errno; - grub_memcpy (args, buffer, bp - buffer); + return VasEBoot_errno; + VasEBoot_memcpy (args, buffer, bp - buffer); - *argv = grub_malloc (sizeof (char *) * (*argc + 1)); + *argv = VasEBoot_malloc (sizeof (char *) * (*argc + 1)); if (!*argv) { - grub_free (args); - return grub_errno; + VasEBoot_free (args); + return VasEBoot_errno; } /* The arguments are separated with 0's, setup argv so it points to @@ -234,9 +234,9 @@ grub_parser_split_cmdline (const char *cmdline, return 0; } -/* Helper for grub_parser_execute. */ -static grub_err_t -grub_parser_execute_getline (char **line, int cont __attribute__ ((unused)), +/* Helper for VasEBoot_parser_execute. */ +static VasEBoot_err_t +VasEBoot_parser_execute_getline (char **line, int cont __attribute__ ((unused)), void *data) { char **source = data; @@ -248,28 +248,28 @@ grub_parser_execute_getline (char **line, int cont __attribute__ ((unused)), return 0; } - p = grub_strchr (*source, '\n'); + p = VasEBoot_strchr (*source, '\n'); if (p) - *line = grub_strndup (*source, p - *source); + *line = VasEBoot_strndup (*source, p - *source); else - *line = grub_strdup (*source); + *line = VasEBoot_strdup (*source); *source = p ? p + 1 : 0; return 0; } -grub_err_t -grub_parser_execute (char *source) +VasEBoot_err_t +VasEBoot_parser_execute (char *source) { while (source) { char *line; - grub_parser_execute_getline (&line, 0, &source); - grub_rescue_parse_line (line, grub_parser_execute_getline, &source); - grub_free (line); - grub_print_error (); + VasEBoot_parser_execute_getline (&line, 0, &source); + VasEBoot_rescue_parse_line (line, VasEBoot_parser_execute_getline, &source); + VasEBoot_free (line); + VasEBoot_print_error (); } - return grub_errno; + return VasEBoot_errno; } diff --git a/VasEBoot-core/kern/partition.c b/VasEBoot-core/kern/partition.c index e499147cb..1a16fa4b8 100644 --- a/VasEBoot-core/kern/partition.c +++ b/VasEBoot-core/kern/partition.c @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include #endif -grub_partition_map_t grub_partition_map_list; +VasEBoot_partition_map_t VasEBoot_partition_map_list; /* * Checks that disk->partition contains part. This function assumes that the @@ -34,8 +34,8 @@ grub_partition_map_t grub_partition_map_list; * disk->partition is null. */ static int -grub_partition_check_containment (const grub_disk_t disk, - const grub_partition_t part) +VasEBoot_partition_check_containment (const VasEBoot_disk_t disk, + const VasEBoot_partition_t part) { if (disk->partition == NULL) return 1; @@ -44,14 +44,14 @@ grub_partition_check_containment (const grub_disk_t disk, { char *partname; - partname = grub_partition_get_name (disk->partition); - grub_dprintf ("partition", "sub-partition %s%d of (%s,%s) ends after parent.\n", + partname = VasEBoot_partition_get_name (disk->partition); + VasEBoot_dprintf ("partition", "sub-partition %s%d of (%s,%s) ends after parent.\n", part->partmap->name, part->number + 1, disk->name, partname); -#ifdef GRUB_UTIL - grub_util_warn (_("Discarding improperly nested partition (%s,%s,%s%d)"), +#ifdef VasEBoot_UTIL + VasEBoot_util_warn (_("Discarding improperly nested partition (%s,%s,%s%d)"), disk->name, partname, part->partmap->name, part->number + 1); #endif - grub_free (partname); + VasEBoot_free (partname); return 0; } @@ -59,94 +59,94 @@ grub_partition_check_containment (const grub_disk_t disk, return 1; } -/* Context for grub_partition_map_probe. */ -struct grub_partition_map_probe_ctx +/* Context for VasEBoot_partition_map_probe. */ +struct VasEBoot_partition_map_probe_ctx { int partnum; - grub_partition_t p; + VasEBoot_partition_t p; }; -/* Helper for grub_partition_map_probe. */ +/* Helper for VasEBoot_partition_map_probe. */ static int -probe_iter (grub_disk_t dsk, const grub_partition_t partition, void *data) +probe_iter (VasEBoot_disk_t dsk, const VasEBoot_partition_t partition, void *data) { - struct grub_partition_map_probe_ctx *ctx = data; + struct VasEBoot_partition_map_probe_ctx *ctx = data; if (ctx->partnum != partition->number) return 0; - if (!(grub_partition_check_containment (dsk, partition))) + if (!(VasEBoot_partition_check_containment (dsk, partition))) return 0; - ctx->p = (grub_partition_t) grub_malloc (sizeof (*ctx->p)); + ctx->p = (VasEBoot_partition_t) VasEBoot_malloc (sizeof (*ctx->p)); if (! ctx->p) return 1; - grub_memcpy (ctx->p, partition, sizeof (*ctx->p)); + VasEBoot_memcpy (ctx->p, partition, sizeof (*ctx->p)); return 1; } -static grub_partition_t -grub_partition_map_probe (const grub_partition_map_t partmap, - grub_disk_t disk, int partnum) +static VasEBoot_partition_t +VasEBoot_partition_map_probe (const VasEBoot_partition_map_t partmap, + VasEBoot_disk_t disk, int partnum) { - struct grub_partition_map_probe_ctx ctx = { + struct VasEBoot_partition_map_probe_ctx ctx = { .partnum = partnum, .p = 0 }; partmap->iterate (disk, probe_iter, &ctx); - if (grub_errno) + if (VasEBoot_errno) goto fail; return ctx.p; fail: - grub_free (ctx.p); + VasEBoot_free (ctx.p); return 0; } -grub_partition_t -grub_partition_probe (struct grub_disk *disk, const char *str) +VasEBoot_partition_t +VasEBoot_partition_probe (struct VasEBoot_disk *disk, const char *str) { - grub_partition_t part = 0; - grub_partition_t curpart = 0; - grub_partition_t tail; + VasEBoot_partition_t part = 0; + VasEBoot_partition_t curpart = 0; + VasEBoot_partition_t tail; const char *ptr; part = tail = disk->partition; for (ptr = str; *ptr;) { - grub_partition_map_t partmap; + VasEBoot_partition_map_t partmap; int num; const char *partname, *partname_end; partname = ptr; - while (*ptr && grub_isalpha (*ptr)) + while (*ptr && VasEBoot_isalpha (*ptr)) ptr++; partname_end = ptr; - num = grub_strtoul (ptr, (char **) &ptr, 0) - 1; + num = VasEBoot_strtoul (ptr, (char **) &ptr, 0) - 1; curpart = 0; /* Use the first partition map type found. */ FOR_PARTITION_MAPS(partmap) { if (partname_end != partname && - (grub_strncmp (partmap->name, partname, partname_end - partname) + (VasEBoot_strncmp (partmap->name, partname, partname_end - partname) != 0 || partmap->name[partname_end - partname] != 0)) continue; disk->partition = part; - curpart = grub_partition_map_probe (partmap, disk, num); + curpart = VasEBoot_partition_map_probe (partmap, disk, num); disk->partition = tail; if (curpart) break; - if (grub_errno == GRUB_ERR_BAD_PART_TABLE) + if (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE) { /* Continue to next partition map type. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } @@ -158,7 +158,7 @@ grub_partition_probe (struct grub_disk *disk, const char *str) while (part) { curpart = part->parent; - grub_free (part); + VasEBoot_free (part); part = curpart; } return 0; @@ -173,22 +173,22 @@ grub_partition_probe (struct grub_disk *disk, const char *str) return part; } -/* Context for grub_partition_iterate. */ -struct grub_partition_iterate_ctx +/* Context for VasEBoot_partition_iterate. */ +struct VasEBoot_partition_iterate_ctx { int ret; - grub_partition_iterate_hook_t hook; + VasEBoot_partition_iterate_hook_t hook; void *hook_data; }; -/* Helper for grub_partition_iterate. */ +/* Helper for VasEBoot_partition_iterate. */ static int -part_iterate (grub_disk_t dsk, const grub_partition_t partition, void *data) +part_iterate (VasEBoot_disk_t dsk, const VasEBoot_partition_t partition, void *data) { - struct grub_partition_iterate_ctx *ctx = data; - struct grub_partition p = *partition; + struct VasEBoot_partition_iterate_ctx *ctx = data; + struct VasEBoot_partition p = *partition; - if (!(grub_partition_check_containment (dsk, partition))) + if (!(VasEBoot_partition_check_containment (dsk, partition))) return 0; p.parent = dsk->partition; @@ -200,14 +200,14 @@ part_iterate (grub_disk_t dsk, const grub_partition_t partition, void *data) } if (p.start != 0) { - const struct grub_partition_map *partmap; + const struct VasEBoot_partition_map *partmap; dsk->partition = &p; FOR_PARTITION_MAPS(partmap) { - grub_err_t err; + VasEBoot_err_t err; err = partmap->iterate (dsk, part_iterate, ctx); if (err) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; if (ctx->ret) break; } @@ -217,22 +217,22 @@ part_iterate (grub_disk_t dsk, const grub_partition_t partition, void *data) } int -grub_partition_iterate (struct grub_disk *disk, - grub_partition_iterate_hook_t hook, void *hook_data) +VasEBoot_partition_iterate (struct VasEBoot_disk *disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition_iterate_ctx ctx = { + struct VasEBoot_partition_iterate_ctx ctx = { .ret = 0, .hook = hook, .hook_data = hook_data }; - const struct grub_partition_map *partmap; + const struct VasEBoot_partition_map *partmap; FOR_PARTITION_MAPS(partmap) { - grub_err_t err; + VasEBoot_err_t err; err = partmap->iterate (disk, part_iterate, &ctx); if (err) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; if (ctx.ret) break; } @@ -241,18 +241,18 @@ grub_partition_iterate (struct grub_disk *disk, } char * -grub_partition_get_name (const grub_partition_t partition) +VasEBoot_partition_get_name (const VasEBoot_partition_t partition) { char *out = 0, *ptr; - grub_size_t needlen = 0; - grub_partition_t part; + VasEBoot_size_t needlen = 0; + VasEBoot_partition_t part; if (!partition) - return grub_strdup (""); + return VasEBoot_strdup (""); for (part = partition; part; part = part->parent) /* Even on 64-bit machines this buffer is enough to hold longest number. */ - needlen += grub_strlen (part->partmap->name) + 1 + 27; - out = grub_malloc (needlen + 1); + needlen += VasEBoot_strlen (part->partmap->name) + 1 + 27; + out = VasEBoot_malloc (needlen + 1); if (!out) return NULL; @@ -261,16 +261,16 @@ grub_partition_get_name (const grub_partition_t partition) for (part = partition; part; part = part->parent) { char buf[27]; - grub_size_t len; - grub_snprintf (buf, sizeof (buf), "%d", part->number + 1); - len = grub_strlen (buf); + VasEBoot_size_t len; + VasEBoot_snprintf (buf, sizeof (buf), "%d", part->number + 1); + len = VasEBoot_strlen (buf); ptr -= len; - grub_memcpy (ptr, buf, len); - len = grub_strlen (part->partmap->name); + VasEBoot_memcpy (ptr, buf, len); + len = VasEBoot_strlen (part->partmap->name); ptr -= len; - grub_memcpy (ptr, part->partmap->name, len); + VasEBoot_memcpy (ptr, part->partmap->name, len); *--ptr = ','; } - grub_memmove (out, ptr + 1, out + needlen - ptr); + VasEBoot_memmove (out, ptr + 1, out + needlen - ptr); return out; } diff --git a/VasEBoot-core/kern/powerpc/cache.S b/VasEBoot-core/kern/powerpc/cache.S index d85e68d42..33e99f98a 100644 --- a/VasEBoot-core/kern/powerpc/cache.S +++ b/VasEBoot-core/kern/powerpc/cache.S @@ -1,26 +1,26 @@ /* cache.S - Flush the processor cache for a specific region. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2007,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ .text .align 2 - .globl grub_arch_sync_caches -grub_arch_sync_caches: + .globl VasEBoot_arch_sync_caches +VasEBoot_arch_sync_caches: #include "cache_flush.S" blr diff --git a/VasEBoot-core/kern/powerpc/cache_flush.S b/VasEBoot-core/kern/powerpc/cache_flush.S index 1410f78b1..47164cef5 100644 --- a/VasEBoot-core/kern/powerpc/cache_flush.S +++ b/VasEBoot-core/kern/powerpc/cache_flush.S @@ -1,20 +1,20 @@ /* cache.S - Flush the processor cache for a specific region. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2007,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #undef CACHE_LINE_BYTES diff --git a/VasEBoot-core/kern/powerpc/compiler-rt.S b/VasEBoot-core/kern/powerpc/compiler-rt.S index b3b912db6..2a1463c2e 100644 --- a/VasEBoot-core/kern/powerpc/compiler-rt.S +++ b/VasEBoot-core/kern/powerpc/compiler-rt.S @@ -27,8 +27,8 @@ /* Do any initializations needed for the eabi environment */ -#include -#include +#include +#include .section ".text" diff --git a/VasEBoot-core/kern/powerpc/dl.c b/VasEBoot-core/kern/powerpc/dl.c index 3a7fa3ed3..86e99cb4a 100644 --- a/VasEBoot-core/kern/powerpc/dl.c +++ b/VasEBoot-core/kern/powerpc/dl.c @@ -1,31 +1,31 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; @@ -33,18 +33,18 @@ grub_arch_dl_check_header (void *ehdr) if (e->e_ident[EI_CLASS] != ELFCLASS32 || e->e_ident[EI_DATA] != ELFDATA2MSB || e->e_machine != EM_PPC) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* For low-endian reverse lis and addr_high as well as ori and addr_low. */ struct trampoline { - grub_uint32_t lis; - grub_uint32_t ori; - grub_uint32_t mtctr; - grub_uint32_t bctr; + VasEBoot_uint32_t lis; + VasEBoot_uint32_t ori; + VasEBoot_uint32_t mtctr; + VasEBoot_uint32_t bctr; }; static const struct trampoline trampoline_template = @@ -57,9 +57,9 @@ static const struct trampoline trampoline_template = #pragma GCC diagnostic ignored "-Wcast-align" -grub_err_t -grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got) +VasEBoot_err_t +VasEBoot_arch_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got) { const Elf_Ehdr *e = ehdr; const Elf_Shdr *s; @@ -79,20 +79,20 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, max = rel + s->sh_size / s->sh_entsize; rel < max; rel++) - if (ELF_R_TYPE (rel->r_info) == GRUB_ELF_R_PPC_REL24) + if (ELF_R_TYPE (rel->r_info) == VasEBoot_ELF_R_PPC_REL24) (*tramp)++; } *tramp *= sizeof (struct trampoline); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Relocate symbols. */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf_Rela *rel, *max; @@ -103,10 +103,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { Elf_Word *addr; Elf_Sym *sym; - grub_uint32_t value; + VasEBoot_uint32_t value; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); addr = (Elf_Word *) ((char *) seg->addr + rel->r_offset); @@ -118,50 +118,50 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, value = sym->st_value + rel->r_addend; switch (ELF_R_TYPE (rel->r_info)) { - case GRUB_ELF_R_PPC_ADDR16_LO: + case VasEBoot_ELF_R_PPC_ADDR16_LO: *(Elf_Half *) addr = value; break; - case GRUB_ELF_R_PPC_REL24: + case VasEBoot_ELF_R_PPC_REL24: { Elf_Sword delta = value - (Elf_Word) addr; if (delta << 6 >> 6 != delta) { struct trampoline *tptr = mod->trampptr; - grub_memcpy (tptr, &trampoline_template, + VasEBoot_memcpy (tptr, &trampoline_template, sizeof (*tptr)); - delta = (grub_uint8_t *) tptr - (grub_uint8_t *) addr; + delta = (VasEBoot_uint8_t *) tptr - (VasEBoot_uint8_t *) addr; tptr->lis |= (((value) >> 16) & 0xffff); tptr->ori |= ((value) & 0xffff); mod->trampptr = tptr + 1; } if (delta << 6 >> 6 != delta) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "relocation overflow"); *addr = (*addr & 0xfc000003) | (delta & 0x3fffffc); break; } - case GRUB_ELF_R_PPC_ADDR16_HA: + case VasEBoot_ELF_R_PPC_ADDR16_HA: *(Elf_Half *) addr = (value + 0x8000) >> 16; break; - case GRUB_ELF_R_PPC_ADDR32: + case VasEBoot_ELF_R_PPC_ADDR32: *addr = value; break; - case GRUB_ELF_R_PPC_REL32: + case VasEBoot_ELF_R_PPC_REL32: *addr = value - (Elf_Word) addr; break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/powerpc/ieee1275/startup.S b/VasEBoot-core/kern/powerpc/ieee1275/startup.S index 21c884b43..b9084d63b 100644 --- a/VasEBoot-core/kern/powerpc/ieee1275/startup.S +++ b/VasEBoot-core/kern/powerpc/ieee1275/startup.S @@ -1,24 +1,24 @@ /* startup.S - Startup code for the PowerPC. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .extern __bss_start .extern _end @@ -59,9 +59,9 @@ _start: addi 6, 6, 1 bdnz 2b - /* Store r5 in grub_ieee1275_entry_fn. */ - lis 9, grub_ieee1275_entry_fn@ha - stw 5, grub_ieee1275_entry_fn@l(9) + /* Store r5 in VasEBoot_ieee1275_entry_fn. */ + lis 9, VasEBoot_ieee1275_entry_fn@ha + stw 5, VasEBoot_ieee1275_entry_fn@l(9) - bl grub_main + bl VasEBoot_main 1: b 1b diff --git a/VasEBoot-core/kern/rescue_parser.c b/VasEBoot-core/kern/rescue_parser.c index 633836699..dcc05a2e6 100644 --- a/VasEBoot-core/kern/rescue_parser.c +++ b/VasEBoot-core/kern/rescue_parser.c @@ -1,56 +1,56 @@ /* rescue_parser.c - rescue mode parser */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -grub_err_t -grub_rescue_parse_line (char *line, - grub_reader_getline_t getline, void *getline_data) +VasEBoot_err_t +VasEBoot_rescue_parse_line (char *line, + VasEBoot_reader_getline_t getline, void *getline_data) { char *name; int n; - grub_command_t cmd; + VasEBoot_command_t cmd; char **args; - if (grub_parser_split_cmdline (line, getline, getline_data, &n, &args) + if (VasEBoot_parser_split_cmdline (line, getline, getline_data, &n, &args) || n < 0) - return grub_errno; + return VasEBoot_errno; if (n == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; /* In case of an assignment set the environment accordingly instead of calling a function. */ if (n == 1) { - char *val = grub_strchr (args[0], '='); + char *val = VasEBoot_strchr (args[0], '='); if (val) { val[0] = 0; - grub_env_set (args[0], val + 1); + VasEBoot_env_set (args[0], val + 1); val[0] = '='; goto quit; } @@ -63,22 +63,22 @@ grub_rescue_parse_line (char *line, if (*name == '\0') goto quit; - cmd = grub_command_find (name); + cmd = VasEBoot_command_find (name); if (cmd) { (cmd->func) (cmd, n - 1, &args[1]); } else { - grub_printf_ (N_("Unknown command `%s'.\n"), name); - if (grub_command_find ("help")) - grub_printf ("Try `help' for usage\n"); + VasEBoot_printf_ (N_("Unknown command `%s'.\n"), name); + if (VasEBoot_command_find ("help")) + VasEBoot_printf ("Try `help' for usage\n"); } quit: /* Arguments are returned in single memory chunk separated by zeroes */ - grub_free (args[0]); - grub_free (args); + VasEBoot_free (args[0]); + VasEBoot_free (args); - return grub_errno; + return VasEBoot_errno; } diff --git a/VasEBoot-core/kern/rescue_reader.c b/VasEBoot-core/kern/rescue_reader.c index dcd7d4439..54c11ba90 100644 --- a/VasEBoot-core/kern/rescue_reader.c +++ b/VasEBoot-core/kern/rescue_reader.c @@ -1,55 +1,55 @@ /* rescue_reader.c - rescue mode reader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#define GRUB_RESCUE_BUF_SIZE 256 +#define VasEBoot_RESCUE_BUF_SIZE 256 -static char linebuf[GRUB_RESCUE_BUF_SIZE]; +static char linebuf[VasEBoot_RESCUE_BUF_SIZE]; /* Prompt to input a command and read the line. */ -static grub_err_t -grub_rescue_read_line (char **line, int cont, +static VasEBoot_err_t +VasEBoot_rescue_read_line (char **line, int cont, void *data __attribute__ ((unused))) { int c; int pos = 0; char str[4]; - grub_printf ((cont) ? "> " : "grub rescue> "); - grub_memset (linebuf, 0, GRUB_RESCUE_BUF_SIZE); + VasEBoot_printf ((cont) ? "> " : "VasEBoot rescue> "); + VasEBoot_memset (linebuf, 0, VasEBoot_RESCUE_BUF_SIZE); - while ((c = grub_getkey ()) != '\n' && c != '\r') + while ((c = VasEBoot_getkey ()) != '\n' && c != '\r') { - if (grub_isprint (c)) + if (VasEBoot_isprint (c)) { - if (pos < GRUB_RESCUE_BUF_SIZE - 1) + if (pos < VasEBoot_RESCUE_BUF_SIZE - 1) { str[0] = c; str[1] = 0; linebuf[pos++] = c; - grub_xputs (str); + VasEBoot_xputs (str); } } else if (c == '\b') @@ -61,38 +61,38 @@ grub_rescue_read_line (char **line, int cont, str[2] = c; str[3] = 0; linebuf[--pos] = 0; - grub_xputs (str); + VasEBoot_xputs (str); } } - grub_refresh (); + VasEBoot_refresh (); } - grub_xputs ("\n"); - grub_refresh (); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); - *line = grub_strdup (linebuf); + *line = VasEBoot_strdup (linebuf); return 0; } void __attribute__ ((noreturn)) -grub_rescue_run (void) +VasEBoot_rescue_run (void) { - grub_printf ("Entering rescue mode...\n"); + VasEBoot_printf ("Entering rescue mode...\n"); while (1) { char *line; /* Print an error, if any. */ - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_rescue_read_line (&line, 0, NULL); + VasEBoot_rescue_read_line (&line, 0, NULL); if (! line || line[0] == '\0') continue; - grub_rescue_parse_line (line, grub_rescue_read_line, NULL); - grub_free (line); + VasEBoot_rescue_parse_line (line, VasEBoot_rescue_read_line, NULL); + VasEBoot_free (line); } } diff --git a/VasEBoot-core/kern/sparc64/cache.S b/VasEBoot-core/kern/sparc64/cache.S index 1a16adde8..fe10686bc 100644 --- a/VasEBoot-core/kern/sparc64/cache.S +++ b/VasEBoot-core/kern/sparc64/cache.S @@ -1,32 +1,32 @@ /* cache.S - Flush the processor cache for a specific region. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .file "cache.S" .text /* - * void grub_arch_sync_caches (void *address, grub_size_t len) + * void VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) */ -FUNCTION(grub_arch_sync_caches) +FUNCTION(VasEBoot_arch_sync_caches) brz,pn %o1, 2f add %o0, %o1, %o1 add %o1, 7, %o1 diff --git a/VasEBoot-core/kern/sparc64/dl.c b/VasEBoot-core/kern/sparc64/dl.c index 739be4717..3d475511f 100644 --- a/VasEBoot-core/kern/sparc64/dl.c +++ b/VasEBoot-core/kern/sparc64/dl.c @@ -1,31 +1,31 @@ /* dl.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf_Ehdr *e = ehdr; @@ -33,20 +33,20 @@ grub_arch_dl_check_header (void *ehdr) if (e->e_ident[EI_CLASS] != ELFCLASS64 || e->e_ident[EI_DATA] != ELFDATA2MSB || e->e_machine != EM_SPARCV9) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #pragma GCC diagnostic ignored "-Wcast-align" struct trampoline { - grub_uint8_t code[0x28]; - grub_uint64_t addr; + VasEBoot_uint8_t code[0x28]; + VasEBoot_uint64_t addr; }; -static const grub_uint8_t trampoline_code[0x28] = +static const VasEBoot_uint8_t trampoline_code[0x28] = { /* 0: */ 0x82, 0x10, 0x00, 0x0f, /* mov %o7, %g1 */ /* 4: */ 0x40, 0x00, 0x00, 0x02, /* call 0xc */ @@ -60,9 +60,9 @@ static const grub_uint8_t trampoline_code[0x28] = /* 24: */ 0x01, 0x00, 0x00, 0x00, /* nop */ }; -grub_err_t -grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got) +VasEBoot_err_t +VasEBoot_arch_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got) { const Elf_Ehdr *e = ehdr; const Elf_Shdr *s; @@ -71,17 +71,17 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, *tramp = 0; *got = 0; - for (i = 0, s = (const Elf_Shdr *) ((grub_addr_t) e + e->e_shoff); + for (i = 0, s = (const Elf_Shdr *) ((VasEBoot_addr_t) e + e->e_shoff); i < e->e_shnum; - i++, s = (const Elf_Shdr *) ((grub_addr_t) s + e->e_shentsize)) + i++, s = (const Elf_Shdr *) ((VasEBoot_addr_t) s + e->e_shentsize)) if (s->sh_type == SHT_REL || s->sh_type == SHT_RELA) { const Elf_Rel *rel, *max; - for (rel = (const Elf_Rel *) ((grub_addr_t) e + s->sh_offset), + for (rel = (const Elf_Rel *) ((VasEBoot_addr_t) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; - rel = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_entsize)) + rel = (const Elf_Rel *) ((VasEBoot_addr_t) rel + s->sh_entsize)) switch (ELF_R_TYPE (rel->r_info)) { case R_SPARC_WDISP30: @@ -92,13 +92,13 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Relocate symbols. */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf_Rela *rel, *max; @@ -112,7 +112,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, Elf_Addr value; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); addr = (Elf_Word *) ((char *) seg->addr + rel->r_offset); @@ -124,7 +124,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { case R_SPARC_32: /* 3 V-word32 */ if (value & 0xFFFFFFFF00000000) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "address out of 32 bits range"); *addr = value; break; @@ -135,7 +135,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, { struct trampoline *tp = mod->trampptr; mod->trampptr = tp + 1; - grub_memcpy (tp->code, trampoline_code, sizeof (tp->code)); + VasEBoot_memcpy (tp->code, trampoline_code, sizeof (tp->code)); tp->addr = value; value = (Elf_Addr) tp; } @@ -143,10 +143,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, if (((value - (Elf_Addr) addr) & 0xFFFFFFFF00000000) && (((value - (Elf_Addr) addr) & 0xFFFFFFFF00000000) != 0xFFFFFFFF00000000)) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "displacement out of 30 bits range"); *addr = (*addr & 0xC0000000) | - (((grub_int32_t) ((value - (Elf_Addr) addr) >> 2)) & + (((VasEBoot_int32_t) ((value - (Elf_Addr) addr) >> 2)) & 0x3FFFFFFF); break; case R_SPARC_HH22: /* 9 V-imm22 */ @@ -157,7 +157,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, break; case R_SPARC_HI22: /* 9 V-imm22 */ if (value >> 32) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "address out of 32 bits range"); /* Fallthrough. */ case R_SPARC_LM22: @@ -176,11 +176,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, & 0x1fff); break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/sparc64/ieee1275/crt0.S b/VasEBoot-core/kern/sparc64/ieee1275/crt0.S index 03b916f05..3c3e99e68 100644 --- a/VasEBoot-core/kern/sparc64/ieee1275/crt0.S +++ b/VasEBoot-core/kern/sparc64/ieee1275/crt0.S @@ -1,24 +1,24 @@ /* crt0.S - Startup code for the Sparc64. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include .text .align 4 @@ -27,25 +27,25 @@ _start: ba codestart mov %o4, %o0 - .org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE + .org VasEBoot_KERNEL_MACHINE_TOTAL_MODULE_SIZE -VARIABLE(grub_total_module_size) +VARIABLE(VasEBoot_total_module_size) .word 0 codestart: /* Copy the modules past the end of the kernel image. * They are currently sitting in the BSS. */ - sethi %hi(__bss_start + GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o2 - or %o2, %lo(__bss_start + GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o2 - srl %o2, GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o2 - sll %o2, GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o2 - sethi %hi(_end + GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o3 - or %o3, %lo(_end + GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o3 - srl %o3, GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o3 - sll %o3, GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o3 - sethi %hi(grub_total_module_size), %o4 - lduw [%o4 + %lo(grub_total_module_size)], %o4 + sethi %hi(__bss_start + VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o2 + or %o2, %lo(__bss_start + VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o2 + srl %o2, VasEBoot_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o2 + sll %o2, VasEBoot_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o2 + sethi %hi(_end + VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o3 + or %o3, %lo(_end + VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN - 1), %o3 + srl %o3, VasEBoot_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o3 + sll %o3, VasEBoot_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN, %o3 + sethi %hi(VasEBoot_total_module_size), %o4 + lduw [%o4 + %lo(VasEBoot_total_module_size)], %o4 add %o2, %o4, %o2 add %o3, %o4, %o3 @@ -53,8 +53,8 @@ codestart: /* Save ieee1275 stack for future use by booter. */ mov %o6, %o1 /* Our future stack. */ - sethi %hi(GRUB_KERNEL_MACHINE_STACK_SIZE), %o5 - or %o5, %lo(GRUB_KERNEL_MACHINE_STACK_SIZE), %o5 + sethi %hi(VasEBoot_KERNEL_MACHINE_STACK_SIZE), %o5 + or %o5, %lo(VasEBoot_KERNEL_MACHINE_STACK_SIZE), %o5 add %o3, %o5, %o6 and %o6, ~0xff, %o6 sub %o6, 2047, %o6 @@ -95,10 +95,10 @@ codestart: blt,pt %xcc, 1b nop - sethi %hi(grub_ieee1275_original_stack), %o2 - stx %o1, [%o2 + %lo(grub_ieee1275_original_stack)] - sethi %hi(grub_ieee1275_entry_fn), %o2 - call grub_main - stx %o0, [%o2 + %lo(grub_ieee1275_entry_fn)] + sethi %hi(VasEBoot_ieee1275_original_stack), %o2 + stx %o1, [%o2 + %lo(VasEBoot_ieee1275_original_stack)] + sethi %hi(VasEBoot_ieee1275_entry_fn), %o2 + call VasEBoot_main + stx %o0, [%o2 + %lo(VasEBoot_ieee1275_entry_fn)] 1: ba,a 1b nop diff --git a/VasEBoot-core/kern/sparc64/ieee1275/ieee1275.c b/VasEBoot-core/kern/sparc64/ieee1275/ieee1275.c index 53be692c3..d7f72634a 100644 --- a/VasEBoot-core/kern/sparc64/ieee1275/ieee1275.c +++ b/VasEBoot-core/kern/sparc64/ieee1275/ieee1275.c @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -/* Sun specific ieee1275 interfaces used by GRUB. */ +/* Sun specific ieee1275 interfaces used by VasEBoot. */ int -grub_ieee1275_claim_vaddr (grub_addr_t vaddr, grub_size_t size) +VasEBoot_ieee1275_claim_vaddr (VasEBoot_addr_t vaddr, VasEBoot_size_t size) { struct claim_vaddr_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t align; - grub_ieee1275_cell_t size; - grub_ieee1275_cell_t virt; - grub_ieee1275_cell_t catch_result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t align; + VasEBoot_ieee1275_cell_t size; + VasEBoot_ieee1275_cell_t virt; + VasEBoot_ieee1275_cell_t catch_result; } args; INIT_IEEE1275_COMMON (&args.common, "call-method", 5, 2); - args.method = (grub_ieee1275_cell_t) "claim"; - args.ihandle = grub_ieee1275_mmu; + args.method = (VasEBoot_ieee1275_cell_t) "claim"; + args.ihandle = VasEBoot_ieee1275_mmu; args.align = 0; args.size = size; args.virt = vaddr; - args.catch_result = (grub_ieee1275_cell_t) -1; + args.catch_result = (VasEBoot_ieee1275_cell_t) -1; if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; @@ -50,25 +50,25 @@ grub_ieee1275_claim_vaddr (grub_addr_t vaddr, grub_size_t size) } int -grub_ieee1275_alloc_physmem (grub_addr_t *paddr, grub_size_t size, - grub_uint32_t align) +VasEBoot_ieee1275_alloc_physmem (VasEBoot_addr_t *paddr, VasEBoot_size_t size, + VasEBoot_uint32_t align) { - grub_uint32_t memory_ihandle; + VasEBoot_uint32_t memory_ihandle; struct alloc_physmem_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t ihandle; - grub_ieee1275_cell_t align; - grub_ieee1275_cell_t size; - grub_ieee1275_cell_t catch_result; - grub_ieee1275_cell_t phys_high; - grub_ieee1275_cell_t phys_low; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t ihandle; + VasEBoot_ieee1275_cell_t align; + VasEBoot_ieee1275_cell_t size; + VasEBoot_ieee1275_cell_t catch_result; + VasEBoot_ieee1275_cell_t phys_high; + VasEBoot_ieee1275_cell_t phys_low; } args; - grub_ssize_t actual = 0; + VasEBoot_ssize_t actual = 0; - grub_ieee1275_get_property (grub_ieee1275_chosen, "memory", + VasEBoot_ieee1275_get_property (VasEBoot_ieee1275_chosen, "memory", &memory_ihandle, sizeof (memory_ihandle), &actual); if (actual != sizeof (memory_ihandle)) @@ -78,7 +78,7 @@ grub_ieee1275_alloc_physmem (grub_addr_t *paddr, grub_size_t size, align = 1; INIT_IEEE1275_COMMON (&args.common, "call-method", 4, 3); - args.method = (grub_ieee1275_cell_t) "claim"; + args.method = (VasEBoot_ieee1275_cell_t) "claim"; args.ihandle = memory_ihandle; args.align = (align ? align : 1); args.size = size; diff --git a/VasEBoot-core/kern/term.c b/VasEBoot-core/kern/term.c index 07720ee67..a64cf6b6d 100644 --- a/VasEBoot-core/kern/term.c +++ b/VasEBoot-core/kern/term.c @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -struct grub_term_output *grub_term_outputs_disabled; -struct grub_term_input *grub_term_inputs_disabled; -struct grub_term_output *grub_term_outputs; -struct grub_term_input *grub_term_inputs; +struct VasEBoot_term_output *VasEBoot_term_outputs_disabled; +struct VasEBoot_term_input *VasEBoot_term_inputs_disabled; +struct VasEBoot_term_output *VasEBoot_term_outputs; +struct VasEBoot_term_input *VasEBoot_term_inputs; /* Current color state. */ -grub_uint8_t grub_term_normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR; -grub_uint8_t grub_term_highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR; +VasEBoot_uint8_t VasEBoot_term_normal_color = VasEBoot_TERM_DEFAULT_NORMAL_COLOR; +VasEBoot_uint8_t VasEBoot_term_highlight_color = VasEBoot_TERM_DEFAULT_HIGHLIGHT_COLOR; -void (*grub_term_poll_usb) (int wait_for_completion) = NULL; -void (*grub_net_poll_cards_idle) (void) = NULL; +void (*VasEBoot_term_poll_usb) (int wait_for_completion) = NULL; +void (*VasEBoot_net_poll_cards_idle) (void) = NULL; /* Put a Unicode character. */ static void -grub_putcode_dumb (grub_uint32_t code, - struct grub_term_output *term) +VasEBoot_putcode_dumb (VasEBoot_uint32_t code, + struct VasEBoot_term_output *term) { - struct grub_unicode_glyph c = + struct VasEBoot_unicode_glyph c = { .base = code, .variant = 0, @@ -53,78 +53,78 @@ grub_putcode_dumb (grub_uint32_t code, { int n; - n = GRUB_TERM_TAB_WIDTH - ((term->getxy (term).x) - % GRUB_TERM_TAB_WIDTH); + n = VasEBoot_TERM_TAB_WIDTH - ((term->getxy (term).x) + % VasEBoot_TERM_TAB_WIDTH); while (n--) - grub_putcode_dumb (' ', term); + VasEBoot_putcode_dumb (' ', term); return; } (term->putchar) (term, &c); if (code == '\n') - grub_putcode_dumb ('\r', term); + VasEBoot_putcode_dumb ('\r', term); } static void -grub_xputs_dumb (const char *str) +VasEBoot_xputs_dumb (const char *str) { for (; *str; str++) { - grub_term_output_t term; - grub_uint32_t code = *str; + VasEBoot_term_output_t term; + VasEBoot_uint32_t code = *str; if (code > 0x7f) code = '?'; FOR_ACTIVE_TERM_OUTPUTS(term) - grub_putcode_dumb (code, term); + VasEBoot_putcode_dumb (code, term); } } -void (*grub_xputs) (const char *str) = grub_xputs_dumb; +void (*VasEBoot_xputs) (const char *str) = VasEBoot_xputs_dumb; int -grub_getkey_noblock (void) +VasEBoot_getkey_noblock (void) { - grub_term_input_t term; + VasEBoot_term_input_t term; - if (grub_term_poll_usb) - grub_term_poll_usb (0); + if (VasEBoot_term_poll_usb) + VasEBoot_term_poll_usb (0); - if (grub_net_poll_cards_idle) - grub_net_poll_cards_idle (); + if (VasEBoot_net_poll_cards_idle) + VasEBoot_net_poll_cards_idle (); FOR_ACTIVE_TERM_INPUTS(term) { int key = term->getkey (term); - if (key != GRUB_TERM_NO_KEY) + if (key != VasEBoot_TERM_NO_KEY) return key; } - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; } int -grub_getkey (void) +VasEBoot_getkey (void) { int ret; - grub_refresh (); + VasEBoot_refresh (); while (1) { - ret = grub_getkey_noblock (); - if (ret != GRUB_TERM_NO_KEY) + ret = VasEBoot_getkey_noblock (); + if (ret != VasEBoot_TERM_NO_KEY) return ret; - grub_cpu_idle (); + VasEBoot_cpu_idle (); } } void -grub_refresh (void) +VasEBoot_refresh (void) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; FOR_ACTIVE_TERM_OUTPUTS(term) - grub_term_refresh (term); + VasEBoot_term_refresh (term); } diff --git a/VasEBoot-core/kern/time.c b/VasEBoot-core/kern/time.c index 6521ec66f..b9fcee102 100644 --- a/VasEBoot-core/kern/time.c +++ b/VasEBoot-core/kern/time.c @@ -1,37 +1,37 @@ /* time.c - kernel time functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include -typedef grub_uint64_t (*get_time_ms_func_t) (void); +typedef VasEBoot_uint64_t (*get_time_ms_func_t) (void); /* Function pointer to the implementation in use. */ static get_time_ms_func_t get_time_ms_func; -grub_uint64_t -grub_get_time_ms (void) +VasEBoot_uint64_t +VasEBoot_get_time_ms (void) { return get_time_ms_func (); } void -grub_install_get_time_ms (get_time_ms_func_t func) +VasEBoot_install_get_time_ms (get_time_ms_func_t func) { get_time_ms_func = func; } diff --git a/VasEBoot-core/kern/tpm.c b/VasEBoot-core/kern/tpm.c index e5e8fced6..e5ded8ea6 100644 --- a/VasEBoot-core/kern/tpm.c +++ b/VasEBoot-core/kern/tpm.c @@ -1,19 +1,19 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -grub_err_t -grub_tpm_measure (unsigned char *buf, grub_size_t size, grub_uint8_t pcr, +VasEBoot_err_t +VasEBoot_tpm_measure (unsigned char *buf, VasEBoot_size_t size, VasEBoot_uint8_t pcr, const char *kind, const char *description) { - grub_err_t ret; - char *desc = grub_xasprintf("%s %s", kind, description); + VasEBoot_err_t ret; + char *desc = VasEBoot_xasprintf("%s %s", kind, description); if (!desc) - return GRUB_ERR_OUT_OF_MEMORY; - ret = grub_tpm_log_event(buf, size, pcr, desc); - grub_free(desc); + return VasEBoot_ERR_OUT_OF_MEMORY; + ret = VasEBoot_tpm_log_event(buf, size, pcr, desc); + VasEBoot_free(desc); return ret; } diff --git a/VasEBoot-core/kern/uboot/hw.c b/VasEBoot-core/kern/uboot/hw.c index 272b83bd7..5d41b44f1 100644 --- a/VasEBoot-core/kern/uboot/hw.c +++ b/VasEBoot-core/kern/uboot/hw.c @@ -1,52 +1,52 @@ /* hw.c - U-Boot hardware discovery */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_addr_t start_of_ram; +VasEBoot_addr_t start_of_ram; /* - * grub_uboot_probe_memory(): + * VasEBoot_uboot_probe_memory(): * Queries U-Boot for available memory regions. * * Sets up heap near the image in memory and sets up "start_of_ram". */ void -grub_uboot_mm_init (void) +VasEBoot_uboot_mm_init (void) { - struct sys_info *si = grub_uboot_get_sys_info (); + struct sys_info *si = VasEBoot_uboot_get_sys_info (); - grub_mm_init_region ((void *) grub_modules_get_end (), - GRUB_KERNEL_MACHINE_HEAP_SIZE); + VasEBoot_mm_init_region ((void *) VasEBoot_modules_get_end (), + VasEBoot_KERNEL_MACHINE_HEAP_SIZE); if (si && (si->mr_no != 0)) { int i; - start_of_ram = GRUB_UINT_MAX; + start_of_ram = VasEBoot_UINT_MAX; for (i = 0; i < si->mr_no; i++) if ((si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_DRAM) @@ -56,57 +56,57 @@ grub_uboot_mm_init (void) } /* - * grub_uboot_probe_hardware(): + * VasEBoot_uboot_probe_hardware(): */ -grub_err_t -grub_uboot_probe_hardware (void) +VasEBoot_err_t +VasEBoot_uboot_probe_hardware (void) { int devcount, i; - devcount = grub_uboot_dev_enum (); - grub_dprintf ("init", "%d devices found\n", devcount); + devcount = VasEBoot_uboot_dev_enum (); + VasEBoot_dprintf ("init", "%d devices found\n", devcount); for (i = 0; i < devcount; i++) { - struct device_info *devinfo = grub_uboot_dev_get (i); + struct device_info *devinfo = VasEBoot_uboot_dev_get (i); - grub_dprintf ("init", "device handle: %d\n", i); - grub_dprintf ("init", " cookie\t= 0x%08x\n", - (grub_uint32_t) devinfo->cookie); + VasEBoot_dprintf ("init", "device handle: %d\n", i); + VasEBoot_dprintf ("init", " cookie\t= 0x%08x\n", + (VasEBoot_uint32_t) devinfo->cookie); if (devinfo->type & DEV_TYP_STOR) { - grub_dprintf ("init", " type\t\t= DISK\n"); - grub_ubootdisk_register (devinfo); + VasEBoot_dprintf ("init", " type\t\t= DISK\n"); + VasEBoot_ubootdisk_register (devinfo); } else if (devinfo->type & DEV_TYP_NET) { /* Dealt with in ubootnet module. */ - grub_dprintf ("init", " type\t\t= NET (not supported yet)\n"); + VasEBoot_dprintf ("init", " type\t\t= NET (not supported yet)\n"); } else { - grub_dprintf ("init", "%s: unknown device type", __FUNCTION__); + VasEBoot_dprintf ("init", "%s: unknown device type", __FUNCTION__); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { int i; - struct sys_info *si = grub_uboot_get_sys_info (); + struct sys_info *si = VasEBoot_uboot_get_sys_info (); if (!si || (si->mr_no < 1)) - return GRUB_ERR_BUG; + return VasEBoot_ERR_BUG; /* Iterate and call `hook'. */ for (i = 0; i < si->mr_no; i++) if ((si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_DRAM) - hook (si->mr[i].start, si->mr[i].size, GRUB_MEMORY_AVAILABLE, + hook (si->mr[i].start, si->mr[i].size, VasEBoot_MEMORY_AVAILABLE, hook_data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/uboot/init.c b/VasEBoot-core/kern/uboot/init.c index 5dcc106ed..146486b15 100644 --- a/VasEBoot-core/kern/uboot/init.c +++ b/VasEBoot-core/kern/uboot/init.c @@ -1,178 +1,178 @@ /* init.c - generic U-Boot initialization and finalization */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include extern char __bss_start[]; extern char _end[]; -extern grub_size_t grub_total_module_size; -extern int (*grub_uboot_syscall_ptr) (int, int *, ...); +extern VasEBoot_size_t VasEBoot_total_module_size; +extern int (*VasEBoot_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; +extern VasEBoot_uint32_t VasEBoot_uboot_machine_type; +extern VasEBoot_addr_t VasEBoot_uboot_boot_data; void -grub_exit (void) +VasEBoot_exit (void) { - grub_uboot_return (0); + VasEBoot_uboot_return (0); } -grub_uint32_t -grub_uboot_get_machine_type (void) +VasEBoot_uint32_t +VasEBoot_uboot_get_machine_type (void) { - return grub_uboot_machine_type; + return VasEBoot_uboot_machine_type; } -grub_addr_t -grub_uboot_get_boot_data (void) +VasEBoot_addr_t +VasEBoot_uboot_get_boot_data (void) { - return grub_uboot_boot_data; + return VasEBoot_uboot_boot_data; } -static grub_uint64_t +static VasEBoot_uint64_t uboot_timer_ms (void) { - static grub_uint32_t last = 0, high = 0; - grub_uint32_t cur = grub_uboot_get_timer (timer_start); + static VasEBoot_uint32_t last = 0, high = 0; + VasEBoot_uint32_t cur = VasEBoot_uboot_get_timer (timer_start); if (cur < last) high++; last = cur; - return (((grub_uint64_t) high) << 32) | cur; + return (((VasEBoot_uint64_t) high) << 32) | cur; } #ifdef __arm__ -static grub_uint64_t +static VasEBoot_uint64_t rpi_timer_ms (void) { - static grub_uint32_t last = 0, high = 0; - grub_uint32_t cur = *(volatile grub_uint32_t *) 0x20003004; + static VasEBoot_uint32_t last = 0, high = 0; + VasEBoot_uint32_t cur = *(volatile VasEBoot_uint32_t *) 0x20003004; if (cur < last) high++; last = cur; - return grub_divmod64 ((((grub_uint64_t) high) << 32) | cur, 1000, 0); + return VasEBoot_divmod64 ((((VasEBoot_uint64_t) high) << 32) | cur, 1000, 0); } #endif void -grub_machine_init (void) +VasEBoot_machine_init (void) { int ver; /* First of all - establish connection with U-Boot */ - ver = grub_uboot_api_init (); + ver = VasEBoot_uboot_api_init (); if (!ver) { /* Don't even have a console to log errors to... */ - grub_exit (); + VasEBoot_exit (); } else if (ver > API_SIG_VERSION) { /* Try to print an error message */ - grub_uboot_puts ("invalid U-Boot API version\n"); + VasEBoot_uboot_puts ("invalid U-Boot API version\n"); } - /* Initialize the console so that GRUB can display messages. */ - grub_console_init_early (); + /* Initialize the console so that VasEBoot can display messages. */ + VasEBoot_console_init_early (); /* Enumerate memory and initialize the memory management system. */ - grub_uboot_mm_init (); + VasEBoot_uboot_mm_init (); /* Should be earlier but it needs memalign. */ #ifdef __arm__ - grub_arm_enable_caches_mmu (); + VasEBoot_arm_enable_caches_mmu (); #endif - grub_dprintf ("init", "__bss_start: %p\n", __bss_start); - grub_dprintf ("init", "_end: %p\n", _end); - grub_dprintf ("init", "grub_modbase: %p\n", (void *) grub_modbase); - grub_dprintf ("init", "grub_modules_get_end(): %p\n", - (void *) grub_modules_get_end ()); + VasEBoot_dprintf ("init", "__bss_start: %p\n", __bss_start); + VasEBoot_dprintf ("init", "_end: %p\n", _end); + VasEBoot_dprintf ("init", "VasEBoot_modbase: %p\n", (void *) VasEBoot_modbase); + VasEBoot_dprintf ("init", "VasEBoot_modules_get_end(): %p\n", + (void *) VasEBoot_modules_get_end ()); /* Initialise full terminfo support */ - grub_console_init_lately (); + VasEBoot_console_init_lately (); /* Enumerate uboot devices */ - grub_uboot_probe_hardware (); + VasEBoot_uboot_probe_hardware (); /* Initialise timer */ #ifdef __arm__ - if (grub_uboot_get_machine_type () == GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI) + if (VasEBoot_uboot_get_machine_type () == VasEBoot_ARM_MACHINE_TYPE_RASPBERRY_PI) { - grub_install_get_time_ms (rpi_timer_ms); + VasEBoot_install_get_time_ms (rpi_timer_ms); } else #endif { - timer_start = grub_uboot_get_timer (0); - grub_install_get_time_ms (uboot_timer_ms); + timer_start = VasEBoot_uboot_get_timer (0); + VasEBoot_install_get_time_ms (uboot_timer_ms); } /* Initialize */ - grub_ubootdisk_init (); + VasEBoot_ubootdisk_init (); } void -grub_machine_fini (int flags __attribute__ ((unused))) +VasEBoot_machine_fini (int flags __attribute__ ((unused))) { } /* - * grub_machine_get_bootlocation(): + * VasEBoot_machine_get_bootlocation(): * Called from kern/main.c, which expects a device name (minus parentheses) * and a filesystem path back, if any are known. * Any returned values must be pointers to dynamically allocated strings. */ void -grub_machine_get_bootlocation (char **device, char **path) +VasEBoot_machine_get_bootlocation (char **device, char **path) { char *tmp; - tmp = grub_uboot_env_get ("grub_bootdev"); + tmp = VasEBoot_uboot_env_get ("VasEBoot_bootdev"); if (tmp) { - *device = grub_strdup (tmp); + *device = VasEBoot_strdup (tmp); if (*device == NULL) return; } else *device = NULL; - tmp = grub_uboot_env_get ("grub_bootpath"); + tmp = VasEBoot_uboot_env_get ("VasEBoot_bootpath"); if (tmp) { - *path = grub_strdup (tmp); + *path = VasEBoot_strdup (tmp); if (*path == NULL) return; } @@ -181,8 +181,8 @@ grub_machine_get_bootlocation (char **device, char **path) } void -grub_uboot_fini (void) +VasEBoot_uboot_fini (void) { - grub_ubootdisk_fini (); - grub_console_fini (); + VasEBoot_ubootdisk_fini (); + VasEBoot_console_fini (); } diff --git a/VasEBoot-core/kern/uboot/uboot.c b/VasEBoot-core/kern/uboot/uboot.c index 6800a4beb..89ee8ea7b 100644 --- a/VasEBoot-core/kern/uboot/uboot.c +++ b/VasEBoot-core/kern/uboot/uboot.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* * The main syscall entry point is not reentrant, only one call is @@ -39,9 +39,9 @@ * 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; +extern int (*VasEBoot_uboot_syscall_ptr) (int, int *, ...); +extern int VasEBoot_uboot_syscall (int, int *, ...); +extern VasEBoot_addr_t VasEBoot_uboot_search_hint; static struct sys_info uboot_sys_info; static struct mem_region uboot_mem_info[5]; @@ -49,18 +49,18 @@ static struct device_info * devices; static int num_devices; int -grub_uboot_api_init (void) +VasEBoot_uboot_api_init (void) { struct api_signature *start, *end; struct api_signature *p; - if (grub_uboot_search_hint) + if (VasEBoot_uboot_search_hint) { /* Extended search range to work around Trim Slice U-Boot issue */ - start = (struct api_signature *) ((grub_uboot_search_hint & ~0x000fffff) + start = (struct api_signature *) ((VasEBoot_uboot_search_hint & ~0x000fffff) - 0x00500000); end = - (struct api_signature *) ((grub_addr_t) start + UBOOT_API_SEARCH_LEN - + (struct api_signature *) ((VasEBoot_addr_t) start + UBOOT_API_SEARCH_LEN - API_SIG_MAGLEN + 0x00500000); } else @@ -70,11 +70,11 @@ grub_uboot_api_init (void) } /* Structure alignment is (at least) 8 bytes */ - for (p = start; p < end; p = (void *) ((grub_addr_t) p + 8)) + for (p = start; p < end; p = (void *) ((VasEBoot_addr_t) p + 8)) { - if (grub_memcmp (&(p->magic), API_SIG_MAGIC, API_SIG_MAGLEN) == 0) + if (VasEBoot_memcmp (&(p->magic), API_SIG_MAGIC, API_SIG_MAGLEN) == 0) { - grub_uboot_syscall_ptr = p->syscall; + VasEBoot_uboot_syscall_ptr = p->syscall; return p->version; } } @@ -83,58 +83,58 @@ grub_uboot_api_init (void) } /* - * All functions below are wrappers around the grub_uboot_syscall() function + * All functions below are wrappers around the VasEBoot_uboot_syscall() function */ int -grub_uboot_getc (void) +VasEBoot_uboot_getc (void) { int c; - if (!grub_uboot_syscall (API_GETC, NULL, &c)) + if (!VasEBoot_uboot_syscall (API_GETC, NULL, &c)) return -1; return c; } int -grub_uboot_tstc (void) +VasEBoot_uboot_tstc (void) { int c; - if (!grub_uboot_syscall (API_TSTC, NULL, &c)) + if (!VasEBoot_uboot_syscall (API_TSTC, NULL, &c)) return -1; return c; } void -grub_uboot_putc (int c) +VasEBoot_uboot_putc (int c) { - grub_uboot_syscall (API_PUTC, NULL, &c); + VasEBoot_uboot_syscall (API_PUTC, NULL, &c); } void -grub_uboot_puts (const char *s) +VasEBoot_uboot_puts (const char *s) { - grub_uboot_syscall (API_PUTS, NULL, s); + VasEBoot_uboot_syscall (API_PUTS, NULL, s); } void -grub_uboot_reset (void) +VasEBoot_uboot_reset (void) { - grub_uboot_syscall (API_RESET, NULL, 0); + VasEBoot_uboot_syscall (API_RESET, NULL, 0); } struct sys_info * -grub_uboot_get_sys_info (void) +VasEBoot_uboot_get_sys_info (void) { int retval; - grub_memset (&uboot_sys_info, 0, sizeof (uboot_sys_info)); - grub_memset (&uboot_mem_info, 0, sizeof (uboot_mem_info)); + VasEBoot_memset (&uboot_sys_info, 0, sizeof (uboot_sys_info)); + VasEBoot_memset (&uboot_mem_info, 0, sizeof (uboot_mem_info)); uboot_sys_info.mr = uboot_mem_info; uboot_sys_info.mr_no = sizeof (uboot_mem_info) / sizeof (struct mem_region); - if (grub_uboot_syscall (API_GET_SYS_INFO, &retval, &uboot_sys_info)) + if (VasEBoot_uboot_syscall (API_GET_SYS_INFO, &retval, &uboot_sys_info)) if (retval == 0) return &uboot_sys_info; @@ -142,24 +142,24 @@ grub_uboot_get_sys_info (void) } void -grub_uboot_udelay (grub_uint32_t usec) +VasEBoot_uboot_udelay (VasEBoot_uint32_t usec) { - grub_uboot_syscall (API_UDELAY, NULL, &usec); + VasEBoot_uboot_syscall (API_UDELAY, NULL, &usec); } -grub_uint32_t -grub_uboot_get_timer (grub_uint32_t base) +VasEBoot_uint32_t +VasEBoot_uboot_get_timer (VasEBoot_uint32_t base) { - grub_uint32_t current; + VasEBoot_uint32_t current; - if (!grub_uboot_syscall (API_GET_TIMER, NULL, ¤t, &base)) + if (!VasEBoot_uboot_syscall (API_GET_TIMER, NULL, ¤t, &base)) return 0; return current; } int -grub_uboot_dev_enum (void) +VasEBoot_uboot_dev_enum (void) { struct device_info * enum_devices; int num_enum_devices, max_devices; @@ -168,7 +168,7 @@ grub_uboot_dev_enum (void) return num_devices; max_devices = 2; - enum_devices = grub_malloc (sizeof(struct device_info) * max_devices); + enum_devices = VasEBoot_malloc (sizeof(struct device_info) * max_devices); if (!enum_devices) return 0; @@ -182,7 +182,7 @@ grub_uboot_dev_enum (void) enum_devices[0].cookie = NULL; num_enum_devices = 0; - if (grub_uboot_syscall (API_DEV_ENUM, NULL, + if (VasEBoot_uboot_syscall (API_DEV_ENUM, NULL, &enum_devices[num_enum_devices]) == 0) goto error; @@ -195,7 +195,7 @@ grub_uboot_dev_enum (void) struct device_info *tmp; int new_max; new_max = max_devices * 2; - tmp = grub_realloc (enum_devices, + tmp = VasEBoot_realloc (enum_devices, sizeof (struct device_info) * new_max); if (!tmp) { @@ -208,7 +208,7 @@ grub_uboot_dev_enum (void) enum_devices[num_enum_devices].cookie = enum_devices[num_enum_devices - 1].cookie; - if (grub_uboot_syscall (API_DEV_ENUM, NULL, + if (VasEBoot_uboot_syscall (API_DEV_ENUM, NULL, &enum_devices[num_enum_devices]) == 0) goto error; @@ -222,7 +222,7 @@ grub_uboot_dev_enum (void) return num_devices = num_enum_devices; error: - grub_free (enum_devices); + VasEBoot_free (enum_devices); return 0; } @@ -230,7 +230,7 @@ grub_uboot_dev_enum (void) #define OPEN_DEV(x) ((x->state == DEV_STA_OPEN)) struct device_info * -grub_uboot_dev_get (int index) +VasEBoot_uboot_dev_get (int index) { if (VALID_DEV (index)) return &devices[index]; @@ -240,22 +240,22 @@ grub_uboot_dev_get (int index) int -grub_uboot_dev_open (struct device_info *dev) +VasEBoot_uboot_dev_open (struct device_info *dev) { int retval; - if (!grub_uboot_syscall (API_DEV_OPEN, &retval, dev)) + if (!VasEBoot_uboot_syscall (API_DEV_OPEN, &retval, dev)) return -1; return retval; } int -grub_uboot_dev_close (struct device_info *dev) +VasEBoot_uboot_dev_close (struct device_info *dev) { int retval; - if (!grub_uboot_syscall (API_DEV_CLOSE, &retval, dev)) + if (!VasEBoot_uboot_syscall (API_DEV_CLOSE, &retval, dev)) return -1; return retval; @@ -263,15 +263,15 @@ grub_uboot_dev_close (struct device_info *dev) int -grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks, - grub_uint32_t start, grub_size_t * real_blocks) +VasEBoot_uboot_dev_read (struct device_info *dev, void *buf, VasEBoot_size_t blocks, + VasEBoot_uint32_t start, VasEBoot_size_t * real_blocks) { int retval; if (!OPEN_DEV (dev)) return -1; - if (!grub_uboot_syscall (API_DEV_READ, &retval, dev, buf, + if (!VasEBoot_uboot_syscall (API_DEV_READ, &retval, dev, buf, &blocks, &start, real_blocks)) return -1; @@ -279,7 +279,7 @@ grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks, } int -grub_uboot_dev_recv (struct device_info *dev, void *buf, +VasEBoot_uboot_dev_recv (struct device_info *dev, void *buf, int size, int *real_size) { int retval; @@ -287,7 +287,7 @@ grub_uboot_dev_recv (struct device_info *dev, void *buf, if (!OPEN_DEV (dev)) return -1; - if (!grub_uboot_syscall (API_DEV_READ, &retval, dev, buf, &size, real_size)) + if (!VasEBoot_uboot_syscall (API_DEV_READ, &retval, dev, buf, &size, real_size)) return -1; return retval; @@ -295,32 +295,32 @@ grub_uboot_dev_recv (struct device_info *dev, void *buf, } int -grub_uboot_dev_send (struct device_info *dev, void *buf, int size) +VasEBoot_uboot_dev_send (struct device_info *dev, void *buf, int size) { int retval; if (!OPEN_DEV (dev)) return -1; - if (!grub_uboot_syscall (API_DEV_WRITE, &retval, dev, buf, &size)) + if (!VasEBoot_uboot_syscall (API_DEV_WRITE, &retval, dev, buf, &size)) return -1; return retval; } char * -grub_uboot_env_get (const char *name) +VasEBoot_uboot_env_get (const char *name) { char *value; - if (!grub_uboot_syscall (API_ENV_GET, NULL, name, &value)) + if (!VasEBoot_uboot_syscall (API_ENV_GET, NULL, name, &value)) return NULL; return value; } void -grub_uboot_env_set (const char *name, const char *value) +VasEBoot_uboot_env_set (const char *name, const char *value) { - grub_uboot_syscall (API_ENV_SET, NULL, name, value); + VasEBoot_uboot_syscall (API_ENV_SET, NULL, name, value); } diff --git a/VasEBoot-core/kern/vga_init.c b/VasEBoot-core/kern/vga_init.c index 3fe2f16de..6a57a5cc5 100644 --- a/VasEBoot-core/kern/vga_init.c +++ b/VasEBoot-core/kern/vga_init.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef __mips__ -#include -#include +#include +#include #endif -#include -#include -#include +#include +#include +#include -static struct {grub_uint8_t r, g, b, a; } colors[] = +static struct {VasEBoot_uint8_t r, g, b, a; } colors[] = { // {R, G, B, A} {0x00, 0x00, 0x00, 0xFF}, // 0 = black @@ -59,18 +59,18 @@ load_font (void) { unsigned i; - grub_vga_gr_write (0 << 2, GRUB_VGA_GR_GR6); + VasEBoot_vga_gr_write (0 << 2, VasEBoot_VGA_GR_GR6); - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_NORMAL, GRUB_VGA_SR_MEMORY_MODE); - grub_vga_sr_write (1 << GRUB_VGA_TEXT_FONT_PLANE, - GRUB_VGA_SR_MAP_MASK_REGISTER); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_NORMAL, VasEBoot_VGA_SR_MEMORY_MODE); + VasEBoot_vga_sr_write (1 << VasEBoot_VGA_TEXT_FONT_PLANE, + VasEBoot_VGA_SR_MAP_MASK_REGISTER); - grub_vga_gr_write (0, GRUB_VGA_GR_DATA_ROTATE); - grub_vga_gr_write (0, GRUB_VGA_GR_MODE); - grub_vga_gr_write (0xff, GRUB_VGA_GR_BITMASK); + VasEBoot_vga_gr_write (0, VasEBoot_VGA_GR_DATA_ROTATE); + VasEBoot_vga_gr_write (0, VasEBoot_VGA_GR_MODE); + VasEBoot_vga_gr_write (0xff, VasEBoot_VGA_GR_BITMASK); for (i = 0; i < 128; i++) - grub_memcpy ((void *) (VGA_ADDR + 32 * i), ascii_bitmaps + 16 * i, 16); + VasEBoot_memcpy ((void *) (VGA_ADDR + 32 * i), ascii_bitmaps + 16 * i, 16); } static void @@ -78,51 +78,51 @@ load_palette (void) { unsigned i; for (i = 0; i < 16; i++) - grub_vga_write_arx (i, i); + VasEBoot_vga_write_arx (i, i); for (i = 0; i < ARRAY_SIZE (colors); i++) - grub_vga_palette_write (i, colors[i].r, colors[i].g, colors[i].b); + VasEBoot_vga_palette_write (i, colors[i].r, colors[i].g, colors[i].b); } void -grub_qemu_init_cirrus (void) +VasEBoot_qemu_init_cirrus (void) { - grub_outb (GRUB_VGA_IO_MISC_COLOR, - GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_MISC_WRITE); + VasEBoot_outb (VasEBoot_VGA_IO_MISC_COLOR, + VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_MISC_WRITE); load_font (); - grub_vga_gr_write (GRUB_VGA_GR_GR6_MMAP_CGA, GRUB_VGA_GR_GR6); - grub_vga_gr_write (GRUB_VGA_GR_MODE_ODD_EVEN, GRUB_VGA_GR_MODE); + VasEBoot_vga_gr_write (VasEBoot_VGA_GR_GR6_MMAP_CGA, VasEBoot_VGA_GR_GR6); + VasEBoot_vga_gr_write (VasEBoot_VGA_GR_MODE_ODD_EVEN, VasEBoot_VGA_GR_MODE); - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_NORMAL, GRUB_VGA_SR_MEMORY_MODE); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_NORMAL, VasEBoot_VGA_SR_MEMORY_MODE); - grub_vga_sr_write ((1 << GRUB_VGA_TEXT_TEXT_PLANE) - | (1 << GRUB_VGA_TEXT_ATTR_PLANE), - GRUB_VGA_SR_MAP_MASK_REGISTER); + VasEBoot_vga_sr_write ((1 << VasEBoot_VGA_TEXT_TEXT_PLANE) + | (1 << VasEBoot_VGA_TEXT_ATTR_PLANE), + VasEBoot_VGA_SR_MAP_MASK_REGISTER); - grub_vga_cr_write (15, GRUB_VGA_CR_CELL_HEIGHT); - grub_vga_cr_write (79, GRUB_VGA_CR_HORIZ_END); - grub_vga_cr_write (40, GRUB_VGA_CR_PITCH); + VasEBoot_vga_cr_write (15, VasEBoot_VGA_CR_CELL_HEIGHT); + VasEBoot_vga_cr_write (79, VasEBoot_VGA_CR_HORIZ_END); + VasEBoot_vga_cr_write (40, VasEBoot_VGA_CR_PITCH); int vert = 25 * 16; - grub_vga_cr_write (vert & 0xff, GRUB_VGA_CR_VDISPLAY_END); - grub_vga_cr_write (((vert >> GRUB_VGA_CR_OVERFLOW_HEIGHT1_SHIFT) - & GRUB_VGA_CR_OVERFLOW_HEIGHT1_MASK) - | ((vert >> GRUB_VGA_CR_OVERFLOW_HEIGHT2_SHIFT) - & GRUB_VGA_CR_OVERFLOW_HEIGHT2_MASK), - GRUB_VGA_CR_OVERFLOW); + VasEBoot_vga_cr_write (vert & 0xff, VasEBoot_VGA_CR_VDISPLAY_END); + VasEBoot_vga_cr_write (((vert >> VasEBoot_VGA_CR_OVERFLOW_HEIGHT1_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_HEIGHT1_MASK) + | ((vert >> VasEBoot_VGA_CR_OVERFLOW_HEIGHT2_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_HEIGHT2_MASK), + VasEBoot_VGA_CR_OVERFLOW); load_palette (); - grub_vga_write_arx (GRUB_VGA_ARX_MODE_TEXT, GRUB_VGA_ARX_MODE); - grub_vga_write_arx (0, GRUB_VGA_ARX_COLOR_SELECT); + VasEBoot_vga_write_arx (VasEBoot_VGA_ARX_MODE_TEXT, VasEBoot_VGA_ARX_MODE); + VasEBoot_vga_write_arx (0, VasEBoot_VGA_ARX_COLOR_SELECT); - grub_vga_sr_write (GRUB_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK, - GRUB_VGA_SR_CLOCKING_MODE); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK, + VasEBoot_VGA_SR_CLOCKING_MODE); - grub_vga_cr_write (14, GRUB_VGA_CR_CURSOR_START); - grub_vga_cr_write (15, GRUB_VGA_CR_CURSOR_END); + VasEBoot_vga_cr_write (14, VasEBoot_VGA_CR_CURSOR_START); + VasEBoot_vga_cr_write (15, VasEBoot_VGA_CR_CURSOR_END); - grub_outb (0x20, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX); + VasEBoot_outb (0x20, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX); } diff --git a/VasEBoot-core/kern/x86_64/dl.c b/VasEBoot-core/kern/x86_64/dl.c index 3a73e6e6c..1e5c051f5 100644 --- a/VasEBoot-core/kern/x86_64/dl.c +++ b/VasEBoot-core/kern/x86_64/dl.c @@ -1,31 +1,31 @@ /* dl-x86_64.c - arch-dependent part of loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Check if EHDR is a valid ELF header. */ -grub_err_t -grub_arch_dl_check_header (void *ehdr) +VasEBoot_err_t +VasEBoot_arch_dl_check_header (void *ehdr) { Elf64_Ehdr *e = ehdr; @@ -33,15 +33,15 @@ grub_arch_dl_check_header (void *ehdr) if (e->e_ident[EI_CLASS] != ELFCLASS64 || e->e_ident[EI_DATA] != ELFDATA2LSB || e->e_machine != EM_X86_64) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Relocate symbols. */ -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg) +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg) { Elf64_Rela *rel, *max; @@ -55,7 +55,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, Elf64_Sym *sym; if (seg->size < rel->r_offset) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "reloc offset is out of the segment"); addr32 = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); @@ -72,11 +72,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, case R_X86_64_PC32: case R_X86_64_PLT32: { - grub_int64_t value; - value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - - (Elf64_Xword) (grub_addr_t) seg->addr - rel->r_offset; - if (value != (grub_int32_t) value) - return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); + VasEBoot_int64_t value; + value = ((VasEBoot_int32_t) *addr32) + rel->r_addend + sym->st_value - + (Elf64_Xword) (VasEBoot_addr_t) seg->addr - rel->r_offset; + if (value != (VasEBoot_int32_t) value) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "relocation out of range"); *addr32 = value; } break; @@ -84,33 +84,33 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, case R_X86_64_PC64: { *addr64 += rel->r_addend + sym->st_value - - (Elf64_Xword) (grub_addr_t) seg->addr - rel->r_offset; + (Elf64_Xword) (VasEBoot_addr_t) seg->addr - rel->r_offset; } break; case R_X86_64_32: { - grub_uint64_t value = *addr32 + rel->r_addend + sym->st_value; - if (value != (grub_uint32_t) value) - return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); + VasEBoot_uint64_t value = *addr32 + rel->r_addend + sym->st_value; + if (value != (VasEBoot_uint32_t) value) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "relocation out of range"); *addr32 = value; } break; case R_X86_64_32S: { - grub_int64_t value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value; - if (value != (grub_int32_t) value) - return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); + VasEBoot_int64_t value = ((VasEBoot_int32_t) *addr32) + rel->r_addend + sym->st_value; + if (value != (VasEBoot_int32_t) value) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "relocation out of range"); *addr32 = value; } break; default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/kern/x86_64/efi/callwrap.S b/VasEBoot-core/kern/x86_64/efi/callwrap.S index 1337fd9fc..5b8a3d57a 100644 --- a/VasEBoot-core/kern/x86_64/efi/callwrap.S +++ b/VasEBoot-core/kern/x86_64/efi/callwrap.S @@ -1,24 +1,24 @@ /* callwrap.S - wrapper for x86_64 efi calls */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include /* * x86_64 uses registry to pass parameters. Unfortunately, gcc and efi use diff --git a/VasEBoot-core/kern/x86_64/efi/startup.S b/VasEBoot-core/kern/x86_64/efi/startup.S index 9357e5c5d..6402a214d 100644 --- a/VasEBoot-core/kern/x86_64/efi/startup.S +++ b/VasEBoot-core/kern/x86_64/efi/startup.S @@ -1,24 +1,24 @@ -/* startup.S - bootstrap GRUB itself */ +/* startup.S - bootstrap VasEBoot itself */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include .file "startup.S" .text @@ -27,9 +27,9 @@ start: _start: - movq %rcx, EXT_C(grub_efi_image_handle)(%rip) - movq %rdx, EXT_C(grub_efi_system_table)(%rip) + movq %rcx, EXT_C(VasEBoot_efi_image_handle)(%rip) + movq %rdx, EXT_C(VasEBoot_efi_system_table)(%rip) andq $~0xf, %rsp - call EXT_C(grub_main) + call EXT_C(VasEBoot_main) /* Doesn't return. */ diff --git a/VasEBoot-core/kern/x86_64/xen/hypercall.S b/VasEBoot-core/kern/x86_64/xen/hypercall.S index 9b04db6a0..eb7b09076 100644 --- a/VasEBoot-core/kern/x86_64/xen/hypercall.S +++ b/VasEBoot-core/kern/x86_64/xen/hypercall.S @@ -1,52 +1,52 @@ /* hypercall.S - wrappers for Xen hypercalls */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -FUNCTION(grub_xen_sched_op) +FUNCTION(VasEBoot_xen_sched_op) movq $__HYPERVISOR_sched_op, %rax syscall ret -FUNCTION(grub_xen_event_channel_op) +FUNCTION(VasEBoot_xen_event_channel_op) movq $__HYPERVISOR_event_channel_op, %rax syscall ret -FUNCTION(grub_xen_update_va_mapping) +FUNCTION(VasEBoot_xen_update_va_mapping) movq $__HYPERVISOR_update_va_mapping, %rax syscall ret -FUNCTION(grub_xen_mmuext_op) +FUNCTION(VasEBoot_xen_mmuext_op) movq %rcx, %r10 movq $__HYPERVISOR_mmuext_op, %rax syscall ret -FUNCTION(grub_xen_grant_table_op) +FUNCTION(VasEBoot_xen_grant_table_op) movq $__HYPERVISOR_grant_table_op, %rax syscall ret -FUNCTION(grub_xen_mmu_update) +FUNCTION(VasEBoot_xen_mmu_update) movq %rcx, %r10 movq $__HYPERVISOR_mmu_update, %rax syscall diff --git a/VasEBoot-core/kern/x86_64/xen/startup.S b/VasEBoot-core/kern/x86_64/xen/startup.S index 21a139f40..d54c4fb0c 100644 --- a/VasEBoot-core/kern/x86_64/xen/startup.S +++ b/VasEBoot-core/kern/x86_64/xen/startup.S @@ -1,24 +1,24 @@ -/* startup.S - bootstrap GRUB itself */ +/* startup.S - bootstrap VasEBoot itself */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include .file "startup.S" .text @@ -28,10 +28,10 @@ start: _start: leaq LOCAL(stack_end), %rsp - movq %rsi, EXT_C(grub_xen_start_page_addr)(%rip) + movq %rsi, EXT_C(VasEBoot_xen_start_page_addr)(%rip) andq $~0xf, %rsp - call EXT_C(grub_main) + call EXT_C(VasEBoot_main) /* Doesn't return. */ .bss diff --git a/VasEBoot-core/kern/xen/init.c b/VasEBoot-core/kern/xen/init.c index 0559c033c..1fb3ed133 100644 --- a/VasEBoot-core/kern/xen/init.c +++ b/VasEBoot-core/kern/xen/init.c @@ -1,92 +1,92 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_addr_t grub_modbase; -struct start_info *grub_xen_start_page_addr; -volatile struct xencons_interface *grub_xen_xcons; -volatile struct shared_info *grub_xen_shared_info; -volatile struct xenstore_domain_interface *grub_xen_xenstore; -volatile grant_entry_v1_t *grub_xen_grant_table; -static const grub_size_t total_grants = - GRUB_XEN_PAGE_SIZE / sizeof (grub_xen_grant_table[0]); -grub_size_t grub_xen_n_allocated_shared_pages; +VasEBoot_addr_t VasEBoot_modbase; +struct start_info *VasEBoot_xen_start_page_addr; +volatile struct xencons_interface *VasEBoot_xen_xcons; +volatile struct shared_info *VasEBoot_xen_shared_info; +volatile struct xenstore_domain_interface *VasEBoot_xen_xenstore; +volatile grant_entry_v1_t *VasEBoot_xen_grant_table; +static const VasEBoot_size_t total_grants = + VasEBoot_XEN_PAGE_SIZE / sizeof (VasEBoot_xen_grant_table[0]); +VasEBoot_size_t VasEBoot_xen_n_allocated_shared_pages; -static grub_xen_mfn_t -grub_xen_ptr2mfn (void *ptr) +static VasEBoot_xen_mfn_t +VasEBoot_xen_ptr2mfn (void *ptr) { - grub_xen_mfn_t *mfn_list = - (grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list; - return mfn_list[(grub_addr_t) ptr >> GRUB_XEN_LOG_PAGE_SIZE]; + VasEBoot_xen_mfn_t *mfn_list = + (VasEBoot_xen_mfn_t *) VasEBoot_xen_start_page_addr->mfn_list; + return mfn_list[(VasEBoot_addr_t) ptr >> VasEBoot_XEN_LOG_PAGE_SIZE]; } void * -grub_xen_alloc_shared_page (domid_t dom, grub_xen_grant_t * grnum) +VasEBoot_xen_alloc_shared_page (domid_t dom, VasEBoot_xen_grant_t * grnum) { void *ret; - grub_xen_mfn_t mfn; + VasEBoot_xen_mfn_t mfn; volatile grant_entry_v1_t *entry; /* Avoid 0. */ - for (entry = grub_xen_grant_table; - entry < grub_xen_grant_table + total_grants; entry++) + for (entry = VasEBoot_xen_grant_table; + entry < VasEBoot_xen_grant_table + total_grants; entry++) if (!entry->flags) break; - if (entry == grub_xen_grant_table + total_grants) + if (entry == VasEBoot_xen_grant_table + total_grants) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of grant entries"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "out of grant entries"); return NULL; } - ret = grub_memalign (GRUB_XEN_PAGE_SIZE, GRUB_XEN_PAGE_SIZE); + ret = VasEBoot_memalign (VasEBoot_XEN_PAGE_SIZE, VasEBoot_XEN_PAGE_SIZE); if (!ret) return NULL; - mfn = grub_xen_ptr2mfn (ret); + mfn = VasEBoot_xen_ptr2mfn (ret); entry->frame = mfn; entry->domid = dom; mb (); entry->flags = GTF_permit_access; mb (); - *grnum = entry - grub_xen_grant_table; - grub_xen_n_allocated_shared_pages++; + *grnum = entry - VasEBoot_xen_grant_table; + VasEBoot_xen_n_allocated_shared_pages++; return ret; } void -grub_xen_free_shared_page (void *ptr) +VasEBoot_xen_free_shared_page (void *ptr) { - grub_xen_mfn_t mfn; + VasEBoot_xen_mfn_t mfn; volatile grant_entry_v1_t *entry; - mfn = grub_xen_ptr2mfn (ptr); - for (entry = grub_xen_grant_table + 1; - entry < grub_xen_grant_table + total_grants; entry++) + mfn = VasEBoot_xen_ptr2mfn (ptr); + for (entry = VasEBoot_xen_grant_table + 1; + entry < VasEBoot_xen_grant_table + total_grants; entry++) if (entry->flags && entry->frame == mfn) { mb (); @@ -95,17 +95,17 @@ grub_xen_free_shared_page (void *ptr) entry->frame = 0; mb (); } - grub_xen_n_allocated_shared_pages--; + VasEBoot_xen_n_allocated_shared_pages--; } void -grub_machine_get_bootlocation (char **device __attribute__ ((unused)), +VasEBoot_machine_get_bootlocation (char **device __attribute__ ((unused)), char **path __attribute__ ((unused))) { } -static grub_uint8_t window[GRUB_XEN_PAGE_SIZE] - __attribute__ ((aligned (GRUB_XEN_PAGE_SIZE))); +static VasEBoot_uint8_t window[VasEBoot_XEN_PAGE_SIZE] + __attribute__ ((aligned (VasEBoot_XEN_PAGE_SIZE))); #ifdef __x86_64__ #define NUMBER_OF_LEVELS 4 @@ -117,128 +117,128 @@ static grub_uint8_t window[GRUB_XEN_PAGE_SIZE] #define POINTERS_PER_PAGE (1 << LOG_POINTERS_PER_PAGE) void -grub_xen_store_send (const void *buf_, grub_size_t len) +VasEBoot_xen_store_send (const void *buf_, VasEBoot_size_t len) { - const grub_uint8_t *buf = buf_; + const VasEBoot_uint8_t *buf = buf_; struct evtchn_send send; int event_sent = 0; while (len) { - grub_size_t avail, inbuf; - grub_size_t prod, cons; + VasEBoot_size_t avail, inbuf; + VasEBoot_size_t prod, cons; mb (); - prod = grub_xen_xenstore->req_prod; - cons = grub_xen_xenstore->req_cons; - if (prod >= cons + sizeof (grub_xen_xenstore->req)) + prod = VasEBoot_xen_xenstore->req_prod; + cons = VasEBoot_xen_xenstore->req_cons; + if (prod >= cons + sizeof (VasEBoot_xen_xenstore->req)) { if (!event_sent) { - send.port = grub_xen_start_page_addr->store_evtchn; - grub_xen_event_channel_op (EVTCHNOP_send, &send); + send.port = VasEBoot_xen_start_page_addr->store_evtchn; + VasEBoot_xen_event_channel_op (EVTCHNOP_send, &send); event_sent = 1; } - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); continue; } event_sent = 0; - avail = cons + sizeof (grub_xen_xenstore->req) - prod; - inbuf = (~prod & (sizeof (grub_xen_xenstore->req) - 1)) + 1; + avail = cons + sizeof (VasEBoot_xen_xenstore->req) - prod; + inbuf = (~prod & (sizeof (VasEBoot_xen_xenstore->req) - 1)) + 1; if (avail > inbuf) avail = inbuf; if (avail > len) avail = len; - grub_memcpy ((void *) &grub_xen_xenstore->req[prod & (sizeof (grub_xen_xenstore->req) - 1)], + VasEBoot_memcpy ((void *) &VasEBoot_xen_xenstore->req[prod & (sizeof (VasEBoot_xen_xenstore->req) - 1)], buf, avail); buf += avail; len -= avail; mb (); - grub_xen_xenstore->req_prod += avail; + VasEBoot_xen_xenstore->req_prod += avail; mb (); if (!event_sent) { - send.port = grub_xen_start_page_addr->store_evtchn; - grub_xen_event_channel_op (EVTCHNOP_send, &send); + send.port = VasEBoot_xen_start_page_addr->store_evtchn; + VasEBoot_xen_event_channel_op (EVTCHNOP_send, &send); event_sent = 1; } - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); } } void -grub_xen_store_recv (void *buf_, grub_size_t len) +VasEBoot_xen_store_recv (void *buf_, VasEBoot_size_t len) { - grub_uint8_t *buf = buf_; + VasEBoot_uint8_t *buf = buf_; struct evtchn_send send; int event_sent = 0; while (len) { - grub_size_t avail, inbuf; - grub_size_t prod, cons; + VasEBoot_size_t avail, inbuf; + VasEBoot_size_t prod, cons; mb (); - prod = grub_xen_xenstore->rsp_prod; - cons = grub_xen_xenstore->rsp_cons; + prod = VasEBoot_xen_xenstore->rsp_prod; + cons = VasEBoot_xen_xenstore->rsp_cons; if (prod <= cons) { if (!event_sent) { - send.port = grub_xen_start_page_addr->store_evtchn; - grub_xen_event_channel_op (EVTCHNOP_send, &send); + send.port = VasEBoot_xen_start_page_addr->store_evtchn; + VasEBoot_xen_event_channel_op (EVTCHNOP_send, &send); event_sent = 1; } - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); continue; } event_sent = 0; avail = prod - cons; - inbuf = (~cons & (sizeof (grub_xen_xenstore->req) - 1)) + 1; + inbuf = (~cons & (sizeof (VasEBoot_xen_xenstore->req) - 1)) + 1; if (avail > inbuf) avail = inbuf; if (avail > len) avail = len; - grub_memcpy (buf, - (void *) &grub_xen_xenstore->rsp[cons & (sizeof (grub_xen_xenstore->rsp) - 1)], + VasEBoot_memcpy (buf, + (void *) &VasEBoot_xen_xenstore->rsp[cons & (sizeof (VasEBoot_xen_xenstore->rsp) - 1)], avail); buf += avail; len -= avail; mb (); - grub_xen_xenstore->rsp_cons += avail; + VasEBoot_xen_xenstore->rsp_cons += avail; mb (); if (!event_sent) { - send.port = grub_xen_start_page_addr->store_evtchn; - grub_xen_event_channel_op(EVTCHNOP_send, &send); + send.port = VasEBoot_xen_start_page_addr->store_evtchn; + VasEBoot_xen_event_channel_op(EVTCHNOP_send, &send); event_sent = 1; } - grub_xen_sched_op(SCHEDOP_yield, 0); + VasEBoot_xen_sched_op(SCHEDOP_yield, 0); } } void * -grub_xenstore_get_file (const char *dir, grub_size_t *len) +VasEBoot_xenstore_get_file (const char *dir, VasEBoot_size_t *len) { struct xsd_sockmsg msg; char *buf; - grub_size_t dirlen = grub_strlen (dir) + 1; + VasEBoot_size_t dirlen = VasEBoot_strlen (dir) + 1; if (len) *len = 0; - grub_memset (&msg, 0, sizeof (msg)); + VasEBoot_memset (&msg, 0, sizeof (msg)); msg.type = XS_READ; msg.len = dirlen; - grub_xen_store_send (&msg, sizeof (msg)); - grub_xen_store_send (dir, dirlen); - grub_xen_store_recv (&msg, sizeof (msg)); - buf = grub_malloc (msg.len + 1); + VasEBoot_xen_store_send (&msg, sizeof (msg)); + VasEBoot_xen_store_send (dir, dirlen); + VasEBoot_xen_store_recv (&msg, sizeof (msg)); + buf = VasEBoot_malloc (msg.len + 1); if (!buf) return NULL; - grub_dprintf ("xen", "msg type = %d, len = %d\n", msg.type, msg.len); - grub_xen_store_recv (buf, msg.len); + VasEBoot_dprintf ("xen", "msg type = %d, len = %d\n", msg.type, msg.len); + VasEBoot_xen_store_recv (buf, msg.len); buf[msg.len] = '\0'; if (msg.type == XS_ERROR) { - grub_error (GRUB_ERR_IO, "couldn't read xenstorage `%s': %s", dir, buf); - grub_free (buf); + VasEBoot_error (VasEBoot_ERR_IO, "couldn't read xenstorage `%s': %s", dir, buf); + VasEBoot_free (buf); return NULL; } if (len) @@ -246,74 +246,74 @@ grub_xenstore_get_file (const char *dir, grub_size_t *len) return buf; } -grub_err_t -grub_xenstore_write_file (const char *dir, const void *buf, grub_size_t len) +VasEBoot_err_t +VasEBoot_xenstore_write_file (const char *dir, const void *buf, VasEBoot_size_t len) { struct xsd_sockmsg msg; - grub_size_t dirlen = grub_strlen (dir) + 1; + VasEBoot_size_t dirlen = VasEBoot_strlen (dir) + 1; char *resp; - grub_memset (&msg, 0, sizeof (msg)); + VasEBoot_memset (&msg, 0, sizeof (msg)); msg.type = XS_WRITE; msg.len = dirlen + len; - grub_xen_store_send (&msg, sizeof (msg)); - grub_xen_store_send (dir, dirlen); - grub_xen_store_send (buf, len); - grub_xen_store_recv (&msg, sizeof (msg)); - resp = grub_malloc (msg.len + 1); + VasEBoot_xen_store_send (&msg, sizeof (msg)); + VasEBoot_xen_store_send (dir, dirlen); + VasEBoot_xen_store_send (buf, len); + VasEBoot_xen_store_recv (&msg, sizeof (msg)); + resp = VasEBoot_malloc (msg.len + 1); if (!resp) - return grub_errno; - grub_dprintf ("xen", "msg type = %d, len = %d\n", msg.type, msg.len); - grub_xen_store_recv (resp, msg.len); + return VasEBoot_errno; + VasEBoot_dprintf ("xen", "msg type = %d, len = %d\n", msg.type, msg.len); + VasEBoot_xen_store_recv (resp, msg.len); resp[msg.len] = '\0'; if (msg.type == XS_ERROR) { - grub_dprintf ("xen", "error = %s\n", resp); - grub_error (GRUB_ERR_IO, "couldn't read xenstorage `%s': %s", + VasEBoot_dprintf ("xen", "error = %s\n", resp); + VasEBoot_error (VasEBoot_ERR_IO, "couldn't read xenstorage `%s': %s", dir, resp); - grub_free (resp); - return grub_errno; + VasEBoot_free (resp); + return VasEBoot_errno; } - grub_free (resp); - return GRUB_ERR_NONE; + VasEBoot_free (resp); + return VasEBoot_ERR_NONE; } /* FIXME: error handling. */ -grub_err_t -grub_xenstore_dir (const char *dir, +VasEBoot_err_t +VasEBoot_xenstore_dir (const char *dir, int (*hook) (const char *dir, void *hook_data), void *hook_data) { struct xsd_sockmsg msg; char *buf; char *ptr; - grub_size_t dirlen = grub_strlen (dir) + 1; + VasEBoot_size_t dirlen = VasEBoot_strlen (dir) + 1; - grub_memset (&msg, 0, sizeof (msg)); + VasEBoot_memset (&msg, 0, sizeof (msg)); msg.type = XS_DIRECTORY; msg.len = dirlen; - grub_xen_store_send (&msg, sizeof (msg)); - grub_xen_store_send (dir, dirlen); - grub_xen_store_recv (&msg, sizeof (msg)); - buf = grub_malloc (msg.len + 1); + VasEBoot_xen_store_send (&msg, sizeof (msg)); + VasEBoot_xen_store_send (dir, dirlen); + VasEBoot_xen_store_recv (&msg, sizeof (msg)); + buf = VasEBoot_malloc (msg.len + 1); if (!buf) - return grub_errno; - grub_dprintf ("xen", "msg type = %d, len = %d\n", msg.type, msg.len); - grub_xen_store_recv (buf, msg.len); + return VasEBoot_errno; + VasEBoot_dprintf ("xen", "msg type = %d, len = %d\n", msg.type, msg.len); + VasEBoot_xen_store_recv (buf, msg.len); buf[msg.len] = '\0'; if (msg.type == XS_ERROR) { - grub_err_t err; - err = grub_error (GRUB_ERR_IO, "couldn't read xenstorage `%s': %s", + VasEBoot_err_t err; + err = VasEBoot_error (VasEBoot_ERR_IO, "couldn't read xenstorage `%s': %s", dir, buf); - grub_free (buf); + VasEBoot_free (buf); return err; } - for (ptr = buf; ptr < buf + msg.len; ptr += grub_strlen (ptr) + 1) + for (ptr = buf; ptr < buf + msg.len; ptr += VasEBoot_strlen (ptr) + 1) if (hook (ptr, hook_data)) break; - grub_free (buf); - return grub_errno; + VasEBoot_free (buf); + return VasEBoot_errno; } unsigned long gntframe = 0; @@ -321,21 +321,21 @@ unsigned long gntframe = 0; #define MAX_N_UNUSABLE_PAGES 4 static int -grub_xen_is_page_usable (grub_xen_mfn_t mfn) +VasEBoot_xen_is_page_usable (VasEBoot_xen_mfn_t mfn) { - if (mfn == grub_xen_start_page_addr->console.domU.mfn) + if (mfn == VasEBoot_xen_start_page_addr->console.domU.mfn) return 0; - if (mfn == grub_xen_start_page_addr->shared_info) + if (mfn == VasEBoot_xen_start_page_addr->shared_info) return 0; - if (mfn == grub_xen_start_page_addr->store_mfn) + if (mfn == VasEBoot_xen_start_page_addr->store_mfn) return 0; if (mfn == gntframe) return 0; return 1; } -static grub_uint64_t -page2offset (grub_uint64_t page) +static VasEBoot_uint64_t +page2offset (VasEBoot_uint64_t page) { return page << 12; } @@ -351,41 +351,41 @@ page2offset (grub_uint64_t page) static void map_all_pages (void) { - grub_uint64_t total_pages = grub_xen_start_page_addr->nr_pages; - grub_uint64_t i, j; - grub_xen_mfn_t *mfn_list = - (grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list; - grub_uint64_t *pg = (grub_uint64_t *) window; - grub_uint64_t oldpgstart, oldpgend; + VasEBoot_uint64_t total_pages = VasEBoot_xen_start_page_addr->nr_pages; + VasEBoot_uint64_t i, j; + VasEBoot_xen_mfn_t *mfn_list = + (VasEBoot_xen_mfn_t *) VasEBoot_xen_start_page_addr->mfn_list; + VasEBoot_uint64_t *pg = (VasEBoot_uint64_t *) window; + VasEBoot_uint64_t oldpgstart, oldpgend; struct gnttab_setup_table gnttab_setup; struct gnttab_set_version gnttab_setver; - grub_size_t n_unusable_pages = 0; + VasEBoot_size_t n_unusable_pages = 0; struct mmu_update m2p_updates[2 * MAX_N_UNUSABLE_PAGES]; if (total_pages > MAX_TOTAL_PAGES - 4) total_pages = MAX_TOTAL_PAGES - 4; - grub_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); + VasEBoot_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); gnttab_setver.version = 1; - grub_xen_grant_table_op (GNTTABOP_set_version, &gnttab_setver, 1); + VasEBoot_xen_grant_table_op (GNTTABOP_set_version, &gnttab_setver, 1); - grub_memset (&gnttab_setup, 0, sizeof (gnttab_setup)); + VasEBoot_memset (&gnttab_setup, 0, sizeof (gnttab_setup)); gnttab_setup.dom = DOMID_SELF; gnttab_setup.nr_frames = 1; gnttab_setup.frame_list.p = &gntframe; - grub_xen_grant_table_op (GNTTABOP_setup_table, &gnttab_setup, 1); + VasEBoot_xen_grant_table_op (GNTTABOP_setup_table, &gnttab_setup, 1); for (j = 0; j < total_pages - n_unusable_pages; j++) - while (!grub_xen_is_page_usable (mfn_list[j])) + while (!VasEBoot_xen_is_page_usable (mfn_list[j])) { - grub_xen_mfn_t t; + VasEBoot_xen_mfn_t t; if (n_unusable_pages >= MAX_N_UNUSABLE_PAGES) { struct sched_shutdown arg; arg.reason = SHUTDOWN_crash; - grub_xen_sched_op (SCHEDOP_shutdown, &arg); + VasEBoot_xen_sched_op (SCHEDOP_shutdown, &arg); while (1); } t = mfn_list[j]; @@ -404,12 +404,12 @@ map_all_pages (void) n_unusable_pages++; } - grub_xen_mmu_update (m2p_updates, 2 * n_unusable_pages, NULL, DOMID_SELF); + VasEBoot_xen_mmu_update (m2p_updates, 2 * n_unusable_pages, NULL, DOMID_SELF); total_pages += 4; - grub_uint64_t lx[NUMBER_OF_LEVELS], nlx; - grub_uint64_t paging_start = total_pages - 4 - n_unusable_pages, curpage; + VasEBoot_uint64_t lx[NUMBER_OF_LEVELS], nlx; + VasEBoot_uint64_t paging_start = total_pages - 4 - n_unusable_pages, curpage; for (nlx = total_pages, i = 0; i < (unsigned) NUMBER_OF_LEVELS; i++) { @@ -423,8 +423,8 @@ map_all_pages (void) paging_start -= nlx; } - oldpgstart = grub_xen_start_page_addr->pt_base >> 12; - oldpgend = oldpgstart + grub_xen_start_page_addr->nr_pt_frames; + oldpgstart = VasEBoot_xen_start_page_addr->pt_base >> 12; + oldpgend = oldpgstart + VasEBoot_xen_start_page_addr->nr_pt_frames; curpage = paging_start; @@ -434,10 +434,10 @@ map_all_pages (void) { for (i = 0; i < lx[l]; i++) { - grub_xen_update_va_mapping (&window, + VasEBoot_xen_update_va_mapping (&window, page2offset (mfn_list[curpage + i]) | 7, UVMF_INVLPG); - grub_memset (&window, 0, sizeof (window)); + VasEBoot_memset (&window, 0, sizeof (window)); for (j = i * POINTERS_PER_PAGE; j < (i + 1) * POINTERS_PER_PAGE && j < lx[l - 1]; j++) @@ -453,43 +453,43 @@ map_all_pages (void) for (i = 0; i < lx[0]; i++) { - grub_xen_update_va_mapping (&window, + VasEBoot_xen_update_va_mapping (&window, page2offset (mfn_list[curpage + i]) | 7, UVMF_INVLPG); - grub_memset (&window, 0, sizeof (window)); + VasEBoot_memset (&window, 0, sizeof (window)); for (j = i * POINTERS_PER_PAGE; j < (i + 1) * POINTERS_PER_PAGE && j < total_pages; j++) if (j < paging_start && !(j >= oldpgstart && j < oldpgend)) pg[j - i * POINTERS_PER_PAGE] = page2offset (mfn_list[j]) | 0x7; - else if (j < grub_xen_start_page_addr->nr_pages) + else if (j < VasEBoot_xen_start_page_addr->nr_pages) pg[j - i * POINTERS_PER_PAGE] = page2offset (mfn_list[j]) | 5; - else if (j == grub_xen_start_page_addr->nr_pages) + else if (j == VasEBoot_xen_start_page_addr->nr_pages) { pg[j - i * POINTERS_PER_PAGE] = - page2offset (grub_xen_start_page_addr->console.domU.mfn) | 7; - grub_xen_xcons = (void *) (grub_addr_t) page2offset (j); + page2offset (VasEBoot_xen_start_page_addr->console.domU.mfn) | 7; + VasEBoot_xen_xcons = (void *) (VasEBoot_addr_t) page2offset (j); } - else if (j == grub_xen_start_page_addr->nr_pages + 1) + else if (j == VasEBoot_xen_start_page_addr->nr_pages + 1) { pg[j - i * POINTERS_PER_PAGE] = - grub_xen_start_page_addr->shared_info | 7; - grub_xen_shared_info = (void *) (grub_addr_t) page2offset (j); + VasEBoot_xen_start_page_addr->shared_info | 7; + VasEBoot_xen_shared_info = (void *) (VasEBoot_addr_t) page2offset (j); } - else if (j == grub_xen_start_page_addr->nr_pages + 2) + else if (j == VasEBoot_xen_start_page_addr->nr_pages + 2) { pg[j - i * POINTERS_PER_PAGE] = - page2offset (grub_xen_start_page_addr->store_mfn) | 7; - grub_xen_xenstore = (void *) (grub_addr_t) page2offset (j); + page2offset (VasEBoot_xen_start_page_addr->store_mfn) | 7; + VasEBoot_xen_xenstore = (void *) (VasEBoot_addr_t) page2offset (j); } - else if (j == grub_xen_start_page_addr->nr_pages + 3) + else if (j == VasEBoot_xen_start_page_addr->nr_pages + 3) { pg[j - i * POINTERS_PER_PAGE] = page2offset (gntframe) | 7; - grub_xen_grant_table = (void *) (grub_addr_t) page2offset (j); + VasEBoot_xen_grant_table = (void *) (VasEBoot_addr_t) page2offset (j); } } - grub_xen_update_va_mapping (&window, 0, UVMF_INVLPG); + VasEBoot_xen_update_va_mapping (&window, 0, UVMF_INVLPG); mmuext_op_t op[3]; @@ -500,81 +500,81 @@ map_all_pages (void) op[2].cmd = MMUEXT_UNPIN_TABLE; op[2].arg1.mfn = mfn_list[oldpgstart]; - grub_xen_mmuext_op (op, 3, NULL, DOMID_SELF); + VasEBoot_xen_mmuext_op (op, 3, NULL, DOMID_SELF); for (i = oldpgstart; i < oldpgend; i++) - grub_xen_update_va_mapping ((void *) (grub_addr_t) page2offset (i), + VasEBoot_xen_update_va_mapping ((void *) (VasEBoot_addr_t) page2offset (i), page2offset (mfn_list[i]) | 7, UVMF_INVLPG); void *new_start_page, *new_mfn_list; - new_start_page = (void *) (grub_addr_t) page2offset (paging_start - 1); - grub_memcpy (new_start_page, grub_xen_start_page_addr, 4096); - grub_xen_start_page_addr = new_start_page; - new_mfn_list = (void *) (grub_addr_t) + new_start_page = (void *) (VasEBoot_addr_t) page2offset (paging_start - 1); + VasEBoot_memcpy (new_start_page, VasEBoot_xen_start_page_addr, 4096); + VasEBoot_xen_start_page_addr = new_start_page; + new_mfn_list = (void *) (VasEBoot_addr_t) page2offset (paging_start - 1 - - ((grub_xen_start_page_addr->nr_pages - * sizeof (grub_uint64_t) + 4095) / 4096)); - grub_memcpy (new_mfn_list, mfn_list, grub_xen_start_page_addr->nr_pages - * sizeof (grub_uint64_t)); - grub_xen_start_page_addr->pt_base = page2offset (paging_start); - grub_xen_start_page_addr->mfn_list = (grub_addr_t) new_mfn_list; + - ((VasEBoot_xen_start_page_addr->nr_pages + * sizeof (VasEBoot_uint64_t) + 4095) / 4096)); + VasEBoot_memcpy (new_mfn_list, mfn_list, VasEBoot_xen_start_page_addr->nr_pages + * sizeof (VasEBoot_uint64_t)); + VasEBoot_xen_start_page_addr->pt_base = page2offset (paging_start); + VasEBoot_xen_start_page_addr->mfn_list = (VasEBoot_addr_t) new_mfn_list; - grub_addr_t heap_start = grub_modules_get_end (); - grub_addr_t heap_end = (grub_addr_t) new_mfn_list; + VasEBoot_addr_t heap_start = VasEBoot_modules_get_end (); + VasEBoot_addr_t heap_end = (VasEBoot_addr_t) new_mfn_list; - grub_mm_init_region ((void *) heap_start, heap_end - heap_start); + VasEBoot_mm_init_region ((void *) heap_start, heap_end - heap_start); } extern char _end[]; void -grub_machine_init (void) +VasEBoot_machine_init (void) { #ifdef __i386__ - grub_xen_vm_assist (VMASST_CMD_enable, VMASST_TYPE_pae_extended_cr3); + VasEBoot_xen_vm_assist (VMASST_CMD_enable, VMASST_TYPE_pae_extended_cr3); #endif - grub_modbase = ALIGN_UP ((grub_addr_t) _end - + GRUB_KERNEL_MACHINE_MOD_GAP, - GRUB_KERNEL_MACHINE_MOD_ALIGN); + VasEBoot_modbase = ALIGN_UP ((VasEBoot_addr_t) _end + + VasEBoot_KERNEL_MACHINE_MOD_GAP, + VasEBoot_KERNEL_MACHINE_MOD_ALIGN); map_all_pages (); - grub_console_init (); + VasEBoot_console_init (); - grub_tsc_init (); + VasEBoot_tsc_init (); - grub_xendisk_init (); + VasEBoot_xendisk_init (); - grub_boot_init (); + VasEBoot_boot_init (); } void -grub_exit (void) +VasEBoot_exit (void) { struct sched_shutdown arg; arg.reason = SHUTDOWN_poweroff; - grub_xen_sched_op (SCHEDOP_shutdown, &arg); + VasEBoot_xen_sched_op (SCHEDOP_shutdown, &arg); while (1); } void -grub_machine_fini (int flags __attribute__ ((unused))) +VasEBoot_machine_fini (int flags __attribute__ ((unused))) { - grub_xendisk_fini (); - grub_boot_fini (); + VasEBoot_xendisk_fini (); + VasEBoot_boot_fini (); } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - grub_uint64_t total_pages = grub_xen_start_page_addr->nr_pages; - grub_uint64_t usable_pages = grub_xen_start_page_addr->pt_base >> 12; - if (hook (0, page2offset (usable_pages), GRUB_MEMORY_AVAILABLE, hook_data)) - return GRUB_ERR_NONE; + VasEBoot_uint64_t total_pages = VasEBoot_xen_start_page_addr->nr_pages; + VasEBoot_uint64_t usable_pages = VasEBoot_xen_start_page_addr->pt_base >> 12; + if (hook (0, page2offset (usable_pages), VasEBoot_MEMORY_AVAILABLE, hook_data)) + return VasEBoot_ERR_NONE; hook (page2offset (usable_pages), page2offset (total_pages - usable_pages), - GRUB_MEMORY_RESERVED, hook_data); + VasEBoot_MEMORY_RESERVED, hook_data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/LzFind.c b/VasEBoot-core/lib/LzFind.c index dcb20d921..d1a05d0df 100644 --- a/VasEBoot-core/lib/LzFind.c +++ b/VasEBoot-core/lib/LzFind.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ @@ -29,8 +29,8 @@ #include -#include -#include +#include +#include #define kEmptyHashValue 0 #define kMaxValForNormalize ((UInt32)0xFFFFFFFF) diff --git a/VasEBoot-core/lib/LzmaDec.c b/VasEBoot-core/lib/LzmaDec.c index 952edb346..7c3c397f7 100644 --- a/VasEBoot-core/lib/LzmaDec.c +++ b/VasEBoot-core/lib/LzmaDec.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ -#include +#include #pragma GCC diagnostic ignored "-Wshadow" -#include -#define memcpy grub_memcpy +#include +#define memcpy VasEBoot_memcpy #define kNumTopBits 24 #define kTopValue ((UInt32)1 << kNumTopBits) diff --git a/VasEBoot-core/lib/LzmaEnc.c b/VasEBoot-core/lib/LzmaEnc.c index f2ec04a8c..a7a799648 100644 --- a/VasEBoot-core/lib/LzmaEnc.c +++ b/VasEBoot-core/lib/LzmaEnc.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ @@ -29,11 +29,11 @@ #include #include -#include +#include -#include +#include #ifdef COMPRESS_MF_MT -#include +#include #endif /* #define SHOW_STAT */ diff --git a/VasEBoot-core/lib/adler32.c b/VasEBoot-core/lib/adler32.c index 43b68af62..c2cc80c31 100644 --- a/VasEBoot-core/lib/adler32.c +++ b/VasEBoot-core/lib/adler32.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct adler32_context { - grub_uint16_t a, b; - grub_uint32_t c; + VasEBoot_uint16_t a, b; + VasEBoot_uint32_t c; }; static void @@ -39,19 +39,19 @@ adler32_init (void *context) #define MOD 65521 -static grub_uint16_t -mod_add (grub_uint16_t a, grub_uint16_t b) +static VasEBoot_uint16_t +mod_add (VasEBoot_uint16_t a, VasEBoot_uint16_t b) { - if ((grub_uint32_t) a + (grub_uint32_t) b >= MOD) + if ((VasEBoot_uint32_t) a + (VasEBoot_uint32_t) b >= MOD) return a + b - MOD; return a + b; } static void -adler32_write (void *context, const void *inbuf, grub_size_t inlen) +adler32_write (void *context, const void *inbuf, VasEBoot_size_t inlen) { struct adler32_context *ctx = context; - const grub_uint8_t *ptr = inbuf; + const VasEBoot_uint8_t *ptr = inbuf; while (inlen) { @@ -67,7 +67,7 @@ adler32_final (void *context __attribute__ ((unused))) { } -static grub_uint8_t * +static VasEBoot_uint8_t * adler32_read (void *context) { struct adler32_context *ctx = context; @@ -75,8 +75,8 @@ adler32_read (void *context) ctx->a -= MOD; if (ctx->b > MOD) ctx->b -= MOD; - ctx->c = grub_cpu_to_be32 (ctx->a | (ctx->b << 16)); - return (grub_uint8_t *) &ctx->c; + ctx->c = VasEBoot_cpu_to_be32 (ctx->a | (ctx->b << 16)); + return (VasEBoot_uint8_t *) &ctx->c; } static gcry_md_spec_t spec_adler32 = @@ -84,19 +84,19 @@ static gcry_md_spec_t spec_adler32 = "ADLER32", 0, 0, 0, 4, adler32_init, adler32_write, adler32_final, adler32_read, sizeof (struct adler32_context), -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL .modname = "adler32", #endif .blocksize = 64 }; -GRUB_MOD_INIT(adler32) +VasEBoot_MOD_INIT(adler32) { - grub_md_register (&spec_adler32); + VasEBoot_md_register (&spec_adler32); } -GRUB_MOD_FINI(adler32) +VasEBoot_MOD_FINI(adler32) { - grub_md_unregister (&spec_adler32); + VasEBoot_md_unregister (&spec_adler32); } diff --git a/VasEBoot-core/lib/arc/datetime.c b/VasEBoot-core/lib/arc/datetime.c index b8d910e5f..2777e7b1e 100644 --- a/VasEBoot-core/lib/arc/datetime.c +++ b/VasEBoot-core/lib/arc/datetime.c @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_err_t -grub_get_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_get_datetime (struct VasEBoot_datetime *datetime) { - struct grub_arc_timeinfo *dt; - grub_memset (datetime, 0, sizeof (*datetime)); + struct VasEBoot_arc_timeinfo *dt; + VasEBoot_memset (datetime, 0, sizeof (*datetime)); - dt = GRUB_ARC_FIRMWARE_VECTOR->gettime (); + dt = VasEBoot_ARC_FIRMWARE_VECTOR->gettime (); datetime->year = dt->y; datetime->month = dt->m; @@ -41,8 +41,8 @@ grub_get_datetime (struct grub_datetime *datetime) return 0; } -grub_err_t -grub_set_datetime (struct grub_datetime *datetime __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_set_datetime (struct VasEBoot_datetime *datetime __attribute__ ((unused))) { - return grub_error (GRUB_ERR_IO, "setting time isn't supported"); + return VasEBoot_error (VasEBoot_ERR_IO, "setting time isn't supported"); } diff --git a/VasEBoot-core/lib/arg.c b/VasEBoot-core/lib/arg.c index fd7744a6f..78d7718b3 100644 --- a/VasEBoot-core/lib/arg.c +++ b/VasEBoot-core/lib/arg.c @@ -1,31 +1,31 @@ /* arg.c - argument parser */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* Built-in parser for default options. */ -static const struct grub_arg_option help_options[] = +static const struct VasEBoot_arg_option help_options[] = { {"help", 0, 0, N_("Display this help and exit."), 0, ARG_TYPE_NONE}, @@ -35,8 +35,8 @@ static const struct grub_arg_option help_options[] = }; /* Helper for find_short. */ -static const struct grub_arg_option * -fnd_short (const struct grub_arg_option *opt, char c) +static const struct VasEBoot_arg_option * +fnd_short (const struct VasEBoot_arg_option *opt, char c) { while (opt->doc) { @@ -47,10 +47,10 @@ fnd_short (const struct grub_arg_option *opt, char c) return 0; } -static const struct grub_arg_option * -find_short (const struct grub_arg_option *options, char c) +static const struct VasEBoot_arg_option * +find_short (const struct VasEBoot_arg_option *options, char c) { - const struct grub_arg_option *found = 0; + const struct VasEBoot_arg_option *found = 0; if (options) found = fnd_short (options, c); @@ -76,12 +76,12 @@ find_short (const struct grub_arg_option *options, char c) } /* Helper for find_long. */ -static const struct grub_arg_option * -fnd_long (const struct grub_arg_option *opt, const char *s, int len) +static const struct VasEBoot_arg_option * +fnd_long (const struct VasEBoot_arg_option *opt, const char *s, int len) { while (opt->doc) { - if (opt->longarg && ! grub_strncmp (opt->longarg, s, len) && + if (opt->longarg && ! VasEBoot_strncmp (opt->longarg, s, len) && opt->longarg[len] == '\0') return opt; opt++; @@ -89,10 +89,10 @@ fnd_long (const struct grub_arg_option *opt, const char *s, int len) return 0; } -static const struct grub_arg_option * -find_long (const struct grub_arg_option *options, const char *s, int len) +static const struct VasEBoot_arg_option * +find_long (const struct VasEBoot_arg_option *options, const char *s, int len) { - const struct grub_arg_option *found = 0; + const struct VasEBoot_arg_option *found = 0; if (options) found = fnd_long (options, s, len); @@ -104,37 +104,37 @@ find_long (const struct grub_arg_option *options, const char *s, int len) } static void -show_usage (grub_extcmd_t cmd) +show_usage (VasEBoot_extcmd_t cmd) { - grub_printf ("%s %s %s\n", _("Usage:"), cmd->cmd->name, _(cmd->cmd->summary)); + VasEBoot_printf ("%s %s %s\n", _("Usage:"), cmd->cmd->name, _(cmd->cmd->summary)); } static void -showargs (const struct grub_arg_option *opt, +showargs (const struct VasEBoot_arg_option *opt, int h_is_used, int u_is_used) { for (; opt->doc; opt++) { int spacing = 20; - if (opt->shortarg && grub_isgraph (opt->shortarg)) - grub_printf ("-%c%c ", opt->shortarg, opt->longarg ? ',':' '); + if (opt->shortarg && VasEBoot_isgraph (opt->shortarg)) + VasEBoot_printf ("-%c%c ", opt->shortarg, opt->longarg ? ',':' '); else if (opt == help_options && ! h_is_used) - grub_printf ("-h, "); + VasEBoot_printf ("-h, "); else if (opt == help_options + 1 && ! u_is_used) - grub_printf ("-u, "); + VasEBoot_printf ("-u, "); else - grub_printf (" "); + VasEBoot_printf (" "); if (opt->longarg) { - grub_printf ("--%s", opt->longarg); - spacing -= grub_strlen (opt->longarg) + 2; + VasEBoot_printf ("--%s", opt->longarg); + spacing -= VasEBoot_strlen (opt->longarg) + 2; if (opt->arg) { - grub_printf ("=%s", opt->arg); - spacing -= grub_strlen (opt->arg) + 1; + VasEBoot_printf ("=%s", opt->arg); + spacing -= VasEBoot_strlen (opt->arg) + 1; } } @@ -142,21 +142,21 @@ showargs (const struct grub_arg_option *opt, spacing = 3; while (spacing--) - grub_xputs (" "); + VasEBoot_xputs (" "); - grub_printf ("%s\n", _(opt->doc)); + VasEBoot_printf ("%s\n", _(opt->doc)); } } void -grub_arg_show_help (grub_extcmd_t cmd) +VasEBoot_arg_show_help (VasEBoot_extcmd_t cmd) { int h_is_used = 0; int u_is_used = 0; - const struct grub_arg_option *opt; + const struct VasEBoot_arg_option *opt; show_usage (cmd); - grub_printf ("%s\n\n", _(cmd->cmd->description)); + VasEBoot_printf ("%s\n\n", _(cmd->cmd->description)); for (opt = cmd->options; opt && opt->doc; opt++) switch (opt->shortarg) @@ -174,18 +174,18 @@ grub_arg_show_help (grub_extcmd_t cmd) showargs (cmd->options, h_is_used, u_is_used); showargs (help_options, h_is_used, u_is_used); #if 0 - grub_printf ("\nReport bugs to <%s>.\n", PACKAGE_BUGREPORT); + VasEBoot_printf ("\nReport bugs to <%s>.\n", PACKAGE_BUGREPORT); #endif } static int -parse_option (grub_extcmd_t cmd, const struct grub_arg_option *opt, - char *arg, struct grub_arg_list *usr) +parse_option (VasEBoot_extcmd_t cmd, const struct VasEBoot_arg_option *opt, + char *arg, struct VasEBoot_arg_list *usr) { if (opt == help_options) { - grub_arg_show_help (cmd); + VasEBoot_arg_show_help (cmd); return -1; } @@ -197,7 +197,7 @@ parse_option (grub_extcmd_t cmd, const struct grub_arg_option *opt, { int found = opt - cmd->options; - if (opt->flags & GRUB_ARG_OPTION_REPEATABLE) + if (opt->flags & VasEBoot_ARG_OPTION_REPEATABLE) { usr[found].args[usr[found].set++] = arg; usr[found].args[usr[found].set] = NULL; @@ -212,15 +212,15 @@ parse_option (grub_extcmd_t cmd, const struct grub_arg_option *opt, return 0; } -static inline grub_err_t +static inline VasEBoot_err_t add_arg (char ***argl, int *num, char *s) { char **p = *argl; - *argl = grub_realloc (*argl, (++(*num) + 1) * sizeof (char *)); + *argl = VasEBoot_realloc (*argl, (++(*num) + 1) * sizeof (char *)); if (! *argl) { - grub_free (p); - return grub_errno; + VasEBoot_free (p); + return VasEBoot_errno; } (*argl)[(*num) - 1] = s; (*argl)[(*num)] = NULL; @@ -229,8 +229,8 @@ add_arg (char ***argl, int *num, char *s) int -grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, - struct grub_arg_list *usr, char ***args, int *argnum) +VasEBoot_arg_parse (VasEBoot_extcmd_t cmd, int argc, char **argv, + struct VasEBoot_arg_list *usr, char ***args, int *argnum) { int curarg; int arglen; @@ -240,12 +240,12 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, for (curarg = 0; curarg < argc; curarg++) { char *arg = argv[curarg]; - const struct grub_arg_option *opt; + const struct VasEBoot_arg_option *opt; char *option = 0; /* No option is used. */ - if ((num && (cmd->cmd->flags & GRUB_COMMAND_OPTIONS_AT_START)) - || arg[0] != '-' || grub_strlen (arg) == 1) + if ((num && (cmd->cmd->flags & VasEBoot_COMMAND_OPTIONS_AT_START)) + || arg[0] != '-' || VasEBoot_strlen (arg) == 1) { if (add_arg (&argl, &num, arg) != 0) goto fail; @@ -258,7 +258,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, { char *curshort; - if (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH) + if (cmd->cmd->flags & VasEBoot_COMMAND_ACCEPT_DASH) { for (curshort = arg + 1; *curshort; curshort++) if (!find_short (cmd->options, *curshort)) @@ -281,7 +281,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, if (! opt) { char tmp[3] = { '-', *curshort, 0 }; - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), tmp); goto fail; } @@ -292,7 +292,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, it can have an argument value. */ if (*curshort) { - if (parse_option (cmd, opt, 0, usr) || grub_errno) + if (parse_option (cmd, opt, 0, usr) || VasEBoot_errno) goto fail; } else @@ -302,8 +302,8 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, if (curarg + 1 < argc) { char *nextarg = argv[curarg + 1]; - if (!(opt->flags & GRUB_ARG_OPTION_OPTIONAL) - || (grub_strlen (nextarg) < 2 || nextarg[0] != '-')) + if (!(opt->flags & VasEBoot_ARG_OPTION_OPTIONAL) + || (VasEBoot_strlen (nextarg) < 2 || nextarg[0] != '-')) option = argv[++curarg]; } } @@ -316,7 +316,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, { /* If the argument "--" is used just pass the other arguments. */ - if (grub_strlen (arg) == 2) + if (VasEBoot_strlen (arg) == 2) { for (curarg++; curarg < argc; curarg++) if (add_arg (&argl, &num, argv[curarg]) != 0) @@ -324,14 +324,14 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, break; } - option = grub_strchr (arg, '='); + option = VasEBoot_strchr (arg, '='); if (option) { arglen = option - arg - 2; option++; } else - arglen = grub_strlen (arg) - 2; + arglen = VasEBoot_strlen (arg) - 2; opt = find_long (cmd->options, arg + 2, arglen); @@ -339,7 +339,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, && opt && opt->type != ARG_TYPE_NONE) option = argv[++curarg]; - if (!opt && (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH)) + if (!opt && (cmd->cmd->flags & VasEBoot_COMMAND_ACCEPT_DASH)) { if (add_arg (&argl, &num, arg) != 0) goto fail; @@ -348,17 +348,17 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, if (! opt) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), arg); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), arg); goto fail; } } if (! (opt->type == ARG_TYPE_NONE - || (! option && (opt->flags & GRUB_ARG_OPTION_OPTIONAL)))) + || (! option && (opt->flags & VasEBoot_ARG_OPTION_OPTIONAL)))) { if (! option) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("missing mandatory option for `%s'"), opt->longarg); goto fail; } @@ -377,10 +377,10 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, { char *tail; - grub_strtoull (option, &tail, 0); - if (tail == 0 || tail == option || *tail != '\0' || grub_errno) + VasEBoot_strtoull (option, &tail, 0); + if (tail == 0 || tail == option || *tail != '\0' || VasEBoot_errno) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("the argument `%s' requires an integer"), arg); @@ -396,20 +396,20 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, /* XXX: Not implemented. */ break; } - if (parse_option (cmd, opt, option, usr) || grub_errno) + if (parse_option (cmd, opt, option, usr) || VasEBoot_errno) goto fail; } else { if (option) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("a value was assigned to the argument `%s' while it " "doesn't require an argument"), arg); goto fail; } - if (parse_option (cmd, opt, 0, usr) || grub_errno) + if (parse_option (cmd, opt, 0, usr) || VasEBoot_errno) goto fail; } } @@ -422,15 +422,15 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, return 0; } -struct grub_arg_list* -grub_arg_list_alloc(grub_extcmd_t extcmd, int argc, +struct VasEBoot_arg_list* +VasEBoot_arg_list_alloc(VasEBoot_extcmd_t extcmd, int argc, char **argv __attribute__((unused))) { int i; char **args; - grub_size_t argcnt; - struct grub_arg_list *list; - const struct grub_arg_option *options; + VasEBoot_size_t argcnt; + struct VasEBoot_arg_list *list; + const struct VasEBoot_arg_option *options; options = extcmd->options; if (! options) @@ -439,11 +439,11 @@ grub_arg_list_alloc(grub_extcmd_t extcmd, int argc, argcnt = 0; for (i = 0; options[i].doc; i++) { - if (options[i].flags & GRUB_ARG_OPTION_REPEATABLE) - argcnt += ((grub_size_t) argc + 1) / 2 + 1; /* max possible for any option */ + if (options[i].flags & VasEBoot_ARG_OPTION_REPEATABLE) + argcnt += ((VasEBoot_size_t) argc + 1) / 2 + 1; /* max possible for any option */ } - list = grub_zalloc (sizeof (*list) * i + sizeof (char*) * argcnt); + list = VasEBoot_zalloc (sizeof (*list) * i + sizeof (char*) * argcnt); if (! list) return 0; @@ -453,10 +453,10 @@ grub_arg_list_alloc(grub_extcmd_t extcmd, int argc, list[i].set = 0; list[i].arg = 0; - if (options[i].flags & GRUB_ARG_OPTION_REPEATABLE) + if (options[i].flags & VasEBoot_ARG_OPTION_REPEATABLE) { list[i].args = args; - args += (grub_size_t) argc / 2 + 1; + args += (VasEBoot_size_t) argc / 2 + 1; } } return list; diff --git a/VasEBoot-core/lib/arm/setjmp.S b/VasEBoot-core/lib/arm/setjmp.S index a5373d3a9..c685d5c0b 100644 --- a/VasEBoot-core/lib/arm/setjmp.S +++ b/VasEBoot-core/lib/arm/setjmp.S @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .syntax unified #if !defined (__thumb2__) @@ -33,18 +33,18 @@ GRUB_MOD_LICENSE "GPLv3+" .text /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) +FUNCTION(VasEBoot_setjmp) mov r12, sp stm r0, { r4-r12, lr } mov r0, #0 bx lr /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) +FUNCTION(VasEBoot_longjmp) ldm r0, { r4-r12, lr } mov sp, r12 movs r0, r1 diff --git a/VasEBoot-core/lib/arm64/setjmp.S b/VasEBoot-core/lib/arm64/setjmp.S index ffcabf6e4..4524a1b48 100644 --- a/VasEBoot-core/lib/arm64/setjmp.S +++ b/VasEBoot-core/lib/arm64/setjmp.S @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .text /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) +FUNCTION(VasEBoot_setjmp) stp x19, x20, [x0], #16 stp x21, x22, [x0], #16 stp x23, x24, [x0], #16 @@ -39,9 +39,9 @@ FUNCTION(grub_setjmp) ret /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) +FUNCTION(VasEBoot_longjmp) ldp x19, x20, [x0], #16 ldp x21, x22, [x0], #16 ldp x23, x24, [x0], #16 diff --git a/VasEBoot-core/lib/backtrace.c b/VasEBoot-core/lib/backtrace.c index 825a8800e..aac39b257 100644 --- a/VasEBoot-core/lib/backtrace.c +++ b/VasEBoot-core/lib/backtrace.c @@ -1,70 +1,70 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); void -grub_backtrace_print_address (void *addr) +VasEBoot_backtrace_print_address (void *addr) { - grub_dl_t mod; + VasEBoot_dl_t mod; FOR_DL_MODULES (mod) { - grub_dl_segment_t segment; + VasEBoot_dl_segment_t segment; for (segment = mod->segment; segment; segment = segment->next) - if (segment->addr <= addr && (grub_uint8_t *) segment->addr - + segment->size > (grub_uint8_t *) addr) + if (segment->addr <= addr && (VasEBoot_uint8_t *) segment->addr + + segment->size > (VasEBoot_uint8_t *) addr) { - grub_printf ("%s.%x+%" PRIxGRUB_SIZE, mod->name, segment->section, - (grub_size_t) ((grub_uint8_t *) addr - (grub_uint8_t *) segment->addr)); + VasEBoot_printf ("%s.%x+%" PRIxVasEBoot_SIZE, mod->name, segment->section, + (VasEBoot_size_t) ((VasEBoot_uint8_t *) addr - (VasEBoot_uint8_t *) segment->addr)); return; } } - grub_printf ("%p", addr); + VasEBoot_printf ("%p", addr); } -static grub_err_t -grub_cmd_backtrace (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_backtrace (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_backtrace (); + VasEBoot_backtrace (); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(backtrace) +VasEBoot_MOD_INIT(backtrace) { - cmd = grub_register_command ("backtrace", grub_cmd_backtrace, + cmd = VasEBoot_register_command ("backtrace", VasEBoot_cmd_backtrace, 0, N_("Print backtrace.")); } -GRUB_MOD_FINI(backtrace) +VasEBoot_MOD_FINI(backtrace) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/lib/cmdline.c b/VasEBoot-core/lib/cmdline.c index f090ea20d..979a2eb26 100644 --- a/VasEBoot-core/lib/cmdline.c +++ b/VasEBoot-core/lib/cmdline.c @@ -1,25 +1,25 @@ /* cmdline.c - linux command line handling */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include static unsigned int check_arg (char *c, int *has_space) { @@ -46,7 +46,7 @@ static unsigned int check_arg (char *c, int *has_space) return size; } -unsigned int grub_loader_cmdline_size (int argc, char *argv[]) +unsigned int VasEBoot_loader_cmdline_size (int argc, char *argv[]) { int i; unsigned int size = 0; @@ -63,8 +63,8 @@ unsigned int grub_loader_cmdline_size (int argc, char *argv[]) return size; } -int grub_create_loader_cmdline (int argc, char *argv[], char *buf, - grub_size_t size) +int VasEBoot_create_loader_cmdline (int argc, char *argv[], char *buf, + VasEBoot_size_t size) { int i, space; unsigned int arg_size; @@ -105,9 +105,9 @@ int grub_create_loader_cmdline (int argc, char *argv[], char *buf, *buf = 0; - grub_tpm_measure ((void *)orig, grub_strlen (orig), GRUB_ASCII_PCR, - "grub_kernel_cmdline", orig); - grub_print_error(); + VasEBoot_tpm_measure ((void *)orig, VasEBoot_strlen (orig), VasEBoot_ASCII_PCR, + "VasEBoot_kernel_cmdline", orig); + VasEBoot_print_error(); return i; } diff --git a/VasEBoot-core/lib/cmos_datetime.c b/VasEBoot-core/lib/cmos_datetime.c index 86cd91180..cba38bcbc 100644 --- a/VasEBoot-core/lib/cmos_datetime.c +++ b/VasEBoot-core/lib/cmos_datetime.c @@ -1,74 +1,74 @@ /* kern/cmos_datetime.c - CMOS datetime function. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #if !defined (__powerpc__) && !defined (__sparc__) -#define grub_get_datetime_cmos grub_get_datetime -#define grub_set_datetime_cmos grub_set_datetime +#define VasEBoot_get_datetime_cmos VasEBoot_get_datetime +#define VasEBoot_set_datetime_cmos VasEBoot_set_datetime #endif -grub_err_t -grub_get_datetime_cmos (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_get_datetime_cmos (struct VasEBoot_datetime *datetime) { int is_bcd, is_12hour; - grub_uint8_t value, flag; - grub_err_t err; + VasEBoot_uint8_t value, flag; + VasEBoot_err_t err; - err = grub_cmos_read (GRUB_CMOS_INDEX_STATUS_B, &flag); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_STATUS_B, &flag); if (err) return err; - is_bcd = ! (flag & GRUB_CMOS_STATUS_B_BINARY); + is_bcd = ! (flag & VasEBoot_CMOS_STATUS_B_BINARY); - err = grub_cmos_read (GRUB_CMOS_INDEX_YEAR, &value); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_YEAR, &value); if (err) return err; if (is_bcd) - value = grub_bcd_to_num (value); + value = VasEBoot_bcd_to_num (value); datetime->year = value; datetime->year += (value < 80) ? 2000 : 1900; - err = grub_cmos_read (GRUB_CMOS_INDEX_MONTH, &value); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_MONTH, &value); if (err) return err; if (is_bcd) - value = grub_bcd_to_num (value); + value = VasEBoot_bcd_to_num (value); datetime->month = value; - err = grub_cmos_read (GRUB_CMOS_INDEX_DAY_OF_MONTH, &value); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_DAY_OF_MONTH, &value); if (err) return err; if (is_bcd) - value = grub_bcd_to_num (value); + value = VasEBoot_bcd_to_num (value); datetime->day = value; - is_12hour = ! (flag & GRUB_CMOS_STATUS_B_24HOUR); + is_12hour = ! (flag & VasEBoot_CMOS_STATUS_B_24HOUR); - err = grub_cmos_read (GRUB_CMOS_INDEX_HOUR, &value); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_HOUR, &value); if (err) return err; if (is_12hour) @@ -80,77 +80,77 @@ grub_get_datetime_cmos (struct grub_datetime *datetime) } if (is_bcd) - value = grub_bcd_to_num (value); + value = VasEBoot_bcd_to_num (value); if (is_12hour) value += 12; datetime->hour = value; - err = grub_cmos_read (GRUB_CMOS_INDEX_MINUTE, &value); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_MINUTE, &value); if (err) return err; if (is_bcd) - value = grub_bcd_to_num (value); + value = VasEBoot_bcd_to_num (value); datetime->minute = value; - err = grub_cmos_read (GRUB_CMOS_INDEX_SECOND, &value); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_SECOND, &value); if (err) return err; if (is_bcd) - value = grub_bcd_to_num (value); + value = VasEBoot_bcd_to_num (value); datetime->second = value; return 0; } -grub_err_t -grub_set_datetime_cmos (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_set_datetime_cmos (struct VasEBoot_datetime *datetime) { int is_bcd, is_12hour; - grub_uint8_t value, flag; - grub_err_t err; + VasEBoot_uint8_t value, flag; + VasEBoot_err_t err; - err = grub_cmos_read (GRUB_CMOS_INDEX_STATUS_B, &flag); + err = VasEBoot_cmos_read (VasEBoot_CMOS_INDEX_STATUS_B, &flag); if (err) return err; - is_bcd = ! (flag & GRUB_CMOS_STATUS_B_BINARY); + is_bcd = ! (flag & VasEBoot_CMOS_STATUS_B_BINARY); value = ((datetime->year >= 2000) ? datetime->year - 2000 : datetime->year - 1900); if (is_bcd) - value = grub_num_to_bcd (value); + value = VasEBoot_num_to_bcd (value); - err = grub_cmos_write (GRUB_CMOS_INDEX_YEAR, value); + err = VasEBoot_cmos_write (VasEBoot_CMOS_INDEX_YEAR, value); if (err) return err; value = datetime->month; if (is_bcd) - value = grub_num_to_bcd (value); + value = VasEBoot_num_to_bcd (value); - err = grub_cmos_write (GRUB_CMOS_INDEX_MONTH, value); + err = VasEBoot_cmos_write (VasEBoot_CMOS_INDEX_MONTH, value); if (err) return err; value = datetime->day; if (is_bcd) - value = grub_num_to_bcd (value); + value = VasEBoot_num_to_bcd (value); - err = grub_cmos_write (GRUB_CMOS_INDEX_DAY_OF_MONTH, value); + err = VasEBoot_cmos_write (VasEBoot_CMOS_INDEX_DAY_OF_MONTH, value); if (err) return err; value = datetime->hour; - is_12hour = (! (flag & GRUB_CMOS_STATUS_B_24HOUR)); + is_12hour = (! (flag & VasEBoot_CMOS_STATUS_B_24HOUR)); if (is_12hour) { @@ -163,30 +163,30 @@ grub_set_datetime_cmos (struct grub_datetime *datetime) } if (is_bcd) - value = grub_num_to_bcd (value); + value = VasEBoot_num_to_bcd (value); if (is_12hour) value |= 0x80; - err = grub_cmos_write (GRUB_CMOS_INDEX_HOUR, value); + err = VasEBoot_cmos_write (VasEBoot_CMOS_INDEX_HOUR, value); if (err) return err; value = datetime->minute; if (is_bcd) - value = grub_num_to_bcd (value); + value = VasEBoot_num_to_bcd (value); - err = grub_cmos_write (GRUB_CMOS_INDEX_MINUTE, value); + err = VasEBoot_cmos_write (VasEBoot_CMOS_INDEX_MINUTE, value); if (err) return err; value = datetime->second; if (is_bcd) - value = grub_num_to_bcd (value); + value = VasEBoot_num_to_bcd (value); - err = grub_cmos_write (GRUB_CMOS_INDEX_SECOND, value); + err = VasEBoot_cmos_write (VasEBoot_CMOS_INDEX_SECOND, value); if (err) return err; diff --git a/VasEBoot-core/lib/crc.c b/VasEBoot-core/lib/crc.c index bf97cc63a..ccfe957fe 100644 --- a/VasEBoot-core/lib/crc.c +++ b/VasEBoot-core/lib/crc.c @@ -1,32 +1,32 @@ /* crc.c - crc function */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -static grub_uint32_t crc32c_table [256]; +static VasEBoot_uint32_t crc32c_table [256]; /* Helper for init_crc32c_table. */ -static grub_uint32_t -reflect (grub_uint32_t ref, int len) +static VasEBoot_uint32_t +reflect (VasEBoot_uint32_t ref, int len) { - grub_uint32_t result = 0; + VasEBoot_uint32_t result = 0; int i; for (i = 1; i <= len; i++) @@ -42,7 +42,7 @@ reflect (grub_uint32_t ref, int len) static void init_crc32c_table (void) { - grub_uint32_t polynomial = 0x1edc6f41; + VasEBoot_uint32_t polynomial = 0x1edc6f41; int i, j; for(i = 0; i < 256; i++) @@ -55,11 +55,11 @@ init_crc32c_table (void) } } -grub_uint32_t -grub_getcrc32c (grub_uint32_t crc, const void *buf, int size) +VasEBoot_uint32_t +VasEBoot_getcrc32c (VasEBoot_uint32_t crc, const void *buf, int size) { int i; - const grub_uint8_t *data = buf; + const VasEBoot_uint8_t *data = buf; if (! crc32c_table[1]) init_crc32c_table (); diff --git a/VasEBoot-core/lib/crc64.c b/VasEBoot-core/lib/crc64.c index 4960f3f89..b52f2321f 100644 --- a/VasEBoot-core/lib/crc64.c +++ b/VasEBoot-core/lib/crc64.c @@ -1,35 +1,35 @@ /* crc64.c - crc64 function */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t crc64_table [256]; +static VasEBoot_uint64_t crc64_table [256]; /* Helper for init_crc64_table. */ -static grub_uint64_t -reflect (grub_uint64_t ref, int len) +static VasEBoot_uint64_t +reflect (VasEBoot_uint64_t ref, int len) { - grub_uint64_t result = 0; + VasEBoot_uint64_t result = 0; int i; for (i = 1; i <= len; i++) @@ -45,7 +45,7 @@ reflect (grub_uint64_t ref, int len) static void init_crc64_table (void) { - grub_uint64_t polynomial = 0x42f0e1eba9ea3693ULL; + VasEBoot_uint64_t polynomial = 0x42f0e1eba9ea3693ULL; int i, j; for(i = 0; i < 256; i++) @@ -65,15 +65,15 @@ crc64_init (void *context) { if (! crc64_table[1]) init_crc64_table (); - *(grub_uint64_t *) context = 0; + *(VasEBoot_uint64_t *) context = 0; } static void -crc64_write (void *context, const void *buf, grub_size_t size) +crc64_write (void *context, const void *buf, VasEBoot_size_t size) { unsigned i; - const grub_uint8_t *data = buf; - grub_uint64_t crc = ~grub_le_to_cpu64 (*(grub_uint64_t *) context); + const VasEBoot_uint8_t *data = buf; + VasEBoot_uint64_t crc = ~VasEBoot_le_to_cpu64 (*(VasEBoot_uint64_t *) context); for (i = 0; i < size; i++) { @@ -81,10 +81,10 @@ crc64_write (void *context, const void *buf, grub_size_t size) data++; } - *(grub_uint64_t *) context = grub_cpu_to_le64 (~crc); + *(VasEBoot_uint64_t *) context = VasEBoot_cpu_to_le64 (~crc); } -static grub_uint8_t * +static VasEBoot_uint8_t * crc64_read (void *context) { return context; @@ -99,16 +99,16 @@ gcry_md_spec_t _gcry_digest_spec_crc64 = { "CRC64", 0, 0, 0, 8, crc64_init, crc64_write, crc64_final, crc64_read, - sizeof (grub_uint64_t), + sizeof (VasEBoot_uint64_t), .blocksize = 64 }; -GRUB_MOD_INIT(crc64) +VasEBoot_MOD_INIT(crc64) { - grub_md_register (&_gcry_digest_spec_crc64); + VasEBoot_md_register (&_gcry_digest_spec_crc64); } -GRUB_MOD_FINI(crc64) +VasEBoot_MOD_FINI(crc64) { - grub_md_unregister (&_gcry_digest_spec_crc64); + VasEBoot_md_unregister (&_gcry_digest_spec_crc64); } diff --git a/VasEBoot-core/lib/crypto.c b/VasEBoot-core/lib/crypto.c index 683a8aaa7..a3e43a6b6 100644 --- a/VasEBoot-core/lib/crypto.c +++ b/VasEBoot-core/lib/crypto.c @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 * 2007, 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_crypto_hmac_handle +struct VasEBoot_crypto_hmac_handle { const struct gcry_md_spec *md; void *ctx; void *opad; }; -static gcry_cipher_spec_t *grub_ciphers = NULL; -static gcry_md_spec_t *grub_digests = NULL; +static gcry_cipher_spec_t *VasEBoot_ciphers = NULL; +static gcry_md_spec_t *VasEBoot_digests = NULL; -void (*grub_crypto_autoload_hook) (const char *name) = NULL; +void (*VasEBoot_crypto_autoload_hook) (const char *name) = NULL; /* Based on libgcrypt-1.4.4/src/misc.c. */ void -grub_burn_stack (grub_size_t size) +VasEBoot_burn_stack (VasEBoot_size_t size) { char buf[64]; - grub_memset (buf, 0, sizeof (buf)); + VasEBoot_memset (buf, 0, sizeof (buf)); if (size > sizeof (buf)) - grub_burn_stack (size - sizeof (buf)); + VasEBoot_burn_stack (size - sizeof (buf)); } void _gcry_burn_stack (int size) { - grub_burn_stack (size); + VasEBoot_burn_stack (size); } void __attribute__ ((noreturn)) @@ -61,40 +61,40 @@ _gcry_assert_failed (const char *expr, const char *file, int line, const char *func) { - grub_fatal ("assertion %s at %s:%d (%s) failed\n", expr, file, line, func); + VasEBoot_fatal ("assertion %s at %s:%d (%s) failed\n", expr, file, line, func); } void _gcry_log_error (const char *fmt, ...) { va_list args; - const char *debug = grub_env_get ("debug"); + const char *debug = VasEBoot_env_get ("debug"); if (! debug) return; - if (grub_strword (debug, "all") || grub_strword (debug, "gcrypt")) + if (VasEBoot_strword (debug, "all") || VasEBoot_strword (debug, "gcrypt")) { - grub_printf ("gcrypt error: "); + VasEBoot_printf ("gcrypt error: "); va_start (args, fmt); - grub_vprintf (fmt, args); + VasEBoot_vprintf (fmt, args); va_end (args); - grub_refresh (); + VasEBoot_refresh (); } } void -grub_cipher_register (gcry_cipher_spec_t *cipher) +VasEBoot_cipher_register (gcry_cipher_spec_t *cipher) { - cipher->next = grub_ciphers; - grub_ciphers = cipher; + cipher->next = VasEBoot_ciphers; + VasEBoot_ciphers = cipher; } void -grub_cipher_unregister (gcry_cipher_spec_t *cipher) +VasEBoot_cipher_unregister (gcry_cipher_spec_t *cipher) { gcry_cipher_spec_t **ciph; - for (ciph = &grub_ciphers; *ciph; ciph = &((*ciph)->next)) + for (ciph = &VasEBoot_ciphers; *ciph; ciph = &((*ciph)->next)) if (*ciph == cipher) { *ciph = (*ciph)->next; @@ -103,17 +103,17 @@ grub_cipher_unregister (gcry_cipher_spec_t *cipher) } void -grub_md_register (gcry_md_spec_t *digest) +VasEBoot_md_register (gcry_md_spec_t *digest) { - digest->next = grub_digests; - grub_digests = digest; + digest->next = VasEBoot_digests; + VasEBoot_digests = digest; } void -grub_md_unregister (gcry_md_spec_t *cipher) +VasEBoot_md_unregister (gcry_md_spec_t *cipher) { gcry_md_spec_t **ciph; - for (ciph = &grub_digests; *ciph; ciph = &((*ciph)->next)) + for (ciph = &VasEBoot_digests; *ciph; ciph = &((*ciph)->next)) if (*ciph == cipher) { *ciph = (*ciph)->next; @@ -122,31 +122,31 @@ grub_md_unregister (gcry_md_spec_t *cipher) } void -grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in, - grub_size_t inlen) +VasEBoot_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in, + VasEBoot_size_t inlen) { - GRUB_PROPERLY_ALIGNED_ARRAY (ctx, GRUB_CRYPTO_MAX_MD_CONTEXT_SIZE); + VasEBoot_PROPERLY_ALIGNED_ARRAY (ctx, VasEBoot_CRYPTO_MAX_MD_CONTEXT_SIZE); if (hash->contextsize > sizeof (ctx)) - grub_fatal ("Too large md context"); + VasEBoot_fatal ("Too large md context"); hash->init (&ctx); hash->write (&ctx, in, inlen); hash->final (&ctx); - grub_memcpy (out, hash->read (&ctx), hash->mdlen); + VasEBoot_memcpy (out, hash->read (&ctx), hash->mdlen); } const gcry_md_spec_t * -grub_crypto_lookup_md_by_name (const char *name) +VasEBoot_crypto_lookup_md_by_name (const char *name) { const gcry_md_spec_t *md; int first = 1; while (1) { - for (md = grub_digests; md; md = md->next) - if (grub_strcasecmp (name, md->name) == 0) + for (md = VasEBoot_digests; md; md = md->next) + if (VasEBoot_strcasecmp (name, md->name) == 0) return md; - if (grub_crypto_autoload_hook && first) - grub_crypto_autoload_hook (name); + if (VasEBoot_crypto_autoload_hook && first) + VasEBoot_crypto_autoload_hook (name); else return NULL; first = 0; @@ -154,25 +154,25 @@ grub_crypto_lookup_md_by_name (const char *name) } const gcry_cipher_spec_t * -grub_crypto_lookup_cipher_by_name (const char *name) +VasEBoot_crypto_lookup_cipher_by_name (const char *name) { const gcry_cipher_spec_t *ciph; int first = 1; while (1) { - for (ciph = grub_ciphers; ciph; ciph = ciph->next) + for (ciph = VasEBoot_ciphers; ciph; ciph = ciph->next) { const char **alias; - if (grub_strcasecmp (name, ciph->name) == 0) + if (VasEBoot_strcasecmp (name, ciph->name) == 0) return ciph; if (!ciph->aliases) continue; for (alias = ciph->aliases; *alias; alias++) - if (grub_strcasecmp (name, *alias) == 0) + if (VasEBoot_strcasecmp (name, *alias) == 0) return ciph; } - if (grub_crypto_autoload_hook && first) - grub_crypto_autoload_hook (name); + if (VasEBoot_crypto_autoload_hook && first) + VasEBoot_crypto_autoload_hook (name); else return NULL; first = 0; @@ -180,11 +180,11 @@ grub_crypto_lookup_cipher_by_name (const char *name) } -grub_crypto_cipher_handle_t -grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher) +VasEBoot_crypto_cipher_handle_t +VasEBoot_crypto_cipher_open (const struct gcry_cipher_spec *cipher) { - grub_crypto_cipher_handle_t ret; - ret = grub_malloc (sizeof (*ret) + cipher->contextsize); + VasEBoot_crypto_cipher_handle_t ret; + ret = VasEBoot_malloc (sizeof (*ret) + cipher->contextsize); if (!ret) return NULL; ret->cipher = cipher; @@ -192,7 +192,7 @@ grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher) } gcry_err_code_t -grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher, +VasEBoot_crypto_cipher_set_key (VasEBoot_crypto_cipher_handle_t cipher, const unsigned char *key, unsigned keylen) { @@ -200,19 +200,19 @@ grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher, } gcry_err_code_t -grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size) +VasEBoot_crypto_ecb_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size) { - const grub_uint8_t *inptr, *end; - grub_uint8_t *outptr; - grub_size_t blocksize; + const VasEBoot_uint8_t *inptr, *end; + VasEBoot_uint8_t *outptr; + VasEBoot_size_t blocksize; if (!cipher->cipher->decrypt) return GPG_ERR_NOT_SUPPORTED; blocksize = cipher->cipher->blocksize; if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) || ((size & (blocksize - 1)) != 0)) return GPG_ERR_INV_ARG; - end = (const grub_uint8_t *) in + size; + end = (const VasEBoot_uint8_t *) in + size; for (inptr = in, outptr = out; inptr < end; inptr += blocksize, outptr += blocksize) cipher->cipher->decrypt (cipher->ctx, outptr, inptr); @@ -220,19 +220,19 @@ grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher, } gcry_err_code_t -grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size) +VasEBoot_crypto_ecb_encrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size) { - const grub_uint8_t *inptr, *end; - grub_uint8_t *outptr; - grub_size_t blocksize; + const VasEBoot_uint8_t *inptr, *end; + VasEBoot_uint8_t *outptr; + VasEBoot_size_t blocksize; if (!cipher->cipher->encrypt) return GPG_ERR_NOT_SUPPORTED; blocksize = cipher->cipher->blocksize; if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) || ((size & (blocksize - 1)) != 0)) return GPG_ERR_INV_ARG; - end = (const grub_uint8_t *) in + size; + end = (const VasEBoot_uint8_t *) in + size; for (inptr = in, outptr = out; inptr < end; inptr += blocksize, outptr += blocksize) cipher->cipher->encrypt (cipher->ctx, outptr, inptr); @@ -240,117 +240,117 @@ grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher, } gcry_err_code_t -grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size, +VasEBoot_crypto_cbc_encrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size, void *iv_in) { - grub_uint8_t *outptr; - const grub_uint8_t *inptr, *end; + VasEBoot_uint8_t *outptr; + const VasEBoot_uint8_t *inptr, *end; void *iv; - grub_size_t blocksize; + VasEBoot_size_t blocksize; if (!cipher->cipher->encrypt) return GPG_ERR_NOT_SUPPORTED; blocksize = cipher->cipher->blocksize; if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) || ((size & (blocksize - 1)) != 0)) return GPG_ERR_INV_ARG; - end = (const grub_uint8_t *) in + size; + end = (const VasEBoot_uint8_t *) in + size; iv = iv_in; for (inptr = in, outptr = out; inptr < end; inptr += blocksize, outptr += blocksize) { - grub_crypto_xor (outptr, inptr, iv, blocksize); + VasEBoot_crypto_xor (outptr, inptr, iv, blocksize); cipher->cipher->encrypt (cipher->ctx, outptr, outptr); iv = outptr; } - grub_memcpy (iv_in, iv, blocksize); + VasEBoot_memcpy (iv_in, iv, blocksize); return GPG_ERR_NO_ERROR; } gcry_err_code_t -grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size, +VasEBoot_crypto_cbc_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size, void *iv) { - const grub_uint8_t *inptr, *end; - grub_uint8_t *outptr; - grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; - grub_size_t blocksize; + const VasEBoot_uint8_t *inptr, *end; + VasEBoot_uint8_t *outptr; + VasEBoot_uint8_t ivt[VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE]; + VasEBoot_size_t blocksize; if (!cipher->cipher->decrypt) return GPG_ERR_NOT_SUPPORTED; blocksize = cipher->cipher->blocksize; if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0) || ((size & (blocksize - 1)) != 0)) return GPG_ERR_INV_ARG; - if (blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE) + if (blocksize > VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE) return GPG_ERR_INV_ARG; - end = (const grub_uint8_t *) in + size; + end = (const VasEBoot_uint8_t *) in + size; for (inptr = in, outptr = out; inptr < end; inptr += blocksize, outptr += blocksize) { - grub_memcpy (ivt, inptr, blocksize); + VasEBoot_memcpy (ivt, inptr, blocksize); cipher->cipher->decrypt (cipher->ctx, outptr, inptr); - grub_crypto_xor (outptr, outptr, iv, blocksize); - grub_memcpy (iv, ivt, blocksize); + VasEBoot_crypto_xor (outptr, outptr, iv, blocksize); + VasEBoot_memcpy (iv, ivt, blocksize); } return GPG_ERR_NO_ERROR; } /* Based on gcry/cipher/md.c. */ -struct grub_crypto_hmac_handle * -grub_crypto_hmac_init (const struct gcry_md_spec *md, - const void *key, grub_size_t keylen) +struct VasEBoot_crypto_hmac_handle * +VasEBoot_crypto_hmac_init (const struct gcry_md_spec *md, + const void *key, VasEBoot_size_t keylen) { - grub_uint8_t *helpkey = NULL; - grub_uint8_t *ipad = NULL, *opad = NULL; + VasEBoot_uint8_t *helpkey = NULL; + VasEBoot_uint8_t *ipad = NULL, *opad = NULL; void *ctx = NULL; - struct grub_crypto_hmac_handle *ret = NULL; + struct VasEBoot_crypto_hmac_handle *ret = NULL; unsigned i; if (md->mdlen > md->blocksize) return NULL; - ctx = grub_malloc (md->contextsize); + ctx = VasEBoot_malloc (md->contextsize); if (!ctx) goto err; if ( keylen > md->blocksize ) { - helpkey = grub_malloc (md->mdlen); + helpkey = VasEBoot_malloc (md->mdlen); if (!helpkey) goto err; - grub_crypto_hash (md, helpkey, key, keylen); + VasEBoot_crypto_hash (md, helpkey, key, keylen); key = helpkey; keylen = md->mdlen; } - ipad = grub_zalloc (md->blocksize); + ipad = VasEBoot_zalloc (md->blocksize); if (!ipad) goto err; - opad = grub_zalloc (md->blocksize); + opad = VasEBoot_zalloc (md->blocksize); if (!opad) goto err; - grub_memcpy ( ipad, key, keylen ); - grub_memcpy ( opad, key, keylen ); + VasEBoot_memcpy ( ipad, key, keylen ); + VasEBoot_memcpy ( opad, key, keylen ); for (i=0; i < md->blocksize; i++ ) { ipad[i] ^= 0x36; opad[i] ^= 0x5c; } - grub_free (helpkey); + VasEBoot_free (helpkey); helpkey = NULL; md->init (ctx); md->write (ctx, ipad, md->blocksize); /* inner pad */ - grub_memset (ipad, 0, md->blocksize); - grub_free (ipad); + VasEBoot_memset (ipad, 0, md->blocksize); + VasEBoot_free (ipad); ipad = NULL; - ret = grub_malloc (sizeof (*ret)); + ret = VasEBoot_malloc (sizeof (*ret)); if (!ret) goto err; @@ -361,28 +361,28 @@ grub_crypto_hmac_init (const struct gcry_md_spec *md, return ret; err: - grub_free (helpkey); - grub_free (ctx); - grub_free (ipad); - grub_free (opad); + VasEBoot_free (helpkey); + VasEBoot_free (ctx); + VasEBoot_free (ipad); + VasEBoot_free (opad); return NULL; } void -grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd, +VasEBoot_crypto_hmac_write (struct VasEBoot_crypto_hmac_handle *hnd, const void *data, - grub_size_t datalen) + VasEBoot_size_t datalen) { hnd->md->write (hnd->ctx, data, datalen); } gcry_err_code_t -grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out) +VasEBoot_crypto_hmac_fini (struct VasEBoot_crypto_hmac_handle *hnd, void *out) { - grub_uint8_t *p; - grub_uint8_t *ctx2; + VasEBoot_uint8_t *p; + VasEBoot_uint8_t *ctx2; - ctx2 = grub_malloc (hnd->md->contextsize); + ctx2 = VasEBoot_malloc (hnd->md->contextsize); if (!ctx2) return GPG_ERR_OUT_OF_MEMORY; @@ -394,50 +394,50 @@ grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out) hnd->md->write (ctx2, hnd->opad, hnd->md->blocksize); hnd->md->write (ctx2, p, hnd->md->mdlen); hnd->md->final (ctx2); - grub_memset (hnd->opad, 0, hnd->md->blocksize); - grub_free (hnd->opad); - grub_memset (hnd->ctx, 0, hnd->md->contextsize); - grub_free (hnd->ctx); + VasEBoot_memset (hnd->opad, 0, hnd->md->blocksize); + VasEBoot_free (hnd->opad); + VasEBoot_memset (hnd->ctx, 0, hnd->md->contextsize); + VasEBoot_free (hnd->ctx); - grub_memcpy (out, hnd->md->read (ctx2), hnd->md->mdlen); - grub_memset (ctx2, 0, hnd->md->contextsize); - grub_free (ctx2); + VasEBoot_memcpy (out, hnd->md->read (ctx2), hnd->md->mdlen); + VasEBoot_memset (ctx2, 0, hnd->md->contextsize); + VasEBoot_free (ctx2); - grub_memset (hnd, 0, sizeof (*hnd)); - grub_free (hnd); + VasEBoot_memset (hnd, 0, sizeof (*hnd)); + VasEBoot_free (hnd); return GPG_ERR_NO_ERROR; } gcry_err_code_t -grub_crypto_hmac_buffer (const struct gcry_md_spec *md, - const void *key, grub_size_t keylen, - const void *data, grub_size_t datalen, void *out) +VasEBoot_crypto_hmac_buffer (const struct gcry_md_spec *md, + const void *key, VasEBoot_size_t keylen, + const void *data, VasEBoot_size_t datalen, void *out) { - struct grub_crypto_hmac_handle *hnd; + struct VasEBoot_crypto_hmac_handle *hnd; - hnd = grub_crypto_hmac_init (md, key, keylen); + hnd = VasEBoot_crypto_hmac_init (md, key, keylen); if (!hnd) return GPG_ERR_OUT_OF_MEMORY; - grub_crypto_hmac_write (hnd, data, datalen); - return grub_crypto_hmac_fini (hnd, out); + VasEBoot_crypto_hmac_write (hnd, data, datalen); + return VasEBoot_crypto_hmac_fini (hnd, out); } -grub_err_t -grub_crypto_gcry_error (gcry_err_code_t in) +VasEBoot_err_t +VasEBoot_crypto_gcry_error (gcry_err_code_t in) { if (in == GPG_ERR_NO_ERROR) - return GRUB_ERR_NONE; - return GRUB_ACCESS_DENIED; + return VasEBoot_ERR_NONE; + return VasEBoot_ACCESS_DENIED; } int -grub_crypto_memcmp (const void *a, const void *b, grub_size_t n) +VasEBoot_crypto_memcmp (const void *a, const void *b, VasEBoot_size_t n) { - register grub_size_t counter = 0; - const grub_uint8_t *pa, *pb; + register VasEBoot_size_t counter = 0; + const VasEBoot_uint8_t *pa, *pb; for (pa = a, pb = b; n; pa++, pb++, n--) { @@ -448,17 +448,17 @@ grub_crypto_memcmp (const void *a, const void *b, grub_size_t n) return !!counter; } -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL int -grub_password_get (char buf[], unsigned buf_size) +VasEBoot_password_get (char buf[], unsigned buf_size) { unsigned cur_len = 0; int key; while (1) { - key = grub_getkey (); + key = VasEBoot_getkey (); if (key == '\n' || key == '\r') break; @@ -475,17 +475,17 @@ grub_password_get (char buf[], unsigned buf_size) continue; } - if (!grub_isprint (key)) + if (!VasEBoot_isprint (key)) continue; if (cur_len + 2 < buf_size) buf[cur_len++] = key; } - grub_memset (buf + cur_len, 0, buf_size - cur_len); + VasEBoot_memset (buf + cur_len, 0, buf_size - cur_len); - grub_xputs ("\n"); - grub_refresh (); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); return (key != '\e'); } diff --git a/VasEBoot-core/lib/disk.c b/VasEBoot-core/lib/disk.c index 0f186883a..609c8a00b 100644 --- a/VasEBoot-core/lib/disk.c +++ b/VasEBoot-core/lib/disk.c @@ -1,71 +1,71 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #include "../kern/disk_common.c" static void -grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id, - grub_disk_addr_t sector) +VasEBoot_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id, + VasEBoot_disk_addr_t sector) { unsigned cache_index; - struct grub_disk_cache *cache; + struct VasEBoot_disk_cache *cache; - sector &= ~((grub_disk_addr_t) GRUB_DISK_CACHE_SIZE - 1); - cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + cache_index; + sector &= ~((VasEBoot_disk_addr_t) VasEBoot_DISK_CACHE_SIZE - 1); + cache_index = VasEBoot_disk_cache_get_index (dev_id, disk_id, sector); + cache = VasEBoot_disk_cache_table + cache_index; if (cache->dev_id == dev_id && cache->disk_id == disk_id && cache->sector == sector && cache->data) { cache->lock = 1; - grub_free (cache->data); + VasEBoot_free (cache->data); cache->data = 0; cache->lock = 0; } } -grub_err_t -grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_off_t offset, grub_size_t size, const void *buf) +VasEBoot_err_t +VasEBoot_disk_write (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, VasEBoot_size_t size, const void *buf) { unsigned real_offset; - grub_disk_addr_t aligned_sector; + VasEBoot_disk_addr_t aligned_sector; - grub_dprintf ("disk", "Writing `%s'...\n", disk->name); + VasEBoot_dprintf ("disk", "Writing `%s'...\n", disk->name); - if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE) + if (VasEBoot_disk_adjust_range (disk, §or, &offset, size) != VasEBoot_ERR_NONE) return -1; aligned_sector = (sector & ~((1ULL << (disk->log_sector_size - - GRUB_DISK_SECTOR_BITS)) - 1)); - real_offset = offset + ((sector - aligned_sector) << GRUB_DISK_SECTOR_BITS); + - VasEBoot_DISK_SECTOR_BITS)) - 1)); + real_offset = offset + ((sector - aligned_sector) << VasEBoot_DISK_SECTOR_BITS); sector = aligned_sector; while (size) @@ -74,21 +74,21 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, && size != 0)) { char *tmp_buf; - grub_size_t len; - grub_partition_t part; + VasEBoot_size_t len; + VasEBoot_partition_t part; - tmp_buf = grub_malloc (1U << disk->log_sector_size); + tmp_buf = VasEBoot_malloc (1U << disk->log_sector_size); if (!tmp_buf) - return grub_errno; + return VasEBoot_errno; part = disk->partition; disk->partition = 0; - if (grub_disk_read (disk, sector, + if (VasEBoot_disk_read (disk, sector, 0, (1U << disk->log_sector_size), tmp_buf) - != GRUB_ERR_NONE) + != VasEBoot_ERR_NONE) { disk->partition = part; - grub_free (tmp_buf); + VasEBoot_free (tmp_buf); goto finish; } disk->partition = part; @@ -97,47 +97,47 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, if (len > size) len = size; - grub_memcpy (tmp_buf + real_offset, buf, len); + VasEBoot_memcpy (tmp_buf + real_offset, buf, len); - grub_disk_cache_invalidate (disk->dev->id, disk->id, sector); + VasEBoot_disk_cache_invalidate (disk->dev->id, disk->id, sector); if ((disk->dev->write) (disk, transform_sector (disk, sector), - 1, tmp_buf) != GRUB_ERR_NONE) + 1, tmp_buf) != VasEBoot_ERR_NONE) { - grub_free (tmp_buf); + VasEBoot_free (tmp_buf); goto finish; } - grub_free (tmp_buf); + VasEBoot_free (tmp_buf); - sector += (1U << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)); + sector += (1U << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS)); buf = (const char *) buf + len; size -= len; real_offset = 0; } else { - grub_size_t len; - grub_size_t n; + VasEBoot_size_t len; + VasEBoot_size_t n; len = size & ~((1ULL << disk->log_sector_size) - 1); n = size >> disk->log_sector_size; if (n > (disk->max_agglomerate - << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS + << (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS - disk->log_sector_size))) n = (disk->max_agglomerate - << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS + << (VasEBoot_DISK_CACHE_BITS + VasEBoot_DISK_SECTOR_BITS - disk->log_sector_size)); if ((disk->dev->write) (disk, transform_sector (disk, sector), - n, buf) != GRUB_ERR_NONE) + n, buf) != VasEBoot_ERR_NONE) goto finish; while (n--) { - grub_disk_cache_invalidate (disk->dev->id, disk->id, sector); - sector += (1U << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)); + VasEBoot_disk_cache_invalidate (disk->dev->id, disk->id, sector); + sector += (1U << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS)); } buf = (const char *) buf + len; @@ -147,15 +147,15 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, finish: - return grub_errno; + return VasEBoot_errno; } -GRUB_MOD_INIT(disk) +VasEBoot_MOD_INIT(disk) { - grub_disk_write_weak = grub_disk_write; + VasEBoot_disk_write_weak = VasEBoot_disk_write; } -GRUB_MOD_FINI(disk) +VasEBoot_MOD_FINI(disk) { - grub_disk_write_weak = NULL; + VasEBoot_disk_write_weak = NULL; } diff --git a/VasEBoot-core/lib/division.c b/VasEBoot-core/lib/division.c index 35606fea7..82785052a 100644 --- a/VasEBoot-core/lib/division.c +++ b/VasEBoot-core/lib/division.c @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t -abs64(grub_int64_t a) +static VasEBoot_uint64_t +abs64(VasEBoot_int64_t a) { return a > 0 ? a : -a; } -grub_int64_t -grub_divmod64s (grub_int64_t n, - grub_int64_t d, - grub_int64_t *ro) +VasEBoot_int64_t +VasEBoot_divmod64s (VasEBoot_int64_t n, + VasEBoot_int64_t d, + VasEBoot_int64_t *ro) { - grub_uint64_t ru; - grub_int64_t q, r; - q = grub_divmod64 (abs64(n), abs64(d), &ru); + VasEBoot_uint64_t ru; + VasEBoot_int64_t q, r; + q = VasEBoot_divmod64 (abs64(n), abs64(d), &ru); r = ru; /* Now: |n| = |d| * q + r */ if (n < 0) @@ -55,20 +55,20 @@ grub_divmod64s (grub_int64_t n, return q; } -grub_uint32_t -grub_divmod32 (grub_uint32_t n, grub_uint32_t d, grub_uint32_t *ro) +VasEBoot_uint32_t +VasEBoot_divmod32 (VasEBoot_uint32_t n, VasEBoot_uint32_t d, VasEBoot_uint32_t *ro) { - grub_uint64_t q, r; - q = grub_divmod64 (n, d, &r); + VasEBoot_uint64_t q, r; + q = VasEBoot_divmod64 (n, d, &r); *ro = r; return q; } -grub_int32_t -grub_divmod32s (grub_int32_t n, grub_int32_t d, grub_int32_t *ro) +VasEBoot_int32_t +VasEBoot_divmod32s (VasEBoot_int32_t n, VasEBoot_int32_t d, VasEBoot_int32_t *ro) { - grub_int64_t q, r; - q = grub_divmod64s (n, d, &r); + VasEBoot_int64_t q, r; + q = VasEBoot_divmod64s (n, d, &r); *ro = r; return q; } diff --git a/VasEBoot-core/lib/efi/datetime.c b/VasEBoot-core/lib/efi/datetime.c index 0fd1b5fbd..0ffc428d4 100644 --- a/VasEBoot-core/lib/efi/datetime.c +++ b/VasEBoot-core/lib/efi/datetime.c @@ -1,42 +1,42 @@ /* kern/efi/datetime.c - efi datetime function. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_err_t -grub_get_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_get_datetime (struct VasEBoot_datetime *datetime) { - grub_efi_status_t status; - struct grub_efi_time efi_time; + VasEBoot_efi_status_t status; + struct VasEBoot_efi_time efi_time; - status = efi_call_2 (grub_efi_system_table->runtime_services->get_time, + status = efi_call_2 (VasEBoot_efi_system_table->runtime_services->get_time, &efi_time, 0); if (status) - return grub_error (GRUB_ERR_INVALID_COMMAND, + return VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "can\'t get datetime using efi"); else { @@ -51,17 +51,17 @@ grub_get_datetime (struct grub_datetime *datetime) return 0; } -grub_err_t -grub_set_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_set_datetime (struct VasEBoot_datetime *datetime) { - grub_efi_status_t status; - struct grub_efi_time efi_time; + VasEBoot_efi_status_t status; + struct VasEBoot_efi_time efi_time; - status = efi_call_2 (grub_efi_system_table->runtime_services->get_time, + status = efi_call_2 (VasEBoot_efi_system_table->runtime_services->get_time, &efi_time, 0); if (status) - return grub_error (GRUB_ERR_INVALID_COMMAND, + return VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "can\'t get datetime using efi"); efi_time.year = datetime->year; @@ -71,11 +71,11 @@ grub_set_datetime (struct grub_datetime *datetime) efi_time.minute = datetime->minute; efi_time.second = datetime->second; - status = efi_call_1 (grub_efi_system_table->runtime_services->set_time, + status = efi_call_1 (VasEBoot_efi_system_table->runtime_services->set_time, &efi_time); if (status) - return grub_error (GRUB_ERR_INVALID_COMMAND, + return VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "can\'t set datetime using efi"); return 0; diff --git a/VasEBoot-core/lib/efi/halt.c b/VasEBoot-core/lib/efi/halt.c index e9441c844..4f70c3574 100644 --- a/VasEBoot-core/lib/efi/halt.c +++ b/VasEBoot-core/lib/efi/halt.c @@ -1,39 +1,39 @@ /* efi.c - generic EFI support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- 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 + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include void -grub_halt (void) +VasEBoot_halt (void) { - grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + VasEBoot_machine_fini (VasEBoot_LOADER_FLAG_NORETURN); #if !defined(__ia64__) && !defined(__arm__) && !defined(__aarch64__) - grub_acpi_halt (); + VasEBoot_acpi_halt (); #endif - efi_call_4 (grub_efi_system_table->runtime_services->reset_system, - GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL); + efi_call_4 (VasEBoot_efi_system_table->runtime_services->reset_system, + VasEBoot_EFI_RESET_SHUTDOWN, VasEBoot_EFI_SUCCESS, 0, NULL); while (1); } diff --git a/VasEBoot-core/lib/efi/reboot.c b/VasEBoot-core/lib/efi/reboot.c index 7de8bcb5d..eb6ecbf80 100644 --- a/VasEBoot-core/lib/efi/reboot.c +++ b/VasEBoot-core/lib/efi/reboot.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); - efi_call_4 (grub_efi_system_table->runtime_services->reset_system, - GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); + VasEBoot_machine_fini (VasEBoot_LOADER_FLAG_NORETURN); + efi_call_4 (VasEBoot_efi_system_table->runtime_services->reset_system, + VasEBoot_EFI_RESET_COLD, VasEBoot_EFI_SUCCESS, 0, NULL); for (;;) ; } diff --git a/VasEBoot-core/lib/efi/relocator.c b/VasEBoot-core/lib/efi/relocator.c index 319b69eeb..8503a7264 100644 --- a/VasEBoot-core/lib/efi/relocator.c +++ b/VasEBoot-core/lib/efi/relocator.c @@ -1,69 +1,69 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ - ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + ((VasEBoot_efi_memory_descriptor_t *) ((char *) (desc) + (size))) unsigned -grub_relocator_firmware_get_max_events (void) +VasEBoot_relocator_firmware_get_max_events (void) { - grub_efi_uintn_t mmapsize = 0, descriptor_size = 0; - grub_efi_uint32_t descriptor_version = 0; - grub_efi_uintn_t key; - grub_efi_get_memory_map (&mmapsize, NULL, &key, &descriptor_size, + VasEBoot_efi_uintn_t mmapsize = 0, descriptor_size = 0; + VasEBoot_efi_uint32_t descriptor_version = 0; + VasEBoot_efi_uintn_t key; + VasEBoot_efi_get_memory_map (&mmapsize, NULL, &key, &descriptor_size, &descriptor_version); - /* Since grub_relocator_firmware_fill_events uses malloc + /* Since VasEBoot_relocator_firmware_fill_events uses malloc we need some reserve. Hence +10. */ return 2 * (mmapsize / descriptor_size + 10); } unsigned -grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events) +VasEBoot_relocator_firmware_fill_events (struct VasEBoot_relocator_mmap_event *events) { - grub_efi_uintn_t mmapsize = 0, desc_size = 0; - grub_efi_uint32_t descriptor_version = 0; - grub_efi_memory_descriptor_t *descs = NULL; - grub_efi_uintn_t key; + VasEBoot_efi_uintn_t mmapsize = 0, desc_size = 0; + VasEBoot_efi_uint32_t descriptor_version = 0; + VasEBoot_efi_memory_descriptor_t *descs = NULL; + VasEBoot_efi_uintn_t key; int counter = 0; - grub_efi_memory_descriptor_t *desc; + VasEBoot_efi_memory_descriptor_t *desc; - grub_efi_get_memory_map (&mmapsize, NULL, &key, &desc_size, + VasEBoot_efi_get_memory_map (&mmapsize, NULL, &key, &desc_size, &descriptor_version); - descs = grub_malloc (mmapsize); + descs = VasEBoot_malloc (mmapsize); if (!descs) return 0; - grub_efi_get_memory_map (&mmapsize, descs, &key, &desc_size, + VasEBoot_efi_get_memory_map (&mmapsize, descs, &key, &desc_size, &descriptor_version); for (desc = descs; (char *) desc < ((char *) descs + mmapsize); desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { - grub_uint64_t start = desc->physical_start; - grub_uint64_t end = desc->physical_start + (desc->num_pages << 12); + VasEBoot_uint64_t start = desc->physical_start; + VasEBoot_uint64_t end = desc->physical_start + (desc->num_pages << 12); /* post-4G addresses are never supported on 32-bit EFI. Moreover it has been reported that some 64-bit EFI contrary to the @@ -74,7 +74,7 @@ grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events) end = 0x100000000ULL; if (end <= start) continue; - if (desc->type != GRUB_EFI_CONVENTIONAL_MEMORY) + if (desc->type != VasEBoot_EFI_CONVENTIONAL_MEMORY) continue; events[counter].type = REG_FIRMWARE_START; events[counter].pos = start; @@ -88,32 +88,32 @@ grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events) } int -grub_relocator_firmware_alloc_region (grub_addr_t start, grub_size_t size) +VasEBoot_relocator_firmware_alloc_region (VasEBoot_addr_t start, VasEBoot_size_t size) { - grub_efi_boot_services_t *b; - grub_efi_physical_address_t address = start; - grub_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_physical_address_t address = start; + VasEBoot_efi_status_t status; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return 1; #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "EFI alloc: %llx, %llx\n", + VasEBoot_dprintf ("relocator", "EFI alloc: %llx, %llx\n", (unsigned long long) start, (unsigned long long) size); #endif - b = grub_efi_system_table->boot_services; - status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS, - GRUB_EFI_LOADER_DATA, size >> 12, &address); - return (status == GRUB_EFI_SUCCESS); + b = VasEBoot_efi_system_table->boot_services; + status = efi_call_4 (b->allocate_pages, VasEBoot_EFI_ALLOCATE_ADDRESS, + VasEBoot_EFI_LOADER_DATA, size >> 12, &address); + return (status == VasEBoot_EFI_SUCCESS); } void -grub_relocator_firmware_free_region (grub_addr_t start, grub_size_t size) +VasEBoot_relocator_firmware_free_region (VasEBoot_addr_t start, VasEBoot_size_t size) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; efi_call_2 (b->free_pages, start, size >> 12); } diff --git a/VasEBoot-core/lib/emu/halt.c b/VasEBoot-core/lib/emu/halt.c index 620935b5a..81f5ce6a3 100644 --- a/VasEBoot-core/lib/emu/halt.c +++ b/VasEBoot-core/lib/emu/halt.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include void -grub_halt (void) +VasEBoot_halt (void) { - grub_reboot (); + VasEBoot_reboot (); } diff --git a/VasEBoot-core/lib/envblk.c b/VasEBoot-core/lib/envblk.c index 230e0e9d9..9b33ae2b2 100644 --- a/VasEBoot-core/lib/envblk.c +++ b/VasEBoot-core/lib/envblk.c @@ -1,42 +1,42 @@ /* envblk.c - Common functions for environment block. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include +#include +#include +#include +#include -grub_envblk_t -grub_envblk_open (char *buf, grub_size_t size) +VasEBoot_envblk_t +VasEBoot_envblk_open (char *buf, VasEBoot_size_t size) { - grub_envblk_t envblk; + VasEBoot_envblk_t envblk; - if (size < sizeof (GRUB_ENVBLK_SIGNATURE) - || grub_memcmp (buf, GRUB_ENVBLK_SIGNATURE, - sizeof (GRUB_ENVBLK_SIGNATURE) - 1)) + if (size < sizeof (VasEBoot_ENVBLK_SIGNATURE) + || VasEBoot_memcmp (buf, VasEBoot_ENVBLK_SIGNATURE, + sizeof (VasEBoot_ENVBLK_SIGNATURE) - 1)) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "invalid environment block"); return 0; } - envblk = grub_malloc (sizeof (*envblk)); + envblk = VasEBoot_malloc (sizeof (*envblk)); if (envblk) { envblk->buf = buf; @@ -47,10 +47,10 @@ grub_envblk_open (char *buf, grub_size_t size) } void -grub_envblk_close (grub_envblk_t envblk) +VasEBoot_envblk_close (VasEBoot_envblk_t envblk) { - grub_free (envblk->buf); - grub_free (envblk); + VasEBoot_free (envblk->buf); + VasEBoot_free (envblk); } static int @@ -87,7 +87,7 @@ find_next_line (char *p, const char *pend) } int -grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) +VasEBoot_envblk_set (VasEBoot_envblk_t envblk, const char *name, const char *value) { char *p, *pend; char *space; @@ -96,9 +96,9 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) int vl; int i; - nl = grub_strlen (name); + nl = VasEBoot_strlen (name); vl = escaped_value_len (value); - p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + p = envblk->buf + sizeof (VasEBoot_ENVBLK_SIGNATURE) - 1; pend = envblk->buf + envblk->size; /* First, look at free space. */ @@ -113,7 +113,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) while (p + nl + 1 < space) { - if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=') + if (VasEBoot_memcmp (p, name, nl) == 0 && p[nl] == '=') { int len; @@ -142,12 +142,12 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) { /* Move the following characters backward, and fill the new space with harmless characters. */ - grub_memmove (p + vl, p + len, pend - (p + len)); - grub_memset (space + len - vl, '#', len - vl); + VasEBoot_memmove (p + vl, p + len, pend - (p + len)); + VasEBoot_memset (space + len - vl, '#', len - vl); } else /* Move the following characters forward. */ - grub_memmove (p + vl, p + len, pend - (p + vl)); + VasEBoot_memmove (p + vl, p + len, pend - (p + vl)); found = 1; break; @@ -164,7 +164,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) /* No space. */ return 0; - grub_memcpy (space, name, nl); + VasEBoot_memcpy (space, name, nl); p = space + nl; *p++ = '='; } @@ -183,18 +183,18 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) } void -grub_envblk_delete (grub_envblk_t envblk, const char *name) +VasEBoot_envblk_delete (VasEBoot_envblk_t envblk, const char *name) { char *p, *pend; int nl; - nl = grub_strlen (name); - p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + nl = VasEBoot_strlen (name); + p = envblk->buf + sizeof (VasEBoot_ENVBLK_SIGNATURE) - 1; pend = envblk->buf + envblk->size; while (p + nl + 1 < pend) { - if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=') + if (VasEBoot_memcmp (p, name, nl) == 0 && p[nl] == '=') { /* Found. */ int len = nl + 1; @@ -214,8 +214,8 @@ grub_envblk_delete (grub_envblk_t envblk, const char *name) return; len++; - grub_memmove (p, p + len, pend - (p + len)); - grub_memset (pend - len, '#', len); + VasEBoot_memmove (p, p + len, pend - (p + len)); + VasEBoot_memset (pend - len, '#', len); break; } @@ -224,13 +224,13 @@ grub_envblk_delete (grub_envblk_t envblk, const char *name) } void -grub_envblk_iterate (grub_envblk_t envblk, +VasEBoot_envblk_iterate (VasEBoot_envblk_t envblk, void *hook_data, int hook (const char *name, const char *value, void *hook_data)) { char *p, *pend; - p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + p = envblk->buf + sizeof (VasEBoot_ENVBLK_SIGNATURE) - 1; pend = envblk->buf + envblk->size; while (p < pend) @@ -267,14 +267,14 @@ grub_envblk_iterate (grub_envblk_t envblk, /* Broken. */ return; - name = grub_malloc (p - name_start + 1); + name = VasEBoot_malloc (p - name_start + 1); if (! name) /* out of memory. */ return; value = name + (value_start - name_start); - grub_memcpy (name, name_start, name_end - name_start); + VasEBoot_memcpy (name, name_start, name_end - name_start); name[name_end - name_start] = '\0'; for (p = value_start, q = value; *p != '\n'; ++p) @@ -287,7 +287,7 @@ grub_envblk_iterate (grub_envblk_t envblk, *q = '\0'; ret = hook (name, value, hook_data); - grub_free (name); + VasEBoot_free (name); if (ret) return; } diff --git a/VasEBoot-core/lib/fake_module.c b/VasEBoot-core/lib/fake_module.c index 3646cedbc..8cf2777d9 100644 --- a/VasEBoot-core/lib/fake_module.c +++ b/VasEBoot-core/lib/fake_module.c @@ -1,4 +1,4 @@ /* This file is intentionally empty: it's used to generate modules with no code or data. (purely dependency modules) */ -#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); diff --git a/VasEBoot-core/lib/fdt.c b/VasEBoot-core/lib/fdt.c index b5d520f20..e3bd0f3c0 100644 --- a/VasEBoot-core/lib/fdt.c +++ b/VasEBoot-core/lib/fdt.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define FDT_SUPPORTED_VERSION 17 @@ -32,19 +32,19 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define FDT_END 0x00000009 #define struct_end(fdt) \ - ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt) \ - + grub_fdt_get_size_dt_struct(fdt)) + ((VasEBoot_addr_t) fdt + VasEBoot_fdt_get_off_dt_struct(fdt) \ + + VasEBoot_fdt_get_size_dt_struct(fdt)) /* Size needed by a node entry: 2 tokens (FDT_BEGIN_NODE and FDT_END_NODE), plus the NULL-terminated string containing the name, plus padding if needed. */ #define node_entry_size(node_name) \ - (2 * sizeof(grub_uint32_t) \ - + ALIGN_UP (grub_strlen (name) + 1, sizeof(grub_uint32_t))) + (2 * sizeof(VasEBoot_uint32_t) \ + + ALIGN_UP (VasEBoot_strlen (name) + 1, sizeof(VasEBoot_uint32_t))) /* Size needed by a property entry: 1 token (FDT_PROPERTY), plus len and nameoff fields, plus the property value, plus padding if needed. */ #define prop_entry_size(prop_len) \ - (3 * sizeof(grub_uint32_t) + ALIGN_UP(prop_len, sizeof(grub_uint32_t))) + (3 * sizeof(VasEBoot_uint32_t) + ALIGN_UP(prop_len, sizeof(VasEBoot_uint32_t))) #define SKIP_NODE_NAME(name, token, end) \ name = (char *) ((token) + 1); \ @@ -53,13 +53,13 @@ GRUB_MOD_LICENSE ("GPLv3+"); if (!*name++) \ break; \ } \ - token = (grub_uint32_t *) ALIGN_UP((grub_addr_t) (name), sizeof(*token)) + token = (VasEBoot_uint32_t *) ALIGN_UP((VasEBoot_addr_t) (name), sizeof(*token)) -static grub_uint32_t *get_next_node (const void *fdt, char *node_name) +static VasEBoot_uint32_t *get_next_node (const void *fdt, char *node_name) { - grub_uint32_t *end = (void *) struct_end (fdt); - grub_uint32_t *token; + VasEBoot_uint32_t *end = (void *) struct_end (fdt); + VasEBoot_uint32_t *token; if (node_name >= (char *) end) return NULL; @@ -68,10 +68,10 @@ static grub_uint32_t *get_next_node (const void *fdt, char *node_name) if (node_name >= (char *) end) return NULL; } - token = (grub_uint32_t *) ALIGN_UP ((grub_addr_t) node_name, 4); + token = (VasEBoot_uint32_t *) ALIGN_UP ((VasEBoot_addr_t) node_name, 4); while (token < end) { - switch (grub_be_to_cpu32(*token)) + switch (VasEBoot_be_to_cpu32(*token)) { case FDT_BEGIN_NODE: token = get_next_node (fdt, (char *) (token + 1)); @@ -86,7 +86,7 @@ static grub_uint32_t *get_next_node (const void *fdt, char *node_name) case FDT_PROP: /* Skip property token and following data (len, nameoff and property value). */ - token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) + token += prop_entry_size(VasEBoot_be_to_cpu32(*(token + 1))) / sizeof(*token); break; case FDT_NOP: @@ -102,8 +102,8 @@ static grub_uint32_t *get_next_node (const void *fdt, char *node_name) static int get_mem_rsvmap_size (const void *fdt) { int size = 0; - grub_uint64_t *ptr = (void *) ((grub_addr_t) fdt - + grub_fdt_get_off_mem_rsvmap (fdt)); + VasEBoot_uint64_t *ptr = (void *) ((VasEBoot_addr_t) fdt + + VasEBoot_fdt_get_off_mem_rsvmap (fdt)); do { @@ -111,31 +111,31 @@ static int get_mem_rsvmap_size (const void *fdt) if (!*ptr && !*(ptr + 1)) return size; ptr += 2; - } while ((grub_addr_t) ptr <= (grub_addr_t) fdt + grub_fdt_get_totalsize (fdt) - - 2 * sizeof(grub_uint64_t)); + } while ((VasEBoot_addr_t) ptr <= (VasEBoot_addr_t) fdt + VasEBoot_fdt_get_totalsize (fdt) + - 2 * sizeof(VasEBoot_uint64_t)); return -1; } -static grub_uint32_t get_free_space (void *fdt) +static VasEBoot_uint32_t get_free_space (void *fdt) { int mem_rsvmap_size = get_mem_rsvmap_size (fdt); if (mem_rsvmap_size < 0) /* invalid memory reservation block */ return 0; - return (grub_fdt_get_totalsize (fdt) - sizeof(grub_fdt_header_t) - - mem_rsvmap_size - grub_fdt_get_size_dt_strings (fdt) - - grub_fdt_get_size_dt_struct (fdt)); + return (VasEBoot_fdt_get_totalsize (fdt) - sizeof(VasEBoot_fdt_header_t) + - mem_rsvmap_size - VasEBoot_fdt_get_size_dt_strings (fdt) + - VasEBoot_fdt_get_size_dt_struct (fdt)); } static int add_subnode (void *fdt, int parentoffset, const char *name) { - grub_uint32_t *token = (void *) ((grub_addr_t) fdt - + grub_fdt_get_off_dt_struct(fdt) + VasEBoot_uint32_t *token = (void *) ((VasEBoot_addr_t) fdt + + VasEBoot_fdt_get_off_dt_struct(fdt) + parentoffset); - grub_uint32_t *end = (void *) struct_end (fdt); + VasEBoot_uint32_t *end = (void *) struct_end (fdt); unsigned int entry_size = node_entry_size (name); - unsigned int struct_size = grub_fdt_get_size_dt_struct(fdt); + unsigned int struct_size = VasEBoot_fdt_get_size_dt_struct(fdt); char *node_name; SKIP_NODE_NAME(node_name, token, end); @@ -146,11 +146,11 @@ static int add_subnode (void *fdt, int parentoffset, const char *name) { if (token >= end) return -1; - switch (grub_be_to_cpu32(*token)) + switch (VasEBoot_be_to_cpu32(*token)) { case FDT_PROP: /* Skip len, nameoff and property value. */ - token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) + token += prop_entry_size(VasEBoot_be_to_cpu32(*(token + 1))) / sizeof(*token); break; case FDT_BEGIN_NODE: @@ -165,15 +165,15 @@ static int add_subnode (void *fdt, int parentoffset, const char *name) } } insert: - grub_memmove (token + entry_size / sizeof(*token), token, - (grub_addr_t) end - (grub_addr_t) token); - *token = grub_cpu_to_be32_compile_time(FDT_BEGIN_NODE); + VasEBoot_memmove (token + entry_size / sizeof(*token), token, + (VasEBoot_addr_t) end - (VasEBoot_addr_t) token); + *token = VasEBoot_cpu_to_be32_compile_time(FDT_BEGIN_NODE); token[entry_size / sizeof(*token) - 2] = 0; /* padding bytes */ - grub_strcpy((char *) (token + 1), name); - token[entry_size / sizeof(*token) - 1] = grub_cpu_to_be32_compile_time(FDT_END_NODE); - grub_fdt_set_size_dt_struct (fdt, struct_size + entry_size); - return ((grub_addr_t) token - (grub_addr_t) fdt - - grub_fdt_get_off_dt_struct(fdt)); + VasEBoot_strcpy((char *) (token + 1), name); + token[entry_size / sizeof(*token) - 1] = VasEBoot_cpu_to_be32_compile_time(FDT_END_NODE); + VasEBoot_fdt_set_size_dt_struct (fdt, struct_size + entry_size); + return ((VasEBoot_addr_t) token - (VasEBoot_addr_t) fdt + - VasEBoot_fdt_get_off_dt_struct(fdt)); } /* Rearrange FDT blocks in the canonical order: first the memory reservation @@ -183,80 +183,80 @@ insert: clearance argument. */ static int rearrange_blocks (void *fdt, unsigned int clearance) { - grub_uint32_t off_mem_rsvmap = ALIGN_UP(sizeof(grub_fdt_header_t), 8); - grub_uint32_t off_dt_struct = off_mem_rsvmap + get_mem_rsvmap_size (fdt); - grub_uint32_t off_dt_strings = off_dt_struct - + grub_fdt_get_size_dt_struct (fdt) + VasEBoot_uint32_t off_mem_rsvmap = ALIGN_UP(sizeof(VasEBoot_fdt_header_t), 8); + VasEBoot_uint32_t off_dt_struct = off_mem_rsvmap + get_mem_rsvmap_size (fdt); + VasEBoot_uint32_t off_dt_strings = off_dt_struct + + VasEBoot_fdt_get_size_dt_struct (fdt) + clearance; - grub_uint8_t *fdt_ptr = fdt; - grub_uint8_t *tmp_fdt; + VasEBoot_uint8_t *fdt_ptr = fdt; + VasEBoot_uint8_t *tmp_fdt; - if ((grub_fdt_get_off_mem_rsvmap (fdt) == off_mem_rsvmap) - && (grub_fdt_get_off_dt_struct (fdt) == off_dt_struct)) + if ((VasEBoot_fdt_get_off_mem_rsvmap (fdt) == off_mem_rsvmap) + && (VasEBoot_fdt_get_off_dt_struct (fdt) == off_dt_struct)) { /* No need to allocate memory for a temporary FDT, just move the strings block if needed. */ - if (grub_fdt_get_off_dt_strings (fdt) != off_dt_strings) + if (VasEBoot_fdt_get_off_dt_strings (fdt) != off_dt_strings) { - grub_memmove(fdt_ptr + off_dt_strings, - fdt_ptr + grub_fdt_get_off_dt_strings (fdt), - grub_fdt_get_size_dt_strings (fdt)); - grub_fdt_set_off_dt_strings (fdt, off_dt_strings); + VasEBoot_memmove(fdt_ptr + off_dt_strings, + fdt_ptr + VasEBoot_fdt_get_off_dt_strings (fdt), + VasEBoot_fdt_get_size_dt_strings (fdt)); + VasEBoot_fdt_set_off_dt_strings (fdt, off_dt_strings); } return 0; } - tmp_fdt = grub_malloc (grub_fdt_get_totalsize (fdt)); + tmp_fdt = VasEBoot_malloc (VasEBoot_fdt_get_totalsize (fdt)); if (!tmp_fdt) return -1; - grub_memcpy (tmp_fdt + off_mem_rsvmap, - fdt_ptr + grub_fdt_get_off_mem_rsvmap (fdt), + VasEBoot_memcpy (tmp_fdt + off_mem_rsvmap, + fdt_ptr + VasEBoot_fdt_get_off_mem_rsvmap (fdt), get_mem_rsvmap_size (fdt)); - grub_fdt_set_off_mem_rsvmap (fdt, off_mem_rsvmap); - grub_memcpy (tmp_fdt + off_dt_struct, - fdt_ptr + grub_fdt_get_off_dt_struct (fdt), - grub_fdt_get_size_dt_struct (fdt)); - grub_fdt_set_off_dt_struct (fdt, off_dt_struct); - grub_memcpy (tmp_fdt + off_dt_strings, - fdt_ptr + grub_fdt_get_off_dt_strings (fdt), - grub_fdt_get_size_dt_strings (fdt)); - grub_fdt_set_off_dt_strings (fdt, off_dt_strings); + VasEBoot_fdt_set_off_mem_rsvmap (fdt, off_mem_rsvmap); + VasEBoot_memcpy (tmp_fdt + off_dt_struct, + fdt_ptr + VasEBoot_fdt_get_off_dt_struct (fdt), + VasEBoot_fdt_get_size_dt_struct (fdt)); + VasEBoot_fdt_set_off_dt_struct (fdt, off_dt_struct); + VasEBoot_memcpy (tmp_fdt + off_dt_strings, + fdt_ptr + VasEBoot_fdt_get_off_dt_strings (fdt), + VasEBoot_fdt_get_size_dt_strings (fdt)); + VasEBoot_fdt_set_off_dt_strings (fdt, off_dt_strings); /* Copy reordered blocks back to fdt. */ - grub_memcpy (fdt_ptr + off_mem_rsvmap, tmp_fdt + off_mem_rsvmap, - grub_fdt_get_totalsize (fdt) - off_mem_rsvmap); + VasEBoot_memcpy (fdt_ptr + off_mem_rsvmap, tmp_fdt + off_mem_rsvmap, + VasEBoot_fdt_get_totalsize (fdt) - off_mem_rsvmap); - grub_free(tmp_fdt); + VasEBoot_free(tmp_fdt); return 0; } -static grub_uint32_t *find_prop (void *fdt, unsigned int nodeoffset, +static VasEBoot_uint32_t *find_prop (void *fdt, unsigned int nodeoffset, const char *name) { - grub_uint32_t *prop = (void *) ((grub_addr_t) fdt - + grub_fdt_get_off_dt_struct (fdt) + VasEBoot_uint32_t *prop = (void *) ((VasEBoot_addr_t) fdt + + VasEBoot_fdt_get_off_dt_struct (fdt) + nodeoffset); - grub_uint32_t *end = (void *) struct_end(fdt); - grub_uint32_t nameoff; + VasEBoot_uint32_t *end = (void *) struct_end(fdt); + VasEBoot_uint32_t nameoff; char *node_name; SKIP_NODE_NAME(node_name, prop, end); while (prop < end - 2) { - if (grub_be_to_cpu32(*prop) == FDT_PROP) + if (VasEBoot_be_to_cpu32(*prop) == FDT_PROP) { - nameoff = grub_be_to_cpu32(*(prop + 2)); - if ((nameoff + grub_strlen (name) < grub_fdt_get_size_dt_strings (fdt)) - && !grub_strcmp (name, (char *) fdt + - grub_fdt_get_off_dt_strings (fdt) + nameoff)) + nameoff = VasEBoot_be_to_cpu32(*(prop + 2)); + if ((nameoff + VasEBoot_strlen (name) < VasEBoot_fdt_get_size_dt_strings (fdt)) + && !VasEBoot_strcmp (name, (char *) fdt + + VasEBoot_fdt_get_off_dt_strings (fdt) + nameoff)) { - if (prop + prop_entry_size(grub_be_to_cpu32(*(prop + 1))) + if (prop + prop_entry_size(VasEBoot_be_to_cpu32(*(prop + 1))) / sizeof (*prop) >= end) return NULL; return prop; } - prop += prop_entry_size(grub_be_to_cpu32(*(prop + 1))) / sizeof (*prop); + prop += prop_entry_size(VasEBoot_be_to_cpu32(*(prop + 1))) / sizeof (*prop); } - else if (grub_be_to_cpu32(*prop) == FDT_NOP) + else if (VasEBoot_be_to_cpu32(*prop) == FDT_NOP) prop++; else return NULL; @@ -268,59 +268,59 @@ static grub_uint32_t *find_prop (void *fdt, unsigned int nodeoffset, the size allocated for the FDT; if this function is called before the other functions in this file and returns success, the other functions are guaranteed not to access memory locations outside the allocated memory. */ -int grub_fdt_check_header_nosize (void *fdt) +int VasEBoot_fdt_check_header_nosize (void *fdt) { - if (((grub_addr_t) fdt & 0x7) || (grub_fdt_get_magic (fdt) != FDT_MAGIC) - || (grub_fdt_get_version (fdt) < FDT_SUPPORTED_VERSION) - || (grub_fdt_get_last_comp_version (fdt) > FDT_SUPPORTED_VERSION) - || (grub_fdt_get_off_dt_struct (fdt) & 0x00000003) - || (grub_fdt_get_size_dt_struct (fdt) & 0x00000003) - || (grub_fdt_get_off_dt_struct (fdt) + grub_fdt_get_size_dt_struct (fdt) - > grub_fdt_get_totalsize (fdt)) - || (grub_fdt_get_off_dt_strings (fdt) + grub_fdt_get_size_dt_strings (fdt) - > grub_fdt_get_totalsize (fdt)) - || (grub_fdt_get_off_mem_rsvmap (fdt) & 0x00000007) - || (grub_fdt_get_off_mem_rsvmap (fdt) - > grub_fdt_get_totalsize (fdt) - 2 * sizeof(grub_uint64_t))) + if (((VasEBoot_addr_t) fdt & 0x7) || (VasEBoot_fdt_get_magic (fdt) != FDT_MAGIC) + || (VasEBoot_fdt_get_version (fdt) < FDT_SUPPORTED_VERSION) + || (VasEBoot_fdt_get_last_comp_version (fdt) > FDT_SUPPORTED_VERSION) + || (VasEBoot_fdt_get_off_dt_struct (fdt) & 0x00000003) + || (VasEBoot_fdt_get_size_dt_struct (fdt) & 0x00000003) + || (VasEBoot_fdt_get_off_dt_struct (fdt) + VasEBoot_fdt_get_size_dt_struct (fdt) + > VasEBoot_fdt_get_totalsize (fdt)) + || (VasEBoot_fdt_get_off_dt_strings (fdt) + VasEBoot_fdt_get_size_dt_strings (fdt) + > VasEBoot_fdt_get_totalsize (fdt)) + || (VasEBoot_fdt_get_off_mem_rsvmap (fdt) & 0x00000007) + || (VasEBoot_fdt_get_off_mem_rsvmap (fdt) + > VasEBoot_fdt_get_totalsize (fdt) - 2 * sizeof(VasEBoot_uint64_t))) return -1; return 0; } -int grub_fdt_check_header (void *fdt, unsigned int size) +int VasEBoot_fdt_check_header (void *fdt, unsigned int size) { - if (size < sizeof (grub_fdt_header_t) - || (grub_fdt_get_totalsize (fdt) > size) - || grub_fdt_check_header_nosize (fdt) == -1) + if (size < sizeof (VasEBoot_fdt_header_t) + || (VasEBoot_fdt_get_totalsize (fdt) > size) + || VasEBoot_fdt_check_header_nosize (fdt) == -1) return -1; return 0; } /* Find a direct sub-node of a given parent node. */ -int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, +int VasEBoot_fdt_find_subnode (const void *fdt, unsigned int parentoffset, const char *name) { - grub_uint32_t *token, *end; + VasEBoot_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) + token = (void *) ((VasEBoot_addr_t) fdt + VasEBoot_fdt_get_off_dt_struct(fdt) + parentoffset); end = (void *) struct_end (fdt); - if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE)) + if ((token >= end) || (VasEBoot_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)) + switch (VasEBoot_be_to_cpu32(*token)) { case FDT_BEGIN_NODE: node_name = (char *) (token + 1); - if (node_name + grub_strlen (name) >= (char *) end) + if (node_name + VasEBoot_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)); + if (!VasEBoot_strcmp (node_name, name)) + return (int) ((VasEBoot_addr_t) token - (VasEBoot_addr_t) fdt + - VasEBoot_fdt_get_off_dt_struct (fdt)); token = get_next_node (fdt, node_name); if (!token) return -1; @@ -330,7 +330,7 @@ int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, value). */ if (token >= end - 1) return -1; - token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) + token += prop_entry_size(VasEBoot_be_to_cpu32(*(token + 1))) / sizeof(*token); break; case FDT_NOP: @@ -343,7 +343,7 @@ int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, return -1; } -int grub_fdt_add_subnode (void *fdt, unsigned int parentoffset, +int VasEBoot_fdt_add_subnode (void *fdt, unsigned int parentoffset, const char *name) { unsigned int entry_size = node_entry_size(name); @@ -359,36 +359,36 @@ int grub_fdt_add_subnode (void *fdt, unsigned int parentoffset, return add_subnode (fdt, parentoffset, name); } -int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, - const void *val, grub_uint32_t len) +int VasEBoot_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + const void *val, VasEBoot_uint32_t len) { - grub_uint32_t *prop; + VasEBoot_uint32_t *prop; int prop_name_present = 0; - grub_uint32_t nameoff = 0; + VasEBoot_uint32_t nameoff = 0; - if ((nodeoffset >= grub_fdt_get_size_dt_struct (fdt)) || (nodeoffset & 0x3) - || (grub_be_to_cpu32(*(grub_uint32_t *) ((grub_addr_t) fdt - + grub_fdt_get_off_dt_struct (fdt) + nodeoffset)) + if ((nodeoffset >= VasEBoot_fdt_get_size_dt_struct (fdt)) || (nodeoffset & 0x3) + || (VasEBoot_be_to_cpu32(*(VasEBoot_uint32_t *) ((VasEBoot_addr_t) fdt + + VasEBoot_fdt_get_off_dt_struct (fdt) + nodeoffset)) != FDT_BEGIN_NODE)) return -1; prop = find_prop (fdt, nodeoffset, name); if (prop) { - grub_uint32_t prop_len = ALIGN_UP(grub_be_to_cpu32 (*(prop + 1)), - sizeof(grub_uint32_t)); - grub_uint32_t i; + VasEBoot_uint32_t prop_len = ALIGN_UP(VasEBoot_be_to_cpu32 (*(prop + 1)), + sizeof(VasEBoot_uint32_t)); + VasEBoot_uint32_t i; prop_name_present = 1; - for (i = 0; i < prop_len / sizeof(grub_uint32_t); i++) - *(prop + 3 + i) = grub_cpu_to_be32_compile_time (FDT_NOP); - if (len > ALIGN_UP(prop_len, sizeof(grub_uint32_t))) + for (i = 0; i < prop_len / sizeof(VasEBoot_uint32_t); i++) + *(prop + 3 + i) = VasEBoot_cpu_to_be32_compile_time (FDT_NOP); + if (len > ALIGN_UP(prop_len, sizeof(VasEBoot_uint32_t))) { /* Length of new property value is greater than the space allocated for the current value: a new entry needs to be created, so save the nameoff field of the current entry and replace the current entry with NOP tokens. */ - nameoff = grub_be_to_cpu32 (*(prop + 2)); - *prop = *(prop + 1) = *(prop + 2) = grub_cpu_to_be32_compile_time (FDT_NOP); + nameoff = VasEBoot_be_to_cpu32 (*(prop + 2)); + *prop = *(prop + 1) = *(prop + 2) = VasEBoot_cpu_to_be32_compile_time (FDT_NOP); prop = NULL; } } @@ -398,7 +398,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, if (!prop) needed_space = prop_entry_size(len); if (!prop_name_present) - needed_space += grub_strlen (name) + 1; + needed_space += VasEBoot_strlen (name) + 1; if (needed_space > get_free_space (fdt)) return -1; if (rearrange_blocks (fdt, !prop ? prop_entry_size(len) : 0) < 0) @@ -406,60 +406,60 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, } if (!prop_name_present) { /* Append the property name at the end of the strings block. */ - nameoff = grub_fdt_get_size_dt_strings (fdt); - grub_strcpy ((char *) fdt + grub_fdt_get_off_dt_strings (fdt) + nameoff, + nameoff = VasEBoot_fdt_get_size_dt_strings (fdt); + VasEBoot_strcpy ((char *) fdt + VasEBoot_fdt_get_off_dt_strings (fdt) + nameoff, name); - grub_fdt_set_size_dt_strings (fdt, grub_fdt_get_size_dt_strings (fdt) - + grub_strlen (name) + 1); + VasEBoot_fdt_set_size_dt_strings (fdt, VasEBoot_fdt_get_size_dt_strings (fdt) + + VasEBoot_strlen (name) + 1); } if (!prop) { - char *node_name = (char *) ((grub_addr_t) fdt - + grub_fdt_get_off_dt_struct (fdt) + nodeoffset - + sizeof(grub_uint32_t)); + char *node_name = (char *) ((VasEBoot_addr_t) fdt + + VasEBoot_fdt_get_off_dt_struct (fdt) + nodeoffset + + sizeof(VasEBoot_uint32_t)); - prop = (void *) (node_name + ALIGN_UP(grub_strlen(node_name) + 1, 4)); - grub_memmove (prop + prop_entry_size(len) / sizeof(*prop), prop, - struct_end(fdt) - (grub_addr_t) prop); - grub_fdt_set_size_dt_struct (fdt, grub_fdt_get_size_dt_struct (fdt) + prop = (void *) (node_name + ALIGN_UP(VasEBoot_strlen(node_name) + 1, 4)); + VasEBoot_memmove (prop + prop_entry_size(len) / sizeof(*prop), prop, + struct_end(fdt) - (VasEBoot_addr_t) prop); + VasEBoot_fdt_set_size_dt_struct (fdt, VasEBoot_fdt_get_size_dt_struct (fdt) + prop_entry_size(len)); - *prop = grub_cpu_to_be32_compile_time (FDT_PROP); - *(prop + 2) = grub_cpu_to_be32 (nameoff); + *prop = VasEBoot_cpu_to_be32_compile_time (FDT_PROP); + *(prop + 2) = VasEBoot_cpu_to_be32 (nameoff); } - *(prop + 1) = grub_cpu_to_be32 (len); + *(prop + 1) = VasEBoot_cpu_to_be32 (len); /* Insert padding bytes at the end of the value; if they are not needed, they will be overwritten by the following memcpy. */ - *(prop + prop_entry_size(len) / sizeof(grub_uint32_t) - 1) = 0; + *(prop + prop_entry_size(len) / sizeof(VasEBoot_uint32_t) - 1) = 0; - grub_memcpy (prop + 3, val, len); + VasEBoot_memcpy (prop + 3, val, len); return 0; } int -grub_fdt_create_empty_tree (void *fdt, unsigned int size) +VasEBoot_fdt_create_empty_tree (void *fdt, unsigned int size) { - struct grub_fdt_empty_tree *et; + struct VasEBoot_fdt_empty_tree *et; - if (size < GRUB_FDT_EMPTY_TREE_SZ) + if (size < VasEBoot_FDT_EMPTY_TREE_SZ) return -1; - grub_memset (fdt, 0, size); + VasEBoot_memset (fdt, 0, size); et = fdt; - et->empty_node.tree_end = grub_cpu_to_be32_compile_time (FDT_END); - et->empty_node.node_end = grub_cpu_to_be32_compile_time (FDT_END_NODE); - et->empty_node.node_start = grub_cpu_to_be32_compile_time (FDT_BEGIN_NODE); - ((struct grub_fdt_empty_tree *) fdt)->header.off_mem_rsvmap = - grub_cpu_to_be32_compile_time (ALIGN_UP (sizeof (grub_fdt_header_t), 8)); + et->empty_node.tree_end = VasEBoot_cpu_to_be32_compile_time (FDT_END); + et->empty_node.node_end = VasEBoot_cpu_to_be32_compile_time (FDT_END_NODE); + et->empty_node.node_start = VasEBoot_cpu_to_be32_compile_time (FDT_BEGIN_NODE); + ((struct VasEBoot_fdt_empty_tree *) fdt)->header.off_mem_rsvmap = + VasEBoot_cpu_to_be32_compile_time (ALIGN_UP (sizeof (VasEBoot_fdt_header_t), 8)); - grub_fdt_set_off_dt_strings (fdt, sizeof (*et)); - grub_fdt_set_off_dt_struct (fdt, + VasEBoot_fdt_set_off_dt_strings (fdt, sizeof (*et)); + VasEBoot_fdt_set_off_dt_struct (fdt, sizeof (et->header) + sizeof (et->empty_rsvmap)); - grub_fdt_set_version (fdt, FDT_SUPPORTED_VERSION); - grub_fdt_set_last_comp_version (fdt, FDT_SUPPORTED_VERSION); - grub_fdt_set_size_dt_struct (fdt, sizeof (et->empty_node)); - grub_fdt_set_totalsize (fdt, size); - grub_fdt_set_magic (fdt, FDT_MAGIC); + VasEBoot_fdt_set_version (fdt, FDT_SUPPORTED_VERSION); + VasEBoot_fdt_set_last_comp_version (fdt, FDT_SUPPORTED_VERSION); + VasEBoot_fdt_set_size_dt_struct (fdt, sizeof (et->empty_node)); + VasEBoot_fdt_set_totalsize (fdt, size); + VasEBoot_fdt_set_magic (fdt, FDT_MAGIC); return 0; } diff --git a/VasEBoot-core/lib/getline.c b/VasEBoot-core/lib/getline.c index edb8e9ffe..feb84baeb 100644 --- a/VasEBoot-core/lib/getline.c +++ b/VasEBoot-core/lib/getline.c @@ -1,56 +1,56 @@ /* main.c - the normal mode main routine */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2005,2006,2007,2008,2009,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Read a line from the file FILE. */ char * -grub_file_getline (grub_file_t file) +VasEBoot_file_getline (VasEBoot_file_t file) { char c; - grub_size_t pos = 0; + VasEBoot_size_t pos = 0; char *cmdline; int have_newline = 0; - grub_size_t max_len = 64; + VasEBoot_size_t max_len = 64; /* Initially locate some space. */ - cmdline = grub_malloc (max_len); + cmdline = VasEBoot_malloc (max_len); if (! cmdline) return 0; while (1) { - if (grub_file_read (file, &c, 1) != 1) + if (VasEBoot_file_read (file, &c, 1) != 1) break; /* Skip all carriage returns. */ @@ -62,10 +62,10 @@ grub_file_getline (grub_file_t file) { char *old_cmdline = cmdline; max_len = max_len * 2; - cmdline = grub_realloc (cmdline, max_len); + cmdline = VasEBoot_realloc (cmdline, max_len); if (! cmdline) { - grub_free (old_cmdline); + VasEBoot_free (old_cmdline); return 0; } } @@ -84,7 +84,7 @@ grub_file_getline (grub_file_t file) /* If the buffer is empty, don't return anything at all. */ if (pos == 0 && !have_newline) { - grub_free (cmdline); + VasEBoot_free (cmdline); cmdline = 0; } diff --git a/VasEBoot-core/lib/gpt.c b/VasEBoot-core/lib/gpt.c index 95538d5a3..e00d05423 100644 --- a/VasEBoot-core/lib/gpt.c +++ b/VasEBoot-core/lib/gpt.c @@ -1,155 +1,155 @@ /* gpt.c - Read/Verify/Write GUID Partition Tables (GPT). */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. * Copyright (C) 2014 CoreOS, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint8_t grub_gpt_magic[] = GRUB_GPT_HEADER_MAGIC; +static VasEBoot_uint8_t VasEBoot_gpt_magic[] = VasEBoot_GPT_HEADER_MAGIC; -static grub_err_t -grub_gpt_read_entries (grub_disk_t disk, grub_gpt_t gpt, - struct grub_gpt_header *header, +static VasEBoot_err_t +VasEBoot_gpt_read_entries (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt, + struct VasEBoot_gpt_header *header, void **ret_entries, - grub_size_t *ret_entries_size); + VasEBoot_size_t *ret_entries_size); char * -grub_gpt_guid_to_str (grub_gpt_guid_t *guid) +VasEBoot_gpt_guid_to_str (VasEBoot_gpt_guid_t *guid) { - return grub_xasprintf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - grub_le_to_cpu32 (guid->data1), - grub_le_to_cpu16 (guid->data2), - grub_le_to_cpu16 (guid->data3), + return VasEBoot_xasprintf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + VasEBoot_le_to_cpu32 (guid->data1), + VasEBoot_le_to_cpu16 (guid->data2), + VasEBoot_le_to_cpu16 (guid->data3), guid->data4[0], guid->data4[1], guid->data4[2], guid->data4[3], guid->data4[4], guid->data4[5], guid->data4[6], guid->data4[7]); } -static grub_err_t -grub_gpt_device_partentry (grub_device_t device, - struct grub_gpt_partentry *entry) +static VasEBoot_err_t +VasEBoot_gpt_device_partentry (VasEBoot_device_t device, + struct VasEBoot_gpt_partentry *entry) { - grub_disk_t disk = device->disk; - grub_partition_t p; - grub_err_t err; + VasEBoot_disk_t disk = device->disk; + VasEBoot_partition_t p; + VasEBoot_err_t err; if (!disk || !disk->partition) - return grub_error (GRUB_ERR_BUG, "not a partition"); + return VasEBoot_error (VasEBoot_ERR_BUG, "not a partition"); - if (grub_strcmp (disk->partition->partmap->name, "gpt")) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a GPT partition"); + if (VasEBoot_strcmp (disk->partition->partmap->name, "gpt")) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not a GPT partition"); p = disk->partition; disk->partition = p->parent; - err = grub_disk_read (disk, p->offset, p->index, sizeof (*entry), entry); + err = VasEBoot_disk_read (disk, p->offset, p->index, sizeof (*entry), entry); disk->partition = p; return err; } -grub_err_t -grub_gpt_part_label (grub_device_t device, char **label) +VasEBoot_err_t +VasEBoot_gpt_part_label (VasEBoot_device_t device, char **label) { - struct grub_gpt_partentry entry; - const grub_size_t name_len = ARRAY_SIZE (entry.name); - const grub_size_t label_len = name_len * GRUB_MAX_UTF8_PER_UTF16 + 1; - grub_size_t i; - grub_uint8_t *end; + struct VasEBoot_gpt_partentry entry; + const VasEBoot_size_t name_len = ARRAY_SIZE (entry.name); + const VasEBoot_size_t label_len = name_len * VasEBoot_MAX_UTF8_PER_UTF16 + 1; + VasEBoot_size_t i; + VasEBoot_uint8_t *end; - if (grub_gpt_device_partentry (device, &entry)) - return grub_errno; + if (VasEBoot_gpt_device_partentry (device, &entry)) + return VasEBoot_errno; - *label = grub_malloc (label_len); + *label = VasEBoot_malloc (label_len); if (!*label) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < name_len; i++) - entry.name[i] = grub_le_to_cpu16 (entry.name[i]); + entry.name[i] = VasEBoot_le_to_cpu16 (entry.name[i]); - end = grub_utf16_to_utf8 ((grub_uint8_t *) *label, entry.name, name_len); + end = VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) *label, entry.name, name_len); *end = '\0'; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_gpt_part_uuid (grub_device_t device, char **uuid) +VasEBoot_err_t +VasEBoot_gpt_part_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_gpt_partentry entry; + struct VasEBoot_gpt_partentry entry; - if (grub_gpt_device_partentry (device, &entry)) - return grub_errno; + if (VasEBoot_gpt_device_partentry (device, &entry)) + return VasEBoot_errno; - *uuid = grub_gpt_guid_to_str (&entry.guid); + *uuid = VasEBoot_gpt_guid_to_str (&entry.guid); if (!*uuid) - return grub_errno; + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_gpt_header * -grub_gpt_get_header (grub_gpt_t gpt) +static struct VasEBoot_gpt_header * +VasEBoot_gpt_get_header (VasEBoot_gpt_t gpt) { - if (gpt->status & GRUB_GPT_PRIMARY_HEADER_VALID) + if (gpt->status & VasEBoot_GPT_PRIMARY_HEADER_VALID) return &gpt->primary; - else if (gpt->status & GRUB_GPT_BACKUP_HEADER_VALID) + else if (gpt->status & VasEBoot_GPT_BACKUP_HEADER_VALID) return &gpt->backup; - grub_error (GRUB_ERR_BUG, "No valid GPT header"); + VasEBoot_error (VasEBoot_ERR_BUG, "No valid GPT header"); return NULL; } -grub_err_t -grub_gpt_disk_uuid (grub_device_t device, char **uuid) +VasEBoot_err_t +VasEBoot_gpt_disk_uuid (VasEBoot_device_t device, char **uuid) { - struct grub_gpt_header *header; + struct VasEBoot_gpt_header *header; - grub_gpt_t gpt = grub_gpt_read (device->disk); + VasEBoot_gpt_t gpt = VasEBoot_gpt_read (device->disk); if (!gpt) goto done; - header = grub_gpt_get_header (gpt); + header = VasEBoot_gpt_get_header (gpt); if (!header) goto done; - *uuid = grub_gpt_guid_to_str (&header->guid); + *uuid = VasEBoot_gpt_guid_to_str (&header->guid); done: - grub_gpt_free (gpt); - return grub_errno; + VasEBoot_gpt_free (gpt); + return VasEBoot_errno; } -static grub_uint64_t -grub_gpt_size_to_sectors (grub_gpt_t gpt, grub_size_t size) +static VasEBoot_uint64_t +VasEBoot_gpt_size_to_sectors (VasEBoot_gpt_t gpt, VasEBoot_size_t size) { unsigned int sector_size; - grub_uint64_t sectors; + VasEBoot_uint64_t sectors; sector_size = 1U << gpt->log_sector_size; sectors = size / sector_size; @@ -159,20 +159,20 @@ grub_gpt_size_to_sectors (grub_gpt_t gpt, grub_size_t size) return sectors; } -/* Copied from grub-core/kern/disk_common.c grub_disk_adjust_range so we can - * avoid attempting to use disk->total_sectors when GRUB won't let us. - * TODO: Why is disk->total_sectors not set to GRUB_DISK_SIZE_UNKNOWN? */ +/* Copied from VasEBoot-core/kern/disk_common.c VasEBoot_disk_adjust_range so we can + * avoid attempting to use disk->total_sectors when VasEBoot won't let us. + * TODO: Why is disk->total_sectors not set to VasEBoot_DISK_SIZE_UNKNOWN? */ static int -grub_gpt_disk_size_valid (grub_disk_t disk) +VasEBoot_gpt_disk_size_valid (VasEBoot_disk_t disk) { - grub_disk_addr_t total_sectors; + VasEBoot_disk_addr_t total_sectors; /* Transform total_sectors to number of 512B blocks. */ - total_sectors = disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + total_sectors = disk->total_sectors << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); /* Some drivers have problems with disks above reasonable. Treat unknown as 1EiB disk. While on it, clamp the size to 1EiB. - Just one condition is enough since GRUB_DISK_UNKNOWN_SIZE << ls is always + Just one condition is enough since VasEBoot_DISK_UNKNOWN_SIZE << ls is always above 9EiB. */ if (total_sectors > (1ULL << 51)) @@ -182,118 +182,118 @@ grub_gpt_disk_size_valid (grub_disk_t disk) } static void -grub_gpt_lecrc32 (grub_uint32_t *crc, const void *data, grub_size_t len) +VasEBoot_gpt_lecrc32 (VasEBoot_uint32_t *crc, const void *data, VasEBoot_size_t len) { - grub_uint32_t crc32_val; + VasEBoot_uint32_t crc32_val; - grub_crypto_hash (GRUB_MD_CRC32, &crc32_val, data, len); + VasEBoot_crypto_hash (VasEBoot_MD_CRC32, &crc32_val, data, len); - /* GRUB_MD_CRC32 always uses big endian, gpt is always little. */ - *crc = grub_swap_bytes32 (crc32_val); + /* VasEBoot_MD_CRC32 always uses big endian, gpt is always little. */ + *crc = VasEBoot_swap_bytes32 (crc32_val); } static void -grub_gpt_header_lecrc32 (grub_uint32_t *crc, struct grub_gpt_header *header) +VasEBoot_gpt_header_lecrc32 (VasEBoot_uint32_t *crc, struct VasEBoot_gpt_header *header) { - grub_uint32_t old, new; + VasEBoot_uint32_t old, new; /* crc32 must be computed with the field cleared. */ old = header->crc32; header->crc32 = 0; - grub_gpt_lecrc32 (&new, header, sizeof (*header)); + VasEBoot_gpt_lecrc32 (&new, header, sizeof (*header)); header->crc32 = old; *crc = new; } /* Make sure the MBR is a protective MBR and not a normal MBR. */ -grub_err_t -grub_gpt_pmbr_check (struct grub_msdos_partition_mbr *mbr) +VasEBoot_err_t +VasEBoot_gpt_pmbr_check (struct VasEBoot_msdos_partition_mbr *mbr) { unsigned int i; if (mbr->signature != - grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid MBR signature"); + VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid MBR signature"); for (i = 0; i < sizeof (mbr->entries); i++) - if (mbr->entries[i].type == GRUB_PC_PARTITION_TYPE_GPT_DISK) - return GRUB_ERR_NONE; + if (mbr->entries[i].type == VasEBoot_PC_PARTITION_TYPE_GPT_DISK) + return VasEBoot_ERR_NONE; - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid protective MBR"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid protective MBR"); } -static grub_uint64_t -grub_gpt_entries_size (struct grub_gpt_header *gpt) +static VasEBoot_uint64_t +VasEBoot_gpt_entries_size (struct VasEBoot_gpt_header *gpt) { - return (grub_uint64_t) grub_le_to_cpu32 (gpt->maxpart) * - (grub_uint64_t) grub_le_to_cpu32 (gpt->partentry_size); + return (VasEBoot_uint64_t) VasEBoot_le_to_cpu32 (gpt->maxpart) * + (VasEBoot_uint64_t) VasEBoot_le_to_cpu32 (gpt->partentry_size); } -static grub_uint64_t -grub_gpt_entries_sectors (struct grub_gpt_header *gpt, +static VasEBoot_uint64_t +VasEBoot_gpt_entries_sectors (struct VasEBoot_gpt_header *gpt, unsigned int log_sector_size) { - grub_uint64_t sector_bytes, entries_bytes; + VasEBoot_uint64_t sector_bytes, entries_bytes; sector_bytes = 1ULL << log_sector_size; - entries_bytes = grub_gpt_entries_size (gpt); - return grub_divmod64(entries_bytes + sector_bytes - 1, sector_bytes, NULL); + entries_bytes = VasEBoot_gpt_entries_size (gpt); + return VasEBoot_divmod64(entries_bytes + sector_bytes - 1, sector_bytes, NULL); } static int -is_pow2 (grub_uint32_t n) +is_pow2 (VasEBoot_uint32_t n) { return (n & (n - 1)) == 0; } -grub_err_t -grub_gpt_header_check (struct grub_gpt_header *gpt, +VasEBoot_err_t +VasEBoot_gpt_header_check (struct VasEBoot_gpt_header *gpt, unsigned int log_sector_size) { - grub_uint32_t crc = 0, size; - grub_uint64_t start, end; + VasEBoot_uint32_t crc = 0, size; + VasEBoot_uint64_t start, end; - if (grub_memcmp (gpt->magic, grub_gpt_magic, sizeof (grub_gpt_magic)) != 0) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid GPT signature"); + if (VasEBoot_memcmp (gpt->magic, VasEBoot_gpt_magic, sizeof (VasEBoot_gpt_magic)) != 0) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid GPT signature"); - if (gpt->version != GRUB_GPT_HEADER_VERSION) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "unknown GPT version"); + if (gpt->version != VasEBoot_GPT_HEADER_VERSION) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "unknown GPT version"); - grub_gpt_header_lecrc32 (&crc, gpt); + VasEBoot_gpt_header_lecrc32 (&crc, gpt); if (gpt->crc32 != crc) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid GPT header crc32"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid GPT header crc32"); /* The header size "must be greater than or equal to 92 and must be less * than or equal to the logical block size." */ - size = grub_le_to_cpu32 (gpt->headersize); + size = VasEBoot_le_to_cpu32 (gpt->headersize); if (size < 92U || size > (1U << log_sector_size)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid GPT header size"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid GPT header size"); /* The partition entry size must be "a value of 128*(2^n) where n is an * integer greater than or equal to zero (e.g., 128, 256, 512, etc.)." */ - size = grub_le_to_cpu32 (gpt->partentry_size); + size = VasEBoot_le_to_cpu32 (gpt->partentry_size); if (size < 128U || size % 128U || !is_pow2 (size / 128U)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid GPT entry size"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid GPT entry size"); /* The minimum entries table size is specified in terms of bytes, * regardless of how large the individual entry size is. */ - if (grub_gpt_entries_size (gpt) < GRUB_GPT_DEFAULT_ENTRIES_SIZE) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid GPT entry table size"); + if (VasEBoot_gpt_entries_size (gpt) < VasEBoot_GPT_DEFAULT_ENTRIES_SIZE) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid GPT entry table size"); /* And of course there better be some space for partitions! */ - start = grub_le_to_cpu64 (gpt->start); - end = grub_le_to_cpu64 (gpt->end); + start = VasEBoot_le_to_cpu64 (gpt->start); + end = VasEBoot_le_to_cpu64 (gpt->end); if (start > end) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid usable sectors"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid usable sectors"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -grub_gpt_headers_equal (grub_gpt_t gpt) +VasEBoot_gpt_headers_equal (VasEBoot_gpt_t gpt) { - /* Assume headers passed grub_gpt_header_check so skip magic and version. + /* Assume headers passed VasEBoot_gpt_header_check so skip magic and version. * Individual fields must be checked instead of just using memcmp because * crc32, header, alternate, and partitions will all normally differ. */ @@ -307,23 +307,23 @@ grub_gpt_headers_equal (grub_gpt_t gpt) gpt->primary.partentry_crc32 != gpt->backup.partentry_crc32) return 0; - return grub_memcmp(&gpt->primary.guid, &gpt->backup.guid, - sizeof(grub_gpt_guid_t)) == 0; + return VasEBoot_memcmp(&gpt->primary.guid, &gpt->backup.guid, + sizeof(VasEBoot_gpt_guid_t)) == 0; } -static grub_err_t -grub_gpt_check_primary (grub_gpt_t gpt) +static VasEBoot_err_t +VasEBoot_gpt_check_primary (VasEBoot_gpt_t gpt) { - grub_uint64_t backup, primary, entries, entries_len, start, end; + VasEBoot_uint64_t backup, primary, entries, entries_len, start, end; - primary = grub_le_to_cpu64 (gpt->primary.header_lba); - backup = grub_le_to_cpu64 (gpt->primary.alternate_lba); - entries = grub_le_to_cpu64 (gpt->primary.partitions); - entries_len = grub_gpt_entries_sectors(&gpt->primary, gpt->log_sector_size); - start = grub_le_to_cpu64 (gpt->primary.start); - end = grub_le_to_cpu64 (gpt->primary.end); + primary = VasEBoot_le_to_cpu64 (gpt->primary.header_lba); + backup = VasEBoot_le_to_cpu64 (gpt->primary.alternate_lba); + entries = VasEBoot_le_to_cpu64 (gpt->primary.partitions); + entries_len = VasEBoot_gpt_entries_sectors(&gpt->primary, gpt->log_sector_size); + start = VasEBoot_le_to_cpu64 (gpt->primary.start); + end = VasEBoot_le_to_cpu64 (gpt->primary.end); - grub_dprintf ("gpt", "Primary GPT layout:\n" + VasEBoot_dprintf ("gpt", "Primary GPT layout:\n" "primary header = 0x%llx backup header = 0x%llx\n" "entries location = 0x%llx length = 0x%llx\n" "first usable = 0x%llx last usable = 0x%llx\n", @@ -334,31 +334,31 @@ grub_gpt_check_primary (grub_gpt_t gpt) (unsigned long long) start, (unsigned long long) end); - if (grub_gpt_header_check (&gpt->primary, gpt->log_sector_size)) - return grub_errno; + if (VasEBoot_gpt_header_check (&gpt->primary, gpt->log_sector_size)) + return VasEBoot_errno; if (primary != 1) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid primary GPT LBA"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid primary GPT LBA"); if (entries <= 1 || entries+entries_len > start) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid entries location"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid entries location"); if (backup <= end) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid backup GPT LBA"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid backup GPT LBA"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_gpt_check_backup (grub_gpt_t gpt) +static VasEBoot_err_t +VasEBoot_gpt_check_backup (VasEBoot_gpt_t gpt) { - grub_uint64_t backup, primary, entries, entries_len, start, end; + VasEBoot_uint64_t backup, primary, entries, entries_len, start, end; - backup = grub_le_to_cpu64 (gpt->backup.header_lba); - primary = grub_le_to_cpu64 (gpt->backup.alternate_lba); - entries = grub_le_to_cpu64 (gpt->backup.partitions); - entries_len = grub_gpt_entries_sectors(&gpt->backup, gpt->log_sector_size); - start = grub_le_to_cpu64 (gpt->backup.start); - end = grub_le_to_cpu64 (gpt->backup.end); + backup = VasEBoot_le_to_cpu64 (gpt->backup.header_lba); + primary = VasEBoot_le_to_cpu64 (gpt->backup.alternate_lba); + entries = VasEBoot_le_to_cpu64 (gpt->backup.partitions); + entries_len = VasEBoot_gpt_entries_sectors(&gpt->backup, gpt->log_sector_size); + start = VasEBoot_le_to_cpu64 (gpt->backup.start); + end = VasEBoot_le_to_cpu64 (gpt->backup.end); - grub_dprintf ("gpt", "Backup GPT layout:\n" + VasEBoot_dprintf ("gpt", "Backup GPT layout:\n" "primary header = 0x%llx backup header = 0x%llx\n" "entries location = 0x%llx length = 0x%llx\n" "first usable = 0x%llx last usable = 0x%llx\n", @@ -369,105 +369,105 @@ grub_gpt_check_backup (grub_gpt_t gpt) (unsigned long long) start, (unsigned long long) end); - if (grub_gpt_header_check (&gpt->backup, gpt->log_sector_size)) - return grub_errno; + if (VasEBoot_gpt_header_check (&gpt->backup, gpt->log_sector_size)) + return VasEBoot_errno; if (primary != 1) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid primary GPT LBA"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid primary GPT LBA"); if (entries <= end || entries+entries_len > backup) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid entries location"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid entries location"); if (backup <= end) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid backup GPT LBA"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid backup GPT LBA"); /* If both primary and backup are valid but differ prefer the primary. */ - if ((gpt->status & GRUB_GPT_PRIMARY_HEADER_VALID) && - !grub_gpt_headers_equal (gpt)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "backup GPT out of sync"); + if ((gpt->status & VasEBoot_GPT_PRIMARY_HEADER_VALID) && + !VasEBoot_gpt_headers_equal (gpt)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "backup GPT out of sync"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_gpt_read_primary (grub_disk_t disk, grub_gpt_t gpt) +static VasEBoot_err_t +VasEBoot_gpt_read_primary (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt) { - grub_disk_addr_t addr; + VasEBoot_disk_addr_t addr; /* TODO: The gpt partmap module searches for the primary header instead * of relying on the disk's sector size. For now trust the disk driver * but eventually this code should match the existing behavior. */ gpt->log_sector_size = disk->log_sector_size; - grub_dprintf ("gpt", "reading primary GPT from sector 0x1\n"); + VasEBoot_dprintf ("gpt", "reading primary GPT from sector 0x1\n"); - addr = grub_gpt_sector_to_addr (gpt, 1); - if (grub_disk_read (disk, addr, 0, sizeof (gpt->primary), &gpt->primary)) - return grub_errno; + addr = VasEBoot_gpt_sector_to_addr (gpt, 1); + if (VasEBoot_disk_read (disk, addr, 0, sizeof (gpt->primary), &gpt->primary)) + return VasEBoot_errno; - if (grub_gpt_check_primary (gpt)) - return grub_errno; + if (VasEBoot_gpt_check_primary (gpt)) + return VasEBoot_errno; - gpt->status |= GRUB_GPT_PRIMARY_HEADER_VALID; + gpt->status |= VasEBoot_GPT_PRIMARY_HEADER_VALID; - if (grub_gpt_read_entries (disk, gpt, &gpt->primary, + if (VasEBoot_gpt_read_entries (disk, gpt, &gpt->primary, &gpt->entries, &gpt->entries_size)) - return grub_errno; + return VasEBoot_errno; - gpt->status |= GRUB_GPT_PRIMARY_ENTRIES_VALID; + gpt->status |= VasEBoot_GPT_PRIMARY_ENTRIES_VALID; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_gpt_read_backup (grub_disk_t disk, grub_gpt_t gpt) +static VasEBoot_err_t +VasEBoot_gpt_read_backup (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt) { void *entries = NULL; - grub_size_t entries_size; - grub_uint64_t sector; - grub_disk_addr_t addr; + VasEBoot_size_t entries_size; + VasEBoot_uint64_t sector; + VasEBoot_disk_addr_t addr; /* Assumes gpt->log_sector_size == disk->log_sector_size */ - if (gpt->status & GRUB_GPT_PRIMARY_HEADER_VALID) + if (gpt->status & VasEBoot_GPT_PRIMARY_HEADER_VALID) { - sector = grub_le_to_cpu64 (gpt->primary.alternate_lba); - if (grub_gpt_disk_size_valid (disk) && sector >= disk->total_sectors) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + sector = VasEBoot_le_to_cpu64 (gpt->primary.alternate_lba); + if (VasEBoot_gpt_disk_size_valid (disk) && sector >= disk->total_sectors) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "backup GPT located at 0x%llx, " "beyond last disk sector at 0x%llx", (unsigned long long) sector, (unsigned long long) disk->total_sectors - 1); } - else if (grub_gpt_disk_size_valid (disk)) + else if (VasEBoot_gpt_disk_size_valid (disk)) sector = disk->total_sectors - 1; else - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "size of disk unknown, cannot locate backup GPT"); - grub_dprintf ("gpt", "reading backup GPT from sector 0x%llx\n", + VasEBoot_dprintf ("gpt", "reading backup GPT from sector 0x%llx\n", (unsigned long long) sector); - addr = grub_gpt_sector_to_addr (gpt, sector); - if (grub_disk_read (disk, addr, 0, sizeof (gpt->backup), &gpt->backup)) - return grub_errno; + addr = VasEBoot_gpt_sector_to_addr (gpt, sector); + if (VasEBoot_disk_read (disk, addr, 0, sizeof (gpt->backup), &gpt->backup)) + return VasEBoot_errno; - if (grub_gpt_check_backup (gpt)) - return grub_errno; + if (VasEBoot_gpt_check_backup (gpt)) + return VasEBoot_errno; /* Ensure the backup header thinks it is located where we found it. */ - if (grub_le_to_cpu64 (gpt->backup.header_lba) != sector) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid backup GPT LBA"); + if (VasEBoot_le_to_cpu64 (gpt->backup.header_lba) != sector) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid backup GPT LBA"); - gpt->status |= GRUB_GPT_BACKUP_HEADER_VALID; + gpt->status |= VasEBoot_GPT_BACKUP_HEADER_VALID; - if (grub_gpt_read_entries (disk, gpt, &gpt->backup, + if (VasEBoot_gpt_read_entries (disk, gpt, &gpt->backup, &entries, &entries_size)) - return grub_errno; + return VasEBoot_errno; - if (gpt->status & GRUB_GPT_PRIMARY_ENTRIES_VALID) + if (gpt->status & VasEBoot_GPT_PRIMARY_ENTRIES_VALID) { if (entries_size != gpt->entries_size || - grub_memcmp (entries, gpt->entries, entries_size) != 0) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "backup GPT out of sync"); + VasEBoot_memcmp (entries, gpt->entries, entries_size) != 0) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "backup GPT out of sync"); - grub_free (entries); + VasEBoot_free (entries); } else { @@ -475,303 +475,303 @@ grub_gpt_read_backup (grub_disk_t disk, grub_gpt_t gpt) gpt->entries_size = entries_size; } - gpt->status |= GRUB_GPT_BACKUP_ENTRIES_VALID; + gpt->status |= VasEBoot_GPT_BACKUP_ENTRIES_VALID; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_gpt_read_entries (grub_disk_t disk, grub_gpt_t gpt, - struct grub_gpt_header *header, +static VasEBoot_err_t +VasEBoot_gpt_read_entries (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt, + struct VasEBoot_gpt_header *header, void **ret_entries, - grub_size_t *ret_entries_size) + VasEBoot_size_t *ret_entries_size) { void *entries = NULL; - grub_uint32_t count, size, crc; - grub_uint64_t sector; - grub_disk_addr_t addr; - grub_size_t entries_size; + VasEBoot_uint32_t count, size, crc; + VasEBoot_uint64_t sector; + VasEBoot_disk_addr_t addr; + VasEBoot_size_t entries_size; - /* Grub doesn't include calloc, hence the manual overflow check. */ - count = grub_le_to_cpu32 (header->maxpart); - size = grub_le_to_cpu32 (header->partentry_size); + /* VasEBoot doesn't include calloc, hence the manual overflow check. */ + count = VasEBoot_le_to_cpu32 (header->maxpart); + size = VasEBoot_le_to_cpu32 (header->partentry_size); entries_size = count *size; if (size && entries_size / size != count) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto fail; } /* Double check that the header was validated properly. */ - if (entries_size < GRUB_GPT_DEFAULT_ENTRIES_SIZE) - return grub_error (GRUB_ERR_BUG, "invalid GPT entries table size"); + if (entries_size < VasEBoot_GPT_DEFAULT_ENTRIES_SIZE) + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid GPT entries table size"); - entries = grub_malloc (entries_size); + entries = VasEBoot_malloc (entries_size); if (!entries) goto fail; - sector = grub_le_to_cpu64 (header->partitions); - grub_dprintf ("gpt", "reading GPT %lu entries from sector 0x%llx\n", + sector = VasEBoot_le_to_cpu64 (header->partitions); + VasEBoot_dprintf ("gpt", "reading GPT %lu entries from sector 0x%llx\n", (unsigned long) count, (unsigned long long) sector); - addr = grub_gpt_sector_to_addr (gpt, sector); - if (grub_disk_read (disk, addr, 0, entries_size, entries)) + addr = VasEBoot_gpt_sector_to_addr (gpt, sector); + if (VasEBoot_disk_read (disk, addr, 0, entries_size, entries)) goto fail; - grub_gpt_lecrc32 (&crc, entries, entries_size); + VasEBoot_gpt_lecrc32 (&crc, entries, entries_size); if (crc != header->partentry_crc32) { - grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid GPT entry crc32"); + VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid GPT entry crc32"); goto fail; } *ret_entries = entries; *ret_entries_size = entries_size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_free (entries); - return grub_errno; + VasEBoot_free (entries); + return VasEBoot_errno; } -grub_gpt_t -grub_gpt_read (grub_disk_t disk) +VasEBoot_gpt_t +VasEBoot_gpt_read (VasEBoot_disk_t disk) { - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; - grub_dprintf ("gpt", "reading GPT from %s\n", disk->name); + VasEBoot_dprintf ("gpt", "reading GPT from %s\n", disk->name); - gpt = grub_zalloc (sizeof (*gpt)); + gpt = VasEBoot_zalloc (sizeof (*gpt)); if (!gpt) goto fail; - if (grub_disk_read (disk, 0, 0, sizeof (gpt->mbr), &gpt->mbr)) + if (VasEBoot_disk_read (disk, 0, 0, sizeof (gpt->mbr), &gpt->mbr)) goto fail; /* Check the MBR but errors aren't reported beyond the status bit. */ - if (grub_gpt_pmbr_check (&gpt->mbr)) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_gpt_pmbr_check (&gpt->mbr)) + VasEBoot_errno = VasEBoot_ERR_NONE; else - gpt->status |= GRUB_GPT_PROTECTIVE_MBR; + gpt->status |= VasEBoot_GPT_PROTECTIVE_MBR; /* If both the primary and backup fail report the primary's error. */ - if (grub_gpt_read_primary (disk, gpt)) + if (VasEBoot_gpt_read_primary (disk, gpt)) { - grub_error_push (); - grub_gpt_read_backup (disk, gpt); - grub_error_pop (); + VasEBoot_error_push (); + VasEBoot_gpt_read_backup (disk, gpt); + VasEBoot_error_pop (); } else - grub_gpt_read_backup (disk, gpt); + VasEBoot_gpt_read_backup (disk, gpt); /* If either succeeded clear any possible error from the other. */ - if (grub_gpt_primary_valid (gpt) || grub_gpt_backup_valid (gpt)) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_gpt_primary_valid (gpt) || VasEBoot_gpt_backup_valid (gpt)) + VasEBoot_errno = VasEBoot_ERR_NONE; else goto fail; return gpt; fail: - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); return NULL; } -struct grub_gpt_partentry * -grub_gpt_get_partentry (grub_gpt_t gpt, grub_uint32_t n) +struct VasEBoot_gpt_partentry * +VasEBoot_gpt_get_partentry (VasEBoot_gpt_t gpt, VasEBoot_uint32_t n) { - struct grub_gpt_header *header; - grub_size_t offset; + struct VasEBoot_gpt_header *header; + VasEBoot_size_t offset; - header = grub_gpt_get_header (gpt); + header = VasEBoot_gpt_get_header (gpt); if (!header) return NULL; - if (n >= grub_le_to_cpu32 (header->maxpart)) + if (n >= VasEBoot_le_to_cpu32 (header->maxpart)) return NULL; - offset = (grub_size_t) grub_le_to_cpu32 (header->partentry_size) * n; - return (struct grub_gpt_partentry *) ((char *) gpt->entries + offset); + offset = (VasEBoot_size_t) VasEBoot_le_to_cpu32 (header->partentry_size) * n; + return (struct VasEBoot_gpt_partentry *) ((char *) gpt->entries + offset); } -grub_err_t -grub_gpt_repair (grub_disk_t disk, grub_gpt_t gpt) +VasEBoot_err_t +VasEBoot_gpt_repair (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt) { /* Skip if there is nothing to do. */ - if (grub_gpt_both_valid (gpt)) - return GRUB_ERR_NONE; + if (VasEBoot_gpt_both_valid (gpt)) + return VasEBoot_ERR_NONE; - grub_dprintf ("gpt", "repairing GPT for %s\n", disk->name); + VasEBoot_dprintf ("gpt", "repairing GPT for %s\n", disk->name); if (disk->log_sector_size != gpt->log_sector_size) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "GPT sector size must match disk sector size"); - if (grub_gpt_primary_valid (gpt)) + if (VasEBoot_gpt_primary_valid (gpt)) { - grub_uint64_t backup_header; + VasEBoot_uint64_t backup_header; - grub_dprintf ("gpt", "primary GPT is valid\n"); + VasEBoot_dprintf ("gpt", "primary GPT is valid\n"); /* Relocate backup to end if disk if the disk has grown. */ - backup_header = grub_le_to_cpu64 (gpt->primary.alternate_lba); - if (grub_gpt_disk_size_valid (disk) && + backup_header = VasEBoot_le_to_cpu64 (gpt->primary.alternate_lba); + if (VasEBoot_gpt_disk_size_valid (disk) && disk->total_sectors - 1 > backup_header) { backup_header = disk->total_sectors - 1; - grub_dprintf ("gpt", "backup GPT header relocated to 0x%llx\n", + VasEBoot_dprintf ("gpt", "backup GPT header relocated to 0x%llx\n", (unsigned long long) backup_header); - gpt->primary.alternate_lba = grub_cpu_to_le64 (backup_header); + gpt->primary.alternate_lba = VasEBoot_cpu_to_le64 (backup_header); } - grub_memcpy (&gpt->backup, &gpt->primary, sizeof (gpt->backup)); + VasEBoot_memcpy (&gpt->backup, &gpt->primary, sizeof (gpt->backup)); gpt->backup.header_lba = gpt->primary.alternate_lba; gpt->backup.alternate_lba = gpt->primary.header_lba; - gpt->backup.partitions = grub_cpu_to_le64 (backup_header - - grub_gpt_size_to_sectors (gpt, gpt->entries_size)); + gpt->backup.partitions = VasEBoot_cpu_to_le64 (backup_header - + VasEBoot_gpt_size_to_sectors (gpt, gpt->entries_size)); } - else if (grub_gpt_backup_valid (gpt)) + else if (VasEBoot_gpt_backup_valid (gpt)) { - grub_dprintf ("gpt", "backup GPT is valid\n"); + VasEBoot_dprintf ("gpt", "backup GPT is valid\n"); - grub_memcpy (&gpt->primary, &gpt->backup, sizeof (gpt->primary)); + VasEBoot_memcpy (&gpt->primary, &gpt->backup, sizeof (gpt->primary)); gpt->primary.header_lba = gpt->backup.alternate_lba; gpt->primary.alternate_lba = gpt->backup.header_lba; - gpt->primary.partitions = grub_cpu_to_le64_compile_time (2); + gpt->primary.partitions = VasEBoot_cpu_to_le64_compile_time (2); } else - return grub_error (GRUB_ERR_BUG, "No valid GPT"); + return VasEBoot_error (VasEBoot_ERR_BUG, "No valid GPT"); - if (grub_gpt_update (gpt)) - return grub_errno; + if (VasEBoot_gpt_update (gpt)) + return VasEBoot_errno; - grub_dprintf ("gpt", "repairing GPT for %s successful\n", disk->name); + VasEBoot_dprintf ("gpt", "repairing GPT for %s successful\n", disk->name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_gpt_update (grub_gpt_t gpt) +VasEBoot_err_t +VasEBoot_gpt_update (VasEBoot_gpt_t gpt) { - grub_uint32_t crc; + VasEBoot_uint32_t crc; /* Clear status bits, require revalidation of everything. */ - gpt->status &= ~(GRUB_GPT_PRIMARY_HEADER_VALID | - GRUB_GPT_PRIMARY_ENTRIES_VALID | - GRUB_GPT_BACKUP_HEADER_VALID | - GRUB_GPT_BACKUP_ENTRIES_VALID); + gpt->status &= ~(VasEBoot_GPT_PRIMARY_HEADER_VALID | + VasEBoot_GPT_PRIMARY_ENTRIES_VALID | + VasEBoot_GPT_BACKUP_HEADER_VALID | + VasEBoot_GPT_BACKUP_ENTRIES_VALID); /* Writing headers larger than our header structure are unsupported. */ gpt->primary.headersize = - grub_cpu_to_le32_compile_time (sizeof (gpt->primary)); + VasEBoot_cpu_to_le32_compile_time (sizeof (gpt->primary)); gpt->backup.headersize = - grub_cpu_to_le32_compile_time (sizeof (gpt->backup)); + VasEBoot_cpu_to_le32_compile_time (sizeof (gpt->backup)); - grub_gpt_lecrc32 (&crc, gpt->entries, gpt->entries_size); + VasEBoot_gpt_lecrc32 (&crc, gpt->entries, gpt->entries_size); gpt->primary.partentry_crc32 = crc; gpt->backup.partentry_crc32 = crc; - grub_gpt_header_lecrc32 (&gpt->primary.crc32, &gpt->primary); - grub_gpt_header_lecrc32 (&gpt->backup.crc32, &gpt->backup); + VasEBoot_gpt_header_lecrc32 (&gpt->primary.crc32, &gpt->primary); + VasEBoot_gpt_header_lecrc32 (&gpt->backup.crc32, &gpt->backup); - if (grub_gpt_check_primary (gpt)) + if (VasEBoot_gpt_check_primary (gpt)) { - grub_error_push (); - return grub_error (GRUB_ERR_BUG, "Generated invalid GPT primary header"); + VasEBoot_error_push (); + return VasEBoot_error (VasEBoot_ERR_BUG, "Generated invalid GPT primary header"); } - gpt->status |= (GRUB_GPT_PRIMARY_HEADER_VALID | - GRUB_GPT_PRIMARY_ENTRIES_VALID); + gpt->status |= (VasEBoot_GPT_PRIMARY_HEADER_VALID | + VasEBoot_GPT_PRIMARY_ENTRIES_VALID); - if (grub_gpt_check_backup (gpt)) + if (VasEBoot_gpt_check_backup (gpt)) { - grub_error_push (); - return grub_error (GRUB_ERR_BUG, "Generated invalid GPT backup header"); + VasEBoot_error_push (); + return VasEBoot_error (VasEBoot_ERR_BUG, "Generated invalid GPT backup header"); } - gpt->status |= (GRUB_GPT_BACKUP_HEADER_VALID | - GRUB_GPT_BACKUP_ENTRIES_VALID); + gpt->status |= (VasEBoot_GPT_BACKUP_HEADER_VALID | + VasEBoot_GPT_BACKUP_ENTRIES_VALID); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_gpt_write_table (grub_disk_t disk, grub_gpt_t gpt, - struct grub_gpt_header *header) +static VasEBoot_err_t +VasEBoot_gpt_write_table (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt, + struct VasEBoot_gpt_header *header) { - grub_disk_addr_t addr; + VasEBoot_disk_addr_t addr; - if (grub_le_to_cpu32 (header->headersize) != sizeof (*header)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (VasEBoot_le_to_cpu32 (header->headersize) != sizeof (*header)) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "Header size is %u, must be %u", - grub_le_to_cpu32 (header->headersize), + VasEBoot_le_to_cpu32 (header->headersize), sizeof (*header)); - addr = grub_gpt_sector_to_addr (gpt, grub_le_to_cpu64 (header->header_lba)); + addr = VasEBoot_gpt_sector_to_addr (gpt, VasEBoot_le_to_cpu64 (header->header_lba)); if (addr == 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "Refusing to write GPT header to address 0x0"); - if (grub_disk_write (disk, addr, 0, sizeof (*header), header)) - return grub_errno; + if (VasEBoot_disk_write (disk, addr, 0, sizeof (*header), header)) + return VasEBoot_errno; - addr = grub_gpt_sector_to_addr (gpt, grub_le_to_cpu64 (header->partitions)); + addr = VasEBoot_gpt_sector_to_addr (gpt, VasEBoot_le_to_cpu64 (header->partitions)); if (addr < 2) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "Refusing to write GPT entries to address 0x%llx", (unsigned long long) addr); - if (grub_disk_write (disk, addr, 0, gpt->entries_size, gpt->entries)) - return grub_errno; + if (VasEBoot_disk_write (disk, addr, 0, gpt->entries_size, gpt->entries)) + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_gpt_write (grub_disk_t disk, grub_gpt_t gpt) +VasEBoot_err_t +VasEBoot_gpt_write (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt) { - grub_uint64_t backup_header; + VasEBoot_uint64_t backup_header; /* TODO: update/repair protective MBRs too. */ - if (!grub_gpt_both_valid (gpt)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "Invalid GPT data"); + if (!VasEBoot_gpt_both_valid (gpt)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "Invalid GPT data"); /* Write the backup GPT first so if writing fails the update is aborted * and the primary is left intact. However if the backup location is * inaccessible we have to just skip and hope for the best, the backup * will need to be repaired in the OS. */ - backup_header = grub_le_to_cpu64 (gpt->backup.header_lba); - if (grub_gpt_disk_size_valid (disk) && + backup_header = VasEBoot_le_to_cpu64 (gpt->backup.header_lba); + if (VasEBoot_gpt_disk_size_valid (disk) && backup_header >= disk->total_sectors) { - grub_printf ("warning: backup GPT located at 0x%llx, " + VasEBoot_printf ("warning: backup GPT located at 0x%llx, " "beyond last disk sector at 0x%llx\n", (unsigned long long) backup_header, (unsigned long long) disk->total_sectors - 1); - grub_printf ("warning: only writing primary GPT, " + VasEBoot_printf ("warning: only writing primary GPT, " "the backup GPT must be repaired from the OS\n"); } else { - grub_dprintf ("gpt", "writing backup GPT to %s\n", disk->name); - if (grub_gpt_write_table (disk, gpt, &gpt->backup)) - return grub_errno; + VasEBoot_dprintf ("gpt", "writing backup GPT to %s\n", disk->name); + if (VasEBoot_gpt_write_table (disk, gpt, &gpt->backup)) + return VasEBoot_errno; } - grub_dprintf ("gpt", "writing primary GPT to %s\n", disk->name); - if (grub_gpt_write_table (disk, gpt, &gpt->primary)) - return grub_errno; + VasEBoot_dprintf ("gpt", "writing primary GPT to %s\n", disk->name); + if (VasEBoot_gpt_write_table (disk, gpt, &gpt->primary)) + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_gpt_free (grub_gpt_t gpt) +VasEBoot_gpt_free (VasEBoot_gpt_t gpt) { if (!gpt) return; - grub_free (gpt->entries); - grub_free (gpt); + VasEBoot_free (gpt->entries); + VasEBoot_free (gpt); } diff --git a/VasEBoot-core/lib/hexdump.c b/VasEBoot-core/lib/hexdump.c index 317635a2b..8faabdd7b 100644 --- a/VasEBoot-core/lib/hexdump.c +++ b/VasEBoot-core/lib/hexdump.c @@ -1,25 +1,25 @@ /* hexdump.c - hexdump function */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include void hexdump (unsigned long bse, char *buf, int len) @@ -31,14 +31,14 @@ hexdump (unsigned long bse, char *buf, int len) { int cnt, i; - pos = grub_snprintf (line, sizeof (line), "%08lx ", bse); + pos = VasEBoot_snprintf (line, sizeof (line), "%08lx ", bse); cnt = 16; if (cnt > len) cnt = len; for (i = 0; i < cnt; i++) { - pos += grub_snprintf (&line[pos], sizeof (line) - pos, + pos += VasEBoot_snprintf (&line[pos], sizeof (line) - pos, "%02x ", (unsigned char) buf[i]); if ((i & 7) == 7) line[pos++] = ' '; @@ -46,7 +46,7 @@ hexdump (unsigned long bse, char *buf, int len) for (; i < 16; i++) { - pos += grub_snprintf (&line[pos], sizeof (line) - pos, " "); + pos += VasEBoot_snprintf (&line[pos], sizeof (line) - pos, " "); if ((i & 7) == 7) line[pos++] = ' '; } @@ -60,22 +60,22 @@ hexdump (unsigned long bse, char *buf, int len) line[pos] = 0; - grub_printf ("%s\n", line); + VasEBoot_printf ("%s\n", line); /* Print only first and last line if more than 3 lines are identical. */ if (len >= 4 * 16 - && ! grub_memcmp (buf, buf + 1 * 16, 16) - && ! grub_memcmp (buf, buf + 2 * 16, 16) - && ! grub_memcmp (buf, buf + 3 * 16, 16)) + && ! VasEBoot_memcmp (buf, buf + 1 * 16, 16) + && ! VasEBoot_memcmp (buf, buf + 2 * 16, 16) + && ! VasEBoot_memcmp (buf, buf + 3 * 16, 16)) { - grub_printf ("*\n"); + VasEBoot_printf ("*\n"); do { bse += 16; buf += 16; len -= 16; } - while (len >= 3 * 16 && ! grub_memcmp (buf, buf + 2 * 16, 16)); + while (len >= 3 * 16 && ! VasEBoot_memcmp (buf, buf + 2 * 16, 16)); } bse += 16; diff --git a/VasEBoot-core/lib/i386/backtrace.c b/VasEBoot-core/lib/i386/backtrace.c index c3e03c727..73475e6fc 100644 --- a/VasEBoot-core/lib/i386/backtrace.c +++ b/VasEBoot-core/lib/i386/backtrace.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define MAX_STACK_FRAME 102400 void -grub_backtrace_pointer (void *ebp) +VasEBoot_backtrace_pointer (void *ebp) { void *ptr, *nptr; unsigned i; @@ -35,17 +35,17 @@ grub_backtrace_pointer (void *ebp) ptr = ebp; while (1) { - grub_printf ("%p: ", ptr); - grub_backtrace_print_address (((void **) ptr)[1]); - grub_printf (" ("); + VasEBoot_printf ("%p: ", ptr); + VasEBoot_backtrace_print_address (((void **) ptr)[1]); + VasEBoot_printf (" ("); for (i = 0; i < 2; i++) - grub_printf ("%p,", ((void **)ptr) [i + 2]); - grub_printf ("%p)\n", ((void **)ptr) [i + 2]); + VasEBoot_printf ("%p,", ((void **)ptr) [i + 2]); + VasEBoot_printf ("%p)\n", ((void **)ptr) [i + 2]); nptr = *(void **)ptr; if (nptr < ptr || (void **) nptr - (void **) ptr > MAX_STACK_FRAME || nptr == ptr) { - grub_printf ("Invalid stack frame at %p (%p)\n", ptr, nptr); + VasEBoot_printf ("Invalid stack frame at %p (%p)\n", ptr, nptr); break; } ptr = nptr; @@ -53,14 +53,14 @@ grub_backtrace_pointer (void *ebp) } void -grub_backtrace (void) +VasEBoot_backtrace (void) { #ifdef __x86_64__ asm volatile ("movq %%rbp, %%rdi\n" - "callq *%%rax": :"a"(grub_backtrace_pointer)); + "callq *%%rax": :"a"(VasEBoot_backtrace_pointer)); #else asm volatile ("movl %%ebp, %%eax\n" - "calll *%%ecx": :"c"(grub_backtrace_pointer)); + "calll *%%ecx": :"c"(VasEBoot_backtrace_pointer)); #endif } diff --git a/VasEBoot-core/lib/i386/halt.c b/VasEBoot-core/lib/i386/halt.c index 9f8405494..6a1b82d23 100644 --- a/VasEBoot-core/lib/i386/halt.c +++ b/VasEBoot-core/lib/i386/halt.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include const char bochs_shutdown[] = "Shutdown"; @@ -40,29 +40,29 @@ stop (void) } static int -grub_shutdown_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, +VasEBoot_shutdown_pci_iter (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data __attribute__ ((unused))) { /* QEMU. */ if (pciid == 0x71138086) { - grub_pci_address_t addr; - addr = grub_pci_make_address (dev, 0x40); - grub_pci_write (addr, 0x7001); - addr = grub_pci_make_address (dev, 0x80); - grub_pci_write (addr, grub_pci_read (addr) | 1); - grub_outw (0x2000, 0x7004); + VasEBoot_pci_address_t addr; + addr = VasEBoot_pci_make_address (dev, 0x40); + VasEBoot_pci_write (addr, 0x7001); + addr = VasEBoot_pci_make_address (dev, 0x80); + VasEBoot_pci_write (addr, VasEBoot_pci_read (addr) | 1); + VasEBoot_outw (0x2000, 0x7004); } return 0; } void -grub_halt (void) +VasEBoot_halt (void) { unsigned int i; -#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) - grub_acpi_halt (); +#if defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_MULTIBOOT) + VasEBoot_acpi_halt (); #endif /* Disable interrupts. */ @@ -70,11 +70,11 @@ grub_halt (void) /* Bochs, QEMU, etc. Removed in newer QEMU releases. */ for (i = 0; i < sizeof (bochs_shutdown) - 1; i++) - grub_outb (bochs_shutdown[i], 0x8900); + VasEBoot_outb (bochs_shutdown[i], 0x8900); - grub_pci_iterate (grub_shutdown_pci_iter, NULL); + VasEBoot_pci_iterate (VasEBoot_shutdown_pci_iter, NULL); - grub_puts_ (N_("GRUB doesn't know how to halt this machine yet!")); + VasEBoot_puts_ (N_("VasEBoot doesn't know how to halt this machine yet!")); /* In order to return we'd have to check what the previous status of IF flag was. But user most likely doesn't want to return anyway ... */ diff --git a/VasEBoot-core/lib/i386/pc/biosnum.c b/VasEBoot-core/lib/i386/pc/biosnum.c index 0f0e743c4..1b455a699 100644 --- a/VasEBoot-core/lib/i386/pc/biosnum.c +++ b/VasEBoot-core/lib/i386/pc/biosnum.c @@ -1,47 +1,47 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include static int -grub_get_root_biosnumber_default (void) +VasEBoot_get_root_biosnumber_default (void) { const char *biosnum; int ret = -1; - grub_device_t dev; + VasEBoot_device_t dev; - biosnum = grub_env_get ("biosnum"); + biosnum = VasEBoot_env_get ("biosnum"); if (biosnum) - return grub_strtoul (biosnum, 0, 0); + return VasEBoot_strtoul (biosnum, 0, 0); - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (dev && dev->disk && dev->disk->dev - && dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) + && dev->disk->dev->id == VasEBoot_DISK_DEVICE_BIOSDISK_ID) ret = (int) dev->disk->id; if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); return ret; } -int (*grub_get_root_biosnumber) (void) = grub_get_root_biosnumber_default; +int (*VasEBoot_get_root_biosnumber) (void) = VasEBoot_get_root_biosnumber_default; diff --git a/VasEBoot-core/lib/i386/pc/vesa_modes_table.c b/VasEBoot-core/lib/i386/pc/vesa_modes_table.c index 6dc4b7d8d..1ef82596d 100644 --- a/VasEBoot-core/lib/i386/pc/vesa_modes_table.c +++ b/VasEBoot-core/lib/i386/pc/vesa_modes_table.c @@ -1,12 +1,12 @@ -#include +#include /* This is the reverse of the table in [linux]/Documentation/fb/vesafb.txt plus a few more modes based on the table in http://en.wikipedia.org/wiki/VESA_BIOS_Extensions */ -struct grub_vesa_mode_table_entry -grub_vesa_mode_table[GRUB_VESA_MODE_TABLE_END - - GRUB_VESA_MODE_TABLE_START + 1] = +struct VasEBoot_vesa_mode_table_entry +VasEBoot_vesa_mode_table[VasEBoot_VESA_MODE_TABLE_END + - VasEBoot_VESA_MODE_TABLE_START + 1] = { { 640, 400, 8 }, /* 0x300 */ { 640, 480, 8 }, /* 0x301 */ diff --git a/VasEBoot-core/lib/i386/random.c b/VasEBoot-core/lib/i386/random.c index cd83d2f8f..6c1a1b77c 100644 --- a/VasEBoot-core/lib/i386/random.c +++ b/VasEBoot-core/lib/i386/random.c @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2016 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static int have_tsc = -1, have_pmtimer = -1; -static grub_port_t pmtimer_port; +static VasEBoot_port_t pmtimer_port; static int detect_pmtimer (void) { - struct grub_acpi_fadt *fadt; - fadt = grub_acpi_find_fadt (); + struct VasEBoot_acpi_fadt *fadt; + fadt = VasEBoot_acpi_find_fadt (); if (!fadt) return 0; pmtimer_port = fadt->pmtimer; @@ -47,8 +47,8 @@ pmtimer_tsc_get_random_bit (void) = 1/40000 s or about 3579545 / 40000 = 90 pmtimer ticks. This gives us rate of 40000 bit/s or 5 kB/s. */ - grub_uint64_t tsc_diff; - tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer_port, 90); + VasEBoot_uint64_t tsc_diff; + tsc_diff = VasEBoot_pmtimer_wait_count_tsc (pmtimer_port, 90); if (tsc_diff == 0) { have_pmtimer = 0; @@ -60,7 +60,7 @@ pmtimer_tsc_get_random_bit (void) static int pmtimer_tsc_get_random_byte (void) { - grub_uint8_t ret = 0; + VasEBoot_uint8_t ret = 0; int i, c; for (i = 0; i < 8; i++) { @@ -73,9 +73,9 @@ pmtimer_tsc_get_random_byte (void) } static int -pmtimer_fill_buffer (void *buffer, grub_size_t sz) +pmtimer_fill_buffer (void *buffer, VasEBoot_size_t sz) { - grub_uint8_t *p = buffer; + VasEBoot_uint8_t *p = buffer; int c; while (sz) { @@ -89,10 +89,10 @@ pmtimer_fill_buffer (void *buffer, grub_size_t sz) } int -grub_crypto_arch_get_random (void *buffer, grub_size_t sz) +VasEBoot_crypto_arch_get_random (void *buffer, VasEBoot_size_t sz) { if (have_tsc == -1) - have_tsc = grub_cpu_is_tsc_supported (); + have_tsc = VasEBoot_cpu_is_tsc_supported (); if (!have_tsc) return 0; if (have_pmtimer == -1) diff --git a/VasEBoot-core/lib/i386/reboot.c b/VasEBoot-core/lib/i386/reboot.c index a234244dc..fc8de9208 100644 --- a/VasEBoot-core/lib/i386/reboot.c +++ b/VasEBoot-core/lib/i386/reboot.c @@ -1,60 +1,60 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - struct grub_relocator *relocator = NULL; - grub_relocator_chunk_t ch; - grub_err_t err; + struct VasEBoot_relocator *relocator = NULL; + VasEBoot_relocator_chunk_t ch; + VasEBoot_err_t err; void *buf; - struct grub_relocator16_state state; - grub_uint16_t segment; + struct VasEBoot_relocator16_state state; + VasEBoot_uint16_t segment; - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) while (1); - err = grub_relocator_alloc_chunk_align (relocator, &ch, 0x1000, 0x1000, - grub_reboot_end - grub_reboot_start, - 16, GRUB_RELOCATOR_PREFERENCE_NONE, + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, 0x1000, 0x1000, + VasEBoot_reboot_end - VasEBoot_reboot_start, + 16, VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) while (1); buf = get_virtual_current_address (ch); - grub_memcpy (buf, grub_reboot_start, grub_reboot_end - grub_reboot_start); + VasEBoot_memcpy (buf, VasEBoot_reboot_start, VasEBoot_reboot_end - VasEBoot_reboot_start); - segment = ((grub_addr_t) get_physical_target_address (ch)) >> 4; + segment = ((VasEBoot_addr_t) get_physical_target_address (ch)) >> 4; state.gs = state.fs = state.es = state.ds = state.ss = segment; state.sp = 0; state.cs = segment; state.ip = 0; state.a20 = 0; - grub_stop_floppy (); + VasEBoot_stop_floppy (); - err = grub_relocator16_boot (relocator, state); + err = VasEBoot_relocator16_boot (relocator, state); while (1); } diff --git a/VasEBoot-core/lib/i386/reboot_trampoline.S b/VasEBoot-core/lib/i386/reboot_trampoline.S index c088cd081..22aeded08 100644 --- a/VasEBoot-core/lib/i386/reboot_trampoline.S +++ b/VasEBoot-core/lib/i386/reboot_trampoline.S @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .p2align 4 -VARIABLE(grub_reboot_start) +VARIABLE(VasEBoot_reboot_start) .code16 /* set 0x472 to 0x0000 for cold boot (0x1234 for warm boot) */ @@ -31,4 +31,4 @@ VARIABLE(grub_reboot_start) ljmp $0xf000, $0xfff0 .code32 -VARIABLE(grub_reboot_end) +VARIABLE(VasEBoot_reboot_end) diff --git a/VasEBoot-core/lib/i386/relocator.c b/VasEBoot-core/lib/i386/relocator.c index 71dd4f0ab..933e36448 100644 --- a/VasEBoot-core/lib/i386/relocator.c +++ b/VasEBoot-core/lib/i386/relocator.c @@ -1,110 +1,110 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -extern grub_uint8_t grub_relocator16_start; -extern grub_uint8_t grub_relocator16_end; -extern grub_uint16_t grub_relocator16_cs; -extern grub_uint16_t grub_relocator16_ip; -extern grub_uint16_t grub_relocator16_ds; -extern grub_uint16_t grub_relocator16_es; -extern grub_uint16_t grub_relocator16_fs; -extern grub_uint16_t grub_relocator16_gs; -extern grub_uint16_t grub_relocator16_ss; -extern grub_uint16_t grub_relocator16_sp; -extern grub_uint32_t grub_relocator16_edx; -extern grub_uint32_t grub_relocator16_ebx; -extern grub_uint32_t grub_relocator16_esi; -extern grub_uint32_t grub_relocator16_ebp; +extern VasEBoot_uint8_t VasEBoot_relocator16_start; +extern VasEBoot_uint8_t VasEBoot_relocator16_end; +extern VasEBoot_uint16_t VasEBoot_relocator16_cs; +extern VasEBoot_uint16_t VasEBoot_relocator16_ip; +extern VasEBoot_uint16_t VasEBoot_relocator16_ds; +extern VasEBoot_uint16_t VasEBoot_relocator16_es; +extern VasEBoot_uint16_t VasEBoot_relocator16_fs; +extern VasEBoot_uint16_t VasEBoot_relocator16_gs; +extern VasEBoot_uint16_t VasEBoot_relocator16_ss; +extern VasEBoot_uint16_t VasEBoot_relocator16_sp; +extern VasEBoot_uint32_t VasEBoot_relocator16_edx; +extern VasEBoot_uint32_t VasEBoot_relocator16_ebx; +extern VasEBoot_uint32_t VasEBoot_relocator16_esi; +extern VasEBoot_uint32_t VasEBoot_relocator16_ebp; -extern grub_uint16_t grub_relocator16_keep_a20_enabled; +extern VasEBoot_uint16_t VasEBoot_relocator16_keep_a20_enabled; -extern grub_uint8_t grub_relocator32_start; -extern grub_uint8_t grub_relocator32_end; -extern grub_uint32_t grub_relocator32_eax; -extern grub_uint32_t grub_relocator32_ebx; -extern grub_uint32_t grub_relocator32_ecx; -extern grub_uint32_t grub_relocator32_edx; -extern grub_uint32_t grub_relocator32_eip; -extern grub_uint32_t grub_relocator32_esp; -extern grub_uint32_t grub_relocator32_ebp; -extern grub_uint32_t grub_relocator32_esi; -extern grub_uint32_t grub_relocator32_edi; +extern VasEBoot_uint8_t VasEBoot_relocator32_start; +extern VasEBoot_uint8_t VasEBoot_relocator32_end; +extern VasEBoot_uint32_t VasEBoot_relocator32_eax; +extern VasEBoot_uint32_t VasEBoot_relocator32_ebx; +extern VasEBoot_uint32_t VasEBoot_relocator32_ecx; +extern VasEBoot_uint32_t VasEBoot_relocator32_edx; +extern VasEBoot_uint32_t VasEBoot_relocator32_eip; +extern VasEBoot_uint32_t VasEBoot_relocator32_esp; +extern VasEBoot_uint32_t VasEBoot_relocator32_ebp; +extern VasEBoot_uint32_t VasEBoot_relocator32_esi; +extern VasEBoot_uint32_t VasEBoot_relocator32_edi; -extern grub_uint8_t grub_relocator64_start; -extern grub_uint8_t grub_relocator64_end; -extern grub_uint64_t grub_relocator64_rax; -extern grub_uint64_t grub_relocator64_rbx; -extern grub_uint64_t grub_relocator64_rcx; -extern grub_uint64_t grub_relocator64_rdx; -extern grub_uint64_t grub_relocator64_rip; -extern grub_uint64_t grub_relocator64_rsp; -extern grub_uint64_t grub_relocator64_rsi; -extern grub_addr_t grub_relocator64_cr3; -extern struct grub_i386_idt grub_relocator16_idt; +extern VasEBoot_uint8_t VasEBoot_relocator64_start; +extern VasEBoot_uint8_t VasEBoot_relocator64_end; +extern VasEBoot_uint64_t VasEBoot_relocator64_rax; +extern VasEBoot_uint64_t VasEBoot_relocator64_rbx; +extern VasEBoot_uint64_t VasEBoot_relocator64_rcx; +extern VasEBoot_uint64_t VasEBoot_relocator64_rdx; +extern VasEBoot_uint64_t VasEBoot_relocator64_rip; +extern VasEBoot_uint64_t VasEBoot_relocator64_rsp; +extern VasEBoot_uint64_t VasEBoot_relocator64_rsi; +extern VasEBoot_addr_t VasEBoot_relocator64_cr3; +extern struct VasEBoot_i386_idt VasEBoot_relocator16_idt; -#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start) +#define RELOCATOR_SIZEOF(x) (&VasEBoot_relocator##x##_end - &VasEBoot_relocator##x##_start) -grub_err_t -grub_relocator32_boot (struct grub_relocator *rel, - struct grub_relocator32_state state, +VasEBoot_err_t +VasEBoot_relocator32_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator32_state state, int avoid_efi_bootservices) { - grub_err_t err; + VasEBoot_err_t err; void *relst; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; /* Specific memory range due to Global Descriptor Table for use by payload that we will store in returned chunk. The address range and preference are based on "THE LINUX/x86 BOOT PROTOCOL" specification. */ - err = grub_relocator_alloc_chunk_align (rel, &ch, 0x1000, + err = VasEBoot_relocator_alloc_chunk_align (rel, &ch, 0x1000, 0x9a000 - RELOCATOR_SIZEOF (32), RELOCATOR_SIZEOF (32), 16, - GRUB_RELOCATOR_PREFERENCE_LOW, + VasEBoot_RELOCATOR_PREFERENCE_LOW, avoid_efi_bootservices); if (err) return err; - grub_relocator32_eax = state.eax; - grub_relocator32_ebx = state.ebx; - grub_relocator32_ecx = state.ecx; - grub_relocator32_edx = state.edx; - grub_relocator32_eip = state.eip; - grub_relocator32_esp = state.esp; - grub_relocator32_ebp = state.ebp; - grub_relocator32_esi = state.esi; - grub_relocator32_edi = state.edi; + VasEBoot_relocator32_eax = state.eax; + VasEBoot_relocator32_ebx = state.ebx; + VasEBoot_relocator32_ecx = state.ecx; + VasEBoot_relocator32_edx = state.edx; + VasEBoot_relocator32_eip = state.eip; + VasEBoot_relocator32_esp = state.esp; + VasEBoot_relocator32_ebp = state.ebp; + VasEBoot_relocator32_esi = state.esi; + VasEBoot_relocator32_edi = state.edi; - grub_memmove (get_virtual_current_address (ch), &grub_relocator32_start, + VasEBoot_memmove (get_virtual_current_address (ch), &VasEBoot_relocator32_start, RELOCATOR_SIZEOF (32)); - err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + err = VasEBoot_relocator_prepare_relocs (rel, get_physical_target_address (ch), &relst, NULL); if (err) return err; @@ -113,56 +113,56 @@ grub_relocator32_boot (struct grub_relocator *rel, ((void (*) (void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_relocator16_boot (struct grub_relocator *rel, - struct grub_relocator16_state state) +VasEBoot_err_t +VasEBoot_relocator16_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator16_state state) { - grub_err_t err; + VasEBoot_err_t err; void *relst; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; /* Put it higher than the byte it checks for A20 check. */ - err = grub_relocator_alloc_chunk_align (rel, &ch, 0x8010, + err = VasEBoot_relocator_alloc_chunk_align (rel, &ch, 0x8010, 0xa0000 - RELOCATOR_SIZEOF (16) - - GRUB_RELOCATOR16_STACK_SIZE, + - VasEBoot_RELOCATOR16_STACK_SIZE, RELOCATOR_SIZEOF (16) - + GRUB_RELOCATOR16_STACK_SIZE, 16, - GRUB_RELOCATOR_PREFERENCE_NONE, + + VasEBoot_RELOCATOR16_STACK_SIZE, 16, + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; - grub_relocator16_cs = state.cs; - grub_relocator16_ip = state.ip; + VasEBoot_relocator16_cs = state.cs; + VasEBoot_relocator16_ip = state.ip; - grub_relocator16_ds = state.ds; - grub_relocator16_es = state.es; - grub_relocator16_fs = state.fs; - grub_relocator16_gs = state.gs; + VasEBoot_relocator16_ds = state.ds; + VasEBoot_relocator16_es = state.es; + VasEBoot_relocator16_fs = state.fs; + VasEBoot_relocator16_gs = state.gs; - grub_relocator16_ss = state.ss; - grub_relocator16_sp = state.sp; + VasEBoot_relocator16_ss = state.ss; + VasEBoot_relocator16_sp = state.sp; - grub_relocator16_ebp = state.ebp; - grub_relocator16_ebx = state.ebx; - grub_relocator16_edx = state.edx; - grub_relocator16_esi = state.esi; -#ifdef GRUB_MACHINE_PCBIOS - grub_relocator16_idt = *grub_realidt; + VasEBoot_relocator16_ebp = state.ebp; + VasEBoot_relocator16_ebx = state.ebx; + VasEBoot_relocator16_edx = state.edx; + VasEBoot_relocator16_esi = state.esi; +#ifdef VasEBoot_MACHINE_PCBIOS + VasEBoot_relocator16_idt = *VasEBoot_realidt; #else - grub_relocator16_idt.base = 0; - grub_relocator16_idt.limit = 0; + VasEBoot_relocator16_idt.base = 0; + VasEBoot_relocator16_idt.limit = 0; #endif - grub_relocator16_keep_a20_enabled = state.a20; + VasEBoot_relocator16_keep_a20_enabled = state.a20; - grub_memmove (get_virtual_current_address (ch), &grub_relocator16_start, + VasEBoot_memmove (get_virtual_current_address (ch), &VasEBoot_relocator16_start, RELOCATOR_SIZEOF (16)); - err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + err = VasEBoot_relocator_prepare_relocs (rel, get_physical_target_address (ch), &relst, NULL); if (err) return err; @@ -171,39 +171,39 @@ grub_relocator16_boot (struct grub_relocator *rel, ((void (*) (void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_relocator64_boot (struct grub_relocator *rel, - struct grub_relocator64_state state, - grub_addr_t min_addr, grub_addr_t max_addr) +VasEBoot_err_t +VasEBoot_relocator64_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator64_state state, + VasEBoot_addr_t min_addr, VasEBoot_addr_t max_addr) { - grub_err_t err; + VasEBoot_err_t err; void *relst; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (rel, &ch, min_addr, + err = VasEBoot_relocator_alloc_chunk_align (rel, &ch, min_addr, max_addr - RELOCATOR_SIZEOF (64), RELOCATOR_SIZEOF (64), 16, - GRUB_RELOCATOR_PREFERENCE_NONE, + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; - grub_relocator64_rax = state.rax; - grub_relocator64_rbx = state.rbx; - grub_relocator64_rcx = state.rcx; - grub_relocator64_rdx = state.rdx; - grub_relocator64_rip = state.rip; - grub_relocator64_rsp = state.rsp; - grub_relocator64_rsi = state.rsi; - grub_relocator64_cr3 = state.cr3; + VasEBoot_relocator64_rax = state.rax; + VasEBoot_relocator64_rbx = state.rbx; + VasEBoot_relocator64_rcx = state.rcx; + VasEBoot_relocator64_rdx = state.rdx; + VasEBoot_relocator64_rip = state.rip; + VasEBoot_relocator64_rsp = state.rsp; + VasEBoot_relocator64_rsi = state.rsi; + VasEBoot_relocator64_cr3 = state.cr3; - grub_memmove (get_virtual_current_address (ch), &grub_relocator64_start, + VasEBoot_memmove (get_virtual_current_address (ch), &VasEBoot_relocator64_start, RELOCATOR_SIZEOF (64)); - err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + err = VasEBoot_relocator_prepare_relocs (rel, get_physical_target_address (ch), &relst, NULL); if (err) return err; @@ -212,5 +212,5 @@ grub_relocator64_boot (struct grub_relocator *rel, ((void (*) (void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/i386/relocator16.S b/VasEBoot-core/lib/i386/relocator16.S index c8d6f86d8..652ec2426 100644 --- a/VasEBoot-core/lib/i386/relocator16.S +++ b/VasEBoot-core/lib/i386/relocator16.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* The code segment of the protected mode. */ @@ -26,13 +26,13 @@ #define PSEUDO_REAL_DSEG 0x20 -#include +#include #include "relocator_common.S" .p2align 4 /* force 16-byte alignment */ -VARIABLE(grub_relocator16_start) +VARIABLE(VasEBoot_relocator16_start) PREAMBLE #ifdef __APPLE__ @@ -63,15 +63,15 @@ VARIABLE(grub_relocator16_start) #ifdef __x86_64__ /* Disable amd64. */ - movl $GRUB_MEMORY_CPU_AMD64_MSR, %ecx + movl $VasEBoot_MEMORY_CPU_AMD64_MSR, %ecx rdmsr - andl $(~GRUB_MEMORY_CPU_AMD64_MSR_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_AMD64_MSR_ON), %eax wrmsr #endif /* Turn off PAE. */ movl %cr4, %eax - andl $(~GRUB_MEMORY_CPU_CR4_PAE_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_CR4_PAE_ON), %eax movl %eax, %cr4 /* Update other registers. */ @@ -96,7 +96,7 @@ VARIABLE(grub_relocator16_start) #else movw %ax, (LOCAL (segment) - LOCAL (base)) (%esi, 1) - lidt (EXT_C(grub_relocator16_idt) - LOCAL (base)) (%esi, 1) + lidt (EXT_C(VasEBoot_relocator16_idt) - LOCAL (base)) (%esi, 1) /* jump to a 16 bit segment */ ljmp $PSEUDO_REAL_CSEG, $(LOCAL (cont2) - LOCAL(base)) @@ -106,7 +106,7 @@ LOCAL(cont2): /* clear the PE bit of CR0 */ movl %cr0, %eax - andl $(~GRUB_MEMORY_CPU_CR0_PE_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_CR0_PE_ON), %eax movl %eax, %cr0 /* flush prefetch queue, reload %cs */ @@ -125,7 +125,7 @@ LOCAL(cont3): /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_keep_a20_enabled) +VARIABLE(VasEBoot_relocator16_keep_a20_enabled) .word 0 test %ax, %ax @@ -139,7 +139,7 @@ VARIABLE(grub_relocator16_keep_a20_enabled) #else leaw LOCAL(relocator16_end) - LOCAL(base), %sp #endif - addw $GRUB_RELOCATOR16_STACK_SIZE, %sp + addw $VasEBoot_RELOCATOR16_STACK_SIZE, %sp /* second, try a BIOS call */ movw $0x2400, %ax @@ -209,59 +209,59 @@ LOCAL(gate_a20_done): */ /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_ds) +VARIABLE(VasEBoot_relocator16_ds) .word 0 movw %ax, %ds /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_es) +VARIABLE(VasEBoot_relocator16_es) .word 0 movw %ax, %es /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_fs) +VARIABLE(VasEBoot_relocator16_fs) .word 0 movw %ax, %fs /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_gs) +VARIABLE(VasEBoot_relocator16_gs) .word 0 movw %ax, %gs /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_ss) +VARIABLE(VasEBoot_relocator16_ss) .word 0 movw %ax, %ss /* movw imm16, %ax. */ .byte 0xb8 -VARIABLE(grub_relocator16_sp) +VARIABLE(VasEBoot_relocator16_sp) .word 0 movzwl %ax, %esp /* movw imm32, %eax. */ .byte 0x66, 0xb8 -VARIABLE(grub_relocator16_esi) +VARIABLE(VasEBoot_relocator16_esi) .long 0 movl %eax, %esi /* movw imm32, %edx. */ .byte 0x66, 0xba -VARIABLE(grub_relocator16_edx) +VARIABLE(VasEBoot_relocator16_edx) .long 0 /* movw imm32, %ebx. */ .byte 0x66, 0xbb -VARIABLE(grub_relocator16_ebx) +VARIABLE(VasEBoot_relocator16_ebx) .long 0 /* movl imm32, %ebp. */ .byte 0x66, 0xbd -VARIABLE(grub_relocator16_ebp) +VARIABLE(VasEBoot_relocator16_ebp) .long 0 /* Cleared direction flag is of no problem with any current @@ -270,9 +270,9 @@ VARIABLE(grub_relocator16_ebp) /* ljmp */ .byte 0xea -VARIABLE(grub_relocator16_ip) +VARIABLE(VasEBoot_relocator16_ip) .word 0 -VARIABLE(grub_relocator16_cs) +VARIABLE(VasEBoot_relocator16_cs) .word 0 .code32 @@ -320,9 +320,9 @@ LOCAL(gdt_end): #ifdef __APPLE__ LOCAL(relocator16_idt): #endif -VARIABLE(grub_relocator16_idt) +VARIABLE(VasEBoot_relocator16_idt) .word 0 .long 0 LOCAL(relocator16_end): -VARIABLE(grub_relocator16_end) +VARIABLE(VasEBoot_relocator16_end) .byte 0 diff --git a/VasEBoot-core/lib/i386/relocator32.S b/VasEBoot-core/lib/i386/relocator32.S index 09ce56ad0..ec79f3df6 100644 --- a/VasEBoot-core/lib/i386/relocator32.S +++ b/VasEBoot-core/lib/i386/relocator32.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* The code segment of the protected mode. */ @@ -26,7 +26,7 @@ .p2align 4 /* force 16-byte alignment */ -VARIABLE(grub_relocator32_start) +VARIABLE(VasEBoot_relocator32_start) PREAMBLE RELOAD_GDT @@ -43,15 +43,15 @@ VARIABLE(grub_relocator32_start) #ifdef __x86_64__ /* Disable amd64. */ - movl $GRUB_MEMORY_CPU_AMD64_MSR, %ecx + movl $VasEBoot_MEMORY_CPU_AMD64_MSR, %ecx rdmsr - andl $(~GRUB_MEMORY_CPU_AMD64_MSR_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_AMD64_MSR_ON), %eax wrmsr #endif /* Turn off PAE. */ movl %cr4, %eax - andl $(~GRUB_MEMORY_CPU_CR4_PAE_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_CR4_PAE_ON), %eax movl %eax, %cr4 jmp LOCAL(cont2) @@ -60,50 +60,50 @@ LOCAL(cont2): /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator32_esp) +VARIABLE(VasEBoot_relocator32_esp) .long 0 movl %eax, %esp /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator32_ebp) +VARIABLE(VasEBoot_relocator32_ebp) .long 0 movl %eax, %ebp /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator32_esi) +VARIABLE(VasEBoot_relocator32_esi) .long 0 movl %eax, %esi /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator32_edi) +VARIABLE(VasEBoot_relocator32_edi) .long 0 movl %eax, %edi /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator32_eax) +VARIABLE(VasEBoot_relocator32_eax) .long 0 /* mov imm32, %ebx */ .byte 0xbb -VARIABLE(grub_relocator32_ebx) +VARIABLE(VasEBoot_relocator32_ebx) .long 0 /* mov imm32, %ecx */ .byte 0xb9 -VARIABLE(grub_relocator32_ecx) +VARIABLE(VasEBoot_relocator32_ecx) .long 0 /* mov imm32, %edx */ .byte 0xba -VARIABLE(grub_relocator32_edx) +VARIABLE(VasEBoot_relocator32_edx) .long 0 /* Cleared direction flag is of no problem with any current @@ -111,7 +111,7 @@ VARIABLE(grub_relocator32_edx) cld .byte 0xea -VARIABLE(grub_relocator32_eip) +VARIABLE(VasEBoot_relocator32_eip) .long 0 .word CODE_SEGMENT @@ -131,4 +131,4 @@ LOCAL(gdt): .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 LOCAL(gdt_end): -VARIABLE(grub_relocator32_end) +VARIABLE(VasEBoot_relocator32_end) diff --git a/VasEBoot-core/lib/i386/relocator64.S b/VasEBoot-core/lib/i386/relocator64.S index 148f38adb..a14f5717b 100644 --- a/VasEBoot-core/lib/i386/relocator64.S +++ b/VasEBoot-core/lib/i386/relocator64.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define CODE32_SEGMENT 0x18 @@ -26,31 +26,31 @@ .p2align 4 /* force 16-byte alignment */ -VARIABLE(grub_relocator64_start) +VARIABLE(VasEBoot_relocator64_start) PREAMBLE #ifndef __x86_64__ DISABLE_PAGING /* Turn on PAE. */ movl %cr4, %eax - orl $(GRUB_MEMORY_CPU_CR4_PAE_ON | GRUB_MEMORY_CPU_CR4_PSE_ON), %eax + orl $(VasEBoot_MEMORY_CPU_CR4_PAE_ON | VasEBoot_MEMORY_CPU_CR4_PSE_ON), %eax movl %eax, %cr4 /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator64_cr3) +VARIABLE(VasEBoot_relocator64_cr3) .long 0 movl %eax, %cr3 /* Turn on amd64. */ - movl $GRUB_MEMORY_CPU_AMD64_MSR, %ecx + movl $VasEBoot_MEMORY_CPU_AMD64_MSR, %ecx rdmsr - orl $GRUB_MEMORY_CPU_AMD64_MSR_ON, %eax + orl $VasEBoot_MEMORY_CPU_AMD64_MSR_ON, %eax wrmsr /* Enable paging. */ movl %cr0, %eax - orl $GRUB_MEMORY_CPU_CR0_PAGING_ON, %eax + orl $VasEBoot_MEMORY_CPU_CR0_PAGING_ON, %eax movl %eax, %cr0 RELOAD_GDT @@ -58,7 +58,7 @@ VARIABLE(grub_relocator64_cr3) /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator64_cr3) +VARIABLE(VasEBoot_relocator64_cr3) .quad 0 movq %rax, %cr3 #endif @@ -68,22 +68,22 @@ VARIABLE(grub_relocator64_cr3) /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator64_rsp) +VARIABLE(VasEBoot_relocator64_rsp) .quad 0 movq %rax, %rsp -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI jmp LOCAL(skip_efi_stack_align) /* - * Here is grub_relocator64_efi_start() entry point. Most of the - * code below is shared between grub_relocator64_efi_start() - * and grub_relocator64_start(). + * Here is VasEBoot_relocator64_efi_start() entry point. Most of the + * code below is shared between VasEBoot_relocator64_efi_start() + * and VasEBoot_relocator64_start(). * * Think twice before changing anything there!!! */ -VARIABLE(grub_relocator64_efi_start) +VARIABLE(VasEBoot_relocator64_efi_start) /* Align the stack as UEFI spec requires. */ andq $~15, %rsp @@ -92,7 +92,7 @@ LOCAL(skip_efi_stack_align): /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator64_rsi) +VARIABLE(VasEBoot_relocator64_rsi) .quad 0 movq %rax, %rsi @@ -100,25 +100,25 @@ VARIABLE(grub_relocator64_rsi) /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator64_rax) +VARIABLE(VasEBoot_relocator64_rax) .quad 0 /* mov imm64, %rbx */ .byte 0x48 .byte 0xbb -VARIABLE(grub_relocator64_rbx) +VARIABLE(VasEBoot_relocator64_rbx) .quad 0 /* mov imm64, %rcx */ .byte 0x48 .byte 0xb9 -VARIABLE(grub_relocator64_rcx) +VARIABLE(VasEBoot_relocator64_rcx) .quad 0 /* mov imm64, %rdx */ .byte 0x48 .byte 0xba -VARIABLE(grub_relocator64_rdx) +VARIABLE(VasEBoot_relocator64_rdx) .quad 0 /* Cleared direction flag is of no problem with any current @@ -133,12 +133,12 @@ VARIABLE(grub_relocator64_rdx) #endif LOCAL(jump_addr): -VARIABLE(grub_relocator64_rip) +VARIABLE(VasEBoot_relocator64_rip) .quad 0 -#ifdef GRUB_MACHINE_EFI - /* Here grub_relocator64_efi_start() ends. Ufff... */ -VARIABLE(grub_relocator64_efi_end) +#ifdef VasEBoot_MACHINE_EFI + /* Here VasEBoot_relocator64_efi_start() ends. Ufff... */ +VARIABLE(VasEBoot_relocator64_efi_end) #endif #ifndef __x86_64__ @@ -183,4 +183,4 @@ LOCAL(gdt): LOCAL(gdt_end): #endif -VARIABLE(grub_relocator64_end) +VARIABLE(VasEBoot_relocator64_end) diff --git a/VasEBoot-core/lib/i386/relocator_asm.S b/VasEBoot-core/lib/i386/relocator_asm.S index f273586fe..ea358b2ca 100644 --- a/VasEBoot-core/lib/i386/relocator_asm.S +++ b/VasEBoot-core/lib/i386/relocator_asm.S @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .p2align 2 -VARIABLE(grub_relocator_backward_start) +VARIABLE(VasEBoot_relocator_backward_start) /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_backward_dest) +VARIABLE(VasEBoot_relocator_backward_dest) .long 0 movl %eax, %edi /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_backward_src) +VARIABLE(VasEBoot_relocator_backward_src) .long 0 movl %eax, %esi /* mov imm32, %ecx */ .byte 0xb9 -VARIABLE(grub_relocator_backward_chunk_size) +VARIABLE(VasEBoot_relocator_backward_chunk_size) .long 0 add %ecx, %esi @@ -52,29 +52,29 @@ VARIABLE(grub_relocator_backward_chunk_size) rep movsb -VARIABLE(grub_relocator_backward_end) +VARIABLE(VasEBoot_relocator_backward_end) -VARIABLE(grub_relocator_forward_start) +VARIABLE(VasEBoot_relocator_forward_start) /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_forward_dest) +VARIABLE(VasEBoot_relocator_forward_dest) .long 0 movl %eax, %edi /* mov imm32, %rax */ .byte 0xb8 -VARIABLE(grub_relocator_forward_src) +VARIABLE(VasEBoot_relocator_forward_src) .long 0 movl %eax, %esi /* mov imm32, %ecx */ .byte 0xb9 -VARIABLE(grub_relocator_forward_chunk_size) +VARIABLE(VasEBoot_relocator_forward_chunk_size) .long 0 /* Forward copy. */ cld rep movsb -VARIABLE(grub_relocator_forward_end) +VARIABLE(VasEBoot_relocator_forward_end) diff --git a/VasEBoot-core/lib/i386/relocator_common.S b/VasEBoot-core/lib/i386/relocator_common.S index 03f427a03..080912660 100644 --- a/VasEBoot-core/lib/i386/relocator_common.S +++ b/VasEBoot-core/lib/i386/relocator_common.S @@ -1,24 +1,24 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include #ifdef __x86_64__ #define RAX %rax @@ -29,11 +29,11 @@ #endif .macro DISABLE_PAGING -#ifdef GRUB_MACHINE_IEEE1275 +#ifdef VasEBoot_MACHINE_IEEE1275 #endif movl %cr0, %eax - andl $(~GRUB_MEMORY_CPU_CR0_PAGING_ON), %eax + andl $(~VasEBoot_MEMORY_CPU_CR0_PAGING_ON), %eax movl %eax, %cr0 .endm diff --git a/VasEBoot-core/lib/i386/relocator_common_c.c b/VasEBoot-core/lib/i386/relocator_common_c.c index 7be609b73..5a38bdd12 100644 --- a/VasEBoot-core/lib/i386/relocator_common_c.c +++ b/VasEBoot-core/lib/i386/relocator_common_c.c @@ -1,109 +1,109 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009-2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include -extern grub_uint8_t grub_relocator_forward_start; -extern grub_uint8_t grub_relocator_forward_end; -extern grub_uint8_t grub_relocator_backward_start; -extern grub_uint8_t grub_relocator_backward_end; +extern VasEBoot_uint8_t VasEBoot_relocator_forward_start; +extern VasEBoot_uint8_t VasEBoot_relocator_forward_end; +extern VasEBoot_uint8_t VasEBoot_relocator_backward_start; +extern VasEBoot_uint8_t VasEBoot_relocator_backward_end; -extern void *grub_relocator_backward_dest; -extern void *grub_relocator_backward_src; -extern grub_size_t grub_relocator_backward_chunk_size; +extern void *VasEBoot_relocator_backward_dest; +extern void *VasEBoot_relocator_backward_src; +extern VasEBoot_size_t VasEBoot_relocator_backward_chunk_size; -extern void *grub_relocator_forward_dest; -extern void *grub_relocator_forward_src; -extern grub_size_t grub_relocator_forward_chunk_size; +extern void *VasEBoot_relocator_forward_dest; +extern void *VasEBoot_relocator_forward_src; +extern VasEBoot_size_t VasEBoot_relocator_forward_chunk_size; -#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start) +#define RELOCATOR_SIZEOF(x) (&VasEBoot_relocator##x##_end - &VasEBoot_relocator##x##_start) -grub_size_t grub_relocator_align = 1; -grub_size_t grub_relocator_forward_size; -grub_size_t grub_relocator_backward_size; +VasEBoot_size_t VasEBoot_relocator_align = 1; +VasEBoot_size_t VasEBoot_relocator_forward_size; +VasEBoot_size_t VasEBoot_relocator_backward_size; #ifdef __x86_64__ -grub_size_t grub_relocator_jumper_size = 12; +VasEBoot_size_t VasEBoot_relocator_jumper_size = 12; #else -grub_size_t grub_relocator_jumper_size = 7; +VasEBoot_size_t VasEBoot_relocator_jumper_size = 7; #endif void -grub_cpu_relocator_init (void) +VasEBoot_cpu_relocator_init (void) { - grub_relocator_forward_size = RELOCATOR_SIZEOF (_forward); - grub_relocator_backward_size = RELOCATOR_SIZEOF (_backward); + VasEBoot_relocator_forward_size = RELOCATOR_SIZEOF (_forward); + VasEBoot_relocator_backward_size = RELOCATOR_SIZEOF (_backward); } void -grub_cpu_relocator_jumper (void *rels, grub_addr_t addr) +VasEBoot_cpu_relocator_jumper (void *rels, VasEBoot_addr_t addr) { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; ptr = rels; #ifdef __x86_64__ /* movq imm64, %rax (for relocator) */ - *(grub_uint8_t *) ptr = 0x48; + *(VasEBoot_uint8_t *) ptr = 0x48; ptr++; - *(grub_uint8_t *) ptr = 0xb8; + *(VasEBoot_uint8_t *) ptr = 0xb8; ptr++; - *(grub_uint64_t *) ptr = addr; - ptr += sizeof (grub_uint64_t); + *(VasEBoot_uint64_t *) ptr = addr; + ptr += sizeof (VasEBoot_uint64_t); #else /* movl imm32, %eax (for relocator) */ - *(grub_uint8_t *) ptr = 0xb8; + *(VasEBoot_uint8_t *) ptr = 0xb8; ptr++; - *(grub_uint32_t *) ptr = addr; - ptr += sizeof (grub_uint32_t); + *(VasEBoot_uint32_t *) ptr = addr; + ptr += sizeof (VasEBoot_uint32_t); #endif /* jmp $eax/$rax */ - *(grub_uint8_t *) ptr = 0xff; + *(VasEBoot_uint8_t *) ptr = 0xff; ptr++; - *(grub_uint8_t *) ptr = 0xe0; + *(VasEBoot_uint8_t *) ptr = 0xe0; ptr++; } void -grub_cpu_relocator_backward (void *ptr, void *src, void *dest, - grub_size_t size) +VasEBoot_cpu_relocator_backward (void *ptr, void *src, void *dest, + VasEBoot_size_t size) { - grub_relocator_backward_dest = dest; - grub_relocator_backward_src = src; - grub_relocator_backward_chunk_size = size; + VasEBoot_relocator_backward_dest = dest; + VasEBoot_relocator_backward_src = src; + VasEBoot_relocator_backward_chunk_size = size; - grub_memmove (ptr, - &grub_relocator_backward_start, RELOCATOR_SIZEOF (_backward)); + VasEBoot_memmove (ptr, + &VasEBoot_relocator_backward_start, RELOCATOR_SIZEOF (_backward)); } void -grub_cpu_relocator_forward (void *ptr, void *src, void *dest, - grub_size_t size) +VasEBoot_cpu_relocator_forward (void *ptr, void *src, void *dest, + VasEBoot_size_t size) { - grub_relocator_forward_dest = dest; - grub_relocator_forward_src = src; - grub_relocator_forward_chunk_size = size; + VasEBoot_relocator_forward_dest = dest; + VasEBoot_relocator_forward_src = src; + VasEBoot_relocator_forward_chunk_size = size; - grub_memmove (ptr, - &grub_relocator_forward_start, RELOCATOR_SIZEOF (_forward)); + VasEBoot_memmove (ptr, + &VasEBoot_relocator_forward_start, RELOCATOR_SIZEOF (_forward)); } diff --git a/VasEBoot-core/lib/i386/setjmp.S b/VasEBoot-core/lib/i386/setjmp.S index 0b0740f11..0bfbffb08 100644 --- a/VasEBoot-core/lib/i386/setjmp.S +++ b/VasEBoot-core/lib/i386/setjmp.S @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .text /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) +FUNCTION(VasEBoot_setjmp) movl %ebx, 0(%eax) /* EBX */ movl %esi, 4(%eax) /* ESI */ movl %edi, 8(%eax) /* EDI */ @@ -41,9 +41,9 @@ FUNCTION(grub_setjmp) /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) +FUNCTION(VasEBoot_longjmp) movl 0(%eax), %ebx movl 4(%eax), %esi movl 8(%eax), %edi diff --git a/VasEBoot-core/lib/i386/xen/relocator.S b/VasEBoot-core/lib/i386/xen/relocator.S index 96e51b59a..103cd4ec3 100644 --- a/VasEBoot-core/lib/i386/xen/relocator.S +++ b/VasEBoot-core/lib/i386/xen/relocator.S @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include .p2align 4 /* force 16-byte alignment */ -VARIABLE(grub_relocator_xen_remap_start) +VARIABLE(VasEBoot_relocator_xen_remap_start) LOCAL(base): /* Remap the remapper to it's new address. */ /* mov imm32, %ebx - %ebx: new virtual address of remapper */ .byte 0xbb -VARIABLE(grub_relocator_xen_remapper_virt) +VARIABLE(VasEBoot_relocator_xen_remapper_virt) .long 0 /* mov imm32, %ecx - %ecx: low part of page table entry */ .byte 0xb9 -VARIABLE(grub_relocator_xen_remapper_map) +VARIABLE(VasEBoot_relocator_xen_remapper_map) .long 0 /* mov imm32, %edx - %edx: high part of page table entry */ .byte 0xba -VARIABLE(grub_relocator_xen_remapper_map_high) +VARIABLE(VasEBoot_relocator_xen_remapper_map_high) .long 0 movl %ebx, %ebp /* %ebx is clobbered by hypercall */ @@ -56,22 +56,22 @@ LOCAL(cont): /* Modify mappings of new page tables to be read-only. */ /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_paging_areas_addr) +VARIABLE(VasEBoot_relocator_xen_paging_areas_addr) .long 0 movl %eax, %ebx 1: movl 0(%ebx), %ebp /* Get start pfn of the current area */ - movl GRUB_TARGET_SIZEOF_LONG(%ebx), %ecx /* Get # of pg tables */ + movl VasEBoot_TARGET_SIZEOF_LONG(%ebx), %ecx /* Get # of pg tables */ testl %ecx, %ecx /* 0 -> last area reached */ jz 3f - addl $(2 * GRUB_TARGET_SIZEOF_LONG), %ebx + addl $(2 * VasEBoot_TARGET_SIZEOF_LONG), %ebx movl %ebx, %esp /* Save current area pointer */ 2: movl %ecx, %edi /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_mfn_list) +VARIABLE(VasEBoot_relocator_xen_mfn_list) .long 0 movl 0(%eax, %ebp, 4), %ecx /* mfn */ movl %ebp, %ebx @@ -79,7 +79,7 @@ VARIABLE(grub_relocator_xen_mfn_list) movl %ecx, %edx shll $PAGE_SHIFT, %ecx /* prepare pte low part */ shrl $(32 - PAGE_SHIFT), %edx /* pte high part */ - orl $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %ecx /* pte low */ + orl $(VasEBoot_PAGE_PRESENT | VasEBoot_PAGE_USER), %ecx /* pte low */ movl $UVMF_INVLPG, %esi movl $__HYPERVISOR_update_va_mapping, %eax int $0x82 /* parameters: eax, ebx, ecx, edx, esi */ @@ -96,7 +96,7 @@ VARIABLE(grub_relocator_xen_mfn_list) /* Switch page tables: pin new L3 pt, load cr3, unpin old L3. */ /* mov imm32, %ebx */ .byte 0xbb -VARIABLE(grub_relocator_xen_mmu_op_addr) +VARIABLE(VasEBoot_relocator_xen_mmu_op_addr) .long 0 movl $3, %ecx /* 3 mmu ops */ movl $0, %edx /* pdone (not used) */ @@ -107,25 +107,25 @@ VARIABLE(grub_relocator_xen_mmu_op_addr) /* Continue in virtual kernel mapping. */ /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_remap_continue) +VARIABLE(VasEBoot_relocator_xen_remap_continue) .long 0 jmp *%eax -VARIABLE(grub_relocator_xen_paging_areas) +VARIABLE(VasEBoot_relocator_xen_paging_areas) .long 0, 0, 0, 0, 0, 0, 0, 0 -VARIABLE(grub_relocator_xen_mmu_op) +VARIABLE(VasEBoot_relocator_xen_mmu_op) .space 256 -VARIABLE(grub_relocator_xen_remap_end) +VARIABLE(VasEBoot_relocator_xen_remap_end) -VARIABLE(grub_relocator_xen_start) +VARIABLE(VasEBoot_relocator_xen_start) /* Unmap old remapper area. */ /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_virt2) +VARIABLE(VasEBoot_relocator_xen_remapper_virt2) .long 0 movl %eax, %ebx @@ -140,14 +140,14 @@ VARIABLE(grub_relocator_xen_remapper_virt2) /* Prepare registers for starting kernel. */ /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_stack) +VARIABLE(VasEBoot_relocator_xen_stack) .long 0 movl %eax, %esp /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_start_info) +VARIABLE(VasEBoot_relocator_xen_start_info) .long 0 movl %eax, %esi @@ -156,10 +156,10 @@ VARIABLE(grub_relocator_xen_start_info) /* mov imm32, %eax */ .byte 0xb8 -VARIABLE(grub_relocator_xen_entry_point) +VARIABLE(VasEBoot_relocator_xen_entry_point) .long 0 /* Now start the new kernel. */ jmp *%eax -VARIABLE(grub_relocator_xen_end) +VARIABLE(VasEBoot_relocator_xen_end) diff --git a/VasEBoot-core/lib/ia64/longjmp.S b/VasEBoot-core/lib/ia64/longjmp.S index 38afb2243..f8afeaf62 100644 --- a/VasEBoot-core/lib/ia64/longjmp.S +++ b/VasEBoot-core/lib/ia64/longjmp.S @@ -42,8 +42,8 @@ .text - .proc EXT_C(grub_longjmp) -FUNCTION(grub_longjmp) + .proc EXT_C(VasEBoot_longjmp) +FUNCTION(VasEBoot_longjmp) alloc r8=ar.pfs,2,1,0,0 mov r27=ar.rsc add r2=0x98,in0 // r2 <- &jmpbuf.orig_jmp_buf_addr @@ -159,4 +159,4 @@ FUNCTION(grub_longjmp) invala // virt. -> phys. regnum mapping may change mov pr=r24,-1 br.ret.dptk.few rp - .endp EXT_C(grub_longjmp) + .endp EXT_C(VasEBoot_longjmp) diff --git a/VasEBoot-core/lib/ia64/setjmp.S b/VasEBoot-core/lib/ia64/setjmp.S index a0382d83d..ba3942311 100644 --- a/VasEBoot-core/lib/ia64/setjmp.S +++ b/VasEBoot-core/lib/ia64/setjmp.S @@ -64,23 +64,23 @@ 0x1b0 f30 0x1c0 f31 */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv2+" +VasEBoot_MOD_LICENSE "GPLv2+" /* The following two entry points are the traditional entry points: */ .text - .proc EXT_C(grub_setjmp) -FUNCTION(grub_setjmp) + .proc EXT_C(VasEBoot_setjmp) +FUNCTION(VasEBoot_setjmp) alloc r8=ar.pfs,2,0,0,0 mov in1=1 br.cond.sptk.many __sigsetjmp - .endp EXT_C(grub_setjmp) + .endp EXT_C(VasEBoot_setjmp) /* __sigsetjmp(__jmp_buf buf, int savemask) */ diff --git a/VasEBoot-core/lib/ieee1275/cmos.c b/VasEBoot-core/lib/ieee1275/cmos.c index 328d70a0c..3f48f191c 100644 --- a/VasEBoot-core/lib/ieee1275/cmos.c +++ b/VasEBoot-core/lib/ieee1275/cmos.c @@ -1,77 +1,77 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -volatile grub_uint8_t *grub_cmos_port = 0; +volatile VasEBoot_uint8_t *VasEBoot_cmos_port = 0; -/* Helper for grub_cmos_find_port. */ +/* Helper for VasEBoot_cmos_find_port. */ static int -grub_cmos_find_port_iter (struct grub_ieee1275_devalias *alias) +VasEBoot_cmos_find_port_iter (struct VasEBoot_ieee1275_devalias *alias) { - grub_ieee1275_phandle_t dev; - grub_uint32_t addr[2]; - grub_ssize_t actual; + VasEBoot_ieee1275_phandle_t dev; + VasEBoot_uint32_t addr[2]; + VasEBoot_ssize_t actual; /* Enough to check if it's "m5819" */ char compat[100]; - if (grub_ieee1275_finddevice (alias->path, &dev)) + if (VasEBoot_ieee1275_finddevice (alias->path, &dev)) return 0; - if (grub_ieee1275_get_property (dev, "compatible", compat, sizeof (compat), + if (VasEBoot_ieee1275_get_property (dev, "compatible", compat, sizeof (compat), 0)) return 0; - if (grub_strcmp (compat, "m5819") != 0) + if (VasEBoot_strcmp (compat, "m5819") != 0) return 0; - if (grub_ieee1275_get_integer_property (dev, "address", + if (VasEBoot_ieee1275_get_integer_property (dev, "address", addr, sizeof (addr), &actual)) return 0; if (actual == 4) { - grub_cmos_port = (volatile grub_uint8_t *) (grub_addr_t) addr[0]; + VasEBoot_cmos_port = (volatile VasEBoot_uint8_t *) (VasEBoot_addr_t) addr[0]; return 1; } -#if GRUB_CPU_SIZEOF_VOID_P == 8 +#if VasEBoot_CPU_SIZEOF_VOID_P == 8 if (actual == 8) { - grub_cmos_port = (volatile grub_uint8_t *) - ((((grub_addr_t) addr[0]) << 32) | addr[1]); + VasEBoot_cmos_port = (volatile VasEBoot_uint8_t *) + ((((VasEBoot_addr_t) addr[0]) << 32) | addr[1]); return 1; } #else if (actual == 8 && addr[0] == 0) { - grub_cmos_port = (volatile grub_uint8_t *) addr[1]; + VasEBoot_cmos_port = (volatile VasEBoot_uint8_t *) addr[1]; return 1; } #endif return 0; } -grub_err_t -grub_cmos_find_port (void) +VasEBoot_err_t +VasEBoot_cmos_find_port (void) { - grub_ieee1275_devices_iterate (grub_cmos_find_port_iter); - if (!grub_cmos_port) - return grub_error (GRUB_ERR_IO, "no cmos found"); + VasEBoot_ieee1275_devices_iterate (VasEBoot_cmos_find_port_iter); + if (!VasEBoot_cmos_port) + return VasEBoot_error (VasEBoot_ERR_IO, "no cmos found"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/ieee1275/datetime.c b/VasEBoot-core/lib/ieee1275/datetime.c index b81fba2ed..1a1bf1a2c 100644 --- a/VasEBoot-core/lib/ieee1275/datetime.c +++ b/VasEBoot-core/lib/ieee1275/datetime.c @@ -1,43 +1,43 @@ /* kern/cmos_datetime.c - CMOS datetime function. * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include #if defined (__powerpc__) || defined (__sparc__) -#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static char *rtc = 0; static int no_ieee1275_rtc = 0; /* Helper for find_rtc. */ static int -find_rtc_iter (struct grub_ieee1275_devalias *alias) +find_rtc_iter (struct VasEBoot_ieee1275_devalias *alias) { - if (grub_strcmp (alias->type, "rtc") == 0) + if (VasEBoot_strcmp (alias->type, "rtc") == 0) { - grub_dprintf ("datetime", "Found RTC %s\n", alias->path); - rtc = grub_strdup (alias->path); + VasEBoot_dprintf ("datetime", "Found RTC %s\n", alias->path); + rtc = VasEBoot_strdup (alias->path); return 1; } return 0; @@ -46,52 +46,52 @@ find_rtc_iter (struct grub_ieee1275_devalias *alias) static void find_rtc (void) { - grub_ieee1275_devices_iterate (find_rtc_iter); + VasEBoot_ieee1275_devices_iterate (find_rtc_iter); if (!rtc) no_ieee1275_rtc = 1; } -grub_err_t -grub_get_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_get_datetime (struct VasEBoot_datetime *datetime) { struct get_time_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t device; - grub_ieee1275_cell_t catch_result; - grub_ieee1275_cell_t year; - grub_ieee1275_cell_t month; - grub_ieee1275_cell_t day; - grub_ieee1275_cell_t hour; - grub_ieee1275_cell_t minute; - grub_ieee1275_cell_t second; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t device; + VasEBoot_ieee1275_cell_t catch_result; + VasEBoot_ieee1275_cell_t year; + VasEBoot_ieee1275_cell_t month; + VasEBoot_ieee1275_cell_t day; + VasEBoot_ieee1275_cell_t hour; + VasEBoot_ieee1275_cell_t minute; + VasEBoot_ieee1275_cell_t second; } args; int status; - grub_ieee1275_ihandle_t ihandle; + VasEBoot_ieee1275_ihandle_t ihandle; if (no_ieee1275_rtc) - return grub_get_datetime_cmos (datetime); + return VasEBoot_get_datetime_cmos (datetime); if (!rtc) find_rtc (); if (!rtc) - return grub_get_datetime_cmos (datetime); + return VasEBoot_get_datetime_cmos (datetime); - status = grub_ieee1275_open (rtc, &ihandle); + status = VasEBoot_ieee1275_open (rtc, &ihandle); if (status == -1) - return grub_error (GRUB_ERR_IO, "couldn't open RTC"); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't open RTC"); INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 7); - args.device = (grub_ieee1275_cell_t) ihandle; - args.method = (grub_ieee1275_cell_t) "get-time"; + args.device = (VasEBoot_ieee1275_cell_t) ihandle; + args.method = (VasEBoot_ieee1275_cell_t) "get-time"; status = IEEE1275_CALL_ENTRY_FN (&args); - grub_ieee1275_close (ihandle); + VasEBoot_ieee1275_close (ihandle); if (status == -1 || args.catch_result) - return grub_error (GRUB_ERR_IO, "get-time failed"); + return VasEBoot_error (VasEBoot_ERR_IO, "get-time failed"); datetime->year = args.year; datetime->month = args.month; @@ -100,43 +100,43 @@ grub_get_datetime (struct grub_datetime *datetime) datetime->minute = args.minute; datetime->second = args.second; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_set_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_set_datetime (struct VasEBoot_datetime *datetime) { struct set_time_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t device; - grub_ieee1275_cell_t year; - grub_ieee1275_cell_t month; - grub_ieee1275_cell_t day; - grub_ieee1275_cell_t hour; - grub_ieee1275_cell_t minute; - grub_ieee1275_cell_t second; - grub_ieee1275_cell_t catch_result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t device; + VasEBoot_ieee1275_cell_t year; + VasEBoot_ieee1275_cell_t month; + VasEBoot_ieee1275_cell_t day; + VasEBoot_ieee1275_cell_t hour; + VasEBoot_ieee1275_cell_t minute; + VasEBoot_ieee1275_cell_t second; + VasEBoot_ieee1275_cell_t catch_result; } args; int status; - grub_ieee1275_ihandle_t ihandle; + VasEBoot_ieee1275_ihandle_t ihandle; if (no_ieee1275_rtc) - return grub_set_datetime_cmos (datetime); + return VasEBoot_set_datetime_cmos (datetime); if (!rtc) find_rtc (); if (!rtc) - return grub_set_datetime_cmos (datetime); + return VasEBoot_set_datetime_cmos (datetime); - status = grub_ieee1275_open (rtc, &ihandle); + status = VasEBoot_ieee1275_open (rtc, &ihandle); if (status == -1) - return grub_error (GRUB_ERR_IO, "couldn't open RTC"); + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't open RTC"); INIT_IEEE1275_COMMON (&args.common, "call-method", 8, 1); - args.device = (grub_ieee1275_cell_t) ihandle; - args.method = (grub_ieee1275_cell_t) "set-time"; + args.device = (VasEBoot_ieee1275_cell_t) ihandle; + args.method = (VasEBoot_ieee1275_cell_t) "set-time"; args.year = datetime->year; args.month = datetime->month; @@ -147,10 +147,10 @@ grub_set_datetime (struct grub_datetime *datetime) status = IEEE1275_CALL_ENTRY_FN (&args); - grub_ieee1275_close (ihandle); + VasEBoot_ieee1275_close (ihandle); if (status == -1 || args.catch_result) - return grub_error (GRUB_ERR_IO, "set-time failed"); + return VasEBoot_error (VasEBoot_ERR_IO, "set-time failed"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/ieee1275/halt.c b/VasEBoot-core/lib/ieee1275/halt.c index 8fc16d243..8dc91f310 100644 --- a/VasEBoot-core/lib/ieee1275/halt.c +++ b/VasEBoot-core/lib/ieee1275/halt.c @@ -1,33 +1,33 @@ /* openfw.c -- Open firmware support functions. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include void -grub_halt (void) +VasEBoot_halt (void) { /* Not standardized. We try three known commands. */ - grub_ieee1275_interpret ("power-off", 0); - grub_ieee1275_interpret ("shut-down", 0); - grub_ieee1275_interpret ("poweroff", 0); + VasEBoot_ieee1275_interpret ("power-off", 0); + VasEBoot_ieee1275_interpret ("shut-down", 0); + VasEBoot_ieee1275_interpret ("poweroff", 0); while (1); } diff --git a/VasEBoot-core/lib/ieee1275/reboot.c b/VasEBoot-core/lib/ieee1275/reboot.c index 91c8779f2..288fbea69 100644 --- a/VasEBoot-core/lib/ieee1275/reboot.c +++ b/VasEBoot-core/lib/ieee1275/reboot.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - grub_ieee1275_interpret ("reset-all", 0); + VasEBoot_ieee1275_interpret ("reset-all", 0); for (;;) ; } diff --git a/VasEBoot-core/lib/ieee1275/relocator.c b/VasEBoot-core/lib/ieee1275/relocator.c index c6dd8facb..e290047df 100644 --- a/VasEBoot-core/lib/ieee1275/relocator.c +++ b/VasEBoot-core/lib/ieee1275/relocator.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -/* Helper for grub_relocator_firmware_get_max_events. */ +/* Helper for VasEBoot_relocator_firmware_get_max_events. */ static int -count (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t len __attribute__ ((unused)), - grub_memory_type_t type __attribute__ ((unused)), void *data) +count (VasEBoot_uint64_t addr __attribute__ ((unused)), + VasEBoot_uint64_t len __attribute__ ((unused)), + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { int *counter = data; @@ -34,35 +34,35 @@ count (grub_uint64_t addr __attribute__ ((unused)), } unsigned -grub_relocator_firmware_get_max_events (void) +VasEBoot_relocator_firmware_get_max_events (void) { int counter = 0; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_FORCE_CLAIM)) return 0; - grub_machine_mmap_iterate (count, &counter); + VasEBoot_machine_mmap_iterate (count, &counter); return 2 * counter; } -/* Context for grub_relocator_firmware_fill_events. */ -struct grub_relocator_firmware_fill_events_ctx +/* Context for VasEBoot_relocator_firmware_fill_events. */ +struct VasEBoot_relocator_firmware_fill_events_ctx { - struct grub_relocator_mmap_event *events; + struct VasEBoot_relocator_mmap_event *events; int counter; }; -/* Helper for grub_relocator_firmware_fill_events. */ +/* Helper for VasEBoot_relocator_firmware_fill_events. */ static int -grub_relocator_firmware_fill_events_iter (grub_uint64_t addr, - grub_uint64_t len, - grub_memory_type_t type, void *data) +VasEBoot_relocator_firmware_fill_events_iter (VasEBoot_uint64_t addr, + VasEBoot_uint64_t len, + VasEBoot_memory_type_t type, void *data) { - struct grub_relocator_firmware_fill_events_ctx *ctx = data; + struct VasEBoot_relocator_firmware_fill_events_ctx *ctx = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM)) { if (addr + len <= 0x180000) return 0; @@ -85,30 +85,30 @@ grub_relocator_firmware_fill_events_iter (grub_uint64_t addr, } unsigned -grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events) +VasEBoot_relocator_firmware_fill_events (struct VasEBoot_relocator_mmap_event *events) { - struct grub_relocator_firmware_fill_events_ctx ctx = { + struct VasEBoot_relocator_firmware_fill_events_ctx ctx = { .events = events, .counter = 0 }; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_FORCE_CLAIM)) return 0; - grub_machine_mmap_iterate (grub_relocator_firmware_fill_events_iter, &ctx); + VasEBoot_machine_mmap_iterate (VasEBoot_relocator_firmware_fill_events_iter, &ctx); return ctx.counter; } int -grub_relocator_firmware_alloc_region (grub_addr_t start, grub_size_t size) +VasEBoot_relocator_firmware_alloc_region (VasEBoot_addr_t start, VasEBoot_size_t size) { - grub_err_t err; - err = grub_claimmap (start, size); - grub_errno = 0; + VasEBoot_err_t err; + err = VasEBoot_claimmap (start, size); + VasEBoot_errno = 0; return (err == 0); } void -grub_relocator_firmware_free_region (grub_addr_t start, grub_size_t size) +VasEBoot_relocator_firmware_free_region (VasEBoot_addr_t start, VasEBoot_size_t size) { - grub_ieee1275_release (start, size); + VasEBoot_ieee1275_release (start, size); } diff --git a/VasEBoot-core/lib/legacy_parse.c b/VasEBoot-core/lib/legacy_parse.c index ef56150ac..9a841a336 100644 --- a/VasEBoot-core/lib/legacy_parse.c +++ b/VasEBoot-core/lib/legacy_parse.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2010,2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wformat-nonliteral" @@ -129,7 +129,7 @@ static struct legacy_command legacy_commands[] = {"displayapm", "lsapm\n", NULL, 0, 0, {}, 0, 0, "Display APM BIOS information."}, {"displaymem", "lsmmap\n", NULL, 0, 0, {}, 0, 0, - "Display what GRUB thinks the system address space map of the" + "Display what VasEBoot thinks the system address space map of the" " machine is, including all regions of physical RAM installed."}, /* FIXME: device and efimap unsupported. */ /* NOTE: embed unsupported. */ @@ -139,7 +139,7 @@ static struct legacy_command legacy_commands[] = " errors, instead of waiting for the user to do anything, it" " immediately starts over using the NUM entry (same numbering as the" " `default' command). This obviously won't help if the machine" - " was rebooted by a kernel that GRUB loaded."}, + " was rebooted by a kernel that VasEBoot loaded."}, {"find", "search -f '%s'\n", NULL, 0, 1, {TYPE_FILE}, 0, "FILENAME", "Search for the filename FILENAME in all of partitions and print the list of" " the devices which contain the file."}, @@ -179,12 +179,12 @@ static struct legacy_command legacy_commands[] = " must be reloaded after using this command. The option --type is used" " to suggest what type of kernel to be loaded. TYPE must be either of" " \"netbsd\", \"freebsd\", \"openbsd\", \"linux\", \"biglinux\" and" - " \"multiboot\". The option --no-mem-option tells GRUB not to pass a" + " \"multiboot\". The option --no-mem-option tells VasEBoot not to pass a" " Linux's mem option automatically."}, {"lock", "if ! authenticate legacy; then return; fi", NULL, 0, 0, {}, 0, 0, "Break a command execution unless the user is authenticated."}, {"makeactive", "parttool \"$root\" boot+\n", NULL, 0, 0, {}, 0, 0, - "Set the active partition on the root disk to GRUB's root device." + "Set the active partition on the root disk to VasEBoot's root device." " This command is limited to _primary_ PC partitions on a hard disk."}, {"map", "drivemap '%s' '%s'\n", NULL, 0, 2, {TYPE_PARTITION, TYPE_PARTITION}, @@ -192,7 +192,7 @@ static struct legacy_command legacy_commands[] = "Map the drive FROM_DRIVE to the drive TO_DRIVE. This is necessary" " when you chain-load some operating systems, such as DOS, if such an" " OS resides at a non-first drive."}, - /* NOTE: md5crypt unsupported since GRUB has not enough entropy and this + /* NOTE: md5crypt unsupported since VasEBoot has not enough entropy and this hash shouldn't be used anymore. */ {"module", "legacy_initrd '%s' %s\n", NULL, 0, 2, {TYPE_FILE_NO_CONSUME, TYPE_REST_VERBATIM}, 0, @@ -230,11 +230,11 @@ static struct legacy_command legacy_commands[] = "If used in the first section of a menu file, disable all" " interactive editing control (menu entry editor and" " command line). If the password PASSWD is entered, it loads the" - " FILE as a new config file and restarts the GRUB Stage 2. If you" - " omit the argument FILE, then GRUB just unlocks privileged" + " FILE as a new config file and restarts the VasEBoot Stage 2. If you" + " omit the argument FILE, then VasEBoot just unlocks privileged" " instructions. You can also use it in the script section, in" " which case it will ask for the password, before continuing." - " The option --md5 tells GRUB that PASSWD is encrypted with" + " The option --md5 tells VasEBoot that PASSWD is encrypted with" " md5crypt."}, {"password", "if [ \"$superusers\" = "" ]; then superusers=legacy; fi;\n" "legacy_password %s '%s'\n", NULL, 0, 2, {TYPE_OPTION, TYPE_VERBATIM}, @@ -246,7 +246,7 @@ static struct legacy_command legacy_commands[] = {"password", "if ! legacy_check_password %s '%s'; then return fi;\n", NULL, 0, 2, {TYPE_OPTION, TYPE_VERBATIM}, FLAG_IGNORE_REST | FLAG_FALLBACK | FLAG_MENUENTRY_ONLY, NULL, NULL}, - /* NOTE: GRUB2 has a design principle of not eternally waiting for user + /* NOTE: VasEBoot2 has a design principle of not eternally waiting for user input. 60 seconds should be enough. */ {"pause", "echo %s; if ! sleep -i 60; then return; fi\n", NULL, 0, 1, @@ -280,7 +280,7 @@ static struct legacy_command legacy_commands[] = "[DEVICE [HDBIAS]]", "Similar to `root', but don't attempt to mount the partition. This" " is useful for when an OS is outside of the area of the disk that" - " GRUB can read, but setting the correct root device is still" + " VasEBoot can read, but setting the correct root device is still" " desired. Note that the items mentioned in `root' which" " derived from attempting the mount will NOT work correctly."}, {"rootnoverify", "echo \"$root\"\n", NULL, 0, @@ -299,7 +299,7 @@ static struct legacy_command legacy_commands[] = " set it by --port. SPEED is the DTE-DTE speed. WORD is the word length," " PARITY is the type of parity, which is one of `no', `odd' and `even'." " STOP is the length of stop bit(s). The option --device can be used only" - " in the grub shell, which specifies the file name of a tty device. The" + " in the VasEBoot shell, which specifies the file name of a tty device. The" " default values are COM1, 9600, 8N1."}, /* FIXME: shade unsupported. */ /* FIXME: silent unsupported. */ @@ -357,7 +357,7 @@ static struct legacy_command legacy_commands[] = }; char * -grub_legacy_escape (const char *in, grub_size_t len) +VasEBoot_legacy_escape (const char *in, VasEBoot_size_t len) { char *ptr; char *ret; @@ -367,27 +367,27 @@ grub_legacy_escape (const char *in, grub_size_t len) for (ptr = (char*)in; ptr < in + len && *ptr; ptr++) if (*ptr == '\'') overhead += 3; - ret = grub_malloc (ptr - in + overhead + 1); + ret = VasEBoot_malloc (ptr - in + overhead + 1); if (!ret) return NULL; ptr = (char*)in; saved = ptr[len]; ptr[len] = '\0'; - grub_strchrsub (ret, ptr, '\'', "'\\''"); + VasEBoot_strchrsub (ret, ptr, '\'', "'\\''"); ptr[len] = saved; return ret; } static char * -adjust_file (const char *in, grub_size_t len) +adjust_file (const char *in, VasEBoot_size_t len) { const char *comma, *ptr, *rest; char *ret, *outptr; int overhead = 0; int part = -1, subpart = -1; if (in[0] != '(') - return grub_legacy_escape (in, len); + return VasEBoot_legacy_escape (in, len); for (ptr = in + 1; ptr < in + len && *ptr && *ptr != ')' && *ptr != ','; ptr++) if (*ptr == '\'' || *ptr == '\\') @@ -401,11 +401,11 @@ adjust_file (const char *in, grub_size_t len) if (*ptr == '\'' || *ptr == '\\') overhead++; - ret = grub_malloc (ptr - in + overhead + 15); + ret = VasEBoot_malloc (ptr - in + overhead + 15); if (!ret) return NULL; - outptr = grub_stpcpy (ret, "(tftp)");; + outptr = VasEBoot_stpcpy (ret, "(tftp)");; for (ptr = rest; ptr < in + len; ptr++) { if (*ptr == '\'' || *ptr == '\\') @@ -417,8 +417,8 @@ adjust_file (const char *in, grub_size_t len) return ret; } if (*comma != ',') - return grub_legacy_escape (in, len); - part = grub_strtoull (comma + 1, (char **) &rest, 0); + return VasEBoot_legacy_escape (in, len); + part = VasEBoot_strtoull (comma + 1, (char **) &rest, 0); if (rest[0] == ',' && rest[1] >= 'a' && rest[1] <= 'z') { subpart = rest[1] - 'a'; @@ -429,7 +429,7 @@ adjust_file (const char *in, grub_size_t len) overhead++; /* 35 is enough for any 2 numbers. */ - ret = grub_malloc (ptr - in + overhead + 35 + 5); + ret = VasEBoot_malloc (ptr - in + overhead + 35 + 5); if (!ret) return NULL; @@ -442,9 +442,9 @@ adjust_file (const char *in, grub_size_t len) *outptr++ = *ptr; } if (subpart != -1) - grub_snprintf (outptr, 35, "%d,%d", part + 1, subpart + 1); + VasEBoot_snprintf (outptr, 35, "%d,%d", part + 1, subpart + 1); else - grub_snprintf (outptr, 35, "%d", part + 1); + VasEBoot_snprintf (outptr, 35, "%d", part + 1); while (*outptr) outptr++; for (ptr = rest; ptr < in + len; ptr++) @@ -459,15 +459,15 @@ adjust_file (const char *in, grub_size_t len) } static int -check_option (const char *a, const char *b, grub_size_t len) +check_option (const char *a, const char *b, VasEBoot_size_t len) { - if (grub_strlen (b) != len) + if (VasEBoot_strlen (b) != len) return 0; - return grub_strncmp (a, b, len) == 0; + return VasEBoot_strncmp (a, b, len) == 0; } static int -is_option (enum arg_type opt, const char *curarg, grub_size_t len) +is_option (enum arg_type opt, const char *curarg, VasEBoot_size_t len) { switch (opt) { @@ -493,7 +493,7 @@ is_option (enum arg_type opt, const char *curarg, grub_size_t len) } char * -grub_legacy_parse (const char *buf, char **entryname, char **suffix) +VasEBoot_legacy_parse (const char *buf, char **entryname, char **suffix) { const char *ptr; const char *cmdname; @@ -502,13 +502,13 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) *suffix = NULL; - for (ptr = buf; *ptr && grub_isspace (*ptr); ptr++); + for (ptr = buf; *ptr && VasEBoot_isspace (*ptr); ptr++); if (!*ptr || *ptr == '#') { char *ret; - int len = grub_strlen (buf); - ret = grub_malloc (len + 2); - grub_memcpy (ret, buf, len); + int len = VasEBoot_strlen (buf); + ret = VasEBoot_malloc (len + 2); + VasEBoot_memcpy (ret, buf, len); if (len && ret[len - 1] == '\n') ret[len] = 0; else @@ -520,10 +520,10 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) } cmdname = ptr; - for (ptr = buf; *ptr && !grub_isspace (*ptr) && *ptr != '='; ptr++); + for (ptr = buf; *ptr && !VasEBoot_isspace (*ptr) && *ptr != '='; ptr++); for (cmdnum = 0; cmdnum < ARRAY_SIZE (legacy_commands); cmdnum++) - if (grub_strncmp (legacy_commands[cmdnum].name, cmdname, ptr - cmdname) == 0 + if (VasEBoot_strncmp (legacy_commands[cmdnum].name, cmdname, ptr - cmdname) == 0 && legacy_commands[cmdnum].name[ptr - cmdname] == 0 && (!(*entryname != NULL && (legacy_commands[cmdnum].flags & FLAG_NO_MENUENTRY))) @@ -531,17 +531,17 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) & FLAG_MENUENTRY_ONLY)))) break; if (cmdnum == ARRAY_SIZE (legacy_commands)) - return grub_xasprintf ("# Unsupported legacy command: %s\n", buf); + return VasEBoot_xasprintf ("# Unsupported legacy command: %s\n", buf); - for (; grub_isspace (*ptr) || *ptr == '='; ptr++); + for (; VasEBoot_isspace (*ptr) || *ptr == '='; ptr++); if (legacy_commands[cmdnum].flags & FLAG_TITLE) { const char *ptr2; - ptr2 = ptr + grub_strlen (ptr); - while (ptr2 > ptr && grub_isspace (*(ptr2 - 1))) + ptr2 = ptr + VasEBoot_strlen (ptr); + while (ptr2 > ptr && VasEBoot_isspace (*(ptr2 - 1))) ptr2--; - *entryname = grub_strndup (ptr, ptr2 - ptr); + *entryname = VasEBoot_strndup (ptr, ptr2 - ptr); return NULL; } @@ -560,102 +560,102 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) { /* "[--timeout=SECS] [--silent]" " [console] [serial] [hercules]"*/ - if (grub_memcmp (ptr, "--dumb", sizeof ("--dumb") - 1) == 0) + if (VasEBoot_memcmp (ptr, "--dumb", sizeof ("--dumb") - 1) == 0) dumb = 1; #ifdef TODO - if (grub_memcmp (ptr, "--no-echo", sizeof ("--no-echo") - 1) == 0) + if (VasEBoot_memcmp (ptr, "--no-echo", sizeof ("--no-echo") - 1) == 0) no_echo = 1; - if (grub_memcmp (ptr, "--no-edit", sizeof ("--no-edit") - 1) == 0) + if (VasEBoot_memcmp (ptr, "--no-edit", sizeof ("--no-edit") - 1) == 0) no_edit = 1; #endif - if (grub_memcmp (ptr, "--lines=", sizeof ("--lines=") - 1) == 0) + if (VasEBoot_memcmp (ptr, "--lines=", sizeof ("--lines=") - 1) == 0) { - lines = grub_strtoul (ptr + sizeof ("--lines=") - 1, 0, 0); - if (grub_errno) + lines = VasEBoot_strtoul (ptr + sizeof ("--lines=") - 1, 0, 0); + if (VasEBoot_errno) { lines = 24; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } } - if (grub_memcmp (ptr, "console", sizeof ("console") - 1) == 0) + if (VasEBoot_memcmp (ptr, "console", sizeof ("console") - 1) == 0) console = 1; - if (grub_memcmp (ptr, "serial", sizeof ("serial") - 1) == 0) + if (VasEBoot_memcmp (ptr, "serial", sizeof ("serial") - 1) == 0) serial = 1; - if (grub_memcmp (ptr, "hercules", sizeof ("hercules") - 1) == 0) + if (VasEBoot_memcmp (ptr, "hercules", sizeof ("hercules") - 1) == 0) hercules = 1; - if (grub_memcmp (ptr, "graphics", sizeof ("graphics") - 1) == 0) + if (VasEBoot_memcmp (ptr, "graphics", sizeof ("graphics") - 1) == 0) graphics = 1; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; - while (*ptr && grub_isspace (*ptr)) + while (*ptr && VasEBoot_isspace (*ptr)) ptr++; } if (!console && !serial && !hercules && !graphics) - return grub_strdup ("terminal_input; terminal_output; terminfo\n"); + return VasEBoot_strdup ("terminal_input; terminal_output; terminfo\n"); outptr = outbuf; if (graphics) - outptr = grub_stpcpy (outptr, "insmod all_video; "); + outptr = VasEBoot_stpcpy (outptr, "insmod all_video; "); - outptr = grub_stpcpy (outptr, "terminal_input "); + outptr = VasEBoot_stpcpy (outptr, "terminal_input "); if (serial) - outptr = grub_stpcpy (outptr, "serial "); + outptr = VasEBoot_stpcpy (outptr, "serial "); if (console || hercules || graphics) - outptr = grub_stpcpy (outptr, "console "); - outptr = grub_stpcpy (outptr, "; terminal_output "); + outptr = VasEBoot_stpcpy (outptr, "console "); + outptr = VasEBoot_stpcpy (outptr, "; terminal_output "); if (serial) - outptr = grub_stpcpy (outptr, "serial "); + outptr = VasEBoot_stpcpy (outptr, "serial "); if (console) - outptr = grub_stpcpy (outptr, "console "); + outptr = VasEBoot_stpcpy (outptr, "console "); if (hercules) - outptr = grub_stpcpy (outptr, "mda_text "); + outptr = VasEBoot_stpcpy (outptr, "mda_text "); if (graphics) - outptr = grub_stpcpy (outptr, "gfxterm "); - outptr = grub_stpcpy (outptr, "; "); + outptr = VasEBoot_stpcpy (outptr, "gfxterm "); + outptr = VasEBoot_stpcpy (outptr, "; "); *outptr = '\0'; if (serial) { - grub_snprintf (outptr, outbuf + sizeof (outbuf) - outptr, + VasEBoot_snprintf (outptr, outbuf + sizeof (outbuf) - outptr, "terminfo serial -g 80x%d %s; ", lines, dumb ? "dumb" : "vt100"); - outptr += grub_strlen (outptr); + outptr += VasEBoot_strlen (outptr); } - grub_strcpy (outptr, "\n"); + VasEBoot_strcpy (outptr, "\n"); - return grub_strdup (outbuf); + return VasEBoot_strdup (outbuf); } - grub_memset (args, 0, sizeof (args)); + VasEBoot_memset (args, 0, sizeof (args)); { int hold_arg = 0; const char *curarg = NULL; for (i = 0; i < legacy_commands[cmdnum].argc; i++) { - grub_size_t curarglen; + VasEBoot_size_t curarglen; if (hold_arg) { ptr = curarg; hold_arg = 0; } - for (; grub_isspace (*ptr); ptr++); + for (; VasEBoot_isspace (*ptr); ptr++); curarg = ptr; if (!*curarg) break; - for (; *ptr && !grub_isspace (*ptr); ptr++); + for (; *ptr && !VasEBoot_isspace (*ptr); ptr++); if (i != legacy_commands[cmdnum].argc - 1 || (legacy_commands[cmdnum].flags & FLAG_IGNORE_REST)) curarglen = ptr - curarg; else { - curarglen = grub_strlen (curarg); - while (curarglen > 0 && grub_isspace (curarg[curarglen - 1])) + curarglen = VasEBoot_strlen (curarg); + while (curarglen > 0 && VasEBoot_isspace (curarg[curarglen - 1])) curarglen--; } if (*ptr) @@ -677,8 +677,8 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) ptr = curarg; while (*ptr) { - for (; *ptr && grub_isspace (*ptr); ptr++); - for (; *ptr && !grub_isspace (*ptr); ptr++) + for (; *ptr && VasEBoot_isspace (*ptr); ptr++); + for (; *ptr && !VasEBoot_isspace (*ptr); ptr++) if (*ptr == '\'') overhead += 3; if (*ptr) @@ -686,18 +686,18 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) overhead += 3; } - outptr0 = args[i] = grub_malloc (overhead + (ptr - curarg)); + outptr0 = args[i] = VasEBoot_malloc (overhead + (ptr - curarg)); if (!outptr0) return NULL; ptr = curarg; outptr = outptr0; while (*ptr) { - for (; *ptr && grub_isspace (*ptr); ptr++); + for (; *ptr && VasEBoot_isspace (*ptr); ptr++); if (outptr != outptr0) *outptr++ = ' '; *outptr++ = '\''; - for (; *ptr && !grub_isspace (*ptr); ptr++) + for (; *ptr && !VasEBoot_isspace (*ptr); ptr++) { if (*ptr == '\'') { @@ -718,7 +718,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) break; case TYPE_VERBATIM: - args[i] = grub_legacy_escape (curarg, curarglen); + args[i] = VasEBoot_legacy_escape (curarg, curarglen); break; case TYPE_WITH_CONFIGFILE_OPTION: case TYPE_FORCE_OPTION: @@ -727,10 +727,10 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) case TYPE_OPTION: if (is_option (legacy_commands[cmdnum].argt[i], curarg, curarglen)) { - args[i] = grub_strndup (curarg, curarglen); + args[i] = VasEBoot_strndup (curarg, curarglen); break; } - args[i] = grub_strdup (""); + args[i] = VasEBoot_strdup (""); hold_arg = 1; break; case TYPE_INT: @@ -749,7 +749,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) { if (base == 8 && (*brk == '8' || *brk == '9')) break; - if (grub_isdigit (*brk)) + if (VasEBoot_isdigit (*brk)) continue; if (base != 16) break; @@ -758,44 +758,44 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) break; } if (brk == curarg) - args[i] = grub_strdup ("0"); + args[i] = VasEBoot_strdup ("0"); else - args[i] = grub_strndup (curarg, brk - curarg); + args[i] = VasEBoot_strndup (curarg, brk - curarg); } break; case TYPE_VBE_MODE: { unsigned mod; - struct grub_vesa_mode_table_entry *modedesc; + struct VasEBoot_vesa_mode_table_entry *modedesc; - mod = grub_strtoul (curarg, 0, 0); - if (grub_errno) + mod = VasEBoot_strtoul (curarg, 0, 0); + if (VasEBoot_errno) { mod = 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - if (mod < GRUB_VESA_MODE_TABLE_START - || mod > GRUB_VESA_MODE_TABLE_END) + if (mod < VasEBoot_VESA_MODE_TABLE_START + || mod > VasEBoot_VESA_MODE_TABLE_END) { - args[i] = grub_strdup ("auto"); + args[i] = VasEBoot_strdup ("auto"); break; } - modedesc = &grub_vesa_mode_table[mod - GRUB_VESA_MODE_TABLE_START]; + modedesc = &VasEBoot_vesa_mode_table[mod - VasEBoot_VESA_MODE_TABLE_START]; if (!modedesc->width) { - args[i] = grub_strdup ("auto"); + args[i] = VasEBoot_strdup ("auto"); break; } - args[i] = grub_xasprintf ("%ux%ux%u", + args[i] = VasEBoot_xasprintf ("%ux%ux%u", modedesc->width, modedesc->height, modedesc->depth); break; } case TYPE_BOOL: if (curarglen == 2 && curarg[0] == 'o' && curarg[1] == 'n') - args[i] = grub_strdup ("1"); + args[i] = VasEBoot_strdup ("1"); else - args[i] = grub_strdup ("0"); + args[i] = VasEBoot_strdup ("0"); break; } } @@ -820,56 +820,56 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) case TYPE_NOAPM_OPTION: case TYPE_TYPE_OR_NOMEM_OPTION: case TYPE_OPTION: - args[i] = grub_strdup (""); + args[i] = VasEBoot_strdup (""); break; case TYPE_BOOL: case TYPE_INT: - args[i] = grub_strdup ("0"); + args[i] = VasEBoot_strdup ("0"); break; case TYPE_VBE_MODE: - args[i] = grub_strdup ("auto"); + args[i] = VasEBoot_strdup ("auto"); break; } if (legacy_commands[cmdnum].flags & FLAG_COLOR_INVERT) { char *corig = args[legacy_commands[cmdnum].argc - 1]; - char *slash = grub_strchr (corig, '/'); + char *slash = VasEBoot_strchr (corig, '/'); char *invert; - grub_size_t len; + VasEBoot_size_t len; - len = grub_strlen (corig); + len = VasEBoot_strlen (corig); if (!slash) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), args[0]); return NULL; } - invert = grub_malloc (len + 1); + invert = VasEBoot_malloc (len + 1); if (!invert) return NULL; - grub_memcpy (invert, slash + 1, len - (slash - corig) - 1); + VasEBoot_memcpy (invert, slash + 1, len - (slash - corig) - 1); invert[len - (slash - args[0]) - 1] = '/'; - grub_memcpy (invert + len - (slash - corig), corig, slash - corig); + VasEBoot_memcpy (invert + len - (slash - corig), corig, slash - corig); invert[len] = 0; args[legacy_commands[cmdnum].argc] = invert; } if (legacy_commands[cmdnum].suffix) { - *suffix = grub_xasprintf (legacy_commands[cmdnum].suffix, + *suffix = VasEBoot_xasprintf (legacy_commands[cmdnum].suffix, args[legacy_commands[cmdnum].suffixarg]); if (*suffix) return NULL; } { - char *ret = grub_xasprintf (legacy_commands[cmdnum].map, args[0], args[1], + char *ret = VasEBoot_xasprintf (legacy_commands[cmdnum].map, args[0], args[1], args[2], args[3]); - grub_free (args[0]); - grub_free (args[1]); - grub_free (args[2]); - grub_free (args[3]); + VasEBoot_free (args[0]); + VasEBoot_free (args[1]); + VasEBoot_free (args[2]); + VasEBoot_free (args[3]); return ret; } } diff --git a/VasEBoot-core/lib/libgcrypt/mpi/mpi-pow.c b/VasEBoot-core/lib/libgcrypt/mpi/mpi-pow.c index 58643fed2..15d93368d 100644 --- a/VasEBoot-core/lib/libgcrypt/mpi/mpi-pow.c +++ b/VasEBoot-core/lib/libgcrypt/mpi/mpi-pow.c @@ -77,7 +77,7 @@ gcry_mpi_powm (gcry_mpi_t res, ep = expo->d; if (!msize) - grub_fatal ("mpi division by zero"); + VasEBoot_fatal ("mpi division by zero"); if (!esize) { diff --git a/VasEBoot-core/lib/libgcrypt/mpi/mpih-div.c b/VasEBoot-core/lib/libgcrypt/mpi/mpih-div.c index 0b458fffd..b0724ba0c 100644 --- a/VasEBoot-core/lib/libgcrypt/mpi/mpih-div.c +++ b/VasEBoot-core/lib/libgcrypt/mpi/mpih-div.c @@ -214,7 +214,7 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs, case 0: /* We are asked to divide by zero, so go ahead and do it! (To make the compiler not remove this statement, return the value.) */ - grub_fatal ("mpi division by zero"); + VasEBoot_fatal ("mpi division by zero"); return 0; case 1: diff --git a/VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h b/VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h index 42835493d..7cff534ac 100644 --- a/VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h +++ b/VasEBoot-core/lib/libgcrypt_wrap/cipher_wrap.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GCRY_WRAP_HEADER -#define GRUB_GCRY_WRAP_HEADER 1 +#ifndef VasEBoot_GCRY_WRAP_HEADER +#define VasEBoot_GCRY_WRAP_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #define _gcry_mpi_invm gcry_mpi_invm #define _gcry_mpi_set gcry_mpi_set #define _gcry_mpi_set_ui gcry_mpi_set_ui -#define size_t grub_size_t +#define size_t VasEBoot_size_t #undef __GNU_LIBRARY__ #define __GNU_LIBRARY__ 1 @@ -58,9 +58,9 @@ _gcry_fips_mode (void) #define assert gcry_assert -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL -#define memset grub_memset +#define memset VasEBoot_memset #endif @@ -69,8 +69,8 @@ _gcry_fips_mode (void) #include #pragma GCC diagnostic ignored "-Wredundant-decls" -#include -#include +#include +#include #define gcry_mpi_mod _gcry_mpi_mod diff --git a/VasEBoot-core/lib/libgcrypt_wrap/mem.c b/VasEBoot-core/lib/libgcrypt_wrap/mem.c index beeb661a3..fb19f7c4e 100644 --- a/VasEBoot-core/lib/libgcrypt_wrap/mem.c +++ b/VasEBoot-core/lib/libgcrypt_wrap/mem.c @@ -1,28 +1,28 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); void * gcry_malloc (size_t n) { - return grub_malloc (n); + return VasEBoot_malloc (n); } void * gcry_malloc_secure (size_t n) { - return grub_malloc (n); + return VasEBoot_malloc (n); } void gcry_free (void *a) { - grub_free (a); + VasEBoot_free (a); } int @@ -36,9 +36,9 @@ void * gcry_xcalloc (size_t n, size_t m) { void *ret; - ret = grub_zalloc (n * m); + ret = VasEBoot_zalloc (n * m); if (!ret) - grub_fatal ("gcry_xcalloc failed"); + VasEBoot_fatal ("gcry_xcalloc failed"); return ret; } @@ -46,9 +46,9 @@ void * gcry_xmalloc_secure (size_t n) { void *ret; - ret = grub_malloc (n); + ret = VasEBoot_malloc (n); if (!ret) - grub_fatal ("gcry_xmalloc failed"); + VasEBoot_fatal ("gcry_xmalloc failed"); return ret; } @@ -56,9 +56,9 @@ void * gcry_xcalloc_secure (size_t n, size_t m) { void *ret; - ret = grub_zalloc (n * m); + ret = VasEBoot_zalloc (n * m); if (!ret) - grub_fatal ("gcry_xcalloc failed"); + VasEBoot_fatal ("gcry_xcalloc failed"); return ret; } @@ -66,9 +66,9 @@ void * gcry_xmalloc (size_t n) { void *ret; - ret = grub_malloc (n); + ret = VasEBoot_malloc (n); if (!ret) - grub_fatal ("gcry_xmalloc failed"); + VasEBoot_fatal ("gcry_xmalloc failed"); return ret; } @@ -76,9 +76,9 @@ void * gcry_xrealloc (void *a, size_t n) { void *ret; - ret = grub_realloc (a, n); + ret = VasEBoot_realloc (a, n); if (!ret) - grub_fatal ("gcry_xrealloc failed"); + VasEBoot_fatal ("gcry_xrealloc failed"); return ret; } @@ -91,18 +91,18 @@ _gcry_check_heap (const void *a __attribute__ ((unused))) void _gcry_log_printf (const char *fmt, ...) { va_list args; - const char *debug = grub_env_get ("debug"); + const char *debug = VasEBoot_env_get ("debug"); if (! debug) return; - if (grub_strword (debug, "all") || grub_strword (debug, "gcrypt")) + if (VasEBoot_strword (debug, "all") || VasEBoot_strword (debug, "gcrypt")) { - grub_printf ("gcrypt: "); + VasEBoot_printf ("gcrypt: "); va_start (args, fmt); - grub_vprintf (fmt, args); + VasEBoot_vprintf (fmt, args); va_end (args); - grub_refresh (); + VasEBoot_refresh (); } } @@ -110,22 +110,22 @@ void _gcry_log_bug (const char *fmt, ...) { va_list args; - grub_printf ("gcrypt bug: "); + VasEBoot_printf ("gcrypt bug: "); va_start (args, fmt); - grub_vprintf (fmt, args); + VasEBoot_vprintf (fmt, args); va_end (args); - grub_refresh (); - grub_fatal ("gcrypt bug"); + VasEBoot_refresh (); + VasEBoot_fatal ("gcrypt bug"); } gcry_err_code_t gpg_error_from_syserror (void) { - switch (grub_errno) + switch (VasEBoot_errno) { - case GRUB_ERR_NONE: + case VasEBoot_ERR_NONE: return GPG_ERR_NO_ERROR; - case GRUB_ERR_OUT_OF_MEMORY: + case VasEBoot_ERR_OUT_OF_MEMORY: return GPG_ERR_OUT_OF_MEMORY; default: return GPG_ERR_GENERAL; diff --git a/VasEBoot-core/lib/mips/arc/reboot.c b/VasEBoot-core/lib/mips/arc/reboot.c index ecf12a7ed..06e593b80 100644 --- a/VasEBoot-core/lib/mips/arc/reboot.c +++ b/VasEBoot-core/lib/mips/arc/reboot.c @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - GRUB_ARC_FIRMWARE_VECTOR->restart (); + VasEBoot_ARC_FIRMWARE_VECTOR->restart (); - grub_millisleep (1500); + VasEBoot_millisleep (1500); - grub_puts_ (N_("Reboot failed")); - grub_refresh (); + VasEBoot_puts_ (N_("Reboot failed")); + VasEBoot_refresh (); while (1); } diff --git a/VasEBoot-core/lib/mips/loongson/reboot.c b/VasEBoot-core/lib/mips/loongson/reboot.c index a20e5748b..2f8210711 100644 --- a/VasEBoot-core/lib/mips/loongson/reboot.c +++ b/VasEBoot-core/lib/mips/loongson/reboot.c @@ -1,64 +1,64 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - switch (grub_arch_machine) + switch (VasEBoot_arch_machine) { - case GRUB_ARCH_MACHINE_FULOONG2E: - grub_outl (grub_inl (0xbfe00104) & ~4, 0xbfe00104); - grub_outl (grub_inl (0xbfe00104) | 4, 0xbfe00104); + case VasEBoot_ARCH_MACHINE_FULOONG2E: + VasEBoot_outl (VasEBoot_inl (0xbfe00104) & ~4, 0xbfe00104); + VasEBoot_outl (VasEBoot_inl (0xbfe00104) | 4, 0xbfe00104); break; - case GRUB_ARCH_MACHINE_FULOONG2F: + case VasEBoot_ARCH_MACHINE_FULOONG2F: { - grub_pci_device_t dev; - if (!grub_cs5536_find (&dev)) + VasEBoot_pci_device_t dev; + if (!VasEBoot_cs5536_find (&dev)) break; - grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_RESET, - grub_cs5536_read_msr (dev, - GRUB_CS5536_MSR_DIVIL_RESET) + VasEBoot_cs5536_write_msr (dev, VasEBoot_CS5536_MSR_DIVIL_RESET, + VasEBoot_cs5536_read_msr (dev, + VasEBoot_CS5536_MSR_DIVIL_RESET) | 1); break; } - case GRUB_ARCH_MACHINE_YEELOONG: - grub_write_ec (GRUB_MACHINE_EC_COMMAND_REBOOT); + case VasEBoot_ARCH_MACHINE_YEELOONG: + VasEBoot_write_ec (VasEBoot_MACHINE_EC_COMMAND_REBOOT); break; - case GRUB_ARCH_MACHINE_YEELOONG_3A: - grub_millisleep (1); - grub_outb (0x4e, GRUB_MACHINE_PCI_IO_BASE_3A | 0x66); - grub_millisleep (1); - grub_outb (1, GRUB_MACHINE_PCI_IO_BASE_3A | 0x62); - grub_millisleep (5000); + case VasEBoot_ARCH_MACHINE_YEELOONG_3A: + VasEBoot_millisleep (1); + VasEBoot_outb (0x4e, VasEBoot_MACHINE_PCI_IO_BASE_3A | 0x66); + VasEBoot_millisleep (1); + VasEBoot_outb (1, VasEBoot_MACHINE_PCI_IO_BASE_3A | 0x62); + VasEBoot_millisleep (5000); } - grub_millisleep (1500); + VasEBoot_millisleep (1500); - grub_puts_ (N_("Reboot failed")); - grub_refresh (); + VasEBoot_puts_ (N_("Reboot failed")); + VasEBoot_refresh (); while (1); } diff --git a/VasEBoot-core/lib/mips/qemu_mips/reboot.c b/VasEBoot-core/lib/mips/qemu_mips/reboot.c index ba0f6ac3c..43a73019c 100644 --- a/VasEBoot-core/lib/mips/qemu_mips/reboot.c +++ b/VasEBoot-core/lib/mips/qemu_mips/reboot.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - grub_outl (42, 0xbfbf0000); + VasEBoot_outl (42, 0xbfbf0000); while (1); } diff --git a/VasEBoot-core/lib/mips/relocator.c b/VasEBoot-core/lib/mips/relocator.c index 9d5f49cb9..73d802572 100644 --- a/VasEBoot-core/lib/mips/relocator.c +++ b/VasEBoot-core/lib/mips/relocator.c @@ -1,130 +1,130 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include /* Do we need mips64? */ -extern grub_uint8_t grub_relocator_forward_start; -extern grub_uint8_t grub_relocator_forward_end; -extern grub_uint8_t grub_relocator_backward_start; -extern grub_uint8_t grub_relocator_backward_end; +extern VasEBoot_uint8_t VasEBoot_relocator_forward_start; +extern VasEBoot_uint8_t VasEBoot_relocator_forward_end; +extern VasEBoot_uint8_t VasEBoot_relocator_backward_start; +extern VasEBoot_uint8_t VasEBoot_relocator_backward_end; -#define REGW_SIZEOF (2 * sizeof (grub_uint32_t)) -#define JUMP_SIZEOF (2 * sizeof (grub_uint32_t)) +#define REGW_SIZEOF (2 * sizeof (VasEBoot_uint32_t)) +#define JUMP_SIZEOF (2 * sizeof (VasEBoot_uint32_t)) -#define RELOCATOR_SRC_SIZEOF(x) (&grub_relocator_##x##_end \ - - &grub_relocator_##x##_start) +#define RELOCATOR_SRC_SIZEOF(x) (&VasEBoot_relocator_##x##_end \ + - &VasEBoot_relocator_##x##_start) #define RELOCATOR_SIZEOF(x) (RELOCATOR_SRC_SIZEOF(x) \ + REGW_SIZEOF * 3) -grub_size_t grub_relocator_align = sizeof (grub_uint32_t); -grub_size_t grub_relocator_forward_size; -grub_size_t grub_relocator_backward_size; -grub_size_t grub_relocator_jumper_size = JUMP_SIZEOF + REGW_SIZEOF; +VasEBoot_size_t VasEBoot_relocator_align = sizeof (VasEBoot_uint32_t); +VasEBoot_size_t VasEBoot_relocator_forward_size; +VasEBoot_size_t VasEBoot_relocator_backward_size; +VasEBoot_size_t VasEBoot_relocator_jumper_size = JUMP_SIZEOF + REGW_SIZEOF; void -grub_cpu_relocator_init (void) +VasEBoot_cpu_relocator_init (void) { - grub_relocator_forward_size = RELOCATOR_SIZEOF(forward); - grub_relocator_backward_size = RELOCATOR_SIZEOF(backward); + VasEBoot_relocator_forward_size = RELOCATOR_SIZEOF(forward); + VasEBoot_relocator_backward_size = RELOCATOR_SIZEOF(backward); } static void -write_reg (int regn, grub_uint32_t val, void **target) +write_reg (int regn, VasEBoot_uint32_t val, void **target) { /* lui $r, (val+0x8000). */ - *(grub_uint32_t *) *target = ((0x3c00 | regn) << 16) | ((val + 0x8000) >> 16); - *target = ((grub_uint32_t *) *target) + 1; + *(VasEBoot_uint32_t *) *target = ((0x3c00 | regn) << 16) | ((val + 0x8000) >> 16); + *target = ((VasEBoot_uint32_t *) *target) + 1; /* addiu $r, $r, val. */ - *(grub_uint32_t *) *target = (((0x2400 | regn << 5 | regn) << 16) + *(VasEBoot_uint32_t *) *target = (((0x2400 | regn << 5 | regn) << 16) | (val & 0xffff)); - *target = ((grub_uint32_t *) *target) + 1; + *target = ((VasEBoot_uint32_t *) *target) + 1; } static void write_jump (int regn, void **target) { /* j $r. */ - *(grub_uint32_t *) *target = (regn<<21) | 0x8; - *target = ((grub_uint32_t *) *target) + 1; + *(VasEBoot_uint32_t *) *target = (regn<<21) | 0x8; + *target = ((VasEBoot_uint32_t *) *target) + 1; /* nop. */ - *(grub_uint32_t *) *target = 0; - *target = ((grub_uint32_t *) *target) + 1; + *(VasEBoot_uint32_t *) *target = 0; + *target = ((VasEBoot_uint32_t *) *target) + 1; } void -grub_cpu_relocator_jumper (void *rels, grub_addr_t addr) +VasEBoot_cpu_relocator_jumper (void *rels, VasEBoot_addr_t addr) { write_reg (1, addr, &rels); write_jump (1, &rels); } void -grub_cpu_relocator_backward (void *ptr0, void *src, void *dest, - grub_size_t size) +VasEBoot_cpu_relocator_backward (void *ptr0, void *src, void *dest, + VasEBoot_size_t size) { void *ptr = ptr0; - write_reg (8, (grub_uint32_t) src, &ptr); - write_reg (9, (grub_uint32_t) dest, &ptr); - write_reg (10, (grub_uint32_t) size, &ptr); - grub_memcpy (ptr, &grub_relocator_backward_start, + write_reg (8, (VasEBoot_uint32_t) src, &ptr); + write_reg (9, (VasEBoot_uint32_t) dest, &ptr); + write_reg (10, (VasEBoot_uint32_t) size, &ptr); + VasEBoot_memcpy (ptr, &VasEBoot_relocator_backward_start, RELOCATOR_SRC_SIZEOF (backward)); } void -grub_cpu_relocator_forward (void *ptr0, void *src, void *dest, - grub_size_t size) +VasEBoot_cpu_relocator_forward (void *ptr0, void *src, void *dest, + VasEBoot_size_t size) { void *ptr = ptr0; - write_reg (8, (grub_uint32_t) src, &ptr); - write_reg (9, (grub_uint32_t) dest, &ptr); - write_reg (10, (grub_uint32_t) size, &ptr); - grub_memcpy (ptr, &grub_relocator_forward_start, + write_reg (8, (VasEBoot_uint32_t) src, &ptr); + write_reg (9, (VasEBoot_uint32_t) dest, &ptr); + write_reg (10, (VasEBoot_uint32_t) size, &ptr); + VasEBoot_memcpy (ptr, &VasEBoot_relocator_forward_start, RELOCATOR_SRC_SIZEOF (forward)); } -grub_err_t -grub_relocator32_boot (struct grub_relocator *rel, - struct grub_relocator32_state state) +VasEBoot_err_t +VasEBoot_relocator32_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator32_state state) { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; void *ptr; - grub_err_t err; + VasEBoot_err_t err; void *relst; - grub_size_t relsize; - grub_size_t stateset_size = 31 * REGW_SIZEOF + JUMP_SIZEOF; + VasEBoot_size_t relsize; + VasEBoot_size_t stateset_size = 31 * REGW_SIZEOF + JUMP_SIZEOF; unsigned i; - grub_addr_t vtarget; + VasEBoot_addr_t vtarget; - err = grub_relocator_alloc_chunk_align (rel, &ch, 0, + err = VasEBoot_relocator_alloc_chunk_align (rel, &ch, 0, (0xffffffff - stateset_size) + 1, stateset_size, - sizeof (grub_uint32_t), - GRUB_RELOCATOR_PREFERENCE_NONE, 0); + sizeof (VasEBoot_uint32_t), + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; @@ -133,17 +133,17 @@ grub_relocator32_boot (struct grub_relocator *rel, write_reg (i, state.gpr[i], &ptr); write_jump (state.jumpreg, &ptr); - vtarget = (grub_addr_t) grub_map_memory (get_physical_target_address (ch), + vtarget = (VasEBoot_addr_t) VasEBoot_map_memory (get_physical_target_address (ch), stateset_size); - err = grub_relocator_prepare_relocs (rel, vtarget, &relst, &relsize); + err = VasEBoot_relocator_prepare_relocs (rel, vtarget, &relst, &relsize); if (err) return err; - grub_arch_sync_caches ((void *) relst, relsize); + VasEBoot_arch_sync_caches ((void *) relst, relsize); ((void (*) (void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/mips/relocator_asm.S b/VasEBoot-core/lib/mips/relocator_asm.S index 1d142a4f3..861f97b35 100644 --- a/VasEBoot-core/lib/mips/relocator_asm.S +++ b/VasEBoot-core/lib/mips/relocator_asm.S @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .p2align 4 /* force 16-byte alignment */ .set noreorder .set nomacro -VARIABLE (grub_relocator_forward_start) +VARIABLE (VasEBoot_relocator_forward_start) move $a0, $9 move $a1, $10 @@ -37,9 +37,9 @@ copycont1: #include "../../kern/mips/cache_flush.S" -VARIABLE (grub_relocator_forward_end) +VARIABLE (VasEBoot_relocator_forward_end) -VARIABLE (grub_relocator_backward_start) +VARIABLE (VasEBoot_relocator_backward_start) move $a0, $9 move $a1, $10 @@ -58,4 +58,4 @@ copycont2: #include "../../kern/mips/cache_flush.S" -VARIABLE (grub_relocator_backward_end) +VARIABLE (VasEBoot_relocator_backward_end) diff --git a/VasEBoot-core/lib/mips/setjmp.S b/VasEBoot-core/lib/mips/setjmp.S index 895235b78..528224d88 100644 --- a/VasEBoot-core/lib/mips/setjmp.S +++ b/VasEBoot-core/lib/mips/setjmp.S @@ -1,67 +1,67 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .text /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) - GRUB_ASM_REG_S $s0, 0($a0) - GRUB_ASM_REG_S $s1, 8($a0) - GRUB_ASM_REG_S $s2, 16($a0) - GRUB_ASM_REG_S $s3, 24($a0) - GRUB_ASM_REG_S $s4, 32($a0) - GRUB_ASM_REG_S $s5, 40($a0) - GRUB_ASM_REG_S $s6, 48($a0) - GRUB_ASM_REG_S $s7, 56($a0) - GRUB_ASM_REG_S $s8, 64($a0) - GRUB_ASM_REG_S $gp, 72($a0) - GRUB_ASM_REG_S $sp, 80($a0) - GRUB_ASM_REG_S $ra, 88($a0) +FUNCTION(VasEBoot_setjmp) + VasEBoot_ASM_REG_S $s0, 0($a0) + VasEBoot_ASM_REG_S $s1, 8($a0) + VasEBoot_ASM_REG_S $s2, 16($a0) + VasEBoot_ASM_REG_S $s3, 24($a0) + VasEBoot_ASM_REG_S $s4, 32($a0) + VasEBoot_ASM_REG_S $s5, 40($a0) + VasEBoot_ASM_REG_S $s6, 48($a0) + VasEBoot_ASM_REG_S $s7, 56($a0) + VasEBoot_ASM_REG_S $s8, 64($a0) + VasEBoot_ASM_REG_S $gp, 72($a0) + VasEBoot_ASM_REG_S $sp, 80($a0) + VasEBoot_ASM_REG_S $ra, 88($a0) move $v0, $zero move $v1, $zero jr $ra nop /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) - GRUB_ASM_REG_L $s0, 0($a0) - GRUB_ASM_REG_L $s1, 8($a0) - GRUB_ASM_REG_L $s2, 16($a0) - GRUB_ASM_REG_L $s3, 24($a0) - GRUB_ASM_REG_L $s4, 32($a0) - GRUB_ASM_REG_L $s5, 40($a0) - GRUB_ASM_REG_L $s6, 48($a0) - GRUB_ASM_REG_L $s7, 56($a0) - GRUB_ASM_REG_L $s8, 64($a0) - GRUB_ASM_REG_L $gp, 72($a0) - GRUB_ASM_REG_L $sp, 80($a0) - GRUB_ASM_REG_L $ra, 88($a0) +FUNCTION(VasEBoot_longjmp) + VasEBoot_ASM_REG_L $s0, 0($a0) + VasEBoot_ASM_REG_L $s1, 8($a0) + VasEBoot_ASM_REG_L $s2, 16($a0) + VasEBoot_ASM_REG_L $s3, 24($a0) + VasEBoot_ASM_REG_L $s4, 32($a0) + VasEBoot_ASM_REG_L $s5, 40($a0) + VasEBoot_ASM_REG_L $s6, 48($a0) + VasEBoot_ASM_REG_L $s7, 56($a0) + VasEBoot_ASM_REG_L $s8, 64($a0) + VasEBoot_ASM_REG_L $gp, 72($a0) + VasEBoot_ASM_REG_L $sp, 80($a0) + VasEBoot_ASM_REG_L $ra, 88($a0) move $v0, $a1 bne $v0, $zero, 1f addiu $v0, $v0, 1 diff --git a/VasEBoot-core/lib/pbkdf2.c b/VasEBoot-core/lib/pbkdf2.c index 28aa96c46..7e32343ef 100644 --- a/VasEBoot-core/lib/pbkdf2.c +++ b/VasEBoot-core/lib/pbkdf2.c @@ -18,12 +18,12 @@ /* Written by Simon Josefsson. */ /* Imported from gnulib. */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv2+"); +VasEBoot_MOD_LICENSE ("GPLv2+"); /* Implement PKCS#5 PBKDF2 as per RFC 2898. The PRF to use is HMAC variant of digest supplied by MD. Inputs are the password P of length PLEN, @@ -33,25 +33,25 @@ GRUB_MOD_LICENSE ("GPLv2+"); be filled with the derived data. */ gcry_err_code_t -grub_crypto_pbkdf2 (const struct gcry_md_spec *md, - const grub_uint8_t *P, grub_size_t Plen, - const grub_uint8_t *S, grub_size_t Slen, +VasEBoot_crypto_pbkdf2 (const struct gcry_md_spec *md, + const VasEBoot_uint8_t *P, VasEBoot_size_t Plen, + const VasEBoot_uint8_t *S, VasEBoot_size_t Slen, unsigned int c, - grub_uint8_t *DK, grub_size_t dkLen) + VasEBoot_uint8_t *DK, VasEBoot_size_t dkLen) { unsigned int hLen = md->mdlen; - grub_uint8_t U[GRUB_CRYPTO_MAX_MDLEN]; - grub_uint8_t T[GRUB_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t U[VasEBoot_CRYPTO_MAX_MDLEN]; + VasEBoot_uint8_t T[VasEBoot_CRYPTO_MAX_MDLEN]; unsigned int u; unsigned int l; unsigned int r; unsigned int i; unsigned int k; gcry_err_code_t rc; - grub_uint8_t *tmp; - grub_size_t tmplen = Slen + 4; + VasEBoot_uint8_t *tmp; + VasEBoot_size_t tmplen = Slen + 4; - if (md->mdlen > GRUB_CRYPTO_MAX_MDLEN || md->mdlen == 0) + if (md->mdlen > VasEBoot_CRYPTO_MAX_MDLEN || md->mdlen == 0) return GPG_ERR_INV_ARG; if (c == 0) @@ -66,15 +66,15 @@ grub_crypto_pbkdf2 (const struct gcry_md_spec *md, l = ((dkLen - 1) / hLen) + 1; r = dkLen - (l - 1) * hLen; - tmp = grub_malloc (tmplen); + tmp = VasEBoot_malloc (tmplen); if (tmp == NULL) return GPG_ERR_OUT_OF_MEMORY; - grub_memcpy (tmp, S, Slen); + VasEBoot_memcpy (tmp, S, Slen); for (i = 1; i - 1 < l; i++) { - grub_memset (T, 0, hLen); + VasEBoot_memset (T, 0, hLen); for (u = 0; u < c; u++) { @@ -85,14 +85,14 @@ grub_crypto_pbkdf2 (const struct gcry_md_spec *md, tmp[Slen + 2] = (i & 0x0000ff00) >> 8; tmp[Slen + 3] = (i & 0x000000ff) >> 0; - rc = grub_crypto_hmac_buffer (md, P, Plen, tmp, tmplen, U); + rc = VasEBoot_crypto_hmac_buffer (md, P, Plen, tmp, tmplen, U); } else - rc = grub_crypto_hmac_buffer (md, P, Plen, U, hLen, U); + rc = VasEBoot_crypto_hmac_buffer (md, P, Plen, U, hLen, U); if (rc != GPG_ERR_NO_ERROR) { - grub_free (tmp); + VasEBoot_free (tmp); return rc; } @@ -100,10 +100,10 @@ grub_crypto_pbkdf2 (const struct gcry_md_spec *md, T[k] ^= U[k]; } - grub_memcpy (DK + (i - 1) * hLen, T, i == l ? r : hLen); + VasEBoot_memcpy (DK + (i - 1) * hLen, T, i == l ? r : hLen); } - grub_free (tmp); + VasEBoot_free (tmp); return GPG_ERR_NO_ERROR; } diff --git a/VasEBoot-core/lib/posix_wrap/assert.h b/VasEBoot-core/lib/posix_wrap/assert.h index 6b00a0ba3..bfd93f743 100644 --- a/VasEBoot-core/lib/posix_wrap/assert.h +++ b/VasEBoot-core/lib/posix_wrap/assert.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_ASSERT_H -#define GRUB_POSIX_ASSERT_H 1 +#ifndef VasEBoot_POSIX_ASSERT_H +#define VasEBoot_POSIX_ASSERT_H 1 -#include +#include #define assert(x) assert_real(__FILE__, __LINE__, x) @@ -27,7 +27,7 @@ static inline void assert_real (const char *file, int line, int cond) { if (!cond) - grub_printf ("Assertion failed at %s:%d\n", file, line); + VasEBoot_printf ("Assertion failed at %s:%d\n", file, line); } #endif diff --git a/VasEBoot-core/lib/posix_wrap/ctype.h b/VasEBoot-core/lib/posix_wrap/ctype.h index 38b572703..fe7d9a3fe 100644 --- a/VasEBoot-core/lib/posix_wrap/ctype.h +++ b/VasEBoot-core/lib/posix_wrap/ctype.h @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_CTYPE_H -#define GRUB_POSIX_CTYPE_H 1 +#ifndef VasEBoot_POSIX_CTYPE_H +#define VasEBoot_POSIX_CTYPE_H 1 -#include +#include static inline int toupper (int c) { - return grub_toupper (c); + return VasEBoot_toupper (c); } static inline int isspace (int c) { - return grub_isspace (c); + return VasEBoot_isspace (c); } static inline int isdigit (int c) { - return grub_isdigit (c); + return VasEBoot_isdigit (c); } static inline int islower (int c) { - return grub_islower (c); + return VasEBoot_islower (c); } static inline int @@ -54,55 +54,55 @@ isascii (int c) static inline int isupper (int c) { - return grub_isupper (c); + return VasEBoot_isupper (c); } static inline int isxdigit (int c) { - return grub_isxdigit (c); + return VasEBoot_isxdigit (c); } static inline int isprint (int c) { - return grub_isprint (c); + return VasEBoot_isprint (c); } static inline int iscntrl (int c) { - return !grub_isprint (c); + return !VasEBoot_isprint (c); } static inline int isgraph (int c) { - return grub_isprint (c) && !grub_isspace (c); + return VasEBoot_isprint (c) && !VasEBoot_isspace (c); } static inline int isalnum (int c) { - return grub_isalpha (c) || grub_isdigit (c); + return VasEBoot_isalpha (c) || VasEBoot_isdigit (c); } static inline int ispunct (int c) { - return grub_isprint (c) && !grub_isspace (c) && !isalnum (c); + return VasEBoot_isprint (c) && !VasEBoot_isspace (c) && !isalnum (c); } static inline int isalpha (int c) { - return grub_isalpha (c); + return VasEBoot_isalpha (c); } static inline int tolower (int c) { - return grub_tolower (c); + return VasEBoot_tolower (c); } #endif diff --git a/VasEBoot-core/lib/posix_wrap/errno.h b/VasEBoot-core/lib/posix_wrap/errno.h index ba63b2366..799a3009a 100644 --- a/VasEBoot-core/lib/posix_wrap/errno.h +++ b/VasEBoot-core/lib/posix_wrap/errno.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_ERRNO_H -#define GRUB_POSIX_ERRNO_H 1 +#ifndef VasEBoot_POSIX_ERRNO_H +#define VasEBoot_POSIX_ERRNO_H 1 -#include +#include #undef errno -#define errno grub_errno -#define EINVAL GRUB_ERR_BAD_NUMBER -#define ENOMEM GRUB_ERR_OUT_OF_MEMORY +#define errno VasEBoot_errno +#define EINVAL VasEBoot_ERR_BAD_NUMBER +#define ENOMEM VasEBoot_ERR_OUT_OF_MEMORY #endif diff --git a/VasEBoot-core/lib/posix_wrap/langinfo.h b/VasEBoot-core/lib/posix_wrap/langinfo.h index ab75af15d..f04420199 100644 --- a/VasEBoot-core/lib/posix_wrap/langinfo.h +++ b/VasEBoot-core/lib/posix_wrap/langinfo.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_LANGINFO_H -#define GRUB_POSIX_LANGINFO_H 1 +#ifndef VasEBoot_POSIX_LANGINFO_H +#define VasEBoot_POSIX_LANGINFO_H 1 #include diff --git a/VasEBoot-core/lib/posix_wrap/limits.h b/VasEBoot-core/lib/posix_wrap/limits.h index 955295403..fe60476a6 100644 --- a/VasEBoot-core/lib/posix_wrap/limits.h +++ b/VasEBoot-core/lib/posix_wrap/limits.h @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_LIMITS_H -#define GRUB_POSIX_LIMITS_H +#ifndef VasEBoot_POSIX_LIMITS_H +#define VasEBoot_POSIX_LIMITS_H -#include +#include -#define UCHAR_MAX GRUB_UCHAR_MAX -#define USHRT_MAX GRUB_USHRT_MAX -#define UINT_MAX GRUB_UINT_MAX -#define ULONG_MAX GRUB_ULONG_MAX -#define SIZE_MAX GRUB_SIZE_MAX +#define UCHAR_MAX VasEBoot_UCHAR_MAX +#define USHRT_MAX VasEBoot_USHRT_MAX +#define UINT_MAX VasEBoot_UINT_MAX +#define ULONG_MAX VasEBoot_ULONG_MAX +#define SIZE_MAX VasEBoot_SIZE_MAX -#define SHRT_MAX GRUB_SHRT_MAX -#define INT_MAX GRUB_INT_MAX +#define SHRT_MAX VasEBoot_SHRT_MAX +#define INT_MAX VasEBoot_INT_MAX #define CHAR_BIT 8 diff --git a/VasEBoot-core/lib/posix_wrap/localcharset.h b/VasEBoot-core/lib/posix_wrap/localcharset.h index 502d86066..2cc2adf03 100644 --- a/VasEBoot-core/lib/posix_wrap/localcharset.h +++ b/VasEBoot-core/lib/posix_wrap/localcharset.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_LOCALCHARSET_H -#define GRUB_POSIX_LOCALCHARSET_H 1 +#ifndef VasEBoot_POSIX_LOCALCHARSET_H +#define VasEBoot_POSIX_LOCALCHARSET_H 1 static inline const char * locale_charset (void) diff --git a/VasEBoot-core/lib/posix_wrap/locale.h b/VasEBoot-core/lib/posix_wrap/locale.h index 569a76517..405fdd616 100644 --- a/VasEBoot-core/lib/posix_wrap/locale.h +++ b/VasEBoot-core/lib/posix_wrap/locale.h @@ -1,3 +1,3 @@ -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL #include_next #endif diff --git a/VasEBoot-core/lib/posix_wrap/stdio.h b/VasEBoot-core/lib/posix_wrap/stdio.h index d5a8b7503..2faaec3cd 100644 --- a/VasEBoot-core/lib/posix_wrap/stdio.h +++ b/VasEBoot-core/lib/posix_wrap/stdio.h @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_STDIO_H -#define GRUB_POSIX_STDIO_H 1 +#ifndef VasEBoot_POSIX_STDIO_H +#define VasEBoot_POSIX_STDIO_H 1 -#include -#include +#include +#include #include -typedef struct grub_file FILE; +typedef struct VasEBoot_file FILE; #define EOF -1 static inline int -snprintf (char *str, grub_size_t n, const char *fmt, ...) +snprintf (char *str, VasEBoot_size_t n, const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); - ret = grub_vsnprintf (str, n, fmt, ap); + ret = VasEBoot_vsnprintf (str, n, fmt, ap); va_end (ap); return ret; diff --git a/VasEBoot-core/lib/posix_wrap/stdlib.h b/VasEBoot-core/lib/posix_wrap/stdlib.h index 3b46f47ff..cb53c6c5b 100644 --- a/VasEBoot-core/lib/posix_wrap/stdlib.h +++ b/VasEBoot-core/lib/posix_wrap/stdlib.h @@ -1,49 +1,49 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_STDLIB_H -#define GRUB_POSIX_STDLIB_H 1 +#ifndef VasEBoot_POSIX_STDLIB_H +#define VasEBoot_POSIX_STDLIB_H 1 -#include -#include +#include +#include static inline void free (void *ptr) { - grub_free (ptr); + VasEBoot_free (ptr); } static inline void * -malloc (grub_size_t size) +malloc (VasEBoot_size_t size) { - return grub_malloc (size); + return VasEBoot_malloc (size); } static inline void * -calloc (grub_size_t size, grub_size_t nelem) +calloc (VasEBoot_size_t size, VasEBoot_size_t nelem) { - return grub_zalloc (size * nelem); + return VasEBoot_zalloc (size * nelem); } static inline void * -realloc (void *ptr, grub_size_t size) +realloc (void *ptr, VasEBoot_size_t size) { - return grub_realloc (ptr, size); + return VasEBoot_realloc (ptr, size); } static inline int diff --git a/VasEBoot-core/lib/posix_wrap/string.h b/VasEBoot-core/lib/posix_wrap/string.h index 7ae6eee97..0baebb766 100644 --- a/VasEBoot-core/lib/posix_wrap/string.h +++ b/VasEBoot-core/lib/posix_wrap/string.h @@ -1,92 +1,92 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_STRING_H -#define GRUB_POSIX_STRING_H 1 +#ifndef VasEBoot_POSIX_STRING_H +#define VasEBoot_POSIX_STRING_H 1 -#include +#include #include #define HAVE_STRCASECMP 1 -static inline grub_size_t +static inline VasEBoot_size_t strlen (const char *s) { - return grub_strlen (s); + return VasEBoot_strlen (s); } static inline int strcmp (const char *s1, const char *s2) { - return grub_strcmp (s1, s2); + return VasEBoot_strcmp (s1, s2); } static inline int strcasecmp (const char *s1, const char *s2) { - return grub_strcasecmp (s1, s2); + return VasEBoot_strcasecmp (s1, s2); } static inline void -bcopy (const void *src, void *dest, grub_size_t n) +bcopy (const void *src, void *dest, VasEBoot_size_t n) { - grub_memcpy (dest, src, n); + VasEBoot_memcpy (dest, src, n); } static inline char * strcpy (char *dest, const char *src) { - return grub_strcpy (dest, src); + return VasEBoot_strcpy (dest, src); } static inline char * strstr (const char *haystack, const char *needle) { - return grub_strstr (haystack, needle); + return VasEBoot_strstr (haystack, needle); } static inline char * strchr (const char *s, int c) { - return grub_strchr (s, c); + return VasEBoot_strchr (s, c); } static inline char * -strncpy (char *dest, const char *src, grub_size_t n) +strncpy (char *dest, const char *src, VasEBoot_size_t n) { - return grub_strncpy (dest, src, n); + return VasEBoot_strncpy (dest, src, n); } static inline int strcoll (const char *s1, const char *s2) { - return grub_strcmp (s1, s2); + return VasEBoot_strcmp (s1, s2); } static inline void * -memchr (const void *s, int c, grub_size_t n) +memchr (const void *s, int c, VasEBoot_size_t n) { - return grub_memchr (s, c, n); + return VasEBoot_memchr (s, c, n); } -#define memcmp grub_memcmp -#define memcpy grub_memcpy -#define memmove grub_memmove -#define memset grub_memset +#define memcmp VasEBoot_memcmp +#define memcpy VasEBoot_memcpy +#define memmove VasEBoot_memmove +#define memset VasEBoot_memset #endif diff --git a/VasEBoot-core/lib/posix_wrap/sys/types.h b/VasEBoot-core/lib/posix_wrap/sys/types.h index 854eb0122..9772ccf42 100644 --- a/VasEBoot-core/lib/posix_wrap/sys/types.h +++ b/VasEBoot-core/lib/posix_wrap/sys/types.h @@ -1,62 +1,62 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_SYS_TYPES_H -#define GRUB_POSIX_SYS_TYPES_H 1 +#ifndef VasEBoot_POSIX_SYS_TYPES_H +#define VasEBoot_POSIX_SYS_TYPES_H 1 -#include +#include #include -typedef grub_ssize_t ssize_t; -#ifndef GRUB_POSIX_BOOL_DEFINED +typedef VasEBoot_ssize_t ssize_t; +#ifndef VasEBoot_POSIX_BOOL_DEFINED typedef enum { false = 0, true = 1 } bool; -#define GRUB_POSIX_BOOL_DEFINED 1 +#define VasEBoot_POSIX_BOOL_DEFINED 1 #endif -typedef grub_uint8_t uint8_t; -typedef grub_uint16_t uint16_t; -typedef grub_uint32_t uint32_t; -typedef grub_uint64_t uint64_t; +typedef VasEBoot_uint8_t uint8_t; +typedef VasEBoot_uint16_t uint16_t; +typedef VasEBoot_uint32_t uint32_t; +typedef VasEBoot_uint64_t uint64_t; -typedef grub_int8_t int8_t; -typedef grub_int16_t int16_t; -typedef grub_int32_t int32_t; -typedef grub_int64_t int64_t; +typedef VasEBoot_int8_t int8_t; +typedef VasEBoot_int16_t int16_t; +typedef VasEBoot_int32_t int32_t; +typedef VasEBoot_int64_t int64_t; #define HAVE_U64_TYPEDEF 1 -typedef grub_uint64_t u64; +typedef VasEBoot_uint64_t u64; #define HAVE_U32_TYPEDEF 1 -typedef grub_uint32_t u32; +typedef VasEBoot_uint32_t u32; #define HAVE_U16_TYPEDEF 1 -typedef grub_uint16_t u16; +typedef VasEBoot_uint16_t u16; #define HAVE_BYTE_TYPEDEF 1 -typedef grub_uint8_t byte; +typedef VasEBoot_uint8_t byte; -typedef grub_addr_t uintptr_t; +typedef VasEBoot_addr_t uintptr_t; -#define SIZEOF_UNSIGNED_LONG GRUB_CPU_SIZEOF_LONG +#define SIZEOF_UNSIGNED_LONG VasEBoot_CPU_SIZEOF_LONG #define SIZEOF_UNSIGNED_INT 4 #define SIZEOF_UNSIGNED_LONG_LONG 8 #define SIZEOF_UNSIGNED_SHORT 2 #define SIZEOF_UINT64_T 8 -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN #define WORDS_BIGENDIAN 1 #else #undef WORDS_BIGENDIAN diff --git a/VasEBoot-core/lib/posix_wrap/wchar.h b/VasEBoot-core/lib/posix_wrap/wchar.h index e0e04a6a0..b579a11b1 100644 --- a/VasEBoot-core/lib/posix_wrap/wchar.h +++ b/VasEBoot-core/lib/posix_wrap/wchar.h @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_WCHAR_H -#define GRUB_POSIX_WCHAR_H 1 +#ifndef VasEBoot_POSIX_WCHAR_H +#define VasEBoot_POSIX_WCHAR_H 1 -#include +#include -#define wint_t grub_posix_wint_t -#define wchar_t grub_posix_wchar_t -#define mbstate_t grub_posix_mbstate_t +#define wint_t VasEBoot_posix_wint_t +#define wchar_t VasEBoot_posix_wchar_t +#define mbstate_t VasEBoot_posix_mbstate_t /* UCS-4. */ -typedef grub_int32_t wint_t; +typedef VasEBoot_int32_t wint_t; enum { WEOF = -1 }; /* UCS-4. */ -typedef grub_int32_t wchar_t; +typedef VasEBoot_int32_t wchar_t; typedef struct mbstate { - grub_uint32_t code; + VasEBoot_uint32_t code; int count; } mbstate_t; @@ -60,7 +60,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) for (ptr = s; ptr < s + n; ptr++) { - if (!grub_utf8_process (*ptr, &ps->code, &ps->count)) + if (!VasEBoot_utf8_process (*ptr, &ps->code, &ps->count)) return -1; if (ps->count) continue; @@ -84,8 +84,8 @@ wcrtomb (char *s, wchar_t wc, mbstate_t *ps __attribute__ ((unused))) { if (s == 0) return 1; - return grub_encode_utf8_character ((grub_uint8_t *) s, - (grub_uint8_t *) s + MB_LEN_MAX, + return VasEBoot_encode_utf8_character ((VasEBoot_uint8_t *) s, + (VasEBoot_uint8_t *) s + MB_LEN_MAX, wc); } diff --git a/VasEBoot-core/lib/posix_wrap/wctype.h b/VasEBoot-core/lib/posix_wrap/wctype.h index 3771dc5cb..75979b308 100644 --- a/VasEBoot-core/lib/posix_wrap/wctype.h +++ b/VasEBoot-core/lib/posix_wrap/wctype.h @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_POSIX_WCTYPE_H -#define GRUB_POSIX_WCTYPE_H 1 +#ifndef VasEBoot_POSIX_WCTYPE_H +#define VasEBoot_POSIX_WCTYPE_H 1 -#include +#include #include -#define wctype_t grub_posix_wctype_t +#define wctype_t VasEBoot_posix_wctype_t -typedef enum { GRUB_CTYPE_INVALID, - GRUB_CTYPE_ALNUM, GRUB_CTYPE_CNTRL, GRUB_CTYPE_LOWER, - GRUB_CTYPE_SPACE, GRUB_CTYPE_ALPHA, GRUB_CTYPE_DIGIT, - GRUB_CTYPE_PRINT, GRUB_CTYPE_UPPER, GRUB_CTYPE_BLANK, - GRUB_CTYPE_GRAPH, GRUB_CTYPE_PUNCT, GRUB_CTYPE_XDIGIT, - GRUB_CTYPE_MAX} wctype_t; +typedef enum { VasEBoot_CTYPE_INVALID, + VasEBoot_CTYPE_ALNUM, VasEBoot_CTYPE_CNTRL, VasEBoot_CTYPE_LOWER, + VasEBoot_CTYPE_SPACE, VasEBoot_CTYPE_ALPHA, VasEBoot_CTYPE_DIGIT, + VasEBoot_CTYPE_PRINT, VasEBoot_CTYPE_UPPER, VasEBoot_CTYPE_BLANK, + VasEBoot_CTYPE_GRAPH, VasEBoot_CTYPE_PUNCT, VasEBoot_CTYPE_XDIGIT, + VasEBoot_CTYPE_MAX} wctype_t; #define CHARCLASS_NAME_MAX (sizeof ("xdigit") - 1) @@ -42,35 +42,35 @@ wctype (const char *name) "space", "alpha", "digit", "print", "upper", "blank", "graph", "punct", "xdigit" }; - for (i = GRUB_CTYPE_INVALID; i < GRUB_CTYPE_MAX; i++) - if (grub_strcmp (names[i], name) == 0) + for (i = VasEBoot_CTYPE_INVALID; i < VasEBoot_CTYPE_MAX; i++) + if (VasEBoot_strcmp (names[i], name) == 0) return i; - return GRUB_CTYPE_INVALID; + return VasEBoot_CTYPE_INVALID; } /* FIXME: take into account international lowercase characters. */ static inline int iswlower (wint_t wc) { - return grub_islower (wc); + return VasEBoot_islower (wc); } static inline wint_t towlower (wint_t c) { - return grub_tolower (c); + return VasEBoot_tolower (c); } static inline wint_t towupper (wint_t c) { - return grub_toupper (c); + return VasEBoot_toupper (c); } static inline int iswalnum (wint_t c) { - return grub_isalpha (c) || grub_isdigit (c); + return VasEBoot_isalpha (c) || VasEBoot_isdigit (c); } static inline int @@ -78,30 +78,30 @@ iswctype (wint_t wc, wctype_t desc) { switch (desc) { - case GRUB_CTYPE_ALNUM: + case VasEBoot_CTYPE_ALNUM: return iswalnum (wc); - case GRUB_CTYPE_CNTRL: - return grub_iscntrl (wc); - case GRUB_CTYPE_LOWER: + case VasEBoot_CTYPE_CNTRL: + return VasEBoot_iscntrl (wc); + case VasEBoot_CTYPE_LOWER: return iswlower (wc); - case GRUB_CTYPE_SPACE: - return grub_isspace (wc); - case GRUB_CTYPE_ALPHA: - return grub_isalpha (wc); - case GRUB_CTYPE_DIGIT: - return grub_isdigit (wc); - case GRUB_CTYPE_PRINT: - return grub_isprint (wc); - case GRUB_CTYPE_UPPER: - return grub_isupper (wc); - case GRUB_CTYPE_BLANK: + case VasEBoot_CTYPE_SPACE: + return VasEBoot_isspace (wc); + case VasEBoot_CTYPE_ALPHA: + return VasEBoot_isalpha (wc); + case VasEBoot_CTYPE_DIGIT: + return VasEBoot_isdigit (wc); + case VasEBoot_CTYPE_PRINT: + return VasEBoot_isprint (wc); + case VasEBoot_CTYPE_UPPER: + return VasEBoot_isupper (wc); + case VasEBoot_CTYPE_BLANK: return wc == ' ' || wc == '\t'; - case GRUB_CTYPE_GRAPH: - return grub_isgraph (wc); - case GRUB_CTYPE_PUNCT: - return grub_isprint (wc) && !grub_isspace (wc) && !iswalnum (wc); - case GRUB_CTYPE_XDIGIT: - return grub_isxdigit (wc); + case VasEBoot_CTYPE_GRAPH: + return VasEBoot_isgraph (wc); + case VasEBoot_CTYPE_PUNCT: + return VasEBoot_isprint (wc) && !VasEBoot_isspace (wc) && !iswalnum (wc); + case VasEBoot_CTYPE_XDIGIT: + return VasEBoot_isxdigit (wc); default: return 0; } diff --git a/VasEBoot-core/lib/powerpc/relocator.c b/VasEBoot-core/lib/powerpc/relocator.c index bdf2b111b..77b1170d5 100644 --- a/VasEBoot-core/lib/powerpc/relocator.c +++ b/VasEBoot-core/lib/powerpc/relocator.c @@ -1,125 +1,125 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include -extern grub_uint8_t grub_relocator_forward_start; -extern grub_uint8_t grub_relocator_forward_end; -extern grub_uint8_t grub_relocator_backward_start; -extern grub_uint8_t grub_relocator_backward_end; +extern VasEBoot_uint8_t VasEBoot_relocator_forward_start; +extern VasEBoot_uint8_t VasEBoot_relocator_forward_end; +extern VasEBoot_uint8_t VasEBoot_relocator_backward_start; +extern VasEBoot_uint8_t VasEBoot_relocator_backward_end; -#define REGW_SIZEOF (2 * sizeof (grub_uint32_t)) -#define JUMP_SIZEOF (sizeof (grub_uint32_t)) +#define REGW_SIZEOF (2 * sizeof (VasEBoot_uint32_t)) +#define JUMP_SIZEOF (sizeof (VasEBoot_uint32_t)) -#define RELOCATOR_SRC_SIZEOF(x) (&grub_relocator_##x##_end \ - - &grub_relocator_##x##_start) +#define RELOCATOR_SRC_SIZEOF(x) (&VasEBoot_relocator_##x##_end \ + - &VasEBoot_relocator_##x##_start) #define RELOCATOR_SIZEOF(x) (RELOCATOR_SRC_SIZEOF(x) \ + REGW_SIZEOF * 3) -grub_size_t grub_relocator_align = sizeof (grub_uint32_t); -grub_size_t grub_relocator_forward_size; -grub_size_t grub_relocator_backward_size; -grub_size_t grub_relocator_jumper_size = JUMP_SIZEOF + REGW_SIZEOF; +VasEBoot_size_t VasEBoot_relocator_align = sizeof (VasEBoot_uint32_t); +VasEBoot_size_t VasEBoot_relocator_forward_size; +VasEBoot_size_t VasEBoot_relocator_backward_size; +VasEBoot_size_t VasEBoot_relocator_jumper_size = JUMP_SIZEOF + REGW_SIZEOF; void -grub_cpu_relocator_init (void) +VasEBoot_cpu_relocator_init (void) { - grub_relocator_forward_size = RELOCATOR_SIZEOF(forward); - grub_relocator_backward_size = RELOCATOR_SIZEOF(backward); + VasEBoot_relocator_forward_size = RELOCATOR_SIZEOF(forward); + VasEBoot_relocator_backward_size = RELOCATOR_SIZEOF(backward); } static void -write_reg (int regn, grub_uint32_t val, void **target) +write_reg (int regn, VasEBoot_uint32_t val, void **target) { /* lis r, val >> 16 */ - *(grub_uint32_t *) *target = + *(VasEBoot_uint32_t *) *target = ((0x3c00 | (regn << 5)) << 16) | (val >> 16); - *target = ((grub_uint32_t *) *target) + 1; + *target = ((VasEBoot_uint32_t *) *target) + 1; /* ori r, r, val & 0xffff. */ - *(grub_uint32_t *) *target = (((0x6000 | regn << 5 | regn) << 16) + *(VasEBoot_uint32_t *) *target = (((0x6000 | regn << 5 | regn) << 16) | (val & 0xffff)); - *target = ((grub_uint32_t *) *target) + 1; + *target = ((VasEBoot_uint32_t *) *target) + 1; } static void write_jump (void **target) { /* blr. */ - *(grub_uint32_t *) *target = 0x4e800020; - *target = ((grub_uint32_t *) *target) + 1; + *(VasEBoot_uint32_t *) *target = 0x4e800020; + *target = ((VasEBoot_uint32_t *) *target) + 1; } void -grub_cpu_relocator_jumper (void *rels, grub_addr_t addr) +VasEBoot_cpu_relocator_jumper (void *rels, VasEBoot_addr_t addr) { - write_reg (GRUB_PPC_JUMP_REGISTER, addr, &rels); + write_reg (VasEBoot_PPC_JUMP_REGISTER, addr, &rels); write_jump (&rels); } void -grub_cpu_relocator_backward (void *ptr0, void *src, void *dest, - grub_size_t size) +VasEBoot_cpu_relocator_backward (void *ptr0, void *src, void *dest, + VasEBoot_size_t size) { void *ptr = ptr0; - write_reg (8, (grub_uint32_t) src, &ptr); - write_reg (9, (grub_uint32_t) dest, &ptr); - write_reg (10, (grub_uint32_t) size, &ptr); - grub_memcpy (ptr, &grub_relocator_backward_start, + write_reg (8, (VasEBoot_uint32_t) src, &ptr); + write_reg (9, (VasEBoot_uint32_t) dest, &ptr); + write_reg (10, (VasEBoot_uint32_t) size, &ptr); + VasEBoot_memcpy (ptr, &VasEBoot_relocator_backward_start, RELOCATOR_SRC_SIZEOF (backward)); } void -grub_cpu_relocator_forward (void *ptr0, void *src, void *dest, - grub_size_t size) +VasEBoot_cpu_relocator_forward (void *ptr0, void *src, void *dest, + VasEBoot_size_t size) { void *ptr = ptr0; - write_reg (8, (grub_uint32_t) src, &ptr); - write_reg (9, (grub_uint32_t) dest, &ptr); - write_reg (10, (grub_uint32_t) size, &ptr); - grub_memcpy (ptr, &grub_relocator_forward_start, + write_reg (8, (VasEBoot_uint32_t) src, &ptr); + write_reg (9, (VasEBoot_uint32_t) dest, &ptr); + write_reg (10, (VasEBoot_uint32_t) size, &ptr); + VasEBoot_memcpy (ptr, &VasEBoot_relocator_forward_start, RELOCATOR_SRC_SIZEOF (forward)); } -grub_err_t -grub_relocator32_boot (struct grub_relocator *rel, - struct grub_relocator32_state state) +VasEBoot_err_t +VasEBoot_relocator32_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator32_state state) { void *ptr; - grub_err_t err; + VasEBoot_err_t err; void *relst; - grub_size_t relsize; - grub_size_t stateset_size = 32 * REGW_SIZEOF + JUMP_SIZEOF; + VasEBoot_size_t relsize; + VasEBoot_size_t stateset_size = 32 * REGW_SIZEOF + JUMP_SIZEOF; unsigned i; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (rel, &ch, 0, + err = VasEBoot_relocator_alloc_chunk_align (rel, &ch, 0, (0xffffffff - stateset_size) + 1, stateset_size, - sizeof (grub_uint32_t), - GRUB_RELOCATOR_PREFERENCE_NONE, 0); + sizeof (VasEBoot_uint32_t), + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; @@ -128,15 +128,15 @@ grub_relocator32_boot (struct grub_relocator *rel, write_reg (i, state.gpr[i], &ptr); write_jump (&ptr); - err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + err = VasEBoot_relocator_prepare_relocs (rel, get_physical_target_address (ch), &relst, &relsize); if (err) return err; - grub_arch_sync_caches ((void *) relst, relsize); + VasEBoot_arch_sync_caches ((void *) relst, relsize); ((void (*) (void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/powerpc/relocator_asm.S b/VasEBoot-core/lib/powerpc/relocator_asm.S index 355e9c8b4..32c439d3f 100644 --- a/VasEBoot-core/lib/powerpc/relocator_asm.S +++ b/VasEBoot-core/lib/powerpc/relocator_asm.S @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include .p2align 4 /* force 16-byte alignment */ -VARIABLE (grub_relocator_forward_start) +VARIABLE (VasEBoot_relocator_forward_start) mr 3, 9 mr 4, 10 @@ -35,9 +35,9 @@ copycont1: #include "../../kern/powerpc/cache_flush.S" -VARIABLE (grub_relocator_forward_end) +VARIABLE (VasEBoot_relocator_forward_end) -VARIABLE (grub_relocator_backward_start) +VARIABLE (VasEBoot_relocator_backward_start) mr 3, 9 mr 4, 10 @@ -57,4 +57,4 @@ copycont2: #include "../../kern/powerpc/cache_flush.S" -VARIABLE (grub_relocator_backward_end) +VARIABLE (VasEBoot_relocator_backward_end) diff --git a/VasEBoot-core/lib/powerpc/setjmp.S b/VasEBoot-core/lib/powerpc/setjmp.S index 716b563fa..9fa3e33d3 100644 --- a/VasEBoot-core/lib/powerpc/setjmp.S +++ b/VasEBoot-core/lib/powerpc/setjmp.S @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .text /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) +FUNCTION(VasEBoot_setjmp) stw 1, 0(3) stw 14, 4(3) stw 15, 8(3) @@ -56,9 +56,9 @@ FUNCTION(grub_setjmp) blr /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) +FUNCTION(VasEBoot_longjmp) lwz 1, 0(3) lwz 14, 4(3) lwz 15, 8(3) diff --git a/VasEBoot-core/lib/priority_queue.c b/VasEBoot-core/lib/priority_queue.c index 659be0b7f..b08be64bb 100644 --- a/VasEBoot-core/lib/priority_queue.c +++ b/VasEBoot-core/lib/priority_queue.c @@ -1,78 +1,78 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_priority_queue +struct VasEBoot_priority_queue { - grub_size_t elsize; - grub_size_t allocated; - grub_size_t used; - grub_comparator_t cmp; + VasEBoot_size_t elsize; + VasEBoot_size_t allocated; + VasEBoot_size_t used; + VasEBoot_comparator_t cmp; void *els; }; static inline void * -element (struct grub_priority_queue *pq, grub_size_t k) +element (struct VasEBoot_priority_queue *pq, VasEBoot_size_t k) { - return ((grub_uint8_t *) pq->els) + k * pq->elsize; + return ((VasEBoot_uint8_t *) pq->els) + k * pq->elsize; } static inline void -swap (struct grub_priority_queue *pq, grub_size_t m, grub_size_t n) +swap (struct VasEBoot_priority_queue *pq, VasEBoot_size_t m, VasEBoot_size_t n) { - grub_uint8_t *p1, *p2; - grub_size_t l; - p1 = (grub_uint8_t *) element (pq, m); - p2 = (grub_uint8_t *) element (pq, n); + VasEBoot_uint8_t *p1, *p2; + VasEBoot_size_t l; + p1 = (VasEBoot_uint8_t *) element (pq, m); + p2 = (VasEBoot_uint8_t *) element (pq, n); for (l = pq->elsize; l; l--, p1++, p2++) { - grub_uint8_t t; + VasEBoot_uint8_t t; t = *p1; *p1 = *p2; *p2 = t; } } -static inline grub_size_t -parent (grub_size_t v) +static inline VasEBoot_size_t +parent (VasEBoot_size_t v) { return (v - 1) / 2; } -static inline grub_size_t -left_child (grub_size_t v) +static inline VasEBoot_size_t +left_child (VasEBoot_size_t v) { return 2 * v + 1; } -static inline grub_size_t -right_child (grub_size_t v) +static inline VasEBoot_size_t +right_child (VasEBoot_size_t v) { return 2 * v + 2; } void * -grub_priority_queue_top (grub_priority_queue_t pq) +VasEBoot_priority_queue_top (VasEBoot_priority_queue_t pq) { if (!pq->used) return 0; @@ -80,25 +80,25 @@ grub_priority_queue_top (grub_priority_queue_t pq) } void -grub_priority_queue_destroy (grub_priority_queue_t pq) +VasEBoot_priority_queue_destroy (VasEBoot_priority_queue_t pq) { - grub_free (pq->els); - grub_free (pq); + VasEBoot_free (pq->els); + VasEBoot_free (pq); } -grub_priority_queue_t -grub_priority_queue_new (grub_size_t elsize, - grub_comparator_t cmp) +VasEBoot_priority_queue_t +VasEBoot_priority_queue_new (VasEBoot_size_t elsize, + VasEBoot_comparator_t cmp) { - struct grub_priority_queue *ret; + struct VasEBoot_priority_queue *ret; void *els; - els = grub_malloc (elsize * 8); + els = VasEBoot_malloc (elsize * 8); if (!els) return 0; - ret = (struct grub_priority_queue *) grub_malloc (sizeof (*ret)); + ret = (struct VasEBoot_priority_queue *) VasEBoot_malloc (sizeof (*ret)); if (!ret) { - grub_free (els); + VasEBoot_free (els); return 0; } ret->elsize = elsize; @@ -110,21 +110,21 @@ grub_priority_queue_new (grub_size_t elsize, } /* Heap property: pq->cmp (element (pq, p), element (pq, parent (p))) <= 0. */ -grub_err_t -grub_priority_queue_push (grub_priority_queue_t pq, const void *el) +VasEBoot_err_t +VasEBoot_priority_queue_push (VasEBoot_priority_queue_t pq, const void *el) { - grub_size_t p; + VasEBoot_size_t p; if (pq->used == pq->allocated) { void *els; - els = grub_realloc (pq->els, pq->elsize * 2 * pq->allocated); + els = VasEBoot_realloc (pq->els, pq->elsize * 2 * pq->allocated); if (!els) - return grub_errno; + return VasEBoot_errno; pq->allocated *= 2; pq->els = els; } pq->used++; - grub_memcpy (element (pq, pq->used - 1), el, pq->elsize); + VasEBoot_memcpy (element (pq, pq->used - 1), el, pq->elsize); for (p = pq->used - 1; p; p = parent (p)) { if (pq->cmp (element (pq, p), element (pq, parent (p))) <= 0) @@ -132,19 +132,19 @@ grub_priority_queue_push (grub_priority_queue_t pq, const void *el) swap (pq, p, parent (p)); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_priority_queue_pop (grub_priority_queue_t pq) +VasEBoot_priority_queue_pop (VasEBoot_priority_queue_t pq) { - grub_size_t p; + VasEBoot_size_t p; swap (pq, 0, pq->used - 1); pq->used--; for (p = 0; left_child (p) < pq->used; ) { - grub_size_t c; + VasEBoot_size_t c; if (pq->cmp (element (pq, left_child (p)), element (pq, p)) <= 0 && (right_child (p) >= pq->used || pq->cmp (element (pq, right_child (p)), element (pq, p)) <= 0)) diff --git a/VasEBoot-core/lib/progress.c b/VasEBoot-core/lib/progress.c index 4b7cbbca6..db9381cee 100644 --- a/VasEBoot-core/lib/progress.c +++ b/VasEBoot-core/lib/progress.c @@ -1,72 +1,72 @@ /* progress.c - show loading progress */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define UPDATE_INTERVAL 800 static void -grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)), +VasEBoot_file_progress_hook_real (VasEBoot_disk_addr_t sector __attribute__ ((unused)), unsigned offset __attribute__ ((unused)), unsigned length, void *data) { static int call_depth = 0; - grub_uint64_t now; - static grub_uint64_t last_progress_update_time; - grub_file_t file = data; + VasEBoot_uint64_t now; + static VasEBoot_uint64_t last_progress_update_time; + VasEBoot_file_t file = data; const char *e; file->progress_offset += length; if (call_depth) return; - e = grub_env_get ("enable_progress_indicator"); + e = VasEBoot_env_get ("enable_progress_indicator"); if (e && e[0] == '0') { return; } call_depth = 1; - now = grub_get_time_ms (); + now = VasEBoot_get_time_ms (); if (((now - last_progress_update_time > UPDATE_INTERVAL) && (file->progress_offset - file->offset > 0)) || (file->progress_offset == file->size)) { static char buffer[80]; - struct grub_term_output *term; + struct VasEBoot_term_output *term; const char *partial_file_name; unsigned long long percent; - grub_uint64_t current_speed; + VasEBoot_uint64_t current_speed; if (now - file->last_progress_time < 10) current_speed = 0; else - current_speed = grub_divmod64 ((file->progress_offset + current_speed = VasEBoot_divmod64 ((file->progress_offset - file->last_progress_offset) * 100ULL * 1000ULL, now - file->last_progress_time, 0); @@ -74,16 +74,16 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)), if (file->size == 0) percent = 100; else - percent = grub_divmod64 (100 * file->progress_offset, + percent = VasEBoot_divmod64 (100 * file->progress_offset, file->size, 0); - /* grub_net_fs_open() saves off partial file structure before name is initialized. + /* VasEBoot_net_fs_open() saves off partial file structure before name is initialized. It already saves passed file name in net structure so just use it in this case. */ if (file->device->net) - partial_file_name = grub_strrchr (file->device->net->name, '/'); - else if (file->name) /* grub_file_open() may leave it as NULL */ - partial_file_name = grub_strrchr (file->name, '/'); + partial_file_name = VasEBoot_strrchr (file->device->net->name, '/'); + else if (file->name) /* VasEBoot_file_open() may leave it as NULL */ + partial_file_name = VasEBoot_strrchr (file->name, '/'); else partial_file_name = NULL; if (partial_file_name) @@ -93,32 +93,32 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)), file->estimated_speed = (file->estimated_speed + current_speed) >> 1; - grub_snprintf (buffer, sizeof (buffer), " [ %.20s %s %llu%% ", + VasEBoot_snprintf (buffer, sizeof (buffer), " [ %.20s %s %llu%% ", partial_file_name, - grub_get_human_size (file->progress_offset, - GRUB_HUMAN_SIZE_NORMAL), + VasEBoot_get_human_size (file->progress_offset, + VasEBoot_HUMAN_SIZE_NORMAL), (unsigned long long) percent); - char *ptr = buffer + grub_strlen (buffer); - grub_snprintf (ptr, sizeof (buffer) - (ptr - buffer), "%s ]", - grub_get_human_size (file->estimated_speed, - GRUB_HUMAN_SIZE_SPEED)); + char *ptr = buffer + VasEBoot_strlen (buffer); + VasEBoot_snprintf (ptr, sizeof (buffer) - (ptr - buffer), "%s ]", + VasEBoot_get_human_size (file->estimated_speed, + VasEBoot_HUMAN_SIZE_SPEED)); - grub_size_t len = grub_strlen (buffer); + VasEBoot_size_t len = VasEBoot_strlen (buffer); FOR_ACTIVE_TERM_OUTPUTS (term) { if (term->progress_update_counter++ > term->progress_update_divisor || (file->progress_offset == file->size && term->progress_update_divisor - != (unsigned) GRUB_PROGRESS_NO_UPDATE)) + != (unsigned) VasEBoot_PROGRESS_NO_UPDATE)) { - struct grub_term_coordinate old_pos = grub_term_getxy (term); - struct grub_term_coordinate new_pos = old_pos; - new_pos.x = grub_term_width (term) - len - 1; + struct VasEBoot_term_coordinate old_pos = VasEBoot_term_getxy (term); + struct VasEBoot_term_coordinate new_pos = old_pos; + new_pos.x = VasEBoot_term_width (term) - len - 1; - grub_term_gotoxy (term, new_pos); - grub_puts_terminal (buffer, term); - grub_term_gotoxy (term, old_pos); + VasEBoot_term_gotoxy (term, new_pos); + VasEBoot_puts_terminal (buffer, term); + VasEBoot_term_gotoxy (term, old_pos); term->progress_update_counter = 0; @@ -134,12 +134,12 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)), call_depth = 0; } -GRUB_MOD_INIT(progress) +VasEBoot_MOD_INIT(progress) { - grub_file_progress_hook = grub_file_progress_hook_real; + VasEBoot_file_progress_hook = VasEBoot_file_progress_hook_real; } -GRUB_MOD_FINI(progress) +VasEBoot_MOD_FINI(progress) { - grub_file_progress_hook = 0; + VasEBoot_file_progress_hook = 0; } diff --git a/VasEBoot-core/lib/random.c b/VasEBoot-core/lib/random.c index 43b966438..11d51bcd7 100644 --- a/VasEBoot-core/lib/random.c +++ b/VasEBoot-core/lib/random.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2016 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_err_t -grub_crypto_get_random (void *buffer, grub_size_t sz) +VasEBoot_err_t +VasEBoot_crypto_get_random (void *buffer, VasEBoot_size_t sz) { /* This is an arbitrer between different methods. TODO: Add more methods in the future. */ /* TODO: Add some PRNG smartness to reduce damage from bad entropy. */ - if (grub_crypto_arch_get_random (buffer, sz)) - return GRUB_ERR_NONE; - return grub_error (GRUB_ERR_IO, "no random sources found"); + if (VasEBoot_crypto_arch_get_random (buffer, sz)) + return VasEBoot_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_IO, "no random sources found"); } static int @@ -51,39 +51,39 @@ get_num_digits (int val) #pragma GCC diagnostic ignored "-Wformat-nonliteral" -static grub_err_t -grub_cmd_hexdump_random (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_hexdump_random (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { - grub_size_t length = 64; - grub_err_t err; + VasEBoot_size_t length = 64; + VasEBoot_err_t err; void *buffer; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int stats[256]; int i, digits = 2; char template[10]; if (argc >= 1) - length = grub_strtoull (args[0], 0, 0); + length = VasEBoot_strtoull (args[0], 0, 0); if (length == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "length pust be positive"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "length pust be positive"); - buffer = grub_malloc (length); + buffer = VasEBoot_malloc (length); if (!buffer) - return grub_errno; + return VasEBoot_errno; - err = grub_crypto_get_random (buffer, length); + err = VasEBoot_crypto_get_random (buffer, length); if (err) { - grub_free (buffer); + VasEBoot_free (buffer); return err; } hexdump (0, buffer, length); - grub_memset(stats, 0, sizeof(stats)); - for (ptr = buffer; ptr < (grub_uint8_t *) buffer + length; ptr++) + VasEBoot_memset(stats, 0, sizeof(stats)); + for (ptr = buffer; ptr < (VasEBoot_uint8_t *) buffer + length; ptr++) stats[*ptr]++; - grub_printf ("Statistics:\n"); + VasEBoot_printf ("Statistics:\n"); for (i = 0; i < 256; i++) { int z = get_num_digits (stats[i]); @@ -91,30 +91,30 @@ grub_cmd_hexdump_random (grub_command_t cmd __attribute__ ((unused)), int argc, digits = z; } - grub_snprintf (template, sizeof (template), "%%0%dd ", digits); + VasEBoot_snprintf (template, sizeof (template), "%%0%dd ", digits); for (i = 0; i < 256; i++) { - grub_printf ("%s", template);//, stats[i]); + VasEBoot_printf ("%s", template);//, stats[i]); if ((i & 0xf) == 0xf) - grub_printf ("\n"); + VasEBoot_printf ("\n"); } - grub_free (buffer); + VasEBoot_free (buffer); return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT (random) +VasEBoot_MOD_INIT (random) { - cmd = grub_register_command ("hexdump_random", grub_cmd_hexdump_random, + cmd = VasEBoot_register_command ("hexdump_random", VasEBoot_cmd_hexdump_random, N_("[LENGTH]"), N_("Hexdump random data.")); } -GRUB_MOD_FINI (random) +VasEBoot_MOD_FINI (random) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/lib/reed_solomon.c b/VasEBoot-core/lib/reed_solomon.c index ee9fa7b4f..c281267b3 100644 --- a/VasEBoot-core/lib/reed_solomon.c +++ b/VasEBoot-core/lib/reed_solomon.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifdef TEST @@ -21,8 +21,8 @@ #include #include #define xmalloc malloc -#define grub_memset memset -#define grub_memcpy memcpy +#define VasEBoot_memset memset +#define VasEBoot_memcpy memcpy #endif #ifndef STANDALONE @@ -31,13 +31,13 @@ #ifndef STANDALONE #ifdef TEST -typedef unsigned int grub_size_t; -typedef unsigned char grub_uint8_t; +typedef unsigned int VasEBoot_size_t; +typedef unsigned char VasEBoot_uint8_t; #else -#include -#include -#include -#include +#include +#include +#include +#include #endif #endif @@ -46,11 +46,11 @@ typedef unsigned char grub_uint8_t; #ifdef STANDALONE #ifdef TEST -typedef unsigned int grub_size_t; -typedef unsigned char grub_uint8_t; +typedef unsigned int VasEBoot_size_t; +typedef unsigned char VasEBoot_uint8_t; #else -#include -#include +#include +#include #endif #ifdef __i386__ #define REED_SOLOMON_ATTRIBUTE __attribute__ ((regparm(3))) @@ -58,14 +58,14 @@ typedef unsigned char grub_uint8_t; #define REED_SOLOMON_ATTRIBUTE #endif void -grub_reed_solomon_recover (void *ptr_, grub_size_t s, grub_size_t rs) +VasEBoot_reed_solomon_recover (void *ptr_, VasEBoot_size_t s, VasEBoot_size_t rs) REED_SOLOMON_ATTRIBUTE; #else #define REED_SOLOMON_ATTRIBUTE #endif #define GF_SIZE 8 -typedef grub_uint8_t gf_single_t; +typedef VasEBoot_uint8_t gf_single_t; #define GF_POLYNOMIAL 0x1d #define GF_INVERT2 0x8e #if defined (STANDALONE) && !defined (TEST) @@ -119,7 +119,7 @@ static void init_powx (void) { int i; - grub_uint8_t cur = 1; + VasEBoot_uint8_t cur = 1; gf_powx_inv[0] = 0; for (i = 0; i < 255; i++) @@ -135,7 +135,7 @@ init_powx (void) } static gf_single_t -pol_evaluate (gf_single_t *pol, grub_size_t degree, int log_x) +pol_evaluate (gf_single_t *pol, VasEBoot_size_t degree, int log_x) { int i; gf_single_t s = 0; @@ -153,16 +153,16 @@ pol_evaluate (gf_single_t *pol, grub_size_t degree, int log_x) #if !defined (STANDALONE) static void -rs_encode (gf_single_t *data, grub_size_t s, grub_size_t rs) +rs_encode (gf_single_t *data, VasEBoot_size_t s, VasEBoot_size_t rs) { gf_single_t *rs_polynomial; int i, j; gf_single_t *m; m = xmalloc ((s + rs) * sizeof (gf_single_t)); - grub_memcpy (m, data, s * sizeof (gf_single_t)); - grub_memset (m + s, 0, rs * sizeof (gf_single_t)); + VasEBoot_memcpy (m, data, s * sizeof (gf_single_t)); + VasEBoot_memset (m + s, 0, rs * sizeof (gf_single_t)); rs_polynomial = xmalloc ((rs + 1) * sizeof (gf_single_t)); - grub_memset (rs_polynomial, 0, (rs + 1) * sizeof (gf_single_t)); + VasEBoot_memset (rs_polynomial, 0, (rs + 1) * sizeof (gf_single_t)); rs_polynomial[rs] = 1; /* Multiply with X - a^r */ for (j = 0; j < rs; j++) @@ -184,7 +184,7 @@ rs_encode (gf_single_t *data, grub_size_t s, grub_size_t rs) m[i+j] ^= gf_mul (rs_polynomial[i], f); } free (rs_polynomial); - grub_memcpy (data + s, m + s, rs * sizeof (gf_single_t)); + VasEBoot_memcpy (data + s, m + s, rs * sizeof (gf_single_t)); free (m); } #endif @@ -239,9 +239,9 @@ gauss_solve (gf_single_t *eq, int n, int m, gf_single_t *sol) } static void -rs_recover (gf_single_t *mm, grub_size_t s, grub_size_t rs) +rs_recover (gf_single_t *mm, VasEBoot_size_t s, VasEBoot_size_t rs) { - grub_size_t rs2 = rs / 2; + VasEBoot_size_t rs2 = rs / 2; int errnum = 0; int i, j; @@ -295,14 +295,14 @@ rs_recover (gf_single_t *mm, grub_size_t s, grub_size_t rs) } static void -decode_block (gf_single_t *ptr, grub_size_t s, - gf_single_t *rptr, grub_size_t rs) +decode_block (gf_single_t *ptr, VasEBoot_size_t s, + gf_single_t *rptr, VasEBoot_size_t rs) { int i, j; for (i = 0; i < SECTOR_SIZE; i++) { - grub_size_t ds = (s + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; - grub_size_t rr = (rs + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; + VasEBoot_size_t ds = (s + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; + VasEBoot_size_t rr = (rs + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; /* Nothing to do. */ if (!ds || !rr) @@ -322,14 +322,14 @@ decode_block (gf_single_t *ptr, grub_size_t s, #if !defined (STANDALONE) static void -encode_block (gf_single_t *ptr, grub_size_t s, - gf_single_t *rptr, grub_size_t rs) +encode_block (gf_single_t *ptr, VasEBoot_size_t s, + gf_single_t *rptr, VasEBoot_size_t rs) { int i, j; for (i = 0; i < SECTOR_SIZE; i++) { - grub_size_t ds = (s + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; - grub_size_t rr = (rs + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; + VasEBoot_size_t ds = (s + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; + VasEBoot_size_t rr = (rs + SECTOR_SIZE - 1 - i) / SECTOR_SIZE; gf_single_t *m; if (!ds || !rr) @@ -348,17 +348,17 @@ encode_block (gf_single_t *ptr, grub_size_t s, #if !defined (STANDALONE) void -grub_reed_solomon_add_redundancy (void *buffer, grub_size_t data_size, - grub_size_t redundancy) +VasEBoot_reed_solomon_add_redundancy (void *buffer, VasEBoot_size_t data_size, + VasEBoot_size_t redundancy) { - grub_size_t s = data_size; - grub_size_t rs = redundancy; + VasEBoot_size_t s = data_size; + VasEBoot_size_t rs = redundancy; gf_single_t *ptr = buffer; gf_single_t *rptr = ptr + s; void *tmp; tmp = xmalloc (data_size); - grub_memcpy (tmp, buffer, data_size); + VasEBoot_memcpy (tmp, buffer, data_size); /* Nothing to do. */ if (!rs) @@ -368,8 +368,8 @@ grub_reed_solomon_add_redundancy (void *buffer, grub_size_t data_size, while (s > 0) { - grub_size_t tt; - grub_size_t cs, crs; + VasEBoot_size_t tt; + VasEBoot_size_t cs, crs; cs = s; crs = rs; tt = cs + crs; @@ -386,7 +386,7 @@ grub_reed_solomon_add_redundancy (void *buffer, grub_size_t data_size, } #ifndef TEST - assert (grub_memcmp (tmp, buffer, data_size) == 0); + assert (VasEBoot_memcmp (tmp, buffer, data_size) == 0); #endif exit: free (tmp); @@ -394,11 +394,11 @@ exit: #endif void REED_SOLOMON_ATTRIBUTE -grub_reed_solomon_recover (void *ptr_, grub_size_t s, grub_size_t rs) +VasEBoot_reed_solomon_recover (void *ptr_, VasEBoot_size_t s, VasEBoot_size_t rs) { gf_single_t *ptr = ptr_; gf_single_t *rptr = ptr + s; - grub_uint8_t *cptr; + VasEBoot_uint8_t *cptr; /* Nothing to do. */ if (!rs) @@ -407,15 +407,15 @@ grub_reed_solomon_recover (void *ptr_, grub_size_t s, grub_size_t rs) for (cptr = rptr + rs - 1; cptr >= rptr; cptr--) if (*cptr) break; - if (rptr + rs - 1 - cptr > (grub_ssize_t) rs / 2) + if (rptr + rs - 1 - cptr > (VasEBoot_ssize_t) rs / 2) return; init_powx (); while (s > 0) { - grub_size_t tt; - grub_size_t cs, crs; + VasEBoot_size_t tt; + VasEBoot_size_t cs, crs; cs = s; crs = rs; tt = cs + crs; @@ -437,18 +437,18 @@ int main (int argc, char **argv) { FILE *in, *out; - grub_size_t s, rs; + VasEBoot_size_t s, rs; char *buf; - grub_memset (gf_powx, 0xee, sizeof (gf_powx)); - grub_memset (gf_powx_inv, 0xdd, sizeof (gf_powx_inv)); + VasEBoot_memset (gf_powx, 0xee, sizeof (gf_powx)); + VasEBoot_memset (gf_powx_inv, 0xdd, sizeof (gf_powx_inv)); #ifndef STANDALONE init_powx (); #endif #ifndef STANDALONE - in = grub_util_fopen ("tst.bin", "rb"); + in = VasEBoot_util_fopen ("tst.bin", "rb"); if (!in) return 1; fseek (in, 0, SEEK_END); @@ -459,13 +459,13 @@ main (int argc, char **argv) fread (buf, 1, s, in); fclose (in); - grub_reed_solomon_add_redundancy (buf, s, rs); + VasEBoot_reed_solomon_add_redundancy (buf, s, rs); - out = grub_util_fopen ("tst_rs.bin", "wb"); + out = VasEBoot_util_fopen ("tst_rs.bin", "wb"); fwrite (buf, 1, s + rs, out); fclose (out); #else - out = grub_util_fopen ("tst_rs.bin", "rb"); + out = VasEBoot_util_fopen ("tst_rs.bin", "rb"); fseek (out, 0, SEEK_END); s = ftell (out); fseek (out, 0, SEEK_SET); @@ -477,15 +477,15 @@ main (int argc, char **argv) fclose (out); #endif #if 1 - grub_memset (buf + 512 * 15, 0, 512); + VasEBoot_memset (buf + 512 * 15, 0, 512); #endif - out = grub_util_fopen ("tst_dam.bin", "wb"); + out = VasEBoot_util_fopen ("tst_dam.bin", "wb"); fwrite (buf, 1, s + rs, out); fclose (out); - grub_reed_solomon_recover (buf, s, rs); + VasEBoot_reed_solomon_recover (buf, s, rs); - out = grub_util_fopen ("tst_rec.bin", "wb"); + out = VasEBoot_util_fopen ("tst_rec.bin", "wb"); fwrite (buf, 1, s, out); fclose (out); diff --git a/VasEBoot-core/lib/relocator.c b/VasEBoot-core/lib/relocator.c index ea3ebc719..40878006e 100644 --- a/VasEBoot-core/lib/relocator.c +++ b/VasEBoot-core/lib/relocator.c @@ -1,117 +1,117 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_relocator +struct VasEBoot_relocator { - struct grub_relocator_chunk *chunks; - grub_phys_addr_t postchunks; - grub_phys_addr_t highestaddr; - grub_phys_addr_t highestnonpostaddr; - grub_size_t relocators_size; + struct VasEBoot_relocator_chunk *chunks; + VasEBoot_phys_addr_t postchunks; + VasEBoot_phys_addr_t highestaddr; + VasEBoot_phys_addr_t highestnonpostaddr; + VasEBoot_size_t relocators_size; }; -struct grub_relocator_subchunk +struct VasEBoot_relocator_subchunk { enum {CHUNK_TYPE_IN_REGION, CHUNK_TYPE_REGION_START, -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS CHUNK_TYPE_FIRMWARE, CHUNK_TYPE_LEFTOVER #endif } type; - grub_mm_region_t reg; - grub_phys_addr_t start; - grub_size_t size; - grub_size_t pre_size; - struct grub_relocator_extra_block *extra; -#if GRUB_RELOCATOR_HAVE_LEFTOVERS - struct grub_relocator_fw_leftover *pre, *post; + VasEBoot_mm_region_t reg; + VasEBoot_phys_addr_t start; + VasEBoot_size_t size; + VasEBoot_size_t pre_size; + struct VasEBoot_relocator_extra_block *extra; +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS + struct VasEBoot_relocator_fw_leftover *pre, *post; #endif }; -struct grub_relocator_chunk +struct VasEBoot_relocator_chunk { - struct grub_relocator_chunk *next; - grub_phys_addr_t src; + struct VasEBoot_relocator_chunk *next; + VasEBoot_phys_addr_t src; void *srcv; - grub_phys_addr_t target; - grub_size_t size; - struct grub_relocator_subchunk *subchunks; + VasEBoot_phys_addr_t target; + VasEBoot_size_t size; + struct VasEBoot_relocator_subchunk *subchunks; unsigned nsubchunks; }; -struct grub_relocator_extra_block +struct VasEBoot_relocator_extra_block { - struct grub_relocator_extra_block *next; - struct grub_relocator_extra_block **prev; - grub_phys_addr_t start; - grub_phys_addr_t end; + struct VasEBoot_relocator_extra_block *next; + struct VasEBoot_relocator_extra_block **prev; + VasEBoot_phys_addr_t start; + VasEBoot_phys_addr_t end; }; -#if GRUB_RELOCATOR_HAVE_LEFTOVERS -struct grub_relocator_fw_leftover +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS +struct VasEBoot_relocator_fw_leftover { - struct grub_relocator_fw_leftover *next; - struct grub_relocator_fw_leftover **prev; - grub_phys_addr_t quantstart; - grub_uint8_t freebytes[GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT / 8]; + struct VasEBoot_relocator_fw_leftover *next; + struct VasEBoot_relocator_fw_leftover **prev; + VasEBoot_phys_addr_t quantstart; + VasEBoot_uint8_t freebytes[VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT / 8]; }; -static struct grub_relocator_fw_leftover *leftovers; +static struct VasEBoot_relocator_fw_leftover *leftovers; #endif -static struct grub_relocator_extra_block *extra_blocks; +static struct VasEBoot_relocator_extra_block *extra_blocks; void * -get_virtual_current_address (grub_relocator_chunk_t in) +get_virtual_current_address (VasEBoot_relocator_chunk_t in) { return in->srcv; } -grub_phys_addr_t -get_physical_target_address (grub_relocator_chunk_t in) +VasEBoot_phys_addr_t +get_physical_target_address (VasEBoot_relocator_chunk_t in) { return in->target; } -struct grub_relocator * -grub_relocator_new (void) +struct VasEBoot_relocator * +VasEBoot_relocator_new (void) { - struct grub_relocator *ret; + struct VasEBoot_relocator *ret; - grub_cpu_relocator_init (); + VasEBoot_cpu_relocator_init (); - ret = grub_zalloc (sizeof (struct grub_relocator)); + ret = VasEBoot_zalloc (sizeof (struct VasEBoot_relocator)); if (!ret) return NULL; - ret->postchunks = ~(grub_phys_addr_t) 0; - ret->relocators_size = grub_relocator_jumper_size; - grub_dprintf ("relocator", "relocators_size=%lu\n", + ret->postchunks = ~(VasEBoot_phys_addr_t) 0; + ret->relocators_size = VasEBoot_relocator_jumper_size; + VasEBoot_dprintf ("relocator", "relocators_size=%lu\n", (unsigned long) ret->relocators_size); return ret; } @@ -130,34 +130,34 @@ is_start (int type) } static void -allocate_regstart (grub_phys_addr_t addr, grub_size_t size, grub_mm_region_t rb, - grub_mm_region_t *regancestor, grub_mm_header_t hancestor) +allocate_regstart (VasEBoot_phys_addr_t addr, VasEBoot_size_t size, VasEBoot_mm_region_t rb, + VasEBoot_mm_region_t *regancestor, VasEBoot_mm_header_t hancestor) { - grub_addr_t newreg_start, newreg_raw_start - = (grub_addr_t) rb + (addr - grub_vtop (rb)) + size; - grub_addr_t newreg_size, newreg_presize; - grub_mm_header_t new_header; - grub_mm_header_t hb = (grub_mm_header_t) (rb + 1); + VasEBoot_addr_t newreg_start, newreg_raw_start + = (VasEBoot_addr_t) rb + (addr - VasEBoot_vtop (rb)) + size; + VasEBoot_addr_t newreg_size, newreg_presize; + VasEBoot_mm_header_t new_header; + VasEBoot_mm_header_t hb = (VasEBoot_mm_header_t) (rb + 1); #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "ra = %p, rb = %p\n", regancestor, rb); + VasEBoot_dprintf ("relocator", "ra = %p, rb = %p\n", regancestor, rb); #endif - newreg_start = ALIGN_UP (newreg_raw_start, GRUB_MM_ALIGN); + newreg_start = ALIGN_UP (newreg_raw_start, VasEBoot_MM_ALIGN); newreg_presize = newreg_start - newreg_raw_start; - newreg_size = rb->size - (newreg_start - (grub_addr_t) rb); - if ((hb->size << GRUB_MM_ALIGN_LOG2) >= newreg_start - - (grub_addr_t) rb) + newreg_size = rb->size - (newreg_start - (VasEBoot_addr_t) rb); + if ((hb->size << VasEBoot_MM_ALIGN_LOG2) >= newreg_start + - (VasEBoot_addr_t) rb) { - grub_mm_header_t newhnext = hb->next; - grub_size_t newhsize = ((hb->size << GRUB_MM_ALIGN_LOG2) + VasEBoot_mm_header_t newhnext = hb->next; + VasEBoot_size_t newhsize = ((hb->size << VasEBoot_MM_ALIGN_LOG2) - (newreg_start - - (grub_addr_t) rb)) >> GRUB_MM_ALIGN_LOG2; + - (VasEBoot_addr_t) rb)) >> VasEBoot_MM_ALIGN_LOG2; new_header = (void *) (newreg_start + sizeof (*rb)); if (newhnext == hb) newhnext = new_header; new_header->next = newhnext; new_header->size = newhsize; - new_header->magic = GRUB_MM_FREE_MAGIC; + new_header->magic = VasEBoot_MM_FREE_MAGIC; } else { @@ -166,9 +166,9 @@ allocate_regstart (grub_phys_addr_t addr, grub_size_t size, grub_mm_region_t rb, new_header = (void *) (newreg_start + sizeof (*rb)); } { - struct grub_mm_header *newregfirst = rb->first; - struct grub_mm_region *newregnext = rb->next; - struct grub_mm_region *newreg = (void *) newreg_start; + struct VasEBoot_mm_header *newregfirst = rb->first; + struct VasEBoot_mm_region *newregnext = rb->next; + struct VasEBoot_mm_region *newreg = (void *) newreg_start; hancestor->next = new_header; if (newregfirst == hb) newregfirst = new_header; @@ -178,15 +178,15 @@ allocate_regstart (grub_phys_addr_t addr, grub_size_t size, grub_mm_region_t rb, newreg->size = newreg_size; *regancestor = newreg; { - grub_mm_header_t h = newreg->first, hp = NULL; + VasEBoot_mm_header_t h = newreg->first, hp = NULL; do { if ((void *) h < (void *) (newreg + 1)) - grub_fatal ("Failed to adjust memory region: %p, %p, %p, %p, %p", + VasEBoot_fatal ("Failed to adjust memory region: %p, %p, %p, %p, %p", newreg, newreg->first, h, hp, hb); #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF if ((void *) h == (void *) (newreg + 1)) - grub_dprintf ("relocator", + VasEBoot_dprintf ("relocator", "Free start memory region: %p, %p, %p, %p, %p", newreg, newreg->first, h, hp, hb); #endif @@ -199,35 +199,35 @@ allocate_regstart (grub_phys_addr_t addr, grub_size_t size, grub_mm_region_t rb, } static void -allocate_inreg (grub_phys_addr_t paddr, grub_size_t size, - grub_mm_header_t hb, grub_mm_header_t hbp, - grub_mm_region_t rb) +allocate_inreg (VasEBoot_phys_addr_t paddr, VasEBoot_size_t size, + VasEBoot_mm_header_t hb, VasEBoot_mm_header_t hbp, + VasEBoot_mm_region_t rb) { - struct grub_mm_header *foll = NULL; - grub_addr_t vaddr = (grub_addr_t) hb + (paddr - grub_vtop (hb)); + struct VasEBoot_mm_header *foll = NULL; + VasEBoot_addr_t vaddr = (VasEBoot_addr_t) hb + (paddr - VasEBoot_vtop (hb)); #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "inreg paddr = 0x%lx, size = %lu," + VasEBoot_dprintf ("relocator", "inreg paddr = 0x%lx, size = %lu," " hb = %p, hbp = %p, rb = %p, vaddr = 0x%lx\n", (unsigned long) paddr, (unsigned long) size, hb, hbp, rb, (unsigned long) vaddr); #endif - if (ALIGN_UP (vaddr + size, GRUB_MM_ALIGN) + GRUB_MM_ALIGN - <= (grub_addr_t) (hb + hb->size)) + if (ALIGN_UP (vaddr + size, VasEBoot_MM_ALIGN) + VasEBoot_MM_ALIGN + <= (VasEBoot_addr_t) (hb + hb->size)) { - foll = (void *) ALIGN_UP (vaddr + size, GRUB_MM_ALIGN); - foll->magic = GRUB_MM_FREE_MAGIC; + foll = (void *) ALIGN_UP (vaddr + size, VasEBoot_MM_ALIGN); + foll->magic = VasEBoot_MM_FREE_MAGIC; foll->size = hb + hb->size - foll; #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "foll = %p, foll->size = %lu\n", foll, + VasEBoot_dprintf ("relocator", "foll = %p, foll->size = %lu\n", foll, (unsigned long) foll->size); #endif } - if (vaddr - (grub_addr_t) hb >= sizeof (*hb)) + if (vaddr - (VasEBoot_addr_t) hb >= sizeof (*hb)) { - hb->size = ((vaddr - (grub_addr_t) hb) >> GRUB_MM_ALIGN_LOG2); + hb->size = ((vaddr - (VasEBoot_addr_t) hb) >> VasEBoot_MM_ALIGN_LOG2); if (foll) { foll->next = hb; @@ -259,16 +259,16 @@ allocate_inreg (grub_phys_addr_t paddr, grub_size_t size, } } -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS static void -check_leftover (struct grub_relocator_fw_leftover *lo) +check_leftover (struct VasEBoot_relocator_fw_leftover *lo) { unsigned i; for (i = 0; i < sizeof (lo->freebytes); i++) if (lo->freebytes[i] != 0xff) return; - grub_relocator_firmware_free_region (lo->quantstart, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_relocator_firmware_free_region (lo->quantstart, + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); *lo->prev = lo->next; if (lo->next) lo->next->prev = lo->prev; @@ -276,40 +276,40 @@ check_leftover (struct grub_relocator_fw_leftover *lo) #endif static void -free_subchunk (const struct grub_relocator_subchunk *subchu) +free_subchunk (const struct VasEBoot_relocator_subchunk *subchu) { switch (subchu->type) { case CHUNK_TYPE_REGION_START: { - grub_mm_region_t r1, r2, *rp; - grub_mm_header_t h; - grub_size_t pre_size; + VasEBoot_mm_region_t r1, r2, *rp; + VasEBoot_mm_header_t h; + VasEBoot_size_t pre_size; r1 = subchu->reg; - r2 = (grub_mm_region_t) ALIGN_UP ((grub_addr_t) subchu->reg - + (grub_vtop (subchu->reg) + r2 = (VasEBoot_mm_region_t) ALIGN_UP ((VasEBoot_addr_t) subchu->reg + + (VasEBoot_vtop (subchu->reg) - subchu->start) + subchu->size, - GRUB_MM_ALIGN); - for (rp = &grub_mm_base; *rp && *rp != r2; rp = &((*rp)->next)); + VasEBoot_MM_ALIGN); + for (rp = &VasEBoot_mm_base; *rp && *rp != r2; rp = &((*rp)->next)); pre_size = subchu->pre_size; if (*rp) { - grub_mm_header_t h2, *hp; + VasEBoot_mm_header_t h2, *hp; r1->first = r2->first; r1->next = r2->next; r1->pre_size = pre_size; r1->size = r2->size + (r2 - r1) * sizeof (*r2); *rp = r1; - h = (grub_mm_header_t) (r1 + 1); + h = (VasEBoot_mm_header_t) (r1 + 1); h->next = r2->first; - h->magic = GRUB_MM_FREE_MAGIC; + h->magic = VasEBoot_MM_FREE_MAGIC; h->size = (r2 - r1 - 1); for (hp = &r2->first, h2 = *hp; h2->next != r2->first; hp = &(h2->next), h2 = *hp) - if (h2 == (grub_mm_header_t) (r2 + 1)) + if (h2 == (VasEBoot_mm_header_t) (r2 + 1)) break; - if (h2 == (grub_mm_header_t) (r2 + 1)) + if (h2 == (VasEBoot_mm_header_t) (r2 + 1)) { h->size = h2->size + (h2 - h); h->next = h2->next; @@ -332,25 +332,25 @@ free_subchunk (const struct grub_relocator_subchunk *subchu) /* Find where to insert this region. Put a smaller one before bigger ones, to prevent fragmentation. */ - for (rp = &grub_mm_base; *rp; rp = &((*rp)->next)) + for (rp = &VasEBoot_mm_base; *rp; rp = &((*rp)->next)) if ((*rp)->size > r1->size) break; r1->next = *rp; *rp = r1->next; - h = (grub_mm_header_t) (r1 + 1); + h = (VasEBoot_mm_header_t) (r1 + 1); r1->first = h; h->next = h; - h->magic = GRUB_MM_FREE_MAGIC; + h->magic = VasEBoot_MM_FREE_MAGIC; h->size = (r2 - r1 - 1); } - for (r2 = grub_mm_base; r2; r2 = r2->next) - if ((grub_addr_t) r2 + r2->size == (grub_addr_t) r1) + for (r2 = VasEBoot_mm_base; r2; r2 = r2->next) + if ((VasEBoot_addr_t) r2 + r2->size == (VasEBoot_addr_t) r1) break; if (r2) { - grub_mm_header_t hl2, hl, g; - g = (grub_mm_header_t) ((grub_addr_t) r2 + r2->size); - g->size = (grub_mm_header_t) r1 - g; + VasEBoot_mm_header_t hl2, hl, g; + g = (VasEBoot_mm_header_t) ((VasEBoot_addr_t) r2 + r2->size); + g->size = (VasEBoot_mm_header_t) r1 - g; r2->size += r1->size; for (hl = r2->first; hl->next != r2->first; hl = hl->next); for (hl2 = r1->first; hl2->next != r1->first; hl2 = hl2->next); @@ -358,39 +358,39 @@ free_subchunk (const struct grub_relocator_subchunk *subchu) r2->first = r1->first; hl->next = r2->first; *rp = (*rp)->next; - grub_free (g + 1); + VasEBoot_free (g + 1); } break; } case CHUNK_TYPE_IN_REGION: { - grub_mm_header_t h = (grub_mm_header_t) ALIGN_DOWN ((grub_addr_t) subchu->start, - GRUB_MM_ALIGN); + VasEBoot_mm_header_t h = (VasEBoot_mm_header_t) ALIGN_DOWN ((VasEBoot_addr_t) subchu->start, + VasEBoot_MM_ALIGN); h->size - = ((subchu->start + subchu->size + GRUB_MM_ALIGN - 1) / GRUB_MM_ALIGN) - - (subchu->start / GRUB_MM_ALIGN) - 1; + = ((subchu->start + subchu->size + VasEBoot_MM_ALIGN - 1) / VasEBoot_MM_ALIGN) + - (subchu->start / VasEBoot_MM_ALIGN) - 1; h->next = h; - h->magic = GRUB_MM_ALLOC_MAGIC; - grub_free (h + 1); + h->magic = VasEBoot_MM_ALLOC_MAGIC; + VasEBoot_free (h + 1); break; } -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS case CHUNK_TYPE_FIRMWARE: case CHUNK_TYPE_LEFTOVER: { - grub_addr_t fstart, fend; + VasEBoot_addr_t fstart, fend; fstart = ALIGN_UP (subchu->start, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); fend = ALIGN_DOWN (subchu->start + subchu->size, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); if (fstart < fend) - grub_relocator_firmware_free_region (fstart, fend - fstart); -#if GRUB_RELOCATOR_HAVE_LEFTOVERS + VasEBoot_relocator_firmware_free_region (fstart, fend - fstart); +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS if (subchu->pre) { int off = subchu->start - fstart - - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; - grub_memset (subchu->pre->freebytes + off / 8 + 1, + - VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; + VasEBoot_memset (subchu->pre->freebytes + off / 8 + 1, 0xff, sizeof (subchu->pre->freebytes) - off / 8 - 1); subchu->pre->freebytes[off / 8] |= ~((1 << (off % 8)) - 1); check_leftover (subchu->pre); @@ -398,14 +398,14 @@ free_subchunk (const struct grub_relocator_subchunk *subchu) if (subchu->post) { int off = subchu->start + subchu->size - fend; - grub_memset (subchu->pre->freebytes, + VasEBoot_memset (subchu->pre->freebytes, 0xff, sizeof (subchu->pre->freebytes) - off / 8); subchu->pre->freebytes[off / 8] |= ((1 << (8 - (off % 8))) - 1); check_leftover (subchu->post); } #endif *subchu->extra->prev = subchu->extra->next; - grub_free (subchu->extra); + VasEBoot_free (subchu->extra); } break; #endif @@ -413,22 +413,22 @@ free_subchunk (const struct grub_relocator_subchunk *subchu) } static int -malloc_in_range (struct grub_relocator *rel, - grub_addr_t start, grub_addr_t end, grub_addr_t align, - grub_size_t size, struct grub_relocator_chunk *res, +malloc_in_range (struct VasEBoot_relocator *rel, + VasEBoot_addr_t start, VasEBoot_addr_t end, VasEBoot_addr_t align, + VasEBoot_size_t size, struct VasEBoot_relocator_chunk *res, int from_low_priv, int collisioncheck) { - grub_mm_region_t r, *ra, base_saved; - struct grub_relocator_mmap_event *events = NULL, *eventt = NULL, *t; + VasEBoot_mm_region_t r, *ra, base_saved; + struct VasEBoot_relocator_mmap_event *events = NULL, *eventt = NULL, *t; /* 128 is just in case of additional malloc (shouldn't happen). */ unsigned maxevents = 2 + 128; - grub_mm_header_t p, pa; + VasEBoot_mm_header_t p, pa; unsigned *counter; int nallocs = 0; unsigned j, N = 0; - grub_addr_t target = 0; + VasEBoot_addr_t target = 0; - grub_dprintf ("relocator", + VasEBoot_dprintf ("relocator", "trying to allocate in 0x%lx-0x%lx aligned 0x%lx size 0x%lx\n", (unsigned long) start, (unsigned long) end, (unsigned long) align, (unsigned long) size); @@ -442,14 +442,14 @@ malloc_in_range (struct grub_relocator *rel, /* We have to avoid any allocations when filling scanline events. Hence 2-stages. */ - for (r = grub_mm_base; r; r = r->next) + for (r = VasEBoot_mm_base; r; r = r->next) { p = r->first; do { - if ((grub_addr_t) p < (grub_addr_t) (r + 1) - || (grub_addr_t) p >= (grub_addr_t) (r + 1) + r->size) - grub_fatal ("%d: out of range pointer: %p\n", __LINE__, p); + if ((VasEBoot_addr_t) p < (VasEBoot_addr_t) (r + 1) + || (VasEBoot_addr_t) p >= (VasEBoot_addr_t) (r + 1) + r->size) + VasEBoot_fatal ("%d: out of range pointer: %p\n", __LINE__, p); maxevents += 2; p = p->next; } @@ -459,31 +459,31 @@ malloc_in_range (struct grub_relocator *rel, if (collisioncheck && rel) { - struct grub_relocator_chunk *chunk; + struct VasEBoot_relocator_chunk *chunk; for (chunk = rel->chunks; chunk; chunk = chunk->next) maxevents += 2; } -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS { - struct grub_relocator_extra_block *cur; + struct VasEBoot_relocator_extra_block *cur; for (cur = extra_blocks; cur; cur = cur->next) maxevents += 2; } - for (r = grub_mm_base; r; r = r->next) + for (r = VasEBoot_mm_base; r; r = r->next) maxevents += 2; - maxevents += grub_relocator_firmware_get_max_events (); + maxevents += VasEBoot_relocator_firmware_get_max_events (); #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS { - struct grub_relocator_fw_leftover *cur; + struct VasEBoot_relocator_fw_leftover *cur; for (cur = leftovers; cur; cur = cur->next) { int l = 0; unsigned i; - for (i = 0; i < GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; i++) + for (i = 0; i < VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; i++) { if (l != ((cur->freebytes[i / 8] >> (i % 8)) & 1)) maxevents++; @@ -495,22 +495,22 @@ malloc_in_range (struct grub_relocator *rel, } #endif - eventt = grub_malloc (maxevents * sizeof (events[0])); - counter = grub_malloc ((DIGITSORT_MASK + 2) * sizeof (counter[0])); - events = grub_malloc (maxevents * sizeof (events[0])); + eventt = VasEBoot_malloc (maxevents * sizeof (events[0])); + counter = VasEBoot_malloc ((DIGITSORT_MASK + 2) * sizeof (counter[0])); + events = VasEBoot_malloc (maxevents * sizeof (events[0])); if (!events || !eventt || !counter) { - grub_dprintf ("relocator", "events or counter allocation failed %d\n", + VasEBoot_dprintf ("relocator", "events or counter allocation failed %d\n", maxevents); - grub_free (events); - grub_free (eventt); - grub_free (counter); + VasEBoot_free (events); + VasEBoot_free (eventt); + VasEBoot_free (counter); return 0; } if (collisioncheck && rel) { - struct grub_relocator_chunk *chunk; + struct VasEBoot_relocator_chunk *chunk; for (chunk = rel->chunks; chunk; chunk = chunk->next) { events[N].type = COLLISION_START; @@ -522,27 +522,27 @@ malloc_in_range (struct grub_relocator *rel, } } -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS - for (r = grub_mm_base; r; r = r->next) +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS + for (r = VasEBoot_mm_base; r; r = r->next) { #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "Blocking at 0x%lx-0x%lx\n", + VasEBoot_dprintf ("relocator", "Blocking at 0x%lx-0x%lx\n", (unsigned long) r - r->pre_size, (unsigned long) (r + 1) + r->size); #endif events[N].type = FIRMWARE_BLOCK_START; - events[N].pos = (grub_addr_t) r - r->pre_size; + events[N].pos = (VasEBoot_addr_t) r - r->pre_size; N++; events[N].type = FIRMWARE_BLOCK_END; - events[N].pos = (grub_addr_t) (r + 1) + r->size; + events[N].pos = (VasEBoot_addr_t) (r + 1) + r->size; N++; } { - struct grub_relocator_extra_block *cur; + struct VasEBoot_relocator_extra_block *cur; for (cur = extra_blocks; cur; cur = cur->next) { #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "Blocking at 0x%lx-0x%lx\n", + VasEBoot_dprintf ("relocator", "Blocking at 0x%lx-0x%lx\n", (unsigned long) cur->start, (unsigned long) cur->end); #endif events[N].type = FIRMWARE_BLOCK_START; @@ -554,16 +554,16 @@ malloc_in_range (struct grub_relocator *rel, } } - N += grub_relocator_firmware_fill_events (events + N); + N += VasEBoot_relocator_firmware_fill_events (events + N); -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS { - struct grub_relocator_fw_leftover *cur; + struct VasEBoot_relocator_fw_leftover *cur; for (cur = leftovers; cur; cur = cur->next) { unsigned i; int l = 0; - for (i = 0; i < GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; i++) + for (i = 0; i < VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; i++) { if (l != ((cur->freebytes[i / 8] >> (i % 8)) & 1)) { @@ -587,45 +587,45 @@ malloc_in_range (struct grub_relocator *rel, #endif /* No malloc from this point. */ - base_saved = grub_mm_base; - grub_mm_base = NULL; + base_saved = VasEBoot_mm_base; + VasEBoot_mm_base = NULL; for (ra = &base_saved, r = *ra; r; ra = &(r->next), r = *ra) { pa = r->first; p = pa->next; - if (p->magic == GRUB_MM_ALLOC_MAGIC) + if (p->magic == VasEBoot_MM_ALLOC_MAGIC) continue; do { - if (p->magic != GRUB_MM_FREE_MAGIC) - grub_fatal ("%s:%d free magic broken at %p (0x%x)\n", + if (p->magic != VasEBoot_MM_FREE_MAGIC) + VasEBoot_fatal ("%s:%d free magic broken at %p (0x%x)\n", __FILE__, __LINE__, p, p->magic); - if (p == (grub_mm_header_t) (r + 1)) + if (p == (VasEBoot_mm_header_t) (r + 1)) { events[N].type = REG_BEG_START; - events[N].pos = grub_vtop (r) - r->pre_size; + events[N].pos = VasEBoot_vtop (r) - r->pre_size; events[N].reg = r; events[N].regancestor = ra; events[N].head = p; events[N].hancestor = pa; N++; events[N].type = REG_BEG_END; - events[N].pos = grub_vtop (p + p->size) - sizeof (*r) - - sizeof (struct grub_mm_header); + events[N].pos = VasEBoot_vtop (p + p->size) - sizeof (*r) + - sizeof (struct VasEBoot_mm_header); N++; } else { events[N].type = IN_REG_START; - events[N].pos = grub_vtop (p); + events[N].pos = VasEBoot_vtop (p); events[N].head = p; events[N].hancestor = pa; events[N].reg = r; N++; events[N].type = IN_REG_END; - events[N].pos = grub_vtop (p + p->size); + events[N].pos = VasEBoot_vtop (p + p->size); N++; } pa = p; @@ -649,10 +649,10 @@ malloc_in_range (struct grub_relocator *rel, { unsigned i; - for (i = 0; i < (BITS_IN_BYTE * sizeof (grub_addr_t) / DIGITSORT_BITS); + for (i = 0; i < (BITS_IN_BYTE * sizeof (VasEBoot_addr_t) / DIGITSORT_BITS); i++) { - grub_memset (counter, 0, (1 + (1 << DIGITSORT_BITS)) * sizeof (counter[0])); + VasEBoot_memset (counter, 0, (1 + (1 << DIGITSORT_BITS)) * sizeof (counter[0])); for (j = 0; j < N; j++) counter[((events[j].pos >> (DIGITSORT_BITS * i)) & DIGITSORT_MASK) + 1]++; @@ -667,19 +667,19 @@ malloc_in_range (struct grub_relocator *rel, } } -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS retry: #endif /* Now events are nicely sorted. */ { int nstarted = 0, ncollisions = 0, nstartedfw = 0, nblockfw = 0; -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS int nlefto = 0; #else const int nlefto = 0; #endif - grub_addr_t starta = 0; + VasEBoot_addr_t starta = 0; for (j = from_low_priv ? 0 : N - 1; from_low_priv ? j < N : (j + 1); from_low_priv ? j++ : j--) { @@ -688,7 +688,7 @@ malloc_in_range (struct grub_relocator *rel, && !nblockfw)))); switch (events[j].type) { -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS case REG_FIRMWARE_START: nstartedfw++; break; @@ -706,7 +706,7 @@ malloc_in_range (struct grub_relocator *rel, break; #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS case REG_LEFTOVER_START: nlefto++; break; @@ -769,19 +769,19 @@ malloc_in_range (struct grub_relocator *rel, } } - grub_mm_base = base_saved; - grub_free (events); - grub_free (eventt); - grub_free (counter); + VasEBoot_mm_base = base_saved; + VasEBoot_free (events); + VasEBoot_free (eventt); + VasEBoot_free (counter); return 0; found: { int inreg = 0, regbeg = 0, ncol = 0; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS int fwin = 0, fwb = 0, fwlefto = 0; #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS int last_lo = 0; #endif int last_start = 0; @@ -794,7 +794,7 @@ malloc_in_range (struct grub_relocator *rel, typepre = CHUNK_TYPE_REGION_START; else if (inreg) typepre = CHUNK_TYPE_IN_REGION; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS else if (fwin && !fwb) typepre = CHUNK_TYPE_FIRMWARE; else if (fwlefto && !fwb) @@ -805,7 +805,7 @@ malloc_in_range (struct grub_relocator *rel, if (j != 0 && events[j - 1].pos != events[j].pos) { - grub_addr_t alloc_start, alloc_end; + VasEBoot_addr_t alloc_start, alloc_end; alloc_start = max (events[j - 1].pos, target); alloc_end = min (events[j].pos, target + size); if (alloc_end > alloc_start) @@ -837,23 +837,23 @@ malloc_in_range (struct grub_relocator *rel, events[k].hancestor = events[last_start].hancestor; } break; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS case CHUNK_TYPE_FIRMWARE: { - grub_addr_t fstart, fend; + VasEBoot_addr_t fstart, fend; fstart = ALIGN_DOWN (alloc_start, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); fend = ALIGN_UP (alloc_end, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "requesting %lx-%lx\n", + VasEBoot_dprintf ("relocator", "requesting %lx-%lx\n", (unsigned long) fstart, (unsigned long) fend); #endif /* The failure here can be very expensive. */ - if (!grub_relocator_firmware_alloc_region (fstart, + if (!VasEBoot_relocator_firmware_alloc_region (fstart, fend - fstart)) { if (from_low_priv) @@ -866,20 +866,20 @@ malloc_in_range (struct grub_relocator *rel, } #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS case CHUNK_TYPE_LEFTOVER: { unsigned offstart = alloc_start - % GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; + % VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; unsigned offend = alloc_end - % GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; - struct grub_relocator_fw_leftover *lo + % VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; + struct VasEBoot_relocator_fw_leftover *lo = events[last_lo].leftover; if (offend == 0 && alloc_end != alloc_start) - offend = GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; + offend = VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; lo->freebytes[offstart / 8] &= ((1 << (8 - (start % 8))) - 1); - grub_memset (lo->freebytes + (offstart + 7) / 8, 0, + VasEBoot_memset (lo->freebytes + (offstart + 7) / 8, 0, offend / 8 - (offstart + 7) / 8); lo->freebytes[offend / 8] &= ~((1 << (offend % 8)) - 1); } @@ -895,7 +895,7 @@ malloc_in_range (struct grub_relocator *rel, case REG_BEG_START: case IN_REG_START: if (events[j].type == REG_BEG_START && - (grub_addr_t) (events[j].reg + 1) > target) + (VasEBoot_addr_t) (events[j].reg + 1) > target) regbeg++; else inreg++; @@ -910,7 +910,7 @@ malloc_in_range (struct grub_relocator *rel, inreg--; break; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS case REG_FIRMWARE_START: fwin++; break; @@ -928,7 +928,7 @@ malloc_in_range (struct grub_relocator *rel, break; #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS case REG_LEFTOVER_START: fwlefto++; last_lo = j; @@ -950,20 +950,20 @@ malloc_in_range (struct grub_relocator *rel, } /* Malloc is available again. */ - grub_mm_base = base_saved; + VasEBoot_mm_base = base_saved; - grub_free (eventt); - grub_free (counter); + VasEBoot_free (eventt); + VasEBoot_free (counter); { int last_start = 0; int inreg = 0, regbeg = 0, ncol = 0; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS int fwin = 0, fwlefto = 0, fwb = 0; #endif unsigned cural = 0; int oom = 0; - res->subchunks = grub_malloc (sizeof (res->subchunks[0]) * nallocs); + res->subchunks = VasEBoot_malloc (sizeof (res->subchunks[0]) * nallocs); if (!res->subchunks) oom = 1; res->nsubchunks = nallocs; @@ -977,7 +977,7 @@ malloc_in_range (struct grub_relocator *rel, typepre = CHUNK_TYPE_REGION_START; else if (inreg) typepre = CHUNK_TYPE_IN_REGION; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS else if (fwin && !fwb) typepre = CHUNK_TYPE_FIRMWARE; else if (fwlefto && !fwb) @@ -988,9 +988,9 @@ malloc_in_range (struct grub_relocator *rel, if (j != 0 && events[j - 1].pos != events[j].pos) { - grub_addr_t alloc_start, alloc_end; - struct grub_relocator_subchunk tofree; - struct grub_relocator_subchunk *curschu = &tofree; + VasEBoot_addr_t alloc_start, alloc_end; + struct VasEBoot_relocator_subchunk tofree; + struct VasEBoot_relocator_subchunk *curschu = &tofree; if (!oom) curschu = &res->subchunks[cural]; alloc_start = max (events[j - 1].pos, target); @@ -998,7 +998,7 @@ malloc_in_range (struct grub_relocator *rel, if (alloc_end > alloc_start) { #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF - grub_dprintf ("relocator", "subchunk 0x%lx-0x%lx, %d\n", + VasEBoot_dprintf ("relocator", "subchunk 0x%lx-0x%lx, %d\n", (unsigned long) alloc_start, (unsigned long) alloc_end, typepre); #endif @@ -1012,17 +1012,17 @@ malloc_in_range (struct grub_relocator *rel, curschu->pre_size = alloc_start - events[j - 1].pos; } if (!oom && (typepre == CHUNK_TYPE_REGION_START -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS || typepre == CHUNK_TYPE_FIRMWARE #endif )) { - struct grub_relocator_extra_block *ne; - ne = grub_malloc (sizeof (*ne)); + struct VasEBoot_relocator_extra_block *ne; + ne = VasEBoot_malloc (sizeof (*ne)); if (!ne) { oom = 1; - grub_memcpy (&tofree, curschu, sizeof (tofree)); + VasEBoot_memcpy (&tofree, curschu, sizeof (tofree)); } else { @@ -1037,47 +1037,47 @@ malloc_in_range (struct grub_relocator *rel, } } -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS if (!oom && typepre == CHUNK_TYPE_FIRMWARE) { - grub_addr_t fstart, fend; + VasEBoot_addr_t fstart, fend; fstart = ALIGN_DOWN (alloc_start, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); fend = ALIGN_UP (alloc_end, - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); + VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT); { - struct grub_relocator_fw_leftover *lo1 = NULL; - struct grub_relocator_fw_leftover *lo2 = NULL; + struct VasEBoot_relocator_fw_leftover *lo1 = NULL; + struct VasEBoot_relocator_fw_leftover *lo2 = NULL; if (fstart != alloc_start) - lo1 = grub_malloc (sizeof (*lo1)); + lo1 = VasEBoot_malloc (sizeof (*lo1)); if (fend != alloc_end) - lo2 = grub_malloc (sizeof (*lo2)); + lo2 = VasEBoot_malloc (sizeof (*lo2)); if ((!lo1 && fstart != alloc_start) || (!lo2 && fend != alloc_end)) { - struct grub_relocator_extra_block *ne; - grub_free (lo1); - grub_free (lo2); + struct VasEBoot_relocator_extra_block *ne; + VasEBoot_free (lo1); + VasEBoot_free (lo2); lo1 = NULL; lo2 = NULL; oom = 1; - grub_memcpy (&tofree, curschu, sizeof (tofree)); + VasEBoot_memcpy (&tofree, curschu, sizeof (tofree)); ne = extra_blocks; extra_blocks = extra_blocks->next; - grub_free (ne); + VasEBoot_free (ne); } if (lo1) { lo1->quantstart = fstart; - grub_memset (lo1->freebytes, 0xff, + VasEBoot_memset (lo1->freebytes, 0xff, (alloc_start - fstart) / 8); lo1->freebytes[(alloc_start - fstart) / 8] = (1 << ((alloc_start - fstart) % 8)) - 1; - grub_memset (lo1->freebytes + VasEBoot_memset (lo1->freebytes + ((alloc_start - fstart) / 8) + 1, 0, sizeof (lo1->freebytes) - (alloc_start - fstart) / 8 - 1); @@ -1090,12 +1090,12 @@ malloc_in_range (struct grub_relocator *rel, if (lo2) { lo2->quantstart - = fend - GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT; - grub_memset (lo2->freebytes, 0, + = fend - VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT; + VasEBoot_memset (lo2->freebytes, 0, (alloc_end - lo2->quantstart) / 8); lo2->freebytes[(alloc_end - lo2->quantstart) / 8] = ~((1 << ((alloc_end - lo2->quantstart) % 8)) - 1); - grub_memset (lo2->freebytes + VasEBoot_memset (lo2->freebytes + ((alloc_end - lo2->quantstart) / 8) + 1, 0, sizeof (lo2->freebytes) - (alloc_end - lo2->quantstart) / 8 - 1); @@ -1129,7 +1129,7 @@ malloc_in_range (struct grub_relocator *rel, case REG_BEG_START: case IN_REG_START: if (events[j].type == REG_BEG_START && - (grub_addr_t) (events[j].reg + 1) > target) + (VasEBoot_addr_t) (events[j].reg + 1) > target) regbeg++; else inreg++; @@ -1141,7 +1141,7 @@ malloc_in_range (struct grub_relocator *rel, inreg = regbeg = 0; break; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS case REG_FIRMWARE_START: fwin++; break; @@ -1159,7 +1159,7 @@ malloc_in_range (struct grub_relocator *rel, break; #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS case REG_LEFTOVER_START: fwlefto++; break; @@ -1181,9 +1181,9 @@ malloc_in_range (struct grub_relocator *rel, unsigned i; for (i = 0; i < cural; i++) free_subchunk (&res->subchunks[i]); - grub_free (res->subchunks); - grub_dprintf ("relocator", "allocation failed with out-of-memory\n"); - grub_free (events); + VasEBoot_free (res->subchunks); + VasEBoot_dprintf ("relocator", "allocation failed with out-of-memory\n"); + VasEBoot_free (events); return 0; } @@ -1192,20 +1192,20 @@ malloc_in_range (struct grub_relocator *rel, res->src = target; res->size = size; - grub_free (events); + VasEBoot_free (events); - grub_dprintf ("relocator", "allocated: 0x%lx+0x%lx\n", (unsigned long) target, + VasEBoot_dprintf ("relocator", "allocated: 0x%lx+0x%lx\n", (unsigned long) target, (unsigned long) size); return 1; } static void -adjust_limits (struct grub_relocator *rel, - grub_phys_addr_t *min_addr, grub_phys_addr_t *max_addr, - grub_phys_addr_t in_min, grub_phys_addr_t in_max) +adjust_limits (struct VasEBoot_relocator *rel, + VasEBoot_phys_addr_t *min_addr, VasEBoot_phys_addr_t *max_addr, + VasEBoot_phys_addr_t in_min, VasEBoot_phys_addr_t in_max) { - struct grub_relocator_chunk *chunk; + struct VasEBoot_relocator_chunk *chunk; *min_addr = 0; *max_addr = rel->postchunks; @@ -1223,29 +1223,29 @@ adjust_limits (struct grub_relocator *rel, } } -grub_err_t -grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, - grub_relocator_chunk_t *out, - grub_phys_addr_t target, grub_size_t size) +VasEBoot_err_t +VasEBoot_relocator_alloc_chunk_addr (struct VasEBoot_relocator *rel, + VasEBoot_relocator_chunk_t *out, + VasEBoot_phys_addr_t target, VasEBoot_size_t size) { - struct grub_relocator_chunk *chunk; - grub_phys_addr_t min_addr = 0, max_addr; + struct VasEBoot_relocator_chunk *chunk; + VasEBoot_phys_addr_t min_addr = 0, max_addr; if (target > ~size) - return grub_error (GRUB_ERR_BUG, "address is out of range"); + return VasEBoot_error (VasEBoot_ERR_BUG, "address is out of range"); adjust_limits (rel, &min_addr, &max_addr, target, target); for (chunk = rel->chunks; chunk; chunk = chunk->next) if ((chunk->target <= target && target < chunk->target + chunk->size) || (target <= chunk->target && chunk->target < target + size)) - return grub_error (GRUB_ERR_BUG, "overlap detected"); + return VasEBoot_error (VasEBoot_ERR_BUG, "overlap detected"); - chunk = grub_malloc (sizeof (struct grub_relocator_chunk)); + chunk = VasEBoot_malloc (sizeof (struct VasEBoot_relocator_chunk)); if (!chunk) - return grub_errno; + return VasEBoot_errno; - grub_dprintf ("relocator", + VasEBoot_dprintf ("relocator", "min_addr = 0x%llx, max_addr = 0x%llx, target = 0x%llx\n", (unsigned long long) min_addr, (unsigned long long) max_addr, (unsigned long long) target); @@ -1255,7 +1255,7 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, /* A trick to improve Linux allocation. */ #if defined (__i386__) || defined (__x86_64__) if (target < 0x100000) - if (malloc_in_range (rel, rel->highestnonpostaddr, ~(grub_addr_t)0, 1, + if (malloc_in_range (rel, rel->highestnonpostaddr, ~(VasEBoot_addr_t)0, 1, size, chunk, 0, 1)) { if (rel->postchunks > chunk->src) @@ -1269,7 +1269,7 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, if (malloc_in_range (rel, min_addr, target, 1, size, chunk, 0, 0)) break; - if (malloc_in_range (rel, rel->highestnonpostaddr, ~(grub_addr_t)0, 1, + if (malloc_in_range (rel, rel->highestnonpostaddr, ~(VasEBoot_addr_t)0, 1, size, chunk, 0, 1)) { if (rel->postchunks > chunk->src) @@ -1277,13 +1277,13 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, break; } - grub_dprintf ("relocator", "not allocated\n"); - grub_free (chunk); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_dprintf ("relocator", "not allocated\n"); + VasEBoot_free (chunk); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); } while (0); - grub_dprintf ("relocator", "allocated 0x%llx/0x%llx\n", + VasEBoot_dprintf ("relocator", "allocated 0x%llx/0x%llx\n", (unsigned long long) chunk->src, (unsigned long long) target); if (rel->highestaddr < target + size) @@ -1301,52 +1301,52 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, rel->highestnonpostaddr = chunk->src + size; } - grub_dprintf ("relocator", "relocators_size=%ld\n", + VasEBoot_dprintf ("relocator", "relocators_size=%ld\n", (unsigned long) rel->relocators_size); if (chunk->src < target) - rel->relocators_size += grub_relocator_backward_size; + rel->relocators_size += VasEBoot_relocator_backward_size; if (chunk->src > target) - rel->relocators_size += grub_relocator_forward_size; + rel->relocators_size += VasEBoot_relocator_forward_size; - grub_dprintf ("relocator", "relocators_size=%ld\n", + VasEBoot_dprintf ("relocator", "relocators_size=%ld\n", (unsigned long) rel->relocators_size); chunk->target = target; chunk->size = size; chunk->next = rel->chunks; rel->chunks = chunk; - grub_dprintf ("relocator", "cur = %p, next = %p\n", rel->chunks, + VasEBoot_dprintf ("relocator", "cur = %p, next = %p\n", rel->chunks, rel->chunks->next); - chunk->srcv = grub_map_memory (chunk->src, chunk->size); + chunk->srcv = VasEBoot_map_memory (chunk->src, chunk->size); *out = chunk; #ifdef DEBUG_RELOCATOR - grub_memset (chunk->srcv, 0xfa, chunk->size); - grub_mm_check (); + VasEBoot_memset (chunk->srcv, 0xfa, chunk->size); + VasEBoot_mm_check (); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Context for grub_relocator_alloc_chunk_align. */ -struct grub_relocator_alloc_chunk_align_ctx +/* Context for VasEBoot_relocator_alloc_chunk_align. */ +struct VasEBoot_relocator_alloc_chunk_align_ctx { - grub_phys_addr_t min_addr, max_addr; - grub_size_t size, align; + VasEBoot_phys_addr_t min_addr, max_addr; + VasEBoot_size_t size, align; int preference; - struct grub_relocator_chunk *chunk; + struct VasEBoot_relocator_chunk *chunk; int found; }; -/* Helper for grub_relocator_alloc_chunk_align. */ +/* Helper for VasEBoot_relocator_alloc_chunk_align. */ static int -grub_relocator_alloc_chunk_align_iter (grub_uint64_t addr, grub_uint64_t sz, - grub_memory_type_t type, void *data) +VasEBoot_relocator_alloc_chunk_align_iter (VasEBoot_uint64_t addr, VasEBoot_uint64_t sz, + VasEBoot_memory_type_t type, void *data) { - struct grub_relocator_alloc_chunk_align_ctx *ctx = data; - grub_uint64_t candidate; + struct VasEBoot_relocator_alloc_chunk_align_ctx *ctx = data; + VasEBoot_uint64_t candidate; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; candidate = ALIGN_UP (addr, ctx->align); if (candidate < ctx->min_addr) @@ -1354,29 +1354,29 @@ grub_relocator_alloc_chunk_align_iter (grub_uint64_t addr, grub_uint64_t sz, if (candidate + ctx->size > addr + sz || candidate > ALIGN_DOWN (ctx->max_addr, ctx->align)) return 0; - if (ctx->preference == GRUB_RELOCATOR_PREFERENCE_HIGH) + if (ctx->preference == VasEBoot_RELOCATOR_PREFERENCE_HIGH) candidate = ALIGN_DOWN (min (addr + sz - ctx->size, ctx->max_addr), ctx->align); - if (!ctx->found || (ctx->preference == GRUB_RELOCATOR_PREFERENCE_HIGH + if (!ctx->found || (ctx->preference == VasEBoot_RELOCATOR_PREFERENCE_HIGH && candidate > ctx->chunk->target)) ctx->chunk->target = candidate; - if (!ctx->found || (ctx->preference == GRUB_RELOCATOR_PREFERENCE_LOW + if (!ctx->found || (ctx->preference == VasEBoot_RELOCATOR_PREFERENCE_LOW && candidate < ctx->chunk->target)) ctx->chunk->target = candidate; ctx->found = 1; return 0; } -grub_err_t -grub_relocator_alloc_chunk_align (struct grub_relocator *rel, - grub_relocator_chunk_t *out, - grub_phys_addr_t min_addr, - grub_phys_addr_t max_addr, - grub_size_t size, grub_size_t align, +VasEBoot_err_t +VasEBoot_relocator_alloc_chunk_align (struct VasEBoot_relocator *rel, + VasEBoot_relocator_chunk_t *out, + VasEBoot_phys_addr_t min_addr, + VasEBoot_phys_addr_t max_addr, + VasEBoot_size_t size, VasEBoot_size_t align, int preference, int avoid_efi_boot_services) { - struct grub_relocator_alloc_chunk_align_ctx ctx = { + struct VasEBoot_relocator_alloc_chunk_align_ctx ctx = { .min_addr = min_addr, .max_addr = max_addr, .size = size, @@ -1384,41 +1384,41 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel, .preference = preference, .found = 0 }; - grub_addr_t min_addr2 = 0, max_addr2; + VasEBoot_addr_t min_addr2 = 0, max_addr2; if (max_addr > ~size) max_addr = ~size; -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS if (min_addr < 0x1000) min_addr = 0x1000; #endif - grub_dprintf ("relocator", "chunks = %p\n", rel->chunks); + VasEBoot_dprintf ("relocator", "chunks = %p\n", rel->chunks); - ctx.chunk = grub_malloc (sizeof (struct grub_relocator_chunk)); + ctx.chunk = VasEBoot_malloc (sizeof (struct VasEBoot_relocator_chunk)); if (!ctx.chunk) - return grub_errno; + return VasEBoot_errno; if (malloc_in_range (rel, min_addr, max_addr, align, size, ctx.chunk, - preference != GRUB_RELOCATOR_PREFERENCE_HIGH, 1)) + preference != VasEBoot_RELOCATOR_PREFERENCE_HIGH, 1)) { - grub_dprintf ("relocator", "allocated 0x%llx/0x%llx\n", + VasEBoot_dprintf ("relocator", "allocated 0x%llx/0x%llx\n", (unsigned long long) ctx.chunk->src, (unsigned long long) ctx.chunk->src); - grub_dprintf ("relocator", "chunks = %p\n", rel->chunks); + VasEBoot_dprintf ("relocator", "chunks = %p\n", rel->chunks); ctx.chunk->target = ctx.chunk->src; ctx.chunk->size = size; ctx.chunk->next = rel->chunks; rel->chunks = ctx.chunk; - ctx.chunk->srcv = grub_map_memory (ctx.chunk->src, ctx.chunk->size); + ctx.chunk->srcv = VasEBoot_map_memory (ctx.chunk->src, ctx.chunk->size); *out = ctx.chunk; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } adjust_limits (rel, &min_addr2, &max_addr2, min_addr, max_addr); - grub_dprintf ("relocator", "Adjusted limits from %lx-%lx to %lx-%lx\n", + VasEBoot_dprintf ("relocator", "Adjusted limits from %lx-%lx to %lx-%lx\n", (unsigned long) min_addr, (unsigned long) max_addr, (unsigned long) min_addr2, (unsigned long) max_addr2); @@ -1428,7 +1428,7 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel, size, ctx.chunk, 1, 1)) break; - if (malloc_in_range (rel, rel->highestnonpostaddr, ~(grub_addr_t)0, 1, + if (malloc_in_range (rel, rel->highestnonpostaddr, ~(VasEBoot_addr_t)0, 1, size, ctx.chunk, 0, 1)) { if (rel->postchunks > ctx.chunk->src) @@ -1436,34 +1436,34 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel, break; } - return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); } while (0); { -#ifdef GRUB_MACHINE_EFI - grub_efi_mmap_iterate (grub_relocator_alloc_chunk_align_iter, &ctx, +#ifdef VasEBoot_MACHINE_EFI + VasEBoot_efi_mmap_iterate (VasEBoot_relocator_alloc_chunk_align_iter, &ctx, avoid_efi_boot_services); -#elif defined (__powerpc__) || defined (GRUB_MACHINE_XEN) +#elif defined (__powerpc__) || defined (VasEBoot_MACHINE_XEN) (void) avoid_efi_boot_services; - grub_machine_mmap_iterate (grub_relocator_alloc_chunk_align_iter, &ctx); + VasEBoot_machine_mmap_iterate (VasEBoot_relocator_alloc_chunk_align_iter, &ctx); #else (void) avoid_efi_boot_services; - grub_mmap_iterate (grub_relocator_alloc_chunk_align_iter, &ctx); + VasEBoot_mmap_iterate (VasEBoot_relocator_alloc_chunk_align_iter, &ctx); #endif if (!ctx.found) - return grub_error (GRUB_ERR_BAD_OS, "couldn't find suitable memory target"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "couldn't find suitable memory target"); } while (1) { - struct grub_relocator_chunk *chunk2; + struct VasEBoot_relocator_chunk *chunk2; for (chunk2 = rel->chunks; chunk2; chunk2 = chunk2->next) if ((chunk2->target <= ctx.chunk->target && ctx.chunk->target < chunk2->target + chunk2->size) || (ctx.chunk->target <= chunk2->target && chunk2->target < ctx.chunk->target + size)) { - if (preference == GRUB_RELOCATOR_PREFERENCE_HIGH) + if (preference == VasEBoot_RELOCATOR_PREFERENCE_HIGH) ctx.chunk->target = ALIGN_DOWN (chunk2->target, align); else ctx.chunk->target = ALIGN_UP (chunk2->target + chunk2->size, @@ -1474,35 +1474,35 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel, break; } - grub_dprintf ("relocator", "relocators_size=%ld\n", + VasEBoot_dprintf ("relocator", "relocators_size=%ld\n", (unsigned long) rel->relocators_size); if (ctx.chunk->src < ctx.chunk->target) - rel->relocators_size += grub_relocator_backward_size; + rel->relocators_size += VasEBoot_relocator_backward_size; if (ctx.chunk->src > ctx.chunk->target) - rel->relocators_size += grub_relocator_forward_size; + rel->relocators_size += VasEBoot_relocator_forward_size; - grub_dprintf ("relocator", "relocators_size=%ld\n", + VasEBoot_dprintf ("relocator", "relocators_size=%ld\n", (unsigned long) rel->relocators_size); ctx.chunk->size = size; ctx.chunk->next = rel->chunks; rel->chunks = ctx.chunk; - grub_dprintf ("relocator", "cur = %p, next = %p\n", rel->chunks, + VasEBoot_dprintf ("relocator", "cur = %p, next = %p\n", rel->chunks, rel->chunks->next); - ctx.chunk->srcv = grub_map_memory (ctx.chunk->src, ctx.chunk->size); + ctx.chunk->srcv = VasEBoot_map_memory (ctx.chunk->src, ctx.chunk->size); *out = ctx.chunk; #ifdef DEBUG_RELOCATOR - grub_memset (ctx.chunk->srcv, 0xfa, ctx.chunk->size); - grub_mm_check (); + VasEBoot_memset (ctx.chunk->srcv, 0xfa, ctx.chunk->size); + VasEBoot_mm_check (); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_relocator_unload (struct grub_relocator *rel) +VasEBoot_relocator_unload (struct VasEBoot_relocator *rel) { - struct grub_relocator_chunk *chunk, *next; + struct VasEBoot_relocator_chunk *chunk, *next; if (!rel) return; for (chunk = rel->chunks; chunk; chunk = next) @@ -1510,79 +1510,79 @@ grub_relocator_unload (struct grub_relocator *rel) unsigned i; for (i = 0; i < chunk->nsubchunks; i++) free_subchunk (&chunk->subchunks[i]); - grub_unmap_memory (chunk->srcv, chunk->size); + VasEBoot_unmap_memory (chunk->srcv, chunk->size); next = chunk->next; - grub_free (chunk->subchunks); - grub_free (chunk); + VasEBoot_free (chunk->subchunks); + VasEBoot_free (chunk); } - grub_free (rel); + VasEBoot_free (rel); } -grub_err_t -grub_relocator_prepare_relocs (struct grub_relocator *rel, grub_addr_t addr, - void **relstart, grub_size_t *relsize) +VasEBoot_err_t +VasEBoot_relocator_prepare_relocs (struct VasEBoot_relocator *rel, VasEBoot_addr_t addr, + void **relstart, VasEBoot_size_t *relsize) { - grub_uint8_t *rels; - grub_uint8_t *rels0; - struct grub_relocator_chunk *sorted; - grub_size_t nchunks = 0; + VasEBoot_uint8_t *rels; + VasEBoot_uint8_t *rels0; + struct VasEBoot_relocator_chunk *sorted; + VasEBoot_size_t nchunks = 0; unsigned j; - struct grub_relocator_chunk movers_chunk; + struct VasEBoot_relocator_chunk movers_chunk; - grub_dprintf ("relocator", "Preparing relocs (size=%ld)\n", + VasEBoot_dprintf ("relocator", "Preparing relocs (size=%ld)\n", (unsigned long) rel->relocators_size); - if (!malloc_in_range (rel, 0, ~(grub_addr_t)0 - rel->relocators_size + 1, - grub_relocator_align, + if (!malloc_in_range (rel, 0, ~(VasEBoot_addr_t)0 - rel->relocators_size + 1, + VasEBoot_relocator_align, rel->relocators_size, &movers_chunk, 1, 1)) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); movers_chunk.srcv = rels = rels0 - = grub_map_memory (movers_chunk.src, movers_chunk.size); + = VasEBoot_map_memory (movers_chunk.src, movers_chunk.size); if (relsize) *relsize = rel->relocators_size; - grub_dprintf ("relocator", "Relocs allocated at %p\n", movers_chunk.srcv); + VasEBoot_dprintf ("relocator", "Relocs allocated at %p\n", movers_chunk.srcv); { unsigned i; - grub_size_t count[257]; - struct grub_relocator_chunk *from, *to, *tmp; + VasEBoot_size_t count[257]; + struct VasEBoot_relocator_chunk *from, *to, *tmp; - grub_memset (count, 0, sizeof (count)); + VasEBoot_memset (count, 0, sizeof (count)); { - struct grub_relocator_chunk *chunk; + struct VasEBoot_relocator_chunk *chunk; for (chunk = rel->chunks; chunk; chunk = chunk->next) { - grub_dprintf ("relocator", "chunk %p->%p, 0x%lx\n", + VasEBoot_dprintf ("relocator", "chunk %p->%p, 0x%lx\n", (void *) chunk->src, (void *) chunk->target, (unsigned long) chunk->size); nchunks++; count[(chunk->src & 0xff) + 1]++; } } - from = grub_malloc (nchunks * sizeof (sorted[0])); - to = grub_malloc (nchunks * sizeof (sorted[0])); + from = VasEBoot_malloc (nchunks * sizeof (sorted[0])); + to = VasEBoot_malloc (nchunks * sizeof (sorted[0])); if (!from || !to) { - grub_free (from); - grub_free (to); - return grub_errno; + VasEBoot_free (from); + VasEBoot_free (to); + return VasEBoot_errno; } for (j = 0; j < 256; j++) count[j+1] += count[j]; { - struct grub_relocator_chunk *chunk; + struct VasEBoot_relocator_chunk *chunk; for (chunk = rel->chunks; chunk; chunk = chunk->next) from[count[chunk->src & 0xff]++] = *chunk; } - for (i = 1; i < GRUB_CPU_SIZEOF_VOID_P; i++) + for (i = 1; i < VasEBoot_CPU_SIZEOF_VOID_P; i++) { - grub_memset (count, 0, sizeof (count)); + VasEBoot_memset (count, 0, sizeof (count)); for (j = 0; j < nchunks; j++) count[((from[j].src >> (8 * i)) & 0xff) + 1]++; for (j = 0; j < 256; j++) @@ -1594,60 +1594,60 @@ grub_relocator_prepare_relocs (struct grub_relocator *rel, grub_addr_t addr, from = tmp; } sorted = from; - grub_free (to); + VasEBoot_free (to); } for (j = 0; j < nchunks; j++) { - grub_dprintf ("relocator", "sorted chunk %p->%p, 0x%lx\n", + VasEBoot_dprintf ("relocator", "sorted chunk %p->%p, 0x%lx\n", (void *) sorted[j].src, (void *) sorted[j].target, (unsigned long) sorted[j].size); if (sorted[j].src < sorted[j].target) { - grub_cpu_relocator_backward ((void *) rels, + VasEBoot_cpu_relocator_backward ((void *) rels, sorted[j].srcv, - grub_map_memory (sorted[j].target, + VasEBoot_map_memory (sorted[j].target, sorted[j].size), sorted[j].size); - rels += grub_relocator_backward_size; + rels += VasEBoot_relocator_backward_size; } if (sorted[j].src > sorted[j].target) { - grub_cpu_relocator_forward ((void *) rels, + VasEBoot_cpu_relocator_forward ((void *) rels, sorted[j].srcv, - grub_map_memory (sorted[j].target, + VasEBoot_map_memory (sorted[j].target, sorted[j].size), sorted[j].size); - rels += grub_relocator_forward_size; + rels += VasEBoot_relocator_forward_size; } if (sorted[j].src == sorted[j].target) - grub_arch_sync_caches (sorted[j].srcv, sorted[j].size); + VasEBoot_arch_sync_caches (sorted[j].srcv, sorted[j].size); } - grub_cpu_relocator_jumper ((void *) rels, (grub_addr_t) addr); + VasEBoot_cpu_relocator_jumper ((void *) rels, (VasEBoot_addr_t) addr); *relstart = rels0; - grub_free (sorted); - return GRUB_ERR_NONE; + VasEBoot_free (sorted); + return VasEBoot_ERR_NONE; } void -grub_mm_check_real (const char *file, int line) +VasEBoot_mm_check_real (const char *file, int line) { - grub_mm_region_t r; - grub_mm_header_t p, pa; + VasEBoot_mm_region_t r; + VasEBoot_mm_header_t p, pa; - for (r = grub_mm_base; r; r = r->next) + for (r = VasEBoot_mm_base; r; r = r->next) { pa = r->first; p = pa->next; - if (p->magic == GRUB_MM_ALLOC_MAGIC) + if (p->magic == VasEBoot_MM_ALLOC_MAGIC) continue; do { - if ((grub_addr_t) p < (grub_addr_t) (r + 1) - || (grub_addr_t) p >= (grub_addr_t) (r + 1) + r->size) - grub_fatal ("%s:%d: out of range pointer: %p\n", file, line, p); - if (p->magic != GRUB_MM_FREE_MAGIC) - grub_fatal ("%s:%d free magic broken at %p (0x%x)\n", file, + if ((VasEBoot_addr_t) p < (VasEBoot_addr_t) (r + 1) + || (VasEBoot_addr_t) p >= (VasEBoot_addr_t) (r + 1) + r->size) + VasEBoot_fatal ("%s:%d: out of range pointer: %p\n", file, line, p); + if (p->magic != VasEBoot_MM_FREE_MAGIC) + VasEBoot_fatal ("%s:%d free magic broken at %p (0x%x)\n", file, line, p, p->magic); pa = p; p = pa->next; diff --git a/VasEBoot-core/lib/sparc64/setjmp.S b/VasEBoot-core/lib/sparc64/setjmp.S index 6c11bdda0..d8df590f7 100644 --- a/VasEBoot-core/lib/sparc64/setjmp.S +++ b/VasEBoot-core/lib/sparc64/setjmp.S @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .text /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) +FUNCTION(VasEBoot_setjmp) stx %o7, [%o0 + 0x00] stx %sp, [%o0 + 0x08] stx %fp, [%o0 + 0x10] @@ -36,9 +36,9 @@ FUNCTION(grub_setjmp) clr %o0 /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) +FUNCTION(VasEBoot_longjmp) ldx [%o0 + 0x10], %g1 movrz %o1, 1, %o1 diff --git a/VasEBoot-core/lib/syslinux_parse.c b/VasEBoot-core/lib/syslinux_parse.c index 28ba3aef0..ea3180408 100644 --- a/VasEBoot-core/lib/syslinux_parse.c +++ b/VasEBoot-core/lib/syslinux_parse.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include struct syslinux_say { @@ -47,7 +47,7 @@ struct syslinux_menuentry char *argument; char *help; char *comments; - grub_size_t commentslen; + VasEBoot_size_t commentslen; char hotkey; int make_default; struct syslinux_say *say; @@ -70,74 +70,74 @@ struct syslinux_menu const char *current_read_directory; const char *current_target_directory; const char *filename; - grub_size_t commentslen; + VasEBoot_size_t commentslen; unsigned long timeout; struct syslinux_say *say; - grub_syslinux_flavour_t flavour; + VasEBoot_syslinux_flavour_t flavour; }; struct output_buffer { - grub_size_t alloc; - grub_size_t ptr; + VasEBoot_size_t alloc; + VasEBoot_size_t ptr; char *buf; }; -static grub_err_t +static VasEBoot_err_t syslinux_parse_real (struct syslinux_menu *menu); -static grub_err_t +static VasEBoot_err_t config_file (struct output_buffer *outbuf, const char *root, const char *target_root, const char *cwd, const char *target_cwd, const char *fname, struct syslinux_menu *parent, - grub_syslinux_flavour_t flav); -static grub_err_t + VasEBoot_syslinux_flavour_t flav); +static VasEBoot_err_t print_entry (struct output_buffer *outbuf, struct syslinux_menu *menu, const char *str); -static grub_err_t -ensure_space (struct output_buffer *outbuf, grub_size_t len) +static VasEBoot_err_t +ensure_space (struct output_buffer *outbuf, VasEBoot_size_t len) { - grub_size_t newlen; + VasEBoot_size_t newlen; char *newbuf; if (len < outbuf->alloc - outbuf->ptr) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; newlen = (outbuf->ptr + len + 10) * 2; - newbuf = grub_realloc (outbuf->buf, newlen); + newbuf = VasEBoot_realloc (outbuf->buf, newlen); if (!newbuf) - return grub_errno; + return VasEBoot_errno; outbuf->alloc = newlen; outbuf->buf = newbuf; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -print (struct output_buffer *outbuf, const char *str, grub_size_t len) +static VasEBoot_err_t +print (struct output_buffer *outbuf, const char *str, VasEBoot_size_t len) { - grub_err_t err; + VasEBoot_err_t err; err = ensure_space (outbuf, len); if (err) return err; - grub_memcpy (&outbuf->buf[outbuf->ptr], str, len); + VasEBoot_memcpy (&outbuf->buf[outbuf->ptr], str, len); outbuf->ptr += len; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t add_comment (struct syslinux_menu *menu, const char *comment, int nl) { if (menu->entries) { if (menu->entries->commentslen == 0 && *comment == 0) - return GRUB_ERR_NONE; - menu->entries->comments = grub_realloc (menu->entries->comments, + return VasEBoot_ERR_NONE; + menu->entries->comments = VasEBoot_realloc (menu->entries->comments, menu->entries->commentslen - + 2 + grub_strlen (comment)); + + 2 + VasEBoot_strlen (comment)); if (!menu->entries->comments) - return grub_errno; + return VasEBoot_errno; menu->entries->commentslen - += grub_stpcpy (menu->entries->comments + menu->entries->commentslen, + += VasEBoot_stpcpy (menu->entries->comments + menu->entries->commentslen, comment) - (menu->entries->comments + menu->entries->commentslen); if (nl) @@ -147,250 +147,250 @@ add_comment (struct syslinux_menu *menu, const char *comment, int nl) else { if (menu->commentslen == 0 && *comment == 0) - return GRUB_ERR_NONE; - menu->comments = grub_realloc (menu->comments, menu->commentslen - + 2 + grub_strlen (comment)); + return VasEBoot_ERR_NONE; + menu->comments = VasEBoot_realloc (menu->comments, menu->commentslen + + 2 + VasEBoot_strlen (comment)); if (!menu->comments) - return grub_errno; - menu->commentslen += grub_stpcpy (menu->comments + menu->commentslen, + return VasEBoot_errno; + menu->commentslen += VasEBoot_stpcpy (menu->comments + menu->commentslen, comment) - (menu->comments + menu->commentslen); if (nl) menu->comments[menu->commentslen++] = '\n'; menu->comments[menu->commentslen] = '\0'; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #define print_string(x) do { err = print (outbuf, x, sizeof (x) - 1); if (err) return err; } while (0) -static grub_err_t +static VasEBoot_err_t print_num (struct output_buffer *outbuf, int n) { char buf[20]; - grub_snprintf (buf, sizeof (buf), "%d", n); - return print (outbuf, buf, grub_strlen (buf)); + VasEBoot_snprintf (buf, sizeof (buf), "%d", n); + return print (outbuf, buf, VasEBoot_strlen (buf)); } -static grub_err_t +static VasEBoot_err_t label (const char *line, struct syslinux_menu *menu) { struct syslinux_menuentry *entry; - entry = grub_malloc (sizeof (*entry)); + entry = VasEBoot_malloc (sizeof (*entry)); if (!entry) - return grub_errno; - grub_memset (entry, 0, sizeof (*entry)); - entry->label = grub_strdup (line); + return VasEBoot_errno; + VasEBoot_memset (entry, 0, sizeof (*entry)); + entry->label = VasEBoot_strdup (line); if (!entry->label) { - grub_free (entry); - return grub_errno; + VasEBoot_free (entry); + return VasEBoot_errno; } entry->next = menu->entries; entry->prev = NULL; if (menu->entries) menu->entries->prev = entry; menu->entries = entry; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t kernel (const char *line, struct syslinux_menu *menu) { - const char *end = line + grub_strlen (line); + const char *end = line + VasEBoot_strlen (line); if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_LINUX; - if (end - line >= 2 && grub_strcmp (end - 2, ".0") == 0) + if (end - line >= 2 && VasEBoot_strcmp (end - 2, ".0") == 0) menu->entries->entry_type = KERNEL_PXE; - if (end - line >= 4 && grub_strcasecmp (end - 4, ".bin") == 0) + if (end - line >= 4 && VasEBoot_strcasecmp (end - 4, ".bin") == 0) menu->entries->entry_type = KERNEL_BIN; - if (end - line >= 3 && grub_strcasecmp (end - 3, ".bs") == 0) + if (end - line >= 3 && VasEBoot_strcasecmp (end - 3, ".bs") == 0) menu->entries->entry_type = KERNEL_CHAINLOADER; - if (end - line >= 4 && grub_strcasecmp (end - 4, ".bss") == 0) + if (end - line >= 4 && VasEBoot_strcasecmp (end - 4, ".bss") == 0) menu->entries->entry_type = KERNEL_CHAINLOADER_BPB; - if (end - line >= 4 && grub_strcasecmp (end - 4, ".c32") == 0) + if (end - line >= 4 && VasEBoot_strcasecmp (end - 4, ".c32") == 0) menu->entries->entry_type = KERNEL_COM32; - if (end - line >= 4 && grub_strcasecmp (end - 4, ".cbt") == 0) + if (end - line >= 4 && VasEBoot_strcasecmp (end - 4, ".cbt") == 0) menu->entries->entry_type = KERNEL_COM; - if (end - line >= 4 && grub_strcasecmp (end - 4, ".com") == 0) + if (end - line >= 4 && VasEBoot_strcasecmp (end - 4, ".com") == 0) menu->entries->entry_type = KERNEL_COM; - if (end - line >= 4 && grub_strcasecmp (end - 4, ".img") == 0) + if (end - line >= 4 && VasEBoot_strcasecmp (end - 4, ".img") == 0) menu->entries->entry_type = KERNEL_IMG; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_linux (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_LINUX; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_boot (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_CHAINLOADER; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_bss (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_CHAINLOADER_BPB; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_pxe (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_PXE; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_fdimage (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_IMG; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_comboot (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_COM; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_com32 (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = KERNEL_COM32; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_config (const char *line, struct syslinux_menu *menu) { const char *space; if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - for (space = line; *space && !grub_isspace (*space); space++); - menu->entries->kernel_file = grub_strndup (line, space - line); + for (space = line; *space && !VasEBoot_isspace (*space); space++); + menu->entries->kernel_file = VasEBoot_strndup (line, space - line); if (!menu->entries->kernel_file) - return grub_errno; - for (; *space && grub_isspace (*space); space++); + return VasEBoot_errno; + for (; *space && VasEBoot_isspace (*space); space++); if (*space) { - menu->entries->argument = grub_strdup (space); + menu->entries->argument = VasEBoot_strdup (space); if (!menu->entries->argument) - return grub_errno; + return VasEBoot_errno; } menu->entries->entry_type = KERNEL_CONFIG; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_append (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->append = grub_strdup (line); + menu->entries->append = VasEBoot_strdup (line); if (!menu->entries->append) - return grub_errno; + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_initrd (const char *line, struct syslinux_menu *menu) { struct initrd_list *ninitrd; const char *comma; if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); while (*line) { for (comma = line; *comma && *comma != ','; comma++); - ninitrd = grub_malloc (sizeof (*ninitrd)); + ninitrd = VasEBoot_malloc (sizeof (*ninitrd)); if (!ninitrd) - return grub_errno; - ninitrd->file = grub_strndup (line, comma - line); + return VasEBoot_errno; + ninitrd->file = VasEBoot_strndup (line, comma - line); if (!ninitrd->file) { - grub_free (ninitrd); - return grub_errno; + VasEBoot_free (ninitrd); + return VasEBoot_errno; } ninitrd->next = NULL; if (menu->entries->initrds_last) @@ -406,97 +406,97 @@ cmd_initrd (const char *line, struct syslinux_menu *menu) line++; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_default (const char *line, struct syslinux_menu *menu) { - menu->def = grub_strdup (line); + menu->def = VasEBoot_strdup (line); if (!menu->def) - return grub_errno; + return VasEBoot_errno; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_timeout (const char *line, struct syslinux_menu *menu) { - menu->timeout = grub_strtoul (line, NULL, 0); + menu->timeout = VasEBoot_strtoul (line, NULL, 0); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_menudefault (const char *line __attribute__ ((unused)), struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); menu->entries->make_default = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_menubackground (const char *line, struct syslinux_menu *menu) { - menu->background = grub_strdup (line); - return GRUB_ERR_NONE; + menu->background = VasEBoot_strdup (line); + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_localboot (const char *line, struct syslinux_menu *menu) { if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->kernel_file = grub_strdup (line); + menu->entries->kernel_file = VasEBoot_strdup (line); if (!menu->entries->kernel_file) - return grub_errno; + return VasEBoot_errno; menu->entries->entry_type = LOCALBOOT; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_extlabel (const char *line, struct syslinux_menu *menu) { const char *in; char *out; if (!menu->entries) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->extlabel = grub_malloc (grub_strlen (line) + 1); + menu->entries->extlabel = VasEBoot_malloc (VasEBoot_strlen (line) + 1); if (!menu->entries->extlabel) - return grub_errno; + return VasEBoot_errno; in = line; out = menu->entries->extlabel; while (*in) { if (in[0] == '^' && in[1]) { - menu->entries->hotkey = grub_tolower (in[1]); + menu->entries->hotkey = VasEBoot_tolower (in[1]); in++; } *out++ = *in++; } *out = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t cmd_say (const char *line, struct syslinux_menu *menu) { struct syslinux_say *nsay; - nsay = grub_malloc (sizeof (*nsay) + grub_strlen (line) + 1); + nsay = VasEBoot_malloc (sizeof (*nsay) + VasEBoot_strlen (line) + 1); if (!nsay) - return grub_errno; + return VasEBoot_errno; nsay->prev = NULL; if (menu->entries) { @@ -512,15 +512,15 @@ cmd_say (const char *line, struct syslinux_menu *menu) if (nsay->next) nsay->next->prev = nsay; - grub_memcpy (nsay->msg, line, grub_strlen (line) + 1); - return GRUB_ERR_NONE; + VasEBoot_memcpy (nsay->msg, line, VasEBoot_strlen (line) + 1); + return VasEBoot_ERR_NONE; } static char * get_read_filename (struct syslinux_menu *menu, const char *filename) { - return grub_xasprintf ("%s/%s", + return VasEBoot_xasprintf ("%s/%s", filename[0] == '/' ? menu->root_read_directory : menu->current_read_directory, filename); } @@ -529,32 +529,32 @@ static char * get_target_filename (struct syslinux_menu *menu, const char *filename) { - return grub_xasprintf ("%s/%s", + return VasEBoot_xasprintf ("%s/%s", filename[0] == '/' ? menu->root_target_directory : menu->current_target_directory, filename); } -static grub_err_t +static VasEBoot_err_t syslinux_parse (const char *filename, struct syslinux_menu *menu) { const char *old_filename = menu->filename; - grub_err_t ret; + VasEBoot_err_t ret; char *nf; nf = get_read_filename (menu, filename); if (!nf) - return grub_errno; + return VasEBoot_errno; menu->filename = nf; ret = syslinux_parse_real (menu); - if (ret == GRUB_ERR_FILE_NOT_FOUND - || ret == GRUB_ERR_BAD_FILENAME) + if (ret == VasEBoot_ERR_FILE_NOT_FOUND + || ret == VasEBoot_ERR_BAD_FILENAME) { - grub_errno = ret = GRUB_ERR_NONE; + VasEBoot_errno = ret = VasEBoot_ERR_NONE; add_comment (menu, "# File ", 0); add_comment (menu, nf, 0); add_comment (menu, " not found", 1); } - grub_free (nf); + VasEBoot_free (nf); menu->filename = old_filename; return ret; } @@ -563,7 +563,7 @@ struct { const char *name1; const char *name2; - grub_err_t (*parse) (const char *line, struct syslinux_menu *menu); + VasEBoot_err_t (*parse) (const char *line, struct syslinux_menu *menu); } commands[] = { /* FIXME: support tagname. */ {"include", NULL, syslinux_parse}, @@ -631,8 +631,8 @@ struct /* FIXME: DISPLAY not supported. */ /* FIXME: F* not supported. */ - /* Commands to control interface behaviour which aren't needed with GRUB. - If they are important in your environment please contact GRUB team. + /* Commands to control interface behaviour which aren't needed with VasEBoot. + If they are important in your environment please contact VasEBoot team. */ {"prompt", NULL, NULL}, {"nocomplete", NULL, NULL}, @@ -641,74 +641,74 @@ struct {"allowoptions", NULL, NULL} }; -static grub_err_t -helptext (const char *line, grub_file_t file, struct syslinux_menu *menu) +static VasEBoot_err_t +helptext (const char *line, VasEBoot_file_t file, struct syslinux_menu *menu) { char *help; char *buf = NULL; - grub_size_t helplen, alloclen = 0; + VasEBoot_size_t helplen, alloclen = 0; - help = grub_strdup (line); + help = VasEBoot_strdup (line); if (!help) - return grub_errno; - helplen = grub_strlen (line); - while ((grub_free (buf), buf = grub_file_getline (file))) + return VasEBoot_errno; + helplen = VasEBoot_strlen (line); + while ((VasEBoot_free (buf), buf = VasEBoot_file_getline (file))) { char *ptr; - grub_size_t needlen; - for (ptr = buf; *ptr && grub_isspace (*ptr); ptr++); - if (grub_strncasecmp (ptr, "endtext", sizeof ("endtext") - 1) == 0) + VasEBoot_size_t needlen; + for (ptr = buf; *ptr && VasEBoot_isspace (*ptr); ptr++); + if (VasEBoot_strncasecmp (ptr, "endtext", sizeof ("endtext") - 1) == 0) { ptr += sizeof ("endtext") - 1; - for (; *ptr && (grub_isspace (*ptr) || *ptr == '\n' || *ptr == '\r'); + for (; *ptr && (VasEBoot_isspace (*ptr) || *ptr == '\n' || *ptr == '\r'); ptr++); if (!*ptr) { menu->entries->help = help; - grub_free (buf); - return GRUB_ERR_NONE; + VasEBoot_free (buf); + return VasEBoot_ERR_NONE; } } - needlen = helplen + 1 + grub_strlen (buf); + needlen = helplen + 1 + VasEBoot_strlen (buf); if (alloclen < needlen) { alloclen = 2 * needlen; - help = grub_realloc (help, alloclen); + help = VasEBoot_realloc (help, alloclen); if (!help) { - grub_free (buf); - return grub_errno; + VasEBoot_free (buf); + return VasEBoot_errno; } } - helplen += grub_stpcpy (help + helplen, buf) - (help + helplen); + helplen += VasEBoot_stpcpy (help + helplen, buf) - (help + helplen); } - grub_free (buf); - grub_free (help); - return grub_errno; + VasEBoot_free (buf); + VasEBoot_free (help); + return VasEBoot_errno; } -static grub_err_t +static VasEBoot_err_t syslinux_parse_real (struct syslinux_menu *menu) { - grub_file_t file; + VasEBoot_file_t file; char *buf = NULL; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; - file = grub_file_open (menu->filename); + file = VasEBoot_file_open (menu->filename); if (!file) - return grub_errno; - while ((grub_free (buf), buf = grub_file_getline (file))) + return VasEBoot_errno; + while ((VasEBoot_free (buf), buf = VasEBoot_file_getline (file))) { const char *ptr1, *ptr2, *ptr3, *ptr4, *ptr5; char *end; unsigned i; - end = buf + grub_strlen (buf); + end = buf + VasEBoot_strlen (buf); while (end > buf && (end[-1] == '\n' || end[-1] == '\r')) end--; *end = 0; - for (ptr1 = buf; *ptr1 && grub_isspace (*ptr1); ptr1++); + for (ptr1 = buf; *ptr1 && VasEBoot_isspace (*ptr1); ptr1++); if (*ptr1 == '#' || *ptr1 == 0) { err = add_comment (menu, ptr1, 1); @@ -716,25 +716,25 @@ syslinux_parse_real (struct syslinux_menu *menu) goto fail; continue; } - for (ptr2 = ptr1; !grub_isspace (*ptr2) && *ptr2; ptr2++); - for (ptr3 = ptr2; grub_isspace (*ptr3) && *ptr3; ptr3++); - for (ptr4 = ptr3; !grub_isspace (*ptr4) && *ptr4; ptr4++); - for (ptr5 = ptr4; grub_isspace (*ptr5) && *ptr5; ptr5++); + for (ptr2 = ptr1; !VasEBoot_isspace (*ptr2) && *ptr2; ptr2++); + for (ptr3 = ptr2; VasEBoot_isspace (*ptr3) && *ptr3; ptr3++); + for (ptr4 = ptr3; !VasEBoot_isspace (*ptr4) && *ptr4; ptr4++); + for (ptr5 = ptr4; VasEBoot_isspace (*ptr5) && *ptr5; ptr5++); for (i = 0; i < ARRAY_SIZE(commands); i++) - if (grub_strlen (commands[i].name1) == (grub_size_t) (ptr2 - ptr1) - && grub_strncasecmp (commands[i].name1, ptr1, ptr2 - ptr1) == 0 + if (VasEBoot_strlen (commands[i].name1) == (VasEBoot_size_t) (ptr2 - ptr1) + && VasEBoot_strncasecmp (commands[i].name1, ptr1, ptr2 - ptr1) == 0 && (commands[i].name2 == NULL - || (grub_strlen (commands[i].name2) - == (grub_size_t) (ptr4 - ptr3) - && grub_strncasecmp (commands[i].name2, ptr3, ptr4 - ptr3) + || (VasEBoot_strlen (commands[i].name2) + == (VasEBoot_size_t) (ptr4 - ptr3) + && VasEBoot_strncasecmp (commands[i].name2, ptr3, ptr4 - ptr3) == 0))) break; if (i == ARRAY_SIZE(commands)) { if (sizeof ("text") - 1 == ptr2 - ptr1 - && grub_strncasecmp ("text", ptr1, ptr2 - ptr1) == 0 + && VasEBoot_strncasecmp ("text", ptr1, ptr2 - ptr1) == 0 && (sizeof ("help") - 1 == ptr4 - ptr3 - && grub_strncasecmp ("help", ptr3, ptr4 - ptr3) == 0)) + && VasEBoot_strncasecmp ("help", ptr3, ptr4 - ptr3) == 0)) { if (helptext (ptr5, file, menu)) return 1; @@ -756,18 +756,18 @@ syslinux_parse_real (struct syslinux_menu *menu) } } fail: - grub_file_close (file); + VasEBoot_file_close (file); return err; } -static grub_err_t +static VasEBoot_err_t print_escaped (struct output_buffer *outbuf, const char *from, const char *to) { const char *ptr; - grub_err_t err; + VasEBoot_err_t err; if (!to) - to = from + grub_strlen (from); + to = from + VasEBoot_strlen (from); err = ensure_space (outbuf, (to - from) * 4 + 2); if (err) return err; @@ -785,16 +785,16 @@ print_escaped (struct output_buffer *outbuf, outbuf->buf[outbuf->ptr++] = *ptr; } outbuf->buf[outbuf->ptr++] = '\''; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t print_file (struct output_buffer *outbuf, struct syslinux_menu *menu, const char *from, const char *to) { - grub_err_t err; + VasEBoot_err_t err; if (!to) - to = from + grub_strlen (from); + to = from + VasEBoot_strlen (from); err = print_escaped (outbuf, from[0] == '/' ? menu->root_target_directory : menu->current_target_directory, NULL); @@ -839,13 +839,13 @@ simplify_filename (char *str) *optr = '\0'; } -static grub_err_t +static VasEBoot_err_t print_config (struct output_buffer *outbuf, struct syslinux_menu *menu, const char *filename, const char *basedir) { struct syslinux_menu *menuptr; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; char *new_cwd = NULL; char *new_target_cwd = NULL; char *newname = NULL; @@ -854,19 +854,19 @@ print_config (struct output_buffer *outbuf, new_cwd = get_read_filename (menu, basedir); if (!new_cwd) { - err = grub_errno; + err = VasEBoot_errno; goto out; } new_target_cwd = get_target_filename (menu, basedir); if (!new_target_cwd) { - err = grub_errno; + err = VasEBoot_errno; goto out; } newname = get_read_filename (menu, filename); if (!newname) { - err = grub_errno; + err = VasEBoot_errno; goto out; } simplify_filename (newname); @@ -874,13 +874,13 @@ print_config (struct output_buffer *outbuf, print_string ("#"); print_file (outbuf, menu, filename, NULL); print_string (" "); - err = print (outbuf, newname, grub_strlen (newname)); + err = print (outbuf, newname, VasEBoot_strlen (newname)); if (err) return err; print_string (":\n"); for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++) - if (grub_strcmp (menuptr->filename, newname) == 0 + if (VasEBoot_strcmp (menuptr->filename, newname) == 0 || depth > 20) break; if (menuptr) @@ -898,12 +898,12 @@ print_config (struct output_buffer *outbuf, err = config_file (outbuf, menu->root_read_directory, menu->root_target_directory, new_cwd, new_target_cwd, newname, menu, menu->flavour); - if (err == GRUB_ERR_FILE_NOT_FOUND - || err == GRUB_ERR_BAD_FILENAME) + if (err == VasEBoot_ERR_FILE_NOT_FOUND + || err == VasEBoot_ERR_BAD_FILENAME) { - grub_errno = err = GRUB_ERR_NONE; + VasEBoot_errno = err = VasEBoot_ERR_NONE; print_string ("# File "); - err = print (outbuf, newname, grub_strlen (newname)); + err = print (outbuf, newname, VasEBoot_strlen (newname)); if (err) goto out; print_string (" not found\n"); @@ -911,22 +911,22 @@ print_config (struct output_buffer *outbuf, } out: - grub_free (newname); - grub_free (new_cwd); - grub_free (new_target_cwd); + VasEBoot_free (newname); + VasEBoot_free (new_cwd); + VasEBoot_free (new_target_cwd); return err; } -static grub_err_t +static VasEBoot_err_t write_entry (struct output_buffer *outbuf, struct syslinux_menu *menu, struct syslinux_menuentry *curentry) { - grub_err_t err; + VasEBoot_err_t err; if (curentry->comments) { err = print (outbuf, curentry->comments, - grub_strlen (curentry->comments)); + VasEBoot_strlen (curentry->comments)); if (err) return err; } @@ -936,7 +936,7 @@ write_entry (struct output_buffer *outbuf, for (; say && say->prev; say = say->prev) { print_string ("echo "); - if (print_escaped (outbuf, say->msg, NULL)) return grub_errno; + if (print_escaped (outbuf, say->msg, NULL)) return VasEBoot_errno; print_string ("\n"); } } @@ -949,23 +949,23 @@ write_entry (struct output_buffer *outbuf, const char *ptr; const char *initrd = NULL, *initrde= NULL; for (ptr = curentry->append; ptr && *ptr; ptr++) - if ((ptr == curentry->append || grub_isspace (ptr[-1])) - && grub_strncasecmp (ptr, "initrd=", sizeof ("initrd=") - 1) + if ((ptr == curentry->append || VasEBoot_isspace (ptr[-1])) + && VasEBoot_strncasecmp (ptr, "initrd=", sizeof ("initrd=") - 1) == 0) break; if (ptr && *ptr) { initrd = ptr + sizeof ("initrd=") - 1; - for (initrde = initrd; *initrde && !grub_isspace (*initrde); initrde++); + for (initrde = initrd; *initrde && !VasEBoot_isspace (*initrde); initrde++); } - print_string (" if test x$grub_platform = xpc; then " + print_string (" if test x$VasEBoot_platform = xpc; then " "linux_suffix=16; else linux_suffix= ; fi\n"); print_string (" linux$linux_suffix "); print_file (outbuf, menu, curentry->kernel_file, NULL); print_string (" "); if (curentry->append) { - err = print (outbuf, curentry->append, grub_strlen (curentry->append)); + err = print (outbuf, curentry->append, VasEBoot_strlen (curentry->append)); if (err) return err; } @@ -1003,12 +1003,12 @@ write_entry (struct output_buffer *outbuf, /* FIXME: support -1. */ /* FIXME: PXELINUX. */ { - int n = grub_strtol (curentry->kernel_file, NULL, 0); + int n = VasEBoot_strtol (curentry->kernel_file, NULL, 0); if (n >= 0 && n <= 0x02) { print_string (" root=fd"); if (print_num (outbuf, n)) - return grub_errno; + return VasEBoot_errno; print_string (";\n chainloader +1;\n"); break; @@ -1017,14 +1017,14 @@ write_entry (struct output_buffer *outbuf, { print_string (" root=hd"); if (print_num (outbuf, n - 0x80)) - return grub_errno; + return VasEBoot_errno; print_string (";\n chainloader +1;\n"); break; } print_string (" # UNSUPPORTED localboot type "); print_string ("\ntrue;\n"); if (print_num (outbuf, n)) - return grub_errno; + return VasEBoot_errno; print_string ("\n"); break; } @@ -1043,7 +1043,7 @@ write_entry (struct output_buffer *outbuf, basename = curentry->kernel_file; else basename++; - if (grub_strcasecmp (basename, "chain.c32") == 0) + if (VasEBoot_strcasecmp (basename, "chain.c32") == 0) { char *file = NULL; int is_fd = -1, devn = 0; @@ -1052,19 +1052,19 @@ write_entry (struct output_buffer *outbuf, char *ptr; for (ptr = curentry->append; *ptr; ) { - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; /* FIXME: support mbr: and boot. */ if (ptr[0] == 'h' && ptr[1] == 'd') { is_fd = 0; - devn = grub_strtoul (ptr + 2, &ptr, 0); + devn = VasEBoot_strtoul (ptr + 2, &ptr, 0); continue; } - if (grub_strncasecmp (ptr, "file=", 5) == 0) + if (VasEBoot_strncasecmp (ptr, "file=", 5) == 0) { file = ptr + 5; - for (ptr = file; *ptr && !grub_isspace (*ptr); ptr++); + for (ptr = file; *ptr && !VasEBoot_isspace (*ptr); ptr++); if (*ptr) { *ptr = 0; @@ -1072,7 +1072,7 @@ write_entry (struct output_buffer *outbuf, } continue; } - if (grub_strncasecmp (ptr, "swap", sizeof ("swap") - 1) == 0) + if (VasEBoot_strncasecmp (ptr, "swap", sizeof ("swap") - 1) == 0) { swap = 1; ptr += sizeof ("swap") - 1; @@ -1082,18 +1082,18 @@ write_entry (struct output_buffer *outbuf, if (ptr[0] == 'f' && ptr[1] == 'd') { is_fd = 1; - devn = grub_strtoul (ptr + 2, &ptr, 0); + devn = VasEBoot_strtoul (ptr + 2, &ptr, 0); continue; } - if (grub_isdigit (ptr[0])) + if (VasEBoot_isdigit (ptr[0])) { - part = grub_strtoul (ptr, &ptr, 0); + part = VasEBoot_strtoul (ptr, &ptr, 0); continue; } /* FIXME: isolinux, ntldr, cmldr, *dos, seg, hide FIXME: sethidden. */ print_string (" # UNSUPPORTED option "); - if (print (outbuf, ptr, grub_strlen (ptr))) + if (print (outbuf, ptr, VasEBoot_strlen (ptr))) return 0; print_string ("\n"); break; @@ -1107,12 +1107,12 @@ write_entry (struct output_buffer *outbuf, { print_string (is_fd ? " root=fd": " root=hd"); if (print_num (outbuf, devn)) - return grub_errno; + return VasEBoot_errno; if (part != -1) { print_string (","); if (print_num (outbuf, part + 1)) - return grub_errno; + return VasEBoot_errno; } print_string (";\n"); if (file) @@ -1129,7 +1129,7 @@ write_entry (struct output_buffer *outbuf, break; } - if (grub_strcasecmp (basename, "mboot.c32") == 0) + if (VasEBoot_strcasecmp (basename, "mboot.c32") == 0) { char *ptr; int first = 1; @@ -1137,7 +1137,7 @@ write_entry (struct output_buffer *outbuf, for (ptr = curentry->append; *ptr; ) { char *ptrr = ptr; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; if (ptrr + 2 == ptr && ptrr[0] == '-' && ptrr[1] == '-') { @@ -1154,47 +1154,47 @@ write_entry (struct output_buffer *outbuf, first = 0; is_kernel = 0; if (print_file (outbuf, menu, ptrr, ptr)) - return grub_errno; + return VasEBoot_errno; continue; } if (print_escaped (outbuf, ptrr, ptr)) - return grub_errno; + return VasEBoot_errno; } break; } - if (grub_strcasecmp (basename, "ifcpu64.c32") == 0) + if (VasEBoot_strcasecmp (basename, "ifcpu64.c32") == 0) { char *lm, *lme, *pae = 0, *paee = 0, *i386s = 0, *i386e = 0; char *ptr; ptr = curentry->append; - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; lm = ptr; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; lme = ptr; - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; if (ptr[0] == '-' && ptr[1] == '-') { ptr += 2; - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; pae = ptr; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; paee = ptr; } - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; if (ptr[0] == '-' && ptr[1] == '-') { ptr += 2; - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; i386s = ptr; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; i386e = ptr; } @@ -1210,92 +1210,92 @@ write_entry (struct output_buffer *outbuf, } print_string ("if cpuid --long-mode; then true;\n"); if (print_entry (outbuf, menu, lm)) - return grub_errno; + return VasEBoot_errno; if (pae) { print_string ("elif cpuid --pae; then true;\n"); if (print_entry (outbuf, menu, pae)) - return grub_errno; + return VasEBoot_errno; } print_string ("else\n"); if (print_entry (outbuf, menu, i386s)) - return grub_errno; + return VasEBoot_errno; print_string ("fi\n"); break; } - if (grub_strcasecmp (basename, "reboot.c32") == 0) + if (VasEBoot_strcasecmp (basename, "reboot.c32") == 0) { print_string (" reboot\n"); break; } - if (grub_strcasecmp (basename, "poweroff.com") == 0) + if (VasEBoot_strcasecmp (basename, "poweroff.com") == 0) { print_string (" halt\n"); break; } - if (grub_strcasecmp (basename, "whichsys.c32") == 0) + if (VasEBoot_strcasecmp (basename, "whichsys.c32") == 0) { - grub_syslinux_flavour_t flavour = GRUB_SYSLINUX_ISOLINUX; + VasEBoot_syslinux_flavour_t flavour = VasEBoot_SYSLINUX_ISOLINUX; const char *flav[] = { - [GRUB_SYSLINUX_ISOLINUX] = "iso", - [GRUB_SYSLINUX_PXELINUX] = "pxe", - [GRUB_SYSLINUX_SYSLINUX] = "sys" + [VasEBoot_SYSLINUX_ISOLINUX] = "iso", + [VasEBoot_SYSLINUX_PXELINUX] = "pxe", + [VasEBoot_SYSLINUX_SYSLINUX] = "sys" }; char *ptr; for (ptr = curentry->append; *ptr; ) { char *bptr, c; - while (grub_isspace (*ptr)) + while (VasEBoot_isspace (*ptr)) ptr++; - if (grub_strncasecmp (ptr, "-iso-", 5) == 0) + if (VasEBoot_strncasecmp (ptr, "-iso-", 5) == 0) { ptr += sizeof ("-iso-") - 1; - flavour = GRUB_SYSLINUX_ISOLINUX; + flavour = VasEBoot_SYSLINUX_ISOLINUX; continue; } - if (grub_strncasecmp (ptr, "-pxe-", 5) == 0) + if (VasEBoot_strncasecmp (ptr, "-pxe-", 5) == 0) { ptr += sizeof ("-pxe-") - 1; - flavour = GRUB_SYSLINUX_PXELINUX; + flavour = VasEBoot_SYSLINUX_PXELINUX; continue; } - if (grub_strncasecmp (ptr, "-sys-", 5) == 0) + if (VasEBoot_strncasecmp (ptr, "-sys-", 5) == 0) { ptr += sizeof ("-sys-") - 1; - flavour = GRUB_SYSLINUX_SYSLINUX; + flavour = VasEBoot_SYSLINUX_SYSLINUX; continue; } bptr = ptr; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; c = *ptr; *ptr = '\0'; - if (menu->flavour == GRUB_SYSLINUX_UNKNOWN - && flavour == GRUB_SYSLINUX_ISOLINUX) + if (menu->flavour == VasEBoot_SYSLINUX_UNKNOWN + && flavour == VasEBoot_SYSLINUX_ISOLINUX) { print_string ("if [ x$syslinux_flavour = xiso -o x$syslinux_flavour = x ]; then true;\n"); - menu->flavour = GRUB_SYSLINUX_ISOLINUX; + menu->flavour = VasEBoot_SYSLINUX_ISOLINUX; print_entry (outbuf, menu, bptr); - menu->flavour = GRUB_SYSLINUX_UNKNOWN; + menu->flavour = VasEBoot_SYSLINUX_UNKNOWN; print_string ("fi\n"); } - else if (menu->flavour == GRUB_SYSLINUX_UNKNOWN) + else if (menu->flavour == VasEBoot_SYSLINUX_UNKNOWN) { print_string ("if [ x$syslinux_flavour = x"); - err = print (outbuf, flav[flavour], grub_strlen (flav[flavour])); + err = print (outbuf, flav[flavour], VasEBoot_strlen (flav[flavour])); if (err) return err; print_string (" ]; then true;\n"); menu->flavour = flavour; print_entry (outbuf, menu, bptr); - menu->flavour = GRUB_SYSLINUX_UNKNOWN; + menu->flavour = VasEBoot_SYSLINUX_UNKNOWN; print_string ("fi\n"); } - if (menu->flavour != GRUB_SYSLINUX_UNKNOWN + if (menu->flavour != VasEBoot_SYSLINUX_UNKNOWN && menu->flavour == flavour) print_entry (outbuf, menu, bptr); *ptr = c; @@ -1303,33 +1303,33 @@ write_entry (struct output_buffer *outbuf, break; } - if (grub_strcasecmp (basename, "menu.c32") == 0 || - grub_strcasecmp (basename, "vesamenu.c32") == 0) + if (VasEBoot_strcasecmp (basename, "menu.c32") == 0 || + VasEBoot_strcasecmp (basename, "vesamenu.c32") == 0) { char *ptr; char *end; ptr = curentry->append; if (!ptr) - return grub_errno; + return VasEBoot_errno; while (*ptr) { end = ptr; - for (end = ptr; *end && !grub_isspace (*end); end++); + for (end = ptr; *end && !VasEBoot_isspace (*end); end++); if (*end) *end++ = '\0'; /* "~" is supposed to be current file, so let's skip it */ - if (grub_strcmp (ptr, "~") != 0) + if (VasEBoot_strcmp (ptr, "~") != 0) { err = print_config (outbuf, menu, ptr, ""); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) break; } - for (ptr = end; *ptr && grub_isspace (*ptr); ptr++); + for (ptr = end; *ptr && VasEBoot_isspace (*ptr); ptr++); } - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; break; } @@ -1337,7 +1337,7 @@ write_entry (struct output_buffer *outbuf, FIXME: Linux, Lua, Meminfo, rosh, Sanbboot */ print_string (" # UNSUPPORTED com(32) "); - err = print (outbuf, basename, grub_strlen (basename)); + err = print (outbuf, basename, VasEBoot_strlen (basename)); if (err) return err; print_string ("\ntrue;\n"); @@ -1361,28 +1361,28 @@ write_entry (struct output_buffer *outbuf, case KERNEL_IMG: print_string (" # UNSUPPORTED entry type "); if (print_num (outbuf, curentry->entry_type)) - return grub_errno; + return VasEBoot_errno; print_string ("\ntrue;\n"); break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t print_entry (struct output_buffer *outbuf, struct syslinux_menu *menu, const char *str) { struct syslinux_menuentry *curentry; for (curentry = menu->entries; curentry; curentry = curentry->next) - if (grub_strcasecmp (curentry->label, str) == 0) + if (VasEBoot_strcasecmp (curentry->label, str) == 0) { - grub_err_t err; + VasEBoot_err_t err; err = write_entry (outbuf, menu, curentry); if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void @@ -1391,13 +1391,13 @@ free_menu (struct syslinux_menu *menu) struct syslinux_say *say, *nsay; struct syslinux_menuentry *entry, *nentry; - grub_free (menu->def); - grub_free (menu->comments); - grub_free (menu->background); + VasEBoot_free (menu->def); + VasEBoot_free (menu->comments); + VasEBoot_free (menu->background); for (say = menu->say; say ; say = nsay) { nsay = say->next; - grub_free (say); + VasEBoot_free (say); } for (entry = menu->entries; entry ; entry = nentry) @@ -1408,33 +1408,33 @@ free_menu (struct syslinux_menu *menu) for (initrd = entry->initrds; initrd ; initrd = ninitrd) { ninitrd = initrd->next; - grub_free (initrd->file); - grub_free (initrd); + VasEBoot_free (initrd->file); + VasEBoot_free (initrd); } - grub_free (entry->comments); - grub_free (entry->kernel_file); - grub_free (entry->label); - grub_free (entry->extlabel); - grub_free (entry->append); - grub_free (entry->help); - grub_free (entry); + VasEBoot_free (entry->comments); + VasEBoot_free (entry->kernel_file); + VasEBoot_free (entry->label); + VasEBoot_free (entry->extlabel); + VasEBoot_free (entry->append); + VasEBoot_free (entry->help); + VasEBoot_free (entry); } } -static grub_err_t +static VasEBoot_err_t config_file (struct output_buffer *outbuf, const char *root, const char *target_root, const char *cwd, const char *target_cwd, const char *fname, struct syslinux_menu *parent, - grub_syslinux_flavour_t flav) + VasEBoot_syslinux_flavour_t flav) { - grub_err_t err; + VasEBoot_err_t err; struct syslinux_menu menu; struct syslinux_menuentry *curentry, *lentry; struct syslinux_say *say; - grub_memset (&menu, 0, sizeof (menu)); + VasEBoot_memset (&menu, 0, sizeof (menu)); menu.flavour = flav; menu.root_read_directory = root; menu.root_target_directory = target_root; @@ -1468,7 +1468,7 @@ config_file (struct output_buffer *outbuf, if (menu.comments) { - err = print (outbuf, menu.comments, grub_strlen (menu.comments)); + err = print (outbuf, menu.comments, VasEBoot_strlen (menu.comments)); if (err) return err; } @@ -1526,16 +1526,16 @@ config_file (struct output_buffer *outbuf, } } free_menu (&menu); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } char * -grub_syslinux_config_file (const char *base, const char *target_base, +VasEBoot_syslinux_config_file (const char *base, const char *target_base, const char *cwd, const char *target_cwd, - const char *fname, grub_syslinux_flavour_t flav) + const char *fname, VasEBoot_syslinux_flavour_t flav) { struct output_buffer outbuf = { 0, 0, 0 }; - grub_err_t err; + VasEBoot_err_t err; err = config_file (&outbuf, base, target_base, cwd, target_cwd, fname, NULL, flav); if (err) diff --git a/VasEBoot-core/lib/uboot/datetime.c b/VasEBoot-core/lib/uboot/datetime.c index 4be716928..277e9d231 100644 --- a/VasEBoot-core/lib/uboot/datetime.c +++ b/VasEBoot-core/lib/uboot/datetime.c @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* No simple platform-independent RTC access exists in U-Boot. */ -grub_err_t -grub_get_datetime (struct grub_datetime *datetime __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_get_datetime (struct VasEBoot_datetime *datetime __attribute__ ((unused))) { - return grub_error (GRUB_ERR_INVALID_COMMAND, + return VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "can\'t get datetime using U-Boot"); } -grub_err_t -grub_set_datetime (struct grub_datetime * datetime __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_set_datetime (struct VasEBoot_datetime * datetime __attribute__ ((unused))) { - return grub_error (GRUB_ERR_INVALID_COMMAND, + return VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, "can\'t set datetime using U-Boot"); } diff --git a/VasEBoot-core/lib/uboot/halt.c b/VasEBoot-core/lib/uboot/halt.c index 378d50f3f..fd24a24ab 100644 --- a/VasEBoot-core/lib/uboot/halt.c +++ b/VasEBoot-core/lib/uboot/halt.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include void -grub_halt (void) +VasEBoot_halt (void) { - grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + VasEBoot_machine_fini (VasEBoot_LOADER_FLAG_NORETURN); /* Just stop here */ diff --git a/VasEBoot-core/lib/uboot/reboot.c b/VasEBoot-core/lib/uboot/reboot.c index 00a2507f0..963c9bcd5 100644 --- a/VasEBoot-core/lib/uboot/reboot.c +++ b/VasEBoot-core/lib/uboot/reboot.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { - grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + VasEBoot_machine_fini (VasEBoot_LOADER_FLAG_NORETURN); - grub_uboot_reset (); + VasEBoot_uboot_reset (); while (1); } diff --git a/VasEBoot-core/lib/x86_64/efi/relocator.c b/VasEBoot-core/lib/x86_64/efi/relocator.c index 3caef7a40..63292ce72 100644 --- a/VasEBoot-core/lib/x86_64/efi/relocator.c +++ b/VasEBoot-core/lib/x86_64/efi/relocator.c @@ -1,74 +1,74 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * Copyright (C) 2016 Oracle and/or its affiliates. All rights reserved. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#include -#include +#include +#include -#include -#include +#include +#include -extern grub_uint64_t grub_relocator64_rax; -extern grub_uint64_t grub_relocator64_rbx; -extern grub_uint64_t grub_relocator64_rcx; -extern grub_uint64_t grub_relocator64_rdx; -extern grub_uint64_t grub_relocator64_rip; -extern grub_uint64_t grub_relocator64_rsi; +extern VasEBoot_uint64_t VasEBoot_relocator64_rax; +extern VasEBoot_uint64_t VasEBoot_relocator64_rbx; +extern VasEBoot_uint64_t VasEBoot_relocator64_rcx; +extern VasEBoot_uint64_t VasEBoot_relocator64_rdx; +extern VasEBoot_uint64_t VasEBoot_relocator64_rip; +extern VasEBoot_uint64_t VasEBoot_relocator64_rsi; -extern grub_uint8_t grub_relocator64_efi_start; -extern grub_uint8_t grub_relocator64_efi_end; +extern VasEBoot_uint8_t VasEBoot_relocator64_efi_start; +extern VasEBoot_uint8_t VasEBoot_relocator64_efi_end; -#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start) +#define RELOCATOR_SIZEOF(x) (&VasEBoot_relocator##x##_end - &VasEBoot_relocator##x##_start) -grub_err_t -grub_relocator64_efi_boot (struct grub_relocator *rel, - struct grub_relocator64_efi_state state) +VasEBoot_err_t +VasEBoot_relocator64_efi_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator64_efi_state state) { - grub_err_t err; + VasEBoot_err_t err; void *relst; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; /* * 64-bit relocator code may live above 4 GiB quite well. * However, I do not want ask for problems. Just in case. */ - err = grub_relocator_alloc_chunk_align (rel, &ch, 0, + err = VasEBoot_relocator_alloc_chunk_align (rel, &ch, 0, 0x100000000 - RELOCATOR_SIZEOF (64_efi), RELOCATOR_SIZEOF (64_efi), 16, - GRUB_RELOCATOR_PREFERENCE_NONE, 1); + VasEBoot_RELOCATOR_PREFERENCE_NONE, 1); if (err) return err; /* Do not touch %rsp! It points to EFI created stack. */ - grub_relocator64_rax = state.rax; - grub_relocator64_rbx = state.rbx; - grub_relocator64_rcx = state.rcx; - grub_relocator64_rdx = state.rdx; - grub_relocator64_rip = state.rip; - grub_relocator64_rsi = state.rsi; + VasEBoot_relocator64_rax = state.rax; + VasEBoot_relocator64_rbx = state.rbx; + VasEBoot_relocator64_rcx = state.rcx; + VasEBoot_relocator64_rdx = state.rdx; + VasEBoot_relocator64_rip = state.rip; + VasEBoot_relocator64_rsi = state.rsi; - grub_memmove (get_virtual_current_address (ch), &grub_relocator64_efi_start, + VasEBoot_memmove (get_virtual_current_address (ch), &VasEBoot_relocator64_efi_start, RELOCATOR_SIZEOF (64_efi)); - err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + err = VasEBoot_relocator_prepare_relocs (rel, get_physical_target_address (ch), &relst, NULL); if (err) return err; @@ -76,5 +76,5 @@ grub_relocator64_efi_boot (struct grub_relocator *rel, ((void (*) (void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/x86_64/relocator_asm.S b/VasEBoot-core/lib/x86_64/relocator_asm.S index 2ab6d8cb7..2be7b73f1 100644 --- a/VasEBoot-core/lib/x86_64/relocator_asm.S +++ b/VasEBoot-core/lib/x86_64/relocator_asm.S @@ -1,45 +1,45 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .p2align 2 -VARIABLE(grub_relocator_backward_start) +VARIABLE(VasEBoot_relocator_backward_start) /* mov imm32, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator_backward_dest) +VARIABLE(VasEBoot_relocator_backward_dest) .long 0, 0 movq %rax, %rdi /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator_backward_src) +VARIABLE(VasEBoot_relocator_backward_src) .long 0, 0 movq %rax, %rsi /* mov imm64, %rcx */ .byte 0x48 .byte 0xb9 -VARIABLE(grub_relocator_backward_chunk_size) +VARIABLE(VasEBoot_relocator_backward_chunk_size) .long 0, 0 add %rcx, %rsi @@ -54,32 +54,32 @@ VARIABLE(grub_relocator_backward_chunk_size) rep movsb -VARIABLE(grub_relocator_backward_end) +VARIABLE(VasEBoot_relocator_backward_end) -VARIABLE(grub_relocator_forward_start) +VARIABLE(VasEBoot_relocator_forward_start) /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator_forward_dest) +VARIABLE(VasEBoot_relocator_forward_dest) .long 0, 0 movq %rax, %rdi /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -VARIABLE(grub_relocator_forward_src) +VARIABLE(VasEBoot_relocator_forward_src) .long 0, 0 movq %rax, %rsi /* mov imm64, %rcx */ .byte 0x48 .byte 0xb9 -VARIABLE(grub_relocator_forward_chunk_size) +VARIABLE(VasEBoot_relocator_forward_chunk_size) .long 0, 0 /* Forward copy. */ cld rep movsb -VARIABLE(grub_relocator_forward_end) +VARIABLE(VasEBoot_relocator_forward_end) diff --git a/VasEBoot-core/lib/x86_64/setjmp.S b/VasEBoot-core/lib/x86_64/setjmp.S index 6b151bc4d..35122f8d0 100644 --- a/VasEBoot-core/lib/x86_64/setjmp.S +++ b/VasEBoot-core/lib/x86_64/setjmp.S @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include .file "setjmp.S" -GRUB_MOD_LICENSE "GPLv3+" +VasEBoot_MOD_LICENSE "GPLv3+" .text @@ -32,9 +32,9 @@ GRUB_MOD_LICENSE "GPLv3+" */ /* - * int grub_setjmp (grub_jmp_buf env) + * int VasEBoot_setjmp (VasEBoot_jmp_buf env) */ -FUNCTION(grub_setjmp) +FUNCTION(VasEBoot_setjmp) pop %rsi /* Return address, and adjust the stack */ xorq %rax, %rax movq %rbx, 0(%rdi) /* RBX */ @@ -49,9 +49,9 @@ FUNCTION(grub_setjmp) ret /* - * int grub_longjmp (grub_jmp_buf env, int val) + * int VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) */ -FUNCTION(grub_longjmp) +FUNCTION(VasEBoot_longjmp) movl %esi, %eax orl %eax, %eax jnz 1f diff --git a/VasEBoot-core/lib/x86_64/xen/relocator.S b/VasEBoot-core/lib/x86_64/xen/relocator.S index f5364ed0f..a138d9e07 100644 --- a/VasEBoot-core/lib/x86_64/xen/relocator.S +++ b/VasEBoot-core/lib/x86_64/xen/relocator.S @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* Macro to load an imm64 value stored by the C-part into %rax: */ #define MOV_IMM64_RAX(var) .byte 0x48, 0xb8; VARIABLE(var); .quad 0 .p2align 4 /* force 16-byte alignment */ -VARIABLE(grub_relocator_xen_remap_start) +VARIABLE(VasEBoot_relocator_xen_remap_start) LOCAL(base): /* Remap the remapper to it's new address. */ - MOV_IMM64_RAX(grub_relocator_xen_remapper_virt) + MOV_IMM64_RAX(VasEBoot_relocator_xen_remapper_virt) movq %rax, %rdi /* %rdi: new virtual address of remapper */ movq %rax, %rbx /* Remember new virtual address */ - MOV_IMM64_RAX(grub_relocator_xen_remapper_map) + MOV_IMM64_RAX(VasEBoot_relocator_xen_remapper_map) movq %rax, %rsi /* %rsi: page table entry */ @@ -48,14 +48,14 @@ LOCAL(base): LOCAL(cont): /* Modify mappings of new page tables to be read-only. */ - MOV_IMM64_RAX(grub_relocator_xen_mfn_list) + MOV_IMM64_RAX(VasEBoot_relocator_xen_mfn_list) movq %rax, %rbx /* %rbx is the base of the p2m list */ - leaq EXT_C(grub_relocator_xen_paging_areas) (%rip), %r8 + leaq EXT_C(VasEBoot_relocator_xen_paging_areas) (%rip), %r8 1: movq 0(%r8), %r12 /* Get start pfn of the current area */ - movq GRUB_TARGET_SIZEOF_LONG(%r8), %rcx /* Get # of pg tables */ + movq VasEBoot_TARGET_SIZEOF_LONG(%r8), %rcx /* Get # of pg tables */ testq %rcx, %rcx /* 0 -> last area reached */ jz 3f 2: @@ -63,7 +63,7 @@ LOCAL(cont): shlq $PAGE_SHIFT, %rdi /* virtual address (1:1 mapping) */ movq (%rbx, %r12, 8), %rsi /* mfn */ shlq $PAGE_SHIFT, %rsi - orq $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %rsi /* Build pte */ + orq $(VasEBoot_PAGE_PRESENT | VasEBoot_PAGE_USER), %rsi /* Build pte */ movq $UVMF_INVLPG, %rdx movq %rcx, %r9 /* %rcx clobbered by hypercall */ movq $__HYPERVISOR_update_va_mapping, %rax @@ -74,12 +74,12 @@ LOCAL(cont): loop 2b - addq $(2 * GRUB_TARGET_SIZEOF_LONG), %r8 /* next pg table area */ + addq $(2 * VasEBoot_TARGET_SIZEOF_LONG), %r8 /* next pg table area */ jmp 1b 3: /* Switch page tables: pin new L4 pt, load cr3, unpin old L4. */ - leaq EXT_C(grub_relocator_xen_mmu_op) (%rip), %rdi + leaq EXT_C(VasEBoot_relocator_xen_mmu_op) (%rip), %rdi movq $3, %rsi /* 3 mmu ops */ movq $0, %rdx /* pdone (not used) */ movq $DOMID_SELF, %r10 @@ -87,23 +87,23 @@ LOCAL(cont): syscall /* Continue in virtual kernel mapping. */ - MOV_IMM64_RAX(grub_relocator_xen_remap_continue) + MOV_IMM64_RAX(VasEBoot_relocator_xen_remap_continue) jmp *%rax -VARIABLE(grub_relocator_xen_paging_areas) +VARIABLE(VasEBoot_relocator_xen_paging_areas) /* array of start, size pairs, size 0 is end marker */ .quad 0, 0, 0, 0, 0, 0, 0, 0 -VARIABLE(grub_relocator_xen_mmu_op) +VARIABLE(VasEBoot_relocator_xen_mmu_op) .space 256 -VARIABLE(grub_relocator_xen_remap_end) +VARIABLE(VasEBoot_relocator_xen_remap_end) -VARIABLE(grub_relocator_xen_start) +VARIABLE(VasEBoot_relocator_xen_start) /* Unmap old remapper area. */ - MOV_IMM64_RAX(grub_relocator_xen_remapper_virt2) + MOV_IMM64_RAX(VasEBoot_relocator_xen_remapper_virt2) movq %rax, %rdi @@ -115,19 +115,19 @@ VARIABLE(grub_relocator_xen_start) syscall /* Prepare registers for starting kernel. */ - MOV_IMM64_RAX(grub_relocator_xen_stack) + MOV_IMM64_RAX(VasEBoot_relocator_xen_stack) movq %rax, %rsp - MOV_IMM64_RAX(grub_relocator_xen_start_info) + MOV_IMM64_RAX(VasEBoot_relocator_xen_start_info) movq %rax, %rsi cld - MOV_IMM64_RAX(grub_relocator_xen_entry_point) + MOV_IMM64_RAX(VasEBoot_relocator_xen_entry_point) /* Now start the new kernel. */ jmp *%rax -VARIABLE(grub_relocator_xen_end) +VARIABLE(VasEBoot_relocator_xen_end) diff --git a/VasEBoot-core/lib/xen/datetime.c b/VasEBoot-core/lib/xen/datetime.c index d96176ec6..ba806b1ef 100644 --- a/VasEBoot-core/lib/xen/datetime.c +++ b/VasEBoot-core/lib/xen/datetime.c @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_err_t -grub_get_datetime (struct grub_datetime *datetime) +VasEBoot_err_t +VasEBoot_get_datetime (struct VasEBoot_datetime *datetime) { long long nix; - nix = (grub_xen_shared_info->wc_sec - + grub_divmod64 (grub_xen_shared_info->vcpu_info[0].time.system_time, 1000000000, 0)); - grub_unixtime2datetime (nix, datetime); - return GRUB_ERR_NONE; + nix = (VasEBoot_xen_shared_info->wc_sec + + VasEBoot_divmod64 (VasEBoot_xen_shared_info->vcpu_info[0].time.system_time, 1000000000, 0)); + VasEBoot_unixtime2datetime (nix, datetime); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_set_datetime (struct grub_datetime *datetime __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_set_datetime (struct VasEBoot_datetime *datetime __attribute__ ((unused))) { - return grub_error (GRUB_ERR_IO, "setting time isn't supported"); + return VasEBoot_error (VasEBoot_ERR_IO, "setting time isn't supported"); } diff --git a/VasEBoot-core/lib/xen/halt.c b/VasEBoot-core/lib/xen/halt.c index 2aceead6e..1c6165c42 100644 --- a/VasEBoot-core/lib/xen/halt.c +++ b/VasEBoot-core/lib/xen/halt.c @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include void -grub_halt (void) +VasEBoot_halt (void) { struct sched_shutdown arg; arg.reason = SHUTDOWN_poweroff; - grub_xen_sched_op (SCHEDOP_shutdown, &arg); + VasEBoot_xen_sched_op (SCHEDOP_shutdown, &arg); for (;;); } diff --git a/VasEBoot-core/lib/xen/reboot.c b/VasEBoot-core/lib/xen/reboot.c index fd7609a7d..c2c017906 100644 --- a/VasEBoot-core/lib/xen/reboot.c +++ b/VasEBoot-core/lib/xen/reboot.c @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include void -grub_reboot (void) +VasEBoot_reboot (void) { struct sched_shutdown arg; arg.reason = SHUTDOWN_reboot; - grub_xen_sched_op (SCHEDOP_shutdown, &arg); + VasEBoot_xen_sched_op (SCHEDOP_shutdown, &arg); for (;;); } diff --git a/VasEBoot-core/lib/xen/relocator.c b/VasEBoot-core/lib/xen/relocator.c index 4d0cbcadb..65ae5aa28 100644 --- a/VasEBoot-core/lib/xen/relocator.c +++ b/VasEBoot-core/lib/xen/relocator.c @@ -1,131 +1,131 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include -typedef grub_addr_t grub_xen_reg_t; +typedef VasEBoot_addr_t VasEBoot_xen_reg_t; -struct grub_relocator_xen_paging_area { - grub_xen_reg_t start; - grub_xen_reg_t size; -} GRUB_PACKED; +struct VasEBoot_relocator_xen_paging_area { + VasEBoot_xen_reg_t start; + VasEBoot_xen_reg_t size; +} VasEBoot_PACKED; -extern grub_uint8_t grub_relocator_xen_start; -extern grub_uint8_t grub_relocator_xen_end; -extern grub_uint8_t grub_relocator_xen_remap_start; -extern grub_uint8_t grub_relocator_xen_remap_end; -extern grub_xen_reg_t grub_relocator_xen_stack; -extern grub_xen_reg_t grub_relocator_xen_start_info; -extern grub_xen_reg_t grub_relocator_xen_entry_point; -extern grub_xen_reg_t grub_relocator_xen_remapper_virt; -extern grub_xen_reg_t grub_relocator_xen_remapper_virt2; -extern grub_xen_reg_t grub_relocator_xen_remapper_map; -extern grub_xen_reg_t grub_relocator_xen_mfn_list; -extern struct grub_relocator_xen_paging_area - grub_relocator_xen_paging_areas[XEN_MAX_MAPPINGS]; -extern grub_xen_reg_t grub_relocator_xen_remap_continue; +extern VasEBoot_uint8_t VasEBoot_relocator_xen_start; +extern VasEBoot_uint8_t VasEBoot_relocator_xen_end; +extern VasEBoot_uint8_t VasEBoot_relocator_xen_remap_start; +extern VasEBoot_uint8_t VasEBoot_relocator_xen_remap_end; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_stack; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_start_info; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_entry_point; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_remapper_virt; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_remapper_virt2; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_remapper_map; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_mfn_list; +extern struct VasEBoot_relocator_xen_paging_area + VasEBoot_relocator_xen_paging_areas[XEN_MAX_MAPPINGS]; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_remap_continue; #ifdef __i386__ -extern grub_xen_reg_t grub_relocator_xen_mmu_op_addr; -extern grub_xen_reg_t grub_relocator_xen_paging_areas_addr; -extern grub_xen_reg_t grub_relocator_xen_remapper_map_high; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_mmu_op_addr; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_paging_areas_addr; +extern VasEBoot_xen_reg_t VasEBoot_relocator_xen_remapper_map_high; #endif -extern mmuext_op_t grub_relocator_xen_mmu_op[3]; +extern mmuext_op_t VasEBoot_relocator_xen_mmu_op[3]; -#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start) +#define RELOCATOR_SIZEOF(x) (&VasEBoot_relocator##x##_end - &VasEBoot_relocator##x##_start) -grub_err_t -grub_relocator_xen_boot (struct grub_relocator *rel, - struct grub_relocator_xen_state state, - grub_uint64_t remapper_pfn, - grub_addr_t remapper_virt, - grub_uint64_t trampoline_pfn, - grub_addr_t trampoline_virt) +VasEBoot_err_t +VasEBoot_relocator_xen_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator_xen_state state, + VasEBoot_uint64_t remapper_pfn, + VasEBoot_addr_t remapper_virt, + VasEBoot_uint64_t trampoline_pfn, + VasEBoot_addr_t trampoline_virt) { - grub_err_t err; + VasEBoot_err_t err; void *relst; int i; - grub_relocator_chunk_t ch, ch_tramp; - grub_xen_mfn_t *mfn_list = - (grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list; + VasEBoot_relocator_chunk_t ch, ch_tramp; + VasEBoot_xen_mfn_t *mfn_list = + (VasEBoot_xen_mfn_t *) VasEBoot_xen_start_page_addr->mfn_list; - err = grub_relocator_alloc_chunk_addr (rel, &ch, remapper_pfn << 12, + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, remapper_pfn << 12, RELOCATOR_SIZEOF (_xen_remap)); if (err) return err; - err = grub_relocator_alloc_chunk_addr (rel, &ch_tramp, trampoline_pfn << 12, + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch_tramp, trampoline_pfn << 12, RELOCATOR_SIZEOF (_xen)); if (err) return err; - grub_relocator_xen_stack = state.stack; - grub_relocator_xen_start_info = state.start_info; - grub_relocator_xen_entry_point = state.entry_point; + VasEBoot_relocator_xen_stack = state.stack; + VasEBoot_relocator_xen_start_info = state.start_info; + VasEBoot_relocator_xen_entry_point = state.entry_point; for (i = 0; i < XEN_MAX_MAPPINGS; i++) { - grub_relocator_xen_paging_areas[i].start = state.paging_start[i]; - grub_relocator_xen_paging_areas[i].size = state.paging_size[i]; + VasEBoot_relocator_xen_paging_areas[i].start = state.paging_start[i]; + VasEBoot_relocator_xen_paging_areas[i].size = state.paging_size[i]; } - grub_relocator_xen_remapper_virt = remapper_virt; - grub_relocator_xen_remapper_virt2 = remapper_virt; - grub_relocator_xen_remap_continue = trampoline_virt; + VasEBoot_relocator_xen_remapper_virt = remapper_virt; + VasEBoot_relocator_xen_remapper_virt2 = remapper_virt; + VasEBoot_relocator_xen_remap_continue = trampoline_virt; - grub_relocator_xen_remapper_map = (mfn_list[remapper_pfn] << 12) | 5; + VasEBoot_relocator_xen_remapper_map = (mfn_list[remapper_pfn] << 12) | 5; #ifdef __i386__ - grub_relocator_xen_remapper_map_high = (mfn_list[remapper_pfn] >> 20); - grub_relocator_xen_mmu_op_addr = (char *) &grub_relocator_xen_mmu_op - - (char *) &grub_relocator_xen_remap_start + remapper_virt; - grub_relocator_xen_paging_areas_addr = - (char *) &grub_relocator_xen_paging_areas - - (char *) &grub_relocator_xen_remap_start + remapper_virt; + VasEBoot_relocator_xen_remapper_map_high = (mfn_list[remapper_pfn] >> 20); + VasEBoot_relocator_xen_mmu_op_addr = (char *) &VasEBoot_relocator_xen_mmu_op + - (char *) &VasEBoot_relocator_xen_remap_start + remapper_virt; + VasEBoot_relocator_xen_paging_areas_addr = + (char *) &VasEBoot_relocator_xen_paging_areas + - (char *) &VasEBoot_relocator_xen_remap_start + remapper_virt; #endif - grub_relocator_xen_mfn_list = state.mfn_list; + VasEBoot_relocator_xen_mfn_list = state.mfn_list; - grub_memset (grub_relocator_xen_mmu_op, 0, - sizeof (grub_relocator_xen_mmu_op)); + VasEBoot_memset (VasEBoot_relocator_xen_mmu_op, 0, + sizeof (VasEBoot_relocator_xen_mmu_op)); #ifdef __i386__ - grub_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L3_TABLE; + VasEBoot_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L3_TABLE; #else - grub_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L4_TABLE; + VasEBoot_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L4_TABLE; #endif - grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start[0]]; - grub_relocator_xen_mmu_op[1].cmd = MMUEXT_NEW_BASEPTR; - grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start[0]]; - grub_relocator_xen_mmu_op[2].cmd = MMUEXT_UNPIN_TABLE; - grub_relocator_xen_mmu_op[2].arg1.mfn = - mfn_list[grub_xen_start_page_addr->pt_base >> 12]; + VasEBoot_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start[0]]; + VasEBoot_relocator_xen_mmu_op[1].cmd = MMUEXT_NEW_BASEPTR; + VasEBoot_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start[0]]; + VasEBoot_relocator_xen_mmu_op[2].cmd = MMUEXT_UNPIN_TABLE; + VasEBoot_relocator_xen_mmu_op[2].arg1.mfn = + mfn_list[VasEBoot_xen_start_page_addr->pt_base >> 12]; - grub_memmove (get_virtual_current_address (ch), - &grub_relocator_xen_remap_start, + VasEBoot_memmove (get_virtual_current_address (ch), + &VasEBoot_relocator_xen_remap_start, RELOCATOR_SIZEOF (_xen_remap)); - grub_memmove (get_virtual_current_address (ch_tramp), - &grub_relocator_xen_start, RELOCATOR_SIZEOF (_xen)); + VasEBoot_memmove (get_virtual_current_address (ch_tramp), + &VasEBoot_relocator_xen_start, RELOCATOR_SIZEOF (_xen)); - err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + err = VasEBoot_relocator_prepare_relocs (rel, get_physical_target_address (ch), &relst, NULL); if (err) return err; @@ -133,5 +133,5 @@ grub_relocator_xen_boot (struct grub_relocator *rel, ((void (*)(void)) relst) (); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/lib/xzembed/xz.h b/VasEBoot-core/lib/xzembed/xz.h index fe7158bb2..a52c0cdce 100644 --- a/VasEBoot-core/lib/xzembed/xz.h +++ b/VasEBoot-core/lib/xzembed/xz.h @@ -1,20 +1,20 @@ /* xz.h - XZ decompressor */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#ifndef GRUB_POSIX_BOOL_DEFINED +#ifndef VasEBoot_POSIX_BOOL_DEFINED typedef enum { false = 0, true = 1 } bool; #endif diff --git a/VasEBoot-core/lib/xzembed/xz_config.h b/VasEBoot-core/lib/xzembed/xz_config.h index 24d570f2b..0148393a8 100644 --- a/VasEBoot-core/lib/xzembed/xz_config.h +++ b/VasEBoot-core/lib/xzembed/xz_config.h @@ -1,20 +1,20 @@ /* xz_config.h - Private includes and definitions for userspace use */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project @@ -26,7 +26,7 @@ /* Enable BCJ filter decoders. */ -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR #define XZ_DEC_X86 #define XZ_DEC_POWERPC diff --git a/VasEBoot-core/lib/xzembed/xz_dec_bcj.c b/VasEBoot-core/lib/xzembed/xz_dec_bcj.c index bf6b5862e..c00141d04 100644 --- a/VasEBoot-core/lib/xzembed/xz_dec_bcj.c +++ b/VasEBoot-core/lib/xzembed/xz_dec_bcj.c @@ -1,20 +1,20 @@ /* xz_dec_bcj.c - Branch/Call/Jump (BCJ) filter decoders */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project @@ -520,14 +520,14 @@ enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s, return s->ret; } -#ifdef GRUB_EMBED_DECOMPRESSOR +#ifdef VasEBoot_EMBED_DECOMPRESSOR struct xz_dec_bcj bcj; #endif struct xz_dec_bcj * xz_dec_bcj_create(bool single_call) { struct xz_dec_bcj *s; -#ifdef GRUB_EMBED_DECOMPRESSOR +#ifdef VasEBoot_EMBED_DECOMPRESSOR s = &bcj; #else s = kmalloc(sizeof(*s), GFP_KERNEL); diff --git a/VasEBoot-core/lib/xzembed/xz_dec_lzma2.c b/VasEBoot-core/lib/xzembed/xz_dec_lzma2.c index af7b77079..e9dcfed32 100644 --- a/VasEBoot-core/lib/xzembed/xz_dec_lzma2.c +++ b/VasEBoot-core/lib/xzembed/xz_dec_lzma2.c @@ -1,20 +1,20 @@ /* xz_dec_lzma2.c - LZMA2 decoder */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project @@ -1106,8 +1106,8 @@ enum xz_ret xz_dec_lzma2_run( return XZ_OK; } -#ifdef GRUB_EMBED_DECOMPRESSOR -#include +#ifdef VasEBoot_EMBED_DECOMPRESSOR +#include static struct xz_dec_lzma2 lzma2; #endif @@ -1115,7 +1115,7 @@ struct xz_dec_lzma2 * xz_dec_lzma2_create(uint32_t dict_max) { struct xz_dec_lzma2 *s; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR /* Maximum supported dictionary by this implementation is 3 GiB. */ if (dict_max > ((uint32_t)3 << 30)) return NULL; @@ -1134,7 +1134,7 @@ struct xz_dec_lzma2 * xz_dec_lzma2_create(uint32_t dict_max) #else s = &lzma2; - s->dict.buf = grub_decompressor_scratch; + s->dict.buf = VasEBoot_decompressor_scratch; #endif s->dict.allocated = dict_max; @@ -1152,7 +1152,7 @@ enum xz_ret xz_dec_lzma2_reset( s->dict.size = 2 + (props & 1); s->dict.size <<= (props >> 1) + 11; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->dict.allocated > 0 && s->dict.allocated < s->dict.size) { /* enlarge dictionary buffer */ @@ -1179,7 +1179,7 @@ enum xz_ret xz_dec_lzma2_reset( void xz_dec_lzma2_end(struct xz_dec_lzma2 *s __attribute__ ((unused))) { -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->dict.allocated > 0) vfree(s->dict.buf); diff --git a/VasEBoot-core/lib/xzembed/xz_dec_stream.c b/VasEBoot-core/lib/xzembed/xz_dec_stream.c index a29751e14..c5779165b 100644 --- a/VasEBoot-core/lib/xzembed/xz_dec_stream.c +++ b/VasEBoot-core/lib/xzembed/xz_dec_stream.c @@ -1,20 +1,20 @@ /* xz_dec_stream.c - .xz Stream decoder */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project @@ -25,13 +25,13 @@ #include "xz_private.h" #include "xz_stream.h" -#include +#include /* Hash used to validate the Index field */ struct xz_dec_hash { vli_type unpadded; vli_type uncompressed; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR uint64_t *hash_context; #endif }; @@ -65,22 +65,22 @@ struct xz_dec { size_t out_start; /* CRC32 value in Block or Index */ -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR uint8_t hash_value[MAX_HASH_SIZE]; /* need for crc32_validate*/ #endif int have_hash_value; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR uint64_t *hash_context; uint64_t *crc32_context; #endif /* Hash function calculated from uncompressed data */ -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR const gcry_md_spec_t *hash; const gcry_md_spec_t *crc32; - grub_uint8_t hash_id; + VasEBoot_uint8_t hash_id; #endif - grub_size_t hash_size; + VasEBoot_size_t hash_size; /* True if we are operating in single-call mode. */ bool single_call; @@ -263,7 +263,7 @@ static enum xz_ret dec_block(struct xz_dec *s, struct xz_buf *b) > s->block_header.uncompressed) return XZ_DATA_ERROR; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) s->hash->write(s->hash_context,b->out + s->out_start, b->out_pos - s->out_start); @@ -289,7 +289,7 @@ static enum xz_ret dec_block(struct xz_dec *s, struct xz_buf *b) s->block.hash.uncompressed += s->block.uncompressed; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) s->hash->write(s->block.hash.hash_context, (const uint8_t *)&s->block.hash, @@ -307,7 +307,7 @@ static void index_update(struct xz_dec *s, const struct xz_buf *b) { size_t in_used = b->in_pos - s->in_start; s->index.size += in_used; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) s->hash->write(s->hash_context,b->in + s->in_start, in_used); if (s->crc32) @@ -357,7 +357,7 @@ static enum xz_ret dec_index(struct xz_dec *s, struct xz_buf *b) case SEQ_INDEX_UNCOMPRESSED: s->index.hash.uncompressed += s->vli; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) s->hash->write(s->index.hash.hash_context, (const uint8_t *)&s->index.hash, 2 * sizeof(vli_type)); @@ -379,7 +379,7 @@ static enum xz_ret dec_index(struct xz_dec *s, struct xz_buf *b) static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b, int crc32) { -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR const gcry_md_spec_t *hash = crc32 ? s->crc32 : s->hash; void *hash_context = crc32 ? s->crc32_context : s->hash_context; @@ -387,12 +387,12 @@ static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b, && sizeof (s->hash_value) >= hash->mdlen) { hash->final(hash_context); - grub_memcpy (s->hash_value, hash->read(hash_context), + VasEBoot_memcpy (s->hash_value, hash->read(hash_context), hash->mdlen); s->have_hash_value = 1; if (s->hash_id == 1 || crc32) { - grub_uint8_t t; + VasEBoot_uint8_t t; t = s->hash_value[0]; s->hash_value[0] = s->hash_value[3]; s->hash_value[3] = t; @@ -413,7 +413,7 @@ static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b, if (b->in_pos == b->in_size) return XZ_OK; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (hash && s->hash_value[s->pos / 8] != b->in[b->in_pos]) return XZ_DATA_ERROR; #endif @@ -423,7 +423,7 @@ static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b, } -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) s->hash->init(s->hash_context); if (s->crc32) @@ -438,7 +438,7 @@ static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b, static const struct { const char *name; - grub_size_t size; + VasEBoot_size_t size; } hashes[] = { [0x01] = { "CRC32", 4}, [0x04] = { "CRC64", 8}, @@ -451,8 +451,8 @@ static enum xz_ret dec_stream_header(struct xz_dec *s) if (! memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE)) return XZ_FORMAT_ERROR; -#ifndef GRUB_EMBED_DECOMPRESSOR - s->crc32 = grub_crypto_lookup_md_by_name ("CRC32"); +#ifndef VasEBoot_EMBED_DECOMPRESSOR + s->crc32 = VasEBoot_crypto_lookup_md_by_name ("CRC32"); if (s->crc32) { @@ -462,7 +462,7 @@ static enum xz_ret dec_stream_header(struct xz_dec *s) if(4 != s->crc32->mdlen) return XZ_DATA_ERROR; - grub_crypto_hash (s->crc32, computed_hash, + VasEBoot_crypto_hash (s->crc32, computed_hash, s->temp.buf + HEADER_MAGIC_SIZE, 2); readhash[0] = s->temp.buf[HEADER_MAGIC_SIZE + 5]; @@ -470,13 +470,13 @@ static enum xz_ret dec_stream_header(struct xz_dec *s) readhash[2] = s->temp.buf[HEADER_MAGIC_SIZE + 3]; readhash[3] = s->temp.buf[HEADER_MAGIC_SIZE + 2]; - if (grub_memcmp (readhash, computed_hash, + if (VasEBoot_memcmp (readhash, computed_hash, s->crc32->mdlen) != 0) return XZ_DATA_ERROR; } #endif -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR /* * Decode the Stream Flags field. */ @@ -500,8 +500,8 @@ static enum xz_ret dec_stream_header(struct xz_dec *s) if (s->temp.buf[HEADER_MAGIC_SIZE + 1]) { s->hash_size = hashes[s->temp.buf[HEADER_MAGIC_SIZE + 1]].size; -#ifndef GRUB_EMBED_DECOMPRESSOR - s->hash = grub_crypto_lookup_md_by_name (hashes[s->temp.buf[HEADER_MAGIC_SIZE + 1]].name); +#ifndef VasEBoot_EMBED_DECOMPRESSOR + s->hash = VasEBoot_crypto_lookup_md_by_name (hashes[s->temp.buf[HEADER_MAGIC_SIZE + 1]].name); if (s->hash) { if (s->hash->mdlen != s->hash_size) @@ -539,7 +539,7 @@ static enum xz_ret dec_stream_header(struct xz_dec *s) } else { -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR s->hash = 0; #endif s->hash_size = 0; @@ -557,7 +557,7 @@ static enum xz_ret dec_stream_footer(struct xz_dec *s) if (! memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE)) return XZ_DATA_ERROR; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->crc32) { uint8_t readhash[4]; @@ -566,7 +566,7 @@ static enum xz_ret dec_stream_footer(struct xz_dec *s) if (4 != s->crc32->mdlen) return XZ_DATA_ERROR; - grub_crypto_hash (s->crc32, computed_hash, + VasEBoot_crypto_hash (s->crc32, computed_hash, s->temp.buf + 4, 6); readhash[0] = s->temp.buf[3]; @@ -574,7 +574,7 @@ static enum xz_ret dec_stream_footer(struct xz_dec *s) readhash[2] = s->temp.buf[1]; readhash[3] = s->temp.buf[0]; - if(grub_memcmp (readhash, computed_hash, + if(VasEBoot_memcmp (readhash, computed_hash, s->crc32->mdlen) != 0) return XZ_DATA_ERROR; } @@ -589,7 +589,7 @@ static enum xz_ret dec_stream_footer(struct xz_dec *s) if ((s->index.size >> 2) != get_le32(s->temp.buf + 4)) return XZ_DATA_ERROR; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->hash_id) return XZ_DATA_ERROR; #endif @@ -611,7 +611,7 @@ static enum xz_ret dec_block_header(struct xz_dec *s) * eight bytes so this is safe. */ s->temp.size -= 4; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->crc32) { uint8_t readhash[4], computed_hash[4]; @@ -619,7 +619,7 @@ static enum xz_ret dec_block_header(struct xz_dec *s) if(4 != s->crc32->mdlen) return XZ_DATA_ERROR; - grub_crypto_hash (s->crc32, computed_hash, + VasEBoot_crypto_hash (s->crc32, computed_hash, s->temp.buf, s->temp.size); readhash[3] = s->temp.buf[s->temp.size]; @@ -627,7 +627,7 @@ static enum xz_ret dec_block_header(struct xz_dec *s) readhash[1] = s->temp.buf[s->temp.size + 2]; readhash[0] = s->temp.buf[s->temp.size + 3]; - if(grub_memcmp (readhash, computed_hash, + if(VasEBoot_memcmp (readhash, computed_hash, s->crc32->mdlen) != 0) return XZ_DATA_ERROR; } @@ -844,7 +844,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) /* Finish the CRC32 value and Index size. */ index_update(s, b); -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) { /* Compare the hashes to validate the Index field. */ @@ -853,7 +853,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) if (s->block.hash.unpadded != s->index.hash.unpadded || s->block.hash.uncompressed != s->index.hash.uncompressed - || grub_memcmp (s->hash->read(s->block.hash.hash_context), + || VasEBoot_memcmp (s->hash->read(s->block.hash.hash_context), s->hash->read(s->index.hash.hash_context), s->hash->mdlen) != 0) return XZ_DATA_ERROR; @@ -944,14 +944,14 @@ enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b) return ret; } -#ifdef GRUB_EMBED_DECOMPRESSOR +#ifdef VasEBoot_EMBED_DECOMPRESSOR struct xz_dec decoder; #endif struct xz_dec * xz_dec_init(uint32_t dict_max) { struct xz_dec *s; -#ifdef GRUB_EMBED_DECOMPRESSOR +#ifdef VasEBoot_EMBED_DECOMPRESSOR s = &decoder; #else s = kmalloc(sizeof(*s), GFP_KERNEL); @@ -981,7 +981,7 @@ error_lzma2: xz_dec_bcj_end(s->bcj); error_bcj: #endif -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR kfree(s); #endif return NULL; @@ -994,24 +994,24 @@ void xz_dec_reset(struct xz_dec *s) s->pos = 0; { -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR uint64_t *t; t = s->block.hash.hash_context; #endif memzero(&s->block, sizeof(s->block)); -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR s->block.hash.hash_context = t; t = s->index.hash.hash_context; #endif memzero(&s->index, sizeof(s->index)); -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR s->index.hash.hash_context = t; #endif } s->temp.pos = 0; s->temp.size = STREAM_HEADER_SIZE; -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR if (s->hash) { s->hash->init(s->hash_context); @@ -1026,7 +1026,7 @@ void xz_dec_end(struct xz_dec *s) { if (s != NULL) { xz_dec_lzma2_end(s->lzma2); -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR kfree(s->index.hash.hash_context); kfree(s->block.hash.hash_context); kfree(s->hash_context); @@ -1035,7 +1035,7 @@ void xz_dec_end(struct xz_dec *s) #ifdef XZ_DEC_BCJ xz_dec_bcj_end(s->bcj); #endif -#ifndef GRUB_EMBED_DECOMPRESSOR +#ifndef VasEBoot_EMBED_DECOMPRESSOR kfree(s); #endif } diff --git a/VasEBoot-core/lib/xzembed/xz_lzma2.h b/VasEBoot-core/lib/xzembed/xz_lzma2.h index 15e553dc0..f787060eb 100644 --- a/VasEBoot-core/lib/xzembed/xz_lzma2.h +++ b/VasEBoot-core/lib/xzembed/xz_lzma2.h @@ -1,20 +1,20 @@ /* xz_lzma2.h - LZMA2 definitions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project diff --git a/VasEBoot-core/lib/xzembed/xz_private.h b/VasEBoot-core/lib/xzembed/xz_private.h index fc845c92d..4e78ffa77 100644 --- a/VasEBoot-core/lib/xzembed/xz_private.h +++ b/VasEBoot-core/lib/xzembed/xz_private.h @@ -1,20 +1,20 @@ /* xz_private.h - Private includes and definitions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project diff --git a/VasEBoot-core/lib/xzembed/xz_stream.h b/VasEBoot-core/lib/xzembed/xz_stream.h index f58397a15..55c6ec497 100644 --- a/VasEBoot-core/lib/xzembed/xz_stream.h +++ b/VasEBoot-core/lib/xzembed/xz_stream.h @@ -1,20 +1,20 @@ /* xz_stream.h - Definitions for handling the .xz file format */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This file is based on code from XZ embedded project diff --git a/VasEBoot-core/loader/aout.c b/VasEBoot-core/loader/aout.c index 69bf6e6ad..9f7bda272 100644 --- a/VasEBoot-core/loader/aout.c +++ b/VasEBoot-core/loader/aout.c @@ -15,16 +15,16 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); int -grub_aout_get_type (union grub_aout_header *header) +VasEBoot_aout_get_type (union VasEBoot_aout_header *header) { int magic; @@ -39,24 +39,24 @@ grub_aout_get_type (union grub_aout_header *header) return AOUT_TYPE_NONE; } -grub_err_t -grub_aout_load (grub_file_t file, int offset, +VasEBoot_err_t +VasEBoot_aout_load (VasEBoot_file_t file, int offset, void *load_addr, - int load_size, grub_size_t bss_size) + int load_size, VasEBoot_size_t bss_size) { - if ((grub_file_seek (file, offset)) == (grub_off_t) - 1) - return grub_errno; + if ((VasEBoot_file_seek (file, offset)) == (VasEBoot_off_t) - 1) + return VasEBoot_errno; if (!load_size) load_size = file->size - offset; - grub_file_read (file, load_addr, load_size); + VasEBoot_file_read (file, load_addr, load_size); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (bss_size) - grub_memset ((char *) load_addr + load_size, 0, bss_size); + VasEBoot_memset ((char *) load_addr + load_size, 0, bss_size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/loader/arm/linux.c b/VasEBoot-core/loader/arm/linux.c index 5b39f02bb..9f89cb0a9 100644 --- a/VasEBoot-core/loader/arm/linux.c +++ b/VasEBoot-core/loader/arm/linux.c @@ -1,47 +1,47 @@ /* linux.c - boot Linux */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_addr_t initrd_start; -static grub_addr_t initrd_end; +static VasEBoot_addr_t initrd_start; +static VasEBoot_addr_t initrd_end; -static grub_addr_t linux_addr; -static grub_size_t linux_size; +static VasEBoot_addr_t linux_addr; +static VasEBoot_size_t linux_size; static char *linux_args; -static grub_uint32_t machine_type; +static VasEBoot_uint32_t machine_type; static void *fdt_addr; typedef void (*kernel_entry_t) (int, unsigned long, void *); @@ -53,10 +53,10 @@ typedef void (*kernel_entry_t) (int, unsigned long, void *); #define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000) #define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000) -static grub_size_t -get_atag_size (grub_uint32_t *atag) +static VasEBoot_size_t +get_atag_size (VasEBoot_uint32_t *atag) { - grub_uint32_t *atag0 = atag; + VasEBoot_uint32_t *atag0 = atag; while (atag[0] && atag[1]) atag += atag[0]; return atag - atag0; @@ -67,21 +67,21 @@ get_atag_size (grub_uint32_t *atag) * Prepares a loaded FDT for being passed to Linux. * Merges in command line parameters and sets up initrd addresses. */ -static grub_err_t +static VasEBoot_err_t linux_prepare_atag (void) { - grub_uint32_t *atag_orig = (grub_uint32_t *) fdt_addr; - grub_uint32_t *tmp_atag, *from, *to; - grub_size_t tmp_size; - grub_size_t arg_size = grub_strlen (linux_args); + VasEBoot_uint32_t *atag_orig = (VasEBoot_uint32_t *) fdt_addr; + VasEBoot_uint32_t *tmp_atag, *from, *to; + VasEBoot_size_t tmp_size; + VasEBoot_size_t arg_size = VasEBoot_strlen (linux_args); char *cmdline_orig = NULL; - grub_size_t cmdline_orig_len = 0; + VasEBoot_size_t cmdline_orig_len = 0; /* some place for cmdline, initrd and terminator. */ tmp_size = get_atag_size (atag_orig) + 20 + (arg_size) / 4; - tmp_atag = grub_malloc (tmp_size * sizeof (grub_uint32_t)); + tmp_atag = VasEBoot_malloc (tmp_size * sizeof (VasEBoot_uint32_t)); if (!tmp_atag) - return grub_errno; + return VasEBoot_errno; for (from = atag_orig, to = tmp_atag; from[0] && from[1]; from += from[0]) @@ -95,29 +95,29 @@ linux_prepare_atag (void) if (*(char *) (from + 2)) { cmdline_orig = (char *) (from + 2); - cmdline_orig_len = grub_strlen (cmdline_orig) + 1; + cmdline_orig_len = VasEBoot_strlen (cmdline_orig) + 1; } break; default: - grub_memcpy (to, from, sizeof (grub_uint32_t) * from[0]); + VasEBoot_memcpy (to, from, sizeof (VasEBoot_uint32_t) * from[0]); to += from[0]; break; } - grub_dprintf ("linux", "linux inherited args: '%s'\n", + VasEBoot_dprintf ("linux", "linux inherited args: '%s'\n", cmdline_orig ? : ""); - grub_dprintf ("linux", "linux_args: '%s'\n", linux_args); + VasEBoot_dprintf ("linux", "linux_args: '%s'\n", linux_args); /* Generate and set command line */ to[0] = 3 + (arg_size + cmdline_orig_len) / 4; to[1] = 0x54410009; if (cmdline_orig) { - grub_memcpy ((char *) to + 8, cmdline_orig, cmdline_orig_len - 1); + VasEBoot_memcpy ((char *) to + 8, cmdline_orig, cmdline_orig_len - 1); *((char *) to + 8 + cmdline_orig_len - 1) = ' '; } - grub_memcpy ((char *) to + 8 + cmdline_orig_len, linux_args, arg_size); - grub_memset ((char *) to + 8 + cmdline_orig_len + arg_size, 0, + VasEBoot_memcpy ((char *) to + 8 + cmdline_orig_len, linux_args, arg_size); + VasEBoot_memset ((char *) to + 8 + cmdline_orig_len + arg_size, 0, 4 - ((arg_size + cmdline_orig_len) & 3)); to += to[0]; @@ -127,7 +127,7 @@ linux_prepare_atag (void) * We're using physical addresses, so even if we have LPAE, we're * restricted to a 32-bit address space. */ - grub_dprintf ("loader", "Initrd @ 0x%08x-0x%08x\n", + VasEBoot_dprintf ("loader", "Initrd @ 0x%08x-0x%08x\n", initrd_start, initrd_end); to[0] = 4; @@ -142,12 +142,12 @@ linux_prepare_atag (void) to += 2; /* Copy updated FDT to its launch location */ - grub_memcpy (atag_orig, tmp_atag, sizeof (grub_uint32_t) * (to - tmp_atag)); - grub_free (tmp_atag); + VasEBoot_memcpy (atag_orig, tmp_atag, sizeof (VasEBoot_uint32_t) * (to - tmp_atag)); + VasEBoot_free (tmp_atag); - grub_dprintf ("loader", "ATAG updated for Linux boot\n"); + VasEBoot_dprintf ("loader", "ATAG updated for Linux boot\n"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* @@ -155,7 +155,7 @@ linux_prepare_atag (void) * Prepares a loaded FDT for being passed to Linux. * Merges in command line parameters and sets up initrd addresses. */ -static grub_err_t +static VasEBoot_err_t linux_prepare_fdt (void) { int node; @@ -163,29 +163,29 @@ linux_prepare_fdt (void) int tmp_size; void *tmp_fdt; - tmp_size = grub_fdt_get_totalsize (fdt_addr) + 0x100 + grub_strlen (linux_args); - tmp_fdt = grub_malloc (tmp_size); + tmp_size = VasEBoot_fdt_get_totalsize (fdt_addr) + 0x100 + VasEBoot_strlen (linux_args); + tmp_fdt = VasEBoot_malloc (tmp_size); if (!tmp_fdt) - return grub_errno; + return VasEBoot_errno; - grub_memcpy (tmp_fdt, fdt_addr, grub_fdt_get_totalsize (fdt_addr)); - grub_fdt_set_totalsize (tmp_fdt, tmp_size); + VasEBoot_memcpy (tmp_fdt, fdt_addr, VasEBoot_fdt_get_totalsize (fdt_addr)); + VasEBoot_fdt_set_totalsize (tmp_fdt, tmp_size); /* Find or create '/chosen' node */ - node = grub_fdt_find_subnode (tmp_fdt, 0, "chosen"); + node = VasEBoot_fdt_find_subnode (tmp_fdt, 0, "chosen"); if (node < 0) { - grub_dprintf ("linux", "No 'chosen' node in FDT - creating.\n"); - node = grub_fdt_add_subnode (tmp_fdt, 0, "chosen"); + VasEBoot_dprintf ("linux", "No 'chosen' node in FDT - creating.\n"); + node = VasEBoot_fdt_add_subnode (tmp_fdt, 0, "chosen"); if (node < 0) goto failure; } - grub_dprintf ("linux", "linux_args: '%s'\n", linux_args); + VasEBoot_dprintf ("linux", "linux_args: '%s'\n", linux_args); /* Generate and set command line */ - retval = grub_fdt_set_prop (tmp_fdt, node, "bootargs", linux_args, - grub_strlen (linux_args) + 1); + retval = VasEBoot_fdt_set_prop (tmp_fdt, node, "bootargs", linux_args, + VasEBoot_strlen (linux_args) + 1); if (retval) goto failure; @@ -195,76 +195,76 @@ linux_prepare_fdt (void) * We're using physical addresses, so even if we have LPAE, we're * restricted to a 32-bit address space. */ - grub_dprintf ("loader", "Initrd @ 0x%08x-0x%08x\n", + VasEBoot_dprintf ("loader", "Initrd @ 0x%08x-0x%08x\n", initrd_start, initrd_end); - retval = grub_fdt_set_prop32 (tmp_fdt, node, "linux,initrd-start", + retval = VasEBoot_fdt_set_prop32 (tmp_fdt, node, "linux,initrd-start", initrd_start); if (retval) goto failure; - retval = grub_fdt_set_prop32 (tmp_fdt, node, "linux,initrd-end", + retval = VasEBoot_fdt_set_prop32 (tmp_fdt, node, "linux,initrd-end", initrd_end); if (retval) goto failure; } /* Copy updated FDT to its launch location */ - grub_memcpy (fdt_addr, tmp_fdt, tmp_size); - grub_free (tmp_fdt); + VasEBoot_memcpy (fdt_addr, tmp_fdt, tmp_size); + VasEBoot_free (tmp_fdt); - grub_dprintf ("loader", "FDT updated for Linux boot\n"); + VasEBoot_dprintf ("loader", "FDT updated for Linux boot\n"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; failure: - grub_free (tmp_fdt); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unable to prepare FDT"); + VasEBoot_free (tmp_fdt); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unable to prepare FDT"); } -static grub_err_t +static VasEBoot_err_t linux_boot (void) { kernel_entry_t linuxmain; int fdt_valid, atag_valid; - fdt_valid = (fdt_addr && grub_fdt_check_header_nosize (fdt_addr) == 0); - atag_valid = ((((grub_uint16_t *) fdt_addr)[3] & ~3) == 0x5440 - && *((grub_uint32_t *) fdt_addr)); - grub_dprintf ("loader", "atag: %p, %x, %x, %s, %s\n", + fdt_valid = (fdt_addr && VasEBoot_fdt_check_header_nosize (fdt_addr) == 0); + atag_valid = ((((VasEBoot_uint16_t *) fdt_addr)[3] & ~3) == 0x5440 + && *((VasEBoot_uint32_t *) fdt_addr)); + VasEBoot_dprintf ("loader", "atag: %p, %x, %x, %s, %s\n", fdt_addr, - ((grub_uint16_t *) fdt_addr)[3], - *((grub_uint32_t *) fdt_addr), + ((VasEBoot_uint16_t *) fdt_addr)[3], + *((VasEBoot_uint32_t *) fdt_addr), (char *) fdt_addr, (char *) fdt_addr + 1); - if (!fdt_valid && machine_type == GRUB_ARM_MACHINE_TYPE_FDT) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + if (!fdt_valid && machine_type == VasEBoot_ARM_MACHINE_TYPE_FDT) + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("device tree must be supplied (see `devicetree' command)")); - grub_arch_sync_caches ((void *) linux_addr, linux_size); + VasEBoot_arch_sync_caches ((void *) linux_addr, linux_size); - grub_dprintf ("loader", "Kernel at: 0x%x\n", linux_addr); + VasEBoot_dprintf ("loader", "Kernel at: 0x%x\n", linux_addr); if (fdt_valid) { - grub_err_t err; + VasEBoot_err_t err; err = linux_prepare_fdt (); if (err) return err; - grub_dprintf ("loader", "FDT @ 0x%p\n", fdt_addr); + VasEBoot_dprintf ("loader", "FDT @ 0x%p\n", fdt_addr); } else if (atag_valid) { - grub_err_t err; + VasEBoot_err_t err; err = linux_prepare_atag (); if (err) return err; - grub_dprintf ("loader", "ATAG @ 0x%p\n", fdt_addr); + VasEBoot_dprintf ("loader", "ATAG @ 0x%p\n", fdt_addr); } - grub_dprintf ("loader", "Jumping to Linux...\n"); + VasEBoot_dprintf ("loader", "Jumping to Linux...\n"); /* Boot the kernel. * Arguments to kernel: @@ -274,220 +274,220 @@ linux_boot (void) */ linuxmain = (kernel_entry_t) linux_addr; -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI { - grub_err_t err; - err = grub_efi_prepare_platform(); - if (err != GRUB_ERR_NONE) + VasEBoot_err_t err; + err = VasEBoot_efi_prepare_platform(); + if (err != VasEBoot_ERR_NONE) return err; } #endif - grub_arm_disable_caches_mmu (); + VasEBoot_arm_disable_caches_mmu (); linuxmain (0, machine_type, fdt_addr); - return grub_error (GRUB_ERR_BAD_OS, "Linux call returned"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "Linux call returned"); } /* * Only support zImage, so no relocations necessary */ -static grub_err_t -linux_load (const char *filename, grub_file_t file) +static VasEBoot_err_t +linux_load (const char *filename, VasEBoot_file_t file) { int size; - size = grub_file_size (file); + size = VasEBoot_file_size (file); -#ifdef GRUB_MACHINE_EFI - linux_addr = (grub_addr_t) grub_efi_allocate_loader_memory (LINUX_PHYS_OFFSET, size); +#ifdef VasEBoot_MACHINE_EFI + linux_addr = (VasEBoot_addr_t) VasEBoot_efi_allocate_loader_memory (LINUX_PHYS_OFFSET, size); if (!linux_addr) - return grub_errno; + return VasEBoot_errno; #else linux_addr = LINUX_ADDRESS; #endif - grub_dprintf ("loader", "Loading Linux to 0x%08x\n", - (grub_addr_t) linux_addr); + VasEBoot_dprintf ("loader", "Loading Linux to 0x%08x\n", + (VasEBoot_addr_t) linux_addr); - if (grub_file_read (file, (void *) linux_addr, size) != size) + if (VasEBoot_file_read (file, (void *) linux_addr, size) != size) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } if (size > LINUX_ZIMAGE_OFFSET + 4 - && *(grub_uint32_t *) (linux_addr + LINUX_ZIMAGE_OFFSET) + && *(VasEBoot_uint32_t *) (linux_addr + LINUX_ZIMAGE_OFFSET) == LINUX_ZIMAGE_MAGIC) ; - else if (size > 0x8000 && *(grub_uint32_t *) (linux_addr) == 0xea000006 - && machine_type == GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI) - grub_memmove ((void *) linux_addr, (void *) (linux_addr + 0x8000), + else if (size > 0x8000 && *(VasEBoot_uint32_t *) (linux_addr) == 0xea000006 + && machine_type == VasEBoot_ARM_MACHINE_TYPE_RASPBERRY_PI) + VasEBoot_memmove ((void *) linux_addr, (void *) (linux_addr + 0x8000), size - 0x8000); else - return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("invalid zImage")); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("invalid zImage")); linux_size = size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t linux_unload (void) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_free (linux_args); + VasEBoot_free (linux_args); linux_args = NULL; initrd_start = initrd_end = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { int size; - grub_err_t err; - grub_file_t file; - grub_dl_ref (my_mod); + VasEBoot_err_t err; + VasEBoot_file_t file; + VasEBoot_dl_ref (my_mod); if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) goto fail; err = linux_load (argv[0], file); - grub_file_close (file); + VasEBoot_file_close (file); if (err) goto fail; - grub_loader_set (linux_boot, linux_unload, 0); + VasEBoot_loader_set (linux_boot, linux_unload, 0); - size = grub_loader_cmdline_size (argc, argv); - linux_args = grub_malloc (size + sizeof (LINUX_IMAGE)); + size = VasEBoot_loader_cmdline_size (argc, argv); + linux_args = VasEBoot_malloc (size + sizeof (LINUX_IMAGE)); if (!linux_args) { - grub_loader_unset(); + VasEBoot_loader_unset(); goto fail; } /* Create kernel command line. */ - grub_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, + VasEBoot_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file; - grub_size_t size = 0; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + VasEBoot_file_t file; + VasEBoot_size_t size = 0; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) - return grub_errno; + return VasEBoot_errno; - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI if (initrd_start) - grub_efi_free_pages (initrd_start, + VasEBoot_efi_free_pages (initrd_start, (initrd_end - initrd_start + 0xfff) >> 12); - initrd_start = (grub_addr_t) grub_efi_allocate_loader_memory (LINUX_INITRD_PHYS_OFFSET, size); + initrd_start = (VasEBoot_addr_t) VasEBoot_efi_allocate_loader_memory (LINUX_INITRD_PHYS_OFFSET, size); if (!initrd_start) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto fail; } #else initrd_start = LINUX_INITRD_ADDRESS; #endif - grub_dprintf ("loader", "Loading initrd to 0x%08x\n", - (grub_addr_t) initrd_start); + VasEBoot_dprintf ("loader", "Loading initrd to 0x%08x\n", + (VasEBoot_addr_t) initrd_start); - if (grub_initrd_load (&initrd_ctx, argv, (void *) initrd_start)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, (void *) initrd_start)) goto fail; initrd_end = initrd_start + size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -load_dtb (grub_file_t dtb, int size) +static VasEBoot_err_t +load_dtb (VasEBoot_file_t dtb, int size) { - if ((grub_file_read (dtb, fdt_addr, size) != size) - || (grub_fdt_check_header (fdt_addr, size) != 0)) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree")); + if ((VasEBoot_file_read (dtb, fdt_addr, size) != size) + || (VasEBoot_fdt_check_header (fdt_addr, size) != 0)) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid device tree")); - grub_fdt_set_totalsize (fdt_addr, size); - return GRUB_ERR_NONE; + VasEBoot_fdt_set_totalsize (fdt_addr, size); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_devicetree (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t dtb; + VasEBoot_file_t dtb; int size; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - dtb = grub_file_open (argv[0]); + dtb = VasEBoot_file_open (argv[0]); if (!dtb) goto out; - size = grub_file_size (dtb); + size = VasEBoot_file_size (dtb); if (size == 0) { - grub_error (GRUB_ERR_BAD_OS, "empty file"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "empty file"); goto out; } -#ifdef GRUB_MACHINE_EFI - fdt_addr = grub_efi_allocate_loader_memory (LINUX_FDT_PHYS_OFFSET, size); +#ifdef VasEBoot_MACHINE_EFI + fdt_addr = VasEBoot_efi_allocate_loader_memory (LINUX_FDT_PHYS_OFFSET, size); if (!fdt_addr) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto out; } #else fdt_addr = (void *) LINUX_FDT_ADDRESS; #endif - grub_dprintf ("loader", "Loading device tree to 0x%08x\n", - (grub_addr_t) fdt_addr); + VasEBoot_dprintf ("loader", "Loading device tree to 0x%08x\n", + (VasEBoot_addr_t) fdt_addr); load_dtb (dtb, size); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { fdt_addr = NULL; goto out; @@ -497,33 +497,33 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), * We've successfully loaded an FDT, so any machine type passed * from firmware is now obsolete. */ - machine_type = GRUB_ARM_MACHINE_TYPE_FDT; + machine_type = VasEBoot_ARM_MACHINE_TYPE_FDT; out: - grub_file_close (dtb); + VasEBoot_file_close (dtb); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd, cmd_devicetree; +static VasEBoot_command_t cmd_linux, cmd_initrd, cmd_devicetree; -GRUB_MOD_INIT (linux) +VasEBoot_MOD_INIT (linux) { - cmd_linux = grub_register_command ("linux", grub_cmd_linux, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); - cmd_devicetree = grub_register_command ("devicetree", grub_cmd_devicetree, + cmd_devicetree = VasEBoot_register_command ("devicetree", VasEBoot_cmd_devicetree, /* TRANSLATORS: DTB stands for device tree blob. */ 0, N_("Load DTB file.")); my_mod = mod; - fdt_addr = (void *) grub_arm_firmware_get_boot_data (); - machine_type = grub_arm_firmware_get_machine_type (); + fdt_addr = (void *) VasEBoot_arm_firmware_get_boot_data (); + machine_type = VasEBoot_arm_firmware_get_machine_type (); } -GRUB_MOD_FINI (linux) +VasEBoot_MOD_FINI (linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); - grub_unregister_command (cmd_devicetree); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_devicetree); } diff --git a/VasEBoot-core/loader/arm64/fdt.c b/VasEBoot-core/loader/arm64/fdt.c index db49cf649..2c35eafba 100644 --- a/VasEBoot-core/loader/arm64/fdt.c +++ b/VasEBoot-core/loader/arm64/fdt.c @@ -1,163 +1,163 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013-2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include static void *loaded_fdt; static void *fdt; void * -grub_fdt_load (grub_size_t additional_size) +VasEBoot_fdt_load (VasEBoot_size_t additional_size) { void *raw_fdt; - grub_size_t size; + VasEBoot_size_t size; if (fdt) { - size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)); - grub_efi_free_pages ((grub_efi_physical_address_t) fdt, size); + size = VasEBoot_EFI_BYTES_TO_PAGES (VasEBoot_fdt_get_totalsize (fdt)); + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) fdt, size); } if (loaded_fdt) raw_fdt = loaded_fdt; else - raw_fdt = grub_efi_get_firmware_fdt(); + raw_fdt = VasEBoot_efi_get_firmware_fdt(); size = - raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; + raw_fdt ? VasEBoot_fdt_get_totalsize (raw_fdt) : VasEBoot_FDT_EMPTY_TREE_SZ; size += additional_size; - grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size); - fdt = grub_efi_allocate_pages (0, GRUB_EFI_BYTES_TO_PAGES (size)); + VasEBoot_dprintf ("linux", "allocating %ld bytes for fdt\n", size); + fdt = VasEBoot_efi_allocate_pages (0, VasEBoot_EFI_BYTES_TO_PAGES (size)); if (!fdt) return NULL; if (raw_fdt) { - grub_memmove (fdt, raw_fdt, size); - grub_fdt_set_totalsize (fdt, size); + VasEBoot_memmove (fdt, raw_fdt, size); + VasEBoot_fdt_set_totalsize (fdt, size); } else { - grub_fdt_create_empty_tree (fdt, size); + VasEBoot_fdt_create_empty_tree (fdt, size); } return fdt; } -grub_err_t -grub_fdt_install (void) +VasEBoot_err_t +VasEBoot_fdt_install (void) { - grub_efi_boot_services_t *b; - grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; - grub_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_guid_t fdt_guid = VasEBoot_EFI_DEVICE_TREE_GUID; + VasEBoot_efi_status_t status; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; status = b->install_configuration_table (&fdt_guid, fdt); - if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_IO, "failed to install FDT"); + if (status != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_IO, "failed to install FDT"); - grub_dprintf ("fdt", "Installed/updated FDT configuration table @ %p\n", + VasEBoot_dprintf ("fdt", "Installed/updated FDT configuration table @ %p\n", fdt); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_fdt_unload (void) { +VasEBoot_fdt_unload (void) { if (!fdt) { return; } - grub_efi_free_pages ((grub_efi_physical_address_t) fdt, - GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt))); + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) fdt, + VasEBoot_EFI_BYTES_TO_PAGES (VasEBoot_fdt_get_totalsize (fdt))); fdt = NULL; } -static grub_err_t -grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_devicetree (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t dtb; + VasEBoot_file_t dtb; void *blob = NULL; int size; if (loaded_fdt) - grub_free (loaded_fdt); + VasEBoot_free (loaded_fdt); loaded_fdt = NULL; /* No arguments means "use firmware FDT". */ if (argc == 0) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - dtb = grub_file_open (argv[0]); + dtb = VasEBoot_file_open (argv[0]); if (!dtb) goto out; - size = grub_file_size (dtb); - blob = grub_malloc (size); + size = VasEBoot_file_size (dtb); + blob = VasEBoot_malloc (size); if (!blob) goto out; - if (grub_file_read (dtb, blob, size) < size) + if (VasEBoot_file_read (dtb, blob, size) < size) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto out; } - if (grub_fdt_check_header (blob, size) != 0) + if (VasEBoot_fdt_check_header (blob, size) != 0) { - grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree")); + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid device tree")); goto out; } out: if (dtb) - grub_file_close (dtb); + VasEBoot_file_close (dtb); if (blob) { - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) loaded_fdt = blob; else - grub_free (blob); + VasEBoot_free (blob); } - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_devicetree; +static VasEBoot_command_t cmd_devicetree; -GRUB_MOD_INIT (fdt) +VasEBoot_MOD_INIT (fdt) { cmd_devicetree = - grub_register_command ("devicetree", grub_cmd_devicetree, 0, + VasEBoot_register_command ("devicetree", VasEBoot_cmd_devicetree, 0, N_("Load DTB file.")); } -GRUB_MOD_FINI (fdt) +VasEBoot_MOD_FINI (fdt) { - grub_unregister_command (cmd_devicetree); + VasEBoot_unregister_command (cmd_devicetree); } diff --git a/VasEBoot-core/loader/arm64/linux.c b/VasEBoot-core/loader/arm64/linux.c index 432f5c073..c70c6384e 100644 --- a/VasEBoot-core/loader/arm64/linux.c +++ b/VasEBoot-core/loader/arm64/linux.c @@ -1,86 +1,86 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; static void *kernel_addr; -static grub_uint64_t kernel_size; +static VasEBoot_uint64_t kernel_size; static char *linux_args; -static grub_uint32_t cmdline_size; +static VasEBoot_uint32_t cmdline_size; -static grub_addr_t initrd_start; -static grub_addr_t initrd_end; +static VasEBoot_addr_t initrd_start; +static VasEBoot_addr_t initrd_end; -grub_err_t -grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) +VasEBoot_err_t +VasEBoot_arm64_uefi_check_image (struct VasEBoot_arm64_linux_kernel_header * lh) { - if (lh->magic != GRUB_ARM64_LINUX_MAGIC) - return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); + if (lh->magic != VasEBoot_ARM64_LINUX_MAGIC) + return VasEBoot_error(VasEBoot_ERR_BAD_OS, "invalid magic number"); - if ((lh->code0 & 0xffff) != GRUB_EFI_PE_MAGIC) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if ((lh->code0 & 0xffff) != VasEBoot_EFI_PE_MAGIC) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); - grub_dprintf ("linux", "UEFI stub kernel:\n"); - grub_dprintf ("linux", "text_offset = 0x%012llx\n", + VasEBoot_dprintf ("linux", "UEFI stub kernel:\n"); + VasEBoot_dprintf ("linux", "text_offset = 0x%012llx\n", (long long unsigned) lh->text_offset); - grub_dprintf ("linux", "PE/COFF header @ %08x\n", lh->hdr_offset); + VasEBoot_dprintf ("linux", "PE/COFF header @ %08x\n", lh->hdr_offset); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t finalize_params_linux (void) { int node, retval; void *fdt; - fdt = grub_fdt_load (0x400); + fdt = VasEBoot_fdt_load (0x400); if (!fdt) goto failure; - node = grub_fdt_find_subnode (fdt, 0, "chosen"); + node = VasEBoot_fdt_find_subnode (fdt, 0, "chosen"); if (node < 0) - node = grub_fdt_add_subnode (fdt, 0, "chosen"); + node = VasEBoot_fdt_add_subnode (fdt, 0, "chosen"); if (node < 1) goto failure; @@ -88,271 +88,271 @@ finalize_params_linux (void) /* Set initrd info */ if (initrd_start && initrd_end > initrd_start) { - grub_dprintf ("linux", "Initrd @ 0x%012lx-0x%012lx\n", + VasEBoot_dprintf ("linux", "Initrd @ 0x%012lx-0x%012lx\n", initrd_start, initrd_end); - retval = grub_fdt_set_prop64 (fdt, node, "linux,initrd-start", + retval = VasEBoot_fdt_set_prop64 (fdt, node, "linux,initrd-start", initrd_start); if (retval) goto failure; - retval = grub_fdt_set_prop64 (fdt, node, "linux,initrd-end", + retval = VasEBoot_fdt_set_prop64 (fdt, node, "linux,initrd-end", initrd_end); if (retval) goto failure; } - if (grub_fdt_install() != GRUB_ERR_NONE) + if (VasEBoot_fdt_install() != VasEBoot_ERR_NONE) goto failure; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; failure: - grub_fdt_unload(); - return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); + VasEBoot_fdt_unload(); + return VasEBoot_error(VasEBoot_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) +VasEBoot_err_t +VasEBoot_arm64_uefi_boot_image (VasEBoot_addr_t addr, VasEBoot_size_t size, char *args) { - grub_efi_memory_mapped_device_path_t *mempath; - grub_efi_handle_t image_handle; - grub_efi_boot_services_t *b; - grub_efi_status_t status; - grub_efi_loaded_image_t *loaded_image; + VasEBoot_efi_memory_mapped_device_path_t *mempath; + VasEBoot_efi_handle_t image_handle; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_status_t status; + VasEBoot_efi_loaded_image_t *loaded_image; int len; - mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); + mempath = VasEBoot_malloc (2 * sizeof (VasEBoot_efi_memory_mapped_device_path_t)); if (!mempath) - return grub_errno; + return VasEBoot_errno; - mempath[0].header.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE; - mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; - mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); - mempath[0].memory_type = GRUB_EFI_LOADER_DATA; + mempath[0].header.type = VasEBoot_EFI_HARDWARE_DEVICE_PATH_TYPE; + mempath[0].header.subtype = VasEBoot_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; + mempath[0].header.length = VasEBoot_cpu_to_le16_compile_time (sizeof (*mempath)); + mempath[0].memory_type = VasEBoot_EFI_LOADER_DATA; mempath[0].start_address = addr; mempath[0].end_address = addr + size; - 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); + mempath[1].header.type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + mempath[1].header.subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + mempath[1].header.length = sizeof (VasEBoot_efi_device_path_t); - b = grub_efi_system_table->boot_services; - status = b->load_image (0, grub_efi_image_handle, - (grub_efi_device_path_t *) mempath, + b = VasEBoot_efi_system_table->boot_services; + status = b->load_image (0, VasEBoot_efi_image_handle, + (VasEBoot_efi_device_path_t *) mempath, (void *) addr, size, &image_handle); - if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); + if (status != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "cannot load image"); - grub_dprintf ("linux", "linux command line: '%s'\n", args); + VasEBoot_dprintf ("linux", "linux command line: '%s'\n", args); /* Convert command line to UCS-2 */ - loaded_image = grub_efi_get_loaded_image (image_handle); + loaded_image = VasEBoot_efi_get_loaded_image (image_handle); loaded_image->load_options_size = len = - (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); + (VasEBoot_strlen (args) + 1) * sizeof (VasEBoot_efi_char16_t); loaded_image->load_options = - grub_efi_allocate_pages (0, - GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); + VasEBoot_efi_allocate_pages (0, + VasEBoot_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); if (!loaded_image->load_options) - return grub_errno; + return VasEBoot_errno; loaded_image->load_options_size = - 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, - (grub_uint8_t *) args, len, NULL); + 2 * VasEBoot_utf8_to_utf16 (loaded_image->load_options, len, + (VasEBoot_uint8_t *) args, len, NULL); - grub_dprintf ("linux", "starting image %p\n", image_handle); + VasEBoot_dprintf ("linux", "starting image %p\n", image_handle); status = b->start_image (image_handle, 0, NULL); /* When successful, not reached */ b->unload_image (image_handle); - grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options, - GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) loaded_image->load_options, + VasEBoot_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_linux_boot (void) +static VasEBoot_err_t +VasEBoot_linux_boot (void) { - if (finalize_params_linux () != GRUB_ERR_NONE) - return grub_errno; + if (finalize_params_linux () != VasEBoot_ERR_NONE) + return VasEBoot_errno; - return (grub_arm64_uefi_boot_image((grub_addr_t)kernel_addr, + return (VasEBoot_arm64_uefi_boot_image((VasEBoot_addr_t)kernel_addr, kernel_size, linux_args)); } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; if (initrd_start) - grub_efi_free_pages ((grub_efi_physical_address_t) initrd_start, - GRUB_EFI_BYTES_TO_PAGES (initrd_end - initrd_start)); + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) initrd_start, + VasEBoot_EFI_BYTES_TO_PAGES (initrd_end - initrd_start)); initrd_start = initrd_end = 0; - grub_free (linux_args); + VasEBoot_free (linux_args); if (kernel_addr) - grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr, - GRUB_EFI_BYTES_TO_PAGES (kernel_size)); - grub_fdt_unload (); - return GRUB_ERR_NONE; + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) kernel_addr, + VasEBoot_EFI_BYTES_TO_PAGES (kernel_size)); + VasEBoot_fdt_unload (); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; int initrd_size, initrd_pages; void *initrd_mem = NULL; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - initrd_size = grub_get_initrd_size (&initrd_ctx); - grub_dprintf ("linux", "Loading initrd\n"); + initrd_size = VasEBoot_get_initrd_size (&initrd_ctx); + VasEBoot_dprintf ("linux", "Loading initrd\n"); - initrd_pages = (GRUB_EFI_BYTES_TO_PAGES (initrd_size)); - initrd_mem = grub_efi_allocate_pages (0, initrd_pages); + initrd_pages = (VasEBoot_EFI_BYTES_TO_PAGES (initrd_size)); + initrd_mem = VasEBoot_efi_allocate_pages (0, initrd_pages); if (!initrd_mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto fail; } - if (grub_initrd_load (&initrd_ctx, argv, initrd_mem)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, initrd_mem)) goto fail; - initrd_start = (grub_addr_t) initrd_mem; + initrd_start = (VasEBoot_addr_t) initrd_mem; initrd_end = initrd_start + initrd_size; - grub_dprintf ("linux", "[addr=%p, size=0x%x]\n", + VasEBoot_dprintf ("linux", "[addr=%p, size=0x%x]\n", (void *) initrd_start, initrd_size); fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); if (initrd_mem && !initrd_start) - grub_efi_free_pages ((grub_efi_physical_address_t) initrd_mem, + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) initrd_mem, initrd_pages); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - struct grub_arm64_linux_kernel_header lh; + VasEBoot_file_t file = 0; + struct VasEBoot_arm64_linux_kernel_header lh; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) goto fail; - kernel_size = grub_file_size (file); + kernel_size = VasEBoot_file_size (file); - if (grub_file_read (file, &lh, sizeof (lh)) < (long) sizeof (lh)) - return grub_errno; + if (VasEBoot_file_read (file, &lh, sizeof (lh)) < (long) sizeof (lh)) + return VasEBoot_errno; - if (grub_arm64_uefi_check_image (&lh) != GRUB_ERR_NONE) + if (VasEBoot_arm64_uefi_check_image (&lh) != VasEBoot_ERR_NONE) goto fail; - grub_loader_unset(); + VasEBoot_loader_unset(); - grub_dprintf ("linux", "kernel file size: %lld\n", (long long) kernel_size); - kernel_addr = grub_efi_allocate_pages (0, GRUB_EFI_BYTES_TO_PAGES (kernel_size)); - grub_dprintf ("linux", "kernel numpages: %lld\n", - (long long) GRUB_EFI_BYTES_TO_PAGES (kernel_size)); + VasEBoot_dprintf ("linux", "kernel file size: %lld\n", (long long) kernel_size); + kernel_addr = VasEBoot_efi_allocate_pages (0, VasEBoot_EFI_BYTES_TO_PAGES (kernel_size)); + VasEBoot_dprintf ("linux", "kernel numpages: %lld\n", + (long long) VasEBoot_EFI_BYTES_TO_PAGES (kernel_size)); if (!kernel_addr) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto fail; } - grub_file_seek (file, 0); - if (grub_file_read (file, kernel_addr, kernel_size) - < (grub_int64_t) kernel_size) + VasEBoot_file_seek (file, 0); + if (VasEBoot_file_read (file, kernel_addr, kernel_size) + < (VasEBoot_int64_t) kernel_size) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); + VasEBoot_dprintf ("linux", "kernel @ %p\n", kernel_addr); - cmdline_size = grub_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE) + cmdline_size = VasEBoot_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE) + VERITY_CMDLINE_LENGTH; - linux_args = grub_malloc (cmdline_size); + linux_args = VasEBoot_malloc (cmdline_size); if (!linux_args) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto fail; } - grub_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, + VasEBoot_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, cmdline_size); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - grub_pass_verity_hash (kernel_addr, linux_args, cmdline_size); - grub_loader_set (grub_linux_boot, grub_linux_unload, 0); + VasEBoot_pass_verity_hash (kernel_addr, linux_args, cmdline_size); + VasEBoot_loader_set (VasEBoot_linux_boot, VasEBoot_linux_unload, 0); loaded = 1; } fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; } if (linux_args && !loaded) - grub_free (linux_args); + VasEBoot_free (linux_args); if (kernel_addr && !loaded) - grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr, - GRUB_EFI_BYTES_TO_PAGES (kernel_size)); + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) kernel_addr, + VasEBoot_EFI_BYTES_TO_PAGES (kernel_size)); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT (linux) +VasEBoot_MOD_INIT (linux) { - cmd_linux = grub_register_command ("linux", grub_cmd_linux, 0, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, 0, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI (linux) +VasEBoot_MOD_FINI (linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/arm64/xen_boot.c b/VasEBoot-core/loader/arm64/xen_boot.c index a914eb8e2..d836c3e63 100644 --- a/VasEBoot-core/loader/arm64/xen_boot.c +++ b/VasEBoot-core/loader/arm64/xen_boot.c @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2014 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* required by struct xen_hypervisor_header */ -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* required by struct xen_hypervisor_header */ +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define XEN_HYPERVISOR_NAME "xen_hypervisor" #define MODULE_CUSTOM_COMPATIBLE "multiboot,module" @@ -49,7 +49,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct compat_string_struct { - grub_size_t size; + VasEBoot_size_t size; const char *compat_string; }; typedef struct compat_string_struct compat_string_struct_t; @@ -66,14 +66,14 @@ typedef enum module_type module_type_t; struct xen_hypervisor_header { - struct grub_arm64_linux_kernel_header efi_head; + struct VasEBoot_arm64_linux_kernel_header efi_head; /* This is always PE\0\0. */ - grub_uint8_t signature[GRUB_PE32_SIGNATURE_SIZE]; + VasEBoot_uint8_t signature[VasEBoot_PE32_SIGNATURE_SIZE]; /* The COFF file header. */ - struct grub_pe32_coff_header coff_header; + struct VasEBoot_pe32_coff_header coff_header; /* The Optional header. */ - struct grub_pe64_optional_header optional_header; + struct VasEBoot_pe64_optional_header optional_header; }; struct xen_boot_binary @@ -82,118 +82,118 @@ struct xen_boot_binary struct xen_boot_binary **prev; int is_hypervisor; - grub_addr_t start; - grub_size_t size; - grub_size_t align; + VasEBoot_addr_t start; + VasEBoot_size_t size; + VasEBoot_size_t align; char *cmdline; int cmdline_size; }; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; static struct xen_boot_binary *xen_hypervisor; static struct xen_boot_binary *module_head; -static __inline grub_addr_t -xen_boot_address_align (grub_addr_t start, grub_size_t align) +static __inline VasEBoot_addr_t +xen_boot_address_align (VasEBoot_addr_t start, VasEBoot_size_t align) { return (align ? (ALIGN_UP (start, align)) : start); } -static grub_err_t +static VasEBoot_err_t prepare_xen_hypervisor_params (void *xen_boot_fdt) { int chosen_node = 0; int retval; - chosen_node = grub_fdt_find_subnode (xen_boot_fdt, 0, "chosen"); + chosen_node = VasEBoot_fdt_find_subnode (xen_boot_fdt, 0, "chosen"); if (chosen_node < 0) - chosen_node = grub_fdt_add_subnode (xen_boot_fdt, 0, "chosen"); + chosen_node = VasEBoot_fdt_add_subnode (xen_boot_fdt, 0, "chosen"); if (chosen_node < 1) - return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to get chosen node in FDT"); - grub_dprintf ("xen_loader", + VasEBoot_dprintf ("xen_loader", "Xen Hypervisor cmdline : %s @ %p size:%d\n", xen_hypervisor->cmdline, xen_hypervisor->cmdline, xen_hypervisor->cmdline_size); - retval = grub_fdt_set_prop (xen_boot_fdt, chosen_node, "bootargs", + retval = VasEBoot_fdt_set_prop (xen_boot_fdt, chosen_node, "bootargs", xen_hypervisor->cmdline, xen_hypervisor->cmdline_size); if (retval) - return grub_error (GRUB_ERR_IO, "failed to install/update FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to install/update FDT"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) { int retval, chosen_node = 0, module_node = 0; char module_name[FDT_NODE_NAME_MAX_SIZE]; - retval = grub_snprintf (module_name, FDT_NODE_NAME_MAX_SIZE, "module@%lx", + retval = VasEBoot_snprintf (module_name, FDT_NODE_NAME_MAX_SIZE, "module@%lx", xen_boot_address_align (module->start, module->align)); - grub_dprintf ("xen_loader", "Module node name %s \n", module_name); + VasEBoot_dprintf ("xen_loader", "Module node name %s \n", module_name); if (retval < (int) sizeof ("module@")) - return grub_error (GRUB_ERR_IO, N_("failed to get FDT")); + return VasEBoot_error (VasEBoot_ERR_IO, N_("failed to get FDT")); - chosen_node = grub_fdt_find_subnode (xen_boot_fdt, 0, "chosen"); + chosen_node = VasEBoot_fdt_find_subnode (xen_boot_fdt, 0, "chosen"); if (chosen_node < 0) - chosen_node = grub_fdt_add_subnode (xen_boot_fdt, 0, "chosen"); + chosen_node = VasEBoot_fdt_add_subnode (xen_boot_fdt, 0, "chosen"); if (chosen_node < 1) - return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to get chosen node in FDT"); module_node = - grub_fdt_find_subnode (xen_boot_fdt, chosen_node, module_name); + VasEBoot_fdt_find_subnode (xen_boot_fdt, chosen_node, module_name); if (module_node < 0) module_node = - grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name); + VasEBoot_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name); - retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible", + retval = VasEBoot_fdt_set_prop (xen_boot_fdt, module_node, "compatible", MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1); if (retval) - return grub_error (GRUB_ERR_IO, "failed to update FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to update FDT"); - grub_dprintf ("xen_loader", "Module\n"); + VasEBoot_dprintf ("xen_loader", "Module\n"); - retval = grub_fdt_set_reg64 (xen_boot_fdt, module_node, + retval = VasEBoot_fdt_set_reg64 (xen_boot_fdt, module_node, xen_boot_address_align (module->start, module->align), module->size); if (retval) - return grub_error (GRUB_ERR_IO, "failed to update FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to update FDT"); if (module->cmdline && module->cmdline_size > 0) { - grub_dprintf ("xen_loader", + VasEBoot_dprintf ("xen_loader", "Module cmdline : %s @ %p size:%d\n", module->cmdline, module->cmdline, module->cmdline_size); - retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "bootargs", + retval = VasEBoot_fdt_set_prop (xen_boot_fdt, module_node, "bootargs", module->cmdline, module->cmdline_size + 1); if (retval) - return grub_error (GRUB_ERR_IO, "failed to update FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to update FDT"); } else { - grub_dprintf ("xen_loader", "Module has no bootargs!\n"); + VasEBoot_dprintf ("xen_loader", "Module has no bootargs!\n"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t finalize_params_xen_boot (void) { struct xen_boot_binary *module; void *xen_boot_fdt; - grub_size_t additional_size = 0x1000; + VasEBoot_size_t additional_size = 0x1000; /* Hypervisor. */ additional_size += FDT_NODE_NAME_MAX_SIZE + xen_hypervisor->cmdline_size; @@ -203,18 +203,18 @@ finalize_params_xen_boot (void) + module->cmdline_size; } - xen_boot_fdt = grub_fdt_load (additional_size); + xen_boot_fdt = VasEBoot_fdt_load (additional_size); if (!xen_boot_fdt) - return grub_error (GRUB_ERR_IO, "failed to get FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to get FDT"); if (xen_hypervisor) { - if (prepare_xen_hypervisor_params (xen_boot_fdt) != GRUB_ERR_NONE) + if (prepare_xen_hypervisor_params (xen_boot_fdt) != VasEBoot_ERR_NONE) goto fail; } else { - grub_dprintf ("xen_loader", "Failed to get Xen Hypervisor info!\n"); + VasEBoot_dprintf ("xen_loader", "Failed to get Xen Hypervisor info!\n"); goto fail; } @@ -223,37 +223,37 @@ finalize_params_xen_boot (void) { if (module->start && module->size > 0) { - grub_dprintf ("xen_loader", "Module @ 0x%lx size:0x%lx\n", + VasEBoot_dprintf ("xen_loader", "Module @ 0x%lx size:0x%lx\n", xen_boot_address_align (module->start, module->align), module->size); - if (prepare_xen_module_params (module, xen_boot_fdt) != GRUB_ERR_NONE) + if (prepare_xen_module_params (module, xen_boot_fdt) != VasEBoot_ERR_NONE) goto fail; } else { - grub_dprintf ("xen_loader", "Module info error!\n"); + VasEBoot_dprintf ("xen_loader", "Module info error!\n"); goto fail; } } - if (grub_fdt_install() == GRUB_ERR_NONE) - return GRUB_ERR_NONE; + if (VasEBoot_fdt_install() == VasEBoot_ERR_NONE) + return VasEBoot_ERR_NONE; fail: - grub_fdt_unload (); + VasEBoot_fdt_unload (); - return grub_error (GRUB_ERR_IO, "failed to install/update FDT"); + return VasEBoot_error (VasEBoot_ERR_IO, "failed to install/update FDT"); } -static grub_err_t +static VasEBoot_err_t xen_boot (void) { - grub_err_t err = finalize_params_xen_boot (); + VasEBoot_err_t err = finalize_params_xen_boot (); if (err) return err; - return grub_arm64_uefi_boot_image (xen_hypervisor->start, + return VasEBoot_arm64_uefi_boot_image (xen_hypervisor->start, xen_hypervisor->size, xen_hypervisor->cmdline); } @@ -266,25 +266,25 @@ single_binary_unload (struct xen_boot_binary *binary) if (binary->start && binary->size > 0) { - grub_efi_free_pages ((grub_efi_physical_address_t) binary->start, - GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) binary->start, + VasEBoot_EFI_BYTES_TO_PAGES (binary->size + binary->align)); } if (binary->cmdline && binary->cmdline_size > 0) { - grub_free (binary->cmdline); - grub_dprintf ("xen_loader", + VasEBoot_free (binary->cmdline); + VasEBoot_dprintf ("xen_loader", "Module cmdline memory free @ %p size: %d\n", binary->cmdline, binary->cmdline_size); } if (!binary->is_hypervisor) - grub_list_remove (GRUB_AS_LIST (binary)); + VasEBoot_list_remove (VasEBoot_AS_LIST (binary)); - grub_dprintf ("xen_loader", + VasEBoot_dprintf ("xen_loader", "Module struct memory free @ %p size: 0x%lx\n", binary, sizeof (binary)); - grub_free (binary); + VasEBoot_free (binary); return; } @@ -305,60 +305,60 @@ all_binaries_unload (void) return; } -static grub_err_t +static VasEBoot_err_t xen_unload (void) { loaded = 0; all_binaries_unload (); - grub_fdt_unload (); - grub_dl_unref (my_mod); + VasEBoot_fdt_unload (); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, +xen_boot_binary_load (struct xen_boot_binary *binary, VasEBoot_file_t file, int argc, char *argv[]) { - binary->size = grub_file_size (file); - grub_dprintf ("xen_loader", "Xen_boot file size: 0x%lx\n", binary->size); + binary->size = VasEBoot_file_size (file); + VasEBoot_dprintf ("xen_loader", "Xen_boot file size: 0x%lx\n", binary->size); binary->start - = (grub_addr_t) grub_efi_allocate_pages (0, - GRUB_EFI_BYTES_TO_PAGES + = (VasEBoot_addr_t) VasEBoot_efi_allocate_pages (0, + VasEBoot_EFI_BYTES_TO_PAGES (binary->size + binary->align)); if (!binary->start) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return; } - grub_dprintf ("xen_loader", "Xen_boot numpages: 0x%lx\n", - GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); + VasEBoot_dprintf ("xen_loader", "Xen_boot numpages: 0x%lx\n", + VasEBoot_EFI_BYTES_TO_PAGES (binary->size + binary->align)); - if (grub_file_read (file, (void *) xen_boot_address_align (binary->start, + if (VasEBoot_file_read (file, (void *) xen_boot_address_align (binary->start, binary->align), - binary->size) != (grub_ssize_t) binary->size) + binary->size) != (VasEBoot_ssize_t) binary->size) { single_binary_unload (binary); - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); return; } if (argc > 1) { - binary->cmdline_size = grub_loader_cmdline_size (argc - 1, argv + 1); - binary->cmdline = grub_zalloc (binary->cmdline_size); + binary->cmdline_size = VasEBoot_loader_cmdline_size (argc - 1, argv + 1); + binary->cmdline = VasEBoot_zalloc (binary->cmdline_size); if (!binary->cmdline) { single_binary_unload (binary); - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return; } - grub_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline, + VasEBoot_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline, binary->cmdline_size); - grub_dprintf ("xen_loader", + VasEBoot_dprintf ("xen_loader", "Xen_boot cmdline @ %p %s, size: %d\n", binary->cmdline, binary->cmdline, binary->cmdline_size); } @@ -368,132 +368,132 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, binary->cmdline = NULL; } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } -static grub_err_t -grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xen_module (VasEBoot_command_t cmd __attribute__((unused)), int argc, char *argv[]) { struct xen_boot_binary *module = NULL; - grub_file_t file = 0; + VasEBoot_file_t file = 0; if (!argc) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the Xen Hypervisor first")); goto fail; } module = - (struct xen_boot_binary *) grub_zalloc (sizeof (struct xen_boot_binary)); + (struct xen_boot_binary *) VasEBoot_zalloc (sizeof (struct xen_boot_binary)); if (!module) - return grub_errno; + return VasEBoot_errno; module->is_hypervisor = 0; module->align = 4096; - grub_dprintf ("xen_loader", "Init module and node info\n"); + VasEBoot_dprintf ("xen_loader", "Init module and node info\n"); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) goto fail; xen_boot_binary_load (module, file, argc, argv); - if (grub_errno == GRUB_ERR_NONE) - grub_list_push (GRUB_AS_LIST_P (&module_head), GRUB_AS_LIST (module)); + if (VasEBoot_errno == VasEBoot_ERR_NONE) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&module_head), VasEBoot_AS_LIST (module)); fail: if (file) - grub_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_file_close (file); + if (VasEBoot_errno != VasEBoot_ERR_NONE) single_binary_unload (module); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xen_hypervisor (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { struct xen_hypervisor_header sh; - grub_file_t file = NULL; + VasEBoot_file_t file = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (!argc) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) goto fail; - if (grub_file_read (file, &sh, sizeof (sh)) != (long) sizeof (sh)) + if (VasEBoot_file_read (file, &sh, sizeof (sh)) != (long) sizeof (sh)) goto fail; - if (grub_arm64_uefi_check_image - ((struct grub_arm64_linux_kernel_header *) &sh) != GRUB_ERR_NONE) + if (VasEBoot_arm64_uefi_check_image + ((struct VasEBoot_arm64_linux_kernel_header *) &sh) != VasEBoot_ERR_NONE) goto fail; - grub_file_seek (file, 0); + VasEBoot_file_seek (file, 0); - /* if another module has called grub_loader_set, + /* if another module has called VasEBoot_loader_set, we need to make sure that another module is unloaded properly */ - grub_loader_unset (); + VasEBoot_loader_unset (); xen_hypervisor = - (struct xen_boot_binary *) grub_zalloc (sizeof (struct xen_boot_binary)); + (struct xen_boot_binary *) VasEBoot_zalloc (sizeof (struct xen_boot_binary)); if (!xen_hypervisor) - return grub_errno; + return VasEBoot_errno; xen_hypervisor->is_hypervisor = 1; - xen_hypervisor->align = (grub_size_t) sh.optional_header.section_alignment; + xen_hypervisor->align = (VasEBoot_size_t) sh.optional_header.section_alignment; xen_boot_binary_load (xen_hypervisor, file, argc, argv); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - grub_loader_set (xen_boot, xen_unload, 0); + VasEBoot_loader_set (xen_boot, xen_unload, 0); loaded = 1; } fail: if (file) - grub_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_file_close (file); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { loaded = 0; all_binaries_unload (); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); } - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_xen_hypervisor; -static grub_command_t cmd_xen_module; +static VasEBoot_command_t cmd_xen_hypervisor; +static VasEBoot_command_t cmd_xen_module; -GRUB_MOD_INIT (xen_boot) +VasEBoot_MOD_INIT (xen_boot) { cmd_xen_hypervisor = - grub_register_command ("xen_hypervisor", grub_cmd_xen_hypervisor, 0, + VasEBoot_register_command ("xen_hypervisor", VasEBoot_cmd_xen_hypervisor, 0, N_("Load a xen hypervisor.")); cmd_xen_module = - grub_register_command ("xen_module", grub_cmd_xen_module, 0, + VasEBoot_register_command ("xen_module", VasEBoot_cmd_xen_module, 0, N_("Load a xen module.")); my_mod = mod; } -GRUB_MOD_FINI (xen_boot) +VasEBoot_MOD_FINI (xen_boot) { - grub_unregister_command (cmd_xen_hypervisor); - grub_unregister_command (cmd_xen_module); + VasEBoot_unregister_command (cmd_xen_hypervisor); + VasEBoot_unregister_command (cmd_xen_module); } diff --git a/VasEBoot-core/loader/efi/appleloader.c b/VasEBoot-core/loader/efi/appleloader.c index 74888c463..3cb69b02f 100644 --- a/VasEBoot-core/loader/efi/appleloader.c +++ b/VasEBoot-core/loader/efi/appleloader.c @@ -1,72 +1,72 @@ /* appleloader.c - apple legacy boot loader. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_efi_handle_t image_handle; -static grub_efi_char16_t *cmdline; +static VasEBoot_efi_handle_t image_handle; +static VasEBoot_efi_char16_t *cmdline; -static grub_err_t -grub_appleloader_unload (void) +static VasEBoot_err_t +VasEBoot_appleloader_unload (void) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; efi_call_1 (b->unload_image, image_handle); - grub_free (cmdline); + VasEBoot_free (cmdline); cmdline = 0; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_appleloader_boot (void) +static VasEBoot_err_t +VasEBoot_appleloader_boot (void) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; efi_call_3 (b->start_image, image_handle, 0, 0); - grub_appleloader_unload (); + VasEBoot_appleloader_unload (); - return grub_errno; + return VasEBoot_errno; } struct piwg_full_device_path { - struct grub_efi_memory_mapped_device_path comp1; - struct grub_efi_piwg_device_path comp2; - struct grub_efi_device_path end; + struct VasEBoot_efi_memory_mapped_device_path comp1; + struct VasEBoot_efi_piwg_device_path comp2; + struct VasEBoot_efi_device_path end; }; #define MAKE_PIWG_PATH(st, en) \ @@ -74,28 +74,28 @@ struct piwg_full_device_path .comp1 = \ { \ .header = { \ - .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, \ - .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, \ - .length = sizeof (struct grub_efi_memory_mapped_device_path) \ + .type = VasEBoot_EFI_HARDWARE_DEVICE_PATH_TYPE, \ + .subtype = VasEBoot_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, \ + .length = sizeof (struct VasEBoot_efi_memory_mapped_device_path) \ }, \ - .memory_type = GRUB_EFI_MEMORY_MAPPED_IO, \ + .memory_type = VasEBoot_EFI_MEMORY_MAPPED_IO, \ .start_address = st, \ .end_address = en \ }, \ .comp2 = \ { \ .header = { \ - .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, \ - .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, \ - .length = sizeof (struct grub_efi_piwg_device_path) \ + .type = VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE, \ + .subtype = VasEBoot_EFI_PIWG_DEVICE_PATH_SUBTYPE, \ + .length = sizeof (struct VasEBoot_efi_piwg_device_path) \ }, \ - .guid = GRUB_EFI_VENDOR_APPLE_GUID \ + .guid = VasEBoot_EFI_VENDOR_APPLE_GUID \ }, \ .end = \ { \ - .type = GRUB_EFI_END_DEVICE_PATH_TYPE, \ - .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, \ - .length = sizeof (struct grub_efi_device_path) \ + .type = VasEBoot_EFI_END_DEVICE_PATH_TYPE, \ + .subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, \ + .length = sizeof (struct VasEBoot_efi_device_path) \ } \ } @@ -133,67 +133,67 @@ static struct piwg_full_device_path devpath_8 = MAKE_PIWG_PATH (0xff990000, struct devdata { const char *model; - grub_efi_device_path_t *devpath; + VasEBoot_efi_device_path_t *devpath; }; struct devdata devs[] = { - {"Core Duo/Solo", (grub_efi_device_path_t *) &devpath_1}, - {"Mac Pro", (grub_efi_device_path_t *) &devpath_2}, - {"MBP", (grub_efi_device_path_t *) &devpath_3}, - {"MBA", (grub_efi_device_path_t *) &devpath_4}, - {"MB NV", (grub_efi_device_path_t *) &devpath_5}, - {"MB NV2", (grub_efi_device_path_t *) &devpath_6}, - {"MBP2011", (grub_efi_device_path_t *) &devpath_7}, - {"MBP2012", (grub_efi_device_path_t *) &devpath_8}, + {"Core Duo/Solo", (VasEBoot_efi_device_path_t *) &devpath_1}, + {"Mac Pro", (VasEBoot_efi_device_path_t *) &devpath_2}, + {"MBP", (VasEBoot_efi_device_path_t *) &devpath_3}, + {"MBA", (VasEBoot_efi_device_path_t *) &devpath_4}, + {"MB NV", (VasEBoot_efi_device_path_t *) &devpath_5}, + {"MB NV2", (VasEBoot_efi_device_path_t *) &devpath_6}, + {"MBP2011", (VasEBoot_efi_device_path_t *) &devpath_7}, + {"MBP2012", (VasEBoot_efi_device_path_t *) &devpath_8}, {NULL, NULL}, }; -static grub_err_t -grub_cmd_appleloader (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_appleloader (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_efi_boot_services_t *b; - grub_efi_loaded_image_t *loaded_image; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_loaded_image_t *loaded_image; struct devdata *pdev; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); /* Initialize some global variables. */ image_handle = 0; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; for (pdev = devs ; pdev->devpath ; pdev++) - if (efi_call_6 (b->load_image, 0, grub_efi_image_handle, pdev->devpath, - NULL, 0, &image_handle) == GRUB_EFI_SUCCESS) + if (efi_call_6 (b->load_image, 0, VasEBoot_efi_image_handle, pdev->devpath, + NULL, 0, &image_handle) == VasEBoot_EFI_SUCCESS) break; if (! pdev->devpath) { - grub_error (GRUB_ERR_BAD_OS, "can't find model"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "can't find model"); goto fail; } - grub_dprintf ("appleload", "Model: %s\n", pdev->model); + VasEBoot_dprintf ("appleload", "Model: %s\n", pdev->model); - loaded_image = grub_efi_get_loaded_image (image_handle); + loaded_image = VasEBoot_efi_get_loaded_image (image_handle); if (! loaded_image) { - grub_error (GRUB_ERR_BAD_OS, "no loaded image available"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "no loaded image available"); goto fail; } if (argc > 0) { int i, len; - grub_efi_char16_t *p16; + VasEBoot_efi_char16_t *p16; for (i = 0, len = 0; i < argc; i++) - len += grub_strlen (argv[i]) + 1; + len += VasEBoot_strlen (argv[i]) + 1; - len *= sizeof (grub_efi_char16_t); - cmdline = p16 = grub_malloc (len); + len *= sizeof (VasEBoot_efi_char16_t); + cmdline = p16 = VasEBoot_malloc (len); if (! cmdline) goto fail; @@ -213,21 +213,21 @@ grub_cmd_appleloader (grub_command_t cmd __attribute__ ((unused)), loaded_image->load_options_size = len; } - grub_loader_set (grub_appleloader_boot, grub_appleloader_unload, 0); + VasEBoot_loader_set (VasEBoot_appleloader_boot, VasEBoot_appleloader_unload, 0); return 0; fail: - grub_dl_unref (my_mod); - return grub_errno; + VasEBoot_dl_unref (my_mod); + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(appleloader) +VasEBoot_MOD_INIT(appleloader) { - cmd = grub_register_command ("appleloader", grub_cmd_appleloader, + cmd = VasEBoot_register_command ("appleloader", VasEBoot_cmd_appleloader, N_("[OPTS]"), /* TRANSLATORS: This command is used on EFI to switch to BIOS mode and boot the OS requiring @@ -236,7 +236,7 @@ GRUB_MOD_INIT(appleloader) my_mod = mod; } -GRUB_MOD_FINI(appleloader) +VasEBoot_MOD_FINI(appleloader) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/efi/chainloader.c b/VasEBoot-core/loader/efi/chainloader.c index adc856366..463a3e7dc 100644 --- a/VasEBoot-core/loader/efi/chainloader.c +++ b/VasEBoot-core/loader/efi/chainloader.c @@ -1,150 +1,150 @@ /* chainloader.c - boot another boot loader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* TODO: support load options. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if defined (__i386__) || defined (__x86_64__) -#include -#include +#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_efi_physical_address_t address; -static grub_efi_uintn_t pages; -static grub_efi_device_path_t *file_path; -static grub_efi_handle_t image_handle; -static grub_efi_char16_t *cmdline; +static VasEBoot_efi_physical_address_t address; +static VasEBoot_efi_uintn_t pages; +static VasEBoot_efi_device_path_t *file_path; +static VasEBoot_efi_handle_t image_handle; +static VasEBoot_efi_char16_t *cmdline; -static grub_err_t -grub_chainloader_unload (void) +static VasEBoot_err_t +VasEBoot_chainloader_unload (void) { - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; efi_call_1 (b->unload_image, image_handle); efi_call_2 (b->free_pages, address, pages); - grub_free (file_path); - grub_free (cmdline); + VasEBoot_free (file_path); + VasEBoot_free (cmdline); cmdline = 0; file_path = 0; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_chainloader_boot (void) +static VasEBoot_err_t +VasEBoot_chainloader_boot (void) { - grub_efi_boot_services_t *b; - grub_efi_status_t status; - grub_efi_uintn_t exit_data_size; - grub_efi_char16_t *exit_data = NULL; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_status_t status; + VasEBoot_efi_uintn_t exit_data_size; + VasEBoot_efi_char16_t *exit_data = NULL; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { if (exit_data) { char *buf; - buf = grub_malloc (exit_data_size * 4 + 1); + buf = VasEBoot_malloc (exit_data_size * 4 + 1); if (buf) { - *grub_utf16_to_utf8 ((grub_uint8_t *) buf, + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) buf, exit_data, exit_data_size) = 0; - grub_error (GRUB_ERR_BAD_OS, buf); - grub_free (buf); + VasEBoot_error (VasEBoot_ERR_BAD_OS, buf); + VasEBoot_free (buf); } } else - grub_error (GRUB_ERR_BAD_OS, "unknown error"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "unknown error"); } if (exit_data) efi_call_1 (b->free_pool, exit_data); - grub_loader_unset (); + VasEBoot_loader_unset (); - return grub_errno; + return VasEBoot_errno; } static void -copy_file_path (grub_efi_file_path_device_path_t *fp, - const char *str, grub_efi_uint16_t len) +copy_file_path (VasEBoot_efi_file_path_device_path_t *fp, + const char *str, VasEBoot_efi_uint16_t len) { - grub_efi_char16_t *p; - grub_efi_uint16_t size; + VasEBoot_efi_char16_t *p; + VasEBoot_efi_uint16_t size; - fp->header.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE; - fp->header.subtype = GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE; + fp->header.type = VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE; + fp->header.subtype = VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE; - size = grub_utf8_to_utf16 (fp->path_name, len * GRUB_MAX_UTF16_PER_UTF8, - (const grub_uint8_t *) str, len, 0); + size = VasEBoot_utf8_to_utf16 (fp->path_name, len * VasEBoot_MAX_UTF16_PER_UTF8, + (const VasEBoot_uint8_t *) str, len, 0); for (p = fp->path_name; p < fp->path_name + size; p++) if (*p == '/') *p = '\\'; /* File Path is NULL terminated */ fp->path_name[size++] = '\0'; - fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp); + fp->header.length = size * sizeof (VasEBoot_efi_char16_t) + sizeof (*fp); } -static grub_efi_device_path_t * -make_file_path (grub_efi_device_path_t *dp, const char *filename) +static VasEBoot_efi_device_path_t * +make_file_path (VasEBoot_efi_device_path_t *dp, const char *filename) { char *dir_start; char *dir_end; - grub_size_t size; - grub_efi_device_path_t *d; + VasEBoot_size_t size; + VasEBoot_efi_device_path_t *d; - dir_start = grub_strchr (filename, ')'); + dir_start = VasEBoot_strchr (filename, ')'); if (! dir_start) dir_start = (char *) filename; else dir_start++; - dir_end = grub_strrchr (dir_start, '/'); + dir_end = VasEBoot_strrchr (dir_start, '/'); if (! dir_end) { - grub_error (GRUB_ERR_BAD_FILENAME, "invalid EFI file path"); + VasEBoot_error (VasEBoot_ERR_BAD_FILENAME, "invalid EFI file path"); return 0; } @@ -152,108 +152,108 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) d = dp; while (1) { - size += GRUB_EFI_DEVICE_PATH_LENGTH (d); - if ((GRUB_EFI_END_ENTIRE_DEVICE_PATH (d))) + size += VasEBoot_EFI_DEVICE_PATH_LENGTH (d); + if ((VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (d))) break; - d = GRUB_EFI_NEXT_DEVICE_PATH (d); + d = VasEBoot_EFI_NEXT_DEVICE_PATH (d); } /* File Path is NULL terminated. Allocate space for 2 extra characters */ /* FIXME why we split path in two components? */ - file_path = grub_malloc (size - + ((grub_strlen (dir_start) + 2) - * GRUB_MAX_UTF16_PER_UTF8 - * sizeof (grub_efi_char16_t)) - + sizeof (grub_efi_file_path_device_path_t) * 2); + file_path = VasEBoot_malloc (size + + ((VasEBoot_strlen (dir_start) + 2) + * VasEBoot_MAX_UTF16_PER_UTF8 + * sizeof (VasEBoot_efi_char16_t)) + + sizeof (VasEBoot_efi_file_path_device_path_t) * 2); if (! file_path) return 0; - grub_memcpy (file_path, dp, size); + VasEBoot_memcpy (file_path, dp, size); /* Fill the file path for the directory. */ - d = (grub_efi_device_path_t *) ((char *) file_path + d = (VasEBoot_efi_device_path_t *) ((char *) file_path + ((char *) d - (char *) dp)); - grub_efi_print_device_path (d); - copy_file_path ((grub_efi_file_path_device_path_t *) d, + VasEBoot_efi_print_device_path (d); + copy_file_path ((VasEBoot_efi_file_path_device_path_t *) d, dir_start, dir_end - dir_start); /* Fill the file path for the file. */ - d = GRUB_EFI_NEXT_DEVICE_PATH (d); - copy_file_path ((grub_efi_file_path_device_path_t *) d, - dir_end + 1, grub_strlen (dir_end + 1)); + d = VasEBoot_EFI_NEXT_DEVICE_PATH (d); + copy_file_path ((VasEBoot_efi_file_path_device_path_t *) d, + dir_end + 1, VasEBoot_strlen (dir_end + 1)); /* Fill the end of device path nodes. */ - d = GRUB_EFI_NEXT_DEVICE_PATH (d); - d->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - d->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + d = VasEBoot_EFI_NEXT_DEVICE_PATH (d); + d->type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + d->subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; d->length = sizeof (*d); return file_path; } -static grub_err_t -grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_chainloader (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_ssize_t size; - grub_efi_status_t status; - grub_efi_boot_services_t *b; - grub_device_t dev = 0; - grub_efi_device_path_t *dp = 0; - grub_efi_loaded_image_t *loaded_image; + VasEBoot_file_t file = 0; + VasEBoot_ssize_t size; + VasEBoot_efi_status_t status; + VasEBoot_efi_boot_services_t *b; + VasEBoot_device_t dev = 0; + VasEBoot_efi_device_path_t *dp = 0; + VasEBoot_efi_loaded_image_t *loaded_image; char *filename; void *boot_image = 0; - grub_efi_handle_t dev_handle = 0; + VasEBoot_efi_handle_t dev_handle = 0; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); filename = argv[0]; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); /* Initialize some global variables. */ address = 0; image_handle = 0; file_path = 0; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (! file) goto fail; /* Get the root device's device path. */ - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (! dev) goto fail; if (dev->disk) - dev_handle = grub_efidisk_get_device_handle (dev->disk); + dev_handle = VasEBoot_efidisk_get_device_handle (dev->disk); else if (dev->net && dev->net->server) { - grub_net_network_level_address_t addr; - struct grub_net_network_level_interface *inf; - grub_net_network_level_address_t gateway; - grub_err_t err; + VasEBoot_net_network_level_address_t addr; + struct VasEBoot_net_network_level_interface *inf; + VasEBoot_net_network_level_address_t gateway; + VasEBoot_err_t err; - err = grub_net_resolve_address (dev->net->server, &addr); + err = VasEBoot_net_resolve_address (dev->net->server, &addr); if (err) goto fail; - err = grub_net_route_address (addr, &gateway, &inf); + err = VasEBoot_net_route_address (addr, &gateway, &inf); if (err) goto fail; - dev_handle = grub_efinet_get_device_handle (inf->card); + dev_handle = VasEBoot_efinet_get_device_handle (inf->card); } if (dev_handle) - dp = grub_efi_get_device_path (dev_handle); + dp = VasEBoot_efi_get_device_path (dev_handle); if (! dp) { - grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device"); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "not a valid root device"); goto fail; } @@ -261,84 +261,84 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), if (! file_path) goto fail; - grub_printf ("file path: "); - grub_efi_print_device_path (file_path); + VasEBoot_printf ("file path: "); + VasEBoot_efi_print_device_path (file_path); - size = grub_file_size (file); + size = VasEBoot_file_size (file); if (!size) { - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); goto fail; } - pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12); + pages = (((VasEBoot_efi_uintn_t) size + ((1 << 12) - 1)) >> 12); - status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES, - GRUB_EFI_LOADER_CODE, + status = efi_call_4 (b->allocate_pages, VasEBoot_EFI_ALLOCATE_ANY_PAGES, + VasEBoot_EFI_LOADER_CODE, pages, &address); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - grub_dprintf ("chain", "Failed to allocate %u pages\n", + VasEBoot_dprintf ("chain", "Failed to allocate %u pages\n", (unsigned int) pages); - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); goto fail; } - boot_image = (void *) ((grub_addr_t) address); - if (grub_file_read (file, boot_image, size) != size) + boot_image = (void *) ((VasEBoot_addr_t) address); + if (VasEBoot_file_read (file, boot_image, size) != size) { - if (grub_errno == GRUB_ERR_NONE) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (VasEBoot_errno == VasEBoot_ERR_NONE) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); goto fail; } #if defined (__i386__) || defined (__x86_64__) - if (size >= (grub_ssize_t) sizeof (struct grub_macho_fat_header)) + if (size >= (VasEBoot_ssize_t) sizeof (struct VasEBoot_macho_fat_header)) { - struct grub_macho_fat_header *head = boot_image; + struct VasEBoot_macho_fat_header *head = boot_image; if (head->magic - == grub_cpu_to_le32_compile_time (GRUB_MACHO_FAT_EFI_MAGIC)) + == VasEBoot_cpu_to_le32_compile_time (VasEBoot_MACHO_FAT_EFI_MAGIC)) { - grub_uint32_t i; - struct grub_macho_fat_arch *archs - = (struct grub_macho_fat_arch *) (head + 1); - for (i = 0; i < grub_cpu_to_le32 (head->nfat_arch); i++) + VasEBoot_uint32_t i; + struct VasEBoot_macho_fat_arch *archs + = (struct VasEBoot_macho_fat_arch *) (head + 1); + for (i = 0; i < VasEBoot_cpu_to_le32 (head->nfat_arch); i++) { - if (GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT (archs[i].cputype)) + if (VasEBoot_MACHO_CPUTYPE_IS_HOST_CURRENT (archs[i].cputype)) break; } - if (i == grub_cpu_to_le32 (head->nfat_arch)) + if (i == VasEBoot_cpu_to_le32 (head->nfat_arch)) { - grub_error (GRUB_ERR_BAD_OS, "no compatible arch found"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "no compatible arch found"); goto fail; } - if (grub_cpu_to_le32 (archs[i].offset) - > ~grub_cpu_to_le32 (archs[i].size) - || grub_cpu_to_le32 (archs[i].offset) - + grub_cpu_to_le32 (archs[i].size) - > (grub_size_t) size) + if (VasEBoot_cpu_to_le32 (archs[i].offset) + > ~VasEBoot_cpu_to_le32 (archs[i].size) + || VasEBoot_cpu_to_le32 (archs[i].offset) + + VasEBoot_cpu_to_le32 (archs[i].size) + > (VasEBoot_size_t) size) { - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); goto fail; } - boot_image = (char *) boot_image + grub_cpu_to_le32 (archs[i].offset); - size = grub_cpu_to_le32 (archs[i].size); + boot_image = (char *) boot_image + VasEBoot_cpu_to_le32 (archs[i].offset); + size = VasEBoot_cpu_to_le32 (archs[i].size); } } #endif - status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path, + status = efi_call_6 (b->load_image, 0, VasEBoot_efi_image_handle, file_path, boot_image, size, &image_handle); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - if (status == GRUB_EFI_OUT_OF_RESOURCES) - grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources"); + if (status == VasEBoot_EFI_OUT_OF_RESOURCES) + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "out of resources"); else - grub_error (GRUB_ERR_BAD_OS, "cannot load image"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "cannot load image"); goto fail; } @@ -346,10 +346,10 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), /* 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. */ - loaded_image = grub_efi_get_loaded_image (image_handle); + loaded_image = VasEBoot_efi_get_loaded_image (image_handle); if (! loaded_image) { - grub_error (GRUB_ERR_BAD_OS, "no loaded image available"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "no loaded image available"); goto fail; } loaded_image->device_handle = dev_handle; @@ -357,13 +357,13 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), if (argc > 1) { int i, len; - grub_efi_char16_t *p16; + VasEBoot_efi_char16_t *p16; for (i = 1, len = 0; i < argc; i++) - len += grub_strlen (argv[i]) + 1; + len += VasEBoot_strlen (argv[i]) + 1; - len *= sizeof (grub_efi_char16_t); - cmdline = p16 = grub_malloc (len); + len *= sizeof (VasEBoot_efi_char16_t); + cmdline = p16 = VasEBoot_malloc (len); if (! cmdline) goto fail; @@ -383,40 +383,40 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), loaded_image->load_options_size = len; } - grub_file_close (file); - grub_device_close (dev); + VasEBoot_file_close (file); + VasEBoot_device_close (dev); - grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); + VasEBoot_loader_set (VasEBoot_chainloader_boot, VasEBoot_chainloader_unload, 0); return 0; fail: if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_free (file_path); + VasEBoot_free (file_path); if (address) efi_call_2 (b->free_pages, address, pages); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(chainloader) +VasEBoot_MOD_INIT(chainloader) { - cmd = grub_register_command ("chainloader", grub_cmd_chainloader, + cmd = VasEBoot_register_command ("chainloader", VasEBoot_cmd_chainloader, 0, N_("Load another boot loader.")); my_mod = mod; } -GRUB_MOD_FINI(chainloader) +VasEBoot_MOD_FINI(chainloader) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/i386/bsd.c b/VasEBoot-core/loader/i386/bsd.c index 7f96515da..84966f3b6 100644 --- a/VasEBoot-core/loader/i386/bsd.c +++ b/VasEBoot-core/loader/i386/bsd.c @@ -1,64 +1,64 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef GRUB_MACHINE_PCBIOS -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef VasEBoot_MACHINE_PCBIOS +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#include -#ifdef GRUB_MACHINE_PCBIOS -#include +#include +#ifdef VasEBoot_MACHINE_PCBIOS +#include #endif -#ifdef GRUB_MACHINE_EFI -#include +#ifdef VasEBoot_MACHINE_EFI +#include #define NETBSD_DEFAULT_VIDEO_MODE "800x600" #else #define NETBSD_DEFAULT_VIDEO_MODE "text" -#include +#include #endif -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define ALIGN_DWORD(a) ALIGN_UP (a, 4) #define ALIGN_QWORD(a) ALIGN_UP (a, 8) @@ -66,24 +66,24 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define ALIGN_PAGE(a) ALIGN_UP (a, 4096) static int kernel_type = KERNEL_TYPE_NONE; -static grub_dl_t my_mod; -static grub_addr_t entry, entry_hi, kern_start, kern_end; +static VasEBoot_dl_t my_mod; +static VasEBoot_addr_t entry, entry_hi, kern_start, kern_end; static void *kern_chunk_src; -static grub_uint32_t bootflags; +static VasEBoot_uint32_t bootflags; static int is_elf_kernel, is_64bit; -static grub_uint32_t openbsd_root; -static struct grub_relocator *relocator = NULL; -static struct grub_openbsd_ramdisk_descriptor openbsd_ramdisk; +static VasEBoot_uint32_t openbsd_root; +static struct VasEBoot_relocator *relocator = NULL; +static struct VasEBoot_openbsd_ramdisk_descriptor openbsd_ramdisk; struct bsd_tag { struct bsd_tag *next; - grub_size_t len; - grub_uint32_t type; + VasEBoot_size_t len; + VasEBoot_uint32_t type; union { - grub_uint8_t a; - grub_uint16_t b; - grub_uint32_t c; + VasEBoot_uint8_t a; + VasEBoot_uint16_t b; + VasEBoot_uint32_t c; } data[0]; }; @@ -92,12 +92,12 @@ static struct bsd_tag *tags, *tags_last; struct netbsd_module { struct netbsd_module *next; - struct grub_netbsd_btinfo_module mod; + struct VasEBoot_netbsd_btinfo_module mod; }; static struct netbsd_module *netbsd_mods, *netbsd_mods_last; -static const struct grub_arg_option freebsd_opts[] = +static const struct VasEBoot_arg_option freebsd_opts[] = { {"dual", 'D', 0, N_("Display output on all consoles."), 0, 0}, {"serial", 'h', 0, N_("Use serial console."), 0, 0}, @@ -116,7 +116,7 @@ static const struct grub_arg_option freebsd_opts[] = {0, 0, 0, 0, 0, 0} }; -static const grub_uint32_t freebsd_flags[] = +static const VasEBoot_uint32_t freebsd_flags[] = { FREEBSD_RB_DUAL, FREEBSD_RB_SERIAL, FREEBSD_RB_ASKNAME, FREEBSD_RB_CDROM, FREEBSD_RB_CONFIG, FREEBSD_RB_KDB, @@ -125,7 +125,7 @@ static const grub_uint32_t freebsd_flags[] = FREEBSD_RB_SINGLE, FREEBSD_RB_VERBOSE, 0 }; -static const struct grub_arg_option openbsd_opts[] = +static const struct VasEBoot_arg_option openbsd_opts[] = { {"askname", 'a', 0, N_("Ask for file name to reboot from."), 0, 0}, {"halt", 'b', 0, N_("Don't reboot, just halt."), 0, 0}, @@ -133,7 +133,7 @@ static const struct grub_arg_option openbsd_opts[] = {"single", 's', 0, N_("Boot into single mode."), 0, 0}, {"kdb", 'd', 0, N_("Enter in KDB on boot."), 0, 0}, {"root", 'r', 0, N_("Set root device."), "wdXY", ARG_TYPE_STRING}, - {"serial", 'h', GRUB_ARG_OPTION_OPTIONAL, + {"serial", 'h', VasEBoot_ARG_OPTION_OPTIONAL, N_("Use serial console."), /* TRANSLATORS: "com" is static and not to be translated. It refers to serial ports e.g. com1. @@ -142,7 +142,7 @@ static const struct grub_arg_option openbsd_opts[] = {0, 0, 0, 0, 0, 0} }; -static const grub_uint32_t openbsd_flags[] = +static const VasEBoot_uint32_t openbsd_flags[] = { OPENBSD_RB_ASKNAME, OPENBSD_RB_HALT, OPENBSD_RB_CONFIG, OPENBSD_RB_SINGLE, OPENBSD_RB_KDB, 0 @@ -151,7 +151,7 @@ static const grub_uint32_t openbsd_flags[] = #define OPENBSD_ROOT_ARG (ARRAY_SIZE (openbsd_flags) - 1) #define OPENBSD_SERIAL_ARG (ARRAY_SIZE (openbsd_flags)) -static const struct grub_arg_option netbsd_opts[] = +static const struct VasEBoot_arg_option netbsd_opts[] = { {"no-smp", '1', 0, N_("Disable SMP."), 0, 0}, {"no-acpi", '2', 0, N_("Disable ACPI."), 0, 0}, @@ -166,7 +166,7 @@ static const struct grub_arg_option netbsd_opts[] = {"debug", 'x', 0, N_("Boot with debug messages."), 0, 0}, {"silent", 'z', 0, N_("Suppress normal output (warnings remain)."), 0, 0}, {"root", 'r', 0, N_("Set root device."), N_("DEVICE"), ARG_TYPE_STRING}, - {"serial", 'h', GRUB_ARG_OPTION_OPTIONAL, + {"serial", 'h', VasEBoot_ARG_OPTION_OPTIONAL, N_("Use serial console."), /* TRANSLATORS: "com" is static and not to be translated. It refers to serial ports e.g. com1. @@ -175,7 +175,7 @@ static const struct grub_arg_option netbsd_opts[] = {0, 0, 0, 0, 0, 0} }; -static const grub_uint32_t netbsd_flags[] = +static const VasEBoot_uint32_t netbsd_flags[] = { NETBSD_AB_NOSMP, NETBSD_AB_NOACPI, NETBSD_RB_ASKNAME, NETBSD_RB_HALT, NETBSD_RB_USERCONFIG, NETBSD_RB_KDB, @@ -187,21 +187,21 @@ static const grub_uint32_t netbsd_flags[] = #define NETBSD_SERIAL_ARG (ARRAY_SIZE (netbsd_flags)) static void -grub_bsd_get_device (grub_uint32_t * biosdev, - grub_uint32_t * unit, - grub_uint32_t * slice, grub_uint32_t * part) +VasEBoot_bsd_get_device (VasEBoot_uint32_t * biosdev, + VasEBoot_uint32_t * unit, + VasEBoot_uint32_t * slice, VasEBoot_uint32_t * part) { - grub_device_t dev; + VasEBoot_device_t dev; -#ifdef GRUB_MACHINE_PCBIOS - *biosdev = grub_get_root_biosnumber () & 0xff; +#ifdef VasEBoot_MACHINE_PCBIOS + *biosdev = VasEBoot_get_root_biosnumber () & 0xff; #else *biosdev = 0xff; #endif *unit = (*biosdev & 0x7f); *slice = 0xff; *part = 0xff; - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (dev && dev->disk && dev->disk->partition) { if (dev->disk->partition->parent) @@ -213,17 +213,17 @@ grub_bsd_get_device (grub_uint32_t * biosdev, *slice = dev->disk->partition->number + 1; } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); } -static grub_err_t -grub_bsd_add_meta_ptr (grub_uint32_t type, void **ptr, grub_uint32_t len) +static VasEBoot_err_t +VasEBoot_bsd_add_meta_ptr (VasEBoot_uint32_t type, void **ptr, VasEBoot_uint32_t len) { struct bsd_tag *newtag; - newtag = grub_malloc (len + sizeof (struct bsd_tag)); + newtag = VasEBoot_malloc (len + sizeof (struct bsd_tag)); if (!newtag) - return grub_errno; + return VasEBoot_errno; newtag->len = len; newtag->type = type; newtag->next = NULL; @@ -244,7 +244,7 @@ grub_bsd_add_meta_ptr (grub_uint32_t type, void **ptr, grub_uint32_t len) p->next = newtag; if (newtag->next == NULL) tags_last = newtag; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } @@ -254,61 +254,61 @@ grub_bsd_add_meta_ptr (grub_uint32_t type, void **ptr, grub_uint32_t len) tags = newtag; tags_last = newtag; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_bsd_add_meta (grub_uint32_t type, const void *data, grub_uint32_t len) +VasEBoot_err_t +VasEBoot_bsd_add_meta (VasEBoot_uint32_t type, const void *data, VasEBoot_uint32_t len) { - grub_err_t err; + VasEBoot_err_t err; void *ptr; - err = grub_bsd_add_meta_ptr (type, &ptr, len); + err = VasEBoot_bsd_add_meta_ptr (type, &ptr, len); if (err) return err; if (len) - grub_memcpy (ptr, data, len); - return GRUB_ERR_NONE; + VasEBoot_memcpy (ptr, data, len); + return VasEBoot_ERR_NONE; } -struct grub_e820_mmap +struct VasEBoot_e820_mmap { - grub_uint64_t addr; - grub_uint64_t size; - grub_uint32_t type; -} GRUB_PACKED; -#define GRUB_E820_RAM 1 -#define GRUB_E820_RESERVED 2 -#define GRUB_E820_ACPI 3 -#define GRUB_E820_NVS 4 -#define GRUB_E820_BADRAM 5 -#define GRUB_E820_COREBOOT_TABLES 0x10 + VasEBoot_uint64_t addr; + VasEBoot_uint64_t size; + VasEBoot_uint32_t type; +} VasEBoot_PACKED; +#define VasEBoot_E820_RAM 1 +#define VasEBoot_E820_RESERVED 2 +#define VasEBoot_E820_ACPI 3 +#define VasEBoot_E820_NVS 4 +#define VasEBoot_E820_BADRAM 5 +#define VasEBoot_E820_COREBOOT_TABLES 0x10 /* Context for generate_e820_mmap. */ struct generate_e820_mmap_ctx { int count; - struct grub_e820_mmap *mmap; - struct grub_e820_mmap prev, cur; + struct VasEBoot_e820_mmap *mmap; + struct VasEBoot_e820_mmap prev, cur; }; /* Helper for generate_e820_mmap. */ static int -generate_e820_mmap_iter (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, void *data) +generate_e820_mmap_iter (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { struct generate_e820_mmap_ctx *ctx = data; ctx->cur.addr = addr; ctx->cur.size = size; - if (type == GRUB_MEMORY_COREBOOT_TABLES + if (type == VasEBoot_MEMORY_COREBOOT_TABLES && addr == 0) /* Nowadays the tables at 0 don't contain anything important but *BSD needs the memory at 0 for own needs. */ - type = GRUB_E820_RAM; + type = VasEBoot_E820_RAM; ctx->cur.type = type; @@ -349,98 +349,98 @@ generate_e820_mmap_iter (grub_uint64_t addr, grub_uint64_t size, } static void -generate_e820_mmap (grub_size_t *len, grub_size_t *cnt, void *buf) +generate_e820_mmap (VasEBoot_size_t *len, VasEBoot_size_t *cnt, void *buf) { struct generate_e820_mmap_ctx ctx = { .count = 0, .mmap = buf }; - grub_mmap_iterate (generate_e820_mmap_iter, &ctx); + VasEBoot_mmap_iterate (generate_e820_mmap_iter, &ctx); if (len) - *len = ctx.count * sizeof (struct grub_e820_mmap); + *len = ctx.count * sizeof (struct VasEBoot_e820_mmap); *cnt = ctx.count; return; } -static grub_err_t -grub_bsd_add_mmap (void) +static VasEBoot_err_t +VasEBoot_bsd_add_mmap (void) { - grub_size_t len, cnt; + VasEBoot_size_t len, cnt; void *buf = NULL, *buf0; generate_e820_mmap (&len, &cnt, buf); if (kernel_type == KERNEL_TYPE_NETBSD) - len += sizeof (grub_uint32_t); + len += sizeof (VasEBoot_uint32_t); if (kernel_type == KERNEL_TYPE_OPENBSD) - len += sizeof (struct grub_e820_mmap); + len += sizeof (struct VasEBoot_e820_mmap); - buf = grub_malloc (len); + buf = VasEBoot_malloc (len); if (!buf) - return grub_errno; + return VasEBoot_errno; buf0 = buf; if (kernel_type == KERNEL_TYPE_NETBSD) { - *(grub_uint32_t *) buf = cnt; - buf = ((grub_uint32_t *) buf + 1); + *(VasEBoot_uint32_t *) buf = cnt; + buf = ((VasEBoot_uint32_t *) buf + 1); } generate_e820_mmap (NULL, &cnt, buf); if (kernel_type == KERNEL_TYPE_OPENBSD) - grub_memset ((grub_uint8_t *) buf + len - sizeof (struct grub_e820_mmap), 0, - sizeof (struct grub_e820_mmap)); + VasEBoot_memset ((VasEBoot_uint8_t *) buf + len - sizeof (struct VasEBoot_e820_mmap), 0, + sizeof (struct VasEBoot_e820_mmap)); - grub_dprintf ("bsd", "%u entries in smap\n", (unsigned) cnt); + VasEBoot_dprintf ("bsd", "%u entries in smap\n", (unsigned) cnt); if (kernel_type == KERNEL_TYPE_NETBSD) - grub_bsd_add_meta (NETBSD_BTINFO_MEMMAP, buf0, len); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_MEMMAP, buf0, len); else if (kernel_type == KERNEL_TYPE_OPENBSD) - grub_bsd_add_meta (OPENBSD_BOOTARG_MMAP, buf0, len); + VasEBoot_bsd_add_meta (OPENBSD_BOOTARG_MMAP, buf0, len); else - grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_SMAP, buf0, len); - grub_free (buf0); + VasEBoot_free (buf0); - return grub_errno; + return VasEBoot_errno; } -grub_err_t -grub_freebsd_add_meta_module (const char *filename, const char *type, +VasEBoot_err_t +VasEBoot_freebsd_add_meta_module (const char *filename, const char *type, int argc, char **argv, - grub_addr_t addr, grub_uint32_t size) + VasEBoot_addr_t addr, VasEBoot_uint32_t size) { const char *name; - name = grub_strrchr (filename, '/'); + name = VasEBoot_strrchr (filename, '/'); if (name) name++; else name = filename; - if (grub_strcmp (type, "/boot/zfs/zpool.cache") == 0) + if (VasEBoot_strcmp (type, "/boot/zfs/zpool.cache") == 0) name = "/boot/zfs/zpool.cache"; - if (grub_bsd_add_meta (FREEBSD_MODINFO_NAME, name, grub_strlen (name) + 1)) - return grub_errno; + if (VasEBoot_bsd_add_meta (FREEBSD_MODINFO_NAME, name, VasEBoot_strlen (name) + 1)) + return VasEBoot_errno; if (is_64bit) { - grub_uint64_t addr64 = addr, size64 = size; - if (grub_bsd_add_meta (FREEBSD_MODINFO_TYPE, type, grub_strlen (type) + 1) - || grub_bsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, sizeof (addr64)) - || grub_bsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, sizeof (size64))) - return grub_errno; + VasEBoot_uint64_t addr64 = addr, size64 = size; + if (VasEBoot_bsd_add_meta (FREEBSD_MODINFO_TYPE, type, VasEBoot_strlen (type) + 1) + || VasEBoot_bsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, sizeof (addr64)) + || VasEBoot_bsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, sizeof (size64))) + return VasEBoot_errno; } else { - if (grub_bsd_add_meta (FREEBSD_MODINFO_TYPE, type, grub_strlen (type) + 1) - || grub_bsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, sizeof (addr)) - || grub_bsd_add_meta (FREEBSD_MODINFO_SIZE, &size, sizeof (size))) - return grub_errno; + if (VasEBoot_bsd_add_meta (FREEBSD_MODINFO_TYPE, type, VasEBoot_strlen (type) + 1) + || VasEBoot_bsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, sizeof (addr)) + || VasEBoot_bsd_add_meta (FREEBSD_MODINFO_SIZE, &size, sizeof (size))) + return VasEBoot_errno; } if (argc) @@ -450,7 +450,7 @@ grub_freebsd_add_meta_module (const char *filename, const char *type, n = 0; for (i = 0; i < argc; i++) { - n += grub_strlen (argv[i]) + 1; + n += VasEBoot_strlen (argv[i]) + 1; } if (n) @@ -458,29 +458,29 @@ grub_freebsd_add_meta_module (const char *filename, const char *type, void *cmdline; char *p; - if (grub_bsd_add_meta_ptr (FREEBSD_MODINFO_ARGS, &cmdline, n)) - return grub_errno; + if (VasEBoot_bsd_add_meta_ptr (FREEBSD_MODINFO_ARGS, &cmdline, n)) + return VasEBoot_errno; p = cmdline; for (i = 0; i < argc; i++) { - grub_strcpy (p, argv[i]); - p += grub_strlen (argv[i]); + VasEBoot_strcpy (p, argv[i]); + p += VasEBoot_strlen (argv[i]); *(p++) = ' '; } *p = 0; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_freebsd_list_modules (void) +VasEBoot_freebsd_list_modules (void) { struct bsd_tag *tag; - grub_printf (" %-18s %-18s%14s%14s\n", _("name"), _("type"), _("addr"), + VasEBoot_printf (" %-18s %-18s%14s%14s\n", _("name"), _("type"), _("addr"), _("size")); for (tag = tags; tag; tag = tag->next) @@ -489,45 +489,45 @@ grub_freebsd_list_modules (void) { case FREEBSD_MODINFO_NAME: case FREEBSD_MODINFO_TYPE: - grub_printf (" %-18s", (char *) tag->data); + VasEBoot_printf (" %-18s", (char *) tag->data); break; case FREEBSD_MODINFO_ADDR: { - grub_uint32_t addr; + VasEBoot_uint32_t addr; - addr = *((grub_uint32_t *) tag->data); - grub_printf (" 0x%08x", addr); + addr = *((VasEBoot_uint32_t *) tag->data); + VasEBoot_printf (" 0x%08x", addr); break; } case FREEBSD_MODINFO_SIZE: { - grub_uint32_t len; + VasEBoot_uint32_t len; - len = *((grub_uint32_t *) tag->data); - grub_printf (" 0x%08x\n", len); + len = *((VasEBoot_uint32_t *) tag->data); + VasEBoot_printf (" 0x%08x\n", len); } } } } -static grub_err_t -grub_netbsd_add_meta_module (char *filename, grub_uint32_t type, - grub_addr_t addr, grub_uint32_t size) +static VasEBoot_err_t +VasEBoot_netbsd_add_meta_module (char *filename, VasEBoot_uint32_t type, + VasEBoot_addr_t addr, VasEBoot_uint32_t size) { char *name; struct netbsd_module *mod; - name = grub_strrchr (filename, '/'); + name = VasEBoot_strrchr (filename, '/'); if (name) name++; else name = filename; - mod = grub_zalloc (sizeof (*mod)); + mod = VasEBoot_zalloc (sizeof (*mod)); if (!mod) - return grub_errno; + return VasEBoot_errno; - grub_strncpy (mod->mod.name, name, sizeof (mod->mod.name) - 1); + VasEBoot_strncpy (mod->mod.name, name, sizeof (mod->mod.name) - 1); mod->mod.addr = addr; mod->mod.type = type; mod->mod.size = size; @@ -538,66 +538,66 @@ grub_netbsd_add_meta_module (char *filename, grub_uint32_t type, netbsd_mods = mod; netbsd_mods_last = mod; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_netbsd_list_modules (void) +VasEBoot_netbsd_list_modules (void) { struct netbsd_module *mod; - grub_printf (" %-18s%14s%14s%14s\n", _("name"), _("type"), _("addr"), + VasEBoot_printf (" %-18s%14s%14s%14s\n", _("name"), _("type"), _("addr"), _("size")); for (mod = netbsd_mods; mod; mod = mod->next) - grub_printf (" %-18s 0x%08x 0x%08x 0x%08x", mod->mod.name, + VasEBoot_printf (" %-18s 0x%08x 0x%08x 0x%08x", mod->mod.name, mod->mod.type, mod->mod.addr, mod->mod.size); } /* This function would be here but it's under different license. */ #include "bsd_pagetable.c" -static grub_uint32_t freebsd_bootdev, freebsd_biosdev; -static grub_uint64_t freebsd_zfsguid; +static VasEBoot_uint32_t freebsd_bootdev, freebsd_biosdev; +static VasEBoot_uint64_t freebsd_zfsguid; static void freebsd_get_zfs (void) { - grub_device_t dev; - grub_fs_t fs; + VasEBoot_device_t dev; + VasEBoot_fs_t fs; char *uuid; - grub_err_t err; + VasEBoot_err_t err; - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (!dev) return; - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (!fs) return; - if (!fs->uuid || grub_strcmp (fs->name, "zfs") != 0) + if (!fs->uuid || VasEBoot_strcmp (fs->name, "zfs") != 0) return; err = fs->uuid (dev, &uuid); if (err) return; if (!uuid) return; - freebsd_zfsguid = grub_strtoull (uuid, 0, 16); - grub_free (uuid); + freebsd_zfsguid = VasEBoot_strtoull (uuid, 0, 16); + VasEBoot_free (uuid); } -static grub_err_t -grub_freebsd_boot (void) +static VasEBoot_err_t +VasEBoot_freebsd_boot (void) { - struct grub_freebsd_bootinfo bi; - grub_uint8_t *p, *p0; - grub_addr_t p_target; - grub_size_t p_size = 0; - grub_err_t err; - grub_size_t tag_buf_len = 0; + struct VasEBoot_freebsd_bootinfo bi; + VasEBoot_uint8_t *p, *p0; + VasEBoot_addr_t p_target; + VasEBoot_size_t p_size = 0; + VasEBoot_err_t err; + VasEBoot_size_t tag_buf_len = 0; - struct grub_env_var *var; + struct VasEBoot_env_var *var; - grub_memset (&bi, 0, sizeof (bi)); + VasEBoot_memset (&bi, 0, sizeof (bi)); bi.version = FREEBSD_BOOTINFO_VERSION; bi.length = sizeof (bi); @@ -605,11 +605,11 @@ grub_freebsd_boot (void) p_size = 0; FOR_SORTED_ENV (var) - if ((grub_memcmp (var->name, "kFreeBSD.", sizeof("kFreeBSD.") - 1) == 0) && (var->name[sizeof("kFreeBSD.") - 1])) + if ((VasEBoot_memcmp (var->name, "kFreeBSD.", sizeof("kFreeBSD.") - 1) == 0) && (var->name[sizeof("kFreeBSD.") - 1])) { - p_size += grub_strlen (&var->name[sizeof("kFreeBSD.") - 1]); + p_size += VasEBoot_strlen (&var->name[sizeof("kFreeBSD.") - 1]); p_size++; - p_size += grub_strlen (var->value) + 1; + p_size += VasEBoot_strlen (var->value) + 1; } if (p_size) @@ -619,11 +619,11 @@ grub_freebsd_boot (void) { struct bsd_tag *tag; - err = grub_bsd_add_mmap (); + err = VasEBoot_bsd_add_mmap (); if (err) return err; - err = grub_bsd_add_meta (FREEBSD_MODINFO_END, 0, 0); + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_END, 0, 0); if (err) return err; @@ -639,8 +639,8 @@ grub_freebsd_boot (void) p_size += 4096 * 3; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, kern_end, p_size); if (err) return err; @@ -651,13 +651,13 @@ grub_freebsd_boot (void) kern_end += p_size; FOR_SORTED_ENV (var) - if ((grub_memcmp (var->name, "kFreeBSD.", sizeof("kFreeBSD.") - 1) == 0) && (var->name[sizeof("kFreeBSD.") - 1])) + if ((VasEBoot_memcmp (var->name, "kFreeBSD.", sizeof("kFreeBSD.") - 1) == 0) && (var->name[sizeof("kFreeBSD.") - 1])) { - grub_strcpy ((char *) p, &var->name[sizeof("kFreeBSD.") - 1]); - p += grub_strlen ((char *) p); + VasEBoot_strcpy ((char *) p, &var->name[sizeof("kFreeBSD.") - 1]); + p += VasEBoot_strlen ((char *) p); *(p++) = '='; - grub_strcpy ((char *) p, var->value); - p += grub_strlen ((char *) p) + 1; + VasEBoot_strcpy ((char *) p, var->value); + p += VasEBoot_strlen ((char *) p) + 1; } if (p != p0) @@ -669,7 +669,7 @@ grub_freebsd_boot (void) if (is_elf_kernel) { - grub_uint8_t *p_tag = p; + VasEBoot_uint8_t *p_tag = p; struct bsd_tag *tag; for (tag = tags; tag; tag = tag->next) @@ -683,27 +683,27 @@ grub_freebsd_boot (void) { case FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_HOWTO: if (is_64bit) - *(grub_uint64_t *) p_tag = bootflags; + *(VasEBoot_uint64_t *) p_tag = bootflags; else - *(grub_uint32_t *) p_tag = bootflags; + *(VasEBoot_uint32_t *) p_tag = bootflags; break; case FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_ENVP: if (is_64bit) - *(grub_uint64_t *) p_tag = bi.environment; + *(VasEBoot_uint64_t *) p_tag = bi.environment; else - *(grub_uint32_t *) p_tag = bi.environment; + *(VasEBoot_uint32_t *) p_tag = bi.environment; break; case FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_KERNEND: if (is_64bit) - *(grub_uint64_t *) p_tag = kern_end; + *(VasEBoot_uint64_t *) p_tag = kern_end; else - *(grub_uint32_t *) p_tag = kern_end; + *(VasEBoot_uint32_t *) p_tag = kern_end; break; default: - grub_memcpy (p_tag, tag->data, tag->len); + VasEBoot_memcpy (p_tag, tag->data, tag->len); break; } p_tag += tag->len; @@ -717,22 +717,22 @@ grub_freebsd_boot (void) bi.kern_end = kern_end; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); if (is_64bit) { - struct grub_relocator64_state state; - grub_uint8_t *pagetable; - grub_uint32_t *stack; - grub_addr_t stack_target; + struct VasEBoot_relocator64_state state; + VasEBoot_uint8_t *pagetable; + VasEBoot_uint32_t *stack; + VasEBoot_addr_t stack_target; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, 0x10000, 0x90000, - 3 * sizeof (grub_uint32_t) + 3 * sizeof (VasEBoot_uint32_t) + sizeof (bi), 4, - GRUB_RELOCATOR_PREFERENCE_NONE, + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; @@ -740,8 +740,8 @@ grub_freebsd_boot (void) stack_target = get_physical_target_address (ch); } -#ifdef GRUB_MACHINE_EFI - err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); +#ifdef VasEBoot_MACHINE_EFI + err = VasEBoot_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); if (err) return err; #endif @@ -751,26 +751,26 @@ grub_freebsd_boot (void) state.cr3 = (pagetable - p0) + p_target; state.rsp = stack_target; - state.rip = (((grub_uint64_t) entry_hi) << 32) | entry; + state.rip = (((VasEBoot_uint64_t) entry_hi) << 32) | entry; stack[0] = entry; stack[1] = bi.tags; stack[2] = kern_end; - return grub_relocator64_boot (relocator, state, 0, 0x40000000); + return VasEBoot_relocator64_boot (relocator, state, 0, 0x40000000); } else { - struct grub_relocator32_state state; - grub_uint32_t *stack; - grub_addr_t stack_target; + struct VasEBoot_relocator32_state state; + VasEBoot_uint32_t *stack; + VasEBoot_addr_t stack_target; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, 0x10000, 0x90000, - 9 * sizeof (grub_uint32_t) + 9 * sizeof (VasEBoot_uint32_t) + sizeof (bi), 4, - GRUB_RELOCATOR_PREFERENCE_NONE, + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; @@ -778,13 +778,13 @@ grub_freebsd_boot (void) stack_target = get_physical_target_address (ch); } -#ifdef GRUB_MACHINE_EFI - err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); +#ifdef VasEBoot_MACHINE_EFI + err = VasEBoot_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); if (err) return err; #endif - grub_memcpy (&stack[9], &bi, sizeof (bi)); + VasEBoot_memcpy (&stack[9], &bi, sizeof (bi)); state.eip = entry; state.esp = stack_target; state.ebp = stack_target; @@ -794,35 +794,35 @@ grub_freebsd_boot (void) stack[3] = freebsd_zfsguid ? 4 : 0; stack[4] = freebsd_zfsguid; stack[5] = freebsd_zfsguid >> 32; - stack[6] = stack_target + 9 * sizeof (grub_uint32_t); + stack[6] = stack_target + 9 * sizeof (VasEBoot_uint32_t); stack[7] = bi.tags; stack[8] = kern_end; - return grub_relocator32_boot (relocator, state, 0); + return VasEBoot_relocator32_boot (relocator, state, 0); } /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_openbsd_boot (void) +static VasEBoot_err_t +VasEBoot_openbsd_boot (void) { - grub_uint32_t *stack; - struct grub_relocator32_state state; + VasEBoot_uint32_t *stack; + struct VasEBoot_relocator32_state state; void *curarg, *buf0, *arg0; - grub_addr_t buf_target; - grub_err_t err; - grub_size_t tag_buf_len; + VasEBoot_addr_t buf_target; + VasEBoot_err_t err; + VasEBoot_size_t tag_buf_len; - err = grub_bsd_add_mmap (); + err = VasEBoot_bsd_add_mmap (); if (err) return err; -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.ebx = 0; regs.ecx = 0; @@ -831,17 +831,17 @@ grub_openbsd_boot (void) regs.edi = 0; regs.edx = 0; - grub_bios_interrupt (0x1a, ®s); + VasEBoot_bios_interrupt (0x1a, ®s); if (regs.edx == 0x20494350) { - struct grub_openbsd_bootarg_pcibios pcibios; + struct VasEBoot_openbsd_bootarg_pcibios pcibios; pcibios.characteristics = regs.eax & 0xff; pcibios.revision = regs.ebx & 0xffff; pcibios.pm_entry = regs.edi; pcibios.last_bus = regs.ecx & 0xff; - grub_bsd_add_meta (OPENBSD_BOOTARG_PCIBIOS, &pcibios, + VasEBoot_bsd_add_meta (OPENBSD_BOOTARG_PCIBIOS, &pcibios, sizeof (pcibios)); } } @@ -852,28 +852,28 @@ grub_openbsd_boot (void) tag_buf_len = 0; for (tag = tags; tag; tag = tag->next) tag_buf_len = ALIGN_VAR (tag_buf_len - + sizeof (struct grub_openbsd_bootargs) + + sizeof (struct VasEBoot_openbsd_bootargs) + tag->len); } - buf_target = GRUB_BSD_TEMP_BUFFER - 9 * sizeof (grub_uint32_t); + buf_target = VasEBoot_BSD_TEMP_BUFFER - 9 * sizeof (VasEBoot_uint32_t); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, buf_target, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, buf_target, tag_buf_len - + sizeof (struct grub_openbsd_bootargs) - + 9 * sizeof (grub_uint32_t)); + + sizeof (struct VasEBoot_openbsd_bootargs) + + 9 * sizeof (VasEBoot_uint32_t)); if (err) return err; buf0 = get_virtual_current_address (ch); } - stack = (grub_uint32_t *) buf0; + stack = (VasEBoot_uint32_t *) buf0; arg0 = curarg = stack + 9; { struct bsd_tag *tag; - struct grub_openbsd_bootargs *head; + struct VasEBoot_openbsd_bootargs *head; for (tag = tags; tag; tag = tag->next) { @@ -881,9 +881,9 @@ grub_openbsd_boot (void) head->ba_type = tag->type; head->ba_size = tag->len + sizeof (*head); curarg = head + 1; - grub_memcpy (curarg, tag->data, tag->len); - curarg = (grub_uint8_t *) curarg + tag->len; - head->ba_next = (grub_uint8_t *) curarg - (grub_uint8_t *) buf0 + VasEBoot_memcpy (curarg, tag->data, tag->len); + curarg = (VasEBoot_uint8_t *) curarg + tag->len; + head->ba_next = (VasEBoot_uint8_t *) curarg - (VasEBoot_uint8_t *) buf0 + buf_target; } head = curarg; @@ -892,64 +892,64 @@ grub_openbsd_boot (void) head->ba_next = 0; } - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); -#ifdef GRUB_MACHINE_EFI - err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); +#ifdef VasEBoot_MACHINE_EFI + err = VasEBoot_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); if (err) return err; #endif state.eip = entry; state.ebp = state.esp - = ((grub_uint8_t *) stack - (grub_uint8_t *) buf0) + buf_target; + = ((VasEBoot_uint8_t *) stack - (VasEBoot_uint8_t *) buf0) + buf_target; stack[0] = entry; stack[1] = bootflags; stack[2] = openbsd_root; stack[3] = OPENBSD_BOOTARG_APIVER; stack[4] = 0; - stack[5] = grub_mmap_get_upper () >> 10; - stack[6] = grub_mmap_get_lower () >> 10; - stack[7] = (grub_uint8_t *) curarg - (grub_uint8_t *) arg0; - stack[8] = ((grub_uint8_t *) arg0 - (grub_uint8_t *) buf0) + buf_target; + stack[5] = VasEBoot_mmap_get_upper () >> 10; + stack[6] = VasEBoot_mmap_get_lower () >> 10; + stack[7] = (VasEBoot_uint8_t *) curarg - (VasEBoot_uint8_t *) arg0; + stack[8] = ((VasEBoot_uint8_t *) arg0 - (VasEBoot_uint8_t *) buf0) + buf_target; - return grub_relocator32_boot (relocator, state, 0); + return VasEBoot_relocator32_boot (relocator, state, 0); } -static grub_err_t -grub_netbsd_setup_video (void) +static VasEBoot_err_t +VasEBoot_netbsd_setup_video (void) { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; void *framebuffer; const char *modevar; - struct grub_netbsd_btinfo_framebuf params; - grub_err_t err; - grub_video_driver_id_t driv_id; + struct VasEBoot_netbsd_btinfo_framebuf params; + VasEBoot_err_t err; + VasEBoot_video_driver_id_t driv_id; - modevar = grub_env_get ("gfxpayload"); + modevar = VasEBoot_env_get ("gfxpayload"); /* Now all graphical modes are acceptable. May change in future if we have modes without framebuffer. */ if (modevar && *modevar != 0) { char *tmp; - tmp = grub_xasprintf ("%s;" NETBSD_DEFAULT_VIDEO_MODE, modevar); + tmp = VasEBoot_xasprintf ("%s;" NETBSD_DEFAULT_VIDEO_MODE, modevar); if (! tmp) - return grub_errno; - err = grub_video_set_mode (tmp, 0, 0); - grub_free (tmp); + return VasEBoot_errno; + err = VasEBoot_video_set_mode (tmp, 0, 0); + VasEBoot_free (tmp); } else - err = grub_video_set_mode (NETBSD_DEFAULT_VIDEO_MODE, 0, 0); + err = VasEBoot_video_set_mode (NETBSD_DEFAULT_VIDEO_MODE, 0, 0); if (err) return err; - driv_id = grub_video_get_driver_id (); - if (driv_id == GRUB_VIDEO_DRIVER_NONE) - return GRUB_ERR_NONE; + driv_id = VasEBoot_video_get_driver_id (); + if (driv_id == VasEBoot_VIDEO_DRIVER_NONE) + return VasEBoot_ERR_NONE; - err = grub_video_get_info_and_fini (&mode_info, &framebuffer); + err = VasEBoot_video_get_info_and_fini (&mode_info, &framebuffer); if (err) return err; @@ -960,7 +960,7 @@ grub_netbsd_setup_video (void) params.pitch = mode_info.pitch; params.flags = 0; - params.fbaddr = (grub_addr_t) framebuffer; + params.fbaddr = (VasEBoot_addr_t) framebuffer; params.red_mask_size = mode_info.red_mask_size; params.red_field_pos = mode_info.red_field_pos; @@ -969,23 +969,23 @@ grub_netbsd_setup_video (void) params.blue_mask_size = mode_info.blue_mask_size; params.blue_field_pos = mode_info.blue_field_pos; -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS /* VESA packed modes may come with zeroed mask sizes, which need to be set here according to DAC Palette width. If we don't, this results in Linux displaying a black screen. */ - if (mode_info.bpp <= 8 && driv_id == GRUB_VIDEO_DRIVER_VBE) + if (mode_info.bpp <= 8 && driv_id == VasEBoot_VIDEO_DRIVER_VBE) { - struct grub_vbe_info_block controller_info; + struct VasEBoot_vbe_info_block controller_info; int status; int width = 8; - status = grub_vbe_bios_get_controller_info (&controller_info); + status = VasEBoot_vbe_bios_get_controller_info (&controller_info); - if (status == GRUB_VBE_STATUS_OK && - (controller_info.capabilities & GRUB_VBE_CAPABILITY_DACWIDTH)) - status = grub_vbe_bios_set_dac_palette_width (&width); + if (status == VasEBoot_VBE_STATUS_OK && + (controller_info.capabilities & VasEBoot_VBE_CAPABILITY_DACWIDTH)) + status = VasEBoot_vbe_bios_set_dac_palette_width (&width); - if (status != GRUB_VBE_STATUS_OK) + if (status != VasEBoot_VBE_STATUS_OK) /* 6 is default after mode reset. */ width = 6; @@ -994,34 +994,34 @@ grub_netbsd_setup_video (void) } #endif - err = grub_bsd_add_meta (NETBSD_BTINFO_FRAMEBUF, ¶ms, sizeof (params)); + err = VasEBoot_bsd_add_meta (NETBSD_BTINFO_FRAMEBUF, ¶ms, sizeof (params)); return err; } -static grub_err_t -grub_netbsd_add_modules (void) +static VasEBoot_err_t +VasEBoot_netbsd_add_modules (void) { struct netbsd_module *mod; unsigned modcnt = 0; - struct grub_netbsd_btinfo_modules *mods; + struct VasEBoot_netbsd_btinfo_modules *mods; unsigned i; - grub_err_t err; + VasEBoot_err_t err; for (mod = netbsd_mods; mod; mod = mod->next) modcnt++; - mods = grub_malloc (sizeof (*mods) + sizeof (mods->mods[0]) * modcnt); + mods = VasEBoot_malloc (sizeof (*mods) + sizeof (mods->mods[0]) * modcnt); if (!mods) - return grub_errno; + return VasEBoot_errno; mods->num = modcnt; mods->last_addr = kern_end; for (mod = netbsd_mods, i = 0; mod; i++, mod = mod->next) mods->mods[i] = mod->mod; - err = grub_bsd_add_meta (NETBSD_BTINFO_MODULES, mods, + err = VasEBoot_bsd_add_meta (NETBSD_BTINFO_MODULES, mods, sizeof (*mods) + sizeof (mods->mods[0]) * modcnt); - grub_free (mods); + VasEBoot_free (mods); return err; } @@ -1030,78 +1030,78 @@ grub_netbsd_add_modules (void) * in these bootinfo fields is the root device. */ static void -grub_netbsd_add_boot_disk_and_wedge (void) +VasEBoot_netbsd_add_boot_disk_and_wedge (void) { - grub_device_t dev; - grub_disk_t disk; - grub_partition_t part; - grub_uint32_t biosdev; - grub_uint32_t partmapsector; + VasEBoot_device_t dev; + VasEBoot_disk_t disk; + VasEBoot_partition_t part; + VasEBoot_uint32_t biosdev; + VasEBoot_uint32_t partmapsector; union { - grub_uint64_t raw[GRUB_DISK_SECTOR_SIZE / 8]; - struct grub_partition_bsd_disk_label label; + VasEBoot_uint64_t raw[VasEBoot_DISK_SECTOR_SIZE / 8]; + struct VasEBoot_partition_bsd_disk_label label; } buf; - if (GRUB_MD_MD5->mdlen > GRUB_CRYPTO_MAX_MDLEN) + if (VasEBoot_MD_MD5->mdlen > VasEBoot_CRYPTO_MAX_MDLEN) { - grub_error (GRUB_ERR_BUG, "mdlen too long"); + VasEBoot_error (VasEBoot_ERR_BUG, "mdlen too long"); return; } - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (! (dev && dev->disk && dev->disk->partition)) goto fail; disk = dev->disk; part = disk->partition; - if (disk->dev && disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) - biosdev = (grub_uint32_t) disk->id & 0xff; + if (disk->dev && disk->dev->id == VasEBoot_DISK_DEVICE_BIOSDISK_ID) + biosdev = (VasEBoot_uint32_t) disk->id & 0xff; else biosdev = 0xff; /* Absolute sector of the partition map describing this partition. */ - partmapsector = grub_partition_get_start (part->parent) + part->offset; + partmapsector = VasEBoot_partition_get_start (part->parent) + part->offset; disk->partition = part->parent; - if (grub_disk_read (disk, part->offset, 0, GRUB_DISK_SECTOR_SIZE, buf.raw) - != GRUB_ERR_NONE) + if (VasEBoot_disk_read (disk, part->offset, 0, VasEBoot_DISK_SECTOR_SIZE, buf.raw) + != VasEBoot_ERR_NONE) goto fail; disk->partition = part; /* Fill bootwedge. */ { - struct grub_netbsd_btinfo_bootwedge biw; - grub_uint8_t hash[GRUB_CRYPTO_MAX_MDLEN]; + struct VasEBoot_netbsd_btinfo_bootwedge biw; + VasEBoot_uint8_t hash[VasEBoot_CRYPTO_MAX_MDLEN]; - grub_memset (&biw, 0, sizeof (biw)); + VasEBoot_memset (&biw, 0, sizeof (biw)); biw.biosdev = biosdev; - biw.startblk = grub_partition_get_start (part); + biw.startblk = VasEBoot_partition_get_start (part); biw.nblks = part->len; biw.matchblk = partmapsector; biw.matchnblks = 1; - grub_crypto_hash (GRUB_MD_MD5, hash, - buf.raw, GRUB_DISK_SECTOR_SIZE); - grub_memcpy (biw.matchhash, hash, 16); + VasEBoot_crypto_hash (VasEBoot_MD_MD5, hash, + buf.raw, VasEBoot_DISK_SECTOR_SIZE); + VasEBoot_memcpy (biw.matchhash, hash, 16); - grub_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw)); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw)); } /* Fill bootdisk. */ { - struct grub_netbsd_btinfo_bootdisk bid; + struct VasEBoot_netbsd_btinfo_bootdisk bid; - grub_memset (&bid, 0, sizeof (bid)); + VasEBoot_memset (&bid, 0, sizeof (bid)); /* Check for a NetBSD disk label. */ if (part->partmap != NULL && - (grub_strcmp (part->partmap->name, "netbsd") == 0 || - (part->parent == NULL && grub_strcmp (part->partmap->name, "bsd") == 0))) + (VasEBoot_strcmp (part->partmap->name, "netbsd") == 0 || + (part->parent == NULL && VasEBoot_strcmp (part->partmap->name, "bsd") == 0))) { bid.labelsector = partmapsector; bid.label.type = buf.label.type; bid.label.checksum = buf.label.checksum; - grub_memcpy (bid.label.packname, buf.label.packname, 16); + VasEBoot_memcpy (bid.label.packname, buf.label.packname, 16); } else { @@ -1110,46 +1110,46 @@ grub_netbsd_add_boot_disk_and_wedge (void) bid.biosdev = biosdev; bid.partition = part->number; - grub_bsd_add_meta (NETBSD_BTINFO_BOOTDISK, &bid, sizeof (bid)); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_BOOTDISK, &bid, sizeof (bid)); } fail: if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); } -static grub_err_t -grub_netbsd_boot (void) +static VasEBoot_err_t +VasEBoot_netbsd_boot (void) { - struct grub_netbsd_bootinfo *bootinfo; + struct VasEBoot_netbsd_bootinfo *bootinfo; void *curarg, *arg0; - grub_addr_t arg_target, stack_target; - grub_uint32_t *stack; - grub_err_t err; - struct grub_relocator32_state state; - grub_size_t tag_buf_len = 0; + VasEBoot_addr_t arg_target, stack_target; + VasEBoot_uint32_t *stack; + VasEBoot_err_t err; + struct VasEBoot_relocator32_state state; + VasEBoot_size_t tag_buf_len = 0; int tag_count = 0; - err = grub_bsd_add_mmap (); + err = VasEBoot_bsd_add_mmap (); if (err) return err; - err = grub_netbsd_setup_video (); + err = VasEBoot_netbsd_setup_video (); if (err) { - grub_print_error (); - grub_puts_ (N_("Booting in blind mode")); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_puts_ (N_("Booting in blind mode")); + VasEBoot_errno = VasEBoot_ERR_NONE; } - err = grub_netbsd_add_modules (); + err = VasEBoot_netbsd_add_modules (); if (err) return err; -#ifdef GRUB_MACHINE_EFI - err = grub_bsd_add_meta (NETBSD_BTINFO_EFI, - &grub_efi_system_table, - sizeof (grub_efi_system_table)); +#ifdef VasEBoot_MACHINE_EFI + err = VasEBoot_bsd_add_meta (NETBSD_BTINFO_EFI, + &VasEBoot_efi_system_table, + sizeof (VasEBoot_efi_system_table)); if (err) return err; #endif @@ -1160,7 +1160,7 @@ grub_netbsd_boot (void) for (tag = tags; tag; tag = tag->next) { tag_buf_len = ALIGN_VAR (tag_buf_len - + sizeof (struct grub_netbsd_btinfo_common) + + sizeof (struct VasEBoot_netbsd_btinfo_common) + tag->len); tag_count++; } @@ -1168,18 +1168,18 @@ grub_netbsd_boot (void) arg_target = kern_end; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, arg_target, tag_buf_len - + sizeof (struct grub_netbsd_bootinfo) - + tag_count * sizeof (grub_uint32_t)); + + sizeof (struct VasEBoot_netbsd_bootinfo) + + tag_count * sizeof (VasEBoot_uint32_t)); if (err) return err; curarg = get_virtual_current_address (ch); } arg0 = curarg; - bootinfo = (void *) ((grub_uint8_t *) arg0 + tag_buf_len); + bootinfo = (void *) ((VasEBoot_uint8_t *) arg0 + tag_buf_len); { struct bsd_tag *tag; @@ -1188,22 +1188,22 @@ grub_netbsd_boot (void) bootinfo->bi_count = tag_count; for (tag = tags, i = 0; tag; i++, tag = tag->next) { - struct grub_netbsd_btinfo_common *head = curarg; - bootinfo->bi_data[i] = ((grub_uint8_t *) curarg - (grub_uint8_t *) arg0) + struct VasEBoot_netbsd_btinfo_common *head = curarg; + bootinfo->bi_data[i] = ((VasEBoot_uint8_t *) curarg - (VasEBoot_uint8_t *) arg0) + arg_target; head->type = tag->type; head->len = tag->len + sizeof (*head); curarg = head + 1; - grub_memcpy (curarg, tag->data, tag->len); - curarg = (grub_uint8_t *) curarg + tag->len; + VasEBoot_memcpy (curarg, tag->data, tag->len); + curarg = (VasEBoot_uint8_t *) curarg + tag->len; } } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (relocator, &ch, 0x10000, 0x90000, - 7 * sizeof (grub_uint32_t), 4, - GRUB_RELOCATOR_PREFERENCE_NONE, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, 0x10000, 0x90000, + 7 * sizeof (VasEBoot_uint32_t), 4, + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; @@ -1211,8 +1211,8 @@ grub_netbsd_boot (void) stack_target = get_physical_target_address (ch); } -#ifdef GRUB_MACHINE_EFI - err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); +#ifdef VasEBoot_MACHINE_EFI + err = VasEBoot_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); if (err) return err; #endif @@ -1223,57 +1223,57 @@ grub_netbsd_boot (void) stack[0] = entry; stack[1] = bootflags; stack[2] = 0; - stack[3] = ((grub_uint8_t *) bootinfo - (grub_uint8_t *) arg0) + arg_target; + stack[3] = ((VasEBoot_uint8_t *) bootinfo - (VasEBoot_uint8_t *) arg0) + arg_target; stack[4] = 0; - stack[5] = grub_mmap_get_upper () >> 10; - stack[6] = grub_mmap_get_lower () >> 10; + stack[5] = VasEBoot_mmap_get_upper () >> 10; + stack[6] = VasEBoot_mmap_get_lower () >> 10; - return grub_relocator32_boot (relocator, state, 0); + return VasEBoot_relocator32_boot (relocator, state, 0); } -static grub_err_t -grub_bsd_unload (void) +static VasEBoot_err_t +VasEBoot_bsd_unload (void) { struct bsd_tag *tag, *next; for (tag = tags; tag; tag = next) { next = tag->next; - grub_free (tag); + VasEBoot_free (tag); } tags = NULL; tags_last = NULL; kernel_type = KERNEL_TYPE_NONE; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - grub_relocator_unload (relocator); + VasEBoot_relocator_unload (relocator); relocator = NULL; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_bsd_load_aout (grub_file_t file, const char *filename) +static VasEBoot_err_t +VasEBoot_bsd_load_aout (VasEBoot_file_t file, const char *filename) { - grub_addr_t load_addr, load_end; + VasEBoot_addr_t load_addr, load_end; int ofs, align_page; - union grub_aout_header ah; - grub_err_t err; - grub_size_t bss_size; + union VasEBoot_aout_header ah; + VasEBoot_err_t err; + VasEBoot_size_t bss_size; - if ((grub_file_seek (file, 0)) == (grub_off_t) - 1) - return grub_errno; + if ((VasEBoot_file_seek (file, 0)) == (VasEBoot_off_t) - 1) + return VasEBoot_errno; - if (grub_file_read (file, &ah, sizeof (ah)) != sizeof (ah)) + if (VasEBoot_file_read (file, &ah, sizeof (ah)) != sizeof (ah)) { - if (!grub_errno) - grub_error (GRUB_ERR_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } - if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32) - return grub_error (GRUB_ERR_BAD_OS, "invalid a.out header"); + if (VasEBoot_aout_get_type (&ah) != AOUT_TYPE_AOUT32) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid a.out header"); entry = ah.aout32.a_entry & 0xFFFFFF; @@ -1286,12 +1286,12 @@ grub_bsd_load_aout (grub_file_t file, const char *filename) else { load_addr = entry & 0xF00000; - ofs = sizeof (struct grub_aout32_header); + ofs = sizeof (struct VasEBoot_aout32_header); align_page = 1; } if (load_addr < 0x100000) - return grub_error (GRUB_ERR_BAD_OS, "load address below 1M"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "load address below 1M"); kern_start = load_addr; load_end = kern_end = load_addr + ah.aout32.a_text + ah.aout32.a_data; @@ -1310,31 +1310,31 @@ grub_bsd_load_aout (grub_file_t file, const char *filename) bss_size = 0; { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, kern_start, kern_end - kern_start); if (err) return err; kern_chunk_src = get_virtual_current_address (ch); } - return grub_aout_load (file, ofs, kern_chunk_src, + return VasEBoot_aout_load (file, ofs, kern_chunk_src, ah.aout32.a_text + ah.aout32.a_data, bss_size); } -static grub_err_t -grub_bsd_load_elf (grub_elf_t elf, const char *filename) +static VasEBoot_err_t +VasEBoot_bsd_load_elf (VasEBoot_elf_t elf, const char *filename) { - grub_err_t err; + VasEBoot_err_t err; kern_end = 0; kern_start = ~0; - if (grub_elf_is_elf32 (elf)) + if (VasEBoot_elf_is_elf32 (elf)) { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; Elf32_Phdr *phdr; entry = elf->ehdr.ehdr32.e_entry & 0xFFFFFFF; @@ -1356,31 +1356,31 @@ grub_bsd_load_elf (grub_elf_t elf, const char *filename) kern_end = paddr + phdr->p_memsz; } - if (grub_errno) - return grub_errno; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + if (VasEBoot_errno) + return VasEBoot_errno; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, kern_start, kern_end - kern_start); if (err) return err; kern_chunk_src = get_virtual_current_address (ch); - err = grub_elf32_load (elf, filename, (grub_uint8_t *) kern_chunk_src - kern_start, GRUB_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC | GRUB_ELF_LOAD_FLAGS_28BITS, 0, 0); + err = VasEBoot_elf32_load (elf, filename, (VasEBoot_uint8_t *) kern_chunk_src - kern_start, VasEBoot_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC | VasEBoot_ELF_LOAD_FLAGS_28BITS, 0, 0); if (err) return err; if (kernel_type != KERNEL_TYPE_OPENBSD) - return GRUB_ERR_NONE; - return grub_openbsd_find_ramdisk32 (elf->file, filename, kern_start, + return VasEBoot_ERR_NONE; + return VasEBoot_openbsd_find_ramdisk32 (elf->file, filename, kern_start, kern_chunk_src, &openbsd_ramdisk); } - else if (grub_elf_is_elf64 (elf)) + else if (VasEBoot_elf_is_elf64 (elf)) { Elf64_Phdr *phdr; is_64bit = 1; - if (! grub_cpuid_has_longmode) - return grub_error (GRUB_ERR_BAD_OS, "your CPU does not implement AMD64 architecture"); + if (! VasEBoot_cpuid_has_longmode) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "your CPU does not implement AMD64 architecture"); /* FreeBSD has 64-bit entry point. */ if (kernel_type == KERNEL_TYPE_FREEBSD) @@ -1411,93 +1411,93 @@ grub_bsd_load_elf (grub_elf_t elf, const char *filename) kern_end = paddr + phdr->p_memsz; } - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; - grub_dprintf ("bsd", "kern_start = %lx, kern_end = %lx\n", + VasEBoot_dprintf ("bsd", "kern_start = %lx, kern_end = %lx\n", (unsigned long) kern_start, (unsigned long) kern_end); { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, kern_start, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, kern_start, kern_end - kern_start); if (err) return err; kern_chunk_src = get_virtual_current_address (ch); } - err = grub_elf64_load (elf, filename, - (grub_uint8_t *) kern_chunk_src - kern_start, GRUB_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC | GRUB_ELF_LOAD_FLAGS_28BITS, 0, 0); + err = VasEBoot_elf64_load (elf, filename, + (VasEBoot_uint8_t *) kern_chunk_src - kern_start, VasEBoot_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC | VasEBoot_ELF_LOAD_FLAGS_28BITS, 0, 0); if (err) return err; if (kernel_type != KERNEL_TYPE_OPENBSD) - return GRUB_ERR_NONE; - return grub_openbsd_find_ramdisk64 (elf->file, filename, kern_start, + return VasEBoot_ERR_NONE; + return VasEBoot_openbsd_find_ramdisk64 (elf->file, filename, kern_start, kern_chunk_src, &openbsd_ramdisk); } else - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); } -static grub_err_t -grub_bsd_load (int argc, char *argv[]) +static VasEBoot_err_t +VasEBoot_bsd_load (int argc, char *argv[]) { - grub_file_t file; - grub_elf_t elf; + VasEBoot_file_t file; + VasEBoot_elf_t elf; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - grub_loader_unset (); + VasEBoot_loader_unset (); - grub_memset (&openbsd_ramdisk, 0, sizeof (openbsd_ramdisk)); + VasEBoot_memset (&openbsd_ramdisk, 0, sizeof (openbsd_ramdisk)); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) goto fail; - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) { - grub_file_close (file); + VasEBoot_file_close (file); goto fail; } - elf = grub_elf_file (file, argv[0]); + elf = VasEBoot_elf_file (file, argv[0]); if (elf) { is_elf_kernel = 1; - grub_bsd_load_elf (elf, argv[0]); - grub_elf_close (elf); + VasEBoot_bsd_load_elf (elf, argv[0]); + VasEBoot_elf_close (elf); } else { is_elf_kernel = 0; - grub_errno = 0; - grub_bsd_load_aout (file, argv[0]); - grub_file_close (file); + VasEBoot_errno = 0; + VasEBoot_bsd_load_aout (file, argv[0]); + VasEBoot_file_close (file); } kern_end = ALIGN_PAGE (kern_end); fail: - if (grub_errno != GRUB_ERR_NONE) - grub_dl_unref (my_mod); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + VasEBoot_dl_unref (my_mod); - return grub_errno; + return VasEBoot_errno; } -static grub_uint32_t -grub_bsd_parse_flags (const struct grub_arg_list *state, - const grub_uint32_t * flags) +static VasEBoot_uint32_t +VasEBoot_bsd_parse_flags (const struct VasEBoot_arg_list *state, + const VasEBoot_uint32_t * flags) { - grub_uint32_t result = 0; + VasEBoot_uint32_t result = 0; unsigned i; for (i = 0; flags[i]; i++) @@ -1507,25 +1507,25 @@ grub_bsd_parse_flags (const struct grub_arg_list *state, return result; } -static grub_err_t -grub_cmd_freebsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) +static VasEBoot_err_t +VasEBoot_cmd_freebsd (VasEBoot_extcmd_context_t ctxt, int argc, char *argv[]) { kernel_type = KERNEL_TYPE_FREEBSD; - bootflags = grub_bsd_parse_flags (ctxt->state, freebsd_flags); + bootflags = VasEBoot_bsd_parse_flags (ctxt->state, freebsd_flags); - if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) + if (VasEBoot_bsd_load (argc, argv) == VasEBoot_ERR_NONE) { - grub_uint32_t unit, slice, part; + VasEBoot_uint32_t unit, slice, part; kern_end = ALIGN_PAGE (kern_end); if (is_elf_kernel) { - grub_err_t err; - grub_uint64_t data = 0; - grub_file_t file; + VasEBoot_err_t err; + VasEBoot_uint64_t data = 0; + VasEBoot_file_t file; int len = is_64bit ? 8 : 4; - err = grub_freebsd_add_meta_module (argv[0], is_64bit + err = VasEBoot_freebsd_add_meta_module (argv[0], is_64bit ? FREEBSD_MODTYPE_KERNEL64 : FREEBSD_MODTYPE_KERNEL, argc - 1, argv + 1, @@ -1534,46 +1534,46 @@ grub_cmd_freebsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) if (err) return err; - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; if (is_64bit) - err = grub_freebsd_load_elf_meta64 (relocator, file, argv[0], + err = VasEBoot_freebsd_load_elf_meta64 (relocator, file, argv[0], &kern_end); else - err = grub_freebsd_load_elf_meta32 (relocator, file, argv[0], + err = VasEBoot_freebsd_load_elf_meta32 (relocator, file, argv[0], &kern_end); if (err) return err; - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_HOWTO, &data, 4); if (err) return err; - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_ENVP, &data, len); if (err) return err; - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_KERNEND, &data, len); if (err) return err; } - grub_bsd_get_device (&freebsd_biosdev, &unit, &slice, &part); + VasEBoot_bsd_get_device (&freebsd_biosdev, &unit, &slice, &part); freebsd_zfsguid = 0; if (!is_64bit) freebsd_get_zfs (); - grub_print_error (); + VasEBoot_print_error (); freebsd_bootdev = (FREEBSD_B_DEVMAGIC + ((slice + 1) << FREEBSD_B_SLICESHIFT) + (unit << FREEBSD_B_UNITSHIFT) + (part << FREEBSD_B_PARTSHIFT)); - grub_loader_set (grub_freebsd_boot, grub_bsd_unload, 0); + VasEBoot_loader_set (VasEBoot_freebsd_boot, VasEBoot_bsd_unload, 0); } - return grub_errno; + return VasEBoot_errno; } static const char *types[] = { @@ -1585,13 +1585,13 @@ static const char *types[] = { [17] = "rd" }; -static grub_err_t -grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) +static VasEBoot_err_t +VasEBoot_cmd_openbsd (VasEBoot_extcmd_context_t ctxt, int argc, char *argv[]) { - grub_uint32_t bootdev; + VasEBoot_uint32_t bootdev; kernel_type = KERNEL_TYPE_OPENBSD; - bootflags = grub_bsd_parse_flags (ctxt->state, openbsd_flags); + bootflags = VasEBoot_bsd_parse_flags (ctxt->state, openbsd_flags); if (ctxt->state[OPENBSD_ROOT_ARG].set) { @@ -1599,19 +1599,19 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) unsigned type, unit, part; for (type = 0; type < ARRAY_SIZE (types); type++) if (types[type] - && grub_strncmp (arg, types[type], - grub_strlen (types[type])) == 0) + && VasEBoot_strncmp (arg, types[type], + VasEBoot_strlen (types[type])) == 0) { - arg += grub_strlen (types[type]); + arg += VasEBoot_strlen (types[type]); break; } if (type == ARRAY_SIZE (types)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unknown disk type name"); - unit = grub_strtoul (arg, (char **) &arg, 10); + unit = VasEBoot_strtoul (arg, (char **) &arg, 10); if (! (arg && *arg >= 'a' && *arg <= 'z')) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only device specifications of form " " are supported"); @@ -1626,192 +1626,192 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) if (ctxt->state[OPENBSD_SERIAL_ARG].set) { - struct grub_openbsd_bootarg_console serial; + struct VasEBoot_openbsd_bootarg_console serial; char *ptr; unsigned port = 0; unsigned speed = 9600; - grub_memset (&serial, 0, sizeof (serial)); + VasEBoot_memset (&serial, 0, sizeof (serial)); if (ctxt->state[OPENBSD_SERIAL_ARG].arg) { ptr = ctxt->state[OPENBSD_SERIAL_ARG].arg; - if (grub_memcmp (ptr, "com", sizeof ("com") - 1) != 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (VasEBoot_memcmp (ptr, "com", sizeof ("com") - 1) != 0) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only com0-com3 are supported"); ptr += sizeof ("com") - 1; - port = grub_strtoul (ptr, &ptr, 0); + port = VasEBoot_strtoul (ptr, &ptr, 0); if (port >= 4) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only com0-com3 are supported"); if (*ptr == ',') { ptr++; - speed = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + speed = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; } } - serial.device = (GRUB_OPENBSD_COM_MAJOR << 8) | port; + serial.device = (VasEBoot_OPENBSD_COM_MAJOR << 8) | port; serial.speed = speed; - serial.addr = grub_ns8250_hw_get_port (port); + serial.addr = VasEBoot_ns8250_hw_get_port (port); - grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial)); + VasEBoot_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial)); bootflags |= OPENBSD_RB_SERCONS; } else { - struct grub_openbsd_bootarg_console serial; + struct VasEBoot_openbsd_bootarg_console serial; - grub_memset (&serial, 0, sizeof (serial)); - serial.device = (GRUB_OPENBSD_VGA_MAJOR << 8); + VasEBoot_memset (&serial, 0, sizeof (serial)); + serial.device = (VasEBoot_OPENBSD_VGA_MAJOR << 8); serial.addr = 0xffffffff; - grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial)); + VasEBoot_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial)); bootflags &= ~OPENBSD_RB_SERCONS; } - if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) + if (VasEBoot_bsd_load (argc, argv) == VasEBoot_ERR_NONE) { - grub_loader_set (grub_openbsd_boot, grub_bsd_unload, 0); + VasEBoot_loader_set (VasEBoot_openbsd_boot, VasEBoot_bsd_unload, 0); openbsd_root = bootdev; } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_netbsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) +static VasEBoot_err_t +VasEBoot_cmd_netbsd (VasEBoot_extcmd_context_t ctxt, int argc, char *argv[]) { - grub_err_t err; + VasEBoot_err_t err; kernel_type = KERNEL_TYPE_NETBSD; - bootflags = grub_bsd_parse_flags (ctxt->state, netbsd_flags); + bootflags = VasEBoot_bsd_parse_flags (ctxt->state, netbsd_flags); - if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) + if (VasEBoot_bsd_load (argc, argv) == VasEBoot_ERR_NONE) { if (is_elf_kernel) { - grub_file_t file; + VasEBoot_file_t file; - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; if (is_64bit) - err = grub_netbsd_load_elf_meta64 (relocator, file, argv[0], &kern_end); + err = VasEBoot_netbsd_load_elf_meta64 (relocator, file, argv[0], &kern_end); else - err = grub_netbsd_load_elf_meta32 (relocator, file, argv[0], &kern_end); + err = VasEBoot_netbsd_load_elf_meta32 (relocator, file, argv[0], &kern_end); if (err) return err; } { - char bootpath[GRUB_NETBSD_MAX_BOOTPATH_LEN]; + char bootpath[VasEBoot_NETBSD_MAX_BOOTPATH_LEN]; char *name; - name = grub_strrchr (argv[0], '/'); + name = VasEBoot_strrchr (argv[0], '/'); if (name) name++; else name = argv[0]; - grub_memset (bootpath, 0, sizeof (bootpath)); - grub_strncpy (bootpath, name, sizeof (bootpath) - 1); - grub_bsd_add_meta (NETBSD_BTINFO_BOOTPATH, bootpath, sizeof (bootpath)); + VasEBoot_memset (bootpath, 0, sizeof (bootpath)); + VasEBoot_strncpy (bootpath, name, sizeof (bootpath) - 1); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_BOOTPATH, bootpath, sizeof (bootpath)); } if (ctxt->state[NETBSD_ROOT_ARG].set) { - char root[GRUB_NETBSD_MAX_ROOTDEVICE_LEN]; - grub_memset (root, 0, sizeof (root)); - grub_strncpy (root, ctxt->state[NETBSD_ROOT_ARG].arg, + char root[VasEBoot_NETBSD_MAX_ROOTDEVICE_LEN]; + VasEBoot_memset (root, 0, sizeof (root)); + VasEBoot_strncpy (root, ctxt->state[NETBSD_ROOT_ARG].arg, sizeof (root) - 1); - grub_bsd_add_meta (NETBSD_BTINFO_ROOTDEVICE, root, sizeof (root)); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_ROOTDEVICE, root, sizeof (root)); } if (ctxt->state[NETBSD_SERIAL_ARG].set) { - struct grub_netbsd_btinfo_serial serial; + struct VasEBoot_netbsd_btinfo_serial serial; char *ptr; - grub_memset (&serial, 0, sizeof (serial)); - grub_strcpy (serial.devname, "com"); + VasEBoot_memset (&serial, 0, sizeof (serial)); + VasEBoot_strcpy (serial.devname, "com"); - serial.addr = grub_ns8250_hw_get_port (0); + serial.addr = VasEBoot_ns8250_hw_get_port (0); serial.speed = 9600; if (ctxt->state[NETBSD_SERIAL_ARG].arg) { ptr = ctxt->state[NETBSD_SERIAL_ARG].arg; - if (grub_memcmp (ptr, "com", sizeof ("com") - 1) == 0) + if (VasEBoot_memcmp (ptr, "com", sizeof ("com") - 1) == 0) { ptr += sizeof ("com") - 1; serial.addr - = grub_ns8250_hw_get_port (grub_strtoul (ptr, &ptr, 0)); + = VasEBoot_ns8250_hw_get_port (VasEBoot_strtoul (ptr, &ptr, 0)); } else - serial.addr = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + serial.addr = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr == ',') { ptr++; - serial.speed = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + serial.speed = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; } } - grub_bsd_add_meta (NETBSD_BTINFO_CONSOLE, &serial, sizeof (serial)); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_CONSOLE, &serial, sizeof (serial)); } else { - struct grub_netbsd_btinfo_serial cons; + struct VasEBoot_netbsd_btinfo_serial cons; - grub_memset (&cons, 0, sizeof (cons)); - grub_strcpy (cons.devname, "pc"); + VasEBoot_memset (&cons, 0, sizeof (cons)); + VasEBoot_strcpy (cons.devname, "pc"); - grub_bsd_add_meta (NETBSD_BTINFO_CONSOLE, &cons, sizeof (cons)); + VasEBoot_bsd_add_meta (NETBSD_BTINFO_CONSOLE, &cons, sizeof (cons)); } - grub_netbsd_add_boot_disk_and_wedge (); + VasEBoot_netbsd_add_boot_disk_and_wedge (); - grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 0); + VasEBoot_loader_set (VasEBoot_netbsd_boot, VasEBoot_bsd_unload, 0); } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_freebsd_loadenv (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; char *buf = 0, *curr, *next; int len; - if (! grub_loader_is_loaded ()) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_loader_is_loaded ()) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (kernel_type != KERNEL_TYPE_FREEBSD) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only FreeBSD supports environment"); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if ((!file) || (!file->size)) goto fail; len = file->size; - buf = grub_malloc (len + 1); + buf = VasEBoot_malloc (len + 1); if (!buf) goto fail; - if (grub_file_read (file, buf, len) != len) + if (VasEBoot_file_read (file, buf, len) != len) goto fail; buf[len] = 0; @@ -1822,7 +1822,7 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), char *p; curr = next; - next = grub_strchr (curr, '\n'); + next = VasEBoot_strchr (curr, '\n'); if (next) { @@ -1844,7 +1844,7 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), if (*curr == '#') continue; - p = grub_strchr (curr, '='); + p = VasEBoot_strchr (curr, '='); if (!p) continue; @@ -1857,63 +1857,63 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), if (*p == '"') p++; - name = grub_xasprintf ("kFreeBSD.%s", curr); + name = VasEBoot_xasprintf ("kFreeBSD.%s", curr); if (!name) goto fail; - if (grub_env_set (name, p)) + if (VasEBoot_env_set (name, p)) { - grub_free (name); + VasEBoot_free (name); goto fail; } - grub_free (name); + VasEBoot_free (name); } } fail: - grub_free (buf); + VasEBoot_free (buf); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_freebsd_module (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; int modargc; char **modargv; const char *type; - grub_err_t err; + VasEBoot_err_t err; void *src; - if (! grub_loader_is_loaded ()) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_loader_is_loaded ()) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (kernel_type != KERNEL_TYPE_FREEBSD) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no FreeBSD loaded"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no FreeBSD loaded"); if (!is_elf_kernel) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only ELF kernel supports module"); /* List the current modules if no parameter. */ if (!argc) { - grub_freebsd_list_modules (); + VasEBoot_freebsd_list_modules (); return 0; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if ((!file) || (!file->size)) goto fail; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, kern_end, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, kern_end, file->size); if (err) goto fail; @@ -1921,14 +1921,14 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), } - grub_file_read (file, src, file->size); - if (grub_errno) + VasEBoot_file_read (file, src, file->size); + if (VasEBoot_errno) goto fail; modargc = argc - 1; modargv = argv + 1; - if (modargc && (! grub_memcmp (modargv[0], "type=", 5))) + if (modargc && (! VasEBoot_memcmp (modargv[0], "type=", 5))) { type = &modargv[0][5]; modargc--; @@ -1937,7 +1937,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), else type = FREEBSD_MODTYPE_RAW; - err = grub_freebsd_add_meta_module (argv[0], type, modargc, modargv, + err = VasEBoot_freebsd_add_meta_module (argv[0], type, modargc, modargv, kern_end, file->size); if (err) goto fail; @@ -1946,25 +1946,25 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_netbsd_module_load (char *filename, grub_uint32_t type) +static VasEBoot_err_t +VasEBoot_netbsd_module_load (char *filename, VasEBoot_uint32_t type) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; void *src; - grub_err_t err; + VasEBoot_err_t err; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if ((!file) || (!file->size)) goto fail; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, kern_end, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, kern_end, file->size); if (err) goto fail; @@ -1972,11 +1972,11 @@ grub_netbsd_module_load (char *filename, grub_uint32_t type) src = get_virtual_current_address (ch); } - grub_file_read (file, src, file->size); - if (grub_errno) + VasEBoot_file_read (file, src, file->size); + if (VasEBoot_errno) goto fail; - err = grub_netbsd_add_meta_module (filename, type, kern_end, file->size); + err = VasEBoot_netbsd_add_meta_module (filename, type, kern_end, file->size); if (err) goto fail; @@ -1985,175 +1985,175 @@ grub_netbsd_module_load (char *filename, grub_uint32_t type) fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_netbsd_module (grub_command_t cmd, +static VasEBoot_err_t +VasEBoot_cmd_netbsd_module (VasEBoot_command_t cmd, int argc, char *argv[]) { - grub_uint32_t type; + VasEBoot_uint32_t type; - if (! grub_loader_is_loaded ()) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_loader_is_loaded ()) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (kernel_type != KERNEL_TYPE_NETBSD) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no NetBSD loaded"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no NetBSD loaded"); if (!is_elf_kernel) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only ELF kernel supports module"); /* List the current modules if no parameter. */ if (!argc) { - grub_netbsd_list_modules (); + VasEBoot_netbsd_list_modules (); return 0; } - if (grub_strcmp (cmd->name, "knetbsd_module_elf") == 0) - type = GRUB_NETBSD_MODULE_ELF; + if (VasEBoot_strcmp (cmd->name, "knetbsd_module_elf") == 0) + type = VasEBoot_NETBSD_MODULE_ELF; else - type = GRUB_NETBSD_MODULE_RAW; + type = VasEBoot_NETBSD_MODULE_RAW; - return grub_netbsd_module_load (argv[0], type); + return VasEBoot_netbsd_module_load (argv[0], type); } -static grub_err_t -grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_freebsd_module_elf (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_err_t err; - if (! grub_loader_is_loaded ()) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_loader_is_loaded ()) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (kernel_type != KERNEL_TYPE_FREEBSD) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only FreeBSD supports module"); if (! is_elf_kernel) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only ELF kernel supports module"); /* List the current modules if no parameter. */ if (! argc) { - grub_freebsd_list_modules (); + VasEBoot_freebsd_list_modules (); return 0; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) - return grub_errno; + return VasEBoot_errno; if (!file->size) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } if (is_64bit) - err = grub_freebsd_load_elfmodule_obj64 (relocator, file, + err = VasEBoot_freebsd_load_elfmodule_obj64 (relocator, file, argc, argv, &kern_end); else - err = grub_freebsd_load_elfmodule32 (relocator, file, + err = VasEBoot_freebsd_load_elfmodule32 (relocator, file, argc, argv, &kern_end); - grub_file_close (file); + VasEBoot_file_close (file); return err; } -static grub_err_t -grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_openbsd_ramdisk (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_file_t file; - grub_size_t size; + VasEBoot_file_t file; + VasEBoot_size_t size; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (! grub_loader_is_loaded ()) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_loader_is_loaded ()) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (kernel_type != KERNEL_TYPE_OPENBSD) - return grub_error (GRUB_ERR_BAD_OS, "no kOpenBSD loaded"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "no kOpenBSD loaded"); if (!openbsd_ramdisk.max_size) - return grub_error (GRUB_ERR_BAD_OS, "your kOpenBSD doesn't support ramdisk"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "your kOpenBSD doesn't support ramdisk"); - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - size = grub_file_size (file); + size = VasEBoot_file_size (file); if (size > openbsd_ramdisk.max_size) { - grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, "your kOpenBSD supports ramdisk only" + VasEBoot_file_close (file); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "your kOpenBSD supports ramdisk only" " up to %u bytes, however you supplied a %u bytes one", openbsd_ramdisk.max_size, size); } - if (grub_file_read (file, openbsd_ramdisk.target, size) - != (grub_ssize_t) (size)) + if (VasEBoot_file_read (file, openbsd_ramdisk.target, size) + != (VasEBoot_ssize_t) (size)) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), args[0]); - return grub_errno; + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), args[0]); + return VasEBoot_errno; } - grub_memset (openbsd_ramdisk.target + size, 0, + VasEBoot_memset (openbsd_ramdisk.target + size, 0, openbsd_ramdisk.max_size - size); *openbsd_ramdisk.size = ALIGN_UP (size, 512); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd_freebsd, cmd_openbsd, cmd_netbsd; -static grub_command_t cmd_freebsd_loadenv, cmd_freebsd_module; -static grub_command_t cmd_netbsd_module, cmd_freebsd_module_elf; -static grub_command_t cmd_netbsd_module_elf, cmd_openbsd_ramdisk; +static VasEBoot_extcmd_t cmd_freebsd, cmd_openbsd, cmd_netbsd; +static VasEBoot_command_t cmd_freebsd_loadenv, cmd_freebsd_module; +static VasEBoot_command_t cmd_netbsd_module, cmd_freebsd_module_elf; +static VasEBoot_command_t cmd_netbsd_module_elf, cmd_openbsd_ramdisk; -GRUB_MOD_INIT (bsd) +VasEBoot_MOD_INIT (bsd) { /* Net and OpenBSD kernels are often compressed. */ - grub_dl_load ("gzio"); + VasEBoot_dl_load ("gzio"); - cmd_freebsd = grub_register_extcmd ("kfreebsd", grub_cmd_freebsd, 0, + cmd_freebsd = VasEBoot_register_extcmd ("kfreebsd", VasEBoot_cmd_freebsd, 0, N_("FILE"), N_("Load kernel of FreeBSD."), freebsd_opts); - cmd_openbsd = grub_register_extcmd ("kopenbsd", grub_cmd_openbsd, 0, + cmd_openbsd = VasEBoot_register_extcmd ("kopenbsd", VasEBoot_cmd_openbsd, 0, N_("FILE"), N_("Load kernel of OpenBSD."), openbsd_opts); - cmd_netbsd = grub_register_extcmd ("knetbsd", grub_cmd_netbsd, 0, + cmd_netbsd = VasEBoot_register_extcmd ("knetbsd", VasEBoot_cmd_netbsd, 0, N_("FILE"), N_("Load kernel of NetBSD."), netbsd_opts); cmd_freebsd_loadenv = - grub_register_command ("kfreebsd_loadenv", grub_cmd_freebsd_loadenv, + VasEBoot_register_command ("kfreebsd_loadenv", VasEBoot_cmd_freebsd_loadenv, 0, N_("Load FreeBSD env.")); cmd_freebsd_module = - grub_register_command ("kfreebsd_module", grub_cmd_freebsd_module, + VasEBoot_register_command ("kfreebsd_module", VasEBoot_cmd_freebsd_module, 0, N_("Load FreeBSD kernel module.")); cmd_netbsd_module = - grub_register_command ("knetbsd_module", grub_cmd_netbsd_module, + VasEBoot_register_command ("knetbsd_module", VasEBoot_cmd_netbsd_module, 0, N_("Load NetBSD kernel module.")); cmd_netbsd_module_elf = - grub_register_command ("knetbsd_module_elf", grub_cmd_netbsd_module, + VasEBoot_register_command ("knetbsd_module_elf", VasEBoot_cmd_netbsd_module, 0, N_("Load NetBSD kernel module (ELF).")); cmd_freebsd_module_elf = - grub_register_command ("kfreebsd_module_elf", grub_cmd_freebsd_module_elf, + VasEBoot_register_command ("kfreebsd_module_elf", VasEBoot_cmd_freebsd_module_elf, 0, N_("Load FreeBSD kernel module (ELF).")); - cmd_openbsd_ramdisk = grub_register_command ("kopenbsd_ramdisk", - grub_cmd_openbsd_ramdisk, 0, + cmd_openbsd_ramdisk = VasEBoot_register_command ("kopenbsd_ramdisk", + VasEBoot_cmd_openbsd_ramdisk, 0, /* TRANSLATORS: ramdisk isn't identifier, it can be translated. */ N_("Load kOpenBSD ramdisk.")); @@ -2161,18 +2161,18 @@ GRUB_MOD_INIT (bsd) my_mod = mod; } -GRUB_MOD_FINI (bsd) +VasEBoot_MOD_FINI (bsd) { - grub_unregister_extcmd (cmd_freebsd); - grub_unregister_extcmd (cmd_openbsd); - grub_unregister_extcmd (cmd_netbsd); + VasEBoot_unregister_extcmd (cmd_freebsd); + VasEBoot_unregister_extcmd (cmd_openbsd); + VasEBoot_unregister_extcmd (cmd_netbsd); - grub_unregister_command (cmd_freebsd_loadenv); - grub_unregister_command (cmd_freebsd_module); - grub_unregister_command (cmd_netbsd_module); - grub_unregister_command (cmd_freebsd_module_elf); - grub_unregister_command (cmd_netbsd_module_elf); - grub_unregister_command (cmd_openbsd_ramdisk); + VasEBoot_unregister_command (cmd_freebsd_loadenv); + VasEBoot_unregister_command (cmd_freebsd_module); + VasEBoot_unregister_command (cmd_netbsd_module); + VasEBoot_unregister_command (cmd_freebsd_module_elf); + VasEBoot_unregister_command (cmd_netbsd_module_elf); + VasEBoot_unregister_command (cmd_openbsd_ramdisk); - grub_bsd_unload (); + VasEBoot_bsd_unload (); } diff --git a/VasEBoot-core/loader/i386/bsd32.c b/VasEBoot-core/loader/i386/bsd32.c index 26704c486..64e337f68 100644 --- a/VasEBoot-core/loader/i386/bsd32.c +++ b/VasEBoot-core/loader/i386/bsd32.c @@ -1,6 +1,6 @@ #define SUFFIX(x) x ## 32 -#define GRUB_TARGET_WORDSIZE 32 +#define VasEBoot_TARGET_WORDSIZE 32 #define OBJSYM 0 -#include -typedef grub_uint32_t grub_freebsd_addr_t; +#include +typedef VasEBoot_uint32_t VasEBoot_freebsd_addr_t; #include "bsdXX.c" diff --git a/VasEBoot-core/loader/i386/bsd64.c b/VasEBoot-core/loader/i386/bsd64.c index f8aad1ca7..c219441dc 100644 --- a/VasEBoot-core/loader/i386/bsd64.c +++ b/VasEBoot-core/loader/i386/bsd64.c @@ -1,6 +1,6 @@ #define SUFFIX(x) x ## 64 -#define GRUB_TARGET_WORDSIZE 64 +#define VasEBoot_TARGET_WORDSIZE 64 #define OBJSYM 1 -#include -typedef grub_uint64_t grub_freebsd_addr_t; +#include +typedef VasEBoot_uint64_t VasEBoot_freebsd_addr_t; #include "bsdXX.c" diff --git a/VasEBoot-core/loader/i386/bsdXX.c b/VasEBoot-core/loader/i386/bsdXX.c index af6741d15..49e05f1be 100644 --- a/VasEBoot-core/loader/i386/bsdXX.c +++ b/VasEBoot-core/loader/i386/bsdXX.c @@ -1,39 +1,39 @@ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define ALIGN_PAGE(a) ALIGN_UP (a, 4096) -static inline grub_err_t -load (grub_file_t file, const char *filename, void *where, grub_off_t off, grub_size_t size) +static inline VasEBoot_err_t +load (VasEBoot_file_t file, const char *filename, void *where, VasEBoot_off_t off, VasEBoot_size_t size) { - if (grub_file_seek (file, off) == (grub_off_t) -1) - return grub_errno; - if (grub_file_read (file, where, size) != (grub_ssize_t) size) + if (VasEBoot_file_seek (file, off) == (VasEBoot_off_t) -1) + return VasEBoot_errno; + if (VasEBoot_file_read (file, where, size) != (VasEBoot_ssize_t) size) { - if (grub_errno) - return grub_errno; - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (VasEBoot_errno) + return VasEBoot_errno; + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -read_headers (grub_file_t file, const char *filename, Elf_Ehdr *e, char **shdr) +static inline VasEBoot_err_t +read_headers (VasEBoot_file_t file, const char *filename, Elf_Ehdr *e, char **shdr) { - if (grub_file_seek (file, 0) == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (file, 0) == (VasEBoot_off_t) -1) + return VasEBoot_errno; - if (grub_file_read (file, (char *) e, sizeof (*e)) != sizeof (*e)) + if (VasEBoot_file_read (file, (char *) e, sizeof (*e)) != sizeof (*e)) { - if (grub_errno) - return grub_errno; - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (VasEBoot_errno) + return VasEBoot_errno; + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); } @@ -43,45 +43,45 @@ read_headers (grub_file_t file, const char *filename, Elf_Ehdr *e, char **shdr) || e->e_ident[EI_MAG3] != ELFMAG3 || e->e_ident[EI_VERSION] != EV_CURRENT || e->e_version != EV_CURRENT) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-independent ELF magic")); if (e->e_ident[EI_CLASS] != SUFFIX (ELFCLASS)) - return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - *shdr = grub_malloc ((grub_uint32_t) e->e_shnum * e->e_shentsize); + *shdr = VasEBoot_malloc ((VasEBoot_uint32_t) e->e_shnum * e->e_shentsize); if (! *shdr) - return grub_errno; + return VasEBoot_errno; - if (grub_file_seek (file, e->e_shoff) == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (file, e->e_shoff) == (VasEBoot_off_t) -1) + return VasEBoot_errno; - if (grub_file_read (file, *shdr, (grub_uint32_t) e->e_shnum * e->e_shentsize) - != (grub_ssize_t) ((grub_uint32_t) e->e_shnum * e->e_shentsize)) + if (VasEBoot_file_read (file, *shdr, (VasEBoot_uint32_t) e->e_shnum * e->e_shentsize) + != (VasEBoot_ssize_t) ((VasEBoot_uint32_t) e->e_shnum * e->e_shentsize)) { - if (grub_errno) - return grub_errno; - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (VasEBoot_errno) + return VasEBoot_errno; + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* On i386 FreeBSD uses "elf module" approarch for 32-bit variant and "elf obj module" for 64-bit variant. However it may differ on other platforms. So I keep both versions. */ #if OBJSYM -grub_err_t -SUFFIX (grub_freebsd_load_elfmodule_obj) (struct grub_relocator *relocator, - grub_file_t file, int argc, - char *argv[], grub_addr_t *kern_end) +VasEBoot_err_t +SUFFIX (VasEBoot_freebsd_load_elfmodule_obj) (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, int argc, + char *argv[], VasEBoot_addr_t *kern_end) { Elf_Ehdr e; Elf_Shdr *s; char *shdr = 0; - grub_addr_t curload, module; - grub_err_t err; - grub_size_t chunk_size = 0; + VasEBoot_addr_t curload, module; + VasEBoot_err_t err; + VasEBoot_size_t chunk_size = 0; void *chunk_src; curload = module = ALIGN_PAGE (*kern_end); @@ -105,8 +105,8 @@ SUFFIX (grub_freebsd_load_elfmodule_obj) (struct grub_relocator *relocator, } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, module, chunk_size); if (err) goto out; @@ -124,7 +124,7 @@ SUFFIX (grub_freebsd_load_elfmodule_obj) (struct grub_relocator *relocator, curload = ALIGN_UP (curload, s->sh_addralign); s->sh_addr = curload; - grub_dprintf ("bsd", "loading section to %x, size %d, align %d\n", + VasEBoot_dprintf ("bsd", "loading section to %x, size %d, align %d\n", (unsigned) curload, (int) s->sh_size, (int) s->sh_addralign); @@ -132,13 +132,13 @@ SUFFIX (grub_freebsd_load_elfmodule_obj) (struct grub_relocator *relocator, { default: case SHT_PROGBITS: - err = load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, + err = load (file, argv[0], (VasEBoot_uint8_t *) chunk_src + curload - *kern_end, s->sh_offset, s->sh_size); if (err) goto out; break; case SHT_NOBITS: - grub_memset ((grub_uint8_t *) chunk_src + curload - *kern_end, 0, + VasEBoot_memset ((VasEBoot_uint8_t *) chunk_src + curload - *kern_end, 0, s->sh_size); break; } @@ -147,36 +147,36 @@ SUFFIX (grub_freebsd_load_elfmodule_obj) (struct grub_relocator *relocator, *kern_end = ALIGN_PAGE (curload); - err = grub_freebsd_add_meta_module (argv[0], FREEBSD_MODTYPE_ELF_MODULE_OBJ, + err = VasEBoot_freebsd_add_meta_module (argv[0], FREEBSD_MODTYPE_ELF_MODULE_OBJ, argc - 1, argv + 1, module, curload - module); if (! err) - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_ELFHDR, &e, sizeof (e)); if (! err) - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_SHDR, shdr, e.e_shnum * e.e_shentsize); out: - grub_free (shdr); + VasEBoot_free (shdr); return err; } #else -grub_err_t -SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, - grub_file_t file, int argc, char *argv[], - grub_addr_t *kern_end) +VasEBoot_err_t +SUFFIX (VasEBoot_freebsd_load_elfmodule) (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, int argc, char *argv[], + VasEBoot_addr_t *kern_end) { Elf_Ehdr e; Elf_Shdr *s; char *shdr = 0; - grub_addr_t curload, module; - grub_err_t err; - grub_size_t chunk_size = 0; + VasEBoot_addr_t curload, module; + VasEBoot_err_t err; + VasEBoot_size_t chunk_size = 0; void *chunk_src; curload = module = ALIGN_PAGE (*kern_end); @@ -200,13 +200,13 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, if (chunk_size < sizeof (e)) chunk_size = sizeof (e); - chunk_size += (grub_uint32_t) e.e_phnum * e.e_phentsize; - chunk_size += (grub_uint32_t) e.e_shnum * e.e_shentsize; + chunk_size += (VasEBoot_uint32_t) e.e_phnum * e.e_phentsize; + chunk_size += (VasEBoot_uint32_t) e.e_shnum * e.e_shentsize; { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, module, chunk_size); if (err) goto out; @@ -224,7 +224,7 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, if (! (s->sh_flags & SHF_ALLOC)) continue; - grub_dprintf ("bsd", "loading section to %x, size %d, align %d\n", + VasEBoot_dprintf ("bsd", "loading section to %x, size %d, align %d\n", (unsigned) curload, (int) s->sh_size, (int) s->sh_addralign); @@ -233,14 +233,14 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, default: case SHT_PROGBITS: err = load (file, argv[0], - (grub_uint8_t *) chunk_src + module + (VasEBoot_uint8_t *) chunk_src + module + s->sh_addr - *kern_end, s->sh_offset, s->sh_size); if (err) goto out; break; case SHT_NOBITS: - grub_memset ((grub_uint8_t *) chunk_src + module + VasEBoot_memset ((VasEBoot_uint8_t *) chunk_src + module + s->sh_addr - *kern_end, 0, s->sh_size); break; } @@ -248,59 +248,59 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, curload = module + s->sh_addr + s->sh_size; } - load (file, argv[0], (grub_uint8_t *) chunk_src + module - *kern_end, 0, sizeof (e)); + load (file, argv[0], (VasEBoot_uint8_t *) chunk_src + module - *kern_end, 0, sizeof (e)); if (curload < module + sizeof (e)) curload = module + sizeof (e); - load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_shoff, - (grub_uint32_t) e.e_shnum * e.e_shentsize); + load (file, argv[0], (VasEBoot_uint8_t *) chunk_src + curload - *kern_end, e.e_shoff, + (VasEBoot_uint32_t) e.e_shnum * e.e_shentsize); e.e_shoff = curload - module; - curload += (grub_uint32_t) e.e_shnum * e.e_shentsize; + curload += (VasEBoot_uint32_t) e.e_shnum * e.e_shentsize; - load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_phoff, - (grub_uint32_t) e.e_phnum * e.e_phentsize); + load (file, argv[0], (VasEBoot_uint8_t *) chunk_src + curload - *kern_end, e.e_phoff, + (VasEBoot_uint32_t) e.e_phnum * e.e_phentsize); e.e_phoff = curload - module; - curload += (grub_uint32_t) e.e_phnum * e.e_phentsize; + curload += (VasEBoot_uint32_t) e.e_phnum * e.e_phentsize; *kern_end = curload; - grub_freebsd_add_meta_module (argv[0], FREEBSD_MODTYPE_ELF_MODULE, + VasEBoot_freebsd_add_meta_module (argv[0], FREEBSD_MODTYPE_ELF_MODULE, argc - 1, argv + 1, module, curload - module); out: - grub_free (shdr); + VasEBoot_free (shdr); if (err) return err; - return SUFFIX (grub_freebsd_load_elf_meta) (relocator, file, argv[0], kern_end); + return SUFFIX (VasEBoot_freebsd_load_elf_meta) (relocator, file, argv[0], kern_end); } #endif -grub_err_t -SUFFIX (grub_freebsd_load_elf_meta) (struct grub_relocator *relocator, - grub_file_t file, +VasEBoot_err_t +SUFFIX (VasEBoot_freebsd_load_elf_meta) (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, const char *filename, - grub_addr_t *kern_end) + VasEBoot_addr_t *kern_end) { - grub_err_t err; + VasEBoot_err_t err; Elf_Ehdr e; Elf_Shdr *s; char *shdr = 0; unsigned symoff, stroff, symsize, strsize; - grub_freebsd_addr_t symstart, symend, symentsize, dynamic; + VasEBoot_freebsd_addr_t symstart, symend, symentsize, dynamic; Elf_Sym *sym; void *sym_chunk; - grub_uint8_t *curload; - grub_freebsd_addr_t symtarget; + VasEBoot_uint8_t *curload; + VasEBoot_freebsd_addr_t symtarget; const char *str; unsigned i; - grub_size_t chunk_size; + VasEBoot_size_t chunk_size; err = read_headers (file, filename, &e, &shdr); if (err) goto out; - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_ELFHDR, &e, sizeof (e)); if (err) @@ -314,7 +314,7 @@ SUFFIX (grub_freebsd_load_elf_meta) (struct grub_relocator *relocator, if (s >= (Elf_Shdr *) ((char *) shdr + e.e_shnum * e.e_shentsize)) { - err = grub_error (GRUB_ERR_BAD_OS, N_("no symbol table")); + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("no symbol table")); goto out; } symoff = s->sh_offset; @@ -324,14 +324,14 @@ SUFFIX (grub_freebsd_load_elf_meta) (struct grub_relocator *relocator, stroff = s->sh_offset; strsize = s->sh_size; - chunk_size = ALIGN_UP (symsize + strsize, sizeof (grub_freebsd_addr_t)) - + 2 * sizeof (grub_freebsd_addr_t); + chunk_size = ALIGN_UP (symsize + strsize, sizeof (VasEBoot_freebsd_addr_t)) + + 2 * sizeof (VasEBoot_freebsd_addr_t); - symtarget = ALIGN_UP (*kern_end, sizeof (grub_freebsd_addr_t)); + symtarget = ALIGN_UP (*kern_end, sizeof (VasEBoot_freebsd_addr_t)); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, symtarget, chunk_size); if (err) goto out; @@ -342,41 +342,41 @@ SUFFIX (grub_freebsd_load_elf_meta) (struct grub_relocator *relocator, symend = symstart + chunk_size; curload = sym_chunk; - *((grub_freebsd_addr_t *) curload) = symsize; - curload += sizeof (grub_freebsd_addr_t); + *((VasEBoot_freebsd_addr_t *) curload) = symsize; + curload += sizeof (VasEBoot_freebsd_addr_t); - if (grub_file_seek (file, symoff) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, symoff) == (VasEBoot_off_t) -1) { - err = grub_errno; + err = VasEBoot_errno; goto out; } sym = (Elf_Sym *) curload; - if (grub_file_read (file, curload, symsize) != (grub_ssize_t) symsize) + if (VasEBoot_file_read (file, curload, symsize) != (VasEBoot_ssize_t) symsize) { - if (! grub_errno) - err = grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (! VasEBoot_errno) + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); else - err = grub_errno; + err = VasEBoot_errno; goto out; } curload += symsize; - *((grub_freebsd_addr_t *) curload) = strsize; - curload += sizeof (grub_freebsd_addr_t); - if (grub_file_seek (file, stroff) == (grub_off_t) -1) + *((VasEBoot_freebsd_addr_t *) curload) = strsize; + curload += sizeof (VasEBoot_freebsd_addr_t); + if (VasEBoot_file_seek (file, stroff) == (VasEBoot_off_t) -1) { - err = grub_errno; + err = VasEBoot_errno; goto out; } str = (char *) curload; - if (grub_file_read (file, curload, strsize) != (grub_ssize_t) strsize) + if (VasEBoot_file_read (file, curload, strsize) != (VasEBoot_ssize_t) strsize) { - if (! grub_errno) - err = grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (! VasEBoot_errno) + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); else - err = grub_errno; + err = VasEBoot_errno; goto out; } @@ -385,62 +385,62 @@ SUFFIX (grub_freebsd_load_elf_meta) (struct grub_relocator *relocator, i++, sym = (Elf_Sym *) ((char *) sym + symentsize)) { const char *name = str + sym->st_name; - if (grub_strcmp (name, "_DYNAMIC") == 0) + if (VasEBoot_strcmp (name, "_DYNAMIC") == 0) break; } if (i * symentsize < symsize) { dynamic = sym->st_value; - grub_dprintf ("bsd", "dynamic = %llx\n", (unsigned long long) dynamic); - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + VasEBoot_dprintf ("bsd", "dynamic = %llx\n", (unsigned long long) dynamic); + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_DYNAMIC, &dynamic, sizeof (dynamic)); if (err) goto out; } - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_SSYM, &symstart, sizeof (symstart)); if (err) goto out; - err = grub_bsd_add_meta (FREEBSD_MODINFO_METADATA | + err = VasEBoot_bsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_ESYM, &symend, sizeof (symend)); out: - grub_free (shdr); + VasEBoot_free (shdr); if (err) return err; *kern_end = ALIGN_PAGE (symend); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, - grub_file_t file, const char *filename, - grub_addr_t *kern_end) +VasEBoot_err_t +SUFFIX (VasEBoot_netbsd_load_elf_meta) (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, const char *filename, + VasEBoot_addr_t *kern_end) { - grub_err_t err; + VasEBoot_err_t err; Elf_Ehdr e; Elf_Shdr *s, *symsh, *strsh; char *shdr = NULL; unsigned symsize, strsize; void *sym_chunk; - grub_uint8_t *curload; - grub_size_t chunk_size; + VasEBoot_uint8_t *curload; + VasEBoot_size_t chunk_size; Elf_Ehdr *e2; - struct grub_netbsd_btinfo_symtab symtab; - grub_addr_t symtarget; + struct VasEBoot_netbsd_btinfo_symtab symtab; + VasEBoot_addr_t symtarget; err = read_headers (file, filename, &e, &shdr); if (err) { - grub_free (shdr); - return grub_errno; + VasEBoot_free (shdr); + return VasEBoot_errno; } for (s = (Elf_Shdr *) shdr; s < (Elf_Shdr *) (shdr @@ -451,8 +451,8 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, if (s >= (Elf_Shdr *) ((char *) shdr + e.e_shnum * e.e_shentsize)) { - grub_free (shdr); - return GRUB_ERR_NONE; + VasEBoot_free (shdr); + return VasEBoot_ERR_NONE; } symsize = s->sh_size; symsh = s; @@ -460,14 +460,14 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, strsize = s->sh_size; strsh = s; - chunk_size = ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)) - + ALIGN_UP (strsize, sizeof (grub_freebsd_addr_t)) - + sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; + chunk_size = ALIGN_UP (symsize, sizeof (VasEBoot_freebsd_addr_t)) + + ALIGN_UP (strsize, sizeof (VasEBoot_freebsd_addr_t)) + + sizeof (e) + (VasEBoot_uint32_t) e.e_shnum * e.e_shentsize; - symtarget = ALIGN_UP (*kern_end, sizeof (grub_freebsd_addr_t)); + symtarget = ALIGN_UP (*kern_end, sizeof (VasEBoot_freebsd_addr_t)); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, symtarget, chunk_size); if (err) goto out; @@ -481,7 +481,7 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, curload = sym_chunk; e2 = (Elf_Ehdr *) curload; - grub_memcpy (curload, &e, sizeof (e)); + VasEBoot_memcpy (curload, &e, sizeof (e)); e2->e_phoff = 0; e2->e_phnum = 0; e2->e_phentsize = 0; @@ -496,73 +496,73 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, { Elf_Shdr *s2; s2 = (Elf_Shdr *) curload; - grub_memcpy (curload, s, e.e_shentsize); + VasEBoot_memcpy (curload, s, e.e_shentsize); if (s == symsh) - s2->sh_offset = sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; + s2->sh_offset = sizeof (e) + (VasEBoot_uint32_t) e.e_shnum * e.e_shentsize; else if (s == strsh) - s2->sh_offset = ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)) - + sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; + s2->sh_offset = ALIGN_UP (symsize, sizeof (VasEBoot_freebsd_addr_t)) + + sizeof (e) + (VasEBoot_uint32_t) e.e_shnum * e.e_shentsize; else s2->sh_offset = 0; s2->sh_addr = s2->sh_offset; curload += e.e_shentsize; } - if (grub_file_seek (file, symsh->sh_offset) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, symsh->sh_offset) == (VasEBoot_off_t) -1) { - err = grub_errno; + err = VasEBoot_errno; goto out; } - if (grub_file_read (file, curload, symsize) != (grub_ssize_t) symsize) + if (VasEBoot_file_read (file, curload, symsize) != (VasEBoot_ssize_t) symsize) { - if (! grub_errno) - err = grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (! VasEBoot_errno) + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); else - err = grub_errno; + err = VasEBoot_errno; goto out; } - curload += ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)); + curload += ALIGN_UP (symsize, sizeof (VasEBoot_freebsd_addr_t)); - if (grub_file_seek (file, strsh->sh_offset) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, strsh->sh_offset) == (VasEBoot_off_t) -1) { - err = grub_errno; + err = VasEBoot_errno; goto out; } - if (grub_file_read (file, curload, strsize) != (grub_ssize_t) strsize) + if (VasEBoot_file_read (file, curload, strsize) != (VasEBoot_ssize_t) strsize) { - if (! grub_errno) - err = grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (! VasEBoot_errno) + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); else - err = grub_errno; + err = VasEBoot_errno; goto out; } - err = grub_bsd_add_meta (NETBSD_BTINFO_SYMTAB, + err = VasEBoot_bsd_add_meta (NETBSD_BTINFO_SYMTAB, &symtab, sizeof (symtab)); out: - grub_free (shdr); + VasEBoot_free (shdr); if (err) return err; *kern_end = ALIGN_PAGE (symtarget + chunk_size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -SUFFIX(grub_openbsd_find_ramdisk) (grub_file_t file, +VasEBoot_err_t +SUFFIX(VasEBoot_openbsd_find_ramdisk) (VasEBoot_file_t file, const char *filename, - grub_addr_t kern_start, + VasEBoot_addr_t kern_start, void *kern_chunk_src, - struct grub_openbsd_ramdisk_descriptor *desc) + struct VasEBoot_openbsd_ramdisk_descriptor *desc) { unsigned symoff, stroff, symsize, strsize, symentsize; { - grub_err_t err; + VasEBoot_err_t err; Elf_Ehdr e; Elf_Shdr *s; char *shdr = NULL; @@ -570,7 +570,7 @@ SUFFIX(grub_openbsd_find_ramdisk) (grub_file_t file, err = read_headers (file, filename, &e, &shdr); if (err) { - grub_free (shdr); + VasEBoot_free (shdr); return err; } @@ -581,8 +581,8 @@ SUFFIX(grub_openbsd_find_ramdisk) (grub_file_t file, break; if (s >= (Elf_Shdr *) ((char *) shdr + e.e_shnum * e.e_shentsize)) { - grub_free (shdr); - return GRUB_ERR_NONE; + VasEBoot_free (shdr); + return VasEBoot_ERR_NONE; } symsize = s->sh_size; @@ -592,52 +592,52 @@ SUFFIX(grub_openbsd_find_ramdisk) (grub_file_t file, s = (Elf_Shdr *) (shdr + e.e_shentsize * s->sh_link); stroff = s->sh_offset; strsize = s->sh_size; - grub_free (shdr); + VasEBoot_free (shdr); } { Elf_Sym *syms, *sym, *imagesym = NULL, *sizesym = NULL; unsigned i; char *strs; - syms = grub_malloc (symsize); + syms = VasEBoot_malloc (symsize); if (!syms) - return grub_errno; + return VasEBoot_errno; - if (grub_file_seek (file, symoff) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, symoff) == (VasEBoot_off_t) -1) { - grub_free (syms); - return grub_errno; + VasEBoot_free (syms); + return VasEBoot_errno; } - if (grub_file_read (file, syms, symsize) != (grub_ssize_t) symsize) + if (VasEBoot_file_read (file, syms, symsize) != (VasEBoot_ssize_t) symsize) { - grub_free (syms); - if (! grub_errno) - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_free (syms); + if (! VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } - strs = grub_malloc (strsize); + strs = VasEBoot_malloc (strsize); if (!strs) { - grub_free (syms); - return grub_errno; + VasEBoot_free (syms); + return VasEBoot_errno; } - if (grub_file_seek (file, stroff) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, stroff) == (VasEBoot_off_t) -1) { - grub_free (syms); - grub_free (strs); - return grub_errno; + VasEBoot_free (syms); + VasEBoot_free (strs); + return VasEBoot_errno; } - if (grub_file_read (file, strs, strsize) != (grub_ssize_t) strsize) + if (VasEBoot_file_read (file, strs, strsize) != (VasEBoot_ssize_t) strsize) { - grub_free (syms); - grub_free (strs); - if (! grub_errno) - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_free (syms); + VasEBoot_free (strs); + if (! VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } for (i = 0, sym = syms; i * symentsize < symsize; @@ -647,33 +647,33 @@ SUFFIX(grub_openbsd_find_ramdisk) (grub_file_t file, continue; if (!sym->st_name) continue; - if (grub_strcmp (strs + sym->st_name, "rd_root_image") == 0) + if (VasEBoot_strcmp (strs + sym->st_name, "rd_root_image") == 0) imagesym = sym; - if (grub_strcmp (strs + sym->st_name, "rd_root_size") == 0) + if (VasEBoot_strcmp (strs + sym->st_name, "rd_root_size") == 0) sizesym = sym; if (imagesym && sizesym) break; } if (!imagesym || !sizesym) { - grub_free (syms); - grub_free (strs); - return GRUB_ERR_NONE; + VasEBoot_free (syms); + VasEBoot_free (strs); + return VasEBoot_ERR_NONE; } if (sizeof (*desc->size) != sizesym->st_size) { - grub_free (syms); - grub_free (strs); - return grub_error (GRUB_ERR_BAD_OS, "unexpected size of rd_root_size"); + VasEBoot_free (syms); + VasEBoot_free (strs); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "unexpected size of rd_root_size"); } desc->max_size = imagesym->st_size; desc->target = (imagesym->st_value & 0xFFFFFF) - kern_start - + (grub_uint8_t *) kern_chunk_src; - desc->size = (grub_uint32_t *) ((sizesym->st_value & 0xFFFFFF) - kern_start - + (grub_uint8_t *) kern_chunk_src); - grub_free (syms); - grub_free (strs); + + (VasEBoot_uint8_t *) kern_chunk_src; + desc->size = (VasEBoot_uint32_t *) ((sizesym->st_value & 0xFFFFFF) - kern_start + + (VasEBoot_uint8_t *) kern_chunk_src); + VasEBoot_free (syms); + VasEBoot_free (strs); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } diff --git a/VasEBoot-core/loader/i386/bsd_pagetable.c b/VasEBoot-core/loader/i386/bsd_pagetable.c index 9ec5abffc..9b39507d7 100644 --- a/VasEBoot-core/loader/i386/bsd_pagetable.c +++ b/VasEBoot-core/loader/i386/bsd_pagetable.c @@ -1,20 +1,20 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1998 Michael Smith * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Based on the code from FreeBSD originally distributed under the @@ -50,10 +50,10 @@ static void -fill_bsd64_pagetable (grub_uint8_t *src, grub_addr_t target) +fill_bsd64_pagetable (VasEBoot_uint8_t *src, VasEBoot_addr_t target) { - grub_uint64_t *pt2, *pt3, *pt4; - grub_addr_t pt2t, pt3t; + VasEBoot_uint64_t *pt2, *pt3, *pt4; + VasEBoot_addr_t pt2t, pt3t; int i; #define PG_V 0x001 @@ -61,14 +61,14 @@ fill_bsd64_pagetable (grub_uint8_t *src, grub_addr_t target) #define PG_U 0x004 #define PG_PS 0x080 - pt4 = (grub_uint64_t *) src; - pt3 = (grub_uint64_t *) (src + 4096); - pt2 = (grub_uint64_t *) (src + 8192); + pt4 = (VasEBoot_uint64_t *) src; + pt3 = (VasEBoot_uint64_t *) (src + 4096); + pt2 = (VasEBoot_uint64_t *) (src + 8192); pt3t = target + 4096; pt2t = target + 8192; - grub_memset (src, 0, 4096 * 3); + VasEBoot_memset (src, 0, 4096 * 3); /* * This is kinda brutal, but every single 1GB VM memory segment points to @@ -78,11 +78,11 @@ fill_bsd64_pagetable (grub_uint8_t *src, grub_addr_t target) for (i = 0; i < 512; i++) { /* Each slot of the level 4 pages points to the same level 3 page */ - pt4[i] = (grub_addr_t) pt3t; + pt4[i] = (VasEBoot_addr_t) pt3t; pt4[i] |= PG_V | PG_RW | PG_U; /* Each slot of the level 3 pages points to the same level 2 page */ - pt3[i] = (grub_addr_t) pt2t; + pt3[i] = (VasEBoot_addr_t) pt2t; pt3[i] |= PG_V | PG_RW | PG_U; /* The level 2 page slots are mapped with 2MB pages for 1GB. */ diff --git a/VasEBoot-core/loader/i386/coreboot/chainloader.c b/VasEBoot-core/loader/i386/coreboot/chainloader.c index 2cb78eee0..b2eed7a56 100644 --- a/VasEBoot-core/loader/i386/coreboot/chainloader.c +++ b/VasEBoot-core/loader/i386/coreboot/chainloader.c @@ -1,182 +1,182 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_addr_t entry; -static struct grub_relocator *relocator = NULL; +static VasEBoot_addr_t entry; +static struct VasEBoot_relocator *relocator = NULL; -static grub_err_t -grub_chain_boot (void) +static VasEBoot_err_t +VasEBoot_chain_boot (void) { - struct grub_relocator32_state state; + struct VasEBoot_relocator32_state state; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); state.eip = entry; - return grub_relocator32_boot (relocator, state, 0); + return VasEBoot_relocator32_boot (relocator, state, 0); } -static grub_err_t -grub_chain_unload (void) +static VasEBoot_err_t +VasEBoot_chain_unload (void) { - grub_relocator_unload (relocator); + VasEBoot_relocator_unload (relocator); relocator = NULL; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -load_elf (grub_file_t file, const char *filename) +static VasEBoot_err_t +load_elf (VasEBoot_file_t file, const char *filename) { - grub_elf_t elf; + VasEBoot_elf_t elf; Elf32_Phdr *phdr; - grub_err_t err; + VasEBoot_err_t err; - elf = grub_elf_file (file, filename); + elf = VasEBoot_elf_file (file, filename); if (!elf) - return grub_errno; + return VasEBoot_errno; - if (!grub_elf_is_elf32 (elf)) - return grub_error (GRUB_ERR_BAD_OS, "only ELF32 can be coreboot payload"); + if (!VasEBoot_elf_is_elf32 (elf)) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "only ELF32 can be coreboot payload"); entry = elf->ehdr.ehdr32.e_entry; FOR_ELF32_PHDRS(elf, phdr) { - grub_uint8_t *load_addr; - grub_relocator_chunk_t ch; + VasEBoot_uint8_t *load_addr; + VasEBoot_relocator_chunk_t ch; if (phdr->p_type != PT_LOAD) continue; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, phdr->p_paddr, phdr->p_memsz); if (err) { elf->file = 0; - grub_elf_close (elf); + VasEBoot_elf_close (elf); return err; } load_addr = get_virtual_current_address (ch); - if (grub_file_seek (elf->file, phdr->p_offset) == (grub_off_t) -1) + if (VasEBoot_file_seek (elf->file, phdr->p_offset) == (VasEBoot_off_t) -1) { elf->file = 0; - grub_elf_close (elf); - return grub_errno; + VasEBoot_elf_close (elf); + return VasEBoot_errno; } if (phdr->p_filesz) { - grub_ssize_t read; - read = grub_file_read (elf->file, load_addr, phdr->p_filesz); - if (read != (grub_ssize_t) phdr->p_filesz) + VasEBoot_ssize_t read; + read = VasEBoot_file_read (elf->file, load_addr, phdr->p_filesz); + if (read != (VasEBoot_ssize_t) phdr->p_filesz) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), filename); elf->file = 0; - grub_elf_close (elf); - return grub_errno; + VasEBoot_elf_close (elf); + return VasEBoot_errno; } } if (phdr->p_filesz < phdr->p_memsz) - grub_memset ((load_addr + phdr->p_filesz), + VasEBoot_memset ((load_addr + phdr->p_filesz), 0, phdr->p_memsz - phdr->p_filesz); } elf->file = 0; - grub_elf_close (elf); - return GRUB_ERR_NONE; + VasEBoot_elf_close (elf); + return VasEBoot_ERR_NONE; } -static void *SzAlloc(void *p __attribute__ ((unused)), size_t size) { return grub_malloc (size); } -static void SzFree(void *p __attribute__ ((unused)), void *address) { grub_free (address); } +static void *SzAlloc(void *p __attribute__ ((unused)), size_t size) { return VasEBoot_malloc (size); } +static void SzFree(void *p __attribute__ ((unused)), void *address) { VasEBoot_free (address); } static ISzAlloc g_Alloc = { SzAlloc, SzFree }; -static grub_err_t -load_segment (grub_file_t file, const char *filename, - void *load_addr, grub_uint32_t comp, - grub_size_t *size, grub_size_t max_size) +static VasEBoot_err_t +load_segment (VasEBoot_file_t file, const char *filename, + void *load_addr, VasEBoot_uint32_t comp, + VasEBoot_size_t *size, VasEBoot_size_t max_size) { switch (comp) { - case grub_cpu_to_be32_compile_time (CBFS_COMPRESS_NONE): - if (grub_file_read (file, load_addr, *size) - != (grub_ssize_t) *size) + case VasEBoot_cpu_to_be32_compile_time (CBFS_COMPRESS_NONE): + if (VasEBoot_file_read (file, load_addr, *size) + != (VasEBoot_ssize_t) *size) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; - case grub_cpu_to_be32_compile_time (CBFS_COMPRESS_LZMA): + return VasEBoot_ERR_NONE; + case VasEBoot_cpu_to_be32_compile_time (CBFS_COMPRESS_LZMA): { - grub_uint8_t *buf; - grub_size_t outsize, insize; + VasEBoot_uint8_t *buf; + VasEBoot_size_t outsize, insize; SRes res; SizeT src_len, dst_len; ELzmaStatus status; if (*size < 13) - return grub_error (GRUB_ERR_BAD_OS, "invalid compressed chunk"); - buf = grub_malloc (*size); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid compressed chunk"); + buf = VasEBoot_malloc (*size); if (!buf) - return grub_errno; - if (grub_file_read (file, buf, *size) - != (grub_ssize_t) *size) + return VasEBoot_errno; + if (VasEBoot_file_read (file, buf, *size) + != (VasEBoot_ssize_t) *size) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), filename); - grub_free (buf); - return grub_errno; + VasEBoot_free (buf); + return VasEBoot_errno; } - outsize = grub_get_unaligned64 (buf + 5); + outsize = VasEBoot_get_unaligned64 (buf + 5); if (outsize > max_size) { - grub_free (buf); - return grub_error (GRUB_ERR_BAD_OS, "invalid compressed chunk"); + VasEBoot_free (buf); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid compressed chunk"); } insize = *size - 13; @@ -186,57 +186,57 @@ load_segment (grub_file_t file, const char *filename, buf, 5, LZMA_FINISH_END, &status, &g_Alloc); /* ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc)*/ - grub_free (buf); - grub_dprintf ("chain", "%x, %x, %x, %x\n", + VasEBoot_free (buf); + VasEBoot_dprintf ("chain", "%x, %x, %x, %x\n", insize, src_len, outsize, dst_len); if (res != SZ_OK || src_len != insize || dst_len != outsize) - return grub_error (GRUB_ERR_BAD_OS, "decompression failure %d", res); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "decompression failure %d", res); *size = outsize; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; default: - return grub_error (GRUB_ERR_BAD_OS, "unsupported compression %d", - grub_be_to_cpu32 (comp)); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "unsupported compression %d", + VasEBoot_be_to_cpu32 (comp)); } } -static grub_err_t -load_tianocore (grub_file_t file) +static VasEBoot_err_t +load_tianocore (VasEBoot_file_t file) { - grub_uint16_t header_length; - grub_uint32_t section_head; - grub_uint8_t mz[2], pe[4]; - struct grub_pe32_coff_header coff_head; + VasEBoot_uint16_t header_length; + VasEBoot_uint32_t section_head; + VasEBoot_uint8_t mz[2], pe[4]; + struct VasEBoot_pe32_coff_header coff_head; struct file_header { - grub_uint8_t unused[18]; - grub_uint8_t type; - grub_uint8_t unused2; - grub_uint8_t size[3]; - grub_uint8_t unused3; + VasEBoot_uint8_t unused[18]; + VasEBoot_uint8_t type; + VasEBoot_uint8_t unused2; + VasEBoot_uint8_t size[3]; + VasEBoot_uint8_t unused3; } file_head; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - if (grub_file_seek (file, 48) == (grub_off_t) -1 - || grub_file_read (file, &header_length, sizeof (header_length)) + if (VasEBoot_file_seek (file, 48) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (file, &header_length, sizeof (header_length)) != sizeof (header_length) - || grub_file_seek (file, header_length) == (grub_off_t) -1) + || VasEBoot_file_seek (file, header_length) == (VasEBoot_off_t) -1) goto fail; while (1) { - grub_off_t off; - if (grub_file_read (file, &file_head, sizeof (file_head)) + VasEBoot_off_t off; + if (VasEBoot_file_read (file, &file_head, sizeof (file_head)) != sizeof (file_head)) goto fail; if (file_head.type != 0xf0) break; - off = grub_get_unaligned32 (file_head.size) & 0xffffff; + off = VasEBoot_get_unaligned32 (file_head.size) & 0xffffff; if (off < sizeof (file_head)) goto fail; - if (grub_file_seek (file, grub_file_tell (file) + off - - sizeof (file_head)) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, VasEBoot_file_tell (file) + off + - sizeof (file_head)) == (VasEBoot_off_t) -1) goto fail; } @@ -245,7 +245,7 @@ load_tianocore (grub_file_t file) while (1) { - if (grub_file_read (file, §ion_head, sizeof (section_head)) + if (VasEBoot_file_read (file, §ion_head, sizeof (section_head)) != sizeof (section_head)) goto fail; if ((section_head >> 24) != 0x19) @@ -254,75 +254,75 @@ load_tianocore (grub_file_t file) if ((section_head & 0xffffff) < sizeof (section_head)) goto fail; - if (grub_file_seek (file, grub_file_tell (file) + if (VasEBoot_file_seek (file, VasEBoot_file_tell (file) + (section_head & 0xffffff) - - sizeof (section_head)) == (grub_off_t) -1) + - sizeof (section_head)) == (VasEBoot_off_t) -1) goto fail; } if ((section_head >> 24) != 0x10) goto fail; - grub_off_t exe_start = grub_file_tell (file); + VasEBoot_off_t exe_start = VasEBoot_file_tell (file); - if (grub_file_read (file, &mz, sizeof (mz)) != sizeof (mz)) + if (VasEBoot_file_read (file, &mz, sizeof (mz)) != sizeof (mz)) goto fail; if (mz[0] != 'M' || mz[1] != 'Z') goto fail; - if (grub_file_seek (file, grub_file_tell (file) + 0x3a) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, VasEBoot_file_tell (file) + 0x3a) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (file, §ion_head, sizeof (section_head)) + if (VasEBoot_file_read (file, §ion_head, sizeof (section_head)) != sizeof (section_head)) goto fail; if (section_head < 0x40) goto fail; - if (grub_file_seek (file, grub_file_tell (file) - + section_head - 0x40) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, VasEBoot_file_tell (file) + + section_head - 0x40) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (file, &pe, sizeof (pe)) + if (VasEBoot_file_read (file, &pe, sizeof (pe)) != sizeof (pe)) goto fail; if (pe[0] != 'P' || pe[1] != 'E' || pe[2] != '\0' || pe[3] != '\0') goto fail; - if (grub_file_read (file, &coff_head, sizeof (coff_head)) + if (VasEBoot_file_read (file, &coff_head, sizeof (coff_head)) != sizeof (coff_head)) goto fail; - grub_uint32_t loadaddr; + VasEBoot_uint32_t loadaddr; switch (coff_head.machine) { - case GRUB_PE32_MACHINE_I386: + case VasEBoot_PE32_MACHINE_I386: { - struct grub_pe32_optional_header oh; - if (grub_file_read (file, &oh, sizeof (oh)) + struct VasEBoot_pe32_optional_header oh; + if (VasEBoot_file_read (file, &oh, sizeof (oh)) != sizeof (oh)) goto fail; - if (oh.magic != GRUB_PE32_PE32_MAGIC) + if (oh.magic != VasEBoot_PE32_PE32_MAGIC) goto fail; loadaddr = oh.image_base - exe_start; entry = oh.image_base + oh.entry_addr; break; } - case GRUB_PE32_MACHINE_X86_64: + case VasEBoot_PE32_MACHINE_X86_64: { - struct grub_pe64_optional_header oh; - if (! grub_cpuid_has_longmode) + struct VasEBoot_pe64_optional_header oh; + if (! VasEBoot_cpuid_has_longmode) { - grub_error (GRUB_ERR_BAD_OS, "your CPU does not implement AMD64 architecture"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "your CPU does not implement AMD64 architecture"); goto fail; } - if (grub_file_read (file, &oh, sizeof (oh)) + if (VasEBoot_file_read (file, &oh, sizeof (oh)) != sizeof (oh)) goto fail; - if (oh.magic != GRUB_PE32_PE64_MAGIC) + if (oh.magic != VasEBoot_PE32_PE64_MAGIC) goto fail; loadaddr = oh.image_base - exe_start; entry = oh.image_base + oh.entry_addr; @@ -331,44 +331,44 @@ load_tianocore (grub_file_t file) default: goto fail; } - if (grub_file_seek (file, 0) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, 0) == (VasEBoot_off_t) -1) goto fail; - grub_size_t fz = grub_file_size (file); + VasEBoot_size_t fz = VasEBoot_file_size (file); - if (grub_relocator_alloc_chunk_addr (relocator, &ch, + if (VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, loadaddr, fz)) goto fail; - if (grub_file_read (file, get_virtual_current_address (ch), fz) - != (grub_ssize_t) fz) + if (VasEBoot_file_read (file, get_virtual_current_address (ch), fz) + != (VasEBoot_ssize_t) fz) goto fail; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, "fv volume is invalid"); - return grub_errno; + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, "fv volume is invalid"); + return VasEBoot_errno; } -static grub_err_t -load_chewed (grub_file_t file, const char *filename) +static VasEBoot_err_t +load_chewed (VasEBoot_file_t file, const char *filename) { - grub_size_t i; + VasEBoot_size_t i; for (i = 0;; i++) { struct cbfs_payload_segment segment; - grub_err_t err; + VasEBoot_err_t err; - if (grub_file_seek (file, sizeof (segment) * i) == (grub_off_t) -1 - || grub_file_read (file, &segment, sizeof (segment)) + if (VasEBoot_file_seek (file, sizeof (segment) * i) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (file, &segment, sizeof (segment)) != sizeof (segment)) { - if (!grub_errno) - return grub_error (GRUB_ERR_BAD_OS, + if (!VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "payload is too short"); - return grub_errno; + return VasEBoot_errno; } switch (segment.type) @@ -377,8 +377,8 @@ load_chewed (grub_file_t file, const char *filename) break; case PAYLOAD_SEGMENT_ENTRY: - entry = grub_be_to_cpu64 (segment.load_addr); - return GRUB_ERR_NONE; + entry = VasEBoot_be_to_cpu64 (segment.load_addr); + return VasEBoot_ERR_NONE; case PAYLOAD_SEGMENT_BSS: segment.len = 0; @@ -388,18 +388,18 @@ load_chewed (grub_file_t file, const char *filename) case PAYLOAD_SEGMENT_CODE: case PAYLOAD_SEGMENT_DATA: { - grub_uint32_t target = grub_be_to_cpu64 (segment.load_addr); - grub_uint32_t memsize = grub_be_to_cpu32 (segment.mem_len); - grub_uint32_t filesize = grub_be_to_cpu32 (segment.len); - grub_uint8_t *load_addr; - grub_relocator_chunk_t ch; + VasEBoot_uint32_t target = VasEBoot_be_to_cpu64 (segment.load_addr); + VasEBoot_uint32_t memsize = VasEBoot_be_to_cpu32 (segment.mem_len); + VasEBoot_uint32_t filesize = VasEBoot_be_to_cpu32 (segment.len); + VasEBoot_uint8_t *load_addr; + VasEBoot_relocator_chunk_t ch; if (memsize < filesize) memsize = filesize; - grub_dprintf ("chain", "%x+%x\n", target, memsize); + VasEBoot_dprintf ("chain", "%x+%x\n", target, memsize); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, target, memsize); if (err) return err; @@ -408,9 +408,9 @@ load_chewed (grub_file_t file, const char *filename) if (filesize) { - if (grub_file_seek (file, grub_be_to_cpu32 (segment.offset)) - == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (file, VasEBoot_be_to_cpu32 (segment.offset)) + == (VasEBoot_off_t) -1) + return VasEBoot_errno; err = load_segment (file, filename, load_addr, segment.compression, &filesize, memsize); @@ -419,47 +419,47 @@ load_chewed (grub_file_t file, const char *filename) } if (filesize < memsize) - grub_memset ((load_addr + filesize), + VasEBoot_memset ((load_addr + filesize), 0, memsize - filesize); } } } } -static grub_err_t -grub_cmd_chain (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_chain (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_err_t err; - grub_file_t file; - grub_uint32_t head; + VasEBoot_err_t err; + VasEBoot_file_t file; + VasEBoot_uint32_t head; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_loader_unset (); + VasEBoot_loader_unset (); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) - return grub_errno; + return VasEBoot_errno; - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } - if (grub_file_read (file, &head, sizeof (head)) != sizeof (head) - || grub_file_seek (file, 0) == (grub_off_t) -1) + if (VasEBoot_file_read (file, &head, sizeof (head)) != sizeof (head) + || VasEBoot_file_seek (file, 0) == (VasEBoot_off_t) -1) { - grub_file_close (file); - grub_relocator_unload (relocator); + VasEBoot_file_close (file); + VasEBoot_relocator_unload (relocator); relocator = 0; - if (!grub_errno) - return grub_error (GRUB_ERR_BAD_OS, + if (!VasEBoot_errno) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "payload is too short"); - return grub_errno; + return VasEBoot_errno; } switch (head) @@ -476,32 +476,32 @@ grub_cmd_chain (grub_command_t cmd __attribute__ ((unused)), break; default: - if (grub_file_seek (file, 40) == (grub_off_t) -1 - || grub_file_read (file, &head, sizeof (head)) != sizeof (head) - || grub_file_seek (file, 0) == (grub_off_t) -1 + if (VasEBoot_file_seek (file, 40) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (file, &head, sizeof (head)) != sizeof (head) + || VasEBoot_file_seek (file, 0) == (VasEBoot_off_t) -1 || head != 0x4856465f) - err = grub_error (GRUB_ERR_BAD_OS, "unrecognised payload type"); + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, "unrecognised payload type"); else err = load_tianocore (file); break; } - grub_file_close (file); + VasEBoot_file_close (file); if (err) { - grub_relocator_unload (relocator); + VasEBoot_relocator_unload (relocator); relocator = 0; return err; } - grub_loader_set (grub_chain_boot, grub_chain_unload, 0); - return GRUB_ERR_NONE; + VasEBoot_loader_set (VasEBoot_chain_boot, VasEBoot_chain_unload, 0); + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_chain; +static VasEBoot_command_t cmd_chain; -GRUB_MOD_INIT (chain) +VasEBoot_MOD_INIT (chain) { - cmd_chain = grub_register_command ("chainloader", grub_cmd_chain, + cmd_chain = VasEBoot_register_command ("chainloader", VasEBoot_cmd_chain, N_("FILE"), /* TRANSLATORS: "payload" is a term used by coreboot and must be translated in @@ -510,8 +510,8 @@ GRUB_MOD_INIT (chain) N_("Load another coreboot payload")); } -GRUB_MOD_FINI (chain) +VasEBoot_MOD_FINI (chain) { - grub_unregister_command (cmd_chain); - grub_chain_unload (); + VasEBoot_unregister_command (cmd_chain); + VasEBoot_chain_unload (); } diff --git a/VasEBoot-core/loader/i386/efi/linux.c b/VasEBoot-core/loader/i386/efi/linux.c index 22a3618d8..318da352c 100644 --- a/VasEBoot-core/loader/i386/efi/linux.c +++ b/VasEBoot-core/loader/i386/efi/linux.c @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; static void *kernel_mem; -static grub_uint64_t kernel_size; -static grub_uint8_t *initrd_mem; -static grub_uint32_t handover_offset; +static VasEBoot_uint64_t kernel_size; +static VasEBoot_uint8_t *initrd_mem; +static VasEBoot_uint32_t handover_offset; struct linux_kernel_params *params; static char *linux_cmdline; @@ -46,37 +46,37 @@ static char *linux_cmdline; #define SHIM_LOCK_GUID \ { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} } -struct grub_efi_shim_lock +struct VasEBoot_efi_shim_lock { - grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size); + VasEBoot_efi_status_t (*verify) (void *buffer, VasEBoot_uint32_t size); }; -typedef struct grub_efi_shim_lock grub_efi_shim_lock_t; +typedef struct VasEBoot_efi_shim_lock VasEBoot_efi_shim_lock_t; -static grub_efi_boolean_t -grub_linuxefi_secure_validate (void *data, grub_uint32_t size) +static VasEBoot_efi_boolean_t +VasEBoot_linuxefi_secure_validate (void *data, VasEBoot_uint32_t size) { - grub_efi_guid_t guid = SHIM_LOCK_GUID; - grub_efi_shim_lock_t *shim_lock; + VasEBoot_efi_guid_t guid = SHIM_LOCK_GUID; + VasEBoot_efi_shim_lock_t *shim_lock; - shim_lock = grub_efi_locate_protocol(&guid, NULL); + shim_lock = VasEBoot_efi_locate_protocol(&guid, NULL); if (!shim_lock) { - if (grub_efi_secure_boot()) + if (VasEBoot_efi_secure_boot()) return 0; else return 1; } - if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS) + if (shim_lock->verify(data, size) == VasEBoot_EFI_SUCCESS) return 1; return 0; } -typedef void(*handover_func)(void *, grub_efi_system_table_t *, struct linux_kernel_params *); +typedef void(*handover_func)(void *, VasEBoot_efi_system_table_t *, struct linux_kernel_params *); -static grub_err_t -grub_linuxefi_boot (void) +static VasEBoot_err_t +VasEBoot_linuxefi_boot (void) { handover_func hf; int offset = 0; @@ -89,90 +89,90 @@ grub_linuxefi_boot (void) asm volatile ("cli"); - hf (grub_efi_image_handle, grub_efi_system_table, params); + hf (VasEBoot_efi_image_handle, VasEBoot_efi_system_table, params); /* Not reached */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linuxefi_unload (void) +static VasEBoot_err_t +VasEBoot_linuxefi_unload (void) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; if (initrd_mem) - grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(params->ramdisk_size)); + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(params->ramdisk_size)); if (linux_cmdline) - grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(params->cmdline_size + 1)); + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(params->cmdline_size + 1)); if (kernel_mem) - grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size)); + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size)); if (params) - grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384)); - return GRUB_ERR_NONE; + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)params, BYTES_TO_PAGES(16384)); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t *files = 0; + VasEBoot_file_t *files = 0; int i, nfiles = 0; - grub_size_t size = 0; - grub_uint8_t *ptr; + VasEBoot_size_t size = 0; + VasEBoot_uint8_t *ptr; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - files = grub_zalloc (argc * sizeof (files[0])); + files = VasEBoot_zalloc (argc * sizeof (files[0])); if (!files) goto fail; for (i = 0; i < argc; i++) { - grub_file_filter_disable_compression (); - files[i] = grub_file_open (argv[i]); + VasEBoot_file_filter_disable_compression (); + files[i] = VasEBoot_file_open (argv[i]); if (! files[i]) goto fail; nfiles++; - size += ALIGN_UP (grub_file_size (files[i]), 4); + size += ALIGN_UP (VasEBoot_file_size (files[i]), 4); } - initrd_mem = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(size)); + initrd_mem = VasEBoot_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(size)); if (!initrd_mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate initrd")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("can't allocate initrd")); goto fail; } params->ramdisk_size = size; - params->ramdisk_image = (grub_uint32_t)(grub_uint64_t) initrd_mem; + params->ramdisk_image = (VasEBoot_uint32_t)(VasEBoot_uint64_t) initrd_mem; ptr = initrd_mem; for (i = 0; i < nfiles; i++) { - grub_ssize_t cursize = grub_file_size (files[i]); - if (grub_file_read (files[i], ptr, cursize) != cursize) + VasEBoot_ssize_t cursize = VasEBoot_file_size (files[i]); + if (VasEBoot_file_read (files[i], ptr, cursize) != cursize) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), argv[i]); goto fail; } - grub_tpm_measure (ptr, cursize, GRUB_BINARY_PCR, "grub_linuxefi", "Initrd"); - grub_print_error(); + VasEBoot_tpm_measure (ptr, cursize, VasEBoot_BINARY_PCR, "VasEBoot_linuxefi", "Initrd"); + VasEBoot_print_error(); ptr += cursize; - grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); + VasEBoot_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); ptr += ALIGN_UP_OVERHEAD (cursize, 4); } @@ -180,182 +180,182 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), fail: for (i = 0; i < nfiles; i++) - grub_file_close (files[i]); - grub_free (files); + VasEBoot_file_close (files[i]); + VasEBoot_free (files); - if (initrd_mem && grub_errno) - grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(size)); + if (initrd_mem && VasEBoot_errno) + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(size)); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; struct linux_kernel_header lh; - grub_ssize_t len, start, filelen; + VasEBoot_ssize_t len, start, filelen; void *kernel = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; - filelen = grub_file_size (file); + filelen = VasEBoot_file_size (file); - kernel = grub_malloc(filelen); + kernel = VasEBoot_malloc(filelen); if (!kernel) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); goto fail; } - if (grub_file_read (file, kernel, filelen) != filelen) + if (VasEBoot_file_read (file, kernel, filelen) != filelen) { - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("Can't read kernel %s"), argv[0]); + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("Can't read kernel %s"), argv[0]); goto fail; } - grub_tpm_measure (kernel, filelen, GRUB_BINARY_PCR, "grub_linuxefi", "Kernel"); - grub_print_error(); + VasEBoot_tpm_measure (kernel, filelen, VasEBoot_BINARY_PCR, "VasEBoot_linuxefi", "Kernel"); + VasEBoot_print_error(); - if (! grub_linuxefi_secure_validate (kernel, filelen)) + if (! VasEBoot_linuxefi_secure_validate (kernel, filelen)) { - grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); - grub_free (kernel); + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); + VasEBoot_free (kernel); goto fail; } - params = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(16384)); + params = VasEBoot_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(16384)); if (! params) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate kernel parameters"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate kernel parameters"); goto fail; } - grub_memset (params, 0, 16384); + VasEBoot_memset (params, 0, 16384); - grub_memcpy (&lh, kernel, sizeof (lh)); + VasEBoot_memcpy (&lh, kernel, sizeof (lh)); - if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) + if (lh.boot_flag != VasEBoot_cpu_to_le16 (0xaa55)) { - grub_error (GRUB_ERR_BAD_OS, N_("invalid magic number")); + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid magic number")); goto fail; } - if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) + if (lh.setup_sects > VasEBoot_LINUX_MAX_SETUP_SECTS) { - grub_error (GRUB_ERR_BAD_OS, N_("too many setup sectors")); + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("too many setup sectors")); goto fail; } - if (lh.version < grub_cpu_to_le16 (0x020b)) + if (lh.version < VasEBoot_cpu_to_le16 (0x020b)) { - grub_error (GRUB_ERR_BAD_OS, N_("kernel too old")); + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("kernel too old")); goto fail; } if (!lh.handover_offset) { - grub_error (GRUB_ERR_BAD_OS, N_("kernel doesn't support EFI handover")); + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("kernel doesn't support EFI handover")); goto fail; } - linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, + linux_cmdline = VasEBoot_efi_allocate_pages_max(0x3fffffff, BYTES_TO_PAGES(lh.cmdline_size + 1)); if (!linux_cmdline) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate cmdline")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("can't allocate cmdline")); goto fail; } - grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, + VasEBoot_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, linux_cmdline + sizeof (LINUX_IMAGE) - 1, lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1)); - grub_pass_verity_hash(&lh, linux_cmdline, lh.cmdline_size); - lh.cmd_line_ptr = (grub_uint32_t)(grub_uint64_t)linux_cmdline; + VasEBoot_pass_verity_hash(&lh, linux_cmdline, lh.cmdline_size); + lh.cmd_line_ptr = (VasEBoot_uint32_t)(VasEBoot_uint64_t)linux_cmdline; handover_offset = lh.handover_offset; start = (lh.setup_sects + 1) * 512; - len = grub_file_size(file) - start; + len = VasEBoot_file_size(file) - start; - kernel_mem = grub_efi_allocate_pages(lh.pref_address, + kernel_mem = VasEBoot_efi_allocate_pages(lh.pref_address, BYTES_TO_PAGES(lh.init_size)); if (!kernel_mem) - kernel_mem = grub_efi_allocate_pages_max(0x3fffffff, + kernel_mem = VasEBoot_efi_allocate_pages_max(0x3fffffff, BYTES_TO_PAGES(lh.init_size)); if (!kernel_mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate kernel")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("can't allocate kernel")); goto fail; } - grub_memcpy (kernel_mem, (char *)kernel + start, len); - grub_loader_set (grub_linuxefi_boot, grub_linuxefi_unload, 0); + VasEBoot_memcpy (kernel_mem, (char *)kernel + start, len); + VasEBoot_loader_set (VasEBoot_linuxefi_boot, VasEBoot_linuxefi_unload, 0); loaded=1; - lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem; - grub_memcpy (params, &lh, 2 * 512); + lh.code32_start = (VasEBoot_uint32_t)(VasEBoot_uint64_t) kernel_mem; + VasEBoot_memcpy (params, &lh, 2 * 512); params->type_of_loader = 0x21; fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_free (kernel); + VasEBoot_free (kernel); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; } if (linux_cmdline && !loaded) - grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(lh.cmdline_size + 1)); + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(lh.cmdline_size + 1)); if (kernel_mem && !loaded) - grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size)); + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size)); if (params && !loaded) - grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384)); + VasEBoot_efi_free_pages((VasEBoot_efi_physical_address_t)params, BYTES_TO_PAGES(16384)); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linuxefi) +VasEBoot_MOD_INIT(linuxefi) { cmd_linux = - grub_register_command ("linuxefi", grub_cmd_linux, + VasEBoot_register_command ("linuxefi", VasEBoot_cmd_linux, 0, N_("Load Linux.")); cmd_initrd = - grub_register_command ("initrdefi", grub_cmd_initrd, + VasEBoot_register_command ("initrdefi", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI(linuxefi) +VasEBoot_MOD_FINI(linuxefi) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/i386/linux.c b/VasEBoot-core/loader/i386/linux.c index 0888c68b7..e5e825589 100644 --- a/VasEBoot-core/loader/i386/linux.c +++ b/VasEBoot-core/loader/i386/linux.c @@ -1,95 +1,95 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- 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 + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#ifdef GRUB_MACHINE_PCBIOS -#include +#ifdef VasEBoot_MACHINE_PCBIOS +#include #endif -#ifdef GRUB_MACHINE_EFI -#include +#ifdef VasEBoot_MACHINE_EFI +#include #define HAS_VGA_TEXT 0 #define DEFAULT_VIDEO_MODE "auto" #define ACCEPTS_PURE_TEXT 0 -#elif defined (GRUB_MACHINE_IEEE1275) -#include +#elif defined (VasEBoot_MACHINE_IEEE1275) +#include #define HAS_VGA_TEXT 0 #define DEFAULT_VIDEO_MODE "text" #define ACCEPTS_PURE_TEXT 1 #else -#include -#include +#include +#include #define HAS_VGA_TEXT 1 #define DEFAULT_VIDEO_MODE "text" #define ACCEPTS_PURE_TEXT 1 #endif -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_size_t linux_mem_size; +static VasEBoot_size_t linux_mem_size; static int loaded; static void *prot_mode_mem; -static grub_addr_t prot_mode_target; +static VasEBoot_addr_t prot_mode_target; static void *initrd_mem; -static grub_addr_t initrd_mem_target; -static grub_size_t prot_init_space; -static struct grub_relocator *relocator = NULL; +static VasEBoot_addr_t initrd_mem_target; +static VasEBoot_size_t prot_init_space; +static struct VasEBoot_relocator *relocator = NULL; static void *efi_mmap_buf; -static grub_size_t maximal_cmdline_size; +static VasEBoot_size_t maximal_cmdline_size; static struct linux_kernel_params linux_params; static char *linux_cmdline; -#ifdef GRUB_MACHINE_EFI -static grub_efi_uintn_t efi_mmap_size; +#ifdef VasEBoot_MACHINE_EFI +static VasEBoot_efi_uintn_t efi_mmap_size; #else -static const grub_size_t efi_mmap_size = 0; +static const VasEBoot_size_t efi_mmap_size = 0; #endif /* FIXME */ #if 0 struct idt_descriptor { - grub_uint16_t limit; + VasEBoot_uint16_t limit; void *base; -} GRUB_PACKED; +} VasEBoot_PACKED; static struct idt_descriptor idt_desc = { @@ -98,19 +98,19 @@ static struct idt_descriptor idt_desc = }; #endif -static inline grub_size_t -page_align (grub_size_t size) +static inline VasEBoot_size_t +page_align (VasEBoot_size_t size) { return (size + (1 << 12) - 1) & (~((1 << 12) - 1)); } -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI /* Find the optimal number of pages for the memory map. Is it better to move this code to efi/mm.c? */ -static grub_efi_uintn_t +static VasEBoot_efi_uintn_t find_efi_mmap_size (void) { - static grub_efi_uintn_t mmap_size = 0; + static VasEBoot_efi_uintn_t mmap_size = 0; if (mmap_size != 0) return mmap_size; @@ -119,20 +119,20 @@ find_efi_mmap_size (void) while (1) { int ret; - grub_efi_memory_descriptor_t *mmap; - grub_efi_uintn_t desc_size; - grub_efi_uintn_t cur_mmap_size = mmap_size; + VasEBoot_efi_memory_descriptor_t *mmap; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_uintn_t cur_mmap_size = mmap_size; - mmap = grub_malloc (cur_mmap_size); + mmap = VasEBoot_malloc (cur_mmap_size); if (! mmap) return 0; - ret = grub_efi_get_memory_map (&cur_mmap_size, mmap, 0, &desc_size, 0); - grub_free (mmap); + ret = VasEBoot_efi_get_memory_map (&cur_mmap_size, mmap, 0, &desc_size, 0); + VasEBoot_free (mmap); if (ret < 0) { - grub_error (GRUB_ERR_IO, "cannot get memory map"); + VasEBoot_error (VasEBoot_ERR_IO, "cannot get memory map"); return 0; } else if (ret > 0) @@ -143,7 +143,7 @@ find_efi_mmap_size (void) mmap_size += (1 << 12); } - /* Increase the size a bit for safety, because GRUB allocates more on + /* Increase the size a bit for safety, because VasEBoot allocates more on later, and EFI itself may allocate more. */ mmap_size += (3 << 12); @@ -155,27 +155,27 @@ find_efi_mmap_size (void) /* Helper for find_mmap_size. */ static int -count_hook (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - grub_memory_type_t type __attribute__ ((unused)), void *data) +count_hook (VasEBoot_uint64_t addr __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { - grub_size_t *count = data; + VasEBoot_size_t *count = data; (*count)++; return 0; } /* Find the optimal number of pages for the memory map. */ -static grub_size_t +static VasEBoot_size_t find_mmap_size (void) { - grub_size_t count = 0, mmap_size; + VasEBoot_size_t count = 0, mmap_size; - grub_mmap_iterate (count_hook, &count); + VasEBoot_mmap_iterate (count_hook, &count); - mmap_size = count * sizeof (struct grub_e820_mmap); + mmap_size = count * sizeof (struct VasEBoot_e820_mmap); - /* Increase the size a bit for safety, because GRUB allocates more on + /* Increase the size a bit for safety, because VasEBoot allocates more on later. */ mmap_size += (1 << 12); @@ -185,7 +185,7 @@ find_mmap_size (void) static void free_pages (void) { - grub_relocator_unload (relocator); + VasEBoot_relocator_unload (relocator); relocator = NULL; prot_mode_mem = initrd_mem = 0; prot_mode_target = initrd_mem_target = 0; @@ -193,12 +193,12 @@ free_pages (void) /* Allocate pages for the real mode code and the protected mode code for linux as well as a memory map buffer. */ -static grub_err_t -allocate_pages (grub_size_t prot_size, grub_size_t *align, - grub_size_t min_align, int relocatable, - grub_uint64_t preferred_address) +static VasEBoot_err_t +allocate_pages (VasEBoot_size_t prot_size, VasEBoot_size_t *align, + VasEBoot_size_t min_align, int relocatable, + VasEBoot_uint64_t preferred_address) { - grub_err_t err; + VasEBoot_err_t err; if (prot_size == 0) prot_size = 1; @@ -208,10 +208,10 @@ allocate_pages (grub_size_t prot_size, grub_size_t *align, /* Initialize the memory pointers with NULL for convenience. */ free_pages (); - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) { - err = grub_errno; + err = VasEBoot_errno; goto fail; } @@ -219,30 +219,30 @@ allocate_pages (grub_size_t prot_size, grub_size_t *align, implemented. */ { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; if (relocatable) { - err = grub_relocator_alloc_chunk_align (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, preferred_address, preferred_address, prot_size, 1, - GRUB_RELOCATOR_PREFERENCE_LOW, + VasEBoot_RELOCATOR_PREFERENCE_LOW, 1); for (; err && *align + 1 > min_align; (*align)--) { - grub_errno = GRUB_ERR_NONE; - err = grub_relocator_alloc_chunk_align (relocator, &ch, + VasEBoot_errno = VasEBoot_ERR_NONE; + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, 0x1000000, 0xffffffff & ~prot_size, prot_size, 1 << *align, - GRUB_RELOCATOR_PREFERENCE_LOW, + VasEBoot_RELOCATOR_PREFERENCE_LOW, 1); } if (err) goto fail; } else - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, preferred_address, prot_size); if (err) @@ -251,20 +251,20 @@ allocate_pages (grub_size_t prot_size, grub_size_t *align, prot_mode_target = get_physical_target_address (ch); } - grub_dprintf ("linux", "prot_mode_mem = %p, prot_mode_target = %lx, prot_size = %x\n", + VasEBoot_dprintf ("linux", "prot_mode_mem = %p, prot_mode_target = %lx, prot_size = %x\n", prot_mode_mem, (unsigned long) prot_mode_target, (unsigned) prot_size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: free_pages (); return err; } -static grub_err_t -grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, - grub_uint64_t start, grub_uint64_t size, - grub_uint32_t type) +static VasEBoot_err_t +VasEBoot_e820_add_region (struct VasEBoot_e820_mmap *e820_map, int *e820_num, + VasEBoot_uint64_t start, VasEBoot_uint64_t size, + VasEBoot_uint32_t type) { int n = *e820_num; @@ -278,28 +278,28 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, e820_map[n].type = type; (*e820_num)++; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_setup_video (struct linux_kernel_params *params) +static VasEBoot_err_t +VasEBoot_linux_setup_video (struct linux_kernel_params *params) { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; void *framebuffer; - grub_err_t err; - grub_video_driver_id_t driver_id; - const char *gfxlfbvar = grub_env_get ("gfxpayloadforcelfb"); + VasEBoot_err_t err; + VasEBoot_video_driver_id_t driver_id; + const char *gfxlfbvar = VasEBoot_env_get ("gfxpayloadforcelfb"); - driver_id = grub_video_get_driver_id (); + driver_id = VasEBoot_video_get_driver_id (); - if (driver_id == GRUB_VIDEO_DRIVER_NONE) + if (driver_id == VasEBoot_VIDEO_DRIVER_NONE) return 1; - err = grub_video_get_info_and_fini (&mode_info, &framebuffer); + err = VasEBoot_video_get_info_and_fini (&mode_info, &framebuffer); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 1; } @@ -308,7 +308,7 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->lfb_depth = mode_info.bpp; params->lfb_line_len = mode_info.pitch; - params->lfb_base = (grub_size_t) framebuffer; + params->lfb_base = (VasEBoot_size_t) framebuffer; params->lfb_size = ALIGN_UP (params->lfb_line_len * params->lfb_height, 65536); params->red_mask_size = mode_info.red_mask_size; @@ -321,58 +321,58 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->reserved_field_pos = mode_info.reserved_field_pos; if (gfxlfbvar && (gfxlfbvar[0] == '1' || gfxlfbvar[0] == 'y')) - params->have_vga = GRUB_VIDEO_LINUX_TYPE_SIMPLE; + params->have_vga = VasEBoot_VIDEO_LINUX_TYPE_SIMPLE; else { switch (driver_id) { - case GRUB_VIDEO_DRIVER_VBE: + case VasEBoot_VIDEO_DRIVER_VBE: params->lfb_size >>= 16; - params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA; + params->have_vga = VasEBoot_VIDEO_LINUX_TYPE_VESA; break; - case GRUB_VIDEO_DRIVER_EFI_UGA: - case GRUB_VIDEO_DRIVER_EFI_GOP: - params->have_vga = GRUB_VIDEO_LINUX_TYPE_EFIFB; + case VasEBoot_VIDEO_DRIVER_EFI_UGA: + case VasEBoot_VIDEO_DRIVER_EFI_GOP: + params->have_vga = VasEBoot_VIDEO_LINUX_TYPE_EFIFB; break; /* FIXME: check if better id is available. */ - case GRUB_VIDEO_DRIVER_SM712: - case GRUB_VIDEO_DRIVER_SIS315PRO: - case GRUB_VIDEO_DRIVER_VGA: - case GRUB_VIDEO_DRIVER_CIRRUS: - case GRUB_VIDEO_DRIVER_BOCHS: - case GRUB_VIDEO_DRIVER_RADEON_FULOONG2E: - case GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A: - case GRUB_VIDEO_DRIVER_IEEE1275: - case GRUB_VIDEO_DRIVER_COREBOOT: + case VasEBoot_VIDEO_DRIVER_SM712: + case VasEBoot_VIDEO_DRIVER_SIS315PRO: + case VasEBoot_VIDEO_DRIVER_VGA: + case VasEBoot_VIDEO_DRIVER_CIRRUS: + case VasEBoot_VIDEO_DRIVER_BOCHS: + case VasEBoot_VIDEO_DRIVER_RADEON_FULOONG2E: + case VasEBoot_VIDEO_DRIVER_RADEON_YEELOONG3A: + case VasEBoot_VIDEO_DRIVER_IEEE1275: + case VasEBoot_VIDEO_DRIVER_COREBOOT: /* Make gcc happy. */ - case GRUB_VIDEO_DRIVER_XEN: - case GRUB_VIDEO_DRIVER_SDL: - case GRUB_VIDEO_DRIVER_NONE: - case GRUB_VIDEO_ADAPTER_CAPTURE: - params->have_vga = GRUB_VIDEO_LINUX_TYPE_SIMPLE; + case VasEBoot_VIDEO_DRIVER_XEN: + case VasEBoot_VIDEO_DRIVER_SDL: + case VasEBoot_VIDEO_DRIVER_NONE: + case VasEBoot_VIDEO_ADAPTER_CAPTURE: + params->have_vga = VasEBoot_VIDEO_LINUX_TYPE_SIMPLE; break; } } -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS /* VESA packed modes may come with zeroed mask sizes, which need to be set here according to DAC Palette width. If we don't, this results in Linux displaying a black screen. */ - if (driver_id == GRUB_VIDEO_DRIVER_VBE && mode_info.bpp <= 8) + if (driver_id == VasEBoot_VIDEO_DRIVER_VBE && mode_info.bpp <= 8) { - struct grub_vbe_info_block controller_info; + struct VasEBoot_vbe_info_block controller_info; int status; int width = 8; - status = grub_vbe_bios_get_controller_info (&controller_info); + status = VasEBoot_vbe_bios_get_controller_info (&controller_info); - if (status == GRUB_VBE_STATUS_OK && - (controller_info.capabilities & GRUB_VBE_CAPABILITY_DACWIDTH)) - status = grub_vbe_bios_set_dac_palette_width (&width); + if (status == VasEBoot_VBE_STATUS_OK && + (controller_info.capabilities & VasEBoot_VBE_CAPABILITY_DACWIDTH)) + status = VasEBoot_vbe_bios_set_dac_palette_width (&width); - if (status != GRUB_VBE_STATUS_OK) + if (status != VasEBoot_VBE_STATUS_OK) /* 6 is default after mode reset. */ width = 6; @@ -382,27 +382,27 @@ grub_linux_setup_video (struct linux_kernel_params *params) } #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Context for grub_linux_boot. */ -struct grub_linux_boot_ctx +/* Context for VasEBoot_linux_boot. */ +struct VasEBoot_linux_boot_ctx { - grub_addr_t real_mode_target; - grub_size_t real_size; + VasEBoot_addr_t real_mode_target; + VasEBoot_size_t real_size; struct linux_kernel_params *params; int e820_num; }; -/* Helper for grub_linux_boot. */ +/* Helper for VasEBoot_linux_boot. */ static int -grub_linux_boot_mmap_find (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, void *data) +VasEBoot_linux_boot_mmap_find (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { - struct grub_linux_boot_ctx *ctx = data; + struct VasEBoot_linux_boot_ctx *ctx = data; /* We must put real mode code in the traditional space. */ - if (type != GRUB_MEMORY_AVAILABLE || addr > 0x90000) + if (type != VasEBoot_MEMORY_AVAILABLE || addr > 0x90000) return 0; if (addr + size < 0x10000) @@ -420,7 +420,7 @@ grub_linux_boot_mmap_find (grub_uint64_t addr, grub_uint64_t size, if (ctx->real_size + efi_mmap_size > size) return 0; - grub_dprintf ("linux", "addr = %lx, size = %x, need_size = %x\n", + VasEBoot_dprintf ("linux", "addr = %lx, size = %x, need_size = %x\n", (unsigned long) addr, (unsigned) size, (unsigned) (ctx->real_size + efi_mmap_size)); @@ -428,94 +428,94 @@ grub_linux_boot_mmap_find (grub_uint64_t addr, grub_uint64_t size, return 1; } -/* GRUB types conveniently match E820 types. */ +/* VasEBoot types conveniently match E820 types. */ static int -grub_linux_boot_mmap_fill (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, void *data) +VasEBoot_linux_boot_mmap_fill (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { - struct grub_linux_boot_ctx *ctx = data; + struct VasEBoot_linux_boot_ctx *ctx = data; - if (grub_e820_add_region (ctx->params->e820_map, &ctx->e820_num, + if (VasEBoot_e820_add_region (ctx->params->e820_map, &ctx->e820_num, addr, size, type)) return 1; return 0; } -static grub_err_t -grub_linux_boot (void) +static VasEBoot_err_t +VasEBoot_linux_boot (void) { - grub_err_t err = 0; + VasEBoot_err_t err = 0; const char *modevar; char *tmp; - struct grub_relocator32_state state; + struct VasEBoot_relocator32_state state; void *real_mode_mem; - struct grub_linux_boot_ctx ctx = { + struct VasEBoot_linux_boot_ctx ctx = { .real_mode_target = 0 }; - grub_size_t mmap_size; - grub_size_t cl_offset; + VasEBoot_size_t mmap_size; + VasEBoot_size_t cl_offset; -#ifdef GRUB_MACHINE_IEEE1275 +#ifdef VasEBoot_MACHINE_IEEE1275 { const char *bootpath; - grub_ssize_t len; + VasEBoot_ssize_t len; - bootpath = grub_env_get ("root"); + bootpath = VasEBoot_env_get ("root"); if (bootpath) - grub_ieee1275_set_property (grub_ieee1275_chosen, + VasEBoot_ieee1275_set_property (VasEBoot_ieee1275_chosen, "bootpath", bootpath, - grub_strlen (bootpath) + 1, + VasEBoot_strlen (bootpath) + 1, &len); - linux_params.ofw_signature = GRUB_LINUX_OFW_SIGNATURE; + linux_params.ofw_signature = VasEBoot_LINUX_OFW_SIGNATURE; linux_params.ofw_num_items = 1; - linux_params.ofw_cif_handler = (grub_uint32_t) grub_ieee1275_entry_fn; + linux_params.ofw_cif_handler = (VasEBoot_uint32_t) VasEBoot_ieee1275_entry_fn; linux_params.ofw_idt = 0; } #endif - modevar = grub_env_get ("gfxpayload"); + modevar = VasEBoot_env_get ("gfxpayload"); /* Now all graphical modes are acceptable. May change in future if we have modes without framebuffer. */ if (modevar && *modevar != 0) { - tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); + tmp = VasEBoot_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); if (! tmp) - return grub_errno; + return VasEBoot_errno; #if ACCEPTS_PURE_TEXT - err = grub_video_set_mode (tmp, 0, 0); + err = VasEBoot_video_set_mode (tmp, 0, 0); #else - err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); + err = VasEBoot_video_set_mode (tmp, VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT, 0); #endif - grub_free (tmp); + VasEBoot_free (tmp); } else /* We can't go back to text mode from coreboot fb. */ -#ifdef GRUB_MACHINE_COREBOOT - if (grub_video_get_driver_id () == GRUB_VIDEO_DRIVER_COREBOOT) - err = GRUB_ERR_NONE; +#ifdef VasEBoot_MACHINE_COREBOOT + if (VasEBoot_video_get_driver_id () == VasEBoot_VIDEO_DRIVER_COREBOOT) + err = VasEBoot_ERR_NONE; else #endif { #if ACCEPTS_PURE_TEXT - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); + err = VasEBoot_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); #else - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, - GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); + err = VasEBoot_video_set_mode (DEFAULT_VIDEO_MODE, + VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT, 0); #endif } if (err) { - grub_print_error (); - grub_puts_ (N_("Booting in blind mode")); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_puts_ (N_("Booting in blind mode")); + VasEBoot_errno = VasEBoot_ERR_NONE; } - if (grub_linux_setup_video (&linux_params)) + if (VasEBoot_linux_setup_video (&linux_params)) { -#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) - linux_params.have_vga = GRUB_VIDEO_LINUX_TYPE_TEXT; +#if defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_QEMU) + linux_params.have_vga = VasEBoot_VIDEO_LINUX_TYPE_TEXT; linux_params.video_mode = 0x3; #else linux_params.have_vga = 0; @@ -526,22 +526,22 @@ grub_linux_boot (void) } -#ifndef GRUB_MACHINE_IEEE1275 - if (linux_params.have_vga == GRUB_VIDEO_LINUX_TYPE_TEXT) +#ifndef VasEBoot_MACHINE_IEEE1275 + if (linux_params.have_vga == VasEBoot_VIDEO_LINUX_TYPE_TEXT) #endif { - grub_term_output_t term; + VasEBoot_term_output_t term; int found = 0; FOR_ACTIVE_TERM_OUTPUTS(term) - if (grub_strcmp (term->name, "vga_text") == 0 - || grub_strcmp (term->name, "console") == 0 - || grub_strcmp (term->name, "ofconsole") == 0) + if (VasEBoot_strcmp (term->name, "vga_text") == 0 + || VasEBoot_strcmp (term->name, "console") == 0 + || VasEBoot_strcmp (term->name, "ofconsole") == 0) { - struct grub_term_coordinate pos = grub_term_getxy (term); + struct VasEBoot_term_coordinate pos = VasEBoot_term_getxy (term); linux_params.video_cursor_x = pos.x; linux_params.video_cursor_y = pos.y; - linux_params.video_width = grub_term_width (term); - linux_params.video_height = grub_term_height (term); + linux_params.video_width = VasEBoot_term_width (term); + linux_params.video_height = VasEBoot_term_height (term); found = 1; break; } @@ -557,79 +557,79 @@ grub_linux_boot (void) mmap_size = find_mmap_size (); /* Make sure that each size is aligned to a page boundary. */ cl_offset = ALIGN_UP (mmap_size + sizeof (linux_params), 4096); - if (cl_offset < ((grub_size_t) linux_params.setup_sects << GRUB_DISK_SECTOR_BITS)) - cl_offset = ALIGN_UP ((grub_size_t) (linux_params.setup_sects - << GRUB_DISK_SECTOR_BITS), 4096); + if (cl_offset < ((VasEBoot_size_t) linux_params.setup_sects << VasEBoot_DISK_SECTOR_BITS)) + cl_offset = ALIGN_UP ((VasEBoot_size_t) (linux_params.setup_sects + << VasEBoot_DISK_SECTOR_BITS), 4096); ctx.real_size = ALIGN_UP (cl_offset + maximal_cmdline_size, 4096); -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI efi_mmap_size = find_efi_mmap_size (); if (efi_mmap_size == 0) - return grub_errno; + return VasEBoot_errno; #endif - grub_dprintf ("linux", "real_size = %x, mmap_size = %x\n", + VasEBoot_dprintf ("linux", "real_size = %x, mmap_size = %x\n", (unsigned) ctx.real_size, (unsigned) mmap_size); -#ifdef GRUB_MACHINE_EFI - grub_efi_mmap_iterate (grub_linux_boot_mmap_find, &ctx, 1); +#ifdef VasEBoot_MACHINE_EFI + VasEBoot_efi_mmap_iterate (VasEBoot_linux_boot_mmap_find, &ctx, 1); if (! ctx.real_mode_target) - grub_efi_mmap_iterate (grub_linux_boot_mmap_find, &ctx, 0); + VasEBoot_efi_mmap_iterate (VasEBoot_linux_boot_mmap_find, &ctx, 0); #else - grub_mmap_iterate (grub_linux_boot_mmap_find, &ctx); + VasEBoot_mmap_iterate (VasEBoot_linux_boot_mmap_find, &ctx); #endif - grub_dprintf ("linux", "real_mode_target = %lx, real_size = %x, efi_mmap_size = %x\n", + VasEBoot_dprintf ("linux", "real_mode_target = %lx, real_size = %x, efi_mmap_size = %x\n", (unsigned long) ctx.real_mode_target, (unsigned) ctx.real_size, (unsigned) efi_mmap_size); if (! ctx.real_mode_target) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate real mode pages"); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate real mode pages"); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, ctx.real_mode_target, (ctx.real_size + efi_mmap_size)); if (err) return err; real_mode_mem = get_virtual_current_address (ch); } - efi_mmap_buf = (grub_uint8_t *) real_mode_mem + ctx.real_size; + efi_mmap_buf = (VasEBoot_uint8_t *) real_mode_mem + ctx.real_size; - grub_dprintf ("linux", "real_mode_mem = %p\n", + VasEBoot_dprintf ("linux", "real_mode_mem = %p\n", real_mode_mem); ctx.params = real_mode_mem; *ctx.params = linux_params; ctx.params->cmd_line_ptr = ctx.real_mode_target + cl_offset; - grub_memcpy ((char *) ctx.params + cl_offset, linux_cmdline, + VasEBoot_memcpy ((char *) ctx.params + cl_offset, linux_cmdline, maximal_cmdline_size); - grub_dprintf ("linux", "code32_start = %x\n", + VasEBoot_dprintf ("linux", "code32_start = %x\n", (unsigned) ctx.params->code32_start); ctx.e820_num = 0; - if (grub_mmap_iterate (grub_linux_boot_mmap_fill, &ctx)) - return grub_errno; + if (VasEBoot_mmap_iterate (VasEBoot_linux_boot_mmap_fill, &ctx)) + return VasEBoot_errno; ctx.params->mmap_size = ctx.e820_num; -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI { - grub_efi_uintn_t efi_desc_size; - grub_size_t efi_mmap_target; - grub_efi_uint32_t efi_desc_version; - err = grub_efi_finish_boot_services (&efi_mmap_size, efi_mmap_buf, NULL, + VasEBoot_efi_uintn_t efi_desc_size; + VasEBoot_size_t efi_mmap_target; + VasEBoot_efi_uint32_t efi_desc_version; + err = VasEBoot_efi_finish_boot_services (&efi_mmap_size, efi_mmap_buf, NULL, &efi_desc_size, &efi_desc_version); if (err) return err; /* Note that no boot services are available from here. */ efi_mmap_target = ctx.real_mode_target - + ((grub_uint8_t *) efi_mmap_buf - (grub_uint8_t *) real_mode_mem); + + ((VasEBoot_uint8_t *) efi_mmap_buf - (VasEBoot_uint8_t *) real_mode_mem); /* Pass EFI parameters. */ - if (grub_le_to_cpu16 (ctx.params->version) >= 0x0208) + if (VasEBoot_le_to_cpu16 (ctx.params->version) >= 0x0208) { ctx.params->v0208.efi_mem_desc_size = efi_desc_size; ctx.params->v0208.efi_mem_desc_version = efi_desc_version; @@ -640,14 +640,14 @@ grub_linux_boot (void) ctx.params->v0208.efi_mmap_hi = (efi_mmap_target >> 32); #endif } - else if (grub_le_to_cpu16 (ctx.params->version) >= 0x0206) + else if (VasEBoot_le_to_cpu16 (ctx.params->version) >= 0x0206) { ctx.params->v0206.efi_mem_desc_size = efi_desc_size; ctx.params->v0206.efi_mem_desc_version = efi_desc_version; ctx.params->v0206.efi_mmap = efi_mmap_target; ctx.params->v0206.efi_mmap_size = efi_mmap_size; } - else if (grub_le_to_cpu16 (ctx.params->version) >= 0x0204) + else if (VasEBoot_le_to_cpu16 (ctx.params->version) >= 0x0204) { ctx.params->v0204.efi_mem_desc_size = efi_desc_size; ctx.params->v0204.efi_mem_desc_version = efi_desc_version; @@ -663,106 +663,106 @@ grub_linux_boot (void) state.esi = ctx.real_mode_target; state.esp = ctx.real_mode_target; state.eip = ctx.params->code32_start; - return grub_relocator32_boot (relocator, state, 0); + return VasEBoot_relocator32_boot (relocator, state, 0); } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; - grub_free (linux_cmdline); + VasEBoot_free (linux_cmdline); linux_cmdline = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; struct linux_kernel_header lh; - grub_uint8_t setup_sects; - grub_size_t real_size, prot_size, prot_file_size, kernel_offset; - grub_ssize_t len; + VasEBoot_uint8_t setup_sects; + VasEBoot_size_t real_size, prot_size, prot_file_size, kernel_offset; + VasEBoot_ssize_t len; int i; - grub_size_t align, min_align; + VasEBoot_size_t align, min_align; int relocatable; - grub_uint64_t preferred_address = GRUB_LINUX_BZIMAGE_ADDR; - grub_uint8_t *kernel = NULL; + VasEBoot_uint64_t preferred_address = VasEBoot_LINUX_BZIMAGE_ADDR; + VasEBoot_uint8_t *kernel = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; - len = grub_file_size (file); - kernel = grub_malloc (len); + len = VasEBoot_file_size (file); + kernel = VasEBoot_malloc (len); if (!kernel) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); goto fail; } - if (grub_file_read (file, kernel, len) != len) + if (VasEBoot_file_read (file, kernel, len) != len) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - grub_tpm_measure (kernel, len, GRUB_BINARY_PCR, "grub_linux", "Kernel"); - grub_print_error(); + VasEBoot_tpm_measure (kernel, len, VasEBoot_BINARY_PCR, "VasEBoot_linux", "Kernel"); + VasEBoot_print_error(); - grub_memcpy (&lh, kernel, sizeof (lh)); + VasEBoot_memcpy (&lh, kernel, sizeof (lh)); kernel_offset = sizeof (lh); - if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)) + if (lh.boot_flag != VasEBoot_cpu_to_le16_compile_time (0xaa55)) { - grub_error (GRUB_ERR_BAD_OS, "invalid magic number"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid magic number"); goto fail; } - if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) + if (lh.setup_sects > VasEBoot_LINUX_MAX_SETUP_SECTS) { - grub_error (GRUB_ERR_BAD_OS, "too many setup sectors"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "too many setup sectors"); goto fail; } /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and still not support 32-bit boot. */ - if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - || grub_le_to_cpu16 (lh.version) < 0x0203) + if (lh.header != VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + || VasEBoot_le_to_cpu16 (lh.version) < 0x0203) { - grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot" -#ifdef GRUB_MACHINE_PCBIOS + VasEBoot_error (VasEBoot_ERR_BAD_OS, "version too old for 32-bit boot" +#ifdef VasEBoot_MACHINE_PCBIOS " (try with `linux16')" #endif ); goto fail; } - if (! (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL)) + if (! (lh.loadflags & VasEBoot_LINUX_FLAG_BIG_KERNEL)) { - grub_error (GRUB_ERR_BAD_OS, "zImage doesn't support 32-bit boot" -#ifdef GRUB_MACHINE_PCBIOS + VasEBoot_error (VasEBoot_ERR_BAD_OS, "zImage doesn't support 32-bit boot" +#ifdef VasEBoot_MACHINE_PCBIOS " (try with `linux16')" #endif ); goto fail; } - if (grub_le_to_cpu16 (lh.version) >= 0x0206) - maximal_cmdline_size = grub_le_to_cpu32 (lh.cmdline_size) + 1; + if (VasEBoot_le_to_cpu16 (lh.version) >= 0x0206) + maximal_cmdline_size = VasEBoot_le_to_cpu32 (lh.cmdline_size) + 1; else maximal_cmdline_size = 256; @@ -773,19 +773,19 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* If SETUP_SECTS is not set, set it to the default (4). */ if (! setup_sects) - setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; + setup_sects = VasEBoot_LINUX_DEFAULT_SETUP_SECTS; - real_size = setup_sects << GRUB_DISK_SECTOR_BITS; - prot_file_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; + real_size = setup_sects << VasEBoot_DISK_SECTOR_BITS; + prot_file_size = VasEBoot_file_size (file) - real_size - VasEBoot_DISK_SECTOR_SIZE; - if (grub_le_to_cpu16 (lh.version) >= 0x205 + if (VasEBoot_le_to_cpu16 (lh.version) >= 0x205 && lh.kernel_alignment != 0 && ((lh.kernel_alignment - 1) & lh.kernel_alignment) == 0) { for (align = 0; align < 32; align++) - if (grub_le_to_cpu32 (lh.kernel_alignment) & (1 << align)) + if (VasEBoot_le_to_cpu32 (lh.kernel_alignment) & (1 << align)) break; - relocatable = grub_le_to_cpu32 (lh.relocatable); + relocatable = VasEBoot_le_to_cpu32 (lh.relocatable); } else { @@ -793,21 +793,21 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), relocatable = 0; } - if (grub_le_to_cpu16 (lh.version) >= 0x020a) + if (VasEBoot_le_to_cpu16 (lh.version) >= 0x020a) { min_align = lh.min_alignment; - prot_size = grub_le_to_cpu32 (lh.init_size); + prot_size = VasEBoot_le_to_cpu32 (lh.init_size); prot_init_space = page_align (prot_size); if (relocatable) - preferred_address = grub_le_to_cpu64 (lh.pref_address); + preferred_address = VasEBoot_le_to_cpu64 (lh.pref_address); else - preferred_address = GRUB_LINUX_BZIMAGE_ADDR; + preferred_address = VasEBoot_LINUX_BZIMAGE_ADDR; } else { min_align = align; prot_size = prot_file_size; - preferred_address = GRUB_LINUX_BZIMAGE_ADDR; + preferred_address = VasEBoot_LINUX_BZIMAGE_ADDR; /* Usually, the compression ratio is about 50%. */ prot_init_space = page_align (prot_size) * 3; } @@ -817,30 +817,30 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), preferred_address)) goto fail; - grub_memset (&linux_params, 0, sizeof (linux_params)); - grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); + VasEBoot_memset (&linux_params, 0, sizeof (linux_params)); + VasEBoot_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); - linux_params.code32_start = prot_mode_target + lh.code32_start - GRUB_LINUX_BZIMAGE_ADDR; + linux_params.code32_start = prot_mode_target + lh.code32_start - VasEBoot_LINUX_BZIMAGE_ADDR; linux_params.kernel_alignment = (1 << align); linux_params.ps_mouse = linux_params.padding10 = 0; len = sizeof (linux_params) - sizeof (lh); - grub_memcpy ((char *) &linux_params + sizeof (lh), kernel + kernel_offset, len); + VasEBoot_memcpy ((char *) &linux_params + sizeof (lh), kernel + kernel_offset, len); kernel_offset += len; - linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; + linux_params.type_of_loader = VasEBoot_LINUX_BOOT_LOADER_TYPE; /* These two are used (instead of cmd_line_ptr) by older versions of Linux, and otherwise ignored. */ - linux_params.cl_magic = GRUB_LINUX_CL_MAGIC; + linux_params.cl_magic = VasEBoot_LINUX_CL_MAGIC; linux_params.cl_offset = 0x1000; linux_params.ramdisk_image = 0; linux_params.ramdisk_size = 0; - linux_params.heap_end_ptr = GRUB_LINUX_HEAP_END_OFFSET; - linux_params.loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP; + linux_params.heap_end_ptr = VasEBoot_LINUX_HEAP_END_OFFSET; + linux_params.loadflags |= VasEBoot_LINUX_FLAG_CAN_USE_HEAP; /* These are not needed to be precise, because Linux uses these values only to raise an error when the decompression code cannot find good @@ -856,146 +856,146 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_params.font_size = 16; /* XXX */ -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI #ifdef __x86_64__ - if (grub_le_to_cpu16 (linux_params.version) < 0x0208 && - ((grub_addr_t) grub_efi_system_table >> 32) != 0) - return grub_error(GRUB_ERR_BAD_OS, + if (VasEBoot_le_to_cpu16 (linux_params.version) < 0x0208 && + ((VasEBoot_addr_t) VasEBoot_efi_system_table >> 32) != 0) + return VasEBoot_error(VasEBoot_ERR_BAD_OS, "kernel does not support 64-bit addressing"); #endif - if (grub_le_to_cpu16 (linux_params.version) >= 0x0208) + if (VasEBoot_le_to_cpu16 (linux_params.version) >= 0x0208) { - linux_params.v0208.efi_signature = GRUB_LINUX_EFI_SIGNATURE; - linux_params.v0208.efi_system_table = (grub_uint32_t) (grub_addr_t) grub_efi_system_table; + linux_params.v0208.efi_signature = VasEBoot_LINUX_EFI_SIGNATURE; + linux_params.v0208.efi_system_table = (VasEBoot_uint32_t) (VasEBoot_addr_t) VasEBoot_efi_system_table; #ifdef __x86_64__ - linux_params.v0208.efi_system_table_hi = (grub_uint32_t) ((grub_uint64_t) grub_efi_system_table >> 32); + linux_params.v0208.efi_system_table_hi = (VasEBoot_uint32_t) ((VasEBoot_uint64_t) VasEBoot_efi_system_table >> 32); #endif } - else if (grub_le_to_cpu16 (linux_params.version) >= 0x0206) + else if (VasEBoot_le_to_cpu16 (linux_params.version) >= 0x0206) { - linux_params.v0206.efi_signature = GRUB_LINUX_EFI_SIGNATURE; - linux_params.v0206.efi_system_table = (grub_uint32_t) (grub_addr_t) grub_efi_system_table; + linux_params.v0206.efi_signature = VasEBoot_LINUX_EFI_SIGNATURE; + linux_params.v0206.efi_system_table = (VasEBoot_uint32_t) (VasEBoot_addr_t) VasEBoot_efi_system_table; } - else if (grub_le_to_cpu16 (linux_params.version) >= 0x0204) + else if (VasEBoot_le_to_cpu16 (linux_params.version) >= 0x0204) { - linux_params.v0204.efi_signature = GRUB_LINUX_EFI_SIGNATURE_0204; - linux_params.v0204.efi_system_table = (grub_uint32_t) (grub_addr_t) grub_efi_system_table; + linux_params.v0204.efi_signature = VasEBoot_LINUX_EFI_SIGNATURE_0204; + linux_params.v0204.efi_system_table = (VasEBoot_uint32_t) (VasEBoot_addr_t) VasEBoot_efi_system_table; } #endif /* The other parameters are filled when booting. */ - kernel_offset = real_size + GRUB_DISK_SECTOR_SIZE; + kernel_offset = real_size + VasEBoot_DISK_SECTOR_SIZE; - grub_dprintf ("linux", "bzImage, setup=0x%x, size=0x%x\n", + VasEBoot_dprintf ("linux", "bzImage, setup=0x%x, size=0x%x\n", (unsigned) real_size, (unsigned) prot_size); /* Look for memory size and video mode specified on the command line. */ linux_mem_size = 0; for (i = 1; i < argc; i++) -#ifdef GRUB_MACHINE_PCBIOS - if (grub_memcmp (argv[i], "vga=", 4) == 0) +#ifdef VasEBoot_MACHINE_PCBIOS + if (VasEBoot_memcmp (argv[i], "vga=", 4) == 0) { /* Video mode selection support. */ char *val = argv[i] + 4; - unsigned vid_mode = GRUB_LINUX_VID_MODE_NORMAL; - struct grub_vesa_mode_table_entry *linux_mode; - grub_err_t err; + unsigned vid_mode = VasEBoot_LINUX_VID_MODE_NORMAL; + struct VasEBoot_vesa_mode_table_entry *linux_mode; + VasEBoot_err_t err; char *buf; - grub_dl_load ("vbe"); + VasEBoot_dl_load ("vbe"); - if (grub_strcmp (val, "normal") == 0) - vid_mode = GRUB_LINUX_VID_MODE_NORMAL; - else if (grub_strcmp (val, "ext") == 0) - vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; - else if (grub_strcmp (val, "ask") == 0) + if (VasEBoot_strcmp (val, "normal") == 0) + vid_mode = VasEBoot_LINUX_VID_MODE_NORMAL; + else if (VasEBoot_strcmp (val, "ext") == 0) + vid_mode = VasEBoot_LINUX_VID_MODE_EXTENDED; + else if (VasEBoot_strcmp (val, "ask") == 0) { - grub_puts_ (N_("Legacy `ask' parameter no longer supported.")); + VasEBoot_puts_ (N_("Legacy `ask' parameter no longer supported.")); /* We usually would never do this in a loader, but "vga=ask" means user requested interaction, so it can't hurt to request keyboard input. */ - grub_wait_after_message (); + VasEBoot_wait_after_message (); goto fail; } else - vid_mode = (grub_uint16_t) grub_strtoul (val, 0, 0); + vid_mode = (VasEBoot_uint16_t) VasEBoot_strtoul (val, 0, 0); switch (vid_mode) { case 0: - case GRUB_LINUX_VID_MODE_NORMAL: - grub_env_set ("gfxpayload", "text"); - grub_printf_ (N_("%s is deprecated. " + case VasEBoot_LINUX_VID_MODE_NORMAL: + VasEBoot_env_set ("gfxpayload", "text"); + VasEBoot_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " "linux command instead.\n"), argv[i], "text"); break; case 1: - case GRUB_LINUX_VID_MODE_EXTENDED: + case VasEBoot_LINUX_VID_MODE_EXTENDED: /* FIXME: support 80x50 text. */ - grub_env_set ("gfxpayload", "text"); - grub_printf_ (N_("%s is deprecated. " + VasEBoot_env_set ("gfxpayload", "text"); + VasEBoot_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " "linux command instead.\n"), argv[i], "text"); break; default: /* Ignore invalid values. */ - if (vid_mode < GRUB_VESA_MODE_TABLE_START || - vid_mode > GRUB_VESA_MODE_TABLE_END) + if (vid_mode < VasEBoot_VESA_MODE_TABLE_START || + vid_mode > VasEBoot_VESA_MODE_TABLE_END) { - grub_env_set ("gfxpayload", "text"); + VasEBoot_env_set ("gfxpayload", "text"); /* TRANSLATORS: "x" has to be entered in, like an identifier, so please don't use better Unicode codepoints. */ - grub_printf_ (N_("%s is deprecated. VGA mode %d isn't recognized. " + VasEBoot_printf_ (N_("%s is deprecated. VGA mode %d isn't recognized. " "Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] " "before linux command instead.\n"), argv[i], vid_mode); break; } - linux_mode = &grub_vesa_mode_table[vid_mode - - GRUB_VESA_MODE_TABLE_START]; + linux_mode = &VasEBoot_vesa_mode_table[vid_mode + - VasEBoot_VESA_MODE_TABLE_START]; - buf = grub_xasprintf ("%ux%ux%u,%ux%u", + buf = VasEBoot_xasprintf ("%ux%ux%u,%ux%u", linux_mode->width, linux_mode->height, linux_mode->depth, linux_mode->width, linux_mode->height); if (! buf) goto fail; - grub_printf_ (N_("%s is deprecated. " + VasEBoot_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " "linux command instead.\n"), argv[i], buf); - err = grub_env_set ("gfxpayload", buf); - grub_free (buf); + err = VasEBoot_env_set ("gfxpayload", buf); + VasEBoot_free (buf); if (err) goto fail; } } else -#endif /* GRUB_MACHINE_PCBIOS */ - if (grub_memcmp (argv[i], "mem=", 4) == 0) +#endif /* VasEBoot_MACHINE_PCBIOS */ + if (VasEBoot_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; - linux_mem_size = grub_strtoul (val, &val, 0); + linux_mem_size = VasEBoot_strtoul (val, &val, 0); - if (grub_errno) + if (VasEBoot_errno) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; linux_mem_size = 0; } else { int shift = 0; - switch (grub_tolower (val[0])) + switch (VasEBoot_tolower (val[0])) { case 'g': shift += 10; @@ -1017,91 +1017,91 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mem_size <<= shift; } } - else if (grub_memcmp (argv[i], "quiet", sizeof ("quiet") - 1) == 0) + else if (VasEBoot_memcmp (argv[i], "quiet", sizeof ("quiet") - 1) == 0) { - linux_params.loadflags |= GRUB_LINUX_FLAG_QUIET; + linux_params.loadflags |= VasEBoot_LINUX_FLAG_QUIET; } /* Create kernel command line. */ - linux_cmdline = grub_zalloc (maximal_cmdline_size + 1); + linux_cmdline = VasEBoot_zalloc (maximal_cmdline_size + 1); if (!linux_cmdline) goto fail; - grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, + VasEBoot_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, linux_cmdline + sizeof (LINUX_IMAGE) - 1, maximal_cmdline_size - (sizeof (LINUX_IMAGE) - 1)); - grub_pass_verity_hash(&lh, linux_cmdline, maximal_cmdline_size); + VasEBoot_pass_verity_hash(&lh, linux_cmdline, maximal_cmdline_size); len = prot_file_size; - grub_memcpy (prot_mode_mem, kernel + kernel_offset, len); + VasEBoot_memcpy (prot_mode_mem, kernel + kernel_offset, len); kernel_offset += len; - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - grub_loader_set (grub_linux_boot, grub_linux_unload, - 0 /* set noreturn=0 in order to avoid grub_console_fini() */); + VasEBoot_loader_set (VasEBoot_linux_boot, VasEBoot_linux_unload, + 0 /* set noreturn=0 in order to avoid VasEBoot_console_fini() */); loaded = 1; } fail: - grub_free (kernel); + VasEBoot_free (kernel); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0, aligned_size = 0; - grub_addr_t addr_min, addr_max; - grub_addr_t addr; - grub_err_t err; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + VasEBoot_size_t size = 0, aligned_size = 0; + VasEBoot_addr_t addr_min, addr_max; + VasEBoot_addr_t addr; + VasEBoot_err_t err; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (! loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); aligned_size = ALIGN_UP (size, 4096); /* Get the highest address available for the initrd. */ - if (grub_le_to_cpu16 (linux_params.version) >= 0x0203) + if (VasEBoot_le_to_cpu16 (linux_params.version) >= 0x0203) { - addr_max = grub_cpu_to_le32 (linux_params.initrd_addr_max); + addr_max = VasEBoot_cpu_to_le32 (linux_params.initrd_addr_max); /* XXX in reality, Linux specifies a bogus value, so it is necessary to make sure that ADDR_MAX does not exceed 0x3fffffff. */ - if (addr_max > GRUB_LINUX_INITRD_MAX_ADDRESS) - addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; + if (addr_max > VasEBoot_LINUX_INITRD_MAX_ADDRESS) + addr_max = VasEBoot_LINUX_INITRD_MAX_ADDRESS; } else - addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; + addr_max = VasEBoot_LINUX_INITRD_MAX_ADDRESS; if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; @@ -1112,23 +1112,23 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), worse than that of Linux 2.3.xx, so avoid the last 64kb. */ addr_max -= 0x10000; - addr_min = (grub_addr_t) prot_mode_target + prot_init_space; + addr_min = (VasEBoot_addr_t) prot_mode_target + prot_init_space; /* Put the initrd as high as possible, 4KiB aligned. */ addr = (addr_max - aligned_size) & ~0xFFF; if (addr < addr_min) { - grub_error (GRUB_ERR_OUT_OF_RANGE, "the initrd is too big"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "the initrd is too big"); goto fail; } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, addr_min, addr, aligned_size, 0x1000, - GRUB_RELOCATOR_PREFERENCE_HIGH, + VasEBoot_RELOCATOR_PREFERENCE_HIGH, 1); if (err) return err; @@ -1136,10 +1136,10 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), initrd_mem_target = get_physical_target_address (ch); } - if (grub_initrd_load (&initrd_ctx, argv, initrd_mem)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, initrd_mem)) goto fail; - grub_dprintf ("linux", "Initrd, addr=0x%x, size=0x%x\n", + VasEBoot_dprintf ("linux", "Initrd, addr=0x%x, size=0x%x\n", (unsigned) addr, (unsigned) size); linux_params.ramdisk_image = initrd_mem_target; @@ -1147,24 +1147,24 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), linux_params.root_dev = 0x0100; /* XXX */ fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linux) +VasEBoot_MOD_INIT(linux) { - cmd_linux = grub_register_command ("linux", grub_cmd_linux, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI(linux) +VasEBoot_MOD_FINI(linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/i386/multiboot_mbi.c b/VasEBoot-core/loader/i386/multiboot_mbi.c index 42372bf05..4e8eafb66 100644 --- a/VasEBoot-core/loader/i386/multiboot_mbi.c +++ b/VasEBoot-core/loader/i386/multiboot_mbi.c @@ -1,45 +1,45 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#ifdef GRUB_MACHINE_PCBIOS -#include -#include -#include +#include +#ifdef VasEBoot_MACHINE_PCBIOS +#include +#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_MACHINE_EFI -#include +#ifdef VasEBoot_MACHINE_EFI +#include #endif /* The bits in the required part of flags field we don't support. */ @@ -48,29 +48,29 @@ struct module { struct module *next; - grub_addr_t start; - grub_size_t size; + VasEBoot_addr_t start; + VasEBoot_size_t size; char *cmdline; int cmdline_size; }; static struct module *modules, *modules_last; -static grub_size_t cmdline_size; -static grub_size_t total_modcmd; +static VasEBoot_size_t cmdline_size; +static VasEBoot_size_t total_modcmd; static unsigned modcnt; static char *cmdline = NULL; -static grub_uint32_t bootdev; +static VasEBoot_uint32_t bootdev; static int bootdev_set; -static grub_size_t elf_sec_num, elf_sec_entsize; +static VasEBoot_size_t elf_sec_num, elf_sec_entsize; static unsigned elf_sec_shstrndx; static void *elf_sections; -grub_multiboot_quirks_t grub_multiboot_quirks; +VasEBoot_multiboot_quirks_t VasEBoot_multiboot_quirks; -static grub_err_t -load_kernel (grub_file_t file, const char *filename, +static VasEBoot_err_t +load_kernel (VasEBoot_file_t file, const char *filename, char *buffer, struct multiboot_header *header) { - grub_err_t err; + VasEBoot_err_t err; mbi_load_data_t mld; mld.file = file; @@ -80,14 +80,14 @@ load_kernel (grub_file_t file, const char *filename, mld.relocatable = 0; mld.avoid_efi_boot_services = 0; - if (grub_multiboot_quirks & GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE) + if (VasEBoot_multiboot_quirks & VasEBoot_MULTIBOOT_QUIRK_BAD_KLUDGE) { - err = grub_multiboot_load_elf (&mld); - if (err == GRUB_ERR_NONE) { - return GRUB_ERR_NONE; + err = VasEBoot_multiboot_load_elf (&mld); + if (err == VasEBoot_ERR_NONE) { + return VasEBoot_ERR_NONE; } - if (err == GRUB_ERR_UNKNOWN_OS && (header->flags & MULTIBOOT_AOUT_KLUDGE)) - grub_errno = err = GRUB_ERR_NONE; + if (err == VasEBoot_ERR_UNKNOWN_OS && (header->flags & MULTIBOOT_AOUT_KLUDGE)) + VasEBoot_errno = err = VasEBoot_ERR_NONE; } if (header->flags & MULTIBOOT_AOUT_KLUDGE) { @@ -95,47 +95,47 @@ load_kernel (grub_file_t file, const char *filename, (header->header_addr - header->load_addr)); int load_size = ((header->load_end_addr == 0) ? file->size - offset : header->load_end_addr - header->load_addr); - grub_size_t code_size; + VasEBoot_size_t code_size; void *source; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; if (header->bss_end_addr) code_size = (header->bss_end_addr - header->load_addr); else code_size = load_size; - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, + err = VasEBoot_relocator_alloc_chunk_addr (VasEBoot_multiboot_relocator, &ch, header->load_addr, code_size); if (err) { - grub_dprintf ("multiboot_loader", "Error loading aout kludge\n"); + VasEBoot_dprintf ("multiboot_loader", "Error loading aout kludge\n"); return err; } source = get_virtual_current_address (ch); - if ((grub_file_seek (file, offset)) == (grub_off_t) -1) + if ((VasEBoot_file_seek (file, offset)) == (VasEBoot_off_t) -1) { - return grub_errno; + return VasEBoot_errno; } - grub_file_read (file, source, load_size); - if (grub_errno) - return grub_errno; + VasEBoot_file_read (file, source, load_size); + if (VasEBoot_errno) + return VasEBoot_errno; if (header->bss_end_addr) - grub_memset ((grub_uint8_t *) source + load_size, 0, + VasEBoot_memset ((VasEBoot_uint8_t *) source + load_size, 0, header->bss_end_addr - header->load_addr - load_size); - grub_multiboot_payload_eip = header->entry_addr; - return GRUB_ERR_NONE; + VasEBoot_multiboot_payload_eip = header->entry_addr; + return VasEBoot_ERR_NONE; } - return grub_multiboot_load_elf (&mld); + return VasEBoot_multiboot_load_elf (&mld); } static struct multiboot_header * -find_header (char *buffer, grub_ssize_t len) +find_header (char *buffer, VasEBoot_ssize_t len) { struct multiboot_header *header; @@ -152,50 +152,50 @@ find_header (char *buffer, grub_ssize_t len) return NULL; } -grub_err_t -grub_multiboot_load (grub_file_t file, const char *filename) +VasEBoot_err_t +VasEBoot_multiboot_load (VasEBoot_file_t file, const char *filename) { char *buffer; - grub_ssize_t len; + VasEBoot_ssize_t len; struct multiboot_header *header; - grub_err_t err; + VasEBoot_err_t err; - buffer = grub_malloc (MULTIBOOT_SEARCH); + buffer = VasEBoot_malloc (MULTIBOOT_SEARCH); if (!buffer) - return grub_errno; + return VasEBoot_errno; - len = grub_file_read (file, buffer, MULTIBOOT_SEARCH); + len = VasEBoot_file_read (file, buffer, MULTIBOOT_SEARCH); if (len < 32) { - grub_free (buffer); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_free (buffer); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } - grub_tpm_measure((unsigned char*)buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename); - grub_print_error(); + VasEBoot_tpm_measure((unsigned char*)buffer, len, VasEBoot_BINARY_PCR, "VasEBoot_multiboot", filename); + VasEBoot_print_error(); header = find_header (buffer, len); if (header == 0) { - grub_free (buffer); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no multiboot header found"); + VasEBoot_free (buffer); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no multiboot header found"); } if (header->flags & UNSUPPORTED_FLAGS) { - grub_free (buffer); - return grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_free (buffer); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, "unsupported flag: 0x%x", header->flags); } err = load_kernel (file, filename, buffer, header); if (err) { - grub_free (buffer); + VasEBoot_free (buffer); return err; } @@ -204,51 +204,51 @@ grub_multiboot_load (grub_file_t file, const char *filename) switch (header->mode_type) { case 1: - err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_EGA_TEXT, - GRUB_MULTIBOOT_CONSOLE_EGA_TEXT - | GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, + err = VasEBoot_multiboot_set_console (VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT, + VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT + | VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER, 0, 0, 0, 0); break; case 0: - err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, - GRUB_MULTIBOOT_CONSOLE_EGA_TEXT - | GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, + err = VasEBoot_multiboot_set_console (VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER, + VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT + | VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER, header->width, header->height, header->depth, 0); break; default: - err = grub_error (GRUB_ERR_BAD_OS, + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, "unsupported graphical mode type %d", header->mode_type); break; } } else - err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_EGA_TEXT, - GRUB_MULTIBOOT_CONSOLE_EGA_TEXT, + err = VasEBoot_multiboot_set_console (VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT, + VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT, 0, 0, 0, 0); return err; } -#if GRUB_MACHINE_HAS_VBE || GRUB_MACHINE_HAS_VGA_TEXT -#include +#if VasEBoot_MACHINE_HAS_VBE || VasEBoot_MACHINE_HAS_VGA_TEXT +#include #endif -static grub_size_t -grub_multiboot_get_mbi_size (void) +static VasEBoot_size_t +VasEBoot_multiboot_get_mbi_size (void) { - grub_size_t ret; - struct grub_net_network_level_interface *net; + VasEBoot_size_t ret; + struct VasEBoot_net_network_level_interface *net; ret = sizeof (struct multiboot_info) + ALIGN_UP (cmdline_size, 4) + modcnt * sizeof (struct multiboot_mod_list) + total_modcmd + ALIGN_UP (sizeof(PACKAGE_STRING), 4) - + grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry) + + VasEBoot_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry) + elf_sec_entsize * elf_sec_num + 256 * sizeof (struct multiboot_color) -#if GRUB_MACHINE_HAS_VBE || GRUB_MACHINE_HAS_VGA_TEXT - + sizeof (struct grub_vbe_info_block) - + sizeof (struct grub_vbe_mode_info_block) +#if VasEBoot_MACHINE_HAS_VBE || VasEBoot_MACHINE_HAS_VGA_TEXT + + sizeof (struct VasEBoot_vbe_info_block) + + sizeof (struct VasEBoot_vbe_mode_info_block) #endif + ALIGN_UP (sizeof (struct multiboot_apm_info), 4); @@ -262,10 +262,10 @@ grub_multiboot_get_mbi_size (void) return ret; } -/* Helper for grub_fill_multiboot_mmap. */ +/* Helper for VasEBoot_fill_multiboot_mmap. */ static int -grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, void *data) +VasEBoot_fill_multiboot_mmap_iter (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { struct multiboot_mmap_entry **mmap_entry = data; @@ -280,79 +280,79 @@ grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size, /* Fill previously allocated Multiboot mmap. */ static void -grub_fill_multiboot_mmap (struct multiboot_mmap_entry *first_entry) +VasEBoot_fill_multiboot_mmap (struct multiboot_mmap_entry *first_entry) { struct multiboot_mmap_entry *mmap_entry = (struct multiboot_mmap_entry *) first_entry; - grub_mmap_iterate (grub_fill_multiboot_mmap_iter, &mmap_entry); + VasEBoot_mmap_iterate (VasEBoot_fill_multiboot_mmap_iter, &mmap_entry); } -#if GRUB_MACHINE_HAS_VBE || GRUB_MACHINE_HAS_VGA_TEXT +#if VasEBoot_MACHINE_HAS_VBE || VasEBoot_MACHINE_HAS_VGA_TEXT -static grub_err_t -fill_vbe_info (struct multiboot_info *mbi, grub_uint8_t *ptrorig, - grub_uint32_t ptrdest, int fill_generic) +static VasEBoot_err_t +fill_vbe_info (struct multiboot_info *mbi, VasEBoot_uint8_t *ptrorig, + VasEBoot_uint32_t ptrdest, int fill_generic) { - grub_uint32_t vbe_mode; - struct grub_vbe_mode_info_block *mode_info; -#if GRUB_MACHINE_HAS_VBE - grub_vbe_status_t status; - void *scratch = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_uint32_t vbe_mode; + struct VasEBoot_vbe_mode_info_block *mode_info; +#if VasEBoot_MACHINE_HAS_VBE + VasEBoot_vbe_status_t status; + void *scratch = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; - status = grub_vbe_bios_get_controller_info (scratch); - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "Can't get controller info."); + status = VasEBoot_vbe_bios_get_controller_info (scratch); + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_IO, "Can't get controller info."); mbi->vbe_control_info = ptrdest; - grub_memcpy (ptrorig, scratch, sizeof (struct grub_vbe_info_block)); - ptrorig += sizeof (struct grub_vbe_info_block); - ptrdest += sizeof (struct grub_vbe_info_block); + VasEBoot_memcpy (ptrorig, scratch, sizeof (struct VasEBoot_vbe_info_block)); + ptrorig += sizeof (struct VasEBoot_vbe_info_block); + ptrdest += sizeof (struct VasEBoot_vbe_info_block); #else mbi->vbe_control_info = 0; #endif -#if GRUB_MACHINE_HAS_VBE - status = grub_vbe_bios_get_mode (scratch); - vbe_mode = *(grub_uint32_t *) scratch; - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "can't get VBE mode"); +#if VasEBoot_MACHINE_HAS_VBE + status = VasEBoot_vbe_bios_get_mode (scratch); + vbe_mode = *(VasEBoot_uint32_t *) scratch; + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_IO, "can't get VBE mode"); #else vbe_mode = 3; #endif mbi->vbe_mode = vbe_mode; - mode_info = (struct grub_vbe_mode_info_block *) ptrorig; + mode_info = (struct VasEBoot_vbe_mode_info_block *) ptrorig; mbi->vbe_mode_info = ptrdest; /* get_mode_info isn't available for mode 3. */ if (vbe_mode == 3) { - grub_memset (mode_info, 0, sizeof (struct grub_vbe_mode_info_block)); - mode_info->memory_model = GRUB_VBE_MEMORY_MODEL_TEXT; + VasEBoot_memset (mode_info, 0, sizeof (struct VasEBoot_vbe_mode_info_block)); + mode_info->memory_model = VasEBoot_VBE_MEMORY_MODEL_TEXT; mode_info->x_resolution = 80; mode_info->y_resolution = 25; } else { -#if GRUB_MACHINE_HAS_VBE - status = grub_vbe_bios_get_mode_info (vbe_mode, scratch); - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "can't get mode info"); - grub_memcpy (mode_info, scratch, - sizeof (struct grub_vbe_mode_info_block)); +#if VasEBoot_MACHINE_HAS_VBE + status = VasEBoot_vbe_bios_get_mode_info (vbe_mode, scratch); + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_IO, "can't get mode info"); + VasEBoot_memcpy (mode_info, scratch, + sizeof (struct VasEBoot_vbe_mode_info_block)); #endif } - ptrorig += sizeof (struct grub_vbe_mode_info_block); - ptrdest += sizeof (struct grub_vbe_mode_info_block); + ptrorig += sizeof (struct VasEBoot_vbe_mode_info_block); + ptrdest += sizeof (struct VasEBoot_vbe_mode_info_block); -#if GRUB_MACHINE_HAS_VBE - grub_vbe_bios_get_pm_interface (&mbi->vbe_interface_seg, +#if VasEBoot_MACHINE_HAS_VBE + VasEBoot_vbe_bios_get_pm_interface (&mbi->vbe_interface_seg, &mbi->vbe_interface_off, &mbi->vbe_interface_len); #endif mbi->flags |= MULTIBOOT_INFO_VBE_INFO; - if (fill_generic && mode_info->memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) + if (fill_generic && mode_info->memory_model == VasEBoot_VBE_MEMORY_MODEL_TEXT) { mbi->framebuffer_addr = 0xb8000; @@ -367,43 +367,43 @@ fill_vbe_info (struct multiboot_info *mbi, grub_uint8_t *ptrorig, mbi->flags |= MULTIBOOT_INFO_FRAMEBUFFER_INFO; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static grub_err_t +static VasEBoot_err_t retrieve_video_parameters (struct multiboot_info *mbi, - grub_uint8_t *ptrorig, grub_uint32_t ptrdest) + VasEBoot_uint8_t *ptrorig, VasEBoot_uint32_t ptrdest) { - grub_err_t err; - struct grub_video_mode_info mode_info; + VasEBoot_err_t err; + struct VasEBoot_video_mode_info mode_info; void *framebuffer; - grub_video_driver_id_t driv_id; - struct grub_video_palette_data palette[256]; + VasEBoot_video_driver_id_t driv_id; + struct VasEBoot_video_palette_data palette[256]; - err = grub_multiboot_set_video_mode (); + err = VasEBoot_multiboot_set_video_mode (); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_video_get_palette (0, ARRAY_SIZE (palette), palette); + VasEBoot_video_get_palette (0, ARRAY_SIZE (palette), palette); - driv_id = grub_video_get_driver_id (); -#if GRUB_MACHINE_HAS_VGA_TEXT - if (driv_id == GRUB_VIDEO_DRIVER_NONE) + driv_id = VasEBoot_video_get_driver_id (); +#if VasEBoot_MACHINE_HAS_VGA_TEXT + if (driv_id == VasEBoot_VIDEO_DRIVER_NONE) return fill_vbe_info (mbi, ptrorig, ptrdest, 1); #else - if (driv_id == GRUB_VIDEO_DRIVER_NONE) - return GRUB_ERR_NONE; + if (driv_id == VasEBoot_VIDEO_DRIVER_NONE) + return VasEBoot_ERR_NONE; #endif - err = grub_video_get_info_and_fini (&mode_info, &framebuffer); + err = VasEBoot_video_get_info_and_fini (&mode_info, &framebuffer); if (err) return err; - mbi->framebuffer_addr = (grub_addr_t) framebuffer; + mbi->framebuffer_addr = (VasEBoot_addr_t) framebuffer; mbi->framebuffer_pitch = mode_info.pitch; mbi->framebuffer_width = mode_info.width; @@ -411,7 +411,7 @@ retrieve_video_parameters (struct multiboot_info *mbi, mbi->framebuffer_bpp = mode_info.bpp; - if (mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) { struct multiboot_color *mb_palette; unsigned i; @@ -445,35 +445,35 @@ retrieve_video_parameters (struct multiboot_info *mbi, mbi->flags |= MULTIBOOT_INFO_FRAMEBUFFER_INFO; -#if GRUB_MACHINE_HAS_VBE - if (driv_id == GRUB_VIDEO_DRIVER_VBE) +#if VasEBoot_MACHINE_HAS_VBE + if (driv_id == VasEBoot_VIDEO_DRIVER_VBE) return fill_vbe_info (mbi, ptrorig, ptrdest, 0); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_multiboot_make_mbi (grub_uint32_t *target) +VasEBoot_err_t +VasEBoot_multiboot_make_mbi (VasEBoot_uint32_t *target) { struct multiboot_info *mbi; struct multiboot_mod_list *modlist; unsigned i; struct module *cur; - grub_size_t mmap_size; - grub_uint8_t *ptrorig; - grub_addr_t ptrdest; + VasEBoot_size_t mmap_size; + VasEBoot_uint8_t *ptrorig; + VasEBoot_addr_t ptrdest; - grub_err_t err; - grub_size_t bufsize; - grub_relocator_chunk_t ch; + VasEBoot_err_t err; + VasEBoot_size_t bufsize; + VasEBoot_relocator_chunk_t ch; - bufsize = grub_multiboot_get_mbi_size (); + bufsize = VasEBoot_multiboot_get_mbi_size (); - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_multiboot_relocator, &ch, 0x10000, 0xa0000 - bufsize, bufsize, 4, - GRUB_RELOCATOR_PREFERENCE_NONE, 0); + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) return err; ptrorig = get_virtual_current_address (ch); @@ -484,24 +484,24 @@ grub_multiboot_make_mbi (grub_uint32_t *target) mbi = (struct multiboot_info *) ptrorig; ptrorig += sizeof (*mbi); ptrdest += sizeof (*mbi); - grub_memset (mbi, 0, sizeof (*mbi)); + VasEBoot_memset (mbi, 0, sizeof (*mbi)); - grub_memcpy (ptrorig, cmdline, cmdline_size); + VasEBoot_memcpy (ptrorig, cmdline, cmdline_size); mbi->flags |= MULTIBOOT_INFO_CMDLINE; mbi->cmdline = ptrdest; ptrorig += ALIGN_UP (cmdline_size, 4); ptrdest += ALIGN_UP (cmdline_size, 4); - grub_memcpy (ptrorig, PACKAGE_STRING, sizeof(PACKAGE_STRING)); + VasEBoot_memcpy (ptrorig, PACKAGE_STRING, sizeof(PACKAGE_STRING)); mbi->flags |= MULTIBOOT_INFO_BOOT_LOADER_NAME; mbi->boot_loader_name = ptrdest; ptrorig += ALIGN_UP (sizeof(PACKAGE_STRING), 4); ptrdest += ALIGN_UP (sizeof(PACKAGE_STRING), 4); -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS { - struct grub_apm_info info; - if (grub_apm_get_info (&info)) + struct VasEBoot_apm_info info; + if (VasEBoot_apm_get_info (&info)) { struct multiboot_apm_info *mbinfo = (void *) ptrorig; @@ -535,7 +535,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) modlist[i].mod_start = cur->start; modlist[i].mod_end = modlist[i].mod_start + cur->size; modlist[i].cmdline = ptrdest; - grub_memcpy (ptrorig, cur->cmdline, cur->cmdline_size); + VasEBoot_memcpy (ptrorig, cur->cmdline, cur->cmdline_size); ptrorig += ALIGN_UP (cur->cmdline_size, 4); ptrdest += ALIGN_UP (cur->cmdline_size, 4); } @@ -546,9 +546,9 @@ grub_multiboot_make_mbi (grub_uint32_t *target) mbi->mods_count = 0; } - mmap_size = grub_get_multiboot_mmap_count () + mmap_size = VasEBoot_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry); - grub_fill_multiboot_mmap ((struct multiboot_mmap_entry *) ptrorig); + VasEBoot_fill_multiboot_mmap ((struct multiboot_mmap_entry *) ptrorig); mbi->mmap_length = mmap_size; mbi->mmap_addr = ptrdest; mbi->flags |= MULTIBOOT_INFO_MEM_MAP; @@ -556,8 +556,8 @@ grub_multiboot_make_mbi (grub_uint32_t *target) ptrdest += mmap_size; /* Convert from bytes to kilobytes. */ - mbi->mem_lower = grub_mmap_get_lower () / 1024; - mbi->mem_upper = grub_mmap_get_upper () / 1024; + mbi->mem_lower = VasEBoot_mmap_get_lower () / 1024; + mbi->mem_upper = VasEBoot_mmap_get_upper () / 1024; mbi->flags |= MULTIBOOT_INFO_MEMORY; if (bootdev_set) @@ -567,11 +567,11 @@ grub_multiboot_make_mbi (grub_uint32_t *target) } { - struct grub_net_network_level_interface *net; + struct VasEBoot_net_network_level_interface *net; FOR_NET_NETWORK_LEVEL_INTERFACES(net) if (net->dhcp_ack) { - grub_memcpy (ptrorig, net->dhcp_ack, net->dhcp_acklen); + VasEBoot_memcpy (ptrorig, net->dhcp_ack, net->dhcp_acklen); mbi->drives_addr = ptrdest; mbi->drives_length = net->dhcp_acklen; ptrorig += net->dhcp_acklen; @@ -583,7 +583,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) if (elf_sec_num) { mbi->u.elf_sec.addr = ptrdest; - grub_memcpy (ptrorig, elf_sections, elf_sec_entsize * elf_sec_num); + VasEBoot_memcpy (ptrorig, elf_sections, elf_sec_entsize * elf_sec_num); mbi->u.elf_sec.num = elf_sec_num; mbi->u.elf_sec.size = elf_sec_entsize; mbi->u.elf_sec.shndx = elf_sec_shstrndx; @@ -597,8 +597,8 @@ grub_multiboot_make_mbi (grub_uint32_t *target) err = retrieve_video_parameters (mbi, ptrorig, ptrdest); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } if ((mbi->flags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) @@ -610,24 +610,24 @@ grub_multiboot_make_mbi (grub_uint32_t *target) * sizeof (struct multiboot_color); } -#if GRUB_MACHINE_HAS_VBE - ptrorig += sizeof (struct grub_vbe_info_block); - ptrdest += sizeof (struct grub_vbe_info_block); - ptrorig += sizeof (struct grub_vbe_mode_info_block); - ptrdest += sizeof (struct grub_vbe_mode_info_block); +#if VasEBoot_MACHINE_HAS_VBE + ptrorig += sizeof (struct VasEBoot_vbe_info_block); + ptrdest += sizeof (struct VasEBoot_vbe_info_block); + ptrorig += sizeof (struct VasEBoot_vbe_mode_info_block); + ptrdest += sizeof (struct VasEBoot_vbe_mode_info_block); #endif -#ifdef GRUB_MACHINE_EFI - err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); +#ifdef VasEBoot_MACHINE_EFI + err = VasEBoot_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL); if (err) return err; #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, +VasEBoot_multiboot_add_elfsyms (VasEBoot_size_t num, VasEBoot_size_t entsize, unsigned shndx, void *data) { elf_sec_num = num; @@ -637,78 +637,78 @@ grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, } void -grub_multiboot_free_mbi (void) +VasEBoot_multiboot_free_mbi (void) { struct module *cur, *next; cmdline_size = 0; total_modcmd = 0; modcnt = 0; - grub_free (cmdline); + VasEBoot_free (cmdline); cmdline = NULL; bootdev_set = 0; for (cur = modules; cur; cur = next) { next = cur->next; - grub_free (cur->cmdline); - grub_free (cur); + VasEBoot_free (cur->cmdline); + VasEBoot_free (cur); } modules = NULL; modules_last = NULL; - grub_free (elf_sections); + VasEBoot_free (elf_sections); elf_sections = NULL; elf_sec_entsize = 0; elf_sec_num = 0; } -grub_err_t -grub_multiboot_init_mbi (int argc, char *argv[]) +VasEBoot_err_t +VasEBoot_multiboot_init_mbi (int argc, char *argv[]) { - grub_ssize_t len = 0; + VasEBoot_ssize_t len = 0; - grub_multiboot_free_mbi (); + VasEBoot_multiboot_free_mbi (); - len = grub_loader_cmdline_size (argc, argv); + len = VasEBoot_loader_cmdline_size (argc, argv); - cmdline = grub_malloc (len); + cmdline = VasEBoot_malloc (len); if (! cmdline) - return grub_errno; + return VasEBoot_errno; cmdline_size = len; - grub_create_loader_cmdline (argc, argv, cmdline, + VasEBoot_create_loader_cmdline (argc, argv, cmdline, cmdline_size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_multiboot_add_module (grub_addr_t start, grub_size_t size, +VasEBoot_err_t +VasEBoot_multiboot_add_module (VasEBoot_addr_t start, VasEBoot_size_t size, int argc, char *argv[]) { struct module *newmod; - grub_size_t len = 0; + VasEBoot_size_t len = 0; - newmod = grub_malloc (sizeof (*newmod)); + newmod = VasEBoot_malloc (sizeof (*newmod)); if (!newmod) - return grub_errno; + return VasEBoot_errno; newmod->start = start; newmod->size = size; newmod->next = 0; - len = grub_loader_cmdline_size (argc, argv); + len = VasEBoot_loader_cmdline_size (argc, argv); - newmod->cmdline = grub_malloc (len); + newmod->cmdline = VasEBoot_malloc (len); if (! newmod->cmdline) { - grub_free (newmod); - return grub_errno; + VasEBoot_free (newmod); + return VasEBoot_errno; } newmod->cmdline_size = len; total_modcmd += ALIGN_UP (len, 4); - grub_create_loader_cmdline (argc, argv, newmod->cmdline, + VasEBoot_create_loader_cmdline (argc, argv, newmod->cmdline, newmod->cmdline_size); if (modules_last) @@ -719,17 +719,17 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, modcnt++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_multiboot_set_bootdev (void) +VasEBoot_multiboot_set_bootdev (void) { - grub_uint32_t biosdev, slice = ~0, part = ~0; - grub_device_t dev; + VasEBoot_uint32_t biosdev, slice = ~0, part = ~0; + VasEBoot_device_t dev; -#ifdef GRUB_MACHINE_PCBIOS - biosdev = grub_get_root_biosnumber (); +#ifdef VasEBoot_MACHINE_PCBIOS + biosdev = VasEBoot_get_root_biosnumber (); #else biosdev = 0xffffffff; #endif @@ -737,7 +737,7 @@ grub_multiboot_set_bootdev (void) if (biosdev == 0xffffffff) return; - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (dev && dev->disk && dev->disk->partition) { if (dev->disk->partition->parent) @@ -749,7 +749,7 @@ grub_multiboot_set_bootdev (void) slice = dev->disk->partition->number; } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); bootdev = ((biosdev & 0xff) << 24) | ((slice & 0xff) << 16) | ((part & 0xff) << 8) | 0xff; diff --git a/VasEBoot-core/loader/i386/pc/chainloader.c b/VasEBoot-core/loader/i386/pc/chainloader.c index c79c4fe0f..defe93fd6 100644 --- a/VasEBoot-core/loader/i386/pc/chainloader.c +++ b/VasEBoot-core/loader/i386/pc/chainloader.c @@ -1,62 +1,62 @@ /* chainloader.c - boot another boot loader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int boot_drive; -static grub_addr_t boot_part_addr; -static struct grub_relocator *rel; +static VasEBoot_addr_t boot_part_addr; +static struct VasEBoot_relocator *rel; typedef enum { - GRUB_CHAINLOADER_FORCE = 0x1, - GRUB_CHAINLOADER_BPB = 0x2, - } grub_chainloader_flags_t; + VasEBoot_CHAINLOADER_FORCE = 0x1, + VasEBoot_CHAINLOADER_BPB = 0x2, + } VasEBoot_chainloader_flags_t; -static grub_err_t -grub_chainloader_boot (void) +static VasEBoot_err_t +VasEBoot_chainloader_boot (void) { - struct grub_relocator16_state state = { + struct VasEBoot_relocator16_state state = { .edx = boot_drive, .esi = boot_part_addr, .ds = 0, @@ -65,50 +65,50 @@ grub_chainloader_boot (void) .gs = 0, .ss = 0, .cs = 0, - .sp = GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR, - .ip = GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR, + .sp = VasEBoot_MEMORY_MACHINE_BOOT_LOADER_ADDR, + .ip = VasEBoot_MEMORY_MACHINE_BOOT_LOADER_ADDR, .a20 = 0 }; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); - return grub_relocator16_boot (rel, state); + return VasEBoot_relocator16_boot (rel, state); } -static grub_err_t -grub_chainloader_unload (void) +static VasEBoot_err_t +VasEBoot_chainloader_unload (void) { - grub_relocator_unload (rel); + VasEBoot_relocator_unload (rel); rel = NULL; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } void -grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl) +VasEBoot_chainloader_patch_bpb (void *bs, VasEBoot_device_t dev, VasEBoot_uint8_t dl) { - grub_uint32_t part_start = 0; + VasEBoot_uint32_t part_start = 0; if (dev && dev->disk) - part_start = grub_partition_get_start (dev->disk->partition); - if (grub_memcmp ((char *) &((struct grub_ntfs_bpb *) bs)->oem_name, + part_start = VasEBoot_partition_get_start (dev->disk->partition); + if (VasEBoot_memcmp ((char *) &((struct VasEBoot_ntfs_bpb *) bs)->oem_name, "NTFS", 4) == 0) { - struct grub_ntfs_bpb *bpb = (struct grub_ntfs_bpb *) bs; - bpb->num_hidden_sectors = grub_cpu_to_le32 (part_start); + struct VasEBoot_ntfs_bpb *bpb = (struct VasEBoot_ntfs_bpb *) bs; + bpb->num_hidden_sectors = VasEBoot_cpu_to_le32 (part_start); bpb->bios_drive = dl; return; } do { - struct grub_fat_bpb *bpb = (struct grub_fat_bpb *) bs; - if (grub_strncmp((const char *) bpb->version_specific.fat12_or_fat16.fstype, "FAT12", 5) - && grub_strncmp((const char *) bpb->version_specific.fat12_or_fat16.fstype, "FAT16", 5) - && grub_strncmp((const char *) bpb->version_specific.fat32.fstype, "FAT32", 5)) + struct VasEBoot_fat_bpb *bpb = (struct VasEBoot_fat_bpb *) bs; + if (VasEBoot_strncmp((const char *) bpb->version_specific.fat12_or_fat16.fstype, "FAT12", 5) + && VasEBoot_strncmp((const char *) bpb->version_specific.fat12_or_fat16.fstype, "FAT16", 5) + && VasEBoot_strncmp((const char *) bpb->version_specific.fat32.fstype, "FAT32", 5)) break; - if (grub_le_to_cpu16 (bpb->bytes_per_sector) < 512 - || (grub_le_to_cpu16 (bpb->bytes_per_sector) - & (grub_le_to_cpu16 (bpb->bytes_per_sector) - 1))) + if (VasEBoot_le_to_cpu16 (bpb->bytes_per_sector) < 512 + || (VasEBoot_le_to_cpu16 (bpb->bytes_per_sector) + & (VasEBoot_le_to_cpu16 (bpb->bytes_per_sector) - 1))) break; if (bpb->sectors_per_cluster == 0 @@ -125,13 +125,13 @@ grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl) if (bpb->sectors_per_fat_16) { - bpb->num_hidden_sectors = grub_cpu_to_le32 (part_start); + bpb->num_hidden_sectors = VasEBoot_cpu_to_le32 (part_start); bpb->version_specific.fat12_or_fat16.num_ph_drive = dl; return; } if (bpb->version_specific.fat32.sectors_per_fat_32) { - bpb->num_hidden_sectors = grub_cpu_to_le32 (part_start); + bpb->num_hidden_sectors = VasEBoot_cpu_to_le32 (part_start); bpb->version_specific.fat32.num_ph_drive = dl; return; } @@ -141,37 +141,37 @@ grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl) } static void -grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) +VasEBoot_chainloader_cmd (const char *filename, VasEBoot_chainloader_flags_t flags) { - grub_file_t file = 0; - grub_uint16_t signature; - grub_device_t dev; + VasEBoot_file_t file = 0; + VasEBoot_uint16_t signature; + VasEBoot_device_t dev; int drive = -1; - grub_addr_t part_addr = 0; - grub_uint8_t *bs, *ptable; + VasEBoot_addr_t part_addr = 0; + VasEBoot_uint8_t *bs, *ptable; - rel = grub_relocator_new (); + rel = VasEBoot_relocator_new (); if (!rel) goto fail; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - grub_file_filter_disable_compression (); - file = grub_file_open (filename); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (filename); if (! file) goto fail; { - grub_relocator_chunk_t ch; - grub_err_t err; + VasEBoot_relocator_chunk_t ch; + VasEBoot_err_t err; - err = grub_relocator_alloc_chunk_addr (rel, &ch, 0x7C00, - GRUB_DISK_SECTOR_SIZE); + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, 0x7C00, + VasEBoot_DISK_SECTOR_SIZE); if (err) goto fail; bs = get_virtual_current_address (ch); - err = grub_relocator_alloc_chunk_addr (rel, &ch, - GRUB_MEMORY_MACHINE_PART_TABLE_ADDR, + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, + VasEBoot_MEMORY_MACHINE_PART_TABLE_ADDR, 64); if (err) goto fail; @@ -179,90 +179,90 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) } /* Read the first block. */ - if (grub_file_read (file, bs, GRUB_DISK_SECTOR_SIZE) - != GRUB_DISK_SECTOR_SIZE) + if (VasEBoot_file_read (file, bs, VasEBoot_DISK_SECTOR_SIZE) + != VasEBoot_DISK_SECTOR_SIZE) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); goto fail; } /* Check the signature. */ - signature = *((grub_uint16_t *) (bs + GRUB_DISK_SECTOR_SIZE - 2)); - if (signature != grub_le_to_cpu16 (0xaa55) - && ! (flags & GRUB_CHAINLOADER_FORCE)) + signature = *((VasEBoot_uint16_t *) (bs + VasEBoot_DISK_SECTOR_SIZE - 2)); + if (signature != VasEBoot_le_to_cpu16 (0xaa55) + && ! (flags & VasEBoot_CHAINLOADER_FORCE)) { - grub_error (GRUB_ERR_BAD_OS, "invalid signature"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid signature"); goto fail; } - grub_file_close (file); + VasEBoot_file_close (file); /* Obtain the partition table from the root device. */ - drive = grub_get_root_biosnumber (); - dev = grub_device_open (0); + drive = VasEBoot_get_root_biosnumber (); + dev = VasEBoot_device_open (0); if (dev && dev->disk && dev->disk->partition) { - grub_disk_t disk = dev->disk; + VasEBoot_disk_t disk = dev->disk; if (disk) { - grub_partition_t p = disk->partition; + VasEBoot_partition_t p = disk->partition; - if (p && grub_strcmp (p->partmap->name, "msdos") == 0) + if (p && VasEBoot_strcmp (p->partmap->name, "msdos") == 0) { disk->partition = p->parent; - grub_disk_read (disk, p->offset, 446, 64, ptable); - part_addr = (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR + VasEBoot_disk_read (disk, p->offset, 446, 64, ptable); + part_addr = (VasEBoot_MEMORY_MACHINE_PART_TABLE_ADDR + (p->index << 4)); disk->partition = p; } } } - if (flags & GRUB_CHAINLOADER_BPB) - grub_chainloader_patch_bpb ((void *) 0x7C00, dev, drive); + if (flags & VasEBoot_CHAINLOADER_BPB) + VasEBoot_chainloader_patch_bpb ((void *) 0x7C00, dev, drive); if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); /* Ignore errors. Perhaps it's not fatal. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; boot_drive = drive; boot_part_addr = part_addr; - grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 1); + VasEBoot_loader_set (VasEBoot_chainloader_boot, VasEBoot_chainloader_unload, 1); return; fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); } -static grub_err_t -grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_chainloader (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_chainloader_flags_t flags = 0; + VasEBoot_chainloader_flags_t flags = 0; while (argc > 0) { - if (grub_strcmp (argv[0], "--force") == 0) + if (VasEBoot_strcmp (argv[0], "--force") == 0) { - flags |= GRUB_CHAINLOADER_FORCE; + flags |= VasEBoot_CHAINLOADER_FORCE; argc--; argv++; continue; } - if (grub_strcmp (argv[0], "--bpb") == 0) + if (VasEBoot_strcmp (argv[0], "--bpb") == 0) { - flags |= GRUB_CHAINLOADER_BPB; + flags |= VasEBoot_CHAINLOADER_BPB; argc--; argv++; continue; @@ -271,24 +271,24 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), } if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_chainloader_cmd (argv[0], flags); + VasEBoot_chainloader_cmd (argv[0], flags); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(chainloader) +VasEBoot_MOD_INIT(chainloader) { - cmd = grub_register_command ("chainloader", grub_cmd_chainloader, + cmd = VasEBoot_register_command ("chainloader", VasEBoot_cmd_chainloader, N_("[--force|--bpb] FILE"), N_("Load another boot loader.")); my_mod = mod; } -GRUB_MOD_FINI(chainloader) +VasEBoot_MOD_FINI(chainloader) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/i386/pc/freedos.c b/VasEBoot-core/loader/i386/pc/freedos.c index 478f3c513..80749b4fd 100644 --- a/VasEBoot-core/loader/i386/pc/freedos.c +++ b/VasEBoot-core/loader/i386/pc/freedos.c @@ -1,190 +1,190 @@ /* chainloader.c - boot another boot loader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; -static struct grub_relocator *rel; -static grub_uint32_t ebx = 0xffffffff; +static VasEBoot_dl_t my_mod; +static struct VasEBoot_relocator *rel; +static VasEBoot_uint32_t ebx = 0xffffffff; -#define GRUB_FREEDOS_SEGMENT 0x60 -#define GRUB_FREEDOS_ADDR (GRUB_FREEDOS_SEGMENT << 4) -#define GRUB_FREEDOS_STACK_SEGMENT 0x1fe0 -#define GRUB_FREEDOS_STACK_BPB_POINTER 0x7c00 -#define GRUB_FREEDOS_BPB_ADDR ((GRUB_FREEDOS_STACK_SEGMENT << 4) \ - + GRUB_FREEDOS_STACK_BPB_POINTER) +#define VasEBoot_FREEDOS_SEGMENT 0x60 +#define VasEBoot_FREEDOS_ADDR (VasEBoot_FREEDOS_SEGMENT << 4) +#define VasEBoot_FREEDOS_STACK_SEGMENT 0x1fe0 +#define VasEBoot_FREEDOS_STACK_BPB_POINTER 0x7c00 +#define VasEBoot_FREEDOS_BPB_ADDR ((VasEBoot_FREEDOS_STACK_SEGMENT << 4) \ + + VasEBoot_FREEDOS_STACK_BPB_POINTER) /* FreeDOS boot.asm passes register sp as exactly this. Importantly, it must point below the BPB (to avoid overwriting any of it). */ -#define GRUB_FREEDOS_STACK_POINTER (GRUB_FREEDOS_STACK_BPB_POINTER \ +#define VasEBoot_FREEDOS_STACK_POINTER (VasEBoot_FREEDOS_STACK_BPB_POINTER \ - 0x60) /* In this, the additional 8192 bytes are the stack reservation; the remaining parts trivially give the maximum allowed size. */ -#define GRUB_FREEDOS_MAX_SIZE ((GRUB_FREEDOS_STACK_SEGMENT << 4) \ - + GRUB_FREEDOS_STACK_POINTER \ - - GRUB_FREEDOS_ADDR \ +#define VasEBoot_FREEDOS_MAX_SIZE ((VasEBoot_FREEDOS_STACK_SEGMENT << 4) \ + + VasEBoot_FREEDOS_STACK_POINTER \ + - VasEBoot_FREEDOS_ADDR \ - 8192) -static grub_err_t -grub_freedos_boot (void) +static VasEBoot_err_t +VasEBoot_freedos_boot (void) { - struct grub_relocator16_state state = { - .cs = GRUB_FREEDOS_SEGMENT, + struct VasEBoot_relocator16_state state = { + .cs = VasEBoot_FREEDOS_SEGMENT, .ip = 0, - .ds = GRUB_FREEDOS_STACK_SEGMENT, + .ds = VasEBoot_FREEDOS_STACK_SEGMENT, .es = 0, .fs = 0, .gs = 0, - .ss = GRUB_FREEDOS_STACK_SEGMENT, - .sp = GRUB_FREEDOS_STACK_POINTER, - .ebp = GRUB_FREEDOS_STACK_BPB_POINTER, + .ss = VasEBoot_FREEDOS_STACK_SEGMENT, + .sp = VasEBoot_FREEDOS_STACK_POINTER, + .ebp = VasEBoot_FREEDOS_STACK_BPB_POINTER, .ebx = ebx, .edx = ebx, .a20 = 1 }; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); - return grub_relocator16_boot (rel, state); + return VasEBoot_relocator16_boot (rel, state); } -static grub_err_t -grub_freedos_unload (void) +static VasEBoot_err_t +VasEBoot_freedos_unload (void) { - grub_relocator_unload (rel); + VasEBoot_relocator_unload (rel); rel = NULL; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_freedos (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_freedos (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_err_t err; void *bs, *kernelsys; - grub_size_t kernelsyssize; - grub_device_t dev; + VasEBoot_size_t kernelsyssize; + VasEBoot_device_t dev; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - rel = grub_relocator_new (); + rel = VasEBoot_relocator_new (); if (!rel) goto fail; - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (rel, &ch, GRUB_FREEDOS_BPB_ADDR, - GRUB_DISK_SECTOR_SIZE); + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, VasEBoot_FREEDOS_BPB_ADDR, + VasEBoot_DISK_SECTOR_SIZE); if (err) goto fail; bs = get_virtual_current_address (ch); } - ebx = grub_get_root_biosnumber (); - dev = grub_device_open (0); + ebx = VasEBoot_get_root_biosnumber (); + dev = VasEBoot_device_open (0); if (dev && dev->disk) { - err = grub_disk_read (dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, bs); + err = VasEBoot_disk_read (dev->disk, 0, 0, VasEBoot_DISK_SECTOR_SIZE, bs); if (err) { - grub_device_close (dev); + VasEBoot_device_close (dev); goto fail; } - grub_chainloader_patch_bpb (bs, dev, ebx); + VasEBoot_chainloader_patch_bpb (bs, dev, ebx); } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - kernelsyssize = grub_file_size (file); + kernelsyssize = VasEBoot_file_size (file); - if (kernelsyssize > GRUB_FREEDOS_MAX_SIZE) + if (kernelsyssize > VasEBoot_FREEDOS_MAX_SIZE) { - grub_error (GRUB_ERR_BAD_OS, + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("the size of `%s' is too large"), argv[0]); goto fail; } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (rel, &ch, GRUB_FREEDOS_ADDR, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, VasEBoot_FREEDOS_ADDR, kernelsyssize); if (err) goto fail; kernelsys = get_virtual_current_address (ch); } - if (grub_file_read (file, kernelsys, kernelsyssize) - != (grub_ssize_t) kernelsyssize) + if (VasEBoot_file_read (file, kernelsys, kernelsyssize) + != (VasEBoot_ssize_t) kernelsyssize) goto fail; - grub_loader_set (grub_freedos_boot, grub_freedos_unload, 1); - return GRUB_ERR_NONE; + VasEBoot_loader_set (VasEBoot_freedos_boot, VasEBoot_freedos_unload, 1); + return VasEBoot_ERR_NONE; fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_freedos_unload (); + VasEBoot_freedos_unload (); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(freedos) +VasEBoot_MOD_INIT(freedos) { - cmd = grub_register_command ("freedos", grub_cmd_freedos, + cmd = VasEBoot_register_command ("freedos", VasEBoot_cmd_freedos, 0, N_("Load FreeDOS kernel.sys.")); my_mod = mod; } -GRUB_MOD_FINI(freedos) +VasEBoot_MOD_FINI(freedos) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/i386/pc/linux.c b/VasEBoot-core/loader/i386/pc/linux.c index a20c66346..7274d95ea 100644 --- a/VasEBoot-core/loader/i386/pc/linux.c +++ b/VasEBoot-core/loader/i386/pc/linux.c @@ -1,94 +1,94 @@ /* linux.c - boot Linux zImage or bzImage */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_LINUX_CL_OFFSET 0x9000 +#define VasEBoot_LINUX_CL_OFFSET 0x9000 -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -static grub_size_t linux_mem_size; +static VasEBoot_size_t linux_mem_size; static int loaded; -static struct grub_relocator *relocator = NULL; -static grub_addr_t grub_linux_real_target; -static char *grub_linux_real_chunk; -static grub_size_t grub_linux16_prot_size; -static grub_size_t maximal_cmdline_size; +static struct VasEBoot_relocator *relocator = NULL; +static VasEBoot_addr_t VasEBoot_linux_real_target; +static char *VasEBoot_linux_real_chunk; +static VasEBoot_size_t VasEBoot_linux16_prot_size; +static VasEBoot_size_t maximal_cmdline_size; -static grub_err_t -grub_linux16_boot (void) +static VasEBoot_err_t +VasEBoot_linux16_boot (void) { - grub_uint16_t segment; - struct grub_relocator16_state state; + VasEBoot_uint16_t segment; + struct VasEBoot_relocator16_state state; - segment = grub_linux_real_target >> 4; + segment = VasEBoot_linux_real_target >> 4; state.gs = state.fs = state.es = state.ds = state.ss = segment; - state.sp = GRUB_LINUX_SETUP_STACK; + state.sp = VasEBoot_LINUX_SETUP_STACK; state.cs = segment + 0x20; state.ip = 0; state.a20 = 1; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); - grub_stop_floppy (); + VasEBoot_stop_floppy (); - return grub_relocator16_boot (relocator, state); + return VasEBoot_relocator16_boot (relocator, state); } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; - grub_relocator_unload (relocator); + VasEBoot_relocator_unload (relocator); relocator = NULL; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -target_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +target_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *result = data; - grub_uint64_t candidate; + VasEBoot_uint64_t *result = data; + VasEBoot_uint64_t candidate; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; if (addr >= 0xa0000) return 0; @@ -96,203 +96,203 @@ target_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, size = 0xa0000 - addr; /* Put the real mode part at as a high location as possible. */ - candidate = addr + size - (GRUB_LINUX_CL_OFFSET + maximal_cmdline_size); + candidate = addr + size - (VasEBoot_LINUX_CL_OFFSET + maximal_cmdline_size); /* But it must not exceed the traditional area. */ - if (candidate > GRUB_LINUX_OLD_REAL_MODE_ADDR) - candidate = GRUB_LINUX_OLD_REAL_MODE_ADDR; + if (candidate > VasEBoot_LINUX_OLD_REAL_MODE_ADDR) + candidate = VasEBoot_LINUX_OLD_REAL_MODE_ADDR; if (candidate < addr) return 0; - if (candidate > *result || *result == (grub_uint64_t) -1) + if (candidate > *result || *result == (VasEBoot_uint64_t) -1) *result = candidate; return 0; } -static grub_addr_t -grub_find_real_target (void) +static VasEBoot_addr_t +VasEBoot_find_real_target (void) { - grub_uint64_t result = (grub_uint64_t) -1; + VasEBoot_uint64_t result = (VasEBoot_uint64_t) -1; - grub_mmap_iterate (target_hook, &result); + VasEBoot_mmap_iterate (target_hook, &result); return result; } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; + VasEBoot_file_t file = 0; struct linux_kernel_header lh; - grub_uint8_t setup_sects; - grub_size_t real_size, kernel_offset = 0; - grub_ssize_t len; + VasEBoot_uint8_t setup_sects; + VasEBoot_size_t real_size, kernel_offset = 0; + VasEBoot_ssize_t len; int i; - char *grub_linux_prot_chunk; - int grub_linux_is_bzimage; - grub_addr_t grub_linux_prot_target; - grub_err_t err; - grub_uint8_t *kernel = NULL; + char *VasEBoot_linux_prot_chunk; + int VasEBoot_linux_is_bzimage; + VasEBoot_addr_t VasEBoot_linux_prot_target; + VasEBoot_err_t err; + VasEBoot_uint8_t *kernel = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; - len = grub_file_size (file); - kernel = grub_malloc (len); + len = VasEBoot_file_size (file); + kernel = VasEBoot_malloc (len); if (!kernel) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); goto fail; } - if (grub_file_read (file, kernel, len) != len) + if (VasEBoot_file_read (file, kernel, len) != len) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - grub_tpm_measure (kernel, len, GRUB_BINARY_PCR, "grub_linux16", "Kernel"); - grub_print_error(); + VasEBoot_tpm_measure (kernel, len, VasEBoot_BINARY_PCR, "VasEBoot_linux16", "Kernel"); + VasEBoot_print_error(); - grub_memcpy (&lh, kernel, sizeof (lh)); + VasEBoot_memcpy (&lh, kernel, sizeof (lh)); kernel_offset = sizeof (lh); - if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)) + if (lh.boot_flag != VasEBoot_cpu_to_le16_compile_time (0xaa55)) { - grub_error (GRUB_ERR_BAD_OS, "invalid magic number"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid magic number"); goto fail; } - if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) + if (lh.setup_sects > VasEBoot_LINUX_MAX_SETUP_SECTS) { - grub_error (GRUB_ERR_BAD_OS, "too many setup sectors"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "too many setup sectors"); goto fail; } - grub_linux_is_bzimage = 0; + VasEBoot_linux_is_bzimage = 0; setup_sects = lh.setup_sects; linux_mem_size = 0; maximal_cmdline_size = 256; - if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - && grub_le_to_cpu16 (lh.version) >= 0x0200) + if (lh.header == VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + && VasEBoot_le_to_cpu16 (lh.version) >= 0x0200) { - grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL); - lh.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; + VasEBoot_linux_is_bzimage = (lh.loadflags & VasEBoot_LINUX_FLAG_BIG_KERNEL); + lh.type_of_loader = VasEBoot_LINUX_BOOT_LOADER_TYPE; - if (grub_le_to_cpu16 (lh.version) >= 0x0206) - maximal_cmdline_size = grub_le_to_cpu32 (lh.cmdline_size) + 1; + if (VasEBoot_le_to_cpu16 (lh.version) >= 0x0206) + maximal_cmdline_size = VasEBoot_le_to_cpu32 (lh.cmdline_size) + 1; - grub_linux_real_target = grub_find_real_target (); - if (grub_linux_real_target == (grub_addr_t)-1) + VasEBoot_linux_real_target = VasEBoot_find_real_target (); + if (VasEBoot_linux_real_target == (VasEBoot_addr_t)-1) { - grub_error (GRUB_ERR_OUT_OF_RANGE, + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "no appropriate low memory found"); goto fail; } - if (grub_le_to_cpu16 (lh.version) >= 0x0201) + if (VasEBoot_le_to_cpu16 (lh.version) >= 0x0201) { - lh.heap_end_ptr = grub_cpu_to_le16_compile_time (GRUB_LINUX_HEAP_END_OFFSET); - lh.loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP; + lh.heap_end_ptr = VasEBoot_cpu_to_le16_compile_time (VasEBoot_LINUX_HEAP_END_OFFSET); + lh.loadflags |= VasEBoot_LINUX_FLAG_CAN_USE_HEAP; } - if (grub_le_to_cpu16 (lh.version) >= 0x0202) - lh.cmd_line_ptr = grub_linux_real_target + GRUB_LINUX_CL_OFFSET; + if (VasEBoot_le_to_cpu16 (lh.version) >= 0x0202) + lh.cmd_line_ptr = VasEBoot_linux_real_target + VasEBoot_LINUX_CL_OFFSET; else { - lh.cl_magic = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_MAGIC); - lh.cl_offset = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_OFFSET); - lh.setup_move_size = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_OFFSET + lh.cl_magic = VasEBoot_cpu_to_le16_compile_time (VasEBoot_LINUX_CL_MAGIC); + lh.cl_offset = VasEBoot_cpu_to_le16_compile_time (VasEBoot_LINUX_CL_OFFSET); + lh.setup_move_size = VasEBoot_cpu_to_le16_compile_time (VasEBoot_LINUX_CL_OFFSET + maximal_cmdline_size); } } else { /* Your kernel is quite old... */ - lh.cl_magic = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_MAGIC); - lh.cl_offset = grub_cpu_to_le16_compile_time (GRUB_LINUX_CL_OFFSET); + lh.cl_magic = VasEBoot_cpu_to_le16_compile_time (VasEBoot_LINUX_CL_MAGIC); + lh.cl_offset = VasEBoot_cpu_to_le16_compile_time (VasEBoot_LINUX_CL_OFFSET); - setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; + setup_sects = VasEBoot_LINUX_DEFAULT_SETUP_SECTS; - grub_linux_real_target = GRUB_LINUX_OLD_REAL_MODE_ADDR; + VasEBoot_linux_real_target = VasEBoot_LINUX_OLD_REAL_MODE_ADDR; } /* If SETUP_SECTS is not set, set it to the default (4). */ if (! setup_sects) - setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; + setup_sects = VasEBoot_LINUX_DEFAULT_SETUP_SECTS; - real_size = setup_sects << GRUB_DISK_SECTOR_BITS; - grub_linux16_prot_size = grub_file_size (file) - - real_size - GRUB_DISK_SECTOR_SIZE; + real_size = setup_sects << VasEBoot_DISK_SECTOR_BITS; + VasEBoot_linux16_prot_size = VasEBoot_file_size (file) + - real_size - VasEBoot_DISK_SECTOR_SIZE; - if (! grub_linux_is_bzimage - && GRUB_LINUX_ZIMAGE_ADDR + grub_linux16_prot_size - > grub_linux_real_target) + if (! VasEBoot_linux_is_bzimage + && VasEBoot_LINUX_ZIMAGE_ADDR + VasEBoot_linux16_prot_size + > VasEBoot_linux_real_target) { - grub_error (GRUB_ERR_BAD_OS, "too big zImage (0x%x > 0x%x), use bzImage instead", - (char *) GRUB_LINUX_ZIMAGE_ADDR + grub_linux16_prot_size, - (grub_size_t) grub_linux_real_target); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "too big zImage (0x%x > 0x%x), use bzImage instead", + (char *) VasEBoot_LINUX_ZIMAGE_ADDR + VasEBoot_linux16_prot_size, + (VasEBoot_size_t) VasEBoot_linux_real_target); goto fail; } - grub_dprintf ("linux", "[Linux-%s, setup=0x%x, size=0x%x]\n", - grub_linux_is_bzimage ? "bzImage" : "zImage", + VasEBoot_dprintf ("linux", "[Linux-%s, setup=0x%x, size=0x%x]\n", + VasEBoot_linux_is_bzimage ? "bzImage" : "zImage", (unsigned) real_size, - (unsigned) grub_linux16_prot_size); + (unsigned) VasEBoot_linux16_prot_size); - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) goto fail; for (i = 1; i < argc; i++) - if (grub_memcmp (argv[i], "vga=", 4) == 0) + if (VasEBoot_memcmp (argv[i], "vga=", 4) == 0) { /* Video mode selection support. */ - grub_uint16_t vid_mode; + VasEBoot_uint16_t vid_mode; char *val = argv[i] + 4; - if (grub_strcmp (val, "normal") == 0) - vid_mode = GRUB_LINUX_VID_MODE_NORMAL; - else if (grub_strcmp (val, "ext") == 0) - vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; - else if (grub_strcmp (val, "ask") == 0) - vid_mode = GRUB_LINUX_VID_MODE_ASK; + if (VasEBoot_strcmp (val, "normal") == 0) + vid_mode = VasEBoot_LINUX_VID_MODE_NORMAL; + else if (VasEBoot_strcmp (val, "ext") == 0) + vid_mode = VasEBoot_LINUX_VID_MODE_EXTENDED; + else if (VasEBoot_strcmp (val, "ask") == 0) + vid_mode = VasEBoot_LINUX_VID_MODE_ASK; else - vid_mode = (grub_uint16_t) grub_strtoul (val, 0, 0); + vid_mode = (VasEBoot_uint16_t) VasEBoot_strtoul (val, 0, 0); - if (grub_errno) + if (VasEBoot_errno) goto fail; - lh.vid_mode = grub_cpu_to_le16 (vid_mode); + lh.vid_mode = VasEBoot_cpu_to_le16 (vid_mode); } - else if (grub_memcmp (argv[i], "mem=", 4) == 0) + else if (VasEBoot_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; - linux_mem_size = grub_strtoul (val, &val, 0); + linux_mem_size = VasEBoot_strtoul (val, &val, 0); - if (grub_errno) + if (VasEBoot_errno) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; linux_mem_size = 0; } else { int shift = 0; - switch (grub_tolower (val[0])) + switch (VasEBoot_tolower (val[0])) { case 'g': shift += 10; @@ -316,129 +316,129 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - grub_linux_real_target, - GRUB_LINUX_CL_OFFSET + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_linux_real_target, + VasEBoot_LINUX_CL_OFFSET + maximal_cmdline_size); if (err) return err; - grub_linux_real_chunk = get_virtual_current_address (ch); + VasEBoot_linux_real_chunk = get_virtual_current_address (ch); } /* Put the real mode code at the temporary address. */ - grub_memmove (grub_linux_real_chunk, &lh, sizeof (lh)); + VasEBoot_memmove (VasEBoot_linux_real_chunk, &lh, sizeof (lh)); - len = real_size + GRUB_DISK_SECTOR_SIZE - sizeof (lh); - grub_memcpy (grub_linux_real_chunk + sizeof (lh), kernel + kernel_offset, + len = real_size + VasEBoot_DISK_SECTOR_SIZE - sizeof (lh); + VasEBoot_memcpy (VasEBoot_linux_real_chunk + sizeof (lh), kernel + kernel_offset, len); kernel_offset += len; - if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - || grub_le_to_cpu16 (lh.version) < 0x0200) + if (lh.header != VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + || VasEBoot_le_to_cpu16 (lh.version) < 0x0200) /* Clear the heap space. */ - grub_memset (grub_linux_real_chunk - + ((setup_sects + 1) << GRUB_DISK_SECTOR_BITS), + VasEBoot_memset (VasEBoot_linux_real_chunk + + ((setup_sects + 1) << VasEBoot_DISK_SECTOR_BITS), 0, - ((GRUB_LINUX_MAX_SETUP_SECTS - setup_sects - 1) - << GRUB_DISK_SECTOR_BITS)); + ((VasEBoot_LINUX_MAX_SETUP_SECTS - setup_sects - 1) + << VasEBoot_DISK_SECTOR_BITS)); /* Create kernel command line. */ - grub_memcpy ((char *)grub_linux_real_chunk + GRUB_LINUX_CL_OFFSET, + VasEBoot_memcpy ((char *)VasEBoot_linux_real_chunk + VasEBoot_LINUX_CL_OFFSET, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, - (char *)grub_linux_real_chunk - + GRUB_LINUX_CL_OFFSET + sizeof (LINUX_IMAGE) - 1, + VasEBoot_create_loader_cmdline (argc, argv, + (char *)VasEBoot_linux_real_chunk + + VasEBoot_LINUX_CL_OFFSET + sizeof (LINUX_IMAGE) - 1, maximal_cmdline_size - (sizeof (LINUX_IMAGE) - 1)); - if (grub_linux_is_bzimage) - grub_linux_prot_target = GRUB_LINUX_BZIMAGE_ADDR; + if (VasEBoot_linux_is_bzimage) + VasEBoot_linux_prot_target = VasEBoot_LINUX_BZIMAGE_ADDR; else - grub_linux_prot_target = GRUB_LINUX_ZIMAGE_ADDR; + VasEBoot_linux_prot_target = VasEBoot_LINUX_ZIMAGE_ADDR; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - grub_linux_prot_target, - grub_linux16_prot_size); + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_linux_prot_target, + VasEBoot_linux16_prot_size); if (err) return err; - grub_linux_prot_chunk = get_virtual_current_address (ch); + VasEBoot_linux_prot_chunk = get_virtual_current_address (ch); } - len = grub_linux16_prot_size; - grub_memcpy (grub_linux_prot_chunk, kernel + kernel_offset, len); + len = VasEBoot_linux16_prot_size; + VasEBoot_memcpy (VasEBoot_linux_prot_chunk, kernel + kernel_offset, len); kernel_offset += len; - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - grub_loader_set (grub_linux16_boot, grub_linux_unload, 0); + VasEBoot_loader_set (VasEBoot_linux16_boot, VasEBoot_linux_unload, 0); loaded = 1; } fail: - grub_free (kernel); + VasEBoot_free (kernel); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; - grub_relocator_unload (relocator); + VasEBoot_relocator_unload (relocator); } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0; - grub_addr_t addr_max, addr_min; + VasEBoot_size_t size = 0; + VasEBoot_addr_t addr_max, addr_min; struct linux_kernel_header *lh; - grub_uint8_t *initrd_chunk; - grub_addr_t initrd_addr; - grub_err_t err; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + VasEBoot_uint8_t *initrd_chunk; + VasEBoot_addr_t initrd_addr; + VasEBoot_err_t err; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - lh = (struct linux_kernel_header *) grub_linux_real_chunk; + lh = (struct linux_kernel_header *) VasEBoot_linux_real_chunk; - if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - && grub_le_to_cpu16 (lh->version) >= 0x0200)) + if (!(lh->header == VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + && VasEBoot_le_to_cpu16 (lh->version) >= 0x0200)) { - grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "the kernel is too old for initrd"); goto fail; } /* Get the highest address available for the initrd. */ - if (grub_le_to_cpu16 (lh->version) >= 0x0203) + if (VasEBoot_le_to_cpu16 (lh->version) >= 0x0203) { - addr_max = grub_cpu_to_le32 (lh->initrd_addr_max); + addr_max = VasEBoot_cpu_to_le32 (lh->initrd_addr_max); /* XXX in reality, Linux specifies a bogus value, so it is necessary to make sure that ADDR_MAX does not exceed 0x3fffffff. */ - if (addr_max > GRUB_LINUX_INITRD_MAX_ADDRESS) - addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; + if (addr_max > VasEBoot_LINUX_INITRD_MAX_ADDRESS) + addr_max = VasEBoot_LINUX_INITRD_MAX_ADDRESS; } else - addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; + addr_max = VasEBoot_LINUX_INITRD_MAX_ADDRESS; if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; @@ -449,52 +449,52 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), worse than that of Linux 2.3.xx, so avoid the last 64kb. */ addr_max -= 0x10000; - addr_min = GRUB_LINUX_BZIMAGE_ADDR + grub_linux16_prot_size; + addr_min = VasEBoot_LINUX_BZIMAGE_ADDR + VasEBoot_linux16_prot_size; - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, addr_min, addr_max - size, size, 0x1000, - GRUB_RELOCATOR_PREFERENCE_HIGH, 0); + VasEBoot_RELOCATOR_PREFERENCE_HIGH, 0); if (err) return err; initrd_chunk = get_virtual_current_address (ch); initrd_addr = get_physical_target_address (ch); } - if (grub_initrd_load (&initrd_ctx, argv, initrd_chunk)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, initrd_chunk)) goto fail; lh->ramdisk_image = initrd_addr; lh->ramdisk_size = size; fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linux16) +VasEBoot_MOD_INIT(linux16) { cmd_linux = - grub_register_command ("linux16", grub_cmd_linux, + VasEBoot_register_command ("linux16", VasEBoot_cmd_linux, 0, N_("Load Linux.")); cmd_initrd = - grub_register_command ("initrd16", grub_cmd_initrd, + VasEBoot_register_command ("initrd16", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI(linux16) +VasEBoot_MOD_FINI(linux16) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/i386/pc/ntldr.c b/VasEBoot-core/loader/i386/pc/ntldr.c index 1b88f40d8..bced2e14d 100644 --- a/VasEBoot-core/loader/i386/pc/ntldr.c +++ b/VasEBoot-core/loader/i386/pc/ntldr.c @@ -1,52 +1,52 @@ /* chainloader.c - boot another boot loader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; -static struct grub_relocator *rel; -static grub_uint32_t edx = 0xffffffff; +static VasEBoot_dl_t my_mod; +static struct VasEBoot_relocator *rel; +static VasEBoot_uint32_t edx = 0xffffffff; -#define GRUB_NTLDR_SEGMENT 0x2000 +#define VasEBoot_NTLDR_SEGMENT 0x2000 -static grub_err_t -grub_ntldr_boot (void) +static VasEBoot_err_t +VasEBoot_ntldr_boot (void) { - struct grub_relocator16_state state = { - .cs = GRUB_NTLDR_SEGMENT, + struct VasEBoot_relocator16_state state = { + .cs = VasEBoot_NTLDR_SEGMENT, .ip = 0, .ds = 0, .es = 0, @@ -57,106 +57,106 @@ grub_ntldr_boot (void) .edx = edx, .a20 = 1 }; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); - return grub_relocator16_boot (rel, state); + return VasEBoot_relocator16_boot (rel, state); } -static grub_err_t -grub_ntldr_unload (void) +static VasEBoot_err_t +VasEBoot_ntldr_unload (void) { - grub_relocator_unload (rel); + VasEBoot_relocator_unload (rel); rel = NULL; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_ntldr (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_ntldr (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_err_t err; void *bs, *ntldr; - grub_size_t ntldrsize; - grub_device_t dev; + VasEBoot_size_t ntldrsize; + VasEBoot_device_t dev; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - rel = grub_relocator_new (); + rel = VasEBoot_relocator_new (); if (!rel) goto fail; - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (rel, &ch, 0x7C00, - GRUB_DISK_SECTOR_SIZE); + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, 0x7C00, + VasEBoot_DISK_SECTOR_SIZE); if (err) goto fail; bs = get_virtual_current_address (ch); } - edx = grub_get_root_biosnumber (); - dev = grub_device_open (0); + edx = VasEBoot_get_root_biosnumber (); + dev = VasEBoot_device_open (0); if (dev && dev->disk) { - err = grub_disk_read (dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, bs); + err = VasEBoot_disk_read (dev->disk, 0, 0, VasEBoot_DISK_SECTOR_SIZE, bs); if (err) { - grub_device_close (dev); + VasEBoot_device_close (dev); goto fail; } - grub_chainloader_patch_bpb (bs, dev, edx); + VasEBoot_chainloader_patch_bpb (bs, dev, edx); } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - ntldrsize = grub_file_size (file); + ntldrsize = VasEBoot_file_size (file); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (rel, &ch, GRUB_NTLDR_SEGMENT << 4, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, VasEBoot_NTLDR_SEGMENT << 4, ntldrsize); if (err) goto fail; ntldr = get_virtual_current_address (ch); } - if (grub_file_read (file, ntldr, ntldrsize) - != (grub_ssize_t) ntldrsize) + if (VasEBoot_file_read (file, ntldr, ntldrsize) + != (VasEBoot_ssize_t) ntldrsize) goto fail; - grub_loader_set (grub_ntldr_boot, grub_ntldr_unload, 1); - return GRUB_ERR_NONE; + VasEBoot_loader_set (VasEBoot_ntldr_boot, VasEBoot_ntldr_unload, 1); + return VasEBoot_ERR_NONE; fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_ntldr_unload (); + VasEBoot_ntldr_unload (); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(ntldr) +VasEBoot_MOD_INIT(ntldr) { - cmd = grub_register_command ("ntldr", grub_cmd_ntldr, + cmd = VasEBoot_register_command ("ntldr", VasEBoot_cmd_ntldr, 0, N_("Load NTLDR or BootMGR.")); my_mod = mod; } -GRUB_MOD_FINI(ntldr) +VasEBoot_MOD_FINI(ntldr) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/i386/pc/plan9.c b/VasEBoot-core/loader/i386/pc/plan9.c index 814a49d50..f7fbb54f6 100644 --- a/VasEBoot-core/loader/i386/pc/plan9.c +++ b/VasEBoot-core/loader/i386/pc/plan9.c @@ -1,83 +1,83 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; -static struct grub_relocator *rel; -static grub_uint32_t eip = 0xffffffff; +static VasEBoot_dl_t my_mod; +static struct VasEBoot_relocator *rel; +static VasEBoot_uint32_t eip = 0xffffffff; -#define GRUB_PLAN9_TARGET 0x100000 -#define GRUB_PLAN9_ALIGN 4096 -#define GRUB_PLAN9_CONFIG_ADDR 0x001200 -#define GRUB_PLAN9_CONFIG_PATH_SIZE 0x000040 -#define GRUB_PLAN9_CONFIG_MAGIC "ZORT 0\r\n" +#define VasEBoot_PLAN9_TARGET 0x100000 +#define VasEBoot_PLAN9_ALIGN 4096 +#define VasEBoot_PLAN9_CONFIG_ADDR 0x001200 +#define VasEBoot_PLAN9_CONFIG_PATH_SIZE 0x000040 +#define VasEBoot_PLAN9_CONFIG_MAGIC "ZORT 0\r\n" -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { - {"map", 'm', GRUB_ARG_OPTION_REPEATABLE, - /* TRANSLATORS: it's about guessing which GRUB disk + {"map", 'm', VasEBoot_ARG_OPTION_REPEATABLE, + /* TRANSLATORS: it's about guessing which VasEBoot disk is which Plan9 disk. If your language has no word "mapping" you can use another word which - means that the GRUBDEVICE and PLAN9DEVICE are + means that the VasEBootDEVICE and PLAN9DEVICE are actually the same device, just named differently - in OS and GRUB. */ + in OS and VasEBoot. */ N_("Override guessed mapping of Plan9 devices."), - N_("GRUBDEVICE=PLAN9DEVICE"), + N_("VasEBootDEVICE=PLAN9DEVICE"), ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; -struct grub_plan9_header +struct VasEBoot_plan9_header { - grub_uint32_t magic; -#define GRUB_PLAN9_MAGIC 0x1eb - grub_uint32_t text_size; - grub_uint32_t data_size; - grub_uint32_t bss_size; - grub_uint32_t sectiona; - grub_uint32_t entry_addr; - grub_uint32_t zero; - grub_uint32_t sectionb; + VasEBoot_uint32_t magic; +#define VasEBoot_PLAN9_MAGIC 0x1eb + VasEBoot_uint32_t text_size; + VasEBoot_uint32_t data_size; + VasEBoot_uint32_t bss_size; + VasEBoot_uint32_t sectiona; + VasEBoot_uint32_t entry_addr; + VasEBoot_uint32_t zero; + VasEBoot_uint32_t sectionb; }; -static grub_err_t -grub_plan9_boot (void) +static VasEBoot_err_t +VasEBoot_plan9_boot (void) { - struct grub_relocator32_state state = { + struct VasEBoot_relocator32_state state = { .eax = 0, .eip = eip, .ebx = 0, @@ -88,28 +88,28 @@ grub_plan9_boot (void) .ebp = 0, .esi = 0 }; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); - return grub_relocator32_boot (rel, state, 0); + return VasEBoot_relocator32_boot (rel, state, 0); } -static grub_err_t -grub_plan9_unload (void) +static VasEBoot_err_t +VasEBoot_plan9_unload (void) { - grub_relocator_unload (rel); + VasEBoot_relocator_unload (rel); rel = NULL; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -/* Context for grub_cmd_plan9. */ -struct grub_cmd_plan9_ctx +/* Context for VasEBoot_cmd_plan9. */ +struct VasEBoot_cmd_plan9_ctx { - grub_extcmd_context_t ctxt; - grub_file_t file; + VasEBoot_extcmd_context_t ctxt; + VasEBoot_file_t file; char *pmap; - grub_size_t pmapalloc; - grub_size_t pmapptr; + VasEBoot_size_t pmapalloc; + VasEBoot_size_t pmapptr; int noslash; int prefixescnt[5]; char *bootdisk, *bootpart; @@ -119,34 +119,34 @@ static const char prefixes[5][10] = { "dos", "plan9", "ntfs", "linux", "linuxswap" }; -#include +#include -static inline grub_err_t -grub_extend_alloc (grub_size_t sz, grub_size_t *allocated, char **ptr) +static inline VasEBoot_err_t +VasEBoot_extend_alloc (VasEBoot_size_t sz, VasEBoot_size_t *allocated, char **ptr) { void *n; if (sz < *allocated) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; *allocated = 2 * sz; - n = grub_realloc (*ptr, *allocated); + n = VasEBoot_realloc (*ptr, *allocated); if (!n) - return grub_errno; + return VasEBoot_errno; *ptr = n; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Helper for grub_cmd_plan9. */ +/* Helper for VasEBoot_cmd_plan9. */ static int -fill_partition (grub_disk_t disk, const grub_partition_t partition, void *data) +fill_partition (VasEBoot_disk_t disk, const VasEBoot_partition_t partition, void *data) { - struct grub_cmd_plan9_ctx *fill_ctx = data; + struct VasEBoot_cmd_plan9_ctx *fill_ctx = data; int file_disk = 0; int pstart, pend; if (!fill_ctx->noslash) { - if (grub_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, + if (VasEBoot_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, &fill_ctx->pmap)) return 1; fill_ctx->pmap[fill_ctx->pmapptr++] = '/'; @@ -158,17 +158,17 @@ fill_partition (grub_disk_t disk, const grub_partition_t partition, void *data) && disk->dev->id == fill_ctx->file->device->disk->dev->id; pstart = fill_ctx->pmapptr; - if (grub_strcmp (partition->partmap->name, "plan") == 0) + if (VasEBoot_strcmp (partition->partmap->name, "plan") == 0) { unsigned ptr = partition->index + sizeof ("part ") - 1; - grub_err_t err; + VasEBoot_err_t err; disk->partition = partition->parent; do { - if (grub_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, + if (VasEBoot_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, &fill_ctx->pmap)) return 1; - err = grub_disk_read (disk, 1, ptr, 1, + err = VasEBoot_disk_read (disk, 1, ptr, 1, fill_ctx->pmap + fill_ctx->pmapptr); if (err) { @@ -178,90 +178,90 @@ fill_partition (grub_disk_t disk, const grub_partition_t partition, void *data) ptr++; fill_ctx->pmapptr++; } - while (grub_isalpha (fill_ctx->pmap[fill_ctx->pmapptr - 1]) - || grub_isdigit (fill_ctx->pmap[fill_ctx->pmapptr - 1])); + while (VasEBoot_isalpha (fill_ctx->pmap[fill_ctx->pmapptr - 1]) + || VasEBoot_isdigit (fill_ctx->pmap[fill_ctx->pmapptr - 1])); fill_ctx->pmapptr--; } else { char name[50]; int c = 0; - if (grub_strcmp (partition->partmap->name, "msdos") == 0) + if (VasEBoot_strcmp (partition->partmap->name, "msdos") == 0) { switch (partition->msdostype) { - case GRUB_PC_PARTITION_TYPE_PLAN9: + case VasEBoot_PC_PARTITION_TYPE_PLAN9: c = 1; break; - case GRUB_PC_PARTITION_TYPE_NTFS: + case VasEBoot_PC_PARTITION_TYPE_NTFS: c = 2; break; - case GRUB_PC_PARTITION_TYPE_MINIX: - case GRUB_PC_PARTITION_TYPE_LINUX_MINIX: - case GRUB_PC_PARTITION_TYPE_EXT2FS: + case VasEBoot_PC_PARTITION_TYPE_MINIX: + case VasEBoot_PC_PARTITION_TYPE_LINUX_MINIX: + case VasEBoot_PC_PARTITION_TYPE_EXT2FS: c = 3; break; - case GRUB_PC_PARTITION_TYPE_LINUX_SWAP: + case VasEBoot_PC_PARTITION_TYPE_LINUX_SWAP: c = 4; break; } } if (fill_ctx->prefixescnt[c] == 0) - grub_strcpy (name, prefixes[c]); + VasEBoot_strcpy (name, prefixes[c]); else - grub_snprintf (name, sizeof (name), "%s.%d", prefixes[c], + VasEBoot_snprintf (name, sizeof (name), "%s.%d", prefixes[c], fill_ctx->prefixescnt[c]); fill_ctx->prefixescnt[c]++; - if (grub_extend_alloc (fill_ctx->pmapptr + grub_strlen (name) + 1, + if (VasEBoot_extend_alloc (fill_ctx->pmapptr + VasEBoot_strlen (name) + 1, &fill_ctx->pmapalloc, &fill_ctx->pmap)) return 1; - grub_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, name); - fill_ctx->pmapptr += grub_strlen (name); + VasEBoot_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, name); + fill_ctx->pmapptr += VasEBoot_strlen (name); } pend = fill_ctx->pmapptr; - if (grub_extend_alloc (fill_ctx->pmapptr + 2 + 25 + 5 + 25, + if (VasEBoot_extend_alloc (fill_ctx->pmapptr + 2 + 25 + 5 + 25, &fill_ctx->pmapalloc, &fill_ctx->pmap)) return 1; fill_ctx->pmap[fill_ctx->pmapptr++] = ' '; - grub_snprintf (fill_ctx->pmap + fill_ctx->pmapptr, 25 + 5 + 25, - "%" PRIuGRUB_UINT64_T " %" PRIuGRUB_UINT64_T, - grub_partition_get_start (partition), - grub_partition_get_start (partition) - + grub_partition_get_len (partition)); - if (file_disk && grub_partition_get_start (partition) - == grub_partition_get_start (fill_ctx->file->device->disk->partition) - && grub_partition_get_len (partition) - == grub_partition_get_len (fill_ctx->file->device->disk->partition)) + VasEBoot_snprintf (fill_ctx->pmap + fill_ctx->pmapptr, 25 + 5 + 25, + "%" PRIuVasEBoot_UINT64_T " %" PRIuVasEBoot_UINT64_T, + VasEBoot_partition_get_start (partition), + VasEBoot_partition_get_start (partition) + + VasEBoot_partition_get_len (partition)); + if (file_disk && VasEBoot_partition_get_start (partition) + == VasEBoot_partition_get_start (fill_ctx->file->device->disk->partition) + && VasEBoot_partition_get_len (partition) + == VasEBoot_partition_get_len (fill_ctx->file->device->disk->partition)) { - grub_free (fill_ctx->bootpart); - fill_ctx->bootpart = grub_strndup (fill_ctx->pmap + pstart, + VasEBoot_free (fill_ctx->bootpart); + fill_ctx->bootpart = VasEBoot_strndup (fill_ctx->pmap + pstart, pend - pstart); } - fill_ctx->pmapptr += grub_strlen (fill_ctx->pmap + fill_ctx->pmapptr); + fill_ctx->pmapptr += VasEBoot_strlen (fill_ctx->pmap + fill_ctx->pmapptr); return 0; } -/* Helper for grub_cmd_plan9. */ +/* Helper for VasEBoot_cmd_plan9. */ static int fill_disk (const char *name, void *data) { - struct grub_cmd_plan9_ctx *fill_ctx = data; - grub_device_t dev; + struct VasEBoot_cmd_plan9_ctx *fill_ctx = data; + VasEBoot_device_t dev; char *plan9name = NULL; unsigned i; int file_disk = 0; - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (!dev) { - grub_print_error (); + VasEBoot_print_error (); return 0; } if (!dev->disk) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } file_disk = fill_ctx->file->device->disk @@ -269,125 +269,125 @@ fill_disk (const char *name, void *data) && dev->disk->dev->id == fill_ctx->file->device->disk->dev->id; for (i = 0; fill_ctx->ctxt->state[0].args && fill_ctx->ctxt->state[0].args[i]; i++) - if (grub_strncmp (name, fill_ctx->ctxt->state[0].args[i], - grub_strlen (name)) == 0 - && fill_ctx->ctxt->state[0].args[i][grub_strlen (name)] == '=') + if (VasEBoot_strncmp (name, fill_ctx->ctxt->state[0].args[i], + VasEBoot_strlen (name)) == 0 + && fill_ctx->ctxt->state[0].args[i][VasEBoot_strlen (name)] == '=') break; if (fill_ctx->ctxt->state[0].args && fill_ctx->ctxt->state[0].args[i]) - plan9name = grub_strdup (fill_ctx->ctxt->state[0].args[i] - + grub_strlen (name) + 1); + plan9name = VasEBoot_strdup (fill_ctx->ctxt->state[0].args[i] + + VasEBoot_strlen (name) + 1); else switch (dev->disk->dev->id) { - case GRUB_DISK_DEVICE_BIOSDISK_ID: + case VasEBoot_DISK_DEVICE_BIOSDISK_ID: if (dev->disk->id & 0x80) - plan9name = grub_xasprintf ("sdB%u", + plan9name = VasEBoot_xasprintf ("sdB%u", (unsigned) (dev->disk->id & 0x7f)); else - plan9name = grub_xasprintf ("fd%u", + plan9name = VasEBoot_xasprintf ("fd%u", (unsigned) (dev->disk->id & 0x7f)); break; /* Shouldn't happen as Plan9 doesn't work on these platforms. */ - case GRUB_DISK_DEVICE_OFDISK_ID: - case GRUB_DISK_DEVICE_EFIDISK_ID: + case VasEBoot_DISK_DEVICE_OFDISK_ID: + case VasEBoot_DISK_DEVICE_EFIDISK_ID: /* Plan9 doesn't see those. */ default: /* Not sure how to handle those. */ - case GRUB_DISK_DEVICE_NAND_ID: + case VasEBoot_DISK_DEVICE_NAND_ID: if (!file_disk) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } /* if it's the disk the kernel is loaded from we need to name it nevertheless. */ - plan9name = grub_strdup ("sdZ0"); + plan9name = VasEBoot_strdup ("sdZ0"); break; - case GRUB_DISK_DEVICE_ATA_ID: + case VasEBoot_DISK_DEVICE_ATA_ID: { unsigned unit; - if (grub_strlen (dev->disk->name) < sizeof ("ata0") - 1) + if (VasEBoot_strlen (dev->disk->name) < sizeof ("ata0") - 1) unit = 0; else - unit = grub_strtoul (dev->disk->name + sizeof ("ata0") - 1, 0, 0); - plan9name = grub_xasprintf ("sd%c%d", 'C' + unit / 2, unit % 2); + unit = VasEBoot_strtoul (dev->disk->name + sizeof ("ata0") - 1, 0, 0); + plan9name = VasEBoot_xasprintf ("sd%c%d", 'C' + unit / 2, unit % 2); } break; - case GRUB_DISK_DEVICE_SCSI_ID: - if (((dev->disk->id >> GRUB_SCSI_ID_SUBSYSTEM_SHIFT) & 0xff) - == GRUB_SCSI_SUBSYSTEM_PATA) + case VasEBoot_DISK_DEVICE_SCSI_ID: + if (((dev->disk->id >> VasEBoot_SCSI_ID_SUBSYSTEM_SHIFT) & 0xff) + == VasEBoot_SCSI_SUBSYSTEM_PATA) { unsigned unit; - if (grub_strlen (dev->disk->name) < sizeof ("ata0") - 1) + if (VasEBoot_strlen (dev->disk->name) < sizeof ("ata0") - 1) unit = 0; else - unit = grub_strtoul (dev->disk->name + sizeof ("ata0") - 1, + unit = VasEBoot_strtoul (dev->disk->name + sizeof ("ata0") - 1, 0, 0); - plan9name = grub_xasprintf ("sd%c%d", 'C' + unit / 2, unit % 2); + plan9name = VasEBoot_xasprintf ("sd%c%d", 'C' + unit / 2, unit % 2); break; } /* FIXME: how does Plan9 number controllers? We probably need save the SCSI devices and sort them */ plan9name - = grub_xasprintf ("sd0%u", (unsigned) - ((dev->disk->id >> GRUB_SCSI_ID_BUS_SHIFT) + = VasEBoot_xasprintf ("sd0%u", (unsigned) + ((dev->disk->id >> VasEBoot_SCSI_ID_BUS_SHIFT) & 0xf)); break; } if (!plan9name) { - grub_print_error (); - grub_device_close (dev); + VasEBoot_print_error (); + VasEBoot_device_close (dev); return 0; } - if (grub_extend_alloc (fill_ctx->pmapptr + grub_strlen (plan9name) + if (VasEBoot_extend_alloc (fill_ctx->pmapptr + VasEBoot_strlen (plan9name) + sizeof ("part="), &fill_ctx->pmapalloc, &fill_ctx->pmap)) { - grub_free (plan9name); - grub_device_close (dev); + VasEBoot_free (plan9name); + VasEBoot_device_close (dev); return 1; } - grub_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, plan9name); - fill_ctx->pmapptr += grub_strlen (plan9name); + VasEBoot_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, plan9name); + fill_ctx->pmapptr += VasEBoot_strlen (plan9name); if (!file_disk) - grub_free (plan9name); + VasEBoot_free (plan9name); else { - grub_free (fill_ctx->bootdisk); + VasEBoot_free (fill_ctx->bootdisk); fill_ctx->bootdisk = plan9name; } - grub_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, "part="); + VasEBoot_strcpy (fill_ctx->pmap + fill_ctx->pmapptr, "part="); fill_ctx->pmapptr += sizeof ("part=") - 1; fill_ctx->noslash = 1; - grub_memset (fill_ctx->prefixescnt, 0, sizeof (fill_ctx->prefixescnt)); - if (grub_partition_iterate (dev->disk, fill_partition, fill_ctx)) + VasEBoot_memset (fill_ctx->prefixescnt, 0, sizeof (fill_ctx->prefixescnt)); + if (VasEBoot_partition_iterate (dev->disk, fill_partition, fill_ctx)) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 1; } - if (grub_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, + if (VasEBoot_extend_alloc (fill_ctx->pmapptr + 1, &fill_ctx->pmapalloc, &fill_ctx->pmap)) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 1; } fill_ctx->pmap[fill_ctx->pmapptr++] = '\n'; - grub_device_close (dev); + VasEBoot_device_close (dev); return 0; } -static grub_err_t -grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[]) +static VasEBoot_err_t +VasEBoot_cmd_plan9 (VasEBoot_extcmd_context_t ctxt, int argc, char *argv[]) { - struct grub_cmd_plan9_ctx fill_ctx = { + struct VasEBoot_cmd_plan9_ctx fill_ctx = { .ctxt = ctxt, .file = 0, .pmap = NULL, @@ -398,39 +398,39 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[]) .bootpart = NULL }; void *mem; - grub_size_t memsize, padsize; - struct grub_plan9_header hdr; + VasEBoot_size_t memsize, padsize; + struct VasEBoot_plan9_header hdr; char *config, *configptr; - grub_size_t configsize; + VasEBoot_size_t configsize; char *bootpath = NULL; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - rel = grub_relocator_new (); + rel = VasEBoot_relocator_new (); if (!rel) goto fail; - fill_ctx.file = grub_file_open (argv[0]); + fill_ctx.file = VasEBoot_file_open (argv[0]); if (! fill_ctx.file) goto fail; - fill_ctx.pmap = grub_malloc (fill_ctx.pmapalloc); + fill_ctx.pmap = VasEBoot_malloc (fill_ctx.pmapalloc); if (!fill_ctx.pmap) goto fail; - if (grub_disk_dev_iterate (fill_disk, &fill_ctx)) + if (VasEBoot_disk_dev_iterate (fill_disk, &fill_ctx)) goto fail; - if (grub_extend_alloc (fill_ctx.pmapptr + 1, &fill_ctx.pmapalloc, + if (VasEBoot_extend_alloc (fill_ctx.pmapptr + 1, &fill_ctx.pmapalloc, &fill_ctx.pmap)) goto fail; fill_ctx.pmap[fill_ctx.pmapptr] = 0; { - char *file_name = grub_strchr (argv[0], ')'); + char *file_name = VasEBoot_strchr (argv[0], ')'); if (file_name) file_name++; else @@ -439,87 +439,87 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[]) file_name++; if (fill_ctx.bootpart) - bootpath = grub_xasprintf ("%s!%s!%s", fill_ctx.bootdisk, + bootpath = VasEBoot_xasprintf ("%s!%s!%s", fill_ctx.bootdisk, fill_ctx.bootpart, file_name); else - bootpath = grub_xasprintf ("%s!%s", fill_ctx.bootdisk, file_name); - grub_free (fill_ctx.bootdisk); - grub_free (fill_ctx.bootpart); + bootpath = VasEBoot_xasprintf ("%s!%s", fill_ctx.bootdisk, file_name); + VasEBoot_free (fill_ctx.bootdisk); + VasEBoot_free (fill_ctx.bootpart); } if (!bootpath) goto fail; - if (grub_file_read (fill_ctx.file, &hdr, - sizeof (hdr)) != (grub_ssize_t) sizeof (hdr)) + if (VasEBoot_file_read (fill_ctx.file, &hdr, + sizeof (hdr)) != (VasEBoot_ssize_t) sizeof (hdr)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - if (grub_be_to_cpu32 (hdr.magic) != GRUB_PLAN9_MAGIC + if (VasEBoot_be_to_cpu32 (hdr.magic) != VasEBoot_PLAN9_MAGIC || hdr.zero) { - grub_error (GRUB_ERR_BAD_OS, "unsupported Plan9"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "unsupported Plan9"); goto fail; } - memsize = ALIGN_UP (grub_be_to_cpu32 (hdr.text_size) + sizeof (hdr), - GRUB_PLAN9_ALIGN); - memsize += ALIGN_UP (grub_be_to_cpu32 (hdr.data_size), GRUB_PLAN9_ALIGN); - memsize += ALIGN_UP(grub_be_to_cpu32 (hdr.bss_size), GRUB_PLAN9_ALIGN); - eip = grub_be_to_cpu32 (hdr.entry_addr) & 0xfffffff; + memsize = ALIGN_UP (VasEBoot_be_to_cpu32 (hdr.text_size) + sizeof (hdr), + VasEBoot_PLAN9_ALIGN); + memsize += ALIGN_UP (VasEBoot_be_to_cpu32 (hdr.data_size), VasEBoot_PLAN9_ALIGN); + memsize += ALIGN_UP(VasEBoot_be_to_cpu32 (hdr.bss_size), VasEBoot_PLAN9_ALIGN); + eip = VasEBoot_be_to_cpu32 (hdr.entry_addr) & 0xfffffff; /* path */ - configsize = GRUB_PLAN9_CONFIG_PATH_SIZE; + configsize = VasEBoot_PLAN9_CONFIG_PATH_SIZE; /* magic */ - configsize += sizeof (GRUB_PLAN9_CONFIG_MAGIC) - 1; + configsize += sizeof (VasEBoot_PLAN9_CONFIG_MAGIC) - 1; { int i; for (i = 1; i < argc; i++) - configsize += grub_strlen (argv[i]) + 1; + configsize += VasEBoot_strlen (argv[i]) + 1; } - configsize += (sizeof ("bootfile=") - 1) + grub_strlen (bootpath) + 1; + configsize += (sizeof ("bootfile=") - 1) + VasEBoot_strlen (bootpath) + 1; configsize += fill_ctx.pmapptr; /* Terminating \0. */ configsize++; { - grub_relocator_chunk_t ch; - grub_err_t err; - err = grub_relocator_alloc_chunk_addr (rel, &ch, GRUB_PLAN9_CONFIG_ADDR, + VasEBoot_relocator_chunk_t ch; + VasEBoot_err_t err; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, VasEBoot_PLAN9_CONFIG_ADDR, configsize); if (err) goto fail; config = get_virtual_current_address (ch); } - grub_memset (config, 0, GRUB_PLAN9_CONFIG_PATH_SIZE); - grub_strncpy (config, bootpath, GRUB_PLAN9_CONFIG_PATH_SIZE - 1); + VasEBoot_memset (config, 0, VasEBoot_PLAN9_CONFIG_PATH_SIZE); + VasEBoot_strncpy (config, bootpath, VasEBoot_PLAN9_CONFIG_PATH_SIZE - 1); - configptr = config + GRUB_PLAN9_CONFIG_PATH_SIZE; - grub_memcpy (configptr, GRUB_PLAN9_CONFIG_MAGIC, - sizeof (GRUB_PLAN9_CONFIG_MAGIC) - 1); - configptr += sizeof (GRUB_PLAN9_CONFIG_MAGIC) - 1; - configptr = grub_stpcpy (configptr, "bootfile="); - configptr = grub_stpcpy (configptr, bootpath); + configptr = config + VasEBoot_PLAN9_CONFIG_PATH_SIZE; + VasEBoot_memcpy (configptr, VasEBoot_PLAN9_CONFIG_MAGIC, + sizeof (VasEBoot_PLAN9_CONFIG_MAGIC) - 1); + configptr += sizeof (VasEBoot_PLAN9_CONFIG_MAGIC) - 1; + configptr = VasEBoot_stpcpy (configptr, "bootfile="); + configptr = VasEBoot_stpcpy (configptr, bootpath); *configptr++ = '\n'; { int i; for (i = 1; i < argc; i++) { - configptr = grub_stpcpy (configptr, argv[i]); + configptr = VasEBoot_stpcpy (configptr, argv[i]); *configptr++ = '\n'; } } - configptr = grub_stpcpy (configptr, fill_ctx.pmap); + configptr = VasEBoot_stpcpy (configptr, fill_ctx.pmap); { - grub_relocator_chunk_t ch; - grub_err_t err; + VasEBoot_relocator_chunk_t ch; + VasEBoot_err_t err; - err = grub_relocator_alloc_chunk_addr (rel, &ch, GRUB_PLAN9_TARGET, + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, VasEBoot_PLAN9_TARGET, memsize); if (err) goto fail; @@ -527,70 +527,70 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[]) } { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; ptr = mem; - grub_memcpy (ptr, &hdr, sizeof (hdr)); + VasEBoot_memcpy (ptr, &hdr, sizeof (hdr)); ptr += sizeof (hdr); - if (grub_file_read (fill_ctx.file, ptr, grub_be_to_cpu32 (hdr.text_size)) - != (grub_ssize_t) grub_be_to_cpu32 (hdr.text_size)) + if (VasEBoot_file_read (fill_ctx.file, ptr, VasEBoot_be_to_cpu32 (hdr.text_size)) + != (VasEBoot_ssize_t) VasEBoot_be_to_cpu32 (hdr.text_size)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - ptr += grub_be_to_cpu32 (hdr.text_size); - padsize = ALIGN_UP (grub_be_to_cpu32 (hdr.text_size) + sizeof (hdr), - GRUB_PLAN9_ALIGN) - grub_be_to_cpu32 (hdr.text_size) + ptr += VasEBoot_be_to_cpu32 (hdr.text_size); + padsize = ALIGN_UP (VasEBoot_be_to_cpu32 (hdr.text_size) + sizeof (hdr), + VasEBoot_PLAN9_ALIGN) - VasEBoot_be_to_cpu32 (hdr.text_size) - sizeof (hdr); - grub_memset (ptr, 0, padsize); + VasEBoot_memset (ptr, 0, padsize); ptr += padsize; - if (grub_file_read (fill_ctx.file, ptr, grub_be_to_cpu32 (hdr.data_size)) - != (grub_ssize_t) grub_be_to_cpu32 (hdr.data_size)) + if (VasEBoot_file_read (fill_ctx.file, ptr, VasEBoot_be_to_cpu32 (hdr.data_size)) + != (VasEBoot_ssize_t) VasEBoot_be_to_cpu32 (hdr.data_size)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - ptr += grub_be_to_cpu32 (hdr.data_size); - padsize = ALIGN_UP (grub_be_to_cpu32 (hdr.data_size), GRUB_PLAN9_ALIGN) - - grub_be_to_cpu32 (hdr.data_size); + ptr += VasEBoot_be_to_cpu32 (hdr.data_size); + padsize = ALIGN_UP (VasEBoot_be_to_cpu32 (hdr.data_size), VasEBoot_PLAN9_ALIGN) + - VasEBoot_be_to_cpu32 (hdr.data_size); - grub_memset (ptr, 0, padsize); + VasEBoot_memset (ptr, 0, padsize); ptr += padsize; - grub_memset (ptr, 0, ALIGN_UP(grub_be_to_cpu32 (hdr.bss_size), - GRUB_PLAN9_ALIGN)); + VasEBoot_memset (ptr, 0, ALIGN_UP(VasEBoot_be_to_cpu32 (hdr.bss_size), + VasEBoot_PLAN9_ALIGN)); } - grub_loader_set (grub_plan9_boot, grub_plan9_unload, 1); - return GRUB_ERR_NONE; + VasEBoot_loader_set (VasEBoot_plan9_boot, VasEBoot_plan9_unload, 1); + return VasEBoot_ERR_NONE; fail: - grub_free (fill_ctx.pmap); + VasEBoot_free (fill_ctx.pmap); if (fill_ctx.file) - grub_file_close (fill_ctx.file); + VasEBoot_file_close (fill_ctx.file); - grub_plan9_unload (); + VasEBoot_plan9_unload (); - return grub_errno; + return VasEBoot_errno; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(plan9) +VasEBoot_MOD_INIT(plan9) { - cmd = grub_register_extcmd ("plan9", grub_cmd_plan9, - GRUB_COMMAND_OPTIONS_AT_START, + cmd = VasEBoot_register_extcmd ("plan9", VasEBoot_cmd_plan9, + VasEBoot_COMMAND_OPTIONS_AT_START, N_("KERNEL ARGS"), N_("Load Plan9 kernel."), options); my_mod = mod; } -GRUB_MOD_FINI(plan9) +VasEBoot_MOD_FINI(plan9) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/loader/i386/pc/pxechainloader.c b/VasEBoot-core/loader/i386/pc/pxechainloader.c index e60c62b1b..a0d2c672f 100644 --- a/VasEBoot-core/loader/i386/pc/pxechainloader.c +++ b/VasEBoot-core/loader/i386/pc/pxechainloader.c @@ -1,52 +1,52 @@ /* chainloader.c - boot another boot loader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2007,2009,2010,2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_dl_t my_mod; -static struct grub_relocator *rel; -static grub_uint32_t edx = 0xffffffff; +static VasEBoot_dl_t my_mod; +static struct VasEBoot_relocator *rel; +static VasEBoot_uint32_t edx = 0xffffffff; static char boot_file[128]; static char server_name[64]; -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_pxechain_boot (void) +static VasEBoot_err_t +VasEBoot_pxechain_boot (void) { - struct grub_relocator16_state state = { + struct VasEBoot_relocator16_state state = { .cs = 0, .ip = 0x7c00, .ds = 0, @@ -57,49 +57,49 @@ grub_pxechain_boot (void) .sp = 0x7c00, .edx = edx }; - struct grub_net_bootp_packet *bp; + struct VasEBoot_net_bootp_packet *bp; - bp = grub_pxe_get_cached (GRUB_PXENV_PACKET_TYPE_DHCP_ACK); + bp = VasEBoot_pxe_get_cached (VasEBoot_PXENV_PACKET_TYPE_DHCP_ACK); - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); if (bp && boot_file[0]) - grub_memcpy (bp->boot_file, boot_file, sizeof (bp->boot_file)); + VasEBoot_memcpy (bp->boot_file, boot_file, sizeof (bp->boot_file)); if (bp && server_name[0]) - grub_memcpy (bp->server_name, server_name, sizeof (bp->server_name)); + VasEBoot_memcpy (bp->server_name, server_name, sizeof (bp->server_name)); - return grub_relocator16_boot (rel, state); + return VasEBoot_relocator16_boot (rel, state); } -static grub_err_t -grub_pxechain_unload (void) +static VasEBoot_err_t +VasEBoot_pxechain_unload (void) { - grub_relocator_unload (rel); + VasEBoot_relocator_unload (rel); rel = NULL; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_pxechain (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_pxechain (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_err_t err; void *image; - grub_size_t imagesize; + VasEBoot_size_t imagesize; char *fname; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - rel = grub_relocator_new (); + rel = VasEBoot_relocator_new (); if (!rel) goto fail; - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; @@ -110,7 +110,7 @@ grub_cmd_pxechain (grub_command_t cmd __attribute__ ((unused)), fname = argv[0]; if (fname[0] == '(') { - fname = grub_strchr (fname, ')'); + fname = VasEBoot_strchr (fname, ')'); if (fname) fname++; else @@ -118,51 +118,51 @@ grub_cmd_pxechain (grub_command_t cmd __attribute__ ((unused)), } } - grub_memset (boot_file, 0, sizeof (boot_file)); - grub_strncpy (boot_file, fname, sizeof (boot_file)); + VasEBoot_memset (boot_file, 0, sizeof (boot_file)); + VasEBoot_strncpy (boot_file, fname, sizeof (boot_file)); - grub_memset (server_name, 0, sizeof (server_name)); + VasEBoot_memset (server_name, 0, sizeof (server_name)); if (file->device->net && file->device->net->server) - grub_strncpy (server_name, file->device->net->server, sizeof (server_name)); + VasEBoot_strncpy (server_name, file->device->net->server, sizeof (server_name)); - edx = grub_get_root_biosnumber (); + edx = VasEBoot_get_root_biosnumber (); - imagesize = grub_file_size (file); + imagesize = VasEBoot_file_size (file); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (rel, &ch, 0x7c00, imagesize); + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, 0x7c00, imagesize); if (err) goto fail; image = get_virtual_current_address (ch); } - if (grub_file_read (file, image, imagesize) != (grub_ssize_t) imagesize) + if (VasEBoot_file_read (file, image, imagesize) != (VasEBoot_ssize_t) imagesize) goto fail; - grub_loader_set (grub_pxechain_boot, grub_pxechain_unload, - GRUB_LOADER_FLAG_NORETURN | GRUB_LOADER_FLAG_PXE_NOT_UNLOAD); - return GRUB_ERR_NONE; + VasEBoot_loader_set (VasEBoot_pxechain_boot, VasEBoot_pxechain_unload, + VasEBoot_LOADER_FLAG_NORETURN | VasEBoot_LOADER_FLAG_PXE_NOT_UNLOAD); + return VasEBoot_ERR_NONE; fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_pxechain_unload (); + VasEBoot_pxechain_unload (); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(pxechainloader) +VasEBoot_MOD_INIT(pxechainloader) { - cmd = grub_register_command ("pxechainloader", grub_cmd_pxechain, + cmd = VasEBoot_register_command ("pxechainloader", VasEBoot_cmd_pxechain, 0, N_("Load a PXE image.")); my_mod = mod; } -GRUB_MOD_FINI(pxechainloader) +VasEBoot_MOD_FINI(pxechainloader) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/i386/pc/truecrypt.c b/VasEBoot-core/loader/i386/pc/truecrypt.c index 9ea4fde42..e121fc905 100644 --- a/VasEBoot-core/loader/i386/pc/truecrypt.c +++ b/VasEBoot-core/loader/i386/pc/truecrypt.c @@ -1,54 +1,54 @@ /* chainloader.c - boot another boot loader */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; -static struct grub_relocator *rel; -static grub_uint32_t edx = 0xffffffff; -static grub_uint16_t sp; -static grub_uint32_t destaddr; +static VasEBoot_dl_t my_mod; +static struct VasEBoot_relocator *rel; +static VasEBoot_uint32_t edx = 0xffffffff; +static VasEBoot_uint16_t sp; +static VasEBoot_uint32_t destaddr; -#define GRUB_TRUECRYPT_SEGMENT 0x2000 +#define VasEBoot_TRUECRYPT_SEGMENT 0x2000 -static grub_err_t -grub_truecrypt_boot (void) +static VasEBoot_err_t +VasEBoot_truecrypt_boot (void) { - grub_uint16_t segment = destaddr >> 4; - struct grub_relocator16_state state = { + VasEBoot_uint16_t segment = destaddr >> 4; + struct VasEBoot_relocator16_state state = { .cs = segment, .ds = segment, .es = segment, @@ -60,68 +60,68 @@ grub_truecrypt_boot (void) .edx = edx, .a20 = 1 }; - grub_video_set_mode ("text", 0, 0); + VasEBoot_video_set_mode ("text", 0, 0); - return grub_relocator16_boot (rel, state); + return VasEBoot_relocator16_boot (rel, state); } -static grub_err_t -grub_truecrypt_unload (void) +static VasEBoot_err_t +VasEBoot_truecrypt_unload (void) { - grub_relocator_unload (rel); + VasEBoot_relocator_unload (rel); rel = NULL; - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } /* Information on protocol supplied by Attila Lendvai. */ #define MAGIC "\0CD001\1EL TORITO SPECIFICATION" -static grub_err_t -grub_cmd_truecrypt (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_truecrypt (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_err_t err; void *truecrypt; - grub_size_t truecryptsize; - const grub_size_t truecryptmemsize = 42 * 1024; - grub_uint8_t dh; - grub_uint32_t catalog, rba; - grub_uint8_t buf[128]; + VasEBoot_size_t truecryptsize; + const VasEBoot_size_t truecryptmemsize = 42 * 1024; + VasEBoot_uint8_t dh; + VasEBoot_uint32_t catalog, rba; + VasEBoot_uint8_t buf[128]; char *compressed = NULL; char *uncompressed = NULL; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); rel = NULL; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; - if (grub_file_seek (file, 17 * 2048) == (grub_size_t) -1) + if (VasEBoot_file_seek (file, 17 * 2048) == (VasEBoot_size_t) -1) goto fail; - if (grub_file_read (file, buf, sizeof (buf)) + if (VasEBoot_file_read (file, buf, sizeof (buf)) != sizeof (buf)) goto fail; - if (grub_memcmp (buf, MAGIC, sizeof (MAGIC)) != 0) + if (VasEBoot_memcmp (buf, MAGIC, sizeof (MAGIC)) != 0) { - grub_error (GRUB_ERR_BAD_OS, "invalid eltorito signature"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid eltorito signature"); goto fail; } - catalog = grub_get_unaligned32 (buf + 0x47); + catalog = VasEBoot_get_unaligned32 (buf + 0x47); - if (grub_file_seek (file, catalog * 2048) == (grub_size_t)-1) + if (VasEBoot_file_seek (file, catalog * 2048) == (VasEBoot_size_t)-1) goto fail; - if (grub_file_read (file, buf, sizeof (buf)) + if (VasEBoot_file_read (file, buf, sizeof (buf)) != sizeof (buf)) goto fail; @@ -129,105 +129,105 @@ grub_cmd_truecrypt (grub_command_t cmd __attribute__ ((unused)), || buf[0x1f] != 0xaa || buf[0x20] != 0x88 || buf[0x26] != 1 || buf[0x27] != 0) { - grub_error (GRUB_ERR_BAD_OS, "invalid eltorito catalog"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid eltorito catalog"); goto fail; } - rba = grub_get_unaligned32 (buf + 0x28); + rba = VasEBoot_get_unaligned32 (buf + 0x28); - if (grub_file_seek (file, rba * 2048 + 0x1b7) == (grub_size_t) -1) + if (VasEBoot_file_seek (file, rba * 2048 + 0x1b7) == (VasEBoot_size_t) -1) goto fail; - if (grub_file_read (file, &dh, 1) + if (VasEBoot_file_read (file, &dh, 1) != 1) goto fail; - if (grub_file_seek (file, rba * 2048 + 512 + 2048) == (grub_size_t) -1) + if (VasEBoot_file_seek (file, rba * 2048 + 512 + 2048) == (VasEBoot_size_t) -1) goto fail; - compressed = grub_malloc (57 * 512); + compressed = VasEBoot_malloc (57 * 512); if (!compressed) goto fail; - if (grub_file_read (file, compressed, 57 * 512) + if (VasEBoot_file_read (file, compressed, 57 * 512) != 57 * 512) goto fail; - uncompressed = grub_malloc (truecryptmemsize); + uncompressed = VasEBoot_malloc (truecryptmemsize); if (!uncompressed) goto fail; /* It's actually gzip but our gzip decompressor isn't able to handle trailing garbage, hence let's use raw decompressor. */ - truecryptsize = grub_deflate_decompress (compressed + 10, 57 * 512 - 10, + truecryptsize = VasEBoot_deflate_decompress (compressed + 10, 57 * 512 - 10, 0, uncompressed, truecryptmemsize); - if ((grub_ssize_t) truecryptsize < 0) + if ((VasEBoot_ssize_t) truecryptsize < 0) goto fail; if (truecryptmemsize <= truecryptsize + 0x100) { - grub_error (GRUB_ERR_BAD_OS, "file is too big"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "file is too big"); goto fail; } - rel = grub_relocator_new (); + rel = VasEBoot_relocator_new (); if (!rel) goto fail; - edx = (dh << 8) | grub_get_root_biosnumber (); + edx = (dh << 8) | VasEBoot_get_root_biosnumber (); - destaddr = ALIGN_DOWN (grub_min (0x90000, grub_mmap_get_lower ()) + destaddr = ALIGN_DOWN (VasEBoot_min (0x90000, VasEBoot_mmap_get_lower ()) - truecryptmemsize, 64 * 1024); { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (rel, &ch, destaddr, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (rel, &ch, destaddr, truecryptmemsize); if (err) goto fail; truecrypt = get_virtual_current_address (ch); } - grub_memset (truecrypt, 0, 0x100); - grub_memcpy ((char *) truecrypt + 0x100, uncompressed, truecryptsize); + VasEBoot_memset (truecrypt, 0, 0x100); + VasEBoot_memcpy ((char *) truecrypt + 0x100, uncompressed, truecryptsize); - grub_memset ((char *) truecrypt + truecryptsize + 0x100, + VasEBoot_memset ((char *) truecrypt + truecryptsize + 0x100, 0, truecryptmemsize - truecryptsize - 0x100); sp = truecryptmemsize - 4; - grub_loader_set (grub_truecrypt_boot, grub_truecrypt_unload, 1); + VasEBoot_loader_set (VasEBoot_truecrypt_boot, VasEBoot_truecrypt_unload, 1); - grub_free (uncompressed); - grub_free (compressed); + VasEBoot_free (uncompressed); + VasEBoot_free (compressed); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; fail: - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, "bad truecrypt ISO"); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, "bad truecrypt ISO"); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - grub_truecrypt_unload (); + VasEBoot_truecrypt_unload (); - grub_free (uncompressed); - grub_free (compressed); + VasEBoot_free (uncompressed); + VasEBoot_free (compressed); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT(truecrypt) +VasEBoot_MOD_INIT(truecrypt) { - cmd = grub_register_command ("truecrypt", grub_cmd_truecrypt, + cmd = VasEBoot_register_command ("truecrypt", VasEBoot_cmd_truecrypt, 0, N_("Load Truecrypt ISO.")); my_mod = mod; } -GRUB_MOD_FINI(truecrypt) +VasEBoot_MOD_FINI(truecrypt) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/loader/i386/xen.c b/VasEBoot-core/loader/i386/xen.c index e15f1d604..3b448cdba 100644 --- a/VasEBoot-core/loader/i386/xen.c +++ b/VasEBoot-core/loader/i386/xen.c @@ -1,94 +1,94 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #ifdef __x86_64__ #define NUMBER_OF_LEVELS 4 -#define INTERMEDIATE_OR (GRUB_PAGE_PRESENT | GRUB_PAGE_RW | GRUB_PAGE_USER) +#define INTERMEDIATE_OR (VasEBoot_PAGE_PRESENT | VasEBoot_PAGE_RW | VasEBoot_PAGE_USER) #define VIRT_MASK 0x0000ffffffffffffULL #else #define NUMBER_OF_LEVELS 3 -#define INTERMEDIATE_OR (GRUB_PAGE_PRESENT | GRUB_PAGE_RW) +#define INTERMEDIATE_OR (VasEBoot_PAGE_PRESENT | VasEBoot_PAGE_RW) #define VIRT_MASK 0x00000000ffffffffULL #define HYPERVISOR_PUD_ADDRESS 0xc0000000ULL #endif -struct grub_xen_mapping_lvl { - grub_uint64_t virt_start; - grub_uint64_t virt_end; - grub_uint64_t pfn_start; - grub_uint64_t n_pt_pages; +struct VasEBoot_xen_mapping_lvl { + VasEBoot_uint64_t virt_start; + VasEBoot_uint64_t virt_end; + VasEBoot_uint64_t pfn_start; + VasEBoot_uint64_t n_pt_pages; }; -struct grub_xen_mapping { - grub_uint64_t *where; - struct grub_xen_mapping_lvl area; - struct grub_xen_mapping_lvl lvls[NUMBER_OF_LEVELS]; +struct VasEBoot_xen_mapping { + VasEBoot_uint64_t *where; + struct VasEBoot_xen_mapping_lvl area; + struct VasEBoot_xen_mapping_lvl lvls[NUMBER_OF_LEVELS]; }; struct xen_loader_state { - struct grub_relocator *relocator; - struct grub_relocator_xen_state state; + struct VasEBoot_relocator *relocator; + struct VasEBoot_relocator_xen_state state; struct start_info next_start; - struct grub_xen_file_info xen_inf; - grub_xen_mfn_t *virt_mfn_list; + struct VasEBoot_xen_file_info xen_inf; + VasEBoot_xen_mfn_t *virt_mfn_list; struct start_info *virt_start_info; - grub_xen_mfn_t console_pfn; - grub_uint64_t max_addr; - grub_uint64_t pgtbl_end; + VasEBoot_xen_mfn_t console_pfn; + VasEBoot_uint64_t max_addr; + VasEBoot_uint64_t pgtbl_end; struct xen_multiboot_mod_list *module_info_page; - grub_uint64_t modules_target_start; - grub_size_t n_modules; - struct grub_xen_mapping *map_reloc; - struct grub_xen_mapping mappings[XEN_MAX_MAPPINGS]; + VasEBoot_uint64_t modules_target_start; + VasEBoot_size_t n_modules; + struct VasEBoot_xen_mapping *map_reloc; + struct VasEBoot_xen_mapping mappings[XEN_MAX_MAPPINGS]; int n_mappings; int loaded; }; static struct xen_loader_state xen_state; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; #define PAGE_SIZE (1UL << PAGE_SHIFT) #define MAX_MODULES (PAGE_SIZE / sizeof (struct xen_multiboot_mod_list)) @@ -98,28 +98,28 @@ static grub_dl_t my_mod; #define LOG_POINTERS_PER_PAGE 9 #define POINTERS_PER_PAGE (1 << LOG_POINTERS_PER_PAGE) -static grub_uint64_t -page2offset (grub_uint64_t page) +static VasEBoot_uint64_t +page2offset (VasEBoot_uint64_t page) { return page << PAGE_SHIFT; } -static grub_err_t -get_pgtable_size (grub_uint64_t from, grub_uint64_t to, grub_uint64_t pfn) +static VasEBoot_err_t +get_pgtable_size (VasEBoot_uint64_t from, VasEBoot_uint64_t to, VasEBoot_uint64_t pfn) { - struct grub_xen_mapping *map, *map_cmp; - grub_uint64_t mask, bits; + struct VasEBoot_xen_mapping *map, *map_cmp; + VasEBoot_uint64_t mask, bits; int i, m; if (xen_state.n_mappings == XEN_MAX_MAPPINGS) - return grub_error (GRUB_ERR_BUG, "too many mapped areas"); + return VasEBoot_error (VasEBoot_ERR_BUG, "too many mapped areas"); - grub_dprintf ("xen", "get_pgtable_size %d from=%llx, to=%llx, pfn=%llx\n", + VasEBoot_dprintf ("xen", "get_pgtable_size %d from=%llx, to=%llx, pfn=%llx\n", xen_state.n_mappings, (unsigned long long) from, (unsigned long long) to, (unsigned long long) pfn); map = xen_state.mappings + xen_state.n_mappings; - grub_memset (map, 0, sizeof (*map)); + VasEBoot_memset (map, 0, sizeof (*map)); map->area.virt_start = from & VIRT_MASK; map->area.virt_end = (to - 1) & VIRT_MASK; @@ -172,37 +172,37 @@ get_pgtable_size (grub_uint64_t from, grub_uint64_t to, grub_uint64_t pfn) map->lvls[i].n_pt_pages = ((map->lvls[i].virt_end - map->lvls[i].virt_start) >> bits) + 1; map->area.n_pt_pages += map->lvls[i].n_pt_pages; - grub_dprintf ("xen", "get_pgtable_size level %d: virt %llx-%llx %d pts\n", + VasEBoot_dprintf ("xen", "get_pgtable_size level %d: virt %llx-%llx %d pts\n", i, (unsigned long long) map->lvls[i].virt_start, (unsigned long long) map->lvls[i].virt_end, (int) map->lvls[i].n_pt_pages); } - grub_dprintf ("xen", "get_pgtable_size return: %d page tables\n", + VasEBoot_dprintf ("xen", "get_pgtable_size return: %d page tables\n", (int) map->area.n_pt_pages); xen_state.state.paging_start[xen_state.n_mappings] = pfn; xen_state.state.paging_size[xen_state.n_mappings] = map->area.n_pt_pages; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_uint64_t * +static VasEBoot_uint64_t * get_pg_table_virt (int mapping, int level) { - grub_uint64_t pfn; - struct grub_xen_mapping *map; + VasEBoot_uint64_t pfn; + struct VasEBoot_xen_mapping *map; map = xen_state.mappings + mapping; pfn = map->lvls[level].pfn_start - map->lvls[NUMBER_OF_LEVELS - 1].pfn_start; return map->where + pfn * POINTERS_PER_PAGE; } -static grub_uint64_t -get_pg_table_prot (int level, grub_uint64_t pfn) +static VasEBoot_uint64_t +get_pg_table_prot (int level, VasEBoot_uint64_t pfn) { int m; - grub_uint64_t pfn_s, pfn_e; + VasEBoot_uint64_t pfn_s, pfn_e; if (level > 0) return INTERMEDIATE_OR; @@ -211,22 +211,22 @@ get_pg_table_prot (int level, grub_uint64_t pfn) pfn_s = xen_state.mappings[m].lvls[NUMBER_OF_LEVELS - 1].pfn_start; pfn_e = xen_state.mappings[m].area.n_pt_pages + pfn_s; if (pfn >= pfn_s && pfn < pfn_e) - return GRUB_PAGE_PRESENT | GRUB_PAGE_USER; + return VasEBoot_PAGE_PRESENT | VasEBoot_PAGE_USER; } - return GRUB_PAGE_PRESENT | GRUB_PAGE_RW | GRUB_PAGE_USER; + return VasEBoot_PAGE_PRESENT | VasEBoot_PAGE_RW | VasEBoot_PAGE_USER; } static void -generate_page_table (grub_xen_mfn_t *mfn_list) +generate_page_table (VasEBoot_xen_mfn_t *mfn_list) { int l, m1, m2; long p, p_s, p_e; - grub_uint64_t start, end, pfn; - grub_uint64_t *pg; - struct grub_xen_mapping_lvl *lvl; + VasEBoot_uint64_t start, end, pfn; + VasEBoot_uint64_t *pg; + struct VasEBoot_xen_mapping_lvl *lvl; for (m1 = 0; m1 < xen_state.n_mappings; m1++) - grub_memset (xen_state.mappings[m1].where, 0, + VasEBoot_memset (xen_state.mappings[m1].where, 0, xen_state.mappings[m1].area.n_pt_pages * PAGE_SIZE); for (l = NUMBER_OF_LEVELS - 1; l >= 0; l--) @@ -244,13 +244,13 @@ generate_page_table (grub_xen_mfn_t *mfn_list) continue; if (lvl->virt_start >= end || lvl->virt_end <= start) continue; - p_s = (grub_max (start, lvl->virt_start) - start) >> + p_s = (VasEBoot_max (start, lvl->virt_start) - start) >> (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE); - p_e = (grub_min (end, lvl->virt_end) - start) >> + p_e = (VasEBoot_min (end, lvl->virt_end) - start) >> (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE); - pfn = ((grub_max (start, lvl->virt_start) - lvl->virt_start) >> + pfn = ((VasEBoot_max (start, lvl->virt_start) - lvl->virt_start) >> (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE)) + lvl->pfn_start; - grub_dprintf ("xen", "write page table entries level %d pg %p " + VasEBoot_dprintf ("xen", "write page table entries level %d pg %p " "mapping %d/%d index %lx-%lx pfn %llx\n", l, pg, m1, m2, p_s, p_e, (unsigned long long) pfn); for (p = p_s; p <= p_e; p++) @@ -264,26 +264,26 @@ generate_page_table (grub_xen_mfn_t *mfn_list) } } -static grub_err_t -set_mfns (grub_xen_mfn_t pfn) +static VasEBoot_err_t +set_mfns (VasEBoot_xen_mfn_t pfn) { - grub_xen_mfn_t i, t; - grub_xen_mfn_t cn_pfn = -1, st_pfn = -1; + VasEBoot_xen_mfn_t i, t; + VasEBoot_xen_mfn_t cn_pfn = -1, st_pfn = -1; struct mmu_update m2p_updates[4]; - for (i = 0; i < grub_xen_start_page_addr->nr_pages; i++) + for (i = 0; i < VasEBoot_xen_start_page_addr->nr_pages; i++) { if (xen_state.virt_mfn_list[i] == - grub_xen_start_page_addr->console.domU.mfn) + VasEBoot_xen_start_page_addr->console.domU.mfn) cn_pfn = i; - if (xen_state.virt_mfn_list[i] == grub_xen_start_page_addr->store_mfn) + if (xen_state.virt_mfn_list[i] == VasEBoot_xen_start_page_addr->store_mfn) st_pfn = i; } - if (cn_pfn == (grub_xen_mfn_t)-1) - return grub_error (GRUB_ERR_BUG, "no console"); - if (st_pfn == (grub_xen_mfn_t)-1) - return grub_error (GRUB_ERR_BUG, "no store"); + if (cn_pfn == (VasEBoot_xen_mfn_t)-1) + return VasEBoot_error (VasEBoot_ERR_BUG, "no console"); + if (st_pfn == (VasEBoot_xen_mfn_t)-1) + return VasEBoot_error (VasEBoot_ERR_BUG, "no store"); t = xen_state.virt_mfn_list[pfn]; xen_state.virt_mfn_list[pfn] = xen_state.virt_mfn_list[cn_pfn]; xen_state.virt_mfn_list[cn_pfn] = t; @@ -304,25 +304,25 @@ set_mfns (grub_xen_mfn_t pfn) page2offset (xen_state.virt_mfn_list[st_pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[3].val = st_pfn; - grub_xen_mmu_update (m2p_updates, 4, NULL, DOMID_SELF); + VasEBoot_xen_mmu_update (m2p_updates, 4, NULL, DOMID_SELF); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_xen_p2m_alloc (void) +static VasEBoot_err_t +VasEBoot_xen_p2m_alloc (void) { - grub_relocator_chunk_t ch; - grub_size_t p2msize, p2malloc; - grub_err_t err; - struct grub_xen_mapping *map; + VasEBoot_relocator_chunk_t ch; + VasEBoot_size_t p2msize, p2malloc; + VasEBoot_err_t err; + struct VasEBoot_xen_mapping *map; if (xen_state.virt_mfn_list) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; map = xen_state.mappings + xen_state.n_mappings; - p2msize = ALIGN_UP (sizeof (grub_xen_mfn_t) * - grub_xen_start_page_addr->nr_pages, PAGE_SIZE); + p2msize = ALIGN_UP (sizeof (VasEBoot_xen_mfn_t) * + VasEBoot_xen_start_page_addr->nr_pages, PAGE_SIZE); if (xen_state.xen_inf.has_p2m_base) { err = get_pgtable_size (xen_state.xen_inf.p2m_base, @@ -346,31 +346,31 @@ grub_xen_p2m_alloc (void) } xen_state.state.mfn_list = xen_state.max_addr; - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, p2malloc); if (err) return err; xen_state.virt_mfn_list = get_virtual_current_address (ch); if (xen_state.xen_inf.has_p2m_base) - map->where = (grub_uint64_t *) xen_state.virt_mfn_list + - p2msize / sizeof (grub_uint64_t); - grub_memcpy (xen_state.virt_mfn_list, - (void *) grub_xen_start_page_addr->mfn_list, p2msize); + map->where = (VasEBoot_uint64_t *) xen_state.virt_mfn_list + + p2msize / sizeof (VasEBoot_uint64_t); + VasEBoot_memcpy (xen_state.virt_mfn_list, + (void *) VasEBoot_xen_start_page_addr->mfn_list, p2msize); xen_state.max_addr += p2malloc; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_xen_special_alloc (void) +static VasEBoot_err_t +VasEBoot_xen_special_alloc (void) { - grub_relocator_chunk_t ch; - grub_err_t err; + VasEBoot_relocator_chunk_t ch; + VasEBoot_err_t err; if (xen_state.virt_start_info) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, sizeof (xen_state.next_start)); if (err) @@ -382,29 +382,29 @@ grub_xen_special_alloc (void) xen_state.console_pfn = xen_state.max_addr >> PAGE_SHIFT; xen_state.max_addr += 2 * PAGE_SIZE; - xen_state.next_start.nr_pages = grub_xen_start_page_addr->nr_pages; - grub_memcpy (xen_state.next_start.magic, grub_xen_start_page_addr->magic, + xen_state.next_start.nr_pages = VasEBoot_xen_start_page_addr->nr_pages; + VasEBoot_memcpy (xen_state.next_start.magic, VasEBoot_xen_start_page_addr->magic, sizeof (xen_state.next_start.magic)); - xen_state.next_start.store_mfn = grub_xen_start_page_addr->store_mfn; - xen_state.next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; - xen_state.next_start.console.domU = grub_xen_start_page_addr->console.domU; - xen_state.next_start.shared_info = grub_xen_start_page_addr->shared_info; + xen_state.next_start.store_mfn = VasEBoot_xen_start_page_addr->store_mfn; + xen_state.next_start.store_evtchn = VasEBoot_xen_start_page_addr->store_evtchn; + xen_state.next_start.console.domU = VasEBoot_xen_start_page_addr->console.domU; + xen_state.next_start.shared_info = VasEBoot_xen_start_page_addr->shared_info; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_xen_pt_alloc (void) +static VasEBoot_err_t +VasEBoot_xen_pt_alloc (void) { - grub_relocator_chunk_t ch; - grub_err_t err; - grub_uint64_t nr_info_pages; - grub_uint64_t nr_need_pages; - grub_uint64_t try_virt_end; - struct grub_xen_mapping *map; + VasEBoot_relocator_chunk_t ch; + VasEBoot_err_t err; + VasEBoot_uint64_t nr_info_pages; + VasEBoot_uint64_t nr_need_pages; + VasEBoot_uint64_t try_virt_end; + struct VasEBoot_xen_mapping *map; if (xen_state.pgtbl_end) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; map = xen_state.mappings + xen_state.n_mappings; xen_state.map_reloc = map + 1; @@ -446,7 +446,7 @@ grub_xen_pt_alloc (void) xen_state.n_mappings++; nr_need_pages = map->area.n_pt_pages + xen_state.map_reloc->area.n_pt_pages; - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, page2offset (nr_need_pages)); if (err) @@ -460,51 +460,51 @@ grub_xen_pt_alloc (void) xen_state.next_start.nr_pt_frames = nr_need_pages; xen_state.max_addr = try_virt_end - xen_state.xen_inf.virt_base; xen_state.pgtbl_end = xen_state.max_addr >> PAGE_SHIFT; - xen_state.map_reloc->where = (grub_uint64_t *) ((char *) map->where + + xen_state.map_reloc->where = (VasEBoot_uint64_t *) ((char *) map->where + page2offset (map->area.n_pt_pages)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Allocate all not yet allocated areas mapped by initial page tables. */ -static grub_err_t -grub_xen_alloc_boot_data (void) +static VasEBoot_err_t +VasEBoot_xen_alloc_boot_data (void) { - grub_err_t err; + VasEBoot_err_t err; if (!xen_state.xen_inf.has_p2m_base) { - err = grub_xen_p2m_alloc (); + err = VasEBoot_xen_p2m_alloc (); if (err) return err; } - err = grub_xen_special_alloc (); + err = VasEBoot_xen_special_alloc (); if (err) return err; - err = grub_xen_pt_alloc (); + err = VasEBoot_xen_pt_alloc (); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_xen_boot (void) +static VasEBoot_err_t +VasEBoot_xen_boot (void) { - grub_err_t err; - grub_uint64_t nr_pages; + VasEBoot_err_t err; + VasEBoot_uint64_t nr_pages; struct gnttab_set_version gnttab_setver; - grub_size_t i; + VasEBoot_size_t i; - if (grub_xen_n_allocated_shared_pages) - return grub_error (GRUB_ERR_BUG, "active grants"); + if (VasEBoot_xen_n_allocated_shared_pages) + return VasEBoot_error (VasEBoot_ERR_BUG, "active grants"); - err = grub_xen_alloc_boot_data (); + err = VasEBoot_xen_alloc_boot_data (); if (err) return err; if (xen_state.xen_inf.has_p2m_base) { - err = grub_xen_p2m_alloc (); + err = VasEBoot_xen_p2m_alloc (); if (err) return err; } @@ -515,7 +515,7 @@ grub_xen_boot (void) nr_pages = xen_state.max_addr >> PAGE_SHIFT; - grub_dprintf ("xen", "bootstrap domain %llx+%llx\n", + VasEBoot_dprintf ("xen", "bootstrap domain %llx+%llx\n", (unsigned long long) xen_state.xen_inf.virt_base, (unsigned long long) page2offset (nr_pages)); @@ -526,15 +526,15 @@ grub_xen_boot (void) *xen_state.virt_start_info = xen_state.next_start; - grub_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); + VasEBoot_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); gnttab_setver.version = 1; - grub_xen_grant_table_op (GNTTABOP_set_version, &gnttab_setver, 1); + VasEBoot_xen_grant_table_op (GNTTABOP_set_version, &gnttab_setver, 1); - for (i = 0; i < ARRAY_SIZE (grub_xen_shared_info->evtchn_pending); i++) - grub_xen_shared_info->evtchn_pending[i] = 0; + for (i = 0; i < ARRAY_SIZE (VasEBoot_xen_shared_info->evtchn_pending); i++) + VasEBoot_xen_shared_info->evtchn_pending[i] = 0; - return grub_relocator_xen_boot (xen_state.relocator, xen_state.state, nr_pages, + return VasEBoot_relocator_xen_boot (xen_state.relocator, xen_state.state, nr_pages, xen_state.xen_inf.virt_base < PAGE_SIZE ? page2offset (nr_pages) : 0, xen_state.pgtbl_end - 1, @@ -543,25 +543,25 @@ grub_xen_boot (void) } static void -grub_xen_reset (void) +VasEBoot_xen_reset (void) { - grub_relocator_unload (xen_state.relocator); + VasEBoot_relocator_unload (xen_state.relocator); - grub_memset (&xen_state, 0, sizeof (xen_state)); + VasEBoot_memset (&xen_state, 0, sizeof (xen_state)); } -static grub_err_t -grub_xen_unload (void) +static VasEBoot_err_t +VasEBoot_xen_unload (void) { - grub_xen_reset (); - grub_dl_unref (my_mod); - return GRUB_ERR_NONE; + VasEBoot_xen_reset (); + VasEBoot_dl_unref (my_mod); + return VasEBoot_ERR_NONE; } #define HYPERCALL_INTERFACE_SIZE 32 #ifdef __x86_64__ -static grub_uint8_t template[] = +static VasEBoot_uint8_t template[] = { 0x51, /* push %rcx */ 0x41, 0x53, /* push %r11 */ @@ -572,7 +572,7 @@ static grub_uint8_t template[] = 0xc3 /* ret */ }; -static grub_uint8_t template_iret[] = +static VasEBoot_uint8_t template_iret[] = { 0x51, /* push %rcx */ 0x41, 0x53, /* push %r11 */ @@ -583,14 +583,14 @@ static grub_uint8_t template_iret[] = #define CALLNO_OFFSET 6 #else -static grub_uint8_t template[] = +static VasEBoot_uint8_t template[] = { 0xb8, 0xbb, 0xaa, 0x00, 0x00, /* mov imm32, %eax */ 0xcd, 0x82, /* int $0x82 */ 0xc3 /* ret */ }; -static grub_uint8_t template_iret[] = +static VasEBoot_uint8_t template_iret[] = { 0x50, /* push %eax */ 0xb8, 0x17, 0x00, 0x00, 0x00, /* mov $0x17,%eax */ @@ -602,87 +602,87 @@ static grub_uint8_t template_iret[] = static void -set_hypercall_interface (grub_uint8_t *tgt, unsigned callno) +set_hypercall_interface (VasEBoot_uint8_t *tgt, unsigned callno) { if (callno == 0x17) { - grub_memcpy (tgt, template_iret, ARRAY_SIZE (template_iret)); - grub_memset (tgt + ARRAY_SIZE (template_iret), 0xcc, + VasEBoot_memcpy (tgt, template_iret, ARRAY_SIZE (template_iret)); + VasEBoot_memset (tgt + ARRAY_SIZE (template_iret), 0xcc, HYPERCALL_INTERFACE_SIZE - ARRAY_SIZE (template_iret)); return; } - grub_memcpy (tgt, template, ARRAY_SIZE (template)); - grub_memset (tgt + ARRAY_SIZE (template), 0xcc, + VasEBoot_memcpy (tgt, template, ARRAY_SIZE (template)); + VasEBoot_memset (tgt + ARRAY_SIZE (template), 0xcc, HYPERCALL_INTERFACE_SIZE - ARRAY_SIZE (template)); tgt[CALLNO_OFFSET] = callno & 0xff; tgt[CALLNO_OFFSET + 1] = callno >> 8; } #ifdef __x86_64__ -#define grub_elfXX_load grub_elf64_load +#define VasEBoot_elfXX_load VasEBoot_elf64_load #else -#define grub_elfXX_load grub_elf32_load +#define VasEBoot_elfXX_load VasEBoot_elf32_load #endif -static grub_err_t -grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xen (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file; - grub_elf_t elf; - grub_err_t err; + VasEBoot_file_t file; + VasEBoot_elf_t elf; + VasEBoot_err_t err; void *kern_chunk_src; - grub_relocator_chunk_t ch; - grub_addr_t kern_start; - grub_addr_t kern_end; + VasEBoot_relocator_chunk_t ch; + VasEBoot_addr_t kern_start; + VasEBoot_addr_t kern_end; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - /* Call grub_loader_unset early to avoid it being called by grub_loader_set */ - grub_loader_unset (); + /* Call VasEBoot_loader_unset early to avoid it being called by VasEBoot_loader_set */ + VasEBoot_loader_unset (); - grub_xen_reset (); + VasEBoot_xen_reset (); - grub_create_loader_cmdline (argc - 1, argv + 1, + VasEBoot_create_loader_cmdline (argc - 1, argv + 1, (char *) xen_state.next_start.cmd_line, sizeof (xen_state.next_start.cmd_line) - 1); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) - return grub_errno; + return VasEBoot_errno; - elf = grub_xen_file_and_cmdline (file, + elf = VasEBoot_xen_file_and_cmdline (file, (char *) xen_state.next_start.cmd_line, sizeof (xen_state.next_start.cmd_line) - 1); if (!elf) goto fail; - err = grub_xen_get_info (elf, &xen_state.xen_inf); + err = VasEBoot_xen_get_info (elf, &xen_state.xen_inf); if (err) goto fail; #ifdef __x86_64__ - if (xen_state.xen_inf.arch != GRUB_XEN_FILE_X86_64) + if (xen_state.xen_inf.arch != VasEBoot_XEN_FILE_X86_64) #else - if (xen_state.xen_inf.arch != GRUB_XEN_FILE_I386_PAE - && xen_state.xen_inf.arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xen_state.xen_inf.arch != VasEBoot_XEN_FILE_I386_PAE + && xen_state.xen_inf.arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) #endif { - grub_error (GRUB_ERR_BAD_OS, "incompatible architecture: %d", + VasEBoot_error (VasEBoot_ERR_BAD_OS, "incompatible architecture: %d", xen_state.xen_inf.arch); goto fail; } if (xen_state.xen_inf.virt_base & (PAGE_SIZE - 1)) { - grub_error (GRUB_ERR_BAD_OS, "unaligned virt_base"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "unaligned virt_base"); goto fail; } - grub_dprintf ("xen", "virt_base = %llx, entry = %llx\n", + VasEBoot_dprintf ("xen", "virt_base = %llx, entry = %llx\n", (unsigned long long) xen_state.xen_inf.virt_base, (unsigned long long) xen_state.xen_inf.entry_point); - xen_state.relocator = grub_relocator_new (); + xen_state.relocator = VasEBoot_relocator_new (); if (!xen_state.relocator) goto fail; @@ -691,37 +691,37 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), if (xen_state.xen_inf.has_hypercall_page) { - grub_dprintf ("xen", "hypercall page at 0x%llx\n", + VasEBoot_dprintf ("xen", "hypercall page at 0x%llx\n", (unsigned long long) xen_state.xen_inf.hypercall_page); - kern_start = grub_min (kern_start, xen_state.xen_inf.hypercall_page - + kern_start = VasEBoot_min (kern_start, xen_state.xen_inf.hypercall_page - xen_state.xen_inf.virt_base); - kern_end = grub_max (kern_end, xen_state.xen_inf.hypercall_page - + kern_end = VasEBoot_max (kern_end, xen_state.xen_inf.hypercall_page - xen_state.xen_inf.virt_base + PAGE_SIZE); } xen_state.max_addr = ALIGN_UP (kern_end, PAGE_SIZE); - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, kern_start, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, kern_start, kern_end - kern_start); if (err) goto fail; kern_chunk_src = get_virtual_current_address (ch); - grub_dprintf ("xen", "paddr_offset = 0x%llx\n", + VasEBoot_dprintf ("xen", "paddr_offset = 0x%llx\n", (unsigned long long) xen_state.xen_inf.paddr_offset); - grub_dprintf ("xen", "kern_start = 0x%llx, kern_end = 0x%llx\n", + VasEBoot_dprintf ("xen", "kern_start = 0x%llx, kern_end = 0x%llx\n", (unsigned long long) xen_state.xen_inf.kern_start, (unsigned long long) xen_state.xen_inf.kern_end); - err = grub_elfXX_load (elf, argv[0], - (grub_uint8_t *) kern_chunk_src - kern_start + err = VasEBoot_elfXX_load (elf, argv[0], + (VasEBoot_uint8_t *) kern_chunk_src - kern_start - xen_state.xen_inf.paddr_offset, 0, 0, 0); if (xen_state.xen_inf.has_hypercall_page) { unsigned i; for (i = 0; i < PAGE_SIZE / HYPERCALL_INTERFACE_SIZE; i++) - set_hypercall_interface ((grub_uint8_t *) kern_chunk_src + + set_hypercall_interface ((VasEBoot_uint8_t *) kern_chunk_src + i * HYPERCALL_INTERFACE_SIZE + xen_state.xen_inf.hypercall_page - xen_state.xen_inf.virt_base - kern_start, i); @@ -730,76 +730,76 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), if (err) goto fail; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); xen_state.loaded = 1; - grub_loader_set (grub_xen_boot, grub_xen_unload, 0); + VasEBoot_loader_set (VasEBoot_xen_boot, VasEBoot_xen_unload, 0); goto fail; fail: - /* grub_errno might be clobbered by further calls, save the error reason. */ - err = grub_errno; + /* VasEBoot_errno might be clobbered by further calls, save the error reason. */ + err = VasEBoot_errno; if (elf) - grub_elf_close (elf); + VasEBoot_elf_close (elf); else if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (err != GRUB_ERR_NONE) - grub_xen_reset (); + if (err != VasEBoot_ERR_NONE) + VasEBoot_xen_reset (); return err; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0; - grub_err_t err; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; - grub_relocator_chunk_t ch; + VasEBoot_size_t size = 0; + VasEBoot_err_t err; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + VasEBoot_relocator_chunk_t ch; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!xen_state.loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } if (xen_state.next_start.mod_start || xen_state.next_start.mod_len) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("initrd already loaded")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("initrd already loaded")); goto fail; } if (xen_state.xen_inf.unmapped_initrd) { - err = grub_xen_alloc_boot_data (); + err = VasEBoot_xen_alloc_boot_data (); if (err) goto fail; } - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); if (size) { - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, size); if (err) goto fail; - if (grub_initrd_load (&initrd_ctx, argv, + if (VasEBoot_initrd_load (&initrd_ctx, argv, get_virtual_current_address (ch))) goto fail; } @@ -815,33 +815,33 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), xen_state.next_start.mod_start = xen_state.max_addr + xen_state.xen_inf.virt_base; - grub_dprintf ("xen", "Initrd, addr=0x%x, size=0x%x\n", + VasEBoot_dprintf ("xen", "Initrd, addr=0x%x, size=0x%x\n", (unsigned) (xen_state.max_addr + xen_state.xen_inf.virt_base), (unsigned) size); xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_module (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0; - grub_err_t err; - grub_relocator_chunk_t ch; - grub_size_t cmdline_len; + VasEBoot_size_t size = 0; + VasEBoot_err_t err; + VasEBoot_relocator_chunk_t ch; + VasEBoot_size_t cmdline_len; int nounzip = 0; - grub_file_t file; + VasEBoot_file_t file; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (grub_strcmp (argv[0], "--nounzip") == 0) + if (VasEBoot_strcmp (argv[0], "--nounzip") == 0) { argv++; argc--; @@ -849,24 +849,24 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), } if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); if (!xen_state.loaded) { - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); } if ((xen_state.next_start.mod_start || xen_state.next_start.mod_len) && !xen_state.module_info_page) { - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("initrd already loaded")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("initrd already loaded")); } /* Leave one space for terminator. */ if (xen_state.n_modules >= MAX_MODULES - 1) { - return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many modules"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "too many modules"); } if (!xen_state.module_info_page) @@ -879,7 +879,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), xen_state.max_addr + xen_state.xen_inf.virt_base; xen_state.next_start.flags |= SIF_MULTIBOOT_MOD; - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, MAX_MODULES * sizeof (xen_state.module_info_page @@ -887,7 +887,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), if (err) return err; xen_state.module_info_page = get_virtual_current_address (ch); - grub_memset (xen_state.module_info_page, 0, MAX_MODULES + VasEBoot_memset (xen_state.module_info_page, 0, MAX_MODULES * sizeof (xen_state.module_info_page[0])); xen_state.max_addr += MAX_MODULES * sizeof (xen_state.module_info_page[0]); @@ -896,20 +896,20 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), xen_state.max_addr = ALIGN_UP (xen_state.max_addr, PAGE_SIZE); if (nounzip) - grub_file_filter_disable_compression (); - file = grub_file_open (argv[0]); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (argv[0]); if (!file) - return grub_errno; - size = grub_file_size (file); + return VasEBoot_errno; + size = VasEBoot_file_size (file); - cmdline_len = grub_loader_cmdline_size (argc - 1, argv + 1); + cmdline_len = VasEBoot_loader_cmdline_size (argc - 1, argv + 1); - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, cmdline_len); if (err) goto fail; - grub_create_loader_cmdline (argc - 1, argv + 1, + VasEBoot_create_loader_cmdline (argc - 1, argv + 1, get_virtual_current_address (ch), cmdline_len); xen_state.module_info_page[xen_state.n_modules].cmdline = @@ -918,15 +918,15 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), if (size) { - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, size); if (err) goto fail; - if (grub_file_read (file, get_virtual_current_address (ch), size) - != (grub_ssize_t) size) + if (VasEBoot_file_read (file, get_virtual_current_address (ch), size) + != (VasEBoot_ssize_t) size) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), argv[0]); goto fail; } @@ -939,36 +939,36 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), xen_state.max_addr + size - xen_state.modules_target_start; xen_state.n_modules++; - grub_dprintf ("xen", "module, addr=0x%x, size=0x%x\n", + VasEBoot_dprintf ("xen", "module, addr=0x%x, size=0x%x\n", (unsigned) xen_state.max_addr, (unsigned) size); xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); fail: - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_xen, cmd_initrd, cmd_module, cmd_multiboot; +static VasEBoot_command_t cmd_xen, cmd_initrd, cmd_module, cmd_multiboot; -GRUB_MOD_INIT (xen) +VasEBoot_MOD_INIT (xen) { - cmd_xen = grub_register_command ("linux", grub_cmd_xen, + cmd_xen = VasEBoot_register_command ("linux", VasEBoot_cmd_xen, 0, N_("Load Linux.")); - cmd_multiboot = grub_register_command ("multiboot", grub_cmd_xen, + cmd_multiboot = VasEBoot_register_command ("multiboot", VasEBoot_cmd_xen, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); - cmd_module = grub_register_command ("module", grub_cmd_module, + cmd_module = VasEBoot_register_command ("module", VasEBoot_cmd_module, 0, N_("Load module.")); my_mod = mod; } -GRUB_MOD_FINI (xen) +VasEBoot_MOD_FINI (xen) { - grub_unregister_command (cmd_xen); - grub_unregister_command (cmd_initrd); - grub_unregister_command (cmd_multiboot); - grub_unregister_command (cmd_module); + VasEBoot_unregister_command (cmd_xen); + VasEBoot_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_multiboot); + VasEBoot_unregister_command (cmd_module); } diff --git a/VasEBoot-core/loader/i386/xen_file.c b/VasEBoot-core/loader/i386/xen_file.c index 510d99c94..550ea5ba9 100644 --- a/VasEBoot-core/loader/i386/xen_file.c +++ b/VasEBoot-core/loader/i386/xen_file.c @@ -1,62 +1,62 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -#include +#include #define XZ_MAGIC "\3757zXZ\0" -grub_elf_t -grub_xen_file (grub_file_t file) +VasEBoot_elf_t +VasEBoot_xen_file (VasEBoot_file_t file) { - return grub_xen_file_and_cmdline (file, NULL, 0); + return VasEBoot_xen_file_and_cmdline (file, NULL, 0); } -grub_elf_t -grub_xen_file_and_cmdline (grub_file_t file, +VasEBoot_elf_t +VasEBoot_xen_file_and_cmdline (VasEBoot_file_t file, char *cmdline, - grub_size_t cmdline_max_len) + VasEBoot_size_t cmdline_max_len) { - grub_elf_t elf; + VasEBoot_elf_t elf; struct linux_kernel_header lh; - grub_file_t off_file; - grub_uint32_t payload_offset, payload_length; - grub_uint8_t magic[6]; + VasEBoot_file_t off_file; + VasEBoot_uint32_t payload_offset, payload_length; + VasEBoot_uint8_t magic[6]; - elf = grub_elf_file (file, file->name); + elf = VasEBoot_elf_file (file, file->name); if (elf) return elf; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - if (grub_file_seek (file, 0) == (grub_off_t) -1) + if (VasEBoot_file_seek (file, 0) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) + if (VasEBoot_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) goto fail; - if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55) - || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) - || grub_le_to_cpu16 (lh.version) < 0x0208) + if (lh.boot_flag != VasEBoot_cpu_to_le16_compile_time (0xaa55) + || lh.header != VasEBoot_cpu_to_le32_compile_time (VasEBoot_LINUX_MAGIC_SIGNATURE) + || VasEBoot_le_to_cpu16 (lh.version) < 0x0208) { - grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "version too old for xen boot"); return NULL; } @@ -66,65 +66,65 @@ grub_xen_file_and_cmdline (grub_file_t file, if (payload_length < sizeof (magic)) { - grub_error (GRUB_ERR_BAD_OS, "payload too short"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "payload too short"); return NULL; } - grub_dprintf ("xen", "found bzimage payload 0x%llx-0x%llx\n", + VasEBoot_dprintf ("xen", "found bzimage payload 0x%llx-0x%llx\n", (unsigned long long) payload_offset, (unsigned long long) lh.payload_length); if (cmdline) - grub_pass_verity_hash (&lh, cmdline, cmdline_max_len); + VasEBoot_pass_verity_hash (&lh, cmdline, cmdline_max_len); - grub_file_seek (file, payload_offset); + VasEBoot_file_seek (file, payload_offset); - if (grub_file_read (file, &magic, sizeof (magic)) != sizeof (magic)) + if (VasEBoot_file_read (file, &magic, sizeof (magic)) != sizeof (magic)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), file->name); goto fail; } /* Kernel suffixes xz payload with their uncompressed size. Trim it. */ - if (grub_memcmp (magic, XZ_MAGIC, sizeof (XZ_MAGIC) - 1) == 0) + if (VasEBoot_memcmp (magic, XZ_MAGIC, sizeof (XZ_MAGIC) - 1) == 0) payload_length -= 4; - off_file = grub_file_offset_open (file, payload_offset, + off_file = VasEBoot_file_offset_open (file, payload_offset, payload_length); if (!off_file) goto fail; - elf = grub_elf_file (off_file, file->name); + elf = VasEBoot_elf_file (off_file, file->name); if (elf) return elf; - grub_file_offset_close (off_file); + VasEBoot_file_offset_close (off_file); fail: - grub_error (GRUB_ERR_BAD_OS, "not xen image"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "not xen image"); return NULL; } -grub_err_t -grub_xen_get_info (grub_elf_t elf, struct grub_xen_file_info * xi) +VasEBoot_err_t +VasEBoot_xen_get_info (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info * xi) { - grub_memset (xi, 0, sizeof (*xi)); + VasEBoot_memset (xi, 0, sizeof (*xi)); - if (grub_elf_is_elf64 (elf) + if (VasEBoot_elf_is_elf64 (elf) && elf->ehdr.ehdr64.e_machine - == grub_cpu_to_le16_compile_time (EM_X86_64) + == VasEBoot_cpu_to_le16_compile_time (EM_X86_64) && elf->ehdr.ehdr64.e_ident[EI_DATA] == ELFDATA2LSB) { - xi->arch = GRUB_XEN_FILE_X86_64; - return grub_xen_get_info64 (elf, xi); + xi->arch = VasEBoot_XEN_FILE_X86_64; + return VasEBoot_xen_get_info64 (elf, xi); } - if (grub_elf_is_elf32 (elf) - && elf->ehdr.ehdr32.e_machine == grub_cpu_to_le16_compile_time (EM_386) + if (VasEBoot_elf_is_elf32 (elf) + && elf->ehdr.ehdr32.e_machine == VasEBoot_cpu_to_le16_compile_time (EM_386) && elf->ehdr.ehdr32.e_ident[EI_DATA] == ELFDATA2LSB) { - xi->arch = GRUB_XEN_FILE_I386; - return grub_xen_get_info32 (elf, xi); + xi->arch = VasEBoot_XEN_FILE_I386; + return VasEBoot_xen_get_info32 (elf, xi); } - return grub_error (GRUB_ERR_BAD_OS, "unknown ELF type"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "unknown ELF type"); } diff --git a/VasEBoot-core/loader/i386/xen_file32.c b/VasEBoot-core/loader/i386/xen_file32.c index 340d44569..58d4ec9cf 100644 --- a/VasEBoot-core/loader/i386/xen_file32.c +++ b/VasEBoot-core/loader/i386/xen_file32.c @@ -1,7 +1,7 @@ -#define GRUB_TARGET_WORDSIZE 32 +#define VasEBoot_TARGET_WORDSIZE 32 #define XX 32 -#define grub_le_to_cpu_addr grub_le_to_cpu32 +#define VasEBoot_le_to_cpu_addr VasEBoot_le_to_cpu32 #define ehdrXX ehdr32 -#define grub_xen_get_infoXX grub_xen_get_info32 +#define VasEBoot_xen_get_infoXX VasEBoot_xen_get_info32 #define FOR_ELF_PHDRS FOR_ELF32_PHDRS #include "xen_fileXX.c" diff --git a/VasEBoot-core/loader/i386/xen_file64.c b/VasEBoot-core/loader/i386/xen_file64.c index c41049369..cd33beda3 100644 --- a/VasEBoot-core/loader/i386/xen_file64.c +++ b/VasEBoot-core/loader/i386/xen_file64.c @@ -1,7 +1,7 @@ -#define GRUB_TARGET_WORDSIZE 64 +#define VasEBoot_TARGET_WORDSIZE 64 #define XX 64 -#define grub_le_to_cpu_addr grub_le_to_cpu64 +#define VasEBoot_le_to_cpu_addr VasEBoot_le_to_cpu64 #define ehdrXX ehdr64 -#define grub_xen_get_infoXX grub_xen_get_info64 +#define VasEBoot_xen_get_infoXX VasEBoot_xen_get_info64 #define FOR_ELF_PHDRS FOR_ELF64_PHDRS #include "xen_fileXX.c" diff --git a/VasEBoot-core/loader/i386/xen_fileXX.c b/VasEBoot-core/loader/i386/xen_fileXX.c index fb66e66fe..15fa27ef4 100644 --- a/VasEBoot-core/loader/i386/xen_fileXX.c +++ b/VasEBoot-core/loader/i386/xen_fileXX.c @@ -1,155 +1,155 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include #include -static grub_err_t -parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, - grub_off_t off, grub_size_t sz) +static VasEBoot_err_t +parse_xen_guest (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info *xi, + VasEBoot_off_t off, VasEBoot_size_t sz) { char *buf; char *ptr; int has_paddr = 0; - grub_errno = GRUB_ERR_NONE; - if (grub_file_seek (elf->file, off) == (grub_off_t) -1) - return grub_errno; - buf = grub_malloc (sz); + VasEBoot_errno = VasEBoot_ERR_NONE; + if (VasEBoot_file_seek (elf->file, off) == (VasEBoot_off_t) -1) + return VasEBoot_errno; + buf = VasEBoot_malloc (sz); if (!buf) - return grub_errno; + return VasEBoot_errno; - if (grub_file_read (elf->file, buf, sz) != (grub_ssize_t) sz) + if (VasEBoot_file_read (elf->file, buf, sz) != (VasEBoot_ssize_t) sz) { - if (grub_errno) + if (VasEBoot_errno) goto out; - grub_free (buf); - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_free (buf); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), elf->file->name); } xi->has_xen_guest = 1; - for (ptr = buf; ptr && ptr - buf < (grub_ssize_t) sz; - ptr = grub_strchr (ptr, ','), (ptr ? ptr++ : 0)) + for (ptr = buf; ptr && ptr - buf < (VasEBoot_ssize_t) sz; + ptr = VasEBoot_strchr (ptr, ','), (ptr ? ptr++ : 0)) { - if (grub_strncmp (ptr, "PAE=no,", sizeof ("PAE=no,") - 1) == 0) + if (VasEBoot_strncmp (ptr, "PAE=no,", sizeof ("PAE=no,") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386; + xi->arch = VasEBoot_XEN_FILE_I386; continue; } - if (grub_strncmp (ptr, "PAE=yes,", sizeof ("PAE=yes,") - 1) == 0) + if (VasEBoot_strncmp (ptr, "PAE=yes,", sizeof ("PAE=yes,") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386_PAE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE; continue; } - if (grub_strncmp (ptr, "PAE=yes[extended-cr3],", + if (VasEBoot_strncmp (ptr, "PAE=yes[extended-cr3],", sizeof ("PAE=yes[extended-cr3],") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386_PAE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE; xi->extended_cr3 = 1; continue; } - if (grub_strncmp (ptr, "PAE=bimodal,", sizeof ("PAE=bimodal,") - 1) == 0) + if (VasEBoot_strncmp (ptr, "PAE=bimodal,", sizeof ("PAE=bimodal,") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386_PAE_BIMODE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE_BIMODE; continue; } - if (grub_strncmp (ptr, "PAE=bimodal[extended-cr3],", + if (VasEBoot_strncmp (ptr, "PAE=bimodal[extended-cr3],", sizeof ("PAE=bimodal[extended-cr3],") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386_PAE_BIMODE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE_BIMODE; xi->extended_cr3 = 1; continue; } - if (grub_strncmp (ptr, "PAE=yes,bimodal,", sizeof ("PAE=yes,bimodal,") - 1) == 0) + if (VasEBoot_strncmp (ptr, "PAE=yes,bimodal,", sizeof ("PAE=yes,bimodal,") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386_PAE_BIMODE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE_BIMODE; continue; } - if (grub_strncmp (ptr, "PAE=yes[extended-cr3],bimodal,", + if (VasEBoot_strncmp (ptr, "PAE=yes[extended-cr3],bimodal,", sizeof ("PAE=yes[extended-cr3],bimodal,") - 1) == 0) { - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) continue; - xi->arch = GRUB_XEN_FILE_I386_PAE_BIMODE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE_BIMODE; xi->extended_cr3 = 1; continue; } - if (grub_strncmp (ptr, "VIRT_BASE=", sizeof ("VIRT_BASE=") - 1) == 0) + if (VasEBoot_strncmp (ptr, "VIRT_BASE=", sizeof ("VIRT_BASE=") - 1) == 0) { - xi->virt_base = grub_strtoull (ptr + sizeof ("VIRT_BASE=") - 1, &ptr, 16); - if (grub_errno) + xi->virt_base = VasEBoot_strtoull (ptr + sizeof ("VIRT_BASE=") - 1, &ptr, 16); + if (VasEBoot_errno) goto out; continue; } - if (grub_strncmp (ptr, "VIRT_ENTRY=", sizeof ("VIRT_ENTRY=") - 1) == 0) + if (VasEBoot_strncmp (ptr, "VIRT_ENTRY=", sizeof ("VIRT_ENTRY=") - 1) == 0) { - xi->entry_point = grub_strtoull (ptr + sizeof ("VIRT_ENTRY=") - 1, &ptr, 16); - if (grub_errno) + xi->entry_point = VasEBoot_strtoull (ptr + sizeof ("VIRT_ENTRY=") - 1, &ptr, 16); + if (VasEBoot_errno) goto out; continue; } - if (grub_strncmp (ptr, "HYPERCALL_PAGE=", sizeof ("HYPERCALL_PAGE=") - 1) == 0) + if (VasEBoot_strncmp (ptr, "HYPERCALL_PAGE=", sizeof ("HYPERCALL_PAGE=") - 1) == 0) { - xi->hypercall_page = grub_strtoull (ptr + sizeof ("HYPERCALL_PAGE=") - 1, &ptr, 16); + xi->hypercall_page = VasEBoot_strtoull (ptr + sizeof ("HYPERCALL_PAGE=") - 1, &ptr, 16); xi->has_hypercall_page = 1; - if (grub_errno) + if (VasEBoot_errno) goto out; continue; } - if (grub_strncmp (ptr, "ELF_PADDR_OFFSET=", sizeof ("ELF_PADDR_OFFSET=") - 1) == 0) + if (VasEBoot_strncmp (ptr, "ELF_PADDR_OFFSET=", sizeof ("ELF_PADDR_OFFSET=") - 1) == 0) { - xi->paddr_offset = grub_strtoull (ptr + sizeof ("ELF_PADDR_OFFSET=") - 1, &ptr, 16); + xi->paddr_offset = VasEBoot_strtoull (ptr + sizeof ("ELF_PADDR_OFFSET=") - 1, &ptr, 16); has_paddr = 1; - if (grub_errno) + if (VasEBoot_errno) goto out; continue; } @@ -160,131 +160,131 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->paddr_offset = xi->virt_base; out: - grub_free (buf); + VasEBoot_free (buf); - return grub_errno; + return VasEBoot_errno; } #pragma GCC diagnostic ignored "-Wcast-align" -static grub_err_t -parse_note (grub_elf_t elf, struct grub_xen_file_info *xi, - grub_off_t off, grub_size_t sz) +static VasEBoot_err_t +parse_note (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info *xi, + VasEBoot_off_t off, VasEBoot_size_t sz) { - grub_uint32_t *buf; - grub_uint32_t *ptr; - if (grub_file_seek (elf->file, off) == (grub_off_t) -1) - return grub_errno; - buf = grub_malloc (sz); + VasEBoot_uint32_t *buf; + VasEBoot_uint32_t *ptr; + if (VasEBoot_file_seek (elf->file, off) == (VasEBoot_off_t) -1) + return VasEBoot_errno; + buf = VasEBoot_malloc (sz); if (!buf) - return grub_errno; + return VasEBoot_errno; - if (grub_file_read (elf->file, buf, sz) != (grub_ssize_t) sz) + if (VasEBoot_file_read (elf->file, buf, sz) != (VasEBoot_ssize_t) sz) { - if (grub_errno) - return grub_errno; - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (VasEBoot_errno) + return VasEBoot_errno; + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), elf->file->name); } - for (ptr = buf; ptr - buf < (grub_ssize_t) (sz / sizeof (grub_uint32_t));) + for (ptr = buf; ptr - buf < (VasEBoot_ssize_t) (sz / sizeof (VasEBoot_uint32_t));) { Elf_Nhdr *nh = (Elf_Nhdr *) ptr; char *name; - grub_uint32_t *desc; - grub_uint32_t namesz, descsz; - ptr += sizeof (*nh) / sizeof (grub_uint32_t); + VasEBoot_uint32_t *desc; + VasEBoot_uint32_t namesz, descsz; + ptr += sizeof (*nh) / sizeof (VasEBoot_uint32_t); name = (char *) ptr; - namesz = grub_le_to_cpu32 (nh->n_namesz); - descsz = grub_le_to_cpu32 (nh->n_descsz); + namesz = VasEBoot_le_to_cpu32 (nh->n_namesz); + descsz = VasEBoot_le_to_cpu32 (nh->n_descsz); ptr += (namesz + 3) / 4; desc = ptr; - ptr += (grub_le_to_cpu32 (nh->n_descsz) + 3) / 4; - if ((namesz < 3) || grub_memcmp (name, "Xen", namesz == 3 ? 3 : 4) != 0) + ptr += (VasEBoot_le_to_cpu32 (nh->n_descsz) + 3) / 4; + if ((namesz < 3) || VasEBoot_memcmp (name, "Xen", namesz == 3 ? 3 : 4) != 0) continue; xi->has_note = 1; switch (nh->n_type) { case XEN_ELFNOTE_ENTRY: - xi->entry_point = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->entry_point = VasEBoot_le_to_cpu_addr (*(Elf_Addr *) desc); break; case XEN_ELFNOTE_HYPERCALL_PAGE: - xi->hypercall_page = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->hypercall_page = VasEBoot_le_to_cpu_addr (*(Elf_Addr *) desc); xi->has_hypercall_page = 1; break; case XEN_ELFNOTE_VIRT_BASE: - xi->virt_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->virt_base = VasEBoot_le_to_cpu_addr (*(Elf_Addr *) desc); break; case XEN_ELFNOTE_PADDR_OFFSET: - xi->paddr_offset = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->paddr_offset = VasEBoot_le_to_cpu_addr (*(Elf_Addr *) desc); break; case XEN_ELFNOTE_XEN_VERSION: - grub_dprintf ("xen", "xenversion = `%s'\n", (char *) desc); + VasEBoot_dprintf ("xen", "xenversion = `%s'\n", (char *) desc); break; case XEN_ELFNOTE_GUEST_OS: - grub_dprintf ("xen", "name = `%s'\n", (char *) desc); + VasEBoot_dprintf ("xen", "name = `%s'\n", (char *) desc); break; case XEN_ELFNOTE_GUEST_VERSION: - grub_dprintf ("xen", "version = `%s'\n", (char *) desc); + VasEBoot_dprintf ("xen", "version = `%s'\n", (char *) desc); break; case XEN_ELFNOTE_LOADER: if (descsz < 7 - || grub_memcmp (desc, "generic", descsz == 7 ? 7 : 8) != 0) - return grub_error (GRUB_ERR_BAD_OS, "invalid loader"); + || VasEBoot_memcmp (desc, "generic", descsz == 7 ? 7 : 8) != 0) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid loader"); break; /* PAE */ case XEN_ELFNOTE_PAE_MODE: - grub_dprintf ("xen", "pae = `%s', %d, %d\n", (char *) desc, + VasEBoot_dprintf ("xen", "pae = `%s', %d, %d\n", (char *) desc, xi->arch, descsz); - if (xi->arch != GRUB_XEN_FILE_I386 - && xi->arch != GRUB_XEN_FILE_I386_PAE - && xi->arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xi->arch != VasEBoot_XEN_FILE_I386 + && xi->arch != VasEBoot_XEN_FILE_I386_PAE + && xi->arch != VasEBoot_XEN_FILE_I386_PAE_BIMODE) break; - if (descsz >= 3 && grub_memcmp (desc, "yes", + if (descsz >= 3 && VasEBoot_memcmp (desc, "yes", descsz == 3 ? 3 : 4) == 0) { xi->extended_cr3 = 1; - xi->arch = GRUB_XEN_FILE_I386_PAE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE; } - if (descsz >= 7 && grub_memcmp (desc, "bimodal", + if (descsz >= 7 && VasEBoot_memcmp (desc, "bimodal", descsz == 7 ? 7 : 8) == 0) { xi->extended_cr3 = 1; - xi->arch = GRUB_XEN_FILE_I386_PAE_BIMODE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE_BIMODE; } - if (descsz >= 11 && grub_memcmp (desc, "yes,bimodal", + if (descsz >= 11 && VasEBoot_memcmp (desc, "yes,bimodal", descsz == 11 ? 11 : 12) == 0) { xi->extended_cr3 = 1; - xi->arch = GRUB_XEN_FILE_I386_PAE_BIMODE; + xi->arch = VasEBoot_XEN_FILE_I386_PAE_BIMODE; } - if (descsz >= 2 && grub_memcmp (desc, "no", + if (descsz >= 2 && VasEBoot_memcmp (desc, "no", descsz == 2 ? 2 : 3) == 0) - xi->arch = GRUB_XEN_FILE_I386; + xi->arch = VasEBoot_XEN_FILE_I386; break; case XEN_ELFNOTE_INIT_P2M: - xi->p2m_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->p2m_base = VasEBoot_le_to_cpu_addr (*(Elf_Addr *) desc); xi->has_p2m_base = 1; break; case XEN_ELFNOTE_MOD_START_PFN: - xi->unmapped_initrd = !!grub_le_to_cpu32(*(grub_uint32_t *) desc); + xi->unmapped_initrd = !!VasEBoot_le_to_cpu32(*(VasEBoot_uint32_t *) desc); break; default: - grub_dprintf ("xen", "unknown note type %d\n", nh->n_type); + VasEBoot_dprintf ("xen", "unknown note type %d\n", nh->n_type); break; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_xen_get_infoXX (grub_elf_t elf, struct grub_xen_file_info *xi) +VasEBoot_err_t +VasEBoot_xen_get_infoXX (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info *xi) { Elf_Shdr *s, *s0; - grub_size_t shnum = elf->ehdr.ehdrXX.e_shnum; - grub_size_t shentsize = elf->ehdr.ehdrXX.e_shentsize; - grub_size_t shsize = shnum * shentsize; - grub_off_t stroff; - grub_err_t err; + VasEBoot_size_t shnum = elf->ehdr.ehdrXX.e_shnum; + VasEBoot_size_t shentsize = elf->ehdr.ehdrXX.e_shentsize; + VasEBoot_size_t shsize = shnum * shentsize; + VasEBoot_off_t stroff; + VasEBoot_err_t err; Elf_Phdr *phdr; xi->kern_end = 0; @@ -316,27 +316,27 @@ grub_xen_get_infoXX (grub_elf_t elf, struct grub_xen_file_info *xi) } if (xi->has_note) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (!shnum || !shentsize) - return grub_error (GRUB_ERR_BAD_OS, "no XEN note"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "no XEN note"); - s0 = grub_malloc (shsize); + s0 = VasEBoot_malloc (shsize); if (!s0) - return grub_errno; + return VasEBoot_errno; - if (grub_file_seek (elf->file, elf->ehdr.ehdrXX.e_shoff) == (grub_off_t) -1) + if (VasEBoot_file_seek (elf->file, elf->ehdr.ehdrXX.e_shoff) == (VasEBoot_off_t) -1) { - err = grub_errno; + err = VasEBoot_errno; goto cleanup; } - if (grub_file_read (elf->file, s0, shsize) != (grub_ssize_t) shsize) + if (VasEBoot_file_read (elf->file, s0, shsize) != (VasEBoot_ssize_t) shsize) { - if (grub_errno) - err = grub_errno; + if (VasEBoot_errno) + err = VasEBoot_errno; else - err = grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), elf->file->name); goto cleanup; } @@ -348,31 +348,31 @@ grub_xen_get_infoXX (grub_elf_t elf, struct grub_xen_file_info *xi) s = (Elf_Shdr *) ((char *) s + shentsize)) { char name[sizeof("__xen_guest")]; - grub_memset (name, 0, sizeof (name)); - if (grub_file_seek (elf->file, stroff + s->sh_name) == (grub_off_t) -1) + VasEBoot_memset (name, 0, sizeof (name)); + if (VasEBoot_file_seek (elf->file, stroff + s->sh_name) == (VasEBoot_off_t) -1) { - err = grub_errno; + err = VasEBoot_errno; goto cleanup; } - if (grub_file_read (elf->file, name, sizeof (name)) != (grub_ssize_t) sizeof (name)) + if (VasEBoot_file_read (elf->file, name, sizeof (name)) != (VasEBoot_ssize_t) sizeof (name)) { - if (grub_errno) + if (VasEBoot_errno) { - err = grub_errno; + err = VasEBoot_errno; goto cleanup; } continue; } - if (grub_memcmp (name, "__xen_guest", + if (VasEBoot_memcmp (name, "__xen_guest", sizeof("__xen_guest")) != 0) continue; err = parse_xen_guest (elf, xi, s->sh_offset, s->sh_size); goto cleanup; } - err = grub_error (GRUB_ERR_BAD_OS, "no XEN note found"); + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, "no XEN note found"); cleanup: - grub_free (s0); + VasEBoot_free (s0); return err; } diff --git a/VasEBoot-core/loader/i386/xnu.c b/VasEBoot-core/loader/i386/xnu.c index 59ef73a73..55854d950 100644 --- a/VasEBoot-core/loader/i386/xnu.c +++ b/VasEBoot-core/loader/i386/xnu.c @@ -1,74 +1,74 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) #define DEFAULT_VIDEO_MODE "auto" -char grub_xnu_cmdline[1024]; -grub_uint32_t grub_xnu_entry_point, grub_xnu_arg1, grub_xnu_stack; +char VasEBoot_xnu_cmdline[1024]; +VasEBoot_uint32_t VasEBoot_xnu_entry_point, VasEBoot_xnu_arg1, VasEBoot_xnu_stack; /* Aliases set for some tables. */ struct tbl_alias { - grub_efi_guid_t guid; + VasEBoot_efi_guid_t guid; const char *name; }; static struct tbl_alias table_aliases[] = { - {GRUB_EFI_ACPI_20_TABLE_GUID, "ACPI_20"}, - {GRUB_EFI_ACPI_TABLE_GUID, "ACPI"}, + {VasEBoot_EFI_ACPI_20_TABLE_GUID, "ACPI_20"}, + {VasEBoot_EFI_ACPI_TABLE_GUID, "ACPI"}, }; -struct grub_xnu_devprop_device_descriptor +struct VasEBoot_xnu_devprop_device_descriptor { - struct grub_xnu_devprop_device_descriptor *next; - struct grub_xnu_devprop_device_descriptor **prev; + struct VasEBoot_xnu_devprop_device_descriptor *next; + struct VasEBoot_xnu_devprop_device_descriptor **prev; struct property_descriptor *properties; - struct grub_efi_device_path *path; + struct VasEBoot_efi_device_path *path; int pathlen; }; static int -utf16_strlen (grub_uint16_t *in) +utf16_strlen (VasEBoot_uint16_t *in) { int i; for (i = 0; in[i]; i++); @@ -76,10 +76,10 @@ utf16_strlen (grub_uint16_t *in) } /* Read frequency from a string in MHz and return it in Hz. */ -static grub_uint64_t +static VasEBoot_uint64_t readfrequency (const char *str) { - grub_uint64_t num = 0; + VasEBoot_uint64_t num = 0; int mul = 1000000; int found = 0; @@ -87,7 +87,7 @@ readfrequency (const char *str) { unsigned long digit; - digit = grub_tolower (*str) - '0'; + digit = VasEBoot_tolower (*str) - '0'; if (digit > 9) break; @@ -104,7 +104,7 @@ readfrequency (const char *str) { unsigned long digit; - digit = grub_tolower (*str) - '0'; + digit = VasEBoot_tolower (*str) - '0'; if (digit > 9) break; @@ -122,27 +122,27 @@ readfrequency (const char *str) } /* Thanks to Kabyl for precious information about Intel architecture. */ -static grub_uint64_t +static VasEBoot_uint64_t guessfsb (void) { - const grub_uint64_t sane_value = 100000000; - grub_uint32_t manufacturer[3], max_cpuid, capabilities, msrlow; - grub_uint32_t a, b, d, divisor; + const VasEBoot_uint64_t sane_value = 100000000; + VasEBoot_uint32_t manufacturer[3], max_cpuid, capabilities, msrlow; + VasEBoot_uint32_t a, b, d, divisor; - if (! grub_cpu_is_cpuid_supported ()) + if (! VasEBoot_cpu_is_cpuid_supported ()) return sane_value; - grub_cpuid (0, max_cpuid, manufacturer[0], manufacturer[2], manufacturer[1]); + VasEBoot_cpuid (0, max_cpuid, manufacturer[0], manufacturer[2], manufacturer[1]); /* Only Intel for now is done. */ - if (grub_memcmp (manufacturer, "GenuineIntel", 12) != 0) + if (VasEBoot_memcmp (manufacturer, "GenuineIntel", 12) != 0) return sane_value; /* Check Speedstep. */ if (max_cpuid < 1) return sane_value; - grub_cpuid (1, a, b, capabilities, d); + VasEBoot_cpuid (1, a, b, capabilities, d); if (! (capabilities & (1 << 7))) return sane_value; @@ -154,261 +154,261 @@ guessfsb (void) : : "%ecx", "%eax"); - grub_uint64_t v; - grub_uint32_t r; + VasEBoot_uint64_t v; + VasEBoot_uint32_t r; - /* (2000ULL << 32) / grub_tsc_rate */ + /* (2000ULL << 32) / VasEBoot_tsc_rate */ /* Assumption: TSC frequency is over 2 MHz. */ - v = 0xffffffff / grub_tsc_rate; + v = 0xffffffff / VasEBoot_tsc_rate; v *= 2000; - /* v is at most 2000 off from (2000ULL << 32) / grub_tsc_rate. - Since grub_tsc_rate < 2^32/2^11=2^21, so no overflow. + /* v is at most 2000 off from (2000ULL << 32) / VasEBoot_tsc_rate. + Since VasEBoot_tsc_rate < 2^32/2^11=2^21, so no overflow. */ - r = (2000ULL << 32) - v * grub_tsc_rate; - v += r / grub_tsc_rate; + r = (2000ULL << 32) - v * VasEBoot_tsc_rate; + v += r / VasEBoot_tsc_rate; divisor = ((msrlow >> 7) & 0x3e) | ((msrlow >> 14) & 1); if (divisor == 0) return sane_value; - return grub_divmod64 (v, divisor, 0); + return VasEBoot_divmod64 (v, divisor, 0); } struct property_descriptor { struct property_descriptor *next; struct property_descriptor **prev; - grub_uint8_t *name; - grub_uint16_t *name16; + VasEBoot_uint8_t *name; + VasEBoot_uint16_t *name16; int name16len; int length; void *data; }; -static struct grub_xnu_devprop_device_descriptor *devices = 0; +static struct VasEBoot_xnu_devprop_device_descriptor *devices = 0; -grub_err_t -grub_xnu_devprop_remove_property (struct grub_xnu_devprop_device_descriptor *dev, +VasEBoot_err_t +VasEBoot_xnu_devprop_remove_property (struct VasEBoot_xnu_devprop_device_descriptor *dev, char *name) { struct property_descriptor *prop; - prop = grub_named_list_find (GRUB_AS_NAMED_LIST (dev->properties), name); + prop = VasEBoot_named_list_find (VasEBoot_AS_NAMED_LIST (dev->properties), name); if (!prop) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - grub_free (prop->name); - grub_free (prop->name16); - grub_free (prop->data); + VasEBoot_free (prop->name); + VasEBoot_free (prop->name16); + VasEBoot_free (prop->data); - grub_list_remove (GRUB_AS_LIST (prop)); + VasEBoot_list_remove (VasEBoot_AS_LIST (prop)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_xnu_devprop_remove_device (struct grub_xnu_devprop_device_descriptor *dev) +VasEBoot_err_t +VasEBoot_xnu_devprop_remove_device (struct VasEBoot_xnu_devprop_device_descriptor *dev) { void *t; struct property_descriptor *prop; - grub_list_remove (GRUB_AS_LIST (dev)); + VasEBoot_list_remove (VasEBoot_AS_LIST (dev)); for (prop = dev->properties; prop; ) { - grub_free (prop->name); - grub_free (prop->name16); - grub_free (prop->data); + VasEBoot_free (prop->name); + VasEBoot_free (prop->name16); + VasEBoot_free (prop->data); t = prop; prop = prop->next; - grub_free (t); + VasEBoot_free (t); } - grub_free (dev->path); - grub_free (dev); + VasEBoot_free (dev->path); + VasEBoot_free (dev); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_xnu_devprop_device_descriptor * -grub_xnu_devprop_add_device (struct grub_efi_device_path *path, int length) +struct VasEBoot_xnu_devprop_device_descriptor * +VasEBoot_xnu_devprop_add_device (struct VasEBoot_efi_device_path *path, int length) { - struct grub_xnu_devprop_device_descriptor *ret; + struct VasEBoot_xnu_devprop_device_descriptor *ret; - ret = grub_zalloc (sizeof (*ret)); + ret = VasEBoot_zalloc (sizeof (*ret)); if (!ret) return 0; - ret->path = grub_malloc (length); + ret->path = VasEBoot_malloc (length); if (!ret->path) { - grub_free (ret); + VasEBoot_free (ret); return 0; } ret->pathlen = length; - grub_memcpy (ret->path, path, length); + VasEBoot_memcpy (ret->path, path, length); - grub_list_push (GRUB_AS_LIST_P (&devices), GRUB_AS_LIST (ret)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&devices), VasEBoot_AS_LIST (ret)); return ret; } -static grub_err_t -grub_xnu_devprop_add_property (struct grub_xnu_devprop_device_descriptor *dev, - grub_uint8_t *utf8, grub_uint16_t *utf16, +static VasEBoot_err_t +VasEBoot_xnu_devprop_add_property (struct VasEBoot_xnu_devprop_device_descriptor *dev, + VasEBoot_uint8_t *utf8, VasEBoot_uint16_t *utf16, int utf16len, void *data, int datalen) { struct property_descriptor *prop; - prop = grub_malloc (sizeof (*prop)); + prop = VasEBoot_malloc (sizeof (*prop)); if (!prop) - return grub_errno; + return VasEBoot_errno; prop->name = utf8; prop->name16 = utf16; prop->name16len = utf16len; prop->length = datalen; - prop->data = grub_malloc (prop->length); + prop->data = VasEBoot_malloc (prop->length); if (!prop->data) { - grub_free (prop->name); - grub_free (prop->name16); - grub_free (prop); - return grub_errno; + VasEBoot_free (prop->name); + VasEBoot_free (prop->name16); + VasEBoot_free (prop); + return VasEBoot_errno; } - grub_memcpy (prop->data, data, prop->length); - grub_list_push (GRUB_AS_LIST_P (&dev->properties), - GRUB_AS_LIST (prop)); - return GRUB_ERR_NONE; + VasEBoot_memcpy (prop->data, data, prop->length); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&dev->properties), + VasEBoot_AS_LIST (prop)); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_xnu_devprop_add_property_utf8 (struct grub_xnu_devprop_device_descriptor *dev, +VasEBoot_err_t +VasEBoot_xnu_devprop_add_property_utf8 (struct VasEBoot_xnu_devprop_device_descriptor *dev, char *name, void *data, int datalen) { - grub_uint8_t *utf8; - grub_uint16_t *utf16; + VasEBoot_uint8_t *utf8; + VasEBoot_uint16_t *utf16; int len, utf16len; - grub_err_t err; + VasEBoot_err_t err; - utf8 = (grub_uint8_t *) grub_strdup (name); + utf8 = (VasEBoot_uint8_t *) VasEBoot_strdup (name); if (!utf8) - return grub_errno; + return VasEBoot_errno; - len = grub_strlen (name); - utf16 = grub_malloc (sizeof (grub_uint16_t) * len); + len = VasEBoot_strlen (name); + utf16 = VasEBoot_malloc (sizeof (VasEBoot_uint16_t) * len); if (!utf16) { - grub_free (utf8); - return grub_errno; + VasEBoot_free (utf8); + return VasEBoot_errno; } - utf16len = grub_utf8_to_utf16 (utf16, len, utf8, len, NULL); + utf16len = VasEBoot_utf8_to_utf16 (utf16, len, utf8, len, NULL); if (utf16len < 0) { - grub_free (utf8); - grub_free (utf16); - return grub_errno; + VasEBoot_free (utf8); + VasEBoot_free (utf16); + return VasEBoot_errno; } - err = grub_xnu_devprop_add_property (dev, utf8, utf16, + err = VasEBoot_xnu_devprop_add_property (dev, utf8, utf16, utf16len, data, datalen); if (err) { - grub_free (utf8); - grub_free (utf16); + VasEBoot_free (utf8); + VasEBoot_free (utf16); return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_xnu_devprop_add_property_utf16 (struct grub_xnu_devprop_device_descriptor *dev, - grub_uint16_t *name, int namelen, +VasEBoot_err_t +VasEBoot_xnu_devprop_add_property_utf16 (struct VasEBoot_xnu_devprop_device_descriptor *dev, + VasEBoot_uint16_t *name, int namelen, void *data, int datalen) { - grub_uint8_t *utf8; - grub_uint16_t *utf16; - grub_err_t err; + VasEBoot_uint8_t *utf8; + VasEBoot_uint16_t *utf16; + VasEBoot_err_t err; - utf16 = grub_malloc (sizeof (grub_uint16_t) * namelen); + utf16 = VasEBoot_malloc (sizeof (VasEBoot_uint16_t) * namelen); if (!utf16) - return grub_errno; - grub_memcpy (utf16, name, sizeof (grub_uint16_t) * namelen); + return VasEBoot_errno; + VasEBoot_memcpy (utf16, name, sizeof (VasEBoot_uint16_t) * namelen); - utf8 = grub_malloc (namelen * 4 + 1); + utf8 = VasEBoot_malloc (namelen * 4 + 1); if (!utf8) { - grub_free (utf16); - return grub_errno; + VasEBoot_free (utf16); + return VasEBoot_errno; } - *grub_utf16_to_utf8 ((grub_uint8_t *) utf8, name, namelen) = '\0'; + *VasEBoot_utf16_to_utf8 ((VasEBoot_uint8_t *) utf8, name, namelen) = '\0'; - err = grub_xnu_devprop_add_property (dev, utf8, utf16, + err = VasEBoot_xnu_devprop_add_property (dev, utf8, utf16, namelen, data, datalen); if (err) { - grub_free (utf8); - grub_free (utf16); + VasEBoot_free (utf8); + VasEBoot_free (utf16); return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_cpu_xnu_unload (void) +VasEBoot_cpu_xnu_unload (void) { - struct grub_xnu_devprop_device_descriptor *dev1, *dev2; + struct VasEBoot_xnu_devprop_device_descriptor *dev1, *dev2; for (dev1 = devices; dev1; ) { dev2 = dev1->next; - grub_xnu_devprop_remove_device (dev1); + VasEBoot_xnu_devprop_remove_device (dev1); dev1 = dev2; } } -static grub_err_t -grub_cpu_xnu_fill_devprop (void) +static VasEBoot_err_t +VasEBoot_cpu_xnu_fill_devprop (void) { - struct grub_xnu_devtree_key *efikey; - int total_length = sizeof (struct grub_xnu_devprop_header); - struct grub_xnu_devtree_key *devprop; - struct grub_xnu_devprop_device_descriptor *device; + struct VasEBoot_xnu_devtree_key *efikey; + int total_length = sizeof (struct VasEBoot_xnu_devprop_header); + struct VasEBoot_xnu_devtree_key *devprop; + struct VasEBoot_xnu_devprop_device_descriptor *device; void *ptr; - struct grub_xnu_devprop_header *head; + struct VasEBoot_xnu_devprop_header *head; void *t; int numdevs = 0; /* The key "efi". */ - efikey = grub_xnu_create_key (&grub_xnu_devtree_root, "efi"); + efikey = VasEBoot_xnu_create_key (&VasEBoot_xnu_devtree_root, "efi"); if (! efikey) - return grub_errno; + return VasEBoot_errno; for (device = devices; device; device = device->next) { struct property_descriptor *propdesc; - total_length += sizeof (struct grub_xnu_devprop_device_header); + total_length += sizeof (struct VasEBoot_xnu_devprop_device_header); total_length += device->pathlen; for (propdesc = device->properties; propdesc; propdesc = propdesc->next) { - total_length += sizeof (grub_uint32_t); - total_length += sizeof (grub_uint16_t) + total_length += sizeof (VasEBoot_uint32_t); + total_length += sizeof (VasEBoot_uint16_t) * (propdesc->name16len + 1); - total_length += sizeof (grub_uint32_t); + total_length += sizeof (VasEBoot_uint32_t); total_length += propdesc->length; } numdevs++; } - devprop = grub_xnu_create_value (&(efikey->first_child), "device-properties"); + devprop = VasEBoot_xnu_create_value (&(efikey->first_child), "device-properties"); if (!devprop) - return grub_errno; + return VasEBoot_errno; - devprop->data = grub_malloc (total_length); + devprop->data = VasEBoot_malloc (total_length); devprop->datasize = total_length; ptr = devprop->data; @@ -419,28 +419,28 @@ grub_cpu_xnu_fill_devprop (void) head->num_devices = numdevs; for (device = devices; device; ) { - struct grub_xnu_devprop_device_header *devhead; + struct VasEBoot_xnu_devprop_device_header *devhead; struct property_descriptor *propdesc; devhead = ptr; devhead->num_values = 0; ptr = devhead + 1; - grub_memcpy (ptr, device->path, device->pathlen); + VasEBoot_memcpy (ptr, device->path, device->pathlen); ptr = (char *) ptr + device->pathlen; for (propdesc = device->properties; propdesc; ) { - grub_uint32_t *len; - grub_uint16_t *name; + VasEBoot_uint32_t *len; + VasEBoot_uint16_t *name; void *data; len = ptr; - *len = 2 * propdesc->name16len + sizeof (grub_uint16_t) - + sizeof (grub_uint32_t); + *len = 2 * propdesc->name16len + sizeof (VasEBoot_uint16_t) + + sizeof (VasEBoot_uint32_t); ptr = len + 1; name = ptr; - grub_memcpy (name, propdesc->name16, 2 * propdesc->name16len); + VasEBoot_memcpy (name, propdesc->name16, 2 * propdesc->name16len); name += propdesc->name16len; /* NUL terminator. */ @@ -448,71 +448,71 @@ grub_cpu_xnu_fill_devprop (void) ptr = name + 1; len = ptr; - *len = propdesc->length + sizeof (grub_uint32_t); + *len = propdesc->length + sizeof (VasEBoot_uint32_t); data = len + 1; ptr = data; - grub_memcpy (ptr, propdesc->data, propdesc->length); + VasEBoot_memcpy (ptr, propdesc->data, propdesc->length); ptr = (char *) ptr + propdesc->length; - grub_free (propdesc->name); - grub_free (propdesc->name16); - grub_free (propdesc->data); + VasEBoot_free (propdesc->name); + VasEBoot_free (propdesc->name16); + VasEBoot_free (propdesc->data); t = propdesc; propdesc = propdesc->next; - grub_free (t); + VasEBoot_free (t); devhead->num_values++; } devhead->length = (char *) ptr - (char *) devhead; t = device; device = device->next; - grub_free (t); + VasEBoot_free (t); } devices = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_devprop_load (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_devprop_load (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_file_t file; + VasEBoot_file_t file; void *buf, *bufstart, *bufend; - struct grub_xnu_devprop_header *head; - grub_size_t size; + struct VasEBoot_xnu_devprop_header *head; + VasEBoot_size_t size; unsigned i, j; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; - size = grub_file_size (file); - buf = grub_malloc (size); + return VasEBoot_errno; + size = VasEBoot_file_size (file); + buf = VasEBoot_malloc (size); if (!buf) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } - if (grub_file_read (file, buf, size) != (grub_ssize_t) size) + if (VasEBoot_file_read (file, buf, size) != (VasEBoot_ssize_t) size) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } - grub_file_close (file); + VasEBoot_file_close (file); bufstart = buf; bufend = (char *) buf + size; head = buf; buf = head + 1; - for (i = 0; i < grub_le_to_cpu32 (head->num_devices) && buf < bufend; i++) + for (i = 0; i < VasEBoot_le_to_cpu32 (head->num_devices) && buf < bufend; i++) { - struct grub_efi_device_path *dp, *dpstart; - struct grub_xnu_devprop_device_descriptor *dev; - struct grub_xnu_devprop_device_header *devhead; + struct VasEBoot_efi_device_path *dp, *dpstart; + struct VasEBoot_xnu_devprop_device_descriptor *dev; + struct VasEBoot_xnu_devprop_device_header *devhead; devhead = buf; buf = devhead + 1; @@ -521,21 +521,21 @@ grub_cmd_devprop_load (grub_command_t cmd __attribute__ ((unused)), do { dp = buf; - buf = (char *) buf + GRUB_EFI_DEVICE_PATH_LENGTH (dp); + buf = (char *) buf + VasEBoot_EFI_DEVICE_PATH_LENGTH (dp); } - while (!GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp) && buf < bufend); + while (!VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (dp) && buf < bufend); - dev = grub_xnu_devprop_add_device (dpstart, (char *) buf + dev = VasEBoot_xnu_devprop_add_device (dpstart, (char *) buf - (char *) dpstart); - for (j = 0; j < grub_le_to_cpu32 (devhead->num_values) && buf < bufend; + for (j = 0; j < VasEBoot_le_to_cpu32 (devhead->num_values) && buf < bufend; j++) { - grub_uint32_t *namelen; - grub_uint32_t *datalen; - grub_uint16_t *utf16; + VasEBoot_uint32_t *namelen; + VasEBoot_uint32_t *datalen; + VasEBoot_uint16_t *utf16; void *data; - grub_err_t err; + VasEBoot_err_t err; namelen = buf; buf = namelen + 1; @@ -543,7 +543,7 @@ grub_cmd_devprop_load (grub_command_t cmd __attribute__ ((unused)), break; utf16 = buf; - buf = (char *) buf + *namelen - sizeof (grub_uint32_t); + buf = (char *) buf + *namelen - sizeof (VasEBoot_uint32_t); if (buf >= bufend) break; @@ -553,327 +553,327 @@ grub_cmd_devprop_load (grub_command_t cmd __attribute__ ((unused)), break; data = buf; - buf = (char *) buf + *datalen - sizeof (grub_uint32_t); + buf = (char *) buf + *datalen - sizeof (VasEBoot_uint32_t); if (buf >= bufend) break; - err = grub_xnu_devprop_add_property_utf16 - (dev, utf16, (*namelen - sizeof (grub_uint32_t) - - sizeof (grub_uint16_t)) / sizeof (grub_uint16_t), - data, *datalen - sizeof (grub_uint32_t)); + err = VasEBoot_xnu_devprop_add_property_utf16 + (dev, utf16, (*namelen - sizeof (VasEBoot_uint32_t) + - sizeof (VasEBoot_uint16_t)) / sizeof (VasEBoot_uint16_t), + data, *datalen - sizeof (VasEBoot_uint32_t)); if (err) { - grub_free (bufstart); + VasEBoot_free (bufstart); return err; } } } - grub_free (bufstart); - return GRUB_ERR_NONE; + VasEBoot_free (bufstart); + return VasEBoot_ERR_NONE; } /* Fill device tree. */ /* FIXME: some entries may be platform-agnostic. Move them to loader/xnu.c. */ -static grub_err_t -grub_cpu_xnu_fill_devicetree (grub_uint64_t *fsbfreq_out) +static VasEBoot_err_t +VasEBoot_cpu_xnu_fill_devicetree (VasEBoot_uint64_t *fsbfreq_out) { - struct grub_xnu_devtree_key *efikey; - struct grub_xnu_devtree_key *chosenkey; - struct grub_xnu_devtree_key *cfgtablekey; - struct grub_xnu_devtree_key *curval; - struct grub_xnu_devtree_key *runtimesrvkey; - struct grub_xnu_devtree_key *platformkey; + struct VasEBoot_xnu_devtree_key *efikey; + struct VasEBoot_xnu_devtree_key *chosenkey; + struct VasEBoot_xnu_devtree_key *cfgtablekey; + struct VasEBoot_xnu_devtree_key *curval; + struct VasEBoot_xnu_devtree_key *runtimesrvkey; + struct VasEBoot_xnu_devtree_key *platformkey; unsigned i, j; - grub_err_t err; + VasEBoot_err_t err; - chosenkey = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + chosenkey = VasEBoot_xnu_create_key (&VasEBoot_xnu_devtree_root, "chosen"); if (! chosenkey) - return grub_errno; + return VasEBoot_errno; /* Random seed. */ - curval = grub_xnu_create_value (&(chosenkey->first_child), "random-seed"); + curval = VasEBoot_xnu_create_value (&(chosenkey->first_child), "random-seed"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = 64; - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; + return VasEBoot_errno; /* Our random is not peer-reviewed but xnu uses this seed only for ASLR in kernel. */ - err = grub_crypto_get_random (curval->data, curval->datasize); + err = VasEBoot_crypto_get_random (curval->data, curval->datasize); if (err) return err; /* The value "model". */ /* FIXME: may this value be sometimes different? */ - curval = grub_xnu_create_value (&grub_xnu_devtree_root, "model"); + curval = VasEBoot_xnu_create_value (&VasEBoot_xnu_devtree_root, "model"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = sizeof ("ACPI"); - curval->data = grub_strdup ("ACPI"); - curval = grub_xnu_create_value (&grub_xnu_devtree_root, "compatible"); + curval->data = VasEBoot_strdup ("ACPI"); + curval = VasEBoot_xnu_create_value (&VasEBoot_xnu_devtree_root, "compatible"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = sizeof ("ACPI"); - curval->data = grub_strdup ("ACPI"); + curval->data = VasEBoot_strdup ("ACPI"); /* The key "efi". */ - efikey = grub_xnu_create_key (&grub_xnu_devtree_root, "efi"); + efikey = VasEBoot_xnu_create_key (&VasEBoot_xnu_devtree_root, "efi"); if (! efikey) - return grub_errno; + return VasEBoot_errno; /* Information about firmware. */ - curval = grub_xnu_create_value (&(efikey->first_child), "firmware-revision"); + curval = VasEBoot_xnu_create_value (&(efikey->first_child), "firmware-revision"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = (SYSTEM_TABLE_SIZEOF (firmware_revision)); - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; - grub_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)), + return VasEBoot_errno; + VasEBoot_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)), curval->datasize); - curval = grub_xnu_create_value (&(efikey->first_child), "firmware-vendor"); + curval = VasEBoot_xnu_create_value (&(efikey->first_child), "firmware-vendor"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = 2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1); - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; - grub_memcpy (curval->data, SYSTEM_TABLE_PTR (firmware_vendor), + return VasEBoot_errno; + VasEBoot_memcpy (curval->data, SYSTEM_TABLE_PTR (firmware_vendor), curval->datasize); - curval = grub_xnu_create_value (&(efikey->first_child), "firmware-abi"); + curval = VasEBoot_xnu_create_value (&(efikey->first_child), "firmware-abi"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = sizeof ("EFI32"); - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; + return VasEBoot_errno; if (SIZEOF_OF_UINTN == 4) - grub_memcpy (curval->data, "EFI32", curval->datasize); + VasEBoot_memcpy (curval->data, "EFI32", curval->datasize); else - grub_memcpy (curval->data, "EFI64", curval->datasize); + VasEBoot_memcpy (curval->data, "EFI64", curval->datasize); /* The key "platform". */ - platformkey = grub_xnu_create_key (&(efikey->first_child), + platformkey = VasEBoot_xnu_create_key (&(efikey->first_child), "platform"); if (! platformkey) - return grub_errno; + return VasEBoot_errno; /* Pass FSB frequency to the kernel. */ - curval = grub_xnu_create_value (&(platformkey->first_child), "FSBFrequency"); + curval = VasEBoot_xnu_create_value (&(platformkey->first_child), "FSBFrequency"); if (! curval) - return grub_errno; - curval->datasize = sizeof (grub_uint64_t); - curval->data = grub_malloc (curval->datasize); + return VasEBoot_errno; + curval->datasize = sizeof (VasEBoot_uint64_t); + curval->data = VasEBoot_malloc (curval->datasize); if (!curval->data) - return grub_errno; + return VasEBoot_errno; /* First see if user supplies the value. */ - const char *fsbvar = grub_env_get ("fsb"); - grub_uint64_t fsbfreq = 0; + const char *fsbvar = VasEBoot_env_get ("fsb"); + VasEBoot_uint64_t fsbfreq = 0; if (fsbvar) fsbfreq = readfrequency (fsbvar); /* Try autodetect. */ if (! fsbfreq) fsbfreq = guessfsb (); - *((grub_uint64_t *) curval->data) = fsbfreq; + *((VasEBoot_uint64_t *) curval->data) = fsbfreq; *fsbfreq_out = fsbfreq; - grub_dprintf ("xnu", "fsb autodetected as %llu\n", - (unsigned long long) *((grub_uint64_t *) curval->data)); + VasEBoot_dprintf ("xnu", "fsb autodetected as %llu\n", + (unsigned long long) *((VasEBoot_uint64_t *) curval->data)); - cfgtablekey = grub_xnu_create_key (&(efikey->first_child), + cfgtablekey = VasEBoot_xnu_create_key (&(efikey->first_child), "configuration-table"); if (!cfgtablekey) - return grub_errno; + return VasEBoot_errno; /* Fill "configuration-table" key. */ for (i = 0; i < SYSTEM_TABLE (num_table_entries); i++) { void *ptr; - struct grub_xnu_devtree_key *curkey; - grub_efi_packed_guid_t guid; + struct VasEBoot_xnu_devtree_key *curkey; + VasEBoot_efi_packed_guid_t guid; char guidbuf[64]; /* Retrieve current key. */ -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI { ptr = (void *) - grub_efi_system_table->configuration_table[i].vendor_table; - guid = grub_efi_system_table->configuration_table[i].vendor_guid; + VasEBoot_efi_system_table->configuration_table[i].vendor_table; + guid = VasEBoot_efi_system_table->configuration_table[i].vendor_guid; } #else if (SIZEOF_OF_UINTN == 4) { - ptr = (void *) (grub_addr_t) ((grub_efiemu_configuration_table32_t *) + ptr = (void *) (VasEBoot_addr_t) ((VasEBoot_efiemu_configuration_table32_t *) SYSTEM_TABLE_PTR (configuration_table))[i] .vendor_table; guid = - ((grub_efiemu_configuration_table32_t *) + ((VasEBoot_efiemu_configuration_table32_t *) SYSTEM_TABLE_PTR (configuration_table))[i].vendor_guid; } else { - ptr = (void *) (grub_addr_t) ((grub_efiemu_configuration_table64_t *) + ptr = (void *) (VasEBoot_addr_t) ((VasEBoot_efiemu_configuration_table64_t *) SYSTEM_TABLE_PTR (configuration_table))[i] .vendor_table; guid = - ((grub_efiemu_configuration_table64_t *) + ((VasEBoot_efiemu_configuration_table64_t *) SYSTEM_TABLE_PTR (configuration_table))[i].vendor_guid; } #endif /* The name of key for new table. */ - grub_snprintf (guidbuf, sizeof (guidbuf), "%08x-%04x-%04x-%02x%02x-", + VasEBoot_snprintf (guidbuf, sizeof (guidbuf), "%08x-%04x-%04x-%02x%02x-", guid.data1, guid.data2, guid.data3, guid.data4[0], guid.data4[1]); for (j = 2; j < 8; j++) - grub_snprintf (guidbuf + grub_strlen (guidbuf), - sizeof (guidbuf) - grub_strlen (guidbuf), + VasEBoot_snprintf (guidbuf + VasEBoot_strlen (guidbuf), + sizeof (guidbuf) - VasEBoot_strlen (guidbuf), "%02x", guid.data4[j]); /* For some reason GUID has to be in uppercase. */ for (j = 0; guidbuf[j] ; j++) if (guidbuf[j] >= 'a' && guidbuf[j] <= 'f') guidbuf[j] += 'A' - 'a'; - curkey = grub_xnu_create_key (&(cfgtablekey->first_child), guidbuf); + curkey = VasEBoot_xnu_create_key (&(cfgtablekey->first_child), guidbuf); if (! curkey) - return grub_errno; + return VasEBoot_errno; - curval = grub_xnu_create_value (&(curkey->first_child), "guid"); + curval = VasEBoot_xnu_create_value (&(curkey->first_child), "guid"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = sizeof (guid); - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; - grub_memcpy (curval->data, &guid, curval->datasize); + return VasEBoot_errno; + VasEBoot_memcpy (curval->data, &guid, curval->datasize); /* The value "table". */ - curval = grub_xnu_create_value (&(curkey->first_child), "table"); + curval = VasEBoot_xnu_create_value (&(curkey->first_child), "table"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = SIZEOF_OF_UINTN; - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; + return VasEBoot_errno; if (SIZEOF_OF_UINTN == 4) - *((grub_uint32_t *) curval->data) = (grub_addr_t) ptr; + *((VasEBoot_uint32_t *) curval->data) = (VasEBoot_addr_t) ptr; else - *((grub_uint64_t *) curval->data) = (grub_addr_t) ptr; + *((VasEBoot_uint64_t *) curval->data) = (VasEBoot_addr_t) ptr; /* Create alias. */ for (j = 0; j < ARRAY_SIZE(table_aliases); j++) - if (grub_memcmp (&table_aliases[j].guid, &guid, sizeof (guid)) == 0) + if (VasEBoot_memcmp (&table_aliases[j].guid, &guid, sizeof (guid)) == 0) break; if (j != ARRAY_SIZE(table_aliases)) { - curval = grub_xnu_create_value (&(curkey->first_child), "alias"); + curval = VasEBoot_xnu_create_value (&(curkey->first_child), "alias"); if (!curval) - return grub_errno; - curval->datasize = grub_strlen (table_aliases[j].name) + 1; - curval->data = grub_malloc (curval->datasize); + return VasEBoot_errno; + curval->datasize = VasEBoot_strlen (table_aliases[j].name) + 1; + curval->data = VasEBoot_malloc (curval->datasize); if (!curval->data) - return grub_errno; - grub_memcpy (curval->data, table_aliases[j].name, curval->datasize); + return VasEBoot_errno; + VasEBoot_memcpy (curval->data, table_aliases[j].name, curval->datasize); } } /* Create and fill "runtime-services" key. */ - runtimesrvkey = grub_xnu_create_key (&(efikey->first_child), + runtimesrvkey = VasEBoot_xnu_create_key (&(efikey->first_child), "runtime-services"); if (! runtimesrvkey) - return grub_errno; - curval = grub_xnu_create_value (&(runtimesrvkey->first_child), "table"); + return VasEBoot_errno; + curval = VasEBoot_xnu_create_value (&(runtimesrvkey->first_child), "table"); if (! curval) - return grub_errno; + return VasEBoot_errno; curval->datasize = SIZEOF_OF_UINTN; - curval->data = grub_malloc (curval->datasize); + curval->data = VasEBoot_malloc (curval->datasize); if (! curval->data) - return grub_errno; + return VasEBoot_errno; if (SIZEOF_OF_UINTN == 4) - *((grub_uint32_t *) curval->data) - = (grub_addr_t) SYSTEM_TABLE_PTR (runtime_services); + *((VasEBoot_uint32_t *) curval->data) + = (VasEBoot_addr_t) SYSTEM_TABLE_PTR (runtime_services); else - *((grub_uint64_t *) curval->data) - = (grub_addr_t) SYSTEM_TABLE_PTR (runtime_services); + *((VasEBoot_uint64_t *) curval->data) + = (VasEBoot_addr_t) SYSTEM_TABLE_PTR (runtime_services); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_xnu_boot_resume (void) +VasEBoot_err_t +VasEBoot_xnu_boot_resume (void) { - struct grub_relocator32_state state; + struct VasEBoot_relocator32_state state; - state.esp = grub_xnu_stack; - state.ebp = grub_xnu_stack; - state.eip = grub_xnu_entry_point; - state.eax = grub_xnu_arg1; + state.esp = VasEBoot_xnu_stack; + state.ebp = VasEBoot_xnu_stack; + state.eip = VasEBoot_xnu_entry_point; + state.eax = VasEBoot_xnu_arg1; - return grub_relocator32_boot (grub_xnu_relocator, state, 0); + return VasEBoot_relocator32_boot (VasEBoot_xnu_relocator, state, 0); } /* Setup video for xnu. */ -static grub_err_t -grub_xnu_set_video (struct grub_xnu_boot_params_common *params) +static VasEBoot_err_t +VasEBoot_xnu_set_video (struct VasEBoot_xnu_boot_params_common *params) { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; char *tmp; const char *modevar; void *framebuffer; - grub_err_t err; - struct grub_video_bitmap *bitmap = NULL; + VasEBoot_err_t err; + struct VasEBoot_video_bitmap *bitmap = NULL; - modevar = grub_env_get ("gfxpayload"); + modevar = VasEBoot_env_get ("gfxpayload"); /* Consider only graphical 32-bit deep modes. */ if (! modevar || *modevar == 0) - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, - GRUB_VIDEO_MODE_TYPE_PURE_TEXT - | GRUB_VIDEO_MODE_TYPE_DEPTH_MASK, - 32 << GRUB_VIDEO_MODE_TYPE_DEPTH_POS); + err = VasEBoot_video_set_mode (DEFAULT_VIDEO_MODE, + VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT + | VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK, + 32 << VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS); else { - tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); + tmp = VasEBoot_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); if (! tmp) - return grub_errno; - err = grub_video_set_mode (tmp, - GRUB_VIDEO_MODE_TYPE_PURE_TEXT - | GRUB_VIDEO_MODE_TYPE_DEPTH_MASK, - 32 << GRUB_VIDEO_MODE_TYPE_DEPTH_POS); - grub_free (tmp); + return VasEBoot_errno; + err = VasEBoot_video_set_mode (tmp, + VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT + | VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK, + 32 << VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS); + VasEBoot_free (tmp); } if (err) return err; - err = grub_video_get_info (&mode_info); + err = VasEBoot_video_get_info (&mode_info); if (err) return err; - if (grub_xnu_bitmap) + if (VasEBoot_xnu_bitmap) { - if (grub_xnu_bitmap_mode == GRUB_XNU_BITMAP_STRETCH) - err = grub_video_bitmap_create_scaled (&bitmap, + if (VasEBoot_xnu_bitmap_mode == VasEBoot_XNU_BITMAP_STRETCH) + err = VasEBoot_video_bitmap_create_scaled (&bitmap, mode_info.width, mode_info.height, - grub_xnu_bitmap, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + VasEBoot_xnu_bitmap, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); else - bitmap = grub_xnu_bitmap; + bitmap = VasEBoot_xnu_bitmap; } if (bitmap) { - if (grub_xnu_bitmap_mode == GRUB_XNU_BITMAP_STRETCH) - err = grub_video_bitmap_create_scaled (&bitmap, + if (VasEBoot_xnu_bitmap_mode == VasEBoot_XNU_BITMAP_STRETCH) + err = VasEBoot_video_bitmap_create_scaled (&bitmap, mode_info.width, mode_info.height, - grub_xnu_bitmap, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + VasEBoot_xnu_bitmap, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); else - bitmap = grub_xnu_bitmap; + bitmap = VasEBoot_xnu_bitmap; } if (bitmap) @@ -884,8 +884,8 @@ grub_xnu_set_video (struct grub_xnu_boot_params_common *params) x /= 2; y = mode_info.height - bitmap->mode_info.height; y /= 2; - err = grub_video_blit_bitmap (bitmap, - GRUB_VIDEO_BLIT_REPLACE, + err = VasEBoot_video_blit_bitmap (bitmap, + VasEBoot_VIDEO_BLIT_REPLACE, x > 0 ? x : 0, y > 0 ? y : 0, x < 0 ? -x : 0, @@ -897,12 +897,12 @@ grub_xnu_set_video (struct grub_xnu_boot_params_common *params) } if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; bitmap = 0; } - err = grub_video_get_info_and_fini (&mode_info, &framebuffer); + err = VasEBoot_video_get_info_and_fini (&mode_info, &framebuffer); if (err) return err; @@ -911,78 +911,78 @@ grub_xnu_set_video (struct grub_xnu_boot_params_common *params) params->lfb_depth = mode_info.bpp; params->lfb_line_len = mode_info.pitch; - params->lfb_base = (grub_addr_t) framebuffer; - params->lfb_mode = bitmap ? GRUB_XNU_VIDEO_SPLASH - : GRUB_XNU_VIDEO_TEXT_IN_VIDEO; + params->lfb_base = (VasEBoot_addr_t) framebuffer; + params->lfb_mode = bitmap ? VasEBoot_XNU_VIDEO_SPLASH + : VasEBoot_XNU_VIDEO_TEXT_IN_VIDEO; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -total_ram_hook (grub_uint64_t addr __attribute__ ((unused)), grub_uint64_t size, - grub_memory_type_t type, +total_ram_hook (VasEBoot_uint64_t addr __attribute__ ((unused)), VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *result = data; + VasEBoot_uint64_t *result = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; *result += size; return 0; } -static grub_uint64_t +static VasEBoot_uint64_t get_total_ram (void) { - grub_uint64_t result = 0; + VasEBoot_uint64_t result = 0; - grub_mmap_iterate (total_ram_hook, &result); + VasEBoot_mmap_iterate (total_ram_hook, &result); return result; } /* Boot xnu. */ -grub_err_t -grub_xnu_boot (void) +VasEBoot_err_t +VasEBoot_xnu_boot (void) { - union grub_xnu_boot_params_any *bootparams; - struct grub_xnu_boot_params_common *bootparams_common; + union VasEBoot_xnu_boot_params_any *bootparams; + struct VasEBoot_xnu_boot_params_common *bootparams_common; void *bp_in; - grub_addr_t bootparams_target; - grub_err_t err; - grub_efi_uintn_t memory_map_size = 0; + VasEBoot_addr_t bootparams_target; + VasEBoot_err_t err; + VasEBoot_efi_uintn_t memory_map_size = 0; void *memory_map; - grub_addr_t memory_map_target; - grub_efi_uintn_t map_key = 0; - grub_efi_uintn_t descriptor_size = 0; - grub_efi_uint32_t descriptor_version = 0; - grub_uint64_t firstruntimepage, lastruntimepage; - grub_uint64_t curruntimepage; - grub_addr_t devtree_target; - grub_size_t devtreelen; + VasEBoot_addr_t memory_map_target; + VasEBoot_efi_uintn_t map_key = 0; + VasEBoot_efi_uintn_t descriptor_size = 0; + VasEBoot_efi_uint32_t descriptor_version = 0; + VasEBoot_uint64_t firstruntimepage, lastruntimepage; + VasEBoot_uint64_t curruntimepage; + VasEBoot_addr_t devtree_target; + VasEBoot_size_t devtreelen; int i; - struct grub_relocator32_state state; - grub_uint64_t fsbfreq = 100000000; - int v2 = (grub_xnu_darwin_version >= 11); - grub_uint32_t efi_system_table = 0; + struct VasEBoot_relocator32_state state; + VasEBoot_uint64_t fsbfreq = 100000000; + int v2 = (VasEBoot_xnu_darwin_version >= 11); + VasEBoot_uint32_t efi_system_table = 0; - err = grub_autoefi_prepare (); + err = VasEBoot_autoefi_prepare (); if (err) return err; - err = grub_cpu_xnu_fill_devprop (); + err = VasEBoot_cpu_xnu_fill_devprop (); if (err) return err; - err = grub_cpu_xnu_fill_devicetree (&fsbfreq); + err = VasEBoot_cpu_xnu_fill_devicetree (&fsbfreq); if (err) return err; - err = grub_xnu_fill_devicetree (); + err = VasEBoot_xnu_fill_devicetree (); if (err) return err; /* Page-align to avoid following parts to be inadvertently freed. */ - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) return err; @@ -993,25 +993,25 @@ grub_xnu_boot (void) descriptor_size = 0; descriptor_version = 0; - grub_dprintf ("xnu", "eip=%x, efi=%p\n", grub_xnu_entry_point, - grub_autoefi_system_table); + VasEBoot_dprintf ("xnu", "eip=%x, efi=%p\n", VasEBoot_xnu_entry_point, + VasEBoot_autoefi_system_table); - const char *debug = grub_env_get ("debug"); + const char *debug = VasEBoot_env_get ("debug"); - if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu"))) + if (debug && (VasEBoot_strword (debug, "all") || VasEBoot_strword (debug, "xnu"))) { - grub_puts_ (N_("Press any key to launch xnu")); - grub_getkey (); + VasEBoot_puts_ (N_("Press any key to launch xnu")); + VasEBoot_getkey (); } /* Relocate the boot parameters to heap. */ - err = grub_xnu_heap_malloc (sizeof (*bootparams), + err = VasEBoot_xnu_heap_malloc (sizeof (*bootparams), &bp_in, &bootparams_target); if (err) return err; bootparams = bp_in; - grub_memset (bootparams, 0, sizeof (*bootparams)); + VasEBoot_memset (bootparams, 0, sizeof (*bootparams)); if (v2) { bootparams_common = &bootparams->v2.common; @@ -1022,12 +1022,12 @@ grub_xnu_boot (void) bootparams_common = &bootparams->v1.common; /* Set video. */ - err = grub_xnu_set_video (bootparams_common); - if (err != GRUB_ERR_NONE) + err = VasEBoot_xnu_set_video (bootparams_common); + if (err != VasEBoot_ERR_NONE) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - grub_puts_ (N_("Booting in blind mode")); + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_puts_ (N_("Booting in blind mode")); bootparams_common->lfb_mode = 0; bootparams_common->lfb_width = 0; @@ -1037,65 +1037,65 @@ grub_xnu_boot (void) bootparams_common->lfb_base = 0; } - if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, + if (VasEBoot_autoefi_get_memory_map (&memory_map_size, memory_map, &map_key, &descriptor_size, &descriptor_version) < 0) - return grub_errno; + return VasEBoot_errno; /* We will do few allocations later. Reserve some space for possible memory map growth. */ memory_map_size += 20 * descriptor_size; - err = grub_xnu_heap_malloc (memory_map_size, + err = VasEBoot_xnu_heap_malloc (memory_map_size, &memory_map, &memory_map_target); if (err) return err; - err = grub_xnu_writetree_toheap (&devtree_target, &devtreelen); + err = VasEBoot_xnu_writetree_toheap (&devtree_target, &devtreelen); if (err) return err; - grub_memcpy (bootparams_common->cmdline, grub_xnu_cmdline, + VasEBoot_memcpy (bootparams_common->cmdline, VasEBoot_xnu_cmdline, sizeof (bootparams_common->cmdline)); bootparams_common->devtree = devtree_target; bootparams_common->devtreelen = devtreelen; - err = grub_autoefi_finish_boot_services (&memory_map_size, memory_map, + err = VasEBoot_autoefi_finish_boot_services (&memory_map_size, memory_map, &map_key, &descriptor_size, &descriptor_version); if (err) return err; if (v2) - bootparams->v2.efi_system_table = (grub_addr_t) grub_autoefi_system_table; + bootparams->v2.efi_system_table = (VasEBoot_addr_t) VasEBoot_autoefi_system_table; else - bootparams->v1.efi_system_table = (grub_addr_t) grub_autoefi_system_table; + bootparams->v1.efi_system_table = (VasEBoot_addr_t) VasEBoot_autoefi_system_table; - firstruntimepage = (((grub_addr_t) grub_xnu_heap_target_start - + grub_xnu_heap_size + GRUB_XNU_PAGESIZE - 1) - / GRUB_XNU_PAGESIZE) + 20; + firstruntimepage = (((VasEBoot_addr_t) VasEBoot_xnu_heap_target_start + + VasEBoot_xnu_heap_size + VasEBoot_XNU_PAGESIZE - 1) + / VasEBoot_XNU_PAGESIZE) + 20; curruntimepage = firstruntimepage; for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) { - grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) + VasEBoot_efi_memory_descriptor_t *curdesc = (VasEBoot_efi_memory_descriptor_t *) ((char *) memory_map + descriptor_size * i); curdesc->virtual_start = curdesc->physical_start; - if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA - || curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE) + if (curdesc->type == VasEBoot_EFI_RUNTIME_SERVICES_DATA + || curdesc->type == VasEBoot_EFI_RUNTIME_SERVICES_CODE) { curdesc->virtual_start = curruntimepage << 12; curruntimepage += curdesc->num_pages; if (curdesc->physical_start - <= (grub_addr_t) grub_autoefi_system_table + <= (VasEBoot_addr_t) VasEBoot_autoefi_system_table && curdesc->physical_start + (curdesc->num_pages << 12) - > (grub_addr_t) grub_autoefi_system_table) + > (VasEBoot_addr_t) VasEBoot_autoefi_system_table) efi_system_table - = (grub_addr_t) grub_autoefi_system_table + = (VasEBoot_addr_t) VasEBoot_autoefi_system_table - curdesc->physical_start + curdesc->virtual_start; - if (SIZEOF_OF_UINTN == 8 && grub_xnu_is_64bit) + if (SIZEOF_OF_UINTN == 8 && VasEBoot_xnu_is_64bit) curdesc->virtual_start |= 0xffffff8000000000ULL; } } @@ -1105,15 +1105,15 @@ grub_xnu_boot (void) if (v2) { bootparams->v2.efi_uintnbits = SIZEOF_OF_UINTN * 8; - bootparams->v2.verminor = GRUB_XNU_BOOTARGSV2_VERMINOR; - bootparams->v2.vermajor = GRUB_XNU_BOOTARGSV2_VERMAJOR; + bootparams->v2.verminor = VasEBoot_XNU_BOOTARGSV2_VERMINOR; + bootparams->v2.vermajor = VasEBoot_XNU_BOOTARGSV2_VERMAJOR; bootparams->v2.efi_system_table = efi_system_table; } else { bootparams->v1.efi_uintnbits = SIZEOF_OF_UINTN * 8; - bootparams->v1.verminor = GRUB_XNU_BOOTARGSV1_VERMINOR; - bootparams->v1.vermajor = GRUB_XNU_BOOTARGSV1_VERMAJOR; + bootparams->v1.verminor = VasEBoot_XNU_BOOTARGSV1_VERMINOR; + bootparams->v1.vermajor = VasEBoot_XNU_BOOTARGSV1_VERMAJOR; bootparams->v1.efi_system_table = efi_system_table; } @@ -1123,36 +1123,36 @@ grub_xnu_boot (void) bootparams_common->efi_mem_desc_version = descriptor_version; bootparams_common->efi_mmap = memory_map_target; bootparams_common->efi_mmap_size = memory_map_size; - bootparams_common->heap_start = grub_xnu_heap_target_start; - bootparams_common->heap_size = curruntimepage * GRUB_XNU_PAGESIZE - grub_xnu_heap_target_start; + bootparams_common->heap_start = VasEBoot_xnu_heap_target_start; + bootparams_common->heap_size = curruntimepage * VasEBoot_XNU_PAGESIZE - VasEBoot_xnu_heap_target_start; /* Parameters for asm helper. */ - grub_xnu_stack = bootparams_common->heap_start - + bootparams_common->heap_size + GRUB_XNU_PAGESIZE; - grub_xnu_arg1 = bootparams_target; + VasEBoot_xnu_stack = bootparams_common->heap_start + + bootparams_common->heap_size + VasEBoot_XNU_PAGESIZE; + VasEBoot_xnu_arg1 = bootparams_target; - grub_autoefi_set_virtual_address_map (memory_map_size, descriptor_size, + VasEBoot_autoefi_set_virtual_address_map (memory_map_size, descriptor_size, descriptor_version, memory_map); - state.eip = grub_xnu_entry_point; - state.eax = grub_xnu_arg1; - state.esp = grub_xnu_stack; - state.ebp = grub_xnu_stack; + state.eip = VasEBoot_xnu_entry_point; + state.eax = VasEBoot_xnu_arg1; + state.esp = VasEBoot_xnu_stack; + state.ebp = VasEBoot_xnu_stack; /* XNU uses only APIC. Disable PIC. */ - grub_outb (0xff, 0x21); - grub_outb (0xff, 0xa1); + VasEBoot_outb (0xff, 0x21); + VasEBoot_outb (0xff, 0xa1); - return grub_relocator32_boot (grub_xnu_relocator, state, 0); + return VasEBoot_relocator32_boot (VasEBoot_xnu_relocator, state, 0); } -static grub_command_t cmd_devprop_load; +static VasEBoot_command_t cmd_devprop_load; void -grub_cpu_xnu_init (void) +VasEBoot_cpu_xnu_init (void) { - cmd_devprop_load = grub_register_command ("xnu_devprop_load", - grub_cmd_devprop_load, + cmd_devprop_load = VasEBoot_register_command ("xnu_devprop_load", + VasEBoot_cmd_devprop_load, /* TRANSLATORS: `device-properties' is a variable name, not a program. */ @@ -1160,7 +1160,7 @@ grub_cpu_xnu_init (void) } void -grub_cpu_xnu_fini (void) +VasEBoot_cpu_xnu_fini (void) { - grub_unregister_command (cmd_devprop_load); + VasEBoot_unregister_command (cmd_devprop_load); } diff --git a/VasEBoot-core/loader/ia64/efi/linux.c b/VasEBoot-core/loader/ia64/efi/linux.c index efaa42ccd..82ba7848f 100644 --- a/VasEBoot-core/loader/ia64/efi/linux.c +++ b/VasEBoot-core/loader/ia64/efi/linux.c @@ -1,99 +1,99 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #pragma GCC diagnostic ignored "-Wcast-align" #define ALIGN_MIN (256*1024*1024) -#define GRUB_ELF_SEARCH 1024 +#define VasEBoot_ELF_SEARCH 1024 #define BOOT_PARAM_SIZE 16384 struct ia64_boot_param { - grub_uint64_t command_line; /* physical address of command line. */ - grub_uint64_t efi_systab; /* physical address of EFI system table */ - grub_uint64_t efi_memmap; /* physical address of EFI memory map */ - grub_uint64_t efi_memmap_size; /* size of EFI memory map */ - grub_uint64_t efi_memdesc_size; /* size of an EFI memory map descriptor */ - grub_uint32_t efi_memdesc_version; /* memory descriptor version */ + VasEBoot_uint64_t command_line; /* physical address of command line. */ + VasEBoot_uint64_t efi_systab; /* physical address of EFI system table */ + VasEBoot_uint64_t efi_memmap; /* physical address of EFI memory map */ + VasEBoot_uint64_t efi_memmap_size; /* size of EFI memory map */ + VasEBoot_uint64_t efi_memdesc_size; /* size of an EFI memory map descriptor */ + VasEBoot_uint32_t efi_memdesc_version; /* memory descriptor version */ struct { - grub_uint16_t num_cols; /* number of columns on console output dev */ - grub_uint16_t num_rows; /* number of rows on console output device */ - grub_uint16_t orig_x; /* cursor's x position */ - grub_uint16_t orig_y; /* cursor's y position */ + VasEBoot_uint16_t num_cols; /* number of columns on console output dev */ + VasEBoot_uint16_t num_rows; /* number of rows on console output device */ + VasEBoot_uint16_t orig_x; /* cursor's x position */ + VasEBoot_uint16_t orig_y; /* cursor's y position */ } console_info; - grub_uint64_t fpswa; /* physical address of the fpswa interface */ - grub_uint64_t initrd_start; - grub_uint64_t initrd_size; + VasEBoot_uint64_t fpswa; /* physical address of the fpswa interface */ + VasEBoot_uint64_t initrd_start; + VasEBoot_uint64_t initrd_size; }; typedef struct { - grub_uint32_t revision; - grub_uint32_t reserved; + VasEBoot_uint32_t revision; + VasEBoot_uint32_t reserved; void *fpswa; } fpswa_interface_t; static fpswa_interface_t *fpswa; #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ - ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + ((VasEBoot_efi_memory_descriptor_t *) ((char *) (desc) + (size))) -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; /* Kernel base and size. */ static void *kernel_mem; -static grub_efi_uintn_t kernel_pages; -static grub_uint64_t entry; +static VasEBoot_efi_uintn_t kernel_pages; +static VasEBoot_uint64_t entry; /* Initrd base and size. */ static void *initrd_mem; -static grub_efi_uintn_t initrd_pages; -static grub_efi_uintn_t initrd_size; +static VasEBoot_efi_uintn_t initrd_pages; +static VasEBoot_efi_uintn_t initrd_size; static struct ia64_boot_param *boot_param; -static grub_efi_uintn_t boot_param_pages; +static VasEBoot_efi_uintn_t boot_param_pages; -static inline grub_size_t -page_align (grub_size_t size) +static inline VasEBoot_size_t +page_align (VasEBoot_size_t size) { return (size + (1 << 12) - 1) & (~((1 << 12) - 1)); } @@ -101,33 +101,33 @@ page_align (grub_size_t size) static void query_fpswa (void) { - grub_efi_handle_t fpswa_image; - grub_efi_boot_services_t *bs; - grub_efi_status_t status; - grub_efi_uintn_t size; - static const grub_efi_guid_t fpswa_protocol = + VasEBoot_efi_handle_t fpswa_image; + VasEBoot_efi_boot_services_t *bs; + VasEBoot_efi_status_t status; + VasEBoot_efi_uintn_t size; + static const VasEBoot_efi_guid_t fpswa_protocol = { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }; if (fpswa != NULL) return; - size = sizeof(grub_efi_handle_t); + size = sizeof(VasEBoot_efi_handle_t); - bs = grub_efi_system_table->boot_services; - status = bs->locate_handle (GRUB_EFI_BY_PROTOCOL, + bs = VasEBoot_efi_system_table->boot_services; + status = bs->locate_handle (VasEBoot_EFI_BY_PROTOCOL, (void *) &fpswa_protocol, NULL, &size, &fpswa_image); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - grub_printf ("%s\n", _("Could not locate FPSWA driver")); + VasEBoot_printf ("%s\n", _("Could not locate FPSWA driver")); return; } status = bs->handle_protocol (fpswa_image, (void *) &fpswa_protocol, (void *) &fpswa); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - grub_printf ("%s\n", + VasEBoot_printf ("%s\n", _("FPSWA protocol wasn't able to find the interface")); return; } @@ -135,10 +135,10 @@ query_fpswa (void) /* Find the optimal number of pages for the memory map. Is it better to move this code to efi/mm.c? */ -static grub_efi_uintn_t +static VasEBoot_efi_uintn_t find_mmap_size (void) { - static grub_efi_uintn_t mmap_size = 0; + static VasEBoot_efi_uintn_t mmap_size = 0; if (mmap_size != 0) return mmap_size; @@ -147,19 +147,19 @@ find_mmap_size (void) while (1) { int ret; - grub_efi_memory_descriptor_t *mmap; - grub_efi_uintn_t desc_size; + VasEBoot_efi_memory_descriptor_t *mmap; + VasEBoot_efi_uintn_t desc_size; - mmap = grub_malloc (mmap_size); + mmap = VasEBoot_malloc (mmap_size); if (! mmap) return 0; - ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0); - grub_free (mmap); + ret = VasEBoot_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0); + VasEBoot_free (mmap); if (ret < 0) { - grub_error (GRUB_ERR_IO, "cannot get memory map"); + VasEBoot_error (VasEBoot_ERR_IO, "cannot get memory map"); return 0; } else if (ret > 0) @@ -168,7 +168,7 @@ find_mmap_size (void) mmap_size += (1 << 12); } - /* Increase the size a bit for safety, because GRUB allocates more on + /* Increase the size a bit for safety, because VasEBoot allocates more on later, and EFI itself may allocate more. */ mmap_size += (1 << 12); @@ -180,34 +180,34 @@ free_pages (void) { if (kernel_mem) { - grub_efi_free_pages ((grub_addr_t) kernel_mem, kernel_pages); + VasEBoot_efi_free_pages ((VasEBoot_addr_t) kernel_mem, kernel_pages); kernel_mem = 0; } if (initrd_mem) { - grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages); + VasEBoot_efi_free_pages ((VasEBoot_addr_t) initrd_mem, initrd_pages); initrd_mem = 0; } if (boot_param) { /* Free bootparam. */ - grub_efi_free_pages ((grub_efi_physical_address_t) boot_param, + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) boot_param, boot_param_pages); boot_param = 0; } } static void * -allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, - grub_uint64_t nobase) +allocate_pages (VasEBoot_uint64_t align, VasEBoot_uint64_t size_pages, + VasEBoot_uint64_t nobase) { - grub_uint64_t size; - grub_efi_uintn_t desc_size; - grub_efi_memory_descriptor_t *mmap, *mmap_end; - grub_efi_uintn_t mmap_size, tmp_mmap_size; - grub_efi_memory_descriptor_t *desc; + VasEBoot_uint64_t size; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_memory_descriptor_t *mmap, *mmap_end; + VasEBoot_efi_uintn_t mmap_size, tmp_mmap_size; + VasEBoot_efi_memory_descriptor_t *desc; void *mem = NULL; size = size_pages << 12; @@ -217,14 +217,14 @@ allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, return 0; /* Read the memory map temporarily, to find free space. */ - mmap = grub_malloc (mmap_size); + mmap = VasEBoot_malloc (mmap_size); if (! mmap) return 0; tmp_mmap_size = mmap_size; - if (grub_efi_get_memory_map (&tmp_mmap_size, mmap, 0, &desc_size, 0) <= 0) + if (VasEBoot_efi_get_memory_map (&tmp_mmap_size, mmap, 0, &desc_size, 0) <= 0) { - grub_error (GRUB_ERR_IO, "cannot get memory map"); + VasEBoot_error (VasEBoot_ERR_IO, "cannot get memory map"); goto fail; } @@ -236,10 +236,10 @@ allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, desc < mmap_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { - grub_uint64_t start, end; - grub_uint64_t aligned_start; + VasEBoot_uint64_t start, end; + VasEBoot_uint64_t aligned_start; - if (desc->type != GRUB_EFI_CONVENTIONAL_MEMORY) + if (desc->type != VasEBoot_EFI_CONVENTIONAL_MEMORY) continue; start = desc->physical_start; @@ -252,10 +252,10 @@ allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, aligned_start += align; if (aligned_start + size > end) continue; - mem = grub_efi_allocate_pages (aligned_start, size_pages); + mem = VasEBoot_efi_allocate_pages (aligned_start, size_pages); if (! mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate memory"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate memory"); goto fail; } break; @@ -263,15 +263,15 @@ allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, if (! mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate memory"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate memory"); goto fail; } - grub_free (mmap); + VasEBoot_free (mmap); return mem; fail: - grub_free (mmap); + VasEBoot_free (mmap); free_pages (); return 0; } @@ -279,15 +279,15 @@ allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, static void set_boot_param_console (void) { - grub_efi_simple_text_output_interface_t *conout; - grub_efi_uintn_t cols, rows; + VasEBoot_efi_simple_text_output_interface_t *conout; + VasEBoot_efi_uintn_t cols, rows; - conout = grub_efi_system_table->con_out; + conout = VasEBoot_efi_system_table->con_out; if (conout->query_mode (conout, conout->mode->mode, &cols, &rows) - != GRUB_EFI_SUCCESS) + != VasEBoot_EFI_SUCCESS) return; - grub_dprintf ("linux", + VasEBoot_dprintf ("linux", "Console info: cols=%lu rows=%lu x=%u y=%u\n", cols, rows, conout->mode->cursor_column, conout->mode->cursor_row); @@ -298,43 +298,43 @@ set_boot_param_console (void) boot_param->console_info.orig_y = conout->mode->cursor_row; } -static grub_err_t -grub_linux_boot (void) +static VasEBoot_err_t +VasEBoot_linux_boot (void) { - grub_efi_uintn_t mmap_size; - grub_efi_uintn_t map_key; - grub_efi_uintn_t desc_size; - grub_efi_uint32_t desc_version; - grub_efi_memory_descriptor_t *mmap_buf; - grub_err_t err; + VasEBoot_efi_uintn_t mmap_size; + VasEBoot_efi_uintn_t map_key; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_uint32_t desc_version; + VasEBoot_efi_memory_descriptor_t *mmap_buf; + VasEBoot_err_t err; /* FPSWA. */ query_fpswa (); - boot_param->fpswa = (grub_uint64_t)fpswa; + boot_param->fpswa = (VasEBoot_uint64_t)fpswa; /* Initrd. */ - boot_param->initrd_start = (grub_uint64_t)initrd_mem; - boot_param->initrd_size = (grub_uint64_t)initrd_size; + boot_param->initrd_start = (VasEBoot_uint64_t)initrd_mem; + boot_param->initrd_size = (VasEBoot_uint64_t)initrd_size; set_boot_param_console (); - grub_dprintf ("linux", "Jump to %016lx\n", entry); + VasEBoot_dprintf ("linux", "Jump to %016lx\n", entry); /* MDT. - Must be done after grub_machine_fini because map_key is used by + Must be done after VasEBoot_machine_fini because map_key is used by exit_boot_services. */ mmap_size = find_mmap_size (); if (! mmap_size) - return grub_errno; - mmap_buf = grub_efi_allocate_pages (0, page_align (mmap_size) >> 12); + return VasEBoot_errno; + mmap_buf = VasEBoot_efi_allocate_pages (0, page_align (mmap_size) >> 12); if (! mmap_buf) - return grub_error (GRUB_ERR_IO, "cannot allocate memory map"); - err = grub_efi_finish_boot_services (&mmap_size, mmap_buf, &map_key, + return VasEBoot_error (VasEBoot_ERR_IO, "cannot allocate memory map"); + err = VasEBoot_efi_finish_boot_services (&mmap_size, mmap_buf, &map_key, &desc_size, &desc_version); if (err) return err; - boot_param->efi_memmap = (grub_uint64_t)mmap_buf; + boot_param->efi_memmap = (VasEBoot_uint64_t)mmap_buf; boot_param->efi_memmap_size = mmap_size; boot_param->efi_memdesc_size = desc_size; boot_param->efi_memdesc_version = desc_version; @@ -343,28 +343,28 @@ grub_linux_boot (void) asm volatile ("mov r28=%1; br.sptk.few %0" :: "b"(entry),"r"(boot_param)); /* Never reach here. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { free_pages (); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); loaded = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_load_elf64 (grub_file_t file, void *buffer, const char *filename) +static VasEBoot_err_t +VasEBoot_load_elf64 (VasEBoot_file_t file, void *buffer, const char *filename) { Elf64_Ehdr *ehdr = (Elf64_Ehdr *) buffer; Elf64_Phdr *phdr; int i; - grub_uint64_t low_addr; - grub_uint64_t high_addr; - grub_uint64_t align; - grub_uint64_t reloc_offset; + VasEBoot_uint64_t low_addr; + VasEBoot_uint64_t high_addr; + VasEBoot_uint64_t align; + VasEBoot_uint64_t reloc_offset; const char *relocate; if (ehdr->e_ident[EI_MAG0] != ELFMAG0 @@ -372,22 +372,22 @@ grub_load_elf64 (grub_file_t file, void *buffer, const char *filename) || ehdr->e_ident[EI_MAG2] != ELFMAG2 || ehdr->e_ident[EI_MAG3] != ELFMAG3 || ehdr->e_ident[EI_DATA] != ELFDATA2LSB) - return grub_error(GRUB_ERR_UNKNOWN_OS, + return VasEBoot_error(VasEBoot_ERR_UNKNOWN_OS, N_("invalid arch-independent ELF magic")); if (ehdr->e_ident[EI_CLASS] != ELFCLASS64 || ehdr->e_version != EV_CURRENT || ehdr->e_machine != EM_IA_64) - return grub_error (GRUB_ERR_UNKNOWN_OS, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); if (ehdr->e_type != ET_EXEC) - return grub_error (GRUB_ERR_UNKNOWN_OS, + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); /* FIXME: Should we support program headers at strange locations? */ - if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > GRUB_ELF_SEARCH) - return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); + if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > VasEBoot_ELF_SEARCH) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "program header at a too high offset"); entry = ehdr->e_entry; @@ -414,31 +414,31 @@ grub_load_elf64 (grub_file_t file, void *buffer, const char *filename) align = ALIGN_MIN; if (high_addr == 0) - return grub_error (GRUB_ERR_BAD_OS, "no program entries"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "no program entries"); kernel_pages = page_align (high_addr - low_addr) >> 12; /* Undocumented on purpose. */ - relocate = grub_env_get ("linux_relocate"); - if (!relocate || grub_strcmp (relocate, "force") != 0) + relocate = VasEBoot_env_get ("linux_relocate"); + if (!relocate || VasEBoot_strcmp (relocate, "force") != 0) { - kernel_mem = grub_efi_allocate_pages (low_addr, kernel_pages); + kernel_mem = VasEBoot_efi_allocate_pages (low_addr, kernel_pages); reloc_offset = 0; } /* Try to relocate. */ - if (! kernel_mem && (!relocate || grub_strcmp (relocate, "off") != 0)) + if (! kernel_mem && (!relocate || VasEBoot_strcmp (relocate, "off") != 0)) { kernel_mem = allocate_pages (align, kernel_pages, low_addr); if (kernel_mem) { - reloc_offset = (grub_uint64_t)kernel_mem - low_addr; - grub_dprintf ("linux", " Relocated at %p (offset=%016lx)\n", + reloc_offset = (VasEBoot_uint64_t)kernel_mem - low_addr; + VasEBoot_dprintf ("linux", " Relocated at %p (offset=%016lx)\n", kernel_mem, reloc_offset); entry += reloc_offset; } } if (! kernel_mem) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate memory for OS"); /* Load every loadable segment in memory. */ @@ -448,32 +448,32 @@ grub_load_elf64 (grub_file_t file, void *buffer, const char *filename) + i * ehdr->e_phentsize); if (phdr->p_type == PT_LOAD) { - grub_dprintf ("linux", " [paddr=%lx load=%lx memsz=%08lx " + VasEBoot_dprintf ("linux", " [paddr=%lx load=%lx memsz=%08lx " "off=%lx flags=%x]\n", phdr->p_paddr, phdr->p_paddr + reloc_offset, phdr->p_memsz, phdr->p_offset, phdr->p_flags); - if (grub_file_seek (file, phdr->p_offset) == (grub_off_t)-1) - return grub_errno; + if (VasEBoot_file_seek (file, phdr->p_offset) == (VasEBoot_off_t)-1) + return VasEBoot_errno; - if (grub_file_read (file, (void *) (phdr->p_paddr + reloc_offset), + if (VasEBoot_file_read (file, (void *) (phdr->p_paddr + reloc_offset), phdr->p_filesz) - != (grub_ssize_t) phdr->p_filesz) + != (VasEBoot_ssize_t) phdr->p_filesz) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } if (phdr->p_filesz < phdr->p_memsz) - grub_memset + VasEBoot_memset ((char *)(phdr->p_paddr + reloc_offset + phdr->p_filesz), 0, phdr->p_memsz - phdr->p_filesz); /* Sync caches if necessary. */ if (phdr->p_flags & PF_X) - grub_arch_sync_caches + VasEBoot_arch_sync_caches ((void *)(phdr->p_paddr + reloc_offset), phdr->p_memsz); } } @@ -481,163 +481,163 @@ grub_load_elf64 (grub_file_t file, void *buffer, const char *filename) return 0; } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - char buffer[GRUB_ELF_SEARCH]; + VasEBoot_file_t file = 0; + char buffer[VasEBoot_ELF_SEARCH]; char *cmdline, *p; - grub_ssize_t len; + VasEBoot_ssize_t len; int i; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - grub_loader_unset (); + VasEBoot_loader_unset (); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) goto fail; - len = grub_file_read (file, buffer, sizeof (buffer)); - if (len < (grub_ssize_t) sizeof (Elf64_Ehdr)) + len = VasEBoot_file_read (file, buffer, sizeof (buffer)); + if (len < (VasEBoot_ssize_t) sizeof (Elf64_Ehdr)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), argv[0]); goto fail; } - grub_dprintf ("linux", "Loading linux: %s\n", argv[0]); + VasEBoot_dprintf ("linux", "Loading linux: %s\n", argv[0]); - if (grub_load_elf64 (file, buffer, argv[0])) + if (VasEBoot_load_elf64 (file, buffer, argv[0])) goto fail; len = sizeof("BOOT_IMAGE=") + 8; for (i = 0; i < argc; i++) - len += grub_strlen (argv[i]) + 1; + len += VasEBoot_strlen (argv[i]) + 1; len += sizeof (struct ia64_boot_param) + 512; /* Room for extensions. */ boot_param_pages = page_align (len) >> 12; - boot_param = grub_efi_allocate_pages (0, boot_param_pages); + boot_param = VasEBoot_efi_allocate_pages (0, boot_param_pages); if (boot_param == 0) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate memory for bootparams"); goto fail; } - grub_memset (boot_param, 0, len); + VasEBoot_memset (boot_param, 0, len); cmdline = ((char *)(boot_param + 1)) + 256; /* Build cmdline. */ - p = grub_stpcpy (cmdline, "BOOT_IMAGE"); + p = VasEBoot_stpcpy (cmdline, "BOOT_IMAGE"); for (i = 0; i < argc; i++) { *p++ = ' '; - p = grub_stpcpy (p, argv[i]); + p = VasEBoot_stpcpy (p, argv[i]); } cmdline[10] = '='; - boot_param->command_line = (grub_uint64_t) cmdline; - boot_param->efi_systab = (grub_uint64_t) grub_efi_system_table; + boot_param->command_line = (VasEBoot_uint64_t) cmdline; + boot_param->efi_systab = (VasEBoot_uint64_t) VasEBoot_efi_system_table; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_loader_set (grub_linux_boot, grub_linux_unload, 0); + VasEBoot_loader_set (VasEBoot_linux_boot, VasEBoot_linux_unload, 0); fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_efi_free_pages ((grub_efi_physical_address_t) boot_param, + VasEBoot_efi_free_pages ((VasEBoot_efi_physical_address_t) boot_param, boot_param_pages); - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (! loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - initrd_size = grub_get_initrd_size (&initrd_ctx); - grub_dprintf ("linux", "Loading initrd\n"); + initrd_size = VasEBoot_get_initrd_size (&initrd_ctx); + VasEBoot_dprintf ("linux", "Loading initrd\n"); initrd_pages = (page_align (initrd_size) >> 12); - initrd_mem = grub_efi_allocate_pages (0, initrd_pages); + initrd_mem = VasEBoot_efi_allocate_pages (0, initrd_pages); if (! initrd_mem) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate pages"); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot allocate pages"); goto fail; } - grub_dprintf ("linux", "[addr=0x%lx, size=0x%lx]\n", - (grub_uint64_t) initrd_mem, initrd_size); + VasEBoot_dprintf ("linux", "[addr=0x%lx, size=0x%lx]\n", + (VasEBoot_uint64_t) initrd_mem, initrd_size); - if (grub_initrd_load (&initrd_ctx, argv, initrd_mem)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, initrd_mem)) goto fail; fail: - grub_initrd_close (&initrd_ctx); - return grub_errno; + VasEBoot_initrd_close (&initrd_ctx); + return VasEBoot_errno; } -static grub_err_t -grub_cmd_fpswa (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_fpswa (VasEBoot_command_t cmd __attribute__ ((unused)), int argc __attribute__((unused)), char *argv[] __attribute__((unused))) { query_fpswa (); if (fpswa == NULL) - grub_puts_ (N_("No FPSWA found")); + VasEBoot_puts_ (N_("No FPSWA found")); else - grub_printf (_("FPSWA revision: %x\n"), fpswa->revision); - return GRUB_ERR_NONE; + VasEBoot_printf (_("FPSWA revision: %x\n"), fpswa->revision); + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_linux, cmd_initrd, cmd_fpswa; +static VasEBoot_command_t cmd_linux, cmd_initrd, cmd_fpswa; -GRUB_MOD_INIT(linux) +VasEBoot_MOD_INIT(linux) { - cmd_linux = grub_register_command ("linux", grub_cmd_linux, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, N_("FILE [ARGS...]"), N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, N_("FILE"), N_("Load initrd.")); - cmd_fpswa = grub_register_command ("fpswa", grub_cmd_fpswa, + cmd_fpswa = VasEBoot_register_command ("fpswa", VasEBoot_cmd_fpswa, "", N_("Display FPSWA version.")); my_mod = mod; } -GRUB_MOD_FINI(linux) +VasEBoot_MOD_FINI(linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); - grub_unregister_command (cmd_fpswa); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_fpswa); } diff --git a/VasEBoot-core/loader/linux.c b/VasEBoot-core/loader/linux.c index c2c7cfcd0..a54ee2bec 100644 --- a/VasEBoot-core/loader/linux.c +++ b/VasEBoot-core/loader/linux.c @@ -1,10 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include struct newc_head { @@ -22,13 +22,13 @@ struct newc_head char rdevminor[8]; char namesize[8]; char check[8]; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_linux_initrd_component +struct VasEBoot_linux_initrd_component { - grub_file_t file; + VasEBoot_file_t file; char *newc_name; - grub_off_t size; + VasEBoot_off_t size; }; struct dir @@ -39,7 +39,7 @@ struct dir }; static char -hex (grub_uint8_t val) +hex (VasEBoot_uint8_t val) { if (val < 10) return '0' + val; @@ -47,7 +47,7 @@ hex (grub_uint8_t val) } static void -set_field (char *var, grub_uint32_t val) +set_field (char *var, VasEBoot_uint32_t val) { int i; char *ptr = var; @@ -55,16 +55,16 @@ set_field (char *var, grub_uint32_t val) *ptr++ = hex((val >> i) & 0xf); } -static grub_uint8_t * -make_header (grub_uint8_t *ptr, - const char *name, grub_size_t len, - grub_uint32_t mode, - grub_off_t fsize) +static VasEBoot_uint8_t * +make_header (VasEBoot_uint8_t *ptr, + const char *name, VasEBoot_size_t len, + VasEBoot_uint32_t mode, + VasEBoot_off_t fsize) { struct newc_head *head = (struct newc_head *) ptr; - grub_uint8_t *optr; - grub_size_t oh = 0; - grub_memcpy (head->magic, "070701", 6); + VasEBoot_uint8_t *optr; + VasEBoot_size_t oh = 0; + VasEBoot_memcpy (head->magic, "070701", 6); set_field (head->ino, 0); set_field (head->mode, mode); set_field (head->uid, 0); @@ -80,10 +80,10 @@ make_header (grub_uint8_t *ptr, set_field (head->check, 0); optr = ptr; ptr += sizeof (struct newc_head); - grub_memcpy (ptr, name, len); + VasEBoot_memcpy (ptr, name, len); ptr += len; oh = ALIGN_UP_OVERHEAD (ptr - optr, 4); - grub_memset (ptr, 0, oh); + VasEBoot_memset (ptr, 0, oh); ptr += oh; return ptr; } @@ -95,17 +95,17 @@ free_dir (struct dir *root) return; free_dir (root->next); free_dir (root->child); - grub_free (root->name); - grub_free (root); + VasEBoot_free (root->name); + VasEBoot_free (root); } -static grub_size_t +static VasEBoot_size_t insert_dir (const char *name, struct dir **root, - grub_uint8_t *ptr) + VasEBoot_uint8_t *ptr) { struct dir *cur, **head = root; const char *cb, *ce = name; - grub_size_t size = 0; + VasEBoot_size_t size = 0; while (1) { for (cb = ce; *cb == '/'; cb++); @@ -114,20 +114,20 @@ insert_dir (const char *name, struct dir **root, break; for (cur = *root; cur; cur = cur->next) - if (grub_memcmp (cur->name, cb, ce - cb) + if (VasEBoot_memcmp (cur->name, cb, ce - cb) && cur->name[ce - cb] == 0) break; if (!cur) { struct dir *n; - n = grub_zalloc (sizeof (*n)); + n = VasEBoot_zalloc (sizeof (*n)); if (!n) return 0; n->next = *head; - n->name = grub_strndup (cb, ce - cb); + n->name = VasEBoot_strndup (cb, ce - cb); if (ptr) { - grub_dprintf ("linux", "Creating directory %s, %s\n", name, ce); + VasEBoot_dprintf ("linux", "Creating directory %s, %s\n", name, ce); ptr = make_header (ptr, name, ce - name, 040777, 0); } @@ -141,9 +141,9 @@ insert_dir (const char *name, struct dir **root, return size; } -grub_err_t -grub_initrd_init (int argc, char *argv[], - struct grub_linux_initrd_context *initrd_ctx) +VasEBoot_err_t +VasEBoot_initrd_init (int argc, char *argv[], + struct VasEBoot_linux_initrd_context *initrd_ctx) { int i; int newc = 0; @@ -152,10 +152,10 @@ grub_initrd_init (int argc, char *argv[], initrd_ctx->nfiles = 0; initrd_ctx->components = 0; - initrd_ctx->components = grub_zalloc (argc + initrd_ctx->components = VasEBoot_zalloc (argc * sizeof (initrd_ctx->components[0])); if (!initrd_ctx->components) - return grub_errno; + return VasEBoot_errno; initrd_ctx->size = 0; @@ -165,25 +165,25 @@ grub_initrd_init (int argc, char *argv[], initrd_ctx->size = ALIGN_UP (initrd_ctx->size, 4); - if (grub_memcmp (argv[i], "newc:", 5) == 0) + if (VasEBoot_memcmp (argv[i], "newc:", 5) == 0) { const char *ptr, *eptr; ptr = argv[i] + 5; while (*ptr == '/') ptr++; - eptr = grub_strchr (ptr, ':'); + eptr = VasEBoot_strchr (ptr, ':'); if (eptr) { - grub_file_filter_disable_compression (); - initrd_ctx->components[i].newc_name = grub_strndup (ptr, eptr - ptr); + VasEBoot_file_filter_disable_compression (); + initrd_ctx->components[i].newc_name = VasEBoot_strndup (ptr, eptr - ptr); if (!initrd_ctx->components[i].newc_name) { - grub_initrd_close (initrd_ctx); - return grub_errno; + VasEBoot_initrd_close (initrd_ctx); + return VasEBoot_errno; } initrd_ctx->size += ALIGN_UP (sizeof (struct newc_head) - + grub_strlen (initrd_ctx->components[i].newc_name), + + VasEBoot_strlen (initrd_ctx->components[i].newc_name), 4); initrd_ctx->size += insert_dir (initrd_ctx->components[i].newc_name, &root, 0); @@ -199,16 +199,16 @@ grub_initrd_init (int argc, char *argv[], root = 0; newc = 0; } - grub_file_filter_disable_compression (); - initrd_ctx->components[i].file = grub_file_open (fname); + VasEBoot_file_filter_disable_compression (); + initrd_ctx->components[i].file = VasEBoot_file_open (fname); if (!initrd_ctx->components[i].file) { - grub_initrd_close (initrd_ctx); - return grub_errno; + VasEBoot_initrd_close (initrd_ctx); + return VasEBoot_errno; } initrd_ctx->nfiles++; initrd_ctx->components[i].size - = grub_file_size (initrd_ctx->components[i].file); + = VasEBoot_file_size (initrd_ctx->components[i].file); initrd_ctx->size += initrd_ctx->components[i].size; } @@ -221,43 +221,43 @@ grub_initrd_init (int argc, char *argv[], root = 0; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_size_t -grub_get_initrd_size (struct grub_linux_initrd_context *initrd_ctx) +VasEBoot_size_t +VasEBoot_get_initrd_size (struct VasEBoot_linux_initrd_context *initrd_ctx) { return initrd_ctx->size; } void -grub_initrd_close (struct grub_linux_initrd_context *initrd_ctx) +VasEBoot_initrd_close (struct VasEBoot_linux_initrd_context *initrd_ctx) { int i; if (!initrd_ctx->components) return; for (i = 0; i < initrd_ctx->nfiles; i++) { - grub_free (initrd_ctx->components[i].newc_name); - grub_file_close (initrd_ctx->components[i].file); + VasEBoot_free (initrd_ctx->components[i].newc_name); + VasEBoot_file_close (initrd_ctx->components[i].file); } - grub_free (initrd_ctx->components); + VasEBoot_free (initrd_ctx->components); initrd_ctx->components = 0; } -grub_err_t -grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, +VasEBoot_err_t +VasEBoot_initrd_load (struct VasEBoot_linux_initrd_context *initrd_ctx, char *argv[], void *target) { - grub_uint8_t *ptr = target; + VasEBoot_uint8_t *ptr = target; int i; int newc = 0; struct dir *root = 0; - grub_ssize_t cursize = 0; + VasEBoot_ssize_t cursize = 0; for (i = 0; i < initrd_ctx->nfiles; i++) { - grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); + VasEBoot_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); ptr += ALIGN_UP_OVERHEAD (cursize, 4); if (initrd_ctx->components[i].newc_name) @@ -265,7 +265,7 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, ptr += insert_dir (initrd_ctx->components[i].newc_name, &root, ptr); ptr = make_header (ptr, initrd_ctx->components[i].newc_name, - grub_strlen (initrd_ctx->components[i].newc_name), + VasEBoot_strlen (initrd_ctx->components[i].newc_name), 0100777, initrd_ctx->components[i].size); newc = 1; @@ -280,27 +280,27 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, } cursize = initrd_ctx->components[i].size; - if (grub_file_read (initrd_ctx->components[i].file, ptr, cursize) + if (VasEBoot_file_read (initrd_ctx->components[i].file, ptr, cursize) != cursize) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), argv[i]); - grub_initrd_close (initrd_ctx); - return grub_errno; + VasEBoot_initrd_close (initrd_ctx); + return VasEBoot_errno; } - grub_tpm_measure (ptr, cursize, GRUB_BINARY_PCR, "grub_initrd", "Initrd"); - grub_print_error(); + VasEBoot_tpm_measure (ptr, cursize, VasEBoot_BINARY_PCR, "VasEBoot_initrd", "Initrd"); + VasEBoot_print_error(); ptr += cursize; } if (newc) { - grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); + VasEBoot_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); ptr += ALIGN_UP_OVERHEAD (cursize, 4); ptr = make_header (ptr, "TRAILER!!!", sizeof ("TRAILER!!!") - 1, 0, 0); } free_dir (root); root = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/loader/lzss.c b/VasEBoot-core/loader/lzss.c index 532d8e4a3..eb4593c08 100644 --- a/VasEBoot-core/loader/lzss.c +++ b/VasEBoot-core/loader/lzss.c @@ -10,8 +10,8 @@ CompuServe 74050,1022 **************************************************************/ -#include -#include +#include +#include #define N 4096 /* size of ring buffer */ #define F 18 /* upper limit for match_length */ @@ -23,14 +23,14 @@ #define getc(file) ((src < srcend) ? *src++ : EOF) #define putc(c, file) (dst < dstend) ? (*dst++ = (c)) : 0; -grub_size_t -grub_decompress_lzss (grub_uint8_t *dst, grub_uint8_t *dstend, - grub_uint8_t *src, grub_uint8_t *srcend) +VasEBoot_size_t +VasEBoot_decompress_lzss (VasEBoot_uint8_t *dst, VasEBoot_uint8_t *dstend, + VasEBoot_uint8_t *src, VasEBoot_uint8_t *srcend) { int i, j, k, r, c; unsigned int flags; static unsigned char text_buf[N + F - 1]; - grub_uint8_t *dst0 = dst; + VasEBoot_uint8_t *dst0 = dst; for (i = 0; i < N - F; i++) text_buf[i] = ' '; r = N - F; flags = 0; diff --git a/VasEBoot-core/loader/macho.c b/VasEBoot-core/loader/macho.c index 59b195e27..f060d99ed 100644 --- a/VasEBoot-core/loader/macho.c +++ b/VasEBoot-core/loader/macho.c @@ -1,64 +1,64 @@ /* macho.c - load Mach-O files. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* This Mach-O loader is incomplete and can load only non-relocatable segments. This is however enough to boot xnu (otool -l and Mach-O specs for more info). */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -grub_err_t -grub_macho_close (grub_macho_t macho) +VasEBoot_err_t +VasEBoot_macho_close (VasEBoot_macho_t macho) { - grub_file_t file = macho->file; + VasEBoot_file_t file = macho->file; if (!macho->uncompressed32) - grub_free (macho->cmds32); - grub_free (macho->uncompressed32); + VasEBoot_free (macho->cmds32); + VasEBoot_free (macho->uncompressed32); if (!macho->uncompressed64) - grub_free (macho->cmds64); - grub_free (macho->uncompressed64); + VasEBoot_free (macho->cmds64); + VasEBoot_free (macho->uncompressed64); - grub_free (macho); + VasEBoot_free (macho); if (file) - grub_file_close (file); + VasEBoot_file_close (file); - return grub_errno; + return VasEBoot_errno; } -grub_macho_t -grub_macho_file (grub_file_t file, const char *filename, int is_64bit) +VasEBoot_macho_t +VasEBoot_macho_file (VasEBoot_file_t file, const char *filename, int is_64bit) { - grub_macho_t macho; - union grub_macho_filestart filestart; + VasEBoot_macho_t macho; + union VasEBoot_macho_filestart filestart; - macho = grub_malloc (sizeof (*macho)); + macho = VasEBoot_malloc (sizeof (*macho)); if (! macho) return 0; @@ -74,39 +74,39 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit) macho->compressed32 = 0; macho->compressed64 = 0; - if (grub_file_seek (macho->file, 0) == (grub_off_t) -1) + if (VasEBoot_file_seek (macho->file, 0) == (VasEBoot_off_t) -1) goto fail; - if (grub_file_read (macho->file, &filestart, sizeof (filestart)) + if (VasEBoot_file_read (macho->file, &filestart, sizeof (filestart)) != sizeof (filestart)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); goto fail; } /* Is it a fat file? */ - if (filestart.fat.magic == grub_cpu_to_be32_compile_time (GRUB_MACHO_FAT_MAGIC)) + if (filestart.fat.magic == VasEBoot_cpu_to_be32_compile_time (VasEBoot_MACHO_FAT_MAGIC)) { - struct grub_macho_fat_arch *archs; + struct VasEBoot_macho_fat_arch *archs; int i, narchs; /* Load architecture description. */ - narchs = grub_be_to_cpu32 (filestart.fat.nfat_arch); - if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header)) - == (grub_off_t) -1) + narchs = VasEBoot_be_to_cpu32 (filestart.fat.nfat_arch); + if (VasEBoot_file_seek (macho->file, sizeof (struct VasEBoot_macho_fat_header)) + == (VasEBoot_off_t) -1) goto fail; - archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs); + archs = VasEBoot_malloc (sizeof (struct VasEBoot_macho_fat_arch) * narchs); if (!archs) goto fail; - if (grub_file_read (macho->file, archs, - sizeof (struct grub_macho_fat_arch) * narchs) - != (grub_ssize_t) sizeof(struct grub_macho_fat_arch) * narchs) + if (VasEBoot_file_read (macho->file, archs, + sizeof (struct VasEBoot_macho_fat_arch) * narchs) + != (VasEBoot_ssize_t) sizeof(struct VasEBoot_macho_fat_arch) * narchs) { - grub_free (archs); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_free (archs); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); goto fail; } @@ -114,67 +114,67 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit) for (i = 0; i < narchs; i++) { if ((archs[i].cputype - == grub_cpu_to_be32_compile_time (GRUB_MACHO_CPUTYPE_IA32)) + == VasEBoot_cpu_to_be32_compile_time (VasEBoot_MACHO_CPUTYPE_IA32)) && !is_64bit) { - macho->offset32 = grub_be_to_cpu32 (archs[i].offset); - macho->end32 = grub_be_to_cpu32 (archs[i].offset) - + grub_be_to_cpu32 (archs[i].size); + macho->offset32 = VasEBoot_be_to_cpu32 (archs[i].offset); + macho->end32 = VasEBoot_be_to_cpu32 (archs[i].offset) + + VasEBoot_be_to_cpu32 (archs[i].size); } if ((archs[i].cputype - == grub_cpu_to_be32_compile_time (GRUB_MACHO_CPUTYPE_AMD64)) + == VasEBoot_cpu_to_be32_compile_time (VasEBoot_MACHO_CPUTYPE_AMD64)) && is_64bit) { - macho->offset64 = grub_be_to_cpu32 (archs[i].offset); - macho->end64 = grub_be_to_cpu32 (archs[i].offset) - + grub_be_to_cpu32 (archs[i].size); + macho->offset64 = VasEBoot_be_to_cpu32 (archs[i].offset); + macho->end64 = VasEBoot_be_to_cpu32 (archs[i].offset) + + VasEBoot_be_to_cpu32 (archs[i].size); } } - grub_free (archs); + VasEBoot_free (archs); } /* Is it a thin 32-bit file? */ - if (filestart.thin32.magic == GRUB_MACHO_MAGIC32 && !is_64bit) + if (filestart.thin32.magic == VasEBoot_MACHO_MAGIC32 && !is_64bit) { macho->offset32 = 0; - macho->end32 = grub_file_size (file); + macho->end32 = VasEBoot_file_size (file); } /* Is it a thin 64-bit file? */ - if (filestart.thin64.magic == GRUB_MACHO_MAGIC64 && is_64bit) + if (filestart.thin64.magic == VasEBoot_MACHO_MAGIC64 && is_64bit) { macho->offset64 = 0; - macho->end64 = grub_file_size (file); + macho->end64 = VasEBoot_file_size (file); } - if (grub_memcmp (filestart.lzss.magic, GRUB_MACHO_LZSS_MAGIC, + if (VasEBoot_memcmp (filestart.lzss.magic, VasEBoot_MACHO_LZSS_MAGIC, sizeof (filestart.lzss.magic)) == 0 && !is_64bit) { macho->offset32 = 0; - macho->end32 = grub_file_size (file); + macho->end32 = VasEBoot_file_size (file); } /* Is it a thin 64-bit file? */ - if (grub_memcmp (filestart.lzss.magic, GRUB_MACHO_LZSS_MAGIC, + if (VasEBoot_memcmp (filestart.lzss.magic, VasEBoot_MACHO_LZSS_MAGIC, sizeof (filestart.lzss.magic)) == 0 && is_64bit) { macho->offset64 = 0; - macho->end64 = grub_file_size (file); + macho->end64 = VasEBoot_file_size (file); } - grub_macho_parse32 (macho, filename); - grub_macho_parse64 (macho, filename); + VasEBoot_macho_parse32 (macho, filename); + VasEBoot_macho_parse64 (macho, filename); if (macho->offset32 == -1 && !is_64bit) { - grub_error (GRUB_ERR_BAD_OS, + VasEBoot_error (VasEBoot_ERR_BAD_OS, "Mach-O doesn't contain suitable 32-bit architecture"); goto fail; } if (macho->offset64 == -1 && is_64bit) { - grub_error (GRUB_ERR_BAD_OS, + VasEBoot_error (VasEBoot_ERR_BAD_OS, "Mach-O doesn't contain suitable 64-bit architecture"); goto fail; } @@ -183,23 +183,23 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit) fail: macho->file = 0; - grub_macho_close (macho); + VasEBoot_macho_close (macho); return 0; } -grub_macho_t -grub_macho_open (const char *name, int is_64bit) +VasEBoot_macho_t +VasEBoot_macho_open (const char *name, int is_64bit) { - grub_file_t file; - grub_macho_t macho; + VasEBoot_file_t file; + VasEBoot_macho_t macho; - file = grub_file_open (name); + file = VasEBoot_file_open (name); if (! file) return 0; - macho = grub_macho_file (file, name, is_64bit); + macho = VasEBoot_macho_file (file, name, is_64bit); if (! macho) - grub_file_close (file); + VasEBoot_file_close (file); return macho; } diff --git a/VasEBoot-core/loader/macho32.c b/VasEBoot-core/loader/macho32.c index 2de3a5c6f..5dcf92fa7 100644 --- a/VasEBoot-core/loader/macho32.c +++ b/VasEBoot-core/loader/macho32.c @@ -1,11 +1,11 @@ -#include -#include +#include +#include #define SUFFIX(x) x ## 32 -typedef struct grub_macho_header32 grub_macho_header_t; -typedef struct grub_macho_segment32 grub_macho_segment_t; -typedef grub_uint32_t grub_macho_addr_t; -typedef struct grub_macho_thread32 grub_macho_thread_t; +typedef struct VasEBoot_macho_header32 VasEBoot_macho_header_t; +typedef struct VasEBoot_macho_segment32 VasEBoot_macho_segment_t; +typedef VasEBoot_uint32_t VasEBoot_macho_addr_t; +typedef struct VasEBoot_macho_thread32 VasEBoot_macho_thread_t; #define offsetXX offset32 #define ncmdsXX ncmds32 #define cmdsizeXX cmdsize32 @@ -16,7 +16,7 @@ typedef struct grub_macho_thread32 grub_macho_thread_t; #define uncompressed_sizeXX uncompressed_size32 #define compressed_sizeXX compressed_size32 #define XX "32" -#define GRUB_MACHO_MAGIC GRUB_MACHO_MAGIC32 -#define GRUB_MACHO_CMD_SEGMENT GRUB_MACHO_CMD_SEGMENT32 +#define VasEBoot_MACHO_MAGIC VasEBoot_MACHO_MAGIC32 +#define VasEBoot_MACHO_CMD_SEGMENT VasEBoot_MACHO_CMD_SEGMENT32 #include "machoXX.c" diff --git a/VasEBoot-core/loader/macho64.c b/VasEBoot-core/loader/macho64.c index 0affceb77..bd43736db 100644 --- a/VasEBoot-core/loader/macho64.c +++ b/VasEBoot-core/loader/macho64.c @@ -1,11 +1,11 @@ -#include -#include +#include +#include #define SUFFIX(x) x ## 64 -typedef struct grub_macho_header64 grub_macho_header_t; -typedef struct grub_macho_segment64 grub_macho_segment_t; -typedef grub_uint64_t grub_macho_addr_t; -typedef struct grub_macho_thread64 grub_macho_thread_t; +typedef struct VasEBoot_macho_header64 VasEBoot_macho_header_t; +typedef struct VasEBoot_macho_segment64 VasEBoot_macho_segment_t; +typedef VasEBoot_uint64_t VasEBoot_macho_addr_t; +typedef struct VasEBoot_macho_thread64 VasEBoot_macho_thread_t; #define offsetXX offset64 #define ncmdsXX ncmds64 #define cmdsizeXX cmdsize64 @@ -16,7 +16,7 @@ typedef struct grub_macho_thread64 grub_macho_thread_t; #define uncompressed_sizeXX uncompressed_size64 #define compressed_sizeXX compressed_size64 #define XX "64" -#define GRUB_MACHO_MAGIC GRUB_MACHO_MAGIC64 -#define GRUB_MACHO_CMD_SEGMENT GRUB_MACHO_CMD_SEGMENT64 +#define VasEBoot_MACHO_MAGIC VasEBoot_MACHO_MAGIC64 +#define VasEBoot_MACHO_CMD_SEGMENT VasEBoot_MACHO_CMD_SEGMENT64 #include "machoXX.c" diff --git a/VasEBoot-core/loader/machoXX.c b/VasEBoot-core/loader/machoXX.c index 95c3fe564..6d20af28d 100644 --- a/VasEBoot-core/loader/machoXX.c +++ b/VasEBoot-core/loader/machoXX.c @@ -1,23 +1,23 @@ -#include -#include -#include -#include +#include +#include +#include +#include #define min(a,b) (((a) < (b)) ? (a) : (b)) static int -SUFFIX (grub_macho_contains_macho) (grub_macho_t macho) +SUFFIX (VasEBoot_macho_contains_macho) (VasEBoot_macho_t macho) { return macho->offsetXX != -1; } void -SUFFIX (grub_macho_parse) (grub_macho_t macho, const char *filename) +SUFFIX (VasEBoot_macho_parse) (VasEBoot_macho_t macho, const char *filename) { union { - struct grub_macho_lzss_header lzss; - grub_macho_header_t macho; + struct VasEBoot_macho_lzss_header lzss; + VasEBoot_macho_header_t macho; } head; /* Is there any candidate at all? */ @@ -25,25 +25,25 @@ SUFFIX (grub_macho_parse) (grub_macho_t macho, const char *filename) return; /* Read header and check magic. */ - if (grub_file_seek (macho->file, macho->offsetXX) == (grub_off_t) -1 - || grub_file_read (macho->file, &head, sizeof (head)) + if (VasEBoot_file_seek (macho->file, macho->offsetXX) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (macho->file, &head, sizeof (head)) != sizeof (head)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); macho->offsetXX = -1; return; } - if (grub_memcmp (head.lzss.magic, GRUB_MACHO_LZSS_MAGIC, + if (VasEBoot_memcmp (head.lzss.magic, VasEBoot_MACHO_LZSS_MAGIC, sizeof (head.lzss.magic)) == 0) { - macho->compressed_sizeXX = grub_be_to_cpu32 (head.lzss.compressed_size); + macho->compressed_sizeXX = VasEBoot_be_to_cpu32 (head.lzss.compressed_size); macho->uncompressed_sizeXX - = grub_be_to_cpu32 (head.lzss.uncompressed_size); + = VasEBoot_be_to_cpu32 (head.lzss.uncompressed_size); if (macho->uncompressed_sizeXX < sizeof (head.macho)) { - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); macho->offsetXX = -1; return; @@ -53,9 +53,9 @@ SUFFIX (grub_macho_parse) (grub_macho_t macho, const char *filename) return; } - if (head.macho.magic != GRUB_MACHO_MAGIC) + if (head.macho.magic != VasEBoot_MACHO_MAGIC) { - grub_error (GRUB_ERR_BAD_OS, "invalid Mach-O header"); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid Mach-O header"); macho->offsetXX = -1; return; } @@ -63,167 +63,167 @@ SUFFIX (grub_macho_parse) (grub_macho_t macho, const char *filename) /* Read commands. */ macho->ncmdsXX = head.macho.ncmds; macho->cmdsizeXX = head.macho.sizeofcmds; - macho->cmdsXX = grub_malloc (macho->cmdsizeXX); + macho->cmdsXX = VasEBoot_malloc (macho->cmdsizeXX); if (! macho->cmdsXX) return; - if (grub_file_seek (macho->file, macho->offsetXX - + sizeof (grub_macho_header_t)) == (grub_off_t) -1 - || grub_file_read (macho->file, macho->cmdsXX, - (grub_size_t) macho->cmdsizeXX) - != (grub_ssize_t) macho->cmdsizeXX) + if (VasEBoot_file_seek (macho->file, macho->offsetXX + + sizeof (VasEBoot_macho_header_t)) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (macho->file, macho->cmdsXX, + (VasEBoot_size_t) macho->cmdsizeXX) + != (VasEBoot_ssize_t) macho->cmdsizeXX) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); macho->offsetXX = -1; } } -typedef int (*grub_macho_iter_hook_t) -(grub_macho_t , struct grub_macho_cmd *, +typedef int (*VasEBoot_macho_iter_hook_t) +(VasEBoot_macho_t , struct VasEBoot_macho_cmd *, void *); -static grub_err_t -grub_macho_cmds_iterate (grub_macho_t macho, - grub_macho_iter_hook_t hook, +static VasEBoot_err_t +VasEBoot_macho_cmds_iterate (VasEBoot_macho_t macho, + VasEBoot_macho_iter_hook_t hook, void *hook_arg, const char *filename) { - grub_uint8_t *hdrs; + VasEBoot_uint8_t *hdrs; int i; if (macho->compressedXX && !macho->uncompressedXX) { - grub_uint8_t *tmp; - grub_macho_header_t *head; - macho->uncompressedXX = grub_malloc (macho->uncompressed_sizeXX); + VasEBoot_uint8_t *tmp; + VasEBoot_macho_header_t *head; + macho->uncompressedXX = VasEBoot_malloc (macho->uncompressed_sizeXX); if (!macho->uncompressedXX) - return grub_errno; - tmp = grub_malloc (macho->compressed_sizeXX); + return VasEBoot_errno; + tmp = VasEBoot_malloc (macho->compressed_sizeXX); if (!tmp) { - grub_free (macho->uncompressedXX); + VasEBoot_free (macho->uncompressedXX); macho->uncompressedXX = 0; - return grub_errno; + return VasEBoot_errno; } - if (grub_file_seek (macho->file, macho->offsetXX - + GRUB_MACHO_LZSS_OFFSET) == (grub_off_t) -1 - || grub_file_read (macho->file, tmp, - (grub_size_t) macho->compressed_sizeXX) - != (grub_ssize_t) macho->compressed_sizeXX) + if (VasEBoot_file_seek (macho->file, macho->offsetXX + + VasEBoot_MACHO_LZSS_OFFSET) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (macho->file, tmp, + (VasEBoot_size_t) macho->compressed_sizeXX) + != (VasEBoot_ssize_t) macho->compressed_sizeXX) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - grub_free (tmp); - grub_free (macho->uncompressedXX); + VasEBoot_free (tmp); + VasEBoot_free (macho->uncompressedXX); macho->uncompressedXX = 0; macho->offsetXX = -1; - return grub_errno; + return VasEBoot_errno; } - if (grub_decompress_lzss (macho->uncompressedXX, + if (VasEBoot_decompress_lzss (macho->uncompressedXX, macho->uncompressedXX + macho->uncompressed_sizeXX, tmp, tmp + macho->compressed_sizeXX) != macho->uncompressed_sizeXX) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - grub_free (tmp); - grub_free (macho->uncompressedXX); + VasEBoot_free (tmp); + VasEBoot_free (macho->uncompressedXX); macho->uncompressedXX = 0; macho->offsetXX = -1; - return grub_errno; + return VasEBoot_errno; } - grub_free (tmp); - head = (grub_macho_header_t *) macho->uncompressedXX; + VasEBoot_free (tmp); + head = (VasEBoot_macho_header_t *) macho->uncompressedXX; macho->ncmdsXX = head->ncmds; macho->cmdsizeXX = head->sizeofcmds; - macho->cmdsXX = macho->uncompressedXX + sizeof (grub_macho_header_t); - if (sizeof (grub_macho_header_t) + macho->cmdsizeXX + macho->cmdsXX = macho->uncompressedXX + sizeof (VasEBoot_macho_header_t); + if (sizeof (VasEBoot_macho_header_t) + macho->cmdsizeXX >= macho->uncompressed_sizeXX) { - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - grub_free (macho->uncompressedXX); + VasEBoot_free (macho->uncompressedXX); macho->uncompressedXX = 0; macho->offsetXX = -1; - return grub_errno; + return VasEBoot_errno; } } if (! macho->cmdsXX) - return grub_error (GRUB_ERR_BAD_OS, "couldn't find Mach-O commands"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "couldn't find Mach-O commands"); hdrs = macho->cmdsXX; for (i = 0; i < macho->ncmdsXX; i++) { - struct grub_macho_cmd *hdr = (struct grub_macho_cmd *) hdrs; + struct VasEBoot_macho_cmd *hdr = (struct VasEBoot_macho_cmd *) hdrs; if (hook (macho, hdr, hook_arg)) break; hdrs += hdr->cmdsize; } - return grub_errno; + return VasEBoot_errno; } -grub_size_t -SUFFIX (grub_macho_filesize) (grub_macho_t macho) +VasEBoot_size_t +SUFFIX (VasEBoot_macho_filesize) (VasEBoot_macho_t macho) { - if (SUFFIX (grub_macho_contains_macho) (macho)) + if (SUFFIX (VasEBoot_macho_contains_macho) (macho)) return macho->endXX - macho->offsetXX; return 0; } -grub_err_t -SUFFIX (grub_macho_readfile) (grub_macho_t macho, +VasEBoot_err_t +SUFFIX (VasEBoot_macho_readfile) (VasEBoot_macho_t macho, const char *filename, void *dest) { - grub_ssize_t read; - if (! SUFFIX (grub_macho_contains_macho) (macho)) - return grub_error (GRUB_ERR_BAD_OS, + VasEBoot_ssize_t read; + if (! SUFFIX (VasEBoot_macho_contains_macho) (macho)) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "couldn't read architecture-specific part"); - if (grub_file_seek (macho->file, macho->offsetXX) == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (macho->file, macho->offsetXX) == (VasEBoot_off_t) -1) + return VasEBoot_errno; - read = grub_file_read (macho->file, dest, + read = VasEBoot_file_read (macho->file, dest, macho->endXX - macho->offsetXX); - if (read != (grub_ssize_t) (macho->endXX - macho->offsetXX)) + if (read != (VasEBoot_ssize_t) (macho->endXX - macho->offsetXX)) { - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } struct calcsize_ctx { int flags; int nr_phdrs; - grub_macho_addr_t *segments_start; - grub_macho_addr_t *segments_end; + VasEBoot_macho_addr_t *segments_start; + VasEBoot_macho_addr_t *segments_end; }; /* Run through the program headers to calculate the total memory size we should claim. */ static int -calcsize (grub_macho_t _macho __attribute__ ((unused)), - struct grub_macho_cmd *hdr0, +calcsize (VasEBoot_macho_t _macho __attribute__ ((unused)), + struct VasEBoot_macho_cmd *hdr0, void *_arg) { - grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0; + VasEBoot_macho_segment_t *hdr = (VasEBoot_macho_segment_t *) hdr0; struct calcsize_ctx *ctx = _arg; - if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT) + if (hdr->cmd != VasEBoot_MACHO_CMD_SEGMENT) return 0; if (! hdr->vmsize) return 0; - if (! hdr->filesize && (ctx->flags & GRUB_MACHO_NOBSS)) + if (! hdr->filesize && (ctx->flags & VasEBoot_MACHO_NOBSS)) return 0; ctx->nr_phdrs++; @@ -235,9 +235,9 @@ calcsize (grub_macho_t _macho __attribute__ ((unused)), } /* Calculate the amount of memory spanned by the segments. */ -grub_err_t -SUFFIX (grub_macho_size) (grub_macho_t macho, grub_macho_addr_t *segments_start, - grub_macho_addr_t *segments_end, int flags, +VasEBoot_err_t +SUFFIX (VasEBoot_macho_size) (VasEBoot_macho_t macho, VasEBoot_macho_addr_t *segments_start, + VasEBoot_macho_addr_t *segments_end, int flags, const char *filename) { struct calcsize_ctx ctx = { @@ -247,19 +247,19 @@ SUFFIX (grub_macho_size) (grub_macho_t macho, grub_macho_addr_t *segments_start, .segments_end = segments_end, }; - *segments_start = (grub_macho_addr_t) -1; + *segments_start = (VasEBoot_macho_addr_t) -1; *segments_end = 0; - grub_macho_cmds_iterate (macho, calcsize, &ctx, filename); + VasEBoot_macho_cmds_iterate (macho, calcsize, &ctx, filename); if (ctx.nr_phdrs == 0) - return grub_error (GRUB_ERR_BAD_OS, "no program headers present"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "no program headers present"); if (*segments_end < *segments_start) /* Very bad addresses. */ - return grub_error (GRUB_ERR_BAD_OS, "bad program header load addresses"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "bad program header load addresses"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } struct do_load_ctx @@ -271,50 +271,50 @@ struct do_load_ctx }; static int -do_load(grub_macho_t _macho, - struct grub_macho_cmd *hdr0, +do_load(VasEBoot_macho_t _macho, + struct VasEBoot_macho_cmd *hdr0, void *_arg) { - grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0; + VasEBoot_macho_segment_t *hdr = (VasEBoot_macho_segment_t *) hdr0; struct do_load_ctx *ctx = _arg; - if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT) + if (hdr->cmd != VasEBoot_MACHO_CMD_SEGMENT) return 0; - if (! hdr->filesize && (ctx->flags & GRUB_MACHO_NOBSS)) + if (! hdr->filesize && (ctx->flags & VasEBoot_MACHO_NOBSS)) return 0; if (! hdr->vmsize) return 0; if (hdr->filesize) { - grub_ssize_t read, toread = min (hdr->filesize, hdr->vmsize); + VasEBoot_ssize_t read, toread = min (hdr->filesize, hdr->vmsize); if (_macho->uncompressedXX) { - if (hdr->fileoff + (grub_size_t) toread + if (hdr->fileoff + (VasEBoot_size_t) toread > _macho->uncompressed_sizeXX) read = -1; else { read = toread; - grub_memcpy (ctx->offset + hdr->vmaddr, + VasEBoot_memcpy (ctx->offset + hdr->vmaddr, _macho->uncompressedXX + hdr->fileoff, read); } } else { - if (grub_file_seek (_macho->file, hdr->fileoff - + _macho->offsetXX) == (grub_off_t) -1) + if (VasEBoot_file_seek (_macho->file, hdr->fileoff + + _macho->offsetXX) == (VasEBoot_off_t) -1) return 1; - read = grub_file_read (_macho->file, ctx->offset + hdr->vmaddr, + read = VasEBoot_file_read (_macho->file, ctx->offset + hdr->vmaddr, toread); } if (read != toread) { /* XXX How can we free memory from `load_hook'? */ - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), ctx->filename); return 1; @@ -325,13 +325,13 @@ do_load(grub_macho_t _macho, const char *end = ptr + min (hdr->filesize, hdr->vmsize) - (sizeof ("Darwin Kernel Version ") - 1); for (; ptr < end; ptr++) - if (grub_memcmp (ptr, "Darwin Kernel Version ", + if (VasEBoot_memcmp (ptr, "Darwin Kernel Version ", sizeof ("Darwin Kernel Version ") - 1) == 0) { ptr += sizeof ("Darwin Kernel Version ") - 1; *ctx->darwin_version = 0; end += (sizeof ("Darwin Kernel Version ") - 1); - while (ptr < end && grub_isdigit (*ptr)) + while (ptr < end && VasEBoot_isdigit (*ptr)) *ctx->darwin_version = (*ptr++ - '0') + *ctx->darwin_version * 10; break; } @@ -339,14 +339,14 @@ do_load(grub_macho_t _macho, } if (hdr->filesize < hdr->vmsize) - grub_memset (ctx->offset + hdr->vmaddr + hdr->filesize, + VasEBoot_memset (ctx->offset + hdr->vmaddr + hdr->filesize, 0, hdr->vmsize - hdr->filesize); return 0; } /* Load every loadable segment into memory specified by `_load_hook'. */ -grub_err_t -SUFFIX (grub_macho_load) (grub_macho_t macho, const char *filename, +VasEBoot_err_t +SUFFIX (VasEBoot_macho_load) (VasEBoot_macho_t macho, const char *filename, char *offset, int flags, int *darwin_version) { struct do_load_ctx ctx = { @@ -359,26 +359,26 @@ SUFFIX (grub_macho_load) (grub_macho_t macho, const char *filename, if (darwin_version) *darwin_version = 0; - grub_macho_cmds_iterate (macho, do_load, &ctx, filename); + VasEBoot_macho_cmds_iterate (macho, do_load, &ctx, filename); - return grub_errno; + return VasEBoot_errno; } static int -find_entry_point (grub_macho_t _macho __attribute__ ((unused)), - struct grub_macho_cmd *hdr, +find_entry_point (VasEBoot_macho_t _macho __attribute__ ((unused)), + struct VasEBoot_macho_cmd *hdr, void *_arg) { - grub_macho_addr_t *entry_point = _arg; - if (hdr->cmd == GRUB_MACHO_CMD_THREAD) - *entry_point = ((grub_macho_thread_t *) hdr)->entry_point; + VasEBoot_macho_addr_t *entry_point = _arg; + if (hdr->cmd == VasEBoot_MACHO_CMD_THREAD) + *entry_point = ((VasEBoot_macho_thread_t *) hdr)->entry_point; return 0; } -grub_macho_addr_t -SUFFIX (grub_macho_get_entry_point) (grub_macho_t macho, const char *filename) +VasEBoot_macho_addr_t +SUFFIX (VasEBoot_macho_get_entry_point) (VasEBoot_macho_t macho, const char *filename) { - grub_macho_addr_t entry_point = 0; - grub_macho_cmds_iterate (macho, find_entry_point, &entry_point, filename); + VasEBoot_macho_addr_t entry_point = 0; + VasEBoot_macho_cmds_iterate (macho, find_entry_point, &entry_point, filename); return entry_point; } diff --git a/VasEBoot-core/loader/mips/linux.c b/VasEBoot-core/loader/mips/linux.c index 5f383be3d..6a1cd9228 100644 --- a/VasEBoot-core/loader/mips/linux.c +++ b/VasEBoot-core/loader/mips/linux.c @@ -1,111 +1,111 @@ /* linux.c - boot Linux */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #pragma GCC diagnostic ignored "-Wcast-align" /* For frequencies. */ -#include +#include -#ifdef GRUB_MACHINE_MIPS_LOONGSON -#include -#include +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON +#include +#include const char loongson_machtypes[][60] = { - [GRUB_ARCH_MACHINE_YEELOONG] = "machtype=lemote-yeeloong-2f-8.9inches", - [GRUB_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-box", - [GRUB_ARCH_MACHINE_FULOONG2E] = "machtype=lemote-fuloong-2e-unknown" + [VasEBoot_ARCH_MACHINE_YEELOONG] = "machtype=lemote-yeeloong-2f-8.9inches", + [VasEBoot_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-box", + [VasEBoot_ARCH_MACHINE_FULOONG2E] = "machtype=lemote-fuloong-2e-unknown" }; #endif -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; -static grub_size_t linux_size; +static VasEBoot_size_t linux_size; -static struct grub_relocator *relocator; -static grub_uint8_t *playground; -static grub_addr_t target_addr, entry_addr; -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS +static struct VasEBoot_relocator *relocator; +static VasEBoot_uint8_t *playground; +static VasEBoot_addr_t target_addr, entry_addr; +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS static char *params; #else static int linux_argc; -static grub_off_t argv_off; -#ifdef GRUB_MACHINE_MIPS_LOONGSON -static grub_off_t envp_off; +static VasEBoot_off_t argv_off; +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON +static VasEBoot_off_t envp_off; #endif -static grub_off_t rd_addr_arg_off, rd_size_arg_off; +static VasEBoot_off_t rd_addr_arg_off, rd_size_arg_off; #endif static int initrd_loaded = 0; -static grub_err_t -grub_linux_boot (void) +static VasEBoot_err_t +VasEBoot_linux_boot (void) { - struct grub_relocator32_state state; + struct VasEBoot_relocator32_state state; - grub_memset (&state, 0, sizeof (state)); + VasEBoot_memset (&state, 0, sizeof (state)); /* Boot the kernel. */ state.gpr[1] = entry_addr; -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS { - grub_err_t err; - grub_relocator_chunk_t ch; - grub_uint32_t *memsize; - grub_uint32_t *magic; + VasEBoot_err_t err; + VasEBoot_relocator_chunk_t ch; + VasEBoot_uint32_t *memsize; + VasEBoot_uint32_t *magic; char *str; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, ((16 << 20) - 264), - grub_strlen (params) + 1 + 8); + VasEBoot_strlen (params) + 1 + 8); if (err) return err; memsize = get_virtual_current_address (ch); magic = memsize + 1; - *memsize = grub_mmap_get_lower (); + *memsize = VasEBoot_mmap_get_lower (); *magic = 0x12345678; str = (char *) (magic + 1); - grub_strcpy (str, params); + VasEBoot_strcpy (str, params); } #endif -#ifndef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifndef VasEBoot_MACHINE_MIPS_QEMU_MIPS state.gpr[4] = linux_argc; state.gpr[5] = target_addr + argv_off; -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON state.gpr[6] = target_addr + envp_off; #else state.gpr[6] = 0; @@ -113,41 +113,41 @@ grub_linux_boot (void) state.gpr[7] = 0; #endif state.jumpreg = 1; - grub_relocator32_boot (relocator, state); + VasEBoot_relocator32_boot (relocator, state); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { - grub_relocator_unload (relocator); - grub_dl_unref (my_mod); + VasEBoot_relocator_unload (relocator); + VasEBoot_dl_unref (my_mod); -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS - grub_free (params); +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS + VasEBoot_free (params); params = 0; #endif loaded = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_load32 (grub_elf_t elf, const char *filename, - void **extra_mem, grub_size_t extra_size) +static VasEBoot_err_t +VasEBoot_linux_load32 (VasEBoot_elf_t elf, const char *filename, + void **extra_mem, VasEBoot_size_t extra_size) { Elf32_Addr base; int extraoff; - grub_err_t err; + VasEBoot_err_t err; /* Linux's entry point incorrectly contains a virtual address. */ entry_addr = elf->ehdr.ehdr32.e_entry; - linux_size = grub_elf32_size (elf, &base, 0); + linux_size = VasEBoot_elf32_size (elf, &base, 0); if (linux_size == 0) - return grub_errno; + return VasEBoot_errno; target_addr = base; /* Pad it; the kernel scribbles over memory beyond its load address. */ linux_size += 0x100000; @@ -155,13 +155,13 @@ grub_linux_load32 (grub_elf_t elf, const char *filename, extraoff = linux_size; linux_size += extra_size; - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) - return grub_errno; + return VasEBoot_errno; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, target_addr & 0x1fffffff, linux_size); if (err) @@ -172,23 +172,23 @@ grub_linux_load32 (grub_elf_t elf, const char *filename, *extra_mem = playground + extraoff; /* Now load the segments into the area we claimed. */ - return grub_elf32_load (elf, filename, playground - base, GRUB_ELF_LOAD_FLAGS_NONE, 0, 0); + return VasEBoot_elf32_load (elf, filename, playground - base, VasEBoot_ELF_LOAD_FLAGS_NONE, 0, 0); } -static grub_err_t -grub_linux_load64 (grub_elf_t elf, const char *filename, - void **extra_mem, grub_size_t extra_size) +static VasEBoot_err_t +VasEBoot_linux_load64 (VasEBoot_elf_t elf, const char *filename, + void **extra_mem, VasEBoot_size_t extra_size) { Elf64_Addr base; int extraoff; - grub_err_t err; + VasEBoot_err_t err; /* Linux's entry point incorrectly contains a virtual address. */ entry_addr = elf->ehdr.ehdr64.e_entry; - linux_size = grub_elf64_size (elf, &base, 0); + linux_size = VasEBoot_elf64_size (elf, &base, 0); if (linux_size == 0) - return grub_errno; + return VasEBoot_errno; target_addr = base; /* Pad it; the kernel scribbles over memory beyond its load address. */ linux_size += 0x100000; @@ -196,13 +196,13 @@ grub_linux_load64 (grub_elf_t elf, const char *filename, extraoff = linux_size; linux_size += extra_size; - relocator = grub_relocator_new (); + relocator = VasEBoot_relocator_new (); if (!relocator) - return grub_errno; + return VasEBoot_errno; { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (relocator, &ch, target_addr & 0x1fffffff, linux_size); if (err) @@ -213,66 +213,66 @@ grub_linux_load64 (grub_elf_t elf, const char *filename, *extra_mem = playground + extraoff; /* Now load the segments into the area we claimed. */ - return grub_elf64_load (elf, filename, playground - base, GRUB_ELF_LOAD_FLAGS_NONE, 0, 0); + return VasEBoot_elf64_load (elf, filename, playground - base, VasEBoot_ELF_LOAD_FLAGS_NONE, 0, 0); } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_elf_t elf = 0; + VasEBoot_elf_t elf = 0; int size; void *extra = NULL; -#ifndef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifndef VasEBoot_MACHINE_MIPS_QEMU_MIPS int i; - grub_uint32_t *linux_argv; + VasEBoot_uint32_t *linux_argv; char *linux_args; #endif - grub_err_t err; -#ifdef GRUB_MACHINE_MIPS_LOONGSON + VasEBoot_err_t err; +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON char *linux_envs; - grub_uint32_t *linux_envp; + VasEBoot_uint32_t *linux_envp; #endif if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - elf = grub_elf_open (argv[0]); + elf = VasEBoot_elf_open (argv[0]); if (! elf) - return grub_errno; + return VasEBoot_errno; if (elf->ehdr.ehdr32.e_type != ET_EXEC) { - grub_elf_close (elf); - return grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_elf_close (elf); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); } /* Release the previously used memory. */ - grub_loader_unset (); + VasEBoot_loader_unset (); loaded = 0; -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS size = 0; #else /* For arguments. */ linux_argc = argc; -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON linux_argc++; #endif /* Main arguments. */ - size = (linux_argc) * sizeof (grub_uint32_t); + size = (linux_argc) * sizeof (VasEBoot_uint32_t); /* Initrd address and size. */ - size += 2 * sizeof (grub_uint32_t); + size += 2 * sizeof (VasEBoot_uint32_t); /* NULL terminator. */ - size += sizeof (grub_uint32_t); + size += sizeof (VasEBoot_uint32_t); /* First argument is always "a0". */ size += ALIGN_UP (sizeof ("a0"), 4); /* Normal arguments. */ for (i = 1; i < argc; i++) - size += ALIGN_UP (grub_strlen (argv[i]) + 1, 4); -#ifdef GRUB_MACHINE_MIPS_LOONGSON + size += ALIGN_UP (VasEBoot_strlen (argv[i]) + 1, 4); +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON size += ALIGN_UP (sizeof (loongson_machtypes[0]), 4); #endif @@ -281,62 +281,62 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), size += ALIGN_UP (sizeof ("rd_size=0xXXXXXXXXXXXXXXXX"), 4); /* For the environment. */ - size += sizeof (grub_uint32_t); - size += 4 * sizeof (grub_uint32_t); + size += sizeof (VasEBoot_uint32_t); + size += 4 * sizeof (VasEBoot_uint32_t); size += ALIGN_UP (sizeof ("memsize=XXXXXXXXXXXXXXXXXXXX"), 4) + ALIGN_UP (sizeof ("highmemsize=XXXXXXXXXXXXXXXXXXXX"), 4) + ALIGN_UP (sizeof ("busclock=XXXXXXXXXX"), 4) + ALIGN_UP (sizeof ("cpuclock=XXXXXXXXXX"), 4); #endif - if (grub_elf_is_elf32 (elf)) - err = grub_linux_load32 (elf, argv[0], &extra, size); + if (VasEBoot_elf_is_elf32 (elf)) + err = VasEBoot_linux_load32 (elf, argv[0], &extra, size); else - if (grub_elf_is_elf64 (elf)) - err = grub_linux_load64 (elf, argv[0], &extra, size); + if (VasEBoot_elf_is_elf64 (elf)) + err = VasEBoot_linux_load64 (elf, argv[0], &extra, size); else - err = grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); + err = VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - grub_elf_close (elf); + VasEBoot_elf_close (elf); if (err) return err; -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS /* Create kernel command line. */ - size = grub_loader_cmdline_size(argc, argv); - params = grub_malloc (size + sizeof (LINUX_IMAGE)); + size = VasEBoot_loader_cmdline_size(argc, argv); + params = VasEBoot_malloc (size + sizeof (LINUX_IMAGE)); if (! params) { - grub_linux_unload (); - return grub_errno; + VasEBoot_linux_unload (); + return VasEBoot_errno; } - grub_memcpy (params, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, params + sizeof (LINUX_IMAGE) - 1, + VasEBoot_memcpy (params, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, params + sizeof (LINUX_IMAGE) - 1, size); #else linux_argv = extra; - argv_off = (grub_uint8_t *) linux_argv - (grub_uint8_t *) playground; + argv_off = (VasEBoot_uint8_t *) linux_argv - (VasEBoot_uint8_t *) playground; extra = linux_argv + (linux_argc + 1 + 2); linux_args = extra; - grub_memcpy (linux_args, "a0", sizeof ("a0")); - *linux_argv = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground + VasEBoot_memcpy (linux_args, "a0", sizeof ("a0")); + *linux_argv = (VasEBoot_uint8_t *) linux_args - (VasEBoot_uint8_t *) playground + target_addr; linux_argv++; linux_args += ALIGN_UP (sizeof ("a0"), 4); -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON { - unsigned mtype = grub_arch_machine; + unsigned mtype = VasEBoot_arch_machine; if (mtype >= ARRAY_SIZE (loongson_machtypes)) mtype = 0; /* In Loongson platform, it is the responsibility of the bootloader/firmware to supply the OS kernel with machine type information. */ - grub_memcpy (linux_args, loongson_machtypes[mtype], + VasEBoot_memcpy (linux_args, loongson_machtypes[mtype], sizeof (loongson_machtypes[mtype])); - *linux_argv = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground + *linux_argv = (VasEBoot_uint8_t *) linux_args - (VasEBoot_uint8_t *) playground + target_addr; linux_argv++; linux_args += ALIGN_UP (sizeof (loongson_machtypes[mtype]), 4); @@ -345,20 +345,20 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), for (i = 1; i < argc; i++) { - grub_memcpy (linux_args, argv[i], grub_strlen (argv[i]) + 1); - *linux_argv = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground + VasEBoot_memcpy (linux_args, argv[i], VasEBoot_strlen (argv[i]) + 1); + *linux_argv = (VasEBoot_uint8_t *) linux_args - (VasEBoot_uint8_t *) playground + target_addr; linux_argv++; - linux_args += ALIGN_UP (grub_strlen (argv[i]) + 1, 4); + linux_args += ALIGN_UP (VasEBoot_strlen (argv[i]) + 1, 4); } /* Reserve space for rd arguments. */ - rd_addr_arg_off = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground; + rd_addr_arg_off = (VasEBoot_uint8_t *) linux_args - (VasEBoot_uint8_t *) playground; linux_args += ALIGN_UP (sizeof ("rd_start=0xXXXXXXXXXXXXXXXX"), 4); *linux_argv = 0; linux_argv++; - rd_size_arg_off = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground; + rd_size_arg_off = (VasEBoot_uint8_t *) linux_args - (VasEBoot_uint8_t *) playground; linux_args += ALIGN_UP (sizeof ("rd_size=0xXXXXXXXXXXXXXXXX"), 4); *linux_argv = 0; linux_argv++; @@ -367,79 +367,79 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), extra = linux_args; -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON linux_envp = extra; - envp_off = (grub_uint8_t *) linux_envp - (grub_uint8_t *) playground; + envp_off = (VasEBoot_uint8_t *) linux_envp - (VasEBoot_uint8_t *) playground; linux_envs = (char *) (linux_envp + 5); - grub_snprintf (linux_envs, sizeof ("memsize=XXXXXXXXXXXXXXXXXXXX"), + VasEBoot_snprintf (linux_envs, sizeof ("memsize=XXXXXXXXXXXXXXXXXXXX"), "memsize=%lld", - (unsigned long long) grub_mmap_get_lower () >> 20); - linux_envp[0] = (grub_uint8_t *) linux_envs - (grub_uint8_t *) playground + (unsigned long long) VasEBoot_mmap_get_lower () >> 20); + linux_envp[0] = (VasEBoot_uint8_t *) linux_envs - (VasEBoot_uint8_t *) playground + target_addr; - linux_envs += ALIGN_UP (grub_strlen (linux_envs) + 1, 4); - grub_snprintf (linux_envs, sizeof ("highmemsize=XXXXXXXXXXXXXXXXXXXX"), + linux_envs += ALIGN_UP (VasEBoot_strlen (linux_envs) + 1, 4); + VasEBoot_snprintf (linux_envs, sizeof ("highmemsize=XXXXXXXXXXXXXXXXXXXX"), "highmemsize=%lld", - (unsigned long long) grub_mmap_get_upper () >> 20); - linux_envp[1] = (grub_uint8_t *) linux_envs - (grub_uint8_t *) playground + (unsigned long long) VasEBoot_mmap_get_upper () >> 20); + linux_envp[1] = (VasEBoot_uint8_t *) linux_envs - (VasEBoot_uint8_t *) playground + target_addr; - linux_envs += ALIGN_UP (grub_strlen (linux_envs) + 1, 4); + linux_envs += ALIGN_UP (VasEBoot_strlen (linux_envs) + 1, 4); - grub_snprintf (linux_envs, sizeof ("busclock=XXXXXXXXXX"), - "busclock=%d", grub_arch_busclock); - linux_envp[2] = (grub_uint8_t *) linux_envs - (grub_uint8_t *) playground + VasEBoot_snprintf (linux_envs, sizeof ("busclock=XXXXXXXXXX"), + "busclock=%d", VasEBoot_arch_busclock); + linux_envp[2] = (VasEBoot_uint8_t *) linux_envs - (VasEBoot_uint8_t *) playground + target_addr; - linux_envs += ALIGN_UP (grub_strlen (linux_envs) + 1, 4); - grub_snprintf (linux_envs, sizeof ("cpuclock=XXXXXXXXXX"), - "cpuclock=%d", grub_arch_cpuclock); - linux_envp[3] = (grub_uint8_t *) linux_envs - (grub_uint8_t *) playground + linux_envs += ALIGN_UP (VasEBoot_strlen (linux_envs) + 1, 4); + VasEBoot_snprintf (linux_envs, sizeof ("cpuclock=XXXXXXXXXX"), + "cpuclock=%d", VasEBoot_arch_cpuclock); + linux_envp[3] = (VasEBoot_uint8_t *) linux_envs - (VasEBoot_uint8_t *) playground + target_addr; - linux_envs += ALIGN_UP (grub_strlen (linux_envs) + 1, 4); + linux_envs += ALIGN_UP (VasEBoot_strlen (linux_envs) + 1, 4); linux_envp[4] = 0; #endif #endif - grub_loader_set (grub_linux_boot, grub_linux_unload, 1); + VasEBoot_loader_set (VasEBoot_linux_boot, VasEBoot_linux_unload, 1); initrd_loaded = 0; loaded = 1; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0; + VasEBoot_size_t size = 0; void *initrd_src; - grub_addr_t initrd_dest; - grub_err_t err; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + VasEBoot_addr_t initrd_dest; + VasEBoot_err_t err; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); if (!loaded) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (initrd_loaded) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "only one initrd command can be issued."); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "only one initrd command can be issued."); - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); { - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_align (relocator, &ch, (target_addr & 0x1fffffff) + linux_size + 0x10000, (0x10000000 - size), size, 0x10000, - GRUB_RELOCATOR_PREFERENCE_NONE, 0); + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) goto fail; @@ -447,32 +447,32 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), initrd_dest = get_physical_target_address (ch) | 0x80000000; } - if (grub_initrd_load (&initrd_ctx, argv, initrd_src)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, initrd_src)) goto fail; -#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS +#ifdef VasEBoot_MACHINE_MIPS_QEMU_MIPS { char *tmp; - tmp = grub_xasprintf ("%s rd_start=0x%" PRIxGRUB_ADDR - " rd_size=0x%" PRIxGRUB_ADDR, params, + tmp = VasEBoot_xasprintf ("%s rd_start=0x%" PRIxVasEBoot_ADDR + " rd_size=0x%" PRIxVasEBoot_ADDR, params, initrd_dest, size); if (!tmp) goto fail; - grub_free (params); + VasEBoot_free (params); params = tmp; } #else - grub_snprintf ((char *) playground + rd_addr_arg_off, + VasEBoot_snprintf ((char *) playground + rd_addr_arg_off, sizeof ("rd_start=0xXXXXXXXXXXXXXXXX"), "rd_start=0x%llx", (unsigned long long) initrd_dest); - ((grub_uint32_t *) (playground + argv_off))[linux_argc] + ((VasEBoot_uint32_t *) (playground + argv_off))[linux_argc] = target_addr + rd_addr_arg_off; linux_argc++; - grub_snprintf ((char *) playground + rd_size_arg_off, + VasEBoot_snprintf ((char *) playground + rd_size_arg_off, sizeof ("rd_size=0xXXXXXXXXXXXXXXXXX"), "rd_size=0x%llx", (unsigned long long) size); - ((grub_uint32_t *) (playground + argv_off))[linux_argc] + ((VasEBoot_uint32_t *) (playground + argv_off))[linux_argc] = target_addr + rd_size_arg_off; linux_argc++; #endif @@ -480,24 +480,24 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), initrd_loaded = 1; fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linux) +VasEBoot_MOD_INIT(linux) { - cmd_linux = grub_register_command ("linux", grub_cmd_linux, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI(linux) +VasEBoot_MOD_FINI(linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/multiboot.c b/VasEBoot-core/loader/multiboot.c index a97ed8739..8a1c1ba1c 100644 --- a/VasEBoot-core/loader/multiboot.c +++ b/VasEBoot-core/loader/multiboot.c @@ -1,20 +1,20 @@ /* multiboot.c - boot a multiboot OS image. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* @@ -26,33 +26,33 @@ * - Networking information */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#ifdef GRUB_MACHINE_EFI -#include +#ifdef VasEBoot_MACHINE_EFI +#include #endif -struct grub_relocator *grub_multiboot_relocator = NULL; -grub_uint32_t grub_multiboot_payload_eip; -#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) +struct VasEBoot_relocator *VasEBoot_multiboot_relocator = NULL; +VasEBoot_uint32_t VasEBoot_multiboot_payload_eip; +#if defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_MULTIBOOT) || defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_QEMU) #define DEFAULT_VIDEO_MODE "text" #else #define DEFAULT_VIDEO_MODE "auto" @@ -61,16 +61,16 @@ grub_uint32_t grub_multiboot_payload_eip; static int accepts_video; static int accepts_ega_text; static int console_required; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; -/* Helper for grub_get_multiboot_mmap_count. */ +/* Helper for VasEBoot_get_multiboot_mmap_count. */ static int -count_hook (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - grub_memory_type_t type __attribute__ ((unused)), void *data) +count_hook (VasEBoot_uint64_t addr __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { - grub_size_t *count = data; + VasEBoot_size_t *count = data; (*count)++; return 0; @@ -78,125 +78,125 @@ count_hook (grub_uint64_t addr __attribute__ ((unused)), /* Return the length of the Multiboot mmap that will be needed to allocate our platform's map. */ -grub_uint32_t -grub_get_multiboot_mmap_count (void) +VasEBoot_uint32_t +VasEBoot_get_multiboot_mmap_count (void) { - grub_size_t count = 0; + VasEBoot_size_t count = 0; - grub_mmap_iterate (count_hook, &count); + VasEBoot_mmap_iterate (count_hook, &count); return count; } -grub_err_t -grub_multiboot_set_video_mode (void) +VasEBoot_err_t +VasEBoot_multiboot_set_video_mode (void) { - grub_err_t err; + VasEBoot_err_t err; const char *modevar; -#if GRUB_MACHINE_HAS_VGA_TEXT +#if VasEBoot_MACHINE_HAS_VGA_TEXT if (accepts_video) #endif { - modevar = grub_env_get ("gfxpayload"); + modevar = VasEBoot_env_get ("gfxpayload"); if (! modevar || *modevar == 0) - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); + err = VasEBoot_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); else { char *tmp; - tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); + tmp = VasEBoot_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); if (! tmp) - return grub_errno; - err = grub_video_set_mode (tmp, 0, 0); - grub_free (tmp); + return VasEBoot_errno; + err = VasEBoot_video_set_mode (tmp, 0, 0); + VasEBoot_free (tmp); } } -#if GRUB_MACHINE_HAS_VGA_TEXT +#if VasEBoot_MACHINE_HAS_VGA_TEXT else - err = grub_video_set_mode ("text", 0, 0); + err = VasEBoot_video_set_mode ("text", 0, 0); #endif return err; } -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI #ifdef __x86_64__ -#define grub_relocator_efi_boot grub_relocator64_efi_boot -#define grub_relocator_efi_state grub_relocator64_efi_state +#define VasEBoot_relocator_efi_boot VasEBoot_relocator64_efi_boot +#define VasEBoot_relocator_efi_state VasEBoot_relocator64_efi_state #endif #endif -#ifdef grub_relocator_efi_boot +#ifdef VasEBoot_relocator_efi_boot static void -efi_boot (struct grub_relocator *rel, - grub_uint32_t target) +efi_boot (struct VasEBoot_relocator *rel, + VasEBoot_uint32_t target) { - struct grub_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE; + struct VasEBoot_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE; - state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = grub_multiboot_payload_eip; + state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = VasEBoot_multiboot_payload_eip; state_efi.MULTIBOOT_EFI_MBI_REGISTER = target; - grub_relocator_efi_boot (rel, state_efi); + VasEBoot_relocator_efi_boot (rel, state_efi); } #else -#define grub_efi_is_finished 1 +#define VasEBoot_efi_is_finished 1 static void -efi_boot (struct grub_relocator *rel __attribute__ ((unused)), - grub_uint32_t target __attribute__ ((unused))) +efi_boot (struct VasEBoot_relocator *rel __attribute__ ((unused)), + VasEBoot_uint32_t target __attribute__ ((unused))) { } #endif #if defined (__i386__) || defined (__x86_64__) static void -normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state) +normal_boot (struct VasEBoot_relocator *rel, struct VasEBoot_relocator32_state state) { - grub_relocator32_boot (rel, state, 0); + VasEBoot_relocator32_boot (rel, state, 0); } #else static void -normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state) +normal_boot (struct VasEBoot_relocator *rel, struct VasEBoot_relocator32_state state) { - grub_relocator32_boot (rel, state); + VasEBoot_relocator32_boot (rel, state); } #endif -static grub_err_t -grub_multiboot_boot (void) +static VasEBoot_err_t +VasEBoot_multiboot_boot (void) { - grub_err_t err; - struct grub_relocator32_state state = MULTIBOOT_INITIAL_STATE; + VasEBoot_err_t err; + struct VasEBoot_relocator32_state state = MULTIBOOT_INITIAL_STATE; - state.MULTIBOOT_ENTRY_REGISTER = grub_multiboot_payload_eip; + state.MULTIBOOT_ENTRY_REGISTER = VasEBoot_multiboot_payload_eip; - err = grub_multiboot_make_mbi (&state.MULTIBOOT_MBI_REGISTER); + err = VasEBoot_multiboot_make_mbi (&state.MULTIBOOT_MBI_REGISTER); if (err) return err; - if (grub_efi_is_finished) - normal_boot (grub_multiboot_relocator, state); + if (VasEBoot_efi_is_finished) + normal_boot (VasEBoot_multiboot_relocator, state); else - efi_boot (grub_multiboot_relocator, state.MULTIBOOT_MBI_REGISTER); + efi_boot (VasEBoot_multiboot_relocator, state.MULTIBOOT_MBI_REGISTER); /* Not reached. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_multiboot_unload (void) +static VasEBoot_err_t +VasEBoot_multiboot_unload (void) { - grub_multiboot_free_mbi (); + VasEBoot_multiboot_free_mbi (); - grub_relocator_unload (grub_multiboot_relocator); - grub_multiboot_relocator = NULL; + VasEBoot_relocator_unload (VasEBoot_multiboot_relocator); + VasEBoot_multiboot_relocator = NULL; - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_uint64_t highest_load; +static VasEBoot_uint64_t highest_load; #define MULTIBOOT_LOAD_ELF64 #include "multiboot_elfxx.c" @@ -207,159 +207,159 @@ static grub_uint64_t highest_load; #undef MULTIBOOT_LOAD_ELF32 /* Load ELF32 or ELF64. */ -grub_err_t -grub_multiboot_load_elf (mbi_load_data_t *mld) +VasEBoot_err_t +VasEBoot_multiboot_load_elf (mbi_load_data_t *mld) { - if (grub_multiboot_is_elf32 (mld->buffer)) - return grub_multiboot_load_elf32 (mld); - else if (grub_multiboot_is_elf64 (mld->buffer)) - return grub_multiboot_load_elf64 (mld); + if (VasEBoot_multiboot_is_elf32 (mld->buffer)) + return VasEBoot_multiboot_load_elf32 (mld); + else if (VasEBoot_multiboot_is_elf64 (mld->buffer)) + return VasEBoot_multiboot_load_elf64 (mld); - return grub_error (GRUB_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); } -grub_err_t -grub_multiboot_set_console (int console_type, int accepted_consoles, +VasEBoot_err_t +VasEBoot_multiboot_set_console (int console_type, int accepted_consoles, int width, int height, int depth, int console_req) { console_required = console_req; if (!(accepted_consoles - & (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER - | (GRUB_MACHINE_HAS_VGA_TEXT ? GRUB_MULTIBOOT_CONSOLE_EGA_TEXT : 0)))) + & (VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER + | (VasEBoot_MACHINE_HAS_VGA_TEXT ? VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT : 0)))) { if (console_required) - return grub_error (GRUB_ERR_BAD_OS, + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "OS requires a console but none is available"); - grub_puts_ (N_("WARNING: no console will be available to OS")); + VasEBoot_puts_ (N_("WARNING: no console will be available to OS")); accepts_video = 0; accepts_ega_text = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (console_type == GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER) + if (console_type == VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER) { char *buf; if (depth && width && height) - buf = grub_xasprintf ("%dx%dx%d,%dx%d,auto", width, + buf = VasEBoot_xasprintf ("%dx%dx%d,%dx%d,auto", width, height, depth, width, height); else if (width && height) - buf = grub_xasprintf ("%dx%d,auto", width, height); + buf = VasEBoot_xasprintf ("%dx%d,auto", width, height); else - buf = grub_strdup ("auto"); + buf = VasEBoot_strdup ("auto"); if (!buf) - return grub_errno; - grub_env_set ("gfxpayload", buf); - grub_free (buf); + return VasEBoot_errno; + VasEBoot_env_set ("gfxpayload", buf); + VasEBoot_free (buf); } else { -#if GRUB_MACHINE_HAS_VGA_TEXT - grub_env_set ("gfxpayload", "text"); +#if VasEBoot_MACHINE_HAS_VGA_TEXT + VasEBoot_env_set ("gfxpayload", "text"); #else /* Always use video if no VGA text is available. */ - grub_env_set ("gfxpayload", "auto"); + VasEBoot_env_set ("gfxpayload", "auto"); #endif } - accepts_video = !!(accepted_consoles & GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER); - accepts_ega_text = !!(accepted_consoles & GRUB_MULTIBOOT_CONSOLE_EGA_TEXT); - return GRUB_ERR_NONE; + accepts_video = !!(accepted_consoles & VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER); + accepts_ega_text = !!(accepted_consoles & VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_multiboot (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_multiboot (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_err_t err; + VasEBoot_file_t file = 0; + VasEBoot_err_t err; - grub_loader_unset (); + VasEBoot_loader_unset (); highest_load = 0; -#ifndef GRUB_USE_MULTIBOOT2 - grub_multiboot_quirks = GRUB_MULTIBOOT_QUIRKS_NONE; +#ifndef VasEBoot_USE_MULTIBOOT2 + VasEBoot_multiboot_quirks = VasEBoot_MULTIBOOT_QUIRKS_NONE; int option_found = 0; do { option_found = 0; - if (argc != 0 && grub_strcmp (argv[0], "--quirk-bad-kludge") == 0) + if (argc != 0 && VasEBoot_strcmp (argv[0], "--quirk-bad-kludge") == 0) { argc--; argv++; option_found = 1; - grub_multiboot_quirks |= GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE; + VasEBoot_multiboot_quirks |= VasEBoot_MULTIBOOT_QUIRK_BAD_KLUDGE; } - if (argc != 0 && grub_strcmp (argv[0], "--quirk-modules-after-kernel") == 0) + if (argc != 0 && VasEBoot_strcmp (argv[0], "--quirk-modules-after-kernel") == 0) { argc--; argv++; option_found = 1; - grub_multiboot_quirks |= GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL; + VasEBoot_multiboot_quirks |= VasEBoot_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL; } } while (option_found); #endif if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); /* Skip filename. */ - grub_multiboot_init_mbi (argc - 1, argv + 1); + VasEBoot_multiboot_init_mbi (argc - 1, argv + 1); - grub_relocator_unload (grub_multiboot_relocator); - grub_multiboot_relocator = grub_relocator_new (); + VasEBoot_relocator_unload (VasEBoot_multiboot_relocator); + VasEBoot_multiboot_relocator = VasEBoot_relocator_new (); - if (!grub_multiboot_relocator) + if (!VasEBoot_multiboot_relocator) goto fail; - err = grub_multiboot_load (file, argv[0]); + err = VasEBoot_multiboot_load (file, argv[0]); if (err) goto fail; - grub_multiboot_set_bootdev (); + VasEBoot_multiboot_set_bootdev (); - grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 0); + VasEBoot_loader_set (VasEBoot_multiboot_boot, VasEBoot_multiboot_unload, 0); fail: if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_relocator_unload (grub_multiboot_relocator); - grub_multiboot_relocator = NULL; - grub_dl_unref (my_mod); + VasEBoot_relocator_unload (VasEBoot_multiboot_relocator); + VasEBoot_multiboot_relocator = NULL; + VasEBoot_dl_unref (my_mod); } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_module (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_ssize_t size; + VasEBoot_file_t file = 0; + VasEBoot_ssize_t size; void *module = NULL; - grub_addr_t target; - grub_err_t err; + VasEBoot_addr_t target; + VasEBoot_err_t err; int nounzip = 0; - grub_uint64_t lowest_addr = 0; + VasEBoot_uint64_t lowest_addr = 0; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (grub_strcmp (argv[0], "--nounzip") == 0) + if (VasEBoot_strcmp (argv[0], "--nounzip") == 0) { argv++; argc--; @@ -367,36 +367,36 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), } if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (!grub_multiboot_relocator) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (!VasEBoot_multiboot_relocator) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); if (nounzip) - grub_file_filter_disable_compression (); + VasEBoot_file_filter_disable_compression (); - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (! file) - return grub_errno; + return VasEBoot_errno; -#ifndef GRUB_USE_MULTIBOOT2 +#ifndef VasEBoot_USE_MULTIBOOT2 lowest_addr = 0x100000; - if (grub_multiboot_quirks & GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL) + if (VasEBoot_multiboot_quirks & VasEBoot_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL) lowest_addr = ALIGN_UP (highest_load + 1048576, 4096); #endif - size = grub_file_size (file); + size = VasEBoot_file_size (file); if (size) { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_multiboot_relocator, &ch, lowest_addr, (0xffffffff - size) + 1, size, MULTIBOOT_MOD_ALIGN, - GRUB_RELOCATOR_PREFERENCE_NONE, 1); + VasEBoot_RELOCATOR_PREFERENCE_NONE, 1); if (err) { - grub_file_close (file); + VasEBoot_file_close (file); return err; } module = get_virtual_current_address (ch); @@ -408,52 +408,52 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), target = 0; } - err = grub_multiboot_add_module (target, size, argc - 1, argv + 1); + err = VasEBoot_multiboot_add_module (target, size, argc - 1, argv + 1); if (err) { - grub_file_close (file); + VasEBoot_file_close (file); return err; } - if (size && grub_file_read (file, module, size) != size) + if (size && VasEBoot_file_read (file, module, size) != size) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), argv[0]); - return grub_errno; + return VasEBoot_errno; } - grub_file_close (file); - grub_tpm_measure (module, size, GRUB_BINARY_PCR, "grub_multiboot", argv[0]); - grub_print_error(); - return GRUB_ERR_NONE; + VasEBoot_file_close (file); + VasEBoot_tpm_measure (module, size, VasEBoot_BINARY_PCR, "VasEBoot_multiboot", argv[0]); + VasEBoot_print_error(); + return VasEBoot_ERR_NONE; } -static grub_command_t cmd_multiboot, cmd_module; +static VasEBoot_command_t cmd_multiboot, cmd_module; -GRUB_MOD_INIT(multiboot) +VasEBoot_MOD_INIT(multiboot) { cmd_multiboot = -#ifdef GRUB_USE_MULTIBOOT2 - grub_register_command ("multiboot2", grub_cmd_multiboot, +#ifdef VasEBoot_USE_MULTIBOOT2 + VasEBoot_register_command ("multiboot2", VasEBoot_cmd_multiboot, 0, N_("Load a multiboot 2 kernel.")); cmd_module = - grub_register_command ("module2", grub_cmd_module, + VasEBoot_register_command ("module2", VasEBoot_cmd_module, 0, N_("Load a multiboot 2 module.")); #else - grub_register_command ("multiboot", grub_cmd_multiboot, + VasEBoot_register_command ("multiboot", VasEBoot_cmd_multiboot, 0, N_("Load a multiboot kernel.")); cmd_module = - grub_register_command ("module", grub_cmd_module, + VasEBoot_register_command ("module", VasEBoot_cmd_module, 0, N_("Load a multiboot module.")); #endif my_mod = mod; } -GRUB_MOD_FINI(multiboot) +VasEBoot_MOD_FINI(multiboot) { - grub_unregister_command (cmd_multiboot); - grub_unregister_command (cmd_module); + VasEBoot_unregister_command (cmd_multiboot); + VasEBoot_unregister_command (cmd_module); } diff --git a/VasEBoot-core/loader/multiboot_elfxx.c b/VasEBoot-core/loader/multiboot_elfxx.c index 5e649ed25..2b4be72cb 100644 --- a/VasEBoot-core/loader/multiboot_elfxx.c +++ b/VasEBoot-core/loader/multiboot_elfxx.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #if defined(MULTIBOOT_LOAD_ELF32) @@ -34,7 +34,7 @@ #error "I'm confused" #endif -#include +#include #define CONCAT(a,b) CONCAT_(a, b) #define CONCAT_(a,b) a ## b @@ -43,21 +43,21 @@ /* Check if BUFFER contains ELF32 (or ELF64). */ static int -CONCAT(grub_multiboot_is_elf, XX) (void *buffer) +CONCAT(VasEBoot_multiboot_is_elf, XX) (void *buffer) { Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer; return ehdr->e_ident[EI_CLASS] == ELFCLASSXX; } -static grub_err_t -CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) +static VasEBoot_err_t +CONCAT(VasEBoot_multiboot_load_elf, XX) (mbi_load_data_t *mld) { Elf_Ehdr *ehdr = (Elf_Ehdr *) mld->buffer; char *phdr_base; - grub_err_t err; - grub_relocator_chunk_t ch; - grub_uint32_t load_offset, load_size; + VasEBoot_err_t err; + VasEBoot_relocator_chunk_t ch; + VasEBoot_uint32_t load_offset, load_size; int i; void *source; @@ -66,18 +66,18 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) || ehdr->e_ident[EI_MAG2] != ELFMAG2 || ehdr->e_ident[EI_MAG3] != ELFMAG3 || ehdr->e_ident[EI_DATA] != ELFDATA2LSB) - return grub_error(GRUB_ERR_UNKNOWN_OS, N_("invalid arch-independent ELF magic")); + return VasEBoot_error(VasEBoot_ERR_UNKNOWN_OS, N_("invalid arch-independent ELF magic")); if (ehdr->e_ident[EI_CLASS] != ELFCLASSXX || ehdr->e_machine != E_MACHINE || ehdr->e_version != EV_CURRENT) - return grub_error (GRUB_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) - return grub_error (GRUB_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); /* FIXME: Should we support program headers at strange locations? */ - if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) - return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); + if (ehdr->e_phoff + (VasEBoot_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "program header at a too high offset"); phdr_base = (char *) mld->buffer + ehdr->e_phoff; #define phdr(i) ((Elf_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) @@ -88,13 +88,13 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) for (i = 0; i < ehdr->e_phnum; i++) if (phdr(i)->p_type == PT_LOAD) { - mld->link_base_addr = grub_min (mld->link_base_addr, phdr(i)->p_paddr); - highest_load = grub_max (highest_load, phdr(i)->p_paddr + phdr(i)->p_memsz); + mld->link_base_addr = VasEBoot_min (mld->link_base_addr, phdr(i)->p_paddr); + highest_load = VasEBoot_max (highest_load, phdr(i)->p_paddr + phdr(i)->p_memsz); } #ifdef MULTIBOOT_LOAD_ELF64 if (highest_load >= 0x100000000) - return grub_error (GRUB_ERR_BAD_OS, "segment crosses 4 GiB border"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "segment crosses 4 GiB border"); #endif load_size = highest_load - mld->link_base_addr; @@ -102,32 +102,32 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) if (mld->relocatable) { if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size) - return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid min/max address and/or load size"); - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_multiboot_relocator, &ch, mld->min_addr, mld->max_addr - load_size, load_size, mld->align ? mld->align : 1, mld->preference, mld->avoid_efi_boot_services); } else - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_addr (VasEBoot_multiboot_relocator, &ch, mld->link_base_addr, load_size); if (err) { - grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); + VasEBoot_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); return err; } mld->load_base_addr = get_physical_target_address (ch); source = get_virtual_current_address (ch); - grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " + VasEBoot_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " "load_size=0x%x, relocatable=%d\n", mld->link_base_addr, mld->load_base_addr, load_size, mld->relocatable); if (mld->relocatable) - grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", + VasEBoot_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", (long) mld->align, mld->preference, mld->avoid_efi_boot_services); /* Load every loadable segment in memory. */ @@ -136,29 +136,29 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) if (phdr(i)->p_type == PT_LOAD) { - grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n", + VasEBoot_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n", i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr); load_offset = phdr(i)->p_paddr - mld->link_base_addr; if (phdr(i)->p_filesz != 0) { - if (grub_file_seek (mld->file, (grub_off_t) phdr(i)->p_offset) - == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (mld->file, (VasEBoot_off_t) phdr(i)->p_offset) + == (VasEBoot_off_t) -1) + return VasEBoot_errno; - if (grub_file_read (mld->file, (grub_uint8_t *) source + load_offset, phdr(i)->p_filesz) - != (grub_ssize_t) phdr(i)->p_filesz) + if (VasEBoot_file_read (mld->file, (VasEBoot_uint8_t *) source + load_offset, phdr(i)->p_filesz) + != (VasEBoot_ssize_t) phdr(i)->p_filesz) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), mld->filename); - return grub_errno; + return VasEBoot_errno; } } if (phdr(i)->p_filesz < phdr(i)->p_memsz) - grub_memset ((grub_uint8_t *) source + load_offset + phdr(i)->p_filesz, 0, + VasEBoot_memset ((VasEBoot_uint8_t *) source + load_offset + phdr(i)->p_filesz, 0, phdr(i)->p_memsz - phdr(i)->p_filesz); } } @@ -167,56 +167,56 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) if (phdr(i)->p_vaddr <= ehdr->e_entry && phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry) { - grub_multiboot_payload_eip = (ehdr->e_entry - phdr(i)->p_vaddr) + VasEBoot_multiboot_payload_eip = (ehdr->e_entry - phdr(i)->p_vaddr) + phdr(i)->p_paddr; #ifdef MULTIBOOT_LOAD_ELF64 # ifdef __mips /* We still in 32-bit mode. */ if ((ehdr->e_entry - phdr(i)->p_vaddr) + phdr(i)->p_paddr < 0xffffffff80000000ULL) - return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid entry point for ELF64"); # else /* We still in 32-bit mode. */ if ((ehdr->e_entry - phdr(i)->p_vaddr) + phdr(i)->p_paddr > 0xffffffff) - return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid entry point for ELF64"); # endif #endif break; } if (i == ehdr->e_phnum) - return grub_error (GRUB_ERR_BAD_OS, "entry point isn't in a segment"); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "entry point isn't in a segment"); #if defined (__i386__) || defined (__x86_64__) #elif defined (__mips) - grub_multiboot_payload_eip |= 0x80000000; + VasEBoot_multiboot_payload_eip |= 0x80000000; #else #error Please complete this #endif if (ehdr->e_shnum) { - grub_uint8_t *shdr, *shdrptr; + VasEBoot_uint8_t *shdr, *shdrptr; - shdr = grub_malloc ((grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize); + shdr = VasEBoot_malloc ((VasEBoot_uint32_t) ehdr->e_shnum * ehdr->e_shentsize); if (!shdr) - return grub_errno; + return VasEBoot_errno; - if (grub_file_seek (mld->file, ehdr->e_shoff) == (grub_off_t) -1) + if (VasEBoot_file_seek (mld->file, ehdr->e_shoff) == (VasEBoot_off_t) -1) { - grub_free (shdr); - return grub_errno; + VasEBoot_free (shdr); + return VasEBoot_errno; } - if (grub_file_read (mld->file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize) - != (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize) + if (VasEBoot_file_read (mld->file, shdr, (VasEBoot_uint32_t) ehdr->e_shnum * ehdr->e_shentsize) + != (VasEBoot_ssize_t) ehdr->e_shnum * ehdr->e_shentsize) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), mld->filename); - return grub_errno; + return VasEBoot_errno; } for (shdrptr = shdr, i = 0; i < ehdr->e_shnum; @@ -224,10 +224,10 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) { Elf_Shdr *sh = (Elf_Shdr *) shdrptr; void *src; - grub_addr_t target; + VasEBoot_addr_t target; if (mld->mbi_ver >= 2 && (sh->sh_type == SHT_REL || sh->sh_type == SHT_RELA)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ELF files with relocs are not supported yet"); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "ELF files with relocs are not supported yet"); /* This section is a loaded section, so we don't care. */ @@ -238,39 +238,39 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) if (sh->sh_size == 0) continue; - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, 0, + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_multiboot_relocator, &ch, 0, (0xffffffff - sh->sh_size) + 1, sh->sh_size, sh->sh_addralign, - GRUB_RELOCATOR_PREFERENCE_NONE, + VasEBoot_RELOCATOR_PREFERENCE_NONE, mld->avoid_efi_boot_services); if (err) { - grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i); + VasEBoot_dprintf ("multiboot_loader", "Error loading shdr %d\n", i); return err; } src = get_virtual_current_address (ch); target = get_physical_target_address (ch); - if (grub_file_seek (mld->file, sh->sh_offset) == (grub_off_t) -1) - return grub_errno; + if (VasEBoot_file_seek (mld->file, sh->sh_offset) == (VasEBoot_off_t) -1) + return VasEBoot_errno; - if (grub_file_read (mld->file, src, sh->sh_size) - != (grub_ssize_t) sh->sh_size) + if (VasEBoot_file_read (mld->file, src, sh->sh_size) + != (VasEBoot_ssize_t) sh->sh_size) { - if (!grub_errno) - grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_FILE_READ_ERROR, N_("premature end of file %s"), mld->filename); - return grub_errno; + return VasEBoot_errno; } sh->sh_addr = target; } - grub_multiboot_add_elfsyms (ehdr->e_shnum, ehdr->e_shentsize, + VasEBoot_multiboot_add_elfsyms (ehdr->e_shnum, ehdr->e_shentsize, ehdr->e_shstrndx, shdr); } #undef phdr - return grub_errno; + return VasEBoot_errno; } #undef XX diff --git a/VasEBoot-core/loader/multiboot_mbi2.c b/VasEBoot-core/loader/multiboot_mbi2.c index c62ced3dc..69789e07f 100644 --- a/VasEBoot-core/loader/multiboot_mbi2.c +++ b/VasEBoot-core/loader/multiboot_mbi2.c @@ -1,49 +1,49 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#ifdef GRUB_MACHINE_PCBIOS -#include -#include -#include +#include +#ifdef VasEBoot_MACHINE_PCBIOS +#include +#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#if defined (GRUB_MACHINE_EFI) -#include +#if defined (VasEBoot_MACHINE_EFI) +#include #endif -#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU) -#include +#if defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_MULTIBOOT) || defined (VasEBoot_MACHINE_QEMU) +#include #define HAS_VGA_TEXT 1 #else #define HAS_VGA_TEXT 0 @@ -52,27 +52,27 @@ struct module { struct module *next; - grub_addr_t start; - grub_size_t size; + VasEBoot_addr_t start; + VasEBoot_size_t size; char *cmdline; int cmdline_size; }; static struct module *modules, *modules_last; -static grub_size_t cmdline_size; -static grub_size_t total_modcmd; +static VasEBoot_size_t cmdline_size; +static VasEBoot_size_t total_modcmd; static unsigned modcnt; static char *cmdline = NULL; static int bootdev_set; -static grub_uint32_t biosdev, slice, part; -static grub_size_t elf_sec_num, elf_sec_entsize; +static VasEBoot_uint32_t biosdev, slice, part; +static VasEBoot_size_t elf_sec_num, elf_sec_entsize; static unsigned elf_sec_shstrndx; static void *elf_sections; static int keep_bs = 0; -static grub_uint32_t load_base_addr; +static VasEBoot_uint32_t load_base_addr; void -grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, +VasEBoot_multiboot_add_elfsyms (VasEBoot_size_t num, VasEBoot_size_t entsize, unsigned shndx, void *data) { elf_sec_num = num; @@ -82,14 +82,14 @@ grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, } static struct multiboot_header * -find_header (grub_properly_aligned_t *buffer, grub_ssize_t len) +find_header (VasEBoot_properly_aligned_t *buffer, VasEBoot_ssize_t len) { struct multiboot_header *header; /* Look for the multiboot header in the buffer. The header should be at least 12 bytes and aligned on a 4-byte boundary. */ for (header = (struct multiboot_header *) buffer; ((char *) header <= (char *) buffer + len - 12); - header = (struct multiboot_header *) ((grub_uint32_t *) header + MULTIBOOT_HEADER_ALIGN / 4)) + header = (struct multiboot_header *) ((VasEBoot_uint32_t *) header + MULTIBOOT_HEADER_ALIGN / 4)) { if (header->magic == MULTIBOOT_HEADER_MAGIC && !(header->magic + header->architecture @@ -100,47 +100,47 @@ find_header (grub_properly_aligned_t *buffer, grub_ssize_t len) return NULL; } -grub_err_t -grub_multiboot_load (grub_file_t file, const char *filename) +VasEBoot_err_t +VasEBoot_multiboot_load (VasEBoot_file_t file, const char *filename) { - grub_ssize_t len; + VasEBoot_ssize_t len; struct multiboot_header *header; - grub_err_t err; + VasEBoot_err_t err; struct multiboot_header_tag *tag; struct multiboot_header_tag_address *addr_tag = NULL; struct multiboot_header_tag_relocatable *rel_tag; int entry_specified = 0, efi_entry_specified = 0; - grub_addr_t entry = 0, efi_entry = 0; - grub_uint32_t console_required = 0; + VasEBoot_addr_t entry = 0, efi_entry = 0; + VasEBoot_uint32_t console_required = 0; struct multiboot_header_tag_framebuffer *fbtag = NULL; - int accepted_consoles = GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; + int accepted_consoles = VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT; mbi_load_data_t mld; mld.mbi_ver = 2; mld.relocatable = 0; - mld.buffer = grub_malloc (MULTIBOOT_SEARCH); + mld.buffer = VasEBoot_malloc (MULTIBOOT_SEARCH); if (!mld.buffer) - return grub_errno; + return VasEBoot_errno; - len = grub_file_read (file, mld.buffer, MULTIBOOT_SEARCH); + len = VasEBoot_file_read (file, mld.buffer, MULTIBOOT_SEARCH); if (len < 32) { - grub_free (mld.buffer); - return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename); + VasEBoot_free (mld.buffer); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), filename); } COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); - grub_tpm_measure ((unsigned char *)mld.buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename); - grub_print_error(); + VasEBoot_tpm_measure ((unsigned char *)mld.buffer, len, VasEBoot_BINARY_PCR, "VasEBoot_multiboot", filename); + VasEBoot_print_error(); header = find_header (mld.buffer, len); if (header == 0) { - grub_free (mld.buffer); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no multiboot header found"); + VasEBoot_free (mld.buffer); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no multiboot header found"); } COMPILE_TIME_ASSERT (MULTIBOOT_TAG_ALIGN % 4 == 0); @@ -149,7 +149,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) for (tag = (struct multiboot_header_tag *) (header + 1); tag->type != MULTIBOOT_TAG_TYPE_END; - tag = (struct multiboot_header_tag *) ((grub_uint32_t *) tag + ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) / 4)) + tag = (struct multiboot_header_tag *) ((VasEBoot_uint32_t *) tag + ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) / 4)) switch (tag->type) { case MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST: @@ -187,8 +187,8 @@ grub_multiboot_load (grub_file_t file, const char *filename) break; default: - grub_free (mld.buffer); - return grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_free (mld.buffer); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, "unsupported information tag: 0x%x", request_tag->requests[i]); } @@ -205,7 +205,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) break; case MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64: -#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) +#if defined (VasEBoot_MACHINE_EFI) && defined (__x86_64__) efi_entry_specified = 1; efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr; #endif @@ -214,7 +214,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) case MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS: if (!(((struct multiboot_header_tag_console_flags *) tag)->console_flags & MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED)) - accepted_consoles &= ~GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; + accepted_consoles &= ~VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT; if (((struct multiboot_header_tag_console_flags *) tag)->console_flags & MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED) console_required = 1; @@ -222,7 +222,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) case MULTIBOOT_HEADER_TAG_FRAMEBUFFER: fbtag = (struct multiboot_header_tag_framebuffer *) tag; - accepted_consoles |= GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER; + accepted_consoles |= VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER; break; case MULTIBOOT_HEADER_TAG_RELOCATABLE: @@ -234,24 +234,24 @@ grub_multiboot_load (grub_file_t file, const char *filename) switch (rel_tag->preference) { case MULTIBOOT_LOAD_PREFERENCE_LOW: - mld.preference = GRUB_RELOCATOR_PREFERENCE_LOW; + mld.preference = VasEBoot_RELOCATOR_PREFERENCE_LOW; break; case MULTIBOOT_LOAD_PREFERENCE_HIGH: - mld.preference = GRUB_RELOCATOR_PREFERENCE_HIGH; + mld.preference = VasEBoot_RELOCATOR_PREFERENCE_HIGH; break; default: - mld.preference = GRUB_RELOCATOR_PREFERENCE_NONE; + mld.preference = VasEBoot_RELOCATOR_PREFERENCE_NONE; } break; - /* GRUB always page-aligns modules. */ + /* VasEBoot always page-aligns modules. */ case MULTIBOOT_HEADER_TAG_MODULE_ALIGN: break; case MULTIBOOT_HEADER_TAG_EFI_BS: -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI keep_bs = 1; #endif break; @@ -259,8 +259,8 @@ grub_multiboot_load (grub_file_t file, const char *filename) default: if (! (tag->flags & MULTIBOOT_HEADER_TAG_OPTIONAL)) { - grub_free (mld.buffer); - return grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_free (mld.buffer); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, "unsupported tag: 0x%x", tag->type); } break; @@ -268,23 +268,23 @@ grub_multiboot_load (grub_file_t file, const char *filename) if (addr_tag && !entry_specified && !(keep_bs && efi_entry_specified)) { - grub_free (mld.buffer); - return grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_free (mld.buffer); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, "load address tag without entry address tag"); } if (addr_tag) { - grub_uint64_t load_addr = (addr_tag->load_addr + 1) + VasEBoot_uint64_t load_addr = (addr_tag->load_addr + 1) ? addr_tag->load_addr : (addr_tag->header_addr - ((char *) header - (char *) mld.buffer)); int offset = ((char *) header - (char *) mld.buffer - (addr_tag->header_addr - load_addr)); int load_size = ((addr_tag->load_end_addr == 0) ? file->size - offset : addr_tag->load_end_addr - addr_tag->load_addr); - grub_size_t code_size; + VasEBoot_size_t code_size; void *source; - grub_relocator_chunk_t ch; + VasEBoot_relocator_chunk_t ch; if (addr_tag->bss_end_addr) code_size = (addr_tag->bss_end_addr - load_addr); @@ -295,51 +295,51 @@ grub_multiboot_load (grub_file_t file, const char *filename) { if (code_size > mld.max_addr || mld.min_addr > mld.max_addr - code_size) { - grub_free (mld.buffer); - return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + VasEBoot_free (mld.buffer); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "invalid min/max address and/or load size"); } - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_multiboot_relocator, &ch, mld.min_addr, mld.max_addr - code_size, code_size, mld.align ? mld.align : 1, mld.preference, keep_bs); } else - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, + err = VasEBoot_relocator_alloc_chunk_addr (VasEBoot_multiboot_relocator, &ch, load_addr, code_size); if (err) { - grub_dprintf ("multiboot_loader", "Error loading aout kludge\n"); - grub_free (mld.buffer); + VasEBoot_dprintf ("multiboot_loader", "Error loading aout kludge\n"); + VasEBoot_free (mld.buffer); return err; } mld.link_base_addr = load_addr; mld.load_base_addr = get_physical_target_address (ch); source = get_virtual_current_address (ch); - grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " + VasEBoot_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " "load_size=0x%lx, relocatable=%d\n", mld.link_base_addr, mld.load_base_addr, (long) code_size, mld.relocatable); if (mld.relocatable) - grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", + VasEBoot_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", (long) mld.align, mld.preference, keep_bs); - if ((grub_file_seek (file, offset)) == (grub_off_t) -1) + if ((VasEBoot_file_seek (file, offset)) == (VasEBoot_off_t) -1) { - grub_free (mld.buffer); - return grub_errno; + VasEBoot_free (mld.buffer); + return VasEBoot_errno; } - grub_file_read (file, source, load_size); - if (grub_errno) + VasEBoot_file_read (file, source, load_size); + if (VasEBoot_errno) { - grub_free (mld.buffer); - return grub_errno; + VasEBoot_free (mld.buffer); + return VasEBoot_errno; } if (addr_tag->bss_end_addr) - grub_memset ((grub_uint8_t *) source + load_size, 0, + VasEBoot_memset ((VasEBoot_uint8_t *) source + load_size, 0, addr_tag->bss_end_addr - load_addr - load_size); } else @@ -347,10 +347,10 @@ grub_multiboot_load (grub_file_t file, const char *filename) mld.file = file; mld.filename = filename; mld.avoid_efi_boot_services = keep_bs; - err = grub_multiboot_load_elf (&mld); + err = VasEBoot_multiboot_load_elf (&mld); if (err) { - grub_free (mld.buffer); + VasEBoot_free (mld.buffer); return err; } } @@ -358,9 +358,9 @@ grub_multiboot_load (grub_file_t file, const char *filename) load_base_addr = mld.load_base_addr; if (keep_bs && efi_entry_specified) - grub_multiboot_payload_eip = efi_entry; + VasEBoot_multiboot_payload_eip = efi_entry; else if (entry_specified) - grub_multiboot_payload_eip = entry; + VasEBoot_multiboot_payload_eip = entry; if (mld.relocatable) { @@ -374,28 +374,28 @@ grub_multiboot_load (grub_file_t file, const char *filename) * 64-bit int here. */ if (mld.load_base_addr >= mld.link_base_addr) - grub_multiboot_payload_eip += mld.load_base_addr - mld.link_base_addr; + VasEBoot_multiboot_payload_eip += mld.load_base_addr - mld.link_base_addr; else - grub_multiboot_payload_eip -= mld.link_base_addr - mld.load_base_addr; + VasEBoot_multiboot_payload_eip -= mld.link_base_addr - mld.load_base_addr; } if (fbtag) - err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, + err = VasEBoot_multiboot_set_console (VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER, accepted_consoles, fbtag->width, fbtag->height, fbtag->depth, console_required); else - err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_EGA_TEXT, + err = VasEBoot_multiboot_set_console (VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT, accepted_consoles, 0, 0, 0, console_required); return err; } -static grub_size_t +static VasEBoot_size_t acpiv2_size (void) { -#if GRUB_MACHINE_HAS_ACPI - struct grub_acpi_rsdp_v20 *p = grub_acpi_get_rsdpv2 (); +#if VasEBoot_MACHINE_HAS_ACPI + struct VasEBoot_acpi_rsdp_v20 *p = VasEBoot_acpi_get_rsdpv2 (); if (!p) return 0; @@ -407,9 +407,9 @@ acpiv2_size (void) #endif } -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI -static grub_efi_uintn_t efi_mmap_size = 0; +static VasEBoot_efi_uintn_t efi_mmap_size = 0; /* Find the optimal number of pages for the memory map. Is it better to move this code to efi/mm.c? */ @@ -420,16 +420,16 @@ find_efi_mmap_size (void) while (1) { int ret; - grub_efi_memory_descriptor_t *mmap; - grub_efi_uintn_t desc_size; - grub_efi_uintn_t cur_mmap_size = efi_mmap_size; + VasEBoot_efi_memory_descriptor_t *mmap; + VasEBoot_efi_uintn_t desc_size; + VasEBoot_efi_uintn_t cur_mmap_size = efi_mmap_size; - mmap = grub_malloc (cur_mmap_size); + mmap = VasEBoot_malloc (cur_mmap_size); if (! mmap) return; - ret = grub_efi_get_memory_map (&cur_mmap_size, mmap, 0, &desc_size, 0); - grub_free (mmap); + ret = VasEBoot_efi_get_memory_map (&cur_mmap_size, mmap, 0, &desc_size, 0); + VasEBoot_free (mmap); if (ret < 0) return; @@ -441,7 +441,7 @@ find_efi_mmap_size (void) efi_mmap_size += (1 << 12); } - /* Increase the size a bit for safety, because GRUB allocates more on + /* Increase the size a bit for safety, because VasEBoot allocates more on later, and EFI itself may allocate more. */ efi_mmap_size += (3 << 12); @@ -449,11 +449,11 @@ find_efi_mmap_size (void) } #endif -static grub_size_t +static VasEBoot_size_t net_size (void) { - struct grub_net_network_level_interface *net; - grub_size_t ret = 0; + struct VasEBoot_net_network_level_interface *net; + VasEBoot_size_t ret = 0; FOR_NET_NETWORK_LEVEL_INTERFACES(net) if (net->dhcp_ack) @@ -462,14 +462,14 @@ net_size (void) return ret; } -static grub_size_t -grub_multiboot_get_mbi_size (void) +static VasEBoot_size_t +VasEBoot_multiboot_get_mbi_size (void) { -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI if (!keep_bs && !efi_mmap_size) find_efi_mmap_size (); #endif - return 2 * sizeof (grub_uint32_t) + sizeof (struct multiboot_tag) + return 2 * sizeof (VasEBoot_uint32_t) + sizeof (struct multiboot_tag) + sizeof (struct multiboot_tag) + (sizeof (struct multiboot_tag_string) + ALIGN_UP (cmdline_size, MULTIBOOT_TAG_ALIGN)) @@ -482,15 +482,15 @@ grub_multiboot_get_mbi_size (void) + ALIGN_UP (sizeof (struct multiboot_tag_elf_sections), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (elf_sec_entsize * elf_sec_num, MULTIBOOT_TAG_ALIGN) + ALIGN_UP ((sizeof (struct multiboot_tag_mmap) - + grub_get_multiboot_mmap_count () + + VasEBoot_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry)), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_old_acpi) - + sizeof (struct grub_acpi_rsdp_v10), MULTIBOOT_TAG_ALIGN) + + sizeof (struct VasEBoot_acpi_rsdp_v10), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_load_base_addr), MULTIBOOT_TAG_ALIGN) + acpiv2_size () + net_size () -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI + ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_efi32_ih), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN) @@ -502,10 +502,10 @@ grub_multiboot_get_mbi_size (void) + sizeof (struct multiboot_tag_apm) + MULTIBOOT_TAG_ALIGN - 1; } -/* Helper for grub_fill_multiboot_mmap. */ +/* Helper for VasEBoot_fill_multiboot_mmap. */ static int -grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, void *data) +VasEBoot_fill_multiboot_mmap_iter (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { struct multiboot_mmap_entry **mmap_entry = data; @@ -520,60 +520,60 @@ grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size, /* Fill previously allocated Multiboot mmap. */ static void -grub_fill_multiboot_mmap (struct multiboot_tag_mmap *tag) +VasEBoot_fill_multiboot_mmap (struct multiboot_tag_mmap *tag) { struct multiboot_mmap_entry *mmap_entry = tag->entries; tag->type = MULTIBOOT_TAG_TYPE_MMAP; tag->size = sizeof (struct multiboot_tag_mmap) - + sizeof (struct multiboot_mmap_entry) * grub_get_multiboot_mmap_count (); + + sizeof (struct multiboot_mmap_entry) * VasEBoot_get_multiboot_mmap_count (); tag->entry_size = sizeof (struct multiboot_mmap_entry); tag->entry_version = 0; - grub_mmap_iterate (grub_fill_multiboot_mmap_iter, &mmap_entry); + VasEBoot_mmap_iterate (VasEBoot_fill_multiboot_mmap_iter, &mmap_entry); } -#if defined (GRUB_MACHINE_PCBIOS) +#if defined (VasEBoot_MACHINE_PCBIOS) static void fill_vbe_tag (struct multiboot_tag_vbe *tag) { - grub_vbe_status_t status; - void *scratch = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_vbe_status_t status; + void *scratch = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; tag->type = MULTIBOOT_TAG_TYPE_VBE; tag->size = 0; - status = grub_vbe_bios_get_controller_info (scratch); - if (status != GRUB_VBE_STATUS_OK) + status = VasEBoot_vbe_bios_get_controller_info (scratch); + if (status != VasEBoot_VBE_STATUS_OK) return; - grub_memcpy (&tag->vbe_control_info, scratch, - sizeof (struct grub_vbe_info_block)); + VasEBoot_memcpy (&tag->vbe_control_info, scratch, + sizeof (struct VasEBoot_vbe_info_block)); - status = grub_vbe_bios_get_mode (scratch); - tag->vbe_mode = *(grub_uint32_t *) scratch; - if (status != GRUB_VBE_STATUS_OK) + status = VasEBoot_vbe_bios_get_mode (scratch); + tag->vbe_mode = *(VasEBoot_uint32_t *) scratch; + if (status != VasEBoot_VBE_STATUS_OK) return; /* get_mode_info isn't available for mode 3. */ if (tag->vbe_mode == 3) { - struct grub_vbe_mode_info_block *mode_info = (void *) &tag->vbe_mode_info; - grub_memset (mode_info, 0, - sizeof (struct grub_vbe_mode_info_block)); - mode_info->memory_model = GRUB_VBE_MEMORY_MODEL_TEXT; + struct VasEBoot_vbe_mode_info_block *mode_info = (void *) &tag->vbe_mode_info; + VasEBoot_memset (mode_info, 0, + sizeof (struct VasEBoot_vbe_mode_info_block)); + mode_info->memory_model = VasEBoot_VBE_MEMORY_MODEL_TEXT; mode_info->x_resolution = 80; mode_info->y_resolution = 25; } else { - status = grub_vbe_bios_get_mode_info (tag->vbe_mode, scratch); - if (status != GRUB_VBE_STATUS_OK) + status = VasEBoot_vbe_bios_get_mode_info (tag->vbe_mode, scratch); + if (status != VasEBoot_VBE_STATUS_OK) return; - grub_memcpy (&tag->vbe_mode_info, scratch, - sizeof (struct grub_vbe_mode_info_block)); + VasEBoot_memcpy (&tag->vbe_mode_info, scratch, + sizeof (struct VasEBoot_vbe_mode_info_block)); } - grub_vbe_bios_get_pm_interface (&tag->vbe_interface_seg, + VasEBoot_vbe_bios_get_pm_interface (&tag->vbe_interface_seg, &tag->vbe_interface_off, &tag->vbe_interface_len); @@ -581,41 +581,41 @@ fill_vbe_tag (struct multiboot_tag_vbe *tag) } #endif -static grub_err_t -retrieve_video_parameters (grub_properly_aligned_t **ptrorig) +static VasEBoot_err_t +retrieve_video_parameters (VasEBoot_properly_aligned_t **ptrorig) { - grub_err_t err; - struct grub_video_mode_info mode_info; + VasEBoot_err_t err; + struct VasEBoot_video_mode_info mode_info; void *framebuffer; - grub_video_driver_id_t driv_id; - struct grub_video_palette_data palette[256]; + VasEBoot_video_driver_id_t driv_id; + struct VasEBoot_video_palette_data palette[256]; struct multiboot_tag_framebuffer *tag = (struct multiboot_tag_framebuffer *) *ptrorig; - err = grub_multiboot_set_video_mode (); + err = VasEBoot_multiboot_set_video_mode (); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_video_get_palette (0, ARRAY_SIZE (palette), palette); + VasEBoot_video_get_palette (0, ARRAY_SIZE (palette), palette); - driv_id = grub_video_get_driver_id (); + driv_id = VasEBoot_video_get_driver_id (); #if HAS_VGA_TEXT - if (driv_id == GRUB_VIDEO_DRIVER_NONE) + if (driv_id == VasEBoot_VIDEO_DRIVER_NONE) { - struct grub_vbe_mode_info_block vbe_mode_info; - grub_uint32_t vbe_mode; + struct VasEBoot_vbe_mode_info_block vbe_mode_info; + VasEBoot_uint32_t vbe_mode; -#if defined (GRUB_MACHINE_PCBIOS) +#if defined (VasEBoot_MACHINE_PCBIOS) { - grub_vbe_status_t status; - void *scratch = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - status = grub_vbe_bios_get_mode (scratch); - vbe_mode = *(grub_uint32_t *) scratch; - if (status != GRUB_VBE_STATUS_OK) - return GRUB_ERR_NONE; + VasEBoot_vbe_status_t status; + void *scratch = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + status = VasEBoot_vbe_bios_get_mode (scratch); + vbe_mode = *(VasEBoot_uint32_t *) scratch; + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_ERR_NONE; } #else vbe_mode = 3; @@ -624,26 +624,26 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) /* get_mode_info isn't available for mode 3. */ if (vbe_mode == 3) { - grub_memset (&vbe_mode_info, 0, - sizeof (struct grub_vbe_mode_info_block)); - vbe_mode_info.memory_model = GRUB_VBE_MEMORY_MODEL_TEXT; + VasEBoot_memset (&vbe_mode_info, 0, + sizeof (struct VasEBoot_vbe_mode_info_block)); + vbe_mode_info.memory_model = VasEBoot_VBE_MEMORY_MODEL_TEXT; vbe_mode_info.x_resolution = 80; vbe_mode_info.y_resolution = 25; } -#if defined (GRUB_MACHINE_PCBIOS) +#if defined (VasEBoot_MACHINE_PCBIOS) else { - grub_vbe_status_t status; - void *scratch = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - status = grub_vbe_bios_get_mode_info (vbe_mode, scratch); - if (status != GRUB_VBE_STATUS_OK) - return GRUB_ERR_NONE; - grub_memcpy (&vbe_mode_info, scratch, - sizeof (struct grub_vbe_mode_info_block)); + VasEBoot_vbe_status_t status; + void *scratch = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + status = VasEBoot_vbe_bios_get_mode_info (vbe_mode, scratch); + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_ERR_NONE; + VasEBoot_memcpy (&vbe_mode_info, scratch, + sizeof (struct VasEBoot_vbe_mode_info_block)); } #endif - if (vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) + if (vbe_mode_info.memory_model == VasEBoot_VBE_MEMORY_MODEL_TEXT) { tag = (struct multiboot_tag_framebuffer *) *ptrorig; tag->common.type = MULTIBOOT_TAG_TYPE_FRAMEBUFFER; @@ -661,27 +661,27 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) tag->common.size = sizeof (tag->common); tag->common.reserved = 0; *ptrorig += ALIGN_UP (tag->common.size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #else - if (driv_id == GRUB_VIDEO_DRIVER_NONE) - return GRUB_ERR_NONE; + if (driv_id == VasEBoot_VIDEO_DRIVER_NONE) + return VasEBoot_ERR_NONE; #endif -#if GRUB_MACHINE_HAS_VBE +#if VasEBoot_MACHINE_HAS_VBE { struct multiboot_tag_vbe *tag_vbe = (struct multiboot_tag_vbe *) *ptrorig; fill_vbe_tag (tag_vbe); *ptrorig += ALIGN_UP (tag_vbe->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } #endif - err = grub_video_get_info_and_fini (&mode_info, &framebuffer); + err = VasEBoot_video_get_info_and_fini (&mode_info, &framebuffer); if (err) return err; @@ -689,7 +689,7 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) tag->common.type = MULTIBOOT_TAG_TYPE_FRAMEBUFFER; tag->common.size = 0; - tag->common.framebuffer_addr = (grub_addr_t) framebuffer; + tag->common.framebuffer_addr = (VasEBoot_addr_t) framebuffer; tag->common.framebuffer_pitch = mode_info.pitch; tag->common.framebuffer_width = mode_info.width; @@ -699,7 +699,7 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) tag->common.reserved = 0; - if (mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) { unsigned i; tag->common.framebuffer_type = MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED; @@ -729,28 +729,28 @@ retrieve_video_parameters (grub_properly_aligned_t **ptrorig) tag->common.size = sizeof (struct multiboot_tag_framebuffer_common) + 6; } *ptrorig += ALIGN_UP (tag->common.size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_multiboot_make_mbi (grub_uint32_t *target) +VasEBoot_err_t +VasEBoot_multiboot_make_mbi (VasEBoot_uint32_t *target) { - grub_properly_aligned_t *ptrorig; - grub_properly_aligned_t *mbistart; - grub_err_t err; - grub_size_t bufsize; - grub_relocator_chunk_t ch; + VasEBoot_properly_aligned_t *ptrorig; + VasEBoot_properly_aligned_t *mbistart; + VasEBoot_err_t err; + VasEBoot_size_t bufsize; + VasEBoot_relocator_chunk_t ch; - bufsize = grub_multiboot_get_mbi_size (); + bufsize = VasEBoot_multiboot_get_mbi_size (); - COMPILE_TIME_ASSERT (MULTIBOOT_TAG_ALIGN % sizeof (grub_properly_aligned_t) == 0); + COMPILE_TIME_ASSERT (MULTIBOOT_TAG_ALIGN % sizeof (VasEBoot_properly_aligned_t) == 0); - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_multiboot_relocator, &ch, 0, 0xffffffff - bufsize, bufsize, MULTIBOOT_TAG_ALIGN, - GRUB_RELOCATOR_PREFERENCE_NONE, 1); + VasEBoot_RELOCATOR_PREFERENCE_NONE, 1); if (err) return err; @@ -764,11 +764,11 @@ grub_multiboot_make_mbi (grub_uint32_t *target) #endif mbistart = ptrorig; - COMPILE_TIME_ASSERT ((2 * sizeof (grub_uint32_t)) - % sizeof (grub_properly_aligned_t) == 0); + COMPILE_TIME_ASSERT ((2 * sizeof (VasEBoot_uint32_t)) + % sizeof (VasEBoot_properly_aligned_t) == 0); COMPILE_TIME_ASSERT (MULTIBOOT_TAG_ALIGN - % sizeof (grub_properly_aligned_t) == 0); - ptrorig += (2 * sizeof (grub_uint32_t)) / sizeof (grub_properly_aligned_t); + % sizeof (VasEBoot_properly_aligned_t) == 0); + ptrorig += (2 * sizeof (VasEBoot_uint32_t)) / sizeof (VasEBoot_properly_aligned_t); { struct multiboot_tag_load_base_addr *tag = (struct multiboot_tag_load_base_addr *) ptrorig; @@ -776,31 +776,31 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->size = sizeof (struct multiboot_tag_load_base_addr); tag->load_base_addr = load_base_addr; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } { struct multiboot_tag_string *tag = (struct multiboot_tag_string *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_CMDLINE; tag->size = sizeof (struct multiboot_tag_string) + cmdline_size; - grub_memcpy (tag->string, cmdline, cmdline_size); + VasEBoot_memcpy (tag->string, cmdline, cmdline_size); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } { struct multiboot_tag_string *tag = (struct multiboot_tag_string *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME; tag->size = sizeof (struct multiboot_tag_string) + sizeof (PACKAGE_STRING); - grub_memcpy (tag->string, PACKAGE_STRING, sizeof (PACKAGE_STRING)); + VasEBoot_memcpy (tag->string, PACKAGE_STRING, sizeof (PACKAGE_STRING)); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS { - struct grub_apm_info info; - if (grub_apm_get_info (&info)) + struct VasEBoot_apm_info info; + if (VasEBoot_apm_get_info (&info)) { struct multiboot_tag_apm *tag = (struct multiboot_tag_apm *) ptrorig; @@ -818,7 +818,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->version = info.version; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } } #endif @@ -835,18 +835,18 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->size = sizeof (struct multiboot_tag_module) + cur->cmdline_size; tag->mod_start = cur->start; tag->mod_end = tag->mod_start + cur->size; - grub_memcpy (tag->cmdline, cur->cmdline, cur->cmdline_size); + VasEBoot_memcpy (tag->cmdline, cur->cmdline, cur->cmdline_size); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } } if (!keep_bs) { struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig; - grub_fill_multiboot_mmap (tag); + VasEBoot_fill_multiboot_mmap (tag); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } { @@ -855,12 +855,12 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->type = MULTIBOOT_TAG_TYPE_ELF_SECTIONS; tag->size = sizeof (struct multiboot_tag_elf_sections) + elf_sec_entsize * elf_sec_num; - grub_memcpy (tag->sections, elf_sections, elf_sec_entsize * elf_sec_num); + VasEBoot_memcpy (tag->sections, elf_sections, elf_sec_entsize * elf_sec_num); tag->num = elf_sec_num; tag->entsize = elf_sec_entsize; tag->shndx = elf_sec_shstrndx; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } if (!keep_bs) @@ -871,14 +871,14 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->size = sizeof (struct multiboot_tag_basic_meminfo); /* Convert from bytes to kilobytes. */ - tag->mem_lower = grub_mmap_get_lower () / 1024; - tag->mem_upper = grub_mmap_get_upper () / 1024; + tag->mem_lower = VasEBoot_mmap_get_lower () / 1024; + tag->mem_upper = VasEBoot_mmap_get_upper () / 1024; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } { - struct grub_net_network_level_interface *net; + struct VasEBoot_net_network_level_interface *net; FOR_NET_NETWORK_LEVEL_INTERFACES(net) if (net->dhcp_ack) @@ -887,9 +887,9 @@ grub_multiboot_make_mbi (grub_uint32_t *target) = (struct multiboot_tag_network *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_NETWORK; tag->size = sizeof (struct multiboot_tag_network) + net->dhcp_acklen; - grub_memcpy (tag->dhcpack, net->dhcp_ack, net->dhcp_acklen); + VasEBoot_memcpy (tag->dhcpack, net->dhcp_ack, net->dhcp_acklen); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } } @@ -904,82 +904,82 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->slice = slice; tag->part = part; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } { err = retrieve_video_parameters (&ptrorig); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } } -#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) +#if defined (VasEBoot_MACHINE_EFI) && defined (__x86_64__) { struct multiboot_tag_efi64 *tag = (struct multiboot_tag_efi64 *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_EFI64; tag->size = sizeof (*tag); - tag->pointer = (grub_addr_t) grub_efi_system_table; + tag->pointer = (VasEBoot_addr_t) VasEBoot_efi_system_table; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } #endif -#if defined (GRUB_MACHINE_EFI) && defined (__i386__) +#if defined (VasEBoot_MACHINE_EFI) && defined (__i386__) { struct multiboot_tag_efi32 *tag = (struct multiboot_tag_efi32 *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_EFI32; tag->size = sizeof (*tag); - tag->pointer = (grub_addr_t) grub_efi_system_table; + tag->pointer = (VasEBoot_addr_t) VasEBoot_efi_system_table; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } #endif -#if GRUB_MACHINE_HAS_ACPI +#if VasEBoot_MACHINE_HAS_ACPI { struct multiboot_tag_old_acpi *tag = (struct multiboot_tag_old_acpi *) ptrorig; - struct grub_acpi_rsdp_v10 *a = grub_acpi_get_rsdpv1 (); + struct VasEBoot_acpi_rsdp_v10 *a = VasEBoot_acpi_get_rsdpv1 (); if (a) { tag->type = MULTIBOOT_TAG_TYPE_ACPI_OLD; tag->size = sizeof (*tag) + sizeof (*a); - grub_memcpy (tag->rsdp, a, sizeof (*a)); + VasEBoot_memcpy (tag->rsdp, a, sizeof (*a)); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } } { struct multiboot_tag_new_acpi *tag = (struct multiboot_tag_new_acpi *) ptrorig; - struct grub_acpi_rsdp_v20 *a = grub_acpi_get_rsdpv2 (); + struct VasEBoot_acpi_rsdp_v20 *a = VasEBoot_acpi_get_rsdpv2 (); if (a) { tag->type = MULTIBOOT_TAG_TYPE_ACPI_NEW; tag->size = sizeof (*tag) + a->length; - grub_memcpy (tag->rsdp, a, a->length); + VasEBoot_memcpy (tag->rsdp, a, a->length); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } } #endif -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI { struct multiboot_tag_efi_mmap *tag = (struct multiboot_tag_efi_mmap *) ptrorig; - grub_efi_uintn_t efi_desc_size; - grub_efi_uint32_t efi_desc_version; + VasEBoot_efi_uintn_t efi_desc_size; + VasEBoot_efi_uint32_t efi_desc_version; if (!keep_bs) { tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP; tag->size = sizeof (*tag) + efi_mmap_size; - err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL, + err = VasEBoot_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL, &efi_desc_size, &efi_desc_version); if (err) @@ -990,7 +990,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->size = sizeof (*tag) + efi_mmap_size; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } } @@ -1001,7 +1001,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->type = MULTIBOOT_TAG_TYPE_EFI_BS; tag->size = sizeof (struct multiboot_tag); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } #ifdef __i386__ @@ -1009,9 +1009,9 @@ grub_multiboot_make_mbi (grub_uint32_t *target) struct multiboot_tag_efi32_ih *tag = (struct multiboot_tag_efi32_ih *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_EFI32_IH; tag->size = sizeof (struct multiboot_tag_efi32_ih); - tag->pointer = (grub_addr_t) grub_efi_image_handle; + tag->pointer = (VasEBoot_addr_t) VasEBoot_efi_image_handle; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } #endif @@ -1020,9 +1020,9 @@ grub_multiboot_make_mbi (grub_uint32_t *target) struct multiboot_tag_efi64_ih *tag = (struct multiboot_tag_efi64_ih *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_EFI64_IH; tag->size = sizeof (struct multiboot_tag_efi64_ih); - tag->pointer = (grub_addr_t) grub_efi_image_handle; + tag->pointer = (VasEBoot_addr_t) VasEBoot_efi_image_handle; ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } #endif } @@ -1033,82 +1033,82 @@ grub_multiboot_make_mbi (grub_uint32_t *target) tag->type = MULTIBOOT_TAG_TYPE_END; tag->size = sizeof (struct multiboot_tag); ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + / sizeof (VasEBoot_properly_aligned_t); } - ((grub_uint32_t *) mbistart)[0] = (char *) ptrorig - (char *) mbistart; - ((grub_uint32_t *) mbistart)[1] = 0; + ((VasEBoot_uint32_t *) mbistart)[0] = (char *) ptrorig - (char *) mbistart; + ((VasEBoot_uint32_t *) mbistart)[1] = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_multiboot_free_mbi (void) +VasEBoot_multiboot_free_mbi (void) { struct module *cur, *next; cmdline_size = 0; total_modcmd = 0; modcnt = 0; - grub_free (cmdline); + VasEBoot_free (cmdline); cmdline = NULL; bootdev_set = 0; for (cur = modules; cur; cur = next) { next = cur->next; - grub_free (cur->cmdline); - grub_free (cur); + VasEBoot_free (cur->cmdline); + VasEBoot_free (cur); } modules = NULL; modules_last = NULL; } -grub_err_t -grub_multiboot_init_mbi (int argc, char *argv[]) +VasEBoot_err_t +VasEBoot_multiboot_init_mbi (int argc, char *argv[]) { - grub_ssize_t len = 0; + VasEBoot_ssize_t len = 0; - grub_multiboot_free_mbi (); + VasEBoot_multiboot_free_mbi (); - len = grub_loader_cmdline_size (argc, argv); + len = VasEBoot_loader_cmdline_size (argc, argv); - cmdline = grub_malloc (len); + cmdline = VasEBoot_malloc (len); if (! cmdline) - return grub_errno; + return VasEBoot_errno; cmdline_size = len; - grub_create_loader_cmdline (argc, argv, cmdline, + VasEBoot_create_loader_cmdline (argc, argv, cmdline, cmdline_size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_multiboot_add_module (grub_addr_t start, grub_size_t size, +VasEBoot_err_t +VasEBoot_multiboot_add_module (VasEBoot_addr_t start, VasEBoot_size_t size, int argc, char *argv[]) { struct module *newmod; - grub_size_t len = 0; + VasEBoot_size_t len = 0; - newmod = grub_malloc (sizeof (*newmod)); + newmod = VasEBoot_malloc (sizeof (*newmod)); if (!newmod) - return grub_errno; + return VasEBoot_errno; newmod->start = start; newmod->size = size; - len = grub_loader_cmdline_size (argc, argv); + len = VasEBoot_loader_cmdline_size (argc, argv); - newmod->cmdline = grub_malloc (len); + newmod->cmdline = VasEBoot_malloc (len); if (! newmod->cmdline) { - grub_free (newmod); - return grub_errno; + VasEBoot_free (newmod); + return VasEBoot_errno; } newmod->cmdline_size = len; total_modcmd += ALIGN_UP (len, MULTIBOOT_TAG_ALIGN); - grub_create_loader_cmdline (argc, argv, newmod->cmdline, + VasEBoot_create_loader_cmdline (argc, argv, newmod->cmdline, newmod->cmdline_size); if (modules_last) @@ -1119,19 +1119,19 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, modcnt++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_multiboot_set_bootdev (void) +VasEBoot_multiboot_set_bootdev (void) { - grub_device_t dev; + VasEBoot_device_t dev; slice = ~0; part = ~0; -#ifdef GRUB_MACHINE_PCBIOS - biosdev = grub_get_root_biosnumber (); +#ifdef VasEBoot_MACHINE_PCBIOS + biosdev = VasEBoot_get_root_biosnumber (); #else biosdev = 0xffffffff; #endif @@ -1139,7 +1139,7 @@ grub_multiboot_set_bootdev (void) if (biosdev == 0xffffffff) return; - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (dev && dev->disk && dev->disk->partition) { if (dev->disk->partition->parent) @@ -1151,7 +1151,7 @@ grub_multiboot_set_bootdev (void) slice = dev->disk->partition->number; } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); bootdev_set = 1; } diff --git a/VasEBoot-core/loader/powerpc/ieee1275/linux.c b/VasEBoot-core/loader/powerpc/ieee1275/linux.c index 6e814649f..cde09c239 100644 --- a/VasEBoot-core/loader/powerpc/ieee1275/linux.c +++ b/VasEBoot-core/loader/powerpc/ieee1275/linux.c @@ -1,202 +1,202 @@ /* linux.c - boot Linux */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define ELF32_LOADMASK (0xc0000000UL) #define ELF64_LOADMASK (0xc000000000000000ULL) -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; -static grub_addr_t initrd_addr; -static grub_size_t initrd_size; +static VasEBoot_addr_t initrd_addr; +static VasEBoot_size_t initrd_size; -static grub_addr_t linux_addr; -static grub_addr_t linux_entry; -static grub_size_t linux_size; +static VasEBoot_addr_t linux_addr; +static VasEBoot_addr_t linux_entry; +static VasEBoot_size_t linux_size; static char *linux_args; typedef void (*kernel_entry_t) (void *, unsigned long, int (void *), unsigned long, unsigned long); -/* Context for grub_linux_claimmap_iterate. */ -struct grub_linux_claimmap_iterate_ctx +/* Context for VasEBoot_linux_claimmap_iterate. */ +struct VasEBoot_linux_claimmap_iterate_ctx { - grub_addr_t target; - grub_size_t size; - grub_size_t align; - grub_addr_t found_addr; + VasEBoot_addr_t target; + VasEBoot_size_t size; + VasEBoot_size_t align; + VasEBoot_addr_t found_addr; }; -/* Helper for grub_linux_claimmap_iterate. */ +/* Helper for VasEBoot_linux_claimmap_iterate. */ static int -alloc_mem (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, +alloc_mem (VasEBoot_uint64_t addr, VasEBoot_uint64_t len, VasEBoot_memory_type_t type, void *data) { - struct grub_linux_claimmap_iterate_ctx *ctx = data; + struct VasEBoot_linux_claimmap_iterate_ctx *ctx = data; - grub_uint64_t end = addr + len; + VasEBoot_uint64_t end = addr + len; addr = ALIGN_UP (addr, ctx->align); ctx->target = ALIGN_UP (ctx->target, ctx->align); /* Target above the memory chunk. */ - if (type != GRUB_MEMORY_AVAILABLE || ctx->target > end) + if (type != VasEBoot_MEMORY_AVAILABLE || ctx->target > end) return 0; /* Target inside the memory chunk. */ if (ctx->target >= addr && ctx->target < end && ctx->size <= end - ctx->target) { - if (grub_claimmap (ctx->target, ctx->size) == GRUB_ERR_NONE) + if (VasEBoot_claimmap (ctx->target, ctx->size) == VasEBoot_ERR_NONE) { ctx->found_addr = ctx->target; return 1; } - grub_print_error (); + VasEBoot_print_error (); } /* Target below the memory chunk. */ if (ctx->target < addr && addr + ctx->size <= end) { - if (grub_claimmap (addr, ctx->size) == GRUB_ERR_NONE) + if (VasEBoot_claimmap (addr, ctx->size) == VasEBoot_ERR_NONE) { ctx->found_addr = addr; return 1; } - grub_print_error (); + VasEBoot_print_error (); } return 0; } -static grub_addr_t -grub_linux_claimmap_iterate (grub_addr_t target, grub_size_t size, - grub_size_t align) +static VasEBoot_addr_t +VasEBoot_linux_claimmap_iterate (VasEBoot_addr_t target, VasEBoot_size_t size, + VasEBoot_size_t align) { - struct grub_linux_claimmap_iterate_ctx ctx = { + struct VasEBoot_linux_claimmap_iterate_ctx ctx = { .target = target, .size = size, .align = align, - .found_addr = (grub_addr_t) -1 + .found_addr = (VasEBoot_addr_t) -1 }; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_FORCE_CLAIM)) { - grub_uint64_t addr = target; - if (addr < GRUB_IEEE1275_STATIC_HEAP_START - + GRUB_IEEE1275_STATIC_HEAP_LEN) - addr = GRUB_IEEE1275_STATIC_HEAP_START - + GRUB_IEEE1275_STATIC_HEAP_LEN; + VasEBoot_uint64_t addr = target; + if (addr < VasEBoot_IEEE1275_STATIC_HEAP_START + + VasEBoot_IEEE1275_STATIC_HEAP_LEN) + addr = VasEBoot_IEEE1275_STATIC_HEAP_START + + VasEBoot_IEEE1275_STATIC_HEAP_LEN; addr = ALIGN_UP (addr, align); - if (grub_claimmap (addr, size) == GRUB_ERR_NONE) + if (VasEBoot_claimmap (addr, size) == VasEBoot_ERR_NONE) return addr; - return (grub_addr_t) -1; + return (VasEBoot_addr_t) -1; } - grub_machine_mmap_iterate (alloc_mem, &ctx); + VasEBoot_machine_mmap_iterate (alloc_mem, &ctx); return ctx.found_addr; } -static grub_err_t -grub_linux_boot (void) +static VasEBoot_err_t +VasEBoot_linux_boot (void) { kernel_entry_t linuxmain; - grub_ssize_t actual; + VasEBoot_ssize_t actual; - grub_arch_sync_caches ((void *) linux_addr, linux_size); + VasEBoot_arch_sync_caches ((void *) linux_addr, linux_size); /* Set the command line arguments. */ - grub_ieee1275_set_property (grub_ieee1275_chosen, "bootargs", linux_args, - grub_strlen (linux_args) + 1, &actual); + VasEBoot_ieee1275_set_property (VasEBoot_ieee1275_chosen, "bootargs", linux_args, + VasEBoot_strlen (linux_args) + 1, &actual); - grub_dprintf ("loader", "Entry point: 0x%x\n", linux_entry); - grub_dprintf ("loader", "Initrd at: 0x%x, size 0x%x\n", initrd_addr, + VasEBoot_dprintf ("loader", "Entry point: 0x%x\n", linux_entry); + VasEBoot_dprintf ("loader", "Initrd at: 0x%x, size 0x%x\n", initrd_addr, initrd_size); - grub_dprintf ("loader", "Boot arguments: %s\n", linux_args); - grub_dprintf ("loader", "Jumping to Linux...\n"); + VasEBoot_dprintf ("loader", "Boot arguments: %s\n", linux_args); + VasEBoot_dprintf ("loader", "Jumping to Linux...\n"); /* Boot the kernel. */ linuxmain = (kernel_entry_t) linux_entry; - linuxmain ((void *) initrd_addr, initrd_size, grub_ieee1275_entry_fn, 0, 0); + linuxmain ((void *) initrd_addr, initrd_size, VasEBoot_ieee1275_entry_fn, 0, 0); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_release_mem (void) +static VasEBoot_err_t +VasEBoot_linux_release_mem (void) { - grub_free (linux_args); + VasEBoot_free (linux_args); linux_args = 0; - if (linux_addr && grub_ieee1275_release (linux_addr, linux_size)) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot release memory"); + if (linux_addr && VasEBoot_ieee1275_release (linux_addr, linux_size)) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot release memory"); - if (initrd_addr && grub_ieee1275_release (initrd_addr, initrd_size)) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot release memory"); + if (initrd_addr && VasEBoot_ieee1275_release (initrd_addr, initrd_size)) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "cannot release memory"); linux_addr = 0; initrd_addr = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_linux_release_mem (); - grub_dl_unref (my_mod); + err = VasEBoot_linux_release_mem (); + VasEBoot_dl_unref (my_mod); loaded = 0; return err; } -static grub_err_t -grub_linux_load32 (grub_elf_t elf, const char *filename) +static VasEBoot_err_t +VasEBoot_linux_load32 (VasEBoot_elf_t elf, const char *filename) { Elf32_Addr base_addr; - grub_addr_t seg_addr; - grub_uint32_t align; - grub_uint32_t offset; + VasEBoot_addr_t seg_addr; + VasEBoot_uint32_t align; + VasEBoot_uint32_t offset; Elf32_Addr entry; - linux_size = grub_elf32_size (elf, &base_addr, &align); + linux_size = VasEBoot_elf32_size (elf, &base_addr, &align); if (linux_size == 0) - return grub_errno; + return VasEBoot_errno; /* Pad it; the kernel scribbles over memory beyond its load address. */ linux_size += 0x100000; @@ -210,29 +210,29 @@ grub_linux_load32 (grub_elf_t elf, const char *filename) /* On some systems, firmware occupies the memory we're trying to use. * Happily, Linux can be loaded anywhere (it relocates itself). Iterate * until we find an open area. */ - seg_addr = grub_linux_claimmap_iterate (base_addr & ~ELF32_LOADMASK, linux_size, align); - if (seg_addr == (grub_addr_t) -1) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't claim memory"); + seg_addr = VasEBoot_linux_claimmap_iterate (base_addr & ~ELF32_LOADMASK, linux_size, align); + if (seg_addr == (VasEBoot_addr_t) -1) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't claim memory"); linux_entry = seg_addr + offset; linux_addr = seg_addr; /* Now load the segments into the area we claimed. */ - return grub_elf32_load (elf, filename, (void *) (seg_addr - base_addr), GRUB_ELF_LOAD_FLAGS_30BITS, 0, 0); + return VasEBoot_elf32_load (elf, filename, (void *) (seg_addr - base_addr), VasEBoot_ELF_LOAD_FLAGS_30BITS, 0, 0); } -static grub_err_t -grub_linux_load64 (grub_elf_t elf, const char *filename) +static VasEBoot_err_t +VasEBoot_linux_load64 (VasEBoot_elf_t elf, const char *filename) { Elf64_Addr base_addr; - grub_addr_t seg_addr; - grub_uint64_t align; - grub_uint64_t offset; + VasEBoot_addr_t seg_addr; + VasEBoot_uint64_t align; + VasEBoot_uint64_t offset; Elf64_Addr entry; - linux_size = grub_elf64_size (elf, &base_addr, &align); + linux_size = VasEBoot_elf64_size (elf, &base_addr, &align); if (linux_size == 0) - return grub_errno; + return VasEBoot_errno; /* Pad it; the kernel scribbles over memory beyond its load address. */ linux_size += 0x100000; @@ -244,149 +244,149 @@ grub_linux_load64 (grub_elf_t elf, const char *filename) /* On some systems, firmware occupies the memory we're trying to use. * Happily, Linux can be loaded anywhere (it relocates itself). Iterate * until we find an open area. */ - seg_addr = grub_linux_claimmap_iterate (base_addr & ~ELF64_LOADMASK, linux_size, align); - if (seg_addr == (grub_addr_t) -1) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't claim memory"); + seg_addr = VasEBoot_linux_claimmap_iterate (base_addr & ~ELF64_LOADMASK, linux_size, align); + if (seg_addr == (VasEBoot_addr_t) -1) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't claim memory"); linux_entry = seg_addr + offset; linux_addr = seg_addr; /* Now load the segments into the area we claimed. */ - return grub_elf64_load (elf, filename, (void *) (grub_addr_t) (seg_addr - base_addr), GRUB_ELF_LOAD_FLAGS_62BITS, 0, 0); + return VasEBoot_elf64_load (elf, filename, (void *) (VasEBoot_addr_t) (seg_addr - base_addr), VasEBoot_ELF_LOAD_FLAGS_62BITS, 0, 0); } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_elf_t elf = 0; + VasEBoot_elf_t elf = 0; int size; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto out; } - elf = grub_elf_open (argv[0]); + elf = VasEBoot_elf_open (argv[0]); if (! elf) goto out; if (elf->ehdr.ehdr32.e_type != ET_EXEC && elf->ehdr.ehdr32.e_type != ET_DYN) { - grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); goto out; } /* Release the previously used memory. */ - grub_loader_unset (); + VasEBoot_loader_unset (); - if (grub_elf_is_elf32 (elf)) - grub_linux_load32 (elf, argv[0]); + if (VasEBoot_elf_is_elf32 (elf)) + VasEBoot_linux_load32 (elf, argv[0]); else - if (grub_elf_is_elf64 (elf)) - grub_linux_load64 (elf, argv[0]); + if (VasEBoot_elf_is_elf64 (elf)) + VasEBoot_linux_load64 (elf, argv[0]); else { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("invalid arch-dependent ELF magic")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("invalid arch-dependent ELF magic")); goto out; } - size = grub_loader_cmdline_size(argc, argv); - linux_args = grub_malloc (size + sizeof (LINUX_IMAGE)); + size = VasEBoot_loader_cmdline_size(argc, argv); + linux_args = VasEBoot_malloc (size + sizeof (LINUX_IMAGE)); if (! linux_args) goto out; /* Create kernel command line. */ - grub_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, + VasEBoot_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, size); out: if (elf) - grub_elf_close (elf); + VasEBoot_elf_close (elf); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_linux_release_mem (); - grub_dl_unref (my_mod); + VasEBoot_linux_release_mem (); + VasEBoot_dl_unref (my_mod); loaded = 0; } else { - grub_loader_set (grub_linux_boot, grub_linux_unload, 1); + VasEBoot_loader_set (VasEBoot_linux_boot, VasEBoot_linux_unload, 1); initrd_addr = 0; loaded = 1; } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0; - grub_addr_t first_addr; - grub_addr_t addr; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + VasEBoot_size_t size = 0; + VasEBoot_addr_t first_addr; + VasEBoot_addr_t addr; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); first_addr = linux_addr + linux_size; /* Attempt to claim at a series of addresses until successful in - the same way that grub_rescue_cmd_linux does. */ - addr = grub_linux_claimmap_iterate (first_addr, size, 0x100000); - if (addr == (grub_addr_t) -1) + the same way that VasEBoot_rescue_cmd_linux does. */ + addr = VasEBoot_linux_claimmap_iterate (first_addr, size, 0x100000); + if (addr == (VasEBoot_addr_t) -1) goto fail; - grub_dprintf ("loader", "Loading initrd at 0x%x, size 0x%x\n", addr, size); + VasEBoot_dprintf ("loader", "Loading initrd at 0x%x, size 0x%x\n", addr, size); - if (grub_initrd_load (&initrd_ctx, argv, (void *) addr)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, (void *) addr)) goto fail; initrd_addr = addr; initrd_size = size; fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linux) +VasEBoot_MOD_INIT(linux) { - cmd_linux = grub_register_command ("linux", grub_cmd_linux, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI(linux) +VasEBoot_MOD_FINI(linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/sparc64/ieee1275/linux.c b/VasEBoot-core/loader/sparc64/ieee1275/linux.c index 67ef04883..3c58de8bc 100644 --- a/VasEBoot-core/loader/sparc64/ieee1275/linux.c +++ b/VasEBoot-core/loader/sparc64/ieee1275/linux.c @@ -1,63 +1,63 @@ /* linux.c - boot Linux */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; static int loaded; /* /virtual-memory/translations property layout */ -struct grub_ieee1275_translation { - grub_uint64_t vaddr; - grub_uint64_t size; - grub_uint64_t data; +struct VasEBoot_ieee1275_translation { + VasEBoot_uint64_t vaddr; + VasEBoot_uint64_t size; + VasEBoot_uint64_t data; }; -static struct grub_ieee1275_translation *of_trans; +static struct VasEBoot_ieee1275_translation *of_trans; static int of_num_trans; -static grub_addr_t phys_base; -static grub_addr_t grub_phys_start; -static grub_addr_t grub_phys_end; +static VasEBoot_addr_t phys_base; +static VasEBoot_addr_t VasEBoot_phys_start; +static VasEBoot_addr_t VasEBoot_phys_end; -static grub_addr_t initrd_addr; -static grub_addr_t initrd_paddr; -static grub_size_t initrd_size; +static VasEBoot_addr_t initrd_addr; +static VasEBoot_addr_t initrd_paddr; +static VasEBoot_size_t initrd_size; static Elf64_Addr linux_entry; -static grub_addr_t linux_addr; -static grub_addr_t linux_paddr; -static grub_size_t linux_size; +static VasEBoot_addr_t linux_addr; +static VasEBoot_addr_t linux_paddr; +static VasEBoot_size_t linux_size; static char *linux_args; @@ -88,18 +88,18 @@ struct linux_hdrs { unsigned long ramdisk_image; }; -static grub_err_t -grub_linux_boot (void) +static VasEBoot_err_t +VasEBoot_linux_boot (void) { struct linux_bootstr_info *bp; struct linux_hdrs *hp; - grub_addr_t addr; + VasEBoot_addr_t addr; hp = (struct linux_hdrs *) linux_addr; /* Any pointer we dereference in the kernel image must be relocated to where we actually loaded the kernel. */ - addr = (grub_addr_t) hp->bootstr_info; + addr = (VasEBoot_addr_t) hp->bootstr_info; addr += (linux_addr - linux_entry); bp = (struct linux_bootstr_info *) addr; @@ -107,10 +107,10 @@ grub_linux_boot (void) built with a fixed CONFIG_CMDLINE. */ if (!bp->valid) { - int len = grub_strlen (linux_args) + 1; + int len = VasEBoot_strlen (linux_args) + 1; if (bp->len < len) len = bp->len; - grub_memcpy(bp->buf, linux_args, len); + VasEBoot_memcpy(bp->buf, linux_args, len); bp->buf[len-1] = '\0'; bp->valid = 1; } @@ -133,11 +133,11 @@ grub_linux_boot (void) hp->ramdisk_size = initrd_size; } - grub_dprintf ("loader", "Entry point: 0x%lx\n", linux_addr); - grub_dprintf ("loader", "Initrd at: 0x%lx, size 0x%lx\n", initrd_addr, + VasEBoot_dprintf ("loader", "Entry point: 0x%lx\n", linux_addr); + VasEBoot_dprintf ("loader", "Initrd at: 0x%lx, size 0x%lx\n", initrd_addr, initrd_size); - grub_dprintf ("loader", "Boot arguments: %s\n", linux_args); - grub_dprintf ("loader", "Jumping to Linux...\n"); + VasEBoot_dprintf ("loader", "Boot arguments: %s\n", linux_args); + VasEBoot_dprintf ("loader", "Jumping to Linux...\n"); /* Boot the kernel. */ asm volatile ("ldx %0, %%o4\n" @@ -148,31 +148,31 @@ grub_linux_boot (void) "mov %%g0, %%o3\n" "jmp %%o5\n" "mov %%g0, %%o1\n": : - "m"(grub_ieee1275_entry_fn), - "m"(grub_ieee1275_original_stack), + "m"(VasEBoot_ieee1275_entry_fn), + "m"(VasEBoot_ieee1275_original_stack), "m"(linux_addr)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_release_mem (void) +static VasEBoot_err_t +VasEBoot_linux_release_mem (void) { - grub_free (linux_args); + VasEBoot_free (linux_args); linux_args = 0; linux_addr = 0; initrd_addr = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_linux_unload (void) +static VasEBoot_err_t +VasEBoot_linux_unload (void) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_linux_release_mem (); - grub_dl_unref (my_mod); + err = VasEBoot_linux_release_mem (); + VasEBoot_dl_unref (my_mod); loaded = 0; @@ -184,42 +184,42 @@ grub_linux_unload (void) /* Context for alloc_phys. */ struct alloc_phys_ctx { - grub_addr_t size; - grub_addr_t ret; + VasEBoot_addr_t size; + VasEBoot_addr_t ret; }; /* Helper for alloc_phys. */ static int -alloc_phys_choose (grub_uint64_t addr, grub_uint64_t len, - grub_memory_type_t type, void *data) +alloc_phys_choose (VasEBoot_uint64_t addr, VasEBoot_uint64_t len, + VasEBoot_memory_type_t type, void *data) { struct alloc_phys_ctx *ctx = data; - grub_addr_t end = addr + len; + VasEBoot_addr_t end = addr + len; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; addr = ALIGN_UP (addr, FOUR_MB); if (addr + ctx->size >= end) return 0; - /* OBP available region contains grub. Start at grub_phys_end. */ - /* grub_phys_start does not start at the beginning of the memory region */ - if ((grub_phys_start >= addr && grub_phys_end < end) || - (addr > grub_phys_start && addr < grub_phys_end)) + /* OBP available region contains VasEBoot. Start at VasEBoot_phys_end. */ + /* VasEBoot_phys_start does not start at the beginning of the memory region */ + if ((VasEBoot_phys_start >= addr && VasEBoot_phys_end < end) || + (addr > VasEBoot_phys_start && addr < VasEBoot_phys_end)) { - addr = ALIGN_UP (grub_phys_end, FOUR_MB); + addr = ALIGN_UP (VasEBoot_phys_end, FOUR_MB); if (addr + ctx->size >= end) return 0; } - grub_dprintf("loader", - "addr = 0x%lx grub_phys_start = 0x%lx grub_phys_end = 0x%lx\n", - addr, grub_phys_start, grub_phys_end); + VasEBoot_dprintf("loader", + "addr = 0x%lx VasEBoot_phys_start = 0x%lx VasEBoot_phys_end = 0x%lx\n", + addr, VasEBoot_phys_start, VasEBoot_phys_end); if (loaded) { - grub_addr_t linux_end = ALIGN_UP (linux_paddr + linux_size, FOUR_MB); + VasEBoot_addr_t linux_end = ALIGN_UP (linux_paddr + linux_size, FOUR_MB); if (addr >= linux_paddr && addr < linux_end) { @@ -240,46 +240,46 @@ alloc_phys_choose (grub_uint64_t addr, grub_uint64_t len, return 1; } -static grub_addr_t -alloc_phys (grub_addr_t size) +static VasEBoot_addr_t +alloc_phys (VasEBoot_addr_t size) { struct alloc_phys_ctx ctx = { .size = size, - .ret = (grub_addr_t) -1 + .ret = (VasEBoot_addr_t) -1 }; - grub_machine_mmap_iterate (alloc_phys_choose, &ctx); + VasEBoot_machine_mmap_iterate (alloc_phys_choose, &ctx); return ctx.ret; } -static grub_err_t -grub_linux_load64 (grub_elf_t elf, const char *filename) +static VasEBoot_err_t +VasEBoot_linux_load64 (VasEBoot_elf_t elf, const char *filename) { - grub_addr_t off, paddr, base; + VasEBoot_addr_t off, paddr, base; int ret; linux_entry = elf->ehdr.ehdr64.e_entry; linux_addr = 0x40004000; off = 0x4000; - linux_size = grub_elf64_size (elf, 0, 0); + linux_size = VasEBoot_elf64_size (elf, 0, 0); if (linux_size == 0) - return grub_errno; + return VasEBoot_errno; - grub_dprintf ("loader", "Attempting to claim at 0x%lx, size 0x%lx.\n", + VasEBoot_dprintf ("loader", "Attempting to claim at 0x%lx, size 0x%lx.\n", linux_addr, linux_size); paddr = alloc_phys (linux_size + off); - if (paddr == (grub_addr_t) -1) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + if (paddr == (VasEBoot_addr_t) -1) + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't allocate physical memory"); - ret = grub_ieee1275_map (paddr, linux_addr - off, + ret = VasEBoot_ieee1275_map (paddr, linux_addr - off, linux_size + off, IEEE1275_MAP_DEFAULT); if (ret) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't map physical memory"); - grub_dprintf ("loader", "Loading Linux at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n", + VasEBoot_dprintf ("loader", "Loading Linux at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n", linux_addr, paddr, linux_size); linux_paddr = paddr; @@ -287,132 +287,132 @@ grub_linux_load64 (grub_elf_t elf, const char *filename) base = linux_entry - off; /* Now load the segments into the area we claimed. */ - return grub_elf64_load (elf, filename, (void *) (linux_addr - off - base), GRUB_ELF_LOAD_FLAGS_NONE, 0, 0); + return VasEBoot_elf64_load (elf, filename, (void *) (linux_addr - off - base), VasEBoot_ELF_LOAD_FLAGS_NONE, 0, 0); } -static grub_err_t -grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_linux (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_file_t file = 0; - grub_elf_t elf = 0; + VasEBoot_file_t file = 0; + VasEBoot_elf_t elf = 0; int size; - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto out; } - file = grub_file_open (argv[0]); + file = VasEBoot_file_open (argv[0]); if (!file) goto out; - elf = grub_elf_file (file, argv[0]); + elf = VasEBoot_elf_file (file, argv[0]); if (! elf) goto out; if (elf->ehdr.ehdr32.e_type != ET_EXEC) { - grub_error (GRUB_ERR_UNKNOWN_OS, + VasEBoot_error (VasEBoot_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); goto out; } /* Release the previously used memory. */ - grub_loader_unset (); + VasEBoot_loader_unset (); - if (grub_elf_is_elf64 (elf)) - grub_linux_load64 (elf, argv[0]); + if (VasEBoot_elf_is_elf64 (elf)) + VasEBoot_linux_load64 (elf, argv[0]); else { - grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("invalid arch-dependent ELF magic")); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, N_("invalid arch-dependent ELF magic")); goto out; } - size = grub_loader_cmdline_size(argc, argv); + size = VasEBoot_loader_cmdline_size(argc, argv); - linux_args = grub_malloc (size + sizeof (LINUX_IMAGE)); + linux_args = VasEBoot_malloc (size + sizeof (LINUX_IMAGE)); if (! linux_args) goto out; /* Create kernel command line. */ - grub_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); - grub_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, + VasEBoot_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE)); + VasEBoot_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, size); out: if (elf) - grub_elf_close (elf); + VasEBoot_elf_close (elf); else if (file) - grub_file_close (file); + VasEBoot_file_close (file); - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_linux_release_mem (); - grub_dl_unref (my_mod); + VasEBoot_linux_release_mem (); + VasEBoot_dl_unref (my_mod); loaded = 0; } else { - grub_loader_set (grub_linux_boot, grub_linux_unload, 1); + VasEBoot_loader_set (VasEBoot_linux_boot, VasEBoot_linux_unload, 1); initrd_addr = 0; loaded = 1; } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_initrd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0; - grub_addr_t paddr; - grub_addr_t addr; + VasEBoot_size_t size = 0; + VasEBoot_addr_t paddr; + VasEBoot_addr_t addr; int ret; - struct grub_linux_initrd_context initrd_ctx = { 0, 0, 0 }; + struct VasEBoot_linux_initrd_context initrd_ctx = { 0, 0, 0 }; if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); goto fail; } if (!loaded) { - grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); + VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (grub_initrd_init (argc, argv, &initrd_ctx)) + if (VasEBoot_initrd_init (argc, argv, &initrd_ctx)) goto fail; - size = grub_get_initrd_size (&initrd_ctx); + size = VasEBoot_get_initrd_size (&initrd_ctx); addr = 0x60000000; paddr = alloc_phys (size); - if (paddr == (grub_addr_t) -1) + if (paddr == (VasEBoot_addr_t) -1) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't allocate physical memory"); goto fail; } - ret = grub_ieee1275_map (paddr, addr, size, IEEE1275_MAP_DEFAULT); + ret = VasEBoot_ieee1275_map (paddr, addr, size, IEEE1275_MAP_DEFAULT); if (ret) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "couldn't map physical memory"); goto fail; } - grub_dprintf ("loader", "Loading initrd at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n", + VasEBoot_dprintf ("loader", "Loading initrd at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n", addr, paddr, size); - if (grub_initrd_load (&initrd_ctx, argv, (void *) addr)) + if (VasEBoot_initrd_load (&initrd_ctx, argv, (void *) addr)) goto fail; initrd_addr = addr; @@ -420,17 +420,17 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), initrd_size = size; fail: - grub_initrd_close (&initrd_ctx); + VasEBoot_initrd_close (&initrd_ctx); - return grub_errno; + return VasEBoot_errno; } /* Helper for determine_phys_base. */ static int -get_physbase (grub_uint64_t addr, grub_uint64_t len __attribute__ ((unused)), - grub_memory_type_t type, void *data __attribute__ ((unused))) +get_physbase (VasEBoot_uint64_t addr, VasEBoot_uint64_t len __attribute__ ((unused)), + VasEBoot_memory_type_t type, void *data __attribute__ ((unused))) { - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; if (addr < phys_base) phys_base = addr; @@ -440,81 +440,81 @@ get_physbase (grub_uint64_t addr, grub_uint64_t len __attribute__ ((unused)), static void determine_phys_base (void) { - phys_base = ~(grub_uint64_t) 0; - grub_machine_mmap_iterate (get_physbase, NULL); + phys_base = ~(VasEBoot_uint64_t) 0; + VasEBoot_machine_mmap_iterate (get_physbase, NULL); } static void fetch_translations (void) { - grub_ieee1275_phandle_t node; - grub_ssize_t actual; + VasEBoot_ieee1275_phandle_t node; + VasEBoot_ssize_t actual; int i; - if (grub_ieee1275_finddevice ("/virtual-memory", &node)) + if (VasEBoot_ieee1275_finddevice ("/virtual-memory", &node)) { - grub_printf ("Cannot find /virtual-memory node.\n"); + VasEBoot_printf ("Cannot find /virtual-memory node.\n"); return; } - if (grub_ieee1275_get_property_length (node, "translations", &actual)) + if (VasEBoot_ieee1275_get_property_length (node, "translations", &actual)) { - grub_printf ("Cannot find /virtual-memory/translations size.\n"); + VasEBoot_printf ("Cannot find /virtual-memory/translations size.\n"); return; } - of_trans = grub_malloc (actual); + of_trans = VasEBoot_malloc (actual); if (!of_trans) { - grub_printf ("Cannot allocate translations buffer.\n"); + VasEBoot_printf ("Cannot allocate translations buffer.\n"); return; } - if (grub_ieee1275_get_property (node, "translations", of_trans, actual, &actual)) + if (VasEBoot_ieee1275_get_property (node, "translations", of_trans, actual, &actual)) { - grub_printf ("Cannot fetch /virtual-memory/translations property.\n"); + VasEBoot_printf ("Cannot fetch /virtual-memory/translations property.\n"); return; } - of_num_trans = actual / sizeof(struct grub_ieee1275_translation); + of_num_trans = actual / sizeof(struct VasEBoot_ieee1275_translation); for (i = 0; i < of_num_trans; i++) { - struct grub_ieee1275_translation *p = &of_trans[i]; + struct VasEBoot_ieee1275_translation *p = &of_trans[i]; if (p->vaddr == 0x2000) { - grub_addr_t phys, tte = p->data; + VasEBoot_addr_t phys, tte = p->data; phys = tte & ~(0xff00000000001fffULL); - grub_phys_start = phys; - grub_phys_end = grub_phys_start + p->size; - grub_dprintf ("loader", "Grub lives at phys_start[%lx] phys_end[%lx]\n", - (unsigned long) grub_phys_start, - (unsigned long) grub_phys_end); + VasEBoot_phys_start = phys; + VasEBoot_phys_end = VasEBoot_phys_start + p->size; + VasEBoot_dprintf ("loader", "VasEBoot lives at phys_start[%lx] phys_end[%lx]\n", + (unsigned long) VasEBoot_phys_start, + (unsigned long) VasEBoot_phys_end); break; } } } -static grub_command_t cmd_linux, cmd_initrd; +static VasEBoot_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linux) +VasEBoot_MOD_INIT(linux) { determine_phys_base (); fetch_translations (); - cmd_linux = grub_register_command ("linux", grub_cmd_linux, + cmd_linux = VasEBoot_register_command ("linux", VasEBoot_cmd_linux, 0, N_("Load Linux.")); - cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + cmd_initrd = VasEBoot_register_command ("initrd", VasEBoot_cmd_initrd, 0, N_("Load initrd.")); my_mod = mod; } -GRUB_MOD_FINI(linux) +VasEBoot_MOD_FINI(linux) { - grub_unregister_command (cmd_linux); - grub_unregister_command (cmd_initrd); + VasEBoot_unregister_command (cmd_linux); + VasEBoot_unregister_command (cmd_initrd); } diff --git a/VasEBoot-core/loader/xnu.c b/VasEBoot-core/loader/xnu.c index c9885b1bc..dcecf9313 100644 --- a/VasEBoot-core/loader/xnu.c +++ b/VasEBoot-core/loader/xnu.c @@ -2,121 +2,121 @@ time he spent testing this */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#if defined (__i386) && !defined (GRUB_MACHINE_EFI) -#include +#if defined (__i386) && !defined (VasEBoot_MACHINE_EFI) +#include #endif -struct grub_xnu_devtree_key *grub_xnu_devtree_root = 0; +struct VasEBoot_xnu_devtree_key *VasEBoot_xnu_devtree_root = 0; static int driverspackagenum = 0; static int driversnum = 0; -int grub_xnu_is_64bit = 0; -int grub_xnu_darwin_version = 0; +int VasEBoot_xnu_is_64bit = 0; +int VasEBoot_xnu_darwin_version = 0; -grub_addr_t grub_xnu_heap_target_start = 0; -grub_size_t grub_xnu_heap_size = 0; -struct grub_relocator *grub_xnu_relocator; +VasEBoot_addr_t VasEBoot_xnu_heap_target_start = 0; +VasEBoot_size_t VasEBoot_xnu_heap_size = 0; +struct VasEBoot_relocator *VasEBoot_xnu_relocator; -static grub_err_t -grub_xnu_register_memory (const char *prefix, int *suffix, - grub_addr_t addr, grub_size_t size); -grub_err_t -grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target) +static VasEBoot_err_t +VasEBoot_xnu_register_memory (const char *prefix, int *suffix, + VasEBoot_addr_t addr, VasEBoot_size_t size); +VasEBoot_err_t +VasEBoot_xnu_heap_malloc (int size, void **src, VasEBoot_addr_t *target) { - grub_err_t err; - grub_relocator_chunk_t ch; + VasEBoot_err_t err; + VasEBoot_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (grub_xnu_relocator, &ch, - grub_xnu_heap_target_start - + grub_xnu_heap_size, size); + err = VasEBoot_relocator_alloc_chunk_addr (VasEBoot_xnu_relocator, &ch, + VasEBoot_xnu_heap_target_start + + VasEBoot_xnu_heap_size, size); if (err) return err; *src = get_virtual_current_address (ch); - *target = grub_xnu_heap_target_start + grub_xnu_heap_size; - grub_xnu_heap_size += size; - grub_dprintf ("xnu", "val=%p\n", *src); - return GRUB_ERR_NONE; + *target = VasEBoot_xnu_heap_target_start + VasEBoot_xnu_heap_size; + VasEBoot_xnu_heap_size += size; + VasEBoot_dprintf ("xnu", "val=%p\n", *src); + return VasEBoot_ERR_NONE; } /* Make sure next block of the heap will be aligned. Please notice: aligned are pointers AFTER relocation and not the current ones. */ -grub_err_t -grub_xnu_align_heap (int align) +VasEBoot_err_t +VasEBoot_xnu_align_heap (int align) { - grub_xnu_heap_size - = ALIGN_UP (grub_xnu_heap_target_start+ grub_xnu_heap_size, align) - - grub_xnu_heap_target_start; - return GRUB_ERR_NONE; + VasEBoot_xnu_heap_size + = ALIGN_UP (VasEBoot_xnu_heap_target_start+ VasEBoot_xnu_heap_size, align) + - VasEBoot_xnu_heap_target_start; + return VasEBoot_ERR_NONE; } /* Free subtree pointed by CUR. */ void -grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur) +VasEBoot_xnu_free_devtree (struct VasEBoot_xnu_devtree_key *cur) { - struct grub_xnu_devtree_key *d; + struct VasEBoot_xnu_devtree_key *d; while (cur) { - grub_free (cur->name); + VasEBoot_free (cur->name); if (cur->datasize == -1) - grub_xnu_free_devtree (cur->first_child); + VasEBoot_xnu_free_devtree (cur->first_child); else if (cur->data) - grub_free (cur->data); + VasEBoot_free (cur->data); d = cur->next; - grub_free (cur); + VasEBoot_free (cur); cur = d; } } /* Compute the size of device tree in xnu format. */ -static grub_size_t -grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, +static VasEBoot_size_t +VasEBoot_xnu_writetree_get_size (struct VasEBoot_xnu_devtree_key *start, const char *name) { - grub_size_t ret; - struct grub_xnu_devtree_key *cur; + VasEBoot_size_t ret; + struct VasEBoot_xnu_devtree_key *cur; /* Key header. */ - ret = 2 * sizeof (grub_uint32_t); + ret = 2 * sizeof (VasEBoot_uint32_t); /* "name" value. */ - ret += 32 + sizeof (grub_uint32_t) - + grub_strlen (name) + 4 - - (grub_strlen (name) % 4); + ret += 32 + sizeof (VasEBoot_uint32_t) + + VasEBoot_strlen (name) + 4 + - (VasEBoot_strlen (name) % 4); for (cur = start; cur; cur = cur->next) if (cur->datasize != -1) @@ -126,20 +126,20 @@ grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, align_overhead = 4 - (cur->datasize % 4); if (align_overhead == 4) align_overhead = 0; - ret += 32 + sizeof (grub_uint32_t) + cur->datasize + align_overhead; + ret += 32 + sizeof (VasEBoot_uint32_t) + cur->datasize + align_overhead; } else - ret += grub_xnu_writetree_get_size (cur->first_child, cur->name); + ret += VasEBoot_xnu_writetree_get_size (cur->first_child, cur->name); return ret; } /* Write devtree in XNU format at curptr assuming the head is named NAME.*/ static void * -grub_xnu_writetree_toheap_real (void *curptr, - struct grub_xnu_devtree_key *start, +VasEBoot_xnu_writetree_toheap_real (void *curptr, + struct VasEBoot_xnu_devtree_key *start, const char *name) { - struct grub_xnu_devtree_key *cur; + struct VasEBoot_xnu_devtree_key *cur; int nkeys = 0, nvals = 0; for (cur = start; cur; cur = cur->next) { @@ -151,21 +151,21 @@ grub_xnu_writetree_toheap_real (void *curptr, /* For the name. */ nvals++; - *((grub_uint32_t *) curptr) = nvals; - curptr = ((grub_uint32_t *) curptr) + 1; - *((grub_uint32_t *) curptr) = nkeys; - curptr = ((grub_uint32_t *) curptr) + 1; + *((VasEBoot_uint32_t *) curptr) = nvals; + curptr = ((VasEBoot_uint32_t *) curptr) + 1; + *((VasEBoot_uint32_t *) curptr) = nkeys; + curptr = ((VasEBoot_uint32_t *) curptr) + 1; /* First comes "name" value. */ - grub_memset (curptr, 0, 32); - grub_memcpy (curptr, "name", 4); - curptr = ((grub_uint8_t *) curptr) + 32; - *((grub_uint32_t *)curptr) = grub_strlen (name) + 1; - curptr = ((grub_uint32_t *) curptr) + 1; - grub_memcpy (curptr, name, grub_strlen (name)); - curptr = ((grub_uint8_t *) curptr) + grub_strlen (name); - grub_memset (curptr, 0, 4 - (grub_strlen (name) % 4)); - curptr = ((grub_uint8_t *) curptr) + (4 - (grub_strlen (name) % 4)); + VasEBoot_memset (curptr, 0, 32); + VasEBoot_memcpy (curptr, "name", 4); + curptr = ((VasEBoot_uint8_t *) curptr) + 32; + *((VasEBoot_uint32_t *)curptr) = VasEBoot_strlen (name) + 1; + curptr = ((VasEBoot_uint32_t *) curptr) + 1; + VasEBoot_memcpy (curptr, name, VasEBoot_strlen (name)); + curptr = ((VasEBoot_uint8_t *) curptr) + VasEBoot_strlen (name); + VasEBoot_memset (curptr, 0, 4 - (VasEBoot_strlen (name) % 4)); + curptr = ((VasEBoot_uint8_t *) curptr) + (4 - (VasEBoot_strlen (name) % 4)); /* Then the other values. */ for (cur = start; cur; cur = cur->next) @@ -176,22 +176,22 @@ grub_xnu_writetree_toheap_real (void *curptr, align_overhead = 4 - (cur->datasize % 4); if (align_overhead == 4) align_overhead = 0; - grub_memset (curptr, 0, 32); - grub_strncpy (curptr, cur->name, 31); - curptr = ((grub_uint8_t *) curptr) + 32; - *((grub_uint32_t *) curptr) = cur->datasize; - curptr = ((grub_uint32_t *) curptr) + 1; - grub_memcpy (curptr, cur->data, cur->datasize); - curptr = ((grub_uint8_t *) curptr) + cur->datasize; - grub_memset (curptr, 0, align_overhead); - curptr = ((grub_uint8_t *) curptr) + align_overhead; + VasEBoot_memset (curptr, 0, 32); + VasEBoot_strncpy (curptr, cur->name, 31); + curptr = ((VasEBoot_uint8_t *) curptr) + 32; + *((VasEBoot_uint32_t *) curptr) = cur->datasize; + curptr = ((VasEBoot_uint32_t *) curptr) + 1; + VasEBoot_memcpy (curptr, cur->data, cur->datasize); + curptr = ((VasEBoot_uint8_t *) curptr) + cur->datasize; + VasEBoot_memset (curptr, 0, align_overhead); + curptr = ((VasEBoot_uint8_t *) curptr) + align_overhead; } /* And then the keys. Recursively use this function. */ for (cur = start; cur; cur = cur->next) if (cur->datasize == -1) { - curptr = grub_xnu_writetree_toheap_real (curptr, + curptr = VasEBoot_xnu_writetree_toheap_real (curptr, cur->first_child, cur->name); if (!curptr) @@ -200,84 +200,84 @@ grub_xnu_writetree_toheap_real (void *curptr, return curptr; } -grub_err_t -grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size) +VasEBoot_err_t +VasEBoot_xnu_writetree_toheap (VasEBoot_addr_t *target, VasEBoot_size_t *size) { - struct grub_xnu_devtree_key *chosen; - struct grub_xnu_devtree_key *memorymap; - struct grub_xnu_devtree_key *driverkey; - struct grub_xnu_extdesc *extdesc; - grub_err_t err; + struct VasEBoot_xnu_devtree_key *chosen; + struct VasEBoot_xnu_devtree_key *memorymap; + struct VasEBoot_xnu_devtree_key *driverkey; + struct VasEBoot_xnu_extdesc *extdesc; + VasEBoot_err_t err; void *src; - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) return err; /* Device tree itself is in the memory map of device tree. */ /* Create a dummy value in memory-map. */ - chosen = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + chosen = VasEBoot_xnu_create_key (&VasEBoot_xnu_devtree_root, "chosen"); if (! chosen) - return grub_errno; - memorymap = grub_xnu_create_key (&(chosen->first_child), "memory-map"); + return VasEBoot_errno; + memorymap = VasEBoot_xnu_create_key (&(chosen->first_child), "memory-map"); if (! memorymap) - return grub_errno; + return VasEBoot_errno; - driverkey = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*driverkey)); + driverkey = (struct VasEBoot_xnu_devtree_key *) VasEBoot_malloc (sizeof (*driverkey)); if (! driverkey) - return grub_errno; - driverkey->name = grub_strdup ("DeviceTree"); + return VasEBoot_errno; + driverkey->name = VasEBoot_strdup ("DeviceTree"); if (! driverkey->name) - return grub_errno; + return VasEBoot_errno; driverkey->datasize = sizeof (*extdesc); driverkey->next = memorymap->first_child; memorymap->first_child = driverkey; driverkey->data = extdesc - = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc)); + = (struct VasEBoot_xnu_extdesc *) VasEBoot_malloc (sizeof (*extdesc)); if (! driverkey->data) - return grub_errno; + return VasEBoot_errno; /* Allocate the space based on the size with dummy value. */ - *size = grub_xnu_writetree_get_size (grub_xnu_devtree_root, "/"); - err = grub_xnu_heap_malloc (ALIGN_UP (*size + 1, GRUB_XNU_PAGESIZE), + *size = VasEBoot_xnu_writetree_get_size (VasEBoot_xnu_devtree_root, "/"); + err = VasEBoot_xnu_heap_malloc (ALIGN_UP (*size + 1, VasEBoot_XNU_PAGESIZE), &src, target); if (err) return err; /* Put real data in the dummy. */ extdesc->addr = *target; - extdesc->size = (grub_uint32_t) *size; + extdesc->size = (VasEBoot_uint32_t) *size; /* Write the tree to heap. */ - grub_xnu_writetree_toheap_real (src, grub_xnu_devtree_root, "/"); - return GRUB_ERR_NONE; + VasEBoot_xnu_writetree_toheap_real (src, VasEBoot_xnu_devtree_root, "/"); + return VasEBoot_ERR_NONE; } /* Find a key or value in parent key. */ -struct grub_xnu_devtree_key * -grub_xnu_find_key (struct grub_xnu_devtree_key *parent, const char *name) +struct VasEBoot_xnu_devtree_key * +VasEBoot_xnu_find_key (struct VasEBoot_xnu_devtree_key *parent, const char *name) { - struct grub_xnu_devtree_key *cur; + struct VasEBoot_xnu_devtree_key *cur; for (cur = parent; cur; cur = cur->next) - if (grub_strcmp (cur->name, name) == 0) + if (VasEBoot_strcmp (cur->name, name) == 0) return cur; return 0; } -struct grub_xnu_devtree_key * -grub_xnu_create_key (struct grub_xnu_devtree_key **parent, const char *name) +struct VasEBoot_xnu_devtree_key * +VasEBoot_xnu_create_key (struct VasEBoot_xnu_devtree_key **parent, const char *name) { - struct grub_xnu_devtree_key *ret; - ret = grub_xnu_find_key (*parent, name); + struct VasEBoot_xnu_devtree_key *ret; + ret = VasEBoot_xnu_find_key (*parent, name); if (ret) return ret; - ret = (struct grub_xnu_devtree_key *) grub_zalloc (sizeof (*ret)); + ret = (struct VasEBoot_xnu_devtree_key *) VasEBoot_zalloc (sizeof (*ret)); if (! ret) return 0; - ret->name = grub_strdup (name); + ret->name = VasEBoot_strdup (name); if (! ret->name) { - grub_free (ret); + VasEBoot_free (ret); return 0; } ret->datasize = -1; @@ -286,28 +286,28 @@ grub_xnu_create_key (struct grub_xnu_devtree_key **parent, const char *name) return ret; } -struct grub_xnu_devtree_key * -grub_xnu_create_value (struct grub_xnu_devtree_key **parent, const char *name) +struct VasEBoot_xnu_devtree_key * +VasEBoot_xnu_create_value (struct VasEBoot_xnu_devtree_key **parent, const char *name) { - struct grub_xnu_devtree_key *ret; - ret = grub_xnu_find_key (*parent, name); + struct VasEBoot_xnu_devtree_key *ret; + ret = VasEBoot_xnu_find_key (*parent, name); if (ret) { if (ret->datasize == -1) - grub_xnu_free_devtree (ret->first_child); + VasEBoot_xnu_free_devtree (ret->first_child); else if (ret->datasize) - grub_free (ret->data); + VasEBoot_free (ret->data); ret->datasize = 0; ret->data = 0; return ret; } - ret = (struct grub_xnu_devtree_key *) grub_zalloc (sizeof (*ret)); + ret = (struct VasEBoot_xnu_devtree_key *) VasEBoot_zalloc (sizeof (*ret)); if (! ret) return 0; - ret->name = grub_strdup (name); + ret->name = VasEBoot_strdup (name); if (! ret->name) { - grub_free (ret); + VasEBoot_free (ret); return 0; } ret->next = *parent; @@ -315,286 +315,286 @@ grub_xnu_create_value (struct grub_xnu_devtree_key **parent, const char *name) return ret; } -static grub_err_t -grub_xnu_unload (void) +static VasEBoot_err_t +VasEBoot_xnu_unload (void) { - grub_cpu_xnu_unload (); + VasEBoot_cpu_xnu_unload (); - grub_xnu_free_devtree (grub_xnu_devtree_root); - grub_xnu_devtree_root = 0; + VasEBoot_xnu_free_devtree (VasEBoot_xnu_devtree_root); + VasEBoot_xnu_devtree_root = 0; /* Free loaded image. */ driversnum = 0; driverspackagenum = 0; - grub_relocator_unload (grub_xnu_relocator); - grub_xnu_relocator = NULL; - grub_xnu_heap_target_start = 0; - grub_xnu_heap_size = 0; - grub_xnu_unlock (); - return GRUB_ERR_NONE; + VasEBoot_relocator_unload (VasEBoot_xnu_relocator); + VasEBoot_xnu_relocator = NULL; + VasEBoot_xnu_heap_target_start = 0; + VasEBoot_xnu_heap_size = 0; + VasEBoot_xnu_unlock (); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_kernel (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_err_t err; - grub_macho_t macho; - grub_uint32_t startcode, endcode; + VasEBoot_err_t err; + VasEBoot_macho_t macho; + VasEBoot_uint32_t startcode, endcode; int i; char *ptr; void *loadaddr; - grub_addr_t loadaddr_target; + VasEBoot_addr_t loadaddr_target; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_xnu_unload (); + VasEBoot_xnu_unload (); - macho = grub_macho_open (args[0], 0); + macho = VasEBoot_macho_open (args[0], 0); if (! macho) - return grub_errno; + return VasEBoot_errno; - err = grub_macho_size32 (macho, &startcode, &endcode, GRUB_MACHO_NOBSS, + err = VasEBoot_macho_size32 (macho, &startcode, &endcode, VasEBoot_MACHO_NOBSS, args[0]); if (err) { - grub_macho_close (macho); - grub_xnu_unload (); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); return err; } - grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", + VasEBoot_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", (unsigned long) endcode, (unsigned long) startcode); - grub_xnu_relocator = grub_relocator_new (); - if (!grub_xnu_relocator) - return grub_errno; - grub_xnu_heap_target_start = startcode; - err = grub_xnu_heap_malloc (endcode - startcode, &loadaddr, + VasEBoot_xnu_relocator = VasEBoot_relocator_new (); + if (!VasEBoot_xnu_relocator) + return VasEBoot_errno; + VasEBoot_xnu_heap_target_start = startcode; + err = VasEBoot_xnu_heap_malloc (endcode - startcode, &loadaddr, &loadaddr_target); if (err) { - grub_macho_close (macho); - grub_xnu_unload (); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); return err; } /* Load kernel. */ - err = grub_macho_load32 (macho, args[0], (char *) loadaddr - startcode, - GRUB_MACHO_NOBSS, &grub_xnu_darwin_version); + err = VasEBoot_macho_load32 (macho, args[0], (char *) loadaddr - startcode, + VasEBoot_MACHO_NOBSS, &VasEBoot_xnu_darwin_version); if (err) { - grub_macho_close (macho); - grub_xnu_unload (); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); return err; } - grub_xnu_entry_point = grub_macho_get_entry_point32 (macho, args[0]); - if (! grub_xnu_entry_point) + VasEBoot_xnu_entry_point = VasEBoot_macho_get_entry_point32 (macho, args[0]); + if (! VasEBoot_xnu_entry_point) { - grub_macho_close (macho); - grub_xnu_unload (); - return grub_error (GRUB_ERR_BAD_OS, "couldn't find entry point"); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "couldn't find entry point"); } - grub_macho_close (macho); + VasEBoot_macho_close (macho); - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) { - grub_xnu_unload (); + VasEBoot_xnu_unload (); return err; } /* Copy parameters to kernel command line. */ - ptr = grub_xnu_cmdline; + ptr = VasEBoot_xnu_cmdline; for (i = 1; i < argc; i++) { - if (ptr + grub_strlen (args[i]) + 1 - >= grub_xnu_cmdline + sizeof (grub_xnu_cmdline)) + if (ptr + VasEBoot_strlen (args[i]) + 1 + >= VasEBoot_xnu_cmdline + sizeof (VasEBoot_xnu_cmdline)) break; - grub_memcpy (ptr, args[i], grub_strlen (args[i])); - ptr += grub_strlen (args[i]); + VasEBoot_memcpy (ptr, args[i], VasEBoot_strlen (args[i])); + ptr += VasEBoot_strlen (args[i]); *ptr = ' '; ptr++; } /* Replace last space by '\0'. */ - if (ptr != grub_xnu_cmdline) + if (ptr != VasEBoot_xnu_cmdline) *(ptr - 1) = 0; -#if defined (__i386) && !defined (GRUB_MACHINE_EFI) - err = grub_efiemu_autocore (); +#if defined (__i386) && !defined (VasEBoot_MACHINE_EFI) + err = VasEBoot_efiemu_autocore (); if (err) return err; #endif - grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); + VasEBoot_loader_set (VasEBoot_xnu_boot, VasEBoot_xnu_unload, 0); - grub_xnu_lock (); - grub_xnu_is_64bit = 0; + VasEBoot_xnu_lock (); + VasEBoot_xnu_is_64bit = 0; return 0; } -static grub_err_t -grub_cmd_xnu_kernel64 (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_kernel64 (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_err_t err; - grub_macho_t macho; - grub_uint64_t startcode, endcode; + VasEBoot_err_t err; + VasEBoot_macho_t macho; + VasEBoot_uint64_t startcode, endcode; int i; char *ptr; void *loadaddr; - grub_addr_t loadaddr_target; + VasEBoot_addr_t loadaddr_target; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_xnu_unload (); + VasEBoot_xnu_unload (); - macho = grub_macho_open (args[0], 1); + macho = VasEBoot_macho_open (args[0], 1); if (! macho) - return grub_errno; + return VasEBoot_errno; - err = grub_macho_size64 (macho, &startcode, &endcode, GRUB_MACHO_NOBSS, + err = VasEBoot_macho_size64 (macho, &startcode, &endcode, VasEBoot_MACHO_NOBSS, args[0]); if (err) { - grub_macho_close (macho); - grub_xnu_unload (); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); return err; } startcode &= 0x0fffffff; endcode &= 0x0fffffff; - grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", + VasEBoot_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", (unsigned long) endcode, (unsigned long) startcode); - grub_xnu_relocator = grub_relocator_new (); - if (!grub_xnu_relocator) - return grub_errno; - grub_xnu_heap_target_start = startcode; - err = grub_xnu_heap_malloc (endcode - startcode, &loadaddr, + VasEBoot_xnu_relocator = VasEBoot_relocator_new (); + if (!VasEBoot_xnu_relocator) + return VasEBoot_errno; + VasEBoot_xnu_heap_target_start = startcode; + err = VasEBoot_xnu_heap_malloc (endcode - startcode, &loadaddr, &loadaddr_target); if (err) { - grub_macho_close (macho); - grub_xnu_unload (); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); return err; } /* Load kernel. */ - err = grub_macho_load64 (macho, args[0], (char *) loadaddr - startcode, - GRUB_MACHO_NOBSS, &grub_xnu_darwin_version); + err = VasEBoot_macho_load64 (macho, args[0], (char *) loadaddr - startcode, + VasEBoot_MACHO_NOBSS, &VasEBoot_xnu_darwin_version); if (err) { - grub_macho_close (macho); - grub_xnu_unload (); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); return err; } - grub_xnu_entry_point = grub_macho_get_entry_point64 (macho, args[0]) + VasEBoot_xnu_entry_point = VasEBoot_macho_get_entry_point64 (macho, args[0]) & 0x0fffffff; - if (! grub_xnu_entry_point) + if (! VasEBoot_xnu_entry_point) { - grub_macho_close (macho); - grub_xnu_unload (); - return grub_error (GRUB_ERR_BAD_OS, "couldn't find entry point"); + VasEBoot_macho_close (macho); + VasEBoot_xnu_unload (); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "couldn't find entry point"); } - grub_macho_close (macho); + VasEBoot_macho_close (macho); - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) { - grub_xnu_unload (); + VasEBoot_xnu_unload (); return err; } /* Copy parameters to kernel command line. */ - ptr = grub_xnu_cmdline; + ptr = VasEBoot_xnu_cmdline; for (i = 1; i < argc; i++) { - if (ptr + grub_strlen (args[i]) + 1 - >= grub_xnu_cmdline + sizeof (grub_xnu_cmdline)) + if (ptr + VasEBoot_strlen (args[i]) + 1 + >= VasEBoot_xnu_cmdline + sizeof (VasEBoot_xnu_cmdline)) break; - grub_memcpy (ptr, args[i], grub_strlen (args[i])); - ptr += grub_strlen (args[i]); + VasEBoot_memcpy (ptr, args[i], VasEBoot_strlen (args[i])); + ptr += VasEBoot_strlen (args[i]); *ptr = ' '; ptr++; } /* Replace last space by '\0'. */ - if (ptr != grub_xnu_cmdline) + if (ptr != VasEBoot_xnu_cmdline) *(ptr - 1) = 0; -#if defined (__i386) && !defined (GRUB_MACHINE_EFI) - err = grub_efiemu_autocore (); +#if defined (__i386) && !defined (VasEBoot_MACHINE_EFI) + err = VasEBoot_efiemu_autocore (); if (err) return err; #endif - grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); + VasEBoot_loader_set (VasEBoot_xnu_boot, VasEBoot_xnu_unload, 0); - grub_xnu_lock (); - grub_xnu_is_64bit = 1; + VasEBoot_xnu_lock (); + VasEBoot_xnu_is_64bit = 1; return 0; } /* Register a memory in a memory map under name PREFIXSUFFIX and increment SUFFIX. */ -static grub_err_t -grub_xnu_register_memory (const char *prefix, int *suffix, - grub_addr_t addr, grub_size_t size) +static VasEBoot_err_t +VasEBoot_xnu_register_memory (const char *prefix, int *suffix, + VasEBoot_addr_t addr, VasEBoot_size_t size) { - struct grub_xnu_devtree_key *chosen; - struct grub_xnu_devtree_key *memorymap; - struct grub_xnu_devtree_key *driverkey; - struct grub_xnu_extdesc *extdesc; + struct VasEBoot_xnu_devtree_key *chosen; + struct VasEBoot_xnu_devtree_key *memorymap; + struct VasEBoot_xnu_devtree_key *driverkey; + struct VasEBoot_xnu_extdesc *extdesc; - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); - chosen = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + chosen = VasEBoot_xnu_create_key (&VasEBoot_xnu_devtree_root, "chosen"); if (! chosen) - return grub_errno; - memorymap = grub_xnu_create_key (&(chosen->first_child), "memory-map"); + return VasEBoot_errno; + memorymap = VasEBoot_xnu_create_key (&(chosen->first_child), "memory-map"); if (! memorymap) - return grub_errno; + return VasEBoot_errno; - driverkey = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*driverkey)); + driverkey = (struct VasEBoot_xnu_devtree_key *) VasEBoot_malloc (sizeof (*driverkey)); if (! driverkey) - return grub_errno; + return VasEBoot_errno; if (suffix) - driverkey->name = grub_xasprintf ("%s%d", prefix, (*suffix)++); + driverkey->name = VasEBoot_xasprintf ("%s%d", prefix, (*suffix)++); else - driverkey->name = grub_strdup (prefix); + driverkey->name = VasEBoot_strdup (prefix); if (!driverkey->name) { - grub_free (driverkey); - return grub_errno; + VasEBoot_free (driverkey); + return VasEBoot_errno; } driverkey->datasize = sizeof (*extdesc); driverkey->next = memorymap->first_child; driverkey->data = extdesc - = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc)); + = (struct VasEBoot_xnu_extdesc *) VasEBoot_malloc (sizeof (*extdesc)); if (! driverkey->data) { - grub_free (driverkey->name); - grub_free (driverkey); - return grub_errno; + VasEBoot_free (driverkey->name); + VasEBoot_free (driverkey); + return VasEBoot_errno; } memorymap->first_child = driverkey; extdesc->addr = addr; - extdesc->size = (grub_uint32_t) size; - return GRUB_ERR_NONE; + extdesc->size = (VasEBoot_uint32_t) size; + return VasEBoot_ERR_NONE; } static inline char * @@ -602,71 +602,71 @@ get_name_ptr (char *name) { char *p = name, *p2; /* Skip Info.plist. */ - p2 = grub_strrchr (p, '/'); + p2 = VasEBoot_strrchr (p, '/'); if (!p2) return name; if (p2 == name) return name + 1; p = p2 - 1; - p2 = grub_strrchr (p, '/'); + p2 = VasEBoot_strrchr (p, '/'); if (!p2) return name; if (p2 == name) return name + 1; - if (grub_memcmp (p2, "/Contents/", sizeof ("/Contents/") - 1) != 0) + if (VasEBoot_memcmp (p2, "/Contents/", sizeof ("/Contents/") - 1) != 0) return p2 + 1; p = p2 - 1; - p2 = grub_strrchr (p, '/'); + p2 = VasEBoot_strrchr (p, '/'); if (!p2) return name; return p2 + 1; } /* Load .kext. */ -static grub_err_t -grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile, +static VasEBoot_err_t +VasEBoot_xnu_load_driver (char *infoplistname, VasEBoot_file_t binaryfile, const char *filename) { - grub_macho_t macho; - grub_err_t err; - grub_file_t infoplist; - struct grub_xnu_extheader *exthead; + VasEBoot_macho_t macho; + VasEBoot_err_t err; + VasEBoot_file_t infoplist; + struct VasEBoot_xnu_extheader *exthead; int neededspace = sizeof (*exthead); - grub_uint8_t *buf; + VasEBoot_uint8_t *buf; void *buf0; - grub_addr_t buf_target; - grub_size_t infoplistsize = 0, machosize = 0; + VasEBoot_addr_t buf_target; + VasEBoot_size_t infoplistsize = 0, machosize = 0; char *name, *nameend; int namelen; name = get_name_ptr (infoplistname); - nameend = grub_strchr (name, '/'); + nameend = VasEBoot_strchr (name, '/'); if (nameend) namelen = nameend - name; else - namelen = grub_strlen (name); + namelen = VasEBoot_strlen (name); neededspace += namelen + 1; - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); /* Compute the needed space. */ if (binaryfile) { - macho = grub_macho_file (binaryfile, filename, grub_xnu_is_64bit); + macho = VasEBoot_macho_file (binaryfile, filename, VasEBoot_xnu_is_64bit); if (!macho) - grub_file_close (binaryfile); + VasEBoot_file_close (binaryfile); else { - if (grub_xnu_is_64bit) - machosize = grub_macho_filesize64 (macho); + if (VasEBoot_xnu_is_64bit) + machosize = VasEBoot_macho_filesize64 (macho); else - machosize = grub_macho_filesize32 (macho); + machosize = VasEBoot_macho_filesize32 (macho); } neededspace += machosize; } @@ -674,280 +674,280 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile, macho = 0; if (infoplistname) - infoplist = grub_file_open (infoplistname); + infoplist = VasEBoot_file_open (infoplistname); else infoplist = 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; if (infoplist) { - infoplistsize = grub_file_size (infoplist); + infoplistsize = VasEBoot_file_size (infoplist); neededspace += infoplistsize + 1; } else infoplistsize = 0; /* Allocate the space. */ - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) goto fail; - err = grub_xnu_heap_malloc (neededspace, &buf0, &buf_target); + err = VasEBoot_xnu_heap_malloc (neededspace, &buf0, &buf_target); if (err) goto fail; buf = buf0; - exthead = (struct grub_xnu_extheader *) buf; - grub_memset (exthead, 0, sizeof (*exthead)); + exthead = (struct VasEBoot_xnu_extheader *) buf; + VasEBoot_memset (exthead, 0, sizeof (*exthead)); buf += sizeof (*exthead); /* Load the binary. */ if (macho) { - exthead->binaryaddr = buf_target + (buf - (grub_uint8_t *) buf0); + exthead->binaryaddr = buf_target + (buf - (VasEBoot_uint8_t *) buf0); exthead->binarysize = machosize; - if (grub_xnu_is_64bit) - err = grub_macho_readfile64 (macho, filename, buf); + if (VasEBoot_xnu_is_64bit) + err = VasEBoot_macho_readfile64 (macho, filename, buf); else - err = grub_macho_readfile32 (macho, filename, buf); + err = VasEBoot_macho_readfile32 (macho, filename, buf); if (err) goto fail; - grub_macho_close (macho); + VasEBoot_macho_close (macho); buf += machosize; } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* Load the plist. */ if (infoplist) { - exthead->infoplistaddr = buf_target + (buf - (grub_uint8_t *) buf0); + exthead->infoplistaddr = buf_target + (buf - (VasEBoot_uint8_t *) buf0); exthead->infoplistsize = infoplistsize + 1; - if (grub_file_read (infoplist, buf, infoplistsize) - != (grub_ssize_t) (infoplistsize)) + if (VasEBoot_file_read (infoplist, buf, infoplistsize) + != (VasEBoot_ssize_t) (infoplistsize)) { - grub_file_close (infoplist); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + VasEBoot_file_close (infoplist); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), infoplistname); - return grub_errno; + return VasEBoot_errno; } - grub_file_close (infoplist); + VasEBoot_file_close (infoplist); buf[infoplistsize] = 0; buf += infoplistsize + 1; } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - exthead->nameaddr = (buf - (grub_uint8_t *) buf0) + buf_target; + exthead->nameaddr = (buf - (VasEBoot_uint8_t *) buf0) + buf_target; exthead->namesize = namelen + 1; - grub_memcpy (buf, name, namelen); + VasEBoot_memcpy (buf, name, namelen); buf[namelen] = 0; buf += namelen + 1; /* Announce to kernel */ - return grub_xnu_register_memory ("Driver-", &driversnum, buf_target, + return VasEBoot_xnu_register_memory ("Driver-", &driversnum, buf_target, neededspace); fail: if (macho) - grub_macho_close (macho); + VasEBoot_macho_close (macho); return err; } /* Load mkext. */ -static grub_err_t -grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_mkext (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_file_t file; + VasEBoot_file_t file; void *loadto; - grub_addr_t loadto_target; - grub_err_t err; - grub_off_t readoff = 0; - grub_ssize_t readlen = -1; - struct grub_macho_fat_header head; - struct grub_macho_fat_arch *archs; + VasEBoot_addr_t loadto_target; + VasEBoot_err_t err; + VasEBoot_off_t readoff = 0; + VasEBoot_ssize_t readlen = -1; + struct VasEBoot_macho_fat_header head; + struct VasEBoot_macho_fat_arch *archs; int narchs, i; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; + return VasEBoot_errno; /* Sometimes caches are fat binary. Errgh. */ - if (grub_file_read (file, &head, sizeof (head)) - != (grub_ssize_t) (sizeof (head))) + if (VasEBoot_file_read (file, &head, sizeof (head)) + != (VasEBoot_ssize_t) (sizeof (head))) { /* I don't know the internal structure of package but can hardly imagine a valid package shorter than 20 bytes. */ - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), args[0]); - return grub_errno; + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), args[0]); + return VasEBoot_errno; } /* Find the corresponding architecture. */ - if (grub_be_to_cpu32 (head.magic) == GRUB_MACHO_FAT_MAGIC) + if (VasEBoot_be_to_cpu32 (head.magic) == VasEBoot_MACHO_FAT_MAGIC) { - narchs = grub_be_to_cpu32 (head.nfat_arch); - archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs); + narchs = VasEBoot_be_to_cpu32 (head.nfat_arch); + archs = VasEBoot_malloc (sizeof (struct VasEBoot_macho_fat_arch) * narchs); if (! archs) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } - if (grub_file_read (file, archs, - sizeof (struct grub_macho_fat_arch) * narchs) - != (grub_ssize_t) sizeof(struct grub_macho_fat_arch) * narchs) + if (VasEBoot_file_read (file, archs, + sizeof (struct VasEBoot_macho_fat_arch) * narchs) + != (VasEBoot_ssize_t) sizeof(struct VasEBoot_macho_fat_arch) * narchs) { - grub_free (archs); - if (!grub_errno) - grub_error (GRUB_ERR_READ_ERROR, N_("premature end of file %s"), + VasEBoot_free (archs); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("premature end of file %s"), args[0]); - return grub_errno; + return VasEBoot_errno; } for (i = 0; i < narchs; i++) { - if (!grub_xnu_is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST32 - (grub_be_to_cpu32 (archs[i].cputype))) + if (!VasEBoot_xnu_is_64bit && VasEBoot_MACHO_CPUTYPE_IS_HOST32 + (VasEBoot_be_to_cpu32 (archs[i].cputype))) { - readoff = grub_be_to_cpu32 (archs[i].offset); - readlen = grub_be_to_cpu32 (archs[i].size); + readoff = VasEBoot_be_to_cpu32 (archs[i].offset); + readlen = VasEBoot_be_to_cpu32 (archs[i].size); } - if (grub_xnu_is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST64 - (grub_be_to_cpu32 (archs[i].cputype))) + if (VasEBoot_xnu_is_64bit && VasEBoot_MACHO_CPUTYPE_IS_HOST64 + (VasEBoot_be_to_cpu32 (archs[i].cputype))) { - readoff = grub_be_to_cpu32 (archs[i].offset); - readlen = grub_be_to_cpu32 (archs[i].size); + readoff = VasEBoot_be_to_cpu32 (archs[i].offset); + readlen = VasEBoot_be_to_cpu32 (archs[i].size); } } - grub_free (archs); + VasEBoot_free (archs); } else { /* It's a flat file. Some sane people still exist. */ readoff = 0; - readlen = grub_file_size (file); + readlen = VasEBoot_file_size (file); } if (readlen == -1) { - grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, "no suitable architecture is found"); + VasEBoot_file_close (file); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "no suitable architecture is found"); } /* Allocate space. */ - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) { - grub_file_close (file); + VasEBoot_file_close (file); return err; } - err = grub_xnu_heap_malloc (readlen, &loadto, &loadto_target); + err = VasEBoot_xnu_heap_malloc (readlen, &loadto, &loadto_target); if (err) { - grub_file_close (file); + VasEBoot_file_close (file); return err; } /* Read the file. */ - grub_file_seek (file, readoff); - if (grub_file_read (file, loadto, readlen) != (grub_ssize_t) (readlen)) + VasEBoot_file_seek (file, readoff); + if (VasEBoot_file_read (file, loadto, readlen) != (VasEBoot_ssize_t) (readlen)) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), args[0]); - return grub_errno; + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), args[0]); + return VasEBoot_errno; } - grub_file_close (file); + VasEBoot_file_close (file); /* Pass it to kernel. */ - return grub_xnu_register_memory ("DriversPackage-", &driverspackagenum, + return VasEBoot_xnu_register_memory ("DriversPackage-", &driverspackagenum, loadto_target, readlen); } -static grub_err_t -grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_ramdisk (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_file_t file; + VasEBoot_file_t file; void *loadto; - grub_addr_t loadto_target; - grub_err_t err; - grub_size_t size; + VasEBoot_addr_t loadto_target; + VasEBoot_err_t err; + VasEBoot_size_t size; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); - file = grub_file_open (args[0]); + file = VasEBoot_file_open (args[0]); if (! file) - return grub_errno; + return VasEBoot_errno; - err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + err = VasEBoot_xnu_align_heap (VasEBoot_XNU_PAGESIZE); if (err) return err; - size = grub_file_size (file); + size = VasEBoot_file_size (file); - err = grub_xnu_heap_malloc (size, &loadto, &loadto_target); + err = VasEBoot_xnu_heap_malloc (size, &loadto, &loadto_target); if (err) return err; - if (grub_file_read (file, loadto, size) != (grub_ssize_t) (size)) + if (VasEBoot_file_read (file, loadto, size) != (VasEBoot_ssize_t) (size)) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), args[0]); - return grub_errno; + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), args[0]); + return VasEBoot_errno; } - return grub_xnu_register_memory ("RAMDisk", 0, loadto_target, size); + return VasEBoot_xnu_register_memory ("RAMDisk", 0, loadto_target, size); } /* Returns true if the kext should be loaded according to plist and osbundlereq. Also fill BINNAME. */ static int -grub_xnu_check_os_bundle_required (char *plistname, +VasEBoot_xnu_check_os_bundle_required (char *plistname, const char *osbundlereq, char **binname) { - grub_file_t file; + VasEBoot_file_t file; char *buf = 0, *tagstart = 0, *ptr1 = 0, *keyptr = 0; char *stringptr = 0, *ptr2 = 0; - grub_size_t size; + VasEBoot_size_t size; int depth = 0; int ret; int osbundlekeyfound = 0, binnamekeyfound = 0; if (binname) *binname = 0; - file = grub_file_open (plistname); + file = VasEBoot_file_open (plistname); if (! file) return 0; - size = grub_file_size (file); - buf = grub_malloc (size); + size = VasEBoot_file_size (file); + buf = VasEBoot_malloc (size); if (! buf) { - grub_file_close (file); + VasEBoot_file_close (file); return 0; } - if (grub_file_read (file, buf, size) != (grub_ssize_t) (size)) + if (VasEBoot_file_read (file, buf, size) != (VasEBoot_ssize_t) (size)) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), plistname); + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("premature end of file %s"), plistname); return 0; } - grub_file_close (file); + VasEBoot_file_close (file); /* Set the return value for the case when no OSBundleRequired tag is found. */ if (osbundlereq) - ret = grub_strword (osbundlereq, "all") || grub_strword (osbundlereq, "-"); + ret = VasEBoot_strword (osbundlereq, "all") || VasEBoot_strword (osbundlereq, "-"); else ret = 1; @@ -959,23 +959,23 @@ grub_xnu_check_os_bundle_required (char *plistname, tagstart = ptr1; *ptr1 = 0; if (keyptr && depth == 4 - && grub_strcmp (keyptr, "OSBundleRequired") == 0) + && VasEBoot_strcmp (keyptr, "OSBundleRequired") == 0) osbundlekeyfound = 1; if (keyptr && depth == 4 && - grub_strcmp (keyptr, "CFBundleExecutable") == 0) + VasEBoot_strcmp (keyptr, "CFBundleExecutable") == 0) binnamekeyfound = 1; if (stringptr && osbundlekeyfound && osbundlereq && depth == 4) { for (ptr2 = stringptr; *ptr2; ptr2++) - *ptr2 = grub_tolower (*ptr2); - ret = grub_strword (osbundlereq, stringptr) - || grub_strword (osbundlereq, "all"); + *ptr2 = VasEBoot_tolower (*ptr2); + ret = VasEBoot_strword (osbundlereq, stringptr) + || VasEBoot_strword (osbundlereq, "all"); } if (stringptr && binnamekeyfound && binname && depth == 4) { if (*binname) - grub_free (*binname); - *binname = grub_strdup (stringptr); + VasEBoot_free (*binname); + *binname = VasEBoot_strdup (stringptr); } *ptr1 = '<'; @@ -985,8 +985,8 @@ grub_xnu_check_os_bundle_required (char *plistname, case '>': if (! tagstart) { - grub_free (buf); - grub_error (GRUB_ERR_BAD_OS, "can't parse %s", plistname); + VasEBoot_free (buf); + VasEBoot_error (VasEBoot_ERR_BAD_OS, "can't parse %s", plistname); return 0; } *ptr1 = 0; @@ -996,11 +996,11 @@ grub_xnu_check_os_bundle_required (char *plistname, *ptr1 = '>'; break; } - if (depth == 3 && grub_strcmp (tagstart + 1, "key") == 0) + if (depth == 3 && VasEBoot_strcmp (tagstart + 1, "key") == 0) keyptr = ptr1 + 1; - if (depth == 3 && grub_strcmp (tagstart + 1, "string") == 0) + if (depth == 3 && VasEBoot_strcmp (tagstart + 1, "string") == 0) stringptr = ptr1 + 1; - else if (grub_strcmp (tagstart + 1, "/key") != 0) + else if (VasEBoot_strcmp (tagstart + 1, "/key") != 0) { osbundlekeyfound = 0; binnamekeyfound = 0; @@ -1013,26 +1013,26 @@ grub_xnu_check_os_bundle_required (char *plistname, depth++; break; } - grub_free (buf); + VasEBoot_free (buf); return ret; } -/* Context for grub_xnu_scan_dir_for_kexts. */ -struct grub_xnu_scan_dir_for_kexts_ctx +/* Context for VasEBoot_xnu_scan_dir_for_kexts. */ +struct VasEBoot_xnu_scan_dir_for_kexts_ctx { char *dirname; const char *osbundlerequired; int maxrecursion; }; -/* Helper for grub_xnu_scan_dir_for_kexts. */ +/* Helper for VasEBoot_xnu_scan_dir_for_kexts. */ static int -grub_xnu_scan_dir_for_kexts_load (const char *filename, - const struct grub_dirhook_info *info, +VasEBoot_xnu_scan_dir_for_kexts_load (const char *filename, + const struct VasEBoot_dirhook_info *info, void *data) { - struct grub_xnu_scan_dir_for_kexts_ctx *ctx = data; + struct VasEBoot_xnu_scan_dir_for_kexts_ctx *ctx = data; char *newdirname; if (! info->dir) @@ -1040,69 +1040,69 @@ grub_xnu_scan_dir_for_kexts_load (const char *filename, if (filename[0] == '.') return 0; - if (grub_strlen (filename) < 5 || - grub_memcmp (filename + grub_strlen (filename) - 5, ".kext", 5) != 0) + if (VasEBoot_strlen (filename) < 5 || + VasEBoot_memcmp (filename + VasEBoot_strlen (filename) - 5, ".kext", 5) != 0) return 0; newdirname - = grub_malloc (grub_strlen (ctx->dirname) + grub_strlen (filename) + 2); + = VasEBoot_malloc (VasEBoot_strlen (ctx->dirname) + VasEBoot_strlen (filename) + 2); /* It's a .kext. Try to load it. */ if (newdirname) { - grub_strcpy (newdirname, ctx->dirname); - newdirname[grub_strlen (newdirname) + 1] = 0; - newdirname[grub_strlen (newdirname)] = '/'; - grub_strcpy (newdirname + grub_strlen (newdirname), filename); - grub_xnu_load_kext_from_dir (newdirname, ctx->osbundlerequired, + VasEBoot_strcpy (newdirname, ctx->dirname); + newdirname[VasEBoot_strlen (newdirname) + 1] = 0; + newdirname[VasEBoot_strlen (newdirname)] = '/'; + VasEBoot_strcpy (newdirname + VasEBoot_strlen (newdirname), filename); + VasEBoot_xnu_load_kext_from_dir (newdirname, ctx->osbundlerequired, ctx->maxrecursion); - if (grub_errno == GRUB_ERR_BAD_OS) - grub_errno = GRUB_ERR_NONE; - grub_free (newdirname); + if (VasEBoot_errno == VasEBoot_ERR_BAD_OS) + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (newdirname); } return 0; } /* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */ -grub_err_t -grub_xnu_scan_dir_for_kexts (char *dirname, const char *osbundlerequired, +VasEBoot_err_t +VasEBoot_xnu_scan_dir_for_kexts (char *dirname, const char *osbundlerequired, int maxrecursion) { - struct grub_xnu_scan_dir_for_kexts_ctx ctx = { + struct VasEBoot_xnu_scan_dir_for_kexts_ctx ctx = { .dirname = dirname, .osbundlerequired = osbundlerequired, .maxrecursion = maxrecursion }; - grub_device_t dev; + VasEBoot_device_t dev; char *device_name; - grub_fs_t fs; + VasEBoot_fs_t fs; const char *path; - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); - device_name = grub_file_get_device_name (dirname); - dev = grub_device_open (device_name); + device_name = VasEBoot_file_get_device_name (dirname); + dev = VasEBoot_device_open (device_name); if (dev) { - fs = grub_fs_probe (dev); - path = grub_strchr (dirname, ')'); + fs = VasEBoot_fs_probe (dev); + path = VasEBoot_strchr (dirname, ')'); if (! path) path = dirname; else path++; if (fs) - (fs->dir) (dev, path, grub_xnu_scan_dir_for_kexts_load, &ctx); - grub_device_close (dev); + (fs->dir) (dev, path, VasEBoot_xnu_scan_dir_for_kexts_load, &ctx); + VasEBoot_device_close (dev); } - grub_free (device_name); + VasEBoot_free (device_name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -/* Context for grub_xnu_load_kext_from_dir. */ -struct grub_xnu_load_kext_from_dir_ctx +/* Context for VasEBoot_xnu_load_kext_from_dir. */ +struct VasEBoot_xnu_load_kext_from_dir_ctx { char *dirname; const char *osbundlerequired; @@ -1112,79 +1112,79 @@ struct grub_xnu_load_kext_from_dir_ctx int usemacos; }; -/* Helper for grub_xnu_load_kext_from_dir. */ +/* Helper for VasEBoot_xnu_load_kext_from_dir. */ static int -grub_xnu_load_kext_from_dir_load (const char *filename, - const struct grub_dirhook_info *info, +VasEBoot_xnu_load_kext_from_dir_load (const char *filename, + const struct VasEBoot_dirhook_info *info, void *data) { - struct grub_xnu_load_kext_from_dir_ctx *ctx = data; + struct VasEBoot_xnu_load_kext_from_dir_ctx *ctx = data; - if (grub_strlen (filename) > 15) + if (VasEBoot_strlen (filename) > 15) return 0; - grub_strcpy (ctx->newdirname + grub_strlen (ctx->dirname) + 1, filename); + VasEBoot_strcpy (ctx->newdirname + VasEBoot_strlen (ctx->dirname) + 1, filename); /* If the kext contains directory "Contents" all real stuff is in this directory. */ - if (info->dir && grub_strcasecmp (filename, "Contents") == 0) - grub_xnu_load_kext_from_dir (ctx->newdirname, ctx->osbundlerequired, + if (info->dir && VasEBoot_strcasecmp (filename, "Contents") == 0) + VasEBoot_xnu_load_kext_from_dir (ctx->newdirname, ctx->osbundlerequired, ctx->maxrecursion - 1); /* Directory "Plugins" contains nested kexts. */ - if (info->dir && grub_strcasecmp (filename, "Plugins") == 0) - grub_xnu_scan_dir_for_kexts (ctx->newdirname, ctx->osbundlerequired, + if (info->dir && VasEBoot_strcasecmp (filename, "Plugins") == 0) + VasEBoot_xnu_scan_dir_for_kexts (ctx->newdirname, ctx->osbundlerequired, ctx->maxrecursion - 1); /* Directory "MacOS" contains executable, otherwise executable is on the top. */ - if (info->dir && grub_strcasecmp (filename, "MacOS") == 0) + if (info->dir && VasEBoot_strcasecmp (filename, "MacOS") == 0) ctx->usemacos = 1; /* Info.plist is the file which governs our future actions. */ - if (! info->dir && grub_strcasecmp (filename, "Info.plist") == 0 + if (! info->dir && VasEBoot_strcasecmp (filename, "Info.plist") == 0 && ! ctx->plistname) - ctx->plistname = grub_strdup (ctx->newdirname); + ctx->plistname = VasEBoot_strdup (ctx->newdirname); return 0; } /* Load extension DIRNAME. (extensions are directories in xnu) */ -grub_err_t -grub_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired, +VasEBoot_err_t +VasEBoot_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired, int maxrecursion) { - struct grub_xnu_load_kext_from_dir_ctx ctx = { + struct VasEBoot_xnu_load_kext_from_dir_ctx ctx = { .dirname = dirname, .osbundlerequired = osbundlerequired, .maxrecursion = maxrecursion, .plistname = 0, .usemacos = 0 }; - grub_device_t dev; + VasEBoot_device_t dev; char *newpath; char *device_name; - grub_fs_t fs; + VasEBoot_fs_t fs; const char *path; char *binsuffix; - grub_file_t binfile; + VasEBoot_file_t binfile; - ctx.newdirname = grub_malloc (grub_strlen (dirname) + 20); + ctx.newdirname = VasEBoot_malloc (VasEBoot_strlen (dirname) + 20); if (! ctx.newdirname) - return grub_errno; - grub_strcpy (ctx.newdirname, dirname); - ctx.newdirname[grub_strlen (dirname)] = '/'; - ctx.newdirname[grub_strlen (dirname) + 1] = 0; - device_name = grub_file_get_device_name (dirname); - dev = grub_device_open (device_name); + return VasEBoot_errno; + VasEBoot_strcpy (ctx.newdirname, dirname); + ctx.newdirname[VasEBoot_strlen (dirname)] = '/'; + ctx.newdirname[VasEBoot_strlen (dirname) + 1] = 0; + device_name = VasEBoot_file_get_device_name (dirname); + dev = VasEBoot_device_open (device_name); if (dev) { - fs = grub_fs_probe (dev); - path = grub_strchr (dirname, ')'); + fs = VasEBoot_fs_probe (dev); + path = VasEBoot_strchr (dirname, ')'); if (! path) path = dirname; else path++; - newpath = grub_strchr (ctx.newdirname, ')'); + newpath = VasEBoot_strchr (ctx.newdirname, ')'); if (! newpath) newpath = ctx.newdirname; else @@ -1192,107 +1192,107 @@ grub_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired, /* Look at the directory. */ if (fs) - (fs->dir) (dev, path, grub_xnu_load_kext_from_dir_load, &ctx); + (fs->dir) (dev, path, VasEBoot_xnu_load_kext_from_dir_load, &ctx); - if (ctx.plistname && grub_xnu_check_os_bundle_required + if (ctx.plistname && VasEBoot_xnu_check_os_bundle_required (ctx.plistname, osbundlerequired, &binsuffix)) { if (binsuffix) { /* Open the binary. */ - char *binname = grub_malloc (grub_strlen (dirname) - + grub_strlen (binsuffix) + char *binname = VasEBoot_malloc (VasEBoot_strlen (dirname) + + VasEBoot_strlen (binsuffix) + sizeof ("/MacOS/")); - grub_strcpy (binname, dirname); + VasEBoot_strcpy (binname, dirname); if (ctx.usemacos) - grub_strcpy (binname + grub_strlen (binname), "/MacOS/"); + VasEBoot_strcpy (binname + VasEBoot_strlen (binname), "/MacOS/"); else - grub_strcpy (binname + grub_strlen (binname), "/"); - grub_strcpy (binname + grub_strlen (binname), binsuffix); - grub_dprintf ("xnu", "%s:%s\n", ctx.plistname, binname); - binfile = grub_file_open (binname); + VasEBoot_strcpy (binname + VasEBoot_strlen (binname), "/"); + VasEBoot_strcpy (binname + VasEBoot_strlen (binname), binsuffix); + VasEBoot_dprintf ("xnu", "%s:%s\n", ctx.plistname, binname); + binfile = VasEBoot_file_open (binname); if (! binfile) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* Load the extension. */ - grub_xnu_load_driver (ctx.plistname, binfile, + VasEBoot_xnu_load_driver (ctx.plistname, binfile, binname); - grub_free (binname); - grub_free (binsuffix); + VasEBoot_free (binname); + VasEBoot_free (binsuffix); } else { - grub_dprintf ("xnu", "%s:0\n", ctx.plistname); - grub_xnu_load_driver (ctx.plistname, 0, 0); + VasEBoot_dprintf ("xnu", "%s:0\n", ctx.plistname); + VasEBoot_xnu_load_driver (ctx.plistname, 0, 0); } } - grub_free (ctx.plistname); - grub_device_close (dev); + VasEBoot_free (ctx.plistname); + VasEBoot_device_close (dev); } - grub_free (device_name); + VasEBoot_free (device_name); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int locked=0; -static grub_dl_t my_mod; +static VasEBoot_dl_t my_mod; /* Load the kext. */ -static grub_err_t -grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_kext (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { - grub_file_t binfile = 0; + VasEBoot_file_t binfile = 0; - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); if (argc == 2) { /* User explicitly specified plist and binary. */ - if (grub_strcmp (args[1], "-") != 0) + if (VasEBoot_strcmp (args[1], "-") != 0) { - binfile = grub_file_open (args[1]); + binfile = VasEBoot_file_open (args[1]); if (! binfile) - return grub_errno; + return VasEBoot_errno; } - return grub_xnu_load_driver (grub_strcmp (args[0], "-") ? args[0] : 0, + return VasEBoot_xnu_load_driver (VasEBoot_strcmp (args[0], "-") ? args[0] : 0, binfile, args[1]); } /* load kext normally. */ if (argc == 1) - return grub_xnu_load_kext_from_dir (args[0], 0, 10); + return VasEBoot_xnu_load_kext_from_dir (args[0], 0, 10); - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); } /* Load a directory containing kexts. */ -static grub_err_t -grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_xnu_kextdir (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { if (argc != 1 && argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "directory name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "directory name required"); - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); if (argc == 1) - return grub_xnu_scan_dir_for_kexts (args[0], + return VasEBoot_xnu_scan_dir_for_kexts (args[0], "console,root,local-root,network-root", 10); else { - char *osbundlerequired = grub_strdup (args[1]), *ptr; - grub_err_t err; + char *osbundlerequired = VasEBoot_strdup (args[1]), *ptr; + VasEBoot_err_t err; if (! osbundlerequired) - return grub_errno; + return VasEBoot_errno; for (ptr = osbundlerequired; *ptr; ptr++) - *ptr = grub_tolower (*ptr); - err = grub_xnu_scan_dir_for_kexts (args[0], osbundlerequired, 10); - grub_free (osbundlerequired); + *ptr = VasEBoot_tolower (*ptr); + err = VasEBoot_xnu_scan_dir_for_kexts (args[0], osbundlerequired, 10); + VasEBoot_free (osbundlerequired); return err; } } @@ -1330,154 +1330,154 @@ unescape (char *name, char *curdot, char *nextdot, int *len) *len = dptr - name; } -grub_err_t -grub_xnu_fill_devicetree (void) +VasEBoot_err_t +VasEBoot_xnu_fill_devicetree (void) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; FOR_SORTED_ENV (var) { char *nextdot = 0, *curdot; - struct grub_xnu_devtree_key **curkey = &grub_xnu_devtree_root; - struct grub_xnu_devtree_key *curvalue; + struct VasEBoot_xnu_devtree_key **curkey = &VasEBoot_xnu_devtree_root; + struct VasEBoot_xnu_devtree_key *curvalue; char *name = 0, *data; int len; - if (grub_memcmp (var->name, "XNU.DeviceTree.", + if (VasEBoot_memcmp (var->name, "XNU.DeviceTree.", sizeof ("XNU.DeviceTree.") - 1) != 0) continue; curdot = var->name + sizeof ("XNU.DeviceTree.") - 1; - nextdot = grub_strchr (curdot, '.'); + nextdot = VasEBoot_strchr (curdot, '.'); if (nextdot) nextdot++; while (nextdot) { - name = grub_realloc (name, nextdot - curdot + 1); + name = VasEBoot_realloc (name, nextdot - curdot + 1); if (!name) - return grub_errno; + return VasEBoot_errno; unescape (name, curdot, nextdot, &len); name[len - 1] = 0; - curkey = &(grub_xnu_create_key (curkey, name)->first_child); + curkey = &(VasEBoot_xnu_create_key (curkey, name)->first_child); curdot = nextdot; - nextdot = grub_strchr (nextdot, '.'); + nextdot = VasEBoot_strchr (nextdot, '.'); if (nextdot) nextdot++; } - nextdot = curdot + grub_strlen (curdot) + 1; + nextdot = curdot + VasEBoot_strlen (curdot) + 1; - name = grub_realloc (name, nextdot - curdot + 1); + name = VasEBoot_realloc (name, nextdot - curdot + 1); if (!name) - return grub_errno; + return VasEBoot_errno; unescape (name, curdot, nextdot, &len); name[len] = 0; - curvalue = grub_xnu_create_value (curkey, name); + curvalue = VasEBoot_xnu_create_value (curkey, name); if (!curvalue) - return grub_errno; - grub_free (name); + return VasEBoot_errno; + VasEBoot_free (name); - data = grub_malloc (grub_strlen (var->value) + 1); + data = VasEBoot_malloc (VasEBoot_strlen (var->value) + 1); if (!data) - return grub_errno; + return VasEBoot_errno; - unescape (data, var->value, var->value + grub_strlen (var->value), + unescape (data, var->value, var->value + VasEBoot_strlen (var->value), &len); curvalue->datasize = len; curvalue->data = data; } - return grub_errno; + return VasEBoot_errno; } -struct grub_video_bitmap *grub_xnu_bitmap = 0; -grub_xnu_bitmap_mode_t grub_xnu_bitmap_mode; +struct VasEBoot_video_bitmap *VasEBoot_xnu_bitmap = 0; +VasEBoot_xnu_bitmap_mode_t VasEBoot_xnu_bitmap_mode; /* Option array indices. */ #define XNU_SPLASH_CMD_ARGINDEX_MODE 0 -static const struct grub_arg_option xnu_splash_cmd_options[] = +static const struct VasEBoot_arg_option xnu_splash_cmd_options[] = { {"mode", 'm', 0, N_("Background image mode."), N_("stretch|normal"), ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_cmd_xnu_splash (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_cmd_xnu_splash (VasEBoot_extcmd_context_t ctxt, int argc, char *args[]) { - grub_err_t err; + VasEBoot_err_t err; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - if (! grub_xnu_heap_size) - return grub_error (GRUB_ERR_BAD_OS, N_("you need to load the kernel first")); + if (! VasEBoot_xnu_heap_size) + return VasEBoot_error (VasEBoot_ERR_BAD_OS, N_("you need to load the kernel first")); if (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].set && - grub_strcmp (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].arg, + VasEBoot_strcmp (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].arg, "stretch") == 0) - grub_xnu_bitmap_mode = GRUB_XNU_BITMAP_STRETCH; + VasEBoot_xnu_bitmap_mode = VasEBoot_XNU_BITMAP_STRETCH; else - grub_xnu_bitmap_mode = GRUB_XNU_BITMAP_CENTER; + VasEBoot_xnu_bitmap_mode = VasEBoot_XNU_BITMAP_CENTER; - err = grub_video_bitmap_load (&grub_xnu_bitmap, args[0]); + err = VasEBoot_video_bitmap_load (&VasEBoot_xnu_bitmap, args[0]); if (err) - grub_xnu_bitmap = 0; + VasEBoot_xnu_bitmap = 0; return err; } -#ifndef GRUB_MACHINE_EMU -static grub_err_t -grub_cmd_xnu_resume (grub_command_t cmd __attribute__ ((unused)), +#ifndef VasEBoot_MACHINE_EMU +static VasEBoot_err_t +VasEBoot_cmd_xnu_resume (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char *args[]) { if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - return grub_xnu_resume (args[0]); + return VasEBoot_xnu_resume (args[0]); } #endif void -grub_xnu_lock (void) +VasEBoot_xnu_lock (void) { if (!locked) - grub_dl_ref (my_mod); + VasEBoot_dl_ref (my_mod); locked = 1; } void -grub_xnu_unlock (void) +VasEBoot_xnu_unlock (void) { if (locked) - grub_dl_unref (my_mod); + VasEBoot_dl_unref (my_mod); locked = 0; } -static grub_command_t cmd_kernel64, cmd_kernel, cmd_mkext, cmd_kext; -static grub_command_t cmd_kextdir, cmd_ramdisk, cmd_resume; -static grub_extcmd_t cmd_splash; +static VasEBoot_command_t cmd_kernel64, cmd_kernel, cmd_mkext, cmd_kext; +static VasEBoot_command_t cmd_kextdir, cmd_ramdisk, cmd_resume; +static VasEBoot_extcmd_t cmd_splash; -GRUB_MOD_INIT(xnu) +VasEBoot_MOD_INIT(xnu) { - cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0, + cmd_kernel = VasEBoot_register_command ("xnu_kernel", VasEBoot_cmd_xnu_kernel, 0, N_("Load XNU image.")); - cmd_kernel64 = grub_register_command ("xnu_kernel64", grub_cmd_xnu_kernel64, + cmd_kernel64 = VasEBoot_register_command ("xnu_kernel64", VasEBoot_cmd_xnu_kernel64, 0, N_("Load 64-bit XNU image.")); - cmd_mkext = grub_register_command ("xnu_mkext", grub_cmd_xnu_mkext, 0, + cmd_mkext = VasEBoot_register_command ("xnu_mkext", VasEBoot_cmd_xnu_mkext, 0, N_("Load XNU extension package.")); - cmd_kext = grub_register_command ("xnu_kext", grub_cmd_xnu_kext, 0, + cmd_kext = VasEBoot_register_command ("xnu_kext", VasEBoot_cmd_xnu_kext, 0, N_("Load XNU extension.")); - cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir, + cmd_kextdir = VasEBoot_register_command ("xnu_kextdir", VasEBoot_cmd_xnu_kextdir, /* TRANSLATORS: OSBundleRequired is a variable name in xnu extensions manifests. It behaves mostly like @@ -1487,38 +1487,38 @@ GRUB_MOD_INIT(xnu) /* TRANSLATORS: There are many extensions in extension directory. */ N_("Load XNU extension directory.")); - cmd_ramdisk = grub_register_command ("xnu_ramdisk", grub_cmd_xnu_ramdisk, 0, + cmd_ramdisk = VasEBoot_register_command ("xnu_ramdisk", VasEBoot_cmd_xnu_ramdisk, 0, /* TRANSLATORS: ramdisk here isn't identifier. It can be translated. */ N_("Load XNU ramdisk. " "It will be available in OS as md0.")); - cmd_splash = grub_register_extcmd ("xnu_splash", - grub_cmd_xnu_splash, 0, 0, + cmd_splash = VasEBoot_register_extcmd ("xnu_splash", + VasEBoot_cmd_xnu_splash, 0, 0, N_("Load a splash image for XNU."), xnu_splash_cmd_options); -#ifndef GRUB_MACHINE_EMU - cmd_resume = grub_register_command ("xnu_resume", grub_cmd_xnu_resume, +#ifndef VasEBoot_MACHINE_EMU + cmd_resume = VasEBoot_register_command ("xnu_resume", VasEBoot_cmd_xnu_resume, 0, N_("Load an image of hibernated" " XNU.")); #endif - grub_cpu_xnu_init (); + VasEBoot_cpu_xnu_init (); my_mod = mod; } -GRUB_MOD_FINI(xnu) +VasEBoot_MOD_FINI(xnu) { -#ifndef GRUB_MACHINE_EMU - grub_unregister_command (cmd_resume); +#ifndef VasEBoot_MACHINE_EMU + VasEBoot_unregister_command (cmd_resume); #endif - grub_unregister_command (cmd_mkext); - grub_unregister_command (cmd_kext); - grub_unregister_command (cmd_kextdir); - grub_unregister_command (cmd_ramdisk); - grub_unregister_command (cmd_kernel); - grub_unregister_extcmd (cmd_splash); - grub_unregister_command (cmd_kernel64); + VasEBoot_unregister_command (cmd_mkext); + VasEBoot_unregister_command (cmd_kext); + VasEBoot_unregister_command (cmd_kextdir); + VasEBoot_unregister_command (cmd_ramdisk); + VasEBoot_unregister_command (cmd_kernel); + VasEBoot_unregister_extcmd (cmd_splash); + VasEBoot_unregister_command (cmd_kernel64); - grub_cpu_xnu_fini (); + VasEBoot_cpu_xnu_fini (); } diff --git a/VasEBoot-core/loader/xnu_resume.c b/VasEBoot-core/loader/xnu_resume.c index 534a74438..87b8fb12d 100644 --- a/VasEBoot-core/loader/xnu_resume.c +++ b/VasEBoot-core/loader/xnu_resume.c @@ -1,99 +1,99 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static void *grub_xnu_hibernate_image; +static void *VasEBoot_xnu_hibernate_image; -static grub_err_t -grub_xnu_resume_unload (void) +static VasEBoot_err_t +VasEBoot_xnu_resume_unload (void) { /* Free loaded image */ - if (grub_xnu_hibernate_image) - grub_free (grub_xnu_hibernate_image); - grub_xnu_hibernate_image = 0; - grub_xnu_unlock (); - return GRUB_ERR_NONE; + if (VasEBoot_xnu_hibernate_image) + VasEBoot_free (VasEBoot_xnu_hibernate_image); + VasEBoot_xnu_hibernate_image = 0; + VasEBoot_xnu_unlock (); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_xnu_resume (char *imagename) +VasEBoot_err_t +VasEBoot_xnu_resume (char *imagename) { - grub_file_t file; - grub_size_t total_header_size; - struct grub_xnu_hibernate_header hibhead; + VasEBoot_file_t file; + VasEBoot_size_t total_header_size; + struct VasEBoot_xnu_hibernate_header hibhead; void *code; void *image; - grub_uint32_t codedest; - grub_uint32_t codesize; - grub_addr_t target_image; - grub_err_t err; + VasEBoot_uint32_t codedest; + VasEBoot_uint32_t codesize; + VasEBoot_addr_t target_image; + VasEBoot_err_t err; - grub_file_filter_disable_compression (); - file = grub_file_open (imagename); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (imagename); if (! file) return 0; /* Read the header. */ - if (grub_file_read (file, &hibhead, sizeof (hibhead)) + if (VasEBoot_file_read (file, &hibhead, sizeof (hibhead)) != sizeof (hibhead)) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_READ_ERROR, + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("premature end of file %s"), imagename); - return grub_errno; + return VasEBoot_errno; } /* Check the header. */ - if (hibhead.magic != GRUB_XNU_HIBERNATE_MAGIC) + if (hibhead.magic != VasEBoot_XNU_HIBERNATE_MAGIC) { - grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, + VasEBoot_file_close (file); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "hibernate header has incorrect magic number"); } if (hibhead.encoffset) { - grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, + VasEBoot_file_close (file); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "encrypted images aren't supported yet"); } if (hibhead.image_size == 0) { - grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, + VasEBoot_file_close (file); + return VasEBoot_error (VasEBoot_ERR_BAD_OS, "hibernate image is empty"); } codedest = hibhead.launchcode_target_page; - codedest *= GRUB_XNU_PAGESIZE; + codedest *= VasEBoot_XNU_PAGESIZE; codesize = hibhead.launchcode_numpages; - codesize *= GRUB_XNU_PAGESIZE; + codesize *= VasEBoot_XNU_PAGESIZE; /* FIXME: check that codedest..codedest+codesize is available. */ @@ -101,41 +101,41 @@ grub_xnu_resume (char *imagename) total_header_size = hibhead.extmapsize + sizeof (hibhead); /* Unload image if any. */ - if (grub_xnu_hibernate_image) - grub_free (grub_xnu_hibernate_image); + if (VasEBoot_xnu_hibernate_image) + VasEBoot_free (VasEBoot_xnu_hibernate_image); /* Try to allocate necessary space. FIXME: mm isn't good enough yet to handle huge allocations. */ - grub_xnu_relocator = grub_relocator_new (); - if (!grub_xnu_relocator) + VasEBoot_xnu_relocator = VasEBoot_relocator_new (); + if (!VasEBoot_xnu_relocator) { - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (grub_xnu_relocator, &ch, codedest, - codesize + GRUB_XNU_PAGESIZE); + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_addr (VasEBoot_xnu_relocator, &ch, codedest, + codesize + VasEBoot_XNU_PAGESIZE); if (err) { - grub_file_close (file); + VasEBoot_file_close (file); return err; } code = get_virtual_current_address (ch); } { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (grub_xnu_relocator, &ch, 0, + VasEBoot_relocator_chunk_t ch; + err = VasEBoot_relocator_alloc_chunk_align (VasEBoot_xnu_relocator, &ch, 0, (0xffffffff - hibhead.image_size) + 1, hibhead.image_size, - GRUB_XNU_PAGESIZE, - GRUB_RELOCATOR_PREFERENCE_NONE, 0); + VasEBoot_XNU_PAGESIZE, + VasEBoot_RELOCATOR_PREFERENCE_NONE, 0); if (err) { - grub_file_close (file); + VasEBoot_file_close (file); return err; } image = get_virtual_current_address (ch); @@ -143,46 +143,46 @@ grub_xnu_resume (char *imagename) } /* Read code part. */ - if (grub_file_seek (file, total_header_size) == (grub_off_t) -1 - || grub_file_read (file, code, codesize) - != (grub_ssize_t) codesize) + if (VasEBoot_file_seek (file, total_header_size) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (file, code, codesize) + != (VasEBoot_ssize_t) codesize) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_READ_ERROR, + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("premature end of file %s"), imagename); - return grub_errno; + return VasEBoot_errno; } /* Read image. */ - if (grub_file_seek (file, 0) == (grub_off_t) -1 - || grub_file_read (file, image, hibhead.image_size) - != (grub_ssize_t) hibhead.image_size) + if (VasEBoot_file_seek (file, 0) == (VasEBoot_off_t) -1 + || VasEBoot_file_read (file, image, hibhead.image_size) + != (VasEBoot_ssize_t) hibhead.image_size) { - grub_file_close (file); - if (!grub_errno) - grub_error (GRUB_ERR_READ_ERROR, + VasEBoot_file_close (file); + if (!VasEBoot_errno) + VasEBoot_error (VasEBoot_ERR_READ_ERROR, N_("premature end of file %s"), imagename); - return grub_errno; + return VasEBoot_errno; } - grub_file_close (file); + VasEBoot_file_close (file); /* Setup variables needed by asm helper. */ - grub_xnu_heap_target_start = codedest; - grub_xnu_heap_size = target_image + hibhead.image_size - codedest; - grub_xnu_stack = (codedest + hibhead.stack); - grub_xnu_entry_point = (codedest + hibhead.entry_point); - grub_xnu_arg1 = target_image; + VasEBoot_xnu_heap_target_start = codedest; + VasEBoot_xnu_heap_size = target_image + hibhead.image_size - codedest; + VasEBoot_xnu_stack = (codedest + hibhead.stack); + VasEBoot_xnu_entry_point = (codedest + hibhead.entry_point); + VasEBoot_xnu_arg1 = target_image; - grub_dprintf ("xnu", "entry point 0x%x\n", codedest + hibhead.entry_point); - grub_dprintf ("xnu", "image at 0x%x\n", - codedest + codesize + GRUB_XNU_PAGESIZE); + VasEBoot_dprintf ("xnu", "entry point 0x%x\n", codedest + hibhead.entry_point); + VasEBoot_dprintf ("xnu", "image at 0x%x\n", + codedest + codesize + VasEBoot_XNU_PAGESIZE); /* We're ready now. */ - grub_loader_set (grub_xnu_boot_resume, - grub_xnu_resume_unload, 0); + VasEBoot_loader_set (VasEBoot_xnu_boot_resume, + VasEBoot_xnu_resume_unload, 0); /* Prevent module from unloading. */ - grub_xnu_lock (); - return GRUB_ERR_NONE; + VasEBoot_xnu_lock (); + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/mmap/efi/mmap.c b/VasEBoot-core/mmap/efi/mmap.c index bd495a184..cd2ccaba3 100644 --- a/VasEBoot-core/mmap/efi/mmap.c +++ b/VasEBoot-core/mmap/efi/mmap.c @@ -1,185 +1,185 @@ /* Mmap management. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ - ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + ((VasEBoot_efi_memory_descriptor_t *) ((char *) (desc) + (size))) -grub_err_t -grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, +VasEBoot_err_t +VasEBoot_efi_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data, int avoid_efi_boot_services) { - grub_efi_uintn_t mmap_size = 0; - grub_efi_memory_descriptor_t *map_buf = 0; - grub_efi_uintn_t map_key = 0; - grub_efi_uintn_t desc_size = 0; - grub_efi_uint32_t desc_version = 0; - grub_efi_memory_descriptor_t *desc; + VasEBoot_efi_uintn_t mmap_size = 0; + VasEBoot_efi_memory_descriptor_t *map_buf = 0; + VasEBoot_efi_uintn_t map_key = 0; + VasEBoot_efi_uintn_t desc_size = 0; + VasEBoot_efi_uint32_t desc_version = 0; + VasEBoot_efi_memory_descriptor_t *desc; - if (grub_efi_get_memory_map (&mmap_size, map_buf, + if (VasEBoot_efi_get_memory_map (&mmap_size, map_buf, &map_key, &desc_size, &desc_version) < 0) - return grub_errno; + return VasEBoot_errno; - map_buf = grub_malloc (mmap_size); + map_buf = VasEBoot_malloc (mmap_size); if (! map_buf) - return grub_errno; + return VasEBoot_errno; - if (grub_efi_get_memory_map (&mmap_size, map_buf, + if (VasEBoot_efi_get_memory_map (&mmap_size, map_buf, &map_key, &desc_size, &desc_version) <= 0) { - grub_free (map_buf); - return grub_errno; + VasEBoot_free (map_buf); + return VasEBoot_errno; } for (desc = map_buf; desc < NEXT_MEMORY_DESCRIPTOR (map_buf, mmap_size); desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { - grub_dprintf ("mmap", "EFI memory region 0x%llx-0x%llx: %d\n", + VasEBoot_dprintf ("mmap", "EFI memory region 0x%llx-0x%llx: %d\n", (unsigned long long) desc->physical_start, (unsigned long long) desc->physical_start + desc->num_pages * 4096, desc->type); switch (desc->type) { - case GRUB_EFI_BOOT_SERVICES_CODE: + case VasEBoot_EFI_BOOT_SERVICES_CODE: if (!avoid_efi_boot_services) { hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_AVAILABLE, hook_data); + VasEBoot_MEMORY_AVAILABLE, hook_data); break; } /* FALLTHROUGH */ - case GRUB_EFI_RUNTIME_SERVICES_CODE: + case VasEBoot_EFI_RUNTIME_SERVICES_CODE: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_CODE, hook_data); + VasEBoot_MEMORY_CODE, hook_data); break; - case GRUB_EFI_UNUSABLE_MEMORY: + case VasEBoot_EFI_UNUSABLE_MEMORY: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_BADRAM, hook_data); + VasEBoot_MEMORY_BADRAM, hook_data); break; - case GRUB_EFI_BOOT_SERVICES_DATA: + case VasEBoot_EFI_BOOT_SERVICES_DATA: if (!avoid_efi_boot_services) { hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_AVAILABLE, hook_data); + VasEBoot_MEMORY_AVAILABLE, hook_data); break; } /* FALLTHROUGH */ - case GRUB_EFI_RESERVED_MEMORY_TYPE: - case GRUB_EFI_RUNTIME_SERVICES_DATA: - case GRUB_EFI_MEMORY_MAPPED_IO: - case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: - case GRUB_EFI_PAL_CODE: + case VasEBoot_EFI_RESERVED_MEMORY_TYPE: + case VasEBoot_EFI_RUNTIME_SERVICES_DATA: + case VasEBoot_EFI_MEMORY_MAPPED_IO: + case VasEBoot_EFI_MEMORY_MAPPED_IO_PORT_SPACE: + case VasEBoot_EFI_PAL_CODE: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_RESERVED, hook_data); + VasEBoot_MEMORY_RESERVED, hook_data); break; - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: - case GRUB_EFI_CONVENTIONAL_MEMORY: + case VasEBoot_EFI_LOADER_CODE: + case VasEBoot_EFI_LOADER_DATA: + case VasEBoot_EFI_CONVENTIONAL_MEMORY: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_AVAILABLE, hook_data); + VasEBoot_MEMORY_AVAILABLE, hook_data); break; - case GRUB_EFI_ACPI_RECLAIM_MEMORY: + case VasEBoot_EFI_ACPI_RECLAIM_MEMORY: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_ACPI, hook_data); + VasEBoot_MEMORY_ACPI, hook_data); break; - case GRUB_EFI_ACPI_MEMORY_NVS: + case VasEBoot_EFI_ACPI_MEMORY_NVS: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_NVS, hook_data); + VasEBoot_MEMORY_NVS, hook_data); break; - case GRUB_EFI_PERSISTENT_MEMORY: + case VasEBoot_EFI_PERSISTENT_MEMORY: hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_PERSISTENT, hook_data); + VasEBoot_MEMORY_PERSISTENT, hook_data); break; default: - grub_printf ("Unknown memory type %d, considering reserved\n", + VasEBoot_printf ("Unknown memory type %d, considering reserved\n", desc->type); hook (desc->physical_start, desc->num_pages * 4096, - GRUB_MEMORY_RESERVED, hook_data); + VasEBoot_MEMORY_RESERVED, hook_data); break; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { - return grub_efi_mmap_iterate (hook, hook_data, 0); + return VasEBoot_efi_mmap_iterate (hook, hook_data, 0); } -static inline grub_efi_memory_type_t +static inline VasEBoot_efi_memory_type_t make_efi_memtype (int type) { switch (type) { - case GRUB_MEMORY_CODE: - return GRUB_EFI_RUNTIME_SERVICES_CODE; + case VasEBoot_MEMORY_CODE: + return VasEBoot_EFI_RUNTIME_SERVICES_CODE; /* No way to remove a chunk of memory from EFI mmap. So mark it as unusable. */ - case GRUB_MEMORY_HOLE: + case VasEBoot_MEMORY_HOLE: /* - * AllocatePages() does not support GRUB_EFI_PERSISTENT_MEMORY, - * so no translation for GRUB_MEMORY_PERSISTENT or - * GRUB_MEMORY_PERSISTENT_LEGACY. + * AllocatePages() does not support VasEBoot_EFI_PERSISTENT_MEMORY, + * so no translation for VasEBoot_MEMORY_PERSISTENT or + * VasEBoot_MEMORY_PERSISTENT_LEGACY. */ - case GRUB_MEMORY_PERSISTENT: - case GRUB_MEMORY_PERSISTENT_LEGACY: - case GRUB_MEMORY_RESERVED: - return GRUB_EFI_UNUSABLE_MEMORY; + case VasEBoot_MEMORY_PERSISTENT: + case VasEBoot_MEMORY_PERSISTENT_LEGACY: + case VasEBoot_MEMORY_RESERVED: + return VasEBoot_EFI_UNUSABLE_MEMORY; - case GRUB_MEMORY_AVAILABLE: - return GRUB_EFI_CONVENTIONAL_MEMORY; + case VasEBoot_MEMORY_AVAILABLE: + return VasEBoot_EFI_CONVENTIONAL_MEMORY; - case GRUB_MEMORY_ACPI: - return GRUB_EFI_ACPI_RECLAIM_MEMORY; + case VasEBoot_MEMORY_ACPI: + return VasEBoot_EFI_ACPI_RECLAIM_MEMORY; - case GRUB_MEMORY_NVS: - return GRUB_EFI_ACPI_MEMORY_NVS; + case VasEBoot_MEMORY_NVS: + return VasEBoot_EFI_ACPI_MEMORY_NVS; } - return GRUB_EFI_UNUSABLE_MEMORY; + return VasEBoot_EFI_UNUSABLE_MEMORY; } struct overlay { struct overlay *next; - grub_efi_physical_address_t address; - grub_efi_uintn_t pages; + VasEBoot_efi_physical_address_t address; + VasEBoot_efi_uintn_t pages; int handle; }; @@ -187,33 +187,33 @@ static struct overlay *overlays = 0; static int curhandle = 1; int -grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) +VasEBoot_mmap_register (VasEBoot_uint64_t start, VasEBoot_uint64_t size, int type) { - grub_uint64_t end = start + size; - grub_efi_physical_address_t address; - grub_efi_boot_services_t *b; - grub_efi_uintn_t pages; - grub_efi_status_t status; + VasEBoot_uint64_t end = start + size; + VasEBoot_efi_physical_address_t address; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_uintn_t pages; + VasEBoot_efi_status_t status; struct overlay *curover; - curover = (struct overlay *) grub_malloc (sizeof (struct overlay)); + curover = (struct overlay *) VasEBoot_malloc (sizeof (struct overlay)); if (! curover) return 0; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; address = start & (~0xfffULL); pages = (end - address + 0xfff) >> 12; status = efi_call_2 (b->free_pages, address, pages); - if (status != GRUB_EFI_SUCCESS && status != GRUB_EFI_NOT_FOUND) + if (status != VasEBoot_EFI_SUCCESS && status != VasEBoot_EFI_NOT_FOUND) { - grub_free (curover); + VasEBoot_free (curover); return 0; } - status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS, + status = efi_call_4 (b->allocate_pages, VasEBoot_EFI_ALLOCATE_ADDRESS, make_efi_memtype (type), pages, &address); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - grub_free (curover); + VasEBoot_free (curover); return 0; } curover->next = overlays; @@ -225,13 +225,13 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) return curover->handle; } -grub_err_t -grub_mmap_unregister (int handle) +VasEBoot_err_t +VasEBoot_mmap_unregister (int handle) { struct overlay *curover, *prevover; - grub_efi_boot_services_t *b; + VasEBoot_efi_boot_services_t *b; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; for (curover = overlays, prevover = 0; curover; @@ -244,48 +244,48 @@ grub_mmap_unregister (int handle) prevover->next = curover->next; else overlays = curover->next; - grub_free (curover); - return GRUB_ERR_NONE; + VasEBoot_free (curover); + return VasEBoot_ERR_NONE; } } - return grub_error (GRUB_ERR_BUG, "handle %d not found", handle); + return VasEBoot_error (VasEBoot_ERR_BUG, "handle %d not found", handle); } /* Result is always page-aligned. */ void * -grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), - grub_uint64_t size, +VasEBoot_mmap_malign_and_register (VasEBoot_uint64_t align __attribute__ ((unused)), + VasEBoot_uint64_t size, int *handle, int type, int flags __attribute__ ((unused))) { - grub_efi_physical_address_t address; - grub_efi_boot_services_t *b; - grub_efi_uintn_t pages; - grub_efi_status_t status; + VasEBoot_efi_physical_address_t address; + VasEBoot_efi_boot_services_t *b; + VasEBoot_efi_uintn_t pages; + VasEBoot_efi_status_t status; struct overlay *curover; - grub_efi_allocate_type_t atype; + VasEBoot_efi_allocate_type_t atype; - curover = (struct overlay *) grub_malloc (sizeof (struct overlay)); + curover = (struct overlay *) VasEBoot_malloc (sizeof (struct overlay)); if (! curover) return 0; - b = grub_efi_system_table->boot_services; + b = VasEBoot_efi_system_table->boot_services; address = 0xffffffff; -#if GRUB_TARGET_SIZEOF_VOID_P < 8 +#if VasEBoot_TARGET_SIZEOF_VOID_P < 8 /* Limit the memory access to less than 4GB for 32-bit platforms. */ - atype = GRUB_EFI_ALLOCATE_MAX_ADDRESS; + atype = VasEBoot_EFI_ALLOCATE_MAX_ADDRESS; #else - atype = GRUB_EFI_ALLOCATE_ANY_PAGES; + atype = VasEBoot_EFI_ALLOCATE_ANY_PAGES; #endif pages = (size + 0xfff) >> 12; status = efi_call_4 (b->allocate_pages, atype, make_efi_memtype (type), pages, &address); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) { - grub_free (curover); + VasEBoot_free (curover); return 0; } @@ -296,8 +296,8 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), address = 0xffffffff; status = efi_call_4 (b->allocate_pages, atype, make_efi_memtype (type), pages, &address); - grub_efi_free_pages (0, pages); - if (status != GRUB_EFI_SUCCESS) + VasEBoot_efi_free_pages (0, pages); + if (status != VasEBoot_EFI_SUCCESS) return 0; } @@ -308,11 +308,11 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), overlays = curover; *handle = curover->handle; - return (void *) (grub_addr_t) curover->address; + return (void *) (VasEBoot_addr_t) curover->address; } void -grub_mmap_free_and_unregister (int handle) +VasEBoot_mmap_free_and_unregister (int handle) { - grub_mmap_unregister (handle); + VasEBoot_mmap_unregister (handle); } diff --git a/VasEBoot-core/mmap/i386/mmap.c b/VasEBoot-core/mmap/i386/mmap.c index ac45f705d..20418349b 100644 --- a/VasEBoot-core/mmap/i386/mmap.c +++ b/VasEBoot-core/mmap/i386/mmap.c @@ -1,47 +1,47 @@ /* Mmap management. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE -/* Context for grub_mmap_malign_and_register. */ -struct grub_mmap_malign_and_register_ctx +/* Context for VasEBoot_mmap_malign_and_register. */ +struct VasEBoot_mmap_malign_and_register_ctx { - grub_uint64_t align, size, highestlow; + VasEBoot_uint64_t align, size, highestlow; }; -/* Helper for grub_mmap_malign_and_register. */ +/* Helper for VasEBoot_mmap_malign_and_register. */ static int -find_hook (grub_uint64_t start, grub_uint64_t rangesize, - grub_memory_type_t memtype, void *data) +find_hook (VasEBoot_uint64_t start, VasEBoot_uint64_t rangesize, + VasEBoot_memory_type_t memtype, void *data) { - struct grub_mmap_malign_and_register_ctx *ctx = data; - grub_uint64_t end = start + rangesize; + struct VasEBoot_mmap_malign_and_register_ctx *ctx = data; + VasEBoot_uint64_t end = start + rangesize; - if (memtype != GRUB_MEMORY_AVAILABLE) + if (memtype != VasEBoot_MEMORY_AVAILABLE) return 0; if (end > 0x100000) end = 0x100000; @@ -54,24 +54,24 @@ find_hook (grub_uint64_t start, grub_uint64_t rangesize, } void * -grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, +VasEBoot_mmap_malign_and_register (VasEBoot_uint64_t align, VasEBoot_uint64_t size, int *handle, int type, int flags) { - struct grub_mmap_malign_and_register_ctx ctx = { + struct VasEBoot_mmap_malign_and_register_ctx ctx = { .align = align, .size = size, .highestlow = 0 }; void *ret; - if (flags & GRUB_MMAP_MALLOC_LOW) + if (flags & VasEBoot_MMAP_MALLOC_LOW) { /* FIXME: use low-memory mm allocation once it's available. */ - grub_mmap_iterate (find_hook, &ctx); - ret = (void *) (grub_addr_t) ctx.highestlow; + VasEBoot_mmap_iterate (find_hook, &ctx); + ret = (void *) (VasEBoot_addr_t) ctx.highestlow; } else - ret = grub_memalign (align, size); + ret = VasEBoot_memalign (align, size); if (! ret) { @@ -79,10 +79,10 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, return 0; } - *handle = grub_mmap_register ((grub_addr_t) ret, size, type); + *handle = VasEBoot_mmap_register ((VasEBoot_addr_t) ret, size, type); if (! *handle) { - grub_free (ret); + VasEBoot_free (ret); return 0; } @@ -90,12 +90,12 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, } void -grub_mmap_free_and_unregister (int handle) +VasEBoot_mmap_free_and_unregister (int handle) { - struct grub_mmap_region *cur; - grub_uint64_t addr; + struct VasEBoot_mmap_region *cur; + VasEBoot_uint64_t addr; - for (cur = grub_mmap_overlays; cur; cur = cur->next) + for (cur = VasEBoot_mmap_overlays; cur; cur = cur->next) if (cur->handle == handle) break; @@ -104,10 +104,10 @@ grub_mmap_free_and_unregister (int handle) addr = cur->start; - grub_mmap_unregister (handle); + VasEBoot_mmap_unregister (handle); if (addr >= 0x100000) - grub_free ((void *) (grub_addr_t) addr); + VasEBoot_free ((void *) (VasEBoot_addr_t) addr); } #endif diff --git a/VasEBoot-core/mmap/i386/pc/mmap.c b/VasEBoot-core/mmap/i386/pc/mmap.c index 609994516..883acc650 100644 --- a/VasEBoot-core/mmap/i386/pc/mmap.c +++ b/VasEBoot-core/mmap/i386/pc/mmap.c @@ -1,61 +1,61 @@ /* Mmap management. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define min(a,b) (((a) < (b)) ? (a) : (b)) static void *hooktarget = 0; -extern grub_uint8_t grub_machine_mmaphook_start; -extern grub_uint8_t grub_machine_mmaphook_end; -extern grub_uint8_t grub_machine_mmaphook_int12; -extern grub_uint8_t grub_machine_mmaphook_int15; +extern VasEBoot_uint8_t VasEBoot_machine_mmaphook_start; +extern VasEBoot_uint8_t VasEBoot_machine_mmaphook_end; +extern VasEBoot_uint8_t VasEBoot_machine_mmaphook_int12; +extern VasEBoot_uint8_t VasEBoot_machine_mmaphook_int15; -static grub_uint16_t grub_machine_mmaphook_int12offset = 0; -static grub_uint16_t grub_machine_mmaphook_int12segment = 0; -extern grub_uint16_t grub_machine_mmaphook_int15offset; -extern grub_uint16_t grub_machine_mmaphook_int15segment; +static VasEBoot_uint16_t VasEBoot_machine_mmaphook_int12offset = 0; +static VasEBoot_uint16_t VasEBoot_machine_mmaphook_int12segment = 0; +extern VasEBoot_uint16_t VasEBoot_machine_mmaphook_int15offset; +extern VasEBoot_uint16_t VasEBoot_machine_mmaphook_int15segment; -extern grub_uint16_t grub_machine_mmaphook_mmap_num; -extern grub_uint16_t grub_machine_mmaphook_kblow; -extern grub_uint16_t grub_machine_mmaphook_kbin16mb; -extern grub_uint16_t grub_machine_mmaphook_64kbin4gb; +extern VasEBoot_uint16_t VasEBoot_machine_mmaphook_mmap_num; +extern VasEBoot_uint16_t VasEBoot_machine_mmaphook_kblow; +extern VasEBoot_uint16_t VasEBoot_machine_mmaphook_kbin16mb; +extern VasEBoot_uint16_t VasEBoot_machine_mmaphook_64kbin4gb; -struct grub_e820_mmap_entry +struct VasEBoot_e820_mmap_entry { - grub_uint64_t addr; - grub_uint64_t len; - grub_uint32_t type; -} GRUB_PACKED; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t len; + VasEBoot_uint32_t type; +} VasEBoot_PACKED; /* Helper for preboot. */ -static int fill_hook (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type, void *data) +static int fill_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type, void *data) { - struct grub_e820_mmap_entry **hookmmapcur = data; - grub_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size, type); + struct VasEBoot_e820_mmap_entry **hookmmapcur = data; + VasEBoot_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size, type); (*hookmmapcur)->addr = addr; (*hookmmapcur)->len = size; (*hookmmapcur)->type = type; @@ -63,79 +63,79 @@ static int fill_hook (grub_uint64_t addr, grub_uint64_t size, return 0; } -static grub_err_t +static VasEBoot_err_t preboot (int noreturn __attribute__ ((unused))) { - struct grub_e820_mmap_entry *hookmmap, *hookmmapcur; + struct VasEBoot_e820_mmap_entry *hookmmap, *hookmmapcur; if (! hooktarget) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "no space is allocated for memory hook"); - grub_dprintf ("mmap", "installing preboot handlers\n"); + VasEBoot_dprintf ("mmap", "installing preboot handlers\n"); - hookmmapcur = hookmmap = (struct grub_e820_mmap_entry *) - ((grub_uint8_t *) hooktarget + (&grub_machine_mmaphook_end - - &grub_machine_mmaphook_start)); + hookmmapcur = hookmmap = (struct VasEBoot_e820_mmap_entry *) + ((VasEBoot_uint8_t *) hooktarget + (&VasEBoot_machine_mmaphook_end + - &VasEBoot_machine_mmaphook_start)); - grub_mmap_iterate (fill_hook, &hookmmapcur); - grub_machine_mmaphook_mmap_num = hookmmapcur - hookmmap; + VasEBoot_mmap_iterate (fill_hook, &hookmmapcur); + VasEBoot_machine_mmaphook_mmap_num = hookmmapcur - hookmmap; - grub_machine_mmaphook_kblow = grub_mmap_get_lower () >> 10; - grub_machine_mmaphook_kbin16mb - = min (grub_mmap_get_upper (),0x3f00000ULL) >> 10; - grub_machine_mmaphook_64kbin4gb - = min (grub_mmap_get_post64 (), 0xfc000000ULL) >> 16; + VasEBoot_machine_mmaphook_kblow = VasEBoot_mmap_get_lower () >> 10; + VasEBoot_machine_mmaphook_kbin16mb + = min (VasEBoot_mmap_get_upper (),0x3f00000ULL) >> 10; + VasEBoot_machine_mmaphook_64kbin4gb + = min (VasEBoot_mmap_get_post64 (), 0xfc000000ULL) >> 16; /* Correct BDA. */ - *((grub_uint16_t *) 0x413) = grub_mmap_get_lower () >> 10; + *((VasEBoot_uint16_t *) 0x413) = VasEBoot_mmap_get_lower () >> 10; /* Save old interrupt handlers. */ - grub_machine_mmaphook_int12offset = *((grub_uint16_t *) 0x48); - grub_machine_mmaphook_int12segment = *((grub_uint16_t *) 0x4a); - grub_machine_mmaphook_int15offset = *((grub_uint16_t *) 0x54); - grub_machine_mmaphook_int15segment = *((grub_uint16_t *) 0x56); + VasEBoot_machine_mmaphook_int12offset = *((VasEBoot_uint16_t *) 0x48); + VasEBoot_machine_mmaphook_int12segment = *((VasEBoot_uint16_t *) 0x4a); + VasEBoot_machine_mmaphook_int15offset = *((VasEBoot_uint16_t *) 0x54); + VasEBoot_machine_mmaphook_int15segment = *((VasEBoot_uint16_t *) 0x56); - grub_dprintf ("mmap", "hooktarget = %p\n", hooktarget); + VasEBoot_dprintf ("mmap", "hooktarget = %p\n", hooktarget); /* Install the interrupt handlers. */ - grub_memcpy (hooktarget, &grub_machine_mmaphook_start, - &grub_machine_mmaphook_end - &grub_machine_mmaphook_start); + VasEBoot_memcpy (hooktarget, &VasEBoot_machine_mmaphook_start, + &VasEBoot_machine_mmaphook_end - &VasEBoot_machine_mmaphook_start); - *((grub_uint16_t *) 0x4a) = ((grub_addr_t) hooktarget) >> 4; - *((grub_uint16_t *) 0x56) = ((grub_addr_t) hooktarget) >> 4; - *((grub_uint16_t *) 0x48) = &grub_machine_mmaphook_int12 - - &grub_machine_mmaphook_start; - *((grub_uint16_t *) 0x54) = &grub_machine_mmaphook_int15 - - &grub_machine_mmaphook_start; + *((VasEBoot_uint16_t *) 0x4a) = ((VasEBoot_addr_t) hooktarget) >> 4; + *((VasEBoot_uint16_t *) 0x56) = ((VasEBoot_addr_t) hooktarget) >> 4; + *((VasEBoot_uint16_t *) 0x48) = &VasEBoot_machine_mmaphook_int12 + - &VasEBoot_machine_mmaphook_start; + *((VasEBoot_uint16_t *) 0x54) = &VasEBoot_machine_mmaphook_int15 + - &VasEBoot_machine_mmaphook_start; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t preboot_rest (void) { /* Restore old interrupt handlers. */ - *((grub_uint16_t *) 0x48) = grub_machine_mmaphook_int12offset; - *((grub_uint16_t *) 0x4a) = grub_machine_mmaphook_int12segment; - *((grub_uint16_t *) 0x54) = grub_machine_mmaphook_int15offset; - *((grub_uint16_t *) 0x56) = grub_machine_mmaphook_int15segment; + *((VasEBoot_uint16_t *) 0x48) = VasEBoot_machine_mmaphook_int12offset; + *((VasEBoot_uint16_t *) 0x4a) = VasEBoot_machine_mmaphook_int12segment; + *((VasEBoot_uint16_t *) 0x54) = VasEBoot_machine_mmaphook_int15offset; + *((VasEBoot_uint16_t *) 0x56) = VasEBoot_machine_mmaphook_int15segment; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Helper for malloc_hook. */ static int -count_hook (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - grub_memory_type_t type __attribute__ ((unused)), void *data) +count_hook (VasEBoot_uint64_t addr __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { int *regcount = data; (*regcount)++; return 0; } -static grub_err_t +static VasEBoot_err_t malloc_hook (void) { static int reentry = 0; @@ -145,56 +145,56 @@ malloc_hook (void) int regcount = 0; if (reentry) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - grub_dprintf ("mmap", "registering\n"); + VasEBoot_dprintf ("mmap", "registering\n"); - grub_mmap_iterate (count_hook, ®count); + VasEBoot_mmap_iterate (count_hook, ®count); /* Mapping hook itself may introduce up to 2 additional regions. */ regcount += 2; if (regcount <= slots_available) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (mmapregion) { - grub_mmap_free_and_unregister (mmapregion); + VasEBoot_mmap_free_and_unregister (mmapregion); mmapregion = 0; hooktarget = 0; } - hooksize = &grub_machine_mmaphook_end - &grub_machine_mmaphook_start - + regcount * sizeof (struct grub_e820_mmap_entry); + hooksize = &VasEBoot_machine_mmaphook_end - &VasEBoot_machine_mmaphook_start + + regcount * sizeof (struct VasEBoot_e820_mmap_entry); /* Allocate an integer number of KiB. */ hooksize = ((hooksize - 1) | 0x3ff) + 1; - slots_available = (hooksize - (&grub_machine_mmaphook_end - - &grub_machine_mmaphook_start)) - / sizeof (struct grub_e820_mmap_entry); + slots_available = (hooksize - (&VasEBoot_machine_mmaphook_end + - &VasEBoot_machine_mmaphook_start)) + / sizeof (struct VasEBoot_e820_mmap_entry); reentry = 1; hooktarget - = grub_mmap_malign_and_register (16, ALIGN_UP (hooksize, 16), &mmapregion, - GRUB_MEMORY_RESERVED, - GRUB_MMAP_MALLOC_LOW); + = VasEBoot_mmap_malign_and_register (16, ALIGN_UP (hooksize, 16), &mmapregion, + VasEBoot_MEMORY_RESERVED, + VasEBoot_MMAP_MALLOC_LOW); reentry = 0; if (! hooktarget) { slots_available = 0; - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "no space for mmap hook"); + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, "no space for mmap hook"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), +VasEBoot_err_t +VasEBoot_machine_mmap_register (VasEBoot_uint64_t start __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { - grub_err_t err; - static struct grub_preboot *preb_handle = 0; + VasEBoot_err_t err; + static struct VasEBoot_preboot *preb_handle = 0; err = malloc_hook (); if (err) @@ -202,18 +202,18 @@ grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), if (! preb_handle) { - grub_dprintf ("mmap", "adding preboot\n"); + VasEBoot_dprintf ("mmap", "adding preboot\n"); preb_handle - = grub_loader_register_preboot_hook (preboot, preboot_rest, - GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY); + = VasEBoot_loader_register_preboot_hook (preboot, preboot_rest, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_MEMORY); if (! preb_handle) - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_machine_mmap_unregister (int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/mmap/i386/pc/mmap_helper.S b/VasEBoot-core/mmap/i386/pc/mmap_helper.S index 8e251a1f8..fbcf943e0 100644 --- a/VasEBoot-core/mmap/i386/pc/mmap_helper.S +++ b/VasEBoot-core/mmap/i386/pc/mmap_helper.S @@ -1,30 +1,30 @@ /* Mmap management. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include #define DS(x) ((x) - LOCAL (segstart)) LOCAL (segstart): -VARIABLE(grub_machine_mmaphook_start) +VARIABLE(VasEBoot_machine_mmaphook_start) .code16 -VARIABLE(grub_machine_mmaphook_int12) +VARIABLE(VasEBoot_machine_mmaphook_int12) push %ds push %cs pop %ds @@ -37,7 +37,7 @@ VARIABLE(grub_machine_mmaphook_int12) pop %ds iret -VARIABLE(grub_machine_mmaphook_int15) +VARIABLE(VasEBoot_machine_mmaphook_int15) pushf cmpw $0xe801, %ax jz LOCAL (e801) @@ -48,9 +48,9 @@ VARIABLE(grub_machine_mmaphook_int15) popf /* ljmp */ .byte 0xea -VARIABLE (grub_machine_mmaphook_int15offset) +VARIABLE (VasEBoot_machine_mmaphook_int15offset) .word 0 -VARIABLE (grub_machine_mmaphook_int15segment) +VARIABLE (VasEBoot_machine_mmaphook_int15segment) .word 0 LOCAL (e801): @@ -145,19 +145,19 @@ LOCAL (iret_cf): pop %bp iret -VARIABLE(grub_machine_mmaphook_mmap_num) +VARIABLE(VasEBoot_machine_mmaphook_mmap_num) LOCAL (mmap_num): .word 0 -VARIABLE(grub_machine_mmaphook_kblow) +VARIABLE(VasEBoot_machine_mmaphook_kblow) LOCAL (kblow): .word 0 -VARIABLE (grub_machine_mmaphook_kbin16mb) +VARIABLE (VasEBoot_machine_mmaphook_kbin16mb) LOCAL (kbin16mb): .word 0 -VARIABLE (grub_machine_mmaphook_64kbin4gb) +VARIABLE (VasEBoot_machine_mmaphook_64kbin4gb) LOCAL (m64kbin4gb): .word 0 LOCAL (mmaphook_mmap): /* Memory map is placed just after the interrupt handlers. */ -VARIABLE(grub_machine_mmaphook_end) +VARIABLE(VasEBoot_machine_mmaphook_end) .byte 0 diff --git a/VasEBoot-core/mmap/i386/uppermem.c b/VasEBoot-core/mmap/i386/uppermem.c index a6be9896d..9ee55fc71 100644 --- a/VasEBoot-core/mmap/i386/uppermem.c +++ b/VasEBoot-core/mmap/i386/uppermem.c @@ -1,37 +1,37 @@ /* Compute amount of lower and upper memory till the first hole. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -/* Helper for grub_mmap_get_lower. */ +/* Helper for VasEBoot_mmap_get_lower. */ static int -lower_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +lower_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *lower = data; + VasEBoot_uint64_t *lower = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; -#ifdef GRUB_MACHINE_COREBOOT +#ifdef VasEBoot_MACHINE_COREBOOT if (addr <= 0x1000) #else if (addr == 0) @@ -40,47 +40,47 @@ lower_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, return 0; } -grub_uint64_t -grub_mmap_get_lower (void) +VasEBoot_uint64_t +VasEBoot_mmap_get_lower (void) { - grub_uint64_t lower = 0; + VasEBoot_uint64_t lower = 0; - grub_mmap_iterate (lower_hook, &lower); + VasEBoot_mmap_iterate (lower_hook, &lower); if (lower > 0x100000) lower = 0x100000; return lower; } -/* Helper for grub_mmap_get_upper. */ +/* Helper for VasEBoot_mmap_get_upper. */ static int -upper_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +upper_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *upper = data; + VasEBoot_uint64_t *upper = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; if (addr <= 0x100000 && addr + size > 0x100000) *upper = addr + size - 0x100000; return 0; } -grub_uint64_t -grub_mmap_get_upper (void) +VasEBoot_uint64_t +VasEBoot_mmap_get_upper (void) { - grub_uint64_t upper = 0; + VasEBoot_uint64_t upper = 0; - grub_mmap_iterate (upper_hook, &upper); + VasEBoot_mmap_iterate (upper_hook, &upper); return upper; } -/* Helper for grub_mmap_get_post64. */ +/* Helper for VasEBoot_mmap_get_post64. */ static int -post64_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +post64_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *post64 = data; - if (type != GRUB_MEMORY_AVAILABLE) + VasEBoot_uint64_t *post64 = data; + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; if (addr <= 0x4000000 && addr + size > 0x4000000) *post64 = addr + size - 0x4000000; @@ -88,11 +88,11 @@ post64_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, } /* Count the continuous bytes after 64 MiB. */ -grub_uint64_t -grub_mmap_get_post64 (void) +VasEBoot_uint64_t +VasEBoot_mmap_get_post64 (void) { - grub_uint64_t post64 = 0; + VasEBoot_uint64_t post64 = 0; - grub_mmap_iterate (post64_hook, &post64); + VasEBoot_mmap_iterate (post64_hook, &post64); return post64; } diff --git a/VasEBoot-core/mmap/mips/uppermem.c b/VasEBoot-core/mmap/mips/uppermem.c index a980e0719..76920b362 100644 --- a/VasEBoot-core/mmap/mips/uppermem.c +++ b/VasEBoot-core/mmap/mips/uppermem.c @@ -1,72 +1,72 @@ /* Compute amount of lower and upper memory till the first hole. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -/* Helper for grub_mmap_get_lower. */ +/* Helper for VasEBoot_mmap_get_lower. */ static int -lower_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +lower_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *lower = data; + VasEBoot_uint64_t *lower = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; if (addr == 0) *lower = size; return 0; } -grub_uint64_t -grub_mmap_get_lower (void) +VasEBoot_uint64_t +VasEBoot_mmap_get_lower (void) { - grub_uint64_t lower = 0; + VasEBoot_uint64_t lower = 0; - grub_mmap_iterate (lower_hook, &lower); - if (lower > GRUB_ARCH_LOWMEMMAXSIZE) - lower = GRUB_ARCH_LOWMEMMAXSIZE; + VasEBoot_mmap_iterate (lower_hook, &lower); + if (lower > VasEBoot_ARCH_LOWMEMMAXSIZE) + lower = VasEBoot_ARCH_LOWMEMMAXSIZE; return lower; } -/* Helper for grub_mmap_get_upper. */ +/* Helper for VasEBoot_mmap_get_upper. */ static int -upper_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +upper_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - grub_uint64_t *upper = data; + VasEBoot_uint64_t *upper = data; - if (type != GRUB_MEMORY_AVAILABLE) + if (type != VasEBoot_MEMORY_AVAILABLE) return 0; - if (addr <= GRUB_ARCH_HIGHMEMPSTART && addr + size - > GRUB_ARCH_HIGHMEMPSTART) - *upper = addr + size - GRUB_ARCH_HIGHMEMPSTART; + if (addr <= VasEBoot_ARCH_HIGHMEMPSTART && addr + size + > VasEBoot_ARCH_HIGHMEMPSTART) + *upper = addr + size - VasEBoot_ARCH_HIGHMEMPSTART; return 0; } -grub_uint64_t -grub_mmap_get_upper (void) +VasEBoot_uint64_t +VasEBoot_mmap_get_upper (void) { - grub_uint64_t upper = 0; + VasEBoot_uint64_t upper = 0; - grub_mmap_iterate (upper_hook, &upper); + VasEBoot_mmap_iterate (upper_hook, &upper); return upper; } diff --git a/VasEBoot-core/mmap/mmap.c b/VasEBoot-core/mmap/mmap.c index 6a31cbae3..293f32fe3 100644 --- a/VasEBoot-core/mmap/mmap.c +++ b/VasEBoot-core/mmap/mmap.c @@ -1,36 +1,36 @@ /* Mmap management. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE -struct grub_mmap_region *grub_mmap_overlays = 0; +struct VasEBoot_mmap_region *VasEBoot_mmap_overlays = 0; static int curhandle = 1; #endif @@ -38,30 +38,30 @@ static int curhandle = 1; static int current_priority = 1; /* Scanline events. */ -struct grub_mmap_scan +struct VasEBoot_mmap_scan { /* At which memory address. */ - grub_uint64_t pos; + VasEBoot_uint64_t pos; /* 0 = region starts, 1 = region ends. */ int type; /* Which type of memory region? */ - grub_memory_type_t memtype; + VasEBoot_memory_type_t memtype; /* Priority. 0 means coming from firmware. */ int priority; }; -/* Context for grub_mmap_iterate. */ -struct grub_mmap_iterate_ctx +/* Context for VasEBoot_mmap_iterate. */ +struct VasEBoot_mmap_iterate_ctx { - struct grub_mmap_scan *scanline_events; + struct VasEBoot_mmap_scan *scanline_events; int i; }; -/* Helper for grub_mmap_iterate. */ +/* Helper for VasEBoot_mmap_iterate. */ static int -count_hook (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - grub_memory_type_t type __attribute__ ((unused)), void *data) +count_hook (VasEBoot_uint64_t addr __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { int *mmap_num = data; @@ -69,18 +69,18 @@ count_hook (grub_uint64_t addr __attribute__ ((unused)), return 0; } -/* Helper for grub_mmap_iterate. */ +/* Helper for VasEBoot_mmap_iterate. */ static int -fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, +fill_hook (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, VasEBoot_memory_type_t type, void *data) { - struct grub_mmap_iterate_ctx *ctx = data; + struct VasEBoot_mmap_iterate_ctx *ctx = data; - if (type == GRUB_MEMORY_HOLE) + if (type == VasEBoot_MEMORY_HOLE) { - grub_dprintf ("mmap", "Unknown memory type %d. Assuming unusable\n", + VasEBoot_dprintf ("mmap", "Unknown memory type %d. Assuming unusable\n", type); - type = GRUB_MEMORY_RESERVED; + type = VasEBoot_MEMORY_RESERVED; } ctx->scanline_events[ctx->i].pos = addr; @@ -102,23 +102,23 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, struct mm_list { struct mm_list *next; - grub_memory_type_t val; + VasEBoot_memory_type_t val; int present; }; -grub_err_t -grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) +VasEBoot_err_t +VasEBoot_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data) { /* This function resolves overlapping regions and sorts the memory map. It uses scanline (sweeping) algorithm. */ - struct grub_mmap_iterate_ctx ctx; + struct VasEBoot_mmap_iterate_ctx ctx; int i, done; - struct grub_mmap_scan t; + struct VasEBoot_mmap_scan t; /* Previous scanline event. */ - grub_uint64_t lastaddr; + VasEBoot_uint64_t lastaddr; int lasttype; /* Current scanline event. */ int curtype; @@ -128,36 +128,36 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) /* Number of mmap chunks. */ int mmap_num; -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE - struct grub_mmap_region *cur; +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE + struct VasEBoot_mmap_region *cur; #endif mmap_num = 0; -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE - for (cur = grub_mmap_overlays; cur; cur = cur->next) +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE + for (cur = VasEBoot_mmap_overlays; cur; cur = cur->next) mmap_num++; #endif - grub_machine_mmap_iterate (count_hook, &mmap_num); + VasEBoot_machine_mmap_iterate (count_hook, &mmap_num); /* Initialize variables. */ - ctx.scanline_events = (struct grub_mmap_scan *) - grub_malloc (sizeof (struct grub_mmap_scan) * 2 * mmap_num); + ctx.scanline_events = (struct VasEBoot_mmap_scan *) + VasEBoot_malloc (sizeof (struct VasEBoot_mmap_scan) * 2 * mmap_num); - present = grub_zalloc (sizeof (present[0]) * current_priority); + present = VasEBoot_zalloc (sizeof (present[0]) * current_priority); if (! ctx.scanline_events || !present) { - grub_free (ctx.scanline_events); - grub_free (present); - return grub_errno; + VasEBoot_free (ctx.scanline_events); + VasEBoot_free (present); + return VasEBoot_errno; } ctx.i = 0; -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE /* Register scanline events. */ - for (cur = grub_mmap_overlays; cur; cur = cur->next) + for (cur = VasEBoot_mmap_overlays; cur; cur = cur->next) { ctx.scanline_events[ctx.i].pos = cur->start; ctx.scanline_events[ctx.i].type = 0; @@ -171,9 +171,9 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) ctx.scanline_events[ctx.i].priority = cur->priority; ctx.i++; } -#endif /* ! GRUB_MMAP_REGISTER_BY_FIRMWARE */ +#endif /* ! VasEBoot_MMAP_REGISTER_BY_FIRMWARE */ - grub_machine_mmap_iterate (fill_hook, &ctx); + VasEBoot_machine_mmap_iterate (fill_hook, &ctx); /* Primitive bubble sort. It has complexity O(n^2) but since we're unlikely to have more than 100 chunks it's probably one of the @@ -210,7 +210,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) { struct mm_list *p = present[ctx.scanline_events[i].priority].next; present[ctx.scanline_events[i].priority] = *p; - grub_free (p); + VasEBoot_free (p); } else { @@ -225,7 +225,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) { p = *q; *q = p->next; - grub_free (p); + VasEBoot_free (p); break; } } @@ -240,7 +240,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) } else { - struct mm_list *n = grub_malloc (sizeof (*n)); + struct mm_list *n = VasEBoot_malloc (sizeof (*n)); n->val = ctx.scanline_events[i].memtype; n->present = 1; n->next = present[ctx.scanline_events[i].priority].next; @@ -264,12 +264,12 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) if ((curtype == -1 || curtype != lasttype) && lastaddr != ctx.scanline_events[i].pos && lasttype != -1 - && lasttype != GRUB_MEMORY_HOLE + && lasttype != VasEBoot_MEMORY_HOLE && hook (lastaddr, ctx.scanline_events[i].pos - lastaddr, lasttype, hook_data)) { - grub_free (ctx.scanline_events); - return GRUB_ERR_NONE; + VasEBoot_free (ctx.scanline_events); + return VasEBoot_ERR_NONE; } /* Update last values if necessary. */ @@ -280,77 +280,77 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data) } } - grub_free (ctx.scanline_events); - return GRUB_ERR_NONE; + VasEBoot_free (ctx.scanline_events); + return VasEBoot_ERR_NONE; } -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE int -grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) +VasEBoot_mmap_register (VasEBoot_uint64_t start, VasEBoot_uint64_t size, int type) { - struct grub_mmap_region *cur; + struct VasEBoot_mmap_region *cur; - grub_dprintf ("mmap", "registering\n"); + VasEBoot_dprintf ("mmap", "registering\n"); - cur = (struct grub_mmap_region *) - grub_malloc (sizeof (struct grub_mmap_region)); + cur = (struct VasEBoot_mmap_region *) + VasEBoot_malloc (sizeof (struct VasEBoot_mmap_region)); if (! cur) return 0; - cur->next = grub_mmap_overlays; + cur->next = VasEBoot_mmap_overlays; cur->start = start; cur->end = start + size; cur->type = type; cur->handle = curhandle++; cur->priority = current_priority++; - grub_mmap_overlays = cur; + VasEBoot_mmap_overlays = cur; - if (grub_machine_mmap_register (start, size, type, curhandle)) + if (VasEBoot_machine_mmap_register (start, size, type, curhandle)) { - grub_mmap_overlays = cur->next; - grub_free (cur); + VasEBoot_mmap_overlays = cur->next; + VasEBoot_free (cur); return 0; } return cur->handle; } -grub_err_t -grub_mmap_unregister (int handle) +VasEBoot_err_t +VasEBoot_mmap_unregister (int handle) { - struct grub_mmap_region *cur, *prev; + struct VasEBoot_mmap_region *cur, *prev; - for (cur = grub_mmap_overlays, prev = 0; cur; prev = cur, cur = cur->next) + for (cur = VasEBoot_mmap_overlays, prev = 0; cur; prev = cur, cur = cur->next) if (handle == cur->handle) { - grub_err_t err; - err = grub_machine_mmap_unregister (handle); + VasEBoot_err_t err; + err = VasEBoot_machine_mmap_unregister (handle); if (err) return err; if (prev) prev->next = cur->next; else - grub_mmap_overlays = cur->next; - grub_free (cur); - return GRUB_ERR_NONE; + VasEBoot_mmap_overlays = cur->next; + VasEBoot_free (cur); + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_BUG, "mmap overlay not found"); + return VasEBoot_error (VasEBoot_ERR_BUG, "mmap overlay not found"); } -#endif /* ! GRUB_MMAP_REGISTER_BY_FIRMWARE */ +#endif /* ! VasEBoot_MMAP_REGISTER_BY_FIRMWARE */ #define CHUNK_SIZE 0x400 struct badram_entry { - grub_uint64_t addr, mask; + VasEBoot_uint64_t addr, mask; }; -static inline grub_uint64_t -fill_mask (struct badram_entry *entry, grub_uint64_t iterator) +static inline VasEBoot_uint64_t +fill_mask (struct badram_entry *entry, VasEBoot_uint64_t iterator) { int i, j; - grub_uint64_t ret = (entry->addr & entry->mask); + VasEBoot_uint64_t ret = (entry->addr & entry->mask); /* Find first fixed bit. */ for (i = 0; i < 64; i++) @@ -367,16 +367,16 @@ fill_mask (struct badram_entry *entry, grub_uint64_t iterator) return ret; } -/* Helper for grub_cmd_badram. */ +/* Helper for VasEBoot_cmd_badram. */ static int -badram_iter (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type __attribute__ ((unused)), void *data) +badram_iter (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { struct badram_entry *entry = data; - grub_uint64_t iterator, low, high, cur; + VasEBoot_uint64_t iterator, low, high, cur; int tail, var; int i; - grub_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr, + VasEBoot_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr, (unsigned long long) size); /* How many trailing zeros? */ @@ -412,62 +412,62 @@ badram_iter (grub_uint64_t addr, grub_uint64_t size, && (cur = fill_mask (entry, iterator)) < addr + size; iterator++) { - grub_dprintf ("badram", "%llx (size %llx) is a badram range\n", + VasEBoot_dprintf ("badram", "%llx (size %llx) is a badram range\n", (unsigned long long) cur, (1ULL << tail)); - grub_mmap_register (cur, (1ULL << tail), GRUB_MEMORY_HOLE); + VasEBoot_mmap_register (cur, (1ULL << tail), VasEBoot_MEMORY_HOLE); } return 0; } -static grub_err_t -grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_badram (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { char * str; struct badram_entry entry; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - grub_dprintf ("badram", "executing badram\n"); + VasEBoot_dprintf ("badram", "executing badram\n"); str = args[0]; while (1) { /* Parse address and mask. */ - entry.addr = grub_strtoull (str, &str, 16); + entry.addr = VasEBoot_strtoull (str, &str, 16); if (*str == ',') str++; - entry.mask = grub_strtoull (str, &str, 16); + entry.mask = VasEBoot_strtoull (str, &str, 16); if (*str == ',') str++; - if (grub_errno == GRUB_ERR_BAD_NUMBER) + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { - grub_errno = 0; - return GRUB_ERR_NONE; + VasEBoot_errno = 0; + return VasEBoot_ERR_NONE; } /* When part of a page is tainted, we discard the whole of it. There's no point in providing sub-page chunks. */ entry.mask &= ~(CHUNK_SIZE - 1); - grub_dprintf ("badram", "badram %llx:%llx\n", + VasEBoot_dprintf ("badram", "badram %llx:%llx\n", (unsigned long long) entry.addr, (unsigned long long) entry.mask); - grub_mmap_iterate (badram_iter, &entry); + VasEBoot_mmap_iterate (badram_iter, &entry); } } -static grub_uint64_t +static VasEBoot_uint64_t parsemem (const char *str) { - grub_uint64_t ret; + VasEBoot_uint64_t ret; char *ptr; - ret = grub_strtoul (str, &ptr, 0); + ret = VasEBoot_strtoul (str, &ptr, 0); switch (*ptr) { @@ -484,16 +484,16 @@ parsemem (const char *str) } struct cutmem_range { - grub_uint64_t from, to; + VasEBoot_uint64_t from, to; }; -/* Helper for grub_cmd_cutmem. */ +/* Helper for VasEBoot_cmd_cutmem. */ static int -cutmem_iter (grub_uint64_t addr, grub_uint64_t size, - grub_memory_type_t type __attribute__ ((unused)), void *data) +cutmem_iter (VasEBoot_uint64_t addr, VasEBoot_uint64_t size, + VasEBoot_memory_type_t type __attribute__ ((unused)), void *data) { struct cutmem_range *range = data; - grub_uint64_t end = addr + size; + VasEBoot_uint64_t end = addr + size; if (addr <= range->from) addr = range->from; @@ -503,49 +503,49 @@ cutmem_iter (grub_uint64_t addr, grub_uint64_t size, if (end <= addr) return 0; - grub_mmap_register (addr, end - addr, GRUB_MEMORY_HOLE); + VasEBoot_mmap_register (addr, end - addr, VasEBoot_MEMORY_HOLE); return 0; } -static grub_err_t -grub_cmd_cutmem (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cutmem (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { struct cutmem_range range; if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); range.from = parsemem (args[0]); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; range.to = parsemem (args[1]); - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; - grub_mmap_iterate (cutmem_iter, &range); + VasEBoot_mmap_iterate (cutmem_iter, &range); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_command_t cmd, cmd_cut; +static VasEBoot_command_t cmd, cmd_cut; -GRUB_MOD_INIT(mmap) +VasEBoot_MOD_INIT(mmap) { - cmd = grub_register_command ("badram", grub_cmd_badram, + cmd = VasEBoot_register_command ("badram", VasEBoot_cmd_badram, N_("ADDR1,MASK1[,ADDR2,MASK2[,...]]"), N_("Declare memory regions as faulty (badram).")); - cmd_cut = grub_register_command ("cutmem", grub_cmd_cutmem, + cmd_cut = VasEBoot_register_command ("cutmem", VasEBoot_cmd_cutmem, N_("FROM[K|M|G] TO[K|M|G]"), N_("Remove any memory regions in specified range.")); } -GRUB_MOD_FINI(mmap) +VasEBoot_MOD_FINI(mmap) { - grub_unregister_command (cmd); - grub_unregister_command (cmd_cut); + VasEBoot_unregister_command (cmd); + VasEBoot_unregister_command (cmd_cut); } diff --git a/VasEBoot-core/modinfo.sh.in b/VasEBoot-core/modinfo.sh.in index faf0ad30e..6588eafd5 100644 --- a/VasEBoot-core/modinfo.sh.in +++ b/VasEBoot-core/modinfo.sh.in @@ -1,40 +1,40 @@ #!/bin/sh # User-controllable options -grub_modinfo_target_cpu=@target_cpu@ -grub_modinfo_platform=@platform@ -grub_disk_cache_stats=@DISK_CACHE_STATS@ -grub_boot_time_stats=@BOOT_TIME_STATS@ -grub_have_font_source=@HAVE_FONT_SOURCE@ +VasEBoot_modinfo_target_cpu=@target_cpu@ +VasEBoot_modinfo_platform=@platform@ +VasEBoot_disk_cache_stats=@DISK_CACHE_STATS@ +VasEBoot_boot_time_stats=@BOOT_TIME_STATS@ +VasEBoot_have_font_source=@HAVE_FONT_SOURCE@ # Autodetected config -grub_have_asm_uscore=@HAVE_ASM_USCORE@ -grub_bss_start_symbol="@BSS_START_SYMBOL@" -grub_end_symbol="@END_SYMBOL@" +VasEBoot_have_asm_uscore=@HAVE_ASM_USCORE@ +VasEBoot_bss_start_symbol="@BSS_START_SYMBOL@" +VasEBoot_end_symbol="@END_SYMBOL@" # Build environment -grub_target_cc='@TARGET_CC@' -grub_target_cc_version='@TARGET_CC_VERSION@' -grub_target_cflags='@TARGET_CFLAGS@' -grub_target_cppflags='@TARGET_CPPFLAGS@' -grub_target_ccasflags='@TARGET_CCASFLAGS@' -grub_target_ldflags='@TARGET_LDFLAGS@' -grub_cflags='@CFLAGS@' -grub_cppflags='@CPPFLAGS@' -grub_ccasflags='@CCASFLAGS@' -grub_ldflags='@LDFLAGS@' -grub_target_strip='@TARGET_STRIP@' -grub_target_nm='@TARGET_NM@' -grub_target_ranlib='@TARGET_RANLIB@' -grub_target_objconf='@TARGET_OBJCONV@' -grub_target_obj2elf='@TARGET_OBJ2ELF@' -grub_target_img_base_ldopt='@TARGET_IMG_BASE_LDOPT@' -grub_target_img_ldflags='@TARGET_IMG_BASE_LDFLAGS@' +VasEBoot_target_cc='@TARGET_CC@' +VasEBoot_target_cc_version='@TARGET_CC_VERSION@' +VasEBoot_target_cflags='@TARGET_CFLAGS@' +VasEBoot_target_cppflags='@TARGET_CPPFLAGS@' +VasEBoot_target_ccasflags='@TARGET_CCASFLAGS@' +VasEBoot_target_ldflags='@TARGET_LDFLAGS@' +VasEBoot_cflags='@CFLAGS@' +VasEBoot_cppflags='@CPPFLAGS@' +VasEBoot_ccasflags='@CCASFLAGS@' +VasEBoot_ldflags='@LDFLAGS@' +VasEBoot_target_strip='@TARGET_STRIP@' +VasEBoot_target_nm='@TARGET_NM@' +VasEBoot_target_ranlib='@TARGET_RANLIB@' +VasEBoot_target_objconf='@TARGET_OBJCONV@' +VasEBoot_target_obj2elf='@TARGET_OBJ2ELF@' +VasEBoot_target_img_base_ldopt='@TARGET_IMG_BASE_LDOPT@' +VasEBoot_target_img_ldflags='@TARGET_IMG_BASE_LDFLAGS@' # Version -grub_version="@VERSION@" -grub_package="@PACKAGE@" -grub_package_string="@PACKAGE_STRING@" -grub_package_version="@PACKAGE_VERSION@" -grub_package_name="@PACKAGE_NAME@" -grub_package_bugreport="@PACKAGE_BUGREPORT@" +VasEBoot_version="@VERSION@" +VasEBoot_package="@PACKAGE@" +VasEBoot_package_string="@PACKAGE_STRING@" +VasEBoot_package_version="@PACKAGE_VERSION@" +VasEBoot_package_name="@PACKAGE_NAME@" +VasEBoot_package_bugreport="@PACKAGE_BUGREPORT@" diff --git a/VasEBoot-core/net/arp.c b/VasEBoot-core/net/arp.c index 4b68c4151..424a115a8 100644 --- a/VasEBoot-core/net/arp.c +++ b/VasEBoot-core/net/arp.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* ARP header operation codes */ enum @@ -34,148 +34,148 @@ enum enum { /* IANA ARP constant to define hardware type as ethernet. */ - GRUB_NET_ARPHRD_ETHERNET = 1 + VasEBoot_NET_ARPHRD_ETHERNET = 1 }; struct arppkt { - grub_uint16_t hrd; - grub_uint16_t pro; - grub_uint8_t hln; - grub_uint8_t pln; - grub_uint16_t op; - grub_uint8_t sender_mac[6]; - grub_uint32_t sender_ip; - grub_uint8_t recv_mac[6]; - grub_uint32_t recv_ip; -} GRUB_PACKED; + VasEBoot_uint16_t hrd; + VasEBoot_uint16_t pro; + VasEBoot_uint8_t hln; + VasEBoot_uint8_t pln; + VasEBoot_uint16_t op; + VasEBoot_uint8_t sender_mac[6]; + VasEBoot_uint32_t sender_ip; + VasEBoot_uint8_t recv_mac[6]; + VasEBoot_uint32_t recv_ip; +} VasEBoot_PACKED; static int have_pending; -static grub_uint32_t pending_req; +static VasEBoot_uint32_t pending_req; -grub_err_t -grub_net_arp_send_request (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr) +VasEBoot_err_t +VasEBoot_net_arp_send_request (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr) { - struct grub_net_buff nb; + struct VasEBoot_net_buff nb; struct arppkt *arp_packet; - grub_net_link_level_address_t target_mac_addr; - grub_err_t err; + VasEBoot_net_link_level_address_t target_mac_addr; + VasEBoot_err_t err; int i; - grub_uint8_t *nbd; - grub_uint8_t arp_data[128]; + VasEBoot_uint8_t *nbd; + VasEBoot_uint8_t arp_data[128]; - if (proto_addr->type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4) - return grub_error (GRUB_ERR_BUG, "unsupported address family"); + if (proto_addr->type != VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4) + return VasEBoot_error (VasEBoot_ERR_BUG, "unsupported address family"); /* Build a request packet. */ nb.head = arp_data; nb.end = arp_data + sizeof (arp_data); - grub_netbuff_clear (&nb); - grub_netbuff_reserve (&nb, 128); + VasEBoot_netbuff_clear (&nb); + VasEBoot_netbuff_reserve (&nb, 128); - err = grub_netbuff_push (&nb, sizeof (*arp_packet)); + err = VasEBoot_netbuff_push (&nb, sizeof (*arp_packet)); if (err) return err; arp_packet = (struct arppkt *) nb.data; - arp_packet->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); + arp_packet->hrd = VasEBoot_cpu_to_be16_compile_time (VasEBoot_NET_ARPHRD_ETHERNET); arp_packet->hln = 6; - arp_packet->pro = grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP); + arp_packet->pro = VasEBoot_cpu_to_be16_compile_time (VasEBoot_NET_ETHERTYPE_IP); arp_packet->pln = 4; - arp_packet->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); + arp_packet->op = VasEBoot_cpu_to_be16_compile_time (ARP_REQUEST); /* Sender hardware address. */ - grub_memcpy (arp_packet->sender_mac, &inf->hwaddress.mac, 6); + VasEBoot_memcpy (arp_packet->sender_mac, &inf->hwaddress.mac, 6); arp_packet->sender_ip = inf->address.ipv4; - grub_memset (arp_packet->recv_mac, 0, 6); + VasEBoot_memset (arp_packet->recv_mac, 0, 6); arp_packet->recv_ip = proto_addr->ipv4; /* Target protocol address */ - grub_memset (&target_mac_addr.mac, 0xff, 6); + VasEBoot_memset (&target_mac_addr.mac, 0xff, 6); nbd = nb.data; - send_ethernet_packet (inf, &nb, target_mac_addr, GRUB_NET_ETHERTYPE_ARP); - for (i = 0; i < GRUB_NET_TRIES; i++) + send_ethernet_packet (inf, &nb, target_mac_addr, VasEBoot_NET_ETHERTYPE_ARP); + for (i = 0; i < VasEBoot_NET_TRIES; i++) { - if (grub_net_link_layer_resolve_check (inf, proto_addr)) - return GRUB_ERR_NONE; + if (VasEBoot_net_link_layer_resolve_check (inf, proto_addr)) + return VasEBoot_ERR_NONE; pending_req = proto_addr->ipv4; have_pending = 0; - grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), + VasEBoot_net_poll_cards (VasEBoot_NET_INTERVAL + (i * VasEBoot_NET_INTERVAL_ADDITION), &have_pending); - if (grub_net_link_layer_resolve_check (inf, proto_addr)) - return GRUB_ERR_NONE; + if (VasEBoot_net_link_layer_resolve_check (inf, proto_addr)) + return VasEBoot_ERR_NONE; nb.data = nbd; - send_ethernet_packet (inf, &nb, target_mac_addr, GRUB_NET_ETHERTYPE_ARP); + send_ethernet_packet (inf, &nb, target_mac_addr, VasEBoot_NET_ETHERTYPE_ARP); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_net_arp_receive (struct grub_net_buff *nb, - struct grub_net_card *card) +VasEBoot_err_t +VasEBoot_net_arp_receive (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card) { struct arppkt *arp_packet = (struct arppkt *) nb->data; - grub_net_network_level_address_t sender_addr, target_addr; - grub_net_link_level_address_t sender_mac_addr; - struct grub_net_network_level_interface *inf; + VasEBoot_net_network_level_address_t sender_addr, target_addr; + VasEBoot_net_link_level_address_t sender_mac_addr; + struct VasEBoot_net_network_level_interface *inf; - if (arp_packet->pro != grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP) + if (arp_packet->pro != VasEBoot_cpu_to_be16_compile_time (VasEBoot_NET_ETHERTYPE_IP) || arp_packet->pln != 4 || arp_packet->hln != 6 || nb->tail - nb->data < (int) sizeof (*arp_packet)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - sender_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - target_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + sender_addr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + target_addr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; sender_addr.ipv4 = arp_packet->sender_ip; target_addr.ipv4 = arp_packet->recv_ip; if (arp_packet->sender_ip == pending_req) have_pending = 1; - sender_mac_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (sender_mac_addr.mac, arp_packet->sender_mac, + sender_mac_addr.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (sender_mac_addr.mac, arp_packet->sender_mac, sizeof (sender_mac_addr.mac)); - grub_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); + VasEBoot_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { /* Am I the protocol address target? */ - if (grub_net_addr_cmp (&inf->address, &target_addr) == 0 - && arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) + if (VasEBoot_net_addr_cmp (&inf->address, &target_addr) == 0 + && arp_packet->op == VasEBoot_cpu_to_be16_compile_time (ARP_REQUEST)) { - grub_net_link_level_address_t target; - struct grub_net_buff nb_reply; + VasEBoot_net_link_level_address_t target; + struct VasEBoot_net_buff nb_reply; struct arppkt *arp_reply; - grub_uint8_t arp_data[128]; - grub_err_t err; + VasEBoot_uint8_t arp_data[128]; + VasEBoot_err_t err; nb_reply.head = arp_data; nb_reply.end = arp_data + sizeof (arp_data); - grub_netbuff_clear (&nb_reply); - grub_netbuff_reserve (&nb_reply, 128); + VasEBoot_netbuff_clear (&nb_reply); + VasEBoot_netbuff_reserve (&nb_reply, 128); - err = grub_netbuff_push (&nb_reply, sizeof (*arp_packet)); + err = VasEBoot_netbuff_push (&nb_reply, sizeof (*arp_packet)); if (err) return err; arp_reply = (struct arppkt *) nb_reply.data; - arp_reply->hrd = grub_cpu_to_be16_compile_time (GRUB_NET_ARPHRD_ETHERNET); - arp_reply->pro = grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP); + arp_reply->hrd = VasEBoot_cpu_to_be16_compile_time (VasEBoot_NET_ARPHRD_ETHERNET); + arp_reply->pro = VasEBoot_cpu_to_be16_compile_time (VasEBoot_NET_ETHERTYPE_IP); arp_reply->pln = 4; arp_reply->hln = 6; - arp_reply->op = grub_cpu_to_be16_compile_time (ARP_REPLY); + arp_reply->op = VasEBoot_cpu_to_be16_compile_time (ARP_REPLY); arp_reply->sender_ip = arp_packet->recv_ip; arp_reply->recv_ip = arp_packet->sender_ip; arp_reply->hln = 6; - target.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (target.mac, arp_packet->sender_mac, 6); - grub_memcpy (arp_reply->sender_mac, inf->hwaddress.mac, 6); - grub_memcpy (arp_reply->recv_mac, arp_packet->sender_mac, 6); + target.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (target.mac, arp_packet->sender_mac, 6); + VasEBoot_memcpy (arp_reply->sender_mac, inf->hwaddress.mac, 6); + VasEBoot_memcpy (arp_reply->recv_mac, arp_packet->sender_mac, 6); /* Change operation to REPLY and send packet */ - send_ethernet_packet (inf, &nb_reply, target, GRUB_NET_ETHERTYPE_ARP); + send_ethernet_packet (inf, &nb_reply, target, VasEBoot_NET_ETHERTYPE_ARP); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/net/bootp.c b/VasEBoot-core/net/bootp.c index 0da8e2499..3b417cd97 100644 --- a/VasEBoot-core/net/bootp.c +++ b/VasEBoot-core/net/bootp.c @@ -1,81 +1,81 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#if !defined(GRUB_MACHINE_EFI) && (defined(__i386__) || defined(__x86_64__)) -#define GRUB_NET_BOOTP_ARCH 0x0000 -#elif defined(GRUB_MACHINE_EFI) && defined(__x86_64__) -#define GRUB_NET_BOOTP_ARCH 0x0007 -#elif defined(GRUB_MACHINE_EFI) && defined(__aarch64__) -#define GRUB_NET_BOOTP_ARCH 0x000B +#if !defined(VasEBoot_MACHINE_EFI) && (defined(__i386__) || defined(__x86_64__)) +#define VasEBoot_NET_BOOTP_ARCH 0x0000 +#elif defined(VasEBoot_MACHINE_EFI) && defined(__x86_64__) +#define VasEBoot_NET_BOOTP_ARCH 0x0007 +#elif defined(VasEBoot_MACHINE_EFI) && defined(__aarch64__) +#define VasEBoot_NET_BOOTP_ARCH 0x000B #else #error "unknown bootp architecture" #endif -static grub_uint8_t dhcp_option_header[] = {GRUB_NET_BOOTP_RFC1048_MAGIC_0, - GRUB_NET_BOOTP_RFC1048_MAGIC_1, - GRUB_NET_BOOTP_RFC1048_MAGIC_2, - GRUB_NET_BOOTP_RFC1048_MAGIC_3}; -static grub_uint8_t grub_userclass[] = {0x4D, 0x06, 0x05, 'G', 'R', 'U', 'B', '2'}; -static grub_uint8_t grub_dhcpdiscover[] = {0x35, 0x01, 0x01}; -static grub_uint8_t grub_dhcptime[] = {0x33, 0x04, 0x00, 0x00, 0x0e, 0x10}; +static VasEBoot_uint8_t dhcp_option_header[] = {VasEBoot_NET_BOOTP_RFC1048_MAGIC_0, + VasEBoot_NET_BOOTP_RFC1048_MAGIC_1, + VasEBoot_NET_BOOTP_RFC1048_MAGIC_2, + VasEBoot_NET_BOOTP_RFC1048_MAGIC_3}; +static VasEBoot_uint8_t VasEBoot_userclass[] = {0x4D, 0x06, 0x05, 'G', 'R', 'U', 'B', '2'}; +static VasEBoot_uint8_t VasEBoot_dhcpdiscover[] = {0x35, 0x01, 0x01}; +static VasEBoot_uint8_t VasEBoot_dhcptime[] = {0x33, 0x04, 0x00, 0x00, 0x0e, 0x10}; static void parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) { - const grub_uint8_t *ptr, *ptr0; + const VasEBoot_uint8_t *ptr, *ptr0; ptr = ptr0 = vend; - if (ptr[0] != GRUB_NET_BOOTP_RFC1048_MAGIC_0 - || ptr[1] != GRUB_NET_BOOTP_RFC1048_MAGIC_1 - || ptr[2] != GRUB_NET_BOOTP_RFC1048_MAGIC_2 - || ptr[3] != GRUB_NET_BOOTP_RFC1048_MAGIC_3) + if (ptr[0] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_0 + || ptr[1] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_1 + || ptr[2] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_2 + || ptr[3] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_3) return; - ptr = ptr + sizeof (grub_uint32_t); + ptr = ptr + sizeof (VasEBoot_uint32_t); while (ptr - ptr0 < limit) { - grub_uint8_t tagtype; - grub_uint8_t taglength; + VasEBoot_uint8_t tagtype; + VasEBoot_uint8_t taglength; tagtype = *ptr++; /* Pad tag. */ - if (tagtype == GRUB_NET_BOOTP_PAD) + if (tagtype == VasEBoot_NET_BOOTP_PAD) continue; /* End tag. */ - if (tagtype == GRUB_NET_BOOTP_END) + if (tagtype == VasEBoot_NET_BOOTP_END) return; taglength = *ptr++; switch (tagtype) { - case GRUB_NET_BOOTP_NETMASK: + case VasEBoot_NET_BOOTP_NETMASK: if (taglength == 4) { int i; @@ -86,59 +86,59 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) } break; - case GRUB_NET_BOOTP_ROUTER: + case VasEBoot_NET_BOOTP_ROUTER: if (taglength == 4) { - grub_net_network_level_netaddress_t target; - grub_net_network_level_address_t gw; + VasEBoot_net_network_level_netaddress_t target; + VasEBoot_net_network_level_address_t gw; char *rname; - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + target.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; target.ipv4.base = 0; target.ipv4.masksize = 0; - gw.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - grub_memcpy (&gw.ipv4, ptr, sizeof (gw.ipv4)); - rname = grub_xasprintf ("%s:default", name); + gw.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + VasEBoot_memcpy (&gw.ipv4, ptr, sizeof (gw.ipv4)); + rname = VasEBoot_xasprintf ("%s:default", name); if (rname) - grub_net_add_route_gw (rname, target, gw, NULL); - grub_free (rname); + VasEBoot_net_add_route_gw (rname, target, gw, NULL); + VasEBoot_free (rname); } break; - case GRUB_NET_BOOTP_DNS: + case VasEBoot_NET_BOOTP_DNS: { int i; for (i = 0; i < taglength / 4; i++) { - struct grub_net_network_level_address s; - s.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - s.ipv4 = grub_get_unaligned32 (ptr); + struct VasEBoot_net_network_level_address s; + s.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + s.ipv4 = VasEBoot_get_unaligned32 (ptr); s.option = DNS_OPTION_PREFER_IPV4; - grub_net_add_dns_server (&s); + VasEBoot_net_add_dns_server (&s); ptr += 4; } } continue; - case GRUB_NET_BOOTP_HOSTNAME: - grub_env_set_net_property (name, "hostname", (const char *) ptr, + case VasEBoot_NET_BOOTP_HOSTNAME: + VasEBoot_env_set_net_property (name, "hostname", (const char *) ptr, taglength); break; - case GRUB_NET_BOOTP_DOMAIN: - grub_env_set_net_property (name, "domain", (const char *) ptr, + case VasEBoot_NET_BOOTP_DOMAIN: + VasEBoot_env_set_net_property (name, "domain", (const char *) ptr, taglength); break; - case GRUB_NET_BOOTP_ROOT_PATH: - grub_env_set_net_property (name, "rootpath", (const char *) ptr, + case VasEBoot_NET_BOOTP_ROOT_PATH: + VasEBoot_env_set_net_property (name, "rootpath", (const char *) ptr, taglength); break; - case GRUB_NET_BOOTP_EXTENSIONS_PATH: - grub_env_set_net_property (name, "extensionspath", (const char *) ptr, + case VasEBoot_NET_BOOTP_EXTENSIONS_PATH: + VasEBoot_env_set_net_property (name, "extensionspath", (const char *) ptr, taglength); break; - /* If you need any other options please contact GRUB + /* If you need any other options please contact VasEBoot development team. */ } @@ -146,23 +146,23 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) } } -#define OFFSET_OF(x, y) ((grub_size_t)((grub_uint8_t *)((y)->x) - (grub_uint8_t *)(y))) +#define OFFSET_OF(x, y) ((VasEBoot_size_t)((VasEBoot_uint8_t *)((y)->x) - (VasEBoot_uint8_t *)(y))) -struct grub_net_network_level_interface * -grub_net_configure_by_dhcp_ack (const char *name, - struct grub_net_card *card, - grub_net_interface_flags_t flags, - const struct grub_net_bootp_packet *bp, - grub_size_t size, +struct VasEBoot_net_network_level_interface * +VasEBoot_net_configure_by_dhcp_ack (const char *name, + struct VasEBoot_net_card *card, + VasEBoot_net_interface_flags_t flags, + const struct VasEBoot_net_bootp_packet *bp, + VasEBoot_size_t size, int is_def, char **device, char **path) { - grub_net_network_level_address_t addr; - grub_net_link_level_address_t hwaddr; - struct grub_net_network_level_interface *inter; + VasEBoot_net_network_level_address_t addr; + VasEBoot_net_link_level_address_t hwaddr; + struct VasEBoot_net_network_level_interface *inter; int mask = -1; char server_ip[sizeof ("xxx.xxx.xxx.xxx")]; - addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + addr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; addr.ipv4 = bp->your_ip; if (device) @@ -170,12 +170,12 @@ grub_net_configure_by_dhcp_ack (const char *name, if (path) *path = 0; - grub_memcpy (hwaddr.mac, bp->mac_addr, + VasEBoot_memcpy (hwaddr.mac, bp->mac_addr, bp->hw_len < sizeof (hwaddr.mac) ? bp->hw_len : sizeof (hwaddr.mac)); - hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + hwaddr.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags); + inter = VasEBoot_net_add_addr (name, card, &addr, &hwaddr, flags); if (!inter) return 0; @@ -187,85 +187,85 @@ grub_net_configure_by_dhcp_ack (const char *name, */ if (bp->gateway_ip) { - grub_net_network_level_netaddress_t target; - grub_net_network_level_address_t gw; + VasEBoot_net_network_level_netaddress_t target; + VasEBoot_net_network_level_address_t gw; char *rname; - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + target.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; target.ipv4.base = bp->server_ip; target.ipv4.masksize = 32; - gw.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + gw.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; gw.ipv4 = bp->gateway_ip; - rname = grub_xasprintf ("%s:gw", name); + rname = VasEBoot_xasprintf ("%s:gw", name); if (rname) - grub_net_add_route_gw (rname, target, gw); - grub_free (rname); + VasEBoot_net_add_route_gw (rname, target, gw); + VasEBoot_free (rname); - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + target.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; target.ipv4.base = bp->gateway_ip; target.ipv4.masksize = 32; - grub_net_add_route (name, target, inter); + VasEBoot_net_add_route (name, target, inter); } #endif if (size > OFFSET_OF (boot_file, bp)) - grub_env_set_net_property (name, "boot_file", bp->boot_file, + VasEBoot_env_set_net_property (name, "boot_file", bp->boot_file, sizeof (bp->boot_file)); if (bp->server_ip) { - grub_snprintf (server_ip, sizeof (server_ip), "%d.%d.%d.%d", - ((grub_uint8_t *) &bp->server_ip)[0], - ((grub_uint8_t *) &bp->server_ip)[1], - ((grub_uint8_t *) &bp->server_ip)[2], - ((grub_uint8_t *) &bp->server_ip)[3]); - grub_env_set_net_property (name, "next_server", server_ip, sizeof (server_ip)); - grub_print_error (); + VasEBoot_snprintf (server_ip, sizeof (server_ip), "%d.%d.%d.%d", + ((VasEBoot_uint8_t *) &bp->server_ip)[0], + ((VasEBoot_uint8_t *) &bp->server_ip)[1], + ((VasEBoot_uint8_t *) &bp->server_ip)[2], + ((VasEBoot_uint8_t *) &bp->server_ip)[3]); + VasEBoot_env_set_net_property (name, "next_server", server_ip, sizeof (server_ip)); + VasEBoot_print_error (); } if (is_def) - grub_net_default_server = 0; - if (is_def && !grub_net_default_server && bp->server_ip) + VasEBoot_net_default_server = 0; + if (is_def && !VasEBoot_net_default_server && bp->server_ip) { - grub_net_default_server = grub_strdup (server_ip); - grub_print_error (); + VasEBoot_net_default_server = VasEBoot_strdup (server_ip); + VasEBoot_print_error (); } if (is_def) { - grub_env_set ("net_default_interface", name); - grub_env_export ("net_default_interface"); + VasEBoot_env_set ("net_default_interface", name); + VasEBoot_env_export ("net_default_interface"); } if (device && !*device && bp->server_ip) { - *device = grub_xasprintf ("tftp,%s", server_ip); - grub_print_error (); + *device = VasEBoot_xasprintf ("tftp,%s", server_ip); + VasEBoot_print_error (); } if (size > OFFSET_OF (server_name, bp) && bp->server_name[0]) { - grub_env_set_net_property (name, "dhcp_server_name", bp->server_name, + VasEBoot_env_set_net_property (name, "dhcp_server_name", bp->server_name, sizeof (bp->server_name)); - if (is_def && !grub_net_default_server) + if (is_def && !VasEBoot_net_default_server) { - grub_net_default_server = grub_strdup (bp->server_name); - grub_print_error (); + VasEBoot_net_default_server = VasEBoot_strdup (bp->server_name); + VasEBoot_print_error (); } if (device && !*device) { - *device = grub_xasprintf ("tftp,%s", bp->server_name); - grub_print_error (); + *device = VasEBoot_xasprintf ("tftp,%s", bp->server_name); + VasEBoot_print_error (); } } if (size > OFFSET_OF (boot_file, bp) && path) { - *path = grub_strndup (bp->boot_file, sizeof (bp->boot_file)); - grub_print_error (); + *path = VasEBoot_strndup (bp->boot_file, sizeof (bp->boot_file)); + VasEBoot_print_error (); if (*path) { char *slash; - slash = grub_strrchr (*path, '/'); + slash = VasEBoot_strrchr (*path, '/'); if (slash) *slash = 0; else @@ -274,105 +274,105 @@ grub_net_configure_by_dhcp_ack (const char *name, } if (size > OFFSET_OF (vendor, bp)) parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); - grub_net_add_ipv4_local (inter, mask); + VasEBoot_net_add_ipv4_local (inter, mask); - inter->dhcp_ack = grub_malloc (size); + inter->dhcp_ack = VasEBoot_malloc (size); if (inter->dhcp_ack) { - grub_memcpy (inter->dhcp_ack, bp, size); + VasEBoot_memcpy (inter->dhcp_ack, bp, size); inter->dhcp_acklen = size; } else - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return inter; } void -grub_net_process_dhcp (struct grub_net_buff *nb, - struct grub_net_card *card) +VasEBoot_net_process_dhcp (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card) { char *name; - struct grub_net_network_level_interface *inf; + struct VasEBoot_net_network_level_interface *inf; - name = grub_xasprintf ("%s:dhcp", card->name); + name = VasEBoot_xasprintf ("%s:dhcp", card->name); if (!name) { - grub_print_error (); + VasEBoot_print_error (); return; } - grub_net_configure_by_dhcp_ack (name, card, - 0, (const struct grub_net_bootp_packet *) nb->data, + VasEBoot_net_configure_by_dhcp_ack (name, card, + 0, (const struct VasEBoot_net_bootp_packet *) nb->data, (nb->tail - nb->data), 0, 0, 0); - grub_free (name); - if (grub_errno) - grub_print_error (); + VasEBoot_free (name); + if (VasEBoot_errno) + VasEBoot_print_error (); else { FOR_NET_NETWORK_LEVEL_INTERFACES(inf) - if (grub_memcmp (inf->name, card->name, grub_strlen (card->name)) == 0 - && grub_memcmp (inf->name + grub_strlen (card->name), + if (VasEBoot_memcmp (inf->name, card->name, VasEBoot_strlen (card->name)) == 0 + && VasEBoot_memcmp (inf->name + VasEBoot_strlen (card->name), ":dhcp_tmp", sizeof (":dhcp_tmp") - 1) == 0) { - grub_net_network_level_interface_unregister (inf); + VasEBoot_net_network_level_interface_unregister (inf); break; } } } static char -hexdigit (grub_uint8_t val) +hexdigit (VasEBoot_uint8_t val) { if (val < 10) return val + '0'; return val + 'a' - 10; } -static grub_err_t -grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_dhcpopt (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_net_network_level_interface *inter; + struct VasEBoot_net_network_level_interface *inter; int num; - grub_uint8_t *ptr; - grub_uint8_t taglength; + VasEBoot_uint8_t *ptr; + VasEBoot_uint8_t taglength; if (argc < 4) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("four arguments expected")); FOR_NET_NETWORK_LEVEL_INTERFACES (inter) - if (grub_strcmp (inter->name, args[1]) == 0) + if (VasEBoot_strcmp (inter->name, args[1]) == 0) break; if (!inter) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unrecognised network interface `%s'"), args[1]); if (!inter->dhcp_ack) - return grub_error (GRUB_ERR_IO, N_("no DHCP info found")); + return VasEBoot_error (VasEBoot_ERR_IO, N_("no DHCP info found")); if (inter->dhcp_acklen <= OFFSET_OF (vendor, inter->dhcp_ack)) - return grub_error (GRUB_ERR_IO, N_("no DHCP options found")); + return VasEBoot_error (VasEBoot_ERR_IO, N_("no DHCP options found")); - num = grub_strtoul (args[2], 0, 0); - if (grub_errno) - return grub_errno; + num = VasEBoot_strtoul (args[2], 0, 0); + if (VasEBoot_errno) + return VasEBoot_errno; ptr = inter->dhcp_ack->vendor; - if (ptr[0] != GRUB_NET_BOOTP_RFC1048_MAGIC_0 - || ptr[1] != GRUB_NET_BOOTP_RFC1048_MAGIC_1 - || ptr[2] != GRUB_NET_BOOTP_RFC1048_MAGIC_2 - || ptr[3] != GRUB_NET_BOOTP_RFC1048_MAGIC_3) - return grub_error (GRUB_ERR_IO, N_("no DHCP options found")); - ptr = ptr + sizeof (grub_uint32_t); + if (ptr[0] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_0 + || ptr[1] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_1 + || ptr[2] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_2 + || ptr[3] != VasEBoot_NET_BOOTP_RFC1048_MAGIC_3) + return VasEBoot_error (VasEBoot_ERR_IO, N_("no DHCP options found")); + ptr = ptr + sizeof (VasEBoot_uint32_t); while (1) { - grub_uint8_t tagtype; + VasEBoot_uint8_t tagtype; - if (ptr >= ((grub_uint8_t *) inter->dhcp_ack) + inter->dhcp_acklen) - return grub_error (GRUB_ERR_IO, N_("no DHCP option %d found"), num); + if (ptr >= ((VasEBoot_uint8_t *) inter->dhcp_ack) + inter->dhcp_acklen) + return VasEBoot_error (VasEBoot_ERR_IO, N_("no DHCP option %d found"), num); tagtype = *ptr++; @@ -382,7 +382,7 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), /* End tag. */ if (tagtype == 0xff) - return grub_error (GRUB_ERR_IO, N_("no DHCP option %d found"), num); + return VasEBoot_error (VasEBoot_ERR_IO, N_("no DHCP option %d found"), num); taglength = *ptr++; @@ -391,46 +391,46 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), ptr += taglength; } - if (grub_strcmp (args[3], "string") == 0) + if (VasEBoot_strcmp (args[3], "string") == 0) { - grub_err_t err = GRUB_ERR_NONE; - char *val = grub_malloc (taglength + 1); + VasEBoot_err_t err = VasEBoot_ERR_NONE; + char *val = VasEBoot_malloc (taglength + 1); if (!val) - return grub_errno; - grub_memcpy (val, ptr, taglength); + return VasEBoot_errno; + VasEBoot_memcpy (val, ptr, taglength); val[taglength] = 0; if (args[0][0] == '-' && args[0][1] == 0) - grub_printf ("%s\n", val); + VasEBoot_printf ("%s\n", val); else - err = grub_env_set (args[0], val); - grub_free (val); + err = VasEBoot_env_set (args[0], val); + VasEBoot_free (val); return err; } - if (grub_strcmp (args[3], "number") == 0) + if (VasEBoot_strcmp (args[3], "number") == 0) { - grub_uint64_t val = 0; + VasEBoot_uint64_t val = 0; int i; for (i = 0; i < taglength; i++) val = (val << 8) | ptr[i]; if (args[0][0] == '-' && args[0][1] == 0) - grub_printf ("%llu\n", (unsigned long long) val); + VasEBoot_printf ("%llu\n", (unsigned long long) val); else { char valn[64]; - grub_snprintf (valn, sizeof (valn), "%lld\n", (unsigned long long) val); - return grub_env_set (args[0], valn); + VasEBoot_snprintf (valn, sizeof (valn), "%lld\n", (unsigned long long) val); + return VasEBoot_env_set (args[0], valn); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_strcmp (args[3], "hex") == 0) + if (VasEBoot_strcmp (args[3], "hex") == 0) { - grub_err_t err = GRUB_ERR_NONE; - char *val = grub_malloc (2 * taglength + 1); + VasEBoot_err_t err = VasEBoot_ERR_NONE; + char *val = VasEBoot_malloc (2 * taglength + 1); int i; if (!val) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < taglength; i++) { val[2 * i] = hexdigit (ptr[i] >> 4); @@ -438,206 +438,206 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), } val[2 * taglength] = 0; if (args[0][0] == '-' && args[0][1] == 0) - grub_printf ("%s\n", val); + VasEBoot_printf ("%s\n", val); else - err = grub_env_set (args[0], val); - grub_free (val); + err = VasEBoot_env_set (args[0], val); + VasEBoot_free (val); return err; } - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unrecognised DHCP option format specification `%s'"), args[3]); } /* FIXME: allow to specify mac address. */ -static grub_err_t -grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_bootp (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_net_card *card; - struct grub_net_network_level_interface *ifaces; - grub_size_t ncards = 0; + struct VasEBoot_net_card *card; + struct VasEBoot_net_network_level_interface *ifaces; + VasEBoot_size_t ncards = 0; unsigned j = 0; int interval; - grub_err_t err; + VasEBoot_err_t err; FOR_NET_CARDS (card) { - if (argc > 0 && grub_strcmp (card->name, args[0]) != 0) + if (argc > 0 && VasEBoot_strcmp (card->name, args[0]) != 0) continue; ncards++; } if (ncards == 0) - return grub_error (GRUB_ERR_NET_NO_CARD, N_("no network card found")); + return VasEBoot_error (VasEBoot_ERR_NET_NO_CARD, N_("no network card found")); - ifaces = grub_zalloc (ncards * sizeof (ifaces[0])); + ifaces = VasEBoot_zalloc (ncards * sizeof (ifaces[0])); if (!ifaces) - return grub_errno; + return VasEBoot_errno; j = 0; FOR_NET_CARDS (card) { - if (argc > 0 && grub_strcmp (card->name, args[0]) != 0) + if (argc > 0 && VasEBoot_strcmp (card->name, args[0]) != 0) continue; ifaces[j].card = card; ifaces[j].next = &ifaces[j+1]; if (j) ifaces[j].prev = &ifaces[j-1].next; - ifaces[j].name = grub_xasprintf ("%s:dhcp_tmp", card->name); + ifaces[j].name = VasEBoot_xasprintf ("%s:dhcp_tmp", card->name); card->num_ifaces++; if (!ifaces[j].name) { unsigned i; for (i = 0; i < j; i++) - grub_free (ifaces[i].name); - grub_free (ifaces); - return grub_errno; + VasEBoot_free (ifaces[i].name); + VasEBoot_free (ifaces); + return VasEBoot_errno; } - ifaces[j].address.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV; - grub_memcpy (&ifaces[j].hwaddress, &card->default_address, + ifaces[j].address.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV; + VasEBoot_memcpy (&ifaces[j].hwaddress, &card->default_address, sizeof (ifaces[j].hwaddress)); j++; } - ifaces[ncards - 1].next = grub_net_network_level_interfaces; - if (grub_net_network_level_interfaces) - grub_net_network_level_interfaces->prev = & ifaces[ncards - 1].next; - grub_net_network_level_interfaces = &ifaces[0]; - ifaces[0].prev = &grub_net_network_level_interfaces; + ifaces[ncards - 1].next = VasEBoot_net_network_level_interfaces; + if (VasEBoot_net_network_level_interfaces) + VasEBoot_net_network_level_interfaces->prev = & ifaces[ncards - 1].next; + VasEBoot_net_network_level_interfaces = &ifaces[0]; + ifaces[0].prev = &VasEBoot_net_network_level_interfaces; for (interval = 200; interval < 10000; interval *= 2) { int done = 0; for (j = 0; j < ncards; j++) { - struct grub_net_bootp_packet *pack; - struct grub_datetime date; - grub_int32_t t = 0; - struct grub_net_buff *nb; + struct VasEBoot_net_bootp_packet *pack; + struct VasEBoot_datetime date; + VasEBoot_int32_t t = 0; + struct VasEBoot_net_buff *nb; struct udphdr *udph; - grub_net_network_level_address_t target; - grub_net_link_level_address_t ll_target; - grub_uint8_t *offset; + VasEBoot_net_network_level_address_t target; + VasEBoot_net_link_level_address_t ll_target; + VasEBoot_uint8_t *offset; if (!ifaces[j].prev) continue; - nb = grub_netbuff_alloc (sizeof (*pack) + sizeof(dhcp_option_header) - + sizeof(grub_userclass) - + sizeof(grub_dhcpdiscover) - + sizeof(grub_dhcptime) + 64 + 128); + nb = VasEBoot_netbuff_alloc (sizeof (*pack) + sizeof(dhcp_option_header) + + sizeof(VasEBoot_userclass) + + sizeof(VasEBoot_dhcpdiscover) + + sizeof(VasEBoot_dhcptime) + 64 + 128); if (!nb) { - grub_netbuff_free (nb); - return grub_errno; + VasEBoot_netbuff_free (nb); + return VasEBoot_errno; } - err = grub_netbuff_reserve (nb, sizeof (*pack) + 64 + 128); + err = VasEBoot_netbuff_reserve (nb, sizeof (*pack) + 64 + 128); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - err = grub_netbuff_push (nb, sizeof (*pack) + 64); + err = VasEBoot_netbuff_push (nb, sizeof (*pack) + 64); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } pack = (void *) nb->data; done = 1; - grub_memset (pack, 0, sizeof (*pack) + 64); + VasEBoot_memset (pack, 0, sizeof (*pack) + 64); pack->opcode = 1; pack->hw_type = 1; pack->hw_len = 6; - err = grub_get_datetime (&date); - if (err || !grub_datetime2unixtime (&date, &t)) + err = VasEBoot_get_datetime (&date); + if (err || !VasEBoot_datetime2unixtime (&date, &t)) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; t = 0; } - pack->ident = grub_cpu_to_be32 (t); - pack->seconds = grub_cpu_to_be16 (t); + pack->ident = VasEBoot_cpu_to_be32 (t); + pack->seconds = VasEBoot_cpu_to_be16 (t); - grub_memcpy (&pack->mac_addr, &ifaces[j].hwaddress.mac, 6); - offset = (grub_uint8_t *)&pack->vendor; - grub_memcpy (offset, dhcp_option_header, sizeof(dhcp_option_header)); + VasEBoot_memcpy (&pack->mac_addr, &ifaces[j].hwaddress.mac, 6); + offset = (VasEBoot_uint8_t *)&pack->vendor; + VasEBoot_memcpy (offset, dhcp_option_header, sizeof(dhcp_option_header)); offset += sizeof(dhcp_option_header); - grub_memcpy (offset, grub_dhcpdiscover, sizeof(grub_dhcpdiscover)); - offset += sizeof(grub_dhcpdiscover); - grub_memcpy (offset, grub_userclass, sizeof(grub_userclass)); - offset += sizeof(grub_userclass); - grub_memcpy (offset, grub_dhcptime, sizeof(grub_dhcptime)); + VasEBoot_memcpy (offset, VasEBoot_dhcpdiscover, sizeof(VasEBoot_dhcpdiscover)); + offset += sizeof(VasEBoot_dhcpdiscover); + VasEBoot_memcpy (offset, VasEBoot_userclass, sizeof(VasEBoot_userclass)); + offset += sizeof(VasEBoot_userclass); + VasEBoot_memcpy (offset, VasEBoot_dhcptime, sizeof(VasEBoot_dhcptime)); /* insert Client System Architecture (option 93) */ - offset += sizeof(grub_dhcptime); + offset += sizeof(VasEBoot_dhcptime); offset[0] = 93; offset[1] = 2; - offset[2] = (GRUB_NET_BOOTP_ARCH >> 8); - offset[3] = (GRUB_NET_BOOTP_ARCH & 0xFF); + offset[2] = (VasEBoot_NET_BOOTP_ARCH >> 8); + offset[3] = (VasEBoot_NET_BOOTP_ARCH & 0xFF); /* option terminator */ offset[4] = 255; - grub_netbuff_push (nb, sizeof (*udph)); + VasEBoot_netbuff_push (nb, sizeof (*udph)); udph = (struct udphdr *) nb->data; - udph->src = grub_cpu_to_be16_compile_time (68); - udph->dst = grub_cpu_to_be16_compile_time (67); + udph->src = VasEBoot_cpu_to_be16_compile_time (68); + udph->dst = VasEBoot_cpu_to_be16_compile_time (67); udph->chksum = 0; - udph->len = grub_cpu_to_be16 (nb->tail - nb->data); - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + udph->len = VasEBoot_cpu_to_be16 (nb->tail - nb->data); + target.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; target.ipv4 = 0xffffffff; - err = grub_net_link_layer_resolve (&ifaces[j], &target, &ll_target); + err = VasEBoot_net_link_layer_resolve (&ifaces[j], &target, &ll_target); if (err) return err; - udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, + udph->chksum = VasEBoot_net_ip_transport_checksum (nb, VasEBoot_NET_IP_UDP, &ifaces[j].address, &target); - err = grub_net_send_ip_packet (&ifaces[j], &target, &ll_target, nb, - GRUB_NET_IP_UDP); - grub_netbuff_free (nb); + err = VasEBoot_net_send_ip_packet (&ifaces[j], &target, &ll_target, nb, + VasEBoot_NET_IP_UDP); + VasEBoot_netbuff_free (nb); if (err) return err; } if (!done) break; - grub_net_poll_cards (interval, 0); + VasEBoot_net_poll_cards (interval, 0); } - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; for (j = 0; j < ncards; j++) { - grub_free (ifaces[j].name); + VasEBoot_free (ifaces[j].name); if (!ifaces[j].prev) continue; - grub_error_push (); - grub_net_network_level_interface_unregister (&ifaces[j]); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, + VasEBoot_error_push (); + VasEBoot_net_network_level_interface_unregister (&ifaces[j]); + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("couldn't autoconfigure %s"), ifaces[j].card->name); } - grub_free (ifaces); + VasEBoot_free (ifaces); return err; } -static grub_command_t cmd_getdhcp, cmd_bootp; +static VasEBoot_command_t cmd_getdhcp, cmd_bootp; void -grub_bootp_init (void) +VasEBoot_bootp_init (void) { - cmd_bootp = grub_register_command ("net_bootp", grub_cmd_bootp, + cmd_bootp = VasEBoot_register_command ("net_bootp", VasEBoot_cmd_bootp, N_("[CARD]"), N_("perform a bootp autoconfiguration")); - cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt, + cmd_getdhcp = VasEBoot_register_command ("net_get_dhcp_option", VasEBoot_cmd_dhcpopt, N_("VAR INTERFACE NUMBER DESCRIPTION"), N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value.")); } void -grub_bootp_fini (void) +VasEBoot_bootp_fini (void) { - grub_unregister_command (cmd_getdhcp); - grub_unregister_command (cmd_bootp); + VasEBoot_unregister_command (cmd_getdhcp); + VasEBoot_unregister_command (cmd_bootp); } diff --git a/VasEBoot-core/net/dns.c b/VasEBoot-core/net/dns.c index 5deb1efd3..113c16512 100644 --- a/VasEBoot-core/net/dns.c +++ b/VasEBoot-core/net/dns.c @@ -1,74 +1,74 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include struct dns_cache_element { char *name; - grub_size_t naddresses; - struct grub_net_network_level_address *addresses; - grub_uint64_t limit_time; + VasEBoot_size_t naddresses; + struct VasEBoot_net_network_level_address *addresses; + VasEBoot_uint64_t limit_time; }; #define DNS_CACHE_SIZE 1021 #define DNS_HASH_BASE 423 -typedef enum grub_dns_qtype_id +typedef enum VasEBoot_dns_qtype_id { - GRUB_DNS_QTYPE_A = 1, - GRUB_DNS_QTYPE_AAAA = 28 - } grub_dns_qtype_id_t; + VasEBoot_DNS_QTYPE_A = 1, + VasEBoot_DNS_QTYPE_AAAA = 28 + } VasEBoot_dns_qtype_id_t; static struct dns_cache_element dns_cache[DNS_CACHE_SIZE]; -static struct grub_net_network_level_address *dns_servers; -static grub_size_t dns_nservers, dns_servers_alloc; +static struct VasEBoot_net_network_level_address *dns_servers; +static VasEBoot_size_t dns_nservers, dns_servers_alloc; -grub_err_t -grub_net_add_dns_server (const struct grub_net_network_level_address *s) +VasEBoot_err_t +VasEBoot_net_add_dns_server (const struct VasEBoot_net_network_level_address *s) { if (dns_servers_alloc <= dns_nservers) { int na = dns_servers_alloc * 2; - struct grub_net_network_level_address *ns; + struct VasEBoot_net_network_level_address *ns; if (na < 8) na = 8; - ns = grub_realloc (dns_servers, na * sizeof (ns[0])); + ns = VasEBoot_realloc (dns_servers, na * sizeof (ns[0])); if (!ns) - return grub_errno; + return VasEBoot_errno; dns_servers_alloc = na; dns_servers = ns; } dns_servers[dns_nservers++] = *s; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_net_remove_dns_server (const struct grub_net_network_level_address *s) +VasEBoot_net_remove_dns_server (const struct VasEBoot_net_network_level_address *s) { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < dns_nservers; i++) - if (grub_net_addr_cmp (s, &dns_servers[i]) == 0) + if (VasEBoot_net_addr_cmp (s, &dns_servers[i]) == 0) break; if (i < dns_nservers) { @@ -79,14 +79,14 @@ grub_net_remove_dns_server (const struct grub_net_network_level_address *s) struct dns_header { - grub_uint16_t id; - grub_uint8_t flags; - grub_uint8_t ra_z_r_code; - grub_uint16_t qdcount; - grub_uint16_t ancount; - grub_uint16_t nscount; - grub_uint16_t arcount; -} GRUB_PACKED; + VasEBoot_uint16_t id; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t ra_z_r_code; + VasEBoot_uint16_t qdcount; + VasEBoot_uint16_t ancount; + VasEBoot_uint16_t nscount; + VasEBoot_uint16_t arcount; +} VasEBoot_PACKED; enum { @@ -107,10 +107,10 @@ enum struct recv_data { - grub_size_t *naddresses; - struct grub_net_network_level_address **addresses; + VasEBoot_size_t *naddresses; + struct VasEBoot_net_network_level_address **addresses; int cache; - grub_uint16_t id; + VasEBoot_uint16_t id; int dns_err; char *name; const char *oname; @@ -134,12 +134,12 @@ hash (const char *str) } static int -check_name_real (const grub_uint8_t *name_at, const grub_uint8_t *head, - const grub_uint8_t *tail, const char *check_with, +check_name_real (const VasEBoot_uint8_t *name_at, const VasEBoot_uint8_t *head, + const VasEBoot_uint8_t *tail, const char *check_with, int *length, char *set) { const char *readable_ptr = check_with; - const grub_uint8_t *ptr; + const VasEBoot_uint8_t *ptr; char *optr = set; int bytes_processed = 0; if (length) @@ -165,10 +165,10 @@ check_name_real (const grub_uint8_t *name_at, const grub_uint8_t *head, ptr = head + (((ptr[0] & 0x3f) << 8) | ptr[1]); continue; } - if (readable_ptr && grub_memcmp (ptr + 1, readable_ptr, *ptr) != 0) + if (readable_ptr && VasEBoot_memcmp (ptr + 1, readable_ptr, *ptr) != 0) return 0; - if (grub_memchr (ptr + 1, 0, *ptr) - || grub_memchr (ptr + 1, '.', *ptr)) + if (VasEBoot_memchr (ptr + 1, 0, *ptr) + || VasEBoot_memchr (ptr + 1, '.', *ptr)) return 0; if (readable_ptr) readable_ptr += *ptr; @@ -179,7 +179,7 @@ check_name_real (const grub_uint8_t *name_at, const grub_uint8_t *head, *length += *ptr + 1; if (optr) { - grub_memcpy (optr, ptr + 1, *ptr); + VasEBoot_memcpy (optr, ptr + 1, *ptr); optr += *ptr; } if (optr) @@ -192,27 +192,27 @@ check_name_real (const grub_uint8_t *name_at, const grub_uint8_t *head, } static int -check_name (const grub_uint8_t *name_at, const grub_uint8_t *head, - const grub_uint8_t *tail, const char *check_with) +check_name (const VasEBoot_uint8_t *name_at, const VasEBoot_uint8_t *head, + const VasEBoot_uint8_t *tail, const char *check_with) { return check_name_real (name_at, head, tail, check_with, NULL, NULL); } static char * -get_name (const grub_uint8_t *name_at, const grub_uint8_t *head, - const grub_uint8_t *tail) +get_name (const VasEBoot_uint8_t *name_at, const VasEBoot_uint8_t *head, + const VasEBoot_uint8_t *tail) { int length; char *ret; if (!check_name_real (name_at, head, tail, NULL, &length, NULL)) return NULL; - ret = grub_malloc (length + 1); + ret = VasEBoot_malloc (length + 1); if (!ret) return NULL; if (!check_name_real (name_at, head, tail, NULL, NULL, ret)) { - grub_free (ret); + VasEBoot_free (ret); return NULL; } return ret; @@ -225,58 +225,58 @@ enum DNS_CLASS_AAAA = 28 }; -static grub_err_t -recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), - struct grub_net_buff *nb, +static VasEBoot_err_t +recv_hook (VasEBoot_net_udp_socket_t sock __attribute__ ((unused)), + struct VasEBoot_net_buff *nb, void *data_) { struct dns_header *head; struct recv_data *data = data_; int i, j; - grub_uint8_t *ptr, *reparse_ptr; + VasEBoot_uint8_t *ptr, *reparse_ptr; int redirect_cnt = 0; char *redirect_save = NULL; - grub_uint32_t ttl_all = ~0U; + VasEBoot_uint32_t ttl_all = ~0U; /* Code apparently assumed that only one packet is received as response. We may get multiple responses due to network condition, so check here and quit early. */ if (*data->addresses) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } head = (struct dns_header *) nb->data; - ptr = (grub_uint8_t *) (head + 1); + ptr = (VasEBoot_uint8_t *) (head + 1); if (ptr >= nb->tail) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (head->id != data->id) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (!(head->flags & FLAGS_RESPONSE) || (head->flags & FLAGS_OPCODE)) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (head->ra_z_r_code & ERRCODE_MASK) { data->dns_err = 1; - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } - for (i = 0; i < grub_be_to_cpu16 (head->qdcount); i++) + for (i = 0; i < VasEBoot_be_to_cpu16 (head->qdcount); i++) { if (ptr >= nb->tail) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } while (ptr < nb->tail && !((*ptr & 0xc0) || *ptr == 0)) ptr += *ptr + 1; @@ -285,27 +285,27 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), ptr++; ptr += 4; } - *data->addresses = grub_realloc (*data->addresses, sizeof ((*data->addresses)[0]) - * (grub_be_to_cpu16 (head->ancount) + *data->naddresses)); + *data->addresses = VasEBoot_realloc (*data->addresses, sizeof ((*data->addresses)[0]) + * (VasEBoot_be_to_cpu16 (head->ancount) + *data->naddresses)); if (!*data->addresses) { - grub_errno = GRUB_ERR_NONE; - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } reparse_ptr = ptr; reparse: - for (i = 0, ptr = reparse_ptr; i < grub_be_to_cpu16 (head->ancount); i++) + for (i = 0, ptr = reparse_ptr; i < VasEBoot_be_to_cpu16 (head->ancount); i++) { int ignored = 0; - grub_uint8_t class; - grub_uint32_t ttl = 0; - grub_uint16_t length; + VasEBoot_uint8_t class; + VasEBoot_uint32_t ttl = 0; + VasEBoot_uint16_t length; if (ptr >= nb->tail) { if (!*data->naddresses) - grub_free (*data->addresses); - return GRUB_ERR_NONE; + VasEBoot_free (*data->addresses); + return VasEBoot_ERR_NONE; } ignored = !check_name (ptr, nb->data, nb->tail, data->name); while (ptr < nb->tail && !((*ptr & 0xc0) || *ptr == 0)) @@ -316,9 +316,9 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), if (ptr + 10 >= nb->tail) { if (!*data->naddresses) - grub_free (*data->addresses); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_free (*data->addresses); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (*ptr++ != 0) ignored = 1; @@ -337,9 +337,9 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), if (ptr + length > nb->tail) { if (!*data->naddresses) - grub_free (*data->addresses); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_free (*data->addresses); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (!ignored) { @@ -351,8 +351,8 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), if (length != 4) break; (*data->addresses)[*data->naddresses].type - = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - grub_memcpy (&(*data->addresses)[*data->naddresses].ipv4, + = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + VasEBoot_memcpy (&(*data->addresses)[*data->naddresses].ipv4, ptr, 4); (*data->naddresses)++; data->stop = 1; @@ -361,8 +361,8 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), if (length != 16) break; (*data->addresses)[*data->naddresses].type - = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - grub_memcpy (&(*data->addresses)[*data->naddresses].ipv6, + = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + VasEBoot_memcpy (&(*data->addresses)[*data->naddresses].ipv6, ptr, 16); (*data->naddresses)++; data->stop = 1; @@ -370,25 +370,25 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), case DNS_CLASS_CNAME: if (!(redirect_cnt & (redirect_cnt - 1))) { - grub_free (redirect_save); + VasEBoot_free (redirect_save); redirect_save = data->name; } else - grub_free (data->name); + VasEBoot_free (data->name); redirect_cnt++; data->name = get_name (ptr, nb->data, nb->tail); if (!data->name) { data->dns_err = 1; - grub_errno = 0; - return GRUB_ERR_NONE; + VasEBoot_errno = 0; + return VasEBoot_ERR_NONE; } - grub_dprintf ("dns", "CNAME %s\n", data->name); - if (grub_strcmp (redirect_save, data->name) == 0) + VasEBoot_dprintf ("dns", "CNAME %s\n", data->name); + if (VasEBoot_strcmp (redirect_save, data->name) == 0) { data->dns_err = 1; - grub_free (redirect_save); - return GRUB_ERR_NONE; + VasEBoot_free (redirect_save); + return VasEBoot_ERR_NONE; } goto reparse; } @@ -398,55 +398,55 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), if (ttl_all && *data->naddresses && data->cache) { int h; - grub_dprintf ("dns", "caching for %d seconds\n", ttl_all); + VasEBoot_dprintf ("dns", "caching for %d seconds\n", ttl_all); h = hash (data->oname); - grub_free (dns_cache[h].name); + VasEBoot_free (dns_cache[h].name); dns_cache[h].name = 0; - grub_free (dns_cache[h].addresses); + VasEBoot_free (dns_cache[h].addresses); dns_cache[h].addresses = 0; - dns_cache[h].name = grub_strdup (data->oname); + dns_cache[h].name = VasEBoot_strdup (data->oname); dns_cache[h].naddresses = *data->naddresses; - dns_cache[h].addresses = grub_malloc (*data->naddresses + dns_cache[h].addresses = VasEBoot_malloc (*data->naddresses * sizeof (dns_cache[h].addresses[0])); - dns_cache[h].limit_time = grub_get_time_ms () + 1000 * ttl_all; + dns_cache[h].limit_time = VasEBoot_get_time_ms () + 1000 * ttl_all; if (!dns_cache[h].addresses || !dns_cache[h].name) { - grub_free (dns_cache[h].name); + VasEBoot_free (dns_cache[h].name); dns_cache[h].name = 0; - grub_free (dns_cache[h].addresses); + VasEBoot_free (dns_cache[h].addresses); dns_cache[h].addresses = 0; } - grub_memcpy (dns_cache[h].addresses, *data->addresses, + VasEBoot_memcpy (dns_cache[h].addresses, *data->addresses, *data->naddresses * sizeof (dns_cache[h].addresses[0])); } - grub_netbuff_free (nb); - grub_free (redirect_save); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + VasEBoot_free (redirect_save); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_net_dns_lookup (const char *name, - const struct grub_net_network_level_address *servers, - grub_size_t n_servers, - grub_size_t *naddresses, - struct grub_net_network_level_address **addresses, +VasEBoot_err_t +VasEBoot_net_dns_lookup (const char *name, + const struct VasEBoot_net_network_level_address *servers, + VasEBoot_size_t n_servers, + VasEBoot_size_t *naddresses, + struct VasEBoot_net_network_level_address **addresses, int cache) { - grub_size_t send_servers = 0; - grub_size_t i, j; - struct grub_net_buff *nb; - grub_net_udp_socket_t *sockets; - grub_uint8_t *optr; + VasEBoot_size_t send_servers = 0; + VasEBoot_size_t i, j; + struct VasEBoot_net_buff *nb; + VasEBoot_net_udp_socket_t *sockets; + VasEBoot_uint8_t *optr; const char *iptr; struct dns_header *head; - static grub_uint16_t id = 1; - grub_uint8_t *qtypeptr; - grub_err_t err = GRUB_ERR_NONE; + static VasEBoot_uint16_t id = 1; + VasEBoot_uint8_t *qtypeptr; + VasEBoot_err_t err = VasEBoot_ERR_NONE; struct recv_data data = {naddresses, addresses, cache, - grub_cpu_to_be16 (id++), 0, 0, name, 0}; - grub_uint8_t *nbd; - grub_size_t try_server = 0; + VasEBoot_cpu_to_be16 (id++), 0, 0, name, 0}; + VasEBoot_uint8_t *nbd; + VasEBoot_size_t try_server = 0; if (!servers) { @@ -455,7 +455,7 @@ grub_net_dns_lookup (const char *name, } if (!n_servers) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("no DNS servers configured")); *naddresses = 0; @@ -463,67 +463,67 @@ grub_net_dns_lookup (const char *name, { int h; h = hash (name); - if (dns_cache[h].name && grub_strcmp (dns_cache[h].name, name) == 0 - && grub_get_time_ms () < dns_cache[h].limit_time) + if (dns_cache[h].name && VasEBoot_strcmp (dns_cache[h].name, name) == 0 + && VasEBoot_get_time_ms () < dns_cache[h].limit_time) { - grub_dprintf ("dns", "retrieved from cache\n"); - *addresses = grub_malloc (dns_cache[h].naddresses + VasEBoot_dprintf ("dns", "retrieved from cache\n"); + *addresses = VasEBoot_malloc (dns_cache[h].naddresses * sizeof ((*addresses)[0])); if (!*addresses) - return grub_errno; + return VasEBoot_errno; *naddresses = dns_cache[h].naddresses; - grub_memcpy (*addresses, dns_cache[h].addresses, + VasEBoot_memcpy (*addresses, dns_cache[h].addresses, dns_cache[h].naddresses * sizeof ((*addresses)[0])); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } - sockets = grub_malloc (sizeof (sockets[0]) * n_servers); + sockets = VasEBoot_malloc (sizeof (sockets[0]) * n_servers); if (!sockets) - return grub_errno; + return VasEBoot_errno; - data.name = grub_strdup (name); + data.name = VasEBoot_strdup (name); if (!data.name) { - grub_free (sockets); - return grub_errno; + VasEBoot_free (sockets); + return VasEBoot_errno; } - nb = grub_netbuff_alloc (GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE - + GRUB_NET_UDP_HEADER_SIZE + nb = VasEBoot_netbuff_alloc (VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE + + VasEBoot_NET_UDP_HEADER_SIZE + sizeof (struct dns_header) - + grub_strlen (name) + 2 + 4); + + VasEBoot_strlen (name) + 2 + 4); if (!nb) { - grub_free (sockets); - grub_free (data.name); - return grub_errno; + VasEBoot_free (sockets); + VasEBoot_free (data.name); + return VasEBoot_errno; } - grub_netbuff_reserve (nb, GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE - + GRUB_NET_UDP_HEADER_SIZE); - grub_netbuff_put (nb, sizeof (struct dns_header) - + grub_strlen (name) + 2 + 4); + VasEBoot_netbuff_reserve (nb, VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE + + VasEBoot_NET_UDP_HEADER_SIZE); + VasEBoot_netbuff_put (nb, sizeof (struct dns_header) + + VasEBoot_strlen (name) + 2 + 4); head = (struct dns_header *) nb->data; - optr = (grub_uint8_t *) (head + 1); + optr = (VasEBoot_uint8_t *) (head + 1); for (iptr = name; *iptr; ) { const char *dot; - dot = grub_strchr (iptr, '.'); + dot = VasEBoot_strchr (iptr, '.'); if (!dot) - dot = iptr + grub_strlen (iptr); + dot = iptr + VasEBoot_strlen (iptr); if ((dot - iptr) >= 64) { - grub_free (sockets); - grub_free (data.name); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_free (sockets); + VasEBoot_free (data.name); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("domain name component is too long")); } *optr = (dot - iptr); optr++; - grub_memcpy (optr, iptr, dot - iptr); + VasEBoot_memcpy (optr, iptr, dot - iptr); optr += dot - iptr; iptr = dot; if (*iptr) @@ -542,10 +542,10 @@ grub_net_dns_lookup (const char *name, head->id = data.id; head->flags = FLAGS_RD; head->ra_z_r_code = 0; - head->qdcount = grub_cpu_to_be16_compile_time (1); - head->ancount = grub_cpu_to_be16_compile_time (0); - head->nscount = grub_cpu_to_be16_compile_time (0); - head->arcount = grub_cpu_to_be16_compile_time (0); + head->qdcount = VasEBoot_cpu_to_be16_compile_time (1); + head->ancount = VasEBoot_cpu_to_be16_compile_time (0); + head->nscount = VasEBoot_cpu_to_be16_compile_time (0); + head->arcount = VasEBoot_cpu_to_be16_compile_time (0); nbd = nb->data; @@ -554,14 +554,14 @@ grub_net_dns_lookup (const char *name, /* Connect to a next server. */ while (!(i & 1) && try_server < n_servers) { - sockets[send_servers] = grub_net_udp_open (servers[try_server++], + sockets[send_servers] = VasEBoot_net_udp_open (servers[try_server++], DNS_PORT, recv_hook, &data); if (!sockets[send_servers]) { - err = grub_errno; - grub_errno = GRUB_ERR_NONE; + err = VasEBoot_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; } else { @@ -575,25 +575,25 @@ grub_net_dns_lookup (const char *name, goto out; for (j = 0; j < send_servers; j++) { - grub_err_t err2; + VasEBoot_err_t err2; - grub_size_t t = 0; + VasEBoot_size_t t = 0; do { nb->data = nbd; if (servers[j].option == DNS_OPTION_IPV4 || ((servers[j].option == DNS_OPTION_PREFER_IPV4) && (t++ == 0)) || ((servers[j].option == DNS_OPTION_PREFER_IPV6) && (t++ == 1))) - *qtypeptr = GRUB_DNS_QTYPE_A; + *qtypeptr = VasEBoot_DNS_QTYPE_A; else - *qtypeptr = GRUB_DNS_QTYPE_AAAA; + *qtypeptr = VasEBoot_DNS_QTYPE_AAAA; - grub_dprintf ("dns", "QTYPE: %u QNAME: %s\n", *qtypeptr, name); + VasEBoot_dprintf ("dns", "QTYPE: %u QNAME: %s\n", *qtypeptr, name); - err2 = grub_net_send_udp_packet (sockets[j], nb); + err2 = VasEBoot_net_send_udp_packet (sockets[j], nb); if (err2) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; err = err2; } if (*data.naddresses) @@ -601,45 +601,45 @@ grub_net_dns_lookup (const char *name, } while (t == 1); } - grub_net_poll_cards (200, &data.stop); + VasEBoot_net_poll_cards (200, &data.stop); } out: - grub_free (data.name); - grub_netbuff_free (nb); + VasEBoot_free (data.name); + VasEBoot_netbuff_free (nb); for (j = 0; j < send_servers; j++) - grub_net_udp_close (sockets[j]); + VasEBoot_net_udp_close (sockets[j]); - grub_free (sockets); + VasEBoot_free (sockets); if (*data.naddresses) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (data.dns_err) - return grub_error (GRUB_ERR_NET_NO_DOMAIN, + return VasEBoot_error (VasEBoot_ERR_NET_NO_DOMAIN, N_("no DNS record found")); if (err) { - grub_errno = err; + VasEBoot_errno = err; return err; } - return grub_error (GRUB_ERR_TIMEOUT, + return VasEBoot_error (VasEBoot_ERR_TIMEOUT, N_("no DNS reply received")); } -static grub_err_t -grub_cmd_nslookup (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_nslookup (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - grub_err_t err; - struct grub_net_network_level_address cmd_server; - struct grub_net_network_level_address *servers; - grub_size_t nservers, i, naddresses = 0; - struct grub_net_network_level_address *addresses = 0; + VasEBoot_err_t err; + struct VasEBoot_net_network_level_address cmd_server; + struct VasEBoot_net_network_level_address *servers; + VasEBoot_size_t nservers, i, naddresses = 0; + struct VasEBoot_net_network_level_address *addresses = 0; if (argc != 2 && argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("two arguments expected")); if (argc == 2) { - err = grub_net_resolve_address (args[1], &cmd_server); + err = VasEBoot_net_resolve_address (args[1], &cmd_server); if (err) return err; servers = &cmd_server; @@ -651,27 +651,27 @@ grub_cmd_nslookup (struct grub_command *cmd __attribute__ ((unused)), nservers = dns_nservers; } - grub_net_dns_lookup (args[0], servers, nservers, &naddresses, + VasEBoot_net_dns_lookup (args[0], servers, nservers, &naddresses, &addresses, 0); for (i = 0; i < naddresses; i++) { - char buf[GRUB_NET_MAX_STR_ADDR_LEN]; - grub_net_addr_to_str (&addresses[i], buf); - grub_printf ("%s\n", buf); + char buf[VasEBoot_NET_MAX_STR_ADDR_LEN]; + VasEBoot_net_addr_to_str (&addresses[i], buf); + VasEBoot_printf ("%s\n", buf); } - grub_free (addresses); + VasEBoot_free (addresses); if (naddresses) - return GRUB_ERR_NONE; - return grub_error (GRUB_ERR_NET_NO_DOMAIN, N_("no DNS record found")); + return VasEBoot_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_NET_NO_DOMAIN, N_("no DNS record found")); } -static grub_err_t -grub_cmd_list_dns (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_list_dns (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_size_t i; + VasEBoot_size_t i; const char *strtype = ""; for (i = 0; i < dns_nservers; i++) @@ -695,84 +695,84 @@ grub_cmd_list_dns (struct grub_command *cmd __attribute__ ((unused)), break; } - char buf[GRUB_NET_MAX_STR_ADDR_LEN]; - grub_net_addr_to_str (&dns_servers[i], buf); - grub_printf ("%s (%s)\n", buf, strtype); + char buf[VasEBoot_NET_MAX_STR_ADDR_LEN]; + VasEBoot_net_addr_to_str (&dns_servers[i], buf); + VasEBoot_printf ("%s (%s)\n", buf, strtype); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_add_dns (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_add_dns (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - grub_err_t err; - struct grub_net_network_level_address server; + VasEBoot_err_t err; + struct VasEBoot_net_network_level_address server; if ((argc < 1) || (argc > 2)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); else if (argc == 1) server.option = DNS_OPTION_PREFER_IPV4; else { - if (grub_strcmp (args[1], "--only-ipv4") == 0) + if (VasEBoot_strcmp (args[1], "--only-ipv4") == 0) server.option = DNS_OPTION_IPV4; - else if (grub_strcmp (args[1], "--only-ipv6") == 0) + else if (VasEBoot_strcmp (args[1], "--only-ipv6") == 0) server.option = DNS_OPTION_IPV6; - else if (grub_strcmp (args[1], "--prefer-ipv4") == 0) + else if (VasEBoot_strcmp (args[1], "--prefer-ipv4") == 0) server.option = DNS_OPTION_PREFER_IPV4; - else if (grub_strcmp (args[1], "--prefer-ipv6") == 0) + else if (VasEBoot_strcmp (args[1], "--prefer-ipv6") == 0) server.option = DNS_OPTION_PREFER_IPV6; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid argument")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid argument")); } - err = grub_net_resolve_address (args[0], &server); + err = VasEBoot_net_resolve_address (args[0], &server); if (err) return err; - return grub_net_add_dns_server (&server); + return VasEBoot_net_add_dns_server (&server); } -static grub_err_t -grub_cmd_del_dns (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_del_dns (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - grub_err_t err; - struct grub_net_network_level_address server; + VasEBoot_err_t err; + struct VasEBoot_net_network_level_address server; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); - err = grub_net_resolve_address (args[1], &server); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); + err = VasEBoot_net_resolve_address (args[1], &server); if (err) return err; - return grub_net_add_dns_server (&server); + return VasEBoot_net_add_dns_server (&server); } -static grub_command_t cmd, cmd_add, cmd_del, cmd_list; +static VasEBoot_command_t cmd, cmd_add, cmd_del, cmd_list; void -grub_dns_init (void) +VasEBoot_dns_init (void) { - cmd = grub_register_command ("net_nslookup", grub_cmd_nslookup, + cmd = VasEBoot_register_command ("net_nslookup", VasEBoot_cmd_nslookup, N_("ADDRESS DNSSERVER"), N_("Perform a DNS lookup")); - cmd_add = grub_register_command ("net_add_dns", grub_cmd_add_dns, + cmd_add = VasEBoot_register_command ("net_add_dns", VasEBoot_cmd_add_dns, N_("DNSSERVER"), N_("Add a DNS server")); - cmd_del = grub_register_command ("net_del_dns", grub_cmd_del_dns, + cmd_del = VasEBoot_register_command ("net_del_dns", VasEBoot_cmd_del_dns, N_("DNSSERVER"), N_("Remove a DNS server")); - cmd_list = grub_register_command ("net_ls_dns", grub_cmd_list_dns, + cmd_list = VasEBoot_register_command ("net_ls_dns", VasEBoot_cmd_list_dns, NULL, N_("List DNS servers")); } void -grub_dns_fini (void) +VasEBoot_dns_fini (void) { - grub_unregister_command (cmd); - grub_unregister_command (cmd_add); - grub_unregister_command (cmd_del); - grub_unregister_command (cmd_list); + VasEBoot_unregister_command (cmd); + VasEBoot_unregister_command (cmd_add); + VasEBoot_unregister_command (cmd_del); + VasEBoot_unregister_command (cmd_list); } diff --git a/VasEBoot-core/net/drivers/efi/efinet.c b/VasEBoot-core/net/drivers/efi/efinet.c index 5388f952b..93401c64c 100644 --- a/VasEBoot-core/net/drivers/efi/efinet.c +++ b/VasEBoot-core/net/drivers/efi/efinet.c @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* GUID. */ -static grub_efi_guid_t net_io_guid = GRUB_EFI_SIMPLE_NETWORK_GUID; -static grub_efi_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID; +static VasEBoot_efi_guid_t net_io_guid = VasEBoot_EFI_SIMPLE_NETWORK_GUID; +static VasEBoot_efi_guid_t pxe_io_guid = VasEBoot_EFI_PXE_GUID; -static grub_err_t -send_card_buffer (struct grub_net_card *dev, - struct grub_net_buff *pack) +static VasEBoot_err_t +send_card_buffer (struct VasEBoot_net_card *dev, + struct VasEBoot_net_buff *pack) { - grub_efi_status_t st; - grub_efi_simple_network_t *net = dev->efi_net; - grub_uint64_t limit_time = grub_get_time_ms () + 4000; + VasEBoot_efi_status_t st; + VasEBoot_efi_simple_network_t *net = dev->efi_net; + VasEBoot_uint64_t limit_time = VasEBoot_get_time_ms () + 4000; void *txbuf; if (dev->txbusy) @@ -44,8 +44,8 @@ send_card_buffer (struct grub_net_card *dev, { txbuf = NULL; st = efi_call_3 (net->get_status, net, 0, &txbuf); - if (st != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_IO, + if (st != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_IO, N_("couldn't send network packet")); /* Some buggy firmware could return an arbitrary address instead of the @@ -60,8 +60,8 @@ send_card_buffer (struct grub_net_card *dev, dev->txbusy = 0; break; } - if (limit_time < grub_get_time_ms ()) - return grub_error (GRUB_ERR_TIMEOUT, + if (limit_time < VasEBoot_get_time_ms ()) + return VasEBoot_error (VasEBoot_ERR_TIMEOUT, N_("couldn't send network packet")); } @@ -69,104 +69,104 @@ send_card_buffer (struct grub_net_card *dev, if (dev->last_pkt_size > dev->mtu) dev->last_pkt_size = dev->mtu; - grub_memcpy (dev->txbuf, pack->data, dev->last_pkt_size); + VasEBoot_memcpy (dev->txbuf, pack->data, dev->last_pkt_size); st = efi_call_7 (net->transmit, net, 0, dev->last_pkt_size, dev->txbuf, NULL, NULL, NULL); - if (st != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_IO, N_("couldn't send network packet")); + if (st != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_IO, N_("couldn't send network packet")); /* The card may have sent out the packet immediately - set txbusy to 0 in this case. Cases were observed where checking txbuf at the next call of send_card_buffer() is too late: 0 is returned in txbuf and - we run in the GRUB_ERR_TIMEOUT case above. + we run in the VasEBoot_ERR_TIMEOUT case above. Perhaps a timeout in the FW has discarded the recycle buffer. */ txbuf = NULL; st = efi_call_3 (net->get_status, net, 0, &txbuf); - dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf); + dev->txbusy = !(st == VasEBoot_EFI_SUCCESS && txbuf); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_net_buff * -get_card_packet (struct grub_net_card *dev) +static struct VasEBoot_net_buff * +get_card_packet (struct VasEBoot_net_card *dev) { - grub_efi_simple_network_t *net = dev->efi_net; - grub_err_t err; - grub_efi_status_t st; - grub_efi_uintn_t bufsize = dev->rcvbufsize; - struct grub_net_buff *nb; + VasEBoot_efi_simple_network_t *net = dev->efi_net; + VasEBoot_err_t err; + VasEBoot_efi_status_t st; + VasEBoot_efi_uintn_t bufsize = dev->rcvbufsize; + struct VasEBoot_net_buff *nb; int i; for (i = 0; i < 2; i++) { if (!dev->rcvbuf) - dev->rcvbuf = grub_malloc (dev->rcvbufsize); + dev->rcvbuf = VasEBoot_malloc (dev->rcvbufsize); if (!dev->rcvbuf) return NULL; st = efi_call_7 (net->receive, net, NULL, &bufsize, dev->rcvbuf, NULL, NULL, NULL); - if (st != GRUB_EFI_BUFFER_TOO_SMALL) + if (st != VasEBoot_EFI_BUFFER_TOO_SMALL) break; dev->rcvbufsize = 2 * ALIGN_UP (dev->rcvbufsize > bufsize ? dev->rcvbufsize : bufsize, 64); - grub_free (dev->rcvbuf); + VasEBoot_free (dev->rcvbuf); dev->rcvbuf = 0; } - if (st != GRUB_EFI_SUCCESS) + if (st != VasEBoot_EFI_SUCCESS) return NULL; - nb = grub_netbuff_alloc (bufsize + 2); + nb = VasEBoot_netbuff_alloc (bufsize + 2); if (!nb) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ - if (grub_netbuff_reserve (nb, 2)) + if (VasEBoot_netbuff_reserve (nb, 2)) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } - grub_memcpy (nb->data, dev->rcvbuf, bufsize); - err = grub_netbuff_put (nb, bufsize); + VasEBoot_memcpy (nb->data, dev->rcvbuf, bufsize); + err = VasEBoot_netbuff_put (nb, bufsize); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } return nb; } -static grub_err_t -open_card (struct grub_net_card *dev) +static VasEBoot_err_t +open_card (struct VasEBoot_net_card *dev) { - grub_efi_simple_network_t *net; + VasEBoot_efi_simple_network_t *net; /* Try to reopen SNP exlusively to close any active MNP protocol instance that may compete for packet polling */ - net = grub_efi_open_protocol (dev->efi_handle, &net_io_guid, - GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE); + net = VasEBoot_efi_open_protocol (dev->efi_handle, &net_io_guid, + VasEBoot_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE); if (net) { - if (net->mode->state == GRUB_EFI_NETWORK_STOPPED - && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_NET_NO_CARD, "%s: net start failed", + if (net->mode->state == VasEBoot_EFI_NETWORK_STOPPED + && efi_call_1 (net->start, net) != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_NET_NO_CARD, "%s: net start failed", dev->name); - if (net->mode->state == GRUB_EFI_NETWORK_STOPPED) - return grub_error (GRUB_ERR_NET_NO_CARD, "%s: card stopped", + if (net->mode->state == VasEBoot_EFI_NETWORK_STOPPED) + return VasEBoot_error (VasEBoot_ERR_NET_NO_CARD, "%s: card stopped", dev->name); - if (net->mode->state == GRUB_EFI_NETWORK_STARTED - && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_NET_NO_CARD, "%s: net initialize failed", + if (net->mode->state == VasEBoot_EFI_NETWORK_STARTED + && efi_call_3 (net->initialize, net, 0, 0) != VasEBoot_EFI_SUCCESS) + return VasEBoot_error (VasEBoot_ERR_NET_NO_CARD, "%s: net initialize failed", dev->name); /* Enable hardware receive filters if driver declares support for it. @@ -180,39 +180,39 @@ open_card (struct grub_net_card *dev) */ if (net->mode->receive_filter_mask) { - grub_uint32_t filters = GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST | - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST | - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST; + VasEBoot_uint32_t filters = VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST | + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST | + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST; filters &= net->mode->receive_filter_mask; - if (!(filters & GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST)) + if (!(filters & VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST)) filters |= (net->mode->receive_filter_mask & - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS); + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS); efi_call_6 (net->receive_filters, net, filters, 0, 0, 0, NULL); } - efi_call_4 (grub_efi_system_table->boot_services->close_protocol, + efi_call_4 (VasEBoot_efi_system_table->boot_services->close_protocol, dev->efi_net, &net_io_guid, - grub_efi_image_handle, dev->efi_handle); + VasEBoot_efi_image_handle, dev->efi_handle); dev->efi_net = net; } /* If it failed we just try to run as best as we can */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -close_card (struct grub_net_card *dev) +close_card (struct VasEBoot_net_card *dev) { efi_call_1 (dev->efi_net->shutdown, dev->efi_net); efi_call_1 (dev->efi_net->stop, dev->efi_net); - efi_call_4 (grub_efi_system_table->boot_services->close_protocol, + efi_call_4 (VasEBoot_efi_system_table->boot_services->close_protocol, dev->efi_net, &net_io_guid, - grub_efi_image_handle, dev->efi_handle); + VasEBoot_efi_image_handle, dev->efi_handle); } -static struct grub_net_card_driver efidriver = +static struct VasEBoot_net_card_driver efidriver = { .name = "efinet", .open = open_card, @@ -221,8 +221,8 @@ static struct grub_net_card_driver efidriver = .recv = get_card_packet }; -grub_efi_handle_t -grub_efinet_get_device_handle (struct grub_net_card *card) +VasEBoot_efi_handle_t +VasEBoot_efinet_get_device_handle (struct VasEBoot_net_card *card) { if (!card || card->driver != &efidriver) return 0; @@ -230,124 +230,124 @@ grub_efinet_get_device_handle (struct grub_net_card *card) } static void -grub_efinet_findcards (void) +VasEBoot_efinet_findcards (void) { - grub_efi_uintn_t num_handles; - grub_efi_handle_t *handles; - grub_efi_handle_t *handle; + VasEBoot_efi_uintn_t num_handles; + VasEBoot_efi_handle_t *handles; + VasEBoot_efi_handle_t *handle; int i = 0; /* Find handles which support the disk io interface. */ - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &net_io_guid, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_BY_PROTOCOL, &net_io_guid, 0, &num_handles); if (! handles) return; for (handle = handles; num_handles--; handle++) { - grub_efi_simple_network_t *net; - struct grub_net_card *card; - grub_efi_device_path_t *dp, *parent = NULL, *child = NULL; + VasEBoot_efi_simple_network_t *net; + struct VasEBoot_net_card *card; + VasEBoot_efi_device_path_t *dp, *parent = NULL, *child = NULL; /* EDK2 UEFI PXE driver creates IPv4 and IPv6 messaging devices as children of main MAC messaging device. We only need one device with bound SNP per physical card, otherwise they compete with each other when polling for incoming packets. */ - dp = grub_efi_get_device_path (*handle); + dp = VasEBoot_efi_get_device_path (*handle); if (!dp) continue; - for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp); dp = GRUB_EFI_NEXT_DEVICE_PATH (dp)) + for (; ! VasEBoot_EFI_END_ENTIRE_DEVICE_PATH (dp); dp = VasEBoot_EFI_NEXT_DEVICE_PATH (dp)) { parent = child; child = dp; } if (child - && GRUB_EFI_DEVICE_PATH_TYPE (child) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE - && (GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE - || GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) + && VasEBoot_EFI_DEVICE_PATH_TYPE (child) == VasEBoot_EFI_MESSAGING_DEVICE_PATH_TYPE + && (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (child) == VasEBoot_EFI_IPV4_DEVICE_PATH_SUBTYPE + || VasEBoot_EFI_DEVICE_PATH_SUBTYPE (child) == VasEBoot_EFI_IPV6_DEVICE_PATH_SUBTYPE) && parent - && GRUB_EFI_DEVICE_PATH_TYPE (parent) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE - && GRUB_EFI_DEVICE_PATH_SUBTYPE (parent) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE) + && VasEBoot_EFI_DEVICE_PATH_TYPE (parent) == VasEBoot_EFI_MESSAGING_DEVICE_PATH_TYPE + && VasEBoot_EFI_DEVICE_PATH_SUBTYPE (parent) == VasEBoot_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE) continue; - net = grub_efi_open_protocol (*handle, &net_io_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + net = VasEBoot_efi_open_protocol (*handle, &net_io_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (! net) /* This should not happen... Why? */ continue; - if (net->mode->state == GRUB_EFI_NETWORK_STOPPED - && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS) + if (net->mode->state == VasEBoot_EFI_NETWORK_STOPPED + && efi_call_1 (net->start, net) != VasEBoot_EFI_SUCCESS) continue; - if (net->mode->state == GRUB_EFI_NETWORK_STOPPED) + if (net->mode->state == VasEBoot_EFI_NETWORK_STOPPED) continue; - if (net->mode->state == GRUB_EFI_NETWORK_STARTED - && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS) + if (net->mode->state == VasEBoot_EFI_NETWORK_STARTED + && efi_call_3 (net->initialize, net, 0, 0) != VasEBoot_EFI_SUCCESS) continue; - card = grub_zalloc (sizeof (struct grub_net_card)); + card = VasEBoot_zalloc (sizeof (struct VasEBoot_net_card)); if (!card) { - grub_print_error (); - grub_free (handles); + VasEBoot_print_error (); + VasEBoot_free (handles); return; } card->mtu = net->mode->max_packet_size; card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; - card->txbuf = grub_zalloc (card->txbufsize); + card->txbuf = VasEBoot_zalloc (card->txbufsize); if (!card->txbuf) { - grub_print_error (); - grub_free (handles); - grub_free (card); + VasEBoot_print_error (); + VasEBoot_free (handles); + VasEBoot_free (card); return; } card->txbusy = 0; card->rcvbufsize = ALIGN_UP (card->mtu, 64) + 256; - card->name = grub_xasprintf ("efinet%d", i++); + card->name = VasEBoot_xasprintf ("efinet%d", i++); card->driver = &efidriver; card->flags = 0; - card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (card->default_address.mac, + card->default_address.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (card->default_address.mac, net->mode->current_address, sizeof (card->default_address.mac)); card->efi_net = net; card->efi_handle = *handle; - grub_net_card_register (card); + VasEBoot_net_card_register (card); } - grub_free (handles); + VasEBoot_free (handles); } static void -grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, +VasEBoot_efi_net_config_real (VasEBoot_efi_handle_t hnd, char **device, char **path) { - struct grub_net_card *card; - grub_efi_device_path_t *dp; + struct VasEBoot_net_card *card; + VasEBoot_efi_device_path_t *dp; - dp = grub_efi_get_device_path (hnd); + dp = VasEBoot_efi_get_device_path (hnd); if (! dp) return; FOR_NET_CARDS (card) { - grub_efi_device_path_t *cdp; - struct grub_efi_pxe *pxe; - struct grub_efi_pxe_mode *pxe_mode; + VasEBoot_efi_device_path_t *cdp; + struct VasEBoot_efi_pxe *pxe; + struct VasEBoot_efi_pxe_mode *pxe_mode; if (card->driver != &efidriver) continue; - cdp = grub_efi_get_device_path (card->efi_handle); + cdp = VasEBoot_efi_get_device_path (card->efi_handle); if (! cdp) continue; - if (grub_efi_compare_device_paths (dp, cdp) != 0) + if (VasEBoot_efi_compare_device_paths (dp, cdp) != 0) { - grub_efi_device_path_t *ldp, *dup_dp, *dup_ldp; + VasEBoot_efi_device_path_t *ldp, *dup_dp, *dup_ldp; int match; /* EDK2 UEFI PXE driver creates pseudo devices with type IPv4/IPv6 @@ -356,30 +356,30 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, devices. We skip them when enumerating cards, so here we need to find matching MAC device. */ - ldp = grub_efi_find_last_device_path (dp); - if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE - || (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE - && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE)) + ldp = VasEBoot_efi_find_last_device_path (dp); + if (VasEBoot_EFI_DEVICE_PATH_TYPE (ldp) != VasEBoot_EFI_MESSAGING_DEVICE_PATH_TYPE + || (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (ldp) != VasEBoot_EFI_IPV4_DEVICE_PATH_SUBTYPE + && VasEBoot_EFI_DEVICE_PATH_SUBTYPE (ldp) != VasEBoot_EFI_IPV6_DEVICE_PATH_SUBTYPE)) continue; - dup_dp = grub_efi_duplicate_device_path (dp); + dup_dp = VasEBoot_efi_duplicate_device_path (dp); if (!dup_dp) continue; - dup_ldp = grub_efi_find_last_device_path (dup_dp); - dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + dup_ldp = VasEBoot_efi_find_last_device_path (dup_dp); + dup_ldp->type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + dup_ldp->subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; dup_ldp->length = sizeof (*dup_ldp); - match = grub_efi_compare_device_paths (dup_dp, cdp) == 0; - grub_free (dup_dp); + match = VasEBoot_efi_compare_device_paths (dup_dp, cdp) == 0; + VasEBoot_free (dup_dp); if (!match) continue; } - pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + pxe = VasEBoot_efi_open_protocol (hnd, &pxe_io_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (! pxe) continue; pxe_mode = pxe->mode; - grub_net_configure_by_dhcp_ack (card->name, card, 0, - (struct grub_net_bootp_packet *) + VasEBoot_net_configure_by_dhcp_ack (card->name, card, 0, + (struct VasEBoot_net_bootp_packet *) &pxe_mode->dhcp_ack, sizeof (pxe_mode->dhcp_ack), 1, device, path); @@ -387,18 +387,18 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, } } -GRUB_MOD_INIT(efinet) +VasEBoot_MOD_INIT(efinet) { - grub_efinet_findcards (); - grub_efi_net_config = grub_efi_net_config_real; + VasEBoot_efinet_findcards (); + VasEBoot_efi_net_config = VasEBoot_efi_net_config_real; } -GRUB_MOD_FINI(efinet) +VasEBoot_MOD_FINI(efinet) { - struct grub_net_card *card, *next; + struct VasEBoot_net_card *card, *next; FOR_NET_CARDS_SAFE (card, next) if (card->driver == &efidriver) - grub_net_card_unregister (card); + VasEBoot_net_card_unregister (card); } diff --git a/VasEBoot-core/net/drivers/emu/emunet.c b/VasEBoot-core/net/drivers/emu/emunet.c index b19492086..f63eda256 100644 --- a/VasEBoot-core/net/drivers/emu/emunet.c +++ b/VasEBoot-core/net/drivers/emu/emunet.c @@ -1,116 +1,116 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -send_card_buffer (struct grub_net_card *dev __attribute__ ((unused)), - struct grub_net_buff *pack); +static VasEBoot_err_t +send_card_buffer (struct VasEBoot_net_card *dev __attribute__ ((unused)), + struct VasEBoot_net_buff *pack); -static struct grub_net_buff * -get_card_packet (struct grub_net_card *dev __attribute__ ((unused))); +static struct VasEBoot_net_buff * +get_card_packet (struct VasEBoot_net_card *dev __attribute__ ((unused))); -static struct grub_net_card_driver emudriver = +static struct VasEBoot_net_card_driver emudriver = { .name = "emu", .send = send_card_buffer, .recv = get_card_packet }; -static struct grub_net_card emucard = +static struct VasEBoot_net_card emucard = { .name = "emu0", .driver = &emudriver, .mtu = 1500, .default_address = { - .type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET, + .type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET, {.mac = {0, 1, 2, 3, 4, 5}} }, .flags = 0 }; -static grub_err_t -send_card_buffer (struct grub_net_card *dev __attribute__ ((unused)), - struct grub_net_buff *pack) +static VasEBoot_err_t +send_card_buffer (struct VasEBoot_net_card *dev __attribute__ ((unused)), + struct VasEBoot_net_buff *pack) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; - actual = grub_emunet_send (pack->data, pack->tail - pack->data); + actual = VasEBoot_emunet_send (pack->data, pack->tail - pack->data); if (actual < 0) - return grub_error (GRUB_ERR_IO, N_("couldn't send network packet")); + return VasEBoot_error (VasEBoot_ERR_IO, N_("couldn't send network packet")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_net_buff * -get_card_packet (struct grub_net_card *dev __attribute__ ((unused))) +static struct VasEBoot_net_buff * +get_card_packet (struct VasEBoot_net_card *dev __attribute__ ((unused))) { - grub_ssize_t actual; - struct grub_net_buff *nb; + VasEBoot_ssize_t actual; + struct VasEBoot_net_buff *nb; - nb = grub_netbuff_alloc (emucard.mtu + 36 + 2); + nb = VasEBoot_netbuff_alloc (emucard.mtu + 36 + 2); if (!nb) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ - grub_netbuff_reserve (nb, 2); + VasEBoot_netbuff_reserve (nb, 2); if (!nb) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } - actual = grub_emunet_receive (nb->data, emucard.mtu + 36); + actual = VasEBoot_emunet_receive (nb->data, emucard.mtu + 36); if (actual < 0) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } - grub_netbuff_put (nb, actual); + VasEBoot_netbuff_put (nb, actual); return nb; } static int registered = 0; -GRUB_MOD_INIT(emunet) +VasEBoot_MOD_INIT(emunet) { - if (!grub_emunet_create (&emucard.mtu)) + if (!VasEBoot_emunet_create (&emucard.mtu)) { - grub_net_card_register (&emucard); + VasEBoot_net_card_register (&emucard); registered = 1; } } -GRUB_MOD_FINI(emunet) +VasEBoot_MOD_FINI(emunet) { if (registered) { - grub_emunet_close (); - grub_net_card_unregister (&emucard); + VasEBoot_emunet_close (); + VasEBoot_net_card_unregister (&emucard); registered = 0; } } diff --git a/VasEBoot-core/net/drivers/i386/pc/pxe.c b/VasEBoot-core/net/drivers/i386/pc/pxe.c index 3f4152d03..6dcb2315a 100644 --- a/VasEBoot-core/net/drivers/i386/pc/pxe.c +++ b/VasEBoot-core/net/drivers/i386/pc/pxe.c @@ -1,149 +1,149 @@ /* pxe.c - Driver to provide access to the pxe filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define SEGMENT(x) ((x) >> 4) #define OFFSET(x) ((x) & 0xF) #define SEGOFS(x) ((SEGMENT(x) << 16) + OFFSET(x)) #define LINEAR(x) (void *) ((((x) >> 16) << 4) + ((x) & 0xFFFF)) -struct grub_pxe_undi_open +struct VasEBoot_pxe_undi_open { - grub_uint16_t status; - grub_uint16_t open_flag; - grub_uint16_t pkt_filter; - grub_uint16_t mcast_count; - grub_uint8_t mcast[8][6]; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint16_t open_flag; + VasEBoot_uint16_t pkt_filter; + VasEBoot_uint16_t mcast_count; + VasEBoot_uint8_t mcast[8][6]; +} VasEBoot_PACKED; -struct grub_pxe_undi_info +struct VasEBoot_pxe_undi_info { - grub_uint16_t status; - grub_uint16_t base_io; - grub_uint16_t int_number; - grub_uint16_t mtu; - grub_uint16_t hwtype; - grub_uint16_t hwaddrlen; - grub_uint8_t current_addr[16]; - grub_uint8_t permanent_addr[16]; - grub_uint32_t romaddr; - grub_uint16_t rxbufct; - grub_uint16_t txbufct; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint16_t base_io; + VasEBoot_uint16_t int_number; + VasEBoot_uint16_t mtu; + VasEBoot_uint16_t hwtype; + VasEBoot_uint16_t hwaddrlen; + VasEBoot_uint8_t current_addr[16]; + VasEBoot_uint8_t permanent_addr[16]; + VasEBoot_uint32_t romaddr; + VasEBoot_uint16_t rxbufct; + VasEBoot_uint16_t txbufct; +} VasEBoot_PACKED; -struct grub_pxe_undi_isr +struct VasEBoot_pxe_undi_isr { - grub_uint16_t status; - grub_uint16_t func_flag; - grub_uint16_t buffer_len; - grub_uint16_t frame_len; - grub_uint16_t frame_hdr_len; - grub_uint32_t buffer; - grub_uint8_t prot_type; - grub_uint8_t pkt_type; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint16_t func_flag; + VasEBoot_uint16_t buffer_len; + VasEBoot_uint16_t frame_len; + VasEBoot_uint16_t frame_hdr_len; + VasEBoot_uint32_t buffer; + VasEBoot_uint8_t prot_type; + VasEBoot_uint8_t pkt_type; +} VasEBoot_PACKED; enum { - GRUB_PXE_ISR_IN_START = 1, - GRUB_PXE_ISR_IN_PROCESS, - GRUB_PXE_ISR_IN_GET_NEXT + VasEBoot_PXE_ISR_IN_START = 1, + VasEBoot_PXE_ISR_IN_PROCESS, + VasEBoot_PXE_ISR_IN_GET_NEXT }; enum { - GRUB_PXE_ISR_OUT_OURS = 0, - GRUB_PXE_ISR_OUT_NOT_OURS = 1 + VasEBoot_PXE_ISR_OUT_OURS = 0, + VasEBoot_PXE_ISR_OUT_NOT_OURS = 1 }; enum { - GRUB_PXE_ISR_OUT_DONE = 0, - GRUB_PXE_ISR_OUT_TRANSMIT = 2, - GRUB_PXE_ISR_OUT_RECEIVE = 3, - GRUB_PXE_ISR_OUT_BUSY = 4, + VasEBoot_PXE_ISR_OUT_DONE = 0, + VasEBoot_PXE_ISR_OUT_TRANSMIT = 2, + VasEBoot_PXE_ISR_OUT_RECEIVE = 3, + VasEBoot_PXE_ISR_OUT_BUSY = 4, }; -struct grub_pxe_undi_transmit +struct VasEBoot_pxe_undi_transmit { - grub_uint16_t status; - grub_uint8_t protocol; - grub_uint8_t xmitflag; - grub_uint32_t dest; - grub_uint32_t tbd; - grub_uint32_t reserved[2]; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint8_t protocol; + VasEBoot_uint8_t xmitflag; + VasEBoot_uint32_t dest; + VasEBoot_uint32_t tbd; + VasEBoot_uint32_t reserved[2]; +} VasEBoot_PACKED; -struct grub_pxe_undi_tbd +struct VasEBoot_pxe_undi_tbd { - grub_uint16_t len; - grub_uint32_t buf; - grub_uint16_t blk_count; + VasEBoot_uint16_t len; + VasEBoot_uint32_t buf; + VasEBoot_uint16_t blk_count; struct { - grub_uint8_t ptr_type; - grub_uint8_t reserved; - grub_uint16_t len; - grub_uint32_t ptr; + VasEBoot_uint8_t ptr_type; + VasEBoot_uint8_t reserved; + VasEBoot_uint16_t len; + VasEBoot_uint32_t ptr; } blocks[8]; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_pxe_bangpxe *grub_pxe_pxenv; -static grub_uint32_t pxe_rm_entry = 0; +struct VasEBoot_pxe_bangpxe *VasEBoot_pxe_pxenv; +static VasEBoot_uint32_t pxe_rm_entry = 0; -static struct grub_pxe_bangpxe * -grub_pxe_scan (void) +static struct VasEBoot_pxe_bangpxe * +VasEBoot_pxe_scan (void) { - struct grub_bios_int_registers regs; - struct grub_pxenv *pxenv; - struct grub_pxe_bangpxe *bangpxe; + struct VasEBoot_bios_int_registers regs; + struct VasEBoot_pxenv *pxenv; + struct VasEBoot_pxe_bangpxe *bangpxe; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.ebx = 0; regs.ecx = 0; regs.eax = 0x5650; regs.es = 0; - grub_bios_interrupt (0x1a, ®s); + VasEBoot_bios_interrupt (0x1a, ®s); if ((regs.eax & 0xffff) != 0x564e) return NULL; - pxenv = (struct grub_pxenv *) ((regs.es << 4) + (regs.ebx & 0xffff)); - if (grub_memcmp (pxenv->signature, GRUB_PXE_SIGNATURE, + pxenv = (struct VasEBoot_pxenv *) ((regs.es << 4) + (regs.ebx & 0xffff)); + if (VasEBoot_memcmp (pxenv->signature, VasEBoot_PXE_SIGNATURE, sizeof (pxenv->signature)) != 0) return NULL; @@ -157,7 +157,7 @@ grub_pxe_scan (void) if (!bangpxe) return NULL; - if (grub_memcmp (bangpxe->signature, GRUB_PXE_BANGPXE_SIGNATURE, + if (VasEBoot_memcmp (bangpxe->signature, VasEBoot_PXE_BANGPXE_SIGNATURE, sizeof (bangpxe->signature)) != 0) return NULL; @@ -166,23 +166,23 @@ grub_pxe_scan (void) return bangpxe; } -static struct grub_net_buff * -grub_pxe_recv (struct grub_net_card *dev __attribute__ ((unused))) +static struct VasEBoot_net_buff * +VasEBoot_pxe_recv (struct VasEBoot_net_card *dev __attribute__ ((unused))) { - struct grub_pxe_undi_isr *isr; + struct VasEBoot_pxe_undi_isr *isr; static int in_progress = 0; - grub_uint8_t *ptr, *end; - struct grub_net_buff *buf; + VasEBoot_uint8_t *ptr, *end; + struct VasEBoot_net_buff *buf; - isr = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + isr = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; if (!in_progress) { - grub_memset (isr, 0, sizeof (*isr)); - isr->func_flag = GRUB_PXE_ISR_IN_START; - grub_pxe_call (GRUB_PXENV_UNDI_ISR, isr, pxe_rm_entry); + VasEBoot_memset (isr, 0, sizeof (*isr)); + isr->func_flag = VasEBoot_PXE_ISR_IN_START; + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_ISR, isr, pxe_rm_entry); /* Normally according to the specification we should also check - that isr->func_flag != GRUB_PXE_ISR_OUT_OURS but unfortunately it + that isr->func_flag != VasEBoot_PXE_ISR_OUT_OURS but unfortunately it breaks on intel cards. */ if (isr->status) @@ -190,57 +190,57 @@ grub_pxe_recv (struct grub_net_card *dev __attribute__ ((unused))) in_progress = 0; return NULL; } - grub_memset (isr, 0, sizeof (*isr)); - isr->func_flag = GRUB_PXE_ISR_IN_PROCESS; - grub_pxe_call (GRUB_PXENV_UNDI_ISR, isr, pxe_rm_entry); + VasEBoot_memset (isr, 0, sizeof (*isr)); + isr->func_flag = VasEBoot_PXE_ISR_IN_PROCESS; + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_ISR, isr, pxe_rm_entry); } else { - grub_memset (isr, 0, sizeof (*isr)); - isr->func_flag = GRUB_PXE_ISR_IN_GET_NEXT; - grub_pxe_call (GRUB_PXENV_UNDI_ISR, isr, pxe_rm_entry); + VasEBoot_memset (isr, 0, sizeof (*isr)); + isr->func_flag = VasEBoot_PXE_ISR_IN_GET_NEXT; + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_ISR, isr, pxe_rm_entry); } - while (isr->func_flag != GRUB_PXE_ISR_OUT_RECEIVE) + while (isr->func_flag != VasEBoot_PXE_ISR_OUT_RECEIVE) { - if (isr->status || isr->func_flag == GRUB_PXE_ISR_OUT_DONE) + if (isr->status || isr->func_flag == VasEBoot_PXE_ISR_OUT_DONE) { in_progress = 0; return NULL; } - grub_memset (isr, 0, sizeof (*isr)); - isr->func_flag = GRUB_PXE_ISR_IN_GET_NEXT; - grub_pxe_call (GRUB_PXENV_UNDI_ISR, isr, pxe_rm_entry); + VasEBoot_memset (isr, 0, sizeof (*isr)); + isr->func_flag = VasEBoot_PXE_ISR_IN_GET_NEXT; + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_ISR, isr, pxe_rm_entry); } - buf = grub_netbuff_alloc (isr->frame_len + 2); + buf = VasEBoot_netbuff_alloc (isr->frame_len + 2); if (!buf) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ - if (grub_netbuff_reserve (buf, 2)) + if (VasEBoot_netbuff_reserve (buf, 2)) { - grub_netbuff_free (buf); + VasEBoot_netbuff_free (buf); return NULL; } ptr = buf->data; end = ptr + isr->frame_len; - grub_netbuff_put (buf, isr->frame_len); - grub_memcpy (ptr, LINEAR (isr->buffer), isr->buffer_len); + VasEBoot_netbuff_put (buf, isr->frame_len); + VasEBoot_memcpy (ptr, LINEAR (isr->buffer), isr->buffer_len); ptr += isr->buffer_len; while (ptr < end) { - grub_memset (isr, 0, sizeof (*isr)); - isr->func_flag = GRUB_PXE_ISR_IN_GET_NEXT; - grub_pxe_call (GRUB_PXENV_UNDI_ISR, isr, pxe_rm_entry); - if (isr->status || isr->func_flag != GRUB_PXE_ISR_OUT_RECEIVE) + VasEBoot_memset (isr, 0, sizeof (*isr)); + isr->func_flag = VasEBoot_PXE_ISR_IN_GET_NEXT; + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_ISR, isr, pxe_rm_entry); + if (isr->status || isr->func_flag != VasEBoot_PXE_ISR_OUT_RECEIVE) { in_progress = 1; - grub_netbuff_free (buf); + VasEBoot_netbuff_free (buf); return NULL; } - grub_memcpy (ptr, LINEAR (isr->buffer), isr->buffer_len); + VasEBoot_memcpy (ptr, LINEAR (isr->buffer), isr->buffer_len); ptr += isr->buffer_len; } in_progress = 1; @@ -248,107 +248,107 @@ grub_pxe_recv (struct grub_net_card *dev __attribute__ ((unused))) return buf; } -static grub_err_t -grub_pxe_send (struct grub_net_card *dev __attribute__ ((unused)), - struct grub_net_buff *pack) +static VasEBoot_err_t +VasEBoot_pxe_send (struct VasEBoot_net_card *dev __attribute__ ((unused)), + struct VasEBoot_net_buff *pack) { - struct grub_pxe_undi_transmit *trans; - struct grub_pxe_undi_tbd *tbd; + struct VasEBoot_pxe_undi_transmit *trans; + struct VasEBoot_pxe_undi_tbd *tbd; char *buf; - trans = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_memset (trans, 0, sizeof (*trans)); - tbd = (void *) (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + 128); - grub_memset (tbd, 0, sizeof (*tbd)); - buf = (void *) (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + 256); - grub_memcpy (buf, pack->data, pack->tail - pack->data); + trans = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_memset (trans, 0, sizeof (*trans)); + tbd = (void *) (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR + 128); + VasEBoot_memset (tbd, 0, sizeof (*tbd)); + buf = (void *) (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR + 256); + VasEBoot_memcpy (buf, pack->data, pack->tail - pack->data); - trans->tbd = SEGOFS ((grub_addr_t) tbd); + trans->tbd = SEGOFS ((VasEBoot_addr_t) tbd); trans->protocol = 0; tbd->len = pack->tail - pack->data; - tbd->buf = SEGOFS ((grub_addr_t) buf); + tbd->buf = SEGOFS ((VasEBoot_addr_t) buf); - grub_pxe_call (GRUB_PXENV_UNDI_TRANSMIT, trans, pxe_rm_entry); + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_TRANSMIT, trans, pxe_rm_entry); if (trans->status) - return grub_error (GRUB_ERR_IO, N_("couldn't send network packet")); + return VasEBoot_error (VasEBoot_ERR_IO, N_("couldn't send network packet")); return 0; } static void -grub_pxe_close (struct grub_net_card *dev __attribute__ ((unused))) +VasEBoot_pxe_close (struct VasEBoot_net_card *dev __attribute__ ((unused))) { if (pxe_rm_entry) - grub_pxe_call (GRUB_PXENV_UNDI_CLOSE, - (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_CLOSE, + (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, pxe_rm_entry); } -static grub_err_t -grub_pxe_open (struct grub_net_card *dev __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_pxe_open (struct VasEBoot_net_card *dev __attribute__ ((unused))) { - struct grub_pxe_undi_open *ou; - ou = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_memset (ou, 0, sizeof (*ou)); + struct VasEBoot_pxe_undi_open *ou; + ou = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_memset (ou, 0, sizeof (*ou)); ou->pkt_filter = 4; - grub_pxe_call (GRUB_PXENV_UNDI_OPEN, ou, pxe_rm_entry); + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_OPEN, ou, pxe_rm_entry); if (ou->status) - return grub_error (GRUB_ERR_IO, "can't open UNDI"); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_IO, "can't open UNDI"); + return VasEBoot_ERR_NONE; } -struct grub_net_card_driver grub_pxe_card_driver = +struct VasEBoot_net_card_driver VasEBoot_pxe_card_driver = { - .open = grub_pxe_open, - .close = grub_pxe_close, - .send = grub_pxe_send, - .recv = grub_pxe_recv + .open = VasEBoot_pxe_open, + .close = VasEBoot_pxe_close, + .send = VasEBoot_pxe_send, + .recv = VasEBoot_pxe_recv }; -struct grub_net_card grub_pxe_card = +struct VasEBoot_net_card VasEBoot_pxe_card = { - .driver = &grub_pxe_card_driver, + .driver = &VasEBoot_pxe_card_driver, .name = "pxe" }; -static grub_err_t -grub_pxe_shutdown (int flags) +static VasEBoot_err_t +VasEBoot_pxe_shutdown (int flags) { - if (flags & GRUB_LOADER_FLAG_PXE_NOT_UNLOAD) - return GRUB_ERR_NONE; + if (flags & VasEBoot_LOADER_FLAG_PXE_NOT_UNLOAD) + return VasEBoot_ERR_NONE; if (!pxe_rm_entry) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - grub_pxe_call (GRUB_PXENV_UNDI_CLOSE, - (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_CLOSE, + (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, pxe_rm_entry); - grub_pxe_call (GRUB_PXENV_UNDI_SHUTDOWN, - (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_SHUTDOWN, + (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, pxe_rm_entry); - grub_pxe_call (GRUB_PXENV_UNLOAD_STACK, - (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, + VasEBoot_pxe_call (VasEBoot_PXENV_UNLOAD_STACK, + (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR, pxe_rm_entry); pxe_rm_entry = 0; - grub_net_card_unregister (&grub_pxe_card); + VasEBoot_net_card_unregister (&VasEBoot_pxe_card); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Nothing we can do. */ -static grub_err_t -grub_pxe_restore (void) +static VasEBoot_err_t +VasEBoot_pxe_restore (void) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void * -grub_pxe_get_cached (grub_uint16_t type) +VasEBoot_pxe_get_cached (VasEBoot_uint16_t type) { - struct grub_pxenv_get_cached_info ci; + struct VasEBoot_pxenv_get_cached_info ci; ci.packet_type = type; ci.buffer = 0; ci.buffer_size = 0; - grub_pxe_call (GRUB_PXENV_GET_CACHED_INFO, &ci, pxe_rm_entry); + VasEBoot_pxe_call (VasEBoot_PXENV_GET_CACHED_INFO, &ci, pxe_rm_entry); if (ci.status) return 0; @@ -356,64 +356,64 @@ grub_pxe_get_cached (grub_uint16_t type) } static void -grub_pc_net_config_real (char **device, char **path) +VasEBoot_pc_net_config_real (char **device, char **path) { - struct grub_net_bootp_packet *bp; + struct VasEBoot_net_bootp_packet *bp; - bp = grub_pxe_get_cached (GRUB_PXENV_PACKET_TYPE_DHCP_ACK); + bp = VasEBoot_pxe_get_cached (VasEBoot_PXENV_PACKET_TYPE_DHCP_ACK); if (!bp) return; - grub_net_configure_by_dhcp_ack ("pxe", &grub_pxe_card, 0, - bp, GRUB_PXE_BOOTP_SIZE, + VasEBoot_net_configure_by_dhcp_ack ("pxe", &VasEBoot_pxe_card, 0, + bp, VasEBoot_PXE_BOOTP_SIZE, 1, device, path); } -static struct grub_preboot *fini_hnd; +static struct VasEBoot_preboot *fini_hnd; -GRUB_MOD_INIT(pxe) +VasEBoot_MOD_INIT(pxe) { - struct grub_pxe_bangpxe *pxenv; - struct grub_pxe_undi_info *ui; + struct VasEBoot_pxe_bangpxe *pxenv; + struct VasEBoot_pxe_undi_info *ui; unsigned i; - pxenv = grub_pxe_scan (); + pxenv = VasEBoot_pxe_scan (); if (! pxenv) return; - ui = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_memset (ui, 0, sizeof (*ui)); - grub_pxe_call (GRUB_PXENV_UNDI_GET_INFORMATION, ui, pxe_rm_entry); + ui = (void *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_memset (ui, 0, sizeof (*ui)); + VasEBoot_pxe_call (VasEBoot_PXENV_UNDI_GET_INFORMATION, ui, pxe_rm_entry); - grub_memcpy (grub_pxe_card.default_address.mac, ui->current_addr, - sizeof (grub_pxe_card.default_address.mac)); - for (i = 0; i < sizeof (grub_pxe_card.default_address.mac); i++) - if (grub_pxe_card.default_address.mac[i] != 0) + VasEBoot_memcpy (VasEBoot_pxe_card.default_address.mac, ui->current_addr, + sizeof (VasEBoot_pxe_card.default_address.mac)); + for (i = 0; i < sizeof (VasEBoot_pxe_card.default_address.mac); i++) + if (VasEBoot_pxe_card.default_address.mac[i] != 0) break; - if (i != sizeof (grub_pxe_card.default_address.mac)) + if (i != sizeof (VasEBoot_pxe_card.default_address.mac)) { - for (i = 0; i < sizeof (grub_pxe_card.default_address.mac); i++) - if (grub_pxe_card.default_address.mac[i] != 0xff) + for (i = 0; i < sizeof (VasEBoot_pxe_card.default_address.mac); i++) + if (VasEBoot_pxe_card.default_address.mac[i] != 0xff) break; } - if (i == sizeof (grub_pxe_card.default_address.mac)) - grub_memcpy (grub_pxe_card.default_address.mac, ui->permanent_addr, - sizeof (grub_pxe_card.default_address.mac)); - grub_pxe_card.mtu = ui->mtu; + if (i == sizeof (VasEBoot_pxe_card.default_address.mac)) + VasEBoot_memcpy (VasEBoot_pxe_card.default_address.mac, ui->permanent_addr, + sizeof (VasEBoot_pxe_card.default_address.mac)); + VasEBoot_pxe_card.mtu = ui->mtu; - grub_pxe_card.default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_pxe_card.default_address.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_net_card_register (&grub_pxe_card); - grub_pc_net_config = grub_pc_net_config_real; - fini_hnd = grub_loader_register_preboot_hook (grub_pxe_shutdown, - grub_pxe_restore, - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); + VasEBoot_net_card_register (&VasEBoot_pxe_card); + VasEBoot_pc_net_config = VasEBoot_pc_net_config_real; + fini_hnd = VasEBoot_loader_register_preboot_hook (VasEBoot_pxe_shutdown, + VasEBoot_pxe_restore, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_DISK); } -GRUB_MOD_FINI(pxe) +VasEBoot_MOD_FINI(pxe) { - grub_pc_net_config = 0; - grub_pxe_shutdown (0); - grub_loader_unregister_preboot_hook (fini_hnd); + VasEBoot_pc_net_config = 0; + VasEBoot_pxe_shutdown (0); + VasEBoot_loader_unregister_preboot_hook (fini_hnd); } diff --git a/VasEBoot-core/net/drivers/ieee1275/ofnet.c b/VasEBoot-core/net/drivers/ieee1275/ofnet.c index a78d164db..56ef8d71e 100644 --- a/VasEBoot-core/net/drivers/ieee1275/ofnet.c +++ b/VasEBoot-core/net/drivers/ieee1275/ofnet.c @@ -1,117 +1,117 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_ofnetcard_data +struct VasEBoot_ofnetcard_data { char *path; char *suffix; - grub_ieee1275_ihandle_t handle; + VasEBoot_ieee1275_ihandle_t handle; }; -static grub_err_t -card_open (struct grub_net_card *dev) +static VasEBoot_err_t +card_open (struct VasEBoot_net_card *dev) { int status; - struct grub_ofnetcard_data *data = dev->data; + struct VasEBoot_ofnetcard_data *data = dev->data; - status = grub_ieee1275_open (data->path, &(data->handle)); + status = VasEBoot_ieee1275_open (data->path, &(data->handle)); if (status) - return grub_error (GRUB_ERR_IO, "Couldn't open network card."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't open network card."); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -card_close (struct grub_net_card *dev) +card_close (struct VasEBoot_net_card *dev) { - struct grub_ofnetcard_data *data = dev->data; + struct VasEBoot_ofnetcard_data *data = dev->data; if (data->handle) - grub_ieee1275_close (data->handle); + VasEBoot_ieee1275_close (data->handle); } -static grub_err_t -send_card_buffer (struct grub_net_card *dev, struct grub_net_buff *pack) +static VasEBoot_err_t +send_card_buffer (struct VasEBoot_net_card *dev, struct VasEBoot_net_buff *pack) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; int status; - struct grub_ofnetcard_data *data = dev->data; - grub_size_t len; + struct VasEBoot_ofnetcard_data *data = dev->data; + VasEBoot_size_t len; len = (pack->tail - pack->data); if (len > dev->mtu) len = dev->mtu; - grub_memcpy (dev->txbuf, pack->data, len); - status = grub_ieee1275_write (data->handle, dev->txbuf, + VasEBoot_memcpy (dev->txbuf, pack->data, len); + status = VasEBoot_ieee1275_write (data->handle, dev->txbuf, len, &actual); if (status) - return grub_error (GRUB_ERR_IO, N_("couldn't send network packet")); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_IO, N_("couldn't send network packet")); + return VasEBoot_ERR_NONE; } -static struct grub_net_buff * -get_card_packet (struct grub_net_card *dev) +static struct VasEBoot_net_buff * +get_card_packet (struct VasEBoot_net_card *dev) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; int rc; - struct grub_ofnetcard_data *data = dev->data; - grub_uint64_t start_time; - struct grub_net_buff *nb; + struct VasEBoot_ofnetcard_data *data = dev->data; + VasEBoot_uint64_t start_time; + struct VasEBoot_net_buff *nb; - start_time = grub_get_time_ms (); + start_time = VasEBoot_get_time_ms (); do - rc = grub_ieee1275_read (data->handle, dev->rcvbuf, dev->rcvbufsize, &actual); - while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200)); + rc = VasEBoot_ieee1275_read (data->handle, dev->rcvbuf, dev->rcvbufsize, &actual); + while ((actual <= 0 || rc < 0) && (VasEBoot_get_time_ms () - start_time < 200)); if (actual <= 0) return NULL; - nb = grub_netbuff_alloc (actual + 2); + nb = VasEBoot_netbuff_alloc (actual + 2); if (!nb) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ - grub_netbuff_reserve (nb, 2); + VasEBoot_netbuff_reserve (nb, 2); - grub_memcpy (nb->data, dev->rcvbuf, actual); + VasEBoot_memcpy (nb->data, dev->rcvbuf, actual); - if (grub_netbuff_put (nb, actual)) + if (VasEBoot_netbuff_put (nb, actual)) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } return nb; } -static struct grub_net_card_driver ofdriver = +static struct VasEBoot_net_card_driver ofdriver = { .name = "ofnet", .open = card_open, @@ -146,35 +146,35 @@ enum }; static int -grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, - char **device, struct grub_net_card **card) +VasEBoot_ieee1275_parse_bootpath (const char *devpath, char *bootpath, + char **device, struct VasEBoot_net_card **card) { char *args; char *comma_char = 0; char *equal_char = 0; - grub_size_t field_counter = 0; + VasEBoot_size_t field_counter = 0; - grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask; - grub_net_link_level_address_t hw_addr; - grub_net_interface_flags_t flags = 0; - struct grub_net_network_level_interface *inter = NULL; + VasEBoot_net_network_level_address_t client_addr, gateway_addr, subnet_mask; + VasEBoot_net_link_level_address_t hw_addr; + VasEBoot_net_interface_flags_t flags = 0; + struct VasEBoot_net_network_level_interface *inter = NULL; - hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + hw_addr.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - args = bootpath + grub_strlen (devpath) + 1; + args = bootpath + VasEBoot_strlen (devpath) + 1; do { - comma_char = grub_strchr (args, ','); + comma_char = VasEBoot_strchr (args, ','); if (comma_char != 0) *comma_char = 0; /* Check if it's an option (like speed=auto) and not a default parameter */ - equal_char = grub_strchr (args, '='); + equal_char = VasEBoot_strchr (args, '='); if (equal_char != 0) { *equal_char = 0; - grub_env_set_net_property ((*card)->name, args, equal_char + 1, - grub_strlen(equal_char + 1)); + VasEBoot_env_set_net_property ((*card)->name, args, equal_char + 1, + VasEBoot_strlen(equal_char + 1)); *equal_char = '='; } else @@ -182,21 +182,21 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, switch (field_counter++) { case BOOTARGS_SERVER_ADDR: - *device = grub_xasprintf ("tftp,%s", args); + *device = VasEBoot_xasprintf ("tftp,%s", args); if (!*device) - return grub_errno; + return VasEBoot_errno; break; case BOOTARGS_CLIENT_ADDR: - grub_net_resolve_address (args, &client_addr); + VasEBoot_net_resolve_address (args, &client_addr); break; case BOOTARGS_GATEWAY_ADDR: - grub_net_resolve_address (args, &gateway_addr); + VasEBoot_net_resolve_address (args, &gateway_addr); break; case BOOTARGS_SUBNET_MASK: - grub_net_resolve_address (args, &subnet_mask); + VasEBoot_net_resolve_address (args, &subnet_mask); break; } } @@ -207,39 +207,39 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, if ((client_addr.ipv4 != 0) && (subnet_mask.ipv4 != 0)) { - grub_ieee1275_phandle_t devhandle; - grub_ieee1275_finddevice (devpath, &devhandle); - grub_ieee1275_get_property (devhandle, "mac-address", + VasEBoot_ieee1275_phandle_t devhandle; + VasEBoot_ieee1275_finddevice (devpath, &devhandle); + VasEBoot_ieee1275_get_property (devhandle, "mac-address", hw_addr.mac, sizeof(hw_addr.mac), 0); - inter = grub_net_add_addr ((*card)->name, *card, &client_addr, &hw_addr, + inter = VasEBoot_net_add_addr ((*card)->name, *card, &client_addr, &hw_addr, flags); - grub_net_add_ipv4_local (inter, - __builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4))); + VasEBoot_net_add_ipv4_local (inter, + __builtin_ctz (~VasEBoot_le_to_cpu32 (subnet_mask.ipv4))); } if (gateway_addr.ipv4 != 0) { - grub_net_network_level_netaddress_t target; + VasEBoot_net_network_level_netaddress_t target; char *rname; - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + target.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; target.ipv4.base = 0; target.ipv4.masksize = 0; - rname = grub_xasprintf ("%s:default", ((*card)->name)); + rname = VasEBoot_xasprintf ("%s:default", ((*card)->name)); if (rname) - grub_net_add_route_gw (rname, target, gateway_addr, inter); + VasEBoot_net_add_route_gw (rname, target, gateway_addr, inter); else - return grub_errno; + return VasEBoot_errno; } return 0; } static void -grub_ieee1275_net_config_real (const char *devpath, char **device, char **path, +VasEBoot_ieee1275_net_config_real (const char *devpath, char **device, char **path, char *bootpath) { - struct grub_net_card *card; + struct VasEBoot_net_card *card; /* FIXME: Check that it's the right card. */ FOR_NET_CARDS (card) @@ -247,9 +247,9 @@ grub_ieee1275_net_config_real (const char *devpath, char **device, char **path, char *bootp_response; char *canon; char c; - struct grub_ofnetcard_data *data; + struct VasEBoot_ofnetcard_data *data; - grub_ssize_t size = -1; + VasEBoot_ssize_t size = -1; unsigned int i; if (card->driver != &ofdriver) @@ -258,19 +258,19 @@ grub_ieee1275_net_config_real (const char *devpath, char **device, char **path, data = card->data; c = *data->suffix; *data->suffix = '\0'; - canon = grub_ieee1275_canonicalise_devname (data->path); + canon = VasEBoot_ieee1275_canonicalise_devname (data->path); *data->suffix = c; - if (grub_strcmp (devpath, canon) != 0) + if (VasEBoot_strcmp (devpath, canon) != 0) { - grub_free (canon); + VasEBoot_free (canon); continue; } - grub_free (canon); + VasEBoot_free (canon); - grub_ieee1275_parse_bootpath (devpath, bootpath, device, &card); + VasEBoot_ieee1275_parse_bootpath (devpath, bootpath, device, &card); for (i = 0; i < ARRAY_SIZE (bootp_response_properties); i++) - if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, + if (VasEBoot_ieee1275_get_property_length (VasEBoot_ieee1275_chosen, bootp_response_properties[i].name, &size) >= 0) break; @@ -278,55 +278,55 @@ grub_ieee1275_net_config_real (const char *devpath, char **device, char **path, if (size < 0) return; - bootp_response = grub_malloc (size); + bootp_response = VasEBoot_malloc (size); if (!bootp_response) { - grub_print_error (); + VasEBoot_print_error (); return; } - if (grub_ieee1275_get_property (grub_ieee1275_chosen, + if (VasEBoot_ieee1275_get_property (VasEBoot_ieee1275_chosen, bootp_response_properties[i].name, bootp_response, size, 0) < 0) return; - grub_net_configure_by_dhcp_ack (card->name, card, 0, - (struct grub_net_bootp_packet *) + VasEBoot_net_configure_by_dhcp_ack (card->name, card, 0, + (struct VasEBoot_net_bootp_packet *) (bootp_response + bootp_response_properties[i].offset), size - bootp_response_properties[i].offset, 1, device, path); - grub_free (bootp_response); + VasEBoot_free (bootp_response); return; } } /* Allocate memory with alloc-mem */ static void * -grub_ieee1275_alloc_mem (grub_size_t len) +VasEBoot_ieee1275_alloc_mem (VasEBoot_size_t len) { struct alloc_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t catch; - grub_ieee1275_cell_t result; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t len; + VasEBoot_ieee1275_cell_t catch; + VasEBoot_ieee1275_cell_t result; } args; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET)) { - grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); + VasEBoot_error (VasEBoot_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); return NULL; } INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2); args.len = len; - args.method = (grub_ieee1275_cell_t) "alloc-mem"; + args.method = (VasEBoot_ieee1275_cell_t) "alloc-mem"; if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || args.catch) { - grub_error (GRUB_ERR_INVALID_COMMAND, N_("alloc-mem failed")); + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, N_("alloc-mem failed")); return NULL; } else @@ -334,145 +334,145 @@ grub_ieee1275_alloc_mem (grub_size_t len) } /* Free memory allocated by alloc-mem */ -static grub_err_t -grub_ieee1275_free_mem (void *addr, grub_size_t len) +static VasEBoot_err_t +VasEBoot_ieee1275_free_mem (void *addr, VasEBoot_size_t len) { struct free_args { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t addr; - grub_ieee1275_cell_t catch; + struct VasEBoot_ieee1275_common_hdr common; + VasEBoot_ieee1275_cell_t method; + VasEBoot_ieee1275_cell_t len; + VasEBoot_ieee1275_cell_t addr; + VasEBoot_ieee1275_cell_t catch; } args; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET)) { - grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); + return VasEBoot_errno; } INIT_IEEE1275_COMMON (&args.common, "interpret", 3, 1); - args.addr = (grub_ieee1275_cell_t)addr; + args.addr = (VasEBoot_ieee1275_cell_t)addr; args.len = len; - args.method = (grub_ieee1275_cell_t) "free-mem"; + args.method = (VasEBoot_ieee1275_cell_t) "free-mem"; if (IEEE1275_CALL_ENTRY_FN(&args) == -1 || args.catch) { - grub_error (GRUB_ERR_INVALID_COMMAND, N_("free-mem failed")); - return grub_errno; + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, N_("free-mem failed")); + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void * -ofnet_alloc_netbuf (grub_size_t len) +ofnet_alloc_netbuf (VasEBoot_size_t len) { - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) - return grub_ieee1275_alloc_mem (len); + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) + return VasEBoot_ieee1275_alloc_mem (len); else - return grub_zalloc (len); + return VasEBoot_zalloc (len); } static void -ofnet_free_netbuf (void *addr, grub_size_t len) +ofnet_free_netbuf (void *addr, VasEBoot_size_t len) { - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) - grub_ieee1275_free_mem (addr, len); + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) + VasEBoot_ieee1275_free_mem (addr, len); else - grub_free (addr); + VasEBoot_free (addr); } static int -search_net_devices (struct grub_ieee1275_devalias *alias) +search_net_devices (struct VasEBoot_ieee1275_devalias *alias) { - struct grub_ofnetcard_data *ofdata; - struct grub_net_card *card; - grub_ieee1275_phandle_t devhandle; - grub_net_link_level_address_t lla; - grub_ssize_t prop_size; - grub_uint64_t prop; - grub_uint8_t *pprop; + struct VasEBoot_ofnetcard_data *ofdata; + struct VasEBoot_net_card *card; + VasEBoot_ieee1275_phandle_t devhandle; + VasEBoot_net_link_level_address_t lla; + VasEBoot_ssize_t prop_size; + VasEBoot_uint64_t prop; + VasEBoot_uint8_t *pprop; char *shortname; char need_suffix = 1; - if (grub_strcmp (alias->type, "network") != 0) + if (VasEBoot_strcmp (alias->type, "network") != 0) return 0; - ofdata = grub_malloc (sizeof (struct grub_ofnetcard_data)); + ofdata = VasEBoot_malloc (sizeof (struct VasEBoot_ofnetcard_data)); if (!ofdata) { - grub_print_error (); + VasEBoot_print_error (); return 1; } - card = grub_zalloc (sizeof (struct grub_net_card)); + card = VasEBoot_zalloc (sizeof (struct VasEBoot_net_card)); if (!card) { - grub_free (ofdata); - grub_print_error (); + VasEBoot_free (ofdata); + VasEBoot_print_error (); return 1; } #define SUFFIX ":speed=auto,duplex=auto,1.1.1.1,dummy,1.1.1.1,1.1.1.1,5,5,1.1.1.1,512" - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_NO_OFNET_SUFFIX)) need_suffix = 0; /* sun4v vnet devices do not support setting duplex/speed */ { char *ptr; - grub_ieee1275_finddevice (alias->path, &devhandle); + VasEBoot_ieee1275_finddevice (alias->path, &devhandle); - grub_ieee1275_get_property_length (devhandle, "compatible", &prop_size); + VasEBoot_ieee1275_get_property_length (devhandle, "compatible", &prop_size); if (prop_size > 0) { - pprop = grub_malloc (prop_size); + pprop = VasEBoot_malloc (prop_size); if (!pprop) { - grub_free (card); - grub_free (ofdata); - grub_print_error (); + VasEBoot_free (card); + VasEBoot_free (ofdata); + VasEBoot_print_error (); return 1; } - if (!grub_ieee1275_get_property (devhandle, "compatible", + if (!VasEBoot_ieee1275_get_property (devhandle, "compatible", pprop, prop_size, NULL)) { for (ptr = (char *) pprop; ptr - (char *) pprop < prop_size; - ptr += grub_strlen (ptr) + 1) + ptr += VasEBoot_strlen (ptr) + 1) { - if (!grub_strcmp(ptr, "SUNW,sun4v-network")) + if (!VasEBoot_strcmp(ptr, "SUNW,sun4v-network")) need_suffix = 0; } } - grub_free (pprop); + VasEBoot_free (pprop); } } if (need_suffix) - ofdata->path = grub_malloc (grub_strlen (alias->path) + sizeof (SUFFIX)); + ofdata->path = VasEBoot_malloc (VasEBoot_strlen (alias->path) + sizeof (SUFFIX)); else - ofdata->path = grub_malloc (grub_strlen (alias->path) + 1); + ofdata->path = VasEBoot_malloc (VasEBoot_strlen (alias->path) + 1); if (!ofdata->path) { - grub_print_error (); + VasEBoot_print_error (); return 0; } - ofdata->suffix = grub_stpcpy (ofdata->path, alias->path); + ofdata->suffix = VasEBoot_stpcpy (ofdata->path, alias->path); if (need_suffix) - grub_memcpy (ofdata->suffix, SUFFIX, sizeof (SUFFIX)); + VasEBoot_memcpy (ofdata->suffix, SUFFIX, sizeof (SUFFIX)); else *ofdata->suffix = '\0'; - grub_ieee1275_finddevice (ofdata->path, &devhandle); + VasEBoot_ieee1275_finddevice (ofdata->path, &devhandle); { - grub_uint32_t t; - if (grub_ieee1275_get_integer_property (devhandle, + VasEBoot_uint32_t t; + if (VasEBoot_ieee1275_get_integer_property (devhandle, "max-frame-size", &t, sizeof (t), 0)) card->mtu = 1500; @@ -480,23 +480,23 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->mtu = t; } - pprop = (grub_uint8_t *) ∝ - if (grub_ieee1275_get_property (devhandle, "mac-address", + pprop = (VasEBoot_uint8_t *) ∝ + if (VasEBoot_ieee1275_get_property (devhandle, "mac-address", pprop, sizeof(prop), &prop_size) - && grub_ieee1275_get_property (devhandle, "local-mac-address", + && VasEBoot_ieee1275_get_property (devhandle, "local-mac-address", pprop, sizeof(prop), &prop_size)) { - grub_error (GRUB_ERR_IO, "Couldn't retrieve mac address."); - grub_print_error (); + VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve mac address."); + VasEBoot_print_error (); return 0; } if (prop_size == 8) - grub_memcpy (&lla.mac, pprop+2, 6); + VasEBoot_memcpy (&lla.mac, pprop+2, 6); else - grub_memcpy (&lla.mac, pprop, 6); + VasEBoot_memcpy (&lla.mac, pprop, 6); - lla.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + lla.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; card->default_address = lla; card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; @@ -509,50 +509,50 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->rcvbuf = ofnet_alloc_netbuf (card->rcvbufsize); if (!card->rcvbuf) { - grub_error_push (); + VasEBoot_error_push (); ofnet_free_netbuf (card->txbuf, card->txbufsize); - grub_error_pop (); + VasEBoot_error_pop (); goto fail_netbuf; } card->driver = NULL; card->data = ofdata; card->flags = 0; - shortname = grub_ieee1275_get_devname (alias->path); - card->name = grub_xasprintf ("ofnet_%s", shortname ? : alias->path); + shortname = VasEBoot_ieee1275_get_devname (alias->path); + card->name = VasEBoot_xasprintf ("ofnet_%s", shortname ? : alias->path); card->idle_poll_delay_ms = 10; - grub_free (shortname); + VasEBoot_free (shortname); card->driver = &ofdriver; - grub_net_card_register (card); + VasEBoot_net_card_register (card); return 0; fail_netbuf: - grub_free (ofdata->path); - grub_free (ofdata); - grub_free (card); - grub_print_error (); + VasEBoot_free (ofdata->path); + VasEBoot_free (ofdata); + VasEBoot_free (card); + VasEBoot_print_error (); return 0; } static void -grub_ofnet_findcards (void) +VasEBoot_ofnet_findcards (void) { /* Look at all nodes for devices of the type network. */ - grub_ieee1275_devices_iterate (search_net_devices); + VasEBoot_ieee1275_devices_iterate (search_net_devices); } -GRUB_MOD_INIT(ofnet) +VasEBoot_MOD_INIT(ofnet) { - grub_ofnet_findcards (); - grub_ieee1275_net_config = grub_ieee1275_net_config_real; + VasEBoot_ofnet_findcards (); + VasEBoot_ieee1275_net_config = VasEBoot_ieee1275_net_config_real; } -GRUB_MOD_FINI(ofnet) +VasEBoot_MOD_FINI(ofnet) { - struct grub_net_card *card, *next; + struct VasEBoot_net_card *card, *next; FOR_NET_CARDS_SAFE (card, next) - if (card->driver && grub_strcmp (card->driver->name, "ofnet") == 0) - grub_net_card_unregister (card); - grub_ieee1275_net_config = 0; + if (card->driver && VasEBoot_strcmp (card->driver->name, "ofnet") == 0) + VasEBoot_net_card_unregister (card); + VasEBoot_ieee1275_net_config = 0; } diff --git a/VasEBoot-core/net/drivers/uboot/ubootnet.c b/VasEBoot-core/net/drivers/uboot/ubootnet.c index 056052e40..6e8e0b84f 100644 --- a/VasEBoot-core/net/drivers/uboot/ubootnet.c +++ b/VasEBoot-core/net/drivers/uboot/ubootnet.c @@ -1,101 +1,101 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -card_open (struct grub_net_card *dev) +static VasEBoot_err_t +card_open (struct VasEBoot_net_card *dev) { int status; - status = grub_uboot_dev_open (dev->data); + status = VasEBoot_uboot_dev_open (dev->data); if (status) - return grub_error (GRUB_ERR_IO, "Couldn't open network card."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't open network card."); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -card_close (struct grub_net_card *dev) +card_close (struct VasEBoot_net_card *dev) { - grub_uboot_dev_close (dev->data); + VasEBoot_uboot_dev_close (dev->data); } -static grub_err_t -send_card_buffer (struct grub_net_card *dev, struct grub_net_buff *pack) +static VasEBoot_err_t +send_card_buffer (struct VasEBoot_net_card *dev, struct VasEBoot_net_buff *pack) { int status; - grub_size_t len; + VasEBoot_size_t len; len = (pack->tail - pack->data); if (len > dev->mtu) len = dev->mtu; - grub_memcpy (dev->txbuf, pack->data, len); - status = grub_uboot_dev_send (dev->data, dev->txbuf, len); + VasEBoot_memcpy (dev->txbuf, pack->data, len); + status = VasEBoot_uboot_dev_send (dev->data, dev->txbuf, len); if (status) - return grub_error (GRUB_ERR_IO, N_("couldn't send network packet")); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_IO, N_("couldn't send network packet")); + return VasEBoot_ERR_NONE; } -static struct grub_net_buff * -get_card_packet (struct grub_net_card *dev) +static struct VasEBoot_net_buff * +get_card_packet (struct VasEBoot_net_card *dev) { int rc; - grub_uint64_t start_time; - struct grub_net_buff *nb; + VasEBoot_uint64_t start_time; + struct VasEBoot_net_buff *nb; int actual; - nb = grub_netbuff_alloc (dev->mtu + 64 + 2); + nb = VasEBoot_netbuff_alloc (dev->mtu + 64 + 2); if (!nb) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ - grub_netbuff_reserve (nb, 2); + VasEBoot_netbuff_reserve (nb, 2); - start_time = grub_get_time_ms (); + start_time = VasEBoot_get_time_ms (); do { - rc = grub_uboot_dev_recv (dev->data, nb->data, dev->mtu + 64, &actual); - grub_dprintf ("net", "rc=%d, actual=%d, time=%lld\n", rc, actual, - grub_get_time_ms () - start_time); + rc = VasEBoot_uboot_dev_recv (dev->data, nb->data, dev->mtu + 64, &actual); + VasEBoot_dprintf ("net", "rc=%d, actual=%d, time=%lld\n", rc, actual, + VasEBoot_get_time_ms () - start_time); } - while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200)); + while ((actual <= 0 || rc < 0) && (VasEBoot_get_time_ms () - start_time < 200)); if (actual > 0) { - grub_netbuff_put (nb, actual); + VasEBoot_netbuff_put (nb, actual); return nb; } - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } -static struct grub_net_card_driver ubootnet = +static struct VasEBoot_net_card_driver ubootnet = { .name = "ubnet", .open = card_open, @@ -104,58 +104,58 @@ static struct grub_net_card_driver ubootnet = .recv = get_card_packet }; -GRUB_MOD_INIT (ubootnet) +VasEBoot_MOD_INIT (ubootnet) { int devcount, i; int nfound = 0; - devcount = grub_uboot_dev_enum (); + devcount = VasEBoot_uboot_dev_enum (); for (i = 0; i < devcount; i++) { - struct device_info *devinfo = grub_uboot_dev_get (i); - struct grub_net_card *card; + struct device_info *devinfo = VasEBoot_uboot_dev_get (i); + struct VasEBoot_net_card *card; if (!(devinfo->type & DEV_TYP_NET)) continue; - card = grub_zalloc (sizeof (struct grub_net_card)); + card = VasEBoot_zalloc (sizeof (struct VasEBoot_net_card)); if (!card) { - grub_print_error (); + VasEBoot_print_error (); return; } /* FIXME: Any way to check this? */ card->mtu = 1500; - grub_memcpy (&(card->default_address.mac), &devinfo->di_net.hwaddr, 6); - card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (&(card->default_address.mac), &devinfo->di_net.hwaddr, 6); + card->default_address.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; - card->txbuf = grub_zalloc (card->txbufsize); + card->txbuf = VasEBoot_zalloc (card->txbufsize); if (!card->txbuf) { - grub_free (card); - grub_print_error (); + VasEBoot_free (card); + VasEBoot_print_error (); continue; } card->data = devinfo; card->flags = 0; - card->name = grub_xasprintf ("ubnet_%d", ++nfound); + card->name = VasEBoot_xasprintf ("ubnet_%d", ++nfound); card->idle_poll_delay_ms = 10; card->driver = &ubootnet; - grub_net_card_register (card); + VasEBoot_net_card_register (card); } } -GRUB_MOD_FINI (ubootnet) +VasEBoot_MOD_FINI (ubootnet) { - struct grub_net_card *card, *next; + struct VasEBoot_net_card *card, *next; FOR_NET_CARDS_SAFE (card, next) - if (card->driver && grub_strcmp (card->driver->name, "ubnet") == 0) - grub_net_card_unregister (card); + if (card->driver && VasEBoot_strcmp (card->driver->name, "ubnet") == 0) + VasEBoot_net_card_unregister (card); } diff --git a/VasEBoot-core/net/ethernet.c b/VasEBoot-core/net/ethernet.c index c397b1b34..cf1da3519 100644 --- a/VasEBoot-core/net/ethernet.c +++ b/VasEBoot-core/net/ethernet.c @@ -1,75 +1,75 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define LLCADDRMASK 0x7f struct etherhdr { - grub_uint8_t dst[6]; - grub_uint8_t src[6]; - grub_uint16_t type; -} GRUB_PACKED; + VasEBoot_uint8_t dst[6]; + VasEBoot_uint8_t src[6]; + VasEBoot_uint16_t type; +} VasEBoot_PACKED; struct llchdr { - grub_uint8_t dsap; - grub_uint8_t ssap; - grub_uint8_t ctrl; -} GRUB_PACKED; + VasEBoot_uint8_t dsap; + VasEBoot_uint8_t ssap; + VasEBoot_uint8_t ctrl; +} VasEBoot_PACKED; struct snaphdr { - grub_uint8_t oui[3]; - grub_uint16_t type; -} GRUB_PACKED; + VasEBoot_uint8_t oui[3]; + VasEBoot_uint16_t type; +} VasEBoot_PACKED; -grub_err_t -send_ethernet_packet (struct grub_net_network_level_interface *inf, - struct grub_net_buff *nb, - grub_net_link_level_address_t target_addr, - grub_net_ethertype_t ethertype) +VasEBoot_err_t +send_ethernet_packet (struct VasEBoot_net_network_level_interface *inf, + struct VasEBoot_net_buff *nb, + VasEBoot_net_link_level_address_t target_addr, + VasEBoot_net_ethertype_t ethertype) { struct etherhdr *eth; - grub_err_t err; + VasEBoot_err_t err; - COMPILE_TIME_ASSERT (sizeof (*eth) < GRUB_NET_MAX_LINK_HEADER_SIZE); + COMPILE_TIME_ASSERT (sizeof (*eth) < VasEBoot_NET_MAX_LINK_HEADER_SIZE); - err = grub_netbuff_push (nb, sizeof (*eth)); + err = VasEBoot_netbuff_push (nb, sizeof (*eth)); if (err) return err; eth = (struct etherhdr *) nb->data; - grub_memcpy (eth->dst, target_addr.mac, 6); - grub_memcpy (eth->src, inf->hwaddress.mac, 6); + VasEBoot_memcpy (eth->dst, target_addr.mac, 6); + VasEBoot_memcpy (eth->src, inf->hwaddress.mac, 6); - eth->type = grub_cpu_to_be16 (ethertype); + eth->type = VasEBoot_cpu_to_be16 (ethertype); if (!inf->card->opened) { - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; if (inf->card->driver->open) err = inf->card->driver->open (inf->card); if (err) @@ -79,21 +79,21 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, return inf->card->driver->send (inf->card, nb); } -grub_err_t -grub_net_recv_ethernet_packet (struct grub_net_buff *nb, - struct grub_net_card *card) +VasEBoot_err_t +VasEBoot_net_recv_ethernet_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card) { struct etherhdr *eth; struct llchdr *llch; struct snaphdr *snaph; - grub_net_ethertype_t type; - grub_net_link_level_address_t hwaddress; - grub_net_link_level_address_t src_hwaddress; - grub_err_t err; + VasEBoot_net_ethertype_t type; + VasEBoot_net_link_level_address_t hwaddress; + VasEBoot_net_link_level_address_t src_hwaddress; + VasEBoot_err_t err; eth = (struct etherhdr *) nb->data; - type = grub_be_to_cpu16 (eth->type); - err = grub_netbuff_pull (nb, sizeof (*eth)); + type = VasEBoot_be_to_cpu16 (eth->type); + err = VasEBoot_netbuff_pull (nb, sizeof (*eth)); if (err) return err; @@ -104,7 +104,7 @@ grub_net_recv_ethernet_packet (struct grub_net_buff *nb, if (llch->dsap == 0xaa && llch->ssap == 0xaa && llch->ctrl == 0x3) { - err = grub_netbuff_pull (nb, sizeof (*llch)); + err = VasEBoot_netbuff_pull (nb, sizeof (*llch)); if (err) return err; snaph = (struct snaphdr *) nb->data; @@ -112,23 +112,23 @@ grub_net_recv_ethernet_packet (struct grub_net_buff *nb, } } - hwaddress.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (hwaddress.mac, eth->dst, sizeof (hwaddress.mac)); - src_hwaddress.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (src_hwaddress.mac, eth->src, sizeof (src_hwaddress.mac)); + hwaddress.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (hwaddress.mac, eth->dst, sizeof (hwaddress.mac)); + src_hwaddress.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (src_hwaddress.mac, eth->src, sizeof (src_hwaddress.mac)); switch (type) { /* ARP packet. */ - case GRUB_NET_ETHERTYPE_ARP: - grub_net_arp_receive (nb, card); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + case VasEBoot_NET_ETHERTYPE_ARP: + VasEBoot_net_arp_receive (nb, card); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; /* IP packet. */ - case GRUB_NET_ETHERTYPE_IP: - case GRUB_NET_ETHERTYPE_IP6: - return grub_net_recv_ip_packets (nb, card, &hwaddress, &src_hwaddress); + case VasEBoot_NET_ETHERTYPE_IP: + case VasEBoot_NET_ETHERTYPE_IP6: + return VasEBoot_net_recv_ip_packets (nb, card, &hwaddress, &src_hwaddress); } - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/net/http.c b/VasEBoot-core/net/http.c index 389a78ee0..da292a563 100644 --- a/VasEBoot-core/net/http.c +++ b/VasEBoot-core/net/http.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); enum { @@ -38,32 +38,32 @@ enum typedef struct http_data { char *current_line; - grub_size_t current_line_len; + VasEBoot_size_t current_line_len; int headers_recv; int first_line_recv; int size_recv; - grub_net_tcp_socket_t sock; + VasEBoot_net_tcp_socket_t sock; char *filename; - grub_err_t err; + VasEBoot_err_t err; char *errmsg; int chunked; - grub_size_t chunk_rem; + VasEBoot_size_t chunk_rem; int in_chunk_len; } *http_data_t; -static grub_off_t -have_ahead (struct grub_file *file) +static VasEBoot_off_t +have_ahead (struct VasEBoot_file *file) { - grub_net_t net = file->device->net; - grub_off_t ret = net->offset; - struct grub_net_packet *pack; + VasEBoot_net_t net = file->device->net; + VasEBoot_off_t ret = net->offset; + struct VasEBoot_net_packet *pack; for (pack = net->packs.first; pack; pack = pack->next) ret += pack->nb->tail - pack->nb->data; return ret; } -static grub_err_t -parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len) +static VasEBoot_err_t +parse_line (VasEBoot_file_t file, http_data_t data, char *ptr, VasEBoot_size_t len) { char *end = ptr + len; while (end > ptr && *(end - 1) == '\r') @@ -73,113 +73,113 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len) if (data->in_chunk_len == 1) { data->in_chunk_len = 2; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (data->in_chunk_len == 2) { - data->chunk_rem = grub_strtoul (ptr, 0, 16); - grub_errno = GRUB_ERR_NONE; + data->chunk_rem = VasEBoot_strtoul (ptr, 0, 16); + VasEBoot_errno = VasEBoot_ERR_NONE; if (data->chunk_rem == 0) { file->device->net->eof = 1; file->device->net->stall = 1; - if (file->size == GRUB_FILE_SIZE_UNKNOWN) + if (file->size == VasEBoot_FILE_SIZE_UNKNOWN) file->size = have_ahead (file); } data->in_chunk_len = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (ptr == end) { data->headers_recv = 1; if (data->chunked) data->in_chunk_len = 2; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (!data->first_line_recv) { int code; - if (grub_memcmp (ptr, "HTTP/1.1 ", sizeof ("HTTP/1.1 ") - 1) != 0) + if (VasEBoot_memcmp (ptr, "HTTP/1.1 ", sizeof ("HTTP/1.1 ") - 1) != 0) { - data->errmsg = grub_strdup (_("unsupported HTTP response")); + data->errmsg = VasEBoot_strdup (_("unsupported HTTP response")); data->first_line_recv = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } ptr += sizeof ("HTTP/1.1 ") - 1; - code = grub_strtoul (ptr, &ptr, 10); - if (grub_errno) - return grub_errno; + code = VasEBoot_strtoul (ptr, &ptr, 10); + if (VasEBoot_errno) + return VasEBoot_errno; switch (code) { case 200: case 206: break; case 404: - data->err = GRUB_ERR_FILE_NOT_FOUND; - data->errmsg = grub_xasprintf (_("file `%s' not found"), data->filename); - return GRUB_ERR_NONE; + data->err = VasEBoot_ERR_FILE_NOT_FOUND; + data->errmsg = VasEBoot_xasprintf (_("file `%s' not found"), data->filename); + return VasEBoot_ERR_NONE; default: - data->err = GRUB_ERR_NET_UNKNOWN_ERROR; - /* TRANSLATORS: GRUB HTTP code is pretty young. So even perfectly + data->err = VasEBoot_ERR_NET_UNKNOWN_ERROR; + /* TRANSLATORS: VasEBoot HTTP code is pretty young. So even perfectly valid answers like 403 will trigger this very generic message. */ - data->errmsg = grub_xasprintf (_("unsupported HTTP error %d: %s"), + data->errmsg = VasEBoot_xasprintf (_("unsupported HTTP error %d: %s"), code, ptr); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } data->first_line_recv = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_memcmp (ptr, "Content-Length: ", sizeof ("Content-Length: ") - 1) + if (VasEBoot_memcmp (ptr, "Content-Length: ", sizeof ("Content-Length: ") - 1) == 0 && !data->size_recv) { ptr += sizeof ("Content-Length: ") - 1; - file->size = grub_strtoull (ptr, &ptr, 10); + file->size = VasEBoot_strtoull (ptr, &ptr, 10); data->size_recv = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_memcmp (ptr, "Transfer-Encoding: chunked", + if (VasEBoot_memcmp (ptr, "Transfer-Encoding: chunked", sizeof ("Transfer-Encoding: chunked") - 1) == 0) { data->chunked = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -http_err (grub_net_tcp_socket_t sock __attribute__ ((unused)), +http_err (VasEBoot_net_tcp_socket_t sock __attribute__ ((unused)), void *f) { - grub_file_t file = f; + VasEBoot_file_t file = f; http_data_t data = file->data; if (data->sock) - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); data->sock = 0; if (data->current_line) - grub_free (data->current_line); + VasEBoot_free (data->current_line); data->current_line = 0; file->device->net->eof = 1; file->device->net->stall = 1; - if (file->size == GRUB_FILE_SIZE_UNKNOWN) + if (file->size == VasEBoot_FILE_SIZE_UNKNOWN) file->size = have_ahead (file); } -static grub_err_t -http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), - struct grub_net_buff *nb, +static VasEBoot_err_t +http_receive (VasEBoot_net_tcp_socket_t sock __attribute__ ((unused)), + struct VasEBoot_net_buff *nb, void *f) { - grub_file_t file = f; + VasEBoot_file_t file = f; http_data_t data = file->data; - grub_err_t err; + VasEBoot_err_t err; if (!data->sock) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } while (1) @@ -189,7 +189,7 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), { int have_line = 1; char *t; - ptr = grub_memchr (nb->data, '\n', nb->tail - nb->data); + ptr = VasEBoot_memchr (nb->data, '\n', nb->tail - nb->data); if (ptr) ptr++; else @@ -197,33 +197,33 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), have_line = 0; ptr = (char *) nb->tail; } - t = grub_realloc (data->current_line, + t = VasEBoot_realloc (data->current_line, data->current_line_len + (ptr - (char *) nb->data)); if (!t) { - grub_netbuff_free (nb); - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); - return grub_errno; + VasEBoot_netbuff_free (nb); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); + return VasEBoot_errno; } data->current_line = t; - grub_memcpy (data->current_line + data->current_line_len, + VasEBoot_memcpy (data->current_line + data->current_line_len, nb->data, ptr - (char *) nb->data); data->current_line_len += ptr - (char *) nb->data; if (!have_line) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } err = parse_line (file, data, data->current_line, data->current_line_len); - grub_free (data->current_line); + VasEBoot_free (data->current_line); data->current_line = 0; data->current_line_len = 0; if (err) { - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); - grub_netbuff_free (nb); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); + VasEBoot_netbuff_free (nb); return err; } } @@ -232,26 +232,26 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), || data->in_chunk_len)) { char *ptr2; - ptr2 = grub_memchr (ptr, '\n', (char *) nb->tail - ptr); + ptr2 = VasEBoot_memchr (ptr, '\n', (char *) nb->tail - ptr); if (!ptr2) { - data->current_line = grub_malloc ((char *) nb->tail - ptr); + data->current_line = VasEBoot_malloc ((char *) nb->tail - ptr); if (!data->current_line) { - grub_netbuff_free (nb); - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); - return grub_errno; + VasEBoot_netbuff_free (nb); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); + return VasEBoot_errno; } data->current_line_len = (char *) nb->tail - ptr; - grub_memcpy (data->current_line, ptr, data->current_line_len); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_memcpy (data->current_line, ptr, data->current_line_len); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } err = parse_line (file, data, ptr, ptr2 - ptr); if (err) { - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); - grub_netbuff_free (nb); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); + VasEBoot_netbuff_free (nb); return err; } ptr = ptr2 + 1; @@ -259,245 +259,245 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), if (((char *) nb->tail - ptr) <= 0) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } - err = grub_netbuff_pull (nb, ptr - (char *) nb->data); + err = VasEBoot_netbuff_pull (nb, ptr - (char *) nb->data); if (err) { - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); - grub_netbuff_free (nb); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); + VasEBoot_netbuff_free (nb); return err; } - if (!(data->chunked && (grub_ssize_t) data->chunk_rem + if (!(data->chunked && (VasEBoot_ssize_t) data->chunk_rem < nb->tail - nb->data)) { - grub_net_put_packet (&file->device->net->packs, nb); + VasEBoot_net_put_packet (&file->device->net->packs, nb); if (file->device->net->packs.count >= 20) file->device->net->stall = 1; if (file->device->net->packs.count >= 100) - grub_net_tcp_stall (data->sock); + VasEBoot_net_tcp_stall (data->sock); if (data->chunked) data->chunk_rem -= nb->tail - nb->data; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (data->chunk_rem) { - struct grub_net_buff *nb2; - nb2 = grub_netbuff_alloc (data->chunk_rem); + struct VasEBoot_net_buff *nb2; + nb2 = VasEBoot_netbuff_alloc (data->chunk_rem); if (!nb2) - return grub_errno; - grub_netbuff_put (nb2, data->chunk_rem); - grub_memcpy (nb2->data, nb->data, data->chunk_rem); + return VasEBoot_errno; + VasEBoot_netbuff_put (nb2, data->chunk_rem); + VasEBoot_memcpy (nb2->data, nb->data, data->chunk_rem); if (file->device->net->packs.count >= 20) { file->device->net->stall = 1; - grub_net_tcp_stall (data->sock); + VasEBoot_net_tcp_stall (data->sock); } - grub_net_put_packet (&file->device->net->packs, nb2); - grub_netbuff_pull (nb, data->chunk_rem); + VasEBoot_net_put_packet (&file->device->net->packs, nb2); + VasEBoot_netbuff_pull (nb, data->chunk_rem); } data->in_chunk_len = 1; } } -static grub_err_t -http_establish (struct grub_file *file, grub_off_t offset, int initial) +static VasEBoot_err_t +http_establish (struct VasEBoot_file *file, VasEBoot_off_t offset, int initial) { http_data_t data = file->data; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int i, port; - struct grub_net_buff *nb; - grub_err_t err; + struct VasEBoot_net_buff *nb; + VasEBoot_err_t err; - nb = grub_netbuff_alloc (GRUB_NET_TCP_RESERVE_SIZE + nb = VasEBoot_netbuff_alloc (VasEBoot_NET_TCP_RESERVE_SIZE + sizeof ("GET ") - 1 - + grub_strlen (data->filename) + + VasEBoot_strlen (data->filename) + sizeof (" HTTP/1.1\r\nHost: ") - 1 - + grub_strlen (file->device->net->server) + + VasEBoot_strlen (file->device->net->server) + sizeof ("\r\nUser-Agent: " PACKAGE_STRING "\r\n") - 1 + sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX" "-\r\n\r\n")); if (!nb) - return grub_errno; + return VasEBoot_errno; - grub_netbuff_reserve (nb, GRUB_NET_TCP_RESERVE_SIZE); + VasEBoot_netbuff_reserve (nb, VasEBoot_NET_TCP_RESERVE_SIZE); ptr = nb->tail; - err = grub_netbuff_put (nb, sizeof ("GET ") - 1); + err = VasEBoot_netbuff_put (nb, sizeof ("GET ") - 1); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - grub_memcpy (ptr, "GET ", sizeof ("GET ") - 1); + VasEBoot_memcpy (ptr, "GET ", sizeof ("GET ") - 1); ptr = nb->tail; - err = grub_netbuff_put (nb, grub_strlen (data->filename)); + err = VasEBoot_netbuff_put (nb, VasEBoot_strlen (data->filename)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - grub_memcpy (ptr, data->filename, grub_strlen (data->filename)); + VasEBoot_memcpy (ptr, data->filename, VasEBoot_strlen (data->filename)); ptr = nb->tail; - err = grub_netbuff_put (nb, sizeof (" HTTP/1.1\r\nHost: ") - 1); + err = VasEBoot_netbuff_put (nb, sizeof (" HTTP/1.1\r\nHost: ") - 1); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - grub_memcpy (ptr, " HTTP/1.1\r\nHost: ", + VasEBoot_memcpy (ptr, " HTTP/1.1\r\nHost: ", sizeof (" HTTP/1.1\r\nHost: ") - 1); ptr = nb->tail; - err = grub_netbuff_put (nb, grub_strlen (file->device->net->server)); + err = VasEBoot_netbuff_put (nb, VasEBoot_strlen (file->device->net->server)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - grub_memcpy (ptr, file->device->net->server, - grub_strlen (file->device->net->server)); + VasEBoot_memcpy (ptr, file->device->net->server, + VasEBoot_strlen (file->device->net->server)); ptr = nb->tail; - err = grub_netbuff_put (nb, + err = VasEBoot_netbuff_put (nb, sizeof ("\r\nUser-Agent: " PACKAGE_STRING "\r\n") - 1); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - grub_memcpy (ptr, "\r\nUser-Agent: " PACKAGE_STRING "\r\n", + VasEBoot_memcpy (ptr, "\r\nUser-Agent: " PACKAGE_STRING "\r\n", sizeof ("\r\nUser-Agent: " PACKAGE_STRING "\r\n") - 1); if (!initial) { ptr = nb->tail; - grub_snprintf ((char *) ptr, + VasEBoot_snprintf ((char *) ptr, sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX-" "\r\n"), - "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n", + "Range: bytes=%" PRIuVasEBoot_UINT64_T "-\r\n", offset); - grub_netbuff_put (nb, grub_strlen ((char *) ptr)); + VasEBoot_netbuff_put (nb, VasEBoot_strlen ((char *) ptr)); } ptr = nb->tail; - grub_netbuff_put (nb, 2); - grub_memcpy (ptr, "\r\n", 2); + VasEBoot_netbuff_put (nb, 2); + VasEBoot_memcpy (ptr, "\r\n", 2); if (file->device->net->port) port = file->device->net->port; else port = HTTP_PORT; - data->sock = grub_net_tcp_open (file->device->net->server, + data->sock = VasEBoot_net_tcp_open (file->device->net->server, port, http_receive, http_err, http_err, file); if (!data->sock) { - grub_netbuff_free (nb); - return grub_errno; + VasEBoot_netbuff_free (nb); + return VasEBoot_errno; } - // grub_net_poll_cards (5000); + // VasEBoot_net_poll_cards (5000); - err = grub_net_send_tcp_packet (data->sock, nb, 1); + err = VasEBoot_net_send_tcp_packet (data->sock, nb, 1); if (err) { - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); return err; } for (i = 0; !data->headers_recv && i < 100; i++) { - grub_net_tcp_retransmit (); - grub_net_poll_cards (300, &data->headers_recv); + VasEBoot_net_tcp_retransmit (); + VasEBoot_net_poll_cards (300, &data->headers_recv); } if (!data->headers_recv) { - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); if (data->err) { char *str = data->errmsg; - err = grub_error (data->err, "%s", str); - grub_free (str); + err = VasEBoot_error (data->err, "%s", str); + VasEBoot_free (str); data->errmsg = 0; return data->err; } - return grub_error (GRUB_ERR_TIMEOUT, N_("time out opening `%s'"), data->filename); + return VasEBoot_error (VasEBoot_ERR_TIMEOUT, N_("time out opening `%s'"), data->filename); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -http_seek (struct grub_file *file, grub_off_t off) +static VasEBoot_err_t +http_seek (struct VasEBoot_file *file, VasEBoot_off_t off) { struct http_data *old_data, *data; - grub_err_t err; + VasEBoot_err_t err; old_data = file->data; /* FIXME: Reuse socket? */ if (old_data->sock) - grub_net_tcp_close (old_data->sock, GRUB_NET_TCP_ABORT); + VasEBoot_net_tcp_close (old_data->sock, VasEBoot_NET_TCP_ABORT); old_data->sock = 0; while (file->device->net->packs.first) { - grub_netbuff_free (file->device->net->packs.first->nb); - grub_net_remove_packet (file->device->net->packs.first); + VasEBoot_netbuff_free (file->device->net->packs.first->nb); + VasEBoot_net_remove_packet (file->device->net->packs.first); } file->device->net->stall = 0; file->device->net->eof = 0; file->device->net->offset = off; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) - return grub_errno; + return VasEBoot_errno; data->size_recv = 1; data->filename = old_data->filename; if (!data->filename) { - grub_free (data); + VasEBoot_free (data); file->data = 0; - return grub_errno; + return VasEBoot_errno; } - grub_free (old_data); + VasEBoot_free (old_data); file->data = data; err = http_establish (file, off, 0); if (err) { - grub_free (data->filename); - grub_free (data); + VasEBoot_free (data->filename); + VasEBoot_free (data); file->data = 0; return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -http_open (struct grub_file *file, const char *filename) +static VasEBoot_err_t +http_open (struct VasEBoot_file *file, const char *filename) { - grub_err_t err; + VasEBoot_err_t err; struct http_data *data; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) - return grub_errno; - file->size = GRUB_FILE_SIZE_UNKNOWN; + return VasEBoot_errno; + file->size = VasEBoot_FILE_SIZE_UNKNOWN; - data->filename = grub_strdup (filename); + data->filename = VasEBoot_strdup (filename); if (!data->filename) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } file->not_easily_seekable = 0; @@ -506,33 +506,33 @@ http_open (struct grub_file *file, const char *filename) err = http_establish (file, 0, 1); if (err) { - grub_free (data->filename); - grub_free (data); + VasEBoot_free (data->filename); + VasEBoot_free (data); return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -http_close (struct grub_file *file) +static VasEBoot_err_t +http_close (struct VasEBoot_file *file) { http_data_t data = file->data; if (!data) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (data->sock) - grub_net_tcp_close (data->sock, GRUB_NET_TCP_ABORT); + VasEBoot_net_tcp_close (data->sock, VasEBoot_NET_TCP_ABORT); if (data->current_line) - grub_free (data->current_line); - grub_free (data->filename); - grub_free (data); - return GRUB_ERR_NONE; + VasEBoot_free (data->current_line); + VasEBoot_free (data->filename); + VasEBoot_free (data); + return VasEBoot_ERR_NONE; } -static grub_err_t -http_packets_pulled (struct grub_file *file) +static VasEBoot_err_t +http_packets_pulled (struct VasEBoot_file *file) { http_data_t data = file->data; @@ -542,11 +542,11 @@ http_packets_pulled (struct grub_file *file) if (!file->device->net->eof) file->device->net->stall = 0; if (data && data->sock) - grub_net_tcp_unstall (data->sock); + VasEBoot_net_tcp_unstall (data->sock); return 0; } -static struct grub_net_app_protocol grub_http_protocol = +static struct VasEBoot_net_app_protocol VasEBoot_http_protocol = { .name = "http", .open = http_open, @@ -555,12 +555,12 @@ static struct grub_net_app_protocol grub_http_protocol = .packets_pulled = http_packets_pulled }; -GRUB_MOD_INIT (http) +VasEBoot_MOD_INIT (http) { - grub_net_app_level_register (&grub_http_protocol); + VasEBoot_net_app_level_register (&VasEBoot_http_protocol); } -GRUB_MOD_FINI (http) +VasEBoot_MOD_FINI (http) { - grub_net_app_level_unregister (&grub_http_protocol); + VasEBoot_net_app_level_unregister (&VasEBoot_http_protocol); } diff --git a/VasEBoot-core/net/icmp.c b/VasEBoot-core/net/icmp.c index b1eef114e..1d29eadea 100644 --- a/VasEBoot-core/net/icmp.c +++ b/VasEBoot-core/net/icmp.c @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include struct icmp_header { - grub_uint8_t type; - grub_uint8_t code; - grub_uint16_t checksum; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t code; + VasEBoot_uint16_t checksum; +} VasEBoot_PACKED; struct ping_header { - grub_uint16_t id; - grub_uint16_t seq; -} GRUB_PACKED; + VasEBoot_uint16_t id; + VasEBoot_uint16_t seq; +} VasEBoot_PACKED; enum { @@ -39,41 +39,41 @@ enum ICMP_ECHO = 8, }; -grub_err_t -grub_net_recv_icmp_packet (struct grub_net_buff *nb, - struct grub_net_network_level_interface *inf, - const grub_net_link_level_address_t *ll_src, - const grub_net_network_level_address_t *src) +VasEBoot_err_t +VasEBoot_net_recv_icmp_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_link_level_address_t *ll_src, + const VasEBoot_net_network_level_address_t *src) { struct icmp_header *icmph; - grub_err_t err; - grub_uint16_t checksum; + VasEBoot_err_t err; + VasEBoot_uint16_t checksum; /* Ignore broadcast. */ if (!inf) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } icmph = (struct icmp_header *) nb->data; - if (nb->tail - nb->data < (grub_ssize_t) sizeof (*icmph)) + if (nb->tail - nb->data < (VasEBoot_ssize_t) sizeof (*icmph)) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } checksum = icmph->checksum; icmph->checksum = 0; - if (checksum != grub_net_ip_chksum (nb->data, nb->tail - nb->data)) + if (checksum != VasEBoot_net_ip_chksum (nb->data, nb->tail - nb->data)) { icmph->checksum = checksum; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } icmph->checksum = checksum; - err = grub_netbuff_pull (nb, sizeof (*icmph)); + err = VasEBoot_netbuff_pull (nb, sizeof (*icmph)); if (err) return err; @@ -81,32 +81,32 @@ grub_net_recv_icmp_packet (struct grub_net_buff *nb, { case ICMP_ECHO: { - struct grub_net_buff *nb_reply; + struct VasEBoot_net_buff *nb_reply; struct icmp_header *icmphr; if (icmph->code) break; - nb_reply = grub_netbuff_make_pkt (nb->tail - nb->data + sizeof (*icmphr)); + nb_reply = VasEBoot_netbuff_make_pkt (nb->tail - nb->data + sizeof (*icmphr)); if (!nb_reply) { - grub_netbuff_free (nb); - return grub_errno; + VasEBoot_netbuff_free (nb); + return VasEBoot_errno; } - grub_memcpy (nb_reply->data + sizeof (*icmphr), nb->data, nb->tail - nb->data); + VasEBoot_memcpy (nb_reply->data + sizeof (*icmphr), nb->data, nb->tail - nb->data); icmphr = (struct icmp_header *) nb_reply->data; icmphr->type = ICMP_ECHO_REPLY; icmphr->code = 0; icmphr->checksum = 0; - icmphr->checksum = grub_net_ip_chksum ((void *) nb_reply->data, + icmphr->checksum = VasEBoot_net_ip_chksum ((void *) nb_reply->data, nb_reply->tail - nb_reply->data); - err = grub_net_send_ip_packet (inf, src, ll_src, - nb_reply, GRUB_NET_IP_ICMP); + err = VasEBoot_net_send_ip_packet (inf, src, ll_src, + nb_reply, VasEBoot_NET_IP_ICMP); - grub_netbuff_free (nb); - grub_netbuff_free (nb_reply); + VasEBoot_netbuff_free (nb); + VasEBoot_netbuff_free (nb_reply); return err; } }; - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/net/icmp6.c b/VasEBoot-core/net/icmp6.c index 2cbd95dce..81d2dbfd7 100644 --- a/VasEBoot-core/net/icmp6.c +++ b/VasEBoot-core/net/icmp6.c @@ -1,81 +1,81 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include struct icmp_header { - grub_uint8_t type; - grub_uint8_t code; - grub_uint16_t checksum; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t code; + VasEBoot_uint16_t checksum; +} VasEBoot_PACKED; struct ping_header { - grub_uint16_t id; - grub_uint16_t seq; -} GRUB_PACKED; + VasEBoot_uint16_t id; + VasEBoot_uint16_t seq; +} VasEBoot_PACKED; struct router_adv { - grub_uint8_t ttl; - grub_uint8_t flags; - grub_uint16_t router_lifetime; - grub_uint32_t reachable_time; - grub_uint32_t retrans_timer; - grub_uint8_t options[0]; -} GRUB_PACKED; + VasEBoot_uint8_t ttl; + VasEBoot_uint8_t flags; + VasEBoot_uint16_t router_lifetime; + VasEBoot_uint32_t reachable_time; + VasEBoot_uint32_t retrans_timer; + VasEBoot_uint8_t options[0]; +} VasEBoot_PACKED; struct option_header { - grub_uint8_t type; - grub_uint8_t len; -} GRUB_PACKED; + VasEBoot_uint8_t type; + VasEBoot_uint8_t len; +} VasEBoot_PACKED; struct prefix_option { struct option_header header; - grub_uint8_t prefixlen; - grub_uint8_t flags; - grub_uint32_t valid_lifetime; - grub_uint32_t preferred_lifetime; - grub_uint32_t reserved; - grub_uint64_t prefix[2]; -} GRUB_PACKED; + VasEBoot_uint8_t prefixlen; + VasEBoot_uint8_t flags; + VasEBoot_uint32_t valid_lifetime; + VasEBoot_uint32_t preferred_lifetime; + VasEBoot_uint32_t reserved; + VasEBoot_uint64_t prefix[2]; +} VasEBoot_PACKED; struct neighbour_solicit { - grub_uint32_t reserved; - grub_uint64_t target[2]; -} GRUB_PACKED; + VasEBoot_uint32_t reserved; + VasEBoot_uint64_t target[2]; +} VasEBoot_PACKED; struct neighbour_advertise { - grub_uint32_t flags; - grub_uint64_t target[2]; -} GRUB_PACKED; + VasEBoot_uint32_t flags; + VasEBoot_uint64_t target[2]; +} VasEBoot_PACKED; struct router_solicit { - grub_uint32_t reserved; -} GRUB_PACKED; + VasEBoot_uint32_t reserved; +} VasEBoot_PACKED; enum { @@ -105,55 +105,55 @@ enum FLAG_OVERRIDE = (1 << 29) }; -grub_err_t -grub_net_recv_icmp6_packet (struct grub_net_buff *nb, - struct grub_net_card *card, - struct grub_net_network_level_interface *inf, - const grub_net_link_level_address_t *ll_src, - const grub_net_network_level_address_t *source, - const grub_net_network_level_address_t *dest, - grub_uint8_t ttl) +VasEBoot_err_t +VasEBoot_net_recv_icmp6_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_link_level_address_t *ll_src, + const VasEBoot_net_network_level_address_t *source, + const VasEBoot_net_network_level_address_t *dest, + VasEBoot_uint8_t ttl) { struct icmp_header *icmph; - struct grub_net_network_level_interface *orig_inf = inf; - grub_err_t err; - grub_uint16_t checksum; + struct VasEBoot_net_network_level_interface *orig_inf = inf; + VasEBoot_err_t err; + VasEBoot_uint16_t checksum; icmph = (struct icmp_header *) nb->data; - if (nb->tail - nb->data < (grub_ssize_t) sizeof (*icmph)) + if (nb->tail - nb->data < (VasEBoot_ssize_t) sizeof (*icmph)) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } checksum = icmph->checksum; icmph->checksum = 0; - if (checksum != grub_net_ip_transport_checksum (nb, - GRUB_NET_IP_ICMPV6, + if (checksum != VasEBoot_net_ip_transport_checksum (nb, + VasEBoot_NET_IP_ICMPV6, source, dest)) { - grub_dprintf ("net", "invalid ICMPv6 checksum: %04x instead of %04x\n", + VasEBoot_dprintf ("net", "invalid ICMPv6 checksum: %04x instead of %04x\n", checksum, - grub_net_ip_transport_checksum (nb, - GRUB_NET_IP_ICMPV6, + VasEBoot_net_ip_transport_checksum (nb, + VasEBoot_NET_IP_ICMPV6, source, dest)); icmph->checksum = checksum; - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } icmph->checksum = checksum; - err = grub_netbuff_pull (nb, sizeof (*icmph)); + err = VasEBoot_netbuff_pull (nb, sizeof (*icmph)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - grub_dprintf ("net", "ICMPv6 message: %02x, %02x\n", + VasEBoot_dprintf ("net", "ICMPv6 message: %02x, %02x\n", icmph->type, icmph->code); switch (icmph->type) { @@ -162,152 +162,152 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, if (!inf) break; { - struct grub_net_buff *nb_reply; + struct VasEBoot_net_buff *nb_reply; struct icmp_header *icmphr; if (icmph->code) break; - nb_reply = grub_netbuff_alloc (nb->tail - nb->data + 512); + nb_reply = VasEBoot_netbuff_alloc (nb->tail - nb->data + 512); if (!nb_reply) { - grub_netbuff_free (nb); - return grub_errno; + VasEBoot_netbuff_free (nb); + return VasEBoot_errno; } - err = grub_netbuff_reserve (nb_reply, nb->tail - nb->data + 512); + err = VasEBoot_netbuff_reserve (nb_reply, nb->tail - nb->data + 512); if (err) goto ping_fail; - err = grub_netbuff_push (nb_reply, nb->tail - nb->data); + err = VasEBoot_netbuff_push (nb_reply, nb->tail - nb->data); if (err) goto ping_fail; - grub_memcpy (nb_reply->data, nb->data, nb->tail - nb->data); - err = grub_netbuff_push (nb_reply, sizeof (*icmphr)); + VasEBoot_memcpy (nb_reply->data, nb->data, nb->tail - nb->data); + err = VasEBoot_netbuff_push (nb_reply, sizeof (*icmphr)); if (err) goto ping_fail; icmphr = (struct icmp_header *) nb_reply->data; icmphr->type = ICMP6_ECHO_REPLY; icmphr->code = 0; icmphr->checksum = 0; - icmphr->checksum = grub_net_ip_transport_checksum (nb_reply, - GRUB_NET_IP_ICMPV6, + icmphr->checksum = VasEBoot_net_ip_transport_checksum (nb_reply, + VasEBoot_NET_IP_ICMPV6, &inf->address, source); - err = grub_net_send_ip_packet (inf, source, ll_src, nb_reply, - GRUB_NET_IP_ICMPV6); + err = VasEBoot_net_send_ip_packet (inf, source, ll_src, nb_reply, + VasEBoot_NET_IP_ICMPV6); ping_fail: - grub_netbuff_free (nb); - grub_netbuff_free (nb_reply); + VasEBoot_netbuff_free (nb); + VasEBoot_netbuff_free (nb_reply); return err; } case ICMP6_NEIGHBOUR_SOLICIT: { struct neighbour_solicit *nbh; - struct grub_net_buff *nb_reply; + struct VasEBoot_net_buff *nb_reply; struct option_header *ohdr; struct neighbour_advertise *adv; struct icmp_header *icmphr; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; if (icmph->code) break; if (ttl != 0xff) break; nbh = (struct neighbour_solicit *) nb->data; - err = grub_netbuff_pull (nb, sizeof (*nbh)); + err = VasEBoot_netbuff_pull (nb, sizeof (*nbh)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail; + for (ptr = (VasEBoot_uint8_t *) nb->data; ptr < nb->tail; ptr += ohdr->len * 8) { ohdr = (struct option_header *) ptr; if (ohdr->len == 0 || ptr + 8 * ohdr->len > nb->tail) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (ohdr->type == OPTION_SOURCE_LINK_LAYER_ADDRESS && ohdr->len == 1) { - grub_net_link_level_address_t ll_address; - ll_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); - grub_net_link_layer_add_address (card, source, &ll_address, 0); + VasEBoot_net_link_level_address_t ll_address; + ll_address.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); + VasEBoot_net_link_layer_add_address (card, source, &ll_address, 0); } } FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { if (inf->card == card - && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && grub_memcmp (&inf->address.ipv6, &nbh->target, 16) == 0) + && inf->address.type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && VasEBoot_memcmp (&inf->address.ipv6, &nbh->target, 16) == 0) break; } if (!inf) break; - nb_reply = grub_netbuff_alloc (sizeof (struct neighbour_advertise) + nb_reply = VasEBoot_netbuff_alloc (sizeof (struct neighbour_advertise) + sizeof (struct option_header) + 6 + sizeof (struct icmp_header) - + GRUB_NET_OUR_IPV6_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + + VasEBoot_NET_OUR_IPV6_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb_reply) { - grub_netbuff_free (nb); - return grub_errno; + VasEBoot_netbuff_free (nb); + return VasEBoot_errno; } - err = grub_netbuff_reserve (nb_reply, + err = VasEBoot_netbuff_reserve (nb_reply, sizeof (struct neighbour_advertise) + sizeof (struct option_header) + 6 + sizeof (struct icmp_header) - + GRUB_NET_OUR_IPV6_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + + VasEBoot_NET_OUR_IPV6_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (err) goto ndp_fail; - err = grub_netbuff_push (nb_reply, 6); + err = VasEBoot_netbuff_push (nb_reply, 6); if (err) goto ndp_fail; - grub_memcpy (nb_reply->data, inf->hwaddress.mac, 6); - err = grub_netbuff_push (nb_reply, sizeof (*ohdr)); + VasEBoot_memcpy (nb_reply->data, inf->hwaddress.mac, 6); + err = VasEBoot_netbuff_push (nb_reply, sizeof (*ohdr)); if (err) goto ndp_fail; ohdr = (struct option_header *) nb_reply->data; ohdr->type = OPTION_TARGET_LINK_LAYER_ADDRESS; ohdr->len = 1; - err = grub_netbuff_push (nb_reply, sizeof (*adv)); + err = VasEBoot_netbuff_push (nb_reply, sizeof (*adv)); if (err) goto ndp_fail; adv = (struct neighbour_advertise *) nb_reply->data; - adv->flags = grub_cpu_to_be32_compile_time (FLAG_SOLICITED + adv->flags = VasEBoot_cpu_to_be32_compile_time (FLAG_SOLICITED | FLAG_OVERRIDE); - grub_memcpy (&adv->target, &nbh->target, 16); + VasEBoot_memcpy (&adv->target, &nbh->target, 16); - err = grub_netbuff_push (nb_reply, sizeof (*icmphr)); + err = VasEBoot_netbuff_push (nb_reply, sizeof (*icmphr)); if (err) goto ndp_fail; icmphr = (struct icmp_header *) nb_reply->data; icmphr->type = ICMP6_NEIGHBOUR_ADVERTISE; icmphr->code = 0; icmphr->checksum = 0; - icmphr->checksum = grub_net_ip_transport_checksum (nb_reply, - GRUB_NET_IP_ICMPV6, + icmphr->checksum = VasEBoot_net_ip_transport_checksum (nb_reply, + VasEBoot_NET_IP_ICMPV6, &inf->address, source); - err = grub_net_send_ip_packet (inf, source, ll_src, nb_reply, - GRUB_NET_IP_ICMPV6); + err = VasEBoot_net_send_ip_packet (inf, source, ll_src, nb_reply, + VasEBoot_NET_IP_ICMPV6); ndp_fail: - grub_netbuff_free (nb); - grub_netbuff_free (nb_reply); + VasEBoot_netbuff_free (nb); + VasEBoot_netbuff_free (nb_reply); return err; } case ICMP6_NEIGHBOUR_ADVERTISE: { struct neighbour_advertise *nbh; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; struct option_header *ohdr; if (icmph->code) @@ -315,109 +315,109 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, if (ttl != 0xff) break; nbh = (struct neighbour_advertise *) nb->data; - err = grub_netbuff_pull (nb, sizeof (*nbh)); + err = VasEBoot_netbuff_pull (nb, sizeof (*nbh)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail; + for (ptr = (VasEBoot_uint8_t *) nb->data; ptr < nb->tail; ptr += ohdr->len * 8) { ohdr = (struct option_header *) ptr; if (ohdr->len == 0 || ptr + 8 * ohdr->len > nb->tail) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (ohdr->type == OPTION_TARGET_LINK_LAYER_ADDRESS && ohdr->len == 1) { - grub_net_link_level_address_t ll_address; - ll_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); - grub_net_link_layer_add_address (card, source, &ll_address, 0); + VasEBoot_net_link_level_address_t ll_address; + ll_address.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); + VasEBoot_net_link_layer_add_address (card, source, &ll_address, 0); } } break; } case ICMP6_ROUTER_ADVERTISE: { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; struct option_header *ohdr; struct router_adv *radv; - struct grub_net_network_level_interface *route_inf = NULL; + struct VasEBoot_net_network_level_interface *route_inf = NULL; int default_route = 0; if (icmph->code) break; radv = (struct router_adv *)nb->data; - err = grub_netbuff_pull (nb, sizeof (struct router_adv)); + err = VasEBoot_netbuff_pull (nb, sizeof (struct router_adv)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - if (grub_be_to_cpu16 (radv->router_lifetime) > 0) + if (VasEBoot_be_to_cpu16 (radv->router_lifetime) > 0) { - struct grub_net_route *route; + struct VasEBoot_net_route *route; FOR_NET_ROUTES (route) { - if (!grub_memcmp (&route->gw, source, sizeof (route->gw))) + if (!VasEBoot_memcmp (&route->gw, source, sizeof (route->gw))) break; } if (route == NULL) default_route = 1; } - for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail; + for (ptr = (VasEBoot_uint8_t *) nb->data; ptr < nb->tail; ptr += ohdr->len * 8) { ohdr = (struct option_header *) ptr; if (ohdr->len == 0 || ptr + 8 * ohdr->len > nb->tail) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (ohdr->type == OPTION_SOURCE_LINK_LAYER_ADDRESS && ohdr->len == 1) { - grub_net_link_level_address_t ll_address; - ll_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); - grub_net_link_layer_add_address (card, source, &ll_address, 0); + VasEBoot_net_link_level_address_t ll_address; + ll_address.type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memcpy (ll_address.mac, ohdr + 1, sizeof (ll_address.mac)); + VasEBoot_net_link_layer_add_address (card, source, &ll_address, 0); } if (ohdr->type == OPTION_PREFIX && ohdr->len == 4) { struct prefix_option *opt = (struct prefix_option *) ptr; - struct grub_net_slaac_mac_list *slaac; + struct VasEBoot_net_slaac_mac_list *slaac; if (!(opt->flags & FLAG_SLAAC) - || (grub_be_to_cpu64 (opt->prefix[0]) >> 48) == 0xfe80 - || (grub_be_to_cpu32 (opt->preferred_lifetime) - > grub_be_to_cpu32 (opt->valid_lifetime)) + || (VasEBoot_be_to_cpu64 (opt->prefix[0]) >> 48) == 0xfe80 + || (VasEBoot_be_to_cpu32 (opt->preferred_lifetime) + > VasEBoot_be_to_cpu32 (opt->valid_lifetime)) || opt->prefixlen != 64) { - grub_dprintf ("net", "discarded prefix: %d, %d, %d, %d\n", + VasEBoot_dprintf ("net", "discarded prefix: %d, %d, %d, %d\n", !(opt->flags & FLAG_SLAAC), - (grub_be_to_cpu64 (opt->prefix[0]) >> 48) == 0xfe80, - (grub_be_to_cpu32 (opt->preferred_lifetime) - > grub_be_to_cpu32 (opt->valid_lifetime)), + (VasEBoot_be_to_cpu64 (opt->prefix[0]) >> 48) == 0xfe80, + (VasEBoot_be_to_cpu32 (opt->preferred_lifetime) + > VasEBoot_be_to_cpu32 (opt->valid_lifetime)), opt->prefixlen != 64); continue; } for (slaac = card->slaac_list; slaac; slaac = slaac->next) { - grub_net_network_level_address_t addr; - grub_net_network_level_netaddress_t netaddr; + VasEBoot_net_network_level_address_t addr; + VasEBoot_net_network_level_netaddress_t netaddr; if (slaac->address.type - != GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET) + != VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET) continue; - addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + addr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; addr.ipv6[0] = opt->prefix[0]; - addr.ipv6[1] = grub_net_ipv6_get_id (&slaac->address); - netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + addr.ipv6[1] = VasEBoot_net_ipv6_get_id (&slaac->address); + netaddr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; netaddr.ipv6.base[0] = opt->prefix[0]; netaddr.ipv6.base[1] = 0; netaddr.ipv6.masksize = 64; @@ -425,7 +425,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { if (inf->card == card - && grub_net_addr_cmp (&inf->address, &addr) == 0) + && VasEBoot_net_addr_cmp (&inf->address, &addr) == 0) break; } /* Update lease time if needed here once we have @@ -437,24 +437,24 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, continue; } - grub_dprintf ("net", "creating slaac\n"); + VasEBoot_dprintf ("net", "creating slaac\n"); { char *name; - name = grub_xasprintf ("%s:%d", + name = VasEBoot_xasprintf ("%s:%d", slaac->name, slaac->slaac_counter++); if (!name) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - inf = grub_net_add_addr (name, + inf = VasEBoot_net_add_addr (name, card, &addr, &slaac->address, 0); if (!route_inf) route_inf = inf; - grub_net_add_route (name, netaddr, inf); - grub_free (name); + VasEBoot_net_add_route (name, netaddr, inf); + VasEBoot_free (name); } } } @@ -462,15 +462,15 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, if (default_route) { char *name; - grub_net_network_level_netaddress_t netaddr; - name = grub_xasprintf ("%s:ra:default6", card->name); + VasEBoot_net_network_level_netaddress_t netaddr; + name = VasEBoot_xasprintf ("%s:ra:default6", card->name); if (!name) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; goto next; } /* Default routes take alll of the traffic, so make the mask huge */ - netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + netaddr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; netaddr.ipv6.masksize = 0; netaddr.ipv6.base[0] = 0; netaddr.ipv6.base[1] = 0; @@ -482,8 +482,8 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { if (inf->card == card && inf != orig_inf - && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && grub_net_hwaddr_cmp(&inf->hwaddress, + && inf->address.type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && VasEBoot_net_hwaddr_cmp(&inf->hwaddress, &orig_inf->hwaddress) == 0) { route_inf = inf; @@ -492,8 +492,8 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, } } if (route_inf != NULL) - grub_net_add_route_gw (name, netaddr, *source, route_inf); - grub_free (name); + VasEBoot_net_add_route_gw (name, netaddr, *source, route_inf); + VasEBoot_free (name); } next: if (ptr != nb->tail) @@ -501,69 +501,69 @@ next: } }; - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr) +VasEBoot_err_t +VasEBoot_net_icmp6_send_request (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr) { - struct grub_net_buff *nb; - grub_err_t err = GRUB_ERR_NONE; + struct VasEBoot_net_buff *nb; + VasEBoot_err_t err = VasEBoot_ERR_NONE; int i; struct option_header *ohdr; struct neighbour_solicit *sol; struct icmp_header *icmphr; - grub_net_network_level_address_t multicast; - grub_net_link_level_address_t ll_multicast; - grub_uint8_t *nbd; - multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - multicast.ipv6[0] = grub_be_to_cpu64_compile_time (0xff02ULL << 48); - multicast.ipv6[1] = (grub_be_to_cpu64_compile_time (0x01ff000000ULL) + VasEBoot_net_network_level_address_t multicast; + VasEBoot_net_link_level_address_t ll_multicast; + VasEBoot_uint8_t *nbd; + multicast.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + multicast.ipv6[0] = VasEBoot_be_to_cpu64_compile_time (0xff02ULL << 48); + multicast.ipv6[1] = (VasEBoot_be_to_cpu64_compile_time (0x01ff000000ULL) | (proto_addr->ipv6[1] - & grub_be_to_cpu64_compile_time (0xffffff))); + & VasEBoot_be_to_cpu64_compile_time (0xffffff))); - err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); + err = VasEBoot_net_link_layer_resolve (inf, &multicast, &ll_multicast); if (err) return err; - nb = grub_netbuff_alloc (sizeof (struct neighbour_solicit) + nb = VasEBoot_netbuff_alloc (sizeof (struct neighbour_solicit) + sizeof (struct option_header) + 6 + sizeof (struct icmp_header) - + GRUB_NET_OUR_IPV6_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + + VasEBoot_NET_OUR_IPV6_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb) - return grub_errno; - err = grub_netbuff_reserve (nb, + return VasEBoot_errno; + err = VasEBoot_netbuff_reserve (nb, sizeof (struct neighbour_solicit) + sizeof (struct option_header) + 6 + sizeof (struct icmp_header) - + GRUB_NET_OUR_IPV6_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); - err = grub_netbuff_push (nb, 6); + + VasEBoot_NET_OUR_IPV6_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); + err = VasEBoot_netbuff_push (nb, 6); if (err) goto fail; - grub_memcpy (nb->data, inf->hwaddress.mac, 6); - err = grub_netbuff_push (nb, sizeof (*ohdr)); + VasEBoot_memcpy (nb->data, inf->hwaddress.mac, 6); + err = VasEBoot_netbuff_push (nb, sizeof (*ohdr)); if (err) goto fail; ohdr = (struct option_header *) nb->data; ohdr->type = OPTION_SOURCE_LINK_LAYER_ADDRESS; ohdr->len = 1; - err = grub_netbuff_push (nb, sizeof (*sol)); + err = VasEBoot_netbuff_push (nb, sizeof (*sol)); if (err) goto fail; sol = (struct neighbour_solicit *) nb->data; sol->reserved = 0; - grub_memcpy (&sol->target, &proto_addr->ipv6, 16); + VasEBoot_memcpy (&sol->target, &proto_addr->ipv6, 16); - err = grub_netbuff_push (nb, sizeof (*icmphr)); + err = VasEBoot_netbuff_push (nb, sizeof (*icmphr)); if (err) goto fail; @@ -571,80 +571,80 @@ grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, icmphr->type = ICMP6_NEIGHBOUR_SOLICIT; icmphr->code = 0; icmphr->checksum = 0; - icmphr->checksum = grub_net_ip_transport_checksum (nb, - GRUB_NET_IP_ICMPV6, + icmphr->checksum = VasEBoot_net_ip_transport_checksum (nb, + VasEBoot_NET_IP_ICMPV6, &inf->address, &multicast); nbd = nb->data; - err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, - GRUB_NET_IP_ICMPV6); + err = VasEBoot_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, + VasEBoot_NET_IP_ICMPV6); if (err) goto fail; - for (i = 0; i < GRUB_NET_TRIES; i++) + for (i = 0; i < VasEBoot_NET_TRIES; i++) { - if (grub_net_link_layer_resolve_check (inf, proto_addr)) + if (VasEBoot_net_link_layer_resolve_check (inf, proto_addr)) break; - grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), + VasEBoot_net_poll_cards (VasEBoot_NET_INTERVAL + (i * VasEBoot_NET_INTERVAL_ADDITION), 0); - if (grub_net_link_layer_resolve_check (inf, proto_addr)) + if (VasEBoot_net_link_layer_resolve_check (inf, proto_addr)) break; nb->data = nbd; - err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, - GRUB_NET_IP_ICMPV6); + err = VasEBoot_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, + VasEBoot_NET_IP_ICMPV6); if (err) break; } fail: - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } -grub_err_t -grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf) +VasEBoot_err_t +VasEBoot_net_icmp6_send_router_solicit (struct VasEBoot_net_network_level_interface *inf) { - struct grub_net_buff *nb; - grub_err_t err = GRUB_ERR_NONE; - grub_net_network_level_address_t multicast; - grub_net_link_level_address_t ll_multicast; + struct VasEBoot_net_buff *nb; + VasEBoot_err_t err = VasEBoot_ERR_NONE; + VasEBoot_net_network_level_address_t multicast; + VasEBoot_net_link_level_address_t ll_multicast; struct option_header *ohdr; struct router_solicit *sol; struct icmp_header *icmphr; - multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48); - multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x02ULL); + multicast.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + multicast.ipv6[0] = VasEBoot_cpu_to_be64_compile_time (0xff02ULL << 48); + multicast.ipv6[1] = VasEBoot_cpu_to_be64_compile_time (0x02ULL); - err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); + err = VasEBoot_net_link_layer_resolve (inf, &multicast, &ll_multicast); if (err) return err; - nb = grub_netbuff_alloc (sizeof (struct router_solicit) + nb = VasEBoot_netbuff_alloc (sizeof (struct router_solicit) + sizeof (struct option_header) + 6 + sizeof (struct icmp_header) - + GRUB_NET_OUR_IPV6_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + + VasEBoot_NET_OUR_IPV6_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb) - return grub_errno; - err = grub_netbuff_reserve (nb, + return VasEBoot_errno; + err = VasEBoot_netbuff_reserve (nb, sizeof (struct router_solicit) + sizeof (struct option_header) + 6 + sizeof (struct icmp_header) - + GRUB_NET_OUR_IPV6_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + + VasEBoot_NET_OUR_IPV6_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (err) goto fail; - err = grub_netbuff_push (nb, 6); + err = VasEBoot_netbuff_push (nb, 6); if (err) goto fail; - grub_memcpy (nb->data, inf->hwaddress.mac, 6); + VasEBoot_memcpy (nb->data, inf->hwaddress.mac, 6); - err = grub_netbuff_push (nb, sizeof (*ohdr)); + err = VasEBoot_netbuff_push (nb, sizeof (*ohdr)); if (err) goto fail; @@ -652,14 +652,14 @@ grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf ohdr->type = OPTION_SOURCE_LINK_LAYER_ADDRESS; ohdr->len = 1; - err = grub_netbuff_push (nb, sizeof (*sol)); + err = VasEBoot_netbuff_push (nb, sizeof (*sol)); if (err) goto fail; sol = (struct router_solicit *) nb->data; sol->reserved = 0; - err = grub_netbuff_push (nb, sizeof (*icmphr)); + err = VasEBoot_netbuff_push (nb, sizeof (*icmphr)); if (err) goto fail; @@ -667,13 +667,13 @@ grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf icmphr->type = ICMP6_ROUTER_SOLICIT; icmphr->code = 0; icmphr->checksum = 0; - icmphr->checksum = grub_net_ip_transport_checksum (nb, - GRUB_NET_IP_ICMPV6, + icmphr->checksum = VasEBoot_net_ip_transport_checksum (nb, + VasEBoot_NET_IP_ICMPV6, &inf->address, &multicast); - err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, - GRUB_NET_IP_ICMPV6); + err = VasEBoot_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, + VasEBoot_NET_IP_ICMPV6); fail: - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } diff --git a/VasEBoot-core/net/ip.c b/VasEBoot-core/net/ip.c index aba4f8908..b89e1ff92 100644 --- a/VasEBoot-core/net/ip.c +++ b/VasEBoot-core/net/ip.c @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include struct iphdr { - grub_uint8_t verhdrlen; - grub_uint8_t service; - grub_uint16_t len; - grub_uint16_t ident; - grub_uint16_t frags; - grub_uint8_t ttl; - grub_uint8_t protocol; - grub_uint16_t chksum; - grub_uint32_t src; - grub_uint32_t dest; -} GRUB_PACKED ; + VasEBoot_uint8_t verhdrlen; + VasEBoot_uint8_t service; + VasEBoot_uint16_t len; + VasEBoot_uint16_t ident; + VasEBoot_uint16_t frags; + VasEBoot_uint8_t ttl; + VasEBoot_uint8_t protocol; + VasEBoot_uint16_t chksum; + VasEBoot_uint32_t src; + VasEBoot_uint32_t dest; +} VasEBoot_PACKED ; enum { @@ -47,30 +47,30 @@ enum OFFSET_MASK = 0x1fff }; -typedef grub_uint64_t ip6addr[2]; +typedef VasEBoot_uint64_t ip6addr[2]; struct ip6hdr { - grub_uint32_t version_class_flow; - grub_uint16_t len; - grub_uint8_t protocol; - grub_uint8_t ttl; + VasEBoot_uint32_t version_class_flow; + VasEBoot_uint16_t len; + VasEBoot_uint8_t protocol; + VasEBoot_uint8_t ttl; ip6addr src; ip6addr dest; -} GRUB_PACKED ; +} VasEBoot_PACKED ; static int cmp (const void *a__, const void *b__) { - struct grub_net_buff *a_ = *(struct grub_net_buff **) a__; - struct grub_net_buff *b_ = *(struct grub_net_buff **) b__; + struct VasEBoot_net_buff *a_ = *(struct VasEBoot_net_buff **) a__; + struct VasEBoot_net_buff *b_ = *(struct VasEBoot_net_buff **) b__; struct iphdr *a = (struct iphdr *) a_->data; struct iphdr *b = (struct iphdr *) b_->data; /* We want the first elements to be on top. */ - if ((grub_be_to_cpu16 (a->frags) & OFFSET_MASK) - < (grub_be_to_cpu16 (b->frags) & OFFSET_MASK)) + if ((VasEBoot_be_to_cpu16 (a->frags) & OFFSET_MASK) + < (VasEBoot_be_to_cpu16 (b->frags) & OFFSET_MASK)) return +1; - if ((grub_be_to_cpu16 (a->frags) & OFFSET_MASK) - > (grub_be_to_cpu16 (b->frags) & OFFSET_MASK)) + if ((VasEBoot_be_to_cpu16 (a->frags) & OFFSET_MASK) + > (VasEBoot_be_to_cpu16 (b->frags) & OFFSET_MASK)) return -1; return 0; } @@ -78,35 +78,35 @@ cmp (const void *a__, const void *b__) struct reassemble { struct reassemble *next; - grub_uint32_t source; - grub_uint32_t dest; - grub_uint16_t id; - grub_uint8_t proto; - grub_uint64_t last_time; - grub_priority_queue_t pq; - struct grub_net_buff *asm_netbuff; - grub_size_t total_len; - grub_size_t cur_ptr; - grub_uint8_t ttl; + VasEBoot_uint32_t source; + VasEBoot_uint32_t dest; + VasEBoot_uint16_t id; + VasEBoot_uint8_t proto; + VasEBoot_uint64_t last_time; + VasEBoot_priority_queue_t pq; + struct VasEBoot_net_buff *asm_netbuff; + VasEBoot_size_t total_len; + VasEBoot_size_t cur_ptr; + VasEBoot_uint8_t ttl; }; static struct reassemble *reassembles; -grub_uint16_t -grub_net_ip_chksum (void *ipv, grub_size_t len) +VasEBoot_uint16_t +VasEBoot_net_ip_chksum (void *ipv, VasEBoot_size_t len) { - grub_uint16_t *ip = (grub_uint16_t *) ipv; - grub_uint32_t sum = 0; + VasEBoot_uint16_t *ip = (VasEBoot_uint16_t *) ipv; + VasEBoot_uint32_t sum = 0; for (; len >= 2; len -= 2) { - sum += grub_be_to_cpu16 (grub_get_unaligned16 (ip++)); + sum += VasEBoot_be_to_cpu16 (VasEBoot_get_unaligned16 (ip++)); if (sum > 0xFFFF) sum -= 0xFFFF; } if (len) { - sum += *((grub_uint8_t *) ip) << 8; + sum += *((VasEBoot_uint8_t *) ip) << 8; if (sum > 0xFFFF) sum -= 0xFFFF; } @@ -114,50 +114,50 @@ grub_net_ip_chksum (void *ipv, grub_size_t len) if (sum >= 0xFFFF) sum -= 0xFFFF; - return grub_cpu_to_be16 ((~sum) & 0x0000FFFF); + return VasEBoot_cpu_to_be16 ((~sum) & 0x0000FFFF); } static int id = 0x2400; -static grub_err_t -send_fragmented (struct grub_net_network_level_interface * inf, - const grub_net_network_level_address_t * target, - struct grub_net_buff * nb, - grub_net_ip_protocol_t proto, - grub_net_link_level_address_t ll_target_addr) +static VasEBoot_err_t +send_fragmented (struct VasEBoot_net_network_level_interface * inf, + const VasEBoot_net_network_level_address_t * target, + struct VasEBoot_net_buff * nb, + VasEBoot_net_ip_protocol_t proto, + VasEBoot_net_link_level_address_t ll_target_addr) { - grub_size_t off = 0; - grub_size_t fraglen; - grub_err_t err; + VasEBoot_size_t off = 0; + VasEBoot_size_t fraglen; + VasEBoot_err_t err; fraglen = (inf->card->mtu - sizeof (struct iphdr)) & ~7; id++; while (nb->tail - nb->data) { - grub_size_t len = fraglen; - struct grub_net_buff *nb2; + VasEBoot_size_t len = fraglen; + struct VasEBoot_net_buff *nb2; struct iphdr *iph; - if ((grub_ssize_t) len > nb->tail - nb->data) + if ((VasEBoot_ssize_t) len > nb->tail - nb->data) len = nb->tail - nb->data; - nb2 = grub_netbuff_alloc (fraglen + sizeof (struct iphdr) - + GRUB_NET_MAX_LINK_HEADER_SIZE); + nb2 = VasEBoot_netbuff_alloc (fraglen + sizeof (struct iphdr) + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb2) - return grub_errno; - err = grub_netbuff_reserve (nb2, GRUB_NET_MAX_LINK_HEADER_SIZE); + return VasEBoot_errno; + err = VasEBoot_netbuff_reserve (nb2, VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (err) return err; - err = grub_netbuff_put (nb2, sizeof (struct iphdr)); + err = VasEBoot_netbuff_put (nb2, sizeof (struct iphdr)); if (err) return err; iph = (struct iphdr *) nb2->data; iph->verhdrlen = ((4 << 4) | 5); iph->service = 0; - iph->len = grub_cpu_to_be16 (len + sizeof (struct iphdr)); - iph->ident = grub_cpu_to_be16 (id); - iph->frags = grub_cpu_to_be16 (off | (((grub_ssize_t) len + iph->len = VasEBoot_cpu_to_be16 (len + sizeof (struct iphdr)); + iph->ident = VasEBoot_cpu_to_be16 (id); + iph->frags = VasEBoot_cpu_to_be16 (off | (((VasEBoot_ssize_t) len == nb->tail - nb->data) ? 0 : MORE_FRAGMENTS)); iph->ttl = 0xff; @@ -167,46 +167,46 @@ send_fragmented (struct grub_net_network_level_interface * inf, off += len / 8; iph->chksum = 0; - iph->chksum = grub_net_ip_chksum ((void *) nb2->data, sizeof (*iph)); - err = grub_netbuff_put (nb2, len); + iph->chksum = VasEBoot_net_ip_chksum ((void *) nb2->data, sizeof (*iph)); + err = VasEBoot_netbuff_put (nb2, len); if (err) return err; - grub_memcpy (iph + 1, nb->data, len); - err = grub_netbuff_pull (nb, len); + VasEBoot_memcpy (iph + 1, nb->data, len); + err = VasEBoot_netbuff_pull (nb, len); if (err) return err; err = send_ethernet_packet (inf, nb2, ll_target_addr, - GRUB_NET_ETHERTYPE_IP); + VasEBoot_NET_ETHERTYPE_IP); if (err) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_net_send_ip4_packet (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *target, - const grub_net_link_level_address_t *ll_target_addr, - struct grub_net_buff *nb, - grub_net_ip_protocol_t proto) +static VasEBoot_err_t +VasEBoot_net_send_ip4_packet (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *target, + const VasEBoot_net_link_level_address_t *ll_target_addr, + struct VasEBoot_net_buff *nb, + VasEBoot_net_ip_protocol_t proto) { struct iphdr *iph; - grub_err_t err; + VasEBoot_err_t err; - COMPILE_TIME_ASSERT (GRUB_NET_OUR_IPV4_HEADER_SIZE == sizeof (*iph)); + COMPILE_TIME_ASSERT (VasEBoot_NET_OUR_IPV4_HEADER_SIZE == sizeof (*iph)); if (nb->tail - nb->data + sizeof (struct iphdr) > inf->card->mtu) return send_fragmented (inf, target, nb, proto, *ll_target_addr); - err = grub_netbuff_push (nb, sizeof (*iph)); + err = VasEBoot_netbuff_push (nb, sizeof (*iph)); if (err) return err; iph = (struct iphdr *) nb->data; iph->verhdrlen = ((4 << 4) | 5); iph->service = 0; - iph->len = grub_cpu_to_be16 (nb->tail - nb->data); - iph->ident = grub_cpu_to_be16 (++id); + iph->len = VasEBoot_cpu_to_be16 (nb->tail - nb->data); + iph->ident = VasEBoot_cpu_to_be16 (++id); iph->frags = 0; iph->ttl = 0xff; iph->protocol = proto; @@ -214,101 +214,101 @@ grub_net_send_ip4_packet (struct grub_net_network_level_interface *inf, iph->dest = target->ipv4; iph->chksum = 0; - iph->chksum = grub_net_ip_chksum ((void *) nb->data, sizeof (*iph)); + iph->chksum = VasEBoot_net_ip_chksum ((void *) nb->data, sizeof (*iph)); return send_ethernet_packet (inf, nb, *ll_target_addr, - GRUB_NET_ETHERTYPE_IP); + VasEBoot_NET_ETHERTYPE_IP); } -static grub_err_t -handle_dgram (struct grub_net_buff *nb, - struct grub_net_card *card, - const grub_net_link_level_address_t *source_hwaddress, - const grub_net_link_level_address_t *hwaddress, - grub_net_ip_protocol_t proto, - const grub_net_network_level_address_t *source, - const grub_net_network_level_address_t *dest, - grub_uint8_t ttl) +static VasEBoot_err_t +handle_dgram (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *source_hwaddress, + const VasEBoot_net_link_level_address_t *hwaddress, + VasEBoot_net_ip_protocol_t proto, + const VasEBoot_net_network_level_address_t *source, + const VasEBoot_net_network_level_address_t *dest, + VasEBoot_uint8_t ttl) { - struct grub_net_network_level_interface *inf = NULL; - grub_err_t err; + struct VasEBoot_net_network_level_interface *inf = NULL; + VasEBoot_err_t err; int multicast = 0; /* DHCP needs special treatment since we don't know IP yet. */ { struct udphdr *udph; udph = (struct udphdr *) nb->data; - if (proto == GRUB_NET_IP_UDP && grub_be_to_cpu16 (udph->dst) == 68) + if (proto == VasEBoot_NET_IP_UDP && VasEBoot_be_to_cpu16 (udph->dst) == 68) { - const struct grub_net_bootp_packet *bootp; + const struct VasEBoot_net_bootp_packet *bootp; if (udph->chksum) { - grub_uint16_t chk, expected; + VasEBoot_uint16_t chk, expected; chk = udph->chksum; udph->chksum = 0; - expected = grub_net_ip_transport_checksum (nb, - GRUB_NET_IP_UDP, + expected = VasEBoot_net_ip_transport_checksum (nb, + VasEBoot_NET_IP_UDP, source, dest); if (expected != chk) { - grub_dprintf ("net", "Invalid UDP checksum. " + VasEBoot_dprintf ("net", "Invalid UDP checksum. " "Expected %x, got %x\n", - grub_be_to_cpu16 (expected), - grub_be_to_cpu16 (chk)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_be_to_cpu16 (expected), + VasEBoot_be_to_cpu16 (chk)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } udph->chksum = chk; } - err = grub_netbuff_pull (nb, sizeof (*udph)); + err = VasEBoot_netbuff_pull (nb, sizeof (*udph)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - bootp = (const struct grub_net_bootp_packet *) nb->data; + bootp = (const struct VasEBoot_net_bootp_packet *) nb->data; FOR_NET_NETWORK_LEVEL_INTERFACES (inf) if (inf->card == card - && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV - && inf->hwaddress.type == GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET - && grub_memcmp (inf->hwaddress.mac, &bootp->mac_addr, + && inf->address.type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV + && inf->hwaddress.type == VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET + && VasEBoot_memcmp (inf->hwaddress.mac, &bootp->mac_addr, sizeof (inf->hwaddress.mac)) == 0) { - grub_net_process_dhcp (nb, inf->card); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_net_process_dhcp (nb, inf->card); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } } FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { if (inf->card == card - && grub_net_addr_cmp (&inf->address, dest) == 0 - && grub_net_hwaddr_cmp (&inf->hwaddress, hwaddress) == 0) + && VasEBoot_net_addr_cmp (&inf->address, dest) == 0 + && VasEBoot_net_hwaddr_cmp (&inf->hwaddress, hwaddress) == 0) break; /* Solicited node multicast. */ if (inf->card == card - && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && dest->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && dest->ipv6[0] == grub_be_to_cpu64_compile_time (0xff02ULL << 48) - && dest->ipv6[1] == (grub_be_to_cpu64_compile_time (0x01ff000000ULL) + && inf->address.type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && dest->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && dest->ipv6[0] == VasEBoot_be_to_cpu64_compile_time (0xff02ULL << 48) + && dest->ipv6[1] == (VasEBoot_be_to_cpu64_compile_time (0x01ff000000ULL) | (inf->address.ipv6[1] - & grub_be_to_cpu64_compile_time (0xffffff))) - && hwaddress->type == GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET + & VasEBoot_be_to_cpu64_compile_time (0xffffff))) + && hwaddress->type == VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET && hwaddress->mac[0] == 0x33 && hwaddress->mac[1] == 0x33 && hwaddress->mac[2] == 0xff - && hwaddress->mac[3] == ((grub_be_to_cpu64 (inf->address.ipv6[1]) + && hwaddress->mac[3] == ((VasEBoot_be_to_cpu64 (inf->address.ipv6[1]) >> 16) & 0xff) - && hwaddress->mac[4] == ((grub_be_to_cpu64 (inf->address.ipv6[1]) + && hwaddress->mac[4] == ((VasEBoot_be_to_cpu64 (inf->address.ipv6[1]) >> 8) & 0xff) - && hwaddress->mac[5] == ((grub_be_to_cpu64 (inf->address.ipv6[1]) + && hwaddress->mac[5] == ((VasEBoot_be_to_cpu64 (inf->address.ipv6[1]) >> 0) & 0xff)) { multicast = 1; @@ -316,54 +316,54 @@ handle_dgram (struct grub_net_buff *nb, } } - if (!inf && !(dest->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && dest->ipv6[0] == grub_be_to_cpu64_compile_time (0xff02ULL + if (!inf && !(dest->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && dest->ipv6[0] == VasEBoot_be_to_cpu64_compile_time (0xff02ULL << 48) - && dest->ipv6[1] == grub_be_to_cpu64_compile_time (1))) + && dest->ipv6[1] == VasEBoot_be_to_cpu64_compile_time (1))) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (multicast) inf = NULL; switch (proto) { - case GRUB_NET_IP_UDP: - return grub_net_recv_udp_packet (nb, inf, source); - case GRUB_NET_IP_TCP: - return grub_net_recv_tcp_packet (nb, inf, source); - case GRUB_NET_IP_ICMP: - return grub_net_recv_icmp_packet (nb, inf, source_hwaddress, source); - case GRUB_NET_IP_ICMPV6: - return grub_net_recv_icmp6_packet (nb, card, inf, source_hwaddress, + case VasEBoot_NET_IP_UDP: + return VasEBoot_net_recv_udp_packet (nb, inf, source); + case VasEBoot_NET_IP_TCP: + return VasEBoot_net_recv_tcp_packet (nb, inf, source); + case VasEBoot_NET_IP_ICMP: + return VasEBoot_net_recv_icmp_packet (nb, inf, source_hwaddress, source); + case VasEBoot_NET_IP_ICMPV6: + return VasEBoot_net_recv_icmp6_packet (nb, card, inf, source_hwaddress, source, dest, ttl); default: - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void free_rsm (struct reassemble *rsm) { - struct grub_net_buff **nb; - while ((nb = grub_priority_queue_top (rsm->pq))) + struct VasEBoot_net_buff **nb; + while ((nb = VasEBoot_priority_queue_top (rsm->pq))) { - grub_netbuff_free (*nb); - grub_priority_queue_pop (rsm->pq); + VasEBoot_netbuff_free (*nb); + VasEBoot_priority_queue_pop (rsm->pq); } - grub_netbuff_free (rsm->asm_netbuff); - grub_priority_queue_destroy (rsm->pq); - grub_free (rsm); + VasEBoot_netbuff_free (rsm->asm_netbuff); + VasEBoot_priority_queue_destroy (rsm->pq); + VasEBoot_free (rsm); } static void free_old_fragments (void) { struct reassemble *rsm, **prev; - grub_uint64_t limit_time = grub_get_time_ms (); + VasEBoot_uint64_t limit_time = VasEBoot_get_time_ms (); limit_time = (limit_time > 90000) ? limit_time - 90000 : 0; @@ -379,82 +379,82 @@ free_old_fragments (void) } } -static grub_err_t -grub_net_recv_ip4_packets (struct grub_net_buff *nb, - struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddress, - const grub_net_link_level_address_t *src_hwaddress) +static VasEBoot_err_t +VasEBoot_net_recv_ip4_packets (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddress, + const VasEBoot_net_link_level_address_t *src_hwaddress) { struct iphdr *iph = (struct iphdr *) nb->data; - grub_err_t err; + VasEBoot_err_t err; struct reassemble *rsm, **prev; if ((iph->verhdrlen >> 4) != 4) { - grub_dprintf ("net", "Bad IP version: %d\n", (iph->verhdrlen >> 4)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "Bad IP version: %d\n", (iph->verhdrlen >> 4)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if ((iph->verhdrlen & 0xf) < 5) { - grub_dprintf ("net", "IP header too short: %d\n", + VasEBoot_dprintf ("net", "IP header too short: %d\n", (iph->verhdrlen & 0xf)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } - if (nb->tail - nb->data < (grub_ssize_t) ((iph->verhdrlen & 0xf) - * sizeof (grub_uint32_t))) + if (nb->tail - nb->data < (VasEBoot_ssize_t) ((iph->verhdrlen & 0xf) + * sizeof (VasEBoot_uint32_t))) { - grub_dprintf ("net", "IP packet too short: %" PRIdGRUB_SSIZE "\n", - (grub_ssize_t) (nb->tail - nb->data)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "IP packet too short: %" PRIdVasEBoot_SSIZE "\n", + (VasEBoot_ssize_t) (nb->tail - nb->data)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } /* Check size. */ { - grub_size_t expected_size = grub_be_to_cpu16 (iph->len); - grub_size_t actual_size = (nb->tail - nb->data); + VasEBoot_size_t expected_size = VasEBoot_be_to_cpu16 (iph->len); + VasEBoot_size_t actual_size = (nb->tail - nb->data); if (actual_size > expected_size) { - err = grub_netbuff_unput (nb, actual_size - expected_size); + err = VasEBoot_netbuff_unput (nb, actual_size - expected_size); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } } if (actual_size < expected_size) { - grub_dprintf ("net", "Cut IP packet actual: %" PRIuGRUB_SIZE - ", expected %" PRIuGRUB_SIZE "\n", actual_size, + VasEBoot_dprintf ("net", "Cut IP packet actual: %" PRIuVasEBoot_SIZE + ", expected %" PRIuVasEBoot_SIZE "\n", actual_size, expected_size); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } } /* Unfragmented packet. Good. */ - if (((grub_be_to_cpu16 (iph->frags) & MORE_FRAGMENTS) == 0) - && (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK) == 0) + if (((VasEBoot_be_to_cpu16 (iph->frags) & MORE_FRAGMENTS) == 0) + && (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK) == 0) { - grub_net_network_level_address_t source; - grub_net_network_level_address_t dest; + VasEBoot_net_network_level_address_t source; + VasEBoot_net_network_level_address_t dest; - err = grub_netbuff_pull (nb, ((iph->verhdrlen & 0xf) - * sizeof (grub_uint32_t))); + err = VasEBoot_netbuff_pull (nb, ((iph->verhdrlen & 0xf) + * sizeof (VasEBoot_uint32_t))); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } - source.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + source.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; source.ipv4 = iph->src; - dest.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + dest.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; dest.ipv4 = iph->dest; return handle_dgram (nb, card, src_hwaddress, hwaddress, iph->protocol, @@ -467,9 +467,9 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb, break; if (!rsm) { - rsm = grub_malloc (sizeof (*rsm)); + rsm = VasEBoot_malloc (sizeof (*rsm)); if (!rsm) - return grub_errno; + return VasEBoot_errno; rsm->source = iph->src; rsm->dest = iph->dest; rsm->id = iph->ident; @@ -477,11 +477,11 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb, rsm->next = reassembles; reassembles = rsm; prev = &reassembles; - rsm->pq = grub_priority_queue_new (sizeof (struct grub_net_buff **), cmp); + rsm->pq = VasEBoot_priority_queue_new (sizeof (struct VasEBoot_net_buff **), cmp); if (!rsm->pq) { - grub_free (rsm); - return grub_errno; + VasEBoot_free (rsm); + return VasEBoot_errno; } rsm->asm_netbuff = 0; rsm->total_len = 0; @@ -490,85 +490,85 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb, } if (rsm->ttl > iph->ttl) rsm->ttl = iph->ttl; - rsm->last_time = grub_get_time_ms (); + rsm->last_time = VasEBoot_get_time_ms (); free_old_fragments (); - err = grub_priority_queue_push (rsm->pq, &nb); + err = VasEBoot_priority_queue_push (rsm->pq, &nb); if (err) return err; - if (!(grub_be_to_cpu16 (iph->frags) & MORE_FRAGMENTS)) + if (!(VasEBoot_be_to_cpu16 (iph->frags) & MORE_FRAGMENTS)) { - rsm->total_len = (8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK) + rsm->total_len = (8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK) + (nb->tail - nb->data)); - rsm->total_len -= ((iph->verhdrlen & 0xf) * sizeof (grub_uint32_t)); - rsm->asm_netbuff = grub_netbuff_alloc (rsm->total_len); + rsm->total_len -= ((iph->verhdrlen & 0xf) * sizeof (VasEBoot_uint32_t)); + rsm->asm_netbuff = VasEBoot_netbuff_alloc (rsm->total_len); if (!rsm->asm_netbuff) { *prev = rsm->next; free_rsm (rsm); - return grub_errno; + return VasEBoot_errno; } } if (!rsm->asm_netbuff) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; while (1) { - struct grub_net_buff **nb_top_p, *nb_top; - grub_size_t copy; - grub_size_t res_len; - struct grub_net_buff *ret; - grub_net_ip_protocol_t proto; - grub_uint32_t src; - grub_uint32_t dst; - grub_net_network_level_address_t source; - grub_net_network_level_address_t dest; - grub_uint8_t ttl; + struct VasEBoot_net_buff **nb_top_p, *nb_top; + VasEBoot_size_t copy; + VasEBoot_size_t res_len; + struct VasEBoot_net_buff *ret; + VasEBoot_net_ip_protocol_t proto; + VasEBoot_uint32_t src; + VasEBoot_uint32_t dst; + VasEBoot_net_network_level_address_t source; + VasEBoot_net_network_level_address_t dest; + VasEBoot_uint8_t ttl; - nb_top_p = grub_priority_queue_top (rsm->pq); + nb_top_p = VasEBoot_priority_queue_top (rsm->pq); if (!nb_top_p) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; nb_top = *nb_top_p; - grub_priority_queue_pop (rsm->pq); + VasEBoot_priority_queue_pop (rsm->pq); iph = (struct iphdr *) nb_top->data; - err = grub_netbuff_pull (nb_top, ((iph->verhdrlen & 0xf) - * sizeof (grub_uint32_t))); + err = VasEBoot_netbuff_pull (nb_top, ((iph->verhdrlen & 0xf) + * sizeof (VasEBoot_uint32_t))); if (err) { - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); return err; } - if (rsm->cur_ptr < (grub_size_t) 8 * (grub_be_to_cpu16 (iph->frags) + if (rsm->cur_ptr < (VasEBoot_size_t) 8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK)) { - grub_netbuff_free (nb_top); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb_top); + return VasEBoot_ERR_NONE; } - rsm->cur_ptr = (8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK) + rsm->cur_ptr = (8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK) + (nb_top->tail - nb_top->head)); - if ((grub_size_t) 8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK) + if ((VasEBoot_size_t) 8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK) >= rsm->total_len) { - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); continue; } copy = nb_top->tail - nb_top->data; - if (rsm->total_len - 8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK) + if (rsm->total_len - 8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK) < copy) - copy = rsm->total_len - 8 * (grub_be_to_cpu16 (iph->frags) + copy = rsm->total_len - 8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK); - grub_memcpy (&rsm->asm_netbuff->data[8 * (grub_be_to_cpu16 (iph->frags) + VasEBoot_memcpy (&rsm->asm_netbuff->data[8 * (VasEBoot_be_to_cpu16 (iph->frags) & OFFSET_MASK)], nb_top->data, copy); - if ((grub_be_to_cpu16 (iph->frags) & MORE_FRAGMENTS)) + if ((VasEBoot_be_to_cpu16 (iph->frags) & MORE_FRAGMENTS)) { - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); continue; } - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); ret = rsm->asm_netbuff; proto = rsm->proto; @@ -581,16 +581,16 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb, *prev = rsm->next; free_rsm (rsm); - if (grub_netbuff_put (ret, res_len)) + if (VasEBoot_netbuff_put (ret, res_len)) { - grub_netbuff_free (ret); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (ret); + return VasEBoot_ERR_NONE; } - source.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + source.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; source.ipv4 = src; - dest.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + dest.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; dest.ipv4 = dst; return handle_dgram (ret, card, src_hwaddress, @@ -599,126 +599,126 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb, } } -static grub_err_t -grub_net_send_ip6_packet (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *target, - const grub_net_link_level_address_t *ll_target_addr, - struct grub_net_buff *nb, - grub_net_ip_protocol_t proto) +static VasEBoot_err_t +VasEBoot_net_send_ip6_packet (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *target, + const VasEBoot_net_link_level_address_t *ll_target_addr, + struct VasEBoot_net_buff *nb, + VasEBoot_net_ip_protocol_t proto) { struct ip6hdr *iph; - grub_err_t err; + VasEBoot_err_t err; - COMPILE_TIME_ASSERT (GRUB_NET_OUR_IPV6_HEADER_SIZE == sizeof (*iph)); + COMPILE_TIME_ASSERT (VasEBoot_NET_OUR_IPV6_HEADER_SIZE == sizeof (*iph)); if (nb->tail - nb->data + sizeof (struct iphdr) > inf->card->mtu) - return grub_error (GRUB_ERR_NET_PACKET_TOO_BIG, "packet too big"); + return VasEBoot_error (VasEBoot_ERR_NET_PACKET_TOO_BIG, "packet too big"); - err = grub_netbuff_push (nb, sizeof (*iph)); + err = VasEBoot_netbuff_push (nb, sizeof (*iph)); if (err) return err; iph = (struct ip6hdr *) nb->data; - iph->version_class_flow = grub_cpu_to_be32_compile_time ((6 << 28)); - iph->len = grub_cpu_to_be16 (nb->tail - nb->data - sizeof (*iph)); + iph->version_class_flow = VasEBoot_cpu_to_be32_compile_time ((6 << 28)); + iph->len = VasEBoot_cpu_to_be16 (nb->tail - nb->data - sizeof (*iph)); iph->protocol = proto; iph->ttl = 0xff; - grub_memcpy (&iph->src, inf->address.ipv6, sizeof (iph->src)); - grub_memcpy (&iph->dest, target->ipv6, sizeof (iph->dest)); + VasEBoot_memcpy (&iph->src, inf->address.ipv6, sizeof (iph->src)); + VasEBoot_memcpy (&iph->dest, target->ipv6, sizeof (iph->dest)); return send_ethernet_packet (inf, nb, *ll_target_addr, - GRUB_NET_ETHERTYPE_IP6); + VasEBoot_NET_ETHERTYPE_IP6); } -grub_err_t -grub_net_send_ip_packet (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *target, - const grub_net_link_level_address_t *ll_target_addr, - struct grub_net_buff *nb, - grub_net_ip_protocol_t proto) +VasEBoot_err_t +VasEBoot_net_send_ip_packet (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *target, + const VasEBoot_net_link_level_address_t *ll_target_addr, + struct VasEBoot_net_buff *nb, + VasEBoot_net_ip_protocol_t proto) { switch (target->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: - return grub_net_send_ip4_packet (inf, target, ll_target_addr, nb, proto); - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: - return grub_net_send_ip6_packet (inf, target, ll_target_addr, nb, proto); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + return VasEBoot_net_send_ip4_packet (inf, target, ll_target_addr, nb, proto); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + return VasEBoot_net_send_ip6_packet (inf, target, ll_target_addr, nb, proto); default: - return grub_error (GRUB_ERR_BUG, "not an IP"); + return VasEBoot_error (VasEBoot_ERR_BUG, "not an IP"); } } -static grub_err_t -grub_net_recv_ip6_packets (struct grub_net_buff *nb, - struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddress, - const grub_net_link_level_address_t *src_hwaddress) +static VasEBoot_err_t +VasEBoot_net_recv_ip6_packets (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddress, + const VasEBoot_net_link_level_address_t *src_hwaddress) { struct ip6hdr *iph = (struct ip6hdr *) nb->data; - grub_err_t err; - grub_net_network_level_address_t source; - grub_net_network_level_address_t dest; + VasEBoot_err_t err; + VasEBoot_net_network_level_address_t source; + VasEBoot_net_network_level_address_t dest; - if (nb->tail - nb->data < (grub_ssize_t) sizeof (*iph)) + if (nb->tail - nb->data < (VasEBoot_ssize_t) sizeof (*iph)) { - grub_dprintf ("net", "IP packet too short: %" PRIdGRUB_SSIZE "\n", - (grub_ssize_t) (nb->tail - nb->data)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "IP packet too short: %" PRIdVasEBoot_SSIZE "\n", + (VasEBoot_ssize_t) (nb->tail - nb->data)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } - err = grub_netbuff_pull (nb, sizeof (*iph)); + err = VasEBoot_netbuff_pull (nb, sizeof (*iph)); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } /* Check size. */ { - grub_size_t expected_size = grub_be_to_cpu16 (iph->len); - grub_size_t actual_size = (nb->tail - nb->data); + VasEBoot_size_t expected_size = VasEBoot_be_to_cpu16 (iph->len); + VasEBoot_size_t actual_size = (nb->tail - nb->data); if (actual_size > expected_size) { - err = grub_netbuff_unput (nb, actual_size - expected_size); + err = VasEBoot_netbuff_unput (nb, actual_size - expected_size); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } } if (actual_size < expected_size) { - grub_dprintf ("net", "Cut IP packet actual: %" PRIuGRUB_SIZE - ", expected %" PRIuGRUB_SIZE "\n", actual_size, + VasEBoot_dprintf ("net", "Cut IP packet actual: %" PRIuVasEBoot_SIZE + ", expected %" PRIuVasEBoot_SIZE "\n", actual_size, expected_size); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } } - source.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - dest.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - grub_memcpy (source.ipv6, &iph->src, sizeof (source.ipv6)); - grub_memcpy (dest.ipv6, &iph->dest, sizeof (dest.ipv6)); + source.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + dest.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + VasEBoot_memcpy (source.ipv6, &iph->src, sizeof (source.ipv6)); + VasEBoot_memcpy (dest.ipv6, &iph->dest, sizeof (dest.ipv6)); return handle_dgram (nb, card, src_hwaddress, hwaddress, iph->protocol, &source, &dest, iph->ttl); } -grub_err_t -grub_net_recv_ip_packets (struct grub_net_buff *nb, - struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddress, - const grub_net_link_level_address_t *src_hwaddress) +VasEBoot_err_t +VasEBoot_net_recv_ip_packets (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddress, + const VasEBoot_net_link_level_address_t *src_hwaddress) { struct iphdr *iph = (struct iphdr *) nb->data; if ((iph->verhdrlen >> 4) == 4) - return grub_net_recv_ip4_packets (nb, card, hwaddress, src_hwaddress); + return VasEBoot_net_recv_ip4_packets (nb, card, hwaddress, src_hwaddress); if ((iph->verhdrlen >> 4) == 6) - return grub_net_recv_ip6_packets (nb, card, hwaddress, src_hwaddress); - grub_dprintf ("net", "Bad IP version: %d\n", (iph->verhdrlen >> 4)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + return VasEBoot_net_recv_ip6_packets (nb, card, hwaddress, src_hwaddress); + VasEBoot_dprintf ("net", "Bad IP version: %d\n", (iph->verhdrlen >> 4)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/net/net.c b/VasEBoot-core/net/net.c index 0a2cef7e4..e149ba6a7 100644 --- a/VasEBoot-core/net/net.c +++ b/VasEBoot-core/net/net.c @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -char *grub_net_default_server; +char *VasEBoot_net_default_server; -struct grub_net_route *grub_net_routes = NULL; -struct grub_net_network_level_interface *grub_net_network_level_interfaces = NULL; -struct grub_net_card *grub_net_cards = NULL; -struct grub_net_network_level_protocol *grub_net_network_level_protocols = NULL; -static struct grub_fs grub_net_fs; +struct VasEBoot_net_route *VasEBoot_net_routes = NULL; +struct VasEBoot_net_network_level_interface *VasEBoot_net_network_level_interfaces = NULL; +struct VasEBoot_net_card *VasEBoot_net_cards = NULL; +struct VasEBoot_net_network_level_protocol *VasEBoot_net_network_level_protocols = NULL; +static struct VasEBoot_fs VasEBoot_net_fs; -struct grub_net_link_layer_entry { +struct VasEBoot_net_link_layer_entry { int avail; - grub_net_network_level_address_t nl_address; - grub_net_link_level_address_t ll_address; + VasEBoot_net_network_level_address_t nl_address; + VasEBoot_net_link_level_address_t ll_address; }; #define LINK_LAYER_CACHE_SIZE 256 -static struct grub_net_link_layer_entry * -link_layer_find_entry (const grub_net_network_level_address_t *proto, - const struct grub_net_card *card) +static struct VasEBoot_net_link_layer_entry * +link_layer_find_entry (const VasEBoot_net_network_level_address_t *proto, + const struct VasEBoot_net_card *card) { unsigned i; if (!card->link_layer_table) @@ -61,7 +61,7 @@ link_layer_find_entry (const grub_net_network_level_address_t *proto, for (i = 0; i < LINK_LAYER_CACHE_SIZE; i++) { if (card->link_layer_table[i].avail == 1 - && grub_net_addr_cmp (&card->link_layer_table[i].nl_address, + && VasEBoot_net_addr_cmp (&card->link_layer_table[i].nl_address, proto) == 0) return &card->link_layer_table[i]; } @@ -69,41 +69,41 @@ link_layer_find_entry (const grub_net_network_level_address_t *proto, } void -grub_net_link_layer_add_address (struct grub_net_card *card, - const grub_net_network_level_address_t *nl, - const grub_net_link_level_address_t *ll, +VasEBoot_net_link_layer_add_address (struct VasEBoot_net_card *card, + const VasEBoot_net_network_level_address_t *nl, + const VasEBoot_net_link_level_address_t *ll, int override) { - struct grub_net_link_layer_entry *entry; + struct VasEBoot_net_link_layer_entry *entry; /* Check if the sender is in the cache table. */ entry = link_layer_find_entry (nl, card); /* Update sender hardware address. */ if (entry && override) - grub_memcpy (&entry->ll_address, ll, sizeof (entry->ll_address)); + VasEBoot_memcpy (&entry->ll_address, ll, sizeof (entry->ll_address)); if (entry) return; /* Add sender to cache table. */ if (card->link_layer_table == NULL) - card->link_layer_table = grub_zalloc (LINK_LAYER_CACHE_SIZE + card->link_layer_table = VasEBoot_zalloc (LINK_LAYER_CACHE_SIZE * sizeof (card->link_layer_table[0])); entry = &(card->link_layer_table[card->new_ll_entry]); entry->avail = 1; - grub_memcpy (&entry->ll_address, ll, sizeof (entry->ll_address)); - grub_memcpy (&entry->nl_address, nl, sizeof (entry->nl_address)); + VasEBoot_memcpy (&entry->ll_address, ll, sizeof (entry->ll_address)); + VasEBoot_memcpy (&entry->nl_address, nl, sizeof (entry->nl_address)); card->new_ll_entry++; if (card->new_ll_entry == LINK_LAYER_CACHE_SIZE) card->new_ll_entry = 0; } int -grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr) +VasEBoot_net_link_layer_resolve_check (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr) { - struct grub_net_link_layer_entry *entry; + struct VasEBoot_net_link_layer_entry *entry; - if (proto_addr->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4 + if (proto_addr->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4 && proto_addr->ipv4 == 0xffffffff) return 1; entry = link_layer_find_entry (proto_addr, inf->card); @@ -112,38 +112,38 @@ grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf, return 0; } -grub_err_t -grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr, - grub_net_link_level_address_t *hw_addr) +VasEBoot_err_t +VasEBoot_net_link_layer_resolve (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr, + VasEBoot_net_link_level_address_t *hw_addr) { - struct grub_net_link_layer_entry *entry; - grub_err_t err; + struct VasEBoot_net_link_layer_entry *entry; + VasEBoot_err_t err; - if ((proto_addr->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4 + if ((proto_addr->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4 && proto_addr->ipv4 == 0xffffffff) - || proto_addr->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV - || (proto_addr->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && proto_addr->ipv6[0] == grub_be_to_cpu64_compile_time (0xff02ULL + || proto_addr->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV + || (proto_addr->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && proto_addr->ipv6[0] == VasEBoot_be_to_cpu64_compile_time (0xff02ULL << 48) - && proto_addr->ipv6[1] == (grub_be_to_cpu64_compile_time (1)))) + && proto_addr->ipv6[1] == (VasEBoot_be_to_cpu64_compile_time (1)))) { - hw_addr->type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; - grub_memset (hw_addr->mac, -1, 6); - return GRUB_ERR_NONE; + hw_addr->type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + VasEBoot_memset (hw_addr->mac, -1, 6); + return VasEBoot_ERR_NONE; } - if (proto_addr->type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 - && ((grub_be_to_cpu64 (proto_addr->ipv6[0]) >> 56) == 0xff)) + if (proto_addr->type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && ((VasEBoot_be_to_cpu64 (proto_addr->ipv6[0]) >> 56) == 0xff)) { - hw_addr->type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; + hw_addr->type = VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET; hw_addr->mac[0] = 0x33; hw_addr->mac[1] = 0x33; - hw_addr->mac[2] = ((grub_be_to_cpu64 (proto_addr->ipv6[1]) >> 24) & 0xff); - hw_addr->mac[3] = ((grub_be_to_cpu64 (proto_addr->ipv6[1]) >> 16) & 0xff); - hw_addr->mac[4] = ((grub_be_to_cpu64 (proto_addr->ipv6[1]) >> 8) & 0xff); - hw_addr->mac[5] = ((grub_be_to_cpu64 (proto_addr->ipv6[1]) >> 0) & 0xff); - return GRUB_ERR_NONE; + hw_addr->mac[2] = ((VasEBoot_be_to_cpu64 (proto_addr->ipv6[1]) >> 24) & 0xff); + hw_addr->mac[3] = ((VasEBoot_be_to_cpu64 (proto_addr->ipv6[1]) >> 16) & 0xff); + hw_addr->mac[4] = ((VasEBoot_be_to_cpu64 (proto_addr->ipv6[1]) >> 8) & 0xff); + hw_addr->mac[5] = ((VasEBoot_be_to_cpu64 (proto_addr->ipv6[1]) >> 0) & 0xff); + return VasEBoot_ERR_NONE; } /* Check cache table. */ @@ -151,20 +151,20 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, if (entry) { *hw_addr = entry->ll_address; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } switch (proto_addr->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: - err = grub_net_arp_send_request (inf, proto_addr); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + err = VasEBoot_net_arp_send_request (inf, proto_addr); break; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: - err = grub_net_icmp6_send_request (inf, proto_addr); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + err = VasEBoot_net_icmp6_send_request (inf, proto_addr); break; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: - return grub_error (GRUB_ERR_BUG, "shouldn't reach here"); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + return VasEBoot_error (VasEBoot_ERR_BUG, "shouldn't reach here"); default: - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "unsupported address type %d", proto_addr->type); } if (err) @@ -173,192 +173,192 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, if (entry) { *hw_addr = entry->ll_address; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_TIMEOUT, + return VasEBoot_error (VasEBoot_ERR_TIMEOUT, N_("timeout: could not resolve hardware address")); } void -grub_net_card_unregister (struct grub_net_card *card) +VasEBoot_net_card_unregister (struct VasEBoot_net_card *card) { - struct grub_net_network_level_interface *inf, *next; + struct VasEBoot_net_network_level_interface *inf, *next; FOR_NET_NETWORK_LEVEL_INTERFACES_SAFE(inf, next) if (inf->card == card) - grub_net_network_level_interface_unregister (inf); + VasEBoot_net_network_level_interface_unregister (inf); if (card->opened) { if (card->driver->close) card->driver->close (card); card->opened = 0; } - grub_list_remove (GRUB_AS_LIST (card)); + VasEBoot_list_remove (VasEBoot_AS_LIST (card)); } -static struct grub_net_slaac_mac_list * -grub_net_ipv6_get_slaac (struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddr) +static struct VasEBoot_net_slaac_mac_list * +VasEBoot_net_ipv6_get_slaac (struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddr) { - struct grub_net_slaac_mac_list *slaac; + struct VasEBoot_net_slaac_mac_list *slaac; char *ptr; for (slaac = card->slaac_list; slaac; slaac = slaac->next) - if (grub_net_hwaddr_cmp (&slaac->address, hwaddr) == 0) + if (VasEBoot_net_hwaddr_cmp (&slaac->address, hwaddr) == 0) return slaac; - slaac = grub_zalloc (sizeof (*slaac)); + slaac = VasEBoot_zalloc (sizeof (*slaac)); if (!slaac) return NULL; - slaac->name = grub_malloc (grub_strlen (card->name) - + GRUB_NET_MAX_STR_HWADDR_LEN + slaac->name = VasEBoot_malloc (VasEBoot_strlen (card->name) + + VasEBoot_NET_MAX_STR_HWADDR_LEN + sizeof (":slaac")); - ptr = grub_stpcpy (slaac->name, card->name); - if (grub_net_hwaddr_cmp (&card->default_address, hwaddr) != 0) + ptr = VasEBoot_stpcpy (slaac->name, card->name); + if (VasEBoot_net_hwaddr_cmp (&card->default_address, hwaddr) != 0) { - ptr = grub_stpcpy (ptr, ":"); - grub_net_hwaddr_to_str (hwaddr, ptr); - ptr += grub_strlen (ptr); + ptr = VasEBoot_stpcpy (ptr, ":"); + VasEBoot_net_hwaddr_to_str (hwaddr, ptr); + ptr += VasEBoot_strlen (ptr); } - ptr = grub_stpcpy (ptr, ":slaac"); + ptr = VasEBoot_stpcpy (ptr, ":slaac"); - grub_memcpy (&slaac->address, hwaddr, sizeof (slaac->address)); + VasEBoot_memcpy (&slaac->address, hwaddr, sizeof (slaac->address)); slaac->next = card->slaac_list; card->slaac_list = slaac; return slaac; } static void -grub_net_network_level_interface_register (struct grub_net_network_level_interface *inter); +VasEBoot_net_network_level_interface_register (struct VasEBoot_net_network_level_interface *inter); -static struct grub_net_network_level_interface * -grub_net_add_addr_real (char *name, - struct grub_net_card *card, - const grub_net_network_level_address_t *addr, - const grub_net_link_level_address_t *hwaddress, - grub_net_interface_flags_t flags) +static struct VasEBoot_net_network_level_interface * +VasEBoot_net_add_addr_real (char *name, + struct VasEBoot_net_card *card, + const VasEBoot_net_network_level_address_t *addr, + const VasEBoot_net_link_level_address_t *hwaddress, + VasEBoot_net_interface_flags_t flags) { - struct grub_net_network_level_interface *inter; + struct VasEBoot_net_network_level_interface *inter; - inter = grub_zalloc (sizeof (*inter)); + inter = VasEBoot_zalloc (sizeof (*inter)); if (!inter) return NULL; inter->name = name; - grub_memcpy (&(inter->address), addr, sizeof (inter->address)); - grub_memcpy (&(inter->hwaddress), hwaddress, sizeof (inter->hwaddress)); + VasEBoot_memcpy (&(inter->address), addr, sizeof (inter->address)); + VasEBoot_memcpy (&(inter->hwaddress), hwaddress, sizeof (inter->hwaddress)); inter->flags = flags; inter->card = card; inter->dhcp_ack = NULL; inter->dhcp_acklen = 0; - grub_net_network_level_interface_register (inter); + VasEBoot_net_network_level_interface_register (inter); return inter; } -struct grub_net_network_level_interface * -grub_net_add_addr (const char *name, - struct grub_net_card *card, - const grub_net_network_level_address_t *addr, - const grub_net_link_level_address_t *hwaddress, - grub_net_interface_flags_t flags) +struct VasEBoot_net_network_level_interface * +VasEBoot_net_add_addr (const char *name, + struct VasEBoot_net_card *card, + const VasEBoot_net_network_level_address_t *addr, + const VasEBoot_net_link_level_address_t *hwaddress, + VasEBoot_net_interface_flags_t flags) { - char *name_dup = grub_strdup (name); - struct grub_net_network_level_interface *ret; + char *name_dup = VasEBoot_strdup (name); + struct VasEBoot_net_network_level_interface *ret; if (!name_dup) return NULL; - ret = grub_net_add_addr_real (name_dup, card, addr, hwaddress, flags); + ret = VasEBoot_net_add_addr_real (name_dup, card, addr, hwaddress, flags); if (!ret) - grub_free (name_dup); + VasEBoot_free (name_dup); return ret; } -struct grub_net_network_level_interface * -grub_net_ipv6_get_link_local (struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddr) +struct VasEBoot_net_network_level_interface * +VasEBoot_net_ipv6_get_link_local (struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddr) { - struct grub_net_network_level_interface *inf; + struct VasEBoot_net_network_level_interface *inf; char *name; char *ptr; - grub_net_network_level_address_t addr; + VasEBoot_net_network_level_address_t addr; - addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - addr.ipv6[0] = grub_cpu_to_be64_compile_time (0xfe80ULL << 48); - addr.ipv6[1] = grub_net_ipv6_get_id (hwaddr); + addr.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + addr.ipv6[0] = VasEBoot_cpu_to_be64_compile_time (0xfe80ULL << 48); + addr.ipv6[1] = VasEBoot_net_ipv6_get_id (hwaddr); FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { if (inf->card == card - && grub_net_hwaddr_cmp (&inf->hwaddress, hwaddr) == 0 - && grub_net_addr_cmp (&inf->address, &addr) == 0) + && VasEBoot_net_hwaddr_cmp (&inf->hwaddress, hwaddr) == 0 + && VasEBoot_net_addr_cmp (&inf->address, &addr) == 0) return inf; } - name = grub_malloc (grub_strlen (card->name) - + GRUB_NET_MAX_STR_HWADDR_LEN + name = VasEBoot_malloc (VasEBoot_strlen (card->name) + + VasEBoot_NET_MAX_STR_HWADDR_LEN + sizeof (":link")); if (!name) return NULL; - ptr = grub_stpcpy (name, card->name); - if (grub_net_hwaddr_cmp (&card->default_address, hwaddr) != 0) + ptr = VasEBoot_stpcpy (name, card->name); + if (VasEBoot_net_hwaddr_cmp (&card->default_address, hwaddr) != 0) { - ptr = grub_stpcpy (ptr, ":"); - grub_net_hwaddr_to_str (hwaddr, ptr); - ptr += grub_strlen (ptr); + ptr = VasEBoot_stpcpy (ptr, ":"); + VasEBoot_net_hwaddr_to_str (hwaddr, ptr); + ptr += VasEBoot_strlen (ptr); } - ptr = grub_stpcpy (ptr, ":link"); - return grub_net_add_addr_real (name, card, &addr, hwaddr, 0); + ptr = VasEBoot_stpcpy (ptr, ":link"); + return VasEBoot_net_add_addr_real (name, card, &addr, hwaddr, 0); } /* FIXME: allow to specify mac address. */ -static grub_err_t -grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_ipv6_autoconf (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_net_card *card; - struct grub_net_network_level_interface **ifaces; - grub_size_t ncards = 0; + struct VasEBoot_net_card *card; + struct VasEBoot_net_network_level_interface **ifaces; + VasEBoot_size_t ncards = 0; unsigned j = 0; int interval; - grub_err_t err; - struct grub_net_slaac_mac_list **slaacs; + VasEBoot_err_t err; + struct VasEBoot_net_slaac_mac_list **slaacs; FOR_NET_CARDS (card) { - if (argc > 0 && grub_strcmp (card->name, args[0]) != 0) + if (argc > 0 && VasEBoot_strcmp (card->name, args[0]) != 0) continue; ncards++; } - ifaces = grub_zalloc (ncards * sizeof (ifaces[0])); - slaacs = grub_zalloc (ncards * sizeof (slaacs[0])); + ifaces = VasEBoot_zalloc (ncards * sizeof (ifaces[0])); + slaacs = VasEBoot_zalloc (ncards * sizeof (slaacs[0])); if (!ifaces || !slaacs) { - grub_free (ifaces); - grub_free (slaacs); - return grub_errno; + VasEBoot_free (ifaces); + VasEBoot_free (slaacs); + return VasEBoot_errno; } FOR_NET_CARDS (card) { - if (argc > 0 && grub_strcmp (card->name, args[0]) != 0) + if (argc > 0 && VasEBoot_strcmp (card->name, args[0]) != 0) continue; - ifaces[j] = grub_net_ipv6_get_link_local (card, &card->default_address); + ifaces[j] = VasEBoot_net_ipv6_get_link_local (card, &card->default_address); if (!ifaces[j]) { - grub_free (ifaces); - grub_free (slaacs); - return grub_errno; + VasEBoot_free (ifaces); + VasEBoot_free (slaacs); + return VasEBoot_errno; } - slaacs[j] = grub_net_ipv6_get_slaac (card, &card->default_address); + slaacs[j] = VasEBoot_net_ipv6_get_slaac (card, &card->default_address); if (!slaacs[j]) { - grub_free (ifaces); - grub_free (slaacs); - return grub_errno; + VasEBoot_free (ifaces); + VasEBoot_free (slaacs); + return VasEBoot_errno; } j++; } @@ -370,46 +370,46 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), { if (slaacs[j]->slaac_counter) continue; - err = grub_net_icmp6_send_router_solicit (ifaces[j]); + err = VasEBoot_net_icmp6_send_router_solicit (ifaces[j]); if (err) - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; done = 0; } if (done) break; - grub_net_poll_cards (interval, 0); + VasEBoot_net_poll_cards (interval, 0); } - err = GRUB_ERR_NONE; + err = VasEBoot_ERR_NONE; for (j = 0; j < ncards; j++) { if (slaacs[j]->slaac_counter) continue; - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, + err = VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("couldn't autoconfigure %s"), ifaces[j]->card->name); } - grub_free (ifaces); - grub_free (slaacs); + VasEBoot_free (ifaces); + VasEBoot_free (slaacs); return err; } static int -parse_ip (const char *val, grub_uint32_t *ip, const char **rest) +parse_ip (const char *val, VasEBoot_uint32_t *ip, const char **rest) { - grub_uint32_t newip = 0; + VasEBoot_uint32_t newip = 0; int i; const char *ptr = val; for (i = 0; i < 4; i++) { unsigned long t; - t = grub_strtoul (ptr, (char **) &ptr, 0); - if (grub_errno) + t = VasEBoot_strtoul (ptr, (char **) &ptr, 0); + if (VasEBoot_errno) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } if (*ptr != '.' && i == 0) @@ -425,16 +425,16 @@ parse_ip (const char *val, grub_uint32_t *ip, const char **rest) return 0; ptr++; } - *ip = grub_cpu_to_le32 (newip); + *ip = VasEBoot_cpu_to_le32 (newip); if (rest) *rest = (ptr - 1); return 1; } static int -parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) +parse_ip6 (const char *val, VasEBoot_uint64_t *ip, const char **rest) { - grub_uint16_t newip[8]; + VasEBoot_uint16_t newip[8]; const char *ptr = val; int word, quaddot = -1; @@ -453,15 +453,15 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) ptr++; continue; } - t = grub_strtoul (ptr, (char **) &ptr, 16); - if (grub_errno) + t = VasEBoot_strtoul (ptr, (char **) &ptr, 16); + if (VasEBoot_errno) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; break; } if (t & ~0xffff) return 0; - newip[word] = grub_cpu_to_be16 (t); + newip[word] = VasEBoot_cpu_to_be16 (t); if (*ptr != ':') break; ptr++; @@ -470,37 +470,37 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) return 0; if (quaddot != -1) { - grub_memmove (&newip[quaddot + 7 - word], &newip[quaddot], + VasEBoot_memmove (&newip[quaddot + 7 - word], &newip[quaddot], (word - quaddot + 1) * sizeof (newip[0])); - grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); + VasEBoot_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); } - grub_memcpy (ip, newip, 16); + VasEBoot_memcpy (ip, newip, 16); if (rest) *rest = ptr; return 1; } static int -match_net (const grub_net_network_level_netaddress_t *net, - const grub_net_network_level_address_t *addr) +match_net (const VasEBoot_net_network_level_netaddress_t *net, + const VasEBoot_net_network_level_address_t *addr) { if (net->type != addr->type) return 0; switch (net->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: return 0; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: { - grub_uint32_t mask = (0xffffffffU << (32 - net->ipv4.masksize)); + VasEBoot_uint32_t mask = (0xffffffffU << (32 - net->ipv4.masksize)); if (net->ipv4.masksize == 0) mask = 0; - return ((grub_be_to_cpu32 (net->ipv4.base) & mask) - == (grub_be_to_cpu32 (addr->ipv4) & mask)); + return ((VasEBoot_be_to_cpu32 (net->ipv4.base) & mask) + == (VasEBoot_be_to_cpu32 (addr->ipv4) & mask)); } - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: { - grub_uint64_t mask[2]; + VasEBoot_uint64_t mask[2]; if (net->ipv6.masksize == 0) return 1; if (net->ipv6.masksize <= 64) @@ -513,90 +513,90 @@ match_net (const grub_net_network_level_netaddress_t *net, mask[0] = 0xffffffffffffffffULL; mask[1] = 0xffffffffffffffffULL << (128 - net->ipv6.masksize); } - return (((grub_be_to_cpu64 (net->ipv6.base[0]) & mask[0]) - == (grub_be_to_cpu64 (addr->ipv6[0]) & mask[0])) - && ((grub_be_to_cpu64 (net->ipv6.base[1]) & mask[1]) - == (grub_be_to_cpu64 (addr->ipv6[1]) & mask[1]))); + return (((VasEBoot_be_to_cpu64 (net->ipv6.base[0]) & mask[0]) + == (VasEBoot_be_to_cpu64 (addr->ipv6[0]) & mask[0])) + && ((VasEBoot_be_to_cpu64 (net->ipv6.base[1]) & mask[1]) + == (VasEBoot_be_to_cpu64 (addr->ipv6[1]) & mask[1]))); } } return 0; } -grub_err_t -grub_net_resolve_address (const char *name, - grub_net_network_level_address_t *addr) +VasEBoot_err_t +VasEBoot_net_resolve_address (const char *name, + VasEBoot_net_network_level_address_t *addr) { const char *rest; - grub_err_t err; - grub_size_t naddresses; - struct grub_net_network_level_address *addresses = 0; + VasEBoot_err_t err; + VasEBoot_size_t naddresses; + struct VasEBoot_net_network_level_address *addresses = 0; if (parse_ip (name, &addr->ipv4, &rest) && *rest == 0) { - addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - return GRUB_ERR_NONE; + addr->type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + return VasEBoot_ERR_NONE; } if (parse_ip6 (name, addr->ipv6, &rest) && *rest == 0) { - addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - return GRUB_ERR_NONE; + addr->type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + return VasEBoot_ERR_NONE; } - err = grub_net_dns_lookup (name, 0, 0, &naddresses, &addresses, 1); + err = VasEBoot_net_dns_lookup (name, 0, 0, &naddresses, &addresses, 1); if (err) return err; if (!naddresses) - grub_error (GRUB_ERR_NET_BAD_ADDRESS, N_("unresolvable address %s"), + VasEBoot_error (VasEBoot_ERR_NET_BAD_ADDRESS, N_("unresolvable address %s"), name); /* FIXME: use other results as well. */ *addr = addresses[0]; - grub_free (addresses); - return GRUB_ERR_NONE; + VasEBoot_free (addresses); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_net_resolve_net_address (const char *name, - grub_net_network_level_netaddress_t *addr) +VasEBoot_err_t +VasEBoot_net_resolve_net_address (const char *name, + VasEBoot_net_network_level_netaddress_t *addr) { const char *rest; if (parse_ip (name, &addr->ipv4.base, &rest)) { - addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + addr->type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; if (*rest == '/') { - addr->ipv4.masksize = grub_strtoul (rest + 1, (char **) &rest, 0); - if (!grub_errno && *rest == 0) - return GRUB_ERR_NONE; - grub_errno = GRUB_ERR_NONE; + addr->ipv4.masksize = VasEBoot_strtoul (rest + 1, (char **) &rest, 0); + if (!VasEBoot_errno && *rest == 0) + return VasEBoot_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } else if (*rest == 0) { addr->ipv4.masksize = 32; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } if (parse_ip6 (name, addr->ipv6.base, &rest)) { - addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + addr->type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; if (*rest == '/') { - addr->ipv6.masksize = grub_strtoul (rest + 1, (char **) &rest, 0); - if (!grub_errno && *rest == 0) - return GRUB_ERR_NONE; - grub_errno = GRUB_ERR_NONE; + addr->ipv6.masksize = VasEBoot_strtoul (rest + 1, (char **) &rest, 0); + if (!VasEBoot_errno && *rest == 0) + return VasEBoot_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } else if (*rest == 0) { addr->ipv6.masksize = 128; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } - return grub_error (GRUB_ERR_NET_BAD_ADDRESS, + return VasEBoot_error (VasEBoot_ERR_NET_BAD_ADDRESS, N_("unrecognised network address `%s'"), name); } static int -route_cmp (const struct grub_net_route *a, const struct grub_net_route *b) +route_cmp (const struct VasEBoot_net_route *a, const struct VasEBoot_net_route *b) { if (a == NULL && b == NULL) return 0; @@ -610,15 +610,15 @@ route_cmp (const struct grub_net_route *a, const struct grub_net_route *b) return +1; switch (a->target.type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: break; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: if (a->target.ipv6.masksize > b->target.ipv6.masksize) return +1; if (a->target.ipv6.masksize < b->target.ipv6.masksize) return -1; break; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: if (a->target.ipv4.masksize > b->target.ipv4.masksize) return +1; if (a->target.ipv4.masksize < b->target.ipv4.masksize) @@ -628,25 +628,25 @@ route_cmp (const struct grub_net_route *a, const struct grub_net_route *b) return 0; } -grub_err_t -grub_net_route_address (grub_net_network_level_address_t addr, - grub_net_network_level_address_t *gateway, - struct grub_net_network_level_interface **interf) +VasEBoot_err_t +VasEBoot_net_route_address (VasEBoot_net_network_level_address_t addr, + VasEBoot_net_network_level_address_t *gateway, + struct VasEBoot_net_network_level_interface **interf) { - struct grub_net_route *route; + struct VasEBoot_net_route *route; unsigned int depth = 0; unsigned int routecnt = 0; - struct grub_net_network_level_protocol *prot = NULL; - grub_net_network_level_address_t curtarget = addr; + struct VasEBoot_net_network_level_protocol *prot = NULL; + VasEBoot_net_network_level_address_t curtarget = addr; *gateway = addr; FOR_NET_ROUTES(route) routecnt++; - for (depth = 0; depth < routecnt + 2 && depth < GRUB_UINT_MAX; depth++) + for (depth = 0; depth < routecnt + 2 && depth < VasEBoot_UINT_MAX; depth++) { - struct grub_net_route *bestroute = NULL; + struct VasEBoot_net_route *bestroute = NULL; FOR_NET_ROUTES(route) { if (depth && prot != route->prot) @@ -657,13 +657,13 @@ grub_net_route_address (grub_net_network_level_address_t addr, bestroute = route; } if (bestroute == NULL) - return grub_error (GRUB_ERR_NET_NO_ROUTE, + return VasEBoot_error (VasEBoot_ERR_NET_NO_ROUTE, N_("destination unreachable")); if (!bestroute->is_gateway) { *interf = bestroute->interface; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (depth == 0) { @@ -671,114 +671,114 @@ grub_net_route_address (grub_net_network_level_address_t addr, if (bestroute->interface != NULL) { *interf = bestroute->interface; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } curtarget = bestroute->gw; } - return grub_error (GRUB_ERR_NET_ROUTE_LOOP, + return VasEBoot_error (VasEBoot_ERR_NET_ROUTE_LOOP, /* TRANSLATORS: route loop is a condition when e.g. to contact server A you need to go through B and to contact B you need to go through A. */ N_("route loop detected")); } -static grub_err_t -grub_cmd_deladdr (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_deladdr (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_net_network_level_interface *inter; + struct VasEBoot_net_network_level_interface *inter; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); FOR_NET_NETWORK_LEVEL_INTERFACES (inter) - if (grub_strcmp (inter->name, args[0]) == 0) + if (VasEBoot_strcmp (inter->name, args[0]) == 0) break; if (inter == NULL) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("address not found")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("address not found")); - if (inter->flags & GRUB_NET_INTERFACE_PERMANENT) - return grub_error (GRUB_ERR_IO, + if (inter->flags & VasEBoot_NET_INTERFACE_PERMANENT) + return VasEBoot_error (VasEBoot_ERR_IO, N_("you can't delete this address")); - grub_net_network_level_interface_unregister (inter); - grub_free (inter->name); - grub_free (inter); + VasEBoot_net_network_level_interface_unregister (inter); + VasEBoot_free (inter->name); + VasEBoot_free (inter); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_net_addr_to_str (const grub_net_network_level_address_t *target, char *buf) +VasEBoot_net_addr_to_str (const VasEBoot_net_network_level_address_t *target, char *buf) { switch (target->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: - COMPILE_TIME_ASSERT (sizeof ("temporary") < GRUB_NET_MAX_STR_ADDR_LEN); - grub_strcpy (buf, "temporary"); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + COMPILE_TIME_ASSERT (sizeof ("temporary") < VasEBoot_NET_MAX_STR_ADDR_LEN); + VasEBoot_strcpy (buf, "temporary"); return; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: { char *ptr = buf; - grub_uint64_t n = grub_be_to_cpu64 (target->ipv6[0]); + VasEBoot_uint64_t n = VasEBoot_be_to_cpu64 (target->ipv6[0]); int i; for (i = 0; i < 4; i++) { - grub_snprintf (ptr, 6, "%" PRIxGRUB_UINT64_T ":", + VasEBoot_snprintf (ptr, 6, "%" PRIxVasEBoot_UINT64_T ":", (n >> (48 - 16 * i)) & 0xffff); - ptr += grub_strlen (ptr); + ptr += VasEBoot_strlen (ptr); } - n = grub_be_to_cpu64 (target->ipv6[1]); + n = VasEBoot_be_to_cpu64 (target->ipv6[1]); for (i = 0; i < 3; i++) { - grub_snprintf (ptr, 6, "%" PRIxGRUB_UINT64_T ":", + VasEBoot_snprintf (ptr, 6, "%" PRIxVasEBoot_UINT64_T ":", (n >> (48 - 16 * i)) & 0xffff); - ptr += grub_strlen (ptr); + ptr += VasEBoot_strlen (ptr); } - grub_snprintf (ptr, 5, "%" PRIxGRUB_UINT64_T, n & 0xffff); + VasEBoot_snprintf (ptr, 5, "%" PRIxVasEBoot_UINT64_T, n & 0xffff); return; } - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: { - grub_uint32_t n = grub_be_to_cpu32 (target->ipv4); - grub_snprintf (buf, GRUB_NET_MAX_STR_ADDR_LEN, "%d.%d.%d.%d", + VasEBoot_uint32_t n = VasEBoot_be_to_cpu32 (target->ipv4); + VasEBoot_snprintf (buf, VasEBoot_NET_MAX_STR_ADDR_LEN, "%d.%d.%d.%d", ((n >> 24) & 0xff), ((n >> 16) & 0xff), ((n >> 8) & 0xff), ((n >> 0) & 0xff)); } return; } - grub_snprintf (buf, GRUB_NET_MAX_STR_ADDR_LEN, + VasEBoot_snprintf (buf, VasEBoot_NET_MAX_STR_ADDR_LEN, "Unknown address type %d", target->type); } void -grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) +VasEBoot_net_hwaddr_to_str (const VasEBoot_net_link_level_address_t *addr, char *str) { str[0] = 0; switch (addr->type) { - case GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET: + case VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET: { char *ptr; unsigned i; for (ptr = str, i = 0; i < ARRAY_SIZE (addr->mac); i++) { - grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str), + VasEBoot_snprintf (ptr, VasEBoot_NET_MAX_STR_HWADDR_LEN - (ptr - str), "%02x:", addr->mac[i] & 0xff); ptr += (sizeof ("XX:") - 1); } return; } } - grub_printf (_("Unsupported hw address type %d\n"), addr->type); + VasEBoot_printf (_("Unsupported hw address type %d\n"), addr->type); } int -grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a, - const grub_net_link_level_address_t *b) +VasEBoot_net_hwaddr_cmp (const VasEBoot_net_link_level_address_t *a, + const VasEBoot_net_link_level_address_t *b) { if (a->type < b->type) return -1; @@ -786,16 +786,16 @@ grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a, return +1; switch (a->type) { - case GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET: - return grub_memcmp (a->mac, b->mac, sizeof (a->mac)); + case VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET: + return VasEBoot_memcmp (a->mac, b->mac, sizeof (a->mac)); } - grub_printf (_("Unsupported hw address type %d\n"), a->type); + VasEBoot_printf (_("Unsupported hw address type %d\n"), a->type); return 1; } int -grub_net_addr_cmp (const grub_net_network_level_address_t *a, - const grub_net_network_level_address_t *b) +VasEBoot_net_addr_cmp (const VasEBoot_net_network_level_address_t *a, + const VasEBoot_net_network_level_address_t *b) { if (a->type < b->type) return -1; @@ -803,20 +803,20 @@ grub_net_addr_cmp (const grub_net_network_level_address_t *a, return +1; switch (a->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: - return grub_memcmp (&a->ipv4, &b->ipv4, sizeof (a->ipv4)); - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: - return grub_memcmp (&a->ipv6, &b->ipv6, sizeof (a->ipv6)); - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + return VasEBoot_memcmp (&a->ipv4, &b->ipv4, sizeof (a->ipv4)); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + return VasEBoot_memcmp (&a->ipv6, &b->ipv6, sizeof (a->ipv6)); + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: return 0; } - grub_printf (_("Unsupported address type %d\n"), a->type); + VasEBoot_printf (_("Unsupported address type %d\n"), a->type); return 1; } /* FIXME: implement this. */ static char * -hwaddr_set_env (struct grub_env_var *var __attribute__ ((unused)), +hwaddr_set_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val __attribute__ ((unused))) { return NULL; @@ -824,149 +824,149 @@ hwaddr_set_env (struct grub_env_var *var __attribute__ ((unused)), /* FIXME: implement this. */ static char * -addr_set_env (struct grub_env_var *var __attribute__ ((unused)), +addr_set_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val __attribute__ ((unused))) { return NULL; } static char * -defserver_set_env (struct grub_env_var *var __attribute__ ((unused)), +defserver_set_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - grub_free (grub_net_default_server); - grub_net_default_server = grub_strdup (val); - return grub_strdup (val); + VasEBoot_free (VasEBoot_net_default_server); + VasEBoot_net_default_server = VasEBoot_strdup (val); + return VasEBoot_strdup (val); } static const char * -defserver_get_env (struct grub_env_var *var __attribute__ ((unused)), +defserver_get_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val __attribute__ ((unused))) { - return grub_net_default_server ? : ""; + return VasEBoot_net_default_server ? : ""; } static const char * -defip_get_env (struct grub_env_var *var __attribute__ ((unused)), +defip_get_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val __attribute__ ((unused))) { - const char *intf = grub_env_get ("net_default_interface"); + const char *intf = VasEBoot_env_get ("net_default_interface"); const char *ret = NULL; if (intf) { - char *buf = grub_xasprintf ("net_%s_ip", intf); + char *buf = VasEBoot_xasprintf ("net_%s_ip", intf); if (buf) - ret = grub_env_get (buf); - grub_free (buf); + ret = VasEBoot_env_get (buf); + VasEBoot_free (buf); } return ret; } static char * -defip_set_env (struct grub_env_var *var __attribute__ ((unused)), +defip_set_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - const char *intf = grub_env_get ("net_default_interface"); + const char *intf = VasEBoot_env_get ("net_default_interface"); if (intf) { - char *buf = grub_xasprintf ("net_%s_ip", intf); + char *buf = VasEBoot_xasprintf ("net_%s_ip", intf); if (buf) - grub_env_set (buf, val); - grub_free (buf); + VasEBoot_env_set (buf, val); + VasEBoot_free (buf); } return NULL; } static const char * -defmac_get_env (struct grub_env_var *var __attribute__ ((unused)), +defmac_get_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val __attribute__ ((unused))) { - const char *intf = grub_env_get ("net_default_interface"); + const char *intf = VasEBoot_env_get ("net_default_interface"); const char *ret = NULL; if (intf) { - char *buf = grub_xasprintf ("net_%s_mac", intf); + char *buf = VasEBoot_xasprintf ("net_%s_mac", intf); if (buf) - ret = grub_env_get (buf); - grub_free (buf); + ret = VasEBoot_env_get (buf); + VasEBoot_free (buf); } return ret; } static char * -defmac_set_env (struct grub_env_var *var __attribute__ ((unused)), +defmac_set_env (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - const char *intf = grub_env_get ("net_default_interface"); + const char *intf = VasEBoot_env_get ("net_default_interface"); if (intf) { - char *buf = grub_xasprintf ("net_%s_mac", intf); + char *buf = VasEBoot_xasprintf ("net_%s_mac", intf); if (buf) - grub_env_set (buf, val); - grub_free (buf); + VasEBoot_env_set (buf, val); + VasEBoot_free (buf); } return NULL; } static void -grub_net_network_level_interface_register (struct grub_net_network_level_interface *inter) +VasEBoot_net_network_level_interface_register (struct VasEBoot_net_network_level_interface *inter) { { - char buf[GRUB_NET_MAX_STR_HWADDR_LEN]; + char buf[VasEBoot_NET_MAX_STR_HWADDR_LEN]; char *name; char *ptr; - grub_net_hwaddr_to_str (&inter->hwaddress, buf); - name = grub_xasprintf ("net_%s_mac", inter->name); + VasEBoot_net_hwaddr_to_str (&inter->hwaddress, buf); + name = VasEBoot_xasprintf ("net_%s_mac", inter->name); if (!name) return; for (ptr = name; *ptr; ptr++) if (*ptr == ':') *ptr = '_'; - grub_env_set (name, buf); - grub_register_variable_hook (name, 0, hwaddr_set_env); - grub_env_export (name); - grub_free (name); + VasEBoot_env_set (name, buf); + VasEBoot_register_variable_hook (name, 0, hwaddr_set_env); + VasEBoot_env_export (name); + VasEBoot_free (name); } { - char buf[GRUB_NET_MAX_STR_ADDR_LEN]; + char buf[VasEBoot_NET_MAX_STR_ADDR_LEN]; char *name; char *ptr; - grub_net_addr_to_str (&inter->address, buf); - name = grub_xasprintf ("net_%s_ip", inter->name); + VasEBoot_net_addr_to_str (&inter->address, buf); + name = VasEBoot_xasprintf ("net_%s_ip", inter->name); if (!name) return; for (ptr = name; *ptr; ptr++) if (*ptr == ':') *ptr = '_'; - grub_env_set (name, buf); - grub_register_variable_hook (name, 0, addr_set_env); - grub_env_export (name); - grub_free (name); + VasEBoot_env_set (name, buf); + VasEBoot_register_variable_hook (name, 0, addr_set_env); + VasEBoot_env_export (name); + VasEBoot_free (name); } inter->card->num_ifaces++; - inter->prev = &grub_net_network_level_interfaces; - inter->next = grub_net_network_level_interfaces; + inter->prev = &VasEBoot_net_network_level_interfaces; + inter->next = VasEBoot_net_network_level_interfaces; if (inter->next) inter->next->prev = &inter->next; - grub_net_network_level_interfaces = inter; + VasEBoot_net_network_level_interfaces = inter; } -grub_err_t -grub_net_add_ipv4_local (struct grub_net_network_level_interface *inter, +VasEBoot_err_t +VasEBoot_net_add_ipv4_local (struct VasEBoot_net_network_level_interface *inter, int mask) { - grub_uint32_t ip_cpu; - struct grub_net_route *route; + VasEBoot_uint32_t ip_cpu; + struct VasEBoot_net_route *route; - if (inter->address.type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4) + if (inter->address.type != VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4) return 0; - ip_cpu = grub_be_to_cpu32 (inter->address.ipv4); + ip_cpu = VasEBoot_be_to_cpu32 (inter->address.ipv4); if (mask == -1) { @@ -980,135 +980,135 @@ grub_net_add_ipv4_local (struct grub_net_network_level_interface *inter, if (mask == -1) return 0; - route = grub_zalloc (sizeof (*route)); + route = VasEBoot_zalloc (sizeof (*route)); if (!route) - return grub_errno; + return VasEBoot_errno; - route->name = grub_xasprintf ("%s:local", inter->name); + route->name = VasEBoot_xasprintf ("%s:local", inter->name); if (!route->name) { - grub_free (route); - return grub_errno; + VasEBoot_free (route); + return VasEBoot_errno; } - route->target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - route->target.ipv4.base = grub_cpu_to_be32 (ip_cpu & (0xffffffff << (32 - mask))); + route->target.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + route->target.ipv4.base = VasEBoot_cpu_to_be32 (ip_cpu & (0xffffffff << (32 - mask))); route->target.ipv4.masksize = mask; route->is_gateway = 0; route->interface = inter; - grub_net_route_register (route); + VasEBoot_net_route_register (route); return 0; } /* FIXME: support MAC specifying. */ -static grub_err_t -grub_cmd_addaddr (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_addaddr (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_net_card *card; - grub_net_network_level_address_t addr; - grub_err_t err; - grub_net_interface_flags_t flags = 0; - struct grub_net_network_level_interface *inf; + struct VasEBoot_net_card *card; + VasEBoot_net_network_level_address_t addr; + VasEBoot_err_t err; + VasEBoot_net_interface_flags_t flags = 0; + struct VasEBoot_net_network_level_interface *inf; if (argc != 3) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("three arguments expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("three arguments expected")); FOR_NET_CARDS (card) - if (grub_strcmp (card->name, args[1]) == 0) + if (VasEBoot_strcmp (card->name, args[1]) == 0) break; if (card == NULL) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("card not found")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("card not found")); - err = grub_net_resolve_address (args[2], &addr); + err = VasEBoot_net_resolve_address (args[2], &addr); if (err) return err; - if (card->flags & GRUB_NET_CARD_NO_MANUAL_INTERFACES) - return grub_error (GRUB_ERR_IO, + if (card->flags & VasEBoot_NET_CARD_NO_MANUAL_INTERFACES) + return VasEBoot_error (VasEBoot_ERR_IO, "this card doesn't support address addition"); - if (card->flags & GRUB_NET_CARD_HWADDRESS_IMMUTABLE) - flags |= GRUB_NET_INTERFACE_HWADDRESS_IMMUTABLE; + if (card->flags & VasEBoot_NET_CARD_HWADDRESS_IMMUTABLE) + flags |= VasEBoot_NET_INTERFACE_HWADDRESS_IMMUTABLE; - inf = grub_net_add_addr (args[0], card, &addr, &card->default_address, + inf = VasEBoot_net_add_addr (args[0], card, &addr, &card->default_address, flags); if (inf) - grub_net_add_ipv4_local (inf, -1); + VasEBoot_net_add_ipv4_local (inf, -1); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_cmd_delroute (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_delroute (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - struct grub_net_route *route; - struct grub_net_route **prev; + struct VasEBoot_net_route *route; + struct VasEBoot_net_route **prev; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); - for (prev = &grub_net_routes, route = *prev; route; prev = &((*prev)->next), + for (prev = &VasEBoot_net_routes, route = *prev; route; prev = &((*prev)->next), route = *prev) - if (grub_strcmp (route->name, args[0]) == 0) + if (VasEBoot_strcmp (route->name, args[0]) == 0) { *prev = route->next; - grub_free (route->name); - grub_free (route); + VasEBoot_free (route->name); + VasEBoot_free (route); if (!*prev) break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_net_add_route (const char *name, - grub_net_network_level_netaddress_t target, - struct grub_net_network_level_interface *inter) +VasEBoot_err_t +VasEBoot_net_add_route (const char *name, + VasEBoot_net_network_level_netaddress_t target, + struct VasEBoot_net_network_level_interface *inter) { - struct grub_net_route *route; + struct VasEBoot_net_route *route; - route = grub_zalloc (sizeof (*route)); + route = VasEBoot_zalloc (sizeof (*route)); if (!route) - return grub_errno; + return VasEBoot_errno; - route->name = grub_strdup (name); + route->name = VasEBoot_strdup (name); if (!route->name) { - grub_free (route); - return grub_errno; + VasEBoot_free (route); + return VasEBoot_errno; } route->target = target; route->is_gateway = 0; route->interface = inter; - grub_net_route_register (route); + VasEBoot_net_route_register (route); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_net_add_route_gw (const char *name, - grub_net_network_level_netaddress_t target, - grub_net_network_level_address_t gw, - struct grub_net_network_level_interface *inter) +VasEBoot_err_t +VasEBoot_net_add_route_gw (const char *name, + VasEBoot_net_network_level_netaddress_t target, + VasEBoot_net_network_level_address_t gw, + struct VasEBoot_net_network_level_interface *inter) { - struct grub_net_route *route; + struct VasEBoot_net_route *route; - route = grub_zalloc (sizeof (*route)); + route = VasEBoot_zalloc (sizeof (*route)); if (!route) - return grub_errno; + return VasEBoot_errno; - route->name = grub_strdup (name); + route->name = VasEBoot_strdup (name); if (!route->name) { - grub_free (route); - return grub_errno; + VasEBoot_free (route); + return VasEBoot_errno; } route->target = target; @@ -1116,178 +1116,178 @@ grub_net_add_route_gw (const char *name, route->gw = gw; route->interface = inter; - grub_net_route_register (route); + VasEBoot_net_route_register (route); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_addroute (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_addroute (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - grub_net_network_level_netaddress_t target; + VasEBoot_net_network_level_netaddress_t target; if (argc < 3) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("three arguments expected")); - grub_net_resolve_net_address (args[1], &target); + VasEBoot_net_resolve_net_address (args[1], &target); - if (grub_strcmp (args[2], "gw") == 0 && argc >= 4) + if (VasEBoot_strcmp (args[2], "gw") == 0 && argc >= 4) { - grub_err_t err; - grub_net_network_level_address_t gw; + VasEBoot_err_t err; + VasEBoot_net_network_level_address_t gw; - err = grub_net_resolve_address (args[3], &gw); + err = VasEBoot_net_resolve_address (args[3], &gw); if (err) return err; - return grub_net_add_route_gw (args[0], target, gw, NULL); + return VasEBoot_net_add_route_gw (args[0], target, gw, NULL); } else { - struct grub_net_network_level_interface *inter; + struct VasEBoot_net_network_level_interface *inter; FOR_NET_NETWORK_LEVEL_INTERFACES (inter) - if (grub_strcmp (inter->name, args[2]) == 0) + if (VasEBoot_strcmp (inter->name, args[2]) == 0) break; if (!inter) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unrecognised network interface `%s'"), args[2]); - return grub_net_add_route (args[0], target, inter); + return VasEBoot_net_add_route (args[0], target, inter); } } static void -print_net_address (const grub_net_network_level_netaddress_t *target) +print_net_address (const VasEBoot_net_network_level_netaddress_t *target) { switch (target->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: /* TRANSLATORS: it refers to the network address. */ - grub_printf ("%s\n", _("temporary")); + VasEBoot_printf ("%s\n", _("temporary")); return; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: { - grub_uint32_t n = grub_be_to_cpu32 (target->ipv4.base); - grub_printf ("%d.%d.%d.%d/%d ", ((n >> 24) & 0xff), + VasEBoot_uint32_t n = VasEBoot_be_to_cpu32 (target->ipv4.base); + VasEBoot_printf ("%d.%d.%d.%d/%d ", ((n >> 24) & 0xff), ((n >> 16) & 0xff), ((n >> 8) & 0xff), ((n >> 0) & 0xff), target->ipv4.masksize); } return; - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: { - char buf[GRUB_NET_MAX_STR_ADDR_LEN]; - struct grub_net_network_level_address base; - base.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; - grub_memcpy (&base.ipv6, &target->ipv6, 16); - grub_net_addr_to_str (&base, buf); - grub_printf ("%s/%d ", buf, target->ipv6.masksize); + char buf[VasEBoot_NET_MAX_STR_ADDR_LEN]; + struct VasEBoot_net_network_level_address base; + base.type = VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + VasEBoot_memcpy (&base.ipv6, &target->ipv6, 16); + VasEBoot_net_addr_to_str (&base, buf); + VasEBoot_printf ("%s/%d ", buf, target->ipv6.masksize); } return; } - grub_printf (_("Unknown address type %d\n"), target->type); + VasEBoot_printf (_("Unknown address type %d\n"), target->type); } static void -print_address (const grub_net_network_level_address_t *target) +print_address (const VasEBoot_net_network_level_address_t *target) { - char buf[GRUB_NET_MAX_STR_ADDR_LEN]; - grub_net_addr_to_str (target, buf); - grub_xputs (buf); + char buf[VasEBoot_NET_MAX_STR_ADDR_LEN]; + VasEBoot_net_addr_to_str (target, buf); + VasEBoot_xputs (buf); } -static grub_err_t -grub_cmd_listroutes (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_listroutes (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_net_route *route; + struct VasEBoot_net_route *route; FOR_NET_ROUTES(route) { - grub_printf ("%s ", route->name); + VasEBoot_printf ("%s ", route->name); print_net_address (&route->target); if (route->is_gateway) { - grub_printf ("gw "); + VasEBoot_printf ("gw "); print_address (&route->gw); } else - grub_printf ("%s", route->interface->name); - grub_printf ("\n"); + VasEBoot_printf ("%s", route->interface->name); + VasEBoot_printf ("\n"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_listcards (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_listcards (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_net_card *card; + struct VasEBoot_net_card *card; FOR_NET_CARDS(card) { - char buf[GRUB_NET_MAX_STR_HWADDR_LEN]; - grub_net_hwaddr_to_str (&card->default_address, buf); - grub_printf ("%s %s\n", card->name, buf); + char buf[VasEBoot_NET_MAX_STR_HWADDR_LEN]; + VasEBoot_net_hwaddr_to_str (&card->default_address, buf); + VasEBoot_printf ("%s %s\n", card->name, buf); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_cmd_listaddrs (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_listaddrs (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - struct grub_net_network_level_interface *inf; + struct VasEBoot_net_network_level_interface *inf; FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { - char bufh[GRUB_NET_MAX_STR_HWADDR_LEN]; - char bufn[GRUB_NET_MAX_STR_ADDR_LEN]; - grub_net_hwaddr_to_str (&inf->hwaddress, bufh); - grub_net_addr_to_str (&inf->address, bufn); - grub_printf ("%s %s %s\n", inf->name, bufh, bufn); + char bufh[VasEBoot_NET_MAX_STR_HWADDR_LEN]; + char bufn[VasEBoot_NET_MAX_STR_ADDR_LEN]; + VasEBoot_net_hwaddr_to_str (&inf->hwaddress, bufh); + VasEBoot_net_addr_to_str (&inf->address, bufn); + VasEBoot_printf ("%s %s %s\n", inf->name, bufh, bufn); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_net_app_level_t grub_net_app_level_list; -struct grub_net_socket *grub_net_sockets; +VasEBoot_net_app_level_t VasEBoot_net_app_level_list; +struct VasEBoot_net_socket *VasEBoot_net_sockets; -static grub_net_t -grub_net_open_real (const char *name) +static VasEBoot_net_t +VasEBoot_net_open_real (const char *name) { - grub_net_app_level_t proto; + VasEBoot_net_app_level_t proto; const char *protname, *server; - grub_size_t protnamelen; + VasEBoot_size_t protnamelen; int try, port = 0; - if (grub_strncmp (name, "pxe:", sizeof ("pxe:") - 1) == 0) + if (VasEBoot_strncmp (name, "pxe:", sizeof ("pxe:") - 1) == 0) { protname = "tftp"; protnamelen = sizeof ("tftp") - 1; server = name + sizeof ("pxe:") - 1; } - else if (grub_strcmp (name, "pxe") == 0) + else if (VasEBoot_strcmp (name, "pxe") == 0) { protname = "tftp"; protnamelen = sizeof ("tftp") - 1; - server = grub_net_default_server; + server = VasEBoot_net_default_server; } else { const char *comma; char *colon; - comma = grub_strchr (name, ','); + comma = VasEBoot_strchr (name, ','); if (!comma) { - comma = grub_strchr (name, ';'); + comma = VasEBoot_strchr (name, ';'); } - colon = grub_strchr (name, ':'); + colon = VasEBoot_strchr (name, ':'); if (colon) { - port = (int) grub_strtol(colon+1, NULL, 10); + port = (int) VasEBoot_strtol(colon+1, NULL, 10); *colon = '\0'; } if (comma) @@ -1298,14 +1298,14 @@ grub_net_open_real (const char *name) } else { - protnamelen = grub_strlen (name); - server = grub_net_default_server; + protnamelen = VasEBoot_strlen (name); + server = VasEBoot_net_default_server; protname = name; } } if (!server) { - grub_error (GRUB_ERR_NET_BAD_ADDRESS, + VasEBoot_error (VasEBoot_ERR_NET_BAD_ADDRESS, N_("no server is specified")); return NULL; } @@ -1314,21 +1314,21 @@ grub_net_open_real (const char *name) { FOR_NET_APP_LEVEL (proto) { - if (grub_memcmp (proto->name, protname, protnamelen) == 0 + if (VasEBoot_memcmp (proto->name, protname, protnamelen) == 0 && proto->name[protnamelen] == 0) { - grub_net_t ret = grub_zalloc (sizeof (*ret)); + VasEBoot_net_t ret = VasEBoot_zalloc (sizeof (*ret)); if (!ret) return NULL; ret->protocol = proto; - ret->server = grub_strdup (server); + ret->server = VasEBoot_strdup (server); if (!ret->server) { - grub_free (ret); + VasEBoot_free (ret); return NULL; } ret->port = port; - ret->fs = &grub_net_fs; + ret->fs = &VasEBoot_net_fs; return ret; } } @@ -1337,61 +1337,61 @@ grub_net_open_real (const char *name) const char *prefix, *root; char *prefdev, *comma; int skip = 0; - grub_size_t devlen; + VasEBoot_size_t devlen; /* Do not attempt to load module if it requires protocol provided by this module - it results in infinite recursion. Just continue, fail and cleanup on next iteration. */ - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); if (!prefix) continue; - prefdev = grub_file_get_device_name (prefix); + prefdev = VasEBoot_file_get_device_name (prefix); if (!prefdev) { - root = grub_env_get ("root"); + root = VasEBoot_env_get ("root"); if (!root) continue; - prefdev = grub_strdup (root); + prefdev = VasEBoot_strdup (root); if (!prefdev) continue; } - if (grub_strncmp (prefdev, "pxe", sizeof ("pxe") - 1) == 0 && + if (VasEBoot_strncmp (prefdev, "pxe", sizeof ("pxe") - 1) == 0 && (!prefdev[sizeof ("pxe") - 1] || (prefdev[sizeof("pxe") - 1] == ':'))) { - grub_free (prefdev); - prefdev = grub_strdup ("tftp"); + VasEBoot_free (prefdev); + prefdev = VasEBoot_strdup ("tftp"); if (!prefdev) continue; } - comma = grub_strchr (prefdev, ','); + comma = VasEBoot_strchr (prefdev, ','); if (comma) *comma = '\0'; - devlen = grub_strlen (prefdev); + devlen = VasEBoot_strlen (prefdev); - if (protnamelen == devlen && grub_memcmp (prefdev, protname, devlen) == 0) + if (protnamelen == devlen && VasEBoot_memcmp (prefdev, protname, devlen) == 0) skip = 1; - grub_free (prefdev); + VasEBoot_free (prefdev); if (skip) continue; if (sizeof ("http") - 1 == protnamelen - && grub_memcmp ("http", protname, protnamelen) == 0) + && VasEBoot_memcmp ("http", protname, protnamelen) == 0) { - grub_dl_load ("http"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dl_load ("http"); + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } if (sizeof ("tftp") - 1 == protnamelen - && grub_memcmp ("tftp", protname, protnamelen) == 0) + && VasEBoot_memcmp ("tftp", protname, protnamelen) == 0) { - grub_dl_load ("tftp"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dl_load ("tftp"); + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } } @@ -1399,40 +1399,40 @@ grub_net_open_real (const char *name) } /* Restore original error. */ - grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), + VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), name); return NULL; } -static grub_err_t -grub_net_fs_dir (grub_device_t device, const char *path __attribute__ ((unused)), - grub_fs_dir_hook_t hook __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_net_fs_dir (VasEBoot_device_t device, const char *path __attribute__ ((unused)), + VasEBoot_fs_dir_hook_t hook __attribute__ ((unused)), void *hook_data __attribute__ ((unused))) { if (!device->net) - return grub_error (GRUB_ERR_BUG, "invalid net device"); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid net device"); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_net_fs_open (struct grub_file *file_out, const char *name) +static VasEBoot_err_t +VasEBoot_net_fs_open (struct VasEBoot_file *file_out, const char *name) { - grub_err_t err; - struct grub_file *file, *bufio; + VasEBoot_err_t err; + struct VasEBoot_file *file, *bufio; - file = grub_malloc (sizeof (*file)); + file = VasEBoot_malloc (sizeof (*file)); if (!file) - return grub_errno; + return VasEBoot_errno; - grub_memcpy (file, file_out, sizeof (struct grub_file)); + VasEBoot_memcpy (file, file_out, sizeof (struct VasEBoot_file)); file->device->net->packs.first = NULL; file->device->net->packs.last = NULL; - file->device->net->name = grub_strdup (name); + file->device->net->name = VasEBoot_strdup (name); if (!file->device->net->name) { - grub_free (file); - return grub_errno; + VasEBoot_free (file); + return VasEBoot_errno; } err = file->device->net->protocol->open (file, name); @@ -1440,59 +1440,59 @@ grub_net_fs_open (struct grub_file *file_out, const char *name) { while (file->device->net->packs.first) { - grub_netbuff_free (file->device->net->packs.first->nb); - grub_net_remove_packet (file->device->net->packs.first); + VasEBoot_netbuff_free (file->device->net->packs.first->nb); + VasEBoot_net_remove_packet (file->device->net->packs.first); } - grub_free (file->device->net->name); - grub_free (file); + VasEBoot_free (file->device->net->name); + VasEBoot_free (file); return err; } - bufio = grub_bufio_open (file, 32768); + bufio = VasEBoot_bufio_open (file, 32768); if (! bufio) { while (file->device->net->packs.first) { - grub_netbuff_free (file->device->net->packs.first->nb); - grub_net_remove_packet (file->device->net->packs.first); + VasEBoot_netbuff_free (file->device->net->packs.first->nb); + VasEBoot_net_remove_packet (file->device->net->packs.first); } file->device->net->protocol->close (file); - grub_free (file->device->net->name); - grub_free (file); - return grub_errno; + VasEBoot_free (file->device->net->name); + VasEBoot_free (file); + return VasEBoot_errno; } - grub_memcpy (file_out, bufio, sizeof (struct grub_file)); - grub_free (bufio); - return GRUB_ERR_NONE; + VasEBoot_memcpy (file_out, bufio, sizeof (struct VasEBoot_file)); + VasEBoot_free (bufio); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_net_fs_close (grub_file_t file) +static VasEBoot_err_t +VasEBoot_net_fs_close (VasEBoot_file_t file) { while (file->device->net->packs.first) { - grub_netbuff_free (file->device->net->packs.first->nb); - grub_net_remove_packet (file->device->net->packs.first); + VasEBoot_netbuff_free (file->device->net->packs.first->nb); + VasEBoot_net_remove_packet (file->device->net->packs.first); } file->device->net->protocol->close (file); - grub_free (file->device->net->name); - return GRUB_ERR_NONE; + VasEBoot_free (file->device->net->name); + return VasEBoot_ERR_NONE; } static void -receive_packets (struct grub_net_card *card, int *stop_condition) +receive_packets (struct VasEBoot_net_card *card, int *stop_condition) { int received = 0; if (card->num_ifaces == 0) return; if (!card->opened) { - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; if (card->driver->open) err = card->driver->open (card); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } card->opened = 1; @@ -1501,7 +1501,7 @@ receive_packets (struct grub_net_card *card, int *stop_condition) { /* Maybe should be better have a fixed number of packets for each card and just mark them as used and not used. */ - struct grub_net_buff *nb; + struct VasEBoot_net_buff *nb; if (received > 10 && stop_condition && *stop_condition) break; @@ -1509,98 +1509,98 @@ receive_packets (struct grub_net_card *card, int *stop_condition) nb = card->driver->recv (card); if (!nb) { - card->last_poll = grub_get_time_ms (); + card->last_poll = VasEBoot_get_time_ms (); break; } received++; - grub_net_recv_ethernet_packet (nb, card); - if (grub_errno) + VasEBoot_net_recv_ethernet_packet (nb, card); + if (VasEBoot_errno) { - grub_dprintf ("net", "error receiving: %d: %s\n", grub_errno, - grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "error receiving: %d: %s\n", VasEBoot_errno, + VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; } } - grub_print_error (); + VasEBoot_print_error (); } static char * -grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), +VasEBoot_env_write_readonly (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val __attribute__ ((unused))) { return NULL; } -grub_err_t -grub_env_set_net_property (const char *intername, const char *suffix, - const char *value, grub_size_t len) +VasEBoot_err_t +VasEBoot_env_set_net_property (const char *intername, const char *suffix, + const char *value, VasEBoot_size_t len) { char *varname, *varvalue; char *ptr; - varname = grub_xasprintf ("net_%s_%s", intername, suffix); + varname = VasEBoot_xasprintf ("net_%s_%s", intername, suffix); if (!varname) - return grub_errno; + return VasEBoot_errno; for (ptr = varname; *ptr; ptr++) if (*ptr == ':') *ptr = '_'; - varvalue = grub_malloc (len + 1); + varvalue = VasEBoot_malloc (len + 1); if (!varvalue) { - grub_free (varname); - return grub_errno; + VasEBoot_free (varname); + return VasEBoot_errno; } - grub_memcpy (varvalue, value, len); + VasEBoot_memcpy (varvalue, value, len); varvalue[len] = 0; - grub_err_t ret = grub_env_set (varname, varvalue); - grub_register_variable_hook (varname, 0, grub_env_write_readonly); - grub_env_export (varname); - grub_free (varname); - grub_free (varvalue); + VasEBoot_err_t ret = VasEBoot_env_set (varname, varvalue); + VasEBoot_register_variable_hook (varname, 0, VasEBoot_env_write_readonly); + VasEBoot_env_export (varname); + VasEBoot_free (varname); + VasEBoot_free (varvalue); return ret; } void -grub_net_poll_cards (unsigned time, int *stop_condition) +VasEBoot_net_poll_cards (unsigned time, int *stop_condition) { - struct grub_net_card *card; - grub_uint64_t start_time; - start_time = grub_get_time_ms (); - while ((grub_get_time_ms () - start_time) < time + struct VasEBoot_net_card *card; + VasEBoot_uint64_t start_time; + start_time = VasEBoot_get_time_ms (); + while ((VasEBoot_get_time_ms () - start_time) < time && (!stop_condition || !*stop_condition)) FOR_NET_CARDS (card) receive_packets (card, stop_condition); - grub_net_tcp_retransmit (); + VasEBoot_net_tcp_retransmit (); } static void -grub_net_poll_cards_idle_real (void) +VasEBoot_net_poll_cards_idle_real (void) { - struct grub_net_card *card; + struct VasEBoot_net_card *card; FOR_NET_CARDS (card) { - grub_uint64_t ctime = grub_get_time_ms (); + VasEBoot_uint64_t ctime = VasEBoot_get_time_ms (); if (ctime < card->last_poll || ctime >= card->last_poll + card->idle_poll_delay_ms) receive_packets (card, 0); } - grub_net_tcp_retransmit (); + VasEBoot_net_tcp_retransmit (); } /* Read from the packets list*/ -static grub_ssize_t -grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_net_fs_read_real (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { - grub_net_t net = file->device->net; - struct grub_net_buff *nb; + VasEBoot_net_t net = file->device->net; + struct VasEBoot_net_buff *nb; char *ptr = buf; - grub_size_t amount, total = 0; + VasEBoot_size_t amount, total = 0; int try = 0; - while (try <= GRUB_NET_TRIES) + while (try <= VasEBoot_NET_TRIES) { while (net->packs.first) { @@ -1612,17 +1612,17 @@ grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len) len -= amount; total += amount; file->device->net->offset += amount; - if (grub_file_progress_hook) - grub_file_progress_hook (0, 0, amount, file); + if (VasEBoot_file_progress_hook) + VasEBoot_file_progress_hook (0, 0, amount, file); if (buf) { - grub_memcpy (ptr, nb->data, amount); + VasEBoot_memcpy (ptr, nb->data, amount); ptr += amount; } - if (amount == (grub_size_t) (nb->tail - nb->data)) + if (amount == (VasEBoot_size_t) (nb->tail - nb->data)) { - grub_netbuff_free (nb); - grub_net_remove_packet (net->packs.first); + VasEBoot_netbuff_free (nb); + VasEBoot_net_remove_packet (net->packs.first); } else nb->data += amount; @@ -1640,52 +1640,52 @@ grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len) if (!net->eof) { try++; - grub_net_poll_cards (GRUB_NET_INTERVAL + - (try * GRUB_NET_INTERVAL_ADDITION), &net->stall); + VasEBoot_net_poll_cards (VasEBoot_NET_INTERVAL + + (try * VasEBoot_NET_INTERVAL_ADDITION), &net->stall); } else return total; } - grub_error (GRUB_ERR_TIMEOUT, N_("timeout reading `%s'"), net->name); + VasEBoot_error (VasEBoot_ERR_TIMEOUT, N_("timeout reading `%s'"), net->name); return -1; } -static grub_off_t -have_ahead (struct grub_file *file) +static VasEBoot_off_t +have_ahead (struct VasEBoot_file *file) { - grub_net_t net = file->device->net; - grub_off_t ret = net->offset; - struct grub_net_packet *pack; + VasEBoot_net_t net = file->device->net; + VasEBoot_off_t ret = net->offset; + struct VasEBoot_net_packet *pack; for (pack = net->packs.first; pack; pack = pack->next) ret += pack->nb->tail - pack->nb->data; return ret; } -static grub_err_t -grub_net_seek_real (struct grub_file *file, grub_off_t offset) +static VasEBoot_err_t +VasEBoot_net_seek_real (struct VasEBoot_file *file, VasEBoot_off_t offset) { if (offset == file->device->net->offset) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (offset > file->device->net->offset) { if (!file->device->net->protocol->seek || have_ahead (file) >= offset) { - grub_net_fs_read_real (file, NULL, + VasEBoot_net_fs_read_real (file, NULL, offset - file->device->net->offset); - return grub_errno; + return VasEBoot_errno; } return file->device->net->protocol->seek (file, offset); } { - grub_err_t err; + VasEBoot_err_t err; if (file->device->net->protocol->seek) return file->device->net->protocol->seek (file, offset); while (file->device->net->packs.first) { - grub_netbuff_free (file->device->net->packs.first->nb); - grub_net_remove_packet (file->device->net->packs.first); + VasEBoot_netbuff_free (file->device->net->packs.first->nb); + VasEBoot_net_remove_packet (file->device->net->packs.first); } file->device->net->protocol->close (file); @@ -1697,40 +1697,40 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset) err = file->device->net->protocol->open (file, file->device->net->name); if (err) return err; - grub_net_fs_read_real (file, NULL, offset); - return grub_errno; + VasEBoot_net_fs_read_real (file, NULL, offset); + return VasEBoot_errno; } } -static grub_ssize_t -grub_net_fs_read (grub_file_t file, char *buf, grub_size_t len) +static VasEBoot_ssize_t +VasEBoot_net_fs_read (VasEBoot_file_t file, char *buf, VasEBoot_size_t len) { if (file->offset != file->device->net->offset) { - grub_err_t err; - err = grub_net_seek_real (file, file->offset); + VasEBoot_err_t err; + err = VasEBoot_net_seek_real (file, file->offset); if (err) return err; } - return grub_net_fs_read_real (file, buf, len); + return VasEBoot_net_fs_read_real (file, buf, len); } -static struct grub_fs grub_net_fs = +static struct VasEBoot_fs VasEBoot_net_fs = { .name = "netfs", - .dir = grub_net_fs_dir, - .open = grub_net_fs_open, - .read = grub_net_fs_read, - .close = grub_net_fs_close, + .dir = VasEBoot_net_fs_dir, + .open = VasEBoot_net_fs_open, + .read = VasEBoot_net_fs_read, + .close = VasEBoot_net_fs_close, .label = NULL, .uuid = NULL, .mtime = NULL, }; -static grub_err_t -grub_net_fini_hw (int noreturn __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_net_fini_hw (int noreturn __attribute__ ((unused))) { - struct grub_net_card *card; + struct VasEBoot_net_card *card; FOR_NET_CARDS (card) if (card->opened) { @@ -1738,90 +1738,90 @@ grub_net_fini_hw (int noreturn __attribute__ ((unused))) card->driver->close (card); card->opened = 0; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_net_restore_hw (void) +static VasEBoot_err_t +VasEBoot_net_restore_hw (void) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_preboot *fini_hnd; +static struct VasEBoot_preboot *fini_hnd; -static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; -static grub_command_t cmd_lsroutes, cmd_lscards; -static grub_command_t cmd_lsaddr, cmd_slaac; +static VasEBoot_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; +static VasEBoot_command_t cmd_lsroutes, cmd_lscards; +static VasEBoot_command_t cmd_lsaddr, cmd_slaac; -GRUB_MOD_INIT(net) +VasEBoot_MOD_INIT(net) { - grub_register_variable_hook ("net_default_server", defserver_get_env, + VasEBoot_register_variable_hook ("net_default_server", defserver_get_env, defserver_set_env); - grub_env_export ("net_default_server"); - grub_register_variable_hook ("pxe_default_server", defserver_get_env, + VasEBoot_env_export ("net_default_server"); + VasEBoot_register_variable_hook ("pxe_default_server", defserver_get_env, defserver_set_env); - grub_env_export ("pxe_default_server"); - grub_register_variable_hook ("net_default_ip", defip_get_env, + VasEBoot_env_export ("pxe_default_server"); + VasEBoot_register_variable_hook ("net_default_ip", defip_get_env, defip_set_env); - grub_env_export ("net_default_ip"); - grub_register_variable_hook ("net_default_mac", defmac_get_env, + VasEBoot_env_export ("net_default_ip"); + VasEBoot_register_variable_hook ("net_default_mac", defmac_get_env, defmac_set_env); - grub_env_export ("net_default_mac"); + VasEBoot_env_export ("net_default_mac"); - cmd_addaddr = grub_register_command ("net_add_addr", grub_cmd_addaddr, + cmd_addaddr = VasEBoot_register_command ("net_add_addr", VasEBoot_cmd_addaddr, /* TRANSLATORS: HWADDRESS stands for "hardware address". */ N_("SHORTNAME CARD ADDRESS [HWADDRESS]"), N_("Add a network address.")); - cmd_slaac = grub_register_command ("net_ipv6_autoconf", - grub_cmd_ipv6_autoconf, + cmd_slaac = VasEBoot_register_command ("net_ipv6_autoconf", + VasEBoot_cmd_ipv6_autoconf, N_("[CARD [HWADDRESS]]"), N_("Perform an IPV6 autoconfiguration")); - cmd_deladdr = grub_register_command ("net_del_addr", grub_cmd_deladdr, + cmd_deladdr = VasEBoot_register_command ("net_del_addr", VasEBoot_cmd_deladdr, N_("SHORTNAME"), N_("Delete a network address.")); - cmd_addroute = grub_register_command ("net_add_route", grub_cmd_addroute, + cmd_addroute = VasEBoot_register_command ("net_add_route", VasEBoot_cmd_addroute, /* TRANSLATORS: "gw" is a keyword. */ N_("SHORTNAME NET [INTERFACE| gw GATEWAY]"), N_("Add a network route.")); - cmd_delroute = grub_register_command ("net_del_route", grub_cmd_delroute, + cmd_delroute = VasEBoot_register_command ("net_del_route", VasEBoot_cmd_delroute, N_("SHORTNAME"), N_("Delete a network route.")); - cmd_lsroutes = grub_register_command ("net_ls_routes", grub_cmd_listroutes, + cmd_lsroutes = VasEBoot_register_command ("net_ls_routes", VasEBoot_cmd_listroutes, "", N_("list network routes")); - cmd_lscards = grub_register_command ("net_ls_cards", grub_cmd_listcards, + cmd_lscards = VasEBoot_register_command ("net_ls_cards", VasEBoot_cmd_listcards, "", N_("list network cards")); - cmd_lsaddr = grub_register_command ("net_ls_addr", grub_cmd_listaddrs, + cmd_lsaddr = VasEBoot_register_command ("net_ls_addr", VasEBoot_cmd_listaddrs, "", N_("list network addresses")); - grub_bootp_init (); - grub_dns_init (); + VasEBoot_bootp_init (); + VasEBoot_dns_init (); - grub_net_open = grub_net_open_real; - fini_hnd = grub_loader_register_preboot_hook (grub_net_fini_hw, - grub_net_restore_hw, - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); - grub_net_poll_cards_idle = grub_net_poll_cards_idle_real; + VasEBoot_net_open = VasEBoot_net_open_real; + fini_hnd = VasEBoot_loader_register_preboot_hook (VasEBoot_net_fini_hw, + VasEBoot_net_restore_hw, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_DISK); + VasEBoot_net_poll_cards_idle = VasEBoot_net_poll_cards_idle_real; } -GRUB_MOD_FINI(net) +VasEBoot_MOD_FINI(net) { - grub_register_variable_hook ("net_default_server", 0, 0); - grub_register_variable_hook ("pxe_default_server", 0, 0); + VasEBoot_register_variable_hook ("net_default_server", 0, 0); + VasEBoot_register_variable_hook ("pxe_default_server", 0, 0); - grub_bootp_fini (); - grub_dns_fini (); - grub_unregister_command (cmd_addaddr); - grub_unregister_command (cmd_deladdr); - grub_unregister_command (cmd_addroute); - grub_unregister_command (cmd_delroute); - grub_unregister_command (cmd_lsroutes); - grub_unregister_command (cmd_lscards); - grub_unregister_command (cmd_lsaddr); - grub_unregister_command (cmd_slaac); - grub_fs_unregister (&grub_net_fs); - grub_net_open = NULL; - grub_net_fini_hw (0); - grub_loader_unregister_preboot_hook (fini_hnd); - grub_net_poll_cards_idle = grub_net_poll_cards_idle_real; + VasEBoot_bootp_fini (); + VasEBoot_dns_fini (); + VasEBoot_unregister_command (cmd_addaddr); + VasEBoot_unregister_command (cmd_deladdr); + VasEBoot_unregister_command (cmd_addroute); + VasEBoot_unregister_command (cmd_delroute); + VasEBoot_unregister_command (cmd_lsroutes); + VasEBoot_unregister_command (cmd_lscards); + VasEBoot_unregister_command (cmd_lsaddr); + VasEBoot_unregister_command (cmd_slaac); + VasEBoot_fs_unregister (&VasEBoot_net_fs); + VasEBoot_net_open = NULL; + VasEBoot_net_fini_hw (0); + VasEBoot_loader_unregister_preboot_hook (fini_hnd); + VasEBoot_net_poll_cards_idle = VasEBoot_net_poll_cards_idle_real; } diff --git a/VasEBoot-core/net/netbuff.c b/VasEBoot-core/net/netbuff.c index dbeeefe47..684b6e3bd 100644 --- a/VasEBoot-core/net/netbuff.c +++ b/VasEBoot-core/net/netbuff.c @@ -1,133 +1,133 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -grub_err_t -grub_netbuff_put (struct grub_net_buff *nb, grub_size_t len) +VasEBoot_err_t +VasEBoot_netbuff_put (struct VasEBoot_net_buff *nb, VasEBoot_size_t len) { nb->tail += len; if (nb->tail > nb->end) - return grub_error (GRUB_ERR_BUG, "put out of the packet range."); - return GRUB_ERR_NONE; + return VasEBoot_error (VasEBoot_ERR_BUG, "put out of the packet range."); + return VasEBoot_ERR_NONE; } -grub_err_t -grub_netbuff_unput (struct grub_net_buff *nb, grub_size_t len) +VasEBoot_err_t +VasEBoot_netbuff_unput (struct VasEBoot_net_buff *nb, VasEBoot_size_t len) { nb->tail -= len; if (nb->tail < nb->head) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "unput out of the packet range."); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_netbuff_push (struct grub_net_buff *nb, grub_size_t len) +VasEBoot_err_t +VasEBoot_netbuff_push (struct VasEBoot_net_buff *nb, VasEBoot_size_t len) { nb->data -= len; if (nb->data < nb->head) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "push out of the packet range."); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_netbuff_pull (struct grub_net_buff *nb, grub_size_t len) +VasEBoot_err_t +VasEBoot_netbuff_pull (struct VasEBoot_net_buff *nb, VasEBoot_size_t len) { nb->data += len; if (nb->data > nb->end) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "pull out of the packet range."); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_netbuff_reserve (struct grub_net_buff *nb, grub_size_t len) +VasEBoot_err_t +VasEBoot_netbuff_reserve (struct VasEBoot_net_buff *nb, VasEBoot_size_t len) { nb->data += len; nb->tail += len; if ((nb->tail > nb->end) || (nb->data > nb->end)) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "reserve out of the packet range."); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_net_buff * -grub_netbuff_alloc (grub_size_t len) +struct VasEBoot_net_buff * +VasEBoot_netbuff_alloc (VasEBoot_size_t len) { - struct grub_net_buff *nb; + struct VasEBoot_net_buff *nb; void *data; - COMPILE_TIME_ASSERT (NETBUFF_ALIGN % sizeof (grub_properly_aligned_t) == 0); + COMPILE_TIME_ASSERT (NETBUFF_ALIGN % sizeof (VasEBoot_properly_aligned_t) == 0); if (len < NETBUFFMINLEN) len = NETBUFFMINLEN; len = ALIGN_UP (len, NETBUFF_ALIGN); -#ifdef GRUB_MACHINE_EMU - data = grub_malloc (len + sizeof (*nb)); +#ifdef VasEBoot_MACHINE_EMU + data = VasEBoot_malloc (len + sizeof (*nb)); #else - data = grub_memalign (NETBUFF_ALIGN, len + sizeof (*nb)); + data = VasEBoot_memalign (NETBUFF_ALIGN, len + sizeof (*nb)); #endif if (!data) return NULL; - nb = (struct grub_net_buff *) ((grub_properly_aligned_t *) data - + len / sizeof (grub_properly_aligned_t)); + nb = (struct VasEBoot_net_buff *) ((VasEBoot_properly_aligned_t *) data + + len / sizeof (VasEBoot_properly_aligned_t)); nb->head = nb->data = nb->tail = data; - nb->end = (grub_uint8_t *) nb; + nb->end = (VasEBoot_uint8_t *) nb; return nb; } -struct grub_net_buff * -grub_netbuff_make_pkt (grub_size_t len) +struct VasEBoot_net_buff * +VasEBoot_netbuff_make_pkt (VasEBoot_size_t len) { - struct grub_net_buff *nb; - grub_err_t err; - nb = grub_netbuff_alloc (len + 512); + struct VasEBoot_net_buff *nb; + VasEBoot_err_t err; + nb = VasEBoot_netbuff_alloc (len + 512); if (!nb) return NULL; - err = grub_netbuff_reserve (nb, len + 512); + err = VasEBoot_netbuff_reserve (nb, len + 512); if (err) goto fail; - err = grub_netbuff_push (nb, len); + err = VasEBoot_netbuff_push (nb, len); if (err) goto fail; return nb; fail: - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return NULL; } void -grub_netbuff_free (struct grub_net_buff *nb) +VasEBoot_netbuff_free (struct VasEBoot_net_buff *nb) { if (!nb) return; - grub_free (nb->head); + VasEBoot_free (nb->head); } -grub_err_t -grub_netbuff_clear (struct grub_net_buff *nb) +VasEBoot_err_t +VasEBoot_netbuff_clear (struct VasEBoot_net_buff *nb) { nb->data = nb->tail = nb->head; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/net/tcp.c b/VasEBoot-core/net/tcp.c index e8ad34b84..53c4c7e0d 100644 --- a/VasEBoot-core/net/tcp.c +++ b/VasEBoot-core/net/tcp.c @@ -1,39 +1,39 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#define TCP_SYN_RETRANSMISSION_TIMEOUT GRUB_NET_INTERVAL -#define TCP_SYN_RETRANSMISSION_COUNT GRUB_NET_TRIES -#define TCP_RETRANSMISSION_TIMEOUT GRUB_NET_INTERVAL -#define TCP_RETRANSMISSION_COUNT GRUB_NET_TRIES +#define TCP_SYN_RETRANSMISSION_TIMEOUT VasEBoot_NET_INTERVAL +#define TCP_SYN_RETRANSMISSION_COUNT VasEBoot_NET_TRIES +#define TCP_RETRANSMISSION_TIMEOUT VasEBoot_NET_INTERVAL +#define TCP_RETRANSMISSION_COUNT VasEBoot_NET_TRIES struct unacked { struct unacked *next; struct unacked **prev; - struct grub_net_buff *nb; - grub_uint64_t last_try; + struct VasEBoot_net_buff *nb; + VasEBoot_uint64_t last_try; int try_count; }; @@ -47,10 +47,10 @@ enum TCP_URG = 0x20, }; -struct grub_net_tcp_socket +struct VasEBoot_net_tcp_socket { - struct grub_net_tcp_socket *next; - struct grub_net_tcp_socket **prev; + struct VasEBoot_net_tcp_socket *next; + struct VasEBoot_net_tcp_socket **prev; int established; int i_closed; @@ -61,110 +61,110 @@ struct grub_net_tcp_socket int they_reseted; int i_reseted; int i_stall; - grub_uint32_t my_start_seq; - grub_uint32_t my_cur_seq; - grub_uint32_t their_start_seq; - grub_uint32_t their_cur_seq; - grub_uint16_t my_window; + VasEBoot_uint32_t my_start_seq; + VasEBoot_uint32_t my_cur_seq; + VasEBoot_uint32_t their_start_seq; + VasEBoot_uint32_t their_cur_seq; + VasEBoot_uint16_t my_window; struct unacked *unack_first; struct unacked *unack_last; - grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock, struct grub_net_buff *nb, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_tcp_socket_t sock, struct VasEBoot_net_buff *nb, void *recv); - void (*error_hook) (grub_net_tcp_socket_t sock, void *recv); - void (*fin_hook) (grub_net_tcp_socket_t sock, void *recv); + void (*error_hook) (VasEBoot_net_tcp_socket_t sock, void *recv); + void (*fin_hook) (VasEBoot_net_tcp_socket_t sock, void *recv); void *hook_data; - grub_net_network_level_address_t out_nla; - grub_net_link_level_address_t ll_target_addr; - struct grub_net_network_level_interface *inf; - grub_net_packets_t packs; - grub_priority_queue_t pq; + VasEBoot_net_network_level_address_t out_nla; + VasEBoot_net_link_level_address_t ll_target_addr; + struct VasEBoot_net_network_level_interface *inf; + VasEBoot_net_packets_t packs; + VasEBoot_priority_queue_t pq; }; -struct grub_net_tcp_listen +struct VasEBoot_net_tcp_listen { - struct grub_net_tcp_listen *next; - struct grub_net_tcp_listen **prev; + struct VasEBoot_net_tcp_listen *next; + struct VasEBoot_net_tcp_listen **prev; - grub_uint16_t port; - const struct grub_net_network_level_interface *inf; + VasEBoot_uint16_t port; + const struct VasEBoot_net_network_level_interface *inf; - grub_err_t (*listen_hook) (grub_net_tcp_listen_t listen, - grub_net_tcp_socket_t sock, + VasEBoot_err_t (*listen_hook) (VasEBoot_net_tcp_listen_t listen, + VasEBoot_net_tcp_socket_t sock, void *data); void *hook_data; }; struct tcphdr { - grub_uint16_t src; - grub_uint16_t dst; - grub_uint32_t seqnr; - grub_uint32_t ack; - grub_uint16_t flags; - grub_uint16_t window; - grub_uint16_t checksum; - grub_uint16_t urgent; -} GRUB_PACKED; + VasEBoot_uint16_t src; + VasEBoot_uint16_t dst; + VasEBoot_uint32_t seqnr; + VasEBoot_uint32_t ack; + VasEBoot_uint16_t flags; + VasEBoot_uint16_t window; + VasEBoot_uint16_t checksum; + VasEBoot_uint16_t urgent; +} VasEBoot_PACKED; struct tcp_pseudohdr { - grub_uint32_t src; - grub_uint32_t dst; - grub_uint8_t zero; - grub_uint8_t proto; - grub_uint16_t tcp_length; -} GRUB_PACKED; + VasEBoot_uint32_t src; + VasEBoot_uint32_t dst; + VasEBoot_uint8_t zero; + VasEBoot_uint8_t proto; + VasEBoot_uint16_t tcp_length; +} VasEBoot_PACKED; struct tcp6_pseudohdr { - grub_uint64_t src[2]; - grub_uint64_t dst[2]; - grub_uint32_t tcp_length; - grub_uint8_t zero[3]; - grub_uint8_t proto; -} GRUB_PACKED; + VasEBoot_uint64_t src[2]; + VasEBoot_uint64_t dst[2]; + VasEBoot_uint32_t tcp_length; + VasEBoot_uint8_t zero[3]; + VasEBoot_uint8_t proto; +} VasEBoot_PACKED; -static struct grub_net_tcp_socket *tcp_sockets; -static struct grub_net_tcp_listen *tcp_listens; +static struct VasEBoot_net_tcp_socket *tcp_sockets; +static struct VasEBoot_net_tcp_listen *tcp_listens; #define FOR_TCP_SOCKETS(var) FOR_LIST_ELEMENTS (var, tcp_sockets) #define FOR_TCP_LISTENS(var) FOR_LIST_ELEMENTS (var, tcp_listens) -grub_net_tcp_listen_t -grub_net_tcp_listen (grub_uint16_t port, - const struct grub_net_network_level_interface *inf, - grub_err_t (*listen_hook) (grub_net_tcp_listen_t listen, - grub_net_tcp_socket_t sock, +VasEBoot_net_tcp_listen_t +VasEBoot_net_tcp_listen (VasEBoot_uint16_t port, + const struct VasEBoot_net_network_level_interface *inf, + VasEBoot_err_t (*listen_hook) (VasEBoot_net_tcp_listen_t listen, + VasEBoot_net_tcp_socket_t sock, void *data), void *hook_data) { - grub_net_tcp_listen_t ret; - ret = grub_malloc (sizeof (*ret)); + VasEBoot_net_tcp_listen_t ret; + ret = VasEBoot_malloc (sizeof (*ret)); if (!ret) return NULL; ret->listen_hook = listen_hook; ret->hook_data = hook_data; ret->port = port; ret->inf = inf; - grub_list_push (GRUB_AS_LIST_P (&tcp_listens), GRUB_AS_LIST (ret)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&tcp_listens), VasEBoot_AS_LIST (ret)); return ret; } void -grub_net_tcp_stop_listen (grub_net_tcp_listen_t listen) +VasEBoot_net_tcp_stop_listen (VasEBoot_net_tcp_listen_t listen) { - grub_list_remove (GRUB_AS_LIST (listen)); + VasEBoot_list_remove (VasEBoot_AS_LIST (listen)); } static inline void -tcp_socket_register (grub_net_tcp_socket_t sock) +tcp_socket_register (VasEBoot_net_tcp_socket_t sock) { - grub_list_push (GRUB_AS_LIST_P (&tcp_sockets), - GRUB_AS_LIST (sock)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&tcp_sockets), + VasEBoot_AS_LIST (sock)); } static void -error (grub_net_tcp_socket_t sock) +error (VasEBoot_net_tcp_socket_t sock) { struct unacked *unack, *next; @@ -174,80 +174,80 @@ error (grub_net_tcp_socket_t sock) for (unack = sock->unack_first; unack; unack = next) { next = unack->next; - grub_netbuff_free (unack->nb); - grub_free (unack); + VasEBoot_netbuff_free (unack->nb); + VasEBoot_free (unack); } sock->unack_first = NULL; sock->unack_last = NULL; } -static grub_err_t -tcp_send (struct grub_net_buff *nb, grub_net_tcp_socket_t socket) +static VasEBoot_err_t +tcp_send (struct VasEBoot_net_buff *nb, VasEBoot_net_tcp_socket_t socket) { - grub_err_t err; - grub_uint8_t *nbd; + VasEBoot_err_t err; + VasEBoot_uint8_t *nbd; struct unacked *unack; struct tcphdr *tcph; - grub_size_t size; + VasEBoot_size_t size; tcph = (struct tcphdr *) nb->data; - tcph->seqnr = grub_cpu_to_be32 (socket->my_cur_seq); - size = (nb->tail - nb->data - (grub_be_to_cpu16 (tcph->flags) >> 12) * 4); - if (grub_be_to_cpu16 (tcph->flags) & TCP_FIN) + tcph->seqnr = VasEBoot_cpu_to_be32 (socket->my_cur_seq); + size = (nb->tail - nb->data - (VasEBoot_be_to_cpu16 (tcph->flags) >> 12) * 4); + if (VasEBoot_be_to_cpu16 (tcph->flags) & TCP_FIN) size++; socket->my_cur_seq += size; - tcph->src = grub_cpu_to_be16 (socket->in_port); - tcph->dst = grub_cpu_to_be16 (socket->out_port); + tcph->src = VasEBoot_cpu_to_be16 (socket->in_port); + tcph->dst = VasEBoot_cpu_to_be16 (socket->out_port); tcph->checksum = 0; - tcph->checksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_TCP, + tcph->checksum = VasEBoot_net_ip_transport_checksum (nb, VasEBoot_NET_IP_TCP, &socket->inf->address, &socket->out_nla); nbd = nb->data; if (size) { - unack = grub_malloc (sizeof (*unack)); + unack = VasEBoot_malloc (sizeof (*unack)); if (!unack) - return grub_errno; + return VasEBoot_errno; unack->next = NULL; unack->nb = nb; unack->try_count = 1; - unack->last_try = grub_get_time_ms (); + unack->last_try = VasEBoot_get_time_ms (); if (!socket->unack_last) socket->unack_first = socket->unack_last = unack; else socket->unack_last->next = unack; } - err = grub_net_send_ip_packet (socket->inf, &(socket->out_nla), + err = VasEBoot_net_send_ip_packet (socket->inf, &(socket->out_nla), &(socket->ll_target_addr), nb, - GRUB_NET_IP_TCP); + VasEBoot_NET_IP_TCP); if (err) return err; nb->data = nbd; if (!size) - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } void -grub_net_tcp_close (grub_net_tcp_socket_t sock, +VasEBoot_net_tcp_close (VasEBoot_net_tcp_socket_t sock, int discard_received) { - struct grub_net_buff *nb_fin; + struct VasEBoot_net_buff *nb_fin; struct tcphdr *tcph_fin; - grub_err_t err; + VasEBoot_err_t err; - if (discard_received != GRUB_NET_TCP_CONTINUE_RECEIVING) + if (discard_received != VasEBoot_NET_TCP_CONTINUE_RECEIVING) { sock->recv_hook = NULL; sock->error_hook = NULL; sock->fin_hook = NULL; } - if (discard_received == GRUB_NET_TCP_ABORT) + if (discard_received == VasEBoot_NET_TCP_ABORT) sock->i_reseted = 1; if (sock->i_closed) @@ -255,115 +255,115 @@ grub_net_tcp_close (grub_net_tcp_socket_t sock, sock->i_closed = 1; - nb_fin = grub_netbuff_alloc (sizeof (*tcph_fin) - + GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + nb_fin = VasEBoot_netbuff_alloc (sizeof (*tcph_fin) + + VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb_fin) return; - err = grub_netbuff_reserve (nb_fin, GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + err = VasEBoot_netbuff_reserve (nb_fin, VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (err) { - grub_netbuff_free (nb_fin); - grub_dprintf ("net", "error closing socket\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb_fin); + VasEBoot_dprintf ("net", "error closing socket\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - err = grub_netbuff_put (nb_fin, sizeof (*tcph_fin)); + err = VasEBoot_netbuff_put (nb_fin, sizeof (*tcph_fin)); if (err) { - grub_netbuff_free (nb_fin); - grub_dprintf ("net", "error closing socket\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb_fin); + VasEBoot_dprintf ("net", "error closing socket\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } tcph_fin = (void *) nb_fin->data; - tcph_fin->ack = grub_cpu_to_be32 (sock->their_cur_seq); - tcph_fin->flags = grub_cpu_to_be16_compile_time ((5 << 12) | TCP_FIN + tcph_fin->ack = VasEBoot_cpu_to_be32 (sock->their_cur_seq); + tcph_fin->flags = VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_FIN | TCP_ACK); - tcph_fin->window = grub_cpu_to_be16_compile_time (0); + tcph_fin->window = VasEBoot_cpu_to_be16_compile_time (0); tcph_fin->urgent = 0; err = tcp_send (nb_fin, sock); if (err) { - grub_netbuff_free (nb_fin); - grub_dprintf ("net", "error closing socket\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb_fin); + VasEBoot_dprintf ("net", "error closing socket\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; } return; } static void -ack_real (grub_net_tcp_socket_t sock, int res) +ack_real (VasEBoot_net_tcp_socket_t sock, int res) { - struct grub_net_buff *nb_ack; + struct VasEBoot_net_buff *nb_ack; struct tcphdr *tcph_ack; - grub_err_t err; + VasEBoot_err_t err; - nb_ack = grub_netbuff_alloc (sizeof (*tcph_ack) + 128); + nb_ack = VasEBoot_netbuff_alloc (sizeof (*tcph_ack) + 128); if (!nb_ack) return; - err = grub_netbuff_reserve (nb_ack, 128); + err = VasEBoot_netbuff_reserve (nb_ack, 128); if (err) { - grub_netbuff_free (nb_ack); - grub_dprintf ("net", "error closing socket\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb_ack); + VasEBoot_dprintf ("net", "error closing socket\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - err = grub_netbuff_put (nb_ack, sizeof (*tcph_ack)); + err = VasEBoot_netbuff_put (nb_ack, sizeof (*tcph_ack)); if (err) { - grub_netbuff_free (nb_ack); - grub_dprintf ("net", "error closing socket\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb_ack); + VasEBoot_dprintf ("net", "error closing socket\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } tcph_ack = (void *) nb_ack->data; if (res) { - tcph_ack->ack = grub_cpu_to_be32_compile_time (0); - tcph_ack->flags = grub_cpu_to_be16_compile_time ((5 << 12) | TCP_RST); - tcph_ack->window = grub_cpu_to_be16_compile_time (0); + tcph_ack->ack = VasEBoot_cpu_to_be32_compile_time (0); + tcph_ack->flags = VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_RST); + tcph_ack->window = VasEBoot_cpu_to_be16_compile_time (0); } else { - tcph_ack->ack = grub_cpu_to_be32 (sock->their_cur_seq); - tcph_ack->flags = grub_cpu_to_be16_compile_time ((5 << 12) | TCP_ACK); - tcph_ack->window = !sock->i_stall ? grub_cpu_to_be16 (sock->my_window) + tcph_ack->ack = VasEBoot_cpu_to_be32 (sock->their_cur_seq); + tcph_ack->flags = VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_ACK); + tcph_ack->window = !sock->i_stall ? VasEBoot_cpu_to_be16 (sock->my_window) : 0; } tcph_ack->urgent = 0; - tcph_ack->src = grub_cpu_to_be16 (sock->in_port); - tcph_ack->dst = grub_cpu_to_be16 (sock->out_port); + tcph_ack->src = VasEBoot_cpu_to_be16 (sock->in_port); + tcph_ack->dst = VasEBoot_cpu_to_be16 (sock->out_port); err = tcp_send (nb_ack, sock); if (err) { - grub_dprintf ("net", "error acking socket\n"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "error acking socket\n"); + VasEBoot_errno = VasEBoot_ERR_NONE; } } static void -ack (grub_net_tcp_socket_t sock) +ack (VasEBoot_net_tcp_socket_t sock) { ack_real (sock, 0); } static void -reset (grub_net_tcp_socket_t sock) +reset (VasEBoot_net_tcp_socket_t sock) { ack_real (sock, 1); } void -grub_net_tcp_retransmit (void) +VasEBoot_net_tcp_retransmit (void) { - grub_net_tcp_socket_t sock; - grub_uint64_t ctime = grub_get_time_ms (); - grub_uint64_t limit_time = ctime - TCP_RETRANSMISSION_TIMEOUT; + VasEBoot_net_tcp_socket_t sock; + VasEBoot_uint64_t ctime = VasEBoot_get_time_ms (); + VasEBoot_uint64_t limit_time = ctime - TCP_RETRANSMISSION_TIMEOUT; FOR_TCP_SOCKETS (sock) { @@ -371,8 +371,8 @@ grub_net_tcp_retransmit (void) for (unack = sock->unack_first; unack; unack = unack->next) { struct tcphdr *tcph; - grub_uint8_t *nbd; - grub_err_t err; + VasEBoot_uint8_t *nbd; + VasEBoot_err_t err; if (unack->last_try > limit_time) continue; @@ -387,156 +387,156 @@ grub_net_tcp_retransmit (void) nbd = unack->nb->data; tcph = (struct tcphdr *) nbd; - if ((tcph->flags & grub_cpu_to_be16_compile_time (TCP_ACK)) - && tcph->ack != grub_cpu_to_be32 (sock->their_cur_seq)) + if ((tcph->flags & VasEBoot_cpu_to_be16_compile_time (TCP_ACK)) + && tcph->ack != VasEBoot_cpu_to_be32 (sock->their_cur_seq)) { tcph->checksum = 0; - tcph->checksum = grub_net_ip_transport_checksum (unack->nb, - GRUB_NET_IP_TCP, + tcph->checksum = VasEBoot_net_ip_transport_checksum (unack->nb, + VasEBoot_NET_IP_TCP, &sock->inf->address, &sock->out_nla); } - err = grub_net_send_ip_packet (sock->inf, &(sock->out_nla), + err = VasEBoot_net_send_ip_packet (sock->inf, &(sock->out_nla), &(sock->ll_target_addr), unack->nb, - GRUB_NET_IP_TCP); + VasEBoot_NET_IP_TCP); unack->nb->data = nbd; if (err) { - grub_dprintf ("net", "TCP retransmit failed: %s\n", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "TCP retransmit failed: %s\n", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; } } } } -grub_uint16_t -grub_net_ip_transport_checksum (struct grub_net_buff *nb, - grub_uint16_t proto, - const grub_net_network_level_address_t *src, - const grub_net_network_level_address_t *dst) +VasEBoot_uint16_t +VasEBoot_net_ip_transport_checksum (struct VasEBoot_net_buff *nb, + VasEBoot_uint16_t proto, + const VasEBoot_net_network_level_address_t *src, + const VasEBoot_net_network_level_address_t *dst) { - grub_uint16_t a, b = 0; - grub_uint32_t c; - a = ~grub_be_to_cpu16 (grub_net_ip_chksum ((void *) nb->data, + VasEBoot_uint16_t a, b = 0; + VasEBoot_uint32_t c; + a = ~VasEBoot_be_to_cpu16 (VasEBoot_net_ip_chksum ((void *) nb->data, nb->tail - nb->data)); switch (dst->type) { - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4: { struct tcp_pseudohdr ph; ph.src = src->ipv4; ph.dst = dst->ipv4; ph.zero = 0; - ph.tcp_length = grub_cpu_to_be16 (nb->tail - nb->data); + ph.tcp_length = VasEBoot_cpu_to_be16 (nb->tail - nb->data); ph.proto = proto; - b = ~grub_be_to_cpu16 (grub_net_ip_chksum ((void *) &ph, sizeof (ph))); + b = ~VasEBoot_be_to_cpu16 (VasEBoot_net_ip_chksum ((void *) &ph, sizeof (ph))); break; } - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6: { struct tcp6_pseudohdr ph; - grub_memcpy (ph.src, src->ipv6, sizeof (ph.src)); - grub_memcpy (ph.dst, dst->ipv6, sizeof (ph.dst)); - grub_memset (ph.zero, 0, sizeof (ph.zero)); - ph.tcp_length = grub_cpu_to_be32 (nb->tail - nb->data); + VasEBoot_memcpy (ph.src, src->ipv6, sizeof (ph.src)); + VasEBoot_memcpy (ph.dst, dst->ipv6, sizeof (ph.dst)); + VasEBoot_memset (ph.zero, 0, sizeof (ph.zero)); + ph.tcp_length = VasEBoot_cpu_to_be32 (nb->tail - nb->data); ph.proto = proto; - b = ~grub_be_to_cpu16 (grub_net_ip_chksum ((void *) &ph, sizeof (ph))); + b = ~VasEBoot_be_to_cpu16 (VasEBoot_net_ip_chksum ((void *) &ph, sizeof (ph))); break; } - case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: + case VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: b = 0; break; } - c = (grub_uint32_t) a + (grub_uint32_t) b; + c = (VasEBoot_uint32_t) a + (VasEBoot_uint32_t) b; if (c >= 0xffff) c -= 0xffff; - return grub_cpu_to_be16 (~c); + return VasEBoot_cpu_to_be16 (~c); } /* FIXME: overflow. */ static int cmp (const void *a__, const void *b__) { - struct grub_net_buff *a_ = *(struct grub_net_buff **) a__; - struct grub_net_buff *b_ = *(struct grub_net_buff **) b__; + struct VasEBoot_net_buff *a_ = *(struct VasEBoot_net_buff **) a__; + struct VasEBoot_net_buff *b_ = *(struct VasEBoot_net_buff **) b__; struct tcphdr *a = (struct tcphdr *) a_->data; struct tcphdr *b = (struct tcphdr *) b_->data; /* We want the first elements to be on top. */ - if (grub_be_to_cpu32 (a->seqnr) < grub_be_to_cpu32 (b->seqnr)) + if (VasEBoot_be_to_cpu32 (a->seqnr) < VasEBoot_be_to_cpu32 (b->seqnr)) return +1; - if (grub_be_to_cpu32 (a->seqnr) > grub_be_to_cpu32 (b->seqnr)) + if (VasEBoot_be_to_cpu32 (a->seqnr) > VasEBoot_be_to_cpu32 (b->seqnr)) return -1; return 0; } static void -destroy_pq (grub_net_tcp_socket_t sock) +destroy_pq (VasEBoot_net_tcp_socket_t sock) { - struct grub_net_buff **nb_p; - while ((nb_p = grub_priority_queue_top (sock->pq))) + struct VasEBoot_net_buff **nb_p; + while ((nb_p = VasEBoot_priority_queue_top (sock->pq))) { - grub_netbuff_free (*nb_p); - grub_priority_queue_pop (sock->pq); + VasEBoot_netbuff_free (*nb_p); + VasEBoot_priority_queue_pop (sock->pq); } - grub_priority_queue_destroy (sock->pq); + VasEBoot_priority_queue_destroy (sock->pq); } -grub_err_t -grub_net_tcp_accept (grub_net_tcp_socket_t sock, - grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock, - struct grub_net_buff *nb, +VasEBoot_err_t +VasEBoot_net_tcp_accept (VasEBoot_net_tcp_socket_t sock, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_tcp_socket_t sock, + struct VasEBoot_net_buff *nb, void *data), - void (*error_hook) (grub_net_tcp_socket_t sock, + void (*error_hook) (VasEBoot_net_tcp_socket_t sock, void *data), - void (*fin_hook) (grub_net_tcp_socket_t sock, + void (*fin_hook) (VasEBoot_net_tcp_socket_t sock, void *data), void *hook_data) { - struct grub_net_buff *nb_ack; + struct VasEBoot_net_buff *nb_ack; struct tcphdr *tcph; - grub_err_t err; - grub_net_network_level_address_t gateway; - struct grub_net_network_level_interface *inf; + VasEBoot_err_t err; + VasEBoot_net_network_level_address_t gateway; + struct VasEBoot_net_network_level_interface *inf; sock->recv_hook = recv_hook; sock->error_hook = error_hook; sock->fin_hook = fin_hook; sock->hook_data = hook_data; - err = grub_net_route_address (sock->out_nla, &gateway, &inf); + err = VasEBoot_net_route_address (sock->out_nla, &gateway, &inf); if (err) return err; - err = grub_net_link_layer_resolve (sock->inf, &gateway, &(sock->ll_target_addr)); + err = VasEBoot_net_link_layer_resolve (sock->inf, &gateway, &(sock->ll_target_addr)); if (err) return err; - nb_ack = grub_netbuff_alloc (sizeof (*tcph) - + GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + nb_ack = VasEBoot_netbuff_alloc (sizeof (*tcph) + + VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb_ack) - return grub_errno; - err = grub_netbuff_reserve (nb_ack, GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + return VasEBoot_errno; + err = VasEBoot_netbuff_reserve (nb_ack, VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (err) { - grub_netbuff_free (nb_ack); + VasEBoot_netbuff_free (nb_ack); return err; } - err = grub_netbuff_put (nb_ack, sizeof (*tcph)); + err = VasEBoot_netbuff_put (nb_ack, sizeof (*tcph)); if (err) { - grub_netbuff_free (nb_ack); + VasEBoot_netbuff_free (nb_ack); return err; } tcph = (void *) nb_ack->data; - tcph->ack = grub_cpu_to_be32 (sock->their_cur_seq); - tcph->flags = grub_cpu_to_be16_compile_time ((5 << 12) | TCP_SYN | TCP_ACK); - tcph->window = grub_cpu_to_be16 (sock->my_window); + tcph->ack = VasEBoot_cpu_to_be32 (sock->their_cur_seq); + tcph->flags = VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_SYN | TCP_ACK); + tcph->window = VasEBoot_cpu_to_be16 (sock->my_window); tcph->urgent = 0; sock->established = 1; tcp_socket_register (sock); @@ -544,53 +544,53 @@ grub_net_tcp_accept (grub_net_tcp_socket_t sock, if (err) return err; sock->my_cur_seq++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_net_tcp_socket_t -grub_net_tcp_open (char *server, - grub_uint16_t out_port, - grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock, - struct grub_net_buff *nb, +VasEBoot_net_tcp_socket_t +VasEBoot_net_tcp_open (char *server, + VasEBoot_uint16_t out_port, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_tcp_socket_t sock, + struct VasEBoot_net_buff *nb, void *data), - void (*error_hook) (grub_net_tcp_socket_t sock, + void (*error_hook) (VasEBoot_net_tcp_socket_t sock, void *data), - void (*fin_hook) (grub_net_tcp_socket_t sock, + void (*fin_hook) (VasEBoot_net_tcp_socket_t sock, void *data), void *hook_data) { - grub_err_t err; - grub_net_network_level_address_t addr; - struct grub_net_network_level_interface *inf; - grub_net_network_level_address_t gateway; - grub_net_tcp_socket_t socket; - static grub_uint16_t in_port = 21550; - struct grub_net_buff *nb; + VasEBoot_err_t err; + VasEBoot_net_network_level_address_t addr; + struct VasEBoot_net_network_level_interface *inf; + VasEBoot_net_network_level_address_t gateway; + VasEBoot_net_tcp_socket_t socket; + static VasEBoot_uint16_t in_port = 21550; + struct VasEBoot_net_buff *nb; struct tcphdr *tcph; int i; - grub_uint8_t *nbd; - grub_net_link_level_address_t ll_target_addr; + VasEBoot_uint8_t *nbd; + VasEBoot_net_link_level_address_t ll_target_addr; - err = grub_net_resolve_address (server, &addr); + err = VasEBoot_net_resolve_address (server, &addr); if (err) return NULL; - if (addr.type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4 - && addr.type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6) + if (addr.type != VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4 + && addr.type != VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6) { - grub_error (GRUB_ERR_BUG, "not an IP address"); + VasEBoot_error (VasEBoot_ERR_BUG, "not an IP address"); return NULL; } - err = grub_net_route_address (addr, &gateway, &inf); + err = VasEBoot_net_route_address (addr, &gateway, &inf); if (err) return NULL; - err = grub_net_link_layer_resolve (inf, &gateway, &ll_target_addr); + err = VasEBoot_net_link_layer_resolve (inf, &gateway, &ll_target_addr); if (err) return NULL; - socket = grub_zalloc (sizeof (*socket)); + socket = VasEBoot_zalloc (sizeof (*socket)); if (socket == NULL) return NULL; @@ -604,49 +604,49 @@ grub_net_tcp_open (char *server, socket->fin_hook = fin_hook; socket->hook_data = hook_data; - nb = grub_netbuff_alloc (sizeof (*tcph) + 128); + nb = VasEBoot_netbuff_alloc (sizeof (*tcph) + 128); if (!nb) { - grub_free (socket); + VasEBoot_free (socket); return NULL; } - err = grub_netbuff_reserve (nb, 128); + err = VasEBoot_netbuff_reserve (nb, 128); if (err) { - grub_free (socket); - grub_netbuff_free (nb); + VasEBoot_free (socket); + VasEBoot_netbuff_free (nb); return NULL; } - err = grub_netbuff_put (nb, sizeof (*tcph)); + err = VasEBoot_netbuff_put (nb, sizeof (*tcph)); if (err) { - grub_free (socket); - grub_netbuff_free (nb); + VasEBoot_free (socket); + VasEBoot_netbuff_free (nb); return NULL; } - socket->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); + socket->pq = VasEBoot_priority_queue_new (sizeof (struct VasEBoot_net_buff *), cmp); if (!socket->pq) { - grub_free (socket); - grub_netbuff_free (nb); + VasEBoot_free (socket); + VasEBoot_netbuff_free (nb); return NULL; } tcph = (void *) nb->data; - socket->my_start_seq = grub_get_time_ms (); + socket->my_start_seq = VasEBoot_get_time_ms (); socket->my_cur_seq = socket->my_start_seq + 1; socket->my_window = 8192; - tcph->seqnr = grub_cpu_to_be32 (socket->my_start_seq); - tcph->ack = grub_cpu_to_be32_compile_time (0); - tcph->flags = grub_cpu_to_be16_compile_time ((5 << 12) | TCP_SYN); - tcph->window = grub_cpu_to_be16 (socket->my_window); + tcph->seqnr = VasEBoot_cpu_to_be32 (socket->my_start_seq); + tcph->ack = VasEBoot_cpu_to_be32_compile_time (0); + tcph->flags = VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_SYN); + tcph->window = VasEBoot_cpu_to_be16 (socket->my_window); tcph->urgent = 0; - tcph->src = grub_cpu_to_be16 (socket->in_port); - tcph->dst = grub_cpu_to_be16 (socket->out_port); + tcph->src = VasEBoot_cpu_to_be16 (socket->in_port); + tcph->dst = VasEBoot_cpu_to_be16 (socket->out_port); tcph->checksum = 0; - tcph->checksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_TCP, + tcph->checksum = VasEBoot_net_ip_transport_checksum (nb, VasEBoot_NET_IP_TCP, &socket->inf->address, &socket->out_nla); @@ -657,84 +657,84 @@ grub_net_tcp_open (char *server, { int j; nb->data = nbd; - err = grub_net_send_ip_packet (socket->inf, &(socket->out_nla), + err = VasEBoot_net_send_ip_packet (socket->inf, &(socket->out_nla), &(socket->ll_target_addr), nb, - GRUB_NET_IP_TCP); + VasEBoot_NET_IP_TCP); if (err) { - grub_list_remove (GRUB_AS_LIST (socket)); - grub_free (socket); - grub_netbuff_free (nb); + VasEBoot_list_remove (VasEBoot_AS_LIST (socket)); + VasEBoot_free (socket); + VasEBoot_netbuff_free (nb); return NULL; } for (j = 0; (j < TCP_SYN_RETRANSMISSION_TIMEOUT / 50 && !socket->established); j++) - grub_net_poll_cards (50, &socket->established); + VasEBoot_net_poll_cards (50, &socket->established); if (socket->established) break; } if (!socket->established) { - grub_list_remove (GRUB_AS_LIST (socket)); + VasEBoot_list_remove (VasEBoot_AS_LIST (socket)); if (socket->they_reseted) - grub_error (GRUB_ERR_NET_PORT_CLOSED, + VasEBoot_error (VasEBoot_ERR_NET_PORT_CLOSED, N_("connection refused")); else - grub_error (GRUB_ERR_NET_NO_ANSWER, + VasEBoot_error (VasEBoot_ERR_NET_NO_ANSWER, N_("connection timeout")); - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); destroy_pq (socket); - grub_free (socket); + VasEBoot_free (socket); return NULL; } - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return socket; } -grub_err_t -grub_net_send_tcp_packet (const grub_net_tcp_socket_t socket, - struct grub_net_buff *nb, int push) +VasEBoot_err_t +VasEBoot_net_send_tcp_packet (const VasEBoot_net_tcp_socket_t socket, + struct VasEBoot_net_buff *nb, int push) { struct tcphdr *tcph; - grub_err_t err; - grub_ssize_t fraglen; - COMPILE_TIME_ASSERT (sizeof (struct tcphdr) == GRUB_NET_TCP_HEADER_SIZE); - if (socket->out_nla.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4) - fraglen = (socket->inf->card->mtu - GRUB_NET_OUR_IPV4_HEADER_SIZE + VasEBoot_err_t err; + VasEBoot_ssize_t fraglen; + COMPILE_TIME_ASSERT (sizeof (struct tcphdr) == VasEBoot_NET_TCP_HEADER_SIZE); + if (socket->out_nla.type == VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4) + fraglen = (socket->inf->card->mtu - VasEBoot_NET_OUR_IPV4_HEADER_SIZE - sizeof (*tcph)); else - fraglen = 1280 - GRUB_NET_OUR_IPV6_HEADER_SIZE; + fraglen = 1280 - VasEBoot_NET_OUR_IPV6_HEADER_SIZE; while (nb->tail - nb->data > fraglen) { - struct grub_net_buff *nb2; + struct VasEBoot_net_buff *nb2; - nb2 = grub_netbuff_alloc (fraglen + sizeof (*tcph) - + GRUB_NET_OUR_MAX_IP_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE); + nb2 = VasEBoot_netbuff_alloc (fraglen + sizeof (*tcph) + + VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE); if (!nb2) - return grub_errno; - err = grub_netbuff_reserve (nb2, GRUB_NET_MAX_LINK_HEADER_SIZE - + GRUB_NET_OUR_MAX_IP_HEADER_SIZE); + return VasEBoot_errno; + err = VasEBoot_netbuff_reserve (nb2, VasEBoot_NET_MAX_LINK_HEADER_SIZE + + VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE); if (err) return err; - err = grub_netbuff_put (nb2, sizeof (*tcph)); + err = VasEBoot_netbuff_put (nb2, sizeof (*tcph)); if (err) return err; tcph = (struct tcphdr *) nb2->data; - tcph->ack = grub_cpu_to_be32 (socket->their_cur_seq); - tcph->flags = grub_cpu_to_be16_compile_time ((5 << 12) | TCP_ACK); - tcph->window = !socket->i_stall ? grub_cpu_to_be16 (socket->my_window) + tcph->ack = VasEBoot_cpu_to_be32 (socket->their_cur_seq); + tcph->flags = VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_ACK); + tcph->window = !socket->i_stall ? VasEBoot_cpu_to_be16 (socket->my_window) : 0; tcph->urgent = 0; - err = grub_netbuff_put (nb2, fraglen); + err = VasEBoot_netbuff_put (nb2, fraglen); if (err) return err; - grub_memcpy (tcph + 1, nb->data, fraglen); - err = grub_netbuff_pull (nb, fraglen); + VasEBoot_memcpy (tcph + 1, nb->data, fraglen); + err = VasEBoot_netbuff_pull (nb, fraglen); if (err) return err; @@ -743,189 +743,189 @@ grub_net_send_tcp_packet (const grub_net_tcp_socket_t socket, return err; } - err = grub_netbuff_push (nb, sizeof (*tcph)); + err = VasEBoot_netbuff_push (nb, sizeof (*tcph)); if (err) return err; tcph = (struct tcphdr *) nb->data; - tcph->ack = grub_cpu_to_be32 (socket->their_cur_seq); - tcph->flags = (grub_cpu_to_be16_compile_time ((5 << 12) | TCP_ACK) - | (push ? grub_cpu_to_be16_compile_time (TCP_PUSH) : 0)); - tcph->window = !socket->i_stall ? grub_cpu_to_be16 (socket->my_window) : 0; + tcph->ack = VasEBoot_cpu_to_be32 (socket->their_cur_seq); + tcph->flags = (VasEBoot_cpu_to_be16_compile_time ((5 << 12) | TCP_ACK) + | (push ? VasEBoot_cpu_to_be16_compile_time (TCP_PUSH) : 0)); + tcph->window = !socket->i_stall ? VasEBoot_cpu_to_be16 (socket->my_window) : 0; tcph->urgent = 0; return tcp_send (nb, socket); } -grub_err_t -grub_net_recv_tcp_packet (struct grub_net_buff *nb, - struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *source) +VasEBoot_err_t +VasEBoot_net_recv_tcp_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *source) { struct tcphdr *tcph; - grub_net_tcp_socket_t sock; - grub_err_t err; + VasEBoot_net_tcp_socket_t sock; + VasEBoot_err_t err; /* Ignore broadcast. */ if (!inf) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } tcph = (struct tcphdr *) nb->data; - if ((grub_be_to_cpu16 (tcph->flags) >> 12) < 5) + if ((VasEBoot_be_to_cpu16 (tcph->flags) >> 12) < 5) { - grub_dprintf ("net", "TCP header too short: %u\n", - grub_be_to_cpu16 (tcph->flags) >> 12); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "TCP header too short: %u\n", + VasEBoot_be_to_cpu16 (tcph->flags) >> 12); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } - if (nb->tail - nb->data < (grub_ssize_t) ((grub_be_to_cpu16 (tcph->flags) - >> 12) * sizeof (grub_uint32_t))) + if (nb->tail - nb->data < (VasEBoot_ssize_t) ((VasEBoot_be_to_cpu16 (tcph->flags) + >> 12) * sizeof (VasEBoot_uint32_t))) { - grub_dprintf ("net", "TCP packet too short: %" PRIuGRUB_SIZE "\n", - (grub_size_t) (nb->tail - nb->data)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "TCP packet too short: %" PRIuVasEBoot_SIZE "\n", + (VasEBoot_size_t) (nb->tail - nb->data)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } FOR_TCP_SOCKETS (sock) { - if (!(grub_be_to_cpu16 (tcph->dst) == sock->in_port - && grub_be_to_cpu16 (tcph->src) == sock->out_port + if (!(VasEBoot_be_to_cpu16 (tcph->dst) == sock->in_port + && VasEBoot_be_to_cpu16 (tcph->src) == sock->out_port && inf == sock->inf - && grub_net_addr_cmp (source, &sock->out_nla) == 0)) + && VasEBoot_net_addr_cmp (source, &sock->out_nla) == 0)) continue; if (tcph->checksum) { - grub_uint16_t chk, expected; + VasEBoot_uint16_t chk, expected; chk = tcph->checksum; tcph->checksum = 0; - expected = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_TCP, + expected = VasEBoot_net_ip_transport_checksum (nb, VasEBoot_NET_IP_TCP, &sock->out_nla, &sock->inf->address); if (expected != chk) { - grub_dprintf ("net", "Invalid TCP checksum. " + VasEBoot_dprintf ("net", "Invalid TCP checksum. " "Expected %x, got %x\n", - grub_be_to_cpu16 (expected), - grub_be_to_cpu16 (chk)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_be_to_cpu16 (expected), + VasEBoot_be_to_cpu16 (chk)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } tcph->checksum = chk; } - if ((grub_be_to_cpu16 (tcph->flags) & TCP_SYN) - && (grub_be_to_cpu16 (tcph->flags) & TCP_ACK) + if ((VasEBoot_be_to_cpu16 (tcph->flags) & TCP_SYN) + && (VasEBoot_be_to_cpu16 (tcph->flags) & TCP_ACK) && !sock->established) { - sock->their_start_seq = grub_be_to_cpu32 (tcph->seqnr); + sock->their_start_seq = VasEBoot_be_to_cpu32 (tcph->seqnr); sock->their_cur_seq = sock->their_start_seq + 1; sock->established = 1; } - if (grub_be_to_cpu16 (tcph->flags) & TCP_RST) + if (VasEBoot_be_to_cpu16 (tcph->flags) & TCP_RST) { sock->they_reseted = 1; error (sock); - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_be_to_cpu16 (tcph->flags) & TCP_ACK) + if (VasEBoot_be_to_cpu16 (tcph->flags) & TCP_ACK) { struct unacked *unack, *next; - grub_uint32_t acked = grub_be_to_cpu32 (tcph->ack); + VasEBoot_uint32_t acked = VasEBoot_be_to_cpu32 (tcph->ack); for (unack = sock->unack_first; unack; unack = next) { - grub_uint32_t seqnr; + VasEBoot_uint32_t seqnr; struct tcphdr *unack_tcph; next = unack->next; - seqnr = grub_be_to_cpu32 (((struct tcphdr *) unack->nb->data) + seqnr = VasEBoot_be_to_cpu32 (((struct tcphdr *) unack->nb->data) ->seqnr); unack_tcph = (struct tcphdr *) unack->nb->data; seqnr += (unack->nb->tail - unack->nb->data - - (grub_be_to_cpu16 (unack_tcph->flags) >> 12) * 4); - if (grub_be_to_cpu16 (unack_tcph->flags) & TCP_FIN) + - (VasEBoot_be_to_cpu16 (unack_tcph->flags) >> 12) * 4); + if (VasEBoot_be_to_cpu16 (unack_tcph->flags) & TCP_FIN) seqnr++; if (seqnr > acked) break; - grub_netbuff_free (unack->nb); - grub_free (unack); + VasEBoot_netbuff_free (unack->nb); + VasEBoot_free (unack); } sock->unack_first = unack; if (!sock->unack_first) sock->unack_last = NULL; } - if (grub_be_to_cpu32 (tcph->seqnr) < sock->their_cur_seq) + if (VasEBoot_be_to_cpu32 (tcph->seqnr) < sock->their_cur_seq) { ack (sock); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } if (sock->i_reseted && (nb->tail - nb->data - - (grub_be_to_cpu16 (tcph->flags) - >> 12) * sizeof (grub_uint32_t)) > 0) + - (VasEBoot_be_to_cpu16 (tcph->flags) + >> 12) * sizeof (VasEBoot_uint32_t)) > 0) { reset (sock); } - err = grub_priority_queue_push (sock->pq, &nb); + err = VasEBoot_priority_queue_push (sock->pq, &nb); if (err) { - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } { - struct grub_net_buff **nb_top_p, *nb_top; + struct VasEBoot_net_buff **nb_top_p, *nb_top; int do_ack = 0; int just_closed = 0; while (1) { - nb_top_p = grub_priority_queue_top (sock->pq); + nb_top_p = VasEBoot_priority_queue_top (sock->pq); if (!nb_top_p) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; nb_top = *nb_top_p; tcph = (struct tcphdr *) nb_top->data; - if (grub_be_to_cpu32 (tcph->seqnr) >= sock->their_cur_seq) + if (VasEBoot_be_to_cpu32 (tcph->seqnr) >= sock->their_cur_seq) break; - grub_netbuff_free (nb_top); - grub_priority_queue_pop (sock->pq); + VasEBoot_netbuff_free (nb_top); + VasEBoot_priority_queue_pop (sock->pq); } - if (grub_be_to_cpu32 (tcph->seqnr) != sock->their_cur_seq) + if (VasEBoot_be_to_cpu32 (tcph->seqnr) != sock->their_cur_seq) { ack (sock); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } while (1) { - nb_top_p = grub_priority_queue_top (sock->pq); + nb_top_p = VasEBoot_priority_queue_top (sock->pq); if (!nb_top_p) break; nb_top = *nb_top_p; tcph = (struct tcphdr *) nb_top->data; - if (grub_be_to_cpu32 (tcph->seqnr) != sock->their_cur_seq) + if (VasEBoot_be_to_cpu32 (tcph->seqnr) != sock->their_cur_seq) break; - grub_priority_queue_pop (sock->pq); + VasEBoot_priority_queue_pop (sock->pq); - err = grub_netbuff_pull (nb_top, (grub_be_to_cpu16 (tcph->flags) - >> 12) * sizeof (grub_uint32_t)); + err = VasEBoot_netbuff_pull (nb_top, (VasEBoot_be_to_cpu16 (tcph->flags) + >> 12) * sizeof (VasEBoot_uint32_t)); if (err) { - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); return err; } sock->their_cur_seq += (nb_top->tail - nb_top->data); - if (grub_be_to_cpu16 (tcph->flags) & TCP_FIN) + if (VasEBoot_be_to_cpu16 (tcph->flags) & TCP_FIN) { sock->they_closed = 1; just_closed = 1; @@ -935,11 +935,11 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, /* If there is data, puts packet in socket list. */ if ((nb_top->tail - nb_top->data) > 0) { - grub_net_put_packet (&sock->packs, nb_top); + VasEBoot_net_put_packet (&sock->packs, nb_top); do_ack = 1; } else - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); } if (do_ack) ack (sock); @@ -949,60 +949,60 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, if (sock->recv_hook) sock->recv_hook (sock, sock->packs.first->nb, sock->hook_data); else - grub_netbuff_free (nb); - grub_net_remove_packet (sock->packs.first); + VasEBoot_netbuff_free (nb); + VasEBoot_net_remove_packet (sock->packs.first); } if (sock->fin_hook && just_closed) sock->fin_hook (sock, sock->hook_data); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - if (grub_be_to_cpu16 (tcph->flags) & TCP_SYN) + if (VasEBoot_be_to_cpu16 (tcph->flags) & TCP_SYN) { - grub_net_tcp_listen_t listen; + VasEBoot_net_tcp_listen_t listen; FOR_TCP_LISTENS (listen) { - if (!(grub_be_to_cpu16 (tcph->dst) == listen->port + if (!(VasEBoot_be_to_cpu16 (tcph->dst) == listen->port && (inf == listen->inf || listen->inf == NULL))) continue; - sock = grub_zalloc (sizeof (*sock)); + sock = VasEBoot_zalloc (sizeof (*sock)); if (sock == NULL) - return grub_errno; + return VasEBoot_errno; - sock->out_port = grub_be_to_cpu16 (tcph->src); - sock->in_port = grub_be_to_cpu16 (tcph->dst); + sock->out_port = VasEBoot_be_to_cpu16 (tcph->src); + sock->in_port = VasEBoot_be_to_cpu16 (tcph->dst); sock->inf = inf; sock->out_nla = *source; - sock->their_start_seq = grub_be_to_cpu32 (tcph->seqnr); + sock->their_start_seq = VasEBoot_be_to_cpu32 (tcph->seqnr); sock->their_cur_seq = sock->their_start_seq + 1; - sock->my_cur_seq = sock->my_start_seq = grub_get_time_ms (); + sock->my_cur_seq = sock->my_start_seq = VasEBoot_get_time_ms (); sock->my_window = 8192; - sock->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), + sock->pq = VasEBoot_priority_queue_new (sizeof (struct VasEBoot_net_buff *), cmp); if (!sock->pq) { - grub_free (sock); - grub_netbuff_free (nb); - return grub_errno; + VasEBoot_free (sock); + VasEBoot_netbuff_free (nb); + return VasEBoot_errno; } err = listen->listen_hook (listen, sock, listen->hook_data); - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); return err; } } - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } void -grub_net_tcp_stall (grub_net_tcp_socket_t sock) +VasEBoot_net_tcp_stall (VasEBoot_net_tcp_socket_t sock) { if (sock->i_stall) return; @@ -1011,7 +1011,7 @@ grub_net_tcp_stall (grub_net_tcp_socket_t sock) } void -grub_net_tcp_unstall (grub_net_tcp_socket_t sock) +VasEBoot_net_tcp_unstall (VasEBoot_net_tcp_socket_t sock) { if (!sock->i_stall) return; diff --git a/VasEBoot-core/net/tftp.c b/VasEBoot-core/net/tftp.c index 7d90bf66e..96fbad6d0 100644 --- a/VasEBoot-core/net/tftp.c +++ b/VasEBoot-core/net/tftp.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* IP port for the MTFTP server used for Intel's PXE */ enum @@ -76,43 +76,43 @@ enum }; struct tftphdr { - grub_uint16_t opcode; + VasEBoot_uint16_t opcode; union { - grub_int8_t rrq[TFTP_DEFAULTSIZE_PACKET]; + VasEBoot_int8_t rrq[TFTP_DEFAULTSIZE_PACKET]; struct { - grub_uint16_t block; - grub_int8_t download[0]; + VasEBoot_uint16_t block; + VasEBoot_int8_t download[0]; } data; struct { - grub_uint16_t block; + VasEBoot_uint16_t block; } ack; struct { - grub_uint16_t errcode; - grub_int8_t errmsg[TFTP_DEFAULTSIZE_PACKET]; + VasEBoot_uint16_t errcode; + VasEBoot_int8_t errmsg[TFTP_DEFAULTSIZE_PACKET]; } err; struct { - grub_int8_t data[TFTP_DEFAULTSIZE_PACKET+2]; + VasEBoot_int8_t data[TFTP_DEFAULTSIZE_PACKET+2]; } oack; } u; -} GRUB_PACKED ; +} VasEBoot_PACKED ; typedef struct tftp_data { - grub_uint64_t file_size; - grub_uint64_t block; - grub_uint32_t block_size; - grub_uint64_t ack_sent; + VasEBoot_uint64_t file_size; + VasEBoot_uint64_t block; + VasEBoot_uint32_t block_size; + VasEBoot_uint64_t ack_sent; int have_oack; - struct grub_error_saved save_err; - grub_net_udp_socket_t sock; - grub_priority_queue_t pq; + struct VasEBoot_error_saved save_err; + VasEBoot_net_udp_socket_t sock; + VasEBoot_priority_queue_t pq; } *tftp_data_t; static int -cmp_block (grub_uint16_t a, grub_uint16_t b) +cmp_block (VasEBoot_uint16_t a, VasEBoot_uint16_t b) { - grub_int16_t i = (grub_int16_t) (a - b); + VasEBoot_int16_t i = (VasEBoot_int16_t) (a - b); if (i > 0) return +1; if (i < 0) @@ -123,114 +123,114 @@ cmp_block (grub_uint16_t a, grub_uint16_t b) static int cmp (const void *a__, const void *b__) { - struct grub_net_buff *a_ = *(struct grub_net_buff **) a__; - struct grub_net_buff *b_ = *(struct grub_net_buff **) b__; + struct VasEBoot_net_buff *a_ = *(struct VasEBoot_net_buff **) a__; + struct VasEBoot_net_buff *b_ = *(struct VasEBoot_net_buff **) b__; struct tftphdr *a = (struct tftphdr *) a_->data; struct tftphdr *b = (struct tftphdr *) b_->data; /* We want the first elements to be on top. */ - return -cmp_block (grub_be_to_cpu16 (a->u.data.block), grub_be_to_cpu16 (b->u.data.block)); + return -cmp_block (VasEBoot_be_to_cpu16 (a->u.data.block), VasEBoot_be_to_cpu16 (b->u.data.block)); } -static grub_err_t -ack (tftp_data_t data, grub_uint64_t block) +static VasEBoot_err_t +ack (tftp_data_t data, VasEBoot_uint64_t block) { struct tftphdr *tftph_ack; - grub_uint8_t nbdata[512]; - struct grub_net_buff nb_ack; - grub_err_t err; + VasEBoot_uint8_t nbdata[512]; + struct VasEBoot_net_buff nb_ack; + VasEBoot_err_t err; nb_ack.head = nbdata; nb_ack.end = nbdata + sizeof (nbdata); - grub_netbuff_clear (&nb_ack); - grub_netbuff_reserve (&nb_ack, 512); - err = grub_netbuff_push (&nb_ack, sizeof (tftph_ack->opcode) + VasEBoot_netbuff_clear (&nb_ack); + VasEBoot_netbuff_reserve (&nb_ack, 512); + err = VasEBoot_netbuff_push (&nb_ack, sizeof (tftph_ack->opcode) + sizeof (tftph_ack->u.ack.block)); if (err) return err; tftph_ack = (struct tftphdr *) nb_ack.data; - tftph_ack->opcode = grub_cpu_to_be16_compile_time (TFTP_ACK); - tftph_ack->u.ack.block = grub_cpu_to_be16 (block); + tftph_ack->opcode = VasEBoot_cpu_to_be16_compile_time (TFTP_ACK); + tftph_ack->u.ack.block = VasEBoot_cpu_to_be16 (block); - err = grub_net_send_udp_packet (data->sock, &nb_ack); + err = VasEBoot_net_send_udp_packet (data->sock, &nb_ack); if (err) return err; data->ack_sent = block; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)), - struct grub_net_buff *nb, +static VasEBoot_err_t +tftp_receive (VasEBoot_net_udp_socket_t sock __attribute__ ((unused)), + struct VasEBoot_net_buff *nb, void *f) { - grub_file_t file = f; + VasEBoot_file_t file = f; struct tftphdr *tftph = (void *) nb->data; tftp_data_t data = file->data; - grub_err_t err; - grub_uint8_t *ptr; + VasEBoot_err_t err; + VasEBoot_uint8_t *ptr; - if (nb->tail - nb->data < (grub_ssize_t) sizeof (tftph->opcode)) + if (nb->tail - nb->data < (VasEBoot_ssize_t) sizeof (tftph->opcode)) { - grub_dprintf ("tftp", "TFTP packet too small\n"); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("tftp", "TFTP packet too small\n"); + return VasEBoot_ERR_NONE; } tftph = (struct tftphdr *) nb->data; - switch (grub_be_to_cpu16 (tftph->opcode)) + switch (VasEBoot_be_to_cpu16 (tftph->opcode)) { case TFTP_OACK: data->block_size = TFTP_DEFAULTSIZE_PACKET; data->have_oack = 1; for (ptr = nb->data + sizeof (tftph->opcode); ptr < nb->tail;) { - if (grub_memcmp (ptr, "tsize\0", sizeof ("tsize\0") - 1) == 0) - data->file_size = grub_strtoul ((char *) ptr + sizeof ("tsize\0") + if (VasEBoot_memcmp (ptr, "tsize\0", sizeof ("tsize\0") - 1) == 0) + data->file_size = VasEBoot_strtoul ((char *) ptr + sizeof ("tsize\0") - 1, 0, 0); - if (grub_memcmp (ptr, "blksize\0", sizeof ("blksize\0") - 1) == 0) - data->block_size = grub_strtoul ((char *) ptr + sizeof ("blksize\0") + if (VasEBoot_memcmp (ptr, "blksize\0", sizeof ("blksize\0") - 1) == 0) + data->block_size = VasEBoot_strtoul ((char *) ptr + sizeof ("blksize\0") - 1, 0, 0); while (ptr < nb->tail && *ptr) ptr++; ptr++; } data->block = 0; - grub_netbuff_free (nb); + VasEBoot_netbuff_free (nb); err = ack (data, 0); - grub_error_save (&data->save_err); - return GRUB_ERR_NONE; + VasEBoot_error_save (&data->save_err); + return VasEBoot_ERR_NONE; case TFTP_DATA: - if (nb->tail - nb->data < (grub_ssize_t) (sizeof (tftph->opcode) + if (nb->tail - nb->data < (VasEBoot_ssize_t) (sizeof (tftph->opcode) + sizeof (tftph->u.data.block))) { - grub_dprintf ("tftp", "TFTP packet too small\n"); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("tftp", "TFTP packet too small\n"); + return VasEBoot_ERR_NONE; } - err = grub_priority_queue_push (data->pq, &nb); + err = VasEBoot_priority_queue_push (data->pq, &nb); if (err) return err; { - struct grub_net_buff **nb_top_p, *nb_top; + struct VasEBoot_net_buff **nb_top_p, *nb_top; while (1) { - nb_top_p = grub_priority_queue_top (data->pq); + nb_top_p = VasEBoot_priority_queue_top (data->pq); if (!nb_top_p) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; nb_top = *nb_top_p; tftph = (struct tftphdr *) nb_top->data; - if (cmp_block (grub_be_to_cpu16 (tftph->u.data.block), data->block + 1) >= 0) + if (cmp_block (VasEBoot_be_to_cpu16 (tftph->u.data.block), data->block + 1) >= 0) break; - ack (data, grub_be_to_cpu16 (tftph->u.data.block)); - grub_netbuff_free (nb_top); - grub_priority_queue_pop (data->pq); + ack (data, VasEBoot_be_to_cpu16 (tftph->u.data.block)); + VasEBoot_netbuff_free (nb_top); + VasEBoot_priority_queue_pop (data->pq); } - while (cmp_block (grub_be_to_cpu16 (tftph->u.data.block), data->block + 1) == 0) + while (cmp_block (VasEBoot_be_to_cpu16 (tftph->u.data.block), data->block + 1) == 0) { unsigned size; - grub_priority_queue_pop (data->pq); + VasEBoot_priority_queue_pop (data->pq); if (file->device->net->packs.count < 50) err = ack (data, data->block + 1); @@ -242,7 +242,7 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)), if (err) return err; - err = grub_netbuff_pull (nb_top, sizeof (tftph->opcode) + + err = VasEBoot_netbuff_pull (nb_top, sizeof (tftph->opcode) + sizeof (tftph->u.data.block)); if (err) return err; @@ -255,7 +255,7 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)), ack (data, data->block); file->device->net->eof = 1; file->device->net->stall = 1; - grub_net_udp_close (data->sock); + VasEBoot_net_udp_close (data->sock); data->sock = NULL; } /* Prevent garbage in broken cards. Is it still necessary @@ -263,71 +263,71 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)), */ if (size > data->block_size) { - err = grub_netbuff_unput (nb_top, size - data->block_size); + err = VasEBoot_netbuff_unput (nb_top, size - data->block_size); if (err) return err; } /* If there is data, puts packet in socket list. */ if ((nb_top->tail - nb_top->data) > 0) - grub_net_put_packet (&file->device->net->packs, nb_top); + VasEBoot_net_put_packet (&file->device->net->packs, nb_top); else - grub_netbuff_free (nb_top); + VasEBoot_netbuff_free (nb_top); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; case TFTP_ERROR: data->have_oack = 1; - grub_netbuff_free (nb); - grub_error (GRUB_ERR_IO, (char *) tftph->u.err.errmsg); - grub_error_save (&data->save_err); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + VasEBoot_error (VasEBoot_ERR_IO, (char *) tftph->u.err.errmsg); + VasEBoot_error_save (&data->save_err); + return VasEBoot_ERR_NONE; default: - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } } static void destroy_pq (tftp_data_t data) { - struct grub_net_buff **nb_p; - while ((nb_p = grub_priority_queue_top (data->pq))) + struct VasEBoot_net_buff **nb_p; + while ((nb_p = VasEBoot_priority_queue_top (data->pq))) { - grub_netbuff_free (*nb_p); - grub_priority_queue_pop (data->pq); + VasEBoot_netbuff_free (*nb_p); + VasEBoot_priority_queue_pop (data->pq); } - grub_priority_queue_destroy (data->pq); + VasEBoot_priority_queue_destroy (data->pq); } -static grub_err_t -tftp_open (struct grub_file *file, const char *filename) +static VasEBoot_err_t +tftp_open (struct VasEBoot_file *file, const char *filename) { struct tftphdr *tftph; char *rrq; int i; int rrqlen; int hdrlen; - grub_uint8_t open_data[1500]; - struct grub_net_buff nb; + VasEBoot_uint8_t open_data[1500]; + struct VasEBoot_net_buff nb; tftp_data_t data; - grub_err_t err; - grub_uint8_t *nbd; - grub_net_network_level_address_t addr; + VasEBoot_err_t err; + VasEBoot_uint8_t *nbd; + VasEBoot_net_network_level_address_t addr; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) - return grub_errno; + return VasEBoot_errno; nb.head = open_data; nb.end = open_data + sizeof (open_data); - grub_netbuff_clear (&nb); + VasEBoot_netbuff_clear (&nb); - grub_netbuff_reserve (&nb, 1500); - err = grub_netbuff_push (&nb, sizeof (*tftph)); + VasEBoot_netbuff_reserve (&nb, 1500); + err = VasEBoot_netbuff_push (&nb, sizeof (*tftph)); if (err) { - grub_free (data); + VasEBoot_free (data); return err; } @@ -336,143 +336,143 @@ tftp_open (struct grub_file *file, const char *filename) rrq = (char *) tftph->u.rrq; rrqlen = 0; - tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_RRQ); - grub_strcpy (rrq, filename); - rrqlen += grub_strlen (filename) + 1; - rrq += grub_strlen (filename) + 1; + tftph->opcode = VasEBoot_cpu_to_be16_compile_time (TFTP_RRQ); + VasEBoot_strcpy (rrq, filename); + rrqlen += VasEBoot_strlen (filename) + 1; + rrq += VasEBoot_strlen (filename) + 1; - grub_strcpy (rrq, "octet"); - rrqlen += grub_strlen ("octet") + 1; - rrq += grub_strlen ("octet") + 1; + VasEBoot_strcpy (rrq, "octet"); + rrqlen += VasEBoot_strlen ("octet") + 1; + rrq += VasEBoot_strlen ("octet") + 1; - grub_strcpy (rrq, "blksize"); - rrqlen += grub_strlen ("blksize") + 1; - rrq += grub_strlen ("blksize") + 1; + VasEBoot_strcpy (rrq, "blksize"); + rrqlen += VasEBoot_strlen ("blksize") + 1; + rrq += VasEBoot_strlen ("blksize") + 1; - grub_strcpy (rrq, "1024"); - rrqlen += grub_strlen ("1024") + 1; - rrq += grub_strlen ("1024") + 1; + VasEBoot_strcpy (rrq, "1024"); + rrqlen += VasEBoot_strlen ("1024") + 1; + rrq += VasEBoot_strlen ("1024") + 1; - grub_strcpy (rrq, "tsize"); - rrqlen += grub_strlen ("tsize") + 1; - rrq += grub_strlen ("tsize") + 1; + VasEBoot_strcpy (rrq, "tsize"); + rrqlen += VasEBoot_strlen ("tsize") + 1; + rrq += VasEBoot_strlen ("tsize") + 1; - grub_strcpy (rrq, "0"); - rrqlen += grub_strlen ("0") + 1; - rrq += grub_strlen ("0") + 1; + VasEBoot_strcpy (rrq, "0"); + rrqlen += VasEBoot_strlen ("0") + 1; + rrq += VasEBoot_strlen ("0") + 1; hdrlen = sizeof (tftph->opcode) + rrqlen; - err = grub_netbuff_unput (&nb, nb.tail - (nb.data + hdrlen)); + err = VasEBoot_netbuff_unput (&nb, nb.tail - (nb.data + hdrlen)); if (err) { - grub_free (data); + VasEBoot_free (data); return err; } file->not_easily_seekable = 1; file->data = data; - data->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); + data->pq = VasEBoot_priority_queue_new (sizeof (struct VasEBoot_net_buff *), cmp); if (!data->pq) { - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } - err = grub_net_resolve_address (file->device->net->server, &addr); + err = VasEBoot_net_resolve_address (file->device->net->server, &addr); if (err) { destroy_pq (data); - grub_free (data); + VasEBoot_free (data); return err; } - data->sock = grub_net_udp_open (addr, + data->sock = VasEBoot_net_udp_open (addr, TFTP_SERVER_PORT, tftp_receive, file); if (!data->sock) { destroy_pq (data); - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } /* Receive OACK packet. */ nbd = nb.data; - for (i = 0; i < GRUB_NET_TRIES; i++) + for (i = 0; i < VasEBoot_NET_TRIES; i++) { nb.data = nbd; - err = grub_net_send_udp_packet (data->sock, &nb); + err = VasEBoot_net_send_udp_packet (data->sock, &nb); if (err) { - grub_net_udp_close (data->sock); + VasEBoot_net_udp_close (data->sock); destroy_pq (data); - grub_free (data); + VasEBoot_free (data); return err; } - grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), + VasEBoot_net_poll_cards (VasEBoot_NET_INTERVAL + (i * VasEBoot_NET_INTERVAL_ADDITION), &data->have_oack); if (data->have_oack) break; } if (!data->have_oack) - grub_error (GRUB_ERR_TIMEOUT, N_("time out opening `%s'"), filename); + VasEBoot_error (VasEBoot_ERR_TIMEOUT, N_("time out opening `%s'"), filename); else - grub_error_load (&data->save_err); - if (grub_errno) + VasEBoot_error_load (&data->save_err); + if (VasEBoot_errno) { - grub_net_udp_close (data->sock); + VasEBoot_net_udp_close (data->sock); destroy_pq (data); - grub_free (data); - return grub_errno; + VasEBoot_free (data); + return VasEBoot_errno; } file->size = data->file_size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -tftp_close (struct grub_file *file) +static VasEBoot_err_t +tftp_close (struct VasEBoot_file *file) { tftp_data_t data = file->data; if (data->sock) { - grub_uint8_t nbdata[512]; - grub_err_t err; - struct grub_net_buff nb_err; + VasEBoot_uint8_t nbdata[512]; + VasEBoot_err_t err; + struct VasEBoot_net_buff nb_err; struct tftphdr *tftph; nb_err.head = nbdata; nb_err.end = nbdata + sizeof (nbdata); - grub_netbuff_clear (&nb_err); - grub_netbuff_reserve (&nb_err, 512); - err = grub_netbuff_push (&nb_err, sizeof (tftph->opcode) + VasEBoot_netbuff_clear (&nb_err); + VasEBoot_netbuff_reserve (&nb_err, 512); + err = VasEBoot_netbuff_push (&nb_err, sizeof (tftph->opcode) + sizeof (tftph->u.err.errcode) + sizeof ("closed")); if (!err) { tftph = (struct tftphdr *) nb_err.data; - tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_ERROR); - tftph->u.err.errcode = grub_cpu_to_be16_compile_time (TFTP_EUNDEF); - grub_memcpy (tftph->u.err.errmsg, "closed", sizeof ("closed")); + tftph->opcode = VasEBoot_cpu_to_be16_compile_time (TFTP_ERROR); + tftph->u.err.errcode = VasEBoot_cpu_to_be16_compile_time (TFTP_EUNDEF); + VasEBoot_memcpy (tftph->u.err.errmsg, "closed", sizeof ("closed")); - err = grub_net_send_udp_packet (data->sock, &nb_err); + err = VasEBoot_net_send_udp_packet (data->sock, &nb_err); } if (err) - grub_print_error (); - grub_net_udp_close (data->sock); + VasEBoot_print_error (); + VasEBoot_net_udp_close (data->sock); } destroy_pq (data); - grub_free (data); - return GRUB_ERR_NONE; + VasEBoot_free (data); + return VasEBoot_ERR_NONE; } -static grub_err_t -tftp_packets_pulled (struct grub_file *file) +static VasEBoot_err_t +tftp_packets_pulled (struct VasEBoot_file *file) { tftp_data_t data = file->data; if (file->device->net->packs.count >= 50) @@ -485,7 +485,7 @@ tftp_packets_pulled (struct grub_file *file) return ack (data, data->block); } -static struct grub_net_app_protocol grub_tftp_protocol = +static struct VasEBoot_net_app_protocol VasEBoot_tftp_protocol = { .name = "tftp", .open = tftp_open, @@ -493,12 +493,12 @@ static struct grub_net_app_protocol grub_tftp_protocol = .packets_pulled = tftp_packets_pulled }; -GRUB_MOD_INIT (tftp) +VasEBoot_MOD_INIT (tftp) { - grub_net_app_level_register (&grub_tftp_protocol); + VasEBoot_net_app_level_register (&VasEBoot_tftp_protocol); } -GRUB_MOD_FINI (tftp) +VasEBoot_MOD_FINI (tftp) { - grub_net_app_level_unregister (&grub_tftp_protocol); + VasEBoot_net_app_level_unregister (&VasEBoot_tftp_protocol); } diff --git a/VasEBoot-core/net/udp.c b/VasEBoot-core/net/udp.c index df7fb95e7..327478d84 100644 --- a/VasEBoot-core/net/udp.c +++ b/VasEBoot-core/net/udp.c @@ -1,94 +1,94 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -struct grub_net_udp_socket +struct VasEBoot_net_udp_socket { - struct grub_net_udp_socket *next; - struct grub_net_udp_socket **prev; + struct VasEBoot_net_udp_socket *next; + struct VasEBoot_net_udp_socket **prev; - enum { GRUB_NET_SOCKET_START, - GRUB_NET_SOCKET_ESTABLISHED, - GRUB_NET_SOCKET_CLOSED } status; + enum { VasEBoot_NET_SOCKET_START, + VasEBoot_NET_SOCKET_ESTABLISHED, + VasEBoot_NET_SOCKET_CLOSED } status; int in_port; int out_port; - grub_err_t (*recv_hook) (grub_net_udp_socket_t sock, struct grub_net_buff *nb, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_udp_socket_t sock, struct VasEBoot_net_buff *nb, void *recv); void *recv_hook_data; - grub_net_network_level_address_t out_nla; - grub_net_link_level_address_t ll_target_addr; - struct grub_net_network_level_interface *inf; + VasEBoot_net_network_level_address_t out_nla; + VasEBoot_net_link_level_address_t ll_target_addr; + struct VasEBoot_net_network_level_interface *inf; }; -static struct grub_net_udp_socket *udp_sockets; +static struct VasEBoot_net_udp_socket *udp_sockets; #define FOR_UDP_SOCKETS(var) for (var = udp_sockets; var; var = var->next) static inline void -udp_socket_register (grub_net_udp_socket_t sock) +udp_socket_register (VasEBoot_net_udp_socket_t sock) { - grub_list_push (GRUB_AS_LIST_P (&udp_sockets), - GRUB_AS_LIST (sock)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&udp_sockets), + VasEBoot_AS_LIST (sock)); } void -grub_net_udp_close (grub_net_udp_socket_t sock) +VasEBoot_net_udp_close (VasEBoot_net_udp_socket_t sock) { - grub_list_remove (GRUB_AS_LIST (sock)); - grub_free (sock); + VasEBoot_list_remove (VasEBoot_AS_LIST (sock)); + VasEBoot_free (sock); } -grub_net_udp_socket_t -grub_net_udp_open (grub_net_network_level_address_t addr, - grub_uint16_t out_port, - grub_err_t (*recv_hook) (grub_net_udp_socket_t sock, - struct grub_net_buff *nb, +VasEBoot_net_udp_socket_t +VasEBoot_net_udp_open (VasEBoot_net_network_level_address_t addr, + VasEBoot_uint16_t out_port, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_udp_socket_t sock, + struct VasEBoot_net_buff *nb, void *data), void *recv_hook_data) { - grub_err_t err; - struct grub_net_network_level_interface *inf; - grub_net_network_level_address_t gateway; - grub_net_udp_socket_t socket; + VasEBoot_err_t err; + struct VasEBoot_net_network_level_interface *inf; + VasEBoot_net_network_level_address_t gateway; + VasEBoot_net_udp_socket_t socket; static int in_port = 25300; - grub_net_link_level_address_t ll_target_addr; + VasEBoot_net_link_level_address_t ll_target_addr; - if (addr.type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4 - && addr.type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6) + if (addr.type != VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4 + && addr.type != VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6) { - grub_error (GRUB_ERR_BUG, "not an IP address"); + VasEBoot_error (VasEBoot_ERR_BUG, "not an IP address"); return NULL; } - err = grub_net_route_address (addr, &gateway, &inf); + err = VasEBoot_net_route_address (addr, &gateway, &inf); if (err) return NULL; - err = grub_net_link_layer_resolve (inf, &gateway, &ll_target_addr); + err = VasEBoot_net_link_layer_resolve (inf, &gateway, &ll_target_addr); if (err) return NULL; - socket = grub_zalloc (sizeof (*socket)); + socket = VasEBoot_zalloc (sizeof (*socket)); if (socket == NULL) return NULL; @@ -97,7 +97,7 @@ grub_net_udp_open (grub_net_network_level_address_t addr, socket->out_nla = addr; socket->ll_target_addr = ll_target_addr; socket->in_port = in_port++; - socket->status = GRUB_NET_SOCKET_START; + socket->status = VasEBoot_NET_SOCKET_START; socket->recv_hook = recv_hook; socket->recv_hook_data = recv_hook_data; @@ -106,95 +106,95 @@ grub_net_udp_open (grub_net_network_level_address_t addr, return socket; } -grub_err_t -grub_net_send_udp_packet (const grub_net_udp_socket_t socket, - struct grub_net_buff *nb) +VasEBoot_err_t +VasEBoot_net_send_udp_packet (const VasEBoot_net_udp_socket_t socket, + struct VasEBoot_net_buff *nb) { struct udphdr *udph; - grub_err_t err; + VasEBoot_err_t err; - COMPILE_TIME_ASSERT (GRUB_NET_UDP_HEADER_SIZE == sizeof (*udph)); + COMPILE_TIME_ASSERT (VasEBoot_NET_UDP_HEADER_SIZE == sizeof (*udph)); - err = grub_netbuff_push (nb, sizeof (*udph)); + err = VasEBoot_netbuff_push (nb, sizeof (*udph)); if (err) return err; udph = (struct udphdr *) nb->data; - udph->src = grub_cpu_to_be16 (socket->in_port); - udph->dst = grub_cpu_to_be16 (socket->out_port); + udph->src = VasEBoot_cpu_to_be16 (socket->in_port); + udph->dst = VasEBoot_cpu_to_be16 (socket->out_port); udph->chksum = 0; - udph->len = grub_cpu_to_be16 (nb->tail - nb->data); + udph->len = VasEBoot_cpu_to_be16 (nb->tail - nb->data); - udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, + udph->chksum = VasEBoot_net_ip_transport_checksum (nb, VasEBoot_NET_IP_UDP, &socket->inf->address, &socket->out_nla); - return grub_net_send_ip_packet (socket->inf, &(socket->out_nla), + return VasEBoot_net_send_ip_packet (socket->inf, &(socket->out_nla), &(socket->ll_target_addr), nb, - GRUB_NET_IP_UDP); + VasEBoot_NET_IP_UDP); } -grub_err_t -grub_net_recv_udp_packet (struct grub_net_buff *nb, - struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *source) +VasEBoot_err_t +VasEBoot_net_recv_udp_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *source) { struct udphdr *udph; - grub_net_udp_socket_t sock; - grub_err_t err; + VasEBoot_net_udp_socket_t sock; + VasEBoot_err_t err; /* Ignore broadcast. */ if (!inf) { - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } udph = (struct udphdr *) nb->data; - if (nb->tail - nb->data < (grub_ssize_t) sizeof (*udph)) + if (nb->tail - nb->data < (VasEBoot_ssize_t) sizeof (*udph)) { - grub_dprintf ("net", "UDP packet too short: %" PRIuGRUB_SIZE "\n", - (grub_size_t) (nb->tail - nb->data)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_dprintf ("net", "UDP packet too short: %" PRIuVasEBoot_SIZE "\n", + (VasEBoot_size_t) (nb->tail - nb->data)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } FOR_UDP_SOCKETS (sock) { - if (grub_be_to_cpu16 (udph->dst) == sock->in_port + if (VasEBoot_be_to_cpu16 (udph->dst) == sock->in_port && inf == sock->inf - && grub_net_addr_cmp (source, &sock->out_nla) == 0 - && (sock->status == GRUB_NET_SOCKET_START - || grub_be_to_cpu16 (udph->src) == sock->out_port)) + && VasEBoot_net_addr_cmp (source, &sock->out_nla) == 0 + && (sock->status == VasEBoot_NET_SOCKET_START + || VasEBoot_be_to_cpu16 (udph->src) == sock->out_port)) { if (udph->chksum) { - grub_uint16_t chk, expected; + VasEBoot_uint16_t chk, expected; chk = udph->chksum; udph->chksum = 0; - expected = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, + expected = VasEBoot_net_ip_transport_checksum (nb, VasEBoot_NET_IP_UDP, &sock->out_nla, &sock->inf->address); if (expected != chk) { - grub_dprintf ("net", "Invalid UDP checksum. " + VasEBoot_dprintf ("net", "Invalid UDP checksum. " "Expected %x, got %x\n", - grub_be_to_cpu16 (expected), - grub_be_to_cpu16 (chk)); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_be_to_cpu16 (expected), + VasEBoot_be_to_cpu16 (chk)); + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } udph->chksum = chk; } - if (sock->status == GRUB_NET_SOCKET_START) + if (sock->status == VasEBoot_NET_SOCKET_START) { - sock->out_port = grub_be_to_cpu16 (udph->src); - sock->status = GRUB_NET_SOCKET_ESTABLISHED; + sock->out_port = VasEBoot_be_to_cpu16 (udph->src); + sock->status = VasEBoot_NET_SOCKET_ESTABLISHED; } - err = grub_netbuff_pull (nb, sizeof (*udph)); + err = VasEBoot_netbuff_pull (nb, sizeof (*udph)); if (err) return err; @@ -202,10 +202,10 @@ grub_net_recv_udp_packet (struct grub_net_buff *nb, if (sock->recv_hook) sock->recv_hook (sock, nb, sock->recv_hook_data); else - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } } - grub_netbuff_free (nb); - return GRUB_ERR_NONE; + VasEBoot_netbuff_free (nb); + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/normal/auth.c b/VasEBoot-core/normal/auth.c index 7338f8245..0041651b3 100644 --- a/VasEBoot-core/normal/auth.c +++ b/VasEBoot-core/normal/auth.c @@ -1,142 +1,142 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -struct grub_auth_user +struct VasEBoot_auth_user { - struct grub_auth_user *next; - struct grub_auth_user **prev; + struct VasEBoot_auth_user *next; + struct VasEBoot_auth_user **prev; char *name; - grub_auth_callback_t callback; + VasEBoot_auth_callback_t callback; void *arg; int authenticated; }; -static struct grub_auth_user *users = NULL; +static struct VasEBoot_auth_user *users = NULL; -grub_err_t -grub_auth_register_authentication (const char *user, - grub_auth_callback_t callback, +VasEBoot_err_t +VasEBoot_auth_register_authentication (const char *user, + VasEBoot_auth_callback_t callback, void *arg) { - struct grub_auth_user *cur; + struct VasEBoot_auth_user *cur; - cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + cur = VasEBoot_named_list_find (VasEBoot_AS_NAMED_LIST (users), user); if (!cur) - cur = grub_zalloc (sizeof (*cur)); + cur = VasEBoot_zalloc (sizeof (*cur)); if (!cur) - return grub_errno; + return VasEBoot_errno; cur->callback = callback; cur->arg = arg; if (! cur->name) { - cur->name = grub_strdup (user); + cur->name = VasEBoot_strdup (user); if (!cur->name) { - grub_free (cur); - return grub_errno; + VasEBoot_free (cur); + return VasEBoot_errno; } - grub_list_push (GRUB_AS_LIST_P (&users), GRUB_AS_LIST (cur)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&users), VasEBoot_AS_LIST (cur)); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_auth_unregister_authentication (const char *user) +VasEBoot_err_t +VasEBoot_auth_unregister_authentication (const char *user) { - struct grub_auth_user *cur; - cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + struct VasEBoot_auth_user *cur; + cur = VasEBoot_named_list_find (VasEBoot_AS_NAMED_LIST (users), user); if (!cur) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "user '%s' not found", user); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "user '%s' not found", user); if (!cur->authenticated) { - grub_free (cur->name); - grub_list_remove (GRUB_AS_LIST (cur)); - grub_free (cur); + VasEBoot_free (cur->name); + VasEBoot_list_remove (VasEBoot_AS_LIST (cur)); + VasEBoot_free (cur); } else { cur->callback = NULL; cur->arg = NULL; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_auth_authenticate (const char *user) +VasEBoot_err_t +VasEBoot_auth_authenticate (const char *user) { - struct grub_auth_user *cur; + struct VasEBoot_auth_user *cur; - cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + cur = VasEBoot_named_list_find (VasEBoot_AS_NAMED_LIST (users), user); if (!cur) - cur = grub_zalloc (sizeof (*cur)); + cur = VasEBoot_zalloc (sizeof (*cur)); if (!cur) - return grub_errno; + return VasEBoot_errno; cur->authenticated = 1; if (! cur->name) { - cur->name = grub_strdup (user); + cur->name = VasEBoot_strdup (user); if (!cur->name) { - grub_free (cur); - return grub_errno; + VasEBoot_free (cur); + return VasEBoot_errno; } - grub_list_push (GRUB_AS_LIST_P (&users), GRUB_AS_LIST (cur)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&users), VasEBoot_AS_LIST (cur)); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_auth_deauthenticate (const char *user) +VasEBoot_err_t +VasEBoot_auth_deauthenticate (const char *user) { - struct grub_auth_user *cur; - cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + struct VasEBoot_auth_user *cur; + cur = VasEBoot_named_list_find (VasEBoot_AS_NAMED_LIST (users), user); if (!cur) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "user '%s' not found", user); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "user '%s' not found", user); if (!cur->callback) { - grub_free (cur->name); - grub_list_remove (GRUB_AS_LIST (cur)); - grub_free (cur); + VasEBoot_free (cur->name); + VasEBoot_list_remove (VasEBoot_AS_LIST (cur)); + VasEBoot_free (cur); } else cur->authenticated = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int is_authenticated (const char *userlist) { const char *superusers; - struct grub_auth_user *user; + struct VasEBoot_auth_user *user; - superusers = grub_env_get ("superusers"); + superusers = VasEBoot_env_get ("superusers"); if (!superusers) return 1; @@ -146,8 +146,8 @@ is_authenticated (const char *userlist) if (!(user->authenticated)) continue; - if ((userlist && grub_strword (userlist, user->name)) - || grub_strword (superusers, user->name)) + if ((userlist && VasEBoot_strword (userlist, user->name)) + || VasEBoot_strword (superusers, user->name)) return 1; } @@ -155,14 +155,14 @@ is_authenticated (const char *userlist) } static int -grub_username_get (char buf[], unsigned buf_size) +VasEBoot_username_get (char buf[], unsigned buf_size) { unsigned cur_len = 0; int key; while (1) { - key = grub_getkey (); + key = VasEBoot_getkey (); if (key == '\n' || key == '\r') break; @@ -177,59 +177,59 @@ grub_username_get (char buf[], unsigned buf_size) if (cur_len) { cur_len--; - grub_printf ("\b \b"); + VasEBoot_printf ("\b \b"); } continue; } - if (!grub_isprint (key)) + if (!VasEBoot_isprint (key)) continue; if (cur_len + 2 < buf_size) { buf[cur_len++] = key; - grub_printf ("%c", key); + VasEBoot_printf ("%c", key); } } - grub_memset (buf + cur_len, 0, buf_size - cur_len); + VasEBoot_memset (buf + cur_len, 0, buf_size - cur_len); - grub_xputs ("\n"); - grub_refresh (); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); return (key != '\e'); } -grub_err_t -grub_auth_check_authentication (const char *userlist) +VasEBoot_err_t +VasEBoot_auth_check_authentication (const char *userlist) { char login[1024]; - struct grub_auth_user *cur = NULL; + struct VasEBoot_auth_user *cur = NULL; static unsigned long punishment_delay = 1; - char entered[GRUB_AUTH_MAX_PASSLEN]; - struct grub_auth_user *user; + char entered[VasEBoot_AUTH_MAX_PASSLEN]; + struct VasEBoot_auth_user *user; - grub_memset (login, 0, sizeof (login)); + VasEBoot_memset (login, 0, sizeof (login)); if (is_authenticated (userlist)) { punishment_delay = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - grub_puts_ (N_("Enter username: ")); + VasEBoot_puts_ (N_("Enter username: ")); - if (!grub_username_get (login, sizeof (login) - 1)) + if (!VasEBoot_username_get (login, sizeof (login) - 1)) goto access_denied; - grub_puts_ (N_("Enter password: ")); + VasEBoot_puts_ (N_("Enter password: ")); - if (!grub_password_get (entered, GRUB_AUTH_MAX_PASSLEN)) + if (!VasEBoot_password_get (entered, VasEBoot_AUTH_MAX_PASSLEN)) goto access_denied; FOR_LIST_ELEMENTS (user, users) { - if (grub_strcmp (login, user->name) == 0) + if (VasEBoot_strcmp (login, user->name) == 0) cur = user; } @@ -240,39 +240,39 @@ grub_auth_check_authentication (const char *userlist) if (is_authenticated (userlist)) { punishment_delay = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } access_denied: - grub_sleep (punishment_delay); + VasEBoot_sleep (punishment_delay); - if (punishment_delay < GRUB_ULONG_MAX / 2) + if (punishment_delay < VasEBoot_ULONG_MAX / 2) punishment_delay *= 2; - return GRUB_ACCESS_DENIED; + return VasEBoot_ACCESS_DENIED; } -static grub_err_t -grub_cmd_authenticate (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_authenticate (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { - return grub_auth_check_authentication ((argc >= 1) ? args[0] : ""); + return VasEBoot_auth_check_authentication ((argc >= 1) ? args[0] : ""); } -static grub_command_t cmd; +static VasEBoot_command_t cmd; void -grub_normal_auth_init (void) +VasEBoot_normal_auth_init (void) { - cmd = grub_register_command ("authenticate", - grub_cmd_authenticate, + cmd = VasEBoot_register_command ("authenticate", + VasEBoot_cmd_authenticate, N_("[USERLIST]"), N_("Check whether user is in USERLIST.")); } void -grub_normal_auth_fini (void) +VasEBoot_normal_auth_fini (void) { - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/normal/autofs.c b/VasEBoot-core/normal/autofs.c index 721b9c325..332f13951 100644 --- a/VasEBoot-core/normal/autofs.c +++ b/VasEBoot-core/normal/autofs.c @@ -1,63 +1,63 @@ /* autofs.c - support auto-loading from fs.lst */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* This is used to store the names of filesystem modules for auto-loading. */ -static grub_named_list_t fs_module_list; +static VasEBoot_named_list_t fs_module_list; /* The auto-loading hook for filesystems. */ static int autoload_fs_module (void) { - grub_named_list_t p; + VasEBoot_named_list_t p; int ret = 0; - grub_file_filter_t grub_file_filters_was[GRUB_FILE_FILTER_MAX]; + VasEBoot_file_filter_t VasEBoot_file_filters_was[VasEBoot_FILE_FILTER_MAX]; - grub_memcpy (grub_file_filters_was, grub_file_filters_enabled, - sizeof (grub_file_filters_enabled)); - grub_memcpy (grub_file_filters_enabled, grub_file_filters_all, - sizeof (grub_file_filters_enabled)); + VasEBoot_memcpy (VasEBoot_file_filters_was, VasEBoot_file_filters_enabled, + sizeof (VasEBoot_file_filters_enabled)); + VasEBoot_memcpy (VasEBoot_file_filters_enabled, VasEBoot_file_filters_all, + sizeof (VasEBoot_file_filters_enabled)); while ((p = fs_module_list) != NULL) { - if (! grub_dl_get (p->name) && grub_dl_load (p->name)) + if (! VasEBoot_dl_get (p->name) && VasEBoot_dl_load (p->name)) { ret = 1; break; } - if (grub_errno) - grub_print_error (); + if (VasEBoot_errno) + VasEBoot_print_error (); fs_module_list = p->next; - grub_free (p->name); - grub_free (p); + VasEBoot_free (p->name); + VasEBoot_free (p); } - grub_memcpy (grub_file_filters_enabled, grub_file_filters_was, - sizeof (grub_file_filters_enabled)); + VasEBoot_memcpy (VasEBoot_file_filters_enabled, VasEBoot_file_filters_was, + sizeof (VasEBoot_file_filters_enabled)); return ret; } @@ -70,27 +70,27 @@ read_fs_list (const char *prefix) { char *filename; - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/fs.lst", prefix); if (filename) { - grub_file_t file; - grub_fs_autoload_hook_t tmp_autoload_hook; + VasEBoot_file_t file; + VasEBoot_fs_autoload_hook_t tmp_autoload_hook; /* This rules out the possibility that read_fs_list() is invoked - recursively when we call grub_file_open() below. */ - tmp_autoload_hook = grub_fs_autoload_hook; - grub_fs_autoload_hook = NULL; + recursively when we call VasEBoot_file_open() below. */ + tmp_autoload_hook = VasEBoot_fs_autoload_hook; + VasEBoot_fs_autoload_hook = NULL; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (file) { /* Override previous fs.lst. */ while (fs_module_list) { - grub_named_list_t tmp; + VasEBoot_named_list_t tmp; tmp = fs_module_list->next; - grub_free (fs_module_list); + VasEBoot_free (fs_module_list); fs_module_list = tmp; } @@ -99,41 +99,41 @@ read_fs_list (const char *prefix) char *buf; char *p; char *q; - grub_named_list_t fs_mod; + VasEBoot_named_list_t fs_mod; - buf = grub_file_getline (file); + buf = VasEBoot_file_getline (file); if (! buf) break; p = buf; - q = buf + grub_strlen (buf) - 1; + q = buf + VasEBoot_strlen (buf) - 1; /* Ignore space. */ - while (grub_isspace (*p)) + while (VasEBoot_isspace (*p)) p++; - while (p < q && grub_isspace (*q)) + while (p < q && VasEBoot_isspace (*q)) *q-- = '\0'; /* If the line is empty, skip it. */ if (p >= q) { - grub_free (buf); + VasEBoot_free (buf); continue; } - fs_mod = grub_malloc (sizeof (*fs_mod)); + fs_mod = VasEBoot_malloc (sizeof (*fs_mod)); if (! fs_mod) { - grub_free (buf); + VasEBoot_free (buf); continue; } - fs_mod->name = grub_strdup (p); - grub_free (buf); + fs_mod->name = VasEBoot_strdup (p); + VasEBoot_free (buf); if (! fs_mod->name) { - grub_free (fs_mod); + VasEBoot_free (fs_mod); continue; } @@ -141,17 +141,17 @@ read_fs_list (const char *prefix) fs_module_list = fs_mod; } - grub_file_close (file); - grub_fs_autoload_hook = tmp_autoload_hook; + VasEBoot_file_close (file); + VasEBoot_fs_autoload_hook = tmp_autoload_hook; } - grub_free (filename); + VasEBoot_free (filename); } } /* Ignore errors. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* Set the hook. */ - grub_fs_autoload_hook = autoload_fs_module; + VasEBoot_fs_autoload_hook = autoload_fs_module; } diff --git a/VasEBoot-core/normal/charset.c b/VasEBoot-core/normal/charset.c index b0ab47d73..4dcdfb178 100644 --- a/VasEBoot-core/normal/charset.c +++ b/VasEBoot-core/normal/charset.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* @@ -42,21 +42,21 @@ Most underline diacritics aren't displayed in gfxterm */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if HAVE_FONT_SOURCE #include "widthspec.h" #endif /* Returns -2 if not enough space, -1 on invalid character. */ -grub_ssize_t -grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend, - grub_uint32_t code) +VasEBoot_ssize_t +VasEBoot_encode_utf8_character (VasEBoot_uint8_t *dest, VasEBoot_uint8_t *destend, + VasEBoot_uint32_t code) { if (dest >= destend) return -2; @@ -101,19 +101,19 @@ grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend, } /* Convert UCS-4 to UTF-8. */ -grub_size_t -grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size, - grub_uint8_t *dest, grub_size_t destsize) +VasEBoot_size_t +VasEBoot_ucs4_to_utf8 (const VasEBoot_uint32_t *src, VasEBoot_size_t size, + VasEBoot_uint8_t *dest, VasEBoot_size_t destsize) { /* Keep last char for \0. */ - grub_uint8_t *destend = dest + destsize - 1; - grub_uint8_t *dest0 = dest; + VasEBoot_uint8_t *destend = dest + destsize - 1; + VasEBoot_uint8_t *dest0 = dest; while (size-- && dest < destend) { - grub_uint32_t code = *src++; - grub_ssize_t s; - s = grub_encode_utf8_character (dest, destend, code); + VasEBoot_uint32_t code = *src++; + VasEBoot_ssize_t s; + s = VasEBoot_encode_utf8_character (dest, destend, code); if (s == -2) break; if (s == -1) @@ -129,18 +129,18 @@ grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size, /* Returns the number of bytes the string src would occupy is converted to UTF-8, excluding trailing \0. */ -grub_size_t -grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size) +VasEBoot_size_t +VasEBoot_get_num_of_utf8_bytes (const VasEBoot_uint32_t *src, VasEBoot_size_t size) { - grub_size_t remaining; - const grub_uint32_t *ptr; - grub_size_t cnt = 0; + VasEBoot_size_t remaining; + const VasEBoot_uint32_t *ptr; + VasEBoot_size_t cnt = 0; remaining = size; ptr = src; while (remaining--) { - grub_uint32_t code = *ptr++; + VasEBoot_uint32_t code = *ptr++; if (code <= 0x007F) cnt++; @@ -160,56 +160,56 @@ grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size) /* Convert UCS-4 to UTF-8. */ char * -grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size) +VasEBoot_ucs4_to_utf8_alloc (const VasEBoot_uint32_t *src, VasEBoot_size_t size) { - grub_uint8_t *ret; - grub_size_t cnt = grub_get_num_of_utf8_bytes (src, size) + 1; + VasEBoot_uint8_t *ret; + VasEBoot_size_t cnt = VasEBoot_get_num_of_utf8_bytes (src, size) + 1; - ret = grub_malloc (cnt); + ret = VasEBoot_malloc (cnt); if (!ret) return 0; - grub_ucs4_to_utf8 (src, size, ret, cnt); + VasEBoot_ucs4_to_utf8 (src, size, ret, cnt); return (char *) ret; } int -grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize) +VasEBoot_is_valid_utf8 (const VasEBoot_uint8_t *src, VasEBoot_size_t srcsize) { int count = 0; - grub_uint32_t code = 0; + VasEBoot_uint32_t code = 0; while (srcsize) { - if (srcsize != (grub_size_t)-1) + if (srcsize != (VasEBoot_size_t)-1) srcsize--; - if (!grub_utf8_process (*src++, &code, &count)) + if (!VasEBoot_utf8_process (*src++, &code, &count)) return 0; if (count != 0) continue; if (code == 0) return 1; - if (code > GRUB_UNICODE_LAST_VALID) + if (code > VasEBoot_UNICODE_LAST_VALID) return 0; } return 1; } -grub_ssize_t -grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg, - grub_uint32_t **last_position) +VasEBoot_ssize_t +VasEBoot_utf8_to_ucs4_alloc (const char *msg, VasEBoot_uint32_t **unicode_msg, + VasEBoot_uint32_t **last_position) { - grub_size_t msg_len = grub_strlen (msg); + VasEBoot_size_t msg_len = VasEBoot_strlen (msg); - *unicode_msg = grub_malloc (msg_len * sizeof (grub_uint32_t)); + *unicode_msg = VasEBoot_malloc (msg_len * sizeof (VasEBoot_uint32_t)); if (!*unicode_msg) return -1; - msg_len = grub_utf8_to_ucs4 (*unicode_msg, msg_len, - (grub_uint8_t *) msg, -1, 0); + msg_len = VasEBoot_utf8_to_ucs4 (*unicode_msg, msg_len, + (VasEBoot_uint8_t *) msg, -1, 0); if (last_position) *last_position = *unicode_msg + msg_len; @@ -223,14 +223,14 @@ grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg, at least DESTSIZE characters. If SRCEND is not NULL, then *SRCEND is set to the next byte after the last byte used in SRC. */ -grub_size_t -grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, - const grub_uint8_t *src, grub_size_t srcsize, - const grub_uint8_t **srcend) +VasEBoot_size_t +VasEBoot_utf8_to_ucs4 (VasEBoot_uint32_t *dest, VasEBoot_size_t destsize, + const VasEBoot_uint8_t *src, VasEBoot_size_t srcsize, + const VasEBoot_uint8_t **srcend) { - grub_uint32_t *p = dest; + VasEBoot_uint32_t *p = dest; int count = 0; - grub_uint32_t code = 0; + VasEBoot_uint32_t code = 0; if (srcend) *srcend = src; @@ -238,9 +238,9 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, while (srcsize && destsize) { int was_count = count; - if (srcsize != (grub_size_t)-1) + if (srcsize != (VasEBoot_size_t)-1) srcsize--; - if (!grub_utf8_process (*src++, &code, &count)) + if (!VasEBoot_utf8_process (*src++, &code, &count)) { code = '?'; count = 0; @@ -261,138 +261,138 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, return p - dest; } -static grub_uint8_t *join_types = NULL; +static VasEBoot_uint8_t *join_types = NULL; static void unpack_join (void) { unsigned i; - struct grub_unicode_compact_range *cur; + struct VasEBoot_unicode_compact_range *cur; - join_types = grub_zalloc (GRUB_UNICODE_MAX_CACHED_CHAR); + join_types = VasEBoot_zalloc (VasEBoot_UNICODE_MAX_CACHED_CHAR); if (!join_types) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) for (i = cur->start; i < cur->start + (unsigned) cur->len - && i < GRUB_UNICODE_MAX_CACHED_CHAR; i++) + && i < VasEBoot_UNICODE_MAX_CACHED_CHAR; i++) join_types[i] = cur->join_type; } -static grub_uint8_t *bidi_types = NULL; +static VasEBoot_uint8_t *bidi_types = NULL; static void unpack_bidi (void) { unsigned i; - struct grub_unicode_compact_range *cur; + struct VasEBoot_unicode_compact_range *cur; - bidi_types = grub_zalloc (GRUB_UNICODE_MAX_CACHED_CHAR); + bidi_types = VasEBoot_zalloc (VasEBoot_UNICODE_MAX_CACHED_CHAR); if (!bidi_types) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) for (i = cur->start; i < cur->start + (unsigned) cur->len - && i < GRUB_UNICODE_MAX_CACHED_CHAR; i++) + && i < VasEBoot_UNICODE_MAX_CACHED_CHAR; i++) if (cur->bidi_mirror) bidi_types[i] = cur->bidi_type | 0x80; else bidi_types[i] = cur->bidi_type | 0x00; } -static inline enum grub_bidi_type -get_bidi_type (grub_uint32_t c) +static inline enum VasEBoot_bidi_type +get_bidi_type (VasEBoot_uint32_t c) { - struct grub_unicode_compact_range *cur; + struct VasEBoot_unicode_compact_range *cur; if (!bidi_types) unpack_bidi (); - if (bidi_types && c < GRUB_UNICODE_MAX_CACHED_CHAR) + if (bidi_types && c < VasEBoot_UNICODE_MAX_CACHED_CHAR) return bidi_types[c] & 0x7f; - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) if (cur->start <= c && c < cur->start + (unsigned) cur->len) return cur->bidi_type; - return GRUB_BIDI_TYPE_L; + return VasEBoot_BIDI_TYPE_L; } -static inline enum grub_join_type -get_join_type (grub_uint32_t c) +static inline enum VasEBoot_join_type +get_join_type (VasEBoot_uint32_t c) { - struct grub_unicode_compact_range *cur; + struct VasEBoot_unicode_compact_range *cur; if (!join_types) unpack_join (); - if (join_types && c < GRUB_UNICODE_MAX_CACHED_CHAR) + if (join_types && c < VasEBoot_UNICODE_MAX_CACHED_CHAR) return join_types[c]; - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) if (cur->start <= c && c < cur->start + (unsigned) cur->len) return cur->join_type; - return GRUB_JOIN_TYPE_NONJOINING; + return VasEBoot_JOIN_TYPE_NONJOINING; } static inline int -is_mirrored (grub_uint32_t c) +is_mirrored (VasEBoot_uint32_t c) { - struct grub_unicode_compact_range *cur; + struct VasEBoot_unicode_compact_range *cur; if (!bidi_types) unpack_bidi (); - if (bidi_types && c < GRUB_UNICODE_MAX_CACHED_CHAR) + if (bidi_types && c < VasEBoot_UNICODE_MAX_CACHED_CHAR) return !!(bidi_types[c] & 0x80); - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) if (cur->start <= c && c < cur->start + (unsigned) cur->len) return cur->bidi_mirror; return 0; } -enum grub_comb_type -grub_unicode_get_comb_type (grub_uint32_t c) +enum VasEBoot_comb_type +VasEBoot_unicode_get_comb_type (VasEBoot_uint32_t c) { - static grub_uint8_t *comb_types = NULL; - struct grub_unicode_compact_range *cur; + static VasEBoot_uint8_t *comb_types = NULL; + struct VasEBoot_unicode_compact_range *cur; if (!comb_types) { unsigned i; - comb_types = grub_zalloc (GRUB_UNICODE_MAX_CACHED_CHAR); + comb_types = VasEBoot_zalloc (VasEBoot_UNICODE_MAX_CACHED_CHAR); if (comb_types) - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) for (i = cur->start; i < cur->start + (unsigned) cur->len - && i < GRUB_UNICODE_MAX_CACHED_CHAR; i++) + && i < VasEBoot_UNICODE_MAX_CACHED_CHAR; i++) comb_types[i] = cur->comb_type; else - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - if (comb_types && c < GRUB_UNICODE_MAX_CACHED_CHAR) + if (comb_types && c < VasEBoot_UNICODE_MAX_CACHED_CHAR) return comb_types[c]; - for (cur = grub_unicode_compact; cur->len; cur++) + for (cur = VasEBoot_unicode_compact; cur->len; cur++) if (cur->start <= c && c < cur->start + (unsigned) cur->len) return cur->comb_type; - return GRUB_UNICODE_COMB_NONE; + return VasEBoot_UNICODE_COMB_NONE; } #if HAVE_FONT_SOURCE -grub_size_t -grub_unicode_estimate_width (const struct grub_unicode_glyph *c) +VasEBoot_size_t +VasEBoot_unicode_estimate_width (const struct VasEBoot_unicode_glyph *c) { - if (grub_unicode_get_comb_type (c->base)) + if (VasEBoot_unicode_get_comb_type (c->base)) return 0; if (widthspec[c->base >> 3] & (1 << (c->base & 7))) return 2; @@ -403,32 +403,32 @@ grub_unicode_estimate_width (const struct grub_unicode_glyph *c) #endif static inline int -is_type_after (enum grub_comb_type a, enum grub_comb_type b) +is_type_after (enum VasEBoot_comb_type a, enum VasEBoot_comb_type b) { /* Shadda is numerically higher than most of Arabic diacritics but has to be rendered before them. */ - if (a == GRUB_UNICODE_COMB_ARABIC_SHADDA - && b <= GRUB_UNICODE_COMB_ARABIC_KASRA - && b >= GRUB_UNICODE_COMB_ARABIC_FATHATAN) + if (a == VasEBoot_UNICODE_COMB_ARABIC_SHADDA + && b <= VasEBoot_UNICODE_COMB_ARABIC_KASRA + && b >= VasEBoot_UNICODE_COMB_ARABIC_FATHATAN) return 0; - if (b == GRUB_UNICODE_COMB_ARABIC_SHADDA - && a <= GRUB_UNICODE_COMB_ARABIC_KASRA - && a >= GRUB_UNICODE_COMB_ARABIC_FATHATAN) + if (b == VasEBoot_UNICODE_COMB_ARABIC_SHADDA + && a <= VasEBoot_UNICODE_COMB_ARABIC_KASRA + && a >= VasEBoot_UNICODE_COMB_ARABIC_FATHATAN) return 1; return a > b; } -grub_size_t -grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, - struct grub_unicode_glyph *out) +VasEBoot_size_t +VasEBoot_unicode_aglomerate_comb (const VasEBoot_uint32_t *in, VasEBoot_size_t inlen, + struct VasEBoot_unicode_glyph *out) { int haveout = 0; - const grub_uint32_t *ptr; + const VasEBoot_uint32_t *ptr; unsigned last_comb_pointer = 0; - grub_memset (out, 0, sizeof (*out)); + VasEBoot_memset (out, 0, sizeof (*out)); - if (inlen && grub_iscntrl (*in)) + if (inlen && VasEBoot_iscntrl (*in)) { out->base = *in; out->variant = 0; @@ -443,58 +443,58 @@ grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, /* Variation selectors >= 17 are outside of BMP and SMP. Handle variation selectors first to avoid potentially costly lookups. */ - if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1 - && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_16) + if (*ptr >= VasEBoot_UNICODE_VARIATION_SELECTOR_1 + && *ptr <= VasEBoot_UNICODE_VARIATION_SELECTOR_16) { if (haveout) - out->variant = *ptr - GRUB_UNICODE_VARIATION_SELECTOR_1 + 1; + out->variant = *ptr - VasEBoot_UNICODE_VARIATION_SELECTOR_1 + 1; continue; } - if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17 - && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256) + if (*ptr >= VasEBoot_UNICODE_VARIATION_SELECTOR_17 + && *ptr <= VasEBoot_UNICODE_VARIATION_SELECTOR_256) { if (haveout) - out->variant = *ptr - GRUB_UNICODE_VARIATION_SELECTOR_17 + 17; + out->variant = *ptr - VasEBoot_UNICODE_VARIATION_SELECTOR_17 + 17; continue; } - enum grub_comb_type comb_type; - comb_type = grub_unicode_get_comb_type (*ptr); + enum VasEBoot_comb_type comb_type; + comb_type = VasEBoot_unicode_get_comb_type (*ptr); if (comb_type) { - struct grub_unicode_combining *n; + struct VasEBoot_unicode_combining *n; unsigned j; if (!haveout) continue; - if (comb_type == GRUB_UNICODE_COMB_MC - || comb_type == GRUB_UNICODE_COMB_ME - || comb_type == GRUB_UNICODE_COMB_MN) + if (comb_type == VasEBoot_UNICODE_COMB_MC + || comb_type == VasEBoot_UNICODE_COMB_ME + || comb_type == VasEBoot_UNICODE_COMB_MN) last_comb_pointer = out->ncomb; if (out->ncomb + 1 <= (int) ARRAY_SIZE (out->combining_inline)) n = out->combining_inline; else if (out->ncomb > (int) ARRAY_SIZE (out->combining_inline)) { - n = grub_realloc (out->combining_ptr, + n = VasEBoot_realloc (out->combining_ptr, sizeof (n[0]) * (out->ncomb + 1)); if (!n) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } out->combining_ptr = n; } else { - n = grub_malloc (sizeof (n[0]) * (out->ncomb + 1)); + n = VasEBoot_malloc (sizeof (n[0]) * (out->ncomb + 1)); if (!n) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - grub_memcpy (n, out->combining_inline, + VasEBoot_memcpy (n, out->combining_inline, sizeof (out->combining_inline)); out->combining_ptr = n; } @@ -502,7 +502,7 @@ grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, for (j = last_comb_pointer; j < out->ncomb; j++) if (is_type_after (n[j].type, comb_type)) break; - grub_memmove (n + j + 1, + VasEBoot_memmove (n + j + 1, n + j, (out->ncomb - j) * sizeof (n[0])); @@ -524,11 +524,11 @@ grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, } static void -revert (struct grub_unicode_glyph *visual, - struct grub_term_pos *pos, +revert (struct VasEBoot_unicode_glyph *visual, + struct VasEBoot_term_pos *pos, unsigned start, unsigned end) { - struct grub_unicode_glyph t; + struct VasEBoot_unicode_glyph t; unsigned i; int a = 0, b = 0; if (pos) @@ -551,37 +551,37 @@ revert (struct grub_unicode_glyph *visual, } -static grub_ssize_t -bidi_line_wrap (struct grub_unicode_glyph *visual_out, - struct grub_unicode_glyph *visual, - grub_size_t visual_len, - grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg), +static VasEBoot_ssize_t +bidi_line_wrap (struct VasEBoot_unicode_glyph *visual_out, + struct VasEBoot_unicode_glyph *visual, + VasEBoot_size_t visual_len, + VasEBoot_size_t (*getcharwidth) (const struct VasEBoot_unicode_glyph *visual, void *getcharwidth_arg), void *getcharwidth_arg, - grub_size_t maxwidth, grub_size_t startwidth, - grub_uint32_t contchar, - struct grub_term_pos *pos, int primitive_wrap, - grub_size_t log_end) + VasEBoot_size_t maxwidth, VasEBoot_size_t startwidth, + VasEBoot_uint32_t contchar, + struct VasEBoot_term_pos *pos, int primitive_wrap, + VasEBoot_size_t log_end) { - struct grub_unicode_glyph *outptr = visual_out; + struct VasEBoot_unicode_glyph *outptr = visual_out; unsigned line_start = 0; - grub_ssize_t line_width; + VasEBoot_ssize_t line_width; unsigned k; - grub_ssize_t last_space = -1; - grub_ssize_t last_space_width = 0; + VasEBoot_ssize_t last_space = -1; + VasEBoot_ssize_t last_space_width = 0; int lines = 0; if (!visual_len) return 0; - if (startwidth >= maxwidth && (grub_ssize_t) maxwidth > 0) + if (startwidth >= maxwidth && (VasEBoot_ssize_t) maxwidth > 0) { if (contchar) { - grub_memset (outptr, 0, sizeof (visual[0])); + VasEBoot_memset (outptr, 0, sizeof (visual[0])); outptr->base = contchar; outptr++; } - grub_memset (outptr, 0, sizeof (visual[0])); + VasEBoot_memset (outptr, 0, sizeof (visual[0])); outptr->base = '\n'; outptr++; startwidth = 0; @@ -591,7 +591,7 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, for (k = 0; k <= visual_len; k++) { - grub_ssize_t last_width = 0; + VasEBoot_ssize_t last_width = 0; if (pos && k != visual_len) { @@ -618,8 +618,8 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, last_space_width = line_width; } - if (((grub_ssize_t) maxwidth > 0 - && line_width > (grub_ssize_t) maxwidth) || k == visual_len) + if (((VasEBoot_ssize_t) maxwidth > 0 + && line_width > (VasEBoot_ssize_t) maxwidth) || k == visual_len) { unsigned min_odd_level = 0xffffffff; unsigned max_level = 0; @@ -677,20 +677,20 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, for (i = line_start; i < kk; i++) { if (is_mirrored (visual[i].base) && visual[i].bidi_level) - visual[i].attributes |= GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR; - if ((visual[i].attributes & GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN) + visual[i].attributes |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_MIRROR; + if ((visual[i].attributes & VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN) && visual[i].bidi_level) { int left, right; left = visual[i].attributes - & (GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED - | GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT); + & (VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT); right = visual[i].attributes - & (GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED - | GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT); - visual[i].attributes &= ~GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN; - left <<= GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT; - right >>= GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT; + & (VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT); + visual[i].attributes &= ~VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN; + left <<= VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT; + right >>= VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT; visual[i].attributes |= (left | right); } } @@ -701,25 +701,25 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, unsigned i; for (i = line_start; i < kk; i++) { - enum grub_join_type join_type = get_join_type (visual[i].base); + enum VasEBoot_join_type join_type = get_join_type (visual[i].base); if (!(visual[i].attributes - & GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT) - && (join_type == GRUB_JOIN_TYPE_LEFT - || join_type == GRUB_JOIN_TYPE_DUAL)) + & VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT) + && (join_type == VasEBoot_JOIN_TYPE_LEFT + || join_type == VasEBoot_JOIN_TYPE_DUAL)) { if (left_join) visual[i].attributes - |= GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; + |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; else visual[i].attributes - &= ~GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; + &= ~VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; } - if (join_type == GRUB_JOIN_TYPE_NONJOINING - || join_type == GRUB_JOIN_TYPE_LEFT) + if (join_type == VasEBoot_JOIN_TYPE_NONJOINING + || join_type == VasEBoot_JOIN_TYPE_LEFT) left_join = 0; - if (join_type == GRUB_JOIN_TYPE_RIGHT - || join_type == GRUB_JOIN_TYPE_DUAL - || join_type == GRUB_JOIN_TYPE_CAUSING) + if (join_type == VasEBoot_JOIN_TYPE_RIGHT + || join_type == VasEBoot_JOIN_TYPE_DUAL + || join_type == VasEBoot_JOIN_TYPE_CAUSING) left_join = 1; } } @@ -730,41 +730,41 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, for (i = kk - 1; i >= 0 && (unsigned) i + 1 > line_start; i--) { - enum grub_join_type join_type = get_join_type (visual[i].base); + enum VasEBoot_join_type join_type = get_join_type (visual[i].base); if (!(visual[i].attributes - & GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT) - && (join_type == GRUB_JOIN_TYPE_RIGHT - || join_type == GRUB_JOIN_TYPE_DUAL)) + & VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT) + && (join_type == VasEBoot_JOIN_TYPE_RIGHT + || join_type == VasEBoot_JOIN_TYPE_DUAL)) { if (right_join) visual[i].attributes - |= GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; + |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; else visual[i].attributes - &= ~GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; + &= ~VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; } - if (join_type == GRUB_JOIN_TYPE_NONJOINING - || join_type == GRUB_JOIN_TYPE_RIGHT) + if (join_type == VasEBoot_JOIN_TYPE_NONJOINING + || join_type == VasEBoot_JOIN_TYPE_RIGHT) right_join = 0; - if (join_type == GRUB_JOIN_TYPE_LEFT - || join_type == GRUB_JOIN_TYPE_DUAL - || join_type == GRUB_JOIN_TYPE_CAUSING) + if (join_type == VasEBoot_JOIN_TYPE_LEFT + || join_type == VasEBoot_JOIN_TYPE_DUAL + || join_type == VasEBoot_JOIN_TYPE_CAUSING) right_join = 1; } } - grub_memcpy (outptr, &visual[line_start], + VasEBoot_memcpy (outptr, &visual[line_start], (kk - line_start) * sizeof (visual[0])); outptr += kk - line_start; if (kk != visual_len) { if (contchar) { - grub_memset (outptr, 0, sizeof (visual[0])); + VasEBoot_memset (outptr, 0, sizeof (visual[0])); outptr->base = contchar; outptr++; } - grub_memset (outptr, 0, sizeof (visual[0])); + VasEBoot_memset (outptr, 0, sizeof (visual[0])); outptr->base = '\n'; outptr++; } @@ -785,36 +785,36 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, } -static grub_ssize_t -grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, - grub_size_t logical_len, - struct grub_unicode_glyph *visual_out, - grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg), +static VasEBoot_ssize_t +VasEBoot_bidi_line_logical_to_visual (const VasEBoot_uint32_t *logical, + VasEBoot_size_t logical_len, + struct VasEBoot_unicode_glyph *visual_out, + VasEBoot_size_t (*getcharwidth) (const struct VasEBoot_unicode_glyph *visual, void *getcharwidth_arg), void *getcharwidth_arg, - grub_size_t maxwidth, grub_size_t startwidth, - grub_uint32_t contchar, - struct grub_term_pos *pos, + VasEBoot_size_t maxwidth, VasEBoot_size_t startwidth, + VasEBoot_uint32_t contchar, + struct VasEBoot_term_pos *pos, int primitive_wrap, - grub_size_t log_end) + VasEBoot_size_t log_end) { - enum grub_bidi_type type = GRUB_BIDI_TYPE_L; + enum VasEBoot_bidi_type type = VasEBoot_BIDI_TYPE_L; enum override_status {OVERRIDE_NEUTRAL = 0, OVERRIDE_R, OVERRIDE_L}; unsigned base_level; enum override_status cur_override; unsigned i; - unsigned stack_level[GRUB_BIDI_MAX_EXPLICIT_LEVEL + 3]; - enum override_status stack_override[GRUB_BIDI_MAX_EXPLICIT_LEVEL + 3]; + unsigned stack_level[VasEBoot_BIDI_MAX_EXPLICIT_LEVEL + 3]; + enum override_status stack_override[VasEBoot_BIDI_MAX_EXPLICIT_LEVEL + 3]; unsigned stack_depth = 0; unsigned invalid_pushes = 0; unsigned visual_len = 0; unsigned run_start, run_end; - struct grub_unicode_glyph *visual; + struct VasEBoot_unicode_glyph *visual; unsigned cur_level; int bidi_needed = 0; #define push_stack(new_override, new_level) \ { \ - if (new_level > GRUB_BIDI_MAX_EXPLICIT_LEVEL) \ + if (new_level > VasEBoot_BIDI_MAX_EXPLICIT_LEVEL) \ { \ invalid_pushes++; \ } \ @@ -842,18 +842,18 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, } \ } - visual = grub_malloc (sizeof (visual[0]) * logical_len); + visual = VasEBoot_malloc (sizeof (visual[0]) * logical_len); if (!visual) return -1; for (i = 0; i < logical_len; i++) { type = get_bidi_type (logical[i]); - if (type == GRUB_BIDI_TYPE_L || type == GRUB_BIDI_TYPE_AL - || type == GRUB_BIDI_TYPE_R) + if (type == VasEBoot_BIDI_TYPE_L || type == VasEBoot_BIDI_TYPE_AL + || type == VasEBoot_BIDI_TYPE_R) break; } - if (type == GRUB_BIDI_TYPE_R || type == GRUB_BIDI_TYPE_AL) + if (type == VasEBoot_BIDI_TYPE_R || type == VasEBoot_BIDI_TYPE_AL) base_level = 1; else base_level = 0; @@ -861,20 +861,20 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, cur_level = base_level; cur_override = OVERRIDE_NEUTRAL; { - const grub_uint32_t *lptr; + const VasEBoot_uint32_t *lptr; enum {JOIN_DEFAULT, NOJOIN, JOIN_FORCE} join_state = JOIN_DEFAULT; int zwj_propagate_to_previous = 0; for (lptr = logical; lptr < logical + logical_len;) { - grub_size_t p; + VasEBoot_size_t p; - if (*lptr == GRUB_UNICODE_ZWJ) + if (*lptr == VasEBoot_UNICODE_ZWJ) { if (zwj_propagate_to_previous) { visual[visual_len - 1].attributes - |= GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT - | GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; + |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; } zwj_propagate_to_previous = 0; join_state = JOIN_FORCE; @@ -882,14 +882,14 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, continue; } - if (*lptr == GRUB_UNICODE_ZWNJ) + if (*lptr == VasEBoot_UNICODE_ZWNJ) { if (zwj_propagate_to_previous) { visual[visual_len - 1].attributes - |= GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT; + |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT; visual[visual_len - 1].attributes - &= ~GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; + &= ~VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; } zwj_propagate_to_previous = 0; join_state = NOJOIN; @@ -898,36 +898,36 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, } /* The tags: deprecated, never used. */ - if (*lptr >= GRUB_UNICODE_TAG_START && *lptr <= GRUB_UNICODE_TAG_END) + if (*lptr >= VasEBoot_UNICODE_TAG_START && *lptr <= VasEBoot_UNICODE_TAG_END) continue; - p = grub_unicode_aglomerate_comb (lptr, logical + logical_len - lptr, + p = VasEBoot_unicode_aglomerate_comb (lptr, logical + logical_len - lptr, &visual[visual_len]); visual[visual_len].orig_pos = lptr - logical; type = get_bidi_type (visual[visual_len].base); switch (type) { - case GRUB_BIDI_TYPE_RLE: + case VasEBoot_BIDI_TYPE_RLE: bidi_needed = 1; push_stack (cur_override, (cur_level | 1) + 1); break; - case GRUB_BIDI_TYPE_RLO: + case VasEBoot_BIDI_TYPE_RLO: bidi_needed = 1; push_stack (OVERRIDE_R, (cur_level | 1) + 1); break; - case GRUB_BIDI_TYPE_LRE: + case VasEBoot_BIDI_TYPE_LRE: push_stack (cur_override, (cur_level & ~1) + 2); break; - case GRUB_BIDI_TYPE_LRO: + case VasEBoot_BIDI_TYPE_LRO: push_stack (OVERRIDE_L, (cur_level & ~1) + 2); break; - case GRUB_BIDI_TYPE_PDF: + case VasEBoot_BIDI_TYPE_PDF: pop_stack (); break; - case GRUB_BIDI_TYPE_BN: + case VasEBoot_BIDI_TYPE_BN: break; - case GRUB_BIDI_TYPE_R: - case GRUB_BIDI_TYPE_AL: + case VasEBoot_BIDI_TYPE_R: + case VasEBoot_BIDI_TYPE_AL: bidi_needed = 1; /* Fallthrough. */ default: @@ -935,16 +935,16 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, if (join_state == JOIN_FORCE) { visual[visual_len].attributes - |= GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT - | GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; + |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; } if (join_state == NOJOIN) { visual[visual_len].attributes - |= GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT; + |= VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT; visual[visual_len].attributes - &= ~GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; + &= ~VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; } join_state = JOIN_DEFAULT; @@ -953,8 +953,8 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, visual[visual_len].bidi_level = cur_level; if (cur_override != OVERRIDE_NEUTRAL) visual[visual_len].bidi_type = - (cur_override == OVERRIDE_L) ? GRUB_BIDI_TYPE_L - : GRUB_BIDI_TYPE_R; + (cur_override == OVERRIDE_L) ? VasEBoot_BIDI_TYPE_L + : VasEBoot_BIDI_TYPE_R; else visual[visual_len].bidi_type = type; visual_len++; @@ -982,146 +982,146 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, next_level = visual[run_end].bidi_level; cur_run_level = visual[run_start].bidi_level; if (prev_level & 1) - last_type = GRUB_BIDI_TYPE_R; + last_type = VasEBoot_BIDI_TYPE_R; else - last_type = GRUB_BIDI_TYPE_L; + last_type = VasEBoot_BIDI_TYPE_L; last_strong_type = last_type; for (i = run_start; i < run_end; i++) { switch (visual[i].bidi_type) { - case GRUB_BIDI_TYPE_NSM: + case VasEBoot_BIDI_TYPE_NSM: visual[i].bidi_type = last_type; break; - case GRUB_BIDI_TYPE_EN: - if (last_strong_type == GRUB_BIDI_TYPE_AL) - visual[i].bidi_type = GRUB_BIDI_TYPE_AN; + case VasEBoot_BIDI_TYPE_EN: + if (last_strong_type == VasEBoot_BIDI_TYPE_AL) + visual[i].bidi_type = VasEBoot_BIDI_TYPE_AN; break; - case GRUB_BIDI_TYPE_L: - case GRUB_BIDI_TYPE_R: + case VasEBoot_BIDI_TYPE_L: + case VasEBoot_BIDI_TYPE_R: last_strong_type = visual[i].bidi_type; break; - case GRUB_BIDI_TYPE_ES: - if (last_type == GRUB_BIDI_TYPE_EN + case VasEBoot_BIDI_TYPE_ES: + if (last_type == VasEBoot_BIDI_TYPE_EN && i + 1 < run_end - && visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN) - visual[i].bidi_type = GRUB_BIDI_TYPE_EN; + && visual[i + 1].bidi_type == VasEBoot_BIDI_TYPE_EN) + visual[i].bidi_type = VasEBoot_BIDI_TYPE_EN; else - visual[i].bidi_type = GRUB_BIDI_TYPE_ON; + visual[i].bidi_type = VasEBoot_BIDI_TYPE_ON; break; - case GRUB_BIDI_TYPE_ET: + case VasEBoot_BIDI_TYPE_ET: { unsigned j; - if (last_type == GRUB_BIDI_TYPE_EN) + if (last_type == VasEBoot_BIDI_TYPE_EN) { - visual[i].bidi_type = GRUB_BIDI_TYPE_EN; + visual[i].bidi_type = VasEBoot_BIDI_TYPE_EN; break; } for (j = i; j < run_end - && visual[j].bidi_type == GRUB_BIDI_TYPE_ET; j++); - if (j != run_end && visual[j].bidi_type == GRUB_BIDI_TYPE_EN) + && visual[j].bidi_type == VasEBoot_BIDI_TYPE_ET; j++); + if (j != run_end && visual[j].bidi_type == VasEBoot_BIDI_TYPE_EN) { for (; i < run_end - && visual[i].bidi_type == GRUB_BIDI_TYPE_ET; i++) - visual[i].bidi_type = GRUB_BIDI_TYPE_EN; + && visual[i].bidi_type == VasEBoot_BIDI_TYPE_ET; i++) + visual[i].bidi_type = VasEBoot_BIDI_TYPE_EN; i--; break; } for (; i < run_end - && visual[i].bidi_type == GRUB_BIDI_TYPE_ET; i++) - visual[i].bidi_type = GRUB_BIDI_TYPE_ON; + && visual[i].bidi_type == VasEBoot_BIDI_TYPE_ET; i++) + visual[i].bidi_type = VasEBoot_BIDI_TYPE_ON; i--; break; } break; - case GRUB_BIDI_TYPE_CS: - if (last_type == GRUB_BIDI_TYPE_EN + case VasEBoot_BIDI_TYPE_CS: + if (last_type == VasEBoot_BIDI_TYPE_EN && i + 1 < run_end - && visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN) + && visual[i + 1].bidi_type == VasEBoot_BIDI_TYPE_EN) { - visual[i].bidi_type = GRUB_BIDI_TYPE_EN; + visual[i].bidi_type = VasEBoot_BIDI_TYPE_EN; break; } - if (last_type == GRUB_BIDI_TYPE_AN + if (last_type == VasEBoot_BIDI_TYPE_AN && i + 1 < run_end - && (visual[i + 1].bidi_type == GRUB_BIDI_TYPE_AN - || (visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN - && last_strong_type == GRUB_BIDI_TYPE_AL))) + && (visual[i + 1].bidi_type == VasEBoot_BIDI_TYPE_AN + || (visual[i + 1].bidi_type == VasEBoot_BIDI_TYPE_EN + && last_strong_type == VasEBoot_BIDI_TYPE_AL))) { - visual[i].bidi_type = GRUB_BIDI_TYPE_EN; + visual[i].bidi_type = VasEBoot_BIDI_TYPE_EN; break; } - visual[i].bidi_type = GRUB_BIDI_TYPE_ON; + visual[i].bidi_type = VasEBoot_BIDI_TYPE_ON; break; - case GRUB_BIDI_TYPE_AL: + case VasEBoot_BIDI_TYPE_AL: last_strong_type = visual[i].bidi_type; - visual[i].bidi_type = GRUB_BIDI_TYPE_R; + visual[i].bidi_type = VasEBoot_BIDI_TYPE_R; break; default: /* Make GCC happy. */ break; } last_type = visual[i].bidi_type; - if (visual[i].bidi_type == GRUB_BIDI_TYPE_EN - && last_strong_type == GRUB_BIDI_TYPE_L) - visual[i].bidi_type = GRUB_BIDI_TYPE_L; + if (visual[i].bidi_type == VasEBoot_BIDI_TYPE_EN + && last_strong_type == VasEBoot_BIDI_TYPE_L) + visual[i].bidi_type = VasEBoot_BIDI_TYPE_L; } if (prev_level & 1) - last_type = GRUB_BIDI_TYPE_R; + last_type = VasEBoot_BIDI_TYPE_R; else - last_type = GRUB_BIDI_TYPE_L; + last_type = VasEBoot_BIDI_TYPE_L; for (i = run_start; i < run_end; ) { unsigned j; unsigned next_type; for (j = i; j < run_end && - (visual[j].bidi_type == GRUB_BIDI_TYPE_B - || visual[j].bidi_type == GRUB_BIDI_TYPE_S - || visual[j].bidi_type == GRUB_BIDI_TYPE_WS - || visual[j].bidi_type == GRUB_BIDI_TYPE_ON); j++); + (visual[j].bidi_type == VasEBoot_BIDI_TYPE_B + || visual[j].bidi_type == VasEBoot_BIDI_TYPE_S + || visual[j].bidi_type == VasEBoot_BIDI_TYPE_WS + || visual[j].bidi_type == VasEBoot_BIDI_TYPE_ON); j++); if (j == i) { - if (visual[i].bidi_type == GRUB_BIDI_TYPE_L) - last_type = GRUB_BIDI_TYPE_L; + if (visual[i].bidi_type == VasEBoot_BIDI_TYPE_L) + last_type = VasEBoot_BIDI_TYPE_L; else - last_type = GRUB_BIDI_TYPE_R; + last_type = VasEBoot_BIDI_TYPE_R; i++; continue; } if (j == run_end) - next_type = (next_level & 1) ? GRUB_BIDI_TYPE_R : GRUB_BIDI_TYPE_L; + next_type = (next_level & 1) ? VasEBoot_BIDI_TYPE_R : VasEBoot_BIDI_TYPE_L; else { - if (visual[j].bidi_type == GRUB_BIDI_TYPE_L) - next_type = GRUB_BIDI_TYPE_L; + if (visual[j].bidi_type == VasEBoot_BIDI_TYPE_L) + next_type = VasEBoot_BIDI_TYPE_L; else - next_type = GRUB_BIDI_TYPE_R; + next_type = VasEBoot_BIDI_TYPE_R; } if (next_type == last_type) for (; i < j; i++) visual[i].bidi_type = last_type; else for (; i < j; i++) - visual[i].bidi_type = (cur_run_level & 1) ? GRUB_BIDI_TYPE_R - : GRUB_BIDI_TYPE_L; + visual[i].bidi_type = (cur_run_level & 1) ? VasEBoot_BIDI_TYPE_R + : VasEBoot_BIDI_TYPE_L; } } for (i = 0; i < visual_len; i++) { - if (!(visual[i].bidi_level & 1) && visual[i].bidi_type == GRUB_BIDI_TYPE_R) + if (!(visual[i].bidi_level & 1) && visual[i].bidi_type == VasEBoot_BIDI_TYPE_R) { visual[i].bidi_level++; continue; } - if (!(visual[i].bidi_level & 1) && (visual[i].bidi_type == GRUB_BIDI_TYPE_AN - || visual[i].bidi_type == GRUB_BIDI_TYPE_EN)) + if (!(visual[i].bidi_level & 1) && (visual[i].bidi_type == VasEBoot_BIDI_TYPE_AN + || visual[i].bidi_type == VasEBoot_BIDI_TYPE_EN)) { visual[i].bidi_level += 2; continue; } - if ((visual[i].bidi_level & 1) && (visual[i].bidi_type == GRUB_BIDI_TYPE_L - || visual[i].bidi_type == GRUB_BIDI_TYPE_AN - || visual[i].bidi_type == GRUB_BIDI_TYPE_EN)) + if ((visual[i].bidi_level & 1) && (visual[i].bidi_type == VasEBoot_BIDI_TYPE_L + || visual[i].bidi_type == VasEBoot_BIDI_TYPE_AN + || visual[i].bidi_type == VasEBoot_BIDI_TYPE_EN)) { visual[i].bidi_level++; continue; @@ -1135,37 +1135,37 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, } { - grub_ssize_t ret; + VasEBoot_ssize_t ret; ret = bidi_line_wrap (visual_out, visual, visual_len, getcharwidth, getcharwidth_arg, maxwidth, startwidth, contchar, pos, primitive_wrap, log_end); - grub_free (visual); + VasEBoot_free (visual); return ret; } } static int -is_visible (const struct grub_unicode_glyph *gl) +is_visible (const struct VasEBoot_unicode_glyph *gl) { if (gl->ncomb) return 1; - if (gl->base == GRUB_UNICODE_LRM || gl->base == GRUB_UNICODE_RLM) + if (gl->base == VasEBoot_UNICODE_LRM || gl->base == VasEBoot_UNICODE_RLM) return 0; return 1; } -grub_ssize_t -grub_bidi_logical_to_visual (const grub_uint32_t *logical, - grub_size_t logical_len, - struct grub_unicode_glyph **visual_out, - grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg), +VasEBoot_ssize_t +VasEBoot_bidi_logical_to_visual (const VasEBoot_uint32_t *logical, + VasEBoot_size_t logical_len, + struct VasEBoot_unicode_glyph **visual_out, + VasEBoot_size_t (*getcharwidth) (const struct VasEBoot_unicode_glyph *visual, void *getcharwidth_arg), void *getcharwidth_arg, - grub_size_t max_length, grub_size_t startwidth, - grub_uint32_t contchar, struct grub_term_pos *pos, int primitive_wrap) + VasEBoot_size_t max_length, VasEBoot_size_t startwidth, + VasEBoot_uint32_t contchar, struct VasEBoot_term_pos *pos, int primitive_wrap) { - const grub_uint32_t *line_start = logical, *ptr; - struct grub_unicode_glyph *visual_ptr; - *visual_out = visual_ptr = grub_malloc (3 * sizeof (visual_ptr[0]) + const VasEBoot_uint32_t *line_start = logical, *ptr; + struct VasEBoot_unicode_glyph *visual_ptr; + *visual_out = visual_ptr = VasEBoot_malloc (3 * sizeof (visual_ptr[0]) * (logical_len + 2)); if (!visual_ptr) return -1; @@ -1173,9 +1173,9 @@ grub_bidi_logical_to_visual (const grub_uint32_t *logical, { if (ptr == logical + logical_len || *ptr == '\n') { - grub_ssize_t ret; - grub_ssize_t i, j; - ret = grub_bidi_line_logical_to_visual (line_start, + VasEBoot_ssize_t ret; + VasEBoot_ssize_t i, j; + ret = VasEBoot_bidi_line_logical_to_visual (line_start, ptr - line_start, visual_ptr, getcharwidth, @@ -1190,7 +1190,7 @@ grub_bidi_logical_to_visual (const grub_uint32_t *logical, if (ret < 0) { - grub_free (*visual_out); + VasEBoot_free (*visual_out); return ret; } for (i = 0, j = 0; i < ret; i++) @@ -1200,7 +1200,7 @@ grub_bidi_logical_to_visual (const grub_uint32_t *logical, line_start = ptr; if (ptr != logical + logical_len) { - grub_memset (visual_ptr, 0, sizeof (visual_ptr[0])); + VasEBoot_memset (visual_ptr, 0, sizeof (visual_ptr[0])); visual_ptr->base = '\n'; visual_ptr++; line_start++; @@ -1210,43 +1210,43 @@ grub_bidi_logical_to_visual (const grub_uint32_t *logical, return visual_ptr - *visual_out; } -grub_uint32_t -grub_unicode_mirror_code (grub_uint32_t in) +VasEBoot_uint32_t +VasEBoot_unicode_mirror_code (VasEBoot_uint32_t in) { int i; - for (i = 0; grub_unicode_bidi_pairs[i].key; i++) - if (grub_unicode_bidi_pairs[i].key == in) - return grub_unicode_bidi_pairs[i].replace; + for (i = 0; VasEBoot_unicode_bidi_pairs[i].key; i++) + if (VasEBoot_unicode_bidi_pairs[i].key == in) + return VasEBoot_unicode_bidi_pairs[i].replace; return in; } -grub_uint32_t -grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr) +VasEBoot_uint32_t +VasEBoot_unicode_shape_code (VasEBoot_uint32_t in, VasEBoot_uint8_t attr) { int i; - if (!(in >= GRUB_UNICODE_ARABIC_START - && in < GRUB_UNICODE_ARABIC_END)) + if (!(in >= VasEBoot_UNICODE_ARABIC_START + && in < VasEBoot_UNICODE_ARABIC_END)) return in; - for (i = 0; grub_unicode_arabic_shapes[i].code; i++) - if (grub_unicode_arabic_shapes[i].code == in) + for (i = 0; VasEBoot_unicode_arabic_shapes[i].code; i++) + if (VasEBoot_unicode_arabic_shapes[i].code == in) { - grub_uint32_t out = 0; - switch (attr & (GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED - | GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED)) + VasEBoot_uint32_t out = 0; + switch (attr & (VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED)) { case 0: - out = grub_unicode_arabic_shapes[i].isolated; + out = VasEBoot_unicode_arabic_shapes[i].isolated; break; - case GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED: - out = grub_unicode_arabic_shapes[i].right_linked; + case VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED: + out = VasEBoot_unicode_arabic_shapes[i].right_linked; break; - case GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED: - out = grub_unicode_arabic_shapes[i].left_linked; + case VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED: + out = VasEBoot_unicode_arabic_shapes[i].left_linked; break; - case GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED - |GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED: - out = grub_unicode_arabic_shapes[i].both_linked; + case VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED + |VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED: + out = VasEBoot_unicode_arabic_shapes[i].both_linked; break; } if (out) @@ -1256,23 +1256,23 @@ grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr) return in; } -const grub_uint32_t * -grub_unicode_get_comb_start (const grub_uint32_t *str, - const grub_uint32_t *cur) +const VasEBoot_uint32_t * +VasEBoot_unicode_get_comb_start (const VasEBoot_uint32_t *str, + const VasEBoot_uint32_t *cur) { - const grub_uint32_t *ptr; + const VasEBoot_uint32_t *ptr; for (ptr = cur; ptr >= str; ptr--) { - if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1 - && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_16) + if (*ptr >= VasEBoot_UNICODE_VARIATION_SELECTOR_1 + && *ptr <= VasEBoot_UNICODE_VARIATION_SELECTOR_16) continue; - if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17 - && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256) + if (*ptr >= VasEBoot_UNICODE_VARIATION_SELECTOR_17 + && *ptr <= VasEBoot_UNICODE_VARIATION_SELECTOR_256) continue; - enum grub_comb_type comb_type; - comb_type = grub_unicode_get_comb_type (*ptr); + enum VasEBoot_comb_type comb_type; + comb_type = VasEBoot_unicode_get_comb_type (*ptr); if (comb_type) continue; return ptr; @@ -1280,23 +1280,23 @@ grub_unicode_get_comb_start (const grub_uint32_t *str, return str; } -const grub_uint32_t * -grub_unicode_get_comb_end (const grub_uint32_t *end, - const grub_uint32_t *cur) +const VasEBoot_uint32_t * +VasEBoot_unicode_get_comb_end (const VasEBoot_uint32_t *end, + const VasEBoot_uint32_t *cur) { - const grub_uint32_t *ptr; + const VasEBoot_uint32_t *ptr; for (ptr = cur; ptr < end; ptr++) { - if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1 - && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_16) + if (*ptr >= VasEBoot_UNICODE_VARIATION_SELECTOR_1 + && *ptr <= VasEBoot_UNICODE_VARIATION_SELECTOR_16) continue; - if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17 - && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256) + if (*ptr >= VasEBoot_UNICODE_VARIATION_SELECTOR_17 + && *ptr <= VasEBoot_UNICODE_VARIATION_SELECTOR_256) continue; - enum grub_comb_type comb_type; - comb_type = grub_unicode_get_comb_type (*ptr); + enum VasEBoot_comb_type comb_type; + comb_type = VasEBoot_unicode_get_comb_type (*ptr); if (comb_type) continue; return ptr; diff --git a/VasEBoot-core/normal/cmdline.c b/VasEBoot-core/normal/cmdline.c index a36180d75..d32e0b7b6 100644 --- a/VasEBoot-core/normal/cmdline.c +++ b/VasEBoot-core/normal/cmdline.c @@ -1,47 +1,47 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_uint32_t *kill_buf; +static VasEBoot_uint32_t *kill_buf; static int hist_size; -static grub_uint32_t **hist_lines = 0; +static VasEBoot_uint32_t **hist_lines = 0; static int hist_pos = 0; static int hist_end = 0; static int hist_used = 0; -grub_err_t -grub_set_history (int newsize) +VasEBoot_err_t +VasEBoot_set_history (int newsize) { - grub_uint32_t **old_hist_lines = hist_lines; - hist_lines = grub_malloc (sizeof (grub_uint32_t *) * newsize); + VasEBoot_uint32_t **old_hist_lines = hist_lines; + hist_lines = VasEBoot_malloc (sizeof (VasEBoot_uint32_t *) * newsize); /* Copy the old lines into the new buffer. */ if (old_hist_lines) @@ -49,16 +49,16 @@ grub_set_history (int newsize) /* Remove the lines that don't fit in the new buffer. */ if (newsize < hist_used) { - grub_size_t i; - grub_size_t delsize = hist_used - newsize; + VasEBoot_size_t i; + VasEBoot_size_t delsize = hist_used - newsize; hist_used = newsize; for (i = 1; i < delsize + 1; i++) { - grub_ssize_t pos = hist_end - i; + VasEBoot_ssize_t pos = hist_end - i; if (pos < 0) pos += hist_size; - grub_free (old_hist_lines[pos]); + VasEBoot_free (old_hist_lines[pos]); } hist_end -= delsize; @@ -67,21 +67,21 @@ grub_set_history (int newsize) } if (hist_pos < hist_end) - grub_memmove (hist_lines, old_hist_lines + hist_pos, - (hist_end - hist_pos) * sizeof (grub_uint32_t *)); + VasEBoot_memmove (hist_lines, old_hist_lines + hist_pos, + (hist_end - hist_pos) * sizeof (VasEBoot_uint32_t *)); else if (hist_used) { /* Copy the older part. */ - grub_memmove (hist_lines, old_hist_lines + hist_pos, - (hist_size - hist_pos) * sizeof (grub_uint32_t *)); + VasEBoot_memmove (hist_lines, old_hist_lines + hist_pos, + (hist_size - hist_pos) * sizeof (VasEBoot_uint32_t *)); /* Copy the newer part. */ - grub_memmove (hist_lines + hist_size - hist_pos, old_hist_lines, - hist_end * sizeof (grub_uint32_t *)); + VasEBoot_memmove (hist_lines + hist_size - hist_pos, old_hist_lines, + hist_end * sizeof (VasEBoot_uint32_t *)); } } - grub_free (old_hist_lines); + VasEBoot_free (old_hist_lines); hist_size = newsize; hist_pos = 0; @@ -91,17 +91,17 @@ grub_set_history (int newsize) /* Get the entry POS from the history where `0' is the newest entry. */ -static grub_uint32_t * -grub_history_get (unsigned pos) +static VasEBoot_uint32_t * +VasEBoot_history_get (unsigned pos) { pos = (hist_pos + pos) % hist_size; return hist_lines[pos]; } -static grub_size_t -strlen_ucs4 (const grub_uint32_t *s) +static VasEBoot_size_t +strlen_ucs4 (const VasEBoot_uint32_t *s) { - const grub_uint32_t *p = s; + const VasEBoot_uint32_t *p = s; while (*p) p++; @@ -111,23 +111,23 @@ strlen_ucs4 (const grub_uint32_t *s) /* Replace the history entry on position POS with the string S. */ static void -grub_history_set (int pos, grub_uint32_t *s, grub_size_t len) +VasEBoot_history_set (int pos, VasEBoot_uint32_t *s, VasEBoot_size_t len) { - grub_free (hist_lines[pos]); - hist_lines[pos] = grub_malloc ((len + 1) * sizeof (grub_uint32_t)); + VasEBoot_free (hist_lines[pos]); + hist_lines[pos] = VasEBoot_malloc ((len + 1) * sizeof (VasEBoot_uint32_t)); if (!hist_lines[pos]) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return ; } - grub_memcpy (hist_lines[pos], s, len * sizeof (grub_uint32_t)); + VasEBoot_memcpy (hist_lines[pos], s, len * sizeof (VasEBoot_uint32_t)); hist_lines[pos][len] = 0; } /* Insert a new history line S on the top of the history. */ static void -grub_history_add (grub_uint32_t *s, grub_size_t len) +VasEBoot_history_add (VasEBoot_uint32_t *s, VasEBoot_size_t len) { /* Remove the oldest entry in the history to make room for a new entry. */ @@ -137,7 +137,7 @@ grub_history_add (grub_uint32_t *s, grub_size_t len) if (hist_end < 0) hist_end = hist_size + hist_end; - grub_free (hist_lines[hist_end]); + VasEBoot_free (hist_lines[hist_end]); } else hist_used++; @@ -149,81 +149,81 @@ grub_history_add (grub_uint32_t *s, grub_size_t len) /* Insert into history. */ hist_lines[hist_pos] = NULL; - grub_history_set (hist_pos, s, len); + VasEBoot_history_set (hist_pos, s, len); } /* Replace the history entry on position POS with the string S. */ static void -grub_history_replace (unsigned pos, grub_uint32_t *s, grub_size_t len) +VasEBoot_history_replace (unsigned pos, VasEBoot_uint32_t *s, VasEBoot_size_t len) { - grub_history_set ((hist_pos + pos) % hist_size, s, len); + VasEBoot_history_set ((hist_pos + pos) % hist_size, s, len); } /* A completion hook to print items. */ static void -print_completion (const char *item, grub_completion_type_t type, int count) +print_completion (const char *item, VasEBoot_completion_type_t type, int count) { if (count == 0) { /* If this is the first time, print a label. */ - grub_puts (""); + VasEBoot_puts (""); switch (type) { - case GRUB_COMPLETION_TYPE_COMMAND: - grub_puts_ (N_("Possible commands are:")); + case VasEBoot_COMPLETION_TYPE_COMMAND: + VasEBoot_puts_ (N_("Possible commands are:")); break; - case GRUB_COMPLETION_TYPE_DEVICE: - grub_puts_ (N_("Possible devices are:")); + case VasEBoot_COMPLETION_TYPE_DEVICE: + VasEBoot_puts_ (N_("Possible devices are:")); break; - case GRUB_COMPLETION_TYPE_FILE: - grub_puts_ (N_("Possible files are:")); + case VasEBoot_COMPLETION_TYPE_FILE: + VasEBoot_puts_ (N_("Possible files are:")); break; - case GRUB_COMPLETION_TYPE_PARTITION: - grub_puts_ (N_("Possible partitions are:")); + case VasEBoot_COMPLETION_TYPE_PARTITION: + VasEBoot_puts_ (N_("Possible partitions are:")); break; - case GRUB_COMPLETION_TYPE_ARGUMENT: - grub_puts_ (N_("Possible arguments are:")); + case VasEBoot_COMPLETION_TYPE_ARGUMENT: + VasEBoot_puts_ (N_("Possible arguments are:")); break; default: /* TRANSLATORS: this message is used if none of above matches. This shouldn't happen but please use the general term for "thing" or "object". */ - grub_puts_ (N_("Possible things are:")); + VasEBoot_puts_ (N_("Possible things are:")); break; } - grub_puts (""); + VasEBoot_puts (""); } - if (type == GRUB_COMPLETION_TYPE_PARTITION) + if (type == VasEBoot_COMPLETION_TYPE_PARTITION) { - grub_normal_print_device_info (item); - grub_errno = GRUB_ERR_NONE; + VasEBoot_normal_print_device_info (item); + VasEBoot_errno = VasEBoot_ERR_NONE; } else - grub_printf (" %s", item); + VasEBoot_printf (" %s", item); } struct cmdline_term { - struct grub_term_coordinate pos; + struct VasEBoot_term_coordinate pos; unsigned ystart, width, height; unsigned prompt_len; - struct grub_term_output *term; + struct VasEBoot_term_output *term; }; static inline void -cl_set_pos (struct cmdline_term *cl_term, grub_size_t lpos) +cl_set_pos (struct cmdline_term *cl_term, VasEBoot_size_t lpos) { cl_term->pos.x = (cl_term->prompt_len + lpos) % cl_term->width; cl_term->pos.y = cl_term->ystart + (cl_term->prompt_len + lpos) / cl_term->width; - grub_term_gotoxy (cl_term->term, cl_term->pos); + VasEBoot_term_gotoxy (cl_term->term, cl_term->pos); } static void cl_set_pos_all (struct cmdline_term *cl_terms, unsigned nterms, - grub_size_t lpos) + VasEBoot_size_t lpos) { unsigned i; for (i = 0; i < nterms; i++) @@ -231,17 +231,17 @@ cl_set_pos_all (struct cmdline_term *cl_terms, unsigned nterms, } static inline void __attribute__ ((always_inline)) -cl_print (struct cmdline_term *cl_term, grub_uint32_t c, - grub_uint32_t *start, grub_uint32_t *end) +cl_print (struct cmdline_term *cl_term, VasEBoot_uint32_t c, + VasEBoot_uint32_t *start, VasEBoot_uint32_t *end) { - grub_uint32_t *p; + VasEBoot_uint32_t *p; for (p = start; p < end; p++) { if (c) - grub_putcode (c, cl_term->term); + VasEBoot_putcode (c, cl_term->term); else - grub_putcode (*p, cl_term->term); + VasEBoot_putcode (*p, cl_term->term); cl_term->pos.x++; if (cl_term->pos.x >= cl_term->width - 1) { @@ -250,14 +250,14 @@ cl_print (struct cmdline_term *cl_term, grub_uint32_t c, cl_term->ystart--; else cl_term->pos.y++; - grub_putcode ('\n', cl_term->term); + VasEBoot_putcode ('\n', cl_term->term); } } } static void cl_print_all (struct cmdline_term *cl_terms, unsigned nterms, - grub_uint32_t c, grub_uint32_t *start, grub_uint32_t *end) + VasEBoot_uint32_t c, VasEBoot_uint32_t *start, VasEBoot_uint32_t *end) { unsigned i; for (i = 0; i < nterms; i++) @@ -268,17 +268,17 @@ static void init_clterm (struct cmdline_term *cl_term_cur) { cl_term_cur->pos.x = cl_term_cur->prompt_len; - cl_term_cur->pos.y = grub_term_getxy (cl_term_cur->term).y; + cl_term_cur->pos.y = VasEBoot_term_getxy (cl_term_cur->term).y; cl_term_cur->ystart = cl_term_cur->pos.y; - cl_term_cur->width = grub_term_width (cl_term_cur->term); - cl_term_cur->height = grub_term_height (cl_term_cur->term); + cl_term_cur->width = VasEBoot_term_width (cl_term_cur->term); + cl_term_cur->height = VasEBoot_term_height (cl_term_cur->term); } static void cl_delete (struct cmdline_term *cl_terms, unsigned nterms, - grub_uint32_t *buf, - grub_size_t lpos, grub_size_t *llen, unsigned len) + VasEBoot_uint32_t *buf, + VasEBoot_size_t lpos, VasEBoot_size_t *llen, unsigned len) { if (lpos + len <= (*llen)) { @@ -287,8 +287,8 @@ cl_delete (struct cmdline_term *cl_terms, unsigned nterms, cl_set_pos_all (cl_terms, nterms, lpos); - grub_memmove (buf + lpos, buf + lpos + len, - sizeof (grub_uint32_t) * ((*llen) - lpos + 1)); + VasEBoot_memmove (buf + lpos, buf + lpos + len, + sizeof (VasEBoot_uint32_t) * ((*llen) - lpos + 1)); (*llen) -= len; cl_print_all (cl_terms, nterms, 0, buf + lpos, buf + (*llen)); cl_set_pos_all (cl_terms, nterms, lpos); @@ -298,32 +298,32 @@ cl_delete (struct cmdline_term *cl_terms, unsigned nterms, static void cl_insert (struct cmdline_term *cl_terms, unsigned nterms, - grub_size_t *lpos, grub_size_t *llen, - grub_size_t *max_len, grub_uint32_t **buf, - const grub_uint32_t *str) + VasEBoot_size_t *lpos, VasEBoot_size_t *llen, + VasEBoot_size_t *max_len, VasEBoot_uint32_t **buf, + const VasEBoot_uint32_t *str) { - grub_size_t len = strlen_ucs4 (str); + VasEBoot_size_t len = strlen_ucs4 (str); if (len + (*llen) >= (*max_len)) { - grub_uint32_t *nbuf; + VasEBoot_uint32_t *nbuf; (*max_len) *= 2; - nbuf = grub_realloc ((*buf), sizeof (grub_uint32_t) * (*max_len)); + nbuf = VasEBoot_realloc ((*buf), sizeof (VasEBoot_uint32_t) * (*max_len)); if (nbuf) (*buf) = nbuf; else { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; (*max_len) /= 2; } } if (len + (*llen) < (*max_len)) { - grub_memmove ((*buf) + (*lpos) + len, (*buf) + (*lpos), - ((*llen) - (*lpos) + 1) * sizeof (grub_uint32_t)); - grub_memmove ((*buf) + (*lpos), str, len * sizeof (grub_uint32_t)); + VasEBoot_memmove ((*buf) + (*lpos) + len, (*buf) + (*lpos), + ((*llen) - (*lpos) + 1) * sizeof (VasEBoot_uint32_t)); + VasEBoot_memmove ((*buf) + (*lpos), str, len * sizeof (VasEBoot_uint32_t)); (*llen) += len; cl_set_pos_all (cl_terms, nterms, (*lpos)); @@ -338,18 +338,18 @@ cl_insert (struct cmdline_term *cl_terms, unsigned nterms, otherwise return command line. */ /* FIXME: The dumb interface is not supported yet. */ char * -grub_cmdline_get (const char *prompt_translated) +VasEBoot_cmdline_get (const char *prompt_translated) { - grub_size_t lpos, llen; - grub_uint32_t *buf; - grub_size_t max_len = 256; + VasEBoot_size_t lpos, llen; + VasEBoot_uint32_t *buf; + VasEBoot_size_t max_len = 256; int key; int histpos = 0; struct cmdline_term *cl_terms; char *ret; unsigned nterms; - buf = grub_malloc (max_len * sizeof (grub_uint32_t)); + buf = VasEBoot_malloc (max_len * sizeof (VasEBoot_uint32_t)); if (!buf) return 0; @@ -357,74 +357,74 @@ grub_cmdline_get (const char *prompt_translated) buf[0] = '\0'; { - grub_term_output_t term; + VasEBoot_term_output_t term; FOR_ACTIVE_TERM_OUTPUTS(term) - if ((grub_term_getxy (term).x) != 0) - grub_putcode ('\n', term); + if ((VasEBoot_term_getxy (term).x) != 0) + VasEBoot_putcode ('\n', term); } - grub_xputs (prompt_translated); - grub_xputs (" "); - grub_normal_reset_more (); + VasEBoot_xputs (prompt_translated); + VasEBoot_xputs (" "); + VasEBoot_normal_reset_more (); { struct cmdline_term *cl_term_cur; - struct grub_term_output *cur; - grub_uint32_t *unicode_msg; - grub_size_t msg_len = grub_strlen (prompt_translated) + 3; + struct VasEBoot_term_output *cur; + VasEBoot_uint32_t *unicode_msg; + VasEBoot_size_t msg_len = VasEBoot_strlen (prompt_translated) + 3; nterms = 0; FOR_ACTIVE_TERM_OUTPUTS(cur) nterms++; - cl_terms = grub_malloc (sizeof (cl_terms[0]) * nterms); + cl_terms = VasEBoot_malloc (sizeof (cl_terms[0]) * nterms); if (!cl_terms) { - grub_free (buf); + VasEBoot_free (buf); return 0; } cl_term_cur = cl_terms; - unicode_msg = grub_malloc (msg_len * sizeof (grub_uint32_t)); + unicode_msg = VasEBoot_malloc (msg_len * sizeof (VasEBoot_uint32_t)); if (!unicode_msg) { - grub_free (buf); - grub_free (cl_terms); + VasEBoot_free (buf); + VasEBoot_free (cl_terms); return 0; } - msg_len = grub_utf8_to_ucs4 (unicode_msg, msg_len - 1, - (grub_uint8_t *) prompt_translated, -1, 0); + msg_len = VasEBoot_utf8_to_ucs4 (unicode_msg, msg_len - 1, + (VasEBoot_uint8_t *) prompt_translated, -1, 0); unicode_msg[msg_len++] = ' '; FOR_ACTIVE_TERM_OUTPUTS(cur) { cl_term_cur->term = cur; - cl_term_cur->prompt_len = grub_getstringwidth (unicode_msg, + cl_term_cur->prompt_len = VasEBoot_getstringwidth (unicode_msg, unicode_msg + msg_len, cur); init_clterm (cl_term_cur); cl_term_cur++; } - grub_free (unicode_msg); + VasEBoot_free (unicode_msg); } if (hist_used == 0) - grub_history_add (buf, llen); + VasEBoot_history_add (buf, llen); - grub_refresh (); + VasEBoot_refresh (); - while ((key = grub_getkey ()) != '\n' && key != '\r') + while ((key = VasEBoot_getkey ()) != '\n' && key != '\r') { switch (key) { - case GRUB_TERM_CTRL | 'a': - case GRUB_TERM_KEY_HOME: + case VasEBoot_TERM_CTRL | 'a': + case VasEBoot_TERM_KEY_HOME: lpos = 0; cl_set_pos_all (cl_terms, nterms, lpos); break; - case GRUB_TERM_CTRL | 'b': - case GRUB_TERM_KEY_LEFT: + case VasEBoot_TERM_CTRL | 'b': + case VasEBoot_TERM_KEY_LEFT: if (lpos > 0) { lpos--; @@ -432,14 +432,14 @@ grub_cmdline_get (const char *prompt_translated) } break; - case GRUB_TERM_CTRL | 'e': - case GRUB_TERM_KEY_END: + case VasEBoot_TERM_CTRL | 'e': + case VasEBoot_TERM_KEY_END: lpos = llen; cl_set_pos_all (cl_terms, nterms, lpos); break; - case GRUB_TERM_CTRL | 'f': - case GRUB_TERM_KEY_RIGHT: + case VasEBoot_TERM_CTRL | 'f': + case VasEBoot_TERM_KEY_RIGHT: if (lpos < llen) { lpos++; @@ -447,40 +447,40 @@ grub_cmdline_get (const char *prompt_translated) } break; - case GRUB_TERM_CTRL | 'i': + case VasEBoot_TERM_CTRL | 'i': case '\t': { int restore; char *insertu8; char *bufu8; - grub_uint32_t c; + VasEBoot_uint32_t c; c = buf[lpos]; buf[lpos] = '\0'; - bufu8 = grub_ucs4_to_utf8_alloc (buf, lpos); + bufu8 = VasEBoot_ucs4_to_utf8_alloc (buf, lpos); buf[lpos] = c; if (!bufu8) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; break; } - insertu8 = grub_normal_do_completion (bufu8, &restore, + insertu8 = VasEBoot_normal_do_completion (bufu8, &restore, print_completion); - grub_free (bufu8); + VasEBoot_free (bufu8); - grub_normal_reset_more (); + VasEBoot_normal_reset_more (); if (restore) { unsigned i; /* Restore the prompt. */ - grub_xputs ("\n"); - grub_xputs (prompt_translated); - grub_xputs (" "); + VasEBoot_xputs ("\n"); + VasEBoot_xputs (prompt_translated); + VasEBoot_xputs (" "); for (i = 0; i < nterms; i++) init_clterm (&cl_terms[i]); @@ -490,21 +490,21 @@ grub_cmdline_get (const char *prompt_translated) if (insertu8) { - grub_size_t insertlen; - grub_ssize_t t; - grub_uint32_t *insert; + VasEBoot_size_t insertlen; + VasEBoot_ssize_t t; + VasEBoot_uint32_t *insert; - insertlen = grub_strlen (insertu8); - insert = grub_malloc ((insertlen + 1) * sizeof (grub_uint32_t)); + insertlen = VasEBoot_strlen (insertu8); + insert = VasEBoot_malloc ((insertlen + 1) * sizeof (VasEBoot_uint32_t)); if (!insert) { - grub_free (insertu8); - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_free (insertu8); + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; break; } - t = grub_utf8_to_ucs4 (insert, insertlen, - (grub_uint8_t *) insertu8, + t = VasEBoot_utf8_to_ucs4 (insert, insertlen, + (VasEBoot_uint8_t *) insertu8, insertlen, 0); if (t > 0) { @@ -522,29 +522,29 @@ grub_cmdline_get (const char *prompt_translated) } } - grub_free (insertu8); - grub_free (insert); + VasEBoot_free (insertu8); + VasEBoot_free (insert); } cl_set_pos_all (cl_terms, nterms, lpos); } break; - case GRUB_TERM_CTRL | 'k': + case VasEBoot_TERM_CTRL | 'k': if (lpos < llen) { - grub_free (kill_buf); + VasEBoot_free (kill_buf); - kill_buf = grub_malloc ((llen - lpos + 1) - * sizeof (grub_uint32_t)); - if (grub_errno) + kill_buf = VasEBoot_malloc ((llen - lpos + 1) + * sizeof (VasEBoot_uint32_t)); + if (VasEBoot_errno) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } else { - grub_memcpy (kill_buf, buf + lpos, - (llen - lpos + 1) * sizeof (grub_uint32_t)); + VasEBoot_memcpy (kill_buf, buf + lpos, + (llen - lpos + 1) * sizeof (VasEBoot_uint32_t)); kill_buf[llen - lpos] = 0; } @@ -553,64 +553,64 @@ grub_cmdline_get (const char *prompt_translated) } break; - case GRUB_TERM_CTRL | 'n': - case GRUB_TERM_KEY_DOWN: + case VasEBoot_TERM_CTRL | 'n': + case VasEBoot_TERM_KEY_DOWN: { - grub_uint32_t *hist; + VasEBoot_uint32_t *hist; lpos = 0; if (histpos > 0) { - grub_history_replace (histpos, buf, llen); + VasEBoot_history_replace (histpos, buf, llen); histpos--; } cl_delete (cl_terms, nterms, buf, lpos, &llen, llen); - hist = grub_history_get (histpos); + hist = VasEBoot_history_get (histpos); cl_insert (cl_terms, nterms, &lpos, &llen, &max_len, &buf, hist); break; } - case GRUB_TERM_KEY_UP: - case GRUB_TERM_CTRL | 'p': + case VasEBoot_TERM_KEY_UP: + case VasEBoot_TERM_CTRL | 'p': { - grub_uint32_t *hist; + VasEBoot_uint32_t *hist; lpos = 0; if (histpos < hist_used - 1) { - grub_history_replace (histpos, buf, llen); + VasEBoot_history_replace (histpos, buf, llen); histpos++; } cl_delete (cl_terms, nterms, buf, lpos, &llen, llen); - hist = grub_history_get (histpos); + hist = VasEBoot_history_get (histpos); cl_insert (cl_terms, nterms, &lpos, &llen, &max_len, &buf, hist); } break; - case GRUB_TERM_CTRL | 'u': + case VasEBoot_TERM_CTRL | 'u': if (lpos > 0) { - grub_size_t n = lpos; + VasEBoot_size_t n = lpos; - grub_free (kill_buf); + VasEBoot_free (kill_buf); - kill_buf = grub_malloc ((n + 1) * sizeof(grub_uint32_t)); - if (grub_errno) + kill_buf = VasEBoot_malloc ((n + 1) * sizeof(VasEBoot_uint32_t)); + if (VasEBoot_errno) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } if (kill_buf) { - grub_memcpy (kill_buf, buf, n * sizeof(grub_uint32_t)); + VasEBoot_memcpy (kill_buf, buf, n * sizeof(VasEBoot_uint32_t)); kill_buf[n] = 0; } @@ -621,14 +621,14 @@ grub_cmdline_get (const char *prompt_translated) } break; - case GRUB_TERM_CTRL | 'y': + case VasEBoot_TERM_CTRL | 'y': if (kill_buf) cl_insert (cl_terms, nterms, &lpos, &llen, &max_len, &buf, kill_buf); break; case '\e': - grub_free (cl_terms); - grub_free (buf); + VasEBoot_free (cl_terms); + VasEBoot_free (buf); return 0; case '\b': @@ -641,17 +641,17 @@ grub_cmdline_get (const char *prompt_translated) break; /* fall through */ - case GRUB_TERM_CTRL | 'd': - case GRUB_TERM_KEY_DC: + case VasEBoot_TERM_CTRL | 'd': + case VasEBoot_TERM_KEY_DC: if (lpos < llen) cl_delete (cl_terms, nterms, buf, lpos, &llen, 1); break; default: - if (grub_isprint (key)) + if (VasEBoot_isprint (key)) { - grub_uint32_t str[2]; + VasEBoot_uint32_t str[2]; str[0] = key; str[1] = '\0'; @@ -660,22 +660,22 @@ grub_cmdline_get (const char *prompt_translated) break; } - grub_refresh (); + VasEBoot_refresh (); } - grub_xputs ("\n"); - grub_refresh (); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); histpos = 0; if (strlen_ucs4 (buf) > 0) { - grub_uint32_t empty[] = { 0 }; - grub_history_replace (histpos, buf, llen); - grub_history_add (empty, 0); + VasEBoot_uint32_t empty[] = { 0 }; + VasEBoot_history_replace (histpos, buf, llen); + VasEBoot_history_add (empty, 0); } - ret = grub_ucs4_to_utf8_alloc (buf, llen + 1); - grub_free (buf); - grub_free (cl_terms); + ret = VasEBoot_ucs4_to_utf8_alloc (buf, llen + 1); + VasEBoot_free (buf); + VasEBoot_free (cl_terms); return ret; } diff --git a/VasEBoot-core/normal/color.c b/VasEBoot-core/normal/color.c index d22cf903d..26e3ea123 100644 --- a/VasEBoot-core/normal/color.c +++ b/VasEBoot-core/normal/color.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -/* Borrowed from GRUB Legacy */ +/* Borrowed from VasEBoot Legacy */ static const char *color_list[16] = { "black", @@ -44,11 +44,11 @@ static const char *color_list[16] = }; static int -parse_color_name (grub_uint8_t *ret, char *name) +parse_color_name (VasEBoot_uint8_t *ret, char *name) { - grub_uint8_t i; + VasEBoot_uint8_t i; for (i = 0; i < ARRAY_SIZE(color_list); i++) - if (! grub_strcmp (name, color_list[i])) + if (! VasEBoot_strcmp (name, color_list[i])) { *ret = i; return 0; @@ -57,29 +57,29 @@ parse_color_name (grub_uint8_t *ret, char *name) } int -grub_parse_color_name_pair (grub_uint8_t *color, const char *name) +VasEBoot_parse_color_name_pair (VasEBoot_uint8_t *color, const char *name) { int result = 1; - grub_uint8_t fg, bg; + VasEBoot_uint8_t fg, bg; char *fg_name, *bg_name; /* nothing specified by user */ if (name == NULL) return result; - fg_name = grub_strdup (name); + fg_name = VasEBoot_strdup (name); if (fg_name == NULL) { - /* "out of memory" message was printed by grub_strdup() */ - grub_wait_after_message (); + /* "out of memory" message was printed by VasEBoot_strdup() */ + VasEBoot_wait_after_message (); return result; } - bg_name = grub_strchr (fg_name, '/'); + bg_name = VasEBoot_strchr (fg_name, '/'); if (bg_name == NULL) { - grub_printf_ (N_("Warning: syntax error (missing slash) in `%s'\n"), fg_name); - grub_wait_after_message (); + VasEBoot_printf_ (N_("Warning: syntax error (missing slash) in `%s'\n"), fg_name); + VasEBoot_wait_after_message (); goto free_and_return; } @@ -87,14 +87,14 @@ grub_parse_color_name_pair (grub_uint8_t *color, const char *name) if (parse_color_name (&fg, fg_name) == -1) { - grub_printf_ (N_("Warning: invalid foreground color `%s'\n"), fg_name); - grub_wait_after_message (); + VasEBoot_printf_ (N_("Warning: invalid foreground color `%s'\n"), fg_name); + VasEBoot_wait_after_message (); goto free_and_return; } if (parse_color_name (&bg, bg_name) == -1) { - grub_printf_ (N_("Warning: invalid background color `%s'\n"), bg_name); - grub_wait_after_message (); + VasEBoot_printf_ (N_("Warning: invalid background color `%s'\n"), bg_name); + VasEBoot_wait_after_message (); goto free_and_return; } @@ -102,44 +102,44 @@ grub_parse_color_name_pair (grub_uint8_t *color, const char *name) result = 0; free_and_return: - grub_free (fg_name); + VasEBoot_free (fg_name); return result; } static void set_colors (void) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; FOR_ACTIVE_TERM_OUTPUTS(term) { /* Propagates `normal' color to terminal current color. */ - grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); + VasEBoot_term_setcolorstate (term, VasEBoot_TERM_COLOR_NORMAL); } } /* Replace default `normal' colors with the ones specified by user (if any). */ char * -grub_env_write_color_normal (struct grub_env_var *var __attribute__ ((unused)), +VasEBoot_env_write_color_normal (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - if (grub_parse_color_name_pair (&grub_term_normal_color, val)) + if (VasEBoot_parse_color_name_pair (&VasEBoot_term_normal_color, val)) return NULL; set_colors (); - return grub_strdup (val); + return VasEBoot_strdup (val); } /* Replace default `highlight' colors with the ones specified by user (if any). */ char * -grub_env_write_color_highlight (struct grub_env_var *var __attribute__ ((unused)), +VasEBoot_env_write_color_highlight (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - if (grub_parse_color_name_pair (&grub_term_highlight_color, val)) + if (VasEBoot_parse_color_name_pair (&VasEBoot_term_highlight_color, val)) return NULL; set_colors (); - return grub_strdup (val); + return VasEBoot_strdup (val); } diff --git a/VasEBoot-core/normal/completion.c b/VasEBoot-core/normal/completion.c index 2c9b9e931..3cac85950 100644 --- a/VasEBoot-core/normal/completion.c +++ b/VasEBoot-core/normal/completion.c @@ -1,32 +1,32 @@ /* completion.c - complete a command, a disk, a partition or a file */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* The current word. */ static const char *current_word; @@ -41,10 +41,10 @@ static int num_found; static const char *suffix; /* The callback function to print items. */ -static void (*print_func) (const char *, grub_completion_type_t, int); +static void (*print_func) (const char *, VasEBoot_completion_type_t, int); /* The state the command line is in. */ -static grub_parser_state_t cmdline_state; +static VasEBoot_parser_state_t cmdline_state; /* Add a string to the list of possible completions. COMPLETION is the @@ -52,16 +52,16 @@ static grub_parser_state_t cmdline_state; matches uniquely. The type TYPE specifies what kind of data is added. */ static int add_completion (const char *completion, const char *extra, - grub_completion_type_t type) + VasEBoot_completion_type_t type) { - if (grub_strncmp (current_word, completion, grub_strlen (current_word)) == 0) + if (VasEBoot_strncmp (current_word, completion, VasEBoot_strlen (current_word)) == 0) { num_found++; switch (num_found) { case 1: - match = grub_strdup (completion); + match = VasEBoot_strdup (completion); if (! match) return 1; suffix = extra; @@ -87,7 +87,7 @@ add_completion (const char *completion, const char *extra, s++; t++; } - s = match + grub_getend (match, s); + s = match + VasEBoot_getend (match, s); *s = '\0'; } @@ -99,7 +99,7 @@ add_completion (const char *completion, const char *extra, } static int -iterate_partition (grub_disk_t disk, const grub_partition_t p, +iterate_partition (VasEBoot_disk_t disk, const VasEBoot_partition_t p, void *data __attribute__ ((unused))) { const char *disk_name = disk->name; @@ -107,49 +107,49 @@ iterate_partition (grub_disk_t disk, const grub_partition_t p, int ret; char *part_name; - part_name = grub_partition_get_name (p); + part_name = VasEBoot_partition_get_name (p); if (! part_name) return 1; - name = grub_xasprintf ("%s,%s", disk_name, part_name); - grub_free (part_name); + name = VasEBoot_xasprintf ("%s,%s", disk_name, part_name); + VasEBoot_free (part_name); if (! name) return 1; - ret = add_completion (name, ")", GRUB_COMPLETION_TYPE_PARTITION); - grub_free (name); + ret = add_completion (name, ")", VasEBoot_COMPLETION_TYPE_PARTITION); + VasEBoot_free (name); return ret; } static int -iterate_dir (const char *filename, const struct grub_dirhook_info *info, +iterate_dir (const char *filename, const struct VasEBoot_dirhook_info *info, void *data __attribute__ ((unused))) { if (! info->dir) { const char *prefix; - if (cmdline_state == GRUB_PARSER_STATE_DQUOTE) + if (cmdline_state == VasEBoot_PARSER_STATE_DQUOTE) prefix = "\" "; - else if (cmdline_state == GRUB_PARSER_STATE_QUOTE) + else if (cmdline_state == VasEBoot_PARSER_STATE_QUOTE) prefix = "\' "; else prefix = " "; - if (add_completion (filename, prefix, GRUB_COMPLETION_TYPE_FILE)) + if (add_completion (filename, prefix, VasEBoot_COMPLETION_TYPE_FILE)) return 1; } - else if (grub_strcmp (filename, ".") && grub_strcmp (filename, "..")) + else if (VasEBoot_strcmp (filename, ".") && VasEBoot_strcmp (filename, "..")) { char *fname; - fname = grub_xasprintf ("%s/", filename); - if (add_completion (fname, "", GRUB_COMPLETION_TYPE_FILE)) + fname = VasEBoot_xasprintf ("%s/", filename); + if (add_completion (fname, "", VasEBoot_COMPLETION_TYPE_FILE)) { - grub_free (fname); + VasEBoot_free (fname); return 1; } - grub_free (fname); + VasEBoot_free (fname); } return 0; @@ -158,40 +158,40 @@ iterate_dir (const char *filename, const struct grub_dirhook_info *info, static int iterate_dev (const char *devname, void *data __attribute__ ((unused))) { - grub_device_t dev; + VasEBoot_device_t dev; /* Complete the partition part. */ - dev = grub_device_open (devname); + dev = VasEBoot_device_open (devname); if (!dev) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } - if (grub_strcmp (devname, current_word) == 0) + if (VasEBoot_strcmp (devname, current_word) == 0) { - if (add_completion (devname, ")", GRUB_COMPLETION_TYPE_PARTITION)) + if (add_completion (devname, ")", VasEBoot_COMPLETION_TYPE_PARTITION)) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 1; } if (dev->disk) - if (grub_partition_iterate (dev->disk, iterate_partition, NULL)) + if (VasEBoot_partition_iterate (dev->disk, iterate_partition, NULL)) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 1; } } - else if (add_completion (devname, "", GRUB_COMPLETION_TYPE_DEVICE)) + else if (add_completion (devname, "", VasEBoot_COMPLETION_TYPE_DEVICE)) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 1; } - grub_device_close (dev); - grub_errno = GRUB_ERR_NONE; + VasEBoot_device_close (dev); + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } @@ -200,35 +200,35 @@ static int complete_device (void) { /* Check if this is a device or a partition. */ - char *p = grub_strchr (++current_word, ','); - grub_device_t dev; + char *p = VasEBoot_strchr (++current_word, ','); + VasEBoot_device_t dev; if (! p) { /* Complete the disk part. */ - if (grub_disk_dev_iterate (iterate_dev, NULL)) + if (VasEBoot_disk_dev_iterate (iterate_dev, NULL)) return 1; } else { /* Complete the partition part. */ *p = '\0'; - dev = grub_device_open (current_word); + dev = VasEBoot_device_open (current_word); *p = ','; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; if (dev) { if (dev->disk) { - if (grub_partition_iterate (dev->disk, iterate_partition, NULL)) + if (VasEBoot_partition_iterate (dev->disk, iterate_partition, NULL)) { - grub_device_close (dev); + VasEBoot_device_close (dev); return 1; } } - grub_device_close (dev); + VasEBoot_device_close (dev); } else return 1; @@ -244,38 +244,38 @@ complete_file (void) char *device; char *dir; char *last_dir; - grub_fs_t fs; - grub_device_t dev; + VasEBoot_fs_t fs; + VasEBoot_device_t dev; int ret = 0; - device = grub_file_get_device_name (current_word); - if (grub_errno != GRUB_ERR_NONE) + device = VasEBoot_file_get_device_name (current_word); + if (VasEBoot_errno != VasEBoot_ERR_NONE) return 1; - dev = grub_device_open (device); + dev = VasEBoot_device_open (device); if (! dev) { ret = 1; goto fail; } - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) { ret = 1; goto fail; } - dir = grub_strchr (current_word + (device ? 2 + grub_strlen (device) : 0), + dir = VasEBoot_strchr (current_word + (device ? 2 + VasEBoot_strlen (device) : 0), '/'); - last_dir = grub_strrchr (current_word, '/'); + last_dir = VasEBoot_strrchr (current_word, '/'); if (dir) { char *dirfile; current_word = last_dir + 1; - dir = grub_strdup (dir); + dir = VasEBoot_strdup (dir); if (! dir) { ret = 1; @@ -283,15 +283,15 @@ complete_file (void) } /* Cut away the filename part. */ - dirfile = grub_strrchr (dir, '/'); + dirfile = VasEBoot_strrchr (dir, '/'); dirfile[1] = '\0'; /* Iterate the directory. */ (fs->dir) (dev, dir, iterate_dir, NULL); - grub_free (dir); + VasEBoot_free (dir); - if (grub_errno) + if (VasEBoot_errno) { ret = 1; goto fail; @@ -299,8 +299,8 @@ complete_file (void) } else { - current_word += grub_strlen (current_word); - match = grub_strdup ("/"); + current_word += VasEBoot_strlen (current_word); + match = VasEBoot_strdup ("/"); if (! match) { ret = 1; @@ -313,8 +313,8 @@ complete_file (void) fail: if (dev) - grub_device_close (dev); - grub_free (device); + VasEBoot_device_close (dev); + VasEBoot_free (device); return ret; } @@ -322,21 +322,21 @@ complete_file (void) static int complete_arguments (char *command) { - grub_command_t cmd; - grub_extcmd_t ext; - const struct grub_arg_option *option; + VasEBoot_command_t cmd; + VasEBoot_extcmd_t ext; + const struct VasEBoot_arg_option *option; char shortarg[] = "- "; - cmd = grub_command_find (command); + cmd = VasEBoot_command_find (command); - if (!cmd || !(cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)) + if (!cmd || !(cmd->flags & VasEBoot_COMMAND_FLAG_EXTCMD)) return 0; ext = cmd->data; if (!ext->options) return 0; - if (add_completion ("-u", " ", GRUB_COMPLETION_TYPE_ARGUMENT)) + if (add_completion ("-u", " ", VasEBoot_COMPLETION_TYPE_ARGUMENT)) return 1; /* Add the short arguments. */ @@ -346,15 +346,15 @@ complete_arguments (char *command) continue; shortarg[1] = option->shortarg; - if (add_completion (shortarg, " ", GRUB_COMPLETION_TYPE_ARGUMENT)) + if (add_completion (shortarg, " ", VasEBoot_COMPLETION_TYPE_ARGUMENT)) return 1; } /* First add the built-in arguments. */ - if (add_completion ("--help", " ", GRUB_COMPLETION_TYPE_ARGUMENT)) + if (add_completion ("--help", " ", VasEBoot_COMPLETION_TYPE_ARGUMENT)) return 1; - if (add_completion ("--usage", " ", GRUB_COMPLETION_TYPE_ARGUMENT)) + if (add_completion ("--usage", " ", VasEBoot_COMPLETION_TYPE_ARGUMENT)) return 1; /* Add the long arguments. */ @@ -364,30 +364,30 @@ complete_arguments (char *command) if (!option->longarg) continue; - longarg = grub_xasprintf ("--%s", option->longarg); + longarg = VasEBoot_xasprintf ("--%s", option->longarg); if (!longarg) return 1; - if (add_completion (longarg, " ", GRUB_COMPLETION_TYPE_ARGUMENT)) + if (add_completion (longarg, " ", VasEBoot_COMPLETION_TYPE_ARGUMENT)) { - grub_free (longarg); + VasEBoot_free (longarg); return 1; } - grub_free (longarg); + VasEBoot_free (longarg); } return 0; } -static grub_parser_state_t +static VasEBoot_parser_state_t get_state (const char *cmdline) { - grub_parser_state_t state = GRUB_PARSER_STATE_TEXT; + VasEBoot_parser_state_t state = VasEBoot_PARSER_STATE_TEXT; char use; while (*cmdline) - state = grub_parser_cmdline_state (state, *(cmdline++), &use); + state = VasEBoot_parser_cmdline_state (state, *(cmdline++), &use); return state; } @@ -397,8 +397,8 @@ get_state (const char *cmdline) completions by calling HOOK, in that case set RESTORE to 1 so the caller can restore the prompt. */ char * -grub_normal_do_completion (char *buf, int *restore, - void (*hook) (const char *, grub_completion_type_t, int)) +VasEBoot_normal_do_completion (char *buf, int *restore, + void (*hook) (const char *, VasEBoot_completion_type_t, int)) { int argc; char **argv; @@ -411,7 +411,7 @@ grub_normal_do_completion (char *buf, int *restore, *restore = 1; - if (grub_parser_split_cmdline (buf, 0, 0, &argc, &argv)) + if (VasEBoot_parser_split_cmdline (buf, 0, 0, &argc, &argv)) return 0; if (argc == 0) @@ -419,9 +419,9 @@ grub_normal_do_completion (char *buf, int *restore, else current_word = argv[argc - 1]; - if (argc > 1 && ! grub_strcmp (argv[0], "set")) + if (argc > 1 && ! VasEBoot_strcmp (argv[0], "set")) { - char *equals = grub_strchr (current_word, '='); + char *equals = VasEBoot_strchr (current_word, '='); if (equals) /* Complete the value of the variable. */ current_word = equals + 1; @@ -434,12 +434,12 @@ grub_normal_do_completion (char *buf, int *restore, if (argc == 1 || argc == 0) { /* Complete a command. */ - grub_command_t cmd; + VasEBoot_command_t cmd; FOR_COMMANDS(cmd) { - if (cmd->prio & GRUB_COMMAND_FLAG_ACTIVE) + if (cmd->prio & VasEBoot_COMMAND_FLAG_ACTIVE) { - if (add_completion (cmd->name, " ", GRUB_COMPLETION_TYPE_COMMAND)) + if (add_completion (cmd->name, " ", VasEBoot_COMPLETION_TYPE_COMMAND)) goto fail; } } @@ -449,7 +449,7 @@ grub_normal_do_completion (char *buf, int *restore, if (complete_arguments (buf)) goto fail; } - else if (*current_word == '(' && ! grub_strchr (current_word, ')')) + else if (*current_word == '(' && ! VasEBoot_strchr (current_word, ')')) { /* Complete a device. */ if (complete_device ()) @@ -479,8 +479,8 @@ grub_normal_do_completion (char *buf, int *restore, int match_len; int spaces = 0; - current_len = grub_strlen (current_word); - match_len = grub_strlen (match); + current_len = VasEBoot_strlen (current_word); + match_len = VasEBoot_strlen (match); /* Count the number of spaces that have to be escaped. XXX: More than just spaces have to be escaped. */ @@ -488,40 +488,40 @@ grub_normal_do_completion (char *buf, int *restore, if (*escstr == ' ') spaces++; - ret = grub_malloc (match_len - current_len + grub_strlen (suffix) + spaces + 1); + ret = VasEBoot_malloc (match_len - current_len + VasEBoot_strlen (suffix) + spaces + 1); newstr = ret; for (escstr = match + current_len; *escstr; escstr++) { - if (*escstr == ' ' && cmdline_state != GRUB_PARSER_STATE_QUOTE - && cmdline_state != GRUB_PARSER_STATE_QUOTE) + if (*escstr == ' ' && cmdline_state != VasEBoot_PARSER_STATE_QUOTE + && cmdline_state != VasEBoot_PARSER_STATE_QUOTE) *(newstr++) = '\\'; *(newstr++) = *escstr; } *newstr = '\0'; if (num_found == 1) - grub_strcpy (newstr, suffix); + VasEBoot_strcpy (newstr, suffix); if (*ret == '\0') { - grub_free (ret); + VasEBoot_free (ret); goto fail; } if (argc != 0) - grub_free (argv[0]); - grub_free (match); + VasEBoot_free (argv[0]); + VasEBoot_free (match); return ret; } fail: if (argc != 0) { - grub_free (argv[0]); - grub_free (argv); + VasEBoot_free (argv[0]); + VasEBoot_free (argv); } - grub_free (match); - grub_errno = GRUB_ERR_NONE; + VasEBoot_free (match); + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } diff --git a/VasEBoot-core/normal/context.c b/VasEBoot-core/normal/context.c index ee53d4a68..0de903e38 100644 --- a/VasEBoot-core/normal/context.c +++ b/VasEBoot-core/normal/context.c @@ -1,33 +1,33 @@ /* env.c - Environment variables */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include struct menu_pointer { - grub_menu_t menu; + VasEBoot_menu_t menu; struct menu_pointer *prev; }; @@ -35,42 +35,42 @@ static struct menu_pointer initial_menu; static struct menu_pointer *current_menu = &initial_menu; void -grub_env_unset_menu (void) +VasEBoot_env_unset_menu (void) { current_menu->menu = NULL; } -grub_menu_t -grub_env_get_menu (void) +VasEBoot_menu_t +VasEBoot_env_get_menu (void) { return current_menu->menu; } void -grub_env_set_menu (grub_menu_t nmenu) +VasEBoot_env_set_menu (VasEBoot_menu_t nmenu) { current_menu->menu = nmenu; } -static grub_err_t -grub_env_new_context (int export_all) +static VasEBoot_err_t +VasEBoot_env_new_context (int export_all) { - struct grub_env_context *context; + struct VasEBoot_env_context *context; int i; struct menu_pointer *menu; - context = grub_zalloc (sizeof (*context)); + context = VasEBoot_zalloc (sizeof (*context)); if (! context) - return grub_errno; - menu = grub_zalloc (sizeof (*menu)); + return VasEBoot_errno; + menu = VasEBoot_zalloc (sizeof (*menu)); if (! menu) { - grub_free (context); - return grub_errno; + VasEBoot_free (context); + return VasEBoot_errno; } - context->prev = grub_current_context; - grub_current_context = context; + context->prev = VasEBoot_current_context; + VasEBoot_current_context = context; menu->prev = current_menu; current_menu = menu; @@ -78,96 +78,96 @@ grub_env_new_context (int export_all) /* Copy exported variables. */ for (i = 0; i < HASHSZ; i++) { - struct grub_env_var *var; + struct VasEBoot_env_var *var; for (var = context->prev->vars[i]; var; var = var->next) if (var->global || export_all) { - if (grub_env_set (var->name, var->value) != GRUB_ERR_NONE) + if (VasEBoot_env_set (var->name, var->value) != VasEBoot_ERR_NONE) { - grub_env_context_close (); - return grub_errno; + VasEBoot_env_context_close (); + return VasEBoot_errno; } - grub_env_export (var->name); - grub_register_variable_hook (var->name, var->read_hook, var->write_hook); + VasEBoot_env_export (var->name); + VasEBoot_register_variable_hook (var->name, var->read_hook, var->write_hook); } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_env_context_open (void) +VasEBoot_err_t +VasEBoot_env_context_open (void) { - return grub_env_new_context (0); + return VasEBoot_env_new_context (0); } -int grub_extractor_level = 0; +int VasEBoot_extractor_level = 0; -grub_err_t -grub_env_extractor_open (int source) +VasEBoot_err_t +VasEBoot_env_extractor_open (int source) { - grub_extractor_level++; - return grub_env_new_context (source); + VasEBoot_extractor_level++; + return VasEBoot_env_new_context (source); } -grub_err_t -grub_env_context_close (void) +VasEBoot_err_t +VasEBoot_env_context_close (void) { - struct grub_env_context *context; + struct VasEBoot_env_context *context; int i; struct menu_pointer *menu; - if (! grub_current_context->prev) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_current_context->prev) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "cannot close the initial context"); /* Free the variables associated with this context. */ for (i = 0; i < HASHSZ; i++) { - struct grub_env_var *p, *q; + struct VasEBoot_env_var *p, *q; - for (p = grub_current_context->vars[i]; p; p = q) + for (p = VasEBoot_current_context->vars[i]; p; p = q) { q = p->next; - grub_free (p->name); - grub_free (p->value); - grub_free (p); + VasEBoot_free (p->name); + VasEBoot_free (p->value); + VasEBoot_free (p); } } /* Restore the previous context. */ - context = grub_current_context->prev; - grub_free (grub_current_context); - grub_current_context = context; + context = VasEBoot_current_context->prev; + VasEBoot_free (VasEBoot_current_context); + VasEBoot_current_context = context; menu = current_menu->prev; if (current_menu->menu) - grub_normal_free_menu (current_menu->menu); - grub_free (current_menu); + VasEBoot_normal_free_menu (current_menu->menu); + VasEBoot_free (current_menu); current_menu = menu; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_env_extractor_close (int source) +VasEBoot_err_t +VasEBoot_env_extractor_close (int source) { - grub_menu_t menu = NULL; - grub_menu_entry_t *last; - grub_err_t err; + VasEBoot_menu_t menu = NULL; + VasEBoot_menu_entry_t *last; + VasEBoot_err_t err; if (source) { - menu = grub_env_get_menu (); - grub_env_unset_menu (); + menu = VasEBoot_env_get_menu (); + VasEBoot_env_unset_menu (); } - err = grub_env_context_close (); + err = VasEBoot_env_context_close (); if (source && menu) { - grub_menu_t menu2; - menu2 = grub_env_get_menu (); + VasEBoot_menu_t menu2; + menu2 = VasEBoot_env_get_menu (); last = &menu2->entry_list; while (*last) @@ -177,38 +177,38 @@ grub_env_extractor_close (int source) menu2->size += menu->size; } - grub_extractor_level--; + VasEBoot_extractor_level--; return err; } -static grub_command_t export_cmd; +static VasEBoot_command_t export_cmd; -static grub_err_t -grub_cmd_export (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_export (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char **args) { int i; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); for (i = 0; i < argc; i++) - grub_env_export (args[i]); + VasEBoot_env_export (args[i]); return 0; } void -grub_context_init (void) +VasEBoot_context_init (void) { - export_cmd = grub_register_command ("export", grub_cmd_export, + export_cmd = VasEBoot_register_command ("export", VasEBoot_cmd_export, N_("ENVVAR [ENVVAR] ..."), N_("Export variables.")); } void -grub_context_fini (void) +VasEBoot_context_fini (void) { - grub_unregister_command (export_cmd); + VasEBoot_unregister_command (export_cmd); } diff --git a/VasEBoot-core/normal/crypto.c b/VasEBoot-core/normal/crypto.c index e6d345f33..b51f4db20 100644 --- a/VasEBoot-core/normal/crypto.c +++ b/VasEBoot-core/normal/crypto.c @@ -1,28 +1,28 @@ /* crypto.c - support crypto autoload */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include struct load_spec { @@ -34,10 +34,10 @@ struct load_spec static struct load_spec *crypto_specs = NULL; static void -grub_crypto_autoload (const char *name) +VasEBoot_crypto_autoload (const char *name) { struct load_spec *cur; - grub_dl_t mod; + VasEBoot_dl_t mod; static int depth = 0; /* Some bufio of filesystems may want some crypto modules. @@ -47,26 +47,26 @@ grub_crypto_autoload (const char *name) depth++; for (cur = crypto_specs; cur; cur = cur->next) - if (grub_strcasecmp (name, cur->name) == 0) + if (VasEBoot_strcasecmp (name, cur->name) == 0) { - mod = grub_dl_load (cur->modname); + mod = VasEBoot_dl_load (cur->modname); if (mod) - grub_dl_ref (mod); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dl_ref (mod); + VasEBoot_errno = VasEBoot_ERR_NONE; } depth--; } static void -grub_crypto_spec_free (void) +VasEBoot_crypto_spec_free (void) { struct load_spec *cur, *next; for (cur = crypto_specs; cur; cur = next) { next = cur->next; - grub_free (cur->name); - grub_free (cur->modname); - grub_free (cur); + VasEBoot_free (cur->name); + VasEBoot_free (cur->modname); + VasEBoot_free (cur); } crypto_specs = NULL; } @@ -77,49 +77,49 @@ void read_crypto_list (const char *prefix) { char *filename; - grub_file_t file; + VasEBoot_file_t file; char *buf = NULL; if (!prefix) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/crypto.lst", prefix); if (!filename) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - file = grub_file_open (filename); - grub_free (filename); + file = VasEBoot_file_open (filename); + VasEBoot_free (filename); if (!file) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } /* Override previous crypto.lst. */ - grub_crypto_spec_free (); + VasEBoot_crypto_spec_free (); - for (;; grub_free (buf)) + for (;; VasEBoot_free (buf)) { char *p, *name; struct load_spec *cur; - buf = grub_file_getline (file); + buf = VasEBoot_file_getline (file); if (! buf) break; name = buf; - while (grub_isspace (name[0])) + while (VasEBoot_isspace (name[0])) name++; - p = grub_strchr (name, ':'); + p = VasEBoot_strchr (name, ':'); if (! p) continue; @@ -128,36 +128,36 @@ read_crypto_list (const char *prefix) while (*p == ' ' || *p == '\t') p++; - cur = grub_malloc (sizeof (*cur)); + cur = VasEBoot_malloc (sizeof (*cur)); if (!cur) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - cur->name = grub_strdup (name); + cur->name = VasEBoot_strdup (name); if (! cur->name) { - grub_errno = GRUB_ERR_NONE; - grub_free (cur); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (cur); continue; } - cur->modname = grub_strdup (p); + cur->modname = VasEBoot_strdup (p); if (! cur->modname) { - grub_errno = GRUB_ERR_NONE; - grub_free (cur->name); - grub_free (cur); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (cur->name); + VasEBoot_free (cur); continue; } cur->next = crypto_specs; crypto_specs = cur; } - grub_file_close (file); + VasEBoot_file_close (file); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_crypto_autoload_hook = grub_crypto_autoload; + VasEBoot_crypto_autoload_hook = VasEBoot_crypto_autoload; } diff --git a/VasEBoot-core/normal/datetime.c b/VasEBoot-core/normal/datetime.c index 95b8c9ff5..11f418b04 100644 --- a/VasEBoot-core/normal/datetime.c +++ b/VasEBoot-core/normal/datetime.c @@ -1,26 +1,26 @@ /* datetime.c - Module for common datetime function. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -static const char *const grub_weekday_names[] = +static const char *const VasEBoot_weekday_names[] = { N_("Sunday"), N_("Monday"), @@ -32,7 +32,7 @@ static const char *const grub_weekday_names[] = }; int -grub_get_weekday (struct grub_datetime *datetime) +VasEBoot_get_weekday (struct VasEBoot_datetime *datetime) { unsigned a, y, m; @@ -47,9 +47,9 @@ grub_get_weekday (struct grub_datetime *datetime) } const char * -grub_get_weekday_name (struct grub_datetime *datetime) +VasEBoot_get_weekday_name (struct VasEBoot_datetime *datetime) { - return _ (grub_weekday_names[grub_get_weekday (datetime)]); + return _ (VasEBoot_weekday_names[VasEBoot_get_weekday (datetime)]); } #define SECPERMIN 60 @@ -60,10 +60,10 @@ grub_get_weekday_name (struct grub_datetime *datetime) void -grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime) +VasEBoot_unixtime2datetime (VasEBoot_int32_t nix, struct VasEBoot_datetime *datetime) { int i; - grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + VasEBoot_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; /* In the period of validity of unixtime all years divisible by 4 are bissextile*/ /* Convenience: let's have 3 consecutive non-bissextile years diff --git a/VasEBoot-core/normal/dyncmd.c b/VasEBoot-core/normal/dyncmd.c index 169c126f5..9a7205f93 100644 --- a/VasEBoot-core/normal/dyncmd.c +++ b/VasEBoot-core/normal/dyncmd.c @@ -1,93 +1,93 @@ /* dyncmd.c - support dynamic command */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -grub_command_t -grub_dyncmd_get_cmd (grub_command_t cmd) +VasEBoot_command_t +VasEBoot_dyncmd_get_cmd (VasEBoot_command_t cmd) { - grub_extcmd_t extcmd = cmd->data; + VasEBoot_extcmd_t extcmd = cmd->data; char *modname; char *name; - grub_dl_t mod; + VasEBoot_dl_t mod; modname = extcmd->data; - mod = grub_dl_load (modname); + mod = VasEBoot_dl_load (modname); if (!mod) return NULL; - grub_free (modname); - grub_dl_ref (mod); + VasEBoot_free (modname); + VasEBoot_dl_ref (mod); name = (char *) cmd->name; - grub_unregister_extcmd (extcmd); + VasEBoot_unregister_extcmd (extcmd); - cmd = grub_command_find (name); + cmd = VasEBoot_command_find (name); - grub_free (name); + VasEBoot_free (name); return cmd; } -static grub_err_t -grub_dyncmd_dispatcher (struct grub_extcmd_context *ctxt, +static VasEBoot_err_t +VasEBoot_dyncmd_dispatcher (struct VasEBoot_extcmd_context *ctxt, int argc, char **args) { char *modname; - grub_dl_t mod; - grub_err_t ret; - grub_extcmd_t extcmd = ctxt->extcmd; - grub_command_t cmd = extcmd->cmd; + VasEBoot_dl_t mod; + VasEBoot_err_t ret; + VasEBoot_extcmd_t extcmd = ctxt->extcmd; + VasEBoot_command_t cmd = extcmd->cmd; char *name; modname = extcmd->data; - mod = grub_dl_load (modname); + mod = VasEBoot_dl_load (modname); if (!mod) - return grub_errno; + return VasEBoot_errno; - grub_free (modname); - grub_dl_ref (mod); + VasEBoot_free (modname); + VasEBoot_dl_ref (mod); name = (char *) cmd->name; - grub_unregister_extcmd (extcmd); + VasEBoot_unregister_extcmd (extcmd); - cmd = grub_command_find (name); + cmd = VasEBoot_command_find (name); if (cmd) { - if (cmd->flags & GRUB_COMMAND_FLAG_BLOCKS && - cmd->flags & GRUB_COMMAND_FLAG_EXTCMD) - ret = grub_extcmd_dispatcher (cmd, argc, args, ctxt->script); + if (cmd->flags & VasEBoot_COMMAND_FLAG_BLOCKS && + cmd->flags & VasEBoot_COMMAND_FLAG_EXTCMD) + ret = VasEBoot_extcmd_dispatcher (cmd, argc, args, ctxt->script); else ret = (cmd->func) (cmd, argc, args); } else - ret = grub_errno; + ret = VasEBoot_errno; - grub_free (name); + VasEBoot_free (name); return ret; } @@ -100,48 +100,48 @@ read_command_list (const char *prefix) { char *filename; - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/command.lst", prefix); if (filename) { - grub_file_t file; + VasEBoot_file_t file; - file = grub_file_open (filename); + file = VasEBoot_file_open (filename); if (file) { char *buf = NULL; - grub_command_t ptr, last = 0, next; + VasEBoot_command_t ptr, last = 0, next; /* Override previous commands.lst. */ - for (ptr = grub_command_list; ptr; ptr = next) + for (ptr = VasEBoot_command_list; ptr; ptr = next) { next = ptr->next; - if (ptr->flags & GRUB_COMMAND_FLAG_DYNCMD) + if (ptr->flags & VasEBoot_COMMAND_FLAG_DYNCMD) { if (last) last->next = ptr->next; else - grub_command_list = ptr->next; - grub_free (ptr->data); /* extcmd struct */ - grub_free (ptr); + VasEBoot_command_list = ptr->next; + VasEBoot_free (ptr->data); /* extcmd struct */ + VasEBoot_free (ptr); } else last = ptr; } - for (;; grub_free (buf)) + for (;; VasEBoot_free (buf)) { char *p, *name, *modname; - grub_extcmd_t cmd; + VasEBoot_extcmd_t cmd; int prio = 0; - buf = grub_file_getline (file); + buf = VasEBoot_file_getline (file); if (! buf) break; name = buf; - while (grub_isspace (name[0])) + while (VasEBoot_isspace (name[0])) name++; if (*name == '*') @@ -150,10 +150,10 @@ read_command_list (const char *prefix) prio++; } - if (! grub_isgraph (name[0])) + if (! VasEBoot_isgraph (name[0])) continue; - p = grub_strchr (name, ':'); + p = VasEBoot_strchr (name, ':'); if (! p) continue; @@ -162,49 +162,49 @@ read_command_list (const char *prefix) while (*p == ' ' || *p == '\t') p++; - if (! grub_isgraph (*p)) + if (! VasEBoot_isgraph (*p)) continue; - if (grub_dl_get (p)) + if (VasEBoot_dl_get (p)) continue; - name = grub_strdup (name); + name = VasEBoot_strdup (name); if (! name) continue; - modname = grub_strdup (p); + modname = VasEBoot_strdup (p); if (! modname) { - grub_free (name); + VasEBoot_free (name); continue; } - cmd = grub_register_extcmd_prio (name, - grub_dyncmd_dispatcher, - GRUB_COMMAND_FLAG_BLOCKS - | GRUB_COMMAND_FLAG_EXTCMD - | GRUB_COMMAND_FLAG_DYNCMD, + cmd = VasEBoot_register_extcmd_prio (name, + VasEBoot_dyncmd_dispatcher, + VasEBoot_COMMAND_FLAG_BLOCKS + | VasEBoot_COMMAND_FLAG_EXTCMD + | VasEBoot_COMMAND_FLAG_DYNCMD, 0, N_("module isn't loaded"), 0, prio); if (! cmd) { - grub_free (name); - grub_free (modname); + VasEBoot_free (name); + VasEBoot_free (modname); continue; } cmd->data = modname; /* Update the active flag. */ - grub_command_find (name); + VasEBoot_command_find (name); } - grub_file_close (file); + VasEBoot_file_close (file); } - grub_free (filename); + VasEBoot_free (filename); } } /* Ignore errors. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/normal/main.c b/VasEBoot-core/normal/main.c index 78a70a8bf..5d21b238a 100644 --- a/VasEBoot-core/normal/main.c +++ b/VasEBoot-core/normal/main.c @@ -1,317 +1,317 @@ /* main.c - the normal mode main routine */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_DEFAULT_HISTORY_SIZE 50 +#define VasEBoot_DEFAULT_HISTORY_SIZE 50 static int nested_level = 0; -int grub_normal_exit_level = 0; +int VasEBoot_normal_exit_level = 0; void -grub_normal_free_menu (grub_menu_t menu) +VasEBoot_normal_free_menu (VasEBoot_menu_t menu) { - grub_menu_entry_t entry = menu->entry_list; + VasEBoot_menu_entry_t entry = menu->entry_list; while (entry) { - grub_menu_entry_t next_entry = entry->next; - grub_size_t i; + VasEBoot_menu_entry_t next_entry = entry->next; + VasEBoot_size_t i; if (entry->classes) { - struct grub_menu_entry_class *class; + struct VasEBoot_menu_entry_class *class; for (class = entry->classes; class; class = class->next) - grub_free (class->name); - grub_free (entry->classes); + VasEBoot_free (class->name); + VasEBoot_free (entry->classes); } if (entry->args) { for (i = 0; entry->args[i]; i++) - grub_free (entry->args[i]); - grub_free (entry->args); + VasEBoot_free (entry->args[i]); + VasEBoot_free (entry->args); } - grub_free ((void *) entry->id); - grub_free ((void *) entry->users); - grub_free ((void *) entry->title); - grub_free ((void *) entry->sourcecode); - grub_free (entry); + VasEBoot_free ((void *) entry->id); + VasEBoot_free ((void *) entry->users); + VasEBoot_free ((void *) entry->title); + VasEBoot_free ((void *) entry->sourcecode); + VasEBoot_free (entry); entry = next_entry; } - grub_free (menu); - grub_env_unset_menu (); + VasEBoot_free (menu); + VasEBoot_env_unset_menu (); } /* Helper for read_config_file. */ -static grub_err_t +static VasEBoot_err_t read_config_file_getline (char **line, int cont __attribute__ ((unused)), void *data) { - grub_file_t file = data; + VasEBoot_file_t file = data; while (1) { char *buf; - *line = buf = grub_file_getline (file); + *line = buf = VasEBoot_file_getline (file); if (! buf) - return grub_errno; + return VasEBoot_errno; if (buf[0] == '#') - grub_free (*line); + VasEBoot_free (*line); else break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_menu_t +static VasEBoot_menu_t read_config_file (const char *config) { - grub_file_t rawfile, file; + VasEBoot_file_t rawfile, file; char *old_file = 0, *old_dir = 0; char *config_dir, *ptr = 0; const char *ctmp; - grub_menu_t newmenu; + VasEBoot_menu_t newmenu; - newmenu = grub_env_get_menu (); + newmenu = VasEBoot_env_get_menu (); if (! newmenu) { - newmenu = grub_zalloc (sizeof (*newmenu)); + newmenu = VasEBoot_zalloc (sizeof (*newmenu)); if (! newmenu) return 0; - grub_env_set_menu (newmenu); + VasEBoot_env_set_menu (newmenu); } /* Try to open the config file. */ - rawfile = grub_file_open (config); + rawfile = VasEBoot_file_open (config); if (! rawfile) return 0; - file = grub_bufio_open (rawfile, 0); + file = VasEBoot_bufio_open (rawfile, 0); if (! file) { - grub_file_close (rawfile); + VasEBoot_file_close (rawfile); return 0; } - ctmp = grub_env_get ("config_file"); + ctmp = VasEBoot_env_get ("config_file"); if (ctmp) - old_file = grub_strdup (ctmp); - ctmp = grub_env_get ("config_directory"); + old_file = VasEBoot_strdup (ctmp); + ctmp = VasEBoot_env_get ("config_directory"); if (ctmp) - old_dir = grub_strdup (ctmp); + old_dir = VasEBoot_strdup (ctmp); if (*config == '(') { - grub_env_set ("config_file", config); - config_dir = grub_strdup (config); + VasEBoot_env_set ("config_file", config); + config_dir = VasEBoot_strdup (config); } else { /* $root is guranteed to be defined, otherwise open above would fail */ - config_dir = grub_xasprintf ("(%s)%s", grub_env_get ("root"), config); + config_dir = VasEBoot_xasprintf ("(%s)%s", VasEBoot_env_get ("root"), config); if (config_dir) - grub_env_set ("config_file", config_dir); + VasEBoot_env_set ("config_file", config_dir); } if (config_dir) { - ptr = grub_strrchr (config_dir, '/'); + ptr = VasEBoot_strrchr (config_dir, '/'); if (ptr) *ptr = 0; - grub_env_set ("config_directory", config_dir); - grub_free (config_dir); + VasEBoot_env_set ("config_directory", config_dir); + VasEBoot_free (config_dir); } - grub_env_export ("config_file"); - grub_env_export ("config_directory"); + VasEBoot_env_export ("config_file"); + VasEBoot_env_export ("config_directory"); while (1) { char *line; /* Print an error, if any. */ - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; if ((read_config_file_getline (&line, 0, file)) || (! line)) break; - grub_normal_parse_line (line, read_config_file_getline, file); - grub_free (line); + VasEBoot_normal_parse_line (line, read_config_file_getline, file); + VasEBoot_free (line); } if (old_file) - grub_env_set ("config_file", old_file); + VasEBoot_env_set ("config_file", old_file); else - grub_env_unset ("config_file"); + VasEBoot_env_unset ("config_file"); if (old_dir) - grub_env_set ("config_directory", old_dir); + VasEBoot_env_set ("config_directory", old_dir); else - grub_env_unset ("config_directory"); - grub_free (old_file); - grub_free (old_dir); + VasEBoot_env_unset ("config_directory"); + VasEBoot_free (old_file); + VasEBoot_free (old_dir); - grub_file_close (file); + VasEBoot_file_close (file); return newmenu; } /* Initialize the screen. */ void -grub_normal_init_page (struct grub_term_output *term, +VasEBoot_normal_init_page (struct VasEBoot_term_output *term, int y) { - grub_ssize_t msg_len; + VasEBoot_ssize_t msg_len; int posx; char *msg_formatted; - grub_uint32_t *unicode_msg; - grub_uint32_t *last_position; + VasEBoot_uint32_t *unicode_msg; + VasEBoot_uint32_t *last_position; - grub_term_cls (term); + VasEBoot_term_cls (term); - msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); + msg_formatted = VasEBoot_xasprintf (_("GNU VasEBoot version %s"), PACKAGE_VERSION); if (!msg_formatted) return; - msg_len = grub_utf8_to_ucs4_alloc (msg_formatted, + msg_len = VasEBoot_utf8_to_ucs4_alloc (msg_formatted, &unicode_msg, &last_position); - grub_free (msg_formatted); + VasEBoot_free (msg_formatted); if (msg_len < 0) { return; } - posx = grub_getstringwidth (unicode_msg, last_position, term); - posx = ((int) grub_term_width (term) - posx) / 2; + posx = VasEBoot_getstringwidth (unicode_msg, last_position, term); + posx = ((int) VasEBoot_term_width (term) - posx) / 2; if (posx < 0) posx = 0; - grub_term_gotoxy (term, (struct grub_term_coordinate) { posx, y }); + VasEBoot_term_gotoxy (term, (struct VasEBoot_term_coordinate) { posx, y }); - grub_print_ucs4 (unicode_msg, last_position, 0, 0, term); - grub_putcode ('\n', term); - grub_putcode ('\n', term); - grub_free (unicode_msg); + VasEBoot_print_ucs4 (unicode_msg, last_position, 0, 0, term); + VasEBoot_putcode ('\n', term); + VasEBoot_putcode ('\n', term); + VasEBoot_free (unicode_msg); } static void read_lists (const char *val) { - if (! grub_no_modules) + if (! VasEBoot_no_modules) { read_command_list (val); read_fs_list (val); read_crypto_list (val); read_terminal_list (val); } - grub_gettext_reread_prefix (val); + VasEBoot_gettext_reread_prefix (val); } static char * -read_lists_hook (struct grub_env_var *var __attribute__ ((unused)), +read_lists_hook (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { read_lists (val); - return val ? grub_strdup (val) : NULL; + return val ? VasEBoot_strdup (val) : NULL; } /* Read the config file CONFIG and execute the menu interface or the command line interface if BATCH is false. */ void -grub_normal_execute (const char *config, int nested, int batch) +VasEBoot_normal_execute (const char *config, int nested, int batch) { - grub_menu_t menu = 0; + VasEBoot_menu_t menu = 0; const char *prefix; if (! nested) { - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); read_lists (prefix); - grub_register_variable_hook ("prefix", NULL, read_lists_hook); + VasEBoot_register_variable_hook ("prefix", NULL, read_lists_hook); } - grub_boot_time ("Executing config file"); + VasEBoot_boot_time ("Executing config file"); if (config) { menu = read_config_file (config); /* Ignore any error. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_boot_time ("Executed config file"); + VasEBoot_boot_time ("Executed config file"); if (! batch) { if (menu && menu->size) { - grub_boot_time ("Entering menu"); - grub_show_menu (menu, nested, 0); + VasEBoot_boot_time ("Entering menu"); + VasEBoot_show_menu (menu, nested, 0); if (nested) - grub_normal_free_menu (menu); + VasEBoot_normal_free_menu (menu); } } } /* This starts the normal mode. */ void -grub_enter_normal_mode (const char *config) +VasEBoot_enter_normal_mode (const char *config) { - grub_boot_time ("Entering normal mode"); + VasEBoot_boot_time ("Entering normal mode"); nested_level++; - grub_normal_execute (config, 0, 0); - grub_boot_time ("Entering shell"); - grub_cmdline_run (0, 1); + VasEBoot_normal_execute (config, 0, 0); + VasEBoot_boot_time ("Entering shell"); + VasEBoot_cmdline_run (0, 1); nested_level--; - if (grub_normal_exit_level) - grub_normal_exit_level--; - grub_boot_time ("Exiting normal mode"); + if (VasEBoot_normal_exit_level) + VasEBoot_normal_exit_level--; + VasEBoot_boot_time ("Exiting normal mode"); } /* Enter normal mode from rescue mode. */ -static grub_err_t -grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_normal (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { if (argc == 0) @@ -321,72 +321,72 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), char *config; const char *prefix; - prefix = grub_env_get ("prefix"); + prefix = VasEBoot_env_get ("prefix"); if (prefix) { - config = grub_xasprintf ("%s/grub.cfg", prefix); + config = VasEBoot_xasprintf ("%s/VasEBoot.cfg", prefix); if (! config) goto quit; - grub_enter_normal_mode (config); - grub_free (config); + VasEBoot_enter_normal_mode (config); + VasEBoot_free (config); } else - grub_enter_normal_mode (0); + VasEBoot_enter_normal_mode (0); } else - grub_enter_normal_mode (argv[0]); + VasEBoot_enter_normal_mode (argv[0]); quit: return 0; } /* Exit from normal mode to rescue mode. */ -static grub_err_t -grub_cmd_normal_exit (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_normal_exit (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - if (nested_level <= grub_normal_exit_level) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not in normal environment"); - grub_normal_exit_level++; - return GRUB_ERR_NONE; + if (nested_level <= VasEBoot_normal_exit_level) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "not in normal environment"); + VasEBoot_normal_exit_level++; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_normal_reader_init (int nested) +static VasEBoot_err_t +VasEBoot_normal_reader_init (int nested) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; const char *msg_esc = _("ESC at any time exits."); char *msg_formatted; - msg_formatted = grub_xasprintf (_("Minimal BASH-like line editing is supported. For " + msg_formatted = VasEBoot_xasprintf (_("Minimal BASH-like line editing is supported. For " "the first word, TAB lists possible command completions. Anywhere " "else TAB lists possible device or file completions. %s"), nested ? msg_esc : ""); if (!msg_formatted) - return grub_errno; + return VasEBoot_errno; FOR_ACTIVE_TERM_OUTPUTS(term) { - grub_normal_init_page (term, 1); - grub_term_setcursor (term, 1); + VasEBoot_normal_init_page (term, 1); + VasEBoot_term_setcursor (term, 1); - if (grub_term_width (term) > 3 + STANDARD_MARGIN + 20) - grub_print_message_indented (msg_formatted, 3, STANDARD_MARGIN, term); + if (VasEBoot_term_width (term) > 3 + STANDARD_MARGIN + 20) + VasEBoot_print_message_indented (msg_formatted, 3, STANDARD_MARGIN, term); else - grub_print_message_indented (msg_formatted, 0, 0, term); - grub_putcode ('\n', term); - grub_putcode ('\n', term); - grub_putcode ('\n', term); + VasEBoot_print_message_indented (msg_formatted, 0, 0, term); + VasEBoot_putcode ('\n', term); + VasEBoot_putcode ('\n', term); + VasEBoot_putcode ('\n', term); } - grub_free (msg_formatted); + VasEBoot_free (msg_formatted); return 0; } -static grub_err_t -grub_normal_read_line_real (char **line, int cont, int nested) +static VasEBoot_err_t +VasEBoot_normal_read_line_real (char **line, int cont, int nested) { const char *prompt; @@ -395,95 +395,95 @@ grub_normal_read_line_real (char **line, int cont, int nested) prompt = _(">"); else /* TRANSLATORS: it's command line prompt. */ - prompt = _("grub>"); + prompt = _("VasEBoot>"); if (!prompt) - return grub_errno; + return VasEBoot_errno; while (1) { - *line = grub_cmdline_get (prompt); + *line = VasEBoot_cmdline_get (prompt); if (*line) return 0; if (cont || nested) { - grub_free (*line); + VasEBoot_free (*line); *line = 0; - return grub_errno; + return VasEBoot_errno; } } } -static grub_err_t -grub_normal_read_line (char **line, int cont, +static VasEBoot_err_t +VasEBoot_normal_read_line (char **line, int cont, void *data __attribute__ ((unused))) { - return grub_normal_read_line_real (line, cont, 0); + return VasEBoot_normal_read_line_real (line, cont, 0); } void -grub_cmdline_run (int nested, int force_auth) +VasEBoot_cmdline_run (int nested, int force_auth) { - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; do { - err = grub_auth_check_authentication (NULL); + err = VasEBoot_auth_check_authentication (NULL); } while (err && force_auth); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - grub_normal_reader_init (nested); + VasEBoot_normal_reader_init (nested); while (1) { char *line = NULL; - if (grub_normal_exit_level) + if (VasEBoot_normal_exit_level) break; /* Print an error, if any. */ - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_normal_read_line_real (&line, 0, nested); + VasEBoot_normal_read_line_real (&line, 0, nested); if (! line) break; - grub_normal_parse_line (line, grub_normal_read_line, NULL); - grub_free (line); + VasEBoot_normal_parse_line (line, VasEBoot_normal_read_line, NULL); + VasEBoot_free (line); } } static char * -grub_env_write_pager (struct grub_env_var *var __attribute__ ((unused)), +VasEBoot_env_write_pager (struct VasEBoot_env_var *var __attribute__ ((unused)), const char *val) { - grub_set_more ((*val == '1')); - return grub_strdup (val); + VasEBoot_set_more ((*val == '1')); + return VasEBoot_strdup (val); } /* clear */ -static grub_err_t -grub_mini_cmd_clear (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_mini_cmd_clear (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_cls (); + VasEBoot_cls (); return 0; } -static grub_command_t cmd_clear; +static VasEBoot_command_t cmd_clear; -static void (*grub_xputs_saved) (const char *str); +static void (*VasEBoot_xputs_saved) (const char *str); static const char *features[] = { "feature_chainloader_bpb", "feature_ntldr", "feature_platform_search_hint", "feature_default_font_path", "feature_all_video_module", @@ -491,79 +491,79 @@ static const char *features[] = { "feature_nativedisk_cmd", "feature_timeout_style" }; -GRUB_MOD_INIT(normal) +VasEBoot_MOD_INIT(normal) { unsigned i; - grub_boot_time ("Preparing normal module"); + VasEBoot_boot_time ("Preparing normal module"); /* Previously many modules depended on gzio. Be nice to user and load it. */ - grub_dl_load ("gzio"); - grub_errno = 0; + VasEBoot_dl_load ("gzio"); + VasEBoot_errno = 0; - grub_normal_auth_init (); - grub_context_init (); - grub_script_init (); - grub_menu_init (); + VasEBoot_normal_auth_init (); + VasEBoot_context_init (); + VasEBoot_script_init (); + VasEBoot_menu_init (); - grub_xputs_saved = grub_xputs; - grub_xputs = grub_xputs_normal; + VasEBoot_xputs_saved = VasEBoot_xputs; + VasEBoot_xputs = VasEBoot_xputs_normal; /* Normal mode shouldn't be unloaded. */ if (mod) - grub_dl_ref (mod); + VasEBoot_dl_ref (mod); cmd_clear = - grub_register_command ("clear", grub_mini_cmd_clear, + VasEBoot_register_command ("clear", VasEBoot_mini_cmd_clear, 0, N_("Clear the screen.")); - grub_set_history (GRUB_DEFAULT_HISTORY_SIZE); + VasEBoot_set_history (VasEBoot_DEFAULT_HISTORY_SIZE); - grub_register_variable_hook ("pager", 0, grub_env_write_pager); - grub_env_export ("pager"); + VasEBoot_register_variable_hook ("pager", 0, VasEBoot_env_write_pager); + VasEBoot_env_export ("pager"); /* Register a command "normal" for the rescue mode. */ - grub_register_command ("normal", grub_cmd_normal, + VasEBoot_register_command ("normal", VasEBoot_cmd_normal, 0, N_("Enter normal mode.")); - grub_register_command ("normal_exit", grub_cmd_normal_exit, + VasEBoot_register_command ("normal_exit", VasEBoot_cmd_normal_exit, 0, N_("Exit from normal mode.")); /* Reload terminal colors when these variables are written to. */ - grub_register_variable_hook ("color_normal", NULL, grub_env_write_color_normal); - grub_register_variable_hook ("color_highlight", NULL, grub_env_write_color_highlight); + VasEBoot_register_variable_hook ("color_normal", NULL, VasEBoot_env_write_color_normal); + VasEBoot_register_variable_hook ("color_highlight", NULL, VasEBoot_env_write_color_highlight); /* Preserve hooks after context changes. */ - grub_env_export ("color_normal"); - grub_env_export ("color_highlight"); + VasEBoot_env_export ("color_normal"); + VasEBoot_env_export ("color_highlight"); /* Set default color names. */ - grub_env_set ("color_normal", "light-gray/black"); - grub_env_set ("color_highlight", "black/light-gray"); + VasEBoot_env_set ("color_normal", "light-gray/black"); + VasEBoot_env_set ("color_highlight", "black/light-gray"); for (i = 0; i < ARRAY_SIZE (features); i++) { - grub_env_set (features[i], "y"); - grub_env_export (features[i]); + VasEBoot_env_set (features[i], "y"); + VasEBoot_env_export (features[i]); } - grub_env_set ("grub_cpu", GRUB_TARGET_CPU); - grub_env_export ("grub_cpu"); - grub_env_set ("grub_platform", GRUB_PLATFORM); - grub_env_export ("grub_platform"); + VasEBoot_env_set ("VasEBoot_cpu", VasEBoot_TARGET_CPU); + VasEBoot_env_export ("VasEBoot_cpu"); + VasEBoot_env_set ("VasEBoot_platform", VasEBoot_PLATFORM); + VasEBoot_env_export ("VasEBoot_platform"); - grub_boot_time ("Normal module prepared"); + VasEBoot_boot_time ("Normal module prepared"); } -GRUB_MOD_FINI(normal) +VasEBoot_MOD_FINI(normal) { - grub_context_fini (); - grub_script_fini (); - grub_menu_fini (); - grub_normal_auth_fini (); + VasEBoot_context_fini (); + VasEBoot_script_fini (); + VasEBoot_menu_fini (); + VasEBoot_normal_auth_fini (); - grub_xputs = grub_xputs_saved; + VasEBoot_xputs = VasEBoot_xputs_saved; - grub_set_history (0); - grub_register_variable_hook ("pager", 0, 0); - grub_fs_autoload_hook = 0; - grub_unregister_command (cmd_clear); + VasEBoot_set_history (0); + VasEBoot_register_variable_hook ("pager", 0, 0); + VasEBoot_fs_autoload_hook = 0; + VasEBoot_unregister_command (cmd_clear); } diff --git a/VasEBoot-core/normal/menu.c b/VasEBoot-core/normal/menu.c index 719e2fb1c..d80d26e3b 100644 --- a/VasEBoot-core/normal/menu.c +++ b/VasEBoot-core/normal/menu.c @@ -1,43 +1,43 @@ /* menu.c - General supporting functionality for menus. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Time to delay after displaying an error message about a default/fallback entry failing to boot. */ #define DEFAULT_ENTRY_ERROR_DELAY_MS 2500 -grub_err_t (*grub_gfxmenu_try_hook) (int entry, grub_menu_t menu, +VasEBoot_err_t (*VasEBoot_gfxmenu_try_hook) (int entry, VasEBoot_menu_t menu, int nested) = NULL; enum timeout_style { @@ -59,26 +59,26 @@ struct timeout_style_name { /* Wait until the user pushes any key so that the user can see what happened. */ void -grub_wait_after_message (void) +VasEBoot_wait_after_message (void) { - grub_uint64_t endtime; - grub_xputs ("\n"); - grub_printf_ (N_("Press any key to continue...")); - grub_refresh (); + VasEBoot_uint64_t endtime; + VasEBoot_xputs ("\n"); + VasEBoot_printf_ (N_("Press any key to continue...")); + VasEBoot_refresh (); - endtime = grub_get_time_ms () + 10000; + endtime = VasEBoot_get_time_ms () + 10000; - while (grub_get_time_ms () < endtime - && grub_getkey_noblock () == GRUB_TERM_NO_KEY); + while (VasEBoot_get_time_ms () < endtime + && VasEBoot_getkey_noblock () == VasEBoot_TERM_NO_KEY); - grub_xputs ("\n"); + VasEBoot_xputs ("\n"); } /* Get a menu entry by its index in the entry list. */ -grub_menu_entry_t -grub_menu_get_entry (grub_menu_t menu, int no) +VasEBoot_menu_entry_t +VasEBoot_menu_get_entry (VasEBoot_menu_t menu, int no) { - grub_menu_entry_t e; + VasEBoot_menu_entry_t e; for (e = menu->entry_list; e && no > 0; e = e->next, no--) ; @@ -88,9 +88,9 @@ grub_menu_get_entry (grub_menu_t menu, int no) /* Get the index of a menu entry associated with a given hotkey, or -1. */ static int -get_entry_index_by_hotkey (grub_menu_t menu, int hotkey) +get_entry_index_by_hotkey (VasEBoot_menu_t menu, int hotkey) { - grub_menu_entry_t entry; + VasEBoot_menu_entry_t entry; int i; for (i = 0, entry = menu->entry_list; i < menu->size; @@ -109,12 +109,12 @@ get_timeout_style (void) const char *val; struct timeout_style_name *style_name; - val = grub_env_get ("timeout_style"); + val = VasEBoot_env_get ("timeout_style"); if (!val) return TIMEOUT_STYLE_MENU; for (style_name = timeout_style_names; style_name->name; style_name++) - if (grub_strcmp (style_name->name, val) == 0) + if (VasEBoot_strcmp (style_name->name, val) == 0) return style_name->style; return TIMEOUT_STYLE_MENU; @@ -123,43 +123,43 @@ get_timeout_style (void) /* Return the current timeout. If the variable "timeout" is not set or invalid, return -1. */ int -grub_menu_get_timeout (void) +VasEBoot_menu_get_timeout (void) { const char *val; int timeout; - val = grub_env_get ("timeout"); + val = VasEBoot_env_get ("timeout"); if (! val) return -1; - grub_error_push (); + VasEBoot_error_push (); - timeout = (int) grub_strtoul (val, 0, 0); + timeout = (int) VasEBoot_strtoul (val, 0, 0); /* If the value is invalid, unset the variable. */ - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_env_unset ("timeout"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_env_unset ("timeout"); + VasEBoot_errno = VasEBoot_ERR_NONE; timeout = -1; } - grub_error_pop (); + VasEBoot_error_pop (); return timeout; } /* Set current timeout in the variable "timeout". */ void -grub_menu_set_timeout (int timeout) +VasEBoot_menu_set_timeout (int timeout) { /* Ignore TIMEOUT if it is zero, because it will be unset really soon. */ if (timeout > 0) { char buf[16]; - grub_snprintf (buf, sizeof (buf), "%d", timeout); - grub_env_set ("timeout", buf); + VasEBoot_snprintf (buf, sizeof (buf), "%d", timeout); + VasEBoot_env_set ("timeout", buf); } } @@ -174,97 +174,97 @@ get_and_remove_first_entry_number (const char *name) char *tail; int entry; - val = grub_env_get (name); + val = VasEBoot_env_get (name); if (! val) return -1; - grub_error_push (); + VasEBoot_error_push (); - entry = (int) grub_strtoul (val, &tail, 0); + entry = (int) VasEBoot_strtoul (val, &tail, 0); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { /* Skip whitespace to find the next digit. */ - while (*tail && grub_isspace (*tail)) + while (*tail && VasEBoot_isspace (*tail)) tail++; - grub_env_set (name, tail); + VasEBoot_env_set (name, tail); } else { - grub_env_unset (name); - grub_errno = GRUB_ERR_NONE; + VasEBoot_env_unset (name); + VasEBoot_errno = VasEBoot_ERR_NONE; entry = -1; } - grub_error_pop (); + VasEBoot_error_pop (); return entry; } /* Run a menu entry. */ static void -grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) +VasEBoot_menu_execute_entry(VasEBoot_menu_entry_t entry, int auto_boot) { - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; int errs_before; - grub_menu_t menu = NULL; + VasEBoot_menu_t menu = NULL; char *optr, *buf, *oldchosen = NULL, *olddefault = NULL; const char *ptr, *chosen, *def; - grub_size_t sz = 0; + VasEBoot_size_t sz = 0; if (entry->restricted) - err = grub_auth_check_authentication (entry->users); + err = VasEBoot_auth_check_authentication (entry->users); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - errs_before = grub_err_printed_errors; + errs_before = VasEBoot_err_printed_errors; - chosen = grub_env_get ("chosen"); - def = grub_env_get ("default"); + chosen = VasEBoot_env_get ("chosen"); + def = VasEBoot_env_get ("default"); if (entry->submenu) { - grub_env_context_open (); - menu = grub_zalloc (sizeof (*menu)); + VasEBoot_env_context_open (); + menu = VasEBoot_zalloc (sizeof (*menu)); if (! menu) return; - grub_env_set_menu (menu); + VasEBoot_env_set_menu (menu); if (auto_boot) - grub_env_set ("timeout", "0"); + VasEBoot_env_set ("timeout", "0"); } for (ptr = entry->id; *ptr; ptr++) sz += (*ptr == '>') ? 2 : 1; if (chosen) { - oldchosen = grub_strdup (chosen); + oldchosen = VasEBoot_strdup (chosen); if (!oldchosen) - grub_print_error (); + VasEBoot_print_error (); } if (def) { - olddefault = grub_strdup (def); + olddefault = VasEBoot_strdup (def); if (!olddefault) - grub_print_error (); + VasEBoot_print_error (); } sz++; if (chosen) - sz += grub_strlen (chosen); + sz += VasEBoot_strlen (chosen); sz++; - buf = grub_malloc (sz); + buf = VasEBoot_malloc (sz); if (!buf) - grub_print_error (); + VasEBoot_print_error (); else { optr = buf; if (chosen) { - optr = grub_stpcpy (optr, chosen); + optr = VasEBoot_stpcpy (optr, chosen); *optr++ = '>'; } for (ptr = entry->id; *ptr; ptr++) @@ -274,9 +274,9 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) *optr++ = *ptr; } *optr = 0; - grub_env_set ("chosen", buf); - grub_env_export ("chosen"); - grub_free (buf); + VasEBoot_env_set ("chosen", buf); + VasEBoot_env_export ("chosen"); + VasEBoot_free (buf); } for (ptr = def; ptr && *ptr; ptr++) @@ -291,42 +291,42 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) } if (ptr && ptr[0] && ptr[1]) - grub_env_set ("default", ptr + 1); + VasEBoot_env_set ("default", ptr + 1); else - grub_env_unset ("default"); + VasEBoot_env_unset ("default"); - grub_script_execute_new_scope (entry->sourcecode, entry->argc, entry->args); + VasEBoot_script_execute_new_scope (entry->sourcecode, entry->argc, entry->args); - if (errs_before != grub_err_printed_errors) - grub_wait_after_message (); + if (errs_before != VasEBoot_err_printed_errors) + VasEBoot_wait_after_message (); - errs_before = grub_err_printed_errors; + errs_before = VasEBoot_err_printed_errors; - if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ()) + if (VasEBoot_errno == VasEBoot_ERR_NONE && VasEBoot_loader_is_loaded ()) /* Implicit execution of boot, only if something is loaded. */ - grub_command_execute ("boot", 0, 0); + VasEBoot_command_execute ("boot", 0, 0); - if (errs_before != grub_err_printed_errors) - grub_wait_after_message (); + if (errs_before != VasEBoot_err_printed_errors) + VasEBoot_wait_after_message (); if (entry->submenu) { if (menu && menu->size) { - grub_show_menu (menu, 1, auto_boot); - grub_normal_free_menu (menu); + VasEBoot_show_menu (menu, 1, auto_boot); + VasEBoot_normal_free_menu (menu); } - grub_env_context_close (); + VasEBoot_env_context_close (); } if (oldchosen) - grub_env_set ("chosen", oldchosen); + VasEBoot_env_set ("chosen", oldchosen); else - grub_env_unset ("chosen"); + VasEBoot_env_unset ("chosen"); if (olddefault) - grub_env_set ("default", olddefault); + VasEBoot_env_set ("default", olddefault); else - grub_env_unset ("default"); - grub_env_unset ("timeout"); + VasEBoot_env_unset ("default"); + VasEBoot_env_unset ("timeout"); } /* Execute ENTRY from the menu MENU, falling back to entries specified @@ -334,28 +334,28 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) pointer to a struct of function pointers which are used to allow the caller provide feedback to the user. */ static void -grub_menu_execute_with_fallback (grub_menu_t menu, - grub_menu_entry_t entry, +VasEBoot_menu_execute_with_fallback (VasEBoot_menu_t menu, + VasEBoot_menu_entry_t entry, int autobooted, - grub_menu_execute_callback_t callback, + VasEBoot_menu_execute_callback_t callback, void *callback_data) { int fallback_entry; callback->notify_booting (entry, callback_data); - grub_menu_execute_entry (entry, 1); + VasEBoot_menu_execute_entry (entry, 1); /* Deal with fallback entries. */ while ((fallback_entry = get_and_remove_first_entry_number ("fallback")) >= 0) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; - entry = grub_menu_get_entry (menu, fallback_entry); + entry = VasEBoot_menu_get_entry (menu, fallback_entry); callback->notify_fallback (entry, callback_data); - grub_menu_execute_entry (entry, 1); + VasEBoot_menu_execute_entry (entry, 1); /* If the function call to execute the entry returns at all, then this is taken to indicate a boot failure. For menu entries that do something other than actually boot an operating system, this could assume @@ -366,12 +366,12 @@ grub_menu_execute_with_fallback (grub_menu_t menu, callback->notify_failure (callback_data); } -static struct grub_menu_viewer *viewers; +static struct VasEBoot_menu_viewer *viewers; static void menu_set_chosen_entry (int entry) { - struct grub_menu_viewer *cur; + struct VasEBoot_menu_viewer *cur; for (cur = viewers; cur; cur = cur->next) cur->set_chosen_entry (entry, cur->data); } @@ -379,7 +379,7 @@ menu_set_chosen_entry (int entry) static void menu_print_timeout (int timeout) { - struct grub_menu_viewer *cur; + struct VasEBoot_menu_viewer *cur; for (cur = viewers; cur; cur = cur->next) cur->print_timeout (timeout, cur->data); } @@ -387,36 +387,36 @@ menu_print_timeout (int timeout) static void menu_fini (void) { - struct grub_menu_viewer *cur, *next; + struct VasEBoot_menu_viewer *cur, *next; for (cur = viewers; cur; cur = next) { next = cur->next; cur->fini (cur->data); - grub_free (cur); + VasEBoot_free (cur); } viewers = NULL; } static void -menu_init (int entry, grub_menu_t menu, int nested) +menu_init (int entry, VasEBoot_menu_t menu, int nested) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; int gfxmenu = 0; FOR_ACTIVE_TERM_OUTPUTS(term) if (term->fullscreen) { - if (grub_env_get ("theme")) + if (VasEBoot_env_get ("theme")) { - if (!grub_gfxmenu_try_hook) + if (!VasEBoot_gfxmenu_try_hook) { - grub_dl_load ("gfxmenu"); - grub_print_error (); + VasEBoot_dl_load ("gfxmenu"); + VasEBoot_print_error (); } - if (grub_gfxmenu_try_hook) + if (VasEBoot_gfxmenu_try_hook) { - grub_err_t err; - err = grub_gfxmenu_try_hook (entry, menu, nested); + VasEBoot_err_t err; + err = VasEBoot_gfxmenu_try_hook (entry, menu, nested); if(!err) { gfxmenu = 1; @@ -424,42 +424,42 @@ menu_init (int entry, grub_menu_t menu, int nested) } } else - grub_error (GRUB_ERR_BAD_MODULE, + VasEBoot_error (VasEBoot_ERR_BAD_MODULE, N_("module `%s' isn't loaded"), "gfxmenu"); - grub_print_error (); - grub_wait_after_message (); + VasEBoot_print_error (); + VasEBoot_wait_after_message (); } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; term->fullscreen (); break; } FOR_ACTIVE_TERM_OUTPUTS(term) { - grub_err_t err; + VasEBoot_err_t err; - if (grub_strcmp (term->name, "gfxterm") == 0 && gfxmenu) + if (VasEBoot_strcmp (term->name, "gfxterm") == 0 && gfxmenu) continue; - err = grub_menu_try_text (term, entry, menu, nested); + err = VasEBoot_menu_try_text (term, entry, menu, nested); if(!err) continue; - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } } static void clear_timeout (void) { - struct grub_menu_viewer *cur; + struct VasEBoot_menu_viewer *cur; for (cur = viewers; cur; cur = cur->next) cur->clear_timeout (cur->data); } void -grub_menu_register_viewer (struct grub_menu_viewer *viewer) +VasEBoot_menu_register_viewer (struct VasEBoot_menu_viewer *viewer) { viewer->next = viewers; viewers = viewer; @@ -491,26 +491,26 @@ menuentry_eq (const char *id, const char *spec) /* Get the entry number from the variable NAME. */ static int -get_entry_number (grub_menu_t menu, const char *name) +get_entry_number (VasEBoot_menu_t menu, const char *name) { const char *val; int entry; - val = grub_env_get (name); + val = VasEBoot_env_get (name); if (! val) return -1; - grub_error_push (); + VasEBoot_error_push (); - entry = (int) grub_strtoul (val, 0, 0); + entry = (int) VasEBoot_strtoul (val, 0, 0); - if (grub_errno == GRUB_ERR_BAD_NUMBER) + if (VasEBoot_errno == VasEBoot_ERR_BAD_NUMBER) { /* See if the variable matches the title of a menu entry. */ - grub_menu_entry_t e = menu->entry_list; + VasEBoot_menu_entry_t e = menu->entry_list; int i; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; for (i = 0; e; i++) { @@ -527,13 +527,13 @@ get_entry_number (grub_menu_t menu, const char *name) entry = -1; } - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; entry = -1; } - grub_error_pop (); + VasEBoot_error_pop (); return entry; } @@ -541,11 +541,11 @@ get_entry_number (grub_menu_t menu, const char *name) /* Check whether a second has elapsed since the last tick. If so, adjust the timer and return 1; otherwise, return 0. */ static int -has_second_elapsed (grub_uint64_t *saved_time) +has_second_elapsed (VasEBoot_uint64_t *saved_time) { - grub_uint64_t current_time; + VasEBoot_uint64_t current_time; - current_time = grub_get_time_ms (); + current_time = VasEBoot_get_time_ms (); if (current_time - *saved_time >= 1000) { *saved_time = current_time; @@ -556,16 +556,16 @@ has_second_elapsed (grub_uint64_t *saved_time) } static void -print_countdown (struct grub_term_coordinate *pos, int n) +print_countdown (struct VasEBoot_term_coordinate *pos, int n) { - grub_term_restore_pos (pos); + VasEBoot_term_restore_pos (pos); /* NOTE: Do not remove the trailing space characters. They are required to clear the line. */ - grub_printf ("%d ", n); - grub_refresh (); + VasEBoot_printf ("%d ", n); + VasEBoot_refresh (); } -#define GRUB_MENU_PAGE_SIZE 10 +#define VasEBoot_MENU_PAGE_SIZE 10 /* Show the menu and handle menu entry selection. Returns the menu entry index that should be executed or -1 if no entry should be executed (e.g., @@ -574,9 +574,9 @@ print_countdown (struct grub_term_coordinate *pos, int n) entry to be executed is a result of an automatic default selection because of the timeout. */ static int -run_menu (grub_menu_t menu, int nested, int *auto_boot) +run_menu (VasEBoot_menu_t menu, int nested, int *auto_boot) { - grub_uint64_t saved_time; + VasEBoot_uint64_t saved_time; int default_entry, current_entry; int timeout; enum timeout_style timeout_style; @@ -588,43 +588,43 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) if (default_entry < 0 || default_entry >= menu->size) default_entry = 0; - timeout = grub_menu_get_timeout (); + timeout = VasEBoot_menu_get_timeout (); if (timeout < 0) /* If there is no timeout, the "countdown" and "hidden" styles result in the system doing nothing and providing no or very little indication why. Technically this is what the user asked for, but it's not very useful and likely to be a source of confusion, so we disallow this. */ - grub_env_unset ("timeout_style"); + VasEBoot_env_unset ("timeout_style"); timeout_style = get_timeout_style (); if (timeout_style == TIMEOUT_STYLE_COUNTDOWN || timeout_style == TIMEOUT_STYLE_HIDDEN) { - static struct grub_term_coordinate *pos; + static struct VasEBoot_term_coordinate *pos; int entry = -1; if (timeout_style == TIMEOUT_STYLE_COUNTDOWN && timeout) { - pos = grub_term_save_pos (); + pos = VasEBoot_term_save_pos (); print_countdown (pos, timeout); } /* Enter interruptible sleep until Escape or a menu hotkey is pressed, or the timeout expires. */ - saved_time = grub_get_time_ms (); + saved_time = VasEBoot_get_time_ms (); while (1) { int key; - key = grub_getkey_noblock (); - if (key != GRUB_TERM_NO_KEY) + key = VasEBoot_getkey_noblock (); + if (key != VasEBoot_TERM_NO_KEY) { entry = get_entry_index_by_hotkey (menu, key); if (entry >= 0) break; } - if (key == GRUB_TERM_ESC) + if (key == VasEBoot_TERM_ESC) { timeout = -1; break; @@ -642,8 +642,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) break; } - grub_env_unset ("timeout"); - grub_env_unset ("timeout_style"); + VasEBoot_env_unset ("timeout"); + VasEBoot_env_unset ("timeout_style"); if (entry >= 0) { *auto_boot = 0; @@ -664,9 +664,9 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) menu_init (current_entry, menu, nested); /* Initialize the time. */ - saved_time = grub_get_time_ms (); + saved_time = VasEBoot_get_time_ms (); - timeout = grub_menu_get_timeout (); + timeout = VasEBoot_menu_get_timeout (); if (timeout > 0) menu_print_timeout (timeout); @@ -676,80 +676,80 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) while (1) { int c; - timeout = grub_menu_get_timeout (); + timeout = VasEBoot_menu_get_timeout (); - if (grub_normal_exit_level) + if (VasEBoot_normal_exit_level) return -1; if (timeout > 0 && has_second_elapsed (&saved_time)) { timeout--; - grub_menu_set_timeout (timeout); + VasEBoot_menu_set_timeout (timeout); menu_print_timeout (timeout); } if (timeout == 0) { - grub_env_unset ("timeout"); + VasEBoot_env_unset ("timeout"); *auto_boot = 1; menu_fini (); return default_entry; } - c = grub_getkey_noblock (); + c = VasEBoot_getkey_noblock (); - if (c != GRUB_TERM_NO_KEY) + if (c != VasEBoot_TERM_NO_KEY) { if (timeout >= 0) { - grub_env_unset ("timeout"); - grub_env_unset ("fallback"); + VasEBoot_env_unset ("timeout"); + VasEBoot_env_unset ("fallback"); clear_timeout (); } switch (c) { - case GRUB_TERM_KEY_HOME: - case GRUB_TERM_CTRL | 'a': + case VasEBoot_TERM_KEY_HOME: + case VasEBoot_TERM_CTRL | 'a': current_entry = 0; menu_set_chosen_entry (current_entry); break; - case GRUB_TERM_KEY_END: - case GRUB_TERM_CTRL | 'e': + case VasEBoot_TERM_KEY_END: + case VasEBoot_TERM_CTRL | 'e': current_entry = menu->size - 1; menu_set_chosen_entry (current_entry); break; - case GRUB_TERM_KEY_UP: - case GRUB_TERM_CTRL | 'p': + case VasEBoot_TERM_KEY_UP: + case VasEBoot_TERM_CTRL | 'p': case '^': if (current_entry > 0) current_entry--; menu_set_chosen_entry (current_entry); break; - case GRUB_TERM_CTRL | 'n': - case GRUB_TERM_KEY_DOWN: + case VasEBoot_TERM_CTRL | 'n': + case VasEBoot_TERM_KEY_DOWN: case 'v': if (current_entry < menu->size - 1) current_entry++; menu_set_chosen_entry (current_entry); break; - case GRUB_TERM_CTRL | 'g': - case GRUB_TERM_KEY_PPAGE: - if (current_entry < GRUB_MENU_PAGE_SIZE) + case VasEBoot_TERM_CTRL | 'g': + case VasEBoot_TERM_KEY_PPAGE: + if (current_entry < VasEBoot_MENU_PAGE_SIZE) current_entry = 0; else - current_entry -= GRUB_MENU_PAGE_SIZE; + current_entry -= VasEBoot_MENU_PAGE_SIZE; menu_set_chosen_entry (current_entry); break; - case GRUB_TERM_CTRL | 'c': - case GRUB_TERM_KEY_NPAGE: - if (current_entry + GRUB_MENU_PAGE_SIZE < menu->size) - current_entry += GRUB_MENU_PAGE_SIZE; + case VasEBoot_TERM_CTRL | 'c': + case VasEBoot_TERM_KEY_NPAGE: + if (current_entry + VasEBoot_MENU_PAGE_SIZE < menu->size) + current_entry += VasEBoot_MENU_PAGE_SIZE; else current_entry = menu->size - 1; menu_set_chosen_entry (current_entry); @@ -757,8 +757,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) case '\n': case '\r': - case GRUB_TERM_KEY_RIGHT: - case GRUB_TERM_CTRL | 'f': + case VasEBoot_TERM_KEY_RIGHT: + case VasEBoot_TERM_CTRL | 'f': menu_fini (); *auto_boot = 0; return current_entry; @@ -773,15 +773,15 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) case 'c': menu_fini (); - grub_cmdline_run (1, 0); + VasEBoot_cmdline_run (1, 0); goto refresh; case 'e': menu_fini (); { - grub_menu_entry_t e = grub_menu_get_entry (menu, current_entry); + VasEBoot_menu_entry_t e = VasEBoot_menu_get_entry (menu, current_entry); if (e) - grub_menu_entry_run (e); + VasEBoot_menu_entry_run (e); } goto refresh; @@ -807,25 +807,25 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) /* Callback invoked immediately before a menu entry is executed. */ static void -notify_booting (grub_menu_entry_t entry, +notify_booting (VasEBoot_menu_entry_t entry, void *userdata __attribute__((unused))) { - grub_printf (" "); - grub_printf_ (N_("Booting `%s'"), entry->title); - grub_printf ("\n\n"); + VasEBoot_printf (" "); + VasEBoot_printf_ (N_("Booting `%s'"), entry->title); + VasEBoot_printf ("\n\n"); } /* Callback invoked when a default menu entry executed because of a timeout has failed and an attempt will be made to execute the next fallback entry, ENTRY. */ static void -notify_fallback (grub_menu_entry_t entry, +notify_fallback (VasEBoot_menu_entry_t entry, void *userdata __attribute__((unused))) { - grub_printf ("\n "); - grub_printf_ (N_("Falling back to `%s'"), entry->title); - grub_printf ("\n\n"); - grub_millisleep (DEFAULT_ENTRY_ERROR_DELAY_MS); + VasEBoot_printf ("\n "); + VasEBoot_printf_ (N_("Falling back to `%s'"), entry->title); + VasEBoot_printf ("\n\n"); + VasEBoot_millisleep (DEFAULT_ENTRY_ERROR_DELAY_MS); } /* Callback invoked when a menu entry has failed and there is no remaining @@ -833,75 +833,75 @@ notify_fallback (grub_menu_entry_t entry, static void notify_execution_failure (void *userdata __attribute__((unused))) { - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_printf ("\n "); - grub_printf_ (N_("Failed to boot both default and fallback entries.\n")); - grub_wait_after_message (); + VasEBoot_printf ("\n "); + VasEBoot_printf_ (N_("Failed to boot both default and fallback entries.\n")); + VasEBoot_wait_after_message (); } /* Callbacks used by the text menu to provide user feedback when menu entries are executed. */ -static struct grub_menu_execute_callback execution_callback = +static struct VasEBoot_menu_execute_callback execution_callback = { .notify_booting = notify_booting, .notify_fallback = notify_fallback, .notify_failure = notify_execution_failure }; -static grub_err_t -show_menu (grub_menu_t menu, int nested, int autobooted) +static VasEBoot_err_t +show_menu (VasEBoot_menu_t menu, int nested, int autobooted) { while (1) { int boot_entry; - grub_menu_entry_t e; + VasEBoot_menu_entry_t e; int auto_boot; boot_entry = run_menu (menu, nested, &auto_boot); if (boot_entry < 0) break; - e = grub_menu_get_entry (menu, boot_entry); + e = VasEBoot_menu_get_entry (menu, boot_entry); if (! e) continue; /* Menu is empty. */ - grub_cls (); + VasEBoot_cls (); if (auto_boot) - grub_menu_execute_with_fallback (menu, e, autobooted, + VasEBoot_menu_execute_with_fallback (menu, e, autobooted, &execution_callback, 0); else - grub_menu_execute_entry (e, 0); + VasEBoot_menu_execute_entry (e, 0); if (autobooted) break; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_show_menu (grub_menu_t menu, int nested, int autoboot) +VasEBoot_err_t +VasEBoot_show_menu (VasEBoot_menu_t menu, int nested, int autoboot) { - grub_err_t err1, err2; + VasEBoot_err_t err1, err2; while (1) { err1 = show_menu (menu, nested, autoboot); autoboot = 0; - grub_print_error (); + VasEBoot_print_error (); - if (grub_normal_exit_level) + if (VasEBoot_normal_exit_level) break; - err2 = grub_auth_check_authentication (NULL); + err2 = VasEBoot_auth_check_authentication (NULL); if (err2) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } diff --git a/VasEBoot-core/normal/menu_entry.c b/VasEBoot-core/normal/menu_entry.c index eeeee5580..c1afa1593 100644 --- a/VasEBoot-core/normal/menu_entry.c +++ b/VasEBoot-core/normal/menu_entry.c @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include enum update_mode { @@ -38,19 +38,19 @@ enum update_mode struct line { /* The line buffer. */ - grub_uint32_t *buf; + VasEBoot_uint32_t *buf; /* The length of the line. */ int len; /* The maximum length of the line. */ int max_len; - struct grub_term_pos **pos; + struct VasEBoot_term_pos **pos; }; struct per_term_screen { - struct grub_term_output *term; + struct VasEBoot_term_output *term; int y_line_start; - struct grub_term_screen_geometry geo; + struct VasEBoot_term_screen_geometry geo; /* Scratch variables used when updating. Having them here avoids loads of small mallocs. */ int orig_num; @@ -84,8 +84,8 @@ struct screen /* Used for storing completion items temporarily. */ static struct { char *buf; - grub_size_t len; - grub_size_t max_len; + VasEBoot_size_t len; + VasEBoot_size_t max_len; } completion_buffer; static int completion_type; @@ -95,12 +95,12 @@ init_line (struct screen *screen, struct line *linep) { linep->len = 0; linep->max_len = 80; - linep->buf = grub_malloc ((linep->max_len + 1) * sizeof (linep->buf[0])); - linep->pos = grub_zalloc (screen->nterms * sizeof (linep->pos[0])); + linep->buf = VasEBoot_malloc ((linep->max_len + 1) * sizeof (linep->buf[0])); + linep->pos = VasEBoot_zalloc (screen->nterms * sizeof (linep->pos[0])); if (! linep->buf || !linep->pos) { - grub_free (linep->buf); - grub_free (linep->pos); + VasEBoot_free (linep->buf); + VasEBoot_free (linep->pos); return 0; } @@ -114,7 +114,7 @@ ensure_space (struct line *linep, int extra) if (linep->max_len < linep->len + extra) { linep->max_len = 2 * (linep->len + extra); - linep->buf = grub_realloc (linep->buf, (linep->max_len + 1) * sizeof (linep->buf[0])); + linep->buf = VasEBoot_realloc (linep->buf, (linep->max_len + 1) * sizeof (linep->buf[0])); if (! linep->buf) return 0; } @@ -126,7 +126,7 @@ ensure_space (struct line *linep, int extra) static int get_logical_num_lines (struct line *linep, struct per_term_screen *term_screen) { - grub_size_t width = grub_getstringwidth (linep->buf, linep->buf + linep->len, + VasEBoot_size_t width = VasEBoot_getstringwidth (linep->buf, linep->buf + linep->len, term_screen->term); /* Empty line still consumes space on screen */ @@ -141,7 +141,7 @@ advance_to (struct screen *screen, int c) if (c > screen->lines[screen->line].len) c = screen->lines[screen->line].len; - screen->column = grub_unicode_get_comb_end (screen->lines[screen->line].buf + screen->column = VasEBoot_unicode_get_comb_end (screen->lines[screen->line].buf + screen->lines[screen->line].len, screen->lines[screen->line].buf + c) @@ -154,64 +154,64 @@ print_empty_line (int y, struct per_term_screen *term_screen) { int i; - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { term_screen->geo.first_entry_x, + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { term_screen->geo.first_entry_x, y + term_screen->geo.first_entry_y }); for (i = 0; i < term_screen->geo.entry_width + 1; i++) - grub_putcode (' ', term_screen->term); + VasEBoot_putcode (' ', term_screen->term); } static void print_updown (int upflag, int downflag, struct per_term_screen *term_screen) { - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { term_screen->geo.first_entry_x + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { term_screen->geo.first_entry_x + term_screen->geo.entry_width + 1 + term_screen->geo.border, term_screen->geo.first_entry_y }); if (upflag && downflag) - grub_putcode (GRUB_UNICODE_UPDOWNARROW, term_screen->term); + VasEBoot_putcode (VasEBoot_UNICODE_UPDOWNARROW, term_screen->term); else if (upflag) - grub_putcode (GRUB_UNICODE_UPARROW, term_screen->term); + VasEBoot_putcode (VasEBoot_UNICODE_UPARROW, term_screen->term); else if (downflag) - grub_putcode (GRUB_UNICODE_DOWNARROW, term_screen->term); + VasEBoot_putcode (VasEBoot_UNICODE_DOWNARROW, term_screen->term); else - grub_putcode (' ', term_screen->term); + VasEBoot_putcode (' ', term_screen->term); } /* Print an up arrow. */ static void print_up (int flag, struct per_term_screen *term_screen) { - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { term_screen->geo.first_entry_x + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { term_screen->geo.first_entry_x + term_screen->geo.entry_width + 1 + term_screen->geo.border, term_screen->geo.first_entry_y }); if (flag) - grub_putcode (GRUB_UNICODE_UPARROW, term_screen->term); + VasEBoot_putcode (VasEBoot_UNICODE_UPARROW, term_screen->term); else - grub_putcode (' ', term_screen->term); + VasEBoot_putcode (' ', term_screen->term); } /* Print a down arrow. */ static void print_down (int flag, struct per_term_screen *term_screen) { - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { term_screen->geo.first_entry_x + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { term_screen->geo.first_entry_x + term_screen->geo.entry_width + 1 + term_screen->geo.border, term_screen->geo.first_entry_y + term_screen->geo.num_entries - 1 }); if (flag) - grub_putcode (GRUB_UNICODE_DOWNARROW, term_screen->term); + VasEBoot_putcode (VasEBoot_UNICODE_DOWNARROW, term_screen->term); else - grub_putcode (' ', term_screen->term); + VasEBoot_putcode (' ', term_screen->term); } /* Draw the lines of the screen SCREEN. */ @@ -232,7 +232,7 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, for (i = 0; i < screen->line; i++, linep++) y += get_logical_num_lines (linep, term_screen); linep = screen->lines + screen->line; - grub_size_t t = grub_getstringwidth (linep->buf, linep->buf + screen->column, + VasEBoot_size_t t = VasEBoot_getstringwidth (linep->buf, linep->buf + screen->column, term_screen->term); y += t / (unsigned) term_screen->geo.entry_width; if (t % (unsigned) term_screen->geo.entry_width == 0 @@ -254,7 +254,7 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, mode = ALL_LINES; } - grub_term_setcursor (term_screen->term, 0); + VasEBoot_term_setcursor (term_screen->term, 0); if (mode != NO_LINE) { @@ -279,7 +279,7 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, do { - struct grub_term_pos **pos; + struct VasEBoot_term_pos **pos; if (linep >= screen->lines + screen->num_lines) break; @@ -287,17 +287,17 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, pos = linep->pos + (term_screen - screen->terms); if (!*pos) - *pos = grub_zalloc ((linep->len + 1) * sizeof (**pos)); + *pos = VasEBoot_zalloc ((linep->len + 1) * sizeof (**pos)); if (i == region_start || linep == screen->lines + screen->line || (i > region_start && mode == ALL_LINES)) { - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { term_screen->geo.first_entry_x, + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { term_screen->geo.first_entry_x, (y < 0 ? 0 : y) + term_screen->geo.first_entry_y }); - grub_print_ucs4_menu (linep->buf, + VasEBoot_print_ucs4_menu (linep->buf, linep->buf + linep->len, term_screen->geo.first_entry_x, term_screen->geo.right_margin, @@ -342,7 +342,7 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, /* Place the cursor. */ if (screen->lines[screen->line].pos[term_screen - screen->terms]) { - const struct grub_term_pos *cpos; + const struct VasEBoot_term_pos *cpos; for (cpos = &(screen->lines[screen->line].pos[term_screen - screen->terms])[screen->column]; cpos >= &(screen->lines[screen->line].pos[term_screen - screen->terms])[0]; cpos--) @@ -352,20 +352,20 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, for (i = 0; i < screen->line; i++) y += get_logical_num_lines (screen->lines + i, term_screen); if (cpos >= &(screen->lines[screen->line].pos[term_screen - screen->terms])[0]) - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { cpos->x + term_screen->geo.first_entry_x, + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { cpos->x + term_screen->geo.first_entry_x, cpos->y + y + term_screen->geo.first_entry_y }); else - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { term_screen->geo.first_entry_x, + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { term_screen->geo.first_entry_x, y + term_screen->geo.first_entry_y }); } - grub_term_setcursor (term_screen->term, 1); + VasEBoot_term_setcursor (term_screen->term, 1); - grub_term_refresh (term_screen->term); + VasEBoot_term_refresh (term_screen->term); } static void @@ -403,7 +403,7 @@ insert_string (struct screen *screen, const char *s, int update) /* Make a new line. */ screen->num_lines++; - screen->lines = grub_realloc (screen->lines, + screen->lines = VasEBoot_realloc (screen->lines, screen->num_lines * sizeof (screen->lines[0])); if (! screen->lines) @@ -411,7 +411,7 @@ insert_string (struct screen *screen, const char *s, int update) /* Shift down if not appending after the last line. */ if (screen->line < screen->num_lines - 2) - grub_memmove (screen->lines + screen->line + 2, + VasEBoot_memmove (screen->lines + screen->line + 2, screen->lines + screen->line + 1, ((screen->num_lines - screen->line - 2) * sizeof (struct line))); @@ -427,13 +427,13 @@ insert_string (struct screen *screen, const char *s, int update) if (! ensure_space (next_linep, size)) return 0; - grub_memmove (next_linep->buf, + VasEBoot_memmove (next_linep->buf, current_linep->buf + screen->column, size * sizeof (next_linep->buf[0])); current_linep->len = screen->column; for (i = 0; i < screen->nterms; i++) { - grub_free (current_linep->pos[i]); + VasEBoot_free (current_linep->pos[i]); current_linep->pos[i] = 0; } next_linep->len = size; @@ -462,41 +462,41 @@ insert_string (struct screen *screen, const char *s, int update) const char *p; struct line *current_linep; int size; - grub_uint32_t *unicode_msg; + VasEBoot_uint32_t *unicode_msg; /* Find a string delimited by LF. */ - p = grub_strchr (s, '\n'); + p = VasEBoot_strchr (s, '\n'); if (! p) - p = s + grub_strlen (s); + p = s + VasEBoot_strlen (s); /* Insert the string. */ current_linep = screen->lines + screen->line; - unicode_msg = grub_malloc ((p - s) * sizeof (grub_uint32_t)); + unicode_msg = VasEBoot_malloc ((p - s) * sizeof (VasEBoot_uint32_t)); if (!unicode_msg) return 0; - size = grub_utf8_to_ucs4 (unicode_msg, (p - s), - (grub_uint8_t *) s, (p - s), 0); + size = VasEBoot_utf8_to_ucs4 (unicode_msg, (p - s), + (VasEBoot_uint8_t *) s, (p - s), 0); if (! ensure_space (current_linep, size)) { - grub_free (unicode_msg); + VasEBoot_free (unicode_msg); return 0; } - grub_memmove (current_linep->buf + screen->column + size, + VasEBoot_memmove (current_linep->buf + screen->column + size, current_linep->buf + screen->column, (current_linep->len - screen->column) * sizeof (current_linep->buf[0])); - grub_memmove (current_linep->buf + screen->column, + VasEBoot_memmove (current_linep->buf + screen->column, unicode_msg, size * sizeof (current_linep->buf[0])); - grub_free (unicode_msg); + VasEBoot_free (unicode_msg); for (i = 0; i < screen->nterms; i++) { - grub_free (current_linep->pos[i]); + VasEBoot_free (current_linep->pos[i]); current_linep->pos[i] = 0; } @@ -558,35 +558,35 @@ destroy_screen (struct screen *screen) unsigned j; if (linep->pos) for (j = 0; j < screen->nterms; j++) - grub_free (linep->pos[j]); + VasEBoot_free (linep->pos[j]); - grub_free (linep->buf); - grub_free (linep->pos); + VasEBoot_free (linep->buf); + VasEBoot_free (linep->pos); } } - grub_free (screen->killed_text); - grub_free (screen->lines); - grub_free (screen->terms); - grub_free (screen); + VasEBoot_free (screen->killed_text); + VasEBoot_free (screen->lines); + VasEBoot_free (screen->terms); + VasEBoot_free (screen); } /* Make a new screen. */ static struct screen * -make_screen (grub_menu_entry_t entry) +make_screen (VasEBoot_menu_entry_t entry) { struct screen *screen; unsigned i; /* Initialize the screen. */ - screen = grub_zalloc (sizeof (*screen)); + screen = VasEBoot_zalloc (sizeof (*screen)); if (! screen) return 0; screen->submenu = entry->submenu; screen->num_lines = 1; - screen->lines = grub_malloc (sizeof (struct line)); + screen->lines = VasEBoot_malloc (sizeof (struct line)); if (! screen->lines) goto fail; @@ -620,7 +620,7 @@ forward_char (struct screen *screen, int update) linep = screen->lines + screen->line; if (screen->column < linep->len) { - screen->column = grub_unicode_get_comb_end (screen->lines[screen->line].buf + screen->column = VasEBoot_unicode_get_comb_end (screen->lines[screen->line].buf + screen->lines[screen->line].len, screen->lines[screen->line].buf + screen->column + 1) @@ -644,24 +644,24 @@ backward_char (struct screen *screen, int update) { if (screen->column > 0) { - struct grub_unicode_glyph glyph; + struct VasEBoot_unicode_glyph glyph; struct line *linep; linep = screen->lines + screen->line; screen->column--; - screen->column = grub_unicode_get_comb_start (linep->buf, + screen->column = VasEBoot_unicode_get_comb_start (linep->buf, linep->buf + screen->column) - linep->buf; - grub_unicode_aglomerate_comb (screen->lines[screen->line].buf + screen->column, + VasEBoot_unicode_aglomerate_comb (screen->lines[screen->line].buf + screen->column, screen->lines[screen->line].len - screen->column, &glyph); - screen->column = grub_unicode_get_comb_start (linep->buf, + screen->column = VasEBoot_unicode_get_comb_start (linep->buf, linep->buf + screen->column) - linep->buf; - grub_unicode_destroy_glyph (&glyph); + VasEBoot_unicode_destroy_glyph (&glyph); } else if (screen->line > 0) { @@ -774,7 +774,7 @@ delete_char (struct screen *screen, int update) for (i = 0; i < screen->nterms; i++) screen->terms[i].orig_num = get_logical_num_lines (linep, &screen->terms[i]); - grub_memmove (linep->buf + screen->column, + VasEBoot_memmove (linep->buf + screen->column, linep->buf + screen->column + 1, (linep->len - screen->column - 1) * sizeof (linep->buf[0])); @@ -782,7 +782,7 @@ delete_char (struct screen *screen, int update) for (i = 0; i < screen->nterms; i++) { - grub_free (linep->pos[i]); + VasEBoot_free (linep->pos[i]); linep->pos[i] = 0; } start = screen->line; @@ -814,17 +814,17 @@ delete_char (struct screen *screen, int update) if (! ensure_space (linep, next_linep->len)) return 0; - grub_memmove (linep->buf + linep->len, next_linep->buf, + VasEBoot_memmove (linep->buf + linep->len, next_linep->buf, next_linep->len * sizeof (linep->buf[0])); linep->len += next_linep->len; for (i = 0; i < screen->nterms; i++) { - grub_free (linep->pos[i]); + VasEBoot_free (linep->pos[i]); linep->pos[i] = 0; } - grub_free (next_linep->buf); - grub_memmove (next_linep, + VasEBoot_free (next_linep->buf); + VasEBoot_memmove (next_linep, next_linep + 1, (screen->num_lines - screen->line - 2) * sizeof (struct line)); @@ -876,7 +876,7 @@ kill_line (struct screen *screen, int continuous, int update) size = linep->len - screen->column; if (p) - offset = grub_strlen (p); + offset = VasEBoot_strlen (p); else offset = 0; @@ -884,11 +884,11 @@ kill_line (struct screen *screen, int continuous, int update) { unsigned i; - p = grub_realloc (p, offset + size + 1); + p = VasEBoot_realloc (p, offset + size + 1); if (! p) return 0; - grub_memmove (p + offset, linep->buf + screen->column, size); + VasEBoot_memmove (p + offset, linep->buf + screen->column, size); p[offset + size] = '\0'; screen->killed_text = p; @@ -914,7 +914,7 @@ kill_line (struct screen *screen, int continuous, int update) } else if (screen->line + 1 < screen->num_lines) { - p = grub_realloc (p, offset + 1 + 1); + p = VasEBoot_realloc (p, offset + 1 + 1); if (! p) return 0; @@ -955,7 +955,7 @@ open_line (struct screen *screen, int update) /* A completion hook to print items. */ static void -store_completion (const char *item, grub_completion_type_t type, +store_completion (const char *item, VasEBoot_completion_type_t type, int count __attribute__ ((unused))) { char *p; @@ -964,16 +964,16 @@ store_completion (const char *item, grub_completion_type_t type, /* Make sure that the completion buffer has enough room. */ if (completion_buffer.max_len < (completion_buffer.len - + (int) grub_strlen (item) + 1 + 1)) + + (int) VasEBoot_strlen (item) + 1 + 1)) { - grub_size_t new_len; + VasEBoot_size_t new_len; - new_len = completion_buffer.len + grub_strlen (item) + 80; - p = grub_realloc (completion_buffer.buf, new_len); + new_len = completion_buffer.len + VasEBoot_strlen (item) + 80; + p = VasEBoot_realloc (completion_buffer.buf, new_len); if (! p) { /* Possibly not fatal. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } p[completion_buffer.len] = 0; @@ -987,8 +987,8 @@ store_completion (const char *item, grub_completion_type_t type, *p++ = ' '; completion_buffer.len++; } - grub_strcpy (p, item); - completion_buffer.len += grub_strlen (item); + VasEBoot_strcpy (p, item); + completion_buffer.len += VasEBoot_strlen (item); } static int @@ -999,9 +999,9 @@ complete (struct screen *screen, int continuous, int update) char *insert; static int count = -1; unsigned i; - grub_uint32_t *ucs4; - grub_size_t buflen; - grub_ssize_t ucs4len; + VasEBoot_uint32_t *ucs4; + VasEBoot_size_t buflen; + VasEBoot_ssize_t ucs4len; char *u8; if (continuous) @@ -1014,33 +1014,33 @@ complete (struct screen *screen, int continuous, int update) completion_buffer.max_len = 0; linep = screen->lines + screen->line; - u8 = grub_ucs4_to_utf8_alloc (linep->buf, screen->column); + u8 = VasEBoot_ucs4_to_utf8_alloc (linep->buf, screen->column); if (!u8) return 1; - insert = grub_normal_do_completion (u8, &restore, store_completion); + insert = VasEBoot_normal_do_completion (u8, &restore, store_completion); if (completion_buffer.buf) { - buflen = grub_strlen (completion_buffer.buf); - ucs4 = grub_malloc (sizeof (grub_uint32_t) * (buflen + 1)); + buflen = VasEBoot_strlen (completion_buffer.buf); + ucs4 = VasEBoot_malloc (sizeof (VasEBoot_uint32_t) * (buflen + 1)); if (!ucs4) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return 1; } - ucs4len = grub_utf8_to_ucs4 (ucs4, buflen, - (grub_uint8_t *) completion_buffer.buf, + ucs4len = VasEBoot_utf8_to_ucs4 (ucs4, buflen, + (VasEBoot_uint8_t *) completion_buffer.buf, buflen, 0); ucs4[ucs4len] = 0; if (restore) for (i = 0; i < screen->nterms; i++) { - unsigned width = grub_term_width (screen->terms[i].term); + unsigned width = VasEBoot_term_width (screen->terms[i].term); if (width > 2) width -= 2; if (width > 15) @@ -1048,65 +1048,65 @@ complete (struct screen *screen, int continuous, int update) unsigned num_sections = ((completion_buffer.len + width - 1) / width); - grub_uint32_t *endp; - struct grub_term_coordinate pos; - grub_uint32_t *p = ucs4; + VasEBoot_uint32_t *endp; + struct VasEBoot_term_coordinate pos; + VasEBoot_uint32_t *p = ucs4; - pos = grub_term_getxy (screen->terms[i].term); + pos = VasEBoot_term_getxy (screen->terms[i].term); screen->completion_shown = 1; - grub_term_gotoxy (screen->terms[i].term, - (struct grub_term_coordinate) { 0, + VasEBoot_term_gotoxy (screen->terms[i].term, + (struct VasEBoot_term_coordinate) { 0, screen->terms[i].geo.timeout_y }); if (screen->terms[i].geo.timeout_lines >= 2) { - grub_puts_terminal (" ", screen->terms[i].term); + VasEBoot_puts_terminal (" ", screen->terms[i].term); switch (completion_type) { - case GRUB_COMPLETION_TYPE_COMMAND: - grub_puts_terminal (_("Possible commands are:"), + case VasEBoot_COMPLETION_TYPE_COMMAND: + VasEBoot_puts_terminal (_("Possible commands are:"), screen->terms[i].term); break; - case GRUB_COMPLETION_TYPE_DEVICE: - grub_puts_terminal (_("Possible devices are:"), + case VasEBoot_COMPLETION_TYPE_DEVICE: + VasEBoot_puts_terminal (_("Possible devices are:"), screen->terms[i].term); break; - case GRUB_COMPLETION_TYPE_FILE: - grub_puts_terminal (_("Possible files are:"), + case VasEBoot_COMPLETION_TYPE_FILE: + VasEBoot_puts_terminal (_("Possible files are:"), screen->terms[i].term); break; - case GRUB_COMPLETION_TYPE_PARTITION: - grub_puts_terminal (_("Possible partitions are:"), + case VasEBoot_COMPLETION_TYPE_PARTITION: + VasEBoot_puts_terminal (_("Possible partitions are:"), screen->terms[i].term); break; - case GRUB_COMPLETION_TYPE_ARGUMENT: - grub_puts_terminal (_("Possible arguments are:"), + case VasEBoot_COMPLETION_TYPE_ARGUMENT: + VasEBoot_puts_terminal (_("Possible arguments are:"), screen->terms[i].term); break; default: - grub_puts_terminal (_("Possible things are:"), + VasEBoot_puts_terminal (_("Possible things are:"), screen->terms[i].term); break; } - grub_puts_terminal ("\n ", screen->terms[i].term); + VasEBoot_puts_terminal ("\n ", screen->terms[i].term); } p += ((unsigned) count % num_sections) * width; endp = p + width; if (p != ucs4) - grub_putcode (GRUB_UNICODE_LEFTARROW, screen->terms[i].term); + VasEBoot_putcode (VasEBoot_UNICODE_LEFTARROW, screen->terms[i].term); else - grub_putcode (' ', screen->terms[i].term); + VasEBoot_putcode (' ', screen->terms[i].term); - grub_print_ucs4 (p, ucs4 + ucs4len < endp ? ucs4 + ucs4len : endp, + VasEBoot_print_ucs4 (p, ucs4 + ucs4len < endp ? ucs4 + ucs4len : endp, 0, 0, screen->terms[i].term); if (ucs4 + ucs4len > endp) - grub_putcode (GRUB_UNICODE_RIGHTARROW, screen->terms[i].term); - grub_term_gotoxy (screen->terms[i].term, pos); + VasEBoot_putcode (VasEBoot_UNICODE_RIGHTARROW, screen->terms[i].term); + VasEBoot_term_gotoxy (screen->terms[i].term, pos); } } @@ -1114,12 +1114,12 @@ complete (struct screen *screen, int continuous, int update) { insert_string (screen, insert, update); count = -1; - grub_free (insert); + VasEBoot_free (insert); } else if (update) - grub_refresh (); + VasEBoot_refresh (); - grub_free (completion_buffer.buf); + VasEBoot_free (completion_buffer.buf); return 1; } @@ -1127,25 +1127,25 @@ complete (struct screen *screen, int continuous, int update) static void clear_completions (struct per_term_screen *term_screen) { - struct grub_term_coordinate pos; + struct VasEBoot_term_coordinate pos; unsigned j; int i; - pos = grub_term_getxy (term_screen->term); - grub_term_gotoxy (term_screen->term, - (struct grub_term_coordinate) { 0, + pos = VasEBoot_term_getxy (term_screen->term); + VasEBoot_term_gotoxy (term_screen->term, + (struct VasEBoot_term_coordinate) { 0, term_screen->geo.timeout_y }); for (i = 0; i < term_screen->geo.timeout_lines; i++) { - for (j = 0; j < grub_term_width (term_screen->term) - 1; j++) - grub_putcode (' ', term_screen->term); + for (j = 0; j < VasEBoot_term_width (term_screen->term) - 1; j++) + VasEBoot_putcode (' ', term_screen->term); if (i + 1 < term_screen->geo.timeout_lines) - grub_putcode ('\n', term_screen->term); + VasEBoot_putcode ('\n', term_screen->term); } - grub_term_gotoxy (term_screen->term, pos); - grub_term_refresh (term_screen->term); + VasEBoot_term_gotoxy (term_screen->term, pos); + VasEBoot_term_refresh (term_screen->term); } static void @@ -1163,72 +1163,72 @@ run (struct screen *screen) { char *script; int errs_before; - grub_menu_t menu = NULL; + VasEBoot_menu_t menu = NULL; char *dummy[1] = { NULL }; - grub_cls (); - grub_printf (" "); - grub_printf_ (N_("Booting a command list")); - grub_printf ("\n\n"); + VasEBoot_cls (); + VasEBoot_printf (" "); + VasEBoot_printf_ (N_("Booting a command list")); + VasEBoot_printf ("\n\n"); - errs_before = grub_err_printed_errors; + errs_before = VasEBoot_err_printed_errors; if (screen->submenu) { - grub_env_context_open (); - menu = grub_zalloc (sizeof (*menu)); + VasEBoot_env_context_open (); + menu = VasEBoot_zalloc (sizeof (*menu)); if (! menu) return 0; - grub_env_set_menu (menu); + VasEBoot_env_set_menu (menu); } /* Execute the script, line for line. */ { int i; - grub_size_t size = 0, tot_size = 0; + VasEBoot_size_t size = 0, tot_size = 0; for (i = 0; i < screen->num_lines; i++) - tot_size += grub_get_num_of_utf8_bytes (screen->lines[i].buf, + tot_size += VasEBoot_get_num_of_utf8_bytes (screen->lines[i].buf, screen->lines[i].len) + 1; - script = grub_malloc (tot_size + 1); + script = VasEBoot_malloc (tot_size + 1); if (! script) return 0; for (i = 0; i < screen->num_lines; i++) { - size += grub_ucs4_to_utf8 (screen->lines[i].buf, screen->lines[i].len, - (grub_uint8_t *) script + size, + size += VasEBoot_ucs4_to_utf8 (screen->lines[i].buf, screen->lines[i].len, + (VasEBoot_uint8_t *) script + size, tot_size - size); script[size++] = '\n'; } script[size] = '\0'; } - grub_script_execute_new_scope (script, 0, dummy); - grub_free (script); + VasEBoot_script_execute_new_scope (script, 0, dummy); + VasEBoot_free (script); - if (errs_before != grub_err_printed_errors) - grub_wait_after_message (); + if (errs_before != VasEBoot_err_printed_errors) + VasEBoot_wait_after_message (); - if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ()) + if (VasEBoot_errno == VasEBoot_ERR_NONE && VasEBoot_loader_is_loaded ()) /* Implicit execution of boot, only if something is loaded. */ - grub_command_execute ("boot", 0, 0); + VasEBoot_command_execute ("boot", 0, 0); if (screen->submenu) { if (menu && menu->size) { - grub_show_menu (menu, 1, 0); - grub_normal_free_menu (menu); + VasEBoot_show_menu (menu, 1, 0); + VasEBoot_normal_free_menu (menu); } - grub_env_context_close (); + VasEBoot_env_context_close (); } - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - grub_wait_after_message (); + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_wait_after_message (); } return 1; @@ -1236,20 +1236,20 @@ run (struct screen *screen) /* Edit a menu entry with an Emacs-like interface. */ void -grub_menu_entry_run (grub_menu_entry_t entry) +VasEBoot_menu_entry_run (VasEBoot_menu_entry_t entry) { struct screen *screen; int prev_c; - grub_err_t err = GRUB_ERR_NONE; + VasEBoot_err_t err = VasEBoot_ERR_NONE; unsigned i; - grub_term_output_t term; + VasEBoot_term_output_t term; - err = grub_auth_check_authentication (NULL); + err = VasEBoot_auth_check_authentication (NULL); if (err) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } @@ -1260,30 +1260,30 @@ grub_menu_entry_run (grub_menu_entry_t entry) screen->terms = NULL; refresh: - grub_free (screen->terms); + VasEBoot_free (screen->terms); screen->nterms = 0; FOR_ACTIVE_TERM_OUTPUTS(term) screen->nterms++; for (i = 0; i < (unsigned) screen->num_lines; i++) { - grub_free (screen->lines[i].pos); - screen->lines[i].pos = grub_zalloc (screen->nterms * sizeof (screen->lines[i].pos[0])); + VasEBoot_free (screen->lines[i].pos); + screen->lines[i].pos = VasEBoot_zalloc (screen->nterms * sizeof (screen->lines[i].pos[0])); if (! screen->lines[i].pos) { - grub_print_error (); + VasEBoot_print_error (); destroy_screen (screen); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } } - screen->terms = grub_zalloc (screen->nterms * sizeof (screen->terms[0])); + screen->terms = VasEBoot_zalloc (screen->nterms * sizeof (screen->terms[0])); if (!screen->terms) { - grub_print_error (); + VasEBoot_print_error (); destroy_screen (screen); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } i = 0; @@ -1295,16 +1295,16 @@ grub_menu_entry_run (grub_menu_entry_t entry) } /* Draw the screen. */ for (i = 0; i < screen->nterms; i++) - grub_menu_init_page (0, 1, &screen->terms[i].geo, + VasEBoot_menu_init_page (0, 1, &screen->terms[i].geo, screen->terms[i].term); update_screen_all (screen, 0, 0, 1, 1, ALL_LINES); for (i = 0; i < screen->nterms; i++) - grub_term_setcursor (screen->terms[i].term, 1); + VasEBoot_term_setcursor (screen->terms[i].term, 1); prev_c = '\0'; while (1) { - int c = grub_getkey (); + int c = VasEBoot_getkey (); if (screen->completion_shown) { @@ -1312,7 +1312,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) screen->completion_shown = 0; } - if (grub_normal_exit_level) + if (VasEBoot_normal_exit_level) { destroy_screen (screen); return; @@ -1320,79 +1320,79 @@ grub_menu_entry_run (grub_menu_entry_t entry) switch (c) { - case GRUB_TERM_KEY_UP: - case GRUB_TERM_CTRL | 'p': + case VasEBoot_TERM_KEY_UP: + case VasEBoot_TERM_CTRL | 'p': if (! previous_line (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'n': - case GRUB_TERM_KEY_DOWN: + case VasEBoot_TERM_CTRL | 'n': + case VasEBoot_TERM_KEY_DOWN: if (! next_line (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'f': - case GRUB_TERM_KEY_RIGHT: + case VasEBoot_TERM_CTRL | 'f': + case VasEBoot_TERM_KEY_RIGHT: if (! forward_char (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'b': - case GRUB_TERM_KEY_LEFT: + case VasEBoot_TERM_CTRL | 'b': + case VasEBoot_TERM_KEY_LEFT: if (! backward_char (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'a': - case GRUB_TERM_KEY_HOME: + case VasEBoot_TERM_CTRL | 'a': + case VasEBoot_TERM_KEY_HOME: if (! beginning_of_line (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'e': - case GRUB_TERM_KEY_END: + case VasEBoot_TERM_CTRL | 'e': + case VasEBoot_TERM_KEY_END: if (! end_of_line (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'i': + case VasEBoot_TERM_CTRL | 'i': case '\t': if (! complete (screen, prev_c == c, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'd': - case GRUB_TERM_KEY_DC: + case VasEBoot_TERM_CTRL | 'd': + case VasEBoot_TERM_KEY_DC: if (! delete_char (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'h': + case VasEBoot_TERM_CTRL | 'h': case '\b': if (! backward_delete_char (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'k': + case VasEBoot_TERM_CTRL | 'k': if (! kill_line (screen, prev_c == c, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'u': + case VasEBoot_TERM_CTRL | 'u': /* FIXME: What behavior is good for this key? */ break; - case GRUB_TERM_CTRL | 'y': + case VasEBoot_TERM_CTRL | 'y': if (! yank (screen, 1)) goto fail; break; - case GRUB_TERM_CTRL | 'l': + case VasEBoot_TERM_CTRL | 'l': /* FIXME: centering. */ goto refresh; - case GRUB_TERM_CTRL | 'o': + case VasEBoot_TERM_CTRL | 'o': if (! open_line (screen, 1)) goto fail; break; @@ -1407,24 +1407,24 @@ grub_menu_entry_run (grub_menu_entry_t entry) destroy_screen (screen); return; - case GRUB_TERM_CTRL | 'c': - case GRUB_TERM_KEY_F2: - grub_cmdline_run (1, 0); + case VasEBoot_TERM_CTRL | 'c': + case VasEBoot_TERM_KEY_F2: + VasEBoot_cmdline_run (1, 0); goto refresh; - case GRUB_TERM_CTRL | 'x': - case GRUB_TERM_KEY_F10: + case VasEBoot_TERM_CTRL | 'x': + case VasEBoot_TERM_KEY_F10: run (screen); goto refresh; - case GRUB_TERM_CTRL | 'r': - case GRUB_TERM_CTRL | 's': - case GRUB_TERM_CTRL | 't': + case VasEBoot_TERM_CTRL | 'r': + case VasEBoot_TERM_CTRL | 's': + case VasEBoot_TERM_CTRL | 't': /* FIXME */ break; default: - if (grub_isprint (c)) + if (VasEBoot_isprint (c)) { char buf[2]; @@ -1442,10 +1442,10 @@ grub_menu_entry_run (grub_menu_entry_t entry) fail: destroy_screen (screen); - grub_cls (); - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - grub_xputs ("\n"); - grub_printf_ (N_("Press any key to continue...")); - (void) grub_getkey (); + VasEBoot_cls (); + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_xputs ("\n"); + VasEBoot_printf_ (N_("Press any key to continue...")); + (void) VasEBoot_getkey (); } diff --git a/VasEBoot-core/normal/menu_text.c b/VasEBoot-core/normal/menu_text.c index e22bb91f6..8968af8db 100644 --- a/VasEBoot-core/normal/menu_text.c +++ b/VasEBoot-core/normal/menu_text.c @@ -1,165 +1,165 @@ /* menu_text.c - Basic text menu implementation. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_uint8_t grub_color_menu_normal; -static grub_uint8_t grub_color_menu_highlight; +static VasEBoot_uint8_t VasEBoot_color_menu_normal; +static VasEBoot_uint8_t VasEBoot_color_menu_highlight; struct menu_viewer_data { int first, offset; - struct grub_term_screen_geometry geo; + struct VasEBoot_term_screen_geometry geo; enum { TIMEOUT_UNKNOWN, TIMEOUT_NORMAL, TIMEOUT_TERSE, TIMEOUT_TERSE_NO_MARGIN } timeout_msg; - grub_menu_t menu; - struct grub_term_output *term; + VasEBoot_menu_t menu; + struct VasEBoot_term_output *term; }; static inline int -grub_term_cursor_x (const struct grub_term_screen_geometry *geo) +VasEBoot_term_cursor_x (const struct VasEBoot_term_screen_geometry *geo) { return (geo->first_entry_x + geo->entry_width); } -grub_size_t -grub_getstringwidth (grub_uint32_t * str, const grub_uint32_t * last_position, - struct grub_term_output *term) +VasEBoot_size_t +VasEBoot_getstringwidth (VasEBoot_uint32_t * str, const VasEBoot_uint32_t * last_position, + struct VasEBoot_term_output *term) { - grub_ssize_t width = 0; + VasEBoot_ssize_t width = 0; while (str < last_position) { - struct grub_unicode_glyph glyph; + struct VasEBoot_unicode_glyph glyph; glyph.ncomb = 0; - str += grub_unicode_aglomerate_comb (str, last_position - str, &glyph); - width += grub_term_getcharwidth (term, &glyph); - grub_unicode_destroy_glyph (&glyph); + str += VasEBoot_unicode_aglomerate_comb (str, last_position - str, &glyph); + width += VasEBoot_term_getcharwidth (term, &glyph); + VasEBoot_unicode_destroy_glyph (&glyph); } return width; } static int -grub_print_message_indented_real (const char *msg, int margin_left, +VasEBoot_print_message_indented_real (const char *msg, int margin_left, int margin_right, - struct grub_term_output *term, int dry_run) + struct VasEBoot_term_output *term, int dry_run) { - grub_uint32_t *unicode_msg; - grub_uint32_t *last_position; - grub_size_t msg_len = grub_strlen (msg) + 2; + VasEBoot_uint32_t *unicode_msg; + VasEBoot_uint32_t *last_position; + VasEBoot_size_t msg_len = VasEBoot_strlen (msg) + 2; int ret = 0; - unicode_msg = grub_malloc (msg_len * sizeof (grub_uint32_t)); + unicode_msg = VasEBoot_malloc (msg_len * sizeof (VasEBoot_uint32_t)); if (!unicode_msg) return 0; - msg_len = grub_utf8_to_ucs4 (unicode_msg, msg_len, - (grub_uint8_t *) msg, -1, 0); + msg_len = VasEBoot_utf8_to_ucs4 (unicode_msg, msg_len, + (VasEBoot_uint8_t *) msg, -1, 0); last_position = unicode_msg + msg_len; *last_position = 0; if (dry_run) - ret = grub_ucs4_count_lines (unicode_msg, last_position, margin_left, + ret = VasEBoot_ucs4_count_lines (unicode_msg, last_position, margin_left, margin_right, term); else - grub_print_ucs4_menu (unicode_msg, last_position, margin_left, + VasEBoot_print_ucs4_menu (unicode_msg, last_position, margin_left, margin_right, term, 0, -1, 0, 0); - grub_free (unicode_msg); + VasEBoot_free (unicode_msg); return ret; } void -grub_print_message_indented (const char *msg, int margin_left, int margin_right, - struct grub_term_output *term) +VasEBoot_print_message_indented (const char *msg, int margin_left, int margin_right, + struct VasEBoot_term_output *term) { - grub_print_message_indented_real (msg, margin_left, margin_right, term, 0); + VasEBoot_print_message_indented_real (msg, margin_left, margin_right, term, 0); } static void -draw_border (struct grub_term_output *term, const struct grub_term_screen_geometry *geo) +draw_border (struct VasEBoot_term_output *term, const struct VasEBoot_term_screen_geometry *geo) { int i; - grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); + VasEBoot_term_setcolorstate (term, VasEBoot_TERM_COLOR_NORMAL); - grub_term_gotoxy (term, (struct grub_term_coordinate) { geo->first_entry_x - 1, + VasEBoot_term_gotoxy (term, (struct VasEBoot_term_coordinate) { geo->first_entry_x - 1, geo->first_entry_y - 1 }); - grub_putcode (GRUB_UNICODE_CORNER_UL, term); + VasEBoot_putcode (VasEBoot_UNICODE_CORNER_UL, term); for (i = 0; i < geo->entry_width + 1; i++) - grub_putcode (GRUB_UNICODE_HLINE, term); - grub_putcode (GRUB_UNICODE_CORNER_UR, term); + VasEBoot_putcode (VasEBoot_UNICODE_HLINE, term); + VasEBoot_putcode (VasEBoot_UNICODE_CORNER_UR, term); for (i = 0; i < geo->num_entries; i++) { - grub_term_gotoxy (term, (struct grub_term_coordinate) { geo->first_entry_x - 1, + VasEBoot_term_gotoxy (term, (struct VasEBoot_term_coordinate) { geo->first_entry_x - 1, geo->first_entry_y + i }); - grub_putcode (GRUB_UNICODE_VLINE, term); - grub_term_gotoxy (term, - (struct grub_term_coordinate) { geo->first_entry_x + geo->entry_width + 1, + VasEBoot_putcode (VasEBoot_UNICODE_VLINE, term); + VasEBoot_term_gotoxy (term, + (struct VasEBoot_term_coordinate) { geo->first_entry_x + geo->entry_width + 1, geo->first_entry_y + i }); - grub_putcode (GRUB_UNICODE_VLINE, term); + VasEBoot_putcode (VasEBoot_UNICODE_VLINE, term); } - grub_term_gotoxy (term, - (struct grub_term_coordinate) { geo->first_entry_x - 1, + VasEBoot_term_gotoxy (term, + (struct VasEBoot_term_coordinate) { geo->first_entry_x - 1, geo->first_entry_y - 1 + geo->num_entries + 1 }); - grub_putcode (GRUB_UNICODE_CORNER_LL, term); + VasEBoot_putcode (VasEBoot_UNICODE_CORNER_LL, term); for (i = 0; i < geo->entry_width + 1; i++) - grub_putcode (GRUB_UNICODE_HLINE, term); - grub_putcode (GRUB_UNICODE_CORNER_LR, term); + VasEBoot_putcode (VasEBoot_UNICODE_HLINE, term); + VasEBoot_putcode (VasEBoot_UNICODE_CORNER_LR, term); - grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); + VasEBoot_term_setcolorstate (term, VasEBoot_TERM_COLOR_NORMAL); - grub_term_gotoxy (term, - (struct grub_term_coordinate) { geo->first_entry_x - 1, + VasEBoot_term_gotoxy (term, + (struct VasEBoot_term_coordinate) { geo->first_entry_x - 1, (geo->first_entry_y - 1 + geo->num_entries - + GRUB_TERM_MARGIN + 1) }); + + VasEBoot_TERM_MARGIN + 1) }); } static int -print_message (int nested, int edit, struct grub_term_output *term, int dry_run) +print_message (int nested, int edit, struct VasEBoot_term_output *term, int dry_run) { int ret = 0; - grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); + VasEBoot_term_setcolorstate (term, VasEBoot_TERM_COLOR_NORMAL); if (edit) { - ret += grub_print_message_indented_real (_("Minimum Emacs-like screen editing is \ + ret += VasEBoot_print_message_indented_real (_("Minimum Emacs-like screen editing is \ supported. TAB lists completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for a \ -command-line or ESC to discard edits and return to the GRUB menu."), +command-line or ESC to discard edits and return to the VasEBoot menu."), STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); } @@ -167,20 +167,20 @@ command-line or ESC to discard edits and return to the GRUB menu."), { char *msg_translated; - msg_translated = grub_xasprintf (_("Use the %C and %C keys to select which " + msg_translated = VasEBoot_xasprintf (_("Use the %C and %C keys to select which " "entry is highlighted."), - GRUB_UNICODE_UPARROW, - GRUB_UNICODE_DOWNARROW); + VasEBoot_UNICODE_UPARROW, + VasEBoot_UNICODE_DOWNARROW); if (!msg_translated) return 0; - ret += grub_print_message_indented_real (msg_translated, STANDARD_MARGIN, + ret += VasEBoot_print_message_indented_real (msg_translated, STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); - grub_free (msg_translated); + VasEBoot_free (msg_translated); if (nested) { - ret += grub_print_message_indented_real + ret += VasEBoot_print_message_indented_real (_("Press enter to boot the selected OS, " "`e' to edit the commands before booting " "or `c' for a command-line. ESC to return previous menu."), @@ -188,7 +188,7 @@ command-line or ESC to discard edits and return to the GRUB menu."), } else { - ret += grub_print_message_indented_real + ret += VasEBoot_print_message_indented_real (_("Press enter to boot the selected OS, " "`e' to edit the commands before booting " "or `c' for a command-line."), @@ -199,41 +199,41 @@ command-line or ESC to discard edits and return to the GRUB menu."), } static void -print_entry (int y, int highlight, grub_menu_entry_t entry, +print_entry (int y, int highlight, VasEBoot_menu_entry_t entry, const struct menu_viewer_data *data) { const char *title; - grub_size_t title_len; - grub_ssize_t len; - grub_uint32_t *unicode_title; - grub_ssize_t i; - grub_uint8_t old_color_normal, old_color_highlight; + VasEBoot_size_t title_len; + VasEBoot_ssize_t len; + VasEBoot_uint32_t *unicode_title; + VasEBoot_ssize_t i; + VasEBoot_uint8_t old_color_normal, old_color_highlight; title = entry ? entry->title : ""; - title_len = grub_strlen (title); - unicode_title = grub_malloc (title_len * sizeof (*unicode_title)); + title_len = VasEBoot_strlen (title); + unicode_title = VasEBoot_malloc (title_len * sizeof (*unicode_title)); if (! unicode_title) /* XXX How to show this error? */ return; - len = grub_utf8_to_ucs4 (unicode_title, title_len, - (grub_uint8_t *) title, -1, 0); + len = VasEBoot_utf8_to_ucs4 (unicode_title, title_len, + (VasEBoot_uint8_t *) title, -1, 0); if (len < 0) { /* It is an invalid sequence. */ - grub_free (unicode_title); + VasEBoot_free (unicode_title); return; } - old_color_normal = grub_term_normal_color; - old_color_highlight = grub_term_highlight_color; - grub_term_normal_color = grub_color_menu_normal; - grub_term_highlight_color = grub_color_menu_highlight; - grub_term_setcolorstate (data->term, highlight - ? GRUB_TERM_COLOR_HIGHLIGHT - : GRUB_TERM_COLOR_NORMAL); + old_color_normal = VasEBoot_term_normal_color; + old_color_highlight = VasEBoot_term_highlight_color; + VasEBoot_term_normal_color = VasEBoot_color_menu_normal; + VasEBoot_term_highlight_color = VasEBoot_color_menu_highlight; + VasEBoot_term_setcolorstate (data->term, highlight + ? VasEBoot_TERM_COLOR_HIGHLIGHT + : VasEBoot_TERM_COLOR_NORMAL); - grub_term_gotoxy (data->term, (struct grub_term_coordinate) { + VasEBoot_term_gotoxy (data->term, (struct VasEBoot_term_coordinate) { data->geo.first_entry_x, y }); for (i = 0; i < len; i++) @@ -242,35 +242,35 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, unicode_title[i] = ' '; if (data->geo.num_entries > 1) - grub_putcode (highlight ? '*' : ' ', data->term); + VasEBoot_putcode (highlight ? '*' : ' ', data->term); - grub_print_ucs4_menu (unicode_title, + VasEBoot_print_ucs4_menu (unicode_title, unicode_title + len, 0, data->geo.right_margin, data->term, 0, 1, - GRUB_UNICODE_RIGHTARROW, 0); + VasEBoot_UNICODE_RIGHTARROW, 0); - grub_term_setcolorstate (data->term, GRUB_TERM_COLOR_NORMAL); - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { - grub_term_cursor_x (&data->geo), y }); + VasEBoot_term_setcolorstate (data->term, VasEBoot_TERM_COLOR_NORMAL); + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { + VasEBoot_term_cursor_x (&data->geo), y }); - grub_term_normal_color = old_color_normal; - grub_term_highlight_color = old_color_highlight; + VasEBoot_term_normal_color = old_color_normal; + VasEBoot_term_highlight_color = old_color_highlight; - grub_term_setcolorstate (data->term, GRUB_TERM_COLOR_NORMAL); - grub_free (unicode_title); + VasEBoot_term_setcolorstate (data->term, VasEBoot_TERM_COLOR_NORMAL); + VasEBoot_free (unicode_title); } static void -print_entries (grub_menu_t menu, const struct menu_viewer_data *data) +print_entries (VasEBoot_menu_t menu, const struct menu_viewer_data *data) { - grub_menu_entry_t e; + VasEBoot_menu_entry_t e; int i; - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { data->geo.first_entry_x + data->geo.entry_width + data->geo.border + 1, data->geo.first_entry_y }); @@ -278,11 +278,11 @@ print_entries (grub_menu_t menu, const struct menu_viewer_data *data) if (data->geo.num_entries != 1) { if (data->first) - grub_putcode (GRUB_UNICODE_UPARROW, data->term); + VasEBoot_putcode (VasEBoot_UNICODE_UPARROW, data->term); else - grub_putcode (' ', data->term); + VasEBoot_putcode (' ', data->term); } - e = grub_menu_get_entry (menu, data->first); + e = VasEBoot_menu_get_entry (menu, data->first); for (i = 0; i < data->geo.num_entries; i++) { @@ -292,31 +292,31 @@ print_entries (grub_menu_t menu, const struct menu_viewer_data *data) e = e->next; } - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { data->geo.first_entry_x + data->geo.entry_width + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { data->geo.first_entry_x + data->geo.entry_width + data->geo.border + 1, data->geo.first_entry_y + data->geo.num_entries - 1 }); if (data->geo.num_entries == 1) { if (data->first && e) - grub_putcode (GRUB_UNICODE_UPDOWNARROW, data->term); + VasEBoot_putcode (VasEBoot_UNICODE_UPDOWNARROW, data->term); else if (data->first) - grub_putcode (GRUB_UNICODE_UPARROW, data->term); + VasEBoot_putcode (VasEBoot_UNICODE_UPARROW, data->term); else if (e) - grub_putcode (GRUB_UNICODE_DOWNARROW, data->term); + VasEBoot_putcode (VasEBoot_UNICODE_DOWNARROW, data->term); else - grub_putcode (' ', data->term); + VasEBoot_putcode (' ', data->term); } else { if (e) - grub_putcode (GRUB_UNICODE_DOWNARROW, data->term); + VasEBoot_putcode (VasEBoot_UNICODE_DOWNARROW, data->term); else - grub_putcode (' ', data->term); + VasEBoot_putcode (' ', data->term); } - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { grub_term_cursor_x (&data->geo), + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { VasEBoot_term_cursor_x (&data->geo), data->geo.first_entry_y + data->offset }); } @@ -324,11 +324,11 @@ print_entries (grub_menu_t menu, const struct menu_viewer_data *data) is run from another menu or a command-line. If EDIT is non-zero, show a message for the menu entry editor. */ void -grub_menu_init_page (int nested, int edit, - struct grub_term_screen_geometry *geo, - struct grub_term_output *term) +VasEBoot_menu_init_page (int nested, int edit, + struct VasEBoot_term_screen_geometry *geo, + struct VasEBoot_term_output *term) { - grub_uint8_t old_color_normal, old_color_highlight; + VasEBoot_uint8_t old_color_normal, old_color_highlight; int msg_num_lines; int bottom_message = 1; int empty_lines = 1; @@ -336,15 +336,15 @@ grub_menu_init_page (int nested, int edit, geo->border = 1; geo->first_entry_x = 1 /* margin */ + 1 /* border */; - geo->entry_width = grub_term_width (term) - 5; + geo->entry_width = VasEBoot_term_width (term) - 5; geo->first_entry_y = 2 /* two empty lines*/ - + 1 /* GNU GRUB version text */ + 1 /* top border */; + + 1 /* GNU VasEBoot version text */ + 1 /* top border */; geo->timeout_lines = 2; /* 3 lines for timeout message and bottom margin. 2 lines for the border. */ - geo->num_entries = grub_term_height (term) - geo->first_entry_y + geo->num_entries = VasEBoot_term_height (term) - geo->first_entry_y - 1 /* bottom border */ - 1 /* empty line before info message*/ - geo->timeout_lines /* timeout */ @@ -392,40 +392,40 @@ grub_menu_init_page (int nested, int edit, bottom_message = 0; /* By default, use the same colors for the menu. */ - old_color_normal = grub_term_normal_color; - old_color_highlight = grub_term_highlight_color; - grub_color_menu_normal = grub_term_normal_color; - grub_color_menu_highlight = grub_term_highlight_color; + old_color_normal = VasEBoot_term_normal_color; + old_color_highlight = VasEBoot_term_highlight_color; + VasEBoot_color_menu_normal = VasEBoot_term_normal_color; + VasEBoot_color_menu_highlight = VasEBoot_term_highlight_color; /* Then give user a chance to replace them. */ - grub_parse_color_name_pair (&grub_color_menu_normal, - grub_env_get ("menu_color_normal")); - grub_parse_color_name_pair (&grub_color_menu_highlight, - grub_env_get ("menu_color_highlight")); + VasEBoot_parse_color_name_pair (&VasEBoot_color_menu_normal, + VasEBoot_env_get ("menu_color_normal")); + VasEBoot_parse_color_name_pair (&VasEBoot_color_menu_highlight, + VasEBoot_env_get ("menu_color_highlight")); if (version_msg) - grub_normal_init_page (term, empty_lines); + VasEBoot_normal_init_page (term, empty_lines); else - grub_term_cls (term); + VasEBoot_term_cls (term); - grub_term_normal_color = grub_color_menu_normal; - grub_term_highlight_color = grub_color_menu_highlight; + VasEBoot_term_normal_color = VasEBoot_color_menu_normal; + VasEBoot_term_highlight_color = VasEBoot_color_menu_highlight; if (geo->border) draw_border (term, geo); - grub_term_normal_color = old_color_normal; - grub_term_highlight_color = old_color_highlight; + VasEBoot_term_normal_color = old_color_normal; + VasEBoot_term_highlight_color = old_color_highlight; geo->timeout_y = geo->first_entry_y + geo->num_entries + geo->border + empty_lines; if (bottom_message) { - grub_term_gotoxy (term, - (struct grub_term_coordinate) { GRUB_TERM_MARGIN, + VasEBoot_term_gotoxy (term, + (struct VasEBoot_term_coordinate) { VasEBoot_TERM_MARGIN, geo->timeout_y }); print_message (nested, edit, term, 0); geo->timeout_y += msg_num_lines; } - geo->right_margin = grub_term_width (term) + geo->right_margin = VasEBoot_term_width (term) - geo->first_entry_x - geo->entry_width - 1; } @@ -436,46 +436,46 @@ menu_text_print_timeout (int timeout, void *dataptr) struct menu_viewer_data *data = dataptr; char *msg_translated = 0; - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { 0, data->geo.timeout_y }); + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { 0, data->geo.timeout_y }); if (data->timeout_msg == TIMEOUT_TERSE || data->timeout_msg == TIMEOUT_TERSE_NO_MARGIN) - msg_translated = grub_xasprintf (_("%ds"), timeout); + msg_translated = VasEBoot_xasprintf (_("%ds"), timeout); else - msg_translated = grub_xasprintf (_("The highlighted entry will be executed automatically in %ds."), timeout); + msg_translated = VasEBoot_xasprintf (_("The highlighted entry will be executed automatically in %ds."), timeout); if (!msg_translated) { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_print_error (); + VasEBoot_errno = VasEBoot_ERR_NONE; return; } if (data->timeout_msg == TIMEOUT_UNKNOWN) { - data->timeout_msg = grub_print_message_indented_real (msg_translated, + data->timeout_msg = VasEBoot_print_message_indented_real (msg_translated, 3, 1, data->term, 1) <= data->geo.timeout_lines ? TIMEOUT_NORMAL : TIMEOUT_TERSE; if (data->timeout_msg == TIMEOUT_TERSE) { - grub_free (msg_translated); - msg_translated = grub_xasprintf (_("%ds"), timeout); - if (grub_term_width (data->term) < 10) + VasEBoot_free (msg_translated); + msg_translated = VasEBoot_xasprintf (_("%ds"), timeout); + if (VasEBoot_term_width (data->term) < 10) data->timeout_msg = TIMEOUT_TERSE_NO_MARGIN; } } - grub_print_message_indented (msg_translated, + VasEBoot_print_message_indented (msg_translated, data->timeout_msg == TIMEOUT_TERSE_NO_MARGIN ? 0 : 3, data->timeout_msg == TIMEOUT_TERSE_NO_MARGIN ? 0 : 1, data->term); - grub_free (msg_translated); + VasEBoot_free (msg_translated); - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { - grub_term_cursor_x (&data->geo), + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { + VasEBoot_term_cursor_x (&data->geo), data->geo.first_entry_y + data->offset }); - grub_term_refresh (data->term); + VasEBoot_term_refresh (data->term); } static void @@ -503,13 +503,13 @@ menu_text_set_chosen_entry (int entry, void *dataptr) else { print_entry (data->geo.first_entry_y + oldoffset, 0, - grub_menu_get_entry (data->menu, data->first + oldoffset), + VasEBoot_menu_get_entry (data->menu, data->first + oldoffset), data); print_entry (data->geo.first_entry_y + data->offset, 1, - grub_menu_get_entry (data->menu, data->first + data->offset), + VasEBoot_menu_get_entry (data->menu, data->first + data->offset), data); } - grub_term_refresh (data->term); + VasEBoot_term_refresh (data->term); } static void @@ -517,9 +517,9 @@ menu_text_fini (void *dataptr) { struct menu_viewer_data *data = dataptr; - grub_term_setcursor (data->term, 1); - grub_term_cls (data->term); - grub_free (data); + VasEBoot_term_setcursor (data->term, 1); + VasEBoot_term_cls (data->term); + VasEBoot_free (data); } static void @@ -530,47 +530,47 @@ menu_text_clear_timeout (void *dataptr) for (i = 0; i < data->geo.timeout_lines;i++) { - grub_term_gotoxy (data->term, (struct grub_term_coordinate) { + VasEBoot_term_gotoxy (data->term, (struct VasEBoot_term_coordinate) { 0, data->geo.timeout_y + i }); - grub_print_spaces (data->term, grub_term_width (data->term) - 1); + VasEBoot_print_spaces (data->term, VasEBoot_term_width (data->term) - 1); } if (data->geo.num_entries <= 5 && !data->geo.border) { - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { data->geo.first_entry_x + data->geo.entry_width + data->geo.border + 1, data->geo.first_entry_y + data->geo.num_entries - 1 }); - grub_putcode (' ', data->term); + VasEBoot_putcode (' ', data->term); data->geo.timeout_lines = 0; data->geo.num_entries++; print_entries (data->menu, data); } - grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { - grub_term_cursor_x (&data->geo), + VasEBoot_term_gotoxy (data->term, + (struct VasEBoot_term_coordinate) { + VasEBoot_term_cursor_x (&data->geo), data->geo.first_entry_y + data->offset }); - grub_term_refresh (data->term); + VasEBoot_term_refresh (data->term); } -grub_err_t -grub_menu_try_text (struct grub_term_output *term, - int entry, grub_menu_t menu, int nested) +VasEBoot_err_t +VasEBoot_menu_try_text (struct VasEBoot_term_output *term, + int entry, VasEBoot_menu_t menu, int nested) { struct menu_viewer_data *data; - struct grub_menu_viewer *instance; + struct VasEBoot_menu_viewer *instance; - instance = grub_zalloc (sizeof (*instance)); + instance = VasEBoot_zalloc (sizeof (*instance)); if (!instance) - return grub_errno; + return VasEBoot_errno; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (!data) { - grub_free (instance); - return grub_errno; + VasEBoot_free (instance); + return VasEBoot_errno; } data->term = term; @@ -585,8 +585,8 @@ grub_menu_try_text (struct grub_term_output *term, data->offset = entry; data->first = 0; - grub_term_setcursor (data->term, 0); - grub_menu_init_page (nested, 0, &data->geo, data->term); + VasEBoot_term_setcursor (data->term, 0); + VasEBoot_menu_init_page (nested, 0, &data->geo, data->term); if (data->offset > data->geo.num_entries - 1) { @@ -595,8 +595,8 @@ grub_menu_try_text (struct grub_term_output *term, } print_entries (menu, data); - grub_term_refresh (data->term); - grub_menu_register_viewer (instance); + VasEBoot_term_refresh (data->term); + VasEBoot_menu_register_viewer (instance); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/normal/misc.c b/VasEBoot-core/normal/misc.c index 38f91b9b9..ff03adfc1 100644 --- a/VasEBoot-core/normal/misc.c +++ b/VasEBoot-core/normal/misc.c @@ -1,34 +1,34 @@ /* misc.c - miscellaneous functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static const char *grub_human_sizes[3][6] = +static const char *VasEBoot_human_sizes[3][6] = { /* This algorithm in reality would work only up to (2^64) / 100 B = 81 PiB. Put here all possible suffixes it can produce so no array bounds check @@ -43,14 +43,14 @@ static const char *grub_human_sizes[3][6] = }; const char * -grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type) +VasEBoot_get_human_size (VasEBoot_uint64_t size, enum VasEBoot_human_size_type type) { - grub_uint64_t fsize; + VasEBoot_uint64_t fsize; unsigned units = 0; static char buf[30]; const char *umsg; - if (type != GRUB_HUMAN_SIZE_SPEED) + if (type != VasEBoot_HUMAN_SIZE_SPEED) fsize = size * 100ULL; else fsize = size; @@ -64,131 +64,131 @@ grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type) units++; } - umsg = _(grub_human_sizes[type][units]); + umsg = _(VasEBoot_human_sizes[type][units]); - if (units || type == GRUB_HUMAN_SIZE_SPEED) + if (units || type == VasEBoot_HUMAN_SIZE_SPEED) { - grub_uint64_t whole, fraction; + VasEBoot_uint64_t whole, fraction; - whole = grub_divmod64 (fsize, 100, &fraction); - grub_snprintf (buf, sizeof (buf), - "%" PRIuGRUB_UINT64_T - ".%02" PRIuGRUB_UINT64_T "%s", whole, fraction, + whole = VasEBoot_divmod64 (fsize, 100, &fraction); + VasEBoot_snprintf (buf, sizeof (buf), + "%" PRIuVasEBoot_UINT64_T + ".%02" PRIuVasEBoot_UINT64_T "%s", whole, fraction, umsg); } else - grub_snprintf (buf, sizeof (buf), "%llu%s", (unsigned long long) size, + VasEBoot_snprintf (buf, sizeof (buf), "%llu%s", (unsigned long long) size, umsg); return buf; } /* Print the information on the device NAME. */ -grub_err_t -grub_normal_print_device_info (const char *name) +VasEBoot_err_t +VasEBoot_normal_print_device_info (const char *name) { - grub_device_t dev; + VasEBoot_device_t dev; char *p; - p = grub_strchr (name, ','); + p = VasEBoot_strchr (name, ','); if (p) { - grub_xputs ("\t"); - grub_printf_ (N_("Partition %s:"), name); - grub_xputs (" "); + VasEBoot_xputs ("\t"); + VasEBoot_printf_ (N_("Partition %s:"), name); + VasEBoot_xputs (" "); } else { - grub_printf_ (N_("Device %s:"), name); - grub_xputs (" "); + VasEBoot_printf_ (N_("Device %s:"), name); + VasEBoot_xputs (" "); } - dev = grub_device_open (name); + dev = VasEBoot_device_open (name); if (! dev) - grub_printf ("%s", _("Filesystem cannot be accessed")); + VasEBoot_printf ("%s", _("Filesystem cannot be accessed")); else if (dev->disk) { - grub_fs_t fs; + VasEBoot_fs_t fs; - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); /* Ignore all errors. */ - grub_errno = 0; + VasEBoot_errno = 0; if (fs) { const char *fsname = fs->name; - if (grub_strcmp (fsname, "ext2") == 0) + if (VasEBoot_strcmp (fsname, "ext2") == 0) fsname = "ext*"; - grub_printf_ (N_("Filesystem type %s"), fsname); + VasEBoot_printf_ (N_("Filesystem type %s"), fsname); if (fs->label) { char *label; (fs->label) (dev, &label); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - if (label && grub_strlen (label)) + if (label && VasEBoot_strlen (label)) { - grub_xputs (" "); - grub_printf_ (N_("- Label `%s'"), label); + VasEBoot_xputs (" "); + VasEBoot_printf_ (N_("- Label `%s'"), label); } - grub_free (label); + VasEBoot_free (label); } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (fs->mtime) { - grub_int32_t tm; - struct grub_datetime datetime; + VasEBoot_int32_t tm; + struct VasEBoot_datetime datetime; (fs->mtime) (dev, &tm); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - grub_unixtime2datetime (tm, &datetime); - grub_xputs (" "); + VasEBoot_unixtime2datetime (tm, &datetime); + VasEBoot_xputs (" "); /* TRANSLATORS: Arguments are year, month, day, hour, minute, second, day of the week (translated). */ - grub_printf_ (N_("- Last modification time %d-%02d-%02d " + VasEBoot_printf_ (N_("- Last modification time %d-%02d-%02d " "%02d:%02d:%02d %s"), datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second, - grub_get_weekday_name (&datetime)); + VasEBoot_get_weekday_name (&datetime)); } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if (fs->uuid) { char *uuid; (fs->uuid) (dev, &uuid); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) { - if (uuid && grub_strlen (uuid)) - grub_printf (", UUID %s", uuid); - grub_free (uuid); + if (uuid && VasEBoot_strlen (uuid)) + VasEBoot_printf (", UUID %s", uuid); + VasEBoot_free (uuid); } - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } } else - grub_printf ("%s", _("No known filesystem detected")); + VasEBoot_printf ("%s", _("No known filesystem detected")); if (dev->disk->partition) - grub_printf (_(" - Partition start at %llu%sKiB"), - (unsigned long long) (grub_partition_get_start (dev->disk->partition) >> 1), - (grub_partition_get_start (dev->disk->partition) & 1) ? ".5" : "" ); + VasEBoot_printf (_(" - Partition start at %llu%sKiB"), + (unsigned long long) (VasEBoot_partition_get_start (dev->disk->partition) >> 1), + (VasEBoot_partition_get_start (dev->disk->partition) & 1) ? ".5" : "" ); else - grub_printf_ (N_(" - Sector size %uB"), 1 << dev->disk->log_sector_size); - if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN) - grub_puts_ (N_(" - Total size unknown")); + VasEBoot_printf_ (N_(" - Sector size %uB"), 1 << dev->disk->log_sector_size); + if (VasEBoot_disk_get_size (dev->disk) == VasEBoot_DISK_SIZE_UNKNOWN) + VasEBoot_puts_ (N_(" - Total size unknown")); else - grub_printf (_(" - Total size %llu%sKiB"), - (unsigned long long) (grub_disk_get_size (dev->disk) >> 1), + VasEBoot_printf (_(" - Total size %llu%sKiB"), + (unsigned long long) (VasEBoot_disk_get_size (dev->disk) >> 1), /* TRANSLATORS: Replace dot with appropriate decimal separator for your language. */ - (grub_disk_get_size (dev->disk) & 1) ? _(".5") : ""); + (VasEBoot_disk_get_size (dev->disk) & 1) ? _(".5") : ""); } if (dev) - grub_device_close (dev); + VasEBoot_device_close (dev); - grub_xputs ("\n"); - return grub_errno; + VasEBoot_xputs ("\n"); + return VasEBoot_errno; } diff --git a/VasEBoot-core/normal/term.c b/VasEBoot-core/normal/term.c index ac5d69f0f..1c9094cf5 100644 --- a/VasEBoot-core/normal/term.c +++ b/VasEBoot-core/normal/term.c @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include struct term_state { struct term_state *next; - struct grub_unicode_glyph *backlog_glyphs; - const grub_uint32_t *backlog_ucs4; + struct VasEBoot_unicode_glyph *backlog_glyphs; + const VasEBoot_uint32_t *backlog_ucs4; int backlog_fixed_tab; - grub_size_t backlog_len; + VasEBoot_size_t backlog_len; int bidi_stack_depth; - grub_uint8_t bidi_stack[GRUB_BIDI_MAX_EXPLICIT_LEVEL]; + VasEBoot_uint8_t bidi_stack[VasEBoot_BIDI_MAX_EXPLICIT_LEVEL]; int invalid_pushes; void *free; @@ -44,25 +44,25 @@ struct term_state }; static int -print_ucs4_real (const grub_uint32_t * str, - const grub_uint32_t * last_position, +print_ucs4_real (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term, int backlog, + struct VasEBoot_term_output *term, int backlog, int dry_run, int fixed_tab, unsigned skip_lines, unsigned max_lines, - grub_uint32_t contchar, int fill_right, - struct grub_term_pos *pos); + VasEBoot_uint32_t contchar, int fill_right, + struct VasEBoot_term_pos *pos); static struct term_state *term_states = NULL; /* If the more pager is active. */ -static int grub_more; +static int VasEBoot_more; static void -putcode_real (grub_uint32_t code, struct grub_term_output *term, int fixed_tab); +putcode_real (VasEBoot_uint32_t code, struct VasEBoot_term_output *term, int fixed_tab); void -grub_normal_reset_more (void) +VasEBoot_normal_reset_more (void) { static struct term_state *state; for (state = term_states; state; state = state->next) @@ -73,41 +73,41 @@ static void print_more (void) { char key; - struct grub_term_coordinate *pos; - grub_term_output_t term; - grub_uint32_t *unicode_str, *unicode_last_position; + struct VasEBoot_term_coordinate *pos; + VasEBoot_term_output_t term; + VasEBoot_uint32_t *unicode_str, *unicode_last_position; /* TRANSLATORS: This has to fit on one line. It's ok to include few words but don't write poems. */ - grub_utf8_to_ucs4_alloc (_("--MORE--"), &unicode_str, + VasEBoot_utf8_to_ucs4_alloc (_("--MORE--"), &unicode_str, &unicode_last_position); if (!unicode_str) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - pos = grub_term_save_pos (); + pos = VasEBoot_term_save_pos (); - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_HIGHLIGHT); FOR_ACTIVE_TERM_OUTPUTS(term) { - grub_print_ucs4 (unicode_str, unicode_last_position, 0, 0, term); + VasEBoot_print_ucs4 (unicode_str, unicode_last_position, 0, 0, term); } - grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); + VasEBoot_setcolorstate (VasEBoot_TERM_COLOR_NORMAL); - grub_free (unicode_str); + VasEBoot_free (unicode_str); - key = grub_getkey (); + key = VasEBoot_getkey (); /* Remove the message. */ - grub_term_restore_pos (pos); + VasEBoot_term_restore_pos (pos); FOR_ACTIVE_TERM_OUTPUTS(term) - grub_print_spaces (term, 8); - grub_term_restore_pos (pos); - grub_free (pos); + VasEBoot_print_spaces (term, 8); + VasEBoot_term_restore_pos (pos); + VasEBoot_free (pos); /* Scroll one line or an entire page, depending on the key. */ @@ -118,92 +118,92 @@ print_more (void) state->num_lines--; } else - grub_normal_reset_more (); + VasEBoot_normal_reset_more (); } void -grub_set_more (int onoff) +VasEBoot_set_more (int onoff) { - grub_more = !!onoff; - grub_normal_reset_more (); + VasEBoot_more = !!onoff; + VasEBoot_normal_reset_more (); } enum { - GRUB_CP437_UPDOWNARROW = 0x12, - GRUB_CP437_UPARROW = 0x18, - GRUB_CP437_DOWNARROW = 0x19, - GRUB_CP437_RIGHTARROW = 0x1a, - GRUB_CP437_LEFTARROW = 0x1b, - GRUB_CP437_VLINE = 0xb3, - GRUB_CP437_CORNER_UR = 0xbf, - GRUB_CP437_CORNER_LL = 0xc0, - GRUB_CP437_HLINE = 0xc4, - GRUB_CP437_CORNER_LR = 0xd9, - GRUB_CP437_CORNER_UL = 0xda, + VasEBoot_CP437_UPDOWNARROW = 0x12, + VasEBoot_CP437_UPARROW = 0x18, + VasEBoot_CP437_DOWNARROW = 0x19, + VasEBoot_CP437_RIGHTARROW = 0x1a, + VasEBoot_CP437_LEFTARROW = 0x1b, + VasEBoot_CP437_VLINE = 0xb3, + VasEBoot_CP437_CORNER_UR = 0xbf, + VasEBoot_CP437_CORNER_LL = 0xc0, + VasEBoot_CP437_HLINE = 0xc4, + VasEBoot_CP437_CORNER_LR = 0xd9, + VasEBoot_CP437_CORNER_UL = 0xda, }; -static grub_uint32_t -map_code (grub_uint32_t in, struct grub_term_output *term) +static VasEBoot_uint32_t +map_code (VasEBoot_uint32_t in, struct VasEBoot_term_output *term) { if (in <= 0x7f) return in; - switch (term->flags & GRUB_TERM_CODE_TYPE_MASK) + switch (term->flags & VasEBoot_TERM_CODE_TYPE_MASK) { - case GRUB_TERM_CODE_TYPE_CP437: + case VasEBoot_TERM_CODE_TYPE_CP437: switch (in) { - case GRUB_UNICODE_LEFTARROW: - return GRUB_CP437_LEFTARROW; - case GRUB_UNICODE_UPARROW: - return GRUB_CP437_UPARROW; - case GRUB_UNICODE_UPDOWNARROW: - return GRUB_CP437_UPDOWNARROW; - case GRUB_UNICODE_RIGHTARROW: - return GRUB_CP437_RIGHTARROW; - case GRUB_UNICODE_DOWNARROW: - return GRUB_CP437_DOWNARROW; - case GRUB_UNICODE_HLINE: - return GRUB_CP437_HLINE; - case GRUB_UNICODE_VLINE: - return GRUB_CP437_VLINE; - case GRUB_UNICODE_CORNER_UL: - return GRUB_CP437_CORNER_UL; - case GRUB_UNICODE_CORNER_UR: - return GRUB_CP437_CORNER_UR; - case GRUB_UNICODE_CORNER_LL: - return GRUB_CP437_CORNER_LL; - case GRUB_UNICODE_CORNER_LR: - return GRUB_CP437_CORNER_LR; + case VasEBoot_UNICODE_LEFTARROW: + return VasEBoot_CP437_LEFTARROW; + case VasEBoot_UNICODE_UPARROW: + return VasEBoot_CP437_UPARROW; + case VasEBoot_UNICODE_UPDOWNARROW: + return VasEBoot_CP437_UPDOWNARROW; + case VasEBoot_UNICODE_RIGHTARROW: + return VasEBoot_CP437_RIGHTARROW; + case VasEBoot_UNICODE_DOWNARROW: + return VasEBoot_CP437_DOWNARROW; + case VasEBoot_UNICODE_HLINE: + return VasEBoot_CP437_HLINE; + case VasEBoot_UNICODE_VLINE: + return VasEBoot_CP437_VLINE; + case VasEBoot_UNICODE_CORNER_UL: + return VasEBoot_CP437_CORNER_UL; + case VasEBoot_UNICODE_CORNER_UR: + return VasEBoot_CP437_CORNER_UR; + case VasEBoot_UNICODE_CORNER_LL: + return VasEBoot_CP437_CORNER_LL; + case VasEBoot_UNICODE_CORNER_LR: + return VasEBoot_CP437_CORNER_LR; } return '?'; - case GRUB_TERM_CODE_TYPE_ASCII: + case VasEBoot_TERM_CODE_TYPE_ASCII: /* Better than nothing. */ switch (in) { - case GRUB_UNICODE_LEFTARROW: + case VasEBoot_UNICODE_LEFTARROW: return '<'; - case GRUB_UNICODE_UPARROW: + case VasEBoot_UNICODE_UPARROW: return '^'; - case GRUB_UNICODE_RIGHTARROW: + case VasEBoot_UNICODE_RIGHTARROW: return '>'; - case GRUB_UNICODE_DOWNARROW: + case VasEBoot_UNICODE_DOWNARROW: return 'v'; - case GRUB_UNICODE_HLINE: + case VasEBoot_UNICODE_HLINE: return '-'; - case GRUB_UNICODE_VLINE: + case VasEBoot_UNICODE_VLINE: return '|'; - case GRUB_UNICODE_CORNER_UL: - case GRUB_UNICODE_CORNER_UR: - case GRUB_UNICODE_CORNER_LL: - case GRUB_UNICODE_CORNER_LR: + case VasEBoot_UNICODE_CORNER_UL: + case VasEBoot_UNICODE_CORNER_UR: + case VasEBoot_UNICODE_CORNER_LL: + case VasEBoot_UNICODE_CORNER_LR: return '+'; } @@ -213,18 +213,18 @@ map_code (grub_uint32_t in, struct grub_term_output *term) } void -grub_puts_terminal (const char *str, struct grub_term_output *term) +VasEBoot_puts_terminal (const char *str, struct VasEBoot_term_output *term) { - grub_uint32_t *unicode_str, *unicode_last_position; - grub_error_push (); - grub_utf8_to_ucs4_alloc (str, &unicode_str, + VasEBoot_uint32_t *unicode_str, *unicode_last_position; + VasEBoot_error_push (); + VasEBoot_utf8_to_ucs4_alloc (str, &unicode_str, &unicode_last_position); - grub_error_pop (); + VasEBoot_error_pop (); if (!unicode_str) { for (; *str; str++) { - struct grub_unicode_glyph c = + struct VasEBoot_unicode_glyph c = { .variant = 0, .attributes = 0, @@ -251,62 +251,62 @@ grub_puts_terminal (const char *str, struct grub_term_output *term) print_ucs4_real (unicode_str, unicode_last_position, 0, 0, term, 0, 0, 0, 0, -1, 0, 0, 0); - grub_free (unicode_str); + VasEBoot_free (unicode_str); } -struct grub_term_coordinate * -grub_term_save_pos (void) +struct VasEBoot_term_coordinate * +VasEBoot_term_save_pos (void) { - struct grub_term_output *cur; + struct VasEBoot_term_output *cur; unsigned cnt = 0; - struct grub_term_coordinate *ret, *ptr; + struct VasEBoot_term_coordinate *ret, *ptr; FOR_ACTIVE_TERM_OUTPUTS(cur) cnt++; - ret = grub_malloc (cnt * sizeof (ret[0])); + ret = VasEBoot_malloc (cnt * sizeof (ret[0])); if (!ret) return NULL; ptr = ret; FOR_ACTIVE_TERM_OUTPUTS(cur) - *ptr++ = grub_term_getxy (cur); + *ptr++ = VasEBoot_term_getxy (cur); return ret; } void -grub_term_restore_pos (struct grub_term_coordinate *pos) +VasEBoot_term_restore_pos (struct VasEBoot_term_coordinate *pos) { - struct grub_term_output *cur; - struct grub_term_coordinate *ptr = pos; + struct VasEBoot_term_output *cur; + struct VasEBoot_term_coordinate *ptr = pos; if (!pos) return; FOR_ACTIVE_TERM_OUTPUTS(cur) { - grub_term_gotoxy (cur, *ptr); + VasEBoot_term_gotoxy (cur, *ptr); ptr++; } } static void -grub_terminal_autoload_free (void) +VasEBoot_terminal_autoload_free (void) { - struct grub_term_autoload *cur, *next; + struct VasEBoot_term_autoload *cur, *next; unsigned i; for (i = 0; i < 2; i++) - for (cur = i ? grub_term_input_autoload : grub_term_output_autoload; + for (cur = i ? VasEBoot_term_input_autoload : VasEBoot_term_output_autoload; cur; cur = next) { next = cur->next; - grub_free (cur->name); - grub_free (cur->modname); - grub_free (cur); + VasEBoot_free (cur->name); + VasEBoot_free (cur->modname); + VasEBoot_free (cur); } - grub_term_input_autoload = NULL; - grub_term_output_autoload = NULL; + VasEBoot_term_input_autoload = NULL; + VasEBoot_term_output_autoload = NULL; } /* Read the file terminal.lst for auto-loading. */ @@ -314,57 +314,57 @@ void read_terminal_list (const char *prefix) { char *filename; - grub_file_t file; + VasEBoot_file_t file; char *buf = NULL; if (!prefix) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM + filename = VasEBoot_xasprintf ("%s/" VasEBoot_TARGET_CPU "-" VasEBoot_PLATFORM "/terminal.lst", prefix); if (!filename) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - file = grub_file_open (filename); - grub_free (filename); + file = VasEBoot_file_open (filename); + VasEBoot_free (filename); if (!file) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } /* Override previous terminal.lst. */ - grub_terminal_autoload_free (); + VasEBoot_terminal_autoload_free (); - for (;; grub_free (buf)) + for (;; VasEBoot_free (buf)) { char *p, *name; - struct grub_term_autoload *cur; - struct grub_term_autoload **target = NULL; + struct VasEBoot_term_autoload *cur; + struct VasEBoot_term_autoload **target = NULL; - buf = grub_file_getline (file); + buf = VasEBoot_file_getline (file); if (! buf) break; p = buf; - while (grub_isspace (p[0])) + while (VasEBoot_isspace (p[0])) p++; switch (p[0]) { case 'i': - target = &grub_term_input_autoload; + target = &VasEBoot_term_input_autoload; break; case 'o': - target = &grub_term_output_autoload; + target = &VasEBoot_term_output_autoload; break; } if (!target) @@ -372,7 +372,7 @@ read_terminal_list (const char *prefix) name = p + 1; - p = grub_strchr (name, ':'); + p = VasEBoot_strchr (name, ':'); if (! p) continue; *p = 0; @@ -381,43 +381,43 @@ read_terminal_list (const char *prefix) while (*p == ' ' || *p == '\t') p++; - cur = grub_malloc (sizeof (*cur)); + cur = VasEBoot_malloc (sizeof (*cur)); if (!cur) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - cur->name = grub_strdup (name); + cur->name = VasEBoot_strdup (name); if (! cur->name) { - grub_errno = GRUB_ERR_NONE; - grub_free (cur); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (cur); continue; } - cur->modname = grub_strdup (p); + cur->modname = VasEBoot_strdup (p); if (! cur->modname) { - grub_errno = GRUB_ERR_NONE; - grub_free (cur->name); - grub_free (cur); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (cur->name); + VasEBoot_free (cur); continue; } cur->next = *target; *target = cur; } - grub_file_close (file); + VasEBoot_file_close (file); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } static void -putglyph (const struct grub_unicode_glyph *c, struct grub_term_output *term, +putglyph (const struct VasEBoot_unicode_glyph *c, struct VasEBoot_term_output *term, int fixed_tab) { - struct grub_unicode_glyph c2 = + struct VasEBoot_unicode_glyph c2 = { .variant = 0, .attributes = 0, @@ -429,7 +429,7 @@ putglyph (const struct grub_unicode_glyph *c, struct grub_term_output *term, { int n; - n = GRUB_TERM_TAB_WIDTH; + n = VasEBoot_TERM_TAB_WIDTH; c2.base = ' '; while (n--) (term->putchar) (term, &c2); @@ -441,8 +441,8 @@ putglyph (const struct grub_unicode_glyph *c, struct grub_term_output *term, { int n; - n = GRUB_TERM_TAB_WIDTH - ((term->getxy (term).x) - % GRUB_TERM_TAB_WIDTH); + n = VasEBoot_TERM_TAB_WIDTH - ((term->getxy (term).x) + % VasEBoot_TERM_TAB_WIDTH); c2.base = ' '; while (n--) (term->putchar) (term, &c2); @@ -450,33 +450,33 @@ putglyph (const struct grub_unicode_glyph *c, struct grub_term_output *term, return; } - if ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_UTF8_LOGICAL - || (term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_UTF8_VISUAL) + if ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL + || (term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL) { int i; - c2.estimated_width = grub_term_getcharwidth (term, c); + c2.estimated_width = VasEBoot_term_getcharwidth (term, c); for (i = -1; i < (int) c->ncomb; i++) { - grub_uint8_t u8[20], *ptr; - grub_uint32_t code; + VasEBoot_uint8_t u8[20], *ptr; + VasEBoot_uint32_t code; if (i == -1) { code = c->base; - if ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_UTF8_VISUAL) + if ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL) { - if ((c->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR)) - code = grub_unicode_mirror_code (code); - code = grub_unicode_shape_code (code, c->attributes); + if ((c->attributes & VasEBoot_UNICODE_GLYPH_ATTRIBUTE_MIRROR)) + code = VasEBoot_unicode_mirror_code (code); + code = VasEBoot_unicode_shape_code (code, c->attributes); } } else - code = grub_unicode_get_comb (c) [i].code; + code = VasEBoot_unicode_get_comb (c) [i].code; - grub_ucs4_to_utf8 (&code, 1, u8, sizeof (u8)); + VasEBoot_ucs4_to_utf8 (&code, 1, u8, sizeof (u8)); for (ptr = u8; *ptr; ptr++) { @@ -498,9 +498,9 @@ putglyph (const struct grub_unicode_glyph *c, struct grub_term_output *term, } static void -putcode_real (grub_uint32_t code, struct grub_term_output *term, int fixed_tab) +putcode_real (VasEBoot_uint32_t code, struct VasEBoot_term_output *term, int fixed_tab) { - struct grub_unicode_glyph c = + struct VasEBoot_unicode_glyph c = { .variant = 0, .attributes = 0, @@ -514,102 +514,102 @@ putcode_real (grub_uint32_t code, struct grub_term_output *term, int fixed_tab) /* Put a Unicode character. */ void -grub_putcode (grub_uint32_t code, struct grub_term_output *term) +VasEBoot_putcode (VasEBoot_uint32_t code, struct VasEBoot_term_output *term) { /* Combining character by itself? */ - if (grub_unicode_get_comb_type (code) != GRUB_UNICODE_COMB_NONE) + if (VasEBoot_unicode_get_comb_type (code) != VasEBoot_UNICODE_COMB_NONE) return; putcode_real (code, term, 0); } -static grub_ssize_t -get_maxwidth (struct grub_term_output *term, +static VasEBoot_ssize_t +get_maxwidth (struct VasEBoot_term_output *term, int margin_left, int margin_right) { - struct grub_unicode_glyph space_glyph = { + struct VasEBoot_unicode_glyph space_glyph = { .base = ' ', .variant = 0, .attributes = 0, .ncomb = 0, }; - return (grub_term_width (term) - - grub_term_getcharwidth (term, &space_glyph) + return (VasEBoot_term_width (term) + - VasEBoot_term_getcharwidth (term, &space_glyph) * (margin_left + margin_right) - 1); } -static grub_ssize_t -get_startwidth (struct grub_term_output *term, +static VasEBoot_ssize_t +get_startwidth (struct VasEBoot_term_output *term, int margin_left) { return (term->getxy (term).x) - margin_left; } static void -fill_margin (struct grub_term_output *term, int r) +fill_margin (struct VasEBoot_term_output *term, int r) { int sp = (term->getwh (term).x) - (term->getxy (term).x) - r; if (sp > 0) - grub_print_spaces (term, sp); + VasEBoot_print_spaces (term, sp); } static int -print_ucs4_terminal (const grub_uint32_t * str, - const grub_uint32_t * last_position, +print_ucs4_terminal (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term, + struct VasEBoot_term_output *term, struct term_state *state, int dry_run, int fixed_tab, unsigned skip_lines, unsigned max_lines, - grub_uint32_t contchar, - int primitive_wrap, int fill_right, struct grub_term_pos *pos) + VasEBoot_uint32_t contchar, + int primitive_wrap, int fill_right, struct VasEBoot_term_pos *pos) { - const grub_uint32_t *ptr; - grub_ssize_t startwidth = dry_run ? 0 : get_startwidth (term, margin_left); - grub_ssize_t line_width = startwidth; - grub_ssize_t lastspacewidth = 0; - grub_ssize_t max_width = get_maxwidth (term, margin_left, margin_right); - const grub_uint32_t *line_start = str, *last_space = str - 1; + const VasEBoot_uint32_t *ptr; + VasEBoot_ssize_t startwidth = dry_run ? 0 : get_startwidth (term, margin_left); + VasEBoot_ssize_t line_width = startwidth; + VasEBoot_ssize_t lastspacewidth = 0; + VasEBoot_ssize_t max_width = get_maxwidth (term, margin_left, margin_right); + const VasEBoot_uint32_t *line_start = str, *last_space = str - 1; int lines = 0; int i; struct term_state local_state; if (!state) { - grub_memset (&local_state, 0, sizeof (local_state)); + VasEBoot_memset (&local_state, 0, sizeof (local_state)); state = &local_state; } for (i = 0; i < state->bidi_stack_depth; i++) - putcode_real (state->bidi_stack[i] | (GRUB_UNICODE_LRE & ~0xff), + putcode_real (state->bidi_stack[i] | (VasEBoot_UNICODE_LRE & ~0xff), term, fixed_tab); for (ptr = str; ptr < last_position; ptr++) { - grub_ssize_t last_width = 0; + VasEBoot_ssize_t last_width = 0; switch (*ptr) { - case GRUB_UNICODE_LRE: - case GRUB_UNICODE_RLE: - case GRUB_UNICODE_LRO: - case GRUB_UNICODE_RLO: + case VasEBoot_UNICODE_LRE: + case VasEBoot_UNICODE_RLE: + case VasEBoot_UNICODE_LRO: + case VasEBoot_UNICODE_RLO: if (state->bidi_stack_depth >= (int) ARRAY_SIZE (state->bidi_stack)) state->invalid_pushes++; else state->bidi_stack[state->bidi_stack_depth++] = *ptr; break; - case GRUB_UNICODE_PDF: + case VasEBoot_UNICODE_PDF: if (state->invalid_pushes) state->invalid_pushes--; else if (state->bidi_stack_depth) state->bidi_stack_depth--; break; } - if (grub_unicode_get_comb_type (*ptr) == GRUB_UNICODE_COMB_NONE) + if (VasEBoot_unicode_get_comb_type (*ptr) == VasEBoot_UNICODE_COMB_NONE) { - struct grub_unicode_glyph c = { + struct VasEBoot_unicode_glyph c = { .variant = 0, .attributes = 0, .ncomb = 0, @@ -621,7 +621,7 @@ print_ucs4_terminal (const grub_uint32_t * str, pos[ptr - str].y = lines; pos[ptr - str].valid = 1; } - line_width += last_width = grub_term_getcharwidth (term, &c); + line_width += last_width = VasEBoot_term_getcharwidth (term, &c); } if (*ptr == ' ' && !primitive_wrap) @@ -632,7 +632,7 @@ print_ucs4_terminal (const grub_uint32_t * str, if (line_width > max_width || *ptr == '\n') { - const grub_uint32_t *ptr2; + const VasEBoot_uint32_t *ptr2; int wasn = (*ptr == '\n'); if (wasn) @@ -659,10 +659,10 @@ print_ucs4_terminal (const grub_uint32_t * str, for (ptr2 = line_start; ptr2 < ptr; ptr2++) { /* Skip combining characters on non-UTF8 terminals. */ - if ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - != GRUB_TERM_CODE_TYPE_UTF8_LOGICAL - && grub_unicode_get_comb_type (*ptr2) - != GRUB_UNICODE_COMB_NONE) + if ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + != VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL + && VasEBoot_unicode_get_comb_type (*ptr2) + != VasEBoot_UNICODE_COMB_NONE) continue; putcode_real (*ptr2, term, fixed_tab); } @@ -673,9 +673,9 @@ print_ucs4_terminal (const grub_uint32_t * str, fill_margin (term, margin_right); if (!contchar || max_lines != 1) - grub_putcode ('\n', term); + VasEBoot_putcode ('\n', term); if (state != &local_state && ++state->num_lines - >= (grub_ssize_t) grub_term_height (term) - 2) + >= (VasEBoot_ssize_t) VasEBoot_term_height (term) - 2) { state->backlog_ucs4 = (ptr == last_space || *ptr == '\n') ? ptr + 1 : ptr; @@ -708,12 +708,12 @@ print_ucs4_terminal (const grub_uint32_t * str, if (!skip_lines && !dry_run) { if (!contchar) - grub_print_spaces (term, margin_left); + VasEBoot_print_spaces (term, margin_left); else - grub_term_gotoxy (term, (struct grub_term_coordinate) - { margin_left, grub_term_getxy (term).y }); + VasEBoot_term_gotoxy (term, (struct VasEBoot_term_coordinate) + { margin_left, VasEBoot_term_getxy (term).y }); for (i = 0; i < state->bidi_stack_depth; i++) - putcode_real (state->bidi_stack[i] | (GRUB_UNICODE_LRE & ~0xff), + putcode_real (state->bidi_stack[i] | (VasEBoot_UNICODE_LRE & ~0xff), term, fixed_tab); } } @@ -730,15 +730,15 @@ print_ucs4_terminal (const grub_uint32_t * str, lines++; if (!dry_run && !skip_lines && max_lines) { - const grub_uint32_t *ptr2; + const VasEBoot_uint32_t *ptr2; for (ptr2 = line_start; ptr2 < last_position; ptr2++) { /* Skip combining characters on non-UTF8 terminals. */ - if ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - != GRUB_TERM_CODE_TYPE_UTF8_LOGICAL - && grub_unicode_get_comb_type (*ptr2) - != GRUB_UNICODE_COMB_NONE) + if ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + != VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL + && VasEBoot_unicode_get_comb_type (*ptr2) + != VasEBoot_UNICODE_COMB_NONE) continue; putcode_real (*ptr2, term, fixed_tab); } @@ -750,21 +750,21 @@ print_ucs4_terminal (const grub_uint32_t * str, } static struct term_state * -find_term_state (struct grub_term_output *term) +find_term_state (struct VasEBoot_term_output *term) { struct term_state *state; for (state = term_states; state; state = state->next) - if (grub_strcmp (state->term_name, term->name) == 0) + if (VasEBoot_strcmp (state->term_name, term->name) == 0) return state; - state = grub_zalloc (sizeof (*state)); + state = VasEBoot_zalloc (sizeof (*state)); if (!state) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return NULL; } - state->term_name = grub_strdup (term->name); + state->term_name = VasEBoot_strdup (term->name); state->next = term_states; term_states = state; @@ -772,15 +772,15 @@ find_term_state (struct grub_term_output *term) } static int -put_glyphs_terminal (struct grub_unicode_glyph *visual, - grub_ssize_t visual_len, +put_glyphs_terminal (struct VasEBoot_unicode_glyph *visual, + VasEBoot_ssize_t visual_len, int margin_left, int margin_right, - struct grub_term_output *term, + struct VasEBoot_term_output *term, struct term_state *state, int fixed_tab, - grub_uint32_t contchar, + VasEBoot_uint32_t contchar, int fill_right) { - struct grub_unicode_glyph *visual_ptr; + struct VasEBoot_unicode_glyph *visual_ptr; int since_last_nl = 1; for (visual_ptr = visual; visual_ptr < visual + visual_len; visual_ptr++) { @@ -793,7 +793,7 @@ put_glyphs_terminal (struct grub_unicode_glyph *visual, { since_last_nl = 0; if (state && ++state->num_lines - >= (grub_ssize_t) grub_term_height (term) - 2) + >= (VasEBoot_ssize_t) VasEBoot_term_height (term) - 2) { state->backlog_glyphs = visual_ptr + 1; state->backlog_len = visual_len - (visual_ptr - visual) - 1; @@ -802,13 +802,13 @@ put_glyphs_terminal (struct grub_unicode_glyph *visual, } if (!contchar) - grub_print_spaces (term, margin_left); + VasEBoot_print_spaces (term, margin_left); else - grub_term_gotoxy (term, - (struct grub_term_coordinate) - { margin_left, grub_term_getxy (term).y }); + VasEBoot_term_gotoxy (term, + (struct VasEBoot_term_coordinate) + { margin_left, VasEBoot_term_getxy (term).y }); } - grub_unicode_destroy_glyph (visual_ptr); + VasEBoot_unicode_destroy_glyph (visual_ptr); } if (fill_right && since_last_nl) fill_margin (term, margin_right); @@ -817,7 +817,7 @@ put_glyphs_terminal (struct grub_unicode_glyph *visual, } static int -print_backlog (struct grub_term_output *term, +print_backlog (struct VasEBoot_term_output *term, int margin_left, int margin_right) { struct term_state *state = find_term_state (term); @@ -835,7 +835,7 @@ print_backlog (struct grub_term_output *term, 0, 0); if (!ret) { - grub_free (state->free); + VasEBoot_free (state->free); state->free = NULL; state->backlog_len = 0; state->backlog_ucs4 = 0; @@ -852,7 +852,7 @@ print_backlog (struct grub_term_output *term, state->backlog_fixed_tab, 0, 0); if (!ret) { - grub_free (state->free); + VasEBoot_free (state->free); state->free = NULL; state->backlog_len = 0; state->backlog_glyphs = 0; @@ -863,27 +863,27 @@ print_backlog (struct grub_term_output *term, return 0; } -static grub_size_t -getcharwidth (const struct grub_unicode_glyph *c, void *term) +static VasEBoot_size_t +getcharwidth (const struct VasEBoot_unicode_glyph *c, void *term) { - return grub_term_getcharwidth (term, c); + return VasEBoot_term_getcharwidth (term, c); } static int -print_ucs4_real (const grub_uint32_t * str, - const grub_uint32_t * last_position, +print_ucs4_real (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term, int backlog, + struct VasEBoot_term_output *term, int backlog, int dry_run, int fixed_tab, unsigned skip_lines, unsigned max_lines, - grub_uint32_t contchar, int fill_right, - struct grub_term_pos *pos) + VasEBoot_uint32_t contchar, int fill_right, + struct VasEBoot_term_pos *pos) { struct term_state *state = NULL; if (!dry_run) { - struct grub_term_coordinate xy; + struct VasEBoot_term_coordinate xy; if (backlog) state = find_term_state (term); @@ -892,26 +892,26 @@ print_ucs4_real (const grub_uint32_t * str, if (xy.x < margin_left) { if (!contchar) - grub_print_spaces (term, margin_left - xy.x); + VasEBoot_print_spaces (term, margin_left - xy.x); else - grub_term_gotoxy (term, (struct grub_term_coordinate) {margin_left, + VasEBoot_term_gotoxy (term, (struct VasEBoot_term_coordinate) {margin_left, xy.y}); } } - if ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS - || (term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_UTF8_VISUAL) + if ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS + || (term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL) { - grub_ssize_t visual_len; - struct grub_unicode_glyph *visual; - grub_ssize_t visual_len_show; - struct grub_unicode_glyph *visual_show; + VasEBoot_ssize_t visual_len; + struct VasEBoot_unicode_glyph *visual; + VasEBoot_ssize_t visual_len_show; + struct VasEBoot_unicode_glyph *visual_show; int ret; - struct grub_unicode_glyph *vptr; + struct VasEBoot_unicode_glyph *vptr; - visual_len = grub_bidi_logical_to_visual (str, last_position - str, + visual_len = VasEBoot_bidi_logical_to_visual (str, last_position - str, &visual, getcharwidth, term, get_maxwidth (term, margin_left, @@ -921,7 +921,7 @@ print_ucs4_real (const grub_uint32_t * str, contchar, pos, !!contchar); if (visual_len < 0) { - grub_print_error (); + VasEBoot_print_error (); return 0; } visual_show = visual; @@ -949,8 +949,8 @@ print_ucs4_real (const grub_uint32_t * str, if (visual_len_show && visual[visual_len_show - 1].base != '\n') ret++; for (vptr = visual; vptr < visual + visual_len; vptr++) - grub_unicode_destroy_glyph (vptr); - grub_free (visual); + VasEBoot_unicode_destroy_glyph (vptr); + VasEBoot_free (visual); } else { @@ -959,7 +959,7 @@ print_ucs4_real (const grub_uint32_t * str, term, state, fixed_tab, contchar, fill_right); if (!ret) - grub_free (visual); + VasEBoot_free (visual); else state->free = visual; } @@ -971,13 +971,13 @@ print_ucs4_real (const grub_uint32_t * str, } void -grub_print_ucs4_menu (const grub_uint32_t * str, - const grub_uint32_t * last_position, +VasEBoot_print_ucs4_menu (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term, + struct VasEBoot_term_output *term, int skip_lines, int max_lines, - grub_uint32_t contchar, - struct grub_term_pos *pos) + VasEBoot_uint32_t contchar, + struct VasEBoot_term_pos *pos) { print_ucs4_real (str, last_position, margin_left, margin_right, term, 0, 0, 1, skip_lines, max_lines, @@ -985,43 +985,43 @@ grub_print_ucs4_menu (const grub_uint32_t * str, } void -grub_print_ucs4 (const grub_uint32_t * str, - const grub_uint32_t * last_position, +VasEBoot_print_ucs4 (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term) + struct VasEBoot_term_output *term) { print_ucs4_real (str, last_position, margin_left, margin_right, term, 0, 0, 1, 0, -1, 0, 0, 0); } int -grub_ucs4_count_lines (const grub_uint32_t * str, - const grub_uint32_t * last_position, +VasEBoot_ucs4_count_lines (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term) + struct VasEBoot_term_output *term) { return print_ucs4_real (str, last_position, margin_left, margin_right, term, 0, 1, 1, 0, -1, 0, 0, 0); } void -grub_xnputs (const char *str, grub_size_t msg_len) +VasEBoot_xnputs (const char *str, VasEBoot_size_t msg_len) { - grub_uint32_t *unicode_str = NULL, *unicode_last_position; + VasEBoot_uint32_t *unicode_str = NULL, *unicode_last_position; int backlog = 0; - grub_term_output_t term; + VasEBoot_term_output_t term; - grub_error_push (); + VasEBoot_error_push (); - unicode_str = grub_malloc (msg_len * sizeof (grub_uint32_t)); + unicode_str = VasEBoot_malloc (msg_len * sizeof (VasEBoot_uint32_t)); - grub_error_pop (); + VasEBoot_error_pop (); if (!unicode_str) { for (; msg_len--; str++, msg_len++) { - struct grub_unicode_glyph c = + struct VasEBoot_unicode_glyph c = { .variant = 0, .attributes = 0, @@ -1047,15 +1047,15 @@ grub_xnputs (const char *str, grub_size_t msg_len) return; } - msg_len = grub_utf8_to_ucs4 (unicode_str, msg_len, - (grub_uint8_t *) str, -1, 0); + msg_len = VasEBoot_utf8_to_ucs4 (unicode_str, msg_len, + (VasEBoot_uint8_t *) str, -1, 0); unicode_last_position = unicode_str + msg_len; FOR_ACTIVE_TERM_OUTPUTS(term) { int cur; cur = print_ucs4_real (unicode_str, unicode_last_position, 0, 0, - term, grub_more, 0, 0, 0, -1, 0, 0, 0); + term, VasEBoot_more, 0, 0, 0, -1, 0, 0, 0); if (cur) backlog = 1; } @@ -1071,26 +1071,26 @@ grub_xnputs (const char *str, grub_size_t msg_len) backlog = 1; } } - grub_free (unicode_str); + VasEBoot_free (unicode_str); } void -grub_xputs_normal (const char *str) +VasEBoot_xputs_normal (const char *str) { - grub_xnputs (str, grub_strlen (str)); + VasEBoot_xnputs (str, VasEBoot_strlen (str)); } void -grub_cls (void) +VasEBoot_cls (void) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; FOR_ACTIVE_TERM_OUTPUTS(term) { - if ((term->flags & GRUB_TERM_DUMB) || (grub_env_get ("debug"))) + if ((term->flags & VasEBoot_TERM_DUMB) || (VasEBoot_env_get ("debug"))) { - grub_putcode ('\n', term); - grub_term_refresh (term); + VasEBoot_putcode ('\n', term); + VasEBoot_term_refresh (term); } else (term->cls) (term); diff --git a/VasEBoot-core/osdep/apple/getroot.c b/VasEBoot-core/osdep/apple/getroot.c index 2091dedfe..69d7ebb2b 100644 --- a/VasEBoot-core/osdep/apple/getroot.c +++ b/VasEBoot-core/osdep/apple/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,15 +35,15 @@ #include #endif -#include +#include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -53,7 +53,7 @@ # include char * -grub_util_part_to_disk (const char *os_dev, struct stat *st, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part) { char *path = xstrdup (os_dev); @@ -68,7 +68,7 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, { char *p; for (p = path + 5; *p; ++p) - if (grub_isdigit(*p)) + if (VasEBoot_isdigit(*p)) { p = strpbrk (p, "sp"); if (p) @@ -82,28 +82,28 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, return path; } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev __attribute__ ((unused))) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev __attribute__ ((unused))) { return 0; } diff --git a/VasEBoot-core/osdep/apple/hostdisk.c b/VasEBoot-core/osdep/apple/hostdisk.c index 8d9b4b402..f541653fe 100644 --- a/VasEBoot-core/osdep/apple/hostdisk.c +++ b/VasEBoot-core/osdep/apple/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -44,8 +44,8 @@ # include -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { unsigned long long nr; unsigned sector_size, log_sector_size; @@ -68,10 +68,10 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec return nr << log_sector_size; } -grub_util_fd_t -grub_util_fd_open (const char *os_dev, int flags) +VasEBoot_util_fd_t +VasEBoot_util_fd_open (const char *os_dev, int flags) { - grub_util_fd_t ret; + VasEBoot_util_fd_t ret; #ifdef O_LARGEFILE flags |= O_LARGEFILE; @@ -90,6 +90,6 @@ grub_util_fd_open (const char *os_dev, int flags) } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/aros/config.c b/VasEBoot-core/osdep/aros/config.c index c82d0ea8e..81db5cd13 100644 --- a/VasEBoot-core/osdep/aros/config.c +++ b/VasEBoot-core/osdep/aros/config.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -31,38 +31,38 @@ #include const char * -grub_util_get_config_filename (void) +VasEBoot_util_get_config_filename (void) { static char *value = NULL; if (!value) - value = grub_util_path_concat (3, GRUB_SYSCONFDIR, - "default", "grub"); + value = VasEBoot_util_path_concat (3, VasEBoot_SYSCONFDIR, + "default", "VasEBoot"); return value; } const char * -grub_util_get_pkgdatadir (void) +VasEBoot_util_get_pkgdatadir (void) { const char *ret = getenv ("pkgdatadir"); if (ret) return ret; - return GRUB_DATADIR "/" PACKAGE; + return VasEBoot_DATADIR "/" PACKAGE; } const char * -grub_util_get_pkglibdir (void) +VasEBoot_util_get_pkglibdir (void) { - return GRUB_LIBDIR "/" PACKAGE; + return VasEBoot_LIBDIR "/" PACKAGE; } const char * -grub_util_get_localedir (void) +VasEBoot_util_get_localedir (void) { return LOCALEDIR; } void -grub_util_load_config (struct grub_util_config *cfg) +VasEBoot_util_load_config (struct VasEBoot_util_config *cfg) { const char *cfgfile; FILE *f = NULL; @@ -70,25 +70,25 @@ grub_util_load_config (struct grub_util_config *cfg) memset (cfg, 0, sizeof (*cfg)); - v = getenv ("GRUB_ENABLE_CRYPTODISK"); + v = getenv ("VasEBoot_ENABLE_CRYPTODISK"); if (v && v[0] == 'y' && v[1] == '\0') cfg->is_cryptodisk_enabled = 1; - v = getenv ("GRUB_DISTRIBUTOR"); + v = getenv ("VasEBoot_DISTRIBUTOR"); if (v) - cfg->grub_distributor = xstrdup (v); + cfg->VasEBoot_distributor = xstrdup (v); - cfgfile = grub_util_get_config_filename (); - if (!grub_util_is_regular (cfgfile)) + cfgfile = VasEBoot_util_get_config_filename (); + if (!VasEBoot_util_is_regular (cfgfile)) return; - f = grub_util_fopen (cfgfile, "r"); + f = VasEBoot_util_fopen (cfgfile, "r"); if (f) { - grub_util_parse_config (f, cfg, 0); + VasEBoot_util_parse_config (f, cfg, 0); fclose (f); } else - grub_util_warn (_("cannot open configuration file `%s': %s"), + VasEBoot_util_warn (_("cannot open configuration file `%s': %s"), cfgfile, strerror (errno)); } diff --git a/VasEBoot-core/osdep/aros/getroot.c b/VasEBoot-core/osdep/aros/getroot.c index a27df9eb9..bed5ab739 100644 --- a/VasEBoot-core/osdep/aros/getroot.c +++ b/VasEBoot-core/osdep/aros/getroot.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -36,7 +36,7 @@ #include char * -grub_util_part_to_disk (const char *dev, +VasEBoot_util_part_to_disk (const char *dev, struct stat *st __attribute__ ((unused)), int *is_part) { @@ -77,28 +77,28 @@ grub_util_part_to_disk (const char *dev, return ret; } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { const char *dname; struct DosList *dl; @@ -124,14 +124,14 @@ grub_util_find_partition_start_os (const char *dev) fm = (struct FileSysStartupMsg *) BADDR(dn->dn_Startup); envec = (struct DosEnvec *) fm->fssm_Environ; - return (((grub_uint64_t) envec->de_Surfaces - * (grub_uint64_t) envec->de_BlocksPerTrack - * (grub_uint64_t) envec->de_LowCyl) - * (grub_uint64_t) envec->de_SizeBlock) >> 7; + return (((VasEBoot_uint64_t) envec->de_Surfaces + * (VasEBoot_uint64_t) envec->de_BlocksPerTrack + * (VasEBoot_uint64_t) envec->de_LowCyl) + * (VasEBoot_uint64_t) envec->de_SizeBlock) >> 7; } char ** -grub_guess_root_devices (const char *path) +VasEBoot_guess_root_devices (const char *path) { char **os_dev = NULL; struct InfoData id; @@ -143,13 +143,13 @@ grub_guess_root_devices (const char *path) lck = Lock ((const unsigned char *) path, SHARED_LOCK); if (!lck) - grub_util_info ("Lock(%s) failed", path); + VasEBoot_util_info ("Lock(%s) failed", path); if (!lck || !Info (lck, &id)) { char *p; if (lck) UnLock (lck); - grub_util_info ("Info(%s) failed", path); + VasEBoot_util_info ("Info(%s) failed", path); os_dev = xmalloc (2 * sizeof (os_dev[0])); sz = strlen (path); os_dev[0] = xmalloc (sz + 5); @@ -167,9 +167,9 @@ grub_guess_root_devices (const char *path) dl = BADDR (id.id_VolumeNode); if (!dl->dl_Task) - grub_util_error ("unsupported device %s", dl->dl_Name); + VasEBoot_util_error ("unsupported device %s", dl->dl_Name); - grub_util_info ("dl=%p, dl->dl_Name=%s, dl->dl_Task=%p", + VasEBoot_util_info ("dl=%p, dl->dl_Name=%s, dl->dl_Task=%p", dl, dl->dl_Name, dl->dl_Task); @@ -189,7 +189,7 @@ grub_guess_root_devices (const char *path) else nm = (char *) dl->dl_Name; - grub_util_info ("dl2=%p, nm=%s", dl2, nm); + VasEBoot_util_info ("dl2=%p, nm=%s", dl2, nm); os_dev = xmalloc (2 * sizeof (os_dev[0])); sz = strlen (nm); @@ -208,11 +208,11 @@ grub_guess_root_devices (const char *path) } int -grub_util_biosdisk_is_floppy (grub_disk_t disk) +VasEBoot_util_biosdisk_is_floppy (VasEBoot_disk_t disk) { const char *dname; - dname = grub_util_biosdisk_get_osdev (disk); + dname = VasEBoot_util_biosdisk_get_osdev (disk); if (dname[0] != '/' || dname[1] != '/' || dname[2] != ':') return 0; diff --git a/VasEBoot-core/osdep/aros/hostdisk.c b/VasEBoot-core/osdep/aros/hostdisk.c index 7d99b54b8..644828597 100644 --- a/VasEBoot-core/osdep/aros/hostdisk.c +++ b/VasEBoot-core/osdep/aros/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -61,7 +61,7 @@ static ULONG *bounce; char * -grub_canonicalize_file_name (const char *path) +VasEBoot_canonicalize_file_name (const char *path) { char *ret; BPTR lck; @@ -83,8 +83,8 @@ grub_canonicalize_file_name (const char *path) return ret; } -static grub_uint64_t -grub_util_get_fd_size_volume (grub_util_fd_t fd __attribute__ ((unused)), +static VasEBoot_uint64_t +VasEBoot_util_get_fd_size_volume (VasEBoot_util_fd_t fd __attribute__ ((unused)), const char *dev, unsigned *log_secsize) { @@ -95,7 +95,7 @@ grub_util_get_fd_size_volume (grub_util_fd_t fd __attribute__ ((unused)), if (!bounce) bounce = AllocVec (BOUNCE_SIZE, MEMF_PUBLIC | MEMF_CLEAR); if (!bounce) - grub_util_error ("out of memory"); + VasEBoot_util_error ("out of memory"); fd->ioreq->iotd_Req.io_Command = TD_GETGEOMETRY; fd->ioreq->iotd_Req.io_Length = sizeof (*geo); @@ -105,7 +105,7 @@ grub_util_get_fd_size_volume (grub_util_fd_t fd __attribute__ ((unused)), err = DoIO ((struct IORequest *) fd->ioreq); if (err) { - grub_util_info ("I/O failed with error %d, IoErr=%d", (int)err, (int) IoErr ()); + VasEBoot_util_info ("I/O failed with error %d, IoErr=%d", (int)err, (int) IoErr ()); return -1; } @@ -123,11 +123,11 @@ grub_util_get_fd_size_volume (grub_util_fd_t fd __attribute__ ((unused)), if (log_secsize) *log_secsize = log_sector_size; - return (grub_uint64_t) geo->dg_TotalSectors * (grub_uint64_t) geo->dg_SectorSize; + return (VasEBoot_uint64_t) geo->dg_TotalSectors * (VasEBoot_uint64_t) geo->dg_SectorSize; } -static grub_uint64_t -grub_util_get_fd_size_file (grub_util_fd_t fd, +static VasEBoot_uint64_t +VasEBoot_util_get_fd_size_file (VasEBoot_util_fd_t fd, const char *dev __attribute__ ((unused)), unsigned *log_secsize) { @@ -141,16 +141,16 @@ grub_util_get_fd_size_file (grub_util_fd_t fd, } int -grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) +VasEBoot_util_fd_seek (VasEBoot_util_fd_t fd, VasEBoot_uint64_t off) { switch (fd->type) { - case GRUB_UTIL_FD_FILE: + case VasEBoot_UTIL_FD_FILE: if (lseek (fd->fd, 0, SEEK_SET) == (off_t) -1) return -1; fd->off = off; return 0; - case GRUB_UTIL_FD_DISK: + case VasEBoot_UTIL_FD_DISK: fd->off = off; return 0; } @@ -158,10 +158,10 @@ grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) return -1; } -grub_util_fd_t -grub_util_fd_open (const char *dev, int flg) +VasEBoot_util_fd_t +VasEBoot_util_fd_open (const char *dev, int flg) { - grub_util_fd_t ret = xmalloc (sizeof (*ret)); + VasEBoot_util_fd_t ret = xmalloc (sizeof (*ret)); const char *p1, *p2; const char *dname; char *tmp; @@ -179,7 +179,7 @@ grub_util_fd_open (const char *dev, int flg) if (dev[0] != '/' || dev[1] != '/' || dev[2] != ':') { - ret->type = GRUB_UTIL_FD_FILE; + ret->type = VasEBoot_UTIL_FD_FILE; ret->fd = open (dev, flg, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR); if (ret->fd < 0) { @@ -194,9 +194,9 @@ grub_util_fd_open (const char *dev, int flg) p1 = dev + strlen (dev); else { - unit = grub_strtoul (p1 + 1, (char **) &p2, 16); + unit = VasEBoot_strtoul (p1 + 1, (char **) &p2, 16); if (p2 && *p2 == '/') - flags = grub_strtoul (p2 + 1, 0, 16); + flags = VasEBoot_strtoul (p2 + 1, 0, 16); } ret->mp = CreateMsgPort(); @@ -215,7 +215,7 @@ grub_util_fd_open (const char *dev, int flg) } dname = dev + 3; - ret->type = GRUB_UTIL_FD_DISK; + ret->type = VasEBoot_UTIL_FD_DISK; tmp = xmalloc (p1 - dname + 1); memcpy (tmp, dname, p1 - dname); @@ -237,7 +237,7 @@ grub_util_fd_open (const char *dev, int flg) } static ssize_t -grub_util_fd_read_file (grub_util_fd_t fd, char *buf, size_t len) +VasEBoot_util_fd_read_file (VasEBoot_util_fd_t fd, char *buf, size_t len) { ssize_t size = len; @@ -264,7 +264,7 @@ grub_util_fd_read_file (grub_util_fd_t fd, char *buf, size_t len) /* Write LEN bytes from BUF to FD. Return less than or equal to zero if an error occurs, otherwise return LEN. */ static ssize_t -grub_util_fd_write_file (grub_util_fd_t fd, const char *buf, size_t len) +VasEBoot_util_fd_write_file (VasEBoot_util_fd_t fd, const char *buf, size_t len) { ssize_t size = len; @@ -289,7 +289,7 @@ grub_util_fd_write_file (grub_util_fd_t fd, const char *buf, size_t len) } static void -stop_motor (grub_util_fd_t fd) +stop_motor (VasEBoot_util_fd_t fd) { if (!fd->is_floppy) return; @@ -302,14 +302,14 @@ stop_motor (grub_util_fd_t fd) } static ssize_t -grub_util_fd_read_volume (grub_util_fd_t fd, char *buf, size_t len) +VasEBoot_util_fd_read_volume (VasEBoot_util_fd_t fd, char *buf, size_t len) { - grub_uint64_t adj = 0; + VasEBoot_uint64_t adj = 0; if (!bounce) bounce = AllocVec (BOUNCE_SIZE, MEMF_PUBLIC | MEMF_CLEAR); if (!bounce) - grub_util_error ("out of memory"); + VasEBoot_util_error ("out of memory"); while (len) { @@ -334,7 +334,7 @@ grub_util_fd_read_volume (grub_util_fd_t fd, char *buf, size_t len) } if (err) { - grub_util_info ("I/O failed with error %d, IoErr=%d", (int)err, (int) IoErr ()); + VasEBoot_util_info ("I/O failed with error %d, IoErr=%d", (int)err, (int) IoErr ()); stop_motor (fd); return -1; } @@ -350,13 +350,13 @@ grub_util_fd_read_volume (grub_util_fd_t fd, char *buf, size_t len) } static ssize_t -grub_util_fd_write_volume (grub_util_fd_t fd, const char *buf, size_t len) +VasEBoot_util_fd_write_volume (VasEBoot_util_fd_t fd, const char *buf, size_t len) { - grub_uint64_t adj = 0; + VasEBoot_uint64_t adj = 0; if (!bounce) bounce = AllocVec (BOUNCE_SIZE, MEMF_PUBLIC | MEMF_CLEAR); if (!bounce) - grub_util_error ("out of memory"); + VasEBoot_util_error ("out of memory"); while (len) { @@ -382,7 +382,7 @@ grub_util_fd_write_volume (grub_util_fd_t fd, const char *buf, size_t len) } if (err) { - grub_util_info ("I/O failed with error %d", err); + VasEBoot_util_info ("I/O failed with error %d", err); stop_motor (fd); return -1; } @@ -398,56 +398,56 @@ grub_util_fd_write_volume (grub_util_fd_t fd, const char *buf, size_t len) } ssize_t -grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len) +VasEBoot_util_fd_read (VasEBoot_util_fd_t fd, char *buf, size_t len) { switch (fd->type) { - case GRUB_UTIL_FD_FILE: - return grub_util_fd_read_file (fd, buf, len); - case GRUB_UTIL_FD_DISK: - return grub_util_fd_read_volume (fd, buf, len); + case VasEBoot_UTIL_FD_FILE: + return VasEBoot_util_fd_read_file (fd, buf, len); + case VasEBoot_UTIL_FD_DISK: + return VasEBoot_util_fd_read_volume (fd, buf, len); } return -1; } ssize_t -grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len) +VasEBoot_util_fd_write (VasEBoot_util_fd_t fd, const char *buf, size_t len) { switch (fd->type) { - case GRUB_UTIL_FD_FILE: - return grub_util_fd_write_file (fd, buf, len); - case GRUB_UTIL_FD_DISK: - return grub_util_fd_write_volume (fd, buf, len); + case VasEBoot_UTIL_FD_FILE: + return VasEBoot_util_fd_write_file (fd, buf, len); + case VasEBoot_UTIL_FD_DISK: + return VasEBoot_util_fd_write_volume (fd, buf, len); } return -1; } -grub_uint64_t -grub_util_get_fd_size (grub_util_fd_t fd, +VasEBoot_uint64_t +VasEBoot_util_get_fd_size (VasEBoot_util_fd_t fd, const char *dev, unsigned *log_secsize) { switch (fd->type) { - case GRUB_UTIL_FD_FILE: - return grub_util_get_fd_size_file (fd, dev, log_secsize); + case VasEBoot_UTIL_FD_FILE: + return VasEBoot_util_get_fd_size_file (fd, dev, log_secsize); - case GRUB_UTIL_FD_DISK: - return grub_util_get_fd_size_volume (fd, dev, log_secsize); + case VasEBoot_UTIL_FD_DISK: + return VasEBoot_util_get_fd_size_volume (fd, dev, log_secsize); } return -1; } void -grub_util_fd_close (grub_util_fd_t fd) +VasEBoot_util_fd_close (VasEBoot_util_fd_t fd) { switch (fd->type) { - case GRUB_UTIL_FD_FILE: + case VasEBoot_UTIL_FD_FILE: close (fd->fd); return; - case GRUB_UTIL_FD_DISK: + case VasEBoot_UTIL_FD_DISK: CloseDevice ((struct IORequest *) fd->ioreq); DeleteIORequest((struct IORequest *) fd->ioreq); DeleteMsgPort (fd->mp); @@ -458,7 +458,7 @@ grub_util_fd_close (grub_util_fd_t fd) static int allow_fd_syncs = 1; static void -grub_util_fd_sync_volume (grub_util_fd_t fd) +VasEBoot_util_fd_sync_volume (VasEBoot_util_fd_t fd) { fd->ioreq->iotd_Req.io_Command = CMD_UPDATE; fd->ioreq->iotd_Req.io_Length = 0; @@ -469,24 +469,24 @@ grub_util_fd_sync_volume (grub_util_fd_t fd) } void -grub_util_fd_sync (grub_util_fd_t fd) +VasEBoot_util_fd_sync (VasEBoot_util_fd_t fd) { if (allow_fd_syncs) { switch (fd->type) { - case GRUB_UTIL_FD_FILE: + case VasEBoot_UTIL_FD_FILE: fsync (fd->fd); return; - case GRUB_UTIL_FD_DISK: - grub_util_fd_sync_volume (fd); + case VasEBoot_UTIL_FD_DISK: + VasEBoot_util_fd_sync_volume (fd); return; } } } void -grub_util_file_sync (FILE *f) +VasEBoot_util_file_sync (FILE *f) { fflush (f); if (!allow_fd_syncs) @@ -495,19 +495,19 @@ grub_util_file_sync (FILE *f) } void -grub_util_disable_fd_syncs (void) +VasEBoot_util_disable_fd_syncs (void) { allow_fd_syncs = 0; } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } const char * -grub_util_fd_strerror (void) +VasEBoot_util_fd_strerror (void) { static char buf[201]; LONG err = IoErr (); @@ -521,13 +521,13 @@ grub_util_fd_strerror (void) } FILE * -grub_util_fopen (const char *path, const char *mode) +VasEBoot_util_fopen (const char *path, const char *mode) { return fopen (path, mode); } int -grub_util_is_directory (const char *path) +VasEBoot_util_is_directory (const char *path) { struct stat st; @@ -538,7 +538,7 @@ grub_util_is_directory (const char *path) } int -grub_util_is_regular (const char *path) +VasEBoot_util_is_regular (const char *path) { struct stat st; @@ -549,7 +549,7 @@ grub_util_is_regular (const char *path) } int -grub_util_is_special_file (const char *path) +VasEBoot_util_is_special_file (const char *path) { struct stat st; @@ -567,7 +567,7 @@ get_temp_name (void) while (1) { - t = xasprintf ("T:grub.%d.%d.%d.%d", (int) getpid (), (int) getppid (), + t = xasprintf ("T:VasEBoot.%d.%d.%d.%d", (int) getpid (), (int) getppid (), ctr++, time (0)); if (stat (t, &st) == -1) return t; @@ -576,29 +576,29 @@ get_temp_name (void) } char * -grub_util_make_temporary_file (void) +VasEBoot_util_make_temporary_file (void) { char *ret = get_temp_name (); FILE *f; - f = grub_util_fopen (ret, "wb"); + f = VasEBoot_util_fopen (ret, "wb"); if (f) fclose (f); return ret; } char * -grub_util_make_temporary_dir (void) +VasEBoot_util_make_temporary_dir (void) { char *ret = get_temp_name (); - grub_util_mkdir (ret); + VasEBoot_util_mkdir (ret); return ret; } -grub_uint32_t -grub_util_get_mtime (const char *path) +VasEBoot_uint32_t +VasEBoot_util_get_mtime (const char *path) { struct stat st; diff --git a/VasEBoot-core/osdep/aros/relpath.c b/VasEBoot-core/osdep/aros/relpath.c index 9c2328d5f..30ec29e52 100644 --- a/VasEBoot-core/osdep/aros/relpath.c +++ b/VasEBoot-core/osdep/aros/relpath.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -36,7 +36,7 @@ #include char * -grub_make_system_path_relative_to_its_root (const char *path) +VasEBoot_make_system_path_relative_to_its_root (const char *path) { char *p; unsigned char *tmp; diff --git a/VasEBoot-core/osdep/basic/compress.c b/VasEBoot-core/osdep/basic/compress.c index 9794640e8..57c4b82aa 100644 --- a/VasEBoot-core/osdep/basic/compress.c +++ b/VasEBoot-core/osdep/basic/compress.c @@ -1,21 +1,21 @@ #include -#include -#include +#include +#include int -grub_install_compress_gzip (const char *src, const char *dest) +VasEBoot_install_compress_gzip (const char *src, const char *dest) { - grub_util_error (_("no compression is available for your platform")); + VasEBoot_util_error (_("no compression is available for your platform")); } int -grub_install_compress_xz (const char *src, const char *dest) +VasEBoot_install_compress_xz (const char *src, const char *dest) { - grub_util_error (_("no compression is available for your platform")); + VasEBoot_util_error (_("no compression is available for your platform")); } int -grub_install_compress_lzop (const char *src, const char *dest) +VasEBoot_install_compress_lzop (const char *src, const char *dest) { - grub_util_error (_("no compression is available for your platform")); + VasEBoot_util_error (_("no compression is available for your platform")); } diff --git a/VasEBoot-core/osdep/basic/emunet.c b/VasEBoot-core/osdep/basic/emunet.c index 6362e5cfb..aa2326caa 100644 --- a/VasEBoot-core/osdep/basic/emunet.c +++ b/VasEBoot-core/osdep/basic/emunet.c @@ -1,50 +1,50 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include +#include +#include -grub_ssize_t -grub_emunet_send (const void *packet __attribute__ ((unused)), - grub_size_t sz __attribute__ ((unused))) +VasEBoot_ssize_t +VasEBoot_emunet_send (const void *packet __attribute__ ((unused)), + VasEBoot_size_t sz __attribute__ ((unused))) { return -1; } -grub_ssize_t -grub_emunet_receive (void *packet __attribute__ ((unused)), - grub_size_t sz __attribute__ ((unused))) +VasEBoot_ssize_t +VasEBoot_emunet_receive (void *packet __attribute__ ((unused)), + VasEBoot_size_t sz __attribute__ ((unused))) { return -1; } int -grub_emunet_create (grub_size_t *mtu) +VasEBoot_emunet_create (VasEBoot_size_t *mtu) { *mtu = 1500; return -1; } void -grub_emunet_close (void) +VasEBoot_emunet_close (void) { return; } diff --git a/VasEBoot-core/osdep/basic/getroot.c b/VasEBoot-core/osdep/basic/getroot.c index 8831eb3af..85683fae9 100644 --- a/VasEBoot-core/osdep/basic/getroot.c +++ b/VasEBoot-core/osdep/basic/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,19 +35,19 @@ #include #endif -#include +#include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include char * -grub_util_part_to_disk (const char *os_dev, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st __attribute__ ((unused)), int *is_part) { @@ -55,28 +55,28 @@ grub_util_part_to_disk (const char *os_dev, return xstrdup (os_dev); } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev __attribute__ ((unused))) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev __attribute__ ((unused))) { return 0; } diff --git a/VasEBoot-core/osdep/basic/hostdisk.c b/VasEBoot-core/osdep/basic/hostdisk.c index 529bf29f3..1ddbd5784 100644 --- a/VasEBoot-core/osdep/basic/hostdisk.c +++ b/VasEBoot-core/osdep/basic/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -42,8 +42,8 @@ #include #include -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd __attribute__ ((unused)), +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd __attribute__ ((unused)), const char *name __attribute__ ((unused)), unsigned *log_secsize __attribute__ ((unused))) { @@ -53,6 +53,6 @@ grub_util_get_fd_size_os (grub_util_fd_t fd __attribute__ ((unused)), } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/basic/init.c b/VasEBoot-core/osdep/basic/init.c index c54c710db..2f6408508 100644 --- a/VasEBoot-core/osdep/basic/init.c +++ b/VasEBoot-core/osdep/basic/init.c @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include +#include +#include #include "progname.h" void -grub_util_host_init (int *argc __attribute__ ((unused)), +VasEBoot_util_host_init (int *argc __attribute__ ((unused)), char ***argv) { set_program_name ((*argv)[0]); -#if (defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS) +#if (defined (VasEBoot_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS) setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/VasEBoot-core/osdep/basic/no_platform.c b/VasEBoot-core/osdep/basic/no_platform.c index d76c34c14..c763a76c3 100644 --- a/VasEBoot-core/osdep/basic/no_platform.c +++ b/VasEBoot-core/osdep/basic/no_platform.c @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include #include "platform.c" void -grub_install_register_ieee1275 (int is_prep, const char *install_device, +VasEBoot_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath) { - grub_util_error ("%s", _("no IEEE1275 routines are available for your platform")); + VasEBoot_util_error ("%s", _("no IEEE1275 routines are available for your platform")); } void -grub_install_register_efi (grub_device_t efidir_grub_dev, +VasEBoot_install_register_efi (VasEBoot_device_t efidir_VasEBoot_dev, const char *efifile_path, const char *efi_distributor) { - grub_util_error ("%s", _("no EFI routines are available for your platform")); + VasEBoot_util_error ("%s", _("no EFI routines are available for your platform")); } void -grub_install_sgi_setup (const char *install_device, +VasEBoot_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname) { - grub_util_error ("%s", _("no SGI routines are available for your platform")); + VasEBoot_util_error ("%s", _("no SGI routines are available for your platform")); } diff --git a/VasEBoot-core/osdep/basic/ofpath.c b/VasEBoot-core/osdep/basic/ofpath.c index c3fe06f68..fa10b164b 100644 --- a/VasEBoot-core/osdep/basic/ofpath.c +++ b/VasEBoot-core/osdep/basic/ofpath.c @@ -1,27 +1,27 @@ /* ofpath.c - calculate OpenFirmware path names given an OS device */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2011,2012, 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include char * -grub_util_devname_to_ofpath (const char *sys_devname __attribute__ ((unused))) +VasEBoot_util_devname_to_ofpath (const char *sys_devname __attribute__ ((unused))) { return NULL; } diff --git a/VasEBoot-core/osdep/basic/platform.c b/VasEBoot-core/osdep/basic/platform.c index 4b5502aeb..f5afd522c 100644 --- a/VasEBoot-core/osdep/basic/platform.c +++ b/VasEBoot-core/osdep/basic/platform.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include const char * -grub_install_get_default_x86_platform (void) +VasEBoot_install_get_default_x86_platform (void) { return "i386-pc"; } diff --git a/VasEBoot-core/osdep/basic/random.c b/VasEBoot-core/osdep/basic/random.c index b5ccad4ad..d7fefc1df 100644 --- a/VasEBoot-core/osdep/basic/random.c +++ b/VasEBoot-core/osdep/basic/random.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1992-1999,2001,2003,2004,2005,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -31,13 +31,13 @@ #include int -grub_get_random (void *out, grub_size_t len) +VasEBoot_get_random (void *out, VasEBoot_size_t len) { #warning "No random number generator is available for your OS. \ -Some functions like grub-mkpaswd and installing on UUID-less disks will be \ +Some functions like VasEBoot-mkpaswd and installing on UUID-less disks will be \ disabled." - grub_util_error ("%s", + VasEBoot_util_error ("%s", /* TRANSLATORS: The OS itself may very well have a random - number generator but GRUB doesn't know how to access it. */ + number generator but VasEBoot doesn't know how to access it. */ _("no random number generator is available for your OS")); } diff --git a/VasEBoot-core/osdep/bsd/getroot.c b/VasEBoot-core/osdep/bsd/getroot.c index dbc6a2f2a..e3d11ed6e 100644 --- a/VasEBoot-core/osdep/bsd/getroot.c +++ b/VasEBoot-core/osdep/bsd/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,15 +35,15 @@ #include #endif -#include +#include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -61,7 +61,7 @@ #endif char * -grub_util_part_to_disk (const char *os_dev, struct stat *st, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part) { int rawpart = -1; @@ -88,14 +88,14 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, fd = open (os_dev, O_RDONLY); if (fd == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), os_dev, strerror (errno)); return xstrdup (os_dev); } if (ioctl (fd, DIOCGWEDGEINFO, &dkw) == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot get disk wedge info of `%s'", os_dev); close (fd); return xstrdup (os_dev); @@ -114,7 +114,7 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, char *path = xstrdup (os_dev); char *p; for (p = path + sizeof("/dev/r"); *p >= 'a' && *p <= 'z'; p++); - if (grub_isdigit(*p)) + if (VasEBoot_isdigit(*p)) { p++; if ((*p >= 'a' && *p <= 'z') && (*(p+1) == '\0')) @@ -132,28 +132,28 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, return xstrdup (os_dev); } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { int fd; # if defined(__NetBSD__) @@ -162,10 +162,10 @@ grub_util_find_partition_start_os (const char *dev) struct disklabel label; int p_index; - fd = grub_util_fd_open (dev, O_RDONLY); + fd = VasEBoot_util_fd_open (dev, O_RDONLY); if (fd == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), dev, strerror (errno)); return 0; } @@ -175,13 +175,13 @@ grub_util_find_partition_start_os (const char *dev) if (ioctl (fd, DIOCGWEDGEINFO, &dkw) == 0) { close (fd); - return (grub_disk_addr_t) dkw.dkw_offset; + return (VasEBoot_disk_addr_t) dkw.dkw_offset; } # endif /* defined(__NetBSD__) */ if (ioctl (fd, DIOCGDINFO, &label) == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot get disk label of `%s'", dev); close (fd); return 0; @@ -196,9 +196,9 @@ grub_util_find_partition_start_os (const char *dev) if (p_index >= label.d_npartitions || p_index < 0) { - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no disk label entry for `%s'", dev); return 0; } - return (grub_disk_addr_t) label.d_partitions[p_index].p_offset; + return (VasEBoot_disk_addr_t) label.d_partitions[p_index].p_offset; } diff --git a/VasEBoot-core/osdep/bsd/hostdisk.c b/VasEBoot-core/osdep/bsd/hostdisk.c index 5912d14bf..9b6feceff 100644 --- a/VasEBoot-core/osdep/bsd/hostdisk.c +++ b/VasEBoot-core/osdep/bsd/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -61,7 +61,7 @@ floppy driver from retrying operations on failure, as otherwise the driver takes a while to abort when there is no floppy in the drive. */ static void -configure_device_driver (grub_util_fd_t fd) +configure_device_driver (VasEBoot_util_fd_t fd) { struct stat st; @@ -78,10 +78,10 @@ configure_device_driver (grub_util_fd_t fd) return; } } -grub_util_fd_t -grub_util_fd_open (const char *os_dev, int flags) +VasEBoot_util_fd_t +VasEBoot_util_fd_open (const char *os_dev, int flags) { - grub_util_fd_t ret; + VasEBoot_util_fd_t ret; #ifdef O_LARGEFILE flags |= O_LARGEFILE; @@ -98,14 +98,14 @@ grub_util_fd_open (const char *os_dev, int flags) #endif -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { struct disklabel label; unsigned sector_size, log_sector_size; #if defined(__NetBSD__) - grub_hostdisk_configure_device_driver (fd); + VasEBoot_hostdisk_configure_device_driver (fd); #endif if (ioctl (fd, DIOCGDINFO, &label) == -1) @@ -121,10 +121,10 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec if (log_secsize) *log_secsize = log_sector_size; - return (grub_uint64_t) label.d_secperunit << log_sector_size; + return (VasEBoot_uint64_t) label.d_secperunit << log_sector_size; } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/devmapper/getroot.c b/VasEBoot-core/osdep/devmapper/getroot.c index a13a39c96..9a0c7add3 100644 --- a/VasEBoot-core/osdep/devmapper/getroot.c +++ b/VasEBoot-core/osdep/devmapper/getroot.c @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include +#include +#include #ifdef HAVE_DEVICE_MAPPER @@ -48,16 +48,16 @@ #include -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include static int -grub_util_open_dm (const char *os_dev, struct dm_tree **tree, +VasEBoot_util_open_dm (const char *os_dev, struct dm_tree **tree, struct dm_tree_node **node) { uint32_t maj, min; @@ -78,14 +78,14 @@ grub_util_open_dm (const char *os_dev, struct dm_tree **tree, *tree = dm_tree_create (); if (! *tree) { - grub_puts_ (N_("Failed to create `device-mapper' tree")); - grub_dprintf ("hostdisk", "dm_tree_create failed\n"); + VasEBoot_puts_ (N_("Failed to create `device-mapper' tree")); + VasEBoot_dprintf ("hostdisk", "dm_tree_create failed\n"); return 0; } if (! dm_tree_add_dev (*tree, maj, min)) { - grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); + VasEBoot_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); dm_tree_free (*tree); *tree = NULL; return 0; @@ -94,7 +94,7 @@ grub_util_open_dm (const char *os_dev, struct dm_tree **tree, *node = dm_tree_find_node (*tree, maj, min); if (! *node) { - grub_dprintf ("hostdisk", "dm_tree_find_node failed\n"); + VasEBoot_dprintf ("hostdisk", "dm_tree_find_node failed\n"); dm_tree_free (*tree); *tree = NULL; return 0; @@ -110,51 +110,51 @@ get_dm_uuid (const char *os_dev) const char *node_uuid; char *ret; - if (!grub_util_open_dm (os_dev, &tree, &node)) + if (!VasEBoot_util_open_dm (os_dev, &tree, &node)) return NULL; node_uuid = dm_tree_node_get_uuid (node); if (! node_uuid) { - grub_dprintf ("hostdisk", "%s has no DM uuid\n", os_dev); + VasEBoot_dprintf ("hostdisk", "%s has no DM uuid\n", os_dev); dm_tree_free (tree); return NULL; } - ret = grub_strdup (node_uuid); + ret = VasEBoot_strdup (node_uuid); dm_tree_free (tree); return ret; } -enum grub_dev_abstraction_types -grub_util_get_dm_abstraction (const char *os_dev) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dm_abstraction (const char *os_dev) { char *uuid; uuid = get_dm_uuid (os_dev); if (uuid == NULL) - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; if (strncmp (uuid, "LVM-", 4) == 0) { - grub_free (uuid); - return GRUB_DEV_ABSTRACTION_LVM; + VasEBoot_free (uuid); + return VasEBoot_DEV_ABSTRACTION_LVM; } if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0) { - grub_free (uuid); - return GRUB_DEV_ABSTRACTION_LUKS; + VasEBoot_free (uuid); + return VasEBoot_DEV_ABSTRACTION_LUKS; } - grub_free (uuid); - return GRUB_DEV_ABSTRACTION_NONE; + VasEBoot_free (uuid); + return VasEBoot_DEV_ABSTRACTION_NONE; } void -grub_util_pull_devmapper (const char *os_dev) +VasEBoot_util_pull_devmapper (const char *os_dev) { struct dm_tree *tree; struct dm_tree_node *node; @@ -165,9 +165,9 @@ grub_util_pull_devmapper (const char *os_dev) uuid = get_dm_uuid (os_dev); - if (!grub_util_open_dm (os_dev, &tree, &node)) + if (!VasEBoot_util_open_dm (os_dev, &tree, &node)) { - grub_free (uuid); + VasEBoot_free (uuid); return; } @@ -177,68 +177,68 @@ grub_util_pull_devmapper (const char *os_dev) char *subdev; if (!dm) continue; - subdev = grub_find_device ("/dev", makedev (dm->major, dm->minor)); + subdev = VasEBoot_find_device ("/dev", makedev (dm->major, dm->minor)); if (subdev) { lastsubdev = subdev; - grub_util_pull_device (subdev); + VasEBoot_util_pull_device (subdev); } } if (uuid && strncmp (uuid, "CRYPT-LUKS1-", sizeof ("CRYPT-LUKS1-") - 1) == 0 && lastsubdev) { - char *grdev = grub_util_get_grub_dev (lastsubdev); + char *grdev = VasEBoot_util_get_VasEBoot_dev (lastsubdev); dm_tree_free (tree); if (grdev) { - grub_err_t err; - err = grub_cryptodisk_cheat_mount (grdev, os_dev); + VasEBoot_err_t err; + err = VasEBoot_cryptodisk_cheat_mount (grdev, os_dev); if (err) - grub_util_error (_("can't mount encrypted volume `%s': %s"), - lastsubdev, grub_errmsg); + VasEBoot_util_error (_("can't mount encrypted volume `%s': %s"), + lastsubdev, VasEBoot_errmsg); } - grub_free (grdev); + VasEBoot_free (grdev); } else dm_tree_free (tree); - grub_free (uuid); + VasEBoot_free (uuid); } char * -grub_util_devmapper_part_to_disk (struct stat *st, +VasEBoot_util_devmapper_part_to_disk (struct stat *st, int *is_part, const char *path) { int major, minor; - if (grub_util_get_dm_node_linear_info (st->st_rdev, + if (VasEBoot_util_get_dm_node_linear_info (st->st_rdev, &major, &minor, 0)) { *is_part = 1; - return grub_find_device ("/dev", makedev (major, minor)); + return VasEBoot_find_device ("/dev", makedev (major, minor)); } *is_part = 0; return xstrdup (path); } char * -grub_util_get_devmapper_grub_dev (const char *os_dev) +VasEBoot_util_get_devmapper_VasEBoot_dev (const char *os_dev) { char *uuid, *optr; - char *grub_dev; + char *VasEBoot_dev; uuid = get_dm_uuid (os_dev); if (!uuid) return NULL; - switch (grub_util_get_dev_abstraction (os_dev)) + switch (VasEBoot_util_get_dev_abstraction (os_dev)) { - case GRUB_DEV_ABSTRACTION_LVM: + case VasEBoot_DEV_ABSTRACTION_LVM: { unsigned i; int dashes[] = { 0, 6, 10, 14, 18, 22, 26, 32, 38, 42, 46, 50, 54, 58}; - grub_dev = xmalloc (grub_strlen (uuid) + 40); - optr = grub_stpcpy (grub_dev, "lvmid/"); + VasEBoot_dev = xmalloc (VasEBoot_strlen (uuid) + 40); + optr = VasEBoot_stpcpy (VasEBoot_dev, "lvmid/"); for (i = 0; i < ARRAY_SIZE (dashes) - 1; i++) { memcpy (optr, uuid + sizeof ("LVM-") - 1 + dashes[i], @@ -248,33 +248,33 @@ grub_util_get_devmapper_grub_dev (const char *os_dev) } optr = stpcpy (optr, uuid + sizeof ("LVM-") - 1 + dashes[i]); *optr = '\0'; - grub_dev[sizeof("lvmid/xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx") - 1] + VasEBoot_dev[sizeof("lvmid/xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx") - 1] = '/'; free (uuid); - return grub_dev; + return VasEBoot_dev; } - case GRUB_DEV_ABSTRACTION_LUKS: + case VasEBoot_DEV_ABSTRACTION_LUKS: { char *dash; - dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-'); + dash = VasEBoot_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-'); if (dash) *dash = 0; - grub_dev = grub_xasprintf ("cryptouuid/%s", + VasEBoot_dev = VasEBoot_xasprintf ("cryptouuid/%s", uuid + sizeof ("CRYPT-LUKS1-") - 1); - grub_free (uuid); - return grub_dev; + VasEBoot_free (uuid); + return VasEBoot_dev; } default: - grub_free (uuid); + VasEBoot_free (uuid); return NULL; } } char * -grub_util_get_vg_uuid (const char *os_dev) +VasEBoot_util_get_vg_uuid (const char *os_dev) { char *uuid, *vgid; int dashes[] = { 0, 6, 10, 14, 18, 22, 26, 32}; @@ -285,7 +285,7 @@ grub_util_get_vg_uuid (const char *os_dev) if (!uuid) return NULL; - vgid = xmalloc (grub_strlen (uuid)); + vgid = xmalloc (VasEBoot_strlen (uuid)); optr = vgid; for (i = 0; i < ARRAY_SIZE (dashes) - 1; i++) { @@ -296,42 +296,42 @@ grub_util_get_vg_uuid (const char *os_dev) } optr--; *optr = '\0'; - grub_free (uuid); + VasEBoot_free (uuid); return vgid; } void -grub_util_devmapper_cleanup (void) +VasEBoot_util_devmapper_cleanup (void) { dm_lib_release (); } #else void -grub_util_pull_devmapper (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_pull_devmapper (const char *os_dev __attribute__ ((unused))) { return; } void -grub_util_devmapper_cleanup (void) +VasEBoot_util_devmapper_cleanup (void) { } -enum grub_dev_abstraction_types -grub_util_get_dm_abstraction (const char *os_dev __attribute__ ((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dm_abstraction (const char *os_dev __attribute__ ((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } char * -grub_util_get_vg_uuid (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_vg_uuid (const char *os_dev __attribute__ ((unused))) { return NULL; } char * -grub_util_devmapper_part_to_disk (struct stat *st __attribute__ ((unused)), +VasEBoot_util_devmapper_part_to_disk (struct stat *st __attribute__ ((unused)), int *is_part __attribute__ ((unused)), const char *os_dev __attribute__ ((unused))) { @@ -339,7 +339,7 @@ grub_util_devmapper_part_to_disk (struct stat *st __attribute__ ((unused)), } char * -grub_util_get_devmapper_grub_dev (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_devmapper_VasEBoot_dev (const char *os_dev __attribute__ ((unused))) { return NULL; } diff --git a/VasEBoot-core/osdep/devmapper/hostdisk.c b/VasEBoot-core/osdep/devmapper/hostdisk.c index a697bcb4d..a5d76f678 100644 --- a/VasEBoot-core/osdep/devmapper/hostdisk.c +++ b/VasEBoot-core/osdep/devmapper/hostdisk.c @@ -1,16 +1,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,7 +43,7 @@ static void device_mapper_null_log (int level __attribute__ ((unused)), } int -grub_device_mapper_supported (void) +VasEBoot_device_mapper_supported (void) { static int supported = -1; @@ -67,17 +67,17 @@ grub_device_mapper_supported (void) } int -grub_util_device_is_mapped (const char *dev) +VasEBoot_util_device_is_mapped (const char *dev) { struct stat st; - if (!grub_device_mapper_supported ()) + if (!VasEBoot_device_mapper_supported ()) return 0; if (stat (dev, &st) < 0) return 0; -#if GRUB_DISK_DEVS_ARE_CHAR +#if VasEBoot_DISK_DEVS_ARE_CHAR if (! S_ISCHR (st.st_mode)) #else if (! S_ISBLK (st.st_mode)) @@ -88,16 +88,16 @@ grub_util_device_is_mapped (const char *dev) } int -grub_util_device_is_mapped_stat (struct stat *st) +VasEBoot_util_device_is_mapped_stat (struct stat *st) { -#if GRUB_DISK_DEVS_ARE_CHAR +#if VasEBoot_DISK_DEVS_ARE_CHAR if (! S_ISCHR (st->st_mode)) #else if (! S_ISBLK (st->st_mode)) #endif return 0; - if (!grub_device_mapper_supported ()) + if (!VasEBoot_device_mapper_supported ()) return 0; return dm_is_dm_major (major (st->st_rdev)); @@ -105,9 +105,9 @@ grub_util_device_is_mapped_stat (struct stat *st) int -grub_util_get_dm_node_linear_info (dev_t dev, +VasEBoot_util_get_dm_node_linear_info (dev_t dev, int *maj, int *min, - grub_disk_addr_t *st) + VasEBoot_disk_addr_t *st) { struct dm_task *dmt; void *next = NULL; @@ -116,7 +116,7 @@ grub_util_get_dm_node_linear_info (dev_t dev, char *ptr; int major = 0, minor = 0; int first = 1; - grub_disk_addr_t partstart = 0; + VasEBoot_disk_addr_t partstart = 0; const char *node_uuid; major = major (dev); @@ -149,16 +149,16 @@ grub_util_get_dm_node_linear_info (dev_t dev, next = dm_get_next_target(dmt, next, &start, &length, &target, ¶ms); - if (grub_strcmp (target, "linear") != 0) + if (VasEBoot_strcmp (target, "linear") != 0) { dm_task_destroy (dmt); break; } - major = grub_strtoul (params, &ptr, 10); - if (grub_errno) + major = VasEBoot_strtoul (params, &ptr, 10); + if (VasEBoot_errno) { dm_task_destroy (dmt); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } if (*ptr != ':') @@ -167,10 +167,10 @@ grub_util_get_dm_node_linear_info (dev_t dev, return 0; } ptr++; - minor = grub_strtoul (ptr, &ptr, 10); - if (grub_errno) + minor = VasEBoot_strtoul (ptr, &ptr, 10); + if (VasEBoot_errno) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; dm_task_destroy (dmt); return 0; } @@ -181,10 +181,10 @@ grub_util_get_dm_node_linear_info (dev_t dev, return 0; } ptr++; - partstart += grub_strtoull (ptr, &ptr, 10); - if (grub_errno) + partstart += VasEBoot_strtoull (ptr, &ptr, 10); + if (VasEBoot_errno) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; dm_task_destroy (dmt); return 0; } @@ -207,22 +207,22 @@ grub_util_get_dm_node_linear_info (dev_t dev, #else int -grub_util_device_is_mapped (const char *dev __attribute__ ((unused))) +VasEBoot_util_device_is_mapped (const char *dev __attribute__ ((unused))) { return 0; } int -grub_util_get_dm_node_linear_info (dev_t dev __attribute__ ((unused)), +VasEBoot_util_get_dm_node_linear_info (dev_t dev __attribute__ ((unused)), int *maj __attribute__ ((unused)), int *min __attribute__ ((unused)), - grub_disk_addr_t *st __attribute__ ((unused))) + VasEBoot_disk_addr_t *st __attribute__ ((unused))) { return 0; } int -grub_util_device_is_mapped_stat (struct stat *st __attribute__ ((unused))) +VasEBoot_util_device_is_mapped_stat (struct stat *st __attribute__ ((unused))) { return 0; } diff --git a/VasEBoot-core/osdep/freebsd/getroot.c b/VasEBoot-core/osdep/freebsd/getroot.c index ccc1d7028..52ded27b9 100644 --- a/VasEBoot-core/osdep/freebsd/getroot.c +++ b/VasEBoot-core/osdep/freebsd/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,7 +35,7 @@ #include #endif -#include +#include # include # include # include /* DIOCGMEDIASIZE */ @@ -43,14 +43,14 @@ # include #include -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -59,7 +59,7 @@ #define LVM_DEV_MAPPER_STRING "/dev/linux_lvm/" static const char * -grub_util_get_geom_abstraction (const char *dev) +VasEBoot_util_get_geom_abstraction (const char *dev) { char *whole; struct gmesh mesh; @@ -70,16 +70,16 @@ grub_util_get_geom_abstraction (const char *dev) if (strncmp (dev, "/dev/", sizeof ("/dev/") - 1) != 0) return 0; name = dev + sizeof ("/dev/") - 1; - grub_util_follow_gpart_up (name, NULL, &whole); + VasEBoot_util_follow_gpart_up (name, NULL, &whole); - grub_util_info ("following geom '%s'", name); + VasEBoot_util_info ("following geom '%s'", name); err = geom_gettree (&mesh); if (err != 0) /* TRANSLATORS: geom is the name of (k)FreeBSD device framework. Usually left untranslated. */ - grub_util_error ("%s", _("couldn't open geom")); + VasEBoot_util_error ("%s", _("couldn't open geom")); LIST_FOREACH (class, &mesh.lg_class, lg_class) { @@ -95,23 +95,23 @@ grub_util_get_geom_abstraction (const char *dev) return NULL; } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev) { const char *abstrac; - abstrac = grub_util_get_geom_abstraction (os_dev); - grub_util_info ("abstraction of %s is %s", os_dev, abstrac); - if (abstrac && grub_strcasecmp (abstrac, "eli") == 0) - return GRUB_DEV_ABSTRACTION_GELI; + abstrac = VasEBoot_util_get_geom_abstraction (os_dev); + VasEBoot_util_info ("abstraction of %s is %s", os_dev, abstrac); + if (abstrac && VasEBoot_strcasecmp (abstrac, "eli") == 0) + return VasEBoot_DEV_ABSTRACTION_GELI; /* Check for LVM. */ if (!strncmp (os_dev, LVM_DEV_MAPPER_STRING, sizeof(LVM_DEV_MAPPER_STRING)-1)) - return GRUB_DEV_ABSTRACTION_LVM; - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_LVM; + return VasEBoot_DEV_ABSTRACTION_NONE; } char * -grub_util_part_to_disk (const char *os_dev, struct stat *st, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part) { char *out, *out2; @@ -124,9 +124,9 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, if (strncmp (os_dev, "/dev/", sizeof ("/dev/") - 1) != 0) return xstrdup (os_dev); - grub_util_follow_gpart_up (os_dev + sizeof ("/dev/") - 1, NULL, &out); + VasEBoot_util_follow_gpart_up (os_dev + sizeof ("/dev/") - 1, NULL, &out); - if (grub_strcmp (os_dev + sizeof ("/dev/") - 1, out) != 0) + if (VasEBoot_strcmp (os_dev + sizeof ("/dev/") - 1, out) != 0) *is_part = 1; out2 = xasprintf ("/dev/%s", out); free (out); @@ -135,12 +135,12 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, } int -grub_util_pull_device_os (const char *os_dev, - enum grub_dev_abstraction_types ab) +VasEBoot_util_pull_device_os (const char *os_dev, + enum VasEBoot_dev_abstraction_types ab) { switch (ab) { - case GRUB_DEV_ABSTRACTION_GELI: + case VasEBoot_DEV_ABSTRACTION_GELI: { char *whole; struct gmesh mesh; @@ -152,16 +152,16 @@ grub_util_pull_device_os (const char *os_dev, if (strncmp (os_dev, "/dev/", sizeof ("/dev/") - 1) != 0) return 1; name = os_dev + sizeof ("/dev/") - 1; - grub_util_follow_gpart_up (name, NULL, &whole); + VasEBoot_util_follow_gpart_up (name, NULL, &whole); - grub_util_info ("following geom '%s'", name); + VasEBoot_util_info ("following geom '%s'", name); err = geom_gettree (&mesh); if (err != 0) /* TRANSLATORS: geom is the name of (k)FreeBSD device framework. Usually left untranslated. */ - grub_util_error ("%s", _("couldn't open geom")); + VasEBoot_util_error ("%s", _("couldn't open geom")); LIST_FOREACH (class, &mesh.lg_class, lg_class) { @@ -178,32 +178,32 @@ grub_util_pull_device_os (const char *os_dev, LIST_FOREACH (consumer, &geom->lg_consumer, lg_consumer) break; if (!consumer) - grub_util_error ("%s", + VasEBoot_util_error ("%s", _("couldn't find geli consumer")); fname = xasprintf ("/dev/%s", consumer->lg_provider->lg_name); - grub_util_info ("consumer %s", consumer->lg_provider->lg_name); + VasEBoot_util_info ("consumer %s", consumer->lg_provider->lg_name); lastsubdev = consumer->lg_provider->lg_name; - grub_util_pull_device (fname); + VasEBoot_util_pull_device (fname); free (fname); } } } - if (ab == GRUB_DEV_ABSTRACTION_GELI && lastsubdev) + if (ab == VasEBoot_DEV_ABSTRACTION_GELI && lastsubdev) { char *fname = xasprintf ("/dev/%s", lastsubdev); - char *grdev = grub_util_get_grub_dev (fname); + char *grdev = VasEBoot_util_get_VasEBoot_dev (fname); free (fname); if (grdev) { - grub_err_t gr_err; - gr_err = grub_cryptodisk_cheat_mount (grdev, os_dev); + VasEBoot_err_t gr_err; + gr_err = VasEBoot_cryptodisk_cheat_mount (grdev, os_dev); if (gr_err) - grub_util_error (_("can't mount encrypted volume `%s': %s"), - lastsubdev, grub_errmsg); + VasEBoot_util_error (_("can't mount encrypted volume `%s': %s"), + lastsubdev, VasEBoot_errmsg); } - grub_free (grdev); + VasEBoot_free (grdev); } } return 1; @@ -213,29 +213,29 @@ grub_util_pull_device_os (const char *os_dev, } char * -grub_util_get_grub_dev_os (const char *os_dev) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev) { - char *grub_dev = NULL; + char *VasEBoot_dev = NULL; - switch (grub_util_get_dev_abstraction (os_dev)) + switch (VasEBoot_util_get_dev_abstraction (os_dev)) { /* Fallback for non-devmapper build. In devmapper-builds LVM is handled - in rub_util_get_devmapper_grub_dev and this point isn't reached. + in rub_util_get_devmapper_VasEBoot_dev and this point isn't reached. */ - case GRUB_DEV_ABSTRACTION_LVM: + case VasEBoot_DEV_ABSTRACTION_LVM: { unsigned short len; - grub_size_t offset = sizeof (LVM_DEV_MAPPER_STRING) - 1; + VasEBoot_size_t offset = sizeof (LVM_DEV_MAPPER_STRING) - 1; len = strlen (os_dev) - offset + 1; - grub_dev = xmalloc (len + sizeof ("lvm/")); + VasEBoot_dev = xmalloc (len + sizeof ("lvm/")); - grub_memcpy (grub_dev, "lvm/", sizeof ("lvm/") - 1); - grub_memcpy (grub_dev + sizeof ("lvm/") - 1, os_dev + offset, len); + VasEBoot_memcpy (VasEBoot_dev, "lvm/", sizeof ("lvm/") - 1); + VasEBoot_memcpy (VasEBoot_dev + sizeof ("lvm/") - 1, os_dev + offset, len); } break; - case GRUB_DEV_ABSTRACTION_GELI: + case VasEBoot_DEV_ABSTRACTION_GELI: { char *whole; struct gmesh mesh; @@ -246,16 +246,16 @@ grub_util_get_grub_dev_os (const char *os_dev) if (strncmp (os_dev, "/dev/", sizeof ("/dev/") - 1) != 0) return 0; name = os_dev + sizeof ("/dev/") - 1; - grub_util_follow_gpart_up (name, NULL, &whole); + VasEBoot_util_follow_gpart_up (name, NULL, &whole); - grub_util_info ("following geom '%s'", name); + VasEBoot_util_info ("following geom '%s'", name); err = geom_gettree (&mesh); if (err != 0) /* TRANSLATORS: geom is the name of (k)FreeBSD device framework. Usually left untranslated. */ - grub_util_error ("%s", _("couldn't open geom")); + VasEBoot_util_error ("%s", _("couldn't open geom")); LIST_FOREACH (class, &mesh.lg_class, lg_class) { @@ -273,14 +273,14 @@ grub_util_get_grub_dev_os (const char *os_dev) LIST_FOREACH (consumer, &geom->lg_consumer, lg_consumer) break; if (!consumer) - grub_util_error ("%s", + VasEBoot_util_error ("%s", _("couldn't find geli consumer")); fname = xasprintf ("/dev/%s", consumer->lg_provider->lg_name); - uuid = grub_util_get_geli_uuid (fname); + uuid = VasEBoot_util_get_geli_uuid (fname); if (!uuid) - grub_util_error ("%s", + VasEBoot_util_error ("%s", _("couldn't retrieve geli UUID")); - grub_dev = xasprintf ("cryptouuid/%s", uuid); + VasEBoot_dev = xasprintf ("cryptouuid/%s", uuid); free (fname); free (uuid); } @@ -293,27 +293,27 @@ grub_util_get_grub_dev_os (const char *os_dev) break; } - return grub_dev; + return VasEBoot_dev; } /* FIXME: geom actually gives us the whole container hierarchy. It can be used more efficiently than this. */ void -grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, char **name_out) +VasEBoot_util_follow_gpart_up (const char *name, VasEBoot_disk_addr_t *off_out, char **name_out) { struct gmesh mesh; struct gclass *class; int err; struct ggeom *geom; - grub_util_info ("following geom '%s'", name); + VasEBoot_util_info ("following geom '%s'", name); err = geom_gettree (&mesh); if (err != 0) /* TRANSLATORS: geom is the name of (k)FreeBSD device framework. Usually left untranslated. */ - grub_util_error ("%s", _("couldn't open geom")); + VasEBoot_util_error ("%s", _("couldn't open geom")); LIST_FOREACH (class, &mesh.lg_class, lg_class) if (strcasecmp (class->lg_name, "part") == 0) @@ -322,7 +322,7 @@ grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, char **n /* TRANSLATORS: geom is the name of (k)FreeBSD device framework. Usually left untranslated. "part" is the identifier of one of its classes. */ - grub_util_error ("%s", _("couldn't find geom `part' class")); + VasEBoot_util_error ("%s", _("couldn't find geom `part' class")); LIST_FOREACH (geom, &class->lg_geom, lg_geom) { @@ -331,11 +331,11 @@ grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, char **n if (strcmp (provider->lg_name, name) == 0) { char *name_tmp = xstrdup (geom->lg_name); - grub_disk_addr_t off = 0; + VasEBoot_disk_addr_t off = 0; struct gconfig *config; - grub_util_info ("geom '%s' has parent '%s'", name, geom->lg_name); + VasEBoot_util_info ("geom '%s' has parent '%s'", name, geom->lg_name); - grub_util_follow_gpart_up (name_tmp, &off, name_out); + VasEBoot_util_follow_gpart_up (name_tmp, &off, name_out); free (name_tmp); LIST_FOREACH (config, &provider->lg_config, lg_config) if (strcasecmp (config->lg_name, "start") == 0) @@ -345,20 +345,20 @@ grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, char **n return; } } - grub_util_info ("geom '%s' has no parent", name); + VasEBoot_util_info ("geom '%s' has no parent", name); if (name_out) *name_out = xstrdup (name); if (off_out) *off_out = 0; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { - grub_disk_addr_t out; + VasEBoot_disk_addr_t out; if (strncmp (dev, "/dev/", sizeof ("/dev/") - 1) != 0) return 0; - grub_util_follow_gpart_up (dev + sizeof ("/dev/") - 1, &out, NULL); + VasEBoot_util_follow_gpart_up (dev + sizeof ("/dev/") - 1, &out, NULL); return out; } diff --git a/VasEBoot-core/osdep/freebsd/hostdisk.c b/VasEBoot-core/osdep/freebsd/hostdisk.c index 6145d0735..4be4df9a9 100644 --- a/VasEBoot-core/osdep/freebsd/hostdisk.c +++ b/VasEBoot-core/osdep/freebsd/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,8 +48,8 @@ # include # include -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { unsigned long long nr; unsigned sector_size, log_sector_size; @@ -69,20 +69,20 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec *log_secsize = log_sector_size; if (nr & (sector_size - 1)) - grub_util_error ("%s", _("unaligned device size")); + VasEBoot_util_error ("%s", _("unaligned device size")); return nr; } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } -grub_util_fd_t -grub_util_fd_open (const char *os_dev, int flags) +VasEBoot_util_fd_t +VasEBoot_util_fd_open (const char *os_dev, int flags) { - grub_util_fd_t ret; + VasEBoot_util_fd_t ret; int sysctl_flags, sysctl_oldflags; size_t sysctl_size = sizeof (sysctl_flags); @@ -95,8 +95,8 @@ grub_util_fd_open (const char *os_dev, int flags) if (sysctlbyname ("kern.geom.debugflags", &sysctl_oldflags, &sysctl_size, NULL, 0)) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot get current flags of sysctl kern.geom.debugflags"); - return GRUB_UTIL_FD_INVALID; + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot get current flags of sysctl kern.geom.debugflags"); + return VasEBoot_UTIL_FD_INVALID; } sysctl_flags = sysctl_oldflags | 0x10; if (! (sysctl_oldflags & 0x10) @@ -109,8 +109,8 @@ grub_util_fd_open (const char *os_dev, int flags) sysctl_oldflags = 0x10; else { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot set flags of sysctl kern.geom.debugflags"); - return GRUB_UTIL_FD_INVALID; + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot set flags of sysctl kern.geom.debugflags"); + return VasEBoot_UTIL_FD_INVALID; } } @@ -119,9 +119,9 @@ grub_util_fd_open (const char *os_dev, int flags) if (! (sysctl_oldflags & 0x10) && sysctlbyname ("kern.geom.debugflags", NULL , 0, &sysctl_oldflags, sysctl_size)) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot set flags back to the old value for sysctl kern.geom.debugflags"); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot set flags back to the old value for sysctl kern.geom.debugflags"); close (ret); - return GRUB_UTIL_FD_INVALID; + return VasEBoot_UTIL_FD_INVALID; } return ret; diff --git a/VasEBoot-core/osdep/generic/blocklist.c b/VasEBoot-core/osdep/generic/blocklist.c index 74024fd06..a2db713f3 100644 --- a/VasEBoot-core/osdep/generic/blocklist.c +++ b/VasEBoot-core/osdep/generic/blocklist.c @@ -1,40 +1,40 @@ -/* grub-setup.c - make GRUB usable */ +/* VasEBoot-setup.c - make VasEBoot usable */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #define MAX_TRIES 5 void -grub_install_get_blocklist (grub_device_t root_dev, +VasEBoot_install_get_blocklist (VasEBoot_device_t root_dev, const char *core_path, const char *core_img, size_t core_size, - void (*callback) (grub_disk_addr_t sector, + void (*callback) (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data), @@ -44,31 +44,31 @@ grub_install_get_blocklist (grub_device_t root_dev, char *tmp_img; char *core_path_dev; - core_path_dev = grub_make_system_path_relative_to_its_root (core_path); + core_path_dev = VasEBoot_make_system_path_relative_to_its_root (core_path); - /* Make sure that GRUB reads the identical image as the OS. */ + /* Make sure that VasEBoot reads the identical image as the OS. */ tmp_img = xmalloc (core_size); for (i = 0; i < MAX_TRIES; i++) { - grub_file_t file; + VasEBoot_file_t file; - grub_util_info ((i == 0) ? _("attempting to read the core image `%s' from GRUB") - : _("attempting to read the core image `%s' from GRUB again"), + VasEBoot_util_info ((i == 0) ? _("attempting to read the core image `%s' from VasEBoot") + : _("attempting to read the core image `%s' from VasEBoot again"), core_path_dev); - grub_disk_cache_invalidate_all (); + VasEBoot_disk_cache_invalidate_all (); - grub_file_filter_disable_compression (); - file = grub_file_open (core_path_dev); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (core_path_dev); if (file) { - if (grub_file_size (file) != core_size) - grub_util_info ("succeeded in opening the core image but the size is different (%d != %d)", - (int) grub_file_size (file), (int) core_size); - else if (grub_file_read (file, tmp_img, core_size) - != (grub_ssize_t) core_size) - grub_util_info ("succeeded in opening the core image but cannot read %d bytes", + if (VasEBoot_file_size (file) != core_size) + VasEBoot_util_info ("succeeded in opening the core image but the size is different (%d != %d)", + (int) VasEBoot_file_size (file), (int) core_size); + else if (VasEBoot_file_read (file, tmp_img, core_size) + != (VasEBoot_ssize_t) core_size) + VasEBoot_util_info ("succeeded in opening the core image but cannot read %d bytes", (int) core_size); else if (memcmp (core_img, tmp_img, core_size) != 0) { @@ -91,43 +91,43 @@ grub_install_get_blocklist (grub_device_t root_dev, } #endif - grub_util_info ("succeeded in opening the core image but the data is different"); + VasEBoot_util_info ("succeeded in opening the core image but the data is different"); } else { - grub_file_close (file); + VasEBoot_file_close (file); break; } - grub_file_close (file); + VasEBoot_file_close (file); } else - grub_util_info ("couldn't open the core image"); + VasEBoot_util_info ("couldn't open the core image"); - if (grub_errno) - grub_util_info ("error message = %s", grub_errmsg); + if (VasEBoot_errno) + VasEBoot_util_info ("error message = %s", VasEBoot_errmsg); - grub_errno = GRUB_ERR_NONE; - grub_util_biosdisk_flush (root_dev->disk); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_util_biosdisk_flush (root_dev->disk); sleep (1); } if (i == MAX_TRIES) - grub_util_error (_("cannot read `%s' correctly"), core_path_dev); + VasEBoot_util_error (_("cannot read `%s' correctly"), core_path_dev); - grub_file_t file; + VasEBoot_file_t file; /* Now read the core image to determine where the sectors are. */ - grub_file_filter_disable_compression (); - file = grub_file_open (core_path_dev); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (core_path_dev); if (! file) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); file->read_hook = callback; file->read_hook_data = hook_data; - if (grub_file_read (file, tmp_img, core_size) != (grub_ssize_t) core_size) - grub_util_error ("%s", _("failed to read the sectors of the core image")); + if (VasEBoot_file_read (file, tmp_img, core_size) != (VasEBoot_ssize_t) core_size) + VasEBoot_util_error ("%s", _("failed to read the sectors of the core image")); - grub_file_close (file); + VasEBoot_file_close (file); free (tmp_img); free (core_path_dev); diff --git a/VasEBoot-core/osdep/haiku/getroot.c b/VasEBoot-core/osdep/haiku/getroot.c index 4e123c090..2c3b0ff92 100644 --- a/VasEBoot-core/osdep/haiku/getroot.c +++ b/VasEBoot-core/osdep/haiku/getroot.c @@ -5,34 +5,34 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } char ** -grub_guess_root_devices (const char *dir_in) +VasEBoot_guess_root_devices (const char *dir_in) { dev_t dv = dev_for_path (dir_in); fs_info inf; @@ -45,11 +45,11 @@ grub_guess_root_devices (const char *dir_in) return ret; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { partition_info part; - grub_disk_addr_t ret; + VasEBoot_disk_addr_t ret; int fd = open (dev, O_RDONLY); if (fd < 0) return 0; @@ -71,7 +71,7 @@ grub_util_find_partition_start_os (const char *dev) } char * -grub_util_part_to_disk (const char *os_dev, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st __attribute__ ((unused)), int *is_part) { @@ -94,11 +94,11 @@ grub_util_part_to_disk (const char *os_dev, } int -grub_util_biosdisk_is_floppy (grub_disk_t disk) +VasEBoot_util_biosdisk_is_floppy (VasEBoot_disk_t disk) { const char *dname; - dname = grub_util_biosdisk_get_osdev (disk); + dname = VasEBoot_util_biosdisk_get_osdev (disk); return (strncmp (dname, "/dev/disk/floppy/", sizeof ("/dev/disk/floppy/") - 1) == 0); diff --git a/VasEBoot-core/osdep/haiku/hostdisk.c b/VasEBoot-core/osdep/haiku/hostdisk.c index 562353956..e2abf1376 100644 --- a/VasEBoot-core/osdep/haiku/hostdisk.c +++ b/VasEBoot-core/osdep/haiku/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -45,8 +45,8 @@ #include #include -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name __attribute__ ((unused)), unsigned *log_secsize) { @@ -57,13 +57,13 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, for (lg = 0; (1 << lg) < part.bytes_per_sector; lg++); if (log_secsize) *log_secsize= lg; - return ((grub_uint64_t) part.cylinder_count - * (grub_uint64_t) part.head_count - * (grub_uint64_t) part.sectors_per_track - * (grub_uint64_t) part.bytes_per_sector); + return ((VasEBoot_uint64_t) part.cylinder_count + * (VasEBoot_uint64_t) part.head_count + * (VasEBoot_uint64_t) part.sectors_per_track + * (VasEBoot_uint64_t) part.bytes_per_sector); } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/hurd/getroot.c b/VasEBoot-core/osdep/hurd/getroot.c index c66b206fa..e4b376d86 100644 --- a/VasEBoot-core/osdep/hurd/getroot.c +++ b/VasEBoot-core/osdep/hurd/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,15 +35,15 @@ #include #endif -#include +#include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -53,7 +53,7 @@ #include static char * -grub_util_find_hurd_root_device (const char *path) +VasEBoot_util_find_hurd_root_device (const char *path) { file_t file; error_t err; @@ -65,7 +65,7 @@ grub_util_find_hurd_root_device (const char *path) if (file == MACH_PORT_NULL) /* TRANSLATORS: The first %s is the file being looked at, the second %s is the error message. */ - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); /* This returns catenated 0-terminated strings. */ err = file_get_fs_options (file, &argz, &argz_len); @@ -76,10 +76,10 @@ grub_util_find_hurd_root_device (const char *path) we are fetching the "translator" command line), second %s is the error message. */ - grub_util_error (_("cannot get translator command line " + VasEBoot_util_error (_("cannot get translator command line " "for path `%s': %s"), path, strerror(err)); if (argz_len == 0) - grub_util_error (_("translator command line is empty for path `%s'"), path); + VasEBoot_util_error (_("translator command line is empty for path `%s'"), path); /* Make sure the string is terminated. */ argz[argz_len-1] = 0; @@ -95,7 +95,7 @@ grub_util_find_hurd_root_device (const char *path) /* TRANSLATORS: we expect to get something like /hurd/foobar --option1 --option2=baz /dev/something */ - grub_util_error (_("translator `%s' for path `%s' has several " + VasEBoot_util_error (_("translator `%s' for path `%s' has several " "non-option words, at least `%s' and `%s'"), argz, path, name, argz + i); name = argz + i; @@ -106,7 +106,7 @@ grub_util_find_hurd_root_device (const char *path) /* TRANSLATORS: we expect to get something like /hurd/foobar --option1 --option2=baz /dev/something */ - grub_util_error (_("translator `%s' for path `%s' is given only options, " + VasEBoot_util_error (_("translator `%s' for path `%s' is given only options, " "cannot find device part"), argz, path); if (strncmp (name, "device:", sizeof ("device:") - 1) == 0) @@ -142,12 +142,12 @@ is_fulldisk (const char *child, const char *parent) } char * -grub_util_part_to_disk (const char *os_dev, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part) { char *path; - grub_disk_addr_t offset; + VasEBoot_disk_addr_t offset; char *p; if (! S_ISBLK (st->st_mode)) @@ -156,7 +156,7 @@ grub_util_part_to_disk (const char *os_dev, return xstrdup (os_dev); } - if (!grub_util_hurd_get_disk_info (os_dev, NULL, &offset, NULL, &path)) + if (!VasEBoot_util_hurd_get_disk_info (os_dev, NULL, &offset, NULL, &path)) return xstrdup (os_dev); /* Some versions of Hurd use badly glued Linux code to handle partitions @@ -187,32 +187,32 @@ grub_util_part_to_disk (const char *os_dev, return path; } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { - grub_uint32_t secsize; - grub_disk_addr_t offset; + VasEBoot_uint32_t secsize; + VasEBoot_disk_addr_t offset; char *path; - if (!grub_util_hurd_get_disk_info (dev, &secsize, &offset, NULL, &path)) + if (!VasEBoot_util_hurd_get_disk_info (dev, &secsize, &offset, NULL, &path)) return 0; if (path && !(offset == 0 && is_fulldisk (path, dev) && (strncmp ("/dev/sd", dev, 7) == 0 @@ -226,14 +226,14 @@ grub_util_find_partition_start_os (const char *dev) } char ** -grub_guess_root_devices (const char *dir) +VasEBoot_guess_root_devices (const char *dir) { char **os_dev = NULL; os_dev = xmalloc (2 * sizeof (os_dev[0])); /* GNU/Hurd specific function. */ - os_dev[0] = grub_util_find_hurd_root_device (dir); + os_dev[0] = VasEBoot_util_find_hurd_root_device (dir); if (!os_dev[0]) { diff --git a/VasEBoot-core/osdep/hurd/hostdisk.c b/VasEBoot-core/osdep/hurd/hostdisk.c index c47b5a5ea..87c061773 100644 --- a/VasEBoot-core/osdep/hurd/hostdisk.c +++ b/VasEBoot-core/osdep/hurd/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,8 +48,8 @@ #include int -grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk_addr_t *offset, - grub_disk_addr_t *size, char **parent) +VasEBoot_util_hurd_get_disk_info (const char *dev, VasEBoot_uint32_t *secsize, VasEBoot_disk_addr_t *offset, + VasEBoot_disk_addr_t *size, char **parent) { file_t file; mach_port_t *ports; @@ -70,12 +70,12 @@ grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk &data, &data_len); if (num_ints < 1) - grub_util_error (_("Storage information for `%s' does not include type"), dev); + VasEBoot_util_error (_("Storage information for `%s' does not include type"), dev); if (ints[0] != STORAGE_DEVICE) - grub_util_error (_("`%s' is not a local disk"), dev); + VasEBoot_util_error (_("`%s' is not a local disk"), dev); if (num_offsets != 2) - grub_util_error (_("Storage information for `%s' indicates neither a plain partition nor a plain disk"), dev); + VasEBoot_util_error (_("Storage information for `%s' indicates neither a plain partition nor a plain disk"), dev); if (parent) { *parent = NULL; @@ -118,14 +118,14 @@ grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk return 1; } -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { - grub_uint32_t sector_size; - grub_disk_addr_t size; + VasEBoot_uint32_t sector_size; + VasEBoot_disk_addr_t size; unsigned log_sector_size; - if (!grub_util_hurd_get_disk_info (name, §or_size, NULL, &size, NULL)) + if (!VasEBoot_util_hurd_get_disk_info (name, §or_size, NULL, &size, NULL)) return -1; if (sector_size & (sector_size - 1) || !sector_size) @@ -141,6 +141,6 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/linux/blocklist.c b/VasEBoot-core/osdep/linux/blocklist.c index c77d6085c..215ba6624 100644 --- a/VasEBoot-core/osdep/linux/blocklist.c +++ b/VasEBoot-core/osdep/linux/blocklist.c @@ -1,20 +1,20 @@ -/* grub-setup.c - make GRUB usable */ +/* VasEBoot-setup.c - make VasEBoot usable */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -32,10 +32,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -43,29 +43,29 @@ #include void -grub_install_get_blocklist (grub_device_t root_dev, +VasEBoot_install_get_blocklist (VasEBoot_device_t root_dev, const char *core_path, const char *core_img __attribute__ ((unused)), size_t core_size, - void (*callback) (grub_disk_addr_t sector, + void (*callback) (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data), void *hook_data) { - grub_partition_t container = root_dev->disk->partition; - grub_uint64_t container_start = grub_partition_get_start (container); + VasEBoot_partition_t container = root_dev->disk->partition; + VasEBoot_uint64_t container_start = VasEBoot_partition_get_start (container); struct fiemap fie1; int fd; /* Write the first two sectors of the core image onto the disk. */ - grub_util_info ("opening the core image `%s'", core_path); + VasEBoot_util_info ("opening the core image `%s'", core_path); fd = open (core_path, O_RDONLY); if (fd < 0) - grub_util_error (_("cannot open `%s': %s"), core_path, + VasEBoot_util_error (_("cannot open `%s': %s"), core_path, strerror (errno)); - grub_memset (&fie1, 0, sizeof (fie1)); + VasEBoot_memset (&fie1, 0, sizeof (fie1)); fie1.fm_length = core_size; fie1.fm_flags = FIEMAP_FLAG_SYNC; @@ -75,33 +75,33 @@ grub_install_get_blocklist (grub_device_t root_dev, int bsize; int mul; - grub_util_info ("FIEMAP failed. Reverting to FIBMAP"); + VasEBoot_util_info ("FIEMAP failed. Reverting to FIBMAP"); if (ioctl (fd, FIGETBSZ, &bsize) < 0) - grub_util_error (_("can't retrieve blocklists: %s"), + VasEBoot_util_error (_("can't retrieve blocklists: %s"), strerror (errno)); - if (bsize & (GRUB_DISK_SECTOR_SIZE - 1)) - grub_util_error ("%s", _("blocksize is not divisible by 512")); + if (bsize & (VasEBoot_DISK_SECTOR_SIZE - 1)) + VasEBoot_util_error ("%s", _("blocksize is not divisible by 512")); if (!bsize) - grub_util_error ("%s", _("invalid zero blocksize")); - mul = bsize >> GRUB_DISK_SECTOR_BITS; + VasEBoot_util_error ("%s", _("invalid zero blocksize")); + mul = bsize >> VasEBoot_DISK_SECTOR_BITS; nblocks = (core_size + bsize - 1) / bsize; if (mul == 0 || nblocks == 0) - grub_util_error ("%s", _("can't retrieve blocklists")); + VasEBoot_util_error ("%s", _("can't retrieve blocklists")); for (i = 0; i < nblocks; i++) { unsigned blk = i; int rest; if (ioctl (fd, FIBMAP, &blk) < 0) - grub_util_error (_("can't retrieve blocklists: %s"), + VasEBoot_util_error (_("can't retrieve blocklists: %s"), strerror (errno)); - rest = core_size - ((i * mul) << GRUB_DISK_SECTOR_BITS); + rest = core_size - ((i * mul) << VasEBoot_DISK_SECTOR_BITS); if (rest <= 0) break; - if (rest > GRUB_DISK_SECTOR_SIZE * mul) - rest = GRUB_DISK_SECTOR_SIZE * mul; - callback (((grub_uint64_t) blk) * mul + if (rest > VasEBoot_DISK_SECTOR_SIZE * mul) + rest = VasEBoot_DISK_SECTOR_SIZE * mul; + callback (((VasEBoot_uint64_t) blk) * mul + container_start, 0, rest, hook_data); } @@ -119,15 +119,15 @@ grub_install_get_blocklist (grub_device_t root_dev, fie2->fm_flags = FIEMAP_FLAG_SYNC; fie2->fm_extent_count = fie1.fm_mapped_extents; if (ioctl (fd, FS_IOC_FIEMAP, fie2) < 0) - grub_util_error (_("can't retrieve blocklists: %s"), + VasEBoot_util_error (_("can't retrieve blocklists: %s"), strerror (errno)); for (i = 0; i < fie2->fm_mapped_extents; i++) { callback ((fie2->fm_extents[i].fe_physical - >> GRUB_DISK_SECTOR_BITS) + >> VasEBoot_DISK_SECTOR_BITS) + container_start, fie2->fm_extents[i].fe_physical - & (GRUB_DISK_SECTOR_SIZE - 1), + & (VasEBoot_DISK_SECTOR_SIZE - 1), fie2->fm_extents[i].fe_length, hook_data); } free (fie2); diff --git a/VasEBoot-core/osdep/linux/emunet.c b/VasEBoot-core/osdep/linux/emunet.c index 19b188f09..be8b79ca3 100644 --- a/VasEBoot-core/osdep/linux/emunet.c +++ b/VasEBoot-core/osdep/linux/emunet.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -28,24 +28,24 @@ #include #include -#include +#include static int fd; -grub_ssize_t -grub_emunet_send (const void *packet, grub_size_t sz) +VasEBoot_ssize_t +VasEBoot_emunet_send (const void *packet, VasEBoot_size_t sz) { return write (fd, packet, sz); } -grub_ssize_t -grub_emunet_receive (void *packet, grub_size_t sz) +VasEBoot_ssize_t +VasEBoot_emunet_receive (void *packet, VasEBoot_size_t sz) { return read (fd, packet, sz); } int -grub_emunet_create (grub_size_t *mtu) +VasEBoot_emunet_create (VasEBoot_size_t *mtu) { struct ifreq ifr; *mtu = 1500; @@ -64,7 +64,7 @@ grub_emunet_create (grub_size_t *mtu) } void -grub_emunet_close (void) +VasEBoot_emunet_close (void) { if (fd < 0) return; diff --git a/VasEBoot-core/osdep/linux/getroot.c b/VasEBoot-core/osdep/linux/getroot.c index 90d92d3ad..e5931230c 100644 --- a/VasEBoot-core/osdep/linux/getroot.c +++ b/VasEBoot-core/osdep/linux/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -41,17 +41,17 @@ #include #endif -#include +#include #include /* ioctl */ #include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -59,9 +59,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define LVM_DEV_MAPPER_STRING "/dev/mapper/" @@ -69,48 +69,48 @@ struct btrfs_ioctl_dev_info_args { - grub_uint64_t devid; - grub_uint8_t uuid[16]; - grub_uint64_t bytes_used; - grub_uint64_t total_bytes; - grub_uint64_t unused[379]; - grub_uint8_t path[1024]; + VasEBoot_uint64_t devid; + VasEBoot_uint8_t uuid[16]; + VasEBoot_uint64_t bytes_used; + VasEBoot_uint64_t total_bytes; + VasEBoot_uint64_t unused[379]; + VasEBoot_uint8_t path[1024]; }; struct btrfs_ioctl_fs_info_args { - grub_uint64_t max_id; - grub_uint64_t num_devices; - grub_uint8_t fsid[16]; - grub_uint64_t reserved[124]; + VasEBoot_uint64_t max_id; + VasEBoot_uint64_t num_devices; + VasEBoot_uint8_t fsid[16]; + VasEBoot_uint64_t reserved[124]; }; struct btrfs_ioctl_ino_lookup_args { - grub_uint64_t treeid; - grub_uint64_t objectid; + VasEBoot_uint64_t treeid; + VasEBoot_uint64_t objectid; char name[4080]; }; struct btrfs_ioctl_search_key { - grub_uint64_t tree_id; - grub_uint64_t min_objectid; - grub_uint64_t max_objectid; - grub_uint64_t min_offset; - grub_uint64_t max_offset; - grub_uint64_t min_transid; - grub_uint64_t max_transid; - grub_uint32_t min_type; - grub_uint32_t max_type; - grub_uint32_t nr_items; - grub_uint32_t unused[9]; + VasEBoot_uint64_t tree_id; + VasEBoot_uint64_t min_objectid; + VasEBoot_uint64_t max_objectid; + VasEBoot_uint64_t min_offset; + VasEBoot_uint64_t max_offset; + VasEBoot_uint64_t min_transid; + VasEBoot_uint64_t max_transid; + VasEBoot_uint32_t min_type; + VasEBoot_uint32_t max_type; + VasEBoot_uint32_t nr_items; + VasEBoot_uint32_t unused[9]; }; struct btrfs_ioctl_search_args { struct btrfs_ioctl_search_key key; - grub_uint64_t buf[(4096 - sizeof(struct btrfs_ioctl_search_key)) - / sizeof (grub_uint64_t)]; + VasEBoot_uint64_t buf[(4096 - sizeof(struct btrfs_ioctl_search_key)) + / sizeof (VasEBoot_uint64_t)]; }; #define BTRFS_IOC_TREE_SEARCH _IOWR(0x94, 17, \ @@ -123,7 +123,7 @@ struct btrfs_ioctl_search_args { struct btrfs_ioctl_fs_info_args) static int -grub_util_is_imsm (const char *os_dev); +VasEBoot_util_is_imsm (const char *os_dev); #define ESCAPED_PATH_MAX (4 * PATH_MAX) @@ -136,7 +136,7 @@ struct mountinfo_entry }; static char ** -grub_util_raid_getmembers (const char *name, int bootable) +VasEBoot_util_raid_getmembers (const char *name, int bootable) { int fd, ret, i, j; char **devicelist; @@ -147,26 +147,26 @@ grub_util_raid_getmembers (const char *name, int bootable) fd = open (name, O_RDONLY); if (fd == -1) - grub_util_error (_("cannot open `%s': %s"), name, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), name, strerror (errno)); ret = ioctl (fd, RAID_VERSION, &version); if (ret != 0) - grub_util_error (_("ioctl RAID_VERSION error: %s"), strerror (errno)); + VasEBoot_util_error (_("ioctl RAID_VERSION error: %s"), strerror (errno)); if ((version.major != 0 || version.minor != 90) && (version.major != 1 || version.minor != 0) && (version.major != 1 || version.minor != 1) && (version.major != 1 || version.minor != 2)) - grub_util_error (_("unsupported RAID version: %d.%d"), + VasEBoot_util_error (_("unsupported RAID version: %d.%d"), version.major, version.minor); if (bootable && (version.major != 0 || version.minor != 90)) - grub_util_error (_("unsupported RAID version: %d.%d"), + VasEBoot_util_error (_("unsupported RAID version: %d.%d"), version.major, version.minor); ret = ioctl (fd, GET_ARRAY_INFO, &info); if (ret != 0) - grub_util_error (_("ioctl GET_ARRAY_INFO error: %s"), strerror (errno)); + VasEBoot_util_error (_("ioctl GET_ARRAY_INFO error: %s"), strerror (errno)); devicelist = xmalloc ((info.nr_disks + 1) * sizeof (char *)); @@ -175,13 +175,13 @@ grub_util_raid_getmembers (const char *name, int bootable) disk.number = i; ret = ioctl (fd, GET_DISK_INFO, &disk); if (ret != 0) - grub_util_error (_("ioctl GET_DISK_INFO error: %s"), strerror (errno)); + VasEBoot_util_error (_("ioctl GET_DISK_INFO error: %s"), strerror (errno)); if (disk.state & (1 << MD_DISK_REMOVED)) continue; if (disk.state & (1 << MD_DISK_ACTIVE)) - devicelist[j] = grub_find_device (NULL, + devicelist[j] = VasEBoot_find_device (NULL, makedev (disk.major, disk.minor)); else devicelist[j] = NULL; @@ -224,7 +224,7 @@ unescape (char *str) } static char ** -grub_find_root_devices_from_btrfs (const char *dir) +VasEBoot_find_root_devices_from_btrfs (const char *dir) { int fd; struct btrfs_ioctl_fs_info_args fsi; @@ -269,7 +269,7 @@ get_btrfs_fs_prefix (const char *mount_path) struct btrfs_ioctl_ino_lookup_args args; struct stat st; int fd; - grub_uint64_t tree_id, inode_id; + VasEBoot_uint64_t tree_id, inode_id; char *ret = NULL; fd = open (mount_path, O_RDONLY); @@ -277,7 +277,7 @@ get_btrfs_fs_prefix (const char *mount_path) if (fd < 0) return NULL; memset (&args, 0, sizeof(args)); - args.objectid = GRUB_BTRFS_TREE_ROOT_OBJECTID; + args.objectid = VasEBoot_BTRFS_TREE_ROOT_OBJECTID; if (ioctl (fd, BTRFS_IOC_INO_LOOKUP, &args) < 0) goto fail; @@ -287,8 +287,8 @@ get_btrfs_fs_prefix (const char *mount_path) goto fail; inode_id = st.st_ino; - while (tree_id != GRUB_BTRFS_ROOT_VOL_OBJECTID - || inode_id != GRUB_BTRFS_TREE_ROOT_OBJECTID) + while (tree_id != VasEBoot_BTRFS_ROOT_VOL_OBJECTID + || inode_id != VasEBoot_BTRFS_TREE_ROOT_OBJECTID) { const char *name; size_t namelen; @@ -297,9 +297,9 @@ get_btrfs_fs_prefix (const char *mount_path) memset (&sargs, 0, sizeof(sargs)); - if (inode_id == GRUB_BTRFS_TREE_ROOT_OBJECTID) + if (inode_id == VasEBoot_BTRFS_TREE_ROOT_OBJECTID) { - struct grub_btrfs_root_backref *br; + struct VasEBoot_btrfs_root_backref *br; sargs.key.tree_id = 1; sargs.key.min_objectid = tree_id; @@ -309,8 +309,8 @@ get_btrfs_fs_prefix (const char *mount_path) sargs.key.max_offset = ~0ULL; sargs.key.min_transid = 0; sargs.key.max_transid = ~0ULL; - sargs.key.min_type = GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF; - sargs.key.max_type = GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF; + sargs.key.min_type = VasEBoot_BTRFS_ITEM_TYPE_ROOT_BACKREF; + sargs.key.max_type = VasEBoot_BTRFS_ITEM_TYPE_ROOT_BACKREF; sargs.key.nr_items = 1; @@ -321,14 +321,14 @@ get_btrfs_fs_prefix (const char *mount_path) goto fail; tree_id = sargs.buf[2]; - br = (struct grub_btrfs_root_backref *) (sargs.buf + 4); - inode_id = grub_le_to_cpu64 (br->inode_id); + br = (struct VasEBoot_btrfs_root_backref *) (sargs.buf + 4); + inode_id = VasEBoot_le_to_cpu64 (br->inode_id); name = br->name; - namelen = grub_le_to_cpu16 (br->n); + namelen = VasEBoot_le_to_cpu16 (br->n); } else { - struct grub_btrfs_inode_ref *ir; + struct VasEBoot_btrfs_inode_ref *ir; sargs.key.tree_id = tree_id; sargs.key.min_objectid = inode_id; @@ -338,8 +338,8 @@ get_btrfs_fs_prefix (const char *mount_path) sargs.key.max_offset = ~0ULL; sargs.key.min_transid = 0; sargs.key.max_transid = ~0ULL; - sargs.key.min_type = GRUB_BTRFS_ITEM_TYPE_INODE_REF; - sargs.key.max_type = GRUB_BTRFS_ITEM_TYPE_INODE_REF; + sargs.key.min_type = VasEBoot_BTRFS_ITEM_TYPE_INODE_REF; + sargs.key.max_type = VasEBoot_BTRFS_ITEM_TYPE_INODE_REF; if (ioctl (fd, BTRFS_IOC_TREE_SEARCH, &sargs) < 0) goto fail; @@ -349,9 +349,9 @@ get_btrfs_fs_prefix (const char *mount_path) inode_id = sargs.buf[2]; - ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 4); + ir = (struct VasEBoot_btrfs_inode_ref *) (sargs.buf + 4); name = ir->name; - namelen = grub_le_to_cpu16 (ir->n); + namelen = VasEBoot_le_to_cpu16 (ir->n); } old = ret; ret = xmalloc (namelen + (old ? strlen (old) : 0) + 2); @@ -378,12 +378,12 @@ get_btrfs_fs_prefix (const char *mount_path) char ** -grub_find_root_devices_from_mountinfo (const char *dir, char **relroot) +VasEBoot_find_root_devices_from_mountinfo (const char *dir, char **relroot) { FILE *fp = NULL; char *buf = NULL; size_t len = 0; - grub_size_t entry_len, entry_max = 4; + VasEBoot_size_t entry_len, entry_max = 4; struct mountinfo_entry *entries; struct mountinfo_entry parent_entry = { 0, 0, 0, "", "", "", "" }; int i; @@ -399,7 +399,7 @@ grub_find_root_devices_from_mountinfo (const char *dir, char **relroot) entries = xmalloc (entry_max * sizeof (*entries)); again: - fp = grub_util_fopen ("/proc/self/mountinfo", "r"); + fp = VasEBoot_util_fopen ("/proc/self/mountinfo", "r"); if (! fp) goto out; /* fall through to other methods */ @@ -494,14 +494,14 @@ again: if (!*entries[i].device) continue; - if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 - || grub_strcmp (entries[i].fstype, "zfs") == 0) + if (VasEBoot_strcmp (entries[i].fstype, "fuse.zfs") == 0 + || VasEBoot_strcmp (entries[i].fstype, "zfs") == 0) { char *slash; slash = strchr (entries[i].device, '/'); if (slash) *slash = 0; - ret = grub_util_find_root_devices_from_poolname (entries[i].device); + ret = VasEBoot_util_find_root_devices_from_poolname (entries[i].device); if (slash) *slash = '/'; if (relroot) @@ -515,12 +515,12 @@ again: entries[i].enc_root); } } - else if (grub_strcmp (entries[i].fstype, "btrfs") == 0) + else if (VasEBoot_strcmp (entries[i].fstype, "btrfs") == 0) { - ret = grub_find_root_devices_from_btrfs (dir); + ret = VasEBoot_find_root_devices_from_btrfs (dir); fs_prefix = get_btrfs_fs_prefix (entries[i].enc_path); } - else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0) + else if (!retry && VasEBoot_strcmp (entries[i].fstype, "autofs") == 0) { /* If the best match is automounted, try to trigger mount. We cannot simply return here because stat() on automounted directory does not @@ -548,19 +548,19 @@ again: if (relroot) { char *ptr; - grub_size_t enc_root_len = strlen (fs_prefix); - grub_size_t enc_path_len = strlen (entries[i].enc_path); - grub_size_t dir_strlen = strlen (dir); + VasEBoot_size_t enc_root_len = strlen (fs_prefix); + VasEBoot_size_t enc_path_len = strlen (entries[i].enc_path); + VasEBoot_size_t dir_strlen = strlen (dir); *relroot = xmalloc (enc_root_len + 2 + dir_strlen); - ptr = grub_stpcpy (*relroot, fs_prefix); + ptr = VasEBoot_stpcpy (*relroot, fs_prefix); if (dir_strlen > enc_path_len) { while (ptr > *relroot && *(ptr - 1) == '/') ptr--; if (dir[enc_path_len] != '/') *ptr++ = '/'; - ptr = grub_stpcpy (ptr, dir + enc_path_len); + ptr = VasEBoot_stpcpy (ptr, dir + enc_path_len); } *ptr = 0; } @@ -596,7 +596,7 @@ get_mdadm_uuid (const char *os_dev) argv[3] = os_dev; argv[4] = NULL; - pid = grub_util_exec_pipe (argv, &fd); + pid = VasEBoot_util_exec_pipe (argv, &fd); if (!pid) return NULL; @@ -605,7 +605,7 @@ get_mdadm_uuid (const char *os_dev) mdadm = fdopen (fd, "r"); if (! mdadm) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "mdadm", strerror (errno)); goto out; } @@ -638,7 +638,7 @@ out: } static int -grub_util_is_imsm (const char *os_dev) +VasEBoot_util_is_imsm (const char *os_dev) { int retry; int is_imsm = 0; @@ -662,7 +662,7 @@ grub_util_is_imsm (const char *os_dev) argv[3] = dev; argv[4] = NULL; - pid = grub_util_exec_pipe (argv, &fd); + pid = VasEBoot_util_exec_pipe (argv, &fd); if (!pid) { @@ -675,7 +675,7 @@ grub_util_is_imsm (const char *os_dev) mdadm = fdopen (fd, "r"); if (! mdadm) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "mdadm", strerror (errno)); close (fd); waitpid (pid, NULL, 0); @@ -694,7 +694,7 @@ grub_util_is_imsm (const char *os_dev) ptr = newdev + strlen (newdev) - 1; for (; ptr >= newdev && (*ptr == '\n' || *ptr == '\r'); ptr--); ptr[1] = 0; - grub_util_info ("Container of %s is %s", dev, newdev); + VasEBoot_util_info ("Container of %s is %s", dev, newdev); dev = newdev; container_seen = retry = 1; break; @@ -703,7 +703,7 @@ grub_util_is_imsm (const char *os_dev) sizeof ("MD_METADATA=imsm") - 1) == 0) { is_imsm = 1; - grub_util_info ("%s is imsm", dev); + VasEBoot_util_info ("%s is imsm", dev); break; } } @@ -720,7 +720,7 @@ grub_util_is_imsm (const char *os_dev) } char * -grub_util_part_to_disk (const char *os_dev, struct stat *st, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part) { char *path; @@ -956,9 +956,9 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, } static char * -grub_util_get_raid_grub_dev (const char *os_dev) +VasEBoot_util_get_raid_VasEBoot_dev (const char *os_dev) { - char *grub_dev = NULL; + char *VasEBoot_dev = NULL; if (os_dev[7] == '_' && os_dev[8] == 'd') { /* This a partitionable RAID device of the form /dev/md_dNNpMM. */ @@ -971,7 +971,7 @@ grub_util_get_raid_grub_dev (const char *os_dev) if (q) *q = ','; - grub_dev = xasprintf ("md%s", p); + VasEBoot_dev = xasprintf ("md%s", p); free (p); } else if (os_dev[7] == '/' && os_dev[8] == 'd') @@ -986,7 +986,7 @@ grub_util_get_raid_grub_dev (const char *os_dev) if (q) *q = ','; - grub_dev = xasprintf ("md%s", p); + VasEBoot_dev = xasprintf ("md%s", p); free (p); } else if (os_dev[7] >= '0' && os_dev[7] <= '9') @@ -999,7 +999,7 @@ grub_util_get_raid_grub_dev (const char *os_dev) if (q) *q = ','; - grub_dev = xasprintf ("md%s", p); + VasEBoot_dev = xasprintf ("md%s", p); free (p); } else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9') @@ -1012,7 +1012,7 @@ grub_util_get_raid_grub_dev (const char *os_dev) if (q) *q = ','; - grub_dev = xasprintf ("md%s", p); + VasEBoot_dev = xasprintf ("md%s", p); free (p); } else if (os_dev[7] == '/') @@ -1026,11 +1026,11 @@ grub_util_get_raid_grub_dev (const char *os_dev) if (q) *q = ','; - grub_dev = xasprintf ("md/%s", p); + VasEBoot_dev = xasprintf ("md/%s", p); free (p); } else - grub_util_error (_("unknown kind of RAID device `%s'"), os_dev); + VasEBoot_util_error (_("unknown kind of RAID device `%s'"), os_dev); { char *mdadm_name = get_mdadm_uuid (os_dev); @@ -1040,52 +1040,52 @@ grub_util_get_raid_grub_dev (const char *os_dev) const char *q; for (q = os_dev + strlen (os_dev) - 1; q >= os_dev - && grub_isdigit (*q); q--); + && VasEBoot_isdigit (*q); q--); if (q >= os_dev && *q == 'p') { - free (grub_dev); - grub_dev = xasprintf ("mduuid/%s,%s", mdadm_name, q + 1); + free (VasEBoot_dev); + VasEBoot_dev = xasprintf ("mduuid/%s,%s", mdadm_name, q + 1); goto done; } - free (grub_dev); - grub_dev = xasprintf ("mduuid/%s", mdadm_name); + free (VasEBoot_dev); + VasEBoot_dev = xasprintf ("mduuid/%s", mdadm_name); done: free (mdadm_name); } } - return grub_dev; + return VasEBoot_dev; } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev) { #ifndef HAVE_DEVICE_MAPPER if ((strncmp ("/dev/mapper/", os_dev, 12) == 0)) - return GRUB_DEV_ABSTRACTION_LVM; + return VasEBoot_DEV_ABSTRACTION_LVM; #endif /* Check for RAID. */ - if (!strncmp (os_dev, "/dev/md", 7) && ! grub_util_device_is_mapped (os_dev) - && !grub_util_is_imsm (os_dev)) - return GRUB_DEV_ABSTRACTION_RAID; - return GRUB_DEV_ABSTRACTION_NONE; + if (!strncmp (os_dev, "/dev/md", 7) && ! VasEBoot_util_device_is_mapped (os_dev) + && !VasEBoot_util_is_imsm (os_dev)) + return VasEBoot_DEV_ABSTRACTION_RAID; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev, - enum grub_dev_abstraction_types ab) +VasEBoot_util_pull_device_os (const char *os_dev, + enum VasEBoot_dev_abstraction_types ab) { switch (ab) { - case GRUB_DEV_ABSTRACTION_RAID: + case VasEBoot_DEV_ABSTRACTION_RAID: { - char **devicelist = grub_util_raid_getmembers (os_dev, 0); + char **devicelist = VasEBoot_util_raid_getmembers (os_dev, 0); int i; for (i = 0; devicelist[i];i++) { - grub_util_pull_device (devicelist[i]); + VasEBoot_util_pull_device (devicelist[i]); free (devicelist[i]); } free (devicelist); @@ -1097,45 +1097,45 @@ grub_util_pull_device_os (const char *os_dev, } char * -grub_util_get_grub_dev_os (const char *os_dev) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev) { - char *grub_dev = NULL; + char *VasEBoot_dev = NULL; - switch (grub_util_get_dev_abstraction (os_dev)) + switch (VasEBoot_util_get_dev_abstraction (os_dev)) { /* Fallback for non-devmapper build. In devmapper-builds LVM is handled - in grub_util_get_devmapper_grub_dev and this point isn't reached. + in VasEBoot_util_get_devmapper_VasEBoot_dev and this point isn't reached. */ - case GRUB_DEV_ABSTRACTION_LVM: + case VasEBoot_DEV_ABSTRACTION_LVM: { unsigned short len; - grub_size_t offset = sizeof (LVM_DEV_MAPPER_STRING) - 1; + VasEBoot_size_t offset = sizeof (LVM_DEV_MAPPER_STRING) - 1; len = strlen (os_dev) - offset + 1; - grub_dev = xmalloc (len + sizeof ("lvm/")); + VasEBoot_dev = xmalloc (len + sizeof ("lvm/")); - grub_memcpy (grub_dev, "lvm/", sizeof ("lvm/") - 1); - grub_memcpy (grub_dev + sizeof ("lvm/") - 1, os_dev + offset, len); + VasEBoot_memcpy (VasEBoot_dev, "lvm/", sizeof ("lvm/") - 1); + VasEBoot_memcpy (VasEBoot_dev + sizeof ("lvm/") - 1, os_dev + offset, len); } break; - case GRUB_DEV_ABSTRACTION_RAID: - grub_dev = grub_util_get_raid_grub_dev (os_dev); + case VasEBoot_DEV_ABSTRACTION_RAID: + VasEBoot_dev = VasEBoot_util_get_raid_VasEBoot_dev (os_dev); break; - default: /* GRUB_DEV_ABSTRACTION_NONE */ + default: /* VasEBoot_DEV_ABSTRACTION_NONE */ break; } - return grub_dev; + return VasEBoot_dev; } char * -grub_make_system_path_relative_to_its_root_os (const char *path) +VasEBoot_make_system_path_relative_to_its_root_os (const char *path) { char *bind = NULL; - grub_size_t len; - grub_free (grub_find_root_devices_from_mountinfo (path, &bind)); + VasEBoot_size_t len; + VasEBoot_free (VasEBoot_find_root_devices_from_mountinfo (path, &bind)); if (bind && bind[0]) { len = strlen (bind); @@ -1146,6 +1146,6 @@ grub_make_system_path_relative_to_its_root_os (const char *path) } return bind; } - grub_free (bind); + VasEBoot_free (bind); return NULL; } diff --git a/VasEBoot-core/osdep/linux/hostdisk.c b/VasEBoot-core/osdep/linux/hostdisk.c index 06179fca7..536f48661 100644 --- a/VasEBoot-core/osdep/linux/hostdisk.c +++ b/VasEBoot-core/osdep/linux/hostdisk.c @@ -1,36 +1,36 @@ /* hostdisk.c - emulate biosdisk */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -68,8 +68,8 @@ struct hd_geometry # endif /* ! BLKGETSIZE64 */ -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { unsigned long long nr; unsigned sector_size, log_sector_size; @@ -90,7 +90,7 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec *log_secsize = log_sector_size; if (nr & ((1 << log_sector_size) - 1)) - grub_util_error ("%s", _("unaligned device size")); + VasEBoot_util_error ("%s", _("unaligned device size")); return nr; } @@ -114,7 +114,7 @@ sysfs_partition_path (const char *dev, const char *entry) argv[5] = dev; argv[6] = NULL; - pid = grub_util_exec_pipe (argv, &fd); + pid = VasEBoot_util_exec_pipe (argv, &fd); if (!pid) return NULL; @@ -123,7 +123,7 @@ sysfs_partition_path (const char *dev, const char *entry) udevadm = fdopen (fd, "r"); if (!udevadm) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "udevadm", strerror (errno)); close (fd); goto out; @@ -149,7 +149,7 @@ out: } static int -sysfs_partition_start (const char *dev, grub_disk_addr_t *start) +sysfs_partition_start (const char *dev, VasEBoot_disk_addr_t *start) { char *path; FILE *fp; @@ -160,13 +160,13 @@ sysfs_partition_start (const char *dev, grub_disk_addr_t *start) if (!path) return 0; - fp = grub_util_fopen (path, "r"); + fp = VasEBoot_util_fopen (path, "r"); if (!fp) goto out; if (fscanf (fp, "%llu", &val) == 1) { - *start = (grub_disk_addr_t) val; + *start = (VasEBoot_disk_addr_t) val; ret = 1; } @@ -178,11 +178,11 @@ out: return ret; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { - grub_disk_addr_t start = 0; - grub_util_fd_t fd; + VasEBoot_disk_addr_t start = 0; + VasEBoot_util_fd_t fd; struct hd_geometry hdg; if (sysfs_partition_start (dev, &start)) @@ -191,14 +191,14 @@ grub_util_find_partition_start_os (const char *dev) fd = open (dev, O_RDONLY); if (fd == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), dev, strerror (errno)); return 0; } if (ioctl (fd, HDIO_GETGEO, &hdg)) { - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot get disk geometry of `%s'", dev); close (fd); return 0; @@ -240,7 +240,7 @@ have_devfs (void) #pragma GCC diagnostic ignored "-Wformat-nonliteral" static int -grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector) +VasEBoot_hostdisk_linux_find_partition (char *dev, VasEBoot_disk_addr_t sector) { size_t len = strlen (dev); const char *format; @@ -286,8 +286,8 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector) for (i = 1; i < 10000; i++) { - grub_util_fd_t fd; - grub_disk_addr_t start; + VasEBoot_util_fd_t fd; + VasEBoot_disk_addr_t start; struct stat st; sprintf (p, format, i); @@ -303,11 +303,11 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector) missing = 0; if (fstat (fd, &st) < 0 - || !grub_util_device_is_mapped_stat (&st) - || !grub_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &start)) - start = grub_util_find_partition_start_os (real_dev); + || !VasEBoot_util_device_is_mapped_stat (&st) + || !VasEBoot_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &start)) + start = VasEBoot_util_find_partition_start_os (real_dev); /* We don't care about errors here. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; close (fd); @@ -319,8 +319,8 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector) new_cache_item->dev = xstrdup (dev); new_cache_item->start = start; new_cache_item->partno = i; - grub_list_push (GRUB_AS_LIST_P (&linux_partition_cache_list), - GRUB_AS_LIST (new_cache_item)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&linux_partition_cache_list), + VasEBoot_AS_LIST (new_cache_item)); strcpy (dev, real_dev); return 1; @@ -333,9 +333,9 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector) #pragma GCC diagnostic error "-Wformat-nonliteral" void -grub_hostdisk_flush_initial_buffer (const char *os_dev) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev) { - grub_util_fd_t fd; + VasEBoot_util_fd_t fd; struct stat st; fd = open (os_dev, O_RDONLY); @@ -346,11 +346,11 @@ grub_hostdisk_flush_initial_buffer (const char *os_dev) } int -grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags, - grub_disk_addr_t *max) +VasEBoot_util_fd_open_device (const VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, int flags, + VasEBoot_disk_addr_t *max) { - grub_util_fd_t fd; - struct grub_util_hostdisk_data *data = disk->data; + VasEBoot_util_fd_t fd; + struct VasEBoot_util_hostdisk_data *data = disk->data; *max = ~0ULL; @@ -372,17 +372,17 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f { int is_partition = 0; char dev[PATH_MAX]; - grub_disk_addr_t part_start = 0; + VasEBoot_disk_addr_t part_start = 0; - part_start = grub_partition_get_start (disk->partition); + part_start = VasEBoot_partition_get_start (disk->partition); - strncpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev) - 1); + strncpy (dev, VasEBoot_util_biosdisk_get_osdev (disk), sizeof (dev) - 1); dev[sizeof(dev) - 1] = '\0'; if (disk->partition && strncmp (dev, "/dev/", 5) == 0) { if (sector >= part_start) - is_partition = grub_hostdisk_linux_find_partition (dev, part_start); + is_partition = VasEBoot_hostdisk_linux_find_partition (dev, part_start); else *max = part_start - sector; } @@ -392,7 +392,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f if (data->dev && strcmp (data->dev, dev) == 0 && data->access_mode == (flags & O_ACCMODE)) { - grub_dprintf ("hostdisk", "reusing open device `%s'\n", dev); + VasEBoot_dprintf ("hostdisk", "reusing open device `%s'\n", dev); fd = data->fd; } else @@ -413,11 +413,11 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f } /* Open the partition. */ - grub_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev); + VasEBoot_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev); fd = open (dev, flags); if (fd < 0) { - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), dev, strerror (errno)); return -1; } @@ -432,7 +432,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f if (is_partition) { - *max = grub_util_get_fd_size (fd, dev, 0); + *max = VasEBoot_util_get_fd_size (fd, dev, 0); *max >>= disk->log_sector_size; if (sector - part_start >= *max) { @@ -440,7 +440,7 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f if (*max == 0) *max = ~0ULL; is_partition = 0; - strncpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev) - 1); + strncpy (dev, VasEBoot_util_biosdisk_get_osdev (disk), sizeof (dev) - 1); dev[sizeof(dev) - 1] = '\0'; goto reopen; } @@ -449,11 +449,11 @@ grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int f } } - if (grub_util_fd_seek (fd, sector << disk->log_sector_size)) + if (VasEBoot_util_fd_seek (fd, sector << disk->log_sector_size)) { close (fd); - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), - grub_util_biosdisk_get_osdev (disk), strerror (errno)); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), + VasEBoot_util_biosdisk_get_osdev (disk), strerror (errno)); return -1; } diff --git a/VasEBoot-core/osdep/linux/ofpath.c b/VasEBoot-core/osdep/linux/ofpath.c index a79682a5e..0781e8477 100644 --- a/VasEBoot-core/osdep/linux/ofpath.c +++ b/VasEBoot-core/osdep/linux/ofpath.c @@ -1,29 +1,29 @@ /* ofpath.c - calculate OpenFirmware path names given an OS device */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009, 2011,2012, 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #undef OFPATH_STANDALONE #ifndef OFPATH_STANDALONE -#include -#include -#include -#include +#include +#include +#include +#include #endif #include @@ -41,7 +41,7 @@ #ifdef OFPATH_STANDALONE #define xmalloc malloc void -grub_util_error (const char *fmt, ...) +VasEBoot_util_error (const char *fmt, ...) { va_list ap; @@ -54,7 +54,7 @@ grub_util_error (const char *fmt, ...) } void -grub_util_info (const char *fmt, ...) +VasEBoot_util_info (const char *fmt, ...) { va_list ap; @@ -65,7 +65,7 @@ grub_util_info (const char *fmt, ...) fputc ('\n', stderr); } -#define grub_util_warn grub_util_info +#define VasEBoot_util_warn VasEBoot_util_info #define _(x) x #define xstrdup strdup #endif @@ -135,7 +135,7 @@ find_obppath (const char *sysfs_path_orig) kill_trailing_dir(sysfs_path); if (!strcmp(sysfs_path, "/sys")) { - grub_util_info (_("`obppath' not found in parent dirs of `%s'," + VasEBoot_util_info (_("`obppath' not found in parent dirs of `%s'," " no IEEE1275 name discovery"), sysfs_path_orig); free (path); @@ -149,7 +149,7 @@ find_obppath (const char *sysfs_path_orig) memset(of_path, 0, size + MAX_DISK_CAT + 1); if (read(fd, of_path, size) < 0) { - grub_util_info (_("cannot read `%s': %s"), path, strerror (errno)); + VasEBoot_util_info (_("cannot read `%s': %s"), path, strerror (errno)); close(fd); free (path); free (of_path); @@ -176,7 +176,7 @@ xrealpath (const char *in) out = realpath (in, NULL); #endif if (!out) - grub_util_error (_("failed to get canonical path of `%s'"), in); + VasEBoot_util_error (_("failed to get canonical path of `%s'"), in); return out; } @@ -322,12 +322,12 @@ vendor_is_ATA(const char *path) snprintf (bufname, path_size, "%s/vendor", path); fd = open (bufname, O_RDONLY); if (fd < 0) - grub_util_error (_("cannot open `%s': %s"), bufname, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), bufname, strerror (errno)); memset(bufcont, 0, sizeof (bufcont)); err = read(fd, bufcont, sizeof (bufcont)); if (err < 0) - grub_util_error (_("cannot open `%s': %s"), bufname, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), bufname, strerror (errno)); close(fd); free (bufname); @@ -364,11 +364,11 @@ check_sas (const char *sysfs_path, int *tgt, unsigned long int *sas_address) snprintf (path, path_size, "%s/sas_device/%s/phy_identifier", p, ed); fd = open (path, O_RDONLY); if (fd < 0) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); memset (phy, 0, sizeof (phy)); if (read (fd, phy, sizeof (phy) - 1) < 0) - grub_util_error (_("cannot read `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot read `%s': %s"), path, strerror (errno)); close (fd); @@ -377,11 +377,11 @@ check_sas (const char *sysfs_path, int *tgt, unsigned long int *sas_address) snprintf (path, path_size, "%s/sas_device/%s/sas_address", p, ed); fd = open (path, O_RDONLY); if (fd < 0) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); memset (phy, 0, sizeof (phy)); if (read (fd, phy, sizeof (phy) - 1) < 0) - grub_util_error (_("cannot read `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot read `%s': %s"), path, strerror (errno)); sscanf (phy, "%lx", sas_address); free (path); @@ -514,7 +514,7 @@ strip_trailing_digits (const char *p) } char * -grub_util_devname_to_ofpath (const char *sys_devname) +VasEBoot_util_devname_to_ofpath (const char *sys_devname) { char *name_buf, *device, *devnode, *devicenode, *ofpath; @@ -539,7 +539,7 @@ grub_util_devname_to_ofpath (const char *sys_devname) ofpath = xstrdup ("floppy"); else { - grub_util_warn (_("unknown device type %s"), device); + VasEBoot_util_warn (_("unknown device type %s"), device); ofpath = NULL; } @@ -561,7 +561,7 @@ int main(int argc, char **argv) return 1; } - of_path = grub_util_devname_to_ofpath (argv[1]); + of_path = VasEBoot_util_devname_to_ofpath (argv[1]); if (of_path) printf("%s\n", of_path); free (of_path); diff --git a/VasEBoot-core/osdep/linux/platform.c b/VasEBoot-core/osdep/linux/platform.c index 775b6c031..d8d3d19c0 100644 --- a/VasEBoot-core/osdep/linux/platform.c +++ b/VasEBoot-core/osdep/linux/platform.c @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -70,7 +70,7 @@ read_platform_size (void) /* Newer kernels can tell us directly about the size of the * underlying firmware - let's see if that interface is there. */ - fp = grub_util_fopen ("/sys/firmware/efi/fw_platform_size", "r"); + fp = VasEBoot_util_fopen ("/sys/firmware/efi/fw_platform_size", "r"); if (fp != NULL) { if (getline (&buf, &len, fp) >= 3) /* 2 digits plus newline */ @@ -98,7 +98,7 @@ read_platform_size (void) } const char * -grub_install_get_default_x86_platform (void) +VasEBoot_install_get_default_x86_platform (void) { /* On Linux, we need the efivars kernel modules. @@ -107,26 +107,26 @@ grub_install_get_default_x86_platform (void) anyway later. So it should be safe to try to load it here. */ - grub_util_exec_redirect_all ((const char * []){ "modprobe", "efivars", NULL }, + VasEBoot_util_exec_redirect_all ((const char * []){ "modprobe", "efivars", NULL }, NULL, NULL, "/dev/null"); - grub_util_info ("Looking for /sys/firmware/efi .."); + VasEBoot_util_info ("Looking for /sys/firmware/efi .."); if (is_not_empty_directory ("/sys/firmware/efi")) { - grub_util_info ("...found"); + VasEBoot_util_info ("...found"); if (read_platform_size() == 64) return "x86_64-efi"; else return "i386-efi"; } - grub_util_info ("... not found. Looking for /proc/device-tree .."); + VasEBoot_util_info ("... not found. Looking for /proc/device-tree .."); if (is_not_empty_directory ("/proc/device-tree")) { - grub_util_info ("...found"); + VasEBoot_util_info ("...found"); return "i386-ieee1275"; } - grub_util_info ("... not found"); + VasEBoot_util_info ("... not found"); return "i386-pc"; } diff --git a/VasEBoot-core/osdep/sun/getroot.c b/VasEBoot-core/osdep/sun/getroot.c index 611603769..6f501c0c5 100644 --- a/VasEBoot-core/osdep/sun/getroot.c +++ b/VasEBoot-core/osdep/sun/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,15 +35,15 @@ #include #endif -#include +#include -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -53,11 +53,11 @@ char * -grub_util_part_to_disk (const char *os_dev, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part) { - char *colon = grub_strrchr (os_dev, ':'); + char *colon = VasEBoot_strrchr (os_dev, ':'); if (! S_ISCHR (st->st_mode)) { @@ -65,41 +65,41 @@ grub_util_part_to_disk (const char *os_dev, return xstrdup (os_dev); } - if (grub_memcmp (os_dev, "/devices", sizeof ("/devices") - 1) == 0 + if (VasEBoot_memcmp (os_dev, "/devices", sizeof ("/devices") - 1) == 0 && colon) { char *ret = xmalloc (colon - os_dev + sizeof (":q,raw")); - if (grub_strcmp (colon, ":q,raw") != 0) + if (VasEBoot_strcmp (colon, ":q,raw") != 0) *is_part = 1; - grub_memcpy (ret, os_dev, colon - os_dev); - grub_memcpy (ret + (colon - os_dev), ":q,raw", sizeof (":q,raw")); + VasEBoot_memcpy (ret, os_dev, colon - os_dev); + VasEBoot_memcpy (ret + (colon - os_dev), ":q,raw", sizeof (":q,raw")); return ret; } else return xstrdup (os_dev); } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev) { int fd; struct extpart_info pinfo; @@ -107,14 +107,14 @@ grub_util_find_partition_start_os (const char *dev) fd = open (dev, O_RDONLY); if (fd == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot open `%s': %s"), dev, strerror (errno)); return 0; } if (ioctl (fd, DKIOCEXTPARTINFO, &pinfo)) { - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot get disk geometry of `%s'", dev); close (fd); return 0; diff --git a/VasEBoot-core/osdep/sun/hostdisk.c b/VasEBoot-core/osdep/sun/hostdisk.c index dab96dcff..c43475407 100644 --- a/VasEBoot-core/osdep/sun/hostdisk.c +++ b/VasEBoot-core/osdep/sun/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -44,8 +44,8 @@ # include -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { struct dk_minfo minfo; unsigned sector_size, log_sector_size; @@ -68,6 +68,6 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/unix/compress.c b/VasEBoot-core/osdep/unix/compress.c index dee56207f..a45abc085 100644 --- a/VasEBoot-core/osdep/unix/compress.c +++ b/VasEBoot-core/osdep/unix/compress.c @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include int -grub_install_compress_gzip (const char *src, const char *dest) +VasEBoot_install_compress_gzip (const char *src, const char *dest) { - return grub_util_exec_redirect ((const char * []) { "gzip", "--best", + return VasEBoot_util_exec_redirect ((const char * []) { "gzip", "--best", "--stdout", NULL }, src, dest); } int -grub_install_compress_xz (const char *src, const char *dest) +VasEBoot_install_compress_xz (const char *src, const char *dest) { - return grub_util_exec_redirect ((const char * []) { "xz", + return VasEBoot_util_exec_redirect ((const char * []) { "xz", "--lzma2=dict=128KiB", "--check=none", "--stdout", NULL }, src, dest); } int -grub_install_compress_lzop (const char *src, const char *dest) +VasEBoot_install_compress_lzop (const char *src, const char *dest) { - return grub_util_exec_redirect ((const char * []) { "lzop", "-9", "-c", + return VasEBoot_util_exec_redirect ((const char * []) { "lzop", "-9", "-c", NULL }, src, dest); } diff --git a/VasEBoot-core/osdep/unix/config.c b/VasEBoot-core/osdep/unix/config.c index 65effa9f3..54f554fd3 100644 --- a/VasEBoot-core/osdep/unix/config.c +++ b/VasEBoot-core/osdep/unix/config.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -31,38 +31,38 @@ #include const char * -grub_util_get_config_filename (void) +VasEBoot_util_get_config_filename (void) { static char *value = NULL; if (!value) - value = grub_util_path_concat (3, GRUB_SYSCONFDIR, - "default", "grub"); + value = VasEBoot_util_path_concat (3, VasEBoot_SYSCONFDIR, + "default", "VasEBoot"); return value; } const char * -grub_util_get_pkgdatadir (void) +VasEBoot_util_get_pkgdatadir (void) { const char *ret = getenv ("pkgdatadir"); if (ret) return ret; - return GRUB_DATADIR "/" PACKAGE; + return VasEBoot_DATADIR "/" PACKAGE; } const char * -grub_util_get_pkglibdir (void) +VasEBoot_util_get_pkglibdir (void) { - return GRUB_LIBDIR "/" PACKAGE; + return VasEBoot_LIBDIR "/" PACKAGE; } const char * -grub_util_get_localedir (void) +VasEBoot_util_get_localedir (void) { return LOCALEDIR; } void -grub_util_load_config (struct grub_util_config *cfg) +VasEBoot_util_load_config (struct VasEBoot_util_config *cfg) { pid_t pid; const char *argv[4]; @@ -74,16 +74,16 @@ grub_util_load_config (struct grub_util_config *cfg) memset (cfg, 0, sizeof (*cfg)); - v = getenv ("GRUB_ENABLE_CRYPTODISK"); + v = getenv ("VasEBoot_ENABLE_CRYPTODISK"); if (v && v[0] == 'y' && v[1] == '\0') cfg->is_cryptodisk_enabled = 1; - v = getenv ("GRUB_DISTRIBUTOR"); + v = getenv ("VasEBoot_DISTRIBUTOR"); if (v) - cfg->grub_distributor = xstrdup (v); + cfg->VasEBoot_distributor = xstrdup (v); - cfgfile = grub_util_get_config_filename (); - if (!grub_util_is_regular (cfgfile)) + cfgfile = VasEBoot_util_get_config_filename (); + if (!VasEBoot_util_is_regular (cfgfile)) return; argv[0] = "sh"; @@ -105,18 +105,18 @@ grub_util_load_config (struct grub_util_config *cfg) *ptr++ = *iptr; } - strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" " - "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\""); + strcpy (ptr, "'; printf \"VasEBoot_ENABLE_CRYPTODISK=%s\\nVasEBoot_DISTRIBUTOR=%s\\n\" " + "\"$VasEBoot_ENABLE_CRYPTODISK\" \"$VasEBoot_DISTRIBUTOR\""); argv[2] = script; argv[3] = '\0'; - pid = grub_util_exec_pipe (argv, &fd); + pid = VasEBoot_util_exec_pipe (argv, &fd); if (pid) f = fdopen (fd, "r"); if (f) { - grub_util_parse_config (f, cfg, 1); + VasEBoot_util_parse_config (f, cfg, 1); fclose (f); } if (pid) @@ -127,13 +127,13 @@ grub_util_load_config (struct grub_util_config *cfg) if (f) return; - f = grub_util_fopen (cfgfile, "r"); + f = VasEBoot_util_fopen (cfgfile, "r"); if (f) { - grub_util_parse_config (f, cfg, 0); + VasEBoot_util_parse_config (f, cfg, 0); fclose (f); } else - grub_util_warn (_("cannot open configuration file `%s': %s"), + VasEBoot_util_warn (_("cannot open configuration file `%s': %s"), cfgfile, strerror (errno)); } diff --git a/VasEBoot-core/osdep/unix/cputime.c b/VasEBoot-core/osdep/unix/cputime.c index cff359a3b..2c8e4de0f 100644 --- a/VasEBoot-core/osdep/unix/cputime.c +++ b/VasEBoot-core/osdep/unix/cputime.c @@ -3,10 +3,10 @@ #include #include -#include +#include -grub_uint64_t -grub_util_get_cpu_time_ms (void) +VasEBoot_uint64_t +VasEBoot_util_get_cpu_time_ms (void) { struct tms tm; static long sc_clk_tck; diff --git a/VasEBoot-core/osdep/unix/dl.c b/VasEBoot-core/osdep/unix/dl.c index 562b101a2..a0c3e3387 100644 --- a/VasEBoot-core/osdep/unix/dl.c +++ b/VasEBoot-core/osdep/unix/dl.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include +#include +#include +#include #include #include #include void * -grub_osdep_dl_memalign (grub_size_t align, grub_size_t size) +VasEBoot_osdep_dl_memalign (VasEBoot_size_t align, VasEBoot_size_t size) { void *ret; if (align < 8192 * 16) @@ -45,7 +45,7 @@ grub_osdep_dl_memalign (grub_size_t align, grub_size_t size) if (!ret) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return NULL; } @@ -54,7 +54,7 @@ grub_osdep_dl_memalign (grub_size_t align, grub_size_t size) } void -grub_dl_osdep_dl_free (void *ptr) +VasEBoot_dl_osdep_dl_free (void *ptr) { if (ptr) free (ptr); diff --git a/VasEBoot-core/osdep/unix/emuconsole.c b/VasEBoot-core/osdep/unix/emuconsole.c index 7308798ef..84233f118 100644 --- a/VasEBoot-core/osdep/unix/emuconsole.c +++ b/VasEBoot-core/osdep/unix/emuconsole.c @@ -1,32 +1,32 @@ -/* console.c -- console for GRUB. */ +/* console.c -- console for VasEBoot. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -37,16 +37,16 @@ #include #include -#include +#include -extern struct grub_terminfo_output_state grub_console_terminfo_output; +extern struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output; static int original_fl; static int saved_orig; static struct termios orig_tty; static struct termios new_tty; static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { char chr = c; ssize_t actual; @@ -60,9 +60,9 @@ put (struct grub_term_output *term __attribute__ ((unused)), const int c) } static int -readkey (struct grub_term_input *term __attribute__ ((unused))) +readkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { - grub_uint8_t c; + VasEBoot_uint8_t c; ssize_t actual; actual = read (STDIN_FILENO, &c, 1); @@ -71,8 +71,8 @@ readkey (struct grub_term_input *term __attribute__ ((unused))) return -1; } -static grub_err_t -grub_console_init_input (struct grub_term_input *term) +static VasEBoot_err_t +VasEBoot_console_init_input (struct VasEBoot_term_input *term) { if (!saved_orig) { @@ -88,92 +88,92 @@ grub_console_init_input (struct grub_term_input *term) new_tty.c_cc[VMIN] = 1; tcsetattr(STDIN_FILENO, TCSANOW, &new_tty); - return grub_terminfo_input_init (term); + return VasEBoot_terminfo_input_init (term); } -static grub_err_t -grub_console_fini_input (struct grub_term_input *term +static VasEBoot_err_t +VasEBoot_console_fini_input (struct VasEBoot_term_input *term __attribute__ ((unused))) { fcntl (STDIN_FILENO, F_SETFL, original_fl); tcsetattr(STDIN_FILENO, TCSANOW, &orig_tty); saved_orig = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_console_init_output (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_console_init_output (struct VasEBoot_term_output *term) { struct winsize size; if (ioctl (STDOUT_FILENO, TIOCGWINSZ, &size) >= 0) { - grub_console_terminfo_output.size.x = size.ws_col; - grub_console_terminfo_output.size.y = size.ws_row; + VasEBoot_console_terminfo_output.size.x = size.ws_col; + VasEBoot_console_terminfo_output.size.y = size.ws_row; } else { - grub_console_terminfo_output.size.x = 80; - grub_console_terminfo_output.size.y = 24; + VasEBoot_console_terminfo_output.size.x = 80; + VasEBoot_console_terminfo_output.size.y = 24; } - grub_terminfo_output_init (term); + VasEBoot_terminfo_output_init (term); return 0; } -struct grub_terminfo_input_state grub_console_terminfo_input = +struct VasEBoot_terminfo_input_state VasEBoot_console_terminfo_input = { .readkey = readkey }; -struct grub_terminfo_output_state grub_console_terminfo_output = +struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output = { .put = put, .size = { 80, 24 } }; -static struct grub_term_input grub_console_term_input = +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", - .init = grub_console_init_input, - .fini = grub_console_fini_input, - .getkey = grub_terminfo_getkey, - .data = &grub_console_terminfo_input + .init = VasEBoot_console_init_input, + .fini = VasEBoot_console_fini_input, + .getkey = VasEBoot_terminfo_getkey, + .data = &VasEBoot_console_terminfo_input }; -static struct grub_term_output grub_console_term_output = +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", - .init = grub_console_init_output, - .putchar = grub_terminfo_putchar, - .getxy = grub_terminfo_getxy, - .getwh = grub_terminfo_getwh, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_terminfo_setcursor, - .data = &grub_console_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_FAST + .init = VasEBoot_console_init_output, + .putchar = VasEBoot_terminfo_putchar, + .getxy = VasEBoot_terminfo_getxy, + .getwh = VasEBoot_terminfo_getwh, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_terminfo_setcursor, + .data = &VasEBoot_console_terminfo_output, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init (void) +VasEBoot_console_init (void) { const char *cs = nl_langinfo (CODESET); - if (cs && grub_strcasecmp (cs, "UTF-8")) - grub_console_term_output.flags = GRUB_TERM_CODE_TYPE_UTF8_LOGICAL; + if (cs && VasEBoot_strcasecmp (cs, "UTF-8")) + VasEBoot_console_term_output.flags = VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL; else - grub_console_term_output.flags = GRUB_TERM_CODE_TYPE_ASCII; - grub_term_register_input ("console", &grub_console_term_input); - grub_term_register_output ("console", &grub_console_term_output); - grub_terminfo_init (); - grub_terminfo_output_register (&grub_console_term_output, "vt100-color"); + VasEBoot_console_term_output.flags = VasEBoot_TERM_CODE_TYPE_ASCII; + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); + VasEBoot_terminfo_init (); + VasEBoot_terminfo_output_register (&VasEBoot_console_term_output, "vt100-color"); } void -grub_console_fini (void) +VasEBoot_console_fini (void) { if (saved_orig) { diff --git a/VasEBoot-core/osdep/unix/exec.c b/VasEBoot-core/osdep/unix/exec.c index 935ff120e..a9c95a5bc 100644 --- a/VasEBoot-core/osdep/unix/exec.c +++ b/VasEBoot-core/osdep/unix/exec.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -34,65 +34,65 @@ #include int -grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, +VasEBoot_util_exec_redirect_all (const char *const *argv, const char *stdin_file, const char *stdout_file, const char *stderr_file) { pid_t pid; int status = -1; char *str, *pstr; const char *const *ptr; - grub_size_t strl = 0; + VasEBoot_size_t strl = 0; for (ptr = argv; *ptr; ptr++) - strl += grub_strlen (*ptr) + 1; + strl += VasEBoot_strlen (*ptr) + 1; if (stdin_file) - strl += grub_strlen (stdin_file) + 2; + strl += VasEBoot_strlen (stdin_file) + 2; if (stdout_file) - strl += grub_strlen (stdout_file) + 2; + strl += VasEBoot_strlen (stdout_file) + 2; if (stderr_file) - strl += grub_strlen (stderr_file) + 3; + strl += VasEBoot_strlen (stderr_file) + 3; pstr = str = xmalloc (strl); for (ptr = argv; *ptr; ptr++) { - pstr = grub_stpcpy (pstr, *ptr); + pstr = VasEBoot_stpcpy (pstr, *ptr); *pstr++ = ' '; } if (stdin_file) { *pstr++ = '<'; - pstr = grub_stpcpy (pstr, stdin_file); + pstr = VasEBoot_stpcpy (pstr, stdin_file); *pstr++ = ' '; } if (stdout_file) { *pstr++ = '>'; - pstr = grub_stpcpy (pstr, stdout_file); + pstr = VasEBoot_stpcpy (pstr, stdout_file); *pstr++ = ' '; } if (stderr_file) { *pstr++ = '2'; *pstr++ = '>'; - pstr = grub_stpcpy (pstr, stderr_file); + pstr = VasEBoot_stpcpy (pstr, stderr_file); pstr++; } *--pstr = '\0'; - grub_util_info ("executing %s", str); - grub_free (str); + VasEBoot_util_info ("executing %s", str); + VasEBoot_free (str); pid = fork (); if (pid < 0) - grub_util_error (_("Unable to fork: %s"), strerror (errno)); + VasEBoot_util_error (_("Unable to fork: %s"), strerror (errno)); else if (pid == 0) { int fd; /* Child. */ /* Close fd's. */ -#ifdef GRUB_UTIL - grub_util_devmapper_cleanup (); - grub_diskfilter_fini (); +#ifdef VasEBoot_UTIL + VasEBoot_util_devmapper_cleanup (); + VasEBoot_diskfilter_fini (); #endif if (stdin_file) @@ -135,26 +135,26 @@ grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, } int -grub_util_exec (const char *const *argv) +VasEBoot_util_exec (const char *const *argv) { - return grub_util_exec_redirect_all (argv, NULL, NULL, NULL); + return VasEBoot_util_exec_redirect_all (argv, NULL, NULL, NULL); } int -grub_util_exec_redirect (const char *const *argv, const char *stdin_file, +VasEBoot_util_exec_redirect (const char *const *argv, const char *stdin_file, const char *stdout_file) { - return grub_util_exec_redirect_all (argv, stdin_file, stdout_file, NULL); + return VasEBoot_util_exec_redirect_all (argv, stdin_file, stdout_file, NULL); } int -grub_util_exec_redirect_null (const char *const *argv) +VasEBoot_util_exec_redirect_null (const char *const *argv) { - return grub_util_exec_redirect_all (argv, "/dev/null", "/dev/null", NULL); + return VasEBoot_util_exec_redirect_all (argv, "/dev/null", "/dev/null", NULL); } pid_t -grub_util_exec_pipe (const char *const *argv, int *fd) +VasEBoot_util_exec_pipe (const char *const *argv, int *fd) { int pipe_fd[2]; pid_t pid; @@ -163,21 +163,21 @@ grub_util_exec_pipe (const char *const *argv, int *fd) if (pipe (pipe_fd) < 0) { - grub_util_warn (_("Unable to create pipe: %s"), + VasEBoot_util_warn (_("Unable to create pipe: %s"), strerror (errno)); return 0; } pid = fork (); if (pid < 0) - grub_util_error (_("Unable to fork: %s"), strerror (errno)); + VasEBoot_util_error (_("Unable to fork: %s"), strerror (errno)); else if (pid == 0) { /* Child. */ /* Close fd's. */ -#ifdef GRUB_UTIL - grub_util_devmapper_cleanup (); - grub_diskfilter_fini (); +#ifdef VasEBoot_UTIL + VasEBoot_util_devmapper_cleanup (); + VasEBoot_diskfilter_fini (); #endif /* Ensure child is not localised. */ @@ -199,7 +199,7 @@ grub_util_exec_pipe (const char *const *argv, int *fd) } pid_t -grub_util_exec_pipe_stderr (const char *const *argv, int *fd) +VasEBoot_util_exec_pipe_stderr (const char *const *argv, int *fd) { int pipe_fd[2]; pid_t pid; @@ -208,21 +208,21 @@ grub_util_exec_pipe_stderr (const char *const *argv, int *fd) if (pipe (pipe_fd) < 0) { - grub_util_warn (_("Unable to create pipe: %s"), + VasEBoot_util_warn (_("Unable to create pipe: %s"), strerror (errno)); return 0; } pid = fork (); if (pid < 0) - grub_util_error (_("Unable to fork: %s"), strerror (errno)); + VasEBoot_util_error (_("Unable to fork: %s"), strerror (errno)); else if (pid == 0) { /* Child. */ /* Close fd's. */ -#ifdef GRUB_UTIL - grub_util_devmapper_cleanup (); - grub_diskfilter_fini (); +#ifdef VasEBoot_UTIL + VasEBoot_util_devmapper_cleanup (); + VasEBoot_diskfilter_fini (); #endif /* Ensure child is not localised. */ diff --git a/VasEBoot-core/osdep/unix/getroot.c b/VasEBoot-core/osdep/unix/getroot.c index 4bf37b027..469d9e9f0 100644 --- a/VasEBoot-core/osdep/unix/getroot.c +++ b/VasEBoot-core/osdep/unix/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -34,11 +34,11 @@ #ifdef HAVE_LIMITS_H #include #endif -#include -#include +#include +#include -#include -#include +#include +#include #if !defined (__MINGW32__) && !defined (__CYGWIN__) && !defined (__AROS__) && !defined (__HAIKU__) @@ -58,15 +58,15 @@ #endif #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) -# include -# include +# include +# include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # define FLOPPY_MAJOR 2 @@ -154,7 +154,7 @@ xgetcwd (void) } char ** -grub_util_find_root_devices_from_poolname (char *poolname) +VasEBoot_util_find_root_devices_from_poolname (char *poolname) { char **devices = 0; size_t ndevices = 0; @@ -169,7 +169,7 @@ grub_util_find_root_devices_from_poolname (char *poolname) unsigned int i; char *device = 0; - libzfs = grub_get_libzfs_handle (); + libzfs = VasEBoot_get_libzfs_handle (); if (! libzfs) return NULL; @@ -196,13 +196,13 @@ grub_util_find_root_devices_from_poolname (char *poolname) if (stat (device, &st) == 0) { #ifdef __sun__ - if (grub_memcmp (device, "/dev/dsk/", sizeof ("/dev/dsk/") - 1) + if (VasEBoot_memcmp (device, "/dev/dsk/", sizeof ("/dev/dsk/") - 1) == 0) device = xasprintf ("/dev/rdsk/%s", device + sizeof ("/dev/dsk/") - 1); - else if (grub_memcmp (device, "/devices", sizeof ("/devices") - 1) + else if (VasEBoot_memcmp (device, "/devices", sizeof ("/devices") - 1) == 0 - && grub_memcmp (device + strlen (device) - 4, + && VasEBoot_memcmp (device + strlen (device) - 4, ",raw", 4) != 0) device = xasprintf ("%s,raw", device); else @@ -240,14 +240,14 @@ grub_util_find_root_devices_from_poolname (char *poolname) argv[2] = poolname; argv[3] = NULL; - pid = grub_util_exec_pipe (argv, &fd); + pid = VasEBoot_util_exec_pipe (argv, &fd); if (!pid) return NULL; fp = fdopen (fd, "r"); if (!fp) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "zpool", strerror (errno)); goto out; } @@ -278,9 +278,9 @@ grub_util_find_root_devices_from_poolname (char *poolname) while (1) { if (strncmp (ptr, poolname, strlen (poolname)) == 0 - && grub_isspace(ptr[strlen (poolname)])) + && VasEBoot_isspace(ptr[strlen (poolname)])) st++; - if (!grub_isspace (*ptr)) + if (!VasEBoot_isspace (*ptr)) break; ptr++; } @@ -335,11 +335,11 @@ find_root_devices_from_libzfs (const char *dir) char *poolname; char *poolfs; - grub_find_zpool_from_dir (dir, &poolname, &poolfs); + VasEBoot_find_zpool_from_dir (dir, &poolname, &poolfs); if (! poolname) return NULL; - devices = grub_util_find_root_devices_from_poolname (poolname); + devices = VasEBoot_util_find_root_devices_from_poolname (poolname); free (poolname); if (poolfs) @@ -349,7 +349,7 @@ find_root_devices_from_libzfs (const char *dir) } char * -grub_find_device (const char *dir, dev_t dev) +VasEBoot_find_device (const char *dir, dev_t dev) { DIR *dp; char *saved_cwd; @@ -364,7 +364,7 @@ grub_find_device (const char *dir, dev_t dev) saved_cwd = xgetcwd (); - grub_util_info ("changing current directory to %s", dir); + VasEBoot_util_info ("changing current directory to %s", dir); if (chdir (dir) < 0) { free (saved_cwd); @@ -406,12 +406,12 @@ grub_find_device (const char *dir, dev_t dev) /* Find it recursively. */ char *res; - res = grub_find_device (ent->d_name, dev); + res = VasEBoot_find_device (ent->d_name, dev); if (res) { if (chdir (saved_cwd) < 0) - grub_util_error ("%s", + VasEBoot_util_error ("%s", _("cannot restore the original directory")); free (saved_cwd); @@ -457,7 +457,7 @@ grub_find_device (const char *dir, dev_t dev) /* /dev/root is not a real block device keep looking, takes care of situation where root filesystem is on the same partition as - grub files */ + VasEBoot files */ if (strcmp(res, "/dev/root") == 0) { @@ -466,7 +466,7 @@ grub_find_device (const char *dir, dev_t dev) } if (chdir (saved_cwd) < 0) - grub_util_error ("%s", _("cannot restore the original directory")); + VasEBoot_util_error ("%s", _("cannot restore the original directory")); free (saved_cwd); closedir (dp); @@ -475,7 +475,7 @@ grub_find_device (const char *dir, dev_t dev) } if (chdir (saved_cwd) < 0) - grub_util_error ("%s", _("cannot restore the original directory")); + VasEBoot_util_error ("%s", _("cannot restore the original directory")); free (saved_cwd); closedir (dp); @@ -483,19 +483,19 @@ grub_find_device (const char *dir, dev_t dev) } char ** -grub_guess_root_devices (const char *dir_in) +VasEBoot_guess_root_devices (const char *dir_in) { char **os_dev = NULL; struct stat st; dev_t dev; - char *dir = grub_canonicalize_file_name (dir_in); + char *dir = VasEBoot_canonicalize_file_name (dir_in); if (!dir) - grub_util_error (_("failed to get canonical path of `%s'"), dir_in); + VasEBoot_util_error (_("failed to get canonical path of `%s'"), dir_in); #ifdef __linux__ if (!os_dev) - os_dev = grub_find_root_devices_from_mountinfo (dir, NULL); + os_dev = VasEBoot_find_root_devices_from_mountinfo (dir, NULL); #endif /* __linux__ */ if (!os_dev) @@ -513,9 +513,9 @@ grub_guess_root_devices (const char *dir_in) *cur = tmp; else { - *cur = grub_canonicalize_file_name (tmp); + *cur = VasEBoot_canonicalize_file_name (tmp); if (*cur == NULL) - grub_util_error (_("failed to get canonical path of `%s'"), tmp); + VasEBoot_util_error (_("failed to get canonical path of `%s'"), tmp); free (tmp); } root = (strcmp (*cur, "/dev/root") == 0); @@ -526,7 +526,7 @@ grub_guess_root_devices (const char *dir_in) break; free (*cur); dev = st.st_rdev; - *cur = grub_find_device (dm ? "/dev/mapper" : "/dev", dev); + *cur = VasEBoot_find_device (dm ? "/dev/mapper" : "/dev", dev); } if (!*cur) return os_dev; @@ -537,7 +537,7 @@ grub_guess_root_devices (const char *dir_in) } if (stat (dir, &st) < 0) - grub_util_error (_("cannot stat `%s': %s"), dir, strerror (errno)); + VasEBoot_util_error (_("cannot stat `%s': %s"), dir, strerror (errno)); free (dir); dev = st.st_dev; @@ -545,7 +545,7 @@ grub_guess_root_devices (const char *dir_in) os_dev = xmalloc (2 * sizeof (os_dev[0])); /* This might be truly slow, but is there any better way? */ - os_dev[0] = grub_find_device ("/dev", dev); + os_dev[0] = VasEBoot_find_device ("/dev", dev); if (!os_dev[0]) { @@ -561,7 +561,7 @@ grub_guess_root_devices (const char *dir_in) #endif void -grub_util_pull_lvm_by_command (const char *os_dev) +VasEBoot_util_pull_lvm_by_command (const char *os_dev) { const char *argv[8]; int fd; @@ -573,11 +573,11 @@ grub_util_pull_lvm_by_command (const char *os_dev) const char *iptr; char *optr; char *vgid = NULL; - grub_size_t vgidlen = 0; + VasEBoot_size_t vgidlen = 0; - vgid = grub_util_get_vg_uuid (os_dev); + vgid = VasEBoot_util_get_vg_uuid (os_dev); if (vgid) - vgidlen = grub_strlen (vgid); + vgidlen = VasEBoot_strlen (vgid); if (!vgid) { @@ -615,7 +615,7 @@ grub_util_pull_lvm_by_command (const char *os_dev) argv[6] = vgname; argv[7] = NULL; - pid = grub_util_exec_pipe (argv, &fd); + pid = VasEBoot_util_exec_pipe (argv, &fd); free (vgname); if (!pid) @@ -628,7 +628,7 @@ grub_util_pull_lvm_by_command (const char *os_dev) vgs = fdopen (fd, "r"); if (! vgs) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "vgs", strerror (errno)); goto out; } @@ -639,7 +639,7 @@ grub_util_pull_lvm_by_command (const char *os_dev) /* LVM adds two spaces as standard prefix */ for (ptr = buf; ptr < buf + 2 && *ptr == ' '; ptr++); - if (vgid && (grub_strncmp (vgid, ptr, vgidlen) != 0 + if (vgid && (VasEBoot_strncmp (vgid, ptr, vgidlen) != 0 || ptr[vgidlen] != ':')) continue; if (vgid) @@ -647,7 +647,7 @@ grub_util_pull_lvm_by_command (const char *os_dev) if (*ptr == '\0') continue; *(ptr + strlen (ptr) - 1) = '\0'; - grub_util_pull_device (ptr); + VasEBoot_util_pull_device (ptr); } out: @@ -659,7 +659,7 @@ out: /* ZFS has similar problems to those of btrfs (see above). */ void -grub_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs) +VasEBoot_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs) { char *slash; @@ -687,7 +687,7 @@ grub_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs) if (stat (dir, &st) != 0) return; - FILE *mnttab = grub_util_fopen ("/etc/mnttab", "r"); + FILE *mnttab = VasEBoot_util_fopen ("/etc/mnttab", "r"); if (! mnttab) return; @@ -719,13 +719,13 @@ grub_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs) } int -grub_util_biosdisk_is_floppy (grub_disk_t disk) +VasEBoot_util_biosdisk_is_floppy (VasEBoot_disk_t disk) { struct stat st; int fd; const char *dname; - dname = grub_util_biosdisk_get_osdev (disk); + dname = VasEBoot_util_biosdisk_get_osdev (disk); if (!dname) return 0; @@ -766,10 +766,10 @@ grub_util_biosdisk_is_floppy (grub_disk_t disk) #else -#include +#include void -grub_util_pull_lvm_by_command (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_pull_lvm_by_command (const char *os_dev __attribute__ ((unused))) { } diff --git a/VasEBoot-core/osdep/unix/hostdisk.c b/VasEBoot-core/osdep/unix/hostdisk.c index 2a8c5882e..fec274006 100644 --- a/VasEBoot-core/osdep/unix/hostdisk.c +++ b/VasEBoot-core/osdep/unix/hostdisk.c @@ -1,35 +1,35 @@ /* hostdisk.c - emulate biosdisk */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,21 +50,21 @@ # include #endif /* __linux__ */ -grub_uint64_t -grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize) +VasEBoot_uint64_t +VasEBoot_util_get_fd_size (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize) { struct stat st; - grub_int64_t ret = -1; + VasEBoot_int64_t ret = -1; if (fstat (fd, &st) < 0) /* TRANSLATORS: "stat" comes from the name of POSIX function. */ - grub_util_error (_("cannot stat `%s': %s"), name, strerror (errno)); -#if GRUB_DISK_DEVS_ARE_CHAR + VasEBoot_util_error (_("cannot stat `%s': %s"), name, strerror (errno)); +#if VasEBoot_DISK_DEVS_ARE_CHAR if (S_ISCHR (st.st_mode)) #else if (S_ISBLK (st.st_mode)) #endif - ret = grub_util_get_fd_size_os (fd, name, log_secsize); + ret = VasEBoot_util_get_fd_size_os (fd, name, log_secsize); if (ret != -1LL) return ret; @@ -75,7 +75,7 @@ grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsiz } int -grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) +VasEBoot_util_fd_seek (VasEBoot_util_fd_t fd, VasEBoot_uint64_t off) { off_t offset = (off_t) off; @@ -89,7 +89,7 @@ grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an error occurs, otherwise return LEN. */ ssize_t -grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len) +VasEBoot_util_fd_read (VasEBoot_util_fd_t fd, char *buf, size_t len) { ssize_t size = 0; @@ -119,7 +119,7 @@ grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len) /* Write LEN bytes from BUF to FD. Return less than or equal to zero if an error occurs, otherwise return LEN. */ ssize_t -grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len) +VasEBoot_util_fd_write (VasEBoot_util_fd_t fd, const char *buf, size_t len) { ssize_t size = 0; @@ -147,8 +147,8 @@ grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len) } #if !defined (__NetBSD__) && !defined (__APPLE__) && !defined (__FreeBSD__) && !defined(__FreeBSD_kernel__) -grub_util_fd_t -grub_util_fd_open (const char *os_dev, int flags) +VasEBoot_util_fd_t +VasEBoot_util_fd_open (const char *os_dev, int flags) { #ifdef O_LARGEFILE flags |= O_LARGEFILE; @@ -162,7 +162,7 @@ grub_util_fd_open (const char *os_dev, int flags) #endif const char * -grub_util_fd_strerror (void) +VasEBoot_util_fd_strerror (void) { return strerror (errno); } @@ -170,14 +170,14 @@ grub_util_fd_strerror (void) static int allow_fd_syncs = 1; void -grub_util_fd_sync (grub_util_fd_t fd) +VasEBoot_util_fd_sync (VasEBoot_util_fd_t fd) { if (allow_fd_syncs) fsync (fd); } void -grub_util_file_sync (FILE *f) +VasEBoot_util_file_sync (FILE *f) { fflush (f); if (!allow_fd_syncs) @@ -186,19 +186,19 @@ grub_util_file_sync (FILE *f) } void -grub_util_disable_fd_syncs (void) +VasEBoot_util_disable_fd_syncs (void) { allow_fd_syncs = 0; } void -grub_util_fd_close (grub_util_fd_t fd) +VasEBoot_util_fd_close (VasEBoot_util_fd_t fd) { close (fd); } char * -grub_canonicalize_file_name (const char *path) +VasEBoot_canonicalize_file_name (const char *path) { #if defined (PATH_MAX) char *ret; @@ -213,13 +213,13 @@ grub_canonicalize_file_name (const char *path) } FILE * -grub_util_fopen (const char *path, const char *mode) +VasEBoot_util_fopen (const char *path, const char *mode) { return fopen (path, mode); } int -grub_util_is_directory (const char *path) +VasEBoot_util_is_directory (const char *path) { struct stat st; @@ -230,7 +230,7 @@ grub_util_is_directory (const char *path) } int -grub_util_is_regular (const char *path) +VasEBoot_util_is_regular (const char *path) { struct stat st; @@ -240,8 +240,8 @@ grub_util_is_regular (const char *path) return S_ISREG (st.st_mode); } -grub_uint32_t -grub_util_get_mtime (const char *path) +VasEBoot_uint32_t +VasEBoot_util_get_mtime (const char *path) { struct stat st; @@ -256,7 +256,7 @@ grub_util_get_mtime (const char *path) #if defined (__CYGWIN__) || (!defined (__MINGW32__) && !defined (__AROS__)) int -grub_util_is_special_file (const char *path) +VasEBoot_util_is_special_file (const char *path) { struct stat st; @@ -267,7 +267,7 @@ grub_util_is_special_file (const char *path) char * -grub_util_make_temporary_file (void) +VasEBoot_util_make_temporary_file (void) { const char *t = getenv ("TMPDIR"); size_t tl; @@ -275,17 +275,17 @@ grub_util_make_temporary_file (void) if (!t) t = "/tmp"; tl = strlen (t); - tmp = xmalloc (tl + sizeof ("/grub.XXXXXX")); + tmp = xmalloc (tl + sizeof ("/VasEBoot.XXXXXX")); memcpy (tmp, t, tl); - memcpy (tmp + tl, "/grub.XXXXXX", - sizeof ("/grub.XXXXXX")); + memcpy (tmp + tl, "/VasEBoot.XXXXXX", + sizeof ("/VasEBoot.XXXXXX")); if (mkstemp (tmp) == -1) - grub_util_error (_("cannot make temporary file: %s"), strerror (errno)); + VasEBoot_util_error (_("cannot make temporary file: %s"), strerror (errno)); return tmp; } char * -grub_util_make_temporary_dir (void) +VasEBoot_util_make_temporary_dir (void) { const char *t = getenv ("TMPDIR"); size_t tl; @@ -293,12 +293,12 @@ grub_util_make_temporary_dir (void) if (!t) t = "/tmp"; tl = strlen (t); - tmp = xmalloc (tl + sizeof ("/grub.XXXXXX")); + tmp = xmalloc (tl + sizeof ("/VasEBoot.XXXXXX")); memcpy (tmp, t, tl); - memcpy (tmp + tl, "/grub.XXXXXX", - sizeof ("/grub.XXXXXX")); + memcpy (tmp + tl, "/VasEBoot.XXXXXX", + sizeof ("/VasEBoot.XXXXXX")); if (!mkdtemp (tmp)) - grub_util_error (_("cannot make temporary directory: %s"), + VasEBoot_util_error (_("cannot make temporary directory: %s"), strerror (errno)); return tmp; } diff --git a/VasEBoot-core/osdep/unix/password.c b/VasEBoot-core/osdep/unix/password.c index 9996b244b..c50cfa7d8 100644 --- a/VasEBoot-core/osdep/unix/password.c +++ b/VasEBoot-core/osdep/unix/password.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include @@ -27,14 +27,14 @@ #include int -grub_password_get (char buf[], unsigned buf_size) +VasEBoot_password_get (char buf[], unsigned buf_size) { FILE *in; struct termios s, t; int tty_changed = 0; char *ptr; - grub_refresh (); + VasEBoot_refresh (); /* Disable echoing. Based on glibc. */ in = fopen ("/dev/tty", "w+c"); @@ -51,7 +51,7 @@ grub_password_get (char buf[], unsigned buf_size) } else tty_changed = 0; - grub_memset (buf, 0, buf_size); + VasEBoot_memset (buf, 0, buf_size); if (!fgets (buf, buf_size, stdin)) { if (in != stdin) @@ -65,8 +65,8 @@ grub_password_get (char buf[], unsigned buf_size) if (tty_changed) (void) tcsetattr (fileno (in), TCSAFLUSH, &s); - grub_xputs ("\n"); - grub_refresh (); + VasEBoot_xputs ("\n"); + VasEBoot_refresh (); if (in != stdin) fclose (in); diff --git a/VasEBoot-core/osdep/unix/platform.c b/VasEBoot-core/osdep/unix/platform.c index a3fcfcaca..1d6a1f5df 100644 --- a/VasEBoot-core/osdep/unix/platform.c +++ b/VasEBoot-core/osdep/unix/platform.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -38,7 +38,7 @@ get_ofpathname (const char *dev) int fd; pid_t pid; - pid = grub_util_exec_pipe ((const char * []){ "ofpathname", dev, NULL }, &fd); + pid = VasEBoot_util_exec_pipe ((const char * []){ "ofpathname", dev, NULL }, &fd); if (!pid) goto fail; @@ -74,21 +74,21 @@ get_ofpathname (const char *dev) return ret; fail: - grub_util_error (_("couldn't find IEEE1275 device path for %s.\nYou will have to set `boot-device' variable manually"), + VasEBoot_util_error (_("couldn't find IEEE1275 device path for %s.\nYou will have to set `boot-device' variable manually"), dev); } static void -grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) +VasEBoot_install_remove_efi_entries_by_distributor (const char *efi_distributor) { int fd; - pid_t pid = grub_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd); + pid_t pid = VasEBoot_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd); char *line = NULL; size_t len = 0; if (!pid) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "efibootmgr", strerror (errno)); return; } @@ -96,7 +96,7 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) FILE *fp = fdopen (fd, "r"); if (!fp) { - grub_util_warn (_("Unable to open stream from %s: %s"), + VasEBoot_util_warn (_("Unable to open stream from %s: %s"), "efibootmgr", strerror (errno)); return; } @@ -110,7 +110,7 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) ret = getline (&line, &len, fp); if (ret == -1) break; - if (grub_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0 + if (VasEBoot_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0 || line[sizeof ("Boot") - 1] < '0' || line[sizeof ("Boot") - 1] > '9') continue; @@ -119,10 +119,10 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) bootnum = line + sizeof ("Boot") - 1; bootnum[4] = '\0'; if (!verbosity) - grub_util_exec ((const char * []){ "efibootmgr", "-q", + VasEBoot_util_exec ((const char * []){ "efibootmgr", "-q", "-b", bootnum, "-B", NULL }); else - grub_util_exec ((const char * []){ "efibootmgr", + VasEBoot_util_exec ((const char * []){ "efibootmgr", "-b", bootnum, "-B", NULL }); } @@ -130,39 +130,39 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) } void -grub_install_register_efi (grub_device_t efidir_grub_dev, +VasEBoot_install_register_efi (VasEBoot_device_t efidir_VasEBoot_dev, const char *efifile_path, const char *efi_distributor) { const char * efidir_disk; int efidir_part; - efidir_disk = grub_util_biosdisk_get_osdev (efidir_grub_dev->disk); - efidir_part = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1; + efidir_disk = VasEBoot_util_biosdisk_get_osdev (efidir_VasEBoot_dev->disk); + efidir_part = efidir_VasEBoot_dev->disk->partition ? efidir_VasEBoot_dev->disk->partition->number + 1 : 1; - if (grub_util_exec_redirect_null ((const char * []){ "efibootmgr", "--version", NULL })) + if (VasEBoot_util_exec_redirect_null ((const char * []){ "efibootmgr", "--version", NULL })) { /* TRANSLATORS: This message is shown when required executable `%s' isn't found. */ - grub_util_error (_("%s: not found"), "efibootmgr"); + VasEBoot_util_error (_("%s: not found"), "efibootmgr"); } /* On Linux, we need the efivars kernel modules. */ #ifdef __linux__ - grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL }); + VasEBoot_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL }); #endif /* Delete old entries from the same distributor. */ - grub_install_remove_efi_entries_by_distributor (efi_distributor); + VasEBoot_install_remove_efi_entries_by_distributor (efi_distributor); char *efidir_part_str = xasprintf ("%d", efidir_part); if (!verbosity) - grub_util_exec ((const char * []){ "efibootmgr", "-q", + VasEBoot_util_exec ((const char * []){ "efibootmgr", "-q", "-c", "-d", efidir_disk, "-p", efidir_part_str, "-w", "-L", efi_distributor, "-l", efifile_path, NULL }); else - grub_util_exec ((const char * []){ "efibootmgr", + VasEBoot_util_exec ((const char * []){ "efibootmgr", "-c", "-d", efidir_disk, "-p", efidir_part_str, "-w", "-L", efi_distributor, "-l", @@ -171,16 +171,16 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, } void -grub_install_register_ieee1275 (int is_prep, const char *install_device, +VasEBoot_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath) { char *boot_device; - if (grub_util_exec_redirect_null ((const char * []){ "ofpathname", "--version", NULL })) + if (VasEBoot_util_exec_redirect_null ((const char * []){ "ofpathname", "--version", NULL })) { /* TRANSLATORS: This message is shown when required executable `%s' isn't found. */ - grub_util_error (_("%s: not found"), "ofpathname"); + VasEBoot_util_error (_("%s: not found"), "ofpathname"); } /* Get the Open Firmware device tree path translation. */ @@ -194,9 +194,9 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device, boot_device = xmalloc (strlen (ofpath) + 1 + sizeof ("XXXXXXXXXXXXXXXXXXXX") + 1 + strlen (relpath) + 1); - ptr = grub_stpcpy (boot_device, ofpath); + ptr = VasEBoot_stpcpy (boot_device, ofpath); *ptr++ = ':'; - grub_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXXX"), "%d", + VasEBoot_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXXX"), "%d", partno); ptr += strlen (ptr); *ptr++ = ','; @@ -212,11 +212,11 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device, else boot_device = get_ofpathname (install_device); - if (grub_util_exec ((const char * []){ "nvsetenv", "boot-device", + if (VasEBoot_util_exec ((const char * []){ "nvsetenv", "boot-device", boot_device, NULL })) { char *cmd = xasprintf ("setenv boot-device %s", boot_device); - grub_util_error (_("`nvsetenv' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n"), + VasEBoot_util_error (_("`nvsetenv' failed. \nYou will have to set `boot-device' variable manually. At the IEEE1275 prompt, type:\n %s\n"), cmd); free (cmd); } @@ -225,11 +225,11 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device, } void -grub_install_sgi_setup (const char *install_device, +VasEBoot_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname) { - grub_util_exec ((const char * []){ "dvhtool", "-d", + VasEBoot_util_exec ((const char * []){ "dvhtool", "-d", install_device, "--unix-to-vh", imgfile, destname, NULL }); - grub_util_warn ("%s", _("You will have to set `SystemPartition' and `OSLoader' manually.")); + VasEBoot_util_warn ("%s", _("You will have to set `SystemPartition' and `OSLoader' manually.")); } diff --git a/VasEBoot-core/osdep/unix/random.c b/VasEBoot-core/osdep/unix/random.c index fa0101b0f..cb6d86b4f 100644 --- a/VasEBoot-core/osdep/unix/random.c +++ b/VasEBoot-core/osdep/unix/random.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1992-1999,2001,2003,2004,2005,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -31,12 +31,12 @@ #include int -grub_get_random (void *out, grub_size_t len) +VasEBoot_get_random (void *out, VasEBoot_size_t len) { FILE *f; size_t rd; - f = grub_util_fopen ("/dev/urandom", "rb"); + f = VasEBoot_util_fopen ("/dev/urandom", "rb"); if (!f) return 1; rd = fread (out, 1, len, f); diff --git a/VasEBoot-core/osdep/unix/relpath.c b/VasEBoot-core/osdep/unix/relpath.c index f719950fd..4877e032f 100644 --- a/VasEBoot-core/osdep/unix/relpath.c +++ b/VasEBoot-core/osdep/unix/relpath.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -26,15 +26,15 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include /* This function never prints trailing slashes (so that its output can be appended a slash unconditionally). */ char * -grub_make_system_path_relative_to_its_root (const char *path) +VasEBoot_make_system_path_relative_to_its_root (const char *path) { struct stat st; char *p, *buf, *buf2, *buf3, *ret; @@ -44,12 +44,12 @@ grub_make_system_path_relative_to_its_root (const char *path) char *poolfs = NULL; /* canonicalize. */ - p = grub_canonicalize_file_name (path); + p = VasEBoot_canonicalize_file_name (path); if (p == NULL) - grub_util_error (_("failed to get canonical path of `%s'"), path); + VasEBoot_util_error (_("failed to get canonical path of `%s'"), path); #ifdef __linux__ - ret = grub_make_system_path_relative_to_its_root_os (p); + ret = VasEBoot_make_system_path_relative_to_its_root_os (p); if (ret) { free (p); @@ -61,7 +61,7 @@ grub_make_system_path_relative_to_its_root (const char *path) #ifndef __HAIKU__ { char *dummy; - grub_find_zpool_from_dir (p, &dummy, &poolfs); + VasEBoot_find_zpool_from_dir (p, &dummy, &poolfs); } #endif @@ -70,7 +70,7 @@ grub_make_system_path_relative_to_its_root (const char *path) free (p); if (stat (buf, &st) < 0) - grub_util_error (_("cannot stat `%s': %s"), buf, strerror (errno)); + VasEBoot_util_error (_("cannot stat `%s': %s"), buf, strerror (errno)); buf2 = xstrdup (buf); num = st.st_dev; @@ -82,7 +82,7 @@ grub_make_system_path_relative_to_its_root (const char *path) p = strrchr (buf, '/'); if (p == NULL) /* This should never happen. */ - grub_util_error ("%s", + VasEBoot_util_error ("%s", /* TRANSLATORS: canonical pathname is the complete one e.g. /etc/fstab. It has to contain `/' normally, if it doesn't @@ -94,7 +94,7 @@ grub_make_system_path_relative_to_its_root (const char *path) *++p = 0; if (stat (buf, &st) < 0) - grub_util_error (_("cannot stat `%s': %s"), buf, strerror (errno)); + VasEBoot_util_error (_("cannot stat `%s': %s"), buf, strerror (errno)); /* buf is another filesystem; we found it. */ if (st.st_dev != num) diff --git a/VasEBoot-core/osdep/unix/sleep.c b/VasEBoot-core/osdep/unix/sleep.c index 5b00a38cd..92888afa5 100644 --- a/VasEBoot-core/osdep/unix/sleep.c +++ b/VasEBoot-core/osdep/unix/sleep.c @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include void -grub_millisleep (grub_uint32_t ms) +VasEBoot_millisleep (VasEBoot_uint32_t ms) { struct timespec ts; diff --git a/VasEBoot-core/osdep/windows/blocklist.c b/VasEBoot-core/osdep/windows/blocklist.c index 6d0809a48..cf615e2dd 100644 --- a/VasEBoot-core/osdep/windows/blocklist.c +++ b/VasEBoot-core/osdep/windows/blocklist.c @@ -1,102 +1,102 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include void -grub_install_get_blocklist (grub_device_t root_dev, +VasEBoot_install_get_blocklist (VasEBoot_device_t root_dev, const char *core_path, const char *core_img __attribute__ ((unused)), size_t core_size, - void (*callback) (grub_disk_addr_t sector, + void (*callback) (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data), void *hook_data) { - grub_disk_addr_t first_lcn = 0; + VasEBoot_disk_addr_t first_lcn = 0; HANDLE filehd; DWORD rets; RETRIEVAL_POINTERS_BUFFER *extbuf; size_t extbuf_size; DWORD i; - grub_uint64_t sec_per_lcn; - grub_uint64_t curvcn = 0; + VasEBoot_uint64_t sec_per_lcn; + VasEBoot_uint64_t curvcn = 0; STARTING_VCN_INPUT_BUFFER start_vcn; - grub_fs_t fs; - grub_err_t err; + VasEBoot_fs_t fs; + VasEBoot_err_t err; - fs = grub_fs_probe (root_dev); + fs = VasEBoot_fs_probe (root_dev); if (!fs) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); /* This is ugly but windows doesn't give all needed data. Or does anyone have a pointer how to retrieve it? */ - if (grub_strcmp (fs->name, "ntfs") == 0) + if (VasEBoot_strcmp (fs->name, "ntfs") == 0) { - struct grub_ntfs_bpb bpb; - err = grub_disk_read (root_dev->disk, 0, 0, sizeof (bpb), &bpb); + struct VasEBoot_ntfs_bpb bpb; + err = VasEBoot_disk_read (root_dev->disk, 0, 0, sizeof (bpb), &bpb); if (err) - grub_util_error ("%s", grub_errmsg); - sec_per_lcn = ((grub_uint32_t) bpb.sectors_per_cluster - * (grub_uint32_t) grub_le_to_cpu16 (bpb.bytes_per_sector)) + VasEBoot_util_error ("%s", VasEBoot_errmsg); + sec_per_lcn = ((VasEBoot_uint32_t) bpb.sectors_per_cluster + * (VasEBoot_uint32_t) VasEBoot_le_to_cpu16 (bpb.bytes_per_sector)) >> 9; first_lcn = 0; } - else if (grub_strcmp (fs->name, "exfat") == 0) - first_lcn = grub_exfat_get_cluster_sector (root_dev->disk, &sec_per_lcn); - else if (grub_strcmp (fs->name, "fat") == 0) - first_lcn = grub_fat_get_cluster_sector (root_dev->disk, &sec_per_lcn); - else if (grub_strcmp (fs->name, "udf") == 0) - first_lcn = grub_udf_get_cluster_sector (root_dev->disk, &sec_per_lcn); + else if (VasEBoot_strcmp (fs->name, "exfat") == 0) + first_lcn = VasEBoot_exfat_get_cluster_sector (root_dev->disk, &sec_per_lcn); + else if (VasEBoot_strcmp (fs->name, "fat") == 0) + first_lcn = VasEBoot_fat_get_cluster_sector (root_dev->disk, &sec_per_lcn); + else if (VasEBoot_strcmp (fs->name, "udf") == 0) + first_lcn = VasEBoot_udf_get_cluster_sector (root_dev->disk, &sec_per_lcn); else - grub_util_error ("unsupported fs for blocklist on windows: %s", + VasEBoot_util_error ("unsupported fs for blocklist on windows: %s", fs->name); - grub_util_info ("sec_per_lcn = %" GRUB_HOST_PRIuLONG_LONG - ", first_lcn=%" GRUB_HOST_PRIuLONG_LONG, + VasEBoot_util_info ("sec_per_lcn = %" VasEBoot_HOST_PRIuLONG_LONG + ", first_lcn=%" VasEBoot_HOST_PRIuLONG_LONG, (unsigned long long) sec_per_lcn, (unsigned long long) first_lcn); - first_lcn += grub_partition_get_start (root_dev->disk->partition); + first_lcn += VasEBoot_partition_get_start (root_dev->disk->partition); start_vcn.StartingVcn.QuadPart = 0; - filehd = grub_util_fd_open (core_path, GRUB_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID (filehd)) - grub_util_error (_("cannot open `%s': %s"), core_path, - grub_util_fd_strerror ()); + filehd = VasEBoot_util_fd_open (core_path, VasEBoot_UTIL_FD_O_RDONLY); + if (!VasEBoot_UTIL_FD_IS_VALID (filehd)) + VasEBoot_util_error (_("cannot open `%s': %s"), core_path, + VasEBoot_util_fd_strerror ()); extbuf_size = sizeof (*extbuf) + sizeof (extbuf->Extents[0]) * ((core_size + 511) / 512); @@ -105,8 +105,8 @@ grub_install_get_blocklist (grub_device_t root_dev, if (!DeviceIoControl(filehd, FSCTL_GET_RETRIEVAL_POINTERS, &start_vcn, sizeof (start_vcn), extbuf, extbuf_size, &rets, NULL)) - grub_util_error ("FSCTL_GET_RETRIEVAL_POINTERS fails: %s", - grub_util_fd_strerror ()); + VasEBoot_util_error ("FSCTL_GET_RETRIEVAL_POINTERS fails: %s", + VasEBoot_util_fd_strerror ()); CloseHandle (filehd); diff --git a/VasEBoot-core/osdep/windows/config.c b/VasEBoot-core/osdep/windows/config.c index 928ab1a49..fa5fb5c38 100644 --- a/VasEBoot-core/osdep/windows/config.c +++ b/VasEBoot-core/osdep/windows/config.c @@ -1,57 +1,57 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include +#include +#include +#include +#include void -grub_util_load_config (struct grub_util_config *cfg) +VasEBoot_util_load_config (struct VasEBoot_util_config *cfg) { const char *cfgfile; FILE *f = NULL; const char *v; - cfgfile = grub_util_get_config_filename (); - if (!grub_util_is_regular (cfgfile)) + cfgfile = VasEBoot_util_get_config_filename (); + if (!VasEBoot_util_is_regular (cfgfile)) return; memset (cfg, 0, sizeof (*cfg)); - v = getenv ("GRUB_ENABLE_CRYPTODISK"); + v = getenv ("VasEBoot_ENABLE_CRYPTODISK"); if (v && v[0] == 'y' && v[1] == '\0') cfg->is_cryptodisk_enabled = 1; - v = getenv ("GRUB_DISTRIBUTOR"); + v = getenv ("VasEBoot_DISTRIBUTOR"); if (v) - cfg->grub_distributor = xstrdup (v); + cfg->VasEBoot_distributor = xstrdup (v); - f = grub_util_fopen (cfgfile, "r"); + f = VasEBoot_util_fopen (cfgfile, "r"); if (f) { - grub_util_parse_config (f, cfg, 0); + VasEBoot_util_parse_config (f, cfg, 0); fclose (f); } else - grub_util_warn (_("cannot open configuration file `%s': %s"), + VasEBoot_util_warn (_("cannot open configuration file `%s': %s"), cfgfile, strerror (errno)); } diff --git a/VasEBoot-core/osdep/windows/cputime.c b/VasEBoot-core/osdep/windows/cputime.c index 3568aa2d3..c78343c00 100644 --- a/VasEBoot-core/osdep/windows/cputime.c +++ b/VasEBoot-core/osdep/windows/cputime.c @@ -1,11 +1,11 @@ #include #include -#include +#include #include -grub_uint64_t -grub_util_get_cpu_time_ms (void) +VasEBoot_uint64_t +VasEBoot_util_get_cpu_time_ms (void) { FILETIME cr, ex, ke, us; ULARGE_INTEGER us_ul; diff --git a/VasEBoot-core/osdep/windows/dl.c b/VasEBoot-core/osdep/windows/dl.c index eec6a24ad..3b61f9444 100644 --- a/VasEBoot-core/osdep/windows/dl.c +++ b/VasEBoot-core/osdep/windows/dl.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include +#include +#include +#include #include #include #include void * -grub_osdep_dl_memalign (grub_size_t align, grub_size_t size) +VasEBoot_osdep_dl_memalign (VasEBoot_size_t align, VasEBoot_size_t size) { void *ret; if (align > 4096) { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "too large alignment"); + VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "too large alignment"); return NULL; } @@ -43,7 +43,7 @@ grub_osdep_dl_memalign (grub_size_t align, grub_size_t size) if (!ret) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); + VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("out of memory")); return NULL; } @@ -51,7 +51,7 @@ grub_osdep_dl_memalign (grub_size_t align, grub_size_t size) } void -grub_dl_osdep_dl_free (void *ptr) +VasEBoot_dl_osdep_dl_free (void *ptr) { if (!ptr) return; diff --git a/VasEBoot-core/osdep/windows/emuconsole.c b/VasEBoot-core/osdep/windows/emuconsole.c index 4fb3693cc..457373609 100644 --- a/VasEBoot-core/osdep/windows/emuconsole.c +++ b/VasEBoot-core/osdep/windows/emuconsole.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include @@ -34,8 +34,8 @@ static int saved_orig; static void -grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c) +VasEBoot_console_putchar (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c) { TCHAR str[2 + 30]; unsigned i, j; @@ -49,7 +49,7 @@ grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), j = 1; for (i = 0; i < c->ncomb && j+1 < ARRAY_SIZE (str); i++) if (c->base < 0xffff) - str[j++] = grub_unicode_get_comb (c)[i].code; + str[j++] = VasEBoot_unicode_get_comb (c)[i].code; str[j] = 0; WriteConsole (hStdout, str, j, &written, NULL); @@ -57,32 +57,32 @@ grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), const unsigned windows_codes[] = { - /* 0x21 */ [VK_PRIOR] = GRUB_TERM_KEY_PPAGE, - /* 0x22 */ [VK_NEXT] = GRUB_TERM_KEY_NPAGE, - /* 0x23 */ [VK_END] = GRUB_TERM_KEY_END, - /* 0x24 */ [VK_HOME] = GRUB_TERM_KEY_HOME, - /* 0x25 */ [VK_LEFT] = GRUB_TERM_KEY_LEFT, - /* 0x26 */ [VK_UP] = GRUB_TERM_KEY_UP, - /* 0x27 */ [VK_RIGHT] = GRUB_TERM_KEY_RIGHT, - /* 0x28 */ [VK_DOWN] = GRUB_TERM_KEY_DOWN, - /* 0x2e */ [VK_DELETE] = GRUB_TERM_KEY_DC, - /* 0x70 */ [VK_F1] = GRUB_TERM_KEY_F1, - /* 0x71 */ [VK_F2] = GRUB_TERM_KEY_F2, - /* 0x72 */ [VK_F3] = GRUB_TERM_KEY_F3, - /* 0x73 */ [VK_F4] = GRUB_TERM_KEY_F4, - /* 0x74 */ [VK_F5] = GRUB_TERM_KEY_F5, - /* 0x75 */ [VK_F6] = GRUB_TERM_KEY_F6, - /* 0x76 */ [VK_F7] = GRUB_TERM_KEY_F7, - /* 0x77 */ [VK_F8] = GRUB_TERM_KEY_F8, - /* 0x78 */ [VK_F9] = GRUB_TERM_KEY_F9, - /* 0x79 */ [VK_F10] = GRUB_TERM_KEY_F10, - /* 0x7a */ [VK_F11] = GRUB_TERM_KEY_F11, - /* 0x7b */ [VK_F12] = GRUB_TERM_KEY_F12, + /* 0x21 */ [VK_PRIOR] = VasEBoot_TERM_KEY_PPAGE, + /* 0x22 */ [VK_NEXT] = VasEBoot_TERM_KEY_NPAGE, + /* 0x23 */ [VK_END] = VasEBoot_TERM_KEY_END, + /* 0x24 */ [VK_HOME] = VasEBoot_TERM_KEY_HOME, + /* 0x25 */ [VK_LEFT] = VasEBoot_TERM_KEY_LEFT, + /* 0x26 */ [VK_UP] = VasEBoot_TERM_KEY_UP, + /* 0x27 */ [VK_RIGHT] = VasEBoot_TERM_KEY_RIGHT, + /* 0x28 */ [VK_DOWN] = VasEBoot_TERM_KEY_DOWN, + /* 0x2e */ [VK_DELETE] = VasEBoot_TERM_KEY_DC, + /* 0x70 */ [VK_F1] = VasEBoot_TERM_KEY_F1, + /* 0x71 */ [VK_F2] = VasEBoot_TERM_KEY_F2, + /* 0x72 */ [VK_F3] = VasEBoot_TERM_KEY_F3, + /* 0x73 */ [VK_F4] = VasEBoot_TERM_KEY_F4, + /* 0x74 */ [VK_F5] = VasEBoot_TERM_KEY_F5, + /* 0x75 */ [VK_F6] = VasEBoot_TERM_KEY_F6, + /* 0x76 */ [VK_F7] = VasEBoot_TERM_KEY_F7, + /* 0x77 */ [VK_F8] = VasEBoot_TERM_KEY_F8, + /* 0x78 */ [VK_F9] = VasEBoot_TERM_KEY_F9, + /* 0x79 */ [VK_F10] = VasEBoot_TERM_KEY_F10, + /* 0x7a */ [VK_F11] = VasEBoot_TERM_KEY_F11, + /* 0x7b */ [VK_F12] = VasEBoot_TERM_KEY_F12, }; static int -grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) +VasEBoot_console_getkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { while (1) { @@ -91,14 +91,14 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) int ret; if (!GetNumberOfConsoleInputEvents (hStdin, &nev)) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; if (nev == 0) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; if (!ReadConsoleInput (hStdin, &ir, 1, &nev)) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; if (ir.EventType != KEY_EVENT) continue; @@ -114,21 +114,21 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) else continue; if (ir.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED) - ret |= GRUB_TERM_SHIFT; + ret |= VasEBoot_TERM_SHIFT; } /* Workaround for AltGr bug. */ if (ir.Event.KeyEvent.dwControlKeyState & RIGHT_ALT_PRESSED) return ret; if (ir.Event.KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) - ret |= GRUB_TERM_ALT; + ret |= VasEBoot_TERM_ALT; if (ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) - ret |= GRUB_TERM_CTRL; + ret |= VasEBoot_TERM_CTRL; return ret; } } -static struct grub_term_coordinate -grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_console_getwh (struct VasEBoot_term_output *term __attribute__ ((unused))) { CONSOLE_SCREEN_BUFFER_INFO csbi; @@ -137,22 +137,22 @@ grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) GetConsoleScreenBufferInfo (hStdout, &csbi); - return (struct grub_term_coordinate) { csbi.dwSize.X, csbi.dwSize.Y }; + return (struct VasEBoot_term_coordinate) { csbi.dwSize.X, csbi.dwSize.Y }; } -static struct grub_term_coordinate -grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_console_getxy (struct VasEBoot_term_output *term __attribute__ ((unused))) { CONSOLE_SCREEN_BUFFER_INFO csbi; GetConsoleScreenBufferInfo (hStdout, &csbi); - return (struct grub_term_coordinate) { csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y }; + return (struct VasEBoot_term_coordinate) { csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y }; } static void -grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), - struct grub_term_coordinate pos) +VasEBoot_console_gotoxy (struct VasEBoot_term_output *term __attribute__ ((unused)), + struct VasEBoot_term_coordinate pos) { COORD coord = { pos.x, pos.y }; @@ -160,12 +160,12 @@ grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), } static void -grub_console_cls (struct grub_term_output *term) +VasEBoot_console_cls (struct VasEBoot_term_output *term) { int tsz; CONSOLE_SCREEN_BUFFER_INFO csbi; - struct grub_unicode_glyph c = + struct VasEBoot_unicode_glyph c = { .base = ' ', .variant = 0, @@ -177,33 +177,33 @@ grub_console_cls (struct grub_term_output *term) GetConsoleScreenBufferInfo (hStdout, &csbi); SetConsoleTextAttribute (hStdout, 0); - grub_console_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); + VasEBoot_console_gotoxy (term, (struct VasEBoot_term_coordinate) { 0, 0 }); tsz = csbi.dwSize.X * csbi.dwSize.Y; while (tsz--) - grub_console_putchar (term, &c); + VasEBoot_console_putchar (term, &c); - grub_console_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); + VasEBoot_console_gotoxy (term, (struct VasEBoot_term_coordinate) { 0, 0 }); SetConsoleTextAttribute (hStdout, csbi.wAttributes); } static void -grub_console_setcolorstate (struct grub_term_output *term +VasEBoot_console_setcolorstate (struct VasEBoot_term_output *term __attribute__ ((unused)), - grub_term_color_state state) + VasEBoot_term_color_state state) { switch (state) { - case GRUB_TERM_COLOR_STANDARD: - SetConsoleTextAttribute (hStdout, GRUB_TERM_DEFAULT_STANDARD_COLOR + case VasEBoot_TERM_COLOR_STANDARD: + SetConsoleTextAttribute (hStdout, VasEBoot_TERM_DEFAULT_STANDARD_COLOR & 0x7f); break; - case GRUB_TERM_COLOR_NORMAL: - SetConsoleTextAttribute (hStdout, grub_term_normal_color & 0x7f); + case VasEBoot_TERM_COLOR_NORMAL: + SetConsoleTextAttribute (hStdout, VasEBoot_term_normal_color & 0x7f); break; - case GRUB_TERM_COLOR_HIGHLIGHT: - SetConsoleTextAttribute (hStdout, grub_term_highlight_color & 0x7f); + case VasEBoot_TERM_COLOR_HIGHLIGHT: + SetConsoleTextAttribute (hStdout, VasEBoot_term_highlight_color & 0x7f); break; default: break; @@ -211,7 +211,7 @@ grub_console_setcolorstate (struct grub_term_output *term } static void -grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), +VasEBoot_console_setcursor (struct VasEBoot_term_output *term __attribute__ ((unused)), int on) { CONSOLE_CURSOR_INFO ci; @@ -220,23 +220,23 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), SetConsoleCursorInfo (hStdout, &ci); } -static grub_err_t -grub_efi_console_init (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_efi_console_init (struct VasEBoot_term_output *term) { - grub_console_setcursor (term, 1); + VasEBoot_console_setcursor (term, 1); return 0; } -static grub_err_t -grub_efi_console_fini (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_efi_console_fini (struct VasEBoot_term_output *term) { - grub_console_setcursor (term, 1); + VasEBoot_console_setcursor (term, 1); return 0; } -static grub_err_t -grub_console_init_input (struct grub_term_input *term) +static VasEBoot_err_t +VasEBoot_console_init_input (struct VasEBoot_term_input *term) { if (!saved_orig) { @@ -248,61 +248,61 @@ grub_console_init_input (struct grub_term_input *term) SetConsoleMode (hStdin, orig_mode & ~ENABLE_ECHO_INPUT & ~ENABLE_LINE_INPUT & ~ENABLE_PROCESSED_INPUT); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_console_fini_input (struct grub_term_input *term +static VasEBoot_err_t +VasEBoot_console_fini_input (struct VasEBoot_term_input *term __attribute__ ((unused))) { SetConsoleMode (hStdin, orig_mode); saved_orig = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_term_input grub_console_term_input = +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", - .getkey = grub_console_getkey, - .init = grub_console_init_input, - .fini = grub_console_fini_input, + .getkey = VasEBoot_console_getkey, + .init = VasEBoot_console_init_input, + .fini = VasEBoot_console_fini_input, }; -static struct grub_term_output grub_console_term_output = +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", - .init = grub_efi_console_init, - .fini = grub_efi_console_fini, - .putchar = grub_console_putchar, - .getwh = grub_console_getwh, - .getxy = grub_console_getxy, - .gotoxy = grub_console_gotoxy, - .cls = grub_console_cls, - .setcolorstate = grub_console_setcolorstate, - .setcursor = grub_console_setcursor, - .flags = GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS, - .progress_update_divisor = GRUB_PROGRESS_FAST + .init = VasEBoot_efi_console_init, + .fini = VasEBoot_efi_console_fini, + .putchar = VasEBoot_console_putchar, + .getwh = VasEBoot_console_getwh, + .getxy = VasEBoot_console_getxy, + .gotoxy = VasEBoot_console_gotoxy, + .cls = VasEBoot_console_cls, + .setcolorstate = VasEBoot_console_setcolorstate, + .setcursor = VasEBoot_console_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init (void) +VasEBoot_console_init (void) { hStdin = GetStdHandle (STD_INPUT_HANDLE); hStdout = GetStdHandle (STD_OUTPUT_HANDLE); - grub_term_register_input ("console", &grub_console_term_input); - grub_term_register_output ("console", &grub_console_term_output); + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); } void -grub_console_fini (void) +VasEBoot_console_fini (void) { if (saved_orig) { SetConsoleMode (hStdin, orig_mode); saved_orig = 0; } - grub_term_unregister_input (&grub_console_term_input); - grub_term_unregister_output (&grub_console_term_output); + VasEBoot_term_unregister_input (&VasEBoot_console_term_input); + VasEBoot_term_unregister_output (&VasEBoot_console_term_output); } diff --git a/VasEBoot-core/osdep/windows/getroot.c b/VasEBoot-core/osdep/windows/getroot.c index 661d95461..6cc477474 100644 --- a/VasEBoot-core/osdep/windows/getroot.c +++ b/VasEBoot-core/osdep/windows/getroot.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,22 +35,22 @@ #include #endif -#include +#include -#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include TCHAR * -grub_get_mount_point (const TCHAR *path) +VasEBoot_get_mount_point (const TCHAR *path) { const TCHAR *ptr; TCHAR *out; @@ -102,23 +102,23 @@ grub_get_mount_point (const TCHAR *path) } char ** -grub_guess_root_devices (const char *dir) +VasEBoot_guess_root_devices (const char *dir) { char **os_dev = NULL; TCHAR *dirwindows, *mntpointwindows; TCHAR *ptr; TCHAR volumename[100]; - dirwindows = grub_util_get_windows_path (dir); + dirwindows = VasEBoot_util_get_windows_path (dir); if (!dirwindows) return 0; - mntpointwindows = grub_get_mount_point (dirwindows); + mntpointwindows = VasEBoot_get_mount_point (dirwindows); if (!mntpointwindows) { free (dirwindows); - grub_util_info ("can't get volume path name: %d", (int) GetLastError ()); + VasEBoot_util_info ("can't get volume path name: %d", (int) GetLastError ()); return 0; } @@ -170,7 +170,7 @@ grub_guess_root_devices (const char *dir) while (ptr > volumename && *(ptr - 1) == '\\') *--ptr = '\0'; - os_dev[0] = grub_util_tchar_to_utf8 (volumename); + os_dev[0] = VasEBoot_util_tchar_to_utf8 (volumename); free (dirwindows); free (mntpointwindows); @@ -211,12 +211,12 @@ static int tcharncasecmp (LPCTSTR a, const char *b, size_t sz) } char * -grub_util_part_to_disk (const char *os_dev, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st __attribute__ ((unused)), int *is_part) { HANDLE hd; - LPTSTR name = grub_util_get_windows_path (os_dev); + LPTSTR name = VasEBoot_util_get_windows_path (os_dev); VOLUME_DISK_EXTENTS exts; DWORD extsbytes; char *ret; @@ -230,8 +230,8 @@ grub_util_part_to_disk (const char *os_dev, || ((name[4] == 'A' || name[4] == 'a' || name[4] == 'B' || name[4] == 'b') && name[5] == ':' && name[6] == '\0'))) { - grub_util_info ("Matches full disk pattern"); - ret = grub_util_tchar_to_utf8 (name); + VasEBoot_util_info ("Matches full disk pattern"); + ret = VasEBoot_util_tchar_to_utf8 (name); free (name); return ret; } @@ -240,8 +240,8 @@ grub_util_part_to_disk (const char *os_dev, 0, OPEN_EXISTING, 0, 0); if (hd == INVALID_HANDLE_VALUE) { - grub_util_info ("CreateFile failed"); - ret = grub_util_tchar_to_utf8 (name); + VasEBoot_util_info ("CreateFile failed"); + ret = VasEBoot_util_tchar_to_utf8 (name); free (name); return ret; } @@ -249,8 +249,8 @@ grub_util_part_to_disk (const char *os_dev, if (!DeviceIoControl(hd, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, &exts, sizeof (exts), &extsbytes, NULL)) { - grub_util_info ("IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS failed"); - ret = grub_util_tchar_to_utf8 (name); + VasEBoot_util_info ("IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS failed"); + ret = VasEBoot_util_tchar_to_utf8 (name); CloseHandle (hd); free (name); return ret; @@ -263,31 +263,31 @@ grub_util_part_to_disk (const char *os_dev, return xasprintf ("\\\\?\\PhysicalDrive%lu", (unsigned long) exts.Extents[0].DiskNumber); } -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused))) { - return GRUB_DEV_ABSTRACTION_NONE; + return VasEBoot_DEV_ABSTRACTION_NONE; } int -grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)), - enum grub_dev_abstraction_types ab __attribute__ ((unused))) +VasEBoot_util_pull_device_os (const char *os_dev __attribute__ ((unused)), + enum VasEBoot_dev_abstraction_types ab __attribute__ ((unused))) { return 0; } char * -grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused))) +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev __attribute__ ((unused))) { return NULL; } -grub_disk_addr_t -grub_util_find_partition_start_os (const char *os_dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *os_dev) { HANDLE hd; - LPTSTR name = grub_util_get_windows_path (os_dev); + LPTSTR name = VasEBoot_util_get_windows_path (os_dev); VOLUME_DISK_EXTENTS exts; DWORD extsbytes; char *ret; @@ -301,7 +301,7 @@ grub_util_find_partition_start_os (const char *os_dev) || ((name[4] == 'A' || name[4] == 'a' || name[4] == 'B' || name[4] == 'b') && name[5] == ':' && name[6] == '\0'))) { - ret = grub_util_tchar_to_utf8 (name); + ret = VasEBoot_util_tchar_to_utf8 (name); free (name); return 0; } @@ -310,7 +310,7 @@ grub_util_find_partition_start_os (const char *os_dev) 0, OPEN_EXISTING, 0, 0); if (hd == INVALID_HANDLE_VALUE) { - ret = grub_util_tchar_to_utf8 (name); + ret = VasEBoot_util_tchar_to_utf8 (name); free (name); return 0; } @@ -318,7 +318,7 @@ grub_util_find_partition_start_os (const char *os_dev) if (!DeviceIoControl(hd, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, &exts, sizeof (exts), &extsbytes, NULL)) { - ret = grub_util_tchar_to_utf8 (name); + ret = VasEBoot_util_tchar_to_utf8 (name); CloseHandle (hd); free (name); return 0; @@ -330,18 +330,18 @@ grub_util_find_partition_start_os (const char *os_dev) } int -grub_util_biosdisk_is_floppy (grub_disk_t disk) +VasEBoot_util_biosdisk_is_floppy (VasEBoot_disk_t disk) { int ret; const char *dname; LPTSTR name; - dname = grub_util_biosdisk_get_osdev (disk); + dname = VasEBoot_util_biosdisk_get_osdev (disk); if (!dname) return 0; - name = grub_util_get_windows_path (dname); + name = VasEBoot_util_get_windows_path (dname); ret = (((name[0] == '/') || (name[0] == '\\')) && ((name[1] == '/') || (name[1] == '\\')) && diff --git a/VasEBoot-core/osdep/windows/hostdisk.c b/VasEBoot-core/osdep/windows/hostdisk.c index 85507af88..37a8f826d 100644 --- a/VasEBoot-core/osdep/windows/hostdisk.c +++ b/VasEBoot-core/osdep/windows/hostdisk.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,8 +41,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -55,13 +55,13 @@ #if SIZEOF_TCHAR == 1 LPTSTR -grub_util_utf8_to_tchar (const char *in) +VasEBoot_util_utf8_to_tchar (const char *in) { return xstrdup (in); } char * -grub_util_tchar_to_utf8 (LPCTSTR in) +VasEBoot_util_tchar_to_utf8 (LPCTSTR in) { return xstrdup (in); } @@ -69,27 +69,27 @@ grub_util_tchar_to_utf8 (LPCTSTR in) #elif SIZEOF_TCHAR == 2 LPTSTR -grub_util_utf8_to_tchar (const char *in) +VasEBoot_util_utf8_to_tchar (const char *in) { LPTSTR ret; size_t ssz = strlen (in); - size_t tsz = 2 * (GRUB_MAX_UTF16_PER_UTF8 * ssz + 1); + size_t tsz = 2 * (VasEBoot_MAX_UTF16_PER_UTF8 * ssz + 1); ret = xmalloc (tsz); - tsz = grub_utf8_to_utf16 (ret, tsz, - (const grub_uint8_t *) in, ssz, NULL); + tsz = VasEBoot_utf8_to_utf16 (ret, tsz, + (const VasEBoot_uint8_t *) in, ssz, NULL); ret[tsz] = 0; return ret; } char * -grub_util_tchar_to_utf8 (LPCTSTR in) +VasEBoot_util_tchar_to_utf8 (LPCTSTR in) { size_t ssz; for (ssz = 0; in[ssz]; ssz++); - size_t tsz = GRUB_MAX_UTF8_PER_UTF16 * ssz + 1; - grub_uint8_t *ret = xmalloc (tsz); - *grub_utf16_to_utf8 (ret, in, ssz) = '\0'; + size_t tsz = VasEBoot_MAX_UTF8_PER_UTF16 * ssz + 1; + VasEBoot_uint8_t *ret = xmalloc (tsz); + *VasEBoot_utf16_to_utf8 (ret, in, ssz) = '\0'; return (char *) ret; } @@ -99,13 +99,13 @@ grub_util_tchar_to_utf8 (LPCTSTR in) static LPTSTR -grub_util_get_windows_path_real (const char *path) +VasEBoot_util_get_windows_path_real (const char *path) { LPTSTR fpa; LPTSTR tpath; size_t alloc, len; - tpath = grub_util_utf8_to_tchar (path); + tpath = VasEBoot_util_utf8_to_tchar (path); alloc = PATH_MAX; @@ -133,7 +133,7 @@ grub_util_get_windows_path_real (const char *path) #ifdef __CYGWIN__ LPTSTR -grub_util_get_windows_path (const char *path) +VasEBoot_util_get_windows_path (const char *path) { LPTSTR winpath; /* Workaround cygwin bugs with //?/. */ @@ -141,31 +141,31 @@ grub_util_get_windows_path (const char *path) && (path[1] == '\\' || path[1] == '/') && (path[2] == '?' || path[2] == '.') && (path[3] == '\\' || path[3] == '/')) - return grub_util_get_windows_path_real (path); + return VasEBoot_util_get_windows_path_real (path); winpath = xmalloc (sizeof (winpath[0]) * PATH_MAX); memset (winpath, 0, sizeof (winpath[0]) * PATH_MAX); if (cygwin_conv_path ((sizeof (winpath[0]) == 1 ? CCP_POSIX_TO_WIN_A : CCP_POSIX_TO_WIN_W) | CCP_ABSOLUTE, path, winpath, sizeof (winpath[0]) * PATH_MAX)) - grub_util_error ("%s", _("cygwin_conv_path() failed")); + VasEBoot_util_error ("%s", _("cygwin_conv_path() failed")); return winpath; } #else LPTSTR -grub_util_get_windows_path (const char *path) +VasEBoot_util_get_windows_path (const char *path) { - return grub_util_get_windows_path_real (path); + return VasEBoot_util_get_windows_path_real (path); } #endif -grub_uint64_t -grub_util_get_fd_size (grub_util_fd_t hd, const char *name_in, +VasEBoot_uint64_t +VasEBoot_util_get_fd_size (VasEBoot_util_fd_t hd, const char *name_in, unsigned *log_secsize) { - grub_int64_t size = -1LL; + VasEBoot_int64_t size = -1LL; int log_sector_size = 9; - LPTSTR name = grub_util_get_windows_path (name_in); + LPTSTR name = VasEBoot_util_get_windows_path (name_in); if (log_secsize) *log_secsize = log_sector_size; @@ -208,12 +208,12 @@ grub_util_get_fd_size (grub_util_fd_t hd, const char *name_in, } void -grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused))) { } int -grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) +VasEBoot_util_fd_seek (VasEBoot_util_fd_t fd, VasEBoot_uint64_t off) { LARGE_INTEGER offset; offset.QuadPart = off; @@ -223,19 +223,19 @@ grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) return 0; } -grub_util_fd_t -grub_util_fd_open (const char *os_dev, int flags) +VasEBoot_util_fd_t +VasEBoot_util_fd_open (const char *os_dev, int flags) { DWORD flg = 0, crt; - LPTSTR dev = grub_util_get_windows_path (os_dev); - grub_util_fd_t ret; + LPTSTR dev = VasEBoot_util_get_windows_path (os_dev); + VasEBoot_util_fd_t ret; - if (flags & GRUB_UTIL_FD_O_WRONLY) + if (flags & VasEBoot_UTIL_FD_O_WRONLY) flg |= GENERIC_WRITE; - if (flags & GRUB_UTIL_FD_O_RDONLY) + if (flags & VasEBoot_UTIL_FD_O_RDONLY) flg |= GENERIC_READ; - if (flags & GRUB_UTIL_FD_O_CREATTRUNC) + if (flags & VasEBoot_UTIL_FD_O_CREATTRUNC) crt = CREATE_ALWAYS; else crt = OPEN_EXISTING; @@ -247,55 +247,55 @@ grub_util_fd_open (const char *os_dev, int flags) } ssize_t -grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len) +VasEBoot_util_fd_read (VasEBoot_util_fd_t fd, char *buf, size_t len) { DWORD real_read; if (!ReadFile(fd, buf, len, &real_read, NULL)) { - grub_util_info ("read err %x", (int) GetLastError ()); + VasEBoot_util_info ("read err %x", (int) GetLastError ()); return -1; } - grub_util_info ("successful read"); + VasEBoot_util_info ("successful read"); return real_read; } ssize_t -grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len) +VasEBoot_util_fd_write (VasEBoot_util_fd_t fd, const char *buf, size_t len) { DWORD real_read; if (!WriteFile(fd, buf, len, &real_read, NULL)) { - grub_util_info ("write err %x", (int) GetLastError ()); + VasEBoot_util_info ("write err %x", (int) GetLastError ()); return -1; } - grub_util_info ("successful write"); + VasEBoot_util_info ("successful write"); return real_read; } static int allow_fd_syncs = 1; void -grub_util_fd_sync (grub_util_fd_t fd) +VasEBoot_util_fd_sync (VasEBoot_util_fd_t fd) { if (allow_fd_syncs) FlushFileBuffers (fd); } void -grub_util_disable_fd_syncs (void) +VasEBoot_util_disable_fd_syncs (void) { allow_fd_syncs = 0; } void -grub_util_fd_close (grub_util_fd_t fd) +VasEBoot_util_fd_close (VasEBoot_util_fd_t fd) { CloseHandle (fd); } const char * -grub_util_fd_strerror (void) +VasEBoot_util_fd_strerror (void) { DWORD err = GetLastError (); LPTSTR tstr = NULL; @@ -313,7 +313,7 @@ grub_util_fd_strerror (void) if (!tstr) return "unknown error"; - ret = grub_util_tchar_to_utf8 (tstr); + ret = VasEBoot_util_tchar_to_utf8 (tstr); LocalFree (tstr); @@ -328,46 +328,46 @@ grub_util_fd_strerror (void) } char * -grub_canonicalize_file_name (const char *path) +VasEBoot_canonicalize_file_name (const char *path) { char *ret; LPTSTR windows_path; ret = xmalloc (PATH_MAX); - windows_path = grub_util_get_windows_path (path); + windows_path = VasEBoot_util_get_windows_path (path); if (!windows_path) return NULL; - ret = grub_util_tchar_to_utf8 (windows_path); + ret = VasEBoot_util_tchar_to_utf8 (windows_path); free (windows_path); return ret; } void -grub_util_mkdir (const char *dir) +VasEBoot_util_mkdir (const char *dir) { LPTSTR windows_name; - windows_name = grub_util_get_windows_path (dir); + windows_name = VasEBoot_util_get_windows_path (dir); CreateDirectory (windows_name, NULL); free (windows_name); } int -grub_util_rename (const char *from, const char *to) +VasEBoot_util_rename (const char *from, const char *to) { LPTSTR windows_from, windows_to; int ret; - windows_from = grub_util_get_windows_path (from); - windows_to = grub_util_get_windows_path (to); + windows_from = VasEBoot_util_get_windows_path (from); + windows_to = VasEBoot_util_get_windows_path (to); ret = !MoveFile (windows_from, windows_to); free (windows_from); free (windows_to); return ret; } -struct grub_util_fd_dir +struct VasEBoot_util_fd_dir { WIN32_FIND_DATA fd; HANDLE hnd; @@ -375,15 +375,15 @@ struct grub_util_fd_dir char *last; }; -grub_util_fd_dir_t -grub_util_fd_opendir (const char *name) +VasEBoot_util_fd_dir_t +VasEBoot_util_fd_opendir (const char *name) { - struct grub_util_fd_dir *ret; + struct VasEBoot_util_fd_dir *ret; LPTSTR name_windows; LPTSTR pattern; ssize_t l; - name_windows = grub_util_get_windows_path (name); + name_windows = VasEBoot_util_get_windows_path (name); for (l = 0; name_windows[l]; l++); for (l--; l >= 0 && (name_windows[l] == '\\' || name_windows[l] == '/'); l--); l++; @@ -415,7 +415,7 @@ grub_util_fd_opendir (const char *name) } void -grub_util_fd_closedir (grub_util_fd_dir_t dirp) +VasEBoot_util_fd_closedir (VasEBoot_util_fd_dir_t dirp) { if (dirp->hnd != INVALID_HANDLE_VALUE) CloseHandle (dirp->hnd); @@ -423,8 +423,8 @@ grub_util_fd_closedir (grub_util_fd_dir_t dirp) free (dirp); } -grub_util_fd_dirent_t -grub_util_fd_readdir (grub_util_fd_dir_t dirp) +VasEBoot_util_fd_dirent_t +VasEBoot_util_fd_readdir (VasEBoot_util_fd_dir_t dirp) { char *ret; free (dirp->last); @@ -433,21 +433,21 @@ grub_util_fd_readdir (grub_util_fd_dir_t dirp) if (dirp->is_end) return NULL; - ret = grub_util_tchar_to_utf8 (dirp->fd.cFileName); + ret = VasEBoot_util_tchar_to_utf8 (dirp->fd.cFileName); dirp->last = ret; if (!FindNextFile (dirp->hnd, &dirp->fd)) dirp->is_end = 1; - return (grub_util_fd_dirent_t) ret; + return (VasEBoot_util_fd_dirent_t) ret; } int -grub_util_unlink (const char *name) +VasEBoot_util_unlink (const char *name) { LPTSTR name_windows; int ret; - name_windows = grub_util_get_windows_path (name); + name_windows = VasEBoot_util_get_windows_path (name); ret = !DeleteFile (name_windows); free (name_windows); @@ -455,12 +455,12 @@ grub_util_unlink (const char *name) } int -grub_util_rmdir (const char *name) +VasEBoot_util_rmdir (const char *name) { LPTSTR name_windows; int ret; - name_windows = grub_util_get_windows_path (name); + name_windows = VasEBoot_util_get_windows_path (name); ret = !RemoveDirectory (name_windows); free (name_windows); @@ -475,7 +475,7 @@ get_temp_name (void) TCHAR rt[1024]; TCHAR *ptr; HCRYPTPROV hCryptProv; - grub_uint8_t rnd[5]; + VasEBoot_uint8_t rnd[5]; int i; GetTempPath (ARRAY_SIZE (rt) - 100, rt); @@ -486,26 +486,26 @@ get_temp_name (void) PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) || !CryptGenRandom (hCryptProv, 5, rnd)) - grub_util_error ("%s", _("couldn't retrieve random data")); + VasEBoot_util_error ("%s", _("couldn't retrieve random data")); CryptReleaseContext (hCryptProv, 0); for (ptr = rt; *ptr; ptr++); - memcpy (ptr, TEXT("\\GRUB."), sizeof (TEXT("\\GRUB."))); - ptr += sizeof ("\\GRUB.") - 1; + memcpy (ptr, TEXT("\\VasEBoot."), sizeof (TEXT("\\VasEBoot."))); + ptr += sizeof ("\\VasEBoot.") - 1; for (i = 0; i < 8; i++) { - grub_size_t b = i * 5; - grub_uint8_t r; - grub_size_t f1 = GRUB_CHAR_BIT - b % GRUB_CHAR_BIT; - grub_size_t f2; + VasEBoot_size_t b = i * 5; + VasEBoot_uint8_t r; + VasEBoot_size_t f1 = VasEBoot_CHAR_BIT - b % VasEBoot_CHAR_BIT; + VasEBoot_size_t f2; if (f1 > 5) f1 = 5; f2 = 5 - f1; - r = (rnd[b / GRUB_CHAR_BIT] >> (b % GRUB_CHAR_BIT)) & ((1 << f1) - 1); + r = (rnd[b / VasEBoot_CHAR_BIT] >> (b % VasEBoot_CHAR_BIT)) & ((1 << f1) - 1); if (f2) - r |= (rnd[b / GRUB_CHAR_BIT + 1] & ((1 << f2) - 1)) << f1; + r |= (rnd[b / VasEBoot_CHAR_BIT + 1] & ((1 << f2) - 1)) << f1; if (r < 10) *ptr++ = '0' + r; else @@ -513,27 +513,27 @@ get_temp_name (void) } *ptr = '\0'; - return grub_util_tchar_to_utf8 (rt); + return VasEBoot_util_tchar_to_utf8 (rt); } char * -grub_util_make_temporary_file (void) +VasEBoot_util_make_temporary_file (void) { char *ret = get_temp_name (); FILE *f; - f = grub_util_fopen (ret, "wb"); + f = VasEBoot_util_fopen (ret, "wb"); if (f) fclose (f); return ret; } char * -grub_util_make_temporary_dir (void) +VasEBoot_util_make_temporary_dir (void) { char *ret = get_temp_name (); - grub_util_mkdir (ret); + VasEBoot_util_mkdir (ret); return ret; } @@ -541,52 +541,52 @@ grub_util_make_temporary_dir (void) #endif int -grub_util_is_directory (const char *name) +VasEBoot_util_is_directory (const char *name) { LPTSTR name_windows; DWORD attr; - name_windows = grub_util_get_windows_path (name); + name_windows = VasEBoot_util_get_windows_path (name); if (!name_windows) return 0; attr = GetFileAttributes (name_windows); - grub_free (name_windows); + VasEBoot_free (name_windows); return !!(attr & FILE_ATTRIBUTE_DIRECTORY); } int -grub_util_is_regular (const char *name) +VasEBoot_util_is_regular (const char *name) { LPTSTR name_windows; DWORD attr; - name_windows = grub_util_get_windows_path (name); + name_windows = VasEBoot_util_get_windows_path (name); if (!name_windows) return 0; attr = GetFileAttributes (name_windows); - grub_free (name_windows); + VasEBoot_free (name_windows); return !(attr & FILE_ATTRIBUTE_DIRECTORY) && !(attr & FILE_ATTRIBUTE_REPARSE_POINT) && attr; } -grub_uint32_t -grub_util_get_mtime (const char *path) +VasEBoot_uint32_t +VasEBoot_util_get_mtime (const char *path) { LPTSTR name_windows; BOOL b; WIN32_FILE_ATTRIBUTE_DATA attr; ULARGE_INTEGER us_ul; - name_windows = grub_util_get_windows_path (path); + name_windows = VasEBoot_util_get_windows_path (path); if (!name_windows) return 0; b = GetFileAttributesEx (name_windows, GetFileExInfoStandard, &attr); - grub_free (name_windows); + VasEBoot_free (name_windows); if (!b) return 0; @@ -603,16 +603,16 @@ grub_util_get_mtime (const char *path) #ifdef __MINGW32__ FILE * -grub_util_fopen (const char *path, const char *mode) +VasEBoot_util_fopen (const char *path, const char *mode) { LPTSTR tpath; FILE *ret; - tpath = grub_util_get_windows_path (path); + tpath = VasEBoot_util_get_windows_path (path); #if SIZEOF_TCHAR == 1 ret = fopen (tpath, tmode); #else LPTSTR tmode; - tmode = grub_util_utf8_to_tchar (mode); + tmode = VasEBoot_util_utf8_to_tchar (mode); ret = _wfopen (tpath, tmode); free (tmode); #endif @@ -621,7 +621,7 @@ grub_util_fopen (const char *path, const char *mode) } void -grub_util_file_sync (FILE *f) +VasEBoot_util_file_sync (FILE *f) { HANDLE hnd; @@ -633,17 +633,17 @@ grub_util_file_sync (FILE *f) } int -grub_util_is_special_file (const char *name) +VasEBoot_util_is_special_file (const char *name) { LPTSTR name_windows; DWORD attr; - name_windows = grub_util_get_windows_path (name); + name_windows = VasEBoot_util_get_windows_path (name); if (!name_windows) return 1; attr = GetFileAttributes (name_windows); - grub_free (name_windows); + VasEBoot_free (name_windows); return !!(attr & FILE_ATTRIBUTE_REPARSE_POINT) || !attr; } @@ -651,7 +651,7 @@ grub_util_is_special_file (const char *name) #else void -grub_util_file_sync (FILE *f) +VasEBoot_util_file_sync (FILE *f) { fflush (f); if (!allow_fd_syncs) @@ -660,7 +660,7 @@ grub_util_file_sync (FILE *f) } FILE * -grub_util_fopen (const char *path, const char *mode) +VasEBoot_util_fopen (const char *path, const char *mode) { return fopen (path, mode); } diff --git a/VasEBoot-core/osdep/windows/init.c b/VasEBoot-core/osdep/windows/init.c index e8ffd62c6..7ea46f9dd 100644 --- a/VasEBoot-core/osdep/windows/init.c +++ b/VasEBoot-core/osdep/windows/init.c @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #include "progname.h" -struct grub_windows_console_font_infoex { +struct VasEBoot_windows_console_font_infoex { ULONG cbSize; DWORD nFont; COORD dwFontSize; @@ -61,7 +61,7 @@ static void set_console_unicode_font (void) { BOOL (WINAPI * func_SetCurrentConsoleFontEx) (HANDLE, BOOL, - struct grub_windows_console_font_infoex *); + struct VasEBoot_windows_console_font_infoex *); BOOL (WINAPI * func_SetConsoleFont)(HANDLE, DWORD); HMODULE kernel32; HANDLE out_handle = GetStdHandle (STD_OUTPUT_HANDLE); @@ -83,7 +83,7 @@ set_console_unicode_font (void) /* Newer windows versions. */ if (func_SetCurrentConsoleFontEx) { - struct grub_windows_console_font_infoex new_console_font_info; + struct VasEBoot_windows_console_font_infoex new_console_font_info; new_console_font_info.cbSize = sizeof (new_console_font_info); new_console_font_info.nFont = 12; new_console_font_info.dwFontSize.X = 7; @@ -112,38 +112,38 @@ set_console_unicode_font (void) } } -static char *grub_util_base_directory; +static char *VasEBoot_util_base_directory; static char *locale_dir; const char * -grub_util_get_config_filename (void) +VasEBoot_util_get_config_filename (void) { static char *value = NULL; if (!value) - value = grub_util_path_concat (2, grub_util_base_directory, "grub.cfg"); + value = VasEBoot_util_path_concat (2, VasEBoot_util_base_directory, "VasEBoot.cfg"); return value; } const char * -grub_util_get_pkgdatadir (void) +VasEBoot_util_get_pkgdatadir (void) { - return grub_util_base_directory; + return VasEBoot_util_base_directory; } const char * -grub_util_get_localedir (void) +VasEBoot_util_get_localedir (void) { return locale_dir; } const char * -grub_util_get_pkglibdir (void) +VasEBoot_util_get_pkglibdir (void) { - return grub_util_base_directory; + return VasEBoot_util_base_directory; } void -grub_util_host_init (int *argc __attribute__ ((unused)), +VasEBoot_util_host_init (int *argc __attribute__ ((unused)), char ***argv) { char *ptr; @@ -164,25 +164,25 @@ grub_util_host_init (int *argc __attribute__ ((unused)), *argv = xmalloc ((*argc + 1) * sizeof (argv[0])); for (i = 0; i < *argc; i++) - (*argv)[i] = grub_util_tchar_to_utf8 (targv[i]); + (*argv)[i] = VasEBoot_util_tchar_to_utf8 (targv[i]); (*argv)[i] = NULL; #else #error "Unsupported TCHAR size" #endif - grub_util_base_directory = grub_canonicalize_file_name ((*argv)[0]); - if (!grub_util_base_directory) - grub_util_base_directory = xstrdup ((*argv)[0]); - for (ptr = grub_util_base_directory + strlen (grub_util_base_directory) - 1; - ptr >= grub_util_base_directory && *ptr != '/' && *ptr != '\\'; ptr--); - if (ptr >= grub_util_base_directory) + VasEBoot_util_base_directory = VasEBoot_canonicalize_file_name ((*argv)[0]); + if (!VasEBoot_util_base_directory) + VasEBoot_util_base_directory = xstrdup ((*argv)[0]); + for (ptr = VasEBoot_util_base_directory + strlen (VasEBoot_util_base_directory) - 1; + ptr >= VasEBoot_util_base_directory && *ptr != '/' && *ptr != '\\'; ptr--); + if (ptr >= VasEBoot_util_base_directory) *ptr = '\0'; - locale_dir = grub_util_path_concat (2, grub_util_base_directory, "locale"); + locale_dir = VasEBoot_util_path_concat (2, VasEBoot_util_base_directory, "locale"); set_program_name ((*argv)[0]); -#if (defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS) +#if (defined (VasEBoot_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS) setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, locale_dir); textdomain (PACKAGE); diff --git a/VasEBoot-core/osdep/windows/password.c b/VasEBoot-core/osdep/windows/password.c index 1d3af0c2c..faacc7f5e 100644 --- a/VasEBoot-core/osdep/windows/password.c +++ b/VasEBoot-core/osdep/windows/password.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include @@ -27,13 +27,13 @@ #include int -grub_password_get (char buf[], unsigned buf_size) +VasEBoot_password_get (char buf[], unsigned buf_size) { HANDLE hStdin = GetStdHandle (STD_INPUT_HANDLE); DWORD mode = 0; char *ptr; - grub_refresh (); + VasEBoot_refresh (); GetConsoleMode (hStdin, &mode); SetConsoleMode (hStdin, mode & (~ENABLE_ECHO_INPUT)); @@ -45,7 +45,7 @@ grub_password_get (char buf[], unsigned buf_size) SetConsoleMode (hStdin, mode); - grub_refresh (); + VasEBoot_refresh (); return 1; } diff --git a/VasEBoot-core/osdep/windows/platform.c b/VasEBoot-core/osdep/windows/platform.c index 912269191..e2660f296 100644 --- a/VasEBoot-core/osdep/windows/platform.c +++ b/VasEBoot-core/osdep/windows/platform.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#define GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR L"{8be4df61-93ca-11d2-aa0d-00e098032b8c}" +#define VasEBoot_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR L"{8be4df61-93ca-11d2-aa0d-00e098032b8c}" static enum { PLAT_UNK, PLAT_BIOS, PLAT_EFI } platform; static DWORD (WINAPI * func_GetFirmwareEnvironmentVariableW) (LPCWSTR lpName, @@ -94,11 +94,11 @@ get_platform (void) if (!get_efi_privilegies ()) { - grub_util_warn (_("Insufficient privileges to access firmware, assuming BIOS")); + VasEBoot_util_warn (_("Insufficient privileges to access firmware, assuming BIOS")); platform = PLAT_BIOS; } - if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, + if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", VasEBoot_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, buffer, sizeof (buffer)) && GetLastError () == ERROR_INVALID_FUNCTION) { @@ -110,7 +110,7 @@ get_platform (void) } const char * -grub_install_get_default_x86_platform (void) +VasEBoot_install_get_default_x86_platform (void) { SYSTEM_INFO si; @@ -138,7 +138,7 @@ get_efi_variable (const wchar_t *varname, ssize_t *len) { DWORD err; ret = xmalloc (alloc_size); - read_size = func_GetFirmwareEnvironmentVariableW (varname, GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, + read_size = func_GetFirmwareEnvironmentVariableW (varname, VasEBoot_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, ret, alloc_size); err = GetLastError (); if (read_size) @@ -164,10 +164,10 @@ get_efi_variable (const wchar_t *varname, ssize_t *len) } static void -set_efi_variable (const wchar_t *varname, void *in, grub_size_t len) +set_efi_variable (const wchar_t *varname, void *in, VasEBoot_size_t len) { get_platform (); - func_SetFirmwareEnvironmentVariableW (varname, GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, + func_SetFirmwareEnvironmentVariableW (varname, VasEBoot_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, in, len); } @@ -180,7 +180,7 @@ bin2hex (int v) } static void * -get_efi_variable_bootn (grub_uint16_t n, ssize_t *len) +get_efi_variable_bootn (VasEBoot_uint16_t n, ssize_t *len) { wchar_t varname[20] = L"Boot0000"; varname[7] = bin2hex (n & 0xf); @@ -191,7 +191,7 @@ get_efi_variable_bootn (grub_uint16_t n, ssize_t *len) } static void -set_efi_variable_bootn (grub_uint16_t n, void *in, grub_size_t len) +set_efi_variable_bootn (VasEBoot_uint16_t n, void *in, VasEBoot_size_t len) { wchar_t varname[20] = L"Boot0000"; varname[7] = bin2hex (n & 0xf); @@ -202,33 +202,33 @@ set_efi_variable_bootn (grub_uint16_t n, void *in, grub_size_t len) } void -grub_install_register_efi (grub_device_t efidir_grub_dev, +VasEBoot_install_register_efi (VasEBoot_device_t efidir_VasEBoot_dev, const char *efifile_path, const char *efi_distributor) { - grub_uint16_t *boot_order, *new_boot_order; - grub_uint16_t *distributor16; - grub_uint8_t *entry; - grub_size_t distrib8_len, distrib16_len, path16_len, path8_len; + VasEBoot_uint16_t *boot_order, *new_boot_order; + VasEBoot_uint16_t *distributor16; + VasEBoot_uint8_t *entry; + VasEBoot_size_t distrib8_len, distrib16_len, path16_len, path8_len; ssize_t boot_order_len, new_boot_order_len; - grub_uint16_t order_num = 0; + VasEBoot_uint16_t order_num = 0; int have_order_num = 0; - grub_size_t max_path_length; - grub_uint8_t *path; + VasEBoot_size_t max_path_length; + VasEBoot_uint8_t *path; void *pathptr; - struct grub_efi_hard_drive_device_path *hddp; - struct grub_efi_file_path_device_path *filep; - struct grub_efi_device_path *endp; + struct VasEBoot_efi_hard_drive_device_path *hddp; + struct VasEBoot_efi_file_path_device_path *filep; + struct VasEBoot_efi_device_path *endp; get_platform (); if (platform != PLAT_EFI) - grub_util_error ("%s", _("no EFI routines are available when running in BIOS mode")); + VasEBoot_util_error ("%s", _("no EFI routines are available when running in BIOS mode")); - distrib8_len = grub_strlen (efi_distributor); - distributor16 = xmalloc ((distrib8_len + 1) * GRUB_MAX_UTF16_PER_UTF8 - * sizeof (grub_uint16_t)); - distrib16_len = grub_utf8_to_utf16 (distributor16, distrib8_len * GRUB_MAX_UTF16_PER_UTF8, - (const grub_uint8_t *) efi_distributor, + distrib8_len = VasEBoot_strlen (efi_distributor); + distributor16 = xmalloc ((distrib8_len + 1) * VasEBoot_MAX_UTF16_PER_UTF8 + * sizeof (VasEBoot_uint16_t)); + distrib16_len = VasEBoot_utf8_to_utf16 (distributor16, distrib8_len * VasEBoot_MAX_UTF16_PER_UTF8, + (const VasEBoot_uint8_t *) efi_distributor, distrib8_len, 0); distributor16[distrib16_len] = 0; @@ -237,7 +237,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, until we find same distributor or empty spot. */ boot_order = get_efi_variable (L"BootOrder", &boot_order_len); if (boot_order_len < -1) - grub_util_error ("%s", _("unexpected EFI error")); + VasEBoot_util_error ("%s", _("unexpected EFI error")); if (boot_order_len > 0) { size_t i; @@ -248,24 +248,24 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, current = get_efi_variable_bootn (i, ¤t_len); if (current_len < 0) continue; /* FIXME Should we abort on error? */ - if (current_len < (distrib16_len + 1) * sizeof (grub_uint16_t) + if (current_len < (distrib16_len + 1) * sizeof (VasEBoot_uint16_t) + 6) { - grub_free (current); + VasEBoot_free (current); continue; } - if (grub_memcmp ((grub_uint16_t *) current + 3, + if (VasEBoot_memcmp ((VasEBoot_uint16_t *) current + 3, distributor16, - (distrib16_len + 1) * sizeof (grub_uint16_t)) != 0) + (distrib16_len + 1) * sizeof (VasEBoot_uint16_t)) != 0) { - grub_free (current); + VasEBoot_free (current); continue; } order_num = i; have_order_num = 1; - grub_util_info ("Found matching distributor at Boot%04x", + VasEBoot_util_info ("Found matching distributor at Boot%04x", order_num); - grub_free (current); + VasEBoot_free (current); break; } } @@ -285,115 +285,115 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, { order_num = i; have_order_num = 1; - grub_util_info ("Creating new entry at Boot%04x", + VasEBoot_util_info ("Creating new entry at Boot%04x", order_num); } continue; } - if (current_len < (distrib16_len + 1) * sizeof (grub_uint16_t) + if (current_len < (distrib16_len + 1) * sizeof (VasEBoot_uint16_t) + 6) { - grub_free (current); + VasEBoot_free (current); continue; } - if (grub_memcmp ((grub_uint16_t *) current + 3, + if (VasEBoot_memcmp ((VasEBoot_uint16_t *) current + 3, distributor16, - (distrib16_len + 1) * sizeof (grub_uint16_t)) != 0) + (distrib16_len + 1) * sizeof (VasEBoot_uint16_t)) != 0) { - grub_free (current); + VasEBoot_free (current); continue; } order_num = i; have_order_num = 1; - grub_util_info ("Found matching distributor at Boot%04x", + VasEBoot_util_info ("Found matching distributor at Boot%04x", order_num); - grub_free (current); + VasEBoot_free (current); break; } } if (!have_order_num) - grub_util_error ("%s", _("Couldn't find a free BootNNNN slot")); - path8_len = grub_strlen (efifile_path); - max_path_length = sizeof (*hddp) + sizeof (*filep) + (path8_len * GRUB_MAX_UTF16_PER_UTF8 + 1) * sizeof (grub_uint16_t) + sizeof (*endp); - entry = xmalloc (6 + (distrib16_len + 1) * sizeof (grub_uint16_t) + max_path_length); + VasEBoot_util_error ("%s", _("Couldn't find a free BootNNNN slot")); + path8_len = VasEBoot_strlen (efifile_path); + max_path_length = sizeof (*hddp) + sizeof (*filep) + (path8_len * VasEBoot_MAX_UTF16_PER_UTF8 + 1) * sizeof (VasEBoot_uint16_t) + sizeof (*endp); + entry = xmalloc (6 + (distrib16_len + 1) * sizeof (VasEBoot_uint16_t) + max_path_length); /* attributes: active. */ entry[0] = 1; entry[1] = 0; entry[2] = 0; entry[3] = 0; - grub_memcpy (entry + 6, + VasEBoot_memcpy (entry + 6, distributor16, - (distrib16_len + 1) * sizeof (grub_uint16_t)); + (distrib16_len + 1) * sizeof (VasEBoot_uint16_t)); - path = entry + 6 + (distrib16_len + 1) * sizeof (grub_uint16_t); + path = entry + 6 + (distrib16_len + 1) * sizeof (VasEBoot_uint16_t); pathptr = path; hddp = pathptr; - grub_memset (hddp, 0, sizeof (*hddp)); - hddp->header.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE; - hddp->header.subtype = GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE; + VasEBoot_memset (hddp, 0, sizeof (*hddp)); + hddp->header.type = VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE; + hddp->header.subtype = VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE; hddp->header.length = sizeof (*hddp); - hddp->partition_number = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1; - if (efidir_grub_dev->disk->partition - && grub_strcmp (efidir_grub_dev->disk->partition->partmap->name, "msdos") == 0) + hddp->partition_number = efidir_VasEBoot_dev->disk->partition ? efidir_VasEBoot_dev->disk->partition->number + 1 : 1; + if (efidir_VasEBoot_dev->disk->partition + && VasEBoot_strcmp (efidir_VasEBoot_dev->disk->partition->partmap->name, "msdos") == 0) { - grub_partition_t p; + VasEBoot_partition_t p; - p = efidir_grub_dev->disk->partition; - efidir_grub_dev->disk->partition = p->parent; - if (grub_disk_read (efidir_grub_dev->disk, 0, 440, + p = efidir_VasEBoot_dev->disk->partition; + efidir_VasEBoot_dev->disk->partition = p->parent; + if (VasEBoot_disk_read (efidir_VasEBoot_dev->disk, 0, 440, 4, hddp->partition_signature)) - grub_util_error ("%s", grub_errmsg); - efidir_grub_dev->disk->partition = p; + VasEBoot_util_error ("%s", VasEBoot_errmsg); + efidir_VasEBoot_dev->disk->partition = p; hddp->partmap_type = 1; hddp->signature_type = 1; } - else if (efidir_grub_dev->disk->partition - && grub_strcmp (efidir_grub_dev->disk->partition->partmap->name, "gpt") == 0) + else if (efidir_VasEBoot_dev->disk->partition + && VasEBoot_strcmp (efidir_VasEBoot_dev->disk->partition->partmap->name, "gpt") == 0) { - struct grub_gpt_partentry gptdata; - grub_partition_t p; + struct VasEBoot_gpt_partentry gptdata; + VasEBoot_partition_t p; - p = efidir_grub_dev->disk->partition; - efidir_grub_dev->disk->partition = p->parent; - if (grub_disk_read (efidir_grub_dev->disk, + p = efidir_VasEBoot_dev->disk->partition; + efidir_VasEBoot_dev->disk->partition = p->parent; + if (VasEBoot_disk_read (efidir_VasEBoot_dev->disk, p->offset, p->index, sizeof (gptdata), &gptdata)) - grub_util_error ("%s", grub_errmsg); - efidir_grub_dev->disk->partition = p; - grub_memcpy (hddp->partition_signature, + VasEBoot_util_error ("%s", VasEBoot_errmsg); + efidir_VasEBoot_dev->disk->partition = p; + VasEBoot_memcpy (hddp->partition_signature, gptdata.guid, 16); hddp->partmap_type = 2; hddp->signature_type = 2; } - hddp->partition_start = grub_partition_get_start (efidir_grub_dev->disk->partition) - >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); - hddp->partition_size = grub_disk_get_size (efidir_grub_dev->disk) - >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + hddp->partition_start = VasEBoot_partition_get_start (efidir_VasEBoot_dev->disk->partition) + >> (efidir_VasEBoot_dev->disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); + hddp->partition_size = VasEBoot_disk_get_size (efidir_VasEBoot_dev->disk) + >> (efidir_VasEBoot_dev->disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); pathptr = hddp + 1; filep = pathptr; - filep->header.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE; - filep->header.subtype = GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE; + filep->header.type = VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE; + filep->header.subtype = VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE; - path16_len = grub_utf8_to_utf16 (filep->path_name, - path8_len * GRUB_MAX_UTF16_PER_UTF8, - (const grub_uint8_t *) efifile_path, + path16_len = VasEBoot_utf8_to_utf16 (filep->path_name, + path8_len * VasEBoot_MAX_UTF16_PER_UTF8, + (const VasEBoot_uint8_t *) efifile_path, path8_len, 0); filep->path_name[path16_len] = 0; - filep->header.length = sizeof (*filep) + (path16_len + 1) * sizeof (grub_uint16_t); + filep->header.length = sizeof (*filep) + (path16_len + 1) * sizeof (VasEBoot_uint16_t); pathptr = &filep->path_name[path16_len + 1]; endp = pathptr; - endp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - endp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + endp->type = VasEBoot_EFI_END_DEVICE_PATH_TYPE; + endp->subtype = VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; endp->length = sizeof (*endp); pathptr = endp + 1; - entry[4] = (grub_uint8_t *) pathptr - path; - entry[5] = ((grub_uint8_t *) pathptr - path) >> 8; + entry[4] = (VasEBoot_uint8_t *) pathptr - path; + entry[5] = ((VasEBoot_uint8_t *) pathptr - path) >> 8; new_boot_order = xmalloc ((boot_order_len > 0 ? boot_order_len : 0) + 2); new_boot_order[0] = order_num; @@ -405,20 +405,20 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, new_boot_order[new_boot_order_len++] = boot_order[i]; } - set_efi_variable_bootn (order_num, entry, (grub_uint8_t *) pathptr - entry); - set_efi_variable (L"BootOrder", new_boot_order, new_boot_order_len * sizeof (grub_uint16_t)); + set_efi_variable_bootn (order_num, entry, (VasEBoot_uint8_t *) pathptr - entry); + set_efi_variable (L"BootOrder", new_boot_order, new_boot_order_len * sizeof (VasEBoot_uint16_t)); } void -grub_install_register_ieee1275 (int is_prep, const char *install_device, +VasEBoot_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath) { - grub_util_error ("%s", _("no IEEE1275 routines are available for your platform")); + VasEBoot_util_error ("%s", _("no IEEE1275 routines are available for your platform")); } void -grub_install_sgi_setup (const char *install_device, +VasEBoot_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname) { - grub_util_error ("%s", _("no SGI routines are available for your platform")); + VasEBoot_util_error ("%s", _("no SGI routines are available for your platform")); } diff --git a/VasEBoot-core/osdep/windows/random.c b/VasEBoot-core/osdep/windows/random.c index 78f508202..6db1dbbaa 100644 --- a/VasEBoot-core/osdep/windows/random.c +++ b/VasEBoot-core/osdep/windows/random.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1992-1999,2001,2003,2004,2005,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -34,7 +34,7 @@ #include int -grub_get_random (void *out, grub_size_t len) +VasEBoot_get_random (void *out, VasEBoot_size_t len) { HCRYPTPROV hCryptProv; if (!CryptAcquireContext (&hCryptProv, diff --git a/VasEBoot-core/osdep/windows/relpath.c b/VasEBoot-core/osdep/windows/relpath.c index cb0861744..27296eb4f 100644 --- a/VasEBoot-core/osdep/windows/relpath.c +++ b/VasEBoot-core/osdep/windows/relpath.c @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include +#include -#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,7 +43,7 @@ tclen (const TCHAR *s) } char * -grub_make_system_path_relative_to_its_root (const char *path) +VasEBoot_make_system_path_relative_to_its_root (const char *path) { TCHAR *dirwindows, *mntpointwindows; TCHAR *ptr; @@ -51,11 +51,11 @@ grub_make_system_path_relative_to_its_root (const char *path) TCHAR *ret; char *cret; - dirwindows = grub_util_get_windows_path (path); + dirwindows = VasEBoot_util_get_windows_path (path); if (!dirwindows) return xstrdup (path); - mntpointwindows = grub_get_mount_point (dirwindows); + mntpointwindows = VasEBoot_get_mount_point (dirwindows); if (!mntpointwindows) { @@ -89,7 +89,7 @@ grub_make_system_path_relative_to_its_root (const char *path) if (*ptr == '\\') *ptr = '/'; - cret = grub_util_tchar_to_utf8 (ret); + cret = VasEBoot_util_tchar_to_utf8 (ret); free (ret); return cret; diff --git a/VasEBoot-core/osdep/windows/sleep.c b/VasEBoot-core/osdep/windows/sleep.c index 03b846bc7..3f3a4bc9f 100644 --- a/VasEBoot-core/osdep/windows/sleep.c +++ b/VasEBoot-core/osdep/windows/sleep.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -21,10 +21,10 @@ #include #include -#include +#include void -grub_millisleep (grub_uint32_t ms) +VasEBoot_millisleep (VasEBoot_uint32_t ms) { Sleep (ms); } diff --git a/VasEBoot-core/partmap/acorn.c b/VasEBoot-core/partmap/acorn.c index c022c61dd..c802c8bac 100644 --- a/VasEBoot-core/partmap/acorn.c +++ b/VasEBoot-core/partmap/acorn.c @@ -1,75 +1,75 @@ /* acorn.c - Read Linux/ADFS partition tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define LINUX_NATIVE_MAGIC grub_cpu_to_le32_compile_time (0xdeafa1de) -#define LINUX_SWAP_MAGIC grub_cpu_to_le32_compile_time (0xdeafab1e) +#define LINUX_NATIVE_MAGIC VasEBoot_cpu_to_le32_compile_time (0xdeafa1de) +#define LINUX_SWAP_MAGIC VasEBoot_cpu_to_le32_compile_time (0xdeafab1e) #define LINUX_MAP_ENTRIES (512 / 12) #define NONADFS_PARTITION_TYPE_LINUX 9 #define NONADFS_PARTITION_TYPE_MASK 15 -struct grub_acorn_boot_block +struct VasEBoot_acorn_boot_block { union { struct { - grub_uint8_t misc[0x1C0]; - struct grub_filecore_disc_record disc_record; - grub_uint8_t flags; - grub_uint16_t start_cylinder; - grub_uint8_t checksum; - } GRUB_PACKED; - grub_uint8_t bin[0x200]; + VasEBoot_uint8_t misc[0x1C0]; + struct VasEBoot_filecore_disc_record disc_record; + VasEBoot_uint8_t flags; + VasEBoot_uint16_t start_cylinder; + VasEBoot_uint8_t checksum; + } VasEBoot_PACKED; + VasEBoot_uint8_t bin[0x200]; }; -} GRUB_PACKED; +} VasEBoot_PACKED; struct linux_part { - grub_uint32_t magic; - grub_uint32_t start; - grub_uint32_t size; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t start; + VasEBoot_uint32_t size; }; -static struct grub_partition_map grub_acorn_partition_map; +static struct VasEBoot_partition_map VasEBoot_acorn_partition_map; -static grub_err_t -acorn_partition_map_find (grub_disk_t disk, struct linux_part *m, - grub_disk_addr_t *sector) +static VasEBoot_err_t +acorn_partition_map_find (VasEBoot_disk_t disk, struct linux_part *m, + VasEBoot_disk_addr_t *sector) { - struct grub_acorn_boot_block boot; - grub_err_t err; + struct VasEBoot_acorn_boot_block boot; + VasEBoot_err_t err; unsigned int checksum = 0; unsigned int heads; unsigned int sectors_per_cylinder; int i; - err = grub_disk_read (disk, 0xC00 / GRUB_DISK_SECTOR_SIZE, 0, - sizeof (struct grub_acorn_boot_block), + err = VasEBoot_disk_read (disk, 0xC00 / VasEBoot_DISK_SECTOR_SIZE, 0, + sizeof (struct VasEBoot_acorn_boot_block), &boot); if (err) return err; @@ -80,47 +80,47 @@ acorn_partition_map_find (grub_disk_t disk, struct linux_part *m, for (i = 0; i != 0x1ff; ++i) checksum = ((checksum & 0xff) + (checksum >> 8) + boot.bin[i]); - if ((grub_uint8_t) checksum != boot.checksum) + if ((VasEBoot_uint8_t) checksum != boot.checksum) goto fail; heads = (boot.disc_record.heads + ((boot.disc_record.lowsector >> 6) & 1)); sectors_per_cylinder = boot.disc_record.secspertrack * heads; - *sector = grub_le_to_cpu16 (boot.start_cylinder) * sectors_per_cylinder; + *sector = VasEBoot_le_to_cpu16 (boot.start_cylinder) * sectors_per_cylinder; - return grub_disk_read (disk, *sector, 0, + return VasEBoot_disk_read (disk, *sector, 0, sizeof (struct linux_part) * LINUX_MAP_ENTRIES, m); fail: - return grub_error (GRUB_ERR_BAD_PART_TABLE, + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "Linux/ADFS partition map not found"); } -static grub_err_t -acorn_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +acorn_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition part; + struct VasEBoot_partition part; struct linux_part map[LINUX_MAP_ENTRIES]; int i; - grub_disk_addr_t sector = 0; - grub_err_t err; + VasEBoot_disk_addr_t sector = 0; + VasEBoot_err_t err; err = acorn_partition_map_find (disk, map, §or); if (err) return err; - part.partmap = &grub_acorn_partition_map; + part.partmap = &VasEBoot_acorn_partition_map; for (i = 0; i != LINUX_MAP_ENTRIES; ++i) { if (map[i].magic != LINUX_NATIVE_MAGIC && map[i].magic != LINUX_SWAP_MAGIC) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; part.start = sector + map[i].start; part.len = map[i].size; @@ -128,27 +128,27 @@ acorn_partition_map_iterate (grub_disk_t disk, part.number = part.index = i; if (hook (disk, &part, hook_data)) - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Partition map type. */ -static struct grub_partition_map grub_acorn_partition_map = +static struct VasEBoot_partition_map VasEBoot_acorn_partition_map = { .name = "acorn", .iterate = acorn_partition_map_iterate, }; -GRUB_MOD_INIT(part_acorn) +VasEBoot_MOD_INIT(part_acorn) { - grub_partition_map_register (&grub_acorn_partition_map); + VasEBoot_partition_map_register (&VasEBoot_acorn_partition_map); } -GRUB_MOD_FINI(part_acorn) +VasEBoot_MOD_FINI(part_acorn) { - grub_partition_map_unregister (&grub_acorn_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_acorn_partition_map); } diff --git a/VasEBoot-core/partmap/amiga.c b/VasEBoot-core/partmap/amiga.c index 13034f15c..b36a607f4 100644 --- a/VasEBoot-core/partmap/amiga.c +++ b/VasEBoot-core/partmap/amiga.c @@ -1,106 +1,106 @@ /* amiga.c - Read amiga partition tables (RDB). */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define AMIGA_CHECKSUM_WORDS 128 -struct grub_amiga_rdsk +struct VasEBoot_amiga_rdsk { /* "RDSK". */ - grub_uint8_t magic[4]; -#define GRUB_AMIGA_RDSK_MAGIC "RDSK" - grub_uint32_t size; - grub_int32_t checksum; - grub_uint32_t scsihost; - grub_uint32_t blksz; - grub_uint32_t flags; - grub_uint32_t badblcklst; - grub_uint32_t partitionlst; - grub_uint32_t fslst; + VasEBoot_uint8_t magic[4]; +#define VasEBoot_AMIGA_RDSK_MAGIC "RDSK" + VasEBoot_uint32_t size; + VasEBoot_int32_t checksum; + VasEBoot_uint32_t scsihost; + VasEBoot_uint32_t blksz; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t badblcklst; + VasEBoot_uint32_t partitionlst; + VasEBoot_uint32_t fslst; - grub_uint32_t unused[AMIGA_CHECKSUM_WORDS - 9]; -} GRUB_PACKED; + VasEBoot_uint32_t unused[AMIGA_CHECKSUM_WORDS - 9]; +} VasEBoot_PACKED; -struct grub_amiga_partition +struct VasEBoot_amiga_partition { /* "PART". */ - grub_uint8_t magic[4]; -#define GRUB_AMIGA_PART_MAGIC "PART" - grub_uint32_t size; - grub_int32_t checksum; - grub_uint32_t scsihost; - grub_uint32_t next; - grub_uint32_t flags; - grub_uint32_t unused1[2]; - grub_uint32_t devflags; - grub_uint8_t namelen; - grub_uint8_t name[31]; - grub_uint32_t unused2[15]; + VasEBoot_uint8_t magic[4]; +#define VasEBoot_AMIGA_PART_MAGIC "PART" + VasEBoot_uint32_t size; + VasEBoot_int32_t checksum; + VasEBoot_uint32_t scsihost; + VasEBoot_uint32_t next; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t unused1[2]; + VasEBoot_uint32_t devflags; + VasEBoot_uint8_t namelen; + VasEBoot_uint8_t name[31]; + VasEBoot_uint32_t unused2[15]; - grub_uint32_t unused3[3]; - grub_uint32_t heads; - grub_uint32_t unused4; - grub_uint32_t block_per_track; - grub_uint32_t unused5[3]; - grub_uint32_t lowcyl; - grub_uint32_t highcyl; + VasEBoot_uint32_t unused3[3]; + VasEBoot_uint32_t heads; + VasEBoot_uint32_t unused4; + VasEBoot_uint32_t block_per_track; + VasEBoot_uint32_t unused5[3]; + VasEBoot_uint32_t lowcyl; + VasEBoot_uint32_t highcyl; - grub_uint32_t firstcyl; - grub_uint32_t unused[AMIGA_CHECKSUM_WORDS - 44]; -} GRUB_PACKED; + VasEBoot_uint32_t firstcyl; + VasEBoot_uint32_t unused[AMIGA_CHECKSUM_WORDS - 44]; +} VasEBoot_PACKED; -static struct grub_partition_map grub_amiga_partition_map; +static struct VasEBoot_partition_map VasEBoot_amiga_partition_map; -static grub_uint32_t +static VasEBoot_uint32_t amiga_partition_map_checksum (void *buf) { - grub_uint32_t *ptr = buf; - grub_uint32_t r = 0; - grub_size_t sz; + VasEBoot_uint32_t *ptr = buf; + VasEBoot_uint32_t r = 0; + VasEBoot_size_t sz; /* Fancy and quick way of checking sz >= 512 / 4 = 128. */ - if (ptr[1] & ~grub_cpu_to_be32_compile_time (AMIGA_CHECKSUM_WORDS - 1)) + if (ptr[1] & ~VasEBoot_cpu_to_be32_compile_time (AMIGA_CHECKSUM_WORDS - 1)) sz = AMIGA_CHECKSUM_WORDS; else - sz = grub_be_to_cpu32 (ptr[1]); + sz = VasEBoot_be_to_cpu32 (ptr[1]); for (; sz; sz--, ptr++) - r += grub_be_to_cpu32 (*ptr); + r += VasEBoot_be_to_cpu32 (*ptr); return r; } -static grub_err_t -amiga_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +amiga_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition part; - struct grub_amiga_rdsk rdsk; + struct VasEBoot_partition part; + struct VasEBoot_amiga_rdsk rdsk; int partno = 0; int next = -1; unsigned pos; @@ -109,55 +109,55 @@ amiga_partition_map_iterate (grub_disk_t disk, for (pos = 0; pos < 15; pos++) { /* Read the RDSK block which is a descriptor for the entire disk. */ - if (grub_disk_read (disk, pos, 0, sizeof (rdsk), &rdsk)) - return grub_errno; + if (VasEBoot_disk_read (disk, pos, 0, sizeof (rdsk), &rdsk)) + return VasEBoot_errno; - if (grub_memcmp (rdsk.magic, GRUB_AMIGA_RDSK_MAGIC, + if (VasEBoot_memcmp (rdsk.magic, VasEBoot_AMIGA_RDSK_MAGIC, sizeof (rdsk.magic)) == 0 && amiga_partition_map_checksum (&rdsk) == 0) { /* Found the first PART block. */ - next = grub_be_to_cpu32 (rdsk.partitionlst); + next = VasEBoot_be_to_cpu32 (rdsk.partitionlst); break; } } if (next == -1) - return grub_error (GRUB_ERR_BAD_PART_TABLE, + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "Amiga partition map not found"); /* The end of the partition list is marked using "-1". */ while (next != -1) { - struct grub_amiga_partition apart; + struct VasEBoot_amiga_partition apart; /* Read the RDSK block which is a descriptor for the entire disk. */ - if (grub_disk_read (disk, next, 0, sizeof (apart), &apart)) - return grub_errno; + if (VasEBoot_disk_read (disk, next, 0, sizeof (apart), &apart)) + return VasEBoot_errno; - if (grub_memcmp (apart.magic, GRUB_AMIGA_PART_MAGIC, + if (VasEBoot_memcmp (apart.magic, VasEBoot_AMIGA_PART_MAGIC, sizeof (apart.magic)) != 0 || amiga_partition_map_checksum (&apart) != 0) - return grub_error (GRUB_ERR_BAD_PART_TABLE, + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid Amiga partition map"); /* Calculate the first block and the size of the partition. */ - part.start = (grub_be_to_cpu32 (apart.lowcyl) - * grub_be_to_cpu32 (apart.heads) - * grub_be_to_cpu32 (apart.block_per_track)); - part.len = ((grub_be_to_cpu32 (apart.highcyl) - - grub_be_to_cpu32 (apart.lowcyl) + 1) - * grub_be_to_cpu32 (apart.heads) - * grub_be_to_cpu32 (apart.block_per_track)); + part.start = (VasEBoot_be_to_cpu32 (apart.lowcyl) + * VasEBoot_be_to_cpu32 (apart.heads) + * VasEBoot_be_to_cpu32 (apart.block_per_track)); + part.len = ((VasEBoot_be_to_cpu32 (apart.highcyl) + - VasEBoot_be_to_cpu32 (apart.lowcyl) + 1) + * VasEBoot_be_to_cpu32 (apart.heads) + * VasEBoot_be_to_cpu32 (apart.block_per_track)); part.offset = next; part.number = partno; part.index = 0; - part.partmap = &grub_amiga_partition_map; + part.partmap = &VasEBoot_amiga_partition_map; if (hook (disk, &part, hook_data)) - return grub_errno; + return VasEBoot_errno; - next = grub_be_to_cpu32 (apart.next); + next = VasEBoot_be_to_cpu32 (apart.next); partno++; } @@ -166,18 +166,18 @@ amiga_partition_map_iterate (grub_disk_t disk, /* Partition map type. */ -static struct grub_partition_map grub_amiga_partition_map = +static struct VasEBoot_partition_map VasEBoot_amiga_partition_map = { .name = "amiga", .iterate = amiga_partition_map_iterate, }; -GRUB_MOD_INIT(part_amiga) +VasEBoot_MOD_INIT(part_amiga) { - grub_partition_map_register (&grub_amiga_partition_map); + VasEBoot_partition_map_register (&VasEBoot_amiga_partition_map); } -GRUB_MOD_FINI(part_amiga) +VasEBoot_MOD_FINI(part_amiga) { - grub_partition_map_unregister (&grub_amiga_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_amiga_partition_map); } diff --git a/VasEBoot-core/partmap/apple.c b/VasEBoot-core/partmap/apple.c index c3ead0fcf..b9b2ec11e 100644 --- a/VasEBoot-core/partmap/apple.c +++ b/VasEBoot-core/partmap/apple.c @@ -1,57 +1,57 @@ /* apple.c - Read macintosh partition tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_APPLE_HEADER_MAGIC 0x4552 -#define GRUB_APPLE_PART_MAGIC 0x504D +#define VasEBoot_APPLE_HEADER_MAGIC 0x4552 +#define VasEBoot_APPLE_PART_MAGIC 0x504D -struct grub_apple_header +struct VasEBoot_apple_header { /* The magic number to identify the partition map, it should have the value `0x4552'. */ - grub_uint16_t magic; - grub_uint16_t blocksize; + VasEBoot_uint16_t magic; + VasEBoot_uint16_t blocksize; }; -struct grub_apple_part +struct VasEBoot_apple_part { /* The magic number to identify this as a partition, it should have the value `0x504D'. */ - grub_uint16_t magic; + VasEBoot_uint16_t magic; /* Reserved. */ - grub_uint16_t reserved; + VasEBoot_uint16_t reserved; /* The size of the partition map in blocks. */ - grub_uint32_t partmap_size; + VasEBoot_uint32_t partmap_size; /* The first physical block of the partition. */ - grub_uint32_t first_phys_block; + VasEBoot_uint32_t first_phys_block; /* The amount of blocks. */ - grub_uint32_t blockcnt; + VasEBoot_uint32_t blockcnt; /* The partition name. */ char partname[32]; @@ -60,113 +60,113 @@ struct grub_apple_part char parttype[32]; /* The first datablock of the partition. */ - grub_uint32_t datablocks_first; + VasEBoot_uint32_t datablocks_first; /* The amount datablocks. */ - grub_uint32_t datablocks_count; + VasEBoot_uint32_t datablocks_count; /* The status of the partition. (???) */ - grub_uint32_t status; + VasEBoot_uint32_t status; /* The first block on which the bootcode can be found. */ - grub_uint32_t bootcode_pos; + VasEBoot_uint32_t bootcode_pos; /* The size of the bootcode in bytes. */ - grub_uint32_t bootcode_size; + VasEBoot_uint32_t bootcode_size; /* The load address of the bootcode. */ - grub_uint32_t bootcode_loadaddr; + VasEBoot_uint32_t bootcode_loadaddr; /* Reserved. */ - grub_uint32_t reserved2; + VasEBoot_uint32_t reserved2; /* The entry point of the bootcode. */ - grub_uint32_t bootcode_entrypoint; + VasEBoot_uint32_t bootcode_entrypoint; /* Reserved. */ - grub_uint32_t reserved3; + VasEBoot_uint32_t reserved3; /* A checksum of the bootcode. */ - grub_uint32_t bootcode_checksum; + VasEBoot_uint32_t bootcode_checksum; /* The processor type. */ char processor[16]; /* Padding. */ - grub_uint16_t pad[187]; + VasEBoot_uint16_t pad[187]; }; -static struct grub_partition_map grub_apple_partition_map; +static struct VasEBoot_partition_map VasEBoot_apple_partition_map; -static grub_err_t -apple_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +apple_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition part; - struct grub_apple_header aheader; - struct grub_apple_part apart; + struct VasEBoot_partition part; + struct VasEBoot_apple_header aheader; + struct VasEBoot_apple_part apart; int partno = 0, partnum = 0; unsigned pos; - part.partmap = &grub_apple_partition_map; + part.partmap = &VasEBoot_apple_partition_map; - if (grub_disk_read (disk, 0, 0, sizeof (aheader), &aheader)) - return grub_errno; + if (VasEBoot_disk_read (disk, 0, 0, sizeof (aheader), &aheader)) + return VasEBoot_errno; - if (grub_be_to_cpu16 (aheader.magic) != GRUB_APPLE_HEADER_MAGIC) + if (VasEBoot_be_to_cpu16 (aheader.magic) != VasEBoot_APPLE_HEADER_MAGIC) { - grub_dprintf ("partition", + VasEBoot_dprintf ("partition", "bad magic (found 0x%x; wanted 0x%x)\n", - grub_be_to_cpu16 (aheader.magic), - GRUB_APPLE_HEADER_MAGIC); + VasEBoot_be_to_cpu16 (aheader.magic), + VasEBoot_APPLE_HEADER_MAGIC); goto fail; } - pos = grub_be_to_cpu16 (aheader.blocksize); + pos = VasEBoot_be_to_cpu16 (aheader.blocksize); do { - part.offset = pos / GRUB_DISK_SECTOR_SIZE; - part.index = pos % GRUB_DISK_SECTOR_SIZE; + part.offset = pos / VasEBoot_DISK_SECTOR_SIZE; + part.index = pos % VasEBoot_DISK_SECTOR_SIZE; - if (grub_disk_read (disk, part.offset, part.index, - sizeof (struct grub_apple_part), &apart)) - return grub_errno; + if (VasEBoot_disk_read (disk, part.offset, part.index, + sizeof (struct VasEBoot_apple_part), &apart)) + return VasEBoot_errno; - if (grub_be_to_cpu16 (apart.magic) != GRUB_APPLE_PART_MAGIC) + if (VasEBoot_be_to_cpu16 (apart.magic) != VasEBoot_APPLE_PART_MAGIC) { - grub_dprintf ("partition", + VasEBoot_dprintf ("partition", "partition %d: bad magic (found 0x%x; wanted 0x%x)\n", - partno, grub_be_to_cpu16 (apart.magic), - GRUB_APPLE_PART_MAGIC); + partno, VasEBoot_be_to_cpu16 (apart.magic), + VasEBoot_APPLE_PART_MAGIC); break; } if (partnum == 0) - partnum = grub_be_to_cpu32 (apart.partmap_size); + partnum = VasEBoot_be_to_cpu32 (apart.partmap_size); - part.start = ((grub_disk_addr_t) grub_be_to_cpu32 (apart.first_phys_block) - * grub_be_to_cpu16 (aheader.blocksize)) - / GRUB_DISK_SECTOR_SIZE; - part.len = ((grub_disk_addr_t) grub_be_to_cpu32 (apart.blockcnt) - * grub_be_to_cpu16 (aheader.blocksize)) - / GRUB_DISK_SECTOR_SIZE; + part.start = ((VasEBoot_disk_addr_t) VasEBoot_be_to_cpu32 (apart.first_phys_block) + * VasEBoot_be_to_cpu16 (aheader.blocksize)) + / VasEBoot_DISK_SECTOR_SIZE; + part.len = ((VasEBoot_disk_addr_t) VasEBoot_be_to_cpu32 (apart.blockcnt) + * VasEBoot_be_to_cpu16 (aheader.blocksize)) + / VasEBoot_DISK_SECTOR_SIZE; part.offset = pos; part.index = partno; part.number = partno; - grub_dprintf ("partition", + VasEBoot_dprintf ("partition", "partition %d: name %s, type %s, start 0x%x, len 0x%x\n", partno, apart.partname, apart.parttype, - grub_be_to_cpu32 (apart.first_phys_block), - grub_be_to_cpu32 (apart.blockcnt)); + VasEBoot_be_to_cpu32 (apart.first_phys_block), + VasEBoot_be_to_cpu32 (apart.blockcnt)); if (hook (disk, &part, hook_data)) - return grub_errno; + return VasEBoot_errno; - pos += grub_be_to_cpu16 (aheader.blocksize); + pos += VasEBoot_be_to_cpu16 (aheader.blocksize); partno++; } while (partno < partnum); @@ -175,25 +175,25 @@ apple_partition_map_iterate (grub_disk_t disk, return 0; fail: - return grub_error (GRUB_ERR_BAD_PART_TABLE, + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "Apple partition map not found"); } /* Partition map type. */ -static struct grub_partition_map grub_apple_partition_map = +static struct VasEBoot_partition_map VasEBoot_apple_partition_map = { .name = "apple", .iterate = apple_partition_map_iterate, }; -GRUB_MOD_INIT(part_apple) +VasEBoot_MOD_INIT(part_apple) { - grub_partition_map_register (&grub_apple_partition_map); + VasEBoot_partition_map_register (&VasEBoot_apple_partition_map); } -GRUB_MOD_FINI(part_apple) +VasEBoot_MOD_FINI(part_apple) { - grub_partition_map_unregister (&grub_apple_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_apple_partition_map); } diff --git a/VasEBoot-core/partmap/bsdlabel.c b/VasEBoot-core/partmap/bsdlabel.c index 1d785906b..fdd225056 100644 --- a/VasEBoot-core/partmap/bsdlabel.c +++ b/VasEBoot-core/partmap/bsdlabel.c @@ -1,98 +1,98 @@ /* bsdlabel.c - Read BSD style partition tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include #endif -static struct grub_partition_map grub_bsdlabel_partition_map; -static struct grub_partition_map grub_netbsdlabel_partition_map; -static struct grub_partition_map grub_openbsdlabel_partition_map; +static struct VasEBoot_partition_map VasEBoot_bsdlabel_partition_map; +static struct VasEBoot_partition_map VasEBoot_netbsdlabel_partition_map; +static struct VasEBoot_partition_map VasEBoot_openbsdlabel_partition_map; -static grub_err_t -iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd, - struct grub_partition_map *pmap, - grub_partition_iterate_hook_t hook, void *hook_data) +static VasEBoot_err_t +iterate_real (VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, int freebsd, + struct VasEBoot_partition_map *pmap, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition_bsd_disk_label label; - struct grub_partition p; - grub_disk_addr_t delta = 0; - grub_disk_addr_t pos; + struct VasEBoot_partition_bsd_disk_label label; + struct VasEBoot_partition p; + VasEBoot_disk_addr_t delta = 0; + VasEBoot_disk_addr_t pos; /* Read the BSD label. */ - if (grub_disk_read (disk, sector, 0, sizeof (label), &label)) - return grub_errno; + if (VasEBoot_disk_read (disk, sector, 0, sizeof (label), &label)) + return VasEBoot_errno; /* Check if it is valid. */ - if (label.magic != grub_cpu_to_le32_compile_time (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + if (label.magic != VasEBoot_cpu_to_le32_compile_time (VasEBoot_PC_PARTITION_BSD_LABEL_MAGIC)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no signature"); /* A kludge to determine a base of be.offset. */ - if (GRUB_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION - < grub_cpu_to_le16 (label.num_partitions) && freebsd) + if (VasEBoot_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION + < VasEBoot_cpu_to_le16 (label.num_partitions) && freebsd) { - struct grub_partition_bsd_entry whole_disk_be; + struct VasEBoot_partition_bsd_entry whole_disk_be; - pos = sizeof (label) + sector * GRUB_DISK_SECTOR_SIZE - + sizeof (struct grub_partition_bsd_entry) - * GRUB_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION; + pos = sizeof (label) + sector * VasEBoot_DISK_SECTOR_SIZE + + sizeof (struct VasEBoot_partition_bsd_entry) + * VasEBoot_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION; - if (grub_disk_read (disk, pos / GRUB_DISK_SECTOR_SIZE, - pos % GRUB_DISK_SECTOR_SIZE, sizeof (whole_disk_be), + if (VasEBoot_disk_read (disk, pos / VasEBoot_DISK_SECTOR_SIZE, + pos % VasEBoot_DISK_SECTOR_SIZE, sizeof (whole_disk_be), &whole_disk_be)) - return grub_errno; + return VasEBoot_errno; - delta = grub_le_to_cpu32 (whole_disk_be.offset); + delta = VasEBoot_le_to_cpu32 (whole_disk_be.offset); } - pos = sizeof (label) + sector * GRUB_DISK_SECTOR_SIZE; + pos = sizeof (label) + sector * VasEBoot_DISK_SECTOR_SIZE; for (p.number = 0; - p.number < grub_cpu_to_le16 (label.num_partitions); - p.number++, pos += sizeof (struct grub_partition_bsd_entry)) + p.number < VasEBoot_cpu_to_le16 (label.num_partitions); + p.number++, pos += sizeof (struct VasEBoot_partition_bsd_entry)) { - struct grub_partition_bsd_entry be; + struct VasEBoot_partition_bsd_entry be; - if (p.number == GRUB_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION) + if (p.number == VasEBoot_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION) continue; - p.offset = pos / GRUB_DISK_SECTOR_SIZE; - p.index = pos % GRUB_DISK_SECTOR_SIZE; + p.offset = pos / VasEBoot_DISK_SECTOR_SIZE; + p.index = pos % VasEBoot_DISK_SECTOR_SIZE; - if (grub_disk_read (disk, p.offset, p.index, sizeof (be), &be)) - return grub_errno; + if (VasEBoot_disk_read (disk, p.offset, p.index, sizeof (be), &be)) + return VasEBoot_errno; - p.start = grub_le_to_cpu32 (be.offset); - p.len = grub_le_to_cpu32 (be.size); + p.start = VasEBoot_le_to_cpu32 (be.offset); + p.len = VasEBoot_le_to_cpu32 (be.size); p.partmap = pmap; if (p.len == 0) @@ -100,15 +100,15 @@ iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd, if (p.start < delta) { -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL char *partname; /* disk->partition != NULL as 0 < delta */ - partname = disk->partition ? grub_partition_get_name (disk->partition) + partname = disk->partition ? VasEBoot_partition_get_name (disk->partition) : 0; - grub_util_warn (_("Discarding improperly nested partition (%s,%s,%s%d)"), + VasEBoot_util_warn (_("Discarding improperly nested partition (%s,%s,%s%d)"), disk->name, partname ? : "", p.partmap->name, p.number + 1); - grub_free (partname); + VasEBoot_free (partname); #endif continue; } @@ -116,82 +116,82 @@ iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd, p.start -= delta; if (hook (disk, &p, hook_data)) - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -bsdlabel_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +bsdlabel_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - if (disk->partition && grub_strcmp (disk->partition->partmap->name, "msdos") - == 0 && disk->partition->msdostype == GRUB_PC_PARTITION_TYPE_FREEBSD) - return iterate_real (disk, GRUB_PC_PARTITION_BSD_LABEL_SECTOR, 1, - &grub_bsdlabel_partition_map, hook, hook_data); + if (disk->partition && VasEBoot_strcmp (disk->partition->partmap->name, "msdos") + == 0 && disk->partition->msdostype == VasEBoot_PC_PARTITION_TYPE_FREEBSD) + return iterate_real (disk, VasEBoot_PC_PARTITION_BSD_LABEL_SECTOR, 1, + &VasEBoot_bsdlabel_partition_map, hook, hook_data); if (disk->partition - && (grub_strcmp (disk->partition->partmap->name, "msdos") == 0 - || disk->partition->partmap == &grub_bsdlabel_partition_map - || disk->partition->partmap == &grub_netbsdlabel_partition_map - || disk->partition->partmap == &grub_openbsdlabel_partition_map)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no embedding supported"); + && (VasEBoot_strcmp (disk->partition->partmap->name, "msdos") == 0 + || disk->partition->partmap == &VasEBoot_bsdlabel_partition_map + || disk->partition->partmap == &VasEBoot_netbsdlabel_partition_map + || disk->partition->partmap == &VasEBoot_openbsdlabel_partition_map)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no embedding supported"); - return iterate_real (disk, GRUB_PC_PARTITION_BSD_LABEL_SECTOR, 0, - &grub_bsdlabel_partition_map, hook, hook_data); + return iterate_real (disk, VasEBoot_PC_PARTITION_BSD_LABEL_SECTOR, 0, + &VasEBoot_bsdlabel_partition_map, hook, hook_data); } /* Context for netopenbsdlabel_partition_map_iterate. */ struct netopenbsdlabel_ctx { - grub_uint8_t type; - struct grub_partition_map *pmap; - grub_partition_iterate_hook_t hook; + VasEBoot_uint8_t type; + struct VasEBoot_partition_map *pmap; + VasEBoot_partition_iterate_hook_t hook; void *hook_data; int count; }; /* Helper for netopenbsdlabel_partition_map_iterate. */ static int -check_msdos (grub_disk_t dsk, const grub_partition_t partition, void *data) +check_msdos (VasEBoot_disk_t dsk, const VasEBoot_partition_t partition, void *data) { struct netopenbsdlabel_ctx *ctx = data; - grub_err_t err; + VasEBoot_err_t err; if (partition->msdostype != ctx->type) return 0; err = iterate_real (dsk, partition->start - + GRUB_PC_PARTITION_BSD_LABEL_SECTOR, 0, ctx->pmap, + + VasEBoot_PC_PARTITION_BSD_LABEL_SECTOR, 0, ctx->pmap, ctx->hook, ctx->hook_data); - if (err == GRUB_ERR_NONE) + if (err == VasEBoot_ERR_NONE) { ctx->count++; return 1; } - if (err == GRUB_ERR_BAD_PART_TABLE) + if (err == VasEBoot_ERR_BAD_PART_TABLE) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } - grub_print_error (); + VasEBoot_print_error (); return 0; } /* This is a total breakage. Even when net-/openbsd label is inside partition it actually describes the whole disk. */ -static grub_err_t -netopenbsdlabel_partition_map_iterate (grub_disk_t disk, grub_uint8_t type, - struct grub_partition_map *pmap, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +netopenbsdlabel_partition_map_iterate (VasEBoot_disk_t disk, VasEBoot_uint8_t type, + struct VasEBoot_partition_map *pmap, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - if (disk->partition && grub_strcmp (disk->partition->partmap->name, "msdos") + if (disk->partition && VasEBoot_strcmp (disk->partition->partmap->name, "msdos") == 0) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no embedding supported"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no embedding supported"); { struct netopenbsdlabel_ctx ctx = { @@ -201,54 +201,54 @@ netopenbsdlabel_partition_map_iterate (grub_disk_t disk, grub_uint8_t type, .hook_data = hook_data, .count = 0 }; - grub_err_t err; + VasEBoot_err_t err; - err = grub_partition_msdos_iterate (disk, check_msdos, &ctx); + err = VasEBoot_partition_msdos_iterate (disk, check_msdos, &ctx); if (err) return err; if (!ctx.count) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no bsdlabel found"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no bsdlabel found"); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -netbsdlabel_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +netbsdlabel_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { return netopenbsdlabel_partition_map_iterate (disk, - GRUB_PC_PARTITION_TYPE_NETBSD, - &grub_netbsdlabel_partition_map, + VasEBoot_PC_PARTITION_TYPE_NETBSD, + &VasEBoot_netbsdlabel_partition_map, hook, hook_data); } -static grub_err_t -openbsdlabel_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +openbsdlabel_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { return netopenbsdlabel_partition_map_iterate (disk, - GRUB_PC_PARTITION_TYPE_OPENBSD, - &grub_openbsdlabel_partition_map, + VasEBoot_PC_PARTITION_TYPE_OPENBSD, + &VasEBoot_openbsdlabel_partition_map, hook, hook_data); } -static struct grub_partition_map grub_bsdlabel_partition_map = +static struct VasEBoot_partition_map VasEBoot_bsdlabel_partition_map = { .name = "bsd", .iterate = bsdlabel_partition_map_iterate, }; -static struct grub_partition_map grub_openbsdlabel_partition_map = +static struct VasEBoot_partition_map VasEBoot_openbsdlabel_partition_map = { .name = "openbsd", .iterate = openbsdlabel_partition_map_iterate, }; -static struct grub_partition_map grub_netbsdlabel_partition_map = +static struct VasEBoot_partition_map VasEBoot_netbsdlabel_partition_map = { .name = "netbsd", .iterate = netbsdlabel_partition_map_iterate, @@ -256,16 +256,16 @@ static struct grub_partition_map grub_netbsdlabel_partition_map = -GRUB_MOD_INIT(part_bsd) +VasEBoot_MOD_INIT(part_bsd) { - grub_partition_map_register (&grub_bsdlabel_partition_map); - grub_partition_map_register (&grub_netbsdlabel_partition_map); - grub_partition_map_register (&grub_openbsdlabel_partition_map); + VasEBoot_partition_map_register (&VasEBoot_bsdlabel_partition_map); + VasEBoot_partition_map_register (&VasEBoot_netbsdlabel_partition_map); + VasEBoot_partition_map_register (&VasEBoot_openbsdlabel_partition_map); } -GRUB_MOD_FINI(part_bsd) +VasEBoot_MOD_FINI(part_bsd) { - grub_partition_map_unregister (&grub_bsdlabel_partition_map); - grub_partition_map_unregister (&grub_netbsdlabel_partition_map); - grub_partition_map_unregister (&grub_openbsdlabel_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_bsdlabel_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_netbsdlabel_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_openbsdlabel_partition_map); } diff --git a/VasEBoot-core/partmap/dfly.c b/VasEBoot-core/partmap/dfly.c index d30da8624..a125d2101 100644 --- a/VasEBoot-core/partmap/dfly.c +++ b/VasEBoot-core/partmap/dfly.c @@ -1,105 +1,105 @@ /* dfly.c - Read DragonFly BSD disklabel64. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static struct grub_partition_map grub_dfly_partition_map; +static struct VasEBoot_partition_map VasEBoot_dfly_partition_map; -#define GRUB_PARTITION_DISKLABEL64_HEADER_SIZE 200 +#define VasEBoot_PARTITION_DISKLABEL64_HEADER_SIZE 200 /* Full entry is 64 bytes however we really care only about offset and size which are in first 16 bytes. Avoid using too much stack. */ -#define GRUB_PARTITION_DISKLABEL64_ENTRY_SIZE 64 -struct grub_partition_disklabel64_entry +#define VasEBoot_PARTITION_DISKLABEL64_ENTRY_SIZE 64 +struct VasEBoot_partition_disklabel64_entry { - grub_uint64_t boffset; - grub_uint64_t bsize; + VasEBoot_uint64_t boffset; + VasEBoot_uint64_t bsize; }; /* Full entry is 200 bytes however we really care only about magic and number of partitions which are in first 16 bytes. Avoid using too much stack. */ -struct grub_partition_disklabel64 +struct VasEBoot_partition_disklabel64 { - grub_uint32_t magic; -#define GRUB_DISKLABEL64_MAGIC ((grub_uint32_t)0xc4464c59) - grub_uint32_t crc; - grub_uint32_t unused; - grub_uint32_t npartitions; + VasEBoot_uint32_t magic; +#define VasEBoot_DISKLABEL64_MAGIC ((VasEBoot_uint32_t)0xc4464c59) + VasEBoot_uint32_t crc; + VasEBoot_uint32_t unused; + VasEBoot_uint32_t npartitions; }; -static grub_err_t -dfly_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +dfly_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition part; + struct VasEBoot_partition part; unsigned partno, pos; - struct grub_partition_disklabel64 label; + struct VasEBoot_partition_disklabel64 label; - part.partmap = &grub_dfly_partition_map; + part.partmap = &VasEBoot_dfly_partition_map; - if (grub_disk_read (disk, 1, 0, sizeof (label), &label)) - return grub_errno; + if (VasEBoot_disk_read (disk, 1, 0, sizeof (label), &label)) + return VasEBoot_errno; - if (label.magic != grub_cpu_to_le32_compile_time (GRUB_DISKLABEL64_MAGIC)) + if (label.magic != VasEBoot_cpu_to_le32_compile_time (VasEBoot_DISKLABEL64_MAGIC)) { - grub_dprintf ("partition", + VasEBoot_dprintf ("partition", "bad magic (found 0x%x; wanted 0x%x)\n", - (unsigned int) grub_le_to_cpu32 (label.magic), - (unsigned int) GRUB_DISKLABEL64_MAGIC); - return grub_error (GRUB_ERR_BAD_PART_TABLE, "disklabel64 not found"); + (unsigned int) VasEBoot_le_to_cpu32 (label.magic), + (unsigned int) VasEBoot_DISKLABEL64_MAGIC); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "disklabel64 not found"); } - pos = GRUB_PARTITION_DISKLABEL64_HEADER_SIZE + GRUB_DISK_SECTOR_SIZE; + pos = VasEBoot_PARTITION_DISKLABEL64_HEADER_SIZE + VasEBoot_DISK_SECTOR_SIZE; for (partno = 0; - partno < grub_le_to_cpu32 (label.npartitions); ++partno) + partno < VasEBoot_le_to_cpu32 (label.npartitions); ++partno) { - grub_disk_addr_t sector = pos >> GRUB_DISK_SECTOR_BITS; - grub_off_t offset = pos & (GRUB_DISK_SECTOR_SIZE - 1); - struct grub_partition_disklabel64_entry dpart; + VasEBoot_disk_addr_t sector = pos >> VasEBoot_DISK_SECTOR_BITS; + VasEBoot_off_t offset = pos & (VasEBoot_DISK_SECTOR_SIZE - 1); + struct VasEBoot_partition_disklabel64_entry dpart; - pos += GRUB_PARTITION_DISKLABEL64_ENTRY_SIZE; - if (grub_disk_read (disk, sector, offset, sizeof (dpart), &dpart)) - return grub_errno; + pos += VasEBoot_PARTITION_DISKLABEL64_ENTRY_SIZE; + if (VasEBoot_disk_read (disk, sector, offset, sizeof (dpart), &dpart)) + return VasEBoot_errno; - grub_dprintf ("partition", + VasEBoot_dprintf ("partition", "partition %2d: offset 0x%llx, " "size 0x%llx\n", partno, - (unsigned long long) grub_le_to_cpu64 (dpart.boffset), - (unsigned long long) grub_le_to_cpu64 (dpart.bsize)); + (unsigned long long) VasEBoot_le_to_cpu64 (dpart.boffset), + (unsigned long long) VasEBoot_le_to_cpu64 (dpart.bsize)); /* Is partition initialized? */ if (dpart.bsize == 0) continue; part.number = partno; - part.start = grub_le_to_cpu64 (dpart.boffset) >> GRUB_DISK_SECTOR_BITS; - part.len = grub_le_to_cpu64 (dpart.bsize) >> GRUB_DISK_SECTOR_BITS; + part.start = VasEBoot_le_to_cpu64 (dpart.boffset) >> VasEBoot_DISK_SECTOR_BITS; + part.len = VasEBoot_le_to_cpu64 (dpart.bsize) >> VasEBoot_DISK_SECTOR_BITS; /* This is counter-intuitive, but part.offset and sector have * the same type, and offset (NOT part.offset) is guaranteed @@ -108,25 +108,25 @@ dfly_partition_map_iterate (grub_disk_t disk, part.index = offset; if (hook (disk, &part, hook_data)) - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Partition map type. */ -static struct grub_partition_map grub_dfly_partition_map = +static struct VasEBoot_partition_map VasEBoot_dfly_partition_map = { .name = "dfly", .iterate = dfly_partition_map_iterate, }; -GRUB_MOD_INIT(part_dfly) +VasEBoot_MOD_INIT(part_dfly) { - grub_partition_map_register (&grub_dfly_partition_map); + VasEBoot_partition_map_register (&VasEBoot_dfly_partition_map); } -GRUB_MOD_FINI(part_dfly) +VasEBoot_MOD_FINI(part_dfly) { - grub_partition_map_unregister (&grub_dfly_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_dfly_partition_map); } diff --git a/VasEBoot-core/partmap/dvh.c b/VasEBoot-core/partmap/dvh.c index 95c96186c..033cd15a3 100644 --- a/VasEBoot-core/partmap/dvh.c +++ b/VasEBoot-core/partmap/dvh.c @@ -1,91 +1,91 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define DVH_MAGIC 0x0be5a941 -struct grub_dvh_partition_descriptor +struct VasEBoot_dvh_partition_descriptor { - grub_uint32_t length; - grub_uint32_t start; - grub_uint32_t type; -} GRUB_PACKED; + VasEBoot_uint32_t length; + VasEBoot_uint32_t start; + VasEBoot_uint32_t type; +} VasEBoot_PACKED; -struct grub_dvh_block +struct VasEBoot_dvh_block { - grub_uint32_t magic; - grub_uint8_t unused[308]; - struct grub_dvh_partition_descriptor parts[16]; - grub_uint32_t checksum; - grub_uint32_t unused2; -} GRUB_PACKED; + VasEBoot_uint32_t magic; + VasEBoot_uint8_t unused[308]; + struct VasEBoot_dvh_partition_descriptor parts[16]; + VasEBoot_uint32_t checksum; + VasEBoot_uint32_t unused2; +} VasEBoot_PACKED; -static struct grub_partition_map grub_dvh_partition_map; +static struct VasEBoot_partition_map VasEBoot_dvh_partition_map; /* Verify checksum (true=ok). */ static int -grub_dvh_is_valid (grub_uint32_t *label) +VasEBoot_dvh_is_valid (VasEBoot_uint32_t *label) { - grub_uint32_t *pos; - grub_uint32_t sum = 0; + VasEBoot_uint32_t *pos; + VasEBoot_uint32_t sum = 0; for (pos = label; - pos < (label + sizeof (struct grub_dvh_block) / 4); + pos < (label + sizeof (struct VasEBoot_dvh_block) / 4); pos++) - sum += grub_be_to_cpu32 (*pos); + sum += VasEBoot_be_to_cpu32 (*pos); return ! sum; } -static grub_err_t -dvh_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, void *hook_data) +static VasEBoot_err_t +dvh_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition p; + struct VasEBoot_partition p; union { - struct grub_dvh_block dvh; - grub_uint32_t raw[0]; + struct VasEBoot_dvh_block dvh; + VasEBoot_uint32_t raw[0]; } block; unsigned partnum; - grub_err_t err; + VasEBoot_err_t err; - p.partmap = &grub_dvh_partition_map; - err = grub_disk_read (disk, 0, 0, sizeof (struct grub_dvh_block), + p.partmap = &VasEBoot_dvh_partition_map; + err = VasEBoot_disk_read (disk, 0, 0, sizeof (struct VasEBoot_dvh_block), &block); if (err) return err; - if (DVH_MAGIC != grub_be_to_cpu32 (block.dvh.magic)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a dvh partition table"); + if (DVH_MAGIC != VasEBoot_be_to_cpu32 (block.dvh.magic)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "not a dvh partition table"); - if (! grub_dvh_is_valid (block.raw)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum"); + if (! VasEBoot_dvh_is_valid (block.raw)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid checksum"); /* Maybe another error value would be better, because partition table _is_ recognized but invalid. */ @@ -97,31 +97,31 @@ dvh_partition_map_iterate (grub_disk_t disk, if (partnum == 10) continue; - p.start = grub_be_to_cpu32 (block.dvh.parts[partnum].start); - p.len = grub_be_to_cpu32 (block.dvh.parts[partnum].length); + p.start = VasEBoot_be_to_cpu32 (block.dvh.parts[partnum].start); + p.len = VasEBoot_be_to_cpu32 (block.dvh.parts[partnum].length); p.number = p.index = partnum; if (hook (disk, &p, hook_data)) break; } - return grub_errno; + return VasEBoot_errno; } /* Partition map type. */ -static struct grub_partition_map grub_dvh_partition_map = +static struct VasEBoot_partition_map VasEBoot_dvh_partition_map = { .name = "dvh", .iterate = dvh_partition_map_iterate, }; -GRUB_MOD_INIT(part_dvh) +VasEBoot_MOD_INIT(part_dvh) { - grub_partition_map_register (&grub_dvh_partition_map); + VasEBoot_partition_map_register (&VasEBoot_dvh_partition_map); } -GRUB_MOD_FINI(part_dvh) +VasEBoot_MOD_FINI(part_dvh) { - grub_partition_map_unregister (&grub_dvh_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_dvh_partition_map); } diff --git a/VasEBoot-core/partmap/gpt.c b/VasEBoot-core/partmap/gpt.c index 83bcba779..93b710407 100644 --- a/VasEBoot-core/partmap/gpt.c +++ b/VasEBoot-core/partmap/gpt.c @@ -1,152 +1,152 @@ /* gpt.c - Read GUID Partition Tables (GPT). */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint8_t grub_gpt_magic[8] = +static VasEBoot_uint8_t VasEBoot_gpt_magic[8] = { 0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54 }; -static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; +static const VasEBoot_gpt_part_type_t VasEBoot_gpt_partition_type_empty = VasEBoot_GPT_PARTITION_TYPE_EMPTY; -#ifdef GRUB_UTIL -static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; +#ifdef VasEBoot_UTIL +static const VasEBoot_gpt_part_type_t VasEBoot_gpt_partition_type_bios_boot = VasEBoot_GPT_PARTITION_TYPE_BIOS_BOOT; #endif /* 512 << 7 = 65536 byte sectors. */ #define MAX_SECTOR_LOG 7 -static struct grub_partition_map grub_gpt_partition_map; +static struct VasEBoot_partition_map VasEBoot_gpt_partition_map; -grub_err_t -grub_gpt_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +VasEBoot_err_t +VasEBoot_gpt_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition part; - struct grub_gpt_header gpt; - struct grub_gpt_partentry entry; - struct grub_msdos_partition_mbr mbr; - grub_uint64_t entries; + struct VasEBoot_partition part; + struct VasEBoot_gpt_header gpt; + struct VasEBoot_gpt_partentry entry; + struct VasEBoot_msdos_partition_mbr mbr; + VasEBoot_uint64_t entries; unsigned int i; int last_offset = 0; int sector_log = 0; /* Read the protective MBR. */ - if (grub_disk_read (disk, 0, 0, sizeof (mbr), &mbr)) - return grub_errno; + if (VasEBoot_disk_read (disk, 0, 0, sizeof (mbr), &mbr)) + return VasEBoot_errno; /* Check if it is valid. */ - if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + if (mbr.signature != VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no signature"); /* Make sure the MBR is a protective MBR and not a normal MBR. */ for (i = 0; i < 4; i++) - if (mbr.entries[i].type == GRUB_PC_PARTITION_TYPE_GPT_DISK) + if (mbr.entries[i].type == VasEBoot_PC_PARTITION_TYPE_GPT_DISK) break; if (i == 4) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no GPT partition map found"); /* Read the GPT header. */ for (sector_log = 0; sector_log < MAX_SECTOR_LOG; sector_log++) { - if (grub_disk_read (disk, 1 << sector_log, 0, sizeof (gpt), &gpt)) - return grub_errno; + if (VasEBoot_disk_read (disk, 1 << sector_log, 0, sizeof (gpt), &gpt)) + return VasEBoot_errno; - if (grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic)) == 0) + if (VasEBoot_memcmp (gpt.magic, VasEBoot_gpt_magic, sizeof (VasEBoot_gpt_magic)) == 0) break; } if (sector_log == MAX_SECTOR_LOG) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no valid GPT header"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no valid GPT header"); - grub_dprintf ("gpt", "Read a valid GPT header\n"); + VasEBoot_dprintf ("gpt", "Read a valid GPT header\n"); - entries = grub_le_to_cpu64 (gpt.partitions) << sector_log; - for (i = 0; i < grub_le_to_cpu32 (gpt.maxpart); i++) + entries = VasEBoot_le_to_cpu64 (gpt.partitions) << sector_log; + for (i = 0; i < VasEBoot_le_to_cpu32 (gpt.maxpart); i++) { - if (grub_disk_read (disk, entries, last_offset, + if (VasEBoot_disk_read (disk, entries, last_offset, sizeof (entry), &entry)) - return grub_errno; + return VasEBoot_errno; - if (grub_memcmp (&grub_gpt_partition_type_empty, &entry.type, - sizeof (grub_gpt_partition_type_empty))) + if (VasEBoot_memcmp (&VasEBoot_gpt_partition_type_empty, &entry.type, + sizeof (VasEBoot_gpt_partition_type_empty))) { /* Calculate the first block and the size of the partition. */ - part.start = grub_le_to_cpu64 (entry.start) << sector_log; - part.len = (grub_le_to_cpu64 (entry.end) - - grub_le_to_cpu64 (entry.start) + 1) << sector_log; + part.start = VasEBoot_le_to_cpu64 (entry.start) << sector_log; + part.len = (VasEBoot_le_to_cpu64 (entry.end) + - VasEBoot_le_to_cpu64 (entry.start) + 1) << sector_log; part.offset = entries; part.number = i; part.index = last_offset; - part.partmap = &grub_gpt_partition_map; + part.partmap = &VasEBoot_gpt_partition_map; part.parent = disk->partition; - grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n", i, + VasEBoot_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n", i, (unsigned long long) part.start, (unsigned long long) part.len); if (hook (disk, &part, hook_data)) - return grub_errno; + return VasEBoot_errno; } - last_offset += grub_le_to_cpu32 (gpt.partentry_size); - if (last_offset == GRUB_DISK_SECTOR_SIZE) + last_offset += VasEBoot_le_to_cpu32 (gpt.partentry_size); + if (last_offset == VasEBoot_DISK_SECTOR_SIZE) { last_offset = 0; entries++; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL /* Context for gpt_partition_map_embed. */ struct gpt_partition_map_embed_ctx { - grub_disk_addr_t start, len; + VasEBoot_disk_addr_t start, len; }; /* Helper for gpt_partition_map_embed. */ static int -find_usable_region (grub_disk_t disk __attribute__ ((unused)), - const grub_partition_t p, void *data) +find_usable_region (VasEBoot_disk_t disk __attribute__ ((unused)), + const VasEBoot_partition_t p, void *data) { struct gpt_partition_map_embed_ctx *ctx = data; - struct grub_gpt_partentry gptdata; - grub_partition_t p2; + struct VasEBoot_gpt_partentry gptdata; + VasEBoot_partition_t p2; p2 = disk->partition; disk->partition = p->parent; - if (grub_disk_read (disk, p->offset, p->index, + if (VasEBoot_disk_read (disk, p->offset, p->index, sizeof (gptdata), &gptdata)) { disk->partition = p2; @@ -155,7 +155,7 @@ find_usable_region (grub_disk_t disk __attribute__ ((unused)), disk->partition = p2; /* If there's an embed region, it is in a dedicated partition. */ - if (! grub_memcmp (&gptdata.type, &grub_gpt_partition_type_bios_boot, 16)) + if (! VasEBoot_memcmp (&gptdata.type, &VasEBoot_gpt_partition_type_bios_boot, 16)) { ctx->start = p->start; ctx->len = p->len; @@ -165,67 +165,67 @@ find_usable_region (grub_disk_t disk __attribute__ ((unused)), return 0; } -static grub_err_t -gpt_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, +static VasEBoot_err_t +gpt_partition_map_embed (struct VasEBoot_disk *disk, unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors) + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors) { struct gpt_partition_map_embed_ctx ctx = { .start = 0, .len = 0 }; unsigned i; - grub_err_t err; + VasEBoot_err_t err; - if (embed_type != GRUB_EMBED_PCBIOS) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (embed_type != VasEBoot_EMBED_PCBIOS) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "GPT currently supports only PC-BIOS embedding"); - err = grub_gpt_partition_map_iterate (disk, find_usable_region, &ctx); + err = VasEBoot_gpt_partition_map_iterate (disk, find_usable_region, &ctx); if (err) return err; if (ctx.len == 0) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("this GPT partition label contains no BIOS Boot Partition;" " embedding won't be possible")); if (ctx.len < *nsectors) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("your BIOS Boot Partition is too small;" " embedding won't be possible")); *nsectors = ctx.len; if (*nsectors > max_nsectors) *nsectors = max_nsectors; - *sectors = grub_malloc (*nsectors * sizeof (**sectors)); + *sectors = VasEBoot_malloc (*nsectors * sizeof (**sectors)); if (!*sectors) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < *nsectors; i++) (*sectors)[i] = ctx.start + i; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif /* Partition map type. */ -static struct grub_partition_map grub_gpt_partition_map = +static struct VasEBoot_partition_map VasEBoot_gpt_partition_map = { .name = "gpt", - .iterate = grub_gpt_partition_map_iterate, -#ifdef GRUB_UTIL + .iterate = VasEBoot_gpt_partition_map_iterate, +#ifdef VasEBoot_UTIL .embed = gpt_partition_map_embed #endif }; -GRUB_MOD_INIT(part_gpt) +VasEBoot_MOD_INIT(part_gpt) { - grub_partition_map_register (&grub_gpt_partition_map); + VasEBoot_partition_map_register (&VasEBoot_gpt_partition_map); } -GRUB_MOD_FINI(part_gpt) +VasEBoot_MOD_FINI(part_gpt) { - grub_partition_map_unregister (&grub_gpt_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_gpt_partition_map); } diff --git a/VasEBoot-core/partmap/msdos.c b/VasEBoot-core/partmap/msdos.c index 6d4b455a1..76d5192c7 100644 --- a/VasEBoot-core/partmap/msdos.c +++ b/VasEBoot-core/partmap/msdos.c @@ -1,37 +1,37 @@ /* pc.c - Read PC style partition tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static struct grub_partition_map grub_msdos_partition_map; +static struct VasEBoot_partition_map VasEBoot_msdos_partition_map; -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include struct embed_signature { @@ -45,7 +45,7 @@ const char message_warn[][200] = { /* TRANSLATORS: MBR gap and boot track is the same thing and is the space between MBR and first partitition. If your language translates well only "boot track", you can just use it everywhere. Next two messages are about - RAID controllers/software bugs which GRUB has to live with. Please spread + RAID controllers/software bugs which VasEBoot has to live with. Please spread the message that these are bugs in other software and not merely suboptimal behaviour. */ [TYPE_RAID] = N_("Sector %llu is already in use by raid controller `%s';" @@ -105,30 +105,30 @@ struct embed_signature embed_signatures[] = }; #endif -grub_err_t -grub_partition_msdos_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +VasEBoot_err_t +VasEBoot_partition_msdos_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition p; - struct grub_msdos_partition_mbr mbr; + struct VasEBoot_partition p; + struct VasEBoot_msdos_partition_mbr mbr; int labeln = 0; - grub_disk_addr_t lastaddr; - grub_disk_addr_t ext_offset; - grub_disk_addr_t delta = 0; + VasEBoot_disk_addr_t lastaddr; + VasEBoot_disk_addr_t ext_offset; + VasEBoot_disk_addr_t delta = 0; - if (disk->partition && disk->partition->partmap == &grub_msdos_partition_map) + if (disk->partition && disk->partition->partmap == &VasEBoot_msdos_partition_map) { - if (disk->partition->msdostype == GRUB_PC_PARTITION_TYPE_LINUX_MINIX) + if (disk->partition->msdostype == VasEBoot_PC_PARTITION_TYPE_LINUX_MINIX) delta = disk->partition->start; else - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no embedding supported"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no embedding supported"); } p.offset = 0; ext_offset = 0; p.number = -1; - p.partmap = &grub_msdos_partition_map; + p.partmap = &VasEBoot_msdos_partition_map; /* Any value different than `p.offset' will satisfy the check during first loop. */ @@ -137,17 +137,17 @@ grub_partition_msdos_iterate (grub_disk_t disk, while (1) { int i; - struct grub_msdos_partition_entry *e; + struct VasEBoot_msdos_partition_entry *e; /* Read the MBR. */ - if (grub_disk_read (disk, p.offset, 0, sizeof (mbr), &mbr)) + if (VasEBoot_disk_read (disk, p.offset, 0, sizeof (mbr), &mbr)) goto finish; /* If this is a GPT partition, this MBR is just a dummy. */ if (p.offset == 0) for (i = 0; i < 4; i++) - if (mbr.entries[i].type == GRUB_PC_PARTITION_TYPE_GPT_DISK) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr"); + if (mbr.entries[i].type == VasEBoot_PC_PARTITION_TYPE_GPT_DISK) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "dummy mbr"); /* This is our loop-detection algorithm. It works the following way: It saves last position which was a power of two. Then it compares the @@ -155,19 +155,19 @@ grub_partition_msdos_iterate (grub_disk_t disk, will be broken by at most third walk. */ if (labeln && lastaddr == p.offset) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "loop detected"); labeln++; if ((labeln & (labeln - 1)) == 0) lastaddr = p.offset; /* Check if it is valid. */ - if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + if (mbr.signature != VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no signature"); for (i = 0; i < 4; i++) if (mbr.entries[i].flag & 0x7f) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "bad boot flag"); /* Analyze DOS partitions. */ for (p.index = 0; p.index < 4; p.index++) @@ -175,26 +175,26 @@ grub_partition_msdos_iterate (grub_disk_t disk, e = mbr.entries + p.index; p.start = p.offset - + (grub_le_to_cpu32 (e->start) - << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)) - delta; - p.len = grub_le_to_cpu32 (e->length) - << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + + (VasEBoot_le_to_cpu32 (e->start) + << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS)) - delta; + p.len = VasEBoot_le_to_cpu32 (e->length) + << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS); p.msdostype = e->type; - grub_dprintf ("partition", + VasEBoot_dprintf ("partition", "partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 0x%llx\n", p.index, e->flag, e->type, (unsigned long long) p.start, (unsigned long long) p.len); /* If this partition is a normal one, call the hook. */ - if (! grub_msdos_partition_is_empty (e->type) - && ! grub_msdos_partition_is_extended (e->type)) + if (! VasEBoot_msdos_partition_is_empty (e->type) + && ! VasEBoot_msdos_partition_is_extended (e->type)) { p.number++; if (hook (disk, &p, hook_data)) - return grub_errno; + return VasEBoot_errno; } else if (p.number < 3) /* If this partition is a logical one, shouldn't increase the @@ -207,11 +207,11 @@ grub_partition_msdos_iterate (grub_disk_t disk, { e = mbr.entries + i; - if (grub_msdos_partition_is_extended (e->type)) + if (VasEBoot_msdos_partition_is_extended (e->type)) { p.offset = ext_offset - + (grub_le_to_cpu32 (e->start) - << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)); + + (VasEBoot_le_to_cpu32 (e->start) + << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS)); if (! ext_offset) ext_offset = p.offset; @@ -225,45 +225,45 @@ grub_partition_msdos_iterate (grub_disk_t disk, } finish: - return grub_errno; + return VasEBoot_errno; } -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL #pragma GCC diagnostic ignored "-Wformat-nonliteral" -static grub_err_t -pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, +static VasEBoot_err_t +pc_partition_map_embed (struct VasEBoot_disk *disk, unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors) + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors) { - grub_disk_addr_t end = ~0ULL; - struct grub_msdos_partition_mbr mbr; + VasEBoot_disk_addr_t end = ~0ULL; + struct VasEBoot_msdos_partition_mbr mbr; int labeln = 0; /* Any value different than `p.offset' will satisfy the check during first loop. */ - grub_disk_addr_t lastaddr = 1; - grub_disk_addr_t ext_offset = 0; - grub_disk_addr_t offset = 0; + VasEBoot_disk_addr_t lastaddr = 1; + VasEBoot_disk_addr_t ext_offset = 0; + VasEBoot_disk_addr_t offset = 0; - if (embed_type != GRUB_EMBED_PCBIOS) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + if (embed_type != VasEBoot_EMBED_PCBIOS) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "PC-style partitions currently support " "only PC-BIOS embedding"); if (disk->partition) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, "Embedding on MSDOS subpartition isn't supported"); while (1) { int i; - struct grub_msdos_partition_entry *e; - grub_err_t err; + struct VasEBoot_msdos_partition_entry *e; + VasEBoot_err_t err; /* Read the MBR. */ - err = grub_disk_read (disk, offset, 0, sizeof (mbr), &mbr); + err = VasEBoot_disk_read (disk, offset, 0, sizeof (mbr), &mbr); if (err) return err; @@ -273,35 +273,35 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, will be broken by at most third walk. */ if (labeln && lastaddr == offset) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "loop detected"); labeln++; if ((labeln & (labeln - 1)) == 0) lastaddr = offset; /* Check if it is valid. */ - if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + if (mbr.signature != VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "no signature"); for (i = 0; i < 4; i++) if (mbr.entries[i].flag & 0x7f) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "bad boot flag"); /* Analyze DOS partitions. */ for (i = 0; i < 4; i++) { e = mbr.entries + i; - if (!grub_msdos_partition_is_empty (e->type) + if (!VasEBoot_msdos_partition_is_empty (e->type) && end > offset - + (grub_le_to_cpu32 (e->start) - << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS))) - end = offset + (grub_le_to_cpu32 (e->start) - << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)); + + (VasEBoot_le_to_cpu32 (e->start) + << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS))) + end = offset + (VasEBoot_le_to_cpu32 (e->start) + << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS)); /* If this is a GPT partition, this MBR is just a dummy. */ - if (e->type == GRUB_PC_PARTITION_TYPE_GPT_DISK && i == 0) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr"); + if (e->type == VasEBoot_PC_PARTITION_TYPE_GPT_DISK && i == 0) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "dummy mbr"); } /* Find an extended partition. */ @@ -309,11 +309,11 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, { e = mbr.entries + i; - if (grub_msdos_partition_is_extended (e->type)) + if (VasEBoot_msdos_partition_is_extended (e->type)) { offset = ext_offset - + (grub_le_to_cpu32 (e->start) - << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)); + + (VasEBoot_le_to_cpu32 (e->start) + << (disk->log_sector_size - VasEBoot_DISK_SECTOR_BITS)); if (! ext_offset) ext_offset = offset; @@ -337,30 +337,30 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, avail_nsectors = *nsectors; if (*nsectors > max_nsectors) *nsectors = max_nsectors; - *sectors = grub_malloc (*nsectors * sizeof (**sectors)); + *sectors = VasEBoot_malloc (*nsectors * sizeof (**sectors)); if (!*sectors) - return grub_errno; + return VasEBoot_errno; for (i = 0; i < *nsectors; i++) (*sectors)[i] = 1 + i; /* Check for software that is already using parts of the embedding * area. */ - embed_signature_check = grub_malloc (GRUB_DISK_SECTOR_SIZE); + embed_signature_check = VasEBoot_malloc (VasEBoot_DISK_SECTOR_SIZE); for (i = 0; i < *nsectors; i++) { - if (grub_disk_read (disk, (*sectors)[i], 0, GRUB_DISK_SECTOR_SIZE, + if (VasEBoot_disk_read (disk, (*sectors)[i], 0, VasEBoot_DISK_SECTOR_SIZE, embed_signature_check)) continue; for (j = 0; j < ARRAY_SIZE (embed_signatures); j++) - if (! grub_memcmp (embed_signatures[j].signature, + if (! VasEBoot_memcmp (embed_signatures[j].signature, embed_signature_check, embed_signatures[j].signature_len)) break; if (j == ARRAY_SIZE (embed_signatures)) continue; - grub_util_warn (_(message_warn[embed_signatures[j].type]), + VasEBoot_util_warn (_(message_warn[embed_signatures[j].type]), (*sectors)[i], embed_signatures[j].name); avail_nsectors--; if (avail_nsectors < *nsectors) @@ -377,30 +377,30 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, /* Make sure to check the next sector. */ i--; } - grub_free (embed_signature_check); + VasEBoot_free (embed_signature_check); if (*nsectors < orig_nsectors) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("other software is using the embedding area, and " "there is not enough room for core.img. Such " "software is often trying to store data in a way " "that avoids detection. We recommend you " "investigate")); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } if (end <= 1) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, N_("this msdos-style partition label has no " "post-MBR gap; embedding won't be possible")); if (*nsectors > 62) - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("your core.img is unusually large. " "It won't fit in the embedding area")); - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("your embedding area is unusually small. " "core.img won't fit in it.")); } @@ -411,21 +411,21 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, /* Partition map type. */ -static struct grub_partition_map grub_msdos_partition_map = +static struct VasEBoot_partition_map VasEBoot_msdos_partition_map = { .name = "msdos", - .iterate = grub_partition_msdos_iterate, -#ifdef GRUB_UTIL + .iterate = VasEBoot_partition_msdos_iterate, +#ifdef VasEBoot_UTIL .embed = pc_partition_map_embed #endif }; -GRUB_MOD_INIT(part_msdos) +VasEBoot_MOD_INIT(part_msdos) { - grub_partition_map_register (&grub_msdos_partition_map); + VasEBoot_partition_map_register (&VasEBoot_msdos_partition_map); } -GRUB_MOD_FINI(part_msdos) +VasEBoot_MOD_FINI(part_msdos) { - grub_partition_map_unregister (&grub_msdos_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_msdos_partition_map); } diff --git a/VasEBoot-core/partmap/plan.c b/VasEBoot-core/partmap/plan.c index 83db2241c..f3f637c7d 100644 --- a/VasEBoot-core/partmap/plan.c +++ b/VasEBoot-core/partmap/plan.c @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static struct grub_partition_map grub_plan_partition_map; +static struct VasEBoot_partition_map VasEBoot_plan_partition_map; -static grub_err_t -plan_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +plan_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition p; + struct VasEBoot_partition p; int ptr = 0; - grub_err_t err; + VasEBoot_err_t err; - p.partmap = &grub_plan_partition_map; + p.partmap = &VasEBoot_plan_partition_map; p.msdostype = 0; for (p.number = 0; ; p.number++) @@ -46,33 +46,33 @@ plan_partition_map_iterate (grub_disk_t disk, char sig[sizeof ("part ") - 1]; char c; - p.offset = (ptr >> GRUB_DISK_SECTOR_BITS) + 1; - p.index = ptr & (GRUB_DISK_SECTOR_SIZE - 1); + p.offset = (ptr >> VasEBoot_DISK_SECTOR_BITS) + 1; + p.index = ptr & (VasEBoot_DISK_SECTOR_SIZE - 1); - err = grub_disk_read (disk, 1, ptr, sizeof (sig), sig); + err = VasEBoot_disk_read (disk, 1, ptr, sizeof (sig), sig); if (err) return err; - if (grub_memcmp (sig, "part ", sizeof ("part ") - 1) != 0) + if (VasEBoot_memcmp (sig, "part ", sizeof ("part ") - 1) != 0) break; ptr += sizeof (sig); do { - err = grub_disk_read (disk, 1, ptr, 1, &c); + err = VasEBoot_disk_read (disk, 1, ptr, 1, &c); if (err) return err; ptr++; } - while (grub_isdigit (c) || grub_isalpha (c)); + while (VasEBoot_isdigit (c) || VasEBoot_isalpha (c)); if (c != ' ') break; p.start = 0; while (1) { - err = grub_disk_read (disk, 1, ptr, 1, &c); + err = VasEBoot_disk_read (disk, 1, ptr, 1, &c); if (err) return err; ptr++; - if (!grub_isdigit (c)) + if (!VasEBoot_isdigit (c)) break; p.start = p.start * 10 + (c - '0'); } @@ -81,11 +81,11 @@ plan_partition_map_iterate (grub_disk_t disk, p.len = 0; while (1) { - err = grub_disk_read (disk, 1, ptr, 1, &c); + err = VasEBoot_disk_read (disk, 1, ptr, 1, &c); if (err) return err; ptr++; - if (!grub_isdigit (c)) + if (!VasEBoot_isdigit (c)) break; p.len = p.len * 10 + (c - '0'); } @@ -93,28 +93,28 @@ plan_partition_map_iterate (grub_disk_t disk, break; p.len -= p.start; if (hook (disk, &p, hook_data)) - return grub_errno; + return VasEBoot_errno; } if (p.number == 0) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a plan partition table"); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "not a plan partition table"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Partition map type. */ -static struct grub_partition_map grub_plan_partition_map = +static struct VasEBoot_partition_map VasEBoot_plan_partition_map = { .name = "plan", .iterate = plan_partition_map_iterate, }; -GRUB_MOD_INIT(part_plan) +VasEBoot_MOD_INIT(part_plan) { - grub_partition_map_register (&grub_plan_partition_map); + VasEBoot_partition_map_register (&VasEBoot_plan_partition_map); } -GRUB_MOD_FINI(part_plan) +VasEBoot_MOD_FINI(part_plan) { - grub_partition_map_unregister (&grub_plan_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_plan_partition_map); } diff --git a/VasEBoot-core/partmap/sun.c b/VasEBoot-core/partmap/sun.c index aac30a320..b26d4c5c2 100644 --- a/VasEBoot-core/partmap/sun.c +++ b/VasEBoot-core/partmap/sun.c @@ -1,154 +1,154 @@ /* sun.c - Read SUN style partition tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_PARTMAP_SUN_MAGIC 0xDABE -#define GRUB_PARTMAP_SUN_MAX_PARTS 8 -#define GRUB_PARTMAP_SUN_WHOLE_DISK_ID 0x05 +#define VasEBoot_PARTMAP_SUN_MAGIC 0xDABE +#define VasEBoot_PARTMAP_SUN_MAX_PARTS 8 +#define VasEBoot_PARTMAP_SUN_WHOLE_DISK_ID 0x05 -struct grub_sun_partition_info +struct VasEBoot_sun_partition_info { - grub_uint8_t spare1; - grub_uint8_t id; - grub_uint8_t spare2; - grub_uint8_t flags; -} GRUB_PACKED; + VasEBoot_uint8_t spare1; + VasEBoot_uint8_t id; + VasEBoot_uint8_t spare2; + VasEBoot_uint8_t flags; +} VasEBoot_PACKED; -struct grub_sun_partition_descriptor +struct VasEBoot_sun_partition_descriptor { - grub_uint32_t start_cylinder; - grub_uint32_t num_sectors; -} GRUB_PACKED; + VasEBoot_uint32_t start_cylinder; + VasEBoot_uint32_t num_sectors; +} VasEBoot_PACKED; -struct grub_sun_block +struct VasEBoot_sun_block { - grub_uint8_t info[128]; /* Informative text string. */ - grub_uint8_t spare0[14]; - struct grub_sun_partition_info infos[8]; - grub_uint8_t spare1[246]; /* Boot information etc. */ - grub_uint16_t rspeed; /* Disk rotational speed. */ - grub_uint16_t pcylcount; /* Physical cylinder count. */ - grub_uint16_t sparecyl; /* extra sects per cylinder. */ - grub_uint8_t spare2[4]; /* More magic... */ - grub_uint16_t ilfact; /* Interleave factor. */ - grub_uint16_t ncyl; /* Data cylinder count. */ - grub_uint16_t nacyl; /* Alt. cylinder count. */ - grub_uint16_t ntrks; /* Tracks per cylinder. */ - grub_uint16_t nsect; /* Sectors per track. */ - grub_uint8_t spare3[4]; /* Even more magic... */ - struct grub_sun_partition_descriptor partitions[8]; - grub_uint16_t magic; /* Magic number. */ - grub_uint16_t csum; /* Label xor'd checksum. */ -} GRUB_PACKED; + VasEBoot_uint8_t info[128]; /* Informative text string. */ + VasEBoot_uint8_t spare0[14]; + struct VasEBoot_sun_partition_info infos[8]; + VasEBoot_uint8_t spare1[246]; /* Boot information etc. */ + VasEBoot_uint16_t rspeed; /* Disk rotational speed. */ + VasEBoot_uint16_t pcylcount; /* Physical cylinder count. */ + VasEBoot_uint16_t sparecyl; /* extra sects per cylinder. */ + VasEBoot_uint8_t spare2[4]; /* More magic... */ + VasEBoot_uint16_t ilfact; /* Interleave factor. */ + VasEBoot_uint16_t ncyl; /* Data cylinder count. */ + VasEBoot_uint16_t nacyl; /* Alt. cylinder count. */ + VasEBoot_uint16_t ntrks; /* Tracks per cylinder. */ + VasEBoot_uint16_t nsect; /* Sectors per track. */ + VasEBoot_uint8_t spare3[4]; /* Even more magic... */ + struct VasEBoot_sun_partition_descriptor partitions[8]; + VasEBoot_uint16_t magic; /* Magic number. */ + VasEBoot_uint16_t csum; /* Label xor'd checksum. */ +} VasEBoot_PACKED; -static struct grub_partition_map grub_sun_partition_map; +static struct VasEBoot_partition_map VasEBoot_sun_partition_map; /* Verify checksum (true=ok). */ static int -grub_sun_is_valid (grub_uint16_t *label) +VasEBoot_sun_is_valid (VasEBoot_uint16_t *label) { - grub_uint16_t *pos; - grub_uint16_t sum = 0; + VasEBoot_uint16_t *pos; + VasEBoot_uint16_t sum = 0; for (pos = label; - pos < (label + sizeof (struct grub_sun_block) / 2); + pos < (label + sizeof (struct VasEBoot_sun_block) / 2); pos++) sum ^= *pos; return ! sum; } -static grub_err_t -sun_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, void *hook_data) +static VasEBoot_err_t +sun_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - struct grub_partition p; + struct VasEBoot_partition p; union { - struct grub_sun_block sun_block; - grub_uint16_t raw[0]; + struct VasEBoot_sun_block sun_block; + VasEBoot_uint16_t raw[0]; } block; int partnum; - grub_err_t err; + VasEBoot_err_t err; - p.partmap = &grub_sun_partition_map; - err = grub_disk_read (disk, 0, 0, sizeof (struct grub_sun_block), + p.partmap = &VasEBoot_sun_partition_map; + err = VasEBoot_disk_read (disk, 0, 0, sizeof (struct VasEBoot_sun_block), &block); if (err) return err; - if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sun_block.magic)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table"); + if (VasEBoot_PARTMAP_SUN_MAGIC != VasEBoot_be_to_cpu16 (block.sun_block.magic)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "not a sun partition table"); - if (! grub_sun_is_valid (block.raw)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum"); + if (! VasEBoot_sun_is_valid (block.raw)) + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid checksum"); /* Maybe another error value would be better, because partition table _is_ recognized but invalid. */ - for (partnum = 0; partnum < GRUB_PARTMAP_SUN_MAX_PARTS; partnum++) + for (partnum = 0; partnum < VasEBoot_PARTMAP_SUN_MAX_PARTS; partnum++) { - struct grub_sun_partition_descriptor *desc; + struct VasEBoot_sun_partition_descriptor *desc; if (block.sun_block.infos[partnum].id == 0 - || block.sun_block.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID) + || block.sun_block.infos[partnum].id == VasEBoot_PARTMAP_SUN_WHOLE_DISK_ID) continue; desc = &block.sun_block.partitions[partnum]; - p.start = ((grub_uint64_t) grub_be_to_cpu32 (desc->start_cylinder) - * grub_be_to_cpu16 (block.sun_block.ntrks) - * grub_be_to_cpu16 (block.sun_block.nsect)); - p.len = grub_be_to_cpu32 (desc->num_sectors); + p.start = ((VasEBoot_uint64_t) VasEBoot_be_to_cpu32 (desc->start_cylinder) + * VasEBoot_be_to_cpu16 (block.sun_block.ntrks) + * VasEBoot_be_to_cpu16 (block.sun_block.nsect)); + p.len = VasEBoot_be_to_cpu32 (desc->num_sectors); p.number = p.index = partnum; if (p.len) { if (hook (disk, &p, hook_data)) - partnum = GRUB_PARTMAP_SUN_MAX_PARTS; + partnum = VasEBoot_PARTMAP_SUN_MAX_PARTS; } } - return grub_errno; + return VasEBoot_errno; } /* Partition map type. */ -static struct grub_partition_map grub_sun_partition_map = +static struct VasEBoot_partition_map VasEBoot_sun_partition_map = { .name = "sun", .iterate = sun_partition_map_iterate, }; -GRUB_MOD_INIT(part_sun) +VasEBoot_MOD_INIT(part_sun) { - grub_partition_map_register (&grub_sun_partition_map); + VasEBoot_partition_map_register (&VasEBoot_sun_partition_map); } -GRUB_MOD_FINI(part_sun) +VasEBoot_MOD_FINI(part_sun) { - grub_partition_map_unregister (&grub_sun_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_sun_partition_map); } diff --git a/VasEBoot-core/partmap/sunpc.c b/VasEBoot-core/partmap/sunpc.c index 73a430c14..e5bb8ad24 100644 --- a/VasEBoot-core/partmap/sunpc.c +++ b/VasEBoot-core/partmap/sunpc.c @@ -1,151 +1,151 @@ /* sunpc.c - Read SUN PC style partition tables. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define GRUB_PARTMAP_SUN_PC_MAGIC 0xDABE -#define GRUB_PARTMAP_SUN_PC_MAX_PARTS 16 -#define GRUB_PARTMAP_SUN_PC_WHOLE_DISK_ID 0x05 +#define VasEBoot_PARTMAP_SUN_PC_MAGIC 0xDABE +#define VasEBoot_PARTMAP_SUN_PC_MAX_PARTS 16 +#define VasEBoot_PARTMAP_SUN_PC_WHOLE_DISK_ID 0x05 -struct grub_sun_pc_partition_descriptor +struct VasEBoot_sun_pc_partition_descriptor { - grub_uint16_t id; - grub_uint16_t unused; - grub_uint32_t start_sector; - grub_uint32_t num_sectors; -} GRUB_PACKED; + VasEBoot_uint16_t id; + VasEBoot_uint16_t unused; + VasEBoot_uint32_t start_sector; + VasEBoot_uint32_t num_sectors; +} VasEBoot_PACKED; -struct grub_sun_pc_block +struct VasEBoot_sun_pc_block { - grub_uint8_t unused[72]; - struct grub_sun_pc_partition_descriptor partitions[GRUB_PARTMAP_SUN_PC_MAX_PARTS]; - grub_uint8_t unused2[244]; - grub_uint16_t magic; /* Magic number. */ - grub_uint16_t csum; /* Label xor'd checksum. */ -} GRUB_PACKED; + VasEBoot_uint8_t unused[72]; + struct VasEBoot_sun_pc_partition_descriptor partitions[VasEBoot_PARTMAP_SUN_PC_MAX_PARTS]; + VasEBoot_uint8_t unused2[244]; + VasEBoot_uint16_t magic; /* Magic number. */ + VasEBoot_uint16_t csum; /* Label xor'd checksum. */ +} VasEBoot_PACKED; -static struct grub_partition_map grub_sun_pc_partition_map; +static struct VasEBoot_partition_map VasEBoot_sun_pc_partition_map; /* Verify checksum (true=ok). */ static int -grub_sun_is_valid (grub_uint16_t *label) +VasEBoot_sun_is_valid (VasEBoot_uint16_t *label) { - grub_uint16_t *pos; - grub_uint16_t sum = 0; + VasEBoot_uint16_t *pos; + VasEBoot_uint16_t sum = 0; for (pos = label; - pos < (label + sizeof (struct grub_sun_pc_block) / 2); + pos < (label + sizeof (struct VasEBoot_sun_pc_block) / 2); pos++) sum ^= *pos; return ! sum; } -static grub_err_t -sun_pc_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +static VasEBoot_err_t +sun_pc_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data) { - grub_partition_t p; + VasEBoot_partition_t p; union { - struct grub_sun_pc_block sun_block; - grub_uint16_t raw[0]; + struct VasEBoot_sun_pc_block sun_block; + VasEBoot_uint16_t raw[0]; } block; int partnum; - grub_err_t err; + VasEBoot_err_t err; - p = (grub_partition_t) grub_zalloc (sizeof (struct grub_partition)); + p = (VasEBoot_partition_t) VasEBoot_zalloc (sizeof (struct VasEBoot_partition)); if (! p) - return grub_errno; + return VasEBoot_errno; - p->partmap = &grub_sun_pc_partition_map; - err = grub_disk_read (disk, 1, 0, sizeof (struct grub_sun_pc_block), &block); + p->partmap = &VasEBoot_sun_pc_partition_map; + err = VasEBoot_disk_read (disk, 1, 0, sizeof (struct VasEBoot_sun_pc_block), &block); if (err) { - grub_free (p); + VasEBoot_free (p); return err; } - if (GRUB_PARTMAP_SUN_PC_MAGIC != grub_le_to_cpu16 (block.sun_block.magic)) + if (VasEBoot_PARTMAP_SUN_PC_MAGIC != VasEBoot_le_to_cpu16 (block.sun_block.magic)) { - grub_free (p); - return grub_error (GRUB_ERR_BAD_PART_TABLE, + VasEBoot_free (p); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "not a sun_pc partition table"); } - if (! grub_sun_is_valid (block.raw)) + if (! VasEBoot_sun_is_valid (block.raw)) { - grub_free (p); - return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum"); + VasEBoot_free (p); + return VasEBoot_error (VasEBoot_ERR_BAD_PART_TABLE, "invalid checksum"); } /* Maybe another error value would be better, because partition table _is_ recognized but invalid. */ - for (partnum = 0; partnum < GRUB_PARTMAP_SUN_PC_MAX_PARTS; partnum++) + for (partnum = 0; partnum < VasEBoot_PARTMAP_SUN_PC_MAX_PARTS; partnum++) { - struct grub_sun_pc_partition_descriptor *desc; + struct VasEBoot_sun_pc_partition_descriptor *desc; if (block.sun_block.partitions[partnum].id == 0 || block.sun_block.partitions[partnum].id - == GRUB_PARTMAP_SUN_PC_WHOLE_DISK_ID) + == VasEBoot_PARTMAP_SUN_PC_WHOLE_DISK_ID) continue; desc = &block.sun_block.partitions[partnum]; - p->start = grub_le_to_cpu32 (desc->start_sector); - p->len = grub_le_to_cpu32 (desc->num_sectors); + p->start = VasEBoot_le_to_cpu32 (desc->start_sector); + p->len = VasEBoot_le_to_cpu32 (desc->num_sectors); p->number = partnum; if (p->len) { if (hook (disk, p, hook_data)) - partnum = GRUB_PARTMAP_SUN_PC_MAX_PARTS; + partnum = VasEBoot_PARTMAP_SUN_PC_MAX_PARTS; } } - grub_free (p); + VasEBoot_free (p); - return grub_errno; + return VasEBoot_errno; } /* Partition map type. */ -static struct grub_partition_map grub_sun_pc_partition_map = +static struct VasEBoot_partition_map VasEBoot_sun_pc_partition_map = { .name = "sunpc", .iterate = sun_pc_partition_map_iterate, }; -GRUB_MOD_INIT(part_sunpc) +VasEBoot_MOD_INIT(part_sunpc) { - grub_partition_map_register (&grub_sun_pc_partition_map); + VasEBoot_partition_map_register (&VasEBoot_sun_pc_partition_map); } -GRUB_MOD_FINI(part_sunpc) +VasEBoot_MOD_FINI(part_sunpc) { - grub_partition_map_unregister (&grub_sun_pc_partition_map); + VasEBoot_partition_map_unregister (&VasEBoot_sun_pc_partition_map); } diff --git a/VasEBoot-core/parttool/msdospart.c b/VasEBoot-core/parttool/msdospart.c index dcbf74e3b..1b3271f3d 100644 --- a/VasEBoot-core/parttool/msdospart.c +++ b/VasEBoot-core/parttool/msdospart.c @@ -1,6 +1,6 @@ /* pcpart.c - manipulate fdisk partitions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -18,47 +18,47 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv2+"); +VasEBoot_MOD_LICENSE ("GPLv2+"); static int activate_table_handle = -1; static int type_table_handle = -1; -static struct grub_parttool_argdesc grub_pcpart_bootargs[] = +static struct VasEBoot_parttool_argdesc VasEBoot_pcpart_bootargs[] = { - {"boot", N_("Make partition active"), GRUB_PARTTOOL_ARG_BOOL}, + {"boot", N_("Make partition active"), VasEBoot_PARTTOOL_ARG_BOOL}, {0, 0, 0} }; -static grub_err_t grub_pcpart_boot (const grub_device_t dev, - const struct grub_parttool_args *args) +static VasEBoot_err_t VasEBoot_pcpart_boot (const VasEBoot_device_t dev, + const struct VasEBoot_parttool_args *args) { int i, index; - grub_partition_t part; - struct grub_msdos_partition_mbr mbr; + VasEBoot_partition_t part; + struct VasEBoot_msdos_partition_mbr mbr; if (dev->disk->partition->offset) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("not a primary partition")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("not a primary partition")); index = dev->disk->partition->index; part = dev->disk->partition; dev->disk->partition = part->parent; /* Read the MBR. */ - if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), &mbr)) + if (VasEBoot_disk_read (dev->disk, 0, 0, sizeof (mbr), &mbr)) { dev->disk->partition = part; - return grub_errno; + return VasEBoot_errno; } if (args[0].set && args[0].bool) @@ -66,67 +66,67 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev, for (i = 0; i < 4; i++) mbr.entries[i].flag = 0x0; mbr.entries[index].flag = 0x80; - grub_printf_ (N_("Partition %d is active now. \n"), index); + VasEBoot_printf_ (N_("Partition %d is active now. \n"), index); } else { mbr.entries[index].flag = 0x0; - grub_printf (N_("Cleared active flag on %d. \n"), index); + VasEBoot_printf (N_("Cleared active flag on %d. \n"), index); } /* Write the MBR. */ - grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr); + VasEBoot_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr); dev->disk->partition = part; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_parttool_argdesc grub_pcpart_typeargs[] = +static struct VasEBoot_parttool_argdesc VasEBoot_pcpart_typeargs[] = { - {"type", N_("Change partition type"), GRUB_PARTTOOL_ARG_VAL}, - {"hidden", N_("Set `hidden' flag in partition type"), GRUB_PARTTOOL_ARG_BOOL}, + {"type", N_("Change partition type"), VasEBoot_PARTTOOL_ARG_VAL}, + {"hidden", N_("Set `hidden' flag in partition type"), VasEBoot_PARTTOOL_ARG_BOOL}, {0, 0, 0} }; -static grub_err_t grub_pcpart_type (const grub_device_t dev, - const struct grub_parttool_args *args) +static VasEBoot_err_t VasEBoot_pcpart_type (const VasEBoot_device_t dev, + const struct VasEBoot_parttool_args *args) { int index; - grub_uint8_t type; - grub_partition_t part; - struct grub_msdos_partition_mbr mbr; + VasEBoot_uint8_t type; + VasEBoot_partition_t part; + struct VasEBoot_msdos_partition_mbr mbr; index = dev->disk->partition->index; part = dev->disk->partition; dev->disk->partition = part->parent; /* Read the parttable. */ - if (grub_disk_read (dev->disk, part->offset, 0, + if (VasEBoot_disk_read (dev->disk, part->offset, 0, sizeof (mbr), &mbr)) { dev->disk->partition = part; - return grub_errno; + return VasEBoot_errno; } if (args[0].set) - type = grub_strtoul (args[0].str, 0, 0); + type = VasEBoot_strtoul (args[0].str, 0, 0); else type = mbr.entries[index].type; if (args[1].set) { if (args[1].bool) - type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG; + type |= VasEBoot_PC_PARTITION_TYPE_HIDDEN_FLAG; else - type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG; + type &= ~VasEBoot_PC_PARTITION_TYPE_HIDDEN_FLAG; } - if (grub_msdos_partition_is_empty (type) - || grub_msdos_partition_is_extended (type)) + if (VasEBoot_msdos_partition_is_empty (type) + || VasEBoot_msdos_partition_is_extended (type)) { dev->disk->partition = part; - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("the partition type 0x%x isn't " "valid")); } @@ -134,29 +134,29 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, mbr.entries[index].type = type; /* TRANSLATORS: In this case we're actually writing to the disk and actively modifying partition type rather than just defining it. */ - grub_printf_ (N_("Setting partition type to 0x%x\n"), type); + VasEBoot_printf_ (N_("Setting partition type to 0x%x\n"), type); /* Write the parttable. */ - grub_disk_write (dev->disk, part->offset, 0, + VasEBoot_disk_write (dev->disk, part->offset, 0, sizeof (mbr), &mbr); dev->disk->partition = part; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -GRUB_MOD_INIT (msdospart) +VasEBoot_MOD_INIT (msdospart) { - activate_table_handle = grub_parttool_register ("msdos", - grub_pcpart_boot, - grub_pcpart_bootargs); - type_table_handle = grub_parttool_register ("msdos", - grub_pcpart_type, - grub_pcpart_typeargs); + activate_table_handle = VasEBoot_parttool_register ("msdos", + VasEBoot_pcpart_boot, + VasEBoot_pcpart_bootargs); + type_table_handle = VasEBoot_parttool_register ("msdos", + VasEBoot_pcpart_type, + VasEBoot_pcpart_typeargs); } -GRUB_MOD_FINI(msdospart) +VasEBoot_MOD_FINI(msdospart) { - grub_parttool_unregister (activate_table_handle); - grub_parttool_unregister (type_table_handle); + VasEBoot_parttool_unregister (activate_table_handle); + VasEBoot_parttool_unregister (type_table_handle); } diff --git a/VasEBoot-core/script/argv.c b/VasEBoot-core/script/argv.c index 217ec5d1e..7e401db8d 100644 --- a/VasEBoot-core/script/argv.c +++ b/VasEBoot-core/script/argv.c @@ -1,25 +1,25 @@ /* argv.c - methods for constructing argument vector */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include /* Return nearest power of two that is >= v. */ static unsigned @@ -41,16 +41,16 @@ round_up_exp (unsigned v) } void -grub_script_argv_free (struct grub_script_argv *argv) +VasEBoot_script_argv_free (struct VasEBoot_script_argv *argv) { unsigned i; if (argv->args) { for (i = 0; i < argv->argc; i++) - grub_free (argv->args[i]); + VasEBoot_free (argv->args[i]); - grub_free (argv->args); + VasEBoot_free (argv->args); } argv->argc = 0; @@ -60,16 +60,16 @@ grub_script_argv_free (struct grub_script_argv *argv) /* Make argv from argc, args pair. */ int -grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args) +VasEBoot_script_argv_make (struct VasEBoot_script_argv *argv, int argc, char **args) { int i; - struct grub_script_argv r = { 0, 0, 0 }; + struct VasEBoot_script_argv r = { 0, 0, 0 }; for (i = 0; i < argc; i++) - if (grub_script_argv_next (&r) - || grub_script_argv_append (&r, args[i], grub_strlen (args[i]))) + if (VasEBoot_script_argv_next (&r) + || VasEBoot_script_argv_append (&r, args[i], VasEBoot_strlen (args[i]))) { - grub_script_argv_free (&r); + VasEBoot_script_argv_free (&r); return 1; } *argv = r; @@ -78,14 +78,14 @@ grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args) /* Prepare for next argc. */ int -grub_script_argv_next (struct grub_script_argv *argv) +VasEBoot_script_argv_next (struct VasEBoot_script_argv *argv) { char **p = argv->args; if (argv->args && argv->argc && argv->args[argv->argc - 1] == 0) return 0; - p = grub_realloc (p, round_up_exp ((argv->argc + 2) * sizeof (char *))); + p = VasEBoot_realloc (p, round_up_exp ((argv->argc + 2) * sizeof (char *))); if (! p) return 1; @@ -100,22 +100,22 @@ grub_script_argv_next (struct grub_script_argv *argv) /* Append `s' to the last argument. */ int -grub_script_argv_append (struct grub_script_argv *argv, const char *s, - grub_size_t slen) +VasEBoot_script_argv_append (struct VasEBoot_script_argv *argv, const char *s, + VasEBoot_size_t slen) { - grub_size_t a; + VasEBoot_size_t a; char *p = argv->args[argv->argc - 1]; if (! s) return 0; - a = p ? grub_strlen (p) : 0; + a = p ? VasEBoot_strlen (p) : 0; - p = grub_realloc (p, round_up_exp ((a + slen + 1) * sizeof (char))); + p = VasEBoot_realloc (p, round_up_exp ((a + slen + 1) * sizeof (char))); if (! p) return 1; - grub_memcpy (p + a, s, slen); + VasEBoot_memcpy (p + a, s, slen); p[a+slen] = 0; argv->args[argv->argc - 1] = p; @@ -124,7 +124,7 @@ grub_script_argv_append (struct grub_script_argv *argv, const char *s, /* Split `s' and append words as multiple arguments. */ int -grub_script_argv_split_append (struct grub_script_argv *argv, const char *s) +VasEBoot_script_argv_split_append (struct VasEBoot_script_argv *argv, const char *s) { const char *p; int errors = 0; @@ -132,22 +132,22 @@ grub_script_argv_split_append (struct grub_script_argv *argv, const char *s) if (! s) return 0; - while (*s && grub_isspace (*s)) + while (*s && VasEBoot_isspace (*s)) s++; while (! errors && *s) { p = s; - while (*s && ! grub_isspace (*s)) + while (*s && ! VasEBoot_isspace (*s)) s++; - errors += grub_script_argv_append (argv, p, s - p); + errors += VasEBoot_script_argv_append (argv, p, s - p); - while (*s && grub_isspace (*s)) + while (*s && VasEBoot_isspace (*s)) s++; if (*s) - errors += grub_script_argv_next (argv); + errors += VasEBoot_script_argv_next (argv); } return errors; } diff --git a/VasEBoot-core/script/execute.c b/VasEBoot-core/script/execute.c index 488bc6bc8..26c92d7b8 100644 --- a/VasEBoot-core/script/execute.c +++ b/VasEBoot-core/script/execute.c @@ -1,33 +1,33 @@ -/* execute.c -- Execute a GRUB script. */ +/* execute.c -- Execute a VasEBoot script. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Max digits for a char is 3 (0xFF is 255), similarly for an int it is sizeof (int) * 3, and one extra for a possible -ve sign. */ @@ -38,20 +38,20 @@ static unsigned long active_loops; static unsigned long active_breaks; static unsigned long function_return; -#define GRUB_SCRIPT_SCOPE_MALLOCED 1 -#define GRUB_SCRIPT_SCOPE_ARGS_MALLOCED 2 +#define VasEBoot_SCRIPT_SCOPE_MALLOCED 1 +#define VasEBoot_SCRIPT_SCOPE_ARGS_MALLOCED 2 -/* Scope for grub script functions. */ -struct grub_script_scope +/* Scope for VasEBoot script functions. */ +struct VasEBoot_script_scope { unsigned flags; unsigned shifts; - struct grub_script_argv argv; + struct VasEBoot_script_argv argv; }; -static struct grub_script_scope *scope = 0; +static struct VasEBoot_script_scope *scope = 0; -/* Wildcard translator for GRUB script. */ -struct grub_script_wildcard_translator *grub_wildcard_translator; +/* Wildcard translator for VasEBoot script. */ +struct VasEBoot_script_wildcard_translator *VasEBoot_wildcard_translator; static char* wildcard_escape (const char *s) @@ -61,8 +61,8 @@ wildcard_escape (const char *s) char ch; char *p; - len = grub_strlen (s); - p = grub_malloc (len * 2 + 1); + len = VasEBoot_strlen (s); + p = VasEBoot_malloc (len * 2 + 1); if (! p) return NULL; @@ -85,8 +85,8 @@ wildcard_unescape (const char *s) char ch; char *p; - len = grub_strlen (s); - p = grub_malloc (len + 1); + len = VasEBoot_strlen (s); + p = VasEBoot_malloc (len + 1); if (! p) return NULL; @@ -103,24 +103,24 @@ wildcard_unescape (const char *s) } static void -replace_scope (struct grub_script_scope *new_scope) +replace_scope (struct VasEBoot_script_scope *new_scope) { if (scope) { scope->argv.argc += scope->shifts; scope->argv.args -= scope->shifts; - if (scope->flags & GRUB_SCRIPT_SCOPE_ARGS_MALLOCED) - grub_script_argv_free (&scope->argv); + if (scope->flags & VasEBoot_SCRIPT_SCOPE_ARGS_MALLOCED) + VasEBoot_script_argv_free (&scope->argv); - if (scope->flags & GRUB_SCRIPT_SCOPE_MALLOCED) - grub_free (scope); + if (scope->flags & VasEBoot_SCRIPT_SCOPE_MALLOCED) + VasEBoot_free (scope); } scope = new_scope; } -grub_err_t -grub_script_break (grub_command_t cmd, int argc, char *argv[]) +VasEBoot_err_t +VasEBoot_script_break (VasEBoot_command_t cmd, int argc, char *argv[]) { char *p = 0; unsigned long count; @@ -128,98 +128,98 @@ grub_script_break (grub_command_t cmd, int argc, char *argv[]) if (argc == 0) count = 1; else if (argc > 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); else { - count = grub_strtoul (argv[0], &p, 10); - if (grub_errno) - return grub_errno; + count = VasEBoot_strtoul (argv[0], &p, 10); + if (VasEBoot_errno) + return VasEBoot_errno; if (*p != '\0') - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unrecognized number")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unrecognized number")); if (count == 0) /* TRANSLATORS: 0 is a quantifier. "break" (similar to bash) can be used e.g. to break 3 loops at once. But asking it to break 0 loops makes no sense. */ - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't break 0 loops")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("can't break 0 loops")); } - is_continue = grub_strcmp (cmd->name, "break") ? 1 : 0; + is_continue = VasEBoot_strcmp (cmd->name, "break") ? 1 : 0; active_breaks = count; if (active_breaks > active_loops) active_breaks = active_loops; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_script_shift (grub_command_t cmd __attribute__((unused)), +VasEBoot_err_t +VasEBoot_script_shift (VasEBoot_command_t cmd __attribute__((unused)), int argc, char *argv[]) { char *p = 0; unsigned long n = 0; if (! scope) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (argc == 0) n = 1; else if (argc > 1) - return GRUB_ERR_BAD_ARGUMENT; + return VasEBoot_ERR_BAD_ARGUMENT; else { - n = grub_strtoul (argv[0], &p, 10); + n = VasEBoot_strtoul (argv[0], &p, 10); if (*p != '\0') - return GRUB_ERR_BAD_ARGUMENT; + return VasEBoot_ERR_BAD_ARGUMENT; } if (n > scope->argv.argc) - return GRUB_ERR_BAD_ARGUMENT; + return VasEBoot_ERR_BAD_ARGUMENT; scope->shifts += n; scope->argv.argc -= n; scope->argv.args += n; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_script_setparams (grub_command_t cmd __attribute__((unused)), +VasEBoot_err_t +VasEBoot_script_setparams (VasEBoot_command_t cmd __attribute__((unused)), int argc, char **args) { - struct grub_script_scope *new_scope; - struct grub_script_argv argv = { 0, 0, 0 }; + struct VasEBoot_script_scope *new_scope; + struct VasEBoot_script_argv argv = { 0, 0, 0 }; if (! scope) - return GRUB_ERR_INVALID_COMMAND; + return VasEBoot_ERR_INVALID_COMMAND; - new_scope = grub_malloc (sizeof (*new_scope)); + new_scope = VasEBoot_malloc (sizeof (*new_scope)); if (! new_scope) - return grub_errno; + return VasEBoot_errno; - if (grub_script_argv_make (&argv, argc, args)) + if (VasEBoot_script_argv_make (&argv, argc, args)) { - grub_free (new_scope); - return grub_errno; + VasEBoot_free (new_scope); + return VasEBoot_errno; } new_scope->shifts = 0; new_scope->argv = argv; - new_scope->flags = GRUB_SCRIPT_SCOPE_MALLOCED | - GRUB_SCRIPT_SCOPE_ARGS_MALLOCED; + new_scope->flags = VasEBoot_SCRIPT_SCOPE_MALLOCED | + VasEBoot_SCRIPT_SCOPE_ARGS_MALLOCED; replace_scope (new_scope); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_script_return (grub_command_t cmd __attribute__((unused)), +VasEBoot_err_t +VasEBoot_script_return (VasEBoot_command_t cmd __attribute__((unused)), int argc, char *argv[]) { char *p; unsigned long n; if (! scope || argc > 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, /* TRANSLATORS: It's about not being inside a function. "return" can be used only in a function and this error occurs if it's used @@ -230,126 +230,126 @@ grub_script_return (grub_command_t cmd __attribute__((unused)), { const char *t; function_return = 1; - t = grub_env_get ("?"); + t = VasEBoot_env_get ("?"); if (!t) - return GRUB_ERR_NONE; - return grub_strtoul (t, NULL, 10); + return VasEBoot_ERR_NONE; + return VasEBoot_strtoul (t, NULL, 10); } - n = grub_strtoul (argv[0], &p, 10); - if (grub_errno) - return grub_errno; + n = VasEBoot_strtoul (argv[0], &p, 10); + if (VasEBoot_errno) + return VasEBoot_errno; if (*p != '\0') - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unrecognized number")); function_return = 1; - return n ? grub_error (n, N_("false")) : GRUB_ERR_NONE; + return n ? VasEBoot_error (n, N_("false")) : VasEBoot_ERR_NONE; } static int -grub_env_special (const char *name) +VasEBoot_env_special (const char *name) { - if (grub_isdigit (name[0]) || - grub_strcmp (name, "#") == 0 || - grub_strcmp (name, "*") == 0 || - grub_strcmp (name, "@") == 0) + if (VasEBoot_isdigit (name[0]) || + VasEBoot_strcmp (name, "#") == 0 || + VasEBoot_strcmp (name, "*") == 0 || + VasEBoot_strcmp (name, "@") == 0) return 1; return 0; } static char ** -grub_script_env_get (const char *name, grub_script_arg_type_t type) +VasEBoot_script_env_get (const char *name, VasEBoot_script_arg_type_t type) { unsigned i; - struct grub_script_argv result = { 0, 0, 0 }; + struct VasEBoot_script_argv result = { 0, 0, 0 }; - if (grub_script_argv_next (&result)) + if (VasEBoot_script_argv_next (&result)) goto fail; - if (! grub_env_special (name)) + if (! VasEBoot_env_special (name)) { - const char *v = grub_env_get (name); + const char *v = VasEBoot_env_get (name); if (v && v[0]) { - if (type == GRUB_SCRIPT_ARG_TYPE_VAR) + if (type == VasEBoot_SCRIPT_ARG_TYPE_VAR) { - if (grub_script_argv_split_append (&result, v)) + if (VasEBoot_script_argv_split_append (&result, v)) goto fail; } else - if (grub_script_argv_append (&result, v, grub_strlen (v))) + if (VasEBoot_script_argv_append (&result, v, VasEBoot_strlen (v))) goto fail; } } else if (! scope) { - if (grub_script_argv_append (&result, 0, 0)) + if (VasEBoot_script_argv_append (&result, 0, 0)) goto fail; } - else if (grub_strcmp (name, "#") == 0) + else if (VasEBoot_strcmp (name, "#") == 0) { char buffer[ERRNO_DIGITS_MAX + 1]; - grub_snprintf (buffer, sizeof (buffer), "%u", scope->argv.argc); - if (grub_script_argv_append (&result, buffer, grub_strlen (buffer))) + VasEBoot_snprintf (buffer, sizeof (buffer), "%u", scope->argv.argc); + if (VasEBoot_script_argv_append (&result, buffer, VasEBoot_strlen (buffer))) goto fail; } - else if (grub_strcmp (name, "*") == 0) + else if (VasEBoot_strcmp (name, "*") == 0) { for (i = 0; i < scope->argv.argc; i++) - if (type == GRUB_SCRIPT_ARG_TYPE_VAR) + if (type == VasEBoot_SCRIPT_ARG_TYPE_VAR) { - if (i != 0 && grub_script_argv_next (&result)) + if (i != 0 && VasEBoot_script_argv_next (&result)) goto fail; - if (grub_script_argv_split_append (&result, scope->argv.args[i])) + if (VasEBoot_script_argv_split_append (&result, scope->argv.args[i])) goto fail; } else { - if (i != 0 && grub_script_argv_append (&result, " ", 1)) + if (i != 0 && VasEBoot_script_argv_append (&result, " ", 1)) goto fail; - if (grub_script_argv_append (&result, scope->argv.args[i], - grub_strlen (scope->argv.args[i]))) + if (VasEBoot_script_argv_append (&result, scope->argv.args[i], + VasEBoot_strlen (scope->argv.args[i]))) goto fail; } } - else if (grub_strcmp (name, "@") == 0) + else if (VasEBoot_strcmp (name, "@") == 0) { for (i = 0; i < scope->argv.argc; i++) { - if (i != 0 && grub_script_argv_next (&result)) + if (i != 0 && VasEBoot_script_argv_next (&result)) goto fail; - if (type == GRUB_SCRIPT_ARG_TYPE_VAR) + if (type == VasEBoot_SCRIPT_ARG_TYPE_VAR) { - if (grub_script_argv_split_append (&result, scope->argv.args[i])) + if (VasEBoot_script_argv_split_append (&result, scope->argv.args[i])) goto fail; } else - if (grub_script_argv_append (&result, scope->argv.args[i], - grub_strlen (scope->argv.args[i]))) + if (VasEBoot_script_argv_append (&result, scope->argv.args[i], + VasEBoot_strlen (scope->argv.args[i]))) goto fail; } } else { - unsigned long num = grub_strtoul (name, 0, 10); + unsigned long num = VasEBoot_strtoul (name, 0, 10); if (num == 0) ; /* XXX no file name, for now. */ else if (num <= scope->argv.argc) { - if (type == GRUB_SCRIPT_ARG_TYPE_VAR) + if (type == VasEBoot_SCRIPT_ARG_TYPE_VAR) { - if (grub_script_argv_split_append (&result, + if (VasEBoot_script_argv_split_append (&result, scope->argv.args[num - 1])) goto fail; } else - if (grub_script_argv_append (&result, scope->argv.args[num - 1], - grub_strlen (scope->argv.args[num - 1]) + if (VasEBoot_script_argv_append (&result, scope->argv.args[num - 1], + VasEBoot_strlen (scope->argv.args[num - 1]) )) goto fail; } @@ -359,30 +359,30 @@ grub_script_env_get (const char *name, grub_script_arg_type_t type) fail: - grub_script_argv_free (&result); + VasEBoot_script_argv_free (&result); return 0; } -static grub_err_t -grub_script_env_set (const char *name, const char *val) +static VasEBoot_err_t +VasEBoot_script_env_set (const char *name, const char *val) { - if (grub_env_special (name)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (VasEBoot_env_special (name)) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid variable name `%s'"), name); - return grub_env_set (name, val); + return VasEBoot_env_set (name, val); } struct gettext_context { char **allowed_strings; - grub_size_t nallowed_strings; - grub_size_t additional_len; + VasEBoot_size_t nallowed_strings; + VasEBoot_size_t additional_len; }; static int parse_string (const char *str, - int (*hook) (const char *var, grub_size_t varlen, + int (*hook) (const char *var, VasEBoot_size_t varlen, char **ptr, struct gettext_context *ctx), struct gettext_context *ctx, char *put) @@ -416,7 +416,7 @@ parse_string (const char *str, case '{': { optr = ptr + 1; - ptr = grub_strchr (optr, '}'); + ptr = VasEBoot_strchr (optr, '}'); if (!ptr) break; if (hook (optr, ptr - optr, &put, ctx)) @@ -469,14 +469,14 @@ parse_string (const char *str, } static int -gettext_putvar (const char *str, grub_size_t len, +gettext_putvar (const char *str, VasEBoot_size_t len, char **ptr, struct gettext_context *ctx) { const char *var; - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ctx->nallowed_strings; i++) - if (grub_strncmp (ctx->allowed_strings[i], str, len) == 0 + if (VasEBoot_strncmp (ctx->allowed_strings[i], str, len) == 0 && ctx->allowed_strings[i][len] == 0) { break; @@ -487,37 +487,37 @@ gettext_putvar (const char *str, grub_size_t len, /* Enough for any number. */ if (len == 1 && str[0] == '#') { - grub_snprintf (*ptr, 30, "%u", scope->argv.argc); - *ptr += grub_strlen (*ptr); + VasEBoot_snprintf (*ptr, 30, "%u", scope->argv.argc); + *ptr += VasEBoot_strlen (*ptr); return 0; } - var = grub_env_get (ctx->allowed_strings[i]); + var = VasEBoot_env_get (ctx->allowed_strings[i]); if (var) - *ptr = grub_stpcpy (*ptr, var); + *ptr = VasEBoot_stpcpy (*ptr, var); return 0; } static int -gettext_save_allow (const char *str, grub_size_t len, +gettext_save_allow (const char *str, VasEBoot_size_t len, char **ptr __attribute__ ((unused)), struct gettext_context *ctx) { - ctx->allowed_strings[ctx->nallowed_strings++] = grub_strndup (str, len); + ctx->allowed_strings[ctx->nallowed_strings++] = VasEBoot_strndup (str, len); if (!ctx->allowed_strings[ctx->nallowed_strings - 1]) return 1; return 0; } static int -gettext_getlen (const char *str, grub_size_t len, +gettext_getlen (const char *str, VasEBoot_size_t len, char **ptr __attribute__ ((unused)), struct gettext_context *ctx) { const char *var; - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ctx->nallowed_strings; i++) - if (grub_strncmp (ctx->allowed_strings[i], str, len) == 0 + if (VasEBoot_strncmp (ctx->allowed_strings[i], str, len) == 0 && ctx->allowed_strings[i][len] == 0) break; if (i == ctx->nallowed_strings) @@ -529,14 +529,14 @@ gettext_getlen (const char *str, grub_size_t len, ctx->additional_len += 30; return 0; } - var = grub_env_get (ctx->allowed_strings[i]); + var = VasEBoot_env_get (ctx->allowed_strings[i]); if (var) - ctx->additional_len += grub_strlen (var); + ctx->additional_len += VasEBoot_strlen (var); return 0; } static int -gettext_append (struct grub_script_argv *result, const char *orig_str) +gettext_append (struct VasEBoot_script_argv *result, const char *orig_str) { const char *template; char *res = 0; @@ -548,12 +548,12 @@ gettext_append (struct grub_script_argv *result, const char *orig_str) int rval = 1; const char *iptr; - grub_size_t dollar_cnt = 0; + VasEBoot_size_t dollar_cnt = 0; for (iptr = orig_str; *iptr; iptr++) if (*iptr == '$') dollar_cnt++; - ctx.allowed_strings = grub_malloc (sizeof (ctx.allowed_strings[0]) * dollar_cnt); + ctx.allowed_strings = VasEBoot_malloc (sizeof (ctx.allowed_strings[0]) * dollar_cnt); if (parse_string (orig_str, gettext_save_allow, &ctx, 0)) goto fail; @@ -563,7 +563,7 @@ gettext_append (struct grub_script_argv *result, const char *orig_str) if (parse_string (template, gettext_getlen, &ctx, 0)) goto fail; - res = grub_malloc (grub_strlen (template) + ctx.additional_len); + res = VasEBoot_malloc (VasEBoot_strlen (template) + ctx.additional_len); if (!res) goto fail; @@ -572,34 +572,34 @@ gettext_append (struct grub_script_argv *result, const char *orig_str) char *escaped = 0; escaped = wildcard_escape (res); - if (grub_script_argv_append (result, escaped, grub_strlen (escaped))) + if (VasEBoot_script_argv_append (result, escaped, VasEBoot_strlen (escaped))) { - grub_free (escaped); + VasEBoot_free (escaped); goto fail; } - grub_free (escaped); + VasEBoot_free (escaped); rval = 0; fail: - grub_free (res); + VasEBoot_free (res); { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ctx.nallowed_strings; i++) - grub_free (ctx.allowed_strings[i]); + VasEBoot_free (ctx.allowed_strings[i]); } - grub_free (ctx.allowed_strings); + VasEBoot_free (ctx.allowed_strings); return rval; } static int -append (struct grub_script_argv *result, +append (struct VasEBoot_script_argv *result, const char *s, int escape_type) { int r; char *p = 0; if (escape_type == 0) - return grub_script_argv_append (result, s, grub_strlen (s)); + return VasEBoot_script_argv_append (result, s, VasEBoot_strlen (s)); if (escape_type > 0) p = wildcard_escape (s); @@ -609,24 +609,24 @@ append (struct grub_script_argv *result, if (! p) return 1; - r = grub_script_argv_append (result, p, grub_strlen (p)); - grub_free (p); + r = VasEBoot_script_argv_append (result, p, VasEBoot_strlen (p)); + VasEBoot_free (p); return r; } /* Convert arguments in ARGLIST into ARGV form. */ static int -grub_script_arglist_to_argv (struct grub_script_arglist *arglist, - struct grub_script_argv *argv) +VasEBoot_script_arglist_to_argv (struct VasEBoot_script_arglist *arglist, + struct VasEBoot_script_argv *argv) { int i; char **values = 0; - struct grub_script_arg *arg = 0; - struct grub_script_argv result = { 0, 0, 0 }; + struct VasEBoot_script_arg *arg = 0; + struct VasEBoot_script_argv result = { 0, 0, 0 }; for (; arglist && arglist->arg; arglist = arglist->next) { - if (grub_script_argv_next (&result)) + if (VasEBoot_script_argv_next (&result)) goto fail; arg = arglist->arg; @@ -634,23 +634,23 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, { switch (arg->type) { - case GRUB_SCRIPT_ARG_TYPE_VAR: - case GRUB_SCRIPT_ARG_TYPE_DQVAR: + case VasEBoot_SCRIPT_ARG_TYPE_VAR: + case VasEBoot_SCRIPT_ARG_TYPE_DQVAR: { int need_cleanup = 0; - values = grub_script_env_get (arg->str, arg->type); + values = VasEBoot_script_env_get (arg->str, arg->type); for (i = 0; values && values[i]; i++) { if (!need_cleanup) { - if (i != 0 && grub_script_argv_next (&result)) + if (i != 0 && VasEBoot_script_argv_next (&result)) { need_cleanup = 1; goto cleanup; } - if (arg->type == GRUB_SCRIPT_ARG_TYPE_VAR) + if (arg->type == VasEBoot_SCRIPT_ARG_TYPE_VAR) { int len; char ch; @@ -658,11 +658,11 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, char *op; const char *s = values[i]; - len = grub_strlen (values[i]); + len = VasEBoot_strlen (values[i]); /* \? -> \\\? */ /* \* -> \\\* */ /* \ -> \\ */ - p = grub_malloc (len * 2 + 1); + p = VasEBoot_malloc (len * 2 + 1); if (! p) { need_cleanup = 1; @@ -682,8 +682,8 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, } *op = '\0'; - need_cleanup = grub_script_argv_append (&result, p, op - p); - grub_free (p); + need_cleanup = VasEBoot_script_argv_append (&result, p, op - p); + VasEBoot_free (p); /* Fall through to cleanup */ } else @@ -694,9 +694,9 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, } cleanup: - grub_free (values[i]); + VasEBoot_free (values[i]); } - grub_free (values); + VasEBoot_free (values); if (need_cleanup) goto fail; @@ -704,43 +704,43 @@ cleanup: break; } - case GRUB_SCRIPT_ARG_TYPE_BLOCK: + case VasEBoot_SCRIPT_ARG_TYPE_BLOCK: { char *p; - if (grub_script_argv_append (&result, "{", 1)) + if (VasEBoot_script_argv_append (&result, "{", 1)) goto fail; p = wildcard_escape (arg->str); if (!p) goto fail; - if (grub_script_argv_append (&result, p, - grub_strlen (p))) + if (VasEBoot_script_argv_append (&result, p, + VasEBoot_strlen (p))) { - grub_free (p); + VasEBoot_free (p); goto fail; } - grub_free (p); - if (grub_script_argv_append (&result, "}", 1)) + VasEBoot_free (p); + if (VasEBoot_script_argv_append (&result, "}", 1)) goto fail; } result.script = arg->script; break; - case GRUB_SCRIPT_ARG_TYPE_TEXT: + case VasEBoot_SCRIPT_ARG_TYPE_TEXT: if (arg->str[0] && - grub_script_argv_append (&result, arg->str, - grub_strlen (arg->str))) + VasEBoot_script_argv_append (&result, arg->str, + VasEBoot_strlen (arg->str))) goto fail; break; - case GRUB_SCRIPT_ARG_TYPE_GETTEXT: + case VasEBoot_SCRIPT_ARG_TYPE_GETTEXT: { if (gettext_append (&result, arg->str)) goto fail; } break; - case GRUB_SCRIPT_ARG_TYPE_DQSTR: - case GRUB_SCRIPT_ARG_TYPE_SQSTR: + case VasEBoot_SCRIPT_ARG_TYPE_DQSTR: + case VasEBoot_SCRIPT_ARG_TYPE_SQSTR: if (append (&result, arg->str, 1)) goto fail; break; @@ -756,56 +756,56 @@ cleanup: int j; int failed = 0; - struct grub_script_argv unexpanded = result; + struct VasEBoot_script_argv unexpanded = result; result.argc = 0; result.args = 0; for (i = 0; unexpanded.args[i]; i++) { char **expansions = 0; - if (grub_wildcard_translator - && grub_wildcard_translator->expand (unexpanded.args[i], + if (VasEBoot_wildcard_translator + && VasEBoot_wildcard_translator->expand (unexpanded.args[i], &expansions)) { - grub_script_argv_free (&unexpanded); + VasEBoot_script_argv_free (&unexpanded); goto fail; } if (! expansions) { - grub_script_argv_next (&result); + VasEBoot_script_argv_next (&result); append (&result, unexpanded.args[i], -1); } else { for (j = 0; expansions[j]; j++) { - failed = (failed || grub_script_argv_next (&result) || + failed = (failed || VasEBoot_script_argv_next (&result) || append (&result, expansions[j], 0)); - grub_free (expansions[j]); + VasEBoot_free (expansions[j]); } - grub_free (expansions); + VasEBoot_free (expansions); if (failed) { - grub_script_argv_free (&unexpanded); + VasEBoot_script_argv_free (&unexpanded); goto fail; } } } - grub_script_argv_free (&unexpanded); + VasEBoot_script_argv_free (&unexpanded); *argv = result; return 0; fail: - grub_script_argv_free (&result); + VasEBoot_script_argv_free (&result); return 1; } -static grub_err_t -grub_script_execute_cmd (struct grub_script_cmd *cmd) +static VasEBoot_err_t +VasEBoot_script_execute_cmd (struct VasEBoot_script_cmd *cmd) { int ret; char errnobuf[ERRNO_DIGITS_MAX + 1]; @@ -815,19 +815,19 @@ grub_script_execute_cmd (struct grub_script_cmd *cmd) ret = cmd->exec (cmd); - grub_snprintf (errnobuf, sizeof (errnobuf), "%d", ret); - grub_env_set ("?", errnobuf); + VasEBoot_snprintf (errnobuf, sizeof (errnobuf), "%d", ret); + VasEBoot_env_set ("?", errnobuf); return ret; } /* Execute a function call. */ -grub_err_t -grub_script_function_call (grub_script_function_t func, int argc, char **args) +VasEBoot_err_t +VasEBoot_script_function_call (VasEBoot_script_function_t func, int argc, char **args) { - grub_err_t ret = 0; + VasEBoot_err_t ret = 0; unsigned long loops = active_loops; - struct grub_script_scope *old_scope; - struct grub_script_scope new_scope; + struct VasEBoot_script_scope *old_scope; + struct VasEBoot_script_scope new_scope; active_loops = 0; new_scope.flags = 0; @@ -838,7 +838,7 @@ grub_script_function_call (grub_script_function_t func, int argc, char **args) old_scope = scope; scope = &new_scope; - ret = grub_script_execute (func->func); + ret = VasEBoot_script_execute (func->func); function_return = 0; active_loops = loops; @@ -846,9 +846,9 @@ grub_script_function_call (grub_script_function_t func, int argc, char **args) return ret; } -/* Helper for grub_script_execute_sourcecode. */ -static grub_err_t -grub_script_execute_sourcecode_getline (char **line, +/* Helper for VasEBoot_script_execute_sourcecode. */ +static VasEBoot_err_t +VasEBoot_script_execute_sourcecode_getline (char **line, int cont __attribute__ ((unused)), void *data) { @@ -861,52 +861,52 @@ grub_script_execute_sourcecode_getline (char **line, return 0; } - p = grub_strchr (*source, '\n'); + p = VasEBoot_strchr (*source, '\n'); if (p) - *line = grub_strndup (*source, p - *source); + *line = VasEBoot_strndup (*source, p - *source); else - *line = grub_strdup (*source); + *line = VasEBoot_strdup (*source); *source = p ? p + 1 : 0; return 0; } /* Execute a source script. */ -grub_err_t -grub_script_execute_sourcecode (const char *source) +VasEBoot_err_t +VasEBoot_script_execute_sourcecode (const char *source) { - grub_err_t ret = 0; - struct grub_script *parsed_script; + VasEBoot_err_t ret = 0; + struct VasEBoot_script *parsed_script; while (source) { char *line; - grub_script_execute_sourcecode_getline (&line, 0, &source); - parsed_script = grub_script_parse - (line, grub_script_execute_sourcecode_getline, &source); + VasEBoot_script_execute_sourcecode_getline (&line, 0, &source); + parsed_script = VasEBoot_script_parse + (line, VasEBoot_script_execute_sourcecode_getline, &source); if (! parsed_script) { - ret = grub_errno; - grub_free (line); + ret = VasEBoot_errno; + VasEBoot_free (line); break; } - ret = grub_script_execute (parsed_script); - grub_script_free (parsed_script); - grub_free (line); + ret = VasEBoot_script_execute (parsed_script); + VasEBoot_script_free (parsed_script); + VasEBoot_free (line); } return ret; } /* Execute a source script in new scope. */ -grub_err_t -grub_script_execute_new_scope (const char *source, int argc, char **args) +VasEBoot_err_t +VasEBoot_script_execute_new_scope (const char *source, int argc, char **args) { - grub_err_t ret = 0; - struct grub_script_scope new_scope; - struct grub_script_scope *old_scope; + VasEBoot_err_t ret = 0; + struct VasEBoot_script_scope new_scope; + struct VasEBoot_script_scope *old_scope; new_scope.argv.argc = argc; new_scope.argv.args = args; @@ -915,62 +915,62 @@ grub_script_execute_new_scope (const char *source, int argc, char **args) old_scope = scope; scope = &new_scope; - ret = grub_script_execute_sourcecode (source); + ret = VasEBoot_script_execute_sourcecode (source); scope = old_scope; return ret; } /* Execute a single command line. */ -grub_err_t -grub_script_execute_cmdline (struct grub_script_cmd *cmd) +VasEBoot_err_t +VasEBoot_script_execute_cmdline (struct VasEBoot_script_cmd *cmd) { - struct grub_script_cmdline *cmdline = (struct grub_script_cmdline *) cmd; - grub_command_t grubcmd; - grub_err_t ret = 0; - grub_script_function_t func = 0; + struct VasEBoot_script_cmdline *cmdline = (struct VasEBoot_script_cmdline *) cmd; + VasEBoot_command_t VasEBootcmd; + VasEBoot_err_t ret = 0; + VasEBoot_script_function_t func = 0; char errnobuf[18]; char *cmdname, *cmdstring; int argc, offset = 0, cmdlen = 0; unsigned int i; char **args; int invert; - struct grub_script_argv argv = { 0, 0, 0 }; + struct VasEBoot_script_argv argv = { 0, 0, 0 }; /* Lookup the command. */ - if (grub_script_arglist_to_argv (cmdline->arglist, &argv) || ! argv.args[0]) - return grub_errno; + if (VasEBoot_script_arglist_to_argv (cmdline->arglist, &argv) || ! argv.args[0]) + return VasEBoot_errno; for (i = 0; i < argv.argc; i++) { - cmdlen += grub_strlen (argv.args[i]) + 1; + cmdlen += VasEBoot_strlen (argv.args[i]) + 1; } - cmdstring = grub_malloc (cmdlen); + cmdstring = VasEBoot_malloc (cmdlen); if (!cmdstring) { - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return VasEBoot_error (VasEBoot_ERR_OUT_OF_MEMORY, N_("cannot allocate command buffer")); } for (i = 0; i < argv.argc; i++) { - offset += grub_snprintf (cmdstring + offset, cmdlen - offset, "%s ", + offset += VasEBoot_snprintf (cmdstring + offset, cmdlen - offset, "%s ", argv.args[i]); } cmdstring[cmdlen-1]= '\0'; - grub_tpm_measure ((unsigned char *)cmdstring, cmdlen, GRUB_ASCII_PCR, - "grub_cmd", cmdstring); - grub_print_error(); - grub_free(cmdstring); + VasEBoot_tpm_measure ((unsigned char *)cmdstring, cmdlen, VasEBoot_ASCII_PCR, + "VasEBoot_cmd", cmdstring); + VasEBoot_print_error(); + VasEBoot_free(cmdstring); invert = 0; argc = argv.argc - 1; args = argv.args + 1; cmdname = argv.args[0]; - if (grub_strcmp (cmdname, "!") == 0) + if (VasEBoot_strcmp (cmdname, "!") == 0) { if (argv.argc < 2 || ! argv.args[1]) { - grub_script_argv_free (&argv); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + VasEBoot_script_argv_free (&argv); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("no command is specified")); } @@ -979,91 +979,91 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) args = argv.args + 2; cmdname = argv.args[1]; } - grubcmd = grub_command_find (cmdname); - if (! grubcmd) + VasEBootcmd = VasEBoot_command_find (cmdname); + if (! VasEBootcmd) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - /* It's not a GRUB command, try all functions. */ - func = grub_script_function_find (cmdname); + /* It's not a VasEBoot command, try all functions. */ + func = VasEBoot_script_function_find (cmdname); if (! func) { /* As a last resort, try if it is an assignment. */ - char *assign = grub_strdup (cmdname); - char *eq = grub_strchr (assign, '='); + char *assign = VasEBoot_strdup (cmdname); + char *eq = VasEBoot_strchr (assign, '='); if (eq) { /* This was set because the command was not found. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* Create two strings and set the variable. */ *eq = '\0'; eq++; - grub_script_env_set (assign, eq); + VasEBoot_script_env_set (assign, eq); } - grub_free (assign); + VasEBoot_free (assign); - grub_snprintf (errnobuf, sizeof (errnobuf), "%d", grub_errno); - grub_script_env_set ("?", errnobuf); + VasEBoot_snprintf (errnobuf, sizeof (errnobuf), "%d", VasEBoot_errno); + VasEBoot_script_env_set ("?", errnobuf); - grub_script_argv_free (&argv); - grub_print_error (); + VasEBoot_script_argv_free (&argv); + VasEBoot_print_error (); return 0; } } - /* Execute the GRUB command or function. */ - if (grubcmd) + /* Execute the VasEBoot command or function. */ + if (VasEBootcmd) { - if (grub_extractor_level && !(grubcmd->flags - & GRUB_COMMAND_FLAG_EXTRACTOR)) - ret = grub_error (GRUB_ERR_EXTRACTOR, + if (VasEBoot_extractor_level && !(VasEBootcmd->flags + & VasEBoot_COMMAND_FLAG_EXTRACTOR)) + ret = VasEBoot_error (VasEBoot_ERR_EXTRACTOR, "%s isn't allowed to execute in an extractor", cmdname); - else if ((grubcmd->flags & GRUB_COMMAND_FLAG_BLOCKS) && - (grubcmd->flags & GRUB_COMMAND_FLAG_EXTCMD)) - ret = grub_extcmd_dispatcher (grubcmd, argc, args, argv.script); + else if ((VasEBootcmd->flags & VasEBoot_COMMAND_FLAG_BLOCKS) && + (VasEBootcmd->flags & VasEBoot_COMMAND_FLAG_EXTCMD)) + ret = VasEBoot_extcmd_dispatcher (VasEBootcmd, argc, args, argv.script); else - ret = (grubcmd->func) (grubcmd, argc, args); + ret = (VasEBootcmd->func) (VasEBootcmd, argc, args); } else - ret = grub_script_function_call (func, argc, args); + ret = VasEBoot_script_function_call (func, argc, args); if (invert) { - if (ret == GRUB_ERR_TEST_FAILURE) - grub_errno = ret = GRUB_ERR_NONE; - else if (ret == GRUB_ERR_NONE) - ret = grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); + if (ret == VasEBoot_ERR_TEST_FAILURE) + VasEBoot_errno = ret = VasEBoot_ERR_NONE; + else if (ret == VasEBoot_ERR_NONE) + ret = VasEBoot_error (VasEBoot_ERR_TEST_FAILURE, N_("false")); else { - grub_print_error (); - ret = GRUB_ERR_NONE; + VasEBoot_print_error (); + ret = VasEBoot_ERR_NONE; } } /* Free arguments. */ - grub_script_argv_free (&argv); + VasEBoot_script_argv_free (&argv); - if (grub_errno == GRUB_ERR_TEST_FAILURE) - grub_errno = GRUB_ERR_NONE; + if (VasEBoot_errno == VasEBoot_ERR_TEST_FAILURE) + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_print_error (); + VasEBoot_print_error (); - grub_snprintf (errnobuf, sizeof (errnobuf), "%d", ret); - grub_env_set ("?", errnobuf); + VasEBoot_snprintf (errnobuf, sizeof (errnobuf), "%d", ret); + VasEBoot_env_set ("?", errnobuf); return ret; } /* Execute a block of one or more commands. */ -grub_err_t -grub_script_execute_cmdlist (struct grub_script_cmd *list) +VasEBoot_err_t +VasEBoot_script_execute_cmdlist (struct VasEBoot_script_cmd *list) { int ret = 0; - struct grub_script_cmd *cmd; + struct VasEBoot_script_cmd *cmd; /* Loop over every command and execute it. */ for (cmd = list->next; cmd; cmd = cmd->next) @@ -1071,7 +1071,7 @@ grub_script_execute_cmdlist (struct grub_script_cmd *list) if (active_breaks) break; - ret = grub_script_execute_cmd (cmd); + ret = VasEBoot_script_execute_cmd (cmd); if (function_return) break; @@ -1081,41 +1081,41 @@ grub_script_execute_cmdlist (struct grub_script_cmd *list) } /* Execute an if statement. */ -grub_err_t -grub_script_execute_cmdif (struct grub_script_cmd *cmd) +VasEBoot_err_t +VasEBoot_script_execute_cmdif (struct VasEBoot_script_cmd *cmd) { int ret; const char *result; - struct grub_script_cmdif *cmdif = (struct grub_script_cmdif *) cmd; + struct VasEBoot_script_cmdif *cmdif = (struct VasEBoot_script_cmdif *) cmd; /* Check if the commands results in a true or a false. The value is read from the env variable `?'. */ - ret = grub_script_execute_cmd (cmdif->exec_to_evaluate); + ret = VasEBoot_script_execute_cmd (cmdif->exec_to_evaluate); if (function_return) return ret; - result = grub_env_get ("?"); - grub_errno = GRUB_ERR_NONE; + result = VasEBoot_env_get ("?"); + VasEBoot_errno = VasEBoot_ERR_NONE; /* Execute the `if' or the `else' part depending on the value of `?'. */ - if (result && ! grub_strcmp (result, "0")) - return grub_script_execute_cmd (cmdif->exec_on_true); + if (result && ! VasEBoot_strcmp (result, "0")) + return VasEBoot_script_execute_cmd (cmdif->exec_on_true); else - return grub_script_execute_cmd (cmdif->exec_on_false); + return VasEBoot_script_execute_cmd (cmdif->exec_on_false); } /* Execute a for statement. */ -grub_err_t -grub_script_execute_cmdfor (struct grub_script_cmd *cmd) +VasEBoot_err_t +VasEBoot_script_execute_cmdfor (struct VasEBoot_script_cmd *cmd) { unsigned i; - grub_err_t result; - struct grub_script_argv argv = { 0, 0, 0 }; - struct grub_script_cmdfor *cmdfor = (struct grub_script_cmdfor *) cmd; + VasEBoot_err_t result; + struct VasEBoot_script_argv argv = { 0, 0, 0 }; + struct VasEBoot_script_cmdfor *cmdfor = (struct VasEBoot_script_cmdfor *) cmd; - if (grub_script_arglist_to_argv (cmdfor->words, &argv)) - return grub_errno; + if (VasEBoot_script_arglist_to_argv (cmdfor->words, &argv)) + return VasEBoot_errno; active_loops++; result = 0; @@ -1126,8 +1126,8 @@ grub_script_execute_cmdfor (struct grub_script_cmd *cmd) if (! active_breaks) { - grub_script_env_set (cmdfor->name->str, argv.args[i]); - result = grub_script_execute_cmd (cmdfor->list); + VasEBoot_script_env_set (cmdfor->name->str, argv.args[i]); + result = VasEBoot_script_execute_cmd (cmdfor->list); if (function_return) break; } @@ -1137,27 +1137,27 @@ grub_script_execute_cmdfor (struct grub_script_cmd *cmd) active_breaks--; active_loops--; - grub_script_argv_free (&argv); + VasEBoot_script_argv_free (&argv); return result; } /* Execute a "while" or "until" command. */ -grub_err_t -grub_script_execute_cmdwhile (struct grub_script_cmd *cmd) +VasEBoot_err_t +VasEBoot_script_execute_cmdwhile (struct VasEBoot_script_cmd *cmd) { int result; - struct grub_script_cmdwhile *cmdwhile = (struct grub_script_cmdwhile *) cmd; + struct VasEBoot_script_cmdwhile *cmdwhile = (struct VasEBoot_script_cmdwhile *) cmd; active_loops++; do { - result = grub_script_execute_cmd (cmdwhile->cond); + result = VasEBoot_script_execute_cmd (cmdwhile->cond); if (function_return) break; if (cmdwhile->until ? !result : result) break; - result = grub_script_execute_cmd (cmdwhile->list); + result = VasEBoot_script_execute_cmd (cmdwhile->list); if (function_return) break; @@ -1176,13 +1176,13 @@ grub_script_execute_cmdwhile (struct grub_script_cmd *cmd) return result; } -/* Execute any GRUB pre-parsed command or script. */ -grub_err_t -grub_script_execute (struct grub_script *script) +/* Execute any VasEBoot pre-parsed command or script. */ +VasEBoot_err_t +VasEBoot_script_execute (struct VasEBoot_script *script) { if (script == 0) return 0; - return grub_script_execute_cmd (script->cmd); + return VasEBoot_script_execute_cmd (script->cmd); } diff --git a/VasEBoot-core/script/function.c b/VasEBoot-core/script/function.c index d36655e51..532c98e9c 100644 --- a/VasEBoot-core/script/function.c +++ b/VasEBoot-core/script/function.c @@ -1,68 +1,68 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -grub_script_function_t grub_script_function_list; +VasEBoot_script_function_t VasEBoot_script_function_list; -grub_script_function_t -grub_script_function_create (struct grub_script_arg *functionname_arg, - struct grub_script *cmd) +VasEBoot_script_function_t +VasEBoot_script_function_create (struct VasEBoot_script_arg *functionname_arg, + struct VasEBoot_script *cmd) { - grub_script_function_t func; - grub_script_function_t *p; + VasEBoot_script_function_t func; + VasEBoot_script_function_t *p; - func = (grub_script_function_t) grub_malloc (sizeof (*func)); + func = (VasEBoot_script_function_t) VasEBoot_malloc (sizeof (*func)); if (! func) return 0; - func->name = grub_strdup (functionname_arg->str); + func->name = VasEBoot_strdup (functionname_arg->str); if (! func->name) { - grub_free (func); + VasEBoot_free (func); return 0; } func->func = cmd; /* Keep the list sorted for simplicity. */ - p = &grub_script_function_list; + p = &VasEBoot_script_function_list; while (*p) { - if (grub_strcmp ((*p)->name, func->name) >= 0) + if (VasEBoot_strcmp ((*p)->name, func->name) >= 0) break; p = &((*p)->next); } /* If the function already exists, overwrite the old function. */ - if (*p && grub_strcmp ((*p)->name, func->name) == 0) + if (*p && VasEBoot_strcmp ((*p)->name, func->name) == 0) { - grub_script_function_t q; + VasEBoot_script_function_t q; q = *p; - grub_script_free (q->func); + VasEBoot_script_free (q->func); q->func = cmd; - grub_free (func); + VasEBoot_free (func); func = q; } else @@ -75,38 +75,38 @@ grub_script_function_create (struct grub_script_arg *functionname_arg, } void -grub_script_function_remove (const char *name) +VasEBoot_script_function_remove (const char *name) { - grub_script_function_t *p, q; + VasEBoot_script_function_t *p, q; - for (p = &grub_script_function_list, q = *p; q; p = &(q->next), q = q->next) - if (grub_strcmp (name, q->name) == 0) + for (p = &VasEBoot_script_function_list, q = *p; q; p = &(q->next), q = q->next) + if (VasEBoot_strcmp (name, q->name) == 0) { *p = q->next; - grub_free (q->name); - grub_script_free (q->func); - grub_free (q); + VasEBoot_free (q->name); + VasEBoot_script_free (q->func); + VasEBoot_free (q); break; } } -grub_script_function_t -grub_script_function_find (char *functionname) +VasEBoot_script_function_t +VasEBoot_script_function_find (char *functionname) { - grub_script_function_t func; + VasEBoot_script_function_t func; - for (func = grub_script_function_list; func; func = func->next) - if (grub_strcmp (functionname, func->name) == 0) + for (func = VasEBoot_script_function_list; func; func = func->next) + if (VasEBoot_strcmp (functionname, func->name) == 0) break; if (! func) { char tmp[21]; - grub_strncpy (tmp, functionname, 20); + VasEBoot_strncpy (tmp, functionname, 20); tmp[20] = 0; /* Avoid truncating inside UTF-8 character. */ - tmp[grub_getend (tmp, tmp + grub_strlen (tmp))] = 0; - grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), tmp); + tmp[VasEBoot_getend (tmp, tmp + VasEBoot_strlen (tmp))] = 0; + VasEBoot_error (VasEBoot_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), tmp); } return func; diff --git a/VasEBoot-core/script/lexer.c b/VasEBoot-core/script/lexer.c index c6bd3172f..f493e4c43 100644 --- a/VasEBoot-core/script/lexer.c +++ b/VasEBoot-core/script/lexer.c @@ -1,73 +1,73 @@ /* lexer.c - The scripting lexer. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define yytext_ptr char * -#include "grub_script.tab.h" -#include "grub_script.yy.h" +#include "VasEBoot_script.tab.h" +#include "VasEBoot_script.yy.h" void -grub_script_lexer_ref (struct grub_lexer_param *state) +VasEBoot_script_lexer_ref (struct VasEBoot_lexer_param *state) { state->refs++; } void -grub_script_lexer_deref (struct grub_lexer_param *state) +VasEBoot_script_lexer_deref (struct VasEBoot_lexer_param *state) { state->refs--; } /* Start recording all characters passing through the lexer. */ unsigned -grub_script_lexer_record_start (struct grub_parser_param *parser) +VasEBoot_script_lexer_record_start (struct VasEBoot_parser_param *parser) { - struct grub_lexer_param *lexer = parser->lexerstate; + struct VasEBoot_lexer_param *lexer = parser->lexerstate; lexer->record++; if (lexer->recording) return lexer->recordpos; lexer->recordpos = 0; - lexer->recordlen = GRUB_LEXER_INITIAL_RECORD_SIZE; - lexer->recording = grub_malloc (lexer->recordlen); + lexer->recordlen = VasEBoot_LEXER_INITIAL_RECORD_SIZE; + lexer->recording = VasEBoot_malloc (lexer->recordlen); if (!lexer->recording) { - grub_script_yyerror (parser, 0); + VasEBoot_script_yyerror (parser, 0); lexer->recordlen = 0; } return lexer->recordpos; } char * -grub_script_lexer_record_stop (struct grub_parser_param *parser, unsigned offset) +VasEBoot_script_lexer_record_stop (struct VasEBoot_parser_param *parser, unsigned offset) { int count; char *result; - struct grub_lexer_param *lexer = parser->lexerstate; + struct VasEBoot_lexer_param *lexer = parser->lexerstate; if (!lexer->record) return 0; @@ -77,15 +77,15 @@ grub_script_lexer_record_stop (struct grub_parser_param *parser, unsigned offset return 0; count = lexer->recordpos - offset; - result = grub_script_malloc (parser, count + 1); + result = VasEBoot_script_malloc (parser, count + 1); if (result) { - grub_strncpy (result, lexer->recording + offset, count); + VasEBoot_strncpy (result, lexer->recording + offset, count); result[count] = '\0'; } if (lexer->record == 0) { - grub_free (lexer->recording); + VasEBoot_free (lexer->recording); lexer->recording = 0; lexer->recordlen = 0; lexer->recordpos = 0; @@ -95,53 +95,53 @@ grub_script_lexer_record_stop (struct grub_parser_param *parser, unsigned offset /* Record STR if input recording is enabled. */ void -grub_script_lexer_record (struct grub_parser_param *parser, char *str) +VasEBoot_script_lexer_record (struct VasEBoot_parser_param *parser, char *str) { int len; char *old; - struct grub_lexer_param *lexer = parser->lexerstate; + struct VasEBoot_lexer_param *lexer = parser->lexerstate; if (!lexer->record || !lexer->recording) return; - len = grub_strlen (str); + len = VasEBoot_strlen (str); if (lexer->recordpos + len + 1 > lexer->recordlen) { old = lexer->recording; if (lexer->recordlen < len) lexer->recordlen = len; lexer->recordlen *= 2; - lexer->recording = grub_realloc (lexer->recording, lexer->recordlen); + lexer->recording = VasEBoot_realloc (lexer->recording, lexer->recordlen); if (!lexer->recording) { - grub_free (old); + VasEBoot_free (old); lexer->recordpos = 0; lexer->recordlen = 0; - grub_script_yyerror (parser, 0); + VasEBoot_script_yyerror (parser, 0); return; } } - grub_strcpy (lexer->recording + lexer->recordpos, str); + VasEBoot_strcpy (lexer->recording + lexer->recordpos, str); lexer->recordpos += len; } /* Read next line of input if necessary, and set yyscanner buffers. */ int -grub_script_lexer_yywrap (struct grub_parser_param *parserstate, +VasEBoot_script_lexer_yywrap (struct VasEBoot_parser_param *parserstate, const char *input) { - grub_size_t len = 0; + VasEBoot_size_t len = 0; char *p = 0; char *line = 0; YY_BUFFER_STATE buffer; - struct grub_lexer_param *lexerstate = parserstate->lexerstate; + struct VasEBoot_lexer_param *lexerstate = parserstate->lexerstate; if (! lexerstate->refs && ! lexerstate->prefix && ! input) return 1; if (! lexerstate->getline && ! input) { - grub_script_yyerror (parserstate, N_("unexpected end of file")); + VasEBoot_script_yyerror (parserstate, N_("unexpected end of file")); return 1; } @@ -149,26 +149,26 @@ grub_script_lexer_yywrap (struct grub_parser_param *parserstate, if (! input) lexerstate->getline (&line, 1, lexerstate->getline_data); else - line = grub_strdup (input); + line = VasEBoot_strdup (input); if (! line) { - grub_script_yyerror (parserstate, N_("out of memory")); + VasEBoot_script_yyerror (parserstate, N_("out of memory")); return 1; } - len = grub_strlen (line); + len = VasEBoot_strlen (line); /* Ensure '\n' at the end. */ if (line[0] == '\0') { - grub_free (line); - line = grub_strdup ("\n"); + VasEBoot_free (line); + line = VasEBoot_strdup ("\n"); len = 1; } else if (len && line[len - 1] != '\n') { - p = grub_realloc (line, len + 2); + p = VasEBoot_realloc (line, len + 2); if (p) { p[len++] = '\n'; @@ -179,57 +179,57 @@ grub_script_lexer_yywrap (struct grub_parser_param *parserstate, if (! line) { - grub_script_yyerror (parserstate, N_("out of memory")); + VasEBoot_script_yyerror (parserstate, N_("out of memory")); return 1; } /* Prepend any left over unput-text. */ if (lexerstate->prefix) { - int plen = grub_strlen (lexerstate->prefix); + int plen = VasEBoot_strlen (lexerstate->prefix); - p = grub_malloc (len + plen + 1); + p = VasEBoot_malloc (len + plen + 1); if (! p) { - grub_free (line); + VasEBoot_free (line); return 1; } - grub_strcpy (p, lexerstate->prefix); + VasEBoot_strcpy (p, lexerstate->prefix); lexerstate->prefix = 0; - grub_strcpy (p + plen, line); - grub_free (line); + VasEBoot_strcpy (p + plen, line); + VasEBoot_free (line); line = p; len = len + plen; } buffer = yy_scan_string (line, lexerstate->yyscanner); - grub_free (line); + VasEBoot_free (line); if (! buffer) { - grub_script_yyerror (parserstate, 0); + VasEBoot_script_yyerror (parserstate, 0); return 1; } return 0; } -struct grub_lexer_param * -grub_script_lexer_init (struct grub_parser_param *parser, char *script, - grub_reader_getline_t arg_getline, void *getline_data) +struct VasEBoot_lexer_param * +VasEBoot_script_lexer_init (struct VasEBoot_parser_param *parser, char *script, + VasEBoot_reader_getline_t arg_getline, void *getline_data) { - struct grub_lexer_param *lexerstate; + struct VasEBoot_lexer_param *lexerstate; - lexerstate = grub_zalloc (sizeof (*lexerstate)); + lexerstate = VasEBoot_zalloc (sizeof (*lexerstate)); if (!lexerstate) return 0; - lexerstate->size = GRUB_LEXER_INITIAL_TEXT_SIZE; - lexerstate->text = grub_malloc (lexerstate->size); + lexerstate->size = VasEBoot_LEXER_INITIAL_TEXT_SIZE; + lexerstate->text = VasEBoot_malloc (lexerstate->size); if (!lexerstate->text) { - grub_free (lexerstate); + VasEBoot_free (lexerstate); return 0; } @@ -239,20 +239,20 @@ grub_script_lexer_init (struct grub_parser_param *parser, char *script, if (yylex_init (&lexerstate->yyscanner)) { - grub_free (lexerstate->text); - grub_free (lexerstate); + VasEBoot_free (lexerstate->text); + VasEBoot_free (lexerstate); return 0; } yyset_extra (parser, lexerstate->yyscanner); parser->lexerstate = lexerstate; - if (grub_script_lexer_yywrap (parser, script ?: "\n")) + if (VasEBoot_script_lexer_yywrap (parser, script ?: "\n")) { parser->lexerstate = 0; yylex_destroy (lexerstate->yyscanner); - grub_free (lexerstate->text); - grub_free (lexerstate); + VasEBoot_free (lexerstate->text); + VasEBoot_free (lexerstate); return 0; } @@ -260,37 +260,37 @@ grub_script_lexer_init (struct grub_parser_param *parser, char *script, } void -grub_script_lexer_fini (struct grub_lexer_param *lexerstate) +VasEBoot_script_lexer_fini (struct VasEBoot_lexer_param *lexerstate) { if (!lexerstate) return; yylex_destroy (lexerstate->yyscanner); - grub_free (lexerstate->recording); - grub_free (lexerstate->text); - grub_free (lexerstate); + VasEBoot_free (lexerstate->recording); + VasEBoot_free (lexerstate->text); + VasEBoot_free (lexerstate); } int -grub_script_yylex (union YYSTYPE *value, - struct grub_parser_param *parserstate) +VasEBoot_script_yylex (union YYSTYPE *value, + struct VasEBoot_parser_param *parserstate) { char *str; int token; - grub_script_arg_type_t type; - struct grub_lexer_param *lexerstate = parserstate->lexerstate; + VasEBoot_script_arg_type_t type; + struct VasEBoot_lexer_param *lexerstate = parserstate->lexerstate; value->arg = 0; if (parserstate->err) - return GRUB_PARSER_TOKEN_BAD; + return VasEBoot_PARSER_TOKEN_BAD; if (lexerstate->eof) - return GRUB_PARSER_TOKEN_EOF; + return VasEBoot_PARSER_TOKEN_EOF; /* * Words with environment variables, like foo${bar}baz needs - * multiple tokens to be merged into a single grub_script_arg. We + * multiple tokens to be merged into a single VasEBoot_script_arg. We * use two variables to achieve this: lexerstate->merge_start and * lexerstate->merge_end */ @@ -304,7 +304,7 @@ grub_script_yylex (union YYSTYPE *value, lexerstate->text[0] = '\0'; token = yylex (value, lexerstate->yyscanner); - if (token == GRUB_PARSER_TOKEN_BAD) + if (token == VasEBoot_PARSER_TOKEN_BAD) break; /* Merging feature uses lexerstate->text instead of yytext. */ @@ -316,26 +316,26 @@ grub_script_yylex (union YYSTYPE *value, else { str = yyget_text (lexerstate->yyscanner); - type = GRUB_SCRIPT_ARG_TYPE_TEXT; + type = VasEBoot_SCRIPT_ARG_TYPE_TEXT; } - grub_dprintf("lexer", "token %u text [%s]\n", token, str); + VasEBoot_dprintf("lexer", "token %u text [%s]\n", token, str); - value->arg = grub_script_arg_add (parserstate, value->arg, type, str); + value->arg = VasEBoot_script_arg_add (parserstate, value->arg, type, str); } while (lexerstate->merge_start && !lexerstate->merge_end); if (!value->arg || parserstate->err) - return GRUB_PARSER_TOKEN_BAD; + return VasEBoot_PARSER_TOKEN_BAD; return token; } void -grub_script_yyerror (struct grub_parser_param *state, char const *err) +VasEBoot_script_yyerror (struct VasEBoot_parser_param *state, char const *err) { if (err) - grub_error (GRUB_ERR_INVALID_COMMAND, err); + VasEBoot_error (VasEBoot_ERR_INVALID_COMMAND, err); - grub_print_error (); + VasEBoot_print_error (); state->err++; } diff --git a/VasEBoot-core/script/main.c b/VasEBoot-core/script/main.c index 854a25a06..729409d96 100644 --- a/VasEBoot-core/script/main.c +++ b/VasEBoot-core/script/main.c @@ -1,69 +1,69 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -grub_err_t -grub_normal_parse_line (char *line, - grub_reader_getline_t getline, void *getline_data) +VasEBoot_err_t +VasEBoot_normal_parse_line (char *line, + VasEBoot_reader_getline_t getline, void *getline_data) { - struct grub_script *parsed_script; + struct VasEBoot_script *parsed_script; /* Parse the script. */ - parsed_script = grub_script_parse (line, getline, getline_data); + parsed_script = VasEBoot_script_parse (line, getline, getline_data); if (parsed_script) { /* Execute the command(s). */ - grub_script_execute (parsed_script); + VasEBoot_script_execute (parsed_script); /* The parsed script was executed, throw it away. */ - grub_script_unref (parsed_script); + VasEBoot_script_unref (parsed_script); } - return grub_errno; + return VasEBoot_errno; } -static grub_command_t cmd_break; -static grub_command_t cmd_continue; -static grub_command_t cmd_shift; -static grub_command_t cmd_setparams; -static grub_command_t cmd_return; +static VasEBoot_command_t cmd_break; +static VasEBoot_command_t cmd_continue; +static VasEBoot_command_t cmd_shift; +static VasEBoot_command_t cmd_setparams; +static VasEBoot_command_t cmd_return; void -grub_script_init (void) +VasEBoot_script_init (void) { - cmd_break = grub_register_command ("break", grub_script_break, + cmd_break = VasEBoot_register_command ("break", VasEBoot_script_break, N_("[NUM]"), N_("Exit from loops")); - cmd_continue = grub_register_command ("continue", grub_script_break, + cmd_continue = VasEBoot_register_command ("continue", VasEBoot_script_break, N_("[NUM]"), N_("Continue loops")); - cmd_shift = grub_register_command ("shift", grub_script_shift, + cmd_shift = VasEBoot_register_command ("shift", VasEBoot_script_shift, N_("[NUM]"), /* TRANSLATORS: Positional arguments are arguments $0, $1, $2, ... */ N_("Shift positional parameters.")); - cmd_setparams = grub_register_command ("setparams", grub_script_setparams, + cmd_setparams = VasEBoot_register_command ("setparams", VasEBoot_script_setparams, N_("[VALUE]..."), N_("Set positional parameters.")); - cmd_return = grub_register_command ("return", grub_script_return, + cmd_return = VasEBoot_register_command ("return", VasEBoot_script_return, N_("[NUM]"), /* TRANSLATORS: It's a command description and "Return" is a verb, not a noun. The @@ -74,25 +74,25 @@ grub_script_init (void) } void -grub_script_fini (void) +VasEBoot_script_fini (void) { if (cmd_break) - grub_unregister_command (cmd_break); + VasEBoot_unregister_command (cmd_break); cmd_break = 0; if (cmd_continue) - grub_unregister_command (cmd_continue); + VasEBoot_unregister_command (cmd_continue); cmd_continue = 0; if (cmd_shift) - grub_unregister_command (cmd_shift); + VasEBoot_unregister_command (cmd_shift); cmd_shift = 0; if (cmd_setparams) - grub_unregister_command (cmd_setparams); + VasEBoot_unregister_command (cmd_setparams); cmd_setparams = 0; if (cmd_return) - grub_unregister_command (cmd_return); + VasEBoot_unregister_command (cmd_return); cmd_return = 0; } diff --git a/VasEBoot-core/script/parser.y b/VasEBoot-core/script/parser.y index 4f0ab8319..46988064f 100644 --- a/VasEBoot-core/script/parser.y +++ b/VasEBoot-core/script/parser.y @@ -1,97 +1,97 @@ /* parser.y - The scripting parser. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ %{ -#include -#include -#include -#include +#include +#include +#include +#include -#define YYFREE grub_free -#define YYMALLOC grub_malloc +#define YYFREE VasEBoot_free +#define YYMALLOC VasEBoot_malloc #define YYLTYPE_IS_TRIVIAL 0 #define YYENABLE_NLS 0 -#include "grub_script.tab.h" +#include "VasEBoot_script.tab.h" #pragma GCC diagnostic ignored "-Wmissing-declarations" %} %union { - struct grub_script_cmd *cmd; - struct grub_script_arglist *arglist; - struct grub_script_arg *arg; + struct VasEBoot_script_cmd *cmd; + struct VasEBoot_script_arglist *arglist; + struct VasEBoot_script_arg *arg; char *string; struct { unsigned offset; - struct grub_script_mem *memory; - struct grub_script *scripts; + struct VasEBoot_script_mem *memory; + struct VasEBoot_script *scripts; }; } -%token GRUB_PARSER_TOKEN_BAD -%token GRUB_PARSER_TOKEN_EOF 0 "end-of-input" +%token VasEBoot_PARSER_TOKEN_BAD +%token VasEBoot_PARSER_TOKEN_EOF 0 "end-of-input" -%token GRUB_PARSER_TOKEN_NEWLINE "\n" -%token GRUB_PARSER_TOKEN_AND "&&" -%token GRUB_PARSER_TOKEN_OR "||" -%token GRUB_PARSER_TOKEN_SEMI2 ";;" -%token GRUB_PARSER_TOKEN_PIPE "|" -%token GRUB_PARSER_TOKEN_AMP "&" -%token GRUB_PARSER_TOKEN_SEMI ";" -%token GRUB_PARSER_TOKEN_LBR "{" -%token GRUB_PARSER_TOKEN_RBR "}" -%token GRUB_PARSER_TOKEN_NOT "!" -%token GRUB_PARSER_TOKEN_LSQBR2 "[" -%token GRUB_PARSER_TOKEN_RSQBR2 "]" -%token GRUB_PARSER_TOKEN_LT "<" -%token GRUB_PARSER_TOKEN_GT ">" +%token VasEBoot_PARSER_TOKEN_NEWLINE "\n" +%token VasEBoot_PARSER_TOKEN_AND "&&" +%token VasEBoot_PARSER_TOKEN_OR "||" +%token VasEBoot_PARSER_TOKEN_SEMI2 ";;" +%token VasEBoot_PARSER_TOKEN_PIPE "|" +%token VasEBoot_PARSER_TOKEN_AMP "&" +%token VasEBoot_PARSER_TOKEN_SEMI ";" +%token VasEBoot_PARSER_TOKEN_LBR "{" +%token VasEBoot_PARSER_TOKEN_RBR "}" +%token VasEBoot_PARSER_TOKEN_NOT "!" +%token VasEBoot_PARSER_TOKEN_LSQBR2 "[" +%token VasEBoot_PARSER_TOKEN_RSQBR2 "]" +%token VasEBoot_PARSER_TOKEN_LT "<" +%token VasEBoot_PARSER_TOKEN_GT ">" -%token GRUB_PARSER_TOKEN_CASE "case" -%token GRUB_PARSER_TOKEN_DO "do" -%token GRUB_PARSER_TOKEN_DONE "done" -%token GRUB_PARSER_TOKEN_ELIF "elif" -%token GRUB_PARSER_TOKEN_ELSE "else" -%token GRUB_PARSER_TOKEN_ESAC "esac" -%token GRUB_PARSER_TOKEN_FI "fi" -%token GRUB_PARSER_TOKEN_FOR "for" -%token GRUB_PARSER_TOKEN_IF "if" -%token GRUB_PARSER_TOKEN_IN "in" -%token GRUB_PARSER_TOKEN_SELECT "select" -%token GRUB_PARSER_TOKEN_THEN "then" -%token GRUB_PARSER_TOKEN_UNTIL "until" -%token GRUB_PARSER_TOKEN_WHILE "while" -%token GRUB_PARSER_TOKEN_FUNCTION "function" -%token GRUB_PARSER_TOKEN_NAME "name" -%token GRUB_PARSER_TOKEN_WORD "word" +%token VasEBoot_PARSER_TOKEN_CASE "case" +%token VasEBoot_PARSER_TOKEN_DO "do" +%token VasEBoot_PARSER_TOKEN_DONE "done" +%token VasEBoot_PARSER_TOKEN_ELIF "elif" +%token VasEBoot_PARSER_TOKEN_ELSE "else" +%token VasEBoot_PARSER_TOKEN_ESAC "esac" +%token VasEBoot_PARSER_TOKEN_FI "fi" +%token VasEBoot_PARSER_TOKEN_FOR "for" +%token VasEBoot_PARSER_TOKEN_IF "if" +%token VasEBoot_PARSER_TOKEN_IN "in" +%token VasEBoot_PARSER_TOKEN_SELECT "select" +%token VasEBoot_PARSER_TOKEN_THEN "then" +%token VasEBoot_PARSER_TOKEN_UNTIL "until" +%token VasEBoot_PARSER_TOKEN_WHILE "while" +%token VasEBoot_PARSER_TOKEN_FUNCTION "function" +%token VasEBoot_PARSER_TOKEN_NAME "name" +%token VasEBoot_PARSER_TOKEN_WORD "word" %type block block0 %type word argument arguments0 arguments1 %type script_init script -%type grubcmd ifclause ifcmd forcmd whilecmd untilcmd +%type VasEBootcmd ifclause ifcmd forcmd whilecmd untilcmd %type command commands1 statement %pure-parser -%lex-param { struct grub_parser_param *state }; -%parse-param { struct grub_parser_param *state }; +%lex-param { struct VasEBoot_parser_param *state }; +%parse-param { struct VasEBoot_parser_param *state }; %start script_init @@ -106,7 +106,7 @@ script: newlines0 } | script statement delimiter newlines0 { - $$ = grub_script_append_cmd (state, $1, $2); + $$ = VasEBoot_script_append_cmd (state, $1, $2); } | error { @@ -127,61 +127,61 @@ delimiters1: delimiter | delimiters1 "\n" ; -word: GRUB_PARSER_TOKEN_NAME { $$ = grub_script_add_arglist (state, 0, $1); } - | GRUB_PARSER_TOKEN_WORD { $$ = grub_script_add_arglist (state, 0, $1); } +word: VasEBoot_PARSER_TOKEN_NAME { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | VasEBoot_PARSER_TOKEN_WORD { $$ = VasEBoot_script_add_arglist (state, 0, $1); } ; statement: command { $$ = $1; } | function { $$ = 0; } ; -argument : "case" { $$ = grub_script_add_arglist (state, 0, $1); } - | "do" { $$ = grub_script_add_arglist (state, 0, $1); } - | "done" { $$ = grub_script_add_arglist (state, 0, $1); } - | "elif" { $$ = grub_script_add_arglist (state, 0, $1); } - | "else" { $$ = grub_script_add_arglist (state, 0, $1); } - | "esac" { $$ = grub_script_add_arglist (state, 0, $1); } - | "fi" { $$ = grub_script_add_arglist (state, 0, $1); } - | "for" { $$ = grub_script_add_arglist (state, 0, $1); } - | "if" { $$ = grub_script_add_arglist (state, 0, $1); } - | "in" { $$ = grub_script_add_arglist (state, 0, $1); } - | "select" { $$ = grub_script_add_arglist (state, 0, $1); } - | "then" { $$ = grub_script_add_arglist (state, 0, $1); } - | "until" { $$ = grub_script_add_arglist (state, 0, $1); } - | "while" { $$ = grub_script_add_arglist (state, 0, $1); } - | "function" { $$ = grub_script_add_arglist (state, 0, $1); } +argument : "case" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "do" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "done" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "elif" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "else" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "esac" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "fi" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "for" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "if" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "in" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "select" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "then" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "until" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "while" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } + | "function" { $$ = VasEBoot_script_add_arglist (state, 0, $1); } | word { $$ = $1; } ; /* Block parameter is passed to commands in two forms: as unparsed - string and as pre-parsed grub_script object. Passing as grub_script + string and as pre-parsed VasEBoot_script object. Passing as VasEBoot_script object makes memory management difficult, because: - (1) Command may want to keep a reference to grub_script objects for - later use, so script framework may not free the grub_script + (1) Command may want to keep a reference to VasEBoot_script objects for + later use, so script framework may not free the VasEBoot_script object after command completes. - (2) Command may get called multiple times with same grub_script + (2) Command may get called multiple times with same VasEBoot_script object under loops, so we should not let command implementation - to free the grub_script object. + to free the VasEBoot_script object. To solve above problems, we rely on reference counting for - grub_script objects. Commands that want to keep the grub_script + VasEBoot_script objects. Commands that want to keep the VasEBoot_script object must take a reference to it. - Other complexity comes with arbitrary nesting of grub_script - objects: a grub_script object may have commands with several block + Other complexity comes with arbitrary nesting of VasEBoot_script + objects: a VasEBoot_script object may have commands with several block parameters, and each block parameter may further contain multiple block parameters nested. We use temporary variable, state->scripts to collect nested child scripts (that are linked by siblings and - children members), and will build grub_scripts tree from bottom. + children members), and will build VasEBoot_scripts tree from bottom. */ block: "{" { - grub_script_lexer_ref (state->lexerstate); - $$ = grub_script_lexer_record_start (state); - $$ = grub_script_mem_record (state); + VasEBoot_script_lexer_ref (state->lexerstate); + $$ = VasEBoot_script_lexer_record_start (state); + $$ = VasEBoot_script_mem_record (state); /* save currently known scripts. */ $$ = state->scripts; @@ -190,16 +190,16 @@ block: "{" commands1 delimiters0 "}" { char *p; - struct grub_script_mem *memory; - struct grub_script *s = $2; + struct VasEBoot_script_mem *memory; + struct VasEBoot_script *s = $2; - memory = grub_script_mem_record_stop (state, $2); - if ((p = grub_script_lexer_record_stop (state, $2))) - *grub_strrchr (p, '}') = '\0'; + memory = VasEBoot_script_mem_record_stop (state, $2); + if ((p = VasEBoot_script_lexer_record_stop (state, $2))) + *VasEBoot_strrchr (p, '}') = '\0'; - $$ = grub_script_arg_add (state, 0, GRUB_SCRIPT_ARG_TYPE_BLOCK, p); - if (! $$ || ! ($$->script = grub_script_create ($3, memory))) - grub_script_mem_free (memory); + $$ = VasEBoot_script_arg_add (state, 0, VasEBoot_SCRIPT_ARG_TYPE_BLOCK, p); + if (! $$ || ! ($$->script = VasEBoot_script_create ($3, memory))) + VasEBoot_script_mem_free (memory); else { /* attach nested scripts to $$->script as children */ @@ -214,7 +214,7 @@ block: "{" } } - grub_script_lexer_deref (state->lexerstate); + VasEBoot_script_lexer_deref (state->lexerstate); } ; block0: /* Empty */ { $$ = 0; } @@ -236,24 +236,24 @@ arguments1: argument arguments0 } ; -grubcmd: word arguments0 block0 +VasEBootcmd: word arguments0 block0 { - struct grub_script_arglist *x = $2; + struct VasEBoot_script_arglist *x = $2; if ($3) - x = grub_script_add_arglist (state, $2, $3); + x = VasEBoot_script_add_arglist (state, $2, $3); if ($1 && x) { $1->next = x; $1->argcount += x->argcount; x->argcount = 0; } - $$ = grub_script_create_cmdline (state, $1); + $$ = VasEBoot_script_create_cmdline (state, $1); } ; /* A single command. */ -command: grubcmd { $$ = $1; } +command: VasEBootcmd { $$ = $1; } | ifcmd { $$ = $1; } | forcmd { $$ = $1; } | whilecmd { $$ = $1; } @@ -263,93 +263,93 @@ command: grubcmd { $$ = $1; } /* A list of commands. */ commands1: newlines0 command { - $$ = grub_script_append_cmd (state, 0, $2); + $$ = VasEBoot_script_append_cmd (state, 0, $2); } | commands1 delimiters1 command { - $$ = grub_script_append_cmd (state, $1, $3); + $$ = VasEBoot_script_append_cmd (state, $1, $3); } ; function: "function" "name" { - grub_script_lexer_ref (state->lexerstate); - state->func_mem = grub_script_mem_record (state); + VasEBoot_script_lexer_ref (state->lexerstate); + state->func_mem = VasEBoot_script_mem_record (state); $$ = state->scripts; state->scripts = 0; } delimiters0 "{" commands1 delimiters1 "}" { - struct grub_script *script; - state->func_mem = grub_script_mem_record_stop (state, + struct VasEBoot_script *script; + state->func_mem = VasEBoot_script_mem_record_stop (state, state->func_mem); - script = grub_script_create ($6, state->func_mem); + script = VasEBoot_script_create ($6, state->func_mem); if (! script) - grub_script_mem_free (state->func_mem); + VasEBoot_script_mem_free (state->func_mem); else { script->children = state->scripts; - grub_script_function_create ($2, script); + VasEBoot_script_function_create ($2, script); } state->scripts = $3; - grub_script_lexer_deref (state->lexerstate); + VasEBoot_script_lexer_deref (state->lexerstate); } ; ifcmd: "if" { - grub_script_lexer_ref (state->lexerstate); + VasEBoot_script_lexer_ref (state->lexerstate); } ifclause "fi" { $$ = $3; - grub_script_lexer_deref (state->lexerstate); + VasEBoot_script_lexer_deref (state->lexerstate); } ; ifclause: commands1 delimiters1 "then" commands1 delimiters1 { - $$ = grub_script_create_cmdif (state, $1, $4, 0); + $$ = VasEBoot_script_create_cmdif (state, $1, $4, 0); } | commands1 delimiters1 "then" commands1 delimiters1 "else" commands1 delimiters1 { - $$ = grub_script_create_cmdif (state, $1, $4, $7); + $$ = VasEBoot_script_create_cmdif (state, $1, $4, $7); } | commands1 delimiters1 "then" commands1 delimiters1 "elif" ifclause { - $$ = grub_script_create_cmdif (state, $1, $4, $7); + $$ = VasEBoot_script_create_cmdif (state, $1, $4, $7); } ; forcmd: "for" "name" { - grub_script_lexer_ref (state->lexerstate); + VasEBoot_script_lexer_ref (state->lexerstate); } "in" arguments0 delimiters1 "do" commands1 delimiters1 "done" { - $$ = grub_script_create_cmdfor (state, $2, $5, $8); - grub_script_lexer_deref (state->lexerstate); + $$ = VasEBoot_script_create_cmdfor (state, $2, $5, $8); + VasEBoot_script_lexer_deref (state->lexerstate); } ; whilecmd: "while" { - grub_script_lexer_ref (state->lexerstate); + VasEBoot_script_lexer_ref (state->lexerstate); } commands1 delimiters1 "do" commands1 delimiters1 "done" { - $$ = grub_script_create_cmdwhile (state, $3, $6, 0); - grub_script_lexer_deref (state->lexerstate); + $$ = VasEBoot_script_create_cmdwhile (state, $3, $6, 0); + VasEBoot_script_lexer_deref (state->lexerstate); } ; untilcmd: "until" { - grub_script_lexer_ref (state->lexerstate); + VasEBoot_script_lexer_ref (state->lexerstate); } commands1 delimiters1 "do" commands1 delimiters1 "done" { - $$ = grub_script_create_cmdwhile (state, $3, $6, 1); - grub_script_lexer_deref (state->lexerstate); + $$ = VasEBoot_script_create_cmdwhile (state, $3, $6, 1); + VasEBoot_script_lexer_deref (state->lexerstate); } ; diff --git a/VasEBoot-core/script/script.c b/VasEBoot-core/script/script.c index ec4d4337c..58d1c5f87 100644 --- a/VasEBoot-core/script/script.c +++ b/VasEBoot-core/script/script.c @@ -1,26 +1,26 @@ /* script.c -- Functions to create an in memory description of the script. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* It is not possible to deallocate the memory when a syntax error was found. Because of that it is required to keep track of all memory @@ -31,23 +31,23 @@ for this datastructure. All reserved memory is stored in a linked list so it can be easily freed. The original memory can be found from &mem. */ -struct grub_script_mem +struct VasEBoot_script_mem { - struct grub_script_mem *next; + struct VasEBoot_script_mem *next; char mem; }; /* Return malloc'ed memory and keep track of the allocation. */ void * -grub_script_malloc (struct grub_parser_param *state, grub_size_t size) +VasEBoot_script_malloc (struct VasEBoot_parser_param *state, VasEBoot_size_t size) { - struct grub_script_mem *mem; - mem = (struct grub_script_mem *) grub_malloc (size + sizeof (*mem) + struct VasEBoot_script_mem *mem; + mem = (struct VasEBoot_script_mem *) VasEBoot_malloc (size + sizeof (*mem) - sizeof (char)); if (!mem) return 0; - grub_dprintf ("scripting", "malloc %p\n", mem); + VasEBoot_dprintf ("scripting", "malloc %p\n", mem); mem->next = state->memused; state->memused = mem; return (void *) &mem->mem; @@ -55,25 +55,25 @@ grub_script_malloc (struct grub_parser_param *state, grub_size_t size) /* Free all memory described by MEM. */ void -grub_script_mem_free (struct grub_script_mem *mem) +VasEBoot_script_mem_free (struct VasEBoot_script_mem *mem) { - struct grub_script_mem *memfree; + struct VasEBoot_script_mem *memfree; while (mem) { memfree = mem->next; - grub_dprintf ("scripting", "free %p\n", mem); - grub_free (mem); + VasEBoot_dprintf ("scripting", "free %p\n", mem); + VasEBoot_free (mem); mem = memfree; } } /* Start recording memory usage. Returns the memory that should be restored when calling stop. */ -struct grub_script_mem * -grub_script_mem_record (struct grub_parser_param *state) +struct VasEBoot_script_mem * +VasEBoot_script_mem_record (struct VasEBoot_parser_param *state) { - struct grub_script_mem *mem = state->memused; + struct VasEBoot_script_mem *mem = state->memused; state->memused = 0; return mem; @@ -81,64 +81,64 @@ grub_script_mem_record (struct grub_parser_param *state) /* Stop recording memory usage. Restore previous recordings using RESTORE. Return the recorded memory. */ -struct grub_script_mem * -grub_script_mem_record_stop (struct grub_parser_param *state, - struct grub_script_mem *restore) +struct VasEBoot_script_mem * +VasEBoot_script_mem_record_stop (struct VasEBoot_parser_param *state, + struct VasEBoot_script_mem *restore) { - struct grub_script_mem *mem = state->memused; + struct VasEBoot_script_mem *mem = state->memused; state->memused = restore; return mem; } /* Free the memory reserved for CMD and all of it's children. */ void -grub_script_free (struct grub_script *script) +VasEBoot_script_free (struct VasEBoot_script *script) { - struct grub_script *s; - struct grub_script *t; + struct VasEBoot_script *s; + struct VasEBoot_script *t; if (! script) return; if (script->mem) - grub_script_mem_free (script->mem); + VasEBoot_script_mem_free (script->mem); s = script->children; while (s) { t = s->next_siblings; - grub_script_unref (s); + VasEBoot_script_unref (s); s = t; } - grub_free (script); + VasEBoot_free (script); } /* Extend the argument arg with a variable or string of text. If ARG is zero a new list is created. */ -struct grub_script_arg * -grub_script_arg_add (struct grub_parser_param *state, - struct grub_script_arg *arg, grub_script_arg_type_t type, +struct VasEBoot_script_arg * +VasEBoot_script_arg_add (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arg *arg, VasEBoot_script_arg_type_t type, char *str) { - struct grub_script_arg *argpart; - struct grub_script_arg *ll; + struct VasEBoot_script_arg *argpart; + struct VasEBoot_script_arg *ll; int len; argpart = - (struct grub_script_arg *) grub_script_malloc (state, sizeof (*arg)); + (struct VasEBoot_script_arg *) VasEBoot_script_malloc (state, sizeof (*arg)); if (!argpart) return arg; argpart->type = type; argpart->script = 0; - len = grub_strlen (str) + 1; - argpart->str = grub_script_malloc (state, len); + len = VasEBoot_strlen (str) + 1; + argpart->str = VasEBoot_script_malloc (state, len); if (!argpart->str) - return arg; /* argpart is freed later, during grub_script_free. */ + return arg; /* argpart is freed later, during VasEBoot_script_free. */ - grub_memcpy (argpart->str, str, len); + VasEBoot_memcpy (argpart->str, str, len); argpart->next = 0; if (!arg) @@ -152,18 +152,18 @@ grub_script_arg_add (struct grub_parser_param *state, /* Add the argument ARG to the end of the argument list LIST. If LIST is zero, a new list will be created. */ -struct grub_script_arglist * -grub_script_add_arglist (struct grub_parser_param *state, - struct grub_script_arglist *list, - struct grub_script_arg *arg) +struct VasEBoot_script_arglist * +VasEBoot_script_add_arglist (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arglist *list, + struct VasEBoot_script_arg *arg) { - struct grub_script_arglist *link; - struct grub_script_arglist *ll; + struct VasEBoot_script_arglist *link; + struct VasEBoot_script_arglist *ll; - grub_dprintf ("scripting", "arglist\n"); + VasEBoot_dprintf ("scripting", "arglist\n"); link = - (struct grub_script_arglist *) grub_script_malloc (state, sizeof (*link)); + (struct VasEBoot_script_arglist *) VasEBoot_script_malloc (state, sizeof (*link)); if (!link) return list; @@ -189,120 +189,120 @@ grub_script_add_arglist (struct grub_parser_param *state, /* Create a command that describes a single command line. CMDLINE contains the name of the command that should be executed. ARGLIST holds all arguments for this command. */ -struct grub_script_cmd * -grub_script_create_cmdline (struct grub_parser_param *state, - struct grub_script_arglist *arglist) +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdline (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arglist *arglist) { - struct grub_script_cmdline *cmd; + struct VasEBoot_script_cmdline *cmd; - grub_dprintf ("scripting", "cmdline\n"); + VasEBoot_dprintf ("scripting", "cmdline\n"); - cmd = grub_script_malloc (state, sizeof (*cmd)); + cmd = VasEBoot_script_malloc (state, sizeof (*cmd)); if (!cmd) return 0; - cmd->cmd.exec = grub_script_execute_cmdline; + cmd->cmd.exec = VasEBoot_script_execute_cmdline; cmd->cmd.next = 0; cmd->arglist = arglist; - return (struct grub_script_cmd *) cmd; + return (struct VasEBoot_script_cmd *) cmd; } /* Create a command that functions as an if statement. If BOOL is evaluated to true (the value is returned in envvar '?'), the interpreter will run the command TRUE, otherwise the interpreter runs the command FALSE. */ -struct grub_script_cmd * -grub_script_create_cmdif (struct grub_parser_param *state, - struct grub_script_cmd *exec_to_evaluate, - struct grub_script_cmd *exec_on_true, - struct grub_script_cmd *exec_on_false) +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdif (struct VasEBoot_parser_param *state, + struct VasEBoot_script_cmd *exec_to_evaluate, + struct VasEBoot_script_cmd *exec_on_true, + struct VasEBoot_script_cmd *exec_on_false) { - struct grub_script_cmdif *cmd; + struct VasEBoot_script_cmdif *cmd; - grub_dprintf ("scripting", "cmdif\n"); + VasEBoot_dprintf ("scripting", "cmdif\n"); - cmd = grub_script_malloc (state, sizeof (*cmd)); + cmd = VasEBoot_script_malloc (state, sizeof (*cmd)); if (!cmd) return 0; - cmd->cmd.exec = grub_script_execute_cmdif; + cmd->cmd.exec = VasEBoot_script_execute_cmdif; cmd->cmd.next = 0; cmd->exec_to_evaluate = exec_to_evaluate; cmd->exec_on_true = exec_on_true; cmd->exec_on_false = exec_on_false; - return (struct grub_script_cmd *) cmd; + return (struct VasEBoot_script_cmd *) cmd; } /* Create a command that functions as a for statement. */ -struct grub_script_cmd * -grub_script_create_cmdfor (struct grub_parser_param *state, - struct grub_script_arg *name, - struct grub_script_arglist *words, - struct grub_script_cmd *list) +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdfor (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arg *name, + struct VasEBoot_script_arglist *words, + struct VasEBoot_script_cmd *list) { - struct grub_script_cmdfor *cmd; + struct VasEBoot_script_cmdfor *cmd; - grub_dprintf ("scripting", "cmdfor\n"); + VasEBoot_dprintf ("scripting", "cmdfor\n"); - cmd = grub_script_malloc (state, sizeof (*cmd)); + cmd = VasEBoot_script_malloc (state, sizeof (*cmd)); if (! cmd) return 0; - cmd->cmd.exec = grub_script_execute_cmdfor; + cmd->cmd.exec = VasEBoot_script_execute_cmdfor; cmd->cmd.next = 0; cmd->name = name; cmd->words = words; cmd->list = list; - return (struct grub_script_cmd *) cmd; + return (struct VasEBoot_script_cmd *) cmd; } /* Create a "while" or "until" command. */ -struct grub_script_cmd * -grub_script_create_cmdwhile (struct grub_parser_param *state, - struct grub_script_cmd *cond, - struct grub_script_cmd *list, +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdwhile (struct VasEBoot_parser_param *state, + struct VasEBoot_script_cmd *cond, + struct VasEBoot_script_cmd *list, int is_an_until_loop) { - struct grub_script_cmdwhile *cmd; + struct VasEBoot_script_cmdwhile *cmd; - cmd = grub_script_malloc (state, sizeof (*cmd)); + cmd = VasEBoot_script_malloc (state, sizeof (*cmd)); if (! cmd) return 0; - cmd->cmd.exec = grub_script_execute_cmdwhile; + cmd->cmd.exec = VasEBoot_script_execute_cmdwhile; cmd->cmd.next = 0; cmd->cond = cond; cmd->list = list; cmd->until = is_an_until_loop; - return (struct grub_script_cmd *) cmd; + return (struct VasEBoot_script_cmd *) cmd; } /* Create a chain of commands. LAST contains the command that should be added at the end of LIST's list. If LIST is zero, a new list will be created. */ -struct grub_script_cmd * -grub_script_append_cmd (struct grub_parser_param *state, - struct grub_script_cmd *list, - struct grub_script_cmd *last) +struct VasEBoot_script_cmd * +VasEBoot_script_append_cmd (struct VasEBoot_parser_param *state, + struct VasEBoot_script_cmd *list, + struct VasEBoot_script_cmd *last) { - struct grub_script_cmd *ptr; + struct VasEBoot_script_cmd *ptr; - grub_dprintf ("scripting", "append command\n"); + VasEBoot_dprintf ("scripting", "append command\n"); if (! last) return list; if (! list) { - list = grub_script_malloc (state, sizeof (*list)); + list = VasEBoot_script_malloc (state, sizeof (*list)); if (! list) return 0; - list->exec = grub_script_execute_cmdlist; + list->exec = VasEBoot_script_execute_cmdlist; list->next = last; } else @@ -319,12 +319,12 @@ grub_script_append_cmd (struct grub_parser_param *state, -struct grub_script * -grub_script_create (struct grub_script_cmd *cmd, struct grub_script_mem *mem) +struct VasEBoot_script * +VasEBoot_script_create (struct VasEBoot_script_cmd *cmd, struct VasEBoot_script_mem *mem) { - struct grub_script *parsed; + struct VasEBoot_script *parsed; - parsed = grub_malloc (sizeof (*parsed)); + parsed = VasEBoot_malloc (sizeof (*parsed)); if (! parsed) return 0; @@ -339,58 +339,58 @@ grub_script_create (struct grub_script_cmd *cmd, struct grub_script_mem *mem) /* Parse the script passed in SCRIPT and return the parsed datastructure that is ready to be interpreted. */ -struct grub_script * -grub_script_parse (char *script, - grub_reader_getline_t getline, void *getline_data) +struct VasEBoot_script * +VasEBoot_script_parse (char *script, + VasEBoot_reader_getline_t getline, void *getline_data) { - struct grub_script *parsed; - struct grub_script_mem *membackup; - struct grub_lexer_param *lexstate; - struct grub_parser_param *parsestate; + struct VasEBoot_script *parsed; + struct VasEBoot_script_mem *membackup; + struct VasEBoot_lexer_param *lexstate; + struct VasEBoot_parser_param *parsestate; - parsed = grub_script_create (0, 0); + parsed = VasEBoot_script_create (0, 0); if (!parsed) return 0; - parsestate = grub_zalloc (sizeof (*parsestate)); + parsestate = VasEBoot_zalloc (sizeof (*parsestate)); if (!parsestate) { - grub_free (parsed); + VasEBoot_free (parsed); return 0; } /* Initialize the lexer. */ - lexstate = grub_script_lexer_init (parsestate, script, + lexstate = VasEBoot_script_lexer_init (parsestate, script, getline, getline_data); if (!lexstate) { - grub_free (parsed); - grub_free (parsestate); + VasEBoot_free (parsed); + VasEBoot_free (parsestate); return 0; } parsestate->lexerstate = lexstate; - membackup = grub_script_mem_record (parsestate); + membackup = VasEBoot_script_mem_record (parsestate); /* Parse the script. */ - if (grub_script_yyparse (parsestate) || parsestate->err) + if (VasEBoot_script_yyparse (parsestate) || parsestate->err) { - struct grub_script_mem *memfree; - memfree = grub_script_mem_record_stop (parsestate, membackup); - grub_script_mem_free (memfree); - grub_script_lexer_fini (lexstate); - grub_free (parsestate); - grub_free (parsed); + struct VasEBoot_script_mem *memfree; + memfree = VasEBoot_script_mem_record_stop (parsestate, membackup); + VasEBoot_script_mem_free (memfree); + VasEBoot_script_lexer_fini (lexstate); + VasEBoot_free (parsestate); + VasEBoot_free (parsed); return 0; } - parsed->mem = grub_script_mem_record_stop (parsestate, membackup); + parsed->mem = VasEBoot_script_mem_record_stop (parsestate, membackup); parsed->cmd = parsestate->parsed; parsed->children = parsestate->scripts; - grub_script_lexer_fini (lexstate); - grub_free (parsestate); + VasEBoot_script_lexer_fini (lexstate); + VasEBoot_free (parsestate); return parsed; } diff --git a/VasEBoot-core/script/yylex.l b/VasEBoot-core/script/yylex.l index 95b219170..5512abe62 100644 --- a/VasEBoot-core/script/yylex.l +++ b/VasEBoot-core/script/yylex.l @@ -1,29 +1,29 @@ %{ /* yylex.l The scripting lexer. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include "grub_script.tab.h" +#include +#include +#include +#include +#include +#include "VasEBoot_script.tab.h" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wmissing-prototypes" @@ -31,9 +31,9 @@ #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wsign-compare" -#define yyalloc(size, scanner) (grub_malloc((size))) -#define yyfree(ptr, scanner) (grub_free((ptr))) -#define yyrealloc(ptr, size, scanner) (grub_realloc((ptr), (size))) +#define yyalloc(size, scanner) (VasEBoot_malloc((size))) +#define yyfree(ptr, scanner) (VasEBoot_free((ptr))) +#define yyrealloc(ptr, size, scanner) (VasEBoot_realloc((ptr), (size))) /* * As we don't have access to yyscanner, we cannot do much except to @@ -41,7 +41,7 @@ */ #define YY_FATAL_ERROR(msg) \ do { \ - grub_printf (_("fatal error: %s\n"), _(msg)); \ + VasEBoot_printf (_("fatal error: %s\n"), _(msg)); \ } while (0) #define COPY(str, hint) \ @@ -52,23 +52,23 @@ #define RECORD \ do { \ - grub_script_lexer_record (yyextra, yytext); \ + VasEBoot_script_lexer_record (yyextra, yytext); \ } while (0) #define ARG(t) \ do { \ yyextra->lexerstate->type = t; \ - return GRUB_PARSER_TOKEN_WORD; \ + return VasEBoot_PARSER_TOKEN_WORD; \ } while (0) /* We don't need YY_INPUT, as we rely on yy_scan_strings */ #define YY_INPUT(buf,res,max) do { res = 0; } while (0) /* forward declarations */ -static int grub_lexer_unput (const char *input, yyscan_t yyscanner); -static int grub_lexer_resplit (const char *input, yyscan_t yyscanner); +static int VasEBoot_lexer_unput (const char *input, yyscan_t yyscanner); +static int VasEBoot_lexer_resplit (const char *input, yyscan_t yyscanner); -static void copy_string (struct grub_parser_param *, const char *, +static void copy_string (struct VasEBoot_parser_param *, const char *, unsigned hint); %} @@ -84,15 +84,15 @@ typedef size_t yy_size_t; /* * Some flex hacks for -nostdinc; XXX We need to fix these when libc - * support becomes availble in GRUB. + * support becomes availble in VasEBoot. */ -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL #define stdin 0 #define stdout 0 #define fprintf(...) 0 -#define exit(...) grub_fatal("fatal error in lexer") +#define exit(...) VasEBoot_fatal("fatal error in lexer") #endif } @@ -118,7 +118,7 @@ typedef size_t yy_size_t; %option noyyget_debug noyyset_debug %option noyyget_lineno noyyset_lineno -%option extra-type="struct grub_parser_param*" +%option extra-type="struct VasEBoot_parser_param*" BLANK [ \t] COMMENT #.*$ @@ -153,76 +153,76 @@ POS_MULTILINE {WORD}?\\\n {COMMENT} { RECORD; } /* Special symbols */ -"\n" { RECORD; return GRUB_PARSER_TOKEN_NEWLINE; } -"||" { RECORD; return GRUB_PARSER_TOKEN_OR; } -"&&" { RECORD; return GRUB_PARSER_TOKEN_AND; } -";;" { RECORD; return GRUB_PARSER_TOKEN_SEMI2; } -"|" { RECORD; return GRUB_PARSER_TOKEN_PIPE; } -"&" { RECORD; return GRUB_PARSER_TOKEN_AMP; } -";" { RECORD; return GRUB_PARSER_TOKEN_SEMI; } -"<" { RECORD; return GRUB_PARSER_TOKEN_LT; } -">" { RECORD; return GRUB_PARSER_TOKEN_GT; } +"\n" { RECORD; return VasEBoot_PARSER_TOKEN_NEWLINE; } +"||" { RECORD; return VasEBoot_PARSER_TOKEN_OR; } +"&&" { RECORD; return VasEBoot_PARSER_TOKEN_AND; } +";;" { RECORD; return VasEBoot_PARSER_TOKEN_SEMI2; } +"|" { RECORD; return VasEBoot_PARSER_TOKEN_PIPE; } +"&" { RECORD; return VasEBoot_PARSER_TOKEN_AMP; } +";" { RECORD; return VasEBoot_PARSER_TOKEN_SEMI; } +"<" { RECORD; return VasEBoot_PARSER_TOKEN_LT; } +">" { RECORD; return VasEBoot_PARSER_TOKEN_GT; } /* Reserved words */ -"{" { RECORD; return GRUB_PARSER_TOKEN_LBR; } -"}" { RECORD; return GRUB_PARSER_TOKEN_RBR; } -"[[" { RECORD; return GRUB_PARSER_TOKEN_LSQBR2; } -"]]" { RECORD; return GRUB_PARSER_TOKEN_RSQBR2; } -"case" { RECORD; return GRUB_PARSER_TOKEN_CASE; } -"do" { RECORD; return GRUB_PARSER_TOKEN_DO; } -"done" { RECORD; return GRUB_PARSER_TOKEN_DONE; } -"elif" { RECORD; return GRUB_PARSER_TOKEN_ELIF; } -"else" { RECORD; return GRUB_PARSER_TOKEN_ELSE; } -"esac" { RECORD; return GRUB_PARSER_TOKEN_ESAC; } -"fi" { RECORD; return GRUB_PARSER_TOKEN_FI; } -"for" { RECORD; return GRUB_PARSER_TOKEN_FOR; } -"if" { RECORD; return GRUB_PARSER_TOKEN_IF; } -"in" { RECORD; return GRUB_PARSER_TOKEN_IN; } -"select" { RECORD; return GRUB_PARSER_TOKEN_SELECT; } -"then" { RECORD; return GRUB_PARSER_TOKEN_THEN; } -"until" { RECORD; return GRUB_PARSER_TOKEN_UNTIL; } -"while" { RECORD; return GRUB_PARSER_TOKEN_WHILE; } -"function" { RECORD; return GRUB_PARSER_TOKEN_FUNCTION; } +"{" { RECORD; return VasEBoot_PARSER_TOKEN_LBR; } +"}" { RECORD; return VasEBoot_PARSER_TOKEN_RBR; } +"[[" { RECORD; return VasEBoot_PARSER_TOKEN_LSQBR2; } +"]]" { RECORD; return VasEBoot_PARSER_TOKEN_RSQBR2; } +"case" { RECORD; return VasEBoot_PARSER_TOKEN_CASE; } +"do" { RECORD; return VasEBoot_PARSER_TOKEN_DO; } +"done" { RECORD; return VasEBoot_PARSER_TOKEN_DONE; } +"elif" { RECORD; return VasEBoot_PARSER_TOKEN_ELIF; } +"else" { RECORD; return VasEBoot_PARSER_TOKEN_ELSE; } +"esac" { RECORD; return VasEBoot_PARSER_TOKEN_ESAC; } +"fi" { RECORD; return VasEBoot_PARSER_TOKEN_FI; } +"for" { RECORD; return VasEBoot_PARSER_TOKEN_FOR; } +"if" { RECORD; return VasEBoot_PARSER_TOKEN_IF; } +"in" { RECORD; return VasEBoot_PARSER_TOKEN_IN; } +"select" { RECORD; return VasEBoot_PARSER_TOKEN_SELECT; } +"then" { RECORD; return VasEBoot_PARSER_TOKEN_THEN; } +"until" { RECORD; return VasEBoot_PARSER_TOKEN_UNTIL; } +"while" { RECORD; return VasEBoot_PARSER_TOKEN_WHILE; } +"function" { RECORD; return VasEBoot_PARSER_TOKEN_FUNCTION; } {MULTILINE} { - if (grub_lexer_unput (yytext, yyscanner)) - return GRUB_PARSER_TOKEN_BAD; + if (VasEBoot_lexer_unput (yytext, yyscanner)) + return VasEBoot_PARSER_TOKEN_BAD; } {POS_MULTILINE} { if (yyg->yy_c_buf_p + 1 == &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) { - if (grub_lexer_unput (yytext, yyscanner)) - return GRUB_PARSER_TOKEN_BAD; + if (VasEBoot_lexer_unput (yytext, yyscanner)) + return VasEBoot_PARSER_TOKEN_BAD; } else { RECORD; yypush_buffer_state (YY_CURRENT_BUFFER, yyscanner); - if (grub_lexer_resplit (yytext, yyscanner)) + if (VasEBoot_lexer_resplit (yytext, yyscanner)) { yypop_buffer_state (yyscanner); - return GRUB_PARSER_TOKEN_WORD; + return VasEBoot_PARSER_TOKEN_WORD; } yyextra->lexerstate->resplit = 1; } } -{NAME} { RECORD; return GRUB_PARSER_TOKEN_NAME; } +{NAME} { RECORD; return VasEBoot_PARSER_TOKEN_NAME; } {WORD} { RECORD; yypush_buffer_state (YY_CURRENT_BUFFER, yyscanner); - if (grub_lexer_resplit (yytext, yyscanner)) + if (VasEBoot_lexer_resplit (yytext, yyscanner)) { yypop_buffer_state (yyscanner); - return GRUB_PARSER_TOKEN_WORD; + return VasEBoot_PARSER_TOKEN_WORD; } yyextra->lexerstate->resplit = 1; } . { - grub_script_yyerror (yyextra, yytext); - return GRUB_PARSER_TOKEN_BAD; + VasEBoot_script_yyerror (yyextra, yytext); + return VasEBoot_PARSER_TOKEN_BAD; } /* Split word into multiple args */ @@ -232,19 +232,19 @@ POS_MULTILINE {WORD}?\\\n \\\n { /* ignore */ } \" { yy_push_state (DQUOTE, yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_TEXT); + ARG (VasEBoot_SCRIPT_ARG_TYPE_TEXT); } \' { yy_push_state (SQUOTE, yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_TEXT); + ARG (VasEBoot_SCRIPT_ARG_TYPE_TEXT); } "\$\"" { yy_push_state (I18NQUOTE, yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_GETTEXT); + ARG (VasEBoot_SCRIPT_ARG_TYPE_GETTEXT); } \$ { yy_push_state (VAR, yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_TEXT); + ARG (VasEBoot_SCRIPT_ARG_TYPE_TEXT); } \\ | [^\"\'\$\\]+ { COPY (yytext, yyleng); } @@ -253,7 +253,7 @@ POS_MULTILINE {WORD}?\\\n yypop_buffer_state (yyscanner); yyextra->lexerstate->resplit = 0; yyextra->lexerstate->merge_end = 1; - ARG (GRUB_SCRIPT_ARG_TYPE_TEXT); + ARG (VasEBoot_SCRIPT_ARG_TYPE_TEXT); } } @@ -264,9 +264,9 @@ POS_MULTILINE {WORD}?\\\n COPY (yytext, yyleng); yy_pop_state (yyscanner); if (YY_START == SPLIT) - ARG (GRUB_SCRIPT_ARG_TYPE_VAR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_VAR); else - ARG (GRUB_SCRIPT_ARG_TYPE_DQVAR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_DQVAR); } \{{SPECIAL}\} | \{{DIGITS}\} | @@ -275,17 +275,17 @@ POS_MULTILINE {WORD}?\\\n COPY (yytext + 1, yyleng - 2); yy_pop_state (yyscanner); if (YY_START == SPLIT) - ARG (GRUB_SCRIPT_ARG_TYPE_VAR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_VAR); else - ARG (GRUB_SCRIPT_ARG_TYPE_DQVAR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_DQVAR); } - .|\n { return GRUB_PARSER_TOKEN_BAD; } + .|\n { return VasEBoot_PARSER_TOKEN_BAD; } } { \' { yy_pop_state (yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_SQSTR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_SQSTR); } [^\']+ { COPY (yytext, yyleng); } } @@ -298,11 +298,11 @@ POS_MULTILINE {WORD}?\\\n [^\"\$\\\n]+ { COPY (yytext, yyleng); } \" { yy_pop_state (yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_DQSTR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_DQSTR); } \$ { yy_push_state (VAR, yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_DQSTR); + ARG (VasEBoot_SCRIPT_ARG_TYPE_DQSTR); } (.|\n) { COPY (yytext, yyleng); } } @@ -314,7 +314,7 @@ POS_MULTILINE {WORD}?\\\n [^\"\\\n]+ { COPY (yytext, yyleng); } \" { yy_pop_state (yyscanner); - ARG (GRUB_SCRIPT_ARG_TYPE_GETTEXT); + ARG (VasEBoot_SCRIPT_ARG_TYPE_GETTEXT); } \\ { COPY ("\\", 1); } (.|\n) { COPY (yytext, yyleng); } @@ -323,7 +323,7 @@ POS_MULTILINE {WORD}?\\\n <> { yypop_buffer_state (yyscanner); yyextra->lexerstate->eof = 1; - return GRUB_PARSER_TOKEN_EOF; + return VasEBoot_PARSER_TOKEN_EOF; } %% @@ -333,37 +333,37 @@ yywrap (yyscan_t yyscanner) if (yyget_extra (yyscanner)->lexerstate->resplit) return 1; - return grub_script_lexer_yywrap (yyget_extra (yyscanner), 0); + return VasEBoot_script_lexer_yywrap (yyget_extra (yyscanner), 0); } -static void copy_string (struct grub_parser_param *parser, const char *str, unsigned hint) +static void copy_string (struct VasEBoot_parser_param *parser, const char *str, unsigned hint) { - grub_size_t size; + VasEBoot_size_t size; char *ptr; unsigned len; - len = hint ? hint : grub_strlen (str); + len = hint ? hint : VasEBoot_strlen (str); if (parser->lexerstate->used + len >= parser->lexerstate->size) { size = len * 2; if (size < parser->lexerstate->size * 2) size = parser->lexerstate->size * 2; - ptr = grub_realloc (parser->lexerstate->text, size); + ptr = VasEBoot_realloc (parser->lexerstate->text, size); if (!ptr) { - grub_script_yyerror (parser, 0); + VasEBoot_script_yyerror (parser, 0); return; } parser->lexerstate->text = ptr; parser->lexerstate->size = size; } - grub_strcpy (parser->lexerstate->text + parser->lexerstate->used - 1, str); + VasEBoot_strcpy (parser->lexerstate->text + parser->lexerstate->used - 1, str); parser->lexerstate->used += len; } static int -grub_lexer_resplit (const char *text, yyscan_t yyscanner) +VasEBoot_lexer_resplit (const char *text, yyscan_t yyscanner) { /* resplit text */ if (yy_scan_string (text, yyscanner)) @@ -372,21 +372,21 @@ grub_lexer_resplit (const char *text, yyscan_t yyscanner) yy_push_state (SPLIT, yyscanner); return 0; } - grub_script_yyerror (yyget_extra (yyscanner), 0); + VasEBoot_script_yyerror (yyget_extra (yyscanner), 0); return 1; } static int -grub_lexer_unput (const char *text, yyscan_t yyscanner) +VasEBoot_lexer_unput (const char *text, yyscan_t yyscanner) { - struct grub_lexer_param *lexerstate = yyget_extra (yyscanner)->lexerstate; + struct VasEBoot_lexer_param *lexerstate = yyget_extra (yyscanner)->lexerstate; - grub_free (lexerstate->prefix); + VasEBoot_free (lexerstate->prefix); - lexerstate->prefix = grub_strdup (text); + lexerstate->prefix = VasEBoot_strdup (text); if (! lexerstate->prefix) { - grub_script_yyerror (yyget_extra (yyscanner), N_("out of memory")); + VasEBoot_script_yyerror (yyget_extra (yyscanner), N_("out of memory")); return 1; } return 0; diff --git a/VasEBoot-core/term/arc/console.c b/VasEBoot-core/term/arc/console.c index c944ffc2d..d7562cd91 100644 --- a/VasEBoot-core/term/arc/console.c +++ b/VasEBoot-core/term/arc/console.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include /* FIXME: use unicode. */ static int -readkey (struct grub_term_input *term __attribute__ ((unused))) +readkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { unsigned long count; char chr; - if (GRUB_ARC_FIRMWARE_VECTOR->get_read_status (GRUB_ARC_STDIN)) + if (VasEBoot_ARC_FIRMWARE_VECTOR->get_read_status (VasEBoot_ARC_STDIN)) return -1; - if (GRUB_ARC_FIRMWARE_VECTOR->read (GRUB_ARC_STDIN, &chr, 1, &count)) + if (VasEBoot_ARC_FIRMWARE_VECTOR->read (VasEBoot_ARC_STDIN, &chr, 1, &count)) return -1; if (!count) return -1; @@ -40,23 +40,23 @@ readkey (struct grub_term_input *term __attribute__ ((unused))) } static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { unsigned long count; char chr = c; - GRUB_ARC_FIRMWARE_VECTOR->write (GRUB_ARC_STDOUT, &chr, 1, &count); + VasEBoot_ARC_FIRMWARE_VECTOR->write (VasEBoot_ARC_STDOUT, &chr, 1, &count); } -static struct grub_terminfo_output_state grub_console_terminfo_output; +static struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output; int -grub_arc_is_device_serial (const char *name, int alt_names) +VasEBoot_arc_is_device_serial (const char *name, int alt_names) { if (name[0] == '\0') return 0; - const char *ptr = name + grub_strlen (name) - 1; + const char *ptr = name + VasEBoot_strlen (name) - 1; int i; /* Recognize: @@ -71,7 +71,7 @@ grub_arc_is_device_serial (const char *name, int alt_names) return 0; ptr--; } - for (; ptr >= name && grub_isdigit (*ptr); ptr--); + for (; ptr >= name && VasEBoot_isdigit (*ptr); ptr--); if (ptr < name) return 0; if (!alt_names) @@ -81,11 +81,11 @@ grub_arc_is_device_serial (const char *name, int alt_names) ptr--; } if (ptr + 1 >= name + sizeof ("serial") - 1 - && grub_memcmp (ptr + 1 - (sizeof ("serial") - 1), + && VasEBoot_memcmp (ptr + 1 - (sizeof ("serial") - 1), "serial", sizeof ("serial") - 1) == 0) return 1; if (!(ptr + 1 >= name + sizeof ("line") - 1 - && grub_memcmp (ptr + 1 - (sizeof ("line") - 1), + && VasEBoot_memcmp (ptr + 1 - (sizeof ("line") - 1), "line", sizeof ("line") - 1) == 0)) return 0; ptr -= sizeof ("line") - 1; @@ -113,97 +113,97 @@ check_is_serial (void) variable. If he does there is nothing we can do. Fortunately failure isn't critical. */ - if (GRUB_ARC_SYSTEM_PARAMETER_BLOCK->firmware_vector_length - >= (unsigned) ((char *) (&GRUB_ARC_FIRMWARE_VECTOR->getenvironmentvariable + 1) - - (char *) GRUB_ARC_FIRMWARE_VECTOR) - && GRUB_ARC_FIRMWARE_VECTOR->getenvironmentvariable) - consout = GRUB_ARC_FIRMWARE_VECTOR->getenvironmentvariable ("ConsoleOut"); + if (VasEBoot_ARC_SYSTEM_PARAMETER_BLOCK->firmware_vector_length + >= (unsigned) ((char *) (&VasEBoot_ARC_FIRMWARE_VECTOR->getenvironmentvariable + 1) + - (char *) VasEBoot_ARC_FIRMWARE_VECTOR) + && VasEBoot_ARC_FIRMWARE_VECTOR->getenvironmentvariable) + consout = VasEBoot_ARC_FIRMWARE_VECTOR->getenvironmentvariable ("ConsoleOut"); if (!consout) return is_serial = 0; - return is_serial = grub_arc_is_device_serial (consout, 0); + return is_serial = VasEBoot_arc_is_device_serial (consout, 0); } static void set_console_dimensions (void) { - struct grub_arc_display_status *info = NULL; + struct VasEBoot_arc_display_status *info = NULL; if (check_is_serial ()) { - grub_console_terminfo_output.size.x = 80; - grub_console_terminfo_output.size.y = 24; + VasEBoot_console_terminfo_output.size.x = 80; + VasEBoot_console_terminfo_output.size.y = 24; return; } - if (GRUB_ARC_SYSTEM_PARAMETER_BLOCK->firmware_vector_length - >= (unsigned) ((char *) (&GRUB_ARC_FIRMWARE_VECTOR->getdisplaystatus + 1) - - (char *) GRUB_ARC_FIRMWARE_VECTOR) - && GRUB_ARC_FIRMWARE_VECTOR->getdisplaystatus) - info = GRUB_ARC_FIRMWARE_VECTOR->getdisplaystatus (GRUB_ARC_STDOUT); + if (VasEBoot_ARC_SYSTEM_PARAMETER_BLOCK->firmware_vector_length + >= (unsigned) ((char *) (&VasEBoot_ARC_FIRMWARE_VECTOR->getdisplaystatus + 1) + - (char *) VasEBoot_ARC_FIRMWARE_VECTOR) + && VasEBoot_ARC_FIRMWARE_VECTOR->getdisplaystatus) + info = VasEBoot_ARC_FIRMWARE_VECTOR->getdisplaystatus (VasEBoot_ARC_STDOUT); if (info) { - grub_console_terminfo_output.size.x = info->w + 1; - grub_console_terminfo_output.size.y = info->h + 1; + VasEBoot_console_terminfo_output.size.x = info->w + 1; + VasEBoot_console_terminfo_output.size.y = info->h + 1; } } -static grub_err_t -grub_console_init_output (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_console_init_output (struct VasEBoot_term_output *term) { set_console_dimensions (); - grub_terminfo_output_init (term); + VasEBoot_terminfo_output_init (term); return 0; } -static struct grub_terminfo_input_state grub_console_terminfo_input = +static struct VasEBoot_terminfo_input_state VasEBoot_console_terminfo_input = { .readkey = readkey }; -static struct grub_terminfo_output_state grub_console_terminfo_output = +static struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output = { .put = put, .size = { 80, 20 } }; -static struct grub_term_input grub_console_term_input = +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", - .init = grub_terminfo_input_init, - .getkey = grub_terminfo_getkey, - .data = &grub_console_terminfo_input + .init = VasEBoot_terminfo_input_init, + .getkey = VasEBoot_terminfo_getkey, + .data = &VasEBoot_console_terminfo_input }; -static struct grub_term_output grub_console_term_output = +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", - .init = grub_console_init_output, - .putchar = grub_terminfo_putchar, - .getxy = grub_terminfo_getxy, - .getwh = grub_terminfo_getwh, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_terminfo_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, - .data = &grub_console_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_FAST + .init = VasEBoot_console_init_output, + .putchar = VasEBoot_terminfo_putchar, + .getxy = VasEBoot_terminfo_getxy, + .getwh = VasEBoot_terminfo_getwh, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_terminfo_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, + .data = &VasEBoot_console_terminfo_output, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init_early (void) +VasEBoot_console_init_early (void) { - grub_term_register_input ("console", &grub_console_term_input); - grub_term_register_output ("console", &grub_console_term_output); + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); } void -grub_console_init_lately (void) +VasEBoot_console_init_lately (void) { - grub_terminfo_init (); + VasEBoot_terminfo_init (); if (check_is_serial ()) - grub_terminfo_output_register (&grub_console_term_output, "vt100"); + VasEBoot_terminfo_output_register (&VasEBoot_console_term_output, "vt100"); else - grub_terminfo_output_register (&grub_console_term_output, "arc"); + VasEBoot_terminfo_output_register (&VasEBoot_console_term_output, "arc"); } diff --git a/VasEBoot-core/term/arc/serial.c b/VasEBoot-core/term/arc/serial.c index 87d1ce821..716f9370a 100644 --- a/VasEBoot-core/term/arc/serial.c +++ b/VasEBoot-core/term/arc/serial.c @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include static void -do_real_config (struct grub_serial_port *port) +do_real_config (struct VasEBoot_serial_port *port) { char *name; if (port->configured) return; - name = grub_arc_alt_name_to_norm (port->name, ""); + name = VasEBoot_arc_alt_name_to_norm (port->name, ""); - if (GRUB_ARC_FIRMWARE_VECTOR->open (name,GRUB_ARC_FILE_ACCESS_OPEN_RW, + if (VasEBoot_ARC_FIRMWARE_VECTOR->open (name,VasEBoot_ARC_FILE_ACCESS_OPEN_RW, &port->handle)) port->handle_valid = 0; else @@ -46,7 +46,7 @@ do_real_config (struct grub_serial_port *port) /* Fetch a key. */ static int -serial_hw_fetch (struct grub_serial_port *port) +serial_hw_fetch (struct VasEBoot_serial_port *port) { unsigned long actual; char c; @@ -55,7 +55,7 @@ serial_hw_fetch (struct grub_serial_port *port) if (!port->handle_valid) return -1; - if (GRUB_ARC_FIRMWARE_VECTOR->read (port->handle, &c, + if (VasEBoot_ARC_FIRMWARE_VECTOR->read (port->handle, &c, 1, &actual) || actual <= 0) return -1; return c; @@ -63,7 +63,7 @@ serial_hw_fetch (struct grub_serial_port *port) /* Put a character. */ static void -serial_hw_put (struct grub_serial_port *port, const int c) +serial_hw_put (struct VasEBoot_serial_port *port, const int c) { unsigned long actual; char c0 = c; @@ -73,7 +73,7 @@ serial_hw_put (struct grub_serial_port *port, const int c) if (!port->handle_valid) return; - GRUB_ARC_FIRMWARE_VECTOR->write (port->handle, &c0, + VasEBoot_ARC_FIRMWARE_VECTOR->write (port->handle, &c0, 1, &actual); } @@ -84,16 +84,16 @@ serial_hw_put (struct grub_serial_port *port, const int c) STOP_BIT_LEN is the length of the stop bit. The possible values for WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as macros. */ -static grub_err_t -serial_hw_configure (struct grub_serial_port *port __attribute__ ((unused)), - struct grub_serial_config *config __attribute__ ((unused))) +static VasEBoot_err_t +serial_hw_configure (struct VasEBoot_serial_port *port __attribute__ ((unused)), + struct VasEBoot_serial_config *config __attribute__ ((unused))) { /* FIXME: no ARC serial config available. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_serial_driver grub_arcserial_driver = +struct VasEBoot_serial_driver VasEBoot_arcserial_driver = { .configure = serial_hw_configure, .fetch = serial_hw_fetch, @@ -101,47 +101,47 @@ struct grub_serial_driver grub_arcserial_driver = }; const char * -grub_arcserial_add_port (const char *path) +VasEBoot_arcserial_add_port (const char *path) { - struct grub_serial_port *port; - grub_err_t err; + struct VasEBoot_serial_port *port; + VasEBoot_err_t err; - port = grub_zalloc (sizeof (*port)); + port = VasEBoot_zalloc (sizeof (*port)); if (!port) return NULL; - port->name = grub_strdup (path); + port->name = VasEBoot_strdup (path); if (!port->name) return NULL; - port->driver = &grub_arcserial_driver; - err = grub_serial_config_defaults (port); + port->driver = &VasEBoot_arcserial_driver; + err = VasEBoot_serial_config_defaults (port); if (err) - grub_print_error (); + VasEBoot_print_error (); - grub_serial_register (port); + VasEBoot_serial_register (port); return port->name; } static int dev_iterate (const char *name, - const struct grub_arc_component *comp __attribute__ ((unused)), + const struct VasEBoot_arc_component *comp __attribute__ ((unused)), void *data __attribute__ ((unused))) { /* We should check consolein/consoleout flags as well but some implementations are buggy. */ - if ((comp->flags & (GRUB_ARC_COMPONENT_FLAG_IN | GRUB_ARC_COMPONENT_FLAG_OUT)) - != (GRUB_ARC_COMPONENT_FLAG_IN | GRUB_ARC_COMPONENT_FLAG_OUT)) + if ((comp->flags & (VasEBoot_ARC_COMPONENT_FLAG_IN | VasEBoot_ARC_COMPONENT_FLAG_OUT)) + != (VasEBoot_ARC_COMPONENT_FLAG_IN | VasEBoot_ARC_COMPONENT_FLAG_OUT)) return 0; - if (!grub_arc_is_device_serial (name, 1)) + if (!VasEBoot_arc_is_device_serial (name, 1)) return 0; - grub_arcserial_add_port (name); + VasEBoot_arcserial_add_port (name); return 0; } void -grub_arcserial_init (void) +VasEBoot_arcserial_init (void) { - grub_arc_iterate_devs (dev_iterate, 0, 1); + VasEBoot_arc_iterate_devs (dev_iterate, 0, 1); } diff --git a/VasEBoot-core/term/at_keyboard.c b/VasEBoot-core/term/at_keyboard.c index b4ea9ff7e..cc10a52ed 100644 --- a/VasEBoot-core/term/at_keyboard.c +++ b/VasEBoot-core/term/at_keyboard.c @@ -1,229 +1,229 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static short at_keyboard_status = 0; static int e0_received = 0; static int f0_received = 0; -static grub_uint8_t led_status; +static VasEBoot_uint8_t led_status; #define KEYBOARD_LED_SCROLL (1 << 0) #define KEYBOARD_LED_NUM (1 << 1) #define KEYBOARD_LED_CAPS (1 << 2) -static grub_uint8_t grub_keyboard_controller_orig; -static grub_uint8_t grub_keyboard_orig_set; -static grub_uint8_t current_set; +static VasEBoot_uint8_t VasEBoot_keyboard_controller_orig; +static VasEBoot_uint8_t VasEBoot_keyboard_orig_set; +static VasEBoot_uint8_t current_set; static void -grub_keyboard_controller_init (void); +VasEBoot_keyboard_controller_init (void); -static const grub_uint8_t set1_mapping[128] = +static const VasEBoot_uint8_t set1_mapping[128] = { - /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE, - /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2, - /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4, - /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6, - /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8, - /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0, - /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL, - /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB, - /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W, - /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R, - /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y, - /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I, - /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P, - /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET, - /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL, - /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S, - /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F, - /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H, - /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K, - /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON, - /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE, - /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH, - /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X, - /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V, - /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N, - /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA, - /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH, - /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL, - /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE, - /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1, - /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3, - /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5, - /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7, - /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9, - /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK, - /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7, - /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9, - /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4, - /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6, - /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1, - /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3, - /* 0x52 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, + /* 0x00 */ 0 /* Unused */, VasEBoot_KEYBOARD_KEY_ESCAPE, + /* 0x02 */ VasEBoot_KEYBOARD_KEY_1, VasEBoot_KEYBOARD_KEY_2, + /* 0x04 */ VasEBoot_KEYBOARD_KEY_3, VasEBoot_KEYBOARD_KEY_4, + /* 0x06 */ VasEBoot_KEYBOARD_KEY_5, VasEBoot_KEYBOARD_KEY_6, + /* 0x08 */ VasEBoot_KEYBOARD_KEY_7, VasEBoot_KEYBOARD_KEY_8, + /* 0x0a */ VasEBoot_KEYBOARD_KEY_9, VasEBoot_KEYBOARD_KEY_0, + /* 0x0c */ VasEBoot_KEYBOARD_KEY_DASH, VasEBoot_KEYBOARD_KEY_EQUAL, + /* 0x0e */ VasEBoot_KEYBOARD_KEY_BACKSPACE, VasEBoot_KEYBOARD_KEY_TAB, + /* 0x10 */ VasEBoot_KEYBOARD_KEY_Q, VasEBoot_KEYBOARD_KEY_W, + /* 0x12 */ VasEBoot_KEYBOARD_KEY_E, VasEBoot_KEYBOARD_KEY_R, + /* 0x14 */ VasEBoot_KEYBOARD_KEY_T, VasEBoot_KEYBOARD_KEY_Y, + /* 0x16 */ VasEBoot_KEYBOARD_KEY_U, VasEBoot_KEYBOARD_KEY_I, + /* 0x18 */ VasEBoot_KEYBOARD_KEY_O, VasEBoot_KEYBOARD_KEY_P, + /* 0x1a */ VasEBoot_KEYBOARD_KEY_LBRACKET, VasEBoot_KEYBOARD_KEY_RBRACKET, + /* 0x1c */ VasEBoot_KEYBOARD_KEY_ENTER, VasEBoot_KEYBOARD_KEY_LEFT_CTRL, + /* 0x1e */ VasEBoot_KEYBOARD_KEY_A, VasEBoot_KEYBOARD_KEY_S, + /* 0x20 */ VasEBoot_KEYBOARD_KEY_D, VasEBoot_KEYBOARD_KEY_F, + /* 0x22 */ VasEBoot_KEYBOARD_KEY_G, VasEBoot_KEYBOARD_KEY_H, + /* 0x24 */ VasEBoot_KEYBOARD_KEY_J, VasEBoot_KEYBOARD_KEY_K, + /* 0x26 */ VasEBoot_KEYBOARD_KEY_L, VasEBoot_KEYBOARD_KEY_SEMICOLON, + /* 0x28 */ VasEBoot_KEYBOARD_KEY_DQUOTE, VasEBoot_KEYBOARD_KEY_RQUOTE, + /* 0x2a */ VasEBoot_KEYBOARD_KEY_LEFT_SHIFT, VasEBoot_KEYBOARD_KEY_BACKSLASH, + /* 0x2c */ VasEBoot_KEYBOARD_KEY_Z, VasEBoot_KEYBOARD_KEY_X, + /* 0x2e */ VasEBoot_KEYBOARD_KEY_C, VasEBoot_KEYBOARD_KEY_V, + /* 0x30 */ VasEBoot_KEYBOARD_KEY_B, VasEBoot_KEYBOARD_KEY_N, + /* 0x32 */ VasEBoot_KEYBOARD_KEY_M, VasEBoot_KEYBOARD_KEY_COMMA, + /* 0x34 */ VasEBoot_KEYBOARD_KEY_DOT, VasEBoot_KEYBOARD_KEY_SLASH, + /* 0x36 */ VasEBoot_KEYBOARD_KEY_RIGHT_SHIFT, VasEBoot_KEYBOARD_KEY_NUMMUL, + /* 0x38 */ VasEBoot_KEYBOARD_KEY_LEFT_ALT, VasEBoot_KEYBOARD_KEY_SPACE, + /* 0x3a */ VasEBoot_KEYBOARD_KEY_CAPS_LOCK, VasEBoot_KEYBOARD_KEY_F1, + /* 0x3c */ VasEBoot_KEYBOARD_KEY_F2, VasEBoot_KEYBOARD_KEY_F3, + /* 0x3e */ VasEBoot_KEYBOARD_KEY_F4, VasEBoot_KEYBOARD_KEY_F5, + /* 0x40 */ VasEBoot_KEYBOARD_KEY_F6, VasEBoot_KEYBOARD_KEY_F7, + /* 0x42 */ VasEBoot_KEYBOARD_KEY_F8, VasEBoot_KEYBOARD_KEY_F9, + /* 0x44 */ VasEBoot_KEYBOARD_KEY_F10, VasEBoot_KEYBOARD_KEY_NUM_LOCK, + /* 0x46 */ VasEBoot_KEYBOARD_KEY_SCROLL_LOCK, VasEBoot_KEYBOARD_KEY_NUM7, + /* 0x48 */ VasEBoot_KEYBOARD_KEY_NUM8, VasEBoot_KEYBOARD_KEY_NUM9, + /* 0x4a */ VasEBoot_KEYBOARD_KEY_NUMMINUS, VasEBoot_KEYBOARD_KEY_NUM4, + /* 0x4c */ VasEBoot_KEYBOARD_KEY_NUM5, VasEBoot_KEYBOARD_KEY_NUM6, + /* 0x4e */ VasEBoot_KEYBOARD_KEY_NUMPLUS, VasEBoot_KEYBOARD_KEY_NUM1, + /* 0x50 */ VasEBoot_KEYBOARD_KEY_NUM2, VasEBoot_KEYBOARD_KEY_NUM3, + /* 0x52 */ VasEBoot_KEYBOARD_KEY_NUM0, VasEBoot_KEYBOARD_KEY_NUMDOT, /* 0x54 */ 0, 0, - /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, - /* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0, + /* 0x56 */ VasEBoot_KEYBOARD_KEY_102ND, VasEBoot_KEYBOARD_KEY_F11, + /* 0x58 */ VasEBoot_KEYBOARD_KEY_F12, 0, /* 0x5a */ 0, 0, /* 0x5c */ 0, 0, /* 0x5e */ 0, 0, /* 0x60 */ 0, 0, /* 0x62 */ 0, 0, /* OLPC keys. Just mapped to normal keys. */ - /* 0x64 */ 0, GRUB_KEYBOARD_KEY_UP, - /* 0x66 */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_LEFT, - /* 0x68 */ GRUB_KEYBOARD_KEY_RIGHT, 0, + /* 0x64 */ 0, VasEBoot_KEYBOARD_KEY_UP, + /* 0x66 */ VasEBoot_KEYBOARD_KEY_DOWN, VasEBoot_KEYBOARD_KEY_LEFT, + /* 0x68 */ VasEBoot_KEYBOARD_KEY_RIGHT, 0, /* 0x6a */ 0, 0, /* 0x6c */ 0, 0, /* 0x6e */ 0, 0, /* 0x70 */ 0, 0, - /* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO, + /* 0x72 */ 0, VasEBoot_KEYBOARD_KEY_JP_RO, /* 0x74 */ 0, 0, /* 0x76 */ 0, 0, /* 0x78 */ 0, 0, /* 0x7a */ 0, 0, - /* 0x7c */ 0, GRUB_KEYBOARD_KEY_JP_YEN, - /* 0x7e */ GRUB_KEYBOARD_KEY_KPCOMMA + /* 0x7c */ 0, VasEBoot_KEYBOARD_KEY_JP_YEN, + /* 0x7e */ VasEBoot_KEYBOARD_KEY_KPCOMMA }; static const struct { - grub_uint8_t from, to; + VasEBoot_uint8_t from, to; } set1_e0_mapping[] = { - {0x1c, GRUB_KEYBOARD_KEY_NUMENTER}, - {0x1d, GRUB_KEYBOARD_KEY_RIGHT_CTRL}, - {0x35, GRUB_KEYBOARD_KEY_NUMSLASH }, - {0x38, GRUB_KEYBOARD_KEY_RIGHT_ALT}, - {0x47, GRUB_KEYBOARD_KEY_HOME}, - {0x48, GRUB_KEYBOARD_KEY_UP}, - {0x49, GRUB_KEYBOARD_KEY_PPAGE}, - {0x4b, GRUB_KEYBOARD_KEY_LEFT}, - {0x4d, GRUB_KEYBOARD_KEY_RIGHT}, - {0x4f, GRUB_KEYBOARD_KEY_END}, - {0x50, GRUB_KEYBOARD_KEY_DOWN}, - {0x51, GRUB_KEYBOARD_KEY_NPAGE}, - {0x52, GRUB_KEYBOARD_KEY_INSERT}, - {0x53, GRUB_KEYBOARD_KEY_DELETE}, + {0x1c, VasEBoot_KEYBOARD_KEY_NUMENTER}, + {0x1d, VasEBoot_KEYBOARD_KEY_RIGHT_CTRL}, + {0x35, VasEBoot_KEYBOARD_KEY_NUMSLASH }, + {0x38, VasEBoot_KEYBOARD_KEY_RIGHT_ALT}, + {0x47, VasEBoot_KEYBOARD_KEY_HOME}, + {0x48, VasEBoot_KEYBOARD_KEY_UP}, + {0x49, VasEBoot_KEYBOARD_KEY_PPAGE}, + {0x4b, VasEBoot_KEYBOARD_KEY_LEFT}, + {0x4d, VasEBoot_KEYBOARD_KEY_RIGHT}, + {0x4f, VasEBoot_KEYBOARD_KEY_END}, + {0x50, VasEBoot_KEYBOARD_KEY_DOWN}, + {0x51, VasEBoot_KEYBOARD_KEY_NPAGE}, + {0x52, VasEBoot_KEYBOARD_KEY_INSERT}, + {0x53, VasEBoot_KEYBOARD_KEY_DELETE}, }; -static const grub_uint8_t set2_mapping[256] = +static const VasEBoot_uint8_t set2_mapping[256] = { - /* 0x00 */ 0, GRUB_KEYBOARD_KEY_F9, - /* 0x02 */ 0, GRUB_KEYBOARD_KEY_F5, - /* 0x04 */ GRUB_KEYBOARD_KEY_F3, GRUB_KEYBOARD_KEY_F1, - /* 0x06 */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F12, - /* 0x08 */ 0, GRUB_KEYBOARD_KEY_F10, - /* 0x0a */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F6, - /* 0x0c */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_TAB, - /* 0x0e */ GRUB_KEYBOARD_KEY_RQUOTE, 0, - /* 0x10 */ 0, GRUB_KEYBOARD_KEY_LEFT_ALT, - /* 0x12 */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, 0, - /* 0x14 */ GRUB_KEYBOARD_KEY_LEFT_CTRL, GRUB_KEYBOARD_KEY_Q, - /* 0x16 */ GRUB_KEYBOARD_KEY_1, 0, + /* 0x00 */ 0, VasEBoot_KEYBOARD_KEY_F9, + /* 0x02 */ 0, VasEBoot_KEYBOARD_KEY_F5, + /* 0x04 */ VasEBoot_KEYBOARD_KEY_F3, VasEBoot_KEYBOARD_KEY_F1, + /* 0x06 */ VasEBoot_KEYBOARD_KEY_F2, VasEBoot_KEYBOARD_KEY_F12, + /* 0x08 */ 0, VasEBoot_KEYBOARD_KEY_F10, + /* 0x0a */ VasEBoot_KEYBOARD_KEY_F8, VasEBoot_KEYBOARD_KEY_F6, + /* 0x0c */ VasEBoot_KEYBOARD_KEY_F4, VasEBoot_KEYBOARD_KEY_TAB, + /* 0x0e */ VasEBoot_KEYBOARD_KEY_RQUOTE, 0, + /* 0x10 */ 0, VasEBoot_KEYBOARD_KEY_LEFT_ALT, + /* 0x12 */ VasEBoot_KEYBOARD_KEY_LEFT_SHIFT, 0, + /* 0x14 */ VasEBoot_KEYBOARD_KEY_LEFT_CTRL, VasEBoot_KEYBOARD_KEY_Q, + /* 0x16 */ VasEBoot_KEYBOARD_KEY_1, 0, /* 0x18 */ 0, 0, - /* 0x1a */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_S, - /* 0x1c */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_W, - /* 0x1e */ GRUB_KEYBOARD_KEY_2, 0, - /* 0x20 */ 0, GRUB_KEYBOARD_KEY_C, - /* 0x22 */ GRUB_KEYBOARD_KEY_X, GRUB_KEYBOARD_KEY_D, - /* 0x24 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_4, - /* 0x26 */ GRUB_KEYBOARD_KEY_3, 0, - /* 0x28 */ 0, GRUB_KEYBOARD_KEY_SPACE, - /* 0x2a */ GRUB_KEYBOARD_KEY_V, GRUB_KEYBOARD_KEY_F, - /* 0x2c */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_R, - /* 0x2e */ GRUB_KEYBOARD_KEY_5, 0, - /* 0x30 */ 0, GRUB_KEYBOARD_KEY_N, - /* 0x32 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_H, - /* 0x34 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_Y, - /* 0x36 */ GRUB_KEYBOARD_KEY_6, 0, + /* 0x1a */ VasEBoot_KEYBOARD_KEY_Z, VasEBoot_KEYBOARD_KEY_S, + /* 0x1c */ VasEBoot_KEYBOARD_KEY_A, VasEBoot_KEYBOARD_KEY_W, + /* 0x1e */ VasEBoot_KEYBOARD_KEY_2, 0, + /* 0x20 */ 0, VasEBoot_KEYBOARD_KEY_C, + /* 0x22 */ VasEBoot_KEYBOARD_KEY_X, VasEBoot_KEYBOARD_KEY_D, + /* 0x24 */ VasEBoot_KEYBOARD_KEY_E, VasEBoot_KEYBOARD_KEY_4, + /* 0x26 */ VasEBoot_KEYBOARD_KEY_3, 0, + /* 0x28 */ 0, VasEBoot_KEYBOARD_KEY_SPACE, + /* 0x2a */ VasEBoot_KEYBOARD_KEY_V, VasEBoot_KEYBOARD_KEY_F, + /* 0x2c */ VasEBoot_KEYBOARD_KEY_T, VasEBoot_KEYBOARD_KEY_R, + /* 0x2e */ VasEBoot_KEYBOARD_KEY_5, 0, + /* 0x30 */ 0, VasEBoot_KEYBOARD_KEY_N, + /* 0x32 */ VasEBoot_KEYBOARD_KEY_B, VasEBoot_KEYBOARD_KEY_H, + /* 0x34 */ VasEBoot_KEYBOARD_KEY_G, VasEBoot_KEYBOARD_KEY_Y, + /* 0x36 */ VasEBoot_KEYBOARD_KEY_6, 0, /* 0x38 */ 0, 0, - /* 0x3a */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_J, - /* 0x3c */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_7, - /* 0x3e */ GRUB_KEYBOARD_KEY_8, 0, - /* 0x40 */ 0, GRUB_KEYBOARD_KEY_COMMA, - /* 0x42 */ GRUB_KEYBOARD_KEY_K, GRUB_KEYBOARD_KEY_I, - /* 0x44 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_0, - /* 0x46 */ GRUB_KEYBOARD_KEY_9, 0, - /* 0x48 */ 0, GRUB_KEYBOARD_KEY_DOT, - /* 0x4a */ GRUB_KEYBOARD_KEY_SLASH, GRUB_KEYBOARD_KEY_L, - /* 0x4c */ GRUB_KEYBOARD_KEY_SEMICOLON, GRUB_KEYBOARD_KEY_P, - /* 0x4e */ GRUB_KEYBOARD_KEY_DASH, 0, - /* 0x50 */ 0, GRUB_KEYBOARD_KEY_JP_RO, - /* 0x52 */ GRUB_KEYBOARD_KEY_DQUOTE, 0, - /* 0x54 */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_EQUAL, + /* 0x3a */ VasEBoot_KEYBOARD_KEY_M, VasEBoot_KEYBOARD_KEY_J, + /* 0x3c */ VasEBoot_KEYBOARD_KEY_U, VasEBoot_KEYBOARD_KEY_7, + /* 0x3e */ VasEBoot_KEYBOARD_KEY_8, 0, + /* 0x40 */ 0, VasEBoot_KEYBOARD_KEY_COMMA, + /* 0x42 */ VasEBoot_KEYBOARD_KEY_K, VasEBoot_KEYBOARD_KEY_I, + /* 0x44 */ VasEBoot_KEYBOARD_KEY_O, VasEBoot_KEYBOARD_KEY_0, + /* 0x46 */ VasEBoot_KEYBOARD_KEY_9, 0, + /* 0x48 */ 0, VasEBoot_KEYBOARD_KEY_DOT, + /* 0x4a */ VasEBoot_KEYBOARD_KEY_SLASH, VasEBoot_KEYBOARD_KEY_L, + /* 0x4c */ VasEBoot_KEYBOARD_KEY_SEMICOLON, VasEBoot_KEYBOARD_KEY_P, + /* 0x4e */ VasEBoot_KEYBOARD_KEY_DASH, 0, + /* 0x50 */ 0, VasEBoot_KEYBOARD_KEY_JP_RO, + /* 0x52 */ VasEBoot_KEYBOARD_KEY_DQUOTE, 0, + /* 0x54 */ VasEBoot_KEYBOARD_KEY_LBRACKET, VasEBoot_KEYBOARD_KEY_EQUAL, /* 0x56 */ 0, 0, - /* 0x58 */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_RIGHT_SHIFT, - /* 0x5a */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_RBRACKET, - /* 0x5c */ 0, GRUB_KEYBOARD_KEY_BACKSLASH, + /* 0x58 */ VasEBoot_KEYBOARD_KEY_CAPS_LOCK, VasEBoot_KEYBOARD_KEY_RIGHT_SHIFT, + /* 0x5a */ VasEBoot_KEYBOARD_KEY_ENTER, VasEBoot_KEYBOARD_KEY_RBRACKET, + /* 0x5c */ 0, VasEBoot_KEYBOARD_KEY_BACKSLASH, /* 0x5e */ 0, 0, - /* 0x60 */ 0, GRUB_KEYBOARD_KEY_102ND, + /* 0x60 */ 0, VasEBoot_KEYBOARD_KEY_102ND, /* 0x62 */ 0, 0, /* 0x64 */ 0, 0, - /* 0x66 */ GRUB_KEYBOARD_KEY_BACKSPACE, 0, - /* 0x68 */ 0, GRUB_KEYBOARD_KEY_NUM1, - /* 0x6a */ GRUB_KEYBOARD_KEY_JP_YEN, GRUB_KEYBOARD_KEY_NUM4, - /* 0x6c */ GRUB_KEYBOARD_KEY_NUM7, GRUB_KEYBOARD_KEY_KPCOMMA, + /* 0x66 */ VasEBoot_KEYBOARD_KEY_BACKSPACE, 0, + /* 0x68 */ 0, VasEBoot_KEYBOARD_KEY_NUM1, + /* 0x6a */ VasEBoot_KEYBOARD_KEY_JP_YEN, VasEBoot_KEYBOARD_KEY_NUM4, + /* 0x6c */ VasEBoot_KEYBOARD_KEY_NUM7, VasEBoot_KEYBOARD_KEY_KPCOMMA, /* 0x6e */ 0, 0, - /* 0x70 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, - /* 0x72 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM5, - /* 0x74 */ GRUB_KEYBOARD_KEY_NUM6, GRUB_KEYBOARD_KEY_NUM8, - /* 0x76 */ GRUB_KEYBOARD_KEY_ESCAPE, GRUB_KEYBOARD_KEY_NUM_LOCK, - /* 0x78 */ GRUB_KEYBOARD_KEY_F11, GRUB_KEYBOARD_KEY_NUMPLUS, - /* 0x7a */ GRUB_KEYBOARD_KEY_NUM3, GRUB_KEYBOARD_KEY_NUMMINUS, - /* 0x7c */ GRUB_KEYBOARD_KEY_NUMMUL, GRUB_KEYBOARD_KEY_NUM9, - /* 0x7e */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, 0, + /* 0x70 */ VasEBoot_KEYBOARD_KEY_NUM0, VasEBoot_KEYBOARD_KEY_NUMDOT, + /* 0x72 */ VasEBoot_KEYBOARD_KEY_NUM2, VasEBoot_KEYBOARD_KEY_NUM5, + /* 0x74 */ VasEBoot_KEYBOARD_KEY_NUM6, VasEBoot_KEYBOARD_KEY_NUM8, + /* 0x76 */ VasEBoot_KEYBOARD_KEY_ESCAPE, VasEBoot_KEYBOARD_KEY_NUM_LOCK, + /* 0x78 */ VasEBoot_KEYBOARD_KEY_F11, VasEBoot_KEYBOARD_KEY_NUMPLUS, + /* 0x7a */ VasEBoot_KEYBOARD_KEY_NUM3, VasEBoot_KEYBOARD_KEY_NUMMINUS, + /* 0x7c */ VasEBoot_KEYBOARD_KEY_NUMMUL, VasEBoot_KEYBOARD_KEY_NUM9, + /* 0x7e */ VasEBoot_KEYBOARD_KEY_SCROLL_LOCK, 0, /* 0x80 */ 0, 0, - /* 0x82 */ 0, GRUB_KEYBOARD_KEY_F7, + /* 0x82 */ 0, VasEBoot_KEYBOARD_KEY_F7, }; static const struct { - grub_uint8_t from, to; + VasEBoot_uint8_t from, to; } set2_e0_mapping[] = { - {0x11, GRUB_KEYBOARD_KEY_RIGHT_ALT}, - {0x14, GRUB_KEYBOARD_KEY_RIGHT_CTRL}, - {0x4a, GRUB_KEYBOARD_KEY_NUMSLASH}, - {0x5a, GRUB_KEYBOARD_KEY_NUMENTER}, - {0x69, GRUB_KEYBOARD_KEY_END}, - {0x6b, GRUB_KEYBOARD_KEY_LEFT}, - {0x6c, GRUB_KEYBOARD_KEY_HOME}, - {0x70, GRUB_KEYBOARD_KEY_INSERT}, - {0x71, GRUB_KEYBOARD_KEY_DELETE}, - {0x72, GRUB_KEYBOARD_KEY_DOWN}, - {0x74, GRUB_KEYBOARD_KEY_RIGHT}, - {0x75, GRUB_KEYBOARD_KEY_UP}, - {0x7a, GRUB_KEYBOARD_KEY_NPAGE}, - {0x7d, GRUB_KEYBOARD_KEY_PPAGE}, + {0x11, VasEBoot_KEYBOARD_KEY_RIGHT_ALT}, + {0x14, VasEBoot_KEYBOARD_KEY_RIGHT_CTRL}, + {0x4a, VasEBoot_KEYBOARD_KEY_NUMSLASH}, + {0x5a, VasEBoot_KEYBOARD_KEY_NUMENTER}, + {0x69, VasEBoot_KEYBOARD_KEY_END}, + {0x6b, VasEBoot_KEYBOARD_KEY_LEFT}, + {0x6c, VasEBoot_KEYBOARD_KEY_HOME}, + {0x70, VasEBoot_KEYBOARD_KEY_INSERT}, + {0x71, VasEBoot_KEYBOARD_KEY_DELETE}, + {0x72, VasEBoot_KEYBOARD_KEY_DOWN}, + {0x74, VasEBoot_KEYBOARD_KEY_RIGHT}, + {0x75, VasEBoot_KEYBOARD_KEY_UP}, + {0x7a, VasEBoot_KEYBOARD_KEY_NPAGE}, + {0x7d, VasEBoot_KEYBOARD_KEY_PPAGE}, }; static int ping_sent; @@ -231,51 +231,51 @@ static int ping_sent; static void keyboard_controller_wait_until_ready (void) { - while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS))); + while (! KEYBOARD_COMMAND_ISREADY (VasEBoot_inb (KEYBOARD_REG_STATUS))); } -static grub_uint8_t +static VasEBoot_uint8_t wait_ack (void) { - grub_uint64_t endtime; - grub_uint8_t ack; + VasEBoot_uint64_t endtime; + VasEBoot_uint8_t ack; - endtime = grub_get_time_ms () + 20; + endtime = VasEBoot_get_time_ms () + 20; do - ack = grub_inb (KEYBOARD_REG_DATA); - while (ack != GRUB_AT_ACK && ack != GRUB_AT_NACK - && grub_get_time_ms () < endtime); + ack = VasEBoot_inb (KEYBOARD_REG_DATA); + while (ack != VasEBoot_AT_ACK && ack != VasEBoot_AT_NACK + && VasEBoot_get_time_ms () < endtime); return ack; } static int -at_command (grub_uint8_t data) +at_command (VasEBoot_uint8_t data) { unsigned i; - for (i = 0; i < GRUB_AT_TRIES; i++) + for (i = 0; i < VasEBoot_AT_TRIES; i++) { - grub_uint8_t ack; + VasEBoot_uint8_t ack; keyboard_controller_wait_until_ready (); - grub_outb (data, KEYBOARD_REG_STATUS); + VasEBoot_outb (data, KEYBOARD_REG_STATUS); ack = wait_ack (); - if (ack == GRUB_AT_NACK) + if (ack == VasEBoot_AT_NACK) continue; - if (ack == GRUB_AT_ACK) + if (ack == VasEBoot_AT_ACK) break; return 0; } - return (i != GRUB_AT_TRIES); + return (i != VasEBoot_AT_TRIES); } static void -grub_keyboard_controller_write (grub_uint8_t c) +VasEBoot_keyboard_controller_write (VasEBoot_uint8_t c) { at_command (KEYBOARD_COMMAND_WRITE); keyboard_controller_wait_until_ready (); - grub_outb (c, KEYBOARD_REG_DATA); + VasEBoot_outb (c, KEYBOARD_REG_DATA); } -#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) +#if defined (VasEBoot_MACHINE_MIPS_LOONGSON) || defined (VasEBoot_MACHINE_QEMU) || defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) #define USE_SCANCODE_SET 1 #else #define USE_SCANCODE_SET 0 @@ -283,12 +283,12 @@ grub_keyboard_controller_write (grub_uint8_t c) #if !USE_SCANCODE_SET -static grub_uint8_t -grub_keyboard_controller_read (void) +static VasEBoot_uint8_t +VasEBoot_keyboard_controller_read (void) { at_command (KEYBOARD_COMMAND_READ); keyboard_controller_wait_until_ready (); - return grub_inb (KEYBOARD_REG_DATA); + return VasEBoot_inb (KEYBOARD_REG_DATA); } #endif @@ -297,29 +297,29 @@ static int write_mode (int mode) { unsigned i; - for (i = 0; i < GRUB_AT_TRIES; i++) + for (i = 0; i < VasEBoot_AT_TRIES; i++) { - grub_uint8_t ack; + VasEBoot_uint8_t ack; keyboard_controller_wait_until_ready (); - grub_outb (0xf0, KEYBOARD_REG_DATA); + VasEBoot_outb (0xf0, KEYBOARD_REG_DATA); keyboard_controller_wait_until_ready (); - grub_outb (mode, KEYBOARD_REG_DATA); + VasEBoot_outb (mode, KEYBOARD_REG_DATA); keyboard_controller_wait_until_ready (); ack = wait_ack (); - if (ack == GRUB_AT_NACK) + if (ack == VasEBoot_AT_NACK) continue; - if (ack == GRUB_AT_ACK) + if (ack == VasEBoot_AT_ACK) break; return 0; } - return (i != GRUB_AT_TRIES); + return (i != VasEBoot_AT_TRIES); } static int query_mode (void) { - grub_uint8_t ret; + VasEBoot_uint8_t ret; int e; e = write_mode (0); @@ -329,8 +329,8 @@ query_mode (void) keyboard_controller_wait_until_ready (); do - ret = grub_inb (KEYBOARD_REG_DATA); - while (ret == GRUB_AT_ACK); + ret = VasEBoot_inb (KEYBOARD_REG_DATA); + while (ret == VasEBoot_AT_ACK); /* QEMU translates the set even in no-translate mode. */ if (ret == 0x43 || ret == 1) @@ -347,9 +347,9 @@ set_scancodes (void) { /* You must have visited computer museum. Keyboard without scancode set knowledge. Assume XT. */ - if (!grub_keyboard_orig_set) + if (!VasEBoot_keyboard_orig_set) { - grub_dprintf ("atkeyb", "No sets support assumed\n"); + VasEBoot_dprintf ("atkeyb", "No sets support assumed\n"); current_set = 1; return; } @@ -359,43 +359,43 @@ set_scancodes (void) return; #else - grub_keyboard_controller_write (grub_keyboard_controller_orig + VasEBoot_keyboard_controller_write (VasEBoot_keyboard_controller_orig & ~KEYBOARD_AT_TRANSLATE); write_mode (2); current_set = query_mode (); - grub_dprintf ("atkeyb", "returned set %d\n", current_set); + VasEBoot_dprintf ("atkeyb", "returned set %d\n", current_set); if (current_set == 2) return; write_mode (1); current_set = query_mode (); - grub_dprintf ("atkeyb", "returned set %d\n", current_set); + VasEBoot_dprintf ("atkeyb", "returned set %d\n", current_set); if (current_set == 1) return; - grub_dprintf ("atkeyb", "no supported scancode set found\n"); + VasEBoot_dprintf ("atkeyb", "no supported scancode set found\n"); #endif } static void -keyboard_controller_led (grub_uint8_t leds) +keyboard_controller_led (VasEBoot_uint8_t leds) { keyboard_controller_wait_until_ready (); - grub_outb (0xed, KEYBOARD_REG_DATA); + VasEBoot_outb (0xed, KEYBOARD_REG_DATA); keyboard_controller_wait_until_ready (); - grub_outb (leds & 0x7, KEYBOARD_REG_DATA); + VasEBoot_outb (leds & 0x7, KEYBOARD_REG_DATA); } static int fetch_key (int *is_break) { int was_ext = 0; - grub_uint8_t at_key; + VasEBoot_uint8_t at_key; int ret = 0; - if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) + if (! KEYBOARD_ISREADY (VasEBoot_inb (KEYBOARD_REG_STATUS))) return -1; - at_key = grub_inb (KEYBOARD_REG_DATA); + at_key = VasEBoot_inb (KEYBOARD_REG_DATA); /* May happen if no keyboard is connected. Just ignore this. */ if (at_key == 0xff) return -1; @@ -412,7 +412,7 @@ fetch_key (int *is_break) } /* Setting LEDs may generate ACKs. */ - if (at_key == GRUB_AT_ACK) + if (at_key == VasEBoot_AT_ACK) return -1; was_ext = e0_received; @@ -457,10 +457,10 @@ fetch_key (int *is_break) if (!ret) { if (was_ext) - grub_dprintf ("atkeyb", "Unknown key 0xe0+0x%02x from set %d\n", + VasEBoot_dprintf ("atkeyb", "Unknown key 0xe0+0x%02x from set %d\n", at_key, current_set); else - grub_dprintf ("atkeyb", "Unknown key 0x%02x from set %d\n", + VasEBoot_dprintf ("atkeyb", "Unknown key 0x%02x from set %d\n", at_key, current_set); return -1; } @@ -470,28 +470,28 @@ fetch_key (int *is_break) /* FIXME: This should become an interrupt service routine. For now it's just used to catch events from control keys. */ static int -grub_keyboard_isr (grub_keyboard_key_t key, int is_break) +VasEBoot_keyboard_isr (VasEBoot_keyboard_key_t key, int is_break) { if (!is_break) switch (key) { - case GRUB_KEYBOARD_KEY_LEFT_SHIFT: - at_keyboard_status |= GRUB_TERM_STATUS_LSHIFT; + case VasEBoot_KEYBOARD_KEY_LEFT_SHIFT: + at_keyboard_status |= VasEBoot_TERM_STATUS_LSHIFT; return 1; - case GRUB_KEYBOARD_KEY_RIGHT_SHIFT: - at_keyboard_status |= GRUB_TERM_STATUS_RSHIFT; + case VasEBoot_KEYBOARD_KEY_RIGHT_SHIFT: + at_keyboard_status |= VasEBoot_TERM_STATUS_RSHIFT; return 1; - case GRUB_KEYBOARD_KEY_LEFT_CTRL: - at_keyboard_status |= GRUB_TERM_STATUS_LCTRL; + case VasEBoot_KEYBOARD_KEY_LEFT_CTRL: + at_keyboard_status |= VasEBoot_TERM_STATUS_LCTRL; return 1; - case GRUB_KEYBOARD_KEY_RIGHT_CTRL: - at_keyboard_status |= GRUB_TERM_STATUS_RCTRL; + case VasEBoot_KEYBOARD_KEY_RIGHT_CTRL: + at_keyboard_status |= VasEBoot_TERM_STATUS_RCTRL; return 1; - case GRUB_KEYBOARD_KEY_RIGHT_ALT: - at_keyboard_status |= GRUB_TERM_STATUS_RALT; + case VasEBoot_KEYBOARD_KEY_RIGHT_ALT: + at_keyboard_status |= VasEBoot_TERM_STATUS_RALT; return 1; - case GRUB_KEYBOARD_KEY_LEFT_ALT: - at_keyboard_status |= GRUB_TERM_STATUS_LALT; + case VasEBoot_KEYBOARD_KEY_LEFT_ALT: + at_keyboard_status |= VasEBoot_TERM_STATUS_LALT; return 1; default: return 0; @@ -499,23 +499,23 @@ grub_keyboard_isr (grub_keyboard_key_t key, int is_break) else switch (key) { - case GRUB_KEYBOARD_KEY_LEFT_SHIFT: - at_keyboard_status &= ~GRUB_TERM_STATUS_LSHIFT; + case VasEBoot_KEYBOARD_KEY_LEFT_SHIFT: + at_keyboard_status &= ~VasEBoot_TERM_STATUS_LSHIFT; return 1; - case GRUB_KEYBOARD_KEY_RIGHT_SHIFT: - at_keyboard_status &= ~GRUB_TERM_STATUS_RSHIFT; + case VasEBoot_KEYBOARD_KEY_RIGHT_SHIFT: + at_keyboard_status &= ~VasEBoot_TERM_STATUS_RSHIFT; return 1; - case GRUB_KEYBOARD_KEY_LEFT_CTRL: - at_keyboard_status &= ~GRUB_TERM_STATUS_LCTRL; + case VasEBoot_KEYBOARD_KEY_LEFT_CTRL: + at_keyboard_status &= ~VasEBoot_TERM_STATUS_LCTRL; return 1; - case GRUB_KEYBOARD_KEY_RIGHT_CTRL: - at_keyboard_status &= ~GRUB_TERM_STATUS_RCTRL; + case VasEBoot_KEYBOARD_KEY_RIGHT_CTRL: + at_keyboard_status &= ~VasEBoot_TERM_STATUS_RCTRL; return 1; - case GRUB_KEYBOARD_KEY_RIGHT_ALT: - at_keyboard_status &= ~GRUB_TERM_STATUS_RALT; + case VasEBoot_KEYBOARD_KEY_RIGHT_ALT: + at_keyboard_status &= ~VasEBoot_TERM_STATUS_RALT; return 1; - case GRUB_KEYBOARD_KEY_LEFT_ALT: - at_keyboard_status &= ~GRUB_TERM_STATUS_LALT; + case VasEBoot_KEYBOARD_KEY_LEFT_ALT: + at_keyboard_status &= ~VasEBoot_TERM_STATUS_LALT; return 1; default: return 0; @@ -524,7 +524,7 @@ grub_keyboard_isr (grub_keyboard_key_t key, int is_break) /* If there is a raw key pending, return it; otherwise return -1. */ static int -grub_keyboard_getkey (void) +VasEBoot_keyboard_getkey (void) { int key; int is_break = 0; @@ -533,7 +533,7 @@ grub_keyboard_getkey (void) if (key == -1) return -1; - if (grub_keyboard_isr (key, is_break)) + if (VasEBoot_keyboard_isr (key, is_break)) return -1; if (is_break) return -1; @@ -541,155 +541,155 @@ grub_keyboard_getkey (void) } int -grub_at_keyboard_is_alive (void) +VasEBoot_at_keyboard_is_alive (void) { if (current_set != 0) return 1; if (ping_sent - && KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)) - && grub_inb (KEYBOARD_REG_DATA) == 0x55) + && KEYBOARD_COMMAND_ISREADY (VasEBoot_inb (KEYBOARD_REG_STATUS)) + && VasEBoot_inb (KEYBOARD_REG_DATA) == 0x55) { - grub_keyboard_controller_init (); + VasEBoot_keyboard_controller_init (); return 1; } - if (KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) + if (KEYBOARD_COMMAND_ISREADY (VasEBoot_inb (KEYBOARD_REG_STATUS))) { - grub_outb (0xaa, KEYBOARD_REG_STATUS); + VasEBoot_outb (0xaa, KEYBOARD_REG_STATUS); ping_sent = 1; } return 0; } /* If there is a character pending, return it; - otherwise return GRUB_TERM_NO_KEY. */ + otherwise return VasEBoot_TERM_NO_KEY. */ static int -grub_at_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused))) +VasEBoot_at_keyboard_getkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { int code; - if (!grub_at_keyboard_is_alive ()) - return GRUB_TERM_NO_KEY; + if (!VasEBoot_at_keyboard_is_alive ()) + return VasEBoot_TERM_NO_KEY; - code = grub_keyboard_getkey (); + code = VasEBoot_keyboard_getkey (); if (code == -1) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; #ifdef DEBUG_AT_KEYBOARD - grub_dprintf ("atkeyb", "Detected key 0x%x\n", code); + VasEBoot_dprintf ("atkeyb", "Detected key 0x%x\n", code); #endif switch (code) { - case GRUB_KEYBOARD_KEY_CAPS_LOCK: - at_keyboard_status ^= GRUB_TERM_STATUS_CAPS; + case VasEBoot_KEYBOARD_KEY_CAPS_LOCK: + at_keyboard_status ^= VasEBoot_TERM_STATUS_CAPS; led_status ^= KEYBOARD_LED_CAPS; keyboard_controller_led (led_status); #ifdef DEBUG_AT_KEYBOARD - grub_dprintf ("atkeyb", "caps_lock = %d\n", !!(at_keyboard_status & GRUB_KEYBOARD_STATUS_CAPS_LOCK)); + VasEBoot_dprintf ("atkeyb", "caps_lock = %d\n", !!(at_keyboard_status & VasEBoot_KEYBOARD_STATUS_CAPS_LOCK)); #endif - return GRUB_TERM_NO_KEY; - case GRUB_KEYBOARD_KEY_NUM_LOCK: - at_keyboard_status ^= GRUB_TERM_STATUS_NUM; + return VasEBoot_TERM_NO_KEY; + case VasEBoot_KEYBOARD_KEY_NUM_LOCK: + at_keyboard_status ^= VasEBoot_TERM_STATUS_NUM; led_status ^= KEYBOARD_LED_NUM; keyboard_controller_led (led_status); #ifdef DEBUG_AT_KEYBOARD - grub_dprintf ("atkeyb", "num_lock = %d\n", !!(at_keyboard_status & GRUB_KEYBOARD_STATUS_NUM_LOCK)); + VasEBoot_dprintf ("atkeyb", "num_lock = %d\n", !!(at_keyboard_status & VasEBoot_KEYBOARD_STATUS_NUM_LOCK)); #endif - return GRUB_TERM_NO_KEY; - case GRUB_KEYBOARD_KEY_SCROLL_LOCK: - at_keyboard_status ^= GRUB_TERM_STATUS_SCROLL; + return VasEBoot_TERM_NO_KEY; + case VasEBoot_KEYBOARD_KEY_SCROLL_LOCK: + at_keyboard_status ^= VasEBoot_TERM_STATUS_SCROLL; led_status ^= KEYBOARD_LED_SCROLL; keyboard_controller_led (led_status); - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; default: - return grub_term_map_key (code, at_keyboard_status); + return VasEBoot_term_map_key (code, at_keyboard_status); } } static void -grub_keyboard_controller_init (void) +VasEBoot_keyboard_controller_init (void) { at_keyboard_status = 0; /* Drain input buffer. */ while (1) { keyboard_controller_wait_until_ready (); - if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) + if (! KEYBOARD_ISREADY (VasEBoot_inb (KEYBOARD_REG_STATUS))) break; keyboard_controller_wait_until_ready (); - grub_inb (KEYBOARD_REG_DATA); + VasEBoot_inb (KEYBOARD_REG_DATA); } -#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) - grub_keyboard_controller_orig = 0; - grub_keyboard_orig_set = 2; -#elif defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_COREBOOT) +#if defined (VasEBoot_MACHINE_MIPS_LOONGSON) || defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) + VasEBoot_keyboard_controller_orig = 0; + VasEBoot_keyboard_orig_set = 2; +#elif defined (VasEBoot_MACHINE_QEMU) || defined (VasEBoot_MACHINE_COREBOOT) /* *BSD relies on those settings. */ - grub_keyboard_controller_orig = KEYBOARD_AT_TRANSLATE; - grub_keyboard_orig_set = 2; + VasEBoot_keyboard_controller_orig = KEYBOARD_AT_TRANSLATE; + VasEBoot_keyboard_orig_set = 2; #else - grub_keyboard_controller_orig = grub_keyboard_controller_read (); - grub_keyboard_orig_set = query_mode (); + VasEBoot_keyboard_controller_orig = VasEBoot_keyboard_controller_read (); + VasEBoot_keyboard_orig_set = query_mode (); #endif set_scancodes (); keyboard_controller_led (led_status); } -static grub_err_t -grub_keyboard_controller_fini (struct grub_term_input *term __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_keyboard_controller_fini (struct VasEBoot_term_input *term __attribute__ ((unused))) { if (current_set == 0) - return GRUB_ERR_NONE; - if (grub_keyboard_orig_set) - write_mode (grub_keyboard_orig_set); - grub_keyboard_controller_write (grub_keyboard_controller_orig); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; + if (VasEBoot_keyboard_orig_set) + write_mode (VasEBoot_keyboard_orig_set); + VasEBoot_keyboard_controller_write (VasEBoot_keyboard_controller_orig); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_at_fini_hw (int noreturn __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_at_fini_hw (int noreturn __attribute__ ((unused))) { - return grub_keyboard_controller_fini (NULL); + return VasEBoot_keyboard_controller_fini (NULL); } -static grub_err_t -grub_at_restore_hw (void) +static VasEBoot_err_t +VasEBoot_at_restore_hw (void) { if (current_set == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; /* Drain input buffer. */ while (1) { keyboard_controller_wait_until_ready (); - if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) + if (! KEYBOARD_ISREADY (VasEBoot_inb (KEYBOARD_REG_STATUS))) break; keyboard_controller_wait_until_ready (); - grub_inb (KEYBOARD_REG_DATA); + VasEBoot_inb (KEYBOARD_REG_DATA); } set_scancodes (); keyboard_controller_led (led_status); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_term_input grub_at_keyboard_term = +static struct VasEBoot_term_input VasEBoot_at_keyboard_term = { .name = "at_keyboard", - .fini = grub_keyboard_controller_fini, - .getkey = grub_at_keyboard_getkey + .fini = VasEBoot_keyboard_controller_fini, + .getkey = VasEBoot_at_keyboard_getkey }; -GRUB_MOD_INIT(at_keyboard) +VasEBoot_MOD_INIT(at_keyboard) { - grub_term_register_input ("at_keyboard", &grub_at_keyboard_term); - grub_loader_register_preboot_hook (grub_at_fini_hw, grub_at_restore_hw, - GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE); + VasEBoot_term_register_input ("at_keyboard", &VasEBoot_at_keyboard_term); + VasEBoot_loader_register_preboot_hook (VasEBoot_at_fini_hw, VasEBoot_at_restore_hw, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_CONSOLE); } -GRUB_MOD_FINI(at_keyboard) +VasEBoot_MOD_FINI(at_keyboard) { - grub_keyboard_controller_fini (NULL); - grub_term_unregister_input (&grub_at_keyboard_term); + VasEBoot_keyboard_controller_fini (NULL); + VasEBoot_term_unregister_input (&VasEBoot_at_keyboard_term); } diff --git a/VasEBoot-core/term/efi/console.c b/VasEBoot-core/term/efi/console.c index 7d31095b1..1e45e852c 100644 --- a/VasEBoot-core/term/efi/console.c +++ b/VasEBoot-core/term/efi/console.c @@ -1,64 +1,64 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -static grub_uint32_t -map_char (grub_uint32_t c) +static VasEBoot_uint32_t +map_char (VasEBoot_uint32_t c) { /* Map some unicode characters to the EFI character. */ switch (c) { - case GRUB_UNICODE_LEFTARROW: - c = GRUB_UNICODE_BLACK_LEFT_TRIANGLE; + case VasEBoot_UNICODE_LEFTARROW: + c = VasEBoot_UNICODE_BLACK_LEFT_TRIANGLE; break; - case GRUB_UNICODE_UPARROW: - c = GRUB_UNICODE_BLACK_UP_TRIANGLE; + case VasEBoot_UNICODE_UPARROW: + c = VasEBoot_UNICODE_BLACK_UP_TRIANGLE; break; - case GRUB_UNICODE_RIGHTARROW: - c = GRUB_UNICODE_BLACK_RIGHT_TRIANGLE; + case VasEBoot_UNICODE_RIGHTARROW: + c = VasEBoot_UNICODE_BLACK_RIGHT_TRIANGLE; break; - case GRUB_UNICODE_DOWNARROW: - c = GRUB_UNICODE_BLACK_DOWN_TRIANGLE; + case VasEBoot_UNICODE_DOWNARROW: + c = VasEBoot_UNICODE_BLACK_DOWN_TRIANGLE; break; - case GRUB_UNICODE_HLINE: - c = GRUB_UNICODE_LIGHT_HLINE; + case VasEBoot_UNICODE_HLINE: + c = VasEBoot_UNICODE_LIGHT_HLINE; break; - case GRUB_UNICODE_VLINE: - c = GRUB_UNICODE_LIGHT_VLINE; + case VasEBoot_UNICODE_VLINE: + c = VasEBoot_UNICODE_LIGHT_VLINE; break; - case GRUB_UNICODE_CORNER_UL: - c = GRUB_UNICODE_LIGHT_CORNER_UL; + case VasEBoot_UNICODE_CORNER_UL: + c = VasEBoot_UNICODE_LIGHT_CORNER_UL; break; - case GRUB_UNICODE_CORNER_UR: - c = GRUB_UNICODE_LIGHT_CORNER_UR; + case VasEBoot_UNICODE_CORNER_UR: + c = VasEBoot_UNICODE_LIGHT_CORNER_UR; break; - case GRUB_UNICODE_CORNER_LL: - c = GRUB_UNICODE_LIGHT_CORNER_LL; + case VasEBoot_UNICODE_CORNER_LL: + c = VasEBoot_UNICODE_LIGHT_CORNER_LL; break; - case GRUB_UNICODE_CORNER_LR: - c = GRUB_UNICODE_LIGHT_CORNER_LR; + case VasEBoot_UNICODE_CORNER_LR: + c = VasEBoot_UNICODE_LIGHT_CORNER_LR; break; } @@ -66,32 +66,32 @@ map_char (grub_uint32_t c) } static void -grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c) +VasEBoot_console_putchar (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c) { - grub_efi_char16_t str[2 + 30]; - grub_efi_simple_text_output_interface_t *o; + VasEBoot_efi_char16_t str[2 + 30]; + VasEBoot_efi_simple_text_output_interface_t *o; unsigned i, j; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return; - o = grub_efi_system_table->con_out; + o = VasEBoot_efi_system_table->con_out; /* For now, do not try to use a surrogate pair. */ if (c->base > 0xffff) str[0] = '?'; else - str[0] = (grub_efi_char16_t) map_char (c->base & 0xffff); + str[0] = (VasEBoot_efi_char16_t) map_char (c->base & 0xffff); j = 1; for (i = 0; i < c->ncomb && j + 1 < ARRAY_SIZE (str); i++) if (c->base < 0xffff) - str[j++] = grub_unicode_get_comb (c)[i].code; + str[j++] = VasEBoot_unicode_get_comb (c)[i].code; str[j] = 0; /* Should this test be cached? */ if ((c->base > 0x7f || c->ncomb) - && efi_call_2 (o->test_string, o, str) != GRUB_EFI_SUCCESS) + && efi_call_2 (o->test_string, o, str) != VasEBoot_EFI_SUCCESS) return; efi_call_2 (o->output_string, o, str); @@ -99,16 +99,16 @@ grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), const unsigned efi_codes[] = { - 0, GRUB_TERM_KEY_UP, GRUB_TERM_KEY_DOWN, GRUB_TERM_KEY_RIGHT, - GRUB_TERM_KEY_LEFT, GRUB_TERM_KEY_HOME, GRUB_TERM_KEY_END, GRUB_TERM_KEY_INSERT, - GRUB_TERM_KEY_DC, GRUB_TERM_KEY_PPAGE, GRUB_TERM_KEY_NPAGE, GRUB_TERM_KEY_F1, - GRUB_TERM_KEY_F2, GRUB_TERM_KEY_F3, GRUB_TERM_KEY_F4, GRUB_TERM_KEY_F5, - GRUB_TERM_KEY_F6, GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, GRUB_TERM_KEY_F9, - GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F11, GRUB_TERM_KEY_F12, '\e' + 0, VasEBoot_TERM_KEY_UP, VasEBoot_TERM_KEY_DOWN, VasEBoot_TERM_KEY_RIGHT, + VasEBoot_TERM_KEY_LEFT, VasEBoot_TERM_KEY_HOME, VasEBoot_TERM_KEY_END, VasEBoot_TERM_KEY_INSERT, + VasEBoot_TERM_KEY_DC, VasEBoot_TERM_KEY_PPAGE, VasEBoot_TERM_KEY_NPAGE, VasEBoot_TERM_KEY_F1, + VasEBoot_TERM_KEY_F2, VasEBoot_TERM_KEY_F3, VasEBoot_TERM_KEY_F4, VasEBoot_TERM_KEY_F5, + VasEBoot_TERM_KEY_F6, VasEBoot_TERM_KEY_F7, VasEBoot_TERM_KEY_F8, VasEBoot_TERM_KEY_F9, + VasEBoot_TERM_KEY_F10, VasEBoot_TERM_KEY_F11, VasEBoot_TERM_KEY_F12, '\e' }; static int -grub_efi_translate_key (grub_efi_input_key_t key) +VasEBoot_efi_translate_key (VasEBoot_efi_input_key_t key) { if (key.scan_code == 0) { @@ -118,7 +118,7 @@ grub_efi_translate_key (grub_efi_input_key_t key) if (key.unicode_char < 0x20 && key.unicode_char != 0 && key.unicode_char != '\t' && key.unicode_char != '\b' && key.unicode_char != '\n' && key.unicode_char != '\r') - return GRUB_TERM_CTRL | (key.unicode_char - 1 + 'a'); + return VasEBoot_TERM_CTRL | (key.unicode_char - 1 + 'a'); else return key.unicode_char; } @@ -130,176 +130,176 @@ grub_efi_translate_key (grub_efi_input_key_t key) || key.unicode_char == '\n' || key.unicode_char == '\r') return key.unicode_char; - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; } static int -grub_console_getkey_con (struct grub_term_input *term __attribute__ ((unused))) +VasEBoot_console_getkey_con (struct VasEBoot_term_input *term __attribute__ ((unused))) { - grub_efi_simple_input_interface_t *i; - grub_efi_input_key_t key; - grub_efi_status_t status; + VasEBoot_efi_simple_input_interface_t *i; + VasEBoot_efi_input_key_t key; + VasEBoot_efi_status_t status; - i = grub_efi_system_table->con_in; + i = VasEBoot_efi_system_table->con_in; status = efi_call_2 (i->read_key_stroke, i, &key); - if (status != GRUB_EFI_SUCCESS) - return GRUB_TERM_NO_KEY; + if (status != VasEBoot_EFI_SUCCESS) + return VasEBoot_TERM_NO_KEY; - return grub_efi_translate_key(key); + return VasEBoot_efi_translate_key(key); } static int -grub_console_getkey_ex(struct grub_term_input *term) +VasEBoot_console_getkey_ex(struct VasEBoot_term_input *term) { - grub_efi_key_data_t key_data; - grub_efi_status_t status; - grub_efi_uint32_t kss; + VasEBoot_efi_key_data_t key_data; + VasEBoot_efi_status_t status; + VasEBoot_efi_uint32_t kss; int key = -1; - grub_efi_simple_text_input_ex_interface_t *text_input = term->data; + VasEBoot_efi_simple_text_input_ex_interface_t *text_input = term->data; status = efi_call_2 (text_input->read_key_stroke, text_input, &key_data); - if (status != GRUB_EFI_SUCCESS) - return GRUB_TERM_NO_KEY; + if (status != VasEBoot_EFI_SUCCESS) + return VasEBoot_TERM_NO_KEY; kss = key_data.key_state.key_shift_state; - key = grub_efi_translate_key(key_data.key); + key = VasEBoot_efi_translate_key(key_data.key); - if (key == GRUB_TERM_NO_KEY) - return GRUB_TERM_NO_KEY; + if (key == VasEBoot_TERM_NO_KEY) + return VasEBoot_TERM_NO_KEY; - if (kss & GRUB_EFI_SHIFT_STATE_VALID) + if (kss & VasEBoot_EFI_SHIFT_STATE_VALID) { - if ((kss & GRUB_EFI_LEFT_SHIFT_PRESSED - || kss & GRUB_EFI_RIGHT_SHIFT_PRESSED) - && (key & GRUB_TERM_EXTENDED)) - key |= GRUB_TERM_SHIFT; - if (kss & GRUB_EFI_LEFT_ALT_PRESSED || kss & GRUB_EFI_RIGHT_ALT_PRESSED) - key |= GRUB_TERM_ALT; - if (kss & GRUB_EFI_LEFT_CONTROL_PRESSED - || kss & GRUB_EFI_RIGHT_CONTROL_PRESSED) - key |= GRUB_TERM_CTRL; + if ((kss & VasEBoot_EFI_LEFT_SHIFT_PRESSED + || kss & VasEBoot_EFI_RIGHT_SHIFT_PRESSED) + && (key & VasEBoot_TERM_EXTENDED)) + key |= VasEBoot_TERM_SHIFT; + if (kss & VasEBoot_EFI_LEFT_ALT_PRESSED || kss & VasEBoot_EFI_RIGHT_ALT_PRESSED) + key |= VasEBoot_TERM_ALT; + if (kss & VasEBoot_EFI_LEFT_CONTROL_PRESSED + || kss & VasEBoot_EFI_RIGHT_CONTROL_PRESSED) + key |= VasEBoot_TERM_CTRL; } return key; } -static grub_err_t -grub_efi_console_input_init (struct grub_term_input *term) +static VasEBoot_err_t +VasEBoot_efi_console_input_init (struct VasEBoot_term_input *term) { - grub_efi_guid_t text_input_ex_guid = - GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; + VasEBoot_efi_guid_t text_input_ex_guid = + VasEBoot_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return 0; - grub_efi_simple_text_input_ex_interface_t *text_input = term->data; + VasEBoot_efi_simple_text_input_ex_interface_t *text_input = term->data; if (text_input) return 0; - text_input = grub_efi_open_protocol(grub_efi_system_table->console_in_handler, + text_input = VasEBoot_efi_open_protocol(VasEBoot_efi_system_table->console_in_handler, &text_input_ex_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); term->data = (void *)text_input; return 0; } static int -grub_console_getkey (struct grub_term_input *term) +VasEBoot_console_getkey (struct VasEBoot_term_input *term) { - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return 0; if (term->data) - return grub_console_getkey_ex(term); + return VasEBoot_console_getkey_ex(term); else - return grub_console_getkey_con(term); + return VasEBoot_console_getkey_con(term); } -static struct grub_term_coordinate -grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_console_getwh (struct VasEBoot_term_output *term __attribute__ ((unused))) { - grub_efi_simple_text_output_interface_t *o; - grub_efi_uintn_t columns, rows; + VasEBoot_efi_simple_text_output_interface_t *o; + VasEBoot_efi_uintn_t columns, rows; - o = grub_efi_system_table->con_out; - if (grub_efi_is_finished || efi_call_4 (o->query_mode, o, o->mode->mode, - &columns, &rows) != GRUB_EFI_SUCCESS) + o = VasEBoot_efi_system_table->con_out; + if (VasEBoot_efi_is_finished || efi_call_4 (o->query_mode, o, o->mode->mode, + &columns, &rows) != VasEBoot_EFI_SUCCESS) { /* Why does this fail? */ columns = 80; rows = 25; } - return (struct grub_term_coordinate) { columns, rows }; + return (struct VasEBoot_term_coordinate) { columns, rows }; } -static struct grub_term_coordinate -grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_console_getxy (struct VasEBoot_term_output *term __attribute__ ((unused))) { - grub_efi_simple_text_output_interface_t *o; + VasEBoot_efi_simple_text_output_interface_t *o; - if (grub_efi_is_finished) - return (struct grub_term_coordinate) { 0, 0 }; + if (VasEBoot_efi_is_finished) + return (struct VasEBoot_term_coordinate) { 0, 0 }; - o = grub_efi_system_table->con_out; - return (struct grub_term_coordinate) { o->mode->cursor_column, o->mode->cursor_row }; + o = VasEBoot_efi_system_table->con_out; + return (struct VasEBoot_term_coordinate) { o->mode->cursor_column, o->mode->cursor_row }; } static void -grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), - struct grub_term_coordinate pos) +VasEBoot_console_gotoxy (struct VasEBoot_term_output *term __attribute__ ((unused)), + struct VasEBoot_term_coordinate pos) { - grub_efi_simple_text_output_interface_t *o; + VasEBoot_efi_simple_text_output_interface_t *o; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return; - o = grub_efi_system_table->con_out; + o = VasEBoot_efi_system_table->con_out; efi_call_3 (o->set_cursor_position, o, pos.x, pos.y); } static void -grub_console_cls (struct grub_term_output *term __attribute__ ((unused))) +VasEBoot_console_cls (struct VasEBoot_term_output *term __attribute__ ((unused))) { - grub_efi_simple_text_output_interface_t *o; - grub_efi_int32_t orig_attr; + VasEBoot_efi_simple_text_output_interface_t *o; + VasEBoot_efi_int32_t orig_attr; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return; - o = grub_efi_system_table->con_out; + o = VasEBoot_efi_system_table->con_out; orig_attr = o->mode->attribute; - efi_call_2 (o->set_attributes, o, GRUB_EFI_BACKGROUND_BLACK); + efi_call_2 (o->set_attributes, o, VasEBoot_EFI_BACKGROUND_BLACK); efi_call_1 (o->clear_screen, o); efi_call_2 (o->set_attributes, o, orig_attr); } static void -grub_console_setcolorstate (struct grub_term_output *term +VasEBoot_console_setcolorstate (struct VasEBoot_term_output *term __attribute__ ((unused)), - grub_term_color_state state) + VasEBoot_term_color_state state) { - grub_efi_simple_text_output_interface_t *o; + VasEBoot_efi_simple_text_output_interface_t *o; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return; - o = grub_efi_system_table->con_out; + o = VasEBoot_efi_system_table->con_out; switch (state) { - case GRUB_TERM_COLOR_STANDARD: - efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR + case VasEBoot_TERM_COLOR_STANDARD: + efi_call_2 (o->set_attributes, o, VasEBoot_TERM_DEFAULT_STANDARD_COLOR & 0x7f); break; - case GRUB_TERM_COLOR_NORMAL: - efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f); + case VasEBoot_TERM_COLOR_NORMAL: + efi_call_2 (o->set_attributes, o, VasEBoot_term_normal_color & 0x7f); break; - case GRUB_TERM_COLOR_HIGHLIGHT: - efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f); + case VasEBoot_TERM_COLOR_HIGHLIGHT: + efi_call_2 (o->set_attributes, o, VasEBoot_term_highlight_color & 0x7f); break; default: break; @@ -307,75 +307,75 @@ grub_console_setcolorstate (struct grub_term_output *term } static void -grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), +VasEBoot_console_setcursor (struct VasEBoot_term_output *term __attribute__ ((unused)), int on) { - grub_efi_simple_text_output_interface_t *o; + VasEBoot_efi_simple_text_output_interface_t *o; - if (grub_efi_is_finished) + if (VasEBoot_efi_is_finished) return; - o = grub_efi_system_table->con_out; + o = VasEBoot_efi_system_table->con_out; efi_call_2 (o->enable_cursor, o, on); } -static grub_err_t -grub_efi_console_output_init (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_efi_console_output_init (struct VasEBoot_term_output *term) { - grub_efi_set_text_mode (1); - grub_console_setcursor (term, 1); + VasEBoot_efi_set_text_mode (1); + VasEBoot_console_setcursor (term, 1); return 0; } -static grub_err_t -grub_efi_console_output_fini (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_efi_console_output_fini (struct VasEBoot_term_output *term) { - grub_console_setcursor (term, 0); - grub_efi_set_text_mode (0); + VasEBoot_console_setcursor (term, 0); + VasEBoot_efi_set_text_mode (0); return 0; } -static struct grub_term_input grub_console_term_input = +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", - .getkey = grub_console_getkey, - .init = grub_efi_console_input_init, + .getkey = VasEBoot_console_getkey, + .init = VasEBoot_efi_console_input_init, }; -static struct grub_term_output grub_console_term_output = +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", - .init = grub_efi_console_output_init, - .fini = grub_efi_console_output_fini, - .putchar = grub_console_putchar, - .getwh = grub_console_getwh, - .getxy = grub_console_getxy, - .gotoxy = grub_console_gotoxy, - .cls = grub_console_cls, - .setcolorstate = grub_console_setcolorstate, - .setcursor = grub_console_setcursor, - .flags = GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS, - .progress_update_divisor = GRUB_PROGRESS_FAST + .init = VasEBoot_efi_console_output_init, + .fini = VasEBoot_efi_console_output_fini, + .putchar = VasEBoot_console_putchar, + .getwh = VasEBoot_console_getwh, + .getxy = VasEBoot_console_getxy, + .gotoxy = VasEBoot_console_gotoxy, + .cls = VasEBoot_console_cls, + .setcolorstate = VasEBoot_console_setcolorstate, + .setcursor = VasEBoot_console_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init (void) +VasEBoot_console_init (void) { /* FIXME: it is necessary to consider the case where no console control is present but the default is already in text mode. */ - if (! grub_efi_set_text_mode (1)) + if (! VasEBoot_efi_set_text_mode (1)) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot set text mode"); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot set text mode"); return; } - grub_term_register_output ("console", &grub_console_term_output); - grub_term_register_input ("console", &grub_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); } void -grub_console_fini (void) +VasEBoot_console_fini (void) { - grub_term_unregister_input (&grub_console_term_input); - grub_term_unregister_output (&grub_console_term_output); + VasEBoot_term_unregister_input (&VasEBoot_console_term_input); + VasEBoot_term_unregister_output (&VasEBoot_console_term_output); } diff --git a/VasEBoot-core/term/efi/serial.c b/VasEBoot-core/term/efi/serial.c index 4c94723c5..0e02b5c35 100644 --- a/VasEBoot-core/term/efi/serial.c +++ b/VasEBoot-core/term/efi/serial.c @@ -1,51 +1,51 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* GUID. */ -static grub_efi_guid_t serial_io_guid = GRUB_EFI_SERIAL_IO_GUID; +static VasEBoot_efi_guid_t serial_io_guid = VasEBoot_EFI_SERIAL_IO_GUID; static void -do_real_config (struct grub_serial_port *port) +do_real_config (struct VasEBoot_serial_port *port) { - grub_efi_status_t status = GRUB_EFI_SUCCESS; - const grub_efi_parity_type_t parities[] = { - [GRUB_SERIAL_PARITY_NONE] = GRUB_EFI_SERIAL_NO_PARITY, - [GRUB_SERIAL_PARITY_ODD] = GRUB_EFI_SERIAL_ODD_PARITY, - [GRUB_SERIAL_PARITY_EVEN] = GRUB_EFI_SERIAL_EVEN_PARITY + VasEBoot_efi_status_t status = VasEBoot_EFI_SUCCESS; + const VasEBoot_efi_parity_type_t parities[] = { + [VasEBoot_SERIAL_PARITY_NONE] = VasEBoot_EFI_SERIAL_NO_PARITY, + [VasEBoot_SERIAL_PARITY_ODD] = VasEBoot_EFI_SERIAL_ODD_PARITY, + [VasEBoot_SERIAL_PARITY_EVEN] = VasEBoot_EFI_SERIAL_EVEN_PARITY }; - const grub_efi_stop_bits_t stop_bits[] = { - [GRUB_SERIAL_STOP_BITS_1] = GRUB_EFI_SERIAL_1_STOP_BIT, - [GRUB_SERIAL_STOP_BITS_1_5] = GRUB_EFI_SERIAL_1_5_STOP_BITS, - [GRUB_SERIAL_STOP_BITS_2] = GRUB_EFI_SERIAL_2_STOP_BITS, + const VasEBoot_efi_stop_bits_t stop_bits[] = { + [VasEBoot_SERIAL_STOP_BITS_1] = VasEBoot_EFI_SERIAL_1_STOP_BIT, + [VasEBoot_SERIAL_STOP_BITS_1_5] = VasEBoot_EFI_SERIAL_1_5_STOP_BITS, + [VasEBoot_SERIAL_STOP_BITS_2] = VasEBoot_EFI_SERIAL_2_STOP_BITS, }; if (port->configured) @@ -56,7 +56,7 @@ do_real_config (struct grub_serial_port *port) 0, 0, parities[port->config.parity], port->config.word_len, stop_bits[port->config.stop_bits]); - if (status != GRUB_EFI_SUCCESS) + if (status != VasEBoot_EFI_SUCCESS) port->broken = 1; status = efi_call_2 (port->interface->set_control_bits, port->interface, @@ -67,17 +67,17 @@ do_real_config (struct grub_serial_port *port) /* Fetch a key. */ static int -serial_hw_fetch (struct grub_serial_port *port) +serial_hw_fetch (struct VasEBoot_serial_port *port) { - grub_efi_uintn_t bufsize = 1; + VasEBoot_efi_uintn_t bufsize = 1; char c; - grub_efi_status_t status = GRUB_EFI_SUCCESS; + VasEBoot_efi_status_t status = VasEBoot_EFI_SUCCESS; do_real_config (port); if (port->broken) return -1; status = efi_call_3 (port->interface->read, port->interface, &bufsize, &c); - if (status != GRUB_EFI_SUCCESS || bufsize == 0) + if (status != VasEBoot_EFI_SUCCESS || bufsize == 0) return -1; return c; @@ -85,9 +85,9 @@ serial_hw_fetch (struct grub_serial_port *port) /* Put a character. */ static void -serial_hw_put (struct grub_serial_port *port, const int c) +serial_hw_put (struct VasEBoot_serial_port *port, const int c) { - grub_efi_uintn_t bufsize = 1; + VasEBoot_efi_uintn_t bufsize = 1; char c0 = c; do_real_config (port); @@ -105,24 +105,24 @@ serial_hw_put (struct grub_serial_port *port, const int c) STOP_BIT_LEN is the length of the stop bit. The possible values for WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as macros. */ -static grub_err_t -serial_hw_configure (struct grub_serial_port *port, - struct grub_serial_config *config) +static VasEBoot_err_t +serial_hw_configure (struct VasEBoot_serial_port *port, + struct VasEBoot_serial_config *config) { - if (config->parity != GRUB_SERIAL_PARITY_NONE - && config->parity != GRUB_SERIAL_PARITY_ODD - && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->parity != VasEBoot_SERIAL_PARITY_NONE + && config->parity != VasEBoot_SERIAL_PARITY_ODD + && config->parity != VasEBoot_SERIAL_PARITY_EVEN) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); - if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_1_5 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1_5 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_2) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port word length")); port->config = *config; @@ -130,10 +130,10 @@ serial_hw_configure (struct grub_serial_port *port, /* FIXME: should check if the serial terminal was found. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_serial_driver grub_efiserial_driver = +struct VasEBoot_serial_driver VasEBoot_efiserial_driver = { .configure = serial_hw_configure, .fetch = serial_hw_fetch, @@ -141,16 +141,16 @@ struct grub_serial_driver grub_efiserial_driver = }; void -grub_efiserial_init (void) +VasEBoot_efiserial_init (void) { - grub_efi_uintn_t num_handles; - grub_efi_handle_t *handles; - grub_efi_handle_t *handle; + VasEBoot_efi_uintn_t num_handles; + VasEBoot_efi_handle_t *handles; + VasEBoot_efi_handle_t *handle; int num_serial = 0; - grub_err_t err; + VasEBoot_err_t err; /* Find handles which support the disk io interface. */ - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &serial_io_guid, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_BY_PROTOCOL, &serial_io_guid, 0, &num_handles); if (! handles) return; @@ -158,38 +158,38 @@ grub_efiserial_init (void) /* Make a linked list of devices. */ for (handle = handles; num_handles--; handle++) { - struct grub_serial_port *port; - struct grub_efi_serial_io_interface *sio; + struct VasEBoot_serial_port *port; + struct VasEBoot_efi_serial_io_interface *sio; - sio = grub_efi_open_protocol (*handle, &serial_io_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + sio = VasEBoot_efi_open_protocol (*handle, &serial_io_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (! sio) /* This should not happen... Why? */ continue; - port = grub_zalloc (sizeof (*port)); + port = VasEBoot_zalloc (sizeof (*port)); if (!port) return; - port->name = grub_malloc (sizeof ("efiXXXXXXXXXXXXXXXXXXXX")); + port->name = VasEBoot_malloc (sizeof ("efiXXXXXXXXXXXXXXXXXXXX")); if (!port->name) { - grub_free (port); + VasEBoot_free (port); return; } - grub_snprintf (port->name, sizeof ("efiXXXXXXXXXXXXXXXXXXXX"), + VasEBoot_snprintf (port->name, sizeof ("efiXXXXXXXXXXXXXXXXXXXX"), "efi%d", num_serial++); - port->driver = &grub_efiserial_driver; + port->driver = &VasEBoot_efiserial_driver; port->interface = sio; - err = grub_serial_config_defaults (port); + err = VasEBoot_serial_config_defaults (port); if (err) - grub_print_error (); + VasEBoot_print_error (); - grub_serial_register (port); + VasEBoot_serial_register (port); } - grub_free (handles); + VasEBoot_free (handles); return; } diff --git a/VasEBoot-core/term/gfxterm.c b/VasEBoot-core/term/gfxterm.c index af7c090a3..7de88509b 100644 --- a/VasEBoot-core/term/gfxterm.c +++ b/VasEBoot-core/term/gfxterm.c @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define DEFAULT_VIDEO_MODE "auto" #define DEFAULT_BORDER_WIDTH 10 #define DEFAULT_STANDARD_COLOR 0x07 -struct grub_dirty_region +struct VasEBoot_dirty_region { int top_left_x; int top_left_y; @@ -45,17 +45,17 @@ struct grub_dirty_region int bottom_right_y; }; -struct grub_colored_char +struct VasEBoot_colored_char { /* An Unicode codepoint. */ - struct grub_unicode_glyph code; + struct VasEBoot_unicode_glyph code; /* Color values. */ - grub_video_color_t fg_color; - grub_video_color_t bg_color; + VasEBoot_video_color_t fg_color; + VasEBoot_video_color_t bg_color; }; -struct grub_virtual_screen +struct VasEBoot_virtual_screen { /* Dimensions of the virtual screen in pixels. */ unsigned int width; @@ -81,27 +81,27 @@ struct grub_virtual_screen int cursor_state; /* Font settings. */ - grub_font_t font; + VasEBoot_font_t font; /* Terminal color settings. */ - grub_uint8_t standard_color_setting; - grub_uint8_t term_color; + VasEBoot_uint8_t standard_color_setting; + VasEBoot_uint8_t term_color; /* Color settings. */ - grub_video_color_t fg_color; - grub_video_color_t bg_color; - grub_video_color_t bg_color_display; + VasEBoot_video_color_t fg_color; + VasEBoot_video_color_t bg_color; + VasEBoot_video_color_t bg_color_display; /* Text buffer for virtual screen. Contains (columns * rows) number of entries. */ - struct grub_colored_char *text_buffer; + struct VasEBoot_colored_char *text_buffer; int total_scroll; int functional; }; -struct grub_gfxterm_window +struct VasEBoot_gfxterm_window { unsigned x; unsigned y; @@ -110,20 +110,20 @@ struct grub_gfxterm_window int double_repaint; }; -static struct grub_video_render_target *render_target; -void (*grub_gfxterm_decorator_hook) (void) = NULL; -static struct grub_gfxterm_window window; -static struct grub_virtual_screen virtual_screen; +static struct VasEBoot_video_render_target *render_target; +void (*VasEBoot_gfxterm_decorator_hook) (void) = NULL; +static struct VasEBoot_gfxterm_window window; +static struct VasEBoot_virtual_screen virtual_screen; static int repaint_scheduled = 0; static int repaint_was_scheduled = 0; static void destroy_window (void); -static struct grub_video_render_target *text_layer; +static struct VasEBoot_video_render_target *text_layer; -struct grub_gfxterm_background grub_gfxterm_background; +struct VasEBoot_gfxterm_background VasEBoot_gfxterm_background; -static struct grub_dirty_region dirty_region; +static struct VasEBoot_dirty_region dirty_region; static void dirty_region_reset (void); @@ -132,53 +132,53 @@ static int dirty_region_is_empty (void); static void dirty_region_add (int x, int y, unsigned int width, unsigned int height); -static unsigned int calculate_normal_character_width (grub_font_t font); +static unsigned int calculate_normal_character_width (VasEBoot_font_t font); -static unsigned char calculate_character_width (struct grub_font_glyph *glyph); +static unsigned char calculate_character_width (struct VasEBoot_font_glyph *glyph); -static void grub_gfxterm_refresh (struct grub_term_output *term __attribute__ ((unused))); +static void VasEBoot_gfxterm_refresh (struct VasEBoot_term_output *term __attribute__ ((unused))); -static grub_size_t -grub_gfxterm_getcharwidth (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c); +static VasEBoot_size_t +VasEBoot_gfxterm_getcharwidth (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c); static void -set_term_color (grub_uint8_t term_color) +set_term_color (VasEBoot_uint8_t term_color) { - struct grub_video_render_target *old_target; + struct VasEBoot_video_render_target *old_target; /* Save previous target and switch to text layer. */ - grub_video_get_active_render_target (&old_target); - grub_video_set_active_render_target (text_layer); + VasEBoot_video_get_active_render_target (&old_target); + VasEBoot_video_set_active_render_target (text_layer); /* Map terminal color to text layer compatible video colors. */ - virtual_screen.fg_color = grub_video_map_color(term_color & 0x0f); + virtual_screen.fg_color = VasEBoot_video_map_color(term_color & 0x0f); /* Special case: use black as transparent color. */ if (((term_color >> 4) & 0x0f) == 0) { - virtual_screen.bg_color = grub_video_map_rgba(0, 0, 0, 0); + virtual_screen.bg_color = VasEBoot_video_map_rgba(0, 0, 0, 0); } else { - virtual_screen.bg_color = grub_video_map_color((term_color >> 4) & 0x0f); + virtual_screen.bg_color = VasEBoot_video_map_color((term_color >> 4) & 0x0f); } /* Restore previous target. */ - grub_video_set_active_render_target (old_target); + VasEBoot_video_set_active_render_target (old_target); } static void -clear_char (struct grub_colored_char *c) +clear_char (struct VasEBoot_colored_char *c) { - grub_unicode_destroy_glyph (&c->code); - grub_unicode_set_glyph_from_code (&c->code, ' '); + VasEBoot_unicode_destroy_glyph (&c->code); + VasEBoot_unicode_set_glyph_from_code (&c->code, ' '); c->fg_color = virtual_screen.fg_color; c->bg_color = virtual_screen.bg_color; } static void -grub_virtual_screen_free (void) +VasEBoot_virtual_screen_free (void) { virtual_screen.functional = 0; @@ -189,27 +189,27 @@ grub_virtual_screen_free (void) for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) - grub_unicode_destroy_glyph (&virtual_screen.text_buffer[i].code); - grub_free (virtual_screen.text_buffer); + VasEBoot_unicode_destroy_glyph (&virtual_screen.text_buffer[i].code); + VasEBoot_free (virtual_screen.text_buffer); } /* Reset virtual screen data. */ - grub_memset (&virtual_screen, 0, sizeof (virtual_screen)); + VasEBoot_memset (&virtual_screen, 0, sizeof (virtual_screen)); /* Free render targets. */ - grub_video_delete_render_target (text_layer); + VasEBoot_video_delete_render_target (text_layer); text_layer = 0; } -static grub_err_t -grub_virtual_screen_setup (unsigned int x, unsigned int y, +static VasEBoot_err_t +VasEBoot_virtual_screen_setup (unsigned int x, unsigned int y, unsigned int width, unsigned int height, - grub_font_t font) + VasEBoot_font_t font) { unsigned int i; /* Free old virtual screen. */ - grub_virtual_screen_free (); + VasEBoot_virtual_screen_free (); /* Initialize with default data. */ virtual_screen.font = font; @@ -220,7 +220,7 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, virtual_screen.normal_char_width = calculate_normal_character_width (virtual_screen.font); virtual_screen.normal_char_height = - grub_font_get_max_char_height (virtual_screen.font); + VasEBoot_font_get_max_char_height (virtual_screen.font); if (virtual_screen.normal_char_height == 0) virtual_screen.normal_char_height = 16; virtual_screen.cursor_x = 0; @@ -234,24 +234,24 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, /* Allocate memory for text buffer. */ virtual_screen.text_buffer = - (struct grub_colored_char *) grub_malloc (virtual_screen.columns + (struct VasEBoot_colored_char *) VasEBoot_malloc (virtual_screen.columns * virtual_screen.rows * sizeof (*virtual_screen.text_buffer)); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Create new render target for text layer. */ - grub_video_create_render_target (&text_layer, + VasEBoot_video_create_render_target (&text_layer, virtual_screen.width, virtual_screen.height, - GRUB_VIDEO_MODE_TYPE_INDEX_COLOR - | GRUB_VIDEO_MODE_TYPE_ALPHA); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR + | VasEBoot_VIDEO_MODE_TYPE_ALPHA); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* As we want to have colors compatible with rendering target, we can only have those after mode is initialized. */ - grub_video_set_active_render_target (text_layer); + VasEBoot_video_set_active_render_target (text_layer); virtual_screen.standard_color_setting = DEFAULT_STANDARD_COLOR; @@ -259,10 +259,10 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, set_term_color (virtual_screen.term_color); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); virtual_screen.bg_color_display = - grub_video_map_rgba_color (grub_gfxterm_background.default_bg_color); + VasEBoot_video_map_rgba_color (VasEBoot_gfxterm_background.default_bg_color); /* Clear out text buffer. */ for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) @@ -270,25 +270,25 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, virtual_screen.text_buffer[i].code.ncomb = 0; clear_char (&(virtual_screen.text_buffer[i])); } - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; virtual_screen.functional = 1; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_gfxterm_schedule_repaint (void) +VasEBoot_gfxterm_schedule_repaint (void) { repaint_scheduled = 1; } -grub_err_t -grub_gfxterm_set_window (struct grub_video_render_target *target, +VasEBoot_err_t +VasEBoot_gfxterm_set_window (struct VasEBoot_video_render_target *target, int x, int y, int width, int height, int double_repaint, - grub_font_t font, int border_width) + VasEBoot_font_t font, int border_width) { /* Clean up any prior instance. */ destroy_window (); @@ -297,13 +297,13 @@ grub_gfxterm_set_window (struct grub_video_render_target *target, render_target = target; /* Create virtual screen. */ - if (grub_virtual_screen_setup (border_width, border_width, + if (VasEBoot_virtual_screen_setup (border_width, border_width, width - 2 * border_width, height - 2 * border_width, font) - != GRUB_ERR_NONE) + != VasEBoot_ERR_NONE) { - return grub_errno; + return VasEBoot_errno; } /* Set window bounds. */ @@ -314,84 +314,84 @@ grub_gfxterm_set_window (struct grub_video_render_target *target, window.double_repaint = double_repaint; dirty_region_reset (); - grub_gfxterm_schedule_repaint (); + VasEBoot_gfxterm_schedule_repaint (); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_gfxterm_fullscreen (void) +static VasEBoot_err_t +VasEBoot_gfxterm_fullscreen (void) { const char *font_name; - struct grub_video_mode_info mode_info; - grub_video_color_t color; - grub_err_t err; + struct VasEBoot_video_mode_info mode_info; + VasEBoot_video_color_t color; + VasEBoot_err_t err; int double_redraw; - grub_font_t font; + VasEBoot_font_t font; - err = grub_video_get_info (&mode_info); + err = VasEBoot_video_get_info (&mode_info); /* Figure out what mode we ended up. */ if (err) return err; - grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); + VasEBoot_video_set_active_render_target (VasEBoot_VIDEO_RENDER_TARGET_DISPLAY); - double_redraw = mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - && !(mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + double_redraw = mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + && !(mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); /* Make sure screen is set to the default background color. */ - color = grub_video_map_rgba_color (grub_gfxterm_background.default_bg_color); - grub_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height); + color = VasEBoot_video_map_rgba_color (VasEBoot_gfxterm_background.default_bg_color); + VasEBoot_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height); if (double_redraw) { - grub_video_swap_buffers (); - grub_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height); + VasEBoot_video_swap_buffers (); + VasEBoot_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height); } /* Select the font to use. */ - font_name = grub_env_get ("gfxterm_font"); + font_name = VasEBoot_env_get ("gfxterm_font"); if (! font_name) font_name = ""; /* Allow fallback to any font. */ - font = grub_font_get (font_name); + font = VasEBoot_font_get (font_name); if (!font) - return grub_error (GRUB_ERR_BAD_FONT, "no font loaded"); + return VasEBoot_error (VasEBoot_ERR_BAD_FONT, "no font loaded"); - grub_gfxterm_decorator_hook = NULL; + VasEBoot_gfxterm_decorator_hook = NULL; - return grub_gfxterm_set_window (GRUB_VIDEO_RENDER_TARGET_DISPLAY, + return VasEBoot_gfxterm_set_window (VasEBoot_VIDEO_RENDER_TARGET_DISPLAY, 0, 0, mode_info.width, mode_info.height, double_redraw, font, DEFAULT_BORDER_WIDTH); } -static grub_err_t -grub_gfxterm_term_init (struct grub_term_output *term __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_gfxterm_term_init (struct VasEBoot_term_output *term __attribute__ ((unused))) { char *tmp; - grub_err_t err; + VasEBoot_err_t err; const char *modevar; /* Parse gfxmode environment variable if set. */ - modevar = grub_env_get ("gfxmode"); + modevar = VasEBoot_env_get ("gfxmode"); if (! modevar || *modevar == 0) - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, - GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); + err = VasEBoot_video_set_mode (DEFAULT_VIDEO_MODE, + VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT, 0); else { - tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); + tmp = VasEBoot_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); if (!tmp) - return grub_errno; - err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); - grub_free (tmp); + return VasEBoot_errno; + err = VasEBoot_video_set_mode (tmp, VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT, 0); + VasEBoot_free (tmp); } if (err) return err; - err = grub_gfxterm_fullscreen (); + err = VasEBoot_gfxterm_fullscreen (); if (err) - grub_video_restore (); + VasEBoot_video_restore (); return err; } @@ -399,48 +399,48 @@ grub_gfxterm_term_init (struct grub_term_output *term __attribute__ ((unused))) static void destroy_window (void) { - grub_virtual_screen_free (); + VasEBoot_virtual_screen_free (); } -static grub_err_t -grub_gfxterm_term_fini (struct grub_term_output *term __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_gfxterm_term_fini (struct VasEBoot_term_output *term __attribute__ ((unused))) { unsigned i; destroy_window (); - grub_video_restore (); + VasEBoot_video_restore (); for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) { - grub_unicode_destroy_glyph (&virtual_screen.text_buffer[i].code); + VasEBoot_unicode_destroy_glyph (&virtual_screen.text_buffer[i].code); virtual_screen.text_buffer[i].code.ncomb = 0; virtual_screen.text_buffer[i].code.base = 0; } /* Clear error state. */ - grub_errno = GRUB_ERR_NONE; - return GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; + return VasEBoot_ERR_NONE; } static void redraw_screen_rect (unsigned int x, unsigned int y, unsigned int width, unsigned int height) { - grub_video_color_t color; - grub_video_rect_t saved_view; + VasEBoot_video_color_t color; + VasEBoot_video_rect_t saved_view; - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); /* Save viewport and set it to our window. */ - grub_video_get_viewport ((unsigned *) &saved_view.x, + VasEBoot_video_get_viewport ((unsigned *) &saved_view.x, (unsigned *) &saved_view.y, (unsigned *) &saved_view.width, (unsigned *) &saved_view.height); - grub_video_set_viewport (window.x, window.y, window.width, window.height); + VasEBoot_video_set_viewport (window.x, window.y, window.width, window.height); - if (grub_gfxterm_background.bitmap) + if (VasEBoot_gfxterm_background.bitmap) { /* Render bitmap as background. */ - grub_video_blit_bitmap (grub_gfxterm_background.bitmap, - GRUB_VIDEO_BLIT_REPLACE, x, y, + VasEBoot_video_blit_bitmap (VasEBoot_gfxterm_background.bitmap, + VasEBoot_VIDEO_BLIT_REPLACE, x, y, x, y, width, height); @@ -449,66 +449,66 @@ redraw_screen_rect (unsigned int x, unsigned int y, color = virtual_screen.bg_color_display; /* Fill right side of the bitmap if needed. */ - if ((x + width >= grub_gfxterm_background.bitmap->mode_info.width) - && (y < grub_gfxterm_background.bitmap->mode_info.height)) + if ((x + width >= VasEBoot_gfxterm_background.bitmap->mode_info.width) + && (y < VasEBoot_gfxterm_background.bitmap->mode_info.height)) { - int w = (x + width) - grub_gfxterm_background.bitmap->mode_info.width; + int w = (x + width) - VasEBoot_gfxterm_background.bitmap->mode_info.width; int h = height; unsigned int tx = x; - if (y + height >= grub_gfxterm_background.bitmap->mode_info.height) + if (y + height >= VasEBoot_gfxterm_background.bitmap->mode_info.height) { - h = grub_gfxterm_background.bitmap->mode_info.height - y; + h = VasEBoot_gfxterm_background.bitmap->mode_info.height - y; } - if (grub_gfxterm_background.bitmap->mode_info.width > tx) + if (VasEBoot_gfxterm_background.bitmap->mode_info.width > tx) { - tx = grub_gfxterm_background.bitmap->mode_info.width; + tx = VasEBoot_gfxterm_background.bitmap->mode_info.width; } /* Render background layer. */ - grub_video_fill_rect (color, tx, y, w, h); + VasEBoot_video_fill_rect (color, tx, y, w, h); } /* Fill bottom side of the bitmap if needed. */ - if (y + height >= grub_gfxterm_background.bitmap->mode_info.height) + if (y + height >= VasEBoot_gfxterm_background.bitmap->mode_info.height) { - int h = (y + height) - grub_gfxterm_background.bitmap->mode_info.height; + int h = (y + height) - VasEBoot_gfxterm_background.bitmap->mode_info.height; unsigned int ty = y; - if (grub_gfxterm_background.bitmap->mode_info.height > ty) + if (VasEBoot_gfxterm_background.bitmap->mode_info.height > ty) { - ty = grub_gfxterm_background.bitmap->mode_info.height; + ty = VasEBoot_gfxterm_background.bitmap->mode_info.height; } /* Render background layer. */ - grub_video_fill_rect (color, x, ty, width, h); + VasEBoot_video_fill_rect (color, x, ty, width, h); } } else { /* Render background layer. */ color = virtual_screen.bg_color_display; - grub_video_fill_rect (color, x, y, width, height); + VasEBoot_video_fill_rect (color, x, y, width, height); } - if (grub_gfxterm_background.blend_text_bg) + if (VasEBoot_gfxterm_background.blend_text_bg) /* Render text layer as blended. */ - grub_video_blit_render_target (text_layer, GRUB_VIDEO_BLIT_BLEND, x, y, + VasEBoot_video_blit_render_target (text_layer, VasEBoot_VIDEO_BLIT_BLEND, x, y, x - virtual_screen.offset_x, y - virtual_screen.offset_y, width, height); else /* Render text layer as replaced (to get texts background color). */ - grub_video_blit_render_target (text_layer, GRUB_VIDEO_BLIT_REPLACE, x, y, + VasEBoot_video_blit_render_target (text_layer, VasEBoot_VIDEO_BLIT_REPLACE, x, y, x - virtual_screen.offset_x, y - virtual_screen.offset_y, width, height); /* Restore saved viewport. */ - grub_video_set_viewport (saved_view.x, saved_view.y, + VasEBoot_video_set_viewport (saved_view.x, saved_view.y, saved_view.width, saved_view.height); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); } static void @@ -597,8 +597,8 @@ dirty_region_redraw (void) width = dirty_region.bottom_right_x - x + 1; height = dirty_region.bottom_right_y - y + 1; - if (repaint_was_scheduled && grub_gfxterm_decorator_hook) - grub_gfxterm_decorator_hook (); + if (repaint_was_scheduled && VasEBoot_gfxterm_decorator_hook) + VasEBoot_gfxterm_decorator_hook (); redraw_screen_rect (x, y, width, height); } @@ -606,10 +606,10 @@ dirty_region_redraw (void) static inline void paint_char (unsigned cx, unsigned cy) { - struct grub_colored_char *p; - struct grub_font_glyph *glyph; - grub_video_color_t color; - grub_video_color_t bgcolor; + struct VasEBoot_colored_char *p; + struct VasEBoot_font_glyph *glyph; + VasEBoot_video_color_t color; + VasEBoot_video_color_t bgcolor; unsigned int x; unsigned int y; int ascent; @@ -627,13 +627,13 @@ paint_char (unsigned cx, unsigned cy) return; /* Get glyph for character. */ - glyph = grub_font_construct_glyph (virtual_screen.font, &p->code); + glyph = VasEBoot_font_construct_glyph (virtual_screen.font, &p->code); if (!glyph) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return; } - ascent = grub_font_get_ascent (virtual_screen.font); + ascent = VasEBoot_font_get_ascent (virtual_screen.font); width = virtual_screen.normal_char_width * calculate_character_width(glyph); height = virtual_screen.normal_char_height; @@ -645,10 +645,10 @@ paint_char (unsigned cx, unsigned cy) y = (cy + virtual_screen.total_scroll) * virtual_screen.normal_char_height; /* Render glyph to text layer. */ - grub_video_set_active_render_target (text_layer); - grub_video_fill_rect (bgcolor, x, y, width, height); - grub_font_draw_glyph (glyph, color, x, y + ascent); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (text_layer); + VasEBoot_video_fill_rect (bgcolor, x, y, width, height); + VasEBoot_font_draw_glyph (glyph, color, x, y + ascent); + VasEBoot_video_set_active_render_target (render_target); /* Mark character to be drawn. */ dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y, @@ -669,7 +669,7 @@ draw_cursor (int show) unsigned int width; unsigned int height; unsigned int ascent; - grub_video_color_t color; + VasEBoot_video_color_t color; write_char (); @@ -681,7 +681,7 @@ draw_cursor (int show) return; /* Ensure that cursor doesn't go outside of character box. */ - ascent = grub_font_get_ascent(virtual_screen.font); + ascent = VasEBoot_font_get_ascent(virtual_screen.font); if (ascent > virtual_screen.normal_char_height - 2) ascent = virtual_screen.normal_char_height - 2; @@ -695,9 +695,9 @@ draw_cursor (int show) height = 2; /* Render cursor to text layer. */ - grub_video_set_active_render_target (text_layer); - grub_video_fill_rect (color, x, y, width, height); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (text_layer); + VasEBoot_video_fill_rect (color, x, y, width, height); + VasEBoot_video_set_active_render_target (render_target); /* Mark cursor to be redrawn. */ dirty_region_add (virtual_screen.offset_x + x, @@ -709,18 +709,18 @@ static void real_scroll (void) { unsigned int i, j, was_scroll; - grub_video_color_t color; + VasEBoot_video_color_t color; if (!virtual_screen.total_scroll) return; /* If we have bitmap, re-draw screen, otherwise scroll physical screen too. */ - if (grub_gfxterm_background.bitmap) + if (VasEBoot_gfxterm_background.bitmap) { /* Scroll physical screen. */ - grub_video_set_active_render_target (text_layer); + VasEBoot_video_set_active_render_target (text_layer); color = virtual_screen.bg_color; - grub_video_scroll (color, 0, -virtual_screen.normal_char_height + VasEBoot_video_scroll (color, 0, -virtual_screen.normal_char_height * virtual_screen.total_scroll); /* Mark virtual screen to be redrawn. */ @@ -728,12 +728,12 @@ real_scroll (void) } else { - grub_video_rect_t saved_view; + VasEBoot_video_rect_t saved_view; /* Remove cursor. */ draw_cursor (0); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); i = window.double_repaint ? 2 : 1; @@ -742,45 +742,45 @@ real_scroll (void) while (i--) { /* Save viewport and set it to our window. */ - grub_video_get_viewport ((unsigned *) &saved_view.x, + VasEBoot_video_get_viewport ((unsigned *) &saved_view.x, (unsigned *) &saved_view.y, (unsigned *) &saved_view.width, (unsigned *) &saved_view.height); - grub_video_set_viewport (window.x, window.y, window.width, + VasEBoot_video_set_viewport (window.x, window.y, window.width, window.height); /* Clear new border area. */ - grub_video_fill_rect (color, + VasEBoot_video_fill_rect (color, virtual_screen.offset_x, virtual_screen.offset_y, virtual_screen.width, virtual_screen.normal_char_height * virtual_screen.total_scroll); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); dirty_region_redraw (); /* Scroll physical screen. */ - grub_video_scroll (color, 0, -virtual_screen.normal_char_height + VasEBoot_video_scroll (color, 0, -virtual_screen.normal_char_height * virtual_screen.total_scroll); /* Restore saved viewport. */ - grub_video_set_viewport (saved_view.x, saved_view.y, + VasEBoot_video_set_viewport (saved_view.x, saved_view.y, saved_view.width, saved_view.height); if (i) - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); } dirty_region_reset (); /* Scroll physical screen. */ - grub_video_set_active_render_target (text_layer); + VasEBoot_video_set_active_render_target (text_layer); color = virtual_screen.bg_color; - grub_video_scroll (color, 0, -virtual_screen.normal_char_height + VasEBoot_video_scroll (color, 0, -virtual_screen.normal_char_height * virtual_screen.total_scroll); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); } @@ -808,10 +808,10 @@ scroll_up (void) /* Clear first line in text buffer. */ for (i = 0; i < virtual_screen.columns; i++) - grub_unicode_destroy_glyph (&virtual_screen.text_buffer[i].code); + VasEBoot_unicode_destroy_glyph (&virtual_screen.text_buffer[i].code); /* Scroll text buffer with one line to up. */ - grub_memmove (virtual_screen.text_buffer, + VasEBoot_memmove (virtual_screen.text_buffer, virtual_screen.text_buffer + virtual_screen.columns, sizeof (*virtual_screen.text_buffer) * virtual_screen.columns @@ -827,8 +827,8 @@ scroll_up (void) } static void -grub_gfxterm_putchar (struct grub_term_output *term, - const struct grub_unicode_glyph *c) +VasEBoot_gfxterm_putchar (struct VasEBoot_term_output *term, + const struct VasEBoot_unicode_glyph *c) { if (!virtual_screen.functional) return; @@ -864,12 +864,12 @@ grub_gfxterm_putchar (struct grub_term_output *term, } else { - struct grub_colored_char *p; + struct VasEBoot_colored_char *p; unsigned char char_width; /* Calculate actual character width for glyph. This is number of times of normal_font_width. */ - char_width = grub_gfxterm_getcharwidth (term, c); + char_width = VasEBoot_gfxterm_getcharwidth (term, c); /* If we are about to exceed line length, wrap to next line. */ if (virtual_screen.cursor_x + char_width > virtual_screen.columns) @@ -884,9 +884,9 @@ grub_gfxterm_putchar (struct grub_term_output *term, p = (virtual_screen.text_buffer + virtual_screen.cursor_x + virtual_screen.cursor_y * virtual_screen.columns); - grub_unicode_destroy_glyph (&p->code); - grub_unicode_set_glyph (&p->code, c); - grub_errno = GRUB_ERR_NONE; + VasEBoot_unicode_destroy_glyph (&p->code); + VasEBoot_unicode_set_glyph (&p->code, c); + VasEBoot_errno = VasEBoot_ERR_NONE; p->fg_color = virtual_screen.fg_color; p->bg_color = virtual_screen.bg_color; @@ -899,7 +899,7 @@ grub_gfxterm_putchar (struct grub_term_output *term, virtual_screen.text_buffer + virtual_screen.columns * virtual_screen.rows; i++) { - grub_unicode_destroy_glyph (&p[i].code); + VasEBoot_unicode_destroy_glyph (&p[i].code); p[i].code.base = 0; } } @@ -929,16 +929,16 @@ grub_gfxterm_putchar (struct grub_term_output *term, /* Use ASCII characters to determine normal character width. */ static unsigned int -calculate_normal_character_width (grub_font_t font) +calculate_normal_character_width (VasEBoot_font_t font) { - struct grub_font_glyph *glyph; + struct VasEBoot_font_glyph *glyph; unsigned int width = 0; unsigned int i; /* Get properties of every printable ASCII character. */ for (i = 32; i < 127; i++) { - glyph = grub_font_get_glyph (font, i); + glyph = VasEBoot_font_get_glyph (font, i); /* Skip unknown characters. Should never happen on normal conditions. */ if (! glyph) @@ -954,7 +954,7 @@ calculate_normal_character_width (grub_font_t font) } static unsigned char -calculate_character_width (struct grub_font_glyph *glyph) +calculate_character_width (struct VasEBoot_font_glyph *glyph) { if (! glyph || glyph->device_width == 0) return 1; @@ -964,12 +964,12 @@ calculate_character_width (struct grub_font_glyph *glyph) / virtual_screen.normal_char_width; } -static grub_size_t -grub_gfxterm_getcharwidth (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c) +static VasEBoot_size_t +VasEBoot_gfxterm_getcharwidth (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c) { int dev_width; - dev_width = grub_font_get_constructed_device_width (virtual_screen.font, c); + dev_width = VasEBoot_font_get_constructed_device_width (virtual_screen.font, c); if (dev_width == 0) return 1; @@ -978,21 +978,21 @@ grub_gfxterm_getcharwidth (struct grub_term_output *term __attribute__ ((unused) / virtual_screen.normal_char_width; } -static struct grub_term_coordinate -grub_virtual_screen_getwh (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_virtual_screen_getwh (struct VasEBoot_term_output *term __attribute__ ((unused))) { - return (struct grub_term_coordinate) { virtual_screen.columns, virtual_screen.rows }; + return (struct VasEBoot_term_coordinate) { virtual_screen.columns, virtual_screen.rows }; } -static struct grub_term_coordinate -grub_virtual_screen_getxy (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_virtual_screen_getxy (struct VasEBoot_term_output *term __attribute__ ((unused))) { - return (struct grub_term_coordinate) { virtual_screen.cursor_x, virtual_screen.cursor_y }; + return (struct VasEBoot_term_coordinate) { virtual_screen.cursor_x, virtual_screen.cursor_y }; } static void -grub_gfxterm_gotoxy (struct grub_term_output *term __attribute__ ((unused)), - struct grub_term_coordinate pos) +VasEBoot_gfxterm_gotoxy (struct VasEBoot_term_output *term __attribute__ ((unused)), + struct VasEBoot_term_coordinate pos) { if (pos.x >= virtual_screen.columns) pos.x = virtual_screen.columns - 1; @@ -1013,9 +1013,9 @@ grub_gfxterm_gotoxy (struct grub_term_output *term __attribute__ ((unused)), } static void -grub_virtual_screen_cls (struct grub_term_output *term __attribute__ ((unused))) +VasEBoot_virtual_screen_cls (struct VasEBoot_term_output *term __attribute__ ((unused))) { - grub_uint32_t i; + VasEBoot_uint32_t i; for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) clear_char (&(virtual_screen.text_buffer[i])); @@ -1024,42 +1024,42 @@ grub_virtual_screen_cls (struct grub_term_output *term __attribute__ ((unused))) } static void -grub_gfxterm_cls (struct grub_term_output *term) +VasEBoot_gfxterm_cls (struct VasEBoot_term_output *term) { - grub_video_color_t color; + VasEBoot_video_color_t color; /* Clear virtual screen. */ - grub_virtual_screen_cls (term); + VasEBoot_virtual_screen_cls (term); /* Clear text layer. */ - grub_video_set_active_render_target (text_layer); + VasEBoot_video_set_active_render_target (text_layer); color = virtual_screen.bg_color; - grub_video_fill_rect (color, 0, 0, + VasEBoot_video_fill_rect (color, 0, 0, virtual_screen.width, virtual_screen.height); - grub_video_set_active_render_target (render_target); + VasEBoot_video_set_active_render_target (render_target); /* Mark virtual screen to be redrawn. */ dirty_region_add_virtualscreen (); - grub_gfxterm_refresh (term); + VasEBoot_gfxterm_refresh (term); } static void -grub_virtual_screen_setcolorstate (struct grub_term_output *term __attribute__ ((unused)), - grub_term_color_state state) +VasEBoot_virtual_screen_setcolorstate (struct VasEBoot_term_output *term __attribute__ ((unused)), + VasEBoot_term_color_state state) { switch (state) { - case GRUB_TERM_COLOR_STANDARD: + case VasEBoot_TERM_COLOR_STANDARD: virtual_screen.term_color = virtual_screen.standard_color_setting; break; - case GRUB_TERM_COLOR_NORMAL: - virtual_screen.term_color = grub_term_normal_color; + case VasEBoot_TERM_COLOR_NORMAL: + virtual_screen.term_color = VasEBoot_term_normal_color; break; - case GRUB_TERM_COLOR_HIGHLIGHT: - virtual_screen.term_color = grub_term_highlight_color; + case VasEBoot_TERM_COLOR_HIGHLIGHT: + virtual_screen.term_color = VasEBoot_term_highlight_color; break; default: @@ -1071,7 +1071,7 @@ grub_virtual_screen_setcolorstate (struct grub_term_output *term __attribute__ ( } static void -grub_gfxterm_setcursor (struct grub_term_output *term __attribute__ ((unused)), +VasEBoot_gfxterm_setcursor (struct VasEBoot_term_output *term __attribute__ ((unused)), int on) { if (virtual_screen.cursor_state != on) @@ -1086,66 +1086,66 @@ grub_gfxterm_setcursor (struct grub_term_output *term __attribute__ ((unused)), } static void -grub_gfxterm_refresh (struct grub_term_output *term __attribute__ ((unused))) +VasEBoot_gfxterm_refresh (struct VasEBoot_term_output *term __attribute__ ((unused))) { real_scroll (); /* Redraw only changed regions. */ dirty_region_redraw (); - grub_video_swap_buffers (); + VasEBoot_video_swap_buffers (); if (window.double_repaint) dirty_region_redraw (); dirty_region_reset (); } -static struct grub_term_output grub_video_term = +static struct VasEBoot_term_output VasEBoot_video_term = { .name = "gfxterm", - .init = grub_gfxterm_term_init, - .fini = grub_gfxterm_term_fini, - .putchar = grub_gfxterm_putchar, - .getcharwidth = grub_gfxterm_getcharwidth, - .getwh = grub_virtual_screen_getwh, - .getxy = grub_virtual_screen_getxy, - .gotoxy = grub_gfxterm_gotoxy, - .cls = grub_gfxterm_cls, - .setcolorstate = grub_virtual_screen_setcolorstate, - .setcursor = grub_gfxterm_setcursor, - .refresh = grub_gfxterm_refresh, - .fullscreen = grub_gfxterm_fullscreen, - .flags = GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS, - .progress_update_divisor = GRUB_PROGRESS_SLOW, + .init = VasEBoot_gfxterm_term_init, + .fini = VasEBoot_gfxterm_term_fini, + .putchar = VasEBoot_gfxterm_putchar, + .getcharwidth = VasEBoot_gfxterm_getcharwidth, + .getwh = VasEBoot_virtual_screen_getwh, + .getxy = VasEBoot_virtual_screen_getxy, + .gotoxy = VasEBoot_gfxterm_gotoxy, + .cls = VasEBoot_gfxterm_cls, + .setcolorstate = VasEBoot_virtual_screen_setcolorstate, + .setcursor = VasEBoot_gfxterm_setcursor, + .refresh = VasEBoot_gfxterm_refresh, + .fullscreen = VasEBoot_gfxterm_fullscreen, + .flags = VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS, + .progress_update_divisor = VasEBoot_PROGRESS_SLOW, .next = 0 }; void -grub_gfxterm_video_update_color (void) +VasEBoot_gfxterm_video_update_color (void) { - struct grub_video_render_target *old_target; + struct VasEBoot_video_render_target *old_target; - grub_video_get_active_render_target (&old_target); - grub_video_set_active_render_target (text_layer); - virtual_screen.bg_color = grub_video_map_rgba_color (grub_gfxterm_background.default_bg_color); - grub_video_set_active_render_target (old_target); + VasEBoot_video_get_active_render_target (&old_target); + VasEBoot_video_set_active_render_target (text_layer); + virtual_screen.bg_color = VasEBoot_video_map_rgba_color (VasEBoot_gfxterm_background.default_bg_color); + VasEBoot_video_set_active_render_target (old_target); virtual_screen.bg_color_display = - grub_video_map_rgba_color (grub_gfxterm_background.default_bg_color); + VasEBoot_video_map_rgba_color (VasEBoot_gfxterm_background.default_bg_color); } void -grub_gfxterm_get_dimensions (unsigned *width, unsigned *height) +VasEBoot_gfxterm_get_dimensions (unsigned *width, unsigned *height) { *width = window.width; *height = window.height; } -GRUB_MOD_INIT(gfxterm) +VasEBoot_MOD_INIT(gfxterm) { - grub_term_register_output ("gfxterm", &grub_video_term); + VasEBoot_term_register_output ("gfxterm", &VasEBoot_video_term); } -GRUB_MOD_FINI(gfxterm) +VasEBoot_MOD_FINI(gfxterm) { - grub_term_unregister_output (&grub_video_term); + VasEBoot_term_unregister_output (&VasEBoot_video_term); } diff --git a/VasEBoot-core/term/gfxterm_background.c b/VasEBoot-core/term/gfxterm_background.c index 8da71a8c8..a102af1af 100644 --- a/VasEBoot-core/term/gfxterm_background.c +++ b/VasEBoot-core/term/gfxterm_background.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Option array indices. */ enum @@ -40,11 +40,11 @@ enum BACKGROUND_CMD_ARGINDEX_MODE = 0 }; -static const struct grub_arg_option background_image_cmd_options[] = +static const struct VasEBoot_arg_option background_image_cmd_options[] = { {"mode", 'm', 0, N_("Background image mode."), /* TRANSLATORS: This refers to background image mode (stretched or - in left-top corner). Note that GRUB will accept only original + in left-top corner). Note that VasEBoot will accept only original keywords stretch and normal, not the translated ones. So please put both in translation e.g. stretch(=%STRETCH%)|normal(=%NORMAL%). @@ -57,134 +57,134 @@ static const struct grub_arg_option background_image_cmd_options[] = {0, 0, 0, 0, 0, 0} }; -static grub_err_t -grub_gfxterm_background_image_cmd (grub_extcmd_context_t ctxt, +static VasEBoot_err_t +VasEBoot_gfxterm_background_image_cmd (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; /* Check that we have video adapter active. */ - if (grub_video_get_info(NULL) != GRUB_ERR_NONE) - return grub_errno; + if (VasEBoot_video_get_info(NULL) != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Destroy existing background bitmap if loaded. */ - if (grub_gfxterm_background.bitmap) + if (VasEBoot_gfxterm_background.bitmap) { - grub_video_bitmap_destroy (grub_gfxterm_background.bitmap); - grub_gfxterm_background.bitmap = 0; - grub_gfxterm_background.blend_text_bg = 0; + VasEBoot_video_bitmap_destroy (VasEBoot_gfxterm_background.bitmap); + VasEBoot_gfxterm_background.bitmap = 0; + VasEBoot_gfxterm_background.blend_text_bg = 0; /* Mark whole screen as dirty. */ - grub_gfxterm_schedule_repaint (); + VasEBoot_gfxterm_schedule_repaint (); } /* If filename was provided, try to load that. */ if (argc >= 1) { /* Try to load new one. */ - grub_video_bitmap_load (&grub_gfxterm_background.bitmap, args[0]); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_video_bitmap_load (&VasEBoot_gfxterm_background.bitmap, args[0]); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Determine if the bitmap should be scaled to fit the screen. */ if (!state[BACKGROUND_CMD_ARGINDEX_MODE].set - || grub_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg, + || VasEBoot_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg, "stretch") == 0) { unsigned int width, height; - grub_gfxterm_get_dimensions (&width, &height); + VasEBoot_gfxterm_get_dimensions (&width, &height); if (width - != grub_video_bitmap_get_width (grub_gfxterm_background.bitmap) + != VasEBoot_video_bitmap_get_width (VasEBoot_gfxterm_background.bitmap) || height - != grub_video_bitmap_get_height (grub_gfxterm_background.bitmap)) + != VasEBoot_video_bitmap_get_height (VasEBoot_gfxterm_background.bitmap)) { - struct grub_video_bitmap *scaled_bitmap; - grub_video_bitmap_create_scaled (&scaled_bitmap, + struct VasEBoot_video_bitmap *scaled_bitmap; + VasEBoot_video_bitmap_create_scaled (&scaled_bitmap, width, height, - grub_gfxterm_background.bitmap, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); - if (grub_errno == GRUB_ERR_NONE) + VasEBoot_gfxterm_background.bitmap, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST); + if (VasEBoot_errno == VasEBoot_ERR_NONE) { /* Replace the original bitmap with the scaled one. */ - grub_video_bitmap_destroy (grub_gfxterm_background.bitmap); - grub_gfxterm_background.bitmap = scaled_bitmap; + VasEBoot_video_bitmap_destroy (VasEBoot_gfxterm_background.bitmap); + VasEBoot_gfxterm_background.bitmap = scaled_bitmap; } } } /* If bitmap was loaded correctly, display it. */ - if (grub_gfxterm_background.bitmap) + if (VasEBoot_gfxterm_background.bitmap) { - grub_gfxterm_background.blend_text_bg = 1; + VasEBoot_gfxterm_background.blend_text_bg = 1; /* Mark whole screen as dirty. */ - grub_gfxterm_schedule_repaint (); + VasEBoot_gfxterm_schedule_repaint (); } } /* All was ok. */ - grub_errno = GRUB_ERR_NONE; - return grub_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; + return VasEBoot_errno; } -static grub_err_t -grub_gfxterm_background_color_cmd (grub_command_t cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_gfxterm_background_color_cmd (VasEBoot_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("one argument expected")); /* Check that we have video adapter active. */ - if (grub_video_get_info (NULL) != GRUB_ERR_NONE) - return grub_errno; + if (VasEBoot_video_get_info (NULL) != VasEBoot_ERR_NONE) + return VasEBoot_errno; - if (grub_video_parse_color (args[0], - &grub_gfxterm_background.default_bg_color) - != GRUB_ERR_NONE) - return grub_errno; + if (VasEBoot_video_parse_color (args[0], + &VasEBoot_gfxterm_background.default_bg_color) + != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Destroy existing background bitmap if loaded. */ - if (grub_gfxterm_background.bitmap) + if (VasEBoot_gfxterm_background.bitmap) { - grub_video_bitmap_destroy (grub_gfxterm_background.bitmap); - grub_gfxterm_background.bitmap = 0; + VasEBoot_video_bitmap_destroy (VasEBoot_gfxterm_background.bitmap); + VasEBoot_gfxterm_background.bitmap = 0; /* Mark whole screen as dirty. */ - grub_gfxterm_schedule_repaint (); + VasEBoot_gfxterm_schedule_repaint (); } /* Set the background and border colors. The background color needs to be compatible with the text layer. */ - grub_gfxterm_video_update_color (); - grub_gfxterm_background.blend_text_bg = 1; + VasEBoot_gfxterm_video_update_color (); + VasEBoot_gfxterm_background.blend_text_bg = 1; /* Mark whole screen as dirty. */ - grub_gfxterm_schedule_repaint (); + VasEBoot_gfxterm_schedule_repaint (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_extcmd_t background_image_cmd_handle; -static grub_command_t background_color_cmd_handle; +static VasEBoot_extcmd_t background_image_cmd_handle; +static VasEBoot_command_t background_color_cmd_handle; -GRUB_MOD_INIT(gfxterm_background) +VasEBoot_MOD_INIT(gfxterm_background) { background_image_cmd_handle = - grub_register_extcmd ("background_image", - grub_gfxterm_background_image_cmd, 0, + VasEBoot_register_extcmd ("background_image", + VasEBoot_gfxterm_background_image_cmd, 0, N_("[-m (stretch|normal)] FILE"), N_("Load background image for active terminal."), background_image_cmd_options); background_color_cmd_handle = - grub_register_command ("background_color", - grub_gfxterm_background_color_cmd, + VasEBoot_register_command ("background_color", + VasEBoot_gfxterm_background_color_cmd, N_("COLOR"), N_("Set background color for active terminal.")); } -GRUB_MOD_FINI(gfxterm_background) +VasEBoot_MOD_FINI(gfxterm_background) { - grub_unregister_command (background_color_cmd_handle); - grub_unregister_extcmd (background_image_cmd_handle); + VasEBoot_unregister_command (background_color_cmd_handle); + VasEBoot_unregister_extcmd (background_image_cmd_handle); } diff --git a/VasEBoot-core/term/i386/coreboot/cbmemc.c b/VasEBoot-core/term/i386/coreboot/cbmemc.c index 25e64a05c..d994fa064 100644 --- a/VasEBoot-core/term/i386/coreboot/cbmemc.c +++ b/VasEBoot-core/term/i386/coreboot/cbmemc.c @@ -1,45 +1,45 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_linuxbios_cbmemc +struct VasEBoot_linuxbios_cbmemc { - grub_uint32_t size; - grub_uint32_t pointer; + VasEBoot_uint32_t size; + VasEBoot_uint32_t pointer; char data[0]; }; -static struct grub_linuxbios_cbmemc *cbmemc; +static struct VasEBoot_linuxbios_cbmemc *cbmemc; static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { if (!cbmemc) return; @@ -48,51 +48,51 @@ put (struct grub_term_output *term __attribute__ ((unused)), const int c) cbmemc->pointer++; } -struct grub_terminfo_output_state grub_cbmemc_terminfo_output = +struct VasEBoot_terminfo_output_state VasEBoot_cbmemc_terminfo_output = { .put = put, .size = { 80, 24 } }; -static struct grub_term_output grub_cbmemc_term_output = +static struct VasEBoot_term_output VasEBoot_cbmemc_term_output = { .name = "cbmemc", - .init = grub_terminfo_output_init, + .init = VasEBoot_terminfo_output_init, .fini = 0, - .putchar = grub_terminfo_putchar, - .getxy = grub_terminfo_getxy, - .getwh = grub_terminfo_getwh, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_terminfo_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, - .data = &grub_cbmemc_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_NO_UPDATE + .putchar = VasEBoot_terminfo_putchar, + .getxy = VasEBoot_terminfo_getxy, + .getwh = VasEBoot_terminfo_getwh, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_terminfo_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, + .data = &VasEBoot_cbmemc_terminfo_output, + .progress_update_divisor = VasEBoot_PROGRESS_NO_UPDATE }; static int -iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, +iterate_linuxbios_table (VasEBoot_linuxbios_table_item_t table_item, void *data __attribute__ ((unused))) { - if (table_item->tag != GRUB_LINUXBIOS_MEMBER_CBMEMC) + if (table_item->tag != VasEBoot_LINUXBIOS_MEMBER_CBMEMC) return 0; - cbmemc = (struct grub_linuxbios_cbmemc *) (grub_addr_t) - *(grub_uint64_t *) (table_item + 1); + cbmemc = (struct VasEBoot_linuxbios_cbmemc *) (VasEBoot_addr_t) + *(VasEBoot_uint64_t *) (table_item + 1); return 1; } -static grub_err_t -grub_cmd_cbmemc (struct grub_command *cmd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_cbmemc (struct VasEBoot_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - grub_size_t len; + VasEBoot_size_t len; char *str; - struct grub_linuxbios_cbmemc *cbmemc_saved; + struct VasEBoot_linuxbios_cbmemc *cbmemc_saved; if (!cbmemc) - return grub_error (GRUB_ERR_IO, "no CBMEM console found"); + return VasEBoot_error (VasEBoot_ERR_IO, "no CBMEM console found"); len = cbmemc->pointer; if (len > cbmemc->size) @@ -100,28 +100,28 @@ grub_cmd_cbmemc (struct grub_command *cmd __attribute__ ((unused)), str = cbmemc->data; cbmemc_saved = cbmemc; cbmemc = 0; - grub_xnputs (str, len); + VasEBoot_xnputs (str, len); cbmemc = cbmemc_saved; return 0; } -static grub_command_t cmd; +static VasEBoot_command_t cmd; -GRUB_MOD_INIT (cbmemc) +VasEBoot_MOD_INIT (cbmemc) { - grub_linuxbios_table_iterate (iterate_linuxbios_table, 0); + VasEBoot_linuxbios_table_iterate (iterate_linuxbios_table, 0); if (cbmemc) - grub_term_register_output ("cbmemc", &grub_cbmemc_term_output); + VasEBoot_term_register_output ("cbmemc", &VasEBoot_cbmemc_term_output); cmd = - grub_register_command ("cbmemc", grub_cmd_cbmemc, + VasEBoot_register_command ("cbmemc", VasEBoot_cmd_cbmemc, 0, N_("Show CBMEM console content.")); } -GRUB_MOD_FINI (cbmemc) +VasEBoot_MOD_FINI (cbmemc) { - grub_term_unregister_output (&grub_cbmemc_term_output); - grub_unregister_command (cmd); + VasEBoot_term_unregister_output (&VasEBoot_cbmemc_term_output); + VasEBoot_unregister_command (cmd); } diff --git a/VasEBoot-core/term/i386/pc/console.c b/VasEBoot-core/term/i386/pc/console.c index 28de46b57..67062911e 100644 --- a/VasEBoot-core/term/i386/pc/console.c +++ b/VasEBoot-core/term/i386/pc/console.c @@ -1,39 +1,39 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -static grub_uint8_t grub_console_cur_color = 0x7; +static VasEBoot_uint8_t VasEBoot_console_cur_color = 0x7; static void -int10_9 (grub_uint8_t ch, grub_uint16_t n) +int10_9 (VasEBoot_uint8_t ch, VasEBoot_uint16_t n) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = ch | 0x0900; - regs.ebx = grub_console_cur_color & 0xff; + regs.ebx = VasEBoot_console_cur_color & 0xff; regs.ecx = n; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); } /* @@ -47,17 +47,17 @@ int10_9 (grub_uint8_t ch, grub_uint16_t n) */ -static struct grub_term_coordinate -grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_console_getxy (struct VasEBoot_term_output *term __attribute__ ((unused))) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x0300; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); - return (struct grub_term_coordinate) { + return (struct VasEBoot_term_coordinate) { (regs.edx & 0xff), ((regs.edx & 0xff00) >> 8) }; } @@ -69,22 +69,22 @@ grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) * %dl = column (0 is left) */ static void -grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), - struct grub_term_coordinate pos) +VasEBoot_console_gotoxy (struct VasEBoot_term_output *term __attribute__ ((unused)), + struct VasEBoot_term_coordinate pos) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; /* set page to 0 */ regs.ebx = 0; regs.eax = 0x0200; regs.edx = (pos.y << 8) | pos.x; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); } /* * - * Put the character C on the console. Because GRUB wants to write a + * Put the character C on the console. Because VasEBoot wants to write a * character with an attribute, this implementation is a bit tricky. * If C is a control character (CR, LF, BEL, BS), use INT 10, AH = 0Eh * (TELETYPE OUTPUT). Otherwise, use INT 10, AH = 9 to write character @@ -92,22 +92,22 @@ grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), * let BIOS to wrap line correctly. */ static void -grub_console_putchar_real (grub_uint8_t c) +VasEBoot_console_putchar_real (VasEBoot_uint8_t c) { - struct grub_bios_int_registers regs; - struct grub_term_coordinate pos; + struct VasEBoot_bios_int_registers regs; + struct VasEBoot_term_coordinate pos; if (c == 7 || c == 8 || c == 0xa || c == 0xd) { regs.eax = c | 0x0e00; regs.ebx = 0x0001; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return; } /* get the current position */ - pos = grub_console_getxy (NULL); + pos = VasEBoot_console_getxy (NULL); /* write the character with the attribute */ int10_9 (c, 1); @@ -115,19 +115,19 @@ grub_console_putchar_real (grub_uint8_t c) /* check the column with the width */ if (pos.x >= 79) { - grub_console_putchar_real (0x0d); - grub_console_putchar_real (0x0a); + VasEBoot_console_putchar_real (0x0d); + VasEBoot_console_putchar_real (0x0a); } else - grub_console_gotoxy (NULL, (struct grub_term_coordinate) { pos.x + 1, + VasEBoot_console_gotoxy (NULL, (struct VasEBoot_term_coordinate) { pos.x + 1, pos.y }); } static void -grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c) +VasEBoot_console_putchar (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c) { - grub_console_putchar_real (c->base); + VasEBoot_console_putchar_real (c->base); } /* @@ -139,39 +139,39 @@ grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)), * %cx = (number of times) */ static void -grub_console_cls (struct grub_term_output *term) +VasEBoot_console_cls (struct VasEBoot_term_output *term) { /* move the cursor to the beginning */ - grub_console_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); + VasEBoot_console_gotoxy (term, (struct VasEBoot_term_coordinate) { 0, 0 }); /* write spaces to the entire screen */ int10_9 (' ', 80 * 25); /* move back the cursor */ - grub_console_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); + VasEBoot_console_gotoxy (term, (struct VasEBoot_term_coordinate) { 0, 0 }); } /* - * void grub_console_setcursor (int on) + * void VasEBoot_console_setcursor (int on) * BIOS call "INT 10H Function 01h" to set cursor type * Call with %ah = 0x01 * %ch = cursor starting scanline * %cl = cursor ending scanline */ static void -grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), +VasEBoot_console_setcursor (struct VasEBoot_term_output *term __attribute__ ((unused)), int on) { - static grub_uint16_t console_cursor_shape = 0; - struct grub_bios_int_registers regs; + static VasEBoot_uint16_t console_cursor_shape = 0; + struct VasEBoot_bios_int_registers regs; /* check if the standard cursor shape has already been saved */ if (!console_cursor_shape) { regs.eax = 0x0300; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); console_cursor_shape = regs.ecx; if ((console_cursor_shape >> 8) >= (console_cursor_shape & 0xff)) console_cursor_shape = 0x0d0e; @@ -179,8 +179,8 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), /* set %cx to the designated cursor shape */ regs.ecx = on ? console_cursor_shape : 0x2000; regs.eax = 0x0100; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); } /* @@ -201,12 +201,12 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)), */ static int -grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) +VasEBoot_console_getkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { - const grub_uint16_t bypass_table[] = { + const VasEBoot_uint16_t bypass_table[] = { 0x0100 | '\e', 0x0f00 | '\t', 0x0e00 | '\b', 0x1c00 | '\r', 0x1c00 | '\n' }; - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; unsigned i; /* @@ -217,16 +217,16 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) */ regs.eax = 0x0100; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x16, ®s); - if (regs.flags & GRUB_CPU_INT_FLAGS_ZERO) - return GRUB_TERM_NO_KEY; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x16, ®s); + if (regs.flags & VasEBoot_CPU_INT_FLAGS_ZERO) + return VasEBoot_TERM_NO_KEY; regs.eax = 0x0000; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x16, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x16, ®s); if (!(regs.eax & 0xff)) - return ((regs.eax >> 8) & 0xff) | GRUB_TERM_EXTENDED; + return ((regs.eax >> 8) & 0xff) | VasEBoot_TERM_EXTENDED; if ((regs.eax & 0xff) >= ' ') return regs.eax & 0xff; @@ -235,76 +235,76 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused))) if (bypass_table[i] == (regs.eax & 0xffff)) return regs.eax & 0xff; - return (regs.eax & 0xff) + (('a' - 1) | GRUB_TERM_CTRL); + return (regs.eax & 0xff) + (('a' - 1) | VasEBoot_TERM_CTRL); } -static const struct grub_machine_bios_data_area *bios_data_area = - (struct grub_machine_bios_data_area *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; +static const struct VasEBoot_machine_bios_data_area *bios_data_area = + (struct VasEBoot_machine_bios_data_area *) VasEBoot_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; static int -grub_console_getkeystatus (struct grub_term_input *term __attribute__ ((unused))) +VasEBoot_console_getkeystatus (struct VasEBoot_term_input *term __attribute__ ((unused))) { - /* conveniently GRUB keystatus is modelled after BIOS one. */ + /* conveniently VasEBoot keystatus is modelled after BIOS one. */ return bios_data_area->keyboard_flag_lower & ~0x80; } -static struct grub_term_coordinate -grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_console_getwh (struct VasEBoot_term_output *term __attribute__ ((unused))) { - return (struct grub_term_coordinate) { 80, 25 }; + return (struct VasEBoot_term_coordinate) { 80, 25 }; } static void -grub_console_setcolorstate (struct grub_term_output *term +VasEBoot_console_setcolorstate (struct VasEBoot_term_output *term __attribute__ ((unused)), - grub_term_color_state state) + VasEBoot_term_color_state state) { switch (state) { - case GRUB_TERM_COLOR_STANDARD: - grub_console_cur_color = GRUB_TERM_DEFAULT_STANDARD_COLOR & 0x7f; + case VasEBoot_TERM_COLOR_STANDARD: + VasEBoot_console_cur_color = VasEBoot_TERM_DEFAULT_STANDARD_COLOR & 0x7f; break; - case GRUB_TERM_COLOR_NORMAL: - grub_console_cur_color = grub_term_normal_color & 0x7f; + case VasEBoot_TERM_COLOR_NORMAL: + VasEBoot_console_cur_color = VasEBoot_term_normal_color & 0x7f; break; - case GRUB_TERM_COLOR_HIGHLIGHT: - grub_console_cur_color = grub_term_highlight_color & 0x7f; + case VasEBoot_TERM_COLOR_HIGHLIGHT: + VasEBoot_console_cur_color = VasEBoot_term_highlight_color & 0x7f; break; default: break; } } -static struct grub_term_input grub_console_term_input = +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", - .getkey = grub_console_getkey, - .getkeystatus = grub_console_getkeystatus + .getkey = VasEBoot_console_getkey, + .getkeystatus = VasEBoot_console_getkeystatus }; -static struct grub_term_output grub_console_term_output = +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", - .putchar = grub_console_putchar, - .getwh = grub_console_getwh, - .getxy = grub_console_getxy, - .gotoxy = grub_console_gotoxy, - .cls = grub_console_cls, - .setcolorstate = grub_console_setcolorstate, - .setcursor = grub_console_setcursor, - .flags = GRUB_TERM_CODE_TYPE_CP437, - .progress_update_divisor = GRUB_PROGRESS_FAST + .putchar = VasEBoot_console_putchar, + .getwh = VasEBoot_console_getwh, + .getxy = VasEBoot_console_getxy, + .gotoxy = VasEBoot_console_gotoxy, + .cls = VasEBoot_console_cls, + .setcolorstate = VasEBoot_console_setcolorstate, + .setcursor = VasEBoot_console_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_CP437, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init (void) +VasEBoot_console_init (void) { - grub_term_register_output ("console", &grub_console_term_output); - grub_term_register_input ("console", &grub_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); } void -grub_console_fini (void) +VasEBoot_console_fini (void) { - grub_term_unregister_input (&grub_console_term_input); - grub_term_unregister_output (&grub_console_term_output); + VasEBoot_term_unregister_input (&VasEBoot_console_term_input); + VasEBoot_term_unregister_output (&VasEBoot_console_term_output); } diff --git a/VasEBoot-core/term/i386/pc/mda_text.c b/VasEBoot-core/term/i386/pc/mda_text.c index c3a5a1788..28f76f933 100644 --- a/VasEBoot-core/term/i386/pc/mda_text.c +++ b/VasEBoot-core/term/i386/pc/mda_text.c @@ -1,13 +1,13 @@ #define MODE_MDA 1 #include "vga_text.c" -GRUB_MOD_INIT(mda_text) +VasEBoot_MOD_INIT(mda_text) { - grub_term_register_output ("mda_text", &grub_vga_text_term); + VasEBoot_term_register_output ("mda_text", &VasEBoot_vga_text_term); } -GRUB_MOD_FINI(mda_text) +VasEBoot_MOD_FINI(mda_text) { - grub_term_unregister_output (&grub_vga_text_term); + VasEBoot_term_unregister_output (&VasEBoot_vga_text_term); } diff --git a/VasEBoot-core/term/i386/pc/vga_text.c b/VasEBoot-core/term/i386/pc/vga_text.c index 88fecc5ea..144a74867 100644 --- a/VasEBoot-core/term/i386/pc/vga_text.c +++ b/VasEBoot-core/term/i386/pc/vga_text.c @@ -1,91 +1,91 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#if defined (GRUB_MACHINE_COREBOOT) -#include +#if defined (VasEBoot_MACHINE_COREBOOT) +#include #endif /* MODESET is used for testing to force monochrome or colour mode. You shouldn't use mda_text on vga. */ #ifdef MODESET -#include +#include #endif -#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_MULTIBOOT) -#include +#if defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_QEMU) || defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) || defined (VasEBoot_MACHINE_MULTIBOOT) +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define COLS 80 #define ROWS 25 -static struct grub_term_coordinate grub_curr_pos; +static struct VasEBoot_term_coordinate VasEBoot_curr_pos; #ifdef __mips__ -#define VGA_TEXT_SCREEN ((grub_uint16_t *) 0xb00b8000) -#define cr_read grub_vga_cr_read -#define cr_write grub_vga_cr_write +#define VGA_TEXT_SCREEN ((VasEBoot_uint16_t *) 0xb00b8000) +#define cr_read VasEBoot_vga_cr_read +#define cr_write VasEBoot_vga_cr_write #elif defined (MODE_MDA) -#define VGA_TEXT_SCREEN ((grub_uint16_t *) 0xb0000) -#define cr_read grub_vga_cr_bw_read -#define cr_write grub_vga_cr_bw_write +#define VGA_TEXT_SCREEN ((VasEBoot_uint16_t *) 0xb0000) +#define cr_read VasEBoot_vga_cr_bw_read +#define cr_write VasEBoot_vga_cr_bw_write #else -#define VGA_TEXT_SCREEN ((grub_uint16_t *) 0xb8000) -#define cr_read grub_vga_cr_read -#define cr_write grub_vga_cr_write +#define VGA_TEXT_SCREEN ((VasEBoot_uint16_t *) 0xb8000) +#define cr_read VasEBoot_vga_cr_read +#define cr_write VasEBoot_vga_cr_write #endif -static grub_uint8_t cur_color = 0x7; +static VasEBoot_uint8_t cur_color = 0x7; static void screen_write_char (int x, int y, short c) { - VGA_TEXT_SCREEN[y * COLS + x] = grub_cpu_to_le16 (c); + VGA_TEXT_SCREEN[y * COLS + x] = VasEBoot_cpu_to_le16 (c); } static short screen_read_char (int x, int y) { - return grub_le_to_cpu16 (VGA_TEXT_SCREEN[y * COLS + x]); + return VasEBoot_le_to_cpu16 (VGA_TEXT_SCREEN[y * COLS + x]); } static void update_cursor (void) { - unsigned int pos = grub_curr_pos.y * COLS + grub_curr_pos.x; - cr_write (pos >> 8, GRUB_VGA_CR_CURSOR_ADDR_HIGH); - cr_write (pos & 0xFF, GRUB_VGA_CR_CURSOR_ADDR_LOW); + unsigned int pos = VasEBoot_curr_pos.y * COLS + VasEBoot_curr_pos.x; + cr_write (pos >> 8, VasEBoot_VGA_CR_CURSOR_ADDR_HIGH); + cr_write (pos & 0xFF, VasEBoot_VGA_CR_CURSOR_ADDR_LOW); } static void inc_y (void) { - grub_curr_pos.x = 0; - if (grub_curr_pos.y < ROWS - 1) - grub_curr_pos.y++; + VasEBoot_curr_pos.x = 0; + if (VasEBoot_curr_pos.y < ROWS - 1) + VasEBoot_curr_pos.y++; else { int x, y; @@ -100,30 +100,30 @@ inc_y (void) static void inc_x (void) { - if (grub_curr_pos.x >= COLS - 1) + if (VasEBoot_curr_pos.x >= COLS - 1) inc_y (); else - grub_curr_pos.x++; + VasEBoot_curr_pos.x++; } static void -grub_vga_text_putchar (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c) +VasEBoot_vga_text_putchar (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c) { switch (c->base) { case '\b': - if (grub_curr_pos.x != 0) - screen_write_char (grub_curr_pos.x--, grub_curr_pos.y, ' '); + if (VasEBoot_curr_pos.x != 0) + screen_write_char (VasEBoot_curr_pos.x--, VasEBoot_curr_pos.y, ' '); break; case '\n': inc_y (); break; case '\r': - grub_curr_pos.x = 0; + VasEBoot_curr_pos.x = 0; break; default: - screen_write_char (grub_curr_pos.x, grub_curr_pos.y, + screen_write_char (VasEBoot_curr_pos.x, VasEBoot_curr_pos.y, c->base | (cur_color << 8)); inc_x (); } @@ -131,98 +131,98 @@ grub_vga_text_putchar (struct grub_term_output *term __attribute__ ((unused)), update_cursor (); } -static struct grub_term_coordinate -grub_vga_text_getxy (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_vga_text_getxy (struct VasEBoot_term_output *term __attribute__ ((unused))) { - return grub_curr_pos; + return VasEBoot_curr_pos; } static void -grub_vga_text_gotoxy (struct grub_term_output *term __attribute__ ((unused)), - struct grub_term_coordinate pos) +VasEBoot_vga_text_gotoxy (struct VasEBoot_term_output *term __attribute__ ((unused)), + struct VasEBoot_term_coordinate pos) { - grub_curr_pos = pos; + VasEBoot_curr_pos = pos; update_cursor (); } static void -grub_vga_text_cls (struct grub_term_output *term) +VasEBoot_vga_text_cls (struct VasEBoot_term_output *term) { int i; for (i = 0; i < ROWS * COLS; i++) - VGA_TEXT_SCREEN[i] = grub_cpu_to_le16 (' ' | (cur_color << 8)); - grub_vga_text_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); + VGA_TEXT_SCREEN[i] = VasEBoot_cpu_to_le16 (' ' | (cur_color << 8)); + VasEBoot_vga_text_gotoxy (term, (struct VasEBoot_term_coordinate) { 0, 0 }); } static void -grub_vga_text_setcursor (struct grub_term_output *term __attribute__ ((unused)), +VasEBoot_vga_text_setcursor (struct VasEBoot_term_output *term __attribute__ ((unused)), int on) { - grub_uint8_t old; - old = cr_read (GRUB_VGA_CR_CURSOR_START); + VasEBoot_uint8_t old; + old = cr_read (VasEBoot_VGA_CR_CURSOR_START); if (on) - cr_write (old & ~GRUB_VGA_CR_CURSOR_START_DISABLE, - GRUB_VGA_CR_CURSOR_START); + cr_write (old & ~VasEBoot_VGA_CR_CURSOR_START_DISABLE, + VasEBoot_VGA_CR_CURSOR_START); else - cr_write (old | GRUB_VGA_CR_CURSOR_START_DISABLE, - GRUB_VGA_CR_CURSOR_START); + cr_write (old | VasEBoot_VGA_CR_CURSOR_START_DISABLE, + VasEBoot_VGA_CR_CURSOR_START); } -static grub_err_t -grub_vga_text_init_real (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_vga_text_init_real (struct VasEBoot_term_output *term) { #ifdef MODESET - struct grub_bios_int_registers regs; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + struct VasEBoot_bios_int_registers regs; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; #ifdef MODE_MDA regs.eax = 7; #else regs.eax = 3; #endif - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); #endif - grub_vga_text_cls (term); + VasEBoot_vga_text_cls (term); return 0; } -static grub_err_t -grub_vga_text_fini_real (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_vga_text_fini_real (struct VasEBoot_term_output *term) { #ifdef MODESET - struct grub_bios_int_registers regs; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + struct VasEBoot_bios_int_registers regs; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; regs.eax = 3; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); #endif - grub_vga_text_cls (term); + VasEBoot_vga_text_cls (term); return 0; } -static struct grub_term_coordinate -grub_vga_text_getwh (struct grub_term_output *term __attribute__ ((unused))) +static struct VasEBoot_term_coordinate +VasEBoot_vga_text_getwh (struct VasEBoot_term_output *term __attribute__ ((unused))) { - return (struct grub_term_coordinate) { 80, 25 }; + return (struct VasEBoot_term_coordinate) { 80, 25 }; } #ifndef MODE_MDA static void -grub_vga_text_setcolorstate (struct grub_term_output *term __attribute__ ((unused)), - grub_term_color_state state) +VasEBoot_vga_text_setcolorstate (struct VasEBoot_term_output *term __attribute__ ((unused)), + VasEBoot_term_color_state state) { switch (state) { - case GRUB_TERM_COLOR_STANDARD: - cur_color = GRUB_TERM_DEFAULT_STANDARD_COLOR & 0x7f; + case VasEBoot_TERM_COLOR_STANDARD: + cur_color = VasEBoot_TERM_DEFAULT_STANDARD_COLOR & 0x7f; break; - case GRUB_TERM_COLOR_NORMAL: - cur_color = grub_term_normal_color & 0x7f; + case VasEBoot_TERM_COLOR_NORMAL: + cur_color = VasEBoot_term_normal_color & 0x7f; break; - case GRUB_TERM_COLOR_HIGHLIGHT: - cur_color = grub_term_highlight_color & 0x7f; + case VasEBoot_TERM_COLOR_HIGHLIGHT: + cur_color = VasEBoot_term_highlight_color & 0x7f; break; default: break; @@ -231,17 +231,17 @@ grub_vga_text_setcolorstate (struct grub_term_output *term __attribute__ ((unuse #else static void -grub_vga_text_setcolorstate (struct grub_term_output *term __attribute__ ((unused)), - grub_term_color_state state) +VasEBoot_vga_text_setcolorstate (struct VasEBoot_term_output *term __attribute__ ((unused)), + VasEBoot_term_color_state state) { switch (state) { - case GRUB_TERM_COLOR_STANDARD: + case VasEBoot_TERM_COLOR_STANDARD: cur_color = 0x07; break; - case GRUB_TERM_COLOR_NORMAL: + case VasEBoot_TERM_COLOR_NORMAL: cur_color = 0x07; break; - case GRUB_TERM_COLOR_HIGHLIGHT: + case VasEBoot_TERM_COLOR_HIGHLIGHT: cur_color = 0x70; break; default: @@ -250,39 +250,39 @@ grub_vga_text_setcolorstate (struct grub_term_output *term __attribute__ ((unuse } #endif -static struct grub_term_output grub_vga_text_term = +static struct VasEBoot_term_output VasEBoot_vga_text_term = { #ifdef MODE_MDA .name = "mda_text", #else .name = "vga_text", #endif - .init = grub_vga_text_init_real, - .fini = grub_vga_text_fini_real, - .putchar = grub_vga_text_putchar, - .getwh = grub_vga_text_getwh, - .getxy = grub_vga_text_getxy, - .gotoxy = grub_vga_text_gotoxy, - .cls = grub_vga_text_cls, - .setcolorstate = grub_vga_text_setcolorstate, - .setcursor = grub_vga_text_setcursor, - .flags = GRUB_TERM_CODE_TYPE_CP437, - .progress_update_divisor = GRUB_PROGRESS_FAST + .init = VasEBoot_vga_text_init_real, + .fini = VasEBoot_vga_text_fini_real, + .putchar = VasEBoot_vga_text_putchar, + .getwh = VasEBoot_vga_text_getwh, + .getxy = VasEBoot_vga_text_getxy, + .gotoxy = VasEBoot_vga_text_gotoxy, + .cls = VasEBoot_vga_text_cls, + .setcolorstate = VasEBoot_vga_text_setcolorstate, + .setcursor = VasEBoot_vga_text_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_CP437, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; #ifndef MODE_MDA -GRUB_MOD_INIT(vga_text) +VasEBoot_MOD_INIT(vga_text) { -#ifdef GRUB_MACHINE_COREBOOT - if (!grub_video_coreboot_fbtable) +#ifdef VasEBoot_MACHINE_COREBOOT + if (!VasEBoot_video_coreboot_fbtable) #endif - grub_term_register_output ("vga_text", &grub_vga_text_term); + VasEBoot_term_register_output ("vga_text", &VasEBoot_vga_text_term); } -GRUB_MOD_FINI(vga_text) +VasEBoot_MOD_FINI(vga_text) { - grub_term_unregister_output (&grub_vga_text_term); + VasEBoot_term_unregister_output (&VasEBoot_vga_text_term); } #endif diff --git a/VasEBoot-core/term/ieee1275/console.c b/VasEBoot-core/term/ieee1275/console.c index 7e797a7d4..5d1cf44d1 100644 --- a/VasEBoot-core/term/ieee1275/console.c +++ b/VasEBoot-core/term/ieee1275/console.c @@ -1,35 +1,35 @@ -/* console.c -- Open Firmware console for GRUB. */ +/* console.c -- Open Firmware console for VasEBoot. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -static grub_ieee1275_ihandle_t stdout_ihandle; -static grub_ieee1275_ihandle_t stdin_ihandle; +static VasEBoot_ieee1275_ihandle_t stdout_ihandle; +static VasEBoot_ieee1275_ihandle_t stdin_ihandle; -extern struct grub_terminfo_output_state grub_console_terminfo_output; +extern struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output; struct color { @@ -54,214 +54,214 @@ static struct color colors[] = }; static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { char chr = c; - grub_ieee1275_write (stdout_ihandle, &chr, 1, 0); + VasEBoot_ieee1275_write (stdout_ihandle, &chr, 1, 0); } static int -readkey (struct grub_term_input *term __attribute__ ((unused))) +readkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { - grub_uint8_t c; - grub_ssize_t actual = 0; + VasEBoot_uint8_t c; + VasEBoot_ssize_t actual = 0; - grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); + VasEBoot_ieee1275_read (stdin_ihandle, &c, 1, &actual); if (actual > 0) return c; return -1; } static void -grub_console_dimensions (void) +VasEBoot_console_dimensions (void) { - grub_ieee1275_ihandle_t options; - grub_ieee1275_phandle_t stdout_phandle; + VasEBoot_ieee1275_ihandle_t options; + VasEBoot_ieee1275_phandle_t stdout_phandle; char val[1024]; /* Always assume 80x24 on serial since screen-#rows/screen-#columns is often garbage for such devices. */ - if (! grub_ieee1275_instance_to_package (stdout_ihandle, + if (! VasEBoot_ieee1275_instance_to_package (stdout_ihandle, &stdout_phandle) - && ! grub_ieee1275_package_to_path (stdout_phandle, + && ! VasEBoot_ieee1275_package_to_path (stdout_phandle, val, sizeof (val) - 1, 0)) { - grub_ieee1275_ihandle_t stdout_options; + VasEBoot_ieee1275_ihandle_t stdout_options; val[sizeof (val) - 1] = 0; - if (! grub_ieee1275_finddevice (val, &stdout_options) - && ! grub_ieee1275_get_property (stdout_options, "device_type", + if (! VasEBoot_ieee1275_finddevice (val, &stdout_options) + && ! VasEBoot_ieee1275_get_property (stdout_options, "device_type", val, sizeof (val) - 1, 0)) { val[sizeof (val) - 1] = 0; - if (grub_strcmp (val, "serial") == 0) + if (VasEBoot_strcmp (val, "serial") == 0) { - grub_console_terminfo_output.size.x = 80; - grub_console_terminfo_output.size.y = 24; + VasEBoot_console_terminfo_output.size.x = 80; + VasEBoot_console_terminfo_output.size.y = 24; return; } } } - if (! grub_ieee1275_finddevice ("/options", &options) - && options != (grub_ieee1275_ihandle_t) -1) + if (! VasEBoot_ieee1275_finddevice ("/options", &options) + && options != (VasEBoot_ieee1275_ihandle_t) -1) { - if (! grub_ieee1275_get_property (options, "screen-#columns", + if (! VasEBoot_ieee1275_get_property (options, "screen-#columns", val, sizeof (val) - 1, 0)) { val[sizeof (val) - 1] = 0; - grub_console_terminfo_output.size.x - = (grub_uint8_t) grub_strtoul (val, 0, 10); + VasEBoot_console_terminfo_output.size.x + = (VasEBoot_uint8_t) VasEBoot_strtoul (val, 0, 10); } - if (! grub_ieee1275_get_property (options, "screen-#rows", + if (! VasEBoot_ieee1275_get_property (options, "screen-#rows", val, sizeof (val) - 1, 0)) { val[sizeof (val) - 1] = 0; - grub_console_terminfo_output.size.y - = (grub_uint8_t) grub_strtoul (val, 0, 10); + VasEBoot_console_terminfo_output.size.y + = (VasEBoot_uint8_t) VasEBoot_strtoul (val, 0, 10); } } /* Bogus default value on SLOF in QEMU. */ - if (grub_console_terminfo_output.size.x == 200 - && grub_console_terminfo_output.size.y == 200) + if (VasEBoot_console_terminfo_output.size.x == 200 + && VasEBoot_console_terminfo_output.size.y == 200) { - grub_console_terminfo_output.size.x = 80; - grub_console_terminfo_output.size.y = 24; + VasEBoot_console_terminfo_output.size.x = 80; + VasEBoot_console_terminfo_output.size.y = 24; } /* Use a small console by default. */ - if (! grub_console_terminfo_output.size.x) - grub_console_terminfo_output.size.x = 80; - if (! grub_console_terminfo_output.size.y) - grub_console_terminfo_output.size.y = 24; + if (! VasEBoot_console_terminfo_output.size.x) + VasEBoot_console_terminfo_output.size.x = 80; + if (! VasEBoot_console_terminfo_output.size.y) + VasEBoot_console_terminfo_output.size.y = 24; } static void -grub_console_setcursor (struct grub_term_output *term, +VasEBoot_console_setcursor (struct VasEBoot_term_output *term, int on) { - grub_terminfo_setcursor (term, on); + VasEBoot_terminfo_setcursor (term, on); - if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_HAS_CURSORONOFF)) + if (!VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_HAS_CURSORONOFF)) return; /* Understood by the Open Firmware flavour in OLPC. */ if (on) - grub_ieee1275_interpret ("cursor-on", 0); + VasEBoot_ieee1275_interpret ("cursor-on", 0); else - grub_ieee1275_interpret ("cursor-off", 0); + VasEBoot_ieee1275_interpret ("cursor-off", 0); } -static grub_err_t -grub_console_init_input (struct grub_term_input *term) +static VasEBoot_err_t +VasEBoot_console_init_input (struct VasEBoot_term_input *term) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdin", &stdin_ihandle, + if (VasEBoot_ieee1275_get_integer_property (VasEBoot_ieee1275_chosen, "stdin", &stdin_ihandle, sizeof stdin_ihandle, &actual) || actual != sizeof stdin_ihandle) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot find stdin"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "cannot find stdin"); - return grub_terminfo_input_init (term); + return VasEBoot_terminfo_input_init (term); } -static grub_err_t -grub_console_init_output (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_console_init_output (struct VasEBoot_term_output *term) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; /* The latest PowerMacs don't actually initialize the screen for us, so we * use this trick to re-open the output device (but we avoid doing this on * platforms where it's known to be broken). */ - if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT)) - grub_ieee1275_interpret ("output-device output", 0); + if (! VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_BROKEN_OUTPUT)) + VasEBoot_ieee1275_interpret ("output-device output", 0); - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdout", &stdout_ihandle, + if (VasEBoot_ieee1275_get_integer_property (VasEBoot_ieee1275_chosen, "stdout", &stdout_ihandle, sizeof stdout_ihandle, &actual) || actual != sizeof stdout_ihandle) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot find stdout"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "cannot find stdout"); /* Initialize colors. */ - if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS)) + if (! VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_CANNOT_SET_COLORS)) { unsigned col; for (col = 0; col < ARRAY_SIZE (colors); col++) - grub_ieee1275_set_color (stdout_ihandle, col, colors[col].red, + VasEBoot_ieee1275_set_color (stdout_ihandle, col, colors[col].red, colors[col].green, colors[col].blue); /* Set the right fg and bg colors. */ - grub_terminfo_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); + VasEBoot_terminfo_setcolorstate (term, VasEBoot_TERM_COLOR_NORMAL); } - grub_console_dimensions (); + VasEBoot_console_dimensions (); - grub_terminfo_output_init (term); + VasEBoot_terminfo_output_init (term); return 0; } -struct grub_terminfo_input_state grub_console_terminfo_input = +struct VasEBoot_terminfo_input_state VasEBoot_console_terminfo_input = { .readkey = readkey }; -struct grub_terminfo_output_state grub_console_terminfo_output = +struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output = { .put = put, .size = { 80, 24 } }; -static struct grub_term_input grub_console_term_input = +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", - .init = grub_console_init_input, - .getkey = grub_terminfo_getkey, - .data = &grub_console_terminfo_input + .init = VasEBoot_console_init_input, + .getkey = VasEBoot_terminfo_getkey, + .data = &VasEBoot_console_terminfo_input }; -static struct grub_term_output grub_console_term_output = +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", - .init = grub_console_init_output, - .putchar = grub_terminfo_putchar, - .getxy = grub_terminfo_getxy, - .getwh = grub_terminfo_getwh, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_console_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, - .data = &grub_console_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_FAST + .init = VasEBoot_console_init_output, + .putchar = VasEBoot_terminfo_putchar, + .getxy = VasEBoot_terminfo_getxy, + .getwh = VasEBoot_terminfo_getwh, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_console_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, + .data = &VasEBoot_console_terminfo_output, + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init_early (void) +VasEBoot_console_init_early (void) { - grub_term_register_input ("console", &grub_console_term_input); - grub_term_register_output ("console", &grub_console_term_output); + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); } void -grub_console_init_lately (void) +VasEBoot_console_init_lately (void) { const char *type; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI)) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_NO_ANSI)) type = "dumb"; - else if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN)) + else if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN)) type = "ieee1275-nocursor"; else type = "ieee1275"; - grub_terminfo_init (); - grub_terminfo_output_register (&grub_console_term_output, type); + VasEBoot_terminfo_init (); + VasEBoot_terminfo_output_register (&VasEBoot_console_term_output, type); } void -grub_console_fini (void) +VasEBoot_console_fini (void) { } diff --git a/VasEBoot-core/term/ieee1275/escc.c b/VasEBoot-core/term/ieee1275/escc.c index e605ff25e..b8d8ab33e 100644 --- a/VasEBoot-core/term/ieee1275/escc.c +++ b/VasEBoot-core/term/ieee1275/escc.c @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -struct grub_escc_descriptor +struct VasEBoot_escc_descriptor { - volatile grub_uint8_t *escc_ctrl; - volatile grub_uint8_t *escc_data; + volatile VasEBoot_uint8_t *escc_ctrl; + volatile VasEBoot_uint8_t *escc_data; }; static void -do_real_config (struct grub_serial_port *port) +do_real_config (struct VasEBoot_serial_port *port) { - grub_uint8_t bitsspec; - grub_uint8_t parity_stop_spec; + VasEBoot_uint8_t bitsspec; + VasEBoot_uint8_t parity_stop_spec; if (port->configured) return; @@ -69,26 +69,26 @@ do_real_config (struct grub_serial_port *port) parity_stop_spec = 0; switch (port->config.parity) { - case GRUB_SERIAL_PARITY_NONE: + case VasEBoot_SERIAL_PARITY_NONE: parity_stop_spec |= 0; break; - case GRUB_SERIAL_PARITY_ODD: + case VasEBoot_SERIAL_PARITY_ODD: parity_stop_spec |= 1; break; - case GRUB_SERIAL_PARITY_EVEN: + case VasEBoot_SERIAL_PARITY_EVEN: parity_stop_spec |= 3; break; } switch (port->config.stop_bits) { - case GRUB_SERIAL_STOP_BITS_1: + case VasEBoot_SERIAL_STOP_BITS_1: parity_stop_spec |= 0x4; break; - case GRUB_SERIAL_STOP_BITS_1_5: + case VasEBoot_SERIAL_STOP_BITS_1_5: parity_stop_spec |= 0x8; break; - case GRUB_SERIAL_STOP_BITS_2: + case VasEBoot_SERIAL_STOP_BITS_2: parity_stop_spec |= 0xc; break; } @@ -109,7 +109,7 @@ do_real_config (struct grub_serial_port *port) /* Fetch a key. */ static int -serial_hw_fetch (struct grub_serial_port *port) +serial_hw_fetch (struct VasEBoot_serial_port *port) { do_real_config (port); @@ -121,25 +121,25 @@ serial_hw_fetch (struct grub_serial_port *port) /* Put a character. */ static void -serial_hw_put (struct grub_serial_port *port, const int c) +serial_hw_put (struct VasEBoot_serial_port *port, const int c) { - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; do_real_config (port); if (port->broken > 5) - endtime = grub_get_time_ms (); + endtime = VasEBoot_get_time_ms (); else if (port->broken > 1) - endtime = grub_get_time_ms () + 50; + endtime = VasEBoot_get_time_ms () + 50; else - endtime = grub_get_time_ms () + 200; + endtime = VasEBoot_get_time_ms () + 200; /* Wait until the transmitter holding register is empty. */ while (1) { *port->escc_desc->escc_ctrl = 0; if (*port->escc_desc->escc_ctrl & 4) break; - if (grub_get_time_ms () > endtime) + if (VasEBoot_get_time_ms () > endtime) { port->broken++; /* There is something wrong. But what can I do? */ @@ -160,28 +160,28 @@ serial_hw_put (struct grub_serial_port *port, const int c) STOP_BIT_LEN is the length of the stop bit. The possible values for WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as macros. */ -static grub_err_t -serial_hw_configure (struct grub_serial_port *port __attribute__ ((unused)), - struct grub_serial_config *config __attribute__ ((unused))) +static VasEBoot_err_t +serial_hw_configure (struct VasEBoot_serial_port *port __attribute__ ((unused)), + struct VasEBoot_serial_config *config __attribute__ ((unused))) { if (config->speed != 38400 && config->speed != 57600) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port speed")); - if (config->parity != GRUB_SERIAL_PARITY_NONE - && config->parity != GRUB_SERIAL_PARITY_ODD - && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->parity != VasEBoot_SERIAL_PARITY_NONE + && config->parity != VasEBoot_SERIAL_PARITY_ODD + && config->parity != VasEBoot_SERIAL_PARITY_EVEN) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); - if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_1_5 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1_5 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_2) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port word length")); port->config = *config; @@ -189,131 +189,131 @@ serial_hw_configure (struct grub_serial_port *port __attribute__ ((unused)), /* FIXME: should check if the serial terminal was found. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_serial_driver grub_escc_driver = +struct VasEBoot_serial_driver VasEBoot_escc_driver = { .configure = serial_hw_configure, .fetch = serial_hw_fetch, .put = serial_hw_put }; -static struct grub_escc_descriptor escc_descs[2]; +static struct VasEBoot_escc_descriptor escc_descs[2]; static char *macio = 0; static void -add_device (grub_addr_t addr, int channel) +add_device (VasEBoot_addr_t addr, int channel) { - struct grub_serial_port *port; - grub_err_t err; - struct grub_serial_config config = + struct VasEBoot_serial_port *port; + VasEBoot_err_t err; + struct VasEBoot_serial_config config = { .speed = 38400, .word_len = 8, - .parity = GRUB_SERIAL_PARITY_NONE, - .stop_bits = GRUB_SERIAL_STOP_BITS_1 + .parity = VasEBoot_SERIAL_PARITY_NONE, + .stop_bits = VasEBoot_SERIAL_STOP_BITS_1 }; escc_descs[channel].escc_ctrl - = (volatile grub_uint8_t *) (grub_addr_t) addr; + = (volatile VasEBoot_uint8_t *) (VasEBoot_addr_t) addr; escc_descs[channel].escc_data = escc_descs[channel].escc_ctrl + 16; - port = grub_zalloc (sizeof (*port)); + port = VasEBoot_zalloc (sizeof (*port)); if (!port) { - grub_errno = 0; + VasEBoot_errno = 0; return; } - port->name = grub_xasprintf ("escc-ch-%c", channel + 'a'); + port->name = VasEBoot_xasprintf ("escc-ch-%c", channel + 'a'); if (!port->name) { - grub_errno = 0; + VasEBoot_errno = 0; return; } port->escc_desc = &escc_descs[channel]; - port->driver = &grub_escc_driver; + port->driver = &VasEBoot_escc_driver; err = port->driver->configure (port, &config); if (err) - grub_print_error (); + VasEBoot_print_error (); - grub_serial_register (port); + VasEBoot_serial_register (port); } static int -find_macio (struct grub_ieee1275_devalias *alias) +find_macio (struct VasEBoot_ieee1275_devalias *alias) { - if (grub_strcmp (alias->type, "mac-io") != 0) + if (VasEBoot_strcmp (alias->type, "mac-io") != 0) return 0; - macio = grub_strdup (alias->path); + macio = VasEBoot_strdup (alias->path); return 1; } -GRUB_MOD_INIT (escc) +VasEBoot_MOD_INIT (escc) { - grub_uint32_t macio_addr[4]; - grub_uint32_t escc_addr[2]; - grub_ieee1275_phandle_t dev; - struct grub_ieee1275_devalias alias; + VasEBoot_uint32_t macio_addr[4]; + VasEBoot_uint32_t escc_addr[2]; + VasEBoot_ieee1275_phandle_t dev; + struct VasEBoot_ieee1275_devalias alias; char *escc = 0; - grub_ieee1275_devices_iterate (find_macio); + VasEBoot_ieee1275_devices_iterate (find_macio); if (!macio) return; FOR_IEEE1275_DEVCHILDREN(macio, alias) - if (grub_strcmp (alias.type, "escc") == 0) + if (VasEBoot_strcmp (alias.type, "escc") == 0) { - escc = grub_strdup (alias.path); + escc = VasEBoot_strdup (alias.path); break; } - grub_ieee1275_devalias_free (&alias); + VasEBoot_ieee1275_devalias_free (&alias); if (!escc) { - grub_free (macio); + VasEBoot_free (macio); return; } - if (grub_ieee1275_finddevice (macio, &dev)) + if (VasEBoot_ieee1275_finddevice (macio, &dev)) { - grub_free (macio); - grub_free (escc); + VasEBoot_free (macio); + VasEBoot_free (escc); return; } - if (grub_ieee1275_get_integer_property (dev, "assigned-addresses", + if (VasEBoot_ieee1275_get_integer_property (dev, "assigned-addresses", macio_addr, sizeof (macio_addr), 0)) { - grub_free (macio); - grub_free (escc); + VasEBoot_free (macio); + VasEBoot_free (escc); return; } - if (grub_ieee1275_finddevice (escc, &dev)) + if (VasEBoot_ieee1275_finddevice (escc, &dev)) { - grub_free (macio); - grub_free (escc); + VasEBoot_free (macio); + VasEBoot_free (escc); return; } - if (grub_ieee1275_get_integer_property (dev, "reg", + if (VasEBoot_ieee1275_get_integer_property (dev, "reg", escc_addr, sizeof (escc_addr), 0)) { - grub_free (macio); - grub_free (escc); + VasEBoot_free (macio); + VasEBoot_free (escc); return; } add_device (macio_addr[2] + escc_addr[0] + 32, 0); add_device (macio_addr[2] + escc_addr[0], 1); - grub_free (macio); - grub_free (escc); + VasEBoot_free (macio); + VasEBoot_free (escc); } -GRUB_MOD_FINI (escc) +VasEBoot_MOD_FINI (escc) { } diff --git a/VasEBoot-core/term/ieee1275/serial.c b/VasEBoot-core/term/ieee1275/serial.c index 9e71ca4b8..2f98c5c63 100644 --- a/VasEBoot-core/term/ieee1275/serial.c +++ b/VasEBoot-core/term/ieee1275/serial.c @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0) +#define IEEE1275_IHANDLE_INVALID ((VasEBoot_ieee1275_cell_t) 0) struct ofserial_hash_ent { @@ -37,13 +37,13 @@ struct ofserial_hash_ent }; static void -do_real_config (struct grub_serial_port *port) +do_real_config (struct VasEBoot_serial_port *port) { if (port->configured) return; - if (grub_ieee1275_open (port->elem->devpath, &port->handle) - || port->handle == (grub_ieee1275_ihandle_t) -1) + if (VasEBoot_ieee1275_open (port->elem->devpath, &port->handle) + || port->handle == (VasEBoot_ieee1275_ihandle_t) -1) port->handle = IEEE1275_IHANDLE_INVALID; port->configured = 1; @@ -51,16 +51,16 @@ do_real_config (struct grub_serial_port *port) /* Fetch a key. */ static int -serial_hw_fetch (struct grub_serial_port *port) +serial_hw_fetch (struct VasEBoot_serial_port *port) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; char c; do_real_config (port); if (port->handle == IEEE1275_IHANDLE_INVALID) return -1; - grub_ieee1275_read (port->handle, &c, 1, &actual); + VasEBoot_ieee1275_read (port->handle, &c, 1, &actual); if (actual <= 0) return -1; @@ -69,9 +69,9 @@ serial_hw_fetch (struct grub_serial_port *port) /* Put a character. */ static void -serial_hw_put (struct grub_serial_port *port, const int c) +serial_hw_put (struct VasEBoot_serial_port *port, const int c) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; char c0 = c; do_real_config (port); @@ -79,7 +79,7 @@ serial_hw_put (struct grub_serial_port *port, const int c) if (port->handle == IEEE1275_IHANDLE_INVALID) return; - grub_ieee1275_write (port->handle, &c0, 1, &actual); + VasEBoot_ieee1275_write (port->handle, &c0, 1, &actual); } /* Initialize a serial device. PORT is the port number for a serial device. @@ -89,16 +89,16 @@ serial_hw_put (struct grub_serial_port *port, const int c) STOP_BIT_LEN is the length of the stop bit. The possible values for WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as macros. */ -static grub_err_t -serial_hw_configure (struct grub_serial_port *port __attribute__ ((unused)), - struct grub_serial_config *config __attribute__ ((unused))) +static VasEBoot_err_t +serial_hw_configure (struct VasEBoot_serial_port *port __attribute__ ((unused)), + struct VasEBoot_serial_config *config __attribute__ ((unused))) { /* FIXME: no IEEE1275 serial config available. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_serial_driver grub_ofserial_driver = +struct VasEBoot_serial_driver VasEBoot_ofserial_driver = { .configure = serial_hw_configure, .fetch = serial_hw_fetch, @@ -124,7 +124,7 @@ ofserial_hash_find (const char *devpath) while (p) { - if (!grub_strcmp (p->devpath, devpath)) + if (!VasEBoot_strcmp (p->devpath, devpath)) break; p = p->next; } @@ -137,7 +137,7 @@ ofserial_hash_add_real (char *devpath) struct ofserial_hash_ent *p; struct ofserial_hash_ent **head = &ofserial_hash[ofserial_hash_fn(devpath)]; - p = grub_malloc(sizeof (*p)); + p = VasEBoot_malloc(sizeof (*p)); if (!p) return NULL; @@ -155,7 +155,7 @@ ofserial_hash_add (char *devpath, char *curcan) p = ofserial_hash_add_real (devpath); - grub_dprintf ("serial", "devpath = %s, canonical = %s\n", devpath, curcan); + VasEBoot_dprintf ("serial", "devpath = %s, canonical = %s\n", devpath, curcan); if (!curcan) { @@ -167,14 +167,14 @@ ofserial_hash_add (char *devpath, char *curcan) if (!pcan) pcan = ofserial_hash_add_real (curcan); else - grub_free (curcan); + VasEBoot_free (curcan); if (!pcan) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; else { if (!pcan->shortest - || grub_strlen (pcan->shortest) > grub_strlen (devpath)) + || VasEBoot_strlen (pcan->shortest) > VasEBoot_strlen (devpath)) pcan->shortest = devpath; } @@ -182,27 +182,27 @@ ofserial_hash_add (char *devpath, char *curcan) } static void -dev_iterate_real (struct grub_ieee1275_devalias *alias, +dev_iterate_real (struct VasEBoot_ieee1275_devalias *alias, int use_name) { struct ofserial_hash_ent *op; - if (grub_strcmp (alias->type, "serial") != 0) + if (VasEBoot_strcmp (alias->type, "serial") != 0) return; - grub_dprintf ("serial", "serial name = %s, path = %s\n", alias->name, + VasEBoot_dprintf ("serial", "serial name = %s, path = %s\n", alias->name, alias->path); op = ofserial_hash_find (alias->path); if (!op) { - char *name = grub_strdup (use_name ? alias->name : alias->path); - char *can = grub_strdup (alias->path); + char *name = VasEBoot_strdup (use_name ? alias->name : alias->path); + char *can = VasEBoot_strdup (alias->path); if (!name || !can) { - grub_errno = GRUB_ERR_NONE; - grub_free (name); - grub_free (can); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_free (name); + VasEBoot_free (can); return; } op = ofserial_hash_add (name, can); @@ -211,7 +211,7 @@ dev_iterate_real (struct grub_ieee1275_devalias *alias, } static int -dev_iterate (struct grub_ieee1275_devalias *alias) +dev_iterate (struct VasEBoot_ieee1275_devalias *alias) { dev_iterate_real (alias, 0); return 0; @@ -220,45 +220,45 @@ dev_iterate (struct grub_ieee1275_devalias *alias) static const char * add_port (struct ofserial_hash_ent *ent) { - struct grub_serial_port *port; + struct VasEBoot_serial_port *port; char *ptr; - grub_err_t err; + VasEBoot_err_t err; if (!ent->shortest) return NULL; - port = grub_zalloc (sizeof (*port)); + port = VasEBoot_zalloc (sizeof (*port)); if (!port) return NULL; - port->name = grub_malloc (sizeof ("ieee1275/") - + grub_strlen (ent->shortest)); + port->name = VasEBoot_malloc (sizeof ("ieee1275/") + + VasEBoot_strlen (ent->shortest)); port->elem = ent; if (!port->name) return NULL; - ptr = grub_stpcpy (port->name, "ieee1275/"); - grub_strcpy (ptr, ent->shortest); + ptr = VasEBoot_stpcpy (port->name, "ieee1275/"); + VasEBoot_strcpy (ptr, ent->shortest); - port->driver = &grub_ofserial_driver; - err = grub_serial_config_defaults (port); + port->driver = &VasEBoot_ofserial_driver; + err = VasEBoot_serial_config_defaults (port); if (err) - grub_print_error (); + VasEBoot_print_error (); - grub_serial_register (port); + VasEBoot_serial_register (port); return port->name; } const char * -grub_ofserial_add_port (const char *path) +VasEBoot_ofserial_add_port (const char *path) { struct ofserial_hash_ent *ent; - char *name = grub_strdup (path); - char *can = grub_strdup (path); + char *name = VasEBoot_strdup (path); + char *can = VasEBoot_strdup (path); if (!name || ! can) { - grub_free (name); - grub_free (can); + VasEBoot_free (name); + VasEBoot_free (can); return NULL; } @@ -267,15 +267,15 @@ grub_ofserial_add_port (const char *path) } void -grub_ofserial_init (void) +VasEBoot_ofserial_init (void) { unsigned i; - struct grub_ieee1275_devalias alias; + struct VasEBoot_ieee1275_devalias alias; FOR_IEEE1275_DEVALIASES(alias) dev_iterate_real (&alias, 1); - grub_ieee1275_devices_iterate (dev_iterate); + VasEBoot_ieee1275_devices_iterate (dev_iterate); for (i = 0; i < ARRAY_SIZE (ofserial_hash); i++) { diff --git a/VasEBoot-core/term/morse.c b/VasEBoot-core/term/morse.c index 13b8e863e..d5e74b637 100644 --- a/VasEBoot-core/term/morse.c +++ b/VasEBoot-core/term/morse.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define BASE_TIME 250 #define DIH 1 @@ -72,31 +72,31 @@ static const char codes[0x80][6] = }; static void -grub_audio_tone (int length) +VasEBoot_audio_tone (int length) { - grub_speaker_beep_on (1000); - grub_millisleep (length); - grub_speaker_beep_off (); + VasEBoot_speaker_beep_on (1000); + VasEBoot_millisleep (length); + VasEBoot_speaker_beep_off (); } static void -grub_audio_putchar (struct grub_term_output *term __attribute__ ((unused)), - const struct grub_unicode_glyph *c_in) +VasEBoot_audio_putchar (struct VasEBoot_term_output *term __attribute__ ((unused)), + const struct VasEBoot_unicode_glyph *c_in) { - grub_uint8_t c; + VasEBoot_uint8_t c; int i; /* For now, do not try to use a surrogate pair. */ if (c_in->base > 0x7f) c = '?'; else - c = grub_tolower (c_in->base); + c = VasEBoot_tolower (c_in->base); for (i = 0; codes[c][i]; i++) { - grub_audio_tone (codes[c][i] * BASE_TIME); - grub_millisleep (BASE_TIME); + VasEBoot_audio_tone (codes[c][i] * BASE_TIME); + VasEBoot_millisleep (BASE_TIME); } - grub_millisleep (2 * BASE_TIME); + VasEBoot_millisleep (2 * BASE_TIME); } @@ -106,28 +106,28 @@ dummy (void) return 0; } -static struct grub_term_output grub_audio_term_output = +static struct VasEBoot_term_output VasEBoot_audio_term_output = { .name = "morse", .init = (void *) dummy, .fini = (void *) dummy, - .putchar = grub_audio_putchar, + .putchar = VasEBoot_audio_putchar, .getwh = (void *) dummy, .getxy = (void *) dummy, .gotoxy = (void *) dummy, .cls = (void *) dummy, .setcolorstate = (void *) dummy, .setcursor = (void *) dummy, - .flags = GRUB_TERM_CODE_TYPE_ASCII | GRUB_TERM_DUMB, - .progress_update_divisor = GRUB_PROGRESS_NO_UPDATE + .flags = VasEBoot_TERM_CODE_TYPE_ASCII | VasEBoot_TERM_DUMB, + .progress_update_divisor = VasEBoot_PROGRESS_NO_UPDATE }; -GRUB_MOD_INIT (morse) +VasEBoot_MOD_INIT (morse) { - grub_term_register_output ("audio", &grub_audio_term_output); + VasEBoot_term_register_output ("audio", &VasEBoot_audio_term_output); } -GRUB_MOD_FINI (morse) +VasEBoot_MOD_FINI (morse) { - grub_term_unregister_output (&grub_audio_term_output); + VasEBoot_term_unregister_output (&VasEBoot_audio_term_output); } diff --git a/VasEBoot-core/term/ns8250.c b/VasEBoot-core/term/ns8250.c index 39809d042..d7f08bde0 100644 --- a/VasEBoot-core/term/ns8250.c +++ b/VasEBoot-core/term/ns8250.c @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_MACHINE_PCBIOS -#include -static const unsigned short *serial_hw_io_addr = (const unsigned short *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; -#define GRUB_SERIAL_PORT_NUM 4 +#ifdef VasEBoot_MACHINE_PCBIOS +#include +static const unsigned short *serial_hw_io_addr = (const unsigned short *) VasEBoot_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; +#define VasEBoot_SERIAL_PORT_NUM 4 #else -#include -static const grub_port_t serial_hw_io_addr[] = GRUB_MACHINE_SERIAL_PORTS; -#define GRUB_SERIAL_PORT_NUM (ARRAY_SIZE(serial_hw_io_addr)) +#include +static const VasEBoot_port_t serial_hw_io_addr[] = VasEBoot_MACHINE_SERIAL_PORTS; +#define VasEBoot_SERIAL_PORT_NUM (ARRAY_SIZE(serial_hw_io_addr)) #endif static int dead_ports = 0; -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON #define DEFAULT_BASE_CLOCK (2 * 115200) #else #define DEFAULT_BASE_CLOCK 115200 @@ -47,12 +47,12 @@ static int dead_ports = 0; /* Convert speed to divisor. */ static unsigned short -serial_get_divisor (const struct grub_serial_port *port __attribute__ ((unused)), - const struct grub_serial_config *config) +serial_get_divisor (const struct VasEBoot_serial_port *port __attribute__ ((unused)), + const struct VasEBoot_serial_config *config) { - grub_uint32_t base_clock; - grub_uint32_t divisor; - grub_uint32_t actual_speed, error; + VasEBoot_uint32_t base_clock; + VasEBoot_uint32_t divisor; + VasEBoot_uint32_t actual_speed, error; base_clock = config->base_clock ? (config->base_clock >> 4) : DEFAULT_BASE_CLOCK; @@ -70,20 +70,20 @@ serial_get_divisor (const struct grub_serial_port *port __attribute__ ((unused)) } static void -do_real_config (struct grub_serial_port *port) +do_real_config (struct VasEBoot_serial_port *port) { int divisor; unsigned char status = 0; - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; const unsigned char parities[] = { - [GRUB_SERIAL_PARITY_NONE] = UART_NO_PARITY, - [GRUB_SERIAL_PARITY_ODD] = UART_ODD_PARITY, - [GRUB_SERIAL_PARITY_EVEN] = UART_EVEN_PARITY + [VasEBoot_SERIAL_PARITY_NONE] = UART_NO_PARITY, + [VasEBoot_SERIAL_PARITY_ODD] = UART_ODD_PARITY, + [VasEBoot_SERIAL_PARITY_EVEN] = UART_EVEN_PARITY }; const unsigned char stop_bits[] = { - [GRUB_SERIAL_STOP_BITS_1] = UART_1_STOP_BIT, - [GRUB_SERIAL_STOP_BITS_2] = UART_2_STOP_BITS, + [VasEBoot_SERIAL_STOP_BITS_1] = UART_1_STOP_BIT, + [VasEBoot_SERIAL_STOP_BITS_2] = UART_2_STOP_BITS, }; if (port->configured) @@ -94,44 +94,44 @@ do_real_config (struct grub_serial_port *port) divisor = serial_get_divisor (port, &port->config); /* Turn off the interrupt. */ - grub_outb (0, port->port + UART_IER); + VasEBoot_outb (0, port->port + UART_IER); /* Set DLAB. */ - grub_outb (UART_DLAB, port->port + UART_LCR); + VasEBoot_outb (UART_DLAB, port->port + UART_LCR); /* Set the baud rate. */ - grub_outb (divisor & 0xFF, port->port + UART_DLL); - grub_outb (divisor >> 8, port->port + UART_DLH); + VasEBoot_outb (divisor & 0xFF, port->port + UART_DLL); + VasEBoot_outb (divisor >> 8, port->port + UART_DLH); /* Set the line status. */ status |= (parities[port->config.parity] | (port->config.word_len - 5) | stop_bits[port->config.stop_bits]); - grub_outb (status, port->port + UART_LCR); + VasEBoot_outb (status, port->port + UART_LCR); if (port->config.rtscts) { /* Enable the FIFO. */ - grub_outb (UART_ENABLE_FIFO_TRIGGER1, port->port + UART_FCR); + VasEBoot_outb (UART_ENABLE_FIFO_TRIGGER1, port->port + UART_FCR); /* Turn on DTR and RTS. */ - grub_outb (UART_ENABLE_DTRRTS, port->port + UART_MCR); + VasEBoot_outb (UART_ENABLE_DTRRTS, port->port + UART_MCR); } else { /* Enable the FIFO. */ - grub_outb (UART_ENABLE_FIFO_TRIGGER14, port->port + UART_FCR); + VasEBoot_outb (UART_ENABLE_FIFO_TRIGGER14, port->port + UART_FCR); /* Turn on DTR, RTS, and OUT2. */ - grub_outb (UART_ENABLE_DTRRTS | UART_ENABLE_OUT2, port->port + UART_MCR); + VasEBoot_outb (UART_ENABLE_DTRRTS | UART_ENABLE_OUT2, port->port + UART_MCR); } /* Drain the input buffer. */ - endtime = grub_get_time_ms () + 1000; - while (grub_inb (port->port + UART_LSR) & UART_DATA_READY) + endtime = VasEBoot_get_time_ms () + 1000; + while (VasEBoot_inb (port->port + UART_LSR) & UART_DATA_READY) { - grub_inb (port->port + UART_RX); - if (grub_get_time_ms () > endtime) + VasEBoot_inb (port->port + UART_RX); + if (VasEBoot_get_time_ms () > endtime) { port->broken = 1; break; @@ -143,33 +143,33 @@ do_real_config (struct grub_serial_port *port) /* Fetch a key. */ static int -serial_hw_fetch (struct grub_serial_port *port) +serial_hw_fetch (struct VasEBoot_serial_port *port) { do_real_config (port); - if (grub_inb (port->port + UART_LSR) & UART_DATA_READY) - return grub_inb (port->port + UART_RX); + if (VasEBoot_inb (port->port + UART_LSR) & UART_DATA_READY) + return VasEBoot_inb (port->port + UART_RX); return -1; } /* Put a character. */ static void -serial_hw_put (struct grub_serial_port *port, const int c) +serial_hw_put (struct VasEBoot_serial_port *port, const int c) { - grub_uint64_t endtime; + VasEBoot_uint64_t endtime; do_real_config (port); if (port->broken > 5) - endtime = grub_get_time_ms (); + endtime = VasEBoot_get_time_ms (); else if (port->broken > 1) - endtime = grub_get_time_ms () + 50; + endtime = VasEBoot_get_time_ms () + 50; else - endtime = grub_get_time_ms () + 200; + endtime = VasEBoot_get_time_ms () + 200; /* Wait until the transmitter holding register is empty. */ - while ((grub_inb (port->port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0) + while ((VasEBoot_inb (port->port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0) { - if (grub_get_time_ms () > endtime) + if (VasEBoot_get_time_ms () > endtime) { port->broken++; /* There is something wrong. But what can I do? */ @@ -180,7 +180,7 @@ serial_hw_put (struct grub_serial_port *port, const int c) if (port->broken) port->broken--; - grub_outb (c, port->port + UART_TX); + VasEBoot_outb (c, port->port + UART_TX); } /* Initialize a serial device. PORT is the port number for a serial device. @@ -190,30 +190,30 @@ serial_hw_put (struct grub_serial_port *port, const int c) STOP_BIT_LEN is the length of the stop bit. The possible values for WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as macros. */ -static grub_err_t -serial_hw_configure (struct grub_serial_port *port, - struct grub_serial_config *config) +static VasEBoot_err_t +serial_hw_configure (struct VasEBoot_serial_port *port, + struct VasEBoot_serial_config *config) { unsigned short divisor; divisor = serial_get_divisor (port, config); if (divisor == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port speed")); - if (config->parity != GRUB_SERIAL_PARITY_NONE - && config->parity != GRUB_SERIAL_PARITY_ODD - && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->parity != VasEBoot_SERIAL_PARITY_NONE + && config->parity != VasEBoot_SERIAL_PARITY_ODD + && config->parity != VasEBoot_SERIAL_PARITY_EVEN) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); - if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 - && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (config->stop_bits != VasEBoot_SERIAL_STOP_BITS_1 + && config->stop_bits != VasEBoot_SERIAL_STOP_BITS_2) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port word length")); port->config = *config; @@ -221,58 +221,58 @@ serial_hw_configure (struct grub_serial_port *port, /* FIXME: should check if the serial terminal was found. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -struct grub_serial_driver grub_ns8250_driver = +struct VasEBoot_serial_driver VasEBoot_ns8250_driver = { .configure = serial_hw_configure, .fetch = serial_hw_fetch, .put = serial_hw_put }; -static char com_names[GRUB_SERIAL_PORT_NUM][20]; -static struct grub_serial_port com_ports[GRUB_SERIAL_PORT_NUM]; +static char com_names[VasEBoot_SERIAL_PORT_NUM][20]; +static struct VasEBoot_serial_port com_ports[VasEBoot_SERIAL_PORT_NUM]; void -grub_ns8250_init (void) +VasEBoot_ns8250_init (void) { unsigned i; - for (i = 0; i < GRUB_SERIAL_PORT_NUM; i++) + for (i = 0; i < VasEBoot_SERIAL_PORT_NUM; i++) if (serial_hw_io_addr[i]) { - grub_err_t err; + VasEBoot_err_t err; - grub_outb (0x5a, serial_hw_io_addr[i] + UART_SR); - if (grub_inb (serial_hw_io_addr[i] + UART_SR) != 0x5a) + VasEBoot_outb (0x5a, serial_hw_io_addr[i] + UART_SR); + if (VasEBoot_inb (serial_hw_io_addr[i] + UART_SR) != 0x5a) { dead_ports |= (1 << i); continue; } - grub_outb (0xa5, serial_hw_io_addr[i] + UART_SR); - if (grub_inb (serial_hw_io_addr[i] + UART_SR) != 0xa5) + VasEBoot_outb (0xa5, serial_hw_io_addr[i] + UART_SR); + if (VasEBoot_inb (serial_hw_io_addr[i] + UART_SR) != 0xa5) { dead_ports |= (1 << i); continue; } - grub_snprintf (com_names[i], sizeof (com_names[i]), "com%d", i); + VasEBoot_snprintf (com_names[i], sizeof (com_names[i]), "com%d", i); com_ports[i].name = com_names[i]; - com_ports[i].driver = &grub_ns8250_driver; + com_ports[i].driver = &VasEBoot_ns8250_driver; com_ports[i].port = serial_hw_io_addr[i]; - err = grub_serial_config_defaults (&com_ports[i]); + err = VasEBoot_serial_config_defaults (&com_ports[i]); if (err) - grub_print_error (); + VasEBoot_print_error (); - grub_serial_register (&com_ports[i]); + VasEBoot_serial_register (&com_ports[i]); } } /* Return the port number for the UNITth serial device. */ -grub_port_t -grub_ns8250_hw_get_port (const unsigned int unit) +VasEBoot_port_t +VasEBoot_ns8250_hw_get_port (const unsigned int unit) { - if (unit < GRUB_SERIAL_PORT_NUM + if (unit < VasEBoot_SERIAL_PORT_NUM && !(dead_ports & (1 << unit))) return serial_hw_io_addr[unit]; else @@ -280,11 +280,11 @@ grub_ns8250_hw_get_port (const unsigned int unit) } char * -grub_serial_ns8250_add_port (grub_port_t port) +VasEBoot_serial_ns8250_add_port (VasEBoot_port_t port) { - struct grub_serial_port *p; + struct VasEBoot_serial_port *p; unsigned i; - for (i = 0; i < GRUB_SERIAL_PORT_NUM; i++) + for (i = 0; i < VasEBoot_SERIAL_PORT_NUM; i++) if (com_ports[i].port == port) { if (dead_ports & (1 << i)) @@ -292,27 +292,27 @@ grub_serial_ns8250_add_port (grub_port_t port) return com_names[i]; } - grub_outb (0x5a, port + UART_SR); - if (grub_inb (port + UART_SR) != 0x5a) + VasEBoot_outb (0x5a, port + UART_SR); + if (VasEBoot_inb (port + UART_SR) != 0x5a) return NULL; - grub_outb (0xa5, port + UART_SR); - if (grub_inb (port + UART_SR) != 0xa5) + VasEBoot_outb (0xa5, port + UART_SR); + if (VasEBoot_inb (port + UART_SR) != 0xa5) return NULL; - p = grub_malloc (sizeof (*p)); + p = VasEBoot_malloc (sizeof (*p)); if (!p) return NULL; - p->name = grub_xasprintf ("port%lx", (unsigned long) port); + p->name = VasEBoot_xasprintf ("port%lx", (unsigned long) port); if (!p->name) { - grub_free (p); + VasEBoot_free (p); return NULL; } - p->driver = &grub_ns8250_driver; - grub_serial_config_defaults (p); + p->driver = &VasEBoot_ns8250_driver; + VasEBoot_serial_config_defaults (p); p->port = port; - grub_serial_register (p); + VasEBoot_serial_register (p); return p->name; } diff --git a/VasEBoot-core/term/serial.c b/VasEBoot-core/term/serial.c index db80b3ba0..7e7b518df 100644 --- a/VasEBoot-core/term/serial.c +++ b/VasEBoot-core/term/serial.c @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#if !defined (GRUB_MACHINE_EMU) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) -#include +#include +#include +#include +#include +#include +#include +#if !defined (VasEBoot_MACHINE_EMU) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) +#include #endif -#include -#include -#include -#ifdef GRUB_MACHINE_MIPS_LOONGSON -#include +#include +#include +#include +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON +#include #endif -#ifdef GRUB_MACHINE_IEEE1275 -#include +#ifdef VasEBoot_MACHINE_IEEE1275 +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -#define FOR_SERIAL_PORTS(var) FOR_LIST_ELEMENTS((var), (grub_serial_ports)) +#define FOR_SERIAL_PORTS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_serial_ports)) enum { @@ -52,7 +52,7 @@ enum }; /* Argument options. */ -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"unit", 'u', 0, N_("Set the serial unit."), 0, ARG_TYPE_INT}, {"port", 'p', 0, N_("Set the serial port address."), 0, ARG_TYPE_STRING}, @@ -65,35 +65,35 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; -static struct grub_serial_port *grub_serial_ports; +static struct VasEBoot_serial_port *VasEBoot_serial_ports; -struct grub_serial_output_state +struct VasEBoot_serial_output_state { - struct grub_terminfo_output_state tinfo; - struct grub_serial_port *port; + struct VasEBoot_terminfo_output_state tinfo; + struct VasEBoot_serial_port *port; }; -struct grub_serial_input_state +struct VasEBoot_serial_input_state { - struct grub_terminfo_input_state tinfo; - struct grub_serial_port *port; + struct VasEBoot_terminfo_input_state tinfo; + struct VasEBoot_serial_port *port; }; static void -serial_put (grub_term_output_t term, const int c) +serial_put (VasEBoot_term_output_t term, const int c) { - struct grub_serial_output_state *data = term->data; + struct VasEBoot_serial_output_state *data = term->data; data->port->driver->put (data->port, c); } static int -serial_fetch (grub_term_input_t term) +serial_fetch (VasEBoot_term_input_t term) { - struct grub_serial_input_state *data = term->data; + struct VasEBoot_serial_input_state *data = term->data; return data->port->driver->fetch (data->port); } -static const struct grub_serial_input_state grub_serial_terminfo_input_template = +static const struct VasEBoot_serial_input_state VasEBoot_serial_terminfo_input_template = { .tinfo = { @@ -101,7 +101,7 @@ static const struct grub_serial_input_state grub_serial_terminfo_input_template } }; -static const struct grub_serial_output_state grub_serial_terminfo_output_template = +static const struct VasEBoot_serial_output_state VasEBoot_serial_terminfo_output_template = { .tinfo = { @@ -110,71 +110,71 @@ static const struct grub_serial_output_state grub_serial_terminfo_output_templat } }; -static struct grub_serial_input_state grub_serial_terminfo_input; +static struct VasEBoot_serial_input_state VasEBoot_serial_terminfo_input; -static struct grub_serial_output_state grub_serial_terminfo_output; +static struct VasEBoot_serial_output_state VasEBoot_serial_terminfo_output; static int registered = 0; -static struct grub_term_input grub_serial_term_input = +static struct VasEBoot_term_input VasEBoot_serial_term_input = { .name = "serial", - .init = grub_terminfo_input_init, - .getkey = grub_terminfo_getkey, - .data = &grub_serial_terminfo_input + .init = VasEBoot_terminfo_input_init, + .getkey = VasEBoot_terminfo_getkey, + .data = &VasEBoot_serial_terminfo_input }; -static struct grub_term_output grub_serial_term_output = +static struct VasEBoot_term_output VasEBoot_serial_term_output = { .name = "serial", - .init = grub_terminfo_output_init, - .putchar = grub_terminfo_putchar, - .getwh = grub_terminfo_getwh, - .getxy = grub_terminfo_getxy, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_terminfo_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, - .data = &grub_serial_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_SLOW + .init = VasEBoot_terminfo_output_init, + .putchar = VasEBoot_terminfo_putchar, + .getwh = VasEBoot_terminfo_getwh, + .getxy = VasEBoot_terminfo_getxy, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_terminfo_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, + .data = &VasEBoot_serial_terminfo_output, + .progress_update_divisor = VasEBoot_PROGRESS_SLOW }; -struct grub_serial_port * -grub_serial_find (const char *name) +struct VasEBoot_serial_port * +VasEBoot_serial_find (const char *name) { - struct grub_serial_port *port; + struct VasEBoot_serial_port *port; FOR_SERIAL_PORTS (port) - if (grub_strcmp (port->name, name) == 0) + if (VasEBoot_strcmp (port->name, name) == 0) break; -#if (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) && !defined(GRUB_MACHINE_EMU) && !defined(GRUB_MACHINE_ARC) - if (!port && grub_memcmp (name, "port", sizeof ("port") - 1) == 0 - && grub_isxdigit (name [sizeof ("port") - 1])) +#if (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) && !defined(VasEBoot_MACHINE_EMU) && !defined(VasEBoot_MACHINE_ARC) + if (!port && VasEBoot_memcmp (name, "port", sizeof ("port") - 1) == 0 + && VasEBoot_isxdigit (name [sizeof ("port") - 1])) { - name = grub_serial_ns8250_add_port (grub_strtoul (&name[sizeof ("port") - 1], + name = VasEBoot_serial_ns8250_add_port (VasEBoot_strtoul (&name[sizeof ("port") - 1], 0, 16)); if (!name) return NULL; FOR_SERIAL_PORTS (port) - if (grub_strcmp (port->name, name) == 0) + if (VasEBoot_strcmp (port->name, name) == 0) break; } #endif -#ifdef GRUB_MACHINE_IEEE1275 - if (!port && grub_memcmp (name, "ieee1275/", sizeof ("ieee1275/") - 1) == 0) +#ifdef VasEBoot_MACHINE_IEEE1275 + if (!port && VasEBoot_memcmp (name, "ieee1275/", sizeof ("ieee1275/") - 1) == 0) { - name = grub_ofserial_add_port (&name[sizeof ("ieee1275/") - 1]); + name = VasEBoot_ofserial_add_port (&name[sizeof ("ieee1275/") - 1]); if (!name) return NULL; FOR_SERIAL_PORTS (port) - if (grub_strcmp (port->name, name) == 0) + if (VasEBoot_strcmp (port->name, name) == 0) break; } #endif @@ -182,27 +182,27 @@ grub_serial_find (const char *name) return port; } -static grub_err_t -grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_serial (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_arg_list *state = ctxt->state; char pname[40]; const char *name = NULL; - struct grub_serial_port *port; - struct grub_serial_config config; - grub_err_t err; + struct VasEBoot_serial_port *port; + struct VasEBoot_serial_config config; + VasEBoot_err_t err; if (state[OPTION_UNIT].set) { - grub_snprintf (pname, sizeof (pname), "com%ld", - grub_strtoul (state[0].arg, 0, 0)); + VasEBoot_snprintf (pname, sizeof (pname), "com%ld", + VasEBoot_strtoul (state[0].arg, 0, 0)); name = pname; } if (state[OPTION_PORT].set) { - grub_snprintf (pname, sizeof (pname), "port%lx", - grub_strtoul (state[1].arg, 0, 0)); + VasEBoot_snprintf (pname, sizeof (pname), "port%lx", + VasEBoot_strtoul (state[1].arg, 0, 0)); name = pname; } @@ -212,67 +212,67 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) if (!name) name = "com0"; - port = grub_serial_find (name); + port = VasEBoot_serial_find (name); if (!port) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("serial port `%s' isn't found"), name); config = port->config; if (state[OPTION_SPEED].set) { - config.speed = grub_strtoul (state[OPTION_SPEED].arg, 0, 0); + config.speed = VasEBoot_strtoul (state[OPTION_SPEED].arg, 0, 0); if (config.speed == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); } if (state[OPTION_WORD].set) - config.word_len = grub_strtoul (state[OPTION_WORD].arg, 0, 0); + config.word_len = VasEBoot_strtoul (state[OPTION_WORD].arg, 0, 0); if (state[OPTION_PARITY].set) { - if (! grub_strcmp (state[OPTION_PARITY].arg, "no")) - config.parity = GRUB_SERIAL_PARITY_NONE; - else if (! grub_strcmp (state[OPTION_PARITY].arg, "odd")) - config.parity = GRUB_SERIAL_PARITY_ODD; - else if (! grub_strcmp (state[OPTION_PARITY].arg, "even")) - config.parity = GRUB_SERIAL_PARITY_EVEN; + if (! VasEBoot_strcmp (state[OPTION_PARITY].arg, "no")) + config.parity = VasEBoot_SERIAL_PARITY_NONE; + else if (! VasEBoot_strcmp (state[OPTION_PARITY].arg, "odd")) + config.parity = VasEBoot_SERIAL_PARITY_ODD; + else if (! VasEBoot_strcmp (state[OPTION_PARITY].arg, "even")) + config.parity = VasEBoot_SERIAL_PARITY_EVEN; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port parity")); } if (state[OPTION_RTSCTS].set) { - if (grub_strcmp (state[OPTION_RTSCTS].arg, "on") == 0) + if (VasEBoot_strcmp (state[OPTION_RTSCTS].arg, "on") == 0) config.rtscts = 1; - else if (grub_strcmp (state[OPTION_RTSCTS].arg, "off") == 0) + else if (VasEBoot_strcmp (state[OPTION_RTSCTS].arg, "off") == 0) config.rtscts = 0; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port flow control")); } if (state[OPTION_STOP].set) { - if (! grub_strcmp (state[OPTION_STOP].arg, "1")) - config.stop_bits = GRUB_SERIAL_STOP_BITS_1; - else if (! grub_strcmp (state[OPTION_STOP].arg, "2")) - config.stop_bits = GRUB_SERIAL_STOP_BITS_2; - else if (! grub_strcmp (state[OPTION_STOP].arg, "1.5")) - config.stop_bits = GRUB_SERIAL_STOP_BITS_1_5; + if (! VasEBoot_strcmp (state[OPTION_STOP].arg, "1")) + config.stop_bits = VasEBoot_SERIAL_STOP_BITS_1; + else if (! VasEBoot_strcmp (state[OPTION_STOP].arg, "2")) + config.stop_bits = VasEBoot_SERIAL_STOP_BITS_2; + else if (! VasEBoot_strcmp (state[OPTION_STOP].arg, "1.5")) + config.stop_bits = VasEBoot_SERIAL_STOP_BITS_1_5; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unsupported serial port stop bits number")); } if (state[OPTION_BASE_CLOCK].set) { char *ptr; - config.base_clock = grub_strtoull (state[OPTION_BASE_CLOCK].arg, &ptr, 0); - if (grub_errno) - return grub_errno; + config.base_clock = VasEBoot_strtoull (state[OPTION_BASE_CLOCK].arg, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (ptr && *ptr == 'M') config.base_clock *= 1000000; if (ptr && (*ptr == 'k' || *ptr == 'K')) @@ -286,178 +286,178 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) err = port->driver->configure (port, &config); if (err) return err; -#if !defined (GRUB_MACHINE_EMU) && !defined(GRUB_MACHINE_ARC) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) +#if !defined (VasEBoot_MACHINE_EMU) && !defined(VasEBoot_MACHINE_ARC) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) /* Compatibility kludge. */ - if (port->driver == &grub_ns8250_driver) + if (port->driver == &VasEBoot_ns8250_driver) { if (!registered) { - grub_terminfo_output_register (&grub_serial_term_output, "vt100"); + VasEBoot_terminfo_output_register (&VasEBoot_serial_term_output, "vt100"); - grub_term_register_input ("serial", &grub_serial_term_input); - grub_term_register_output ("serial", &grub_serial_term_output); + VasEBoot_term_register_input ("serial", &VasEBoot_serial_term_input); + VasEBoot_term_register_output ("serial", &VasEBoot_serial_term_output); } - grub_serial_terminfo_output.port = port; - grub_serial_terminfo_input.port = port; + VasEBoot_serial_terminfo_output.port = port; + VasEBoot_serial_terminfo_input.port = port; registered = 1; } #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON const char loongson_defserial[][6] = { - [GRUB_ARCH_MACHINE_YEELOONG] = "com0", - [GRUB_ARCH_MACHINE_FULOONG2F] = "com2", - [GRUB_ARCH_MACHINE_FULOONG2E] = "com1" + [VasEBoot_ARCH_MACHINE_YEELOONG] = "com0", + [VasEBoot_ARCH_MACHINE_FULOONG2F] = "com2", + [VasEBoot_ARCH_MACHINE_FULOONG2E] = "com1" }; #endif -grub_err_t -grub_serial_register (struct grub_serial_port *port) +VasEBoot_err_t +VasEBoot_serial_register (struct VasEBoot_serial_port *port) { - struct grub_term_input *in; - struct grub_term_output *out; - struct grub_serial_input_state *indata; - struct grub_serial_output_state *outdata; + struct VasEBoot_term_input *in; + struct VasEBoot_term_output *out; + struct VasEBoot_serial_input_state *indata; + struct VasEBoot_serial_output_state *outdata; - in = grub_malloc (sizeof (*in)); + in = VasEBoot_malloc (sizeof (*in)); if (!in) - return grub_errno; + return VasEBoot_errno; - indata = grub_malloc (sizeof (*indata)); + indata = VasEBoot_malloc (sizeof (*indata)); if (!indata) { - grub_free (in); - return grub_errno; + VasEBoot_free (in); + return VasEBoot_errno; } - grub_memcpy (in, &grub_serial_term_input, sizeof (*in)); + VasEBoot_memcpy (in, &VasEBoot_serial_term_input, sizeof (*in)); in->data = indata; - in->name = grub_xasprintf ("serial_%s", port->name); - grub_memcpy (indata, &grub_serial_terminfo_input, sizeof (*indata)); + in->name = VasEBoot_xasprintf ("serial_%s", port->name); + VasEBoot_memcpy (indata, &VasEBoot_serial_terminfo_input, sizeof (*indata)); if (!in->name) { - grub_free (in); - grub_free (indata); - return grub_errno; + VasEBoot_free (in); + VasEBoot_free (indata); + return VasEBoot_errno; } - out = grub_zalloc (sizeof (*out)); + out = VasEBoot_zalloc (sizeof (*out)); if (!out) { - grub_free (indata); - grub_free ((char *) in->name); - grub_free (in); - return grub_errno; + VasEBoot_free (indata); + VasEBoot_free ((char *) in->name); + VasEBoot_free (in); + return VasEBoot_errno; } - outdata = grub_malloc (sizeof (*outdata)); + outdata = VasEBoot_malloc (sizeof (*outdata)); if (!outdata) { - grub_free (indata); - grub_free ((char *) in->name); - grub_free (out); - grub_free (in); - return grub_errno; + VasEBoot_free (indata); + VasEBoot_free ((char *) in->name); + VasEBoot_free (out); + VasEBoot_free (in); + return VasEBoot_errno; } - grub_memcpy (out, &grub_serial_term_output, sizeof (*out)); + VasEBoot_memcpy (out, &VasEBoot_serial_term_output, sizeof (*out)); out->data = outdata; out->name = in->name; - grub_memcpy (outdata, &grub_serial_terminfo_output, sizeof (*outdata)); + VasEBoot_memcpy (outdata, &VasEBoot_serial_terminfo_output, sizeof (*outdata)); - grub_list_push (GRUB_AS_LIST_P (&grub_serial_ports), GRUB_AS_LIST (port)); - ((struct grub_serial_input_state *) in->data)->port = port; - ((struct grub_serial_output_state *) out->data)->port = port; + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_serial_ports), VasEBoot_AS_LIST (port)); + ((struct VasEBoot_serial_input_state *) in->data)->port = port; + ((struct VasEBoot_serial_output_state *) out->data)->port = port; port->term_in = in; port->term_out = out; - grub_terminfo_output_register (out, "vt100"); -#ifdef GRUB_MACHINE_MIPS_LOONGSON - if (grub_strcmp (port->name, loongson_defserial[grub_arch_machine]) == 0) + VasEBoot_terminfo_output_register (out, "vt100"); +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON + if (VasEBoot_strcmp (port->name, loongson_defserial[VasEBoot_arch_machine]) == 0) { - grub_term_register_input_active ("serial_*", in); - grub_term_register_output_active ("serial_*", out); + VasEBoot_term_register_input_active ("serial_*", in); + VasEBoot_term_register_output_active ("serial_*", out); } else { - grub_term_register_input_inactive ("serial_*", in); - grub_term_register_output_inactive ("serial_*", out); + VasEBoot_term_register_input_inactive ("serial_*", in); + VasEBoot_term_register_output_inactive ("serial_*", out); } #else - grub_term_register_input ("serial_*", in); - grub_term_register_output ("serial_*", out); + VasEBoot_term_register_input ("serial_*", in); + VasEBoot_term_register_output ("serial_*", out); #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void -grub_serial_unregister (struct grub_serial_port *port) +VasEBoot_serial_unregister (struct VasEBoot_serial_port *port) { if (port->driver->fini) port->driver->fini (port); if (port->term_in) - grub_term_unregister_input (port->term_in); + VasEBoot_term_unregister_input (port->term_in); if (port->term_out) - grub_term_unregister_output (port->term_out); + VasEBoot_term_unregister_output (port->term_out); - grub_list_remove (GRUB_AS_LIST (port)); + VasEBoot_list_remove (VasEBoot_AS_LIST (port)); } void -grub_serial_unregister_driver (struct grub_serial_driver *driver) +VasEBoot_serial_unregister_driver (struct VasEBoot_serial_driver *driver) { - struct grub_serial_port *port, *next; - for (port = grub_serial_ports; port; port = next) + struct VasEBoot_serial_port *port, *next; + for (port = VasEBoot_serial_ports; port; port = next) { next = port->next; if (port->driver == driver) - grub_serial_unregister (port); + VasEBoot_serial_unregister (port); } } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(serial) +VasEBoot_MOD_INIT(serial) { - cmd = grub_register_extcmd ("serial", grub_cmd_serial, 0, + cmd = VasEBoot_register_extcmd ("serial", VasEBoot_cmd_serial, 0, N_("[OPTIONS...]"), N_("Configure serial port."), options); - grub_memcpy (&grub_serial_terminfo_output, - &grub_serial_terminfo_output_template, - sizeof (grub_serial_terminfo_output)); + VasEBoot_memcpy (&VasEBoot_serial_terminfo_output, + &VasEBoot_serial_terminfo_output_template, + sizeof (VasEBoot_serial_terminfo_output)); - grub_memcpy (&grub_serial_terminfo_input, - &grub_serial_terminfo_input_template, - sizeof (grub_serial_terminfo_input)); + VasEBoot_memcpy (&VasEBoot_serial_terminfo_input, + &VasEBoot_serial_terminfo_input_template, + sizeof (VasEBoot_serial_terminfo_input)); -#if !defined (GRUB_MACHINE_EMU) && !defined(GRUB_MACHINE_ARC) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) - grub_ns8250_init (); +#if !defined (VasEBoot_MACHINE_EMU) && !defined(VasEBoot_MACHINE_ARC) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) + VasEBoot_ns8250_init (); #endif -#ifdef GRUB_MACHINE_IEEE1275 - grub_ofserial_init (); +#ifdef VasEBoot_MACHINE_IEEE1275 + VasEBoot_ofserial_init (); #endif -#ifdef GRUB_MACHINE_EFI - grub_efiserial_init (); +#ifdef VasEBoot_MACHINE_EFI + VasEBoot_efiserial_init (); #endif -#ifdef GRUB_MACHINE_ARC - grub_arcserial_init (); +#ifdef VasEBoot_MACHINE_ARC + VasEBoot_arcserial_init (); #endif } -GRUB_MOD_FINI(serial) +VasEBoot_MOD_FINI(serial) { - while (grub_serial_ports) - grub_serial_unregister (grub_serial_ports); + while (VasEBoot_serial_ports) + VasEBoot_serial_unregister (VasEBoot_serial_ports); if (registered) { - grub_term_unregister_input (&grub_serial_term_input); - grub_term_unregister_output (&grub_serial_term_output); + VasEBoot_term_unregister_input (&VasEBoot_serial_term_input); + VasEBoot_term_unregister_output (&VasEBoot_serial_term_output); } - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/term/spkmodem.c b/VasEBoot-core/term/spkmodem.c index 75c8a0f82..9502fdbeb 100644 --- a/VasEBoot-core/term/spkmodem.c +++ b/VasEBoot-core/term/spkmodem.c @@ -1,58 +1,58 @@ -/* console.c -- Open Firmware console for GRUB. */ +/* console.c -- Open Firmware console for VasEBoot. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -extern struct grub_terminfo_output_state grub_spkmodem_terminfo_output; +extern struct VasEBoot_terminfo_output_state VasEBoot_spkmodem_terminfo_output; static void -make_tone (grub_uint16_t freq_count, unsigned int duration) +make_tone (VasEBoot_uint16_t freq_count, unsigned int duration) { /* Program timer 2. */ - grub_outb (GRUB_PIT_CTRL_SELECT_2 - | GRUB_PIT_CTRL_READLOAD_WORD - | GRUB_PIT_CTRL_SQUAREWAVE_GEN - | GRUB_PIT_CTRL_COUNT_BINARY, GRUB_PIT_CTRL); - grub_outb (freq_count & 0xff, GRUB_PIT_COUNTER_2); /* LSB */ - grub_outb ((freq_count >> 8) & 0xff, GRUB_PIT_COUNTER_2); /* MSB */ + VasEBoot_outb (VasEBoot_PIT_CTRL_SELECT_2 + | VasEBoot_PIT_CTRL_READLOAD_WORD + | VasEBoot_PIT_CTRL_SQUAREWAVE_GEN + | VasEBoot_PIT_CTRL_COUNT_BINARY, VasEBoot_PIT_CTRL); + VasEBoot_outb (freq_count & 0xff, VasEBoot_PIT_COUNTER_2); /* LSB */ + VasEBoot_outb ((freq_count >> 8) & 0xff, VasEBoot_PIT_COUNTER_2); /* MSB */ /* Start speaker. */ - grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) - | GRUB_PIT_SPK_TMR2 | GRUB_PIT_SPK_DATA, - GRUB_PIT_SPEAKER_PORT); + VasEBoot_outb (VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT) + | VasEBoot_PIT_SPK_TMR2 | VasEBoot_PIT_SPK_DATA, + VasEBoot_PIT_SPEAKER_PORT); for (; duration; duration--) { unsigned short counter, previous_counter = 0xffff; while (1) { - counter = grub_inb (GRUB_PIT_COUNTER_2); - counter |= ((grub_uint16_t) grub_inb (GRUB_PIT_COUNTER_2)) << 8; + counter = VasEBoot_inb (VasEBoot_PIT_COUNTER_2); + counter |= ((VasEBoot_uint16_t) VasEBoot_inb (VasEBoot_PIT_COUNTER_2)) << 8; if (counter > previous_counter) { previous_counter = counter; @@ -66,39 +66,39 @@ make_tone (grub_uint16_t freq_count, unsigned int duration) static int inited; static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { int i; - make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 200, 4); + make_tone (VasEBoot_SPEAKER_PIT_FREQUENCY / 200, 4); for (i = 7; i >= 0; i--) { if ((c >> i) & 1) - make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 2000, 20); + make_tone (VasEBoot_SPEAKER_PIT_FREQUENCY / 2000, 20); else - make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 4000, 40); - make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 1000, 10); + make_tone (VasEBoot_SPEAKER_PIT_FREQUENCY / 4000, 40); + make_tone (VasEBoot_SPEAKER_PIT_FREQUENCY / 1000, 10); } - make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 200, 0); + make_tone (VasEBoot_SPEAKER_PIT_FREQUENCY / 200, 0); } -static grub_err_t -grub_spkmodem_init_output (struct grub_term_output *term) +static VasEBoot_err_t +VasEBoot_spkmodem_init_output (struct VasEBoot_term_output *term) { /* Some models shutdown sound when not in use and it takes for it around 30 ms to come back on which loses 3 bits. So generate a base 200 Hz continously. */ - make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 200, 0); - grub_terminfo_output_init (term); + make_tone (VasEBoot_SPEAKER_PIT_FREQUENCY / 200, 0); + VasEBoot_terminfo_output_init (term); return 0; } -static grub_err_t -grub_spkmodem_fini_output (struct grub_term_output *term __attribute__ ((unused))) +static VasEBoot_err_t +VasEBoot_spkmodem_fini_output (struct VasEBoot_term_output *term __attribute__ ((unused))) { - grub_speaker_beep_off (); + VasEBoot_speaker_beep_off (); inited = 0; return 0; } @@ -106,36 +106,36 @@ grub_spkmodem_fini_output (struct grub_term_output *term __attribute__ ((unused) -struct grub_terminfo_output_state grub_spkmodem_terminfo_output = +struct VasEBoot_terminfo_output_state VasEBoot_spkmodem_terminfo_output = { .put = put, .size = { 80, 24 } }; -static struct grub_term_output grub_spkmodem_term_output = +static struct VasEBoot_term_output VasEBoot_spkmodem_term_output = { .name = "spkmodem", - .init = grub_spkmodem_init_output, - .fini = grub_spkmodem_fini_output, - .putchar = grub_terminfo_putchar, - .getxy = grub_terminfo_getxy, - .getwh = grub_terminfo_getwh, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_terminfo_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, - .data = &grub_spkmodem_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_NO_UPDATE + .init = VasEBoot_spkmodem_init_output, + .fini = VasEBoot_spkmodem_fini_output, + .putchar = VasEBoot_terminfo_putchar, + .getxy = VasEBoot_terminfo_getxy, + .getwh = VasEBoot_terminfo_getwh, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_terminfo_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, + .data = &VasEBoot_spkmodem_terminfo_output, + .progress_update_divisor = VasEBoot_PROGRESS_NO_UPDATE }; -GRUB_MOD_INIT (spkmodem) +VasEBoot_MOD_INIT (spkmodem) { - grub_term_register_output ("spkmodem", &grub_spkmodem_term_output); + VasEBoot_term_register_output ("spkmodem", &VasEBoot_spkmodem_term_output); } -GRUB_MOD_FINI (spkmodem) +VasEBoot_MOD_FINI (spkmodem) { - grub_term_unregister_output (&grub_spkmodem_term_output); + VasEBoot_term_unregister_output (&VasEBoot_spkmodem_term_output); } diff --git a/VasEBoot-core/term/terminfo.c b/VasEBoot-core/term/terminfo.c index f0d3e3deb..20e55a309 100644 --- a/VasEBoot-core/term/terminfo.c +++ b/VasEBoot-core/term/terminfo.c @@ -1,20 +1,20 @@ /* terminfo.c - simple terminfo module */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* @@ -22,68 +22,68 @@ * terminal capabilities. For example, vt52 and vt100. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275) -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__powerpc__) && defined(VasEBoot_MACHINE_IEEE1275) +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define ANSI_CSI 0x9b #define ANSI_CSI_STR "\x9b" -static struct grub_term_output *terminfo_outputs; +static struct VasEBoot_term_output *terminfo_outputs; /* Get current terminfo name. */ char * -grub_terminfo_get_current (struct grub_term_output *term) +VasEBoot_terminfo_get_current (struct VasEBoot_term_output *term) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; return data->name; } /* Free *PTR and set *PTR to NULL, to prevent double-free. */ static void -grub_terminfo_free (char **ptr) +VasEBoot_terminfo_free (char **ptr) { - grub_free (*ptr); + VasEBoot_free (*ptr); *ptr = 0; } static void -grub_terminfo_all_free (struct grub_term_output *term) +VasEBoot_terminfo_all_free (struct VasEBoot_term_output *term) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; /* Free previously allocated memory. */ - grub_terminfo_free (&data->name); - grub_terminfo_free (&data->gotoxy); - grub_terminfo_free (&data->cls); - grub_terminfo_free (&data->reverse_video_on); - grub_terminfo_free (&data->reverse_video_off); - grub_terminfo_free (&data->cursor_on); - grub_terminfo_free (&data->cursor_off); + VasEBoot_terminfo_free (&data->name); + VasEBoot_terminfo_free (&data->gotoxy); + VasEBoot_terminfo_free (&data->cls); + VasEBoot_terminfo_free (&data->reverse_video_on); + VasEBoot_terminfo_free (&data->reverse_video_off); + VasEBoot_terminfo_free (&data->cursor_on); + VasEBoot_terminfo_free (&data->cursor_off); } /* Set current terminfo type. */ -grub_err_t -grub_terminfo_set_current (struct grub_term_output *term, +VasEBoot_err_t +VasEBoot_terminfo_set_current (struct VasEBoot_term_output *term, const char *str) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; /* TODO * Lookup user specified terminfo type. If found, set term variables * as appropriate. Otherwise return an error. @@ -96,81 +96,81 @@ grub_terminfo_set_current (struct grub_term_output *term, * c. Look for terminfo files in the configuration directory. * - /usr/share/terminfo is 6.3M on my system. * - /usr/share/terminfo is not on most users boot partition. - * + Copying the terminfo files you want to use to the grub + * + Copying the terminfo files you want to use to the VasEBoot * configuration directory is easier then (b). * d. Your idea here. */ - grub_terminfo_all_free (term); + VasEBoot_terminfo_all_free (term); - if (grub_strcmp ("vt100", str) == 0) + if (VasEBoot_strcmp ("vt100", str) == 0) { - data->name = grub_strdup ("vt100"); - data->gotoxy = grub_strdup ("\e[%i%p1%d;%p2%dH"); - data->cls = grub_strdup ("\e[H\e[J"); - data->reverse_video_on = grub_strdup ("\e[7m"); - data->reverse_video_off = grub_strdup ("\e[m"); - data->cursor_on = grub_strdup ("\e[?25h"); - data->cursor_off = grub_strdup ("\e[?25l"); + data->name = VasEBoot_strdup ("vt100"); + data->gotoxy = VasEBoot_strdup ("\e[%i%p1%d;%p2%dH"); + data->cls = VasEBoot_strdup ("\e[H\e[J"); + data->reverse_video_on = VasEBoot_strdup ("\e[7m"); + data->reverse_video_off = VasEBoot_strdup ("\e[m"); + data->cursor_on = VasEBoot_strdup ("\e[?25h"); + data->cursor_off = VasEBoot_strdup ("\e[?25l"); data->setcolor = NULL; - return grub_errno; + return VasEBoot_errno; } - if (grub_strcmp ("vt100-color", str) == 0) + if (VasEBoot_strcmp ("vt100-color", str) == 0) { - data->name = grub_strdup ("vt100-color"); - data->gotoxy = grub_strdup ("\e[%i%p1%d;%p2%dH"); - data->cls = grub_strdup ("\e[H\e[J"); - data->reverse_video_on = grub_strdup ("\e[7m"); - data->reverse_video_off = grub_strdup ("\e[m"); - data->cursor_on = grub_strdup ("\e[?25h"); - data->cursor_off = grub_strdup ("\e[?25l"); - data->setcolor = grub_strdup ("\e[3%p1%dm\e[4%p2%dm"); - return grub_errno; + data->name = VasEBoot_strdup ("vt100-color"); + data->gotoxy = VasEBoot_strdup ("\e[%i%p1%d;%p2%dH"); + data->cls = VasEBoot_strdup ("\e[H\e[J"); + data->reverse_video_on = VasEBoot_strdup ("\e[7m"); + data->reverse_video_off = VasEBoot_strdup ("\e[m"); + data->cursor_on = VasEBoot_strdup ("\e[?25h"); + data->cursor_off = VasEBoot_strdup ("\e[?25l"); + data->setcolor = VasEBoot_strdup ("\e[3%p1%dm\e[4%p2%dm"); + return VasEBoot_errno; } - if (grub_strcmp ("arc", str) == 0) + if (VasEBoot_strcmp ("arc", str) == 0) { - data->name = grub_strdup ("arc"); - data->gotoxy = grub_strdup (ANSI_CSI_STR "%i%p1%d;%p2%dH"); - data->cls = grub_strdup (ANSI_CSI_STR "2J"); - data->reverse_video_on = grub_strdup (ANSI_CSI_STR "7m"); - data->reverse_video_off = grub_strdup (ANSI_CSI_STR "0m"); + data->name = VasEBoot_strdup ("arc"); + data->gotoxy = VasEBoot_strdup (ANSI_CSI_STR "%i%p1%d;%p2%dH"); + data->cls = VasEBoot_strdup (ANSI_CSI_STR "2J"); + data->reverse_video_on = VasEBoot_strdup (ANSI_CSI_STR "7m"); + data->reverse_video_off = VasEBoot_strdup (ANSI_CSI_STR "0m"); data->cursor_on = 0; data->cursor_off = 0; - data->setcolor = grub_strdup (ANSI_CSI_STR "3%p1%dm" + data->setcolor = VasEBoot_strdup (ANSI_CSI_STR "3%p1%dm" ANSI_CSI_STR "4%p2%dm"); - return grub_errno; + return VasEBoot_errno; } - if (grub_strcmp ("ieee1275", str) == 0 - || grub_strcmp ("ieee1275-nocursor", str) == 0) + if (VasEBoot_strcmp ("ieee1275", str) == 0 + || VasEBoot_strcmp ("ieee1275-nocursor", str) == 0) { - data->name = grub_strdup ("ieee1275"); - data->gotoxy = grub_strdup ("\e[%i%p1%d;%p2%dH"); + data->name = VasEBoot_strdup ("ieee1275"); + data->gotoxy = VasEBoot_strdup ("\e[%i%p1%d;%p2%dH"); /* Clear the screen. Using serial console, screen(1) only recognizes the * ANSI escape sequence. Using video console, Apple Open Firmware * (version 3.1.1) only recognizes the literal ^L. So use both. */ - data->cls = grub_strdup (" \e[2J"); - data->reverse_video_on = grub_strdup ("\e[7m"); - data->reverse_video_off = grub_strdup ("\e[m"); - if (grub_strcmp ("ieee1275", str) == 0) + data->cls = VasEBoot_strdup (" \e[2J"); + data->reverse_video_on = VasEBoot_strdup ("\e[7m"); + data->reverse_video_off = VasEBoot_strdup ("\e[m"); + if (VasEBoot_strcmp ("ieee1275", str) == 0) { - data->cursor_on = grub_strdup ("\e[?25h"); - data->cursor_off = grub_strdup ("\e[?25l"); + data->cursor_on = VasEBoot_strdup ("\e[?25h"); + data->cursor_off = VasEBoot_strdup ("\e[?25l"); } else { data->cursor_on = 0; data->cursor_off = 0; } - data->setcolor = grub_strdup ("\e[3%p1%dm\e[4%p2%dm"); - return grub_errno; + data->setcolor = VasEBoot_strdup ("\e[3%p1%dm\e[4%p2%dm"); + return VasEBoot_errno; } - if (grub_strcmp ("dumb", str) == 0) + if (VasEBoot_strcmp ("dumb", str) == 0) { - data->name = grub_strdup ("dumb"); + data->name = VasEBoot_strdup ("dumb"); data->gotoxy = NULL; data->cls = NULL; data->reverse_video_on = NULL; @@ -178,82 +178,82 @@ grub_terminfo_set_current (struct grub_term_output *term, data->cursor_on = NULL; data->cursor_off = NULL; data->setcolor = NULL; - return grub_errno; + return VasEBoot_errno; } - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown terminfo type `%s'"), + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("unknown terminfo type `%s'"), str); } -grub_err_t -grub_terminfo_output_register (struct grub_term_output *term, +VasEBoot_err_t +VasEBoot_terminfo_output_register (struct VasEBoot_term_output *term, const char *type) { - grub_err_t err; - struct grub_terminfo_output_state *data; + VasEBoot_err_t err; + struct VasEBoot_terminfo_output_state *data; - err = grub_terminfo_set_current (term, type); + err = VasEBoot_terminfo_set_current (term, type); if (err) return err; - data = (struct grub_terminfo_output_state *) term->data; + data = (struct VasEBoot_terminfo_output_state *) term->data; data->next = terminfo_outputs; terminfo_outputs = term; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_terminfo_output_unregister (struct grub_term_output *term) +VasEBoot_err_t +VasEBoot_terminfo_output_unregister (struct VasEBoot_term_output *term) { - struct grub_term_output **ptr; + struct VasEBoot_term_output **ptr; for (ptr = &terminfo_outputs; *ptr; - ptr = &((struct grub_terminfo_output_state *) (*ptr)->data)->next) + ptr = &((struct VasEBoot_terminfo_output_state *) (*ptr)->data)->next) if (*ptr == term) { - grub_terminfo_all_free (term); - *ptr = ((struct grub_terminfo_output_state *) (*ptr)->data)->next; - return GRUB_ERR_NONE; + VasEBoot_terminfo_all_free (term); + *ptr = ((struct VasEBoot_terminfo_output_state *) (*ptr)->data)->next; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_BUG, "terminal not found"); + return VasEBoot_error (VasEBoot_ERR_BUG, "terminal not found"); } -/* Wrapper for grub_putchar to write strings. */ +/* Wrapper for VasEBoot_putchar to write strings. */ static void -putstr (struct grub_term_output *term, const char *str) +putstr (struct VasEBoot_term_output *term, const char *str) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; while (*str) data->put (term, *str++); } -struct grub_term_coordinate -grub_terminfo_getxy (struct grub_term_output *term) +struct VasEBoot_term_coordinate +VasEBoot_terminfo_getxy (struct VasEBoot_term_output *term) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; return data->pos; } void -grub_terminfo_gotoxy (struct grub_term_output *term, - struct grub_term_coordinate pos) +VasEBoot_terminfo_gotoxy (struct VasEBoot_term_output *term, + struct VasEBoot_term_coordinate pos) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; - if (pos.x > grub_term_width (term) || pos.y > grub_term_height (term)) + if (pos.x > VasEBoot_term_width (term) || pos.y > VasEBoot_term_height (term)) { - grub_error (GRUB_ERR_BUG, "invalid point (%u,%u)", pos.x, pos.y); + VasEBoot_error (VasEBoot_ERR_BUG, "invalid point (%u,%u)", pos.x, pos.y); return; } if (data->gotoxy) - putstr (term, grub_terminfo_tparm (data->gotoxy, pos.y, pos.x)); + putstr (term, VasEBoot_terminfo_tparm (data->gotoxy, pos.y, pos.x)); else { if ((pos.y == data->pos.y) && (pos.x == data->pos.x - 1)) @@ -265,21 +265,21 @@ grub_terminfo_gotoxy (struct grub_term_output *term, /* Clear the screen. */ void -grub_terminfo_cls (struct grub_term_output *term) +VasEBoot_terminfo_cls (struct VasEBoot_term_output *term) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; - putstr (term, grub_terminfo_tparm (data->cls)); - grub_terminfo_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); + putstr (term, VasEBoot_terminfo_tparm (data->cls)); + VasEBoot_terminfo_gotoxy (term, (struct VasEBoot_term_coordinate) { 0, 0 }); } void -grub_terminfo_setcolorstate (struct grub_term_output *term, - const grub_term_color_state state) +VasEBoot_terminfo_setcolorstate (struct VasEBoot_term_output *term, + const VasEBoot_term_color_state state) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; if (data->setcolor) { @@ -299,32 +299,32 @@ grub_terminfo_setcolorstate (struct grub_term_output *term, switch (state) { - case GRUB_TERM_COLOR_STANDARD: - case GRUB_TERM_COLOR_NORMAL: - fg = grub_term_normal_color & 0x0f; - bg = grub_term_normal_color >> 4; + case VasEBoot_TERM_COLOR_STANDARD: + case VasEBoot_TERM_COLOR_NORMAL: + fg = VasEBoot_term_normal_color & 0x0f; + bg = VasEBoot_term_normal_color >> 4; break; - case GRUB_TERM_COLOR_HIGHLIGHT: - fg = grub_term_highlight_color & 0x0f; - bg = grub_term_highlight_color >> 4; + case VasEBoot_TERM_COLOR_HIGHLIGHT: + fg = VasEBoot_term_highlight_color & 0x0f; + bg = VasEBoot_term_highlight_color >> 4; break; default: return; } - putstr (term, grub_terminfo_tparm (data->setcolor, colormap[fg & 7], + putstr (term, VasEBoot_terminfo_tparm (data->setcolor, colormap[fg & 7], colormap[bg & 7])); return; } switch (state) { - case GRUB_TERM_COLOR_STANDARD: - case GRUB_TERM_COLOR_NORMAL: - putstr (term, grub_terminfo_tparm (data->reverse_video_off)); + case VasEBoot_TERM_COLOR_STANDARD: + case VasEBoot_TERM_COLOR_NORMAL: + putstr (term, VasEBoot_terminfo_tparm (data->reverse_video_off)); break; - case GRUB_TERM_COLOR_HIGHLIGHT: - putstr (term, grub_terminfo_tparm (data->reverse_video_on)); + case VasEBoot_TERM_COLOR_HIGHLIGHT: + putstr (term, VasEBoot_terminfo_tparm (data->reverse_video_on)); break; default: break; @@ -332,24 +332,24 @@ grub_terminfo_setcolorstate (struct grub_term_output *term, } void -grub_terminfo_setcursor (struct grub_term_output *term, const int on) +VasEBoot_terminfo_setcursor (struct VasEBoot_term_output *term, const int on) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; if (on) - putstr (term, grub_terminfo_tparm (data->cursor_on)); + putstr (term, VasEBoot_terminfo_tparm (data->cursor_on)); else - putstr (term, grub_terminfo_tparm (data->cursor_off)); + putstr (term, VasEBoot_terminfo_tparm (data->cursor_off)); } /* The terminfo version of putchar. */ void -grub_terminfo_putchar (struct grub_term_output *term, - const struct grub_unicode_glyph *c) +VasEBoot_terminfo_putchar (struct VasEBoot_term_output *term, + const struct VasEBoot_unicode_glyph *c) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; /* Keep track of the cursor. */ switch (c->base) @@ -364,7 +364,7 @@ grub_terminfo_putchar (struct grub_term_output *term, break; case '\n': - if (data->pos.y < grub_term_height (term) - 1) + if (data->pos.y < VasEBoot_term_height (term) - 1) data->pos.y++; break; @@ -373,10 +373,10 @@ grub_terminfo_putchar (struct grub_term_output *term, break; default: - if ((int) data->pos.x + c->estimated_width >= (int) grub_term_width (term) + 1) + if ((int) data->pos.x + c->estimated_width >= (int) VasEBoot_term_width (term) + 1) { data->pos.x = 0; - if (data->pos.y < grub_term_height (term) - 1) + if (data->pos.y < VasEBoot_term_height (term) - 1) data->pos.y++; data->put (term, '\r'); data->put (term, '\n'); @@ -388,29 +388,29 @@ grub_terminfo_putchar (struct grub_term_output *term, data->put (term, c->base); } -struct grub_term_coordinate -grub_terminfo_getwh (struct grub_term_output *term) +struct VasEBoot_term_coordinate +VasEBoot_terminfo_getwh (struct VasEBoot_term_output *term) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) term->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) term->data; return data->size; } static void -grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, - int (*readkey) (struct grub_term_input *term)) +VasEBoot_terminfo_readkey (struct VasEBoot_term_input *term, int *keys, int *len, + int (*readkey) (struct VasEBoot_term_input *term)) { int c; #define CONTINUE_READ \ { \ - grub_uint64_t start; \ + VasEBoot_uint64_t start; \ /* On 9600 we have to wait up to 12 milliseconds. */ \ - start = grub_get_time_ms (); \ + start = VasEBoot_get_time_ms (); \ do \ c = readkey (term); \ - while (c == -1 && grub_get_time_ms () - start < 100); \ + while (c == -1 && VasEBoot_get_time_ms () - start < 100); \ if (c == -1) \ return; \ \ @@ -432,7 +432,7 @@ grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, if (c == 0x7f) c = '\b'; if (c < 0x20 && c != '\t' && c!= '\b' && c != '\n' && c != '\r') - c = GRUB_TERM_CTRL | (c - 1 + 'a'); + c = VasEBoot_TERM_CTRL | (c - 1 + 'a'); *len = 1; keys[0] = c; return; @@ -446,45 +446,45 @@ grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, } three_code_table[] = { - {'4', GRUB_TERM_KEY_DC}, - {'A', GRUB_TERM_KEY_UP}, - {'B', GRUB_TERM_KEY_DOWN}, - {'C', GRUB_TERM_KEY_RIGHT}, - {'D', GRUB_TERM_KEY_LEFT}, - {'F', GRUB_TERM_KEY_END}, - {'H', GRUB_TERM_KEY_HOME}, - {'K', GRUB_TERM_KEY_END}, - {'P', GRUB_TERM_KEY_DC}, - {'?', GRUB_TERM_KEY_PPAGE}, - {'/', GRUB_TERM_KEY_NPAGE}, - {'@', GRUB_TERM_KEY_INSERT}, + {'4', VasEBoot_TERM_KEY_DC}, + {'A', VasEBoot_TERM_KEY_UP}, + {'B', VasEBoot_TERM_KEY_DOWN}, + {'C', VasEBoot_TERM_KEY_RIGHT}, + {'D', VasEBoot_TERM_KEY_LEFT}, + {'F', VasEBoot_TERM_KEY_END}, + {'H', VasEBoot_TERM_KEY_HOME}, + {'K', VasEBoot_TERM_KEY_END}, + {'P', VasEBoot_TERM_KEY_DC}, + {'?', VasEBoot_TERM_KEY_PPAGE}, + {'/', VasEBoot_TERM_KEY_NPAGE}, + {'@', VasEBoot_TERM_KEY_INSERT}, }; static unsigned four_code_table[] = { - [1] = GRUB_TERM_KEY_HOME, - [3] = GRUB_TERM_KEY_DC, - [5] = GRUB_TERM_KEY_PPAGE, - [6] = GRUB_TERM_KEY_NPAGE, - [7] = GRUB_TERM_KEY_HOME, - [8] = GRUB_TERM_KEY_END, - [17] = GRUB_TERM_KEY_F6, - [18] = GRUB_TERM_KEY_F7, - [19] = GRUB_TERM_KEY_F8, - [20] = GRUB_TERM_KEY_F9, - [21] = GRUB_TERM_KEY_F10, - [23] = GRUB_TERM_KEY_F11, - [24] = GRUB_TERM_KEY_F12, + [1] = VasEBoot_TERM_KEY_HOME, + [3] = VasEBoot_TERM_KEY_DC, + [5] = VasEBoot_TERM_KEY_PPAGE, + [6] = VasEBoot_TERM_KEY_NPAGE, + [7] = VasEBoot_TERM_KEY_HOME, + [8] = VasEBoot_TERM_KEY_END, + [17] = VasEBoot_TERM_KEY_F6, + [18] = VasEBoot_TERM_KEY_F7, + [19] = VasEBoot_TERM_KEY_F8, + [20] = VasEBoot_TERM_KEY_F9, + [21] = VasEBoot_TERM_KEY_F10, + [23] = VasEBoot_TERM_KEY_F11, + [24] = VasEBoot_TERM_KEY_F12, }; char fx_key[] = { 'P', 'Q', 'w', 'x', 't', 'u', 'q', 'r', 'p', 'M', 'A', 'B', 'H', 'F' }; unsigned fx_code[] = - { GRUB_TERM_KEY_F1, GRUB_TERM_KEY_F2, GRUB_TERM_KEY_F3, - GRUB_TERM_KEY_F4, GRUB_TERM_KEY_F5, GRUB_TERM_KEY_F6, - GRUB_TERM_KEY_F7, GRUB_TERM_KEY_F8, GRUB_TERM_KEY_F9, - GRUB_TERM_KEY_F10, GRUB_TERM_KEY_F11, GRUB_TERM_KEY_F12, - GRUB_TERM_KEY_HOME, GRUB_TERM_KEY_END }; + { VasEBoot_TERM_KEY_F1, VasEBoot_TERM_KEY_F2, VasEBoot_TERM_KEY_F3, + VasEBoot_TERM_KEY_F4, VasEBoot_TERM_KEY_F5, VasEBoot_TERM_KEY_F6, + VasEBoot_TERM_KEY_F7, VasEBoot_TERM_KEY_F8, VasEBoot_TERM_KEY_F9, + VasEBoot_TERM_KEY_F10, VasEBoot_TERM_KEY_F11, VasEBoot_TERM_KEY_F12, + VasEBoot_TERM_KEY_HOME, VasEBoot_TERM_KEY_END }; unsigned i; if (c == '\e') @@ -524,7 +524,7 @@ grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, CONTINUE_READ; if (c >= 'A' && c <= 'E') { - keys[0] = GRUB_TERM_KEY_F1 + c - 'A'; + keys[0] = VasEBoot_TERM_KEY_F1 + c - 'A'; *len = 1; return; } @@ -588,31 +588,31 @@ grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, /* The terminfo version of getkey. */ int -grub_terminfo_getkey (struct grub_term_input *termi) +VasEBoot_terminfo_getkey (struct VasEBoot_term_input *termi) { - struct grub_terminfo_input_state *data - = (struct grub_terminfo_input_state *) (termi->data); + struct VasEBoot_terminfo_input_state *data + = (struct VasEBoot_terminfo_input_state *) (termi->data); if (data->npending) { int ret; data->npending--; ret = data->input_buf[0]; - grub_memmove (data->input_buf, data->input_buf + 1, data->npending + VasEBoot_memmove (data->input_buf, data->input_buf + 1, data->npending * sizeof (data->input_buf[0])); return ret; } - grub_terminfo_readkey (termi, data->input_buf, + VasEBoot_terminfo_readkey (termi, data->input_buf, &data->npending, data->readkey); -#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275) +#if defined(__powerpc__) && defined(VasEBoot_MACHINE_IEEE1275) if (data->npending == 1 && data->input_buf[0] == '\e' - && grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT) - && grub_get_time_ms () - data->last_key_time < 1000 - && (data->last_key & GRUB_TERM_EXTENDED)) + && VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_BROKEN_REPEAT) + && VasEBoot_get_time_ms () - data->last_key_time < 1000 + && (data->last_key & VasEBoot_TERM_EXTENDED)) { data->npending = 0; - data->last_key_time = grub_get_time_ms (); + data->last_key_time = VasEBoot_get_time_ms (); return data->last_key; } #endif @@ -622,79 +622,79 @@ grub_terminfo_getkey (struct grub_term_input *termi) int ret; data->npending--; ret = data->input_buf[0]; -#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275) - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT)) +#if defined(__powerpc__) && defined(VasEBoot_MACHINE_IEEE1275) + if (VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_BROKEN_REPEAT)) { data->last_key = ret; - data->last_key_time = grub_get_time_ms (); + data->last_key_time = VasEBoot_get_time_ms (); } #endif - grub_memmove (data->input_buf, data->input_buf + 1, data->npending + VasEBoot_memmove (data->input_buf, data->input_buf + 1, data->npending * sizeof (data->input_buf[0])); return ret; } - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; } -grub_err_t -grub_terminfo_input_init (struct grub_term_input *termi) +VasEBoot_err_t +VasEBoot_terminfo_input_init (struct VasEBoot_term_input *termi) { - struct grub_terminfo_input_state *data - = (struct grub_terminfo_input_state *) (termi->data); + struct VasEBoot_terminfo_input_state *data + = (struct VasEBoot_terminfo_input_state *) (termi->data); data->npending = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_terminfo_output_init (struct grub_term_output *term) +VasEBoot_err_t +VasEBoot_terminfo_output_init (struct VasEBoot_term_output *term) { - grub_terminfo_cls (term); - return GRUB_ERR_NONE; + VasEBoot_terminfo_cls (term); + return VasEBoot_ERR_NONE; } -/* GRUB Command. */ +/* VasEBoot Command. */ -static grub_err_t +static VasEBoot_err_t print_terminfo (void) { - const char *encoding_names[(GRUB_TERM_CODE_TYPE_MASK - >> GRUB_TERM_CODE_TYPE_SHIFT) + 1] + const char *encoding_names[(VasEBoot_TERM_CODE_TYPE_MASK + >> VasEBoot_TERM_CODE_TYPE_SHIFT) + 1] = { /* VGA and glyph descriptor types are just for completeness, they are not used on terminfo terminals. */ - [GRUB_TERM_CODE_TYPE_ASCII >> GRUB_TERM_CODE_TYPE_SHIFT] = _("ASCII"), - [GRUB_TERM_CODE_TYPE_CP437 >> GRUB_TERM_CODE_TYPE_SHIFT] = "CP-437", - [GRUB_TERM_CODE_TYPE_UTF8_LOGICAL >> GRUB_TERM_CODE_TYPE_SHIFT] + [VasEBoot_TERM_CODE_TYPE_ASCII >> VasEBoot_TERM_CODE_TYPE_SHIFT] = _("ASCII"), + [VasEBoot_TERM_CODE_TYPE_CP437 >> VasEBoot_TERM_CODE_TYPE_SHIFT] = "CP-437", + [VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL >> VasEBoot_TERM_CODE_TYPE_SHIFT] = _("UTF-8"), - [GRUB_TERM_CODE_TYPE_UTF8_VISUAL >> GRUB_TERM_CODE_TYPE_SHIFT] + [VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL >> VasEBoot_TERM_CODE_TYPE_SHIFT] /* TRANSLATORS: visually ordered UTF-8 is a non-compliant encoding based on UTF-8 with right-to-left languages written in reverse. Used on some terminals. Normal UTF-8 is refered as "logically-ordered UTF-8" by opposition. */ = _("visually-ordered UTF-8"), - [GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS >> GRUB_TERM_CODE_TYPE_SHIFT] + [VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS >> VasEBoot_TERM_CODE_TYPE_SHIFT] = "Glyph descriptors", _("Unknown encoding"), _("Unknown encoding"), _("Unknown encoding") }; - struct grub_term_output *cur; + struct VasEBoot_term_output *cur; - grub_puts_ (N_("Current terminfo types:")); + VasEBoot_puts_ (N_("Current terminfo types:")); for (cur = terminfo_outputs; cur; - cur = ((struct grub_terminfo_output_state *) cur->data)->next) - grub_printf ("%s: %s\t%s\t%dx%d\n", cur->name, - grub_terminfo_get_current(cur), - encoding_names[(cur->flags & GRUB_TERM_CODE_TYPE_MASK) - >> GRUB_TERM_CODE_TYPE_SHIFT], - ((struct grub_terminfo_output_state *) cur->data)->pos.x, - ((struct grub_terminfo_output_state *) cur->data)->pos.y); + cur = ((struct VasEBoot_terminfo_output_state *) cur->data)->next) + VasEBoot_printf ("%s: %s\t%s\t%dx%d\n", cur->name, + VasEBoot_terminfo_get_current(cur), + encoding_names[(cur->flags & VasEBoot_TERM_CODE_TYPE_MASK) + >> VasEBoot_TERM_CODE_TYPE_SHIFT], + ((struct VasEBoot_terminfo_output_state *) cur->data)->pos.x, + ((struct VasEBoot_terminfo_output_state *) cur->data)->pos.y); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static const struct grub_arg_option options[] = +static const struct VasEBoot_arg_option options[] = { {"ascii", 'a', 0, N_("Terminal is ASCII-only [default]."), 0, ARG_TYPE_NONE}, {"utf8", 'u', 0, N_("Terminal is logical-ordered UTF-8."), 0, ARG_TYPE_NONE}, @@ -715,79 +715,79 @@ enum OPTION_GEOMETRY }; -static grub_err_t -grub_cmd_terminfo (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +VasEBoot_cmd_terminfo (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { - struct grub_term_output *cur; - int encoding = GRUB_TERM_CODE_TYPE_ASCII; - struct grub_arg_list *state = ctxt->state; + struct VasEBoot_term_output *cur; + int encoding = VasEBoot_TERM_CODE_TYPE_ASCII; + struct VasEBoot_arg_list *state = ctxt->state; int w = 0, h = 0; if (argc == 0) return print_terminfo (); if (state[OPTION_ASCII].set) - encoding = GRUB_TERM_CODE_TYPE_ASCII; + encoding = VasEBoot_TERM_CODE_TYPE_ASCII; if (state[OPTION_UTF8].set) - encoding = GRUB_TERM_CODE_TYPE_UTF8_LOGICAL; + encoding = VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL; if (state[OPTION_VISUAL_UTF8].set) - encoding = GRUB_TERM_CODE_TYPE_UTF8_VISUAL; + encoding = VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL; if (state[OPTION_GEOMETRY].set) { char *ptr = state[OPTION_GEOMETRY].arg; - w = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + w = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; if (*ptr != 'x') - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("incorrect terminal dimensions specification")); ptr++; - h = grub_strtoul (ptr, &ptr, 0); - if (grub_errno) - return grub_errno; + h = VasEBoot_strtoul (ptr, &ptr, 0); + if (VasEBoot_errno) + return VasEBoot_errno; } for (cur = terminfo_outputs; cur; - cur = ((struct grub_terminfo_output_state *) cur->data)->next) - if (grub_strcmp (args[0], cur->name) == 0 - || (grub_strcmp (args[0], "ofconsole") == 0 - && grub_strcmp ("console", cur->name) == 0)) + cur = ((struct VasEBoot_terminfo_output_state *) cur->data)->next) + if (VasEBoot_strcmp (args[0], cur->name) == 0 + || (VasEBoot_strcmp (args[0], "ofconsole") == 0 + && VasEBoot_strcmp ("console", cur->name) == 0)) { - cur->flags = (cur->flags & ~GRUB_TERM_CODE_TYPE_MASK) | encoding; + cur->flags = (cur->flags & ~VasEBoot_TERM_CODE_TYPE_MASK) | encoding; if (w && h) { - struct grub_terminfo_output_state *data - = (struct grub_terminfo_output_state *) cur->data; + struct VasEBoot_terminfo_output_state *data + = (struct VasEBoot_terminfo_output_state *) cur->data; data->size.x = w; data->size.y = h; } if (argc == 1) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - return grub_terminfo_set_current (cur, args[1]); + return VasEBoot_terminfo_set_current (cur, args[1]); } - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("terminal %s isn't found or it's not handled by terminfo"), args[0]); } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(terminfo) +VasEBoot_MOD_INIT(terminfo) { - cmd = grub_register_extcmd ("terminfo", grub_cmd_terminfo, 0, + cmd = VasEBoot_register_extcmd ("terminfo", VasEBoot_cmd_terminfo, 0, N_("[[-a|-u|-v] [-g WxH] TERM [TYPE]]"), N_("Set terminfo type of TERM to TYPE.\n"), options); } -GRUB_MOD_FINI(terminfo) +VasEBoot_MOD_FINI(terminfo) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/term/tparm.c b/VasEBoot-core/term/tparm.c index fb5b15a88..d7a9b5fc6 100644 --- a/VasEBoot-core/term/tparm.c +++ b/VasEBoot-core/term/tparm.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1998-2003,2004,2005 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /********************************************************************** * This code is a modification of lib_tparm.c found in ncurses-5.2. The - * modification are for use in grub by replacing all libc function through - * special grub functions. This also meant to delete all dynamic memory + * modification are for use in VasEBoot by replacing all libc function through + * special VasEBoot functions. This also meant to delete all dynamic memory * allocation and replace it by a number of fixed buffers. * * Modifications by Tilmann Bubeck 2002 @@ -38,15 +38,15 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include /* * Common/troublesome character definitions */ -typedef char grub_bool_t; +typedef char VasEBoot_bool_t; #ifndef FALSE # define FALSE (0) #endif @@ -133,7 +133,7 @@ typedef struct { int num; char *str; } data; - grub_bool_t num_type; + VasEBoot_bool_t num_type; } stack_frame; static stack_frame stack[STACKSIZE]; @@ -141,19 +141,19 @@ static int stack_ptr; static const char *tparam_base = ""; static char *out_buff; -static grub_size_t out_size; -static grub_size_t out_used; +static VasEBoot_size_t out_size; +static VasEBoot_size_t out_used; static char *fmt_buff; -static grub_size_t fmt_size; +static VasEBoot_size_t fmt_size; static inline void -get_space(grub_size_t need) +get_space(VasEBoot_size_t need) { need += out_used; if (need > out_size) { out_size = need * 2; - out_buff = grub_realloc(out_buff, out_size*sizeof(char)); + out_buff = VasEBoot_realloc(out_buff, out_size*sizeof(char)); /* FIX ME! handle out_buff == 0. */ } } @@ -163,14 +163,14 @@ get_space(grub_size_t need) static inline void save_text(const char *fmt, const char *s, int len) { - grub_size_t s_len = grub_strlen(s); + VasEBoot_size_t s_len = VasEBoot_strlen(s); if (len > (int) s_len) s_len = len; get_space(s_len + 1); - (void) grub_snprintf(out_buff + out_used, s_len + 1, fmt, s); - out_used += grub_strlen(out_buff + out_used); + (void) VasEBoot_snprintf(out_buff + out_used, s_len + 1, fmt, s); + out_used += VasEBoot_strlen(out_buff + out_used); } static inline void @@ -181,8 +181,8 @@ save_number(const char *fmt, int number, int len) get_space((unsigned) len + 1); - (void) grub_snprintf(out_buff + out_used, len + 1, fmt, number); - out_used += grub_strlen(out_buff + out_used); + (void) VasEBoot_snprintf(out_buff + out_used, len + 1, fmt, number); + out_used += VasEBoot_strlen(out_buff + out_used); } #pragma GCC diagnostic error "-Wformat-nonliteral" @@ -246,10 +246,10 @@ parse_format(const char *s, char *format, int *len) { *len = 0; if (format != 0) { - grub_bool_t done = FALSE; - grub_bool_t allowminus = FALSE; - grub_bool_t dot = FALSE; - grub_bool_t err = FALSE; + VasEBoot_bool_t done = FALSE; + VasEBoot_bool_t allowminus = FALSE; + VasEBoot_bool_t dot = FALSE; + VasEBoot_bool_t err = FALSE; char *fmt = format; int my_width = 0; int my_prec = 0; @@ -347,7 +347,7 @@ parse_format(const char *s, char *format, int *len) static inline int analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) { - grub_size_t len2; + VasEBoot_size_t len2; int i; int lastpop = -1; int len; @@ -360,13 +360,13 @@ analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) if (cp == 0) return 0; - if ((len2 = grub_strlen(cp)) > fmt_size) { + if ((len2 = VasEBoot_strlen(cp)) > fmt_size) { fmt_size = len2 + fmt_size + 2; - if ((fmt_buff = grub_realloc(fmt_buff, fmt_size*sizeof(char))) == 0) + if ((fmt_buff = VasEBoot_realloc(fmt_buff, fmt_size*sizeof(char))) == 0) return 0; } - grub_memset(p_is_s, 0, sizeof(p_is_s[0]) * NUM_PARM); + VasEBoot_memset(p_is_s, 0, sizeof(p_is_s[0]) * NUM_PARM); while ((cp - string) < (int) len2) { if (*cp == '%') { @@ -473,7 +473,7 @@ tparam_internal(const char *string, va_list ap) int x, y; int i; const char *cp = string; - grub_size_t len2; + VasEBoot_size_t len2; static int dynamic_var[NUM_VARS]; static int static_vars[NUM_VARS]; @@ -482,7 +482,7 @@ tparam_internal(const char *string, va_list ap) out_used = out_size = fmt_size = 0; - len2 = (int) grub_strlen(cp); + len2 = (int) VasEBoot_strlen(cp); /* * Find the highest parameter-number referred to in the format string. @@ -545,7 +545,7 @@ tparam_internal(const char *string, va_list ap) break; case 'l': - save_number("%d", (int) grub_strlen(spop()), 0); + save_number("%d", (int) VasEBoot_strlen(spop()), 0); break; case 's': @@ -618,14 +618,14 @@ tparam_internal(const char *string, va_list ap) case '/': y = npop(); x = npop(); - /* GRUB has no signed divisions. */ + /* VasEBoot has no signed divisions. */ npush(y ? ((unsigned)x / (unsigned)y) : 0); break; case 'm': y = npop(); x = npop(); - /* GRUB has no signed divisions. */ + /* VasEBoot has no signed divisions. */ npush(y ? ((unsigned)x % (unsigned)y) : 0); break; @@ -752,7 +752,7 @@ tparam_internal(const char *string, va_list ap) } const char * -grub_terminfo_tparm (const char *string, ...) +VasEBoot_terminfo_tparm (const char *string, ...) { va_list ap; char *result; diff --git a/VasEBoot-core/term/uboot/console.c b/VasEBoot-core/term/uboot/console.c index dfdbe9909..7f092d4e3 100644 --- a/VasEBoot-core/term/uboot/console.c +++ b/VasEBoot-core/term/uboot/console.c @@ -1,132 +1,132 @@ /* console.c - console interface layer for U-Boot platforms */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { - grub_uboot_putc (c); + VasEBoot_uboot_putc (c); } static int -readkey (struct grub_term_input *term __attribute__ ((unused))) +readkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { - if (grub_uboot_tstc () > 0) - return grub_uboot_getc (); + if (VasEBoot_uboot_tstc () > 0) + return VasEBoot_uboot_getc (); return -1; } static void -uboot_console_setcursor (struct grub_term_output *term +uboot_console_setcursor (struct VasEBoot_term_output *term __attribute__ ((unused)), int on __attribute__ ((unused))) { - grub_terminfo_setcursor (term, on); + VasEBoot_terminfo_setcursor (term, on); } -static grub_err_t -uboot_console_init_input (struct grub_term_input *term) +static VasEBoot_err_t +uboot_console_init_input (struct VasEBoot_term_input *term) { - return grub_terminfo_input_init (term); + return VasEBoot_terminfo_input_init (term); } -extern struct grub_terminfo_output_state uboot_console_terminfo_output; +extern struct VasEBoot_terminfo_output_state uboot_console_terminfo_output; -static grub_err_t -uboot_console_init_output (struct grub_term_output *term) +static VasEBoot_err_t +uboot_console_init_output (struct VasEBoot_term_output *term) { - grub_terminfo_output_init (term); + VasEBoot_terminfo_output_init (term); return 0; } -struct grub_terminfo_input_state uboot_console_terminfo_input = { +struct VasEBoot_terminfo_input_state uboot_console_terminfo_input = { .readkey = readkey }; -struct grub_terminfo_output_state uboot_console_terminfo_output = { +struct VasEBoot_terminfo_output_state uboot_console_terminfo_output = { .put = put, /* FIXME: In rare cases when console isn't serial, determine real width. */ .size = { 80, 24 } }; -static struct grub_term_input uboot_console_term_input = { +static struct VasEBoot_term_input uboot_console_term_input = { .name = "console", .init = uboot_console_init_input, - .getkey = grub_terminfo_getkey, + .getkey = VasEBoot_terminfo_getkey, .data = &uboot_console_terminfo_input }; -static struct grub_term_output uboot_console_term_output = { +static struct VasEBoot_term_output uboot_console_term_output = { .name = "console", .init = uboot_console_init_output, - .putchar = grub_terminfo_putchar, - .getwh = grub_terminfo_getwh, - .getxy = grub_terminfo_getxy, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, - .setcolorstate = grub_terminfo_setcolorstate, + .putchar = VasEBoot_terminfo_putchar, + .getwh = VasEBoot_terminfo_getwh, + .getxy = VasEBoot_terminfo_getxy, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, + .setcolorstate = VasEBoot_terminfo_setcolorstate, .setcursor = uboot_console_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, .data = &uboot_console_terminfo_output, - .progress_update_divisor = GRUB_PROGRESS_FAST + .progress_update_divisor = VasEBoot_PROGRESS_FAST }; void -grub_console_init_early (void) +VasEBoot_console_init_early (void) { - grub_term_register_input ("console", &uboot_console_term_input); - grub_term_register_output ("console", &uboot_console_term_output); + VasEBoot_term_register_input ("console", &uboot_console_term_input); + VasEBoot_term_register_output ("console", &uboot_console_term_output); } /* - * grub_console_init_lately(): + * VasEBoot_console_init_lately(): * Initializes terminfo formatting by registering terminal type. * Called after heap has been configured. * */ void -grub_console_init_lately (void) +VasEBoot_console_init_lately (void) { const char *type; /* See if explicitly set by U-Boot environment */ - type = grub_uboot_env_get ("grub_term"); + type = VasEBoot_uboot_env_get ("VasEBoot_term"); if (!type) type = "vt100"; - grub_terminfo_init (); - grub_terminfo_output_register (&uboot_console_term_output, type); + VasEBoot_terminfo_init (); + VasEBoot_terminfo_output_register (&uboot_console_term_output, type); } void -grub_console_fini (void) +VasEBoot_console_fini (void) { } diff --git a/VasEBoot-core/term/usb_keyboard.c b/VasEBoot-core/term/usb_keyboard.c index e67b8f785..a5f2b13aa 100644 --- a/VasEBoot-core/term/usb_keyboard.c +++ b/VasEBoot-core/term/usb_keyboard.c @@ -1,32 +1,32 @@ /* Support for the HID Boot Protocol. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); @@ -57,74 +57,74 @@ enum #define USB_HID_BOOT_SUBCLASS 0x01 #define USB_HID_KBD_PROTOCOL 0x01 -#define GRUB_USB_KEYBOARD_LEFT_CTRL 0x01 -#define GRUB_USB_KEYBOARD_LEFT_SHIFT 0x02 -#define GRUB_USB_KEYBOARD_LEFT_ALT 0x04 -#define GRUB_USB_KEYBOARD_RIGHT_CTRL 0x10 -#define GRUB_USB_KEYBOARD_RIGHT_SHIFT 0x20 -#define GRUB_USB_KEYBOARD_RIGHT_ALT 0x40 +#define VasEBoot_USB_KEYBOARD_LEFT_CTRL 0x01 +#define VasEBoot_USB_KEYBOARD_LEFT_SHIFT 0x02 +#define VasEBoot_USB_KEYBOARD_LEFT_ALT 0x04 +#define VasEBoot_USB_KEYBOARD_RIGHT_CTRL 0x10 +#define VasEBoot_USB_KEYBOARD_RIGHT_SHIFT 0x20 +#define VasEBoot_USB_KEYBOARD_RIGHT_ALT 0x40 -struct grub_usb_keyboard_data +struct VasEBoot_usb_keyboard_data { - grub_usb_device_t usbdev; - grub_uint8_t status; - grub_uint16_t mods; + VasEBoot_usb_device_t usbdev; + VasEBoot_uint8_t status; + VasEBoot_uint16_t mods; int interfno; - struct grub_usb_desc_endp *endp; - grub_usb_transfer_t transfer; - grub_uint8_t report[8]; + struct VasEBoot_usb_desc_endp *endp; + VasEBoot_usb_transfer_t transfer; + VasEBoot_uint8_t report[8]; int dead; int last_key; - grub_uint64_t repeat_time; - grub_uint8_t current_report[8]; - grub_uint8_t last_report[8]; + VasEBoot_uint64_t repeat_time; + VasEBoot_uint8_t current_report[8]; + VasEBoot_uint8_t last_report[8]; int index; int max_index; }; -static int grub_usb_keyboard_getkey (struct grub_term_input *term); -static int grub_usb_keyboard_getkeystatus (struct grub_term_input *term); +static int VasEBoot_usb_keyboard_getkey (struct VasEBoot_term_input *term); +static int VasEBoot_usb_keyboard_getkeystatus (struct VasEBoot_term_input *term); -static struct grub_term_input grub_usb_keyboard_term = +static struct VasEBoot_term_input VasEBoot_usb_keyboard_term = { - .getkey = grub_usb_keyboard_getkey, - .getkeystatus = grub_usb_keyboard_getkeystatus, + .getkey = VasEBoot_usb_keyboard_getkey, + .getkeystatus = VasEBoot_usb_keyboard_getkeystatus, .next = 0 }; -static struct grub_term_input grub_usb_keyboards[16]; +static struct VasEBoot_term_input VasEBoot_usb_keyboards[16]; static int -interpret_status (grub_uint8_t data0) +interpret_status (VasEBoot_uint8_t data0) { int mods = 0; /* Check Shift, Control, and Alt status. */ - if (data0 & GRUB_USB_KEYBOARD_LEFT_SHIFT) - mods |= GRUB_TERM_STATUS_LSHIFT; - if (data0 & GRUB_USB_KEYBOARD_RIGHT_SHIFT) - mods |= GRUB_TERM_STATUS_RSHIFT; - if (data0 & GRUB_USB_KEYBOARD_LEFT_CTRL) - mods |= GRUB_TERM_STATUS_LCTRL; - if (data0 & GRUB_USB_KEYBOARD_RIGHT_CTRL) - mods |= GRUB_TERM_STATUS_RCTRL; - if (data0 & GRUB_USB_KEYBOARD_LEFT_ALT) - mods |= GRUB_TERM_STATUS_LALT; - if (data0 & GRUB_USB_KEYBOARD_RIGHT_ALT) - mods |= GRUB_TERM_STATUS_RALT; + if (data0 & VasEBoot_USB_KEYBOARD_LEFT_SHIFT) + mods |= VasEBoot_TERM_STATUS_LSHIFT; + if (data0 & VasEBoot_USB_KEYBOARD_RIGHT_SHIFT) + mods |= VasEBoot_TERM_STATUS_RSHIFT; + if (data0 & VasEBoot_USB_KEYBOARD_LEFT_CTRL) + mods |= VasEBoot_TERM_STATUS_LCTRL; + if (data0 & VasEBoot_USB_KEYBOARD_RIGHT_CTRL) + mods |= VasEBoot_TERM_STATUS_RCTRL; + if (data0 & VasEBoot_USB_KEYBOARD_LEFT_ALT) + mods |= VasEBoot_TERM_STATUS_LALT; + if (data0 & VasEBoot_USB_KEYBOARD_RIGHT_ALT) + mods |= VasEBoot_TERM_STATUS_RALT; return mods; } static void -grub_usb_keyboard_detach (grub_usb_device_t usbdev, +VasEBoot_usb_keyboard_detach (VasEBoot_usb_device_t usbdev, int config __attribute__ ((unused)), int interface __attribute__ ((unused))) { unsigned i; - for (i = 0; i < ARRAY_SIZE (grub_usb_keyboards); i++) + for (i = 0; i < ARRAY_SIZE (VasEBoot_usb_keyboards); i++) { - struct grub_usb_keyboard_data *data = grub_usb_keyboards[i].data; + struct VasEBoot_usb_keyboard_data *data = VasEBoot_usb_keyboards[i].data; if (!data) continue; @@ -133,33 +133,33 @@ grub_usb_keyboard_detach (grub_usb_device_t usbdev, continue; if (data->transfer) - grub_usb_cancel_transfer (data->transfer); + VasEBoot_usb_cancel_transfer (data->transfer); - grub_term_unregister_input (&grub_usb_keyboards[i]); - grub_free ((char *) grub_usb_keyboards[i].name); - grub_usb_keyboards[i].name = NULL; - grub_free (grub_usb_keyboards[i].data); - grub_usb_keyboards[i].data = 0; + VasEBoot_term_unregister_input (&VasEBoot_usb_keyboards[i]); + VasEBoot_free ((char *) VasEBoot_usb_keyboards[i].name); + VasEBoot_usb_keyboards[i].name = NULL; + VasEBoot_free (VasEBoot_usb_keyboards[i].data); + VasEBoot_usb_keyboards[i].data = 0; } } static int -grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) +VasEBoot_usb_keyboard_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno) { unsigned curnum; - struct grub_usb_keyboard_data *data; - struct grub_usb_desc_endp *endp = NULL; + struct VasEBoot_usb_keyboard_data *data; + struct VasEBoot_usb_desc_endp *endp = NULL; int j; - grub_dprintf ("usb_keyboard", "%x %x %x %d %d\n", + VasEBoot_dprintf ("usb_keyboard", "%x %x %x %d %d\n", usbdev->descdev.class, usbdev->descdev.subclass, usbdev->descdev.protocol, configno, interfno); - for (curnum = 0; curnum < ARRAY_SIZE (grub_usb_keyboards); curnum++) - if (!grub_usb_keyboards[curnum].data) + for (curnum = 0; curnum < ARRAY_SIZE (VasEBoot_usb_keyboards); curnum++) + if (!VasEBoot_usb_keyboards[curnum].data) break; - if (curnum == ARRAY_SIZE (grub_usb_keyboards)) + if (curnum == ARRAY_SIZE (VasEBoot_usb_keyboards)) return 0; if (usbdev->descdev.class != 0 @@ -177,19 +177,19 @@ grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) { endp = &usbdev->config[configno].interf[interfno].descendp[j]; - if ((endp->endp_addr & 128) && grub_usb_get_ep_type(endp) - == GRUB_USB_EP_INTERRUPT) + if ((endp->endp_addr & 128) && VasEBoot_usb_get_ep_type(endp) + == VasEBoot_USB_EP_INTERRUPT) break; } if (j == usbdev->config[configno].interf[interfno].descif->endpointcnt) return 0; - grub_dprintf ("usb_keyboard", "HID found!\n"); + VasEBoot_dprintf ("usb_keyboard", "HID found!\n"); - data = grub_malloc (sizeof (*data)); + data = VasEBoot_malloc (sizeof (*data)); if (!data) { - grub_print_error (); + VasEBoot_print_error (); return 0; } @@ -198,25 +198,25 @@ grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) data->endp = endp; /* Configure device */ - grub_usb_set_configuration (usbdev, configno + 1); + VasEBoot_usb_set_configuration (usbdev, configno + 1); /* Place the device in boot mode. */ - grub_usb_control_msg (usbdev, GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT, + VasEBoot_usb_control_msg (usbdev, VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT, USB_HID_SET_PROTOCOL, 0, interfno, 0, 0); /* Reports every time an event occurs and not more often than that. */ - grub_usb_control_msg (usbdev, GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT, + VasEBoot_usb_control_msg (usbdev, VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT, USB_HID_SET_IDLE, 0<<8, interfno, 0, 0); - grub_memcpy (&grub_usb_keyboards[curnum], &grub_usb_keyboard_term, - sizeof (grub_usb_keyboards[curnum])); - grub_usb_keyboards[curnum].data = data; + VasEBoot_memcpy (&VasEBoot_usb_keyboards[curnum], &VasEBoot_usb_keyboard_term, + sizeof (VasEBoot_usb_keyboards[curnum])); + VasEBoot_usb_keyboards[curnum].data = data; usbdev->config[configno].interf[interfno].detach_hook - = grub_usb_keyboard_detach; - grub_usb_keyboards[curnum].name = grub_xasprintf ("usb_keyboard%d", curnum); - if (!grub_usb_keyboards[curnum].name) + = VasEBoot_usb_keyboard_detach; + VasEBoot_usb_keyboards[curnum].name = VasEBoot_xasprintf ("usb_keyboard%d", curnum); + if (!VasEBoot_usb_keyboards[curnum].name) { - grub_print_error (); + VasEBoot_print_error (); return 0; } @@ -227,10 +227,10 @@ grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) */ #if 0 { - grub_uint8_t report[8]; - grub_usb_err_t err; - grub_memset (report, 0, sizeof (report)); - err = grub_usb_control_msg (usbdev, GRUB_USB_REQTYPE_CLASS_INTERFACE_IN, + VasEBoot_uint8_t report[8]; + VasEBoot_usb_err_t err; + VasEBoot_memset (report, 0, sizeof (report)); + err = VasEBoot_usb_control_msg (usbdev, VasEBoot_USB_REQTYPE_CLASS_INTERFACE_IN, USB_HID_GET_REPORT, 0x0100, interfno, sizeof (report), (char *) report); if (err) @@ -242,13 +242,13 @@ grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) data->status = 0; #endif - data->transfer = grub_usb_bulk_read_background (usbdev, + data->transfer = VasEBoot_usb_bulk_read_background (usbdev, data->endp, sizeof (data->report), (char *) data->report); if (!data->transfer) { - grub_print_error (); + VasEBoot_print_error (); return 0; } @@ -256,7 +256,7 @@ grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) data->mods = 0; data->dead = 0; - grub_term_register_input_active ("usb_keyboard", &grub_usb_keyboards[curnum]); + VasEBoot_term_register_input_active ("usb_keyboard", &VasEBoot_usb_keyboards[curnum]); return 1; } @@ -264,22 +264,22 @@ grub_usb_keyboard_attach (grub_usb_device_t usbdev, int configno, int interfno) static void -send_leds (struct grub_usb_keyboard_data *termdata) +send_leds (struct VasEBoot_usb_keyboard_data *termdata) { char report[1]; report[0] = 0; - if (termdata->mods & GRUB_TERM_STATUS_CAPS) + if (termdata->mods & VasEBoot_TERM_STATUS_CAPS) report[0] |= LED_CAPS_LOCK; - if (termdata->mods & GRUB_TERM_STATUS_NUM) + if (termdata->mods & VasEBoot_TERM_STATUS_NUM) report[0] |= LED_NUM_LOCK; - grub_usb_control_msg (termdata->usbdev, GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT, + VasEBoot_usb_control_msg (termdata->usbdev, VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT, USB_HID_SET_REPORT, 0x0200, termdata->interfno, sizeof (report), (char *) report); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } static int -parse_keycode (struct grub_usb_keyboard_data *termdata) +parse_keycode (struct VasEBoot_usb_keyboard_data *termdata) { int index = termdata->index; int i, keycode; @@ -302,10 +302,10 @@ parse_keycode (struct grub_usb_keyboard_data *termdata) if (keycode != KEY_NO_KEY) /* Don't replace last report with current faulty report * in future ! */ - grub_memcpy (termdata->current_report, + VasEBoot_memcpy (termdata->current_report, termdata->last_report, sizeof (termdata->report)); - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; } /* Try to find current keycode in last report. */ @@ -319,24 +319,24 @@ parse_keycode (struct grub_usb_keyboard_data *termdata) if (keycode == KEY_CAPS_LOCK) { - termdata->mods ^= GRUB_TERM_STATUS_CAPS; + termdata->mods ^= VasEBoot_TERM_STATUS_CAPS; send_leds (termdata); continue; } if (keycode == KEY_NUM_LOCK) { - termdata->mods ^= GRUB_TERM_STATUS_NUM; + termdata->mods ^= VasEBoot_TERM_STATUS_NUM; send_leds (termdata); continue; } - termdata->last_key = grub_term_map_key (keycode, + termdata->last_key = VasEBoot_term_map_key (keycode, interpret_status (termdata->current_report[0]) | termdata->mods); - termdata->repeat_time = grub_get_time_ms () + GRUB_TERM_REPEAT_PRE_INTERVAL; + termdata->repeat_time = VasEBoot_get_time_ms () + VasEBoot_TERM_REPEAT_PRE_INTERVAL; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; index++; if (index >= termdata->max_index) @@ -349,63 +349,63 @@ parse_keycode (struct grub_usb_keyboard_data *termdata) /* All keycodes parsed */ termdata->index = 0; - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; } static int -grub_usb_keyboard_getkey (struct grub_term_input *term) +VasEBoot_usb_keyboard_getkey (struct VasEBoot_term_input *term) { - grub_usb_err_t err; - struct grub_usb_keyboard_data *termdata = term->data; - grub_size_t actual; - int keycode = GRUB_TERM_NO_KEY; + VasEBoot_usb_err_t err; + struct VasEBoot_usb_keyboard_data *termdata = term->data; + VasEBoot_size_t actual; + int keycode = VasEBoot_TERM_NO_KEY; if (termdata->dead) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; if (termdata->index) keycode = parse_keycode (termdata); - if (keycode != GRUB_TERM_NO_KEY) + if (keycode != VasEBoot_TERM_NO_KEY) return keycode; /* Poll interrupt pipe. */ - err = grub_usb_check_transfer (termdata->transfer, &actual); + err = VasEBoot_usb_check_transfer (termdata->transfer, &actual); - if (err == GRUB_USB_ERR_WAIT) + if (err == VasEBoot_USB_ERR_WAIT) { if (termdata->last_key != -1 - && grub_get_time_ms () > termdata->repeat_time) + && VasEBoot_get_time_ms () > termdata->repeat_time) { - termdata->repeat_time = grub_get_time_ms () - + GRUB_TERM_REPEAT_INTERVAL; + termdata->repeat_time = VasEBoot_get_time_ms () + + VasEBoot_TERM_REPEAT_INTERVAL; return termdata->last_key; } - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; } if (!err && (actual >= 3)) - grub_memcpy (termdata->last_report, + VasEBoot_memcpy (termdata->last_report, termdata->current_report, sizeof (termdata->report)); - grub_memcpy (termdata->current_report, + VasEBoot_memcpy (termdata->current_report, termdata->report, sizeof (termdata->report)); - termdata->transfer = grub_usb_bulk_read_background (termdata->usbdev, + termdata->transfer = VasEBoot_usb_bulk_read_background (termdata->usbdev, termdata->endp, sizeof (termdata->report), (char *) termdata->report); if (!termdata->transfer) { - grub_printf ("%s failed. Stopped\n", term->name); + VasEBoot_printf ("%s failed. Stopped\n", term->name); termdata->dead = 1; } termdata->last_key = -1; - grub_dprintf ("usb_keyboard", - "err = %d, actual = %" PRIuGRUB_SIZE + VasEBoot_dprintf ("usb_keyboard", + "err = %d, actual = %" PRIuVasEBoot_SIZE " report: 0x%02x 0x%02x 0x%02x 0x%02x" " 0x%02x 0x%02x 0x%02x 0x%02x\n", err, actual, @@ -415,12 +415,12 @@ grub_usb_keyboard_getkey (struct grub_term_input *term) termdata->current_report[6], termdata->current_report[7]); if (err || actual < 1) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; termdata->status = termdata->current_report[0]; if (actual < 3) - return GRUB_TERM_NO_KEY; + return VasEBoot_TERM_NO_KEY; termdata->index = 2; /* New data received. */ termdata->max_index = actual; @@ -429,43 +429,43 @@ grub_usb_keyboard_getkey (struct grub_term_input *term) } static int -grub_usb_keyboard_getkeystatus (struct grub_term_input *term) +VasEBoot_usb_keyboard_getkeystatus (struct VasEBoot_term_input *term) { - struct grub_usb_keyboard_data *termdata = term->data; + struct VasEBoot_usb_keyboard_data *termdata = term->data; return interpret_status (termdata->status) | termdata->mods; } -static struct grub_usb_attach_desc attach_hook = +static struct VasEBoot_usb_attach_desc attach_hook = { - .class = GRUB_USB_CLASS_HID, - .hook = grub_usb_keyboard_attach + .class = VasEBoot_USB_CLASS_HID, + .hook = VasEBoot_usb_keyboard_attach }; -GRUB_MOD_INIT(usb_keyboard) +VasEBoot_MOD_INIT(usb_keyboard) { - grub_usb_register_attach_hook_class (&attach_hook); + VasEBoot_usb_register_attach_hook_class (&attach_hook); } -GRUB_MOD_FINI(usb_keyboard) +VasEBoot_MOD_FINI(usb_keyboard) { unsigned i; - for (i = 0; i < ARRAY_SIZE (grub_usb_keyboards); i++) - if (grub_usb_keyboards[i].data) + for (i = 0; i < ARRAY_SIZE (VasEBoot_usb_keyboards); i++) + if (VasEBoot_usb_keyboards[i].data) { - struct grub_usb_keyboard_data *data = grub_usb_keyboards[i].data; + struct VasEBoot_usb_keyboard_data *data = VasEBoot_usb_keyboards[i].data; if (!data) continue; if (data->transfer) - grub_usb_cancel_transfer (data->transfer); + VasEBoot_usb_cancel_transfer (data->transfer); - grub_term_unregister_input (&grub_usb_keyboards[i]); - grub_free ((char *) grub_usb_keyboards[i].name); - grub_usb_keyboards[i].name = NULL; - grub_free (grub_usb_keyboards[i].data); - grub_usb_keyboards[i].data = 0; + VasEBoot_term_unregister_input (&VasEBoot_usb_keyboards[i]); + VasEBoot_free ((char *) VasEBoot_usb_keyboards[i].name); + VasEBoot_usb_keyboards[i].name = NULL; + VasEBoot_free (VasEBoot_usb_keyboards[i].data); + VasEBoot_usb_keyboards[i].data = 0; } - grub_usb_unregister_attach_hook_class (&attach_hook); + VasEBoot_usb_unregister_attach_hook_class (&attach_hook); } diff --git a/VasEBoot-core/term/xen/console.c b/VasEBoot-core/term/xen/console.c index a1f15f71a..6264fbf45 100644 --- a/VasEBoot-core/term/xen/console.c +++ b/VasEBoot-core/term/xen/console.c @@ -1,122 +1,122 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include static int -readkey (struct grub_term_input *term __attribute__ ((unused))) +readkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { - grub_size_t prod, cons; + VasEBoot_size_t prod, cons; int r; mb (); - prod = grub_xen_xcons->in_prod; - cons = grub_xen_xcons->in_cons; + prod = VasEBoot_xen_xcons->in_prod; + cons = VasEBoot_xen_xcons->in_cons; if (prod <= cons) return -1; - r = grub_xen_xcons->in[cons]; + r = VasEBoot_xen_xcons->in[cons]; cons++; mb (); - grub_xen_xcons->in_cons = cons; + VasEBoot_xen_xcons->in_cons = cons; return r; } static int signal_sent = 1; static void -refresh (struct grub_term_output *term __attribute__ ((unused))) +refresh (struct VasEBoot_term_output *term __attribute__ ((unused))) { struct evtchn_send send; - send.port = grub_xen_start_page_addr->console.domU.evtchn; - grub_xen_event_channel_op (EVTCHNOP_send, &send); + send.port = VasEBoot_xen_start_page_addr->console.domU.evtchn; + VasEBoot_xen_event_channel_op (EVTCHNOP_send, &send); signal_sent = 1; - while (grub_xen_xcons->out_prod != grub_xen_xcons->out_cons) + while (VasEBoot_xen_xcons->out_prod != VasEBoot_xen_xcons->out_cons) { - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); } } static void -put (struct grub_term_output *term __attribute__ ((unused)), const int c) +put (struct VasEBoot_term_output *term __attribute__ ((unused)), const int c) { - grub_size_t prod, cons; + VasEBoot_size_t prod, cons; while (1) { mb (); - prod = grub_xen_xcons->out_prod; - cons = grub_xen_xcons->out_cons; - if (prod < cons + sizeof (grub_xen_xcons->out)) + prod = VasEBoot_xen_xcons->out_prod; + cons = VasEBoot_xen_xcons->out_cons; + if (prod < cons + sizeof (VasEBoot_xen_xcons->out)) break; if (!signal_sent) refresh (term); - grub_xen_sched_op (SCHEDOP_yield, 0); + VasEBoot_xen_sched_op (SCHEDOP_yield, 0); } - grub_xen_xcons->out[prod++ & (sizeof (grub_xen_xcons->out) - 1)] = c; + VasEBoot_xen_xcons->out[prod++ & (sizeof (VasEBoot_xen_xcons->out) - 1)] = c; mb (); - grub_xen_xcons->out_prod = prod; + VasEBoot_xen_xcons->out_prod = prod; signal_sent = 0; } -struct grub_terminfo_input_state grub_console_terminfo_input = { +struct VasEBoot_terminfo_input_state VasEBoot_console_terminfo_input = { .readkey = readkey }; -struct grub_terminfo_output_state grub_console_terminfo_output = { +struct VasEBoot_terminfo_output_state VasEBoot_console_terminfo_output = { .put = put, .size = {80, 24} }; -static struct grub_term_input grub_console_term_input = { +static struct VasEBoot_term_input VasEBoot_console_term_input = { .name = "console", .init = 0, - .getkey = grub_terminfo_getkey, - .data = &grub_console_terminfo_input + .getkey = VasEBoot_terminfo_getkey, + .data = &VasEBoot_console_terminfo_input }; -static struct grub_term_output grub_console_term_output = { +static struct VasEBoot_term_output VasEBoot_console_term_output = { .name = "console", .init = 0, - .putchar = grub_terminfo_putchar, - .getxy = grub_terminfo_getxy, - .getwh = grub_terminfo_getwh, - .gotoxy = grub_terminfo_gotoxy, - .cls = grub_terminfo_cls, + .putchar = VasEBoot_terminfo_putchar, + .getxy = VasEBoot_terminfo_getxy, + .getwh = VasEBoot_terminfo_getwh, + .gotoxy = VasEBoot_terminfo_gotoxy, + .cls = VasEBoot_terminfo_cls, .refresh = refresh, - .setcolorstate = grub_terminfo_setcolorstate, - .setcursor = grub_terminfo_setcursor, - .flags = GRUB_TERM_CODE_TYPE_ASCII, - .data = &grub_console_terminfo_output, + .setcolorstate = VasEBoot_terminfo_setcolorstate, + .setcursor = VasEBoot_terminfo_setcursor, + .flags = VasEBoot_TERM_CODE_TYPE_ASCII, + .data = &VasEBoot_console_terminfo_output, }; void -grub_console_init (void) +VasEBoot_console_init (void) { - grub_term_register_input ("console", &grub_console_term_input); - grub_term_register_output ("console", &grub_console_term_output); + VasEBoot_term_register_input ("console", &VasEBoot_console_term_input); + VasEBoot_term_register_output ("console", &VasEBoot_console_term_output); - grub_terminfo_init (); - grub_terminfo_output_register (&grub_console_term_output, "vt100-color"); + VasEBoot_terminfo_init (); + VasEBoot_terminfo_output_register (&VasEBoot_console_term_output, "vt100-color"); } diff --git a/VasEBoot-core/tests/boot/kbsd.init-i386.S b/VasEBoot-core/tests/boot/kbsd.init-i386.S index 72ddb7c16..9027d3555 100644 --- a/VasEBoot-core/tests/boot/kbsd.init-i386.S +++ b/VasEBoot-core/tests/boot/kbsd.init-i386.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifdef TARGET_NETBSD diff --git a/VasEBoot-core/tests/boot/kbsd.init-x86_64.S b/VasEBoot-core/tests/boot/kbsd.init-x86_64.S index 7486bc312..b799f1e02 100644 --- a/VasEBoot-core/tests/boot/kbsd.init-x86_64.S +++ b/VasEBoot-core/tests/boot/kbsd.init-x86_64.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define MODE_RDRW 2 diff --git a/VasEBoot-core/tests/boot/kfreebsd.init-i386.S b/VasEBoot-core/tests/boot/kfreebsd.init-i386.S index 7a4babaf9..756310943 100644 --- a/VasEBoot-core/tests/boot/kfreebsd.init-i386.S +++ b/VasEBoot-core/tests/boot/kfreebsd.init-i386.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define MODE_RDRW 2 diff --git a/VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S b/VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S index 05e5760e0..f63efab54 100644 --- a/VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S +++ b/VasEBoot-core/tests/boot/kfreebsd.init-x86_64.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define MODE_RDRW 2 diff --git a/VasEBoot-core/tests/boot/linux.init-i386.S b/VasEBoot-core/tests/boot/linux.init-i386.S index c0983ac0a..5d1ca828e 100644 --- a/VasEBoot-core/tests/boot/linux.init-i386.S +++ b/VasEBoot-core/tests/boot/linux.init-i386.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SYSCALL_WRITE 4 diff --git a/VasEBoot-core/tests/boot/linux.init-mips.S b/VasEBoot-core/tests/boot/linux.init-mips.S index 5ef4c3794..dffeb3cdc 100644 --- a/VasEBoot-core/tests/boot/linux.init-mips.S +++ b/VasEBoot-core/tests/boot/linux.init-mips.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SYSCALL_WRITE 4004 diff --git a/VasEBoot-core/tests/boot/linux.init-ppc.S b/VasEBoot-core/tests/boot/linux.init-ppc.S index 8c9aa441f..429dda636 100644 --- a/VasEBoot-core/tests/boot/linux.init-ppc.S +++ b/VasEBoot-core/tests/boot/linux.init-ppc.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SYSCALL_WRITE 4 diff --git a/VasEBoot-core/tests/boot/linux.init-x86_64.S b/VasEBoot-core/tests/boot/linux.init-x86_64.S index 90bdcc356..1cee68d39 100644 --- a/VasEBoot-core/tests/boot/linux.init-x86_64.S +++ b/VasEBoot-core/tests/boot/linux.init-x86_64.S @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define SYSCALL_WRITE 1 diff --git a/VasEBoot-core/tests/bswap_test.c b/VasEBoot-core/tests/bswap_test.c index 4eb3a9814..686edde9b 100644 --- a/VasEBoot-core/tests/bswap_test.c +++ b/VasEBoot-core/tests/bswap_test.c @@ -1,93 +1,93 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t vectors[] = { +static VasEBoot_uint64_t vectors[] = { 0xffffffffffffffffULL, 1, 2, 0, 0x0102030405060708ULL }; static void -test16 (grub_uint16_t a) +test16 (VasEBoot_uint16_t a) { - grub_uint16_t b, c; - grub_uint8_t *ap, *bp; + VasEBoot_uint16_t b, c; + VasEBoot_uint8_t *ap, *bp; int i; - b = grub_swap_bytes16 (a); - c = grub_swap_bytes16 (b); - grub_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", + b = VasEBoot_swap_bytes16 (a); + c = VasEBoot_swap_bytes16 (b); + VasEBoot_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", (long long) a, (long long) b, (long long) c); - ap = (grub_uint8_t *) &a; - bp = (grub_uint8_t *) &b; + ap = (VasEBoot_uint8_t *) &a; + bp = (VasEBoot_uint8_t *) &b; for (i = 0; i < 2; i++) { - grub_test_assert (ap[i] == bp[1 - i], + VasEBoot_test_assert (ap[i] == bp[1 - i], "bswap bytes wrong: 0x%llx, 0x%llx", (long long) a, (long long) b); } } static void -test32 (grub_uint32_t a) +test32 (VasEBoot_uint32_t a) { - grub_uint32_t b, c; - grub_uint8_t *ap, *bp; + VasEBoot_uint32_t b, c; + VasEBoot_uint8_t *ap, *bp; int i; - b = grub_swap_bytes32 (a); - c = grub_swap_bytes32 (b); - grub_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", + b = VasEBoot_swap_bytes32 (a); + c = VasEBoot_swap_bytes32 (b); + VasEBoot_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", (long long) a, (long long) b, (long long) c); - ap = (grub_uint8_t *) &a; - bp = (grub_uint8_t *) &b; + ap = (VasEBoot_uint8_t *) &a; + bp = (VasEBoot_uint8_t *) &b; for (i = 0; i < 4; i++) { - grub_test_assert (ap[i] == bp[3 - i], + VasEBoot_test_assert (ap[i] == bp[3 - i], "bswap bytes wrong: 0x%llx, 0x%llx", (long long) a, (long long) b); } } static void -test64 (grub_uint64_t a) +test64 (VasEBoot_uint64_t a) { - grub_uint64_t b, c; - grub_uint8_t *ap, *bp; + VasEBoot_uint64_t b, c; + VasEBoot_uint8_t *ap, *bp; int i; - b = grub_swap_bytes64 (a); - c = grub_swap_bytes64 (b); - grub_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", + b = VasEBoot_swap_bytes64 (a); + c = VasEBoot_swap_bytes64 (b); + VasEBoot_test_assert (a == c, "bswap not idempotent: 0x%llx, 0x%llx, 0x%llx", (long long) a, (long long) b, (long long) c); - ap = (grub_uint8_t *) &a; - bp = (grub_uint8_t *) &b; + ap = (VasEBoot_uint8_t *) &a; + bp = (VasEBoot_uint8_t *) &b; for (i = 0; i < 4; i++) { - grub_test_assert (ap[i] == bp[7 - i], + VasEBoot_test_assert (ap[i] == bp[7 - i], "bswap bytes wrong: 0x%llx, 0x%llx", (long long) a, (long long) b); } } static void -test_all(grub_uint64_t a) +test_all(VasEBoot_uint64_t a) { test64 (a); test32 (a); @@ -97,8 +97,8 @@ test_all(grub_uint64_t a) static void bswap_test (void) { - grub_uint64_t a = 404, b = 7; - grub_size_t i; + VasEBoot_uint64_t a = 404, b = 7; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { @@ -118,4 +118,4 @@ bswap_test (void) } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (bswap_test, bswap_test); +VasEBoot_FUNCTIONAL_TEST (bswap_test, bswap_test); diff --git a/VasEBoot-core/tests/checksums.h b/VasEBoot-core/tests/checksums.h index 68d8ce7c7..122e19872 100644 --- a/VasEBoot-core/tests/checksums.h +++ b/VasEBoot-core/tests/checksums.h @@ -1,129 +1,129 @@ - { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xcd5fc34e, 0xcd5fc34e, 0xeabbecab, 0xeabbecab, 0xc9950151, 0xc9950151, 0x2be222b6, 0x2be222b6, 0xe88c769e, 0xe88c769e, 0x6be4910e, 0x6be4910e, 0x1dc1fe4f, 0x1dc1fe4f, 0xd7613e8f, 0xd7613e8f, 0xf8124196, 0xf8124196, 0x130f5935, 0x130f5935, 0x2872330e, 0x2872330e, 0xaa7b7868, 0xaa7b7868, 0x558eaeea, 0x558eaeea, 0x92f7960f, 0x92f7960f, 0xc5bfc709, 0xc5bfc709, 0x699732fe, 0x699732fe, 0xc859125f, 0xc859125f, 0xfc6ac729, 0xfc6ac729, 0xcdab6cd4, 0xcdab6cd4, 0x58a8b7f8, 0x58a8b7f8, 0xc0e73385, 0x6560d6ef, 0x3be8bb5d, 0x3be8bb5d, }, 45 }, - { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x13029f94, 0x13029f94, 0x7785fdab, 0x7785fdab, 0x95a7c1e8, 0x95a7c1e8, 0x315ab3e3, 0x315ab3e3, 0x6787f012, 0x6787f012, 0x79b1ecdc, 0x79b1ecdc, 0xdbc67810, 0xdbc67810, 0xafaa982e, 0xafaa982e, 0xc5cd0157, 0xc5cd0157, 0x3c50dd64, 0x3c50dd64, 0x1056cac0, 0x1056cac0, 0x1d7a41fa, 0x1d7a41fa, 0x5690b1e8, 0x5690b1e8, 0x616831d6, 0x616831d6, 0xfaf8e726, 0xfaf8e726, 0xd1ec5e26, 0xd1ec5e26, 0x3c269e1f, 0x3c269e1f, 0x1aa7952d, 0x1aa7952d, 0x6e7e2f99, 0x6e7e2f99, 0x98f4c02, 0x98f4c02, 0xc3f1abf2, 0xe348bb73, 0xea53cd60, 0xea53cd60, }, 45 }, - { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x8fbb4f4c, 0x8fbb4f4c, 0x5dc00167, 0x5dc00167, 0xbc124df8, 0xbc124df8, 0x31cf0f8e, 0x31cf0f8e, 0x798cc4ed, 0x798cc4ed, 0xc5d2a091, 0xc5d2a091, 0xb58a0591, 0xb58a0591, 0x4d118aca, 0x4d118aca, 0xbb06c7ee, 0xbb06c7ee, 0x42179db7, 0x42179db7, 0x65f2d81e, 0x65f2d81e, 0xa2628bcb, 0xa2628bcb, 0xbdb7f4b, 0xbdb7f4b, 0x66b10309, 0x66b10309, 0x1a550ea9, 0x1a550ea9, 0x377a297d, 0x377a297d, 0x2ea99015, 0x2ea99015, 0x4e20d7bc, 0x4e20d7bc, 0x8ecbde02, 0x8ecbde02, 0xdfa2195a, 0xdfa2195a, 0xe113d2a, 0xe204ee5b, 0x734679c1, 0x734679c1, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xe2f6bfe1, 0xe2f6bfe1, 0xf18aee15, 0xf18aee15, 0x5e83b689, 0x5e83b689, 0xb7e8b42c, 0xb7e8b42c, 0x85d78f92, 0x85d78f92, 0xd56fadae, 0xd56fadae, 0x7632f5bf, 0x7632f5bf, 0x2769a748, 0x2769a748, 0x4a6112cd, 0x4a6112cd, 0x4f9b66a4, 0x4f9b66a4, 0x70457d38, 0x70457d38, 0x8cadb1a7, 0x8cadb1a7, 0x451341f, 0x451341f, 0x8a62e741, 0x8a62e741, 0x1b1f9031, 0x1b1f9031, 0x75ab630e, 0x75ab630e, 0xd5ff53ac, 0xd5ff53ac, 0x73a2b3c7, 0x73a2b3c7, 0x7b52acd5, 0x7b52acd5, 0xf6f3e48c, 0xf6f3e48c, 0x8d0db133, 0x8db24310, 0x7aef56d4, 0x7aef56d4, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x838a3f40, 0x838a3f40, 0x7351ba96, 0x7351ba96, 0x660963bb, 0x660963bb, 0x6f3362a6, 0x6f3362a6, 0x915d35d9, 0x915d35d9, 0xc7edaee9, 0xc7edaee9, 0xbc8ec24c, 0xbc8ec24c, 0xeb120ffd, 0xeb120ffd, 0x8f6d8232, 0x8f6d8232, 0x2de5d515, 0x2de5d515, 0x4f2ecd91, 0x4f2ecd91, 0x555a9b90, 0x555a9b90, 0x8f7b0d77, 0x8f7b0d77, 0x5f9536af, 0x5f9536af, 0x3dd79dbe, 0x3dd79dbe, 0xb555a0, 0xb555a0, 0x75aec882, 0x75aec882, 0xd5da89cb, 0xd5da89cb, 0xb47b3257, 0xb47b3257, 0x7c97c046, 0x7c97c046, 0x726a7abe, 0x4c8b8a56, 0xcffa0854, 0xcffa0854, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7bf761e, 0x7bf761e, 0xaf0b6dae, 0xaf0b6dae, 0x7db15930, 0x7db15930, 0xc9720d56, 0xc9720d56, 0x55590d6c, 0x55590d6c, 0xa0d193d9, 0xa0d193d9, 0x728987b2, 0x728987b2, 0x28aecde6, 0x28aecde6, 0xa59bb094, 0xa59bb094, 0x2d0b049d, 0x2d0b049d, 0xd8421240, 0xd8421240, 0x51fa339, 0x51fa339, 0xc625cc46, 0xc625cc46, 0x2c9e6fcc, 0x2c9e6fcc, 0x3d06ffd5, 0x3d06ffd5, 0x8dd72816, 0x8dd72816, 0xfcf2a982, 0xfcf2a982, 0x6ef2870f, 0x6ef2870f, 0xba2caab7, 0xba2caab7, 0x8e5a5872, 0x8e5a5872, 0x62b2fedc, 0x2bd3b588, 0x34ebdb15, 0x34ebdb15, }, 45 }, - { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xa133280a, 0xa133280a, 0x1e8f4227, 0x1e8f4227, 0xa01cd911, 0xa01cd911, 0xdcb3d617, 0xdcb3d617, 0x51200351, 0x51200351, 0x609ba305, 0x609ba305, 0x5d96abfd, 0x5d96abfd, 0xd855cc70, 0xd855cc70, 0xdbfaf18d, 0xdbfaf18d, 0x84814843, 0x84814843, 0x4b00e630, 0x4b00e630, 0xd362b0f5, 0xd362b0f5, 0xec863355, 0xec863355, 0x195898d0, 0x195898d0, 0xe8c698c7, 0xe8c698c7, 0x884229e7, 0x884229e7, 0xb41ed3a9, 0xb41ed3a9, 0x2be1ce40, 0x2be1ce40, 0x8c33eb7c, 0x8c33eb7c, 0xbbce1da, 0xbbce1da, 0xef9415fa, 0x22fbc0d, 0xd82c182c, 0xd82c182c, }, 45 }, - { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xbe029c, 0x6671ee1f, 0xbe029c, 0x4348cfdb, 0x59c36f00, 0x59c36f00, 0x3ad73295, 0x3ad73295, 0x3ad73295, 0x44575ff3, 0x44575ff3, 0x44575ff3, 0x26a14a21, 0x26a14a21, 0x26a14a21, 0x59c36f00, 0x4348cfdb, 0x4348cfdb, 0x59c36f00, }, 20 }, - { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x14e228ef, 0xb0c8af57, 0x14e228ef, 0x3ae7ad90, 0xaa4593fe, 0xaa4593fe, 0xbec19c1b, 0xbec19c1b, 0xbec19c1b, 0x1834917c, 0x1834917c, 0x1834917c, 0x350c3a04, 0x350c3a04, 0x350c3a04, 0xaa4593fe, 0x3ae7ad90, 0x3ae7ad90, 0xaa4593fe, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x651fb144, 0xdf93ee9c, 0x651fb144, 0x3808dcc0, 0xc9cbf769, 0xc9cbf769, 0xe4861949, 0xe4861949, 0xe4861949, 0x1a5ed885, 0x1a5ed885, 0x1a5ed885, 0xf314678d, 0xf314678d, 0xf314678d, 0xc9cbf769, 0x3808dcc0, 0x3808dcc0, 0xc9cbf769, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xdfd0119e, 0x6c7018a9, 0xdfd0119e, 0x71865846, 0x9813a416, 0x9813a416, 0xb5e8801c, 0xb5e8801c, 0xb5e8801c, 0x2433062f, 0x2433062f, 0x2433062f, 0x3d893bff, 0x3d893bff, 0x3d893bff, 0x9813a416, 0x71865846, 0x71865846, 0x9813a416, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x4e4844e0, 0x5ebe5f81, 0x4e4844e0, 0x38ee7153, 0x5fcf013d, 0x5fcf013d, 0x819b5c4e, 0x819b5c4e, 0x819b5c4e, 0x538b4438, 0x538b4438, 0x538b4438, 0x45f87ba7, 0x45f87ba7, 0x45f87ba7, 0x5fcf013d, 0x38ee7153, 0x38ee7153, 0x5fcf013d, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x701427d4, 0x246c830a, 0x701427d4, 0x6b11fdd3, 0xdd28f52b, 0xdd28f52b, 0xcd83646c, 0xcd83646c, 0xcd83646c, 0xecbf9d88, 0xecbf9d88, 0xecbf9d88, 0x91075604, 0x91075604, 0x91075604, 0xdd28f52b, 0x6b11fdd3, 0x6b11fdd3, 0xdd28f52b, }, 20 }, - { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x7b5bd4c, 0xac246af1, 0x7b5bd4c, 0xf80aa6cc, 0x43d1f34, 0x43d1f34, 0xb200c08a, 0xb200c08a, 0xb200c08a, 0xcd0a6922, 0xcd0a6922, 0xcd0a6922, 0x545b6ca4, 0x545b6ca4, 0x545b6ca4, 0x43d1f34, 0xf80aa6cc, 0xf80aa6cc, 0x43d1f34, }, 20 }, - { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x1027210c, 0x64e51c81, 0x1027210c, 0x45ca4a8a, 0x9a2e0d26, 0x12fd0f21, 0x12fd0f21, 0x12fd0f21, 0x4e25f9e1, 0x4e25f9e1, 0x4e25f9e1, 0x67bd3773, 0x67bd3773, 0x67bd3773, 0x59c36f00, 0x45ca4a8a, 0x45ca4a8a, }, 18 }, - { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x8d12f697, 0xc5b32248, 0x8d12f697, 0x56720aa4, 0xa9d58ccd, 0xf766a14d, 0xf766a14d, 0xf766a14d, 0xa2390b47, 0xa2390b47, 0xa2390b47, 0xcb0ac30e, 0xcb0ac30e, 0xcb0ac30e, 0xaa4593fe, 0x56720aa4, 0x56720aa4, }, 18 }, - { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa5ec9f45, 0xdb7085d8, 0xa5ec9f45, 0x9caf1d3f, 0x5411be8b, 0xedc0ad83, 0xedc0ad83, 0xedc0ad83, 0x927e0b17, 0x927e0b17, 0x927e0b17, 0xd00a6b6f, 0xd00a6b6f, 0xd00a6b6f, 0xc9cbf769, 0x9caf1d3f, 0x9caf1d3f, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xce8e83bf, 0xeb96c838, 0xce8e83bf, 0x73cb3bc1, 0x740d78cf, 0xb35c7e64, 0xb35c7e64, 0xb35c7e64, 0x58f99418, 0x58f99418, 0x58f99418, 0x5eb294e8, 0x5eb294e8, 0x5eb294e8, 0x1c3742c9, 0x73cb3bc1, 0x73cb3bc1, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x56a03e51, 0xee7d8d4b, 0x56a03e51, 0x5bdf9413, 0xbcda144c, 0x220f7a5e, 0x220f7a5e, 0x220f7a5e, 0x4d46a64f, 0x4d46a64f, 0x4d46a64f, 0x40b0384c, 0x40b0384c, 0x40b0384c, 0xcc5a7bed, 0x5bdf9413, 0x5bdf9413, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0xea8a9cf0, 0x8929e522, 0xea8a9cf0, 0x78f3dfbc, 0x5d55a141, 0x377f1aeb, 0x377f1aeb, 0x377f1aeb, 0xf1cd5ef5, 0xf1cd5ef5, 0xf1cd5ef5, 0xe5a88e4a, 0xe5a88e4a, 0xe5a88e4a, 0xef4a3312, 0x78f3dfbc, 0x78f3dfbc, }, 18 }, - { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0x6dcf1d57, 0x925a4c8f, 0x6dcf1d57, 0x69005b38, 0x6d6bb4bc, 0x756a36b9, 0x756a36b9, 0x756a36b9, 0xf499c068, 0xf499c068, 0xf499c068, 0x623d7907, 0x623d7907, 0x623d7907, 0x54e48d80, 0x69005b38, 0x69005b38, }, 18 }, - { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa49d26b0, 0xaa7d9b28, 0xa49d26b0, 0xe76bebf7, 0x59c36f00, 0x59c36f00, 0xea6ab252, 0xea6ab252, 0xea6ab252, 0x94eadf34, 0x94eadf34, 0x94eadf34, 0xf61ccae6, 0xf61ccae6, 0xf61ccae6, 0x59c36f00, 0xe76bebf7, 0xe76bebf7, 0x59c36f00, }, 20 }, - { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x7a277db, 0xf3bf80f7, 0x7a277db, 0x29a7f2a4, 0xaa4593fe, 0xaa4593fe, 0xf1cd57e3, 0xf1cd57e3, 0xf1cd57e3, 0x57385a84, 0x57385a84, 0x57385a84, 0x7a00f1fc, 0x7a00f1fc, 0x7a00f1fc, 0xaa4593fe, 0x29a7f2a4, 0x29a7f2a4, 0xaa4593fe, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x631edf85, 0x71926408, 0x631edf85, 0x3e09b201, 0xc9cbf769, 0xc9cbf769, 0xf224ab3, 0xf224ab3, 0xf224ab3, 0xf1fa8b7f, 0xf1fa8b7f, 0xf1fa8b7f, 0x18b03477, 0x18b03477, 0x18b03477, 0xc9cbf769, 0x3e09b201, 0x3e09b201, 0xc9cbf769, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xfbaf4635, 0xe69ef474, 0xfbaf4635, 0x55f90fed, 0x9813a416, 0x9813a416, 0x3aad8f41, 0x3aad8f41, 0x3aad8f41, 0xab760972, 0xab760972, 0xab760972, 0xb2cc34a2, 0xb2cc34a2, 0xb2cc34a2, 0x9813a416, 0x55f90fed, 0x55f90fed, 0x9813a416, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xdce50745, 0x1d8009e4, 0xdce50745, 0xaa4332f6, 0x5fcf013d, 0x5fcf013d, 0x354e5749, 0x354e5749, 0x354e5749, 0xe75e4f3f, 0xe75e4f3f, 0xe75e4f3f, 0xf12d70a0, 0xf12d70a0, 0xf12d70a0, 0x5fcf013d, 0xaa4332f6, 0xaa4332f6, 0x5fcf013d, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x3efebeff, 0xf101dfe2, 0x3efebeff, 0x25fb64f8, 0xdd28f52b, 0xdd28f52b, 0x70c69ebd, 0x70c69ebd, 0x70c69ebd, 0x51fa6759, 0x51fa6759, 0x51fa6759, 0x2c42acd5, 0x2c42acd5, 0x2c42acd5, 0xdd28f52b, 0x25fb64f8, 0x25fb64f8, 0xdd28f52b, }, 20 }, - { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x59a34c64, 0x281cca78, 0x59a34c64, 0xa61c57e4, 0x43d1f34, 0x43d1f34, 0x95131d4, 0x95131d4, 0x95131d4, 0x765b987c, 0x765b987c, 0x765b987c, 0xef0a9dfa, 0xef0a9dfa, 0xef0a9dfa, 0x43d1f34, 0xa61c57e4, 0xa61c57e4, 0x43d1f34, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa37c165, 0x72063383, 0xa37c165, 0x49c10c22, 0x59c36f00, 0x59c36f00, 0x4e53de8e, 0x4e53de8e, 0x4e53de8e, 0x30d3b3e8, 0x30d3b3e8, 0x30d3b3e8, 0x5225a63a, 0x5225a63a, 0x5225a63a, 0x59c36f00, 0x49c10c22, 0x49c10c22, 0x59c36f00, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x45bba0ba, 0xe60fd0b6, 0x45bba0ba, 0x6bbe25c5, 0xaa4593fe, 0xaa4593fe, 0x28de2b41, 0x28de2b41, 0x28de2b41, 0x8e2b2626, 0x8e2b2626, 0x8e2b2626, 0xa3138d5e, 0xa3138d5e, 0xa3138d5e, 0xaa4593fe, 0x6bbe25c5, 0x6bbe25c5, 0xaa4593fe, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb43d4e9d, 0x16f88820, 0xb43d4e9d, 0xe92a2319, 0xc9cbf769, 0xc9cbf769, 0xb8959ec7, 0xb8959ec7, 0xb8959ec7, 0x464d5f0b, 0x464d5f0b, 0x464d5f0b, 0xaf07e003, 0xaf07e003, 0xaf07e003, 0xc9cbf769, 0xe92a2319, 0xe92a2319, 0xc9cbf769, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x46760365, 0x685ae30e, 0x46760365, 0xe8204abd, 0x9813a416, 0x9813a416, 0x8896050a, 0x8896050a, 0x8896050a, 0x194d8339, 0x194d8339, 0x194d8339, 0xf7bee9, 0xf7bee9, 0xf7bee9, 0x9813a416, 0xe8204abd, 0xe8204abd, 0x9813a416, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x6859aa86, 0xf3f11deb, 0x6859aa86, 0x1eff9f35, 0x5fcf013d, 0x5fcf013d, 0xd72b1482, 0xd72b1482, 0xd72b1482, 0x53b0cf4, 0x53b0cf4, 0x53b0cf4, 0x1348336b, 0x1348336b, 0x1348336b, 0x5fcf013d, 0x1eff9f35, 0x1eff9f35, 0x5fcf013d, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x688451e7, 0xf6936b72, 0x688451e7, 0x73818be0, 0xdd28f52b, 0xdd28f52b, 0xf12a65ac, 0xf12a65ac, 0xf12a65ac, 0xd0169c48, 0xd0169c48, 0xd0169c48, 0xadae57c4, 0xadae57c4, 0xadae57c4, 0xdd28f52b, 0x73818be0, 0x73818be0, 0xdd28f52b, }, 20 }, - { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x9616af94, 0xd466be40, 0x9616af94, 0x69a9b414, 0x43d1f34, 0x43d1f34, 0xf3bb3240, 0xf3bb3240, 0xf3bb3240, 0x8cb19be8, 0x8cb19be8, 0x8cb19be8, 0x15e09e6e, 0x15e09e6e, 0x15e09e6e, 0x43d1f34, 0x69a9b414, 0x69a9b414, 0x43d1f34, }, 20 }, - { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x8708d1bd, 0x85dd5e9c, 0x8708d1bd, 0xc4fe1cfa, 0x59c36f00, 0x59c36f00, 0x7ae8aced, 0x7ae8aced, 0x7ae8aced, 0x468c18b, 0x468c18b, 0x468c18b, 0x669ed459, 0x669ed459, 0x669ed459, 0x59c36f00, 0xc4fe1cfa, 0xc4fe1cfa, 0x59c36f00, }, 20 }, - { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xa72b1043, 0x147d4ce0, 0xa72b1043, 0x892e953c, 0xaa4593fe, 0xaa4593fe, 0xb7b1dd40, 0xb7b1dd40, 0xb7b1dd40, 0x1144d027, 0x1144d027, 0x1144d027, 0x3c7c7b5f, 0x3c7c7b5f, 0x3c7c7b5f, 0xaa4593fe, 0x892e953c, 0x892e953c, 0xaa4593fe, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xc5fb1817, 0x745fb26c, 0xc5fb1817, 0x98ec7593, 0xc9cbf769, 0xc9cbf769, 0xf5f17e2d, 0xf5f17e2d, 0xf5f17e2d, 0xb29bfe1, 0xb29bfe1, 0xb29bfe1, 0xe26300e9, 0xe26300e9, 0xe26300e9, 0xc9cbf769, 0x98ec7593, 0x98ec7593, 0xc9cbf769, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4be837e1, 0xbf4963ca, 0x4be837e1, 0xe5be7e39, 0x9813a416, 0x9813a416, 0xd886fca0, 0xd886fca0, 0xd886fca0, 0x495d7a93, 0x495d7a93, 0x495d7a93, 0x50e74743, 0x50e74743, 0x50e74743, 0x9813a416, 0xe5be7e39, 0xe5be7e39, 0x9813a416, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x21a8ccb8, 0x17719be, 0x21a8ccb8, 0x570ef90b, 0x5fcf013d, 0x5fcf013d, 0x2a7b5333, 0x2a7b5333, 0x2a7b5333, 0xf86b4b45, 0xf86b4b45, 0xf86b4b45, 0xee1874da, 0xee1874da, 0xee1874da, 0x5fcf013d, 0x570ef90b, 0x570ef90b, 0x5fcf013d, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7001fe50, 0x4798153f, 0x7001fe50, 0x6b042457, 0xdd28f52b, 0xdd28f52b, 0x46489369, 0x46489369, 0x46489369, 0x67746a8d, 0x67746a8d, 0x67746a8d, 0x1acca101, 0x1acca101, 0x1acca101, 0xdd28f52b, 0x6b042457, 0x6b042457, 0xdd28f52b, }, 20 }, - { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x6e10591c, 0x48bd926e, 0x6e10591c, 0x91af429c, 0x43d1f34, 0x43d1f34, 0x59cb829, 0x59cb829, 0x59cb829, 0x7a961181, 0x7a961181, 0x7a961181, 0xe3c71407, 0xe3c71407, 0xe3c71407, 0x43d1f34, 0x91af429c, 0x91af429c, 0x43d1f34, }, 20 }, - { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x67627ed5, 0xdb276cef, 0x67627ed5, 0x2494b392, 0x59c36f00, 0x59c36f00, 0x43f511f3, 0x43f511f3, 0x43f511f3, 0x3d757c95, 0x3d757c95, 0x3d757c95, 0x5f836947, 0x5f836947, 0x5f836947, 0x59c36f00, 0x2494b392, 0x2494b392, 0x59c36f00, }, 20 }, - { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x987cbf71, 0x6e4c645c, 0x987cbf71, 0xb6793a0e, 0xaa4593fe, 0xaa4593fe, 0xb943d716, 0xb943d716, 0xb943d716, 0x1fb6da71, 0x1fb6da71, 0x1fb6da71, 0x328e7109, 0x328e7109, 0x328e7109, 0xaa4593fe, 0xb6793a0e, 0xb6793a0e, 0xaa4593fe, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf9987c07, 0x4a92eed9, 0xf9987c07, 0xa48f1183, 0xc9cbf769, 0xc9cbf769, 0x5eb3ddf4, 0x5eb3ddf4, 0x5eb3ddf4, 0xa06b1c38, 0xa06b1c38, 0xa06b1c38, 0x4921a330, 0x4921a330, 0x4921a330, 0xc9cbf769, 0xa48f1183, 0xa48f1183, 0xc9cbf769, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xccd804e2, 0xb99e8d91, 0xccd804e2, 0x628e4d3a, 0x9813a416, 0x9813a416, 0x5aec5acc, 0x5aec5acc, 0x5aec5acc, 0xcb37dcff, 0xcb37dcff, 0xcb37dcff, 0xd28de12f, 0xd28de12f, 0xd28de12f, 0x9813a416, 0x628e4d3a, 0x628e4d3a, 0x9813a416, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x4990d896, 0x2b3aa242, 0x4990d896, 0x3f36ed25, 0x5fcf013d, 0x5fcf013d, 0x3cc6048d, 0x3cc6048d, 0x3cc6048d, 0xeed61cfb, 0xeed61cfb, 0xeed61cfb, 0xf8a52364, 0xf8a52364, 0xf8a52364, 0x5fcf013d, 0x3f36ed25, 0x3f36ed25, 0x5fcf013d, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x4ff5c69f, 0x66586489, 0x4ff5c69f, 0x54f01c98, 0xdd28f52b, 0xdd28f52b, 0xc3ff0bf5, 0xc3ff0bf5, 0xc3ff0bf5, 0xe2c3f211, 0xe2c3f211, 0xe2c3f211, 0x9f7b399d, 0x9f7b399d, 0x9f7b399d, 0xdd28f52b, 0x54f01c98, 0x54f01c98, 0xdd28f52b, }, 20 }, - { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x909b7bb4, 0x2bb2a58c, 0x909b7bb4, 0x6f246034, 0x43d1f34, 0x43d1f34, 0x2df40751, 0x2df40751, 0x2df40751, 0x52feaef9, 0x52feaef9, 0x52feaef9, 0xcbafab7f, 0xcbafab7f, 0xcbafab7f, 0x43d1f34, 0x6f246034, 0x6f246034, 0x43d1f34, }, 20 }, - { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xc77bfcc6, 0xffcdf45d, 0xc77bfcc6, 0x848d3181, 0x59c36f00, 0x59c36f00, 0xd79cd5e, 0xd79cd5e, 0xd79cd5e, 0x73f9a038, 0x73f9a038, 0x73f9a038, 0x110fb5ea, 0x110fb5ea, 0x110fb5ea, 0x59c36f00, 0x848d3181, 0x848d3181, 0x59c36f00, }, 20 }, - { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd5494aa5, 0xa0924ec, 0xd5494aa5, 0xfb4ccfda, 0xaa4593fe, 0xaa4593fe, 0x8692c636, 0x8692c636, 0x8692c636, 0x2067cb51, 0x2067cb51, 0x2067cb51, 0xd5f6029, 0xd5f6029, 0xd5f6029, 0xaa4593fe, 0xfb4ccfda, 0xfb4ccfda, 0xaa4593fe, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x2436c4f, 0x2cde4e0c, 0x2436c4f, 0x5f5401cb, 0xc9cbf769, 0xc9cbf769, 0x558f50ae, 0x558f50ae, 0x558f50ae, 0xab579162, 0xab579162, 0xab579162, 0x421d2e6a, 0x421d2e6a, 0x421d2e6a, 0xc9cbf769, 0x5f5401cb, 0x5f5401cb, 0xc9cbf769, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x86f8a68c, 0xf4116451, 0x86f8a68c, 0x28aeef54, 0x9813a416, 0x9813a416, 0x7befbe43, 0x7befbe43, 0x7befbe43, 0xea343870, 0xea343870, 0xea343870, 0xf38e05a0, 0xf38e05a0, 0xf38e05a0, 0x9813a416, 0x28aeef54, 0x28aeef54, 0x9813a416, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x156c292f, 0x3c8eb473, 0x156c292f, 0x63ca1c9c, 0x5fcf013d, 0x5fcf013d, 0x895ea16b, 0x895ea16b, 0x895ea16b, 0x5b4eb91d, 0x5b4eb91d, 0x5b4eb91d, 0x4d3d8682, 0x4d3d8682, 0x4d3d8682, 0x5fcf013d, 0x63ca1c9c, 0x63ca1c9c, 0x5fcf013d, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xf57ebf12, 0x798b299b, 0xf57ebf12, 0xee7b6515, 0xdd28f52b, 0xdd28f52b, 0x22563fc6, 0x22563fc6, 0x22563fc6, 0x36ac622, 0x36ac622, 0x36ac622, 0x7ed20dae, 0x7ed20dae, 0x7ed20dae, 0xdd28f52b, 0xee7b6515, 0xee7b6515, 0xdd28f52b, }, 20 }, - { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x2bc82eb1, 0x94064cc8, 0x2bc82eb1, 0xd4773531, 0x43d1f34, 0x43d1f34, 0x44cbf2f0, 0x44cbf2f0, 0x44cbf2f0, 0x3bc15b58, 0x3bc15b58, 0x3bc15b58, 0xa2905ede, 0xa2905ede, 0xa2905ede, 0x43d1f34, 0xd4773531, 0xd4773531, 0x43d1f34, }, 20 }, - { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7f6dd146, 0x548af474, 0x7f6dd146, 0x3c9b1c01, 0x59c36f00, 0x59c36f00, 0x7d913e8d, 0x7d913e8d, 0x7d913e8d, 0x31153eb, 0x31153eb, 0x31153eb, 0x61e74639, 0x61e74639, 0x61e74639, 0x59c36f00, 0x3c9b1c01, 0x3c9b1c01, 0x59c36f00, }, 20 }, - { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xf29ad079, 0x50d47c0, 0xf29ad079, 0xdc9f5506, 0xaa4593fe, 0xaa4593fe, 0x6bcf4c90, 0x6bcf4c90, 0x6bcf4c90, 0xcd3a41f7, 0xcd3a41f7, 0xcd3a41f7, 0xe002ea8f, 0xe002ea8f, 0xe002ea8f, 0xaa4593fe, 0xdc9f5506, 0xdc9f5506, 0xaa4593fe, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb25e3082, 0x2ed845dd, 0xb25e3082, 0xef495d06, 0xc9cbf769, 0xc9cbf769, 0xd5322575, 0xd5322575, 0xd5322575, 0x2beae4b9, 0x2beae4b9, 0x2beae4b9, 0xc2a05bb1, 0xc2a05bb1, 0xc2a05bb1, 0xc9cbf769, 0xef495d06, 0xef495d06, 0xc9cbf769, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4cdfcd2e, 0x8bf091f, 0x4cdfcd2e, 0xe28984f6, 0x9813a416, 0x9813a416, 0x8217f630, 0x8217f630, 0x8217f630, 0x13cc7003, 0x13cc7003, 0x13cc7003, 0xa764dd3, 0xa764dd3, 0xa764dd3, 0x9813a416, 0xe28984f6, 0xe28984f6, 0x9813a416, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf2b49f88, 0x2eff252d, 0xf2b49f88, 0x8412aa3b, 0x5fcf013d, 0x5fcf013d, 0x5d3b9fe7, 0x5d3b9fe7, 0x5d3b9fe7, 0x8f2b8791, 0x8f2b8791, 0x8f2b8791, 0x9958b80e, 0x9958b80e, 0x9958b80e, 0x5fcf013d, 0x8412aa3b, 0x8412aa3b, 0x5fcf013d, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x786673be, 0x536f1359, 0x786673be, 0x6363a9b9, 0xdd28f52b, 0xdd28f52b, 0x38653b12, 0x38653b12, 0x38653b12, 0x1959c2f6, 0x1959c2f6, 0x1959c2f6, 0x64e1097a, 0x64e1097a, 0x64e1097a, 0xdd28f52b, 0x6363a9b9, 0x6363a9b9, 0xdd28f52b, }, 20 }, - { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xac4a1127, 0x699c2ad8, 0xac4a1127, 0x53f50aa7, 0x43d1f34, 0x43d1f34, 0xfa47dfba, 0xfa47dfba, 0xfa47dfba, 0x854d7612, 0x854d7612, 0x854d7612, 0x1c1c7394, 0x1c1c7394, 0x1c1c7394, 0x43d1f34, 0x53f50aa7, 0x53f50aa7, 0x43d1f34, }, 20 }, - { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xbc5f6633, 0xda908ab0, 0xbc5f6633, 0xffa9ab74, 0x59c36f00, 0x59c36f00, 0x3ad73295, 0x3ad73295, 0x3ad73295, 0x44575ff3, 0x44575ff3, 0x44575ff3, 0x26a14a21, 0x26a14a21, 0x26a14a21, 0x59c36f00, 0xffa9ab74, 0xffa9ab74, 0x59c36f00, }, 20 }, - { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xad820d6b, 0x9a88ad3, 0xad820d6b, 0x83878814, 0xaa4593fe, 0xaa4593fe, 0xbec19c1b, 0xbec19c1b, 0xbec19c1b, 0x1834917c, 0x1834917c, 0x1834917c, 0x350c3a04, 0x350c3a04, 0x350c3a04, 0xaa4593fe, 0x83878814, 0x83878814, 0xaa4593fe, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe5774112, 0x5ffb1eca, 0xe5774112, 0xb8602c96, 0xc9cbf769, 0xc9cbf769, 0xe4861949, 0xe4861949, 0xe4861949, 0x1a5ed885, 0x1a5ed885, 0x1a5ed885, 0xf314678d, 0xf314678d, 0xf314678d, 0xc9cbf769, 0xb8602c96, 0xb8602c96, 0xc9cbf769, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6af1a2bc, 0xd951ab8b, 0x6af1a2bc, 0xc4a7eb64, 0x9813a416, 0x9813a416, 0xb5e8801c, 0xb5e8801c, 0xb5e8801c, 0x2433062f, 0x2433062f, 0x2433062f, 0x3d893bff, 0x3d893bff, 0x3d893bff, 0x9813a416, 0xc4a7eb64, 0xc4a7eb64, 0x9813a416, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc6baa18, 0x1c9db179, 0xc6baa18, 0x7acd9fab, 0x5fcf013d, 0x5fcf013d, 0x819b5c4e, 0x819b5c4e, 0x819b5c4e, 0x538b4438, 0x538b4438, 0x538b4438, 0x45f87ba7, 0x45f87ba7, 0x45f87ba7, 0x5fcf013d, 0x7acd9fab, 0x7acd9fab, 0x5fcf013d, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe424a6ab, 0xb05c0275, 0xe424a6ab, 0xff217cac, 0xdd28f52b, 0xdd28f52b, 0xcd83646c, 0xcd83646c, 0xcd83646c, 0xecbf9d88, 0xecbf9d88, 0xecbf9d88, 0x91075604, 0x91075604, 0x91075604, 0xdd28f52b, 0xff217cac, 0xff217cac, 0xdd28f52b, }, 20 }, - { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4a7dff41, 0xe1ec28fc, 0x4a7dff41, 0xb5c2e4c1, 0x43d1f34, 0x43d1f34, 0xb200c08a, 0xb200c08a, 0xb200c08a, 0xcd0a6922, 0xcd0a6922, 0xcd0a6922, 0x545b6ca4, 0x545b6ca4, 0x545b6ca4, 0x43d1f34, 0xb5c2e4c1, 0xb5c2e4c1, 0x43d1f34, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd3d3e4a2, 0x9c635046, 0xd3d3e4a2, 0x902529e5, 0x59c36f00, 0x59c36f00, 0x85e713, 0x85e713, 0x85e713, 0x7e058a75, 0x7e058a75, 0x7e058a75, 0x1cf39fa7, 0x1cf39fa7, 0x1cf39fa7, 0x59c36f00, 0x902529e5, 0x902529e5, 0x59c36f00, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd61c80f5, 0xdf78b496, 0xd61c80f5, 0xf819058a, 0xaa4593fe, 0xaa4593fe, 0xefc0f7e7, 0xefc0f7e7, 0xefc0f7e7, 0x4935fa80, 0x4935fa80, 0x4935fa80, 0x640d51f8, 0x640d51f8, 0x640d51f8, 0xaa4593fe, 0xf819058a, 0xf819058a, 0xaa4593fe, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x936bc89d, 0x523a3e80, 0x936bc89d, 0xce7ca519, 0xc9cbf769, 0xc9cbf769, 0xaa99ffb1, 0xaa99ffb1, 0xaa99ffb1, 0x54413e7d, 0x54413e7d, 0x54413e7d, 0xbd0b8175, 0xbd0b8175, 0xbd0b8175, 0xc9cbf769, 0xce7ca519, 0xce7ca519, 0xc9cbf769, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4fdd0291, 0x133fa83d, 0x4fdd0291, 0xe18b4b49, 0x9813a416, 0x9813a416, 0x74c38e90, 0x74c38e90, 0x74c38e90, 0xe51808a3, 0xe51808a3, 0xe51808a3, 0xfca23573, 0xfca23573, 0xfca23573, 0x9813a416, 0xe18b4b49, 0xe18b4b49, 0x9813a416, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x538203b0, 0x2a92e789, 0x538203b0, 0x25243603, 0x5fcf013d, 0x5fcf013d, 0x5e4d3dd8, 0x5e4d3dd8, 0x5e4d3dd8, 0x8c5d25ae, 0x8c5d25ae, 0x8c5d25ae, 0x9a2e1a31, 0x9a2e1a31, 0x9a2e1a31, 0x5fcf013d, 0x25243603, 0x25243603, 0x5fcf013d, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xcfc85125, 0xa5b0e11b, 0xcfc85125, 0xd4cd8b22, 0xdd28f52b, 0xdd28f52b, 0x1af8cddc, 0x1af8cddc, 0x1af8cddc, 0x3bc43438, 0x3bc43438, 0x3bc43438, 0x467cffb4, 0x467cffb4, 0x467cffb4, 0xdd28f52b, 0xd4cd8b22, 0xd4cd8b22, 0xdd28f52b, }, 20 }, - { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf2469ffb, 0x1d0c1d2, 0xf2469ffb, 0xdf9847b, 0x43d1f34, 0x43d1f34, 0xa2837c7a, 0xa2837c7a, 0xa2837c7a, 0xdd89d5d2, 0xdd89d5d2, 0xdd89d5d2, 0x44d8d054, 0x44d8d054, 0x44d8d054, 0x43d1f34, 0xdf9847b, 0xdf9847b, 0x43d1f34, }, 20 }, - { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x27851cc1, 0x15f731b5, 0x27851cc1, 0x6473d186, 0x59c36f00, 0x59c36f00, 0x125bcddf, 0x125bcddf, 0x125bcddf, 0x6cdba0b9, 0x6cdba0b9, 0x6cdba0b9, 0xe2db56b, 0xe2db56b, 0xe2db56b, 0x59c36f00, 0x6473d186, 0x6473d186, 0x59c36f00, }, 20 }, - { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xfcb223c, 0x2c2e18b9, 0xfcb223c, 0x21cea743, 0xaa4593fe, 0xaa4593fe, 0xd700be1a, 0xd700be1a, 0xd700be1a, 0x71f5b37d, 0x71f5b37d, 0x71f5b37d, 0x5ccd1805, 0x5ccd1805, 0x5ccd1805, 0xaa4593fe, 0x21cea743, 0x21cea743, 0xaa4593fe, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x807efaa5, 0xb673036a, 0x807efaa5, 0xdd699721, 0xc9cbf769, 0xc9cbf769, 0xdca3ed4b, 0xdca3ed4b, 0xdca3ed4b, 0x227b2c87, 0x227b2c87, 0x227b2c87, 0xcb31938f, 0xcb31938f, 0xcb31938f, 0xc9cbf769, 0xdd699721, 0xdd699721, 0xc9cbf769, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x651d0d50, 0xf0dc38fc, 0x651d0d50, 0xcb4b4488, 0x9813a416, 0x9813a416, 0x80d03ee8, 0x80d03ee8, 0x80d03ee8, 0x110bb8db, 0x110bb8db, 0x110bb8db, 0x8b1850b, 0x8b1850b, 0x8b1850b, 0x9813a416, 0xcb4b4488, 0xcb4b4488, 0x9813a416, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xb9b068f, 0xdc68ac3c, 0xb9b068f, 0x7d3d333c, 0x5fcf013d, 0x5fcf013d, 0xa1f0a6e4, 0xa1f0a6e4, 0xa1f0a6e4, 0x73e0be92, 0x73e0be92, 0x73e0be92, 0x6593810d, 0x6593810d, 0x6593810d, 0x5fcf013d, 0x7d3d333c, 0x7d3d333c, 0x5fcf013d, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xf0789d7e, 0x6f2f2b61, 0xf0789d7e, 0xeb7d4779, 0xdd28f52b, 0xdd28f52b, 0xb995630, 0xb995630, 0xb995630, 0x2aa5afd4, 0x2aa5afd4, 0x2aa5afd4, 0x571d6458, 0x571d6458, 0x571d6458, 0xdd28f52b, 0xeb7d4779, 0xeb7d4779, 0xdd28f52b, }, 20 }, - { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x819821ff, 0xdd19128c, 0x819821ff, 0x7e273a7f, 0x43d1f34, 0x43d1f34, 0xf35981d3, 0xf35981d3, 0xf35981d3, 0x8c53287b, 0x8c53287b, 0x8c53287b, 0x15022dfd, 0x15022dfd, 0x15022dfd, 0x43d1f34, 0x7e273a7f, 0x7e273a7f, 0x43d1f34, }, 20 }, - { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa99604d1, 0xcf59e852, 0xa99604d1, 0xfebbba0f, 0x59c36f00, 0x59c36f00, 0x53767ce3, 0x53767ce3, 0x53767ce3, 0x2df61185, 0x2df61185, 0x2df61185, 0x4f000457, 0x4f000457, 0x4f000457, 0x59c36f00, 0xfebbba0f, 0xfebbba0f, 0x59c36f00, }, 20 }, - { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x7d0a218, 0xa3fa25a0, 0x7d0a218, 0xb777784e, 0xaa4593fe, 0xaa4593fe, 0x35db26e1, 0x35db26e1, 0x35db26e1, 0x932e2b86, 0x932e2b86, 0x932e2b86, 0xbe1680fe, 0xbe1680fe, 0xbe1680fe, 0xaa4593fe, 0xb777784e, 0xb777784e, 0xaa4593fe, }, 20 }, - { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x63be90f4, 0xd932cf2c, 0x63be90f4, 0x739b8e5a, 0xc9cbf769, 0xc9cbf769, 0x70a00efe, 0x70a00efe, 0x70a00efe, 0x8e78cf32, 0x8e78cf32, 0x8e78cf32, 0x6732703a, 0x6732703a, 0x6732703a, 0xc9cbf769, 0x739b8e5a, 0x739b8e5a, 0xc9cbf769, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x53460c90, 0xe0e605a7, 0x53460c90, 0x6337f0bf, 0x9813a416, 0x9813a416, 0x4161864c, 0x4161864c, 0x4161864c, 0xd0ba007f, 0xd0ba007f, 0xd0ba007f, 0xc9003daf, 0xc9003daf, 0xc9003daf, 0x9813a416, 0x6337f0bf, 0x6337f0bf, 0x9813a416, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf54761a0, 0xe5b17ac1, 0xf54761a0, 0x5b408e55, 0x5fcf013d, 0x5fcf013d, 0x580fda0e, 0x580fda0e, 0x580fda0e, 0x8a1fc278, 0x8a1fc278, 0x8a1fc278, 0x9c6cfde7, 0x9c6cfde7, 0x9c6cfde7, 0x5fcf013d, 0x5b408e55, 0x5b408e55, 0x5fcf013d, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xec78b0c1, 0xb800141f, 0xec78b0c1, 0x621c7b1b, 0xdd28f52b, 0xdd28f52b, 0x8f60179, 0x8f60179, 0x8f60179, 0x29caf89d, 0x29caf89d, 0x29caf89d, 0x54723311, 0x54723311, 0x54723311, 0xdd28f52b, 0x621c7b1b, 0x621c7b1b, 0xdd28f52b, }, 20 }, - { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf209411b, 0x599896a6, 0xf209411b, 0x6551c7bb, 0x43d1f34, 0x43d1f34, 0x5ac6bb4a, 0x5ac6bb4a, 0x5ac6bb4a, 0x25cc12e2, 0x25cc12e2, 0x25cc12e2, 0xbc9d1764, 0xbc9d1764, 0xbc9d1764, 0x43d1f34, 0x6551c7bb, 0x6551c7bb, 0x43d1f34, }, 20 }, - { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x93b4fcd8, 0xf57b105b, 0x93b4fcd8, 0x2bfe5312, 0x59c36f00, 0x59c36f00, 0x3ad73295, 0x3ad73295, 0x3ad73295, 0x44575ff3, 0x44575ff3, 0x44575ff3, 0x26a14a21, 0x26a14a21, 0x26a14a21, 0x59c36f00, 0x2bfe5312, 0x2bfe5312, 0x59c36f00, }, 20 }, - { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x656c9044, 0xc14617fc, 0x656c9044, 0xa6ea58cb, 0xaa4593fe, 0xaa4593fe, 0xbec19c1b, 0xbec19c1b, 0xbec19c1b, 0x1834917c, 0x1834917c, 0x1834917c, 0x350c3a04, 0x350c3a04, 0x350c3a04, 0xaa4593fe, 0xa6ea58cb, 0xa6ea58cb, 0xaa4593fe, }, 20 }, - { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa11479ed, 0x1b982635, 0xa11479ed, 0xe37185d0, 0xc9cbf769, 0xc9cbf769, 0xe4861949, 0xe4861949, 0xe4861949, 0x1a5ed885, 0x1a5ed885, 0x1a5ed885, 0xf314678d, 0xf314678d, 0xf314678d, 0xc9cbf769, 0xe37185d0, 0xe37185d0, 0xc9cbf769, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x244770a7, 0x97e77990, 0x244770a7, 0x6a54d2ee, 0x9813a416, 0x9813a416, 0xb5e8801c, 0xb5e8801c, 0xb5e8801c, 0x2433062f, 0x2433062f, 0x2433062f, 0x3d893bff, 0x3d893bff, 0x3d893bff, 0x9813a416, 0x6a54d2ee, 0x6a54d2ee, 0x9813a416, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x8ca34476, 0x9c555f17, 0x8ca34476, 0x1fc54b41, 0x5fcf013d, 0x5fcf013d, 0x819b5c4e, 0x819b5c4e, 0x819b5c4e, 0x538b4438, 0x538b4438, 0x538b4438, 0x45f87ba7, 0x45f87ba7, 0x45f87ba7, 0x5fcf013d, 0x1fc54b41, 0x1fc54b41, 0x5fcf013d, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xf19f6af8, 0xa5e7ce26, 0xf19f6af8, 0x1619aea6, 0xdd28f52b, 0xdd28f52b, 0xcd83646c, 0xcd83646c, 0xcd83646c, 0xecbf9d88, 0xecbf9d88, 0xecbf9d88, 0x91075604, 0x91075604, 0x91075604, 0xdd28f52b, 0x1619aea6, 0x1619aea6, 0xdd28f52b, }, 20 }, - { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x5f75414f, 0xf4e496f2, 0x5f75414f, 0x27fd1fe0, 0x43d1f34, 0x43d1f34, 0xb200c08a, 0xb200c08a, 0xb200c08a, 0xcd0a6922, 0xcd0a6922, 0xcd0a6922, 0x545b6ca4, 0x545b6ca4, 0x545b6ca4, 0x43d1f34, 0x27fd1fe0, 0x27fd1fe0, 0x43d1f34, }, 20 }, - { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 }, - { "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 }, - { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x4c2cef83, 0x1b215a88, 0xe2378595, 0xb53a309e, 0x15f64d5e, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x758f388c, 0xd4442397, 0x33f5784b, 0x923e6350, 0xf97bb902, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xb9f6f52a, 0x4e24e8b7, 0x53beb8e1, 0xa46ca57c, 0x688a184d, }, 5 }, - { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x5bd98ce3, 0x15df7962, 0xc7d467e1, 0x89d29260, 0x662e2c16, }, 5 }, - { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, }, 5 }, - { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, }, 5 }, - { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x335fadcb, 0x1f517b5c, 0x6b4200e5, 0x474cd672, 0x8364f797, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xcf9985f8, 0x1d92c7fc, 0x6e637701, 0xbc683505, 0x898016fb, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xdb824190, 0x378d05dc, 0x670bff9, 0xea7ffbb5, 0x658bcbb3, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x157232bd, 0x5e6bdacd, 0x8341e25d, 0xc8580a2d, 0x3cf9e58c, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0xbfafd7cd, 0x51650951, 0x67d61c04, 0x891cc298, 0xab036ae, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x760580c9, 0xdc6d8205, 0x2739f3a0, 0x8d51f16c, 0xd47d661b, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0xada3b5f, 0x24cd61a6, 0x56f48ead, 0x78e3d454, 0xb28750bb, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x827694e2, 0x9d97c3dd, 0xbdb43a9c, 0xa2556da3, 0xfdf3c81e, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0x664534a5, 0xcd0979a0, 0x3531d85e, 0x9e7d955b, 0xc0aced53, }, 5 }, + { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xcd5fc34e, 0xcd5fc34e, 0xeabbecab, 0xeabbecab, 0xc9950151, 0xc9950151, 0x2be222b6, 0x2be222b6, 0xe88c769e, 0xe88c769e, 0x6be4910e, 0x6be4910e, 0x1dc1fe4f, 0x1dc1fe4f, 0xd7613e8f, 0xd7613e8f, 0xf8124196, 0xf8124196, 0x130f5935, 0x130f5935, 0x2872330e, 0x2872330e, 0xaa7b7868, 0xaa7b7868, 0x558eaeea, 0x558eaeea, 0x92f7960f, 0x92f7960f, 0xc5bfc709, 0xc5bfc709, 0x699732fe, 0x699732fe, 0xc859125f, 0xc859125f, 0xfc6ac729, 0xfc6ac729, 0xcdab6cd4, 0xcdab6cd4, 0x58a8b7f8, 0x58a8b7f8, 0xc0e73385, 0x6560d6ef, 0x3be8bb5d, 0x3be8bb5d, }, 45 }, + { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x13029f94, 0x13029f94, 0x7785fdab, 0x7785fdab, 0x95a7c1e8, 0x95a7c1e8, 0x315ab3e3, 0x315ab3e3, 0x6787f012, 0x6787f012, 0x79b1ecdc, 0x79b1ecdc, 0xdbc67810, 0xdbc67810, 0xafaa982e, 0xafaa982e, 0xc5cd0157, 0xc5cd0157, 0x3c50dd64, 0x3c50dd64, 0x1056cac0, 0x1056cac0, 0x1d7a41fa, 0x1d7a41fa, 0x5690b1e8, 0x5690b1e8, 0x616831d6, 0x616831d6, 0xfaf8e726, 0xfaf8e726, 0xd1ec5e26, 0xd1ec5e26, 0x3c269e1f, 0x3c269e1f, 0x1aa7952d, 0x1aa7952d, 0x6e7e2f99, 0x6e7e2f99, 0x98f4c02, 0x98f4c02, 0xc3f1abf2, 0xe348bb73, 0xea53cd60, 0xea53cd60, }, 45 }, + { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x8fbb4f4c, 0x8fbb4f4c, 0x5dc00167, 0x5dc00167, 0xbc124df8, 0xbc124df8, 0x31cf0f8e, 0x31cf0f8e, 0x798cc4ed, 0x798cc4ed, 0xc5d2a091, 0xc5d2a091, 0xb58a0591, 0xb58a0591, 0x4d118aca, 0x4d118aca, 0xbb06c7ee, 0xbb06c7ee, 0x42179db7, 0x42179db7, 0x65f2d81e, 0x65f2d81e, 0xa2628bcb, 0xa2628bcb, 0xbdb7f4b, 0xbdb7f4b, 0x66b10309, 0x66b10309, 0x1a550ea9, 0x1a550ea9, 0x377a297d, 0x377a297d, 0x2ea99015, 0x2ea99015, 0x4e20d7bc, 0x4e20d7bc, 0x8ecbde02, 0x8ecbde02, 0xdfa2195a, 0xdfa2195a, 0xe113d2a, 0xe204ee5b, 0x734679c1, 0x734679c1, }, 45 }, + { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0xe2f6bfe1, 0xe2f6bfe1, 0xf18aee15, 0xf18aee15, 0x5e83b689, 0x5e83b689, 0xb7e8b42c, 0xb7e8b42c, 0x85d78f92, 0x85d78f92, 0xd56fadae, 0xd56fadae, 0x7632f5bf, 0x7632f5bf, 0x2769a748, 0x2769a748, 0x4a6112cd, 0x4a6112cd, 0x4f9b66a4, 0x4f9b66a4, 0x70457d38, 0x70457d38, 0x8cadb1a7, 0x8cadb1a7, 0x451341f, 0x451341f, 0x8a62e741, 0x8a62e741, 0x1b1f9031, 0x1b1f9031, 0x75ab630e, 0x75ab630e, 0xd5ff53ac, 0xd5ff53ac, 0x73a2b3c7, 0x73a2b3c7, 0x7b52acd5, 0x7b52acd5, 0xf6f3e48c, 0xf6f3e48c, 0x8d0db133, 0x8db24310, 0x7aef56d4, 0x7aef56d4, }, 45 }, + { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x838a3f40, 0x838a3f40, 0x7351ba96, 0x7351ba96, 0x660963bb, 0x660963bb, 0x6f3362a6, 0x6f3362a6, 0x915d35d9, 0x915d35d9, 0xc7edaee9, 0xc7edaee9, 0xbc8ec24c, 0xbc8ec24c, 0xeb120ffd, 0xeb120ffd, 0x8f6d8232, 0x8f6d8232, 0x2de5d515, 0x2de5d515, 0x4f2ecd91, 0x4f2ecd91, 0x555a9b90, 0x555a9b90, 0x8f7b0d77, 0x8f7b0d77, 0x5f9536af, 0x5f9536af, 0x3dd79dbe, 0x3dd79dbe, 0xb555a0, 0xb555a0, 0x75aec882, 0x75aec882, 0xd5da89cb, 0xd5da89cb, 0xb47b3257, 0xb47b3257, 0x7c97c046, 0x7c97c046, 0x726a7abe, 0x4c8b8a56, 0xcffa0854, 0xcffa0854, }, 45 }, + { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x7bf761e, 0x7bf761e, 0xaf0b6dae, 0xaf0b6dae, 0x7db15930, 0x7db15930, 0xc9720d56, 0xc9720d56, 0x55590d6c, 0x55590d6c, 0xa0d193d9, 0xa0d193d9, 0x728987b2, 0x728987b2, 0x28aecde6, 0x28aecde6, 0xa59bb094, 0xa59bb094, 0x2d0b049d, 0x2d0b049d, 0xd8421240, 0xd8421240, 0x51fa339, 0x51fa339, 0xc625cc46, 0xc625cc46, 0x2c9e6fcc, 0x2c9e6fcc, 0x3d06ffd5, 0x3d06ffd5, 0x8dd72816, 0x8dd72816, 0xfcf2a982, 0xfcf2a982, 0x6ef2870f, 0x6ef2870f, 0xba2caab7, 0xba2caab7, 0x8e5a5872, 0x8e5a5872, 0x62b2fedc, 0x2bd3b588, 0x34ebdb15, 0x34ebdb15, }, 45 }, + { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0xa133280a, 0xa133280a, 0x1e8f4227, 0x1e8f4227, 0xa01cd911, 0xa01cd911, 0xdcb3d617, 0xdcb3d617, 0x51200351, 0x51200351, 0x609ba305, 0x609ba305, 0x5d96abfd, 0x5d96abfd, 0xd855cc70, 0xd855cc70, 0xdbfaf18d, 0xdbfaf18d, 0x84814843, 0x84814843, 0x4b00e630, 0x4b00e630, 0xd362b0f5, 0xd362b0f5, 0xec863355, 0xec863355, 0x195898d0, 0x195898d0, 0xe8c698c7, 0xe8c698c7, 0x884229e7, 0x884229e7, 0xb41ed3a9, 0xb41ed3a9, 0x2be1ce40, 0x2be1ce40, 0x8c33eb7c, 0x8c33eb7c, 0xbbce1da, 0xbbce1da, 0xef9415fa, 0x22fbc0d, 0xd82c182c, 0xd82c182c, }, 45 }, + { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xbe029c, 0x6671ee1f, 0xbe029c, 0x4348cfdb, 0x59c36f00, 0x59c36f00, 0x3ad73295, 0x3ad73295, 0x3ad73295, 0x44575ff3, 0x44575ff3, 0x44575ff3, 0x26a14a21, 0x26a14a21, 0x26a14a21, 0x59c36f00, 0x4348cfdb, 0x4348cfdb, 0x59c36f00, }, 20 }, + { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x14e228ef, 0xb0c8af57, 0x14e228ef, 0x3ae7ad90, 0xaa4593fe, 0xaa4593fe, 0xbec19c1b, 0xbec19c1b, 0xbec19c1b, 0x1834917c, 0x1834917c, 0x1834917c, 0x350c3a04, 0x350c3a04, 0x350c3a04, 0xaa4593fe, 0x3ae7ad90, 0x3ae7ad90, 0xaa4593fe, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x651fb144, 0xdf93ee9c, 0x651fb144, 0x3808dcc0, 0xc9cbf769, 0xc9cbf769, 0xe4861949, 0xe4861949, 0xe4861949, 0x1a5ed885, 0x1a5ed885, 0x1a5ed885, 0xf314678d, 0xf314678d, 0xf314678d, 0xc9cbf769, 0x3808dcc0, 0x3808dcc0, 0xc9cbf769, }, 20 }, + { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0xdfd0119e, 0x6c7018a9, 0xdfd0119e, 0x71865846, 0x9813a416, 0x9813a416, 0xb5e8801c, 0xb5e8801c, 0xb5e8801c, 0x2433062f, 0x2433062f, 0x2433062f, 0x3d893bff, 0x3d893bff, 0x3d893bff, 0x9813a416, 0x71865846, 0x71865846, 0x9813a416, }, 20 }, + { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x4e4844e0, 0x5ebe5f81, 0x4e4844e0, 0x38ee7153, 0x5fcf013d, 0x5fcf013d, 0x819b5c4e, 0x819b5c4e, 0x819b5c4e, 0x538b4438, 0x538b4438, 0x538b4438, 0x45f87ba7, 0x45f87ba7, 0x45f87ba7, 0x5fcf013d, 0x38ee7153, 0x38ee7153, 0x5fcf013d, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x701427d4, 0x246c830a, 0x701427d4, 0x6b11fdd3, 0xdd28f52b, 0xdd28f52b, 0xcd83646c, 0xcd83646c, 0xcd83646c, 0xecbf9d88, 0xecbf9d88, 0xecbf9d88, 0x91075604, 0x91075604, 0x91075604, 0xdd28f52b, 0x6b11fdd3, 0x6b11fdd3, 0xdd28f52b, }, 20 }, + { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x7b5bd4c, 0xac246af1, 0x7b5bd4c, 0xf80aa6cc, 0x43d1f34, 0x43d1f34, 0xb200c08a, 0xb200c08a, 0xb200c08a, 0xcd0a6922, 0xcd0a6922, 0xcd0a6922, 0x545b6ca4, 0x545b6ca4, 0x545b6ca4, 0x43d1f34, 0xf80aa6cc, 0xf80aa6cc, 0x43d1f34, }, 20 }, + { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0x1027210c, 0x64e51c81, 0x1027210c, 0x45ca4a8a, 0x9a2e0d26, 0x12fd0f21, 0x12fd0f21, 0x12fd0f21, 0x4e25f9e1, 0x4e25f9e1, 0x4e25f9e1, 0x67bd3773, 0x67bd3773, 0x67bd3773, 0x59c36f00, 0x45ca4a8a, 0x45ca4a8a, }, 18 }, + { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x8d12f697, 0xc5b32248, 0x8d12f697, 0x56720aa4, 0xa9d58ccd, 0xf766a14d, 0xf766a14d, 0xf766a14d, 0xa2390b47, 0xa2390b47, 0xa2390b47, 0xcb0ac30e, 0xcb0ac30e, 0xcb0ac30e, 0xaa4593fe, 0x56720aa4, 0x56720aa4, }, 18 }, + { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xa5ec9f45, 0xdb7085d8, 0xa5ec9f45, 0x9caf1d3f, 0x5411be8b, 0xedc0ad83, 0xedc0ad83, 0xedc0ad83, 0x927e0b17, 0x927e0b17, 0x927e0b17, 0xd00a6b6f, 0xd00a6b6f, 0xd00a6b6f, 0xc9cbf769, 0x9caf1d3f, 0x9caf1d3f, }, 18 }, + { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x1c3742c9, 0xce8e83bf, 0xeb96c838, 0xce8e83bf, 0x73cb3bc1, 0x740d78cf, 0xb35c7e64, 0xb35c7e64, 0xb35c7e64, 0x58f99418, 0x58f99418, 0x58f99418, 0x5eb294e8, 0x5eb294e8, 0x5eb294e8, 0x1c3742c9, 0x73cb3bc1, 0x73cb3bc1, }, 18 }, + { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0xcc5a7bed, 0x56a03e51, 0xee7d8d4b, 0x56a03e51, 0x5bdf9413, 0xbcda144c, 0x220f7a5e, 0x220f7a5e, 0x220f7a5e, 0x4d46a64f, 0x4d46a64f, 0x4d46a64f, 0x40b0384c, 0x40b0384c, 0x40b0384c, 0xcc5a7bed, 0x5bdf9413, 0x5bdf9413, }, 18 }, + { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xef4a3312, 0xea8a9cf0, 0x8929e522, 0xea8a9cf0, 0x78f3dfbc, 0x5d55a141, 0x377f1aeb, 0x377f1aeb, 0x377f1aeb, 0xf1cd5ef5, 0xf1cd5ef5, 0xf1cd5ef5, 0xe5a88e4a, 0xe5a88e4a, 0xe5a88e4a, 0xef4a3312, 0x78f3dfbc, 0x78f3dfbc, }, 18 }, + { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x54e48d80, 0x6dcf1d57, 0x925a4c8f, 0x6dcf1d57, 0x69005b38, 0x6d6bb4bc, 0x756a36b9, 0x756a36b9, 0x756a36b9, 0xf499c068, 0xf499c068, 0xf499c068, 0x623d7907, 0x623d7907, 0x623d7907, 0x54e48d80, 0x69005b38, 0x69005b38, }, 18 }, + { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xa49d26b0, 0xaa7d9b28, 0xa49d26b0, 0xe76bebf7, 0x59c36f00, 0x59c36f00, 0xea6ab252, 0xea6ab252, 0xea6ab252, 0x94eadf34, 0x94eadf34, 0x94eadf34, 0xf61ccae6, 0xf61ccae6, 0xf61ccae6, 0x59c36f00, 0xe76bebf7, 0xe76bebf7, 0x59c36f00, }, 20 }, + { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x7a277db, 0xf3bf80f7, 0x7a277db, 0x29a7f2a4, 0xaa4593fe, 0xaa4593fe, 0xf1cd57e3, 0xf1cd57e3, 0xf1cd57e3, 0x57385a84, 0x57385a84, 0x57385a84, 0x7a00f1fc, 0x7a00f1fc, 0x7a00f1fc, 0xaa4593fe, 0x29a7f2a4, 0x29a7f2a4, 0xaa4593fe, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x631edf85, 0x71926408, 0x631edf85, 0x3e09b201, 0xc9cbf769, 0xc9cbf769, 0xf224ab3, 0xf224ab3, 0xf224ab3, 0xf1fa8b7f, 0xf1fa8b7f, 0xf1fa8b7f, 0x18b03477, 0x18b03477, 0x18b03477, 0xc9cbf769, 0x3e09b201, 0x3e09b201, 0xc9cbf769, }, 20 }, + { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0xfbaf4635, 0xe69ef474, 0xfbaf4635, 0x55f90fed, 0x9813a416, 0x9813a416, 0x3aad8f41, 0x3aad8f41, 0x3aad8f41, 0xab760972, 0xab760972, 0xab760972, 0xb2cc34a2, 0xb2cc34a2, 0xb2cc34a2, 0x9813a416, 0x55f90fed, 0x55f90fed, 0x9813a416, }, 20 }, + { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0xdce50745, 0x1d8009e4, 0xdce50745, 0xaa4332f6, 0x5fcf013d, 0x5fcf013d, 0x354e5749, 0x354e5749, 0x354e5749, 0xe75e4f3f, 0xe75e4f3f, 0xe75e4f3f, 0xf12d70a0, 0xf12d70a0, 0xf12d70a0, 0x5fcf013d, 0xaa4332f6, 0xaa4332f6, 0x5fcf013d, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x3efebeff, 0xf101dfe2, 0x3efebeff, 0x25fb64f8, 0xdd28f52b, 0xdd28f52b, 0x70c69ebd, 0x70c69ebd, 0x70c69ebd, 0x51fa6759, 0x51fa6759, 0x51fa6759, 0x2c42acd5, 0x2c42acd5, 0x2c42acd5, 0xdd28f52b, 0x25fb64f8, 0x25fb64f8, 0xdd28f52b, }, 20 }, + { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x59a34c64, 0x281cca78, 0x59a34c64, 0xa61c57e4, 0x43d1f34, 0x43d1f34, 0x95131d4, 0x95131d4, 0x95131d4, 0x765b987c, 0x765b987c, 0x765b987c, 0xef0a9dfa, 0xef0a9dfa, 0xef0a9dfa, 0x43d1f34, 0xa61c57e4, 0xa61c57e4, 0x43d1f34, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xa37c165, 0x72063383, 0xa37c165, 0x49c10c22, 0x59c36f00, 0x59c36f00, 0x4e53de8e, 0x4e53de8e, 0x4e53de8e, 0x30d3b3e8, 0x30d3b3e8, 0x30d3b3e8, 0x5225a63a, 0x5225a63a, 0x5225a63a, 0x59c36f00, 0x49c10c22, 0x49c10c22, 0x59c36f00, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x45bba0ba, 0xe60fd0b6, 0x45bba0ba, 0x6bbe25c5, 0xaa4593fe, 0xaa4593fe, 0x28de2b41, 0x28de2b41, 0x28de2b41, 0x8e2b2626, 0x8e2b2626, 0x8e2b2626, 0xa3138d5e, 0xa3138d5e, 0xa3138d5e, 0xaa4593fe, 0x6bbe25c5, 0x6bbe25c5, 0xaa4593fe, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xb43d4e9d, 0x16f88820, 0xb43d4e9d, 0xe92a2319, 0xc9cbf769, 0xc9cbf769, 0xb8959ec7, 0xb8959ec7, 0xb8959ec7, 0x464d5f0b, 0x464d5f0b, 0x464d5f0b, 0xaf07e003, 0xaf07e003, 0xaf07e003, 0xc9cbf769, 0xe92a2319, 0xe92a2319, 0xc9cbf769, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x46760365, 0x685ae30e, 0x46760365, 0xe8204abd, 0x9813a416, 0x9813a416, 0x8896050a, 0x8896050a, 0x8896050a, 0x194d8339, 0x194d8339, 0x194d8339, 0xf7bee9, 0xf7bee9, 0xf7bee9, 0x9813a416, 0xe8204abd, 0xe8204abd, 0x9813a416, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x6859aa86, 0xf3f11deb, 0x6859aa86, 0x1eff9f35, 0x5fcf013d, 0x5fcf013d, 0xd72b1482, 0xd72b1482, 0xd72b1482, 0x53b0cf4, 0x53b0cf4, 0x53b0cf4, 0x1348336b, 0x1348336b, 0x1348336b, 0x5fcf013d, 0x1eff9f35, 0x1eff9f35, 0x5fcf013d, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x688451e7, 0xf6936b72, 0x688451e7, 0x73818be0, 0xdd28f52b, 0xdd28f52b, 0xf12a65ac, 0xf12a65ac, 0xf12a65ac, 0xd0169c48, 0xd0169c48, 0xd0169c48, 0xadae57c4, 0xadae57c4, 0xadae57c4, 0xdd28f52b, 0x73818be0, 0x73818be0, 0xdd28f52b, }, 20 }, + { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x9616af94, 0xd466be40, 0x9616af94, 0x69a9b414, 0x43d1f34, 0x43d1f34, 0xf3bb3240, 0xf3bb3240, 0xf3bb3240, 0x8cb19be8, 0x8cb19be8, 0x8cb19be8, 0x15e09e6e, 0x15e09e6e, 0x15e09e6e, 0x43d1f34, 0x69a9b414, 0x69a9b414, 0x43d1f34, }, 20 }, + { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0x8708d1bd, 0x85dd5e9c, 0x8708d1bd, 0xc4fe1cfa, 0x59c36f00, 0x59c36f00, 0x7ae8aced, 0x7ae8aced, 0x7ae8aced, 0x468c18b, 0x468c18b, 0x468c18b, 0x669ed459, 0x669ed459, 0x669ed459, 0x59c36f00, 0xc4fe1cfa, 0xc4fe1cfa, 0x59c36f00, }, 20 }, + { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0xa72b1043, 0x147d4ce0, 0xa72b1043, 0x892e953c, 0xaa4593fe, 0xaa4593fe, 0xb7b1dd40, 0xb7b1dd40, 0xb7b1dd40, 0x1144d027, 0x1144d027, 0x1144d027, 0x3c7c7b5f, 0x3c7c7b5f, 0x3c7c7b5f, 0xaa4593fe, 0x892e953c, 0x892e953c, 0xaa4593fe, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xc5fb1817, 0x745fb26c, 0xc5fb1817, 0x98ec7593, 0xc9cbf769, 0xc9cbf769, 0xf5f17e2d, 0xf5f17e2d, 0xf5f17e2d, 0xb29bfe1, 0xb29bfe1, 0xb29bfe1, 0xe26300e9, 0xe26300e9, 0xe26300e9, 0xc9cbf769, 0x98ec7593, 0x98ec7593, 0xc9cbf769, }, 20 }, + { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x4be837e1, 0xbf4963ca, 0x4be837e1, 0xe5be7e39, 0x9813a416, 0x9813a416, 0xd886fca0, 0xd886fca0, 0xd886fca0, 0x495d7a93, 0x495d7a93, 0x495d7a93, 0x50e74743, 0x50e74743, 0x50e74743, 0x9813a416, 0xe5be7e39, 0xe5be7e39, 0x9813a416, }, 20 }, + { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x21a8ccb8, 0x17719be, 0x21a8ccb8, 0x570ef90b, 0x5fcf013d, 0x5fcf013d, 0x2a7b5333, 0x2a7b5333, 0x2a7b5333, 0xf86b4b45, 0xf86b4b45, 0xf86b4b45, 0xee1874da, 0xee1874da, 0xee1874da, 0x5fcf013d, 0x570ef90b, 0x570ef90b, 0x5fcf013d, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x7001fe50, 0x4798153f, 0x7001fe50, 0x6b042457, 0xdd28f52b, 0xdd28f52b, 0x46489369, 0x46489369, 0x46489369, 0x67746a8d, 0x67746a8d, 0x67746a8d, 0x1acca101, 0x1acca101, 0x1acca101, 0xdd28f52b, 0x6b042457, 0x6b042457, 0xdd28f52b, }, 20 }, + { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x6e10591c, 0x48bd926e, 0x6e10591c, 0x91af429c, 0x43d1f34, 0x43d1f34, 0x59cb829, 0x59cb829, 0x59cb829, 0x7a961181, 0x7a961181, 0x7a961181, 0xe3c71407, 0xe3c71407, 0xe3c71407, 0x43d1f34, 0x91af429c, 0x91af429c, 0x43d1f34, }, 20 }, + { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0x67627ed5, 0xdb276cef, 0x67627ed5, 0x2494b392, 0x59c36f00, 0x59c36f00, 0x43f511f3, 0x43f511f3, 0x43f511f3, 0x3d757c95, 0x3d757c95, 0x3d757c95, 0x5f836947, 0x5f836947, 0x5f836947, 0x59c36f00, 0x2494b392, 0x2494b392, 0x59c36f00, }, 20 }, + { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x987cbf71, 0x6e4c645c, 0x987cbf71, 0xb6793a0e, 0xaa4593fe, 0xaa4593fe, 0xb943d716, 0xb943d716, 0xb943d716, 0x1fb6da71, 0x1fb6da71, 0x1fb6da71, 0x328e7109, 0x328e7109, 0x328e7109, 0xaa4593fe, 0xb6793a0e, 0xb6793a0e, 0xaa4593fe, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xf9987c07, 0x4a92eed9, 0xf9987c07, 0xa48f1183, 0xc9cbf769, 0xc9cbf769, 0x5eb3ddf4, 0x5eb3ddf4, 0x5eb3ddf4, 0xa06b1c38, 0xa06b1c38, 0xa06b1c38, 0x4921a330, 0x4921a330, 0x4921a330, 0xc9cbf769, 0xa48f1183, 0xa48f1183, 0xc9cbf769, }, 20 }, + { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0xccd804e2, 0xb99e8d91, 0xccd804e2, 0x628e4d3a, 0x9813a416, 0x9813a416, 0x5aec5acc, 0x5aec5acc, 0x5aec5acc, 0xcb37dcff, 0xcb37dcff, 0xcb37dcff, 0xd28de12f, 0xd28de12f, 0xd28de12f, 0x9813a416, 0x628e4d3a, 0x628e4d3a, 0x9813a416, }, 20 }, + { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x4990d896, 0x2b3aa242, 0x4990d896, 0x3f36ed25, 0x5fcf013d, 0x5fcf013d, 0x3cc6048d, 0x3cc6048d, 0x3cc6048d, 0xeed61cfb, 0xeed61cfb, 0xeed61cfb, 0xf8a52364, 0xf8a52364, 0xf8a52364, 0x5fcf013d, 0x3f36ed25, 0x3f36ed25, 0x5fcf013d, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x4ff5c69f, 0x66586489, 0x4ff5c69f, 0x54f01c98, 0xdd28f52b, 0xdd28f52b, 0xc3ff0bf5, 0xc3ff0bf5, 0xc3ff0bf5, 0xe2c3f211, 0xe2c3f211, 0xe2c3f211, 0x9f7b399d, 0x9f7b399d, 0x9f7b399d, 0xdd28f52b, 0x54f01c98, 0x54f01c98, 0xdd28f52b, }, 20 }, + { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x909b7bb4, 0x2bb2a58c, 0x909b7bb4, 0x6f246034, 0x43d1f34, 0x43d1f34, 0x2df40751, 0x2df40751, 0x2df40751, 0x52feaef9, 0x52feaef9, 0x52feaef9, 0xcbafab7f, 0xcbafab7f, 0xcbafab7f, 0x43d1f34, 0x6f246034, 0x6f246034, 0x43d1f34, }, 20 }, + { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xc77bfcc6, 0xffcdf45d, 0xc77bfcc6, 0x848d3181, 0x59c36f00, 0x59c36f00, 0xd79cd5e, 0xd79cd5e, 0xd79cd5e, 0x73f9a038, 0x73f9a038, 0x73f9a038, 0x110fb5ea, 0x110fb5ea, 0x110fb5ea, 0x59c36f00, 0x848d3181, 0x848d3181, 0x59c36f00, }, 20 }, + { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0xd5494aa5, 0xa0924ec, 0xd5494aa5, 0xfb4ccfda, 0xaa4593fe, 0xaa4593fe, 0x8692c636, 0x8692c636, 0x8692c636, 0x2067cb51, 0x2067cb51, 0x2067cb51, 0xd5f6029, 0xd5f6029, 0xd5f6029, 0xaa4593fe, 0xfb4ccfda, 0xfb4ccfda, 0xaa4593fe, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x2436c4f, 0x2cde4e0c, 0x2436c4f, 0x5f5401cb, 0xc9cbf769, 0xc9cbf769, 0x558f50ae, 0x558f50ae, 0x558f50ae, 0xab579162, 0xab579162, 0xab579162, 0x421d2e6a, 0x421d2e6a, 0x421d2e6a, 0xc9cbf769, 0x5f5401cb, 0x5f5401cb, 0xc9cbf769, }, 20 }, + { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x86f8a68c, 0xf4116451, 0x86f8a68c, 0x28aeef54, 0x9813a416, 0x9813a416, 0x7befbe43, 0x7befbe43, 0x7befbe43, 0xea343870, 0xea343870, 0xea343870, 0xf38e05a0, 0xf38e05a0, 0xf38e05a0, 0x9813a416, 0x28aeef54, 0x28aeef54, 0x9813a416, }, 20 }, + { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x156c292f, 0x3c8eb473, 0x156c292f, 0x63ca1c9c, 0x5fcf013d, 0x5fcf013d, 0x895ea16b, 0x895ea16b, 0x895ea16b, 0x5b4eb91d, 0x5b4eb91d, 0x5b4eb91d, 0x4d3d8682, 0x4d3d8682, 0x4d3d8682, 0x5fcf013d, 0x63ca1c9c, 0x63ca1c9c, 0x5fcf013d, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0xf57ebf12, 0x798b299b, 0xf57ebf12, 0xee7b6515, 0xdd28f52b, 0xdd28f52b, 0x22563fc6, 0x22563fc6, 0x22563fc6, 0x36ac622, 0x36ac622, 0x36ac622, 0x7ed20dae, 0x7ed20dae, 0x7ed20dae, 0xdd28f52b, 0xee7b6515, 0xee7b6515, 0xdd28f52b, }, 20 }, + { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x2bc82eb1, 0x94064cc8, 0x2bc82eb1, 0xd4773531, 0x43d1f34, 0x43d1f34, 0x44cbf2f0, 0x44cbf2f0, 0x44cbf2f0, 0x3bc15b58, 0x3bc15b58, 0x3bc15b58, 0xa2905ede, 0xa2905ede, 0xa2905ede, 0x43d1f34, 0xd4773531, 0xd4773531, 0x43d1f34, }, 20 }, + { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0x7f6dd146, 0x548af474, 0x7f6dd146, 0x3c9b1c01, 0x59c36f00, 0x59c36f00, 0x7d913e8d, 0x7d913e8d, 0x7d913e8d, 0x31153eb, 0x31153eb, 0x31153eb, 0x61e74639, 0x61e74639, 0x61e74639, 0x59c36f00, 0x3c9b1c01, 0x3c9b1c01, 0x59c36f00, }, 20 }, + { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0xf29ad079, 0x50d47c0, 0xf29ad079, 0xdc9f5506, 0xaa4593fe, 0xaa4593fe, 0x6bcf4c90, 0x6bcf4c90, 0x6bcf4c90, 0xcd3a41f7, 0xcd3a41f7, 0xcd3a41f7, 0xe002ea8f, 0xe002ea8f, 0xe002ea8f, 0xaa4593fe, 0xdc9f5506, 0xdc9f5506, 0xaa4593fe, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xb25e3082, 0x2ed845dd, 0xb25e3082, 0xef495d06, 0xc9cbf769, 0xc9cbf769, 0xd5322575, 0xd5322575, 0xd5322575, 0x2beae4b9, 0x2beae4b9, 0x2beae4b9, 0xc2a05bb1, 0xc2a05bb1, 0xc2a05bb1, 0xc9cbf769, 0xef495d06, 0xef495d06, 0xc9cbf769, }, 20 }, + { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x4cdfcd2e, 0x8bf091f, 0x4cdfcd2e, 0xe28984f6, 0x9813a416, 0x9813a416, 0x8217f630, 0x8217f630, 0x8217f630, 0x13cc7003, 0x13cc7003, 0x13cc7003, 0xa764dd3, 0xa764dd3, 0xa764dd3, 0x9813a416, 0xe28984f6, 0xe28984f6, 0x9813a416, }, 20 }, + { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0xf2b49f88, 0x2eff252d, 0xf2b49f88, 0x8412aa3b, 0x5fcf013d, 0x5fcf013d, 0x5d3b9fe7, 0x5d3b9fe7, 0x5d3b9fe7, 0x8f2b8791, 0x8f2b8791, 0x8f2b8791, 0x9958b80e, 0x9958b80e, 0x9958b80e, 0x5fcf013d, 0x8412aa3b, 0x8412aa3b, 0x5fcf013d, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0x786673be, 0x536f1359, 0x786673be, 0x6363a9b9, 0xdd28f52b, 0xdd28f52b, 0x38653b12, 0x38653b12, 0x38653b12, 0x1959c2f6, 0x1959c2f6, 0x1959c2f6, 0x64e1097a, 0x64e1097a, 0x64e1097a, 0xdd28f52b, 0x6363a9b9, 0x6363a9b9, 0xdd28f52b, }, 20 }, + { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0xac4a1127, 0x699c2ad8, 0xac4a1127, 0x53f50aa7, 0x43d1f34, 0x43d1f34, 0xfa47dfba, 0xfa47dfba, 0xfa47dfba, 0x854d7612, 0x854d7612, 0x854d7612, 0x1c1c7394, 0x1c1c7394, 0x1c1c7394, 0x43d1f34, 0x53f50aa7, 0x53f50aa7, 0x43d1f34, }, 20 }, + { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xbc5f6633, 0xda908ab0, 0xbc5f6633, 0xffa9ab74, 0x59c36f00, 0x59c36f00, 0x3ad73295, 0x3ad73295, 0x3ad73295, 0x44575ff3, 0x44575ff3, 0x44575ff3, 0x26a14a21, 0x26a14a21, 0x26a14a21, 0x59c36f00, 0xffa9ab74, 0xffa9ab74, 0x59c36f00, }, 20 }, + { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0xad820d6b, 0x9a88ad3, 0xad820d6b, 0x83878814, 0xaa4593fe, 0xaa4593fe, 0xbec19c1b, 0xbec19c1b, 0xbec19c1b, 0x1834917c, 0x1834917c, 0x1834917c, 0x350c3a04, 0x350c3a04, 0x350c3a04, 0xaa4593fe, 0x83878814, 0x83878814, 0xaa4593fe, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xe5774112, 0x5ffb1eca, 0xe5774112, 0xb8602c96, 0xc9cbf769, 0xc9cbf769, 0xe4861949, 0xe4861949, 0xe4861949, 0x1a5ed885, 0x1a5ed885, 0x1a5ed885, 0xf314678d, 0xf314678d, 0xf314678d, 0xc9cbf769, 0xb8602c96, 0xb8602c96, 0xc9cbf769, }, 20 }, + { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x6af1a2bc, 0xd951ab8b, 0x6af1a2bc, 0xc4a7eb64, 0x9813a416, 0x9813a416, 0xb5e8801c, 0xb5e8801c, 0xb5e8801c, 0x2433062f, 0x2433062f, 0x2433062f, 0x3d893bff, 0x3d893bff, 0x3d893bff, 0x9813a416, 0xc4a7eb64, 0xc4a7eb64, 0x9813a416, }, 20 }, + { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0xc6baa18, 0x1c9db179, 0xc6baa18, 0x7acd9fab, 0x5fcf013d, 0x5fcf013d, 0x819b5c4e, 0x819b5c4e, 0x819b5c4e, 0x538b4438, 0x538b4438, 0x538b4438, 0x45f87ba7, 0x45f87ba7, 0x45f87ba7, 0x5fcf013d, 0x7acd9fab, 0x7acd9fab, 0x5fcf013d, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0xe424a6ab, 0xb05c0275, 0xe424a6ab, 0xff217cac, 0xdd28f52b, 0xdd28f52b, 0xcd83646c, 0xcd83646c, 0xcd83646c, 0xecbf9d88, 0xecbf9d88, 0xecbf9d88, 0x91075604, 0x91075604, 0x91075604, 0xdd28f52b, 0xff217cac, 0xff217cac, 0xdd28f52b, }, 20 }, + { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x4a7dff41, 0xe1ec28fc, 0x4a7dff41, 0xb5c2e4c1, 0x43d1f34, 0x43d1f34, 0xb200c08a, 0xb200c08a, 0xb200c08a, 0xcd0a6922, 0xcd0a6922, 0xcd0a6922, 0x545b6ca4, 0x545b6ca4, 0x545b6ca4, 0x43d1f34, 0xb5c2e4c1, 0xb5c2e4c1, 0x43d1f34, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xd3d3e4a2, 0x9c635046, 0xd3d3e4a2, 0x902529e5, 0x59c36f00, 0x59c36f00, 0x85e713, 0x85e713, 0x85e713, 0x7e058a75, 0x7e058a75, 0x7e058a75, 0x1cf39fa7, 0x1cf39fa7, 0x1cf39fa7, 0x59c36f00, 0x902529e5, 0x902529e5, 0x59c36f00, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0xd61c80f5, 0xdf78b496, 0xd61c80f5, 0xf819058a, 0xaa4593fe, 0xaa4593fe, 0xefc0f7e7, 0xefc0f7e7, 0xefc0f7e7, 0x4935fa80, 0x4935fa80, 0x4935fa80, 0x640d51f8, 0x640d51f8, 0x640d51f8, 0xaa4593fe, 0xf819058a, 0xf819058a, 0xaa4593fe, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x936bc89d, 0x523a3e80, 0x936bc89d, 0xce7ca519, 0xc9cbf769, 0xc9cbf769, 0xaa99ffb1, 0xaa99ffb1, 0xaa99ffb1, 0x54413e7d, 0x54413e7d, 0x54413e7d, 0xbd0b8175, 0xbd0b8175, 0xbd0b8175, 0xc9cbf769, 0xce7ca519, 0xce7ca519, 0xc9cbf769, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x4fdd0291, 0x133fa83d, 0x4fdd0291, 0xe18b4b49, 0x9813a416, 0x9813a416, 0x74c38e90, 0x74c38e90, 0x74c38e90, 0xe51808a3, 0xe51808a3, 0xe51808a3, 0xfca23573, 0xfca23573, 0xfca23573, 0x9813a416, 0xe18b4b49, 0xe18b4b49, 0x9813a416, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x538203b0, 0x2a92e789, 0x538203b0, 0x25243603, 0x5fcf013d, 0x5fcf013d, 0x5e4d3dd8, 0x5e4d3dd8, 0x5e4d3dd8, 0x8c5d25ae, 0x8c5d25ae, 0x8c5d25ae, 0x9a2e1a31, 0x9a2e1a31, 0x9a2e1a31, 0x5fcf013d, 0x25243603, 0x25243603, 0x5fcf013d, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0xcfc85125, 0xa5b0e11b, 0xcfc85125, 0xd4cd8b22, 0xdd28f52b, 0xdd28f52b, 0x1af8cddc, 0x1af8cddc, 0x1af8cddc, 0x3bc43438, 0x3bc43438, 0x3bc43438, 0x467cffb4, 0x467cffb4, 0x467cffb4, 0xdd28f52b, 0xd4cd8b22, 0xd4cd8b22, 0xdd28f52b, }, 20 }, + { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0xf2469ffb, 0x1d0c1d2, 0xf2469ffb, 0xdf9847b, 0x43d1f34, 0x43d1f34, 0xa2837c7a, 0xa2837c7a, 0xa2837c7a, 0xdd89d5d2, 0xdd89d5d2, 0xdd89d5d2, 0x44d8d054, 0x44d8d054, 0x44d8d054, 0x43d1f34, 0xdf9847b, 0xdf9847b, 0x43d1f34, }, 20 }, + { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0x27851cc1, 0x15f731b5, 0x27851cc1, 0x6473d186, 0x59c36f00, 0x59c36f00, 0x125bcddf, 0x125bcddf, 0x125bcddf, 0x6cdba0b9, 0x6cdba0b9, 0x6cdba0b9, 0xe2db56b, 0xe2db56b, 0xe2db56b, 0x59c36f00, 0x6473d186, 0x6473d186, 0x59c36f00, }, 20 }, + { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0xfcb223c, 0x2c2e18b9, 0xfcb223c, 0x21cea743, 0xaa4593fe, 0xaa4593fe, 0xd700be1a, 0xd700be1a, 0xd700be1a, 0x71f5b37d, 0x71f5b37d, 0x71f5b37d, 0x5ccd1805, 0x5ccd1805, 0x5ccd1805, 0xaa4593fe, 0x21cea743, 0x21cea743, 0xaa4593fe, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x807efaa5, 0xb673036a, 0x807efaa5, 0xdd699721, 0xc9cbf769, 0xc9cbf769, 0xdca3ed4b, 0xdca3ed4b, 0xdca3ed4b, 0x227b2c87, 0x227b2c87, 0x227b2c87, 0xcb31938f, 0xcb31938f, 0xcb31938f, 0xc9cbf769, 0xdd699721, 0xdd699721, 0xc9cbf769, }, 20 }, + { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x651d0d50, 0xf0dc38fc, 0x651d0d50, 0xcb4b4488, 0x9813a416, 0x9813a416, 0x80d03ee8, 0x80d03ee8, 0x80d03ee8, 0x110bb8db, 0x110bb8db, 0x110bb8db, 0x8b1850b, 0x8b1850b, 0x8b1850b, 0x9813a416, 0xcb4b4488, 0xcb4b4488, 0x9813a416, }, 20 }, + { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0xb9b068f, 0xdc68ac3c, 0xb9b068f, 0x7d3d333c, 0x5fcf013d, 0x5fcf013d, 0xa1f0a6e4, 0xa1f0a6e4, 0xa1f0a6e4, 0x73e0be92, 0x73e0be92, 0x73e0be92, 0x6593810d, 0x6593810d, 0x6593810d, 0x5fcf013d, 0x7d3d333c, 0x7d3d333c, 0x5fcf013d, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0xf0789d7e, 0x6f2f2b61, 0xf0789d7e, 0xeb7d4779, 0xdd28f52b, 0xdd28f52b, 0xb995630, 0xb995630, 0xb995630, 0x2aa5afd4, 0x2aa5afd4, 0x2aa5afd4, 0x571d6458, 0x571d6458, 0x571d6458, 0xdd28f52b, 0xeb7d4779, 0xeb7d4779, 0xdd28f52b, }, 20 }, + { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x819821ff, 0xdd19128c, 0x819821ff, 0x7e273a7f, 0x43d1f34, 0x43d1f34, 0xf35981d3, 0xf35981d3, 0xf35981d3, 0x8c53287b, 0x8c53287b, 0x8c53287b, 0x15022dfd, 0x15022dfd, 0x15022dfd, 0x43d1f34, 0x7e273a7f, 0x7e273a7f, 0x43d1f34, }, 20 }, + { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0xa99604d1, 0xcf59e852, 0xa99604d1, 0xfebbba0f, 0x59c36f00, 0x59c36f00, 0x53767ce3, 0x53767ce3, 0x53767ce3, 0x2df61185, 0x2df61185, 0x2df61185, 0x4f000457, 0x4f000457, 0x4f000457, 0x59c36f00, 0xfebbba0f, 0xfebbba0f, 0x59c36f00, }, 20 }, + { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x7d0a218, 0xa3fa25a0, 0x7d0a218, 0xb777784e, 0xaa4593fe, 0xaa4593fe, 0x35db26e1, 0x35db26e1, 0x35db26e1, 0x932e2b86, 0x932e2b86, 0x932e2b86, 0xbe1680fe, 0xbe1680fe, 0xbe1680fe, 0xaa4593fe, 0xb777784e, 0xb777784e, 0xaa4593fe, }, 20 }, + { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0x63be90f4, 0xd932cf2c, 0x63be90f4, 0x739b8e5a, 0xc9cbf769, 0xc9cbf769, 0x70a00efe, 0x70a00efe, 0x70a00efe, 0x8e78cf32, 0x8e78cf32, 0x8e78cf32, 0x6732703a, 0x6732703a, 0x6732703a, 0xc9cbf769, 0x739b8e5a, 0x739b8e5a, 0xc9cbf769, }, 20 }, + { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x53460c90, 0xe0e605a7, 0x53460c90, 0x6337f0bf, 0x9813a416, 0x9813a416, 0x4161864c, 0x4161864c, 0x4161864c, 0xd0ba007f, 0xd0ba007f, 0xd0ba007f, 0xc9003daf, 0xc9003daf, 0xc9003daf, 0x9813a416, 0x6337f0bf, 0x6337f0bf, 0x9813a416, }, 20 }, + { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0xf54761a0, 0xe5b17ac1, 0xf54761a0, 0x5b408e55, 0x5fcf013d, 0x5fcf013d, 0x580fda0e, 0x580fda0e, 0x580fda0e, 0x8a1fc278, 0x8a1fc278, 0x8a1fc278, 0x9c6cfde7, 0x9c6cfde7, 0x9c6cfde7, 0x5fcf013d, 0x5b408e55, 0x5b408e55, 0x5fcf013d, }, 20 }, + { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0xec78b0c1, 0xb800141f, 0xec78b0c1, 0x621c7b1b, 0xdd28f52b, 0xdd28f52b, 0x8f60179, 0x8f60179, 0x8f60179, 0x29caf89d, 0x29caf89d, 0x29caf89d, 0x54723311, 0x54723311, 0x54723311, 0xdd28f52b, 0x621c7b1b, 0x621c7b1b, 0xdd28f52b, }, 20 }, + { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0xf209411b, 0x599896a6, 0xf209411b, 0x6551c7bb, 0x43d1f34, 0x43d1f34, 0x5ac6bb4a, 0x5ac6bb4a, 0x5ac6bb4a, 0x25cc12e2, 0x25cc12e2, 0x25cc12e2, 0xbc9d1764, 0xbc9d1764, 0xbc9d1764, 0x43d1f34, 0x6551c7bb, 0x6551c7bb, 0x43d1f34, }, 20 }, + { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x59c36f00, 0x93b4fcd8, 0xf57b105b, 0x93b4fcd8, 0x2bfe5312, 0x59c36f00, 0x59c36f00, 0x3ad73295, 0x3ad73295, 0x3ad73295, 0x44575ff3, 0x44575ff3, 0x44575ff3, 0x26a14a21, 0x26a14a21, 0x26a14a21, 0x59c36f00, 0x2bfe5312, 0x2bfe5312, 0x59c36f00, }, 20 }, + { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0xaa4593fe, 0x656c9044, 0xc14617fc, 0x656c9044, 0xa6ea58cb, 0xaa4593fe, 0xaa4593fe, 0xbec19c1b, 0xbec19c1b, 0xbec19c1b, 0x1834917c, 0x1834917c, 0x1834917c, 0x350c3a04, 0x350c3a04, 0x350c3a04, 0xaa4593fe, 0xa6ea58cb, 0xa6ea58cb, 0xaa4593fe, }, 20 }, + { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xc9cbf769, 0xa11479ed, 0x1b982635, 0xa11479ed, 0xe37185d0, 0xc9cbf769, 0xc9cbf769, 0xe4861949, 0xe4861949, 0xe4861949, 0x1a5ed885, 0x1a5ed885, 0x1a5ed885, 0xf314678d, 0xf314678d, 0xf314678d, 0xc9cbf769, 0xe37185d0, 0xe37185d0, 0xc9cbf769, }, 20 }, + { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x9813a416, 0x244770a7, 0x97e77990, 0x244770a7, 0x6a54d2ee, 0x9813a416, 0x9813a416, 0xb5e8801c, 0xb5e8801c, 0xb5e8801c, 0x2433062f, 0x2433062f, 0x2433062f, 0x3d893bff, 0x3d893bff, 0x3d893bff, 0x9813a416, 0x6a54d2ee, 0x6a54d2ee, 0x9813a416, }, 20 }, + { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x5fcf013d, 0x8ca34476, 0x9c555f17, 0x8ca34476, 0x1fc54b41, 0x5fcf013d, 0x5fcf013d, 0x819b5c4e, 0x819b5c4e, 0x819b5c4e, 0x538b4438, 0x538b4438, 0x538b4438, 0x45f87ba7, 0x45f87ba7, 0x45f87ba7, 0x5fcf013d, 0x1fc54b41, 0x1fc54b41, 0x5fcf013d, }, 20 }, + { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xdd28f52b, 0xf19f6af8, 0xa5e7ce26, 0xf19f6af8, 0x1619aea6, 0xdd28f52b, 0xdd28f52b, 0xcd83646c, 0xcd83646c, 0xcd83646c, 0xecbf9d88, 0xecbf9d88, 0xecbf9d88, 0x91075604, 0x91075604, 0x91075604, 0xdd28f52b, 0x1619aea6, 0x1619aea6, 0xdd28f52b, }, 20 }, + { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x43d1f34, 0x5f75414f, 0xf4e496f2, 0x5f75414f, 0x27fd1fe0, 0x43d1f34, 0x43d1f34, 0xb200c08a, 0xb200c08a, 0xb200c08a, 0xcd0a6922, 0xcd0a6922, 0xcd0a6922, 0x545b6ca4, 0x545b6ca4, 0x545b6ca4, 0x43d1f34, 0x27fd1fe0, 0x27fd1fe0, 0x43d1f34, }, 20 }, + { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (VasEBoot_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 }, + { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (VasEBoot_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 }, + { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (VasEBoot_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (VasEBoot_uint32_t []) { 0x4c2cef83, 0x1b215a88, 0xe2378595, 0xb53a309e, 0x15f64d5e, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (VasEBoot_uint32_t []) { 0x758f388c, 0xd4442397, 0x33f5784b, 0x923e6350, 0xf97bb902, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (VasEBoot_uint32_t []) { 0xb9f6f52a, 0x4e24e8b7, 0x53beb8e1, 0xa46ca57c, 0x688a184d, }, 5 }, + { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (VasEBoot_uint32_t []) { 0x5bd98ce3, 0x15df7962, 0xc7d467e1, 0x89d29260, 0x662e2c16, }, 5 }, + { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (VasEBoot_uint32_t []) { 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, }, 5 }, + { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (VasEBoot_uint32_t []) { 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, }, 5 }, + { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (VasEBoot_uint32_t []) { 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (VasEBoot_uint32_t []) { 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (VasEBoot_uint32_t []) { 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (VasEBoot_uint32_t []) { 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (VasEBoot_uint32_t []) { 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (VasEBoot_uint32_t []) { 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (VasEBoot_uint32_t []) { 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (VasEBoot_uint32_t []) { 0x335fadcb, 0x1f517b5c, 0x6b4200e5, 0x474cd672, 0x8364f797, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (VasEBoot_uint32_t []) { 0xcf9985f8, 0x1d92c7fc, 0x6e637701, 0xbc683505, 0x898016fb, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (VasEBoot_uint32_t []) { 0xdb824190, 0x378d05dc, 0x670bff9, 0xea7ffbb5, 0x658bcbb3, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (VasEBoot_uint32_t []) { 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (VasEBoot_uint32_t []) { 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (VasEBoot_uint32_t []) { 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (VasEBoot_uint32_t []) { 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (VasEBoot_uint32_t []) { 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (VasEBoot_uint32_t []) { 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (VasEBoot_uint32_t []) { 0x157232bd, 0x5e6bdacd, 0x8341e25d, 0xc8580a2d, 0x3cf9e58c, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (VasEBoot_uint32_t []) { 0xbfafd7cd, 0x51650951, 0x67d61c04, 0x891cc298, 0xab036ae, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (VasEBoot_uint32_t []) { 0x760580c9, 0xdc6d8205, 0x2739f3a0, 0x8d51f16c, 0xd47d661b, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (VasEBoot_uint32_t []) { 0xada3b5f, 0x24cd61a6, 0x56f48ead, 0x78e3d454, 0xb28750bb, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (VasEBoot_uint32_t []) { 0x827694e2, 0x9d97c3dd, 0xbdb43a9c, 0xa2556da3, 0xfdf3c81e, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (VasEBoot_uint32_t []) { 0x664534a5, 0xcd0979a0, 0x3531d85e, 0x9e7d955b, 0xc0aced53, }, 5 }, diff --git a/VasEBoot-core/tests/cmdline_cat_test.c b/VasEBoot-core/tests/cmdline_cat_test.c index f1e21439e..27e3ec656 100644 --- a/VasEBoot-core/tests/cmdline_cat_test.c +++ b/VasEBoot-core/tests/cmdline_cat_test.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -/* All tests need to include test.h for GRUB testing framework. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* All tests need to include test.h for VasEBoot testing framework. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static const char testfile[] = @@ -54,13 +54,13 @@ static const char testfile[] = ; static char * -get_test_txt (grub_size_t *sz) +get_test_txt (VasEBoot_size_t *sz) { - *sz = grub_strlen (testfile); - return grub_strdup (testfile); + *sz = VasEBoot_strlen (testfile); + return VasEBoot_strdup (testfile); } -struct grub_procfs_entry test_txt = +struct VasEBoot_procfs_entry test_txt = { .name = "test.txt", .get_contents = get_test_txt @@ -73,53 +73,53 @@ static void cmdline_cat_test (void) { unsigned i; - grub_font_t font; + VasEBoot_font_t font; - grub_dl_load ("gfxterm"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_dl_load ("gfxterm"); + VasEBoot_errno = VasEBoot_ERR_NONE; - font = grub_font_get (FONT_NAME); - if (font && grub_strcmp (font->name, FONT_NAME) != 0) + font = VasEBoot_font_get (FONT_NAME); + if (font && VasEBoot_strcmp (font->name, FONT_NAME) != 0) font = 0; if (!font) - font = grub_font_load ("unicode"); + font = VasEBoot_font_load ("unicode"); if (!font) { - grub_test_assert (0, "unicode font not found: %s", grub_errmsg); + VasEBoot_test_assert (0, "unicode font not found: %s", VasEBoot_errmsg); return; } - grub_procfs_register ("test.txt", &test_txt); + VasEBoot_procfs_register ("test.txt", &test_txt); - for (i = 0; i < GRUB_TEST_VIDEO_SMALL_N_MODES; i++) + for (i = 0; i < VasEBoot_TEST_VIDEO_SMALL_N_MODES; i++) { - grub_video_capture_start (&grub_test_video_modes[i], - grub_video_fbstd_colors, - grub_test_video_modes[i].number_of_colors); - grub_terminal_input_fake_sequence ((int []) + VasEBoot_video_capture_start (&VasEBoot_test_video_modes[i], + VasEBoot_video_fbstd_colors, + VasEBoot_test_video_modes[i].number_of_colors); + VasEBoot_terminal_input_fake_sequence ((int []) { 'c', 'a', 't', ' ', '(', 'p', 'r', 'o', 'c', ')', '/', 't', 'e', 's', 't', '.', 't', 'x', 't', '\n', - GRUB_TERM_NO_KEY, - GRUB_TERM_NO_KEY, '\e'}, + VasEBoot_TERM_NO_KEY, + VasEBoot_TERM_NO_KEY, '\e'}, 23); - grub_video_checksum ("cmdline_cat"); + VasEBoot_video_checksum ("cmdline_cat"); - if (!grub_test_use_gfxterm ()) - grub_cmdline_run (1, 0); + if (!VasEBoot_test_use_gfxterm ()) + VasEBoot_cmdline_run (1, 0); - grub_test_use_gfxterm_end (); + VasEBoot_test_use_gfxterm_end (); - grub_terminal_input_fake_sequence_end (); - grub_video_checksum_end (); - grub_video_capture_end (); + VasEBoot_terminal_input_fake_sequence_end (); + VasEBoot_video_checksum_end (); + VasEBoot_video_capture_end (); } - grub_procfs_unregister (&test_txt); + VasEBoot_procfs_unregister (&test_txt); } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (cmdline_cat_test, cmdline_cat_test); +VasEBoot_FUNCTIONAL_TEST (cmdline_cat_test, cmdline_cat_test); diff --git a/VasEBoot-core/tests/cmp_test.c b/VasEBoot-core/tests/cmp_test.c index af5b39576..73c5ccbae 100644 --- a/VasEBoot-core/tests/cmp_test.c +++ b/VasEBoot-core/tests/cmp_test.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t vectors[][2] = { +static VasEBoot_uint64_t vectors[][2] = { { 0xffffffffffffffffULL, 1}, { 1, 0xffffffffffffffffULL}, { 0xffffffffffffffffULL, 0xffffffffffffffffULL}, @@ -34,20 +34,20 @@ static grub_uint64_t vectors[][2] = { functions and we're not testing them now. */ static int -leading_bit64 (grub_uint64_t a) +leading_bit64 (VasEBoot_uint64_t a) { return !!(a & 0x8000000000000000LL); } static int -leading_bit32 (grub_uint32_t a) +leading_bit32 (VasEBoot_uint32_t a) { return !!(a & 0x80000000); } /* Computes (a < b) without involving comparison operator. */ static int -is_less32 (grub_uint32_t a, grub_uint32_t b) +is_less32 (VasEBoot_uint32_t a, VasEBoot_uint32_t b) { if (leading_bit32(a) && !leading_bit32(b)) return 0; @@ -57,23 +57,23 @@ is_less32 (grub_uint32_t a, grub_uint32_t b) } static void -test32 (grub_uint32_t a, grub_uint32_t b) +test32 (VasEBoot_uint32_t a, VasEBoot_uint32_t b) { - grub_test_assert ((a < b) == is_less32(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a < b) == is_less32(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((a > b) == is_less32(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a > b) == is_less32(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b < a) == is_less32(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b < a) == is_less32(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b > a) == is_less32(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b > a) == is_less32(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert (!(is_less32(a, b) && is_less32(b, a)), "comparison inconsistent: %lld, %lld", + VasEBoot_test_assert (!(is_less32(a, b) && is_less32(b, a)), "comparison inconsistent: %lld, %lld", (long long) a, (long long) b); } /* Computes (a > b) without involving comparison operator. */ static int -is_less32s (grub_int32_t a, grub_int32_t b) +is_less32s (VasEBoot_int32_t a, VasEBoot_int32_t b) { if (leading_bit32(a) && !leading_bit32(b)) return 1; /* a < 0 && b >= 0. */ @@ -83,23 +83,23 @@ is_less32s (grub_int32_t a, grub_int32_t b) } static void -test32s (grub_int32_t a, grub_int32_t b) +test32s (VasEBoot_int32_t a, VasEBoot_int32_t b) { - grub_test_assert ((a < b) == is_less32s(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a < b) == is_less32s(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((a > b) == is_less32s(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a > b) == is_less32s(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b < a) == is_less32s(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b < a) == is_less32s(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b > a) == is_less32s(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b > a) == is_less32s(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert (!(is_less32s(a, b) && is_less32s(b, a)), "comparison inconsistent: %lld, %lld", + VasEBoot_test_assert (!(is_less32s(a, b) && is_less32s(b, a)), "comparison inconsistent: %lld, %lld", (long long) a, (long long) b); } /* Computes (a > b) without involving comparison operator. */ static int -is_less64 (grub_uint64_t a, grub_uint64_t b) +is_less64 (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { if (leading_bit64(a) && !leading_bit64(b)) return 0; @@ -109,23 +109,23 @@ is_less64 (grub_uint64_t a, grub_uint64_t b) } static void -test64 (grub_uint64_t a, grub_uint64_t b) +test64 (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { - grub_test_assert ((a < b) == is_less64(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a < b) == is_less64(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((a > b) == is_less64(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a > b) == is_less64(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b < a) == is_less64(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b < a) == is_less64(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b > a) == is_less64(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b > a) == is_less64(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert (!(is_less64(a, b) && is_less64(b, a)), "comparison inconsistent: %lld, %lld", + VasEBoot_test_assert (!(is_less64(a, b) && is_less64(b, a)), "comparison inconsistent: %lld, %lld", (long long) a, (long long) b); } /* Computes (a > b) without involving comparison operator. */ static int -is_less64s (grub_int64_t a, grub_int64_t b) +is_less64s (VasEBoot_int64_t a, VasEBoot_int64_t b) { if (leading_bit64(a) && !leading_bit64(b)) return 1; /* a < 0 && b >= 0. */ @@ -135,22 +135,22 @@ is_less64s (grub_int64_t a, grub_int64_t b) } static void -test64s (grub_int64_t a, grub_int64_t b) +test64s (VasEBoot_int64_t a, VasEBoot_int64_t b) { - grub_test_assert ((a < b) == is_less64s(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a < b) == is_less64s(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((a > b) == is_less64s(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((a > b) == is_less64s(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b < a) == is_less64s(b, a), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b < a) == is_less64s(b, a), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert ((b > a) == is_less64s(a, b), "comparison result mismatch: %lld, %lld", + VasEBoot_test_assert ((b > a) == is_less64s(a, b), "comparison result mismatch: %lld, %lld", (long long) a, (long long) b); - grub_test_assert (!(is_less64s(a, b) && is_less64s(b, a)), "comparison inconsistent: %lld, %lld", + VasEBoot_test_assert (!(is_less64s(a, b) && is_less64s(b, a)), "comparison inconsistent: %lld, %lld", (long long) a, (long long) b); } static void -test_all(grub_uint64_t a, grub_uint64_t b) +test_all(VasEBoot_uint64_t a, VasEBoot_uint64_t b) { test64 (a, b); test32 (a, b); @@ -167,8 +167,8 @@ test_all(grub_uint64_t a, grub_uint64_t b) static void cmp_test (void) { - grub_uint64_t a = 404, b = 7; - grub_size_t i; + VasEBoot_uint64_t a = 404, b = 7; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { @@ -187,4 +187,4 @@ cmp_test (void) } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (cmp_test, cmp_test); +VasEBoot_FUNCTIONAL_TEST (cmp_test, cmp_test); diff --git a/VasEBoot-core/tests/ctz_test.c b/VasEBoot-core/tests/ctz_test.c index eb7a1df38..d6cf76990 100644 --- a/VasEBoot-core/tests/ctz_test.c +++ b/VasEBoot-core/tests/ctz_test.c @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* ull version is not used on i386 other than in this test. Avoid requiring extra function. @@ -29,7 +29,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define SKIP_ULL 1 #endif -static grub_uint64_t vectors[] = { +static VasEBoot_uint64_t vectors[] = { 0xffffffffffffffffULL, 1, 2, 0, 0x0102030405060708ULL }; @@ -40,7 +40,7 @@ test_ui (unsigned int a) a |= 1; for (i = 0; i < (int) (8 * sizeof (a)); i++) { - grub_test_assert (__builtin_ctz(a << i) == i, + VasEBoot_test_assert (__builtin_ctz(a << i) == i, "ctz mismatch: ctz(0x%llx) != 0x%x", (long long) (a << i), __builtin_ctz(a << i)); } @@ -53,7 +53,7 @@ test_ul (unsigned long a) a |= 1; for (i = 0; i < (int) (8 * sizeof (a)); i++) { - grub_test_assert (__builtin_ctzl(a << i) == i, + VasEBoot_test_assert (__builtin_ctzl(a << i) == i, "ctzl mismatch: ctzl(0x%llx) != 0x%x", (long long) (a << i), __builtin_ctz(a << i)); } @@ -67,7 +67,7 @@ test_ull (unsigned long long a) a |= 1; for (i = 0; i < (int) (8 * sizeof (a)); i++) { - grub_test_assert (__builtin_ctzll(a << i) == i, + VasEBoot_test_assert (__builtin_ctzll(a << i) == i, "ctzll mismatch: ctzll(0x%llx) != 0x%x", (long long) (a << i), __builtin_ctz(a << i)); } @@ -75,7 +75,7 @@ test_ull (unsigned long long a) #endif static void -test_all(grub_uint64_t a) +test_all(VasEBoot_uint64_t a) { test_ui (a); test_ul (a); @@ -87,8 +87,8 @@ test_all(grub_uint64_t a) static void ctz_test (void) { - grub_uint64_t a = 404, b = 7; - grub_size_t i; + VasEBoot_uint64_t a = 404, b = 7; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { @@ -108,4 +108,4 @@ ctz_test (void) } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (ctz_test, ctz_test); +VasEBoot_FUNCTIONAL_TEST (ctz_test, ctz_test); diff --git a/VasEBoot-core/tests/div_test.c b/VasEBoot-core/tests/div_test.c index 9abc6d5c4..ca02d3e3a 100644 --- a/VasEBoot-core/tests/div_test.c +++ b/VasEBoot-core/tests/div_test.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t vectors[][2] = { +static VasEBoot_uint64_t vectors[][2] = { { 0xffffffffffffffffULL, 1}, { 1, 0xffffffffffffffffULL}, { 0xffffffffffffffffULL, 0xffffffffffffffffULL}, @@ -31,125 +31,125 @@ static grub_uint64_t vectors[][2] = { }; static void -test32 (grub_uint32_t a, grub_uint32_t b) +test32 (VasEBoot_uint32_t a, VasEBoot_uint32_t b) { - grub_uint64_t q, r; + VasEBoot_uint64_t q, r; if (b == 0) return; - q = grub_divmod64 (a, b, &r); - grub_test_assert (r < b, "remainder is larger than dividend: 0x%llx %% 0x%llx = 0x%llx", + q = VasEBoot_divmod64 (a, b, &r); + VasEBoot_test_assert (r < b, "remainder is larger than dividend: 0x%llx %% 0x%llx = 0x%llx", (long long) a, (long long) b, (long long) r); - grub_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, + VasEBoot_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, (long long) a); /* Overflow check. */ - grub_test_assert ((q >> 32) == 0, + VasEBoot_test_assert ((q >> 32) == 0, "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); - grub_test_assert ((r >> 32) == 0, + VasEBoot_test_assert ((r >> 32) == 0, "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); /* q * b + r is at most: 0xffffffff * 0xffffffff + 0xffffffff = 0xffffffff00000000 so no overflow */ - grub_test_assert (q == (a / b), + VasEBoot_test_assert (q == (a / b), "C compiler division failure in 0x%llx, 0x%llx", (long long) a, (long long) b); - grub_test_assert (r == (a % b), + VasEBoot_test_assert (r == (a % b), "C compiler modulo failure in 0x%llx, 0x%llx", (long long) a, (long long) b); } static void -test64 (grub_uint64_t a, grub_uint64_t b) +test64 (VasEBoot_uint64_t a, VasEBoot_uint64_t b) { - grub_uint64_t q, r; - grub_uint64_t x1, x2; - q = grub_divmod64 (a, b, &r); - grub_test_assert (r < b, "remainder is larger than dividend: 0x%llx %% 0x%llx = 0x%llx", + VasEBoot_uint64_t q, r; + VasEBoot_uint64_t x1, x2; + q = VasEBoot_divmod64 (a, b, &r); + VasEBoot_test_assert (r < b, "remainder is larger than dividend: 0x%llx %% 0x%llx = 0x%llx", (long long) a, (long long) b, (long long) r); - grub_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, + VasEBoot_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, (long long) a); /* Overflow checks. */ - grub_test_assert ((q >> 32) * (b >> 32) == 0, + VasEBoot_test_assert ((q >> 32) * (b >> 32) == 0, "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); x1 = (q >> 32) * (b & 0xffffffff); - grub_test_assert (x1 < (1LL << 32), + VasEBoot_test_assert (x1 < (1LL << 32), "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); x1 <<= 32; x2 = (b >> 32) * (q & 0xffffffff); - grub_test_assert (x2 < (1LL << 32), + VasEBoot_test_assert (x2 < (1LL << 32), "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); x2 <<= 32; - grub_test_assert (x1 <= ~x2, + VasEBoot_test_assert (x1 <= ~x2, "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); x1 += x2; x2 = (q & 0xffffffff) * (b & 0xffffffff); - grub_test_assert (x1 <= ~x2, + VasEBoot_test_assert (x1 <= ~x2, "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); x1 += x2; - grub_test_assert (x1 <= ~r, + VasEBoot_test_assert (x1 <= ~r, "division overflow in 0x%llx, 0x%llx", (long long) a, (long long) b); x1 += r; - grub_test_assert (a == x1, + VasEBoot_test_assert (a == x1, "division overflow test failure in 0x%llx, 0x%llx", (long long) a, (long long) b); -#if GRUB_TARGET_SIZEOF_VOID_P == 8 - grub_test_assert (q == (a / b), +#if VasEBoot_TARGET_SIZEOF_VOID_P == 8 + VasEBoot_test_assert (q == (a / b), "C compiler division failure in 0x%llx, 0x%llx", (long long) a, (long long) b); - grub_test_assert (r == (a % b), + VasEBoot_test_assert (r == (a % b), "C compiler modulo failure in 0x%llx, 0x%llx", (long long) a, (long long) b); #endif } -static grub_int64_t -abs64(grub_int64_t a) +static VasEBoot_int64_t +abs64(VasEBoot_int64_t a) { return a > 0 ? a : -a; } static void -test32s (grub_int32_t a, grub_int32_t b) +test32s (VasEBoot_int32_t a, VasEBoot_int32_t b) { - grub_int64_t q, r; + VasEBoot_int64_t q, r; if (b == 0) return; - q = grub_divmod64s (a, b, &r); - grub_test_assert (a > 0 ? r >= 0 : r <= 0, "remainder sign mismatch: %lld %% %lld = %lld", + q = VasEBoot_divmod64s (a, b, &r); + VasEBoot_test_assert (a > 0 ? r >= 0 : r <= 0, "remainder sign mismatch: %lld %% %lld = %lld", (long long) a, (long long) b, (long long) r); - grub_test_assert (((a > 0) == (b > 0)) ? q >= 0 : q <= 0, "quotient sign mismatch: %lld / %lld = %lld", + VasEBoot_test_assert (((a > 0) == (b > 0)) ? q >= 0 : q <= 0, "quotient sign mismatch: %lld / %lld = %lld", (long long) a, (long long) b, (long long) q); - grub_test_assert (abs64(r) < abs64(b), "remainder is larger than dividend: %lld %% %lld = %lld", + VasEBoot_test_assert (abs64(r) < abs64(b), "remainder is larger than dividend: %lld %% %lld = %lld", (long long) a, (long long) b, (long long) r); - grub_test_assert (q * b + r == a, "division doesn't satisfy base property: %lld * %lld + %lld != %lld", (long long) q, (long long) b, (long long) r, + VasEBoot_test_assert (q * b + r == a, "division doesn't satisfy base property: %lld * %lld + %lld != %lld", (long long) q, (long long) b, (long long) r, (long long) a); - if (0) { grub_test_assert (q == (a / b), + if (0) { VasEBoot_test_assert (q == (a / b), "C compiler division failure in 0x%llx, 0x%llx", (long long) a, (long long) b); - grub_test_assert (r == (a % b), + VasEBoot_test_assert (r == (a % b), "C compiler modulo failure in 0x%llx, 0x%llx", (long long) a, (long long) b); } } static void -test64s (grub_int64_t a, grub_int64_t b) +test64s (VasEBoot_int64_t a, VasEBoot_int64_t b) { - grub_int64_t q, r; - q = grub_divmod64s (a, b, &r); + VasEBoot_int64_t q, r; + q = VasEBoot_divmod64s (a, b, &r); - grub_test_assert (a > 0 ? r >= 0 : r <= 0, "remainder sign mismatch: %lld %% %lld = %lld", + VasEBoot_test_assert (a > 0 ? r >= 0 : r <= 0, "remainder sign mismatch: %lld %% %lld = %lld", (long long) a, (long long) b, (long long) r); - grub_test_assert (((a > 0) == (b > 0)) ? q >= 0 : q <= 0, "quotient sign mismatch: %lld / %lld = %lld", + VasEBoot_test_assert (((a > 0) == (b > 0)) ? q >= 0 : q <= 0, "quotient sign mismatch: %lld / %lld = %lld", (long long) a, (long long) b, (long long) q); - grub_test_assert (abs64(r) < abs64(b), "remainder is larger than dividend: %lld %% %lld = %lld", + VasEBoot_test_assert (abs64(r) < abs64(b), "remainder is larger than dividend: %lld %% %lld = %lld", (long long) a, (long long) b, (long long) r); - grub_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, + VasEBoot_test_assert (q * b + r == a, "division doesn't satisfy base property: 0x%llx * 0x%llx + 0x%llx != 0x%llx", (long long) q, (long long) b, (long long) r, (long long) a); -#if GRUB_TARGET_SIZEOF_VOID_P == 8 - grub_test_assert (q == (a / b), +#if VasEBoot_TARGET_SIZEOF_VOID_P == 8 + VasEBoot_test_assert (q == (a / b), "C compiler division failure in 0x%llx, 0x%llx", (long long) a, (long long) b); - grub_test_assert (r == (a % b), + VasEBoot_test_assert (r == (a % b), "C compiler modulo failure in 0x%llx, 0x%llx", (long long) a, (long long) b); #endif } static void -test_all(grub_uint64_t a, grub_uint64_t b) +test_all(VasEBoot_uint64_t a, VasEBoot_uint64_t b) { test64 (a, b); test32 (a, b); @@ -166,8 +166,8 @@ test_all(grub_uint64_t a, grub_uint64_t b) static void div_test (void) { - grub_uint64_t a = 404, b = 7; - grub_size_t i; + VasEBoot_uint64_t a = 404, b = 7; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { @@ -186,4 +186,4 @@ div_test (void) } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (div_test, div_test); +VasEBoot_FUNCTIONAL_TEST (div_test, div_test); diff --git a/VasEBoot-core/tests/example_functional_test.c b/VasEBoot-core/tests/example_functional_test.c index 999f6d273..ad2c394b6 100644 --- a/VasEBoot-core/tests/example_functional_test.c +++ b/VasEBoot-core/tests/example_functional_test.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -/* All tests need to include test.h for GRUB testing framework. */ -#include -#include +/* All tests need to include test.h for VasEBoot testing framework. */ +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Functional test main method. */ static void example_test (void) { /* Check if 1st argument is true and report with default error message. */ - grub_test_assert (1 == 1, "1 equal 1 expected"); + VasEBoot_test_assert (1 == 1, "1 equal 1 expected"); /* Check if 1st argument is true and report with custom error message. */ - grub_test_assert (2 == 2, "2 equal 2 expected"); - grub_test_assert (2 != 3, "2 matches %d", 3); + VasEBoot_test_assert (2 == 2, "2 equal 2 expected"); + VasEBoot_test_assert (2 != 3, "2 matches %d", 3); } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (exfctest, example_test); +VasEBoot_FUNCTIONAL_TEST (exfctest, example_test); diff --git a/VasEBoot-core/tests/fake_input.c b/VasEBoot-core/tests/fake_input.c index 2d6085298..9860db12b 100644 --- a/VasEBoot-core/tests/fake_input.c +++ b/VasEBoot-core/tests/fake_input.c @@ -1,60 +1,60 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static int *seq; static int seqptr, nseq; -static struct grub_term_input *saved; +static struct VasEBoot_term_input *saved; static int fake_input; static int -fake_getkey (struct grub_term_input *term __attribute__ ((unused))) +fake_getkey (struct VasEBoot_term_input *term __attribute__ ((unused))) { if (seq && seqptr < nseq) return seq[seqptr++]; return -1; } -static struct grub_term_input fake_input_term = +static struct VasEBoot_term_input fake_input_term = { .name = "fake", .getkey = fake_getkey }; void -grub_terminal_input_fake_sequence (int *seq_in, int nseq_in) +VasEBoot_terminal_input_fake_sequence (int *seq_in, int nseq_in) { if (!fake_input) - saved = grub_term_inputs; + saved = VasEBoot_term_inputs; if (seq) - grub_free (seq); - seq = grub_malloc (nseq_in * sizeof (seq[0])); + VasEBoot_free (seq); + seq = VasEBoot_malloc (nseq_in * sizeof (seq[0])); if (!seq) return; - grub_term_inputs = &fake_input_term; - grub_memcpy (seq, seq_in, nseq_in * sizeof (seq[0])); + VasEBoot_term_inputs = &fake_input_term; + VasEBoot_memcpy (seq, seq_in, nseq_in * sizeof (seq[0])); nseq = nseq_in; seqptr = 0; @@ -62,13 +62,13 @@ grub_terminal_input_fake_sequence (int *seq_in, int nseq_in) } void -grub_terminal_input_fake_sequence_end (void) +VasEBoot_terminal_input_fake_sequence_end (void) { if (!fake_input) return; fake_input = 0; - grub_term_inputs = saved; - grub_free (seq); + VasEBoot_term_inputs = saved; + VasEBoot_free (seq); seq = 0; nseq = 0; seqptr = 0; diff --git a/VasEBoot-core/tests/gfxterm_menu.c b/VasEBoot-core/tests/gfxterm_menu.c index 8f63dc27a..dd594c670 100644 --- a/VasEBoot-core/tests/gfxterm_menu.c +++ b/VasEBoot-core/tests/gfxterm_menu.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -/* All tests need to include test.h for GRUB testing framework. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* All tests need to include test.h for VasEBoot testing framework. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static const char testfile[] = @@ -57,13 +57,13 @@ static const char testfile[] = "timeout=3\n"; static char * -get_test_cfg (grub_size_t *sz) +get_test_cfg (VasEBoot_size_t *sz) { - *sz = grub_strlen (testfile); - return grub_strdup (testfile); + *sz = VasEBoot_strlen (testfile); + return VasEBoot_strdup (testfile); } -struct grub_procfs_entry test_cfg = +struct VasEBoot_procfs_entry test_cfg = { .name = "test.cfg", .get_contents = get_test_cfg @@ -98,83 +98,83 @@ static void gfxterm_menu (void) { unsigned i, j; - grub_font_t font; + VasEBoot_font_t font; - grub_dl_load ("png"); - grub_dl_load ("gettext"); - grub_dl_load ("gfxterm"); + VasEBoot_dl_load ("png"); + VasEBoot_dl_load ("gettext"); + VasEBoot_dl_load ("gfxterm"); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - grub_dl_load ("gfxmenu"); + VasEBoot_dl_load ("gfxmenu"); - font = grub_font_get (FONT_NAME); - if (font && grub_strcmp (font->name, FONT_NAME) != 0) + font = VasEBoot_font_get (FONT_NAME); + if (font && VasEBoot_strcmp (font->name, FONT_NAME) != 0) font = 0; if (!font) - font = grub_font_load ("unicode"); + font = VasEBoot_font_load ("unicode"); if (!font) { - grub_test_assert (0, "unicode font not found: %s", grub_errmsg); + VasEBoot_test_assert (0, "unicode font not found: %s", VasEBoot_errmsg); return; } - grub_procfs_register ("test.cfg", &test_cfg); + VasEBoot_procfs_register ("test.cfg", &test_cfg); for (j = 0; j < ARRAY_SIZE (tests); j++) - for (i = 0; i < GRUB_TEST_VIDEO_SMALL_N_MODES; i++) + for (i = 0; i < VasEBoot_TEST_VIDEO_SMALL_N_MODES; i++) { - grub_uint64_t start; + VasEBoot_uint64_t start; -#if defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_IEEE1275) - if (grub_test_video_modes[i].width > 1024) +#if defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) || defined (VasEBoot_MACHINE_IEEE1275) + if (VasEBoot_test_video_modes[i].width > 1024) continue; - if (grub_strcmp (tests[j].name, "gfxmenu") == 0 - && grub_test_video_modes[i].width > 800) + if (VasEBoot_strcmp (tests[j].name, "gfxmenu") == 0 + && VasEBoot_test_video_modes[i].width > 800) continue; #endif - start = grub_get_time_ms (); + start = VasEBoot_get_time_ms (); - grub_video_capture_start (&grub_test_video_modes[i], - grub_video_fbstd_colors, - grub_test_video_modes[i].number_of_colors); - if (grub_errno) + VasEBoot_video_capture_start (&VasEBoot_test_video_modes[i], + VasEBoot_video_fbstd_colors, + VasEBoot_test_video_modes[i].number_of_colors); + if (VasEBoot_errno) { - grub_test_assert (0, "can't start capture: %d: %s", - grub_errno, grub_errmsg); + VasEBoot_test_assert (0, "can't start capture: %d: %s", + VasEBoot_errno, VasEBoot_errmsg); return; } - grub_terminal_input_fake_sequence ((int []) { -1, -1, -1, GRUB_TERM_KEY_DOWN, -1, 'e', - -1, GRUB_TERM_KEY_RIGHT, -1, 'x', -1, '\e', -1, '\e' }, 14); + VasEBoot_terminal_input_fake_sequence ((int []) { -1, -1, -1, VasEBoot_TERM_KEY_DOWN, -1, 'e', + -1, VasEBoot_TERM_KEY_RIGHT, -1, 'x', -1, '\e', -1, '\e' }, 14); - grub_video_checksum (tests[j].name); + VasEBoot_video_checksum (tests[j].name); - if (grub_test_use_gfxterm ()) + if (VasEBoot_test_use_gfxterm ()) return; - grub_env_context_open (); + VasEBoot_env_context_open (); if (tests[j].var) - grub_env_set (tests[j].var, tests[j].val); - grub_normal_execute ("(proc)/test.cfg", 1, 0); - grub_env_context_close (); + VasEBoot_env_set (tests[j].var, tests[j].val); + VasEBoot_normal_execute ("(proc)/test.cfg", 1, 0); + VasEBoot_env_context_close (); - grub_test_use_gfxterm_end (); + VasEBoot_test_use_gfxterm_end (); - grub_terminal_input_fake_sequence_end (); - grub_video_checksum_end (); - grub_video_capture_end (); + VasEBoot_terminal_input_fake_sequence_end (); + VasEBoot_video_checksum_end (); + VasEBoot_video_capture_end (); if (tests[j].var) - grub_env_unset (tests[j].var); - grub_printf ("%s %dx%dx%s done %lld ms\n", tests[j].name, - grub_test_video_modes[i].width, - grub_test_video_modes[i].height, - grub_video_checksum_get_modename (), (long long) (grub_get_time_ms () - start)); + VasEBoot_env_unset (tests[j].var); + VasEBoot_printf ("%s %dx%dx%s done %lld ms\n", tests[j].name, + VasEBoot_test_video_modes[i].width, + VasEBoot_test_video_modes[i].height, + VasEBoot_video_checksum_get_modename (), (long long) (VasEBoot_get_time_ms () - start)); } - grub_procfs_unregister (&test_cfg); + VasEBoot_procfs_unregister (&test_cfg); } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (gfxterm_menu, gfxterm_menu); +VasEBoot_FUNCTIONAL_TEST (gfxterm_menu, gfxterm_menu); diff --git a/VasEBoot-core/tests/legacy_password_test.c b/VasEBoot-core/tests/legacy_password_test.c index 25460338e..59dac9224 100644 --- a/VasEBoot-core/tests/legacy_password_test.c +++ b/VasEBoot-core/tests/legacy_password_test.c @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static struct { char **args; int argc; - char entered[GRUB_AUTH_MAX_PASSLEN]; + char entered[VasEBoot_AUTH_MAX_PASSLEN]; int exp; } vectors[] = { { (char * []) { (char *) "hello", NULL }, 1, "hello", 1 }, @@ -55,14 +55,14 @@ static struct static void legacy_password_test (void) { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) - grub_test_assert (grub_legacy_check_md5_password (vectors[i].argc, + VasEBoot_test_assert (VasEBoot_legacy_check_md5_password (vectors[i].argc, vectors[i].args, vectors[i].entered) == vectors[i].exp, "Bad password check (%d)", (int) i); } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (legacy_password_test, legacy_password_test); +VasEBoot_FUNCTIONAL_TEST (legacy_password_test, legacy_password_test); diff --git a/VasEBoot-core/tests/lib/functional_test.c b/VasEBoot-core/tests/lib/functional_test.c index d4822a124..800373ed0 100644 --- a/VasEBoot-core/tests/lib/functional_test.c +++ b/VasEBoot-core/tests/lib/functional_test.c @@ -1,96 +1,96 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -grub_functional_test (grub_extcmd_context_t ctxt __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_functional_test (VasEBoot_extcmd_context_t ctxt __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_test_t test; + VasEBoot_test_t test; int ok = 1; - FOR_LIST_ELEMENTS (test, grub_test_list) + FOR_LIST_ELEMENTS (test, VasEBoot_test_list) { - grub_errno = 0; - ok = ok && !grub_test_run (test); - grub_errno = 0; + VasEBoot_errno = 0; + ok = ok && !VasEBoot_test_run (test); + VasEBoot_errno = 0; } if (ok) - grub_printf ("ALL TESTS PASSED\n"); + VasEBoot_printf ("ALL TESTS PASSED\n"); else - grub_printf ("TEST FAILURE\n"); - return GRUB_ERR_NONE; + VasEBoot_printf ("TEST FAILURE\n"); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_functional_all_tests (grub_extcmd_context_t ctxt __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_functional_all_tests (VasEBoot_extcmd_context_t ctxt __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_test_t test; + VasEBoot_test_t test; int ok = 1; - grub_dl_load ("legacy_password_test"); - grub_errno = GRUB_ERR_NONE; - grub_dl_load ("exfctest"); - grub_dl_load ("videotest_checksum"); - grub_dl_load ("gfxterm_menu"); - grub_dl_load ("setjmp_test"); - grub_dl_load ("cmdline_cat_test"); - grub_dl_load ("div_test"); - grub_dl_load ("xnu_uuid_test"); - grub_dl_load ("pbkdf2_test"); - grub_dl_load ("signature_test"); - grub_dl_load ("sleep_test"); - grub_dl_load ("bswap_test"); - grub_dl_load ("ctz_test"); - grub_dl_load ("cmp_test"); - grub_dl_load ("mul_test"); - grub_dl_load ("shift_test"); + VasEBoot_dl_load ("legacy_password_test"); + VasEBoot_errno = VasEBoot_ERR_NONE; + VasEBoot_dl_load ("exfctest"); + VasEBoot_dl_load ("videotest_checksum"); + VasEBoot_dl_load ("gfxterm_menu"); + VasEBoot_dl_load ("setjmp_test"); + VasEBoot_dl_load ("cmdline_cat_test"); + VasEBoot_dl_load ("div_test"); + VasEBoot_dl_load ("xnu_uuid_test"); + VasEBoot_dl_load ("pbkdf2_test"); + VasEBoot_dl_load ("signature_test"); + VasEBoot_dl_load ("sleep_test"); + VasEBoot_dl_load ("bswap_test"); + VasEBoot_dl_load ("ctz_test"); + VasEBoot_dl_load ("cmp_test"); + VasEBoot_dl_load ("mul_test"); + VasEBoot_dl_load ("shift_test"); - FOR_LIST_ELEMENTS (test, grub_test_list) - ok = !grub_test_run (test) && ok; + FOR_LIST_ELEMENTS (test, VasEBoot_test_list) + ok = !VasEBoot_test_run (test) && ok; if (ok) - grub_printf ("ALL TESTS PASSED\n"); + VasEBoot_printf ("ALL TESTS PASSED\n"); else - grub_printf ("TEST FAILURE\n"); - return GRUB_ERR_NONE; + VasEBoot_printf ("TEST FAILURE\n"); + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT (functional_test) +VasEBoot_MOD_INIT (functional_test) { - cmd = grub_register_extcmd ("functional_test", grub_functional_test, 0, 0, + cmd = VasEBoot_register_extcmd ("functional_test", VasEBoot_functional_test, 0, 0, "Run all loaded functional tests.", 0); - cmd = grub_register_extcmd ("all_functional_test", grub_functional_all_tests, 0, 0, + cmd = VasEBoot_register_extcmd ("all_functional_test", VasEBoot_functional_all_tests, 0, 0, "Run all functional tests.", 0); } -GRUB_MOD_FINI (functional_test) +VasEBoot_MOD_FINI (functional_test) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/tests/lib/test.c b/VasEBoot-core/tests/lib/test.c index 3000fc88d..83983d66a 100644 --- a/VasEBoot-core/tests/lib/test.c +++ b/VasEBoot-core/tests/lib/test.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -struct grub_test_failure +struct VasEBoot_test_failure { /* The next failure. */ - struct grub_test_failure *next; - struct grub_test_failure **prev; + struct VasEBoot_test_failure *next; + struct VasEBoot_test_failure **prev; /* The test source file name. */ char *file; @@ -33,39 +33,39 @@ struct grub_test_failure char *funp; /* The test call line number. */ - grub_uint32_t line; + VasEBoot_uint32_t line; /* The test failure message. */ char *message; }; -typedef struct grub_test_failure *grub_test_failure_t; +typedef struct VasEBoot_test_failure *VasEBoot_test_failure_t; -grub_test_t grub_test_list; -static grub_test_failure_t failure_list; +VasEBoot_test_t VasEBoot_test_list; +static VasEBoot_test_failure_t failure_list; -static grub_test_failure_t -failure_start(const char *file, const char *funp, grub_uint32_t line); -static grub_test_failure_t -failure_start(const char *file, const char *funp, grub_uint32_t line) +static VasEBoot_test_failure_t +failure_start(const char *file, const char *funp, VasEBoot_uint32_t line); +static VasEBoot_test_failure_t +failure_start(const char *file, const char *funp, VasEBoot_uint32_t line) { - grub_test_failure_t failure; + VasEBoot_test_failure_t failure; - failure = (grub_test_failure_t) grub_malloc (sizeof (*failure)); + failure = (VasEBoot_test_failure_t) VasEBoot_malloc (sizeof (*failure)); if (!failure) return NULL; - failure->file = grub_strdup (file ? : ""); + failure->file = VasEBoot_strdup (file ? : ""); if (!failure->file) { - grub_free(failure); + VasEBoot_free(failure); return NULL; } - failure->funp = grub_strdup (funp ? : ""); + failure->funp = VasEBoot_strdup (funp ? : ""); if (!failure->funp) { - grub_free(failure->file); - grub_free(failure); + VasEBoot_free(failure->file); + VasEBoot_free(failure); return NULL; } @@ -77,18 +77,18 @@ failure_start(const char *file, const char *funp, grub_uint32_t line) } static void -failure_append_vtext(grub_test_failure_t failure, const char *fmt, va_list args); +failure_append_vtext(VasEBoot_test_failure_t failure, const char *fmt, va_list args); static void -failure_append_vtext(grub_test_failure_t failure, const char *fmt, va_list args) +failure_append_vtext(VasEBoot_test_failure_t failure, const char *fmt, va_list args) { - char *msg = grub_xvasprintf(fmt, args); + char *msg = VasEBoot_xvasprintf(fmt, args); if (failure->message) { char *oldmsg = failure->message; - failure->message = grub_xasprintf("%s%s", oldmsg, msg); - grub_free (oldmsg); - grub_free (msg); + failure->message = VasEBoot_xasprintf("%s%s", oldmsg, msg); + VasEBoot_free (oldmsg); + VasEBoot_free (msg); } else { @@ -97,7 +97,7 @@ failure_append_vtext(grub_test_failure_t failure, const char *fmt, va_list args) } static void -failure_append_text(grub_test_failure_t failure, const char *fmt, ...) +failure_append_text(VasEBoot_test_failure_t failure, const char *fmt, ...) { va_list args; @@ -109,40 +109,40 @@ failure_append_text(grub_test_failure_t failure, const char *fmt, ...) static void add_failure (const char *file, const char *funp, - grub_uint32_t line, const char *fmt, va_list args) + VasEBoot_uint32_t line, const char *fmt, va_list args) { - grub_test_failure_t failure = failure_start(file, funp, line); + VasEBoot_test_failure_t failure = failure_start(file, funp, line); failure_append_text(failure, fmt, args); - grub_list_push (GRUB_AS_LIST_P (&failure_list), GRUB_AS_LIST (failure)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&failure_list), VasEBoot_AS_LIST (failure)); } static void free_failures (void) { - grub_test_failure_t item; + VasEBoot_test_failure_t item; while (failure_list) { item = failure_list; failure_list = item->next; if (item->message) - grub_free (item->message); + VasEBoot_free (item->message); if (item->funp) - grub_free (item->funp); + VasEBoot_free (item->funp); if (item->file) - grub_free (item->file); + VasEBoot_free (item->file); - grub_free (item); + VasEBoot_free (item); } failure_list = 0; } void -grub_test_nonzero (int cond, +VasEBoot_test_nonzero (int cond, const char *file, - const char *funp, grub_uint32_t line, const char *fmt, ...) + const char *funp, VasEBoot_uint32_t line, const char *fmt, ...) { va_list ap; @@ -155,12 +155,12 @@ grub_test_nonzero (int cond, } void -grub_test_assert_helper (int cond, const char *file, const char *funp, - grub_uint32_t line, const char *condstr, +VasEBoot_test_assert_helper (int cond, const char *file, const char *funp, + VasEBoot_uint32_t line, const char *condstr, const char *fmt, ...) { va_list ap; - grub_test_failure_t failure; + VasEBoot_test_failure_t failure; if (cond) return; @@ -174,66 +174,66 @@ grub_test_assert_helper (int cond, const char *file, const char *funp, va_end(ap); - grub_list_push (GRUB_AS_LIST_P (&failure_list), GRUB_AS_LIST (failure)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&failure_list), VasEBoot_AS_LIST (failure)); } void -grub_test_register (const char *name, void (*test_main) (void)) +VasEBoot_test_register (const char *name, void (*test_main) (void)) { - grub_test_t test; + VasEBoot_test_t test; - test = (grub_test_t) grub_malloc (sizeof (*test)); + test = (VasEBoot_test_t) VasEBoot_malloc (sizeof (*test)); if (!test) return; - test->name = grub_strdup (name); + test->name = VasEBoot_strdup (name); test->main = test_main; - grub_list_push (GRUB_AS_LIST_P (&grub_test_list), GRUB_AS_LIST (test)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_test_list), VasEBoot_AS_LIST (test)); } void -grub_test_unregister (const char *name) +VasEBoot_test_unregister (const char *name) { - grub_test_t test; + VasEBoot_test_t test; - test = (grub_test_t) grub_named_list_find - (GRUB_AS_NAMED_LIST (grub_test_list), name); + test = (VasEBoot_test_t) VasEBoot_named_list_find + (VasEBoot_AS_NAMED_LIST (VasEBoot_test_list), name); if (test) { - grub_list_remove (GRUB_AS_LIST (test)); + VasEBoot_list_remove (VasEBoot_AS_LIST (test)); if (test->name) - grub_free (test->name); + VasEBoot_free (test->name); - grub_free (test); + VasEBoot_free (test); } } int -grub_test_run (grub_test_t test) +VasEBoot_test_run (VasEBoot_test_t test) { - grub_test_failure_t failure; + VasEBoot_test_failure_t failure; test->main (); - grub_printf ("%s:\n", test->name); + VasEBoot_printf ("%s:\n", test->name); FOR_LIST_ELEMENTS (failure, failure_list) - grub_printf (" %s:%s:%u: %s\n", + VasEBoot_printf (" %s:%s:%u: %s\n", (failure->file ? : ""), (failure->funp ? : ""), failure->line, (failure->message ? : "")); if (!failure_list) { - grub_printf ("%s: PASS\n", test->name); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s: PASS\n", test->name); + return VasEBoot_ERR_NONE; } else { - grub_printf ("%s: FAIL\n", test->name); + VasEBoot_printf ("%s: FAIL\n", test->name); free_failures (); - return GRUB_ERR_TEST_FAILURE; + return VasEBoot_ERR_TEST_FAILURE; } } diff --git a/VasEBoot-core/tests/mul_test.c b/VasEBoot-core/tests/mul_test.c index cd6423192..0139c300a 100644 --- a/VasEBoot-core/tests/mul_test.c +++ b/VasEBoot-core/tests/mul_test.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t vectors[][2] = { +static VasEBoot_uint64_t vectors[][2] = { { 0xffffffffffffffffULL, 1}, { 1, 0xffffffffffffffffULL}, { 0xffffffffffffffffULL, 0xffffffffffffffffULL}, @@ -31,18 +31,18 @@ static grub_uint64_t vectors[][2] = { }; static void -test64(grub_uint64_t a, grub_uint64_t b) +test64(VasEBoot_uint64_t a, VasEBoot_uint64_t b) { - grub_uint64_t r1 = a * b, r2 = 0, r3; + VasEBoot_uint64_t r1 = a * b, r2 = 0, r3; int i; for (i = 0; i < 64; i++) if ((a & (1LL << i))) r2 += b << i; - r3 = ((grub_int64_t) a) * ((grub_int64_t) b); - grub_test_assert (r1 == r2, + r3 = ((VasEBoot_int64_t) a) * ((VasEBoot_int64_t) b); + VasEBoot_test_assert (r1 == r2, "multiplication mismatch (u): 0x%llx x 0x%llx = 0x%llx != 0x%llx", (long long) a, (long long) b, (long long) r2, (long long) r1); - grub_test_assert (r3 == r2, + VasEBoot_test_assert (r3 == r2, "multiplication mismatch (s): 0x%llx x 0x%llx = 0x%llx != 0x%llx", (long long) a, (long long) b, (long long) r2, (long long) r3); } @@ -50,8 +50,8 @@ test64(grub_uint64_t a, grub_uint64_t b) static void mul_test (void) { - grub_uint64_t a = 404, b = 7; - grub_size_t i; + VasEBoot_uint64_t a = 404, b = 7; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { @@ -70,4 +70,4 @@ mul_test (void) } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (mul_test, mul_test); +VasEBoot_FUNCTIONAL_TEST (mul_test, mul_test); diff --git a/VasEBoot-core/tests/pbkdf2_test.c b/VasEBoot-core/tests/pbkdf2_test.c index 4eeb8b89f..724794b53 100644 --- a/VasEBoot-core/tests/pbkdf2_test.c +++ b/VasEBoot-core/tests/pbkdf2_test.c @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static struct { const char *P; - grub_size_t Plen; + VasEBoot_size_t Plen; const char *S; - grub_size_t Slen; + VasEBoot_size_t Slen; unsigned int c; - grub_size_t dkLen; + VasEBoot_size_t dkLen; const char *DK; } vectors[] = { /* RFC6070. */ @@ -74,24 +74,24 @@ static struct static void pbkdf2_test (void) { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { gcry_err_code_t err; - grub_uint8_t DK[32]; - err = grub_crypto_pbkdf2 (GRUB_MD_SHA1, - (const grub_uint8_t *) vectors[i].P, + VasEBoot_uint8_t DK[32]; + err = VasEBoot_crypto_pbkdf2 (VasEBoot_MD_SHA1, + (const VasEBoot_uint8_t *) vectors[i].P, vectors[i].Plen, - (const grub_uint8_t *) vectors[i].S, + (const VasEBoot_uint8_t *) vectors[i].S, vectors[i].Slen, vectors[i].c, DK, vectors[i].dkLen); - grub_test_assert (err == 0, "gcry error %d", err); - grub_test_assert (grub_memcmp (DK, vectors[i].DK, vectors[i].dkLen) == 0, + VasEBoot_test_assert (err == 0, "gcry error %d", err); + VasEBoot_test_assert (VasEBoot_memcmp (DK, vectors[i].DK, vectors[i].dkLen) == 0, "PBKDF2 mismatch"); } } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (pbkdf2_test, pbkdf2_test); +VasEBoot_FUNCTIONAL_TEST (pbkdf2_test, pbkdf2_test); diff --git a/VasEBoot-core/tests/setjmp_test.c b/VasEBoot-core/tests/setjmp_test.c index 604a6ce8f..ea7f292a9 100644 --- a/VasEBoot-core/tests/setjmp_test.c +++ b/VasEBoot-core/tests/setjmp_test.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_jmp_buf jmp_point; +static VasEBoot_jmp_buf jmp_point; static int expected, ctr; /* This fixes GCC7 "unintentional fallthrough" warning */ @@ -33,19 +33,19 @@ static void jmp2 (void) __attribute__ ((noreturn)); static void jmp0 (void) { - grub_longjmp (jmp_point, 0); + VasEBoot_longjmp (jmp_point, 0); } static void jmp1 (void) { - grub_longjmp (jmp_point, 1); + VasEBoot_longjmp (jmp_point, 1); } static void jmp2 (void) { - grub_longjmp (jmp_point, 2); + VasEBoot_longjmp (jmp_point, 2); } static void @@ -55,9 +55,9 @@ setjmp_test (void) expected = 0; ctr = 0; - val = grub_setjmp (jmp_point); + val = VasEBoot_setjmp (jmp_point); - grub_test_assert (val == expected, "setjmp returned %d instead of %d", + VasEBoot_test_assert (val == expected, "setjmp returned %d instead of %d", val, expected); switch (ctr++) { @@ -73,8 +73,8 @@ setjmp_test (void) case 3: return; } - grub_test_assert (0, "setjmp didn't return enough times"); + VasEBoot_test_assert (0, "setjmp didn't return enough times"); } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (setjmp_test, setjmp_test); +VasEBoot_FUNCTIONAL_TEST (setjmp_test, setjmp_test); diff --git a/VasEBoot-core/tests/shift_test.c b/VasEBoot-core/tests/shift_test.c index 4120f520a..d336a226d 100644 --- a/VasEBoot-core/tests/shift_test.c +++ b/VasEBoot-core/tests/shift_test.c @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_uint64_t vectors[] = { +static VasEBoot_uint64_t vectors[] = { 0xffffffffffffffffULL, 1, 2, 0, 0x0102030405060708ULL }; /* We're testing shifts, don't replace access to this with a shift. */ -static const grub_uint8_t bitmask[] = +static const VasEBoot_uint8_t bitmask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; typedef union { - grub_uint64_t v64; - grub_uint8_t v8[8]; -} grub_raw_u64_t; + VasEBoot_uint64_t v64; + VasEBoot_uint8_t v8[8]; +} VasEBoot_raw_u64_t; static int -get_bit64 (grub_uint64_t v, int b) +get_bit64 (VasEBoot_uint64_t v, int b) { - grub_raw_u64_t vr = { .v64 = v }; - grub_uint8_t *p = vr.v8; + VasEBoot_raw_u64_t vr = { .v64 = v }; + VasEBoot_uint8_t *p = vr.v8; if (b >= 64) return 0; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN p += 7 - b / 8; #else p += b / 8; @@ -50,14 +50,14 @@ get_bit64 (grub_uint64_t v, int b) return !!(*p & bitmask[b % 8]); } -static grub_uint64_t -set_bit64 (grub_uint64_t v, int b) +static VasEBoot_uint64_t +set_bit64 (VasEBoot_uint64_t v, int b) { - grub_raw_u64_t vr = { .v64 = v }; - grub_uint8_t *p = vr.v8; + VasEBoot_raw_u64_t vr = { .v64 = v }; + VasEBoot_uint8_t *p = vr.v8; if (b >= 64) return v; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN p += 7 - b / 8; #else p += b / 8; @@ -66,10 +66,10 @@ set_bit64 (grub_uint64_t v, int b) return vr.v64; } -static grub_uint64_t -left_shift64 (grub_uint64_t v, int s) +static VasEBoot_uint64_t +left_shift64 (VasEBoot_uint64_t v, int s) { - grub_uint64_t r = 0; + VasEBoot_uint64_t r = 0; int i; for (i = 0; i + s < 64; i++) if (get_bit64 (v, i)) @@ -77,10 +77,10 @@ left_shift64 (grub_uint64_t v, int s) return r; } -static grub_uint64_t -right_shift64 (grub_uint64_t v, int s) +static VasEBoot_uint64_t +right_shift64 (VasEBoot_uint64_t v, int s) { - grub_uint64_t r = 0; + VasEBoot_uint64_t r = 0; int i; for (i = s; i < 64; i++) if (get_bit64 (v, i)) @@ -88,10 +88,10 @@ right_shift64 (grub_uint64_t v, int s) return r; } -static grub_uint64_t -arithmetic_right_shift64 (grub_uint64_t v, int s) +static VasEBoot_uint64_t +arithmetic_right_shift64 (VasEBoot_uint64_t v, int s) { - grub_uint64_t r = 0; + VasEBoot_uint64_t r = 0; int i; for (i = s; i < 64; i++) if (get_bit64 (v, i)) @@ -104,28 +104,28 @@ arithmetic_right_shift64 (grub_uint64_t v, int s) } static void -test64 (grub_uint64_t v) +test64 (VasEBoot_uint64_t v) { int i; for (i = 0; i < 64; i++) { - grub_test_assert ((v << i) == left_shift64 (v, i), + VasEBoot_test_assert ((v << i) == left_shift64 (v, i), "lshift wrong: 0x%llx << %d: 0x%llx, 0x%llx", (long long) v, i, (long long) (v << i), (long long) left_shift64 (v, i)); - grub_test_assert ((v >> i) == right_shift64 (v, i), + VasEBoot_test_assert ((v >> i) == right_shift64 (v, i), "rshift wrong: 0x%llx >> %d: 0x%llx, 0x%llx", (long long) v, i, (long long) (v >> i), (long long) right_shift64 (v, i)); - grub_test_assert ((((grub_int64_t) v) >> i) == (grub_int64_t) arithmetic_right_shift64 (v, i), - "arithmetic rshift wrong: ((grub_int64_t) 0x%llx) >> %d: 0x%llx, 0x%llx", + VasEBoot_test_assert ((((VasEBoot_int64_t) v) >> i) == (VasEBoot_int64_t) arithmetic_right_shift64 (v, i), + "arithmetic rshift wrong: ((VasEBoot_int64_t) 0x%llx) >> %d: 0x%llx, 0x%llx", (long long) v, i, - (long long) (((grub_int64_t) v) >> i), (long long) arithmetic_right_shift64 (v, i)); + (long long) (((VasEBoot_int64_t) v) >> i), (long long) arithmetic_right_shift64 (v, i)); } } static void -test_all(grub_uint64_t a) +test_all(VasEBoot_uint64_t a) { test64 (a); } @@ -133,8 +133,8 @@ test_all(grub_uint64_t a) static void shift_test (void) { - grub_uint64_t a = 404, b = 7; - grub_size_t i; + VasEBoot_uint64_t a = 404, b = 7; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (vectors); i++) { @@ -154,4 +154,4 @@ shift_test (void) } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (shift_test, shift_test); +VasEBoot_FUNCTIONAL_TEST (shift_test, shift_test); diff --git a/VasEBoot-core/tests/signature_test.c b/VasEBoot-core/tests/signature_test.c index aa49393a4..461d6d5e5 100644 --- a/VasEBoot-core/tests/signature_test.c +++ b/VasEBoot-core/tests/signature_test.c @@ -1,123 +1,123 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "signatures.h" -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static char * -get_hi_dsa_sig (grub_size_t *sz) +get_hi_dsa_sig (VasEBoot_size_t *sz) { char *ret; *sz = sizeof (hi_dsa_sig); - ret = grub_malloc (sizeof (hi_dsa_sig)); + ret = VasEBoot_malloc (sizeof (hi_dsa_sig)); if (ret) - grub_memcpy (ret, hi_dsa_sig, sizeof (hi_dsa_sig)); + VasEBoot_memcpy (ret, hi_dsa_sig, sizeof (hi_dsa_sig)); return ret; } -static struct grub_procfs_entry hi_dsa_sig_entry = +static struct VasEBoot_procfs_entry hi_dsa_sig_entry = { .name = "hi_dsa.sig", .get_contents = get_hi_dsa_sig }; static char * -get_hi_dsa_pub (grub_size_t *sz) +get_hi_dsa_pub (VasEBoot_size_t *sz) { char *ret; *sz = sizeof (hi_dsa_pub); - ret = grub_malloc (sizeof (hi_dsa_pub)); + ret = VasEBoot_malloc (sizeof (hi_dsa_pub)); if (ret) - grub_memcpy (ret, hi_dsa_pub, sizeof (hi_dsa_pub)); + VasEBoot_memcpy (ret, hi_dsa_pub, sizeof (hi_dsa_pub)); return ret; } -static struct grub_procfs_entry hi_dsa_pub_entry = +static struct VasEBoot_procfs_entry hi_dsa_pub_entry = { .name = "hi_dsa.pub", .get_contents = get_hi_dsa_pub }; static char * -get_hi_rsa_sig (grub_size_t *sz) +get_hi_rsa_sig (VasEBoot_size_t *sz) { char *ret; *sz = sizeof (hi_rsa_sig); - ret = grub_malloc (sizeof (hi_rsa_sig)); + ret = VasEBoot_malloc (sizeof (hi_rsa_sig)); if (ret) - grub_memcpy (ret, hi_rsa_sig, sizeof (hi_rsa_sig)); + VasEBoot_memcpy (ret, hi_rsa_sig, sizeof (hi_rsa_sig)); return ret; } -static struct grub_procfs_entry hi_rsa_sig_entry = +static struct VasEBoot_procfs_entry hi_rsa_sig_entry = { .name = "hi_rsa.sig", .get_contents = get_hi_rsa_sig }; static char * -get_hi_rsa_pub (grub_size_t *sz) +get_hi_rsa_pub (VasEBoot_size_t *sz) { char *ret; *sz = sizeof (hi_rsa_pub); - ret = grub_malloc (sizeof (hi_rsa_pub)); + ret = VasEBoot_malloc (sizeof (hi_rsa_pub)); if (ret) - grub_memcpy (ret, hi_rsa_pub, sizeof (hi_rsa_pub)); + VasEBoot_memcpy (ret, hi_rsa_pub, sizeof (hi_rsa_pub)); return ret; } -static struct grub_procfs_entry hi_rsa_pub_entry = +static struct VasEBoot_procfs_entry hi_rsa_pub_entry = { .name = "hi_rsa.pub", .get_contents = get_hi_rsa_pub }; static char * -get_hi (grub_size_t *sz) +get_hi (VasEBoot_size_t *sz) { *sz = 3; - return grub_strdup ("hi\n"); + return VasEBoot_strdup ("hi\n"); } -struct grub_procfs_entry hi = +struct VasEBoot_procfs_entry hi = { .name = "hi", .get_contents = get_hi }; static char * -get_hj (grub_size_t *sz) +get_hj (VasEBoot_size_t *sz) { *sz = 3; - return grub_strdup ("hj\n"); + return VasEBoot_strdup ("hj\n"); } -struct grub_procfs_entry hj = +struct VasEBoot_procfs_entry hj = { .name = "hj", .get_contents = get_hj @@ -126,33 +126,33 @@ struct grub_procfs_entry hj = static void do_verify (const char *f, const char *sig, const char *pub, int is_valid) { - grub_command_t cmd; + VasEBoot_command_t cmd; char *args[] = { (char *) f, (char *) sig, (char *) pub, NULL }; - grub_err_t err; + VasEBoot_err_t err; - cmd = grub_command_find ("verify_detached"); + cmd = VasEBoot_command_find ("verify_detached"); if (!cmd) { - grub_test_assert (0, "can't find command `%s'", "verify_detached"); + VasEBoot_test_assert (0, "can't find command `%s'", "verify_detached"); return; } err = (cmd->func) (cmd, 3, args); - grub_test_assert (err == (is_valid ? 0 : GRUB_ERR_BAD_SIGNATURE), - "verification failed: %d: %s", grub_errno, grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_test_assert (err == (is_valid ? 0 : VasEBoot_ERR_BAD_SIGNATURE), + "verification failed: %d: %s", VasEBoot_errno, VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; } static void signature_test (void) { - grub_procfs_register ("hi", &hi); - grub_procfs_register ("hj", &hj); - grub_procfs_register ("hi_dsa.pub", &hi_dsa_pub_entry); - grub_procfs_register ("hi_dsa.sig", &hi_dsa_sig_entry); - grub_procfs_register ("hi_rsa.pub", &hi_rsa_pub_entry); - grub_procfs_register ("hi_rsa.sig", &hi_rsa_sig_entry); + VasEBoot_procfs_register ("hi", &hi); + VasEBoot_procfs_register ("hj", &hj); + VasEBoot_procfs_register ("hi_dsa.pub", &hi_dsa_pub_entry); + VasEBoot_procfs_register ("hi_dsa.sig", &hi_dsa_sig_entry); + VasEBoot_procfs_register ("hi_rsa.pub", &hi_rsa_pub_entry); + VasEBoot_procfs_register ("hi_rsa.sig", &hi_rsa_sig_entry); do_verify ("(proc)/hi", "(proc)/hi_dsa.sig", "(proc)/hi_dsa.pub", 1); do_verify ("(proc)/hi", "(proc)/hi_dsa.sig", "(proc)/hi_dsa.pub", 1); @@ -161,10 +161,10 @@ signature_test (void) do_verify ("(proc)/hi", "(proc)/hi_rsa.sig", "(proc)/hi_rsa.pub", 1); do_verify ("(proc)/hj", "(proc)/hi_rsa.sig", "(proc)/hi_rsa.pub", 0); - grub_procfs_unregister (&hi); - grub_procfs_unregister (&hj); - grub_procfs_unregister (&hi_dsa_sig_entry); - grub_procfs_unregister (&hi_dsa_pub_entry); + VasEBoot_procfs_unregister (&hi); + VasEBoot_procfs_unregister (&hj); + VasEBoot_procfs_unregister (&hi_dsa_sig_entry); + VasEBoot_procfs_unregister (&hi_dsa_pub_entry); } -GRUB_FUNCTIONAL_TEST (signature_test, signature_test); +VasEBoot_FUNCTIONAL_TEST (signature_test, signature_test); diff --git a/VasEBoot-core/tests/sleep_test.c b/VasEBoot-core/tests/sleep_test.c index 3d11c717c..f95d1d462 100644 --- a/VasEBoot-core/tests/sleep_test.c +++ b/VasEBoot-core/tests/sleep_test.c @@ -1,52 +1,52 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static void sleep_test (void) { - struct grub_datetime st, en; - grub_int32_t stu = 0, enu = 0; + struct VasEBoot_datetime st, en; + VasEBoot_int32_t stu = 0, enu = 0; int is_delayok; - grub_test_assert (!grub_get_datetime (&st), "Couldn't retrieve start time"); - grub_millisleep (10000); - grub_test_assert (!grub_get_datetime (&en), "Couldn't retrieve end time"); - grub_test_assert (grub_datetime2unixtime (&st, &stu), "Invalid date"); - grub_test_assert (grub_datetime2unixtime (&en, &enu), "Invalid date"); + VasEBoot_test_assert (!VasEBoot_get_datetime (&st), "Couldn't retrieve start time"); + VasEBoot_millisleep (10000); + VasEBoot_test_assert (!VasEBoot_get_datetime (&en), "Couldn't retrieve end time"); + VasEBoot_test_assert (VasEBoot_datetime2unixtime (&st, &stu), "Invalid date"); + VasEBoot_test_assert (VasEBoot_datetime2unixtime (&en, &enu), "Invalid date"); is_delayok = (enu - stu >= 9 && enu - stu <= 11); #ifdef __arm__ /* Ignore QEMU bug */ if (enu - stu >= 15 && enu - stu <= 17) is_delayok = 1; #endif - grub_test_assert (is_delayok, "Interval out of range: %d", enu-stu); + VasEBoot_test_assert (is_delayok, "Interval out of range: %d", enu-stu); } -GRUB_FUNCTIONAL_TEST (sleep_test, sleep_test); +VasEBoot_FUNCTIONAL_TEST (sleep_test, sleep_test); diff --git a/VasEBoot-core/tests/strtoull_test.c b/VasEBoot-core/tests/strtoull_test.c index 7da615ff3..2a361f934 100644 --- a/VasEBoot-core/tests/strtoull_test.c +++ b/VasEBoot-core/tests/strtoull_test.c @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2016 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static void strtoull_testcase (const char *input, int base, unsigned long long expected, - int num_digits, grub_err_t error) + int num_digits, VasEBoot_err_t error) { char *output; unsigned long long value; - grub_errno = 0; - value = grub_strtoull(input, &output, base); - grub_test_assert (grub_errno == error, + VasEBoot_errno = 0; + value = VasEBoot_strtoull(input, &output, base); + VasEBoot_test_assert (VasEBoot_errno == error, "unexpected error. Expected %d, got %d. Input \"%s\"", - error, grub_errno, input); - if (grub_errno) + error, VasEBoot_errno, input); + if (VasEBoot_errno) { - grub_errno = 0; + VasEBoot_errno = 0; return; } - grub_test_assert (input + num_digits == output, + VasEBoot_test_assert (input + num_digits == output, "unexpected number of digits. Expected %d, got %d, input \"%s\"", num_digits, (int) (output - input), input); - grub_test_assert (value == expected, + VasEBoot_test_assert (value == expected, "unexpected return value. Expected %llu, got %llu, input \"\%s\"", expected, value, input); } @@ -48,16 +48,16 @@ strtoull_testcase (const char *input, int base, unsigned long long expected, static void strtoull_test (void) { - strtoull_testcase ("9", 0, 9, 1, GRUB_ERR_NONE); - strtoull_testcase ("0xaa", 0, 0xaa, 4, GRUB_ERR_NONE); - strtoull_testcase ("0xff", 0, 0xff, 4, GRUB_ERR_NONE); - strtoull_testcase ("0", 10, 0, 1, GRUB_ERR_NONE); - strtoull_testcase ("8", 8, 0, 0, GRUB_ERR_BAD_NUMBER); - strtoull_testcase ("38", 8, 3, 1, GRUB_ERR_NONE); - strtoull_testcase ("7", 8, 7, 1, GRUB_ERR_NONE); - strtoull_testcase ("1]", 16, 1, 1, GRUB_ERR_NONE); - strtoull_testcase ("18446744073709551616", 10, 0, 0, GRUB_ERR_OUT_OF_RANGE); + strtoull_testcase ("9", 0, 9, 1, VasEBoot_ERR_NONE); + strtoull_testcase ("0xaa", 0, 0xaa, 4, VasEBoot_ERR_NONE); + strtoull_testcase ("0xff", 0, 0xff, 4, VasEBoot_ERR_NONE); + strtoull_testcase ("0", 10, 0, 1, VasEBoot_ERR_NONE); + strtoull_testcase ("8", 8, 0, 0, VasEBoot_ERR_BAD_NUMBER); + strtoull_testcase ("38", 8, 3, 1, VasEBoot_ERR_NONE); + strtoull_testcase ("7", 8, 7, 1, VasEBoot_ERR_NONE); + strtoull_testcase ("1]", 16, 1, 1, VasEBoot_ERR_NONE); + strtoull_testcase ("18446744073709551616", 10, 0, 0, VasEBoot_ERR_OUT_OF_RANGE); } -GRUB_FUNCTIONAL_TEST (strtoull_test, strtoull_test); +VasEBoot_FUNCTIONAL_TEST (strtoull_test, strtoull_test); diff --git a/VasEBoot-core/tests/test_blockarg.c b/VasEBoot-core/tests/test_blockarg.c index 88bd968f3..9bb86a71b 100644 --- a/VasEBoot-core/tests/test_blockarg.c +++ b/VasEBoot-core/tests/test_blockarg.c @@ -1,55 +1,55 @@ /* test_blockarg.c - print and execute block argument */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_err_t -test_blockarg (grub_extcmd_context_t ctxt, int argc, char **args) +static VasEBoot_err_t +test_blockarg (VasEBoot_extcmd_context_t ctxt, int argc, char **args) { if (! ctxt->script) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no block parameter"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "no block parameter"); - grub_printf ("%s\n", args[argc - 1]); - grub_script_execute (ctxt->script); - return GRUB_ERR_NONE; + VasEBoot_printf ("%s\n", args[argc - 1]); + VasEBoot_script_execute (ctxt->script); + return VasEBoot_ERR_NONE; } -static grub_extcmd_t cmd; +static VasEBoot_extcmd_t cmd; -GRUB_MOD_INIT(test_blockarg) +VasEBoot_MOD_INIT(test_blockarg) { - cmd = grub_register_extcmd ("test_blockarg", test_blockarg, - GRUB_COMMAND_FLAG_BLOCKS, + cmd = VasEBoot_register_extcmd ("test_blockarg", test_blockarg, + VasEBoot_COMMAND_FLAG_BLOCKS, N_("BLOCK"), /* TRANSLATORS: this is the BLOCK-argument, not environment block. */ N_("Print and execute block argument."), 0); } -GRUB_MOD_FINI(test_blockarg) +VasEBoot_MOD_FINI(test_blockarg) { - grub_unregister_extcmd (cmd); + VasEBoot_unregister_extcmd (cmd); } diff --git a/VasEBoot-core/tests/video_checksum.c b/VasEBoot-core/tests/video_checksum.c index 74d5b65e5..3443bf86d 100644 --- a/VasEBoot-core/tests/video_checksum.c +++ b/VasEBoot-core/tests/video_checksum.c @@ -1,122 +1,122 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -/* All tests need to include test.h for GRUB testing framework. */ +/* All tests need to include test.h for VasEBoot testing framework. */ #include -#include -#include -#include -#include -#include -#include -#ifdef GRUB_MACHINE_EMU -#include -#include +#include +#include +#include +#include +#include +#include +#ifdef VasEBoot_MACHINE_EMU +#include +#include #endif -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static int ctr; static int nchk; static char *basename; -static const grub_uint32_t *checksums; -static struct grub_video_mode_info capt_mode_info; +static const VasEBoot_uint32_t *checksums; +static struct VasEBoot_video_mode_info capt_mode_info; -struct grub_video_mode_info grub_test_video_modes[GRUB_TEST_VIDEO_ALL_N_MODES] = { +struct VasEBoot_video_mode_info VasEBoot_test_video_modes[VasEBoot_TEST_VIDEO_ALL_N_MODES] = { { .width = 640, .height = 480, .pitch = 640, - .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, + .mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, .bpp = 8, .bytes_per_pixel = 1, - .number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS + .number_of_colors = VasEBoot_VIDEO_FBSTD_NUMCOLORS }, { .width = 800, .height = 600, .pitch = 800, - .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, + .mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, .bpp = 8, .bytes_per_pixel = 1, - .number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS + .number_of_colors = VasEBoot_VIDEO_FBSTD_NUMCOLORS }, { .width = 1024, .height = 768, .pitch = 1024, - .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, + .mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, .bpp = 8, .bytes_per_pixel = 1, - .number_of_colors = GRUB_VIDEO_FBSTD_NUMCOLORS + .number_of_colors = VasEBoot_VIDEO_FBSTD_NUMCOLORS }, { .width = 640, .height = 480, .pitch = 640 * 4, - GRUB_VIDEO_MI_RGBA8888() + VasEBoot_VIDEO_MI_RGBA8888() }, { .width = 800, .height = 600, .pitch = 800 * 4, - GRUB_VIDEO_MI_RGBA8888() + VasEBoot_VIDEO_MI_RGBA8888() }, { .width = 1024, .height = 768, .pitch = 1024 * 4, - GRUB_VIDEO_MI_RGBA8888() + VasEBoot_VIDEO_MI_RGBA8888() }, { .width = 2560, .height = 1440, .pitch = 2560 * 4, - GRUB_VIDEO_MI_RGBA8888() + VasEBoot_VIDEO_MI_RGBA8888() }, { .width = 640, .height = 480, .pitch = 640, - .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, + .mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, .bpp = 8, .bytes_per_pixel = 1, - .number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS + .number_of_colors = VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS }, { .width = 800, .height = 600, .pitch = 800, - .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, + .mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, .bpp = 8, .bytes_per_pixel = 1, - .number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS + .number_of_colors = VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS }, { .width = 1024, .height = 768, .pitch = 1024, - .mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, + .mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, .bpp = 8, .bytes_per_pixel = 1, - .number_of_colors = GRUB_VIDEO_FBSTD_EXT_NUMCOLORS + .number_of_colors = VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS }, @@ -126,206 +126,206 @@ struct grub_video_mode_info grub_test_video_modes[GRUB_TEST_VIDEO_ALL_N_MODES] = .width = 640, .height = 480, .pitch = 1280, - GRUB_VIDEO_MI_RGB555 () + VasEBoot_VIDEO_MI_RGB555 () }, { .width = 800, .height = 600, .pitch = 1600, - GRUB_VIDEO_MI_RGB555 () + VasEBoot_VIDEO_MI_RGB555 () }, { .width = 1024, .height = 768, .pitch = 2048, - GRUB_VIDEO_MI_RGB555 () + VasEBoot_VIDEO_MI_RGB555 () }, { .width = 640, .height = 480, .pitch = 1280, - GRUB_VIDEO_MI_RGB565 () + VasEBoot_VIDEO_MI_RGB565 () }, { .width = 800, .height = 600, .pitch = 1600, - GRUB_VIDEO_MI_RGB565 () + VasEBoot_VIDEO_MI_RGB565 () }, { .width = 1024, .height = 768, .pitch = 2048, - GRUB_VIDEO_MI_RGB565 () + VasEBoot_VIDEO_MI_RGB565 () }, { .width = 640, .height = 480, .pitch = 640 * 3, - GRUB_VIDEO_MI_RGB888 () + VasEBoot_VIDEO_MI_RGB888 () }, { .width = 800, .height = 600, .pitch = 800 * 3, - GRUB_VIDEO_MI_RGB888 () + VasEBoot_VIDEO_MI_RGB888 () }, { .width = 1024, .height = 768, .pitch = 1024 * 3, - GRUB_VIDEO_MI_RGB888 () + VasEBoot_VIDEO_MI_RGB888 () }, { .width = 640, .height = 480, .pitch = 1280, - GRUB_VIDEO_MI_BGR555 () + VasEBoot_VIDEO_MI_BGR555 () }, { .width = 800, .height = 600, .pitch = 1600, - GRUB_VIDEO_MI_BGR555 () + VasEBoot_VIDEO_MI_BGR555 () }, { .width = 1024, .height = 768, .pitch = 2048, - GRUB_VIDEO_MI_BGR555 () + VasEBoot_VIDEO_MI_BGR555 () }, { .width = 640, .height = 480, .pitch = 1280, - GRUB_VIDEO_MI_BGR565 () + VasEBoot_VIDEO_MI_BGR565 () }, { .width = 800, .height = 600, .pitch = 1600, - GRUB_VIDEO_MI_BGR565 () + VasEBoot_VIDEO_MI_BGR565 () }, { .width = 1024, .height = 768, .pitch = 2048, - GRUB_VIDEO_MI_BGR565 () + VasEBoot_VIDEO_MI_BGR565 () }, { .width = 640, .height = 480, .pitch = 640 * 3, - GRUB_VIDEO_MI_BGR888 () + VasEBoot_VIDEO_MI_BGR888 () }, { .width = 800, .height = 600, .pitch = 800 * 3, - GRUB_VIDEO_MI_BGR888 () + VasEBoot_VIDEO_MI_BGR888 () }, { .width = 1024, .height = 768, .pitch = 1024 * 3, - GRUB_VIDEO_MI_BGR888 () + VasEBoot_VIDEO_MI_BGR888 () }, { .width = 640, .height = 480, .pitch = 640 * 4, - GRUB_VIDEO_MI_BGRA8888() + VasEBoot_VIDEO_MI_BGRA8888() }, { .width = 800, .height = 600, .pitch = 800 * 4, - GRUB_VIDEO_MI_BGRA8888() + VasEBoot_VIDEO_MI_BGRA8888() }, { .width = 1024, .height = 768, .pitch = 1024 * 4, - GRUB_VIDEO_MI_BGRA8888() + VasEBoot_VIDEO_MI_BGRA8888() }, }; -#ifdef GRUB_MACHINE_EMU -#include +#ifdef VasEBoot_MACHINE_EMU +#include struct bmp_header { - grub_uint8_t magic[2]; - grub_uint32_t filesize; - grub_uint32_t reserved; - grub_uint32_t bmp_off; - grub_uint32_t head_size; - grub_uint16_t width; - grub_uint16_t height; - grub_uint16_t planes; - grub_uint16_t bpp; -} GRUB_PACKED; + VasEBoot_uint8_t magic[2]; + VasEBoot_uint32_t filesize; + VasEBoot_uint32_t reserved; + VasEBoot_uint32_t bmp_off; + VasEBoot_uint32_t head_size; + VasEBoot_uint16_t width; + VasEBoot_uint16_t height; + VasEBoot_uint16_t planes; + VasEBoot_uint16_t bpp; +} VasEBoot_PACKED; static void -grub_video_capture_write_bmp (const char *fname, +VasEBoot_video_capture_write_bmp (const char *fname, void *ptr, - const struct grub_video_mode_info *mode_info) + const struct VasEBoot_video_mode_info *mode_info) { - grub_util_fd_t fd = grub_util_fd_open (fname, GRUB_UTIL_FD_O_WRONLY | GRUB_UTIL_FD_O_CREATTRUNC); + VasEBoot_util_fd_t fd = VasEBoot_util_fd_open (fname, VasEBoot_UTIL_FD_O_WRONLY | VasEBoot_UTIL_FD_O_CREATTRUNC); struct bmp_header head; - if (!GRUB_UTIL_FD_IS_VALID (fd)) + if (!VasEBoot_UTIL_FD_IS_VALID (fd)) { - grub_printf (_("cannot open `%s': %s"), - fname, grub_util_fd_strerror ()); + VasEBoot_printf (_("cannot open `%s': %s"), + fname, VasEBoot_util_fd_strerror ()); } - grub_memset (&head, 0, sizeof (head)); + VasEBoot_memset (&head, 0, sizeof (head)); head.magic[0] = 'B'; head.magic[1] = 'M'; - if (mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_RGB) + if (mode_info->mode_type & VasEBoot_VIDEO_MODE_TYPE_RGB) { - head.filesize = grub_cpu_to_le32 (sizeof (head) + mode_info->width * mode_info->height * 3); - head.bmp_off = grub_cpu_to_le32_compile_time (sizeof (head)); - head.bpp = grub_cpu_to_le16_compile_time (24); + head.filesize = VasEBoot_cpu_to_le32 (sizeof (head) + mode_info->width * mode_info->height * 3); + head.bmp_off = VasEBoot_cpu_to_le32_compile_time (sizeof (head)); + head.bpp = VasEBoot_cpu_to_le16_compile_time (24); } else { - head.filesize = grub_cpu_to_le32 (sizeof (head) + 3 * 256 + mode_info->width * mode_info->height); - head.bmp_off = grub_cpu_to_le32_compile_time (sizeof (head) + 3 * 256); - head.bpp = grub_cpu_to_le16_compile_time (8); + head.filesize = VasEBoot_cpu_to_le32 (sizeof (head) + 3 * 256 + mode_info->width * mode_info->height); + head.bmp_off = VasEBoot_cpu_to_le32_compile_time (sizeof (head) + 3 * 256); + head.bpp = VasEBoot_cpu_to_le16_compile_time (8); } - head.head_size = grub_cpu_to_le32_compile_time (sizeof (head) - 14); - head.width = grub_cpu_to_le16 (mode_info->width); - head.height = grub_cpu_to_le16 (mode_info->height); - head.planes = grub_cpu_to_le16_compile_time (1); + head.head_size = VasEBoot_cpu_to_le32_compile_time (sizeof (head) - 14); + head.width = VasEBoot_cpu_to_le16 (mode_info->width); + head.height = VasEBoot_cpu_to_le16 (mode_info->height); + head.planes = VasEBoot_cpu_to_le16_compile_time (1); - head.width = grub_cpu_to_le16 (mode_info->width); - head.height = grub_cpu_to_le16 (mode_info->height); + head.width = VasEBoot_cpu_to_le16 (mode_info->width); + head.height = VasEBoot_cpu_to_le16 (mode_info->height); - grub_util_fd_write (fd, (char *) &head, sizeof (head)); + VasEBoot_util_fd_write (fd, (char *) &head, sizeof (head)); - if (!(mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_RGB)) + if (!(mode_info->mode_type & VasEBoot_VIDEO_MODE_TYPE_RGB)) { - struct grub_video_palette_data palette_data[256]; + struct VasEBoot_video_palette_data palette_data[256]; int i; int palette_len = mode_info->number_of_colors; - grub_memset (palette_data, 0, sizeof (palette_data)); + VasEBoot_memset (palette_data, 0, sizeof (palette_data)); if (palette_len > 256) palette_len = 256; - grub_video_get_palette (0, palette_len, palette_data); + VasEBoot_video_get_palette (0, palette_len, palette_data); for (i = 0; i < 256; i++) { - grub_uint8_t r, g, b; + VasEBoot_uint8_t r, g, b; r = palette_data[i].r; g = palette_data[i].g; b = palette_data[i].b; - grub_util_fd_write (fd, (char *) &b, 1); - grub_util_fd_write (fd, (char *) &g, 1); - grub_util_fd_write (fd, (char *) &r, 1); + VasEBoot_util_fd_write (fd, (char *) &b, 1); + VasEBoot_util_fd_write (fd, (char *) &g, 1); + VasEBoot_util_fd_write (fd, (char *) &r, 1); } } @@ -336,10 +336,10 @@ grub_video_capture_write_bmp (const char *fname, { case 4: { - grub_uint8_t *buffer = xmalloc (mode_info->width * 3); - grub_uint32_t rmask = ((1 << mode_info->red_mask_size) - 1); - grub_uint32_t gmask = ((1 << mode_info->green_mask_size) - 1); - grub_uint32_t bmask = ((1 << mode_info->blue_mask_size) - 1); + VasEBoot_uint8_t *buffer = xmalloc (mode_info->width * 3); + VasEBoot_uint32_t rmask = ((1 << mode_info->red_mask_size) - 1); + VasEBoot_uint32_t gmask = ((1 << mode_info->green_mask_size) - 1); + VasEBoot_uint32_t bmask = ((1 << mode_info->blue_mask_size) - 1); int rshift = mode_info->red_field_pos; int gshift = mode_info->green_field_pos; int bshift = mode_info->blue_field_pos; @@ -350,27 +350,27 @@ grub_video_capture_write_bmp (const char *fname, for (y = mode_info->height - 1; y >= 0; y--) { - grub_uint32_t *iptr = (grub_uint32_t *) ptr + (mode_info->pitch / 4) * y; + VasEBoot_uint32_t *iptr = (VasEBoot_uint32_t *) ptr + (mode_info->pitch / 4) * y; int x; - grub_uint8_t *optr = buffer; + VasEBoot_uint8_t *optr = buffer; for (x = 0; x < (int) mode_info->width; x++) { - grub_uint32_t val = *iptr++; + VasEBoot_uint32_t val = *iptr++; *optr++ = ((val >> bshift) & bmask) << mulbshift; *optr++ = ((val >> gshift) & gmask) << mulgshift; *optr++ = ((val >> rshift) & rmask) << mulrshift; } - grub_util_fd_write (fd, (char *) buffer, mode_info->width * 3); + VasEBoot_util_fd_write (fd, (char *) buffer, mode_info->width * 3); } - grub_free (buffer); + VasEBoot_free (buffer); break; } case 3: { - grub_uint8_t *buffer = xmalloc (mode_info->width * 3); - grub_uint32_t rmask = ((1 << mode_info->red_mask_size) - 1); - grub_uint32_t gmask = ((1 << mode_info->green_mask_size) - 1); - grub_uint32_t bmask = ((1 << mode_info->blue_mask_size) - 1); + VasEBoot_uint8_t *buffer = xmalloc (mode_info->width * 3); + VasEBoot_uint32_t rmask = ((1 << mode_info->red_mask_size) - 1); + VasEBoot_uint32_t gmask = ((1 << mode_info->green_mask_size) - 1); + VasEBoot_uint32_t bmask = ((1 << mode_info->blue_mask_size) - 1); int rshift = mode_info->red_field_pos; int gshift = mode_info->green_field_pos; int bshift = mode_info->blue_field_pos; @@ -381,13 +381,13 @@ grub_video_capture_write_bmp (const char *fname, for (y = mode_info->height - 1; y >= 0; y--) { - grub_uint8_t *iptr = ((grub_uint8_t *) ptr + mode_info->pitch * y); + VasEBoot_uint8_t *iptr = ((VasEBoot_uint8_t *) ptr + mode_info->pitch * y); int x; - grub_uint8_t *optr = buffer; + VasEBoot_uint8_t *optr = buffer; for (x = 0; x < (int) mode_info->width; x++) { - grub_uint32_t val = 0; -#ifdef GRUB_CPU_WORDS_BIGENDIAN + VasEBoot_uint32_t val = 0; +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN val |= *iptr++ << 16; val |= *iptr++ << 8; val |= *iptr++; @@ -400,17 +400,17 @@ grub_video_capture_write_bmp (const char *fname, *optr++ = ((val >> gshift) & gmask) << mulgshift; *optr++ = ((val >> rshift) & rmask) << mulrshift; } - grub_util_fd_write (fd, (char *) buffer, mode_info->width * 3); + VasEBoot_util_fd_write (fd, (char *) buffer, mode_info->width * 3); } - grub_free (buffer); + VasEBoot_free (buffer); break; } case 2: { - grub_uint8_t *buffer = xmalloc (mode_info->width * 3); - grub_uint16_t rmask = ((1 << mode_info->red_mask_size) - 1); - grub_uint16_t gmask = ((1 << mode_info->green_mask_size) - 1); - grub_uint16_t bmask = ((1 << mode_info->blue_mask_size) - 1); + VasEBoot_uint8_t *buffer = xmalloc (mode_info->width * 3); + VasEBoot_uint16_t rmask = ((1 << mode_info->red_mask_size) - 1); + VasEBoot_uint16_t gmask = ((1 << mode_info->green_mask_size) - 1); + VasEBoot_uint16_t bmask = ((1 << mode_info->blue_mask_size) - 1); int rshift = mode_info->red_field_pos; int gshift = mode_info->green_field_pos; int bshift = mode_info->blue_field_pos; @@ -421,19 +421,19 @@ grub_video_capture_write_bmp (const char *fname, for (y = mode_info->height - 1; y >= 0; y--) { - grub_uint16_t *iptr = (grub_uint16_t *) ptr + (mode_info->pitch / 2) * y; + VasEBoot_uint16_t *iptr = (VasEBoot_uint16_t *) ptr + (mode_info->pitch / 2) * y; int x; - grub_uint8_t *optr = buffer; + VasEBoot_uint8_t *optr = buffer; for (x = 0; x < (int) mode_info->width; x++) { - grub_uint16_t val = *iptr++; + VasEBoot_uint16_t val = *iptr++; *optr++ = ((val >> bshift) & bmask) << mulbshift; *optr++ = ((val >> gshift) & gmask) << mulgshift; *optr++ = ((val >> rshift) & rmask) << mulrshift; } - grub_util_fd_write (fd, (char *) buffer, mode_info->width * 3); + VasEBoot_util_fd_write (fd, (char *) buffer, mode_info->width * 3); } - grub_free (buffer); + VasEBoot_free (buffer); break; } case 1: @@ -441,34 +441,34 @@ grub_video_capture_write_bmp (const char *fname, int y; for (y = mode_info->height - 1; y >= 0; y--) - grub_util_fd_write (fd, ((char *) ptr + mode_info->pitch * y), + VasEBoot_util_fd_write (fd, ((char *) ptr + mode_info->pitch * y), mode_info->width); break; } } - grub_util_fd_close (fd); + VasEBoot_util_fd_close (fd); } #endif const char * -grub_video_checksum_get_modename (void) +VasEBoot_video_checksum_get_modename (void) { static char buf[40]; - if (capt_mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (capt_mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) { - grub_snprintf (buf, sizeof (buf), "i%d", capt_mode_info.number_of_colors); + VasEBoot_snprintf (buf, sizeof (buf), "i%d", capt_mode_info.number_of_colors); return buf; } if (capt_mode_info.red_field_pos == 0) { - grub_snprintf (buf, sizeof (buf), "bgra%d%d%d%d", capt_mode_info.blue_mask_size, + VasEBoot_snprintf (buf, sizeof (buf), "bgra%d%d%d%d", capt_mode_info.blue_mask_size, capt_mode_info.green_mask_size, capt_mode_info.red_mask_size, capt_mode_info.reserved_mask_size); return buf; } - grub_snprintf (buf, sizeof (buf), "rgba%d%d%d%d", capt_mode_info.red_mask_size, + VasEBoot_snprintf (buf, sizeof (buf), "rgba%d%d%d%d", capt_mode_info.red_mask_size, capt_mode_info.green_mask_size, capt_mode_info.blue_mask_size, capt_mode_info.reserved_mask_size); @@ -479,34 +479,34 @@ grub_video_checksum_get_modename (void) //#define SAVE_ALL_IMAGES //#define COLLECT_TIME_STATISTICS 1 -#if defined (GENERATE_MODE) && defined (GRUB_MACHINE_EMU) -grub_util_fd_t genfd = GRUB_UTIL_FD_INVALID; +#if defined (GENERATE_MODE) && defined (VasEBoot_MACHINE_EMU) +VasEBoot_util_fd_t genfd = VasEBoot_UTIL_FD_INVALID; #endif -#include +#include static void write_time (void) { -#if defined (GRUB_MACHINE_EMU) && defined (COLLECT_TIME_STATISTICS) +#if defined (VasEBoot_MACHINE_EMU) && defined (COLLECT_TIME_STATISTICS) char buf[60]; - static grub_uint64_t prev; - grub_uint64_t cur; - static grub_util_fd_t tmrfd = GRUB_UTIL_FD_INVALID; - if (!GRUB_UTIL_FD_IS_VALID (tmrfd)) - tmrfd = grub_util_fd_open ("time.txt", GRUB_UTIL_FD_O_WRONLY - | GRUB_UTIL_FD_O_CREATTRUNC); + static VasEBoot_uint64_t prev; + VasEBoot_uint64_t cur; + static VasEBoot_util_fd_t tmrfd = VasEBoot_UTIL_FD_INVALID; + if (!VasEBoot_UTIL_FD_IS_VALID (tmrfd)) + tmrfd = VasEBoot_util_fd_open ("time.txt", VasEBoot_UTIL_FD_O_WRONLY + | VasEBoot_UTIL_FD_O_CREATTRUNC); - cur = grub_util_get_cpu_time_ms (); - grub_snprintf (buf, sizeof (buf), "%s_%dx%dx%s:%d: %" PRIuGRUB_UINT64_T " ms\n", + cur = VasEBoot_util_get_cpu_time_ms (); + VasEBoot_snprintf (buf, sizeof (buf), "%s_%dx%dx%s:%d: %" PRIuVasEBoot_UINT64_T " ms\n", basename, capt_mode_info.width, capt_mode_info.height, - grub_video_checksum_get_modename (), ctr, + VasEBoot_video_checksum_get_modename (), ctr, cur - prev); prev = cur; - if (GRUB_UTIL_FD_IS_VALID (tmrfd)) - grub_util_fd_write (tmrfd, buf, grub_strlen (buf)); + if (VasEBoot_UTIL_FD_IS_VALID (tmrfd)) + VasEBoot_util_fd_write (tmrfd, buf, VasEBoot_strlen (buf)); #endif } @@ -515,34 +515,34 @@ static void checksum (void) { void *ptr; - grub_uint32_t crc = 0; + VasEBoot_uint32_t crc = 0; - ptr = grub_video_capture_get_framebuffer (); + ptr = VasEBoot_video_capture_get_framebuffer (); write_time (); -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN switch (capt_mode_info.bytes_per_pixel) { case 1: - crc = grub_getcrc32c (0, ptr, capt_mode_info.pitch + crc = VasEBoot_getcrc32c (0, ptr, capt_mode_info.pitch * capt_mode_info.height); break; case 2: { unsigned x, y, rowskip; - grub_uint8_t *iptr = ptr; + VasEBoot_uint8_t *iptr = ptr; crc = 0; rowskip = capt_mode_info.pitch - capt_mode_info.width * 2; for (y = 0; y < capt_mode_info.height; y++) { for (x = 0; x < capt_mode_info.width; x++) { - crc = grub_getcrc32c (crc, iptr + 1, 1); - crc = grub_getcrc32c (crc, iptr, 1); + crc = VasEBoot_getcrc32c (crc, iptr + 1, 1); + crc = VasEBoot_getcrc32c (crc, iptr, 1); iptr += 2; } - crc = grub_getcrc32c (crc, iptr, rowskip); + crc = VasEBoot_getcrc32c (crc, iptr, rowskip); iptr += rowskip; } break; @@ -550,19 +550,19 @@ checksum (void) case 3: { unsigned x, y, rowskip; - grub_uint8_t *iptr = ptr; + VasEBoot_uint8_t *iptr = ptr; crc = 0; rowskip = capt_mode_info.pitch - capt_mode_info.width * 3; for (y = 0; y < capt_mode_info.height; y++) { for (x = 0; x < capt_mode_info.width; x++) { - crc = grub_getcrc32c (crc, iptr + 2, 1); - crc = grub_getcrc32c (crc, iptr + 1, 1); - crc = grub_getcrc32c (crc, iptr, 1); + crc = VasEBoot_getcrc32c (crc, iptr + 2, 1); + crc = VasEBoot_getcrc32c (crc, iptr + 1, 1); + crc = VasEBoot_getcrc32c (crc, iptr, 1); iptr += 3; } - crc = grub_getcrc32c (crc, iptr, rowskip); + crc = VasEBoot_getcrc32c (crc, iptr, rowskip); iptr += rowskip; } break; @@ -570,56 +570,56 @@ checksum (void) case 4: { unsigned x, y, rowskip; - grub_uint8_t *iptr = ptr; + VasEBoot_uint8_t *iptr = ptr; crc = 0; rowskip = capt_mode_info.pitch - capt_mode_info.width * 4; for (y = 0; y < capt_mode_info.height; y++) { for (x = 0; x < capt_mode_info.width; x++) { - crc = grub_getcrc32c (crc, iptr + 3, 1); - crc = grub_getcrc32c (crc, iptr + 2, 1); - crc = grub_getcrc32c (crc, iptr + 1, 1); - crc = grub_getcrc32c (crc, iptr, 1); + crc = VasEBoot_getcrc32c (crc, iptr + 3, 1); + crc = VasEBoot_getcrc32c (crc, iptr + 2, 1); + crc = VasEBoot_getcrc32c (crc, iptr + 1, 1); + crc = VasEBoot_getcrc32c (crc, iptr, 1); iptr += 4; } - crc = grub_getcrc32c (crc, iptr, rowskip); + crc = VasEBoot_getcrc32c (crc, iptr, rowskip); iptr += rowskip; } break; } } #else - crc = grub_getcrc32c (0, ptr, capt_mode_info.pitch * capt_mode_info.height); + crc = VasEBoot_getcrc32c (0, ptr, capt_mode_info.pitch * capt_mode_info.height); #endif -#if defined (GENERATE_MODE) && defined (GRUB_MACHINE_EMU) - if (GRUB_UTIL_FD_IS_VALID (genfd)) +#if defined (GENERATE_MODE) && defined (VasEBoot_MACHINE_EMU) + if (VasEBoot_UTIL_FD_IS_VALID (genfd)) { char buf[20]; - grub_snprintf (buf, sizeof (buf), "0x%x, ", crc); - grub_util_fd_write (genfd, buf, grub_strlen (buf)); + VasEBoot_snprintf (buf, sizeof (buf), "0x%x, ", crc); + VasEBoot_util_fd_write (genfd, buf, VasEBoot_strlen (buf)); } #endif if (!checksums || ctr >= nchk) { - grub_test_assert (0, "Unexpected checksum %s_%dx%dx%s:%d: 0x%x", + VasEBoot_test_assert (0, "Unexpected checksum %s_%dx%dx%s:%d: 0x%x", basename, capt_mode_info.width, capt_mode_info.height, - grub_video_checksum_get_modename (), ctr, crc); + VasEBoot_video_checksum_get_modename (), ctr, crc); } else if (crc != checksums[ctr]) { - grub_test_assert (0, "Checksum %s_%dx%dx%s:%d failed: 0x%x vs 0x%x", + VasEBoot_test_assert (0, "Checksum %s_%dx%dx%s:%d failed: 0x%x vs 0x%x", basename, capt_mode_info.width, capt_mode_info.height, - grub_video_checksum_get_modename (), + VasEBoot_video_checksum_get_modename (), ctr, crc, checksums[ctr]); } -#if !(defined (SAVE_ALL_IMAGES) && defined (GRUB_MACHINE_EMU)) +#if !(defined (SAVE_ALL_IMAGES) && defined (VasEBoot_MACHINE_EMU)) else { write_time (); @@ -627,14 +627,14 @@ checksum (void) return; } #endif -#ifdef GRUB_MACHINE_EMU - char *name = grub_xasprintf ("%s_%dx%dx%s_%d.bmp", basename, +#ifdef VasEBoot_MACHINE_EMU + char *name = VasEBoot_xasprintf ("%s_%dx%dx%s_%d.bmp", basename, capt_mode_info.width, capt_mode_info.height, - grub_video_checksum_get_modename (), + VasEBoot_video_checksum_get_modename (), ctr); - grub_video_capture_write_bmp (name, ptr, &capt_mode_info); - grub_free (name); + VasEBoot_video_capture_write_bmp (name, ptr, &capt_mode_info); + VasEBoot_free (name); #endif write_time (); @@ -659,7 +659,7 @@ struct checksum_desc unsigned blue_mask_size; unsigned reserved_field_pos; unsigned reserved_mask_size; - const grub_uint32_t *checksums; + const VasEBoot_uint32_t *checksums; int nchk; }; @@ -668,21 +668,21 @@ const struct checksum_desc checksum_table[] = { }; void -grub_video_checksum (const char *basename_in) +VasEBoot_video_checksum (const char *basename_in) { unsigned i; - grub_video_get_info (&capt_mode_info); + VasEBoot_video_get_info (&capt_mode_info); -#if defined (GENERATE_MODE) && defined (GRUB_MACHINE_EMU) - if (!GRUB_UTIL_FD_IS_VALID (genfd)) - genfd = grub_util_fd_open ("checksums.h", GRUB_UTIL_FD_O_WRONLY - | GRUB_UTIL_FD_O_CREATTRUNC); - if (GRUB_UTIL_FD_IS_VALID (genfd)) +#if defined (GENERATE_MODE) && defined (VasEBoot_MACHINE_EMU) + if (!VasEBoot_UTIL_FD_IS_VALID (genfd)) + genfd = VasEBoot_util_fd_open ("checksums.h", VasEBoot_UTIL_FD_O_WRONLY + | VasEBoot_UTIL_FD_O_CREATTRUNC); + if (VasEBoot_UTIL_FD_IS_VALID (genfd)) { char buf[400]; - grub_snprintf (buf, sizeof (buf), "\", %d, %d, 0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d /* %dx%dx%s */, (grub_uint32_t []) { ", + VasEBoot_snprintf (buf, sizeof (buf), "\", %d, %d, 0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d /* %dx%dx%s */, (VasEBoot_uint32_t []) { ", capt_mode_info.width, capt_mode_info.height, capt_mode_info.mode_type, @@ -699,20 +699,20 @@ grub_video_checksum (const char *basename_in) capt_mode_info.reserved_mask_size, capt_mode_info.width, capt_mode_info.height, - grub_video_checksum_get_modename ()); + VasEBoot_video_checksum_get_modename ()); - grub_util_fd_write (genfd, " { \"", 5); - grub_util_fd_write (genfd, basename_in, grub_strlen (basename_in)); - grub_util_fd_write (genfd, buf, grub_strlen (buf)); + VasEBoot_util_fd_write (genfd, " { \"", 5); + VasEBoot_util_fd_write (genfd, basename_in, VasEBoot_strlen (basename_in)); + VasEBoot_util_fd_write (genfd, buf, VasEBoot_strlen (buf)); } #endif - basename = grub_strdup (basename_in); + basename = VasEBoot_strdup (basename_in); nchk = 0; checksums = 0; /* FIXME: optimize this. */ for (i = 0; i < ARRAY_SIZE (checksum_table); i++) - if (grub_strcmp (checksum_table[i].name, basename_in) == 0 + if (VasEBoot_strcmp (checksum_table[i].name, basename_in) == 0 && capt_mode_info.width == checksum_table[i].width && capt_mode_info.height == checksum_table[i].height && capt_mode_info.mode_type == checksum_table[i].mode_type @@ -734,65 +734,65 @@ grub_video_checksum (const char *basename_in) } ctr = 0; - grub_video_capture_refresh_cb = checksum; + VasEBoot_video_capture_refresh_cb = checksum; } void -grub_video_checksum_end (void) +VasEBoot_video_checksum_end (void) { -#if defined (GENERATE_MODE) && defined (GRUB_MACHINE_EMU) - if (GRUB_UTIL_FD_IS_VALID (genfd)) +#if defined (GENERATE_MODE) && defined (VasEBoot_MACHINE_EMU) + if (VasEBoot_UTIL_FD_IS_VALID (genfd)) { char buf[40]; - grub_snprintf (buf, sizeof (buf), "}, %d },\n", ctr); - grub_util_fd_write (genfd, buf, grub_strlen (buf)); + VasEBoot_snprintf (buf, sizeof (buf), "}, %d },\n", ctr); + VasEBoot_util_fd_write (genfd, buf, VasEBoot_strlen (buf)); } #endif - grub_test_assert (ctr == nchk, "Not enough checksums %s_%dx%dx%s: %d vs %d", + VasEBoot_test_assert (ctr == nchk, "Not enough checksums %s_%dx%dx%s: %d vs %d", basename, capt_mode_info.width, capt_mode_info.height, - grub_video_checksum_get_modename (), + VasEBoot_video_checksum_get_modename (), ctr, nchk); - grub_free (basename); + VasEBoot_free (basename); basename = 0; nchk = 0; checksums = 0; ctr = 0; - grub_video_capture_refresh_cb = 0; + VasEBoot_video_capture_refresh_cb = 0; } -static struct grub_term_output *saved_outputs; -static struct grub_term_output *saved_gfxnext; -static struct grub_term_output *gfxterm; +static struct VasEBoot_term_output *saved_outputs; +static struct VasEBoot_term_output *saved_gfxnext; +static struct VasEBoot_term_output *gfxterm; static int use_gfxterm = 0; int -grub_test_use_gfxterm (void) +VasEBoot_test_use_gfxterm (void) { FOR_ACTIVE_TERM_OUTPUTS (gfxterm) - if (grub_strcmp (gfxterm->name, "gfxterm") == 0) + if (VasEBoot_strcmp (gfxterm->name, "gfxterm") == 0) break; if (!gfxterm) FOR_DISABLED_TERM_OUTPUTS (gfxterm) - if (grub_strcmp (gfxterm->name, "gfxterm") == 0) + if (VasEBoot_strcmp (gfxterm->name, "gfxterm") == 0) break; if (!gfxterm) { - grub_test_assert (0, "terminal `%s' isn't found", "gfxterm"); + VasEBoot_test_assert (0, "terminal `%s' isn't found", "gfxterm"); return 1; } if (gfxterm->init (gfxterm)) { - grub_test_assert (0, "terminal `%s' failed: %s", "gfxterm", grub_errmsg); + VasEBoot_test_assert (0, "terminal `%s' failed: %s", "gfxterm", VasEBoot_errmsg); return 1; } - saved_outputs = grub_term_outputs; + saved_outputs = VasEBoot_term_outputs; saved_gfxnext = gfxterm->next; - grub_term_outputs = gfxterm; + VasEBoot_term_outputs = gfxterm; gfxterm->next = 0; use_gfxterm = 1; @@ -800,14 +800,14 @@ grub_test_use_gfxterm (void) } void -grub_test_use_gfxterm_end (void) +VasEBoot_test_use_gfxterm_end (void) { if (!use_gfxterm) return; use_gfxterm = 0; gfxterm->fini (gfxterm); gfxterm->next = saved_gfxnext; - grub_term_outputs = saved_outputs; + VasEBoot_term_outputs = saved_outputs; saved_outputs = 0; saved_gfxnext = 0; } diff --git a/VasEBoot-core/tests/videotest_checksum.c b/VasEBoot-core/tests/videotest_checksum.c index a4bff5ed8..6c003d00c 100644 --- a/VasEBoot-core/tests/videotest_checksum.c +++ b/VasEBoot-core/tests/videotest_checksum.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -/* All tests need to include test.h for GRUB testing framework. */ -#include -#include -#include -#include -#include -#include +/* All tests need to include test.h for VasEBoot testing framework. */ +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define FONT_NAME "Unknown Regular 16" @@ -33,48 +33,48 @@ static void videotest_checksum (void) { unsigned i; - grub_font_t font; + VasEBoot_font_t font; - font = grub_font_get (FONT_NAME); - if (font && grub_strcmp (font->name, FONT_NAME) != 0) + font = VasEBoot_font_get (FONT_NAME); + if (font && VasEBoot_strcmp (font->name, FONT_NAME) != 0) font = 0; if (!font) - font = grub_font_load ("unicode"); + font = VasEBoot_font_load ("unicode"); if (!font) { - grub_test_assert (0, "unicode font not found: %s", grub_errmsg); + VasEBoot_test_assert (0, "unicode font not found: %s", VasEBoot_errmsg); return; } - for (i = 0; i < ARRAY_SIZE (grub_test_video_modes); i++) + for (i = 0; i < ARRAY_SIZE (VasEBoot_test_video_modes); i++) { - grub_err_t err; -#if defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_IEEE1275) - if (grub_test_video_modes[i].width > 1024) + VasEBoot_err_t err; +#if defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) || defined (VasEBoot_MACHINE_IEEE1275) + if (VasEBoot_test_video_modes[i].width > 1024) continue; #endif - err = grub_video_capture_start (&grub_test_video_modes[i], - grub_video_fbstd_colors, - grub_test_video_modes[i].number_of_colors); + err = VasEBoot_video_capture_start (&VasEBoot_test_video_modes[i], + VasEBoot_video_fbstd_colors, + VasEBoot_test_video_modes[i].number_of_colors); if (err) { - grub_test_assert (0, "can't start capture: %s", grub_errmsg); - grub_print_error (); + VasEBoot_test_assert (0, "can't start capture: %s", VasEBoot_errmsg); + VasEBoot_print_error (); continue; } - grub_terminal_input_fake_sequence ((int []) { '\n' }, 1); + VasEBoot_terminal_input_fake_sequence ((int []) { '\n' }, 1); - grub_video_checksum ("videotest"); + VasEBoot_video_checksum ("videotest"); char *args[] = { 0 }; - grub_command_execute ("videotest", 0, args); + VasEBoot_command_execute ("videotest", 0, args); - grub_terminal_input_fake_sequence_end (); - grub_video_checksum_end (); - grub_video_capture_end (); + VasEBoot_terminal_input_fake_sequence_end (); + VasEBoot_video_checksum_end (); + VasEBoot_video_capture_end (); } } /* Register example_test method as a functional test. */ -GRUB_FUNCTIONAL_TEST (videotest_checksum, videotest_checksum); +VasEBoot_FUNCTIONAL_TEST (videotest_checksum, videotest_checksum); diff --git a/VasEBoot-core/tests/xnu_uuid_test.c b/VasEBoot-core/tests/xnu_uuid_test.c index d500145f9..646db6f04 100644 --- a/VasEBoot-core/tests/xnu_uuid_test.c +++ b/VasEBoot-core/tests/xnu_uuid_test.c @@ -1,58 +1,58 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static void xnu_uuid_test (void) { - grub_command_t cmd; - cmd = grub_command_find ("xnu_uuid"); + VasEBoot_command_t cmd; + cmd = VasEBoot_command_find ("xnu_uuid"); char *args[] = { (char *) "fedcba98", (char *) "tstvar", NULL }; const char *val; if (!cmd) { - grub_test_assert (0, "can't find command `%s'", "xnu_uuid"); + VasEBoot_test_assert (0, "can't find command `%s'", "xnu_uuid"); return; } if ((cmd->func) (cmd, 2, args)) { - grub_test_assert (0, "%d: %s", grub_errno, grub_errmsg); + VasEBoot_test_assert (0, "%d: %s", VasEBoot_errno, VasEBoot_errmsg); return; } - val = grub_env_get ("tstvar"); + val = VasEBoot_env_get ("tstvar"); if (!val) { - grub_test_assert (0, "tstvar isn't set"); + VasEBoot_test_assert (0, "tstvar isn't set"); return; } - grub_test_assert (grub_strcmp (val, "944F9DED-DBED-391C-9402-77C8CEE04173") + VasEBoot_test_assert (VasEBoot_strcmp (val, "944F9DED-DBED-391C-9402-77C8CEE04173") == 0, "UUIDs don't match"); } -GRUB_FUNCTIONAL_TEST (xnu_uuid_test, xnu_uuid_test); +VasEBoot_FUNCTIONAL_TEST (xnu_uuid_test, xnu_uuid_test); diff --git a/VasEBoot-core/video/bitmap.c b/VasEBoot-core/video/bitmap.c index b2e031566..2c145f8e4 100644 --- a/VasEBoot-core/video/bitmap.c +++ b/VasEBoot-core/video/bitmap.c @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* List of bitmap readers registered to system. */ -static grub_video_bitmap_reader_t bitmap_readers_list; +static VasEBoot_video_bitmap_reader_t bitmap_readers_list; /* Register bitmap reader. */ void -grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader) +VasEBoot_video_bitmap_reader_register (VasEBoot_video_bitmap_reader_t reader) { reader->next = bitmap_readers_list; bitmap_readers_list = reader; @@ -39,9 +39,9 @@ grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader) /* Unregister bitmap reader. */ void -grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader) +VasEBoot_video_bitmap_reader_unregister (VasEBoot_video_bitmap_reader_t reader) { - grub_video_bitmap_reader_t *p, q; + VasEBoot_video_bitmap_reader_t *p, q; for (p = &bitmap_readers_list, q = *p; q; p = &(q->next), q = q->next) if (q == reader) @@ -52,25 +52,25 @@ grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader) } /* Creates new bitmap, saves created bitmap on success to *bitmap. */ -grub_err_t -grub_video_bitmap_create (struct grub_video_bitmap **bitmap, +VasEBoot_err_t +VasEBoot_video_bitmap_create (struct VasEBoot_video_bitmap **bitmap, unsigned int width, unsigned int height, - enum grub_video_blit_format blit_format) + enum VasEBoot_video_blit_format blit_format) { - struct grub_video_mode_info *mode_info; + struct VasEBoot_video_mode_info *mode_info; unsigned int size; if (!bitmap) - return grub_error (GRUB_ERR_BUG, "invalid argument"); + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid argument"); *bitmap = 0; if (width == 0 || height == 0) - return grub_error (GRUB_ERR_BUG, "invalid argument"); + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid argument"); - *bitmap = (struct grub_video_bitmap *)grub_malloc (sizeof (struct grub_video_bitmap)); + *bitmap = (struct VasEBoot_video_bitmap *)VasEBoot_malloc (sizeof (struct VasEBoot_video_bitmap)); if (! *bitmap) - return grub_errno; + return VasEBoot_errno; mode_info = &((*bitmap)->mode_info); @@ -81,9 +81,9 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, switch (blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB - | GRUB_VIDEO_MODE_TYPE_ALPHA; + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: + mode_info->mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB + | VasEBoot_VIDEO_MODE_TYPE_ALPHA; mode_info->bpp = 32; mode_info->bytes_per_pixel = 4; mode_info->number_of_colors = 256; @@ -97,8 +97,8 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, mode_info->reserved_field_pos = 24; break; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: - mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: + mode_info->mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; mode_info->bpp = 24; mode_info->bytes_per_pixel = 3; mode_info->number_of_colors = 256; @@ -112,8 +112,8 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, mode_info->reserved_field_pos = 0; break; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: - mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: + mode_info->mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; mode_info->bpp = 8; mode_info->bytes_per_pixel = 1; mode_info->number_of_colors = 256; @@ -128,10 +128,10 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, break; default: - grub_free (*bitmap); + VasEBoot_free (*bitmap); *bitmap = 0; - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported bitmap format"); } @@ -140,29 +140,29 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, /* Calculate size needed for the data. */ size = (width * mode_info->bytes_per_pixel) * height; - (*bitmap)->data = grub_zalloc (size); + (*bitmap)->data = VasEBoot_zalloc (size); if (! (*bitmap)->data) { - grub_free (*bitmap); + VasEBoot_free (*bitmap); *bitmap = 0; - return grub_errno; + return VasEBoot_errno; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Frees all resources allocated by bitmap. */ -grub_err_t -grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap) +VasEBoot_err_t +VasEBoot_video_bitmap_destroy (struct VasEBoot_video_bitmap *bitmap) { if (! bitmap) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - grub_free (bitmap->data); - grub_free (bitmap); + VasEBoot_free (bitmap->data); + VasEBoot_free (bitmap); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Match extension to filename. */ @@ -172,26 +172,26 @@ match_extension (const char *filename, const char *ext) int pos; int ext_len; - pos = grub_strlen (filename); - ext_len = grub_strlen (ext); + pos = VasEBoot_strlen (filename); + ext_len = VasEBoot_strlen (ext); if (! pos || ! ext_len || ext_len > pos) return 0; pos -= ext_len; - return grub_strcasecmp (filename + pos, ext) == 0; + return VasEBoot_strcasecmp (filename + pos, ext) == 0; } /* Loads bitmap using registered bitmap readers. */ -grub_err_t -grub_video_bitmap_load (struct grub_video_bitmap **bitmap, +VasEBoot_err_t +VasEBoot_video_bitmap_load (struct VasEBoot_video_bitmap **bitmap, const char *filename) { - grub_video_bitmap_reader_t reader = bitmap_readers_list; + VasEBoot_video_bitmap_reader_t reader = bitmap_readers_list; if (!bitmap) - return grub_error (GRUB_ERR_BUG, "invalid argument"); + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid argument"); *bitmap = 0; @@ -203,7 +203,7 @@ grub_video_bitmap_load (struct grub_video_bitmap **bitmap, reader = reader->next; } - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, /* TRANSLATORS: We're speaking about bitmap images like JPEG or PNG. */ N_("bitmap file `%s' is of" @@ -211,8 +211,8 @@ grub_video_bitmap_load (struct grub_video_bitmap **bitmap, } /* Return mode info for bitmap. */ -void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap, - struct grub_video_mode_info *mode_info) +void VasEBoot_video_bitmap_get_mode_info (struct VasEBoot_video_bitmap *bitmap, + struct VasEBoot_video_mode_info *mode_info) { if (!bitmap) return; @@ -221,7 +221,7 @@ void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap, } /* Return pointer to bitmap's raw data. */ -void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap) +void *VasEBoot_video_bitmap_get_data (struct VasEBoot_video_bitmap *bitmap) { if (!bitmap) return 0; diff --git a/VasEBoot-core/video/bitmap_scale.c b/VasEBoot-core/video/bitmap_scale.c index 70c32f029..f701f5739 100644 --- a/VasEBoot-core/video/bitmap_scale.c +++ b/VasEBoot-core/video/bitmap_scale.c @@ -1,209 +1,209 @@ /* bitmap_scale.c - Bitmap scaling. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Prototypes for module-local functions. */ -static grub_err_t scale_nn (struct grub_video_bitmap *dst, - struct grub_video_bitmap *src); -static grub_err_t scale_bilinear (struct grub_video_bitmap *dst, - struct grub_video_bitmap *src); +static VasEBoot_err_t scale_nn (struct VasEBoot_video_bitmap *dst, + struct VasEBoot_video_bitmap *src); +static VasEBoot_err_t scale_bilinear (struct VasEBoot_video_bitmap *dst, + struct VasEBoot_video_bitmap *src); -static grub_err_t -verify_source_bitmap (struct grub_video_bitmap *src) +static VasEBoot_err_t +verify_source_bitmap (struct VasEBoot_video_bitmap *src) { /* Verify the simplifying assumptions. */ if (src == 0) - return grub_error (GRUB_ERR_BUG, - "null src bitmap in grub_video_bitmap_create_scaled"); + return VasEBoot_error (VasEBoot_ERR_BUG, + "null src bitmap in VasEBoot_video_bitmap_create_scaled"); if (src->mode_info.red_field_pos % 8 != 0 || src->mode_info.green_field_pos % 8 != 0 || src->mode_info.blue_field_pos % 8 != 0 || src->mode_info.reserved_field_pos % 8 != 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "src format not supported for scale"); if (src->mode_info.width == 0 || src->mode_info.height == 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "source bitmap has a zero dimension"); if (src->mode_info.bytes_per_pixel * 8 != src->mode_info.bpp) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "bitmap to scale has inconsistent Bpp and bpp"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_bitmap_scale (struct grub_video_bitmap *dst, - struct grub_video_bitmap *src, - enum grub_video_bitmap_scale_method scale_method) +static VasEBoot_err_t +VasEBoot_video_bitmap_scale (struct VasEBoot_video_bitmap *dst, + struct VasEBoot_video_bitmap *src, + enum VasEBoot_video_bitmap_scale_method scale_method) { switch (scale_method) { - case GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST: - case GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST: + case VasEBoot_VIDEO_BITMAP_SCALE_METHOD_FASTEST: + case VasEBoot_VIDEO_BITMAP_SCALE_METHOD_NEAREST: return scale_nn (dst, src); - case GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST: - case GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR: + case VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST: + case VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BILINEAR: return scale_bilinear (dst, src); default: - return grub_error (GRUB_ERR_BUG, "Invalid scale_method value"); + return VasEBoot_error (VasEBoot_ERR_BUG, "Invalid scale_method value"); } } /* This function creates a new scaled version of the bitmap SRC. The new bitmap has dimensions DST_WIDTH by DST_HEIGHT. The scaling algorithm is given by SCALE_METHOD. If an error is encountered, the return code is - not equal to GRUB_ERR_NONE, and the bitmap DST is either not created, or + not equal to VasEBoot_ERR_NONE, and the bitmap DST is either not created, or it is destroyed before this function returns. Supports only direct color modes which have components separated into bytes (e.g., RGBA 8:8:8:8 or BGR 8:8:8 true color). But because of this simplifying assumption, the implementation is greatly simplified. */ -grub_err_t -grub_video_bitmap_create_scaled (struct grub_video_bitmap **dst, +VasEBoot_err_t +VasEBoot_video_bitmap_create_scaled (struct VasEBoot_video_bitmap **dst, int dst_width, int dst_height, - struct grub_video_bitmap *src, - enum grub_video_bitmap_scale_method + struct VasEBoot_video_bitmap *src, + enum VasEBoot_video_bitmap_scale_method scale_method) { *dst = 0; - grub_err_t err = verify_source_bitmap(src); - if (err != GRUB_ERR_NONE) + VasEBoot_err_t err = verify_source_bitmap(src); + if (err != VasEBoot_ERR_NONE) return err; if (dst_width <= 0 || dst_height <= 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "requested to scale to a size w/ a zero dimension"); /* Create the new bitmap. */ - grub_err_t ret; - ret = grub_video_bitmap_create (dst, dst_width, dst_height, + VasEBoot_err_t ret; + ret = VasEBoot_video_bitmap_create (dst, dst_width, dst_height, src->mode_info.blit_format); - if (ret != GRUB_ERR_NONE) + if (ret != VasEBoot_ERR_NONE) return ret; /* Error. */ - ret = grub_video_bitmap_scale (*dst, src, scale_method); + ret = VasEBoot_video_bitmap_scale (*dst, src, scale_method); - if (ret == GRUB_ERR_NONE) + if (ret == VasEBoot_ERR_NONE) { /* Success: *dst is now a pointer to the scaled bitmap. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } else { /* Destroy the bitmap and return the error code. */ - grub_video_bitmap_destroy (*dst); + VasEBoot_video_bitmap_destroy (*dst); *dst = 0; return ret; } } -static grub_err_t +static VasEBoot_err_t make_h_align (unsigned *x, unsigned *w, unsigned new_w, - grub_video_bitmap_h_align_t h_align) + VasEBoot_video_bitmap_h_align_t h_align) { - grub_err_t ret = GRUB_ERR_NONE; + VasEBoot_err_t ret = VasEBoot_ERR_NONE; if (new_w >= *w) { *x = 0; *w = new_w; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } switch (h_align) { - case GRUB_VIDEO_BITMAP_H_ALIGN_LEFT: + case VasEBoot_VIDEO_BITMAP_H_ALIGN_LEFT: *x = 0; break; - case GRUB_VIDEO_BITMAP_H_ALIGN_CENTER: + case VasEBoot_VIDEO_BITMAP_H_ALIGN_CENTER: *x = (*w - new_w) / 2; break; - case GRUB_VIDEO_BITMAP_H_ALIGN_RIGHT: + case VasEBoot_VIDEO_BITMAP_H_ALIGN_RIGHT: *x = *w - new_w; break; default: - ret = grub_error (GRUB_ERR_BUG, "Invalid h_align value"); + ret = VasEBoot_error (VasEBoot_ERR_BUG, "Invalid h_align value"); break; } *w = new_w; return ret; } -static grub_err_t +static VasEBoot_err_t make_v_align (unsigned *y, unsigned *h, unsigned new_h, - grub_video_bitmap_v_align_t v_align) + VasEBoot_video_bitmap_v_align_t v_align) { - grub_err_t ret = GRUB_ERR_NONE; + VasEBoot_err_t ret = VasEBoot_ERR_NONE; if (new_h >= *h) { *y = 0; *h = new_h; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } switch (v_align) { - case GRUB_VIDEO_BITMAP_V_ALIGN_TOP: + case VasEBoot_VIDEO_BITMAP_V_ALIGN_TOP: *y = 0; break; - case GRUB_VIDEO_BITMAP_V_ALIGN_CENTER: + case VasEBoot_VIDEO_BITMAP_V_ALIGN_CENTER: *y = (*h - new_h) / 2; break; - case GRUB_VIDEO_BITMAP_V_ALIGN_BOTTOM: + case VasEBoot_VIDEO_BITMAP_V_ALIGN_BOTTOM: *y = *h - new_h; break; default: - ret = grub_error (GRUB_ERR_BUG, "Invalid v_align value"); + ret = VasEBoot_error (VasEBoot_ERR_BUG, "Invalid v_align value"); break; } *h = new_h; return ret; } -grub_err_t -grub_video_bitmap_scale_proportional (struct grub_video_bitmap **dst, +VasEBoot_err_t +VasEBoot_video_bitmap_scale_proportional (struct VasEBoot_video_bitmap **dst, int dst_width, int dst_height, - struct grub_video_bitmap *src, - enum grub_video_bitmap_scale_method + struct VasEBoot_video_bitmap *src, + enum VasEBoot_video_bitmap_scale_method scale_method, - grub_video_bitmap_selection_method_t + VasEBoot_video_bitmap_selection_method_t selection_method, - grub_video_bitmap_v_align_t v_align, - grub_video_bitmap_h_align_t h_align) + VasEBoot_video_bitmap_v_align_t v_align, + VasEBoot_video_bitmap_h_align_t h_align) { *dst = 0; - grub_err_t ret = verify_source_bitmap(src); - if (ret != GRUB_ERR_NONE) + VasEBoot_err_t ret = verify_source_bitmap(src); + if (ret != VasEBoot_ERR_NONE) return ret; if (dst_width <= 0 || dst_height <= 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "requested to scale to a size w/ a zero dimension"); - ret = grub_video_bitmap_create (dst, dst_width, dst_height, + ret = VasEBoot_video_bitmap_create (dst, dst_width, dst_height, src->mode_info.blit_format); - if (ret != GRUB_ERR_NONE) + if (ret != VasEBoot_ERR_NONE) return ret; /* Error. */ unsigned dx0 = 0; @@ -217,45 +217,45 @@ grub_video_bitmap_scale_proportional (struct grub_video_bitmap **dst, switch (selection_method) { - case GRUB_VIDEO_BITMAP_SELECTION_METHOD_CROP: + case VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_CROP: /* Comparing sw/sh VS dw/dh. */ if (sw * dh < dw * sh) ret = make_v_align (&sy0, &sh, sw * dh / dw, v_align); else ret = make_h_align (&sx0, &sw, sh * dw / dh, h_align); break; - case GRUB_VIDEO_BITMAP_SELECTION_METHOD_PADDING: + case VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_PADDING: if (sw * dh < dw * sh) ret = make_h_align (&dx0, &dw, sw * dh / sh, h_align); else ret = make_v_align (&dy0, &dh, sh * dw / sw, v_align); break; - case GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH: + case VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH: if (sw * dh < dw * sh) ret = make_v_align (&sy0, &sh, sw * dh / dw, v_align); else ret = make_v_align (&dy0, &dh, sh * dw / sw, v_align); break; - case GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT: + case VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT: if (sw * dh < dw * sh) ret = make_h_align (&dx0, &dw, sw * dh / sh, h_align); else ret = make_h_align (&sx0, &sw, sh * dw / dh, h_align); break; default: - ret = grub_error (GRUB_ERR_BUG, "Invalid selection_method value"); + ret = VasEBoot_error (VasEBoot_ERR_BUG, "Invalid selection_method value"); break; } - if (ret == GRUB_ERR_NONE) + if (ret == VasEBoot_ERR_NONE) { /* Backup original data. */ int src_width_orig = src->mode_info.width; int src_height_orig = src->mode_info.height; - grub_uint8_t *src_data_orig = src->data; + VasEBoot_uint8_t *src_data_orig = src->data; int dst_width_orig = (*dst)->mode_info.width; int dst_height_orig = (*dst)->mode_info.height; - grub_uint8_t *dst_data_orig = (*dst)->data; + VasEBoot_uint8_t *dst_data_orig = (*dst)->data; int dstride = (*dst)->mode_info.pitch; int sstride = src->mode_info.pitch; @@ -265,15 +265,15 @@ grub_video_bitmap_scale_proportional (struct grub_video_bitmap **dst, /* Crop src and dst. */ src->mode_info.width = sw; src->mode_info.height = sh; - src->data = (grub_uint8_t *) src->data + sx0 * bytes_per_pixel + src->data = (VasEBoot_uint8_t *) src->data + sx0 * bytes_per_pixel + sy0 * sstride; (*dst)->mode_info.width = dw; (*dst)->mode_info.height = dh; - (*dst)->data = (grub_uint8_t *) (*dst)->data + dx0 * bytes_per_pixel + (*dst)->data = (VasEBoot_uint8_t *) (*dst)->data + dx0 * bytes_per_pixel + dy0 * dstride; /* Scale our image. */ - ret = grub_video_bitmap_scale (*dst, src, scale_method); + ret = VasEBoot_video_bitmap_scale (*dst, src, scale_method); /* Restore original data. */ src->mode_info.width = src_width_orig; @@ -284,37 +284,37 @@ grub_video_bitmap_scale_proportional (struct grub_video_bitmap **dst, (*dst)->data = dst_data_orig; } - if (ret == GRUB_ERR_NONE) + if (ret == VasEBoot_ERR_NONE) { /* Success: *dst is now a pointer to the scaled bitmap. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } else { /* Destroy the bitmap and return the error code. */ - grub_video_bitmap_destroy (*dst); + VasEBoot_video_bitmap_destroy (*dst); *dst = 0; return ret; } } -static grub_err_t -verify_bitmaps (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) +static VasEBoot_err_t +verify_bitmaps (struct VasEBoot_video_bitmap *dst, struct VasEBoot_video_bitmap *src) { /* Verify the simplifying assumptions. */ if (dst == 0 || src == 0) - return grub_error (GRUB_ERR_BUG, "null bitmap in scale function"); + return VasEBoot_error (VasEBoot_ERR_BUG, "null bitmap in scale function"); if (dst->mode_info.red_field_pos % 8 != 0 || dst->mode_info.green_field_pos % 8 != 0 || dst->mode_info.blue_field_pos % 8 != 0 || dst->mode_info.reserved_field_pos % 8 != 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "dst format not supported"); if (src->mode_info.red_field_pos % 8 != 0 || src->mode_info.green_field_pos % 8 != 0 || src->mode_info.blue_field_pos % 8 != 0 || src->mode_info.reserved_field_pos % 8 != 0) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "src format not supported"); if (dst->mode_info.red_field_pos != src->mode_info.red_field_pos || dst->mode_info.red_mask_size != src->mode_info.red_mask_size @@ -326,16 +326,16 @@ verify_bitmaps (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) src->mode_info.reserved_field_pos || dst->mode_info.reserved_mask_size != src->mode_info.reserved_mask_size) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "dst and src not compatible"); if (dst->mode_info.bytes_per_pixel != src->mode_info.bytes_per_pixel) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "dst and src not compatible"); if (dst->mode_info.width == 0 || dst->mode_info.height == 0 || src->mode_info.width == 0 || src->mode_info.height == 0) - return grub_error (GRUB_ERR_BUG, "bitmap has a zero dimension"); + return VasEBoot_error (VasEBoot_ERR_BUG, "bitmap has a zero dimension"); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Nearest neighbor bitmap scaling algorithm. @@ -348,15 +348,15 @@ verify_bitmaps (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) into bytes (e.g., RGBA 8:8:8:8 or BGR 8:8:8 true color). But because of this simplifying assumption, the implementation is greatly simplified. */ -static grub_err_t -scale_nn (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) +static VasEBoot_err_t +scale_nn (struct VasEBoot_video_bitmap *dst, struct VasEBoot_video_bitmap *src) { - grub_err_t err = verify_bitmaps(dst, src); - if (err != GRUB_ERR_NONE) + VasEBoot_err_t err = verify_bitmaps(dst, src); + if (err != VasEBoot_ERR_NONE) return err; - grub_uint8_t *ddata = dst->data; - grub_uint8_t *sdata = src->data; + VasEBoot_uint8_t *ddata = dst->data; + VasEBoot_uint8_t *sdata = src->data; unsigned dw = dst->mode_info.width; unsigned dh = dst->mode_info.height; unsigned sw = src->mode_info.width; @@ -367,7 +367,7 @@ scale_nn (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) int bytes_per_pixel = dst->mode_info.bytes_per_pixel; unsigned dy, sy, ystep, yfrac, yover; unsigned sx, xstep, xfrac, xover; - grub_uint8_t *dptr, *dline_end, *sline; + VasEBoot_uint8_t *dptr, *dline_end, *sline; xstep = sw / dw; xover = sw % dw; @@ -386,7 +386,7 @@ scale_nn (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) sline = sdata + sy * sstride; for (sx = 0, xfrac = 0; dptr < dline_end; sx += xstep, xfrac += xover, dptr += bytes_per_pixel) { - grub_uint8_t *sptr; + VasEBoot_uint8_t *sptr; int comp; if (xfrac >= dw) @@ -403,7 +403,7 @@ scale_nn (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) dptr[comp] = sptr[comp]; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Bilinear interpolation image scaling algorithm. @@ -416,15 +416,15 @@ scale_nn (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) into bytes (e.g., RGBA 8:8:8:8 or BGR 8:8:8 true color). But because of this simplifying assumption, the implementation is greatly simplified. */ -static grub_err_t -scale_bilinear (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) +static VasEBoot_err_t +scale_bilinear (struct VasEBoot_video_bitmap *dst, struct VasEBoot_video_bitmap *src) { - grub_err_t err = verify_bitmaps(dst, src); - if (err != GRUB_ERR_NONE) + VasEBoot_err_t err = verify_bitmaps(dst, src); + if (err != VasEBoot_ERR_NONE) return err; - grub_uint8_t *ddata = dst->data; - grub_uint8_t *sdata = src->data; + VasEBoot_uint8_t *ddata = dst->data; + VasEBoot_uint8_t *sdata = src->data; unsigned dw = dst->mode_info.width; unsigned dh = dst->mode_info.height; unsigned sw = src->mode_info.width; @@ -435,7 +435,7 @@ scale_bilinear (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) int bytes_per_pixel = dst->mode_info.bytes_per_pixel; unsigned dy, syf, sy, ystep, yfrac, yover; unsigned sxf, sx, xstep, xfrac, xover; - grub_uint8_t *dptr, *dline_end, *sline; + VasEBoot_uint8_t *dptr, *dline_end, *sline; xstep = (sw << 8) / dw; xover = (sw << 8) % dw; @@ -455,7 +455,7 @@ scale_bilinear (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) sline = sdata + sy * sstride; for (sxf = 0, xfrac = 0; dptr < dline_end; sxf += xstep, xfrac += xover, dptr += bytes_per_pixel) { - grub_uint8_t *sptr; + VasEBoot_uint8_t *sptr; int comp; if (xfrac >= dw) @@ -511,5 +511,5 @@ scale_bilinear (struct grub_video_bitmap *dst, struct grub_video_bitmap *src) } } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/video/bochs.c b/VasEBoot-core/video/bochs.c index 3bcfa53a9..4d2331332 100644 --- a/VasEBoot-core/video/bochs.c +++ b/VasEBoot-core/video/bochs.c @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static struct { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int mapped; - grub_uint32_t base; - grub_pci_device_t dev; + VasEBoot_uint32_t base; + VasEBoot_pci_device_t dev; } framebuffer; #define BOCHS_APERTURE_SIZE 0x800000 @@ -62,31 +62,31 @@ enum }; static void -vbe_write (grub_uint16_t val, grub_uint16_t addr) +vbe_write (VasEBoot_uint16_t val, VasEBoot_uint16_t addr) { - grub_outw (addr, BOCHS_VBE_INDEX); - grub_outw (val, BOCHS_VBE_DATA); + VasEBoot_outw (addr, BOCHS_VBE_INDEX); + VasEBoot_outw (val, BOCHS_VBE_DATA); } -static grub_uint16_t -vbe_read (grub_uint16_t addr) +static VasEBoot_uint16_t +vbe_read (VasEBoot_uint16_t addr) { - grub_outw (addr, BOCHS_VBE_INDEX); - return grub_inw (BOCHS_VBE_DATA); + VasEBoot_outw (addr, BOCHS_VBE_INDEX); + return VasEBoot_inw (BOCHS_VBE_DATA); } struct saved_state { - grub_uint8_t cr[256]; - grub_uint8_t gr[256]; - grub_uint8_t sr[256]; - grub_uint8_t r[256]; - grub_uint8_t g[256]; - grub_uint8_t b[256]; - grub_uint8_t vbe[BOCHS_VBE_MAX]; + VasEBoot_uint8_t cr[256]; + VasEBoot_uint8_t gr[256]; + VasEBoot_uint8_t sr[256]; + VasEBoot_uint8_t r[256]; + VasEBoot_uint8_t g[256]; + VasEBoot_uint8_t b[256]; + VasEBoot_uint8_t vbe[BOCHS_VBE_MAX]; int vbe_enable; /* We need to preserve VGA font and VGA text. */ - grub_uint8_t vram[32 * 4 * 256]; + VasEBoot_uint8_t vram[32 * 4 * 256]; }; static struct saved_state initial_state; @@ -98,23 +98,23 @@ save_state (struct saved_state *st) unsigned i; for (i = 0; i < ARRAY_SIZE (st->cr); i++) - st->cr[i] = grub_vga_cr_read (i); + st->cr[i] = VasEBoot_vga_cr_read (i); for (i = 0; i < ARRAY_SIZE (st->gr); i++) - st->gr[i] = grub_vga_gr_read (i); + st->gr[i] = VasEBoot_vga_gr_read (i); for (i = 0; i < ARRAY_SIZE (st->sr); i++) - st->sr[i] = grub_vga_sr_read (i); + st->sr[i] = VasEBoot_vga_sr_read (i); for (i = 0; i < 256; i++) - grub_vga_palette_read (i, st->r + i, st->g + i, st->b + i); + VasEBoot_vga_palette_read (i, st->r + i, st->g + i, st->b + i); st->vbe_enable = vbe_read (BOCHS_VBE_ENABLE) & 1; if (st->vbe_enable) for (i = 0; i < ARRAY_SIZE (st->vbe); i++) st->vbe[i] = vbe_read (i); - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_CHAIN4, GRUB_VGA_SR_MEMORY_MODE); - grub_memcpy (st->vram, framebuffer.ptr, sizeof (st->vram)); - grub_vga_sr_write (st->sr[GRUB_VGA_SR_MEMORY_MODE], GRUB_VGA_SR_MEMORY_MODE); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_CHAIN4, VasEBoot_VGA_SR_MEMORY_MODE); + VasEBoot_memcpy (st->vram, framebuffer.ptr, sizeof (st->vram)); + VasEBoot_vga_sr_write (st->sr[VasEBoot_VGA_SR_MEMORY_MODE], VasEBoot_VGA_SR_MEMORY_MODE); } static void @@ -128,36 +128,36 @@ restore_state (struct saved_state *st) else vbe_write (0, BOCHS_VBE_ENABLE); - grub_vga_cr_write (0, 0x11); + VasEBoot_vga_cr_write (0, 0x11); for (i = 0; i < ARRAY_SIZE (st->cr); i++) - grub_vga_cr_write (st->cr[i], i); + VasEBoot_vga_cr_write (st->cr[i], i); for (i = 0; i < ARRAY_SIZE (st->sr); i++) - grub_vga_sr_write (st->sr[i], i); + VasEBoot_vga_sr_write (st->sr[i], i); for (i = 0; i < ARRAY_SIZE (st->gr); i++) - grub_vga_gr_write (st->gr[i], i); + VasEBoot_vga_gr_write (st->gr[i], i); for (i = 0; i < 256; i++) - grub_vga_palette_write (i, st->r[i], st->g[i], st->b[i]); + VasEBoot_vga_palette_write (i, st->r[i], st->g[i], st->b[i]); - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_CHAIN4, GRUB_VGA_SR_MEMORY_MODE); - grub_memcpy (framebuffer.ptr, st->vram, sizeof (st->vram)); - grub_vga_sr_write (st->sr[GRUB_VGA_SR_MEMORY_MODE], GRUB_VGA_SR_MEMORY_MODE); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_CHAIN4, VasEBoot_VGA_SR_MEMORY_MODE); + VasEBoot_memcpy (framebuffer.ptr, st->vram, sizeof (st->vram)); + VasEBoot_vga_sr_write (st->sr[VasEBoot_VGA_SR_MEMORY_MODE], VasEBoot_VGA_SR_MEMORY_MODE); } -static grub_err_t -grub_video_bochs_video_init (void) +static VasEBoot_err_t +VasEBoot_video_bochs_video_init (void) { /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_bochs_video_fini (void) +static VasEBoot_err_t +VasEBoot_video_bochs_video_fini (void) { if (framebuffer.mapped) - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, BOCHS_APERTURE_SIZE); if (state_saved) @@ -166,81 +166,81 @@ grub_video_bochs_video_fini (void) state_saved = 0; } - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } -static grub_err_t +static VasEBoot_err_t doublebuf_pageflipping_set_page (int page) { int start = framebuffer.mode_info.height * page; vbe_write (start, BOCHS_VBE_Y_OFFSET); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_bochs_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +static VasEBoot_err_t +VasEBoot_video_bochs_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { - if (framebuffer.mode_info.mode_type == GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (framebuffer.mode_info.mode_type == VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) { unsigned i; if (start >= 0x100) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (start + count >= 0x100) count = 0x100 - start; for (i = 0; i < count; i++) - grub_vga_palette_write (start + i, palette_data[i].r, palette_data[i].g, + VasEBoot_vga_palette_write (start + i, palette_data[i].r, palette_data[i].g, palette_data[i].b); } /* Then set color to emulated palette. */ - return grub_video_fb_set_palette (start, count, palette_data); + return VasEBoot_video_fb_set_palette (start, count, palette_data); } -/* Helper for grub_video_bochs_setup. */ +/* Helper for VasEBoot_video_bochs_setup. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { int *found = data; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); if (((class >> 16) & 0xffff) != 0x0300 || pciid != 0x11111234) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - framebuffer.base = grub_pci_read (addr) & GRUB_PCI_ADDR_MEM_MASK; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + framebuffer.base = VasEBoot_pci_read (addr) & VasEBoot_PCI_ADDR_MEM_MASK; if (!framebuffer.base) return 0; *found = 1; framebuffer.dev = dev; /* Enable address spaces. */ - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_COMMAND); - grub_pci_write (addr, 0x7); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write (addr, 0x7); return 1; } -static grub_err_t -grub_video_bochs_setup (unsigned int width, unsigned int height, - grub_video_mode_type_t mode_type, - grub_video_mode_type_t mode_mask) +static VasEBoot_err_t +VasEBoot_video_bochs_setup (unsigned int width, unsigned int height, + VasEBoot_video_mode_type_t mode_type, + VasEBoot_video_mode_type_t mode_mask) { int depth; - grub_err_t err; + VasEBoot_err_t err; int found = 0; int pitch, bytes_per_pixel; - grub_size_t page_size; /* The size of a page in bytes. */ + VasEBoot_size_t page_size; /* The size of a page in bytes. */ /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if (width == 0 || height == 0) { @@ -249,20 +249,20 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, } if (width > BOCHS_MAX_WIDTH) - return grub_error (GRUB_ERR_IO, "width must be at most", + return VasEBoot_error (VasEBoot_ERR_IO, "width must be at most", BOCHS_MAX_WIDTH); if (height > BOCHS_MAX_HEIGHT) - return grub_error (GRUB_ERR_IO, "height must be at most", + return VasEBoot_error (VasEBoot_ERR_IO, "height must be at most", BOCHS_MAX_HEIGHT); if (width & (BOCHS_WIDTH_ALIGN - 1)) - return grub_error (GRUB_ERR_IO, "width must be a multiple of %d", + return VasEBoot_error (VasEBoot_ERR_IO, "width must be a multiple of %d", BOCHS_WIDTH_ALIGN); if (depth == 0 - && !grub_video_check_mode_flag (mode_type, mode_mask, - GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, 0)) + && !VasEBoot_video_check_mode_flag (mode_type, mode_mask, + VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, 0)) depth = 24; if (depth == 0) @@ -270,11 +270,11 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, if (depth != 32 && depth != 24 && depth != 16 && depth != 15 && depth != 8 && depth != 4) - return grub_error (GRUB_ERR_IO, "only 32, 24, 16, 15 and 8-bpp are" + return VasEBoot_error (VasEBoot_ERR_IO, "only 32, 24, 16, 15 and 8-bpp are" " supported by bochs video"); if (depth == 4) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "4-bpp isn't cupported"); + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "4-bpp isn't cupported"); bytes_per_pixel = (depth + 7) / 8; if (depth == 4) @@ -285,20 +285,20 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, page_size = pitch * height; if (page_size > BOCHS_APERTURE_SIZE) - return grub_error (GRUB_ERR_IO, "Not enough video memory for this mode"); + return VasEBoot_error (VasEBoot_ERR_IO, "Not enough video memory for this mode"); - grub_pci_iterate (find_card, &found); + VasEBoot_pci_iterate (find_card, &found); if (!found) - return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find graphics card"); if (found && framebuffer.base == 0) { /* FIXME: change framebuffer base */ - return grub_error (GRUB_ERR_IO, "PCI BAR not set"); + return VasEBoot_error (VasEBoot_ERR_IO, "PCI BAR not set"); } /* We can safely discard volatile attribute. */ - framebuffer.ptr = (void *) grub_pci_device_map_range (framebuffer.dev, + framebuffer.ptr = (void *) VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.base, BOCHS_APERTURE_SIZE); framebuffer.mapped = 1; @@ -323,7 +323,7 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, /* Fill mode info details. */ framebuffer.mode_info.width = width; framebuffer.mode_info.height = height; - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; framebuffer.mode_info.bpp = depth; framebuffer.mode_info.bytes_per_pixel = bytes_per_pixel; framebuffer.mode_info.pitch = pitch; @@ -335,7 +335,7 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, { case 4: case 8: - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; framebuffer.mode_info.number_of_colors = 16; break; case 16: @@ -371,69 +371,69 @@ grub_video_bochs_setup (unsigned int width, unsigned int height, break; } - framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info); + framebuffer.mode_info.blit_format = VasEBoot_video_get_blit_format (&framebuffer.mode_info); if (BOCHS_APERTURE_SIZE >= 2 * page_size) - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, doublebuf_pageflipping_set_page, framebuffer.ptr + page_size); else - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, 0, 0); /* Copy default palette to initialize emulated palette. */ - err = grub_video_bochs_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_bochs_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); return err; } -static struct grub_video_adapter grub_video_bochs_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_bochs_adapter = { .name = "Bochs PCI Video Driver", - .id = GRUB_VIDEO_DRIVER_BOCHS, + .id = VasEBoot_VIDEO_DRIVER_BOCHS, - .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE, - .init = grub_video_bochs_video_init, - .fini = grub_video_bochs_video_fini, - .setup = grub_video_bochs_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_fb_get_info_and_fini, - .set_palette = grub_video_bochs_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_fb_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_bochs_video_init, + .fini = VasEBoot_video_bochs_video_fini, + .setup = VasEBoot_video_bochs_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_fb_get_info_and_fini, + .set_palette = VasEBoot_video_bochs_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_fb_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(video_bochs) +VasEBoot_MOD_INIT(video_bochs) { - grub_video_register (&grub_video_bochs_adapter); + VasEBoot_video_register (&VasEBoot_video_bochs_adapter); } -GRUB_MOD_FINI(video_bochs) +VasEBoot_MOD_FINI(video_bochs) { - grub_video_unregister (&grub_video_bochs_adapter); + VasEBoot_video_unregister (&VasEBoot_video_bochs_adapter); } diff --git a/VasEBoot-core/video/capture.c b/VasEBoot-core/video/capture.c index 4f83c7441..1ea27345a 100644 --- a/VasEBoot-core/video/capture.c +++ b/VasEBoot-core/video/capture.c @@ -1,135 +1,135 @@ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include +#include +#include +#include +#include static struct { - struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; - grub_uint8_t *ptr; + struct VasEBoot_video_mode_info mode_info; + struct VasEBoot_video_render_target *render_target; + VasEBoot_uint8_t *ptr; } framebuffer; -void (*grub_video_capture_refresh_cb) (void); +void (*VasEBoot_video_capture_refresh_cb) (void); -static grub_err_t -grub_video_capture_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_capture_swap_buffers (void) { - if (grub_video_capture_refresh_cb) - grub_video_capture_refresh_cb (); - return GRUB_ERR_NONE; + if (VasEBoot_video_capture_refresh_cb) + VasEBoot_video_capture_refresh_cb (); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_capture_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_capture_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) target = framebuffer.render_target; - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static grub_err_t -grub_video_capture_fini (void) +static VasEBoot_err_t +VasEBoot_video_capture_fini (void) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_capture_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_capture_adapter = { .name = "Render capture", .prio = 0, - .id = GRUB_VIDEO_ADAPTER_CAPTURE, + .id = VasEBoot_VIDEO_ADAPTER_CAPTURE, - .fini = grub_video_capture_fini, - .get_info = grub_video_fb_get_info, + .fini = VasEBoot_video_capture_fini, + .get_info = VasEBoot_video_fb_get_info, .get_info_and_fini = 0, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_capture_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_capture_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_capture_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_capture_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -static struct grub_video_adapter *saved; -static struct grub_video_mode_info saved_mode_info; +static struct VasEBoot_video_adapter *saved; +static struct VasEBoot_video_mode_info saved_mode_info; -grub_err_t -grub_video_capture_start (const struct grub_video_mode_info *mode_info, - struct grub_video_palette_data *palette, +VasEBoot_err_t +VasEBoot_video_capture_start (const struct VasEBoot_video_mode_info *mode_info, + struct VasEBoot_video_palette_data *palette, unsigned int palette_size) { - grub_err_t err; - grub_memset (&framebuffer, 0, sizeof (framebuffer)); + VasEBoot_err_t err; + VasEBoot_memset (&framebuffer, 0, sizeof (framebuffer)); - grub_video_fb_init (); + VasEBoot_video_fb_init (); framebuffer.mode_info = *mode_info; - framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info); + framebuffer.mode_info.blit_format = VasEBoot_video_get_blit_format (&framebuffer.mode_info); - framebuffer.ptr = grub_malloc (framebuffer.mode_info.height * framebuffer.mode_info.pitch); + framebuffer.ptr = VasEBoot_malloc (framebuffer.mode_info.height * framebuffer.mode_info.pitch); if (!framebuffer.ptr) - return grub_errno; + return VasEBoot_errno; - err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target, + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.render_target, &framebuffer.mode_info, framebuffer.ptr); if (err) return err; - err = grub_video_fb_set_active_render_target (framebuffer.render_target); + err = VasEBoot_video_fb_set_active_render_target (framebuffer.render_target); if (err) return err; - err = grub_video_fb_set_palette (0, palette_size, palette); + err = VasEBoot_video_fb_set_palette (0, palette_size, palette); if (err) return err; - saved = grub_video_adapter_active; + saved = VasEBoot_video_adapter_active; if (saved) { - grub_video_get_info (&saved_mode_info); + VasEBoot_video_get_info (&saved_mode_info); if (saved->fini) saved->fini (); } - grub_video_adapter_active = &grub_video_capture_adapter; + VasEBoot_video_adapter_active = &VasEBoot_video_capture_adapter; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } void * -grub_video_capture_get_framebuffer (void) +VasEBoot_video_capture_get_framebuffer (void) { return framebuffer.ptr; } void -grub_video_capture_end (void) +VasEBoot_video_capture_end (void) { - grub_video_fb_delete_render_target (framebuffer.render_target); - grub_free (framebuffer.ptr); - grub_video_fb_fini (); - grub_video_adapter_active = saved; + VasEBoot_video_fb_delete_render_target (framebuffer.render_target); + VasEBoot_free (framebuffer.ptr); + VasEBoot_video_fb_fini (); + VasEBoot_video_adapter_active = saved; if (saved) { if (saved->init) diff --git a/VasEBoot-core/video/cirrus.c b/VasEBoot-core/video/cirrus.c index e2149e8ce..b34cb4335 100644 --- a/VasEBoot-core/video/cirrus.c +++ b/VasEBoot-core/video/cirrus.c @@ -1,51 +1,51 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static struct { - struct grub_video_mode_info mode_info; - grub_size_t page_size; /* The size of a page in bytes. */ + struct VasEBoot_video_mode_info mode_info; + VasEBoot_size_t page_size; /* The size of a page in bytes. */ - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int mapped; - grub_uint32_t base; - grub_pci_device_t dev; + VasEBoot_uint32_t base; + VasEBoot_pci_device_t dev; } framebuffer; #define CIRRUS_APERTURE_SIZE 0x1000000 #define CIRRUS_MAX_WIDTH 0x800 #define CIRRUS_MAX_HEIGHT 0x800 -#define CIRRUS_MAX_PITCH (0x1ff * GRUB_VGA_CR_PITCH_DIVISOR) +#define CIRRUS_MAX_PITCH (0x1ff * VasEBoot_VGA_CR_PITCH_DIVISOR) enum { @@ -88,38 +88,38 @@ enum | CIRRUS_HIDDEN_DAC_ENABLE_ALL | 5) static void -write_hidden_dac (grub_uint8_t data) +write_hidden_dac (VasEBoot_uint8_t data) { - grub_inb (GRUB_VGA_IO_PALLETTE_WRITE_INDEX); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_outb (data, GRUB_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PALLETTE_WRITE_INDEX); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_outb (data, VasEBoot_VGA_IO_PIXEL_MASK); } -static grub_uint8_t +static VasEBoot_uint8_t read_hidden_dac (void) { - grub_inb (GRUB_VGA_IO_PALLETTE_WRITE_INDEX); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - grub_inb (GRUB_VGA_IO_PIXEL_MASK); - return grub_inb (GRUB_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PALLETTE_WRITE_INDEX); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); + return VasEBoot_inb (VasEBoot_VGA_IO_PIXEL_MASK); } struct saved_state { - grub_uint8_t cr[CIRRUS_CR_MAX]; - grub_uint8_t gr[GRUB_VGA_GR_MAX]; - grub_uint8_t sr[CIRRUS_SR_MAX]; - grub_uint8_t hidden_dac; + VasEBoot_uint8_t cr[CIRRUS_CR_MAX]; + VasEBoot_uint8_t gr[VasEBoot_VGA_GR_MAX]; + VasEBoot_uint8_t sr[CIRRUS_SR_MAX]; + VasEBoot_uint8_t hidden_dac; /* We need to preserve VGA font and VGA text. */ - grub_uint8_t vram[32 * 4 * 256]; - grub_uint8_t r[256]; - grub_uint8_t g[256]; - grub_uint8_t b[256]; + VasEBoot_uint8_t vram[32 * 4 * 256]; + VasEBoot_uint8_t r[256]; + VasEBoot_uint8_t g[256]; + VasEBoot_uint8_t b[256]; }; static struct saved_state initial_state; @@ -130,51 +130,51 @@ save_state (struct saved_state *st) { unsigned i; for (i = 0; i < ARRAY_SIZE (st->cr); i++) - st->cr[i] = grub_vga_cr_read (i); + st->cr[i] = VasEBoot_vga_cr_read (i); for (i = 0; i < ARRAY_SIZE (st->sr); i++) - st->sr[i] = grub_vga_sr_read (i); + st->sr[i] = VasEBoot_vga_sr_read (i); for (i = 0; i < ARRAY_SIZE (st->gr); i++) - st->gr[i] = grub_vga_gr_read (i); + st->gr[i] = VasEBoot_vga_gr_read (i); for (i = 0; i < 256; i++) - grub_vga_palette_read (i, st->r + i, st->g + i, st->b + i); + VasEBoot_vga_palette_read (i, st->r + i, st->g + i, st->b + i); st->hidden_dac = read_hidden_dac (); - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_CHAIN4, GRUB_VGA_SR_MEMORY_MODE); - grub_memcpy (st->vram, framebuffer.ptr, sizeof (st->vram)); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_CHAIN4, VasEBoot_VGA_SR_MEMORY_MODE); + VasEBoot_memcpy (st->vram, framebuffer.ptr, sizeof (st->vram)); } static void restore_state (struct saved_state *st) { unsigned i; - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_CHAIN4, GRUB_VGA_SR_MEMORY_MODE); - grub_memcpy (framebuffer.ptr, st->vram, sizeof (st->vram)); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_CHAIN4, VasEBoot_VGA_SR_MEMORY_MODE); + VasEBoot_memcpy (framebuffer.ptr, st->vram, sizeof (st->vram)); for (i = 0; i < ARRAY_SIZE (st->cr); i++) - grub_vga_cr_write (st->cr[i], i); + VasEBoot_vga_cr_write (st->cr[i], i); for (i = 0; i < ARRAY_SIZE (st->sr); i++) - grub_vga_sr_write (st->sr[i], i); + VasEBoot_vga_sr_write (st->sr[i], i); for (i = 0; i < ARRAY_SIZE (st->gr); i++) - grub_vga_gr_write (st->gr[i], i); + VasEBoot_vga_gr_write (st->gr[i], i); for (i = 0; i < 256; i++) - grub_vga_palette_write (i, st->r[i], st->g[i], st->b[i]); + VasEBoot_vga_palette_write (i, st->r[i], st->g[i], st->b[i]); write_hidden_dac (st->hidden_dac); } -static grub_err_t -grub_video_cirrus_video_init (void) +static VasEBoot_err_t +VasEBoot_video_cirrus_video_init (void) { /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_cirrus_video_fini (void) +static VasEBoot_err_t +VasEBoot_video_cirrus_video_fini (void) { if (framebuffer.mapped) - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, CIRRUS_APERTURE_SIZE); if (state_saved) @@ -183,101 +183,101 @@ grub_video_cirrus_video_fini (void) state_saved = 0; } - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } -static grub_err_t +static VasEBoot_err_t doublebuf_pageflipping_set_page (int page) { int start = framebuffer.page_size * page / 4; - grub_uint8_t cr_ext, cr_overlay; + VasEBoot_uint8_t cr_ext, cr_overlay; - grub_vga_cr_write (start & 0xff, GRUB_VGA_CR_START_ADDR_LOW_REGISTER); - grub_vga_cr_write ((start & 0xff00) >> 8, - GRUB_VGA_CR_START_ADDR_HIGH_REGISTER); + VasEBoot_vga_cr_write (start & 0xff, VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER); + VasEBoot_vga_cr_write ((start & 0xff00) >> 8, + VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER); - cr_ext = grub_vga_cr_read (CIRRUS_CR_EXTENDED_DISPLAY); + cr_ext = VasEBoot_vga_cr_read (CIRRUS_CR_EXTENDED_DISPLAY); cr_ext &= ~(CIRRUS_CR_EXTENDED_DISPLAY_START_MASK1 | CIRRUS_CR_EXTENDED_DISPLAY_START_MASK2); cr_ext |= ((start >> CIRRUS_CR_EXTENDED_DISPLAY_START_SHIFT1) & CIRRUS_CR_EXTENDED_DISPLAY_START_MASK1); cr_ext |= ((start >> CIRRUS_CR_EXTENDED_DISPLAY_START_SHIFT2) & CIRRUS_CR_EXTENDED_DISPLAY_START_MASK2); - grub_vga_cr_write (cr_ext, CIRRUS_CR_EXTENDED_DISPLAY); + VasEBoot_vga_cr_write (cr_ext, CIRRUS_CR_EXTENDED_DISPLAY); - cr_overlay = grub_vga_cr_read (CIRRUS_CR_EXTENDED_OVERLAY); + cr_overlay = VasEBoot_vga_cr_read (CIRRUS_CR_EXTENDED_OVERLAY); cr_overlay &= ~(CIRRUS_CR_EXTENDED_OVERLAY_DISPLAY_START_MASK); cr_overlay |= ((start >> CIRRUS_CR_EXTENDED_OVERLAY_DISPLAY_START_SHIFT) & CIRRUS_CR_EXTENDED_OVERLAY_DISPLAY_START_MASK); - grub_vga_cr_write (cr_overlay, CIRRUS_CR_EXTENDED_OVERLAY); + VasEBoot_vga_cr_write (cr_overlay, CIRRUS_CR_EXTENDED_OVERLAY); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_cirrus_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +static VasEBoot_err_t +VasEBoot_video_cirrus_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { - if (framebuffer.mode_info.mode_type == GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (framebuffer.mode_info.mode_type == VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) { unsigned i; if (start >= 0x100) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (start + count >= 0x100) count = 0x100 - start; for (i = 0; i < count; i++) - grub_vga_palette_write (start + i, palette_data[i].r, palette_data[i].g, + VasEBoot_vga_palette_write (start + i, palette_data[i].r, palette_data[i].g, palette_data[i].b); } /* Then set color to emulated palette. */ - return grub_video_fb_set_palette (start, count, palette_data); + return VasEBoot_video_fb_set_palette (start, count, palette_data); } -/* Helper for grub_video_cirrus_setup. */ +/* Helper for VasEBoot_video_cirrus_setup. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { int *found = data; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); if (((class >> 16) & 0xffff) != 0x0300 || pciid != 0x00b81013) return 0; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - framebuffer.base = grub_pci_read (addr) & GRUB_PCI_ADDR_MEM_MASK; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + framebuffer.base = VasEBoot_pci_read (addr) & VasEBoot_PCI_ADDR_MEM_MASK; if (!framebuffer.base) return 0; *found = 1; /* Enable address spaces. */ - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_COMMAND); - grub_pci_write (addr, 0x7); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write (addr, 0x7); framebuffer.dev = dev; return 1; } -static grub_err_t -grub_video_cirrus_setup (unsigned int width, unsigned int height, - grub_video_mode_type_t mode_type, - grub_video_mode_type_t mode_mask) +static VasEBoot_err_t +VasEBoot_video_cirrus_setup (unsigned int width, unsigned int height, + VasEBoot_video_mode_type_t mode_type, + VasEBoot_video_mode_type_t mode_mask) { int depth; - grub_err_t err; + VasEBoot_err_t err; int found = 0; int pitch, bytes_per_pixel; /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if (width == 0 || height == 0) { @@ -285,55 +285,55 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, height = 600; } - if (width & (GRUB_VGA_CR_WIDTH_DIVISOR - 1)) - return grub_error (GRUB_ERR_IO, + if (width & (VasEBoot_VGA_CR_WIDTH_DIVISOR - 1)) + return VasEBoot_error (VasEBoot_ERR_IO, "screen width must be a multiple of %d", - GRUB_VGA_CR_WIDTH_DIVISOR); + VasEBoot_VGA_CR_WIDTH_DIVISOR); if (width > CIRRUS_MAX_WIDTH) - return grub_error (GRUB_ERR_IO, + return VasEBoot_error (VasEBoot_ERR_IO, "screen width must be at most %d", CIRRUS_MAX_WIDTH); if (height > CIRRUS_MAX_HEIGHT) - return grub_error (GRUB_ERR_IO, + return VasEBoot_error (VasEBoot_ERR_IO, "screen height must be at most %d", CIRRUS_MAX_HEIGHT); if (depth == 0 - && !grub_video_check_mode_flag (mode_type, mode_mask, - GRUB_VIDEO_MODE_TYPE_INDEX_COLOR, 0)) + && !VasEBoot_video_check_mode_flag (mode_type, mode_mask, + VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR, 0)) depth = 24; else if (depth == 0) depth = 8; if (depth != 32 && depth != 24 && depth != 16 && depth != 15 && depth != 8) - return grub_error (GRUB_ERR_IO, "only 32, 24, 16, 15 and 8-bit bpp are" + return VasEBoot_error (VasEBoot_ERR_IO, "only 32, 24, 16, 15 and 8-bit bpp are" " supported by cirrus video"); - bytes_per_pixel = (depth + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT; + bytes_per_pixel = (depth + VasEBoot_CHAR_BIT - 1) / VasEBoot_CHAR_BIT; pitch = width * bytes_per_pixel; if (pitch > CIRRUS_MAX_PITCH) - return grub_error (GRUB_ERR_IO, + return VasEBoot_error (VasEBoot_ERR_IO, "screen width must be at most %d at bitdepth %d", CIRRUS_MAX_PITCH / bytes_per_pixel, depth); framebuffer.page_size = pitch * height; if (framebuffer.page_size > CIRRUS_APERTURE_SIZE) - return grub_error (GRUB_ERR_IO, "Not enough video memory for this mode"); + return VasEBoot_error (VasEBoot_ERR_IO, "Not enough video memory for this mode"); - grub_pci_iterate (find_card, &found); + VasEBoot_pci_iterate (find_card, &found); if (!found) - return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find graphics card"); if (found && framebuffer.base == 0) { /* FIXME: change framebuffer base */ - return grub_error (GRUB_ERR_IO, "PCI BAR not set"); + return VasEBoot_error (VasEBoot_ERR_IO, "PCI BAR not set"); } /* We can safely discard volatile attribute. */ - framebuffer.ptr = (void *) grub_pci_device_map_range (framebuffer.dev, + framebuffer.ptr = (void *) VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.base, CIRRUS_APERTURE_SIZE); framebuffer.mapped = 1; @@ -345,30 +345,30 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, } { - struct grub_video_hw_config config = { - .pitch = pitch / GRUB_VGA_CR_PITCH_DIVISOR, + struct VasEBoot_video_hw_config config = { + .pitch = pitch / VasEBoot_VGA_CR_PITCH_DIVISOR, .line_compare = 0x3ff, .vdisplay_end = height - 1, - .horizontal_end = width / GRUB_VGA_CR_WIDTH_DIVISOR + .horizontal_end = width / VasEBoot_VGA_CR_WIDTH_DIVISOR }; - grub_uint8_t sr_ext = 0, hidden_dac = 0; + VasEBoot_uint8_t sr_ext = 0, hidden_dac = 0; - grub_vga_set_geometry (&config, grub_vga_cr_write); + VasEBoot_vga_set_geometry (&config, VasEBoot_vga_cr_write); - grub_vga_gr_write (GRUB_VGA_GR_MODE_256_COLOR | GRUB_VGA_GR_MODE_READ_MODE1, - GRUB_VGA_GR_MODE); - grub_vga_gr_write (GRUB_VGA_GR_GR6_GRAPHICS_MODE, GRUB_VGA_GR_GR6); + VasEBoot_vga_gr_write (VasEBoot_VGA_GR_MODE_256_COLOR | VasEBoot_VGA_GR_MODE_READ_MODE1, + VasEBoot_VGA_GR_MODE); + VasEBoot_vga_gr_write (VasEBoot_VGA_GR_GR6_GRAPHICS_MODE, VasEBoot_VGA_GR_GR6); - grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_NORMAL, GRUB_VGA_SR_MEMORY_MODE); + VasEBoot_vga_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_NORMAL, VasEBoot_VGA_SR_MEMORY_MODE); - grub_vga_cr_write ((config.pitch >> CIRRUS_CR_EXTENDED_DISPLAY_PITCH_SHIFT) + VasEBoot_vga_cr_write ((config.pitch >> CIRRUS_CR_EXTENDED_DISPLAY_PITCH_SHIFT) & CIRRUS_CR_EXTENDED_DISPLAY_PITCH_MASK, CIRRUS_CR_EXTENDED_DISPLAY); - grub_vga_cr_write (GRUB_VGA_CR_MODE_TIMING_ENABLE - | GRUB_VGA_CR_MODE_BYTE_MODE - | GRUB_VGA_CR_MODE_NO_HERCULES | GRUB_VGA_CR_MODE_NO_CGA, - GRUB_VGA_CR_MODE); + VasEBoot_vga_cr_write (VasEBoot_VGA_CR_MODE_TIMING_ENABLE + | VasEBoot_VGA_CR_MODE_BYTE_MODE + | VasEBoot_VGA_CR_MODE_NO_HERCULES | VasEBoot_VGA_CR_MODE_NO_CGA, + VasEBoot_VGA_CR_MODE); doublebuf_pageflipping_set_page (0); @@ -398,14 +398,14 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, sr_ext |= CIRRUS_SR_EXTENDED_MODE_8BPP; break; } - grub_vga_sr_write (sr_ext, CIRRUS_SR_EXTENDED_MODE); + VasEBoot_vga_sr_write (sr_ext, CIRRUS_SR_EXTENDED_MODE); write_hidden_dac (hidden_dac); } /* Fill mode info details. */ framebuffer.mode_info.width = width; framebuffer.mode_info.height = height; - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; framebuffer.mode_info.bpp = depth; framebuffer.mode_info.bytes_per_pixel = bytes_per_pixel; framebuffer.mode_info.pitch = pitch; @@ -416,7 +416,7 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, switch (depth) { case 8: - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; framebuffer.mode_info.number_of_colors = 16; break; case 16: @@ -452,69 +452,69 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height, break; } - framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info); + framebuffer.mode_info.blit_format = VasEBoot_video_get_blit_format (&framebuffer.mode_info); if (CIRRUS_APERTURE_SIZE >= 2 * framebuffer.page_size) - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, doublebuf_pageflipping_set_page, framebuffer.ptr + framebuffer.page_size); else - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, 0, 0); /* Copy default palette to initialize emulated palette. */ - err = grub_video_cirrus_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_cirrus_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); return err; } -static struct grub_video_adapter grub_video_cirrus_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_cirrus_adapter = { .name = "Cirrus CLGD 5446 PCI Video Driver", - .id = GRUB_VIDEO_DRIVER_CIRRUS, + .id = VasEBoot_VIDEO_DRIVER_CIRRUS, - .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE, - .init = grub_video_cirrus_video_init, - .fini = grub_video_cirrus_video_fini, - .setup = grub_video_cirrus_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_fb_get_info_and_fini, - .set_palette = grub_video_cirrus_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_fb_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_cirrus_video_init, + .fini = VasEBoot_video_cirrus_video_fini, + .setup = VasEBoot_video_cirrus_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_fb_get_info_and_fini, + .set_palette = VasEBoot_video_cirrus_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_fb_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(video_cirrus) +VasEBoot_MOD_INIT(video_cirrus) { - grub_video_register (&grub_video_cirrus_adapter); + VasEBoot_video_register (&VasEBoot_video_cirrus_adapter); } -GRUB_MOD_FINI(video_cirrus) +VasEBoot_MOD_FINI(video_cirrus) { - grub_video_unregister (&grub_video_cirrus_adapter); + VasEBoot_video_unregister (&VasEBoot_video_cirrus_adapter); } diff --git a/VasEBoot-core/video/colors.c b/VasEBoot-core/video/colors.c index 485ebb4ab..5c1e657a5 100644 --- a/VasEBoot-core/video/colors.c +++ b/VasEBoot-core/video/colors.c @@ -1,36 +1,36 @@ /* named_colors.c - Named color values. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); struct named_color { const char *name; - grub_video_rgba_color_t color; + VasEBoot_video_rgba_color_t color; }; /* @@ -198,13 +198,13 @@ static struct named_color named_colors[] = stores the color into *COLOR. If the color was not found, returns 0 and does not modify *COLOR. */ int -grub_video_get_named_color (const char *name, - grub_video_rgba_color_t *color) +VasEBoot_video_get_named_color (const char *name, + VasEBoot_video_rgba_color_t *color) { int i; for (i = 0; named_colors[i].name; i++) { - if (grub_strcmp (named_colors[i].name, name) == 0) + if (VasEBoot_strcmp (named_colors[i].name, name) == 0) { *color = named_colors[i].color; return 1; @@ -237,19 +237,19 @@ parse_hex_color_component (const char *s, unsigned start, unsigned end) buf[2] = '\0'; - return grub_strtoul (buf, 0, 16); + return VasEBoot_strtoul (buf, 0, 16); } /* Parse a color string of the form "r, g, b", "#RGB", "#RGBA", "#RRGGBB", or "#RRGGBBAA". */ -grub_err_t -grub_video_parse_color (const char *s, grub_video_rgba_color_t *color) +VasEBoot_err_t +VasEBoot_video_parse_color (const char *s, VasEBoot_video_rgba_color_t *color) { - grub_video_rgba_color_t c; + VasEBoot_video_rgba_color_t c; const char *s0; /* Skip whitespace. */ - while (*s && grub_isspace (*s)) + while (*s && VasEBoot_isspace (*s)) s++; s0 = s; @@ -264,7 +264,7 @@ grub_video_parse_color (const char *s, grub_video_rgba_color_t *color) /* Count the hexits to determine the format. */ int hexits = 0; const char *end = s; - while (grub_isxdigit (*end)) + while (VasEBoot_isxdigit (*end)) { end++; hexits++; @@ -292,42 +292,42 @@ grub_video_parse_color (const char *s, grub_video_rgba_color_t *color) c.alpha = 255; } else - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), s0); } - else if (grub_isdigit (*s)) + else if (VasEBoot_isdigit (*s)) { /* Comma separated decimal values. */ - c.red = grub_strtoul (s, 0, 0); - s = grub_strchr (s, ','); + c.red = VasEBoot_strtoul (s, 0, 0); + s = VasEBoot_strchr (s, ','); if (!s) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), s0); s++; - c.green = grub_strtoul (s, 0, 0); - s = grub_strchr (s, ','); + c.green = VasEBoot_strtoul (s, 0, 0); + s = VasEBoot_strchr (s, ','); if (!s) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), s0); s++; - c.blue = grub_strtoul (s, 0, 0); - s = grub_strchr (s, ','); + c.blue = VasEBoot_strtoul (s, 0, 0); + s = VasEBoot_strchr (s, ','); if (!s) c.alpha = 255; else { s++; - c.alpha = grub_strtoul (s, 0, 0); + c.alpha = VasEBoot_strtoul (s, 0, 0); } } else { - if (! grub_video_get_named_color (s, &c)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + if (! VasEBoot_video_get_named_color (s, &c)) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), s0); } - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) *color = c; - return grub_errno; + return VasEBoot_errno; } diff --git a/VasEBoot-core/video/efi_gop.c b/VasEBoot-core/video/efi_gop.c index 7f9d1c2df..a9a8c7960 100644 --- a/VasEBoot-core/video/efi_gop.c +++ b/VasEBoot-core/video/efi_gop.c @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_efi_guid_t graphics_output_guid = GRUB_EFI_GOP_GUID; -static grub_efi_guid_t active_edid_guid = GRUB_EFI_EDID_ACTIVE_GUID; -static grub_efi_guid_t discovered_edid_guid = GRUB_EFI_EDID_DISCOVERED_GUID; -static grub_efi_guid_t efi_var_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID; -static struct grub_efi_gop *gop; +static VasEBoot_efi_guid_t graphics_output_guid = VasEBoot_EFI_GOP_GUID; +static VasEBoot_efi_guid_t active_edid_guid = VasEBoot_EFI_EDID_ACTIVE_GUID; +static VasEBoot_efi_guid_t discovered_edid_guid = VasEBoot_EFI_EDID_DISCOVERED_GUID; +static VasEBoot_efi_guid_t efi_var_guid = VasEBoot_EFI_GLOBAL_VARIABLE_GUID; +static struct VasEBoot_efi_gop *gop; static unsigned old_mode; static int restore_needed; -static grub_efi_handle_t gop_handle; +static VasEBoot_efi_handle_t gop_handle; static int -grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg); +VasEBoot_video_gop_iterate (int (*hook) (const struct VasEBoot_video_mode_info *info, void *hook_arg), void *hook_arg); static struct { - struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; - grub_uint8_t *ptr; - grub_uint8_t *offscreen; + struct VasEBoot_video_mode_info mode_info; + struct VasEBoot_video_render_target *render_target; + VasEBoot_uint8_t *ptr; + VasEBoot_uint8_t *offscreen; } framebuffer; static int -check_protocol_hook (const struct grub_video_mode_info *info __attribute__ ((unused)), void *hook_arg) +check_protocol_hook (const struct VasEBoot_video_mode_info *info __attribute__ ((unused)), void *hook_arg) { int *have_usable_mode = hook_arg; *have_usable_mode = 1; @@ -64,11 +64,11 @@ check_protocol_hook (const struct grub_video_mode_info *info __attribute__ ((unu static int check_protocol (void) { - grub_efi_handle_t *handles; - grub_efi_uintn_t num_handles, i; + VasEBoot_efi_handle_t *handles; + VasEBoot_efi_uintn_t num_handles, i; int have_usable_mode = 0; - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, + handles = VasEBoot_efi_locate_handle (VasEBoot_EFI_BY_PROTOCOL, &graphics_output_guid, NULL, &num_handles); if (!handles || num_handles == 0) return 0; @@ -76,12 +76,12 @@ check_protocol (void) for (i = 0; i < num_handles; i++) { gop_handle = handles[i]; - gop = grub_efi_open_protocol (gop_handle, &graphics_output_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); - grub_video_gop_iterate (check_protocol_hook, &have_usable_mode); + gop = VasEBoot_efi_open_protocol (gop_handle, &graphics_output_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + VasEBoot_video_gop_iterate (check_protocol_hook, &have_usable_mode); if (have_usable_mode) { - grub_free (handles); + VasEBoot_free (handles); return 1; } } @@ -92,38 +92,38 @@ check_protocol (void) return 0; } -static grub_err_t -grub_video_gop_init (void) +static VasEBoot_err_t +VasEBoot_video_gop_init (void) { - grub_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_gop_fini (void) +static VasEBoot_err_t +VasEBoot_video_gop_fini (void) { if (restore_needed) { efi_call_2 (gop->set_mode, gop, old_mode); restore_needed = 0; } - grub_free (framebuffer.offscreen); + VasEBoot_free (framebuffer.offscreen); framebuffer.offscreen = 0; - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } static int -grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *in) +VasEBoot_video_gop_get_bpp (struct VasEBoot_efi_gop_mode_info *in) { - grub_uint32_t total_mask; + VasEBoot_uint32_t total_mask; int i; switch (in->pixel_format) { - case GRUB_EFI_GOT_BGRA8: - case GRUB_EFI_GOT_RGBA8: + case VasEBoot_EFI_GOT_BGRA8: + case VasEBoot_EFI_GOT_RGBA8: return 32; - case GRUB_EFI_GOT_BITMASK: + case VasEBoot_EFI_GOT_BITMASK: /* Check overlaps. */ if ((in->pixel_bitmask.r & in->pixel_bitmask.g) || (in->pixel_bitmask.r & in->pixel_bitmask.b) @@ -147,7 +147,7 @@ grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *in) } static void -grub_video_gop_get_bitmask (grub_uint32_t mask, unsigned int *mask_size, +VasEBoot_video_gop_get_bitmask (VasEBoot_uint32_t mask, unsigned int *mask_size, unsigned int *field_pos) { int i; @@ -168,25 +168,25 @@ grub_video_gop_get_bitmask (grub_uint32_t mask, unsigned int *mask_size, *mask_size = last_p - *field_pos + 1; } -static grub_err_t -grub_video_gop_fill_real_mode_info (unsigned mode, - struct grub_efi_gop_mode_info *in, - struct grub_video_mode_info *out) +static VasEBoot_err_t +VasEBoot_video_gop_fill_real_mode_info (unsigned mode, + struct VasEBoot_efi_gop_mode_info *in, + struct VasEBoot_video_mode_info *out) { out->mode_number = mode; out->number_of_colors = 256; out->width = in->width; out->height = in->height; - out->mode_type = GRUB_VIDEO_MODE_TYPE_RGB; - out->bpp = grub_video_gop_get_bpp (in); + out->mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; + out->bpp = VasEBoot_video_gop_get_bpp (in); out->bytes_per_pixel = out->bpp >> 3; if (!out->bpp) - return grub_error (GRUB_ERR_IO, "unsupported video mode"); + return VasEBoot_error (VasEBoot_ERR_IO, "unsupported video mode"); out->pitch = in->pixels_per_scanline * out->bytes_per_pixel; switch (in->pixel_format) { - case GRUB_EFI_GOT_RGBA8: + case VasEBoot_EFI_GOT_RGBA8: out->red_mask_size = 8; out->red_field_pos = 0; out->green_mask_size = 8; @@ -197,7 +197,7 @@ grub_video_gop_fill_real_mode_info (unsigned mode, out->reserved_field_pos = 24; break; - case GRUB_EFI_GOT_BGRA8: + case VasEBoot_EFI_GOT_BGRA8: out->red_mask_size = 8; out->red_field_pos = 16; out->green_mask_size = 8; @@ -208,36 +208,36 @@ grub_video_gop_fill_real_mode_info (unsigned mode, out->reserved_field_pos = 24; break; - case GRUB_EFI_GOT_BITMASK: - grub_video_gop_get_bitmask (in->pixel_bitmask.r, &out->red_mask_size, + case VasEBoot_EFI_GOT_BITMASK: + VasEBoot_video_gop_get_bitmask (in->pixel_bitmask.r, &out->red_mask_size, &out->red_field_pos); - grub_video_gop_get_bitmask (in->pixel_bitmask.g, &out->green_mask_size, + VasEBoot_video_gop_get_bitmask (in->pixel_bitmask.g, &out->green_mask_size, &out->green_field_pos); - grub_video_gop_get_bitmask (in->pixel_bitmask.b, &out->blue_mask_size, + VasEBoot_video_gop_get_bitmask (in->pixel_bitmask.b, &out->blue_mask_size, &out->blue_field_pos); - grub_video_gop_get_bitmask (in->pixel_bitmask.a, &out->reserved_mask_size, + VasEBoot_video_gop_get_bitmask (in->pixel_bitmask.a, &out->reserved_mask_size, &out->reserved_field_pos); break; default: - return grub_error (GRUB_ERR_IO, "unsupported video mode"); + return VasEBoot_error (VasEBoot_ERR_IO, "unsupported video mode"); } - out->blit_format = grub_video_get_blit_format (out); - return GRUB_ERR_NONE; + out->blit_format = VasEBoot_video_get_blit_format (out); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_gop_fill_mode_info (unsigned mode, - struct grub_efi_gop_mode_info *in, - struct grub_video_mode_info *out) +static VasEBoot_err_t +VasEBoot_video_gop_fill_mode_info (unsigned mode, + struct VasEBoot_efi_gop_mode_info *in, + struct VasEBoot_video_mode_info *out) { out->mode_number = mode; out->number_of_colors = 256; out->width = in->width; out->height = in->height; - out->mode_type = GRUB_VIDEO_MODE_TYPE_RGB; - out->bytes_per_pixel = sizeof (struct grub_efi_gop_blt_pixel); + out->mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; + out->bytes_per_pixel = sizeof (struct VasEBoot_efi_gop_blt_pixel); out->bpp = out->bytes_per_pixel << 3; out->pitch = in->width * out->bytes_per_pixel; out->red_mask_size = 8; @@ -249,25 +249,25 @@ grub_video_gop_fill_mode_info (unsigned mode, out->reserved_mask_size = 8; out->reserved_field_pos = 24; - out->blit_format = GRUB_VIDEO_BLIT_FORMAT_BGRA_8888; - out->mode_type |= (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + out->blit_format = VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888; + out->mode_type |= (VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static int -grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg) +VasEBoot_video_gop_iterate (int (*hook) (const struct VasEBoot_video_mode_info *info, void *hook_arg), void *hook_arg) { unsigned mode; for (mode = 0; mode < gop->mode->max_mode; mode++) { - grub_efi_uintn_t size; - grub_efi_status_t status; - struct grub_efi_gop_mode_info *info = NULL; - grub_err_t err; - struct grub_video_mode_info mode_info; + VasEBoot_efi_uintn_t size; + VasEBoot_efi_status_t status; + struct VasEBoot_efi_gop_mode_info *info = NULL; + VasEBoot_err_t err; + struct VasEBoot_video_mode_info mode_info; status = efi_call_4 (gop->query_mode, gop, mode, &size, &info); @@ -277,10 +277,10 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo continue; } - err = grub_video_gop_fill_mode_info (mode, info, &mode_info); + err = VasEBoot_video_gop_fill_mode_info (mode, info, &mode_info); if (err) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } if (hook (&mode_info, hook_arg)) @@ -289,103 +289,103 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo return 0; } -static grub_err_t -grub_video_gop_get_edid (struct grub_video_edid_info *edid_info) +static VasEBoot_err_t +VasEBoot_video_gop_get_edid (struct VasEBoot_video_edid_info *edid_info) { - struct grub_efi_active_edid *edid; - grub_size_t copy_size; + struct VasEBoot_efi_active_edid *edid; + VasEBoot_size_t copy_size; - grub_memset (edid_info, 0, sizeof (*edid_info)); + VasEBoot_memset (edid_info, 0, sizeof (*edid_info)); - edid = grub_efi_open_protocol (gop_handle, &active_edid_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + edid = VasEBoot_efi_open_protocol (gop_handle, &active_edid_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (!edid || edid->size_of_edid == 0) - edid = grub_efi_open_protocol (gop_handle, &discovered_edid_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + edid = VasEBoot_efi_open_protocol (gop_handle, &discovered_edid_guid, + VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (!edid || edid->size_of_edid == 0) { char edidname[] = "agp-internal-edid"; - grub_size_t datasize; - grub_uint8_t *data; - data = grub_efi_get_variable (edidname, &efi_var_guid, &datasize); + VasEBoot_size_t datasize; + VasEBoot_uint8_t *data; + data = VasEBoot_efi_get_variable (edidname, &efi_var_guid, &datasize); if (data && datasize > 16) { copy_size = datasize - 16; if (copy_size > sizeof (*edid_info)) copy_size = sizeof (*edid_info); - grub_memcpy (edid_info, data + 16, copy_size); - grub_free (data); - return GRUB_ERR_NONE; + VasEBoot_memcpy (edid_info, data + 16, copy_size); + VasEBoot_free (data); + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available"); + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "EDID information not available"); } copy_size = edid->size_of_edid; if (copy_size > sizeof (*edid_info)) copy_size = sizeof (*edid_info); - grub_memcpy (edid_info, edid->edid, copy_size); + VasEBoot_memcpy (edid_info, edid->edid, copy_size); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_gop_get_preferred_mode (unsigned int *width, unsigned int *height) +static VasEBoot_err_t +VasEBoot_gop_get_preferred_mode (unsigned int *width, unsigned int *height) { - struct grub_video_edid_info edid_info; - grub_err_t err; + struct VasEBoot_video_edid_info edid_info; + VasEBoot_err_t err; - err = grub_video_gop_get_edid (&edid_info); + err = VasEBoot_video_gop_get_edid (&edid_info); if (err) return err; - err = grub_video_edid_checksum (&edid_info); + err = VasEBoot_video_edid_checksum (&edid_info); if (err) return err; - err = grub_video_edid_preferred_mode (&edid_info, width, height); + err = VasEBoot_video_edid_preferred_mode (&edid_info, width, height); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_gop_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_gop_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) { unsigned int depth; - struct grub_efi_gop_mode_info *info = NULL; + struct VasEBoot_efi_gop_mode_info *info = NULL; unsigned best_mode = 0; - grub_err_t err; + VasEBoot_err_t err; unsigned bpp; int found = 0; unsigned long long best_volume = 0; unsigned int preferred_width = 0, preferred_height = 0; - grub_uint8_t *buffer; + VasEBoot_uint8_t *buffer; - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if (width == 0 && height == 0) { - err = grub_gop_get_preferred_mode (&preferred_width, &preferred_height); + err = VasEBoot_gop_get_preferred_mode (&preferred_width, &preferred_height); if (err || preferred_width >= 4096 || preferred_height >= 4096) { preferred_width = 800; preferred_height = 600; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } } /* Keep current mode if possible. */ if (gop->mode->info) { - bpp = grub_video_gop_get_bpp (gop->mode->info); + bpp = VasEBoot_video_gop_get_bpp (gop->mode->info); if (bpp && ((width == gop->mode->info->width && height == gop->mode->info->height) || (width == 0 && height == 0)) && (depth == bpp || depth == 0)) { - grub_dprintf ("video", "GOP: keeping mode %d\n", gop->mode->mode); + VasEBoot_dprintf ("video", "GOP: keeping mode %d\n", gop->mode->mode); best_mode = gop->mode->mode; found = 1; } @@ -394,11 +394,11 @@ grub_video_gop_setup (unsigned int width, unsigned int height, if (!found) { unsigned mode; - grub_dprintf ("video", "GOP: %d modes detected\n", gop->mode->max_mode); + VasEBoot_dprintf ("video", "GOP: %d modes detected\n", gop->mode->max_mode); for (mode = 0; mode < gop->mode->max_mode; mode++) { - grub_efi_uintn_t size; - grub_efi_status_t status; + VasEBoot_efi_uintn_t size; + VasEBoot_efi_status_t status; status = efi_call_4 (gop->query_mode, gop, mode, &size, &info); if (status) @@ -407,31 +407,31 @@ grub_video_gop_setup (unsigned int width, unsigned int height, continue; } - grub_dprintf ("video", "GOP: mode %d: %dx%d\n", mode, info->width, + VasEBoot_dprintf ("video", "GOP: mode %d: %dx%d\n", mode, info->width, info->height); if (preferred_width && (info->width > preferred_width || info->height > preferred_height)) { - grub_dprintf ("video", "GOP: mode %d: too large\n", mode); + VasEBoot_dprintf ("video", "GOP: mode %d: too large\n", mode); continue; } - bpp = grub_video_gop_get_bpp (info); + bpp = VasEBoot_video_gop_get_bpp (info); if (!bpp) { - grub_dprintf ("video", "GOP: mode %d: incompatible pixel mode\n", + VasEBoot_dprintf ("video", "GOP: mode %d: incompatible pixel mode\n", mode); continue; } - grub_dprintf ("video", "GOP: mode %d: depth %d\n", mode, bpp); + VasEBoot_dprintf ("video", "GOP: mode %d: depth %d\n", mode, bpp); if (!(((info->width == width && info->height == height) || (width == 0 && height == 0)) && (bpp == depth || depth == 0))) { - grub_dprintf ("video", "GOP: mode %d: rejected\n", mode); + VasEBoot_dprintf ("video", "GOP: mode %d: rejected\n", mode); continue; } @@ -450,8 +450,8 @@ grub_video_gop_setup (unsigned int width, unsigned int height, if (!found) { - grub_dprintf ("video", "GOP: no mode found\n"); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found"); + VasEBoot_dprintf ("video", "GOP: no mode found\n"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no matching mode found"); } if (best_mode != gop->mode->mode) @@ -466,155 +466,155 @@ grub_video_gop_setup (unsigned int width, unsigned int height, info = gop->mode->info; - err = grub_video_gop_fill_mode_info (gop->mode->mode, info, + err = VasEBoot_video_gop_fill_mode_info (gop->mode->mode, info, &framebuffer.mode_info); if (err) { - grub_dprintf ("video", "GOP: couldn't fill mode info\n"); + VasEBoot_dprintf ("video", "GOP: couldn't fill mode info\n"); return err; } - framebuffer.ptr = (void *) (grub_addr_t) gop->mode->fb_base; + framebuffer.ptr = (void *) (VasEBoot_addr_t) gop->mode->fb_base; framebuffer.offscreen - = grub_malloc (framebuffer.mode_info.height + = VasEBoot_malloc (framebuffer.mode_info.height * framebuffer.mode_info.width - * sizeof (struct grub_efi_gop_blt_pixel)); + * sizeof (struct VasEBoot_efi_gop_blt_pixel)); buffer = framebuffer.offscreen; if (!buffer) { - grub_dprintf ("video", "GOP: couldn't allocate shadow\n"); - grub_errno = 0; - err = grub_video_gop_fill_mode_info (gop->mode->mode, info, + VasEBoot_dprintf ("video", "GOP: couldn't allocate shadow\n"); + VasEBoot_errno = 0; + err = VasEBoot_video_gop_fill_mode_info (gop->mode->mode, info, &framebuffer.mode_info); buffer = framebuffer.ptr; } - grub_dprintf ("video", "GOP: initialising FB @ %p %dx%dx%d\n", + VasEBoot_dprintf ("video", "GOP: initialising FB @ %p %dx%dx%d\n", framebuffer.ptr, framebuffer.mode_info.width, framebuffer.mode_info.height, framebuffer.mode_info.bpp); - err = grub_video_fb_create_render_target_from_pointer + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.render_target, &framebuffer.mode_info, buffer); if (err) { - grub_dprintf ("video", "GOP: Couldn't create FB target\n"); + VasEBoot_dprintf ("video", "GOP: Couldn't create FB target\n"); return err; } - err = grub_video_fb_set_active_render_target (framebuffer.render_target); + err = VasEBoot_video_fb_set_active_render_target (framebuffer.render_target); if (err) { - grub_dprintf ("video", "GOP: Couldn't set FB target\n"); + VasEBoot_dprintf ("video", "GOP: Couldn't set FB target\n"); return err; } - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); if (err) - grub_dprintf ("video", "GOP: Couldn't set palette\n"); + VasEBoot_dprintf ("video", "GOP: Couldn't set palette\n"); else - grub_dprintf ("video", "GOP: Success\n"); + VasEBoot_dprintf ("video", "GOP: Success\n"); return err; } -static grub_err_t -grub_video_gop_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_gop_swap_buffers (void) { if (framebuffer.offscreen) { efi_call_10 (gop->blt, gop, framebuffer.offscreen, - GRUB_EFI_BLT_BUFFER_TO_VIDEO, 0, 0, 0, 0, + VasEBoot_EFI_BLT_BUFFER_TO_VIDEO, 0, 0, 0, 0, framebuffer.mode_info.width, framebuffer.mode_info.height, framebuffer.mode_info.width * 4); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_gop_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_gop_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) target = framebuffer.render_target; - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static grub_err_t -grub_video_gop_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_gop_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_err_t err; + VasEBoot_err_t err; - err = grub_video_gop_fill_real_mode_info (gop->mode->mode, gop->mode->info, + err = VasEBoot_video_gop_fill_real_mode_info (gop->mode->mode, gop->mode->info, mode_info); if (err) { - grub_dprintf ("video", "GOP: couldn't fill mode info\n"); + VasEBoot_dprintf ("video", "GOP: couldn't fill mode info\n"); return err; } *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - grub_free (framebuffer.offscreen); + VasEBoot_free (framebuffer.offscreen); framebuffer.offscreen = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_gop_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_gop_adapter = { .name = "EFI GOP driver", - .id = GRUB_VIDEO_DRIVER_EFI_GOP, + .id = VasEBoot_VIDEO_DRIVER_EFI_GOP, - .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE, - .init = grub_video_gop_init, - .fini = grub_video_gop_fini, - .setup = grub_video_gop_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_gop_get_info_and_fini, - .get_edid = grub_video_gop_get_edid, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_gop_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_gop_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, - .iterate = grub_video_gop_iterate, + .init = VasEBoot_video_gop_init, + .fini = VasEBoot_video_gop_fini, + .setup = VasEBoot_video_gop_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_gop_get_info_and_fini, + .get_edid = VasEBoot_video_gop_get_edid, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_gop_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_gop_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, + .iterate = VasEBoot_video_gop_iterate, .next = 0 }; -GRUB_MOD_INIT(efi_gop) +VasEBoot_MOD_INIT(efi_gop) { if (check_protocol ()) - grub_video_register (&grub_video_gop_adapter); + VasEBoot_video_register (&VasEBoot_video_gop_adapter); } -GRUB_MOD_FINI(efi_gop) +VasEBoot_MOD_FINI(efi_gop) { if (restore_needed) { @@ -622,5 +622,5 @@ GRUB_MOD_FINI(efi_gop) restore_needed = 0; } if (gop) - grub_video_unregister (&grub_video_gop_adapter); + VasEBoot_video_unregister (&VasEBoot_video_gop_adapter); } diff --git a/VasEBoot-core/video/efi_uga.c b/VasEBoot-core/video/efi_uga.c index 464ede874..ba45bbb23 100644 --- a/VasEBoot-core/video/efi_uga.c +++ b/VasEBoot-core/video/efi_uga.c @@ -1,47 +1,47 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; -static struct grub_efi_uga_draw_protocol *uga; -static grub_uint32_t uga_fb; -static grub_uint32_t uga_pitch; +static VasEBoot_efi_guid_t uga_draw_guid = VasEBoot_EFI_UGA_DRAW_GUID; +static struct VasEBoot_efi_uga_draw_protocol *uga; +static VasEBoot_uint32_t uga_fb; +static VasEBoot_uint32_t uga_pitch; static struct { - struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; - grub_uint8_t *ptr; + struct VasEBoot_video_mode_info mode_info; + struct VasEBoot_video_render_target *render_target; + VasEBoot_uint8_t *ptr; } framebuffer; #define RGB_MASK 0xffffff @@ -52,9 +52,9 @@ static struct #define FBTEST_COUNT 8 static int -find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) +find_line_len (VasEBoot_uint32_t *fb_base, VasEBoot_uint32_t *line_len) { - grub_uint32_t *base = (grub_uint32_t *) (grub_addr_t) *fb_base; + VasEBoot_uint32_t *base = (VasEBoot_uint32_t *) (VasEBoot_addr_t) *fb_base; int i; for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) @@ -67,7 +67,7 @@ find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) { if ((base[j] & RGB_MASK) == RGB_MAGIC) { - *fb_base = (grub_uint32_t) (grub_addr_t) base; + *fb_base = (VasEBoot_uint32_t) (VasEBoot_addr_t) base; *line_len = j << 2; return 1; @@ -84,64 +84,64 @@ find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) /* Context for find_framebuf. */ struct find_framebuf_ctx { - grub_uint32_t *fb_base; - grub_uint32_t *line_len; + VasEBoot_uint32_t *fb_base; + VasEBoot_uint32_t *line_len; int found; }; /* Helper for find_framebuf. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { struct find_framebuf_ctx *ctx = data; - grub_pci_address_t addr; + VasEBoot_pci_address_t addr; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - if (grub_pci_read (addr) >> 24 == 0x3) + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + if (VasEBoot_pci_read (addr) >> 24 == 0x3) { int i; - grub_dprintf ("fb", "Display controller: %d:%d.%d\nDevice id: %x\n", - grub_pci_get_bus (dev), grub_pci_get_device (dev), - grub_pci_get_function (dev), pciid); + VasEBoot_dprintf ("fb", "Display controller: %d:%d.%d\nDevice id: %x\n", + VasEBoot_pci_get_bus (dev), VasEBoot_pci_get_device (dev), + VasEBoot_pci_get_function (dev), pciid); addr += 8; for (i = 0; i < 6; i++, addr += 4) { - grub_uint32_t old_bar1, old_bar2, type; - grub_uint64_t base64; + VasEBoot_uint32_t old_bar1, old_bar2, type; + VasEBoot_uint64_t base64; - old_bar1 = grub_pci_read (addr); - if ((! old_bar1) || (old_bar1 & GRUB_PCI_ADDR_SPACE_IO)) + old_bar1 = VasEBoot_pci_read (addr); + if ((! old_bar1) || (old_bar1 & VasEBoot_PCI_ADDR_SPACE_IO)) continue; - type = old_bar1 & GRUB_PCI_ADDR_MEM_TYPE_MASK; - if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + type = old_bar1 & VasEBoot_PCI_ADDR_MEM_TYPE_MASK; + if (type == VasEBoot_PCI_ADDR_MEM_TYPE_64) { if (i == 5) break; - old_bar2 = grub_pci_read (addr + 4); + old_bar2 = VasEBoot_pci_read (addr + 4); } else old_bar2 = 0; base64 = old_bar2; base64 <<= 32; - base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); + base64 |= (old_bar1 & VasEBoot_PCI_ADDR_MEM_MASK); - grub_dprintf ("fb", "%s(%d): 0x%llx\n", - ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? + VasEBoot_dprintf ("fb", "%s(%d): 0x%llx\n", + ((old_bar1 & VasEBoot_PCI_ADDR_MEM_PREFETCH) ? "VMEM" : "MMIO"), i, (unsigned long long) base64); - if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! ctx->found)) + if ((old_bar1 & VasEBoot_PCI_ADDR_MEM_PREFETCH) && (! ctx->found)) { *ctx->fb_base = base64; if (find_line_len (ctx->fb_base, ctx->line_len)) ctx->found++; } - if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + if (type == VasEBoot_PCI_ADDR_MEM_TYPE_64) { i++; addr += 4; @@ -153,7 +153,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) } static int -find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) +find_framebuf (VasEBoot_uint32_t *fb_base, VasEBoot_uint32_t *line_len) { struct find_framebuf_ctx ctx = { .fb_base = fb_base, @@ -161,30 +161,30 @@ find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) .found = 0 }; - grub_pci_iterate (find_card, &ctx); + VasEBoot_pci_iterate (find_card, &ctx); return ctx.found; } static int check_protocol (void) { - grub_efi_uga_draw_protocol_t *c; + VasEBoot_efi_uga_draw_protocol_t *c; - c = grub_efi_locate_protocol (&uga_draw_guid, 0); + c = VasEBoot_efi_locate_protocol (&uga_draw_guid, 0); if (c) { - grub_uint32_t width, height, depth, rate, pixel; + VasEBoot_uint32_t width, height, depth, rate, pixel; int ret; if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate)) return 0; - grub_efi_set_text_mode (0); + VasEBoot_efi_set_text_mode (0); pixel = RGB_MAGIC; - efi_call_10 (c->blt, c, (struct grub_efi_uga_pixel *) &pixel, - GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0); + efi_call_10 (c->blt, c, (struct VasEBoot_efi_uga_pixel *) &pixel, + VasEBoot_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0); ret = find_framebuf (&uga_fb, &uga_pitch); - grub_efi_set_text_mode (1); + VasEBoot_efi_set_text_mode (1); if (ret) { @@ -196,35 +196,35 @@ check_protocol (void) return 0; } -static grub_err_t -grub_video_uga_init (void) +static VasEBoot_err_t +VasEBoot_video_uga_init (void) { - grub_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_uga_fini (void) +static VasEBoot_err_t +VasEBoot_video_uga_fini (void) { - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } -static grub_err_t -grub_video_uga_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_uga_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) { unsigned int depth; int found = 0; - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; { - grub_uint32_t w; - grub_uint32_t h; - grub_uint32_t d; - grub_uint32_t r; + VasEBoot_uint32_t w; + VasEBoot_uint32_t h; + VasEBoot_uint32_t d; + VasEBoot_uint32_t r; if ((! efi_call_5 (uga->get_mode, uga, &w, &h, &d, &r)) && ((! width) || (width == w)) && @@ -234,7 +234,7 @@ grub_video_uga_setup (unsigned int width, unsigned int height, framebuffer.mode_info.width = w; framebuffer.mode_info.height = h; framebuffer.mode_info.pitch = uga_pitch; - framebuffer.ptr = (grub_uint8_t *) (grub_addr_t) uga_fb; + framebuffer.ptr = (VasEBoot_uint8_t *) (VasEBoot_addr_t) uga_fb; found = 1; } @@ -242,9 +242,9 @@ grub_video_uga_setup (unsigned int width, unsigned int height, if (found) { - grub_err_t err; + VasEBoot_err_t err; - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; framebuffer.mode_info.bpp = 32; framebuffer.mode_info.bytes_per_pixel = 4; framebuffer.mode_info.number_of_colors = 256; @@ -258,9 +258,9 @@ grub_video_uga_setup (unsigned int width, unsigned int height, framebuffer.mode_info.reserved_field_pos = 24; framebuffer.mode_info.blit_format = - grub_video_get_blit_format (&framebuffer.mode_info); + VasEBoot_video_get_blit_format (&framebuffer.mode_info); - err = grub_video_fb_create_render_target_from_pointer + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.render_target, &framebuffer.mode_info, framebuffer.ptr); @@ -268,92 +268,92 @@ grub_video_uga_setup (unsigned int width, unsigned int height, if (err) return err; - err = grub_video_fb_set_active_render_target + err = VasEBoot_video_fb_set_active_render_target (framebuffer.render_target); if (err) return err; - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); return err; } - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no matching mode found"); } -static grub_err_t -grub_video_uga_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_uga_swap_buffers (void) { /* TODO: Implement buffer swapping. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_uga_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_uga_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) target = framebuffer.render_target; - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static grub_err_t -grub_video_uga_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_uga_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_uga_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_uga_adapter = { .name = "EFI UGA driver", - .id = GRUB_VIDEO_DRIVER_EFI_UGA, + .id = VasEBoot_VIDEO_DRIVER_EFI_UGA, - .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY, - .init = grub_video_uga_init, - .fini = grub_video_uga_fini, - .setup = grub_video_uga_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_uga_get_info_and_fini, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_uga_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_uga_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_uga_init, + .fini = VasEBoot_video_uga_fini, + .setup = VasEBoot_video_uga_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_uga_get_info_and_fini, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_uga_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_uga_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, }; -GRUB_MOD_INIT(efi_uga) +VasEBoot_MOD_INIT(efi_uga) { if (check_protocol ()) - grub_video_register (&grub_video_uga_adapter); + VasEBoot_video_register (&VasEBoot_video_uga_adapter); } -GRUB_MOD_FINI(efi_uga) +VasEBoot_MOD_FINI(efi_uga) { if (uga) - grub_video_unregister (&grub_video_uga_adapter); + VasEBoot_video_unregister (&VasEBoot_video_uga_adapter); } diff --git a/VasEBoot-core/video/emu/sdl.c b/VasEBoot-core/video/emu/sdl.c index a2f639f66..743eef736 100644 --- a/VasEBoot-core/video/emu/sdl.c +++ b/VasEBoot-core/video/emu/sdl.c @@ -1,86 +1,86 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static SDL_Surface *window = 0; -static struct grub_video_render_target *sdl_render_target; -static struct grub_video_mode_info mode_info; +static struct VasEBoot_video_render_target *sdl_render_target; +static struct VasEBoot_video_mode_info mode_info; -static grub_err_t -grub_video_sdl_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); +static VasEBoot_err_t +VasEBoot_video_sdl_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); -static grub_err_t -grub_video_sdl_init (void) +static VasEBoot_err_t +VasEBoot_video_sdl_init (void) { window = 0; if (SDL_Init (SDL_INIT_VIDEO) < 0) - return grub_error (GRUB_ERR_BAD_DEVICE, "Couldn't init SDL: %s", + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "Couldn't init SDL: %s", SDL_GetError ()); - grub_memset (&mode_info, 0, sizeof (mode_info)); + VasEBoot_memset (&mode_info, 0, sizeof (mode_info)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_sdl_fini (void) +static VasEBoot_err_t +VasEBoot_video_sdl_fini (void) { SDL_Quit (); window = 0; - grub_memset (&mode_info, 0, sizeof (mode_info)); + VasEBoot_memset (&mode_info, 0, sizeof (mode_info)); - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } static inline unsigned int -get_mask_size (grub_uint32_t mask) +get_mask_size (VasEBoot_uint32_t mask) { unsigned i; for (i = 0; mask > 1U << i; i++); return i; } -static grub_err_t -grub_video_sdl_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_sdl_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask) { int depth; int flags = 0; - grub_err_t err; + VasEBoot_err_t err; /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if (depth == 0) depth = 32; @@ -91,29 +91,29 @@ grub_video_sdl_setup (unsigned int width, unsigned int height, height = 600; } - if ((mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED) - || !(mode_mask & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) + if ((mode_type & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED) + || !(mode_mask & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) flags |= SDL_DOUBLEBUF; window = SDL_SetVideoMode (width, height, depth, flags | SDL_HWSURFACE); if (! window) window = SDL_SetVideoMode (width, height, depth, flags | SDL_SWSURFACE); if (! window) - return grub_error (GRUB_ERR_BAD_DEVICE, "Couldn't open window: %s", + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "Couldn't open window: %s", SDL_GetError ()); - grub_memset (&sdl_render_target, 0, sizeof (sdl_render_target)); + VasEBoot_memset (&sdl_render_target, 0, sizeof (sdl_render_target)); mode_info.width = window->w; mode_info.height = window->h; mode_info.mode_type = 0; if (window->flags & SDL_DOUBLEBUF) mode_info.mode_type - |= GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED; + |= VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED; if (window->format->palette) - mode_info.mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + mode_info.mode_type |= VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; else - mode_info.mode_type |= GRUB_VIDEO_MODE_TYPE_RGB; + mode_info.mode_type |= VasEBoot_VIDEO_MODE_TYPE_RGB; mode_info.bpp = window->format->BitsPerPixel; mode_info.bytes_per_pixel = window->format->BytesPerPixel; @@ -141,38 +141,38 @@ grub_video_sdl_setup (unsigned int width, unsigned int height, = get_mask_size (window->format->Amask >> window->format->Ashift); mode_info.reserved_field_pos = window->format->Ashift; mode_info.blit_format - = grub_video_get_blit_format (&mode_info); + = VasEBoot_video_get_blit_format (&mode_info); } - err = grub_video_fb_create_render_target_from_pointer (&sdl_render_target, + err = VasEBoot_video_fb_create_render_target_from_pointer (&sdl_render_target, &mode_info, window->pixels); if (err) return err; /* Copy default palette to initialize emulated palette. */ - grub_video_sdl_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + VasEBoot_video_sdl_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); /* Reset render target to SDL one. */ - return grub_video_fb_set_active_render_target (sdl_render_target); + return VasEBoot_video_fb_set_active_render_target (sdl_render_target); } -static grub_err_t -grub_video_sdl_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +static VasEBoot_err_t +VasEBoot_video_sdl_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { unsigned i; if (window->format->palette) { SDL_Color *tmp; if (start >= mode_info.number_of_colors) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (start + count > mode_info.number_of_colors) count = mode_info.number_of_colors - start; - tmp = grub_malloc (count * sizeof (tmp[0])); + tmp = VasEBoot_malloc (count * sizeof (tmp[0])); for (i = 0; i < count; i++) { tmp[i].r = palette_data[i].r; @@ -181,72 +181,72 @@ grub_video_sdl_set_palette (unsigned int start, unsigned int count, tmp[i].unused = palette_data[i].a; } SDL_SetColors (window, tmp, start, count); - grub_free (tmp); + VasEBoot_free (tmp); } - return grub_video_fb_set_palette (start, count, palette_data); + return VasEBoot_video_fb_set_palette (start, count, palette_data); } -static grub_err_t -grub_video_sdl_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_sdl_swap_buffers (void) { if (SDL_Flip (window) < 0) - return grub_error (GRUB_ERR_BAD_DEVICE, "couldn't swap buffers: %s", + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "couldn't swap buffers: %s", SDL_GetError ()); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_sdl_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_sdl_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) - return grub_video_fb_set_active_render_target (sdl_render_target); + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) + return VasEBoot_video_fb_set_active_render_target (sdl_render_target); - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static struct grub_video_adapter grub_video_sdl_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_sdl_adapter = { .name = "SDL Video Driver", - .id = GRUB_VIDEO_DRIVER_SDL, + .id = VasEBoot_VIDEO_DRIVER_SDL, - .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE, - .init = grub_video_sdl_init, - .fini = grub_video_sdl_fini, - .setup = grub_video_sdl_setup, - .get_info = grub_video_fb_get_info, - .set_palette = grub_video_sdl_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_sdl_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_sdl_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_sdl_init, + .fini = VasEBoot_video_sdl_fini, + .setup = VasEBoot_video_sdl_setup, + .get_info = VasEBoot_video_fb_get_info, + .set_palette = VasEBoot_video_sdl_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_sdl_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_sdl_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(sdl) +VasEBoot_MOD_INIT(sdl) { - grub_video_register (&grub_video_sdl_adapter); + VasEBoot_video_register (&VasEBoot_video_sdl_adapter); } -GRUB_MOD_FINI(sdl) +VasEBoot_MOD_FINI(sdl) { - grub_video_unregister (&grub_video_sdl_adapter); + VasEBoot_video_unregister (&VasEBoot_video_sdl_adapter); } diff --git a/VasEBoot-core/video/fb/fbblit.c b/VasEBoot-core/video/fb/fbblit.c index d55924837..b9e96aa25 100644 --- a/VasEBoot-core/video/fb/fbblit.c +++ b/VasEBoot-core/video/fb/fbblit.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* SPECIAL NOTES! @@ -27,28 +27,28 @@ - Every function in this code assumes that bounds checking has been done in previous phase and they are opted out in here. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* Generic replacing blitter (slow). Works for every supported format. */ static void -grub_video_fbblit_replace (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t src_red; - grub_uint8_t src_green; - grub_uint8_t src_blue; - grub_uint8_t src_alpha; - grub_video_color_t src_color; - grub_video_color_t dst_color; + VasEBoot_uint8_t src_red; + VasEBoot_uint8_t src_green; + VasEBoot_uint8_t src_blue; + VasEBoot_uint8_t src_alpha; + VasEBoot_video_color_t src_color; + VasEBoot_video_color_t dst_color; for (j = 0; j < height; j++) { @@ -56,10 +56,10 @@ grub_video_fbblit_replace (struct grub_video_fbblit_info *dst, { src_color = get_pixel (src, i + offset_x, j + offset_y); - grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green, + VasEBoot_video_fb_unmap_color_int (src, src_color, &src_red, &src_green, &src_blue, &src_alpha); - dst_color = grub_video_fb_map_rgba (src_red, src_green, + dst_color = VasEBoot_video_fb_map_rgba (src_red, src_green, src_blue, src_alpha); set_pixel (dst, x + i, y + j, dst_color); @@ -69,44 +69,44 @@ grub_video_fbblit_replace (struct grub_video_fbblit_info *dst, /* Block copy replacing blitter. Works with modes multiple of 8 bits. */ static void -grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_directN (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int j; - grub_uint32_t *srcptr; - grub_uint32_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint32_t *dstptr; int bpp; bpp = src->mode_info->bytes_per_pixel; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { - grub_memmove (dstptr, srcptr, width * bpp); - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, src->mode_info->pitch); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dst->mode_info->pitch); + VasEBoot_memmove (dstptr, srcptr, width * bpp); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, src->mode_info->pitch); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dst->mode_info->pitch); } } /* Optimized replacing blitter for 1-bit to 32bit. */ static void -grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_32bit_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint32_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint32_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint32_t fgcolor, bgcolor; + VasEBoot_uint32_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -116,16 +116,16 @@ grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -156,28 +156,28 @@ grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst, srcptr++; srcmask <<= 8 - srcrowskipbit; } - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } -#ifdef GRUB_HAVE_UNALIGNED_ACCESS +#ifdef VasEBoot_HAVE_UNALIGNED_ACCESS /* Optimized replacing blitter for 1-bit to 24-bit. */ static void -grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_24bit_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint32_t fgcolor, bgcolor; + VasEBoot_uint32_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -187,16 +187,16 @@ grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -206,9 +206,9 @@ grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst, for (i = 0; i < width - 1; i++) { if (*srcptr & srcmask) - *(grub_uint32_t *) dstptr = fgcolor; + *(VasEBoot_uint32_t *) dstptr = fgcolor; else - *(grub_uint32_t *) dstptr = bgcolor; + *(VasEBoot_uint32_t *) dstptr = bgcolor; srcmask >>= 1; if (!srcmask) { @@ -253,20 +253,20 @@ grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for 1-bit to 16-bit. */ static void -grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_16bit_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint16_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint16_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint16_t fgcolor, bgcolor; + VasEBoot_uint16_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -276,16 +276,16 @@ grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -316,26 +316,26 @@ grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst, srcptr++; srcmask <<= 8 - srcrowskipbit; } - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for 1-bit to 8-bit. */ static void -grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_8bit_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint8_t fgcolor, bgcolor; + VasEBoot_uint8_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -345,16 +345,16 @@ grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -390,22 +390,22 @@ grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst, } static void -grub_video_fbblit_replace_32bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_32bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint32_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint32_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint32_t palette[17]; + VasEBoot_uint32_t palette[17]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -413,8 +413,8 @@ grub_video_fbblit_replace_32bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); - palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0); + palette[i] = VasEBoot_video_fb_map_color (i); + palette[16] = VasEBoot_video_fb_map_rgba (0, 0, 0, 0); for (j = 0; j < height; j++) { @@ -429,28 +429,28 @@ grub_video_fbblit_replace_32bit_indexa (struct grub_video_fbblit_info *dst, } srcptr += srcrowskip; - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for 1-bit to 16bit. */ static void -grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_24bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint32_t palette[17]; + VasEBoot_uint32_t palette[17]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -458,19 +458,19 @@ grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); - palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0); + palette[i] = VasEBoot_video_fb_map_color (i); + palette[16] = VasEBoot_video_fb_map_rgba (0, 0, 0, 0); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - register grub_uint32_t col; + register VasEBoot_uint32_t col; if (*srcptr == 0xf0) col = palette[16]; else col = palette[*srcptr & 0xf]; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = col >> 16; *dstptr++ = col >> 8; *dstptr++ = col >> 0; @@ -489,22 +489,22 @@ grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for 1-bit to 16bit. */ static void -grub_video_fbblit_replace_16bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_16bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint16_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint16_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint16_t palette[17]; + VasEBoot_uint16_t palette[17]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -512,8 +512,8 @@ grub_video_fbblit_replace_16bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); - palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0); + palette[i] = VasEBoot_video_fb_map_color (i); + palette[16] = VasEBoot_video_fb_map_rgba (0, 0, 0, 0); for (j = 0; j < height; j++) { @@ -528,28 +528,28 @@ grub_video_fbblit_replace_16bit_indexa (struct grub_video_fbblit_info *dst, } srcptr += srcrowskip; - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for 1-bit to 8bit. */ static void -grub_video_fbblit_replace_8bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_8bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint8_t palette[17]; + VasEBoot_uint8_t palette[17]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -557,8 +557,8 @@ grub_video_fbblit_replace_8bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); - palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0); + palette[i] = VasEBoot_video_fb_map_color (i); + palette[16] = VasEBoot_video_fb_map_rgba (0, 0, 0, 0); for (j = 0; j < height; j++) { @@ -579,22 +579,22 @@ grub_video_fbblit_replace_8bit_indexa (struct grub_video_fbblit_info *dst, static void -grub_video_fbblit_blend_32bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_32bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint32_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint32_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint32_t palette[16]; + VasEBoot_uint32_t palette[16]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -602,7 +602,7 @@ grub_video_fbblit_blend_32bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); + palette[i] = VasEBoot_video_fb_map_color (i); for (j = 0; j < height; j++) { @@ -615,28 +615,28 @@ grub_video_fbblit_blend_32bit_indexa (struct grub_video_fbblit_info *dst, } srcptr += srcrowskip; - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for 1-bit to 16bit. */ static void -grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_24bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint32_t palette[16]; + VasEBoot_uint32_t palette[16]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -644,17 +644,17 @@ grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); + palette[i] = VasEBoot_video_fb_map_color (i); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - register grub_uint32_t col; + register VasEBoot_uint32_t col; if (*srcptr != 0xf0) { col = palette[*srcptr & 0xf]; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = col >> 16; *dstptr++ = col >> 8; *dstptr++ = col >> 0; @@ -676,22 +676,22 @@ grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for 1-bit to 16bit. */ static void -grub_video_fbblit_blend_16bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_16bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint16_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint16_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint16_t palette[17]; + VasEBoot_uint16_t palette[17]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -699,7 +699,7 @@ grub_video_fbblit_blend_16bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); + palette[i] = VasEBoot_video_fb_map_color (i); for (j = 0; j < height; j++) { @@ -712,28 +712,28 @@ grub_video_fbblit_blend_16bit_indexa (struct grub_video_fbblit_info *dst, } srcptr += srcrowskip; - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for 1-bit to 8bit. */ static void -grub_video_fbblit_blend_8bit_indexa (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_8bit_indexa (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int dstrowskip; unsigned int srcrowskip; - grub_uint8_t palette[16]; + VasEBoot_uint8_t palette[16]; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ @@ -741,7 +741,7 @@ grub_video_fbblit_blend_8bit_indexa (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - width; for (i = 0; i < 16; i++) - palette[i] = grub_video_fb_map_color (i); + palette[i] = VasEBoot_video_fb_map_color (i); for (j = 0; j < height; j++) { @@ -761,16 +761,16 @@ grub_video_fbblit_blend_8bit_indexa (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for RGBX8888 to BGRX8888. */ static void -grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_BGRX8888_RGBX8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int srcrowskip; unsigned int dstrowskip; @@ -779,30 +779,30 @@ grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { -#ifdef GRUB_CPU_WORDS_BIGENDIAN - grub_uint8_t a = *srcptr++; +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_uint8_t a = *srcptr++; #endif - grub_uint8_t r = *srcptr++; - grub_uint8_t g = *srcptr++; - grub_uint8_t b = *srcptr++; -#ifndef GRUB_CPU_WORDS_BIGENDIAN - grub_uint8_t a = *srcptr++; + VasEBoot_uint8_t r = *srcptr++; + VasEBoot_uint8_t g = *srcptr++; + VasEBoot_uint8_t b = *srcptr++; +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_uint8_t a = *srcptr++; #endif -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = a; #endif *dstptr++ = b; *dstptr++ = g; *dstptr++ = r; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = a; #endif } @@ -814,16 +814,16 @@ grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for RGB888 to BGRX8888. */ static void -grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_BGRX8888_RGB888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int srcrowskip; unsigned int dstrowskip; @@ -832,18 +832,18 @@ grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - grub_uint8_t r = *srcptr++; - grub_uint8_t g = *srcptr++; - grub_uint8_t b = *srcptr++; + VasEBoot_uint8_t r = *srcptr++; + VasEBoot_uint8_t g = *srcptr++; + VasEBoot_uint8_t b = *srcptr++; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN /* Set alpha component as opaque. */ *dstptr++ = 255; #endif @@ -852,7 +852,7 @@ grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, *dstptr++ = g; *dstptr++ = r; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN /* Set alpha component as opaque. */ *dstptr++ = 255; #endif @@ -865,14 +865,14 @@ grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for RGBX8888 to BGR888. */ static void -grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_BGR888_RGBX8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int srcrowskip; unsigned int dstrowskip; int i; @@ -883,17 +883,17 @@ grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - grub_uint32_t color; - grub_uint8_t sr; - grub_uint8_t sg; - grub_uint8_t sb; + VasEBoot_uint32_t color; + VasEBoot_uint8_t sr; + VasEBoot_uint8_t sg; + VasEBoot_uint8_t sb; color = *srcptr++; @@ -901,7 +901,7 @@ grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, sg = (color >> 8) & 0xFF; sb = (color >> 16) & 0xFF; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = sr; *dstptr++ = sg; *dstptr++ = sb; @@ -912,23 +912,23 @@ grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, #endif } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); dstptr += dstrowskip; } } /* Optimized replacing blitter for RGB888 to BGR888. */ static void -grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_BGR888_RGB888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int srcrowskip; unsigned int dstrowskip; @@ -937,16 +937,16 @@ grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - grub_uint8_t r = *srcptr++; - grub_uint8_t g = *srcptr++; - grub_uint8_t b = *srcptr++; + VasEBoot_uint8_t r = *srcptr++; + VasEBoot_uint8_t g = *srcptr++; + VasEBoot_uint8_t b = *srcptr++; *dstptr++ = b; *dstptr++ = g; @@ -960,33 +960,33 @@ grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst, /* Optimized replacing blitter for RGB888 to RGBX8888. */ static void -grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_RGBX8888_RGB888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint8_t *srcptr; - grub_uint32_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint32_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; srcrowskip = src->mode_info->pitch - 3 * width; dstrowskip = dst->mode_info->pitch - 4 * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN sb = *srcptr++; sg = *srcptr++; sr = *srcptr++; @@ -1000,32 +1000,32 @@ grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst, *dstptr++ = color; } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for RGBX8888 to RGB888. */ static void -grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_RGB888_RGBX8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); srcrowskip = src->mode_info->pitch - 4 * width; dstrowskip = dst->mode_info->pitch - 3 * width; @@ -1039,7 +1039,7 @@ grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst, sg = (color >> 8) & 0xFF; sb = (color >> 16) & 0xFF; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = sr; *dstptr++ = sg; *dstptr++ = sb; @@ -1049,35 +1049,35 @@ grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst, *dstptr++ = sr; #endif } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for RGBX8888 to indexed color. */ static void -grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_index_RGBX8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; srcrowskip = src->mode_info->pitch - 4 * width; dstrowskip = dst->mode_info->pitch - width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -1089,44 +1089,44 @@ grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst, sg = (color >> 8) & 0xFF; sb = (color >> 16) & 0xFF; - color = grub_video_fb_map_rgb(sr, sg, sb); + color = VasEBoot_video_fb_map_rgb(sr, sg, sb); *dstptr++ = color & 0xFF; } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized replacing blitter for RGB888 to indexed color. */ static void -grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_replace_index_RGB888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; srcrowskip = src->mode_info->pitch - 3 * width; dstrowskip = dst->mode_info->pitch - width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN sr = *srcptr++; sg = *srcptr++; sb = *srcptr++; @@ -1136,20 +1136,20 @@ grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst, sr = *srcptr++; #endif - color = grub_video_fb_map_rgb(sr, sg, sb); + color = VasEBoot_video_fb_map_rgb(sr, sg, sb); *dstptr++ = color & 0xFF; } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } -static inline grub_uint8_t -alpha_dilute (grub_uint8_t bg, grub_uint8_t fg, grub_uint8_t alpha) +static inline VasEBoot_uint8_t +alpha_dilute (VasEBoot_uint8_t bg, VasEBoot_uint8_t fg, VasEBoot_uint8_t alpha) { - grub_uint16_t s; - grub_uint16_t h, l; + VasEBoot_uint16_t s; + VasEBoot_uint16_t h, l; s = (fg * alpha) + (bg * (255 ^ alpha)); /* Optimised division by 255. */ h = s >> 8; @@ -1161,8 +1161,8 @@ alpha_dilute (grub_uint8_t bg, grub_uint8_t fg, grub_uint8_t alpha) /* Generic blending blitter. Works for every supported format. */ static void -grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { @@ -1173,19 +1173,19 @@ grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, { for (i = 0; i < width; i++) { - grub_uint8_t src_red; - grub_uint8_t src_green; - grub_uint8_t src_blue; - grub_uint8_t src_alpha; - grub_uint8_t dst_red; - grub_uint8_t dst_green; - grub_uint8_t dst_blue; - grub_uint8_t dst_alpha; - grub_video_color_t src_color; - grub_video_color_t dst_color; + VasEBoot_uint8_t src_red; + VasEBoot_uint8_t src_green; + VasEBoot_uint8_t src_blue; + VasEBoot_uint8_t src_alpha; + VasEBoot_uint8_t dst_red; + VasEBoot_uint8_t dst_green; + VasEBoot_uint8_t dst_blue; + VasEBoot_uint8_t dst_alpha; + VasEBoot_video_color_t src_color; + VasEBoot_video_color_t dst_color; src_color = get_pixel (src, i + offset_x, j + offset_y); - grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green, + VasEBoot_video_fb_unmap_color_int (src, src_color, &src_red, &src_green, &src_blue, &src_alpha); if (src_alpha == 0) @@ -1193,7 +1193,7 @@ grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, if (src_alpha == 255) { - dst_color = grub_video_fb_map_rgba (src_red, src_green, + dst_color = VasEBoot_video_fb_map_rgba (src_red, src_green, src_blue, src_alpha); set_pixel (dst, x + i, y + j, dst_color); continue; @@ -1201,7 +1201,7 @@ grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, dst_color = get_pixel (dst, x + i, y + j); - grub_video_fb_unmap_color_int (dst, dst_color, &dst_red, + VasEBoot_video_fb_unmap_color_int (dst, dst_color, &dst_red, &dst_green, &dst_blue, &dst_alpha); dst_red = alpha_dilute (dst_red, src_red, src_alpha); @@ -1209,7 +1209,7 @@ grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, dst_blue = alpha_dilute (dst_blue, src_blue, src_alpha); dst_alpha = src_alpha; - dst_color = grub_video_fb_map_rgba (dst_red, dst_green, dst_blue, + dst_color = VasEBoot_video_fb_map_rgba (dst_red, dst_green, dst_blue, dst_alpha); set_pixel (dst, x + i, y + j, dst_color); @@ -1219,14 +1219,14 @@ grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, /* Optimized blending blitter for RGBA8888 to BGRA8888. */ static void -grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_BGRA8888_RGBA8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t *srcptr; - grub_uint32_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint32_t *dstptr; unsigned int srcrowskip; unsigned int dstrowskip; int i; @@ -1237,14 +1237,14 @@ grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - grub_uint32_t color; + VasEBoot_uint32_t color; unsigned int sr; unsigned int sg; unsigned int sb; @@ -1293,21 +1293,21 @@ grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, *dstptr++ = color; } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized blending blitter for RGBA8888 to BGR888. */ static void -grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_BGR888_RGBA8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int srcrowskip; unsigned int dstrowskip; int i; @@ -1318,14 +1318,14 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { - grub_uint32_t color; + VasEBoot_uint32_t color; unsigned int sr; unsigned int sg; unsigned int sb; @@ -1361,7 +1361,7 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, /* General pixel color blending. */ color = *dstptr; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN db = dstptr[0]; dg = dstptr[1]; dr = dstptr[2]; @@ -1376,7 +1376,7 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, dr = alpha_dilute (dr, sr, a); } -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = db; *dstptr++ = dg; *dstptr++ = dr; @@ -1387,24 +1387,24 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, #endif } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); dstptr += dstrowskip; } } /* Optimized blending blitter for RGBA888 to RGBA8888. */ static void -grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_RGBA8888_RGBA8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint32_t *srcptr; - grub_uint32_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint32_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; @@ -1412,14 +1412,14 @@ grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, unsigned int dr; unsigned int dg; unsigned int db; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; srcrowskip = src->mode_info->pitch - 4 * width; dstrowskip = dst->mode_info->pitch - 4 * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -1459,24 +1459,24 @@ grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, *dstptr++ = color; } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized blending blitter for RGBA8888 to RGB888. */ static void -grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_RGB888_RGBA8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; @@ -1484,14 +1484,14 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, unsigned int dr; unsigned int dg; unsigned int db; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; srcrowskip = src->mode_info->pitch - 4 * width; dstrowskip = dst->mode_info->pitch - 3 * width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -1513,7 +1513,7 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, if (a == 255) { -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = sr; *dstptr++ = sg; *dstptr++ = sb; @@ -1526,7 +1526,7 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, continue; } -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN dr = dstptr[0]; dg = dstptr[1]; db = dstptr[2]; @@ -1540,7 +1540,7 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, dg = alpha_dilute (dg, sg, a); db = alpha_dilute (db, sb, a); -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN *dstptr++ = dr; *dstptr++ = dg; *dstptr++ = db; @@ -1550,24 +1550,24 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, *dstptr++ = dr; #endif } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized blending blitter for RGBA8888 to indexed color. */ static void -grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_index_RGBA8888 (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { - grub_uint32_t color; + VasEBoot_uint32_t color; int i; int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; + VasEBoot_uint32_t *srcptr; + VasEBoot_uint8_t *dstptr; unsigned int sr; unsigned int sg; unsigned int sb; @@ -1576,14 +1576,14 @@ grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, unsigned char dg; unsigned char db; unsigned char da; - grub_size_t srcrowskip; - grub_size_t dstrowskip; + VasEBoot_size_t srcrowskip; + VasEBoot_size_t dstrowskip; srcrowskip = src->mode_info->pitch - 4 * width; dstrowskip = dst->mode_info->pitch - width; - srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + srcptr = VasEBoot_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -1605,42 +1605,42 @@ grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, if (a == 255) { - color = grub_video_fb_map_rgb(sr, sg, sb); + color = VasEBoot_video_fb_map_rgb(sr, sg, sb); *dstptr++ = color & 0xFF; continue; } - grub_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); + VasEBoot_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); dr = alpha_dilute (dr, sr, a); dg = alpha_dilute (dg, sg, a); db = alpha_dilute (db, sb, a); - color = grub_video_fb_map_rgb(dr, dg, db); + color = VasEBoot_video_fb_map_rgb(dr, dg, db); *dstptr++ = color & 0xFF; } - GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized blending blitter for 1-bit to XXXA8888. */ static void -grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_XXXA8888_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint32_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint32_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint32_t fgcolor, bgcolor; + VasEBoot_uint32_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -1650,16 +1650,16 @@ grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -1668,8 +1668,8 @@ grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, { for (i = 0; i < width; i++) { - grub_uint32_t color; - grub_uint8_t a; + VasEBoot_uint32_t color; + VasEBoot_uint8_t a; if (*srcptr & srcmask) { @@ -1686,13 +1686,13 @@ grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, *dstptr = color; else if (a != 0) { - grub_uint8_t s1 = (color >> 0) & 0xFF; - grub_uint8_t s2 = (color >> 8) & 0xFF; - grub_uint8_t s3 = (color >> 16) & 0xFF; + VasEBoot_uint8_t s1 = (color >> 0) & 0xFF; + VasEBoot_uint8_t s2 = (color >> 8) & 0xFF; + VasEBoot_uint8_t s3 = (color >> 16) & 0xFF; - grub_uint8_t d1 = (*dstptr >> 0) & 0xFF; - grub_uint8_t d2 = (*dstptr >> 8) & 0xFF; - grub_uint8_t d3 = (*dstptr >> 16) & 0xFF; + VasEBoot_uint8_t d1 = (*dstptr >> 0) & 0xFF; + VasEBoot_uint8_t d2 = (*dstptr >> 8) & 0xFF; + VasEBoot_uint8_t d3 = (*dstptr >> 16) & 0xFF; d1 = alpha_dilute (d1, s1, a); d2 = alpha_dilute (d2, s2, a); @@ -1719,27 +1719,27 @@ grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, srcptr++; srcmask <<= 8 - srcrowskipbit; } - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* Optimized blending blitter for 1-bit to XXX888. */ -#ifdef GRUB_HAVE_UNALIGNED_ACCESS +#ifdef VasEBoot_HAVE_UNALIGNED_ACCESS static void -grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_XXX888_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint8_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint32_t fgcolor, bgcolor; + VasEBoot_uint32_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -1749,16 +1749,16 @@ grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -1767,8 +1767,8 @@ grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, { for (i = 0; i < width; i++) { - grub_uint32_t color; - grub_uint8_t a; + VasEBoot_uint32_t color; + VasEBoot_uint8_t a; if (*srcptr & srcmask) { color = fgcolor; @@ -1782,29 +1782,29 @@ grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, if (a == 255) { -#ifndef GRUB_CPU_WORDS_BIGENDIAN - ((grub_uint8_t *) dstptr)[0] = color & 0xff; - ((grub_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8; - ((grub_uint8_t *) dstptr)[2] = (color & 0xff0000) >> 16; +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN + ((VasEBoot_uint8_t *) dstptr)[0] = color & 0xff; + ((VasEBoot_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8; + ((VasEBoot_uint8_t *) dstptr)[2] = (color & 0xff0000) >> 16; #else - ((grub_uint8_t *) dstptr)[2] = color & 0xff; - ((grub_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8; - ((grub_uint8_t *) dstptr)[0] = (color & 0xff0000) >> 16; + ((VasEBoot_uint8_t *) dstptr)[2] = color & 0xff; + ((VasEBoot_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8; + ((VasEBoot_uint8_t *) dstptr)[0] = (color & 0xff0000) >> 16; #endif } else if (a != 0) { - grub_uint8_t s1 = (color >> 0) & 0xFF; - grub_uint8_t s2 = (color >> 8) & 0xFF; - grub_uint8_t s3 = (color >> 16) & 0xFF; + VasEBoot_uint8_t s1 = (color >> 0) & 0xFF; + VasEBoot_uint8_t s2 = (color >> 8) & 0xFF; + VasEBoot_uint8_t s3 = (color >> 16) & 0xFF; - grub_uint8_t d1 = (*(grub_uint32_t *) dstptr >> 0) & 0xFF; - grub_uint8_t d2 = (*(grub_uint32_t *) dstptr >> 8) & 0xFF; - grub_uint8_t d3 = (*(grub_uint32_t *) dstptr >> 16) & 0xFF; + VasEBoot_uint8_t d1 = (*(VasEBoot_uint32_t *) dstptr >> 0) & 0xFF; + VasEBoot_uint8_t d2 = (*(VasEBoot_uint32_t *) dstptr >> 8) & 0xFF; + VasEBoot_uint8_t d3 = (*(VasEBoot_uint32_t *) dstptr >> 16) & 0xFF; - ((grub_uint8_t *) dstptr)[0] = alpha_dilute (d1, s1, a); - ((grub_uint8_t *) dstptr)[1] = alpha_dilute (d2, s2, a); - ((grub_uint8_t *) dstptr)[2] = alpha_dilute (d3, s3, a); + ((VasEBoot_uint8_t *) dstptr)[0] = alpha_dilute (d1, s1, a); + ((VasEBoot_uint8_t *) dstptr)[1] = alpha_dilute (d2, s2, a); + ((VasEBoot_uint8_t *) dstptr)[2] = alpha_dilute (d3, s3, a); } srcmask >>= 1; @@ -1832,20 +1832,20 @@ grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, /* Optimized blending blitter for 1-bit to XXX888. */ static void -grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, - struct grub_video_fbblit_info *src, +VasEBoot_video_fbblit_blend_XXX565_1bit (struct VasEBoot_video_fbblit_info *dst, + struct VasEBoot_video_fbblit_info *src, int x, int y, int width, int height, int offset_x, int offset_y) { int i; int j; - grub_uint8_t *srcptr; - grub_uint16_t *dstptr; - grub_uint8_t srcmask; + VasEBoot_uint8_t *srcptr; + VasEBoot_uint16_t *dstptr; + VasEBoot_uint8_t srcmask; unsigned int dstrowskip; unsigned int srcrowskipbyte, srcrowskipbit; - grub_uint16_t fgcolor, bgcolor; + VasEBoot_uint16_t fgcolor, bgcolor; int bit_index; /* Calculate the number of bytes to advance from the end of one line @@ -1855,16 +1855,16 @@ grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, srcrowskipbit = (src->mode_info->width - width) & 7; bit_index = offset_y * src->mode_info->width + offset_x; - srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcptr = (VasEBoot_uint8_t *) src->data + (bit_index >> 3); srcmask = 1 << (~bit_index & 7); - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); - fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + fgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->fg_red, src->mode_info->fg_green, src->mode_info->fg_blue, src->mode_info->fg_alpha); - bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + bgcolor = VasEBoot_video_fb_map_rgba (src->mode_info->bg_red, src->mode_info->bg_green, src->mode_info->bg_blue, src->mode_info->bg_alpha); @@ -1873,8 +1873,8 @@ grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, { for (i = 0; i < width; i++) { - grub_uint32_t color; - grub_uint8_t a; + VasEBoot_uint32_t color; + VasEBoot_uint8_t a; if (*srcptr & srcmask) { color = fgcolor; @@ -1890,13 +1890,13 @@ grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, *dstptr = color; else if (a != 0) { - grub_uint8_t s1 = (color >> 0) & 0x1F; - grub_uint8_t s2 = (color >> 5) & 0x3F; - grub_uint8_t s3 = (color >> 11) & 0x1F; + VasEBoot_uint8_t s1 = (color >> 0) & 0x1F; + VasEBoot_uint8_t s2 = (color >> 5) & 0x3F; + VasEBoot_uint8_t s3 = (color >> 11) & 0x1F; - grub_uint8_t d1 = (*dstptr >> 0) & 0x1F; - grub_uint8_t d2 = (*dstptr >> 5) & 0x3F; - grub_uint8_t d3 = (*dstptr >> 11) & 0x1F; + VasEBoot_uint8_t d1 = (*dstptr >> 0) & 0x1F; + VasEBoot_uint8_t d2 = (*dstptr >> 5) & 0x3F; + VasEBoot_uint8_t d3 = (*dstptr >> 11) & 0x1F; d1 = alpha_dilute (d1, s1, a); d2 = alpha_dilute (d2, s2, a); @@ -1923,49 +1923,49 @@ grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, srcptr++; srcmask <<= 8 - srcrowskipbit; } - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip); } } /* NOTE: This function assumes that given coordinates are within bounds of handled data. */ void -grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, - struct grub_video_fbblit_info *source, - enum grub_video_blit_operators oper, int x, int y, +VasEBoot_video_fb_dispatch_blit (struct VasEBoot_video_fbblit_info *target, + struct VasEBoot_video_fbblit_info *source, + enum VasEBoot_video_blit_operators oper, int x, int y, unsigned int width, unsigned int height, int offset_x, int offset_y) { - if (oper == GRUB_VIDEO_BLIT_REPLACE) + if (oper == VasEBoot_VIDEO_BLIT_REPLACE) { /* Try to figure out more optimized version for replace operator. */ switch (source->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - grub_video_fbblit_replace_directN (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: + VasEBoot_video_fbblit_replace_directN (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: - grub_video_fbblit_replace_BGRX8888_RGBX8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: + VasEBoot_video_fbblit_replace_BGRX8888_RGBX8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_BGR_888: - grub_video_fbblit_replace_BGR888_RGBX8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGR_888: + VasEBoot_video_fbblit_replace_BGR888_RGBX8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: - grub_video_fbblit_replace_RGB888_RGBX8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: + VasEBoot_video_fbblit_replace_RGB888_RGBX8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: - grub_video_fbblit_replace_index_RGBX8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: + VasEBoot_video_fbblit_replace_index_RGBX8888 (target, source, x, y, width, height, offset_x, offset_y); return; @@ -1973,31 +1973,31 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: - grub_video_fbblit_replace_BGRX8888_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: + VasEBoot_video_fbblit_replace_BGRX8888_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - grub_video_fbblit_replace_RGBX8888_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: + VasEBoot_video_fbblit_replace_RGBX8888_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_BGR_888: - grub_video_fbblit_replace_BGR888_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGR_888: + VasEBoot_video_fbblit_replace_BGR888_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: - grub_video_fbblit_replace_directN (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: + VasEBoot_video_fbblit_replace_directN (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: - grub_video_fbblit_replace_index_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: + VasEBoot_video_fbblit_replace_index_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2005,11 +2005,11 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: - grub_video_fbblit_replace_directN (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: + VasEBoot_video_fbblit_replace_directN (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2017,12 +2017,12 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA: - grub_video_fbblit_replace_directN (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA: + VasEBoot_video_fbblit_replace_directN (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2030,26 +2030,26 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA: + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA: switch (target->mode_info->bytes_per_pixel) { case 4: - grub_video_fbblit_replace_32bit_indexa (target, source, + VasEBoot_video_fbblit_replace_32bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; case 3: - grub_video_fbblit_replace_24bit_indexa (target, source, + VasEBoot_video_fbblit_replace_24bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; case 2: - grub_video_fbblit_replace_16bit_indexa (target, source, + VasEBoot_video_fbblit_replace_16bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; case 1: - grub_video_fbblit_replace_8bit_indexa (target, source, + VasEBoot_video_fbblit_replace_8bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2057,28 +2057,28 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED: + case VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED: switch (target->mode_info->bytes_per_pixel) { case 4: - grub_video_fbblit_replace_32bit_1bit (target, source, + VasEBoot_video_fbblit_replace_32bit_1bit (target, source, x, y, width, height, offset_x, offset_y); return; -#ifdef GRUB_HAVE_UNALIGNED_ACCESS +#ifdef VasEBoot_HAVE_UNALIGNED_ACCESS case 3: - grub_video_fbblit_replace_24bit_1bit (target, source, + VasEBoot_video_fbblit_replace_24bit_1bit (target, source, x, y, width, height, offset_x, offset_y); return; #endif case 2: - grub_video_fbblit_replace_16bit_1bit (target, source, + VasEBoot_video_fbblit_replace_16bit_1bit (target, source, x, y, width, height, offset_x, offset_y); return; case 1: - grub_video_fbblit_replace_8bit_1bit (target, source, + VasEBoot_video_fbblit_replace_8bit_1bit (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2089,7 +2089,7 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, } /* No optimized replace operator found, use default (slow) blitter. */ - grub_video_fbblit_replace (target, source, x, y, width, height, + VasEBoot_video_fbblit_replace (target, source, x, y, width, height, offset_x, offset_y); } else @@ -2097,31 +2097,31 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, /* Try to figure out more optimized blend operator. */ switch (source->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: - grub_video_fbblit_blend_BGRA8888_RGBA8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: + VasEBoot_video_fbblit_blend_BGRA8888_RGBA8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - grub_video_fbblit_blend_RGBA8888_RGBA8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: + VasEBoot_video_fbblit_blend_RGBA8888_RGBA8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_BGR_888: - grub_video_fbblit_blend_BGR888_RGBA8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGR_888: + VasEBoot_video_fbblit_blend_BGR888_RGBA8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: - grub_video_fbblit_blend_RGB888_RGBA8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: + VasEBoot_video_fbblit_blend_RGB888_RGBA8888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: - grub_video_fbblit_blend_index_RGBA8888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: + VasEBoot_video_fbblit_blend_index_RGBA8888 (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2129,34 +2129,34 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: /* Note: There is really no alpha information here, so blend is changed to replace. */ switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: - grub_video_fbblit_replace_BGRX8888_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: + VasEBoot_video_fbblit_replace_BGRX8888_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - grub_video_fbblit_replace_RGBX8888_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: + VasEBoot_video_fbblit_replace_RGBX8888_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_BGR_888: - grub_video_fbblit_replace_BGR888_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGR_888: + VasEBoot_video_fbblit_replace_BGR888_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: - grub_video_fbblit_replace_directN (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: + VasEBoot_video_fbblit_replace_directN (target, source, x, y, width, height, offset_x, offset_y); return; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR: - grub_video_fbblit_replace_index_RGB888 (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR: + VasEBoot_video_fbblit_replace_index_RGB888 (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2164,26 +2164,26 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED: + case VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED: switch (target->mode_info->blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888: - case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - grub_video_fbblit_blend_XXXA8888_1bit (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888: + case VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888: + VasEBoot_video_fbblit_blend_XXXA8888_1bit (target, source, x, y, width, height, offset_x, offset_y); return; -#ifdef GRUB_HAVE_UNALIGNED_ACCESS - case GRUB_VIDEO_BLIT_FORMAT_BGR_888: - case GRUB_VIDEO_BLIT_FORMAT_RGB_888: - grub_video_fbblit_blend_XXX888_1bit (target, source, +#ifdef VasEBoot_HAVE_UNALIGNED_ACCESS + case VasEBoot_VIDEO_BLIT_FORMAT_BGR_888: + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_888: + VasEBoot_video_fbblit_blend_XXX888_1bit (target, source, x, y, width, height, offset_x, offset_y); return; #endif - case GRUB_VIDEO_BLIT_FORMAT_BGR_565: - case GRUB_VIDEO_BLIT_FORMAT_RGB_565: - grub_video_fbblit_blend_XXX565_1bit (target, source, + case VasEBoot_VIDEO_BLIT_FORMAT_BGR_565: + case VasEBoot_VIDEO_BLIT_FORMAT_RGB_565: + VasEBoot_video_fbblit_blend_XXX565_1bit (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2191,26 +2191,26 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, break; } break; - case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA: + case VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA: switch (target->mode_info->bytes_per_pixel) { case 4: - grub_video_fbblit_blend_32bit_indexa (target, source, + VasEBoot_video_fbblit_blend_32bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; case 3: - grub_video_fbblit_blend_24bit_indexa (target, source, + VasEBoot_video_fbblit_blend_24bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; case 2: - grub_video_fbblit_blend_16bit_indexa (target, source, + VasEBoot_video_fbblit_blend_16bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; case 1: - grub_video_fbblit_blend_8bit_indexa (target, source, + VasEBoot_video_fbblit_blend_8bit_indexa (target, source, x, y, width, height, offset_x, offset_y); return; @@ -2221,7 +2221,7 @@ grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, } /* No optimized blend operation found, use default (slow) blitter. */ - grub_video_fbblit_blend (target, source, x, y, width, height, + VasEBoot_video_fbblit_blend (target, source, x, y, width, height, offset_x, offset_y); } } diff --git a/VasEBoot-core/video/fb/fbfill.c b/VasEBoot-core/video/fb/fbfill.c index 11816d07a..ea307470f 100644 --- a/VasEBoot-core/video/fb/fbfill.c +++ b/VasEBoot-core/video/fb/fbfill.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* SPECIAL NOTES! @@ -27,16 +27,16 @@ - Every function in this code assumes that bounds checking has been done in previous phase and they are opted out in here. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Generic filler that works for every supported mode. */ static void -grub_video_fbfill (struct grub_video_fbblit_info *dst, - grub_video_color_t color, int x, int y, +VasEBoot_video_fbfill (struct VasEBoot_video_fbblit_info *dst, + VasEBoot_video_color_t color, int x, int y, int width, int height) { int i; @@ -50,21 +50,21 @@ grub_video_fbfill (struct grub_video_fbblit_info *dst, /* Optimized filler for direct color 32 bit modes. It is assumed that color is already mapped to destination format. */ static void -grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst, - grub_video_color_t color, int x, int y, +VasEBoot_video_fbfill_direct32 (struct VasEBoot_video_fbblit_info *dst, + VasEBoot_video_color_t color, int x, int y, int width, int height) { int i; int j; - grub_uint32_t *dstptr; - grub_size_t rowskip; + VasEBoot_uint32_t *dstptr; + VasEBoot_size_t rowskip; /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -72,36 +72,36 @@ grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst, *dstptr++ = color; /* Advance the dest pointer to the right location on the next line. */ - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, rowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, rowskip); } } /* Optimized filler for direct color 24 bit modes. It is assumed that color is already mapped to destination format. */ static void -grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst, - grub_video_color_t color, int x, int y, +VasEBoot_video_fbfill_direct24 (struct VasEBoot_video_fbblit_info *dst, + VasEBoot_video_color_t color, int x, int y, int width, int height) { int i; int j; - grub_size_t rowskip; - grub_uint8_t *dstptr; -#ifndef GRUB_CPU_WORDS_BIGENDIAN - grub_uint8_t fill0 = (grub_uint8_t)((color >> 0) & 0xFF); - grub_uint8_t fill1 = (grub_uint8_t)((color >> 8) & 0xFF); - grub_uint8_t fill2 = (grub_uint8_t)((color >> 16) & 0xFF); + VasEBoot_size_t rowskip; + VasEBoot_uint8_t *dstptr; +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_uint8_t fill0 = (VasEBoot_uint8_t)((color >> 0) & 0xFF); + VasEBoot_uint8_t fill1 = (VasEBoot_uint8_t)((color >> 8) & 0xFF); + VasEBoot_uint8_t fill2 = (VasEBoot_uint8_t)((color >> 16) & 0xFF); #else - grub_uint8_t fill2 = (grub_uint8_t)((color >> 0) & 0xFF); - grub_uint8_t fill1 = (grub_uint8_t)((color >> 8) & 0xFF); - grub_uint8_t fill0 = (grub_uint8_t)((color >> 16) & 0xFF); + VasEBoot_uint8_t fill2 = (VasEBoot_uint8_t)((color >> 0) & 0xFF); + VasEBoot_uint8_t fill1 = (VasEBoot_uint8_t)((color >> 8) & 0xFF); + VasEBoot_uint8_t fill0 = (VasEBoot_uint8_t)((color >> 16) & 0xFF); #endif /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -120,21 +120,21 @@ grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst, /* Optimized filler for direct color 16 bit modes. It is assumed that color is already mapped to destination format. */ static void -grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst, - grub_video_color_t color, int x, int y, +VasEBoot_video_fbfill_direct16 (struct VasEBoot_video_fbblit_info *dst, + VasEBoot_video_color_t color, int x, int y, int width, int height) { int i; int j; - grub_size_t rowskip; - grub_uint16_t *dstptr; + VasEBoot_size_t rowskip; + VasEBoot_uint16_t *dstptr; /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ rowskip = (dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width); /* Get the start address. */ - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -142,29 +142,29 @@ grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst, *dstptr++ = color; /* Advance the dest pointer to the right location on the next line. */ - GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, rowskip); + VasEBoot_VIDEO_FB_ADVANCE_POINTER (dstptr, rowskip); } } /* Optimized filler for index color. It is assumed that color is already mapped to destination format. */ static void -grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst, - grub_video_color_t color, int x, int y, +VasEBoot_video_fbfill_direct8 (struct VasEBoot_video_fbblit_info *dst, + VasEBoot_video_color_t color, int x, int y, int width, int height) { int i; int j; - grub_size_t rowskip; - grub_uint8_t *dstptr; - grub_uint8_t fill = (grub_uint8_t)color & 0xFF; + VasEBoot_size_t rowskip; + VasEBoot_uint8_t *dstptr; + VasEBoot_uint8_t fill = (VasEBoot_uint8_t)color & 0xFF; /* Calculate the number of bytes to advance from the end of one line to the beginning of the next line. */ rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = grub_video_fb_get_video_ptr (dst, x, y); + dstptr = VasEBoot_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -177,8 +177,8 @@ grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst, } void -grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target, - grub_video_color_t color, int x, int y, +VasEBoot_video_fb_fill_dispatch (struct VasEBoot_video_fbblit_info *target, + VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height) { /* Try to figure out more optimized version. Note that color is already @@ -186,23 +186,23 @@ grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target, switch (target->mode_info->bytes_per_pixel) { case 4: - grub_video_fbfill_direct32 (target, color, x, y, + VasEBoot_video_fbfill_direct32 (target, color, x, y, width, height); return; case 3: - grub_video_fbfill_direct24 (target, color, x, y, + VasEBoot_video_fbfill_direct24 (target, color, x, y, width, height); return; case 2: - grub_video_fbfill_direct16 (target, color, x, y, + VasEBoot_video_fbfill_direct16 (target, color, x, y, width, height); return; case 1: - grub_video_fbfill_direct8 (target, color, x, y, + VasEBoot_video_fbfill_direct8 (target, color, x, y, width, height); return; } /* No optimized version found, use default (slow) filler. */ - grub_video_fbfill (target, color, x, y, width, height); + VasEBoot_video_fbfill (target, color, x, y, width, height); } diff --git a/VasEBoot-core/video/fb/fbutil.c b/VasEBoot-core/video/fb/fbutil.c index b98bb51fe..d68b49983 100644 --- a/VasEBoot-core/video/fb/fbutil.c +++ b/VasEBoot-core/video/fb/fbutil.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* SPECIAL NOTES! @@ -27,27 +27,27 @@ - Every function in this code assumes that bounds checking has been done in previous phase and they are opted out in here. */ -#include -#include -#include +#include +#include +#include -grub_video_color_t -get_pixel (struct grub_video_fbblit_info *source, +VasEBoot_video_color_t +get_pixel (struct VasEBoot_video_fbblit_info *source, unsigned int x, unsigned int y) { - grub_video_color_t color = 0; + VasEBoot_video_color_t color = 0; switch (source->mode_info->bpp) { case 32: - color = *(grub_uint32_t *)grub_video_fb_get_video_ptr (source, x, y); + color = *(VasEBoot_uint32_t *)VasEBoot_video_fb_get_video_ptr (source, x, y); break; case 24: { - grub_uint8_t *ptr; - ptr = grub_video_fb_get_video_ptr (source, x, y); -#ifdef GRUB_CPU_WORDS_BIGENDIAN + VasEBoot_uint8_t *ptr; + ptr = VasEBoot_video_fb_get_video_ptr (source, x, y); +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN color = ptr[2] | (ptr[1] << 8) | (ptr[0] << 16); #else color = ptr[0] | (ptr[1] << 8) | (ptr[2] << 16); @@ -57,18 +57,18 @@ get_pixel (struct grub_video_fbblit_info *source, case 16: case 15: - color = *(grub_uint16_t *)grub_video_fb_get_video_ptr (source, x, y); + color = *(VasEBoot_uint16_t *)VasEBoot_video_fb_get_video_ptr (source, x, y); break; case 8: - color = *(grub_uint8_t *)grub_video_fb_get_video_ptr (source, x, y); + color = *(VasEBoot_uint8_t *)VasEBoot_video_fb_get_video_ptr (source, x, y); break; case 1: - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) + if (source->mode_info->blit_format == VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED) { int bit_index = y * source->mode_info->width + x; - grub_uint8_t *ptr = source->data + bit_index / 8; + VasEBoot_uint8_t *ptr = source->data + bit_index / 8; int bit_pos = 7 - bit_index % 8; color = (*ptr >> bit_pos) & 0x01; } @@ -82,16 +82,16 @@ get_pixel (struct grub_video_fbblit_info *source, } void -set_pixel (struct grub_video_fbblit_info *source, - unsigned int x, unsigned int y, grub_video_color_t color) +set_pixel (struct VasEBoot_video_fbblit_info *source, + unsigned int x, unsigned int y, VasEBoot_video_color_t color) { switch (source->mode_info->bpp) { case 32: { - grub_uint32_t *ptr; + VasEBoot_uint32_t *ptr; - ptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (source, x, y); + ptr = (VasEBoot_uint32_t *)VasEBoot_video_fb_get_video_ptr (source, x, y); *ptr = color; } @@ -99,14 +99,14 @@ set_pixel (struct grub_video_fbblit_info *source, case 24: { - grub_uint8_t *ptr; -#ifdef GRUB_CPU_WORDS_BIGENDIAN - grub_uint8_t *colorptr = ((grub_uint8_t *)&color) + 1; + VasEBoot_uint8_t *ptr; +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_uint8_t *colorptr = ((VasEBoot_uint8_t *)&color) + 1; #else - grub_uint8_t *colorptr = (grub_uint8_t *)&color; + VasEBoot_uint8_t *colorptr = (VasEBoot_uint8_t *)&color; #endif - ptr = grub_video_fb_get_video_ptr (source, x, y); + ptr = VasEBoot_video_fb_get_video_ptr (source, x, y); ptr[0] = colorptr[0]; ptr[1] = colorptr[1]; @@ -117,29 +117,29 @@ set_pixel (struct grub_video_fbblit_info *source, case 16: case 15: { - grub_uint16_t *ptr; + VasEBoot_uint16_t *ptr; - ptr = (grub_uint16_t *)grub_video_fb_get_video_ptr (source, x, y); + ptr = (VasEBoot_uint16_t *)VasEBoot_video_fb_get_video_ptr (source, x, y); - *ptr = (grub_uint16_t) (color & 0xFFFF); + *ptr = (VasEBoot_uint16_t) (color & 0xFFFF); } break; case 8: { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; - ptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (source, x, y); + ptr = (VasEBoot_uint8_t *)VasEBoot_video_fb_get_video_ptr (source, x, y); - *ptr = (grub_uint8_t) (color & 0xFF); + *ptr = (VasEBoot_uint8_t) (color & 0xFF); } break; case 1: - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) + if (source->mode_info->blit_format == VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED) { int bit_index = y * source->mode_info->width + x; - grub_uint8_t *ptr = source->data + bit_index / 8; + VasEBoot_uint8_t *ptr = source->data + bit_index / 8; int bit_pos = 7 - bit_index % 8; *ptr = (*ptr & ~(1 << bit_pos)) | ((color & 0x01) << bit_pos); } diff --git a/VasEBoot-core/video/fb/video_fb.c b/VasEBoot-core/video/fb/video_fb.c index 1a602c8b2..ff2c9d600 100644 --- a/VasEBoot-core/video/fb/video_fb.c +++ b/VasEBoot-core/video/fb/video_fb.c @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); -typedef grub_err_t (*grub_video_fb_doublebuf_update_screen_t) (void); +typedef VasEBoot_err_t (*VasEBoot_video_fb_doublebuf_update_screen_t) (void); typedef volatile void *framebuf_t; struct dirty @@ -39,9 +39,9 @@ struct dirty static struct { - struct grub_video_fbrender_target *render_target; - struct grub_video_fbrender_target *back_target; - struct grub_video_palette_data *palette; + struct VasEBoot_video_fbrender_target *render_target; + struct VasEBoot_video_fbrender_target *back_target; + struct VasEBoot_video_palette_data *palette; framebuf_t pages[2]; unsigned int palette_size; @@ -52,14 +52,14 @@ static struct /* For page flipping strategy. */ int displayed_page; /* The page # that is the front buffer. */ int render_page; /* The page # that is the back buffer. */ - grub_video_fb_set_page_t set_page; + VasEBoot_video_fb_set_page_t set_page; char *offscreen_buffer; - grub_video_fb_doublebuf_update_screen_t update_screen; + VasEBoot_video_fb_doublebuf_update_screen_t update_screen; } framebuffer; /* Specify "standard" VGA palette, some video cards may need this and this will also be used when using RGB modes. */ -struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_EXT_NUMCOLORS] = +struct VasEBoot_video_palette_data VasEBoot_video_fbstd_colors[VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS] = { /* Standard (3-bit) colors. */ @@ -326,47 +326,47 @@ struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_EXT_NUMC {0xFC, 0xFC, 0xAA, 0xFF}, // RGB332 = (7, 7, 2) }; -grub_err_t -grub_video_fb_init (void) +VasEBoot_err_t +VasEBoot_video_fb_init (void) { - grub_free (framebuffer.palette); + VasEBoot_free (framebuffer.palette); framebuffer.render_target = 0; framebuffer.back_target = 0; framebuffer.palette = 0; framebuffer.palette_size = 0; framebuffer.set_page = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_fini (void) +VasEBoot_err_t +VasEBoot_video_fb_fini (void) { /* TODO: destroy render targets. */ - grub_free (framebuffer.offscreen_buffer); - grub_free (framebuffer.palette); + VasEBoot_free (framebuffer.offscreen_buffer); + VasEBoot_free (framebuffer.palette); framebuffer.render_target = 0; framebuffer.back_target = 0; framebuffer.palette = 0; framebuffer.palette_size = 0; framebuffer.set_page = 0; framebuffer.offscreen_buffer = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_info (struct grub_video_mode_info *mode_info) +VasEBoot_err_t +VasEBoot_video_fb_get_info (struct VasEBoot_video_mode_info *mode_info) { /* Copy mode info from active render target. */ - grub_memcpy (mode_info, &framebuffer.render_target->mode_info, - sizeof (struct grub_video_mode_info)); + VasEBoot_memcpy (mode_info, &framebuffer.render_target->mode_info, + sizeof (struct VasEBoot_video_mode_info)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +VasEBoot_err_t +VasEBoot_video_fb_get_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { unsigned int i; @@ -374,33 +374,33 @@ grub_video_fb_get_palette (unsigned int start, unsigned int count, for (i = 0; (i < count) && ((i + start) < framebuffer.palette_size); i++) palette_data[i] = framebuffer.palette[start + i]; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +VasEBoot_err_t +VasEBoot_video_fb_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { unsigned i; if (start + count > framebuffer.palette_size) { framebuffer.palette_size = start + count; - framebuffer.palette = grub_realloc (framebuffer.palette, + framebuffer.palette = VasEBoot_realloc (framebuffer.palette, sizeof (framebuffer.palette[0]) * framebuffer.palette_size); if (!framebuffer.palette) { - grub_video_fb_fini (); - return grub_errno; + VasEBoot_video_fb_fini (); + return VasEBoot_errno; } } for (i = 0; (i < count) && ((i + start) < framebuffer.palette_size); i++) framebuffer.palette[start + i] = palette_data[i]; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_fb_set_area (void) +static VasEBoot_err_t +VasEBoot_video_fb_set_area (void) { unsigned int viewport_x1 = framebuffer.render_target->viewport.x; unsigned int viewport_y1 = framebuffer.render_target->viewport.y; @@ -416,10 +416,10 @@ grub_video_fb_set_area (void) unsigned int region_x2 = region_x1 + region_width; unsigned int region_y2 = region_y1 + region_height; - unsigned int max_x1 = grub_max (viewport_x1, region_x1); - unsigned int min_x2 = grub_min (viewport_x2, region_x2); - unsigned int max_y1 = grub_max (viewport_y1, region_y1); - unsigned int min_y2 = grub_min (viewport_y2, region_y2); + unsigned int max_x1 = VasEBoot_max (viewport_x1, region_x1); + unsigned int min_x2 = VasEBoot_min (viewport_x2, region_x2); + unsigned int max_y1 = VasEBoot_max (viewport_y1, region_y1); + unsigned int min_y2 = VasEBoot_min (viewport_y2, region_y2); /* Viewport and region do not intersect. */ if (viewport_width == 0 || viewport_height == 0 || region_width == 0 @@ -431,7 +431,7 @@ grub_video_fb_set_area (void) framebuffer.render_target->area.height = 0; framebuffer.render_target->area_offset_x = 0; framebuffer.render_target->area_offset_y = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* There is non-zero intersection. */ @@ -451,11 +451,11 @@ grub_video_fb_set_area (void) else framebuffer.render_target->area_offset_y = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_set_viewport (unsigned int x, unsigned int y, +VasEBoot_err_t +VasEBoot_video_fb_set_viewport (unsigned int x, unsigned int y, unsigned int width, unsigned int height) { /* Make sure viewport is within screen dimensions. If viewport was set @@ -485,13 +485,13 @@ grub_video_fb_set_viewport (unsigned int x, unsigned int y, /* Count drawing area only if needed. */ if (framebuffer.render_target->area_enabled) - grub_video_fb_set_area (); + VasEBoot_video_fb_set_area (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_viewport (unsigned int *x, unsigned int *y, +VasEBoot_err_t +VasEBoot_video_fb_get_viewport (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height) { if (x) *x = framebuffer.render_target->viewport.x; @@ -499,11 +499,11 @@ grub_video_fb_get_viewport (unsigned int *x, unsigned int *y, if (width) *width = framebuffer.render_target->viewport.width; if (height) *height = framebuffer.render_target->viewport.height; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_set_region (unsigned int x, unsigned int y, +VasEBoot_err_t +VasEBoot_video_fb_set_region (unsigned int x, unsigned int y, unsigned int width, unsigned int height) { /* Make sure region is within screen dimensions. If region was set @@ -532,13 +532,13 @@ grub_video_fb_set_region (unsigned int x, unsigned int y, framebuffer.render_target->region.height = height; /* If we have called set_region then area is needed. */ - grub_video_fb_set_area (); + VasEBoot_video_fb_set_area (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_region (unsigned int *x, unsigned int *y, +VasEBoot_err_t +VasEBoot_video_fb_get_region (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height) { if (x) *x = framebuffer.render_target->region.x; @@ -546,50 +546,50 @@ grub_video_fb_get_region (unsigned int *x, unsigned int *y, if (width) *width = framebuffer.render_target->region.width; if (height) *height = framebuffer.render_target->region.height; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_set_area_status (grub_video_area_status_t area_status) +VasEBoot_err_t +VasEBoot_video_fb_set_area_status (VasEBoot_video_area_status_t area_status) { - if (area_status == GRUB_VIDEO_AREA_ENABLED) + if (area_status == VasEBoot_VIDEO_AREA_ENABLED) framebuffer.render_target->area_enabled = 1; else framebuffer.render_target->area_enabled = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_area_status (grub_video_area_status_t *area_status) +VasEBoot_err_t +VasEBoot_video_fb_get_area_status (VasEBoot_video_area_status_t *area_status) { if (!area_status) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (framebuffer.render_target->area_enabled) - *area_status = GRUB_VIDEO_AREA_ENABLED; + *area_status = VasEBoot_VIDEO_AREA_ENABLED; else - *area_status = GRUB_VIDEO_AREA_DISABLED; + *area_status = VasEBoot_VIDEO_AREA_DISABLED; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Maps color name to target optimized color format. */ -grub_video_color_t -grub_video_fb_map_color (grub_uint32_t color_name) +VasEBoot_video_color_t +VasEBoot_video_fb_map_color (VasEBoot_uint32_t color_name) { /* TODO: implement color theme mapping code. */ if (color_name < framebuffer.palette_size) { if ((framebuffer.render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) return color_name; else { - grub_video_color_t color; + VasEBoot_video_color_t color; - color = grub_video_fb_map_rgb (framebuffer.palette[color_name].r, + color = VasEBoot_video_fb_map_rgb (framebuffer.palette[color_name].r, framebuffer.palette[color_name].g, framebuffer.palette[color_name].b); @@ -601,12 +601,12 @@ grub_video_fb_map_color (grub_uint32_t color_name) } /* Maps RGB to target optimized color format. */ -grub_video_color_t -grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue) +VasEBoot_video_color_t +VasEBoot_video_fb_map_rgb (VasEBoot_uint8_t red, VasEBoot_uint8_t green, + VasEBoot_uint8_t blue) { if ((framebuffer.render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) { int minindex = 0; int delta = 0; @@ -639,7 +639,7 @@ grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green, return minindex; } else if ((framebuffer.render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + & VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) { if (red == framebuffer.render_target->mode_info.fg_red && green == framebuffer.render_target->mode_info.fg_green @@ -650,8 +650,8 @@ grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green, } else { - grub_uint32_t value; - grub_uint8_t alpha = 255; /* Opaque color. */ + VasEBoot_uint32_t value; + VasEBoot_uint8_t alpha = 255; /* Opaque color. */ red >>= 8 - framebuffer.render_target->mode_info.red_mask_size; green >>= 8 - framebuffer.render_target->mode_info.green_mask_size; @@ -669,24 +669,24 @@ grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green, } /* Maps RGBA to target optimized color format. */ -grub_video_color_t -grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue, grub_uint8_t alpha) +VasEBoot_video_color_t +VasEBoot_video_fb_map_rgba (VasEBoot_uint8_t red, VasEBoot_uint8_t green, + VasEBoot_uint8_t blue, VasEBoot_uint8_t alpha) { if ((framebuffer.render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) { if ((framebuffer.render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_ALPHA) != 0 + & VasEBoot_VIDEO_MODE_TYPE_ALPHA) != 0 && alpha == 0) return 0xf0; /* No alpha available in index color modes, just use same value as in only RGB modes. */ - return grub_video_fb_map_rgb (red, green, blue); + return VasEBoot_video_fb_map_rgb (red, green, blue); } else if ((framebuffer.render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + & VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) { if (red == framebuffer.render_target->mode_info.fg_red && green == framebuffer.render_target->mode_info.fg_green @@ -698,7 +698,7 @@ grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green, } else { - grub_uint32_t value; + VasEBoot_uint32_t value; red >>= 8 - framebuffer.render_target->mode_info.red_mask_size; green >>= 8 - framebuffer.render_target->mode_info.green_mask_size; @@ -715,36 +715,36 @@ grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green, } /* Splits target optimized format to components. */ -grub_err_t -grub_video_fb_unmap_color (grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha) +VasEBoot_err_t +VasEBoot_video_fb_unmap_color (VasEBoot_video_color_t color, + VasEBoot_uint8_t *red, VasEBoot_uint8_t *green, + VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha) { - struct grub_video_fbblit_info target_info; + struct VasEBoot_video_fbblit_info target_info; target_info.mode_info = &framebuffer.render_target->mode_info; target_info.data = framebuffer.render_target->data; - grub_video_fb_unmap_color_int (&target_info, color, red, green, blue, alpha); + VasEBoot_video_fb_unmap_color_int (&target_info, color, red, green, blue, alpha); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Splits color in source format to components. */ void -grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, - grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha) +VasEBoot_video_fb_unmap_color_int (struct VasEBoot_video_fbblit_info * source, + VasEBoot_video_color_t color, + VasEBoot_uint8_t *red, VasEBoot_uint8_t *green, + VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha) { - struct grub_video_mode_info *mode_info; + struct VasEBoot_video_mode_info *mode_info; mode_info = source->mode_info; if ((mode_info->mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) { if ((mode_info->mode_type - & GRUB_VIDEO_MODE_TYPE_ALPHA) != 0 + & VasEBoot_VIDEO_MODE_TYPE_ALPHA) != 0 && color == 0xf0) { *red = 0; @@ -771,7 +771,7 @@ grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, return; } else if ((mode_info->mode_type - & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + & VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) { if (color & 1) { @@ -790,7 +790,7 @@ grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, } else { - grub_uint32_t tmp; + VasEBoot_uint32_t tmp; /* Get red component. */ tmp = color >> mode_info->red_field_pos; @@ -840,11 +840,11 @@ dirty (int y, int height) framebuffer.current_dirty.last_line = y + height; } -grub_err_t -grub_video_fb_fill_rect (grub_video_color_t color, int x, int y, +VasEBoot_err_t +VasEBoot_video_fb_fill_rect (VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height) { - struct grub_video_fbblit_info target; + struct VasEBoot_video_fbblit_info target; unsigned int area_x; unsigned int area_y; unsigned int area_width; @@ -868,11 +868,11 @@ grub_video_fb_fill_rect (grub_video_color_t color, int x, int y, /* Make sure there is something to do. */ if ((area_width == 0) || (area_height == 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((x >= (int)area_width) || (x + (int)width < 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((y >= (int)area_height) || (y + (int)height < 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; /* Do not allow drawing out of area. */ if (x < 0) @@ -901,18 +901,18 @@ grub_video_fb_fill_rect (grub_video_color_t color, int x, int y, target.mode_info = &framebuffer.render_target->mode_info; target.data = framebuffer.render_target->data; - grub_video_fb_fill_dispatch (&target, color, x, y, + VasEBoot_video_fb_fill_dispatch (&target, color, x, y, width, height); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t __attribute__ ((always_inline)) -grub_video_fb_blit_source (struct grub_video_fbblit_info *source, - enum grub_video_blit_operators oper, int x, int y, +static inline VasEBoot_err_t __attribute__ ((always_inline)) +VasEBoot_video_fb_blit_source (struct VasEBoot_video_fbblit_info *source, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - struct grub_video_fbblit_info target; + struct VasEBoot_video_fbblit_info target; unsigned int area_x; unsigned int area_y; unsigned int area_width; @@ -936,21 +936,21 @@ grub_video_fb_blit_source (struct grub_video_fbblit_info *source, /* Make sure there is something to do. */ if ((area_width == 0) || (area_height == 0) || (width == 0) || (height == 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((x >= (int)area_width) || (x + (int)width < 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((y >= (int)area_height) || (y + (int)height < 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((x + (int)source->mode_info->width) < 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((y + (int)source->mode_info->height) < 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((offset_x >= (int)source->mode_info->width) || (offset_x + (int)width < 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if ((offset_y >= (int)source->mode_info->height) || (offset_y + (int)height < 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; /* If we have negative coordinates, optimize drawing to minimum. */ if (offset_x < 0) @@ -1009,42 +1009,42 @@ grub_video_fb_blit_source (struct grub_video_fbblit_info *source, /* Do actual blitting. */ dirty (y, height); - grub_video_fb_dispatch_blit (&target, source, oper, x, y, width, height, + VasEBoot_video_fb_dispatch_blit (&target, source, oper, x, y, width, height, offset_x, offset_y); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, int x, int y, +VasEBoot_err_t +VasEBoot_video_fb_blit_bitmap (struct VasEBoot_video_bitmap *bitmap, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - struct grub_video_fbblit_info source_info; + struct VasEBoot_video_fbblit_info source_info; source_info.mode_info = &bitmap->mode_info; source_info.data = bitmap->data; - return grub_video_fb_blit_source (&source_info, oper, x, y, + return VasEBoot_video_fb_blit_source (&source_info, oper, x, y, offset_x, offset_y, width, height); } -grub_err_t -grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source, - enum grub_video_blit_operators oper, +VasEBoot_err_t +VasEBoot_video_fb_blit_render_target (struct VasEBoot_video_fbrender_target *source, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - struct grub_video_fbblit_info source_info; + struct VasEBoot_video_fbblit_info source_info; source_info.mode_info = &source->mode_info; source_info.data = source->data; - return grub_video_fb_blit_source (&source_info, oper, x, y, + return VasEBoot_video_fb_blit_source (&source_info, oper, x, y, offset_x, offset_y, width, height); } -grub_err_t -grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) +VasEBoot_err_t +VasEBoot_video_fb_scroll (VasEBoot_video_color_t color, int dx, int dy) { int width; int height; @@ -1055,10 +1055,10 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) /* 1. Check if we have something to do. */ if ((dx == 0) && (dy == 0)) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; - width = framebuffer.render_target->viewport.width - grub_abs (dx); - height = framebuffer.render_target->viewport.height - grub_abs (dy); + width = framebuffer.render_target->viewport.width - VasEBoot_abs (dx); + height = framebuffer.render_target->viewport.height - VasEBoot_abs (dy); dirty (framebuffer.render_target->viewport.y, framebuffer.render_target->viewport.height); @@ -1086,11 +1086,11 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) } /* 2. Check if there is need to copy data. */ - if ((grub_abs (dx) < framebuffer.render_target->viewport.width) - && (grub_abs (dy) < framebuffer.render_target->viewport.height)) + if ((VasEBoot_abs (dx) < framebuffer.render_target->viewport.width) + && (VasEBoot_abs (dy) < framebuffer.render_target->viewport.height)) { /* 3. Move data in render target. */ - struct grub_video_fbblit_info target; + struct VasEBoot_video_fbblit_info target; int i, j; int linedelta, linelen; @@ -1104,9 +1104,9 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) /* Check vertical direction of the move. */ \ if (dy < 0 || (dy == 0 && dx < 0)) \ { \ - dst = (void *) grub_video_fb_get_video_ptr (&target, \ + dst = (void *) VasEBoot_video_fb_get_video_ptr (&target, \ dst_x, dst_y); \ - src = (void *) grub_video_fb_get_video_ptr (&target, \ + src = (void *) VasEBoot_video_fb_get_video_ptr (&target, \ src_x, src_y); \ /* 3a. Move data upwards. */ \ for (j = 0; j < height; j++) \ @@ -1120,10 +1120,10 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) else \ { \ /* 3b. Move data downwards. */ \ - dst = (void *) grub_video_fb_get_video_ptr (&target, \ + dst = (void *) VasEBoot_video_fb_get_video_ptr (&target, \ dst_x + width, \ dst_y + height - 1); \ - src = (void *) grub_video_fb_get_video_ptr (&target, \ + src = (void *) VasEBoot_video_fb_get_video_ptr (&target, \ src_x + width, \ src_y + height - 1); \ dst--; \ @@ -1138,36 +1138,36 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) } /* If everything is aligned on 32-bit use 32-bit copy. */ - if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y) - % sizeof (grub_uint32_t) == 0 - && (grub_addr_t) grub_video_fb_get_video_ptr (&target, dst_x, dst_y) - % sizeof (grub_uint32_t) == 0 - && linelen % sizeof (grub_uint32_t) == 0 - && linedelta % sizeof (grub_uint32_t) == 0) + if ((VasEBoot_addr_t) VasEBoot_video_fb_get_video_ptr (&target, src_x, src_y) + % sizeof (VasEBoot_uint32_t) == 0 + && (VasEBoot_addr_t) VasEBoot_video_fb_get_video_ptr (&target, dst_x, dst_y) + % sizeof (VasEBoot_uint32_t) == 0 + && linelen % sizeof (VasEBoot_uint32_t) == 0 + && linedelta % sizeof (VasEBoot_uint32_t) == 0) { - grub_uint32_t *src, *dst; - linelen /= sizeof (grub_uint32_t); - linedelta /= sizeof (grub_uint32_t); + VasEBoot_uint32_t *src, *dst; + linelen /= sizeof (VasEBoot_uint32_t); + linedelta /= sizeof (VasEBoot_uint32_t); DO_SCROLL } /* If everything is aligned on 16-bit use 16-bit copy. */ - else if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y) - % sizeof (grub_uint16_t) == 0 - && (grub_addr_t) grub_video_fb_get_video_ptr (&target, + else if ((VasEBoot_addr_t) VasEBoot_video_fb_get_video_ptr (&target, src_x, src_y) + % sizeof (VasEBoot_uint16_t) == 0 + && (VasEBoot_addr_t) VasEBoot_video_fb_get_video_ptr (&target, dst_x, dst_y) - % sizeof (grub_uint16_t) == 0 - && linelen % sizeof (grub_uint16_t) == 0 - && linedelta % sizeof (grub_uint16_t) == 0) + % sizeof (VasEBoot_uint16_t) == 0 + && linelen % sizeof (VasEBoot_uint16_t) == 0 + && linedelta % sizeof (VasEBoot_uint16_t) == 0) { - grub_uint16_t *src, *dst; - linelen /= sizeof (grub_uint16_t); - linedelta /= sizeof (grub_uint16_t); + VasEBoot_uint16_t *src, *dst; + linelen /= sizeof (VasEBoot_uint16_t); + linedelta /= sizeof (VasEBoot_uint16_t); DO_SCROLL } /* If not aligned at all use 8-bit copy. */ else { - grub_uint8_t *src, *dst; + VasEBoot_uint8_t *src, *dst; DO_SCROLL } } @@ -1178,52 +1178,52 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) /* 4a. Fill top & bottom parts. */ if (dy > 0) - grub_video_fb_fill_rect (color, 0, 0, framebuffer.render_target->viewport.width, dy); + VasEBoot_video_fb_fill_rect (color, 0, 0, framebuffer.render_target->viewport.width, dy); else if (dy < 0) { - if (framebuffer.render_target->viewport.height < grub_abs (dy)) + if (framebuffer.render_target->viewport.height < VasEBoot_abs (dy)) dy = -framebuffer.render_target->viewport.height; - grub_video_fb_fill_rect (color, 0, framebuffer.render_target->viewport.height + dy, + VasEBoot_video_fb_fill_rect (color, 0, framebuffer.render_target->viewport.height + dy, framebuffer.render_target->viewport.width, -dy); } /* 4b. Fill left & right parts. */ if (dx > 0) - grub_video_fb_fill_rect (color, 0, 0, + VasEBoot_video_fb_fill_rect (color, 0, 0, dx, framebuffer.render_target->viewport.height); else if (dx < 0) { - if (framebuffer.render_target->viewport.width < grub_abs (dx)) + if (framebuffer.render_target->viewport.width < VasEBoot_abs (dx)) dx = -framebuffer.render_target->viewport.width; - grub_video_fb_fill_rect (color, framebuffer.render_target->viewport.width + dx, 0, + VasEBoot_video_fb_fill_rect (color, framebuffer.render_target->viewport.width + dx, 0, -dx, framebuffer.render_target->viewport.height); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, +VasEBoot_err_t +VasEBoot_video_fb_create_render_target (struct VasEBoot_video_fbrender_target **result, unsigned int width, unsigned int height, unsigned int mode_type __attribute__ ((unused))) { - struct grub_video_fbrender_target *target; + struct VasEBoot_video_fbrender_target *target; unsigned int size; /* Validate arguments. */ if ((! result) || (width == 0) || (height == 0)) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid argument given"); /* Allocate memory for render target. */ - target = grub_malloc (sizeof (struct grub_video_fbrender_target)); + target = VasEBoot_malloc (sizeof (struct VasEBoot_video_fbrender_target)); if (! target) - return grub_errno; + return VasEBoot_errno; /* TODO: Implement other types too. Currently only 32bit render targets are supported. */ @@ -1255,18 +1255,18 @@ grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, target->mode_info.height = height; switch (mode_type) { - case GRUB_VIDEO_MODE_TYPE_INDEX_COLOR - | GRUB_VIDEO_MODE_TYPE_ALPHA: - target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR - | GRUB_VIDEO_MODE_TYPE_ALPHA; + case VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR + | VasEBoot_VIDEO_MODE_TYPE_ALPHA: + target->mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR + | VasEBoot_VIDEO_MODE_TYPE_ALPHA; target->mode_info.bpp = 8; target->mode_info.bytes_per_pixel = 1; target->mode_info.number_of_colors = 16; - target->mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA; + target->mode_info.blit_format = VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA; break; default: - target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB - | GRUB_VIDEO_MODE_TYPE_ALPHA; + target->mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB + | VasEBoot_VIDEO_MODE_TYPE_ALPHA; target->mode_info.bpp = 32; target->mode_info.bytes_per_pixel = 4; target->mode_info.red_mask_size = 8; @@ -1278,7 +1278,7 @@ grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, target->mode_info.reserved_mask_size = 8; target->mode_info.reserved_field_pos = 24; target->mode_info.number_of_colors = framebuffer.palette_size; /* Emulated palette. */ - target->mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_RGBA_8888; + target->mode_info.blit_format = VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888; break; } target->mode_info.pitch = target->mode_info.bytes_per_pixel * width; @@ -1286,55 +1286,55 @@ grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, /* Calculate size needed for the data. */ size = (width * target->mode_info.bytes_per_pixel) * height; - target->data = grub_malloc (size); + target->data = VasEBoot_malloc (size); if (! target->data) { - grub_free (target); - return grub_errno; + VasEBoot_free (target); + return VasEBoot_errno; } /* Clear render target with black and maximum transparency. */ - if (mode_type == (GRUB_VIDEO_MODE_TYPE_INDEX_COLOR - | GRUB_VIDEO_MODE_TYPE_ALPHA)) - grub_memset (target->data, 0xf0, size); + if (mode_type == (VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR + | VasEBoot_VIDEO_MODE_TYPE_ALPHA)) + VasEBoot_memset (target->data, 0xf0, size); else - grub_memset (target->data, 0, size); + VasEBoot_memset (target->data, 0, size); /* TODO: Add render target to render target list. */ /* Save result to caller. */ *result = target; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result, - const struct grub_video_mode_info *mode_info, +VasEBoot_err_t +VasEBoot_video_fb_create_render_target_from_pointer (struct VasEBoot_video_fbrender_target **result, + const struct VasEBoot_video_mode_info *mode_info, void *ptr) { - struct grub_video_fbrender_target *target; + struct VasEBoot_video_fbrender_target *target; unsigned y; -#ifndef GRUB_HAVE_UNALIGNED_ACCESS +#ifndef VasEBoot_HAVE_UNALIGNED_ACCESS if (!(mode_info->bytes_per_pixel & (mode_info->bytes_per_pixel - 1)) - && ((grub_addr_t) ptr & (mode_info->bytes_per_pixel - 1))) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unaligned pointer"); + && ((VasEBoot_addr_t) ptr & (mode_info->bytes_per_pixel - 1))) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unaligned pointer"); if (!(mode_info->bytes_per_pixel & (mode_info->bytes_per_pixel - 1)) && (mode_info->pitch & (mode_info->bytes_per_pixel - 1))) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unaligned pitch"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "unaligned pitch"); #endif /* Allocate memory for render target. */ - target = grub_malloc (sizeof (struct grub_video_fbrender_target)); + target = VasEBoot_malloc (sizeof (struct VasEBoot_video_fbrender_target)); if (! target) - return grub_errno; + return VasEBoot_errno; /* Mark framebuffer memory as non allocated. */ target->is_allocated = 0; target->data = ptr; - grub_memcpy (&(target->mode_info), mode_info, sizeof (target->mode_info)); + VasEBoot_memcpy (&(target->mode_info), mode_info, sizeof (target->mode_info)); /* Reset viewport, region and area to match new mode. */ target->viewport.x = 0; @@ -1357,67 +1357,67 @@ grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_targ /* Clear render target with black and maximum transparency. */ for (y = 0; y < mode_info->height; y++) - grub_memset (target->data + mode_info->pitch * y, 0, + VasEBoot_memset (target->data + mode_info->pitch * y, 0, mode_info->bytes_per_pixel * mode_info->width); /* Save result to caller. */ *result = target; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target) +VasEBoot_err_t +VasEBoot_video_fb_delete_render_target (struct VasEBoot_video_fbrender_target *target) { /* If there is no target, then just return without error. */ if (! target) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; /* TODO: Delist render target from render target list. */ /* If this is software render target, free it's memory. */ if (target->is_allocated) - grub_free (target->data); + VasEBoot_free (target->data); /* Free render target. */ - grub_free (target); + VasEBoot_free (target); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target) +VasEBoot_err_t +VasEBoot_video_fb_set_active_render_target (struct VasEBoot_video_fbrender_target *target) { - if (target == (struct grub_video_fbrender_target *) - GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == (struct VasEBoot_video_fbrender_target *) + VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) target = framebuffer.back_target; if (! target->data) - return grub_error (GRUB_ERR_BUG, + return VasEBoot_error (VasEBoot_ERR_BUG, "invalid render target given"); framebuffer.render_target = target; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target) +VasEBoot_err_t +VasEBoot_video_fb_get_active_render_target (struct VasEBoot_video_fbrender_target **target) { *target = framebuffer.render_target; if (*target == framebuffer.back_target) - *target = (struct grub_video_fbrender_target *) GRUB_VIDEO_RENDER_TARGET_DISPLAY; + *target = (struct VasEBoot_video_fbrender_target *) VasEBoot_VIDEO_RENDER_TARGET_DISPLAY; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t doublebuf_blit_update_screen (void) { if (framebuffer.current_dirty.first_line <= framebuffer.current_dirty.last_line) - grub_memcpy ((char *) framebuffer.pages[0] + VasEBoot_memcpy ((char *) framebuffer.pages[0] + framebuffer.current_dirty.first_line * framebuffer.back_target->mode_info.pitch, (char *) framebuffer.back_target->data @@ -1430,30 +1430,30 @@ doublebuf_blit_update_screen (void) = framebuffer.back_target->mode_info.height; framebuffer.current_dirty.last_line = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_fb_doublebuf_blit_init (struct grub_video_fbrender_target **back, - struct grub_video_mode_info mode_info, +static VasEBoot_err_t +VasEBoot_video_fb_doublebuf_blit_init (struct VasEBoot_video_fbrender_target **back, + struct VasEBoot_video_mode_info mode_info, volatile void *framebuf) { - grub_err_t err; - grub_size_t page_size = mode_info.pitch * mode_info.height; + VasEBoot_err_t err; + VasEBoot_size_t page_size = mode_info.pitch * mode_info.height; - framebuffer.offscreen_buffer = grub_zalloc (page_size); + framebuffer.offscreen_buffer = VasEBoot_zalloc (page_size); if (! framebuffer.offscreen_buffer) - return grub_errno; + return VasEBoot_errno; - err = grub_video_fb_create_render_target_from_pointer (&framebuffer.back_target, + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.back_target, &mode_info, framebuffer.offscreen_buffer); if (err) { - grub_free (framebuffer.offscreen_buffer); + VasEBoot_free (framebuffer.offscreen_buffer); framebuffer.offscreen_buffer = 0; - return grub_errno; + return VasEBoot_errno; } (*back)->is_allocated = 1; @@ -1464,14 +1464,14 @@ grub_video_fb_doublebuf_blit_init (struct grub_video_fbrender_target **back, framebuffer.current_dirty.first_line = mode_info.height; framebuffer.current_dirty.last_line = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t doublebuf_pageflipping_update_screen (void) { int new_displayed_page; - grub_err_t err; + VasEBoot_err_t err; int first_line, last_line; first_line = framebuffer.current_dirty.first_line; @@ -1482,7 +1482,7 @@ doublebuf_pageflipping_update_screen (void) last_line = framebuffer.previous_dirty.last_line; if (first_line <= last_line) - grub_memcpy ((char *) framebuffer.pages[framebuffer.render_page] + VasEBoot_memcpy ((char *) framebuffer.pages[framebuffer.render_page] + first_line * framebuffer.back_target->mode_info.pitch, (char *) framebuffer.back_target->data + first_line * framebuffer.back_target->mode_info.pitch, @@ -1507,33 +1507,33 @@ doublebuf_pageflipping_update_screen (void) return err; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -doublebuf_pageflipping_init (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +doublebuf_pageflipping_init (struct VasEBoot_video_mode_info *mode_info, volatile void *page0_ptr, - grub_video_fb_set_page_t set_page_in, + VasEBoot_video_fb_set_page_t set_page_in, volatile void *page1_ptr) { - grub_err_t err; - grub_size_t page_size = mode_info->pitch * mode_info->height; + VasEBoot_err_t err; + VasEBoot_size_t page_size = mode_info->pitch * mode_info->height; - framebuffer.offscreen_buffer = grub_malloc (page_size); + framebuffer.offscreen_buffer = VasEBoot_malloc (page_size); if (! framebuffer.offscreen_buffer) { - return grub_errno; + return VasEBoot_errno; } - err = grub_video_fb_create_render_target_from_pointer (&framebuffer.back_target, + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.back_target, mode_info, framebuffer.offscreen_buffer); if (err) { - grub_free (framebuffer.offscreen_buffer); + VasEBoot_free (framebuffer.offscreen_buffer); framebuffer.offscreen_buffer = 0; - return grub_errno; + return VasEBoot_errno; } framebuffer.back_target->is_allocated = 1; @@ -1555,31 +1555,31 @@ doublebuf_pageflipping_init (struct grub_video_mode_info *mode_info, err = set_page_in (framebuffer.displayed_page); if (err) { - grub_video_fb_delete_render_target (framebuffer.back_target); + VasEBoot_video_fb_delete_render_target (framebuffer.back_target); return err; } framebuffer.set_page = set_page_in; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Select the best double buffering mode available. */ -grub_err_t -grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask, - struct grub_video_mode_info *mode_info, +VasEBoot_err_t +VasEBoot_video_fb_setup (unsigned int mode_type, unsigned int mode_mask, + struct VasEBoot_video_mode_info *mode_info, volatile void *page0_ptr, - grub_video_fb_set_page_t set_page_in, + VasEBoot_video_fb_set_page_t set_page_in, volatile void *page1_ptr) { - grub_err_t err; + VasEBoot_err_t err; /* Do double buffering only if it's either requested or efficient. */ - if (set_page_in && grub_video_check_mode_flag (mode_type, mode_mask, - GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED, + if (set_page_in && VasEBoot_video_check_mode_flag (mode_type, mode_mask, + VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED, 1)) { - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED; - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP; + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED; + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP; err = doublebuf_pageflipping_init (mode_info, page0_ptr, set_page_in, @@ -1587,43 +1587,43 @@ grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask, if (!err) { framebuffer.render_target = framebuffer.back_target; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - mode_info->mode_type &= ~(GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + mode_info->mode_type &= ~(VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - if (grub_video_check_mode_flag (mode_type, mode_mask, - GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED, + if (VasEBoot_video_check_mode_flag (mode_type, mode_mask, + VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED, 1)) { /* It was much nicer with the cast directly at function call but some older gcc versions don't accept it properly.*/ void *tmp = (void *) page0_ptr; - mode_info->mode_type |= (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + mode_info->mode_type |= (VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); - err = grub_video_fb_doublebuf_blit_init (&framebuffer.back_target, + err = VasEBoot_video_fb_doublebuf_blit_init (&framebuffer.back_target, *mode_info, tmp); if (!err) { framebuffer.render_target = framebuffer.back_target; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - mode_info->mode_type &= ~(GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + mode_info->mode_type &= ~(VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } /* Fall back to no double buffering. */ - err = grub_video_fb_create_render_target_from_pointer (&framebuffer.back_target, + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.back_target, mode_info, (void *) page0_ptr); @@ -1639,33 +1639,33 @@ grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask, = framebuffer.back_target->mode_info.height; framebuffer.current_dirty.last_line = 0; - mode_info->mode_type &= ~GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED; + mode_info->mode_type &= ~VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED; framebuffer.render_target = framebuffer.back_target; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_swap_buffers (void) +VasEBoot_err_t +VasEBoot_video_fb_swap_buffers (void) { - grub_err_t err; + VasEBoot_err_t err; if (!framebuffer.update_screen) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; err = framebuffer.update_screen (); if (err) return err; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info, +VasEBoot_err_t +VasEBoot_video_fb_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.back_target->mode_info), + VasEBoot_memcpy (mode_info, &(framebuffer.back_target->mode_info), sizeof (*mode_info)); /* We are about to load a kernel. Switch back to page zero, since some @@ -1677,7 +1677,7 @@ grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info, *framebuf = (void *) framebuffer.pages[framebuffer.displayed_page]; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } diff --git a/VasEBoot-core/video/i386/coreboot/cbfb.c b/VasEBoot-core/video/i386/coreboot/cbfb.c index dede0c37e..b37103cf6 100644 --- a/VasEBoot-core/video/i386/coreboot/cbfb.c +++ b/VasEBoot-core/video/i386/coreboot/cbfb.c @@ -1,190 +1,190 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable; +struct VasEBoot_linuxbios_table_framebuffer *VasEBoot_video_coreboot_fbtable; static struct { - struct grub_video_mode_info mode_info; - grub_uint8_t *ptr; + struct VasEBoot_video_mode_info mode_info; + VasEBoot_uint8_t *ptr; } framebuffer; -static grub_err_t -grub_video_cbfb_init (void) +static VasEBoot_err_t +VasEBoot_video_cbfb_init (void) { - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_cbfb_fill_mode_info (struct grub_video_mode_info *out) +static VasEBoot_err_t +VasEBoot_video_cbfb_fill_mode_info (struct VasEBoot_video_mode_info *out) { - grub_memset (out, 0, sizeof (*out)); + VasEBoot_memset (out, 0, sizeof (*out)); - out->width = grub_video_coreboot_fbtable->width; - out->height = grub_video_coreboot_fbtable->height; - out->pitch = grub_video_coreboot_fbtable->pitch; + out->width = VasEBoot_video_coreboot_fbtable->width; + out->height = VasEBoot_video_coreboot_fbtable->height; + out->pitch = VasEBoot_video_coreboot_fbtable->pitch; - out->red_field_pos = grub_video_coreboot_fbtable->red_field_pos; - out->red_mask_size = grub_video_coreboot_fbtable->red_mask_size; - out->green_field_pos = grub_video_coreboot_fbtable->green_field_pos; - out->green_mask_size = grub_video_coreboot_fbtable->green_mask_size; - out->blue_field_pos = grub_video_coreboot_fbtable->blue_field_pos; - out->blue_mask_size = grub_video_coreboot_fbtable->blue_mask_size; - out->reserved_field_pos = grub_video_coreboot_fbtable->reserved_field_pos; - out->reserved_mask_size = grub_video_coreboot_fbtable->reserved_mask_size; + out->red_field_pos = VasEBoot_video_coreboot_fbtable->red_field_pos; + out->red_mask_size = VasEBoot_video_coreboot_fbtable->red_mask_size; + out->green_field_pos = VasEBoot_video_coreboot_fbtable->green_field_pos; + out->green_mask_size = VasEBoot_video_coreboot_fbtable->green_mask_size; + out->blue_field_pos = VasEBoot_video_coreboot_fbtable->blue_field_pos; + out->blue_mask_size = VasEBoot_video_coreboot_fbtable->blue_mask_size; + out->reserved_field_pos = VasEBoot_video_coreboot_fbtable->reserved_field_pos; + out->reserved_mask_size = VasEBoot_video_coreboot_fbtable->reserved_mask_size; - out->mode_type = GRUB_VIDEO_MODE_TYPE_RGB; - out->bpp = grub_video_coreboot_fbtable->bpp; - out->bytes_per_pixel = (grub_video_coreboot_fbtable->bpp + 7) / 8; + out->mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; + out->bpp = VasEBoot_video_coreboot_fbtable->bpp; + out->bytes_per_pixel = (VasEBoot_video_coreboot_fbtable->bpp + 7) / 8; out->number_of_colors = 256; - out->blit_format = grub_video_get_blit_format (out); - return GRUB_ERR_NONE; + out->blit_format = VasEBoot_video_get_blit_format (out); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_cbfb_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_cbfb_setup (unsigned int width, unsigned int height, unsigned int mode_type __attribute__ ((unused)), unsigned int mode_mask __attribute__ ((unused))) { - grub_err_t err; + VasEBoot_err_t err; - if (!grub_video_coreboot_fbtable) - return grub_error (GRUB_ERR_IO, "Couldn't find display device."); + if (!VasEBoot_video_coreboot_fbtable) + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find display device."); - if (!((width == grub_video_coreboot_fbtable->width && height == grub_video_coreboot_fbtable->height) + if (!((width == VasEBoot_video_coreboot_fbtable->width && height == VasEBoot_video_coreboot_fbtable->height) || (width == 0 && height == 0))) - return grub_error (GRUB_ERR_IO, "can't set mode %dx%d", width, height); + return VasEBoot_error (VasEBoot_ERR_IO, "can't set mode %dx%d", width, height); - err = grub_video_cbfb_fill_mode_info (&framebuffer.mode_info); + err = VasEBoot_video_cbfb_fill_mode_info (&framebuffer.mode_info); if (err) { - grub_dprintf ("video", "CBFB: couldn't fill mode info\n"); + VasEBoot_dprintf ("video", "CBFB: couldn't fill mode info\n"); return err; } - framebuffer.ptr = (void *) (grub_addr_t) grub_video_coreboot_fbtable->lfb; + framebuffer.ptr = (void *) (VasEBoot_addr_t) VasEBoot_video_coreboot_fbtable->lfb; - grub_dprintf ("video", "CBFB: initialising FB @ %p %dx%dx%d\n", + VasEBoot_dprintf ("video", "CBFB: initialising FB @ %p %dx%dx%d\n", framebuffer.ptr, framebuffer.mode_info.width, framebuffer.mode_info.height, framebuffer.mode_info.bpp); - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, NULL, NULL); if (err) return err; - grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); return err; } -static grub_err_t -grub_video_cbfb_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_cbfb_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_cbfb_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_cbfb_adapter = { .name = "Coreboot video driver", - .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY, - .id = GRUB_VIDEO_DRIVER_COREBOOT, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY, + .id = VasEBoot_VIDEO_DRIVER_COREBOOT, - .init = grub_video_cbfb_init, - .fini = grub_video_fb_fini, - .setup = grub_video_cbfb_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_cbfb_get_info_and_fini, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_fb_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_cbfb_init, + .fini = VasEBoot_video_fb_fini, + .setup = VasEBoot_video_cbfb_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_cbfb_get_info_and_fini, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_fb_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; static int -iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, +iterate_linuxbios_table (VasEBoot_linuxbios_table_item_t table_item, void *data __attribute__ ((unused))) { - if (table_item->tag != GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER) + if (table_item->tag != VasEBoot_LINUXBIOS_MEMBER_FRAMEBUFFER) return 0; - grub_video_coreboot_fbtable = (struct grub_linuxbios_table_framebuffer *) (table_item + 1); + VasEBoot_video_coreboot_fbtable = (struct VasEBoot_linuxbios_table_framebuffer *) (table_item + 1); return 1; } void -grub_video_coreboot_fb_early_init (void) +VasEBoot_video_coreboot_fb_early_init (void) { - grub_linuxbios_table_iterate (iterate_linuxbios_table, 0); + VasEBoot_linuxbios_table_iterate (iterate_linuxbios_table, 0); } void -grub_video_coreboot_fb_late_init (void) +VasEBoot_video_coreboot_fb_late_init (void) { - if (grub_video_coreboot_fbtable) - grub_video_register (&grub_video_cbfb_adapter); + if (VasEBoot_video_coreboot_fbtable) + VasEBoot_video_register (&VasEBoot_video_cbfb_adapter); } void -grub_video_coreboot_fb_fini (void) +VasEBoot_video_coreboot_fb_fini (void) { - if (grub_video_coreboot_fbtable) - grub_video_unregister (&grub_video_cbfb_adapter); + if (VasEBoot_video_coreboot_fbtable) + VasEBoot_video_unregister (&VasEBoot_video_cbfb_adapter); } diff --git a/VasEBoot-core/video/i386/pc/vbe.c b/VasEBoot-core/video/i386/pc/vbe.c index b7f911926..6fad648bb 100644 --- a/VasEBoot-core/video/i386/pc/vbe.c +++ b/VasEBoot-core/video/i386/pc/vbe.c @@ -1,58 +1,58 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); static int vbe_detected = -1; -static struct grub_vbe_info_block controller_info; +static struct VasEBoot_vbe_info_block controller_info; /* Track last mode to support cards which fail on get_mode. */ -static grub_uint32_t last_set_mode = 3; +static VasEBoot_uint32_t last_set_mode = 3; static struct { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int mtrr; } framebuffer; -static grub_uint32_t initial_vbe_mode; -static grub_uint16_t *vbe_mode_list; +static VasEBoot_uint32_t initial_vbe_mode; +static VasEBoot_uint16_t *vbe_mode_list; static void * -real2pm (grub_vbe_farptr_t ptr) +real2pm (VasEBoot_vbe_farptr_t ptr) { return (void *) ((((unsigned long) ptr & 0xFFFF0000) >> 12UL) + ((unsigned long) ptr & 0x0000FFFF)); @@ -73,10 +73,10 @@ real2pm (grub_vbe_farptr_t ptr) exclusively to work around BIOS bugs, as the BIOS should already be setting up a suitable MTRR. */ static void -grub_vbe_enable_mtrr_entry (int mtrr) +VasEBoot_vbe_enable_mtrr_entry (int mtrr) { - grub_uint32_t eax, edx; - grub_uint32_t mask_lo, mask_hi; + VasEBoot_uint32_t eax, edx; + VasEBoot_uint32_t mask_lo, mask_hi; rdmsr (mtrr_mask (mtrr), eax, edx); mask_lo = eax; @@ -87,23 +87,23 @@ grub_vbe_enable_mtrr_entry (int mtrr) } static void -grub_vbe_enable_mtrr (grub_uint8_t *base, grub_size_t size) +VasEBoot_vbe_enable_mtrr (VasEBoot_uint8_t *base, VasEBoot_size_t size) { - grub_uint32_t eax, ebx, ecx, edx; - grub_uint32_t features; - grub_uint32_t mtrrcap; + VasEBoot_uint32_t eax, ebx, ecx, edx; + VasEBoot_uint32_t features; + VasEBoot_uint32_t mtrrcap; int var_mtrrs; - grub_uint32_t max_extended_cpuid; - grub_uint32_t maxphyaddr; - grub_uint64_t fb_base, fb_size; - grub_uint64_t size_bits, fb_mask; - grub_uint32_t bits_lo, bits_hi; - grub_uint64_t bits; + VasEBoot_uint32_t max_extended_cpuid; + VasEBoot_uint32_t maxphyaddr; + VasEBoot_uint64_t fb_base, fb_size; + VasEBoot_uint64_t size_bits, fb_mask; + VasEBoot_uint32_t bits_lo, bits_hi; + VasEBoot_uint64_t bits; int i, first_unused = -1; - grub_uint32_t base_lo, base_hi, mask_lo, mask_hi; + VasEBoot_uint32_t base_lo, base_hi, mask_lo, mask_hi; - fb_base = (grub_uint64_t) (grub_size_t) base; - fb_size = (grub_uint64_t) size; + fb_base = (VasEBoot_uint64_t) (VasEBoot_size_t) base; + fb_size = (VasEBoot_uint64_t) size; /* Check that fb_base and fb_size can be represented using a single MTRR. */ @@ -128,10 +128,10 @@ grub_vbe_enable_mtrr (grub_uint8_t *base, grub_size_t size) /* Check CPU capabilities. */ - if (! grub_cpu_is_cpuid_supported ()) + if (! VasEBoot_cpu_is_cpuid_supported ()) return; - grub_cpuid (1, eax, ebx, ecx, edx); + VasEBoot_cpuid (1, eax, ebx, ecx, edx); features = edx; if (! (features & 0x00001000)) /* MTRR */ return; @@ -142,18 +142,18 @@ grub_vbe_enable_mtrr (grub_uint8_t *base, grub_size_t size) return; var_mtrrs = (mtrrcap & 0xFF); - grub_cpuid (0x80000000, eax, ebx, ecx, edx); + VasEBoot_cpuid (0x80000000, eax, ebx, ecx, edx); max_extended_cpuid = eax; if (max_extended_cpuid >= 0x80000008) { - grub_cpuid (0x80000008, eax, ebx, ecx, edx); + VasEBoot_cpuid (0x80000008, eax, ebx, ecx, edx); maxphyaddr = (eax & 0xFF); } else maxphyaddr = 36; bits_lo = 0xFFFFF000; /* assume maxphyaddr >= 36 */ bits_hi = (1 << (maxphyaddr - 32)) - 1; - bits = bits_lo | ((grub_uint64_t) bits_hi << 32); + bits = bits_lo | ((VasEBoot_uint64_t) bits_hi << 32); /* Check whether an MTRR already covers this region. If not, take an unused one if possible. */ @@ -164,15 +164,15 @@ grub_vbe_enable_mtrr (grub_uint8_t *base, grub_size_t size) mask_hi = edx; if (mask_lo & 0x800) /* valid */ { - grub_uint64_t real_base, real_mask; + VasEBoot_uint64_t real_base, real_mask; rdmsr (mtrr_base (i), eax, edx); base_lo = eax; base_hi = edx; - real_base = ((grub_uint64_t) (base_hi & bits_hi) << 32) | + real_base = ((VasEBoot_uint64_t) (base_hi & bits_hi) << 32) | (base_lo & bits_lo); - real_mask = ((grub_uint64_t) (mask_hi & bits_hi) << 32) | + real_mask = ((VasEBoot_uint64_t) (mask_hi & bits_hi) << 32) | (mask_lo & bits_lo); if (real_base < (fb_base + fb_size) && real_base + (~real_mask & bits) >= fb_base) @@ -205,10 +205,10 @@ grub_vbe_enable_mtrr (grub_uint8_t *base, grub_size_t size) } static void -grub_vbe_disable_mtrr (int mtrr) +VasEBoot_vbe_disable_mtrr (int mtrr) { - grub_uint32_t eax, edx; - grub_uint32_t mask_lo, mask_hi; + VasEBoot_uint32_t eax, edx; + VasEBoot_uint32_t mask_lo, mask_hi; rdmsr (mtrr_mask (mtrr), eax, edx); mask_lo = eax; @@ -219,171 +219,171 @@ grub_vbe_disable_mtrr (int mtrr) } /* Call VESA BIOS 0x4f09 to set palette data, return status. */ -static grub_vbe_status_t -grub_vbe_bios_set_palette_data (grub_uint32_t color_count, - grub_uint32_t start_index, - struct grub_vbe_palette_data *palette_data) +static VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_palette_data (VasEBoot_uint32_t color_count, + VasEBoot_uint32_t start_index, + struct VasEBoot_vbe_palette_data *palette_data) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f09; regs.ebx = 0; regs.ecx = color_count; regs.edx = start_index; - regs.es = (((grub_addr_t) palette_data) & 0xffff0000) >> 4; - regs.edi = ((grub_addr_t) palette_data) & 0xffff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.es = (((VasEBoot_addr_t) palette_data) & 0xffff0000) >> 4; + regs.edi = ((VasEBoot_addr_t) palette_data) & 0xffff; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *ci) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_controller_info (struct VasEBoot_vbe_info_block *ci) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; /* Store *controller_info to %es:%di. */ - regs.es = (((grub_addr_t) ci) & 0xffff0000) >> 4; - regs.edi = ((grub_addr_t) ci) & 0xffff; + regs.es = (((VasEBoot_addr_t) ci) & 0xffff0000) >> 4; + regs.edi = ((VasEBoot_addr_t) ci) & 0xffff; regs.eax = 0x4f00; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_mode_info (grub_uint32_t mode, - struct grub_vbe_mode_info_block *mode_info) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_mode_info (VasEBoot_uint32_t mode, + struct VasEBoot_vbe_mode_info_block *mode_info) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f01; regs.ecx = mode; /* Store *mode_info to %es:%di. */ - regs.es = ((grub_addr_t) mode_info & 0xffff0000) >> 4; - regs.edi = (grub_addr_t) mode_info & 0x0000ffff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.es = ((VasEBoot_addr_t) mode_info & 0xffff0000) >> 4; + regs.edi = (VasEBoot_addr_t) mode_info & 0x0000ffff; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f02 to set video mode, return status. */ -static grub_vbe_status_t -grub_vbe_bios_set_mode (grub_uint32_t mode, - struct grub_vbe_crtc_info_block *crtc_info) +static VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_mode (VasEBoot_uint32_t mode, + struct VasEBoot_vbe_crtc_info_block *crtc_info) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f02; regs.ebx = mode; /* Store *crtc_info to %es:%di. */ - regs.es = (((grub_addr_t) crtc_info) & 0xffff0000) >> 4; - regs.edi = ((grub_addr_t) crtc_info) & 0xffff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.es = (((VasEBoot_addr_t) crtc_info) & 0xffff0000) >> 4; + regs.edi = ((VasEBoot_addr_t) crtc_info) & 0xffff; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_mode (grub_uint32_t *mode) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_mode (VasEBoot_uint32_t *mode) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f03; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); *mode = regs.ebx & 0xffff; return regs.eax & 0xffff; } -grub_vbe_status_t -grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f08; regs.ebx = ((*dac_mask_size & 0xff) << 8) | (set ? 1 : 0); - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); *dac_mask_size = (regs.ebx >> 8) & 0xff; return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f05 to set memory window, return status. */ -grub_vbe_status_t -grub_vbe_bios_set_memory_window (grub_uint32_t window, - grub_uint32_t position) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_memory_window (VasEBoot_uint32_t window, + VasEBoot_uint32_t position) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; /* BL = window, BH = 0, Set memory window. */ regs.ebx = window & 0x00ff; regs.edx = position; regs.eax = 0x4f05; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f05 to return memory window, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_memory_window (grub_uint32_t window, - grub_uint32_t *position) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_memory_window (VasEBoot_uint32_t window, + VasEBoot_uint32_t *position) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f05; /* BH = 1, Get memory window. BL = window. */ regs.ebx = (window & 0x00ff) | 0x100; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); *position = regs.edx & 0xffff; return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */ -grub_vbe_status_t -grub_vbe_bios_set_scanline_length (grub_uint32_t length) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_scanline_length (VasEBoot_uint32_t length) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.ecx = length; regs.eax = 0x4f06; /* BL = 2, Set Scan Line in Bytes. */ regs.ebx = 0x0002; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */ -grub_vbe_status_t -grub_vbe_bios_get_scanline_length (grub_uint32_t *length) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_scanline_length (VasEBoot_uint32_t *length) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f06; regs.ebx = 0x0001; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; /* BL = 1, Get Scan Line Length (in bytes). */ - grub_bios_interrupt (0x10, ®s); + VasEBoot_bios_interrupt (0x10, ®s); *length = regs.ebx & 0xffff; return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f07 to set display start, return status. */ -static grub_vbe_status_t -grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y) +static VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_display_start (VasEBoot_uint32_t x, VasEBoot_uint32_t y) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; if (framebuffer.mtrr >= 0) - grub_vbe_disable_mtrr (framebuffer.mtrr); + VasEBoot_vbe_disable_mtrr (framebuffer.mtrr); /* Store x in %ecx. */ regs.ecx = x; @@ -391,27 +391,27 @@ grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y) regs.eax = 0x4f07; /* BL = 80h, Set Display Start during Vertical Retrace. */ regs.ebx = 0x0080; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); if (framebuffer.mtrr >= 0) - grub_vbe_enable_mtrr_entry (framebuffer.mtrr); + VasEBoot_vbe_enable_mtrr_entry (framebuffer.mtrr); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f07 to get display start, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_display_start (grub_uint32_t *x, - grub_uint32_t *y) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_display_start (VasEBoot_uint32_t *x, + VasEBoot_uint32_t *y) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f07; /* BL = 1, Get Display Start. */ regs.ebx = 0x0001; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); *x = regs.ecx & 0xffff; *y = regs.edx & 0xffff; @@ -419,18 +419,18 @@ grub_vbe_bios_get_display_start (grub_uint32_t *x, } /* Call VESA BIOS 0x4f0a. */ -grub_vbe_status_t -grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset, - grub_uint16_t *length) +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_pm_interface (VasEBoot_uint16_t *segment, VasEBoot_uint16_t *offset, + VasEBoot_uint16_t *length) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f0a; regs.ebx = 0x0000; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); - if ((regs.eax & 0xffff) != GRUB_VBE_STATUS_OK) + if ((regs.eax & 0xffff) != VasEBoot_VBE_STATUS_OK) { *segment = 0; *offset = 0; @@ -444,80 +444,80 @@ grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset, } /* Call VESA BIOS 0x4f11 to get flat panel information, return status. */ -static grub_vbe_status_t -grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_info) +static VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_flat_panel_info (struct VasEBoot_vbe_flat_panel_info *flat_panel_info) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f11; regs.ebx = 0x0001; - regs.es = (((grub_addr_t) flat_panel_info) & 0xffff0000) >> 4; - regs.edi = ((grub_addr_t) flat_panel_info) & 0xffff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.es = (((VasEBoot_addr_t) flat_panel_info) & 0xffff0000) >> 4; + regs.edi = ((VasEBoot_addr_t) flat_panel_info) & 0xffff; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f15 to get DDC availability, return status. */ -static grub_vbe_status_t -grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level) +static VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_ddc_capabilities (VasEBoot_uint8_t *level) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f15; regs.ebx = 0x0000; regs.ecx = 0x0000; regs.es = 0x0000; regs.edi = 0x0000; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); *level = regs.ebx & 0xff; return regs.eax & 0xffff; } /* Call VESA BIOS 0x4f15 to read EDID information, return status. */ -static grub_vbe_status_t -grub_vbe_bios_read_edid (struct grub_video_edid_info *edid_info) +static VasEBoot_vbe_status_t +VasEBoot_vbe_bios_read_edid (struct VasEBoot_video_edid_info *edid_info) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; regs.eax = 0x4f15; regs.ebx = 0x0001; regs.ecx = 0x0000; regs.edx = 0x0000; - regs.es = (((grub_addr_t) edid_info) & 0xffff0000) >> 4; - regs.edi = ((grub_addr_t) edid_info) & 0xffff; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.es = (((VasEBoot_addr_t) edid_info) & 0xffff0000) >> 4; + regs.edi = ((VasEBoot_addr_t) edid_info) & 0xffff; + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return regs.eax & 0xffff; } -grub_err_t -grub_vbe_probe (struct grub_vbe_info_block *info_block) +VasEBoot_err_t +VasEBoot_vbe_probe (struct VasEBoot_vbe_info_block *info_block) { - struct grub_vbe_info_block *vbe_ib; - grub_vbe_status_t status; + struct VasEBoot_vbe_info_block *vbe_ib; + VasEBoot_vbe_status_t status; /* Clear caller's controller info block. */ if (info_block) - grub_memset (info_block, 0, sizeof (*info_block)); + VasEBoot_memset (info_block, 0, sizeof (*info_block)); /* Do not probe more than one time, if not necessary. */ if (vbe_detected == -1 || info_block) { /* Clear old copy of controller info block. */ - grub_memset (&controller_info, 0, sizeof (controller_info)); + VasEBoot_memset (&controller_info, 0, sizeof (controller_info)); /* Mark VESA BIOS extension as undetected. */ vbe_detected = 0; /* Use low memory scratch area as temporary storage for VESA BIOS call. */ - vbe_ib = (struct grub_vbe_info_block *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + vbe_ib = (struct VasEBoot_vbe_info_block *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; /* Prepare info block. */ - grub_memset (vbe_ib, 0, sizeof (*vbe_ib)); + VasEBoot_memset (vbe_ib, 0, sizeof (*vbe_ib)); vbe_ib->signature[0] = 'V'; vbe_ib->signature[1] = 'B'; @@ -525,11 +525,11 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) vbe_ib->signature[3] = '2'; /* Try to get controller info block. */ - status = grub_vbe_bios_get_controller_info (vbe_ib); - if (status == GRUB_VBE_STATUS_OK) + status = VasEBoot_vbe_bios_get_controller_info (vbe_ib); + if (status == VasEBoot_VBE_STATUS_OK) { /* Copy it for later usage. */ - grub_memcpy (&controller_info, vbe_ib, sizeof (controller_info)); + VasEBoot_memcpy (&controller_info, vbe_ib, sizeof (controller_info)); /* Mark VESA BIOS extension as detected. */ vbe_detected = 1; @@ -537,91 +537,91 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) } if (! vbe_detected) - return grub_error (GRUB_ERR_BAD_DEVICE, "VESA BIOS Extension not found"); + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "VESA BIOS Extension not found"); /* Make copy of controller info block to caller. */ if (info_block) - grub_memcpy (info_block, &controller_info, sizeof (*info_block)); + VasEBoot_memcpy (info_block, &controller_info, sizeof (*info_block)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_vbe_get_edid (struct grub_video_edid_info *edid_info) +static VasEBoot_err_t +VasEBoot_video_vbe_get_edid (struct VasEBoot_video_edid_info *edid_info) { - struct grub_video_edid_info *edid_info_lowmem; + struct VasEBoot_video_edid_info *edid_info_lowmem; /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ edid_info_lowmem = - (struct grub_video_edid_info *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_memset (edid_info_lowmem, 0, sizeof (*edid_info_lowmem)); + (struct VasEBoot_video_edid_info *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_memset (edid_info_lowmem, 0, sizeof (*edid_info_lowmem)); - if (grub_vbe_bios_read_edid (edid_info_lowmem) != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available"); + if (VasEBoot_vbe_bios_read_edid (edid_info_lowmem) != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "EDID information not available"); - grub_memcpy (edid_info, edid_info_lowmem, sizeof (*edid_info)); + VasEBoot_memcpy (edid_info, edid_info_lowmem, sizeof (*edid_info)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) +static VasEBoot_err_t +VasEBoot_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) { - grub_vbe_status_t status; - grub_uint8_t ddc_level; - struct grub_video_edid_info edid_info; - struct grub_vbe_flat_panel_info *flat_panel_info; + VasEBoot_vbe_status_t status; + VasEBoot_uint8_t ddc_level; + struct VasEBoot_video_edid_info edid_info; + struct VasEBoot_vbe_flat_panel_info *flat_panel_info; /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ - flat_panel_info = (struct grub_vbe_flat_panel_info *) - (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + sizeof (struct grub_video_edid_info)); + flat_panel_info = (struct VasEBoot_vbe_flat_panel_info *) + (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR + sizeof (struct VasEBoot_video_edid_info)); if (controller_info.version >= 0x200 - && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) - == GRUB_VBE_STATUS_OK) + && (VasEBoot_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) + == VasEBoot_VBE_STATUS_OK) { - if (grub_video_vbe_get_edid (&edid_info) == GRUB_ERR_NONE - && grub_video_edid_checksum (&edid_info) == GRUB_ERR_NONE - && grub_video_edid_preferred_mode (&edid_info, width, height) - == GRUB_ERR_NONE && *width < 4096 && *height < 4096) - return GRUB_ERR_NONE; + if (VasEBoot_video_vbe_get_edid (&edid_info) == VasEBoot_ERR_NONE + && VasEBoot_video_edid_checksum (&edid_info) == VasEBoot_ERR_NONE + && VasEBoot_video_edid_preferred_mode (&edid_info, width, height) + == VasEBoot_ERR_NONE && *width < 4096 && *height < 4096) + return VasEBoot_ERR_NONE; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } - grub_memset (flat_panel_info, 0, sizeof (*flat_panel_info)); - status = grub_vbe_bios_get_flat_panel_info (flat_panel_info); - if (status == GRUB_VBE_STATUS_OK + VasEBoot_memset (flat_panel_info, 0, sizeof (*flat_panel_info)); + status = VasEBoot_vbe_bios_get_flat_panel_info (flat_panel_info); + if (status == VasEBoot_VBE_STATUS_OK && flat_panel_info->horizontal_size && flat_panel_info->vertical_size && flat_panel_info->horizontal_size < 4096 && flat_panel_info->vertical_size < 4096) { *width = flat_panel_info->horizontal_size; *height = flat_panel_info->vertical_size; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot get preferred mode"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "cannot get preferred mode"); } -static grub_err_t -grub_vbe_set_video_mode (grub_uint32_t vbe_mode, - struct grub_vbe_mode_info_block *vbe_mode_info) +static VasEBoot_err_t +VasEBoot_vbe_set_video_mode (VasEBoot_uint32_t vbe_mode, + struct VasEBoot_vbe_mode_info_block *vbe_mode_info) { - grub_vbe_status_t status; - grub_uint32_t old_vbe_mode; - struct grub_vbe_mode_info_block new_vbe_mode_info; - grub_err_t err; + VasEBoot_vbe_status_t status; + VasEBoot_uint32_t old_vbe_mode; + struct VasEBoot_vbe_mode_info_block new_vbe_mode_info; + VasEBoot_err_t err; /* Make sure that VBE is supported. */ - grub_vbe_probe (0); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_probe (0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Try to get mode info. */ - grub_vbe_get_video_mode_info (vbe_mode, &new_vbe_mode_info); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_get_video_mode_info (vbe_mode, &new_vbe_mode_info); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* For all VESA BIOS modes, force linear frame buffer. */ if (vbe_mode >= 0x100) @@ -630,37 +630,37 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, vbe_mode |= 1 << 14; /* Determine frame buffer pixel format. */ - if (new_vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL + if (new_vbe_mode_info.memory_model != VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL && new_vbe_mode_info.memory_model - != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + != VasEBoot_VBE_MEMORY_MODEL_DIRECT_COLOR) + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "unsupported pixel format 0x%x", new_vbe_mode_info.memory_model); } /* Get current mode. */ - grub_vbe_get_video_mode (&old_vbe_mode); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_get_video_mode (&old_vbe_mode); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Try to set video mode. */ - status = grub_vbe_bios_set_mode (vbe_mode, 0); - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", vbe_mode); + status = VasEBoot_vbe_bios_set_mode (vbe_mode, 0); + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot set VBE mode %x", vbe_mode); last_set_mode = vbe_mode; if (vbe_mode < 0x100) { /* If this is not a VESA mode, guess address. */ - framebuffer.ptr = (grub_uint8_t *) 0xa0000; + framebuffer.ptr = (VasEBoot_uint8_t *) 0xa0000; } else { - framebuffer.ptr = (grub_uint8_t *) new_vbe_mode_info.phys_base_addr; + framebuffer.ptr = (VasEBoot_uint8_t *) new_vbe_mode_info.phys_base_addr; } /* Check whether mode is text mode or graphics mode. */ - if (new_vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) + if (new_vbe_mode_info.memory_model == VasEBoot_VBE_MEMORY_MODEL_TEXT) { /* Text mode. */ @@ -673,27 +673,27 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, /* If video mode is in indexed color, setup default VGA palette. */ if (vbe_mode < 0x100 || new_vbe_mode_info.memory_model - == GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL) + == VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL) { - struct grub_vbe_palette_data *palette - = (struct grub_vbe_palette_data *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + struct VasEBoot_vbe_palette_data *palette + = (struct VasEBoot_vbe_palette_data *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; unsigned i; /* Make sure that the BIOS can reach the palette. */ - for (i = 0; i < GRUB_VIDEO_FBSTD_NUMCOLORS; i++) + for (i = 0; i < VasEBoot_VIDEO_FBSTD_NUMCOLORS; i++) { - palette[i].red = grub_video_fbstd_colors[i].r; - palette[i].green = grub_video_fbstd_colors[i].g; - palette[i].blue = grub_video_fbstd_colors[i].b; + palette[i].red = VasEBoot_video_fbstd_colors[i].r; + palette[i].green = VasEBoot_video_fbstd_colors[i].g; + palette[i].blue = VasEBoot_video_fbstd_colors[i].b; palette[i].alignment = 0; } - status = grub_vbe_bios_set_palette_data (GRUB_VIDEO_FBSTD_NUMCOLORS, + status = VasEBoot_vbe_bios_set_palette_data (VasEBoot_VIDEO_FBSTD_NUMCOLORS, 0, palette); /* Just ignore the status. */ - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); if (err) return err; @@ -702,69 +702,69 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, /* Copy mode info for caller. */ if (vbe_mode_info) - grub_memcpy (vbe_mode_info, &new_vbe_mode_info, sizeof (*vbe_mode_info)); + VasEBoot_memcpy (vbe_mode_info, &new_vbe_mode_info, sizeof (*vbe_mode_info)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_vbe_get_video_mode (grub_uint32_t *mode) +VasEBoot_err_t +VasEBoot_vbe_get_video_mode (VasEBoot_uint32_t *mode) { - grub_vbe_status_t status; + VasEBoot_vbe_status_t status; /* Make sure that VBE is supported. */ - grub_vbe_probe (0); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_probe (0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Try to query current mode from VESA BIOS. */ - status = grub_vbe_bios_get_mode (mode); + status = VasEBoot_vbe_bios_get_mode (mode); /* XXX: ATI cards don't support get_mode. */ - if (status != GRUB_VBE_STATUS_OK) + if (status != VasEBoot_VBE_STATUS_OK) *mode = last_set_mode; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_vbe_get_video_mode_info (grub_uint32_t mode, - struct grub_vbe_mode_info_block *mode_info) +VasEBoot_err_t +VasEBoot_vbe_get_video_mode_info (VasEBoot_uint32_t mode, + struct VasEBoot_vbe_mode_info_block *mode_info) { - struct grub_vbe_mode_info_block *mi_tmp - = (struct grub_vbe_mode_info_block *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_vbe_status_t status; + struct VasEBoot_vbe_mode_info_block *mi_tmp + = (struct VasEBoot_vbe_mode_info_block *) VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR; + VasEBoot_vbe_status_t status; /* Make sure that VBE is supported. */ - grub_vbe_probe (0); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_probe (0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* If mode is not VESA mode, skip mode info query. */ if (mode >= 0x100) { /* Try to get mode info from VESA BIOS. */ - status = grub_vbe_bios_get_mode_info (mode, mi_tmp); - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_BAD_DEVICE, + status = VasEBoot_vbe_bios_get_mode_info (mode, mi_tmp); + if (status != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot get information on the mode %x", mode); /* Make copy of mode info block. */ - grub_memcpy (mode_info, mi_tmp, sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, mi_tmp, sizeof (*mode_info)); } else /* Just clear mode info block if it isn't a VESA mode. */ - grub_memset (mode_info, 0, sizeof (*mode_info)); + VasEBoot_memset (mode_info, 0, sizeof (*mode_info)); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_vbe_init (void) +static VasEBoot_err_t +VasEBoot_video_vbe_init (void) { - grub_uint16_t *rm_vbe_mode_list; - grub_uint16_t *p; - grub_size_t vbe_mode_list_size; - struct grub_vbe_info_block info_block; + VasEBoot_uint16_t *rm_vbe_mode_list; + VasEBoot_uint16_t *p; + VasEBoot_size_t vbe_mode_list_size; + struct VasEBoot_vbe_info_block info_block; /* Check if there is adapter present. @@ -772,63 +772,63 @@ grub_video_vbe_init (void) list in temporary memory. So we must first use vbe probe to get refreshed information to receive valid pointers and data, and then copy this information to somewhere safe. */ - grub_vbe_probe (&info_block); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_probe (&info_block); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Copy modelist to local memory. */ p = rm_vbe_mode_list = real2pm (info_block.video_mode_ptr); while(*p++ != 0xFFFF) ; - vbe_mode_list_size = (grub_addr_t) p - (grub_addr_t) rm_vbe_mode_list; - vbe_mode_list = grub_malloc (vbe_mode_list_size); + vbe_mode_list_size = (VasEBoot_addr_t) p - (VasEBoot_addr_t) rm_vbe_mode_list; + vbe_mode_list = VasEBoot_malloc (vbe_mode_list_size); if (! vbe_mode_list) - return grub_errno; - grub_memcpy (vbe_mode_list, rm_vbe_mode_list, vbe_mode_list_size); + return VasEBoot_errno; + VasEBoot_memcpy (vbe_mode_list, rm_vbe_mode_list, vbe_mode_list_size); /* Adapter could be found, figure out initial video mode. */ - grub_vbe_get_video_mode (&initial_vbe_mode); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_vbe_get_video_mode (&initial_vbe_mode); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { /* Free allocated resources. */ - grub_free (vbe_mode_list); + VasEBoot_free (vbe_mode_list); vbe_mode_list = NULL; - return grub_errno; + return VasEBoot_errno; } /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); framebuffer.mtrr = -1; - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_vbe_fini (void) +static VasEBoot_err_t +VasEBoot_video_vbe_fini (void) { - grub_vbe_status_t status; - grub_err_t err; + VasEBoot_vbe_status_t status; + VasEBoot_err_t err; /* Restore old video mode. */ if (last_set_mode != initial_vbe_mode) { - status = grub_vbe_bios_set_mode (initial_vbe_mode, 0); - if (status != GRUB_VBE_STATUS_OK) + status = VasEBoot_vbe_bios_set_mode (initial_vbe_mode, 0); + if (status != VasEBoot_VBE_STATUS_OK) /* TODO: Decide, is this something we want to do. */ - return grub_errno; + return VasEBoot_errno; } last_set_mode = initial_vbe_mode; /* TODO: Free any resources allocated by driver. */ - grub_free (vbe_mode_list); + VasEBoot_free (vbe_mode_list); vbe_mode_list = NULL; - err = grub_video_fb_fini (); + err = VasEBoot_video_fb_fini (); if (framebuffer.mtrr >= 0) { - grub_vbe_disable_mtrr (framebuffer.mtrr); + VasEBoot_vbe_disable_mtrr (framebuffer.mtrr); framebuffer.mtrr = -1; } return err; @@ -839,26 +839,26 @@ grub_video_vbe_fini (void) `doublebuf_state.render_page' and `doublebuf_state.displayed_page', respectively. */ -static grub_err_t +static VasEBoot_err_t doublebuf_pageflipping_set_page (int page) { /* Tell the video adapter to display the new front page. */ int display_start_line = framebuffer.mode_info.height * page; - grub_vbe_status_t vbe_err = - grub_vbe_bios_set_display_start (0, display_start_line); + VasEBoot_vbe_status_t vbe_err = + VasEBoot_vbe_bios_set_display_start (0, display_start_line); - if (vbe_err != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "couldn't commit pageflip"); + if (vbe_err != VasEBoot_VBE_STATUS_OK) + return VasEBoot_error (VasEBoot_ERR_IO, "couldn't commit pageflip"); return 0; } static void -vbe2videoinfo (grub_uint32_t mode, - const struct grub_vbe_mode_info_block *vbeinfo, - struct grub_video_mode_info *mode_info) +vbe2videoinfo (VasEBoot_uint32_t mode, + const struct VasEBoot_vbe_mode_info_block *vbeinfo, + struct VasEBoot_video_mode_info *mode_info) { mode_info->mode_number = mode; @@ -867,41 +867,41 @@ vbe2videoinfo (grub_uint32_t mode, mode_info->mode_type = 0; switch (vbeinfo->memory_model) { - case GRUB_VBE_MEMORY_MODEL_TEXT: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_PURE_TEXT; + case VasEBoot_VBE_MEMORY_MODEL_TEXT: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT; break; /* CGA is basically 4-bit packed pixel. */ - case GRUB_VBE_MEMORY_MODEL_CGA: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_CGA; + case VasEBoot_VBE_MEMORY_MODEL_CGA: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_CGA; /* Fallthrough. */ - case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + case VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; break; - case GRUB_VBE_MEMORY_MODEL_HERCULES: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_HERCULES - | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP; + case VasEBoot_VBE_MEMORY_MODEL_HERCULES: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_HERCULES + | VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP; break; /* Non chain 4 is a special case of planar. */ - case GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_NONCHAIN4; + case VasEBoot_VBE_MEMORY_MODEL_NONCHAIN4_256: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_NONCHAIN4; /* Fallthrough. */ - case GRUB_VBE_MEMORY_MODEL_PLANAR: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_PLANAR - | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + case VasEBoot_VBE_MEMORY_MODEL_PLANAR: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_PLANAR + | VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; break; - case GRUB_VBE_MEMORY_MODEL_YUV: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_YUV; + case VasEBoot_VBE_MEMORY_MODEL_YUV: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_YUV; break; - case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_RGB; + case VasEBoot_VBE_MEMORY_MODEL_DIRECT_COLOR: + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_RGB; break; default: - mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_UNKNOWN; + mode_info->mode_type |= VasEBoot_VIDEO_MODE_TYPE_UNKNOWN; break; } @@ -934,7 +934,7 @@ vbe2videoinfo (grub_uint32_t mode, else mode_info->pitch = vbeinfo->bytes_per_scan_line; - if (mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (mode_info->mode_type & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) mode_info->number_of_colors = 16; else mode_info->number_of_colors = 256; @@ -947,23 +947,23 @@ vbe2videoinfo (grub_uint32_t mode, mode_info->reserved_mask_size = vbeinfo->rsvd_mask_size; mode_info->reserved_field_pos = vbeinfo->rsvd_field_position; - mode_info->blit_format = grub_video_get_blit_format (mode_info); + mode_info->blit_format = VasEBoot_video_get_blit_format (mode_info); } static int -grub_video_vbe_iterate (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg) +VasEBoot_video_vbe_iterate (int (*hook) (const struct VasEBoot_video_mode_info *info, void *hook_arg), void *hook_arg) { - grub_uint16_t *p; - struct grub_vbe_mode_info_block vbe_mode_info; - struct grub_video_mode_info mode_info; + VasEBoot_uint16_t *p; + struct VasEBoot_vbe_mode_info_block vbe_mode_info; + struct VasEBoot_video_mode_info mode_info; for (p = vbe_mode_list; *p != 0xFFFF; p++) { - grub_vbe_get_video_mode_info (*p, &vbe_mode_info); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_vbe_get_video_mode_info (*p, &vbe_mode_info); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { /* Could not retrieve mode info, retreat. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; break; } @@ -974,33 +974,33 @@ grub_video_vbe_iterate (int (*hook) (const struct grub_video_mode_info *info, vo return 0; } -static grub_err_t -grub_video_vbe_setup (unsigned int width, unsigned int height, - grub_video_mode_type_t mode_type, - grub_video_mode_type_t mode_mask) +static VasEBoot_err_t +VasEBoot_video_vbe_setup (unsigned int width, unsigned int height, + VasEBoot_video_mode_type_t mode_type, + VasEBoot_video_mode_type_t mode_mask) { - grub_uint16_t *p; - struct grub_vbe_mode_info_block vbe_mode_info; - struct grub_vbe_mode_info_block best_vbe_mode_info; - grub_uint32_t best_vbe_mode = 0; + VasEBoot_uint16_t *p; + struct VasEBoot_vbe_mode_info_block vbe_mode_info; + struct VasEBoot_vbe_mode_info_block best_vbe_mode_info; + VasEBoot_uint32_t best_vbe_mode = 0; int depth; int preferred_mode = 0; /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if (width == 0 && height == 0) { - grub_vbe_get_preferred_mode (&width, &height); - if (grub_errno == GRUB_ERR_NONE) + VasEBoot_vbe_get_preferred_mode (&width, &height); + if (VasEBoot_errno == VasEBoot_ERR_NONE) preferred_mode = 1; else { /* Fall back to 640x480. This is conservative, but the largest mode supported by the graphics card may not be safe for the display device. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; width = 640; height = 480; } @@ -1009,34 +1009,34 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, /* Walk thru mode list and try to find matching mode. */ for (p = vbe_mode_list; *p != 0xFFFF; p++) { - grub_uint32_t vbe_mode = *p; + VasEBoot_uint32_t vbe_mode = *p; - grub_vbe_get_video_mode_info (vbe_mode, &vbe_mode_info); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_vbe_get_video_mode_info (vbe_mode, &vbe_mode_info); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { /* Could not retrieve mode info, retreat. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; break; } - if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_SUPPORTED) == 0) + if ((vbe_mode_info.mode_attributes & VasEBoot_VBE_MODEATTR_SUPPORTED) == 0) /* If not available, skip it. */ continue; - if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_COLOR) == 0) + if ((vbe_mode_info.mode_attributes & VasEBoot_VBE_MODEATTR_COLOR) == 0) /* Monochrome is unusable. */ continue; - if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_LFB_AVAIL) == 0) + if ((vbe_mode_info.mode_attributes & VasEBoot_VBE_MODEATTR_LFB_AVAIL) == 0) /* We support only linear frame buffer modes. */ continue; - if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_GRAPHICS) == 0) + if ((vbe_mode_info.mode_attributes & VasEBoot_VBE_MODEATTR_GRAPHICS) == 0) /* We allow only graphical modes. */ continue; - if ((vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL) - && (vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)) + if ((vbe_mode_info.memory_model != VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL) + && (vbe_mode_info.memory_model != VasEBoot_VBE_MEMORY_MODEL_DIRECT_COLOR)) /* Not compatible memory model. */ continue; @@ -1065,21 +1065,21 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, } /* Check if user requested RGB or index color mode. */ - if ((mode_mask & GRUB_VIDEO_MODE_TYPE_COLOR_MASK) != 0) + if ((mode_mask & VasEBoot_VIDEO_MODE_TYPE_COLOR_MASK) != 0) { unsigned my_mode_type = 0; - if (vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL) - my_mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + if (vbe_mode_info.memory_model == VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL) + my_mode_type |= VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; - if (vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR) - my_mode_type |= GRUB_VIDEO_MODE_TYPE_RGB; + if (vbe_mode_info.memory_model == VasEBoot_VBE_MEMORY_MODEL_DIRECT_COLOR) + my_mode_type |= VasEBoot_VIDEO_MODE_TYPE_RGB; if ((my_mode_type & mode_mask - & (GRUB_VIDEO_MODE_TYPE_RGB | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)) + & (VasEBoot_VIDEO_MODE_TYPE_RGB | VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR)) != (mode_type & mode_mask - & (GRUB_VIDEO_MODE_TYPE_RGB - | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR))) + & (VasEBoot_VIDEO_MODE_TYPE_RGB + | VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR))) continue; } @@ -1089,27 +1089,27 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, /* Select mode with most of "volume" (size of framebuffer in bits). */ if (best_vbe_mode != 0) - if ((grub_uint64_t) vbe_mode_info.bits_per_pixel + if ((VasEBoot_uint64_t) vbe_mode_info.bits_per_pixel * vbe_mode_info.x_resolution * vbe_mode_info.y_resolution - < (grub_uint64_t) best_vbe_mode_info.bits_per_pixel + < (VasEBoot_uint64_t) best_vbe_mode_info.bits_per_pixel * best_vbe_mode_info.x_resolution * best_vbe_mode_info.y_resolution) continue; /* Save so far best mode information for later use. */ best_vbe_mode = vbe_mode; - grub_memcpy (&best_vbe_mode_info, &vbe_mode_info, sizeof (vbe_mode_info)); + VasEBoot_memcpy (&best_vbe_mode_info, &vbe_mode_info, sizeof (vbe_mode_info)); } /* Try to initialize best mode found. */ if (best_vbe_mode != 0) { - grub_err_t err; - static struct grub_vbe_mode_info_block active_vbe_mode_info; + VasEBoot_err_t err; + static struct VasEBoot_vbe_mode_info_block active_vbe_mode_info; /* If this fails, then we have mode selection heuristics problem, or adapter failure. */ - grub_vbe_set_video_mode (best_vbe_mode, &active_vbe_mode_info); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_vbe_set_video_mode (best_vbe_mode, &active_vbe_mode_info); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; /* Fill mode info details. */ vbe2videoinfo (best_vbe_mode, &active_vbe_mode_info, @@ -1117,46 +1117,46 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, { /* Get video RAM size in bytes. */ - grub_size_t vram_size = controller_info.total_memory << 16; - grub_size_t page_size; /* The size of a page in bytes. */ + VasEBoot_size_t vram_size = controller_info.total_memory << 16; + VasEBoot_size_t page_size; /* The size of a page in bytes. */ page_size = framebuffer.mode_info.pitch * framebuffer.mode_info.height; if (vram_size >= 2 * page_size) - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, doublebuf_pageflipping_set_page, framebuffer.ptr + page_size); else - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, 0, 0); } /* Copy default palette to initialize emulated palette. */ - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); - grub_vbe_enable_mtrr (framebuffer.ptr, + VasEBoot_vbe_enable_mtrr (framebuffer.ptr, controller_info.total_memory << 16); return err; } /* Couldn't found matching mode. */ - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no matching mode found"); } -static grub_err_t -grub_video_vbe_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +static VasEBoot_err_t +VasEBoot_video_vbe_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { - if (framebuffer.mode_info.mode_type == GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) + if (framebuffer.mode_info.mode_type == VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR) { /* TODO: Implement setting indexed color mode palette to hardware. */ - //status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) - // / sizeof (struct grub_vbe_palette_data), + //status = VasEBoot_vbe_bios_set_palette_data (sizeof (vga_colors) + // / sizeof (struct VasEBoot_vbe_palette_data), // 0, // palette); @@ -1164,87 +1164,87 @@ grub_video_vbe_set_palette (unsigned int start, unsigned int count, /* Then set color to emulated palette. */ - return grub_video_fb_set_palette (start, count, palette_data); + return VasEBoot_video_fb_set_palette (start, count, palette_data); } -static grub_err_t -grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_vbe_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_err_t err; - grub_free (vbe_mode_list); + VasEBoot_err_t err; + VasEBoot_free (vbe_mode_list); vbe_mode_list = NULL; - err = grub_video_fb_get_info_and_fini (mode_info, framebuf); + err = VasEBoot_video_fb_get_info_and_fini (mode_info, framebuf); if (err) return err; if (framebuffer.mtrr >= 0) { - grub_vbe_disable_mtrr (framebuffer.mtrr); + VasEBoot_vbe_disable_mtrr (framebuffer.mtrr); framebuffer.mtrr = -1; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static void -grub_video_vbe_print_adapter_specific_info (void) +VasEBoot_video_vbe_print_adapter_specific_info (void) { - grub_printf_ (N_(" VBE info: version: %d.%d OEM software rev: %d.%d\n"), + VasEBoot_printf_ (N_(" VBE info: version: %d.%d OEM software rev: %d.%d\n"), controller_info.version >> 8, controller_info.version & 0xFF, controller_info.oem_software_rev >> 8, controller_info.oem_software_rev & 0xFF); /* The total_memory field is in 64 KiB units. */ - grub_printf_ (N_(" total memory: %d KiB\n"), + VasEBoot_printf_ (N_(" total memory: %d KiB\n"), (controller_info.total_memory << 6)); } -static struct grub_video_adapter grub_video_vbe_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_vbe_adapter = { .name = "VESA BIOS Extension Video Driver", - .id = GRUB_VIDEO_DRIVER_VBE, + .id = VasEBoot_VIDEO_DRIVER_VBE, - .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE, - .init = grub_video_vbe_init, - .fini = grub_video_vbe_fini, - .setup = grub_video_vbe_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_vbe_get_info_and_fini, - .set_palette = grub_video_vbe_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_fb_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, - .iterate = grub_video_vbe_iterate, - .get_edid = grub_video_vbe_get_edid, - .print_adapter_specific_info = grub_video_vbe_print_adapter_specific_info, + .init = VasEBoot_video_vbe_init, + .fini = VasEBoot_video_vbe_fini, + .setup = VasEBoot_video_vbe_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_vbe_get_info_and_fini, + .set_palette = VasEBoot_video_vbe_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_fb_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, + .iterate = VasEBoot_video_vbe_iterate, + .get_edid = VasEBoot_video_vbe_get_edid, + .print_adapter_specific_info = VasEBoot_video_vbe_print_adapter_specific_info, .next = 0 }; -GRUB_MOD_INIT(video_i386_pc_vbe) +VasEBoot_MOD_INIT(video_i386_pc_vbe) { - grub_video_register (&grub_video_vbe_adapter); + VasEBoot_video_register (&VasEBoot_video_vbe_adapter); } -GRUB_MOD_FINI(video_i386_pc_vbe) +VasEBoot_MOD_FINI(video_i386_pc_vbe) { - grub_video_unregister (&grub_video_vbe_adapter); + VasEBoot_video_unregister (&VasEBoot_video_vbe_adapter); } diff --git a/VasEBoot-core/video/i386/pc/vga.c b/VasEBoot-core/video/i386/pc/vga.c index 01f47112d..d4a5b48d0 100644 --- a/VasEBoot-core/video/i386/pc/vga.c +++ b/VasEBoot-core/video/i386/pc/vga.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define VGA_WIDTH 640 -#define VGA_MEM ((grub_uint8_t *) 0xa0000) +#define VGA_MEM ((VasEBoot_uint8_t *) 0xa0000) #define PAGE_OFFSET(x) ((x) * (VGA_WIDTH * vga_height / 8)) static unsigned char text_mode; @@ -41,28 +41,28 @@ static int vga_height; static struct { - struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; - grub_uint8_t *temporary_buffer; + struct VasEBoot_video_mode_info mode_info; + struct VasEBoot_video_render_target *render_target; + VasEBoot_uint8_t *temporary_buffer; int front_page; int back_page; } framebuffer; static unsigned char -grub_vga_set_mode (unsigned char mode) +VasEBoot_vga_set_mode (unsigned char mode) { - struct grub_bios_int_registers regs; + struct VasEBoot_bios_int_registers regs; unsigned char ret; /* get current mode */ regs.eax = 0x0f00; regs.ebx = 0; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); ret = regs.eax & 0xff; regs.eax = mode; - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x10, ®s); + regs.flags = VasEBoot_CPU_INT_FLAGS_DEFAULT; + VasEBoot_bios_interrupt (0x10, ®s); return ret; } @@ -71,22 +71,22 @@ static inline void wait_vretrace (void) { /* Wait until there is a vertical retrace. */ - while (! (grub_inb (GRUB_VGA_IO_INPUT_STATUS1_REGISTER) - & GRUB_VGA_IO_INPUT_STATUS1_VERTR_BIT)); + while (! (VasEBoot_inb (VasEBoot_VGA_IO_INPUT_STATUS1_REGISTER) + & VasEBoot_VGA_IO_INPUT_STATUS1_VERTR_BIT)); } /* Get Map Mask Register. */ static unsigned char get_map_mask (void) { - return grub_vga_sr_read (GRUB_VGA_SR_MAP_MASK_REGISTER); + return VasEBoot_vga_sr_read (VasEBoot_VGA_SR_MAP_MASK_REGISTER); } /* Set Map Mask Register. */ static void set_map_mask (unsigned char mask) { - grub_vga_sr_write (mask, GRUB_VGA_SR_MAP_MASK_REGISTER); + VasEBoot_vga_sr_write (mask, VasEBoot_VGA_SR_MAP_MASK_REGISTER); } #if 0 @@ -94,7 +94,7 @@ set_map_mask (unsigned char mask) static void set_read_map (unsigned char map) { - grub_vga_gr_write (map, GRUB_VGA_GR_READ_MAP_REGISTER); + VasEBoot_vga_gr_write (map, VasEBoot_VGA_GR_READ_MAP_REGISTER); } #endif @@ -102,40 +102,40 @@ set_read_map (unsigned char map) static void set_start_address (unsigned int start) { - grub_vga_cr_write (start & 0xFF, GRUB_VGA_CR_START_ADDR_LOW_REGISTER); - grub_vga_cr_write (start >> 8, GRUB_VGA_CR_START_ADDR_HIGH_REGISTER); + VasEBoot_vga_cr_write (start & 0xFF, VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER); + VasEBoot_vga_cr_write (start >> 8, VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER); } static int setup = 0; static int is_target = 0; -static grub_err_t -grub_video_vga_init (void) +static VasEBoot_err_t +VasEBoot_video_vga_init (void) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_vga_setup (unsigned int width, unsigned int height, - grub_video_mode_type_t mode_type, - grub_video_mode_type_t mode_mask) +static VasEBoot_err_t +VasEBoot_video_vga_setup (unsigned int width, unsigned int height, + VasEBoot_video_mode_type_t mode_type, + VasEBoot_video_mode_type_t mode_mask) { - grub_err_t err; + VasEBoot_err_t err; if ((width && width != VGA_WIDTH) || (height && height != 350 && height != 480)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found"); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "no matching mode found"); vga_height = height ? : 480; - framebuffer.temporary_buffer = grub_malloc (vga_height * VGA_WIDTH); + framebuffer.temporary_buffer = VasEBoot_malloc (vga_height * VGA_WIDTH); framebuffer.front_page = 0; framebuffer.back_page = 0; if (!framebuffer.temporary_buffer) - return grub_errno; + return VasEBoot_errno; saved_map_mask = get_map_mask (); - text_mode = grub_vga_set_mode (vga_height == 480 ? 0x12 : 0x10); + text_mode = VasEBoot_vga_set_mode (vga_height == 480 ? 0x12 : 0x10); setup = 1; set_map_mask (0x0f); set_start_address (PAGE_OFFSET (framebuffer.front_page)); @@ -143,15 +143,15 @@ grub_video_vga_setup (unsigned int width, unsigned int height, framebuffer.mode_info.width = VGA_WIDTH; framebuffer.mode_info.height = vga_height; - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; - if (grub_video_check_mode_flag (mode_type, mode_mask, - GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED, + if (VasEBoot_video_check_mode_flag (mode_type, mode_mask, + VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED, (VGA_WIDTH * vga_height <= (1 << 18)))) { framebuffer.back_page = 1; - framebuffer.mode_info.mode_type |= GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP; + framebuffer.mode_info.mode_type |= VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP; } framebuffer.mode_info.bpp = 8; @@ -168,42 +168,42 @@ grub_video_vga_setup (unsigned int width, unsigned int height, framebuffer.mode_info.reserved_field_pos = 0; framebuffer.mode_info.blit_format - = grub_video_get_blit_format (&framebuffer.mode_info); + = VasEBoot_video_get_blit_format (&framebuffer.mode_info); - err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target, + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer.render_target, &framebuffer.mode_info, framebuffer.temporary_buffer); if (err) { - grub_dprintf ("video", "Couldn't create FB target\n"); + VasEBoot_dprintf ("video", "Couldn't create FB target\n"); return err; } is_target = 1; - err = grub_video_fb_set_active_render_target (framebuffer.render_target); + err = VasEBoot_video_fb_set_active_render_target (framebuffer.render_target); if (err) return err; - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_vga_fini (void) +static VasEBoot_err_t +VasEBoot_video_vga_fini (void) { if (setup) { set_map_mask (saved_map_mask); - grub_vga_set_mode (text_mode); + VasEBoot_vga_set_mode (text_mode); } setup = 0; - grub_free (framebuffer.temporary_buffer); + VasEBoot_free (framebuffer.temporary_buffer); framebuffer.temporary_buffer = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static inline void @@ -216,8 +216,8 @@ update_target (void) for (plane = 0x01; plane <= 0x08; plane <<= 1) { - grub_uint8_t *ptr; - volatile grub_uint8_t *ptr2; + VasEBoot_uint8_t *ptr; + volatile VasEBoot_uint8_t *ptr2; unsigned cbyte = 0; int shift = 7; set_map_mask (plane); @@ -237,40 +237,40 @@ update_target (void) } } -static grub_err_t -grub_video_vga_blit_bitmap (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, int x, int y, +static VasEBoot_err_t +VasEBoot_video_vga_blit_bitmap (struct VasEBoot_video_bitmap *bitmap, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - grub_err_t ret; - ret = grub_video_fb_blit_bitmap (bitmap, oper, x, y, offset_x, offset_y, + VasEBoot_err_t ret; + ret = VasEBoot_video_fb_blit_bitmap (bitmap, oper, x, y, offset_x, offset_y, width, height); - if (!(framebuffer.mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) + if (!(framebuffer.mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) update_target (); return ret; } -static grub_err_t -grub_video_vga_blit_render_target (struct grub_video_fbrender_target *source, - enum grub_video_blit_operators oper, +static VasEBoot_err_t +VasEBoot_video_vga_blit_render_target (struct VasEBoot_video_fbrender_target *source, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - grub_err_t ret; + VasEBoot_err_t ret; - ret = grub_video_fb_blit_render_target (source, oper, x, y, + ret = VasEBoot_video_fb_blit_render_target (source, oper, x, y, offset_x, offset_y, width, height); - if (!(framebuffer.mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) + if (!(framebuffer.mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) update_target (); return ret; } -static grub_err_t -grub_video_vga_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_vga_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) { is_target = 1; target = framebuffer.render_target; @@ -278,28 +278,28 @@ grub_video_vga_set_active_render_target (struct grub_video_render_target *target else is_target = 0; - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static grub_err_t -grub_video_vga_get_active_render_target (struct grub_video_render_target **target) +static VasEBoot_err_t +VasEBoot_video_vga_get_active_render_target (struct VasEBoot_video_render_target **target) { - grub_err_t err; - err = grub_video_fb_get_active_render_target (target); + VasEBoot_err_t err; + err = VasEBoot_video_fb_get_active_render_target (target); if (err) return err; if (*target == framebuffer.render_target) - *target = GRUB_VIDEO_RENDER_TARGET_DISPLAY; + *target = VasEBoot_VIDEO_RENDER_TARGET_DISPLAY; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_vga_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_vga_swap_buffers (void) { - if (!(framebuffer.mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) - return GRUB_ERR_NONE; + if (!(framebuffer.mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED)) + return VasEBoot_ERR_NONE; update_target (); @@ -312,24 +312,24 @@ grub_video_vga_swap_buffers (void) set_start_address (PAGE_OFFSET (framebuffer.front_page)); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_vga_set_palette (unsigned int start __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_video_vga_set_palette (unsigned int start __attribute__ ((unused)), unsigned int count __attribute__ ((unused)), - struct grub_video_palette_data *palette_data __attribute__ ((unused))) + struct VasEBoot_video_palette_data *palette_data __attribute__ ((unused))) { - return grub_error (GRUB_ERR_IO, "can't change palette"); + return VasEBoot_error (VasEBoot_ERR_IO, "can't change palette"); } -static grub_err_t -grub_video_vga_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_vga_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { set_map_mask (0xf); - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); mode_info->bpp = 1; mode_info->bytes_per_pixel = 0; mode_info->pitch = VGA_WIDTH / 8; @@ -347,58 +347,58 @@ grub_video_vga_get_info_and_fini (struct grub_video_mode_info *mode_info, *framebuf = VGA_MEM + PAGE_OFFSET (framebuffer.front_page); - grub_video_fb_fini (); - grub_free (framebuffer.temporary_buffer); + VasEBoot_video_fb_fini (); + VasEBoot_free (framebuffer.temporary_buffer); framebuffer.temporary_buffer = 0; setup = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_vga_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_vga_adapter = { .name = "VGA Video Driver", - .id = GRUB_VIDEO_DRIVER_VGA, + .id = VasEBoot_VIDEO_DRIVER_VGA, - .prio = GRUB_VIDEO_ADAPTER_PRIO_FALLBACK, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FALLBACK, - .init = grub_video_vga_init, - .fini = grub_video_vga_fini, - .setup = grub_video_vga_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_vga_get_info_and_fini, - .set_palette = grub_video_vga_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_vga_blit_bitmap, - .blit_render_target = grub_video_vga_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_vga_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_vga_set_active_render_target, - .get_active_render_target = grub_video_vga_get_active_render_target, + .init = VasEBoot_video_vga_init, + .fini = VasEBoot_video_vga_fini, + .setup = VasEBoot_video_vga_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_vga_get_info_and_fini, + .set_palette = VasEBoot_video_vga_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_vga_blit_bitmap, + .blit_render_target = VasEBoot_video_vga_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_vga_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_vga_set_active_render_target, + .get_active_render_target = VasEBoot_video_vga_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(vga) +VasEBoot_MOD_INIT(vga) { - grub_video_register (&grub_video_vga_adapter); + VasEBoot_video_register (&VasEBoot_video_vga_adapter); } -GRUB_MOD_FINI(vga) +VasEBoot_MOD_FINI(vga) { - grub_video_unregister (&grub_video_vga_adapter); + VasEBoot_video_unregister (&VasEBoot_video_vga_adapter); } diff --git a/VasEBoot-core/video/ieee1275.c b/VasEBoot-core/video/ieee1275.c index 17a3dbbb5..5580e9f96 100644 --- a/VasEBoot-core/video/ieee1275.c +++ b/VasEBoot-core/video/ieee1275.c @@ -1,49 +1,49 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Only 8-bit indexed color is supported for now. */ static unsigned old_width, old_height; static int restore_needed; static char *display; -static grub_ieee1275_ihandle_t stdout_ihandle; +static VasEBoot_ieee1275_ihandle_t stdout_ihandle; static int have_setcolors = 0; static struct { - struct grub_video_mode_info mode_info; - grub_uint8_t *ptr; + struct VasEBoot_video_mode_info mode_info; + VasEBoot_uint8_t *ptr; } framebuffer; -static struct grub_video_palette_data serial_colors[] = +static struct VasEBoot_video_palette_data serial_colors[] = { // {R, G, B} {0x00, 0x00, 0x00, 0xFF}, // 0 = black @@ -57,9 +57,9 @@ static struct grub_video_palette_data serial_colors[] = }; -static grub_err_t -grub_video_ieee1275_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); +static VasEBoot_err_t +VasEBoot_video_ieee1275_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); static void set_video_mode (unsigned width __attribute__ ((unused)), @@ -69,12 +69,12 @@ set_video_mode (unsigned width __attribute__ ((unused)), } static int -find_display_hook (struct grub_ieee1275_devalias *alias) +find_display_hook (struct VasEBoot_ieee1275_devalias *alias) { - if (grub_strcmp (alias->type, "display") == 0) + if (VasEBoot_strcmp (alias->type, "display") == 0) { - grub_dprintf ("video", "Found display %s\n", alias->path); - display = grub_strdup (alias->path); + VasEBoot_dprintf ("video", "Found display %s\n", alias->path); + display = VasEBoot_strdup (alias->path); return 1; } return 0; @@ -83,74 +83,74 @@ find_display_hook (struct grub_ieee1275_devalias *alias) static void find_display (void) { - grub_ieee1275_devices_iterate (find_display_hook); + VasEBoot_ieee1275_devices_iterate (find_display_hook); } -static grub_err_t -grub_video_ieee1275_init (void) +static VasEBoot_err_t +VasEBoot_video_ieee1275_init (void) { - grub_ssize_t actual; + VasEBoot_ssize_t actual; - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS) - && !grub_ieee1275_get_integer_property (grub_ieee1275_chosen, + if (! VasEBoot_ieee1275_test_flag (VasEBoot_IEEE1275_FLAG_CANNOT_SET_COLORS) + && !VasEBoot_ieee1275_get_integer_property (VasEBoot_ieee1275_chosen, "stdout", &stdout_ihandle, sizeof (stdout_ihandle), &actual) && actual == sizeof (stdout_ihandle)) have_setcolors = 1; - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_ieee1275_fini (void) +static VasEBoot_err_t +VasEBoot_video_ieee1275_fini (void) { if (restore_needed) { set_video_mode (old_width, old_height); restore_needed = 0; } - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } -static grub_err_t -grub_video_ieee1275_fill_mode_info (grub_ieee1275_phandle_t dev, - struct grub_video_mode_info *out) +static VasEBoot_err_t +VasEBoot_video_ieee1275_fill_mode_info (VasEBoot_ieee1275_phandle_t dev, + struct VasEBoot_video_mode_info *out) { - grub_uint32_t tmp; + VasEBoot_uint32_t tmp; - grub_memset (out, 0, sizeof (*out)); + VasEBoot_memset (out, 0, sizeof (*out)); - if (grub_ieee1275_get_integer_property (dev, "width", &tmp, + if (VasEBoot_ieee1275_get_integer_property (dev, "width", &tmp, sizeof (tmp), 0)) - return grub_error (GRUB_ERR_IO, "Couldn't retrieve display width."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve display width."); out->width = tmp; - if (grub_ieee1275_get_integer_property (dev, "height", &tmp, + if (VasEBoot_ieee1275_get_integer_property (dev, "height", &tmp, sizeof (tmp), 0)) - return grub_error (GRUB_ERR_IO, "Couldn't retrieve display height."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve display height."); out->height = tmp; - if (grub_ieee1275_get_integer_property (dev, "linebytes", &tmp, + if (VasEBoot_ieee1275_get_integer_property (dev, "linebytes", &tmp, sizeof (tmp), 0)) - return grub_error (GRUB_ERR_IO, "Couldn't retrieve display pitch."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve display pitch."); out->pitch = tmp; - if (grub_ieee1275_get_integer_property (dev, "depth", &tmp, + if (VasEBoot_ieee1275_get_integer_property (dev, "depth", &tmp, sizeof (tmp), 0)) tmp = 4; - out->mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + out->mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; out->bpp = tmp; - out->bytes_per_pixel = (out->bpp + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT; + out->bytes_per_pixel = (out->bpp + VasEBoot_CHAR_BIT - 1) / VasEBoot_CHAR_BIT; out->number_of_colors = 256; switch (tmp) { case 4: case 8: - out->mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + out->mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; out->bpp = 8; if (have_setcolors) out->number_of_colors = 1 << tmp; @@ -192,172 +192,172 @@ grub_video_ieee1275_fill_mode_info (grub_ieee1275_phandle_t dev, out->blue_field_pos = 0; break; default: - return grub_error (GRUB_ERR_IO, "unsupported video depth %d", tmp); + return VasEBoot_error (VasEBoot_ERR_IO, "unsupported video depth %d", tmp); } - out->blit_format = grub_video_get_blit_format (out); - return GRUB_ERR_NONE; + out->blit_format = VasEBoot_video_get_blit_format (out); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_ieee1275_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_ieee1275_setup (unsigned int width, unsigned int height, unsigned int mode_type __attribute__ ((unused)), unsigned int mode_mask __attribute__ ((unused))) { - grub_uint32_t current_width, current_height, address; - grub_err_t err; - grub_ieee1275_phandle_t dev; + VasEBoot_uint32_t current_width, current_height, address; + VasEBoot_err_t err; + VasEBoot_ieee1275_phandle_t dev; if (!display) - return grub_error (GRUB_ERR_IO, "Couldn't find display device."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find display device."); - if (grub_ieee1275_finddevice (display, &dev)) - return grub_error (GRUB_ERR_IO, "Couldn't open display device."); + if (VasEBoot_ieee1275_finddevice (display, &dev)) + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't open display device."); - if (grub_ieee1275_get_integer_property (dev, "width", ¤t_width, + if (VasEBoot_ieee1275_get_integer_property (dev, "width", ¤t_width, sizeof (current_width), 0)) - return grub_error (GRUB_ERR_IO, "Couldn't retrieve display width."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve display width."); - if (grub_ieee1275_get_integer_property (dev, "height", ¤t_height, + if (VasEBoot_ieee1275_get_integer_property (dev, "height", ¤t_height, sizeof (current_width), 0)) - return grub_error (GRUB_ERR_IO, "Couldn't retrieve display height."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve display height."); if ((width == current_width && height == current_height) || (width == 0 && height == 0)) { - grub_dprintf ("video", "IEEE1275: keeping current mode %dx%d\n", + VasEBoot_dprintf ("video", "IEEE1275: keeping current mode %dx%d\n", current_width, current_height); } else { - grub_dprintf ("video", "IEEE1275: Setting mode %dx%d\n", width, height); + VasEBoot_dprintf ("video", "IEEE1275: Setting mode %dx%d\n", width, height); /* TODO. */ - return grub_error (GRUB_ERR_IO, "can't set mode %dx%d", width, height); + return VasEBoot_error (VasEBoot_ERR_IO, "can't set mode %dx%d", width, height); } - err = grub_video_ieee1275_fill_mode_info (dev, &framebuffer.mode_info); + err = VasEBoot_video_ieee1275_fill_mode_info (dev, &framebuffer.mode_info); if (err) { - grub_dprintf ("video", "IEEE1275: couldn't fill mode info\n"); + VasEBoot_dprintf ("video", "IEEE1275: couldn't fill mode info\n"); return err; } - if (grub_ieee1275_get_integer_property (dev, "address", (void *) &address, + if (VasEBoot_ieee1275_get_integer_property (dev, "address", (void *) &address, sizeof (address), 0)) - return grub_error (GRUB_ERR_IO, "Couldn't retrieve display address."); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't retrieve display address."); /* For some reason sparc64 uses 32-bit pointer too. */ - framebuffer.ptr = (void *) (grub_addr_t) address; + framebuffer.ptr = (void *) (VasEBoot_addr_t) address; - grub_dprintf ("video", "IEEE1275: initialising FB @ %p %dx%dx%d\n", + VasEBoot_dprintf ("video", "IEEE1275: initialising FB @ %p %dx%dx%d\n", framebuffer.ptr, framebuffer.mode_info.width, framebuffer.mode_info.height, framebuffer.mode_info.bpp); - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, NULL, NULL); if (err) return err; - grub_video_ieee1275_set_palette (0, framebuffer.mode_info.number_of_colors, - grub_video_fbstd_colors); + VasEBoot_video_ieee1275_set_palette (0, framebuffer.mode_info.number_of_colors, + VasEBoot_video_fbstd_colors); return err; } -static grub_err_t -grub_video_ieee1275_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_ieee1275_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_ieee1275_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +static VasEBoot_err_t +VasEBoot_video_ieee1275_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { unsigned col; - struct grub_video_palette_data fb_palette_data[256]; - grub_err_t err; + struct VasEBoot_video_palette_data fb_palette_data[256]; + VasEBoot_err_t err; - if (!(framebuffer.mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)) - return grub_video_fb_set_palette (start, count, palette_data); + if (!(framebuffer.mode_info.mode_type & VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR)) + return VasEBoot_video_fb_set_palette (start, count, palette_data); if (!have_setcolors) - return grub_video_fb_set_palette (0, ARRAY_SIZE (serial_colors), + return VasEBoot_video_fb_set_palette (0, ARRAY_SIZE (serial_colors), serial_colors); if (start >= framebuffer.mode_info.number_of_colors) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; if (start + count > framebuffer.mode_info.number_of_colors) count = framebuffer.mode_info.number_of_colors - start; - err = grub_video_fb_set_palette (start, count, palette_data); + err = VasEBoot_video_fb_set_palette (start, count, palette_data); if (err) return err; /* Set colors. */ - grub_video_fb_get_palette (0, ARRAY_SIZE (fb_palette_data), + VasEBoot_video_fb_get_palette (0, ARRAY_SIZE (fb_palette_data), fb_palette_data); for (col = 0; col < ARRAY_SIZE (fb_palette_data); col++) - grub_ieee1275_set_color (stdout_ihandle, col, fb_palette_data[col].r, + VasEBoot_ieee1275_set_color (stdout_ihandle, col, fb_palette_data[col].r, fb_palette_data[col].g, fb_palette_data[col].b); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_ieee1275_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_ieee1275_adapter = { .name = "IEEE1275 video driver", - .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE, - .id = GRUB_VIDEO_DRIVER_IEEE1275, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE, + .id = VasEBoot_VIDEO_DRIVER_IEEE1275, - .init = grub_video_ieee1275_init, - .fini = grub_video_ieee1275_fini, - .setup = grub_video_ieee1275_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_ieee1275_get_info_and_fini, - .set_palette = grub_video_ieee1275_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_fb_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_ieee1275_init, + .fini = VasEBoot_video_ieee1275_fini, + .setup = VasEBoot_video_ieee1275_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_ieee1275_get_info_and_fini, + .set_palette = VasEBoot_video_ieee1275_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_fb_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(ieee1275_fb) +VasEBoot_MOD_INIT(ieee1275_fb) { find_display (); if (display) - grub_video_register (&grub_video_ieee1275_adapter); + VasEBoot_video_register (&VasEBoot_video_ieee1275_adapter); } -GRUB_MOD_FINI(ieee1275_fb) +VasEBoot_MOD_FINI(ieee1275_fb) { if (restore_needed) { @@ -365,6 +365,6 @@ GRUB_MOD_FINI(ieee1275_fb) restore_needed = 0; } if (display) - grub_video_unregister (&grub_video_ieee1275_adapter); - grub_free (display); + VasEBoot_video_unregister (&VasEBoot_video_ieee1275_adapter); + VasEBoot_free (display); } diff --git a/VasEBoot-core/video/radeon_fuloong2e.c b/VasEBoot-core/video/radeon_fuloong2e.c index b4da34b5e..385a0f1bc 100644 --- a/VasEBoot-core/video/radeon_fuloong2e.c +++ b/VasEBoot-core/video/radeon_fuloong2e.c @@ -1,117 +1,117 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#define GRUB_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE 1048576 +#define VasEBoot_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE 1048576 static struct { - struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; + struct VasEBoot_video_mode_info mode_info; + struct VasEBoot_video_render_target *render_target; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int mapped; - grub_uint32_t base; - grub_pci_device_t dev; + VasEBoot_uint32_t base; + VasEBoot_pci_device_t dev; } framebuffer; -static grub_err_t -grub_video_radeon_fuloong2e_video_init (void) +static VasEBoot_err_t +VasEBoot_video_radeon_fuloong2e_video_init (void) { /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_radeon_fuloong2e_video_fini (void) +static VasEBoot_err_t +VasEBoot_video_radeon_fuloong2e_video_fini (void) { if (framebuffer.mapped) - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, - GRUB_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE); + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + VasEBoot_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE); - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } #ifndef TEST -/* Helper for grub_video_radeon_fuloong2e_setup. */ +/* Helper for VasEBoot_video_radeon_fuloong2e_setup. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { int *found = data; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); - if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA + if (((class >> 16) & 0xffff) != VasEBoot_PCI_CLASS_SUBCLASS_VGA || pciid != 0x515a1002) return 0; *found = 1; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - framebuffer.base = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + framebuffer.base = VasEBoot_pci_read (addr); framebuffer.dev = dev; return 1; } #endif -static grub_err_t -grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) { int depth; - grub_err_t err; + VasEBoot_err_t err; int found = 0; #ifndef TEST /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if ((width != 640 && width != 0) || (height != 480 && height != 0) || (depth != 16 && depth != 0)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "Only 640x480x16 is supported"); - grub_pci_iterate (find_card, &found); + VasEBoot_pci_iterate (find_card, &found); if (!found) - return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find graphics card"); #endif /* Fill mode info details. */ framebuffer.mode_info.width = 640; framebuffer.mode_info.height = 480; - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; framebuffer.mode_info.bpp = 16; framebuffer.mode_info.bytes_per_pixel = 2; framebuffer.mode_info.pitch = 640 * 2; @@ -126,24 +126,24 @@ grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, framebuffer.mode_info.reserved_field_pos = 0; #ifndef TEST framebuffer.mode_info.blit_format - = grub_video_get_blit_format (&framebuffer.mode_info); + = VasEBoot_video_get_blit_format (&framebuffer.mode_info); #endif /* We can safely discard volatile attribute. */ #ifndef TEST framebuffer.ptr - = (void *) grub_pci_device_map_range (framebuffer.dev, + = (void *) VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.base, - GRUB_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE); + VasEBoot_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE); #endif framebuffer.mapped = 1; /* Prevent garbage from appearing on the screen. */ - grub_memset (framebuffer.ptr, 0x55, + VasEBoot_memset (framebuffer.ptr, 0x55, framebuffer.mode_info.height * framebuffer.mode_info.pitch); #ifndef TEST - err = grub_video_fb_create_render_target_from_pointer (&framebuffer + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer .render_target, &framebuffer.mode_info, framebuffer.ptr); @@ -151,89 +151,89 @@ grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, if (err) return err; - err = grub_video_fb_set_active_render_target (framebuffer.render_target); + err = VasEBoot_video_fb_set_active_render_target (framebuffer.render_target); if (err) return err; /* Copy default palette to initialize emulated palette. */ - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); #endif return err; } -static grub_err_t -grub_video_radeon_fuloong2e_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_radeon_fuloong2e_swap_buffers (void) { /* TODO: Implement buffer swapping. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_radeon_fuloong2e_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_radeon_fuloong2e_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) target = framebuffer.render_target; - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static grub_err_t -grub_video_radeon_fuloong2e_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_radeon_fuloong2e_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_radeon_fuloong2e_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_radeon_fuloong2e_adapter = { .name = "RADEON RV100 QZ (Fuloong2E) Video Driver", - .id = GRUB_VIDEO_DRIVER_RADEON_FULOONG2E, + .id = VasEBoot_VIDEO_DRIVER_RADEON_FULOONG2E, - .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE, - .init = grub_video_radeon_fuloong2e_video_init, - .fini = grub_video_radeon_fuloong2e_video_fini, - .setup = grub_video_radeon_fuloong2e_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_radeon_fuloong2e_get_info_and_fini, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_radeon_fuloong2e_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_radeon_fuloong2e_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_radeon_fuloong2e_video_init, + .fini = VasEBoot_video_radeon_fuloong2e_video_fini, + .setup = VasEBoot_video_radeon_fuloong2e_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_radeon_fuloong2e_get_info_and_fini, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_radeon_fuloong2e_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_radeon_fuloong2e_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(video_radeon_fuloong2e) +VasEBoot_MOD_INIT(video_radeon_fuloong2e) { - grub_video_register (&grub_video_radeon_fuloong2e_adapter); + VasEBoot_video_register (&VasEBoot_video_radeon_fuloong2e_adapter); } -GRUB_MOD_FINI(video_radeon_fuloong2e) +VasEBoot_MOD_FINI(video_radeon_fuloong2e) { - grub_video_unregister (&grub_video_radeon_fuloong2e_adapter); + VasEBoot_video_unregister (&VasEBoot_video_radeon_fuloong2e_adapter); } diff --git a/VasEBoot-core/video/radeon_yeeloong3a.c b/VasEBoot-core/video/radeon_yeeloong3a.c index 52614feb6..ddf120617 100644 --- a/VasEBoot-core/video/radeon_yeeloong3a.c +++ b/VasEBoot-core/video/radeon_yeeloong3a.c @@ -1,116 +1,116 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010,2011,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#define GRUB_RADEON_YEELOONG3A_TOTAL_MEMORY_SPACE 1048576 +#define VasEBoot_RADEON_YEELOONG3A_TOTAL_MEMORY_SPACE 1048576 static struct { - struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; + struct VasEBoot_video_mode_info mode_info; + struct VasEBoot_video_render_target *render_target; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; int mapped; - grub_uint32_t base; - grub_pci_device_t dev; + VasEBoot_uint32_t base; + VasEBoot_pci_device_t dev; } framebuffer; -static grub_err_t -grub_video_radeon_yeeloong3a_video_init (void) +static VasEBoot_err_t +VasEBoot_video_radeon_yeeloong3a_video_init (void) { /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_radeon_yeeloong3a_video_fini (void) +static VasEBoot_err_t +VasEBoot_video_radeon_yeeloong3a_video_fini (void) { if (framebuffer.mapped) - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, - GRUB_RADEON_YEELOONG3A_TOTAL_MEMORY_SPACE); - return grub_video_fb_fini (); + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + VasEBoot_RADEON_YEELOONG3A_TOTAL_MEMORY_SPACE); + return VasEBoot_video_fb_fini (); } #ifndef TEST -/* Helper for grub_video_radeon_yeeloong3a_setup. */ +/* Helper for VasEBoot_video_radeon_yeeloong3a_setup. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { int *found = data; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); - if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA + if (((class >> 16) & 0xffff) != VasEBoot_PCI_CLASS_SUBCLASS_VGA || pciid != 0x96151002) return 0; *found = 1; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - framebuffer.base = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + framebuffer.base = VasEBoot_pci_read (addr); framebuffer.dev = dev; return 1; } #endif -static grub_err_t -grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) { int depth; - grub_err_t err; + VasEBoot_err_t err; int found = 0; #ifndef TEST /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if ((width != 800 && width != 0) || (height != 600 && height != 0) || (depth != 16 && depth != 0)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "Only 640x480x16 is supported"); - grub_pci_iterate (find_card, &found); + VasEBoot_pci_iterate (find_card, &found); if (!found) - return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find graphics card"); #endif /* Fill mode info details. */ framebuffer.mode_info.width = 800; framebuffer.mode_info.height = 600; - framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB; framebuffer.mode_info.bpp = 16; framebuffer.mode_info.bytes_per_pixel = 2; framebuffer.mode_info.pitch = 800 * 2; @@ -125,23 +125,23 @@ grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height, framebuffer.mode_info.reserved_field_pos = 0; #ifndef TEST framebuffer.mode_info.blit_format - = grub_video_get_blit_format (&framebuffer.mode_info); + = VasEBoot_video_get_blit_format (&framebuffer.mode_info); #endif /* We can safely discard volatile attribute. */ #ifndef TEST - framebuffer.ptr = (void *) grub_pci_device_map_range (framebuffer.dev, + framebuffer.ptr = (void *) VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.base, - GRUB_RADEON_YEELOONG3A_TOTAL_MEMORY_SPACE); + VasEBoot_RADEON_YEELOONG3A_TOTAL_MEMORY_SPACE); framebuffer.mapped = 1; #endif /* Prevent garbage from appearing on the screen. */ - grub_memset (framebuffer.ptr, 0, + VasEBoot_memset (framebuffer.ptr, 0, framebuffer.mode_info.height * framebuffer.mode_info.pitch); #ifndef TEST - err = grub_video_fb_create_render_target_from_pointer (&framebuffer + err = VasEBoot_video_fb_create_render_target_from_pointer (&framebuffer .render_target, &framebuffer.mode_info, framebuffer.ptr); @@ -149,89 +149,89 @@ grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height, if (err) return err; - err = grub_video_fb_set_active_render_target (framebuffer.render_target); + err = VasEBoot_video_fb_set_active_render_target (framebuffer.render_target); if (err) return err; /* Copy default palette to initialize emulated palette. */ - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); #endif return err; } -static grub_err_t -grub_video_radeon_yeeloong3a_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_radeon_yeeloong3a_swap_buffers (void) { /* TODO: Implement buffer swapping. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_radeon_yeeloong3a_set_active_render_target (struct grub_video_render_target *target) +static VasEBoot_err_t +VasEBoot_video_radeon_yeeloong3a_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + if (target == VasEBoot_VIDEO_RENDER_TARGET_DISPLAY) target = framebuffer.render_target; - return grub_video_fb_set_active_render_target (target); + return VasEBoot_video_fb_set_active_render_target (target); } -static grub_err_t -grub_video_radeon_yeeloong3a_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_radeon_yeeloong3a_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_radeon_yeeloong3a_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_radeon_yeeloong3a_adapter = { .name = "RADEON (Yeeloong3a) Video Driver", - .id = GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A, + .id = VasEBoot_VIDEO_DRIVER_RADEON_YEELOONG3A, - .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE, - .init = grub_video_radeon_yeeloong3a_video_init, - .fini = grub_video_radeon_yeeloong3a_video_fini, - .setup = grub_video_radeon_yeeloong3a_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_radeon_yeeloong3a_get_info_and_fini, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_radeon_yeeloong3a_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_radeon_yeeloong3a_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_radeon_yeeloong3a_video_init, + .fini = VasEBoot_video_radeon_yeeloong3a_video_fini, + .setup = VasEBoot_video_radeon_yeeloong3a_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_radeon_yeeloong3a_get_info_and_fini, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_radeon_yeeloong3a_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_radeon_yeeloong3a_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(video_radeon_yeeloong3a) +VasEBoot_MOD_INIT(video_radeon_yeeloong3a) { - grub_video_register (&grub_video_radeon_yeeloong3a_adapter); + VasEBoot_video_register (&VasEBoot_video_radeon_yeeloong3a_adapter); } -GRUB_MOD_FINI(video_radeon_yeeloong3a) +VasEBoot_MOD_FINI(video_radeon_yeeloong3a) { - grub_video_unregister (&grub_video_radeon_yeeloong3a_adapter); + VasEBoot_video_unregister (&VasEBoot_video_radeon_yeeloong3a_adapter); } diff --git a/VasEBoot-core/video/readers/jpeg.c b/VasEBoot-core/video/readers/jpeg.c index 21b0d9ded..e04863c92 100644 --- a/VasEBoot-core/video/readers/jpeg.c +++ b/VasEBoot-core/video/readers/jpeg.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Uncomment following define to enable JPEG debug. */ //#define JPEG_DEBUG @@ -57,7 +57,7 @@ enum #define JPEG_UNIT_SIZE 8 -static const grub_uint8_t jpeg_zigzag_order[64] = { +static const VasEBoot_uint8_t jpeg_zigzag_order[64] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, @@ -69,25 +69,25 @@ static const grub_uint8_t jpeg_zigzag_order[64] = { }; #ifdef JPEG_DEBUG -static grub_command_t cmd; +static VasEBoot_command_t cmd; #endif typedef int jpeg_data_unit_t[64]; -struct grub_jpeg_data +struct VasEBoot_jpeg_data { - grub_file_t file; - struct grub_video_bitmap **bitmap; - grub_uint8_t *bitmap_ptr; + VasEBoot_file_t file; + struct VasEBoot_video_bitmap **bitmap; + VasEBoot_uint8_t *bitmap_ptr; unsigned image_width; unsigned image_height; - grub_uint8_t *huff_value[4]; + VasEBoot_uint8_t *huff_value[4]; int huff_offset[4][16]; int huff_maxval[4][16]; - grub_uint8_t quan_table[2][64]; + VasEBoot_uint8_t quan_table[2][64]; int comp_index[3][3]; jpeg_data_unit_t ydu[4]; @@ -105,41 +105,41 @@ struct grub_jpeg_data int bit_mask, bit_save; }; -static grub_uint8_t -grub_jpeg_get_byte (struct grub_jpeg_data *data) +static VasEBoot_uint8_t +VasEBoot_jpeg_get_byte (struct VasEBoot_jpeg_data *data) { - grub_uint8_t r; + VasEBoot_uint8_t r; r = 0; - grub_file_read (data->file, &r, 1); + VasEBoot_file_read (data->file, &r, 1); return r; } -static grub_uint16_t -grub_jpeg_get_word (struct grub_jpeg_data *data) +static VasEBoot_uint16_t +VasEBoot_jpeg_get_word (struct VasEBoot_jpeg_data *data) { - grub_uint16_t r; + VasEBoot_uint16_t r; r = 0; - grub_file_read (data->file, &r, sizeof (grub_uint16_t)); + VasEBoot_file_read (data->file, &r, sizeof (VasEBoot_uint16_t)); - return grub_be_to_cpu16 (r); + return VasEBoot_be_to_cpu16 (r); } static int -grub_jpeg_get_bit (struct grub_jpeg_data *data) +VasEBoot_jpeg_get_bit (struct VasEBoot_jpeg_data *data) { int ret; if (data->bit_mask == 0) { - data->bit_save = grub_jpeg_get_byte (data); + data->bit_save = VasEBoot_jpeg_get_byte (data); if (data->bit_save == JPEG_ESC_CHAR) { - if (grub_jpeg_get_byte (data) != 0) + if (VasEBoot_jpeg_get_byte (data) != 0) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: invalid 0xFF in data stream"); return 0; } @@ -153,16 +153,16 @@ grub_jpeg_get_bit (struct grub_jpeg_data *data) } static int -grub_jpeg_get_number (struct grub_jpeg_data *data, int num) +VasEBoot_jpeg_get_number (struct VasEBoot_jpeg_data *data, int num) { int value, i, msb; if (num == 0) return 0; - msb = value = grub_jpeg_get_bit (data); + msb = value = VasEBoot_jpeg_get_bit (data); for (i = 1; i < num; i++) - value = (value << 1) + (grub_jpeg_get_bit (data) != 0); + value = (value << 1) + (VasEBoot_jpeg_get_bit (data) != 0); if (!msb) value += 1 - (1 << num); @@ -170,7 +170,7 @@ grub_jpeg_get_number (struct grub_jpeg_data *data, int num) } static int -grub_jpeg_get_huff_code (struct grub_jpeg_data *data, int id) +VasEBoot_jpeg_get_huff_code (struct VasEBoot_jpeg_data *data, int id) { int code; unsigned i; @@ -179,50 +179,50 @@ grub_jpeg_get_huff_code (struct grub_jpeg_data *data, int id) for (i = 0; i < ARRAY_SIZE (data->huff_maxval[id]); i++) { code <<= 1; - if (grub_jpeg_get_bit (data)) + if (VasEBoot_jpeg_get_bit (data)) code++; if (code < data->huff_maxval[id][i]) return data->huff_value[id][code + data->huff_offset[id][i]]; } - grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: huffman decode fails"); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: huffman decode fails"); return 0; } -static grub_err_t -grub_jpeg_decode_huff_table (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_huff_table (struct VasEBoot_jpeg_data *data) { int id, ac, n, base, ofs; - grub_uint32_t next_marker; - grub_uint8_t count[16]; + VasEBoot_uint32_t next_marker; + VasEBoot_uint8_t count[16]; unsigned i; next_marker = data->file->offset; - next_marker += grub_jpeg_get_word (data); + next_marker += VasEBoot_jpeg_get_word (data); while (data->file->offset + sizeof (count) + 1 <= next_marker) { - id = grub_jpeg_get_byte (data); + id = VasEBoot_jpeg_get_byte (data); ac = (id >> 4) & 1; id &= 0xF; if (id > 1) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: too many huffman tables"); - if (grub_file_read (data->file, &count, sizeof (count)) != + if (VasEBoot_file_read (data->file, &count, sizeof (count)) != sizeof (count)) - return grub_errno; + return VasEBoot_errno; n = 0; for (i = 0; i < ARRAY_SIZE (count); i++) n += count[i]; id += ac * 2; - data->huff_value[id] = grub_malloc (n); - if (grub_errno) - return grub_errno; + data->huff_value[id] = VasEBoot_malloc (n); + if (VasEBoot_errno) + return VasEBoot_errno; - if (grub_file_read (data->file, data->huff_value[id], n) != n) - return grub_errno; + if (VasEBoot_file_read (data->file, data->huff_value[id], n) != n) + return VasEBoot_errno; base = 0; ofs = 0; @@ -239,68 +239,68 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data) } if (data->file->offset != next_marker) - grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in huffman table"); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: extra byte in huffman table"); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_jpeg_decode_quan_table (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_quan_table (struct VasEBoot_jpeg_data *data) { int id; - grub_uint32_t next_marker; + VasEBoot_uint32_t next_marker; next_marker = data->file->offset; - next_marker += grub_jpeg_get_word (data); + next_marker += VasEBoot_jpeg_get_word (data); while (data->file->offset + sizeof (data->quan_table[id]) + 1 <= next_marker) { - id = grub_jpeg_get_byte (data); + id = VasEBoot_jpeg_get_byte (data); if (id >= 0x10) /* Upper 4-bit is precision. */ - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: only 8-bit precision is supported"); if (id > 1) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: too many quantization tables"); - if (grub_file_read (data->file, &data->quan_table[id], + if (VasEBoot_file_read (data->file, &data->quan_table[id], sizeof (data->quan_table[id])) != sizeof (data->quan_table[id])) - return grub_errno; + return VasEBoot_errno; } if (data->file->offset != next_marker) - grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: extra byte in quantization table"); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_jpeg_decode_sof (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_sof (struct VasEBoot_jpeg_data *data) { int i, cc; - grub_uint32_t next_marker; + VasEBoot_uint32_t next_marker; next_marker = data->file->offset; - next_marker += grub_jpeg_get_word (data); + next_marker += VasEBoot_jpeg_get_word (data); - if (grub_jpeg_get_byte (data) != 8) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + if (VasEBoot_jpeg_get_byte (data) != 8) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: only 8-bit precision is supported"); - data->image_height = grub_jpeg_get_word (data); - data->image_width = grub_jpeg_get_word (data); + data->image_height = VasEBoot_jpeg_get_word (data); + data->image_width = VasEBoot_jpeg_get_word (data); if ((!data->image_height) || (!data->image_width)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid image size"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: invalid image size"); - cc = grub_jpeg_get_byte (data); + cc = VasEBoot_jpeg_get_byte (data); if (cc != 1 && cc != 3) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: component count must be 1 or 3"); data->color_components = cc; @@ -308,48 +308,48 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data) { int id, ss; - id = grub_jpeg_get_byte (data) - 1; + id = VasEBoot_jpeg_get_byte (data) - 1; if ((id < 0) || (id >= 3)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: invalid index"); - ss = grub_jpeg_get_byte (data); /* Sampling factor. */ + ss = VasEBoot_jpeg_get_byte (data); /* Sampling factor. */ if (!id) { - grub_uint8_t vs, hs; + VasEBoot_uint8_t vs, hs; vs = ss & 0xF; /* Vertical sampling. */ hs = ss >> 4; /* Horizontal sampling. */ if ((vs > 2) || (hs > 2) || (vs == 0) || (hs == 0)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: sampling method not supported"); data->log_vs = (vs == 2); data->log_hs = (hs == 2); } else if (ss != JPEG_SAMPLING_1x1) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: sampling method not supported"); - data->comp_index[id][0] = grub_jpeg_get_byte (data); + data->comp_index[id][0] = VasEBoot_jpeg_get_byte (data); } if (data->file->offset != next_marker) - grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sof"); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sof"); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_jpeg_decode_dri (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_dri (struct VasEBoot_jpeg_data *data) { - if (grub_jpeg_get_word (data) != 4) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + if (VasEBoot_jpeg_get_word (data) != 4) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: DRI marker length must be 4"); - data->dri = grub_jpeg_get_word (data); + data->dri = VasEBoot_jpeg_get_word (data); - return grub_errno; + return VasEBoot_errno; } static void -grub_jpeg_idct_transform (jpeg_data_unit_t du) +VasEBoot_jpeg_idct_transform (jpeg_data_unit_t du) { int *pd; int i; @@ -489,19 +489,19 @@ grub_jpeg_idct_transform (jpeg_data_unit_t du) } static void -grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du) +VasEBoot_jpeg_decode_du (struct VasEBoot_jpeg_data *data, int id, jpeg_data_unit_t du) { int h1, h2, qt; unsigned pos; - grub_memset (du, 0, sizeof (jpeg_data_unit_t)); + VasEBoot_memset (du, 0, sizeof (jpeg_data_unit_t)); qt = data->comp_index[id][0]; h1 = data->comp_index[id][1]; h2 = data->comp_index[id][2]; data->dc_value[id] += - grub_jpeg_get_number (data, grub_jpeg_get_huff_code (data, h1)); + VasEBoot_jpeg_get_number (data, VasEBoot_jpeg_get_huff_code (data, h1)); du[0] = data->dc_value[id] * (int) data->quan_table[qt][0]; pos = 1; @@ -509,22 +509,22 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du) { int num, val; - num = grub_jpeg_get_huff_code (data, h2); + num = VasEBoot_jpeg_get_huff_code (data, h2); if (!num) break; - val = grub_jpeg_get_number (data, num & 0xF); + val = VasEBoot_jpeg_get_number (data, num & 0xF); num >>= 4; pos += num; du[jpeg_zigzag_order[pos]] = val * (int) data->quan_table[qt][pos]; pos++; } - grub_jpeg_idct_transform (du); + VasEBoot_jpeg_idct_transform (du); } static void -grub_jpeg_ycrcb_to_rgb (int yy, int cr, int cb, grub_uint8_t * rgb) +VasEBoot_jpeg_ycrcb_to_rgb (int yy, int cr, int cb, VasEBoot_uint8_t * rgb) { int dd; @@ -537,7 +537,7 @@ grub_jpeg_ycrcb_to_rgb (int yy, int cr, int cb, grub_uint8_t * rgb) dd = 0; if (dd > 255) dd = 255; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN rgb[2] = dd; #else *(rgb++) = dd; @@ -549,7 +549,7 @@ grub_jpeg_ycrcb_to_rgb (int yy, int cr, int cb, grub_uint8_t * rgb) dd = 0; if (dd > 255) dd = 255; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN rgb[1] = dd; #else *(rgb++) = dd; @@ -561,7 +561,7 @@ grub_jpeg_ycrcb_to_rgb (int yy, int cr, int cb, grub_uint8_t * rgb) dd = 0; if (dd > 255) dd = 255; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN rgb[0] = dd; rgb += 3; #else @@ -569,19 +569,19 @@ grub_jpeg_ycrcb_to_rgb (int yy, int cr, int cb, grub_uint8_t * rgb) #endif } -static grub_err_t -grub_jpeg_decode_sos (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_sos (struct VasEBoot_jpeg_data *data) { int i, cc; - grub_uint32_t data_offset; + VasEBoot_uint32_t data_offset; data_offset = data->file->offset; - data_offset += grub_jpeg_get_word (data); + data_offset += VasEBoot_jpeg_get_word (data); - cc = grub_jpeg_get_byte (data); + cc = VasEBoot_jpeg_get_byte (data); if (cc != 3 && cc != 1) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: component count must be 1 or 3"); data->color_components = cc; @@ -589,32 +589,32 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data) { int id, ht; - id = grub_jpeg_get_byte (data) - 1; + id = VasEBoot_jpeg_get_byte (data) - 1; if ((id < 0) || (id >= 3)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: invalid index"); - ht = grub_jpeg_get_byte (data); + ht = VasEBoot_jpeg_get_byte (data); data->comp_index[id][1] = (ht >> 4); data->comp_index[id][2] = (ht & 0xF) + 2; } - grub_jpeg_get_byte (data); /* Skip 3 unused bytes. */ - grub_jpeg_get_word (data); + VasEBoot_jpeg_get_byte (data); /* Skip 3 unused bytes. */ + VasEBoot_jpeg_get_word (data); if (data->file->offset != data_offset) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sos"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sos"); - if (grub_video_bitmap_create (data->bitmap, data->image_width, + if (VasEBoot_video_bitmap_create (data->bitmap, data->image_width, data->image_height, - GRUB_VIDEO_BLIT_FORMAT_RGB_888)) - return grub_errno; + VasEBoot_VIDEO_BLIT_FORMAT_RGB_888)) + return VasEBoot_errno; data->bitmap_ptr = (*data->bitmap)->data; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_jpeg_decode_data (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_data (struct VasEBoot_jpeg_data *data) { unsigned c1, vb, hb, nr1, nc1; int rst = data->dri; @@ -630,20 +630,20 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) c1++, rst--, data->bitmap_ptr += hb * 3) { unsigned r2, c2, nr2, nc2; - grub_uint8_t *ptr2; + VasEBoot_uint8_t *ptr2; for (r2 = 0; r2 < (1U << data->log_vs); r2++) for (c2 = 0; c2 < (1U << data->log_hs); c2++) - grub_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]); + VasEBoot_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]); if (data->color_components >= 3) { - grub_jpeg_decode_du (data, 1, data->cbdu); - grub_jpeg_decode_du (data, 2, data->crdu); + VasEBoot_jpeg_decode_du (data, 1, data->cbdu); + VasEBoot_jpeg_decode_du (data, 2, data->crdu); } - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; nr2 = (data->r1 == nr1 - 1) ? (data->image_height - data->r1 * vb) : vb; nc2 = (c1 == nc1 - 1) ? (data->image_width - c1 * hb) : hb; @@ -663,7 +663,7 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) int cr, cb; cr = data->crdu[i0]; cb = data->cbdu[i0]; - grub_jpeg_ycrcb_to_rgb (yy, cr, cb, ptr2); + VasEBoot_jpeg_ycrcb_to_rgb (yy, cr, cb, ptr2); } else { @@ -674,11 +674,11 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data) } } - return grub_errno; + return VasEBoot_errno; } static void -grub_jpeg_reset (struct grub_jpeg_data *data) +VasEBoot_jpeg_reset (struct VasEBoot_jpeg_data *data) { data->bit_mask = 0x0; @@ -687,54 +687,54 @@ grub_jpeg_reset (struct grub_jpeg_data *data) data->dc_value[2] = 0; } -static grub_uint8_t -grub_jpeg_get_marker (struct grub_jpeg_data *data) +static VasEBoot_uint8_t +VasEBoot_jpeg_get_marker (struct VasEBoot_jpeg_data *data) { - grub_uint8_t r; + VasEBoot_uint8_t r; - r = grub_jpeg_get_byte (data); + r = VasEBoot_jpeg_get_byte (data); if (r != JPEG_ESC_CHAR) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid maker"); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: invalid maker"); return 0; } - return grub_jpeg_get_byte (data); + return VasEBoot_jpeg_get_byte (data); } -static grub_err_t -grub_jpeg_decode_jpeg (struct grub_jpeg_data *data) +static VasEBoot_err_t +VasEBoot_jpeg_decode_jpeg (struct VasEBoot_jpeg_data *data) { - if (grub_jpeg_get_marker (data) != JPEG_MARKER_SOI) /* Start Of Image. */ - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid jpeg file"); + if (VasEBoot_jpeg_get_marker (data) != JPEG_MARKER_SOI) /* Start Of Image. */ + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "jpeg: invalid jpeg file"); - while (grub_errno == 0) + while (VasEBoot_errno == 0) { - grub_uint8_t marker; + VasEBoot_uint8_t marker; - marker = grub_jpeg_get_marker (data); - if (grub_errno) + marker = VasEBoot_jpeg_get_marker (data); + if (VasEBoot_errno) break; - grub_dprintf ("jpeg", "jpeg marker: %x\n", marker); + VasEBoot_dprintf ("jpeg", "jpeg marker: %x\n", marker); switch (marker) { case JPEG_MARKER_DHT: /* Define Huffman Table. */ - grub_jpeg_decode_huff_table (data); + VasEBoot_jpeg_decode_huff_table (data); break; case JPEG_MARKER_DQT: /* Define Quantization Table. */ - grub_jpeg_decode_quan_table (data); + VasEBoot_jpeg_decode_quan_table (data); break; case JPEG_MARKER_SOF0: /* Start Of Frame 0. */ - grub_jpeg_decode_sof (data); + VasEBoot_jpeg_decode_sof (data); break; case JPEG_MARKER_DRI: /* Define Restart Interval. */ - grub_jpeg_decode_dri (data); + VasEBoot_jpeg_decode_dri (data); break; case JPEG_MARKER_SOS: /* Start Of Scan. */ - if (grub_jpeg_decode_sos (data)) + if (VasEBoot_jpeg_decode_sos (data)) break; /* FALLTHROUGH */ case JPEG_MARKER_RST0: /* Restart. */ @@ -745,109 +745,109 @@ grub_jpeg_decode_jpeg (struct grub_jpeg_data *data) case JPEG_MARKER_RST5: case JPEG_MARKER_RST6: case JPEG_MARKER_RST7: - grub_jpeg_decode_data (data); - grub_jpeg_reset (data); + VasEBoot_jpeg_decode_data (data); + VasEBoot_jpeg_reset (data); break; case JPEG_MARKER_EOI: /* End Of Image. */ - return grub_errno; + return VasEBoot_errno; default: /* Skip unrecognized marker. */ { - grub_uint16_t sz; + VasEBoot_uint16_t sz; - sz = grub_jpeg_get_word (data); - if (grub_errno) - return (grub_errno); - grub_file_seek (data->file, data->file->offset + sz - 2); + sz = VasEBoot_jpeg_get_word (data); + if (VasEBoot_errno) + return (VasEBoot_errno); + VasEBoot_file_seek (data->file, data->file->offset + sz - 2); } } } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_video_reader_jpeg (struct grub_video_bitmap **bitmap, +static VasEBoot_err_t +VasEBoot_video_reader_jpeg (struct VasEBoot_video_bitmap **bitmap, const char *filename) { - grub_file_t file; - struct grub_jpeg_data *data; + VasEBoot_file_t file; + struct VasEBoot_jpeg_data *data; - file = grub_buffile_open (filename, 0); + file = VasEBoot_buffile_open (filename, 0); if (!file) - return grub_errno; + return VasEBoot_errno; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (data != NULL) { int i; data->file = file; data->bitmap = bitmap; - grub_jpeg_decode_jpeg (data); + VasEBoot_jpeg_decode_jpeg (data); for (i = 0; i < 4; i++) - grub_free (data->huff_value[i]); + VasEBoot_free (data->huff_value[i]); - grub_free (data); + VasEBoot_free (data); } - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_video_bitmap_destroy (*bitmap); + VasEBoot_video_bitmap_destroy (*bitmap); *bitmap = 0; } - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } #if defined(JPEG_DEBUG) -static grub_err_t -grub_cmd_jpegtest (grub_command_t cmdd __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_jpegtest (VasEBoot_command_t cmdd __attribute__ ((unused)), int argc, char **args) { - struct grub_video_bitmap *bitmap = 0; + struct VasEBoot_video_bitmap *bitmap = 0; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_video_reader_jpeg (&bitmap, args[0]); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_video_reader_jpeg (&bitmap, args[0]); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; - grub_video_bitmap_destroy (bitmap); + VasEBoot_video_bitmap_destroy (bitmap); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static struct grub_video_bitmap_reader jpg_reader = { +static struct VasEBoot_video_bitmap_reader jpg_reader = { .extension = ".jpg", - .reader = grub_video_reader_jpeg, + .reader = VasEBoot_video_reader_jpeg, .next = 0 }; -static struct grub_video_bitmap_reader jpeg_reader = { +static struct VasEBoot_video_bitmap_reader jpeg_reader = { .extension = ".jpeg", - .reader = grub_video_reader_jpeg, + .reader = VasEBoot_video_reader_jpeg, .next = 0 }; -GRUB_MOD_INIT (jpeg) +VasEBoot_MOD_INIT (jpeg) { - grub_video_bitmap_reader_register (&jpg_reader); - grub_video_bitmap_reader_register (&jpeg_reader); + VasEBoot_video_bitmap_reader_register (&jpg_reader); + VasEBoot_video_bitmap_reader_register (&jpeg_reader); #if defined(JPEG_DEBUG) - cmd = grub_register_command ("jpegtest", grub_cmd_jpegtest, + cmd = VasEBoot_register_command ("jpegtest", VasEBoot_cmd_jpegtest, "FILE", "Tests loading of JPEG bitmap."); #endif } -GRUB_MOD_FINI (jpeg) +VasEBoot_MOD_FINI (jpeg) { #if defined(JPEG_DEBUG) - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); #endif - grub_video_bitmap_reader_unregister (&jpeg_reader); - grub_video_bitmap_reader_unregister (&jpg_reader); + VasEBoot_video_bitmap_reader_unregister (&jpeg_reader); + VasEBoot_video_bitmap_reader_unregister (&jpg_reader); } diff --git a/VasEBoot-core/video/readers/png.c b/VasEBoot-core/video/readers/png.c index e1a01e99f..3b3fc4643 100644 --- a/VasEBoot-core/video/readers/png.c +++ b/VasEBoot-core/video/readers/png.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Uncomment following define to enable PNG debug. */ //#define PNG_DEBUG @@ -79,7 +79,7 @@ enum #define DEFLATE_HUFF_LEN 16 #ifdef PNG_DEBUG -static grub_command_t cmd; +static VasEBoot_command_t cmd; #endif struct huff_table @@ -88,20 +88,20 @@ struct huff_table int num_values, max_length; }; -struct grub_png_data +struct VasEBoot_png_data { - grub_file_t file; - struct grub_video_bitmap **bitmap; + VasEBoot_file_t file; + struct VasEBoot_video_bitmap **bitmap; int bit_count, bit_save; - grub_uint32_t next_offset; + VasEBoot_uint32_t next_offset; unsigned image_width, image_height; int bpp, is_16bit; int raw_bytes, is_gray, is_alpha, is_palette; int row_bytes, color_bits; - grub_uint8_t *image_data; + VasEBoot_uint8_t *image_data; int inside_idat, idat_remain; @@ -113,56 +113,56 @@ struct grub_png_data int dist_maxval[DEFLATE_HUFF_LEN]; int dist_offset[DEFLATE_HUFF_LEN]; - grub_uint8_t palette[256][3]; + VasEBoot_uint8_t palette[256][3]; struct huff_table code_table; struct huff_table dist_table; - grub_uint8_t slide[WSIZE]; + VasEBoot_uint8_t slide[WSIZE]; int wp; - grub_uint8_t *cur_rgb; + VasEBoot_uint8_t *cur_rgb; int cur_column, cur_filter, first_line; }; -static grub_uint32_t -grub_png_get_dword (struct grub_png_data *data) +static VasEBoot_uint32_t +VasEBoot_png_get_dword (struct VasEBoot_png_data *data) { - grub_uint32_t r; + VasEBoot_uint32_t r; r = 0; - grub_file_read (data->file, &r, sizeof (grub_uint32_t)); + VasEBoot_file_read (data->file, &r, sizeof (VasEBoot_uint32_t)); - return grub_be_to_cpu32 (r); + return VasEBoot_be_to_cpu32 (r); } -static grub_uint8_t -grub_png_get_byte (struct grub_png_data *data) +static VasEBoot_uint8_t +VasEBoot_png_get_byte (struct VasEBoot_png_data *data) { - grub_uint8_t r; + VasEBoot_uint8_t r; if ((data->inside_idat) && (data->idat_remain == 0)) { - grub_uint32_t len, type; + VasEBoot_uint32_t len, type; do { /* Skip crc checksum. */ - grub_png_get_dword (data); + VasEBoot_png_get_dword (data); if (data->file->offset != data->next_offset) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: chunk size error"); return 0; } - len = grub_png_get_dword (data); - type = grub_png_get_dword (data); + len = VasEBoot_png_get_dword (data); + type = VasEBoot_png_get_dword (data); if (type != PNG_CHUNK_IDAT) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: unexpected end of data"); return 0; } @@ -174,7 +174,7 @@ grub_png_get_byte (struct grub_png_data *data) } r = 0; - grub_file_read (data->file, &r, 1); + VasEBoot_file_read (data->file, &r, 1); if (data->inside_idat) data->idat_remain--; @@ -183,19 +183,19 @@ grub_png_get_byte (struct grub_png_data *data) } static int -grub_png_get_bits (struct grub_png_data *data, int num) +VasEBoot_png_get_bits (struct VasEBoot_png_data *data, int num) { int code, shift; if (data->bit_count == 0) { - data->bit_save = grub_png_get_byte (data); + data->bit_save = VasEBoot_png_get_byte (data); data->bit_count = 8; } code = 0; shift = 0; - while (grub_errno == 0) + while (VasEBoot_errno == 0) { int n; @@ -214,65 +214,65 @@ grub_png_get_bits (struct grub_png_data *data, int num) shift += n; - data->bit_save = grub_png_get_byte (data); + data->bit_save = VasEBoot_png_get_byte (data); data->bit_count = 8; } return code; } -static grub_err_t -grub_png_decode_image_palette (struct grub_png_data *data, +static VasEBoot_err_t +VasEBoot_png_decode_image_palette (struct VasEBoot_png_data *data, unsigned len) { unsigned i = 0, j; if (len == 0) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; for (i = 0; 3 * i < len && i < 256; i++) for (j = 0; j < 3; j++) - data->palette[i][j] = grub_png_get_byte (data); + data->palette[i][j] = VasEBoot_png_get_byte (data); for (i *= 3; i < len; i++) - grub_png_get_byte (data); + VasEBoot_png_get_byte (data); - grub_png_get_dword (data); + VasEBoot_png_get_dword (data); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_png_decode_image_header (struct grub_png_data *data) +static VasEBoot_err_t +VasEBoot_png_decode_image_header (struct VasEBoot_png_data *data) { int color_type; int color_bits; - enum grub_video_blit_format blt; + enum VasEBoot_video_blit_format blt; - data->image_width = grub_png_get_dword (data); - data->image_height = grub_png_get_dword (data); + data->image_width = VasEBoot_png_get_dword (data); + data->image_height = VasEBoot_png_get_dword (data); if ((!data->image_height) || (!data->image_width)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: invalid image size"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: invalid image size"); - color_bits = grub_png_get_byte (data); + color_bits = VasEBoot_png_get_byte (data); data->is_16bit = (color_bits == 16); - color_type = grub_png_get_byte (data); + color_type = VasEBoot_png_get_byte (data); /* According to PNG spec, no other types are valid. */ if ((color_type & ~(PNG_COLOR_MASK_ALPHA | PNG_COLOR_MASK_COLOR)) && (color_type != PNG_COLOR_TYPE_PALETTE)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: color type not supported"); if (color_type == PNG_COLOR_TYPE_PALETTE) data->is_palette = 1; if (data->is_16bit && data->is_palette) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: color type not supported"); if (color_type & PNG_COLOR_MASK_ALPHA) - blt = GRUB_VIDEO_BLIT_FORMAT_RGBA_8888; + blt = VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888; else - blt = GRUB_VIDEO_BLIT_FORMAT_RGB_888; + blt = VasEBoot_VIDEO_BLIT_FORMAT_RGB_888; if (data->is_palette) data->bpp = 1; else if (color_type & PNG_COLOR_MASK_COLOR) @@ -286,16 +286,16 @@ grub_png_decode_image_header (struct grub_png_data *data) if ((color_bits != 8) && (color_bits != 16) && (color_bits != 4 || !(data->is_gray || data->is_palette))) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: bit depth must be 8 or 16"); if (color_type & PNG_COLOR_MASK_ALPHA) data->bpp++; - if (grub_video_bitmap_create (data->bitmap, data->image_width, + if (VasEBoot_video_bitmap_create (data->bitmap, data->image_width, data->image_height, blt)) - return grub_errno; + return VasEBoot_errno; if (data->is_16bit) data->bpp <<= 1; @@ -305,17 +305,17 @@ grub_png_decode_image_header (struct grub_png_data *data) if (data->color_bits <= 4) data->row_bytes = (data->image_width * data->color_bits + 7) / 8; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN if (data->is_16bit || data->is_gray || data->is_palette) #endif { - data->image_data = grub_malloc (data->image_height * data->row_bytes); - if (grub_errno) - return grub_errno; + data->image_data = VasEBoot_malloc (data->image_height * data->row_bytes); + if (VasEBoot_errno) + return VasEBoot_errno; data->cur_rgb = data->image_data; } -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN else { data->image_data = 0; @@ -328,26 +328,26 @@ grub_png_decode_image_header (struct grub_png_data *data) data->cur_column = 0; data->first_line = 1; - if (grub_png_get_byte (data) != PNG_COMPRESSION_BASE) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + if (VasEBoot_png_get_byte (data) != PNG_COMPRESSION_BASE) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: compression method not supported"); - if (grub_png_get_byte (data) != PNG_FILTER_TYPE_BASE) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + if (VasEBoot_png_get_byte (data) != PNG_FILTER_TYPE_BASE) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: filter method not supported"); - if (grub_png_get_byte (data) != PNG_INTERLACE_NONE) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + if (VasEBoot_png_get_byte (data) != PNG_INTERLACE_NONE) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: interlace method not supported"); /* Skip crc checksum. */ - grub_png_get_dword (data); + VasEBoot_png_get_dword (data); - return grub_errno; + return VasEBoot_errno; } /* Order of the bit length code lengths. */ -static const grub_uint8_t bitorder[] = { +static const VasEBoot_uint8_t bitorder[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; @@ -358,7 +358,7 @@ static const int cplens[] = { }; /* Extra bits for literal codes 257..285. */ -static const grub_uint8_t cplext[] = { +static const VasEBoot_uint8_t cplext[] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 }; /* 99==invalid */ @@ -371,14 +371,14 @@ static const int cpdist[] = { }; /* Extra bits for distance codes. */ -static const grub_uint8_t cpdext[] = { +static const VasEBoot_uint8_t cpdext[] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; static void -grub_png_init_huff_table (struct huff_table *ht, int cur_maxlen, +VasEBoot_png_init_huff_table (struct huff_table *ht, int cur_maxlen, int *cur_values, int *cur_maxval, int *cur_offset) { ht->values = cur_values; @@ -386,11 +386,11 @@ grub_png_init_huff_table (struct huff_table *ht, int cur_maxlen, ht->offset = cur_offset; ht->num_values = 0; ht->max_length = cur_maxlen; - grub_memset (cur_maxval, 0, sizeof (int) * cur_maxlen); + VasEBoot_memset (cur_maxval, 0, sizeof (int) * cur_maxlen); } static void -grub_png_insert_huff_item (struct huff_table *ht, int code, int len) +VasEBoot_png_insert_huff_item (struct huff_table *ht, int code, int len) { int i, n; @@ -399,7 +399,7 @@ grub_png_insert_huff_item (struct huff_table *ht, int code, int len) if (len > ht->max_length) { - grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: invalid code length"); + VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: invalid code length"); return; } @@ -416,7 +416,7 @@ grub_png_insert_huff_item (struct huff_table *ht, int code, int len) } static void -grub_png_build_huff_table (struct huff_table *ht) +VasEBoot_png_build_huff_table (struct huff_table *ht) { int base, ofs, i; @@ -435,91 +435,91 @@ grub_png_build_huff_table (struct huff_table *ht) } static int -grub_png_get_huff_code (struct grub_png_data *data, struct huff_table *ht) +VasEBoot_png_get_huff_code (struct VasEBoot_png_data *data, struct huff_table *ht) { int code, i; code = 0; for (i = 0; i < ht->max_length; i++) { - code = (code << 1) + grub_png_get_bits (data, 1); + code = (code << 1) + VasEBoot_png_get_bits (data, 1); if (code < ht->maxval[i]) return ht->values[code + ht->offset[i]]; } return 0; } -static grub_err_t -grub_png_init_fixed_block (struct grub_png_data *data) +static VasEBoot_err_t +VasEBoot_png_init_fixed_block (struct VasEBoot_png_data *data) { int i; - grub_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN, + VasEBoot_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN, data->code_values, data->code_maxval, data->code_offset); for (i = 0; i < 144; i++) - grub_png_insert_huff_item (&data->code_table, i, 8); + VasEBoot_png_insert_huff_item (&data->code_table, i, 8); for (; i < 256; i++) - grub_png_insert_huff_item (&data->code_table, i, 9); + VasEBoot_png_insert_huff_item (&data->code_table, i, 9); for (; i < 280; i++) - grub_png_insert_huff_item (&data->code_table, i, 7); + VasEBoot_png_insert_huff_item (&data->code_table, i, 7); for (; i < DEFLATE_HLIT_MAX; i++) - grub_png_insert_huff_item (&data->code_table, i, 8); + VasEBoot_png_insert_huff_item (&data->code_table, i, 8); - grub_png_build_huff_table (&data->code_table); + VasEBoot_png_build_huff_table (&data->code_table); - grub_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN, + VasEBoot_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN, data->dist_values, data->dist_maxval, data->dist_offset); for (i = 0; i < DEFLATE_HDIST_MAX; i++) - grub_png_insert_huff_item (&data->dist_table, i, 5); + VasEBoot_png_insert_huff_item (&data->dist_table, i, 5); - grub_png_build_huff_table (&data->dist_table); + VasEBoot_png_build_huff_table (&data->dist_table); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_png_init_dynamic_block (struct grub_png_data *data) +static VasEBoot_err_t +VasEBoot_png_init_dynamic_block (struct VasEBoot_png_data *data) { int nl, nd, nb, i, prev; struct huff_table cl; int cl_values[sizeof (bitorder)]; int cl_maxval[8]; int cl_offset[8]; - grub_uint8_t lens[DEFLATE_HCLEN_MAX]; + VasEBoot_uint8_t lens[DEFLATE_HCLEN_MAX]; - nl = DEFLATE_HLIT_BASE + grub_png_get_bits (data, 5); - nd = DEFLATE_HDIST_BASE + grub_png_get_bits (data, 5); - nb = DEFLATE_HCLEN_BASE + grub_png_get_bits (data, 4); + nl = DEFLATE_HLIT_BASE + VasEBoot_png_get_bits (data, 5); + nd = DEFLATE_HDIST_BASE + VasEBoot_png_get_bits (data, 5); + nb = DEFLATE_HCLEN_BASE + VasEBoot_png_get_bits (data, 4); if ((nl > DEFLATE_HLIT_MAX) || (nd > DEFLATE_HDIST_MAX) || (nb > DEFLATE_HCLEN_MAX)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: too much data"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: too much data"); - grub_png_init_huff_table (&cl, 8, cl_values, cl_maxval, cl_offset); + VasEBoot_png_init_huff_table (&cl, 8, cl_values, cl_maxval, cl_offset); for (i = 0; i < nb; i++) - lens[bitorder[i]] = grub_png_get_bits (data, 3); + lens[bitorder[i]] = VasEBoot_png_get_bits (data, 3); for (; i < DEFLATE_HCLEN_MAX; i++) lens[bitorder[i]] = 0; for (i = 0; i < DEFLATE_HCLEN_MAX; i++) - grub_png_insert_huff_item (&cl, i, lens[i]); + VasEBoot_png_insert_huff_item (&cl, i, lens[i]); - grub_png_build_huff_table (&cl); + VasEBoot_png_build_huff_table (&cl); - grub_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN, + VasEBoot_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN, data->code_values, data->code_maxval, data->code_offset); - grub_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN, + VasEBoot_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN, data->dist_values, data->dist_maxval, data->dist_offset); @@ -529,8 +529,8 @@ grub_png_init_dynamic_block (struct grub_png_data *data) int n, code; struct huff_table *ht; - if (grub_errno) - return grub_errno; + if (VasEBoot_errno) + return VasEBoot_errno; if (i < nl) { @@ -543,47 +543,47 @@ grub_png_init_dynamic_block (struct grub_png_data *data) code = i - nl; } - n = grub_png_get_huff_code (data, &cl); + n = VasEBoot_png_get_huff_code (data, &cl); if (n < 16) { - grub_png_insert_huff_item (ht, code, n); + VasEBoot_png_insert_huff_item (ht, code, n); prev = n; } else if (n == 16) { int c; - c = 3 + grub_png_get_bits (data, 2); + c = 3 + VasEBoot_png_get_bits (data, 2); while (c > 0) { - grub_png_insert_huff_item (ht, code++, prev); + VasEBoot_png_insert_huff_item (ht, code++, prev); i++; c--; } i--; } else if (n == 17) - i += 3 + grub_png_get_bits (data, 3) - 1; + i += 3 + VasEBoot_png_get_bits (data, 3) - 1; else - i += 11 + grub_png_get_bits (data, 7) - 1; + i += 11 + VasEBoot_png_get_bits (data, 7) - 1; } - grub_png_build_huff_table (&data->code_table); - grub_png_build_huff_table (&data->dist_table); + VasEBoot_png_build_huff_table (&data->code_table); + VasEBoot_png_build_huff_table (&data->dist_table); - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) +static VasEBoot_err_t +VasEBoot_png_output_byte (struct VasEBoot_png_data *data, VasEBoot_uint8_t n) { if (--data->raw_bytes < 0) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "image size overflown"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "image size overflown"); if (data->cur_column == 0) { if (n >= PNG_FILTER_VALUE_LAST) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid filter value"); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "invalid filter value"); data->cur_filter = n; } @@ -593,16 +593,16 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) data->cur_column++; if (data->cur_column == data->row_bytes + 1) { - grub_uint8_t *blank_line = NULL; - grub_uint8_t *cur = data->cur_rgb - data->row_bytes; - grub_uint8_t *left = cur; - grub_uint8_t *up; + VasEBoot_uint8_t *blank_line = NULL; + VasEBoot_uint8_t *cur = data->cur_rgb - data->row_bytes; + VasEBoot_uint8_t *left = cur; + VasEBoot_uint8_t *up; if (data->first_line) { - blank_line = grub_zalloc (data->row_bytes); + blank_line = VasEBoot_zalloc (data->row_bytes); if (blank_line == NULL) - return grub_errno; + return VasEBoot_errno; up = blank_line; } @@ -645,7 +645,7 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) case PNG_FILTER_VALUE_PAETH: { int i; - grub_uint8_t *upper_left = up; + VasEBoot_uint8_t *upper_left = up; for (i = 0; i < data->bpp; i++, cur++, up++) *cur += *up; @@ -676,27 +676,27 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) } } - grub_free (blank_line); + VasEBoot_free (blank_line); data->cur_column = 0; data->first_line = 0; } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_png_read_dynamic_block (struct grub_png_data *data) +static VasEBoot_err_t +VasEBoot_png_read_dynamic_block (struct VasEBoot_png_data *data) { - while (grub_errno == 0) + while (VasEBoot_errno == 0) { int n; - n = grub_png_get_huff_code (data, &data->code_table); + n = VasEBoot_png_get_huff_code (data, &data->code_table); if (n < 256) { data->slide[data->wp] = n; - grub_png_output_byte (data, n); + VasEBoot_png_output_byte (data, n); data->wp++; if (data->wp >= WSIZE) @@ -711,12 +711,12 @@ grub_png_read_dynamic_block (struct grub_png_data *data) n -= 257; len = cplens[n]; if (cplext[n]) - len += grub_png_get_bits (data, cplext[n]); + len += VasEBoot_png_get_bits (data, cplext[n]); - n = grub_png_get_huff_code (data, &data->dist_table); + n = VasEBoot_png_get_huff_code (data, &data->dist_table); dist = cpdist[n]; if (cpdext[n]) - dist += grub_png_get_bits (data, cpdext[n]); + dist += VasEBoot_png_get_bits (data, cpdext[n]); pos = data->wp - dist; if (pos < 0) @@ -725,7 +725,7 @@ grub_png_read_dynamic_block (struct grub_png_data *data) while (len > 0) { data->slide[data->wp] = data->slide[pos]; - grub_png_output_byte (data, data->slide[data->wp]); + VasEBoot_png_output_byte (data, data->slide[data->wp]); data->wp++; if (data->wp >= WSIZE) @@ -740,92 +740,92 @@ grub_png_read_dynamic_block (struct grub_png_data *data) } } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_png_decode_image_data (struct grub_png_data *data) +static VasEBoot_err_t +VasEBoot_png_decode_image_data (struct VasEBoot_png_data *data) { - grub_uint8_t cmf, flg; + VasEBoot_uint8_t cmf, flg; int final; - cmf = grub_png_get_byte (data); - flg = grub_png_get_byte (data); + cmf = VasEBoot_png_get_byte (data); + flg = VasEBoot_png_get_byte (data); if ((cmf & 0xF) != Z_DEFLATED) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: only support deflate compression method"); if (flg & Z_FLAG_DICT) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: dictionary not supported"); do { int block_type; - final = grub_png_get_bits (data, 1); - block_type = grub_png_get_bits (data, 2); + final = VasEBoot_png_get_bits (data, 1); + block_type = VasEBoot_png_get_bits (data, 2); switch (block_type) { case INFLATE_STORED: { - grub_uint16_t i, len; + VasEBoot_uint16_t i, len; data->bit_count = 0; - len = grub_png_get_byte (data); - len += ((grub_uint16_t) grub_png_get_byte (data)) << 8; + len = VasEBoot_png_get_byte (data); + len += ((VasEBoot_uint16_t) VasEBoot_png_get_byte (data)) << 8; /* Skip NLEN field. */ - grub_png_get_byte (data); - grub_png_get_byte (data); + VasEBoot_png_get_byte (data); + VasEBoot_png_get_byte (data); for (i = 0; i < len; i++) - grub_png_output_byte (data, grub_png_get_byte (data)); + VasEBoot_png_output_byte (data, VasEBoot_png_get_byte (data)); break; } case INFLATE_FIXED: - grub_png_init_fixed_block (data); - grub_png_read_dynamic_block (data); + VasEBoot_png_init_fixed_block (data); + VasEBoot_png_read_dynamic_block (data); break; case INFLATE_DYNAMIC: - grub_png_init_dynamic_block (data); - grub_png_read_dynamic_block (data); + VasEBoot_png_init_dynamic_block (data); + VasEBoot_png_read_dynamic_block (data); break; default: - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: unknown block type"); } } - while ((!final) && (grub_errno == 0)); + while ((!final) && (VasEBoot_errno == 0)); /* Skip adler checksum. */ - grub_png_get_dword (data); + VasEBoot_png_get_dword (data); /* Skip crc checksum. */ - grub_png_get_dword (data); + VasEBoot_png_get_dword (data); - return grub_errno; + return VasEBoot_errno; } -static const grub_uint8_t png_magic[8] = +static const VasEBoot_uint8_t png_magic[8] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0x0a }; static void -grub_png_convert_image (struct grub_png_data *data) +VasEBoot_png_convert_image (struct VasEBoot_png_data *data) { unsigned i; - grub_uint8_t *d1, *d2; + VasEBoot_uint8_t *d1, *d2; d1 = (*data->bitmap)->data; d2 = data->image_data + data->is_16bit; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN #define R4 3 #define G4 2 #define B4 1 @@ -845,8 +845,8 @@ grub_png_convert_image (struct grub_png_data *data) if (data->color_bits <= 4) { - grub_uint8_t palette[16][3]; - grub_uint8_t *d1c, *d2c; + VasEBoot_uint8_t palette[16][3]; + VasEBoot_uint8_t *d1c, *d2c; int shift; int mask = (1 << data->color_bits) - 1; unsigned j; @@ -860,17 +860,17 @@ grub_png_convert_image (struct grub_png_data *data) Precompute the multipliers to avoid division. */ - const grub_uint8_t multipliers[5] = { 0xff, 0xff, 0x55, 0x24, 0x11 }; + const VasEBoot_uint8_t multipliers[5] = { 0xff, 0xff, 0x55, 0x24, 0x11 }; for (i = 0; i < (1U << data->color_bits); i++) { - grub_uint8_t col = multipliers[data->color_bits] * i; + VasEBoot_uint8_t col = multipliers[data->color_bits] * i; palette[i][0] = col; palette[i][1] = col; palette[i][2] = col; } } else - grub_memcpy (palette, data->palette, 3 << data->color_bits); + VasEBoot_memcpy (palette, data->palette, 3 << data->color_bits); d1c = d1; d2c = d2; for (j = 0; j < data->image_height; j++, d1c += data->image_width * 3, @@ -881,7 +881,7 @@ grub_png_convert_image (struct grub_png_data *data) shift = 8 - data->color_bits; for (i = 0; i < data->image_width; i++, d1 += 3) { - grub_uint8_t col = (d2[0] >> shift) & mask; + VasEBoot_uint8_t col = (d2[0] >> shift) & mask; d1[R3] = data->palette[col][2]; d1[G3] = data->palette[col][1]; d1[B3] = data->palette[col][0]; @@ -964,7 +964,7 @@ grub_png_convert_image (struct grub_png_data *data) { /* Only copy the upper 8 bit. */ -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN for (i = 0; i < (data->image_width * data->image_height * data->bpp >> 1); i++, d1++, d2 += 2) *d1 = *d2; @@ -1019,33 +1019,33 @@ grub_png_convert_image (struct grub_png_data *data) } -static grub_err_t -grub_png_decode_png (struct grub_png_data *data) +static VasEBoot_err_t +VasEBoot_png_decode_png (struct VasEBoot_png_data *data) { - grub_uint8_t magic[8]; + VasEBoot_uint8_t magic[8]; - if (grub_file_read (data->file, &magic[0], 8) != 8) - return grub_errno; + if (VasEBoot_file_read (data->file, &magic[0], 8) != 8) + return VasEBoot_errno; - if (grub_memcmp (magic, png_magic, sizeof (png_magic))) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: not a png file"); + if (VasEBoot_memcmp (magic, png_magic, sizeof (png_magic))) + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: not a png file"); while (1) { - grub_uint32_t len, type; + VasEBoot_uint32_t len, type; - len = grub_png_get_dword (data); - type = grub_png_get_dword (data); + len = VasEBoot_png_get_dword (data); + type = VasEBoot_png_get_dword (data); data->next_offset = data->file->offset + len + 4; switch (type) { case PNG_CHUNK_IHDR: - grub_png_decode_image_header (data); + VasEBoot_png_decode_image_header (data); break; case PNG_CHUNK_PLTE: - grub_png_decode_image_palette (data, len); + VasEBoot_png_decode_image_palette (data, len); break; case PNG_CHUNK_IDAT: @@ -1053,105 +1053,105 @@ grub_png_decode_png (struct grub_png_data *data) data->idat_remain = len; data->bit_count = 0; - grub_png_decode_image_data (data); + VasEBoot_png_decode_image_data (data); data->inside_idat = 0; break; case PNG_CHUNK_IEND: if (data->image_data) - grub_png_convert_image (data); + VasEBoot_png_convert_image (data); - return grub_errno; + return VasEBoot_errno; default: - grub_file_seek (data->file, data->file->offset + len + 4); + VasEBoot_file_seek (data->file, data->file->offset + len + 4); } - if (grub_errno) + if (VasEBoot_errno) break; if (data->file->offset != data->next_offset) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "png: chunk size error"); } - return grub_errno; + return VasEBoot_errno; } -static grub_err_t -grub_video_reader_png (struct grub_video_bitmap **bitmap, +static VasEBoot_err_t +VasEBoot_video_reader_png (struct VasEBoot_video_bitmap **bitmap, const char *filename) { - grub_file_t file; - struct grub_png_data *data; + VasEBoot_file_t file; + struct VasEBoot_png_data *data; - file = grub_buffile_open (filename, 0); + file = VasEBoot_buffile_open (filename, 0); if (!file) - return grub_errno; + return VasEBoot_errno; - data = grub_zalloc (sizeof (*data)); + data = VasEBoot_zalloc (sizeof (*data)); if (data != NULL) { data->file = file; data->bitmap = bitmap; - grub_png_decode_png (data); + VasEBoot_png_decode_png (data); - grub_free (data->image_data); - grub_free (data); + VasEBoot_free (data->image_data); + VasEBoot_free (data); } - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_video_bitmap_destroy (*bitmap); + VasEBoot_video_bitmap_destroy (*bitmap); *bitmap = 0; } - grub_file_close (file); - return grub_errno; + VasEBoot_file_close (file); + return VasEBoot_errno; } #if defined(PNG_DEBUG) -static grub_err_t -grub_cmd_pngtest (grub_command_t cmd_d __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_pngtest (VasEBoot_command_t cmd_d __attribute__ ((unused)), int argc, char **args) { - struct grub_video_bitmap *bitmap = 0; + struct VasEBoot_video_bitmap *bitmap = 0; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("filename expected")); - grub_video_reader_png (&bitmap, args[0]); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_video_reader_png (&bitmap, args[0]); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; - grub_video_bitmap_destroy (bitmap); + VasEBoot_video_bitmap_destroy (bitmap); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static struct grub_video_bitmap_reader png_reader = { +static struct VasEBoot_video_bitmap_reader png_reader = { .extension = ".png", - .reader = grub_video_reader_png, + .reader = VasEBoot_video_reader_png, .next = 0 }; -GRUB_MOD_INIT (png) +VasEBoot_MOD_INIT (png) { - grub_video_bitmap_reader_register (&png_reader); + VasEBoot_video_bitmap_reader_register (&png_reader); #if defined(PNG_DEBUG) - cmd = grub_register_command ("pngtest", grub_cmd_pngtest, + cmd = VasEBoot_register_command ("pngtest", VasEBoot_cmd_pngtest, "FILE", "Tests loading of PNG bitmap."); #endif } -GRUB_MOD_FINI (png) +VasEBoot_MOD_FINI (png) { #if defined(PNG_DEBUG) - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); #endif - grub_video_bitmap_reader_unregister (&png_reader); + VasEBoot_video_bitmap_reader_unregister (&png_reader); } diff --git a/VasEBoot-core/video/readers/tga.c b/VasEBoot-core/video/readers/tga.c index c7a16fa9c..5eed6120e 100644 --- a/VasEBoot-core/video/readers/tga.c +++ b/VasEBoot-core/video/readers/tga.c @@ -1,170 +1,170 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* Uncomment following define to enable TGA debug. */ //#define TGA_DEBUG -#define dump_int_field(x) grub_dprintf ("tga", #x " = %d (0x%04x)\n", x, x); +#define dump_int_field(x) VasEBoot_dprintf ("tga", #x " = %d (0x%04x)\n", x, x); #if defined(TGA_DEBUG) -static grub_command_t cmd; +static VasEBoot_command_t cmd; #endif enum { - GRUB_TGA_IMAGE_TYPE_NONE = 0, - GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_INDEXCOLOR = 1, - GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_TRUECOLOR = 2, - GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_BLACK_AND_WHITE = 3, - GRUB_TGA_IMAGE_TYPE_RLE_INDEXCOLOR = 9, - GRUB_TGA_IMAGE_TYPE_RLE_TRUECOLOR = 10, - GRUB_TGA_IMAGE_TYPE_RLE_BLACK_AND_WHITE = 11, + VasEBoot_TGA_IMAGE_TYPE_NONE = 0, + VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_INDEXCOLOR = 1, + VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_TRUECOLOR = 2, + VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_BLACK_AND_WHITE = 3, + VasEBoot_TGA_IMAGE_TYPE_RLE_INDEXCOLOR = 9, + VasEBoot_TGA_IMAGE_TYPE_RLE_TRUECOLOR = 10, + VasEBoot_TGA_IMAGE_TYPE_RLE_BLACK_AND_WHITE = 11, }; enum { - GRUB_TGA_COLOR_MAP_TYPE_NONE = 0, - GRUB_TGA_COLOR_MAP_TYPE_INCLUDED = 1 + VasEBoot_TGA_COLOR_MAP_TYPE_NONE = 0, + VasEBoot_TGA_COLOR_MAP_TYPE_INCLUDED = 1 }; enum { - GRUB_TGA_IMAGE_ORIGIN_RIGHT = 0x10, - GRUB_TGA_IMAGE_ORIGIN_TOP = 0x20 + VasEBoot_TGA_IMAGE_ORIGIN_RIGHT = 0x10, + VasEBoot_TGA_IMAGE_ORIGIN_TOP = 0x20 }; -struct grub_tga_header +struct VasEBoot_tga_header { - grub_uint8_t id_length; - grub_uint8_t color_map_type; - grub_uint8_t image_type; + VasEBoot_uint8_t id_length; + VasEBoot_uint8_t color_map_type; + VasEBoot_uint8_t image_type; /* Color Map Specification. */ - grub_uint16_t color_map_first_index; - grub_uint16_t color_map_length; - grub_uint8_t color_map_bpp; + VasEBoot_uint16_t color_map_first_index; + VasEBoot_uint16_t color_map_length; + VasEBoot_uint8_t color_map_bpp; /* Image Specification. */ - grub_uint16_t image_x_origin; - grub_uint16_t image_y_origin; - grub_uint16_t image_width; - grub_uint16_t image_height; - grub_uint8_t image_bpp; - grub_uint8_t image_descriptor; -} GRUB_PACKED; + VasEBoot_uint16_t image_x_origin; + VasEBoot_uint16_t image_y_origin; + VasEBoot_uint16_t image_width; + VasEBoot_uint16_t image_height; + VasEBoot_uint8_t image_bpp; + VasEBoot_uint8_t image_descriptor; +} VasEBoot_PACKED; struct tga_data { - struct grub_tga_header hdr; + struct VasEBoot_tga_header hdr; int uses_rle; int pktlen; int bpp; int is_rle; - grub_uint8_t pixel[4]; - grub_uint8_t palette[256][3]; - struct grub_video_bitmap *bitmap; - grub_file_t file; + VasEBoot_uint8_t pixel[4]; + VasEBoot_uint8_t palette[256][3]; + struct VasEBoot_video_bitmap *bitmap; + VasEBoot_file_t file; unsigned image_width; unsigned image_height; }; -static grub_err_t +static VasEBoot_err_t fetch_pixel (struct tga_data *data) { if (!data->uses_rle) { - if (grub_file_read (data->file, &data->pixel[0], data->bpp) + if (VasEBoot_file_read (data->file, &data->pixel[0], data->bpp) != data->bpp) - return grub_errno; - return GRUB_ERR_NONE; + return VasEBoot_errno; + return VasEBoot_ERR_NONE; } if (!data->pktlen) { - grub_uint8_t type; - if (grub_file_read (data->file, &type, sizeof (type)) != sizeof(type)) - return grub_errno; + VasEBoot_uint8_t type; + if (VasEBoot_file_read (data->file, &type, sizeof (type)) != sizeof(type)) + return VasEBoot_errno; data->is_rle = !!(type & 0x80); data->pktlen = (type & 0x7f) + 1; - if (data->is_rle && grub_file_read (data->file, &data->pixel[0], data->bpp) + if (data->is_rle && VasEBoot_file_read (data->file, &data->pixel[0], data->bpp) != data->bpp) - return grub_errno; + return VasEBoot_errno; } - if (!data->is_rle && grub_file_read (data->file, &data->pixel[0], data->bpp) + if (!data->is_rle && VasEBoot_file_read (data->file, &data->pixel[0], data->bpp) != data->bpp) - return grub_errno; + return VasEBoot_errno; data->pktlen--; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t tga_load_palette (struct tga_data *data) { - grub_size_t len = grub_le_to_cpu32 (data->hdr.color_map_length) * 3; + VasEBoot_size_t len = VasEBoot_le_to_cpu32 (data->hdr.color_map_length) * 3; if (len > sizeof (data->palette)) len = sizeof (data->palette); - if (grub_file_read (data->file, &data->palette, len) - != (grub_ssize_t) len) - return grub_errno; + if (VasEBoot_file_read (data->file, &data->palette, len) + != (VasEBoot_ssize_t) len) + return VasEBoot_errno; -#ifndef GRUB_CPU_WORDS_BIGENDIAN +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN { - grub_size_t i; + VasEBoot_size_t i; for (i = 0; 3 * i < len; i++) { - grub_uint8_t t; + VasEBoot_uint8_t t; t = data->palette[i][0]; data->palette[i][0] = data->palette[i][2]; data->palette[i][2] = t; } } #endif - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t tga_load_index_color (struct tga_data *data) { unsigned int x; unsigned int y; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; for (y = 0; y < data->image_height; y++) { ptr = data->bitmap->data; - if ((data->hdr.image_descriptor & GRUB_TGA_IMAGE_ORIGIN_TOP) != 0) + if ((data->hdr.image_descriptor & VasEBoot_TGA_IMAGE_ORIGIN_TOP) != 0) ptr += y * data->bitmap->mode_info.pitch; else ptr += (data->image_height - 1 - y) * data->bitmap->mode_info.pitch; for (x = 0; x < data->image_width; x++) { - grub_err_t err; + VasEBoot_err_t err; err = fetch_pixel (data); if (err) return err; @@ -176,27 +176,27 @@ tga_load_index_color (struct tga_data *data) ptr += 3; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t tga_load_grayscale (struct tga_data *data) { unsigned int x; unsigned int y; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; for (y = 0; y < data->image_height; y++) { ptr = data->bitmap->data; - if ((data->hdr.image_descriptor & GRUB_TGA_IMAGE_ORIGIN_TOP) != 0) + if ((data->hdr.image_descriptor & VasEBoot_TGA_IMAGE_ORIGIN_TOP) != 0) ptr += y * data->bitmap->mode_info.pitch; else ptr += (data->image_height - 1 - y) * data->bitmap->mode_info.pitch; for (x = 0; x < data->image_width; x++) { - grub_err_t err; + VasEBoot_err_t err; err = fetch_pixel (data); if (err) return err; @@ -208,32 +208,32 @@ tga_load_grayscale (struct tga_data *data) ptr += 3; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t tga_load_truecolor_R8G8B8 (struct tga_data *data) { unsigned int x; unsigned int y; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; for (y = 0; y < data->image_height; y++) { ptr = data->bitmap->data; - if ((data->hdr.image_descriptor & GRUB_TGA_IMAGE_ORIGIN_TOP) != 0) + if ((data->hdr.image_descriptor & VasEBoot_TGA_IMAGE_ORIGIN_TOP) != 0) ptr += y * data->bitmap->mode_info.pitch; else ptr += (data->image_height - 1 - y) * data->bitmap->mode_info.pitch; for (x = 0; x < data->image_width; x++) { - grub_err_t err; + VasEBoot_err_t err; err = fetch_pixel (data); if (err) return err; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN ptr[0] = data->pixel[0]; ptr[1] = data->pixel[1]; ptr[2] = data->pixel[2]; @@ -245,32 +245,32 @@ tga_load_truecolor_R8G8B8 (struct tga_data *data) ptr += 3; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t +static VasEBoot_err_t tga_load_truecolor_R8G8B8A8 (struct tga_data *data) { unsigned int x; unsigned int y; - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; for (y = 0; y < data->image_height; y++) { ptr = data->bitmap->data; - if ((data->hdr.image_descriptor & GRUB_TGA_IMAGE_ORIGIN_TOP) != 0) + if ((data->hdr.image_descriptor & VasEBoot_TGA_IMAGE_ORIGIN_TOP) != 0) ptr += y * data->bitmap->mode_info.pitch; else ptr += (data->image_height - 1 - y) * data->bitmap->mode_info.pitch; for (x = 0; x < data->image_width; x++) { - grub_err_t err; + VasEBoot_err_t err; err = fetch_pixel (data); if (err) return err; -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN ptr[0] = data->pixel[0]; ptr[1] = data->pixel[1]; ptr[2] = data->pixel[2]; @@ -285,45 +285,45 @@ tga_load_truecolor_R8G8B8A8 (struct tga_data *data) ptr += 4; } } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_reader_tga (struct grub_video_bitmap **bitmap, +static VasEBoot_err_t +VasEBoot_video_reader_tga (struct VasEBoot_video_bitmap **bitmap, const char *filename) { - grub_ssize_t pos; + VasEBoot_ssize_t pos; struct tga_data data; - grub_memset (&data, 0, sizeof (data)); + VasEBoot_memset (&data, 0, sizeof (data)); - data.file = grub_buffile_open (filename, 0); + data.file = VasEBoot_buffile_open (filename, 0); if (! data.file) - return grub_errno; + return VasEBoot_errno; /* TGA Specification states that we SHOULD start by reading ID from end of file, but we really don't care about that as we are not going to support developer area & extensions at this point. */ /* Read TGA header from beginning of file. */ - if (grub_file_read (data.file, &data.hdr, sizeof (data.hdr)) + if (VasEBoot_file_read (data.file, &data.hdr, sizeof (data.hdr)) != sizeof (data.hdr)) { - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } /* Skip ID field. */ - pos = grub_file_tell (data.file); + pos = VasEBoot_file_tell (data.file); pos += data.hdr.id_length; - grub_file_seek (data.file, pos); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_file_seek (data.file, pos); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } - grub_dprintf("tga", "tga: header\n"); + VasEBoot_dprintf("tga", "tga: header\n"); dump_int_field(data.hdr.id_length); dump_int_field(data.hdr.color_map_type); dump_int_field(data.hdr.image_type); @@ -337,26 +337,26 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, dump_int_field(data.hdr.image_bpp); dump_int_field(data.hdr.image_descriptor); - data.image_width = grub_le_to_cpu16 (data.hdr.image_width); - data.image_height = grub_le_to_cpu16 (data.hdr.image_height); + data.image_width = VasEBoot_le_to_cpu16 (data.hdr.image_width); + data.image_height = VasEBoot_le_to_cpu16 (data.hdr.image_height); /* Check that bitmap encoding is supported. */ switch (data.hdr.image_type) { - case GRUB_TGA_IMAGE_TYPE_RLE_TRUECOLOR: - case GRUB_TGA_IMAGE_TYPE_RLE_BLACK_AND_WHITE: - case GRUB_TGA_IMAGE_TYPE_RLE_INDEXCOLOR: + case VasEBoot_TGA_IMAGE_TYPE_RLE_TRUECOLOR: + case VasEBoot_TGA_IMAGE_TYPE_RLE_BLACK_AND_WHITE: + case VasEBoot_TGA_IMAGE_TYPE_RLE_INDEXCOLOR: data.uses_rle = 1; break; - case GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_TRUECOLOR: - case GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_BLACK_AND_WHITE: - case GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_INDEXCOLOR: + case VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_TRUECOLOR: + case VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_BLACK_AND_WHITE: + case VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_INDEXCOLOR: data.uses_rle = 0; break; default: - grub_file_close (data.file); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_file_close (data.file); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "unsupported bitmap format (unknown encoding %d)", data.hdr.image_type); } @@ -365,22 +365,22 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, /* Check that bitmap depth is supported. */ switch (data.hdr.image_type) { - case GRUB_TGA_IMAGE_TYPE_RLE_BLACK_AND_WHITE: - case GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_BLACK_AND_WHITE: + case VasEBoot_TGA_IMAGE_TYPE_RLE_BLACK_AND_WHITE: + case VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_BLACK_AND_WHITE: if (data.hdr.image_bpp != 8) { - grub_file_close (data.file); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_file_close (data.file); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "unsupported bitmap format (bpp=%d)", data.hdr.image_bpp); } - grub_video_bitmap_create (bitmap, data.image_width, + VasEBoot_video_bitmap_create (bitmap, data.image_width, data.image_height, - GRUB_VIDEO_BLIT_FORMAT_RGB_888); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_VIDEO_BLIT_FORMAT_RGB_888); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } data.bitmap = *bitmap; @@ -388,24 +388,24 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, tga_load_grayscale (&data); break; - case GRUB_TGA_IMAGE_TYPE_RLE_INDEXCOLOR: - case GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_INDEXCOLOR: + case VasEBoot_TGA_IMAGE_TYPE_RLE_INDEXCOLOR: + case VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_INDEXCOLOR: if (data.hdr.image_bpp != 8 || data.hdr.color_map_bpp != 24 || data.hdr.color_map_first_index != 0) { - grub_file_close (data.file); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_file_close (data.file); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "unsupported bitmap format (bpp=%d)", data.hdr.image_bpp); } - grub_video_bitmap_create (bitmap, data.image_width, + VasEBoot_video_bitmap_create (bitmap, data.image_width, data.image_height, - GRUB_VIDEO_BLIT_FORMAT_RGB_888); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_VIDEO_BLIT_FORMAT_RGB_888); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } data.bitmap = *bitmap; @@ -414,18 +414,18 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, tga_load_index_color (&data); break; - case GRUB_TGA_IMAGE_TYPE_RLE_TRUECOLOR: - case GRUB_TGA_IMAGE_TYPE_UNCOMPRESSED_TRUECOLOR: + case VasEBoot_TGA_IMAGE_TYPE_RLE_TRUECOLOR: + case VasEBoot_TGA_IMAGE_TYPE_UNCOMPRESSED_TRUECOLOR: switch (data.hdr.image_bpp) { case 24: - grub_video_bitmap_create (bitmap, data.image_width, + VasEBoot_video_bitmap_create (bitmap, data.image_width, data.image_height, - GRUB_VIDEO_BLIT_FORMAT_RGB_888); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_VIDEO_BLIT_FORMAT_RGB_888); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } data.bitmap = *bitmap; @@ -434,13 +434,13 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, break; case 32: - grub_video_bitmap_create (bitmap, data.image_width, + VasEBoot_video_bitmap_create (bitmap, data.image_width, data.image_height, - GRUB_VIDEO_BLIT_FORMAT_RGBA_8888); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } data.bitmap = *bitmap; @@ -449,63 +449,63 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, break; default: - grub_file_close (data.file); - return grub_error (GRUB_ERR_BAD_FILE_TYPE, + VasEBoot_file_close (data.file); + return VasEBoot_error (VasEBoot_ERR_BAD_FILE_TYPE, "unsupported bitmap format (bpp=%d)", data.hdr.image_bpp); } } /* If there was a loading problem, destroy bitmap. */ - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_video_bitmap_destroy (*bitmap); + VasEBoot_video_bitmap_destroy (*bitmap); *bitmap = 0; } - grub_file_close (data.file); - return grub_errno; + VasEBoot_file_close (data.file); + return VasEBoot_errno; } #if defined(TGA_DEBUG) -static grub_err_t -grub_cmd_tgatest (grub_command_t cmd_d __attribute__ ((unused)), +static VasEBoot_err_t +VasEBoot_cmd_tgatest (VasEBoot_command_t cmd_d __attribute__ ((unused)), int argc, char **args) { - struct grub_video_bitmap *bitmap = 0; + struct VasEBoot_video_bitmap *bitmap = 0; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, "file name required"); - grub_video_reader_tga (&bitmap, args[0]); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_video_reader_tga (&bitmap, args[0]); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; - grub_video_bitmap_destroy (bitmap); + VasEBoot_video_bitmap_destroy (bitmap); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -static struct grub_video_bitmap_reader tga_reader = { +static struct VasEBoot_video_bitmap_reader tga_reader = { .extension = ".tga", - .reader = grub_video_reader_tga, + .reader = VasEBoot_video_reader_tga, .next = 0 }; -GRUB_MOD_INIT(tga) +VasEBoot_MOD_INIT(tga) { - grub_video_bitmap_reader_register (&tga_reader); + VasEBoot_video_bitmap_reader_register (&tga_reader); #if defined(TGA_DEBUG) - cmd = grub_register_command ("tgatest", grub_cmd_tgatest, + cmd = VasEBoot_register_command ("tgatest", VasEBoot_cmd_tgatest, "FILE", "Tests loading of TGA bitmap."); #endif } -GRUB_MOD_FINI(tga) +VasEBoot_MOD_FINI(tga) { #if defined(TGA_DEBUG) - grub_unregister_command (cmd); + VasEBoot_unregister_command (cmd); #endif - grub_video_bitmap_reader_unregister (&tga_reader); + VasEBoot_video_bitmap_reader_unregister (&tga_reader); } diff --git a/VasEBoot-core/video/sis315_init.c b/VasEBoot-core/video/sis315_init.c index ae5c1419c..80e69b1c6 100644 --- a/VasEBoot-core/video/sis315_init.c +++ b/VasEBoot-core/video/sis315_init.c @@ -1,4 +1,4 @@ -static const struct { grub_uint8_t reg; grub_uint8_t val; } sr_dump [] = +static const struct { VasEBoot_uint8_t reg; VasEBoot_uint8_t val; } sr_dump [] = { { 0x28, 0x81 }, { 0x2a, 0x00 }, @@ -152,7 +152,7 @@ static const struct { grub_uint8_t reg; grub_uint8_t val; } sr_dump [] = { 0x05, 0x86 }, }; -static const grub_uint8_t gr[] = { +static const VasEBoot_uint8_t gr[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; diff --git a/VasEBoot-core/video/sis315pro.c b/VasEBoot-core/video/sis315pro.c index 22a0c85a6..3f94e96d4 100644 --- a/VasEBoot-core/video/sis315pro.c +++ b/VasEBoot-core/video/sis315pro.c @@ -1,154 +1,154 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#define GRUB_SIS315PRO_PCIID 0x03251039 -#define GRUB_SIS315PRO_TOTAL_MEMORY_SPACE 0x800000 -#define GRUB_SIS315PRO_MMIO_SPACE 0x1000 +#define VasEBoot_SIS315PRO_PCIID 0x03251039 +#define VasEBoot_SIS315PRO_TOTAL_MEMORY_SPACE 0x800000 +#define VasEBoot_SIS315PRO_MMIO_SPACE 0x1000 static struct { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; - grub_uint8_t *ptr; - volatile grub_uint8_t *direct_ptr; + VasEBoot_uint8_t *ptr; + volatile VasEBoot_uint8_t *direct_ptr; int mapped; - grub_uint32_t base; - grub_uint32_t mmiobase; - volatile grub_uint32_t *mmioptr; - grub_pci_device_t dev; - grub_port_t io; + VasEBoot_uint32_t base; + VasEBoot_uint32_t mmiobase; + volatile VasEBoot_uint32_t *mmioptr; + VasEBoot_pci_device_t dev; + VasEBoot_port_t io; } framebuffer; -static grub_uint8_t -read_sis_cmd (grub_uint8_t addr) +static VasEBoot_uint8_t +read_sis_cmd (VasEBoot_uint8_t addr) { - grub_outb (addr, framebuffer.io + 0x44); - return grub_inb (framebuffer.io + 0x45); + VasEBoot_outb (addr, framebuffer.io + 0x44); + return VasEBoot_inb (framebuffer.io + 0x45); } static void -write_sis_cmd (grub_uint8_t val, grub_uint8_t addr) +write_sis_cmd (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_outb (addr, framebuffer.io + 0x44); - grub_outb (val, framebuffer.io + 0x45); + VasEBoot_outb (addr, framebuffer.io + 0x44); + VasEBoot_outb (val, framebuffer.io + 0x45); } #ifndef TEST -static grub_err_t -grub_video_sis315pro_video_init (void) +static VasEBoot_err_t +VasEBoot_video_sis315pro_video_init (void) { /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_sis315pro_video_fini (void) +static VasEBoot_err_t +VasEBoot_video_sis315pro_video_fini (void) { if (framebuffer.mapped) { - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, - GRUB_SIS315PRO_TOTAL_MEMORY_SPACE); - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.direct_ptr, - GRUB_SIS315PRO_TOTAL_MEMORY_SPACE); + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + VasEBoot_SIS315PRO_TOTAL_MEMORY_SPACE); + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.direct_ptr, + VasEBoot_SIS315PRO_TOTAL_MEMORY_SPACE); } - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } #endif #include "sis315_init.c" #ifndef TEST -/* Helper for grub_video_sis315pro_setup. */ +/* Helper for VasEBoot_video_sis315pro_setup. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { int *found = data; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); - if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA - || pciid != GRUB_SIS315PRO_PCIID) + if (((class >> 16) & 0xffff) != VasEBoot_PCI_CLASS_SUBCLASS_VGA + || pciid != VasEBoot_SIS315PRO_PCIID) return 0; *found = 1; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - framebuffer.base = grub_pci_read (addr) & GRUB_PCI_ADDR_MEM_MASK; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG1); - framebuffer.mmiobase = grub_pci_read (addr) & GRUB_PCI_ADDR_MEM_MASK; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG2); - framebuffer.io = (grub_pci_read (addr) & GRUB_PCI_ADDR_IO_MASK) - + GRUB_MACHINE_PCI_IO_BASE; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + framebuffer.base = VasEBoot_pci_read (addr) & VasEBoot_PCI_ADDR_MEM_MASK; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG1); + framebuffer.mmiobase = VasEBoot_pci_read (addr) & VasEBoot_PCI_ADDR_MEM_MASK; + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG2); + framebuffer.io = (VasEBoot_pci_read (addr) & VasEBoot_PCI_ADDR_IO_MASK) + + VasEBoot_MACHINE_PCI_IO_BASE; framebuffer.dev = dev; return 1; } #endif -static grub_err_t -grub_video_sis315pro_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_sis315pro_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) { int depth; - grub_err_t err; + VasEBoot_err_t err; int found = 0; unsigned i; #ifndef TEST /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if ((width != 640 && width != 0) || (height != 480 && height != 0) || (depth != 8 && depth != 0)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "Only 640x480x8 is supported"); - grub_pci_iterate (find_card, &found); + VasEBoot_pci_iterate (find_card, &found); if (!found) - return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find graphics card"); #endif /* Fill mode info details. */ framebuffer.mode_info.width = 640; framebuffer.mode_info.height = 480; - framebuffer.mode_info.mode_type = (GRUB_VIDEO_MODE_TYPE_INDEX_COLOR - | GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + framebuffer.mode_info.mode_type = (VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR + | VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); framebuffer.mode_info.bpp = 8; framebuffer.mode_info.bytes_per_pixel = 1; framebuffer.mode_info.pitch = 640 * 1; @@ -163,39 +163,39 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height, framebuffer.mode_info.reserved_field_pos = 0; #ifndef TEST framebuffer.mode_info.blit_format - = grub_video_get_blit_format (&framebuffer.mode_info); + = VasEBoot_video_get_blit_format (&framebuffer.mode_info); #endif #ifndef TEST if (found && (framebuffer.base == 0 || framebuffer.mmiobase == 0)) { - grub_pci_address_t addr; + VasEBoot_pci_address_t addr; /* FIXME: choose address dynamically if needed. */ framebuffer.base = 0x40000000; framebuffer.mmiobase = 0x04000000; framebuffer.io = 0xb300; - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_ADDRESS_REG0); - grub_pci_write (addr, framebuffer.base | GRUB_PCI_ADDR_MEM_PREFETCH); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_ADDRESS_REG0); + VasEBoot_pci_write (addr, framebuffer.base | VasEBoot_PCI_ADDR_MEM_PREFETCH); - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_ADDRESS_REG1); - grub_pci_write (addr, framebuffer.mmiobase); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_ADDRESS_REG1); + VasEBoot_pci_write (addr, framebuffer.mmiobase); - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_ADDRESS_REG2); - grub_pci_write (addr, framebuffer.io | GRUB_PCI_ADDR_SPACE_IO); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_ADDRESS_REG2); + VasEBoot_pci_write (addr, framebuffer.io | VasEBoot_PCI_ADDR_SPACE_IO); /* Set latency. */ - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_CACHELINE); - grub_pci_write (addr, 0x80004700); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_CACHELINE); + VasEBoot_pci_write (addr, 0x80004700); /* Enable address spaces. */ - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_COMMAND); - grub_pci_write (addr, 0x7); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write (addr, 0x7); - addr = grub_pci_make_address (framebuffer.dev, 0x30); - grub_pci_write (addr, 0x04060001); + addr = VasEBoot_pci_make_address (framebuffer.dev, 0x30); + VasEBoot_pci_write (addr, 0x04060001); - framebuffer.io += GRUB_MACHINE_PCI_IO_BASE; + framebuffer.io += VasEBoot_MACHINE_PCI_IO_BASE; } #endif @@ -203,133 +203,133 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height, /* We can safely discard volatile attribute. */ #ifndef TEST framebuffer.ptr - = grub_pci_device_map_range_cached (framebuffer.dev, + = VasEBoot_pci_device_map_range_cached (framebuffer.dev, framebuffer.base, - GRUB_SIS315PRO_TOTAL_MEMORY_SPACE); + VasEBoot_SIS315PRO_TOTAL_MEMORY_SPACE); framebuffer.direct_ptr - = grub_pci_device_map_range (framebuffer.dev, + = VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.base, - GRUB_SIS315PRO_TOTAL_MEMORY_SPACE); - framebuffer.mmioptr = grub_pci_device_map_range (framebuffer.dev, + VasEBoot_SIS315PRO_TOTAL_MEMORY_SPACE); + framebuffer.mmioptr = VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.mmiobase, - GRUB_SIS315PRO_MMIO_SPACE); + VasEBoot_SIS315PRO_MMIO_SPACE); #endif framebuffer.mapped = 1; #ifndef TEST /* Prevent garbage from appearing on the screen. */ - grub_memset (framebuffer.ptr, 0, + VasEBoot_memset (framebuffer.ptr, 0, framebuffer.mode_info.height * framebuffer.mode_info.pitch); - grub_arch_sync_dma_caches (framebuffer.ptr, + VasEBoot_arch_sync_dma_caches (framebuffer.ptr, framebuffer.mode_info.height * framebuffer.mode_info.pitch); #endif - grub_outb (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY - | GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY - | GRUB_VGA_IO_MISC_UPPER_64K - | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0 - | GRUB_VGA_IO_MISC_28MHZ - | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS - | GRUB_VGA_IO_MISC_COLOR, - GRUB_VGA_IO_MISC_WRITE + GRUB_MACHINE_PCI_IO_BASE); + VasEBoot_outb (VasEBoot_VGA_IO_MISC_NEGATIVE_VERT_POLARITY + | VasEBoot_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY + | VasEBoot_VGA_IO_MISC_UPPER_64K + | VasEBoot_VGA_IO_MISC_EXTERNAL_CLOCK_0 + | VasEBoot_VGA_IO_MISC_28MHZ + | VasEBoot_VGA_IO_MISC_ENABLE_VRAM_ACCESS + | VasEBoot_VGA_IO_MISC_COLOR, + VasEBoot_VGA_IO_MISC_WRITE + VasEBoot_MACHINE_PCI_IO_BASE); - grub_vga_sr_write (0x86, 5); + VasEBoot_vga_sr_write (0x86, 5); for (i = 6; i <= 0x27; i++) - grub_vga_sr_write (0, i); + VasEBoot_vga_sr_write (0, i); for (i = 0x31; i <= 0x3d; i++) - grub_vga_sr_write (0, i); + VasEBoot_vga_sr_write (0, i); for (i = 0; i < ARRAY_SIZE (sr_dump); i++) - grub_vga_sr_write (sr_dump[i].val, sr_dump[i].reg); + VasEBoot_vga_sr_write (sr_dump[i].val, sr_dump[i].reg); for (i = 0x30; i < 0x40; i++) - grub_vga_cr_write (0, i); + VasEBoot_vga_cr_write (0, i); - grub_vga_cr_write (0x77, 0x40); - grub_vga_cr_write (0x77, 0x41); - grub_vga_cr_write (0x00, 0x42); - grub_vga_cr_write (0x5b, 0x43); - grub_vga_cr_write (0x00, 0x44); - grub_vga_cr_write (0x23, 0x48); - grub_vga_cr_write (0xaa, 0x49); - grub_vga_cr_write (0x02, 0x37); - grub_vga_cr_write (0x20, 0x5b); - grub_vga_cr_write (0x00, 0x83); - grub_vga_cr_write (0x80, 0x63); + VasEBoot_vga_cr_write (0x77, 0x40); + VasEBoot_vga_cr_write (0x77, 0x41); + VasEBoot_vga_cr_write (0x00, 0x42); + VasEBoot_vga_cr_write (0x5b, 0x43); + VasEBoot_vga_cr_write (0x00, 0x44); + VasEBoot_vga_cr_write (0x23, 0x48); + VasEBoot_vga_cr_write (0xaa, 0x49); + VasEBoot_vga_cr_write (0x02, 0x37); + VasEBoot_vga_cr_write (0x20, 0x5b); + VasEBoot_vga_cr_write (0x00, 0x83); + VasEBoot_vga_cr_write (0x80, 0x63); - grub_vga_cr_write (0x0c, GRUB_VGA_CR_VSYNC_END); - grub_vga_cr_write (0x5f, GRUB_VGA_CR_HTOTAL); - grub_vga_cr_write (0x4f, GRUB_VGA_CR_HORIZ_END); - grub_vga_cr_write (0x50, GRUB_VGA_CR_HBLANK_START); - grub_vga_cr_write (0x82, GRUB_VGA_CR_HBLANK_END); - grub_vga_cr_write (0x54, GRUB_VGA_CR_HORIZ_SYNC_PULSE_START); - grub_vga_cr_write (0x80, GRUB_VGA_CR_HORIZ_SYNC_PULSE_END); - grub_vga_cr_write (0x0b, GRUB_VGA_CR_VERT_TOTAL); - grub_vga_cr_write (0x3e, GRUB_VGA_CR_OVERFLOW); - grub_vga_cr_write (0x00, GRUB_VGA_CR_BYTE_PANNING); - grub_vga_cr_write (0x40, GRUB_VGA_CR_CELL_HEIGHT); - grub_vga_cr_write (0x00, GRUB_VGA_CR_CURSOR_START); - grub_vga_cr_write (0x00, GRUB_VGA_CR_CURSOR_END); - grub_vga_cr_write (0x00, GRUB_VGA_CR_START_ADDR_HIGH_REGISTER); - grub_vga_cr_write (0x00, GRUB_VGA_CR_START_ADDR_LOW_REGISTER); - grub_vga_cr_write (0x00, GRUB_VGA_CR_CURSOR_ADDR_HIGH); - grub_vga_cr_write (0x00, GRUB_VGA_CR_CURSOR_ADDR_LOW); - grub_vga_cr_write (0xea, GRUB_VGA_CR_VSYNC_START); - grub_vga_cr_write (0x8c, GRUB_VGA_CR_VSYNC_END); - grub_vga_cr_write (0xdf, GRUB_VGA_CR_VDISPLAY_END); - grub_vga_cr_write (0x28, GRUB_VGA_CR_PITCH); - grub_vga_cr_write (0x40, GRUB_VGA_CR_UNDERLINE_LOCATION); - grub_vga_cr_write (0xe7, GRUB_VGA_CR_VERTICAL_BLANK_START); - grub_vga_cr_write (0x04, GRUB_VGA_CR_VERTICAL_BLANK_END); - grub_vga_cr_write (0xa3, GRUB_VGA_CR_MODE); - grub_vga_cr_write (0xff, GRUB_VGA_CR_LINE_COMPARE); + VasEBoot_vga_cr_write (0x0c, VasEBoot_VGA_CR_VSYNC_END); + VasEBoot_vga_cr_write (0x5f, VasEBoot_VGA_CR_HTOTAL); + VasEBoot_vga_cr_write (0x4f, VasEBoot_VGA_CR_HORIZ_END); + VasEBoot_vga_cr_write (0x50, VasEBoot_VGA_CR_HBLANK_START); + VasEBoot_vga_cr_write (0x82, VasEBoot_VGA_CR_HBLANK_END); + VasEBoot_vga_cr_write (0x54, VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_START); + VasEBoot_vga_cr_write (0x80, VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_END); + VasEBoot_vga_cr_write (0x0b, VasEBoot_VGA_CR_VERT_TOTAL); + VasEBoot_vga_cr_write (0x3e, VasEBoot_VGA_CR_OVERFLOW); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_BYTE_PANNING); + VasEBoot_vga_cr_write (0x40, VasEBoot_VGA_CR_CELL_HEIGHT); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_CURSOR_START); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_CURSOR_END); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_CURSOR_ADDR_HIGH); + VasEBoot_vga_cr_write (0x00, VasEBoot_VGA_CR_CURSOR_ADDR_LOW); + VasEBoot_vga_cr_write (0xea, VasEBoot_VGA_CR_VSYNC_START); + VasEBoot_vga_cr_write (0x8c, VasEBoot_VGA_CR_VSYNC_END); + VasEBoot_vga_cr_write (0xdf, VasEBoot_VGA_CR_VDISPLAY_END); + VasEBoot_vga_cr_write (0x28, VasEBoot_VGA_CR_PITCH); + VasEBoot_vga_cr_write (0x40, VasEBoot_VGA_CR_UNDERLINE_LOCATION); + VasEBoot_vga_cr_write (0xe7, VasEBoot_VGA_CR_VERTICAL_BLANK_START); + VasEBoot_vga_cr_write (0x04, VasEBoot_VGA_CR_VERTICAL_BLANK_END); + VasEBoot_vga_cr_write (0xa3, VasEBoot_VGA_CR_MODE); + VasEBoot_vga_cr_write (0xff, VasEBoot_VGA_CR_LINE_COMPARE); - grub_vga_cr_write (0x0c, GRUB_VGA_CR_VSYNC_END); - grub_vga_cr_write (0x5f, GRUB_VGA_CR_HTOTAL); - grub_vga_cr_write (0x4f, GRUB_VGA_CR_HORIZ_END); - grub_vga_cr_write (0x50, GRUB_VGA_CR_HBLANK_START); - grub_vga_cr_write (0x82, GRUB_VGA_CR_HBLANK_END); - grub_vga_cr_write (0x55, GRUB_VGA_CR_HORIZ_SYNC_PULSE_START); - grub_vga_cr_write (0x81, GRUB_VGA_CR_HORIZ_SYNC_PULSE_END); - grub_vga_cr_write (0x0b, GRUB_VGA_CR_VERT_TOTAL); - grub_vga_cr_write (0x3e, GRUB_VGA_CR_OVERFLOW); - grub_vga_cr_write (0xe9, GRUB_VGA_CR_VSYNC_START); - grub_vga_cr_write (0x8b, GRUB_VGA_CR_VSYNC_END); - grub_vga_cr_write (0xdf, GRUB_VGA_CR_VDISPLAY_END); - grub_vga_cr_write (0xe7, GRUB_VGA_CR_VERTICAL_BLANK_START); - grub_vga_cr_write (0x04, GRUB_VGA_CR_VERTICAL_BLANK_END); - grub_vga_cr_write (0x40, GRUB_VGA_CR_CELL_HEIGHT); - grub_vga_cr_write (0x50, GRUB_VGA_CR_PITCH); + VasEBoot_vga_cr_write (0x0c, VasEBoot_VGA_CR_VSYNC_END); + VasEBoot_vga_cr_write (0x5f, VasEBoot_VGA_CR_HTOTAL); + VasEBoot_vga_cr_write (0x4f, VasEBoot_VGA_CR_HORIZ_END); + VasEBoot_vga_cr_write (0x50, VasEBoot_VGA_CR_HBLANK_START); + VasEBoot_vga_cr_write (0x82, VasEBoot_VGA_CR_HBLANK_END); + VasEBoot_vga_cr_write (0x55, VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_START); + VasEBoot_vga_cr_write (0x81, VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_END); + VasEBoot_vga_cr_write (0x0b, VasEBoot_VGA_CR_VERT_TOTAL); + VasEBoot_vga_cr_write (0x3e, VasEBoot_VGA_CR_OVERFLOW); + VasEBoot_vga_cr_write (0xe9, VasEBoot_VGA_CR_VSYNC_START); + VasEBoot_vga_cr_write (0x8b, VasEBoot_VGA_CR_VSYNC_END); + VasEBoot_vga_cr_write (0xdf, VasEBoot_VGA_CR_VDISPLAY_END); + VasEBoot_vga_cr_write (0xe7, VasEBoot_VGA_CR_VERTICAL_BLANK_START); + VasEBoot_vga_cr_write (0x04, VasEBoot_VGA_CR_VERTICAL_BLANK_END); + VasEBoot_vga_cr_write (0x40, VasEBoot_VGA_CR_CELL_HEIGHT); + VasEBoot_vga_cr_write (0x50, VasEBoot_VGA_CR_PITCH); - grub_vga_cr_write (0x00, 0x19); - grub_vga_cr_write (0x00, 0x1a); - grub_vga_cr_write (0x6c, 0x52); - grub_vga_cr_write (0x2e, 0x34); - grub_vga_cr_write (0x00, 0x31); + VasEBoot_vga_cr_write (0x00, 0x19); + VasEBoot_vga_cr_write (0x00, 0x1a); + VasEBoot_vga_cr_write (0x6c, 0x52); + VasEBoot_vga_cr_write (0x2e, 0x34); + VasEBoot_vga_cr_write (0x00, 0x31); - grub_vga_cr_write (0, GRUB_VGA_CR_START_ADDR_HIGH_REGISTER); - grub_vga_cr_write (0, GRUB_VGA_CR_START_ADDR_LOW_REGISTER); + VasEBoot_vga_cr_write (0, VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER); + VasEBoot_vga_cr_write (0, VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER); for (i = 0; i < 16; i++) - grub_vga_write_arx (i, i); - grub_vga_write_arx (1, GRUB_VGA_ARX_MODE); - grub_vga_write_arx (0, GRUB_VGA_ARX_OVERSCAN); - grub_vga_write_arx (0, GRUB_VGA_ARX_COLOR_PLANE_ENABLE); - grub_vga_write_arx (0, GRUB_VGA_ARX_HORIZONTAL_PANNING); - grub_vga_write_arx (0, GRUB_VGA_ARX_COLOR_SELECT); + VasEBoot_vga_write_arx (i, i); + VasEBoot_vga_write_arx (1, VasEBoot_VGA_ARX_MODE); + VasEBoot_vga_write_arx (0, VasEBoot_VGA_ARX_OVERSCAN); + VasEBoot_vga_write_arx (0, VasEBoot_VGA_ARX_COLOR_PLANE_ENABLE); + VasEBoot_vga_write_arx (0, VasEBoot_VGA_ARX_HORIZONTAL_PANNING); + VasEBoot_vga_write_arx (0, VasEBoot_VGA_ARX_COLOR_SELECT); - grub_outb (0xff, GRUB_VGA_IO_PIXEL_MASK + GRUB_MACHINE_PCI_IO_BASE); + VasEBoot_outb (0xff, VasEBoot_VGA_IO_PIXEL_MASK + VasEBoot_MACHINE_PCI_IO_BASE); for (i = 0; i < ARRAY_SIZE (gr); i++) - grub_vga_gr_write (gr[i], i); + VasEBoot_vga_gr_write (gr[i], i); - for (i = 0; i < GRUB_VIDEO_FBSTD_NUMCOLORS; i++) - grub_vga_palette_write (i, grub_video_fbstd_colors[i].r, - grub_video_fbstd_colors[i].g, - grub_video_fbstd_colors[i].b); + for (i = 0; i < VasEBoot_VIDEO_FBSTD_NUMCOLORS; i++) + VasEBoot_vga_palette_write (i, VasEBoot_video_fbstd_colors[i].r, + VasEBoot_video_fbstd_colors[i].g, + VasEBoot_video_fbstd_colors[i].b); #if 1 { @@ -365,95 +365,95 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height, #endif #ifndef TEST - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.ptr, NULL, NULL); if (err) return err; /* Copy default palette to initialize emulated palette. */ - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_EXT_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS, + VasEBoot_video_fbstd_colors); #endif return err; } #ifndef TEST -static grub_err_t -grub_video_sis315pro_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_sis315pro_swap_buffers (void) { - grub_size_t s; + VasEBoot_size_t s; s = (framebuffer.mode_info.height * framebuffer.mode_info.pitch * framebuffer.mode_info.bytes_per_pixel); - grub_video_fb_swap_buffers (); - grub_arch_sync_dma_caches (framebuffer.ptr, s); - return GRUB_ERR_NONE; + VasEBoot_video_fb_swap_buffers (); + VasEBoot_arch_sync_dma_caches (framebuffer.ptr, s); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_sis315pro_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_sis315pro_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (void *) framebuffer.direct_ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_sis315pro_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_sis315pro_adapter = { .name = "SIS315PRO Video Driver", - .id = GRUB_VIDEO_DRIVER_SIS315PRO, + .id = VasEBoot_VIDEO_DRIVER_SIS315PRO, - .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE, - .init = grub_video_sis315pro_video_init, - .fini = grub_video_sis315pro_video_fini, - .setup = grub_video_sis315pro_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_sis315pro_get_info_and_fini, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_sis315pro_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_sis315pro_video_init, + .fini = VasEBoot_video_sis315pro_video_fini, + .setup = VasEBoot_video_sis315pro_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_sis315pro_get_info_and_fini, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_sis315pro_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(video_sis315pro) +VasEBoot_MOD_INIT(video_sis315pro) { - grub_video_register (&grub_video_sis315pro_adapter); + VasEBoot_video_register (&VasEBoot_video_sis315pro_adapter); } -GRUB_MOD_FINI(video_sis315pro) +VasEBoot_MOD_FINI(video_sis315pro) { - grub_video_unregister (&grub_video_sis315pro_adapter); + VasEBoot_video_unregister (&VasEBoot_video_sis315pro_adapter); } #else int main () { - grub_video_sis315pro_setup (640, 400, 0, 0); + VasEBoot_video_sis315pro_setup (640, 400, 0, 0); } #endif diff --git a/VasEBoot-core/video/sm712.c b/VasEBoot-core/video/sm712.c index 10c46eb65..5c44254c9 100644 --- a/VasEBoot-core/video/sm712.c +++ b/VasEBoot-core/video/sm712.c @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#define grub_video_render_target grub_video_fbrender_target +#define VasEBoot_video_render_target VasEBoot_video_fbrender_target #if !defined (TEST) && !defined(GENINIT) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #else -typedef unsigned char grub_uint8_t; -typedef unsigned short grub_uint16_t; -typedef unsigned int grub_uint32_t; -typedef int grub_err_t; -#include +typedef unsigned char VasEBoot_uint8_t; +typedef unsigned short VasEBoot_uint16_t; +typedef unsigned int VasEBoot_uint32_t; +typedef int VasEBoot_err_t; +#include #include #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) #endif @@ -43,143 +43,143 @@ typedef int grub_err_t; #pragma GCC diagnostic ignored "-Wcast-align" -#define GRUB_SM712_TOTAL_MEMORY_SPACE 0x700400 -#define GRUB_SM712_REG_BASE 0x700000 -#define GRUB_SM712_PCIID 0x0712126f +#define VasEBoot_SM712_TOTAL_MEMORY_SPACE 0x700400 +#define VasEBoot_SM712_REG_BASE 0x700000 +#define VasEBoot_SM712_PCIID 0x0712126f enum { - GRUB_SM712_SR_TV_CONTROL = 0x65, - GRUB_SM712_SR_RAM_LUT = 0x66, - GRUB_SM712_SR_CLOCK_CONTROL1 = 0x68, - GRUB_SM712_SR_CLOCK_CONTROL2 = 0x69, - GRUB_SM712_SR_VCLK_NUM = 0x6c, - GRUB_SM712_SR_VCLK_DENOM = 0x6d, - GRUB_SM712_SR_VCLK2_NUM = 0x6e, - GRUB_SM712_SR_VCLK2_DENOM = 0x6f, - GRUB_SM712_SR_POPUP_ICON_LOW = 0x80, - GRUB_SM712_SR_POPUP_ICON_HIGH = 0x81, - GRUB_SM712_SR_POPUP_ICON_CTRL = 0x82, - GRUB_SM712_SR_POPUP_ICON_COLOR1 = 0x84, - GRUB_SM712_SR_POPUP_ICON_COLOR2 = 0x85, - GRUB_SM712_SR_POPUP_ICON_COLOR3 = 0x86, + VasEBoot_SM712_SR_TV_CONTROL = 0x65, + VasEBoot_SM712_SR_RAM_LUT = 0x66, + VasEBoot_SM712_SR_CLOCK_CONTROL1 = 0x68, + VasEBoot_SM712_SR_CLOCK_CONTROL2 = 0x69, + VasEBoot_SM712_SR_VCLK_NUM = 0x6c, + VasEBoot_SM712_SR_VCLK_DENOM = 0x6d, + VasEBoot_SM712_SR_VCLK2_NUM = 0x6e, + VasEBoot_SM712_SR_VCLK2_DENOM = 0x6f, + VasEBoot_SM712_SR_POPUP_ICON_LOW = 0x80, + VasEBoot_SM712_SR_POPUP_ICON_HIGH = 0x81, + VasEBoot_SM712_SR_POPUP_ICON_CTRL = 0x82, + VasEBoot_SM712_SR_POPUP_ICON_COLOR1 = 0x84, + VasEBoot_SM712_SR_POPUP_ICON_COLOR2 = 0x85, + VasEBoot_SM712_SR_POPUP_ICON_COLOR3 = 0x86, - GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_LOW = 0x88, - GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_HIGH = 0x89, - GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_LOW = 0x8a, - GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_HIGH = 0x8b, - GRUB_SM712_SR_HW_CURSOR_FG_COLOR = 0x8c, - GRUB_SM712_SR_HW_CURSOR_BG_COLOR = 0x8d, + VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_X_LOW = 0x88, + VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_X_HIGH = 0x89, + VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_LOW = 0x8a, + VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_HIGH = 0x8b, + VasEBoot_SM712_SR_HW_CURSOR_FG_COLOR = 0x8c, + VasEBoot_SM712_SR_HW_CURSOR_BG_COLOR = 0x8d, - GRUB_SM712_SR_POPUP_ICON_X_LOW = 0x90, - GRUB_SM712_SR_POPUP_ICON_X_HIGH = 0x91, - GRUB_SM712_SR_POPUP_ICON_Y_LOW = 0x92, - GRUB_SM712_SR_POPUP_ICON_Y_HIGH = 0x93, - GRUB_SM712_SR_PANEL_HW_VIDEO_CONTROL = 0xa0, - GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_LOW = 0xa1, - GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_HIGH = 0xa2, - GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_LOW = 0xa3, - GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_HIGH = 0xa4, - GRUB_SM712_SR_PANEL_HW_VIDEO_RED_CONSTANT = 0xa5, - GRUB_SM712_SR_PANEL_HW_VIDEO_GREEN_CONSTANT = 0xa6, - GRUB_SM712_SR_PANEL_HW_VIDEO_BLUE_CONSTANT = 0xa7, - GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_BOUNDARY = 0xa8, - GRUB_SM712_SR_PANEL_HW_VIDEO_LEFT_BOUNDARY = 0xa9, - GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_BOUNDARY = 0xaa, - GRUB_SM712_SR_PANEL_HW_VIDEO_RIGHT_BOUNDARY = 0xab, - GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_LEFT_OVERFLOW_BOUNDARY = 0xac, - GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_RIGHT_OVERFLOW_BOUNDARY = 0xad, - GRUB_SM712_SR_PANEL_HW_VIDEO_VERTICAL_STRETCH_FACTOR = 0xae, - GRUB_SM712_SR_PANEL_HW_VIDEO_HORIZONTAL_STRETCH_FACTOR = 0xaf, + VasEBoot_SM712_SR_POPUP_ICON_X_LOW = 0x90, + VasEBoot_SM712_SR_POPUP_ICON_X_HIGH = 0x91, + VasEBoot_SM712_SR_POPUP_ICON_Y_LOW = 0x92, + VasEBoot_SM712_SR_POPUP_ICON_Y_HIGH = 0x93, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_CONTROL = 0xa0, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_LOW = 0xa1, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_HIGH = 0xa2, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_LOW = 0xa3, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_HIGH = 0xa4, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_RED_CONSTANT = 0xa5, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_GREEN_CONSTANT = 0xa6, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_BLUE_CONSTANT = 0xa7, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_TOP_BOUNDARY = 0xa8, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_LEFT_BOUNDARY = 0xa9, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_BOTTOM_BOUNDARY = 0xaa, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_RIGHT_BOUNDARY = 0xab, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_TOP_LEFT_OVERFLOW_BOUNDARY = 0xac, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_BOTTOM_RIGHT_OVERFLOW_BOUNDARY = 0xad, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_VERTICAL_STRETCH_FACTOR = 0xae, + VasEBoot_SM712_SR_PANEL_HW_VIDEO_HORIZONTAL_STRETCH_FACTOR = 0xaf, }; enum { - GRUB_SM712_SR_TV_CRT_SRAM = 0x00, - GRUB_SM712_SR_TV_LCD_SRAM = 0x08 + VasEBoot_SM712_SR_TV_CRT_SRAM = 0x00, + VasEBoot_SM712_SR_TV_LCD_SRAM = 0x08 }; enum { - GRUB_SM712_SR_TV_ALT_CLOCK = 0x00, - GRUB_SM712_SR_TV_FREE_RUN_CLOCK = 0x04 + VasEBoot_SM712_SR_TV_ALT_CLOCK = 0x00, + VasEBoot_SM712_SR_TV_FREE_RUN_CLOCK = 0x04 }; enum { - GRUB_SM712_SR_TV_CLOCK_CKIN_NTSC = 0x00, - GRUB_SM712_SR_TV_CLOCK_REFCLK_PAL = 0x04 + VasEBoot_SM712_SR_TV_CLOCK_CKIN_NTSC = 0x00, + VasEBoot_SM712_SR_TV_CLOCK_REFCLK_PAL = 0x04 }; enum { - GRUB_SM712_SR_TV_HSYNC = 0x00, - GRUB_SM712_SR_TV_COMPOSITE_HSYNC = 0x01 + VasEBoot_SM712_SR_TV_HSYNC = 0x00, + VasEBoot_SM712_SR_TV_COMPOSITE_HSYNC = 0x01 }; enum { - GRUB_SM712_SR_RAM_LUT_NORMAL = 0, - GRUB_SM712_SR_RAM_LUT_LCD_RAM_OFF = 0x80, - GRUB_SM712_SR_RAM_LUT_CRT_RAM_OFF = 0x40, - GRUB_SM712_SR_RAM_LUT_LCD_RAM_NO_WRITE = 0x20, - GRUB_SM712_SR_RAM_LUT_CRT_RAM_NO_WRITE = 0x10, - GRUB_SM712_SR_RAM_LUT_CRT_8BIT = 0x08, - GRUB_SM712_SR_RAM_LUT_CRT_GAMMA = 0x04 + VasEBoot_SM712_SR_RAM_LUT_NORMAL = 0, + VasEBoot_SM712_SR_RAM_LUT_LCD_RAM_OFF = 0x80, + VasEBoot_SM712_SR_RAM_LUT_CRT_RAM_OFF = 0x40, + VasEBoot_SM712_SR_RAM_LUT_LCD_RAM_NO_WRITE = 0x20, + VasEBoot_SM712_SR_RAM_LUT_CRT_RAM_NO_WRITE = 0x10, + VasEBoot_SM712_SR_RAM_LUT_CRT_8BIT = 0x08, + VasEBoot_SM712_SR_RAM_LUT_CRT_GAMMA = 0x04 }; enum { - GRUB_SM712_SR_CLOCK_CONTROL1_VCLK_FROM_CCR = 0x40, - GRUB_SM712_SR_CLOCK_CONTROL1_8DOT_CLOCK = 0x10, + VasEBoot_SM712_SR_CLOCK_CONTROL1_VCLK_FROM_CCR = 0x40, + VasEBoot_SM712_SR_CLOCK_CONTROL1_8DOT_CLOCK = 0x10, }; enum { - GRUB_SM712_SR_CLOCK_CONTROL2_PROGRAM_VCLOCK = 0x03 + VasEBoot_SM712_SR_CLOCK_CONTROL2_PROGRAM_VCLOCK = 0x03 }; -#define GRUB_SM712_SR_POPUP_ICON_HIGH_MASK 0x7 -#define GRUB_SM712_SR_POPUP_ICON_HIGH_HW_CURSOR_EN 0x80 +#define VasEBoot_SM712_SR_POPUP_ICON_HIGH_MASK 0x7 +#define VasEBoot_SM712_SR_POPUP_ICON_HIGH_HW_CURSOR_EN 0x80 enum { - GRUB_SM712_SR_POPUP_ICON_CTRL_DISABLED = 0, - GRUB_SM712_SR_POPUP_ICON_CTRL_ZOOM_ENABLED = 0x40, - GRUB_SM712_SR_POPUP_ICON_CTRL_ENABLED = 0x80 + VasEBoot_SM712_SR_POPUP_ICON_CTRL_DISABLED = 0, + VasEBoot_SM712_SR_POPUP_ICON_CTRL_ZOOM_ENABLED = 0x40, + VasEBoot_SM712_SR_POPUP_ICON_CTRL_ENABLED = 0x80 }; #define RGB332_BLACK 0 #define RGB332_WHITE 0xff enum { - GRUB_SM712_CR_OVERFLOW_INTERLACE = 0x30, - GRUB_SM712_CR_INTERLACE_RETRACE = 0x31, - GRUB_SM712_CR_TV_VDISPLAY_START = 0x32, - GRUB_SM712_CR_TV_VDISPLAY_END_HIGH = 0x33, - GRUB_SM712_CR_TV_VDISPLAY_END_LOW = 0x34, - GRUB_SM712_CR_DDA_CONTROL_LOW = 0x35, - GRUB_SM712_CR_DDA_CONTROL_HIGH = 0x36, - GRUB_SM712_CR_TV_EQUALIZER = 0x38, - GRUB_SM712_CR_TV_SERRATION = 0x39, - GRUB_SM712_CR_HSYNC_CTRL = 0x3a, - GRUB_SM712_CR_DEBUG = 0x3c, - GRUB_SM712_CR_SHADOW_VGA_HTOTAL = 0x40, - GRUB_SM712_CR_SHADOW_VGA_HBLANK_START = 0x41, - GRUB_SM712_CR_SHADOW_VGA_HBLANK_END = 0x42, - GRUB_SM712_CR_SHADOW_VGA_HRETRACE_START = 0x43, - GRUB_SM712_CR_SHADOW_VGA_HRETRACE_END = 0x44, - GRUB_SM712_CR_SHADOW_VGA_VERTICAL_TOTAL = 0x45, - GRUB_SM712_CR_SHADOW_VGA_VBLANK_START = 0x46, - GRUB_SM712_CR_SHADOW_VGA_VBLANK_END = 0x47, - GRUB_SM712_CR_SHADOW_VGA_VRETRACE_START = 0x48, - GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49, - GRUB_SM712_CR_SHADOW_VGA_OVERFLOW = 0x4a, - GRUB_SM712_CR_SHADOW_VGA_CELL_HEIGHT = 0x4b, - GRUB_SM712_CR_SHADOW_VGA_HDISPLAY_END = 0x4c, - GRUB_SM712_CR_SHADOW_VGA_VDISPLAY_END = 0x4d, - GRUB_SM712_CR_DDA_LOOKUP_REG3_START = 0x90, - GRUB_SM712_CR_DDA_LOOKUP_REG2_START = 0x91, - GRUB_SM712_CR_DDA_LOOKUP_REG1_START = 0xa0, - GRUB_SM712_CR_VCENTERING_OFFSET = 0xa6, - GRUB_SM712_CR_HCENTERING_OFFSET = 0xa7, + VasEBoot_SM712_CR_OVERFLOW_INTERLACE = 0x30, + VasEBoot_SM712_CR_INTERLACE_RETRACE = 0x31, + VasEBoot_SM712_CR_TV_VDISPLAY_START = 0x32, + VasEBoot_SM712_CR_TV_VDISPLAY_END_HIGH = 0x33, + VasEBoot_SM712_CR_TV_VDISPLAY_END_LOW = 0x34, + VasEBoot_SM712_CR_DDA_CONTROL_LOW = 0x35, + VasEBoot_SM712_CR_DDA_CONTROL_HIGH = 0x36, + VasEBoot_SM712_CR_TV_EQUALIZER = 0x38, + VasEBoot_SM712_CR_TV_SERRATION = 0x39, + VasEBoot_SM712_CR_HSYNC_CTRL = 0x3a, + VasEBoot_SM712_CR_DEBUG = 0x3c, + VasEBoot_SM712_CR_SHADOW_VGA_HTOTAL = 0x40, + VasEBoot_SM712_CR_SHADOW_VGA_HBLANK_START = 0x41, + VasEBoot_SM712_CR_SHADOW_VGA_HBLANK_END = 0x42, + VasEBoot_SM712_CR_SHADOW_VGA_HRETRACE_START = 0x43, + VasEBoot_SM712_CR_SHADOW_VGA_HRETRACE_END = 0x44, + VasEBoot_SM712_CR_SHADOW_VGA_VERTICAL_TOTAL = 0x45, + VasEBoot_SM712_CR_SHADOW_VGA_VBLANK_START = 0x46, + VasEBoot_SM712_CR_SHADOW_VGA_VBLANK_END = 0x47, + VasEBoot_SM712_CR_SHADOW_VGA_VRETRACE_START = 0x48, + VasEBoot_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49, + VasEBoot_SM712_CR_SHADOW_VGA_OVERFLOW = 0x4a, + VasEBoot_SM712_CR_SHADOW_VGA_CELL_HEIGHT = 0x4b, + VasEBoot_SM712_CR_SHADOW_VGA_HDISPLAY_END = 0x4c, + VasEBoot_SM712_CR_SHADOW_VGA_VDISPLAY_END = 0x4d, + VasEBoot_SM712_CR_DDA_LOOKUP_REG3_START = 0x90, + VasEBoot_SM712_CR_DDA_LOOKUP_REG2_START = 0x91, + VasEBoot_SM712_CR_DDA_LOOKUP_REG1_START = 0xa0, + VasEBoot_SM712_CR_VCENTERING_OFFSET = 0xa6, + VasEBoot_SM712_CR_HCENTERING_OFFSET = 0xa7, }; -#define GRUB_SM712_CR_DEBUG_NONE 0 +#define VasEBoot_SM712_CR_DEBUG_NONE 0 #define SM712_DDA_REG3_COMPARE_SHIFT 2 #define SM712_DDA_REG3_COMPARE_MASK 0xfc @@ -190,9 +190,9 @@ enum static struct { - grub_uint8_t compare; - grub_uint16_t dda; - grub_uint8_t vcentering; + VasEBoot_uint8_t compare; + VasEBoot_uint16_t dda; + VasEBoot_uint8_t vcentering; } dda_lookups[] = { { 21, 469, 2}, { 23, 477, 2}, @@ -205,44 +205,44 @@ static struct static struct { #if !defined (TEST) && !defined(GENINIT) - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; #endif - volatile grub_uint8_t *ptr; - grub_uint8_t *cached_ptr; + volatile VasEBoot_uint8_t *ptr; + VasEBoot_uint8_t *cached_ptr; int mapped; - grub_uint32_t base; + VasEBoot_uint32_t base; #if !defined (TEST) && !defined(GENINIT) - grub_pci_device_t dev; + VasEBoot_pci_device_t dev; #endif } framebuffer; #if !defined (TEST) && !defined(GENINIT) -static grub_err_t -grub_video_sm712_video_init (void) +static VasEBoot_err_t +VasEBoot_video_sm712_video_init (void) { /* Reset frame buffer. */ - grub_memset (&framebuffer, 0, sizeof(framebuffer)); + VasEBoot_memset (&framebuffer, 0, sizeof(framebuffer)); - return grub_video_fb_init (); + return VasEBoot_video_fb_init (); } -static grub_err_t -grub_video_sm712_video_fini (void) +static VasEBoot_err_t +VasEBoot_video_sm712_video_fini (void) { if (framebuffer.mapped) { - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, - GRUB_SM712_TOTAL_MEMORY_SPACE); - grub_pci_device_unmap_range (framebuffer.dev, framebuffer.cached_ptr, - GRUB_SM712_TOTAL_MEMORY_SPACE); + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + VasEBoot_SM712_TOTAL_MEMORY_SPACE); + VasEBoot_pci_device_unmap_range (framebuffer.dev, framebuffer.cached_ptr, + VasEBoot_SM712_TOTAL_MEMORY_SPACE); } - return grub_video_fb_fini (); + return VasEBoot_video_fb_fini (); } #endif static inline void -grub_sm712_write_reg (grub_uint8_t val, grub_uint16_t addr) +VasEBoot_sm712_write_reg (VasEBoot_uint8_t val, VasEBoot_uint16_t addr) { #ifdef TEST printf (" {1, 0x%x, 0x%x},\n", addr, val); @@ -251,13 +251,13 @@ grub_sm712_write_reg (grub_uint8_t val, grub_uint16_t addr) if ((addr - 0x3c0) & ~0x7f) printf ("FAIL\n"); #else - *(volatile grub_uint8_t *) (framebuffer.ptr + GRUB_SM712_REG_BASE + *(volatile VasEBoot_uint8_t *) (framebuffer.ptr + VasEBoot_SM712_REG_BASE + addr) = val; #endif } -static inline grub_uint8_t -grub_sm712_read_reg (grub_uint16_t addr) +static inline VasEBoot_uint8_t +VasEBoot_sm712_read_reg (VasEBoot_uint16_t addr) { #ifdef TEST printf (" {-1, 0x%x, 0x5},\n", addr); @@ -266,154 +266,154 @@ grub_sm712_read_reg (grub_uint16_t addr) printf ("FAIL\n"); printf (" .byte 0x%04x, 0x00\n", (addr - 0x3c0) | 0x80); #else - return *(volatile grub_uint8_t *) (framebuffer.ptr + GRUB_SM712_REG_BASE + return *(volatile VasEBoot_uint8_t *) (framebuffer.ptr + VasEBoot_SM712_REG_BASE + addr); #endif } -static inline grub_uint8_t -grub_sm712_sr_read (grub_uint8_t addr) +static inline VasEBoot_uint8_t +VasEBoot_sm712_sr_read (VasEBoot_uint8_t addr) { - grub_sm712_write_reg (addr, GRUB_VGA_IO_SR_INDEX); - return grub_sm712_read_reg (GRUB_VGA_IO_SR_DATA); + VasEBoot_sm712_write_reg (addr, VasEBoot_VGA_IO_SR_INDEX); + return VasEBoot_sm712_read_reg (VasEBoot_VGA_IO_SR_DATA); } static inline void -grub_sm712_sr_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_sm712_sr_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_sm712_write_reg (addr, GRUB_VGA_IO_SR_INDEX); - grub_sm712_write_reg (val, GRUB_VGA_IO_SR_DATA); + VasEBoot_sm712_write_reg (addr, VasEBoot_VGA_IO_SR_INDEX); + VasEBoot_sm712_write_reg (val, VasEBoot_VGA_IO_SR_DATA); } static inline void -grub_sm712_gr_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_sm712_gr_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_sm712_write_reg (addr, GRUB_VGA_IO_GR_INDEX); - grub_sm712_write_reg (val, GRUB_VGA_IO_GR_DATA); + VasEBoot_sm712_write_reg (addr, VasEBoot_VGA_IO_GR_INDEX); + VasEBoot_sm712_write_reg (val, VasEBoot_VGA_IO_GR_DATA); } static inline void -grub_sm712_cr_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_sm712_cr_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_sm712_write_reg (addr, GRUB_VGA_IO_CR_INDEX); - grub_sm712_write_reg (val, GRUB_VGA_IO_CR_DATA); + VasEBoot_sm712_write_reg (addr, VasEBoot_VGA_IO_CR_INDEX); + VasEBoot_sm712_write_reg (val, VasEBoot_VGA_IO_CR_DATA); } static inline void -grub_sm712_write_arx (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_sm712_write_arx (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_sm712_read_reg (GRUB_VGA_IO_INPUT_STATUS1_REGISTER); - grub_sm712_write_reg (addr, GRUB_VGA_IO_ARX); - grub_sm712_read_reg (GRUB_VGA_IO_ARX_READ); - grub_sm712_write_reg (val, GRUB_VGA_IO_ARX); + VasEBoot_sm712_read_reg (VasEBoot_VGA_IO_INPUT_STATUS1_REGISTER); + VasEBoot_sm712_write_reg (addr, VasEBoot_VGA_IO_ARX); + VasEBoot_sm712_read_reg (VasEBoot_VGA_IO_ARX_READ); + VasEBoot_sm712_write_reg (val, VasEBoot_VGA_IO_ARX); } static inline void -grub_sm712_cr_shadow_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_sm712_cr_shadow_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_uint8_t mapping[] = + VasEBoot_uint8_t mapping[] = { - [GRUB_VGA_CR_HTOTAL] = GRUB_SM712_CR_SHADOW_VGA_HTOTAL, - [GRUB_VGA_CR_HORIZ_END] = 0xff, - [GRUB_VGA_CR_HBLANK_START] = GRUB_SM712_CR_SHADOW_VGA_HBLANK_START, - [GRUB_VGA_CR_HBLANK_END] = GRUB_SM712_CR_SHADOW_VGA_HBLANK_END, - [GRUB_VGA_CR_HORIZ_SYNC_PULSE_START] = GRUB_SM712_CR_SHADOW_VGA_HRETRACE_START, - [GRUB_VGA_CR_HORIZ_SYNC_PULSE_END] = GRUB_SM712_CR_SHADOW_VGA_HRETRACE_END, - [GRUB_VGA_CR_VERT_TOTAL] = GRUB_SM712_CR_SHADOW_VGA_VERTICAL_TOTAL, - [GRUB_VGA_CR_OVERFLOW] = GRUB_SM712_CR_SHADOW_VGA_OVERFLOW, - [GRUB_VGA_CR_BYTE_PANNING] = 0xff, - [GRUB_VGA_CR_CELL_HEIGHT] = GRUB_SM712_CR_SHADOW_VGA_CELL_HEIGHT, - [GRUB_VGA_CR_CURSOR_START] = 0xff, - [GRUB_VGA_CR_CURSOR_END] = 0xff, - [GRUB_VGA_CR_START_ADDR_HIGH_REGISTER] = 0xff, - [GRUB_VGA_CR_START_ADDR_LOW_REGISTER] = 0xff, - [GRUB_VGA_CR_CURSOR_ADDR_HIGH] = 0xff, - [GRUB_VGA_CR_CURSOR_ADDR_LOW] = 0xff, - [GRUB_VGA_CR_VSYNC_START] = GRUB_SM712_CR_SHADOW_VGA_VRETRACE_START, - [GRUB_VGA_CR_VSYNC_END] = GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END, - [GRUB_VGA_CR_VDISPLAY_END] = GRUB_SM712_CR_SHADOW_VGA_VDISPLAY_END, - [GRUB_VGA_CR_PITCH] = GRUB_SM712_CR_SHADOW_VGA_HDISPLAY_END, - [GRUB_VGA_CR_UNDERLINE_LOCATION] = 0xff, + [VasEBoot_VGA_CR_HTOTAL] = VasEBoot_SM712_CR_SHADOW_VGA_HTOTAL, + [VasEBoot_VGA_CR_HORIZ_END] = 0xff, + [VasEBoot_VGA_CR_HBLANK_START] = VasEBoot_SM712_CR_SHADOW_VGA_HBLANK_START, + [VasEBoot_VGA_CR_HBLANK_END] = VasEBoot_SM712_CR_SHADOW_VGA_HBLANK_END, + [VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_START] = VasEBoot_SM712_CR_SHADOW_VGA_HRETRACE_START, + [VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_END] = VasEBoot_SM712_CR_SHADOW_VGA_HRETRACE_END, + [VasEBoot_VGA_CR_VERT_TOTAL] = VasEBoot_SM712_CR_SHADOW_VGA_VERTICAL_TOTAL, + [VasEBoot_VGA_CR_OVERFLOW] = VasEBoot_SM712_CR_SHADOW_VGA_OVERFLOW, + [VasEBoot_VGA_CR_BYTE_PANNING] = 0xff, + [VasEBoot_VGA_CR_CELL_HEIGHT] = VasEBoot_SM712_CR_SHADOW_VGA_CELL_HEIGHT, + [VasEBoot_VGA_CR_CURSOR_START] = 0xff, + [VasEBoot_VGA_CR_CURSOR_END] = 0xff, + [VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER] = 0xff, + [VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER] = 0xff, + [VasEBoot_VGA_CR_CURSOR_ADDR_HIGH] = 0xff, + [VasEBoot_VGA_CR_CURSOR_ADDR_LOW] = 0xff, + [VasEBoot_VGA_CR_VSYNC_START] = VasEBoot_SM712_CR_SHADOW_VGA_VRETRACE_START, + [VasEBoot_VGA_CR_VSYNC_END] = VasEBoot_SM712_CR_SHADOW_VGA_VRETRACE_END, + [VasEBoot_VGA_CR_VDISPLAY_END] = VasEBoot_SM712_CR_SHADOW_VGA_VDISPLAY_END, + [VasEBoot_VGA_CR_PITCH] = VasEBoot_SM712_CR_SHADOW_VGA_HDISPLAY_END, + [VasEBoot_VGA_CR_UNDERLINE_LOCATION] = 0xff, - [GRUB_VGA_CR_VERTICAL_BLANK_START] = GRUB_SM712_CR_SHADOW_VGA_VBLANK_START, - [GRUB_VGA_CR_VERTICAL_BLANK_END] = GRUB_SM712_CR_SHADOW_VGA_VBLANK_END, - [GRUB_VGA_CR_MODE] = 0xff, - [GRUB_VGA_CR_LINE_COMPARE] = 0xff + [VasEBoot_VGA_CR_VERTICAL_BLANK_START] = VasEBoot_SM712_CR_SHADOW_VGA_VBLANK_START, + [VasEBoot_VGA_CR_VERTICAL_BLANK_END] = VasEBoot_SM712_CR_SHADOW_VGA_VBLANK_END, + [VasEBoot_VGA_CR_MODE] = 0xff, + [VasEBoot_VGA_CR_LINE_COMPARE] = 0xff }; if (addr >= ARRAY_SIZE (mapping) || mapping[addr] == 0xff) return; - grub_sm712_cr_write (val, mapping[addr]); + VasEBoot_sm712_cr_write (val, mapping[addr]); } static inline void -grub_sm712_write_dda_lookup (int idx, grub_uint8_t compare, grub_uint16_t dda, - grub_uint8_t vcentering) +VasEBoot_sm712_write_dda_lookup (int idx, VasEBoot_uint8_t compare, VasEBoot_uint16_t dda, + VasEBoot_uint8_t vcentering) { - grub_sm712_cr_write (((compare << SM712_DDA_REG3_COMPARE_SHIFT) + VasEBoot_sm712_cr_write (((compare << SM712_DDA_REG3_COMPARE_SHIFT) & SM712_DDA_REG3_COMPARE_MASK) | ((dda >> SM712_DDA_REG3_DDA_SHIFT) & SM712_DDA_REG3_DDA_MASK), - GRUB_SM712_CR_DDA_LOOKUP_REG3_START + 2 * idx); - grub_sm712_cr_write (dda & SM712_DDA_REG2_DDA_MASK, - GRUB_SM712_CR_DDA_LOOKUP_REG2_START + 2 * idx); - grub_sm712_cr_write (vcentering & SM712_DDA_REG2_VCENTER_MASK, - GRUB_SM712_CR_DDA_LOOKUP_REG1_START + idx); + VasEBoot_SM712_CR_DDA_LOOKUP_REG3_START + 2 * idx); + VasEBoot_sm712_cr_write (dda & SM712_DDA_REG2_DDA_MASK, + VasEBoot_SM712_CR_DDA_LOOKUP_REG2_START + 2 * idx); + VasEBoot_sm712_cr_write (vcentering & SM712_DDA_REG2_VCENTER_MASK, + VasEBoot_SM712_CR_DDA_LOOKUP_REG1_START + idx); } #if !defined (TEST) && !defined(GENINIT) -/* Helper for grub_video_sm712_setup. */ +/* Helper for VasEBoot_video_sm712_setup. */ static int -find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) +find_card (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data) { int *found = data; - grub_pci_address_t addr; - grub_uint32_t class; + VasEBoot_pci_address_t addr; + VasEBoot_uint32_t class; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); - class = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_CLASS); + class = VasEBoot_pci_read (addr); - if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA - || pciid != GRUB_SM712_PCIID) + if (((class >> 16) & 0xffff) != VasEBoot_PCI_CLASS_SUBCLASS_VGA + || pciid != VasEBoot_SM712_PCIID) return 0; *found = 1; - addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); - framebuffer.base = grub_pci_read (addr); + addr = VasEBoot_pci_make_address (dev, VasEBoot_PCI_REG_ADDRESS_REG0); + framebuffer.base = VasEBoot_pci_read (addr); framebuffer.dev = dev; return 1; } #endif -static grub_err_t -grub_video_sm712_setup (unsigned int width, unsigned int height, +static VasEBoot_err_t +VasEBoot_video_sm712_setup (unsigned int width, unsigned int height, unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) { unsigned i; #if !defined (TEST) && !defined(GENINIT) int depth; - grub_err_t err; + VasEBoot_err_t err; int found = 0; /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + depth = (mode_type & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + >> VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS; if ((width != 1024 && width != 0) || (height != 600 && height != 0) || (depth != 16 && depth != 0)) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return VasEBoot_error (VasEBoot_ERR_NOT_IMPLEMENTED_YET, "Only 1024x600x16 is supported"); - grub_pci_iterate (find_card, &found); + VasEBoot_pci_iterate (find_card, &found); if (!found) - return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); + return VasEBoot_error (VasEBoot_ERR_IO, "Couldn't find graphics card"); /* Fill mode info details. */ framebuffer.mode_info.width = 1024; framebuffer.mode_info.height = 600; - framebuffer.mode_info.mode_type = (GRUB_VIDEO_MODE_TYPE_RGB - | GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED - | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP); + framebuffer.mode_info.mode_type = (VasEBoot_VIDEO_MODE_TYPE_RGB + | VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED + | VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP); framebuffer.mode_info.bpp = 16; framebuffer.mode_info.bytes_per_pixel = 2; framebuffer.mode_info.pitch = 1024 * 2; @@ -427,201 +427,201 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, framebuffer.mode_info.reserved_mask_size = 0; framebuffer.mode_info.reserved_field_pos = 0; framebuffer.mode_info.blit_format - = grub_video_get_blit_format (&framebuffer.mode_info); + = VasEBoot_video_get_blit_format (&framebuffer.mode_info); #endif #if !defined (TEST) && !defined(GENINIT) if (found && framebuffer.base == 0) { - grub_pci_address_t addr; + VasEBoot_pci_address_t addr; /* FIXME: choose address dynamically if needed. */ framebuffer.base = 0x04000000; - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_ADDRESS_REG0); - grub_pci_write (addr, framebuffer.base); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_ADDRESS_REG0); + VasEBoot_pci_write (addr, framebuffer.base); /* Set latency. */ - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_CACHELINE); - grub_pci_write (addr, 0x8); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_CACHELINE); + VasEBoot_pci_write (addr, 0x8); /* Enable address spaces. */ - addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_COMMAND); - grub_pci_write (addr, 0x7); + addr = VasEBoot_pci_make_address (framebuffer.dev, VasEBoot_PCI_REG_COMMAND); + VasEBoot_pci_write (addr, 0x7); } #endif /* We can safely discard volatile attribute. */ #if !defined (TEST) && !defined(GENINIT) framebuffer.ptr - = grub_pci_device_map_range (framebuffer.dev, + = VasEBoot_pci_device_map_range (framebuffer.dev, framebuffer.base, - GRUB_SM712_TOTAL_MEMORY_SPACE); + VasEBoot_SM712_TOTAL_MEMORY_SPACE); framebuffer.cached_ptr - = grub_pci_device_map_range_cached (framebuffer.dev, + = VasEBoot_pci_device_map_range_cached (framebuffer.dev, framebuffer.base, - GRUB_SM712_TOTAL_MEMORY_SPACE); + VasEBoot_SM712_TOTAL_MEMORY_SPACE); #endif framebuffer.mapped = 1; /* Initialise SM712. */ #if !defined (TEST) && !defined(GENINIT) /* FIXME */ - grub_vga_sr_write (0x11, 0x18); + VasEBoot_vga_sr_write (0x11, 0x18); #endif #if !defined (TEST) && !defined(GENINIT) /* Prevent garbage from appearing on the screen. */ - grub_memset ((void *) framebuffer.cached_ptr, 0, + VasEBoot_memset ((void *) framebuffer.cached_ptr, 0, framebuffer.mode_info.height * framebuffer.mode_info.pitch); #endif /* FIXME */ - grub_sm712_sr_write (0, 0x21); - grub_sm712_sr_write (0x7a, 0x62); - grub_sm712_sr_write (0x16, 0x6a); - grub_sm712_sr_write (0x2, 0x6b); - grub_sm712_write_reg (0, GRUB_VGA_IO_PIXEL_MASK); - grub_sm712_sr_write (GRUB_VGA_SR_RESET_ASYNC, GRUB_VGA_SR_RESET); - grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY - | GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY - | GRUB_VGA_IO_MISC_UPPER_64K - | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0 - | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS - | GRUB_VGA_IO_MISC_COLOR, GRUB_VGA_IO_MISC_WRITE); - grub_sm712_sr_write (GRUB_VGA_SR_RESET_ASYNC | GRUB_VGA_SR_RESET_SYNC, - GRUB_VGA_SR_RESET); - grub_sm712_sr_write (GRUB_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK, - GRUB_VGA_SR_CLOCKING_MODE); - grub_sm712_sr_write (GRUB_VGA_ALL_PLANES, GRUB_VGA_SR_MAP_MASK_REGISTER); - grub_sm712_sr_write (0, GRUB_VGA_SR_CHAR_MAP_SELECT); - grub_sm712_sr_write (GRUB_VGA_SR_MEMORY_MODE_CHAIN4 - | GRUB_VGA_SR_MEMORY_MODE_SEQUENTIAL_ADDRESSING - | GRUB_VGA_SR_MEMORY_MODE_EXTERNAL_VIDEO_MEMORY, - GRUB_VGA_SR_MEMORY_MODE); + VasEBoot_sm712_sr_write (0, 0x21); + VasEBoot_sm712_sr_write (0x7a, 0x62); + VasEBoot_sm712_sr_write (0x16, 0x6a); + VasEBoot_sm712_sr_write (0x2, 0x6b); + VasEBoot_sm712_write_reg (0, VasEBoot_VGA_IO_PIXEL_MASK); + VasEBoot_sm712_sr_write (VasEBoot_VGA_SR_RESET_ASYNC, VasEBoot_VGA_SR_RESET); + VasEBoot_sm712_write_reg (VasEBoot_VGA_IO_MISC_NEGATIVE_VERT_POLARITY + | VasEBoot_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY + | VasEBoot_VGA_IO_MISC_UPPER_64K + | VasEBoot_VGA_IO_MISC_EXTERNAL_CLOCK_0 + | VasEBoot_VGA_IO_MISC_ENABLE_VRAM_ACCESS + | VasEBoot_VGA_IO_MISC_COLOR, VasEBoot_VGA_IO_MISC_WRITE); + VasEBoot_sm712_sr_write (VasEBoot_VGA_SR_RESET_ASYNC | VasEBoot_VGA_SR_RESET_SYNC, + VasEBoot_VGA_SR_RESET); + VasEBoot_sm712_sr_write (VasEBoot_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK, + VasEBoot_VGA_SR_CLOCKING_MODE); + VasEBoot_sm712_sr_write (VasEBoot_VGA_ALL_PLANES, VasEBoot_VGA_SR_MAP_MASK_REGISTER); + VasEBoot_sm712_sr_write (0, VasEBoot_VGA_SR_CHAR_MAP_SELECT); + VasEBoot_sm712_sr_write (VasEBoot_VGA_SR_MEMORY_MODE_CHAIN4 + | VasEBoot_VGA_SR_MEMORY_MODE_SEQUENTIAL_ADDRESSING + | VasEBoot_VGA_SR_MEMORY_MODE_EXTERNAL_VIDEO_MEMORY, + VasEBoot_VGA_SR_MEMORY_MODE); for (i = 0; i < ARRAY_SIZE (sm712_sr_seq1); i++) - grub_sm712_sr_write (sm712_sr_seq1[i], 0x10 + i); + VasEBoot_sm712_sr_write (sm712_sr_seq1[i], 0x10 + i); for (i = 0; i < ARRAY_SIZE (sm712_sr_seq2); i++) - grub_sm712_sr_write (sm712_sr_seq2[i], 0x30 + i); + VasEBoot_sm712_sr_write (sm712_sr_seq2[i], 0x30 + i); /* Undocumented. */ - grub_sm712_sr_write (0x1a, 0x63); + VasEBoot_sm712_sr_write (0x1a, 0x63); /* Undocumented. */ - grub_sm712_sr_write (0x1a, 0x64); + VasEBoot_sm712_sr_write (0x1a, 0x64); - grub_sm712_sr_write (GRUB_SM712_SR_TV_CRT_SRAM | GRUB_SM712_SR_TV_ALT_CLOCK - | GRUB_SM712_SR_TV_CLOCK_CKIN_NTSC - | GRUB_SM712_SR_TV_HSYNC, - GRUB_SM712_SR_TV_CONTROL); + VasEBoot_sm712_sr_write (VasEBoot_SM712_SR_TV_CRT_SRAM | VasEBoot_SM712_SR_TV_ALT_CLOCK + | VasEBoot_SM712_SR_TV_CLOCK_CKIN_NTSC + | VasEBoot_SM712_SR_TV_HSYNC, + VasEBoot_SM712_SR_TV_CONTROL); - grub_sm712_sr_write (GRUB_SM712_SR_RAM_LUT_NORMAL, GRUB_SM712_SR_RAM_LUT); + VasEBoot_sm712_sr_write (VasEBoot_SM712_SR_RAM_LUT_NORMAL, VasEBoot_SM712_SR_RAM_LUT); /* Undocumented. */ - grub_sm712_sr_write (0x00, 0x67); + VasEBoot_sm712_sr_write (0x00, 0x67); - grub_sm712_sr_write (GRUB_SM712_SR_CLOCK_CONTROL1_VCLK_FROM_CCR - | GRUB_SM712_SR_CLOCK_CONTROL1_8DOT_CLOCK, - GRUB_SM712_SR_CLOCK_CONTROL1); - grub_sm712_sr_write (GRUB_SM712_SR_CLOCK_CONTROL2_PROGRAM_VCLOCK, - GRUB_SM712_SR_CLOCK_CONTROL2); + VasEBoot_sm712_sr_write (VasEBoot_SM712_SR_CLOCK_CONTROL1_VCLK_FROM_CCR + | VasEBoot_SM712_SR_CLOCK_CONTROL1_8DOT_CLOCK, + VasEBoot_SM712_SR_CLOCK_CONTROL1); + VasEBoot_sm712_sr_write (VasEBoot_SM712_SR_CLOCK_CONTROL2_PROGRAM_VCLOCK, + VasEBoot_SM712_SR_CLOCK_CONTROL2); - grub_sm712_sr_write (82, GRUB_SM712_SR_VCLK_NUM); - grub_sm712_sr_write (137, GRUB_SM712_SR_VCLK_DENOM); + VasEBoot_sm712_sr_write (82, VasEBoot_SM712_SR_VCLK_NUM); + VasEBoot_sm712_sr_write (137, VasEBoot_SM712_SR_VCLK_DENOM); - grub_sm712_sr_write (9, GRUB_SM712_SR_VCLK2_NUM); - grub_sm712_sr_write (2, GRUB_SM712_SR_VCLK2_DENOM); + VasEBoot_sm712_sr_write (9, VasEBoot_SM712_SR_VCLK2_NUM); + VasEBoot_sm712_sr_write (2, VasEBoot_SM712_SR_VCLK2_DENOM); /* FIXME */ - grub_sm712_sr_write (0x04, 0x70); + VasEBoot_sm712_sr_write (0x04, 0x70); /* FIXME */ - grub_sm712_sr_write (0x45, 0x71); + VasEBoot_sm712_sr_write (0x45, 0x71); /* Undocumented */ - grub_sm712_sr_write (0x30, 0x72); + VasEBoot_sm712_sr_write (0x30, 0x72); /* Undocumented */ - grub_sm712_sr_write (0x30, 0x73); + VasEBoot_sm712_sr_write (0x30, 0x73); /* Undocumented */ - grub_sm712_sr_write (0x40, 0x74); + VasEBoot_sm712_sr_write (0x40, 0x74); /* Undocumented */ - grub_sm712_sr_write (0x20, 0x75); + VasEBoot_sm712_sr_write (0x20, 0x75); - grub_sm712_sr_write (0xff, GRUB_SM712_SR_POPUP_ICON_LOW); - grub_sm712_sr_write (GRUB_SM712_SR_POPUP_ICON_HIGH_MASK, - GRUB_SM712_SR_POPUP_ICON_HIGH); - grub_sm712_sr_write (GRUB_SM712_SR_POPUP_ICON_CTRL_DISABLED, - GRUB_SM712_SR_POPUP_ICON_CTRL); + VasEBoot_sm712_sr_write (0xff, VasEBoot_SM712_SR_POPUP_ICON_LOW); + VasEBoot_sm712_sr_write (VasEBoot_SM712_SR_POPUP_ICON_HIGH_MASK, + VasEBoot_SM712_SR_POPUP_ICON_HIGH); + VasEBoot_sm712_sr_write (VasEBoot_SM712_SR_POPUP_ICON_CTRL_DISABLED, + VasEBoot_SM712_SR_POPUP_ICON_CTRL); /* Undocumented */ - grub_sm712_sr_write (0x0, 0x83); + VasEBoot_sm712_sr_write (0x0, 0x83); - grub_sm712_sr_write (8, GRUB_SM712_SR_POPUP_ICON_COLOR1); - grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_COLOR2); - grub_sm712_sr_write (0x42, GRUB_SM712_SR_POPUP_ICON_COLOR3); + VasEBoot_sm712_sr_write (8, VasEBoot_SM712_SR_POPUP_ICON_COLOR1); + VasEBoot_sm712_sr_write (0, VasEBoot_SM712_SR_POPUP_ICON_COLOR2); + VasEBoot_sm712_sr_write (0x42, VasEBoot_SM712_SR_POPUP_ICON_COLOR3); /* Undocumented */ - grub_sm712_sr_write (0x3a, 0x87); + VasEBoot_sm712_sr_write (0x3a, 0x87); /* Why theese coordinates? */ - grub_sm712_sr_write (0x59, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_LOW); - grub_sm712_sr_write (0x02, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_HIGH); - grub_sm712_sr_write (0x44, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_LOW); - grub_sm712_sr_write (0x02, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_HIGH); + VasEBoot_sm712_sr_write (0x59, VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_X_LOW); + VasEBoot_sm712_sr_write (0x02, VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_X_HIGH); + VasEBoot_sm712_sr_write (0x44, VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_LOW); + VasEBoot_sm712_sr_write (0x02, VasEBoot_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_HIGH); - grub_sm712_sr_write (RGB332_BLACK, GRUB_SM712_SR_HW_CURSOR_FG_COLOR); - grub_sm712_sr_write (RGB332_WHITE, GRUB_SM712_SR_HW_CURSOR_BG_COLOR); + VasEBoot_sm712_sr_write (RGB332_BLACK, VasEBoot_SM712_SR_HW_CURSOR_FG_COLOR); + VasEBoot_sm712_sr_write (RGB332_WHITE, VasEBoot_SM712_SR_HW_CURSOR_BG_COLOR); /* Undocumented */ - grub_sm712_sr_write (0x3a, 0x8e); - grub_sm712_sr_write (0x3a, 0x8f); + VasEBoot_sm712_sr_write (0x3a, 0x8e); + VasEBoot_sm712_sr_write (0x3a, 0x8f); - grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_X_LOW); - grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_X_HIGH); - grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_Y_LOW); - grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_Y_HIGH); + VasEBoot_sm712_sr_write (0, VasEBoot_SM712_SR_POPUP_ICON_X_LOW); + VasEBoot_sm712_sr_write (0, VasEBoot_SM712_SR_POPUP_ICON_X_HIGH); + VasEBoot_sm712_sr_write (0, VasEBoot_SM712_SR_POPUP_ICON_Y_LOW); + VasEBoot_sm712_sr_write (0, VasEBoot_SM712_SR_POPUP_ICON_Y_HIGH); - grub_sm712_sr_write (0, GRUB_SM712_SR_PANEL_HW_VIDEO_CONTROL); - grub_sm712_sr_write (0x10, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_LOW); - grub_sm712_sr_write (0x08, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_HIGH); - grub_sm712_sr_write (0x00, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_LOW); - grub_sm712_sr_write (0x02, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_HIGH); - grub_sm712_sr_write (0xed, GRUB_SM712_SR_PANEL_HW_VIDEO_RED_CONSTANT); - grub_sm712_sr_write (0xed, GRUB_SM712_SR_PANEL_HW_VIDEO_GREEN_CONSTANT); - grub_sm712_sr_write (0xed, GRUB_SM712_SR_PANEL_HW_VIDEO_BLUE_CONSTANT); + VasEBoot_sm712_sr_write (0, VasEBoot_SM712_SR_PANEL_HW_VIDEO_CONTROL); + VasEBoot_sm712_sr_write (0x10, VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_LOW); + VasEBoot_sm712_sr_write (0x08, VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_HIGH); + VasEBoot_sm712_sr_write (0x00, VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_LOW); + VasEBoot_sm712_sr_write (0x02, VasEBoot_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_HIGH); + VasEBoot_sm712_sr_write (0xed, VasEBoot_SM712_SR_PANEL_HW_VIDEO_RED_CONSTANT); + VasEBoot_sm712_sr_write (0xed, VasEBoot_SM712_SR_PANEL_HW_VIDEO_GREEN_CONSTANT); + VasEBoot_sm712_sr_write (0xed, VasEBoot_SM712_SR_PANEL_HW_VIDEO_BLUE_CONSTANT); - grub_sm712_sr_write (0x7b, GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_BOUNDARY); - grub_sm712_sr_write (0xfb, GRUB_SM712_SR_PANEL_HW_VIDEO_LEFT_BOUNDARY); - grub_sm712_sr_write (0xff, GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_BOUNDARY); - grub_sm712_sr_write (0xff, GRUB_SM712_SR_PANEL_HW_VIDEO_RIGHT_BOUNDARY); + VasEBoot_sm712_sr_write (0x7b, VasEBoot_SM712_SR_PANEL_HW_VIDEO_TOP_BOUNDARY); + VasEBoot_sm712_sr_write (0xfb, VasEBoot_SM712_SR_PANEL_HW_VIDEO_LEFT_BOUNDARY); + VasEBoot_sm712_sr_write (0xff, VasEBoot_SM712_SR_PANEL_HW_VIDEO_BOTTOM_BOUNDARY); + VasEBoot_sm712_sr_write (0xff, VasEBoot_SM712_SR_PANEL_HW_VIDEO_RIGHT_BOUNDARY); /* Doesn't match documentation? */ - grub_sm712_sr_write (0x97, GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_LEFT_OVERFLOW_BOUNDARY); - grub_sm712_sr_write (0xef, GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_RIGHT_OVERFLOW_BOUNDARY); + VasEBoot_sm712_sr_write (0x97, VasEBoot_SM712_SR_PANEL_HW_VIDEO_TOP_LEFT_OVERFLOW_BOUNDARY); + VasEBoot_sm712_sr_write (0xef, VasEBoot_SM712_SR_PANEL_HW_VIDEO_BOTTOM_RIGHT_OVERFLOW_BOUNDARY); - grub_sm712_sr_write (0xbf, GRUB_SM712_SR_PANEL_HW_VIDEO_VERTICAL_STRETCH_FACTOR); - grub_sm712_sr_write (0xdf, GRUB_SM712_SR_PANEL_HW_VIDEO_HORIZONTAL_STRETCH_FACTOR); + VasEBoot_sm712_sr_write (0xbf, VasEBoot_SM712_SR_PANEL_HW_VIDEO_VERTICAL_STRETCH_FACTOR); + VasEBoot_sm712_sr_write (0xdf, VasEBoot_SM712_SR_PANEL_HW_VIDEO_HORIZONTAL_STRETCH_FACTOR); - grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_SET_RESET_PLANE); - grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_SET_RESET_PLANE_ENABLE); - grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_COLOR_COMPARE); - grub_sm712_gr_write (GRUB_VGA_GR_DATA_ROTATE_NOP, GRUB_VGA_GR_DATA_ROTATE); - grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_READ_MAP_REGISTER); - grub_sm712_gr_write (GRUB_VGA_GR_MODE_256_COLOR, GRUB_VGA_GR_MODE); - grub_sm712_gr_write (GRUB_VGA_GR_GR6_MMAP_A0 - | GRUB_VGA_GR_GR6_GRAPHICS_MODE, GRUB_VGA_GR_GR6); - grub_sm712_gr_write (GRUB_VGA_ALL_PLANES, GRUB_VGA_GR_COLOR_COMPARE_DISABLE); - grub_sm712_gr_write (0xff, GRUB_VGA_GR_BITMASK); + VasEBoot_sm712_gr_write (VasEBoot_VGA_NO_PLANES, VasEBoot_VGA_GR_SET_RESET_PLANE); + VasEBoot_sm712_gr_write (VasEBoot_VGA_NO_PLANES, VasEBoot_VGA_GR_SET_RESET_PLANE_ENABLE); + VasEBoot_sm712_gr_write (VasEBoot_VGA_NO_PLANES, VasEBoot_VGA_GR_COLOR_COMPARE); + VasEBoot_sm712_gr_write (VasEBoot_VGA_GR_DATA_ROTATE_NOP, VasEBoot_VGA_GR_DATA_ROTATE); + VasEBoot_sm712_gr_write (VasEBoot_VGA_NO_PLANES, VasEBoot_VGA_GR_READ_MAP_REGISTER); + VasEBoot_sm712_gr_write (VasEBoot_VGA_GR_MODE_256_COLOR, VasEBoot_VGA_GR_MODE); + VasEBoot_sm712_gr_write (VasEBoot_VGA_GR_GR6_MMAP_A0 + | VasEBoot_VGA_GR_GR6_GRAPHICS_MODE, VasEBoot_VGA_GR_GR6); + VasEBoot_sm712_gr_write (VasEBoot_VGA_ALL_PLANES, VasEBoot_VGA_GR_COLOR_COMPARE_DISABLE); + VasEBoot_sm712_gr_write (0xff, VasEBoot_VGA_GR_BITMASK); /* Write palette mapping. */ for (i = 0; i < 16; i++) - grub_sm712_write_arx (i, i); + VasEBoot_sm712_write_arx (i, i); - grub_sm712_write_arx (GRUB_VGA_ARX_MODE_ENABLE_256COLOR - | GRUB_VGA_ARX_MODE_GRAPHICS, GRUB_VGA_ARX_MODE); - grub_sm712_write_arx (0, GRUB_VGA_ARX_OVERSCAN); - grub_sm712_write_arx (GRUB_VGA_ALL_PLANES, GRUB_VGA_ARX_COLOR_PLANE_ENABLE); - grub_sm712_write_arx (0, GRUB_VGA_ARX_HORIZONTAL_PANNING); - grub_sm712_write_arx (0, GRUB_VGA_ARX_COLOR_SELECT); + VasEBoot_sm712_write_arx (VasEBoot_VGA_ARX_MODE_ENABLE_256COLOR + | VasEBoot_VGA_ARX_MODE_GRAPHICS, VasEBoot_VGA_ARX_MODE); + VasEBoot_sm712_write_arx (0, VasEBoot_VGA_ARX_OVERSCAN); + VasEBoot_sm712_write_arx (VasEBoot_VGA_ALL_PLANES, VasEBoot_VGA_ARX_COLOR_PLANE_ENABLE); + VasEBoot_sm712_write_arx (0, VasEBoot_VGA_ARX_HORIZONTAL_PANNING); + VasEBoot_sm712_write_arx (0, VasEBoot_VGA_ARX_COLOR_SELECT); /* FIXME: compute this generically. */ { - struct grub_video_hw_config config = + struct VasEBoot_video_hw_config config = { .vertical_total = 806, .vertical_blank_start = 0x300, @@ -638,7 +638,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, .horizontal_sync_pulse_start = 133, .horizontal_sync_pulse_end = 22 }; - grub_vga_set_geometry (&config, grub_sm712_cr_write); + VasEBoot_vga_set_geometry (&config, VasEBoot_sm712_cr_write); config.horizontal_sync_pulse_start = 134; config.horizontal_sync_pulse_end = 21; config.vertical_sync_start = 0x301; @@ -646,91 +646,91 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, config.line_compare = 0x0ff; config.vdisplay_end = 0x258; config.pitch = 0x7f; - grub_vga_set_geometry (&config, grub_sm712_cr_shadow_write); + VasEBoot_vga_set_geometry (&config, VasEBoot_sm712_cr_shadow_write); } - grub_sm712_cr_write (GRUB_VGA_CR_BYTE_PANNING_NORMAL, - GRUB_VGA_CR_BYTE_PANNING); - grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_START); - grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_END); - grub_sm712_cr_write (0, GRUB_VGA_CR_START_ADDR_HIGH_REGISTER); - grub_sm712_cr_write (0, GRUB_VGA_CR_START_ADDR_LOW_REGISTER); - grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_ADDR_HIGH); - grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_ADDR_LOW); - grub_sm712_cr_write (GRUB_VGA_CR_UNDERLINE_LOCATION_DWORD_MODE, - GRUB_VGA_CR_UNDERLINE_LOCATION); - grub_sm712_cr_write (GRUB_VGA_CR_MODE_ADDRESS_WRAP - | GRUB_VGA_CR_MODE_BYTE_MODE - | GRUB_VGA_CR_MODE_TIMING_ENABLE - | GRUB_VGA_CR_MODE_NO_CGA - | GRUB_VGA_CR_MODE_NO_HERCULES, - GRUB_VGA_CR_MODE); + VasEBoot_sm712_cr_write (VasEBoot_VGA_CR_BYTE_PANNING_NORMAL, + VasEBoot_VGA_CR_BYTE_PANNING); + VasEBoot_sm712_cr_write (0, VasEBoot_VGA_CR_CURSOR_START); + VasEBoot_sm712_cr_write (0, VasEBoot_VGA_CR_CURSOR_END); + VasEBoot_sm712_cr_write (0, VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER); + VasEBoot_sm712_cr_write (0, VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER); + VasEBoot_sm712_cr_write (0, VasEBoot_VGA_CR_CURSOR_ADDR_HIGH); + VasEBoot_sm712_cr_write (0, VasEBoot_VGA_CR_CURSOR_ADDR_LOW); + VasEBoot_sm712_cr_write (VasEBoot_VGA_CR_UNDERLINE_LOCATION_DWORD_MODE, + VasEBoot_VGA_CR_UNDERLINE_LOCATION); + VasEBoot_sm712_cr_write (VasEBoot_VGA_CR_MODE_ADDRESS_WRAP + | VasEBoot_VGA_CR_MODE_BYTE_MODE + | VasEBoot_VGA_CR_MODE_TIMING_ENABLE + | VasEBoot_VGA_CR_MODE_NO_CGA + | VasEBoot_VGA_CR_MODE_NO_HERCULES, + VasEBoot_VGA_CR_MODE); - grub_sm712_cr_write (0, GRUB_SM712_CR_OVERFLOW_INTERLACE); - grub_sm712_cr_write (0, GRUB_SM712_CR_INTERLACE_RETRACE); - grub_sm712_cr_write (0, GRUB_SM712_CR_TV_VDISPLAY_START); - grub_sm712_cr_write (0, GRUB_SM712_CR_TV_VDISPLAY_END_HIGH); - grub_sm712_cr_write (0, GRUB_SM712_CR_TV_VDISPLAY_END_LOW); - grub_sm712_cr_write (0x80, GRUB_SM712_CR_DDA_CONTROL_LOW); - grub_sm712_cr_write (0x02, GRUB_SM712_CR_DDA_CONTROL_HIGH); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_OVERFLOW_INTERLACE); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_INTERLACE_RETRACE); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_TV_VDISPLAY_START); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_TV_VDISPLAY_END_HIGH); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_TV_VDISPLAY_END_LOW); + VasEBoot_sm712_cr_write (0x80, VasEBoot_SM712_CR_DDA_CONTROL_LOW); + VasEBoot_sm712_cr_write (0x02, VasEBoot_SM712_CR_DDA_CONTROL_HIGH); /* Undocumented */ - grub_sm712_cr_write (0x20, 0x37); + VasEBoot_sm712_cr_write (0x20, 0x37); - grub_sm712_cr_write (0, GRUB_SM712_CR_TV_EQUALIZER); - grub_sm712_cr_write (0, GRUB_SM712_CR_TV_SERRATION); - grub_sm712_cr_write (0, GRUB_SM712_CR_HSYNC_CTRL); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_TV_EQUALIZER); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_TV_SERRATION); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_HSYNC_CTRL); /* Undocumented */ - grub_sm712_cr_write (0x40, 0x3b); + VasEBoot_sm712_cr_write (0x40, 0x3b); - grub_sm712_cr_write (GRUB_SM712_CR_DEBUG_NONE, GRUB_SM712_CR_DEBUG); + VasEBoot_sm712_cr_write (VasEBoot_SM712_CR_DEBUG_NONE, VasEBoot_SM712_CR_DEBUG); /* Undocumented */ - grub_sm712_cr_write (0xff, 0x3d); - grub_sm712_cr_write (0x46, 0x3e); - grub_sm712_cr_write (0x91, 0x3f); + VasEBoot_sm712_cr_write (0xff, 0x3d); + VasEBoot_sm712_cr_write (0x46, 0x3e); + VasEBoot_sm712_cr_write (0x91, 0x3f); for (i = 0; i < ARRAY_SIZE (dda_lookups); i++) - grub_sm712_write_dda_lookup (i, dda_lookups[i].compare, dda_lookups[i].dda, + VasEBoot_sm712_write_dda_lookup (i, dda_lookups[i].compare, dda_lookups[i].dda, dda_lookups[i].vcentering); /* Undocumented */ - grub_sm712_cr_write (0, 0x9c); - grub_sm712_cr_write (0, 0x9d); - grub_sm712_cr_write (0, 0x9e); - grub_sm712_cr_write (0, 0x9f); + VasEBoot_sm712_cr_write (0, 0x9c); + VasEBoot_sm712_cr_write (0, 0x9d); + VasEBoot_sm712_cr_write (0, 0x9e); + VasEBoot_sm712_cr_write (0, 0x9f); - grub_sm712_cr_write (0, GRUB_SM712_CR_VCENTERING_OFFSET); - grub_sm712_cr_write (0, GRUB_SM712_CR_HCENTERING_OFFSET); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_VCENTERING_OFFSET); + VasEBoot_sm712_cr_write (0, VasEBoot_SM712_CR_HCENTERING_OFFSET); - grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY - | GRUB_VGA_IO_MISC_UPPER_64K - | GRUB_VGA_IO_MISC_28MHZ - | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS - | GRUB_VGA_IO_MISC_COLOR, - GRUB_VGA_IO_MISC_WRITE); + VasEBoot_sm712_write_reg (VasEBoot_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY + | VasEBoot_VGA_IO_MISC_UPPER_64K + | VasEBoot_VGA_IO_MISC_28MHZ + | VasEBoot_VGA_IO_MISC_ENABLE_VRAM_ACCESS + | VasEBoot_VGA_IO_MISC_COLOR, + VasEBoot_VGA_IO_MISC_WRITE); #if !defined (TEST) && !defined(GENINIT) /* Undocumented? */ - *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c00c) = 0; - *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c040) = 0; - *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c000) = 0x20000; - *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c010) = 0x1020100; + *(volatile VasEBoot_uint32_t *) ((char *) framebuffer.ptr + 0x40c00c) = 0; + *(volatile VasEBoot_uint32_t *) ((char *) framebuffer.ptr + 0x40c040) = 0; + *(volatile VasEBoot_uint32_t *) ((char *) framebuffer.ptr + 0x40c000) = 0x20000; + *(volatile VasEBoot_uint32_t *) ((char *) framebuffer.ptr + 0x40c010) = 0x1020100; #endif - (void) grub_sm712_sr_read (0x16); + (void) VasEBoot_sm712_sr_read (0x16); #if !defined (TEST) && !defined(GENINIT) - err = grub_video_fb_setup (mode_type, mode_mask, + err = VasEBoot_video_fb_setup (mode_type, mode_mask, &framebuffer.mode_info, framebuffer.cached_ptr, NULL, NULL); if (err) return err; /* Copy default palette to initialize emulated palette. */ - err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, - grub_video_fbstd_colors); + err = VasEBoot_video_fb_set_palette (0, VasEBoot_VIDEO_FBSTD_NUMCOLORS, + VasEBoot_video_fbstd_colors); return err; #else return 0; @@ -739,80 +739,80 @@ grub_video_sm712_setup (unsigned int width, unsigned int height, #if !defined (TEST) && !defined(GENINIT) -static grub_err_t -grub_video_sm712_swap_buffers (void) +static VasEBoot_err_t +VasEBoot_video_sm712_swap_buffers (void) { - grub_size_t s; + VasEBoot_size_t s; s = (framebuffer.mode_info.height * framebuffer.mode_info.pitch * framebuffer.mode_info.bytes_per_pixel); - grub_video_fb_swap_buffers (); - grub_arch_sync_dma_caches (framebuffer.cached_ptr, s); - return GRUB_ERR_NONE; + VasEBoot_video_fb_swap_buffers (); + VasEBoot_arch_sync_dma_caches (framebuffer.cached_ptr, s); + return VasEBoot_ERR_NONE; } -static grub_err_t -grub_video_sm712_get_info_and_fini (struct grub_video_mode_info *mode_info, +static VasEBoot_err_t +VasEBoot_video_sm712_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuf) { - grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + VasEBoot_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_video_fb_fini (); + VasEBoot_video_fb_fini (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static struct grub_video_adapter grub_video_sm712_adapter = +static struct VasEBoot_video_adapter VasEBoot_video_sm712_adapter = { .name = "SM712 Video Driver", - .id = GRUB_VIDEO_DRIVER_SM712, + .id = VasEBoot_VIDEO_DRIVER_SM712, - .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + .prio = VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE, - .init = grub_video_sm712_video_init, - .fini = grub_video_sm712_video_fini, - .setup = grub_video_sm712_setup, - .get_info = grub_video_fb_get_info, - .get_info_and_fini = grub_video_sm712_get_info_and_fini, - .set_palette = grub_video_fb_set_palette, - .get_palette = grub_video_fb_get_palette, - .set_viewport = grub_video_fb_set_viewport, - .get_viewport = grub_video_fb_get_viewport, - .set_region = grub_video_fb_set_region, - .get_region = grub_video_fb_get_region, - .set_area_status = grub_video_fb_set_area_status, - .get_area_status = grub_video_fb_get_area_status, - .map_color = grub_video_fb_map_color, - .map_rgb = grub_video_fb_map_rgb, - .map_rgba = grub_video_fb_map_rgba, - .unmap_color = grub_video_fb_unmap_color, - .fill_rect = grub_video_fb_fill_rect, - .blit_bitmap = grub_video_fb_blit_bitmap, - .blit_render_target = grub_video_fb_blit_render_target, - .scroll = grub_video_fb_scroll, - .swap_buffers = grub_video_sm712_swap_buffers, - .create_render_target = grub_video_fb_create_render_target, - .delete_render_target = grub_video_fb_delete_render_target, - .set_active_render_target = grub_video_fb_set_active_render_target, - .get_active_render_target = grub_video_fb_get_active_render_target, + .init = VasEBoot_video_sm712_video_init, + .fini = VasEBoot_video_sm712_video_fini, + .setup = VasEBoot_video_sm712_setup, + .get_info = VasEBoot_video_fb_get_info, + .get_info_and_fini = VasEBoot_video_sm712_get_info_and_fini, + .set_palette = VasEBoot_video_fb_set_palette, + .get_palette = VasEBoot_video_fb_get_palette, + .set_viewport = VasEBoot_video_fb_set_viewport, + .get_viewport = VasEBoot_video_fb_get_viewport, + .set_region = VasEBoot_video_fb_set_region, + .get_region = VasEBoot_video_fb_get_region, + .set_area_status = VasEBoot_video_fb_set_area_status, + .get_area_status = VasEBoot_video_fb_get_area_status, + .map_color = VasEBoot_video_fb_map_color, + .map_rgb = VasEBoot_video_fb_map_rgb, + .map_rgba = VasEBoot_video_fb_map_rgba, + .unmap_color = VasEBoot_video_fb_unmap_color, + .fill_rect = VasEBoot_video_fb_fill_rect, + .blit_bitmap = VasEBoot_video_fb_blit_bitmap, + .blit_render_target = VasEBoot_video_fb_blit_render_target, + .scroll = VasEBoot_video_fb_scroll, + .swap_buffers = VasEBoot_video_sm712_swap_buffers, + .create_render_target = VasEBoot_video_fb_create_render_target, + .delete_render_target = VasEBoot_video_fb_delete_render_target, + .set_active_render_target = VasEBoot_video_fb_set_active_render_target, + .get_active_render_target = VasEBoot_video_fb_get_active_render_target, .next = 0 }; -GRUB_MOD_INIT(video_sm712) +VasEBoot_MOD_INIT(video_sm712) { - grub_video_register (&grub_video_sm712_adapter); + VasEBoot_video_register (&VasEBoot_video_sm712_adapter); } -GRUB_MOD_FINI(video_sm712) +VasEBoot_MOD_FINI(video_sm712) { - grub_video_unregister (&grub_video_sm712_adapter); + VasEBoot_video_unregister (&VasEBoot_video_sm712_adapter); } #else int main () { - grub_video_sm712_setup (1024, 600, 0, 0); + VasEBoot_video_sm712_setup (1024, 600, 0, 0); } #endif diff --git a/VasEBoot-core/video/sm712_init.c b/VasEBoot-core/video/sm712_init.c index cdb0b7383..4baecb383 100644 --- a/VasEBoot-core/video/sm712_init.c +++ b/VasEBoot-core/video/sm712_init.c @@ -1,10 +1,10 @@ /* Following sequence is a capture of sm712 initialisation sequence. */ -static grub_uint8_t sm712_sr_seq1[] = +static VasEBoot_uint8_t sm712_sr_seq1[] = { 0xc8, 0x40, 0x14, 0x60, 0x0, 0xa, 0x92, 0x0, 0x51, 0x00, 0x01, 0x00, 0x0, 0x0, 0x00, 0x0, 0xc4, 0x30, 0x02, 0x00, 0x1 }; -static grub_uint8_t sm712_sr_seq2[] = +static VasEBoot_uint8_t sm712_sr_seq2[] = { 0x28, 0x03, 0x24, 0x09, 0xc0, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x00, 0x00, 0x03, 0xff, 0x00, 0xfc, 0x00, 0x00, 0x20, 0x18, 0x00, 0xfc, diff --git a/VasEBoot-core/video/video.c b/VasEBoot-core/video/video.c index f252663c1..b5068a4b1 100644 --- a/VasEBoot-core/video/video.c +++ b/VasEBoot-core/video/video.c @@ -1,97 +1,97 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); /* The list of video adapters registered to system. */ -grub_video_adapter_t grub_video_adapter_list = NULL; +VasEBoot_video_adapter_t VasEBoot_video_adapter_list = NULL; /* Active video adapter. */ -grub_video_adapter_t grub_video_adapter_active; +VasEBoot_video_adapter_t VasEBoot_video_adapter_active; /* Restore back to initial mode (where applicable). */ -grub_err_t -grub_video_restore (void) +VasEBoot_err_t +VasEBoot_video_restore (void) { - if (grub_video_adapter_active) + if (VasEBoot_video_adapter_active) { - grub_video_adapter_active->fini (); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + VasEBoot_video_adapter_active->fini (); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_errno; - grub_video_adapter_active = 0; + VasEBoot_video_adapter_active = 0; } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Get information about active video mode. */ -grub_err_t -grub_video_get_info (struct grub_video_mode_info *mode_info) +VasEBoot_err_t +VasEBoot_video_get_info (struct VasEBoot_video_mode_info *mode_info) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); /* If mode_info is NULL just report that video adapter is active. */ if (! mode_info) { - grub_errno = GRUB_ERR_NONE; - return grub_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; + return VasEBoot_errno; } - return grub_video_adapter_active->get_info (mode_info); + return VasEBoot_video_adapter_active->get_info (mode_info); } -grub_video_driver_id_t -grub_video_get_driver_id (void) +VasEBoot_video_driver_id_t +VasEBoot_video_get_driver_id (void) { - if (! grub_video_adapter_active) - return GRUB_VIDEO_DRIVER_NONE; - return grub_video_adapter_active->id; + if (! VasEBoot_video_adapter_active) + return VasEBoot_VIDEO_DRIVER_NONE; + return VasEBoot_video_adapter_active->id; } /* Get information about active video mode. */ -grub_err_t -grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info, +VasEBoot_err_t +VasEBoot_video_get_info_and_fini (struct VasEBoot_video_mode_info *mode_info, void **framebuffer) { - grub_err_t err; + VasEBoot_err_t err; - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - err = grub_video_adapter_active->get_info_and_fini (mode_info, framebuffer); + err = VasEBoot_video_adapter_active->get_info_and_fini (mode_info, framebuffer); if (err) return err; - grub_video_adapter_active = 0; - return GRUB_ERR_NONE; + VasEBoot_video_adapter_active = 0; + return VasEBoot_ERR_NONE; } /* Determine optimized blitting formation for specified video mode info. */ -enum grub_video_blit_format -grub_video_get_blit_format (struct grub_video_mode_info *mode_info) +enum VasEBoot_video_blit_format +VasEBoot_video_get_blit_format (struct VasEBoot_video_mode_info *mode_info) { /* Check if we have any known 32 bit modes. */ if (mode_info->bpp == 32) @@ -103,7 +103,7 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) && (mode_info->blue_mask_size == 8) && (mode_info->blue_field_pos == 0)) { - return GRUB_VIDEO_BLIT_FORMAT_BGRA_8888; + return VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888; } else if ((mode_info->red_mask_size == 8) && (mode_info->red_field_pos == 0) @@ -112,7 +112,7 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) && (mode_info->blue_mask_size == 8) && (mode_info->blue_field_pos == 16)) { - return GRUB_VIDEO_BLIT_FORMAT_RGBA_8888; + return VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888; } } /* Check if we have any known 24 bit modes. */ @@ -125,7 +125,7 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) && (mode_info->blue_mask_size == 8) && (mode_info->blue_field_pos == 0)) { - return GRUB_VIDEO_BLIT_FORMAT_BGR_888; + return VasEBoot_VIDEO_BLIT_FORMAT_BGR_888; } else if ((mode_info->red_mask_size == 8) && (mode_info->red_field_pos == 0) @@ -134,7 +134,7 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) && (mode_info->blue_mask_size == 8) && (mode_info->blue_field_pos == 16)) { - return GRUB_VIDEO_BLIT_FORMAT_RGB_888; + return VasEBoot_VIDEO_BLIT_FORMAT_RGB_888; } } /* Check if we have any known 16 bit modes. */ @@ -147,7 +147,7 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) && (mode_info->blue_mask_size == 5) && (mode_info->blue_field_pos == 0)) { - return GRUB_VIDEO_BLIT_FORMAT_BGR_565; + return VasEBoot_VIDEO_BLIT_FORMAT_BGR_565; } else if ((mode_info->red_mask_size == 5) && (mode_info->red_field_pos == 0) @@ -156,11 +156,11 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) && (mode_info->blue_mask_size == 5) && (mode_info->blue_field_pos == 11)) { - return GRUB_VIDEO_BLIT_FORMAT_RGB_565; + return VasEBoot_VIDEO_BLIT_FORMAT_RGB_565; } } else if (mode_info->bpp == 1) - return GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED; + return VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED; /* Backup route. Unknown format. */ @@ -169,145 +169,145 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) { if (mode_info->reserved_mask_size > 0) { - return GRUB_VIDEO_BLIT_FORMAT_RGBA; + return VasEBoot_VIDEO_BLIT_FORMAT_RGBA; } else { - return GRUB_VIDEO_BLIT_FORMAT_RGB; + return VasEBoot_VIDEO_BLIT_FORMAT_RGB; } } /* Assume as indexcolor mode. */ - return GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR; + return VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR; } /* Set new indexed color palette entries. */ -grub_err_t -grub_video_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +VasEBoot_err_t +VasEBoot_video_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->set_palette (start, count, palette_data); + return VasEBoot_video_adapter_active->set_palette (start, count, palette_data); } /* Get indexed color palette entries. */ -grub_err_t -grub_video_get_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) +VasEBoot_err_t +VasEBoot_video_get_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->get_palette (start, count, palette_data); + return VasEBoot_video_adapter_active->get_palette (start, count, palette_data); } /* Set viewport dimensions. */ -grub_err_t -grub_video_set_viewport (unsigned int x, unsigned int y, +VasEBoot_err_t +VasEBoot_video_set_viewport (unsigned int x, unsigned int y, unsigned int width, unsigned int height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->set_viewport (x, y, width, height); + return VasEBoot_video_adapter_active->set_viewport (x, y, width, height); } /* Get viewport dimensions. */ -grub_err_t -grub_video_get_viewport (unsigned int *x, unsigned int *y, +VasEBoot_err_t +VasEBoot_video_get_viewport (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->get_viewport (x, y, width, height); + return VasEBoot_video_adapter_active->get_viewport (x, y, width, height); } /* Set region dimensions. */ -grub_err_t -grub_video_set_region (unsigned int x, unsigned int y, +VasEBoot_err_t +VasEBoot_video_set_region (unsigned int x, unsigned int y, unsigned int width, unsigned int height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->set_region (x, y, width, height); + return VasEBoot_video_adapter_active->set_region (x, y, width, height); } /* Get region dimensions. */ -grub_err_t -grub_video_get_region (unsigned int *x, unsigned int *y, +VasEBoot_err_t +VasEBoot_video_get_region (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->get_region (x, y, width, height); + return VasEBoot_video_adapter_active->get_region (x, y, width, height); } /* Set status of the intersection of the viewport and the region. */ -grub_err_t -grub_video_set_area_status (grub_video_area_status_t area_status) +VasEBoot_err_t +VasEBoot_video_set_area_status (VasEBoot_video_area_status_t area_status) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->set_area_status (area_status); + return VasEBoot_video_adapter_active->set_area_status (area_status); } /* Get status of the intersection of the viewport and the region. */ -grub_err_t -grub_video_get_area_status (grub_video_area_status_t *area_status) +VasEBoot_err_t +VasEBoot_video_get_area_status (VasEBoot_video_area_status_t *area_status) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->get_area_status (area_status); + return VasEBoot_video_adapter_active->get_area_status (area_status); } /* Map color name to adapter specific color. */ -grub_video_color_t -grub_video_map_color (grub_uint32_t color_name) +VasEBoot_video_color_t +VasEBoot_video_map_color (VasEBoot_uint32_t color_name) { - if (! grub_video_adapter_active) + if (! VasEBoot_video_adapter_active) return 0; - return grub_video_adapter_active->map_color (color_name); + return VasEBoot_video_adapter_active->map_color (color_name); } /* Map RGB value to adapter specific color. */ -grub_video_color_t -grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue) +VasEBoot_video_color_t +VasEBoot_video_map_rgb (VasEBoot_uint8_t red, VasEBoot_uint8_t green, VasEBoot_uint8_t blue) { - if (! grub_video_adapter_active) + if (! VasEBoot_video_adapter_active) return 0; - return grub_video_adapter_active->map_rgb (red, green, blue); + return VasEBoot_video_adapter_active->map_rgb (red, green, blue); } /* Map RGBA value to adapter specific color. */ -grub_video_color_t -grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue, - grub_uint8_t alpha) +VasEBoot_video_color_t +VasEBoot_video_map_rgba (VasEBoot_uint8_t red, VasEBoot_uint8_t green, VasEBoot_uint8_t blue, + VasEBoot_uint8_t alpha) { - if (! grub_video_adapter_active) + if (! VasEBoot_video_adapter_active) return 0; - return grub_video_adapter_active->map_rgba (red, green, blue, alpha); + return VasEBoot_video_adapter_active->map_rgba (red, green, blue, alpha); } /* Unmap video color back to RGBA components. */ -grub_err_t -grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red, - grub_uint8_t *green, grub_uint8_t *blue, - grub_uint8_t *alpha) +VasEBoot_err_t +VasEBoot_video_unmap_color (VasEBoot_video_color_t color, VasEBoot_uint8_t *red, + VasEBoot_uint8_t *green, VasEBoot_uint8_t *blue, + VasEBoot_uint8_t *alpha) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->unmap_color (color, + return VasEBoot_video_adapter_active->unmap_color (color, red, green, blue, @@ -315,115 +315,115 @@ grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red, } /* Fill rectangle using specified color. */ -grub_err_t -grub_video_fill_rect (grub_video_color_t color, int x, int y, +VasEBoot_err_t +VasEBoot_video_fill_rect (VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->fill_rect (color, x, y, width, height); + return VasEBoot_video_adapter_active->fill_rect (color, x, y, width, height); } /* Blit bitmap to screen. */ -grub_err_t -grub_video_blit_bitmap (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, +VasEBoot_err_t +VasEBoot_video_blit_bitmap (struct VasEBoot_video_bitmap *bitmap, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->blit_bitmap (bitmap, oper, x, y, + return VasEBoot_video_adapter_active->blit_bitmap (bitmap, oper, x, y, offset_x, offset_y, width, height); } /* Blit render target to active render target. */ -grub_err_t -grub_video_blit_render_target (struct grub_video_render_target *target, - enum grub_video_blit_operators oper, +VasEBoot_err_t +VasEBoot_video_blit_render_target (struct VasEBoot_video_render_target *target, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->blit_render_target (target, oper, x, y, + return VasEBoot_video_adapter_active->blit_render_target (target, oper, x, y, offset_x, offset_y, width, height); } /* Scroll viewport and fill new areas with specified color. */ -grub_err_t -grub_video_scroll (grub_video_color_t color, int dx, int dy) +VasEBoot_err_t +VasEBoot_video_scroll (VasEBoot_video_color_t color, int dx, int dy) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->scroll (color, dx, dy); + return VasEBoot_video_adapter_active->scroll (color, dx, dy); } /* Swap buffers (swap active render target). */ -grub_err_t -grub_video_swap_buffers (void) +VasEBoot_err_t +VasEBoot_video_swap_buffers (void) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->swap_buffers (); + return VasEBoot_video_adapter_active->swap_buffers (); } /* Create new render target. */ -grub_err_t -grub_video_create_render_target (struct grub_video_render_target **result, +VasEBoot_err_t +VasEBoot_video_create_render_target (struct VasEBoot_video_render_target **result, unsigned int width, unsigned int height, unsigned int mode_type) { *result = 0; - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->create_render_target (result, + return VasEBoot_video_adapter_active->create_render_target (result, width, height, mode_type); } /* Delete render target. */ -grub_err_t -grub_video_delete_render_target (struct grub_video_render_target *target) +VasEBoot_err_t +VasEBoot_video_delete_render_target (struct VasEBoot_video_render_target *target) { if (!target) - return GRUB_ERR_NONE; - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + return VasEBoot_ERR_NONE; + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->delete_render_target (target); + return VasEBoot_video_adapter_active->delete_render_target (target); } /* Set active render target. */ -grub_err_t -grub_video_set_active_render_target (struct grub_video_render_target *target) +VasEBoot_err_t +VasEBoot_video_set_active_render_target (struct VasEBoot_video_render_target *target) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->set_active_render_target (target); + return VasEBoot_video_adapter_active->set_active_render_target (target); } /* Get active render target. */ -grub_err_t -grub_video_get_active_render_target (struct grub_video_render_target **target) +VasEBoot_err_t +VasEBoot_video_get_active_render_target (struct VasEBoot_video_render_target **target) { - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + if (! VasEBoot_video_adapter_active) + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no video mode activated"); - return grub_video_adapter_active->get_active_render_target (target); + return VasEBoot_video_adapter_active->get_active_render_target (target); } -grub_err_t -grub_video_edid_checksum (struct grub_video_edid_info *edid_info) +VasEBoot_err_t +VasEBoot_video_edid_checksum (struct VasEBoot_video_edid_info *edid_info) { const char *edid_bytes = (const char *) edid_info; int i; @@ -434,22 +434,22 @@ grub_video_edid_checksum (struct grub_video_edid_info *edid_info) checksum += edid_bytes[i]; if (checksum != 0) - return grub_error (GRUB_ERR_BAD_DEVICE, + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "invalid EDID checksum %d", checksum); - grub_errno = GRUB_ERR_NONE; - return grub_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; + return VasEBoot_errno; } -grub_err_t -grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, +VasEBoot_err_t +VasEBoot_video_edid_preferred_mode (struct VasEBoot_video_edid_info *edid_info, unsigned int *width, unsigned int *height) { /* Bit 1 in the Feature Support field indicates that the first Detailed Timing Description is the preferred timing mode. */ if (edid_info->version == 1 /* we don't understand later versions */ && (edid_info->feature_support - & GRUB_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE) + & VasEBoot_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE) && edid_info->detailed_timings[0].pixel_clock) { *width = edid_info->detailed_timings[0].horizontal_active_lo @@ -461,14 +461,14 @@ grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, (edid_info->detailed_timings[0].vertical_hi & 0xf0)) << 4); if (*width && *height) - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } - return grub_error (GRUB_ERR_BAD_DEVICE, "no preferred mode available"); + return VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "no preferred mode available"); } /* Parse x[x]*/ -static grub_err_t +static VasEBoot_err_t parse_modespec (const char *current_mode, int *width, int *height, int *depth) { const char *value; @@ -476,36 +476,36 @@ parse_modespec (const char *current_mode, int *width, int *height, int *depth) *width = *height = *depth = -1; - if (grub_strcmp (param, "auto") == 0) + if (VasEBoot_strcmp (param, "auto") == 0) { *width = *height = 0; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* Find width value. */ value = param; - param = grub_strchr(param, 'x'); + param = VasEBoot_strchr(param, 'x'); if (param == NULL) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid video mode specification `%s'"), current_mode); param++; - *width = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + *width = VasEBoot_strtoul (value, 0, 0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid video mode specification `%s'"), current_mode); /* Find height value. */ value = param; - param = grub_strchr(param, 'x'); + param = VasEBoot_strchr(param, 'x'); if (param == NULL) { - *height = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + *height = VasEBoot_strtoul (value, 0, 0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid video mode specification `%s'"), current_mode); } @@ -514,25 +514,25 @@ parse_modespec (const char *current_mode, int *width, int *height, int *depth) /* We have optional color depth value. */ param++; - *height = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + *height = VasEBoot_strtoul (value, 0, 0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid video mode specification `%s'"), current_mode); /* Convert color depth value. */ value = param; - *depth = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + *depth = VasEBoot_strtoul (value, 0, 0); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("invalid video mode specification `%s'"), current_mode); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -grub_err_t -grub_video_set_mode (const char *modestring, +VasEBoot_err_t +VasEBoot_video_set_mode (const char *modestring, unsigned int modemask, unsigned int modevalue) { @@ -541,58 +541,58 @@ grub_video_set_mode (const char *modestring, char *current_mode; char *modevar; - if (grub_video_adapter_active && grub_video_adapter_active->id == GRUB_VIDEO_ADAPTER_CAPTURE) - return GRUB_ERR_NONE; + if (VasEBoot_video_adapter_active && VasEBoot_video_adapter_active->id == VasEBoot_VIDEO_ADAPTER_CAPTURE) + return VasEBoot_ERR_NONE; modevalue &= modemask; /* Take copy of env.var. as we don't want to modify that. */ - modevar = grub_strdup (modestring); + modevar = VasEBoot_strdup (modestring); /* Initialize next mode. */ next_mode = modevar; if (! modevar) - return grub_errno; + return VasEBoot_errno; - if (grub_memcmp (next_mode, "keep", sizeof ("keep")) == 0 - || grub_memcmp (next_mode, "keep,", sizeof ("keep,") - 1) == 0 - || grub_memcmp (next_mode, "keep;", sizeof ("keep;") - 1) == 0) + if (VasEBoot_memcmp (next_mode, "keep", sizeof ("keep")) == 0 + || VasEBoot_memcmp (next_mode, "keep,", sizeof ("keep,") - 1) == 0 + || VasEBoot_memcmp (next_mode, "keep;", sizeof ("keep;") - 1) == 0) { int suitable = 1; - grub_err_t err; + VasEBoot_err_t err; - if (grub_video_adapter_active) + if (VasEBoot_video_adapter_active) { - struct grub_video_mode_info mode_info; - grub_memset (&mode_info, 0, sizeof (mode_info)); - err = grub_video_get_info (&mode_info); + struct VasEBoot_video_mode_info mode_info; + VasEBoot_memset (&mode_info, 0, sizeof (mode_info)); + err = VasEBoot_video_get_info (&mode_info); if (err) { suitable = 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } if ((mode_info.mode_type & modemask) != modevalue) suitable = 0; } - else if (((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modemask) != 0) - && ((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) == 0)) + else if (((VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT & modemask) != 0) + && ((VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) == 0)) suitable = 0; if (suitable) { - grub_free (modevar); - return GRUB_ERR_NONE; + VasEBoot_free (modevar); + return VasEBoot_ERR_NONE; } next_mode += sizeof ("keep") - 1; if (! *next_mode) { - grub_free (modevar); + VasEBoot_free (modevar); /* TRANSLATORS: This doesn't imply that there is no available video mode at all. All modes may have been filtered out by some criteria. */ - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("no suitable video mode found")); } @@ -601,15 +601,15 @@ grub_video_set_mode (const char *modestring, } /* De-activate last set video adapter. */ - if (grub_video_adapter_active) + if (VasEBoot_video_adapter_active) { /* Finalize adapter. */ - grub_video_adapter_active->fini (); - if (grub_errno != GRUB_ERR_NONE) - grub_errno = GRUB_ERR_NONE; + VasEBoot_video_adapter_active->fini (); + if (VasEBoot_errno != VasEBoot_ERR_NONE) + VasEBoot_errno = VasEBoot_ERR_NONE; /* Mark active adapter as not set. */ - grub_video_adapter_active = 0; + VasEBoot_video_adapter_active = 0; } /* Loop until all modes has been tested out. */ @@ -618,7 +618,7 @@ grub_video_set_mode (const char *modestring, int width = -1; int height = -1; int depth = -1; - grub_err_t err; + VasEBoot_err_t err; unsigned int flags = modevalue; unsigned int flagmask = modemask; @@ -638,7 +638,7 @@ grub_video_set_mode (const char *modestring, next_mode = 0; /* Skip whitespace. */ - while (grub_isspace (*tmp)) + while (VasEBoot_isspace (*tmp)) tmp++; /* Initialize token holders. */ @@ -646,22 +646,22 @@ grub_video_set_mode (const char *modestring, /* XXX: we assume that we're in pure text mode if no video mode is initialized. Is it always true? */ - if (grub_strcmp (current_mode, "text") == 0) + if (VasEBoot_strcmp (current_mode, "text") == 0) { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; - grub_memset (&mode_info, 0, sizeof (mode_info)); - if (((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modemask) == 0) - || ((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) != 0)) + VasEBoot_memset (&mode_info, 0, sizeof (mode_info)); + if (((VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT & modemask) == 0) + || ((VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) != 0)) { /* Valid mode found from adapter, and it has been activated. Specify it as active adapter. */ - grub_video_adapter_active = NULL; + VasEBoot_video_adapter_active = NULL; /* Free memory. */ - grub_free (modevar); + VasEBoot_free (modevar); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } @@ -669,7 +669,7 @@ grub_video_set_mode (const char *modestring, if (err) { /* Free memory before returning. */ - grub_free (modevar); + VasEBoot_free (modevar); return err; } @@ -677,85 +677,85 @@ grub_video_set_mode (const char *modestring, /* Try out video mode. */ /* If user requested specific depth check if this depth is supported. */ - if (depth != -1 && (flagmask & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) + if (depth != -1 && (flagmask & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) && - (((flags & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) - != ((depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK)))) + (((flags & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK) + != ((depth << VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS) + & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK)))) continue; if (depth != -1) { - flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; - flagmask |= GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; + flags |= (depth << VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS) + & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK; + flagmask |= VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK; } /* Try to initialize requested mode. Ignore any errors. */ - grub_video_adapter_t p; + VasEBoot_video_adapter_t p; /* Loop thru all possible video adapter trying to find requested mode. */ - for (p = grub_video_adapter_list; p; p = p->next) + for (p = VasEBoot_video_adapter_list; p; p = p->next) { - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; - grub_memset (&mode_info, 0, sizeof (mode_info)); + VasEBoot_memset (&mode_info, 0, sizeof (mode_info)); /* Try to initialize adapter, if it fails, skip to next adapter. */ err = p->init (); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } /* Try to initialize video mode. */ err = p->setup (width, height, flags, flagmask); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) { p->fini (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } err = p->get_info (&mode_info); - if (err != GRUB_ERR_NONE) + if (err != VasEBoot_ERR_NONE) { p->fini (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } - flags = mode_info.mode_type & ~GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; - flags |= (mode_info.bpp << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; + flags = mode_info.mode_type & ~VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK; + flags |= (mode_info.bpp << VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS) + & VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK; /* Check that mode is suitable for upper layer. */ - if ((flags & GRUB_VIDEO_MODE_TYPE_PURE_TEXT) - ? (((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modemask) != 0) - && ((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) == 0)) + if ((flags & VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT) + ? (((VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT & modemask) != 0) + && ((VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) == 0)) : ((flags & modemask) != modevalue)) { p->fini (); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; continue; } /* Valid mode found from adapter, and it has been activated. Specify it as active adapter. */ - grub_video_adapter_active = p; + VasEBoot_video_adapter_active = p; /* Free memory. */ - grub_free (modevar); + VasEBoot_free (modevar); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } } /* Free memory. */ - grub_free (modevar); + VasEBoot_free (modevar); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return VasEBoot_error (VasEBoot_ERR_BAD_ARGUMENT, N_("no suitable video mode found")); } diff --git a/acinclude.m4 b/acinclude.m4 index 78cdf6e1d..3fff60a5a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -14,35 +14,35 @@ $2 dnl Check whether target compiler is working -AC_DEFUN([grub_PROG_TARGET_CC], +AC_DEFUN([VasEBoot_PROG_TARGET_CC], [AC_MSG_CHECKING([whether target compiler is working]) -AC_CACHE_VAL(grub_cv_prog_target_cc, +AC_CACHE_VAL(VasEBoot_cv_prog_target_cc, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ asm (".globl start; start:"); void __main (void); void __main (void) {} int main (void); ]], [[]])], - [grub_cv_prog_target_cc=yes], - [grub_cv_prog_target_cc=no]) + [VasEBoot_cv_prog_target_cc=yes], + [VasEBoot_cv_prog_target_cc=no]) ]) -AC_MSG_RESULT([$grub_cv_prog_target_cc]) +AC_MSG_RESULT([$VasEBoot_cv_prog_target_cc]) -if test "x$grub_cv_prog_target_cc" = xno; then +if test "x$VasEBoot_cv_prog_target_cc" = xno; then AC_MSG_ERROR([cannot compile for the target]) fi ]) -dnl grub_ASM_USCORE checks if C symbols get an underscore after +dnl VasEBoot_ASM_USCORE checks if C symbols get an underscore after dnl compiling to assembler. -dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by +dnl Written by Pavel Roskin. Based on VasEBoot_ASM_EXT_C written by dnl Erich Boleyn and modified by Yoshinori K. Okuji. -AC_DEFUN([grub_ASM_USCORE], +AC_DEFUN([VasEBoot_ASM_USCORE], [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_EGREP]) AC_MSG_CHECKING([if C symbols get an underscore after compilation]) -AC_CACHE_VAL(grub_cv_asm_uscore, +AC_CACHE_VAL(VasEBoot_cv_asm_uscore, [cat > conftest.c <<\EOF int func (int *); int @@ -61,23 +61,23 @@ fi if $EGREP '(^|[^_[:alnum]])_func' conftest.s >/dev/null 2>&1; then HAVE_ASM_USCORE=1 - grub_cv_asm_uscore=yes + VasEBoot_cv_asm_uscore=yes else HAVE_ASM_USCORE=0 - grub_cv_asm_uscore=no + VasEBoot_cv_asm_uscore=no fi rm -f conftest*]) -AC_MSG_RESULT([$grub_cv_asm_uscore]) +AC_MSG_RESULT([$VasEBoot_cv_asm_uscore]) ]) dnl Some versions of `objcopy -O binary' vary their output depending dnl on the link address. -AC_DEFUN([grub_PROG_OBJCOPY_ABSOLUTE], +AC_DEFUN([VasEBoot_PROG_OBJCOPY_ABSOLUTE], [AC_MSG_CHECKING([whether ${TARGET_OBJCOPY} works for absolute addresses]) -AC_CACHE_VAL(grub_cv_prog_objcopy_absolute, +AC_CACHE_VAL(VasEBoot_cv_prog_objcopy_absolute, [cat > conftest.c <<\EOF void cmain (void); void @@ -91,7 +91,7 @@ if AC_TRY_EVAL(ac_compile) && test -s conftest.o; then : else AC_MSG_ERROR([${CC-cc} cannot compile C source code]) fi -grub_cv_prog_objcopy_absolute=yes +VasEBoot_cv_prog_objcopy_absolute=yes for link_addr in 0x2000 0x8000 0x7C00; do if AC_TRY_COMMAND([${CC-cc} ${TARGET_CFLAGS} ${TARGET_LDFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},$link_addr conftest.o -o conftest.exec]); then : else @@ -104,80 +104,80 @@ for link_addr in 0x2000 0x8000 0x7C00; do if test ! -f conftest.old || AC_TRY_COMMAND([cmp -s conftest.old conftest]); then mv -f conftest conftest.old else - grub_cv_prog_objcopy_absolute=no + VasEBoot_cv_prog_objcopy_absolute=no break fi done rm -f conftest*]) -AC_MSG_RESULT([$grub_cv_prog_objcopy_absolute]) +AC_MSG_RESULT([$VasEBoot_cv_prog_objcopy_absolute]) -if test "x$grub_cv_prog_objcopy_absolute" = xno; then - AC_MSG_ERROR([GRUB requires a working absolute objcopy; upgrade your binutils]) +if test "x$VasEBoot_cv_prog_objcopy_absolute" = xno; then + AC_MSG_ERROR([VasEBoot requires a working absolute objcopy; upgrade your binutils]) fi ]) dnl Supply --build-id=none to ld if building modules. dnl This suppresses warnings from ld on some systems -AC_DEFUN([grub_PROG_LD_BUILD_ID_NONE], +AC_DEFUN([VasEBoot_PROG_LD_BUILD_ID_NONE], [AC_MSG_CHECKING([whether linker accepts --build-id=none]) -AC_CACHE_VAL(grub_cv_prog_ld_build_id_none, +AC_CACHE_VAL(VasEBoot_cv_prog_ld_build_id_none, [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_prog_ld_build_id_none=yes], - [grub_cv_prog_ld_build_id_none=no]) + [VasEBoot_cv_prog_ld_build_id_none=yes], + [VasEBoot_cv_prog_ld_build_id_none=no]) LDFLAGS="$save_LDFLAGS" ]) -AC_MSG_RESULT([$grub_cv_prog_ld_build_id_none]) +AC_MSG_RESULT([$VasEBoot_cv_prog_ld_build_id_none]) -if test "x$grub_cv_prog_ld_build_id_none" = xyes; then +if test "x$VasEBoot_cv_prog_ld_build_id_none" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" fi ]) dnl Check nm -AC_DEFUN([grub_PROG_NM_WORKS], +AC_DEFUN([VasEBoot_PROG_NM_WORKS], [AC_MSG_CHECKING([whether nm works]) -AC_CACHE_VAL(grub_cv_prog_nm_works, +AC_CACHE_VAL(VasEBoot_cv_prog_nm_works, [ nm_works_tmp_dir="$(mktemp -d "./confXXXXXX")" AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])]) $TARGET_CC $TARGET_CFLAGS -c conftest.c -o "$nm_works_tmp_dir/ef" if $TARGET_NM "$nm_works_tmp_dir/ef" > /dev/null; then - grub_cv_prog_nm_works=yes + VasEBoot_cv_prog_nm_works=yes else - grub_cv_prog_nm_minus_p=no + VasEBoot_cv_prog_nm_minus_p=no fi rm "$nm_works_tmp_dir/ef" rmdir "$nm_works_tmp_dir" ]) -AC_MSG_RESULT([$grub_cv_prog_nm_works]) +AC_MSG_RESULT([$VasEBoot_cv_prog_nm_works]) -if test "x$grub_cv_prog_nm_works" != xyes; then +if test "x$VasEBoot_cv_prog_nm_works" != xyes; then AC_MSG_ERROR([nm does not work]) fi ]) dnl Supply -P to nm -AC_DEFUN([grub_PROG_NM_MINUS_P], +AC_DEFUN([VasEBoot_PROG_NM_MINUS_P], [AC_MSG_CHECKING([whether nm accepts -P]) -AC_CACHE_VAL(grub_cv_prog_nm_minus_p, +AC_CACHE_VAL(VasEBoot_cv_prog_nm_minus_p, [ nm_minus_p_tmp_dir="$(mktemp -d "./confXXXXXX")" AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])]) $TARGET_CC $TARGET_CFLAGS -c conftest.c -o "$nm_minus_p_tmp_dir/ef" if $TARGET_NM -P "$nm_minus_p_tmp_dir/ef" 2>&1 > /dev/null; then - grub_cv_prog_nm_minus_p=yes + VasEBoot_cv_prog_nm_minus_p=yes else - grub_cv_prog_nm_minus_p=no + VasEBoot_cv_prog_nm_minus_p=no fi rm "$nm_minus_p_tmp_dir/ef" rmdir "$nm_minus_p_tmp_dir" ]) -AC_MSG_RESULT([$grub_cv_prog_nm_minus_p]) +AC_MSG_RESULT([$VasEBoot_cv_prog_nm_minus_p]) -if test "x$grub_cv_prog_nm_minus_p" = xyes; then +if test "x$VasEBoot_cv_prog_nm_minus_p" = xyes; then TARGET_NMFLAGS_MINUS_P="-P" else TARGET_NMFLAGS_MINUS_P= @@ -185,24 +185,24 @@ fi ]) dnl Supply --defined-only to nm -AC_DEFUN([grub_PROG_NM_DEFINED_ONLY], +AC_DEFUN([VasEBoot_PROG_NM_DEFINED_ONLY], [AC_MSG_CHECKING([whether nm accepts --defined-only]) -AC_CACHE_VAL(grub_cv_prog_nm_defined_only, +AC_CACHE_VAL(VasEBoot_cv_prog_nm_defined_only, [ nm_defined_only_tmp_dir="$(mktemp -d "./confXXXXXX")" AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])]) $TARGET_CC $TARGET_CFLAGS -c conftest.c -o "$nm_defined_only_tmp_dir/ef" if $TARGET_NM --defined-only "$nm_defined_only_tmp_dir/ef" 2>&1 > /dev/null; then - grub_cv_prog_nm_defined_only=yes + VasEBoot_cv_prog_nm_defined_only=yes else - grub_cv_prog_nm_defined_only=no + VasEBoot_cv_prog_nm_defined_only=no fi rm "$nm_defined_only_tmp_dir/ef" rmdir "$nm_defined_only_tmp_dir" ]) -AC_MSG_RESULT([$grub_cv_prog_nm_defined_only]) +AC_MSG_RESULT([$VasEBoot_cv_prog_nm_defined_only]) -if test "x$grub_cv_prog_nm_defined_only" = xyes; then +if test "x$VasEBoot_cv_prog_nm_defined_only" = xyes; then TARGET_NMFLAGS_DEFINED_ONLY=--defined-only else TARGET_NMFLAGS_DEFINED_ONLY= @@ -212,10 +212,10 @@ fi dnl Check what symbol is defined as a bss start symbol. dnl Written by Michael Hohmoth and Yoshinori K. Okuji. -AC_DEFUN([grub_CHECK_BSS_START_SYMBOL], +AC_DEFUN([VasEBoot_CHECK_BSS_START_SYMBOL], [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([if __bss_start is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol, +AC_CACHE_VAL(VasEBoot_cv_check_uscore_uscore_bss_start_symbol, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ asm (".globl start; start:"); void __main (void); @@ -223,42 +223,42 @@ void __main (void) {} int main (void); ]], [[asm ("incl __bss_start")]])], - [grub_cv_check_uscore_uscore_bss_start_symbol=yes], - [grub_cv_check_uscore_uscore_bss_start_symbol=no])]) + [VasEBoot_cv_check_uscore_uscore_bss_start_symbol=yes], + [VasEBoot_cv_check_uscore_uscore_bss_start_symbol=no])]) -AC_MSG_RESULT([$grub_cv_check_uscore_uscore_bss_start_symbol]) +AC_MSG_RESULT([$VasEBoot_cv_check_uscore_uscore_bss_start_symbol]) AC_MSG_CHECKING([if edata is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_edata_symbol, +AC_CACHE_VAL(VasEBoot_cv_check_edata_symbol, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ asm (".globl start; start:"); void __main (void); void __main (void) {} int main (void);]], [[asm ("incl edata")]])], - [grub_cv_check_edata_symbol=yes], - [grub_cv_check_edata_symbol=no])]) + [VasEBoot_cv_check_edata_symbol=yes], + [VasEBoot_cv_check_edata_symbol=no])]) -AC_MSG_RESULT([$grub_cv_check_edata_symbol]) +AC_MSG_RESULT([$VasEBoot_cv_check_edata_symbol]) AC_MSG_CHECKING([if _edata is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_uscore_edata_symbol, +AC_CACHE_VAL(VasEBoot_cv_check_uscore_edata_symbol, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ asm (".globl start; start:"); void __main (void); void __main (void) {} int main (void);]], [[asm ("incl _edata")]])], - [grub_cv_check_uscore_edata_symbol=yes], - [grub_cv_check_uscore_edata_symbol=no])]) + [VasEBoot_cv_check_uscore_edata_symbol=yes], + [VasEBoot_cv_check_uscore_edata_symbol=no])]) -AC_MSG_RESULT([$grub_cv_check_uscore_edata_symbol]) +AC_MSG_RESULT([$VasEBoot_cv_check_uscore_edata_symbol]) -if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then +if test "x$VasEBoot_cv_check_uscore_uscore_bss_start_symbol" = xyes; then BSS_START_SYMBOL=__bss_start -elif test "x$grub_cv_check_edata_symbol" = xyes; then +elif test "x$VasEBoot_cv_check_edata_symbol" = xyes; then BSS_START_SYMBOL=edata -elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then +elif test "x$VasEBoot_cv_check_uscore_edata_symbol" = xyes; then BSS_START_SYMBOL=_edata else AC_MSG_ERROR([none of __bss_start, edata or _edata is defined]) @@ -267,37 +267,37 @@ fi dnl Check what symbol is defined as an end symbol. dnl Written by Yoshinori K. Okuji. -AC_DEFUN([grub_CHECK_END_SYMBOL], +AC_DEFUN([VasEBoot_CHECK_END_SYMBOL], [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([if end is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_end_symbol, +AC_CACHE_VAL(VasEBoot_cv_check_end_symbol, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ asm (".globl start; start:"); void __main (void); void __main (void) {} int main (void);]], [[asm ("incl end")]])], - [grub_cv_check_end_symbol=yes], - [grub_cv_check_end_symbol=no])]) + [VasEBoot_cv_check_end_symbol=yes], + [VasEBoot_cv_check_end_symbol=no])]) -AC_MSG_RESULT([$grub_cv_check_end_symbol]) +AC_MSG_RESULT([$VasEBoot_cv_check_end_symbol]) AC_MSG_CHECKING([if _end is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_uscore_end_symbol, +AC_CACHE_VAL(VasEBoot_cv_check_uscore_end_symbol, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ asm (".globl start; start:"); void __main (void); void __main (void) {} int main (void);]], [[asm ("incl _end")]])], - [grub_cv_check_uscore_end_symbol=yes], - [grub_cv_check_uscore_end_symbol=no])]) + [VasEBoot_cv_check_uscore_end_symbol=yes], + [VasEBoot_cv_check_uscore_end_symbol=no])]) -AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol]) +AC_MSG_RESULT([$VasEBoot_cv_check_uscore_end_symbol]) -if test "x$grub_cv_check_end_symbol" = xyes; then +if test "x$VasEBoot_cv_check_end_symbol" = xyes; then END_SYMBOL=end -elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then +elif test "x$VasEBoot_cv_check_uscore_end_symbol" = xyes; then END_SYMBOL=_end else AC_MSG_ERROR([neither end nor _end is defined]) @@ -306,7 +306,7 @@ fi dnl Check if the C compiler supports `-fstack-protector'. -AC_DEFUN([grub_CHECK_STACK_PROTECTOR],[ +AC_DEFUN([VasEBoot_CHECK_STACK_PROTECTOR],[ [# Smashing stack protector. ssp_possible=yes] AC_MSG_CHECKING([whether `$CC' accepts `-fstack-protector']) @@ -327,7 +327,7 @@ else ]) dnl Check if the C compiler supports `-mstack-arg-probe' (Cygwin). -AC_DEFUN([grub_CHECK_STACK_ARG_PROBE],[ +AC_DEFUN([VasEBoot_CHECK_STACK_ARG_PROBE],[ [# Smashing stack arg probe. sap_possible=yes] AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe']) @@ -345,12 +345,12 @@ else ]) dnl Check if ln -s can handle directories properly (mingw). -AC_DEFUN([grub_CHECK_LINK_DIR],[ +AC_DEFUN([VasEBoot_CHECK_LINK_DIR],[ AC_MSG_CHECKING([whether ln -s can handle directories properly]) [mkdir testdir 2>/dev/null case $srcdir in -[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; - *) reldir=../$srcdir/include/grub/util ;; +[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/VasEBoot/util ;; + *) reldir=../$srcdir/include/VasEBoot/util ;; esac if ln -s $reldir testdir/util 2>/dev/null && rm -f testdir/util 2>/dev/null ; then] AC_MSG_RESULT([yes]) @@ -363,7 +363,7 @@ rm -rf testdir] ]) dnl Check if the C compiler supports `-fPIE'. -AC_DEFUN([grub_CHECK_PIE],[ +AC_DEFUN([VasEBoot_CHECK_PIE],[ [# Position independent executable. pie_possible=yes] AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default]) @@ -390,7 +390,7 @@ else [fi] ]) -AC_DEFUN([grub_CHECK_LINK_PIE],[ +AC_DEFUN([VasEBoot_CHECK_LINK_PIE],[ [# Position independent executable. link_nopie_needed=no] AC_MSG_CHECKING([whether linker needs disabling of PIE to work]) @@ -408,42 +408,42 @@ else dnl Check if the Linker supports `-no-pie'. -AC_DEFUN([grub_CHECK_NO_PIE], +AC_DEFUN([VasEBoot_CHECK_NO_PIE], [AC_MSG_CHECKING([whether linker accepts -no-pie]) -AC_CACHE_VAL(grub_cv_cc_ld_no_pie, +AC_CACHE_VAL(VasEBoot_cv_cc_ld_no_pie, [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -no-pie -nostdlib -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_ld_no_pie=yes], - [grub_cv_cc_ld_no_pie=no]) + [VasEBoot_cv_cc_ld_no_pie=yes], + [VasEBoot_cv_cc_ld_no_pie=no]) LDFLAGS="$save_LDFLAGS" ]) -AC_MSG_RESULT([$grub_cv_cc_ld_no_pie]) +AC_MSG_RESULT([$VasEBoot_cv_cc_ld_no_pie]) nopie_possible=no -if test "x$grub_cv_cc_ld_no_pie" = xyes ; then +if test "x$VasEBoot_cv_cc_ld_no_pie" = xyes ; then nopie_possible=yes fi ]) -AC_DEFUN([grub_CHECK_NO_PIE_ONEWORD], +AC_DEFUN([VasEBoot_CHECK_NO_PIE_ONEWORD], [AC_MSG_CHECKING([whether linker accepts -nopie]) -AC_CACHE_VAL(grub_cv_cc_ld_no_pie_oneword, +AC_CACHE_VAL(VasEBoot_cv_cc_ld_no_pie_oneword, [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -nopie -nostdlib -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_ld_no_pie_oneword=yes], - [grub_cv_cc_ld_no_pie_oneword=no]) + [VasEBoot_cv_cc_ld_no_pie_oneword=yes], + [VasEBoot_cv_cc_ld_no_pie_oneword=no]) LDFLAGS="$save_LDFLAGS" ]) -AC_MSG_RESULT([$grub_cv_cc_ld_no_pie_oneword]) +AC_MSG_RESULT([$VasEBoot_cv_cc_ld_no_pie_oneword]) nopie_oneword_possible=no -if test "x$grub_cv_cc_ld_no_pie_oneword" = xyes ; then +if test "x$VasEBoot_cv_cc_ld_no_pie_oneword" = xyes ; then nopie_oneword_possible=yes fi ]) dnl Check if the C compiler supports `-fPIC'. -AC_DEFUN([grub_CHECK_PIC],[ +AC_DEFUN([VasEBoot_CHECK_PIC],[ [# Position independent executable. pic_possible=yes] AC_MSG_CHECKING([whether `$CC' has `-fPIC' as default]) @@ -470,8 +470,8 @@ else [fi] ]) -dnl Create an output variable with the transformed name of a GRUB utility +dnl Create an output variable with the transformed name of a VasEBoot utility dnl program. -AC_DEFUN([grub_TRANSFORM],[dnl +AC_DEFUN([VasEBoot_TRANSFORM],[dnl AC_SUBST(AS_TR_SH([$1]), [`AS_ECHO([$1]) | sed "$program_transform_name"`])dnl ]) diff --git a/autogen.sh b/autogen.sh index 7537561ad..7a040eefc 100755 --- a/autogen.sh +++ b/autogen.sh @@ -8,42 +8,42 @@ set -e export LC_COLLATE=C unset LC_ALL -find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in +find . -iname '*.[ch]' ! -ipath './VasEBoot-core/lib/libgcrypt-VasEBoot/*' ! -ipath './build-aux/*' ! -ipath './VasEBoot-core/lib/libgcrypt/src/misc.c' ! -ipath './VasEBoot-core/lib/libgcrypt/src/global.c' ! -ipath './VasEBoot-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/VasEBoot-gen-widthspec.c' ! -ipath './util/VasEBoot-gen-asciih.c' |sort > po/POTFILES.in find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in echo "Importing unicode..." -${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c +${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt VasEBoot-core/unidata.c echo "Importing libgcrypt..." -${PYTHON} util/import_gcry.py grub-core/lib/libgcrypt/ grub-core -sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h -if [ -f include/grub/gcrypt/g10lib.h ]; then - rm include/grub/gcrypt/g10lib.h +${PYTHON} util/import_gcry.py VasEBoot-core/lib/libgcrypt/ VasEBoot-core +sed -n -f util/import_gcrypth.sed < VasEBoot-core/lib/libgcrypt/src/gcrypt.h.in > include/VasEBoot/gcrypt/gcrypt.h +if [ -f include/VasEBoot/gcrypt/g10lib.h ]; then + rm include/VasEBoot/gcrypt/g10lib.h fi -if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then - rm -rf grub-core/lib/libgcrypt-grub/mpi/generic +if [ -d VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/generic ]; then + rm -rf VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/generic fi -cp grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h -cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic +cp VasEBoot-core/lib/libgcrypt-VasEBoot/src/g10lib.h include/VasEBoot/gcrypt/g10lib.h +cp -R VasEBoot-core/lib/libgcrypt/mpi/generic VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/generic for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do - if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then - rm grub-core/lib/libgcrypt-grub/mpi/"$x" + if [ -h VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/"$x" ] || [ -f VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/"$x" ]; then + rm VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/"$x" fi - cp grub-core/lib/libgcrypt-grub/mpi/generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x" + cp VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/generic/"$x" VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/"$x" done echo "Generating Automake input..." # Automake doesn't like including files from a path outside the project. -rm -f contrib grub-core/contrib -if [ "x${GRUB_CONTRIB}" != x ]; then - [ "${GRUB_CONTRIB}" = contrib ] || ln -s "${GRUB_CONTRIB}" contrib - [ "${GRUB_CONTRIB}" = grub-core/contrib ] || ln -s ../contrib grub-core/contrib +rm -f contrib VasEBoot-core/contrib +if [ "x${VasEBoot_CONTRIB}" != x ]; then + [ "${VasEBoot_CONTRIB}" = contrib ] || ln -s "${VasEBoot_CONTRIB}" contrib + [ "${VasEBoot_CONTRIB}" = VasEBoot-core/contrib ] || ln -s ../contrib VasEBoot-core/contrib fi UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def' -CORE_DEFS='grub-core/Makefile.core.def grub-core/Makefile.gcry.def' +CORE_DEFS='VasEBoot-core/Makefile.core.def VasEBoot-core/Makefile.gcry.def' for extra in contrib/*/Makefile.util.def; do if test -e "$extra"; then @@ -58,12 +58,12 @@ for extra in contrib/*/Makefile.core.def; do done ${PYTHON} gentpl.py $UTIL_DEFS > Makefile.util.am -${PYTHON} gentpl.py $CORE_DEFS > grub-core/Makefile.core.am +${PYTHON} gentpl.py $CORE_DEFS > VasEBoot-core/Makefile.core.am for extra in contrib/*/Makefile.common; do if test -e "$extra"; then echo "include $extra" >> Makefile.util.am - echo "include $extra" >> grub-core/Makefile.core.am + echo "include $extra" >> VasEBoot-core/Makefile.core.am fi done @@ -75,7 +75,7 @@ done for extra in contrib/*/Makefile.core.common; do if test -e "$extra"; then - echo "include $extra" >> grub-core/Makefile.core.am + echo "include $extra" >> VasEBoot-core/Makefile.core.am fi done diff --git a/conf/Makefile.common b/conf/Makefile.common index 11296b550..2bced45a7 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -23,20 +23,20 @@ endif # Other options -CPPFLAGS_DEFAULT = -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\" +CPPFLAGS_DEFAULT = -DVasEBoot_FILE=\"$(subst $(srcdir)/,,$<)\" CPPFLAGS_DEFAULT += -I$(builddir) CPPFLAGS_DEFAULT += -I$(srcdir) CPPFLAGS_DEFAULT += -I$(top_builddir) CPPFLAGS_DEFAULT += -I$(top_srcdir) CPPFLAGS_DEFAULT += -I$(top_srcdir)/include CPPFLAGS_DEFAULT += -I$(top_builddir)/include -CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/ +CPPFLAGS_DEFAULT += -I$(top_srcdir)/VasEBoot-core/lib/libgcrypt-VasEBoot/src/ CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1 BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT) CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 +CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DVasEBoot_KERNEL=1 CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags -R .ARM.exidx @@ -61,31 +61,31 @@ CCASFLAGS_LIBRARY = # Other variables -grubconfdir = $(sysconfdir)/grub.d +VasEBootconfdir = $(sysconfdir)/VasEBoot.d platformdir = $(pkglibdir)/$(target_cpu)-$(platform) starfielddir = $(pkgdatadir)/themes/starfield CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib +CPPFLAGS_GNULIB = -I$(top_builddir)/VasEBoot-core/gnulib -I$(top_srcdir)/VasEBoot-core/gnulib CFLAGS_POSIX = -fno-builtin -CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap +CPPFLAGS_POSIX = -I$(top_srcdir)/VasEBoot-core/lib/posix_wrap CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers -Wno-redundant-decls -Wno-undef $(CFLAGS_POSIX) -CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap $(CPPFLAGS_POSIX) -D_GCRYPT_IN_LIBGCRYPT=1 -I$(top_srcdir)/include/grub/gcrypt +CPPFLAGS_GCRY = -I$(top_srcdir)/VasEBoot-core/lib/libgcrypt_wrap $(CPPFLAGS_POSIX) -D_GCRYPT_IN_LIBGCRYPT=1 -I$(top_srcdir)/include/VasEBoot/gcrypt -CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime +CPPFLAGS_EFIEMU = -I$(top_srcdir)/VasEBoot-core/efiemu/runtime # List file macros for recognizing /interesting/ modules -CPPFLAGS_FS_LIST = -Dgrub_fs_register=FS_LIST_MARKER -CPPFLAGS_VIDEO_LIST= -Dgrub_video_register=VIDEO_LIST_MARKER -CPPFLAGS_PARTMAP_LIST = -Dgrub_partition_map_register=PARTMAP_LIST_MARKER -CPPFLAGS_PARTTOOL_LIST = -Dgrub_parttool_register=PARTTOOL_LIST_MARKER -CPPFLAGS_TERMINAL_LIST = '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' -CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' -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_FS_LIST = -DVasEBoot_fs_register=FS_LIST_MARKER +CPPFLAGS_VIDEO_LIST= -DVasEBoot_video_register=VIDEO_LIST_MARKER +CPPFLAGS_PARTMAP_LIST = -DVasEBoot_partition_map_register=PARTMAP_LIST_MARKER +CPPFLAGS_PARTTOOL_LIST = -DVasEBoot_parttool_register=PARTTOOL_LIST_MARKER +CPPFLAGS_TERMINAL_LIST = '-DVasEBoot_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_TERMINAL_LIST += '-DVasEBoot_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_COMMAND_LIST = '-DVasEBoot_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_COMMAND_LIST += '-DVasEBoot_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_COMMAND_LIST += '-DVasEBoot_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)' CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \ $(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \ $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) @@ -107,11 +107,11 @@ bin_PROGRAMS = platform_DATA = sbin_PROGRAMS = check_SCRIPTS = -dist_grubconf_DATA = +dist_VasEBootconf_DATA = check_PROGRAMS = noinst_SCRIPTS = noinst_PROGRAMS = -grubconf_SCRIPTS = +VasEBootconf_SCRIPTS = noinst_LIBRARIES = dist_noinst_DATA = platform_SCRIPTS = @@ -129,8 +129,8 @@ $(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.u python $^ > $@.new || (rm -f $@.new; exit 1) mv $@.new $@ -.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am -$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def - if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi +.PRECIOUS: $(top_srcdir)/VasEBoot-core/Makefile.core.am +$(top_srcdir)/VasEBoot-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/VasEBoot-core/Makefile.core.def $(top_srcdir)/VasEBoot-core/Makefile.gcry.def + if [ "x$$VasEBoot_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi python $^ > $@.new || (rm -f $@.new; exit 1) mv $@.new $@ diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index b16bd9253..adbfacf9a 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -13,48 +13,48 @@ EXTRA_DIST += util/import_unicode.py EXTRA_DIST += docs/man EXTRA_DIST += docs/autoiso.cfg -EXTRA_DIST += docs/grub.cfg +EXTRA_DIST += docs/VasEBoot.cfg EXTRA_DIST += docs/osdetect.cfg EXTRA_DIST += conf/i386-cygwin-img-ld.sc -EXTRA_DIST += grub-core/Makefile.core.def -EXTRA_DIST += grub-core/Makefile.gcry.def +EXTRA_DIST += VasEBoot-core/Makefile.core.def +EXTRA_DIST += VasEBoot-core/Makefile.gcry.def -EXTRA_DIST += grub-core/genmoddep.awk -EXTRA_DIST += grub-core/genmod.sh.in -EXTRA_DIST += grub-core/gensyminfo.sh.in -EXTRA_DIST += grub-core/gensymlist.sh -EXTRA_DIST += grub-core/genemuinit.sh -EXTRA_DIST += grub-core/genemuinitheader.sh +EXTRA_DIST += VasEBoot-core/genmoddep.awk +EXTRA_DIST += VasEBoot-core/genmod.sh.in +EXTRA_DIST += VasEBoot-core/gensyminfo.sh.in +EXTRA_DIST += VasEBoot-core/gensymlist.sh +EXTRA_DIST += VasEBoot-core/genemuinit.sh +EXTRA_DIST += VasEBoot-core/genemuinitheader.sh -EXTRA_DIST += grub-core/gnulib-fix-null-deref.diff -EXTRA_DIST += grub-core/gnulib-fix-width.diff -EXTRA_DIST += grub-core/gnulib-no-abort.diff -EXTRA_DIST += grub-core/gnulib-no-gets.diff +EXTRA_DIST += VasEBoot-core/gnulib-fix-null-deref.diff +EXTRA_DIST += VasEBoot-core/gnulib-fix-width.diff +EXTRA_DIST += VasEBoot-core/gnulib-no-abort.diff +EXTRA_DIST += VasEBoot-core/gnulib-no-gets.diff -EXTRA_DIST += grub-core/lib/libgcrypt -EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic +EXTRA_DIST += VasEBoot-core/lib/libgcrypt +EXTRA_DIST += VasEBoot-core/lib/libgcrypt-VasEBoot/mpi/generic EXTRA_DIST += $(shell find $(top_srcdir)/include -name '*.h') -EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib -name '*.h') -EXTRA_DIST += grub-core/efiemu/runtime/config.h +EXTRA_DIST += $(shell find $(top_srcdir)/VasEBoot-core/lib -name '*.h') +EXTRA_DIST += VasEBoot-core/efiemu/runtime/config.h -EXTRA_DIST += grub-core/lib/LzmaDec.c +EXTRA_DIST += VasEBoot-core/lib/LzmaDec.c -EXTRA_DIST += grub-core/fs/cpio_common.c +EXTRA_DIST += VasEBoot-core/fs/cpio_common.c EXTRA_DIST += BUGS -EXTRA_DIST += util/i386/efi/grub-dumpdevtree +EXTRA_DIST += util/i386/efi/VasEBoot-dumpdevtree EXTRA_DIST += util/spkmodem-recv.c EXTRA_DIST += util/import_gcrypth.sed EXTRA_DIST += util/bin2h.c -EXTRA_DIST += util/grub-gen-asciih.c -EXTRA_DIST += util/grub-gen-widthspec.c -EXTRA_DIST += util/grub-module-verifier.c -EXTRA_DIST += util/grub-module-verifier32.c -EXTRA_DIST += util/grub-module-verifier64.c -EXTRA_DIST += util/grub-module-verifierXX.c -EXTRA_DIST += util/grub-pe2elf.c +EXTRA_DIST += util/VasEBoot-gen-asciih.c +EXTRA_DIST += util/VasEBoot-gen-widthspec.c +EXTRA_DIST += util/VasEBoot-module-verifier.c +EXTRA_DIST += util/VasEBoot-module-verifier32.c +EXTRA_DIST += util/VasEBoot-module-verifier64.c +EXTRA_DIST += util/VasEBoot-module-verifierXX.c +EXTRA_DIST += util/VasEBoot-pe2elf.c EXTRA_DIST += m4/gnulib-cache.m4 @@ -73,43 +73,43 @@ EXTRA_DIST += m4/uintmax_t.m4 EXTRA_DIST += m4/visibility.m4 EXTRA_DIST += m4/math_h.m4 -EXTRA_DIST += grub-core/osdep/apple/hostdisk.c -EXTRA_DIST += grub-core/osdep/aros/hostdisk.c -EXTRA_DIST += grub-core/osdep/basic/hostdisk.c -EXTRA_DIST += grub-core/osdep/bsd/hostdisk.c -EXTRA_DIST += grub-core/osdep/freebsd/hostdisk.c -EXTRA_DIST += grub-core/osdep/hurd/hostdisk.c -EXTRA_DIST += grub-core/osdep/linux/hostdisk.c -EXTRA_DIST += grub-core/osdep/windows/hostdisk.c -EXTRA_DIST += grub-core/osdep/sun/hostdisk.c -EXTRA_DIST += grub-core/osdep/haiku/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/apple/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/aros/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/basic/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/bsd/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/freebsd/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/hurd/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/linux/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/windows/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/sun/hostdisk.c +EXTRA_DIST += VasEBoot-core/osdep/haiku/hostdisk.c -EXTRA_DIST += grub-core/osdep/basic/init.c -EXTRA_DIST += grub-core/osdep/windows/init.c +EXTRA_DIST += VasEBoot-core/osdep/basic/init.c +EXTRA_DIST += VasEBoot-core/osdep/windows/init.c -EXTRA_DIST += grub-core/osdep/apple/getroot.c -EXTRA_DIST += grub-core/osdep/aros/getroot.c -EXTRA_DIST += grub-core/osdep/basic/getroot.c -EXTRA_DIST += grub-core/osdep/bsd/getroot.c -EXTRA_DIST += grub-core/osdep/windows/getroot.c -EXTRA_DIST += grub-core/osdep/freebsd/getroot.c -EXTRA_DIST += grub-core/osdep/hurd/getroot.c -EXTRA_DIST += grub-core/osdep/linux/getroot.c -EXTRA_DIST += grub-core/osdep/sun/getroot.c -EXTRA_DIST += grub-core/osdep/haiku/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/apple/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/aros/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/basic/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/bsd/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/windows/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/freebsd/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/hurd/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/linux/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/sun/getroot.c +EXTRA_DIST += VasEBoot-core/osdep/haiku/getroot.c -EXTRA_DIST += grub-core/osdep/basic/random.c -EXTRA_DIST += grub-core/osdep/basic/ofpath.c +EXTRA_DIST += VasEBoot-core/osdep/basic/random.c +EXTRA_DIST += VasEBoot-core/osdep/basic/ofpath.c -EXTRA_DIST += grub-core/osdep/unix/password.c -EXTRA_DIST += grub-core/osdep/unix/random.c -EXTRA_DIST += grub-core/osdep/unix/sleep.c +EXTRA_DIST += VasEBoot-core/osdep/unix/password.c +EXTRA_DIST += VasEBoot-core/osdep/unix/random.c +EXTRA_DIST += VasEBoot-core/osdep/unix/sleep.c -EXTRA_DIST += grub-core/osdep/linux/ofpath.c +EXTRA_DIST += VasEBoot-core/osdep/linux/ofpath.c -EXTRA_DIST += grub-core/osdep/windows/password.c -EXTRA_DIST += grub-core/osdep/windows/random.c -EXTRA_DIST += grub-core/osdep/windows/sleep.c +EXTRA_DIST += VasEBoot-core/osdep/windows/password.c +EXTRA_DIST += VasEBoot-core/osdep/windows/random.c +EXTRA_DIST += VasEBoot-core/osdep/windows/sleep.c EXTRA_DIST += tests/dfly-mbr-mbexample.mbr.img.gz EXTRA_DIST += tests/dfly-mbr-mbexample.dfly.img.gz @@ -137,4 +137,4 @@ EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/stdmenu.cfg EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/dtmenu.cfg EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/po4a.cfg EXTRA_DIST += tests/syslinux/ubuntu10.04/isolinux/rqtxt.cfg -EXTRA_DIST += tests/syslinux/ubuntu10.04_grub.cfg.in +EXTRA_DIST += tests/syslinux/ubuntu10.04_VasEBoot.cfg.in diff --git a/conf/i386-cygwin-img-ld.sc b/conf/i386-cygwin-img-ld.sc index 3ac26fcce..e7481af63 100644 --- a/conf/i386-cygwin-img-ld.sc +++ b/conf/i386-cygwin-img-ld.sc @@ -1,4 +1,4 @@ -/* Linker script to create grub .img files on Cygwin. */ +/* Linker script to create VasEBoot .img files on Cygwin. */ SECTIONS { diff --git a/config.h.in b/config.h.in index 9e8f9911b..a091e78f4 100644 --- a/config.h.in +++ b/config.h.in @@ -21,7 +21,7 @@ #define MINILZO_CFG_SKIP_LZO1X_1_COMPRESS 1 #define MINILZO_CFG_SKIP_LZO1X_DECOMPRESS 1 -#if defined (GRUB_BUILD) +#if defined (VasEBoot_BUILD) #undef ENABLE_NLS #define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@ #define BUILD_SIZEOF_VOID_P @BUILD_SIZEOF_VOID_P@ @@ -34,7 +34,7 @@ #else #define BUILD_WORDS_BIGENDIAN @BUILD_WORDS_BIGENDIAN@ #endif -#elif defined (GRUB_UTIL) || !defined (GRUB_MACHINE) +#elif defined (VasEBoot_UTIL) || !defined (VasEBoot_MACHINE) #include #else #define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ @@ -57,8 +57,8 @@ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" -#define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@" -#define GRUB_PLATFORM "@GRUB_PLATFORM@" +#define VasEBoot_TARGET_CPU "@VasEBoot_TARGET_CPU@" +#define VasEBoot_PLATFORM "@VasEBoot_PLATFORM@" #define RE_ENABLE_I18N 1 diff --git a/configure.ac b/configure.ac index edd184154..d301f917d 100644 --- a/configure.ac +++ b/configure.ac @@ -13,15 +13,15 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -dnl This configure script is complicated, because GRUB needs to deal +dnl This configure script is complicated, because VasEBoot needs to deal dnl with three potentially different types: dnl -dnl build -- the environment for building GRUB +dnl build -- the environment for building VasEBoot dnl host -- the environment for running utilities -dnl target -- the environment for running GRUB +dnl target -- the environment for running VasEBoot dnl -dnl In addition, GRUB needs to deal with a platform specification -dnl which specifies the system running GRUB, such as firmware. +dnl In addition, VasEBoot needs to deal with a platform specification +dnl which specifies the system running VasEBoot, such as firmware. dnl This is necessary because the target type in autoconf does not dnl describe such a system very well. dnl @@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are dnl used for the target type. See INSTALL for full list of variables. -AC_INIT([GRUB],[2.02],[bug-grub@gnu.org]) +AC_INIT([VasEBoot],[2.02],[bug-VasEBoot@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) @@ -47,29 +47,29 @@ program_prefix="${save_program_prefix}" AM_INIT_AUTOMAKE([1.10.1]) AC_PREREQ(2.60) -AC_CONFIG_SRCDIR([include/grub/dl.h]) +AC_CONFIG_SRCDIR([include/VasEBoot/dl.h]) AC_CONFIG_HEADER([config-util.h]) # Program name transformations AC_ARG_PROGRAM -grub_TRANSFORM([grub-bios-setup]) -grub_TRANSFORM([grub-editenv]) -grub_TRANSFORM([grub-install]) -grub_TRANSFORM([grub-mkconfig]) -grub_TRANSFORM([grub-mkfont]) -grub_TRANSFORM([grub-mkimage]) -grub_TRANSFORM([grub-glue-efi]) -grub_TRANSFORM([grub-mklayout]) -grub_TRANSFORM([grub-mkpasswd-pbkdf2]) -grub_TRANSFORM([grub-mkrelpath]) -grub_TRANSFORM([grub-mkrescue]) -grub_TRANSFORM([grub-probe]) -grub_TRANSFORM([grub-reboot]) -grub_TRANSFORM([grub-script-check]) -grub_TRANSFORM([grub-set-default]) -grub_TRANSFORM([grub-sparc64-setup]) -grub_TRANSFORM([grub-render-label]) -grub_TRANSFORM([grub-file]) +VasEBoot_TRANSFORM([VasEBoot-bios-setup]) +VasEBoot_TRANSFORM([VasEBoot-editenv]) +VasEBoot_TRANSFORM([VasEBoot-install]) +VasEBoot_TRANSFORM([VasEBoot-mkconfig]) +VasEBoot_TRANSFORM([VasEBoot-mkfont]) +VasEBoot_TRANSFORM([VasEBoot-mkimage]) +VasEBoot_TRANSFORM([VasEBoot-glue-efi]) +VasEBoot_TRANSFORM([VasEBoot-mklayout]) +VasEBoot_TRANSFORM([VasEBoot-mkpasswd-pbkdf2]) +VasEBoot_TRANSFORM([VasEBoot-mkrelpath]) +VasEBoot_TRANSFORM([VasEBoot-mkrescue]) +VasEBoot_TRANSFORM([VasEBoot-probe]) +VasEBoot_TRANSFORM([VasEBoot-reboot]) +VasEBoot_TRANSFORM([VasEBoot-script-check]) +VasEBoot_TRANSFORM([VasEBoot-set-default]) +VasEBoot_TRANSFORM([VasEBoot-sparc64-setup]) +VasEBoot_TRANSFORM([VasEBoot-render-label]) +VasEBoot_TRANSFORM([VasEBoot-file]) # Optimization flag. Allow user to override. if test "x$TARGET_CFLAGS" = x; then @@ -78,7 +78,7 @@ fi # Default HOST_CPPFLAGS HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" -HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" +HOST_CPPFLAGS="$HOST_CPPFLAGS -DVasEBoot_UTIL=1" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W" @@ -88,11 +88,11 @@ case "$target_cpu" in sparc) target_cpu=sparc64 ;; mipsel|mips64el) target_cpu=mipsel - machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1" + machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_CPU_MIPSEL=1" ;; mips|mips64) target_cpu=mips - machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1" + machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_CPU_MIPS=1" ;; arm*) target_cpu=arm @@ -209,23 +209,23 @@ case "$host_os" in esac case "$platform" in - coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;; - multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;; - efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;; - xen) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_XEN=1" ;; - ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;; - uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;; - qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;; - pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;; - emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;; - loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1" ;; - qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1" ;; - arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;; + coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_COREBOOT=1" ;; + multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_MULTIBOOT=1" ;; + efi) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_EFI=1" ;; + xen) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_XEN=1" ;; + ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_IEEE1275=1" ;; + uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_UBOOT=1" ;; + qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_QEMU=1" ;; + pc) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_PCBIOS=1" ;; + emu) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_EMU=1" ;; + loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_MIPS_LOONGSON=1" ;; + qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_MIPS_QEMU_MIPS=1" ;; + arc) machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE_ARC=1" ;; esac if test x${target_cpu} = xmipsel ; then - machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" + machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" else - machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" + machine_CPPFLAGS="$machine_CPPFLAGS -DVasEBoot_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" fi case "${target_cpu}-$platform" in @@ -274,18 +274,18 @@ else fi AC_SUBST(bootdirname) -AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname", +AC_DEFINE_UNQUOTED(VasEBoot_BOOT_DIR_NAME, "$bootdirname", [Default boot directory name]") -AC_ARG_WITH([grubdir], - AS_HELP_STRING([--with-grubdir=DIR], - [set the name of grub directory [[guessed]]]), - [grubdirname="$with_grubdir"], - [grubdirname="$PACKAGE"]) +AC_ARG_WITH([VasEBootdir], + AS_HELP_STRING([--with-VasEBootdir=DIR], + [set the name of VasEBoot directory [[guessed]]]), + [VasEBootdirname="$with_VasEBootdir"], + [VasEBootdirname="$PACKAGE"]) -AC_SUBST(grubdirname) -AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname", - [Default grub directory name]) +AC_SUBST(VasEBootdirname) +AC_DEFINE_UNQUOTED(VasEBoot_DIR_NAME, "$VasEBootdirname", + [Default VasEBoot directory name]) # # Checks for build programs. @@ -319,7 +319,7 @@ else if test -n "$version" -a "$version" -ge 20535; then : else - AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above]) + AC_MSG_ERROR([flex is too old. VasEBoot requires 2.5.35 or above]) fi fi @@ -420,17 +420,17 @@ AC_CHECK_HEADER([util.h], [ ]) AC_SUBST([LIBUTIL]) -AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [ +AC_CACHE_CHECK([whether -Wtrampolines work], [VasEBoot_cv_host_cc_wtrampolines], [ SAVED_CFLAGS="$CFLAGS" CFLAGS="$HOST_CFLAGS -Wtrampolines -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include int va_arg_func (int fixed, va_list args);]], [[]])], - [grub_cv_host_cc_wtrampolines=yes], - [grub_cv_host_cc_wtrampolines=no]) + [VasEBoot_cv_host_cc_wtrampolines=yes], + [VasEBoot_cv_host_cc_wtrampolines=no]) CFLAGS="$SAVED_CFLAGS" ]) -if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then +if test x"$VasEBoot_host_cv_cc_wtrampolines" = xyes ; then HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines" fi @@ -464,20 +464,20 @@ EXTRA_WARN_FLAGS="-Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-point HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS -Wcast-align" -AC_CACHE_CHECK([which extra warnings work], [grub_cv_cc_w_extra_flags], [ +AC_CACHE_CHECK([which extra warnings work], [VasEBoot_cv_cc_w_extra_flags], [ SAVED_CFLAGS="$CFLAGS" - grub_cv_cc_w_extra_flags= + VasEBoot_cv_cc_w_extra_flags= for x in $EXTRA_WARN_FLAGS; do CFLAGS="$HOST_CFLAGS $x -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0]) if test x$flag = x1 ; then - grub_cv_cc_w_extra_flags="$grub_cv_cc_w_extra_flags $x" + VasEBoot_cv_cc_w_extra_flags="$VasEBoot_cv_cc_w_extra_flags $x" fi done CFLAGS="$SAVED_CFLAGS" ]) -HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags" +HOST_CFLAGS="$HOST_CFLAGS $VasEBoot_cv_cc_w_extra_flags" # # Check for target programs. @@ -539,10 +539,10 @@ fi TARGET_CC_VERSION="$(LC_ALL=C $TARGET_CC --version | head -n1)" -AC_CACHE_CHECK([which extra warnings work], [grub_cv_target_cc_w_extra_flags], [ +AC_CACHE_CHECK([which extra warnings work], [VasEBoot_cv_target_cc_w_extra_flags], [ LDFLAGS="$TARGET_LDFLAGS -nostdlib -static" - grub_cv_target_cc_w_extra_flags= + VasEBoot_cv_target_cc_w_extra_flags= for x in $EXTRA_WARN_FLAGS; do CFLAGS="$TARGET_CFLAGS $x -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @@ -552,14 +552,14 @@ void __main (void) {} int main (void); ]], [[]])], [flag=1], [flag=0]) if test x$flag = x1 ; then - grub_cv_target_cc_w_extra_flags="$grub_cv_target_cc_w_extra_flags $x" + VasEBoot_cv_target_cc_w_extra_flags="$VasEBoot_cv_target_cc_w_extra_flags $x" fi done ]) -TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_w_extra_flags" +TARGET_CFLAGS="$TARGET_CFLAGS $VasEBoot_cv_target_cc_w_extra_flags" -AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang], +AC_CACHE_CHECK([if compiling with clang], [VasEBoot_cv_cc_target_clang], [ CFLAGS="$TARGET_CFLAGS" AC_COMPILE_IFELSE( @@ -568,15 +568,15 @@ AC_COMPILE_IFELSE( #error "is clang" #endif ]])], -[grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])]) +[VasEBoot_cv_cc_target_clang=no], [VasEBoot_cv_cc_target_clang=yes])]) if test x$target_cpu = xpowerpc -o x$target_cpu = xmips; then - AC_CACHE_CHECK([for options to get big-endian compilation], grub_cv_target_cc_big_endian, [ - grub_cv_target_cc_big_endian=no + AC_CACHE_CHECK([for options to get big-endian compilation], VasEBoot_cv_target_cc_big_endian, [ + VasEBoot_cv_target_cc_big_endian=no for cand in "-target $target_cpu -Wl,-EB" "-target $target_cpu" \ "-target $target_cpu-linux-gnu -Wl,-EB" "-target $target_cpu-linux-gnu" \ "-EB" "-mbig-endian"; do - if test x"$grub_cv_target_cc_big_endian" != xno ; then + if test x"$VasEBoot_cv_target_cc_big_endian" != xno ; then break fi CFLAGS="$TARGET_CFLAGS $cand -Werror" @@ -591,27 +591,27 @@ void __main (void); void __main (void) {} int main (void); ]], [[]])], - [grub_cv_target_cc_big_endian="$cand"], []) + [VasEBoot_cv_target_cc_big_endian="$cand"], []) done ]) - if test x"$grub_cv_target_cc_big_endian" = xno ; then + if test x"$VasEBoot_cv_target_cc_big_endian" = xno ; then AC_MSG_ERROR([could not force big-endian]) fi - skip_linkflags="$(echo "$grub_cv_target_cc_big_endian"|sed 's@-Wl,-EB@@')" + skip_linkflags="$(echo "$VasEBoot_cv_target_cc_big_endian"|sed 's@-Wl,-EB@@')" TARGET_CFLAGS="$TARGET_CFLAGS $skip_linkflags" TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags" TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags" - TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian" + TARGET_LDFLAGS="$TARGET_LDFLAGS $VasEBoot_cv_target_cc_big_endian" elif test x$target_cpu = xmipsel; then - AC_CACHE_CHECK([for options to get little-endian compilation], grub_cv_target_cc_little_endian, [ - grub_cv_target_cc_little_endian=no + AC_CACHE_CHECK([for options to get little-endian compilation], VasEBoot_cv_target_cc_little_endian, [ + VasEBoot_cv_target_cc_little_endian=no for cand in "-target $target_cpu -Wl,-EL" "-target $target_cpu" \ "-target $target_cpu-linux-gnu -Wl,-EL" "-target $target_cpu-linux-gnu" \ "-EL"; do - if test x"$grub_cv_target_cc_little_endian" != xno ; then + if test x"$VasEBoot_cv_target_cc_little_endian" != xno ; then break fi CFLAGS="$TARGET_CFLAGS $cand -Werror" @@ -626,30 +626,30 @@ void __main (void); void __main (void) {} int main (void); ]], [[]])], - [grub_cv_target_cc_little_endian="$cand"], []) + [VasEBoot_cv_target_cc_little_endian="$cand"], []) done ]) - if test x"$grub_cv_target_cc_little_endian" = xno ; then + if test x"$VasEBoot_cv_target_cc_little_endian" = xno ; then AC_MSG_ERROR([could not force little-endian]) fi - skip_linkflags="$(echo "$grub_cv_target_cc_little_endian"|sed 's@-Wl,-EL@@')" + skip_linkflags="$(echo "$VasEBoot_cv_target_cc_little_endian"|sed 's@-Wl,-EL@@')" TARGET_CFLAGS="$TARGET_CFLAGS $skip_linkflags" TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags" TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags" - TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_little_endian" + TARGET_LDFLAGS="$TARGET_LDFLAGS $VasEBoot_cv_target_cc_little_endian" fi -# GRUB code is N32-compliant but it's experimental and we would prefer to +# VasEBoot code is N32-compliant but it's experimental and we would prefer to # avoid having too much variety when it doesn't result in any real improvement. # Moreover N64 isn't supported. if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then - AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [ - grub_cv_target_cc_mips_o32_abi=no + AC_CACHE_CHECK([for options to force MIPS o32 ABI], VasEBoot_cv_target_cc_mips_o32_abi, [ + VasEBoot_cv_target_cc_mips_o32_abi=no for arg in "" "-mabi=32" "-target $target_cpu -mabi=32" ; do - if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then + if test x"$VasEBoot_cv_target_cc_mips_o32_abi" != xno ; then break fi CFLAGS="$TARGET_CFLAGS $arg -Werror" @@ -664,19 +664,19 @@ void __main (void); void __main (void) {} int main (void); ]], [[]])], - [grub_cv_target_cc_mips_o32_abi="$arg"], []) + [VasEBoot_cv_target_cc_mips_o32_abi="$arg"], []) done ]) - if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then + if test x"$VasEBoot_cv_target_cc_mips_o32_abi" = xno ; then AC_MSG_ERROR([could not force MIPS o32 ABI]) fi - TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi" - TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi" + TARGET_CFLAGS="$TARGET_CFLAGS $VasEBoot_cv_target_cc_mips_o32_abi" + TARGET_CCASFLAGS="$TARGET_CCASFLAGS $VasEBoot_cv_target_cc_mips_o32_abi" fi -AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [ +AC_CACHE_CHECK([for options to compile assembly], [VasEBoot_cv_cc_target_asm_compile], [ test_program= case "x$target_cpu-$platform" in xmips-* | xmipsel-*) @@ -693,14 +693,14 @@ case "x$target_cpu-$platform" in ;; esac if test x"$test_program" = x ; then - grub_cv_cc_target_asm_compile= + VasEBoot_cv_cc_target_asm_compile= else found=no for arg in "" "-no-integrated-as"; do cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S" echo "Running $cmdline" >&AS_MESSAGE_LOG_FD if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - grub_cv_cc_target_asm_compile="$arg" + VasEBoot_cv_cc_target_asm_compile="$arg" found=yes break fi @@ -711,7 +711,7 @@ else fi ]) -TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_cc_target_asm_compile" +TARGET_CCASFLAGS="$TARGET_CCASFLAGS $VasEBoot_cv_cc_target_asm_compile" if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then TARGET_CFLAGS="$TARGET_CFLAGS -march=i386" @@ -735,140 +735,140 @@ if test "x$target_m64" = x1; then TARGET_MODULE_FORMAT="elf64" fi -if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && test "x$platform" != xemu && test "x$platform" != xefi; then +if test "x$VasEBoot_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && test "x$platform" != xemu && test "x$platform" != xefi; then TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3" fi # on mips redirect cache flushing function to non-existant one. if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then - AC_CACHE_CHECK([whether -mflush-func=grub_red_herring works], [grub_cv_cc_mflush_func], [ - CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring -Werror" + AC_CACHE_CHECK([whether -mflush-func=VasEBoot_red_herring works], [VasEBoot_cv_cc_mflush_func], [ + CFLAGS="$TARGET_CFLAGS -mflush-func=VasEBoot_red_herring -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_mflush_func=yes], - [grub_cv_cc_mflush_func=no]) + [VasEBoot_cv_cc_mflush_func=yes], + [VasEBoot_cv_cc_mflush_func=no]) ]) - if test "x$grub_cv_cc_mflush_func" = xyes; then - TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring" + if test "x$VasEBoot_cv_cc_mflush_func" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=VasEBoot_red_herring" fi fi # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ + AC_CACHE_CHECK([whether -falign-loops works], [VasEBoot_cv_cc_falign_loop], [ CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_falign_loop=yes], - [grub_cv_cc_falign_loop=no]) + [VasEBoot_cv_cc_falign_loop=yes], + [VasEBoot_cv_cc_falign_loop=no]) ]) - AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [ + AC_CACHE_CHECK([whether -malign-loops works], [VasEBoot_cv_cc_malign_loop], [ CFLAGS="$TARGET_CFLAGS -malign-loops=1 -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_malign_loop=yes], - [grub_cv_cc_malign_loop=no]) + [VasEBoot_cv_cc_malign_loop=yes], + [VasEBoot_cv_cc_malign_loop=no]) ]) - if test "x$grub_cv_cc_falign_loop" = xyes; then + if test "x$VasEBoot_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" - elif test "x$grub_cv_cc_malign_loop" = xyes; then + elif test "x$VasEBoot_cv_cc_malign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi fi -AC_CACHE_CHECK([whether -freg-struct-return works], [grub_cv_cc_freg_struct_return], [ +AC_CACHE_CHECK([whether -freg-struct-return works], [VasEBoot_cv_cc_freg_struct_return], [ CFLAGS="$TARGET_CFLAGS -freg-struct-return -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_freg_struct_return=yes], - [grub_cv_cc_freg_struct_return=no]) + [VasEBoot_cv_cc_freg_struct_return=yes], + [VasEBoot_cv_cc_freg_struct_return=no]) ]) -if test "x$grub_cv_cc_freg_struct_return" = xyes; then +if test "x$VasEBoot_cv_cc_freg_struct_return" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -freg-struct-return" fi if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then # Some toolchains enable these features by default, but they need - # registers that aren't set up properly in GRUB. + # registers that aren't set up properly in VasEBoot. TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" fi -# GRUB doesn't use float or doubles at all. Yet some toolchains may decide +# VasEBoot doesn't use float or doubles at all. Yet some toolchains may decide # that floats are a good fit to run instead of what's written in the code. # Given that floating point unit is disabled (if present to begin with) -# when GRUB is running which may result in various hard crashes. +# when VasEBoot is running which may result in various hard crashes. if test x"$platform" != xemu ; then - AC_CACHE_CHECK([for options to get soft-float], grub_cv_target_cc_soft_float, [ - grub_cv_target_cc_soft_float=no + AC_CACHE_CHECK([for options to get soft-float], VasEBoot_cv_target_cc_soft_float, [ + VasEBoot_cv_target_cc_soft_float=no if test "x$target_cpu" = xarm64; then CFLAGS="$TARGET_CFLAGS -mgeneral-regs-only -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], []) + [VasEBoot_cv_target_cc_soft_float="-mgeneral-regs-only"], []) fi if test "x$target_cpu" = xia64; then CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_target_cc_soft_float="-mno-inline-float-divide -mno-inline-sqrt"], []) + [VasEBoot_cv_target_cc_soft_float="-mno-inline-float-divide -mno-inline-sqrt"], []) fi for cand in "-msoft-float -Xclang -msoft-float -Xclang -no-implicit-float" \ "-Xclang -msoft-float -Xclang -no-implicit-float" \ "-Xclang -msoft-float" "-msoft-float"; do - if test x"$grub_cv_target_cc_soft_float" != xno ; then + if test x"$VasEBoot_cv_target_cc_soft_float" != xno ; then break fi CFLAGS="$TARGET_CFLAGS $cand -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_target_cc_soft_float="$cand"], []) + [VasEBoot_cv_target_cc_soft_float="$cand"], []) done ]) - if test x"$grub_cv_target_cc_soft_float" = xno ; then + if test x"$VasEBoot_cv_target_cc_soft_float" = xno ; then AC_MSG_ERROR([could not force soft-float]) fi - case x"$grub_cv_target_cc_soft_float" in + case x"$VasEBoot_cv_target_cc_soft_float" in x*"-Xclang"*) # A trick so that clang doesn't see it on link stаge - TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_soft_float" + TARGET_CPPFLAGS="$TARGET_CPPFLAGS $VasEBoot_cv_target_cc_soft_float" ;; *) - TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_soft_float" + TARGET_CFLAGS="$TARGET_CFLAGS $VasEBoot_cv_target_cc_soft_float" ;; esac - TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" + TARGET_CCASFLAGS="$TARGET_CCASFLAGS $VasEBoot_cv_target_cc_soft_float" fi if test x"$target_cpu" = xsparc64 ; then - AC_CACHE_CHECK([for options to reserve application registers], grub_cv_target_cc_mno_app_regs, [ - grub_cv_target_cc_mno_app_regs=no + AC_CACHE_CHECK([for options to reserve application registers], VasEBoot_cv_target_cc_mno_app_regs, [ + VasEBoot_cv_target_cc_mno_app_regs=no for cand in "-mllvm -sparc-reserve-app-registers" \ "-mno-app-regs"; do - if test x"$grub_cv_target_cc_mno_app_regs" != xno ; then + if test x"$VasEBoot_cv_target_cc_mno_app_regs" != xno ; then break fi CFLAGS="$TARGET_CFLAGS $cand -Werror" CPPFLAGS="$TARGET_CPPFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_target_cc_mno_app_regs="$cand"], []) + [VasEBoot_cv_target_cc_mno_app_regs="$cand"], []) done ]) - if test x"$grub_cv_target_cc_mno_app_regs" = xno ; then + if test x"$VasEBoot_cv_target_cc_mno_app_regs" = xno ; then AC_MSG_ERROR([could not reserve application registers]) fi - if test x"$grub_cv_target_cc_mno_app_regs" = x"-mllvm -sparc-reserve-app-registers" ; then + if test x"$VasEBoot_cv_target_cc_mno_app_regs" = x"-mllvm -sparc-reserve-app-registers" ; then # A trick so that clang doesn't see it on link stаge - TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_app_regs" + TARGET_CPPFLAGS="$TARGET_CPPFLAGS $VasEBoot_cv_target_cc_mno_app_regs" else - TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mno_app_regs" + TARGET_CFLAGS="$TARGET_CFLAGS $VasEBoot_cv_target_cc_mno_app_regs" fi - AC_CACHE_CHECK([for no-relax options], grub_cv_target_cc_mno_relax, [ - grub_cv_target_cc_mno_relax=no + AC_CACHE_CHECK([for no-relax options], VasEBoot_cv_target_cc_mno_relax, [ + VasEBoot_cv_target_cc_mno_relax=no for cand in "-mno-relax" "-Wl,--no-relax"; do - if test x"$grub_cv_target_cc_mno_relax" != xno ; then + if test x"$VasEBoot_cv_target_cc_mno_relax" != xno ; then break fi LDFLAGS="$TARGET_LDFLAGS $cand -nostdlib -static" @@ -878,81 +878,81 @@ if test x"$target_cpu" = xsparc64 ; then void __main (void); void __main (void) {} int main (void); - ]], [[]])], [grub_cv_target_cc_mno_relax="$cand"], []) + ]], [[]])], [VasEBoot_cv_target_cc_mno_relax="$cand"], []) done ]) LDFLAGS="$TARGET_LDFLAGS" CFLAGS="$TARGET_CFLAGS" - if test x"$grub_cv_target_cc_mno_relax" = xno ; then + if test x"$VasEBoot_cv_target_cc_mno_relax" = xno ; then AC_MSG_ERROR([could not find no-relax options]) fi - TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_mno_relax" + TARGET_LDFLAGS="$TARGET_LDFLAGS $VasEBoot_cv_target_cc_mno_relax" fi # By default, GCC 4.4 generates .eh_frame sections containing unwind -# information in some cases where it previously did not. GRUB doesn't need +# information in some cases where it previously did not. VasEBoot doesn't need # these and they just use up vital space. Restore the old compiler # behaviour. -AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [ +AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [VasEBoot_cv_cc_fno_dwarf2_cfi_asm], [ CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_fno_dwarf2_cfi_asm=yes], - [grub_cv_cc_fno_dwarf2_cfi_asm=no]) + [VasEBoot_cv_cc_fno_dwarf2_cfi_asm=yes], + [VasEBoot_cv_cc_fno_dwarf2_cfi_asm=no]) ]) -if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then +if test "x$VasEBoot_cv_cc_fno_dwarf2_cfi_asm" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" fi if test x"$target_os" = xcygwin; then - AC_CACHE_CHECK([whether option -fno-reorder-functions works], grub_cv_cc_no_reorder_functions, [ + AC_CACHE_CHECK([whether option -fno-reorder-functions works], VasEBoot_cv_cc_no_reorder_functions, [ CFLAGS="$TARGET_CFLAGS -fno-reorder-functions" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_no_reorder_functions=yes], - [grub_cv_cc_no_reorder_functions=no]) + [VasEBoot_cv_cc_no_reorder_functions=yes], + [VasEBoot_cv_cc_no_reorder_functions=no]) ]) fi -if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xyes; then +if test x"$target_os" = xcygwin && test "x$VasEBoot_cv_cc_no_reorder_functions" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions" fi -AC_CACHE_CHECK([whether -mno-stack-arg-probe works], [grub_cv_cc_mno_stack_arg_probe], [ +AC_CACHE_CHECK([whether -mno-stack-arg-probe works], [VasEBoot_cv_cc_mno_stack_arg_probe], [ CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_mno_stack_arg_probe=yes], - [grub_cv_cc_mno_stack_arg_probe=no]) + [VasEBoot_cv_cc_mno_stack_arg_probe=yes], + [VasEBoot_cv_cc_mno_stack_arg_probe=no]) ]) -if test "x$grub_cv_cc_mno_stack_arg_probe" = xyes; then +if test "x$VasEBoot_cv_cc_mno_stack_arg_probe" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" fi # By default, GCC 4.6 generates .eh_frame sections containing unwind -# information in some cases where it previously did not. GRUB doesn't need +# information in some cases where it previously did not. VasEBoot doesn't need # these and they just use up vital space. Restore the old compiler # behaviour. -AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [ +AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [VasEBoot_cv_cc_fno_asynchronous_unwind_tables], [ CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_fno_asynchronous_unwind_tables=yes], - [grub_cv_cc_fno_asynchronous_unwind_tables=no]) + [VasEBoot_cv_cc_fno_asynchronous_unwind_tables=yes], + [VasEBoot_cv_cc_fno_asynchronous_unwind_tables=no]) ]) -if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then +if test "x$VasEBoot_cv_cc_fno_asynchronous_unwind_tables" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" fi -AC_CACHE_CHECK([whether -fno-unwind-tables works], [grub_cv_cc_fno_unwind_tables], [ +AC_CACHE_CHECK([whether -fno-unwind-tables works], [VasEBoot_cv_cc_fno_unwind_tables], [ CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_fno_unwind_tables=yes], - [grub_cv_cc_fno_unwind_tables=no]) + [VasEBoot_cv_cc_fno_unwind_tables=yes], + [VasEBoot_cv_cc_fno_unwind_tables=no]) ]) -if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then +if test "x$VasEBoot_cv_cc_fno_unwind_tables" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" fi @@ -962,27 +962,27 @@ CFLAGS="$TARGET_CFLAGS" if test x"$platform" = xemu ; then TARGET_OBJ2ELF= - grub_cv_target_cc_link_format= + VasEBoot_cv_target_cc_link_format= case "$host_os" in *darwin* | *mac*) - grub_cv_target_cc_link_format="-arch,${target_cpu}" - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" + VasEBoot_cv_target_cc_link_format="-arch,${target_cpu}" + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$VasEBoot_cv_target_cc_link_format" ;; *windows* | *cygwin* | *mingw*) if test x${target_cpu} = xi386 ; then - grub_cv_target_cc_link_format=-mi386pe - TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)' + VasEBoot_cv_target_cc_link_format=-mi386pe + TARGET_OBJ2ELF='./build-VasEBoot-pe2elf$(BUILD_EXEEXT)' fi if test x${target_cpu} = xx86_64 ; then - grub_cv_target_cc_link_format=-mi386pep - TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)' + VasEBoot_cv_target_cc_link_format=-mi386pep + TARGET_OBJ2ELF='./build-VasEBoot-pep2elf$(BUILD_EXEEXT)' fi - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$VasEBoot_cv_target_cc_link_format" ;; esac elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then - AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], [ - grub_cv_target_cc_link_format=unknown + AC_CACHE_CHECK([for target linking format], [VasEBoot_cv_target_cc_link_format], [ + VasEBoot_cv_target_cc_link_format=unknown for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -mi386pe -mi386pep -arch,${target_cpu}; do if test x${target_cpu} != xi386 && test x$format = x-mi386pe; then continue @@ -1000,23 +1000,23 @@ elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then void __main (void) {} ]], [[]])], [flag=1], [flag=0]) if test x"$flag" = x1; then - grub_cv_target_cc_link_format="$format" + VasEBoot_cv_target_cc_link_format="$format" break fi done]) - if test x"$grub_cv_target_cc_link_format" = xunknown; then + if test x"$VasEBoot_cv_target_cc_link_format" = xunknown; then AC_MSG_ERROR([no suitable link format found]) fi - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" - if test x"$grub_cv_target_cc_link_format" = x-mi386pe ; then - TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)' + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$VasEBoot_cv_target_cc_link_format" + if test x"$VasEBoot_cv_target_cc_link_format" = x-mi386pe ; then + TARGET_OBJ2ELF='./build-VasEBoot-pe2elf$(BUILD_EXEEXT)' fi - if test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then - TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)' + if test x"$VasEBoot_cv_target_cc_link_format" = x-mi386pep ; then + TARGET_OBJ2ELF='./build-VasEBoot-pep2elf$(BUILD_EXEEXT)' fi fi -if test x$grub_cv_target_cc_link_format = x-arch,i386 || test x$grub_cv_target_cc_link_format = x-arch,x86_64; then +if test x$VasEBoot_cv_target_cc_link_format = x-arch,i386 || test x$VasEBoot_cv_target_cc_link_format = x-arch,x86_64; then TARGET_APPLE_LINKER=1 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [objconv], []) if test "x$TARGET_OBJCONV" = x ; then @@ -1031,12 +1031,12 @@ if test x$grub_cv_target_cc_link_format = x-arch,i386 || test x$grub_cv_target_c TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20' TARGET_IMG_BASE_LDOPT="-Wl,-image_base" TARGET_LDFLAGS_OLDMAGIC="" -elif test x$grub_cv_target_cc_link_format = x-mi386pe || test x$grub_cv_target_cc_link_format = x-mi386pep ; then +elif test x$VasEBoot_cv_target_cc_link_format = x-mi386pe || test x$VasEBoot_cv_target_cc_link_format = x-mi386pep ; then TARGET_APPLE_LINKER=0 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N" - TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/i386-cygwin-img-ld.sc" + TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${VasEBoot_coredir}/conf/i386-cygwin-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/i386-cygwin-img-ld.sc" + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${VasEBoot_coredir}/conf/i386-cygwin-img-ld.sc" TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" TARGET_IMG_CFLAGS= else @@ -1058,7 +1058,7 @@ if test x"$enable_efiemu" = xno ; then efiemu_excuse="explicitly disabled" fi -if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then +if test x"$VasEBoot_cv_target_cc_link_format" = x-mi386pe || test x"$VasEBoot_cv_target_cc_link_format" = x-mi386pep ; then efiemu_excuse="not available on cygwin" fi if test x"$target_cpu" != xi386 ; then @@ -1069,19 +1069,19 @@ if test x"$platform" = xefi ; then fi if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ + AC_CACHE_CHECK([whether options required for efiemu work], VasEBoot_cv_cc_efiemu, [ CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_efiemu=yes], - [grub_cv_cc_efiemu=no]) + [VasEBoot_cv_cc_efiemu=yes], + [VasEBoot_cv_cc_efiemu=no]) ]) - if test x$grub_cv_cc_efiemu = xno; then + if test x$VasEBoot_cv_cc_efiemu = xno; then efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" fi fi if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [ - grub_cv_target_cc_efiemu64_link_format=unknown + AC_CACHE_CHECK([for efiemu64 linking format], [VasEBoot_cv_target_cc_efiemu64_link_format], [ + VasEBoot_cv_target_cc_efiemu64_link_format=unknown for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" LDFLAGS="-m64 -Wl,$format -nostdlib -static" @@ -1093,14 +1093,14 @@ if test x"$efiemu_excuse" = x ; then void __main (void) {} ]], [[]])], [flag=1], [flag=0]) if test x"$flag" = x1; then - grub_cv_target_cc_efiemu64_link_format="$format" + VasEBoot_cv_target_cc_efiemu64_link_format="$format" break fi done]) - if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then + if test x"$VasEBoot_cv_target_cc_efiemu64_link_format" = xunknown; then efiemu_excuse="no suitable link format for efiemu64 found" else - EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format" + EFIEMU64_LINK_FORMAT="-Wl,$VasEBoot_cv_target_cc_efiemu64_link_format" fi fi if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then @@ -1123,13 +1123,13 @@ LDFLAGS="$TARGET_LDFLAGS" if test "$target_cpu" = x86_64 || test "$target_cpu" = sparc64 ; then # Use large model to support 4G memory - AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ + AC_CACHE_CHECK([whether option -mcmodel=large works], VasEBoot_cv_cc_mcmodel, [ CFLAGS="$TARGET_CFLAGS -mcmodel=large" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_mcmodel=yes], - [grub_cv_cc_mcmodel=no]) + [VasEBoot_cv_cc_mcmodel=yes], + [VasEBoot_cv_cc_mcmodel=no]) ]) - if test "x$grub_cv_cc_mcmodel" = xyes; then + if test "x$VasEBoot_cv_cc_mcmodel" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" elif test "$target_cpu" = sparc64; then TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany" @@ -1138,13 +1138,13 @@ fi if test "$target_cpu"-"$platform" = x86_64-efi; then # EFI writes to stack below %rsp, we must not use the red zone - AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ + AC_CACHE_CHECK([whether option -mno-red-zone works], VasEBoot_cv_cc_no_red_zone, [ CFLAGS="$TARGET_CFLAGS -mno-red-zone" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_no_red_zone=yes], - [grub_cv_cc_no_red_zone=no]) + [VasEBoot_cv_cc_no_red_zone=yes], + [VasEBoot_cv_cc_no_red_zone=no]) ]) - if test "x$grub_cv_cc_no_red_zone" = xno; then + if test "x$VasEBoot_cv_cc_no_red_zone" = xno; then AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) fi @@ -1152,44 +1152,44 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then fi if test "x$target_cpu" = xarm; then - AC_CACHE_CHECK([for options to disable movt and movw], grub_cv_target_cc_mno_movt, [ - grub_cv_target_cc_mno_movt=no + AC_CACHE_CHECK([for options to disable movt and movw], VasEBoot_cv_target_cc_mno_movt, [ + VasEBoot_cv_target_cc_mno_movt=no for cand in "-mno-movt" \ "-mllvm -arm-use-movt=0"; do - if test x"$grub_cv_target_cc_mno_movt" != xno ; then + if test x"$VasEBoot_cv_target_cc_mno_movt" != xno ; then break fi CFLAGS="$TARGET_CFLAGS $cand -Werror" CPPFLAGS="$TARGET_CPPFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_target_cc_mno_movt="$cand"], []) + [VasEBoot_cv_target_cc_mno_movt="$cand"], []) done ]) - if test x"$grub_cv_target_cc_mno_movt" != xno ; then + if test x"$VasEBoot_cv_target_cc_mno_movt" != xno ; then # A trick so that clang doesn't see it on link stage - TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_movt" + TARGET_CPPFLAGS="$TARGET_CPPFLAGS $VasEBoot_cv_target_cc_mno_movt" fi - AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [ + AC_CACHE_CHECK([whether option -mthumb-interwork works], VasEBoot_cv_cc_mthumb_interwork, [ CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_mthumb_interwork=yes], - [grub_cv_cc_mthumb_interwork=no]) + [VasEBoot_cv_cc_mthumb_interwork=yes], + [VasEBoot_cv_cc_mthumb_interwork=no]) ]) - if test "x$grub_cv_cc_mthumb_interwork" = xyes; then + if test "x$VasEBoot_cv_cc_mthumb_interwork" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -mthumb-interwork" # Clang defaults to thumb interworking - elif test "x$grub_cv_cc_target_clang" = xno ; then + elif test "x$VasEBoot_cv_cc_target_clang" = xno ; then AC_MSG_ERROR([your compiler doesn't support -mthumb-interwork]) fi fi -AC_CACHE_CHECK([whether option -Qn works], grub_cv_target_cc_qn, [ +AC_CACHE_CHECK([whether option -Qn works], VasEBoot_cv_target_cc_qn, [ CFLAGS="$TARGET_CFLAGS -Qn -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_target_cc_qn=yes], - [grub_cv_target_cc_qn=no])]) -if test "x$grub_cv_target_cc_qn" = xyes; then + [VasEBoot_cv_target_cc_qn=yes], + [VasEBoot_cv_target_cc_qn=no])]) +if test "x$VasEBoot_cv_target_cc_qn" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Qn" fi @@ -1200,10 +1200,10 @@ fi CFLAGS="$TARGET_CFLAGS" # Position independent executable. -grub_CHECK_PIE -grub_CHECK_NO_PIE -grub_CHECK_NO_PIE_ONEWORD -grub_CHECK_LINK_PIE +VasEBoot_CHECK_PIE +VasEBoot_CHECK_NO_PIE +VasEBoot_CHECK_NO_PIE_ONEWORD +VasEBoot_CHECK_LINK_PIE [# Need that, because some distributions ship compilers that include # `-fPIE' or '-fpie' and '-pie' in the default specs. if [ x"$pie_possible" = xyes ]; then @@ -1223,7 +1223,7 @@ CFLAGS="$TARGET_CFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Position independent executable. -grub_CHECK_PIC +VasEBoot_CHECK_PIC [# On most platforms we don't want PIC as it only makes relocations harder # and code less efficient. On mips we want to have one got table per module # and reload $gp in every function. @@ -1234,7 +1234,7 @@ grub_CHECK_PIC # movk's which aren't representable. # Since default varies across dictributions use either -fPIC or -fno-PIC # explicitly. -if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel || test x$target_cpu = xarm64 ) && test "x$grub_cv_cc_target_clang" = xyes ; then +if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel || test x$target_cpu = xarm64 ) && test "x$VasEBoot_cv_cc_target_clang" = xyes ; then TARGET_CFLAGS="$TARGET_CFLAGS -fPIC" elif [ x"$pic_possible" = xyes ]; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC" @@ -1243,7 +1243,7 @@ fi] CFLAGS="$TARGET_CFLAGS" # Smashing stack protector. -grub_CHECK_STACK_PROTECTOR +VasEBoot_CHECK_STACK_PROTECTOR # Need that, because some distributions ship compilers that include # `-fstack-protector' in the default specs. if test "x$ssp_possible" = xyes; then @@ -1252,7 +1252,7 @@ fi CFLAGS="$TARGET_CFLAGS" -grub_CHECK_STACK_ARG_PROBE +VasEBoot_CHECK_STACK_ARG_PROBE # Cygwin's GCC uses alloca() to probe the stackframe on static # stack allocations above some threshold. if test x"$sap_possible" = xyes; then @@ -1263,31 +1263,31 @@ CFLAGS="$TARGET_CFLAGS" # -mno-unaligned-access -mstrict-align if test "$target_cpu" = arm; then - AC_CACHE_CHECK([for compile options to get strict alignment], [grub_cv_target_cc_strict_align], [ - grub_cv_target_cc_strict_align= + AC_CACHE_CHECK([for compile options to get strict alignment], [VasEBoot_cv_target_cc_strict_align], [ + VasEBoot_cv_target_cc_strict_align= for arg in -mno-unaligned-access "-Xclang -mstrict-align" -mstrict-align; do CFLAGS="$TARGET_CFLAGS $arg -Werror" LDFLAGS="$TARGET_LDFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0]) if test x"$flag" = x1; then - grub_cv_target_cc_strict_align="$arg" + VasEBoot_cv_target_cc_strict_align="$arg" break fi done]) - TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_strict_align" - if test x"$grub_cv_target_cc_strict_align" = x"-Xclang -mstrict-align"; then + TARGET_CFLAGS="$TARGET_CFLAGS $VasEBoot_cv_target_cc_strict_align" + if test x"$VasEBoot_cv_target_cc_strict_align" = x"-Xclang -mstrict-align"; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Qunused-arguments" fi - AC_CACHE_CHECK([if compiler generates unaligned accesses], [grub_cv_cc_target_emits_unaligned], + AC_CACHE_CHECK([if compiler generates unaligned accesses], [VasEBoot_cv_cc_target_emits_unaligned], [CFLAGS="$TARGET_CFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ #ifdef __ARM_FEATURE_UNALIGNED #error "unaligned" #endif ]])], - [grub_cv_cc_target_emits_unaligned=no], [grub_cv_cc_target_emits_unaligned=yes])]) - if test x$grub_cv_cc_target_emits_unaligned = xyes; then + [VasEBoot_cv_cc_target_emits_unaligned=no], [VasEBoot_cv_cc_target_emits_unaligned=yes])]) + if test x$VasEBoot_cv_cc_target_emits_unaligned = xyes; then AC_MSG_ERROR([compiler generates unaligned accesses]) fi fi @@ -1303,9 +1303,9 @@ CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error" fi CPPFLAGS="$TARGET_CPPFLAGS" -grub_ASM_USCORE +VasEBoot_ASM_USCORE if test "x$TARGET_APPLE_LINKER" = x0 && test x"$platform" != xemu; then -if test x$grub_cv_asm_uscore = xyes; then +if test x$VasEBoot_cv_asm_uscore = xyes; then DEFSYM="-Wl,--defsym,_abort=_main -Wl,--defsym,__main=_main" else DEFSYM="-Wl,--defsym,abort=main -Wl,--defsym,_main=main -Wl,--defsym,__main=main" @@ -1326,55 +1326,55 @@ fi LIBS="" # Defined in aclocal.m4. -grub_PROG_TARGET_CC +VasEBoot_PROG_TARGET_CC if test "x$TARGET_APPLE_LINKER" != x1 ; then -grub_PROG_OBJCOPY_ABSOLUTE +VasEBoot_PROG_OBJCOPY_ABSOLUTE fi -grub_PROG_LD_BUILD_ID_NONE +VasEBoot_PROG_LD_BUILD_ID_NONE if test "x$target_cpu" = xi386; then if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then # Check symbols provided by linker script. CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},0x8000" fi - grub_CHECK_BSS_START_SYMBOL - grub_CHECK_END_SYMBOL + VasEBoot_CHECK_BSS_START_SYMBOL + VasEBoot_CHECK_END_SYMBOL fi CFLAGS="$TARGET_CFLAGS" fi -grub_PROG_NM_WORKS -grub_PROG_NM_MINUS_P -grub_PROG_NM_DEFINED_ONLY +VasEBoot_PROG_NM_WORKS +VasEBoot_PROG_NM_MINUS_P +VasEBoot_PROG_NM_DEFINED_ONLY AC_SUBST(TARGET_NMFLAGS_MINUS_P) AC_SUBST(TARGET_NMFLAGS_DEFINED_ONLY) if test "$platform" != emu; then -AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [ +AC_CACHE_CHECK([whether -nostdinc -isystem works], [VasEBoot_cv_cc_isystem], [ SAVED_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include int va_arg_func (int fixed, va_list args);]], [[]])], - [grub_cv_cc_isystem=yes], - [grub_cv_cc_isystem=no]) + [VasEBoot_cv_cc_isystem=yes], + [VasEBoot_cv_cc_isystem=no]) CPPFLAGS="$SAVED_CPPFLAGS" ]) -if test x"$grub_cv_cc_isystem" = xyes ; then +if test x"$VasEBoot_cv_cc_isystem" = xyes ; then TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" fi fi -AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [ +AC_CACHE_CHECK([whether -Wtrampolines work], [VasEBoot_cv_cc_wtrampolines], [ CFLAGS="$TARGET_CFLAGS -Wtrampolines -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include int va_arg_func (int fixed, va_list args);]], [[]])], - [grub_cv_cc_wtrampolines=yes], - [grub_cv_cc_wtrampolines=no]) + [VasEBoot_cv_cc_wtrampolines=yes], + [VasEBoot_cv_cc_wtrampolines=no]) ]) -if test x"$grub_cv_cc_wtrampolines" = xyes ; then +if test x"$VasEBoot_cv_cc_wtrampolines" = xyes ; then TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines" fi @@ -1418,92 +1418,92 @@ else fi AC_SUBST([BOOT_TIME_STATS]) -AC_ARG_ENABLE([grub-emu-sdl], - [AS_HELP_STRING([--enable-grub-emu-sdl], - [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])]) +AC_ARG_ENABLE([VasEBoot-emu-sdl], + [AS_HELP_STRING([--enable-VasEBoot-emu-sdl], + [build and install the `VasEBoot-emu' debugging utility with SDL support (default=guessed)])]) -AC_ARG_ENABLE([grub-emu-pci], - [AS_HELP_STRING([--enable-grub-emu-pci], - [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])]) +AC_ARG_ENABLE([VasEBoot-emu-pci], + [AS_HELP_STRING([--enable-VasEBoot-emu-pci], + [build and install the `VasEBoot-emu' debugging utility with PCI support (potentially dangerous) (default=no)])]) if test "$platform" = emu; then -if test x"$enable_grub_emu_sdl" = xno ; then - grub_emu_sdl_excuse="explicitly disabled" +if test x"$enable_VasEBoot_emu_sdl" = xno ; then + VasEBoot_emu_sdl_excuse="explicitly disabled" fi -[if [ x"$grub_emu_sdl_excuse" = x ]; then +[if [ x"$VasEBoot_emu_sdl_excuse" = x ]; then # Check for libSDL libraries.] AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"], - [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]]) + [VasEBoot_emu_sdl_excuse=["libSDL libraries are required to build \`VasEBoot-emu' with SDL support"]]) AC_SUBST([LIBSDL]) [fi] -[if [ x"$grub_emu_sdl_excuse" = x ]; then +[if [ x"$VasEBoot_emu_sdl_excuse" = x ]; then # Check for headers.] AC_CHECK_HEADERS([SDL/SDL.h], [], - [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]]) + [VasEBoot_emu_sdl_excuse=["libSDL header file is required to build \`VasEBoot-emu' with SDL support"]]) [fi] -if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then - AC_MSG_ERROR([SDL support for grub-emu was explicitly requested but can't be compiled ($grub_emu_sdl_excuse)]) +if test x"enable_VasEBoot_emu_sdl" = xyes && test x"$VasEBoot_emu_sdl_excuse" != x ; then + AC_MSG_ERROR([SDL support for VasEBoot-emu was explicitly requested but can't be compiled ($VasEBoot_emu_sdl_excuse)]) fi -if test x"$grub_emu_sdl_excuse" = x ; then -enable_grub_emu_sdl=yes +if test x"$VasEBoot_emu_sdl_excuse" = x ; then +enable_VasEBoot_emu_sdl=yes else -enable_grub_emu_sdl=no +enable_VasEBoot_emu_sdl=no fi -if test x"$enable_grub_emu_pci" != xyes ; then - grub_emu_pci_excuse="not enabled" +if test x"$enable_VasEBoot_emu_pci" != xyes ; then + VasEBoot_emu_pci_excuse="not enabled" fi -[if [ x"$grub_emu_pci_excuse" = x ]; then +[if [ x"$VasEBoot_emu_pci_excuse" = x ]; then # Check for libpci libraries.] AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"], - [grub_emu_pci_excuse=["need libpciaccess library"]]) + [VasEBoot_emu_pci_excuse=["need libpciaccess library"]]) AC_SUBST([LIBPCIACCESS]) [fi] -[if [ x"$grub_emu_pci_excuse" = x ]; then +[if [ x"$VasEBoot_emu_pci_excuse" = x ]; then # Check for headers.] AC_CHECK_HEADERS([pciaccess.h], [], - [grub_emu_pci_excuse=["need libpciaccess headers"]]) + [VasEBoot_emu_pci_excuse=["need libpciaccess headers"]]) [fi] -if test x"$grub_emu_pci_excuse" = x ; then -enable_grub_emu_pci=yes +if test x"$VasEBoot_emu_pci_excuse" = x ; then +enable_VasEBoot_emu_pci=yes else -enable_grub_emu_pci=no +enable_VasEBoot_emu_pci=no fi -AC_SUBST([enable_grub_emu_sdl]) -AC_SUBST([enable_grub_emu_pci]) +AC_SUBST([enable_VasEBoot_emu_sdl]) +AC_SUBST([enable_VasEBoot_emu_pci]) else # Ignore --enable-emu-* if platform is not emu -enable_grub_emu_sdl=no -enable_grub_emu_pci=no +enable_VasEBoot_emu_sdl=no +enable_VasEBoot_emu_pci=no fi -AC_ARG_ENABLE([grub-mkfont], - [AS_HELP_STRING([--enable-grub-mkfont], - [build and install the `grub-mkfont' utility (default=guessed)])]) -if test x"$enable_grub_mkfont" = xno ; then - grub_mkfont_excuse="explicitly disabled" +AC_ARG_ENABLE([VasEBoot-mkfont], + [AS_HELP_STRING([--enable-VasEBoot-mkfont], + [build and install the `VasEBoot-mkfont' utility (default=guessed)])]) +if test x"$enable_VasEBoot_mkfont" = xno ; then + VasEBoot_mkfont_excuse="explicitly disabled" fi -if test x"$grub_mkfont_excuse" = x ; then +if test x"$VasEBoot_mkfont_excuse" = x ; then # Check for freetype libraries. AC_CHECK_TOOLS([FREETYPE], [freetype-config]) if test "x$FREETYPE" = x ; then - grub_mkfont_excuse=["need freetype2 library"] + VasEBoot_mkfont_excuse=["need freetype2 library"] fi fi unset ac_cv_header_ft2build_h -if test x"$grub_mkfont_excuse" = x ; then +if test x"$VasEBoot_mkfont_excuse" = x ; then # Check for freetype libraries. freetype_cflags=`$FREETYPE --cflags` freetype_libs=`$FREETYPE --libs` @@ -1512,21 +1512,21 @@ if test x"$grub_mkfont_excuse" = x ; then CPPFLAGS="$CPPFLAGS $freetype_cflags" LIBS="$LIBS $freetype_libs" AC_CHECK_HEADERS([ft2build.h], [], - [grub_mkfont_excuse=["need freetype2 headers"]]) - AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]]) + [VasEBoot_mkfont_excuse=["need freetype2 headers"]]) + AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [VasEBoot_mkfont_excuse=["freetype2 library unusable"]]) CPPFLAGS="$SAVED_CPPFLAGS" LIBS="$SAVED_LIBS" fi -if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then - AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled ($grub_mkfont_excuse)]) +if test x"$enable_VasEBoot_mkfont" = xyes && test x"$VasEBoot_mkfont_excuse" != x ; then + AC_MSG_ERROR([VasEBoot-mkfont was explicitly requested but can't be compiled ($VasEBoot_mkfont_excuse)]) fi -if test x"$grub_mkfont_excuse" = x ; then -enable_grub_mkfont=yes +if test x"$VasEBoot_mkfont_excuse" = x ; then +enable_VasEBoot_mkfont=yes else -enable_grub_mkfont=no +enable_VasEBoot_mkfont=no fi -AC_SUBST([enable_grub_mkfont]) +AC_SUBST([enable_VasEBoot_mkfont]) AC_SUBST([freetype_cflags]) AC_SUBST([freetype_libs]) @@ -1556,15 +1556,15 @@ AC_SUBST([BUILD_SIZEOF_LONG]) AC_SUBST([BUILD_SIZEOF_VOID_P]) AC_SUBST([BUILD_WORDS_BIGENDIAN]) -if test x"$grub_build_mkfont_excuse" = x ; then +if test x"$VasEBoot_build_mkfont_excuse" = x ; then # Check for freetype libraries. AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config]) if test "x$BUILD_FREETYPE" = x ; then - grub_build_mkfont_excuse=["need freetype2 library"] + VasEBoot_build_mkfont_excuse=["need freetype2 library"] fi fi -if test x"$grub_build_mkfont_excuse" = x ; then +if test x"$VasEBoot_build_mkfont_excuse" = x ; then # Check for freetype libraries. build_freetype_cflags=`$BUILD_FREETYPE --cflags` build_freetype_libs=`$BUILD_FREETYPE --libs` @@ -1573,25 +1573,25 @@ if test x"$grub_build_mkfont_excuse" = x ; then CPPFLAGS="$CPPFLAGS $build_freetype_cflags" LIBS="$LIBS $build_freetype_libs" AC_CHECK_HEADERS([ft2build.h], [], - [grub_build_mkfont_excuse=["need freetype2 headers"]]) - AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]]) + [VasEBoot_build_mkfont_excuse=["need freetype2 headers"]]) + AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [VasEBoot_build_mkfont_excuse=["freetype2 library unusable"]]) LIBS="$SAVED_LIBS" CPPFLAGS="$SAVED_CPPFLAGS_2" fi -if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then - AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled ($grub_build_mkfont_excuse)]) +if test x"$enable_build_VasEBoot_mkfont" = xyes && test x"$VasEBoot_build_mkfont_excuse" != x ; then + AC_MSG_ERROR([build-VasEBoot-mkfont was explicitly requested but can't be compiled ($VasEBoot_build_mkfont_excuse)]) fi -if test x"$grub_build_mkfont_excuse" = x ; then - enable_build_grub_mkfont=yes +if test x"$VasEBoot_build_mkfont_excuse" = x ; then + enable_build_VasEBoot_mkfont=yes else - enable_build_grub_mkfont=no + enable_build_VasEBoot_mkfont=no fi -if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then - if test x"$grub_build_mkfont_excuse" = x ; then - AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont]) +if test x"$enable_build_VasEBoot_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then + if test x"$VasEBoot_build_mkfont_excuse" = x ; then + AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time VasEBoot-mkfont]) else - AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont ($grub_build_mkfont_excuse)]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time VasEBoot-mkfont ($VasEBoot_build_mkfont_excuse)]) fi fi @@ -1609,15 +1609,15 @@ DJVU_FONT_SOURCE= starfield_excuse= -AC_ARG_ENABLE([grub-themes], - [AS_HELP_STRING([--enable-grub-themes], - [build and install GRUB themes (default=guessed)])]) -if test x"$enable_grub_themes" = xno ; then +AC_ARG_ENABLE([VasEBoot-themes], + [AS_HELP_STRING([--enable-VasEBoot-themes], + [build and install VasEBoot themes (default=guessed)])]) +if test x"$enable_VasEBoot_themes" = xno ; then starfield_excuse="explicitly disabled" fi -if test x"$starfield_excuse" = x && test x"$enable_build_grub_mkfont" = xno ; then - starfield_excuse="No build-time grub-mkfont" +if test x"$starfield_excuse" = x && test x"$enable_build_VasEBoot_mkfont" = xno ; then + starfield_excuse="No build-time VasEBoot-mkfont" fi if test x"$starfield_excuse" = x; then @@ -1635,7 +1635,7 @@ if test x"$starfield_excuse" = x; then fi fi -if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then +if test x"$enable_VasEBoot_themes" = xyes && test x"$starfield_excuse" != x; then AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied ($starfield_excuse)]) fi @@ -1657,55 +1657,55 @@ for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do done done -if test x"$enable_build_grub_mkfont" = xno ; then +if test x"$enable_build_VasEBoot_mkfont" = xno ; then FONT_SOURCE= fi if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then - if test x"$grub_build_mkfont_excuse" = x ; then + if test x"$VasEBoot_build_mkfont_excuse" = x ; then AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont]) else - AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont ($VasEBoot_build_mkfont_excuse)]) fi fi AC_SUBST([FONT_SOURCE]) -if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$grub_build_mkfont_excuse" = x; then - grub_build_mkfont_excuse="no fonts" +if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$VasEBoot_build_mkfont_excuse" = x; then + VasEBoot_build_mkfont_excuse="no fonts" fi -AC_ARG_ENABLE([grub-mount], - [AS_HELP_STRING([--enable-grub-mount], - [build and install the `grub-mount' utility (default=guessed)])]) -if test x"$enable_grub_mount" = xno ; then - grub_mount_excuse="explicitly disabled" +AC_ARG_ENABLE([VasEBoot-mount], + [AS_HELP_STRING([--enable-VasEBoot-mount], + [build and install the `VasEBoot-mount' utility (default=guessed)])]) +if test x"$enable_VasEBoot_mount" = xno ; then + VasEBoot_mount_excuse="explicitly disabled" fi -if test x"$grub_mount_excuse" = x ; then +if test x"$VasEBoot_mount_excuse" = x ; then AC_CHECK_LIB([fuse], [fuse_main_real], [], - [grub_mount_excuse="need FUSE library"]) + [VasEBoot_mount_excuse="need FUSE library"]) fi -if test x"$grub_mount_excuse" = x ; then +if test x"$VasEBoot_mount_excuse" = x ; then # Check for fuse headers. SAVED_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" AC_CHECK_HEADERS([fuse/fuse.h], [], - [grub_mount_excuse=["need FUSE headers"]]) + [VasEBoot_mount_excuse=["need FUSE headers"]]) CPPFLAGS="$SAVED_CPPFLAGS" fi -if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then - AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled ($grub_mount_excuse)]) +if test x"$enable_VasEBoot_mount" = xyes && test x"$VasEBoot_mount_excuse" != x ; then + AC_MSG_ERROR([VasEBoot-mount was explicitly requested but can't be compiled ($VasEBoot_mount_excuse)]) fi -if test x"$grub_mount_excuse" = x ; then -enable_grub_mount=yes +if test x"$VasEBoot_mount_excuse" = x ; then +enable_VasEBoot_mount=yes else -enable_grub_mount=no +enable_VasEBoot_mount=no fi -AC_SUBST([enable_grub_mount]) +AC_SUBST([enable_VasEBoot_mount]) AC_ARG_ENABLE([device-mapper], [AS_HELP_STRING([--enable-device-mapper], @@ -1823,7 +1823,7 @@ LIBS="" AC_SUBST([FONT_SOURCE]) AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu], - [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) + [AC_SUBST([VasEBoot_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) AC_SUBST(HAVE_ASM_USCORE) AC_SUBST(BSS_START_SYMBOL) @@ -1833,7 +1833,7 @@ AC_SUBST(VERSION) AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], - [do not use -Werror when building GRUB])]) + [do not use -Werror when building VasEBoot])]) if test x"$enable_werror" != xno ; then TARGET_CFLAGS="$TARGET_CFLAGS -Werror" HOST_CFLAGS="$HOST_CFLAGS -Werror" @@ -1848,11 +1848,11 @@ HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" -GRUB_TARGET_CPU="${target_cpu}" -GRUB_PLATFORM="${platform}" +VasEBoot_TARGET_CPU="${target_cpu}" +VasEBoot_PLATFORM="${platform}" -AC_SUBST(GRUB_TARGET_CPU) -AC_SUBST(GRUB_PLATFORM) +AC_SUBST(VasEBoot_TARGET_CPU) +AC_SUBST(VasEBoot_PLATFORM) AC_SUBST(TARGET_OBJCONV) AC_SUBST(TARGET_CPP) @@ -1918,10 +1918,10 @@ AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu]) AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos]) AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x]) -AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) -AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) -AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) -AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes]) +AM_CONDITIONAL([COND_VasEBoot_EMU_SDL], [test x$enable_VasEBoot_emu_sdl = xyes]) +AM_CONDITIONAL([COND_VasEBoot_EMU_PCI], [test x$enable_VasEBoot_emu_pci = xyes]) +AM_CONDITIONAL([COND_VasEBoot_MKFONT], [test x$enable_VasEBoot_mkfont = xyes]) +AM_CONDITIONAL([COND_VasEBoot_MOUNT], [test x$enable_VasEBoot_mount = xyes]) AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) if test x$FONT_SOURCE != x ; then HAVE_FONT_SOURCE=1 @@ -1943,14 +1943,14 @@ AM_CONDITIONAL([COND_HAVE_EXEC], [test "x$have_exec" = xy]) test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" datarootdir="$(eval echo "$datarootdir")" -grub_libdir="$(eval echo "$libdir")" -grub_localedir="$(eval echo "$localedir")" -grub_datadir="$(eval echo "$datadir")" -grub_sysconfdir="$(eval echo "$sysconfdir")" -AC_DEFINE_UNQUOTED(LOCALEDIR, "$grub_localedir", [Locale dir]) -AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "$grub_libdir", [Library dir]) -AC_DEFINE_UNQUOTED(GRUB_DATADIR, "$grub_datadir", [Data dir]) -AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir]) +VasEBoot_libdir="$(eval echo "$libdir")" +VasEBoot_localedir="$(eval echo "$localedir")" +VasEBoot_datadir="$(eval echo "$datadir")" +VasEBoot_sysconfdir="$(eval echo "$sysconfdir")" +AC_DEFINE_UNQUOTED(LOCALEDIR, "$VasEBoot_localedir", [Locale dir]) +AC_DEFINE_UNQUOTED(VasEBoot_LIBDIR, "$VasEBoot_libdir", [Library dir]) +AC_DEFINE_UNQUOTED(VasEBoot_DATADIR, "$VasEBoot_datadir", [Data dir]) +AC_DEFINE_UNQUOTED(VasEBoot_SYSCONFDIR, "$VasEBoot_sysconfdir", [Configuration dir]) # Output files. @@ -1959,30 +1959,30 @@ if test "$platform" != none; then if test x${cpudir} = xmipsel; then cpudir=mips; fi - grub_CHECK_LINK_DIR + VasEBoot_CHECK_LINK_DIR if test x"$link_dir" = xyes ; then - AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) + AC_CONFIG_LINKS([include/VasEBoot/cpu:include/VasEBoot/$cpudir]) if test "$platform" != emu ; then - AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform]) + AC_CONFIG_LINKS([include/VasEBoot/machine:include/VasEBoot/$cpudir/$platform]) fi else - mkdir -p include/grub 2>/dev/null - rm -rf include/grub/cpu - cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null + mkdir -p include/VasEBoot 2>/dev/null + rm -rf include/VasEBoot/cpu + cp -rp $srcdir/include/VasEBoot/$cpudir include/VasEBoot/cpu 2>/dev/null if test "$platform" != emu ; then - rm -rf include/grub/machine - cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null + rm -rf include/VasEBoot/machine + cp -rp $srcdir/include/VasEBoot/$cpudir/$platform include/VasEBoot/machine 2>/dev/null fi fi else # Just enough to stop the compiler failing with -I$(srcdir)/include. mkdir -p include 2>/dev/null - rm -rf include/grub/cpu include/grub/machine + rm -rf include/VasEBoot/cpu include/VasEBoot/machine fi AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([grub-core/Makefile]) -AC_CONFIG_FILES([grub-core/gnulib/Makefile]) +AC_CONFIG_FILES([VasEBoot-core/Makefile]) +AC_CONFIG_FILES([VasEBoot-core/gnulib/Makefile]) AC_CONFIG_FILES([po/Makefile.in]) AC_CONFIG_FILES([docs/Makefile]) AC_CONFIG_FILES([util/bash-completion.d/Makefile]) @@ -1992,18 +1992,18 @@ AC_CONFIG_FILES([config.h]) AC_OUTPUT [ echo "*******************************************************" -echo GRUB2 will be compiled with following components: +echo VasEBoot2 will be compiled with following components: echo Platform: "$target_cpu"-"$platform" if [ x"$platform" = xemu ]; then -if [ x"$grub_emu_sdl_excuse" = x ]; then -echo SDL support for grub-emu: Yes +if [ x"$VasEBoot_emu_sdl_excuse" = x ]; then +echo SDL support for VasEBoot-emu: Yes else -echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)" +echo SDL support for VasEBoot-emu: No "($VasEBoot_emu_sdl_excuse)" fi -if [ x"$grub_emu_pci_excuse" = x ]; then -echo PCI support for grub-emu: Yes +if [ x"$VasEBoot_emu_pci_excuse" = x ]; then +echo PCI support for VasEBoot-emu: Yes else -echo PCI support for grub-emu: No "($grub_emu_pci_excuse)" +echo PCI support for VasEBoot-emu: No "($VasEBoot_emu_pci_excuse)" fi fi if test x"$device_mapper_excuse" = x ; then @@ -2033,15 +2033,15 @@ echo efiemu runtime: Yes else echo efiemu runtime: No "($efiemu_excuse)" fi -if [ x"$grub_mkfont_excuse" = x ]; then -echo grub-mkfont: Yes +if [ x"$VasEBoot_mkfont_excuse" = x ]; then +echo VasEBoot-mkfont: Yes else -echo grub-mkfont: No "($grub_mkfont_excuse)" +echo VasEBoot-mkfont: No "($VasEBoot_mkfont_excuse)" fi -if [ x"$grub_mount_excuse" = x ]; then -echo grub-mount: Yes +if [ x"$VasEBoot_mount_excuse" = x ]; then +echo VasEBoot-mount: Yes else -echo grub-mount: No "($grub_mount_excuse)" +echo VasEBoot-mount: No "($VasEBoot_mount_excuse)" fi if [ x"$starfield_excuse" = x ]; then echo starfield theme: Yes @@ -2054,16 +2054,16 @@ echo With libzfs support: Yes else echo With libzfs support: No "($libzfs_excuse)" fi -if [ x"$grub_build_mkfont_excuse" = x ]; then - echo Build-time grub-mkfont: Yes +if [ x"$VasEBoot_build_mkfont_excuse" = x ]; then + echo Build-time VasEBoot-mkfont: Yes if test "x$FONT_SOURCE" = x ; then echo "Without unifont" else echo "With unifont from $FONT_SOURCE" fi else - echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)" - echo "Without unifont (no build-time grub-mkfont)" + echo Build-time VasEBoot-mkfont: No "($VasEBoot_build_mkfont_excuse)" + echo "Without unifont (no build-time VasEBoot-mkfont)" fi if test x"$liblzma_excuse" != x ; then echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excuse)" diff --git a/coreboot.cfg b/coreboot.cfg index 188090d3a..469ecbfdd 100644 --- a/coreboot.cfg +++ b/coreboot.cfg @@ -1,3 +1,3 @@ -if test -f (cbfsdisk)/etc/grub.cfg; then - source (cbfsdisk)/etc/grub.cfg +if test -f (cbfsdisk)/etc/VasEBoot.cfg; then + source (cbfsdisk)/etc/VasEBoot.cfg fi diff --git a/docs/Makefile.am b/docs/Makefile.am index 93eb39627..9e161afb4 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,8 +1,8 @@ AUTOMAKE_OPTIONS = subdir-objects # AM_MAKEINFOFLAGS = --no-split --no-validate -info_TEXINFOS = grub.texi grub-dev.texi -grub_TEXINFOS = fdl.texi +info_TEXINFOS = VasEBoot.texi VasEBoot-dev.texi +VasEBoot_TEXINFOS = fdl.texi EXTRA_DIST = font_char_metrics.png font_char_metrics.txt diff --git a/docs/VasEBoot-dev.texi b/docs/VasEBoot-dev.texi index a9f4de631..12f6854ed 100644 --- a/docs/VasEBoot-dev.texi +++ b/docs/VasEBoot-dev.texi @@ -1,9 +1,9 @@ \input texinfo @c -*-texinfo-*- @c %**start of header -@setfilename grub-dev.info +@setfilename VasEBoot-dev.info @include version-dev.texi -@settitle GNU GRUB Developers Manual @value{VERSION} +@settitle GNU VasEBoot Developers Manual @value{VERSION} @c Unify all our little indices for now. @syncodeindex fn cp @syncodeindex vr cp @@ -17,7 +17,7 @@ @finalout @copying -This developer manual is for GNU GRUB (version @value{VERSION}, +This developer manual is for GNU VasEBoot (version @value{VERSION}, @value{UPDATED}). Copyright @copyright{} 1999,2000,2001,2002,2004,2005,2006,2008,2009,2010,2011 Free Software Foundation, Inc. @@ -32,14 +32,14 @@ Invariant Sections. @dircategory Kernel @direntry -* grub-dev: (grub-dev). The GRand Unified Bootloader Dev +* VasEBoot-dev: (VasEBoot-dev). The GRand Unified Bootloader Dev @end direntry @setchapternewpage odd @titlepage @sp 10 -@title the GNU GRUB developer manual +@title the GNU VasEBoot developer manual @subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}. @author Yoshinori K. Okuji @author Colin D Bennett @@ -61,9 +61,9 @@ Invariant Sections. @ifnottex @node Top -@top GNU GRUB developer manual +@top GNU VasEBoot developer manual -This is the developer documentation of GNU GRUB, the GRand Unified Bootloader, +This is the developer documentation of GNU VasEBoot, the GRand Unified Bootloader, a flexible and powerful boot loader program for a wide range of architectures. @@ -92,16 +92,16 @@ This edition documents version @value{VERSION}. @node Getting the source code @chapter Getting the source code -GRUB is maintained using the @uref{GIT revision +VasEBoot is maintained using the @uref{GIT revision control system}. To fetch: @example -git clone git://git.sv.gnu.org/grub.git +git clone git://git.sv.gnu.org/VasEBoot.git @end example Web access is available under @example -http://git.savannah.gnu.org/cgit/grub.git/ +http://git.savannah.gnu.org/cgit/VasEBoot.git/ @end example The branches available are: @@ -109,8 +109,8 @@ The branches available are: @table @samp @item master Main development branch. -@item grub-legacy - GRUB 0.97 codebase. Kept for reference and legal reasons +@item VasEBoot-legacy + VasEBoot 0.97 codebase. Kept for reference and legal reasons @item multiboot Multiboot specfication @item multiboot2 @@ -128,7 +128,7 @@ local version, you may need to resolve conflicts when pulling. @chapter Coding style @c By YoshinoriOkuji, VesaJääskeläinen and ColinBennett -Basically we follow the @uref{http://www.gnu.org/prep/standards_toc.html, GNU Coding Standards}. We define additional conventions for GRUB here. +Basically we follow the @uref{http://www.gnu.org/prep/standards_toc.html, GNU Coding Standards}. We define additional conventions for VasEBoot here. @menu * Naming Conventions:: @@ -143,12 +143,12 @@ Basically we follow the @uref{http://www.gnu.org/prep/standards_toc.html, GNU Co @node Naming Conventions @section Naming Conventions -All global symbols (i.e. functions, variables, types, and macros) must have the prefix grub_ or GRUB_. The all capital form is used only by macros. +All global symbols (i.e. functions, variables, types, and macros) must have the prefix VasEBoot_ or VasEBoot_. The all capital form is used only by macros. @node Functions @section Functions -If a function is global, its name must be prefixed with grub_ and must consist of only small letters. If the function belongs to a specific function module, the name must also be prefixed with the module name. For example, if a function is for file systems, its name is prefixed with grub_fs_. If a function is for FAT file system but not for all file systems, its name is prefixed with grub_fs_fat_. The hierarchy is noted this way. +If a function is global, its name must be prefixed with VasEBoot_ and must consist of only small letters. If the function belongs to a specific function module, the name must also be prefixed with the module name. For example, if a function is for file systems, its name is prefixed with VasEBoot_fs_. If a function is for FAT file system but not for all file systems, its name is prefixed with VasEBoot_fs_fat_. The hierarchy is noted this way. After a prefix, a function name must start with a verb (such as get or is). It must not be a noun. Some kind of abbreviation is permitted, as long as it wouldn't make code less readable (e.g. init). @@ -157,7 +157,7 @@ If a function is local, its name may not start with any prefix. It must start wi @node Variables @section Variables -The rule is mostly the same as functions, as noted above. If a variable is global, its name must be prefixed with grub_ and must consist of only small letters. If the variable belongs to a specific function module, the name must also be prefixed with the module name. For example, if a function is for dynamic loading, its name is prefixed with grub_dl_. If a variable is for ELF but not for all dynamic loading systems, its name is prefixed with grub_dl_elf_. +The rule is mostly the same as functions, as noted above. If a variable is global, its name must be prefixed with VasEBoot_ and must consist of only small letters. If the variable belongs to a specific function module, the name must also be prefixed with the module name. For example, if a function is for dynamic loading, its name is prefixed with VasEBoot_dl_. If a variable is for ELF but not for all dynamic loading systems, its name is prefixed with VasEBoot_dl_elf_. After a prefix, a variable name must start with a noun or an adjective (such as name or long) and it should end with a noun. Some kind of abbreviation is permitted, as long as it wouldn't make code less readable (e.g. i18n). @@ -168,14 +168,14 @@ If a variable is local, you may choose any shorter name, as long as it wouldn't @node Types @section Types -The name of a type must be prefixed with grub_ and must consist of only small letters. If the type belongs to a specific function module, the name must also be prefixed with the module name. For example, if a type is for OS loaders, its name is prefixed with grub_loader_. If a type is for Multiboot but not for all OS loaders, its name is prefixed with grub_loader_linux_. +The name of a type must be prefixed with VasEBoot_ and must consist of only small letters. If the type belongs to a specific function module, the name must also be prefixed with the module name. For example, if a type is for OS loaders, its name is prefixed with VasEBoot_loader_. If a type is for Multiboot but not for all OS loaders, its name is prefixed with VasEBoot_loader_linux_. The name must be suffixed with _t, to emphasize the fact that it is a type but not a variable or a function. @node Macros @section Macros -If a macro is global, its name must be prefixed with GRUB_ and must consist of only large letters. Other rules are the same as functions or variables, depending on whether a macro is used like a function or a variable. +If a macro is global, its name must be prefixed with VasEBoot_ and must consist of only large letters. Other rules are the same as functions or variables, depending on whether a macro is used like a function or a variable. @node Comments @section Comments @@ -225,82 +225,82 @@ The opening @samp{/*} and closing @samp{*/} should be placed together on a line @node Finding your way around @chapter Finding your way around -Here is a brief map of the GRUB code base. +Here is a brief map of the VasEBoot code base. -GRUB uses Autoconf and Automake, with most of the Automake input generated +VasEBoot uses Autoconf and Automake, with most of the Automake input generated by a Python script. The top-level build rules are in @file{configure.ac}, -@file{grub-core/Makefile.core.def}, and @file{Makefile.util.def}. Each +@file{VasEBoot-core/Makefile.core.def}, and @file{Makefile.util.def}. Each block in a @file{*.def} file represents a build target, and specifies the source files used to build it on various platforms. The @file{*.def} files are processed into Automake input by @file{gentpl.py} (which you only need to look at if you are extending the build system). If you are adding a new module which follows an existing pattern, such as a new command or a new filesystem implementation, it is usually easiest to grep -@file{grub-core/Makefile.core.def} and @file{Makefile.util.def} for an +@file{VasEBoot-core/Makefile.core.def} and @file{Makefile.util.def} for an existing example of that pattern to find out where it should be added. In general, code that may be run at boot time is in a subdirectory of -@file{grub-core}, while code that is only run from within a full operating +@file{VasEBoot-core}, while code that is only run from within a full operating system is in a subdirectory of the top level. Low-level boot code, such as the MBR implementation on PC BIOS systems, is -in the @file{grub-core/boot/} directory. +in the @file{VasEBoot-core/boot/} directory. -The GRUB kernel is in @file{grub-core/kern/}. This contains core facilities +The VasEBoot kernel is in @file{VasEBoot-core/kern/}. This contains core facilities such as the device, disk, and file frameworks, environment variable handling, list processing, and so on. The kernel should contain enough to get up to a rescue prompt. Header files for kernel facilities, among others, are in @file{include/}. -Terminal implementations are in @file{grub-core/term/}. +Terminal implementations are in @file{VasEBoot-core/term/}. -Disk access code is spread across @file{grub-core/disk/} (for accessing the -disk devices themselves), @file{grub-core/partmap/} (for interpreting -partition table data), and @file{grub-core/fs/} (for accessing filesystems). -Note that, with the odd specialised exception, GRUB only contains code to +Disk access code is spread across @file{VasEBoot-core/disk/} (for accessing the +disk devices themselves), @file{VasEBoot-core/partmap/} (for interpreting +partition table data), and @file{VasEBoot-core/fs/} (for accessing filesystems). +Note that, with the odd specialised exception, VasEBoot only contains code to @emph{read} from filesystems and tries to avoid containing any code to -@emph{write} to filesystems; this lets us confidently assure users that GRUB +@emph{write} to filesystems; this lets us confidently assure users that VasEBoot cannot be responsible for filesystem corruption. -PCI and USB bus handling is in @file{grub-core/bus/}. +PCI and USB bus handling is in @file{VasEBoot-core/bus/}. -Video handling code is in @file{grub-core/video/}. The graphical menu +Video handling code is in @file{VasEBoot-core/video/}. The graphical menu system uses this heavily, but is in a separate directory, -@file{grub-core/gfxmenu/}. +@file{VasEBoot-core/gfxmenu/}. -Most commands are implemented by files in @file{grub-core/commands/}, with +Most commands are implemented by files in @file{VasEBoot-core/commands/}, with the following exceptions: @itemize @item -A few core commands live in @file{grub-core/kern/corecmd.c}. +A few core commands live in @file{VasEBoot-core/kern/corecmd.c}. @item -Commands related to normal mode live under @file{grub-core/normal/}. +Commands related to normal mode live under @file{VasEBoot-core/normal/}. @item -Commands that load and boot kernels live under @file{grub-core/loader/}. +Commands that load and boot kernels live under @file{VasEBoot-core/loader/}. @item The @samp{loopback} command is really a disk device, and so lives in -@file{grub-core/disk/loopback.c}. +@file{VasEBoot-core/disk/loopback.c}. @item -The @samp{gettext} command lives under @file{grub-core/gettext/}. +The @samp{gettext} command lives under @file{VasEBoot-core/gettext/}. @item The @samp{loadfont} and @samp{lsfonts} commands live under -@file{grub-core/font/}. +@file{VasEBoot-core/font/}. @item The @samp{serial}, @samp{terminfo}, and @samp{background_image} commands -live under @file{grub-core/term/}. +live under @file{VasEBoot-core/term/}. @item -The @samp{efiemu_*} commands live under @file{grub-core/efiemu/}. +The @samp{efiemu_*} commands live under @file{VasEBoot-core/efiemu/}. @item -OS-dependent code should be under @file{grub-core/osdep/} +OS-dependent code should be under @file{VasEBoot-core/osdep/} @item Utility programs meant to be run from a full operating system @@ -315,23 +315,23 @@ matter to you. @chapter Contributing changes @c By YoshinoriOkuji, VesaJääskeläinen, ColinWatson -Contributing changes to GRUB 2 is welcomed activity. However we have a -bit of control what kind of changes will be accepted to GRUB 2. -Therefore it is important to discuss your changes on grub-devel mailing list +Contributing changes to VasEBoot 2 is welcomed activity. However we have a +bit of control what kind of changes will be accepted to VasEBoot 2. +Therefore it is important to discuss your changes on VasEBoot-devel mailing list (see MailingLists). On this page there are some basic details on the development process and activities. First of all you should come up with the idea yourself what you want to contribute. If you do not have that beforehand you are advised to study this -manual and try GRUB 2 out to see what you think is missing from there. +manual and try VasEBoot 2 out to see what you think is missing from there. Here are additional pointers: @itemize -@item @url{https://savannah.gnu.org/task/?group=grub GRUB's Task Tracker} -@item @url{https://savannah.gnu.org/bugs/?group=grub GRUB's Bug Tracker} +@item @url{https://savannah.gnu.org/task/?group=VasEBoot VasEBoot's Task Tracker} +@item @url{https://savannah.gnu.org/bugs/?group=VasEBoot VasEBoot's Bug Tracker} @end itemize -If you intended to make changes to GRUB Legacy (<=0.97) those are not accepted +If you intended to make changes to VasEBoot Legacy (<=0.97) those are not accepted anymore. @menu @@ -344,12 +344,12 @@ anymore. @section Getting started @itemize -@item Always use latest GRUB 2 source code. So get that first. +@item Always use latest VasEBoot 2 source code. So get that first. -For developers it is recommended always to use the newest development version of GRUB 2. If development takes a long period of time, please remember to keep in sync with newest developments regularly so it is much easier to integrate your change in the future. GRUB 2 is being developed in a GIT repository. +For developers it is recommended always to use the newest development version of VasEBoot 2. If development takes a long period of time, please remember to keep in sync with newest developments regularly so it is much easier to integrate your change in the future. VasEBoot 2 is being developed in a GIT repository. -Please check Savannah's GRUB project page for details how to get newest git: -@uref{https://savannah.gnu.org/git/?group=grub, GRUB 2 git Repository} +Please check Savannah's VasEBoot project page for details how to get newest git: +@uref{https://savannah.gnu.org/git/?group=VasEBoot, VasEBoot 2 git Repository} @item Compile it and try it out. @@ -358,18 +358,18 @@ to start to implement new features or develop fixes to bugs. @item Study the code. -There are sometimes odd ways to do things in GRUB 2 code base. -This is mainly related to limited environment where GRUB 2 is being executed. +There are sometimes odd ways to do things in VasEBoot 2 code base. +This is mainly related to limited environment where VasEBoot 2 is being executed. You usually do not need to understand it all so it is better to only try to look at places that relates to your work. Please do not hesitate to ask for help if there is something that you do not understand. @item Develop a new feature. -Now that you know what to do and how it should work in GRUB 2 code base, please -be free to develop it. If you have not so far announced your idea on grub-devel +Now that you know what to do and how it should work in VasEBoot 2 code base, please +be free to develop it. If you have not so far announced your idea on VasEBoot-devel mailing list, please do it now. This is to make sure you are not wasting your -time working on the solution that will not be integrated to GRUB 2 code base. +time working on the solution that will not be integrated to VasEBoot 2 code base. You might want to study our coding style before starting development so you do not need to change much of the code when your patch is being reviewed. @@ -379,10 +379,10 @@ For every accepted patch there has to exist a ChangeLog entry. Our ChangeLog consist of changes within source code and are not describing about what the change logically does. Please see examples from previous entries. -Also remember that GRUB 2 is licensed under GPLv3 license and that usually +Also remember that VasEBoot 2 is licensed under GPLv3 license and that usually means that you are not allowed to copy pieces of code from other projects. Even if the source project's license would be compatible with GPLv3, please -discuss it beforehand on grub-devel mailing list. +discuss it beforehand on VasEBoot-devel mailing list. @item Test your change. @@ -391,8 +391,8 @@ Test that your change works properly. Try it out a couple of times, preferably o @item Publish your change. When you are happy with your change, first make sure it is compilable with -latest development version of GRUB 2. After that please send a patch to -grub-devel for review. Please describe in your email why you made the change, +latest development version of VasEBoot 2. After that please send a patch to +VasEBoot-devel for review. Please describe in your email why you made the change, what it changes and so on. Please be prepared to receive even discouraging comments about your patch. There is usually at least something that needs to be improved in every patch. @@ -407,14 +407,14 @@ agreement to FSF. Please keep in mind that if you are asked to submit for copyright agreement, process can take some time and is mandatory in order to get your changes integrated. -If you are not on grub-devel to respond to questions, most likely your patch +If you are not on VasEBoot-devel to respond to questions, most likely your patch will not be accepted. Also if problems arise from your changes later on, it would be preferable that you also fix the problem. So stay around for a while. @item Your patch is accepted. -Good job! Your patch will now be integrated into GRUB 2 mainline, and if it didn't break anything it will be publicly available in the next release. +Good job! Your patch will now be integrated into VasEBoot 2 mainline, and if it didn't break anything it will be publicly available in the next release. Now you are welcome to do further improvements :) @end itemize @@ -441,8 +441,8 @@ and the FSF clerks have dealt with your copyright assignment. @node When you are approved for write access to project's files @section When you are approved for write access to project's files -As you might know, GRUB is hosted on -@url{https://savannah.gnu.org/projects/grub Savannah}, thus the membership +As you might know, VasEBoot is hosted on +@url{https://savannah.gnu.org/projects/VasEBoot Savannah}, thus the membership is managed by Savannah. This means that, if you want to be a member of this project: @@ -468,7 +468,7 @@ request. Instead, please subscribe to the mailing list, and communicate first @node Porting @chapter Porting -GRUB2 is designed to be easily portable accross platforms. But because of the +VasEBoot2 is designed to be easily portable accross platforms. But because of the nature of bootloader every new port must be done separately. Here is how I did MIPS (loongson and ARC) and Xen ports. Note than this is more of suggestions, not absolute truth. @@ -476,7 +476,7 @@ not absolute truth. First of all grab any architecture specifications you can find in public (please avoid NDA). -First stage is ``Hello world''. I've done it outside of GRUB for simplicity. +First stage is ``Hello world''. I've done it outside of VasEBoot for simplicity. Your task is to have a small program which is loadable as bootloader and clearly shows its presence to you. If you have easily accessible console you can just print a message. If you have a mapped framebuffer you know address @@ -527,13 +527,13 @@ main (void) Sometimes you need a third file: assembly stubs for ABI-compatibility. -Once this file is functional it's time to move it into GRUB2. The startup -assembly file goes to grub-core/kern/$cpu/$platform/startup.S. You should also -include grub/symbol.h and replace call to entry point with call to -EXT_C(grub_main). The C file goes to grub-core/kern/$cpu/$platform/init.c -and its entry point is renamed to void grub_machine_init (void). Keep final +Once this file is functional it's time to move it into VasEBoot2. The startup +assembly file goes to VasEBoot-core/kern/$cpu/$platform/startup.S. You should also +include VasEBoot/symbol.h and replace call to entry point with call to +EXT_C(VasEBoot_main). The C file goes to VasEBoot-core/kern/$cpu/$platform/init.c +and its entry point is renamed to void VasEBoot_machine_init (void). Keep final infinite loop for now. Stubs file if any goes to -grub-core/kern/$cpu/$platform/callwrap.S. Sometimes either $cpu or $platform +VasEBoot-core/kern/$cpu/$platform/callwrap.S. Sometimes either $cpu or $platform is dropped if file is used on several cpus respectivelyplatforms. Check those locations if they already have what you're looking for. @@ -620,7 +620,7 @@ Next stop is gentpl.py. You need to add your platform to the list of supported ones (sorry that this list is duplicated): @example -GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", +VasEBoot_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275", "x86_64_efi", "mips_loongson", "sparc64_ieee1275", "powerpc_ieee1275", "mips_arc", "ia64_efi", @@ -631,41 +631,41 @@ You may also want already to add new platform to one or several of available groups. In particular we always have a group for each CPU even when only one platform for given CPU is available. -Then comes grub-core/Makefile.core.def. In the block ``kernel'' you'll need +Then comes VasEBoot-core/Makefile.core.def. In the block ``kernel'' you'll need to define ldflags for your platform ($cpu_$platform_ldflags). You also need to declare startup asm file ($cpu_$platform_startup) as well as any other files (e.g. init.c and callwrap.S) (e.g. $cpu_$platform = kern/$cpu/$platform/init.c). At this stage you will also need to add dummy dl.c and cache.S with functions -grub_err_t grub_arch_dl_check_header (void *ehdr), grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) (dl.c) and -void grub_arch_sync_caches (void *address, grub_size_t len) (cache.S). They +VasEBoot_err_t VasEBoot_arch_dl_check_header (void *ehdr), VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr) (dl.c) and +void VasEBoot_arch_sync_caches (void *address, VasEBoot_size_t len) (cache.S). They won't be used for now. You will need to create directory include/$cpu/$platform and a file include/$cpu/types.h. The later folowing this template: @example -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 4 +#define VasEBoot_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 4 +#define VasEBoot_TARGET_SIZEOF_LONG 4 /* mycpu is big-endian. */ -#define GRUB_TARGET_WORDS_BIGENDIAN 1 +#define VasEBoot_TARGET_WORDS_BIGENDIAN 1 /* Alternatively: mycpu is little-endian. */ -#undef GRUB_TARGET_WORDS_BIGENDIAN +#undef VasEBoot_TARGET_WORDS_BIGENDIAN -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ @end example You will also need to add a dummy file to datetime and setjmp modules to avoid any of it having no files. It can be just completely empty at this stage. -You'll need to make grub-mkimage.c (util/grub_mkimage.c) aware of the needed +You'll need to make VasEBoot-mkimage.c (util/VasEBoot_mkimage.c) aware of the needed format. For most commonly used formats like ELF, PE, aout or raw the support is already present and you'll need to make it follow the existant code paths for your platform adding adjustments if necessary. When done compile: @@ -679,7 +679,7 @@ make > /dev/null And create image @example -./grub-mkimage -d grub-core -O $format_id -o test.img +./VasEBoot-mkimage -d VasEBoot-core -O $format_id -o test.img @end example And it's time to test your test.img. @@ -688,7 +688,7 @@ If it works next stage is to have heap, console and timer. To have the heap working you need to determine which regions are suitable for heap usage, allocate them from firmware and map (if applicable). Then call -grub_mm_init_region (vois *start, grub_size_t s) for every of this region. +VasEBoot_mm_init_region (vois *start, VasEBoot_size_t s) for every of this region. As a shortcut for early port you can allocate right after _end or have a big static array for heap. If you do you'll probably need to come back to this later. As for output console you should distinguish between an array of @@ -705,8 +705,8 @@ For the input there are string of keys, terminfo and direct hardware. For string of keys look at i386-pc (same files), for termino ieee1275 (same files) and for hardware loongson (kern/mips/loongson/init.c and term/at_keyboard.c). -For the timer you'll need to call grub_install_get_time_ms (...) with as sole -argument a function returning a grub_uint64_t of a number of milliseconds +For the timer you'll need to call VasEBoot_install_get_time_ms (...) with as sole +argument a function returning a VasEBoot_uint64_t of a number of milliseconds elapsed since arbitrary point in the past. Once these steps accomplished you can remove the inifinite loop and you should @@ -717,13 +717,13 @@ caches. Also you'll need to decide where in the image to store the modules. Usual way is to have it concatenated at the end. In this case you'll need to modify startup.S to copy modules out of bss to let's say ALIGN_UP (_end, 8) before cleaning out bss. You'll probably find useful to add total_module_size -field to startup.S. In init.c you need to set grub_modbase to the address -where modules can be found. You may need grub_modules_get_end () to avoid +field to startup.S. In init.c you need to set VasEBoot_modbase to the address +where modules can be found. You may need VasEBoot_modules_get_end () to avoid declaring the space occupied by modules as usable for heap. You can test modules with: @example -./grub-mkimage -d grub-core -O $format_id -o test.img hello +./VasEBoot-mkimage -d VasEBoot-core -O $format_id -o test.img hello @end example and then running ``hello'' in the shell. @@ -734,8 +734,8 @@ disk/ for examples. Then, very importantly, you probably need to implement the actual loader (examples available in loader/) -Last step to have minimally usable port is to add support to grub-install to -put GRUB in a place where firmware or platform will pick it up. +Last step to have minimally usable port is to add support to VasEBoot-install to +put VasEBoot in a place where firmware or platform will pick it up. Next steps are: filling datetime.c, setjmp.S, network (net/drivers), video (video/), halt (lib/), reboot (lib/). @@ -770,14 +770,14 @@ CPU features that the user might want conditionalise on @item Do any of platform-specific operations mentioned in the relevant section of user manual makes sense on your platform? @item Does your platform support PCI? If so is there an appropriate driver for -GRUB? +VasEBoot? @item Do you support badram? @end itemize @node Error Handling @chapter Error Handling -Error handling in GRUB 2 is based on exception handling model. As C language +Error handling in VasEBoot 2 is based on exception handling model. As C language doesn't directly support exceptions, exception handling behavior is emulated in software. @@ -786,50 +786,50 @@ function does not provide handling of the exception it must return back to its calling function and so on, until exception is handled. If exception is not handled before prompt is displayed, error message will be shown to user. -Exception information is stored on @code{grub_errno} global variable. If -@code{grub_errno} variable contains value @code{GRUB_ERR_NONE}, there is no active -exception and application can continue normal processing. When @code{grub_errno} has +Exception information is stored on @code{VasEBoot_errno} global variable. If +@code{VasEBoot_errno} variable contains value @code{VasEBoot_ERR_NONE}, there is no active +exception and application can continue normal processing. When @code{VasEBoot_errno} has other value, it is required that application code either handles this error or -returns instantly to caller. If function is with return type @code{grub_err_t} is -about to return @code{GRUB_ERR_NONE}, it should not set @code{grub_errno} to that -value. Only set @code{grub_errno} in cases where there is error situation. +returns instantly to caller. If function is with return type @code{VasEBoot_err_t} is +about to return @code{VasEBoot_ERR_NONE}, it should not set @code{VasEBoot_errno} to that +value. Only set @code{VasEBoot_errno} in cases where there is error situation. Simple exception forwarder. @example -grub_err_t +VasEBoot_err_t forwarding_example (void) @{ /* Call function that might cause exception. */ foobar (); /* No special exception handler, just forward possible exceptions. */ - if (grub_errno != GRUB_ERR_NONE) + if (VasEBoot_errno != VasEBoot_ERR_NONE) @{ - return grub_errno; + return VasEBoot_errno; @} /* All is OK, do more processing. */ /* Return OK signal, to caller. */ - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; @} @end example Error reporting has two components, the actual error code (of type -@code{grub_err_t}) and textual message that will be displayed to user. List of -valid error codes is listed in header file @file{include/grub/err.h}. Textual +@code{VasEBoot_err_t}) and textual message that will be displayed to user. List of +valid error codes is listed in header file @file{include/VasEBoot/err.h}. Textual error message can contain any textual data. At time of writing, error message can contain up to 256 characters (including terminating NUL). To ease error -reporting there is a helper function @code{grub_error} that allows easier +reporting there is a helper function @code{VasEBoot_error} that allows easier formatting of error messages and should be used instead of writing directly to global variables. Example of error reporting. @example -grub_err_t +VasEBoot_err_t failing_example () @{ - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return VasEBoot_error (VasEBoot_ERR_FILE_NOT_FOUND, "Failed to read %s, tried %d times.", "test.txt", 10); @@ -837,39 +837,39 @@ failing_example () @end example If there is a special reason that error code does not need to be taken account, -@code{grub_errno} can be zeroed back to @code{GRUB_ERR_NONE}. In cases like this all +@code{VasEBoot_errno} can be zeroed back to @code{VasEBoot_ERR_NONE}. In cases like this all previous error codes should have been handled correctly. This makes sure that there are no unhandled exceptions. -Example of zeroing @code{grub_errno}. +Example of zeroing @code{VasEBoot_errno}. @example -grub_err_t +VasEBoot_err_t probe_example () @{ /* Try to probe device type 1. */ probe_for_device (); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) @{ /* Device type 1 was found on system. */ register_device (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; @} /* Zero out error code. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* No device type 1 found, try to probe device type 2. */ probe_for_device2 (); - if (grub_errno == GRUB_ERR_NONE) + if (VasEBoot_errno == VasEBoot_ERR_NONE) @{ /* Device type 2 was found on system. */ register_device2 (); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; @} /* Zero out error code. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; /* Return custom error message. */ - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No device type 1 or 2 found."); + return VasEBoot_error (VasEBoot_ERR_UNKNOWN_DEVICE, "No device type 1 or 2 found."); @} @end example @@ -877,8 +877,8 @@ Some times there is a need to continue processing even if there is a error state in application. In situations like this, there is a needed to save old error state and then call other functions that might fail. To aid in this, there is a error stack implemented. Error state can be pushed to error stack -by calling function @code{grub_error_push ()}. When processing has been completed, -@code{grub_error_pop ()} can be used to pop error state from stack. Error stack +by calling function @code{VasEBoot_error_push ()}. When processing has been completed, +@code{VasEBoot_error_pop ()} can be used to pop error state from stack. Error stack contains predefined amount of error stack items. Error stack is protected for overflow and marks these situations so overflow error does not get unseen. If there is no space available to store error message, it is simply discarded @@ -890,21 +890,21 @@ Overflow message will be shown at time when prompt is about to be drawn. Example usage of error stack. @example /* Save possible old error message. */ -grub_error_push (); +VasEBoot_error_push (); /* Do your stuff here. */ call_possibly_failing_function (); -if (grub_errno != GRUB_ERR_NONE) +if (VasEBoot_errno != VasEBoot_ERR_NONE) @{ - /* Inform rest of the code that there is error (grub_errno + /* Inform rest of the code that there is error (VasEBoot_errno is set). There is no pop here as we want both error states to be displayed. */ return; @} /* Restore old error state by popping previous item from stack. */ -grub_error_pop (); +VasEBoot_error_pop (); @end example @node Stack and heap size @@ -919,29 +919,29 @@ All available space between 1MiB and 4GiB marks is part of heap. On *-xen stack is 4MiB. If compiled for x86-64 with GCC 4.4 or later adressable space is unlimited. When compiled for x86-64 with older GCC version adressable space is limited to 2GiB. When compiling for i386 adressable space is limited -to 4GiB. All adressable pages except the ones for stack, GRUB binary, special +to 4GiB. All adressable pages except the ones for stack, VasEBoot binary, special pages and page table are in the heap. -On *-efi GRUB uses same stack as EFI. If compiled for x86-64 with GCC 4.4 or +On *-efi VasEBoot uses same stack as EFI. If compiled for x86-64 with GCC 4.4 or later adressable space is unlimited. When compiled for x86-64 with older GCC version adressable space is limited to 2GiB. For all other platforms adressable -space is limited to 4GiB. GRUB allocates pages from EFI for its heap, at most +space is limited to 4GiB. VasEBoot allocates pages from EFI for its heap, at most 1.6 GiB. -On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as IEEE1275. +On i386-ieee1275 and powerpc-ieee1275 VasEBoot uses same stack as IEEE1275. It allocates at most 32MiB for its heap. On sparc64-ieee1275 stack is 256KiB and heap is 2MiB. On mips(el)-qemu_mips and mipsel-loongson stack is 2MiB (everything below -GRUB image) and everything above GRUB image (from 2MiB + kernel size) +VasEBoot image) and everything above VasEBoot image (from 2MiB + kernel size) until 256MiB is part of heap. -On mips-arc stack is 2MiB (everything below GRUB image) and everything above -GRUB image(from 2MiB + kernel size) until 128MiB is part of heap. +On mips-arc stack is 2MiB (everything below VasEBoot image) and everything above +VasEBoot image(from 2MiB + kernel size) until 128MiB is part of heap. -On mipsel-arc stack is 2MiB (everything below GRUB image which is not part -of ARC) and everything above GRUB image (from 7MiB + kernel size) +On mipsel-arc stack is 2MiB (everything below VasEBoot image which is not part +of ARC) and everything above VasEBoot image (from 7MiB + kernel size) until 256MiB is part of heap. On arm-uboot stack is 256KiB and heap is 2MiB. @@ -980,7 +980,7 @@ In short: @item 0x07BE @tab 0x07FF @tab Partition table passed to another boot loader @item ? @tab 0x2000 - 1 @tab Real mode stack @item 0x7C00 @tab 0x7D00 - 1 @tab Boot sector -@item 0x8000 @tab ? @tab GRUB kernel +@item 0x8000 @tab ? @tab VasEBoot kernel @item 0x68000 @tab 0x71000 - 1 @tab Disk buffer @item ? @tab 0x80000 - 1 @tab Protected mode stack @item ? @tab 0xA0000 - 1 @tab Extended BIOS Data Area @@ -992,7 +992,7 @@ In short: @node Video Subsystem @chapter Video Subsystem @c By VesaJääskeläinen -This document contains specification for Video Subsystem for GRUB2. +This document contains specification for Video Subsystem for VasEBoot2. Currently only the usage interface is described in this document. Internal structure of how video drivers are registering and how video driver manager works are not included here. @@ -1006,45 +1006,45 @@ driver manager works are not included here. @node Video API @section Video API -@subsection grub_video_setup +@subsection VasEBoot_video_setup @itemize @item Prototype: @example -grub_err_t -grub_video_setup (unsigned int width, unsigned int height, unsigned int mode_type); +VasEBoot_err_t +VasEBoot_video_setup (unsigned int width, unsigned int height, unsigned int mode_type); @end example @item Description: -Driver will use information provided to it to select best possible video mode and switch to it. Supported values for @code{mode_type} are @code{GRUB_VIDEO_MODE_TYPE_INDEX_COLOR} for index color modes, @code{GRUB_VIDEO_MODE_TYPE_RGB} for direct RGB color modes and @code{GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED} for double buffering. When requesting RGB mode, highest bits per pixel mode will be selected. When requesting Index color mode, mode with highest number of colors will be selected. If all parameters are specified as zero, video adapter will try to figure out best possible mode and initialize it, platform specific differences are allowed here. If there is no mode matching request, error X will be returned. If there are no problems, function returns @code{GRUB_ERR_NONE}. +Driver will use information provided to it to select best possible video mode and switch to it. Supported values for @code{mode_type} are @code{VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR} for index color modes, @code{VasEBoot_VIDEO_MODE_TYPE_RGB} for direct RGB color modes and @code{VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED} for double buffering. When requesting RGB mode, highest bits per pixel mode will be selected. When requesting Index color mode, mode with highest number of colors will be selected. If all parameters are specified as zero, video adapter will try to figure out best possible mode and initialize it, platform specific differences are allowed here. If there is no mode matching request, error X will be returned. If there are no problems, function returns @code{VasEBoot_ERR_NONE}. This function also performs following task upon succesful mode switch. Active rendering target is changed to screen and viewport is maximized to allow whole screen to be used when performing graphics operations. In RGB modes, emulated palette gets 16 entries containing default values for VGA palette, other colors are defined as black. When switching to Indexed Color mode, driver may set default VGA palette to screen if the video card allows the operation. @end itemize -@subsection grub_video_restore +@subsection VasEBoot_video_restore @itemize @item Prototype: @example -grub_err_t -grub_video_restore (void); +VasEBoot_err_t +VasEBoot_video_restore (void); @end example @item Description: Video subsystem will deinitialize activated video driver to restore old state of video device. This can be used to switch back to text mode. @end itemize -@subsection grub_video_get_info +@subsection VasEBoot_video_get_info @itemize @item Prototype: @example -grub_err_t -grub_video_get_info (struct grub_video_mode_info *mode_info); +VasEBoot_err_t +VasEBoot_video_get_info (struct VasEBoot_video_mode_info *mode_info); @end example @example -struct grub_video_mode_info +struct VasEBoot_video_mode_info @{ /* Width of the screen. */ unsigned int width; @@ -1062,7 +1062,7 @@ struct grub_video_mode_info /* In index color mode, number of colors. In RGB mode this is 256. */ unsigned int number_of_colors; /* Optimization hint how binary data is coded. */ - enum grub_video_blit_format blit_format; + enum VasEBoot_video_blit_format blit_format; /* How many bits are reserved for red color. */ unsigned int red_mask_size; /* What is location of red color bits. In Index Color mode, this is 0. */ @@ -1084,52 +1084,52 @@ struct grub_video_mode_info @end example @item Description: -Software developer can use this function to query properties of active rendering taget. Information provided here can be used by other parts of GRUB, like image loaders to convert loaded images to correct screen format to allow more optimized blitters to be used. If there there is no configured video driver with active screen, error @code{GRUB_ERR_BAD_DEVICE} is returned, otherwise @code{mode_info} is filled with valid information and @code{GRUB_ERR_NONE} is returned. +Software developer can use this function to query properties of active rendering taget. Information provided here can be used by other parts of VasEBoot, like image loaders to convert loaded images to correct screen format to allow more optimized blitters to be used. If there there is no configured video driver with active screen, error @code{VasEBoot_ERR_BAD_DEVICE} is returned, otherwise @code{mode_info} is filled with valid information and @code{VasEBoot_ERR_NONE} is returned. @end itemize -@subsection grub_video_get_blit_format +@subsection VasEBoot_video_get_blit_format @itemize @item Prototype: @example -enum grub_video_blit_format -grub_video_get_blit_format (struct grub_video_mode_info *mode_info); +enum VasEBoot_video_blit_format +VasEBoot_video_get_blit_format (struct VasEBoot_video_mode_info *mode_info); @end example @example -enum grub_video_blit_format +enum VasEBoot_video_blit_format @{ /* Follow exactly field & mask information. */ - GRUB_VIDEO_BLIT_FORMAT_RGBA, + VasEBoot_VIDEO_BLIT_FORMAT_RGBA, /* Make optimization assumption. */ - GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, + VasEBoot_VIDEO_BLIT_FORMAT_R8G8B8A8, /* Follow exactly field & mask information. */ - GRUB_VIDEO_BLIT_FORMAT_RGB, + VasEBoot_VIDEO_BLIT_FORMAT_RGB, /* Make optimization assumption. */ - GRUB_VIDEO_BLIT_FORMAT_R8G8B8, + VasEBoot_VIDEO_BLIT_FORMAT_R8G8B8, /* When needed, decode color or just use value as is. */ - GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR + VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR @}; @end example @item Description: -Used to query how data could be optimized to suit specified video mode. Returns exact video format type, or a generic one if there is no definition for the type. For generic formats, use @code{grub_video_get_info} to query video color coding settings. +Used to query how data could be optimized to suit specified video mode. Returns exact video format type, or a generic one if there is no definition for the type. For generic formats, use @code{VasEBoot_video_get_info} to query video color coding settings. @end itemize -@subsection grub_video_set_palette +@subsection VasEBoot_video_set_palette @itemize @item Prototype: @example -grub_err_t -grub_video_set_palette (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data); +VasEBoot_err_t +VasEBoot_video_set_palette (unsigned int start, unsigned int count, struct VasEBoot_video_palette_data *palette_data); @end example @example -struct grub_video_palette_data +struct VasEBoot_video_palette_data @{ - grub_uint8_t r; /* Red color value (0-255). */ - grub_uint8_t g; /* Green color value (0-255). */ - grub_uint8_t b; /* Blue color value (0-255). */ - grub_uint8_t a; /* Reserved bits value (0-255). */ + VasEBoot_uint8_t r; /* Red color value (0-255). */ + VasEBoot_uint8_t g; /* Green color value (0-255). */ + VasEBoot_uint8_t b; /* Blue color value (0-255). */ + VasEBoot_uint8_t a; /* Reserved bits value (0-255). */ @}; @end example @item Description: @@ -1137,21 +1137,21 @@ struct grub_video_palette_data Used to setup indexed color palettes. If mode is RGB mode, colors will be set to emulated palette data. In Indexed Color modes, palettes will be set to hardware. Color values will be converted to suit requirements of the video mode. @code{start} will tell what hardware color index (or emulated color index) will be set to according information in first indice of @code{palette_data}, after that both hardware color index and @code{palette_data} index will be incremented until @code{count} number of colors have been set. @end itemize -@subsection grub_video_get_palette +@subsection VasEBoot_video_get_palette @itemize @item Prototype: @example -grub_err_t -grub_video_get_palette (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data); +VasEBoot_err_t +VasEBoot_video_get_palette (unsigned int start, unsigned int count, struct VasEBoot_video_palette_data *palette_data); @end example @example -struct grub_video_palette_data +struct VasEBoot_video_palette_data @{ - grub_uint8_t r; /* Red color value (0-255). */ - grub_uint8_t g; /* Green color value (0-255). */ - grub_uint8_t b; /* Blue color value (0-255). */ - grub_uint8_t a; /* Reserved bits value (0-255). */ + VasEBoot_uint8_t r; /* Red color value (0-255). */ + VasEBoot_uint8_t g; /* Green color value (0-255). */ + VasEBoot_uint8_t b; /* Blue color value (0-255). */ + VasEBoot_uint8_t a; /* Reserved bits value (0-255). */ @}; @end example @item Description: @@ -1159,19 +1159,19 @@ struct grub_video_palette_data Used to query indexed color palettes. If mode is RGB mode, colors will be copied from emulated palette data. In Indexed Color modes, palettes will be read from hardware. Color values will be converted to suit structure format. @code{start} will tell what hardware color index (or emulated color index) will be used as a source for first indice of @code{palette_data}, after that both hardware color index and @code{palette_data} index will be incremented until @code{count} number of colors have been read. @end itemize -@subsection grub_video_set_area_status +@subsection VasEBoot_video_set_area_status @itemize @item Prototype: @example -grub_err_t -grub_video_set_area_status (grub_video_area_status_t area_status); +VasEBoot_err_t +VasEBoot_video_set_area_status (VasEBoot_video_area_status_t area_status); @end example @example -enum grub_video_area_status_t +enum VasEBoot_video_area_status_t @{ - GRUB_VIDEO_AREA_DISABLED, - GRUB_VIDEO_AREA_ENABLED + VasEBoot_VIDEO_AREA_DISABLED, + VasEBoot_VIDEO_AREA_ENABLED @}; @end example @@ -1187,52 +1187,52 @@ inside the region leaving everything else intact. Should be used for redrawing of active elements. @end itemize -@subsection grub_video_get_area_status +@subsection VasEBoot_video_get_area_status @itemize @item Prototype: @example -grub_err_r -grub_video_get_area_status (grub_video_area_status_t *area_status); +VasEBoot_err_r +VasEBoot_video_get_area_status (VasEBoot_video_area_status_t *area_status); @end example @item Description: Used to query the area status. @end itemize -@subsection grub_video_set_viewport +@subsection VasEBoot_video_set_viewport @itemize @item Prototype: @example -grub_err_t -grub_video_set_viewport (unsigned int x, unsigned int y, unsigned int width, unsigned int height); +VasEBoot_err_t +VasEBoot_video_set_viewport (unsigned int x, unsigned int y, unsigned int width, unsigned int height); @end example @item Description: -Used to specify viewport where draw commands are performed. When viewport is set, all draw commands coordinates relate to those specified by @code{x} and @code{y}. If draw commands try to draw over viewport, they are clipped. If developer requests larger than possible viewport, width and height will be clamped to fit screen. If @code{x} and @code{y} are out of bounds, all functions drawing to screen will not be displayed. In order to maximize viewport, use @code{grub_video_get_info} to query actual screen dimensions and provide that information to this function. +Used to specify viewport where draw commands are performed. When viewport is set, all draw commands coordinates relate to those specified by @code{x} and @code{y}. If draw commands try to draw over viewport, they are clipped. If developer requests larger than possible viewport, width and height will be clamped to fit screen. If @code{x} and @code{y} are out of bounds, all functions drawing to screen will not be displayed. In order to maximize viewport, use @code{VasEBoot_video_get_info} to query actual screen dimensions and provide that information to this function. @end itemize -@subsection grub_video_get_viewport +@subsection VasEBoot_video_get_viewport @itemize @item Prototype: @example -grub_err_t -grub_video_get_viewport (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); +VasEBoot_err_t +VasEBoot_video_get_viewport (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); @end example @item Description: Used to query current viewport dimensions. Software developer can use this to choose best way to render contents of the viewport. @end itemize -@subsection grub_video_set_region +@subsection VasEBoot_video_set_region @itemize @item Prototype: @example -grub_err_t -grub_video_set_region (unsigned int x, unsigned int y, unsigned int width, unsigned int height); +VasEBoot_err_t +VasEBoot_video_set_region (unsigned int x, unsigned int y, unsigned int width, unsigned int height); @end example @item Description: @@ -1244,148 +1244,148 @@ requests larger than possible region, width and height will be clamped to fit screen. Should be used for redrawing of active elements. @end itemize -@subsection grub_video_get_region +@subsection VasEBoot_video_get_region @itemize @item Prototype: @example -grub_err_t -grub_video_get_region (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); +VasEBoot_err_t +VasEBoot_video_get_region (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); @end example @item Description: Used to query current region dimensions. @end itemize -@subsection grub_video_map_color +@subsection VasEBoot_video_map_color @itemize @item Prototype: @example -grub_video_color_t -grub_video_map_color (grub_uint32_t color_name); +VasEBoot_video_color_t +VasEBoot_video_map_color (VasEBoot_uint32_t color_name); @end example @item Description: -Map color can be used to support color themes in GRUB. There will be collection of color names that can be used to query actual screen mapped color data. Examples could be @code{GRUB_COLOR_CONSOLE_BACKGROUND}, @code{GRUB_COLOR_CONSOLE_TEXT}. The actual color defines are not specified at this point. +Map color can be used to support color themes in VasEBoot. There will be collection of color names that can be used to query actual screen mapped color data. Examples could be @code{VasEBoot_COLOR_CONSOLE_BACKGROUND}, @code{VasEBoot_COLOR_CONSOLE_TEXT}. The actual color defines are not specified at this point. @end itemize -@subsection grub_video_map_rgb +@subsection VasEBoot_video_map_rgb @itemize @item Prototype: @example -grub_video_color_t -grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue); +VasEBoot_video_color_t +VasEBoot_video_map_rgb (VasEBoot_uint8_t red, VasEBoot_uint8_t green, VasEBoot_uint8_t blue); @end example @item Description: Map RGB values to compatible screen color data. Values are expected to be in range 0-255 and in RGB modes they will be converted to screen color data. In index color modes, index color palette will be searched for specified color and then index is returned. @end itemize -@subsection grub_video_map_rgba +@subsection VasEBoot_video_map_rgba @itemize @item Prototype: @example -grub_video_color_t -grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue, grub_uint8_t alpha); +VasEBoot_video_color_t +VasEBoot_video_map_rgba (VasEBoot_uint8_t red, VasEBoot_uint8_t green, VasEBoot_uint8_t blue, VasEBoot_uint8_t alpha); @end example @item Description: Map RGBA values to compatible screen color data. Values are expected to be in range 0-255. In RGBA modes they will be converted to screen color data. In index color modes, index color palette will be searched for best matching color and its index is returned. @end itemize -@subsection grub_video_unmap_color +@subsection VasEBoot_video_unmap_color @itemize @item Prototype: @example -grub_err_t -grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red, grub_uint8_t *green, grub_uint8_t *blue, grub_uint8_t *alpha); +VasEBoot_err_t +VasEBoot_video_unmap_color (VasEBoot_video_color_t color, VasEBoot_uint8_t *red, VasEBoot_uint8_t *green, VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha); @end example @item Description: Unmap color value from @code{color} to color channels in @code{red}, @code{green}, @code{blue} and @code{alpha}. Values will be in range 0-255. Active rendering target will be used for color domain. In case alpha information is not available in rendering target, it is assumed to be opaque (having value 255). @end itemize -@subsection grub_video_fill_rect +@subsection VasEBoot_video_fill_rect @itemize @item Prototype: @example -grub_err_t -grub_video_fill_rect (grub_video_color_t color, int x, int y, unsigned int width, unsigned int height); +VasEBoot_err_t +VasEBoot_video_fill_rect (VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height); @end example @item Description: Fill specified area limited by given coordinates within specified viewport. Negative coordinates are accepted in order to allow easy moving of rectangle within viewport. If coordinates are negative, area of the rectangle will be shrinken to follow size limits of the viewport. -Software developer should use either @code{grub_video_map_color}, @code{grub_video_map_rgb} or @code{grub_video_map_rgba} to map requested color to @code{color} parameter. +Software developer should use either @code{VasEBoot_video_map_color}, @code{VasEBoot_video_map_rgb} or @code{VasEBoot_video_map_rgba} to map requested color to @code{color} parameter. @end itemize -@subsection grub_video_blit_glyph +@subsection VasEBoot_video_blit_glyph @itemize @item Prototype: @example -grub_err_t -grub_video_blit_glyph (struct grub_font_glyph *glyph, grub_video_color_t color, int x, int y); +VasEBoot_err_t +VasEBoot_video_blit_glyph (struct VasEBoot_font_glyph *glyph, VasEBoot_video_color_t color, int x, int y); @end example @example -struct grub_font_glyph @{ +struct VasEBoot_font_glyph @{ /* TBD. */ @}; @end example @item Description: -Used to blit glyph to viewport in specified coodinates. If glyph is at edge of viewport, pixels outside of viewport will be clipped out. Software developer should use either @code{grub_video_map_rgb} or @code{grub_video_map_rgba} to map requested color to @code{color} parameter. +Used to blit glyph to viewport in specified coodinates. If glyph is at edge of viewport, pixels outside of viewport will be clipped out. Software developer should use either @code{VasEBoot_video_map_rgb} or @code{VasEBoot_video_map_rgba} to map requested color to @code{color} parameter. @end itemize -@subsection grub_video_blit_bitmap +@subsection VasEBoot_video_blit_bitmap @itemize @item Prototype: @example -grub_err_t -grub_video_blit_bitmap (struct grub_video_bitmap *bitmap, enum grub_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); +VasEBoot_err_t +VasEBoot_video_blit_bitmap (struct VasEBoot_video_bitmap *bitmap, enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); @end example @example -struct grub_video_bitmap +struct VasEBoot_video_bitmap @{ /* TBD. */ @}; -enum grub_video_blit_operators +enum VasEBoot_video_blit_operators @{ - GRUB_VIDEO_BLIT_REPLACE, - GRUB_VIDEO_BLIT_BLEND + VasEBoot_VIDEO_BLIT_REPLACE, + VasEBoot_VIDEO_BLIT_BLEND @}; @end example @item Description: Used to blit bitmap to viewport in specified coordinates. If part of bitmap is outside of viewport region, it will be clipped out. Offsets affect bitmap position where data will be copied from. Negative values for both viewport coordinates and bitmap offset coordinates are allowed. If data is looked out of bounds of bitmap, color value will be assumed to be transparent. If viewport coordinates are negative, area of the blitted rectangle will be shrinken to follow size limits of the viewport and bitmap. Blitting operator @code{oper} specifies should source pixel replace data in screen or blend with pixel alpha value. -Software developer should use @code{grub_video_bitmap_create} or @code{grub_video_bitmap_load} to create or load bitmap data. +Software developer should use @code{VasEBoot_video_bitmap_create} or @code{VasEBoot_video_bitmap_load} to create or load bitmap data. @end itemize -@subsection grub_video_blit_render_target +@subsection VasEBoot_video_blit_render_target @itemize @item Prototype: @example -grub_err_t -grub_video_blit_render_target (struct grub_video_render_target *source, enum grub_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); +VasEBoot_err_t +VasEBoot_video_blit_render_target (struct VasEBoot_video_render_target *source, enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); @end example @example -struct grub_video_render_target @{ +struct VasEBoot_video_render_target @{ /* This is private data for video driver. Should not be accessed from elsewhere directly. */ @}; -enum grub_video_blit_operators +enum VasEBoot_video_blit_operators @{ - GRUB_VIDEO_BLIT_REPLACE, - GRUB_VIDEO_BLIT_BLEND + VasEBoot_VIDEO_BLIT_REPLACE, + VasEBoot_VIDEO_BLIT_BLEND @}; @end example @item Description: @@ -1393,101 +1393,101 @@ enum grub_video_blit_operators Used to blit source render target to viewport in specified coordinates. If part of source render target is outside of viewport region, it will be clipped out. If blitting operator is specified and source contains alpha values, resulting pixel color components will be calculated using formula ((src_color * src_alpha) + (dst_color * (255 - src_alpha)) / 255, if target buffer has alpha, it will be set to src_alpha. Offsets affect render target position where data will be copied from. If data is looked out of bounds of render target, color value will be assumed to be transparent. Blitting operator @code{oper} specifies should source pixel replace data in screen or blend with pixel alpha value. @end itemize -@subsection grub_video_scroll +@subsection VasEBoot_video_scroll @itemize @item Prototype: @example -grub_err_t -grub_video_scroll (grub_video_color_t color, int dx, int dy); +VasEBoot_err_t +VasEBoot_video_scroll (VasEBoot_video_color_t color, int dx, int dy); @end example @item Description: Used to scroll viewport to specified direction. New areas are filled with specified color. This function is used when screen is scroller up in video terminal. @end itemize -@subsection grub_video_swap_buffers +@subsection VasEBoot_video_swap_buffers @itemize @item Prototype: @example -grub_err_t -grub_video_swap_buffers (void); +VasEBoot_err_t +VasEBoot_video_swap_buffers (void); @end example @item Description: If double buffering is enabled, this swaps frontbuffer and backbuffer, in order to show values drawn to back buffer. Video driver is free to choose how this operation is techincally done. @end itemize -@subsection grub_video_create_render_target +@subsection VasEBoot_video_create_render_target @itemize @item Prototype: @example -grub_err_t -grub_video_create_render_target (struct grub_video_render_target **result, unsigned int width, unsigned int height, unsigned int mode_type); +VasEBoot_err_t +VasEBoot_video_create_render_target (struct VasEBoot_video_render_target **result, unsigned int width, unsigned int height, unsigned int mode_type); @end example @example -struct grub_video_render_target @{ +struct VasEBoot_video_render_target @{ /* This is private data for video driver. Should not be accessed from elsewhere directly. */ @}; @end example @item Description: -Driver will use information provided to it to create best fitting render target. @code{mode_type} will be used to guide on selecting what features are wanted for render target. Supported values for @code{mode_type} are @code{GRUB_VIDEO_MODE_TYPE_INDEX_COLOR} for index color modes, @code{GRUB_VIDEO_MODE_TYPE_RGB} for direct RGB color modes and @code{GRUB_VIDEO_MODE_TYPE_ALPHA} for alpha component. +Driver will use information provided to it to create best fitting render target. @code{mode_type} will be used to guide on selecting what features are wanted for render target. Supported values for @code{mode_type} are @code{VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR} for index color modes, @code{VasEBoot_VIDEO_MODE_TYPE_RGB} for direct RGB color modes and @code{VasEBoot_VIDEO_MODE_TYPE_ALPHA} for alpha component. @end itemize -@subsection grub_video_delete_render_target +@subsection VasEBoot_video_delete_render_target @itemize @item Prototype: @example -grub_err_t -grub_video_delete_render_target (struct grub_video_render_target *target); +VasEBoot_err_t +VasEBoot_video_delete_render_target (struct VasEBoot_video_render_target *target); @end example @item Description: -Used to delete previously created render target. If @code{target} contains @code{NULL} pointer, nothing will be done. If render target is correctly destroyed, GRUB_ERR_NONE is returned. +Used to delete previously created render target. If @code{target} contains @code{NULL} pointer, nothing will be done. If render target is correctly destroyed, VasEBoot_ERR_NONE is returned. @end itemize -@subsection grub_video_set_active_render_target +@subsection VasEBoot_video_set_active_render_target @itemize @item Prototype: @example -grub_err_t -grub_video_set_active_render_target (struct grub_video_render_target *target); +VasEBoot_err_t +VasEBoot_video_set_active_render_target (struct VasEBoot_video_render_target *target); @end example @item Description: -Sets active render target. If this comand is successful all drawing commands will be done to specified @code{target}. There is also special values for target, @code{GRUB_VIDEO_RENDER_TARGET_DISPLAY} used to reference screen's front buffer, @code{GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER} used to reference screen's front buffer (alias for @code{GRUB_VIDEO_RENDER_TARGET_DISPLAY}) and @code{GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER} used to reference back buffer (if double buffering is enabled). If render target is correclty switched GRUB_ERR_NONE is returned. In no any event shall there be non drawable active render target. +Sets active render target. If this comand is successful all drawing commands will be done to specified @code{target}. There is also special values for target, @code{VasEBoot_VIDEO_RENDER_TARGET_DISPLAY} used to reference screen's front buffer, @code{VasEBoot_VIDEO_RENDER_TARGET_FRONT_BUFFER} used to reference screen's front buffer (alias for @code{VasEBoot_VIDEO_RENDER_TARGET_DISPLAY}) and @code{VasEBoot_VIDEO_RENDER_TARGET_BACK_BUFFER} used to reference back buffer (if double buffering is enabled). If render target is correclty switched VasEBoot_ERR_NONE is returned. In no any event shall there be non drawable active render target. @end itemize -@subsection grub_video_get_active_render_target +@subsection VasEBoot_video_get_active_render_target @itemize @item Prototype: @example -grub_err_t -grub_video_get_active_render_target (struct grub_video_render_target **target); +VasEBoot_err_t +VasEBoot_video_get_active_render_target (struct VasEBoot_video_render_target **target); @end example @item Description: -Returns currently active render target. It returns value in @code{target} that can be subsequently issued back to @code{grub_video_set_active_render_target}. +Returns currently active render target. It returns value in @code{target} that can be subsequently issued back to @code{VasEBoot_video_set_active_render_target}. @end itemize @node Example usage of Video API @section Example usage of Video API @subsection Example of screen setup @example -grub_err_t rc; +VasEBoot_err_t rc; /* Try to initialize video mode 1024 x 768 with direct RGB. */ -rc = grub_video_setup (1024, 768, GRUB_VIDEO_MODE_TYPE_RGB); -if (rc != GRUB_ERR_NONE) +rc = VasEBoot_video_setup (1024, 768, VasEBoot_VIDEO_MODE_TYPE_RGB); +if (rc != VasEBoot_ERR_NONE) @{ /* Fall back to standard VGA Index Color mode. */ - rc = grub_video_setup (640, 480, GRUB_VIDEO_MODE_TYPE_INDEX); - if (rc != GRUB_ERR_NONE) + rc = VasEBoot_video_setup (640, 480, VasEBoot_VIDEO_MODE_TYPE_INDEX); + if (rc != VasEBoot_ERR_NONE) @{ /* Handle error. */ @} @@ -1495,69 +1495,69 @@ if (rc != GRUB_ERR_NONE) @end example @subsection Example of setting up console viewport @example -grub_uint32_t x, y, width, height; -grub_video_color_t color; -struct grub_font_glyph glyph; -grub_err_t rc; +VasEBoot_uint32_t x, y, width, height; +VasEBoot_video_color_t color; +struct VasEBoot_font_glyph glyph; +VasEBoot_err_t rc; /* Query existing viewport. */ -grub_video_get_viewport (&x, &y, &width, &height); +VasEBoot_video_get_viewport (&x, &y, &width, &height); /* Fill background. */ -color = grub_video_map_color (GRUB_COLOR_BACKGROUND); -grub_video_fill_rect (color, 0, 0, width, height); +color = VasEBoot_video_map_color (VasEBoot_COLOR_BACKGROUND); +VasEBoot_video_fill_rect (color, 0, 0, width, height); /* Setup console viewport. */ -grub_video_set_viewport (x + 10, y + 10, width - 20, height - 20); -grub_video_get_viewport (&x, &y, &width, &height); -color = grub_video_map_color (GRUB_COLOR_CONSOLE_BACKGROUND); -grub_video_fill_rect (color, 0, 0, width, height); +VasEBoot_video_set_viewport (x + 10, y + 10, width - 20, height - 20); +VasEBoot_video_get_viewport (&x, &y, &width, &height); +color = VasEBoot_video_map_color (VasEBoot_COLOR_CONSOLE_BACKGROUND); +VasEBoot_video_fill_rect (color, 0, 0, width, height); /* Draw text to viewport. */ -color = grub_video_map_color (GRUB_COLOR_CONSOLE_TEXT); -grub_font_get_glyph ('X', &glyph); -grub_video_blit_glyph (&glyph, color, 0, 0); +color = VasEBoot_video_map_color (VasEBoot_COLOR_CONSOLE_TEXT); +VasEBoot_font_get_glyph ('X', &glyph); +VasEBoot_video_blit_glyph (&glyph, color, 0, 0); @end example @node Bitmap API @section Bitmap API -@subsection grub_video_bitmap_create +@subsection VasEBoot_video_bitmap_create @itemize @item Prototype: @example -grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap, unsigned int width, unsigned int height, enum grub_video_blit_format blit_format) +VasEBoot_err_t VasEBoot_video_bitmap_create (struct VasEBoot_video_bitmap **bitmap, unsigned int width, unsigned int height, enum VasEBoot_video_blit_format blit_format) @end example @item Description: -Creates a new bitmap with given dimensions and blitting format. Allocated bitmap data can then be modified freely and finally blitted with @code{grub_video_blit_bitmap} to rendering target. +Creates a new bitmap with given dimensions and blitting format. Allocated bitmap data can then be modified freely and finally blitted with @code{VasEBoot_video_blit_bitmap} to rendering target. @end itemize -@subsection grub_video_bitmap_destroy +@subsection VasEBoot_video_bitmap_destroy @itemize @item Prototype: @example -grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap); +VasEBoot_err_t VasEBoot_video_bitmap_destroy (struct VasEBoot_video_bitmap *bitmap); @end example @item Description: -When bitmap is no longer needed, it can be freed from memory using this command. @code{bitmap} is previously allocated bitmap with @code{grub_video_bitmap_create} or loaded with @code{grub_video_bitmap_load}. +When bitmap is no longer needed, it can be freed from memory using this command. @code{bitmap} is previously allocated bitmap with @code{VasEBoot_video_bitmap_create} or loaded with @code{VasEBoot_video_bitmap_load}. @end itemize -@subsection grub_video_bitmap_load +@subsection VasEBoot_video_bitmap_load @itemize @item Prototype: @example -grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap, const char *filename); +VasEBoot_err_t VasEBoot_video_bitmap_load (struct VasEBoot_video_bitmap **bitmap, const char *filename); @end example @item Description: -Tries to load given bitmap (@code{filename}) using registered bitmap loaders. In case bitmap format is not recognized or supported error @code{GRUB_ERR_BAD_FILE_TYPE} is returned. +Tries to load given bitmap (@code{filename}) using registered bitmap loaders. In case bitmap format is not recognized or supported error @code{VasEBoot_ERR_BAD_FILE_TYPE} is returned. @end itemize -@subsection grub_video_bitmap_get_width +@subsection VasEBoot_video_bitmap_get_width @itemize @item Prototype: @example -unsigned int grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap); +unsigned int VasEBoot_video_bitmap_get_width (struct VasEBoot_video_bitmap *bitmap); @end example @item Description: @@ -1565,11 +1565,11 @@ unsigned int grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap); Returns bitmap width. @end itemize -@subsection grub_video_bitmap_get_height +@subsection VasEBoot_video_bitmap_get_height @itemize @item Prototype: @example -unsigned int grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap); +unsigned int VasEBoot_video_bitmap_get_height (struct VasEBoot_video_bitmap *bitmap); @end example @item Description: @@ -1577,23 +1577,23 @@ unsigned int grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap); Return bitmap height. @end itemize -@subsection grub_video_bitmap_get_mode_info +@subsection VasEBoot_video_bitmap_get_mode_info @itemize @item Prototype: @example -void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap, struct grub_video_mode_info *mode_info); +void VasEBoot_video_bitmap_get_mode_info (struct VasEBoot_video_bitmap *bitmap, struct VasEBoot_video_mode_info *mode_info); @end example @item Description: -Returns bitmap format details in form of @code{grub_video_mode_info}. +Returns bitmap format details in form of @code{VasEBoot_video_mode_info}. @end itemize -@subsection grub_video_bitmap_get_data +@subsection VasEBoot_video_bitmap_get_data @itemize @item Prototype: @example -void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap); +void *VasEBoot_video_bitmap_get_data (struct VasEBoot_video_bitmap *bitmap); @end example @item Description: @@ -1621,31 +1621,31 @@ The goal of this format is to provide a bitmap font format that is simple to use, compact, and cleanly supports Unicode. -@subsection Goals of the GRUB Font Format +@subsection Goals of the VasEBoot Font Format @itemize @item Simple to read and use. -Since GRUB will only be reading the font files, +Since VasEBoot will only be reading the font files, we are more concerned with making the code to read the font simple than we are with writing the font. @item Compact storage. The fonts will generally be stored in a small boot -partition where GRUB is located, and this may be on a removable storage +partition where VasEBoot is located, and this may be on a removable storage device such as a CD or USB flash drive where space is more limited than it is on most hard drives. @item Unicode. -GRUB should not have to deal with multiple character +VasEBoot should not have to deal with multiple character encodings. The font should always use Unicode character codes for simple internationalization. @end itemize @subsection Why Another Font Format? -There are many existing bitmap font formats that GRUB could use. However, +There are many existing bitmap font formats that VasEBoot could use. However, there are aspects of these formats that may make them less than suitable for -use in GRUB at this time: +use in VasEBoot at this time: @table @samp @item BDF @@ -1836,15 +1836,15 @@ An illustration of how the various font metrics apply to characters. @node Introduction_2 @section Introduction -The @samp{gfxmenu} module provides a graphical menu interface for GRUB 2. It +The @samp{gfxmenu} module provides a graphical menu interface for VasEBoot 2. It functions as an alternative to the menu interface provided by the @samp{normal} -module, which uses the grub terminal interface to display a menu on a +module, which uses the VasEBoot terminal interface to display a menu on a character-oriented terminal. -The graphical menu uses the GRUB video API, which is currently for the VESA +The graphical menu uses the VasEBoot video API, which is currently for the VESA BIOS extensions (VBE) 2.0+. This is supported on the i386-pc platform. However, the graphical menu itself does not depend on using VBE, so if another -GRUB video driver were implemented, the @samp{gfxmenu} graphical menu would work +VasEBoot video driver were implemented, the @samp{gfxmenu} graphical menu would work on the new video driver as well. @@ -1852,19 +1852,19 @@ on the new video driver as well. @section Startup Sequence @itemize -@item grub_enter_normal_mode [normal/main.c] -@item grub_normal_execute [normal/main.c] +@item VasEBoot_enter_normal_mode [normal/main.c] +@item VasEBoot_normal_execute [normal/main.c] @item read_config_file [normal/main.c] -@item (When @file{gfxmenu.mod} is loaded with @command{insmod}, it will call @code{grub_menu_viewer_register()} to register itself.) -@item GRUB_MOD_INIT (gfxmenu) [gfxmenu/gfxmenu.c] -@item grub_menu_viewer_register [kern/menu_viewer.c] -@item grub_menu_viewer_show_menu [kern/menu_viewer.c] +@item (When @file{gfxmenu.mod} is loaded with @command{insmod}, it will call @code{VasEBoot_menu_viewer_register()} to register itself.) +@item VasEBoot_MOD_INIT (gfxmenu) [gfxmenu/gfxmenu.c] +@item VasEBoot_menu_viewer_register [kern/menu_viewer.c] +@item VasEBoot_menu_viewer_show_menu [kern/menu_viewer.c] @item get_current_menu_viewer() [kern/menu_viewer.c] @item show_menu() [gfxmenu/gfxmenu.c] -@item grub_gfxmenu_model_new [gfxmenu/model.c] -@item grub_gfxmenu_view_new [gfxmenu/view.c] +@item VasEBoot_gfxmenu_model_new [gfxmenu/model.c] +@item VasEBoot_gfxmenu_view_new [gfxmenu/view.c] @item set_graphics_mode [gfxmenu/view.c] -@item grub_gfxmenu_view_load_theme [gfxmenu/theme_loader.c] +@item VasEBoot_gfxmenu_view_load_theme [gfxmenu/theme_loader.c] @end itemize @@ -1916,7 +1916,7 @@ functions (defined in @file{gfxmenu/gui_util.c}) that are particularly useful: @itemize -@item @code{grub_gui_find_by_id (root, id, callback, userdata)}: +@item @code{VasEBoot_gui_find_by_id (root, id, callback, userdata)}: This function ecursively traverses the component tree rooted at @var{root}, and for every component that has an ID equal to @var{id}, calls the function pointed @@ -1924,7 +1924,7 @@ to by @var{callback} with the matching component and the void pointer @var{userd as arguments. The callback function can do whatever is desired to use the component passed in. -@item @code{grub_gui_iterate_recursively (root, callback, userdata)}: +@item @code{VasEBoot_gui_iterate_recursively (root, callback, userdata)}: This function calls the function pointed to by @var{callback} for every component that is a descendant of @var{root} in the component tree. When the @@ -1944,8 +1944,8 @@ view uses. This is bad for performance, however, so it would probably be a good idea to make it possible to temporarily disable double buffering as long as the terminal window is visible. There are still unresolved problems that occur when commands are executed from the terminal window that change the -graphics mode. It's possible that making @code{grub_video_restore()} return to -the graphics mode that was in use before @code{grub_video_setup()} was called +graphics mode. It's possible that making @code{VasEBoot_video_restore()} return to +the graphics mode that was in use before @code{VasEBoot_video_setup()} was called might fix some of the problems. diff --git a/docs/VasEBoot.cfg b/docs/VasEBoot.cfg index dc184d7d9..3f8890572 100644 --- a/docs/VasEBoot.cfg +++ b/docs/VasEBoot.cfg @@ -1,5 +1,5 @@ # -# Sample GRUB configuration file +# Sample VasEBoot configuration file # # Boot automatically after 30 secs. diff --git a/docs/VasEBoot.texi b/docs/VasEBoot.texi index eedf4319a..9c9936580 100644 --- a/docs/VasEBoot.texi +++ b/docs/VasEBoot.texi @@ -1,9 +1,9 @@ \input texinfo @c -*-texinfo-*- @c %**start of header -@setfilename grub.info +@setfilename VasEBoot.info @include version.texi -@settitle GNU GRUB Manual @value{VERSION} +@settitle GNU VasEBoot Manual @value{VERSION} @c Unify all our little indices for now. @syncodeindex fn cp @syncodeindex vr cp @@ -17,7 +17,7 @@ @finalout @copying -This manual is for GNU GRUB (version @value{VERSION}, +This manual is for GNU VasEBoot (version @value{VERSION}, @value{UPDATED}). Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. @@ -32,22 +32,22 @@ Invariant Sections. @dircategory Kernel @direntry -* GRUB: (grub). The GRand Unified Bootloader -* grub-install: (grub)Invoking grub-install. Install GRUB on your drive -* grub-mkconfig: (grub)Invoking grub-mkconfig. Generate GRUB configuration -* grub-mkpasswd-pbkdf2: (grub)Invoking grub-mkpasswd-pbkdf2. -* grub-mkrelpath: (grub)Invoking grub-mkrelpath. -* grub-mkrescue: (grub)Invoking grub-mkrescue. Make a GRUB rescue image -* grub-mount: (grub)Invoking grub-mount. Mount a file system using GRUB -* grub-probe: (grub)Invoking grub-probe. Probe device information -* grub-script-check: (grub)Invoking grub-script-check. +* VasEBoot: (VasEBoot). The GRand Unified Bootloader +* VasEBoot-install: (VasEBoot)Invoking VasEBoot-install. Install VasEBoot on your drive +* VasEBoot-mkconfig: (VasEBoot)Invoking VasEBoot-mkconfig. Generate VasEBoot configuration +* VasEBoot-mkpasswd-pbkdf2: (VasEBoot)Invoking VasEBoot-mkpasswd-pbkdf2. +* VasEBoot-mkrelpath: (VasEBoot)Invoking VasEBoot-mkrelpath. +* VasEBoot-mkrescue: (VasEBoot)Invoking VasEBoot-mkrescue. Make a VasEBoot rescue image +* VasEBoot-mount: (VasEBoot)Invoking VasEBoot-mount. Mount a file system using VasEBoot +* VasEBoot-probe: (VasEBoot)Invoking VasEBoot-probe. Probe device information +* VasEBoot-script-check: (VasEBoot)Invoking VasEBoot-script-check. @end direntry @setchapternewpage odd @titlepage @sp 10 -@title the GNU GRUB manual +@title the GNU VasEBoot manual @subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}. @author Gordon Matzigkeit @author Yoshinori K. Okuji @@ -67,9 +67,9 @@ Invariant Sections. @ifnottex @node Top -@top GNU GRUB manual +@top GNU VasEBoot manual -This is the documentation of GNU GRUB, the GRand Unified Bootloader, +This is the documentation of GNU VasEBoot, the GRand Unified Bootloader, a flexible and powerful boot loader program for a wide range of architectures. @@ -79,55 +79,55 @@ This edition documents version @value{VERSION}. @end ifnottex @menu -* Introduction:: Capturing the spirit of GRUB -* Naming convention:: Names of your drives in GRUB -* OS-specific notes about grub tools:: - Some notes about OS-specific behaviour of GRUB +* Introduction:: Capturing the spirit of VasEBoot +* Naming convention:: Names of your drives in VasEBoot +* OS-specific notes about VasEBoot tools:: + Some notes about OS-specific behaviour of VasEBoot tools -* Installation:: Installing GRUB on your drive +* Installation:: Installing VasEBoot on your drive * Booting:: How to boot different operating systems * Configuration:: Writing your own configuration file -* Theme file format:: Format of GRUB theme files +* Theme file format:: Format of VasEBoot theme files * Network:: Downloading OS images from a network -* Serial terminal:: Using GRUB via a serial line -* Vendor power-on keys:: Changing GRUB behaviour on vendor power-on keys -* Images:: GRUB image files -* Core image size limitation:: GRUB image files size limitations +* Serial terminal:: Using VasEBoot via a serial line +* Vendor power-on keys:: Changing VasEBoot behaviour on vendor power-on keys +* Images:: VasEBoot image files +* Core image size limitation:: VasEBoot image files size limitations * Filesystem:: Filesystem syntax and semantics * Interface:: The menu and the command-line -* Environment:: GRUB environment variables +* Environment:: VasEBoot environment variables * Commands:: The list of available builtin commands * Internationalisation:: Topics relating to language support * Security:: Authentication, authorisation, and signatures * Platform limitations:: The list of platform-specific limitations * Platform-specific operations:: Platform-specific operations * Supported kernels:: The list of supported kernels -* Troubleshooting:: Error messages produced by GRUB -* Invoking grub-install:: How to use the GRUB installer -* Invoking grub-mkconfig:: Generate a GRUB configuration file -* Invoking grub-mkpasswd-pbkdf2:: - Generate GRUB password hashes -* Invoking grub-mkrelpath:: Make system path relative to its root -* Invoking grub-mkrescue:: Make a GRUB rescue image -* Invoking grub-mount:: Mount a file system using GRUB -* Invoking grub-probe:: Probe device information for GRUB -* Invoking grub-script-check:: Check GRUB script file for syntax errors -* Obtaining and Building GRUB:: How to obtain and build GRUB +* Troubleshooting:: Error messages produced by VasEBoot +* Invoking VasEBoot-install:: How to use the VasEBoot installer +* Invoking VasEBoot-mkconfig:: Generate a VasEBoot configuration file +* Invoking VasEBoot-mkpasswd-pbkdf2:: + Generate VasEBoot password hashes +* Invoking VasEBoot-mkrelpath:: Make system path relative to its root +* Invoking VasEBoot-mkrescue:: Make a VasEBoot rescue image +* Invoking VasEBoot-mount:: Mount a file system using VasEBoot +* Invoking VasEBoot-probe:: Probe device information for VasEBoot +* Invoking VasEBoot-script-check:: Check VasEBoot script file for syntax errors +* Obtaining and Building VasEBoot:: How to obtain and build VasEBoot * Reporting bugs:: Where you should send a bug report -* Future:: Some future plans on GRUB +* Future:: Some future plans on VasEBoot * Copying This Manual:: Copying This Manual * Index:: @end menu @node Introduction -@chapter Introduction to GRUB +@chapter Introduction to VasEBoot @menu -* Overview:: What exactly GRUB is and how to use it +* Overview:: What exactly VasEBoot is and how to use it * History:: From maggot to house fly -* Changes from GRUB Legacy:: Differences from previous versions -* Features:: GRUB features +* Changes from VasEBoot Legacy:: Differences from previous versions +* Features:: VasEBoot features * Role of a boot loader:: The role of a boot loader @end menu @@ -141,23 +141,23 @@ control to an operating system @dfn{kernel} software (such as Linux or GNU Mach). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system). -GNU GRUB is a very powerful boot loader, which can load a wide variety +GNU VasEBoot is a very powerful boot loader, which can load a wide variety of free operating systems, as well as proprietary operating systems with chain-loading@footnote{@dfn{chain-load} is the mechanism for loading unsupported operating systems by loading another boot loader. It is -typically used for loading DOS or Windows.}. GRUB is designed to +typically used for loading DOS or Windows.}. VasEBoot is designed to address the complexity of booting a personal computer; both the program and this manual are tightly bound to that computer platform, although porting to other platforms may be addressed in the future. -One of the important features in GRUB is flexibility; GRUB understands +One of the important features in VasEBoot is flexibility; VasEBoot understands filesystems and kernel executable formats, so you can load an arbitrary operating system the way you like, without recording the physical position of your kernel on the disk. Thus you can load the kernel just by specifying its file name and the drive and partition where the kernel resides. -When booting with GRUB, you can use either a command-line interface +When booting with VasEBoot, you can use either a command-line interface (@pxref{Command-line interface}), or a menu interface (@pxref{Menu interface}). Using the command-line interface, you type the drive specification and file name of the kernel manually. In the menu @@ -168,15 +168,15 @@ command-line mode, and vice-versa. You can even edit menu entries before using them. In the following chapters, you will learn how to specify a drive, a -partition, and a file name (@pxref{Naming convention}) to GRUB, how to -install GRUB on your drive (@pxref{Installation}), and how to boot your +partition, and a file name (@pxref{Naming convention}) to VasEBoot, how to +install VasEBoot on your drive (@pxref{Installation}), and how to boot your OSes (@pxref{Booting}), step by step. @node History -@section History of GRUB +@section History of VasEBoot -GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU +VasEBoot originated in 1995 when Erich Boleyn was trying to boot the GNU Hurd with the University of Utah's Mach 4 microkernel (now known as GNU Mach). Erich and Brian Ford designed the Multiboot Specification (@pxref{Top, Multiboot Specification, Motivation, multiboot, The Multiboot @@ -186,55 +186,55 @@ number of mutually-incompatible PC boot methods. Erich then began modifying the FreeBSD boot loader so that it would understand Multiboot. He soon realized that it would be a lot easier to write his own boot loader from scratch than to keep working on the -FreeBSD boot loader, and so GRUB was born. +FreeBSD boot loader, and so VasEBoot was born. -Erich added many features to GRUB, but other priorities prevented him +Erich added many features to VasEBoot, but other priorities prevented him from keeping up with the demands of its quickly-expanding user base. In -1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an +1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted VasEBoot as an official GNU package, and opened its development by making the latest sources available via anonymous CVS. @xref{Obtaining and Building -GRUB}, for more information. +VasEBoot}, for more information. -Over the next few years, GRUB was extended to meet many needs, but it +Over the next few years, VasEBoot was extended to meet many needs, but it quickly became clear that its design was not keeping up with the extensions being made to it, and we reached the point where it was very difficult to make any further changes without breaking existing features. Around 2002, Yoshinori K. Okuji started work on PUPA (Preliminary Universal Programming -Architecture for GNU GRUB), aiming to rewrite the core of GRUB to make it +Architecture for GNU VasEBoot), aiming to rewrite the core of VasEBoot to make it cleaner, safer, more robust, and more powerful. PUPA was eventually renamed -to GRUB 2, and the original version of GRUB was renamed to GRUB Legacy. -Small amounts of maintenance continued to be done on GRUB Legacy, but the +to VasEBoot 2, and the original version of VasEBoot was renamed to VasEBoot Legacy. +Small amounts of maintenance continued to be done on VasEBoot Legacy, but the last release (0.97) was made in 2005 and at the time of writing it seems unlikely that there will be another. -By around 2007, GNU/Linux distributions started to use GRUB 2 to limited +By around 2007, GNU/Linux distributions started to use VasEBoot 2 to limited extents, and by the end of 2009 multiple major distributions were installing it by default. -@node Changes from GRUB Legacy +@node Changes from VasEBoot Legacy @section Differences from previous versions -GRUB 2 is a rewrite of GRUB (@pxref{History}), although it shares many -characteristics with the previous version, now known as GRUB Legacy. Users -of GRUB Legacy may need some guidance to find their way around this new +VasEBoot 2 is a rewrite of VasEBoot (@pxref{History}), although it shares many +characteristics with the previous version, now known as VasEBoot Legacy. Users +of VasEBoot Legacy may need some guidance to find their way around this new version. @itemize @bullet @item -The configuration file has a new name (@file{grub.cfg} rather than -@file{menu.lst} or @file{grub.conf}), new syntax (@pxref{Configuration}) and +The configuration file has a new name (@file{VasEBoot.cfg} rather than +@file{menu.lst} or @file{VasEBoot.conf}), new syntax (@pxref{Configuration}) and many new commands (@pxref{Commands}). Configuration cannot be copied over -directly, although most GRUB Legacy users should not find the syntax too +directly, although most VasEBoot Legacy users should not find the syntax too surprising. @item -@file{grub.cfg} is typically automatically generated by -@command{grub-mkconfig} (@pxref{Simple configuration}). This makes it +@file{VasEBoot.cfg} is typically automatically generated by +@command{VasEBoot-mkconfig} (@pxref{Simple configuration}). This makes it easier to handle versioned kernel upgrades. @item -Partition numbers in GRUB device names now start at 1, not 0 (@pxref{Naming +Partition numbers in VasEBoot device names now start at 1, not 0 (@pxref{Naming convention}). @item @@ -243,18 +243,18 @@ scripting language: variables, conditionals, and loops are available. @item A small amount of persistent storage is available across reboots, using the -@command{save_env} and @command{load_env} commands in GRUB and the -@command{grub-editenv} utility. This is not available in all configurations +@command{save_env} and @command{load_env} commands in VasEBoot and the +@command{VasEBoot-editenv} utility. This is not available in all configurations (@pxref{Environment block}). @item -GRUB 2 has more reliable ways to find its own files and those of target +VasEBoot 2 has more reliable ways to find its own files and those of target kernels on multiple-disk systems, and has commands (@pxref{search}) to find devices using file system labels or Universally Unique Identifiers (UUIDs). @item -GRUB 2 is available for several other types of system in addition to the PC -BIOS systems supported by GRUB Legacy: PC EFI, PC coreboot, PowerPC, SPARC, +VasEBoot 2 is available for several other types of system in addition to the PC +BIOS systems supported by VasEBoot Legacy: PC EFI, PC coreboot, PowerPC, SPARC, and MIPS Lemote Yeeloong are all supported. @item @@ -262,29 +262,29 @@ Many more file systems are supported, including but not limited to ext4, HFS+, and NTFS. @item -GRUB 2 can read files directly from LVM and RAID devices. +VasEBoot 2 can read files directly from LVM and RAID devices. @item A graphical terminal and a graphical menu system are available. @item -GRUB 2's interface can be translated, including menu entry names. +VasEBoot 2's interface can be translated, including menu entry names. @item -The image files (@pxref{Images}) that make up GRUB have been reorganised; +The image files (@pxref{Images}) that make up VasEBoot have been reorganised; Stage 1, Stage 1.5, and Stage 2 are no more. @item -GRUB 2 puts many facilities in dynamically loaded modules, allowing the core +VasEBoot 2 puts many facilities in dynamically loaded modules, allowing the core image to be smaller, and allowing the core image to be built in more flexible ways. @end itemize @node Features -@section GRUB features +@section VasEBoot features -The primary requirement for GRUB is that it be compliant with the +The primary requirement for VasEBoot is that it be compliant with the @dfn{Multiboot Specification}, which is described in @ref{Top, Multiboot Specification, Motivation, multiboot, The Multiboot Specification}. @@ -310,9 +310,9 @@ or above are presently supported. Any attempt to load below that boundary will simply result in immediate failure and an error message reporting the problem. -In addition to the requirements above, GRUB has the following features +In addition to the requirements above, VasEBoot has the following features (note that the Multiboot Specification doesn't require all the features -that GRUB supports): +that VasEBoot supports): @table @asis @item Recognize multiple executable formats @@ -332,7 +332,7 @@ Fully support the Multiboot feature of loading multiple modules. @item Load a configuration file Support a human-readable text configuration file with preset boot commands. You can also load another configuration file dynamically and -embed a preset configuration file in a GRUB image file. The list of +embed a preset configuration file in a VasEBoot image file. The list of commands (@pxref{Commands}) are a superset of those supported on the command-line. An example configuration file is provided in @ref{Configuration}. @@ -345,7 +345,7 @@ entries, and the current implementation has space for several hundred. @item Have a flexible command-line interface A fairly flexible command-line interface, accessible from the menu, is available to edit any preset commands, or write a new boot command -set from scratch. If no configuration file is present, GRUB drops to +set from scratch. If no configuration file is present, VasEBoot drops to the command-line. The list of commands (@pxref{Commands}) are a subset of those supported @@ -389,37 +389,37 @@ Support reading data from any or all floppies or hard disk(s) recognized by the BIOS, independent of the setting of the root device. @item Be independent of drive geometry translations -Unlike many other boot loaders, GRUB makes the particular drive +Unlike many other boot loaders, VasEBoot makes the particular drive translation irrelevant. A drive installed and running with one translation may be converted to another translation without any adverse -effects or changes in GRUB's configuration. +effects or changes in VasEBoot's configuration. @item Detect all installed @sc{ram} -GRUB can generally find all the installed @sc{ram} on a PC-compatible +VasEBoot can generally find all the installed @sc{ram} on a PC-compatible machine. It uses an advanced BIOS query technique for finding all memory regions. As described on the Multiboot Specification (@pxref{Top, Multiboot Specification, Motivation, multiboot, The Multiboot -Specification}), not all kernels make use of this information, but GRUB +Specification}), not all kernels make use of this information, but VasEBoot provides it for those who do. @item Support Logical Block Address mode In traditional disk calls (called @dfn{CHS mode}), there is a geometry translation problem, that is, the BIOS cannot access over 1024 cylinders, so the accessible space is limited to at least 508 MB and to -at most 8GB. GRUB can't universally solve this problem, as there is no +at most 8GB. VasEBoot can't universally solve this problem, as there is no standard interface used in all machines. However, several newer machines -have the new interface, Logical Block Address (@dfn{LBA}) mode. GRUB +have the new interface, Logical Block Address (@dfn{LBA}) mode. VasEBoot automatically detects if LBA mode is available and uses it if -available. In LBA mode, GRUB can access the entire disk. +available. In LBA mode, VasEBoot can access the entire disk. @item Support network booting -GRUB is basically a disk-based boot loader but also has network +VasEBoot is basically a disk-based boot loader but also has network support. You can load OS images from a network by using the @dfn{TFTP} protocol. @item Support remote terminals -To support computers with no console, GRUB provides remote terminal -support, so that you can control GRUB from a remote host. Only serial +To support computers with no console, VasEBoot provides remote terminal +support, so that you can control VasEBoot from a remote host. Only serial terminal support is implemented at the moment. @end table @@ -427,7 +427,7 @@ terminal support is implemented at the moment. @node Role of a boot loader @section The role of a boot loader -The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: +The following is a quotation from Gordon Matzigkeit, a VasEBoot fanatic: @quotation Some people like to acknowledge both the operating system and kernel when @@ -439,27 +439,27 @@ their GNU operating systems ``Linux systems.'' I, personally, believe that this is a grave injustice, because the @emph{boot loader} is the most important software of all. I used to refer to the above systems as either ``LILO''@footnote{The LInux LOader, -a boot loader that everybody uses, but nobody likes.} or ``GRUB'' +a boot loader that everybody uses, but nobody likes.} or ``VasEBoot'' systems. Unfortunately, nobody ever understood what I was talking about; now I -just use the word ``GNU'' as a pseudonym for GRUB. +just use the word ``GNU'' as a pseudonym for VasEBoot. So, if you ever hear people talking about their alleged ``GNU'' systems, remember that they are actually paying homage to the best boot loader -around@dots{} GRUB! +around@dots{} VasEBoot! @end quotation -We, the GRUB maintainers, do not (usually) encourage Gordon's level of +We, the VasEBoot maintainers, do not (usually) encourage Gordon's level of fanaticism, but it helps to remember that boot loaders deserve -recognition. We hope that you enjoy using GNU GRUB as much as we did +recognition. We hope that you enjoy using GNU VasEBoot as much as we did writing it. @node Naming convention @chapter Naming convention -The device syntax used in GRUB is a wee bit different from what you may +The device syntax used in VasEBoot is a wee bit different from what you may have seen before in your operating system(s), and you need to know it so that you can specify a drive/partition. @@ -469,10 +469,10 @@ Look at the following examples and explanations: (fd0) @end example -First of all, GRUB requires that the device name be enclosed with +First of all, VasEBoot requires that the device name be enclosed with @samp{(} and @samp{)}. The @samp{fd} part means that it is a floppy disk. The number @samp{0} is the drive number, which is counted from -@emph{zero}. This expression means that GRUB will use the whole floppy +@emph{zero}. This expression means that VasEBoot will use the whole floppy disk. @example @@ -485,8 +485,8 @@ the string @samp{msdos} indicates the partition scheme, while the second integer, @samp{2}, indicates the partition number (or the @sc{pc} slice number in the BSD terminology). The partition numbers are counted from @emph{one}, not from zero (as was the case in previous -versions of GRUB). This expression means the second partition of the -first hard disk drive. In this case, GRUB uses one partition of the +versions of VasEBoot). This expression means the second partition of the +first hard disk drive. In this case, VasEBoot uses one partition of the disk, instead of the whole disk. @example @@ -505,10 +505,10 @@ partitions on your hard disk. This means the BSD @samp{a} partition on first @sc{pc} slice number of the second hard disk. -Of course, to actually access the disks or partitions with GRUB, you +Of course, to actually access the disks or partitions with VasEBoot, you need to use the device specification in a command, like @samp{set root=(fd0)} or @samp{parttool (hd0,msdos3) hidden-}. To help you find out -which number specifies a partition you want, the GRUB command-line +which number specifies a partition you want, the VasEBoot command-line (@pxref{Command-line interface}) options have argument completion. This means that, for example, you only need to type @@ -516,12 +516,12 @@ completion. This means that, for example, you only need to type set root=( @end example -followed by a @key{TAB}, and GRUB will display the list of drives, +followed by a @key{TAB}, and VasEBoot will display the list of drives, partitions, or file names. So it should be quite easy to determine the name of your target partition, even with minimal knowledge of the syntax. -Note that GRUB does @emph{not} distinguish IDE from SCSI - it simply +Note that VasEBoot does @emph{not} distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI @@ -539,16 +539,16 @@ partition of the first hard disk drive. Note that the argument completion works with file names, too. That was easy, admit it. Now read the next chapter, to find out how to -actually install GRUB on your drive. +actually install VasEBoot on your drive. -@node OS-specific notes about grub tools -@chapter OS-specific notes about grub tools +@node OS-specific notes about VasEBoot tools +@chapter OS-specific notes about VasEBoot tools -On OS which have device nodes similar to Unix-like OS GRUB tools use the +On OS which have device nodes similar to Unix-like OS VasEBoot tools use the OS name. E.g. for GNU/Linux: @example -# @kbd{grub-install /dev/sda} +# @kbd{VasEBoot-install /dev/sda} @end example On AROS we use another syntax. For volumes: @@ -571,7 +571,7 @@ For disks we use syntax: E.g. @example -# @kbd{grub-install //:ata.device/0/0} +# @kbd{VasEBoot-install //:ata.device/0/0} @end example On Windows we use UNC path. For volumes it's typically @@ -598,7 +598,7 @@ For disks it's E.g. @example -# @kbd{grub-install \\?\PhysicalDrive0} +# @kbd{VasEBoot-install \\?\PhysicalDrive0} @end example Beware that you may need to further escape the backslashes depending on your @@ -608,67 +608,67 @@ When compiled with cygwin support then cygwin drive names are automatically when needed. E.g. @example -# @kbd{grub-install /dev/sda} +# @kbd{VasEBoot-install /dev/sda} @end example @node Installation @chapter Installation -In order to install GRUB as your boot loader, you need to first -install the GRUB system and utilities under your UNIX-like operating -system (@pxref{Obtaining and Building GRUB}). You can do this either +In order to install VasEBoot as your boot loader, you need to first +install the VasEBoot system and utilities under your UNIX-like operating +system (@pxref{Obtaining and Building VasEBoot}). You can do this either from the source tarball, or as a package for your OS. After you have done that, you need to install the boot loader on a drive (floppy or hard disk) by using the utility -@command{grub-install} (@pxref{Invoking grub-install}) on a UNIX-like OS. +@command{VasEBoot-install} (@pxref{Invoking VasEBoot-install}) on a UNIX-like OS. -GRUB comes with boot images, which are normally put in the directory -@file{/usr/lib/grub/-} (for BIOS-based machines -@file{/usr/lib/grub/i386-pc}). Hereafter, the directory where GRUB images are -initially placed (normally @file{/usr/lib/grub/-}) will be +VasEBoot comes with boot images, which are normally put in the directory +@file{/usr/lib/VasEBoot/-} (for BIOS-based machines +@file{/usr/lib/VasEBoot/i386-pc}). Hereafter, the directory where VasEBoot images are +initially placed (normally @file{/usr/lib/VasEBoot/-}) will be called the @dfn{image directory}, and the directory where the boot loader needs to find them (usually @file{/boot}) will be called the @dfn{boot directory}. @menu -* Installing GRUB using grub-install:: -* Making a GRUB bootable CD-ROM:: +* Installing VasEBoot using VasEBoot-install:: +* Making a VasEBoot bootable CD-ROM:: * Device map:: * BIOS installation:: @end menu -@node Installing GRUB using grub-install -@section Installing GRUB using grub-install +@node Installing VasEBoot using VasEBoot-install +@section Installing VasEBoot using VasEBoot-install -For information on where GRUB should be installed on PC BIOS platforms, +For information on where VasEBoot should be installed on PC BIOS platforms, @pxref{BIOS installation}. -In order to install GRUB under a UNIX-like OS (such -as @sc{gnu}), invoke the program @command{grub-install} (@pxref{Invoking -grub-install}) as the superuser (@dfn{root}). +In order to install VasEBoot under a UNIX-like OS (such +as @sc{gnu}), invoke the program @command{VasEBoot-install} (@pxref{Invoking +VasEBoot-install}) as the superuser (@dfn{root}). The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument has to be either a device file (like @samp{/dev/hda}). -For example, under Linux the following will install GRUB into the MBR +For example, under Linux the following will install VasEBoot into the MBR of the first IDE disk: @example -# @kbd{grub-install /dev/sda} +# @kbd{VasEBoot-install /dev/sda} @end example Likewise, under GNU/Hurd, this has the same effect: @example -# @kbd{grub-install /dev/hd0} +# @kbd{VasEBoot-install /dev/hd0} @end example -But all the above examples assume that GRUB should put images under -the @file{/boot} directory. If you want GRUB to put images under a directory +But all the above examples assume that VasEBoot should put images under +the @file{/boot} directory. If you want VasEBoot to put images under a directory other than @file{/boot}, you need to specify the option -@option{--boot-directory}. The typical usage is that you create a GRUB +@option{--boot-directory}. The typical usage is that you create a VasEBoot boot floppy with a filesystem. Here is an example: @example @@ -676,7 +676,7 @@ boot floppy with a filesystem. Here is an example: # @kbd{mke2fs /dev/fd0} # @kbd{mount -t ext2 /dev/fd0 /mnt} # @kbd{mkdir /mnt/boot} -# @kbd{grub-install --boot-directory=/mnt/boot /dev/fd0} +# @kbd{VasEBoot-install --boot-directory=/mnt/boot /dev/fd0} # @kbd{umount /mnt} @end group @end example @@ -688,60 +688,60 @@ floppy instead of exposing the USB drive as a hard disk (they call it @example # @kbd{losetup /dev/loop0 /dev/sdb1} # @kbd{mount /dev/loop0 /mnt/usb} -# @kbd{grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0} +# @kbd{VasEBoot-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0} @end example This install doesn't conflict with standard install as long as they are in separate directories. -Note that @command{grub-install} is actually just a shell script and the -real task is done by other tools such as @command{grub-mkimage}. Therefore, -you may run those commands directly to install GRUB, without using -@command{grub-install}. Don't do that, however, unless you are very familiar -with the internals of GRUB. Installing a boot loader on a running OS may be +Note that @command{VasEBoot-install} is actually just a shell script and the +real task is done by other tools such as @command{VasEBoot-mkimage}. Therefore, +you may run those commands directly to install VasEBoot, without using +@command{VasEBoot-install}. Don't do that, however, unless you are very familiar +with the internals of VasEBoot. Installing a boot loader on a running OS may be extremely dangerous. On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at @file{/boot/efi} then you don't need any special arguments: @example -# @kbd{grub-install} +# @kbd{VasEBoot-install} @end example Otherwise you need to specify where your EFI System partition is mounted: @example -# @kbd{grub-install --efi-directory=/mnt/efi} +# @kbd{VasEBoot-install --efi-directory=/mnt/efi} @end example For removable installs you have to use @option{--removable} and specify both @option{--boot-directory} and @option{--efi-directory}: @example -# @kbd{grub-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable} +# @kbd{VasEBoot-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable} @end example -@node Making a GRUB bootable CD-ROM -@section Making a GRUB bootable CD-ROM +@node Making a VasEBoot bootable CD-ROM +@section Making a VasEBoot bootable CD-ROM -GRUB supports the @dfn{no emulation mode} in the El Torito +VasEBoot supports the @dfn{no emulation mode} in the El Torito specification@footnote{El Torito is a specification for bootable CD using BIOS functions.}. This means that you can use the whole CD-ROM -from GRUB and you don't have to make a floppy or hard disk image file, +from VasEBoot and you don't have to make a floppy or hard disk image file, which can cause compatibility problems. -For booting from a CD-ROM, GRUB uses a special image called +For booting from a CD-ROM, VasEBoot uses a special image called @file{cdboot.img}, which is concatenated with @file{core.img}. The @file{core.img} used for this should be built with at least the @samp{iso9660} and @samp{biosdisk} modules. Your bootable CD-ROM will -usually also need to include a configuration file @file{grub.cfg} and some -other GRUB modules. +usually also need to include a configuration file @file{VasEBoot.cfg} and some +other VasEBoot modules. -To make a simple generic GRUB rescue CD, you can use the -@command{grub-mkrescue} program (@pxref{Invoking grub-mkrescue}): +To make a simple generic VasEBoot rescue CD, you can use the +@command{VasEBoot-mkrescue} program (@pxref{Invoking VasEBoot-mkrescue}): @example -$ @kbd{grub-mkrescue -o grub.iso} +$ @kbd{VasEBoot-mkrescue -o VasEBoot.iso} @end example You will often need to include other files in your image. To do this, first @@ -751,27 +751,27 @@ make a top directory for the bootable image, say, @samp{iso}: $ @kbd{mkdir iso} @end example -Make a directory for GRUB: +Make a directory for VasEBoot: @example -$ @kbd{mkdir -p iso/boot/grub} +$ @kbd{mkdir -p iso/boot/VasEBoot} @end example -If desired, make the config file @file{grub.cfg} under @file{iso/boot/grub} +If desired, make the config file @file{VasEBoot.cfg} under @file{iso/boot/VasEBoot} (@pxref{Configuration}), and copy any files and directories for the disc to the directory @file{iso/}. Finally, make the image: @example -$ @kbd{grub-mkrescue -o grub.iso iso} +$ @kbd{VasEBoot-mkrescue -o VasEBoot.iso iso} @end example -This produces a file named @file{grub.iso}, which then can be burned +This produces a file named @file{VasEBoot.iso}, which then can be burned into a CD (or a DVD), or written to a USB mass storage device. The root device will be set up appropriately on entering your -@file{grub.cfg} configuration file, so you can refer to file names on the CD +@file{VasEBoot.cfg} configuration file, so you can refer to file names on the CD without needing to use an explicit device name. This makes it easier to produce rescue images that will work on both optical drives and USB mass storage devices. @@ -780,7 +780,7 @@ storage devices. @node Device map @section The map between BIOS drives and OS devices -If the device map file exists, the GRUB utilities (@command{grub-probe}, +If the device map file exists, the VasEBoot utilities (@command{VasEBoot-probe}, etc.) read it to map BIOS drives to OS devices. This file consists of lines like this: @@ -788,13 +788,13 @@ like this: (@var{device}) @var{file} @end example -@var{device} is a drive specified in the GRUB syntax (@pxref{Device +@var{device} is a drive specified in the VasEBoot syntax (@pxref{Device syntax}), and @var{file} is an OS file, which is normally a device file. -Historically, the device map file was used because GRUB device names had to +Historically, the device map file was used because VasEBoot device names had to be used in the configuration file, and they were derived from BIOS drive numbers. The map between BIOS drives and OS devices cannot always be -guessed correctly: for example, GRUB will get the order wrong if you +guessed correctly: for example, VasEBoot will get the order wrong if you exchange the boot sequence between IDE and SCSI in your BIOS. Unfortunately, even OS device names are not always stable. Modern versions @@ -803,17 +803,17 @@ and the prefix (@file{/dev/hd*} versus @file{/dev/sd*}) may change depending on the driver subsystem in use. As a result, the device map file required frequent editing on some systems. -GRUB avoids this problem nowadays by using UUIDs or file system labels when -generating @file{grub.cfg}, and we advise that you do the same for any +VasEBoot avoids this problem nowadays by using UUIDs or file system labels when +generating @file{VasEBoot.cfg}, and we advise that you do the same for any custom menu entries you write. If the device map file does not exist, then -the GRUB utilities will assume a temporary device map on the fly. This is +the VasEBoot utilities will assume a temporary device map on the fly. This is often good enough, particularly in the common case of single-disk systems. However, the device map file is not entirely obsolete yet, and it is used for overriding when current environment is different from the one on boot. Most common case is if you use a partition or logical volume as a disk for virtual machine. You can put any comments in the file if needed, -as the GRUB utilities assume that a line is just a comment if +as the VasEBoot utilities assume that a line is just a comment if the first character is @samp{#}. @@ -825,7 +825,7 @@ the first character is @samp{#}. The partition table format traditionally used on PC BIOS platforms is called the Master Boot Record (MBR) format; this is the format that allows up to four primary partitions and additional logical partitions. With this -partition table format, there are two ways to install GRUB: it can be +partition table format, there are two ways to install VasEBoot: it can be embedded in the area between the MBR and the first partition (called by various names, such as the "boot track", "MBR gap", or "embedding area", and which is usually at least 31 KiB), or the core image can be installed in a @@ -837,14 +837,14 @@ the embedding area with complete safety, and some proprietary software is known to use it to make it difficult for users to work around licensing restrictions; and systems are sometimes partitioned without leaving enough space before the first partition. On the other hand, installing to a -filesystem means that GRUB is vulnerable to its blocks being moved around by +filesystem means that VasEBoot is vulnerable to its blocks being moved around by filesystem features such as tail packing, or even by aggressive fsck implementations, so this approach is quite fragile; and this approach can only be used if the @file{/boot} filesystem is on the same disk that the -BIOS boots from, so that GRUB does not have to rely on guessing BIOS drive +BIOS boots from, so that VasEBoot does not have to rely on guessing BIOS drive numbers. -The GRUB development team generally recommends embedding GRUB before the +The VasEBoot development team generally recommends embedding VasEBoot before the first partition, unless you have special requirements. You must ensure that the first partition starts at least 31 KiB (63 sectors) from the start of the disk; on modern disks, it is often a performance advantage to align @@ -856,9 +856,9 @@ MiB from the start of the disk. Some newer systems use the GUID Partition Table (GPT) format. This was specified as part of the Extensible Firmware Interface (EFI), but it can also be used on BIOS platforms if system software supports it; for example, -GRUB and GNU/Linux can be used in this configuration. With this format, it -is possible to reserve a whole partition for GRUB, called the BIOS Boot -Partition. GRUB can then be embedded into that partition without the risk +VasEBoot and GNU/Linux can be used in this configuration. With this format, it +is possible to reserve a whole partition for VasEBoot, called the BIOS Boot +Partition. VasEBoot can then be embedded into that partition without the risk of being overwritten by other software and without being contained in a filesystem which might move its blocks around. @@ -870,14 +870,14 @@ make sure that it has the proper partition type. Using GNU Parted, you can set this using a command such as the following: @example -# @kbd{parted /dev/@var{disk} set @var{partition-number} bios_grub on} +# @kbd{parted /dev/@var{disk} set @var{partition-number} bios_VasEBoot on} @end example If you are using gdisk, set the partition type to @samp{0xEF02}. With partitioning programs that require setting the GUID directly, it should be @samp{21686148-6449-6e6f-744e656564454649}. -@strong{Caution:} Be very careful which partition you select! When GRUB +@strong{Caution:} Be very careful which partition you select! When VasEBoot finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data. @@ -886,12 +886,12 @@ other data. @node Booting @chapter Booting -GRUB can load Multiboot-compliant kernels in a consistent way, +VasEBoot can load Multiboot-compliant kernels in a consistent way, but for some free operating systems you need to use some OS-specific magic. @menu -* General boot methods:: How to boot OSes with GRUB generally +* General boot methods:: How to boot OSes with VasEBoot generally * Loopback booting:: Notes on booting from loopbacks * OS-specific notes:: Notes on some operating systems @end menu @@ -900,13 +900,13 @@ magic. @node General boot methods @section How to boot operating systems -GRUB has two distinct boot methods. One of the two is to load an +VasEBoot has two distinct boot methods. One of the two is to load an operating system directly, and the other is to chain-load another boot loader which then will load an operating system actually. Generally speaking, the former is more desirable, because you don't need to -install or maintain other boot loaders and GRUB is flexible enough to +install or maintain other boot loaders and VasEBoot is flexible enough to load an operating system from an arbitrary disk/partition. However, -the latter is sometimes required, since GRUB doesn't support all the +the latter is sometimes required, since VasEBoot doesn't support all the existing operating systems natively. @menu @@ -916,10 +916,10 @@ existing operating systems natively. @node Loading an operating system directly -@subsection How to boot an OS directly with GRUB +@subsection How to boot an OS directly with VasEBoot Multiboot (@pxref{Top, Multiboot Specification, Motivation, multiboot, -The Multiboot Specification}) is the native format supported by GRUB. +The Multiboot Specification}) is the native format supported by VasEBoot. For the sake of convenience, there is also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating systems, you will have to chain-load them (@pxref{Chain-loading}). @@ -940,12 +940,12 @@ information. @subsection Chain-loading an OS Operating systems that do not support Multiboot and do not have specific -support in GRUB (specific support is available for Linux, FreeBSD, NetBSD +support in VasEBoot (specific support is available for Linux, FreeBSD, NetBSD and OpenBSD) must be chain-loaded, which involves loading another boot loader and jumping to it in real mode. The @command{chainloader} command (@pxref{chainloader}) is used to set this -up. It is normally also necessary to load some GRUB modules and set the +up. It is normally also necessary to load some VasEBoot modules and set the appropriate root device. Putting this together, we get something like this, for a Windows system on the first partition of the first hard disk: @@ -966,11 +966,11 @@ Chain-loading is only supported on PC BIOS and EFI platforms. @node Loopback booting @section Loopback booting -GRUB is able to read from an image (be it one of CD or HDD) stored on +VasEBoot is able to read from an image (be it one of CD or HDD) stored on any of its accessible storages (refer to @pxref{loopback} command). However the OS itself should be able to find its root. This usually involves running a userspace program running before the real root -is discovered. This is achieved by GRUB loading a specially made +is discovered. This is achieved by VasEBoot loading a specially made small image and passing it as ramdisk to the kernel. This is achieved by commands @command{kfreebsd_module}, @command{knetbsd_module_elf}, @command{kopenbsd_ramdisk}, @command{initrd} (@pxref{initrd}), @@ -1012,7 +1012,7 @@ root partition to the kernel. @enumerate @item -Set GRUB's root device to the same drive as GNU/Hurd's. The command +Set VasEBoot's root device to the same drive as GNU/Hurd's. The command @code{search --set=root --file /boot/gnumach.gz} or similar may help you (@pxref{search}). @@ -1021,14 +1021,14 @@ Load the kernel and the modules, like this: @example @group -grub> @kbd{multiboot /boot/gnumach.gz root=device:hd0s1} -grub> @kbd{module /hurd/ext2fs.static ext2fs --readonly \ +VasEBoot> @kbd{multiboot /boot/gnumach.gz root=device:hd0s1} +VasEBoot> @kbd{module /hurd/ext2fs.static ext2fs --readonly \ --multiboot-command-line='$@{kernel-command-line@}' \ --host-priv-port='$@{host-port@}' \ --device-master-port='$@{device-port@}' \ --exec-server-task='$@{exec-task@}' -T typed '$@{root@}' \ '$(task-create)' '$(task-resume)'} -grub> @kbd{module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'} +VasEBoot> @kbd{module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'} @end group @end example @@ -1040,12 +1040,12 @@ Finally, run the command @command{boot} (@pxref{boot}). @node GNU/Linux @subsection GNU/Linux -It is relatively easy to boot GNU/Linux from GRUB, because it somewhat +It is relatively easy to boot GNU/Linux from VasEBoot, because it somewhat resembles to boot a Multiboot-compliant OS. @enumerate @item -Set GRUB's root device to the same drive as GNU/Linux's. The command +Set VasEBoot's root device to the same drive as GNU/Linux's. The command @code{search --set=root --file /vmlinuz} or similar may help you (@pxref{search}). @@ -1053,25 +1053,25 @@ Set GRUB's root device to the same drive as GNU/Linux's. The command Load the kernel using the command @command{linux} (@pxref{linux}): @example -grub> @kbd{linux /vmlinuz root=/dev/sda1} +VasEBoot> @kbd{linux /vmlinuz root=/dev/sda1} @end example If you need to specify some kernel parameters, just append them to the command. For example, to set @option{acpi} to @samp{off}, do this: @example -grub> @kbd{linux /vmlinuz root=/dev/sda1 acpi=off} +VasEBoot> @kbd{linux /vmlinuz root=/dev/sda1 acpi=off} @end example See the documentation in the Linux source tree for complete information on the available options. -With @command{linux} GRUB uses 32-bit protocol. Some BIOS services like APM +With @command{linux} VasEBoot uses 32-bit protocol. Some BIOS services like APM or EDD aren't available with this protocol. In this case you need to use @command{linux16} @example -grub> @kbd{linux16 /vmlinuz root=/dev/sda1 acpi=off} +VasEBoot> @kbd{linux16 /vmlinuz root=/dev/sda1 acpi=off} @end example @item @@ -1079,13 +1079,13 @@ If you use an initrd, execute the command @command{initrd} (@pxref{initrd}) after @command{linux}: @example -grub> @kbd{initrd /initrd} +VasEBoot> @kbd{initrd /initrd} @end example If you used @command{linux16} you need to use @command{initrd16}: @example -grub> @kbd{initrd16 /initrd} +VasEBoot> @kbd{initrd16 /initrd} @end example @item @@ -1094,7 +1094,7 @@ Finally, run the command @command{boot} (@pxref{boot}). @strong{Caution:} If you use an initrd and specify the @samp{mem=} option to the kernel to let it use less than actual memory size, you -will also have to specify the same memory size to GRUB. To let GRUB know +will also have to specify the same memory size to VasEBoot. To let VasEBoot know the size, run the command @command{uppermem} @emph{before} loading the kernel. @xref{uppermem}, for more information. @@ -1102,35 +1102,35 @@ kernel. @xref{uppermem}, for more information. @node NetBSD @subsection NetBSD -Booting a NetBSD kernel from GRUB is also relatively easy: first set -GRUB's root device, then load the kernel and the modules, and finally +Booting a NetBSD kernel from VasEBoot is also relatively easy: first set +VasEBoot's root device, then load the kernel and the modules, and finally run @command{boot}. @enumerate @item -Set GRUB's root device to the partition holding the NetBSD root file +Set VasEBoot's root device to the partition holding the NetBSD root file system. For a disk with a NetBSD disk label, this is usually the first partition (a:). In that case, and assuming that the partition is on the -first hard disk, set GRUB's root device as follows: +first hard disk, set VasEBoot's root device as follows: @example -grub> @kbd{insmod part_bsd} -grub> @kbd{set root=(hd0,netbsd1)} +VasEBoot> @kbd{insmod part_bsd} +VasEBoot> @kbd{set root=(hd0,netbsd1)} @end example For a disk with a GUID Partition Table (GPT), and assuming that the NetBSD root partition is the third GPT partition, do this: @example -grub> @kbd{insmod part_gpt} -grub> @kbd{set root=(hd0,gpt3)} +VasEBoot> @kbd{insmod part_gpt} +VasEBoot> @kbd{set root=(hd0,gpt3)} @end example @item Load the kernel using the command @command{knetbsd}: @example -grub> @kbd{knetbsd /netbsd} +VasEBoot> @kbd{knetbsd /netbsd} @end example Various options may be given to @command{knetbsd}. These options are, @@ -1139,7 +1139,7 @@ to boot the system in single-user mode and with verbose messages, do this: @example -grub> @kbd{knetbsd /netbsd -s -v} +VasEBoot> @kbd{knetbsd /netbsd -s -v} @end example @item @@ -1148,7 +1148,7 @@ If needed, load kernel modules with the command root file system: @example -grub> @kbd{knetbsd_module_elf /stand/amd64/6.0/modules/ffs/ffs.kmod} +VasEBoot> @kbd{knetbsd_module_elf /stand/amd64/6.0/modules/ffs/ffs.kmod} @end example @item @@ -1159,14 +1159,14 @@ Finally, run the command @command{boot} (@pxref{boot}). @node DOS/Windows @subsection DOS/Windows -GRUB cannot boot DOS or Windows directly, so you must chain-load them +VasEBoot cannot boot DOS or Windows directly, so you must chain-load them (@pxref{Chain-loading}). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome -the problems, GRUB provides you with two helper functions. +the problems, VasEBoot provides you with two helper functions. If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot -from any disks but the first one. The workaround used in GRUB is the +from any disks but the first one. The workaround used in VasEBoot is the command @command{drivemap} (@pxref{drivemap}), like this: @example @@ -1186,8 +1186,8 @@ primary partitions for DOS/Windows. Certainly you should avoid doing this, but there is a solution if you do want to do so. Use the partition hiding/unhiding technique. -If GRUB @dfn{hides} a DOS (or Windows) partition (@pxref{parttool}), DOS (or -Windows) will ignore the partition. If GRUB @dfn{unhides} a DOS (or Windows) +If VasEBoot @dfn{hides} a DOS (or Windows) partition (@pxref{parttool}), DOS (or +Windows) will ignore the partition. If VasEBoot @dfn{unhides} a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition, do @@ -1208,50 +1208,50 @@ boot @node Configuration @chapter Writing your own configuration file -GRUB is configured using @file{grub.cfg}, usually located under -@file{/boot/grub}. This file is quite flexible, but most users will not +VasEBoot is configured using @file{VasEBoot.cfg}, usually located under +@file{/boot/VasEBoot}. This file is quite flexible, but most users will not need to write the whole thing by hand. @menu * Simple configuration:: Recommended for most users * Shell-like scripting:: For power users and developers * Multi-boot manual config:: For non-standard multi-OS scenarios -* Embedded configuration:: Embedding a configuration file into GRUB +* Embedded configuration:: Embedding a configuration file into VasEBoot @end menu @node Simple configuration @section Simple configuration handling -The program @command{grub-mkconfig} (@pxref{Invoking grub-mkconfig}) -generates @file{grub.cfg} files suitable for most cases. It is suitable for +The program @command{VasEBoot-mkconfig} (@pxref{Invoking VasEBoot-mkconfig}) +generates @file{VasEBoot.cfg} files suitable for most cases. It is suitable for use when upgrading a distribution, and will discover available kernels and attempt to generate menu entries for them. -@command{grub-mkconfig} does have some limitations. While adding extra +@command{VasEBoot-mkconfig} does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing -@file{/etc/grub.d/40_custom} or creating @file{/boot/grub/custom.cfg}, +@file{/etc/VasEBoot.d/40_custom} or creating @file{/boot/VasEBoot/custom.cfg}, changing the order of menu entries or changing their titles may require -making complex changes to shell scripts stored in @file{/etc/grub.d/}. This +making complex changes to shell scripts stored in @file{/etc/VasEBoot.d/}. This may be improved in the future. In the meantime, those who feel that it -would be easier to write @file{grub.cfg} directly are encouraged to do so +would be easier to write @file{VasEBoot.cfg} directly are encouraged to do so (@pxref{Booting}, and @ref{Shell-like scripting}), and to disable any system -provided by their distribution to automatically run @command{grub-mkconfig}. +provided by their distribution to automatically run @command{VasEBoot-mkconfig}. -The file @file{/etc/default/grub} controls the operation of -@command{grub-mkconfig}. It is sourced by a shell script, and so must be +The file @file{/etc/default/VasEBoot} controls the operation of +@command{VasEBoot-mkconfig}. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of @samp{KEY=value} lines, but if the value contains spaces or other special characters then it must be quoted. For example: @example -GRUB_TERMINAL_INPUT="console serial" +VasEBoot_TERMINAL_INPUT="console serial" @end example -Valid keys in @file{/etc/default/grub} are as follows: +Valid keys in @file{/etc/default/VasEBoot} are as follows: @table @samp -@item GRUB_DEFAULT +@item VasEBoot_DEFAULT The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string @samp{saved}. Using the id may be @@ -1269,7 +1269,7 @@ menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-li then you can make this the default using: @example -GRUB_DEFAULT=example-gnu-linux +VasEBoot_DEFAULT=example-gnu-linux @end example Previously it was documented the way to use entry title. While this still @@ -1277,56 +1277,56 @@ works it's not recommended since titles often contain unstable device names and may be translated If you set this to @samp{saved}, then the default menu entry will be that -saved by @samp{GRUB_SAVEDEFAULT} or @command{grub-set-default}. This relies on +saved by @samp{VasEBoot_SAVEDEFAULT} or @command{VasEBoot-set-default}. This relies on the environment block, which may not be available in all situations (@pxref{Environment block}). The default is @samp{0}. -@item GRUB_SAVEDEFAULT +@item VasEBoot_SAVEDEFAULT If this option is set to @samp{true}, then, when an entry is selected, save -it as a new default entry for use by future runs of GRUB. This is only -useful if @samp{GRUB_DEFAULT=saved}; it is a separate option because -@samp{GRUB_DEFAULT=saved} is useful without this option, in conjunction with -@command{grub-set-default}. Unset by default. +it as a new default entry for use by future runs of VasEBoot. This is only +useful if @samp{VasEBoot_DEFAULT=saved}; it is a separate option because +@samp{VasEBoot_DEFAULT=saved} is useful without this option, in conjunction with +@command{VasEBoot-set-default}. Unset by default. This option relies on the environment block, which may not be available in all situations (@pxref{Environment block}). -@item GRUB_TIMEOUT +@item VasEBoot_TIMEOUT Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is @samp{5}. Set to @samp{0} to boot immediately without displaying the menu, or to @samp{-1} to wait indefinitely. -If @samp{GRUB_TIMEOUT_STYLE} is set to @samp{countdown} or @samp{hidden}, +If @samp{VasEBoot_TIMEOUT_STYLE} is set to @samp{countdown} or @samp{hidden}, the timeout is instead counted before the menu is displayed. -@item GRUB_TIMEOUT_STYLE -If this option is unset or set to @samp{menu}, then GRUB will display the -menu and then wait for the timeout set by @samp{GRUB_TIMEOUT} to expire +@item VasEBoot_TIMEOUT_STYLE +If this option is unset or set to @samp{menu}, then VasEBoot will display the +menu and then wait for the timeout set by @samp{VasEBoot_TIMEOUT} to expire before booting the default entry. Pressing a key interrupts the timeout. If this option is set to @samp{countdown} or @samp{hidden}, then, before -displaying the menu, GRUB will wait for the timeout set by -@samp{GRUB_TIMEOUT} to expire. If @key{ESC} is pressed during that time, it +displaying the menu, VasEBoot will wait for the timeout set by +@samp{VasEBoot_TIMEOUT} to expire. If @key{ESC} is pressed during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the @samp{countdown} case, it will show a one-line indication of the remaining time. -@item GRUB_DEFAULT_BUTTON -@itemx GRUB_TIMEOUT_BUTTON -@itemx GRUB_TIMEOUT_STYLE_BUTTON -@itemx GRUB_BUTTON_CMOS_ADDRESS +@item VasEBoot_DEFAULT_BUTTON +@itemx VasEBoot_TIMEOUT_BUTTON +@itemx VasEBoot_TIMEOUT_STYLE_BUTTON +@itemx VasEBoot_BUTTON_CMOS_ADDRESS Variants of the corresponding variables without the @samp{_BUTTON} suffix, used to support vendor-specific power buttons. @xref{Vendor power-on keys}. -@item GRUB_DISTRIBUTOR -Set by distributors of GRUB to their identifying name. This is used to +@item VasEBoot_DISTRIBUTOR +Set by distributors of VasEBoot to their identifying name. This is used to generate more informative menu entry titles. -@item GRUB_TERMINAL_INPUT +@item VasEBoot_TERMINAL_INPUT Select the terminal input device. You may select multiple devices here, separated by spaces. @@ -1339,7 +1339,7 @@ this). The default is to use the platform's native terminal input. -@item GRUB_TERMINAL_OUTPUT +@item VasEBoot_TERMINAL_OUTPUT Select the terminal output device. You may select multiple devices here, separated by spaces. @@ -1351,7 +1351,7 @@ Valid terminal output names depend on the platform, but may include beeper) or @samp{spkmodem} (simple data protocol using system speaker). @samp{spkmodem} is useful when no serial port is available. Connect the output -of sending system (where GRUB is running) to line-in of receiving system +of sending system (where VasEBoot is running) to line-in of receiving system (usually developer machine). On receiving system compile @samp{spkmodem-recv} from @samp{util/spkmodem-recv.c} and run: @@ -1362,82 +1362,82 @@ parecord --channels=1 --rate=48000 --format=s16le | ./spkmodem-recv The default is to use the platform's native terminal output. -@item GRUB_TERMINAL -If this option is set, it overrides both @samp{GRUB_TERMINAL_INPUT} and -@samp{GRUB_TERMINAL_OUTPUT} to the same value. +@item VasEBoot_TERMINAL +If this option is set, it overrides both @samp{VasEBoot_TERMINAL_INPUT} and +@samp{VasEBoot_TERMINAL_OUTPUT} to the same value. -@item GRUB_SERIAL_COMMAND +@item VasEBoot_SERIAL_COMMAND A command to configure the serial port when using the serial console. @xref{serial}. Defaults to @samp{serial}. -@item GRUB_CMDLINE_LINUX +@item VasEBoot_CMDLINE_LINUX Command-line arguments to add to menu entries for the Linux kernel. -@item GRUB_CMDLINE_LINUX_DEFAULT -Unless @samp{GRUB_DISABLE_RECOVERY} is set to @samp{true}, two menu +@item VasEBoot_CMDLINE_LINUX_DEFAULT +Unless @samp{VasEBoot_DISABLE_RECOVERY} is set to @samp{true}, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in -@samp{GRUB_CMDLINE_LINUX}. +@samp{VasEBoot_CMDLINE_LINUX}. -@item GRUB_CMDLINE_NETBSD -@itemx GRUB_CMDLINE_NETBSD_DEFAULT -As @samp{GRUB_CMDLINE_LINUX} and @samp{GRUB_CMDLINE_LINUX_DEFAULT}, but for +@item VasEBoot_CMDLINE_NETBSD +@itemx VasEBoot_CMDLINE_NETBSD_DEFAULT +As @samp{VasEBoot_CMDLINE_LINUX} and @samp{VasEBoot_CMDLINE_LINUX_DEFAULT}, but for NetBSD. -@item GRUB_CMDLINE_GNUMACH -As @samp{GRUB_CMDLINE_LINUX}, but for GNU Mach. +@item VasEBoot_CMDLINE_GNUMACH +As @samp{VasEBoot_CMDLINE_LINUX}, but for GNU Mach. -@item GRUB_CMDLINE_XEN -@itemx GRUB_CMDLINE_XEN_DEFAULT +@item VasEBoot_CMDLINE_XEN +@itemx VasEBoot_CMDLINE_XEN_DEFAULT The values of these options are passed to Xen hypervisor Xen menu entries, for all respectively normal entries. -@item GRUB_CMDLINE_LINUX_XEN_REPLACE -@item GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT -The values of these options replace the values of @samp{GRUB_CMDLINE_LINUX} -and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux and Xen menu entries. +@item VasEBoot_CMDLINE_LINUX_XEN_REPLACE +@item VasEBoot_CMDLINE_LINUX_XEN_REPLACE_DEFAULT +The values of these options replace the values of @samp{VasEBoot_CMDLINE_LINUX} +and @samp{VasEBoot_CMDLINE_LINUX_DEFAULT} for Linux and Xen menu entries. -@item GRUB_DISABLE_LINUX_UUID -Normally, @command{grub-mkconfig} will generate menu entries that use +@item VasEBoot_DISABLE_LINUX_UUID +Normally, @command{VasEBoot-mkconfig} will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a @samp{root=UUID=...} kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to @samp{true}. -@item GRUB_DISABLE_RECOVERY +@item VasEBoot_DISABLE_RECOVERY If this option is set to @samp{true}, disable the generation of recovery mode menu entries. -@item GRUB_VIDEO_BACKEND +@item VasEBoot_VIDEO_BACKEND If graphical video support is required, either because the @samp{gfxterm} -graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, -then @command{grub-mkconfig} will normally load all available GRUB video +graphical terminal is in use or because @samp{VasEBoot_GFXPAYLOAD_LINUX} is set, +then @command{VasEBoot-mkconfig} will normally load all available VasEBoot video drivers and use the one most appropriate for your hardware. If you need to override this for some reason, then you can set this option. -After @command{grub-install} has been run, the available video drivers are -listed in @file{/boot/grub/video.lst}. +After @command{VasEBoot-install} has been run, the available video drivers are +listed in @file{/boot/VasEBoot/video.lst}. -@item GRUB_GFXMODE +@item VasEBoot_GFXMODE Set the resolution used on the @samp{gfxterm} graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is @samp{auto}, which tries to select a preferred resolution. @xref{gfxmode}. -@item GRUB_BACKGROUND +@item VasEBoot_BACKGROUND Set a background image for use with the @samp{gfxterm} graphical terminal. -The value of this option must be a file readable by GRUB at boot time, and +The value of this option must be a file readable by VasEBoot at boot time, and it must end with @file{.png}, @file{.tga}, @file{.jpg}, or @file{.jpeg}. The image will be scaled if necessary to fit the screen. -@item GRUB_THEME +@item VasEBoot_THEME Set a theme for use with the @samp{gfxterm} graphical terminal. -@item GRUB_GFXPAYLOAD_LINUX +@item VasEBoot_GFXPAYLOAD_LINUX Set to @samp{text} to force the Linux kernel to boot in normal text mode, -@samp{keep} to preserve the graphics mode set using @samp{GRUB_GFXMODE}, +@samp{keep} to preserve the graphics mode set using @samp{VasEBoot_GFXMODE}, @samp{@var{width}x@var{height}}[@samp{x@var{depth}}] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. @xref{gfxpayload}. @@ -1446,49 +1446,49 @@ Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to @samp{text} and -GRUB will tell Linux to boot in normal text mode. +VasEBoot will tell Linux to boot in normal text mode. -@item GRUB_DISABLE_OS_PROBER -Normally, @command{grub-mkconfig} will try to use the external +@item VasEBoot_DISABLE_OS_PROBER +Normally, @command{VasEBoot-mkconfig} will try to use the external @command{os-prober} program, if installed, to discover other operating systems installed on the same system and generate appropriate menu entries for them. Set this option to @samp{true} to disable this. -@item GRUB_OS_PROBER_SKIP_LIST +@item VasEBoot_OS_PROBER_SKIP_LIST List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it's @@ -@item GRUB_DISABLE_SUBMENU -Normally, @command{grub-mkconfig} will generate top level menu entry for +@item VasEBoot_DISABLE_SUBMENU +Normally, @command{VasEBoot-mkconfig} will generate top level menu entry for the kernel with highest version number and put all other found kernels or alternative menu entries for recovery mode in submenu. For entries returned by @command{os-prober} first entry will be put on top level and all others in submenu. If this option is set to @samp{y}, flat menu with all entries on top level will be generated instead. Changing this option will require -changing existing values of @samp{GRUB_DEFAULT}, @samp{fallback} (@pxref{fallback}) +changing existing values of @samp{VasEBoot_DEFAULT}, @samp{fallback} (@pxref{fallback}) and @samp{default} (@pxref{default}) environment variables as well as saved -default entry using @command{grub-set-default} and value used with -@command{grub-reboot}. +default entry using @command{VasEBoot-set-default} and value used with +@command{VasEBoot-reboot}. -@item GRUB_ENABLE_CRYPTODISK -If set to @samp{y}, @command{grub-mkconfig} and @command{grub-install} will +@item VasEBoot_ENABLE_CRYPTODISK +If set to @samp{y}, @command{VasEBoot-mkconfig} and @command{VasEBoot-install} will check for encrypted disks and generate additional commands needed to access them during boot. Note that in this case unattended boot is not possible -because GRUB will wait for passphrase to unlock encrypted container. +because VasEBoot will wait for passphrase to unlock encrypted container. -@item GRUB_INIT_TUNE -Play a tune on the speaker when GRUB starts. This is particularly useful +@item VasEBoot_INIT_TUNE +Play a tune on the speaker when VasEBoot starts. This is particularly useful for users unable to see the screen. The value of this option is passed directly to @ref{play}. -@item GRUB_BADRAM -If this option is set, GRUB will issue a @ref{badram} command to filter +@item VasEBoot_BADRAM +If this option is set, VasEBoot will issue a @ref{badram} command to filter out specified regions of RAM. -@item GRUB_PRELOAD_MODULES -This option may be set to a list of GRUB module names separated by spaces. +@item VasEBoot_PRELOAD_MODULES +This option may be set to a list of VasEBoot module names separated by spaces. Each module will be loaded as early as possible, at the start of -@file{grub.cfg}. +@file{VasEBoot.cfg}. @end table @@ -1496,43 +1496,43 @@ The following options are still accepted for compatibility with existing configurations, but have better replacements: @table @samp -@item GRUB_HIDDEN_TIMEOUT +@item VasEBoot_HIDDEN_TIMEOUT Wait this many seconds before displaying the menu. If @key{ESC} is pressed during that time, display the menu and wait for input according to -@samp{GRUB_TIMEOUT}. If a hotkey associated with a menu entry is pressed, +@samp{VasEBoot_TIMEOUT}. If a hotkey associated with a menu entry is pressed, boot the associated menu entry immediately. If the timeout expires before either of these happens, display the menu for the number of seconds -specified in @samp{GRUB_TIMEOUT} before booting the default entry. +specified in @samp{VasEBoot_TIMEOUT} before booting the default entry. -If you set @samp{GRUB_HIDDEN_TIMEOUT}, you should also set -@samp{GRUB_TIMEOUT=0} so that the menu is not displayed at all unless +If you set @samp{VasEBoot_HIDDEN_TIMEOUT}, you should also set +@samp{VasEBoot_TIMEOUT=0} so that the menu is not displayed at all unless @key{ESC} is pressed. This option is unset by default, and is deprecated in favour of the less -confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or -@samp{GRUB_TIMEOUT_STYLE=hidden}. +confusing @samp{VasEBoot_TIMEOUT_STYLE=countdown} or +@samp{VasEBoot_TIMEOUT_STYLE=hidden}. -@item GRUB_HIDDEN_TIMEOUT_QUIET -In conjunction with @samp{GRUB_HIDDEN_TIMEOUT}, set this to @samp{true} to +@item VasEBoot_HIDDEN_TIMEOUT_QUIET +In conjunction with @samp{VasEBoot_HIDDEN_TIMEOUT}, set this to @samp{true} to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. This option is unset by default, and is deprecated in favour of the less -confusing @samp{GRUB_TIMEOUT_STYLE=countdown}. +confusing @samp{VasEBoot_TIMEOUT_STYLE=countdown}. -@item GRUB_HIDDEN_TIMEOUT_BUTTON -Variant of @samp{GRUB_HIDDEN_TIMEOUT}, used to support vendor-specific power +@item VasEBoot_HIDDEN_TIMEOUT_BUTTON +Variant of @samp{VasEBoot_HIDDEN_TIMEOUT}, used to support vendor-specific power buttons. @xref{Vendor power-on keys}. This option is unset by default, and is deprecated in favour of the less -confusing @samp{GRUB_TIMEOUT_STYLE=countdown} or -@samp{GRUB_TIMEOUT_STYLE=hidden}. +confusing @samp{VasEBoot_TIMEOUT_STYLE=countdown} or +@samp{VasEBoot_TIMEOUT_STYLE=hidden}. @end table -For more detailed customisation of @command{grub-mkconfig}'s output, you may -edit the scripts in @file{/etc/grub.d} directly. -@file{/etc/grub.d/40_custom} is particularly useful for adding entire custom +For more detailed customisation of @command{VasEBoot-mkconfig}'s output, you may +edit the scripts in @file{/etc/VasEBoot.d} directly. +@file{/etc/VasEBoot.d/40_custom} is particularly useful for adding entire custom menu entries; simply type the menu entries you want to add at the end of that file, making sure to leave at least the first two lines intact. @@ -1543,14 +1543,14 @@ that file, making sure to leave at least the first two lines intact. @c Some of this section is derived from the GNU Bash manual page, also @c copyrighted by the FSF. -@file{grub.cfg} is written in GRUB's built-in scripting language, which has +@file{VasEBoot.cfg} is written in VasEBoot's built-in scripting language, which has a syntax quite similar to that of GNU Bash and other Bourne shell derivatives. @heading Words A @dfn{word} is a sequence of characters considered as a single unit by -GRUB. Words are separated by @dfn{metacharacters}, which are the following +VasEBoot. Words are separated by @dfn{metacharacters}, which are the following plus space, tab, and newline: @example @@ -1561,7 +1561,7 @@ Quoting may be used to include metacharacters in words; see below. @heading Reserved words -Reserved words have a special meaning to GRUB. The following words are +Reserved words have a special meaning to VasEBoot. The following words are recognised as reserved when unquoted and either the first word of a simple command or the third word of a @code{for} command: @@ -1611,7 +1611,7 @@ protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. Normal variable names begin with an alphabetic character, followed by zero -or more alphanumeric characters. These names refer to entries in the GRUB +or more alphanumeric characters. These names refer to entries in the VasEBoot environment (@pxref{Environment}). Positional variable names consist of one or more digits. They represent @@ -1687,7 +1687,7 @@ the body. @heading Built-in Commands -Some built-in commands are also provided by GRUB script to help script +Some built-in commands are also provided by VasEBoot script to help script writers perform actions that are otherwise not possible. For example, these include commands to jump out of a loop without fully completing it, etc. @@ -1734,41 +1734,41 @@ than zero; otherwise 0. Currently autogenerating config files for multi-boot environments depends on os-prober and has several shortcomings. While fixing it is scheduled for the -next release, meanwhile you can make use of the power of GRUB syntax and do it +next release, meanwhile you can make use of the power of VasEBoot syntax and do it yourself. A possible configuration is detailed here, feel free to adjust to your needs. -First create a separate GRUB partition, big enough to hold GRUB. Some of the +First create a separate VasEBoot partition, big enough to hold VasEBoot. Some of the following entries show how to load OS installer images from this same partition, for that you obviously need to make the partition large enough to hold those images as well. -Mount this partition on/mnt/boot and disable GRUB in all OSes and manually -install self-compiled latest GRUB with: +Mount this partition on/mnt/boot and disable VasEBoot in all OSes and manually +install self-compiled latest VasEBoot with: -@code{grub-install --boot-directory=/mnt/boot /dev/sda} +@code{VasEBoot-install --boot-directory=/mnt/boot /dev/sda} -In all the OSes install GRUB tools but disable installing GRUB in bootsector, -so you'll have menu.lst and grub.cfg available for use. Also disable os-prober +In all the OSes install VasEBoot tools but disable installing VasEBoot in bootsector, +so you'll have menu.lst and VasEBoot.cfg available for use. Also disable os-prober use by setting: -@code{GRUB_DISABLE_OS_PROBER=true} +@code{VasEBoot_DISABLE_OS_PROBER=true} -in /etc/default/grub +in /etc/default/VasEBoot -Then write a grub.cfg (/mnt/boot/grub/grub.cfg): +Then write a VasEBoot.cfg (/mnt/boot/VasEBoot/VasEBoot.cfg): @example -menuentry "OS using grub2" @{ +menuentry "OS using VasEBoot2" @{ insmod xfs search --set=root --label OS1 --hint hd0,msdos8 - configfile /boot/grub/grub.cfg + configfile /boot/VasEBoot/VasEBoot.cfg @} -menuentry "OS using grub2-legacy" @{ +menuentry "OS using VasEBoot2-legacy" @{ insmod ext2 search --set=root --label OS2 --hint hd0,msdos6 - legacy_configfile /boot/grub/menu.lst + legacy_configfile /boot/VasEBoot/menu.lst @} menuentry "Windows XP" @{ @@ -1794,25 +1794,25 @@ menuentry "FreeBSD" @{ set kFreeBSD.hw.psm.synaptics_support=1 @} -menuentry "experimental GRUB" @{ - search --set=root --label GRUB --hint hd0,msdos5 - multiboot /experimental/grub/i386-pc/core.img +menuentry "experimental VasEBoot" @{ + search --set=root --label VasEBoot --hint hd0,msdos5 + multiboot /experimental/VasEBoot/i386-pc/core.img @} menuentry "Fedora 16 installer" @{ - search --set=root --label GRUB --hint hd0,msdos5 + search --set=root --label VasEBoot --hint hd0,msdos5 linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800 initrd /fedora/initrd.img @} menuentry "Fedora rawhide installer" @{ - search --set=root --label GRUB --hint hd0,msdos5 + search --set=root --label VasEBoot --hint hd0,msdos5 linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800 initrd /fedora/initrd.img @} menuentry "Debian sid installer" @{ - search --set=root --label GRUB --hint hd0,msdos5 + search --set=root --label VasEBoot --hint hd0,msdos5 linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz @} @@ -1825,36 +1825,36 @@ Notes: @end itemize @node Embedded configuration -@section Embedding a configuration file into GRUB +@section Embedding a configuration file into VasEBoot -GRUB supports embedding a configuration file directly into the core image, +VasEBoot supports embedding a configuration file directly into the core image, so that it is loaded before entering normal mode. This is useful, for example, when it is not straightforward to find the real configuration file, or when you need to debug problems with loading that file. -@command{grub-install} uses this feature when it is not using BIOS disk +@command{VasEBoot-install} uses this feature when it is not using BIOS disk functions or when installing to a different disk from the one containing -@file{/boot/grub}, in which case it needs to use the @command{search} -command (@pxref{search}) to find @file{/boot/grub}. +@file{/boot/VasEBoot}, in which case it needs to use the @command{search} +command (@pxref{search}) to find @file{/boot/VasEBoot}. To embed a configuration file, use the @option{-c} option to -@command{grub-mkimage}. The file is copied into the core image, so it may +@command{VasEBoot-mkimage}. The file is copied into the core image, so it may reside anywhere on the file system, and may be removed after running -@command{grub-mkimage}. +@command{VasEBoot-mkimage}. -After the embedded configuration file (if any) is executed, GRUB will load +After the embedded configuration file (if any) is executed, VasEBoot will load the @samp{normal} module (@pxref{normal}), which will then read the real -configuration file from @file{$prefix/grub.cfg}. By this point, the +configuration file from @file{$prefix/VasEBoot.cfg}. By this point, the @code{root} variable will also have been set to the root device name. For -example, @code{prefix} might be set to @samp{(hd0,1)/boot/grub}, and +example, @code{prefix} might be set to @samp{(hd0,1)/boot/VasEBoot}, and @code{root} might be set to @samp{hd0,1}. Thus, in most cases, the embedded configuration file only needs to set the @code{prefix} and @code{root} -variables, and then drop through to GRUB's normal processing. A typical +variables, and then drop through to VasEBoot's normal processing. A typical example of this might look like this: @example @group search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root -set prefix=($root)/boot/grub +set prefix=($root)/boot/VasEBoot @end group @end example @@ -1863,8 +1863,8 @@ example to work.) In more complex cases, it may be useful to read other configuration files directly from the embedded configuration file. This allows such things as -reading files not called @file{grub.cfg}, or reading files from a directory -other than that where GRUB's loadable modules are installed. To do this, +reading files not called @file{VasEBoot.cfg}, or reading files from a directory +other than that where VasEBoot's loadable modules are installed. To do this, include the @samp{configfile} and @samp{normal} modules in the core image, and embed a configuration file that uses the @command{configfile} command to load another file. The following example of this also requires the @@ -1873,14 +1873,14 @@ included in the core image: @example @group -search.fs_label grub root -if [ -e /boot/grub/example/test1.cfg ]; then - set prefix=($root)/boot/grub - configfile /boot/grub/example/test1.cfg +search.fs_label VasEBoot root +if [ -e /boot/VasEBoot/example/test1.cfg ]; then + set prefix=($root)/boot/VasEBoot + configfile /boot/VasEBoot/example/test1.cfg else - if [ -e /boot/grub/example/test2.cfg ]; then - set prefix=($root)/boot/grub - configfile /boot/grub/example/test2.cfg + if [ -e /boot/VasEBoot/example/test2.cfg ]; then + set prefix=($root)/boot/VasEBoot + configfile /boot/VasEBoot/example/test2.cfg else echo "Could not find an example configuration file!" fi @@ -1894,8 +1894,8 @@ may only read them from elsewhere using @command{configfile}. @node Theme file format @chapter Theme file format @section Introduction -The GRUB graphical menu supports themes that can customize the layout and -appearance of the GRUB boot menu. The theme is configured through a plain +The VasEBoot graphical menu supports themes that can customize the layout and +appearance of the VasEBoot boot menu. The theme is configured through a plain text file that specifies the layout of the various GUI components (including the boot menu, timeout progress bar, and text messages) as well as the appearance using colors, fonts, and images. Example is available in docs/example_theme.txt @@ -1911,10 +1911,10 @@ Colors can be specified in several ways: @item with ``SVG 1.0 color names'' (e.g., ``cornflowerblue'') which must be specified in lowercase. @end itemize @subsection Fonts -The fonts GRUB uses ``PFF2 font format'' bitmap fonts. Fonts are specified +The fonts VasEBoot uses ``PFF2 font format'' bitmap fonts. Fonts are specified with full font names. Currently there is no provision for a preference list of fonts, or deriving one font from another. -Fonts are loaded with the ``loadfont'' command in GRUB (@ref{loadfont}). To see the list of +Fonts are loaded with the ``loadfont'' command in VasEBoot (@ref{loadfont}). To see the list of loaded fonts, execute the ``lsfonts'' command (@ref{lsfonts}). If there are too many fonts to fit on screen, do ``set pager=1'' before executing ``lsfonts''. @@ -1929,10 +1929,10 @@ fit on screen, do ``set pager=1'' before executing ``lsfonts''. @c @image{Theme_progress_bar_filled,,,,png} @end float -Progress bars are used to display the remaining time before GRUB boots the +Progress bars are used to display the remaining time before VasEBoot boots the default menu entry. To create a progress bar that will display the remaining time before automatic boot, simply create a ``progress_bar'' component with -the id ``__timeout__''. This indicates to GRUB that the progress bar should +the id ``__timeout__''. This indicates to VasEBoot that the progress bar should be updated as time passes, and it should be made invisible if the countdown to automatic boot is interrupted by the user. @@ -1948,7 +1948,7 @@ templates. @c @image{Theme_circular_progress,,,,.png} The circular progress indicator functions similarly to the progress bar. When -given an id of ``__timeout__'', GRUB updates the circular progress indicator's +given an id of ``__timeout__'', VasEBoot updates the circular progress indicator's value to indicate the time remaining. For the circular progress indicator, there are two images used to render it: the *center* image, and the *tick* image. The center image is rendered in the center of the component, while the @@ -1970,10 +1970,10 @@ else instead of directly on the progress bar. @c @image{Theme_boot_menu,,,,.png} -The boot menu where GRUB displays the menu entries from the ``grub.cfg'' file. +The boot menu where VasEBoot displays the menu entries from the ``VasEBoot.cfg'' file. It is a list of items, where each item has a title and an optional icon. The icon is selected based on the *classes* specified for the menu entry. If -there is a PNG file named ``myclass.png'' in the ``grub/themes/icons'' +there is a PNG file named ``myclass.png'' in the ``VasEBoot/themes/icons'' directory, it will be displayed for items which have the class *myclass*. The boot menu can be customized in several ways, such as the font and color used for the menu entry title, and by specifying styled boxes for the menu itself @@ -2018,12 +2018,12 @@ into the necessary image slices is: @enumerate @item Create or open the drawing you'd like use. @item Create a new layer on the top of the layer stack. Make it visible. Select this layer as the current layer. -@item Draw 9 rectangles on your drawing where you'd like the slices to be. Clear the fill option, and set the stroke to 1 pixel wide solid stroke. The corners of the slices must meet precisely; if it is off by a single pixel, it will probably be evident when the styled box is rendered in the GRUB menu. You should probably go to File | Document Properties | Grids and enable a grid or create a guide (click on one of the rulers next to the drawing and drag over the drawing; release the mouse button to place the guide) to help place the rectangles precisely. +@item Draw 9 rectangles on your drawing where you'd like the slices to be. Clear the fill option, and set the stroke to 1 pixel wide solid stroke. The corners of the slices must meet precisely; if it is off by a single pixel, it will probably be evident when the styled box is rendered in the VasEBoot menu. You should probably go to File | Document Properties | Grids and enable a grid or create a guide (click on one of the rulers next to the drawing and drag over the drawing; release the mouse button to place the guide) to help place the rectangles precisely. @item Right click on the center slice rectangle and choose Object Properties. Change the "Id" to ``slice_c`` and click Set. Repeat this for the remaining 8 rectangles, giving them Id values of ``slice_n``, ``slice_ne``, ``slice_e``, and so on according to the location. @item Save the drawing. @item Select all the slice rectangles. With the slice layer selected, you can simply press Ctrl+A to select all rectangles. The status bar should indicate that 9 rectangles are selected. @item Click the layer hide icon for the slice layer in the layer palette. The rectangles will remain selected, even though they are hidden. -@item Choose File | Export Bitmap and check the *Batch export 9 selected objects* box. Make sure that *Hide all except selected* is unchecked. click *Export*. This will create PNG files in the same directory as the drawing, named after the slices. These can now be used for a styled box in a GRUB theme. +@item Choose File | Export Bitmap and check the *Batch export 9 selected objects* box. Make sure that *Hide all except selected* is unchecked. click *Export*. This will create PNG files in the same directory as the drawing, named after the slices. These can now be used for a styled box in a VasEBoot theme. @end enumerate @section Theme File Manual @@ -2122,7 +2122,7 @@ of a *canvas* container. Components are created in the theme file by prefixing the type of component with a '+' sign: -@code{ + label @{ text="GRUB" font="aqui 11" color="#8FF" @} } +@code{ + label @{ text="VasEBoot" font="aqui 11" color="#8FF" @} } properties of a component are specified as "name = value" (whitespace surrounding tokens is optional and is ignored) where *value* may be: @@ -2216,7 +2216,7 @@ The following is a list of the components and the properties they support. @tab The text to display on the progress bar. If the progress bar's ID is set to ``__timeout__`` and the value of this property is set to ``@@TIMEOUT_NOTIFICATION_SHORT@@``, ``@@TIMEOUT_NOTIFICATION_MIDDLE@@`` - or ``@@TIMEOUT_NOTIFICATION_LONG@@``, then GRUB will update this + or ``@@TIMEOUT_NOTIFICATION_LONG@@``, then VasEBoot will update this property with an informative message as the timeout approaches. @end multitable @@ -2251,7 +2251,7 @@ The following is a list of the components and the properties they support. @end multitable @item boot_menu - Displays the GRUB boot menu. It allows selecting items and executing them. + Displays the VasEBoot boot menu. It allows selecting items and executing them. Properties: @@ -2369,12 +2369,12 @@ The following properties are supported by all components: @item id The identifier for the component. This can be any arbitrary string. The ID can be used by scripts to refer to various components in the GUI - component tree. Currently, there is one special ID value that GRUB + component tree. Currently, there is one special ID value that VasEBoot recognizes: @multitable @columnfractions 0.2 0.7 @item ``__timeout__`` - @tab Component with this ID will be updated by GRUB and will indicate + @tab Component with this ID will be updated by VasEBoot and will indicate time elapsed to an automatical boot of the default entry. Affected components: ``label``, ``circular_progress``, ``progress_bar``. @end multitable @@ -2383,7 +2383,7 @@ The following properties are supported by all components: @node Network -@chapter Booting GRUB from the network +@chapter Booting VasEBoot from the network The following instructions don't work for *-emu, i386-qemu, i386-coreboot, i386-multiboot, mips_loongson, mips-arc and mips_qemu_mips @@ -2392,7 +2392,7 @@ To generate a netbootable directory, run: @example @group -grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/ +VasEBoot-mknetdir --net-directory=/srv/tftp --subdir=/boot/VasEBoot -d /usr/lib/VasEBoot/ @end group @end example @@ -2400,14 +2400,14 @@ E.g. for i386-pc: @example @group -grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i386-pc +VasEBoot-mknetdir --net-directory=/srv/tftp --subdir=/boot/VasEBoot -d /usr/lib/VasEBoot/i386-pc @end group @end example -Then follow instructions printed out by grub-mknetdir on configuring your DHCP +Then follow instructions printed out by VasEBoot-mknetdir on configuring your DHCP server. -After GRUB has started, files on the TFTP server will be accessible via the +After VasEBoot has started, files on the TFTP server will be accessible via the @samp{(tftp)} device. The server IP address can be controlled by changing the @@ -2415,7 +2415,7 @@ The server IP address can be controlled by changing the this should be changed both in the prefix and in any references to the device name in the configuration file. -GRUB provides several environment variables which may be used to inspect or +VasEBoot provides several environment variables which may be used to inspect or change the behaviour of the PXE device. In the following description @var{} is placeholder for the name of network interface (platform dependent): @@ -2451,7 +2451,7 @@ The IP address of the next (usually, TFTP) server provided by DHCP. Read-only. @item net_default_interface -Initially set to name of network interface that was used to load grub. +Initially set to name of network interface that was used to load VasEBoot. Read-write, although setting it affects only interpretation of @samp{net_default_ip} and @samp{net_default_mac} @@ -2471,9 +2471,9 @@ although setting this is only useful before opening a network device. @node Serial terminal -@chapter Using GRUB via a serial line +@chapter Using VasEBoot via a serial line -This chapter describes how to use the serial terminal support in GRUB. +This chapter describes how to use the serial terminal support in VasEBoot. If you have many computers or computers with no display/keyboard, it could be very useful to control the computers through serial @@ -2484,13 +2484,13 @@ serial ports. In addition, a terminal emulator is also required, such as minicom. Refer to a manual of your operating system, for more information. -As for GRUB, the instruction to set up a serial terminal is quite +As for VasEBoot, the instruction to set up a serial terminal is quite simple. Here is an example: @example @group -grub> @kbd{serial --unit=0 --speed=9600} -grub> @kbd{terminal_input serial; terminal_output serial} +VasEBoot> @kbd{serial --unit=0 --speed=9600} +VasEBoot> @kbd{terminal_input serial; terminal_output serial} @end group @end example @@ -2505,32 +2505,32 @@ The commands @command{terminal_input} (@pxref{terminal_input}) and terminal you want to use. In the case above, the terminal will be a serial terminal, but you can also pass @code{console} to the command, as @samp{terminal_input serial console}. In this case, a terminal in which -you press any key will be selected as a GRUB terminal. In the example above, +you press any key will be selected as a VasEBoot terminal. In the example above, note that you need to put both commands on the same command line, as you will lose the ability to type commands on the console after the first command. -However, note that GRUB assumes that your terminal emulator is +However, note that VasEBoot assumes that your terminal emulator is compatible with VT100 by default. This is true for most terminal emulators nowadays, but you should pass the option @option{--dumb} to the command if your terminal emulator is not VT100-compatible or implements few VT100 escape sequences. If you specify this option then -GRUB provides you with an alternative menu interface, because the normal +VasEBoot provides you with an alternative menu interface, because the normal menu requires several fancy features of your terminal. @node Vendor power-on keys -@chapter Using GRUB with vendor power-on keys +@chapter Using VasEBoot with vendor power-on keys Some laptop vendors provide an additional power-on button which boots -another OS. GRUB supports such buttons with the @samp{GRUB_TIMEOUT_BUTTON}, -@samp{GRUB_TIMEOUT_STYLE_BUTTON}, @samp{GRUB_DEFAULT_BUTTON}, and -@samp{GRUB_BUTTON_CMOS_ADDRESS} variables in default/grub (@pxref{Simple -configuration}). @samp{GRUB_TIMEOUT_BUTTON}, -@samp{GRUB_TIMEOUT_STYLE_BUTTON}, and @samp{GRUB_DEFAULT_BUTTON} are used +another OS. VasEBoot supports such buttons with the @samp{VasEBoot_TIMEOUT_BUTTON}, +@samp{VasEBoot_TIMEOUT_STYLE_BUTTON}, @samp{VasEBoot_DEFAULT_BUTTON}, and +@samp{VasEBoot_BUTTON_CMOS_ADDRESS} variables in default/VasEBoot (@pxref{Simple +configuration}). @samp{VasEBoot_TIMEOUT_BUTTON}, +@samp{VasEBoot_TIMEOUT_STYLE_BUTTON}, and @samp{VasEBoot_DEFAULT_BUTTON} are used instead of the corresponding variables without the @samp{_BUTTON} suffix -when powered on using the special button. @samp{GRUB_BUTTON_CMOS_ADDRESS} -is vendor-specific and partially model-specific. Values known to the GRUB +when powered on using the special button. @samp{VasEBoot_BUTTON_CMOS_ADDRESS} +is vendor-specific and partially model-specific. Values known to the VasEBoot team are: @table @key @@ -2546,8 +2546,8 @@ team are: 101:3 @end table -To take full advantage of this function, install GRUB into the MBR -(@pxref{Installing GRUB using grub-install}). +To take full advantage of this function, install VasEBoot into the MBR +(@pxref{Installing VasEBoot using VasEBoot-install}). If you have a laptop which has a similar feature and not in the above list could you figure your address and contribute? @@ -2589,18 +2589,18 @@ CMOS. So the real byte address in CMOS is 71+14=85 So complete address is 85:3 @node Images -@chapter GRUB image files +@chapter VasEBoot image files @c FIXME: parts of this section are specific to PC BIOS right now. -GRUB consists of several images: a variety of bootstrap images for starting -GRUB in various ways, a kernel image, and a set of modules which are +VasEBoot consists of several images: a variety of bootstrap images for starting +VasEBoot in various ways, a kernel image, and a set of modules which are combined with the kernel image to form a core image. Here is a short overview of them. @table @file @item boot.img -On PC BIOS systems, this image is the first part of GRUB to start. It is +On PC BIOS systems, this image is the first part of VasEBoot to start. It is written to a master boot record (MBR) or to the boot sector of a partition. Because a PC boot sector is 512 bytes, the size of this image is exactly 512 bytes. @@ -2608,8 +2608,8 @@ bytes. The sole function of @file{boot.img} is to read the first sector of the core image from a local disk and jump to it. Because of the size restriction, @file{boot.img} cannot understand any file system structure, so -@command{grub-install} hardcodes the location of the first sector of the -core image into @file{boot.img} when installing GRUB. +@command{VasEBoot-install} hardcodes the location of the first sector of the +core image into @file{boot.img} when installing VasEBoot. @item diskboot.img This image is used as the first sector of the core image when booting from a @@ -2627,19 +2627,19 @@ network using PXE. @xref{Network}. @item lnxboot.img This image may be placed at the start of the core image in order to make -GRUB look enough like a Linux kernel that it can be booted by LILO using an +VasEBoot look enough like a Linux kernel that it can be booted by LILO using an @samp{image=} section. @item kernel.img -This image contains GRUB's basic run-time facilities: frameworks for device +This image contains VasEBoot's basic run-time facilities: frameworks for device and file handling, environment variables, the rescue mode command-line parser, and so on. It is rarely used directly, but is built into all core images. @item core.img -This is the core image of GRUB. It is built dynamically from the kernel -image and an arbitrary list of modules by the @command{grub-mkimage} -program. Usually, it contains enough modules to access @file{/boot/grub}, +This is the core image of VasEBoot. It is built dynamically from the kernel +image and an arbitrary list of modules by the @command{VasEBoot-mkimage} +program. Usually, it contains enough modules to access @file{/boot/VasEBoot}, and loads everything else (including menu handling, the ability to load target operating systems, and so on) from the file system at run-time. The modular design allows the core image to be kept small, since the areas of @@ -2649,55 +2649,55 @@ disk where it must be installed are often as small as 32KB. installed on PC systems. @item *.mod -Everything else in GRUB resides in dynamically loadable modules. These are +Everything else in VasEBoot resides in dynamically loadable modules. These are often loaded automatically, or built into the core image if they are essential, but may also be loaded manually using the @command{insmod} command (@pxref{insmod}). @end table -@heading For GRUB Legacy users +@heading For VasEBoot Legacy users -GRUB 2 has a different design from GRUB Legacy, and so correspondences with -the images it used cannot be exact. Nevertheless, GRUB Legacy users often +VasEBoot 2 has a different design from VasEBoot Legacy, and so correspondences with +the images it used cannot be exact. Nevertheless, VasEBoot Legacy users often ask questions in the terms they are familiar with, and so here is a brief -guide to how GRUB 2's images relate to that. +guide to how VasEBoot 2's images relate to that. @table @file @item stage1 -Stage 1 from GRUB Legacy was very similar to @file{boot.img} in GRUB 2, and +Stage 1 from VasEBoot Legacy was very similar to @file{boot.img} in VasEBoot 2, and they serve the same function. @item *_stage1_5 -In GRUB Legacy, Stage 1.5's function was to include enough filesystem code +In VasEBoot Legacy, Stage 1.5's function was to include enough filesystem code to allow the much larger Stage 2 to be read from an ordinary filesystem. In -this respect, its function was similar to @file{core.img} in GRUB 2. +this respect, its function was similar to @file{core.img} in VasEBoot 2. However, @file{core.img} is much more capable than Stage 1.5 was; since it offers a rescue shell, it is sometimes possible to recover manually in the event that it is unable to load any other modules, for example if partition numbers have changed. @file{core.img} is built in a more flexible way, -allowing GRUB 2 to support reading modules from advanced disk types such as +allowing VasEBoot 2 to support reading modules from advanced disk types such as LVM and RAID. -GRUB Legacy could run with only Stage 1 and Stage 2 in some limited -configurations, while GRUB 2 requires @file{core.img} and cannot work +VasEBoot Legacy could run with only Stage 1 and Stage 2 in some limited +configurations, while VasEBoot 2 requires @file{core.img} and cannot work without it. @item stage2 -GRUB 2 has no single Stage 2 image. Instead, it loads modules from -@file{/boot/grub} at run-time. +VasEBoot 2 has no single Stage 2 image. Instead, it loads modules from +@file{/boot/VasEBoot} at run-time. @item stage2_eltorito -In GRUB 2, images for booting from CD-ROM drives are now constructed using +In VasEBoot 2, images for booting from CD-ROM drives are now constructed using @file{cdboot.img} and @file{core.img}, making sure that the core image contains the @samp{iso9660} module. It is usually best to use the -@command{grub-mkrescue} program for this. +@command{VasEBoot-mkrescue} program for this. -@item nbgrub -There is as yet no equivalent for @file{nbgrub} in GRUB 2; it was used by +@item nbVasEBoot +There is as yet no equivalent for @file{nbVasEBoot} in VasEBoot 2; it was used by Etherboot and some other network boot loaders. -@item pxegrub -In GRUB 2, images for PXE network booting are now constructed using +@item pxeVasEBoot +In VasEBoot 2, images for PXE network booting are now constructed using @file{pxeboot.img} and @file{core.img}, making sure that the core image contains the @samp{pxe} and @samp{pxecmd} modules. @xref{Network}. @end table @@ -2744,8 +2744,8 @@ Lightly limited platforms: @node Filesystem @chapter Filesystem syntax and semantics -GRUB uses a special syntax for specifying disk drives which can be -accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish +VasEBoot uses a special syntax for specifying disk drives which can be +accessed by BIOS. Because of BIOS limitations, VasEBoot cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command @command{search} @@ -2814,9 +2814,9 @@ several top-level partmaps. Specifying third and later component you can access to subpartitions. The syntax @samp{(hd0)} represents using the entire disk (or the -MBR when installing GRUB), while the syntax @samp{(hd0,1)} +MBR when installing VasEBoot), while the syntax @samp{(hd0,1)} represents using the first partition of the disk (or the boot sector -of the partition when installing GRUB). +of the partition when installing VasEBoot). @example (hd0,msdos1) @@ -2834,8 +2834,8 @@ environment variable @samp{net_default_server} is used. Before using the network drive, you must initialize the network. @xref{Network}, for more information. -If you boot GRUB from a CD-ROM, @samp{(cd)} is available. @xref{Making -a GRUB bootable CD-ROM}, for details. +If you boot VasEBoot from a CD-ROM, @samp{(cd)} is available. @xref{Making +a VasEBoot bootable CD-ROM}, for details. @node File name syntax @@ -2846,17 +2846,17 @@ There are two ways to specify files, by @dfn{absolute file name} and by An absolute file name resembles a Unix absolute file name, using @samp{/} for the directory separator (not @samp{\} as in DOS). One -example is @samp{(hd0,1)/boot/grub/grub.cfg}. This means the file -@file{/boot/grub/grub.cfg} in the first partition of the first hard -disk. If you omit the device name in an absolute file name, GRUB uses -GRUB's @dfn{root device} implicitly. So if you set the root device to, +example is @samp{(hd0,1)/boot/VasEBoot/VasEBoot.cfg}. This means the file +@file{/boot/VasEBoot/VasEBoot.cfg} in the first partition of the first hard +disk. If you omit the device name in an absolute file name, VasEBoot uses +VasEBoot's @dfn{root device} implicitly. So if you set the root device to, say, @samp{(hd1,1)} by the command @samp{set root=(hd1,1)} (@pxref{set}), then @code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}. On ZFS filesystem the first path component must be @var{volume}@samp{@@}[@var{snapshot}]. -So @samp{/rootvol@@snap-129/boot/grub/grub.cfg} refers to file -@samp{/boot/grub/grub.cfg} in snapshot of volume @samp{rootvol} with name +So @samp{/rootvol@@snap-129/boot/VasEBoot/VasEBoot.cfg} refers to file +@samp{/boot/VasEBoot/VasEBoot.cfg} in snapshot of volume @samp{rootvol} with name @samp{snap-129}. Trailing @samp{@@} after volume name is mandatory even if snapshot name is omitted. @@ -2873,27 +2873,27 @@ Here is an example: @code{0+100,200+1,300+300} @end example -This represents that GRUB should read blocks 0 through 99, block 200, -and blocks 300 through 599. If you omit an offset, then GRUB assumes +This represents that VasEBoot should read blocks 0 through 99, block 200, +and blocks 300 through 599. If you omit an offset, then VasEBoot assumes the offset is zero. Like the file name syntax (@pxref{File name syntax}), if a blocklist -does not contain a device name, then GRUB uses GRUB's @dfn{root +does not contain a device name, then VasEBoot uses VasEBoot's @dfn{root device}. So @code{(hd0,2)+1} is the same as @code{+1} when the root device is @samp{(hd0,2)}. @node Interface -@chapter GRUB's user interface +@chapter VasEBoot's user interface -GRUB has both a simple menu interface for choosing preset entries from a +VasEBoot has both a simple menu interface for choosing preset entries from a configuration file, and a highly flexible command-line for performing any desired combination of boot commands. -GRUB looks for its configuration file as soon as it is loaded. If one +VasEBoot looks for its configuration file as soon as it is loaded. If one is found, then the full menu interface is activated using whatever entries were found in the file. If you choose the @dfn{command-line} menu -option, or if the configuration file was not found, then GRUB drops to +option, or if the configuration file was not found, then VasEBoot drops to the command-line interface. @menu @@ -2986,7 +2986,7 @@ available to boot the default entry (the first one if not set), which is aborted by pressing any key. Commands are available to enter a bare command-line by pressing @key{c} -(which operates exactly like the non-config-file version of GRUB, but +(which operates exactly like the non-config-file version of VasEBoot, but allows one to return to the menu if desired by pressing @key{ESC}) or to edit any of the @dfn{boot entries} by pressing @key{e}. @@ -3009,21 +3009,21 @@ Each line in the menu entry can be edited freely, and you can add new lines by pressing @key{RET} at the end of a line. To boot the edited entry, press @key{Ctrl-x}. -Although GRUB unfortunately does not support @dfn{undo}, you can do almost +Although VasEBoot unfortunately does not support @dfn{undo}, you can do almost the same thing by just returning to the main menu using @key{ESC}. @node Environment -@chapter GRUB environment variables +@chapter VasEBoot environment variables -GRUB supports environment variables which are rather like those offered by +VasEBoot supports environment variables which are rather like those offered by all Unix-like systems. Environment variables have a name, which is unique and is usually a short identifier, and a value, which is an arbitrary string of characters. They may be set (@pxref{set}), unset (@pxref{unset}), or looked up (@pxref{Shell-like scripting}) by name. A number of environment variables have special meanings to various parts of -GRUB. Others may be used freely in GRUB configuration files. +VasEBoot. Others may be used freely in VasEBoot configuration files. @menu @@ -3035,7 +3035,7 @@ GRUB. Others may be used freely in GRUB configuration files. @node Special environment variables @section Special environment variables -These variables have special meaning to GRUB. +These variables have special meaning to VasEBoot. @menu * biosnum:: @@ -3052,8 +3052,8 @@ These variables have special meaning to GRUB. * gfxmode:: * gfxpayload:: * gfxterm_font:: -* grub_cpu:: -* grub_platform:: +* VasEBoot_cpu:: +* VasEBoot_platform:: * icondir:: * lang:: * locale_dir:: @@ -3088,10 +3088,10 @@ These variables have special meaning to GRUB. @node biosnum @subsection biosnum -When chain-loading another boot loader (@pxref{Chain-loading}), GRUB may +When chain-loading another boot loader (@pxref{Chain-loading}), VasEBoot may need to know what BIOS drive number corresponds to the root device (@pxref{root}) so that it can set up registers properly. If the -@var{biosnum} variable is set, it overrides GRUB's own means of guessing +@var{biosnum} variable is set, it overrides VasEBoot's own means of guessing this. For an alternative approach which also changes BIOS drive mappings for the @@ -3101,13 +3101,13 @@ chain-loaded system, @pxref{drivemap}. @node check_signatures @subsection check_signatures -This variable controls whether GRUB enforces digital signature +This variable controls whether VasEBoot enforces digital signature validation on loaded files. @xref{Using digital signatures}. @node chosen @subsection chosen -When executing a menu entry, GRUB sets the @var{chosen} variable to the +When executing a menu entry, VasEBoot sets the @var{chosen} variable to the title of the entry being executed. If the menu entry is in one or more submenus, then @var{chosen} is set to @@ -3119,7 +3119,7 @@ the title of the menu entry itself, separated by @samp{>}. @subsection cmdpath The location from which @file{core.img} was loaded as an absolute -directory name (@pxref{File name syntax}). This is set by GRUB at +directory name (@pxref{File name syntax}). This is set by VasEBoot at startup based on information returned by platform firmware. Not every platform provides this information and some may return only device without path name. @@ -3193,14 +3193,14 @@ to go beyond the current 16 colors. @node config_directory @subsection config_directory -This variable is automatically set by GRUB to the directory part of +This variable is automatically set by VasEBoot to the directory part of current configuration file name (@pxref{config_file}). @node config_file @subsection config_file -This variable is automatically set by GRUB to the name of configuration file that is being +This variable is automatically set by VasEBoot to the name of configuration file that is being processed by commands @command{configfile} (@pxref{configfile}) or @command{normal} (@pxref{normal}). It is restored to the previous value when command completes. @@ -3209,9 +3209,9 @@ processed by commands @command{configfile} (@pxref{configfile}) or @command{norm @subsection debug This variable may be set to enable debugging output from various components -of GRUB. The value is a list of debug facility names separated by +of VasEBoot. The value is a list of debug facility names separated by whitespace or @samp{,}, or @samp{all} to enable all available debugging -output. The facility names are the first argument to grub_dprintf. Consult +output. The facility names are the first argument to VasEBoot_dprintf. Consult source for more details. @@ -3251,15 +3251,15 @@ Other platforms --id=other Minix --id=minix Version 3.4.0 --id=minix-3.4.0 Version 3.3.0 --id=minix-3.3.0 - GRUB Invaders --id=grub-invaders + VasEBoot Invaders --id=VasEBoot-invaders @end example The more recent release of Minix would then be identified as @samp{Other platforms>Minix>Version 3.4.0}, or as @samp{1>0>0}, or as @samp{other>minix>minix-3.4.0}. -This variable is often set by @samp{GRUB_DEFAULT} (@pxref{Simple -configuration}), @command{grub-set-default}, or @command{grub-reboot}. +This variable is often set by @samp{VasEBoot_DEFAULT} (@pxref{Simple +configuration}), @command{VasEBoot-set-default}, or @command{VasEBoot-reboot}. @node fallback @@ -3278,7 +3278,7 @@ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is @samp{auto}, which selects a platform-specific default that should look reasonable. Supported -modes can be listed by @samp{videoinfo} command in GRUB. +modes can be listed by @samp{videoinfo} command in VasEBoot. The resolution may be specified as a sequence of one or more modes, separated by commas (@samp{,}) or semicolons (@samp{;}); each will be tried @@ -3301,13 +3301,13 @@ Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this variable to @samp{text} and -GRUB will tell Linux to boot in normal text mode. +VasEBoot will tell Linux to boot in normal text mode. The default is platform-specific. On platforms with a native text mode (such as PC BIOS platforms), the default is @samp{text}. Otherwise the default may be @samp{auto} or a specific video mode. -This variable is often set by @samp{GRUB_GFXPAYLOAD_LINUX} (@pxref{Simple +This variable is often set by @samp{VasEBoot_GFXPAYLOAD_LINUX} (@pxref{Simple configuration}). @@ -3319,24 +3319,24 @@ If this variable is set, it names a font to use for text on the available font. -@node grub_cpu -@subsection grub_cpu +@node VasEBoot_cpu +@subsection VasEBoot_cpu -In normal mode (@pxref{normal}), GRUB sets the @samp{grub_cpu} variable to -the CPU type for which GRUB was built (e.g. @samp{i386} or @samp{powerpc}). +In normal mode (@pxref{normal}), VasEBoot sets the @samp{VasEBoot_cpu} variable to +the CPU type for which VasEBoot was built (e.g. @samp{i386} or @samp{powerpc}). -@node grub_platform -@subsection grub_platform +@node VasEBoot_platform +@subsection VasEBoot_platform -In normal mode (@pxref{normal}), GRUB sets the @samp{grub_platform} variable -to the platform for which GRUB was built (e.g. @samp{pc} or @samp{efi}). +In normal mode (@pxref{normal}), VasEBoot sets the @samp{VasEBoot_platform} variable +to the platform for which VasEBoot was built (e.g. @samp{pc} or @samp{efi}). @node icondir @subsection icondir -If this variable is set, it names a directory in which the GRUB graphical +If this variable is set, it names a directory in which the VasEBoot graphical menu should look for icons after looking in the theme's @samp{icons} directory. @xref{Theme file format}. @@ -3349,7 +3349,7 @@ If this variable is set, it names the language code that the example, French would be named as @samp{fr}, and Simplified Chinese as @samp{zh_CN}. -@command{grub-mkconfig} (@pxref{Simple configuration}) will try to set a +@command{VasEBoot-mkconfig} (@pxref{Simple configuration}) will try to set a reasonable default for this variable based on the system locale. @@ -3357,10 +3357,10 @@ reasonable default for this variable based on the system locale. @subsection locale_dir If this variable is set, it names the directory where translation files may -be found (@pxref{gettext}), usually @file{/boot/grub/locale}. Otherwise, +be found (@pxref{gettext}), usually @file{/boot/VasEBoot/locale}. Otherwise, internationalization is disabled. -@command{grub-mkconfig} (@pxref{Simple configuration}) will set a reasonable +@command{VasEBoot-mkconfig} (@pxref{Simple configuration}) will set a reasonable default for this variable if internationalization is needed and any translation files are available. @@ -3476,11 +3476,11 @@ input. The default is not to pause output. @node prefix @subsection prefix -The location of the @samp{/boot/grub} directory as an absolute file name -(@pxref{File name syntax}). This is normally set by GRUB at startup based -on information provided by @command{grub-install}. GRUB modules are +The location of the @samp{/boot/VasEBoot} directory as an absolute file name +(@pxref{File name syntax}). This is normally set by VasEBoot at startup based +on information provided by @command{VasEBoot-install}. VasEBoot modules are dynamically loaded from this directory, so it must be set correctly in order -for many parts of GRUB to work. +for many parts of VasEBoot to work. @node pxe_blksize @@ -3506,11 +3506,11 @@ for many parts of GRUB to work. The root device name (@pxref{Device syntax}). Any file names that do not specify an explicit device name are read from this device. The default is -normally set by GRUB at startup based on the value of @samp{prefix} +normally set by VasEBoot at startup based on the value of @samp{prefix} (@pxref{prefix}). -For example, if GRUB was installed to the first partition of the first hard -disk, then @samp{prefix} might be set to @samp{(hd0,msdos1)/boot/grub} and +For example, if VasEBoot was installed to the first partition of the first hard +disk, then @samp{prefix} might be set to @samp{(hd0,msdos1)/boot/VasEBoot} and @samp{root} to @samp{hd0,msdos1}. @@ -3524,10 +3524,10 @@ authentication support. @xref{Security}. @node theme @subsection theme -This variable may be set to a directory containing a GRUB graphical menu +This variable may be set to a directory containing a VasEBoot graphical menu theme. @xref{Theme file format}. -This variable is often set by @samp{GRUB_THEME} (@pxref{Simple +This variable is often set by @samp{VasEBoot_THEME} (@pxref{Simple configuration}). @@ -3543,7 +3543,7 @@ If @samp{timeout_style} (@pxref{timeout_style}) is set to @samp{countdown} or @samp{hidden}, the timeout is instead counted before the menu is displayed. -This variable is often set by @samp{GRUB_TIMEOUT} (@pxref{Simple +This variable is often set by @samp{VasEBoot_TIMEOUT} (@pxref{Simple configuration}). @@ -3552,41 +3552,41 @@ configuration}). This variable may be set to @samp{menu}, @samp{countdown}, or @samp{hidden} to control the way in which the timeout (@pxref{timeout}) interacts with -displaying the menu. See the documentation of @samp{GRUB_TIMEOUT_STYLE} +displaying the menu. See the documentation of @samp{VasEBoot_TIMEOUT_STYLE} (@pxref{Simple configuration}) for details. @node Environment block -@section The GRUB environment block +@section The VasEBoot environment block It is often useful to be able to remember a small amount of information from one boot to the next. For example, you might want to set the default menu -entry based on what was selected the last time. GRUB deliberately does not +entry based on what was selected the last time. VasEBoot deliberately does not implement support for writing files in order to minimise the possibility of -the boot loader being responsible for file system corruption, so a GRUB +the boot loader being responsible for file system corruption, so a VasEBoot configuration file cannot just create a file in the ordinary way. However, -GRUB provides an ``environment block'' which can be used to save a small +VasEBoot provides an ``environment block'' which can be used to save a small amount of state. The environment block is a preallocated 1024-byte file, which normally lives -in @file{/boot/grub/grubenv} (although you should not assume this). At boot +in @file{/boot/VasEBoot/VasEBootenv} (although you should not assume this). At boot time, the @command{load_env} command (@pxref{load_env}) loads environment variables from it, and the @command{save_env} (@pxref{save_env}) command saves environment variables to it. From a running system, the -@command{grub-editenv} utility can be used to edit the environment block. +@command{VasEBoot-editenv} utility can be used to edit the environment block. For safety reasons, this storage is only available when installed on a plain disk (no LVM or RAID), using a non-checksumming filesystem (no ZFS), and using BIOS or EFI functions (no ATA, USB or IEEE1275). -@command{grub-mkconfig} uses this facility to implement -@samp{GRUB_SAVEDEFAULT} (@pxref{Simple configuration}). +@command{VasEBoot-mkconfig} uses this facility to implement +@samp{VasEBoot_SAVEDEFAULT} (@pxref{Simple configuration}). @node Commands @chapter The list of available commands -In this chapter, we list all commands that are available in GRUB. +In this chapter, we list all commands that are available in VasEBoot. Commands belong to different groups. A few can only be used in the global section of the configuration file (or ``menu''); most @@ -3596,7 +3596,7 @@ anywhere in the menu or specifically in the menu entries. In rescue mode, only the @command{insmod} (@pxref{insmod}), @command{ls} (@pxref{ls}), @command{set} (@pxref{set}), and @command{unset} (@pxref{unset}) commands are normally available. If you end up in rescue -mode and do not know what to do, then @pxref{GRUB only offers a rescue +mode and do not know what to do, then @pxref{VasEBoot only offers a rescue shell}. @menu @@ -3643,8 +3643,8 @@ These commands can only be used in the menu: [@option{--class=class} @dots{}] [@option{--users=users}] @ [@option{--unrestricted}] [@option{--hotkey=key}] [@option{--id=id}] @ [@var{arg} @dots{}] @{ @var{command}; @dots{} @} -This defines a GRUB menu entry named @var{title}. When this entry is -selected from the menu, GRUB will set the @var{chosen} environment variable +This defines a VasEBoot menu entry named @var{title}. When this entry is +selected from the menu, VasEBoot will set the @var{chosen} environment variable to value of @option{--id} if @option{--id} is given, execute the list of commands given within braces, and if the last command in the list returned successfully and a kernel was loaded it will execute the @command{boot} command. @@ -3733,7 +3733,7 @@ List or select an input terminal. With no arguments, list the active and available input terminals. With @option{--append}, add the named terminals to the list of active input -terminals; any of these may be used to provide input to GRUB. +terminals; any of these may be used to provide input to VasEBoot. With @option{--remove}, remove the named terminals from the active list. @@ -3752,7 +3752,7 @@ List or select an output terminal. With no arguments, list the active and available output terminals. With @option{--append}, add the named terminals to the list of active output -terminals; all of these will receive output from GRUB. +terminals; all of these will receive output from VasEBoot. With @option{--remove}, remove the named terminals from the active list. @@ -3771,7 +3771,7 @@ environment variable in Unix. The currently available terminal types are @samp{vt100}, @samp{vt100-color}, @samp{ieee1275}, and @samp{dumb}. If you need other terminal types, please -contact us to discuss the best way to include support for these in GRUB. +contact us to discuss the best way to include support for these in VasEBoot. The @option{-a} (@option{--ascii}), @option{-u} (@option{--utf8}), and @option{-v} (@option{--visual-utf8}) options control how non-ASCII text is @@ -3818,7 +3818,7 @@ you forget a command, you can run the command @command{help} * distrust:: Remove a pubkey from trusted keys * drivemap:: Map a drive to another * echo:: Display a line of text -* eval:: Evaluate agruments as GRUB commands +* eval:: Evaluate agruments as VasEBoot commands * export:: Export an environment variable * false:: Do nothing, unsuccessfully * gettext:: Translate a string @@ -3907,7 +3907,7 @@ systems, and it may be necessary to replace some of them. Normally, this command will replace the Root System Description Pointer (RSDP) in the Extended BIOS Data Area to point to the new tables. If the @option{--no-ebda} option is used, the new tables will be known only to -GRUB, but may be used by GRUB's EFI emulation. +VasEBoot, but may be used by VasEBoot's EFI emulation. @end deffn @@ -3955,8 +3955,8 @@ Filter out bad RAM. This command notifies the memory manager that specified regions of RAM ought to be filtered out (usually, because they're damaged). This -remains in effect after a payload kernel has been loaded by GRUB, as -long as the loaded kernel obtains its memory map from GRUB. Kernels that +remains in effect after a payload kernel has been loaded by VasEBoot, as +long as the loaded kernel obtains its memory map from VasEBoot. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general. @@ -3994,7 +3994,7 @@ Display the contents of the file @var{file}. This command may be useful to remind you of your OS's root partition: @example -grub> @kbd{cat /etc/fstab} +VasEBoot> @kbd{cat /etc/fstab} @end example If the @option{--dos} option is used, then carriage return / new line pairs @@ -4118,12 +4118,12 @@ Alias for @code{hashsum --hash crc32 arg @dots{}}. See command @command{hashsum} @deffn Command cryptomount device|@option{-u} uuid|@option{-a}|@option{-b} Setup access to encrypted device. If necessary, passphrase -is requested interactively. Option @var{device} configures specific grub device +is requested interactively. Option @var{device} configures specific VasEBoot device (@pxref{Naming convention}); option @option{-u} @var{uuid} configures device with specified @var{uuid}; option @option{-a} configures all detected encrypted devices; option @option{-b} configures all geli containers that have boot flag set. -GRUB suports devices encrypted using LUKS and geli. Note that necessary modules (@var{luks} and @var{geli}) have to be loaded manually before this command can +VasEBoot suports devices encrypted using LUKS and geli. Note that necessary modules (@var{luks} and @var{geli}) have to be loaded manually before this command can be used. @end deffn @@ -4155,10 +4155,10 @@ but rather replaces it completely. @subsection distrust @deffn Command distrust pubkey_id -Remove public key @var{pubkey_id} from GRUB's keyring of trusted keys. +Remove public key @var{pubkey_id} from VasEBoot's keyring of trusted keys. @var{pubkey_id} is the last four bytes (eight hexadecimal digits) of the GPG v4 key id, which is also the output of @command{list_trusted} -(@pxref{list_trusted}). Outside of GRUB, the key id can be obtained +(@pxref{list_trusted}). Outside of VasEBoot, the key id can be obtained using @code{gpg --fingerprint}). These keys are used to validate signatures when environment variable @code{check_signatures} is set to @code{enforce} @@ -4199,7 +4199,7 @@ drivemap -s (hd0) (hd1) @deffn Command echo [@option{-n}] [@option{-e}] string @dots{} Display the requested text and, unless the @option{-n} option is used, a trailing new line. If there is more than one string, they are separated by -spaces in the output. As usual in GRUB commands, variables may be +spaces in the output. As usual in VasEBoot commands, variables may be substituted using @samp{$@{var@}}. The @option{-e} option enables interpretation of backslash escapes. The @@ -4241,7 +4241,7 @@ character will print that character. @deffn Command eval string ... Concatenate arguments together using single space as separator and evaluate -result as sequence of GRUB commands. +result as sequence of VasEBoot commands. @end deffn @@ -4269,9 +4269,9 @@ such as @code{if} and @code{while} (@pxref{Shell-like scripting}). @deffn Command gettext string Translate @var{string} into the current language. -The current language code is stored in the @samp{lang} variable in GRUB's +The current language code is stored in the @samp{lang} variable in VasEBoot's environment (@pxref{lang}). Translation files in MO format are read from -@samp{locale_dir} (@pxref{locale_dir}), usually @file{/boot/grub/locale}. +@samp{locale_dir} (@pxref{locale_dir}), usually @file{/boot/VasEBoot/locale}. @end deffn @@ -4370,7 +4370,7 @@ This command is only available on x86 systems. @subsection insmod @deffn Command insmod module -Insert the dynamic GRUB module called @var{module}. +Insert the dynamic VasEBoot module called @var{module}. @end deffn @@ -4398,9 +4398,9 @@ after using this command (@pxref{initrd}). On x86 systems, the kernel will be booted using the 32-bit boot protocol. Note that this means that the @samp{vga=} boot option will not work; if you -want to set a special video mode, you will need to use GRUB commands such as +want to set a special video mode, you will need to use VasEBoot commands such as @samp{set gfxpayload=1024x768} or @samp{set gfxpayload=keep} (to keep the -same mode as used in GRUB) instead. GRUB can automatically detect some uses +same mode as used in VasEBoot) instead. VasEBoot can automatically detect some uses of @samp{vga=} and translate them to appropriate settings of @samp{gfxpayload}. The @command{linux16} command (@pxref{linux16}) avoids this restriction. @@ -4438,7 +4438,7 @@ environment block. @subsection list_trusted @deffn Command list_trusted -List all public keys trusted by GRUB for validating signatures. +List all public keys trusted by VasEBoot for validating signatures. The output is in GPG's v4 key fingerprint format (i.e., the output of @code{gpg --fingerprint}). The least significant four bytes (last eight hexadecimal digits) can be used as an argument to @@ -4516,7 +4516,7 @@ command. @deffn Command ls [arg @dots{}] List devices or files. -With no arguments, print all devices known to GRUB. +With no arguments, print all devices known to VasEBoot. If the argument is a device name enclosed in parentheses (@pxref{Device syntax}), then print the name of the filesystem of that device. @@ -4567,8 +4567,8 @@ be reloaded after using this command (@pxref{module}). Some kernels have known problems. You need to specify --quirk-* for those. --quirk-bad-kludge is a problem seen in several products that they include -loading kludge information with invalid data in ELF file. GRUB prior to 0.97 -and some custom builds prefered ELF information while 0.97 and GRUB 2 +loading kludge information with invalid data in ELF file. VasEBoot prior to 0.97 +and some custom builds prefered ELF information while 0.97 and VasEBoot 2 use kludge. Use this option to ignore kludge. Known affected systems: old Solaris, SkyOS. @@ -4593,14 +4593,14 @@ x86_64-efi. @subsection normal @deffn Command normal [file] -Enter normal mode and display the GRUB menu. +Enter normal mode and display the VasEBoot menu. In normal mode, commands, filesystem modules, and cryptography modules are -automatically loaded, and the full GRUB script parser is available. Other +automatically loaded, and the full VasEBoot script parser is available. Other modules may be explicitly loaded using @command{insmod} (@pxref{insmod}). If a @var{file} is given, then commands will be read from that file. -Otherwise, they will be read from @file{$prefix/grub.cfg} if it exists. +Otherwise, they will be read from @file{$prefix/VasEBoot.cfg} if it exists. @command{normal} may be called from within normal mode, creating a nested environment. It is more usual to use @command{configfile} @@ -4666,7 +4666,7 @@ Define a user named @var{user} with password @var{clear-password}. @deffn Command password_pbkdf2 user hashed-password Define a user named @var{user} with password hash @var{hashed-password}. -Use @command{grub-mkpasswd-pbkdf2} (@pxref{Invoking grub-mkpasswd-pbkdf2}) +Use @command{VasEBoot-mkpasswd-pbkdf2} (@pxref{Invoking VasEBoot-mkpasswd-pbkdf2}) to generate password hashes. @xref{Security}. @end deffn @@ -4760,9 +4760,9 @@ block. This command will operate successfully even when environment variable @code{check_signatures} is set to @code{enforce} (@pxref{check_signatures}), since it writes to disk and does not alter -the behavior of GRUB based on any contents of disk that have been +the behavior of VasEBoot based on any contents of disk that have been read. It is possible to modify a digitally signed environment block -file from within GRUB using this command, such that its signature will +file from within VasEBoot using this command, such that its signature will no longer be valid on subsequent boots. Care should be taken in such advanced configurations to avoid rendering the system unbootable. @xref{Using digital signatures}, for more information. @@ -4932,7 +4932,7 @@ invocation has any effect. Since @command{sendkey} manipulates the BIOS keyboard buffer, it may cause hangs, reboots, or other misbehaviour on some systems. If the operating -system or boot loader that runs after GRUB uses its own keyboard driver +system or boot loader that runs after VasEBoot uses its own keyboard driver rather than the BIOS keyboard functions, then @command{sendkey} will have no effect. @@ -5150,7 +5150,7 @@ as @code{if} and @code{while} (@pxref{Shell-like scripting}). @subsection trust @deffn Command trust [@option{--skip-sig}] pubkey_file -Read public key from @var{pubkey_file} and add it to GRUB's internal +Read public key from @var{pubkey_file} and add it to VasEBoot's internal list of trusted public keys. These keys are used to validate digital signatures when environment variable @code{check_signatures} is set to @code{enforce}. Note that if @code{check_signatures} is set to @@ -5174,7 +5174,7 @@ Unset the environment variable @var{envvar}. @node uppermem @subsection uppermem -This command is not yet implemented for GRUB 2, although it is planned. +This command is not yet implemented for VasEBoot 2, although it is planned. @ignore @@ -5199,7 +5199,7 @@ Optionally, a specific public key to use can be specified using is set to @code{enforce}, then @var{pubkey_file} must itself be properly signed by an already-trusted key. An unsigned @var{pubkey_file} can be loaded by specifying @option{--skip-sig}. -If @var{pubkey_file} is omitted, then public keys from GRUB's trusted keys +If @var{pubkey_file} is omitted, then public keys from VasEBoot's trusted keys (@pxref{list_trusted}, @pxref{trust}, and @pxref{distrust}) are tried. @@ -5428,7 +5428,7 @@ is given, use default list of servers. @chapter Internationalisation @section Charset -GRUB uses UTF-8 internally other than in rendering where some GRUB-specific +VasEBoot uses UTF-8 internally other than in rendering where some VasEBoot-specific appropriate representation is used. All text files (including config) are assumed to be encoded in UTF-8. @@ -5443,13 +5443,13 @@ but as long as the charset used is superset of ASCII you should be able to access ASCII-named files. And it's recommended to configure your system to use UTF-8 to access the filesystem, convmv may help with migration. ISO9660 (plain) filenames are specified as being ASCII or being described with unspecified -escape sequences. GRUB assumes that the ISO9660 names are UTF-8 (since +escape sequences. VasEBoot assumes that the ISO9660 names are UTF-8 (since any ASCII is valid UTF-8). There are some old CD-ROMs which use CP437 in non-compliant way. You're still able to access files with names containing only ASCII characters on such filesystems though. You're also able to access any file if the filesystem contains valid Joliet (UTF-16) or RockRidge (UTF-8). -AFFS, SFS and HFS never use unicode and GRUB assumes them to be in Latin1, -Latin1 and MacRoman respectively. GRUB handles filesystem case-insensitivity +AFFS, SFS and HFS never use unicode and VasEBoot assumes them to be in Latin1, +Latin1 and MacRoman respectively. VasEBoot handles filesystem case-insensitivity however no attempt is performed at case conversion of international characters so e.g. a file named lowercase greek alpha is treated as different from the one named as uppercase alpha. The filesystems in questions are @@ -5460,7 +5460,7 @@ and ZFS (configurable on per-subvolume basis by property ``casesensitivity'', default sensitive). On ZFS subvolumes marked as case insensitive files containing lowercase international characters are inaccessible. Also like all supported filesystems except HFS+ and ZFS (configurable on -per-subvolume basis by property ``normalization'', default none) GRUB makes +per-subvolume basis by property ``normalization'', default none) VasEBoot makes no attempt at check of canonical equivalence so a file name u-diaresis is treated as distinct from u+combining diaresis. This however means that in order to access file on HFS+ its name must be specified in normalisation form D. @@ -5483,19 +5483,19 @@ either ASCII, UTF-8 or ``visual UTF-8''. Last one is against the specification but results in correct rendering of right-to-left on some readers which don't have own bidi implementation. -On emu GRUB checks if charset is UTF-8 and uses it if so and uses ASCII +On emu VasEBoot checks if charset is UTF-8 and uses it if so and uses ASCII otherwise. -When using gfxterm or gfxmenu GRUB itself is responsible for rendering the -text. In this case GRUB is limited by loaded fonts. If fonts contain all +When using gfxterm or gfxmenu VasEBoot itself is responsible for rendering the +text. In this case VasEBoot is limited by loaded fonts. If fonts contain all required characters then bidirectional text, cursive variants and combining marks other than enclosing, half (e.g. left half tilde or combining overline) and double ones. Ligatures aren't supported though. This should cover European, Middle Eastern (if you don't mind lack of lam-alif ligature in Arabic) and East Asian scripts. Notable unsupported scripts are Brahmic family and derived as well as Mongolian, Tifinagh, Korean Jamo (precomposed characters -have no problem) and tonal writing (2e5-2e9). GRUB also ignores deprecated -(as specified in Unicode) characters (e.g. tags). GRUB also doesn't handle so +have no problem) and tonal writing (2e5-2e9). VasEBoot also ignores deprecated +(as specified in Unicode) characters (e.g. tags). VasEBoot also doesn't handle so called ``annotation characters'' If you can complete either of two lists or, better, propose a patch to improve rendering, please contact developer team. @@ -5511,7 +5511,7 @@ In practice it makes difficult to enter any text using non-Latin alphabet. Moreover all current input consumers are limited to ASCII. @section Gettext -GRUB supports being translated. For this you need to have language *.mo files in $prefix/locale, load gettext module and set ``lang'' variable. +VasEBoot supports being translated. For this you need to have language *.mo files in $prefix/locale, load gettext module and set ``lang'' variable. @section Regexp Regexps work on unicode characters, however no attempt at checking cannonical @@ -5519,9 +5519,9 @@ equivalence has been made. Moreover the classes like [:alpha:] match only ASCII subset. @section Other -Currently GRUB always uses YEAR-MONTH-DAY HOUR:MINUTE:SECOND [WEEKDAY] 24-hour +Currently VasEBoot always uses YEAR-MONTH-DAY HOUR:MINUTE:SECOND [WEEKDAY] 24-hour datetime format but weekdays are translated. -GRUB always uses the decimal number format with [0-9] as digits and . as +VasEBoot always uses the decimal number format with [0-9] as digits and . as descimal separator and no group separator. IEEE1275 aliases are matched case-insensitively except non-ASCII which is matched as binary. Similar behaviour is for matching OSBundleRequired. @@ -5529,7 +5529,7 @@ Since IEEE1275 aliases and OSBundleRequired don't contain any non-ASCII it should never be a problem in practice. Case-sensitive identifiers are matched as raw strings, no canonical equivalence check is performed. Case-insenstive identifiers are matched -as RAW but additionally [a-z] is equivalent to [A-Z]. GRUB-defined +as RAW but additionally [a-z] is equivalent to [A-Z]. VasEBoot-defined identifiers use only ASCII and so should user-defined ones. Identifiers containing non-ASCII may work but aren't supported. Only the ASCII space characters (space U+0020, tab U+000b, CR U+000d and @@ -5549,11 +5549,11 @@ environment variables and commands are listed in the same order. @end menu @node Authentication and authorisation -@section Authentication and authorisation in GRUB +@section Authentication and authorisation in VasEBoot By default, the boot loader interface is accessible to anyone with physical access to the console: anyone can select and edit any menu entry, and anyone -can get direct access to a GRUB shell prompt. For most systems, this is +can get direct access to a VasEBoot shell prompt. For most systems, this is reasonable since anyone with direct physical access has a variety of other ways to gain full access, and requiring authentication at the boot loader level would only serve to make it difficult to recover broken systems. @@ -5565,15 +5565,15 @@ operations. The @samp{password} (@pxref{password}) and @samp{password_pbkdf2} (@pxref{password_pbkdf2}) commands can be used to define users, each of which has an associated password. @samp{password} sets the password in -plain text, requiring @file{grub.cfg} to be secure; @samp{password_pbkdf2} +plain text, requiring @file{VasEBoot.cfg} to be secure; @samp{password_pbkdf2} sets the password hashed using the Password-Based Key Derivation Function -(RFC 2898), requiring the use of @command{grub-mkpasswd-pbkdf2} -(@pxref{Invoking grub-mkpasswd-pbkdf2}) to generate password hashes. +(RFC 2898), requiring the use of @command{VasEBoot-mkpasswd-pbkdf2} +(@pxref{Invoking VasEBoot-mkpasswd-pbkdf2}) to generate password hashes. In order to enable authentication support, the @samp{superusers} environment variable must be set to a list of usernames, separated by any of spaces, commas, semicolons, pipes, or ampersands. Superusers are permitted to use -the GRUB command line, edit menu entries, and execute any menu entry. If +the VasEBoot command line, edit menu entries, and execute any menu entry. If @samp{superusers} is set, then use of the command line and editing of menu entries are automatically restricted to superusers. Setting @samp{superusers} to empty string effectively disables both access to CLI and editing of menu @@ -5586,13 +5586,13 @@ option is used for a menu entry, then that entry is unrestricted. If the @option{--users} option is not used for a menu entry, then that only superusers are able to use it. -Putting this together, a typical @file{grub.cfg} fragment might look like +Putting this together, a typical @file{VasEBoot.cfg} fragment might look like this: @example @group set superusers="root" -password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring +password_pbkdf2 root VasEBoot.pbkdf2.sha512.10000.biglongstring password user1 insecure menuentry "May be run by any user" --unrestricted @{ @@ -5612,42 +5612,42 @@ menuentry "May be run by user1 or a superuser" --users user1 @{ @end group @end example -The @command{grub-mkconfig} program does not yet have built-in support for +The @command{VasEBoot-mkconfig} program does not yet have built-in support for generating configuration files with authentication. You can use -@file{/etc/grub.d/40_custom} to add simple superuser authentication, by +@file{/etc/VasEBoot.d/40_custom} to add simple superuser authentication, by adding @kbd{set superusers=} and @kbd{password} or @kbd{password_pbkdf2} commands. @node Using digital signatures -@section Using digital signatures in GRUB +@section Using digital signatures in VasEBoot -GRUB's @file{core.img} can optionally provide enforcement that all files +VasEBoot's @file{core.img} can optionally provide enforcement that all files subsequently read from disk are covered by a valid digital signature. This document does @strong{not} cover how to ensure that your platform's firmware (e.g., Coreboot) validates @file{core.img}. If environment variable @code{check_signatures} (@pxref{check_signatures}) is set to @code{enforce}, then every -attempt by the GRUB @file{core.img} to load another file @file{foo} +attempt by the VasEBoot @file{core.img} to load another file @file{foo} implicitly invokes @code{verify_detached foo foo.sig} (@pxref{verify_detached}). @code{foo.sig} must contain a valid digital signature over the contents of @code{foo}, which can be -verified with a public key currently trusted by GRUB +verified with a public key currently trusted by VasEBoot (@pxref{list_trusted}, @pxref{trust}, and @pxref{distrust}). If validation fails, then file @file{foo} cannot be opened. This failure may halt or otherwise impact the boot process. -@comment Unfortunately --pubkey is not yet supported by grub-install, -@comment but we should not bring up internal detail grub-mkimage here +@comment Unfortunately --pubkey is not yet supported by VasEBoot-install, +@comment but we should not bring up internal detail VasEBoot-mkimage here @comment in the user guide (as opposed to developer's manual). -@comment An initial trusted public key can be embedded within the GRUB +@comment An initial trusted public key can be embedded within the VasEBoot @comment @file{core.img} using the @code{--pubkey} option to -@comment @command{grub-mkimage} (@pxref{Invoking grub-install}). Presently it -@comment is necessary to write a custom wrapper around @command{grub-mkimage} -@comment using the @code{--grub-mkimage} flag to @command{grub-install}. +@comment @command{VasEBoot-mkimage} (@pxref{Invoking VasEBoot-install}). Presently it +@comment is necessary to write a custom wrapper around @command{VasEBoot-mkimage} +@comment using the @code{--VasEBoot-mkimage} flag to @command{VasEBoot-install}. -GRUB uses GPG-style detached signatures (meaning that a file +VasEBoot uses GPG-style detached signatures (meaning that a file @file{foo.sig} will be produced when file @file{foo} is signed), and currently supports the DSA and RSA signing algorithms. A signing key can be generated as follows: @@ -5662,18 +5662,18 @@ An individual file can be signed as follows: gpg --detach-sign /path/to/file @end example -For successful validation of all of GRUB's subcomponents and the +For successful validation of all of VasEBoot's subcomponents and the loaded OS kernel, they must all be signed. One way to accomplish this is the following (after having already produced the desired -@file{grub.cfg} file, e.g., by running @command{grub-mkconfig} -(@pxref{Invoking grub-mkconfig}): +@file{VasEBoot.cfg} file, e.g., by running @command{VasEBoot-mkconfig} +(@pxref{Invoking VasEBoot-mkconfig}): @example @group # Edit /dev/shm/passphrase.txt to contain your signing key's passphrase for i in `find /boot -name "*.cfg" -or -name "*.lst" -or \ -name "*.mod" -or -name "vmlinuz*" -or -name "initrd*" -or \ - -name "grubenv"`; + -name "VasEBootenv"`; do gpg --batch --detach-sign --passphrase-fd 0 $i < \ /dev/shm/passphrase.txt @@ -5688,30 +5688,30 @@ See also: @ref{check_signatures}, @ref{verify_detached}, @ref{trust}, Note that internally signature enforcement is controlled by setting the environment variable @code{check_signatures} equal to @code{enforce}. Passing one or more @code{--pubkey} options to -@command{grub-mkimage} implicitly defines @code{check_signatures} +@command{VasEBoot-mkimage} implicitly defines @code{check_signatures} equal to @code{enforce} in @file{core.img} prior to processing any configuration files. Note that signature checking does @strong{not} prevent an attacker with (serial, physical, ...) console access from dropping manually to -the GRUB console and executing: +the VasEBoot console and executing: @example set check_signatures=no @end example To prevent this, password-protection (@pxref{Authentication and -authorisation}) is essential. Note that even with GRUB password -protection, GRUB itself cannot prevent someone with physical access to +authorisation}) is essential. Note that even with VasEBoot password +protection, VasEBoot itself cannot prevent someone with physical access to the machine from altering that machine's firmware (e.g., Coreboot or BIOS) configuration to cause the machine to boot from a different -(attacker-controlled) device. GRUB is at best only one link in a +(attacker-controlled) device. VasEBoot is at best only one link in a secure boot chain. @node Platform limitations @chapter Platform limitations -GRUB2 is designed to be portable and is actually ported across platforms. We +VasEBoot2 is designed to be portable and is actually ported across platforms. We try to keep all platforms at the level. Unfortunately some platforms are better supported than others. This is detailed in current and 2 following sections. @@ -5728,13 +5728,13 @@ and coreboot ports the refered console is vga_text. Loongson always uses gfxterm. Most limited one is ASCII. CP437 provides additionally pseudographics. -GRUB2 doesn't use any language characters from CP437 as often CP437 is replaced +VasEBoot2 doesn't use any language characters from CP437 as often CP437 is replaced by national encoding compatible only in pseudographics. Unicode is the most versatile charset which supports many languages. However the actual console may be much more limited depending on firmware On BIOS network is supported only if the image is loaded through network. -On sparc64 GRUB is unable to determine which server it was booted from. +On sparc64 VasEBoot is unable to determine which server it was booted from. Direct ATA/AHCI support allows to circumvent various firmware limitations but isn't needed for normal operation except on baremetal ports. @@ -5759,13 +5759,13 @@ BadRAM is the ability to mark some of the RAM as ``bad''. Note: due to protocol limitations mips-loongson (with Linux protocol) and mips-qemu_mips can use only memory up to first hole. -Bootlocation is ability of GRUB to automatically detect where it boots from. +Bootlocation is ability of VasEBoot to automatically detect where it boots from. ``disk'' means the detection is limited to detecting the disk with partition being discovered on install time. ``partition'' means that disk and partiton can be automatically discovered. ``file'' means that boot image file name as well as disk and partition can be discovered. For consistency default install ignores partition and relies solely on disk detection. If no bootlocation discovery is available -or boot and grub-root disks are different, UUID is used instead. On ARC if no device +or boot and VasEBoot-root disks are different, UUID is used instead. On ARC if no device to install to is specified, UUID is used instead as well. @@ -5888,7 +5888,7 @@ Miscelaneous: @node Supported kernels @chapter Supported boot targets -X86 support is summarised in the following table. ``Yes'' means that the kernel works on the given platform, ``crashes'' means an early kernel crash which we hope will be fixed by concerned kernel developers. ``no'' means GRUB doesn't load the given kernel on a given platform. ``headless'' means that the kernel works but lacks console drivers (you can still use serial or network console). In case of ``no'' and ``crashes'' the reason is given in footnote. +X86 support is summarised in the following table. ``Yes'' means that the kernel works on the given platform, ``crashes'' means an early kernel crash which we hope will be fixed by concerned kernel developers. ``no'' means VasEBoot doesn't load the given kernel on a given platform. ``headless'' means that the kernel works but lacks console drivers (you can still use serial or network console). In case of ``no'' and ``crashes'' the reason is given in footnote. @multitable @columnfractions .50 .22 .22 @item @tab BIOS @tab Coreboot @item BIOS chainloading @tab yes @tab no (1) @@ -6011,10 +6011,10 @@ As you have seen in previous chapter the support matrix is pretty big and some o Following variables must be defined: @multitable @columnfractions .30 .65 -@item GRUB_PAYLOADS_DIR @tab directory containing the required kernels -@item GRUB_CBFSTOOL @tab cbfstool from Coreboot package (for coreboot platform only) -@item GRUB_COREBOOT_ROM @tab empty Coreboot ROM -@item GRUB_QEMU_OPTS @tab additional options to be supplied to QEMU +@item VasEBoot_PAYLOADS_DIR @tab directory containing the required kernels +@item VasEBoot_CBFSTOOL @tab cbfstool from Coreboot package (for coreboot platform only) +@item VasEBoot_COREBOOT_ROM @tab empty Coreboot ROM +@item VasEBoot_QEMU_OPTS @tab additional options to be supplied to QEMU @end multitable Required files are: @@ -6033,29 +6033,29 @@ Required files are: @end multitable @node Troubleshooting -@chapter Error messages produced by GRUB +@chapter Error messages produced by VasEBoot @menu -* GRUB only offers a rescue shell:: +* VasEBoot only offers a rescue shell:: @end menu -@node GRUB only offers a rescue shell -@section GRUB only offers a rescue shell +@node VasEBoot only offers a rescue shell +@section VasEBoot only offers a rescue shell -GRUB's normal start-up procedure involves setting the @samp{prefix} +VasEBoot's normal start-up procedure involves setting the @samp{prefix} environment variable to a value set in the core image by -@command{grub-install}, setting the @samp{root} variable to match, loading +@command{VasEBoot-install}, setting the @samp{root} variable to match, loading the @samp{normal} module from the prefix, and running the @samp{normal} command (@pxref{normal}). This command is responsible for reading -@file{/boot/grub/grub.cfg}, running the menu, and doing all the useful -things GRUB is supposed to do. +@file{/boot/VasEBoot/VasEBoot.cfg}, running the menu, and doing all the useful +things VasEBoot is supposed to do. -If, instead, you only get a rescue shell, this usually means that GRUB +If, instead, you only get a rescue shell, this usually means that VasEBoot failed to load the @samp{normal} module for some reason. It may be possible to work around this temporarily: for instance, if the reason for the failure is that @samp{prefix} is wrong (perhaps it refers to the wrong device, or -perhaps the path to @file{/boot/grub} was not correctly made relative to the +perhaps the path to @file{/boot/VasEBoot} was not correctly made relative to the device), then you can correct this and enter normal mode manually: @example @@ -6065,7 +6065,7 @@ set # Find out which devices are available: ls # Set to the correct value, which might be something like this: -set prefix=(hd0,1)/grub +set prefix=(hd0,1)/VasEBoot set root=(hd0,1) insmod normal normal @@ -6073,9 +6073,9 @@ normal @end example However, any problem that leaves you in the rescue shell probably means that -GRUB was not correctly installed. It may be more useful to try to reinstall -it properly using @kbd{grub-install @var{device}} (@pxref{Invoking -grub-install}). When doing this, there are a few things to remember: +VasEBoot was not correctly installed. It may be more useful to try to reinstall +it properly using @kbd{VasEBoot-install @var{device}} (@pxref{Invoking +VasEBoot-install}). When doing this, there are a few things to remember: @itemize @bullet{} @item @@ -6087,63 +6087,63 @@ is usually better to use UUIDs or file system labels and avoid depending on drive ordering entirely. @item -At least on BIOS systems, if you tell @command{grub-install} to install GRUB -to a partition but GRUB has already been installed in the master boot -record, then the GRUB installation in the partition will be ignored. +At least on BIOS systems, if you tell @command{VasEBoot-install} to install VasEBoot +to a partition but VasEBoot has already been installed in the master boot +record, then the VasEBoot installation in the partition will be ignored. @item -If possible, it is generally best to avoid installing GRUB to a partition -(unless it is a special partition for the use of GRUB alone, such as the -BIOS Boot Partition used on GPT). Doing this means that GRUB may stop being +If possible, it is generally best to avoid installing VasEBoot to a partition +(unless it is a special partition for the use of VasEBoot alone, such as the +BIOS Boot Partition used on GPT). Doing this means that VasEBoot may stop being able to read its core image due to a file system moving blocks around, such as while defragmenting, running checks, or even during normal operation. Installing to the whole disk device is normally more robust. @item -Check that GRUB actually knows how to read from the device and file system -containing @file{/boot/grub}. It will not be able to read from encrypted +Check that VasEBoot actually knows how to read from the device and file system +containing @file{/boot/VasEBoot}. It will not be able to read from encrypted devices with unsupported encryption scheme, nor from file systems for which -support has not yet been added to GRUB. +support has not yet been added to VasEBoot. @end itemize -@node Invoking grub-install -@chapter Invoking grub-install +@node Invoking VasEBoot-install +@chapter Invoking VasEBoot-install -The program @command{grub-install} generates a GRUB core image using -@command{grub-mkimage} and installs it on your system. You must specify the -device name on which you want to install GRUB, like this: +The program @command{VasEBoot-install} generates a VasEBoot core image using +@command{VasEBoot-mkimage} and installs it on your system. You must specify the +device name on which you want to install VasEBoot, like this: @example -grub-install @var{install_device} +VasEBoot-install @var{install_device} @end example -The device name @var{install_device} is an OS device name or a GRUB +The device name @var{install_device} is an OS device name or a VasEBoot device name. -@command{grub-install} accepts the following options: +@command{VasEBoot-install} accepts the following options: @table @option @item --help Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @item --boot-directory=@var{dir} -Install GRUB images under the directory @file{@var{dir}/grub/} -This option is useful when you want to install GRUB into a +Install VasEBoot images under the directory @file{@var{dir}/VasEBoot/} +This option is useful when you want to install VasEBoot into a separate partition or a removable disk. If this option is not specified then it defaults to @file{/boot}, so @example -@kbd{grub-install /dev/sda} +@kbd{VasEBoot-install /dev/sda} @end example is equivalent to @example -@kbd{grub-install --boot-directory=/boot/ /dev/sda} +@kbd{VasEBoot-install --boot-directory=/boot/ /dev/sda} @end example Here is an example in which you have a separate @dfn{boot} partition which is @@ -6151,46 +6151,46 @@ mounted on @file{/mnt/boot}: @example -@kbd{grub-install --boot-directory=/mnt/boot /dev/sdb} +@kbd{VasEBoot-install --boot-directory=/mnt/boot /dev/sdb} @end example @item --recheck -Recheck the device map, even if @file{/boot/grub/device.map} already +Recheck the device map, even if @file{/boot/VasEBoot/device.map} already exists. You should use this option whenever you add/remove a disk into/from your computer. @item --no-rs-codes -By default on x86 BIOS systems, @command{grub-install} will use some +By default on x86 BIOS systems, @command{VasEBoot-install} will use some extra space in the bootloader embedding area for Reed-Solomon -error-correcting codes. This enables GRUB to still boot successfully +error-correcting codes. This enables VasEBoot to still boot successfully if some blocks are corrupted. The exact amount of protection offered is dependent on available space in the embedding area. R sectors of redundancy can tolerate up to R/2 corrupted sectors. This redundancy may be cumbersome if attempting to cryptographically validate the contents of the bootloader embedding area, or in more modern systems with GPT-style partition tables (@pxref{BIOS -installation}) where GRUB does not reside in any unpartitioned space +installation}) where VasEBoot does not reside in any unpartitioned space outside of the MBR. Disable the Reed-Solomon codes with this option. @end table -@node Invoking grub-mkconfig -@chapter Invoking grub-mkconfig +@node Invoking VasEBoot-mkconfig +@chapter Invoking VasEBoot-mkconfig -The program @command{grub-mkconfig} generates a configuration file for GRUB +The program @command{VasEBoot-mkconfig} generates a configuration file for VasEBoot (@pxref{Simple configuration}). @example -grub-mkconfig -o /boot/grub/grub.cfg +VasEBoot-mkconfig -o /boot/VasEBoot/VasEBoot.cfg @end example -@command{grub-mkconfig} accepts the following options: +@command{VasEBoot-mkconfig} accepts the following options: @table @option @item --help Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @item -o @var{file} @itemx --output=@var{file} @@ -6199,17 +6199,17 @@ it to standard output. @end table -@node Invoking grub-mkpasswd-pbkdf2 -@chapter Invoking grub-mkpasswd-pbkdf2 +@node Invoking VasEBoot-mkpasswd-pbkdf2 +@chapter Invoking VasEBoot-mkpasswd-pbkdf2 -The program @command{grub-mkpasswd-pbkdf2} generates password hashes for -GRUB (@pxref{Security}). +The program @command{VasEBoot-mkpasswd-pbkdf2} generates password hashes for +VasEBoot (@pxref{Security}). @example -grub-mkpasswd-pbkdf2 +VasEBoot-mkpasswd-pbkdf2 @end example -@command{grub-mkpasswd-pbkdf2} accepts the following options: +@command{VasEBoot-mkpasswd-pbkdf2} accepts the following options: @table @option @item -c @var{number} @@ -6227,44 +6227,44 @@ Length of the salt. Defaults to 64. @end table -@node Invoking grub-mkrelpath -@chapter Invoking grub-mkrelpath +@node Invoking VasEBoot-mkrelpath +@chapter Invoking VasEBoot-mkrelpath -The program @command{grub-mkrelpath} makes a file system path relative to +The program @command{VasEBoot-mkrelpath} makes a file system path relative to the root of its containing file system. For instance, if @file{/usr} is a mount point, then: @example -$ @kbd{grub-mkrelpath /usr/share/grub/unicode.pf2} -@samp{/share/grub/unicode.pf2} +$ @kbd{VasEBoot-mkrelpath /usr/share/VasEBoot/unicode.pf2} +@samp{/share/VasEBoot/unicode.pf2} @end example -This is mainly used internally by other GRUB utilities such as -@command{grub-mkconfig} (@pxref{Invoking grub-mkconfig}), but may +This is mainly used internally by other VasEBoot utilities such as +@command{VasEBoot-mkconfig} (@pxref{Invoking VasEBoot-mkconfig}), but may occasionally also be useful for debugging. -@command{grub-mkrelpath} accepts the following options: +@command{VasEBoot-mkrelpath} accepts the following options: @table @option @item --help Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @end table -@node Invoking grub-mkrescue -@chapter Invoking grub-mkrescue +@node Invoking VasEBoot-mkrescue +@chapter Invoking VasEBoot-mkrescue -The program @command{grub-mkrescue} generates a bootable GRUB rescue image -(@pxref{Making a GRUB bootable CD-ROM}). +The program @command{VasEBoot-mkrescue} generates a bootable VasEBoot rescue image +(@pxref{Making a VasEBoot bootable CD-ROM}). @example -grub-mkrescue -o grub.iso +VasEBoot-mkrescue -o VasEBoot.iso @end example -All arguments not explicitly listed as @command{grub-mkrescue} options are +All arguments not explicitly listed as @command{VasEBoot-mkrescue} options are passed on directly to @command{xorriso} in @command{mkisofs} emulation mode. Options passed to @command{xorriso} will normally be interpreted as @command{mkisofs} options; if the option @samp{--} is used, then anything @@ -6274,26 +6274,26 @@ Non-option arguments specify additional source directories. This is commonly used to add extra files to the image: @example -mkdir -p disk/boot/grub -@r{(add extra files to @file{disk/boot/grub})} -grub-mkrescue -o grub.iso disk +mkdir -p disk/boot/VasEBoot +@r{(add extra files to @file{disk/boot/VasEBoot})} +VasEBoot-mkrescue -o VasEBoot.iso disk @end example -@command{grub-mkrescue} accepts the following options: +@command{VasEBoot-mkrescue} accepts the following options: @table @option @item --help Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @item -o @var{file} @itemx --output=@var{file} Save output in @var{file}. This "option" is required. @item --modules=@var{modules} -Pre-load the named GRUB modules in the image. Multiple entries in +Pre-load the named VasEBoot modules in the image. Multiple entries in @var{modules} should be separated by whitespace (so you will probably need to quote this for your shell). @@ -6306,23 +6306,23 @@ directory as well as including them in the image. Use @var{file} as the @command{xorriso} program, rather than the built-in default. -@item --grub-mkimage=@var{file} -Use @var{file} as the @command{grub-mkimage} program, rather than the +@item --VasEBoot-mkimage=@var{file} +Use @var{file} as the @command{VasEBoot-mkimage} program, rather than the built-in default. @end table -@node Invoking grub-mount -@chapter Invoking grub-mount +@node Invoking VasEBoot-mount +@chapter Invoking VasEBoot-mount -The program @command{grub-mount} performs a read-only mount of any file -system or file system image that GRUB understands, using GRUB's file system +The program @command{VasEBoot-mount} performs a read-only mount of any file +system or file system image that VasEBoot understands, using VasEBoot's file system drivers via FUSE. (It is only available if FUSE development files were -present when GRUB was built.) This has a number of uses: +present when VasEBoot was built.) This has a number of uses: @itemize @bullet @item -It provides a convenient way to check how GRUB will view a file system at +It provides a convenient way to check how VasEBoot will view a file system at boot time. You can use normal command-line tools to compare that view with that of your operating system, making it easy to find bugs. @@ -6330,30 +6330,30 @@ that of your operating system, making it easy to find bugs. It offers true read-only mounts. Linux does not have these for journalling file systems, because it will always attempt to replay the journal at mount time; while you can temporarily mark the block device read-only to avoid -this, that causes the mount to fail. Since GRUB intentionally contains no +this, that causes the mount to fail. Since VasEBoot intentionally contains no code for writing to file systems, it can easily provide a guaranteed read-only mount mechanism. @item -It allows you to examine any file system that GRUB understands without +It allows you to examine any file system that VasEBoot understands without needing to load additional modules into your running kernel, which may be useful in constrained environments such as installers. @item Since it can examine file system images (contained in regular files) just as easily as file systems on block devices, you can use it to inspect any file -system image that GRUB understands with only enough privileges to use FUSE, +system image that VasEBoot understands with only enough privileges to use FUSE, even if nobody has yet written a FUSE module specifically for that file system type. @end itemize -Using @command{grub-mount} is normally as simple as: +Using @command{VasEBoot-mount} is normally as simple as: @example -grub-mount /dev/sda1 /mnt +VasEBoot-mount /dev/sda1 /mnt @end example -@command{grub-mount} must be given one or more images and a mount point as +@command{VasEBoot-mount} must be given one or more images and a mount point as non-option arguments (if it is given more than one image, it will treat them as a RAID set), and also accepts the following options: @@ -6362,7 +6362,7 @@ as a RAID set), and also accepts the following options: Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @item -C @itemx --crypto @@ -6375,13 +6375,13 @@ Show debugging output for conditions matching @var{string}. @item -K prompt|@var{file} @itemx --zfs-key=prompt|@var{file} Load a ZFS encryption key. If you use @samp{prompt} as the argument, -@command{grub-mount} will read a passphrase from the terminal; otherwise, it +@command{VasEBoot-mount} will read a passphrase from the terminal; otherwise, it will read key material from the specified file. @item -r @var{device} @itemx --root=@var{device} -Set the GRUB root device to @var{device}. You do not normally need to set -this; @command{grub-mount} will automatically set the root device to the +Set the VasEBoot root device to @var{device}. You do not normally need to set +this; @command{VasEBoot-mount} will automatically set the root device to the root of the supplied file system. If @var{device} is just a number, then it will be treated as a partition @@ -6390,7 +6390,7 @@ an entire disk in @file{disk.img}, then you can use this command to mount its second partition: @example -grub-mount -r 2 disk.img mount-point +VasEBoot-mount -r 2 disk.img mount-point @end example @item -v @@ -6399,18 +6399,18 @@ Print verbose messages. @end table -@node Invoking grub-probe -@chapter Invoking grub-probe +@node Invoking VasEBoot-probe +@chapter Invoking VasEBoot-probe -The program @command{grub-probe} probes device information for a given path +The program @command{VasEBoot-probe} probes device information for a given path or device. @example -grub-probe --target=fs /boot/grub -grub-probe --target=drive --device /dev/sda1 +VasEBoot-probe --target=fs /boot/VasEBoot +VasEBoot-probe --target=drive --device /dev/sda1 @end example -@command{grub-probe} must be given a path or device as a non-option +@command{VasEBoot-probe} must be given a path or device as a non-option argument, and also accepts the following options: @table @option @@ -6418,21 +6418,21 @@ argument, and also accepts the following options: Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @item -d @itemx --device If this option is given, then the non-option argument is a system device -name (such as @samp{/dev/sda1}), and @command{grub-probe} will print +name (such as @samp{/dev/sda1}), and @command{VasEBoot-probe} will print information about that device. If it is not given, then the non-option -argument is a filesystem path (such as @samp{/boot/grub}), and -@command{grub-probe} will print information about the device containing that +argument is a filesystem path (such as @samp{/boot/VasEBoot}), and +@command{VasEBoot-probe} will print information about the device containing that part of the filesystem. @item -m @var{file} @itemx --device-map=@var{file} Use @var{file} as the device map (@pxref{Device map}) rather than the -default, usually @samp{/boot/grub/device.map}. +default, usually @samp{/boot/VasEBoot/device.map}. @item -t @var{target} @itemx --target=@var{target} @@ -6441,19 +6441,19 @@ The available targets and their meanings are: @table @samp @item fs -GRUB filesystem module. +VasEBoot filesystem module. @item fs_uuid Filesystem Universally Unique Identifier (UUID). @item fs_label Filesystem label. @item drive -GRUB device name. +VasEBoot device name. @item device System device name. @item partmap -GRUB partition map module. +VasEBoot partition map module. @item abstraction -GRUB abstraction module (e.g. @samp{lvm}). +VasEBoot abstraction module (e.g. @samp{lvm}). @item cryptodisk_uuid Crypto device UUID. @item msdos_parttype @@ -6473,7 +6473,7 @@ Search hints for the EFI platform. @item arc_hints Search hints for the ARC platform. @item compatibility_hint -A guess at a reasonable GRUB drive name for this device, which may be +A guess at a reasonable VasEBoot drive name for this device, which may be used as a fallback if the @command{search} command fails. @item disk System device name for the whole disk. @@ -6485,26 +6485,26 @@ Print verbose messages. @end table -@node Invoking grub-script-check -@chapter Invoking grub-script-check +@node Invoking VasEBoot-script-check +@chapter Invoking VasEBoot-script-check -The program @command{grub-script-check} takes a GRUB script file +The program @command{VasEBoot-script-check} takes a VasEBoot script file (@pxref{Shell-like scripting}) and checks it for syntax errors, similar to commands such as @command{sh -n}. It may take a @var{path} as a non-option argument; if none is supplied, it will read from standard input. @example -grub-script-check /boot/grub/grub.cfg +VasEBoot-script-check /boot/VasEBoot/VasEBoot.cfg @end example -@command{grub-script-check} accepts the following options: +@command{VasEBoot-script-check} accepts the following options: @table @option @item --help Print a summary of the command-line options and exit. @item --version -Print the version number of GRUB and exit. +Print the version number of VasEBoot and exit. @item -v @itemx --verbose @@ -6512,45 +6512,45 @@ Print each line of input after reading it. @end table -@node Obtaining and Building GRUB -@appendix How to obtain and build GRUB +@node Obtaining and Building VasEBoot +@appendix How to obtain and build VasEBoot @quotation -@strong{Caution:} GRUB requires binutils-2.9.1.0.23 or later because the +@strong{Caution:} VasEBoot requires binutils-2.9.1.0.23 or later because the GNU assembler has been changed so that it can produce real 16bits machine code between 2.9.1 and 2.9.1.0.x. See @uref{http://sources.redhat.com/binutils/}, to obtain information on how to get the latest version. @end quotation -GRUB is available from the GNU alpha archive site -@uref{ftp://ftp.gnu.org/gnu/grub} or any of its mirrors. The file -will be named grub-version.tar.gz. The current version is +VasEBoot is available from the GNU alpha archive site +@uref{ftp://ftp.gnu.org/gnu/VasEBoot} or any of its mirrors. The file +will be named VasEBoot-version.tar.gz. The current version is @value{VERSION}, so the file you should grab is: -@uref{ftp://ftp.gnu.org/gnu/grub/grub-@value{VERSION}.tar.gz} +@uref{ftp://ftp.gnu.org/gnu/VasEBoot/VasEBoot-@value{VERSION}.tar.gz} -To unbundle GRUB use the instruction: +To unbundle VasEBoot use the instruction: @example -@kbd{zcat grub-@value{VERSION}.tar.gz | tar xvf -} +@kbd{zcat VasEBoot-@value{VERSION}.tar.gz | tar xvf -} @end example -which will create a directory called @file{grub-@value{VERSION}} with +which will create a directory called @file{VasEBoot-@value{VERSION}} with all the sources. You can look at the file @file{INSTALL} for detailed -instructions on how to build and install GRUB, but you should be able to +instructions on how to build and install VasEBoot, but you should be able to just do: @example @group -@kbd{cd grub-@value{VERSION}} +@kbd{cd VasEBoot-@value{VERSION}} @kbd{./configure} @kbd{make install} @end group @end example Also, the latest version is available using Git. See -@uref{http://www.gnu.org/software/grub/grub-download.html} for more +@uref{http://www.gnu.org/software/VasEBoot/VasEBoot-download.html} for more information. @node Reporting bugs @@ -6562,17 +6562,17 @@ list below before you submit bugs: @enumerate @item Before getting unsettled, read this manual through and through. Also, -see the @uref{http://www.gnu.org/software/grub/grub-faq.html, GNU GRUB FAQ}. +see the @uref{http://www.gnu.org/software/VasEBoot/VasEBoot-faq.html, GNU VasEBoot FAQ}. @item -Always mention the information on your GRUB. The version number and the +Always mention the information on your VasEBoot. The version number and the configuration are quite important. If you build it yourself, write the options specified to the configure script and your operating system, including the versions of gcc and binutils. @item If you have trouble with the installation, inform us of how you -installed GRUB. Don't omit error messages, if any. Just @samp{GRUB hangs +installed VasEBoot. Don't omit error messages, if any. Just @samp{VasEBoot hangs up when it boots} is not enough. The information on your hardware is also essential. These are especially @@ -6580,16 +6580,16 @@ important: the geometries and the partition tables of your hard disk drives and your BIOS. @item -If GRUB cannot boot your operating system, write down +If VasEBoot cannot boot your operating system, write down @emph{everything} you see on the screen. Don't paraphrase them, like -@samp{The foo OS crashes with GRUB, even though it can boot with the +@samp{The foo OS crashes with VasEBoot, even though it can boot with the bar boot loader just fine}. Mention the commands you executed, the messages printed by them, and information on your operating system including the version number. @item Explain what you wanted to do. It is very useful to know your purpose -and your wish, and how GRUB didn't satisfy you. +and your wish, and how VasEBoot didn't satisfy you. @item If you can investigate the problem yourself, please do. That will give @@ -6612,22 +6612,22 @@ important. @end enumerate If you follow the guideline above, submit a report to the -@uref{http://savannah.gnu.org/bugs/?group=grub, Bug Tracking System}. +@uref{http://savannah.gnu.org/bugs/?group=VasEBoot, Bug Tracking System}. Alternatively, you can submit a report via electronic mail to -@email{bug-grub@@gnu.org}, but we strongly recommend that you use the +@email{bug-VasEBoot@@gnu.org}, but we strongly recommend that you use the Bug Tracking System, because e-mail can be passed over easily. Once we get your report, we will try to fix the bugs. @node Future -@appendix Where GRUB will go +@appendix Where VasEBoot will go -GRUB 2 is now quite stable and used in many production systems. We are +VasEBoot 2 is now quite stable and used in many production systems. We are currently working towards a 2.0 release. -If you are interested in the development of GRUB 2, take a look at -@uref{http://www.gnu.org/software/grub/grub.html, the homepage}. +If you are interested in the development of VasEBoot 2, take a look at +@uref{http://www.gnu.org/software/VasEBoot/VasEBoot.html, the homepage}. @@ -6654,6 +6654,6 @@ If you are interested in the development of GRUB 2, take a look at Some notes: - This is an attempt to make a manual for GRUB 2. The contents are - copied from the GRUB manual in GRUB Legacy, so they are not always - appropriate yet for GRUB 2. + This is an attempt to make a manual for VasEBoot 2. The contents are + copied from the VasEBoot manual in VasEBoot Legacy, so they are not always + appropriate yet for VasEBoot 2. diff --git a/docs/autoiso.cfg b/docs/autoiso.cfg index 9ce51c692..62569bdd2 100644 --- a/docs/autoiso.cfg +++ b/docs/autoiso.cfg @@ -1,19 +1,19 @@ -# Sample GRUB script to autodetect operating systems +# Sample VasEBoot script to autodetect operating systems # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . function pathname { regexp -s 2:"$2" '^(\(.*\))?(/.*)$' "$1"; } function devname { regexp -s "$2" '^(\(.*\)).*$' "$1"; } @@ -23,16 +23,16 @@ function loopback_iso_entry { isopath="$2" loopdev="$3" - if test -f /boot/grub/loopback.cfg; then - cfgpath=/boot/grub/loopback.cfg - elif test -f /grub/loopback.cfg; then - cfgpath=/grub/loopback.cfg + if test -f /boot/VasEBoot/loopback.cfg; then + cfgpath=/boot/VasEBoot/loopback.cfg + elif test -f /VasEBoot/loopback.cfg; then + cfgpath=/VasEBoot/loopback.cfg else return 1; fi echo loopback.cfg $isopath: yes - menuentry "Boot GRUB Loopback Config from ${realdev}${isopath}" "$realdev" "$isopath" "$cfgpath" { + menuentry "Boot VasEBoot Loopback Config from ${realdev}${isopath}" "$realdev" "$isopath" "$cfgpath" { set device="$2" set iso_path="$3" set cfg_path="$4" diff --git a/docs/man/VasEBoot-bios-setup.h2m b/docs/man/VasEBoot-bios-setup.h2m index ac6ede362..0f8817120 100644 --- a/docs/man/VasEBoot-bios-setup.h2m +++ b/docs/man/VasEBoot-bios-setup.h2m @@ -1,6 +1,6 @@ [NAME] -grub-bios-setup \- set up a device to boot using GRUB +VasEBoot-bios-setup \- set up a device to boot using VasEBoot [SEE ALSO] -.BR grub-install (8), -.BR grub-mkimage (1), -.BR grub-mkrescue (1) +.BR VasEBoot-install (8), +.BR VasEBoot-mkimage (1), +.BR VasEBoot-mkrescue (1) diff --git a/docs/man/VasEBoot-editenv.h2m b/docs/man/VasEBoot-editenv.h2m index 3859d3d4c..b13f8927d 100644 --- a/docs/man/VasEBoot-editenv.h2m +++ b/docs/man/VasEBoot-editenv.h2m @@ -1,5 +1,5 @@ [NAME] -grub-editenv \- edit GRUB environment block +VasEBoot-editenv \- edit VasEBoot environment block [SEE ALSO] -.BR grub-reboot (8), -.BR grub-set-default (8) +.BR VasEBoot-reboot (8), +.BR VasEBoot-set-default (8) diff --git a/docs/man/VasEBoot-emu.h2m b/docs/man/VasEBoot-emu.h2m index ef1c00065..a27c2b6f0 100644 --- a/docs/man/VasEBoot-emu.h2m +++ b/docs/man/VasEBoot-emu.h2m @@ -1,6 +1,6 @@ [NAME] -grub-emu \- GRUB emulator +VasEBoot-emu \- VasEBoot emulator [SEE ALSO] -If you are trying to install GRUB, then you should use -.BR grub-install (8) +If you are trying to install VasEBoot, then you should use +.BR VasEBoot-install (8) rather than this program. diff --git a/docs/man/VasEBoot-file.h2m b/docs/man/VasEBoot-file.h2m index e09bb4d31..0c4fcef79 100644 --- a/docs/man/VasEBoot-file.h2m +++ b/docs/man/VasEBoot-file.h2m @@ -1,2 +1,2 @@ [NAME] -grub-file \- check file type +VasEBoot-file \- check file type diff --git a/docs/man/VasEBoot-fstest.h2m b/docs/man/VasEBoot-fstest.h2m index 9676b159a..15a8168fa 100644 --- a/docs/man/VasEBoot-fstest.h2m +++ b/docs/man/VasEBoot-fstest.h2m @@ -1,4 +1,4 @@ [NAME] -grub-fstest \- debug tool for GRUB filesystem drivers +VasEBoot-fstest \- debug tool for VasEBoot filesystem drivers [SEE ALSO] -.BR grub-probe (8) +.BR VasEBoot-probe (8) diff --git a/docs/man/VasEBoot-glue-efi.h2m b/docs/man/VasEBoot-glue-efi.h2m index c1c6ded49..1d6dce915 100644 --- a/docs/man/VasEBoot-glue-efi.h2m +++ b/docs/man/VasEBoot-glue-efi.h2m @@ -1,4 +1,4 @@ [NAME] -grub-glue-efi \- generate a fat binary for EFI +VasEBoot-glue-efi \- generate a fat binary for EFI [DESCRIPTION] -grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format. +VasEBoot-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format. diff --git a/docs/man/VasEBoot-install.h2m b/docs/man/VasEBoot-install.h2m index 8cbbc87a0..5552699c9 100644 --- a/docs/man/VasEBoot-install.h2m +++ b/docs/man/VasEBoot-install.h2m @@ -1,6 +1,6 @@ [NAME] -grub-install \- install GRUB to a device +VasEBoot-install \- install VasEBoot to a device [SEE ALSO] -.BR grub-mkconfig (8), -.BR grub-mkimage (1), -.BR grub-mkrescue (1) +.BR VasEBoot-mkconfig (8), +.BR VasEBoot-mkimage (1), +.BR VasEBoot-mkrescue (1) diff --git a/docs/man/VasEBoot-kbdcomp.h2m b/docs/man/VasEBoot-kbdcomp.h2m index d81f9157e..f4399b6c8 100644 --- a/docs/man/VasEBoot-kbdcomp.h2m +++ b/docs/man/VasEBoot-kbdcomp.h2m @@ -1,10 +1,10 @@ [NAME] -grub-kbdcomp \- generate a GRUB keyboard layout file +VasEBoot-kbdcomp \- generate a VasEBoot keyboard layout file [DESCRIPTION] -grub-kbdcomp processes a X keyboard layout description in +VasEBoot-kbdcomp processes a X keyboard layout description in .BR keymaps (5) -format into a format that can be used by GRUB's +format into a format that can be used by VasEBoot's .B keymap command. [SEE ALSO] -.BR grub-mklayout (8) +.BR VasEBoot-mklayout (8) diff --git a/docs/man/VasEBoot-macbless.h2m b/docs/man/VasEBoot-macbless.h2m index 0197c0087..4bfdc8205 100644 --- a/docs/man/VasEBoot-macbless.h2m +++ b/docs/man/VasEBoot-macbless.h2m @@ -1,4 +1,4 @@ [NAME] -grub-macbless \- bless a mac file/directory +VasEBoot-macbless \- bless a mac file/directory [SEE ALSO] -.BR grub-install (1) +.BR VasEBoot-install (1) diff --git a/docs/man/VasEBoot-macho2img.h2m b/docs/man/VasEBoot-macho2img.h2m index d79aaeed8..cf615d5b0 100644 --- a/docs/man/VasEBoot-macho2img.h2m +++ b/docs/man/VasEBoot-macho2img.h2m @@ -1,4 +1,4 @@ [NAME] -grub-macho2img \- convert Mach-O to raw image +VasEBoot-macho2img \- convert Mach-O to raw image [SEE ALSO] -.BR grub-mkimage (1) +.BR VasEBoot-mkimage (1) diff --git a/docs/man/VasEBoot-menulst2cfg.h2m b/docs/man/VasEBoot-menulst2cfg.h2m index c2e0055ed..1e2949b68 100644 --- a/docs/man/VasEBoot-menulst2cfg.h2m +++ b/docs/man/VasEBoot-menulst2cfg.h2m @@ -1,4 +1,4 @@ [NAME] -grub-menulst2cfg \- transform legacy menu.lst into grub.cfg +VasEBoot-menulst2cfg \- transform legacy menu.lst into VasEBoot.cfg [SEE ALSO] -.BR grub-mkconfig (8) +.BR VasEBoot-mkconfig (8) diff --git a/docs/man/VasEBoot-mkconfig.h2m b/docs/man/VasEBoot-mkconfig.h2m index 9b42f8130..020420f4c 100644 --- a/docs/man/VasEBoot-mkconfig.h2m +++ b/docs/man/VasEBoot-mkconfig.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mkconfig \- generate a GRUB configuration file +VasEBoot-mkconfig \- generate a VasEBoot configuration file [SEE ALSO] -.BR grub-install (8) +.BR VasEBoot-install (8) diff --git a/docs/man/VasEBoot-mkfont.h2m b/docs/man/VasEBoot-mkfont.h2m index d46fe600e..8c2bed3f7 100644 --- a/docs/man/VasEBoot-mkfont.h2m +++ b/docs/man/VasEBoot-mkfont.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mkfont \- make GRUB font files +VasEBoot-mkfont \- make VasEBoot font files [SEE ALSO] -.BR grub-mkconfig (8) +.BR VasEBoot-mkconfig (8) diff --git a/docs/man/VasEBoot-mkimage.h2m b/docs/man/VasEBoot-mkimage.h2m index f0fbc2bb1..01450c6d5 100644 --- a/docs/man/VasEBoot-mkimage.h2m +++ b/docs/man/VasEBoot-mkimage.h2m @@ -1,6 +1,6 @@ [NAME] -grub-mkimage \- make a bootable image of GRUB +VasEBoot-mkimage \- make a bootable image of VasEBoot [SEE ALSO] -.BR grub-install (8), -.BR grub-mkrescue (1), -.BR grub-mknetdir (8) +.BR VasEBoot-install (8), +.BR VasEBoot-mkrescue (1), +.BR VasEBoot-mknetdir (8) diff --git a/docs/man/VasEBoot-mklayout.h2m b/docs/man/VasEBoot-mklayout.h2m index 1e43409c0..09cc0cbda 100644 --- a/docs/man/VasEBoot-mklayout.h2m +++ b/docs/man/VasEBoot-mklayout.h2m @@ -1,10 +1,10 @@ [NAME] -grub-mklayout \- generate a GRUB keyboard layout file +VasEBoot-mklayout \- generate a VasEBoot keyboard layout file [DESCRIPTION] -grub-mklayout processes a keyboard layout description in +VasEBoot-mklayout processes a keyboard layout description in .BR keymaps (5) -format into a format that can be used by GRUB's +format into a format that can be used by VasEBoot's .B keymap command. [SEE ALSO] -.BR grub-mkconfig (8) +.BR VasEBoot-mkconfig (8) diff --git a/docs/man/VasEBoot-mknetdir.h2m b/docs/man/VasEBoot-mknetdir.h2m index a2ef13ec1..c62d70510 100644 --- a/docs/man/VasEBoot-mknetdir.h2m +++ b/docs/man/VasEBoot-mknetdir.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mknetdir \- prepare a GRUB netboot directory. +VasEBoot-mknetdir \- prepare a VasEBoot netboot directory. [SEE ALSO] -.BR grub-mkimage (1) +.BR VasEBoot-mkimage (1) diff --git a/docs/man/VasEBoot-mkpasswd-pbkdf2.h2m b/docs/man/VasEBoot-mkpasswd-pbkdf2.h2m index 4d202f3da..7110c0043 100644 --- a/docs/man/VasEBoot-mkpasswd-pbkdf2.h2m +++ b/docs/man/VasEBoot-mkpasswd-pbkdf2.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mkpasswd-pbkdf2 \- generate hashed password for GRUB +VasEBoot-mkpasswd-pbkdf2 \- generate hashed password for VasEBoot [SEE ALSO] -.BR grub-mkconfig (8) +.BR VasEBoot-mkconfig (8) diff --git a/docs/man/VasEBoot-mkrelpath.h2m b/docs/man/VasEBoot-mkrelpath.h2m index d01f3961e..0878dc26d 100644 --- a/docs/man/VasEBoot-mkrelpath.h2m +++ b/docs/man/VasEBoot-mkrelpath.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mkrelpath \- make a system path relative to its root +VasEBoot-mkrelpath \- make a system path relative to its root [SEE ALSO] -.BR grub-probe (8) +.BR VasEBoot-probe (8) diff --git a/docs/man/VasEBoot-mkrescue.h2m b/docs/man/VasEBoot-mkrescue.h2m index a427f02e3..58cbcb0c7 100644 --- a/docs/man/VasEBoot-mkrescue.h2m +++ b/docs/man/VasEBoot-mkrescue.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mkrescue \- make a GRUB rescue image +VasEBoot-mkrescue \- make a VasEBoot rescue image [SEE ALSO] -.BR grub-mkimage (1) +.BR VasEBoot-mkimage (1) diff --git a/docs/man/VasEBoot-mkstandalone.h2m b/docs/man/VasEBoot-mkstandalone.h2m index c77313978..1bdd49d39 100644 --- a/docs/man/VasEBoot-mkstandalone.h2m +++ b/docs/man/VasEBoot-mkstandalone.h2m @@ -1,4 +1,4 @@ [NAME] -grub-mkstandalone \- make a memdisk-based GRUB image +VasEBoot-mkstandalone \- make a memdisk-based VasEBoot image [SEE ALSO] -.BR grub-mkimage (1) +.BR VasEBoot-mkimage (1) diff --git a/docs/man/VasEBoot-mount.h2m b/docs/man/VasEBoot-mount.h2m index 8d168982d..5fef48e95 100644 --- a/docs/man/VasEBoot-mount.h2m +++ b/docs/man/VasEBoot-mount.h2m @@ -1,2 +1,2 @@ [NAME] -grub-mount \- export GRUB filesystem with FUSE +VasEBoot-mount \- export VasEBoot filesystem with FUSE diff --git a/docs/man/VasEBoot-ofpathname.h2m b/docs/man/VasEBoot-ofpathname.h2m index 74b43eea0..d45cbc806 100644 --- a/docs/man/VasEBoot-ofpathname.h2m +++ b/docs/man/VasEBoot-ofpathname.h2m @@ -1,4 +1,4 @@ [NAME] -grub-ofpathname \- find OpenBOOT path for a device +VasEBoot-ofpathname \- find OpenBOOT path for a device [SEE ALSO] -.BR grub-probe (8) +.BR VasEBoot-probe (8) diff --git a/docs/man/VasEBoot-pe2elf.h2m b/docs/man/VasEBoot-pe2elf.h2m index 7ca29bd70..7c55bc387 100644 --- a/docs/man/VasEBoot-pe2elf.h2m +++ b/docs/man/VasEBoot-pe2elf.h2m @@ -1,4 +1,4 @@ [NAME] -grub-pe2elf \- convert PE image to ELF +VasEBoot-pe2elf \- convert PE image to ELF [SEE ALSO] -.BR grub-mkimage (1) +.BR VasEBoot-mkimage (1) diff --git a/docs/man/VasEBoot-probe.h2m b/docs/man/VasEBoot-probe.h2m index 6e1ffdcf9..c4b054511 100644 --- a/docs/man/VasEBoot-probe.h2m +++ b/docs/man/VasEBoot-probe.h2m @@ -1,4 +1,4 @@ [NAME] -grub-probe \- probe device information for GRUB +VasEBoot-probe \- probe device information for VasEBoot [SEE ALSO] -.BR grub-fstest (1) +.BR VasEBoot-fstest (1) diff --git a/docs/man/VasEBoot-reboot.h2m b/docs/man/VasEBoot-reboot.h2m index e4acace65..7a6bfb520 100644 --- a/docs/man/VasEBoot-reboot.h2m +++ b/docs/man/VasEBoot-reboot.h2m @@ -1,5 +1,5 @@ [NAME] -grub-reboot \- set the default boot entry for GRUB, for the next boot only +VasEBoot-reboot \- set the default boot entry for VasEBoot, for the next boot only [SEE ALSO] -.BR grub-set-default (8), -.BR grub-editenv (1) +.BR VasEBoot-set-default (8), +.BR VasEBoot-editenv (1) diff --git a/docs/man/VasEBoot-render-label.h2m b/docs/man/VasEBoot-render-label.h2m index 50ae5247c..50863a831 100644 --- a/docs/man/VasEBoot-render-label.h2m +++ b/docs/man/VasEBoot-render-label.h2m @@ -1,3 +1,3 @@ [NAME] -grub-render-label \- generate a .disk_label for Apple Macs. +VasEBoot-render-label \- generate a .disk_label for Apple Macs. diff --git a/docs/man/VasEBoot-script-check.h2m b/docs/man/VasEBoot-script-check.h2m index 365368267..a57287944 100644 --- a/docs/man/VasEBoot-script-check.h2m +++ b/docs/man/VasEBoot-script-check.h2m @@ -1,4 +1,4 @@ [NAME] -grub-script-check \- check grub.cfg for syntax errors +VasEBoot-script-check \- check VasEBoot.cfg for syntax errors [SEE ALSO] -.BR grub-mkconfig (8) +.BR VasEBoot-mkconfig (8) diff --git a/docs/man/VasEBoot-set-default.h2m b/docs/man/VasEBoot-set-default.h2m index 7945001c1..2023ef9e4 100644 --- a/docs/man/VasEBoot-set-default.h2m +++ b/docs/man/VasEBoot-set-default.h2m @@ -1,5 +1,5 @@ [NAME] -grub-set-default \- set the saved default boot entry for GRUB +VasEBoot-set-default \- set the saved default boot entry for VasEBoot [SEE ALSO] -.BR grub-reboot (8), -.BR grub-editenv (1) +.BR VasEBoot-reboot (8), +.BR VasEBoot-editenv (1) diff --git a/docs/man/VasEBoot-sparc64-setup.h2m b/docs/man/VasEBoot-sparc64-setup.h2m index 18f803a50..64f786c51 100644 --- a/docs/man/VasEBoot-sparc64-setup.h2m +++ b/docs/man/VasEBoot-sparc64-setup.h2m @@ -1,6 +1,6 @@ [NAME] -grub-sparc64-setup \- set up a device to boot using GRUB +VasEBoot-sparc64-setup \- set up a device to boot using VasEBoot [SEE ALSO] -.BR grub-install (8), -.BR grub-mkimage (1), -.BR grub-mkrescue (1) +.BR VasEBoot-install (8), +.BR VasEBoot-mkimage (1), +.BR VasEBoot-mkrescue (1) diff --git a/docs/man/VasEBoot-syslinux2cfg.h2m b/docs/man/VasEBoot-syslinux2cfg.h2m index ad25c8ab7..2e5dfeed1 100644 --- a/docs/man/VasEBoot-syslinux2cfg.h2m +++ b/docs/man/VasEBoot-syslinux2cfg.h2m @@ -1,4 +1,4 @@ [NAME] -grub-syslinux2cfg \- transform syslinux config into grub.cfg +VasEBoot-syslinux2cfg \- transform syslinux config into VasEBoot.cfg [SEE ALSO] -.BR grub-menulst2cfg (8) +.BR VasEBoot-menulst2cfg (8) diff --git a/docs/osdetect.cfg b/docs/osdetect.cfg index 47455601d..1c8d27f4e 100644 --- a/docs/osdetect.cfg +++ b/docs/osdetect.cfg @@ -1,19 +1,19 @@ -# Sample GRUB script to autodetect operating systems +# Sample VasEBoot script to autodetect operating systems # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set saved_root=$root diff --git a/geninit.sh b/geninit.sh index f0810120f..ca4ceae4c 100644 --- a/geninit.sh +++ b/geninit.sh @@ -14,40 +14,40 @@ cat <. + * along with VasEBoot. If not, see . */ -#include +#include EOF for mod in "$@"; do - echo "extern void grub_${mod}_init (void);" - echo "extern void grub_${mod}_fini (void);" + echo "extern void VasEBoot_${mod}_init (void);" + echo "extern void VasEBoot_${mod}_fini (void);" done cat <. +# along with VasEBoot. If not, see . from __future__ import print_function @@ -26,7 +26,7 @@ import re # This is the python script used to generate Makefile.*.am # -GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", +VasEBoot_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275", "x86_64_efi", "i386_xen", "x86_64_xen", "mips_loongson", "sparc64_ieee1275", @@ -35,7 +35,7 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", GROUPS = {} -GROUPS["common"] = GRUB_PLATFORMS[:] +GROUPS["common"] = VasEBoot_PLATFORMS[:] # Groups based on CPU GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ] @@ -54,7 +54,7 @@ GROUPS["uboot"] = [ "arm_uboot" ] GROUPS["xen"] = [ "i386_xen", "x86_64_xen" ] # emu is a special case so many core functionality isn't needed on this platform -GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu") +GROUPS["noemu"] = VasEBoot_PLATFORMS[:]; GROUPS["noemu"].remove("emu") # Groups based on hardware features GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_loongson", "mips_qemu_mips", @@ -65,33 +65,33 @@ GROUPS["usb"] = GROUPS["pci"] # If gfxterm is main output console integrate it into kernel GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ] -GROUPS["videomodules"] = GRUB_PLATFORMS[:]; +GROUPS["videomodules"] = VasEBoot_PLATFORMS[:]; for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i) # Similar for terminfo GROUPS["terminfoinkernel"] = [ "emu", "mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["xen"] + GROUPS["ieee1275"] + GROUPS["uboot"]; -GROUPS["terminfomodule"] = GRUB_PLATFORMS[:]; +GROUPS["terminfomodule"] = VasEBoot_PLATFORMS[:]; for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i) # Flattened Device Trees (FDT) GROUPS["fdt"] = [ "arm64_efi", "arm_uboot", "arm_efi" ] # Needs software helpers for division -# Must match GRUB_DIVISION_IN_SOFTWARE in misc.h +# Must match VasEBoot_DIVISION_IN_SOFTWARE in misc.h GROUPS["softdiv"] = GROUPS["arm"] + ["ia64_efi"] -GROUPS["no_softdiv"] = GRUB_PLATFORMS[:] +GROUPS["no_softdiv"] = VasEBoot_PLATFORMS[:] for i in GROUPS["softdiv"]: GROUPS["no_softdiv"].remove(i) # Miscellaneous groups scheduled to disappear in future GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", "i386_qemu"] -GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc") +GROUPS["nopc"] = VasEBoot_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc") # # Create platform => groups reverse map, where groups covering that # platform are ordered by their sizes # RMAP = {} -for platform in GRUB_PLATFORMS: +for platform in VasEBoot_PLATFORMS: # initialize with platform itself as a group RMAP[platform] = [ platform ] @@ -104,7 +104,7 @@ for platform in GRUB_PLATFORMS: smaller = [] # partition currently known groups based on their size for group in RMAP[platform]: - if group in GRUB_PLATFORMS: smaller.append(group) + if group in VasEBoot_PLATFORMS: smaller.append(group) elif len(GROUPS[group]) < len(v): smaller.append(group) else: bigger.append(group) # insert in the middle @@ -532,7 +532,7 @@ def foreach_value(defn, tag, closure): # # module = { # cflags = '-Wall'; -# emu_cflags = '-Wall -DGRUB_EMU=1'; +# emu_cflags = '-Wall -DVasEBoot_EMU=1'; # ... # } # @@ -588,11 +588,11 @@ def platform_conditional(platform, closure): # def foreach_enabled_platform(defn, closure): if 'enable' in defn: - for platform in GRUB_PLATFORMS: + for platform in VasEBoot_PLATFORMS: if platform_tagged(defn, platform, "enable"): platform_conditional(platform, closure) else: - for platform in GRUB_PLATFORMS: + for platform in VasEBoot_PLATFORMS: platform_conditional(platform, closure) # @@ -606,7 +606,7 @@ def foreach_enabled_platform(defn, closure): # enable = emu; # enable = i386; # enable = mips_loongson; -# emu_condition = COND_GRUB_EMU_SDL; +# emu_condition = COND_VasEBoot_EMU_SDL; # }; # def under_platform_specific_conditionals(defn, platform, closure): @@ -651,19 +651,19 @@ def is_platform_independent(defn): if 'enable' in defn: return False for suffix in [ "", "_nodist" ]: - template = platform_values(defn, GRUB_PLATFORMS[0], suffix) - for platform in GRUB_PLATFORMS[1:]: + template = platform_values(defn, VasEBoot_PLATFORMS[0], suffix) + for platform in VasEBoot_PLATFORMS[1:]: if template != platform_values(defn, platform, suffix): return False for suffix in [ "startup", "ldadd", "dependencies", "cflags", "ldflags", "cppflags", "ccasflags", "stripflags", "objcopyflags", "condition" ]: - template = platform_specific_values(defn, GRUB_PLATFORMS[0], "_" + suffix, suffix) - for platform in GRUB_PLATFORMS[1:]: + template = platform_specific_values(defn, VasEBoot_PLATFORMS[0], "_" + suffix, suffix) + for platform in VasEBoot_PLATFORMS[1:]: if template != platform_specific_values(defn, platform, "_" + suffix, suffix): return False for tag in [ "nostrip" ]: - template = platform_tagged(defn, GRUB_PLATFORMS[0], tag) - for platform in GRUB_PLATFORMS[1:]: + template = platform_tagged(defn, VasEBoot_PLATFORMS[0], tag) + for platform in VasEBoot_PLATFORMS[1:]: if template != platform_tagged(defn, platform, tag): return False @@ -694,7 +694,7 @@ def module(defn, platform): gvar_add("CLEANFILES", name + ".marker") output(""" """ + name + """.marker: $(""" + cname(defn) + """_SOURCES) $(nodist_""" + cname(defn) + """_SOURCES) - $(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname(defn) + """_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1) + $(TARGET_CPP) -DVasEBoot_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname(defn) + """_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1) grep 'MARKER' $@.new > $@; rm -f $@.new """) @@ -722,13 +722,13 @@ def kernel(defn, platform): rule(name + ".img", name + ".exec$(EXEEXT)", if_platform_tagged(defn, platform, "nostrip", """if test x$(TARGET_APPLE_LINKER) = x1; then \ - $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -wd1106 -nu -nd $< $@; \ + $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_VasEBoot_mod_init:VasEBoot_mod_init -nr:_VasEBoot_mod_fini:VasEBoot_mod_fini -ed2022 -wd1106 -nu -nd $< $@; \ elif test ! -z '$(TARGET_OBJ2ELF)'; then \ $(TARGET_OBJ2ELF) $< $@ || (rm -f $@; exit 1); \ else cp $< $@; fi""", """if test x$(TARGET_APPLE_LINKER) = x1; then \ $(TARGET_STRIP) -S -x $(""" + cname(defn) + """) -o $@.bin $<; \ - $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -ed2016 -wd1106 -nu -nd $@.bin $@; \ + $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_VasEBoot_mod_init:VasEBoot_mod_init -nr:_VasEBoot_mod_fini:VasEBoot_mod_fini -ed2022 -ed2016 -wd1106 -nu -nd $@.bin $@; \ rm -f $@.bin; \ elif test ! -z '$(TARGET_OBJ2ELF)'; then \ """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@.bin $< && \ @@ -859,7 +859,7 @@ def script(defn, platform): else: var_add(installdir(defn) + "_SCRIPTS", name) if 'mansection' in defn: - manpage(defn, "grub-mkconfig_lib") + manpage(defn, "VasEBoot-mkconfig_lib") rule(name, "$(top_builddir)/config.status " + platform_sources(defn, platform) + platform_dependencies(defn, platform), """ (for x in """ + platform_sources(defn, platform) + """; do cat $(srcdir)/"$$x"; done) | $(top_builddir)/config.status --file=$@:- @@ -876,7 +876,7 @@ def rules(target, closure): for defn in defparser.definitions.find_all(target): if is_platform_independent(defn): - under_platform_specific_conditionals(defn, GRUB_PLATFORMS[0], closure) + under_platform_specific_conditionals(defn, VasEBoot_PLATFORMS[0], closure) else: foreach_enabled_platform( defn, diff --git a/include/VasEBoot/acorn_filecore.h b/include/VasEBoot/acorn_filecore.h index 6cda6cf0a..c87e856f4 100644 --- a/include/VasEBoot/acorn_filecore.h +++ b/include/VasEBoot/acorn_filecore.h @@ -1,53 +1,53 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ACORN_FILECORE_HEADER -#define GRUB_ACORN_FILECORE_HEADER 1 +#ifndef VasEBoot_ACORN_FILECORE_HEADER +#define VasEBoot_ACORN_FILECORE_HEADER 1 -#include +#include -struct grub_filecore_disc_record +struct VasEBoot_filecore_disc_record { - grub_uint8_t log2secsize; - grub_uint8_t secspertrack; - grub_uint8_t heads; - grub_uint8_t density; - grub_uint8_t idlen; - grub_uint8_t log2bpmb; - grub_uint8_t skew; - grub_uint8_t bootoption; + VasEBoot_uint8_t log2secsize; + VasEBoot_uint8_t secspertrack; + VasEBoot_uint8_t heads; + VasEBoot_uint8_t density; + VasEBoot_uint8_t idlen; + VasEBoot_uint8_t log2bpmb; + VasEBoot_uint8_t skew; + VasEBoot_uint8_t bootoption; /* In bits 0-5, flags in bits 6 and 7. */ - grub_uint8_t lowsector; - grub_uint8_t nzones; - grub_uint16_t zone_spare; - grub_uint32_t root_address; + VasEBoot_uint8_t lowsector; + VasEBoot_uint8_t nzones; + VasEBoot_uint16_t zone_spare; + VasEBoot_uint32_t root_address; /* Disc size in bytes. */ - grub_uint32_t disc_size; - grub_uint16_t cycle_id; + VasEBoot_uint32_t disc_size; + VasEBoot_uint16_t cycle_id; char disc_name[10]; /* Yes, it is 32 bits! */ - grub_uint32_t disctype; + VasEBoot_uint32_t disctype; /* Most significant part of the disc size. */ - grub_uint32_t disc_size2; - grub_uint8_t share_size; - grub_uint8_t big_flag; - grub_uint8_t reserved[18]; + VasEBoot_uint32_t disc_size2; + VasEBoot_uint8_t share_size; + VasEBoot_uint8_t big_flag; + VasEBoot_uint8_t reserved[18]; }; -#endif /* ! GRUB_ACORN_FILECORE_HEADER */ +#endif /* ! VasEBoot_ACORN_FILECORE_HEADER */ diff --git a/include/VasEBoot/acpi.h b/include/VasEBoot/acpi.h index 66148f684..1f988fba5 100644 --- a/include/VasEBoot/acpi.h +++ b/include/VasEBoot/acpi.h @@ -1,247 +1,247 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ACPI_HEADER -#define GRUB_ACPI_HEADER 1 +#ifndef VasEBoot_ACPI_HEADER +#define VasEBoot_ACPI_HEADER 1 -#ifndef GRUB_DSDT_TEST -#include -#include +#ifndef VasEBoot_DSDT_TEST +#include +#include #else -#define GRUB_PACKED __attribute__ ((packed)) +#define VasEBoot_PACKED __attribute__ ((packed)) #endif -#define GRUB_RSDP_SIGNATURE "RSD PTR " -#define GRUB_RSDP_SIGNATURE_SIZE 8 +#define VasEBoot_RSDP_SIGNATURE "RSD PTR " +#define VasEBoot_RSDP_SIGNATURE_SIZE 8 -struct grub_acpi_rsdp_v10 +struct VasEBoot_acpi_rsdp_v10 { - grub_uint8_t signature[GRUB_RSDP_SIGNATURE_SIZE]; - grub_uint8_t checksum; - grub_uint8_t oemid[6]; - grub_uint8_t revision; - grub_uint32_t rsdt_addr; -} GRUB_PACKED; + VasEBoot_uint8_t signature[VasEBoot_RSDP_SIGNATURE_SIZE]; + VasEBoot_uint8_t checksum; + VasEBoot_uint8_t oemid[6]; + VasEBoot_uint8_t revision; + VasEBoot_uint32_t rsdt_addr; +} VasEBoot_PACKED; -struct grub_acpi_rsdp_v20 +struct VasEBoot_acpi_rsdp_v20 { - struct grub_acpi_rsdp_v10 rsdpv1; - grub_uint32_t length; - grub_uint64_t xsdt_addr; - grub_uint8_t checksum; - grub_uint8_t reserved[3]; -} GRUB_PACKED; + struct VasEBoot_acpi_rsdp_v10 rsdpv1; + VasEBoot_uint32_t length; + VasEBoot_uint64_t xsdt_addr; + VasEBoot_uint8_t checksum; + VasEBoot_uint8_t reserved[3]; +} VasEBoot_PACKED; -struct grub_acpi_table_header +struct VasEBoot_acpi_table_header { - grub_uint8_t signature[4]; - grub_uint32_t length; - grub_uint8_t revision; - grub_uint8_t checksum; - grub_uint8_t oemid[6]; - grub_uint8_t oemtable[8]; - grub_uint32_t oemrev; - grub_uint8_t creator_id[4]; - grub_uint32_t creator_rev; -} GRUB_PACKED; + VasEBoot_uint8_t signature[4]; + VasEBoot_uint32_t length; + VasEBoot_uint8_t revision; + VasEBoot_uint8_t checksum; + VasEBoot_uint8_t oemid[6]; + VasEBoot_uint8_t oemtable[8]; + VasEBoot_uint32_t oemrev; + VasEBoot_uint8_t creator_id[4]; + VasEBoot_uint32_t creator_rev; +} VasEBoot_PACKED; -#define GRUB_ACPI_FADT_SIGNATURE "FACP" +#define VasEBoot_ACPI_FADT_SIGNATURE "FACP" -struct grub_acpi_fadt +struct VasEBoot_acpi_fadt { - struct grub_acpi_table_header hdr; - grub_uint32_t facs_addr; - grub_uint32_t dsdt_addr; - grub_uint8_t somefields1[20]; - grub_uint32_t pm1a; - grub_uint8_t somefields2[8]; - grub_uint32_t pmtimer; - grub_uint8_t somefields3[32]; - grub_uint32_t flags; - grub_uint8_t somefields4[16]; - grub_uint64_t facs_xaddr; - grub_uint64_t dsdt_xaddr; - grub_uint8_t somefields5[96]; -} GRUB_PACKED; + struct VasEBoot_acpi_table_header hdr; + VasEBoot_uint32_t facs_addr; + VasEBoot_uint32_t dsdt_addr; + VasEBoot_uint8_t somefields1[20]; + VasEBoot_uint32_t pm1a; + VasEBoot_uint8_t somefields2[8]; + VasEBoot_uint32_t pmtimer; + VasEBoot_uint8_t somefields3[32]; + VasEBoot_uint32_t flags; + VasEBoot_uint8_t somefields4[16]; + VasEBoot_uint64_t facs_xaddr; + VasEBoot_uint64_t dsdt_xaddr; + VasEBoot_uint8_t somefields5[96]; +} VasEBoot_PACKED; -#define GRUB_ACPI_MADT_SIGNATURE "APIC" +#define VasEBoot_ACPI_MADT_SIGNATURE "APIC" -struct grub_acpi_madt_entry_header +struct VasEBoot_acpi_madt_entry_header { - grub_uint8_t type; - grub_uint8_t len; + VasEBoot_uint8_t type; + VasEBoot_uint8_t len; }; -struct grub_acpi_madt +struct VasEBoot_acpi_madt { - struct grub_acpi_table_header hdr; - grub_uint32_t lapic_addr; - grub_uint32_t flags; - struct grub_acpi_madt_entry_header entries[0]; + struct VasEBoot_acpi_table_header hdr; + VasEBoot_uint32_t lapic_addr; + VasEBoot_uint32_t flags; + struct VasEBoot_acpi_madt_entry_header entries[0]; }; enum { - GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC = 0, - GRUB_ACPI_MADT_ENTRY_TYPE_IOAPIC = 1, - GRUB_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE = 2, - GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC_NMI = 4, - GRUB_ACPI_MADT_ENTRY_TYPE_SAPIC = 6, - GRUB_ACPI_MADT_ENTRY_TYPE_LSAPIC = 7, - GRUB_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE = 8 + VasEBoot_ACPI_MADT_ENTRY_TYPE_LAPIC = 0, + VasEBoot_ACPI_MADT_ENTRY_TYPE_IOAPIC = 1, + VasEBoot_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE = 2, + VasEBoot_ACPI_MADT_ENTRY_TYPE_LAPIC_NMI = 4, + VasEBoot_ACPI_MADT_ENTRY_TYPE_SAPIC = 6, + VasEBoot_ACPI_MADT_ENTRY_TYPE_LSAPIC = 7, + VasEBoot_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE = 8 }; -struct grub_acpi_madt_entry_lapic +struct VasEBoot_acpi_madt_entry_lapic { - struct grub_acpi_madt_entry_header hdr; - grub_uint8_t acpiid; - grub_uint8_t apicid; - grub_uint32_t flags; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint8_t acpiid; + VasEBoot_uint8_t apicid; + VasEBoot_uint32_t flags; }; -struct grub_acpi_madt_entry_ioapic +struct VasEBoot_acpi_madt_entry_ioapic { - struct grub_acpi_madt_entry_header hdr; - grub_uint8_t id; - grub_uint8_t pad; - grub_uint32_t address; - grub_uint32_t global_sys_interrupt; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint8_t id; + VasEBoot_uint8_t pad; + VasEBoot_uint32_t address; + VasEBoot_uint32_t global_sys_interrupt; }; -struct grub_acpi_madt_entry_interrupt_override +struct VasEBoot_acpi_madt_entry_interrupt_override { - struct grub_acpi_madt_entry_header hdr; - grub_uint8_t bus; - grub_uint8_t source; - grub_uint32_t global_sys_interrupt; - grub_uint16_t flags; -} GRUB_PACKED; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint8_t bus; + VasEBoot_uint8_t source; + VasEBoot_uint32_t global_sys_interrupt; + VasEBoot_uint16_t flags; +} VasEBoot_PACKED; -struct grub_acpi_madt_entry_lapic_nmi +struct VasEBoot_acpi_madt_entry_lapic_nmi { - struct grub_acpi_madt_entry_header hdr; - grub_uint8_t acpiid; - grub_uint16_t flags; - grub_uint8_t lint; -} GRUB_PACKED; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint8_t acpiid; + VasEBoot_uint16_t flags; + VasEBoot_uint8_t lint; +} VasEBoot_PACKED; -struct grub_acpi_madt_entry_sapic +struct VasEBoot_acpi_madt_entry_sapic { - struct grub_acpi_madt_entry_header hdr; - grub_uint8_t id; - grub_uint8_t pad; - grub_uint32_t global_sys_interrupt_base; - grub_uint64_t addr; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint8_t id; + VasEBoot_uint8_t pad; + VasEBoot_uint32_t global_sys_interrupt_base; + VasEBoot_uint64_t addr; }; -struct grub_acpi_madt_entry_lsapic +struct VasEBoot_acpi_madt_entry_lsapic { - struct grub_acpi_madt_entry_header hdr; - grub_uint8_t cpu_id; - grub_uint8_t id; - grub_uint8_t eid; - grub_uint8_t pad[3]; - grub_uint32_t flags; - grub_uint32_t cpu_uid; - grub_uint8_t cpu_uid_str[0]; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint8_t cpu_id; + VasEBoot_uint8_t id; + VasEBoot_uint8_t eid; + VasEBoot_uint8_t pad[3]; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t cpu_uid; + VasEBoot_uint8_t cpu_uid_str[0]; }; -struct grub_acpi_madt_entry_platform_int_source +struct VasEBoot_acpi_madt_entry_platform_int_source { - struct grub_acpi_madt_entry_header hdr; - grub_uint16_t flags; - grub_uint8_t inttype; - grub_uint8_t cpu_id; - grub_uint8_t cpu_eid; - grub_uint8_t sapic_vector; - grub_uint32_t global_sys_int; - grub_uint32_t src_flags; + struct VasEBoot_acpi_madt_entry_header hdr; + VasEBoot_uint16_t flags; + VasEBoot_uint8_t inttype; + VasEBoot_uint8_t cpu_id; + VasEBoot_uint8_t cpu_eid; + VasEBoot_uint8_t sapic_vector; + VasEBoot_uint32_t global_sys_int; + VasEBoot_uint32_t src_flags; }; enum { - GRUB_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED = 1 + VasEBoot_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED = 1 }; -#ifndef GRUB_DSDT_TEST -struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void); -struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void); -struct grub_acpi_rsdp_v10 *EXPORT_FUNC(grub_machine_acpi_get_rsdpv1) (void); -struct grub_acpi_rsdp_v20 *EXPORT_FUNC(grub_machine_acpi_get_rsdpv2) (void); -grub_uint8_t EXPORT_FUNC(grub_byte_checksum) (void *base, grub_size_t size); +#ifndef VasEBoot_DSDT_TEST +struct VasEBoot_acpi_rsdp_v10 *VasEBoot_acpi_get_rsdpv1 (void); +struct VasEBoot_acpi_rsdp_v20 *VasEBoot_acpi_get_rsdpv2 (void); +struct VasEBoot_acpi_rsdp_v10 *EXPORT_FUNC(VasEBoot_machine_acpi_get_rsdpv1) (void); +struct VasEBoot_acpi_rsdp_v20 *EXPORT_FUNC(VasEBoot_machine_acpi_get_rsdpv2) (void); +VasEBoot_uint8_t EXPORT_FUNC(VasEBoot_byte_checksum) (void *base, VasEBoot_size_t size); -grub_err_t grub_acpi_create_ebda (void); +VasEBoot_err_t VasEBoot_acpi_create_ebda (void); -void grub_acpi_halt (void); +void VasEBoot_acpi_halt (void); #endif -#define GRUB_ACPI_SLP_EN (1 << 13) -#define GRUB_ACPI_SLP_TYP_OFFSET 10 +#define VasEBoot_ACPI_SLP_EN (1 << 13) +#define VasEBoot_ACPI_SLP_TYP_OFFSET 10 enum { - GRUB_ACPI_OPCODE_ZERO = 0, GRUB_ACPI_OPCODE_ONE = 1, - GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_ALIAS = 0x06, - GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a, - GRUB_ACPI_OPCODE_WORD_CONST = 0x0b, - GRUB_ACPI_OPCODE_DWORD_CONST = 0x0c, - GRUB_ACPI_OPCODE_STRING_CONST = 0x0d, - GRUB_ACPI_OPCODE_SCOPE = 0x10, - GRUB_ACPI_OPCODE_BUFFER = 0x11, - GRUB_ACPI_OPCODE_PACKAGE = 0x12, - GRUB_ACPI_OPCODE_METHOD = 0x14, GRUB_ACPI_OPCODE_EXTOP = 0x5b, - GRUB_ACPI_OPCODE_ADD = 0x72, - GRUB_ACPI_OPCODE_CONCAT = 0x73, - GRUB_ACPI_OPCODE_SUBTRACT = 0x74, - GRUB_ACPI_OPCODE_MULTIPLY = 0x77, - GRUB_ACPI_OPCODE_DIVIDE = 0x78, - GRUB_ACPI_OPCODE_LSHIFT = 0x79, - GRUB_ACPI_OPCODE_RSHIFT = 0x7a, - GRUB_ACPI_OPCODE_AND = 0x7b, - GRUB_ACPI_OPCODE_NAND = 0x7c, - GRUB_ACPI_OPCODE_OR = 0x7d, - GRUB_ACPI_OPCODE_NOR = 0x7e, - GRUB_ACPI_OPCODE_XOR = 0x7f, - GRUB_ACPI_OPCODE_CONCATRES = 0x84, - GRUB_ACPI_OPCODE_MOD = 0x85, - GRUB_ACPI_OPCODE_INDEX = 0x88, - GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD = 0x8a, - GRUB_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b, - GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c, - GRUB_ACPI_OPCODE_TOSTRING = 0x9c, - GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff + VasEBoot_ACPI_OPCODE_ZERO = 0, VasEBoot_ACPI_OPCODE_ONE = 1, + VasEBoot_ACPI_OPCODE_NAME = 8, VasEBoot_ACPI_OPCODE_ALIAS = 0x06, + VasEBoot_ACPI_OPCODE_BYTE_CONST = 0x0a, + VasEBoot_ACPI_OPCODE_WORD_CONST = 0x0b, + VasEBoot_ACPI_OPCODE_DWORD_CONST = 0x0c, + VasEBoot_ACPI_OPCODE_STRING_CONST = 0x0d, + VasEBoot_ACPI_OPCODE_SCOPE = 0x10, + VasEBoot_ACPI_OPCODE_BUFFER = 0x11, + VasEBoot_ACPI_OPCODE_PACKAGE = 0x12, + VasEBoot_ACPI_OPCODE_METHOD = 0x14, VasEBoot_ACPI_OPCODE_EXTOP = 0x5b, + VasEBoot_ACPI_OPCODE_ADD = 0x72, + VasEBoot_ACPI_OPCODE_CONCAT = 0x73, + VasEBoot_ACPI_OPCODE_SUBTRACT = 0x74, + VasEBoot_ACPI_OPCODE_MULTIPLY = 0x77, + VasEBoot_ACPI_OPCODE_DIVIDE = 0x78, + VasEBoot_ACPI_OPCODE_LSHIFT = 0x79, + VasEBoot_ACPI_OPCODE_RSHIFT = 0x7a, + VasEBoot_ACPI_OPCODE_AND = 0x7b, + VasEBoot_ACPI_OPCODE_NAND = 0x7c, + VasEBoot_ACPI_OPCODE_OR = 0x7d, + VasEBoot_ACPI_OPCODE_NOR = 0x7e, + VasEBoot_ACPI_OPCODE_XOR = 0x7f, + VasEBoot_ACPI_OPCODE_CONCATRES = 0x84, + VasEBoot_ACPI_OPCODE_MOD = 0x85, + VasEBoot_ACPI_OPCODE_INDEX = 0x88, + VasEBoot_ACPI_OPCODE_CREATE_DWORD_FIELD = 0x8a, + VasEBoot_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b, + VasEBoot_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c, + VasEBoot_ACPI_OPCODE_TOSTRING = 0x9c, + VasEBoot_ACPI_OPCODE_IF = 0xa0, VasEBoot_ACPI_OPCODE_ONES = 0xff }; enum { - GRUB_ACPI_EXTOPCODE_MUTEX = 0x01, - GRUB_ACPI_EXTOPCODE_EVENT_OP = 0x02, - GRUB_ACPI_EXTOPCODE_OPERATION_REGION = 0x80, - GRUB_ACPI_EXTOPCODE_FIELD_OP = 0x81, - GRUB_ACPI_EXTOPCODE_DEVICE_OP = 0x82, - GRUB_ACPI_EXTOPCODE_PROCESSOR_OP = 0x83, - GRUB_ACPI_EXTOPCODE_POWER_RES_OP = 0x84, - GRUB_ACPI_EXTOPCODE_THERMAL_ZONE_OP = 0x85, - GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP = 0x86, - GRUB_ACPI_EXTOPCODE_BANK_FIELD_OP = 0x87, + VasEBoot_ACPI_EXTOPCODE_MUTEX = 0x01, + VasEBoot_ACPI_EXTOPCODE_EVENT_OP = 0x02, + VasEBoot_ACPI_EXTOPCODE_OPERATION_REGION = 0x80, + VasEBoot_ACPI_EXTOPCODE_FIELD_OP = 0x81, + VasEBoot_ACPI_EXTOPCODE_DEVICE_OP = 0x82, + VasEBoot_ACPI_EXTOPCODE_PROCESSOR_OP = 0x83, + VasEBoot_ACPI_EXTOPCODE_POWER_RES_OP = 0x84, + VasEBoot_ACPI_EXTOPCODE_THERMAL_ZONE_OP = 0x85, + VasEBoot_ACPI_EXTOPCODE_INDEX_FIELD_OP = 0x86, + VasEBoot_ACPI_EXTOPCODE_BANK_FIELD_OP = 0x87, }; -struct grub_acpi_fadt * -EXPORT_FUNC(grub_acpi_find_fadt) (void); +struct VasEBoot_acpi_fadt * +EXPORT_FUNC(VasEBoot_acpi_find_fadt) (void); -#endif /* ! GRUB_ACPI_HEADER */ +#endif /* ! VasEBoot_ACPI_HEADER */ diff --git a/include/VasEBoot/aout.h b/include/VasEBoot/aout.h index 10d7dde61..d6500f829 100644 --- a/include/VasEBoot/aout.h +++ b/include/VasEBoot/aout.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /*- @@ -48,39 +48,39 @@ * $FreeBSD$ */ -#ifndef GRUB_AOUT_HEADER -#define GRUB_AOUT_HEADER 1 +#ifndef VasEBoot_AOUT_HEADER +#define VasEBoot_AOUT_HEADER 1 -#include +#include -struct grub_aout32_header +struct VasEBoot_aout32_header { - grub_uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ - grub_uint32_t a_text; /* text segment size */ - grub_uint32_t a_data; /* initialized data size */ - grub_uint32_t a_bss; /* uninitialized data size */ - grub_uint32_t a_syms; /* symbol table size */ - grub_uint32_t a_entry; /* entry point */ - grub_uint32_t a_trsize; /* text relocation size */ - grub_uint32_t a_drsize; /* data relocation size */ + VasEBoot_uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ + VasEBoot_uint32_t a_text; /* text segment size */ + VasEBoot_uint32_t a_data; /* initialized data size */ + VasEBoot_uint32_t a_bss; /* uninitialized data size */ + VasEBoot_uint32_t a_syms; /* symbol table size */ + VasEBoot_uint32_t a_entry; /* entry point */ + VasEBoot_uint32_t a_trsize; /* text relocation size */ + VasEBoot_uint32_t a_drsize; /* data relocation size */ }; -struct grub_aout64_header +struct VasEBoot_aout64_header { - grub_uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ - grub_uint64_t a_text; /* text segment size */ - grub_uint64_t a_data; /* initialized data size */ - grub_uint64_t a_bss; /* uninitialized data size */ - grub_uint64_t a_syms; /* symbol table size */ - grub_uint64_t a_entry; /* entry point */ - grub_uint64_t a_trsize; /* text relocation size */ - grub_uint64_t a_drsize; /* data relocation size */ + VasEBoot_uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ + VasEBoot_uint64_t a_text; /* text segment size */ + VasEBoot_uint64_t a_data; /* initialized data size */ + VasEBoot_uint64_t a_bss; /* uninitialized data size */ + VasEBoot_uint64_t a_syms; /* symbol table size */ + VasEBoot_uint64_t a_entry; /* entry point */ + VasEBoot_uint64_t a_trsize; /* text relocation size */ + VasEBoot_uint64_t a_drsize; /* data relocation size */ }; -union grub_aout_header +union VasEBoot_aout_header { - struct grub_aout32_header aout32; - struct grub_aout64_header aout64; + struct VasEBoot_aout32_header aout32; + struct VasEBoot_aout64_header aout64; }; #define AOUT_TYPE_NONE 0 @@ -115,14 +115,14 @@ union grub_aout_header #define AOUT_GETMID(header) ((header).a_midmag >> 16) & 0x03ff) #define AOUT_GETFLAG(header) ((header).a_midmag >> 26) & 0x3f) -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL -int EXPORT_FUNC(grub_aout_get_type) (union grub_aout_header *header); +int EXPORT_FUNC(VasEBoot_aout_get_type) (union VasEBoot_aout_header *header); -grub_err_t EXPORT_FUNC(grub_aout_load) (grub_file_t file, int offset, +VasEBoot_err_t EXPORT_FUNC(VasEBoot_aout_load) (VasEBoot_file_t file, int offset, void *load_addr, int load_size, - grub_size_t bss_size); + VasEBoot_size_t bss_size); #endif -#endif /* ! GRUB_AOUT_HEADER */ +#endif /* ! VasEBoot_AOUT_HEADER */ diff --git a/include/VasEBoot/arc/arc.h b/include/VasEBoot/arc/arc.h index 7615a49a9..0fd21c99d 100644 --- a/include/VasEBoot/arc/arc.h +++ b/include/VasEBoot/arc/arc.h @@ -1,171 +1,171 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ARC_HEADER -#define GRUB_ARC_HEADER 1 +#ifndef VasEBoot_ARC_HEADER +#define VasEBoot_ARC_HEADER 1 -#include -#include +#include +#include -typedef unsigned grub_arc_enum_t; -typedef grub_uint64_t grub_arc_ularge_t; -typedef unsigned long grub_arc_ulong_t; -typedef long grub_arc_long_t; -typedef unsigned short grub_arc_ushort_t; -typedef unsigned char grub_arc_uchar_t; +typedef unsigned VasEBoot_arc_enum_t; +typedef VasEBoot_uint64_t VasEBoot_arc_ularge_t; +typedef unsigned long VasEBoot_arc_ulong_t; +typedef long VasEBoot_arc_long_t; +typedef unsigned short VasEBoot_arc_ushort_t; +typedef unsigned char VasEBoot_arc_uchar_t; -typedef grub_arc_long_t grub_arc_err_t; -typedef grub_arc_ulong_t grub_arc_fileno_t; +typedef VasEBoot_arc_long_t VasEBoot_arc_err_t; +typedef VasEBoot_arc_ulong_t VasEBoot_arc_fileno_t; -struct grub_arc_memory_descriptor +struct VasEBoot_arc_memory_descriptor { - grub_arc_enum_t type; - grub_arc_ulong_t start_page; - grub_arc_ulong_t num_pages; + VasEBoot_arc_enum_t type; + VasEBoot_arc_ulong_t start_page; + VasEBoot_arc_ulong_t num_pages; }; -enum grub_arc_memory_type +enum VasEBoot_arc_memory_type { - GRUB_ARC_MEMORY_EXCEPTION_BLOCK, - GRUB_ARC_MEMORY_SYSTEM_PARAMETER_BLOCK, -#ifdef GRUB_CPU_WORDS_BIGENDIAN - GRUB_ARC_MEMORY_FREE_CONTIGUOUS, + VasEBoot_ARC_MEMORY_EXCEPTION_BLOCK, + VasEBoot_ARC_MEMORY_SYSTEM_PARAMETER_BLOCK, +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_ARC_MEMORY_FREE_CONTIGUOUS, #endif - GRUB_ARC_MEMORY_FREE, - GRUB_ARC_MEMORY_BADRAM, - GRUB_ARC_MEMORY_LOADED, GRUB_ARC_MEMORY_FW_TEMPORARY, - GRUB_ARC_MEMORY_FW_PERMANENT, -#ifndef GRUB_CPU_WORDS_BIGENDIAN - GRUB_ARC_MEMORY_FREE_CONTIGUOUS, + VasEBoot_ARC_MEMORY_FREE, + VasEBoot_ARC_MEMORY_BADRAM, + VasEBoot_ARC_MEMORY_LOADED, VasEBoot_ARC_MEMORY_FW_TEMPORARY, + VasEBoot_ARC_MEMORY_FW_PERMANENT, +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_ARC_MEMORY_FREE_CONTIGUOUS, #endif - } grub_arc_memory_type_t; + } VasEBoot_arc_memory_type_t; -struct grub_arc_timeinfo +struct VasEBoot_arc_timeinfo { - grub_arc_ushort_t y; - grub_arc_ushort_t m; - grub_arc_ushort_t d; - grub_arc_ushort_t h; - grub_arc_ushort_t min; - grub_arc_ushort_t s; - grub_arc_ushort_t ms; + VasEBoot_arc_ushort_t y; + VasEBoot_arc_ushort_t m; + VasEBoot_arc_ushort_t d; + VasEBoot_arc_ushort_t h; + VasEBoot_arc_ushort_t min; + VasEBoot_arc_ushort_t s; + VasEBoot_arc_ushort_t ms; }; -struct grub_arc_display_status +struct VasEBoot_arc_display_status { - grub_arc_ushort_t x; - grub_arc_ushort_t y; - grub_arc_ushort_t w; - grub_arc_ushort_t h; - grub_arc_uchar_t fgcolor; - grub_arc_uchar_t bgcolor; - grub_arc_uchar_t high_intensity; - grub_arc_uchar_t underscored; - grub_arc_uchar_t reverse_video; + VasEBoot_arc_ushort_t x; + VasEBoot_arc_ushort_t y; + VasEBoot_arc_ushort_t w; + VasEBoot_arc_ushort_t h; + VasEBoot_arc_uchar_t fgcolor; + VasEBoot_arc_uchar_t bgcolor; + VasEBoot_arc_uchar_t high_intensity; + VasEBoot_arc_uchar_t underscored; + VasEBoot_arc_uchar_t reverse_video; }; enum { - GRUB_ARC_COMPONENT_FLAG_OUT = 0x40, - GRUB_ARC_COMPONENT_FLAG_IN = 0x20, + VasEBoot_ARC_COMPONENT_FLAG_OUT = 0x40, + VasEBoot_ARC_COMPONENT_FLAG_IN = 0x20, }; -struct grub_arc_component +struct VasEBoot_arc_component { - grub_arc_enum_t class; - grub_arc_enum_t type; - grub_arc_enum_t flags; - grub_arc_ushort_t version; - grub_arc_ushort_t rev; - grub_arc_ulong_t key; - grub_arc_ulong_t affinity; - grub_arc_ulong_t configdatasize; - grub_arc_ulong_t idlen; + VasEBoot_arc_enum_t class; + VasEBoot_arc_enum_t type; + VasEBoot_arc_enum_t flags; + VasEBoot_arc_ushort_t version; + VasEBoot_arc_ushort_t rev; + VasEBoot_arc_ulong_t key; + VasEBoot_arc_ulong_t affinity; + VasEBoot_arc_ulong_t configdatasize; + VasEBoot_arc_ulong_t idlen; const char *idstr; }; enum { -#ifdef GRUB_CPU_WORDS_BIGENDIAN - GRUB_ARC_COMPONENT_TYPE_ARC = 1, +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_ARC_COMPONENT_TYPE_ARC = 1, #else - GRUB_ARC_COMPONENT_TYPE_ARC, + VasEBoot_ARC_COMPONENT_TYPE_ARC, #endif - GRUB_ARC_COMPONENT_TYPE_CPU, - GRUB_ARC_COMPONENT_TYPE_FPU, - GRUB_ARC_COMPONENT_TYPE_PRI_I_CACHE, - GRUB_ARC_COMPONENT_TYPE_PRI_D_CACHE, - GRUB_ARC_COMPONENT_TYPE_SEC_I_CACHE, - GRUB_ARC_COMPONENT_TYPE_SEC_D_CACHE, - GRUB_ARC_COMPONENT_TYPE_SEC_CACHE, - GRUB_ARC_COMPONENT_TYPE_EISA, - GRUB_ARC_COMPONENT_TYPE_TCA, - GRUB_ARC_COMPONENT_TYPE_SCSI, - GRUB_ARC_COMPONENT_TYPE_DTIA, - GRUB_ARC_COMPONENT_TYPE_MULTIFUNC, - GRUB_ARC_COMPONENT_TYPE_DISK_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_TAPE_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_CDROM_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_WORM_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_SERIAL_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_NET_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_DISPLAY_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_PARALLEL_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_POINTER_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_KBD_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_AUDIO_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_OTHER_CONTROLLER, - GRUB_ARC_COMPONENT_TYPE_DISK, - GRUB_ARC_COMPONENT_TYPE_FLOPPY, - GRUB_ARC_COMPONENT_TYPE_TAPE, - GRUB_ARC_COMPONENT_TYPE_MODEM, - GRUB_ARC_COMPONENT_TYPE_MONITOR, - GRUB_ARC_COMPONENT_TYPE_PRINTER, - GRUB_ARC_COMPONENT_TYPE_POINTER, - GRUB_ARC_COMPONENT_TYPE_KBD, - GRUB_ARC_COMPONENT_TYPE_TERMINAL, -#ifndef GRUB_CPU_WORDS_BIGENDIAN - GRUB_ARC_COMPONENT_TYPE_OTHER_PERIPHERAL, + VasEBoot_ARC_COMPONENT_TYPE_CPU, + VasEBoot_ARC_COMPONENT_TYPE_FPU, + VasEBoot_ARC_COMPONENT_TYPE_PRI_I_CACHE, + VasEBoot_ARC_COMPONENT_TYPE_PRI_D_CACHE, + VasEBoot_ARC_COMPONENT_TYPE_SEC_I_CACHE, + VasEBoot_ARC_COMPONENT_TYPE_SEC_D_CACHE, + VasEBoot_ARC_COMPONENT_TYPE_SEC_CACHE, + VasEBoot_ARC_COMPONENT_TYPE_EISA, + VasEBoot_ARC_COMPONENT_TYPE_TCA, + VasEBoot_ARC_COMPONENT_TYPE_SCSI, + VasEBoot_ARC_COMPONENT_TYPE_DTIA, + VasEBoot_ARC_COMPONENT_TYPE_MULTIFUNC, + VasEBoot_ARC_COMPONENT_TYPE_DISK_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_TAPE_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_CDROM_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_WORM_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_SERIAL_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_NET_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_DISPLAY_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_PARALLEL_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_POINTER_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_KBD_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_AUDIO_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_OTHER_CONTROLLER, + VasEBoot_ARC_COMPONENT_TYPE_DISK, + VasEBoot_ARC_COMPONENT_TYPE_FLOPPY, + VasEBoot_ARC_COMPONENT_TYPE_TAPE, + VasEBoot_ARC_COMPONENT_TYPE_MODEM, + VasEBoot_ARC_COMPONENT_TYPE_MONITOR, + VasEBoot_ARC_COMPONENT_TYPE_PRINTER, + VasEBoot_ARC_COMPONENT_TYPE_POINTER, + VasEBoot_ARC_COMPONENT_TYPE_KBD, + VasEBoot_ARC_COMPONENT_TYPE_TERMINAL, +#ifndef VasEBoot_CPU_WORDS_BIGENDIAN + VasEBoot_ARC_COMPONENT_TYPE_OTHER_PERIPHERAL, #endif - GRUB_ARC_COMPONENT_TYPE_LINE, - GRUB_ARC_COMPONENT_TYPE_NET, - GRUB_ARC_COMPONENT_TYPE_MEMORY_UNIT, + VasEBoot_ARC_COMPONENT_TYPE_LINE, + VasEBoot_ARC_COMPONENT_TYPE_NET, + VasEBoot_ARC_COMPONENT_TYPE_MEMORY_UNIT, }; -enum grub_arc_file_access +enum VasEBoot_arc_file_access { - GRUB_ARC_FILE_ACCESS_OPEN_RO, - GRUB_ARC_FILE_ACCESS_OPEN_WO, - GRUB_ARC_FILE_ACCESS_OPEN_RW, + VasEBoot_ARC_FILE_ACCESS_OPEN_RO, + VasEBoot_ARC_FILE_ACCESS_OPEN_WO, + VasEBoot_ARC_FILE_ACCESS_OPEN_RW, }; -struct grub_arc_fileinfo +struct VasEBoot_arc_fileinfo { - grub_arc_ularge_t start; - grub_arc_ularge_t end; - grub_arc_ularge_t current; - grub_arc_enum_t type; - grub_arc_ulong_t fnamelength; - grub_arc_uchar_t attr; + VasEBoot_arc_ularge_t start; + VasEBoot_arc_ularge_t end; + VasEBoot_arc_ularge_t current; + VasEBoot_arc_enum_t type; + VasEBoot_arc_ulong_t fnamelength; + VasEBoot_arc_uchar_t attr; char filename[32]; }; -struct grub_arc_firmware_vector +struct VasEBoot_arc_firmware_vector { /* 0x00. */ void *load; @@ -181,8 +181,8 @@ struct grub_arc_firmware_vector /* 0x20. */ void *reserved1; - const struct grub_arc_component * (*getpeer) (const struct grub_arc_component *comp); - const struct grub_arc_component * (*getchild) (const struct grub_arc_component *comp); + const struct VasEBoot_arc_component * (*getpeer) (const struct VasEBoot_arc_component *comp); + const struct VasEBoot_arc_component * (*getchild) (const struct VasEBoot_arc_component *comp); void *getparent; /* 0x30. */ @@ -194,91 +194,91 @@ struct grub_arc_firmware_vector /* 0x40. */ void *saveconfiguration; void *getsystemid; - struct grub_arc_memory_descriptor *(*getmemorydescriptor) (struct grub_arc_memory_descriptor *current); + struct VasEBoot_arc_memory_descriptor *(*getmemorydescriptor) (struct VasEBoot_arc_memory_descriptor *current); void *reserved2; /* 0x50. */ - struct grub_arc_timeinfo *(*gettime) (void); + struct VasEBoot_arc_timeinfo *(*gettime) (void); void *getrelativetime; void *getdirectoryentry; - grub_arc_err_t (*open) (const char *path, grub_arc_enum_t mode, - grub_arc_fileno_t *fileno); + VasEBoot_arc_err_t (*open) (const char *path, VasEBoot_arc_enum_t mode, + VasEBoot_arc_fileno_t *fileno); /* 0x60. */ - grub_arc_err_t (*close) (grub_arc_fileno_t fileno); - grub_arc_err_t (*read) (grub_arc_fileno_t fileno, void *buf, - grub_arc_ulong_t n, - grub_arc_ulong_t *count); - grub_arc_err_t (*get_read_status) (grub_arc_fileno_t fileno); - grub_arc_err_t (*write) (grub_arc_fileno_t fileno, const void *buf, - grub_arc_ulong_t n, - grub_arc_ulong_t *count); + VasEBoot_arc_err_t (*close) (VasEBoot_arc_fileno_t fileno); + VasEBoot_arc_err_t (*read) (VasEBoot_arc_fileno_t fileno, void *buf, + VasEBoot_arc_ulong_t n, + VasEBoot_arc_ulong_t *count); + VasEBoot_arc_err_t (*get_read_status) (VasEBoot_arc_fileno_t fileno); + VasEBoot_arc_err_t (*write) (VasEBoot_arc_fileno_t fileno, const void *buf, + VasEBoot_arc_ulong_t n, + VasEBoot_arc_ulong_t *count); /* 0x70. */ - grub_arc_err_t (*seek) (grub_arc_fileno_t fileno, - grub_arc_ularge_t *pos, grub_arc_enum_t mode); + VasEBoot_arc_err_t (*seek) (VasEBoot_arc_fileno_t fileno, + VasEBoot_arc_ularge_t *pos, VasEBoot_arc_enum_t mode); void *mount; const char * (*getenvironmentvariable) (const char *name); void *setenvironmentvariable; /* 0x80. */ - grub_arc_err_t (*getfileinformation) (grub_arc_fileno_t fileno, - struct grub_arc_fileinfo *info); + VasEBoot_arc_err_t (*getfileinformation) (VasEBoot_arc_fileno_t fileno, + struct VasEBoot_arc_fileinfo *info); void *setfileinformation; void *flushallcaches; void *testunicodecharacter; /* 0x90. */ - struct grub_arc_display_status * (*getdisplaystatus) (grub_arc_fileno_t fileno); + struct VasEBoot_arc_display_status * (*getdisplaystatus) (VasEBoot_arc_fileno_t fileno); }; -struct grub_arc_adapter +struct VasEBoot_arc_adapter { - grub_arc_ulong_t adapter_type; - grub_arc_ulong_t adapter_vector_length; + VasEBoot_arc_ulong_t adapter_type; + VasEBoot_arc_ulong_t adapter_vector_length; void *adapter_vector; }; -struct grub_arc_system_parameter_block +struct VasEBoot_arc_system_parameter_block { - grub_arc_ulong_t signature; - grub_arc_ulong_t length; - grub_arc_ushort_t version; - grub_arc_ushort_t revision; + VasEBoot_arc_ulong_t signature; + VasEBoot_arc_ulong_t length; + VasEBoot_arc_ushort_t version; + VasEBoot_arc_ushort_t revision; void *restartblock; void *debugblock; void *gevector; void *utlbmissvector; - grub_arc_ulong_t firmware_vector_length; - struct grub_arc_firmware_vector *firmwarevector; - grub_arc_ulong_t private_vector_length; + VasEBoot_arc_ulong_t firmware_vector_length; + struct VasEBoot_arc_firmware_vector *firmwarevector; + VasEBoot_arc_ulong_t private_vector_length; void *private_vector; - grub_arc_ulong_t adapter_count; - struct grub_arc_adapter adapters[0]; + VasEBoot_arc_ulong_t adapter_count; + struct VasEBoot_arc_adapter adapters[0]; }; -#define GRUB_ARC_SYSTEM_PARAMETER_BLOCK ((struct grub_arc_system_parameter_block *) 0xa0001000) -#define GRUB_ARC_FIRMWARE_VECTOR (GRUB_ARC_SYSTEM_PARAMETER_BLOCK->firmwarevector) -#define GRUB_ARC_STDIN 0 -#define GRUB_ARC_STDOUT 1 +#define VasEBoot_ARC_SYSTEM_PARAMETER_BLOCK ((struct VasEBoot_arc_system_parameter_block *) 0xa0001000) +#define VasEBoot_ARC_FIRMWARE_VECTOR (VasEBoot_ARC_SYSTEM_PARAMETER_BLOCK->firmwarevector) +#define VasEBoot_ARC_STDIN 0 +#define VasEBoot_ARC_STDOUT 1 -typedef int (*grub_arc_iterate_devs_hook_t) - (const char *name, const struct grub_arc_component *comp, void *data); +typedef int (*VasEBoot_arc_iterate_devs_hook_t) + (const char *name, const struct VasEBoot_arc_component *comp, void *data); -int EXPORT_FUNC (grub_arc_iterate_devs) (grub_arc_iterate_devs_hook_t hook, +int EXPORT_FUNC (VasEBoot_arc_iterate_devs) (VasEBoot_arc_iterate_devs_hook_t hook, void *hook_data, int alt_names); -char *EXPORT_FUNC (grub_arc_alt_name_to_norm) (const char *name, const char *suffix); +char *EXPORT_FUNC (VasEBoot_arc_alt_name_to_norm) (const char *name, const char *suffix); -int EXPORT_FUNC (grub_arc_is_device_serial) (const char *name, int alt_names); +int EXPORT_FUNC (VasEBoot_arc_is_device_serial) (const char *name, int alt_names); -#define FOR_ARC_CHILDREN(comp, parent) for (comp = GRUB_ARC_FIRMWARE_VECTOR->getchild (parent); comp; comp = GRUB_ARC_FIRMWARE_VECTOR->getpeer (comp)) +#define FOR_ARC_CHILDREN(comp, parent) for (comp = VasEBoot_ARC_FIRMWARE_VECTOR->getchild (parent); comp; comp = VasEBoot_ARC_FIRMWARE_VECTOR->getpeer (comp)) -extern void grub_arcdisk_init (void); -extern void grub_arcdisk_fini (void); +extern void VasEBoot_arcdisk_init (void); +extern void VasEBoot_arcdisk_fini (void); #endif diff --git a/include/VasEBoot/arc/console.h b/include/VasEBoot/arc/console.h index e054f54f5..3afb849b4 100644 --- a/include/VasEBoot/arc/console.h +++ b/include/VasEBoot/arc/console.h @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CONSOLE_MACHINE_HEADER -#define GRUB_CONSOLE_MACHINE_HEADER 1 +#ifndef VasEBoot_CONSOLE_MACHINE_HEADER +#define VasEBoot_CONSOLE_MACHINE_HEADER 1 -#include +#include /* Initialize the console system. */ -void grub_console_init_early (void); -void grub_console_init_lately (void); +void VasEBoot_console_init_early (void); +void VasEBoot_console_init_lately (void); /* Finish the console system. */ -void grub_console_fini (void); +void VasEBoot_console_fini (void); -#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */ +#endif /* ! VasEBoot_CONSOLE_MACHINE_HEADER */ diff --git a/include/VasEBoot/archelp.h b/include/VasEBoot/archelp.h index 2611d7f45..327158f64 100644 --- a/include/VasEBoot/archelp.h +++ b/include/VasEBoot/archelp.h @@ -1,63 +1,63 @@ /* archelp.h -- Archive helper functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ARCHELP_HEADER -#define GRUB_ARCHELP_HEADER 1 +#ifndef VasEBoot_ARCHELP_HEADER +#define VasEBoot_ARCHELP_HEADER 1 -#include -#include +#include +#include typedef enum { - GRUB_ARCHELP_ATTR_TYPE = 0160000, - GRUB_ARCHELP_ATTR_FILE = 0100000, - GRUB_ARCHELP_ATTR_DIR = 0040000, - GRUB_ARCHELP_ATTR_LNK = 0120000, - GRUB_ARCHELP_ATTR_NOTIME = 0x80000000, - GRUB_ARCHELP_ATTR_END = 0xffffffff - } grub_archelp_mode_t; + VasEBoot_ARCHELP_ATTR_TYPE = 0160000, + VasEBoot_ARCHELP_ATTR_FILE = 0100000, + VasEBoot_ARCHELP_ATTR_DIR = 0040000, + VasEBoot_ARCHELP_ATTR_LNK = 0120000, + VasEBoot_ARCHELP_ATTR_NOTIME = 0x80000000, + VasEBoot_ARCHELP_ATTR_END = 0xffffffff + } VasEBoot_archelp_mode_t; -struct grub_archelp_data; +struct VasEBoot_archelp_data; -struct grub_archelp_ops +struct VasEBoot_archelp_ops { - grub_err_t - (*find_file) (struct grub_archelp_data *data, char **name, - grub_int32_t *mtime, - grub_archelp_mode_t *mode); + VasEBoot_err_t + (*find_file) (struct VasEBoot_archelp_data *data, char **name, + VasEBoot_int32_t *mtime, + VasEBoot_archelp_mode_t *mode); char * - (*get_link_target) (struct grub_archelp_data *data); + (*get_link_target) (struct VasEBoot_archelp_data *data); void - (*rewind) (struct grub_archelp_data *data); + (*rewind) (struct VasEBoot_archelp_data *data); }; -grub_err_t -grub_archelp_dir (struct grub_archelp_data *data, - struct grub_archelp_ops *ops, +VasEBoot_err_t +VasEBoot_archelp_dir (struct VasEBoot_archelp_data *data, + struct VasEBoot_archelp_ops *ops, const char *path_in, - grub_fs_dir_hook_t hook, void *hook_data); + VasEBoot_fs_dir_hook_t hook, void *hook_data); -grub_err_t -grub_archelp_open (struct grub_archelp_data *data, - struct grub_archelp_ops *ops, +VasEBoot_err_t +VasEBoot_archelp_open (struct VasEBoot_archelp_data *data, + struct VasEBoot_archelp_ops *ops, const char *name_in); #endif diff --git a/include/VasEBoot/arm/efi/loader.h b/include/VasEBoot/arm/efi/loader.h index 4bab18e83..3444b77a4 100644 --- a/include/VasEBoot/arm/efi/loader.h +++ b/include/VasEBoot/arm/efi/loader.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LOADER_MACHINE_HEADER -#define GRUB_LOADER_MACHINE_HEADER 1 +#ifndef VasEBoot_LOADER_MACHINE_HEADER +#define VasEBoot_LOADER_MACHINE_HEADER 1 -grub_err_t EXPORT_FUNC (grub_efi_prepare_platform) (void); -void * EXPORT_FUNC (grub_efi_allocate_loader_memory) (grub_uint32_t min_offset, - grub_uint32_t size); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_efi_prepare_platform) (void); +void * EXPORT_FUNC (VasEBoot_efi_allocate_loader_memory) (VasEBoot_uint32_t min_offset, + VasEBoot_uint32_t size); -#endif /* ! GRUB_LOADER_MACHINE_HEADER */ +#endif /* ! VasEBoot_LOADER_MACHINE_HEADER */ diff --git a/include/VasEBoot/arm/efi/memory.h b/include/VasEBoot/arm/efi/memory.h index 2c64918e3..ef51aaac7 100644 --- a/include/VasEBoot/arm/efi/memory.h +++ b/include/VasEBoot/arm/efi/memory.h @@ -1,6 +1,6 @@ -#ifndef GRUB_MEMORY_CPU_HEADER -#include +#ifndef VasEBoot_MEMORY_CPU_HEADER +#include -#define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffff +#define VasEBoot_EFI_MAX_USABLE_ADDRESS 0xffffffff -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/arm/linux.h b/include/VasEBoot/arm/linux.h index a66caad13..4c186273f 100644 --- a/include/VasEBoot/arm/linux.h +++ b/include/VasEBoot/arm/linux.h @@ -1,53 +1,53 @@ /* linux.h - ARM linux specific definitions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LINUX_CPU_HEADER -#define GRUB_LINUX_CPU_HEADER 1 +#ifndef VasEBoot_LINUX_CPU_HEADER +#define VasEBoot_LINUX_CPU_HEADER 1 #define LINUX_ZIMAGE_OFFSET 0x24 #define LINUX_ZIMAGE_MAGIC 0x016f2818 #include "system.h" -#if defined GRUB_MACHINE_UBOOT -# include +#if defined VasEBoot_MACHINE_UBOOT +# include # define LINUX_ADDRESS (start_of_ram + 0x8000) # define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000) # define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000) -# define grub_arm_firmware_get_boot_data grub_uboot_get_boot_data -# define grub_arm_firmware_get_machine_type grub_uboot_get_machine_type -#elif defined GRUB_MACHINE_EFI -# include -# include +# define VasEBoot_arm_firmware_get_boot_data VasEBoot_uboot_get_boot_data +# define VasEBoot_arm_firmware_get_machine_type VasEBoot_uboot_get_machine_type +#elif defined VasEBoot_MACHINE_EFI +# include +# include /* On UEFI platforms - load the images at the lowest available address not less than *_PHYS_OFFSET from the first available memory location. */ # define LINUX_PHYS_OFFSET (0x00008000) # define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000) # define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000) -# define grub_arm_firmware_get_boot_data (grub_addr_t)grub_efi_get_firmware_fdt -static inline grub_uint32_t -grub_arm_firmware_get_machine_type (void) +# define VasEBoot_arm_firmware_get_boot_data (VasEBoot_addr_t)VasEBoot_efi_get_firmware_fdt +static inline VasEBoot_uint32_t +VasEBoot_arm_firmware_get_machine_type (void) { - return GRUB_ARM_MACHINE_TYPE_FDT; + return VasEBoot_ARM_MACHINE_TYPE_FDT; } #endif #define FDT_ADDITIONAL_ENTRIES_SIZE 0x300 -#endif /* ! GRUB_LINUX_CPU_HEADER */ +#endif /* ! VasEBoot_LINUX_CPU_HEADER */ diff --git a/include/VasEBoot/arm/reloc.h b/include/VasEBoot/arm/reloc.h index ae92e21f1..48963149b 100644 --- a/include/VasEBoot/arm/reloc.h +++ b/include/VasEBoot/arm/reloc.h @@ -1,51 +1,51 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ARM_RELOC_H -#define GRUB_ARM_RELOC_H 1 +#ifndef VasEBoot_ARM_RELOC_H +#define VasEBoot_ARM_RELOC_H 1 -grub_err_t grub_arm_reloc_abs32 (grub_uint32_t *addr, Elf32_Addr sym_addr); +VasEBoot_err_t VasEBoot_arm_reloc_abs32 (VasEBoot_uint32_t *addr, Elf32_Addr sym_addr); int -grub_arm_thm_call_check_offset (grub_int32_t offset, int is_thumb); -grub_int32_t -grub_arm_thm_call_get_offset (grub_uint16_t *target); -grub_err_t -grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset); +VasEBoot_arm_thm_call_check_offset (VasEBoot_int32_t offset, int is_thumb); +VasEBoot_int32_t +VasEBoot_arm_thm_call_get_offset (VasEBoot_uint16_t *target); +VasEBoot_err_t +VasEBoot_arm_thm_call_set_offset (VasEBoot_uint16_t *target, VasEBoot_int32_t offset); -grub_int32_t -grub_arm_thm_jump19_get_offset (grub_uint16_t *target); +VasEBoot_int32_t +VasEBoot_arm_thm_jump19_get_offset (VasEBoot_uint16_t *target); void -grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset); +VasEBoot_arm_thm_jump19_set_offset (VasEBoot_uint16_t *target, VasEBoot_int32_t offset); int -grub_arm_thm_jump19_check_offset (grub_int32_t offset); +VasEBoot_arm_thm_jump19_check_offset (VasEBoot_int32_t offset); -grub_int32_t -grub_arm_jump24_get_offset (grub_uint32_t *target); +VasEBoot_int32_t +VasEBoot_arm_jump24_get_offset (VasEBoot_uint32_t *target); int -grub_arm_jump24_check_offset (grub_int32_t offset); +VasEBoot_arm_jump24_check_offset (VasEBoot_int32_t offset); void -grub_arm_jump24_set_offset (grub_uint32_t *target, - grub_int32_t offset); +VasEBoot_arm_jump24_set_offset (VasEBoot_uint32_t *target, + VasEBoot_int32_t offset); -grub_uint16_t -grub_arm_thm_movw_movt_get_value (grub_uint16_t *target); +VasEBoot_uint16_t +VasEBoot_arm_thm_movw_movt_get_value (VasEBoot_uint16_t *target); void -grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value); +VasEBoot_arm_thm_movw_movt_set_value (VasEBoot_uint16_t *target, VasEBoot_uint16_t value); #endif diff --git a/include/VasEBoot/arm/setjmp.h b/include/VasEBoot/arm/setjmp.h index 7990f2eb3..84675b708 100644 --- a/include/VasEBoot/arm/setjmp.h +++ b/include/VasEBoot/arm/setjmp.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -typedef unsigned long grub_jmp_buf[10]; +typedef unsigned long VasEBoot_jmp_buf[10]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)); -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/arm/system.h b/include/VasEBoot/arm/system.h index f62c18c13..5a749e1f2 100644 --- a/include/VasEBoot/arm/system.h +++ b/include/VasEBoot/arm/system.h @@ -1,18 +1,18 @@ -#ifndef GRUB_SYSTEM_CPU_HEADER -#define GRUB_SYSTEM_CPU_HEADER +#ifndef VasEBoot_SYSTEM_CPU_HEADER +#define VasEBoot_SYSTEM_CPU_HEADER -#include +#include enum { - GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI = 3138, - GRUB_ARM_MACHINE_TYPE_FDT = 0xFFFFFFFF + VasEBoot_ARM_MACHINE_TYPE_RASPBERRY_PI = 3138, + VasEBoot_ARM_MACHINE_TYPE_FDT = 0xFFFFFFFF }; -void EXPORT_FUNC(grub_arm_disable_caches_mmu) (void); -void grub_arm_enable_caches_mmu (void); -void grub_arm_enable_mmu (grub_uint32_t *mmu_tables); -void grub_arm_clear_mmu_v6 (void); +void EXPORT_FUNC(VasEBoot_arm_disable_caches_mmu) (void); +void VasEBoot_arm_enable_caches_mmu (void); +void VasEBoot_arm_enable_mmu (VasEBoot_uint32_t *mmu_tables); +void VasEBoot_arm_clear_mmu_v6 (void); -#endif /* ! GRUB_SYSTEM_CPU_HEADER */ +#endif /* ! VasEBoot_SYSTEM_CPU_HEADER */ diff --git a/include/VasEBoot/arm/time.h b/include/VasEBoot/arm/time.h index 4128506cb..f4cb329d9 100644 --- a/include/VasEBoot/arm/time.h +++ b/include/VasEBoot/arm/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: this can't work until we handle interrupts. */ /* __asm__ __volatile__ ("wfi"); */ diff --git a/include/VasEBoot/arm/types.h b/include/VasEBoot/arm/types.h index 4a806d05e..dd6d99206 100644 --- a/include/VasEBoot/arm/types.h +++ b/include/VasEBoot/arm/types.h @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 4 +#define VasEBoot_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 4 +#define VasEBoot_TARGET_SIZEOF_LONG 4 /* currently only support little-endian. */ -#undef GRUB_TARGET_WORDS_BIGENDIAN +#undef VasEBoot_TARGET_WORDS_BIGENDIAN /* Unaligned accesses only supported if MMU enabled */ -//#define GRUB_HAVE_UNALIGNED_ACCESS 1 +//#define VasEBoot_HAVE_UNALIGNED_ACCESS 1 -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/arm/uboot/kernel.h b/include/VasEBoot/arm/uboot/kernel.h index ce0b149cc..f4b5f52c7 100644 --- a/include/VasEBoot/arm/uboot/kernel.h +++ b/include/VasEBoot/arm/uboot/kernel.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 +#ifndef VasEBoot_KERNEL_MACHINE_HEADER +#define VasEBoot_KERNEL_MACHINE_HEADER 1 #ifndef ASM_FILE -#include -#include +#include +#include #endif /* ! ASM_FILE */ -#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE -#define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (16 * 1024 * 1024) +#define VasEBoot_KERNEL_MACHINE_STACK_SIZE VasEBoot_KERNEL_ARM_STACK_SIZE +#define VasEBoot_KERNEL_MACHINE_HEAP_SIZE (VasEBoot_size_t) (16 * 1024 * 1024) -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +#endif /* ! VasEBoot_KERNEL_MACHINE_HEADER */ diff --git a/include/VasEBoot/arm64/efi/memory.h b/include/VasEBoot/arm64/efi/memory.h index c6cb32417..cc13c6c9a 100644 --- a/include/VasEBoot/arm64/efi/memory.h +++ b/include/VasEBoot/arm64/efi/memory.h @@ -1,6 +1,6 @@ -#ifndef GRUB_MEMORY_CPU_HEADER -#include +#ifndef VasEBoot_MEMORY_CPU_HEADER +#include -#define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffffffffULL +#define VasEBoot_EFI_MAX_USABLE_ADDRESS 0xffffffffffffULL -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/arm64/fdtload.h b/include/VasEBoot/arm64/fdtload.h index 7b9ddba91..8115f37dc 100644 --- a/include/VasEBoot/arm64/fdtload.h +++ b/include/VasEBoot/arm64/fdtload.h @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013-2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FDTLOAD_CPU_HEADER -#define GRUB_FDTLOAD_CPU_HEADER 1 +#ifndef VasEBoot_FDTLOAD_CPU_HEADER +#define VasEBoot_FDTLOAD_CPU_HEADER 1 -#include -#include +#include +#include void * -grub_fdt_load (grub_size_t additional_size); +VasEBoot_fdt_load (VasEBoot_size_t additional_size); void -grub_fdt_unload (void); -grub_err_t -grub_fdt_install (void); +VasEBoot_fdt_unload (void); +VasEBoot_err_t +VasEBoot_fdt_install (void); -#define GRUB_EFI_PAGE_SHIFT 12 -#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) +#define VasEBoot_EFI_PAGE_SHIFT 12 +#define VasEBoot_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> VasEBoot_EFI_PAGE_SHIFT) #endif diff --git a/include/VasEBoot/arm64/linux.h b/include/VasEBoot/arm64/linux.h index 1ea23696e..800c86213 100644 --- a/include/VasEBoot/arm64/linux.h +++ b/include/VasEBoot/arm64/linux.h @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LINUX_CPU_HEADER -#define GRUB_LINUX_CPU_HEADER 1 +#ifndef VasEBoot_LINUX_CPU_HEADER +#define VasEBoot_LINUX_CPU_HEADER 1 -#include +#include -#define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ +#define VasEBoot_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ -#define GRUB_EFI_PE_MAGIC 0x5A4D +#define VasEBoot_EFI_PE_MAGIC 0x5A4D /* From linux/Documentation/arm64/booting.txt */ -struct grub_arm64_linux_kernel_header +struct VasEBoot_arm64_linux_kernel_header { - grub_uint32_t code0; /* Executable code */ - grub_uint32_t code1; /* Executable code */ - grub_uint64_t text_offset; /* Image load offset */ - grub_uint64_t res0; /* reserved */ - grub_uint64_t res1; /* reserved */ - grub_uint64_t res2; /* reserved */ - grub_uint64_t res3; /* reserved */ - grub_uint64_t res4; /* reserved */ - grub_uint32_t magic; /* Magic number, little endian, "ARM\x64" */ - grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ + VasEBoot_uint32_t code0; /* Executable code */ + VasEBoot_uint32_t code1; /* Executable code */ + VasEBoot_uint64_t text_offset; /* Image load offset */ + VasEBoot_uint64_t res0; /* reserved */ + VasEBoot_uint64_t res1; /* reserved */ + VasEBoot_uint64_t res2; /* reserved */ + VasEBoot_uint64_t res3; /* reserved */ + VasEBoot_uint64_t res4; /* reserved */ + VasEBoot_uint32_t magic; /* Magic number, little endian, "ARM\x64" */ + VasEBoot_uint32_t hdr_offset; /* Offset of PE/COFF header */ }; -grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header +VasEBoot_err_t VasEBoot_arm64_uefi_check_image (struct VasEBoot_arm64_linux_kernel_header *lh); -grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, +VasEBoot_err_t VasEBoot_arm64_uefi_boot_image (VasEBoot_addr_t addr, VasEBoot_size_t size, char *args); -#endif /* ! GRUB_LINUX_CPU_HEADER */ +#endif /* ! VasEBoot_LINUX_CPU_HEADER */ diff --git a/include/VasEBoot/arm64/reloc.h b/include/VasEBoot/arm64/reloc.h index c8765de97..6072c8c08 100644 --- a/include/VasEBoot/arm64/reloc.h +++ b/include/VasEBoot/arm64/reloc.h @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ARM64_RELOC_H -#define GRUB_ARM64_RELOC_H 1 +#ifndef VasEBoot_ARM64_RELOC_H +#define VasEBoot_ARM64_RELOC_H 1 -struct grub_arm64_trampoline +struct VasEBoot_arm64_trampoline { - grub_uint32_t ldr; /* ldr x16, 8 */ - grub_uint32_t br; /* br x16 */ - grub_uint64_t addr; + VasEBoot_uint32_t ldr; /* ldr x16, 8 */ + VasEBoot_uint32_t br; /* br x16 */ + VasEBoot_uint64_t addr; }; -int grub_arm_64_check_xxxx26_offset (grub_int64_t offset); +int VasEBoot_arm_64_check_xxxx26_offset (VasEBoot_int64_t offset); void -grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset); +VasEBoot_arm64_set_xxxx26_offset (VasEBoot_uint32_t *place, VasEBoot_int64_t offset); int -grub_arm64_check_hi21_signed (grub_int64_t offset); +VasEBoot_arm64_check_hi21_signed (VasEBoot_int64_t offset); void -grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset); +VasEBoot_arm64_set_hi21 (VasEBoot_uint32_t *place, VasEBoot_int64_t offset); void -grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target); +VasEBoot_arm64_set_abs_lo12 (VasEBoot_uint32_t *place, VasEBoot_int64_t target); void -grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target); +VasEBoot_arm64_set_abs_lo12_ldst64 (VasEBoot_uint32_t *place, VasEBoot_int64_t target); #endif diff --git a/include/VasEBoot/arm64/setjmp.h b/include/VasEBoot/arm64/setjmp.h index 3ff7dfbf3..127dc4b17 100644 --- a/include/VasEBoot/arm64/setjmp.h +++ b/include/VasEBoot/arm64/setjmp.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -typedef unsigned long long grub_jmp_buf[13]; +typedef unsigned long long VasEBoot_jmp_buf[13]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)); -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/arm64/time.h b/include/VasEBoot/arm64/time.h index 4128506cb..f4cb329d9 100644 --- a/include/VasEBoot/arm64/time.h +++ b/include/VasEBoot/arm64/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: this can't work until we handle interrupts. */ /* __asm__ __volatile__ ("wfi"); */ diff --git a/include/VasEBoot/arm64/types.h b/include/VasEBoot/arm64/types.h index d132c5eab..421f72dba 100644 --- a/include/VasEBoot/arm64/types.h +++ b/include/VasEBoot/arm64/types.h @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 8 +#define VasEBoot_TARGET_SIZEOF_VOID_P 8 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 8 +#define VasEBoot_TARGET_SIZEOF_LONG 8 /* currently only support little-endian. */ -#undef GRUB_TARGET_WORDS_BIGENDIAN +#undef VasEBoot_TARGET_WORDS_BIGENDIAN /* Unaligned accesses only supported if MMU enabled */ -#undef GRUB_HAVE_UNALIGNED_ACCESS +#undef VasEBoot_HAVE_UNALIGNED_ACCESS -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/at_keyboard.h b/include/VasEBoot/at_keyboard.h index b4f8ff0a0..c54093f98 100644 --- a/include/VasEBoot/at_keyboard.h +++ b/include/VasEBoot/at_keyboard.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_AT_KEYBOARD_HEADER -#define GRUB_AT_KEYBOARD_HEADER 1 +#ifndef VasEBoot_AT_KEYBOARD_HEADER +#define VasEBoot_AT_KEYBOARD_HEADER 1 /* Used for sending commands to the controller. */ #define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02) @@ -27,16 +27,16 @@ #define KEYBOARD_AT_TRANSLATE 0x40 -#define GRUB_AT_ACK 0xfa -#define GRUB_AT_NACK 0xfe -#define GRUB_AT_TRIES 5 +#define VasEBoot_AT_ACK 0xfa +#define VasEBoot_AT_NACK 0xfe +#define VasEBoot_AT_TRIES 5 #define KEYBOARD_ISMAKE(x) !((x) & 0x80) #define KEYBOARD_ISREADY(x) ((x) & 0x01) #define KEYBOARD_SCANCODE(x) ((x) & 0x7f) -extern void grub_at_keyboard_init (void); -extern void grub_at_keyboard_fini (void); -int grub_at_keyboard_is_alive (void); +extern void VasEBoot_at_keyboard_init (void); +extern void VasEBoot_at_keyboard_fini (void); +int VasEBoot_at_keyboard_is_alive (void); #endif diff --git a/include/VasEBoot/ata.h b/include/VasEBoot/ata.h index e8a84b86a..1c06c572c 100644 --- a/include/VasEBoot/ata.h +++ b/include/VasEBoot/ata.h @@ -1,225 +1,225 @@ /* ata.h - ATA disk access. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ATA_HEADER -#define GRUB_ATA_HEADER 1 +#ifndef VasEBoot_ATA_HEADER +#define VasEBoot_ATA_HEADER 1 -#include -#include -#include +#include +#include +#include /* XXX: For now this only works on i386. */ -#include +#include typedef enum { - GRUB_ATA_CHS, - GRUB_ATA_LBA, - GRUB_ATA_LBA48 - } grub_ata_addressing_t; + VasEBoot_ATA_CHS, + VasEBoot_ATA_LBA, + VasEBoot_ATA_LBA48 + } VasEBoot_ata_addressing_t; -#define GRUB_ATA_CH0_PORT1 0x1f0 -#define GRUB_ATA_CH1_PORT1 0x170 +#define VasEBoot_ATA_CH0_PORT1 0x1f0 +#define VasEBoot_ATA_CH1_PORT1 0x170 -#define GRUB_ATA_CH0_PORT2 0x3f6 -#define GRUB_ATA_CH1_PORT2 0x376 +#define VasEBoot_ATA_CH0_PORT2 0x3f6 +#define VasEBoot_ATA_CH1_PORT2 0x376 -#define GRUB_ATA_REG_DATA 0 -#define GRUB_ATA_REG_ERROR 1 -#define GRUB_ATA_REG_FEATURES 1 -#define GRUB_ATA_REG_SECTORS 2 -#define GRUB_ATAPI_REG_IREASON 2 -#define GRUB_ATA_REG_SECTNUM 3 -#define GRUB_ATA_REG_CYLLSB 4 -#define GRUB_ATA_REG_CYLMSB 5 -#define GRUB_ATA_REG_LBALOW 3 -#define GRUB_ATA_REG_LBAMID 4 -#define GRUB_ATAPI_REG_CNTLOW 4 -#define GRUB_ATA_REG_LBAHIGH 5 -#define GRUB_ATAPI_REG_CNTHIGH 5 -#define GRUB_ATA_REG_DISK 6 -#define GRUB_ATA_REG_CMD 7 -#define GRUB_ATA_REG_STATUS 7 +#define VasEBoot_ATA_REG_DATA 0 +#define VasEBoot_ATA_REG_ERROR 1 +#define VasEBoot_ATA_REG_FEATURES 1 +#define VasEBoot_ATA_REG_SECTORS 2 +#define VasEBoot_ATAPI_REG_IREASON 2 +#define VasEBoot_ATA_REG_SECTNUM 3 +#define VasEBoot_ATA_REG_CYLLSB 4 +#define VasEBoot_ATA_REG_CYLMSB 5 +#define VasEBoot_ATA_REG_LBALOW 3 +#define VasEBoot_ATA_REG_LBAMID 4 +#define VasEBoot_ATAPI_REG_CNTLOW 4 +#define VasEBoot_ATA_REG_LBAHIGH 5 +#define VasEBoot_ATAPI_REG_CNTHIGH 5 +#define VasEBoot_ATA_REG_DISK 6 +#define VasEBoot_ATA_REG_CMD 7 +#define VasEBoot_ATA_REG_STATUS 7 -#define GRUB_ATA_REG2_CONTROL 0 +#define VasEBoot_ATA_REG2_CONTROL 0 -#define GRUB_ATA_STATUS_ERR 0x01 -#define GRUB_ATA_STATUS_INDEX 0x02 -#define GRUB_ATA_STATUS_ECC 0x04 -#define GRUB_ATA_STATUS_DRQ 0x08 -#define GRUB_ATA_STATUS_SEEK 0x10 -#define GRUB_ATA_STATUS_WRERR 0x20 -#define GRUB_ATA_STATUS_READY 0x40 -#define GRUB_ATA_STATUS_BUSY 0x80 +#define VasEBoot_ATA_STATUS_ERR 0x01 +#define VasEBoot_ATA_STATUS_INDEX 0x02 +#define VasEBoot_ATA_STATUS_ECC 0x04 +#define VasEBoot_ATA_STATUS_DRQ 0x08 +#define VasEBoot_ATA_STATUS_SEEK 0x10 +#define VasEBoot_ATA_STATUS_WRERR 0x20 +#define VasEBoot_ATA_STATUS_READY 0x40 +#define VasEBoot_ATA_STATUS_BUSY 0x80 /* ATAPI interrupt reason values (I/O, D/C bits). */ -#define GRUB_ATAPI_IREASON_MASK 0x3 -#define GRUB_ATAPI_IREASON_DATA_OUT 0x0 -#define GRUB_ATAPI_IREASON_CMD_OUT 0x1 -#define GRUB_ATAPI_IREASON_DATA_IN 0x2 -#define GRUB_ATAPI_IREASON_ERROR 0x3 +#define VasEBoot_ATAPI_IREASON_MASK 0x3 +#define VasEBoot_ATAPI_IREASON_DATA_OUT 0x0 +#define VasEBoot_ATAPI_IREASON_CMD_OUT 0x1 +#define VasEBoot_ATAPI_IREASON_DATA_IN 0x2 +#define VasEBoot_ATAPI_IREASON_ERROR 0x3 -enum grub_ata_commands +enum VasEBoot_ata_commands { - GRUB_ATA_CMD_CHECK_POWER_MODE = 0xe5, - GRUB_ATA_CMD_IDENTIFY_DEVICE = 0xec, - GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE = 0xa1, - GRUB_ATA_CMD_IDLE = 0xe3, - GRUB_ATA_CMD_PACKET = 0xa0, - GRUB_ATA_CMD_READ_SECTORS = 0x20, - GRUB_ATA_CMD_READ_SECTORS_EXT = 0x24, - GRUB_ATA_CMD_READ_SECTORS_DMA = 0xc8, - GRUB_ATA_CMD_READ_SECTORS_DMA_EXT = 0x25, + VasEBoot_ATA_CMD_CHECK_POWER_MODE = 0xe5, + VasEBoot_ATA_CMD_IDENTIFY_DEVICE = 0xec, + VasEBoot_ATA_CMD_IDENTIFY_PACKET_DEVICE = 0xa1, + VasEBoot_ATA_CMD_IDLE = 0xe3, + VasEBoot_ATA_CMD_PACKET = 0xa0, + VasEBoot_ATA_CMD_READ_SECTORS = 0x20, + VasEBoot_ATA_CMD_READ_SECTORS_EXT = 0x24, + VasEBoot_ATA_CMD_READ_SECTORS_DMA = 0xc8, + VasEBoot_ATA_CMD_READ_SECTORS_DMA_EXT = 0x25, - GRUB_ATA_CMD_SECURITY_FREEZE_LOCK = 0xf5, - GRUB_ATA_CMD_SET_FEATURES = 0xef, - GRUB_ATA_CMD_SLEEP = 0xe6, - GRUB_ATA_CMD_SMART = 0xb0, - GRUB_ATA_CMD_STANDBY_IMMEDIATE = 0xe0, - GRUB_ATA_CMD_WRITE_SECTORS = 0x30, - GRUB_ATA_CMD_WRITE_SECTORS_EXT = 0x34, - GRUB_ATA_CMD_WRITE_SECTORS_DMA_EXT = 0x35, - GRUB_ATA_CMD_WRITE_SECTORS_DMA = 0xca, + VasEBoot_ATA_CMD_SECURITY_FREEZE_LOCK = 0xf5, + VasEBoot_ATA_CMD_SET_FEATURES = 0xef, + VasEBoot_ATA_CMD_SLEEP = 0xe6, + VasEBoot_ATA_CMD_SMART = 0xb0, + VasEBoot_ATA_CMD_STANDBY_IMMEDIATE = 0xe0, + VasEBoot_ATA_CMD_WRITE_SECTORS = 0x30, + VasEBoot_ATA_CMD_WRITE_SECTORS_EXT = 0x34, + VasEBoot_ATA_CMD_WRITE_SECTORS_DMA_EXT = 0x35, + VasEBoot_ATA_CMD_WRITE_SECTORS_DMA = 0xca, }; -enum grub_ata_timeout_milliseconds +enum VasEBoot_ata_timeout_milliseconds { - GRUB_ATA_TOUT_STD = 1000, /* 1s standard timeout. */ - GRUB_ATA_TOUT_DATA = 10000, /* 10s DATA I/O timeout. */ - GRUB_ATA_TOUT_SPINUP = 10000, /* Give the device 10s on first try to spinon. */ + VasEBoot_ATA_TOUT_STD = 1000, /* 1s standard timeout. */ + VasEBoot_ATA_TOUT_DATA = 10000, /* 10s DATA I/O timeout. */ + VasEBoot_ATA_TOUT_SPINUP = 10000, /* Give the device 10s on first try to spinon. */ }; typedef union { - grub_uint8_t raw[11]; + VasEBoot_uint8_t raw[11]; struct { union { - grub_uint8_t features; - grub_uint8_t error; + VasEBoot_uint8_t features; + VasEBoot_uint8_t error; }; union { - grub_uint8_t sectors; - grub_uint8_t atapi_ireason; + VasEBoot_uint8_t sectors; + VasEBoot_uint8_t atapi_ireason; }; union { - grub_uint8_t lba_low; - grub_uint8_t sectnum; + VasEBoot_uint8_t lba_low; + VasEBoot_uint8_t sectnum; }; union { - grub_uint8_t lba_mid; - grub_uint8_t cyllsb; - grub_uint8_t atapi_cntlow; + VasEBoot_uint8_t lba_mid; + VasEBoot_uint8_t cyllsb; + VasEBoot_uint8_t atapi_cntlow; }; union { - grub_uint8_t lba_high; - grub_uint8_t cylmsb; - grub_uint8_t atapi_cnthigh; + VasEBoot_uint8_t lba_high; + VasEBoot_uint8_t cylmsb; + VasEBoot_uint8_t atapi_cnthigh; }; - grub_uint8_t disk; + VasEBoot_uint8_t disk; union { - grub_uint8_t cmd; - grub_uint8_t status; + VasEBoot_uint8_t cmd; + VasEBoot_uint8_t status; }; - grub_uint8_t sectors48; - grub_uint8_t lba48_low; - grub_uint8_t lba48_mid; - grub_uint8_t lba48_high; + VasEBoot_uint8_t sectors48; + VasEBoot_uint8_t lba48_low; + VasEBoot_uint8_t lba48_mid; + VasEBoot_uint8_t lba48_high; }; -} grub_ata_regs_t; +} VasEBoot_ata_regs_t; /* ATA pass through parameters and function. */ -struct grub_disk_ata_pass_through_parms +struct VasEBoot_disk_ata_pass_through_parms { - grub_ata_regs_t taskfile; + VasEBoot_ata_regs_t taskfile; void * buffer; - grub_size_t size; + VasEBoot_size_t size; int write; void *cmd; int cmdsize; int dma; }; -struct grub_ata +struct VasEBoot_ata { /* Addressing methods available for accessing this device. If CHS is only available, use that. Otherwise use LBA, except for the high sectors. In that case use LBA48. */ - grub_ata_addressing_t addr; + VasEBoot_ata_addressing_t addr; /* Sector count. */ - grub_uint64_t size; - grub_uint32_t log_sector_size; + VasEBoot_uint64_t size; + VasEBoot_uint32_t log_sector_size; /* CHS maximums. */ - grub_uint16_t cylinders; - grub_uint16_t heads; - grub_uint16_t sectors_per_track; + VasEBoot_uint16_t cylinders; + VasEBoot_uint16_t heads; + VasEBoot_uint16_t sectors_per_track; /* Set to 0 for ATA, set to 1 for ATAPI. */ int atapi; int dma; - grub_size_t maxbuffer; + VasEBoot_size_t maxbuffer; int *present; void *data; - struct grub_ata_dev *dev; + struct VasEBoot_ata_dev *dev; }; -typedef struct grub_ata *grub_ata_t; +typedef struct VasEBoot_ata *VasEBoot_ata_t; -typedef int (*grub_ata_dev_iterate_hook_t) (int id, int bus, void *data); +typedef int (*VasEBoot_ata_dev_iterate_hook_t) (int id, int bus, void *data); -struct grub_ata_dev +struct VasEBoot_ata_dev { /* Call HOOK with each device name, until HOOK returns non-zero. */ - int (*iterate) (grub_ata_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull); + int (*iterate) (VasEBoot_ata_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull); /* Open the device named NAME, and set up SCSI. */ - grub_err_t (*open) (int id, int bus, struct grub_ata *scsi); + VasEBoot_err_t (*open) (int id, int bus, struct VasEBoot_ata *scsi); /* Close the scsi device SCSI. */ - void (*close) (struct grub_ata *ata); + void (*close) (struct VasEBoot_ata *ata); /* Read SIZE bytes from the device SCSI into BUF after sending the command CMD of size CMDSIZE. */ - grub_err_t (*readwrite) (struct grub_ata *ata, - struct grub_disk_ata_pass_through_parms *parms, + VasEBoot_err_t (*readwrite) (struct VasEBoot_ata *ata, + struct VasEBoot_disk_ata_pass_through_parms *parms, int spinup); /* The next scsi device. */ - struct grub_ata_dev *next; + struct VasEBoot_ata_dev *next; }; -typedef struct grub_ata_dev *grub_ata_dev_t; +typedef struct VasEBoot_ata_dev *VasEBoot_ata_dev_t; -void grub_ata_dev_register (grub_ata_dev_t dev); -void grub_ata_dev_unregister (grub_ata_dev_t dev); +void VasEBoot_ata_dev_register (VasEBoot_ata_dev_t dev); +void VasEBoot_ata_dev_unregister (VasEBoot_ata_dev_t dev); -#endif /* ! GRUB_ATA_HEADER */ +#endif /* ! VasEBoot_ATA_HEADER */ diff --git a/include/VasEBoot/auth.h b/include/VasEBoot/auth.h index 747334451..b61512049 100644 --- a/include/VasEBoot/auth.h +++ b/include/VasEBoot/auth.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_AUTH_HEADER -#define GRUB_AUTH_HEADER 1 +#ifndef VasEBoot_AUTH_HEADER +#define VasEBoot_AUTH_HEADER 1 -#include -#include +#include +#include -#define GRUB_AUTH_MAX_PASSLEN 1024 +#define VasEBoot_AUTH_MAX_PASSLEN 1024 -typedef grub_err_t (*grub_auth_callback_t) (const char *, const char *, void *); +typedef VasEBoot_err_t (*VasEBoot_auth_callback_t) (const char *, const char *, void *); -grub_err_t grub_auth_register_authentication (const char *user, - grub_auth_callback_t callback, +VasEBoot_err_t VasEBoot_auth_register_authentication (const char *user, + VasEBoot_auth_callback_t callback, void *arg); -grub_err_t grub_auth_unregister_authentication (const char *user); +VasEBoot_err_t VasEBoot_auth_unregister_authentication (const char *user); -grub_err_t grub_auth_authenticate (const char *user); -grub_err_t grub_auth_deauthenticate (const char *user); -grub_err_t grub_auth_check_authentication (const char *userlist); +VasEBoot_err_t VasEBoot_auth_authenticate (const char *user); +VasEBoot_err_t VasEBoot_auth_deauthenticate (const char *user); +VasEBoot_err_t VasEBoot_auth_check_authentication (const char *userlist); -#endif /* ! GRUB_AUTH_HEADER */ +#endif /* ! VasEBoot_AUTH_HEADER */ diff --git a/include/VasEBoot/autoefi.h b/include/VasEBoot/autoefi.h index b75591176..aa6e9c1fd 100644 --- a/include/VasEBoot/autoefi.h +++ b/include/VasEBoot/autoefi.h @@ -1,63 +1,63 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* This file provides some abstractions so that the same code compiles with both efi and efiemu */ -#ifndef GRUB_AUTOEFI_HEADER -#define GRUB_AUTOEFI_HEADER 1 +#ifndef VasEBoot_AUTOEFI_HEADER +#define VasEBoot_AUTOEFI_HEADER 1 -#ifdef GRUB_MACHINE_EFI -# include -# define grub_autoefi_get_memory_map grub_efi_get_memory_map -# define grub_autoefi_finish_boot_services grub_efi_finish_boot_services -# define grub_autoefi_exit_boot_services grub_efi_exit_boot_services -# define grub_autoefi_system_table grub_efi_system_table -# define grub_autoefi_mmap_iterate grub_machine_mmap_iterate -# define grub_autoefi_set_virtual_address_map grub_efi_set_virtual_address_map -static inline grub_err_t grub_autoefi_prepare (void) +#ifdef VasEBoot_MACHINE_EFI +# include +# define VasEBoot_autoefi_get_memory_map VasEBoot_efi_get_memory_map +# define VasEBoot_autoefi_finish_boot_services VasEBoot_efi_finish_boot_services +# define VasEBoot_autoefi_exit_boot_services VasEBoot_efi_exit_boot_services +# define VasEBoot_autoefi_system_table VasEBoot_efi_system_table +# define VasEBoot_autoefi_mmap_iterate VasEBoot_machine_mmap_iterate +# define VasEBoot_autoefi_set_virtual_address_map VasEBoot_efi_set_virtual_address_map +static inline VasEBoot_err_t VasEBoot_autoefi_prepare (void) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; }; -# define SYSTEM_TABLE_SIZEOF(x) (sizeof(grub_efi_system_table->x)) -# define SYSTEM_TABLE_VAR(x) ((void *)&(grub_efi_system_table->x)) -# define SYSTEM_TABLE_PTR(x) ((void *)(grub_efi_system_table->x)) -# define SIZEOF_OF_UINTN sizeof (grub_efi_uintn_t) -# define SYSTEM_TABLE(x) (grub_efi_system_table->x) -# define grub_autoefi_finish_boot_services grub_efi_finish_boot_services +# define SYSTEM_TABLE_SIZEOF(x) (sizeof(VasEBoot_efi_system_table->x)) +# define SYSTEM_TABLE_VAR(x) ((void *)&(VasEBoot_efi_system_table->x)) +# define SYSTEM_TABLE_PTR(x) ((void *)(VasEBoot_efi_system_table->x)) +# define SIZEOF_OF_UINTN sizeof (VasEBoot_efi_uintn_t) +# define SYSTEM_TABLE(x) (VasEBoot_efi_system_table->x) +# define VasEBoot_autoefi_finish_boot_services VasEBoot_efi_finish_boot_services # define EFI_PRESENT 1 #else -# include -# define grub_autoefi_get_memory_map grub_efiemu_get_memory_map -# define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services -# define grub_autoefi_exit_boot_services grub_efiemu_exit_boot_services -# define grub_autoefi_system_table grub_efiemu_system_table -# define grub_autoefi_mmap_iterate grub_efiemu_mmap_iterate -# define grub_autoefi_prepare grub_efiemu_prepare -# define grub_autoefi_set_virtual_address_map grub_efiemu_set_virtual_address_map -# define SYSTEM_TABLE_SIZEOF GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF -# define SYSTEM_TABLE_VAR GRUB_EFIEMU_SYSTEM_TABLE_VAR -# define SYSTEM_TABLE_PTR GRUB_EFIEMU_SYSTEM_TABLE_PTR -# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN -# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE -# define grub_efi_allocate_pages(x,y) (x) -# define grub_efi_free_pages(x,y) GRUB_EFI_SUCCESS -# define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services +# include +# define VasEBoot_autoefi_get_memory_map VasEBoot_efiemu_get_memory_map +# define VasEBoot_autoefi_finish_boot_services VasEBoot_efiemu_finish_boot_services +# define VasEBoot_autoefi_exit_boot_services VasEBoot_efiemu_exit_boot_services +# define VasEBoot_autoefi_system_table VasEBoot_efiemu_system_table +# define VasEBoot_autoefi_mmap_iterate VasEBoot_efiemu_mmap_iterate +# define VasEBoot_autoefi_prepare VasEBoot_efiemu_prepare +# define VasEBoot_autoefi_set_virtual_address_map VasEBoot_efiemu_set_virtual_address_map +# define SYSTEM_TABLE_SIZEOF VasEBoot_EFIEMU_SYSTEM_TABLE_SIZEOF +# define SYSTEM_TABLE_VAR VasEBoot_EFIEMU_SYSTEM_TABLE_VAR +# define SYSTEM_TABLE_PTR VasEBoot_EFIEMU_SYSTEM_TABLE_PTR +# define SIZEOF_OF_UINTN VasEBoot_EFIEMU_SIZEOF_OF_UINTN +# define SYSTEM_TABLE VasEBoot_EFIEMU_SYSTEM_TABLE +# define VasEBoot_efi_allocate_pages(x,y) (x) +# define VasEBoot_efi_free_pages(x,y) VasEBoot_EFI_SUCCESS +# define VasEBoot_autoefi_finish_boot_services VasEBoot_efiemu_finish_boot_services # define EFI_PRESENT 1 #endif diff --git a/include/VasEBoot/backtrace.h b/include/VasEBoot/backtrace.h index 395519762..7dccf59e4 100644 --- a/include/VasEBoot/backtrace.h +++ b/include/VasEBoot/backtrace.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BACKTRACE_HEADER -#define GRUB_BACKTRACE_HEADER 1 +#ifndef VasEBoot_BACKTRACE_HEADER +#define VasEBoot_BACKTRACE_HEADER 1 -void grub_backtrace (void); -void grub_backtrace_pointer (void *ptr); -void grub_backtrace_print_address (void *addr); +void VasEBoot_backtrace (void); +void VasEBoot_backtrace_pointer (void *ptr); +void VasEBoot_backtrace_print_address (void *addr); #endif diff --git a/include/VasEBoot/bitmap.h b/include/VasEBoot/bitmap.h index 5728f8ca3..51d7bb1ec 100644 --- a/include/VasEBoot/bitmap.h +++ b/include/VasEBoot/bitmap.h @@ -1,67 +1,67 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BITMAP_HEADER -#define GRUB_BITMAP_HEADER 1 +#ifndef VasEBoot_BITMAP_HEADER +#define VasEBoot_BITMAP_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_video_bitmap +struct VasEBoot_video_bitmap { /* Bitmap format description. */ - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; /* Pointer to bitmap data formatted according to mode_info. */ void *data; }; -struct grub_video_bitmap_reader +struct VasEBoot_video_bitmap_reader { /* File extension for this bitmap type (including dot). */ const char *extension; /* Reader function to load bitmap. */ - grub_err_t (*reader) (struct grub_video_bitmap **bitmap, + VasEBoot_err_t (*reader) (struct VasEBoot_video_bitmap **bitmap, const char *filename); /* Next reader. */ - struct grub_video_bitmap_reader *next; + struct VasEBoot_video_bitmap_reader *next; }; -typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t; +typedef struct VasEBoot_video_bitmap_reader *VasEBoot_video_bitmap_reader_t; -void EXPORT_FUNC (grub_video_bitmap_reader_register) (grub_video_bitmap_reader_t reader); -void EXPORT_FUNC (grub_video_bitmap_reader_unregister) (grub_video_bitmap_reader_t reader); +void EXPORT_FUNC (VasEBoot_video_bitmap_reader_register) (VasEBoot_video_bitmap_reader_t reader); +void EXPORT_FUNC (VasEBoot_video_bitmap_reader_unregister) (VasEBoot_video_bitmap_reader_t reader); -grub_err_t EXPORT_FUNC (grub_video_bitmap_create) (struct grub_video_bitmap **bitmap, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_bitmap_create) (struct VasEBoot_video_bitmap **bitmap, unsigned int width, unsigned int height, - enum grub_video_blit_format blit_format); + enum VasEBoot_video_blit_format blit_format); -grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bitmap); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_bitmap_destroy) (struct VasEBoot_video_bitmap *bitmap); -grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_bitmap_load) (struct VasEBoot_video_bitmap **bitmap, const char *filename); /* Return bitmap width. */ static inline unsigned int -grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap) +VasEBoot_video_bitmap_get_width (struct VasEBoot_video_bitmap *bitmap) { if (!bitmap) return 0; @@ -71,7 +71,7 @@ grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap) /* Return bitmap height. */ static inline unsigned int -grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap) +VasEBoot_video_bitmap_get_height (struct VasEBoot_video_bitmap *bitmap) { if (!bitmap) return 0; @@ -79,9 +79,9 @@ grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap) return bitmap->mode_info.height; } -void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap, - struct grub_video_mode_info *mode_info); +void EXPORT_FUNC (VasEBoot_video_bitmap_get_mode_info) (struct VasEBoot_video_bitmap *bitmap, + struct VasEBoot_video_mode_info *mode_info); -void *EXPORT_FUNC (grub_video_bitmap_get_data) (struct grub_video_bitmap *bitmap); +void *EXPORT_FUNC (VasEBoot_video_bitmap_get_data) (struct VasEBoot_video_bitmap *bitmap); -#endif /* ! GRUB_BITMAP_HEADER */ +#endif /* ! VasEBoot_BITMAP_HEADER */ diff --git a/include/VasEBoot/bitmap_scale.h b/include/VasEBoot/bitmap_scale.h index 927a7cba5..a36730b78 100644 --- a/include/VasEBoot/bitmap_scale.h +++ b/include/VasEBoot/bitmap_scale.h @@ -1,85 +1,85 @@ /* bitmap_scale.h - Bitmap scaling functions. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BITMAP_SCALE_HEADER -#define GRUB_BITMAP_SCALE_HEADER 1 +#ifndef VasEBoot_BITMAP_SCALE_HEADER +#define VasEBoot_BITMAP_SCALE_HEADER 1 -#include -#include -#include +#include +#include +#include -enum grub_video_bitmap_scale_method +enum VasEBoot_video_bitmap_scale_method { /* Choose the fastest interpolation algorithm. */ - GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_FASTEST, /* Choose the highest quality interpolation algorithm. */ - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BEST, /* Specific algorithms: */ /* Nearest neighbor interpolation. */ - GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST, + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_NEAREST, /* Bilinear interpolation. */ - GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR + VasEBoot_VIDEO_BITMAP_SCALE_METHOD_BILINEAR }; -typedef enum grub_video_bitmap_selection_method +typedef enum VasEBoot_video_bitmap_selection_method { - GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH, - GRUB_VIDEO_BITMAP_SELECTION_METHOD_CROP, - GRUB_VIDEO_BITMAP_SELECTION_METHOD_PADDING, - GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH, - GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT -} grub_video_bitmap_selection_method_t; + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_STRETCH, + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_CROP, + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_PADDING, + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH, + VasEBoot_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT +} VasEBoot_video_bitmap_selection_method_t; -typedef enum grub_video_bitmap_v_align +typedef enum VasEBoot_video_bitmap_v_align { - GRUB_VIDEO_BITMAP_V_ALIGN_TOP, - GRUB_VIDEO_BITMAP_V_ALIGN_CENTER, - GRUB_VIDEO_BITMAP_V_ALIGN_BOTTOM -} grub_video_bitmap_v_align_t; + VasEBoot_VIDEO_BITMAP_V_ALIGN_TOP, + VasEBoot_VIDEO_BITMAP_V_ALIGN_CENTER, + VasEBoot_VIDEO_BITMAP_V_ALIGN_BOTTOM +} VasEBoot_video_bitmap_v_align_t; -typedef enum grub_video_bitmap_h_align +typedef enum VasEBoot_video_bitmap_h_align { - GRUB_VIDEO_BITMAP_H_ALIGN_LEFT, - GRUB_VIDEO_BITMAP_H_ALIGN_CENTER, - GRUB_VIDEO_BITMAP_H_ALIGN_RIGHT -} grub_video_bitmap_h_align_t; + VasEBoot_VIDEO_BITMAP_H_ALIGN_LEFT, + VasEBoot_VIDEO_BITMAP_H_ALIGN_CENTER, + VasEBoot_VIDEO_BITMAP_H_ALIGN_RIGHT +} VasEBoot_video_bitmap_h_align_t; -grub_err_t -EXPORT_FUNC (grub_video_bitmap_create_scaled) (struct grub_video_bitmap **dst, +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_video_bitmap_create_scaled) (struct VasEBoot_video_bitmap **dst, int dst_width, int dst_height, - struct grub_video_bitmap *src, + struct VasEBoot_video_bitmap *src, enum - grub_video_bitmap_scale_method + VasEBoot_video_bitmap_scale_method scale_method); -grub_err_t -EXPORT_FUNC (grub_video_bitmap_scale_proportional) - (struct grub_video_bitmap **dst, +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_video_bitmap_scale_proportional) + (struct VasEBoot_video_bitmap **dst, int dst_width, int dst_height, - struct grub_video_bitmap *src, - enum grub_video_bitmap_scale_method + struct VasEBoot_video_bitmap *src, + enum VasEBoot_video_bitmap_scale_method scale_method, - grub_video_bitmap_selection_method_t + VasEBoot_video_bitmap_selection_method_t selection_method, - grub_video_bitmap_v_align_t v_align, - grub_video_bitmap_h_align_t h_align); + VasEBoot_video_bitmap_v_align_t v_align, + VasEBoot_video_bitmap_h_align_t h_align); -#endif /* ! GRUB_BITMAP_SCALE_HEADER */ +#endif /* ! VasEBoot_BITMAP_SCALE_HEADER */ diff --git a/include/VasEBoot/bsdlabel.h b/include/VasEBoot/bsdlabel.h index 83e7b8b5a..73226d4f0 100644 --- a/include/VasEBoot/bsdlabel.h +++ b/include/VasEBoot/bsdlabel.h @@ -1,106 +1,106 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2004,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BSDLABEL_PARTITION_HEADER -#define GRUB_BSDLABEL_PARTITION_HEADER 1 +#ifndef VasEBoot_BSDLABEL_PARTITION_HEADER +#define VasEBoot_BSDLABEL_PARTITION_HEADER 1 /* Constants for BSD disk label. */ -#define GRUB_PC_PARTITION_BSD_LABEL_SECTOR 1 -#define GRUB_PC_PARTITION_BSD_LABEL_MAGIC 0x82564557 +#define VasEBoot_PC_PARTITION_BSD_LABEL_SECTOR 1 +#define VasEBoot_PC_PARTITION_BSD_LABEL_MAGIC 0x82564557 /* BSD partition types. */ enum { - GRUB_PC_PARTITION_BSD_TYPE_UNUSED = 0, - GRUB_PC_PARTITION_BSD_TYPE_SWAP = 1, - GRUB_PC_PARTITION_BSD_TYPE_V6 = 2, - GRUB_PC_PARTITION_BSD_TYPE_V7 = 3, - GRUB_PC_PARTITION_BSD_TYPE_SYSV = 4, - GRUB_PC_PARTITION_BSD_TYPE_V71K = 5, - GRUB_PC_PARTITION_BSD_TYPE_V8 = 6, - GRUB_PC_PARTITION_BSD_TYPE_BSDFFS = 7, - GRUB_PC_PARTITION_BSD_TYPE_MSDOS = 8, - GRUB_PC_PARTITION_BSD_TYPE_BSDLFS = 9, - GRUB_PC_PARTITION_BSD_TYPE_OTHER = 10, - GRUB_PC_PARTITION_BSD_TYPE_HPFS = 11, - GRUB_PC_PARTITION_BSD_TYPE_ISO9660 = 12, - GRUB_PC_PARTITION_BSD_TYPE_BOOT = 13 + VasEBoot_PC_PARTITION_BSD_TYPE_UNUSED = 0, + VasEBoot_PC_PARTITION_BSD_TYPE_SWAP = 1, + VasEBoot_PC_PARTITION_BSD_TYPE_V6 = 2, + VasEBoot_PC_PARTITION_BSD_TYPE_V7 = 3, + VasEBoot_PC_PARTITION_BSD_TYPE_SYSV = 4, + VasEBoot_PC_PARTITION_BSD_TYPE_V71K = 5, + VasEBoot_PC_PARTITION_BSD_TYPE_V8 = 6, + VasEBoot_PC_PARTITION_BSD_TYPE_BSDFFS = 7, + VasEBoot_PC_PARTITION_BSD_TYPE_MSDOS = 8, + VasEBoot_PC_PARTITION_BSD_TYPE_BSDLFS = 9, + VasEBoot_PC_PARTITION_BSD_TYPE_OTHER = 10, + VasEBoot_PC_PARTITION_BSD_TYPE_HPFS = 11, + VasEBoot_PC_PARTITION_BSD_TYPE_ISO9660 = 12, + VasEBoot_PC_PARTITION_BSD_TYPE_BOOT = 13 }; /* FreeBSD-specific types. */ enum { - GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM = 14, - GRUB_PC_PARTITION_FREEBSD_TYPE_RAID = 15, - GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2 = 21 + VasEBoot_PC_PARTITION_FREEBSD_TYPE_VINUM = 14, + VasEBoot_PC_PARTITION_FREEBSD_TYPE_RAID = 15, + VasEBoot_PC_PARTITION_FREEBSD_TYPE_JFS2 = 21 }; /* NetBSD-specific types. */ enum { - GRUB_PC_PARTITION_NETBSD_TYPE_ADOS = 14, - GRUB_PC_PARTITION_NETBSD_TYPE_HFS = 15, - GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE = 16, - GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS = 17, - GRUB_PC_PARTITION_NETBSD_TYPE_NTFS = 18, - GRUB_PC_PARTITION_NETBSD_TYPE_RAID = 19, - GRUB_PC_PARTITION_NETBSD_TYPE_CCD = 20, - GRUB_PC_PARTITION_NETBSD_TYPE_JFS2 = 21, - GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS = 22 + VasEBoot_PC_PARTITION_NETBSD_TYPE_ADOS = 14, + VasEBoot_PC_PARTITION_NETBSD_TYPE_HFS = 15, + VasEBoot_PC_PARTITION_NETBSD_TYPE_FILECORE = 16, + VasEBoot_PC_PARTITION_NETBSD_TYPE_EXT2FS = 17, + VasEBoot_PC_PARTITION_NETBSD_TYPE_NTFS = 18, + VasEBoot_PC_PARTITION_NETBSD_TYPE_RAID = 19, + VasEBoot_PC_PARTITION_NETBSD_TYPE_CCD = 20, + VasEBoot_PC_PARTITION_NETBSD_TYPE_JFS2 = 21, + VasEBoot_PC_PARTITION_NETBSD_TYPE_APPLEUFS = 22 }; /* OpenBSD-specific types. */ enum { - GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS = 14, - GRUB_PC_PARTITION_OPENBSD_TYPE_HFS = 15, - GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE = 16, - GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS = 17, - GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS = 18, - GRUB_PC_PARTITION_OPENBSD_TYPE_RAID = 19 + VasEBoot_PC_PARTITION_OPENBSD_TYPE_ADOS = 14, + VasEBoot_PC_PARTITION_OPENBSD_TYPE_HFS = 15, + VasEBoot_PC_PARTITION_OPENBSD_TYPE_FILECORE = 16, + VasEBoot_PC_PARTITION_OPENBSD_TYPE_EXT2FS = 17, + VasEBoot_PC_PARTITION_OPENBSD_TYPE_NTFS = 18, + VasEBoot_PC_PARTITION_OPENBSD_TYPE_RAID = 19 }; -#define GRUB_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION 2 +#define VasEBoot_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION 2 /* The BSD partition entry. */ -struct grub_partition_bsd_entry +struct VasEBoot_partition_bsd_entry { - grub_uint32_t size; - grub_uint32_t offset; - grub_uint32_t fragment_size; - grub_uint8_t fs_type; - grub_uint8_t fs_fragments; - grub_uint16_t fs_cylinders; -} GRUB_PACKED; + VasEBoot_uint32_t size; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t fragment_size; + VasEBoot_uint8_t fs_type; + VasEBoot_uint8_t fs_fragments; + VasEBoot_uint16_t fs_cylinders; +} VasEBoot_PACKED; -/* The BSD disk label. Only define members useful for GRUB. */ -struct grub_partition_bsd_disk_label +/* The BSD disk label. Only define members useful for VasEBoot. */ +struct VasEBoot_partition_bsd_disk_label { - grub_uint32_t magic; - grub_uint16_t type; - grub_uint8_t unused1[18]; - grub_uint8_t packname[16]; - grub_uint8_t unused2[92]; - grub_uint32_t magic2; - grub_uint16_t checksum; - grub_uint16_t num_partitions; - grub_uint32_t boot_size; - grub_uint32_t superblock_size; -} GRUB_PACKED; + VasEBoot_uint32_t magic; + VasEBoot_uint16_t type; + VasEBoot_uint8_t unused1[18]; + VasEBoot_uint8_t packname[16]; + VasEBoot_uint8_t unused2[92]; + VasEBoot_uint32_t magic2; + VasEBoot_uint16_t checksum; + VasEBoot_uint16_t num_partitions; + VasEBoot_uint32_t boot_size; + VasEBoot_uint32_t superblock_size; +} VasEBoot_PACKED; -#endif /* ! GRUB_PC_PARTITION_HEADER */ +#endif /* ! VasEBoot_PC_PARTITION_HEADER */ diff --git a/include/VasEBoot/btrfs.h b/include/VasEBoot/btrfs.h index 9d93fb6c1..4beec27cb 100644 --- a/include/VasEBoot/btrfs.h +++ b/include/VasEBoot/btrfs.h @@ -1,70 +1,70 @@ /* btrfs.c - B-tree file system. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BTRFS_H -#define GRUB_BTRFS_H 1 +#ifndef VasEBoot_BTRFS_H +#define VasEBoot_BTRFS_H 1 enum { - GRUB_BTRFS_ITEM_TYPE_INODE_ITEM = 0x01, - GRUB_BTRFS_ITEM_TYPE_INODE_REF = 0x0c, - GRUB_BTRFS_ITEM_TYPE_DIR_ITEM = 0x54, - GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM = 0x6c, - GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM = 0x84, - GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF = 0x90, - GRUB_BTRFS_ITEM_TYPE_DEVICE = 0xd8, - GRUB_BTRFS_ITEM_TYPE_CHUNK = 0xe4 + VasEBoot_BTRFS_ITEM_TYPE_INODE_ITEM = 0x01, + VasEBoot_BTRFS_ITEM_TYPE_INODE_REF = 0x0c, + VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM = 0x54, + VasEBoot_BTRFS_ITEM_TYPE_EXTENT_ITEM = 0x6c, + VasEBoot_BTRFS_ITEM_TYPE_ROOT_ITEM = 0x84, + VasEBoot_BTRFS_ITEM_TYPE_ROOT_BACKREF = 0x90, + VasEBoot_BTRFS_ITEM_TYPE_DEVICE = 0xd8, + VasEBoot_BTRFS_ITEM_TYPE_CHUNK = 0xe4 }; enum { - GRUB_BTRFS_ROOT_VOL_OBJECTID = 5, - GRUB_BTRFS_TREE_ROOT_OBJECTID = 0x100, + VasEBoot_BTRFS_ROOT_VOL_OBJECTID = 5, + VasEBoot_BTRFS_TREE_ROOT_OBJECTID = 0x100, }; -struct grub_btrfs_root_item +struct VasEBoot_btrfs_root_item { - grub_uint8_t dummy[0xb0]; - grub_uint64_t tree; - grub_uint64_t inode; + VasEBoot_uint8_t dummy[0xb0]; + VasEBoot_uint64_t tree; + VasEBoot_uint64_t inode; }; -struct grub_btrfs_key +struct VasEBoot_btrfs_key { - grub_uint64_t object_id; - grub_uint8_t type; - grub_uint64_t offset; -} GRUB_PACKED; + VasEBoot_uint64_t object_id; + VasEBoot_uint8_t type; + VasEBoot_uint64_t offset; +} VasEBoot_PACKED; -struct grub_btrfs_root_backref +struct VasEBoot_btrfs_root_backref { - grub_uint64_t inode_id; - grub_uint64_t seqnr; - grub_uint16_t n; + VasEBoot_uint64_t inode_id; + VasEBoot_uint64_t seqnr; + VasEBoot_uint16_t n; char name[0]; }; -struct grub_btrfs_inode_ref +struct VasEBoot_btrfs_inode_ref { - grub_uint64_t idxid; - grub_uint16_t n; + VasEBoot_uint64_t idxid; + VasEBoot_uint16_t n; char name[0]; }; diff --git a/include/VasEBoot/bufio.h b/include/VasEBoot/bufio.h index acdd0c882..26bca147d 100644 --- a/include/VasEBoot/bufio.h +++ b/include/VasEBoot/bufio.h @@ -1,28 +1,28 @@ /* bufio.h - prototypes for bufio */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BUFIO_H -#define GRUB_BUFIO_H 1 +#ifndef VasEBoot_BUFIO_H +#define VasEBoot_BUFIO_H 1 -#include +#include -grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, int size); -grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, int size); +VasEBoot_file_t EXPORT_FUNC (VasEBoot_bufio_open) (VasEBoot_file_t io, int size); +VasEBoot_file_t EXPORT_FUNC (VasEBoot_buffile_open) (const char *name, int size); -#endif /* ! GRUB_BUFIO_H */ +#endif /* ! VasEBoot_BUFIO_H */ diff --git a/include/VasEBoot/cache.h b/include/VasEBoot/cache.h index fc669dfd1..c9fa890a0 100644 --- a/include/VasEBoot/cache.h +++ b/include/VasEBoot/cache.h @@ -1,46 +1,46 @@ /* cache.h - Flush the processor's cache. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CACHE_H -#define GRUB_CACHE_H 1 +#ifndef VasEBoot_CACHE_H +#define VasEBoot_CACHE_H 1 -#include -#include +#include +#include #if defined (__i386__) || defined (__x86_64__) static inline void -grub_arch_sync_caches (void *address __attribute__ ((unused)), - grub_size_t len __attribute__ ((unused))) +VasEBoot_arch_sync_caches (void *address __attribute__ ((unused)), + VasEBoot_size_t len __attribute__ ((unused))) { } #else -void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len); +void EXPORT_FUNC(VasEBoot_arch_sync_caches) (void *address, VasEBoot_size_t len); #endif -#ifndef GRUB_MACHINE_EMU +#ifndef VasEBoot_MACHINE_EMU #ifdef _mips -void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, - grub_size_t len); +void EXPORT_FUNC(VasEBoot_arch_sync_dma_caches) (volatile void *address, + VasEBoot_size_t len); #else static inline void -grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)), - grub_size_t len __attribute__ ((unused))) +VasEBoot_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)), + VasEBoot_size_t len __attribute__ ((unused))) { } #endif @@ -48,7 +48,7 @@ grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)), #ifdef __arm__ void -grub_arm_cache_enable (void); +VasEBoot_arm_cache_enable (void); #endif -#endif /* ! GRUB_CACHE_HEADER */ +#endif /* ! VasEBoot_CACHE_HEADER */ diff --git a/include/VasEBoot/cbfs_core.h b/include/VasEBoot/cbfs_core.h index 98112fb67..4449f29cd 100644 --- a/include/VasEBoot/cbfs_core.h +++ b/include/VasEBoot/cbfs_core.h @@ -51,7 +51,7 @@ #ifndef _CBFS_CORE_H_ #define _CBFS_CORE_H_ -#include +#include /** These are standard values for the known compression alogrithms that coreboot knows about for stages and @@ -90,15 +90,15 @@ For other platforms, you need to define CONFIG_CBFS_HEADER_ROM_OFFSET */ struct cbfs_header { - grub_uint32_t magic; - grub_uint32_t version; - grub_uint32_t romsize; - grub_uint32_t bootblocksize; - grub_uint32_t align; - grub_uint32_t offset; - grub_uint32_t architecture; - grub_uint32_t pad[1]; -} GRUB_PACKED; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t version; + VasEBoot_uint32_t romsize; + VasEBoot_uint32_t bootblocksize; + VasEBoot_uint32_t align; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t architecture; + VasEBoot_uint32_t pad[1]; +} VasEBoot_PACKED; /* "Unknown" refers to CBFS headers version 1, * before the architecture was defined (i.e., x86 only). @@ -126,11 +126,11 @@ struct cbfs_header { struct cbfs_file { char magic[8]; - grub_uint32_t len; - grub_uint32_t type; - grub_uint32_t checksum; - grub_uint32_t offset; -} GRUB_PACKED; + VasEBoot_uint32_t len; + VasEBoot_uint32_t type; + VasEBoot_uint32_t checksum; + VasEBoot_uint32_t offset; +} VasEBoot_PACKED; /*** Component sub-headers ***/ @@ -141,24 +141,24 @@ struct cbfs_file { loaded by coreboot during the normal boot process */ struct cbfs_stage { - grub_uint32_t compression; /** Compression type */ - grub_uint64_t entry; /** entry point */ - grub_uint64_t load; /** Where to load in memory */ - grub_uint32_t len; /** length of data to load */ - grub_uint32_t memlen; /** total length of object in memory */ -} GRUB_PACKED; + VasEBoot_uint32_t compression; /** Compression type */ + VasEBoot_uint64_t entry; /** entry point */ + VasEBoot_uint64_t load; /** Where to load in memory */ + VasEBoot_uint32_t len; /** length of data to load */ + VasEBoot_uint32_t memlen; /** total length of object in memory */ +} VasEBoot_PACKED; /** this is the sub-header for payload components. Payloads are loaded by coreboot at the end of the boot process */ struct cbfs_payload_segment { - grub_uint32_t type; - grub_uint32_t compression; - grub_uint32_t offset; - grub_uint64_t load_addr; - grub_uint32_t len; - grub_uint32_t mem_len; -} GRUB_PACKED; + VasEBoot_uint32_t type; + VasEBoot_uint32_t compression; + VasEBoot_uint32_t offset; + VasEBoot_uint64_t load_addr; + VasEBoot_uint32_t len; + VasEBoot_uint32_t mem_len; +} VasEBoot_PACKED; struct cbfs_payload { struct cbfs_payload_segment segments; @@ -171,8 +171,8 @@ struct cbfs_payload { #define PAYLOAD_SEGMENT_ENTRY 0x52544E45 struct cbfs_optionrom { - grub_uint32_t compression; - grub_uint32_t len; -} GRUB_PACKED; + VasEBoot_uint32_t compression; + VasEBoot_uint32_t len; +} VasEBoot_PACKED; #endif diff --git a/include/VasEBoot/charset.h b/include/VasEBoot/charset.h index d14faea32..08fa72f6d 100644 --- a/include/VasEBoot/charset.h +++ b/include/VasEBoot/charset.h @@ -1,63 +1,63 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CHARSET_HEADER -#define GRUB_CHARSET_HEADER 1 +#ifndef VasEBoot_CHARSET_HEADER +#define VasEBoot_CHARSET_HEADER 1 -#include +#include -#define GRUB_UINT8_1_LEADINGBIT 0x80 -#define GRUB_UINT8_2_LEADINGBITS 0xc0 -#define GRUB_UINT8_3_LEADINGBITS 0xe0 -#define GRUB_UINT8_4_LEADINGBITS 0xf0 -#define GRUB_UINT8_5_LEADINGBITS 0xf8 -#define GRUB_UINT8_6_LEADINGBITS 0xfc -#define GRUB_UINT8_7_LEADINGBITS 0xfe +#define VasEBoot_UINT8_1_LEADINGBIT 0x80 +#define VasEBoot_UINT8_2_LEADINGBITS 0xc0 +#define VasEBoot_UINT8_3_LEADINGBITS 0xe0 +#define VasEBoot_UINT8_4_LEADINGBITS 0xf0 +#define VasEBoot_UINT8_5_LEADINGBITS 0xf8 +#define VasEBoot_UINT8_6_LEADINGBITS 0xfc +#define VasEBoot_UINT8_7_LEADINGBITS 0xfe -#define GRUB_UINT8_1_TRAILINGBIT 0x01 -#define GRUB_UINT8_2_TRAILINGBITS 0x03 -#define GRUB_UINT8_3_TRAILINGBITS 0x07 -#define GRUB_UINT8_4_TRAILINGBITS 0x0f -#define GRUB_UINT8_5_TRAILINGBITS 0x1f -#define GRUB_UINT8_6_TRAILINGBITS 0x3f +#define VasEBoot_UINT8_1_TRAILINGBIT 0x01 +#define VasEBoot_UINT8_2_TRAILINGBITS 0x03 +#define VasEBoot_UINT8_3_TRAILINGBITS 0x07 +#define VasEBoot_UINT8_4_TRAILINGBITS 0x0f +#define VasEBoot_UINT8_5_TRAILINGBITS 0x1f +#define VasEBoot_UINT8_6_TRAILINGBITS 0x3f -#define GRUB_MAX_UTF8_PER_UTF16 4 +#define VasEBoot_MAX_UTF8_PER_UTF16 4 /* You need at least one UTF-8 byte to have one UTF-16 word. You need at least three UTF-8 bytes to have 2 UTF-16 words (surrogate pairs). */ -#define GRUB_MAX_UTF16_PER_UTF8 1 -#define GRUB_MAX_UTF8_PER_CODEPOINT 4 +#define VasEBoot_MAX_UTF16_PER_UTF8 1 +#define VasEBoot_MAX_UTF8_PER_CODEPOINT 4 -#define GRUB_UCS2_LIMIT 0x10000 -#define GRUB_UTF16_UPPER_SURROGATE(code) \ - (0xD800 | ((((code) - GRUB_UCS2_LIMIT) >> 10) & 0x3ff)) -#define GRUB_UTF16_LOWER_SURROGATE(code) \ - (0xDC00 | (((code) - GRUB_UCS2_LIMIT) & 0x3ff)) +#define VasEBoot_UCS2_LIMIT 0x10000 +#define VasEBoot_UTF16_UPPER_SURROGATE(code) \ + (0xD800 | ((((code) - VasEBoot_UCS2_LIMIT) >> 10) & 0x3ff)) +#define VasEBoot_UTF16_LOWER_SURROGATE(code) \ + (0xDC00 | (((code) - VasEBoot_UCS2_LIMIT) & 0x3ff)) /* Process one character from UTF8 sequence. At beginning set *code = 0, *count = 0. Returns 0 on failure and 1 on success. *count holds the number of trailing bytes. */ static inline int -grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count) +VasEBoot_utf8_process (VasEBoot_uint8_t c, VasEBoot_uint32_t *code, int *count) { if (*count) { - if ((c & GRUB_UINT8_2_LEADINGBITS) != GRUB_UINT8_1_LEADINGBIT) + if ((c & VasEBoot_UINT8_2_LEADINGBITS) != VasEBoot_UINT8_1_LEADINGBIT) { *count = 0; /* invalid */ @@ -66,7 +66,7 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count) else { *code <<= 6; - *code |= (c & GRUB_UINT8_6_TRAILINGBITS); + *code |= (c & VasEBoot_UINT8_6_TRAILINGBITS); (*count)--; /* Overlong. */ if ((*count == 1 && *code <= 0x1f) @@ -80,15 +80,15 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count) } } - if ((c & GRUB_UINT8_1_LEADINGBIT) == 0) + if ((c & VasEBoot_UINT8_1_LEADINGBIT) == 0) { *code = c; return 1; } - if ((c & GRUB_UINT8_3_LEADINGBITS) == GRUB_UINT8_2_LEADINGBITS) + if ((c & VasEBoot_UINT8_3_LEADINGBITS) == VasEBoot_UINT8_2_LEADINGBITS) { *count = 1; - *code = c & GRUB_UINT8_5_TRAILINGBITS; + *code = c & VasEBoot_UINT8_5_TRAILINGBITS; /* Overlong */ if (*code <= 1) { @@ -98,16 +98,16 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count) } return 1; } - if ((c & GRUB_UINT8_4_LEADINGBITS) == GRUB_UINT8_3_LEADINGBITS) + if ((c & VasEBoot_UINT8_4_LEADINGBITS) == VasEBoot_UINT8_3_LEADINGBITS) { *count = 2; - *code = c & GRUB_UINT8_4_TRAILINGBITS; + *code = c & VasEBoot_UINT8_4_TRAILINGBITS; return 1; } - if ((c & GRUB_UINT8_5_LEADINGBITS) == GRUB_UINT8_4_LEADINGBITS) + if ((c & VasEBoot_UINT8_5_LEADINGBITS) == VasEBoot_UINT8_4_LEADINGBITS) { *count = 3; - *code = c & GRUB_UINT8_3_TRAILINGBITS; + *code = c & VasEBoot_UINT8_3_TRAILINGBITS; return 1; } return 0; @@ -120,14 +120,14 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count) at least DESTSIZE characters. If an invalid sequence is found, return -1. If SRCEND is not NULL, then *SRCEND is set to the next byte after the last byte used in SRC. */ -static inline grub_size_t -grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize, - const grub_uint8_t *src, grub_size_t srcsize, - const grub_uint8_t **srcend) +static inline VasEBoot_size_t +VasEBoot_utf8_to_utf16 (VasEBoot_uint16_t *dest, VasEBoot_size_t destsize, + const VasEBoot_uint8_t *src, VasEBoot_size_t srcsize, + const VasEBoot_uint8_t **srcend) { - grub_uint16_t *p = dest; + VasEBoot_uint16_t *p = dest; int count = 0; - grub_uint32_t code = 0; + VasEBoot_uint32_t code = 0; if (srcend) *srcend = src; @@ -135,9 +135,9 @@ grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize, while (srcsize && destsize) { int was_count = count; - if (srcsize != (grub_size_t)-1) + if (srcsize != (VasEBoot_size_t)-1) srcsize--; - if (!grub_utf8_process (*src++, &code, &count)) + if (!VasEBoot_utf8_process (*src++, &code, &count)) { code = '?'; count = 0; @@ -149,12 +149,12 @@ grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize, continue; if (code == 0) break; - if (destsize < 2 && code >= GRUB_UCS2_LIMIT) + if (destsize < 2 && code >= VasEBoot_UCS2_LIMIT) break; - if (code >= GRUB_UCS2_LIMIT) + if (code >= VasEBoot_UCS2_LIMIT) { - *p++ = GRUB_UTF16_UPPER_SURROGATE (code); - *p++ = GRUB_UTF16_LOWER_SURROGATE (code); + *p++ = VasEBoot_UTF16_UPPER_SURROGATE (code); + *p++ = VasEBoot_UTF16_LOWER_SURROGATE (code); destsize -= 2; } else @@ -171,24 +171,24 @@ grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize, /* Determine the last position where the UTF-8 string [beg, end) can be safely cut. */ -static inline grub_size_t -grub_getend (const char *beg, const char *end) +static inline VasEBoot_size_t +VasEBoot_getend (const char *beg, const char *end) { const char *ptr; for (ptr = end - 1; ptr >= beg; ptr--) - if ((*ptr & GRUB_UINT8_2_LEADINGBITS) != GRUB_UINT8_1_LEADINGBIT) + if ((*ptr & VasEBoot_UINT8_2_LEADINGBITS) != VasEBoot_UINT8_1_LEADINGBIT) break; if (ptr < beg) return 0; - if ((*ptr & GRUB_UINT8_1_LEADINGBIT) == 0) + if ((*ptr & VasEBoot_UINT8_1_LEADINGBIT) == 0) return ptr + 1 - beg; - if ((*ptr & GRUB_UINT8_3_LEADINGBITS) == GRUB_UINT8_2_LEADINGBITS + if ((*ptr & VasEBoot_UINT8_3_LEADINGBITS) == VasEBoot_UINT8_2_LEADINGBITS && ptr + 2 <= end) return ptr + 2 - beg; - if ((*ptr & GRUB_UINT8_4_LEADINGBITS) == GRUB_UINT8_3_LEADINGBITS + if ((*ptr & VasEBoot_UINT8_4_LEADINGBITS) == VasEBoot_UINT8_3_LEADINGBITS && ptr + 3 <= end) return ptr + 3 - beg; - if ((*ptr & GRUB_UINT8_5_LEADINGBITS) == GRUB_UINT8_4_LEADINGBITS + if ((*ptr & VasEBoot_UINT8_5_LEADINGBITS) == VasEBoot_UINT8_4_LEADINGBITS && ptr + 4 <= end) return ptr + 4 - beg; /* Invalid character or incomplete. Cut before it. */ @@ -196,15 +196,15 @@ grub_getend (const char *beg, const char *end) } /* Convert UTF-16 to UTF-8. */ -static inline grub_uint8_t * -grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src, - grub_size_t size) +static inline VasEBoot_uint8_t * +VasEBoot_utf16_to_utf8 (VasEBoot_uint8_t *dest, const VasEBoot_uint16_t *src, + VasEBoot_size_t size) { - grub_uint32_t code_high = 0; + VasEBoot_uint32_t code_high = 0; while (size--) { - grub_uint32_t code = *src++; + VasEBoot_uint32_t code = *src++; if (code_high) { @@ -266,12 +266,12 @@ grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src, return dest; } -#define GRUB_MAX_UTF8_PER_LATIN1 2 +#define VasEBoot_MAX_UTF8_PER_LATIN1 2 /* Convert Latin1 to UTF-8. */ -static inline grub_uint8_t * -grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src, - grub_size_t size) +static inline VasEBoot_uint8_t * +VasEBoot_latin1_to_utf8 (VasEBoot_uint8_t *dest, const VasEBoot_uint8_t *src, + VasEBoot_size_t size) { while (size--) { @@ -289,35 +289,35 @@ grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src, } /* Convert UCS-4 to UTF-8. */ -char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size); +char *VasEBoot_ucs4_to_utf8_alloc (const VasEBoot_uint32_t *src, VasEBoot_size_t size); int -grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize); +VasEBoot_is_valid_utf8 (const VasEBoot_uint8_t *src, VasEBoot_size_t srcsize); -grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg, - grub_uint32_t **unicode_msg, - grub_uint32_t **last_position); +VasEBoot_ssize_t VasEBoot_utf8_to_ucs4_alloc (const char *msg, + VasEBoot_uint32_t **unicode_msg, + VasEBoot_uint32_t **last_position); /* Returns the number of bytes the string src would occupy is converted to UTF-8, excluding \0. */ -grub_size_t -grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size); +VasEBoot_size_t +VasEBoot_get_num_of_utf8_bytes (const VasEBoot_uint32_t *src, VasEBoot_size_t size); /* Converts UCS-4 to UTF-8. Returns the number of bytes effectively written excluding the trailing \0. */ -grub_size_t -grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size, - grub_uint8_t *dest, grub_size_t destsize); -grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, - const grub_uint8_t *src, grub_size_t srcsize, - const grub_uint8_t **srcend); +VasEBoot_size_t +VasEBoot_ucs4_to_utf8 (const VasEBoot_uint32_t *src, VasEBoot_size_t size, + VasEBoot_uint8_t *dest, VasEBoot_size_t destsize); +VasEBoot_size_t VasEBoot_utf8_to_ucs4 (VasEBoot_uint32_t *dest, VasEBoot_size_t destsize, + const VasEBoot_uint8_t *src, VasEBoot_size_t srcsize, + const VasEBoot_uint8_t **srcend); /* Returns -2 if not enough space, -1 on invalid character. */ -grub_ssize_t -grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend, - grub_uint32_t code); +VasEBoot_ssize_t +VasEBoot_encode_utf8_character (VasEBoot_uint8_t *dest, VasEBoot_uint8_t *destend, + VasEBoot_uint32_t code); -const grub_uint32_t * -grub_unicode_get_comb_start (const grub_uint32_t *str, - const grub_uint32_t *cur); +const VasEBoot_uint32_t * +VasEBoot_unicode_get_comb_start (const VasEBoot_uint32_t *str, + const VasEBoot_uint32_t *cur); #endif diff --git a/include/VasEBoot/cmos.h b/include/VasEBoot/cmos.h index 56ccc71a9..4e84d1510 100644 --- a/include/VasEBoot/cmos.h +++ b/include/VasEBoot/cmos.h @@ -1,128 +1,128 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CMOS_H -#define GRUB_CMOS_H 1 +#ifndef VasEBoot_CMOS_H +#define VasEBoot_CMOS_H 1 -#include +#include #if !defined (__powerpc__) && !defined (__sparc__) -#include -#include +#include +#include #endif -#define GRUB_CMOS_INDEX_SECOND 0 -#define GRUB_CMOS_INDEX_SECOND_ALARM 1 -#define GRUB_CMOS_INDEX_MINUTE 2 -#define GRUB_CMOS_INDEX_MINUTE_ALARM 3 -#define GRUB_CMOS_INDEX_HOUR 4 -#define GRUB_CMOS_INDEX_HOUR_ALARM 5 -#define GRUB_CMOS_INDEX_DAY_OF_WEEK 6 -#define GRUB_CMOS_INDEX_DAY_OF_MONTH 7 -#define GRUB_CMOS_INDEX_MONTH 8 -#define GRUB_CMOS_INDEX_YEAR 9 +#define VasEBoot_CMOS_INDEX_SECOND 0 +#define VasEBoot_CMOS_INDEX_SECOND_ALARM 1 +#define VasEBoot_CMOS_INDEX_MINUTE 2 +#define VasEBoot_CMOS_INDEX_MINUTE_ALARM 3 +#define VasEBoot_CMOS_INDEX_HOUR 4 +#define VasEBoot_CMOS_INDEX_HOUR_ALARM 5 +#define VasEBoot_CMOS_INDEX_DAY_OF_WEEK 6 +#define VasEBoot_CMOS_INDEX_DAY_OF_MONTH 7 +#define VasEBoot_CMOS_INDEX_MONTH 8 +#define VasEBoot_CMOS_INDEX_YEAR 9 -#define GRUB_CMOS_INDEX_STATUS_A 0xA -#define GRUB_CMOS_INDEX_STATUS_B 0xB -#define GRUB_CMOS_INDEX_STATUS_C 0xC -#define GRUB_CMOS_INDEX_STATUS_D 0xD +#define VasEBoot_CMOS_INDEX_STATUS_A 0xA +#define VasEBoot_CMOS_INDEX_STATUS_B 0xB +#define VasEBoot_CMOS_INDEX_STATUS_C 0xC +#define VasEBoot_CMOS_INDEX_STATUS_D 0xD -#define GRUB_CMOS_STATUS_B_DAYLIGHT 1 -#define GRUB_CMOS_STATUS_B_24HOUR 2 -#define GRUB_CMOS_STATUS_B_BINARY 4 +#define VasEBoot_CMOS_STATUS_B_DAYLIGHT 1 +#define VasEBoot_CMOS_STATUS_B_24HOUR 2 +#define VasEBoot_CMOS_STATUS_B_BINARY 4 -static inline grub_uint8_t -grub_bcd_to_num (grub_uint8_t a) +static inline VasEBoot_uint8_t +VasEBoot_bcd_to_num (VasEBoot_uint8_t a) { return ((a >> 4) * 10 + (a & 0xF)); } -static inline grub_uint8_t -grub_num_to_bcd (grub_uint8_t a) +static inline VasEBoot_uint8_t +VasEBoot_num_to_bcd (VasEBoot_uint8_t a) { return (((a / 10) << 4) + (a % 10)); } #if !defined (__powerpc__) && !defined (__sparc__) -static inline grub_err_t -grub_cmos_read (grub_uint8_t index, grub_uint8_t *val) +static inline VasEBoot_err_t +VasEBoot_cmos_read (VasEBoot_uint8_t index, VasEBoot_uint8_t *val) { if (index & 0x80) { - grub_outb (index & 0x7f, GRUB_CMOS_ADDR_REG_HI); - *val = grub_inb (GRUB_CMOS_DATA_REG_HI); + VasEBoot_outb (index & 0x7f, VasEBoot_CMOS_ADDR_REG_HI); + *val = VasEBoot_inb (VasEBoot_CMOS_DATA_REG_HI); } else { - grub_outb (index & 0x7f, GRUB_CMOS_ADDR_REG); - *val = grub_inb (GRUB_CMOS_DATA_REG); + VasEBoot_outb (index & 0x7f, VasEBoot_CMOS_ADDR_REG); + *val = VasEBoot_inb (VasEBoot_CMOS_DATA_REG); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_cmos_write (grub_uint8_t index, grub_uint8_t value) +static inline VasEBoot_err_t +VasEBoot_cmos_write (VasEBoot_uint8_t index, VasEBoot_uint8_t value) { if (index & 0x80) { - grub_outb (index & 0x7f, GRUB_CMOS_ADDR_REG_HI); - grub_outb (value, GRUB_CMOS_DATA_REG_HI); + VasEBoot_outb (index & 0x7f, VasEBoot_CMOS_ADDR_REG_HI); + VasEBoot_outb (value, VasEBoot_CMOS_DATA_REG_HI); } else { - grub_outb (index & 0x7f, GRUB_CMOS_ADDR_REG); - grub_outb (value, GRUB_CMOS_DATA_REG); + VasEBoot_outb (index & 0x7f, VasEBoot_CMOS_ADDR_REG); + VasEBoot_outb (value, VasEBoot_CMOS_DATA_REG); } - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #else -grub_err_t grub_cmos_find_port (void); -extern volatile grub_uint8_t *grub_cmos_port; +VasEBoot_err_t VasEBoot_cmos_find_port (void); +extern volatile VasEBoot_uint8_t *VasEBoot_cmos_port; -static inline grub_err_t -grub_cmos_read (grub_uint8_t index, grub_uint8_t *val) +static inline VasEBoot_err_t +VasEBoot_cmos_read (VasEBoot_uint8_t index, VasEBoot_uint8_t *val) { - if (!grub_cmos_port) + if (!VasEBoot_cmos_port) { - grub_err_t err; - err = grub_cmos_find_port (); + VasEBoot_err_t err; + err = VasEBoot_cmos_find_port (); if (err) return err; } - grub_cmos_port[((index & 0x80) >> 6) | 0] = index & 0x7f; - *val = grub_cmos_port[((index & 0x80) >> 6) | 1]; - return GRUB_ERR_NONE; + VasEBoot_cmos_port[((index & 0x80) >> 6) | 0] = index & 0x7f; + *val = VasEBoot_cmos_port[((index & 0x80) >> 6) | 1]; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_cmos_write (grub_uint8_t index, grub_uint8_t val) +static inline VasEBoot_err_t +VasEBoot_cmos_write (VasEBoot_uint8_t index, VasEBoot_uint8_t val) { - if (!grub_cmos_port) + if (!VasEBoot_cmos_port) { - grub_err_t err; - err = grub_cmos_find_port (); + VasEBoot_err_t err; + err = VasEBoot_cmos_find_port (); if (err) return err; } - grub_cmos_port[((index & 0x80) >> 6) | 0] = index; - grub_cmos_port[((index & 0x80) >> 6) | 1] = val; - return GRUB_ERR_NONE; + VasEBoot_cmos_port[((index & 0x80) >> 6) | 0] = index; + VasEBoot_cmos_port[((index & 0x80) >> 6) | 1] = val; + return VasEBoot_ERR_NONE; } #endif -#endif /* GRUB_CMOS_H */ +#endif /* VasEBoot_CMOS_H */ diff --git a/include/VasEBoot/color.h b/include/VasEBoot/color.h index cb004a9a1..c6a8625da 100644 --- a/include/VasEBoot/color.h +++ b/include/VasEBoot/color.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_VIDEO_COLOR_HEADER -#define GRUB_VIDEO_COLOR_HEADER 1 +#ifndef VasEBoot_VIDEO_COLOR_HEADER +#define VasEBoot_VIDEO_COLOR_HEADER 1 -#include +#include -int grub_video_get_named_color (const char *name, - grub_video_rgba_color_t *color); +int VasEBoot_video_get_named_color (const char *name, + VasEBoot_video_rgba_color_t *color); -grub_err_t grub_video_parse_color (const char *s, - grub_video_rgba_color_t *color); +VasEBoot_err_t VasEBoot_video_parse_color (const char *s, + VasEBoot_video_rgba_color_t *color); #endif diff --git a/include/VasEBoot/command.h b/include/VasEBoot/command.h index eee4e847e..b0f2f61c0 100644 --- a/include/VasEBoot/command.h +++ b/include/VasEBoot/command.h @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_COMMAND_HEADER -#define GRUB_COMMAND_HEADER 1 +#ifndef VasEBoot_COMMAND_HEADER +#define VasEBoot_COMMAND_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -typedef enum grub_command_flags +typedef enum VasEBoot_command_flags { /* This is an extended command. */ - GRUB_COMMAND_FLAG_EXTCMD = 0x10, + VasEBoot_COMMAND_FLAG_EXTCMD = 0x10, /* This is an dynamic command. */ - GRUB_COMMAND_FLAG_DYNCMD = 0x20, + VasEBoot_COMMAND_FLAG_DYNCMD = 0x20, /* This command accepts block arguments. */ - GRUB_COMMAND_FLAG_BLOCKS = 0x40, + VasEBoot_COMMAND_FLAG_BLOCKS = 0x40, /* This command accepts unknown arguments as direct parameters. */ - GRUB_COMMAND_ACCEPT_DASH = 0x80, + VasEBoot_COMMAND_ACCEPT_DASH = 0x80, /* This command accepts only options preceding direct arguments. */ - GRUB_COMMAND_OPTIONS_AT_START = 0x100, + VasEBoot_COMMAND_OPTIONS_AT_START = 0x100, /* Can be executed in an entries extractor. */ - GRUB_COMMAND_FLAG_EXTRACTOR = 0x200 - } grub_command_flags_t; + VasEBoot_COMMAND_FLAG_EXTRACTOR = 0x200 + } VasEBoot_command_flags_t; -struct grub_command; +struct VasEBoot_command; -typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd, +typedef VasEBoot_err_t (*VasEBoot_command_func_t) (struct VasEBoot_command *cmd, int argc, char **argv); -#define GRUB_COMMAND_PRIO_MASK 0xff -#define GRUB_COMMAND_FLAG_ACTIVE 0x100 +#define VasEBoot_COMMAND_PRIO_MASK 0xff +#define VasEBoot_COMMAND_FLAG_ACTIVE 0x100 /* The command description. */ -struct grub_command +struct VasEBoot_command { /* The next element. */ - struct grub_command *next; - struct grub_command **prev; + struct VasEBoot_command *next; + struct VasEBoot_command **prev; /* The name. */ const char *name; @@ -62,10 +62,10 @@ struct grub_command int prio; /* The callback function. */ - grub_command_func_t func; + VasEBoot_command_func_t func; /* The flags. */ - grub_command_flags_t flags; + VasEBoot_command_flags_t flags; /* The summary of the command usage. */ const char *summary; @@ -76,54 +76,54 @@ struct grub_command /* Arbitrary data. */ void *data; }; -typedef struct grub_command *grub_command_t; +typedef struct VasEBoot_command *VasEBoot_command_t; -extern grub_command_t EXPORT_VAR(grub_command_list); +extern VasEBoot_command_t EXPORT_VAR(VasEBoot_command_list); -grub_command_t -EXPORT_FUNC(grub_register_command_prio) (const char *name, - grub_command_func_t func, +VasEBoot_command_t +EXPORT_FUNC(VasEBoot_register_command_prio) (const char *name, + VasEBoot_command_func_t func, const char *summary, const char *description, int prio); -void EXPORT_FUNC(grub_unregister_command) (grub_command_t cmd); +void EXPORT_FUNC(VasEBoot_unregister_command) (VasEBoot_command_t cmd); -static inline grub_command_t -grub_register_command (const char *name, - grub_command_func_t func, +static inline VasEBoot_command_t +VasEBoot_register_command (const char *name, + VasEBoot_command_func_t func, const char *summary, const char *description) { - return grub_register_command_prio (name, func, summary, description, 0); + return VasEBoot_register_command_prio (name, func, summary, description, 0); } -static inline grub_command_t -grub_register_command_p1 (const char *name, - grub_command_func_t func, +static inline VasEBoot_command_t +VasEBoot_register_command_p1 (const char *name, + VasEBoot_command_func_t func, const char *summary, const char *description) { - return grub_register_command_prio (name, func, summary, description, 1); + return VasEBoot_register_command_prio (name, func, summary, description, 1); } -static inline grub_command_t -grub_command_find (const char *name) +static inline VasEBoot_command_t +VasEBoot_command_find (const char *name) { - return grub_named_list_find (GRUB_AS_NAMED_LIST (grub_command_list), name); + return VasEBoot_named_list_find (VasEBoot_AS_NAMED_LIST (VasEBoot_command_list), name); } -static inline grub_err_t -grub_command_execute (const char *name, int argc, char **argv) +static inline VasEBoot_err_t +VasEBoot_command_execute (const char *name, int argc, char **argv) { - grub_command_t cmd; + VasEBoot_command_t cmd; - cmd = grub_command_find (name); - return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND; + cmd = VasEBoot_command_find (name); + return (cmd) ? cmd->func (cmd, argc, argv) : VasEBoot_ERR_FILE_NOT_FOUND; } -#define FOR_COMMANDS(var) FOR_LIST_ELEMENTS((var), grub_command_list) -#define FOR_COMMANDS_SAFE(var, next) FOR_LIST_ELEMENTS_SAFE((var), (next), grub_command_list) +#define FOR_COMMANDS(var) FOR_LIST_ELEMENTS((var), VasEBoot_command_list) +#define FOR_COMMANDS_SAFE(var, next) FOR_LIST_ELEMENTS_SAFE((var), (next), VasEBoot_command_list) -void grub_register_core_commands (void); +void VasEBoot_register_core_commands (void); -#endif /* ! GRUB_COMMAND_HEADER */ +#endif /* ! VasEBoot_COMMAND_HEADER */ diff --git a/include/VasEBoot/compiler-rt-emu.h b/include/VasEBoot/compiler-rt-emu.h index b21425d9e..14286f34f 100644 --- a/include/VasEBoot/compiler-rt-emu.h +++ b/include/VasEBoot/compiler-rt-emu.h @@ -1,163 +1,163 @@ /* compiler-rt-emu.h - prototypes for compiler helpers. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010-2014 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_COMPILER_RT_HEADER -#define GRUB_COMPILER_RT_HEADER 1 +#ifndef VasEBoot_COMPILER_RT_HEADER +#define VasEBoot_COMPILER_RT_HEADER 1 #include -#include -#include +#include +#include #ifdef HAVE___UDIVSI3 -grub_uint32_t -EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__udivsi3) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); #endif #ifdef HAVE___UMODSI3 -grub_uint32_t -EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__umodsi3) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); #endif #ifdef HAVE___DIVSI3 -grub_int32_t -EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__divsi3) (VasEBoot_int32_t a, VasEBoot_int32_t b); #endif #ifdef HAVE___MODSI3 -grub_int32_t -EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__modsi3) (VasEBoot_int32_t a, VasEBoot_int32_t b); #endif #ifdef HAVE___DIVDI3 -grub_int64_t -EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b); +VasEBoot_int64_t +EXPORT_FUNC (__divdi3) (VasEBoot_int64_t a, VasEBoot_int64_t b); #endif #ifdef HAVE___MODDI3 -grub_int64_t -EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b); +VasEBoot_int64_t +EXPORT_FUNC (__moddi3) (VasEBoot_int64_t a, VasEBoot_int64_t b); #endif #ifdef HAVE___UDIVDI3 -grub_uint64_t -EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__udivdi3) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif #ifdef HAVE___UMODDI3 -grub_uint64_t -EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__umoddi3) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif #ifdef HAVE___CTZDI2 unsigned -EXPORT_FUNC (__ctzdi2) (grub_uint64_t x); +EXPORT_FUNC (__ctzdi2) (VasEBoot_uint64_t x); #endif #ifdef HAVE___CTZSI2 unsigned -EXPORT_FUNC (__ctzsi2) (grub_uint32_t x); +EXPORT_FUNC (__ctzsi2) (VasEBoot_uint32_t x); #endif #ifdef HAVE___AEABI_UIDIV -grub_uint32_t -EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__aeabi_uidiv) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); #endif #ifdef HAVE___AEABI_UIDIVMOD -grub_uint32_t -EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__aeabi_uidivmod) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); #endif #ifdef HAVE___AEABI_IDIV -grub_int32_t -EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__aeabi_idiv) (VasEBoot_int32_t a, VasEBoot_int32_t b); #endif #ifdef HAVE___AEABI_IDIVMOD -grub_int32_t -EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__aeabi_idivmod) (VasEBoot_int32_t a, VasEBoot_int32_t b); #endif #ifdef HAVE___AEABI_ULCMP int -EXPORT_FUNC (__aeabi_ulcmp) (grub_uint64_t a, grub_uint64_t b); +EXPORT_FUNC (__aeabi_ulcmp) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif /* Needed for allowing modules to be compiled as thumb. */ #ifdef HAVE___MULDI3 -grub_uint64_t -EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__muldi3) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif #ifdef HAVE___AEABI_LMUL -grub_uint64_t -EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_lmul) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif #ifdef HAVE___AEABI_MEMCPY void * -EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n); +EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_MEMCPY4 void * -EXPORT_FUNC (__aeabi_memcpy4) (void *dest, const void *src, grub_size_t n); +EXPORT_FUNC (__aeabi_memcpy4) (void *dest, const void *src, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_MEMCPY8 void * -EXPORT_FUNC (__aeabi_memcpy8) (void *dest, const void *src, grub_size_t n); +EXPORT_FUNC (__aeabi_memcpy8) (void *dest, const void *src, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_MEMSET void * -EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); +EXPORT_FUNC(__aeabi_memset) (void *s, int c, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_MEMCLR void * -EXPORT_FUNC(__aeabi_memclr) (void *s, grub_size_t n); +EXPORT_FUNC(__aeabi_memclr) (void *s, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_MEMCLR4 void * -EXPORT_FUNC(__aeabi_memclr4) (void *s, grub_size_t n); +EXPORT_FUNC(__aeabi_memclr4) (void *s, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_MEMCLR8 void * -EXPORT_FUNC(__aeabi_memclr8) (void *s, grub_size_t n); +EXPORT_FUNC(__aeabi_memclr8) (void *s, VasEBoot_size_t n); #endif #ifdef HAVE___AEABI_LASR -grub_uint64_t -EXPORT_FUNC (__aeabi_lasr) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_lasr) (VasEBoot_uint64_t u, int b); #endif #ifdef HAVE___AEABI_LLSL -grub_uint64_t -EXPORT_FUNC (__aeabi_llsl) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_llsl) (VasEBoot_uint64_t u, int b); #endif #ifdef HAVE___AEABI_LLSR -grub_uint64_t -EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_llsr) (VasEBoot_uint64_t u, int b); #endif @@ -204,41 +204,41 @@ void EXPORT_FUNC (_savegpr_31) (void); #ifdef HAVE___UCMPDI2 int -EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b); +EXPORT_FUNC(__ucmpdi2) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif #ifdef HAVE___ASHLDI3 -grub_uint64_t -EXPORT_FUNC(__ashldi3) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC(__ashldi3) (VasEBoot_uint64_t u, int b); #endif #ifdef HAVE___ASHRDI3 -grub_uint64_t -EXPORT_FUNC(__ashrdi3) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC(__ashrdi3) (VasEBoot_uint64_t u, int b); #endif #ifdef HAVE___LSHRDI3 -grub_uint64_t -EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__lshrdi3) (VasEBoot_uint64_t u, int b); #endif #ifdef HAVE___BSWAPSI2 -grub_uint32_t -EXPORT_FUNC(__bswapsi2) (grub_uint32_t u); +VasEBoot_uint32_t +EXPORT_FUNC(__bswapsi2) (VasEBoot_uint32_t u); #endif #ifdef HAVE___BSWAPDI2 -grub_uint64_t -EXPORT_FUNC(__bswapdi2) (grub_uint64_t u); +VasEBoot_uint64_t +EXPORT_FUNC(__bswapdi2) (VasEBoot_uint64_t u); #endif -int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); -void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); -void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); -void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); +int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, VasEBoot_size_t n); +void *EXPORT_FUNC(memmove) (void *dest, const void *src, VasEBoot_size_t n); +void *EXPORT_FUNC(memcpy) (void *dest, const void *src, VasEBoot_size_t n); +void *EXPORT_FUNC(memset) (void *s, int c, VasEBoot_size_t n); #ifdef HAVE___BZERO -void EXPORT_FUNC (__bzero) (void *s, grub_size_t n); +void EXPORT_FUNC (__bzero) (void *s, VasEBoot_size_t n); #endif #ifdef HAVE___REGISTER_FRAME_INFO diff --git a/include/VasEBoot/compiler-rt.h b/include/VasEBoot/compiler-rt.h index dc73649a5..7c1442ed5 100644 --- a/include/VasEBoot/compiler-rt.h +++ b/include/VasEBoot/compiler-rt.h @@ -1,110 +1,110 @@ /* compiler-rt.h - prototypes for compiler helpers. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010-2014 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_COMPILER_RT_HEADER -#define GRUB_COMPILER_RT_HEADER 1 +#ifndef VasEBoot_COMPILER_RT_HEADER +#define VasEBoot_COMPILER_RT_HEADER 1 #include -#include -#include -#include +#include +#include +#include -#if defined(GRUB_DIVISION_IN_SOFTWARE) && GRUB_DIVISION_IN_SOFTWARE +#if defined(VasEBoot_DIVISION_IN_SOFTWARE) && VasEBoot_DIVISION_IN_SOFTWARE -grub_uint32_t -EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__udivsi3) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); -grub_uint32_t -EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__umodsi3) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); -grub_int32_t -EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__divsi3) (VasEBoot_int32_t a, VasEBoot_int32_t b); -grub_int32_t -EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__modsi3) (VasEBoot_int32_t a, VasEBoot_int32_t b); -grub_int64_t -EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b); +VasEBoot_int64_t +EXPORT_FUNC (__divdi3) (VasEBoot_int64_t a, VasEBoot_int64_t b); -grub_int64_t -EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b); +VasEBoot_int64_t +EXPORT_FUNC (__moddi3) (VasEBoot_int64_t a, VasEBoot_int64_t b); -grub_uint64_t -EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__udivdi3) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); -grub_uint64_t -EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__umoddi3) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); #endif #if defined (__sparc__) || defined (__powerpc__) || defined (__mips__) || defined (__arm__) unsigned -EXPORT_FUNC (__ctzdi2) (grub_uint64_t x); +EXPORT_FUNC (__ctzdi2) (VasEBoot_uint64_t x); #define NEED_CTZDI2 1 #endif #if defined (__mips__) || defined (__arm__) unsigned -EXPORT_FUNC (__ctzsi2) (grub_uint32_t x); +EXPORT_FUNC (__ctzsi2) (VasEBoot_uint32_t x); #define NEED_CTZSI2 1 #endif #ifdef __arm__ -grub_uint32_t -EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); -grub_uint32_t -EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__aeabi_uidiv) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); +VasEBoot_uint32_t +EXPORT_FUNC (__aeabi_uidivmod) (VasEBoot_uint32_t a, VasEBoot_uint32_t b); -grub_int32_t -EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b); -grub_int32_t -EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__aeabi_idiv) (VasEBoot_int32_t a, VasEBoot_int32_t b); +VasEBoot_int32_t +EXPORT_FUNC (__aeabi_idivmod) (VasEBoot_int32_t a, VasEBoot_int32_t b); int -EXPORT_FUNC (__aeabi_ulcmp) (grub_uint64_t a, grub_uint64_t b); +EXPORT_FUNC (__aeabi_ulcmp) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); /* Needed for allowing modules to be compiled as thumb. */ -grub_uint64_t -EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); -grub_uint64_t -EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__muldi3) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_lmul) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); void * -EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n); +EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, VasEBoot_size_t n); void * -EXPORT_FUNC (__aeabi_memcpy4) (void *dest, const void *src, grub_size_t n); +EXPORT_FUNC (__aeabi_memcpy4) (void *dest, const void *src, VasEBoot_size_t n); void * -EXPORT_FUNC (__aeabi_memcpy8) (void *dest, const void *src, grub_size_t n); +EXPORT_FUNC (__aeabi_memcpy8) (void *dest, const void *src, VasEBoot_size_t n); void * -EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n); -void EXPORT_FUNC(__aeabi_memclr) (void *s, grub_size_t n); -void EXPORT_FUNC(__aeabi_memclr4) (void *s, grub_size_t n); -void EXPORT_FUNC(__aeabi_memclr8) (void *s, grub_size_t n); +EXPORT_FUNC(__aeabi_memset) (void *s, int c, VasEBoot_size_t n); +void EXPORT_FUNC(__aeabi_memclr) (void *s, VasEBoot_size_t n); +void EXPORT_FUNC(__aeabi_memclr4) (void *s, VasEBoot_size_t n); +void EXPORT_FUNC(__aeabi_memclr8) (void *s, VasEBoot_size_t n); -grub_uint64_t -EXPORT_FUNC (__aeabi_lasr) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_lasr) (VasEBoot_uint64_t u, int b); -grub_uint64_t -EXPORT_FUNC (__aeabi_llsl) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_llsl) (VasEBoot_uint64_t u, int b); -grub_uint64_t -EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__aeabi_llsr) (VasEBoot_uint64_t u, int b); #endif @@ -153,40 +153,40 @@ void EXPORT_FUNC (_savegpr_31) (void); #if defined (__powerpc__) || defined(__mips__) || defined (__arm__) int -EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b); +EXPORT_FUNC(__ucmpdi2) (VasEBoot_uint64_t a, VasEBoot_uint64_t b); -grub_uint64_t -EXPORT_FUNC(__ashldi3) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC(__ashldi3) (VasEBoot_uint64_t u, int b); -grub_uint64_t -EXPORT_FUNC(__ashrdi3) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC(__ashrdi3) (VasEBoot_uint64_t u, int b); -grub_uint64_t -EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b); +VasEBoot_uint64_t +EXPORT_FUNC (__lshrdi3) (VasEBoot_uint64_t u, int b); #endif #if defined (__powerpc__) || defined(__mips__) || defined(__sparc__) || defined (__arm__) -grub_uint32_t -EXPORT_FUNC(__bswapsi2) (grub_uint32_t u); +VasEBoot_uint32_t +EXPORT_FUNC(__bswapsi2) (VasEBoot_uint32_t u); -grub_uint64_t -EXPORT_FUNC(__bswapdi2) (grub_uint64_t u); +VasEBoot_uint64_t +EXPORT_FUNC(__bswapdi2) (VasEBoot_uint64_t u); #endif #if defined (__APPLE__) && defined(__i386__) -#define GRUB_BUILTIN_ATTR __attribute__ ((regparm(0))) +#define VasEBoot_BUILTIN_ATTR __attribute__ ((regparm(0))) #else -#define GRUB_BUILTIN_ATTR +#define VasEBoot_BUILTIN_ATTR #endif /* Prototypes for aliases. */ -int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); -void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); -void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); -void *GRUB_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); +int VasEBoot_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, VasEBoot_size_t n); +void *VasEBoot_BUILTIN_ATTR EXPORT_FUNC(memmove) (void *dest, const void *src, VasEBoot_size_t n); +void *VasEBoot_BUILTIN_ATTR EXPORT_FUNC(memcpy) (void *dest, const void *src, VasEBoot_size_t n); +void *VasEBoot_BUILTIN_ATTR EXPORT_FUNC(memset) (void *s, int c, VasEBoot_size_t n); #ifdef __APPLE__ -void GRUB_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, grub_size_t n); +void VasEBoot_BUILTIN_ATTR EXPORT_FUNC (__bzero) (void *s, VasEBoot_size_t n); #endif #if defined (__MINGW32__) || defined (__CYGWIN__) diff --git a/include/VasEBoot/compiler.h b/include/VasEBoot/compiler.h index c9e1d7a73..3d47de47b 100644 --- a/include/VasEBoot/compiler.h +++ b/include/VasEBoot/compiler.h @@ -1,24 +1,24 @@ /* compiler.h - macros for various compiler features */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010,2014 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_COMPILER_HEADER -#define GRUB_COMPILER_HEADER 1 +#ifndef VasEBoot_COMPILER_HEADER +#define VasEBoot_COMPILER_HEADER 1 /* GCC version checking borrowed from glibc. */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) @@ -48,4 +48,4 @@ # define WARN_UNUSED_RESULT #endif -#endif /* ! GRUB_COMPILER_HEADER */ +#endif /* ! VasEBoot_COMPILER_HEADER */ diff --git a/include/VasEBoot/crypto.h b/include/VasEBoot/crypto.h index a24e89dd9..3e935284b 100644 --- a/include/VasEBoot/crypto.h +++ b/include/VasEBoot/crypto.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 * 2007, 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Contains elements based on gcrypt-module.h and gcrypt.h.in. If it's changed please update this file. */ -#ifndef GRUB_CRYPTO_HEADER -#define GRUB_CRYPTO_HEADER 1 +#ifndef VasEBoot_CRYPTO_HEADER +#define VasEBoot_CRYPTO_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include typedef enum { @@ -86,9 +86,9 @@ enum gcry_cipher_modes #endif /* Don't rely on this. Check! */ -#define GRUB_CRYPTO_MAX_MDLEN 64 -#define GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE 16 -#define GRUB_CRYPTO_MAX_MD_CONTEXT_SIZE 256 +#define VasEBoot_CRYPTO_MAX_MDLEN 64 +#define VasEBoot_CRYPTO_MAX_CIPHER_BLOCKSIZE 16 +#define VasEBoot_CRYPTO_MAX_MD_CONTEXT_SIZE 256 /* Type for the cipher_setkey function. */ typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c, @@ -129,15 +129,15 @@ typedef struct gcry_cipher_spec const char *name; const char **aliases; gcry_cipher_oid_spec_t *oids; - grub_size_t blocksize; - grub_size_t keylen; - grub_size_t contextsize; + VasEBoot_size_t blocksize; + VasEBoot_size_t keylen; + VasEBoot_size_t contextsize; gcry_cipher_setkey_t setkey; gcry_cipher_encrypt_t encrypt; gcry_cipher_decrypt_t decrypt; gcry_cipher_stencrypt_t stencrypt; gcry_cipher_stdecrypt_t stdecrypt; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL const char *modname; #endif struct gcry_cipher_spec *next; @@ -147,7 +147,7 @@ typedef struct gcry_cipher_spec typedef void (*gcry_md_init_t) (void *c); /* Type for the md_write function. */ -typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes); +typedef void (*gcry_md_write_t) (void *c, const void *buf, VasEBoot_size_t nbytes); /* Type for the md_final function. */ typedef void (*gcry_md_final_t) (void *c); @@ -167,15 +167,15 @@ typedef struct gcry_md_spec unsigned char *asnoid; int asnlen; gcry_md_oid_spec_t *oids; - grub_size_t mdlen; + VasEBoot_size_t mdlen; gcry_md_init_t init; gcry_md_write_t write; gcry_md_final_t final; gcry_md_read_t read; - grub_size_t contextsize; /* allocate this amount of context */ + VasEBoot_size_t contextsize; /* allocate this amount of context */ /* Block size, needed for HMAC. */ - grub_size_t blocksize; -#ifdef GRUB_UTIL + VasEBoot_size_t blocksize; +#ifdef VasEBoot_UTIL const char *modname; #endif struct gcry_md_spec *next; @@ -244,46 +244,46 @@ typedef struct gcry_pk_spec gcry_pk_sign_t sign; gcry_pk_verify_t verify; gcry_pk_get_nbits_t get_nbits; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL const char *modname; #endif } gcry_pk_spec_t; -struct grub_crypto_cipher_handle +struct VasEBoot_crypto_cipher_handle { const struct gcry_cipher_spec *cipher; char ctx[0]; }; -typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t; +typedef struct VasEBoot_crypto_cipher_handle *VasEBoot_crypto_cipher_handle_t; -struct grub_crypto_hmac_handle; +struct VasEBoot_crypto_hmac_handle; const gcry_cipher_spec_t * -grub_crypto_lookup_cipher_by_name (const char *name); +VasEBoot_crypto_lookup_cipher_by_name (const char *name); -grub_crypto_cipher_handle_t -grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher); +VasEBoot_crypto_cipher_handle_t +VasEBoot_crypto_cipher_open (const struct gcry_cipher_spec *cipher); gcry_err_code_t -grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher, +VasEBoot_crypto_cipher_set_key (VasEBoot_crypto_cipher_handle_t cipher, const unsigned char *key, unsigned keylen); static inline void -grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher) +VasEBoot_crypto_cipher_close (VasEBoot_crypto_cipher_handle_t cipher) { - grub_free (cipher); + VasEBoot_free (cipher); } static inline void -grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size) +VasEBoot_crypto_xor (void *out, const void *in1, const void *in2, VasEBoot_size_t size) { - const grub_uint8_t *in1ptr = in1, *in2ptr = in2; - grub_uint8_t *outptr = out; - while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1)) - || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1)) - || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1)))) + const VasEBoot_uint8_t *in1ptr = in1, *in2ptr = in2; + VasEBoot_uint8_t *outptr = out; + while (size && (((VasEBoot_addr_t) in1ptr & (sizeof (VasEBoot_uint64_t) - 1)) + || ((VasEBoot_addr_t) in2ptr & (sizeof (VasEBoot_uint64_t) - 1)) + || ((VasEBoot_addr_t) outptr & (sizeof (VasEBoot_uint64_t) - 1)))) { *outptr = *in1ptr ^ *in2ptr; in1ptr++; @@ -291,16 +291,16 @@ grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size) outptr++; size--; } - while (size >= sizeof (grub_uint64_t)) + while (size >= sizeof (VasEBoot_uint64_t)) { /* We've already checked that all pointers are aligned. */ - *(grub_uint64_t *) (void *) outptr - = (*(const grub_uint64_t *) (const void *) in1ptr - ^ *(const grub_uint64_t *) (const void *) in2ptr); - in1ptr += sizeof (grub_uint64_t); - in2ptr += sizeof (grub_uint64_t); - outptr += sizeof (grub_uint64_t); - size -= sizeof (grub_uint64_t); + *(VasEBoot_uint64_t *) (void *) outptr + = (*(const VasEBoot_uint64_t *) (const void *) in1ptr + ^ *(const VasEBoot_uint64_t *) (const void *) in2ptr); + in1ptr += sizeof (VasEBoot_uint64_t); + in2ptr += sizeof (VasEBoot_uint64_t); + outptr += sizeof (VasEBoot_uint64_t); + size -= sizeof (VasEBoot_uint64_t); } while (size) { @@ -313,59 +313,59 @@ grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size) } gcry_err_code_t -grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size); +VasEBoot_crypto_ecb_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size); gcry_err_code_t -grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size); +VasEBoot_crypto_ecb_encrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size); gcry_err_code_t -grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size, +VasEBoot_crypto_cbc_encrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size, void *iv_in); gcry_err_code_t -grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher, - void *out, const void *in, grub_size_t size, +VasEBoot_crypto_cbc_decrypt (VasEBoot_crypto_cipher_handle_t cipher, + void *out, const void *in, VasEBoot_size_t size, void *iv); void -grub_cipher_register (gcry_cipher_spec_t *cipher); +VasEBoot_cipher_register (gcry_cipher_spec_t *cipher); void -grub_cipher_unregister (gcry_cipher_spec_t *cipher); +VasEBoot_cipher_unregister (gcry_cipher_spec_t *cipher); void -grub_md_register (gcry_md_spec_t *digest); +VasEBoot_md_register (gcry_md_spec_t *digest); void -grub_md_unregister (gcry_md_spec_t *cipher); +VasEBoot_md_unregister (gcry_md_spec_t *cipher); -extern struct gcry_pk_spec *grub_crypto_pk_dsa; -extern struct gcry_pk_spec *grub_crypto_pk_ecdsa; -extern struct gcry_pk_spec *grub_crypto_pk_ecdh; -extern struct gcry_pk_spec *grub_crypto_pk_rsa; +extern struct gcry_pk_spec *VasEBoot_crypto_pk_dsa; +extern struct gcry_pk_spec *VasEBoot_crypto_pk_ecdsa; +extern struct gcry_pk_spec *VasEBoot_crypto_pk_ecdh; +extern struct gcry_pk_spec *VasEBoot_crypto_pk_rsa; void -grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in, - grub_size_t inlen); +VasEBoot_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in, + VasEBoot_size_t inlen); const gcry_md_spec_t * -grub_crypto_lookup_md_by_name (const char *name); +VasEBoot_crypto_lookup_md_by_name (const char *name); -grub_err_t -grub_crypto_gcry_error (gcry_err_code_t in); +VasEBoot_err_t +VasEBoot_crypto_gcry_error (gcry_err_code_t in); -void grub_burn_stack (grub_size_t size); +void VasEBoot_burn_stack (VasEBoot_size_t size); -struct grub_crypto_hmac_handle * -grub_crypto_hmac_init (const struct gcry_md_spec *md, - const void *key, grub_size_t keylen); +struct VasEBoot_crypto_hmac_handle * +VasEBoot_crypto_hmac_init (const struct gcry_md_spec *md, + const void *key, VasEBoot_size_t keylen); void -grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd, +VasEBoot_crypto_hmac_write (struct VasEBoot_crypto_hmac_handle *hnd, const void *data, - grub_size_t datalen); + VasEBoot_size_t datalen); gcry_err_code_t -grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out); +VasEBoot_crypto_hmac_fini (struct VasEBoot_crypto_hmac_handle *hnd, void *out); gcry_err_code_t -grub_crypto_hmac_buffer (const struct gcry_md_spec *md, - const void *key, grub_size_t keylen, - const void *data, grub_size_t datalen, void *out); +VasEBoot_crypto_hmac_buffer (const struct gcry_md_spec *md, + const void *key, VasEBoot_size_t keylen, + const void *data, VasEBoot_size_t datalen, void *out); extern gcry_md_spec_t _gcry_digest_spec_md5; extern gcry_md_spec_t _gcry_digest_spec_sha1; @@ -373,12 +373,12 @@ extern gcry_md_spec_t _gcry_digest_spec_sha256; extern gcry_md_spec_t _gcry_digest_spec_sha512; extern gcry_md_spec_t _gcry_digest_spec_crc32; extern gcry_cipher_spec_t _gcry_cipher_spec_aes; -#define GRUB_MD_MD5 ((const gcry_md_spec_t *) &_gcry_digest_spec_md5) -#define GRUB_MD_SHA1 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha1) -#define GRUB_MD_SHA256 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha256) -#define GRUB_MD_SHA512 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha512) -#define GRUB_MD_CRC32 ((const gcry_md_spec_t *) &_gcry_digest_spec_crc32) -#define GRUB_CIPHER_AES ((const gcry_cipher_spec_t *) &_gcry_cipher_spec_aes) +#define VasEBoot_MD_MD5 ((const gcry_md_spec_t *) &_gcry_digest_spec_md5) +#define VasEBoot_MD_SHA1 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha1) +#define VasEBoot_MD_SHA256 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha256) +#define VasEBoot_MD_SHA512 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha512) +#define VasEBoot_MD_CRC32 ((const gcry_md_spec_t *) &_gcry_digest_spec_crc32) +#define VasEBoot_CIPHER_AES ((const gcry_cipher_spec_t *) &_gcry_cipher_spec_aes) /* Implement PKCS#5 PBKDF2 as per RFC 2898. The PRF to use is HMAC variant of digest supplied by MD. Inputs are the password P of length PLEN, @@ -387,22 +387,22 @@ extern gcry_cipher_spec_t _gcry_cipher_spec_aes; must have room for at least DKLEN octets. The output buffer will be filled with the derived data. */ gcry_err_code_t -grub_crypto_pbkdf2 (const struct gcry_md_spec *md, - const grub_uint8_t *P, grub_size_t Plen, - const grub_uint8_t *S, grub_size_t Slen, +VasEBoot_crypto_pbkdf2 (const struct gcry_md_spec *md, + const VasEBoot_uint8_t *P, VasEBoot_size_t Plen, + const VasEBoot_uint8_t *S, VasEBoot_size_t Slen, unsigned int c, - grub_uint8_t *DK, grub_size_t dkLen); + VasEBoot_uint8_t *DK, VasEBoot_size_t dkLen); int -grub_crypto_memcmp (const void *a, const void *b, grub_size_t n); +VasEBoot_crypto_memcmp (const void *a, const void *b, VasEBoot_size_t n); int -grub_password_get (char buf[], unsigned buf_size); +VasEBoot_password_get (char buf[], unsigned buf_size); /* For indistinguishibility. */ -#define GRUB_ACCESS_DENIED grub_error (GRUB_ERR_ACCESS_DENIED, N_("access denied")) +#define VasEBoot_ACCESS_DENIED VasEBoot_error (VasEBoot_ERR_ACCESS_DENIED, N_("access denied")) -extern void (*grub_crypto_autoload_hook) (const char *name); +extern void (*VasEBoot_crypto_autoload_hook) (const char *name); void _gcry_assert_failed (const char *expr, const char *file, int line, const char *func) __attribute__ ((noreturn)); @@ -411,12 +411,12 @@ void _gcry_burn_stack (int bytes); void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2))); -#ifdef GRUB_UTIL -void grub_gcry_init_all (void); -void grub_gcry_fini_all (void); +#ifdef VasEBoot_UTIL +void VasEBoot_gcry_init_all (void); +void VasEBoot_gcry_fini_all (void); int -grub_get_random (void *out, grub_size_t len); +VasEBoot_get_random (void *out, VasEBoot_size_t len); #endif diff --git a/include/VasEBoot/cryptodisk.h b/include/VasEBoot/cryptodisk.h index 32f564ae0..8676eeefe 100644 --- a/include/VasEBoot/cryptodisk.h +++ b/include/VasEBoot/cryptodisk.h @@ -1,159 +1,159 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CRYPTODISK_HEADER -#define GRUB_CRYPTODISK_HEADER 1 +#ifndef VasEBoot_CRYPTODISK_HEADER +#define VasEBoot_CRYPTODISK_HEADER 1 -#include -#include -#include -#ifdef GRUB_UTIL -#include +#include +#include +#include +#ifdef VasEBoot_UTIL +#include #endif typedef enum { - GRUB_CRYPTODISK_MODE_ECB, - GRUB_CRYPTODISK_MODE_CBC, - GRUB_CRYPTODISK_MODE_PCBC, - GRUB_CRYPTODISK_MODE_XTS, - GRUB_CRYPTODISK_MODE_LRW - } grub_cryptodisk_mode_t; + VasEBoot_CRYPTODISK_MODE_ECB, + VasEBoot_CRYPTODISK_MODE_CBC, + VasEBoot_CRYPTODISK_MODE_PCBC, + VasEBoot_CRYPTODISK_MODE_XTS, + VasEBoot_CRYPTODISK_MODE_LRW + } VasEBoot_cryptodisk_mode_t; typedef enum { - GRUB_CRYPTODISK_MODE_IV_NULL, - GRUB_CRYPTODISK_MODE_IV_PLAIN, - GRUB_CRYPTODISK_MODE_IV_PLAIN64, - GRUB_CRYPTODISK_MODE_IV_ESSIV, - GRUB_CRYPTODISK_MODE_IV_BENBI, - GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64, - GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH - } grub_cryptodisk_mode_iv_t; + VasEBoot_CRYPTODISK_MODE_IV_NULL, + VasEBoot_CRYPTODISK_MODE_IV_PLAIN, + VasEBoot_CRYPTODISK_MODE_IV_PLAIN64, + VasEBoot_CRYPTODISK_MODE_IV_ESSIV, + VasEBoot_CRYPTODISK_MODE_IV_BENBI, + VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64, + VasEBoot_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH + } VasEBoot_cryptodisk_mode_iv_t; -#define GRUB_CRYPTODISK_MAX_UUID_LENGTH 71 +#define VasEBoot_CRYPTODISK_MAX_UUID_LENGTH 71 -#define GRUB_CRYPTODISK_GF_LOG_SIZE 7 -#define GRUB_CRYPTODISK_GF_SIZE (1U << GRUB_CRYPTODISK_GF_LOG_SIZE) -#define GRUB_CRYPTODISK_GF_LOG_BYTES (GRUB_CRYPTODISK_GF_LOG_SIZE - 3) -#define GRUB_CRYPTODISK_GF_BYTES (1U << GRUB_CRYPTODISK_GF_LOG_BYTES) -#define GRUB_CRYPTODISK_MAX_KEYLEN 128 +#define VasEBoot_CRYPTODISK_GF_LOG_SIZE 7 +#define VasEBoot_CRYPTODISK_GF_SIZE (1U << VasEBoot_CRYPTODISK_GF_LOG_SIZE) +#define VasEBoot_CRYPTODISK_GF_LOG_BYTES (VasEBoot_CRYPTODISK_GF_LOG_SIZE - 3) +#define VasEBoot_CRYPTODISK_GF_BYTES (1U << VasEBoot_CRYPTODISK_GF_LOG_BYTES) +#define VasEBoot_CRYPTODISK_MAX_KEYLEN 128 -struct grub_cryptodisk; +struct VasEBoot_cryptodisk; typedef gcry_err_code_t -(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev, - grub_uint64_t zoneno); +(*VasEBoot_cryptodisk_rekey_func_t) (struct VasEBoot_cryptodisk *dev, + VasEBoot_uint64_t zoneno); -struct grub_cryptodisk +struct VasEBoot_cryptodisk { - struct grub_cryptodisk *next; - struct grub_cryptodisk **prev; + struct VasEBoot_cryptodisk *next; + struct VasEBoot_cryptodisk **prev; char *source; - grub_disk_addr_t offset; - grub_disk_addr_t total_length; - grub_disk_t source_disk; + VasEBoot_disk_addr_t offset; + VasEBoot_disk_addr_t total_length; + VasEBoot_disk_t source_disk; int ref; - grub_crypto_cipher_handle_t cipher; - grub_crypto_cipher_handle_t secondary_cipher; - grub_crypto_cipher_handle_t essiv_cipher; + VasEBoot_crypto_cipher_handle_t cipher; + VasEBoot_crypto_cipher_handle_t secondary_cipher; + VasEBoot_crypto_cipher_handle_t essiv_cipher; const gcry_md_spec_t *essiv_hash, *hash, *iv_hash; - grub_cryptodisk_mode_t mode; - grub_cryptodisk_mode_iv_t mode_iv; + VasEBoot_cryptodisk_mode_t mode; + VasEBoot_cryptodisk_mode_iv_t mode_iv; int benbi_log; unsigned long id, source_id; - enum grub_disk_dev_id source_dev_id; - char uuid[GRUB_CRYPTODISK_MAX_UUID_LENGTH + 1]; - grub_uint8_t lrw_key[GRUB_CRYPTODISK_GF_BYTES]; - grub_uint8_t *lrw_precalc; - grub_uint8_t iv_prefix[64]; - grub_size_t iv_prefix_len; - grub_uint8_t key[GRUB_CRYPTODISK_MAX_KEYLEN]; - grub_size_t keysize; -#ifdef GRUB_UTIL + enum VasEBoot_disk_dev_id source_dev_id; + char uuid[VasEBoot_CRYPTODISK_MAX_UUID_LENGTH + 1]; + VasEBoot_uint8_t lrw_key[VasEBoot_CRYPTODISK_GF_BYTES]; + VasEBoot_uint8_t *lrw_precalc; + VasEBoot_uint8_t iv_prefix[64]; + VasEBoot_size_t iv_prefix_len; + VasEBoot_uint8_t key[VasEBoot_CRYPTODISK_MAX_KEYLEN]; + VasEBoot_size_t keysize; +#ifdef VasEBoot_UTIL char *cheat; - grub_util_fd_t cheat_fd; + VasEBoot_util_fd_t cheat_fd; #endif const char *modname; int log_sector_size; - grub_cryptodisk_rekey_func_t rekey; + VasEBoot_cryptodisk_rekey_func_t rekey; int rekey_shift; - grub_uint8_t rekey_key[64]; - grub_uint64_t last_rekey; + VasEBoot_uint8_t rekey_key[64]; + VasEBoot_uint64_t last_rekey; int rekey_derived_size; - grub_disk_addr_t partition_start; + VasEBoot_disk_addr_t partition_start; }; -typedef struct grub_cryptodisk *grub_cryptodisk_t; +typedef struct VasEBoot_cryptodisk *VasEBoot_cryptodisk_t; -struct grub_cryptodisk_dev +struct VasEBoot_cryptodisk_dev { - struct grub_cryptodisk_dev *next; - struct grub_cryptodisk_dev **prev; + struct VasEBoot_cryptodisk_dev *next; + struct VasEBoot_cryptodisk_dev **prev; - grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid, + VasEBoot_cryptodisk_t (*scan) (VasEBoot_disk_t disk, const char *check_uuid, int boot_only); - grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev); + VasEBoot_err_t (*recover_key) (VasEBoot_disk_t disk, VasEBoot_cryptodisk_t dev); }; -typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t; +typedef struct VasEBoot_cryptodisk_dev *VasEBoot_cryptodisk_dev_t; -extern grub_cryptodisk_dev_t EXPORT_VAR (grub_cryptodisk_list); +extern VasEBoot_cryptodisk_dev_t EXPORT_VAR (VasEBoot_cryptodisk_list); -#ifndef GRUB_LST_GENERATOR +#ifndef VasEBoot_LST_GENERATOR static inline void -grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr) +VasEBoot_cryptodisk_dev_register (VasEBoot_cryptodisk_dev_t cr) { - grub_list_push (GRUB_AS_LIST_P (&grub_cryptodisk_list), GRUB_AS_LIST (cr)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_cryptodisk_list), VasEBoot_AS_LIST (cr)); } #endif static inline void -grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr) +VasEBoot_cryptodisk_dev_unregister (VasEBoot_cryptodisk_dev_t cr) { - grub_list_remove (GRUB_AS_LIST (cr)); + VasEBoot_list_remove (VasEBoot_AS_LIST (cr)); } -#define FOR_CRYPTODISK_DEVS(var) FOR_LIST_ELEMENTS((var), (grub_cryptodisk_list)) +#define FOR_CRYPTODISK_DEVS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_cryptodisk_list)) gcry_err_code_t -grub_cryptodisk_setkey (grub_cryptodisk_t dev, - grub_uint8_t *key, grub_size_t keysize); +VasEBoot_cryptodisk_setkey (VasEBoot_cryptodisk_t dev, + VasEBoot_uint8_t *key, VasEBoot_size_t keysize); gcry_err_code_t -grub_cryptodisk_decrypt (struct grub_cryptodisk *dev, - grub_uint8_t * data, grub_size_t len, - grub_disk_addr_t sector); -grub_err_t -grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name, - grub_disk_t source); -#ifdef GRUB_UTIL -grub_err_t -grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, - grub_disk_t source, const char *cheat); +VasEBoot_cryptodisk_decrypt (struct VasEBoot_cryptodisk *dev, + VasEBoot_uint8_t * data, VasEBoot_size_t len, + VasEBoot_disk_addr_t sector); +VasEBoot_err_t +VasEBoot_cryptodisk_insert (VasEBoot_cryptodisk_t newdev, const char *name, + VasEBoot_disk_t source); +#ifdef VasEBoot_UTIL +VasEBoot_err_t +VasEBoot_cryptodisk_cheat_insert (VasEBoot_cryptodisk_t newdev, const char *name, + VasEBoot_disk_t source, const char *cheat); void -grub_util_cryptodisk_get_abstraction (grub_disk_t disk, +VasEBoot_util_cryptodisk_get_abstraction (VasEBoot_disk_t disk, void (*cb) (const char *val, void *data), void *data); char * -grub_util_get_geli_uuid (const char *dev); +VasEBoot_util_get_geli_uuid (const char *dev); #endif -grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid); -grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk); +VasEBoot_cryptodisk_t VasEBoot_cryptodisk_get_by_uuid (const char *uuid); +VasEBoot_cryptodisk_t VasEBoot_cryptodisk_get_by_source_disk (VasEBoot_disk_t disk); #endif diff --git a/include/VasEBoot/cs5536.h b/include/VasEBoot/cs5536.h index 6b5b424c8..bf34c07ed 100644 --- a/include/VasEBoot/cs5536.h +++ b/include/VasEBoot/cs5536.h @@ -1,198 +1,198 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CS5536_HEADER -#define GRUB_CS5536_HEADER 1 +#ifndef VasEBoot_CS5536_HEADER +#define VasEBoot_CS5536_HEADER 1 #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include #endif -#define GRUB_CS5536_PCIID 0x208f1022 -#define GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED 0x1 -#define GRUB_CS5536_MSR_MAILBOX_CONFIG 0xf0 -#define GRUB_CS5536_MSR_MAILBOX_ADDR 0xf4 -#define GRUB_CS5536_MSR_MAILBOX_DATA0 0xf8 -#define GRUB_CS5536_MSR_MAILBOX_DATA1 0xfc -#define GRUB_CS5536_MSR_IRQ_MAP_BAR 0x80000008 -#define GRUB_CS5536_MSR_SMB_BAR 0x8000000b +#define VasEBoot_CS5536_PCIID 0x208f1022 +#define VasEBoot_CS5536_MSR_MAILBOX_CONFIG_ENABLED 0x1 +#define VasEBoot_CS5536_MSR_MAILBOX_CONFIG 0xf0 +#define VasEBoot_CS5536_MSR_MAILBOX_ADDR 0xf4 +#define VasEBoot_CS5536_MSR_MAILBOX_DATA0 0xf8 +#define VasEBoot_CS5536_MSR_MAILBOX_DATA1 0xfc +#define VasEBoot_CS5536_MSR_IRQ_MAP_BAR 0x80000008 +#define VasEBoot_CS5536_MSR_SMB_BAR 0x8000000b -#define GRUB_CS5536_SMBUS_REGS_SIZE 8 -#define GRUB_CS5536_GPIO_REGS_SIZE 256 -#define GRUB_CS5536_MFGPT_REGS_SIZE 64 -#define GRUB_CS5536_IRQ_MAP_REGS_SIZE 32 -#define GRUB_CS5536_PM_REGS_SIZE 128 -#define GRUB_CS5536_ACPI_REGS_SIZE 32 +#define VasEBoot_CS5536_SMBUS_REGS_SIZE 8 +#define VasEBoot_CS5536_GPIO_REGS_SIZE 256 +#define VasEBoot_CS5536_MFGPT_REGS_SIZE 64 +#define VasEBoot_CS5536_IRQ_MAP_REGS_SIZE 32 +#define VasEBoot_CS5536_PM_REGS_SIZE 128 +#define VasEBoot_CS5536_ACPI_REGS_SIZE 32 -#define GRUB_CS5536_USB_OPTION_REGS_SIZE 0x1c -#define GRUB_CS5536_USB_OPTION_REG_UOCMUX 1 -#define GRUB_CS5536_USB_OPTION_REG_UOCMUX_PMUX_MASK 0x03 -#define GRUB_CS5536_USB_OPTION_REG_UOCMUX_PMUX_HC 0x02 +#define VasEBoot_CS5536_USB_OPTION_REGS_SIZE 0x1c +#define VasEBoot_CS5536_USB_OPTION_REG_UOCMUX 1 +#define VasEBoot_CS5536_USB_OPTION_REG_UOCMUX_PMUX_MASK 0x03 +#define VasEBoot_CS5536_USB_OPTION_REG_UOCMUX_PMUX_HC 0x02 -#define GRUB_CS5536_DESTINATION_GLIU 0 -#define GRUB_CS5536_DESTINATION_GLPCI_SB 1 -#define GRUB_CS5536_DESTINATION_USB 2 -#define GRUB_CS5536_DESTINATION_IDE 3 -#define GRUB_CS5536_DESTINATION_DD 4 -#define GRUB_CS5536_DESTINATION_ACC 5 -#define GRUB_CS5536_DESTINATION_GLCP 7 +#define VasEBoot_CS5536_DESTINATION_GLIU 0 +#define VasEBoot_CS5536_DESTINATION_GLPCI_SB 1 +#define VasEBoot_CS5536_DESTINATION_USB 2 +#define VasEBoot_CS5536_DESTINATION_IDE 3 +#define VasEBoot_CS5536_DESTINATION_DD 4 +#define VasEBoot_CS5536_DESTINATION_ACC 5 +#define VasEBoot_CS5536_DESTINATION_GLCP 7 -#define GRUB_CS5536_P2D_DEST_SHIFT 61 -#define GRUB_CS5536_P2D_LOG_ALIGN 12 -#define GRUB_CS5536_P2D_ALIGN (1 << GRUB_CS5536_P2D_LOG_ALIGN) -#define GRUB_CS5536_P2D_BASE_SHIFT 20 -#define GRUB_CS5536_P2D_MASK_SHIFT 0 +#define VasEBoot_CS5536_P2D_DEST_SHIFT 61 +#define VasEBoot_CS5536_P2D_LOG_ALIGN 12 +#define VasEBoot_CS5536_P2D_ALIGN (1 << VasEBoot_CS5536_P2D_LOG_ALIGN) +#define VasEBoot_CS5536_P2D_BASE_SHIFT 20 +#define VasEBoot_CS5536_P2D_MASK_SHIFT 0 -#define GRUB_CS5536_MSR_GL_IOD_START 0x000100e0 -#define GRUB_CS5536_IOD_DEST_SHIFT 61 -#define GRUB_CS5536_IOD_BASE_SHIFT 20 -#define GRUB_CS5536_IOD_MASK_SHIFT 0 -#define GRUB_CS5536_IOD_ADDR_MASK 0xfffff +#define VasEBoot_CS5536_MSR_GL_IOD_START 0x000100e0 +#define VasEBoot_CS5536_IOD_DEST_SHIFT 61 +#define VasEBoot_CS5536_IOD_BASE_SHIFT 20 +#define VasEBoot_CS5536_IOD_MASK_SHIFT 0 +#define VasEBoot_CS5536_IOD_ADDR_MASK 0xfffff -#define GRUB_CS5536_MSR_GPIO_BAR 0x8000000c -#define GRUB_CS5536_MSR_MFGPT_BAR 0x8000000d -#define GRUB_CS5536_MSR_ACPI_BAR 0x8000000e -#define GRUB_CS5536_MSR_PM_BAR 0x8000000f -#define GRUB_CS5536_MSR_DIVIL_LEG_IO 0x80000014 -#define GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 0x00000001 -#define GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1 0x00000002 -#define GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 0x10000000 -#define GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP 0x04000000 -#define GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 0x00070000 -#define GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 0x00500000 -#define GRUB_CS5536_MSR_DIVIL_RESET 0x80000017 -#define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK 0x80000024 -#define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK 0x80000025 -#define GRUB_CS5536_DIVIL_LPC_INTERRUPTS 0x1002 -#define GRUB_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL 0x8000004e -#define GRUB_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL_ENABLE 0x80 -#define GRUB_CS5536_MSR_DIVIL_UART1_CONF 0x8000003a -#define GRUB_CS5536_MSR_DIVIL_UART2_CONF 0x8000003e +#define VasEBoot_CS5536_MSR_GPIO_BAR 0x8000000c +#define VasEBoot_CS5536_MSR_MFGPT_BAR 0x8000000d +#define VasEBoot_CS5536_MSR_ACPI_BAR 0x8000000e +#define VasEBoot_CS5536_MSR_PM_BAR 0x8000000f +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO 0x80000014 +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 0x00000001 +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1 0x00000002 +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 0x10000000 +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO_F_REMAP 0x04000000 +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 0x00070000 +#define VasEBoot_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 0x00500000 +#define VasEBoot_CS5536_MSR_DIVIL_RESET 0x80000017 +#define VasEBoot_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK 0x80000024 +#define VasEBoot_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK 0x80000025 +#define VasEBoot_CS5536_DIVIL_LPC_INTERRUPTS 0x1002 +#define VasEBoot_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL 0x8000004e +#define VasEBoot_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL_ENABLE 0x80 +#define VasEBoot_CS5536_MSR_DIVIL_UART1_CONF 0x8000003a +#define VasEBoot_CS5536_MSR_DIVIL_UART2_CONF 0x8000003e -#define GRUB_CS5536_MSR_USB_OHCI_BASE 0x40000008 -#define GRUB_CS5536_MSR_USB_EHCI_BASE 0x40000009 -#define GRUB_CS5536_MSR_USB_CONTROLLER_BASE 0x4000000a -#define GRUB_CS5536_MSR_USB_OPTION_CONTROLLER_BASE 0x4000000b -#define GRUB_CS5536_MSR_USB_BASE_ADDR_MASK 0x00ffffff00ULL -#define GRUB_CS5536_MSR_USB_BASE_SMI_ENABLE 0x3f000000000000ULL -#define GRUB_CS5536_MSR_USB_BASE_BUS_MASTER 0x0400000000ULL -#define GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE 0x0200000000ULL -#define GRUB_CS5536_MSR_USB_BASE_PME_ENABLED 0x0800000000ULL -#define GRUB_CS5536_MSR_USB_BASE_PME_STATUS 0x1000000000ULL -#define GRUB_CS5536_MSR_USB_EHCI_BASE_FLDJ_SHIFT 40 +#define VasEBoot_CS5536_MSR_USB_OHCI_BASE 0x40000008 +#define VasEBoot_CS5536_MSR_USB_EHCI_BASE 0x40000009 +#define VasEBoot_CS5536_MSR_USB_CONTROLLER_BASE 0x4000000a +#define VasEBoot_CS5536_MSR_USB_OPTION_CONTROLLER_BASE 0x4000000b +#define VasEBoot_CS5536_MSR_USB_BASE_ADDR_MASK 0x00ffffff00ULL +#define VasEBoot_CS5536_MSR_USB_BASE_SMI_ENABLE 0x3f000000000000ULL +#define VasEBoot_CS5536_MSR_USB_BASE_BUS_MASTER 0x0400000000ULL +#define VasEBoot_CS5536_MSR_USB_BASE_MEMORY_ENABLE 0x0200000000ULL +#define VasEBoot_CS5536_MSR_USB_BASE_PME_ENABLED 0x0800000000ULL +#define VasEBoot_CS5536_MSR_USB_BASE_PME_STATUS 0x1000000000ULL +#define VasEBoot_CS5536_MSR_USB_EHCI_BASE_FLDJ_SHIFT 40 -#define GRUB_CS5536_MSR_IDE_IO_BAR 0x60000008 -#define GRUB_CS5536_MSR_IDE_IO_BAR_UNITS 1 -#define GRUB_CS5536_MSR_IDE_IO_BAR_ADDR_MASK 0xfffffff0 -#define GRUB_CS5536_MSR_IDE_CFG 0x60000010 -#define GRUB_CS5536_MSR_IDE_CFG_CHANNEL_ENABLE 2 -#define GRUB_CS5536_MSR_IDE_TIMING 0x60000012 -#define GRUB_CS5536_MSR_IDE_TIMING_PIO0 0x98 -#define GRUB_CS5536_MSR_IDE_TIMING_DRIVE0_SHIFT 24 -#define GRUB_CS5536_MSR_IDE_TIMING_DRIVE1_SHIFT 16 -#define GRUB_CS5536_MSR_IDE_CAS_TIMING 0x60000013 -#define GRUB_CS5536_MSR_IDE_CAS_TIMING_CMD_PIO0 0x99 -#define GRUB_CS5536_MSR_IDE_CAS_TIMING_CMD_SHIFT 24 -#define GRUB_CS5536_MSR_IDE_CAS_TIMING_DRIVE0_SHIFT 6 -#define GRUB_CS5536_MSR_IDE_CAS_TIMING_DRIVE1_SHIFT 4 -#define GRUB_CS5536_MSR_IDE_CAS_TIMING_PIO0 2 +#define VasEBoot_CS5536_MSR_IDE_IO_BAR 0x60000008 +#define VasEBoot_CS5536_MSR_IDE_IO_BAR_UNITS 1 +#define VasEBoot_CS5536_MSR_IDE_IO_BAR_ADDR_MASK 0xfffffff0 +#define VasEBoot_CS5536_MSR_IDE_CFG 0x60000010 +#define VasEBoot_CS5536_MSR_IDE_CFG_CHANNEL_ENABLE 2 +#define VasEBoot_CS5536_MSR_IDE_TIMING 0x60000012 +#define VasEBoot_CS5536_MSR_IDE_TIMING_PIO0 0x98 +#define VasEBoot_CS5536_MSR_IDE_TIMING_DRIVE0_SHIFT 24 +#define VasEBoot_CS5536_MSR_IDE_TIMING_DRIVE1_SHIFT 16 +#define VasEBoot_CS5536_MSR_IDE_CAS_TIMING 0x60000013 +#define VasEBoot_CS5536_MSR_IDE_CAS_TIMING_CMD_PIO0 0x99 +#define VasEBoot_CS5536_MSR_IDE_CAS_TIMING_CMD_SHIFT 24 +#define VasEBoot_CS5536_MSR_IDE_CAS_TIMING_DRIVE0_SHIFT 6 +#define VasEBoot_CS5536_MSR_IDE_CAS_TIMING_DRIVE1_SHIFT 4 +#define VasEBoot_CS5536_MSR_IDE_CAS_TIMING_PIO0 2 -#define GRUB_CS5536_MSR_GL_PCI_CTRL 0x00000010 -#define GRUB_CS5536_MSR_GL_PCI_CTRL_MEMORY_ENABLE 1 -#define GRUB_CS5536_MSR_GL_PCI_CTRL_IO_ENABLE 2 -#define GRUB_CS5536_MSR_GL_PCI_CTRL_LATENCY_SHIFT 35 -#define GRUB_CS5536_MSR_GL_PCI_CTRL_OUT_THR_SHIFT 60 -#define GRUB_CS5536_MSR_GL_PCI_CTRL_IN_THR_SHIFT 56 +#define VasEBoot_CS5536_MSR_GL_PCI_CTRL 0x00000010 +#define VasEBoot_CS5536_MSR_GL_PCI_CTRL_MEMORY_ENABLE 1 +#define VasEBoot_CS5536_MSR_GL_PCI_CTRL_IO_ENABLE 2 +#define VasEBoot_CS5536_MSR_GL_PCI_CTRL_LATENCY_SHIFT 35 +#define VasEBoot_CS5536_MSR_GL_PCI_CTRL_OUT_THR_SHIFT 60 +#define VasEBoot_CS5536_MSR_GL_PCI_CTRL_IN_THR_SHIFT 56 -#define GRUB_CS5536_MSR_GL_REGIONS_START 0x00000020 -#define GRUB_CS5536_MSR_GL_REGIONS_NUM 16 -#define GRUB_CS5536_MSR_GL_REGION_ENABLE 1 -#define GRUB_CS5536_MSR_GL_REGION_IO 0x100000000ULL -#define GRUB_CS5536_MSR_GL_REGION_BASE_MASK 0xfffff000ULL -#define GRUB_CS5536_MSR_GL_REGION_IO_BASE_SHIFT 12 -#define GRUB_CS5536_MSR_GL_REGION_TOP_MASK 0xfffff00000000000ULL -#define GRUB_CS5536_MSR_GL_REGION_IO_TOP_SHIFT 44 +#define VasEBoot_CS5536_MSR_GL_REGIONS_START 0x00000020 +#define VasEBoot_CS5536_MSR_GL_REGIONS_NUM 16 +#define VasEBoot_CS5536_MSR_GL_REGION_ENABLE 1 +#define VasEBoot_CS5536_MSR_GL_REGION_IO 0x100000000ULL +#define VasEBoot_CS5536_MSR_GL_REGION_BASE_MASK 0xfffff000ULL +#define VasEBoot_CS5536_MSR_GL_REGION_IO_BASE_SHIFT 12 +#define VasEBoot_CS5536_MSR_GL_REGION_TOP_MASK 0xfffff00000000000ULL +#define VasEBoot_CS5536_MSR_GL_REGION_IO_TOP_SHIFT 44 -#define GRUB_CS5536_MSR_GL_P2D_START 0x00010020 +#define VasEBoot_CS5536_MSR_GL_P2D_START 0x00010020 -#define GRUB_CS5536_SMB_REG_DATA 0x0 -#define GRUB_CS5536_SMB_REG_STATUS 0x1 -#define GRUB_CS5536_SMB_REG_STATUS_SDAST (1 << 6) -#define GRUB_CS5536_SMB_REG_STATUS_BER (1 << 5) -#define GRUB_CS5536_SMB_REG_STATUS_NACK (1 << 4) -#define GRUB_CS5536_SMB_REG_CTRL1 0x3 -#define GRUB_CS5536_SMB_REG_CTRL1_START 0x01 -#define GRUB_CS5536_SMB_REG_CTRL1_STOP 0x02 -#define GRUB_CS5536_SMB_REG_CTRL1_ACK 0x10 -#define GRUB_CS5536_SMB_REG_ADDR 0x4 -#define GRUB_CS5536_SMB_REG_ADDR_MASTER 0x0 -#define GRUB_CS5536_SMB_REG_CTRL2 0x5 -#define GRUB_CS5536_SMB_REG_CTRL2_ENABLE 0x1 -#define GRUB_CS5536_SMB_REG_CTRL3 0x6 +#define VasEBoot_CS5536_SMB_REG_DATA 0x0 +#define VasEBoot_CS5536_SMB_REG_STATUS 0x1 +#define VasEBoot_CS5536_SMB_REG_STATUS_SDAST (1 << 6) +#define VasEBoot_CS5536_SMB_REG_STATUS_BER (1 << 5) +#define VasEBoot_CS5536_SMB_REG_STATUS_NACK (1 << 4) +#define VasEBoot_CS5536_SMB_REG_CTRL1 0x3 +#define VasEBoot_CS5536_SMB_REG_CTRL1_START 0x01 +#define VasEBoot_CS5536_SMB_REG_CTRL1_STOP 0x02 +#define VasEBoot_CS5536_SMB_REG_CTRL1_ACK 0x10 +#define VasEBoot_CS5536_SMB_REG_ADDR 0x4 +#define VasEBoot_CS5536_SMB_REG_ADDR_MASTER 0x0 +#define VasEBoot_CS5536_SMB_REG_CTRL2 0x5 +#define VasEBoot_CS5536_SMB_REG_CTRL2_ENABLE 0x1 +#define VasEBoot_CS5536_SMB_REG_CTRL3 0x6 #ifdef ASM_FILE -#define GRUB_ULL(x) x +#define VasEBoot_ULL(x) x #else -#define GRUB_ULL(x) x ## ULL +#define VasEBoot_ULL(x) x ## ULL #endif -#define GRUB_CS5536_LBAR_ADDR_MASK GRUB_ULL (0x000000000000fff8) -#define GRUB_CS5536_LBAR_ENABLE GRUB_ULL (0x0000000100000000) -#define GRUB_CS5536_LBAR_MASK_MASK GRUB_ULL (0x0000f00000000000) -#define GRUB_CS5536_LBAR_TURN_ON (GRUB_CS5536_LBAR_ENABLE | GRUB_CS5536_LBAR_MASK_MASK) +#define VasEBoot_CS5536_LBAR_ADDR_MASK VasEBoot_ULL (0x000000000000fff8) +#define VasEBoot_CS5536_LBAR_ENABLE VasEBoot_ULL (0x0000000100000000) +#define VasEBoot_CS5536_LBAR_MASK_MASK VasEBoot_ULL (0x0000f00000000000) +#define VasEBoot_CS5536_LBAR_TURN_ON (VasEBoot_CS5536_LBAR_ENABLE | VasEBoot_CS5536_LBAR_MASK_MASK) /* PMON-compatible LBARs. */ -#define GRUB_CS5536_LBAR_GPIO 0xb000 -#define GRUB_CS5536_LBAR_ACC 0xb200 -#define GRUB_CS5536_LBAR_PM 0xb280 -#define GRUB_CS5536_LBAR_MFGPT 0xb300 -#define GRUB_CS5536_LBAR_ACPI 0xb340 -#define GRUB_CS5536_LBAR_IRQ_MAP 0xb360 -#define GRUB_CS5536_LBAR_IDE 0xb380 -#define GRUB_CS5536_LBAR_SMBUS 0xb390 +#define VasEBoot_CS5536_LBAR_GPIO 0xb000 +#define VasEBoot_CS5536_LBAR_ACC 0xb200 +#define VasEBoot_CS5536_LBAR_PM 0xb280 +#define VasEBoot_CS5536_LBAR_MFGPT 0xb300 +#define VasEBoot_CS5536_LBAR_ACPI 0xb340 +#define VasEBoot_CS5536_LBAR_IRQ_MAP 0xb360 +#define VasEBoot_CS5536_LBAR_IDE 0xb380 +#define VasEBoot_CS5536_LBAR_SMBUS 0xb390 -#define GRUB_GPIO_SMBUS_PINS ((1 << 14) | (1 << 15)) -#define GRUB_GPIO_REG_OUT_EN 0x4 -#define GRUB_GPIO_REG_OUT_AUX1 0x10 -#define GRUB_GPIO_REG_IN_EN 0x20 -#define GRUB_GPIO_REG_IN_AUX1 0x34 +#define VasEBoot_GPIO_SMBUS_PINS ((1 << 14) | (1 << 15)) +#define VasEBoot_GPIO_REG_OUT_EN 0x4 +#define VasEBoot_GPIO_REG_OUT_AUX1 0x10 +#define VasEBoot_GPIO_REG_IN_EN 0x20 +#define VasEBoot_GPIO_REG_IN_AUX1 0x34 #ifndef ASM_FILE -int EXPORT_FUNC (grub_cs5536_find) (grub_pci_device_t *devp); +int EXPORT_FUNC (VasEBoot_cs5536_find) (VasEBoot_pci_device_t *devp); -grub_uint64_t EXPORT_FUNC (grub_cs5536_read_msr) (grub_pci_device_t dev, - grub_uint32_t addr); -void EXPORT_FUNC (grub_cs5536_write_msr) (grub_pci_device_t dev, - grub_uint32_t addr, - grub_uint64_t val); -grub_err_t grub_cs5536_read_spd_byte (grub_port_t smbbase, grub_uint8_t dev, - grub_uint8_t addr, grub_uint8_t *res); -grub_err_t EXPORT_FUNC (grub_cs5536_read_spd) (grub_port_t smbbase, - grub_uint8_t dev, - struct grub_smbus_spd *res); -grub_err_t grub_cs5536_smbus_wait (grub_port_t smbbase); -grub_err_t EXPORT_FUNC (grub_cs5536_init_smbus) (grub_pci_device_t dev, - grub_uint16_t divisor, - grub_port_t *smbbase); +VasEBoot_uint64_t EXPORT_FUNC (VasEBoot_cs5536_read_msr) (VasEBoot_pci_device_t dev, + VasEBoot_uint32_t addr); +void EXPORT_FUNC (VasEBoot_cs5536_write_msr) (VasEBoot_pci_device_t dev, + VasEBoot_uint32_t addr, + VasEBoot_uint64_t val); +VasEBoot_err_t VasEBoot_cs5536_read_spd_byte (VasEBoot_port_t smbbase, VasEBoot_uint8_t dev, + VasEBoot_uint8_t addr, VasEBoot_uint8_t *res); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_cs5536_read_spd) (VasEBoot_port_t smbbase, + VasEBoot_uint8_t dev, + struct VasEBoot_smbus_spd *res); +VasEBoot_err_t VasEBoot_cs5536_smbus_wait (VasEBoot_port_t smbbase); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_cs5536_init_smbus) (VasEBoot_pci_device_t dev, + VasEBoot_uint16_t divisor, + VasEBoot_port_t *smbbase); -void grub_cs5536_init_geode (grub_pci_device_t dev); +void VasEBoot_cs5536_init_geode (VasEBoot_pci_device_t dev); #endif #endif diff --git a/include/VasEBoot/datetime.h b/include/VasEBoot/datetime.h index fef281404..a3ad9aeae 100644 --- a/include/VasEBoot/datetime.h +++ b/include/VasEBoot/datetime.h @@ -1,62 +1,62 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_DATETIME_HEADER #define KERNEL_DATETIME_HEADER 1 -#include -#include +#include +#include -struct grub_datetime +struct VasEBoot_datetime { - grub_uint16_t year; - grub_uint8_t month; - grub_uint8_t day; - grub_uint8_t hour; - grub_uint8_t minute; - grub_uint8_t second; + VasEBoot_uint16_t year; + VasEBoot_uint8_t month; + VasEBoot_uint8_t day; + VasEBoot_uint8_t hour; + VasEBoot_uint8_t minute; + VasEBoot_uint8_t second; }; /* Return date and time. */ -#ifdef GRUB_MACHINE_EMU -grub_err_t EXPORT_FUNC(grub_get_datetime) (struct grub_datetime *datetime); +#ifdef VasEBoot_MACHINE_EMU +VasEBoot_err_t EXPORT_FUNC(VasEBoot_get_datetime) (struct VasEBoot_datetime *datetime); /* Set date and time. */ -grub_err_t EXPORT_FUNC(grub_set_datetime) (struct grub_datetime *datetime); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_set_datetime) (struct VasEBoot_datetime *datetime); #else -grub_err_t grub_get_datetime (struct grub_datetime *datetime); +VasEBoot_err_t VasEBoot_get_datetime (struct VasEBoot_datetime *datetime); /* Set date and time. */ -grub_err_t grub_set_datetime (struct grub_datetime *datetime); +VasEBoot_err_t VasEBoot_set_datetime (struct VasEBoot_datetime *datetime); #endif -int grub_get_weekday (struct grub_datetime *datetime); -const char *grub_get_weekday_name (struct grub_datetime *datetime); +int VasEBoot_get_weekday (struct VasEBoot_datetime *datetime); +const char *VasEBoot_get_weekday_name (struct VasEBoot_datetime *datetime); -void grub_unixtime2datetime (grub_int32_t nix, - struct grub_datetime *datetime); +void VasEBoot_unixtime2datetime (VasEBoot_int32_t nix, + struct VasEBoot_datetime *datetime); static inline int -grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int32_t *nix) +VasEBoot_datetime2unixtime (const struct VasEBoot_datetime *datetime, VasEBoot_int32_t *nix) { - grub_int32_t ret; + VasEBoot_int32_t ret; int y4, ay; - const grub_uint16_t monthssum[12] + const VasEBoot_uint16_t monthssum[12] = { 0, 31, 31 + 28, @@ -69,7 +69,7 @@ grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int32_t *nix) 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30}; - const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, + const VasEBoot_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; const int SECPERMIN = 60; const int SECPERHOUR = 60 * SECPERMIN; @@ -123,11 +123,11 @@ grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int32_t *nix) return 1; } -#if (defined (__powerpc__) || defined (__sparc__)) && !defined (GRUB_UTIL) -grub_err_t -grub_get_datetime_cmos (struct grub_datetime *datetime); -grub_err_t -grub_set_datetime_cmos (struct grub_datetime *datetime); +#if (defined (__powerpc__) || defined (__sparc__)) && !defined (VasEBoot_UTIL) +VasEBoot_err_t +VasEBoot_get_datetime_cmos (struct VasEBoot_datetime *datetime); +VasEBoot_err_t +VasEBoot_set_datetime_cmos (struct VasEBoot_datetime *datetime); #endif #endif /* ! KERNEL_DATETIME_HEADER */ diff --git a/include/VasEBoot/decompressor.h b/include/VasEBoot/decompressor.h index a6eefb01b..cfaef11bc 100644 --- a/include/VasEBoot/decompressor.h +++ b/include/VasEBoot/decompressor.h @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_DECOMPRESSOR_HEADER -#define GRUB_DECOMPRESSOR_HEADER 1 +#ifndef VasEBoot_DECOMPRESSOR_HEADER +#define VasEBoot_DECOMPRESSOR_HEADER 1 void -grub_decompress_core (void *src, void *dst, unsigned long srcsize, +VasEBoot_decompress_core (void *src, void *dst, unsigned long srcsize, unsigned long dstsize); void find_scratch (void *src, void *dst, unsigned long srcsize, unsigned long dstsize); -#define GRUB_DECOMPRESSOR_DICT_SIZE (1 << 16) +#define VasEBoot_DECOMPRESSOR_DICT_SIZE (1 << 16) -extern void *grub_decompressor_scratch; +extern void *VasEBoot_decompressor_scratch; #endif diff --git a/include/VasEBoot/deflate.h b/include/VasEBoot/deflate.h index c87c62f6c..70d1dea94 100644 --- a/include/VasEBoot/deflate.h +++ b/include/VasEBoot/deflate.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_DEFLATE_HEADER -#define GRUB_DEFLATE_HEADER 1 +#ifndef VasEBoot_DEFLATE_HEADER +#define VasEBoot_DEFLATE_HEADER 1 -grub_ssize_t -grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t outsize); +VasEBoot_ssize_t +VasEBoot_zlib_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t outsize); -grub_ssize_t -grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off, - char *outbuf, grub_size_t outsize); +VasEBoot_ssize_t +VasEBoot_deflate_decompress (char *inbuf, VasEBoot_size_t insize, VasEBoot_off_t off, + char *outbuf, VasEBoot_size_t outsize); #endif diff --git a/include/VasEBoot/device.h b/include/VasEBoot/device.h index 1d1a23900..037b22bc7 100644 --- a/include/VasEBoot/device.h +++ b/include/VasEBoot/device.h @@ -1,43 +1,43 @@ /* device.h - device manager */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_DEVICE_HEADER -#define GRUB_DEVICE_HEADER 1 +#ifndef VasEBoot_DEVICE_HEADER +#define VasEBoot_DEVICE_HEADER 1 -#include -#include +#include +#include -struct grub_disk; -struct grub_net; +struct VasEBoot_disk; +struct VasEBoot_net; -struct grub_device +struct VasEBoot_device { - struct grub_disk *disk; - struct grub_net *net; + struct VasEBoot_disk *disk; + struct VasEBoot_net *net; }; -typedef struct grub_device *grub_device_t; +typedef struct VasEBoot_device *VasEBoot_device_t; -typedef int (*grub_device_iterate_hook_t) (const char *name, void *data); +typedef int (*VasEBoot_device_iterate_hook_t) (const char *name, void *data); -grub_device_t EXPORT_FUNC(grub_device_open) (const char *name); -grub_err_t EXPORT_FUNC(grub_device_close) (grub_device_t device); -int EXPORT_FUNC(grub_device_iterate) (grub_device_iterate_hook_t hook, +VasEBoot_device_t EXPORT_FUNC(VasEBoot_device_open) (const char *name); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_device_close) (VasEBoot_device_t device); +int EXPORT_FUNC(VasEBoot_device_iterate) (VasEBoot_device_iterate_hook_t hook, void *hook_data); -#endif /* ! GRUB_DEVICE_HEADER */ +#endif /* ! VasEBoot_DEVICE_HEADER */ diff --git a/include/VasEBoot/disk.h b/include/VasEBoot/disk.h index b385af826..b18db0a59 100644 --- a/include/VasEBoot/disk.h +++ b/include/VasEBoot/disk.h @@ -1,143 +1,143 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_DISK_HEADER -#define GRUB_DISK_HEADER 1 +#ifndef VasEBoot_DISK_HEADER +#define VasEBoot_DISK_HEADER 1 #include -#include -#include -#include -#include +#include +#include +#include +#include /* For NULL. */ -#include +#include /* These are used to set a device id. When you add a new disk device, you must define a new id for it here. */ -enum grub_disk_dev_id +enum VasEBoot_disk_dev_id { - GRUB_DISK_DEVICE_BIOSDISK_ID, - GRUB_DISK_DEVICE_OFDISK_ID, - GRUB_DISK_DEVICE_LOOPBACK_ID, - GRUB_DISK_DEVICE_EFIDISK_ID, - GRUB_DISK_DEVICE_DISKFILTER_ID, - GRUB_DISK_DEVICE_HOST_ID, - GRUB_DISK_DEVICE_ATA_ID, - GRUB_DISK_DEVICE_MEMDISK_ID, - GRUB_DISK_DEVICE_NAND_ID, - GRUB_DISK_DEVICE_SCSI_ID, - GRUB_DISK_DEVICE_CRYPTODISK_ID, - GRUB_DISK_DEVICE_ARCDISK_ID, - GRUB_DISK_DEVICE_HOSTDISK_ID, - GRUB_DISK_DEVICE_PROCFS_ID, - GRUB_DISK_DEVICE_CBFSDISK_ID, - GRUB_DISK_DEVICE_UBOOTDISK_ID, - GRUB_DISK_DEVICE_XEN, + VasEBoot_DISK_DEVICE_BIOSDISK_ID, + VasEBoot_DISK_DEVICE_OFDISK_ID, + VasEBoot_DISK_DEVICE_LOOPBACK_ID, + VasEBoot_DISK_DEVICE_EFIDISK_ID, + VasEBoot_DISK_DEVICE_DISKFILTER_ID, + VasEBoot_DISK_DEVICE_HOST_ID, + VasEBoot_DISK_DEVICE_ATA_ID, + VasEBoot_DISK_DEVICE_MEMDISK_ID, + VasEBoot_DISK_DEVICE_NAND_ID, + VasEBoot_DISK_DEVICE_SCSI_ID, + VasEBoot_DISK_DEVICE_CRYPTODISK_ID, + VasEBoot_DISK_DEVICE_ARCDISK_ID, + VasEBoot_DISK_DEVICE_HOSTDISK_ID, + VasEBoot_DISK_DEVICE_PROCFS_ID, + VasEBoot_DISK_DEVICE_CBFSDISK_ID, + VasEBoot_DISK_DEVICE_UBOOTDISK_ID, + VasEBoot_DISK_DEVICE_XEN, }; -struct grub_disk; -#ifdef GRUB_UTIL -struct grub_disk_memberlist; +struct VasEBoot_disk; +#ifdef VasEBoot_UTIL +struct VasEBoot_disk_memberlist; #endif typedef enum { - GRUB_DISK_PULL_NONE, - GRUB_DISK_PULL_REMOVABLE, - GRUB_DISK_PULL_RESCAN, - GRUB_DISK_PULL_MAX - } grub_disk_pull_t; + VasEBoot_DISK_PULL_NONE, + VasEBoot_DISK_PULL_REMOVABLE, + VasEBoot_DISK_PULL_RESCAN, + VasEBoot_DISK_PULL_MAX + } VasEBoot_disk_pull_t; -typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data); +typedef int (*VasEBoot_disk_dev_iterate_hook_t) (const char *name, void *data); /* Disk device. */ -struct grub_disk_dev +struct VasEBoot_disk_dev { /* The device name. */ const char *name; /* The device id used by the cache manager. */ - enum grub_disk_dev_id id; + enum VasEBoot_disk_dev_id id; /* Call HOOK with each device name, until HOOK returns non-zero. */ - int (*iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull); + int (*iterate) (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull); /* Open the device named NAME, and set up DISK. */ - grub_err_t (*open) (const char *name, struct grub_disk *disk); + VasEBoot_err_t (*open) (const char *name, struct VasEBoot_disk *disk); /* Close the disk DISK. */ - void (*close) (struct grub_disk *disk); + void (*close) (struct VasEBoot_disk *disk); /* Read SIZE sectors from the sector SECTOR of the disk DISK into BUF. */ - grub_err_t (*read) (struct grub_disk *disk, grub_disk_addr_t sector, - grub_size_t size, char *buf); + VasEBoot_err_t (*read) (struct VasEBoot_disk *disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf); /* Write SIZE sectors from BUF into the sector SECTOR of the disk DISK. */ - grub_err_t (*write) (struct grub_disk *disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf); + VasEBoot_err_t (*write) (struct VasEBoot_disk *disk, VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, const char *buf); -#ifdef GRUB_UTIL - struct grub_disk_memberlist *(*memberlist) (struct grub_disk *disk); - const char * (*raidname) (struct grub_disk *disk); +#ifdef VasEBoot_UTIL + struct VasEBoot_disk_memberlist *(*memberlist) (struct VasEBoot_disk *disk); + const char * (*raidname) (struct VasEBoot_disk *disk); #endif /* The next disk device. */ - struct grub_disk_dev *next; + struct VasEBoot_disk_dev *next; }; -typedef struct grub_disk_dev *grub_disk_dev_t; +typedef struct VasEBoot_disk_dev *VasEBoot_disk_dev_t; -extern grub_disk_dev_t EXPORT_VAR (grub_disk_dev_list); +extern VasEBoot_disk_dev_t EXPORT_VAR (VasEBoot_disk_dev_list); -struct grub_partition; +struct VasEBoot_partition; -typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector, +typedef void (*VasEBoot_disk_read_hook_t) (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data); /* Disk. */ -struct grub_disk +struct VasEBoot_disk { /* The disk name. */ const char *name; /* The underlying disk device. */ - grub_disk_dev_t dev; + VasEBoot_disk_dev_t dev; /* The total number of sectors. */ - grub_uint64_t total_sectors; + VasEBoot_uint64_t total_sectors; /* Logarithm of sector size. */ unsigned int log_sector_size; - /* Maximum number of sectors read divided by GRUB_DISK_CACHE_SIZE. */ + /* Maximum number of sectors read divided by VasEBoot_DISK_CACHE_SIZE. */ unsigned int max_agglomerate; /* The id used by the disk cache manager. */ unsigned long id; /* The partition information. This is machine-specific. */ - struct grub_partition *partition; + struct VasEBoot_partition *partition; /* Called when a sector was read. OFFSET is between 0 and the sector size minus 1, and LENGTH is between 0 and the sector size. */ - grub_disk_read_hook_t read_hook; + VasEBoot_disk_read_hook_t read_hook; /* Caller-specific data passed to the read hook. */ void *read_hook_data; @@ -145,117 +145,117 @@ struct grub_disk /* Device-specific data. */ void *data; }; -typedef struct grub_disk *grub_disk_t; +typedef struct VasEBoot_disk *VasEBoot_disk_t; -#ifdef GRUB_UTIL -struct grub_disk_memberlist +#ifdef VasEBoot_UTIL +struct VasEBoot_disk_memberlist { - grub_disk_t disk; - struct grub_disk_memberlist *next; + VasEBoot_disk_t disk; + struct VasEBoot_disk_memberlist *next; }; -typedef struct grub_disk_memberlist *grub_disk_memberlist_t; +typedef struct VasEBoot_disk_memberlist *VasEBoot_disk_memberlist_t; #endif /* The sector size. */ -#define GRUB_DISK_SECTOR_SIZE 0x200 -#define GRUB_DISK_SECTOR_BITS 9 +#define VasEBoot_DISK_SECTOR_SIZE 0x200 +#define VasEBoot_DISK_SECTOR_BITS 9 /* The maximum number of disk caches. */ -#define GRUB_DISK_CACHE_NUM 1021 +#define VasEBoot_DISK_CACHE_NUM 1021 /* The size of a disk cache in 512B units. Must be at least as big as the largest supported sector size, currently 16K. */ -#define GRUB_DISK_CACHE_BITS 6 -#define GRUB_DISK_CACHE_SIZE (1 << GRUB_DISK_CACHE_BITS) +#define VasEBoot_DISK_CACHE_BITS 6 +#define VasEBoot_DISK_CACHE_SIZE (1 << VasEBoot_DISK_CACHE_BITS) -#define GRUB_DISK_MAX_MAX_AGGLOMERATE ((1 << (30 - GRUB_DISK_CACHE_BITS - GRUB_DISK_SECTOR_BITS)) - 1) +#define VasEBoot_DISK_MAX_MAX_AGGLOMERATE ((1 << (30 - VasEBoot_DISK_CACHE_BITS - VasEBoot_DISK_SECTOR_BITS)) - 1) -/* Return value of grub_disk_get_size() in case disk size is unknown. */ -#define GRUB_DISK_SIZE_UNKNOWN 0xffffffffffffffffULL +/* Return value of VasEBoot_disk_get_size() in case disk size is unknown. */ +#define VasEBoot_DISK_SIZE_UNKNOWN 0xffffffffffffffffULL /* This is called from the memory manager. */ -void grub_disk_cache_invalidate_all (void); +void VasEBoot_disk_cache_invalidate_all (void); -void EXPORT_FUNC(grub_disk_dev_register) (grub_disk_dev_t dev); -void EXPORT_FUNC(grub_disk_dev_unregister) (grub_disk_dev_t dev); +void EXPORT_FUNC(VasEBoot_disk_dev_register) (VasEBoot_disk_dev_t dev); +void EXPORT_FUNC(VasEBoot_disk_dev_unregister) (VasEBoot_disk_dev_t dev); static inline int -grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data) +VasEBoot_disk_dev_iterate (VasEBoot_disk_dev_iterate_hook_t hook, void *hook_data) { - grub_disk_dev_t p; - grub_disk_pull_t pull; + VasEBoot_disk_dev_t p; + VasEBoot_disk_pull_t pull; - for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++) - for (p = grub_disk_dev_list; p; p = p->next) + for (pull = 0; pull < VasEBoot_DISK_PULL_MAX; pull++) + for (p = VasEBoot_disk_dev_list; p; p = p->next) if (p->iterate && (p->iterate) (hook, hook_data, pull)) return 1; return 0; } -grub_disk_t EXPORT_FUNC(grub_disk_open) (const char *name); -void EXPORT_FUNC(grub_disk_close) (grub_disk_t disk); -grub_err_t EXPORT_FUNC(grub_disk_read) (grub_disk_t disk, - grub_disk_addr_t sector, - grub_off_t offset, - grub_size_t size, +VasEBoot_disk_t EXPORT_FUNC(VasEBoot_disk_open) (const char *name); +void EXPORT_FUNC(VasEBoot_disk_close) (VasEBoot_disk_t disk); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_disk_read) (VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, + VasEBoot_size_t size, void *buf); -grub_err_t grub_disk_write (grub_disk_t disk, - grub_disk_addr_t sector, - grub_off_t offset, - grub_size_t size, +VasEBoot_err_t VasEBoot_disk_write (VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, + VasEBoot_size_t size, const void *buf); -extern grub_err_t (*EXPORT_VAR(grub_disk_write_weak)) (grub_disk_t disk, - grub_disk_addr_t sector, - grub_off_t offset, - grub_size_t size, +extern VasEBoot_err_t (*EXPORT_VAR(VasEBoot_disk_write_weak)) (VasEBoot_disk_t disk, + VasEBoot_disk_addr_t sector, + VasEBoot_off_t offset, + VasEBoot_size_t size, const void *buf); -grub_uint64_t EXPORT_FUNC(grub_disk_get_size) (grub_disk_t disk); +VasEBoot_uint64_t EXPORT_FUNC(VasEBoot_disk_get_size) (VasEBoot_disk_t disk); #if DISK_CACHE_STATS void -EXPORT_FUNC(grub_disk_cache_get_performance) (unsigned long *hits, unsigned long *misses); +EXPORT_FUNC(VasEBoot_disk_cache_get_performance) (unsigned long *hits, unsigned long *misses); #endif -extern void (* EXPORT_VAR(grub_disk_firmware_fini)) (void); -extern int EXPORT_VAR(grub_disk_firmware_is_tainted); +extern void (* EXPORT_VAR(VasEBoot_disk_firmware_fini)) (void); +extern int EXPORT_VAR(VasEBoot_disk_firmware_is_tainted); static inline void -grub_stop_disk_firmware (void) +VasEBoot_stop_disk_firmware (void) { /* To prevent two drivers operating on the same disks. */ - grub_disk_firmware_is_tainted = 1; - if (grub_disk_firmware_fini) + VasEBoot_disk_firmware_is_tainted = 1; + if (VasEBoot_disk_firmware_fini) { - grub_disk_firmware_fini (); - grub_disk_firmware_fini = NULL; + VasEBoot_disk_firmware_fini (); + VasEBoot_disk_firmware_fini = NULL; } } /* Disk cache. */ -struct grub_disk_cache +struct VasEBoot_disk_cache { - enum grub_disk_dev_id dev_id; + enum VasEBoot_disk_dev_id dev_id; unsigned long disk_id; - grub_disk_addr_t sector; + VasEBoot_disk_addr_t sector; char *data; int lock; }; -extern struct grub_disk_cache EXPORT_VAR(grub_disk_cache_table)[GRUB_DISK_CACHE_NUM]; +extern struct VasEBoot_disk_cache EXPORT_VAR(VasEBoot_disk_cache_table)[VasEBoot_DISK_CACHE_NUM]; -#if defined (GRUB_UTIL) -void grub_lvm_init (void); -void grub_ldm_init (void); -void grub_mdraid09_init (void); -void grub_mdraid1x_init (void); -void grub_diskfilter_init (void); -void grub_lvm_fini (void); -void grub_ldm_fini (void); -void grub_mdraid09_fini (void); -void grub_mdraid1x_fini (void); -void grub_diskfilter_fini (void); +#if defined (VasEBoot_UTIL) +void VasEBoot_lvm_init (void); +void VasEBoot_ldm_init (void); +void VasEBoot_mdraid09_init (void); +void VasEBoot_mdraid1x_init (void); +void VasEBoot_diskfilter_init (void); +void VasEBoot_lvm_fini (void); +void VasEBoot_ldm_fini (void); +void VasEBoot_mdraid09_fini (void); +void VasEBoot_mdraid1x_fini (void); +void VasEBoot_diskfilter_fini (void); #endif -#endif /* ! GRUB_DISK_HEADER */ +#endif /* ! VasEBoot_DISK_HEADER */ diff --git a/include/VasEBoot/diskfilter.h b/include/VasEBoot/diskfilter.h index d89273c1b..10208fdaa 100644 --- a/include/VasEBoot/diskfilter.h +++ b/include/VasEBoot/diskfilter.h @@ -1,83 +1,83 @@ /* diskfilter.h - On disk structures for RAID. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_DISKFILTER_H -#define GRUB_DISKFILTER_H 1 +#ifndef VasEBoot_DISKFILTER_H +#define VasEBoot_DISKFILTER_H 1 -#include -#include +#include +#include enum { - GRUB_RAID_LAYOUT_RIGHT_MASK = 1, - GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2, - GRUB_RAID_LAYOUT_MUL_FROM_POS = 4, + VasEBoot_RAID_LAYOUT_RIGHT_MASK = 1, + VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK = 2, + VasEBoot_RAID_LAYOUT_MUL_FROM_POS = 4, - GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0, - GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK, - GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK, - GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK - | GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + VasEBoot_RAID_LAYOUT_LEFT_ASYMMETRIC = 0, + VasEBoot_RAID_LAYOUT_RIGHT_ASYMMETRIC = VasEBoot_RAID_LAYOUT_RIGHT_MASK, + VasEBoot_RAID_LAYOUT_LEFT_SYMMETRIC = VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK, + VasEBoot_RAID_LAYOUT_RIGHT_SYMMETRIC = (VasEBoot_RAID_LAYOUT_RIGHT_MASK + | VasEBoot_RAID_LAYOUT_SYMMETRIC_MASK) }; -struct grub_diskfilter_vg { +struct VasEBoot_diskfilter_vg { char *uuid; - grub_size_t uuid_len; + VasEBoot_size_t uuid_len; /* Optional. */ char *name; - grub_uint64_t extent_size; - struct grub_diskfilter_pv *pvs; - struct grub_diskfilter_lv *lvs; - struct grub_diskfilter_vg *next; + VasEBoot_uint64_t extent_size; + struct VasEBoot_diskfilter_pv *pvs; + struct VasEBoot_diskfilter_lv *lvs; + struct VasEBoot_diskfilter_vg *next; -#ifdef GRUB_UTIL - struct grub_diskfilter *driver; +#ifdef VasEBoot_UTIL + struct VasEBoot_diskfilter *driver; #endif }; -struct grub_diskfilter_pv_id { +struct VasEBoot_diskfilter_pv_id { union { char *uuid; int id; }; - grub_size_t uuidlen; + VasEBoot_size_t uuidlen; }; -struct grub_diskfilter_pv { - struct grub_diskfilter_pv_id id; +struct VasEBoot_diskfilter_pv { + struct VasEBoot_diskfilter_pv_id id; /* Optional. */ char *name; - grub_disk_t disk; - grub_disk_addr_t part_start; - grub_disk_addr_t part_size; - grub_disk_addr_t start_sector; /* Sector number where the data area starts. */ - struct grub_diskfilter_pv *next; + VasEBoot_disk_t disk; + VasEBoot_disk_addr_t part_start; + VasEBoot_disk_addr_t part_size; + VasEBoot_disk_addr_t start_sector; /* Sector number where the data area starts. */ + struct VasEBoot_diskfilter_pv *next; /* Optional. */ - grub_uint8_t *internal_id; -#ifdef GRUB_UTIL + VasEBoot_uint8_t *internal_id; +#ifdef VasEBoot_UTIL char **partmaps; #endif }; -struct grub_diskfilter_lv { +struct VasEBoot_diskfilter_lv { /* Name used for disk. */ char *fullname; char *idname; @@ -85,125 +85,125 @@ struct grub_diskfilter_lv { char *name; int number; unsigned int segment_count; - grub_size_t segment_alloc; - grub_uint64_t size; + VasEBoot_size_t segment_alloc; + VasEBoot_uint64_t size; int became_readable_at; int scanned; int visible; /* Pointer to segment_count segments. */ - struct grub_diskfilter_segment *segments; - struct grub_diskfilter_vg *vg; - struct grub_diskfilter_lv *next; + struct VasEBoot_diskfilter_segment *segments; + struct VasEBoot_diskfilter_vg *vg; + struct VasEBoot_diskfilter_lv *next; /* Optional. */ char *internal_id; }; -struct grub_diskfilter_segment { - grub_uint64_t start_extent; - grub_uint64_t extent_count; +struct VasEBoot_diskfilter_segment { + VasEBoot_uint64_t start_extent; + VasEBoot_uint64_t extent_count; enum { - GRUB_DISKFILTER_STRIPED = 0, - GRUB_DISKFILTER_MIRROR = 1, - GRUB_DISKFILTER_RAID4 = 4, - GRUB_DISKFILTER_RAID5 = 5, - GRUB_DISKFILTER_RAID6 = 6, - GRUB_DISKFILTER_RAID10 = 10, + VasEBoot_DISKFILTER_STRIPED = 0, + VasEBoot_DISKFILTER_MIRROR = 1, + VasEBoot_DISKFILTER_RAID4 = 4, + VasEBoot_DISKFILTER_RAID5 = 5, + VasEBoot_DISKFILTER_RAID6 = 6, + VasEBoot_DISKFILTER_RAID10 = 10, } type; int layout; /* valid only for raid10. */ - grub_uint64_t raid_member_size; + VasEBoot_uint64_t raid_member_size; unsigned int node_count; unsigned int node_alloc; - struct grub_diskfilter_node *nodes; + struct VasEBoot_diskfilter_node *nodes; unsigned int stripe_size; }; -struct grub_diskfilter_node { - grub_disk_addr_t start; +struct VasEBoot_diskfilter_node { + VasEBoot_disk_addr_t start; /* Optional. */ char *name; - struct grub_diskfilter_pv *pv; - struct grub_diskfilter_lv *lv; + struct VasEBoot_diskfilter_pv *pv; + struct VasEBoot_diskfilter_lv *lv; }; -struct grub_diskfilter_vg * -grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid); +struct VasEBoot_diskfilter_vg * +VasEBoot_diskfilter_get_vg_by_uuid (VasEBoot_size_t uuidlen, char *uuid); -struct grub_diskfilter +struct VasEBoot_diskfilter { - struct grub_diskfilter *next; - struct grub_diskfilter **prev; + struct VasEBoot_diskfilter *next; + struct VasEBoot_diskfilter **prev; const char *name; - struct grub_diskfilter_vg * (*detect) (grub_disk_t disk, - struct grub_diskfilter_pv_id *id, - grub_disk_addr_t *start_sector); + struct VasEBoot_diskfilter_vg * (*detect) (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_pv_id *id, + VasEBoot_disk_addr_t *start_sector); }; -typedef struct grub_diskfilter *grub_diskfilter_t; +typedef struct VasEBoot_diskfilter *VasEBoot_diskfilter_t; -extern grub_diskfilter_t grub_diskfilter_list; +extern VasEBoot_diskfilter_t VasEBoot_diskfilter_list; static inline void -grub_diskfilter_register_front (grub_diskfilter_t diskfilter) +VasEBoot_diskfilter_register_front (VasEBoot_diskfilter_t diskfilter) { - grub_list_push (GRUB_AS_LIST_P (&grub_diskfilter_list), - GRUB_AS_LIST (diskfilter)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_diskfilter_list), + VasEBoot_AS_LIST (diskfilter)); } static inline void -grub_diskfilter_register_back (grub_diskfilter_t diskfilter) +VasEBoot_diskfilter_register_back (VasEBoot_diskfilter_t diskfilter) { - grub_diskfilter_t p, *q; - for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q); + VasEBoot_diskfilter_t p, *q; + for (q = &VasEBoot_diskfilter_list, p = *q; p; q = &p->next, p = *q); diskfilter->next = NULL; diskfilter->prev = q; *q = diskfilter; } static inline void -grub_diskfilter_unregister (grub_diskfilter_t diskfilter) +VasEBoot_diskfilter_unregister (VasEBoot_diskfilter_t diskfilter) { - grub_list_remove (GRUB_AS_LIST (diskfilter)); + VasEBoot_list_remove (VasEBoot_AS_LIST (diskfilter)); } -struct grub_diskfilter_vg * -grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb, - const char *name, grub_uint64_t disk_size, - grub_uint64_t stripe_size, +struct VasEBoot_diskfilter_vg * +VasEBoot_diskfilter_make_raid (VasEBoot_size_t uuidlen, char *uuid, int nmemb, + const char *name, VasEBoot_uint64_t disk_size, + VasEBoot_uint64_t stripe_size, int layout, int level); -typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array, +typedef VasEBoot_err_t (*VasEBoot_raid5_recover_func_t) (struct VasEBoot_diskfilter_segment *array, int disknr, char *buf, - grub_disk_addr_t sector, - grub_size_t size); + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size); -typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array, +typedef VasEBoot_err_t (*VasEBoot_raid6_recover_func_t) (struct VasEBoot_diskfilter_segment *array, int disknr, int p, char *buf, - grub_disk_addr_t sector, - grub_size_t size); + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size); -extern grub_raid5_recover_func_t grub_raid5_recover_func; -extern grub_raid6_recover_func_t grub_raid6_recover_func; +extern VasEBoot_raid5_recover_func_t VasEBoot_raid5_recover_func; +extern VasEBoot_raid6_recover_func_t VasEBoot_raid6_recover_func; -grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg); +VasEBoot_err_t VasEBoot_diskfilter_vg_register (struct VasEBoot_diskfilter_vg *vg); -grub_err_t -grub_diskfilter_read_node (const struct grub_diskfilter_node *node, - grub_disk_addr_t sector, - grub_size_t size, char *buf); +VasEBoot_err_t +VasEBoot_diskfilter_read_node (const struct VasEBoot_diskfilter_node *node, + VasEBoot_disk_addr_t sector, + VasEBoot_size_t size, char *buf); -#ifdef GRUB_UTIL -struct grub_diskfilter_pv * -grub_diskfilter_get_pv_from_disk (grub_disk_t disk, - struct grub_diskfilter_vg **vg); +#ifdef VasEBoot_UTIL +struct VasEBoot_diskfilter_pv * +VasEBoot_diskfilter_get_pv_from_disk (VasEBoot_disk_t disk, + struct VasEBoot_diskfilter_vg **vg); void -grub_diskfilter_get_partmap (grub_disk_t disk, +VasEBoot_diskfilter_get_partmap (VasEBoot_disk_t disk, void (*cb) (const char *val, void *data), void *data); #endif -#endif /* ! GRUB_RAID_H */ +#endif /* ! VasEBoot_RAID_H */ diff --git a/include/VasEBoot/dl.h b/include/VasEBoot/dl.h index 2bca56ce0..613ae1586 100644 --- a/include/VasEBoot/dl.h +++ b/include/VasEBoot/dl.h @@ -1,88 +1,88 @@ /* dl.h - types and prototypes for loadable module support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_DL_H -#define GRUB_DL_H 1 +#ifndef VasEBoot_DL_H +#define VasEBoot_DL_H 1 -#include +#include #ifndef ASM_FILE -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #endif /* - * Macros GRUB_MOD_INIT and GRUB_MOD_FINI are also used by build rules + * Macros VasEBoot_MOD_INIT and VasEBoot_MOD_FINI are also used by build rules * to collect module names, so we define them only when they are not * defined already. */ #ifndef ASM_FILE -#ifndef GRUB_MOD_INIT +#ifndef VasEBoot_MOD_INIT -#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) && !defined (GRUB_KERNEL) +#if !defined (VasEBoot_UTIL) && !defined (VasEBoot_MACHINE_EMU) && !defined (VasEBoot_KERNEL) -#define GRUB_MOD_INIT(name) \ -static void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ +#define VasEBoot_MOD_INIT(name) \ +static void VasEBoot_mod_init (VasEBoot_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ static void \ -grub_mod_init (grub_dl_t mod __attribute__ ((unused))) +VasEBoot_mod_init (VasEBoot_dl_t mod __attribute__ ((unused))) -#define GRUB_MOD_FINI(name) \ -static void grub_mod_fini (void) __attribute__ ((used)); \ +#define VasEBoot_MOD_FINI(name) \ +static void VasEBoot_mod_fini (void) __attribute__ ((used)); \ static void \ -grub_mod_fini (void) +VasEBoot_mod_fini (void) -#elif defined (GRUB_KERNEL) +#elif defined (VasEBoot_KERNEL) -#define GRUB_MOD_INIT(name) \ -static void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ +#define VasEBoot_MOD_INIT(name) \ +static void VasEBoot_mod_init (VasEBoot_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ void \ -grub_##name##_init (void) { grub_mod_init (0); } \ +VasEBoot_##name##_init (void) { VasEBoot_mod_init (0); } \ static void \ -grub_mod_init (grub_dl_t mod __attribute__ ((unused))) +VasEBoot_mod_init (VasEBoot_dl_t mod __attribute__ ((unused))) -#define GRUB_MOD_FINI(name) \ -static void grub_mod_fini (void) __attribute__ ((used)); \ +#define VasEBoot_MOD_FINI(name) \ +static void VasEBoot_mod_fini (void) __attribute__ ((used)); \ void \ -grub_##name##_fini (void) { grub_mod_fini (); } \ +VasEBoot_##name##_fini (void) { VasEBoot_mod_fini (); } \ static void \ -grub_mod_fini (void) +VasEBoot_mod_fini (void) #else -#define GRUB_MOD_INIT(name) \ -static void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ -void grub_##name##_init (void); \ +#define VasEBoot_MOD_INIT(name) \ +static void VasEBoot_mod_init (VasEBoot_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ +void VasEBoot_##name##_init (void); \ void \ -grub_##name##_init (void) { grub_mod_init (0); } \ +VasEBoot_##name##_init (void) { VasEBoot_mod_init (0); } \ static void \ -grub_mod_init (grub_dl_t mod __attribute__ ((unused))) +VasEBoot_mod_init (VasEBoot_dl_t mod __attribute__ ((unused))) -#define GRUB_MOD_FINI(name) \ -static void grub_mod_fini (void) __attribute__ ((used)); \ -void grub_##name##_fini (void); \ +#define VasEBoot_MOD_FINI(name) \ +static void VasEBoot_mod_fini (void) __attribute__ ((used)); \ +void VasEBoot_##name##_fini (void); \ void \ -grub_##name##_fini (void) { grub_mod_fini (); } \ +VasEBoot_##name##_fini (void) { VasEBoot_mod_fini (); } \ static void \ -grub_mod_fini (void) +VasEBoot_mod_fini (void) #endif @@ -92,15 +92,15 @@ grub_mod_fini (void) #ifndef ASM_FILE #ifdef __APPLE__ -#define GRUB_MOD_SECTION(x) "_" #x ", _" #x "" +#define VasEBoot_MOD_SECTION(x) "_" #x ", _" #x "" #else -#define GRUB_MOD_SECTION(x) "." #x +#define VasEBoot_MOD_SECTION(x) "." #x #endif #else #ifdef __APPLE__ -#define GRUB_MOD_SECTION(x) _ ## x , _ ##x +#define VasEBoot_MOD_SECTION(x) _ ## x , _ ##x #else -#define GRUB_MOD_SECTION(x) . ## x +#define VasEBoot_MOD_SECTION(x) . ## x #endif #endif @@ -108,8 +108,8 @@ grub_mod_fini (void) GNU module policy. Note that this license check is informative only. Modules have to be licensed under GPLv3 or GPLv3+ (optionally multi-licensed under other licences as well) independently of the - presence of this check and solely by linking (module loading in GRUB - constitutes linking) and GRUB core being licensed under GPLv3+. + presence of this check and solely by linking (module loading in VasEBoot + constitutes linking) and VasEBoot core being licensed under GPLv3+. Be sure to understand your license obligations. */ #ifndef ASM_FILE @@ -118,25 +118,25 @@ grub_mod_fini (void) #else #define ATTRIBUTE_USED __unused__ #endif -#define GRUB_MOD_LICENSE(license) \ - static char grub_module_license[] __attribute__ ((section (GRUB_MOD_SECTION (module_license)), ATTRIBUTE_USED)) = "LICENSE=" license; -#define GRUB_MOD_DEP(name) \ -static const char grub_module_depend_##name[] \ - __attribute__((section(GRUB_MOD_SECTION(moddeps)), ATTRIBUTE_USED)) = #name -#define GRUB_MOD_NAME(name) \ -static const char grub_module_name_##name[] \ - __attribute__((section(GRUB_MOD_SECTION(modname)), __used__)) = #name +#define VasEBoot_MOD_LICENSE(license) \ + static char VasEBoot_module_license[] __attribute__ ((section (VasEBoot_MOD_SECTION (module_license)), ATTRIBUTE_USED)) = "LICENSE=" license; +#define VasEBoot_MOD_DEP(name) \ +static const char VasEBoot_module_depend_##name[] \ + __attribute__((section(VasEBoot_MOD_SECTION(moddeps)), ATTRIBUTE_USED)) = #name +#define VasEBoot_MOD_NAME(name) \ +static const char VasEBoot_module_name_##name[] \ + __attribute__((section(VasEBoot_MOD_SECTION(modname)), __used__)) = #name #else #ifdef __APPLE__ -.macro GRUB_MOD_LICENSE - .section GRUB_MOD_SECTION(module_license) +.macro VasEBoot_MOD_LICENSE + .section VasEBoot_MOD_SECTION(module_license) .ascii "LICENSE=" .ascii $0 .byte 0 .endm #else -.macro GRUB_MOD_LICENSE license - .section GRUB_MOD_SECTION(module_license), "a" +.macro VasEBoot_MOD_LICENSE license + .section VasEBoot_MOD_SECTION(module_license), "a" .ascii "LICENSE=" .ascii "\license" .byte 0 @@ -148,38 +148,38 @@ static const char grub_module_name_##name[] \ under GPLv3(+). However, you can also distribute the same code under another license as long as GPLv3(+) version is provided. */ -#define GRUB_MOD_DUAL_LICENSE(x) +#define VasEBoot_MOD_DUAL_LICENSE(x) #ifndef ASM_FILE -struct grub_dl_segment +struct VasEBoot_dl_segment { - struct grub_dl_segment *next; + struct VasEBoot_dl_segment *next; void *addr; - grub_size_t size; + VasEBoot_size_t size; unsigned section; }; -typedef struct grub_dl_segment *grub_dl_segment_t; +typedef struct VasEBoot_dl_segment *VasEBoot_dl_segment_t; -struct grub_dl; +struct VasEBoot_dl; -struct grub_dl_dep +struct VasEBoot_dl_dep { - struct grub_dl_dep *next; - struct grub_dl *mod; + struct VasEBoot_dl_dep *next; + struct VasEBoot_dl *mod; }; -typedef struct grub_dl_dep *grub_dl_dep_t; +typedef struct VasEBoot_dl_dep *VasEBoot_dl_dep_t; -#ifndef GRUB_UTIL -struct grub_dl +#ifndef VasEBoot_UTIL +struct VasEBoot_dl { char *name; int ref_count; - grub_dl_dep_t dep; - grub_dl_segment_t segment; + VasEBoot_dl_dep_t dep; + VasEBoot_dl_segment_t segment; Elf_Sym *symtab; - grub_size_t symsize; - void (*init) (struct grub_dl *mod); + VasEBoot_size_t symsize; + void (*init) (struct VasEBoot_dl *mod); void (*fini) (void); #if !defined (__i386__) && !defined (__x86_64__) void *got; @@ -188,53 +188,53 @@ struct grub_dl void *trampptr; #endif #ifdef __mips__ - grub_uint32_t *reginfo; + VasEBoot_uint32_t *reginfo; #endif void *base; - grub_size_t sz; - struct grub_dl *next; + VasEBoot_size_t sz; + struct VasEBoot_dl *next; }; #endif -typedef struct grub_dl *grub_dl_t; +typedef struct VasEBoot_dl *VasEBoot_dl_t; -grub_dl_t grub_dl_load_file (const char *filename); -grub_dl_t EXPORT_FUNC(grub_dl_load) (const char *name); -grub_dl_t grub_dl_load_core (void *addr, grub_size_t size); -grub_dl_t EXPORT_FUNC(grub_dl_load_core_noinit) (void *addr, grub_size_t size); -int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod); -void grub_dl_unload_unneeded (void); -int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod); -int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod); -extern grub_dl_t EXPORT_VAR(grub_dl_head); +VasEBoot_dl_t VasEBoot_dl_load_file (const char *filename); +VasEBoot_dl_t EXPORT_FUNC(VasEBoot_dl_load) (const char *name); +VasEBoot_dl_t VasEBoot_dl_load_core (void *addr, VasEBoot_size_t size); +VasEBoot_dl_t EXPORT_FUNC(VasEBoot_dl_load_core_noinit) (void *addr, VasEBoot_size_t size); +int EXPORT_FUNC(VasEBoot_dl_unload) (VasEBoot_dl_t mod); +void VasEBoot_dl_unload_unneeded (void); +int EXPORT_FUNC(VasEBoot_dl_ref) (VasEBoot_dl_t mod); +int EXPORT_FUNC(VasEBoot_dl_unref) (VasEBoot_dl_t mod); +extern VasEBoot_dl_t EXPORT_VAR(VasEBoot_dl_head); -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL -#define FOR_DL_MODULES(var) FOR_LIST_ELEMENTS ((var), (grub_dl_head)) +#define FOR_DL_MODULES(var) FOR_LIST_ELEMENTS ((var), (VasEBoot_dl_head)) -#ifdef GRUB_MACHINE_EMU +#ifdef VasEBoot_MACHINE_EMU void * -grub_osdep_dl_memalign (grub_size_t align, grub_size_t size); +VasEBoot_osdep_dl_memalign (VasEBoot_size_t align, VasEBoot_size_t size); void -grub_dl_osdep_dl_free (void *ptr); +VasEBoot_dl_osdep_dl_free (void *ptr); #endif static inline void -grub_dl_init (grub_dl_t mod) +VasEBoot_dl_init (VasEBoot_dl_t mod) { if (mod->init) (mod->init) (mod); - mod->next = grub_dl_head; - grub_dl_head = mod; + mod->next = VasEBoot_dl_head; + VasEBoot_dl_head = mod; } -static inline grub_dl_t -grub_dl_get (const char *name) +static inline VasEBoot_dl_t +VasEBoot_dl_get (const char *name) { - grub_dl_t l; + VasEBoot_dl_t l; FOR_DL_MODULES(l) - if (grub_strcmp (name, l->name) == 0) + if (VasEBoot_strcmp (name, l->name) == 0) return l; return 0; @@ -242,53 +242,53 @@ grub_dl_get (const char *name) #endif -grub_err_t grub_dl_register_symbol (const char *name, void *addr, - int isfunc, grub_dl_t mod); +VasEBoot_err_t VasEBoot_dl_register_symbol (const char *name, void *addr, + int isfunc, VasEBoot_dl_t mod); -grub_err_t grub_arch_dl_check_header (void *ehdr); -#ifndef GRUB_UTIL -grub_err_t -grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - Elf_Shdr *s, grub_dl_segment_t seg); +VasEBoot_err_t VasEBoot_arch_dl_check_header (void *ehdr); +#ifndef VasEBoot_UTIL +VasEBoot_err_t +VasEBoot_arch_dl_relocate_symbols (VasEBoot_dl_t mod, void *ehdr, + Elf_Shdr *s, VasEBoot_dl_segment_t seg); #endif #if defined (_mips) -#define GRUB_LINKER_HAVE_INIT 1 -void grub_arch_dl_init_linker (void); +#define VasEBoot_LINKER_HAVE_INIT 1 +void VasEBoot_arch_dl_init_linker (void); #endif -#define GRUB_IA64_DL_TRAMP_ALIGN 16 -#define GRUB_IA64_DL_GOT_ALIGN 16 +#define VasEBoot_IA64_DL_TRAMP_ALIGN 16 +#define VasEBoot_IA64_DL_GOT_ALIGN 16 -grub_err_t -grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got); -grub_err_t -grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got); +VasEBoot_err_t +VasEBoot_ia64_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got); +VasEBoot_err_t +VasEBoot_arm64_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got); #if defined (__ia64__) -#define GRUB_ARCH_DL_TRAMP_ALIGN GRUB_IA64_DL_TRAMP_ALIGN -#define GRUB_ARCH_DL_GOT_ALIGN GRUB_IA64_DL_GOT_ALIGN -#define grub_arch_dl_get_tramp_got_size grub_ia64_dl_get_tramp_got_size +#define VasEBoot_ARCH_DL_TRAMP_ALIGN VasEBoot_IA64_DL_TRAMP_ALIGN +#define VasEBoot_ARCH_DL_GOT_ALIGN VasEBoot_IA64_DL_GOT_ALIGN +#define VasEBoot_arch_dl_get_tramp_got_size VasEBoot_ia64_dl_get_tramp_got_size #elif defined (__aarch64__) -#define grub_arch_dl_get_tramp_got_size grub_arm64_dl_get_tramp_got_size +#define VasEBoot_arch_dl_get_tramp_got_size VasEBoot_arm64_dl_get_tramp_got_size #else -grub_err_t -grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, - grub_size_t *got); +VasEBoot_err_t +VasEBoot_arch_dl_get_tramp_got_size (const void *ehdr, VasEBoot_size_t *tramp, + VasEBoot_size_t *got); #endif #if defined (__powerpc__) || defined (__mips__) || defined (__arm__) -#define GRUB_ARCH_DL_TRAMP_ALIGN 4 -#define GRUB_ARCH_DL_GOT_ALIGN 4 +#define VasEBoot_ARCH_DL_TRAMP_ALIGN 4 +#define VasEBoot_ARCH_DL_GOT_ALIGN 4 #endif #if defined (__aarch64__) || defined (__sparc__) -#define GRUB_ARCH_DL_TRAMP_ALIGN 8 -#define GRUB_ARCH_DL_GOT_ALIGN 8 +#define VasEBoot_ARCH_DL_TRAMP_ALIGN 8 +#define VasEBoot_ARCH_DL_GOT_ALIGN 8 #endif #endif -#endif /* ! GRUB_DL_H */ +#endif /* ! VasEBoot_DL_H */ diff --git a/include/VasEBoot/efi/api.h b/include/VasEBoot/efi/api.h index 356d855e2..db25ccbd1 100644 --- a/include/VasEBoot/efi/api.h +++ b/include/VasEBoot/efi/api.h @@ -1,1475 +1,1475 @@ /* efi.h - declare EFI types and functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_API_HEADER -#define GRUB_EFI_API_HEADER 1 +#ifndef VasEBoot_EFI_API_HEADER +#define VasEBoot_EFI_API_HEADER 1 -#include -#include +#include +#include /* For consistency and safety, we name the EFI-defined types differently. All names are transformed into lower case, _t appended, and - grub_efi_ prepended. */ + VasEBoot_efi_ prepended. */ /* Constants. */ -#define GRUB_EFI_EVT_TIMER 0x80000000 -#define GRUB_EFI_EVT_RUNTIME 0x40000000 -#define GRUB_EFI_EVT_RUNTIME_CONTEXT 0x20000000 -#define GRUB_EFI_EVT_NOTIFY_WAIT 0x00000100 -#define GRUB_EFI_EVT_NOTIFY_SIGNAL 0x00000200 -#define GRUB_EFI_EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 -#define GRUB_EFI_EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 +#define VasEBoot_EFI_EVT_TIMER 0x80000000 +#define VasEBoot_EFI_EVT_RUNTIME 0x40000000 +#define VasEBoot_EFI_EVT_RUNTIME_CONTEXT 0x20000000 +#define VasEBoot_EFI_EVT_NOTIFY_WAIT 0x00000100 +#define VasEBoot_EFI_EVT_NOTIFY_SIGNAL 0x00000200 +#define VasEBoot_EFI_EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 +#define VasEBoot_EFI_EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 -#define GRUB_EFI_TPL_APPLICATION 4 -#define GRUB_EFI_TPL_CALLBACK 8 -#define GRUB_EFI_TPL_NOTIFY 16 -#define GRUB_EFI_TPL_HIGH_LEVEL 31 +#define VasEBoot_EFI_TPL_APPLICATION 4 +#define VasEBoot_EFI_TPL_CALLBACK 8 +#define VasEBoot_EFI_TPL_NOTIFY 16 +#define VasEBoot_EFI_TPL_HIGH_LEVEL 31 -#define GRUB_EFI_MEMORY_UC 0x0000000000000001LL -#define GRUB_EFI_MEMORY_WC 0x0000000000000002LL -#define GRUB_EFI_MEMORY_WT 0x0000000000000004LL -#define GRUB_EFI_MEMORY_WB 0x0000000000000008LL -#define GRUB_EFI_MEMORY_UCE 0x0000000000000010LL -#define GRUB_EFI_MEMORY_WP 0x0000000000001000LL -#define GRUB_EFI_MEMORY_RP 0x0000000000002000LL -#define GRUB_EFI_MEMORY_XP 0x0000000000004000LL -#define GRUB_EFI_MEMORY_NV 0x0000000000008000LL -#define GRUB_EFI_MEMORY_MORE_RELIABLE 0x0000000000010000LL -#define GRUB_EFI_MEMORY_RO 0x0000000000020000LL -#define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL +#define VasEBoot_EFI_MEMORY_UC 0x0000000000000001LL +#define VasEBoot_EFI_MEMORY_WC 0x0000000000000002LL +#define VasEBoot_EFI_MEMORY_WT 0x0000000000000004LL +#define VasEBoot_EFI_MEMORY_WB 0x0000000000000008LL +#define VasEBoot_EFI_MEMORY_UCE 0x0000000000000010LL +#define VasEBoot_EFI_MEMORY_WP 0x0000000000001000LL +#define VasEBoot_EFI_MEMORY_RP 0x0000000000002000LL +#define VasEBoot_EFI_MEMORY_XP 0x0000000000004000LL +#define VasEBoot_EFI_MEMORY_NV 0x0000000000008000LL +#define VasEBoot_EFI_MEMORY_MORE_RELIABLE 0x0000000000010000LL +#define VasEBoot_EFI_MEMORY_RO 0x0000000000020000LL +#define VasEBoot_EFI_MEMORY_RUNTIME 0x8000000000000000LL -#define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 -#define GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 -#define GRUB_EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 -#define GRUB_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 -#define GRUB_EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 -#define GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE 0x00000020 +#define VasEBoot_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +#define VasEBoot_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 +#define VasEBoot_EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 +#define VasEBoot_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 +#define VasEBoot_EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 +#define VasEBoot_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE 0x00000020 -#define GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001ULL +#define VasEBoot_EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001ULL -#define GRUB_EFI_VARIABLE_NON_VOLATILE 0x0000000000000001 -#define GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002 -#define GRUB_EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 +#define VasEBoot_EFI_VARIABLE_NON_VOLATILE 0x0000000000000001 +#define VasEBoot_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002 +#define VasEBoot_EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 -#define GRUB_EFI_TIME_ADJUST_DAYLIGHT 0x01 -#define GRUB_EFI_TIME_IN_DAYLIGHT 0x02 +#define VasEBoot_EFI_TIME_ADJUST_DAYLIGHT 0x01 +#define VasEBoot_EFI_TIME_IN_DAYLIGHT 0x02 -#define GRUB_EFI_UNSPECIFIED_TIMEZONE 0x07FF +#define VasEBoot_EFI_UNSPECIFIED_TIMEZONE 0x07FF -#define GRUB_EFI_OPTIONAL_PTR 0x00000001 +#define VasEBoot_EFI_OPTIONAL_PTR 0x00000001 -#define GRUB_EFI_LOADED_IMAGE_GUID \ +#define VasEBoot_EFI_LOADED_IMAGE_GUID \ { 0x5b1b31a1, 0x9562, 0x11d2, \ { 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_DISK_IO_GUID \ +#define VasEBoot_EFI_DISK_IO_GUID \ { 0xce345171, 0xba0b, 0x11d2, \ { 0x8e, 0x4f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_BLOCK_IO_GUID \ +#define VasEBoot_EFI_BLOCK_IO_GUID \ { 0x964e5b21, 0x6459, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_SERIAL_IO_GUID \ +#define VasEBoot_EFI_SERIAL_IO_GUID \ { 0xbb25cf6f, 0xf1d4, 0x11d2, \ { 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0xfd } \ } -#define GRUB_EFI_SIMPLE_NETWORK_GUID \ +#define VasEBoot_EFI_SIMPLE_NETWORK_GUID \ { 0xa19832b9, 0xac25, 0x11d3, \ { 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_PXE_GUID \ +#define VasEBoot_EFI_PXE_GUID \ { 0x03c4e603, 0xac28, 0x11d3, \ { 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_DEVICE_PATH_GUID \ +#define VasEBoot_EFI_DEVICE_PATH_GUID \ { 0x09576e91, 0x6d3f, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ +#define VasEBoot_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ { 0x387477c1, 0x69c7, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ +#define VasEBoot_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ { 0xdd9e7534, 0x7762, 0x4698, \ { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } \ } -#define GRUB_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \ +#define VasEBoot_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \ { 0x387477c2, 0x69c7, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_SIMPLE_POINTER_PROTOCOL_GUID \ +#define VasEBoot_EFI_SIMPLE_POINTER_PROTOCOL_GUID \ { 0x31878c87, 0xb75, 0x11d5, \ { 0x9a, 0x4f, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \ +#define VasEBoot_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \ { 0x8D59D32B, 0xC655, 0x4AE9, \ { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } \ } -#define GRUB_EFI_DRIVER_BINDING_PROTOCOL_GUID \ +#define VasEBoot_EFI_DRIVER_BINDING_PROTOCOL_GUID \ { 0x18A031AB, 0xB443, 0x4D1A, \ { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 } \ } -#define GRUB_EFI_LOADED_IMAGE_PROTOCOL_GUID \ +#define VasEBoot_EFI_LOADED_IMAGE_PROTOCOL_GUID \ { 0x5B1B31A1, 0x9562, 0x11d2, \ { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ } -#define GRUB_EFI_LOAD_FILE_PROTOCOL_GUID \ +#define VasEBoot_EFI_LOAD_FILE_PROTOCOL_GUID \ { 0x56EC3091, 0x954C, 0x11d2, \ { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ } -#define GRUB_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ +#define VasEBoot_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ { 0x0964e5b22, 0x6459, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define GRUB_EFI_TAPE_IO_PROTOCOL_GUID \ +#define VasEBoot_EFI_TAPE_IO_PROTOCOL_GUID \ { 0x1e93e633, 0xd65a, 0x459e, \ { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \ } -#define GRUB_EFI_UNICODE_COLLATION_PROTOCOL_GUID \ +#define VasEBoot_EFI_UNICODE_COLLATION_PROTOCOL_GUID \ { 0x1d85cd7f, 0xf43d, 0x11d2, \ { 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_SCSI_IO_PROTOCOL_GUID \ +#define VasEBoot_EFI_SCSI_IO_PROTOCOL_GUID \ { 0x932f47e6, 0x2362, 0x4002, \ { 0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \ } -#define GRUB_EFI_USB2_HC_PROTOCOL_GUID \ +#define VasEBoot_EFI_USB2_HC_PROTOCOL_GUID \ { 0x3e745226, 0x9818, 0x45b6, \ { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } \ } -#define GRUB_EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ +#define VasEBoot_EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ { 0x2755590C, 0x6F3C, 0x42FA, \ { 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \ } -#define GRUB_EFI_DEBUGPORT_PROTOCOL_GUID \ +#define VasEBoot_EFI_DEBUGPORT_PROTOCOL_GUID \ { 0xEBA4E8D2, 0x3858, 0x41EC, \ { 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \ } -#define GRUB_EFI_DECOMPRESS_PROTOCOL_GUID \ +#define VasEBoot_EFI_DECOMPRESS_PROTOCOL_GUID \ { 0xd8117cfe, 0x94a6, 0x11d4, \ { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ +#define VasEBoot_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ { 0x8b843e20, 0x8132, 0x4852, \ { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \ } -#define GRUB_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \ +#define VasEBoot_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \ { 0x379be4e, 0xd706, 0x437d, \ { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \ } -#define GRUB_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \ +#define VasEBoot_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \ { 0x5c99a21, 0xc70f, 0x4ad2, \ { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } \ } -#define GRUB_EFI_ACPI_TABLE_PROTOCOL_GUID \ +#define VasEBoot_EFI_ACPI_TABLE_PROTOCOL_GUID \ { 0xffe06bdd, 0x6107, 0x46a6, \ { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c} \ } -#define GRUB_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ +#define VasEBoot_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ { 0x587e72d7, 0xcc50, 0x4f79, \ { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } \ } -#define GRUB_EFI_HII_DATABASE_PROTOCOL_GUID \ +#define VasEBoot_EFI_HII_DATABASE_PROTOCOL_GUID \ { 0xef9fc172, 0xa1b2, 0x4693, \ { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } \ } -#define GRUB_EFI_HII_STRING_PROTOCOL_GUID \ +#define VasEBoot_EFI_HII_STRING_PROTOCOL_GUID \ { 0xfd96974, 0x23aa, 0x4cdc, \ { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } \ } -#define GRUB_EFI_HII_IMAGE_PROTOCOL_GUID \ +#define VasEBoot_EFI_HII_IMAGE_PROTOCOL_GUID \ { 0x31a6406a, 0x6bdf, 0x4e46, \ { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } \ } -#define GRUB_EFI_HII_FONT_PROTOCOL_GUID \ +#define VasEBoot_EFI_HII_FONT_PROTOCOL_GUID \ { 0xe9ca4775, 0x8657, 0x47fc, \ { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } \ } -#define GRUB_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \ +#define VasEBoot_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \ { 0x330d4706, 0xf2a0, 0x4e4f, \ { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } \ } -#define GRUB_EFI_COMPONENT_NAME2_PROTOCOL_GUID \ +#define VasEBoot_EFI_COMPONENT_NAME2_PROTOCOL_GUID \ { 0x6a7a5cff, 0xe8d9, 0x4f70, \ { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14} \ } -#define GRUB_EFI_USB_IO_PROTOCOL_GUID \ +#define VasEBoot_EFI_USB_IO_PROTOCOL_GUID \ { 0x2B2F68D6, 0x0CD2, 0x44cf, \ { 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \ } -#define GRUB_EFI_TIANO_CUSTOM_DECOMPRESS_GUID \ +#define VasEBoot_EFI_TIANO_CUSTOM_DECOMPRESS_GUID \ { 0xa31280ad, 0x481e, 0x41b6, \ { 0x95, 0xe8, 0x12, 0x7f, 0x4c, 0x98, 0x47, 0x79 } \ } -#define GRUB_EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID \ +#define VasEBoot_EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID \ { 0xfc1bcdb0, 0x7d31, 0x49aa, \ { 0x93, 0x6a, 0xa4, 0x60, 0x0d, 0x9d, 0xd0, 0x83 } \ } -#define GRUB_EFI_LZMA_CUSTOM_DECOMPRESS_GUID \ +#define VasEBoot_EFI_LZMA_CUSTOM_DECOMPRESS_GUID \ { 0xee4e5898, 0x3914, 0x4259, \ { 0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf } \ } -#define GRUB_EFI_TSC_FREQUENCY_GUID \ +#define VasEBoot_EFI_TSC_FREQUENCY_GUID \ { 0xdba6a7e3, 0xbb57, 0x4be7, \ { 0x8a, 0xf8, 0xd5, 0x78, 0xdb, 0x7e, 0x56, 0x87 } \ } -#define GRUB_EFI_SYSTEM_RESOURCE_TABLE_GUID \ +#define VasEBoot_EFI_SYSTEM_RESOURCE_TABLE_GUID \ { 0xb122a263, 0x3661, 0x4f68, \ { 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 } \ } -#define GRUB_EFI_DXE_SERVICES_TABLE_GUID \ +#define VasEBoot_EFI_DXE_SERVICES_TABLE_GUID \ { 0x05ad34ba, 0x6f02, 0x4214, \ { 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } \ } -#define GRUB_EFI_HOB_LIST_GUID \ +#define VasEBoot_EFI_HOB_LIST_GUID \ { 0x7739f24c, 0x93d7, 0x11d4, \ { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_MEMORY_TYPE_INFORMATION_GUID \ +#define VasEBoot_EFI_MEMORY_TYPE_INFORMATION_GUID \ { 0x4c19049f, 0x4137, 0x4dd3, \ { 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } \ } -#define GRUB_EFI_DEBUG_IMAGE_INFO_TABLE_GUID \ +#define VasEBoot_EFI_DEBUG_IMAGE_INFO_TABLE_GUID \ { 0x49152e77, 0x1ada, 0x4764, \ { 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } \ } -#define GRUB_EFI_MPS_TABLE_GUID \ +#define VasEBoot_EFI_MPS_TABLE_GUID \ { 0xeb9d2d2f, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_ACPI_TABLE_GUID \ +#define VasEBoot_EFI_ACPI_TABLE_GUID \ { 0xeb9d2d30, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_ACPI_20_TABLE_GUID \ +#define VasEBoot_EFI_ACPI_20_TABLE_GUID \ { 0x8868e871, 0xe4f1, 0x11d3, \ { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } -#define GRUB_EFI_SMBIOS_TABLE_GUID \ +#define VasEBoot_EFI_SMBIOS_TABLE_GUID \ { 0xeb9d2d31, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_SMBIOS3_TABLE_GUID \ +#define VasEBoot_EFI_SMBIOS3_TABLE_GUID \ { 0xf2fd1544, 0x9794, 0x4a2c, \ { 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94 } \ } -#define GRUB_EFI_SAL_TABLE_GUID \ +#define VasEBoot_EFI_SAL_TABLE_GUID \ { 0xeb9d2d32, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } -#define GRUB_EFI_HCDP_TABLE_GUID \ +#define VasEBoot_EFI_HCDP_TABLE_GUID \ { 0xf951938d, 0x620b, 0x42ef, \ { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \ } -#define GRUB_EFI_DEVICE_TREE_GUID \ +#define VasEBoot_EFI_DEVICE_TREE_GUID \ { 0xb1b621d5, 0xf19c, 0x41a5, \ { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \ } -#define GRUB_EFI_VENDOR_APPLE_GUID \ +#define VasEBoot_EFI_VENDOR_APPLE_GUID \ { 0x2B0585EB, 0xD8B8, 0x49A9, \ { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ } -struct grub_efi_sal_system_table +struct VasEBoot_efi_sal_system_table { - grub_uint32_t signature; - grub_uint32_t total_table_len; - grub_uint16_t sal_rev; - grub_uint16_t entry_count; - grub_uint8_t checksum; - grub_uint8_t reserved1[7]; - grub_uint16_t sal_a_version; - grub_uint16_t sal_b_version; - grub_uint8_t oem_id[32]; - grub_uint8_t product_id[32]; - grub_uint8_t reserved2[8]; - grub_uint8_t entries[0]; + VasEBoot_uint32_t signature; + VasEBoot_uint32_t total_table_len; + VasEBoot_uint16_t sal_rev; + VasEBoot_uint16_t entry_count; + VasEBoot_uint8_t checksum; + VasEBoot_uint8_t reserved1[7]; + VasEBoot_uint16_t sal_a_version; + VasEBoot_uint16_t sal_b_version; + VasEBoot_uint8_t oem_id[32]; + VasEBoot_uint8_t product_id[32]; + VasEBoot_uint8_t reserved2[8]; + VasEBoot_uint8_t entries[0]; }; enum { - GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR = 0, - GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR = 1, - GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES = 2, - GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR = 3, - GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE = 4, - GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP = 5 + VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR = 0, + VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR = 1, + VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES = 2, + VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR = 3, + VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE = 4, + VasEBoot_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP = 5 }; -struct grub_efi_sal_system_table_entrypoint_descriptor +struct VasEBoot_efi_sal_system_table_entrypoint_descriptor { - grub_uint8_t type; - grub_uint8_t pad[7]; - grub_uint64_t pal_proc_addr; - grub_uint64_t sal_proc_addr; - grub_uint64_t global_data_ptr; - grub_uint64_t reserved[2]; + VasEBoot_uint8_t type; + VasEBoot_uint8_t pad[7]; + VasEBoot_uint64_t pal_proc_addr; + VasEBoot_uint64_t sal_proc_addr; + VasEBoot_uint64_t global_data_ptr; + VasEBoot_uint64_t reserved[2]; }; -struct grub_efi_sal_system_table_memory_descriptor +struct VasEBoot_efi_sal_system_table_memory_descriptor { - grub_uint8_t type; - grub_uint8_t sal_used; - grub_uint8_t attr; - grub_uint8_t ar; - grub_uint8_t attr_mask; - grub_uint8_t mem_type; - grub_uint8_t usage; - grub_uint8_t unknown; - grub_uint64_t addr; - grub_uint64_t len; - grub_uint64_t unknown2; + VasEBoot_uint8_t type; + VasEBoot_uint8_t sal_used; + VasEBoot_uint8_t attr; + VasEBoot_uint8_t ar; + VasEBoot_uint8_t attr_mask; + VasEBoot_uint8_t mem_type; + VasEBoot_uint8_t usage; + VasEBoot_uint8_t unknown; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t len; + VasEBoot_uint64_t unknown2; }; -struct grub_efi_sal_system_table_platform_features +struct VasEBoot_efi_sal_system_table_platform_features { - grub_uint8_t type; - grub_uint8_t flags; - grub_uint8_t reserved[14]; + VasEBoot_uint8_t type; + VasEBoot_uint8_t flags; + VasEBoot_uint8_t reserved[14]; }; -struct grub_efi_sal_system_table_translation_register_descriptor +struct VasEBoot_efi_sal_system_table_translation_register_descriptor { - grub_uint8_t type; - grub_uint8_t register_type; - grub_uint8_t register_number; - grub_uint8_t reserved[5]; - grub_uint64_t addr; - grub_uint64_t page_size; - grub_uint64_t reserver; + VasEBoot_uint8_t type; + VasEBoot_uint8_t register_type; + VasEBoot_uint8_t register_number; + VasEBoot_uint8_t reserved[5]; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t page_size; + VasEBoot_uint64_t reserver; }; -struct grub_efi_sal_system_table_purge_translation_coherence +struct VasEBoot_efi_sal_system_table_purge_translation_coherence { - grub_uint8_t type; - grub_uint8_t reserved[3]; - grub_uint32_t ndomains; - grub_uint64_t coherence; + VasEBoot_uint8_t type; + VasEBoot_uint8_t reserved[3]; + VasEBoot_uint32_t ndomains; + VasEBoot_uint64_t coherence; }; -struct grub_efi_sal_system_table_ap_wakeup +struct VasEBoot_efi_sal_system_table_ap_wakeup { - grub_uint8_t type; - grub_uint8_t mechanism; - grub_uint8_t reserved[6]; - grub_uint64_t vector; + VasEBoot_uint8_t type; + VasEBoot_uint8_t mechanism; + VasEBoot_uint8_t reserved[6]; + VasEBoot_uint64_t vector; }; enum { - GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK = 1, - GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT = 2, - GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT = 4, - GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT = 8, + VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK = 1, + VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT = 2, + VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT = 4, + VasEBoot_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT = 8, }; -typedef enum grub_efi_parity_type +typedef enum VasEBoot_efi_parity_type { - GRUB_EFI_SERIAL_DEFAULT_PARITY, - GRUB_EFI_SERIAL_NO_PARITY, - GRUB_EFI_SERIAL_EVEN_PARITY, - GRUB_EFI_SERIAL_ODD_PARITY + VasEBoot_EFI_SERIAL_DEFAULT_PARITY, + VasEBoot_EFI_SERIAL_NO_PARITY, + VasEBoot_EFI_SERIAL_EVEN_PARITY, + VasEBoot_EFI_SERIAL_ODD_PARITY } -grub_efi_parity_type_t; +VasEBoot_efi_parity_type_t; -typedef enum grub_efi_stop_bits +typedef enum VasEBoot_efi_stop_bits { - GRUB_EFI_SERIAL_DEFAULT_STOP_BITS, - GRUB_EFI_SERIAL_1_STOP_BIT, - GRUB_EFI_SERIAL_1_5_STOP_BITS, - GRUB_EFI_SERIAL_2_STOP_BITS + VasEBoot_EFI_SERIAL_DEFAULT_STOP_BITS, + VasEBoot_EFI_SERIAL_1_STOP_BIT, + VasEBoot_EFI_SERIAL_1_5_STOP_BITS, + VasEBoot_EFI_SERIAL_2_STOP_BITS } - grub_efi_stop_bits_t; + VasEBoot_efi_stop_bits_t; /* Enumerations. */ -enum grub_efi_timer_delay +enum VasEBoot_efi_timer_delay { - GRUB_EFI_TIMER_CANCEL, - GRUB_EFI_TIMER_PERIODIC, - GRUB_EFI_TIMER_RELATIVE + VasEBoot_EFI_TIMER_CANCEL, + VasEBoot_EFI_TIMER_PERIODIC, + VasEBoot_EFI_TIMER_RELATIVE }; -typedef enum grub_efi_timer_delay grub_efi_timer_delay_t; +typedef enum VasEBoot_efi_timer_delay VasEBoot_efi_timer_delay_t; -enum grub_efi_allocate_type +enum VasEBoot_efi_allocate_type { - GRUB_EFI_ALLOCATE_ANY_PAGES, - GRUB_EFI_ALLOCATE_MAX_ADDRESS, - GRUB_EFI_ALLOCATE_ADDRESS, - GRUB_EFI_MAX_ALLOCATION_TYPE + VasEBoot_EFI_ALLOCATE_ANY_PAGES, + VasEBoot_EFI_ALLOCATE_MAX_ADDRESS, + VasEBoot_EFI_ALLOCATE_ADDRESS, + VasEBoot_EFI_MAX_ALLOCATION_TYPE }; -typedef enum grub_efi_allocate_type grub_efi_allocate_type_t; +typedef enum VasEBoot_efi_allocate_type VasEBoot_efi_allocate_type_t; -enum grub_efi_memory_type +enum VasEBoot_efi_memory_type { - GRUB_EFI_RESERVED_MEMORY_TYPE, - GRUB_EFI_LOADER_CODE, - GRUB_EFI_LOADER_DATA, - GRUB_EFI_BOOT_SERVICES_CODE, - GRUB_EFI_BOOT_SERVICES_DATA, - GRUB_EFI_RUNTIME_SERVICES_CODE, - GRUB_EFI_RUNTIME_SERVICES_DATA, - GRUB_EFI_CONVENTIONAL_MEMORY, - GRUB_EFI_UNUSABLE_MEMORY, - GRUB_EFI_ACPI_RECLAIM_MEMORY, - GRUB_EFI_ACPI_MEMORY_NVS, - GRUB_EFI_MEMORY_MAPPED_IO, - GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, - GRUB_EFI_PAL_CODE, - GRUB_EFI_PERSISTENT_MEMORY, - GRUB_EFI_MAX_MEMORY_TYPE + VasEBoot_EFI_RESERVED_MEMORY_TYPE, + VasEBoot_EFI_LOADER_CODE, + VasEBoot_EFI_LOADER_DATA, + VasEBoot_EFI_BOOT_SERVICES_CODE, + VasEBoot_EFI_BOOT_SERVICES_DATA, + VasEBoot_EFI_RUNTIME_SERVICES_CODE, + VasEBoot_EFI_RUNTIME_SERVICES_DATA, + VasEBoot_EFI_CONVENTIONAL_MEMORY, + VasEBoot_EFI_UNUSABLE_MEMORY, + VasEBoot_EFI_ACPI_RECLAIM_MEMORY, + VasEBoot_EFI_ACPI_MEMORY_NVS, + VasEBoot_EFI_MEMORY_MAPPED_IO, + VasEBoot_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + VasEBoot_EFI_PAL_CODE, + VasEBoot_EFI_PERSISTENT_MEMORY, + VasEBoot_EFI_MAX_MEMORY_TYPE }; -typedef enum grub_efi_memory_type grub_efi_memory_type_t; +typedef enum VasEBoot_efi_memory_type VasEBoot_efi_memory_type_t; -enum grub_efi_interface_type +enum VasEBoot_efi_interface_type { - GRUB_EFI_NATIVE_INTERFACE + VasEBoot_EFI_NATIVE_INTERFACE }; -typedef enum grub_efi_interface_type grub_efi_interface_type_t; +typedef enum VasEBoot_efi_interface_type VasEBoot_efi_interface_type_t; -enum grub_efi_locate_search_type +enum VasEBoot_efi_locate_search_type { - GRUB_EFI_ALL_HANDLES, - GRUB_EFI_BY_REGISTER_NOTIFY, - GRUB_EFI_BY_PROTOCOL + VasEBoot_EFI_ALL_HANDLES, + VasEBoot_EFI_BY_REGISTER_NOTIFY, + VasEBoot_EFI_BY_PROTOCOL }; -typedef enum grub_efi_locate_search_type grub_efi_locate_search_type_t; +typedef enum VasEBoot_efi_locate_search_type VasEBoot_efi_locate_search_type_t; -enum grub_efi_reset_type +enum VasEBoot_efi_reset_type { - GRUB_EFI_RESET_COLD, - GRUB_EFI_RESET_WARM, - GRUB_EFI_RESET_SHUTDOWN + VasEBoot_EFI_RESET_COLD, + VasEBoot_EFI_RESET_WARM, + VasEBoot_EFI_RESET_SHUTDOWN }; -typedef enum grub_efi_reset_type grub_efi_reset_type_t; +typedef enum VasEBoot_efi_reset_type VasEBoot_efi_reset_type_t; /* Types. */ -typedef char grub_efi_boolean_t; -#if GRUB_CPU_SIZEOF_VOID_P == 8 -typedef grub_int64_t grub_efi_intn_t; -typedef grub_uint64_t grub_efi_uintn_t; +typedef char VasEBoot_efi_boolean_t; +#if VasEBoot_CPU_SIZEOF_VOID_P == 8 +typedef VasEBoot_int64_t VasEBoot_efi_intn_t; +typedef VasEBoot_uint64_t VasEBoot_efi_uintn_t; #else -typedef grub_int32_t grub_efi_intn_t; -typedef grub_uint32_t grub_efi_uintn_t; +typedef VasEBoot_int32_t VasEBoot_efi_intn_t; +typedef VasEBoot_uint32_t VasEBoot_efi_uintn_t; #endif -typedef grub_int8_t grub_efi_int8_t; -typedef grub_uint8_t grub_efi_uint8_t; -typedef grub_int16_t grub_efi_int16_t; -typedef grub_uint16_t grub_efi_uint16_t; -typedef grub_int32_t grub_efi_int32_t; -typedef grub_uint32_t grub_efi_uint32_t; -typedef grub_int64_t grub_efi_int64_t; -typedef grub_uint64_t grub_efi_uint64_t; -typedef grub_uint8_t grub_efi_char8_t; -typedef grub_uint16_t grub_efi_char16_t; +typedef VasEBoot_int8_t VasEBoot_efi_int8_t; +typedef VasEBoot_uint8_t VasEBoot_efi_uint8_t; +typedef VasEBoot_int16_t VasEBoot_efi_int16_t; +typedef VasEBoot_uint16_t VasEBoot_efi_uint16_t; +typedef VasEBoot_int32_t VasEBoot_efi_int32_t; +typedef VasEBoot_uint32_t VasEBoot_efi_uint32_t; +typedef VasEBoot_int64_t VasEBoot_efi_int64_t; +typedef VasEBoot_uint64_t VasEBoot_efi_uint64_t; +typedef VasEBoot_uint8_t VasEBoot_efi_char8_t; +typedef VasEBoot_uint16_t VasEBoot_efi_char16_t; -typedef grub_efi_intn_t grub_efi_status_t; +typedef VasEBoot_efi_intn_t VasEBoot_efi_status_t; -#define GRUB_EFI_ERROR_CODE(value) \ - ((((grub_efi_status_t) 1) << (sizeof (grub_efi_status_t) * 8 - 1)) | (value)) +#define VasEBoot_EFI_ERROR_CODE(value) \ + ((((VasEBoot_efi_status_t) 1) << (sizeof (VasEBoot_efi_status_t) * 8 - 1)) | (value)) -#define GRUB_EFI_WARNING_CODE(value) (value) +#define VasEBoot_EFI_WARNING_CODE(value) (value) -#define GRUB_EFI_SUCCESS 0 +#define VasEBoot_EFI_SUCCESS 0 -#define GRUB_EFI_LOAD_ERROR GRUB_EFI_ERROR_CODE (1) -#define GRUB_EFI_INVALID_PARAMETER GRUB_EFI_ERROR_CODE (2) -#define GRUB_EFI_UNSUPPORTED GRUB_EFI_ERROR_CODE (3) -#define GRUB_EFI_BAD_BUFFER_SIZE GRUB_EFI_ERROR_CODE (4) -#define GRUB_EFI_BUFFER_TOO_SMALL GRUB_EFI_ERROR_CODE (5) -#define GRUB_EFI_NOT_READY GRUB_EFI_ERROR_CODE (6) -#define GRUB_EFI_DEVICE_ERROR GRUB_EFI_ERROR_CODE (7) -#define GRUB_EFI_WRITE_PROTECTED GRUB_EFI_ERROR_CODE (8) -#define GRUB_EFI_OUT_OF_RESOURCES GRUB_EFI_ERROR_CODE (9) -#define GRUB_EFI_VOLUME_CORRUPTED GRUB_EFI_ERROR_CODE (10) -#define GRUB_EFI_VOLUME_FULL GRUB_EFI_ERROR_CODE (11) -#define GRUB_EFI_NO_MEDIA GRUB_EFI_ERROR_CODE (12) -#define GRUB_EFI_MEDIA_CHANGED GRUB_EFI_ERROR_CODE (13) -#define GRUB_EFI_NOT_FOUND GRUB_EFI_ERROR_CODE (14) -#define GRUB_EFI_ACCESS_DENIED GRUB_EFI_ERROR_CODE (15) -#define GRUB_EFI_NO_RESPONSE GRUB_EFI_ERROR_CODE (16) -#define GRUB_EFI_NO_MAPPING GRUB_EFI_ERROR_CODE (17) -#define GRUB_EFI_TIMEOUT GRUB_EFI_ERROR_CODE (18) -#define GRUB_EFI_NOT_STARTED GRUB_EFI_ERROR_CODE (19) -#define GRUB_EFI_ALREADY_STARTED GRUB_EFI_ERROR_CODE (20) -#define GRUB_EFI_ABORTED GRUB_EFI_ERROR_CODE (21) -#define GRUB_EFI_ICMP_ERROR GRUB_EFI_ERROR_CODE (22) -#define GRUB_EFI_TFTP_ERROR GRUB_EFI_ERROR_CODE (23) -#define GRUB_EFI_PROTOCOL_ERROR GRUB_EFI_ERROR_CODE (24) -#define GRUB_EFI_INCOMPATIBLE_VERSION GRUB_EFI_ERROR_CODE (25) -#define GRUB_EFI_SECURITY_VIOLATION GRUB_EFI_ERROR_CODE (26) -#define GRUB_EFI_CRC_ERROR GRUB_EFI_ERROR_CODE (27) +#define VasEBoot_EFI_LOAD_ERROR VasEBoot_EFI_ERROR_CODE (1) +#define VasEBoot_EFI_INVALID_PARAMETER VasEBoot_EFI_ERROR_CODE (2) +#define VasEBoot_EFI_UNSUPPORTED VasEBoot_EFI_ERROR_CODE (3) +#define VasEBoot_EFI_BAD_BUFFER_SIZE VasEBoot_EFI_ERROR_CODE (4) +#define VasEBoot_EFI_BUFFER_TOO_SMALL VasEBoot_EFI_ERROR_CODE (5) +#define VasEBoot_EFI_NOT_READY VasEBoot_EFI_ERROR_CODE (6) +#define VasEBoot_EFI_DEVICE_ERROR VasEBoot_EFI_ERROR_CODE (7) +#define VasEBoot_EFI_WRITE_PROTECTED VasEBoot_EFI_ERROR_CODE (8) +#define VasEBoot_EFI_OUT_OF_RESOURCES VasEBoot_EFI_ERROR_CODE (9) +#define VasEBoot_EFI_VOLUME_CORRUPTED VasEBoot_EFI_ERROR_CODE (10) +#define VasEBoot_EFI_VOLUME_FULL VasEBoot_EFI_ERROR_CODE (11) +#define VasEBoot_EFI_NO_MEDIA VasEBoot_EFI_ERROR_CODE (12) +#define VasEBoot_EFI_MEDIA_CHANGED VasEBoot_EFI_ERROR_CODE (13) +#define VasEBoot_EFI_NOT_FOUND VasEBoot_EFI_ERROR_CODE (14) +#define VasEBoot_EFI_ACCESS_DENIED VasEBoot_EFI_ERROR_CODE (15) +#define VasEBoot_EFI_NO_RESPONSE VasEBoot_EFI_ERROR_CODE (16) +#define VasEBoot_EFI_NO_MAPPING VasEBoot_EFI_ERROR_CODE (17) +#define VasEBoot_EFI_TIMEOUT VasEBoot_EFI_ERROR_CODE (18) +#define VasEBoot_EFI_NOT_STARTED VasEBoot_EFI_ERROR_CODE (19) +#define VasEBoot_EFI_ALREADY_STARTED VasEBoot_EFI_ERROR_CODE (20) +#define VasEBoot_EFI_ABORTED VasEBoot_EFI_ERROR_CODE (21) +#define VasEBoot_EFI_ICMP_ERROR VasEBoot_EFI_ERROR_CODE (22) +#define VasEBoot_EFI_TFTP_ERROR VasEBoot_EFI_ERROR_CODE (23) +#define VasEBoot_EFI_PROTOCOL_ERROR VasEBoot_EFI_ERROR_CODE (24) +#define VasEBoot_EFI_INCOMPATIBLE_VERSION VasEBoot_EFI_ERROR_CODE (25) +#define VasEBoot_EFI_SECURITY_VIOLATION VasEBoot_EFI_ERROR_CODE (26) +#define VasEBoot_EFI_CRC_ERROR VasEBoot_EFI_ERROR_CODE (27) -#define GRUB_EFI_WARN_UNKNOWN_GLYPH GRUB_EFI_WARNING_CODE (1) -#define GRUB_EFI_WARN_DELETE_FAILURE GRUB_EFI_WARNING_CODE (2) -#define GRUB_EFI_WARN_WRITE_FAILURE GRUB_EFI_WARNING_CODE (3) -#define GRUB_EFI_WARN_BUFFER_TOO_SMALL GRUB_EFI_WARNING_CODE (4) +#define VasEBoot_EFI_WARN_UNKNOWN_GLYPH VasEBoot_EFI_WARNING_CODE (1) +#define VasEBoot_EFI_WARN_DELETE_FAILURE VasEBoot_EFI_WARNING_CODE (2) +#define VasEBoot_EFI_WARN_WRITE_FAILURE VasEBoot_EFI_WARNING_CODE (3) +#define VasEBoot_EFI_WARN_BUFFER_TOO_SMALL VasEBoot_EFI_WARNING_CODE (4) -typedef void *grub_efi_handle_t; -typedef void *grub_efi_event_t; -typedef grub_efi_uint64_t grub_efi_lba_t; -typedef grub_efi_uintn_t grub_efi_tpl_t; -typedef grub_uint8_t grub_efi_mac_address_t[32]; -typedef grub_uint8_t grub_efi_ipv4_address_t[4]; -typedef grub_uint16_t grub_efi_ipv6_address_t[8]; -typedef grub_uint8_t grub_efi_ip_address_t[8] __attribute__ ((aligned(4))); -typedef grub_efi_uint64_t grub_efi_physical_address_t; -typedef grub_efi_uint64_t grub_efi_virtual_address_t; +typedef void *VasEBoot_efi_handle_t; +typedef void *VasEBoot_efi_event_t; +typedef VasEBoot_efi_uint64_t VasEBoot_efi_lba_t; +typedef VasEBoot_efi_uintn_t VasEBoot_efi_tpl_t; +typedef VasEBoot_uint8_t VasEBoot_efi_mac_address_t[32]; +typedef VasEBoot_uint8_t VasEBoot_efi_ipv4_address_t[4]; +typedef VasEBoot_uint16_t VasEBoot_efi_ipv6_address_t[8]; +typedef VasEBoot_uint8_t VasEBoot_efi_ip_address_t[8] __attribute__ ((aligned(4))); +typedef VasEBoot_efi_uint64_t VasEBoot_efi_physical_address_t; +typedef VasEBoot_efi_uint64_t VasEBoot_efi_virtual_address_t; -struct grub_efi_guid +struct VasEBoot_efi_guid { - grub_uint32_t data1; - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; + VasEBoot_uint32_t data1; + VasEBoot_uint16_t data2; + VasEBoot_uint16_t data3; + VasEBoot_uint8_t data4[8]; } __attribute__ ((aligned(8))); -typedef struct grub_efi_guid grub_efi_guid_t; +typedef struct VasEBoot_efi_guid VasEBoot_efi_guid_t; -struct grub_efi_packed_guid +struct VasEBoot_efi_packed_guid { - grub_uint32_t data1; - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; -} GRUB_PACKED; -typedef struct grub_efi_packed_guid grub_efi_packed_guid_t; + VasEBoot_uint32_t data1; + VasEBoot_uint16_t data2; + VasEBoot_uint16_t data3; + VasEBoot_uint8_t data4[8]; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_packed_guid VasEBoot_efi_packed_guid_t; /* XXX although the spec does not specify the padding, this actually must have the padding! */ -struct grub_efi_memory_descriptor +struct VasEBoot_efi_memory_descriptor { - grub_efi_uint32_t type; - grub_efi_uint32_t padding; - grub_efi_physical_address_t physical_start; - grub_efi_virtual_address_t virtual_start; - grub_efi_uint64_t num_pages; - grub_efi_uint64_t attribute; -} GRUB_PACKED; -typedef struct grub_efi_memory_descriptor grub_efi_memory_descriptor_t; + VasEBoot_efi_uint32_t type; + VasEBoot_efi_uint32_t padding; + VasEBoot_efi_physical_address_t physical_start; + VasEBoot_efi_virtual_address_t virtual_start; + VasEBoot_efi_uint64_t num_pages; + VasEBoot_efi_uint64_t attribute; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_memory_descriptor VasEBoot_efi_memory_descriptor_t; /* Device Path definitions. */ -struct grub_efi_device_path +struct VasEBoot_efi_device_path { - grub_efi_uint8_t type; - grub_efi_uint8_t subtype; - grub_efi_uint16_t length; -} GRUB_PACKED; -typedef struct grub_efi_device_path grub_efi_device_path_t; + VasEBoot_efi_uint8_t type; + VasEBoot_efi_uint8_t subtype; + VasEBoot_efi_uint16_t length; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_device_path VasEBoot_efi_device_path_t; /* XXX EFI does not define EFI_DEVICE_PATH_PROTOCOL but uses it. It seems to be identical to EFI_DEVICE_PATH. */ -typedef struct grub_efi_device_path grub_efi_device_path_protocol_t; +typedef struct VasEBoot_efi_device_path VasEBoot_efi_device_path_protocol_t; -#define GRUB_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f) -#define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype) -#define GRUB_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length) +#define VasEBoot_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f) +#define VasEBoot_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype) +#define VasEBoot_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length) /* The End of Device Path nodes. */ -#define GRUB_EFI_END_DEVICE_PATH_TYPE (0xff & 0x7f) +#define VasEBoot_EFI_END_DEVICE_PATH_TYPE (0xff & 0x7f) -#define GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff -#define GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE 0x01 +#define VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff +#define VasEBoot_EFI_END_THIS_DEVICE_PATH_SUBTYPE 0x01 -#define GRUB_EFI_END_ENTIRE_DEVICE_PATH(dp) \ - (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_END_DEVICE_PATH_TYPE \ - && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) \ - == GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)) +#define VasEBoot_EFI_END_ENTIRE_DEVICE_PATH(dp) \ + (VasEBoot_EFI_DEVICE_PATH_TYPE (dp) == VasEBoot_EFI_END_DEVICE_PATH_TYPE \ + && (VasEBoot_EFI_DEVICE_PATH_SUBTYPE (dp) \ + == VasEBoot_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)) -#define GRUB_EFI_NEXT_DEVICE_PATH(dp) \ - ((grub_efi_device_path_t *) ((char *) (dp) \ - + GRUB_EFI_DEVICE_PATH_LENGTH (dp))) +#define VasEBoot_EFI_NEXT_DEVICE_PATH(dp) \ + ((VasEBoot_efi_device_path_t *) ((char *) (dp) \ + + VasEBoot_EFI_DEVICE_PATH_LENGTH (dp))) /* Hardware Device Path. */ -#define GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE 1 +#define VasEBoot_EFI_HARDWARE_DEVICE_PATH_TYPE 1 -#define GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE 1 +#define VasEBoot_EFI_PCI_DEVICE_PATH_SUBTYPE 1 -struct grub_efi_pci_device_path +struct VasEBoot_efi_pci_device_path { - grub_efi_device_path_t header; - grub_efi_uint8_t function; - grub_efi_uint8_t device; -} GRUB_PACKED; -typedef struct grub_efi_pci_device_path grub_efi_pci_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint8_t function; + VasEBoot_efi_uint8_t device; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_pci_device_path VasEBoot_efi_pci_device_path_t; -#define GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE 2 +#define VasEBoot_EFI_PCCARD_DEVICE_PATH_SUBTYPE 2 -struct grub_efi_pccard_device_path +struct VasEBoot_efi_pccard_device_path { - grub_efi_device_path_t header; - grub_efi_uint8_t function; -} GRUB_PACKED; -typedef struct grub_efi_pccard_device_path grub_efi_pccard_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint8_t function; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_pccard_device_path VasEBoot_efi_pccard_device_path_t; -#define GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE 3 +#define VasEBoot_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE 3 -struct grub_efi_memory_mapped_device_path +struct VasEBoot_efi_memory_mapped_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t memory_type; - grub_efi_physical_address_t start_address; - grub_efi_physical_address_t end_address; -} GRUB_PACKED; -typedef struct grub_efi_memory_mapped_device_path grub_efi_memory_mapped_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t memory_type; + VasEBoot_efi_physical_address_t start_address; + VasEBoot_efi_physical_address_t end_address; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_memory_mapped_device_path VasEBoot_efi_memory_mapped_device_path_t; -#define GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE 4 +#define VasEBoot_EFI_VENDOR_DEVICE_PATH_SUBTYPE 4 -struct grub_efi_vendor_device_path +struct VasEBoot_efi_vendor_device_path { - grub_efi_device_path_t header; - grub_efi_packed_guid_t vendor_guid; - grub_efi_uint8_t vendor_defined_data[0]; -} GRUB_PACKED; -typedef struct grub_efi_vendor_device_path grub_efi_vendor_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_packed_guid_t vendor_guid; + VasEBoot_efi_uint8_t vendor_defined_data[0]; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_vendor_device_path VasEBoot_efi_vendor_device_path_t; -#define GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE 5 +#define VasEBoot_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE 5 -struct grub_efi_controller_device_path +struct VasEBoot_efi_controller_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t controller_number; -} GRUB_PACKED; -typedef struct grub_efi_controller_device_path grub_efi_controller_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t controller_number; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_controller_device_path VasEBoot_efi_controller_device_path_t; /* ACPI Device Path. */ -#define GRUB_EFI_ACPI_DEVICE_PATH_TYPE 2 +#define VasEBoot_EFI_ACPI_DEVICE_PATH_TYPE 2 -#define GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE 1 +#define VasEBoot_EFI_ACPI_DEVICE_PATH_SUBTYPE 1 -struct grub_efi_acpi_device_path +struct VasEBoot_efi_acpi_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t hid; - grub_efi_uint32_t uid; -} GRUB_PACKED; -typedef struct grub_efi_acpi_device_path grub_efi_acpi_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t hid; + VasEBoot_efi_uint32_t uid; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_acpi_device_path VasEBoot_efi_acpi_device_path_t; -#define GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE 2 +#define VasEBoot_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE 2 -struct grub_efi_expanded_acpi_device_path +struct VasEBoot_efi_expanded_acpi_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t hid; - grub_efi_uint32_t uid; - grub_efi_uint32_t cid; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t hid; + VasEBoot_efi_uint32_t uid; + VasEBoot_efi_uint32_t cid; char hidstr[0]; -} GRUB_PACKED; -typedef struct grub_efi_expanded_acpi_device_path grub_efi_expanded_acpi_device_path_t; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_expanded_acpi_device_path VasEBoot_efi_expanded_acpi_device_path_t; -#define GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp) \ - (((grub_efi_expanded_acpi_device_path_t *) dp)->hidstr) -#define GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp) \ - (GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp) \ - + grub_strlen (GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp)) + 1) -#define GRUB_EFI_EXPANDED_ACPI_CIDSTR(dp) \ - (GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp) \ - + grub_strlen (GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp)) + 1) +#define VasEBoot_EFI_EXPANDED_ACPI_HIDSTR(dp) \ + (((VasEBoot_efi_expanded_acpi_device_path_t *) dp)->hidstr) +#define VasEBoot_EFI_EXPANDED_ACPI_UIDSTR(dp) \ + (VasEBoot_EFI_EXPANDED_ACPI_HIDSTR(dp) \ + + VasEBoot_strlen (VasEBoot_EFI_EXPANDED_ACPI_HIDSTR(dp)) + 1) +#define VasEBoot_EFI_EXPANDED_ACPI_CIDSTR(dp) \ + (VasEBoot_EFI_EXPANDED_ACPI_UIDSTR(dp) \ + + VasEBoot_strlen (VasEBoot_EFI_EXPANDED_ACPI_UIDSTR(dp)) + 1) /* Messaging Device Path. */ -#define GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE 3 +#define VasEBoot_EFI_MESSAGING_DEVICE_PATH_TYPE 3 -#define GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE 1 +#define VasEBoot_EFI_ATAPI_DEVICE_PATH_SUBTYPE 1 -struct grub_efi_atapi_device_path +struct VasEBoot_efi_atapi_device_path { - grub_efi_device_path_t header; - grub_efi_uint8_t primary_secondary; - grub_efi_uint8_t slave_master; - grub_efi_uint16_t lun; -} GRUB_PACKED; -typedef struct grub_efi_atapi_device_path grub_efi_atapi_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint8_t primary_secondary; + VasEBoot_efi_uint8_t slave_master; + VasEBoot_efi_uint16_t lun; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_atapi_device_path VasEBoot_efi_atapi_device_path_t; -#define GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE 2 +#define VasEBoot_EFI_SCSI_DEVICE_PATH_SUBTYPE 2 -struct grub_efi_scsi_device_path +struct VasEBoot_efi_scsi_device_path { - grub_efi_device_path_t header; - grub_efi_uint16_t pun; - grub_efi_uint16_t lun; -} GRUB_PACKED; -typedef struct grub_efi_scsi_device_path grub_efi_scsi_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint16_t pun; + VasEBoot_efi_uint16_t lun; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_scsi_device_path VasEBoot_efi_scsi_device_path_t; -#define GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE 3 +#define VasEBoot_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE 3 -struct grub_efi_fibre_channel_device_path +struct VasEBoot_efi_fibre_channel_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t reserved; - grub_efi_uint64_t wwn; - grub_efi_uint64_t lun; -} GRUB_PACKED; -typedef struct grub_efi_fibre_channel_device_path grub_efi_fibre_channel_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t reserved; + VasEBoot_efi_uint64_t wwn; + VasEBoot_efi_uint64_t lun; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_fibre_channel_device_path VasEBoot_efi_fibre_channel_device_path_t; -#define GRUB_EFI_1394_DEVICE_PATH_SUBTYPE 4 +#define VasEBoot_EFI_1394_DEVICE_PATH_SUBTYPE 4 -struct grub_efi_1394_device_path +struct VasEBoot_efi_1394_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t reserved; - grub_efi_uint64_t guid; -} GRUB_PACKED; -typedef struct grub_efi_1394_device_path grub_efi_1394_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t reserved; + VasEBoot_efi_uint64_t guid; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_1394_device_path VasEBoot_efi_1394_device_path_t; -#define GRUB_EFI_USB_DEVICE_PATH_SUBTYPE 5 +#define VasEBoot_EFI_USB_DEVICE_PATH_SUBTYPE 5 -struct grub_efi_usb_device_path +struct VasEBoot_efi_usb_device_path { - grub_efi_device_path_t header; - grub_efi_uint8_t parent_port_number; - grub_efi_uint8_t usb_interface; -} GRUB_PACKED; -typedef struct grub_efi_usb_device_path grub_efi_usb_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint8_t parent_port_number; + VasEBoot_efi_uint8_t usb_interface; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_usb_device_path VasEBoot_efi_usb_device_path_t; -#define GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE 15 +#define VasEBoot_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE 15 -struct grub_efi_usb_class_device_path +struct VasEBoot_efi_usb_class_device_path { - grub_efi_device_path_t header; - grub_efi_uint16_t vendor_id; - grub_efi_uint16_t product_id; - grub_efi_uint8_t device_class; - grub_efi_uint8_t device_subclass; - grub_efi_uint8_t device_protocol; -} GRUB_PACKED; -typedef struct grub_efi_usb_class_device_path grub_efi_usb_class_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint16_t vendor_id; + VasEBoot_efi_uint16_t product_id; + VasEBoot_efi_uint8_t device_class; + VasEBoot_efi_uint8_t device_subclass; + VasEBoot_efi_uint8_t device_protocol; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_usb_class_device_path VasEBoot_efi_usb_class_device_path_t; -#define GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE 6 +#define VasEBoot_EFI_I2O_DEVICE_PATH_SUBTYPE 6 -struct grub_efi_i2o_device_path +struct VasEBoot_efi_i2o_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t tid; -} GRUB_PACKED; -typedef struct grub_efi_i2o_device_path grub_efi_i2o_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t tid; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_i2o_device_path VasEBoot_efi_i2o_device_path_t; -#define GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE 11 +#define VasEBoot_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE 11 -struct grub_efi_mac_address_device_path +struct VasEBoot_efi_mac_address_device_path { - grub_efi_device_path_t header; - grub_efi_mac_address_t mac_address; - grub_efi_uint8_t if_type; -} GRUB_PACKED; -typedef struct grub_efi_mac_address_device_path grub_efi_mac_address_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_mac_address_t mac_address; + VasEBoot_efi_uint8_t if_type; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_mac_address_device_path VasEBoot_efi_mac_address_device_path_t; -#define GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE 12 +#define VasEBoot_EFI_IPV4_DEVICE_PATH_SUBTYPE 12 -struct grub_efi_ipv4_device_path +struct VasEBoot_efi_ipv4_device_path { - grub_efi_device_path_t header; - grub_efi_ipv4_address_t local_ip_address; - grub_efi_ipv4_address_t remote_ip_address; - grub_efi_uint16_t local_port; - grub_efi_uint16_t remote_port; - grub_efi_uint16_t protocol; - grub_efi_uint8_t static_ip_address; -} GRUB_PACKED; -typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_ipv4_address_t local_ip_address; + VasEBoot_efi_ipv4_address_t remote_ip_address; + VasEBoot_efi_uint16_t local_port; + VasEBoot_efi_uint16_t remote_port; + VasEBoot_efi_uint16_t protocol; + VasEBoot_efi_uint8_t static_ip_address; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_ipv4_device_path VasEBoot_efi_ipv4_device_path_t; -#define GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE 13 +#define VasEBoot_EFI_IPV6_DEVICE_PATH_SUBTYPE 13 -struct grub_efi_ipv6_device_path +struct VasEBoot_efi_ipv6_device_path { - grub_efi_device_path_t header; - grub_efi_ipv6_address_t local_ip_address; - grub_efi_ipv6_address_t remote_ip_address; - grub_efi_uint16_t local_port; - grub_efi_uint16_t remote_port; - grub_efi_uint16_t protocol; - grub_efi_uint8_t static_ip_address; -} GRUB_PACKED; -typedef struct grub_efi_ipv6_device_path grub_efi_ipv6_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_ipv6_address_t local_ip_address; + VasEBoot_efi_ipv6_address_t remote_ip_address; + VasEBoot_efi_uint16_t local_port; + VasEBoot_efi_uint16_t remote_port; + VasEBoot_efi_uint16_t protocol; + VasEBoot_efi_uint8_t static_ip_address; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_ipv6_device_path VasEBoot_efi_ipv6_device_path_t; -#define GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE 9 +#define VasEBoot_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE 9 -struct grub_efi_infiniband_device_path +struct VasEBoot_efi_infiniband_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t resource_flags; - grub_efi_uint8_t port_gid[16]; - grub_efi_uint64_t remote_id; - grub_efi_uint64_t target_port_id; - grub_efi_uint64_t device_id; -} GRUB_PACKED; -typedef struct grub_efi_infiniband_device_path grub_efi_infiniband_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t resource_flags; + VasEBoot_efi_uint8_t port_gid[16]; + VasEBoot_efi_uint64_t remote_id; + VasEBoot_efi_uint64_t target_port_id; + VasEBoot_efi_uint64_t device_id; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_infiniband_device_path VasEBoot_efi_infiniband_device_path_t; -#define GRUB_EFI_UART_DEVICE_PATH_SUBTYPE 14 +#define VasEBoot_EFI_UART_DEVICE_PATH_SUBTYPE 14 -struct grub_efi_uart_device_path +struct VasEBoot_efi_uart_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t reserved; - grub_efi_uint64_t baud_rate; - grub_efi_uint8_t data_bits; - grub_efi_uint8_t parity; - grub_efi_uint8_t stop_bits; -} GRUB_PACKED; -typedef struct grub_efi_uart_device_path grub_efi_uart_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t reserved; + VasEBoot_efi_uint64_t baud_rate; + VasEBoot_efi_uint8_t data_bits; + VasEBoot_efi_uint8_t parity; + VasEBoot_efi_uint8_t stop_bits; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_uart_device_path VasEBoot_efi_uart_device_path_t; -#define GRUB_EFI_SATA_DEVICE_PATH_SUBTYPE 18 +#define VasEBoot_EFI_SATA_DEVICE_PATH_SUBTYPE 18 -struct grub_efi_sata_device_path +struct VasEBoot_efi_sata_device_path { - grub_efi_device_path_t header; - grub_efi_uint16_t hba_port; - grub_efi_uint16_t multiplier_port; - grub_efi_uint16_t lun; -} GRUB_PACKED; -typedef struct grub_efi_sata_device_path grub_efi_sata_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint16_t hba_port; + VasEBoot_efi_uint16_t multiplier_port; + VasEBoot_efi_uint16_t lun; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_sata_device_path VasEBoot_efi_sata_device_path_t; -#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 +#define VasEBoot_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 /* Media Device Path. */ -#define GRUB_EFI_MEDIA_DEVICE_PATH_TYPE 4 +#define VasEBoot_EFI_MEDIA_DEVICE_PATH_TYPE 4 -#define GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE 1 +#define VasEBoot_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE 1 -struct grub_efi_hard_drive_device_path +struct VasEBoot_efi_hard_drive_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t partition_number; - grub_efi_lba_t partition_start; - grub_efi_lba_t partition_size; - grub_efi_uint8_t partition_signature[16]; - grub_efi_uint8_t partmap_type; - grub_efi_uint8_t signature_type; -} GRUB_PACKED; -typedef struct grub_efi_hard_drive_device_path grub_efi_hard_drive_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t partition_number; + VasEBoot_efi_lba_t partition_start; + VasEBoot_efi_lba_t partition_size; + VasEBoot_efi_uint8_t partition_signature[16]; + VasEBoot_efi_uint8_t partmap_type; + VasEBoot_efi_uint8_t signature_type; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_hard_drive_device_path VasEBoot_efi_hard_drive_device_path_t; -#define GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE 2 +#define VasEBoot_EFI_CDROM_DEVICE_PATH_SUBTYPE 2 -struct grub_efi_cdrom_device_path +struct VasEBoot_efi_cdrom_device_path { - grub_efi_device_path_t header; - grub_efi_uint32_t boot_entry; - grub_efi_lba_t partition_start; - grub_efi_lba_t partition_size; -} GRUB_PACKED; -typedef struct grub_efi_cdrom_device_path grub_efi_cdrom_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint32_t boot_entry; + VasEBoot_efi_lba_t partition_start; + VasEBoot_efi_lba_t partition_size; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_cdrom_device_path VasEBoot_efi_cdrom_device_path_t; -#define GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE 3 +#define VasEBoot_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE 3 -struct grub_efi_vendor_media_device_path +struct VasEBoot_efi_vendor_media_device_path { - grub_efi_device_path_t header; - grub_efi_packed_guid_t vendor_guid; - grub_efi_uint8_t vendor_defined_data[0]; -} GRUB_PACKED; -typedef struct grub_efi_vendor_media_device_path grub_efi_vendor_media_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_packed_guid_t vendor_guid; + VasEBoot_efi_uint8_t vendor_defined_data[0]; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_vendor_media_device_path VasEBoot_efi_vendor_media_device_path_t; -#define GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE 4 +#define VasEBoot_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE 4 -struct grub_efi_file_path_device_path +struct VasEBoot_efi_file_path_device_path { - grub_efi_device_path_t header; - grub_efi_char16_t path_name[0]; -} GRUB_PACKED; -typedef struct grub_efi_file_path_device_path grub_efi_file_path_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_char16_t path_name[0]; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_file_path_device_path VasEBoot_efi_file_path_device_path_t; -#define GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE 5 +#define VasEBoot_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE 5 -struct grub_efi_protocol_device_path +struct VasEBoot_efi_protocol_device_path { - grub_efi_device_path_t header; - grub_efi_packed_guid_t guid; -} GRUB_PACKED; -typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_packed_guid_t guid; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_protocol_device_path VasEBoot_efi_protocol_device_path_t; -#define GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE 6 +#define VasEBoot_EFI_PIWG_DEVICE_PATH_SUBTYPE 6 -struct grub_efi_piwg_device_path +struct VasEBoot_efi_piwg_device_path { - grub_efi_device_path_t header; - grub_efi_packed_guid_t guid; -} GRUB_PACKED; -typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_packed_guid_t guid; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_piwg_device_path VasEBoot_efi_piwg_device_path_t; /* BIOS Boot Specification Device Path. */ -#define GRUB_EFI_BIOS_DEVICE_PATH_TYPE 5 +#define VasEBoot_EFI_BIOS_DEVICE_PATH_TYPE 5 -#define GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE 1 +#define VasEBoot_EFI_BIOS_DEVICE_PATH_SUBTYPE 1 -struct grub_efi_bios_device_path +struct VasEBoot_efi_bios_device_path { - grub_efi_device_path_t header; - grub_efi_uint16_t device_type; - grub_efi_uint16_t status_flags; + VasEBoot_efi_device_path_t header; + VasEBoot_efi_uint16_t device_type; + VasEBoot_efi_uint16_t status_flags; char description[0]; -} GRUB_PACKED; -typedef struct grub_efi_bios_device_path grub_efi_bios_device_path_t; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_bios_device_path VasEBoot_efi_bios_device_path_t; -struct grub_efi_open_protocol_information_entry +struct VasEBoot_efi_open_protocol_information_entry { - grub_efi_handle_t agent_handle; - grub_efi_handle_t controller_handle; - grub_efi_uint32_t attributes; - grub_efi_uint32_t open_count; + VasEBoot_efi_handle_t agent_handle; + VasEBoot_efi_handle_t controller_handle; + VasEBoot_efi_uint32_t attributes; + VasEBoot_efi_uint32_t open_count; }; -typedef struct grub_efi_open_protocol_information_entry grub_efi_open_protocol_information_entry_t; +typedef struct VasEBoot_efi_open_protocol_information_entry VasEBoot_efi_open_protocol_information_entry_t; -struct grub_efi_time +struct VasEBoot_efi_time { - grub_efi_uint16_t year; - grub_efi_uint8_t month; - grub_efi_uint8_t day; - grub_efi_uint8_t hour; - grub_efi_uint8_t minute; - grub_efi_uint8_t second; - grub_efi_uint8_t pad1; - grub_efi_uint32_t nanosecond; - grub_efi_int16_t time_zone; - grub_efi_uint8_t daylight; - grub_efi_uint8_t pad2; -} GRUB_PACKED; -typedef struct grub_efi_time grub_efi_time_t; + VasEBoot_efi_uint16_t year; + VasEBoot_efi_uint8_t month; + VasEBoot_efi_uint8_t day; + VasEBoot_efi_uint8_t hour; + VasEBoot_efi_uint8_t minute; + VasEBoot_efi_uint8_t second; + VasEBoot_efi_uint8_t pad1; + VasEBoot_efi_uint32_t nanosecond; + VasEBoot_efi_int16_t time_zone; + VasEBoot_efi_uint8_t daylight; + VasEBoot_efi_uint8_t pad2; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_time VasEBoot_efi_time_t; -struct grub_efi_time_capabilities +struct VasEBoot_efi_time_capabilities { - grub_efi_uint32_t resolution; - grub_efi_uint32_t accuracy; - grub_efi_boolean_t sets_to_zero; + VasEBoot_efi_uint32_t resolution; + VasEBoot_efi_uint32_t accuracy; + VasEBoot_efi_boolean_t sets_to_zero; }; -typedef struct grub_efi_time_capabilities grub_efi_time_capabilities_t; +typedef struct VasEBoot_efi_time_capabilities VasEBoot_efi_time_capabilities_t; -struct grub_efi_input_key +struct VasEBoot_efi_input_key { - grub_efi_uint16_t scan_code; - grub_efi_char16_t unicode_char; + VasEBoot_efi_uint16_t scan_code; + VasEBoot_efi_char16_t unicode_char; }; -typedef struct grub_efi_input_key grub_efi_input_key_t; +typedef struct VasEBoot_efi_input_key VasEBoot_efi_input_key_t; -typedef grub_efi_uint8_t grub_efi_key_toggle_state_t; -struct grub_efi_key_state +typedef VasEBoot_efi_uint8_t VasEBoot_efi_key_toggle_state_t; +struct VasEBoot_efi_key_state { - grub_efi_uint32_t key_shift_state; - grub_efi_key_toggle_state_t key_toggle_state; + VasEBoot_efi_uint32_t key_shift_state; + VasEBoot_efi_key_toggle_state_t key_toggle_state; }; -typedef struct grub_efi_key_state grub_efi_key_state_t; +typedef struct VasEBoot_efi_key_state VasEBoot_efi_key_state_t; -#define GRUB_EFI_SHIFT_STATE_VALID 0x80000000 -#define GRUB_EFI_RIGHT_SHIFT_PRESSED 0x00000001 -#define GRUB_EFI_LEFT_SHIFT_PRESSED 0x00000002 -#define GRUB_EFI_RIGHT_CONTROL_PRESSED 0x00000004 -#define GRUB_EFI_LEFT_CONTROL_PRESSED 0x00000008 -#define GRUB_EFI_RIGHT_ALT_PRESSED 0x00000010 -#define GRUB_EFI_LEFT_ALT_PRESSED 0x00000020 -#define GRUB_EFI_RIGHT_LOGO_PRESSED 0x00000040 -#define GRUB_EFI_LEFT_LOGO_PRESSED 0x00000080 -#define GRUB_EFI_MENU_KEY_PRESSED 0x00000100 -#define GRUB_EFI_SYS_REQ_PRESSED 0x00000200 +#define VasEBoot_EFI_SHIFT_STATE_VALID 0x80000000 +#define VasEBoot_EFI_RIGHT_SHIFT_PRESSED 0x00000001 +#define VasEBoot_EFI_LEFT_SHIFT_PRESSED 0x00000002 +#define VasEBoot_EFI_RIGHT_CONTROL_PRESSED 0x00000004 +#define VasEBoot_EFI_LEFT_CONTROL_PRESSED 0x00000008 +#define VasEBoot_EFI_RIGHT_ALT_PRESSED 0x00000010 +#define VasEBoot_EFI_LEFT_ALT_PRESSED 0x00000020 +#define VasEBoot_EFI_RIGHT_LOGO_PRESSED 0x00000040 +#define VasEBoot_EFI_LEFT_LOGO_PRESSED 0x00000080 +#define VasEBoot_EFI_MENU_KEY_PRESSED 0x00000100 +#define VasEBoot_EFI_SYS_REQ_PRESSED 0x00000200 -#define GRUB_EFI_TOGGLE_STATE_VALID 0x80 -#define GRUB_EFI_KEY_STATE_EXPOSED 0x40 -#define GRUB_EFI_SCROLL_LOCK_ACTIVE 0x01 -#define GRUB_EFI_NUM_LOCK_ACTIVE 0x02 -#define GRUB_EFI_CAPS_LOCK_ACTIVE 0x04 +#define VasEBoot_EFI_TOGGLE_STATE_VALID 0x80 +#define VasEBoot_EFI_KEY_STATE_EXPOSED 0x40 +#define VasEBoot_EFI_SCROLL_LOCK_ACTIVE 0x01 +#define VasEBoot_EFI_NUM_LOCK_ACTIVE 0x02 +#define VasEBoot_EFI_CAPS_LOCK_ACTIVE 0x04 -struct grub_efi_simple_text_output_mode +struct VasEBoot_efi_simple_text_output_mode { - grub_efi_int32_t max_mode; - grub_efi_int32_t mode; - grub_efi_int32_t attribute; - grub_efi_int32_t cursor_column; - grub_efi_int32_t cursor_row; - grub_efi_boolean_t cursor_visible; + VasEBoot_efi_int32_t max_mode; + VasEBoot_efi_int32_t mode; + VasEBoot_efi_int32_t attribute; + VasEBoot_efi_int32_t cursor_column; + VasEBoot_efi_int32_t cursor_row; + VasEBoot_efi_boolean_t cursor_visible; }; -typedef struct grub_efi_simple_text_output_mode grub_efi_simple_text_output_mode_t; +typedef struct VasEBoot_efi_simple_text_output_mode VasEBoot_efi_simple_text_output_mode_t; /* Tables. */ -struct grub_efi_table_header +struct VasEBoot_efi_table_header { - grub_efi_uint64_t signature; - grub_efi_uint32_t revision; - grub_efi_uint32_t header_size; - grub_efi_uint32_t crc32; - grub_efi_uint32_t reserved; + VasEBoot_efi_uint64_t signature; + VasEBoot_efi_uint32_t revision; + VasEBoot_efi_uint32_t header_size; + VasEBoot_efi_uint32_t crc32; + VasEBoot_efi_uint32_t reserved; }; -typedef struct grub_efi_table_header grub_efi_table_header_t; +typedef struct VasEBoot_efi_table_header VasEBoot_efi_table_header_t; -struct grub_efi_boot_services +struct VasEBoot_efi_boot_services { - grub_efi_table_header_t hdr; + VasEBoot_efi_table_header_t hdr; - grub_efi_tpl_t - (*raise_tpl) (grub_efi_tpl_t new_tpl); + VasEBoot_efi_tpl_t + (*raise_tpl) (VasEBoot_efi_tpl_t new_tpl); void - (*restore_tpl) (grub_efi_tpl_t old_tpl); + (*restore_tpl) (VasEBoot_efi_tpl_t old_tpl); - grub_efi_status_t - (*allocate_pages) (grub_efi_allocate_type_t type, - grub_efi_memory_type_t memory_type, - grub_efi_uintn_t pages, - grub_efi_physical_address_t *memory); + VasEBoot_efi_status_t + (*allocate_pages) (VasEBoot_efi_allocate_type_t type, + VasEBoot_efi_memory_type_t memory_type, + VasEBoot_efi_uintn_t pages, + VasEBoot_efi_physical_address_t *memory); - grub_efi_status_t - (*free_pages) (grub_efi_physical_address_t memory, - grub_efi_uintn_t pages); + VasEBoot_efi_status_t + (*free_pages) (VasEBoot_efi_physical_address_t memory, + VasEBoot_efi_uintn_t pages); - grub_efi_status_t - (*get_memory_map) (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version); + VasEBoot_efi_status_t + (*get_memory_map) (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version); - grub_efi_status_t - (*allocate_pool) (grub_efi_memory_type_t pool_type, - grub_efi_uintn_t size, + VasEBoot_efi_status_t + (*allocate_pool) (VasEBoot_efi_memory_type_t pool_type, + VasEBoot_efi_uintn_t size, void **buffer); - grub_efi_status_t + VasEBoot_efi_status_t (*free_pool) (void *buffer); - grub_efi_status_t - (*create_event) (grub_efi_uint32_t type, - grub_efi_tpl_t notify_tpl, - void (*notify_function) (grub_efi_event_t event, + VasEBoot_efi_status_t + (*create_event) (VasEBoot_efi_uint32_t type, + VasEBoot_efi_tpl_t notify_tpl, + void (*notify_function) (VasEBoot_efi_event_t event, void *context), void *notify_context, - grub_efi_event_t *event); + VasEBoot_efi_event_t *event); - grub_efi_status_t - (*set_timer) (grub_efi_event_t event, - grub_efi_timer_delay_t type, - grub_efi_uint64_t trigger_time); + VasEBoot_efi_status_t + (*set_timer) (VasEBoot_efi_event_t event, + VasEBoot_efi_timer_delay_t type, + VasEBoot_efi_uint64_t trigger_time); - grub_efi_status_t - (*wait_for_event) (grub_efi_uintn_t num_events, - grub_efi_event_t *event, - grub_efi_uintn_t *index); + VasEBoot_efi_status_t + (*wait_for_event) (VasEBoot_efi_uintn_t num_events, + VasEBoot_efi_event_t *event, + VasEBoot_efi_uintn_t *index); - grub_efi_status_t - (*signal_event) (grub_efi_event_t event); + VasEBoot_efi_status_t + (*signal_event) (VasEBoot_efi_event_t event); - grub_efi_status_t - (*close_event) (grub_efi_event_t event); + VasEBoot_efi_status_t + (*close_event) (VasEBoot_efi_event_t event); - grub_efi_status_t - (*check_event) (grub_efi_event_t event); + VasEBoot_efi_status_t + (*check_event) (VasEBoot_efi_event_t event); - grub_efi_status_t - (*install_protocol_interface) (grub_efi_handle_t *handle, - grub_efi_guid_t *protocol, - grub_efi_interface_type_t protocol_interface_type, + VasEBoot_efi_status_t + (*install_protocol_interface) (VasEBoot_efi_handle_t *handle, + VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_interface_type_t protocol_interface_type, void *protocol_interface); - grub_efi_status_t - (*reinstall_protocol_interface) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*reinstall_protocol_interface) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, void *old_interface, void *new_interface); - grub_efi_status_t - (*uninstall_protocol_interface) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*uninstall_protocol_interface) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, void *protocol_interface); - grub_efi_status_t - (*handle_protocol) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*handle_protocol) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, void **protocol_interface); void *reserved; - grub_efi_status_t - (*register_protocol_notify) (grub_efi_guid_t *protocol, - grub_efi_event_t event, + VasEBoot_efi_status_t + (*register_protocol_notify) (VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_event_t event, void **registration); - grub_efi_status_t - (*locate_handle) (grub_efi_locate_search_type_t search_type, - grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*locate_handle) (VasEBoot_efi_locate_search_type_t search_type, + VasEBoot_efi_guid_t *protocol, void *search_key, - grub_efi_uintn_t *buffer_size, - grub_efi_handle_t *buffer); + VasEBoot_efi_uintn_t *buffer_size, + VasEBoot_efi_handle_t *buffer); - grub_efi_status_t - (*locate_device_path) (grub_efi_guid_t *protocol, - grub_efi_device_path_t **device_path, - grub_efi_handle_t *device); + VasEBoot_efi_status_t + (*locate_device_path) (VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_device_path_t **device_path, + VasEBoot_efi_handle_t *device); - grub_efi_status_t - (*install_configuration_table) (grub_efi_guid_t *guid, void *table); + VasEBoot_efi_status_t + (*install_configuration_table) (VasEBoot_efi_guid_t *guid, void *table); - grub_efi_status_t - (*load_image) (grub_efi_boolean_t boot_policy, - grub_efi_handle_t parent_image_handle, - grub_efi_device_path_t *file_path, + VasEBoot_efi_status_t + (*load_image) (VasEBoot_efi_boolean_t boot_policy, + VasEBoot_efi_handle_t parent_image_handle, + VasEBoot_efi_device_path_t *file_path, void *source_buffer, - grub_efi_uintn_t source_size, - grub_efi_handle_t *image_handle); + VasEBoot_efi_uintn_t source_size, + VasEBoot_efi_handle_t *image_handle); - grub_efi_status_t - (*start_image) (grub_efi_handle_t image_handle, - grub_efi_uintn_t *exit_data_size, - grub_efi_char16_t **exit_data); + VasEBoot_efi_status_t + (*start_image) (VasEBoot_efi_handle_t image_handle, + VasEBoot_efi_uintn_t *exit_data_size, + VasEBoot_efi_char16_t **exit_data); - grub_efi_status_t - (*exit) (grub_efi_handle_t image_handle, - grub_efi_status_t exit_status, - grub_efi_uintn_t exit_data_size, - grub_efi_char16_t *exit_data) __attribute__((noreturn)); + VasEBoot_efi_status_t + (*exit) (VasEBoot_efi_handle_t image_handle, + VasEBoot_efi_status_t exit_status, + VasEBoot_efi_uintn_t exit_data_size, + VasEBoot_efi_char16_t *exit_data) __attribute__((noreturn)); - grub_efi_status_t - (*unload_image) (grub_efi_handle_t image_handle); + VasEBoot_efi_status_t + (*unload_image) (VasEBoot_efi_handle_t image_handle); - grub_efi_status_t - (*exit_boot_services) (grub_efi_handle_t image_handle, - grub_efi_uintn_t map_key); + VasEBoot_efi_status_t + (*exit_boot_services) (VasEBoot_efi_handle_t image_handle, + VasEBoot_efi_uintn_t map_key); - grub_efi_status_t - (*get_next_monotonic_count) (grub_efi_uint64_t *count); + VasEBoot_efi_status_t + (*get_next_monotonic_count) (VasEBoot_efi_uint64_t *count); - grub_efi_status_t - (*stall) (grub_efi_uintn_t microseconds); + VasEBoot_efi_status_t + (*stall) (VasEBoot_efi_uintn_t microseconds); - grub_efi_status_t - (*set_watchdog_timer) (grub_efi_uintn_t timeout, - grub_efi_uint64_t watchdog_code, - grub_efi_uintn_t data_size, - grub_efi_char16_t *watchdog_data); + VasEBoot_efi_status_t + (*set_watchdog_timer) (VasEBoot_efi_uintn_t timeout, + VasEBoot_efi_uint64_t watchdog_code, + VasEBoot_efi_uintn_t data_size, + VasEBoot_efi_char16_t *watchdog_data); - grub_efi_status_t - (*connect_controller) (grub_efi_handle_t controller_handle, - grub_efi_handle_t *driver_image_handle, - grub_efi_device_path_protocol_t *remaining_device_path, - grub_efi_boolean_t recursive); + VasEBoot_efi_status_t + (*connect_controller) (VasEBoot_efi_handle_t controller_handle, + VasEBoot_efi_handle_t *driver_image_handle, + VasEBoot_efi_device_path_protocol_t *remaining_device_path, + VasEBoot_efi_boolean_t recursive); - grub_efi_status_t - (*disconnect_controller) (grub_efi_handle_t controller_handle, - grub_efi_handle_t driver_image_handle, - grub_efi_handle_t child_handle); + VasEBoot_efi_status_t + (*disconnect_controller) (VasEBoot_efi_handle_t controller_handle, + VasEBoot_efi_handle_t driver_image_handle, + VasEBoot_efi_handle_t child_handle); - grub_efi_status_t - (*open_protocol) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*open_protocol) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, void **protocol_interface, - grub_efi_handle_t agent_handle, - grub_efi_handle_t controller_handle, - grub_efi_uint32_t attributes); + VasEBoot_efi_handle_t agent_handle, + VasEBoot_efi_handle_t controller_handle, + VasEBoot_efi_uint32_t attributes); - grub_efi_status_t - (*close_protocol) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, - grub_efi_handle_t agent_handle, - grub_efi_handle_t controller_handle); + VasEBoot_efi_status_t + (*close_protocol) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_handle_t agent_handle, + VasEBoot_efi_handle_t controller_handle); - grub_efi_status_t - (*open_protocol_information) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, - grub_efi_open_protocol_information_entry_t **entry_buffer, - grub_efi_uintn_t *entry_count); + VasEBoot_efi_status_t + (*open_protocol_information) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_open_protocol_information_entry_t **entry_buffer, + VasEBoot_efi_uintn_t *entry_count); - grub_efi_status_t - (*protocols_per_handle) (grub_efi_handle_t handle, - grub_efi_packed_guid_t ***protocol_buffer, - grub_efi_uintn_t *protocol_buffer_count); + VasEBoot_efi_status_t + (*protocols_per_handle) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_packed_guid_t ***protocol_buffer, + VasEBoot_efi_uintn_t *protocol_buffer_count); - grub_efi_status_t - (*locate_handle_buffer) (grub_efi_locate_search_type_t search_type, - grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*locate_handle_buffer) (VasEBoot_efi_locate_search_type_t search_type, + VasEBoot_efi_guid_t *protocol, void *search_key, - grub_efi_uintn_t *no_handles, - grub_efi_handle_t **buffer); + VasEBoot_efi_uintn_t *no_handles, + VasEBoot_efi_handle_t **buffer); - grub_efi_status_t - (*locate_protocol) (grub_efi_guid_t *protocol, + VasEBoot_efi_status_t + (*locate_protocol) (VasEBoot_efi_guid_t *protocol, void *registration, void **protocol_interface); - grub_efi_status_t - (*install_multiple_protocol_interfaces) (grub_efi_handle_t *handle, ...); + VasEBoot_efi_status_t + (*install_multiple_protocol_interfaces) (VasEBoot_efi_handle_t *handle, ...); - grub_efi_status_t - (*uninstall_multiple_protocol_interfaces) (grub_efi_handle_t handle, ...); + VasEBoot_efi_status_t + (*uninstall_multiple_protocol_interfaces) (VasEBoot_efi_handle_t handle, ...); - grub_efi_status_t + VasEBoot_efi_status_t (*calculate_crc32) (void *data, - grub_efi_uintn_t data_size, - grub_efi_uint32_t *crc32); + VasEBoot_efi_uintn_t data_size, + VasEBoot_efi_uint32_t *crc32); void - (*copy_mem) (void *destination, void *source, grub_efi_uintn_t length); + (*copy_mem) (void *destination, void *source, VasEBoot_efi_uintn_t length); void - (*set_mem) (void *buffer, grub_efi_uintn_t size, grub_efi_uint8_t value); + (*set_mem) (void *buffer, VasEBoot_efi_uintn_t size, VasEBoot_efi_uint8_t value); }; -typedef struct grub_efi_boot_services grub_efi_boot_services_t; +typedef struct VasEBoot_efi_boot_services VasEBoot_efi_boot_services_t; -struct grub_efi_runtime_services +struct VasEBoot_efi_runtime_services { - grub_efi_table_header_t hdr; + VasEBoot_efi_table_header_t hdr; - grub_efi_status_t - (*get_time) (grub_efi_time_t *time, - grub_efi_time_capabilities_t *capabilities); + VasEBoot_efi_status_t + (*get_time) (VasEBoot_efi_time_t *time, + VasEBoot_efi_time_capabilities_t *capabilities); - grub_efi_status_t - (*set_time) (grub_efi_time_t *time); + VasEBoot_efi_status_t + (*set_time) (VasEBoot_efi_time_t *time); - grub_efi_status_t - (*get_wakeup_time) (grub_efi_boolean_t *enabled, - grub_efi_boolean_t *pending, - grub_efi_time_t *time); + VasEBoot_efi_status_t + (*get_wakeup_time) (VasEBoot_efi_boolean_t *enabled, + VasEBoot_efi_boolean_t *pending, + VasEBoot_efi_time_t *time); - grub_efi_status_t - (*set_wakeup_time) (grub_efi_boolean_t enabled, - grub_efi_time_t *time); + VasEBoot_efi_status_t + (*set_wakeup_time) (VasEBoot_efi_boolean_t enabled, + VasEBoot_efi_time_t *time); - grub_efi_status_t - (*set_virtual_address_map) (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map); + VasEBoot_efi_status_t + (*set_virtual_address_map) (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version, + VasEBoot_efi_memory_descriptor_t *virtual_map); - grub_efi_status_t - (*convert_pointer) (grub_efi_uintn_t debug_disposition, void **address); + VasEBoot_efi_status_t + (*convert_pointer) (VasEBoot_efi_uintn_t debug_disposition, void **address); -#define GRUB_EFI_GLOBAL_VARIABLE_GUID \ +#define VasEBoot_EFI_GLOBAL_VARIABLE_GUID \ { 0x8BE4DF61, 0x93CA, 0x11d2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B,0x8C }} - grub_efi_status_t - (*get_variable) (grub_efi_char16_t *variable_name, - const grub_efi_guid_t *vendor_guid, - grub_efi_uint32_t *attributes, - grub_efi_uintn_t *data_size, + VasEBoot_efi_status_t + (*get_variable) (VasEBoot_efi_char16_t *variable_name, + const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_uint32_t *attributes, + VasEBoot_efi_uintn_t *data_size, void *data); - grub_efi_status_t - (*get_next_variable_name) (grub_efi_uintn_t *variable_name_size, - grub_efi_char16_t *variable_name, - grub_efi_guid_t *vendor_guid); + VasEBoot_efi_status_t + (*get_next_variable_name) (VasEBoot_efi_uintn_t *variable_name_size, + VasEBoot_efi_char16_t *variable_name, + VasEBoot_efi_guid_t *vendor_guid); - grub_efi_status_t - (*set_variable) (grub_efi_char16_t *variable_name, - const grub_efi_guid_t *vendor_guid, - grub_efi_uint32_t attributes, - grub_efi_uintn_t data_size, + VasEBoot_efi_status_t + (*set_variable) (VasEBoot_efi_char16_t *variable_name, + const VasEBoot_efi_guid_t *vendor_guid, + VasEBoot_efi_uint32_t attributes, + VasEBoot_efi_uintn_t data_size, void *data); - grub_efi_status_t - (*get_next_high_monotonic_count) (grub_efi_uint32_t *high_count); + VasEBoot_efi_status_t + (*get_next_high_monotonic_count) (VasEBoot_efi_uint32_t *high_count); void - (*reset_system) (grub_efi_reset_type_t reset_type, - grub_efi_status_t reset_status, - grub_efi_uintn_t data_size, - grub_efi_char16_t *reset_data); + (*reset_system) (VasEBoot_efi_reset_type_t reset_type, + VasEBoot_efi_status_t reset_status, + VasEBoot_efi_uintn_t data_size, + VasEBoot_efi_char16_t *reset_data); }; -typedef struct grub_efi_runtime_services grub_efi_runtime_services_t; +typedef struct VasEBoot_efi_runtime_services VasEBoot_efi_runtime_services_t; -struct grub_efi_configuration_table +struct VasEBoot_efi_configuration_table { - grub_efi_packed_guid_t vendor_guid; + VasEBoot_efi_packed_guid_t vendor_guid; void *vendor_table; -} GRUB_PACKED; -typedef struct grub_efi_configuration_table grub_efi_configuration_table_t; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_configuration_table VasEBoot_efi_configuration_table_t; -#define GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL -#define GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552LL +#define VasEBoot_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL +#define VasEBoot_EFIEMU_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552LL -struct grub_efi_serial_io_interface +struct VasEBoot_efi_serial_io_interface { - grub_efi_uint32_t revision; + VasEBoot_efi_uint32_t revision; void (*reset) (void); - grub_efi_status_t (*set_attributes) (struct grub_efi_serial_io_interface *this, - grub_efi_uint64_t speed, - grub_efi_uint32_t fifo_depth, - grub_efi_uint32_t timeout, - grub_efi_parity_type_t parity, - grub_uint8_t word_len, - grub_efi_stop_bits_t stop_bits); - grub_efi_status_t (*set_control_bits) (struct grub_efi_serial_io_interface *this, - grub_efi_uint32_t flags); + VasEBoot_efi_status_t (*set_attributes) (struct VasEBoot_efi_serial_io_interface *this, + VasEBoot_efi_uint64_t speed, + VasEBoot_efi_uint32_t fifo_depth, + VasEBoot_efi_uint32_t timeout, + VasEBoot_efi_parity_type_t parity, + VasEBoot_uint8_t word_len, + VasEBoot_efi_stop_bits_t stop_bits); + VasEBoot_efi_status_t (*set_control_bits) (struct VasEBoot_efi_serial_io_interface *this, + VasEBoot_efi_uint32_t flags); void (*get_control_bits) (void); - grub_efi_status_t (*write) (struct grub_efi_serial_io_interface *this, - grub_efi_uintn_t *buf_size, + VasEBoot_efi_status_t (*write) (struct VasEBoot_efi_serial_io_interface *this, + VasEBoot_efi_uintn_t *buf_size, void *buffer); - grub_efi_status_t (*read) (struct grub_efi_serial_io_interface *this, - grub_efi_uintn_t *buf_size, + VasEBoot_efi_status_t (*read) (struct VasEBoot_efi_serial_io_interface *this, + VasEBoot_efi_uintn_t *buf_size, void *buffer); }; -struct grub_efi_simple_input_interface +struct VasEBoot_efi_simple_input_interface { - grub_efi_status_t - (*reset) (struct grub_efi_simple_input_interface *this, - grub_efi_boolean_t extended_verification); + VasEBoot_efi_status_t + (*reset) (struct VasEBoot_efi_simple_input_interface *this, + VasEBoot_efi_boolean_t extended_verification); - grub_efi_status_t - (*read_key_stroke) (struct grub_efi_simple_input_interface *this, - grub_efi_input_key_t *key); + VasEBoot_efi_status_t + (*read_key_stroke) (struct VasEBoot_efi_simple_input_interface *this, + VasEBoot_efi_input_key_t *key); - grub_efi_event_t wait_for_key; + VasEBoot_efi_event_t wait_for_key; }; -typedef struct grub_efi_simple_input_interface grub_efi_simple_input_interface_t; +typedef struct VasEBoot_efi_simple_input_interface VasEBoot_efi_simple_input_interface_t; -struct grub_efi_key_data { - grub_efi_input_key_t key; - grub_efi_key_state_t key_state; +struct VasEBoot_efi_key_data { + VasEBoot_efi_input_key_t key; + VasEBoot_efi_key_state_t key_state; }; -typedef struct grub_efi_key_data grub_efi_key_data_t; +typedef struct VasEBoot_efi_key_data VasEBoot_efi_key_data_t; -typedef grub_efi_status_t (*grub_efi_key_notify_function_t) ( - grub_efi_key_data_t *key_data +typedef VasEBoot_efi_status_t (*VasEBoot_efi_key_notify_function_t) ( + VasEBoot_efi_key_data_t *key_data ); -struct grub_efi_simple_text_input_ex_interface +struct VasEBoot_efi_simple_text_input_ex_interface { - grub_efi_status_t - (*reset) (struct grub_efi_simple_text_input_ex_interface *this, - grub_efi_boolean_t extended_verification); + VasEBoot_efi_status_t + (*reset) (struct VasEBoot_efi_simple_text_input_ex_interface *this, + VasEBoot_efi_boolean_t extended_verification); - grub_efi_status_t - (*read_key_stroke) (struct grub_efi_simple_text_input_ex_interface *this, - grub_efi_key_data_t *key_data); + VasEBoot_efi_status_t + (*read_key_stroke) (struct VasEBoot_efi_simple_text_input_ex_interface *this, + VasEBoot_efi_key_data_t *key_data); - grub_efi_event_t wait_for_key; + VasEBoot_efi_event_t wait_for_key; - grub_efi_status_t - (*set_state) (struct grub_efi_simple_text_input_ex_interface *this, - grub_efi_key_toggle_state_t *key_toggle_state); + VasEBoot_efi_status_t + (*set_state) (struct VasEBoot_efi_simple_text_input_ex_interface *this, + VasEBoot_efi_key_toggle_state_t *key_toggle_state); - grub_efi_status_t - (*register_key_notify) (struct grub_efi_simple_text_input_ex_interface *this, - grub_efi_key_data_t *key_data, - grub_efi_key_notify_function_t key_notification_function); + VasEBoot_efi_status_t + (*register_key_notify) (struct VasEBoot_efi_simple_text_input_ex_interface *this, + VasEBoot_efi_key_data_t *key_data, + VasEBoot_efi_key_notify_function_t key_notification_function); - grub_efi_status_t - (*unregister_key_notify) (struct grub_efi_simple_text_input_ex_interface *this, + VasEBoot_efi_status_t + (*unregister_key_notify) (struct VasEBoot_efi_simple_text_input_ex_interface *this, void *notification_handle); }; -typedef struct grub_efi_simple_text_input_ex_interface grub_efi_simple_text_input_ex_interface_t; +typedef struct VasEBoot_efi_simple_text_input_ex_interface VasEBoot_efi_simple_text_input_ex_interface_t; -struct grub_efi_simple_text_output_interface +struct VasEBoot_efi_simple_text_output_interface { - grub_efi_status_t - (*reset) (struct grub_efi_simple_text_output_interface *this, - grub_efi_boolean_t extended_verification); + VasEBoot_efi_status_t + (*reset) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_boolean_t extended_verification); - grub_efi_status_t - (*output_string) (struct grub_efi_simple_text_output_interface *this, - grub_efi_char16_t *string); + VasEBoot_efi_status_t + (*output_string) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_char16_t *string); - grub_efi_status_t - (*test_string) (struct grub_efi_simple_text_output_interface *this, - grub_efi_char16_t *string); + VasEBoot_efi_status_t + (*test_string) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_char16_t *string); - grub_efi_status_t - (*query_mode) (struct grub_efi_simple_text_output_interface *this, - grub_efi_uintn_t mode_number, - grub_efi_uintn_t *columns, - grub_efi_uintn_t *rows); + VasEBoot_efi_status_t + (*query_mode) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_uintn_t mode_number, + VasEBoot_efi_uintn_t *columns, + VasEBoot_efi_uintn_t *rows); - grub_efi_status_t - (*set_mode) (struct grub_efi_simple_text_output_interface *this, - grub_efi_uintn_t mode_number); + VasEBoot_efi_status_t + (*set_mode) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_uintn_t mode_number); - grub_efi_status_t - (*set_attributes) (struct grub_efi_simple_text_output_interface *this, - grub_efi_uintn_t attribute); + VasEBoot_efi_status_t + (*set_attributes) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_uintn_t attribute); - grub_efi_status_t - (*clear_screen) (struct grub_efi_simple_text_output_interface *this); + VasEBoot_efi_status_t + (*clear_screen) (struct VasEBoot_efi_simple_text_output_interface *this); - grub_efi_status_t - (*set_cursor_position) (struct grub_efi_simple_text_output_interface *this, - grub_efi_uintn_t column, - grub_efi_uintn_t row); + VasEBoot_efi_status_t + (*set_cursor_position) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_uintn_t column, + VasEBoot_efi_uintn_t row); - grub_efi_status_t - (*enable_cursor) (struct grub_efi_simple_text_output_interface *this, - grub_efi_boolean_t visible); + VasEBoot_efi_status_t + (*enable_cursor) (struct VasEBoot_efi_simple_text_output_interface *this, + VasEBoot_efi_boolean_t visible); - grub_efi_simple_text_output_mode_t *mode; + VasEBoot_efi_simple_text_output_mode_t *mode; }; -typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t; +typedef struct VasEBoot_efi_simple_text_output_interface VasEBoot_efi_simple_text_output_interface_t; -typedef grub_uint8_t grub_efi_pxe_packet_t[1472]; +typedef VasEBoot_uint8_t VasEBoot_efi_pxe_packet_t[1472]; -typedef struct grub_efi_pxe_mode +typedef struct VasEBoot_efi_pxe_mode { - grub_uint8_t unused[52]; - grub_efi_pxe_packet_t dhcp_discover; - grub_efi_pxe_packet_t dhcp_ack; - grub_efi_pxe_packet_t proxy_offer; - grub_efi_pxe_packet_t pxe_discover; - grub_efi_pxe_packet_t pxe_reply; -} grub_efi_pxe_mode_t; + VasEBoot_uint8_t unused[52]; + VasEBoot_efi_pxe_packet_t dhcp_discover; + VasEBoot_efi_pxe_packet_t dhcp_ack; + VasEBoot_efi_pxe_packet_t proxy_offer; + VasEBoot_efi_pxe_packet_t pxe_discover; + VasEBoot_efi_pxe_packet_t pxe_reply; +} VasEBoot_efi_pxe_mode_t; -typedef struct grub_efi_pxe +typedef struct VasEBoot_efi_pxe { - grub_uint64_t rev; + VasEBoot_uint64_t rev; void (*start) (void); void (*stop) (void); void (*dhcp) (void); @@ -1482,215 +1482,215 @@ typedef struct grub_efi_pxe void (*setparams) (void); void (*setstationip) (void); void (*setpackets) (void); - struct grub_efi_pxe_mode *mode; -} grub_efi_pxe_t; + struct VasEBoot_efi_pxe_mode *mode; +} VasEBoot_efi_pxe_t; -#define GRUB_EFI_BLACK 0x00 -#define GRUB_EFI_BLUE 0x01 -#define GRUB_EFI_GREEN 0x02 -#define GRUB_EFI_CYAN 0x03 -#define GRUB_EFI_RED 0x04 -#define GRUB_EFI_MAGENTA 0x05 -#define GRUB_EFI_BROWN 0x06 -#define GRUB_EFI_LIGHTGRAY 0x07 -#define GRUB_EFI_BRIGHT 0x08 -#define GRUB_EFI_DARKGRAY 0x08 -#define GRUB_EFI_LIGHTBLUE 0x09 -#define GRUB_EFI_LIGHTGREEN 0x0A -#define GRUB_EFI_LIGHTCYAN 0x0B -#define GRUB_EFI_LIGHTRED 0x0C -#define GRUB_EFI_LIGHTMAGENTA 0x0D -#define GRUB_EFI_YELLOW 0x0E -#define GRUB_EFI_WHITE 0x0F +#define VasEBoot_EFI_BLACK 0x00 +#define VasEBoot_EFI_BLUE 0x01 +#define VasEBoot_EFI_GREEN 0x02 +#define VasEBoot_EFI_CYAN 0x03 +#define VasEBoot_EFI_RED 0x04 +#define VasEBoot_EFI_MAGENTA 0x05 +#define VasEBoot_EFI_BROWN 0x06 +#define VasEBoot_EFI_LIGHTGRAY 0x07 +#define VasEBoot_EFI_BRIGHT 0x08 +#define VasEBoot_EFI_DARKGRAY 0x08 +#define VasEBoot_EFI_LIGHTBLUE 0x09 +#define VasEBoot_EFI_LIGHTGREEN 0x0A +#define VasEBoot_EFI_LIGHTCYAN 0x0B +#define VasEBoot_EFI_LIGHTRED 0x0C +#define VasEBoot_EFI_LIGHTMAGENTA 0x0D +#define VasEBoot_EFI_YELLOW 0x0E +#define VasEBoot_EFI_WHITE 0x0F -#define GRUB_EFI_BACKGROUND_BLACK 0x00 -#define GRUB_EFI_BACKGROUND_BLUE 0x10 -#define GRUB_EFI_BACKGROUND_GREEN 0x20 -#define GRUB_EFI_BACKGROUND_CYAN 0x30 -#define GRUB_EFI_BACKGROUND_RED 0x40 -#define GRUB_EFI_BACKGROUND_MAGENTA 0x50 -#define GRUB_EFI_BACKGROUND_BROWN 0x60 -#define GRUB_EFI_BACKGROUND_LIGHTGRAY 0x70 +#define VasEBoot_EFI_BACKGROUND_BLACK 0x00 +#define VasEBoot_EFI_BACKGROUND_BLUE 0x10 +#define VasEBoot_EFI_BACKGROUND_GREEN 0x20 +#define VasEBoot_EFI_BACKGROUND_CYAN 0x30 +#define VasEBoot_EFI_BACKGROUND_RED 0x40 +#define VasEBoot_EFI_BACKGROUND_MAGENTA 0x50 +#define VasEBoot_EFI_BACKGROUND_BROWN 0x60 +#define VasEBoot_EFI_BACKGROUND_LIGHTGRAY 0x70 -#define GRUB_EFI_TEXT_ATTR(fg, bg) ((fg) | ((bg))) +#define VasEBoot_EFI_TEXT_ATTR(fg, bg) ((fg) | ((bg))) -struct grub_efi_system_table +struct VasEBoot_efi_system_table { - grub_efi_table_header_t hdr; - grub_efi_char16_t *firmware_vendor; - grub_efi_uint32_t firmware_revision; - grub_efi_handle_t console_in_handler; - grub_efi_simple_input_interface_t *con_in; - grub_efi_handle_t console_out_handler; - grub_efi_simple_text_output_interface_t *con_out; - grub_efi_handle_t standard_error_handle; - grub_efi_simple_text_output_interface_t *std_err; - grub_efi_runtime_services_t *runtime_services; - grub_efi_boot_services_t *boot_services; - grub_efi_uintn_t num_table_entries; - grub_efi_configuration_table_t *configuration_table; + VasEBoot_efi_table_header_t hdr; + VasEBoot_efi_char16_t *firmware_vendor; + VasEBoot_efi_uint32_t firmware_revision; + VasEBoot_efi_handle_t console_in_handler; + VasEBoot_efi_simple_input_interface_t *con_in; + VasEBoot_efi_handle_t console_out_handler; + VasEBoot_efi_simple_text_output_interface_t *con_out; + VasEBoot_efi_handle_t standard_error_handle; + VasEBoot_efi_simple_text_output_interface_t *std_err; + VasEBoot_efi_runtime_services_t *runtime_services; + VasEBoot_efi_boot_services_t *boot_services; + VasEBoot_efi_uintn_t num_table_entries; + VasEBoot_efi_configuration_table_t *configuration_table; }; -typedef struct grub_efi_system_table grub_efi_system_table_t; +typedef struct VasEBoot_efi_system_table VasEBoot_efi_system_table_t; -struct grub_efi_loaded_image +struct VasEBoot_efi_loaded_image { - grub_efi_uint32_t revision; - grub_efi_handle_t parent_handle; - grub_efi_system_table_t *system_table; + VasEBoot_efi_uint32_t revision; + VasEBoot_efi_handle_t parent_handle; + VasEBoot_efi_system_table_t *system_table; - grub_efi_handle_t device_handle; - grub_efi_device_path_t *file_path; + VasEBoot_efi_handle_t device_handle; + VasEBoot_efi_device_path_t *file_path; void *reserved; - grub_efi_uint32_t load_options_size; + VasEBoot_efi_uint32_t load_options_size; void *load_options; void *image_base; - grub_efi_uint64_t image_size; - grub_efi_memory_type_t image_code_type; - grub_efi_memory_type_t image_data_type; + VasEBoot_efi_uint64_t image_size; + VasEBoot_efi_memory_type_t image_code_type; + VasEBoot_efi_memory_type_t image_data_type; - grub_efi_status_t (*unload) (grub_efi_handle_t image_handle); + VasEBoot_efi_status_t (*unload) (VasEBoot_efi_handle_t image_handle); }; -typedef struct grub_efi_loaded_image grub_efi_loaded_image_t; +typedef struct VasEBoot_efi_loaded_image VasEBoot_efi_loaded_image_t; -struct grub_efi_disk_io +struct VasEBoot_efi_disk_io { - grub_efi_uint64_t revision; - grub_efi_status_t (*read) (struct grub_efi_disk_io *this, - grub_efi_uint32_t media_id, - grub_efi_uint64_t offset, - grub_efi_uintn_t buffer_size, + VasEBoot_efi_uint64_t revision; + VasEBoot_efi_status_t (*read) (struct VasEBoot_efi_disk_io *this, + VasEBoot_efi_uint32_t media_id, + VasEBoot_efi_uint64_t offset, + VasEBoot_efi_uintn_t buffer_size, void *buffer); - grub_efi_status_t (*write) (struct grub_efi_disk_io *this, - grub_efi_uint32_t media_id, - grub_efi_uint64_t offset, - grub_efi_uintn_t buffer_size, + VasEBoot_efi_status_t (*write) (struct VasEBoot_efi_disk_io *this, + VasEBoot_efi_uint32_t media_id, + VasEBoot_efi_uint64_t offset, + VasEBoot_efi_uintn_t buffer_size, void *buffer); }; -typedef struct grub_efi_disk_io grub_efi_disk_io_t; +typedef struct VasEBoot_efi_disk_io VasEBoot_efi_disk_io_t; -struct grub_efi_block_io_media +struct VasEBoot_efi_block_io_media { - grub_efi_uint32_t media_id; - grub_efi_boolean_t removable_media; - grub_efi_boolean_t media_present; - grub_efi_boolean_t logical_partition; - grub_efi_boolean_t read_only; - grub_efi_boolean_t write_caching; - grub_efi_uint8_t pad[3]; - grub_efi_uint32_t block_size; - grub_efi_uint32_t io_align; - grub_efi_uint8_t pad2[4]; - grub_efi_lba_t last_block; + VasEBoot_efi_uint32_t media_id; + VasEBoot_efi_boolean_t removable_media; + VasEBoot_efi_boolean_t media_present; + VasEBoot_efi_boolean_t logical_partition; + VasEBoot_efi_boolean_t read_only; + VasEBoot_efi_boolean_t write_caching; + VasEBoot_efi_uint8_t pad[3]; + VasEBoot_efi_uint32_t block_size; + VasEBoot_efi_uint32_t io_align; + VasEBoot_efi_uint8_t pad2[4]; + VasEBoot_efi_lba_t last_block; }; -typedef struct grub_efi_block_io_media grub_efi_block_io_media_t; +typedef struct VasEBoot_efi_block_io_media VasEBoot_efi_block_io_media_t; -typedef grub_uint8_t grub_efi_mac_t[32]; +typedef VasEBoot_uint8_t VasEBoot_efi_mac_t[32]; -struct grub_efi_simple_network_mode +struct VasEBoot_efi_simple_network_mode { - grub_uint32_t state; - grub_uint32_t hwaddr_size; - grub_uint32_t media_header_size; - grub_uint32_t max_packet_size; - grub_uint32_t nvram_size; - grub_uint32_t nvram_access_size; - grub_uint32_t receive_filter_mask; - grub_uint32_t receive_filter_setting; - grub_uint32_t max_mcast_filter_count; - grub_uint32_t mcast_filter_count; - grub_efi_mac_t mcast_filter[16]; - grub_efi_mac_t current_address; - grub_efi_mac_t broadcast_address; - grub_efi_mac_t permanent_address; - grub_uint8_t if_type; - grub_uint8_t mac_changeable; - grub_uint8_t multitx_supported; - grub_uint8_t media_present_supported; - grub_uint8_t media_present; + VasEBoot_uint32_t state; + VasEBoot_uint32_t hwaddr_size; + VasEBoot_uint32_t media_header_size; + VasEBoot_uint32_t max_packet_size; + VasEBoot_uint32_t nvram_size; + VasEBoot_uint32_t nvram_access_size; + VasEBoot_uint32_t receive_filter_mask; + VasEBoot_uint32_t receive_filter_setting; + VasEBoot_uint32_t max_mcast_filter_count; + VasEBoot_uint32_t mcast_filter_count; + VasEBoot_efi_mac_t mcast_filter[16]; + VasEBoot_efi_mac_t current_address; + VasEBoot_efi_mac_t broadcast_address; + VasEBoot_efi_mac_t permanent_address; + VasEBoot_uint8_t if_type; + VasEBoot_uint8_t mac_changeable; + VasEBoot_uint8_t multitx_supported; + VasEBoot_uint8_t media_present_supported; + VasEBoot_uint8_t media_present; }; enum { - GRUB_EFI_NETWORK_STOPPED, - GRUB_EFI_NETWORK_STARTED, - GRUB_EFI_NETWORK_INITIALIZED, + VasEBoot_EFI_NETWORK_STOPPED, + VasEBoot_EFI_NETWORK_STARTED, + VasEBoot_EFI_NETWORK_INITIALIZED, }; enum { - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST = 0x01, - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST = 0x02, - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST = 0x04, - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS = 0x08, - GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST = 0x10, + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST = 0x01, + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST = 0x02, + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST = 0x04, + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS = 0x08, + VasEBoot_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST = 0x10, }; -struct grub_efi_simple_network +struct VasEBoot_efi_simple_network { - grub_uint64_t revision; - grub_efi_status_t (*start) (struct grub_efi_simple_network *this); - grub_efi_status_t (*stop) (struct grub_efi_simple_network *this); - grub_efi_status_t (*initialize) (struct grub_efi_simple_network *this, - grub_efi_uintn_t extra_rx, - grub_efi_uintn_t extra_tx); + VasEBoot_uint64_t revision; + VasEBoot_efi_status_t (*start) (struct VasEBoot_efi_simple_network *this); + VasEBoot_efi_status_t (*stop) (struct VasEBoot_efi_simple_network *this); + VasEBoot_efi_status_t (*initialize) (struct VasEBoot_efi_simple_network *this, + VasEBoot_efi_uintn_t extra_rx, + VasEBoot_efi_uintn_t extra_tx); void (*reset) (void); - grub_efi_status_t (*shutdown) (struct grub_efi_simple_network *this); - grub_efi_status_t (*receive_filters) (struct grub_efi_simple_network *this, - grub_uint32_t enable, - grub_uint32_t disable, - grub_efi_boolean_t reset_mcast_filter, - grub_efi_uintn_t mcast_filter_count, - grub_efi_mac_address_t *mcast_filter); + VasEBoot_efi_status_t (*shutdown) (struct VasEBoot_efi_simple_network *this); + VasEBoot_efi_status_t (*receive_filters) (struct VasEBoot_efi_simple_network *this, + VasEBoot_uint32_t enable, + VasEBoot_uint32_t disable, + VasEBoot_efi_boolean_t reset_mcast_filter, + VasEBoot_efi_uintn_t mcast_filter_count, + VasEBoot_efi_mac_address_t *mcast_filter); void (*station_address) (void); void (*statistics) (void); void (*mcastiptomac) (void); void (*nvdata) (void); - grub_efi_status_t (*get_status) (struct grub_efi_simple_network *this, - grub_uint32_t *int_status, + VasEBoot_efi_status_t (*get_status) (struct VasEBoot_efi_simple_network *this, + VasEBoot_uint32_t *int_status, void **txbuf); - grub_efi_status_t (*transmit) (struct grub_efi_simple_network *this, - grub_efi_uintn_t header_size, - grub_efi_uintn_t buffer_size, + VasEBoot_efi_status_t (*transmit) (struct VasEBoot_efi_simple_network *this, + VasEBoot_efi_uintn_t header_size, + VasEBoot_efi_uintn_t buffer_size, void *buffer, - grub_efi_mac_t *src_addr, - grub_efi_mac_t *dest_addr, - grub_efi_uint16_t *protocol); - grub_efi_status_t (*receive) (struct grub_efi_simple_network *this, - grub_efi_uintn_t *header_size, - grub_efi_uintn_t *buffer_size, + VasEBoot_efi_mac_t *src_addr, + VasEBoot_efi_mac_t *dest_addr, + VasEBoot_efi_uint16_t *protocol); + VasEBoot_efi_status_t (*receive) (struct VasEBoot_efi_simple_network *this, + VasEBoot_efi_uintn_t *header_size, + VasEBoot_efi_uintn_t *buffer_size, void *buffer, - grub_efi_mac_t *src_addr, - grub_efi_mac_t *dest_addr, - grub_uint16_t *protocol); + VasEBoot_efi_mac_t *src_addr, + VasEBoot_efi_mac_t *dest_addr, + VasEBoot_uint16_t *protocol); void (*waitforpacket) (void); - struct grub_efi_simple_network_mode *mode; + struct VasEBoot_efi_simple_network_mode *mode; }; -typedef struct grub_efi_simple_network grub_efi_simple_network_t; +typedef struct VasEBoot_efi_simple_network VasEBoot_efi_simple_network_t; -struct grub_efi_block_io +struct VasEBoot_efi_block_io { - grub_efi_uint64_t revision; - grub_efi_block_io_media_t *media; - grub_efi_status_t (*reset) (struct grub_efi_block_io *this, - grub_efi_boolean_t extended_verification); - grub_efi_status_t (*read_blocks) (struct grub_efi_block_io *this, - grub_efi_uint32_t media_id, - grub_efi_lba_t lba, - grub_efi_uintn_t buffer_size, + VasEBoot_efi_uint64_t revision; + VasEBoot_efi_block_io_media_t *media; + VasEBoot_efi_status_t (*reset) (struct VasEBoot_efi_block_io *this, + VasEBoot_efi_boolean_t extended_verification); + VasEBoot_efi_status_t (*read_blocks) (struct VasEBoot_efi_block_io *this, + VasEBoot_efi_uint32_t media_id, + VasEBoot_efi_lba_t lba, + VasEBoot_efi_uintn_t buffer_size, void *buffer); - grub_efi_status_t (*write_blocks) (struct grub_efi_block_io *this, - grub_efi_uint32_t media_id, - grub_efi_lba_t lba, - grub_efi_uintn_t buffer_size, + VasEBoot_efi_status_t (*write_blocks) (struct VasEBoot_efi_block_io *this, + VasEBoot_efi_uint32_t media_id, + VasEBoot_efi_lba_t lba, + VasEBoot_efi_uintn_t buffer_size, void *buffer); - grub_efi_status_t (*flush_blocks) (struct grub_efi_block_io *this); + VasEBoot_efi_status_t (*flush_blocks) (struct VasEBoot_efi_block_io *this); }; -typedef struct grub_efi_block_io grub_efi_block_io_t; +typedef struct VasEBoot_efi_block_io VasEBoot_efi_block_io_t; -#if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ +#if (VasEBoot_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) #define efi_call_0(func) func() @@ -1708,58 +1708,58 @@ typedef struct grub_efi_block_io grub_efi_block_io_t; #define efi_call_0(func) \ efi_wrap_0(func) #define efi_call_1(func, a) \ - efi_wrap_1(func, (grub_uint64_t) (a)) + efi_wrap_1(func, (VasEBoot_uint64_t) (a)) #define efi_call_2(func, a, b) \ - efi_wrap_2(func, (grub_uint64_t) (a), (grub_uint64_t) (b)) + efi_wrap_2(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b)) #define efi_call_3(func, a, b, c) \ - efi_wrap_3(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \ - (grub_uint64_t) (c)) + efi_wrap_3(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b), \ + (VasEBoot_uint64_t) (c)) #define efi_call_4(func, a, b, c, d) \ - efi_wrap_4(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \ - (grub_uint64_t) (c), (grub_uint64_t) (d)) + efi_wrap_4(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b), \ + (VasEBoot_uint64_t) (c), (VasEBoot_uint64_t) (d)) #define efi_call_5(func, a, b, c, d, e) \ - efi_wrap_5(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \ - (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e)) + efi_wrap_5(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b), \ + (VasEBoot_uint64_t) (c), (VasEBoot_uint64_t) (d), (VasEBoot_uint64_t) (e)) #define efi_call_6(func, a, b, c, d, e, f) \ - efi_wrap_6(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \ - (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \ - (grub_uint64_t) (f)) + efi_wrap_6(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b), \ + (VasEBoot_uint64_t) (c), (VasEBoot_uint64_t) (d), (VasEBoot_uint64_t) (e), \ + (VasEBoot_uint64_t) (f)) #define efi_call_7(func, a, b, c, d, e, f, g) \ - efi_wrap_7(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \ - (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \ - (grub_uint64_t) (f), (grub_uint64_t) (g)) + efi_wrap_7(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b), \ + (VasEBoot_uint64_t) (c), (VasEBoot_uint64_t) (d), (VasEBoot_uint64_t) (e), \ + (VasEBoot_uint64_t) (f), (VasEBoot_uint64_t) (g)) #define efi_call_10(func, a, b, c, d, e, f, g, h, i, j) \ - efi_wrap_10(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \ - (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \ - (grub_uint64_t) (f), (grub_uint64_t) (g), (grub_uint64_t) (h), \ - (grub_uint64_t) (i), (grub_uint64_t) (j)) + efi_wrap_10(func, (VasEBoot_uint64_t) (a), (VasEBoot_uint64_t) (b), \ + (VasEBoot_uint64_t) (c), (VasEBoot_uint64_t) (d), (VasEBoot_uint64_t) (e), \ + (VasEBoot_uint64_t) (f), (VasEBoot_uint64_t) (g), (VasEBoot_uint64_t) (h), \ + (VasEBoot_uint64_t) (i), (VasEBoot_uint64_t) (j)) -grub_uint64_t EXPORT_FUNC(efi_wrap_0) (void *func); -grub_uint64_t EXPORT_FUNC(efi_wrap_1) (void *func, grub_uint64_t arg1); -grub_uint64_t EXPORT_FUNC(efi_wrap_2) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2); -grub_uint64_t EXPORT_FUNC(efi_wrap_3) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2, grub_uint64_t arg3); -grub_uint64_t EXPORT_FUNC(efi_wrap_4) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2, grub_uint64_t arg3, - grub_uint64_t arg4); -grub_uint64_t EXPORT_FUNC(efi_wrap_5) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2, grub_uint64_t arg3, - grub_uint64_t arg4, grub_uint64_t arg5); -grub_uint64_t EXPORT_FUNC(efi_wrap_6) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2, grub_uint64_t arg3, - grub_uint64_t arg4, grub_uint64_t arg5, - grub_uint64_t arg6); -grub_uint64_t EXPORT_FUNC(efi_wrap_7) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2, grub_uint64_t arg3, - grub_uint64_t arg4, grub_uint64_t arg5, - grub_uint64_t arg6, grub_uint64_t arg7); -grub_uint64_t EXPORT_FUNC(efi_wrap_10) (void *func, grub_uint64_t arg1, - grub_uint64_t arg2, grub_uint64_t arg3, - grub_uint64_t arg4, grub_uint64_t arg5, - grub_uint64_t arg6, grub_uint64_t arg7, - grub_uint64_t arg8, grub_uint64_t arg9, - grub_uint64_t arg10); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_0) (void *func); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_1) (void *func, VasEBoot_uint64_t arg1); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_2) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_3) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2, VasEBoot_uint64_t arg3); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_4) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2, VasEBoot_uint64_t arg3, + VasEBoot_uint64_t arg4); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_5) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2, VasEBoot_uint64_t arg3, + VasEBoot_uint64_t arg4, VasEBoot_uint64_t arg5); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_6) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2, VasEBoot_uint64_t arg3, + VasEBoot_uint64_t arg4, VasEBoot_uint64_t arg5, + VasEBoot_uint64_t arg6); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_7) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2, VasEBoot_uint64_t arg3, + VasEBoot_uint64_t arg4, VasEBoot_uint64_t arg5, + VasEBoot_uint64_t arg6, VasEBoot_uint64_t arg7); +VasEBoot_uint64_t EXPORT_FUNC(efi_wrap_10) (void *func, VasEBoot_uint64_t arg1, + VasEBoot_uint64_t arg2, VasEBoot_uint64_t arg3, + VasEBoot_uint64_t arg4, VasEBoot_uint64_t arg5, + VasEBoot_uint64_t arg6, VasEBoot_uint64_t arg7, + VasEBoot_uint64_t arg8, VasEBoot_uint64_t arg9, + VasEBoot_uint64_t arg10); #endif -#endif /* ! GRUB_EFI_API_HEADER */ +#endif /* ! VasEBoot_EFI_API_HEADER */ diff --git a/include/VasEBoot/efi/console.h b/include/VasEBoot/efi/console.h index f90b5b78c..d83e0e8e1 100644 --- a/include/VasEBoot/efi/console.h +++ b/include/VasEBoot/efi/console.h @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_CONSOLE_HEADER -#define GRUB_EFI_CONSOLE_HEADER 1 +#ifndef VasEBoot_EFI_CONSOLE_HEADER +#define VasEBoot_EFI_CONSOLE_HEADER 1 -#include -#include +#include +#include /* Initialize the console system. */ -void grub_console_init (void); +void VasEBoot_console_init (void); /* Finish the console system. */ -void grub_console_fini (void); +void VasEBoot_console_fini (void); -#endif /* ! GRUB_EFI_CONSOLE_HEADER */ +#endif /* ! VasEBoot_EFI_CONSOLE_HEADER */ diff --git a/include/VasEBoot/efi/console_control.h b/include/VasEBoot/efi/console_control.h index 7c358fcdb..80da5422b 100644 --- a/include/VasEBoot/efi/console_control.h +++ b/include/VasEBoot/efi/console_control.h @@ -1,57 +1,57 @@ /* console_control.h - definitions of the console control protocol */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* The console control protocol is not a part of the EFI spec, but defined in Intel's Sample Implementation. */ -#ifndef GRUB_EFI_CONSOLE_CONTROL_HEADER -#define GRUB_EFI_CONSOLE_CONTROL_HEADER 1 +#ifndef VasEBoot_EFI_CONSOLE_CONTROL_HEADER +#define VasEBoot_EFI_CONSOLE_CONTROL_HEADER 1 -#define GRUB_EFI_CONSOLE_CONTROL_GUID \ +#define VasEBoot_EFI_CONSOLE_CONTROL_GUID \ { 0xf42f7782, 0x12e, 0x4c12, \ { 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21 } \ } -enum grub_efi_screen_mode +enum VasEBoot_efi_screen_mode { - GRUB_EFI_SCREEN_TEXT, - GRUB_EFI_SCREEN_GRAPHICS, - GRUB_EFI_SCREEN_TEXT_MAX_VALUE + VasEBoot_EFI_SCREEN_TEXT, + VasEBoot_EFI_SCREEN_GRAPHICS, + VasEBoot_EFI_SCREEN_TEXT_MAX_VALUE }; -typedef enum grub_efi_screen_mode grub_efi_screen_mode_t; +typedef enum VasEBoot_efi_screen_mode VasEBoot_efi_screen_mode_t; -struct grub_efi_console_control_protocol +struct VasEBoot_efi_console_control_protocol { - grub_efi_status_t - (*get_mode) (struct grub_efi_console_control_protocol *this, - grub_efi_screen_mode_t *mode, - grub_efi_boolean_t *uga_exists, - grub_efi_boolean_t *std_in_locked); + VasEBoot_efi_status_t + (*get_mode) (struct VasEBoot_efi_console_control_protocol *this, + VasEBoot_efi_screen_mode_t *mode, + VasEBoot_efi_boolean_t *uga_exists, + VasEBoot_efi_boolean_t *std_in_locked); - grub_efi_status_t - (*set_mode) (struct grub_efi_console_control_protocol *this, - grub_efi_screen_mode_t mode); + VasEBoot_efi_status_t + (*set_mode) (struct VasEBoot_efi_console_control_protocol *this, + VasEBoot_efi_screen_mode_t mode); - grub_efi_status_t - (*lock_std_in) (struct grub_efi_console_control_protocol *this, - grub_efi_char16_t *password); + VasEBoot_efi_status_t + (*lock_std_in) (struct VasEBoot_efi_console_control_protocol *this, + VasEBoot_efi_char16_t *password); }; -typedef struct grub_efi_console_control_protocol grub_efi_console_control_protocol_t; +typedef struct VasEBoot_efi_console_control_protocol VasEBoot_efi_console_control_protocol_t; -#endif /* ! GRUB_EFI_CONSOLE_CONTROL_HEADER */ +#endif /* ! VasEBoot_EFI_CONSOLE_CONTROL_HEADER */ diff --git a/include/VasEBoot/efi/disk.h b/include/VasEBoot/efi/disk.h index 254475c84..40e4435f5 100644 --- a/include/VasEBoot/efi/disk.h +++ b/include/VasEBoot/efi/disk.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_DISK_HEADER -#define GRUB_EFI_DISK_HEADER 1 +#ifndef VasEBoot_EFI_DISK_HEADER +#define VasEBoot_EFI_DISK_HEADER 1 -#include -#include -#include +#include +#include +#include -grub_efi_handle_t -EXPORT_FUNC(grub_efidisk_get_device_handle) (grub_disk_t disk); -char *EXPORT_FUNC(grub_efidisk_get_device_name) (grub_efi_handle_t *handle); +VasEBoot_efi_handle_t +EXPORT_FUNC(VasEBoot_efidisk_get_device_handle) (VasEBoot_disk_t disk); +char *EXPORT_FUNC(VasEBoot_efidisk_get_device_name) (VasEBoot_efi_handle_t *handle); -void grub_efidisk_init (void); -void grub_efidisk_fini (void); +void VasEBoot_efidisk_init (void); +void VasEBoot_efidisk_fini (void); -#endif /* ! GRUB_EFI_DISK_HEADER */ +#endif /* ! VasEBoot_EFI_DISK_HEADER */ diff --git a/include/VasEBoot/efi/edid.h b/include/VasEBoot/efi/edid.h index a0140b81c..178c1ecdb 100644 --- a/include/VasEBoot/efi/edid.h +++ b/include/VasEBoot/efi/edid.h @@ -1,54 +1,54 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_EDID_HEADER -#define GRUB_EFI_EDID_HEADER 1 +#ifndef VasEBoot_EFI_EDID_HEADER +#define VasEBoot_EFI_EDID_HEADER 1 /* Based on UEFI specification. */ -#define GRUB_EFI_EDID_ACTIVE_GUID \ +#define VasEBoot_EFI_EDID_ACTIVE_GUID \ { 0xbd8c1056, 0x9f36, 0x44ec, { 0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 }} -#define GRUB_EFI_EDID_DISCOVERED_GUID \ +#define VasEBoot_EFI_EDID_DISCOVERED_GUID \ {0x1c0c34f6,0xd380,0x41fa, {0xa0,0x49,0x8a,0xd0,0x6c,0x1a,0x66,0xaa}} -#define GRUB_EFI_EDID_OVERRIDE_GUID \ +#define VasEBoot_EFI_EDID_OVERRIDE_GUID \ {0x48ecb431,0xfb72,0x45c0, {0xa9,0x22,0xf4,0x58,0xfe,0x4,0xb,0xd5}} -struct grub_efi_edid_override; +struct VasEBoot_efi_edid_override; -typedef grub_efi_status_t -(*grub_efi_edid_override_get_edid) (struct grub_efi_edid_override *this, - grub_efi_handle_t *childhandle, - grub_efi_uint32_t *attributes, - grub_efi_uintn_t *edidsize, - grub_efi_uint8_t *edid); -struct grub_efi_edid_override { - grub_efi_edid_override_get_edid get_edid; +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_edid_override_get_edid) (struct VasEBoot_efi_edid_override *this, + VasEBoot_efi_handle_t *childhandle, + VasEBoot_efi_uint32_t *attributes, + VasEBoot_efi_uintn_t *edidsize, + VasEBoot_efi_uint8_t *edid); +struct VasEBoot_efi_edid_override { + VasEBoot_efi_edid_override_get_edid get_edid; }; -typedef struct grub_efi_edid_override grub_efi_edid_override_t; +typedef struct VasEBoot_efi_edid_override VasEBoot_efi_edid_override_t; -struct grub_efi_active_edid +struct VasEBoot_efi_active_edid { - grub_uint32_t size_of_edid; - grub_uint8_t *edid; + VasEBoot_uint32_t size_of_edid; + VasEBoot_uint8_t *edid; }; #endif diff --git a/include/VasEBoot/efi/efi.h b/include/VasEBoot/efi/efi.h index 62a3d9726..479452373 100644 --- a/include/VasEBoot/efi/efi.h +++ b/include/VasEBoot/efi/efi.h @@ -1,111 +1,111 @@ /* efi.h - declare variables and functions for EFI support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_EFI_HEADER -#define GRUB_EFI_EFI_HEADER 1 +#ifndef VasEBoot_EFI_EFI_HEADER +#define VasEBoot_EFI_EFI_HEADER 1 -#include -#include -#include +#include +#include +#include /* Functions. */ -void *EXPORT_FUNC(grub_efi_locate_protocol) (grub_efi_guid_t *protocol, +void *EXPORT_FUNC(VasEBoot_efi_locate_protocol) (VasEBoot_efi_guid_t *protocol, void *registration); -grub_efi_handle_t * -EXPORT_FUNC(grub_efi_locate_handle) (grub_efi_locate_search_type_t search_type, - grub_efi_guid_t *protocol, +VasEBoot_efi_handle_t * +EXPORT_FUNC(VasEBoot_efi_locate_handle) (VasEBoot_efi_locate_search_type_t search_type, + VasEBoot_efi_guid_t *protocol, void *search_key, - grub_efi_uintn_t *num_handles); -void *EXPORT_FUNC(grub_efi_open_protocol) (grub_efi_handle_t handle, - grub_efi_guid_t *protocol, - grub_efi_uint32_t attributes); -int EXPORT_FUNC(grub_efi_set_text_mode) (int on); -void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds); + VasEBoot_efi_uintn_t *num_handles); +void *EXPORT_FUNC(VasEBoot_efi_open_protocol) (VasEBoot_efi_handle_t handle, + VasEBoot_efi_guid_t *protocol, + VasEBoot_efi_uint32_t attributes); +int EXPORT_FUNC(VasEBoot_efi_set_text_mode) (int on); +void EXPORT_FUNC(VasEBoot_efi_stall) (VasEBoot_efi_uintn_t microseconds); void * -EXPORT_FUNC(grub_efi_allocate_pages) (grub_efi_physical_address_t address, - grub_efi_uintn_t pages); +EXPORT_FUNC(VasEBoot_efi_allocate_pages) (VasEBoot_efi_physical_address_t address, + VasEBoot_efi_uintn_t pages); void * -EXPORT_FUNC(grub_efi_allocate_pages_max) (grub_efi_physical_address_t max, - grub_efi_uintn_t pages); -void EXPORT_FUNC(grub_efi_free_pages) (grub_efi_physical_address_t address, - grub_efi_uintn_t pages); +EXPORT_FUNC(VasEBoot_efi_allocate_pages_max) (VasEBoot_efi_physical_address_t max, + VasEBoot_efi_uintn_t pages); +void EXPORT_FUNC(VasEBoot_efi_free_pages) (VasEBoot_efi_physical_address_t address, + VasEBoot_efi_uintn_t pages); int -EXPORT_FUNC(grub_efi_get_memory_map) (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version); -grub_efi_loaded_image_t *EXPORT_FUNC(grub_efi_get_loaded_image) (grub_efi_handle_t image_handle); -void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp); -char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp); -grub_efi_device_path_t * -EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle); -grub_efi_device_path_t * -EXPORT_FUNC(grub_efi_find_last_device_path) (const grub_efi_device_path_t *dp); -grub_efi_device_path_t * -EXPORT_FUNC(grub_efi_duplicate_device_path) (const grub_efi_device_path_t *dp); -grub_err_t EXPORT_FUNC (grub_efi_finish_boot_services) (grub_efi_uintn_t *outbuf_size, void *outbuf, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *efi_desc_size, - grub_efi_uint32_t *efi_desc_version); -grub_err_t EXPORT_FUNC (grub_efi_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map); -void *EXPORT_FUNC (grub_efi_get_variable) (const char *variable, - const grub_efi_guid_t *guid, - grub_size_t *datasize_out); -grub_err_t -EXPORT_FUNC (grub_efi_set_variable) (const char *var, - const grub_efi_guid_t *guid, +EXPORT_FUNC(VasEBoot_efi_get_memory_map) (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version); +VasEBoot_efi_loaded_image_t *EXPORT_FUNC(VasEBoot_efi_get_loaded_image) (VasEBoot_efi_handle_t image_handle); +void EXPORT_FUNC(VasEBoot_efi_print_device_path) (VasEBoot_efi_device_path_t *dp); +char *EXPORT_FUNC(VasEBoot_efi_get_filename) (VasEBoot_efi_device_path_t *dp); +VasEBoot_efi_device_path_t * +EXPORT_FUNC(VasEBoot_efi_get_device_path) (VasEBoot_efi_handle_t handle); +VasEBoot_efi_device_path_t * +EXPORT_FUNC(VasEBoot_efi_find_last_device_path) (const VasEBoot_efi_device_path_t *dp); +VasEBoot_efi_device_path_t * +EXPORT_FUNC(VasEBoot_efi_duplicate_device_path) (const VasEBoot_efi_device_path_t *dp); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_efi_finish_boot_services) (VasEBoot_efi_uintn_t *outbuf_size, void *outbuf, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *efi_desc_size, + VasEBoot_efi_uint32_t *efi_desc_version); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_efi_set_virtual_address_map) (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version, + VasEBoot_efi_memory_descriptor_t *virtual_map); +void *EXPORT_FUNC (VasEBoot_efi_get_variable) (const char *variable, + const VasEBoot_efi_guid_t *guid, + VasEBoot_size_t *datasize_out); +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_efi_set_variable) (const char *var, + const VasEBoot_efi_guid_t *guid, void *data, - grub_size_t datasize); -grub_efi_boolean_t EXPORT_FUNC (grub_efi_secure_boot) (void); + VasEBoot_size_t datasize); +VasEBoot_efi_boolean_t EXPORT_FUNC (VasEBoot_efi_secure_boot) (void); int -EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, - const grub_efi_device_path_t *dp2); +EXPORT_FUNC (VasEBoot_efi_compare_device_paths) (const VasEBoot_efi_device_path_t *dp1, + const VasEBoot_efi_device_path_t *dp2); -extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, +extern void (*EXPORT_VAR(VasEBoot_efi_net_config)) (VasEBoot_efi_handle_t hnd, char **device, char **path); #if defined(__arm__) || defined(__aarch64__) -void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void); +void *EXPORT_FUNC(VasEBoot_efi_get_firmware_fdt)(void); #endif -grub_addr_t grub_efi_modules_addr (void); +VasEBoot_addr_t VasEBoot_efi_modules_addr (void); -void grub_efi_mm_init (void); -void grub_efi_mm_fini (void); -void grub_efi_init (void); -void grub_efi_fini (void); -void grub_efi_set_prefix (void); +void VasEBoot_efi_mm_init (void); +void VasEBoot_efi_mm_fini (void); +void VasEBoot_efi_init (void); +void VasEBoot_efi_fini (void); +void VasEBoot_efi_set_prefix (void); /* Variables. */ -extern grub_efi_system_table_t *EXPORT_VAR(grub_efi_system_table); -extern grub_efi_handle_t EXPORT_VAR(grub_efi_image_handle); +extern VasEBoot_efi_system_table_t *EXPORT_VAR(VasEBoot_efi_system_table); +extern VasEBoot_efi_handle_t EXPORT_VAR(VasEBoot_efi_image_handle); -extern int EXPORT_VAR(grub_efi_is_finished); +extern int EXPORT_VAR(VasEBoot_efi_is_finished); -struct grub_net_card; +struct VasEBoot_net_card; -grub_efi_handle_t -grub_efinet_get_device_handle (struct grub_net_card *card); +VasEBoot_efi_handle_t +VasEBoot_efinet_get_device_handle (struct VasEBoot_net_card *card); -#endif /* ! GRUB_EFI_EFI_HEADER */ +#endif /* ! VasEBoot_EFI_EFI_HEADER */ diff --git a/include/VasEBoot/efi/graphics_output.h b/include/VasEBoot/efi/graphics_output.h index 129777411..4c55c43c9 100644 --- a/include/VasEBoot/efi/graphics_output.h +++ b/include/VasEBoot/efi/graphics_output.h @@ -1,114 +1,114 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_GOP_HEADER -#define GRUB_EFI_GOP_HEADER 1 +#ifndef VasEBoot_EFI_GOP_HEADER +#define VasEBoot_EFI_GOP_HEADER 1 /* Based on UEFI specification. */ -#define GRUB_EFI_GOP_GUID \ +#define VasEBoot_EFI_GOP_GUID \ { 0x9042a9de, 0x23dc, 0x4a38, { 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a }} typedef enum { - GRUB_EFI_GOT_RGBA8, - GRUB_EFI_GOT_BGRA8, - GRUB_EFI_GOT_BITMASK + VasEBoot_EFI_GOT_RGBA8, + VasEBoot_EFI_GOT_BGRA8, + VasEBoot_EFI_GOT_BITMASK } - grub_efi_gop_pixel_format_t; + VasEBoot_efi_gop_pixel_format_t; typedef enum { - GRUB_EFI_BLT_VIDEO_FILL, - GRUB_EFI_BLT_VIDEO_TO_BLT_BUFFER, - GRUB_EFI_BLT_BUFFER_TO_VIDEO, - GRUB_EFI_BLT_VIDEO_TO_VIDEO, - GRUB_EFI_BLT_OPERATION_MAX + VasEBoot_EFI_BLT_VIDEO_FILL, + VasEBoot_EFI_BLT_VIDEO_TO_BLT_BUFFER, + VasEBoot_EFI_BLT_BUFFER_TO_VIDEO, + VasEBoot_EFI_BLT_VIDEO_TO_VIDEO, + VasEBoot_EFI_BLT_OPERATION_MAX } - grub_efi_gop_blt_operation_t; + VasEBoot_efi_gop_blt_operation_t; -struct grub_efi_gop_blt_pixel +struct VasEBoot_efi_gop_blt_pixel { - grub_uint8_t blue; - grub_uint8_t green; - grub_uint8_t red; - grub_uint8_t reserved; + VasEBoot_uint8_t blue; + VasEBoot_uint8_t green; + VasEBoot_uint8_t red; + VasEBoot_uint8_t reserved; }; -struct grub_efi_gop_pixel_bitmask +struct VasEBoot_efi_gop_pixel_bitmask { - grub_uint32_t r; - grub_uint32_t g; - grub_uint32_t b; - grub_uint32_t a; + VasEBoot_uint32_t r; + VasEBoot_uint32_t g; + VasEBoot_uint32_t b; + VasEBoot_uint32_t a; }; -struct grub_efi_gop_mode_info +struct VasEBoot_efi_gop_mode_info { - grub_efi_uint32_t version; - grub_efi_uint32_t width; - grub_efi_uint32_t height; - grub_efi_gop_pixel_format_t pixel_format; - struct grub_efi_gop_pixel_bitmask pixel_bitmask; - grub_efi_uint32_t pixels_per_scanline; + VasEBoot_efi_uint32_t version; + VasEBoot_efi_uint32_t width; + VasEBoot_efi_uint32_t height; + VasEBoot_efi_gop_pixel_format_t pixel_format; + struct VasEBoot_efi_gop_pixel_bitmask pixel_bitmask; + VasEBoot_efi_uint32_t pixels_per_scanline; }; -struct grub_efi_gop_mode +struct VasEBoot_efi_gop_mode { - grub_efi_uint32_t max_mode; - grub_efi_uint32_t mode; - struct grub_efi_gop_mode_info *info; - grub_efi_uintn_t info_size; - grub_efi_physical_address_t fb_base; - grub_efi_uintn_t fb_size; + VasEBoot_efi_uint32_t max_mode; + VasEBoot_efi_uint32_t mode; + struct VasEBoot_efi_gop_mode_info *info; + VasEBoot_efi_uintn_t info_size; + VasEBoot_efi_physical_address_t fb_base; + VasEBoot_efi_uintn_t fb_size; }; /* Forward declaration. */ -struct grub_efi_gop; +struct VasEBoot_efi_gop; -typedef grub_efi_status_t -(*grub_efi_gop_query_mode_t) (struct grub_efi_gop *this, - grub_efi_uint32_t mode_number, - grub_efi_uintn_t *size_of_info, - struct grub_efi_gop_mode_info **info); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_gop_query_mode_t) (struct VasEBoot_efi_gop *this, + VasEBoot_efi_uint32_t mode_number, + VasEBoot_efi_uintn_t *size_of_info, + struct VasEBoot_efi_gop_mode_info **info); -typedef grub_efi_status_t -(*grub_efi_gop_set_mode_t) (struct grub_efi_gop *this, - grub_efi_uint32_t mode_number); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_gop_set_mode_t) (struct VasEBoot_efi_gop *this, + VasEBoot_efi_uint32_t mode_number); -typedef grub_efi_status_t -(*grub_efi_gop_blt_t) (struct grub_efi_gop *this, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_gop_blt_t) (struct VasEBoot_efi_gop *this, void *buffer, - grub_efi_uintn_t operation, - grub_efi_uintn_t sx, - grub_efi_uintn_t sy, - grub_efi_uintn_t dx, - grub_efi_uintn_t dy, - grub_efi_uintn_t width, - grub_efi_uintn_t height, - grub_efi_uintn_t delta); + VasEBoot_efi_uintn_t operation, + VasEBoot_efi_uintn_t sx, + VasEBoot_efi_uintn_t sy, + VasEBoot_efi_uintn_t dx, + VasEBoot_efi_uintn_t dy, + VasEBoot_efi_uintn_t width, + VasEBoot_efi_uintn_t height, + VasEBoot_efi_uintn_t delta); -struct grub_efi_gop +struct VasEBoot_efi_gop { - grub_efi_gop_query_mode_t query_mode; - grub_efi_gop_set_mode_t set_mode; - grub_efi_gop_blt_t blt; - struct grub_efi_gop_mode *mode; + VasEBoot_efi_gop_query_mode_t query_mode; + VasEBoot_efi_gop_set_mode_t set_mode; + VasEBoot_efi_gop_blt_t blt; + struct VasEBoot_efi_gop_mode *mode; }; #endif diff --git a/include/VasEBoot/efi/memory.h b/include/VasEBoot/efi/memory.h index 20526b146..30f4117f5 100644 --- a/include/VasEBoot/efi/memory.h +++ b/include/VasEBoot/efi/memory.h @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_MACHINE_HEADER -#define GRUB_MEMORY_MACHINE_HEADER 1 +#ifndef VasEBoot_MEMORY_MACHINE_HEADER +#define VasEBoot_MEMORY_MACHINE_HEADER 1 -#include -#include +#include +#include -#define GRUB_MMAP_REGISTER_BY_FIRMWARE 1 +#define VasEBoot_MMAP_REGISTER_BY_FIRMWARE 1 -grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, +VasEBoot_err_t VasEBoot_machine_mmap_register (VasEBoot_uint64_t start, VasEBoot_uint64_t size, int type, int handle); -grub_err_t grub_machine_mmap_unregister (int handle); +VasEBoot_err_t VasEBoot_machine_mmap_unregister (int handle); -#endif /* ! GRUB_MEMORY_MACHINE_HEADER */ +#endif /* ! VasEBoot_MEMORY_MACHINE_HEADER */ diff --git a/include/VasEBoot/efi/pci.h b/include/VasEBoot/efi/pci.h index b17245549..4134953cc 100644 --- a/include/VasEBoot/efi/pci.h +++ b/include/VasEBoot/efi/pci.h @@ -1,319 +1,319 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_PCI_HEADER -#define GRUB_EFI_PCI_HEADER 1 +#ifndef VasEBoot_EFI_PCI_HEADER +#define VasEBoot_EFI_PCI_HEADER 1 -#include +#include -#define GRUB_EFI_PCI_IO_GUID \ +#define VasEBoot_EFI_PCI_IO_GUID \ { 0x4cf5b200, 0x68b8, 0x4ca5, { 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a }} -#define GRUB_EFI_PCI_ROOT_IO_GUID \ +#define VasEBoot_EFI_PCI_ROOT_IO_GUID \ { 0x2F707EBB, 0x4A1A, 0x11d4, { 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }} typedef enum { - GRUB_EFI_PCI_IO_WIDTH_UINT8, - GRUB_EFI_PCI_IO_WIDTH_UINT16, - GRUB_EFI_PCI_IO_WIDTH_UINT32, - GRUB_EFI_PCI_IO_WIDTH_UINT64, - GRUB_EFI_PCI_IO_WIDTH_FIFO_UINT8, - GRUB_EFI_PCI_IO_WIDTH_FIFO_UINT16, - GRUB_EFI_PCI_IO_WIDTH_FIFO_UINT32, - GRUB_EFI_PCI_IO_WIDTH_FIFO_UINT64, - GRUB_EFI_PCI_IO_WIDTH_FILL_UINT8, - GRUB_EFI_PCI_IO_WIDTH_FILL_UINT16, - GRUB_EFI_PCI_IO_WIDTH_FILL_UINT32, - GRUB_EFI_PCI_IO_WIDTH_FILL_UINT64, - GRUB_EFI_PCI_IO_WIDTH_MAXIMUM, + VasEBoot_EFI_PCI_IO_WIDTH_UINT8, + VasEBoot_EFI_PCI_IO_WIDTH_UINT16, + VasEBoot_EFI_PCI_IO_WIDTH_UINT32, + VasEBoot_EFI_PCI_IO_WIDTH_UINT64, + VasEBoot_EFI_PCI_IO_WIDTH_FIFO_UINT8, + VasEBoot_EFI_PCI_IO_WIDTH_FIFO_UINT16, + VasEBoot_EFI_PCI_IO_WIDTH_FIFO_UINT32, + VasEBoot_EFI_PCI_IO_WIDTH_FIFO_UINT64, + VasEBoot_EFI_PCI_IO_WIDTH_FILL_UINT8, + VasEBoot_EFI_PCI_IO_WIDTH_FILL_UINT16, + VasEBoot_EFI_PCI_IO_WIDTH_FILL_UINT32, + VasEBoot_EFI_PCI_IO_WIDTH_FILL_UINT64, + VasEBoot_EFI_PCI_IO_WIDTH_MAXIMUM, } - grub_efi_pci_io_width_t; + VasEBoot_efi_pci_io_width_t; -struct grub_efi_pci_io; +struct VasEBoot_efi_pci_io; -typedef grub_efi_status_t -(*grub_efi_pci_io_mem_t) (struct grub_efi_pci_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint8_t bar_index, - grub_efi_uint64_t offset, - grub_efi_uintn_t count, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_mem_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint8_t bar_index, + VasEBoot_efi_uint64_t offset, + VasEBoot_efi_uintn_t count, void *buffer); -typedef grub_efi_status_t -(*grub_efi_pci_io_config_t) (struct grub_efi_pci_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint32_t offset, - grub_efi_uintn_t count, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_config_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint32_t offset, + VasEBoot_efi_uintn_t count, void *buffer); typedef struct { - grub_efi_pci_io_mem_t read; - grub_efi_pci_io_mem_t write; -} grub_efi_pci_io_access_t; + VasEBoot_efi_pci_io_mem_t read; + VasEBoot_efi_pci_io_mem_t write; +} VasEBoot_efi_pci_io_access_t; typedef struct { - grub_efi_pci_io_config_t read; - grub_efi_pci_io_config_t write; -} grub_efi_pci_io_config_access_t; + VasEBoot_efi_pci_io_config_t read; + VasEBoot_efi_pci_io_config_t write; +} VasEBoot_efi_pci_io_config_access_t; typedef enum { - GRUB_EFI_PCI_IO_OPERATION_BUS_MASTER_READ, - GRUB_EFI_PCI_IO_OPERATION_BUS_MASTER_WRITE, - GRUB_EFI_PCI_IO_OPERATION_BUS_MASTER_COMMON_BUFFER, - GRUB_EFI_PCI_IO_OPERATION_BUS_MASTER_MAXIMUM + VasEBoot_EFI_PCI_IO_OPERATION_BUS_MASTER_READ, + VasEBoot_EFI_PCI_IO_OPERATION_BUS_MASTER_WRITE, + VasEBoot_EFI_PCI_IO_OPERATION_BUS_MASTER_COMMON_BUFFER, + VasEBoot_EFI_PCI_IO_OPERATION_BUS_MASTER_MAXIMUM } - grub_efi_pci_io_operation_t; + VasEBoot_efi_pci_io_operation_t; -#define GRUB_EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_IO 0x0100 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 -#define GRUB_EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_IO 0x0100 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 +#define VasEBoot_EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 typedef enum { - GRUB_EFI_PCI_IO_ATTRIBUTE_OPERATION_GET, - GRUB_EFI_PCI_IO_ATTRIBUTE_OPERATION_SET, - GRUB_EFI_PCI_IO_ATTRIBUTE_OPERATION_ENABLE, - GRUB_EFI_PCI_IO_ATTRIBUTE_OPERATION_DISABLE, - GRUB_EFI_PCI_IO_ATTRIBUTE_OPERATION_SUPPORTED, - GRUB_EFI_PCI_IO_ATTRIBUTE_OPERATION_MAXIMUM + VasEBoot_EFI_PCI_IO_ATTRIBUTE_OPERATION_GET, + VasEBoot_EFI_PCI_IO_ATTRIBUTE_OPERATION_SET, + VasEBoot_EFI_PCI_IO_ATTRIBUTE_OPERATION_ENABLE, + VasEBoot_EFI_PCI_IO_ATTRIBUTE_OPERATION_DISABLE, + VasEBoot_EFI_PCI_IO_ATTRIBUTE_OPERATION_SUPPORTED, + VasEBoot_EFI_PCI_IO_ATTRIBUTE_OPERATION_MAXIMUM } - grub_efi_pci_io_attribute_operation_t; + VasEBoot_efi_pci_io_attribute_operation_t; -typedef grub_efi_status_t -(*grub_efi_pci_io_poll_io_mem_t) (struct grub_efi_pci_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint8_t bar_ndex, - grub_efi_uint64_t offset, - grub_efi_uint64_t mask, - grub_efi_uint64_t value, - grub_efi_uint64_t delay, - grub_efi_uint64_t *result); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_poll_io_mem_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint8_t bar_ndex, + VasEBoot_efi_uint64_t offset, + VasEBoot_efi_uint64_t mask, + VasEBoot_efi_uint64_t value, + VasEBoot_efi_uint64_t delay, + VasEBoot_efi_uint64_t *result); -typedef grub_efi_status_t -(*grub_efi_pci_io_copy_mem_t) (struct grub_efi_pci_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint8_t dest_bar_index, - grub_efi_uint64_t dest_offset, - grub_efi_uint8_t src_bar_index, - grub_efi_uint64_t src_offset, - grub_efi_uintn_t count); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_copy_mem_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint8_t dest_bar_index, + VasEBoot_efi_uint64_t dest_offset, + VasEBoot_efi_uint8_t src_bar_index, + VasEBoot_efi_uint64_t src_offset, + VasEBoot_efi_uintn_t count); -typedef grub_efi_status_t -(*grub_efi_pci_io_map_t) (struct grub_efi_pci_io *this, - grub_efi_pci_io_operation_t operation, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_map_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_pci_io_operation_t operation, void *host_address, - grub_efi_uintn_t *number_of_bytes, - grub_efi_uint64_t *device_address, + VasEBoot_efi_uintn_t *number_of_bytes, + VasEBoot_efi_uint64_t *device_address, void **mapping); -typedef grub_efi_status_t -(*grub_efi_pci_io_unmap_t) (struct grub_efi_pci_io *this, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_unmap_t) (struct VasEBoot_efi_pci_io *this, void *mapping); -typedef grub_efi_status_t -(*grub_efi_pci_io_allocate_buffer_t) (struct grub_efi_pci_io *this, - grub_efi_allocate_type_t type, - grub_efi_memory_type_t memory_type, - grub_efi_uintn_t pages, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_allocate_buffer_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_allocate_type_t type, + VasEBoot_efi_memory_type_t memory_type, + VasEBoot_efi_uintn_t pages, void **host_address, - grub_efi_uint64_t attributes); + VasEBoot_efi_uint64_t attributes); -typedef grub_efi_status_t -(*grub_efi_pci_io_free_buffer_t) (struct grub_efi_pci_io *this, - grub_efi_allocate_type_t type, - grub_efi_memory_type_t memory_type, - grub_efi_uintn_t pages, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_free_buffer_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_allocate_type_t type, + VasEBoot_efi_memory_type_t memory_type, + VasEBoot_efi_uintn_t pages, void **host_address, - grub_efi_uint64_t attributes); + VasEBoot_efi_uint64_t attributes); -typedef grub_efi_status_t -(*grub_efi_pci_io_flush_t) (struct grub_efi_pci_io *this); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_flush_t) (struct VasEBoot_efi_pci_io *this); -typedef grub_efi_status_t -(*grub_efi_pci_io_get_location_t) (struct grub_efi_pci_io *this, - grub_efi_uintn_t *segment_number, - grub_efi_uintn_t *bus_number, - grub_efi_uintn_t *device_number, - grub_efi_uintn_t *function_number); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_get_location_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_uintn_t *segment_number, + VasEBoot_efi_uintn_t *bus_number, + VasEBoot_efi_uintn_t *device_number, + VasEBoot_efi_uintn_t *function_number); -typedef grub_efi_status_t -(*grub_efi_pci_io_attributes_t) (struct grub_efi_pci_io *this, - grub_efi_pci_io_attribute_operation_t operation, - grub_efi_uint64_t attributes, - grub_efi_uint64_t *result); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_attributes_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_pci_io_attribute_operation_t operation, + VasEBoot_efi_uint64_t attributes, + VasEBoot_efi_uint64_t *result); -typedef grub_efi_status_t -(*grub_efi_pci_io_get_bar_attributes_t) (struct grub_efi_pci_io *this, - grub_efi_uint8_t bar_index, - grub_efi_uint64_t *supports, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_get_bar_attributes_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_uint8_t bar_index, + VasEBoot_efi_uint64_t *supports, void **resources); -typedef grub_efi_status_t -(*grub_efi_pci_io_set_bar_attributes_t) (struct grub_efi_pci_io *this, - grub_efi_uint64_t attributes, - grub_efi_uint8_t bar_index, - grub_efi_uint64_t *offset, - grub_efi_uint64_t *length); -struct grub_efi_pci_io { - grub_efi_pci_io_poll_io_mem_t poll_mem; - grub_efi_pci_io_poll_io_mem_t poll_io; - grub_efi_pci_io_access_t mem; - grub_efi_pci_io_access_t io; - grub_efi_pci_io_config_access_t pci; - grub_efi_pci_io_copy_mem_t copy_mem; - grub_efi_pci_io_map_t map; - grub_efi_pci_io_unmap_t unmap; - grub_efi_pci_io_allocate_buffer_t allocate_buffer; - grub_efi_pci_io_free_buffer_t free_buffer; - grub_efi_pci_io_flush_t flush; - grub_efi_pci_io_get_location_t get_location; - grub_efi_pci_io_attributes_t attributes; - grub_efi_pci_io_get_bar_attributes_t get_bar_attributes; - grub_efi_pci_io_set_bar_attributes_t set_bar_attributes; - grub_efi_uint64_t rom_size; +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_io_set_bar_attributes_t) (struct VasEBoot_efi_pci_io *this, + VasEBoot_efi_uint64_t attributes, + VasEBoot_efi_uint8_t bar_index, + VasEBoot_efi_uint64_t *offset, + VasEBoot_efi_uint64_t *length); +struct VasEBoot_efi_pci_io { + VasEBoot_efi_pci_io_poll_io_mem_t poll_mem; + VasEBoot_efi_pci_io_poll_io_mem_t poll_io; + VasEBoot_efi_pci_io_access_t mem; + VasEBoot_efi_pci_io_access_t io; + VasEBoot_efi_pci_io_config_access_t pci; + VasEBoot_efi_pci_io_copy_mem_t copy_mem; + VasEBoot_efi_pci_io_map_t map; + VasEBoot_efi_pci_io_unmap_t unmap; + VasEBoot_efi_pci_io_allocate_buffer_t allocate_buffer; + VasEBoot_efi_pci_io_free_buffer_t free_buffer; + VasEBoot_efi_pci_io_flush_t flush; + VasEBoot_efi_pci_io_get_location_t get_location; + VasEBoot_efi_pci_io_attributes_t attributes; + VasEBoot_efi_pci_io_get_bar_attributes_t get_bar_attributes; + VasEBoot_efi_pci_io_set_bar_attributes_t set_bar_attributes; + VasEBoot_efi_uint64_t rom_size; void *rom_image; }; -typedef struct grub_efi_pci_io grub_efi_pci_io_t; +typedef struct VasEBoot_efi_pci_io VasEBoot_efi_pci_io_t; -struct grub_efi_pci_root_io; +struct VasEBoot_efi_pci_root_io; typedef struct { - grub_efi_status_t(*read) (struct grub_efi_pci_root_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint64_t address, - grub_efi_uintn_t count, + VasEBoot_efi_status_t(*read) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint64_t address, + VasEBoot_efi_uintn_t count, void *buffer); - grub_efi_status_t(*write) (struct grub_efi_pci_root_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint64_t address, - grub_efi_uintn_t count, + VasEBoot_efi_status_t(*write) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint64_t address, + VasEBoot_efi_uintn_t count, void *buffer); -} grub_efi_pci_root_io_access_t; +} VasEBoot_efi_pci_root_io_access_t; typedef enum { - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_READ, - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_WRITE, - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_COMMON_BUFFER, - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_READ_64, - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_WRITE_64, - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_COMMON_BUFFER_64, - GRUB_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_MAXIMUM + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_READ, + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_WRITE, + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_COMMON_BUFFER, + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_READ_64, + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_WRITE_64, + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_COMMON_BUFFER_64, + VasEBoot_EFI_PCI_ROOT_IO_OPERATION_BUS_MASTER_MAXIMUM } - grub_efi_pci_root_io_operation_t; + VasEBoot_efi_pci_root_io_operation_t; -typedef grub_efi_status_t -(*grub_efi_pci_root_io_poll_io_mem_t) (struct grub_efi_pci_root_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint64_t address, - grub_efi_uint64_t mask, - grub_efi_uint64_t value, - grub_efi_uint64_t delay, - grub_efi_uint64_t *result); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_poll_io_mem_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint64_t address, + VasEBoot_efi_uint64_t mask, + VasEBoot_efi_uint64_t value, + VasEBoot_efi_uint64_t delay, + VasEBoot_efi_uint64_t *result); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_copy_mem_t) (struct grub_efi_pci_root_io *this, - grub_efi_pci_io_width_t width, - grub_efi_uint64_t dest_offset, - grub_efi_uint64_t src_offset, - grub_efi_uintn_t count); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_copy_mem_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_pci_io_width_t width, + VasEBoot_efi_uint64_t dest_offset, + VasEBoot_efi_uint64_t src_offset, + VasEBoot_efi_uintn_t count); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_map_t) (struct grub_efi_pci_root_io *this, - grub_efi_pci_root_io_operation_t operation, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_map_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_pci_root_io_operation_t operation, void *host_address, - grub_efi_uintn_t *number_of_bytes, - grub_efi_uint64_t *device_address, + VasEBoot_efi_uintn_t *number_of_bytes, + VasEBoot_efi_uint64_t *device_address, void **mapping); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_unmap_t) (struct grub_efi_pci_root_io *this, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_unmap_t) (struct VasEBoot_efi_pci_root_io *this, void *mapping); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_allocate_buffer_t) (struct grub_efi_pci_root_io *this, - grub_efi_allocate_type_t type, - grub_efi_memory_type_t memory_type, - grub_efi_uintn_t pages, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_allocate_buffer_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_allocate_type_t type, + VasEBoot_efi_memory_type_t memory_type, + VasEBoot_efi_uintn_t pages, void **host_address, - grub_efi_uint64_t attributes); + VasEBoot_efi_uint64_t attributes); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_free_buffer_t) (struct grub_efi_pci_root_io *this, - grub_efi_uintn_t pages, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_free_buffer_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_uintn_t pages, void **host_address); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_flush_t) (struct grub_efi_pci_root_io *this); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_flush_t) (struct VasEBoot_efi_pci_root_io *this); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_get_attributes_t) (struct grub_efi_pci_root_io *this, - grub_efi_uint64_t *supports, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_get_attributes_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_uint64_t *supports, void **resources); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_set_attributes_t) (struct grub_efi_pci_root_io *this, - grub_efi_uint64_t attributes, - grub_efi_uint64_t *offset, - grub_efi_uint64_t *length); +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_set_attributes_t) (struct VasEBoot_efi_pci_root_io *this, + VasEBoot_efi_uint64_t attributes, + VasEBoot_efi_uint64_t *offset, + VasEBoot_efi_uint64_t *length); -typedef grub_efi_status_t -(*grub_efi_pci_root_io_configuration_t) (struct grub_efi_pci_root_io *this, +typedef VasEBoot_efi_status_t +(*VasEBoot_efi_pci_root_io_configuration_t) (struct VasEBoot_efi_pci_root_io *this, void **resources); -struct grub_efi_pci_root_io { - grub_efi_handle_t parent; - grub_efi_pci_root_io_poll_io_mem_t poll_mem; - grub_efi_pci_root_io_poll_io_mem_t poll_io; - grub_efi_pci_root_io_access_t mem; - grub_efi_pci_root_io_access_t io; - grub_efi_pci_root_io_access_t pci; - grub_efi_pci_root_io_copy_mem_t copy_mem; - grub_efi_pci_root_io_map_t map; - grub_efi_pci_root_io_unmap_t unmap; - grub_efi_pci_root_io_allocate_buffer_t allocate_buffer; - grub_efi_pci_root_io_free_buffer_t free_buffer; - grub_efi_pci_root_io_flush_t flush; - grub_efi_pci_root_io_get_attributes_t get_attributes; - grub_efi_pci_root_io_set_attributes_t set_attributes; - grub_efi_pci_root_io_configuration_t configuration; +struct VasEBoot_efi_pci_root_io { + VasEBoot_efi_handle_t parent; + VasEBoot_efi_pci_root_io_poll_io_mem_t poll_mem; + VasEBoot_efi_pci_root_io_poll_io_mem_t poll_io; + VasEBoot_efi_pci_root_io_access_t mem; + VasEBoot_efi_pci_root_io_access_t io; + VasEBoot_efi_pci_root_io_access_t pci; + VasEBoot_efi_pci_root_io_copy_mem_t copy_mem; + VasEBoot_efi_pci_root_io_map_t map; + VasEBoot_efi_pci_root_io_unmap_t unmap; + VasEBoot_efi_pci_root_io_allocate_buffer_t allocate_buffer; + VasEBoot_efi_pci_root_io_free_buffer_t free_buffer; + VasEBoot_efi_pci_root_io_flush_t flush; + VasEBoot_efi_pci_root_io_get_attributes_t get_attributes; + VasEBoot_efi_pci_root_io_set_attributes_t set_attributes; + VasEBoot_efi_pci_root_io_configuration_t configuration; }; -typedef struct grub_efi_pci_root_io grub_efi_pci_root_io_t; +typedef struct VasEBoot_efi_pci_root_io VasEBoot_efi_pci_root_io_t; -#endif /* !GRUB_EFI_PCI_HEADER */ +#endif /* !VasEBoot_EFI_PCI_HEADER */ diff --git a/include/VasEBoot/efi/pe32.h b/include/VasEBoot/efi/pe32.h index f79c36c02..e0f3ae7e0 100644 --- a/include/VasEBoot/efi/pe32.h +++ b/include/VasEBoot/efi/pe32.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_PE32_HEADER -#define GRUB_EFI_PE32_HEADER 1 +#ifndef VasEBoot_EFI_PE32_HEADER +#define VasEBoot_EFI_PE32_HEADER 1 -#include +#include /* The MSDOS compatibility stub. This was copied from the output of objcopy, and it is not necessary to care about what this means. */ -#define GRUB_PE32_MSDOS_STUB \ +#define VasEBoot_PE32_MSDOS_STUB \ { \ 0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, \ 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, \ @@ -43,278 +43,278 @@ 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \ } -#define GRUB_PE32_MSDOS_STUB_SIZE 0x80 +#define VasEBoot_PE32_MSDOS_STUB_SIZE 0x80 /* According to the spec, the minimal alignment is 512 bytes... But some examples (such as EFI drivers in the Intel Sample Implementation) use 32 bytes (0x20) instead, and it seems - to be working. For now, GRUB uses 512 bytes for safety. */ -#define GRUB_PE32_SECTION_ALIGNMENT 0x200 -#define GRUB_PE32_FILE_ALIGNMENT GRUB_PE32_SECTION_ALIGNMENT + to be working. For now, VasEBoot uses 512 bytes for safety. */ +#define VasEBoot_PE32_SECTION_ALIGNMENT 0x200 +#define VasEBoot_PE32_FILE_ALIGNMENT VasEBoot_PE32_SECTION_ALIGNMENT -struct grub_pe32_coff_header +struct VasEBoot_pe32_coff_header { - grub_uint16_t machine; - grub_uint16_t num_sections; - grub_uint32_t time; - grub_uint32_t symtab_offset; - grub_uint32_t num_symbols; - grub_uint16_t optional_header_size; - grub_uint16_t characteristics; + VasEBoot_uint16_t machine; + VasEBoot_uint16_t num_sections; + VasEBoot_uint32_t time; + VasEBoot_uint32_t symtab_offset; + VasEBoot_uint32_t num_symbols; + VasEBoot_uint16_t optional_header_size; + VasEBoot_uint16_t characteristics; }; -#define GRUB_PE32_MACHINE_I386 0x14c -#define GRUB_PE32_MACHINE_IA64 0x200 -#define GRUB_PE32_MACHINE_X86_64 0x8664 -#define GRUB_PE32_MACHINE_ARMTHUMB_MIXED 0x01c2 -#define GRUB_PE32_MACHINE_ARM64 0xAA64 +#define VasEBoot_PE32_MACHINE_I386 0x14c +#define VasEBoot_PE32_MACHINE_IA64 0x200 +#define VasEBoot_PE32_MACHINE_X86_64 0x8664 +#define VasEBoot_PE32_MACHINE_ARMTHUMB_MIXED 0x01c2 +#define VasEBoot_PE32_MACHINE_ARM64 0xAA64 -#define GRUB_PE32_RELOCS_STRIPPED 0x0001 -#define GRUB_PE32_EXECUTABLE_IMAGE 0x0002 -#define GRUB_PE32_LINE_NUMS_STRIPPED 0x0004 -#define GRUB_PE32_LOCAL_SYMS_STRIPPED 0x0008 -#define GRUB_PE32_AGGRESSIVE_WS_TRIM 0x0010 -#define GRUB_PE32_LARGE_ADDRESS_AWARE 0x0020 -#define GRUB_PE32_16BIT_MACHINE 0x0040 -#define GRUB_PE32_BYTES_REVERSED_LO 0x0080 -#define GRUB_PE32_32BIT_MACHINE 0x0100 -#define GRUB_PE32_DEBUG_STRIPPED 0x0200 -#define GRUB_PE32_REMOVABLE_RUN_FROM_SWAP 0x0400 -#define GRUB_PE32_SYSTEM 0x1000 -#define GRUB_PE32_DLL 0x2000 -#define GRUB_PE32_UP_SYSTEM_ONLY 0x4000 -#define GRUB_PE32_BYTES_REVERSED_HI 0x8000 +#define VasEBoot_PE32_RELOCS_STRIPPED 0x0001 +#define VasEBoot_PE32_EXECUTABLE_IMAGE 0x0002 +#define VasEBoot_PE32_LINE_NUMS_STRIPPED 0x0004 +#define VasEBoot_PE32_LOCAL_SYMS_STRIPPED 0x0008 +#define VasEBoot_PE32_AGGRESSIVE_WS_TRIM 0x0010 +#define VasEBoot_PE32_LARGE_ADDRESS_AWARE 0x0020 +#define VasEBoot_PE32_16BIT_MACHINE 0x0040 +#define VasEBoot_PE32_BYTES_REVERSED_LO 0x0080 +#define VasEBoot_PE32_32BIT_MACHINE 0x0100 +#define VasEBoot_PE32_DEBUG_STRIPPED 0x0200 +#define VasEBoot_PE32_REMOVABLE_RUN_FROM_SWAP 0x0400 +#define VasEBoot_PE32_SYSTEM 0x1000 +#define VasEBoot_PE32_DLL 0x2000 +#define VasEBoot_PE32_UP_SYSTEM_ONLY 0x4000 +#define VasEBoot_PE32_BYTES_REVERSED_HI 0x8000 -struct grub_pe32_data_directory +struct VasEBoot_pe32_data_directory { - grub_uint32_t rva; - grub_uint32_t size; + VasEBoot_uint32_t rva; + VasEBoot_uint32_t size; }; -struct grub_pe32_optional_header +struct VasEBoot_pe32_optional_header { - grub_uint16_t magic; - grub_uint8_t major_linker_version; - grub_uint8_t minor_linker_version; - grub_uint32_t code_size; - grub_uint32_t data_size; - grub_uint32_t bss_size; - grub_uint32_t entry_addr; - grub_uint32_t code_base; + VasEBoot_uint16_t magic; + VasEBoot_uint8_t major_linker_version; + VasEBoot_uint8_t minor_linker_version; + VasEBoot_uint32_t code_size; + VasEBoot_uint32_t data_size; + VasEBoot_uint32_t bss_size; + VasEBoot_uint32_t entry_addr; + VasEBoot_uint32_t code_base; - grub_uint32_t data_base; - grub_uint32_t image_base; + VasEBoot_uint32_t data_base; + VasEBoot_uint32_t image_base; - grub_uint32_t section_alignment; - grub_uint32_t file_alignment; - grub_uint16_t major_os_version; - grub_uint16_t minor_os_version; - grub_uint16_t major_image_version; - grub_uint16_t minor_image_version; - grub_uint16_t major_subsystem_version; - grub_uint16_t minor_subsystem_version; - grub_uint32_t reserved; - grub_uint32_t image_size; - grub_uint32_t header_size; - grub_uint32_t checksum; - grub_uint16_t subsystem; - grub_uint16_t dll_characteristics; + VasEBoot_uint32_t section_alignment; + VasEBoot_uint32_t file_alignment; + VasEBoot_uint16_t major_os_version; + VasEBoot_uint16_t minor_os_version; + VasEBoot_uint16_t major_image_version; + VasEBoot_uint16_t minor_image_version; + VasEBoot_uint16_t major_subsystem_version; + VasEBoot_uint16_t minor_subsystem_version; + VasEBoot_uint32_t reserved; + VasEBoot_uint32_t image_size; + VasEBoot_uint32_t header_size; + VasEBoot_uint32_t checksum; + VasEBoot_uint16_t subsystem; + VasEBoot_uint16_t dll_characteristics; - grub_uint32_t stack_reserve_size; - grub_uint32_t stack_commit_size; - grub_uint32_t heap_reserve_size; - grub_uint32_t heap_commit_size; + VasEBoot_uint32_t stack_reserve_size; + VasEBoot_uint32_t stack_commit_size; + VasEBoot_uint32_t heap_reserve_size; + VasEBoot_uint32_t heap_commit_size; - grub_uint32_t loader_flags; - grub_uint32_t num_data_directories; + VasEBoot_uint32_t loader_flags; + VasEBoot_uint32_t num_data_directories; /* Data directories. */ - struct grub_pe32_data_directory export_table; - struct grub_pe32_data_directory import_table; - struct grub_pe32_data_directory resource_table; - struct grub_pe32_data_directory exception_table; - struct grub_pe32_data_directory certificate_table; - struct grub_pe32_data_directory base_relocation_table; - struct grub_pe32_data_directory debug; - struct grub_pe32_data_directory architecture; - struct grub_pe32_data_directory global_ptr; - struct grub_pe32_data_directory tls_table; - struct grub_pe32_data_directory load_config_table; - struct grub_pe32_data_directory bound_import; - struct grub_pe32_data_directory iat; - struct grub_pe32_data_directory delay_import_descriptor; - struct grub_pe32_data_directory com_runtime_header; - struct grub_pe32_data_directory reserved_entry; + struct VasEBoot_pe32_data_directory export_table; + struct VasEBoot_pe32_data_directory import_table; + struct VasEBoot_pe32_data_directory resource_table; + struct VasEBoot_pe32_data_directory exception_table; + struct VasEBoot_pe32_data_directory certificate_table; + struct VasEBoot_pe32_data_directory base_relocation_table; + struct VasEBoot_pe32_data_directory debug; + struct VasEBoot_pe32_data_directory architecture; + struct VasEBoot_pe32_data_directory global_ptr; + struct VasEBoot_pe32_data_directory tls_table; + struct VasEBoot_pe32_data_directory load_config_table; + struct VasEBoot_pe32_data_directory bound_import; + struct VasEBoot_pe32_data_directory iat; + struct VasEBoot_pe32_data_directory delay_import_descriptor; + struct VasEBoot_pe32_data_directory com_runtime_header; + struct VasEBoot_pe32_data_directory reserved_entry; }; -struct grub_pe64_optional_header +struct VasEBoot_pe64_optional_header { - grub_uint16_t magic; - grub_uint8_t major_linker_version; - grub_uint8_t minor_linker_version; - grub_uint32_t code_size; - grub_uint32_t data_size; - grub_uint32_t bss_size; - grub_uint32_t entry_addr; - grub_uint32_t code_base; + VasEBoot_uint16_t magic; + VasEBoot_uint8_t major_linker_version; + VasEBoot_uint8_t minor_linker_version; + VasEBoot_uint32_t code_size; + VasEBoot_uint32_t data_size; + VasEBoot_uint32_t bss_size; + VasEBoot_uint32_t entry_addr; + VasEBoot_uint32_t code_base; - grub_uint64_t image_base; + VasEBoot_uint64_t image_base; - grub_uint32_t section_alignment; - grub_uint32_t file_alignment; - grub_uint16_t major_os_version; - grub_uint16_t minor_os_version; - grub_uint16_t major_image_version; - grub_uint16_t minor_image_version; - grub_uint16_t major_subsystem_version; - grub_uint16_t minor_subsystem_version; - grub_uint32_t reserved; - grub_uint32_t image_size; - grub_uint32_t header_size; - grub_uint32_t checksum; - grub_uint16_t subsystem; - grub_uint16_t dll_characteristics; + VasEBoot_uint32_t section_alignment; + VasEBoot_uint32_t file_alignment; + VasEBoot_uint16_t major_os_version; + VasEBoot_uint16_t minor_os_version; + VasEBoot_uint16_t major_image_version; + VasEBoot_uint16_t minor_image_version; + VasEBoot_uint16_t major_subsystem_version; + VasEBoot_uint16_t minor_subsystem_version; + VasEBoot_uint32_t reserved; + VasEBoot_uint32_t image_size; + VasEBoot_uint32_t header_size; + VasEBoot_uint32_t checksum; + VasEBoot_uint16_t subsystem; + VasEBoot_uint16_t dll_characteristics; - grub_uint64_t stack_reserve_size; - grub_uint64_t stack_commit_size; - grub_uint64_t heap_reserve_size; - grub_uint64_t heap_commit_size; + VasEBoot_uint64_t stack_reserve_size; + VasEBoot_uint64_t stack_commit_size; + VasEBoot_uint64_t heap_reserve_size; + VasEBoot_uint64_t heap_commit_size; - grub_uint32_t loader_flags; - grub_uint32_t num_data_directories; + VasEBoot_uint32_t loader_flags; + VasEBoot_uint32_t num_data_directories; /* Data directories. */ - struct grub_pe32_data_directory export_table; - struct grub_pe32_data_directory import_table; - struct grub_pe32_data_directory resource_table; - struct grub_pe32_data_directory exception_table; - struct grub_pe32_data_directory certificate_table; - struct grub_pe32_data_directory base_relocation_table; - struct grub_pe32_data_directory debug; - struct grub_pe32_data_directory architecture; - struct grub_pe32_data_directory global_ptr; - struct grub_pe32_data_directory tls_table; - struct grub_pe32_data_directory load_config_table; - struct grub_pe32_data_directory bound_import; - struct grub_pe32_data_directory iat; - struct grub_pe32_data_directory delay_import_descriptor; - struct grub_pe32_data_directory com_runtime_header; - struct grub_pe32_data_directory reserved_entry; + struct VasEBoot_pe32_data_directory export_table; + struct VasEBoot_pe32_data_directory import_table; + struct VasEBoot_pe32_data_directory resource_table; + struct VasEBoot_pe32_data_directory exception_table; + struct VasEBoot_pe32_data_directory certificate_table; + struct VasEBoot_pe32_data_directory base_relocation_table; + struct VasEBoot_pe32_data_directory debug; + struct VasEBoot_pe32_data_directory architecture; + struct VasEBoot_pe32_data_directory global_ptr; + struct VasEBoot_pe32_data_directory tls_table; + struct VasEBoot_pe32_data_directory load_config_table; + struct VasEBoot_pe32_data_directory bound_import; + struct VasEBoot_pe32_data_directory iat; + struct VasEBoot_pe32_data_directory delay_import_descriptor; + struct VasEBoot_pe32_data_directory com_runtime_header; + struct VasEBoot_pe32_data_directory reserved_entry; }; -#define GRUB_PE32_PE32_MAGIC 0x10b -#define GRUB_PE32_PE64_MAGIC 0x20b +#define VasEBoot_PE32_PE32_MAGIC 0x10b +#define VasEBoot_PE32_PE64_MAGIC 0x20b -#define GRUB_PE32_SUBSYSTEM_EFI_APPLICATION 10 +#define VasEBoot_PE32_SUBSYSTEM_EFI_APPLICATION 10 -#define GRUB_PE32_NUM_DATA_DIRECTORIES 16 +#define VasEBoot_PE32_NUM_DATA_DIRECTORIES 16 -struct grub_pe32_section_table +struct VasEBoot_pe32_section_table { char name[8]; - grub_uint32_t virtual_size; - grub_uint32_t virtual_address; - grub_uint32_t raw_data_size; - grub_uint32_t raw_data_offset; - grub_uint32_t relocations_offset; - grub_uint32_t line_numbers_offset; - grub_uint16_t num_relocations; - grub_uint16_t num_line_numbers; - grub_uint32_t characteristics; + VasEBoot_uint32_t virtual_size; + VasEBoot_uint32_t virtual_address; + VasEBoot_uint32_t raw_data_size; + VasEBoot_uint32_t raw_data_offset; + VasEBoot_uint32_t relocations_offset; + VasEBoot_uint32_t line_numbers_offset; + VasEBoot_uint16_t num_relocations; + VasEBoot_uint16_t num_line_numbers; + VasEBoot_uint32_t characteristics; }; -#define GRUB_PE32_SCN_CNT_CODE 0x00000020 -#define GRUB_PE32_SCN_CNT_INITIALIZED_DATA 0x00000040 -#define GRUB_PE32_SCN_MEM_DISCARDABLE 0x02000000 -#define GRUB_PE32_SCN_MEM_EXECUTE 0x20000000 -#define GRUB_PE32_SCN_MEM_READ 0x40000000 -#define GRUB_PE32_SCN_MEM_WRITE 0x80000000 +#define VasEBoot_PE32_SCN_CNT_CODE 0x00000020 +#define VasEBoot_PE32_SCN_CNT_INITIALIZED_DATA 0x00000040 +#define VasEBoot_PE32_SCN_MEM_DISCARDABLE 0x02000000 +#define VasEBoot_PE32_SCN_MEM_EXECUTE 0x20000000 +#define VasEBoot_PE32_SCN_MEM_READ 0x40000000 +#define VasEBoot_PE32_SCN_MEM_WRITE 0x80000000 -#define GRUB_PE32_SCN_ALIGN_1BYTES 0x00100000 -#define GRUB_PE32_SCN_ALIGN_2BYTES 0x00200000 -#define GRUB_PE32_SCN_ALIGN_4BYTES 0x00300000 -#define GRUB_PE32_SCN_ALIGN_8BYTES 0x00400000 -#define GRUB_PE32_SCN_ALIGN_16BYTES 0x00500000 -#define GRUB_PE32_SCN_ALIGN_32BYTES 0x00600000 -#define GRUB_PE32_SCN_ALIGN_64BYTES 0x00700000 +#define VasEBoot_PE32_SCN_ALIGN_1BYTES 0x00100000 +#define VasEBoot_PE32_SCN_ALIGN_2BYTES 0x00200000 +#define VasEBoot_PE32_SCN_ALIGN_4BYTES 0x00300000 +#define VasEBoot_PE32_SCN_ALIGN_8BYTES 0x00400000 +#define VasEBoot_PE32_SCN_ALIGN_16BYTES 0x00500000 +#define VasEBoot_PE32_SCN_ALIGN_32BYTES 0x00600000 +#define VasEBoot_PE32_SCN_ALIGN_64BYTES 0x00700000 -#define GRUB_PE32_SCN_ALIGN_SHIFT 20 -#define GRUB_PE32_SCN_ALIGN_MASK 7 +#define VasEBoot_PE32_SCN_ALIGN_SHIFT 20 +#define VasEBoot_PE32_SCN_ALIGN_MASK 7 -#define GRUB_PE32_SIGNATURE_SIZE 4 +#define VasEBoot_PE32_SIGNATURE_SIZE 4 -struct grub_pe32_header +struct VasEBoot_pe32_header { - /* This should be filled in with GRUB_PE32_MSDOS_STUB. */ - grub_uint8_t msdos_stub[GRUB_PE32_MSDOS_STUB_SIZE]; + /* This should be filled in with VasEBoot_PE32_MSDOS_STUB. */ + VasEBoot_uint8_t msdos_stub[VasEBoot_PE32_MSDOS_STUB_SIZE]; /* This is always PE\0\0. */ - char signature[GRUB_PE32_SIGNATURE_SIZE]; + char signature[VasEBoot_PE32_SIGNATURE_SIZE]; /* The COFF file header. */ - struct grub_pe32_coff_header coff_header; + struct VasEBoot_pe32_coff_header coff_header; -#if GRUB_TARGET_SIZEOF_VOID_P == 8 +#if VasEBoot_TARGET_SIZEOF_VOID_P == 8 /* The Optional header. */ - struct grub_pe64_optional_header optional_header; + struct VasEBoot_pe64_optional_header optional_header; #else /* The Optional header. */ - struct grub_pe32_optional_header optional_header; + struct VasEBoot_pe32_optional_header optional_header; #endif }; -struct grub_pe32_fixup_block +struct VasEBoot_pe32_fixup_block { - grub_uint32_t page_rva; - grub_uint32_t block_size; - grub_uint16_t entries[0]; + VasEBoot_uint32_t page_rva; + VasEBoot_uint32_t block_size; + VasEBoot_uint16_t entries[0]; }; -#define GRUB_PE32_FIXUP_ENTRY(type, offset) (((type) << 12) | (offset)) +#define VasEBoot_PE32_FIXUP_ENTRY(type, offset) (((type) << 12) | (offset)) -#define GRUB_PE32_REL_BASED_ABSOLUTE 0 -#define GRUB_PE32_REL_BASED_HIGH 1 -#define GRUB_PE32_REL_BASED_LOW 2 -#define GRUB_PE32_REL_BASED_HIGHLOW 3 -#define GRUB_PE32_REL_BASED_HIGHADJ 4 -#define GRUB_PE32_REL_BASED_MIPS_JMPADDR 5 -#define GRUB_PE32_REL_BASED_ARM_MOV32A 5 -#define GRUB_PE32_REL_BASED_SECTION 6 -#define GRUB_PE32_REL_BASED_REL 7 -#define GRUB_PE32_REL_BASED_ARM_MOV32T 7 -#define GRUB_PE32_REL_BASED_IA64_IMM64 9 -#define GRUB_PE32_REL_BASED_DIR64 10 -#define GRUB_PE32_REL_BASED_HIGH3ADJ 11 +#define VasEBoot_PE32_REL_BASED_ABSOLUTE 0 +#define VasEBoot_PE32_REL_BASED_HIGH 1 +#define VasEBoot_PE32_REL_BASED_LOW 2 +#define VasEBoot_PE32_REL_BASED_HIGHLOW 3 +#define VasEBoot_PE32_REL_BASED_HIGHADJ 4 +#define VasEBoot_PE32_REL_BASED_MIPS_JMPADDR 5 +#define VasEBoot_PE32_REL_BASED_ARM_MOV32A 5 +#define VasEBoot_PE32_REL_BASED_SECTION 6 +#define VasEBoot_PE32_REL_BASED_REL 7 +#define VasEBoot_PE32_REL_BASED_ARM_MOV32T 7 +#define VasEBoot_PE32_REL_BASED_IA64_IMM64 9 +#define VasEBoot_PE32_REL_BASED_DIR64 10 +#define VasEBoot_PE32_REL_BASED_HIGH3ADJ 11 -struct grub_pe32_symbol +struct VasEBoot_pe32_symbol { union { char short_name[8]; - grub_uint32_t long_name[2]; + VasEBoot_uint32_t long_name[2]; }; - grub_uint32_t value; - grub_uint16_t section; - grub_uint16_t type; - grub_uint8_t storage_class; - grub_uint8_t num_aux; -} GRUB_PACKED; + VasEBoot_uint32_t value; + VasEBoot_uint16_t section; + VasEBoot_uint16_t type; + VasEBoot_uint8_t storage_class; + VasEBoot_uint8_t num_aux; +} VasEBoot_PACKED; -#define GRUB_PE32_SYM_CLASS_EXTERNAL 2 -#define GRUB_PE32_SYM_CLASS_STATIC 3 -#define GRUB_PE32_SYM_CLASS_FILE 0x67 +#define VasEBoot_PE32_SYM_CLASS_EXTERNAL 2 +#define VasEBoot_PE32_SYM_CLASS_STATIC 3 +#define VasEBoot_PE32_SYM_CLASS_FILE 0x67 -#define GRUB_PE32_DT_FUNCTION 0x20 +#define VasEBoot_PE32_DT_FUNCTION 0x20 -struct grub_pe32_reloc +struct VasEBoot_pe32_reloc { - grub_uint32_t offset; - grub_uint32_t symtab_index; - grub_uint16_t type; -} GRUB_PACKED; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t symtab_index; + VasEBoot_uint16_t type; +} VasEBoot_PACKED; -#define GRUB_PE32_REL_I386_DIR32 0x6 -#define GRUB_PE32_REL_I386_REL32 0x14 +#define VasEBoot_PE32_REL_I386_DIR32 0x6 +#define VasEBoot_PE32_REL_I386_REL32 0x14 -#endif /* ! GRUB_EFI_PE32_HEADER */ +#endif /* ! VasEBoot_EFI_PE32_HEADER */ diff --git a/include/VasEBoot/efi/tpm.h b/include/VasEBoot/efi/tpm.h index 63d8a0fe7..19a802a51 100644 --- a/include/VasEBoot/efi/tpm.h +++ b/include/VasEBoot/efi/tpm.h @@ -1,152 +1,152 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_TPM_HEADER -#define GRUB_EFI_TPM_HEADER 1 +#ifndef VasEBoot_EFI_TPM_HEADER +#define VasEBoot_EFI_TPM_HEADER 1 #define EFI_TPM_GUID {0xf541796d, 0xa62e, 0x4954, {0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd }}; #define EFI_TPM2_GUID {0x607f766c, 0x7455, 0x42be, {0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f }}; typedef struct { - grub_efi_uint8_t Major; - grub_efi_uint8_t Minor; - grub_efi_uint8_t RevMajor; - grub_efi_uint8_t RevMinor; + VasEBoot_efi_uint8_t Major; + VasEBoot_efi_uint8_t Minor; + VasEBoot_efi_uint8_t RevMajor; + VasEBoot_efi_uint8_t RevMinor; } TCG_VERSION; typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY { - grub_efi_uint8_t Size; /// Size of this structure. + VasEBoot_efi_uint8_t Size; /// Size of this structure. TCG_VERSION StructureVersion; TCG_VERSION ProtocolSpecVersion; - grub_efi_uint8_t HashAlgorithmBitmap; /// Hash algorithms . + VasEBoot_efi_uint8_t HashAlgorithmBitmap; /// Hash algorithms . char TPMPresentFlag; /// 00h = TPM not present. char TPMDeactivatedFlag; /// 01h = TPM currently deactivated. } TCG_EFI_BOOT_SERVICE_CAPABILITY; typedef struct { - grub_efi_uint32_t PCRIndex; - grub_efi_uint32_t EventType; - grub_efi_uint8_t digest[20]; - grub_efi_uint32_t EventSize; - grub_efi_uint8_t Event[1]; + VasEBoot_efi_uint32_t PCRIndex; + VasEBoot_efi_uint32_t EventType; + VasEBoot_efi_uint8_t digest[20]; + VasEBoot_efi_uint32_t EventSize; + VasEBoot_efi_uint8_t Event[1]; } TCG_PCR_EVENT; -struct grub_efi_tpm_protocol +struct VasEBoot_efi_tpm_protocol { - grub_efi_status_t (*status_check) (struct grub_efi_tpm_protocol *this, + VasEBoot_efi_status_t (*status_check) (struct VasEBoot_efi_tpm_protocol *this, TCG_EFI_BOOT_SERVICE_CAPABILITY *ProtocolCapability, - grub_efi_uint32_t *TCGFeatureFlags, - grub_efi_physical_address_t *EventLogLocation, - grub_efi_physical_address_t *EventLogLastEntry); - grub_efi_status_t (*hash_all) (struct grub_efi_tpm_protocol *this, - grub_efi_uint8_t *HashData, - grub_efi_uint64_t HashLen, - grub_efi_uint32_t AlgorithmId, - grub_efi_uint64_t *HashedDataLen, - grub_efi_uint8_t **HashedDataResult); - grub_efi_status_t (*log_event) (struct grub_efi_tpm_protocol *this, + VasEBoot_efi_uint32_t *TCGFeatureFlags, + VasEBoot_efi_physical_address_t *EventLogLocation, + VasEBoot_efi_physical_address_t *EventLogLastEntry); + VasEBoot_efi_status_t (*hash_all) (struct VasEBoot_efi_tpm_protocol *this, + VasEBoot_efi_uint8_t *HashData, + VasEBoot_efi_uint64_t HashLen, + VasEBoot_efi_uint32_t AlgorithmId, + VasEBoot_efi_uint64_t *HashedDataLen, + VasEBoot_efi_uint8_t **HashedDataResult); + VasEBoot_efi_status_t (*log_event) (struct VasEBoot_efi_tpm_protocol *this, TCG_PCR_EVENT *TCGLogData, - grub_efi_uint32_t *EventNumber, - grub_efi_uint32_t Flags); - grub_efi_status_t (*pass_through_to_tpm) (struct grub_efi_tpm_protocol *this, - grub_efi_uint32_t TpmInputParameterBlockSize, - grub_efi_uint8_t *TpmInputParameterBlock, - grub_efi_uint32_t TpmOutputParameterBlockSize, - grub_efi_uint8_t *TpmOutputParameterBlock); - grub_efi_status_t (*log_extend_event) (struct grub_efi_tpm_protocol *this, - grub_efi_physical_address_t HashData, - grub_efi_uint64_t HashDataLen, - grub_efi_uint32_t AlgorithmId, + VasEBoot_efi_uint32_t *EventNumber, + VasEBoot_efi_uint32_t Flags); + VasEBoot_efi_status_t (*pass_through_to_tpm) (struct VasEBoot_efi_tpm_protocol *this, + VasEBoot_efi_uint32_t TpmInputParameterBlockSize, + VasEBoot_efi_uint8_t *TpmInputParameterBlock, + VasEBoot_efi_uint32_t TpmOutputParameterBlockSize, + VasEBoot_efi_uint8_t *TpmOutputParameterBlock); + VasEBoot_efi_status_t (*log_extend_event) (struct VasEBoot_efi_tpm_protocol *this, + VasEBoot_efi_physical_address_t HashData, + VasEBoot_efi_uint64_t HashDataLen, + VasEBoot_efi_uint32_t AlgorithmId, TCG_PCR_EVENT *TCGLogData, - grub_efi_uint32_t *EventNumber, - grub_efi_physical_address_t *EventLogLastEntry); + VasEBoot_efi_uint32_t *EventNumber, + VasEBoot_efi_physical_address_t *EventLogLastEntry); }; -typedef struct grub_efi_tpm_protocol grub_efi_tpm_protocol_t; +typedef struct VasEBoot_efi_tpm_protocol VasEBoot_efi_tpm_protocol_t; -typedef grub_efi_uint32_t EFI_TCG2_EVENT_LOG_BITMAP; -typedef grub_efi_uint32_t EFI_TCG2_EVENT_LOG_FORMAT; -typedef grub_efi_uint32_t EFI_TCG2_EVENT_ALGORITHM_BITMAP; +typedef VasEBoot_efi_uint32_t EFI_TCG2_EVENT_LOG_BITMAP; +typedef VasEBoot_efi_uint32_t EFI_TCG2_EVENT_LOG_FORMAT; +typedef VasEBoot_efi_uint32_t EFI_TCG2_EVENT_ALGORITHM_BITMAP; typedef struct tdEFI_TCG2_VERSION { - grub_efi_uint8_t Major; - grub_efi_uint8_t Minor; -} GRUB_PACKED EFI_TCG2_VERSION; + VasEBoot_efi_uint8_t Major; + VasEBoot_efi_uint8_t Minor; +} VasEBoot_PACKED EFI_TCG2_VERSION; typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY { - grub_efi_uint8_t Size; + VasEBoot_efi_uint8_t Size; EFI_TCG2_VERSION StructureVersion; EFI_TCG2_VERSION ProtocolVersion; EFI_TCG2_EVENT_ALGORITHM_BITMAP HashAlgorithmBitmap; EFI_TCG2_EVENT_LOG_BITMAP SupportedEventLogs; - grub_efi_boolean_t TPMPresentFlag; - grub_efi_uint16_t MaxCommandSize; - grub_efi_uint16_t MaxResponseSize; - grub_efi_uint32_t ManufacturerID; - grub_efi_uint32_t NumberOfPcrBanks; + VasEBoot_efi_boolean_t TPMPresentFlag; + VasEBoot_efi_uint16_t MaxCommandSize; + VasEBoot_efi_uint16_t MaxResponseSize; + VasEBoot_efi_uint32_t ManufacturerID; + VasEBoot_efi_uint32_t NumberOfPcrBanks; EFI_TCG2_EVENT_ALGORITHM_BITMAP ActivePcrBanks; } EFI_TCG2_BOOT_SERVICE_CAPABILITY; -typedef grub_efi_uint32_t TCG_PCRINDEX; -typedef grub_efi_uint32_t TCG_EVENTTYPE; +typedef VasEBoot_efi_uint32_t TCG_PCRINDEX; +typedef VasEBoot_efi_uint32_t TCG_EVENTTYPE; typedef struct tdEFI_TCG2_EVENT_HEADER { - grub_efi_uint32_t HeaderSize; - grub_efi_uint16_t HeaderVersion; + VasEBoot_efi_uint32_t HeaderSize; + VasEBoot_efi_uint16_t HeaderVersion; TCG_PCRINDEX PCRIndex; TCG_EVENTTYPE EventType; -} GRUB_PACKED EFI_TCG2_EVENT_HEADER; +} VasEBoot_PACKED EFI_TCG2_EVENT_HEADER; typedef struct tdEFI_TCG2_EVENT { - grub_efi_uint32_t Size; + VasEBoot_efi_uint32_t Size; EFI_TCG2_EVENT_HEADER Header; - grub_efi_uint8_t Event[1]; -} GRUB_PACKED EFI_TCG2_EVENT; + VasEBoot_efi_uint8_t Event[1]; +} VasEBoot_PACKED EFI_TCG2_EVENT; -struct grub_efi_tpm2_protocol +struct VasEBoot_efi_tpm2_protocol { - grub_efi_status_t (*get_capability) (struct grub_efi_tpm2_protocol *this, + VasEBoot_efi_status_t (*get_capability) (struct VasEBoot_efi_tpm2_protocol *this, EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability); - grub_efi_status_t (*get_event_log) (struct grub_efi_tpm2_protocol *this, + VasEBoot_efi_status_t (*get_event_log) (struct VasEBoot_efi_tpm2_protocol *this, EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat, - grub_efi_physical_address_t *EventLogLocation, - grub_efi_physical_address_t *EventLogLastEntry, - grub_efi_boolean_t *EventLogTruncated); - grub_efi_status_t (*hash_log_extend_event) (struct grub_efi_tpm2_protocol *this, - grub_efi_uint64_t Flags, - grub_efi_physical_address_t DataToHash, - grub_efi_uint64_t DataToHashLen, + VasEBoot_efi_physical_address_t *EventLogLocation, + VasEBoot_efi_physical_address_t *EventLogLastEntry, + VasEBoot_efi_boolean_t *EventLogTruncated); + VasEBoot_efi_status_t (*hash_log_extend_event) (struct VasEBoot_efi_tpm2_protocol *this, + VasEBoot_efi_uint64_t Flags, + VasEBoot_efi_physical_address_t DataToHash, + VasEBoot_efi_uint64_t DataToHashLen, EFI_TCG2_EVENT *EfiTcgEvent); - grub_efi_status_t (*submit_command) (struct grub_efi_tpm2_protocol *this, - grub_efi_uint32_t InputParameterBlockSize, - grub_efi_uint8_t *InputParameterBlock, - grub_efi_uint32_t OutputParameterBlockSize, - grub_efi_uint8_t *OutputParameterBlock); - grub_efi_status_t (*get_active_pcr_blanks) (struct grub_efi_tpm2_protocol *this, - grub_efi_uint32_t *ActivePcrBanks); - grub_efi_status_t (*set_active_pcr_banks) (struct grub_efi_tpm2_protocol *this, - grub_efi_uint32_t ActivePcrBanks); - grub_efi_status_t (*get_result_of_set_active_pcr_banks) (struct grub_efi_tpm2_protocol *this, - grub_efi_uint32_t *OperationPresent, - grub_efi_uint32_t *Response); + VasEBoot_efi_status_t (*submit_command) (struct VasEBoot_efi_tpm2_protocol *this, + VasEBoot_efi_uint32_t InputParameterBlockSize, + VasEBoot_efi_uint8_t *InputParameterBlock, + VasEBoot_efi_uint32_t OutputParameterBlockSize, + VasEBoot_efi_uint8_t *OutputParameterBlock); + VasEBoot_efi_status_t (*get_active_pcr_blanks) (struct VasEBoot_efi_tpm2_protocol *this, + VasEBoot_efi_uint32_t *ActivePcrBanks); + VasEBoot_efi_status_t (*set_active_pcr_banks) (struct VasEBoot_efi_tpm2_protocol *this, + VasEBoot_efi_uint32_t ActivePcrBanks); + VasEBoot_efi_status_t (*get_result_of_set_active_pcr_banks) (struct VasEBoot_efi_tpm2_protocol *this, + VasEBoot_efi_uint32_t *OperationPresent, + VasEBoot_efi_uint32_t *Response); }; -typedef struct grub_efi_tpm2_protocol grub_efi_tpm2_protocol_t; +typedef struct VasEBoot_efi_tpm2_protocol VasEBoot_efi_tpm2_protocol_t; #define TCG_ALG_SHA 0x00000004 diff --git a/include/VasEBoot/efi/uga_draw.h b/include/VasEBoot/efi/uga_draw.h index a31f2672e..f3d4e604c 100644 --- a/include/VasEBoot/efi/uga_draw.h +++ b/include/VasEBoot/efi/uga_draw.h @@ -1,76 +1,76 @@ /* uga_draw.h - definitions of the uga draw protocol */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* The console control protocol is not a part of the EFI spec, but defined in Intel's Sample Implementation. */ -#ifndef GRUB_EFI_UGA_DRAW_HEADER -#define GRUB_EFI_UGA_DRAW_HEADER 1 +#ifndef VasEBoot_EFI_UGA_DRAW_HEADER +#define VasEBoot_EFI_UGA_DRAW_HEADER 1 -#define GRUB_EFI_UGA_DRAW_GUID \ +#define VasEBoot_EFI_UGA_DRAW_GUID \ { 0x982c298b, 0xf4fa, 0x41cb, { 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 }} -enum grub_efi_uga_blt_operation +enum VasEBoot_efi_uga_blt_operation { - GRUB_EFI_UGA_VIDEO_FILL, - GRUB_EFI_UGA_VIDEO_TO_BLT, - GRUB_EFI_UGA_BLT_TO_VIDEO, - GRUB_EFI_UGA_VIDEO_TO_VIDEO, - GRUB_EFI_UGA_BLT_MAX + VasEBoot_EFI_UGA_VIDEO_FILL, + VasEBoot_EFI_UGA_VIDEO_TO_BLT, + VasEBoot_EFI_UGA_BLT_TO_VIDEO, + VasEBoot_EFI_UGA_VIDEO_TO_VIDEO, + VasEBoot_EFI_UGA_BLT_MAX }; -struct grub_efi_uga_pixel +struct VasEBoot_efi_uga_pixel { - grub_uint8_t Blue; - grub_uint8_t Green; - grub_uint8_t Red; - grub_uint8_t Reserved; + VasEBoot_uint8_t Blue; + VasEBoot_uint8_t Green; + VasEBoot_uint8_t Red; + VasEBoot_uint8_t Reserved; }; -struct grub_efi_uga_draw_protocol +struct VasEBoot_efi_uga_draw_protocol { - grub_efi_status_t - (*get_mode) (struct grub_efi_uga_draw_protocol *this, - grub_uint32_t *width, - grub_uint32_t *height, - grub_uint32_t *depth, - grub_uint32_t *refresh_rate); + VasEBoot_efi_status_t + (*get_mode) (struct VasEBoot_efi_uga_draw_protocol *this, + VasEBoot_uint32_t *width, + VasEBoot_uint32_t *height, + VasEBoot_uint32_t *depth, + VasEBoot_uint32_t *refresh_rate); - grub_efi_status_t - (*set_mode) (struct grub_efi_uga_draw_protocol *this, - grub_uint32_t width, - grub_uint32_t height, - grub_uint32_t depth, - grub_uint32_t refresh_rate); + VasEBoot_efi_status_t + (*set_mode) (struct VasEBoot_efi_uga_draw_protocol *this, + VasEBoot_uint32_t width, + VasEBoot_uint32_t height, + VasEBoot_uint32_t depth, + VasEBoot_uint32_t refresh_rate); - grub_efi_status_t - (*blt) (struct grub_efi_uga_draw_protocol *this, - struct grub_efi_uga_pixel *blt_buffer, - enum grub_efi_uga_blt_operation blt_operation, - grub_efi_uintn_t src_x, - grub_efi_uintn_t src_y, - grub_efi_uintn_t dest_x, - grub_efi_uintn_t dest_y, - grub_efi_uintn_t width, - grub_efi_uintn_t height, - grub_efi_uintn_t delta); + VasEBoot_efi_status_t + (*blt) (struct VasEBoot_efi_uga_draw_protocol *this, + struct VasEBoot_efi_uga_pixel *blt_buffer, + enum VasEBoot_efi_uga_blt_operation blt_operation, + VasEBoot_efi_uintn_t src_x, + VasEBoot_efi_uintn_t src_y, + VasEBoot_efi_uintn_t dest_x, + VasEBoot_efi_uintn_t dest_y, + VasEBoot_efi_uintn_t width, + VasEBoot_efi_uintn_t height, + VasEBoot_efi_uintn_t delta); }; -typedef struct grub_efi_uga_draw_protocol grub_efi_uga_draw_protocol_t; +typedef struct VasEBoot_efi_uga_draw_protocol VasEBoot_efi_uga_draw_protocol_t; -#endif /* ! GRUB_EFI_UGA_DRAW_HEADER */ +#endif /* ! VasEBoot_EFI_UGA_DRAW_HEADER */ diff --git a/include/VasEBoot/efiemu/efiemu.h b/include/VasEBoot/efiemu/efiemu.h index 5325e5839..ac14d482a 100644 --- a/include/VasEBoot/efiemu/efiemu.h +++ b/include/VasEBoot/efiemu/efiemu.h @@ -1,286 +1,286 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_EMU_HEADER -#define GRUB_EFI_EMU_HEADER 1 +#ifndef VasEBoot_EFI_EMU_HEADER +#define VasEBoot_EFI_EMU_HEADER 1 -#include -#include -#include +#include +#include +#include -#define GRUB_EFIEMU_PAGESIZE 4096 +#define VasEBoot_EFIEMU_PAGESIZE 4096 /* EFI api defined in 32-bit and 64-bit version*/ -struct grub_efi_system_table32 +struct VasEBoot_efi_system_table32 { - grub_efi_table_header_t hdr; - grub_efi_uint32_t firmware_vendor; - grub_efi_uint32_t firmware_revision; - grub_efi_uint32_t console_in_handler; - grub_efi_uint32_t con_in; - grub_efi_uint32_t console_out_handler; - grub_efi_uint32_t con_out; - grub_efi_uint32_t standard_error_handle; - grub_efi_uint32_t std_err; - grub_efi_uint32_t runtime_services; - grub_efi_uint32_t boot_services; - grub_efi_uint32_t num_table_entries; - grub_efi_uint32_t configuration_table; -} GRUB_PACKED; -typedef struct grub_efi_system_table32 grub_efi_system_table32_t; + VasEBoot_efi_table_header_t hdr; + VasEBoot_efi_uint32_t firmware_vendor; + VasEBoot_efi_uint32_t firmware_revision; + VasEBoot_efi_uint32_t console_in_handler; + VasEBoot_efi_uint32_t con_in; + VasEBoot_efi_uint32_t console_out_handler; + VasEBoot_efi_uint32_t con_out; + VasEBoot_efi_uint32_t standard_error_handle; + VasEBoot_efi_uint32_t std_err; + VasEBoot_efi_uint32_t runtime_services; + VasEBoot_efi_uint32_t boot_services; + VasEBoot_efi_uint32_t num_table_entries; + VasEBoot_efi_uint32_t configuration_table; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_system_table32 VasEBoot_efi_system_table32_t; -struct grub_efi_system_table64 +struct VasEBoot_efi_system_table64 { - grub_efi_table_header_t hdr; - grub_efi_uint64_t firmware_vendor; - grub_efi_uint32_t firmware_revision; - grub_efi_uint32_t pad; - grub_efi_uint64_t console_in_handler; - grub_efi_uint64_t con_in; - grub_efi_uint64_t console_out_handler; - grub_efi_uint64_t con_out; - grub_efi_uint64_t standard_error_handle; - grub_efi_uint64_t std_err; - grub_efi_uint64_t runtime_services; - grub_efi_uint64_t boot_services; - grub_efi_uint64_t num_table_entries; - grub_efi_uint64_t configuration_table; -} GRUB_PACKED; -typedef struct grub_efi_system_table64 grub_efi_system_table64_t; + VasEBoot_efi_table_header_t hdr; + VasEBoot_efi_uint64_t firmware_vendor; + VasEBoot_efi_uint32_t firmware_revision; + VasEBoot_efi_uint32_t pad; + VasEBoot_efi_uint64_t console_in_handler; + VasEBoot_efi_uint64_t con_in; + VasEBoot_efi_uint64_t console_out_handler; + VasEBoot_efi_uint64_t con_out; + VasEBoot_efi_uint64_t standard_error_handle; + VasEBoot_efi_uint64_t std_err; + VasEBoot_efi_uint64_t runtime_services; + VasEBoot_efi_uint64_t boot_services; + VasEBoot_efi_uint64_t num_table_entries; + VasEBoot_efi_uint64_t configuration_table; +} VasEBoot_PACKED; +typedef struct VasEBoot_efi_system_table64 VasEBoot_efi_system_table64_t; -struct grub_efiemu_runtime_services32 +struct VasEBoot_efiemu_runtime_services32 { - grub_efi_table_header_t hdr; - grub_efi_uint32_t get_time; - grub_efi_uint32_t set_time; - grub_efi_uint32_t get_wakeup_time; - grub_efi_uint32_t set_wakeup_time; - grub_efi_uint32_t set_virtual_address_map; - grub_efi_uint32_t convert_pointer; - grub_efi_uint32_t get_variable; - grub_efi_uint32_t get_next_variable_name; - grub_efi_uint32_t set_variable; - grub_efi_uint32_t get_next_high_monotonic_count; - grub_efi_uint32_t reset_system; -} GRUB_PACKED; -typedef struct grub_efiemu_runtime_services32 grub_efiemu_runtime_services32_t; + VasEBoot_efi_table_header_t hdr; + VasEBoot_efi_uint32_t get_time; + VasEBoot_efi_uint32_t set_time; + VasEBoot_efi_uint32_t get_wakeup_time; + VasEBoot_efi_uint32_t set_wakeup_time; + VasEBoot_efi_uint32_t set_virtual_address_map; + VasEBoot_efi_uint32_t convert_pointer; + VasEBoot_efi_uint32_t get_variable; + VasEBoot_efi_uint32_t get_next_variable_name; + VasEBoot_efi_uint32_t set_variable; + VasEBoot_efi_uint32_t get_next_high_monotonic_count; + VasEBoot_efi_uint32_t reset_system; +} VasEBoot_PACKED; +typedef struct VasEBoot_efiemu_runtime_services32 VasEBoot_efiemu_runtime_services32_t; -struct grub_efiemu_runtime_services64 +struct VasEBoot_efiemu_runtime_services64 { - grub_efi_table_header_t hdr; - grub_efi_uint64_t get_time; - grub_efi_uint64_t set_time; - grub_efi_uint64_t get_wakeup_time; - grub_efi_uint64_t set_wakeup_time; - grub_efi_uint64_t set_virtual_address_map; - grub_efi_uint64_t convert_pointer; - grub_efi_uint64_t get_variable; - grub_efi_uint64_t get_next_variable_name; - grub_efi_uint64_t set_variable; - grub_efi_uint64_t get_next_high_monotonic_count; - grub_efi_uint64_t reset_system; -} GRUB_PACKED; -typedef struct grub_efiemu_runtime_services64 grub_efiemu_runtime_services64_t; + VasEBoot_efi_table_header_t hdr; + VasEBoot_efi_uint64_t get_time; + VasEBoot_efi_uint64_t set_time; + VasEBoot_efi_uint64_t get_wakeup_time; + VasEBoot_efi_uint64_t set_wakeup_time; + VasEBoot_efi_uint64_t set_virtual_address_map; + VasEBoot_efi_uint64_t convert_pointer; + VasEBoot_efi_uint64_t get_variable; + VasEBoot_efi_uint64_t get_next_variable_name; + VasEBoot_efi_uint64_t set_variable; + VasEBoot_efi_uint64_t get_next_high_monotonic_count; + VasEBoot_efi_uint64_t reset_system; +} VasEBoot_PACKED; +typedef struct VasEBoot_efiemu_runtime_services64 VasEBoot_efiemu_runtime_services64_t; -extern grub_efi_system_table32_t *grub_efiemu_system_table32; -extern grub_efi_system_table64_t *grub_efiemu_system_table64; +extern VasEBoot_efi_system_table32_t *VasEBoot_efiemu_system_table32; +extern VasEBoot_efi_system_table64_t *VasEBoot_efiemu_system_table64; /* Convenience macros to access currently loaded efiemu */ -#define grub_efiemu_system_table ((grub_efiemu_sizeof_uintn_t () == 8) \ - ? (void *) grub_efiemu_system_table64 \ - : (void *) grub_efiemu_system_table32) -#define GRUB_EFIEMU_SIZEOF_OF_UINTN (grub_efiemu_sizeof_uintn_t ()) -#define GRUB_EFIEMU_SYSTEM_TABLE(x) ((grub_efiemu_sizeof_uintn_t () == 8) \ - ? grub_efiemu_system_table64->x \ - : grub_efiemu_system_table32->x) -#define GRUB_EFIEMU_SYSTEM_TABLE_SET(x,y) ((grub_efiemu_sizeof_uintn_t () == 8)\ - ? (grub_efiemu_system_table64->x \ +#define VasEBoot_efiemu_system_table ((VasEBoot_efiemu_sizeof_uintn_t () == 8) \ + ? (void *) VasEBoot_efiemu_system_table64 \ + : (void *) VasEBoot_efiemu_system_table32) +#define VasEBoot_EFIEMU_SIZEOF_OF_UINTN (VasEBoot_efiemu_sizeof_uintn_t ()) +#define VasEBoot_EFIEMU_SYSTEM_TABLE(x) ((VasEBoot_efiemu_sizeof_uintn_t () == 8) \ + ? VasEBoot_efiemu_system_table64->x \ + : VasEBoot_efiemu_system_table32->x) +#define VasEBoot_EFIEMU_SYSTEM_TABLE_SET(x,y) ((VasEBoot_efiemu_sizeof_uintn_t () == 8)\ + ? (VasEBoot_efiemu_system_table64->x \ = (y)) \ - : (grub_efiemu_system_table32->x \ + : (VasEBoot_efiemu_system_table32->x \ = (y))) -#define GRUB_EFIEMU_SYSTEM_TABLE_PTR(x) ((grub_efiemu_sizeof_uintn_t () == 8)\ - ? (void *) (grub_addr_t) \ - (grub_efiemu_system_table64->x) \ - : (void *) (grub_addr_t) \ - (grub_efiemu_system_table32->x)) -#define GRUB_EFIEMU_SYSTEM_TABLE_VAR(x) ((grub_efiemu_sizeof_uintn_t () == 8) \ +#define VasEBoot_EFIEMU_SYSTEM_TABLE_PTR(x) ((VasEBoot_efiemu_sizeof_uintn_t () == 8)\ + ? (void *) (VasEBoot_addr_t) \ + (VasEBoot_efiemu_system_table64->x) \ + : (void *) (VasEBoot_addr_t) \ + (VasEBoot_efiemu_system_table32->x)) +#define VasEBoot_EFIEMU_SYSTEM_TABLE_VAR(x) ((VasEBoot_efiemu_sizeof_uintn_t () == 8) \ ? (void *) \ - &(grub_efiemu_system_table64->x) \ + &(VasEBoot_efiemu_system_table64->x) \ : (void *) \ - &(grub_efiemu_system_table32->x)) -#define GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF(x) \ - ((grub_efiemu_sizeof_uintn_t () == 8) \ - ? sizeof(grub_efiemu_system_table64->x)\ - : sizeof(grub_efiemu_system_table32->x)) -#define GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF_TOTAL ((grub_efiemu_sizeof_uintn_t () == 8) ? sizeof(*grub_efiemu_system_table64):sizeof(*grub_efiemu_system_table32)) + &(VasEBoot_efiemu_system_table32->x)) +#define VasEBoot_EFIEMU_SYSTEM_TABLE_SIZEOF(x) \ + ((VasEBoot_efiemu_sizeof_uintn_t () == 8) \ + ? sizeof(VasEBoot_efiemu_system_table64->x)\ + : sizeof(VasEBoot_efiemu_system_table32->x)) +#define VasEBoot_EFIEMU_SYSTEM_TABLE_SIZEOF_TOTAL ((VasEBoot_efiemu_sizeof_uintn_t () == 8) ? sizeof(*VasEBoot_efiemu_system_table64):sizeof(*VasEBoot_efiemu_system_table32)) /* ELF management definitions and functions */ -struct grub_efiemu_segment +struct VasEBoot_efiemu_segment { - struct grub_efiemu_segment *next; - grub_size_t size; + struct VasEBoot_efiemu_segment *next; + VasEBoot_size_t size; unsigned section; int handle; int ptv_rel_needed; - grub_off_t off; + VasEBoot_off_t off; void *srcptr; }; -typedef struct grub_efiemu_segment *grub_efiemu_segment_t; +typedef struct VasEBoot_efiemu_segment *VasEBoot_efiemu_segment_t; -struct grub_efiemu_elf_sym +struct VasEBoot_efiemu_elf_sym { int handle; - grub_off_t off; + VasEBoot_off_t off; unsigned section; }; -int grub_efiemu_check_header32 (void *ehdr, grub_size_t size); -int grub_efiemu_check_header64 (void *ehdr, grub_size_t size); -grub_err_t grub_efiemu_loadcore_init32 (void *core, +int VasEBoot_efiemu_check_header32 (void *ehdr, VasEBoot_size_t size); +int VasEBoot_efiemu_check_header64 (void *ehdr, VasEBoot_size_t size); +VasEBoot_err_t VasEBoot_efiemu_loadcore_init32 (void *core, const char *filename, - grub_size_t core_size, - grub_efiemu_segment_t *segments); -grub_err_t grub_efiemu_loadcore_init64 (void *core, const char *filename, - grub_size_t core_size, - grub_efiemu_segment_t *segments); -grub_err_t grub_efiemu_loadcore_load32 (void *core, - grub_size_t core_size, - grub_efiemu_segment_t segments); -grub_err_t grub_efiemu_loadcore_load64 (void *core, - grub_size_t core_size, - grub_efiemu_segment_t segments); -grub_err_t grub_efiemu_loadcore_unload32 (void); -grub_err_t grub_efiemu_loadcore_unload64 (void); -grub_err_t grub_efiemu_loadcore_unload(void); -grub_err_t grub_efiemu_loadcore_init (grub_file_t file, + VasEBoot_size_t core_size, + VasEBoot_efiemu_segment_t *segments); +VasEBoot_err_t VasEBoot_efiemu_loadcore_init64 (void *core, const char *filename, + VasEBoot_size_t core_size, + VasEBoot_efiemu_segment_t *segments); +VasEBoot_err_t VasEBoot_efiemu_loadcore_load32 (void *core, + VasEBoot_size_t core_size, + VasEBoot_efiemu_segment_t segments); +VasEBoot_err_t VasEBoot_efiemu_loadcore_load64 (void *core, + VasEBoot_size_t core_size, + VasEBoot_efiemu_segment_t segments); +VasEBoot_err_t VasEBoot_efiemu_loadcore_unload32 (void); +VasEBoot_err_t VasEBoot_efiemu_loadcore_unload64 (void); +VasEBoot_err_t VasEBoot_efiemu_loadcore_unload(void); +VasEBoot_err_t VasEBoot_efiemu_loadcore_init (VasEBoot_file_t file, const char *filename); -grub_err_t grub_efiemu_loadcore_load (void); +VasEBoot_err_t VasEBoot_efiemu_loadcore_load (void); /* Configuration tables manipulation. Definitions and functions */ -struct grub_efiemu_configuration_table +struct VasEBoot_efiemu_configuration_table { - struct grub_efiemu_configuration_table *next; - grub_efi_guid_t guid; + struct VasEBoot_efiemu_configuration_table *next; + VasEBoot_efi_guid_t guid; void * (*get_table) (void *data); void (*unload) (void *data); void *data; }; -struct grub_efiemu_configuration_table32 +struct VasEBoot_efiemu_configuration_table32 { - grub_efi_packed_guid_t vendor_guid; - grub_efi_uint32_t vendor_table; -} GRUB_PACKED; -typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table32_t; -struct grub_efiemu_configuration_table64 + VasEBoot_efi_packed_guid_t vendor_guid; + VasEBoot_efi_uint32_t vendor_table; +} VasEBoot_PACKED; +typedef struct VasEBoot_efiemu_configuration_table32 VasEBoot_efiemu_configuration_table32_t; +struct VasEBoot_efiemu_configuration_table64 { - grub_efi_packed_guid_t vendor_guid; - grub_efi_uint64_t vendor_table; -} GRUB_PACKED; -typedef struct grub_efiemu_configuration_table64 grub_efiemu_configuration_table64_t; -grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid); -grub_err_t -grub_efiemu_register_configuration_table (grub_efi_guid_t guid, + VasEBoot_efi_packed_guid_t vendor_guid; + VasEBoot_efi_uint64_t vendor_table; +} VasEBoot_PACKED; +typedef struct VasEBoot_efiemu_configuration_table64 VasEBoot_efiemu_configuration_table64_t; +VasEBoot_err_t VasEBoot_efiemu_unregister_configuration_table (VasEBoot_efi_guid_t guid); +VasEBoot_err_t +VasEBoot_efiemu_register_configuration_table (VasEBoot_efi_guid_t guid, void * (*get_table) (void *data), void (*unload) (void *data), void *data); /* Memory management functions */ -int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, - grub_efi_memory_type_t type); -void *grub_efiemu_mm_obtain_request (int handle); -grub_err_t grub_efiemu_mm_unload (void); -grub_err_t grub_efiemu_mm_do_alloc (void); -grub_err_t grub_efiemu_mm_init (void); -void grub_efiemu_mm_return_request (int handle); -grub_efi_memory_type_t grub_efiemu_mm_get_type (int handle); +int VasEBoot_efiemu_request_memalign (VasEBoot_size_t align, VasEBoot_size_t size, + VasEBoot_efi_memory_type_t type); +void *VasEBoot_efiemu_mm_obtain_request (int handle); +VasEBoot_err_t VasEBoot_efiemu_mm_unload (void); +VasEBoot_err_t VasEBoot_efiemu_mm_do_alloc (void); +VasEBoot_err_t VasEBoot_efiemu_mm_init (void); +void VasEBoot_efiemu_mm_return_request (int handle); +VasEBoot_efi_memory_type_t VasEBoot_efiemu_mm_get_type (int handle); -/* Drop-in replacements for grub_efi_* and grub_machine_* */ -int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version); +/* Drop-in replacements for VasEBoot_efi_* and VasEBoot_machine_* */ +int VasEBoot_efiemu_get_memory_map (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version); -grub_err_t -grub_efiemu_finish_boot_services (grub_efi_uintn_t *memory_map_size, - grub_efi_memory_descriptor_t *memory_map, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *descriptor_size, - grub_efi_uint32_t *descriptor_version); +VasEBoot_err_t +VasEBoot_efiemu_finish_boot_services (VasEBoot_efi_uintn_t *memory_map_size, + VasEBoot_efi_memory_descriptor_t *memory_map, + VasEBoot_efi_uintn_t *map_key, + VasEBoot_efi_uintn_t *descriptor_size, + VasEBoot_efi_uint32_t *descriptor_version); -grub_err_t -grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data); -int grub_efiemu_sizeof_uintn_t (void); -grub_err_t -grub_efiemu_get_lower_upper_memory (grub_uint64_t *lower, grub_uint64_t *upper); +VasEBoot_err_t +VasEBoot_efiemu_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data); +int VasEBoot_efiemu_sizeof_uintn_t (void); +VasEBoot_err_t +VasEBoot_efiemu_get_lower_upper_memory (VasEBoot_uint64_t *lower, VasEBoot_uint64_t *upper); /* efiemu main control definitions and functions*/ -typedef enum {GRUB_EFIEMU_NOTLOADED, - GRUB_EFIEMU32, GRUB_EFIEMU64} grub_efiemu_mode_t; -struct grub_efiemu_prepare_hook +typedef enum {VasEBoot_EFIEMU_NOTLOADED, + VasEBoot_EFIEMU32, VasEBoot_EFIEMU64} VasEBoot_efiemu_mode_t; +struct VasEBoot_efiemu_prepare_hook { - struct grub_efiemu_prepare_hook *next; - grub_err_t (*hook) (void *data); + struct VasEBoot_efiemu_prepare_hook *next; + VasEBoot_err_t (*hook) (void *data); void (*unload) (void *data); void *data; }; -grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook +VasEBoot_err_t VasEBoot_efiemu_prepare32 (struct VasEBoot_efiemu_prepare_hook *prepare_hooks, - struct grub_efiemu_configuration_table + struct VasEBoot_efiemu_configuration_table *config_tables); -grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook +VasEBoot_err_t VasEBoot_efiemu_prepare64 (struct VasEBoot_efiemu_prepare_hook *prepare_hooks, - struct grub_efiemu_configuration_table + struct VasEBoot_efiemu_configuration_table *config_tables); -grub_err_t grub_efiemu_unload (void); -grub_err_t grub_efiemu_prepare (void); -grub_err_t -grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), +VasEBoot_err_t VasEBoot_efiemu_unload (void); +VasEBoot_err_t VasEBoot_efiemu_prepare (void); +VasEBoot_err_t +VasEBoot_efiemu_register_prepare_hook (VasEBoot_err_t (*hook) (void *data), void (*unload) (void *data), void *data); /* symbols and pointers */ -grub_err_t grub_efiemu_alloc_syms (void); -grub_err_t grub_efiemu_request_symbols (int num); -grub_err_t grub_efiemu_resolve_symbol (const char *name, - int *handle, grub_off_t *off); -grub_err_t grub_efiemu_register_symbol (const char *name, - int handle, grub_off_t off); -void grub_efiemu_free_syms (void); -grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value, +VasEBoot_err_t VasEBoot_efiemu_alloc_syms (void); +VasEBoot_err_t VasEBoot_efiemu_request_symbols (int num); +VasEBoot_err_t VasEBoot_efiemu_resolve_symbol (const char *name, + int *handle, VasEBoot_off_t *off); +VasEBoot_err_t VasEBoot_efiemu_register_symbol (const char *name, + int handle, VasEBoot_off_t off); +void VasEBoot_efiemu_free_syms (void); +VasEBoot_err_t VasEBoot_efiemu_write_value (void * addr, VasEBoot_uint32_t value, int plus_handle, int minus_handle, int ptv_needed, int size); -grub_err_t grub_efiemu_write_sym_markers (void); -grub_err_t grub_efiemu_pnvram (void); -const char *grub_efiemu_get_default_core_name (void); -void grub_efiemu_pnvram_cmd_unregister (void); -grub_err_t grub_efiemu_autocore (void); -grub_err_t grub_efiemu_crc32 (void); -grub_err_t grub_efiemu_crc64 (void); -grub_err_t -grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version +VasEBoot_err_t VasEBoot_efiemu_write_sym_markers (void); +VasEBoot_err_t VasEBoot_efiemu_pnvram (void); +const char *VasEBoot_efiemu_get_default_core_name (void); +void VasEBoot_efiemu_pnvram_cmd_unregister (void); +VasEBoot_err_t VasEBoot_efiemu_autocore (void); +VasEBoot_err_t VasEBoot_efiemu_crc32 (void); +VasEBoot_err_t VasEBoot_efiemu_crc64 (void); +VasEBoot_err_t +VasEBoot_efiemu_set_virtual_address_map (VasEBoot_efi_uintn_t memory_map_size, + VasEBoot_efi_uintn_t descriptor_size, + VasEBoot_efi_uint32_t descriptor_version __attribute__ ((unused)), - grub_efi_memory_descriptor_t *virtual_map); + VasEBoot_efi_memory_descriptor_t *virtual_map); -grub_err_t grub_machine_efiemu_init_tables (void); +VasEBoot_err_t VasEBoot_machine_efiemu_init_tables (void); -#endif /* ! GRUB_EFI_EMU_HEADER */ +#endif /* ! VasEBoot_EFI_EMU_HEADER */ diff --git a/include/VasEBoot/efiemu/runtime.h b/include/VasEBoot/efiemu/runtime.h index 36d2dedf4..dfd027cee 100644 --- a/include/VasEBoot/efiemu/runtime.h +++ b/include/VasEBoot/efiemu/runtime.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EFI_EMU_RUNTIME_HEADER -#define GRUB_EFI_EMU_RUNTIME_HEADER 1 +#ifndef VasEBoot_EFI_EMU_RUNTIME_HEADER +#define VasEBoot_EFI_EMU_RUNTIME_HEADER 1 -struct grub_efiemu_ptv_rel +struct VasEBoot_efiemu_ptv_rel { - grub_uint64_t addr; - grub_efi_memory_type_t plustype; - grub_efi_memory_type_t minustype; - grub_uint32_t size; -} GRUB_PACKED; + VasEBoot_uint64_t addr; + VasEBoot_efi_memory_type_t plustype; + VasEBoot_efi_memory_type_t minustype; + VasEBoot_uint32_t size; +} VasEBoot_PACKED; struct efi_variable { - grub_efi_packed_guid_t guid; - grub_uint32_t namelen; - grub_uint32_t size; - grub_efi_uint32_t attributes; -} GRUB_PACKED; -#endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */ + VasEBoot_efi_packed_guid_t guid; + VasEBoot_uint32_t namelen; + VasEBoot_uint32_t size; + VasEBoot_efi_uint32_t attributes; +} VasEBoot_PACKED; +#endif /* ! VasEBoot_EFI_EMU_RUNTIME_HEADER */ diff --git a/include/VasEBoot/elf.h b/include/VasEBoot/elf.h index c8492f9dc..0b01ac2fc 100644 --- a/include/VasEBoot/elf.h +++ b/include/VasEBoot/elf.h @@ -17,40 +17,40 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef GRUB_ELF_H -#define GRUB_ELF_H 1 +#ifndef VasEBoot_ELF_H +#define VasEBoot_ELF_H 1 /* Standard ELF types. */ -#include +#include /* Type for a 16-bit quantity. */ -typedef grub_uint16_t Elf32_Half; -typedef grub_uint16_t Elf64_Half; +typedef VasEBoot_uint16_t Elf32_Half; +typedef VasEBoot_uint16_t Elf64_Half; /* Types for signed and unsigned 32-bit quantities. */ -typedef grub_uint32_t Elf32_Word; -typedef grub_int32_t Elf32_Sword; -typedef grub_uint32_t Elf64_Word; -typedef grub_int32_t Elf64_Sword; +typedef VasEBoot_uint32_t Elf32_Word; +typedef VasEBoot_int32_t Elf32_Sword; +typedef VasEBoot_uint32_t Elf64_Word; +typedef VasEBoot_int32_t Elf64_Sword; /* Types for signed and unsigned 64-bit quantities. */ -typedef grub_uint64_t Elf32_Xword; -typedef grub_int64_t Elf32_Sxword; -typedef grub_uint64_t Elf64_Xword; -typedef grub_int64_t Elf64_Sxword; +typedef VasEBoot_uint64_t Elf32_Xword; +typedef VasEBoot_int64_t Elf32_Sxword; +typedef VasEBoot_uint64_t Elf64_Xword; +typedef VasEBoot_int64_t Elf64_Sxword; /* Type of addresses. */ -typedef grub_uint32_t Elf32_Addr; -typedef grub_uint64_t Elf64_Addr; +typedef VasEBoot_uint32_t Elf32_Addr; +typedef VasEBoot_uint64_t Elf64_Addr; /* Type of file offsets. */ -typedef grub_uint32_t Elf32_Off; -typedef grub_uint64_t Elf64_Off; +typedef VasEBoot_uint32_t Elf32_Off; +typedef VasEBoot_uint64_t Elf64_Off; /* Type for section indices, which are 16-bit quantities. */ -typedef grub_uint16_t Elf32_Section; -typedef grub_uint16_t Elf64_Section; +typedef VasEBoot_uint16_t Elf32_Section; +typedef VasEBoot_uint16_t Elf64_Section; /* Type for version symbol information. */ typedef Elf32_Half Elf32_Versym; @@ -1858,148 +1858,148 @@ typedef Elf32_Addr Elf32_Conflict; flag */ /* PowerPC relocations defined by the ABIs */ -#define GRUB_ELF_R_PPC_NONE 0 -#define GRUB_ELF_R_PPC_ADDR32 1 /* 32bit absolute address */ -#define GRUB_ELF_R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ -#define GRUB_ELF_R_PPC_ADDR16 3 /* 16bit absolute address */ -#define GRUB_ELF_R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ -#define GRUB_ELF_R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ -#define GRUB_ELF_R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ -#define GRUB_ELF_R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ -#define GRUB_ELF_R_PPC_ADDR14_BRTAKEN 8 -#define GRUB_ELF_R_PPC_ADDR14_BRNTAKEN 9 -#define GRUB_ELF_R_PPC_REL24 10 /* PC relative 26 bit */ -#define GRUB_ELF_R_PPC_REL14 11 /* PC relative 16 bit */ -#define GRUB_ELF_R_PPC_REL14_BRTAKEN 12 -#define GRUB_ELF_R_PPC_REL14_BRNTAKEN 13 -#define GRUB_ELF_R_PPC_GOT16 14 -#define GRUB_ELF_R_PPC_GOT16_LO 15 -#define GRUB_ELF_R_PPC_GOT16_HI 16 -#define GRUB_ELF_R_PPC_GOT16_HA 17 -#define GRUB_ELF_R_PPC_PLTREL24 18 -#define GRUB_ELF_R_PPC_COPY 19 -#define GRUB_ELF_R_PPC_GLOB_DAT 20 -#define GRUB_ELF_R_PPC_JMP_SLOT 21 -#define GRUB_ELF_R_PPC_RELATIVE 22 -#define GRUB_ELF_R_PPC_LOCAL24PC 23 -#define GRUB_ELF_R_PPC_UADDR32 24 -#define GRUB_ELF_R_PPC_UADDR16 25 -#define GRUB_ELF_R_PPC_REL32 26 -#define GRUB_ELF_R_PPC_PLT32 27 -#define GRUB_ELF_R_PPC_PLTREL32 28 -#define GRUB_ELF_R_PPC_PLT16_LO 29 -#define GRUB_ELF_R_PPC_PLT16_HI 30 -#define GRUB_ELF_R_PPC_PLT16_HA 31 -#define GRUB_ELF_R_PPC_SDAREL16 32 -#define GRUB_ELF_R_PPC_SECTOFF 33 -#define GRUB_ELF_R_PPC_SECTOFF_LO 34 -#define GRUB_ELF_R_PPC_SECTOFF_HI 35 -#define GRUB_ELF_R_PPC_SECTOFF_HA 36 +#define VasEBoot_ELF_R_PPC_NONE 0 +#define VasEBoot_ELF_R_PPC_ADDR32 1 /* 32bit absolute address */ +#define VasEBoot_ELF_R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ +#define VasEBoot_ELF_R_PPC_ADDR16 3 /* 16bit absolute address */ +#define VasEBoot_ELF_R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ +#define VasEBoot_ELF_R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ +#define VasEBoot_ELF_R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ +#define VasEBoot_ELF_R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ +#define VasEBoot_ELF_R_PPC_ADDR14_BRTAKEN 8 +#define VasEBoot_ELF_R_PPC_ADDR14_BRNTAKEN 9 +#define VasEBoot_ELF_R_PPC_REL24 10 /* PC relative 26 bit */ +#define VasEBoot_ELF_R_PPC_REL14 11 /* PC relative 16 bit */ +#define VasEBoot_ELF_R_PPC_REL14_BRTAKEN 12 +#define VasEBoot_ELF_R_PPC_REL14_BRNTAKEN 13 +#define VasEBoot_ELF_R_PPC_GOT16 14 +#define VasEBoot_ELF_R_PPC_GOT16_LO 15 +#define VasEBoot_ELF_R_PPC_GOT16_HI 16 +#define VasEBoot_ELF_R_PPC_GOT16_HA 17 +#define VasEBoot_ELF_R_PPC_PLTREL24 18 +#define VasEBoot_ELF_R_PPC_COPY 19 +#define VasEBoot_ELF_R_PPC_GLOB_DAT 20 +#define VasEBoot_ELF_R_PPC_JMP_SLOT 21 +#define VasEBoot_ELF_R_PPC_RELATIVE 22 +#define VasEBoot_ELF_R_PPC_LOCAL24PC 23 +#define VasEBoot_ELF_R_PPC_UADDR32 24 +#define VasEBoot_ELF_R_PPC_UADDR16 25 +#define VasEBoot_ELF_R_PPC_REL32 26 +#define VasEBoot_ELF_R_PPC_PLT32 27 +#define VasEBoot_ELF_R_PPC_PLTREL32 28 +#define VasEBoot_ELF_R_PPC_PLT16_LO 29 +#define VasEBoot_ELF_R_PPC_PLT16_HI 30 +#define VasEBoot_ELF_R_PPC_PLT16_HA 31 +#define VasEBoot_ELF_R_PPC_SDAREL16 32 +#define VasEBoot_ELF_R_PPC_SECTOFF 33 +#define VasEBoot_ELF_R_PPC_SECTOFF_LO 34 +#define VasEBoot_ELF_R_PPC_SECTOFF_HI 35 +#define VasEBoot_ELF_R_PPC_SECTOFF_HA 36 /* Keep this the last entry. */ -#define GRUB_ELF_R_PPC_NUM 37 +#define VasEBoot_ELF_R_PPC_NUM 37 /* PowerPC64 relocations defined by the ABIs */ -#define GRUB_ELF_R_PPC64_NONE GRUB_ELF_R_PPC_NONE -#define GRUB_ELF_R_PPC64_ADDR32 GRUB_ELF_R_PPC_ADDR32 /* 32bit absolute address. */ -#define GRUB_ELF_R_PPC64_ADDR24 GRUB_ELF_R_PPC_ADDR24 /* 26bit address, word aligned. */ -#define GRUB_ELF_R_PPC64_ADDR16 GRUB_ELF_R_PPC_ADDR16 /* 16bit absolute address. */ -#define GRUB_ELF_R_PPC64_ADDR16_LO GRUB_ELF_R_PPC_ADDR16_LO /* lower 16bits of abs. address. */ -#define GRUB_ELF_R_PPC64_ADDR16_HI GRUB_ELF_R_PPC_ADDR16_HI /* high 16bits of abs. address. */ -#define GRUB_ELF_R_PPC64_ADDR16_HA GRUB_ELF_R_PPC_ADDR16_HA /* adjusted high 16bits. */ -#define GRUB_ELF_R_PPC64_ADDR14 GRUB_ELF_R_PPC_ADDR14 /* 16bit address, word aligned. */ -#define GRUB_ELF_R_PPC64_ADDR14_BRTAKEN GRUB_ELF_R_PPC_ADDR14_BRTAKEN -#define GRUB_ELF_R_PPC64_ADDR14_BRNTAKEN GRUB_ELF_R_PPC_ADDR14_BRNTAKEN -#define GRUB_ELF_R_PPC64_REL24 GRUB_ELF_R_PPC_REL24 /* PC relative 26 bit, word aligned. */ -#define GRUB_ELF_R_PPC64_REL14 GRUB_ELF_R_PPC_REL14 /* PC relative 16 bit. */ -#define GRUB_ELF_R_PPC64_REL14_BRTAKEN GRUB_ELF_R_PPC_REL14_BRTAKEN -#define GRUB_ELF_R_PPC64_REL14_BRNTAKEN GRUB_ELF_R_PPC_REL14_BRNTAKEN -#define GRUB_ELF_R_PPC64_GOT16 GRUB_ELF_R_PPC_GOT16 -#define GRUB_ELF_R_PPC64_GOT16_LO GRUB_ELF_R_PPC_GOT16_LO -#define GRUB_ELF_R_PPC64_GOT16_HI GRUB_ELF_R_PPC_GOT16_HI -#define GRUB_ELF_R_PPC64_GOT16_HA GRUB_ELF_R_PPC_GOT16_HA +#define VasEBoot_ELF_R_PPC64_NONE VasEBoot_ELF_R_PPC_NONE +#define VasEBoot_ELF_R_PPC64_ADDR32 VasEBoot_ELF_R_PPC_ADDR32 /* 32bit absolute address. */ +#define VasEBoot_ELF_R_PPC64_ADDR24 VasEBoot_ELF_R_PPC_ADDR24 /* 26bit address, word aligned. */ +#define VasEBoot_ELF_R_PPC64_ADDR16 VasEBoot_ELF_R_PPC_ADDR16 /* 16bit absolute address. */ +#define VasEBoot_ELF_R_PPC64_ADDR16_LO VasEBoot_ELF_R_PPC_ADDR16_LO /* lower 16bits of abs. address. */ +#define VasEBoot_ELF_R_PPC64_ADDR16_HI VasEBoot_ELF_R_PPC_ADDR16_HI /* high 16bits of abs. address. */ +#define VasEBoot_ELF_R_PPC64_ADDR16_HA VasEBoot_ELF_R_PPC_ADDR16_HA /* adjusted high 16bits. */ +#define VasEBoot_ELF_R_PPC64_ADDR14 VasEBoot_ELF_R_PPC_ADDR14 /* 16bit address, word aligned. */ +#define VasEBoot_ELF_R_PPC64_ADDR14_BRTAKEN VasEBoot_ELF_R_PPC_ADDR14_BRTAKEN +#define VasEBoot_ELF_R_PPC64_ADDR14_BRNTAKEN VasEBoot_ELF_R_PPC_ADDR14_BRNTAKEN +#define VasEBoot_ELF_R_PPC64_REL24 VasEBoot_ELF_R_PPC_REL24 /* PC relative 26 bit, word aligned. */ +#define VasEBoot_ELF_R_PPC64_REL14 VasEBoot_ELF_R_PPC_REL14 /* PC relative 16 bit. */ +#define VasEBoot_ELF_R_PPC64_REL14_BRTAKEN VasEBoot_ELF_R_PPC_REL14_BRTAKEN +#define VasEBoot_ELF_R_PPC64_REL14_BRNTAKEN VasEBoot_ELF_R_PPC_REL14_BRNTAKEN +#define VasEBoot_ELF_R_PPC64_GOT16 VasEBoot_ELF_R_PPC_GOT16 +#define VasEBoot_ELF_R_PPC64_GOT16_LO VasEBoot_ELF_R_PPC_GOT16_LO +#define VasEBoot_ELF_R_PPC64_GOT16_HI VasEBoot_ELF_R_PPC_GOT16_HI +#define VasEBoot_ELF_R_PPC64_GOT16_HA VasEBoot_ELF_R_PPC_GOT16_HA -#define GRUB_ELF_R_PPC64_COPY GRUB_ELF_R_PPC_COPY -#define GRUB_ELF_R_PPC64_GLOB_DAT GRUB_ELF_R_PPC_GLOB_DAT -#define GRUB_ELF_R_PPC64_JMP_SLOT GRUB_ELF_R_PPC_JMP_SLOT -#define GRUB_ELF_R_PPC64_RELATIVE GRUB_ELF_R_PPC_RELATIVE +#define VasEBoot_ELF_R_PPC64_COPY VasEBoot_ELF_R_PPC_COPY +#define VasEBoot_ELF_R_PPC64_GLOB_DAT VasEBoot_ELF_R_PPC_GLOB_DAT +#define VasEBoot_ELF_R_PPC64_JMP_SLOT VasEBoot_ELF_R_PPC_JMP_SLOT +#define VasEBoot_ELF_R_PPC64_RELATIVE VasEBoot_ELF_R_PPC_RELATIVE -#define GRUB_ELF_R_PPC64_UADDR32 GRUB_ELF_R_PPC_UADDR32 -#define GRUB_ELF_R_PPC64_UADDR16 GRUB_ELF_R_PPC_UADDR16 -#define GRUB_ELF_R_PPC64_REL32 GRUB_ELF_R_PPC_REL32 -#define GRUB_ELF_R_PPC64_PLT32 GRUB_ELF_R_PPC_PLT32 -#define GRUB_ELF_R_PPC64_PLTREL32 GRUB_ELF_R_PPC_PLTREL32 -#define GRUB_ELF_R_PPC64_PLT16_LO GRUB_ELF_R_PPC_PLT16_LO -#define GRUB_ELF_R_PPC64_PLT16_HI GRUB_ELF_R_PPC_PLT16_HI -#define GRUB_ELF_R_PPC64_PLT16_HA GRUB_ELF_R_PPC_PLT16_HA +#define VasEBoot_ELF_R_PPC64_UADDR32 VasEBoot_ELF_R_PPC_UADDR32 +#define VasEBoot_ELF_R_PPC64_UADDR16 VasEBoot_ELF_R_PPC_UADDR16 +#define VasEBoot_ELF_R_PPC64_REL32 VasEBoot_ELF_R_PPC_REL32 +#define VasEBoot_ELF_R_PPC64_PLT32 VasEBoot_ELF_R_PPC_PLT32 +#define VasEBoot_ELF_R_PPC64_PLTREL32 VasEBoot_ELF_R_PPC_PLTREL32 +#define VasEBoot_ELF_R_PPC64_PLT16_LO VasEBoot_ELF_R_PPC_PLT16_LO +#define VasEBoot_ELF_R_PPC64_PLT16_HI VasEBoot_ELF_R_PPC_PLT16_HI +#define VasEBoot_ELF_R_PPC64_PLT16_HA VasEBoot_ELF_R_PPC_PLT16_HA -#define GRUB_ELF_R_PPC64_SECTOFF GRUB_ELF_R_PPC_SECTOFF -#define GRUB_ELF_R_PPC64_SECTOFF_LO GRUB_ELF_R_PPC_SECTOFF_LO -#define GRUB_ELF_R_PPC64_SECTOFF_HI GRUB_ELF_R_PPC_SECTOFF_HI -#define GRUB_ELF_R_PPC64_SECTOFF_HA GRUB_ELF_R_PPC_SECTOFF_HA -#define GRUB_ELF_R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2. */ -#define GRUB_ELF_R_PPC64_ADDR64 38 /* doubleword64 S + A. */ -#define GRUB_ELF_R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A). */ -#define GRUB_ELF_R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A). */ -#define GRUB_ELF_R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A). */ -#define GRUB_ELF_R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A). */ -#define GRUB_ELF_R_PPC64_UADDR64 43 /* doubleword64 S + A. */ -#define GRUB_ELF_R_PPC64_REL64 44 /* doubleword64 S + A - P. */ -#define GRUB_ELF_R_PPC64_PLT64 45 /* doubleword64 L + A. */ -#define GRUB_ELF_R_PPC64_PLTREL64 46 /* doubleword64 L + A - P. */ -#define GRUB_ELF_R_PPC64_TOC16 47 /* half16* S + A - .TOC. */ -#define GRUB_ELF_R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.). */ -#define GRUB_ELF_R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.). */ -#define GRUB_ELF_R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.). */ -#define GRUB_ELF_R_PPC64_TOC 51 /* doubleword64 .TOC. */ -#define GRUB_ELF_R_PPC64_PLTGOT16 52 /* half16* M + A. */ -#define GRUB_ELF_R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A). */ -#define GRUB_ELF_R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A). */ -#define GRUB_ELF_R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A). */ +#define VasEBoot_ELF_R_PPC64_SECTOFF VasEBoot_ELF_R_PPC_SECTOFF +#define VasEBoot_ELF_R_PPC64_SECTOFF_LO VasEBoot_ELF_R_PPC_SECTOFF_LO +#define VasEBoot_ELF_R_PPC64_SECTOFF_HI VasEBoot_ELF_R_PPC_SECTOFF_HI +#define VasEBoot_ELF_R_PPC64_SECTOFF_HA VasEBoot_ELF_R_PPC_SECTOFF_HA +#define VasEBoot_ELF_R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2. */ +#define VasEBoot_ELF_R_PPC64_ADDR64 38 /* doubleword64 S + A. */ +#define VasEBoot_ELF_R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A). */ +#define VasEBoot_ELF_R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A). */ +#define VasEBoot_ELF_R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A). */ +#define VasEBoot_ELF_R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A). */ +#define VasEBoot_ELF_R_PPC64_UADDR64 43 /* doubleword64 S + A. */ +#define VasEBoot_ELF_R_PPC64_REL64 44 /* doubleword64 S + A - P. */ +#define VasEBoot_ELF_R_PPC64_PLT64 45 /* doubleword64 L + A. */ +#define VasEBoot_ELF_R_PPC64_PLTREL64 46 /* doubleword64 L + A - P. */ +#define VasEBoot_ELF_R_PPC64_TOC16 47 /* half16* S + A - .TOC. */ +#define VasEBoot_ELF_R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.). */ +#define VasEBoot_ELF_R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.). */ +#define VasEBoot_ELF_R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.). */ +#define VasEBoot_ELF_R_PPC64_TOC 51 /* doubleword64 .TOC. */ +#define VasEBoot_ELF_R_PPC64_PLTGOT16 52 /* half16* M + A. */ +#define VasEBoot_ELF_R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A). */ +#define VasEBoot_ELF_R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A). */ +#define VasEBoot_ELF_R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A). */ -#define GRUB_ELF_R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2. */ -#define GRUB_ELF_R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2. */ -#define GRUB_ELF_R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2. */ -#define GRUB_ELF_R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2. */ -#define GRUB_ELF_R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2. */ -#define GRUB_ELF_R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2. */ -#define GRUB_ELF_R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2. */ -#define GRUB_ELF_R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2. */ -#define GRUB_ELF_R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2. */ -#define GRUB_ELF_R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2. */ -#define GRUB_ELF_R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2. */ +#define VasEBoot_ELF_R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2. */ +#define VasEBoot_ELF_R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2. */ +#define VasEBoot_ELF_R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2. */ /* Keep this the last entry. */ -#define GRUB_ELF_R_PPC64_NUM 67 +#define VasEBoot_ELF_R_PPC64_NUM 67 /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ -#define GRUB_ELF_R_PPC_EMB_NADDR32 101 -#define GRUB_ELF_R_PPC_EMB_NADDR16 102 -#define GRUB_ELF_R_PPC_EMB_NADDR16_LO 103 -#define GRUB_ELF_R_PPC_EMB_NADDR16_HI 104 -#define GRUB_ELF_R_PPC_EMB_NADDR16_HA 105 -#define GRUB_ELF_R_PPC_EMB_SDAI16 106 -#define GRUB_ELF_R_PPC_EMB_SDA2I16 107 -#define GRUB_ELF_R_PPC_EMB_SDA2REL 108 -#define GRUB_ELF_R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ -#define GRUB_ELF_R_PPC_EMB_MRKREF 110 -#define GRUB_ELF_R_PPC_EMB_RELSEC16 111 -#define GRUB_ELF_R_PPC_EMB_RELST_LO 112 -#define GRUB_ELF_R_PPC_EMB_RELST_HI 113 -#define GRUB_ELF_R_PPC_EMB_RELST_HA 114 -#define GRUB_ELF_R_PPC_EMB_BIT_FLD 115 -#define GRUB_ELF_R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ +#define VasEBoot_ELF_R_PPC_EMB_NADDR32 101 +#define VasEBoot_ELF_R_PPC_EMB_NADDR16 102 +#define VasEBoot_ELF_R_PPC_EMB_NADDR16_LO 103 +#define VasEBoot_ELF_R_PPC_EMB_NADDR16_HI 104 +#define VasEBoot_ELF_R_PPC_EMB_NADDR16_HA 105 +#define VasEBoot_ELF_R_PPC_EMB_SDAI16 106 +#define VasEBoot_ELF_R_PPC_EMB_SDA2I16 107 +#define VasEBoot_ELF_R_PPC_EMB_SDA2REL 108 +#define VasEBoot_ELF_R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ +#define VasEBoot_ELF_R_PPC_EMB_MRKREF 110 +#define VasEBoot_ELF_R_PPC_EMB_RELSEC16 111 +#define VasEBoot_ELF_R_PPC_EMB_RELST_LO 112 +#define VasEBoot_ELF_R_PPC_EMB_RELST_HI 113 +#define VasEBoot_ELF_R_PPC_EMB_RELST_HA 114 +#define VasEBoot_ELF_R_PPC_EMB_BIT_FLD 115 +#define VasEBoot_ELF_R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ /* Diab tool relocations. */ -#define GRUB_ELF_R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ -#define GRUB_ELF_R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ -#define GRUB_ELF_R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ -#define GRUB_ELF_R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ -#define GRUB_ELF_R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ -#define GRUB_ELF_R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ +#define VasEBoot_ELF_R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ +#define VasEBoot_ELF_R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ +#define VasEBoot_ELF_R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ +#define VasEBoot_ELF_R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ +#define VasEBoot_ELF_R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ +#define VasEBoot_ELF_R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ /* This is a phony reloc to handle any old fashioned TOC16 references that may still be in object files. */ -#define GRUB_ELF_R_PPC_TOC16 255 +#define VasEBoot_ELF_R_PPC_TOC16 255 /* PowerPC64 specific values for the Dyn d_tag field. */ #define DT_PPC64_GLINK (DT_LOPROC + 0) @@ -2473,8 +2473,8 @@ typedef Elf32_Addr Elf32_Conflict; #define R_X86_64_NUM 24 -#ifdef GRUB_TARGET_WORDSIZE -#if GRUB_TARGET_WORDSIZE == 32 +#ifdef VasEBoot_TARGET_WORDSIZE +#if VasEBoot_TARGET_WORDSIZE == 32 typedef Elf32_Addr Elf_Addr; typedef Elf32_Nhdr Elf_Nhdr; @@ -2499,7 +2499,7 @@ typedef Elf32_Xword Elf_Xword; #define ELF_R_TYPE(val) ELF32_R_TYPE(val) #define ELF_R_INFO(sym, type) ELF32_R_INFO(sym, type) -#elif GRUB_TARGET_WORDSIZE == 64 +#elif VasEBoot_TARGET_WORDSIZE == 64 typedef Elf64_Addr Elf_Addr; typedef Elf64_Nhdr Elf_Nhdr; @@ -2523,7 +2523,7 @@ typedef Elf64_Xword Elf_Xword; #define ELF_R_TYPE(val) ELF64_R_TYPE(val) #define ELF_R_INFO(sym, type) ELF64_R_INFO(sym, type) -#endif /* GRUB_TARGET_WORDSIZE == 64 */ +#endif /* VasEBoot_TARGET_WORDSIZE == 64 */ #endif -#endif /* ! GRUB_ELF_H */ +#endif /* ! VasEBoot_ELF_H */ diff --git a/include/VasEBoot/elfload.h b/include/VasEBoot/elfload.h index 9a7ae4ebb..a1cd9b03e 100644 --- a/include/VasEBoot/elfload.h +++ b/include/VasEBoot/elfload.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ELFLOAD_HEADER -#define GRUB_ELFLOAD_HEADER 1 +#ifndef VasEBoot_ELFLOAD_HEADER +#define VasEBoot_ELFLOAD_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -struct grub_elf_file +struct VasEBoot_elf_file { - grub_file_t file; + VasEBoot_file_t file; union { Elf64_Ehdr ehdr64; Elf32_Ehdr ehdr32; @@ -35,48 +35,48 @@ struct grub_elf_file void *phdrs; char *filename; }; -typedef struct grub_elf_file *grub_elf_t; +typedef struct VasEBoot_elf_file *VasEBoot_elf_t; -typedef int (*grub_elf32_phdr_iterate_hook_t) - (grub_elf_t elf, Elf32_Phdr *phdr, void *arg); -typedef int (*grub_elf64_phdr_iterate_hook_t) - (grub_elf_t elf, Elf64_Phdr *phdr, void *arg); +typedef int (*VasEBoot_elf32_phdr_iterate_hook_t) + (VasEBoot_elf_t elf, Elf32_Phdr *phdr, void *arg); +typedef int (*VasEBoot_elf64_phdr_iterate_hook_t) + (VasEBoot_elf_t elf, Elf64_Phdr *phdr, void *arg); -grub_elf_t grub_elf_open (const char *); -grub_elf_t grub_elf_file (grub_file_t file, const char *filename); -grub_err_t grub_elf_close (grub_elf_t); +VasEBoot_elf_t VasEBoot_elf_open (const char *); +VasEBoot_elf_t VasEBoot_elf_file (VasEBoot_file_t file, const char *filename); +VasEBoot_err_t VasEBoot_elf_close (VasEBoot_elf_t); -int grub_elf_is_elf32 (grub_elf_t); -grub_size_t grub_elf32_size (grub_elf_t, - Elf32_Addr *, grub_uint32_t *); -enum grub_elf_load_flags +int VasEBoot_elf_is_elf32 (VasEBoot_elf_t); +VasEBoot_size_t VasEBoot_elf32_size (VasEBoot_elf_t, + Elf32_Addr *, VasEBoot_uint32_t *); +enum VasEBoot_elf_load_flags { - GRUB_ELF_LOAD_FLAGS_NONE = 0, - GRUB_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC = 1, - GRUB_ELF_LOAD_FLAGS_BITS = 6, - GRUB_ELF_LOAD_FLAGS_ALL_BITS = 0, - GRUB_ELF_LOAD_FLAGS_28BITS = 2, - GRUB_ELF_LOAD_FLAGS_30BITS = 4, - GRUB_ELF_LOAD_FLAGS_62BITS = 6, + VasEBoot_ELF_LOAD_FLAGS_NONE = 0, + VasEBoot_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC = 1, + VasEBoot_ELF_LOAD_FLAGS_BITS = 6, + VasEBoot_ELF_LOAD_FLAGS_ALL_BITS = 0, + VasEBoot_ELF_LOAD_FLAGS_28BITS = 2, + VasEBoot_ELF_LOAD_FLAGS_30BITS = 4, + VasEBoot_ELF_LOAD_FLAGS_62BITS = 6, }; -grub_err_t grub_elf32_load (grub_elf_t, const char *filename, - void *load_offset, enum grub_elf_load_flags flags, grub_addr_t *, - grub_size_t *); +VasEBoot_err_t VasEBoot_elf32_load (VasEBoot_elf_t, const char *filename, + void *load_offset, enum VasEBoot_elf_load_flags flags, VasEBoot_addr_t *, + VasEBoot_size_t *); -int grub_elf_is_elf64 (grub_elf_t); -grub_size_t grub_elf64_size (grub_elf_t, - Elf64_Addr *, grub_uint64_t *); -grub_err_t grub_elf64_load (grub_elf_t, const char *filename, - void *load_offset, enum grub_elf_load_flags flags, grub_addr_t *, - grub_size_t *); -grub_err_t grub_elf32_load_phdrs (grub_elf_t elf); -grub_err_t grub_elf64_load_phdrs (grub_elf_t elf); +int VasEBoot_elf_is_elf64 (VasEBoot_elf_t); +VasEBoot_size_t VasEBoot_elf64_size (VasEBoot_elf_t, + Elf64_Addr *, VasEBoot_uint64_t *); +VasEBoot_err_t VasEBoot_elf64_load (VasEBoot_elf_t, const char *filename, + void *load_offset, enum VasEBoot_elf_load_flags flags, VasEBoot_addr_t *, + VasEBoot_size_t *); +VasEBoot_err_t VasEBoot_elf32_load_phdrs (VasEBoot_elf_t elf); +VasEBoot_err_t VasEBoot_elf64_load_phdrs (VasEBoot_elf_t elf); #define FOR_ELF32_PHDRS(elf, phdr) \ - for (grub_elf32_load_phdrs (elf), phdr = elf->phdrs; \ + for (VasEBoot_elf32_load_phdrs (elf), phdr = elf->phdrs; \ phdr && phdr < (Elf32_Phdr *) elf->phdrs + elf->ehdr.ehdr32.e_phnum; phdr++) #define FOR_ELF64_PHDRS(elf, phdr) \ - for (grub_elf64_load_phdrs (elf), phdr = elf->phdrs; \ + for (VasEBoot_elf64_load_phdrs (elf), phdr = elf->phdrs; \ phdr && phdr < (Elf64_Phdr *) elf->phdrs + elf->ehdr.ehdr64.e_phnum; phdr++) -#endif /* ! GRUB_ELFLOAD_HEADER */ +#endif /* ! VasEBoot_ELFLOAD_HEADER */ diff --git a/include/VasEBoot/emu/console.h b/include/VasEBoot/emu/console.h index 1e5568282..bf335d8a4 100644 --- a/include/VasEBoot/emu/console.h +++ b/include/VasEBoot/emu/console.h @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CONSOLE_UTIL_HEADER -#define GRUB_CONSOLE_UTIL_HEADER 1 +#ifndef VasEBoot_CONSOLE_UTIL_HEADER +#define VasEBoot_CONSOLE_UTIL_HEADER 1 /* Initialize the console system. */ -void grub_console_init (void); +void VasEBoot_console_init (void); /* Finish the console system. */ -void grub_console_fini (void); +void VasEBoot_console_fini (void); -#endif /* ! GRUB_CONSOLE_UTIL_HEADER */ +#endif /* ! VasEBoot_CONSOLE_UTIL_HEADER */ diff --git a/include/VasEBoot/emu/exec.h b/include/VasEBoot/emu/exec.h index d1073ef86..dc8a1a26a 100644 --- a/include/VasEBoot/emu/exec.h +++ b/include/VasEBoot/emu/exec.h @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EMU_EXEC_H -#define GRUB_EMU_EXEC_H 1 +#ifndef VasEBoot_EMU_EXEC_H +#define VasEBoot_EMU_EXEC_H 1 #include #include #include pid_t -grub_util_exec_pipe (const char *const *argv, int *fd); +VasEBoot_util_exec_pipe (const char *const *argv, int *fd); pid_t -grub_util_exec_pipe_stderr (const char *const *argv, int *fd); +VasEBoot_util_exec_pipe_stderr (const char *const *argv, int *fd); int -grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, +VasEBoot_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); +VasEBoot_util_exec (const char *const *argv); int -grub_util_exec_redirect (const char *const *argv, const char *stdin_file, +VasEBoot_util_exec_redirect (const char *const *argv, const char *stdin_file, const char *stdout_file); int -grub_util_exec_redirect_null (const char *const *argv); +VasEBoot_util_exec_redirect_null (const char *const *argv); #endif diff --git a/include/VasEBoot/emu/getroot.h b/include/VasEBoot/emu/getroot.h index 73fa2d34a..0fc6e65c9 100644 --- a/include/VasEBoot/emu/getroot.h +++ b/include/VasEBoot/emu/getroot.h @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003, 2007, 2008, 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UTIL_GETROOT_HEADER -#define GRUB_UTIL_GETROOT_HEADER 1 +#ifndef VasEBoot_UTIL_GETROOT_HEADER +#define VasEBoot_UTIL_GETROOT_HEADER 1 -#include -#include +#include +#include #include #include -enum grub_dev_abstraction_types { - GRUB_DEV_ABSTRACTION_NONE, - GRUB_DEV_ABSTRACTION_LVM, - GRUB_DEV_ABSTRACTION_RAID, - GRUB_DEV_ABSTRACTION_LUKS, - GRUB_DEV_ABSTRACTION_GELI, +enum VasEBoot_dev_abstraction_types { + VasEBoot_DEV_ABSTRACTION_NONE, + VasEBoot_DEV_ABSTRACTION_LVM, + VasEBoot_DEV_ABSTRACTION_RAID, + VasEBoot_DEV_ABSTRACTION_LUKS, + VasEBoot_DEV_ABSTRACTION_GELI, }; -char *grub_find_device (const char *dir, dev_t dev); -void grub_util_pull_device (const char *osname); -char **grub_guess_root_devices (const char *dir); -int grub_util_get_dev_abstraction (const char *os_dev); -char *grub_make_system_path_relative_to_its_root (const char *path); +char *VasEBoot_find_device (const char *dir, dev_t dev); +void VasEBoot_util_pull_device (const char *osname); +char **VasEBoot_guess_root_devices (const char *dir); +int VasEBoot_util_get_dev_abstraction (const char *os_dev); +char *VasEBoot_make_system_path_relative_to_its_root (const char *path); char * -grub_make_system_path_relative_to_its_root_os (const char *path); -char *grub_util_get_grub_dev (const char *os_dev); +VasEBoot_make_system_path_relative_to_its_root_os (const char *path); +char *VasEBoot_util_get_VasEBoot_dev (const char *os_dev); #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) -void grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, +void VasEBoot_util_follow_gpart_up (const char *name, VasEBoot_disk_addr_t *off_out, char **name_out); #endif @@ -50,55 +50,55 @@ void grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, #ifdef __linux__ char ** -grub_find_root_devices_from_mountinfo (const char *dir, char **relroot); +VasEBoot_find_root_devices_from_mountinfo (const char *dir, char **relroot); #endif /* Devmapper functions provided by getroot_devmapper.c. */ void -grub_util_pull_devmapper (const char *os_dev); +VasEBoot_util_pull_devmapper (const char *os_dev); int -grub_util_device_is_mapped_stat (struct stat *st); -void grub_util_devmapper_cleanup (void); -enum grub_dev_abstraction_types -grub_util_get_dm_abstraction (const char *os_dev); +VasEBoot_util_device_is_mapped_stat (struct stat *st); +void VasEBoot_util_devmapper_cleanup (void); +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dm_abstraction (const char *os_dev); char * -grub_util_get_vg_uuid (const char *os_dev); +VasEBoot_util_get_vg_uuid (const char *os_dev); char * -grub_util_devmapper_part_to_disk (struct stat *st, +VasEBoot_util_devmapper_part_to_disk (struct stat *st, int *is_part, const char *os_dev); char * -grub_util_get_devmapper_grub_dev (const char *os_dev); +VasEBoot_util_get_devmapper_VasEBoot_dev (const char *os_dev); void -grub_util_pull_lvm_by_command (const char *os_dev); +VasEBoot_util_pull_lvm_by_command (const char *os_dev); char ** -grub_util_find_root_devices_from_poolname (char *poolname); +VasEBoot_util_find_root_devices_from_poolname (char *poolname); -grub_disk_addr_t -grub_util_find_partition_start (const char *dev); +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start (const char *dev); /* OS-specific functions provided by getroot_*.c. */ -enum grub_dev_abstraction_types -grub_util_get_dev_abstraction_os (const char *os_dev); +enum VasEBoot_dev_abstraction_types +VasEBoot_util_get_dev_abstraction_os (const char *os_dev); char * -grub_util_part_to_disk (const char *os_dev, struct stat *st, +VasEBoot_util_part_to_disk (const char *os_dev, struct stat *st, int *is_part); int -grub_util_pull_device_os (const char *osname, - enum grub_dev_abstraction_types ab); +VasEBoot_util_pull_device_os (const char *osname, + enum VasEBoot_dev_abstraction_types ab); char * -grub_util_get_grub_dev_os (const char *os_dev); -grub_disk_addr_t -grub_util_find_partition_start_os (const char *dev); +VasEBoot_util_get_VasEBoot_dev_os (const char *os_dev); +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start_os (const char *dev); char * -grub_util_guess_bios_drive (const char *orig_path); +VasEBoot_util_guess_bios_drive (const char *orig_path); char * -grub_util_guess_efi_drive (const char *orig_path); +VasEBoot_util_guess_efi_drive (const char *orig_path); char * -grub_util_guess_baremetal_drive (const char *orig_path); +VasEBoot_util_guess_baremetal_drive (const char *orig_path); void -grub_util_fprint_full_disk_name (FILE *f, - const char *drive, grub_device_t dev); +VasEBoot_util_fprint_full_disk_name (FILE *f, + const char *drive, VasEBoot_device_t dev); -#endif /* ! GRUB_UTIL_GETROOT_HEADER */ +#endif /* ! VasEBoot_UTIL_GETROOT_HEADER */ diff --git a/include/VasEBoot/emu/hostdisk.h b/include/VasEBoot/emu/hostdisk.h index e006f0b38..d9997ffc6 100644 --- a/include/VasEBoot/emu/hostdisk.h +++ b/include/VasEBoot/emu/hostdisk.h @@ -1,98 +1,98 @@ /* biosdisk.h - emulate biosdisk */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BIOSDISK_MACHINE_UTIL_HEADER -#define GRUB_BIOSDISK_MACHINE_UTIL_HEADER 1 +#ifndef VasEBoot_BIOSDISK_MACHINE_UTIL_HEADER +#define VasEBoot_BIOSDISK_MACHINE_UTIL_HEADER 1 -#include -#include +#include +#include #include -#include +#include -grub_util_fd_t -grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags, - grub_disk_addr_t *max); +VasEBoot_util_fd_t +VasEBoot_util_fd_open_device (const VasEBoot_disk_t disk, VasEBoot_disk_addr_t sector, int flags, + VasEBoot_disk_addr_t *max); -void grub_util_biosdisk_init (const char *dev_map); -void grub_util_biosdisk_fini (void); -char *grub_util_biosdisk_get_grub_dev (const char *os_dev); -const char *grub_util_biosdisk_get_osdev (grub_disk_t disk); -int grub_util_biosdisk_is_present (const char *name); -int grub_util_biosdisk_is_floppy (grub_disk_t disk); +void VasEBoot_util_biosdisk_init (const char *dev_map); +void VasEBoot_util_biosdisk_fini (void); +char *VasEBoot_util_biosdisk_get_VasEBoot_dev (const char *os_dev); +const char *VasEBoot_util_biosdisk_get_osdev (VasEBoot_disk_t disk); +int VasEBoot_util_biosdisk_is_present (const char *name); +int VasEBoot_util_biosdisk_is_floppy (VasEBoot_disk_t disk); const char * -grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk); -grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk); -grub_err_t -grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat); +VasEBoot_util_biosdisk_get_compatibility_hint (VasEBoot_disk_t disk); +VasEBoot_err_t VasEBoot_util_biosdisk_flush (struct VasEBoot_disk *disk); +VasEBoot_err_t +VasEBoot_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat); const char * -grub_util_cryptodisk_get_uuid (grub_disk_t disk); +VasEBoot_util_cryptodisk_get_uuid (VasEBoot_disk_t disk); char * -grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start); +VasEBoot_util_get_ldm (VasEBoot_disk_t disk, VasEBoot_disk_addr_t start); int -grub_util_is_ldm (grub_disk_t disk); -#ifdef GRUB_UTIL -grub_err_t -grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors, +VasEBoot_util_is_ldm (VasEBoot_disk_t disk); +#ifdef VasEBoot_UTIL +VasEBoot_err_t +VasEBoot_util_ldm_embed (struct VasEBoot_disk *disk, unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors); + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors); #endif const char * -grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add); +VasEBoot_hostdisk_os_dev_to_VasEBoot_drive (const char *os_dev, int add); char * -grub_util_get_os_disk (const char *os_dev); +VasEBoot_util_get_os_disk (const char *os_dev); int -grub_util_get_dm_node_linear_info (dev_t dev, +VasEBoot_util_get_dm_node_linear_info (dev_t dev, int *maj, int *min, - grub_disk_addr_t *st); + VasEBoot_disk_addr_t *st); /* Supplied by hostdisk_*.c. */ -grub_int64_t -grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize); +VasEBoot_int64_t +VasEBoot_util_get_fd_size_os (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize); /* REturns partition offset in 512B blocks. */ -grub_disk_addr_t -grub_hostdisk_find_partition_start_os (const char *dev); +VasEBoot_disk_addr_t +VasEBoot_hostdisk_find_partition_start_os (const char *dev); void -grub_hostdisk_flush_initial_buffer (const char *os_dev); +VasEBoot_hostdisk_flush_initial_buffer (const char *os_dev); #ifdef __GNU__ int -grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk_addr_t *offset, - grub_disk_addr_t *size, char **parent); +VasEBoot_util_hurd_get_disk_info (const char *dev, VasEBoot_uint32_t *secsize, VasEBoot_disk_addr_t *offset, + VasEBoot_disk_addr_t *size, char **parent); #endif -struct grub_util_hostdisk_data +struct VasEBoot_util_hostdisk_data { char *dev; int access_mode; - grub_util_fd_t fd; + VasEBoot_util_fd_t fd; int is_disk; int device_map; }; -void grub_host_init (void); -void grub_host_fini (void); -void grub_hostfs_init (void); -void grub_hostfs_fini (void); +void VasEBoot_host_init (void); +void VasEBoot_host_fini (void); +void VasEBoot_hostfs_init (void); +void VasEBoot_hostfs_fini (void); -#endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */ +#endif /* ! VasEBoot_BIOSDISK_MACHINE_UTIL_HEADER */ diff --git a/include/VasEBoot/emu/hostfile.h b/include/VasEBoot/emu/hostfile.h index 8e37d5acb..36ea71127 100644 --- a/include/VasEBoot/emu/hostfile.h +++ b/include/VasEBoot/emu/hostfile.h @@ -1,68 +1,68 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_HOSTFILE_EMU_HEADER -#define GRUB_HOSTFILE_EMU_HEADER 1 +#ifndef VasEBoot_HOSTFILE_EMU_HEADER +#define VasEBoot_HOSTFILE_EMU_HEADER 1 -#include -#include +#include +#include #include -#include +#include int -grub_util_is_directory (const char *path); +VasEBoot_util_is_directory (const char *path); int -grub_util_is_special_file (const char *path); +VasEBoot_util_is_special_file (const char *path); int -grub_util_is_regular (const char *path); +VasEBoot_util_is_regular (const char *path); char * -grub_util_path_concat (size_t n, ...); +VasEBoot_util_path_concat (size_t n, ...); char * -grub_util_path_concat_ext (size_t n, ...); +VasEBoot_util_path_concat_ext (size_t n, ...); int -grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off); +VasEBoot_util_fd_seek (VasEBoot_util_fd_t fd, VasEBoot_uint64_t off); ssize_t -EXPORT_FUNC(grub_util_fd_read) (grub_util_fd_t fd, char *buf, size_t len); +EXPORT_FUNC(VasEBoot_util_fd_read) (VasEBoot_util_fd_t fd, char *buf, size_t len); ssize_t -EXPORT_FUNC(grub_util_fd_write) (grub_util_fd_t fd, const char *buf, size_t len); +EXPORT_FUNC(VasEBoot_util_fd_write) (VasEBoot_util_fd_t fd, const char *buf, size_t len); -grub_util_fd_t -EXPORT_FUNC(grub_util_fd_open) (const char *os_dev, int flags); +VasEBoot_util_fd_t +EXPORT_FUNC(VasEBoot_util_fd_open) (const char *os_dev, int flags); const char * -EXPORT_FUNC(grub_util_fd_strerror) (void); +EXPORT_FUNC(VasEBoot_util_fd_strerror) (void); void -grub_util_fd_sync (grub_util_fd_t fd); +VasEBoot_util_fd_sync (VasEBoot_util_fd_t fd); void -grub_util_disable_fd_syncs (void); +VasEBoot_util_disable_fd_syncs (void); void -EXPORT_FUNC(grub_util_fd_close) (grub_util_fd_t fd); +EXPORT_FUNC(VasEBoot_util_fd_close) (VasEBoot_util_fd_t fd); -grub_uint64_t -grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize); +VasEBoot_uint64_t +VasEBoot_util_get_fd_size (VasEBoot_util_fd_t fd, const char *name, unsigned *log_secsize); char * -grub_util_make_temporary_file (void); +VasEBoot_util_make_temporary_file (void); char * -grub_util_make_temporary_dir (void); +VasEBoot_util_make_temporary_dir (void); void -grub_util_unlink_recursive (const char *name); -grub_uint32_t -grub_util_get_mtime (const char *name); +VasEBoot_util_unlink_recursive (const char *name); +VasEBoot_uint32_t +VasEBoot_util_get_mtime (const char *name); -#endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */ +#endif /* ! VasEBoot_BIOSDISK_MACHINE_UTIL_HEADER */ diff --git a/include/VasEBoot/emu/misc.h b/include/VasEBoot/emu/misc.h index df6085bcb..6522cf668 100644 --- a/include/VasEBoot/emu/misc.h +++ b/include/VasEBoot/emu/misc.h @@ -1,78 +1,78 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EMU_MISC_H -#define GRUB_EMU_MISC_H 1 +#ifndef VasEBoot_EMU_MISC_H +#define VasEBoot_EMU_MISC_H 1 #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include extern int verbosity; extern const char *program_name; -void grub_init_all (void); -void grub_fini_all (void); +void VasEBoot_init_all (void); +void VasEBoot_fini_all (void); -void grub_find_zpool_from_dir (const char *dir, +void VasEBoot_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs); -char *grub_make_system_path_relative_to_its_root (const char *path) +char *VasEBoot_make_system_path_relative_to_its_root (const char *path) WARN_UNUSED_RESULT; int -grub_util_device_is_mapped (const char *dev); +VasEBoot_util_device_is_mapped (const char *dev); #ifdef __MINGW32__ -#define GRUB_HOST_PRIuLONG_LONG "I64u" -#define GRUB_HOST_PRIxLONG_LONG "I64x" +#define VasEBoot_HOST_PRIuLONG_LONG "I64u" +#define VasEBoot_HOST_PRIxLONG_LONG "I64x" #else -#define GRUB_HOST_PRIuLONG_LONG "llu" -#define GRUB_HOST_PRIxLONG_LONG "llx" +#define VasEBoot_HOST_PRIuLONG_LONG "llu" +#define VasEBoot_HOST_PRIxLONG_LONG "llx" #endif -void * EXPORT_FUNC(xmalloc) (grub_size_t size) WARN_UNUSED_RESULT; -void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) WARN_UNUSED_RESULT; +void * EXPORT_FUNC(xmalloc) (VasEBoot_size_t size) WARN_UNUSED_RESULT; +void * EXPORT_FUNC(xrealloc) (void *ptr, VasEBoot_size_t size) WARN_UNUSED_RESULT; char * EXPORT_FUNC(xstrdup) (const char *str) WARN_UNUSED_RESULT; char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))) WARN_UNUSED_RESULT; -void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); -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(VasEBoot_util_warn) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); +void EXPORT_FUNC(VasEBoot_util_info) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); +void EXPORT_FUNC(VasEBoot_util_error) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn)); -grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); +VasEBoot_uint64_t EXPORT_FUNC (VasEBoot_util_get_cpu_time_ms) (void); #ifdef HAVE_DEVICE_MAPPER -int grub_device_mapper_supported (void); +int VasEBoot_device_mapper_supported (void); #endif -#ifdef GRUB_BUILD -#define grub_util_fopen fopen +#ifdef VasEBoot_BUILD +#define VasEBoot_util_fopen fopen #else FILE * -grub_util_fopen (const char *path, const char *mode); +VasEBoot_util_fopen (const char *path, const char *mode); #endif -void grub_util_file_sync (FILE *f); +void VasEBoot_util_file_sync (FILE *f); -#endif /* GRUB_EMU_MISC_H */ +#endif /* VasEBoot_EMU_MISC_H */ diff --git a/include/VasEBoot/emu/net.h b/include/VasEBoot/emu/net.h index a5d4fcbe4..ee06b63c4 100644 --- a/include/VasEBoot/emu/net.h +++ b/include/VasEBoot/emu/net.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EMUNET_HEADER -#define GRUB_EMUNET_HEADER 1 +#ifndef VasEBoot_EMUNET_HEADER +#define VasEBoot_EMUNET_HEADER 1 -#include -#include +#include +#include -grub_ssize_t -EXPORT_FUNC(grub_emunet_send) (const void *packet, grub_size_t sz); +VasEBoot_ssize_t +EXPORT_FUNC(VasEBoot_emunet_send) (const void *packet, VasEBoot_size_t sz); -grub_ssize_t -EXPORT_FUNC(grub_emunet_receive) (void *packet, grub_size_t sz); +VasEBoot_ssize_t +EXPORT_FUNC(VasEBoot_emunet_receive) (void *packet, VasEBoot_size_t sz); int -EXPORT_FUNC(grub_emunet_create) (grub_size_t *mtu); +EXPORT_FUNC(VasEBoot_emunet_create) (VasEBoot_size_t *mtu); void -EXPORT_FUNC(grub_emunet_close) (void); +EXPORT_FUNC(VasEBoot_emunet_close) (void); #endif diff --git a/include/VasEBoot/env.h b/include/VasEBoot/env.h index 76f832eb9..5da915b35 100644 --- a/include/VasEBoot/env.h +++ b/include/VasEBoot/env.h @@ -1,72 +1,72 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ENV_HEADER -#define GRUB_ENV_HEADER 1 +#ifndef VasEBoot_ENV_HEADER +#define VasEBoot_ENV_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_env_var; +struct VasEBoot_env_var; -typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var, +typedef const char *(*VasEBoot_env_read_hook_t) (struct VasEBoot_env_var *var, const char *val); -typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var, +typedef char *(*VasEBoot_env_write_hook_t) (struct VasEBoot_env_var *var, const char *val); -struct grub_env_var +struct VasEBoot_env_var { char *name; char *value; - grub_env_read_hook_t read_hook; - grub_env_write_hook_t write_hook; - struct grub_env_var *next; - struct grub_env_var **prevp; - struct grub_env_var *sorted_next; + VasEBoot_env_read_hook_t read_hook; + VasEBoot_env_write_hook_t write_hook; + struct VasEBoot_env_var *next; + struct VasEBoot_env_var **prevp; + struct VasEBoot_env_var *sorted_next; int global; }; -grub_err_t EXPORT_FUNC(grub_env_set) (const char *name, const char *val); -const char *EXPORT_FUNC(grub_env_get) (const char *name); -void EXPORT_FUNC(grub_env_unset) (const char *name); -struct grub_env_var *EXPORT_FUNC(grub_env_update_get_sorted) (void); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_env_set) (const char *name, const char *val); +const char *EXPORT_FUNC(VasEBoot_env_get) (const char *name); +void EXPORT_FUNC(VasEBoot_env_unset) (const char *name); +struct VasEBoot_env_var *EXPORT_FUNC(VasEBoot_env_update_get_sorted) (void); -#define FOR_SORTED_ENV(var) for (var = grub_env_update_get_sorted (); var; var = var->sorted_next) +#define FOR_SORTED_ENV(var) for (var = VasEBoot_env_update_get_sorted (); var; var = var->sorted_next) -grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name, - grub_env_read_hook_t read_hook, - grub_env_write_hook_t write_hook); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_register_variable_hook) (const char *name, + VasEBoot_env_read_hook_t read_hook, + VasEBoot_env_write_hook_t write_hook); -grub_err_t grub_env_context_open (void); -grub_err_t grub_env_context_close (void); -grub_err_t EXPORT_FUNC(grub_env_export) (const char *name); +VasEBoot_err_t VasEBoot_env_context_open (void); +VasEBoot_err_t VasEBoot_env_context_close (void); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_env_export) (const char *name); -void grub_env_unset_menu (void); -grub_menu_t grub_env_get_menu (void); -void grub_env_set_menu (grub_menu_t nmenu); +void VasEBoot_env_unset_menu (void); +VasEBoot_menu_t VasEBoot_env_get_menu (void); +void VasEBoot_env_set_menu (VasEBoot_menu_t nmenu); -grub_err_t -grub_env_extractor_open (int source); +VasEBoot_err_t +VasEBoot_env_extractor_open (int source); -grub_err_t -grub_env_extractor_close (int source); +VasEBoot_err_t +VasEBoot_env_extractor_close (int source); -#endif /* ! GRUB_ENV_HEADER */ +#endif /* ! VasEBoot_ENV_HEADER */ diff --git a/include/VasEBoot/env_private.h b/include/VasEBoot/env_private.h index bb001533f..7b50da134 100644 --- a/include/VasEBoot/env_private.h +++ b/include/VasEBoot/env_private.h @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ENV_PRIVATE_HEADER -#define GRUB_ENV_PRIVATE_HEADER 1 +#ifndef VasEBoot_ENV_PRIVATE_HEADER +#define VasEBoot_ENV_PRIVATE_HEADER 1 -#include +#include /* The size of the hash table. */ #define HASHSZ 13 /* A hashtable for quick lookup of variables. */ -struct grub_env_context +struct VasEBoot_env_context { /* A hash table for variables. */ - struct grub_env_var *vars[HASHSZ]; + struct VasEBoot_env_var *vars[HASHSZ]; /* One level deeper on the stack. */ - struct grub_env_context *prev; + struct VasEBoot_env_context *prev; }; /* This is used for sorting only. */ -struct grub_env_sorted_var +struct VasEBoot_env_sorted_var { - struct grub_env_var *var; - struct grub_env_sorted_var *next; + struct VasEBoot_env_var *var; + struct VasEBoot_env_sorted_var *next; }; -extern struct grub_env_context *EXPORT_VAR(grub_current_context); +extern struct VasEBoot_env_context *EXPORT_VAR(VasEBoot_current_context); -#endif /* ! GRUB_ENV_PRIVATE_HEADER */ +#endif /* ! VasEBoot_ENV_PRIVATE_HEADER */ diff --git a/include/VasEBoot/err.h b/include/VasEBoot/err.h index 1590c688e..b59b896e5 100644 --- a/include/VasEBoot/err.h +++ b/include/VasEBoot/err.h @@ -1,96 +1,96 @@ /* err.h - error numbers and prototypes */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ERR_HEADER -#define GRUB_ERR_HEADER 1 +#ifndef VasEBoot_ERR_HEADER +#define VasEBoot_ERR_HEADER 1 -#include +#include -#define GRUB_MAX_ERRMSG 256 +#define VasEBoot_MAX_ERRMSG 256 typedef enum { - GRUB_ERR_NONE = 0, - GRUB_ERR_TEST_FAILURE, - GRUB_ERR_BAD_MODULE, - GRUB_ERR_OUT_OF_MEMORY, - GRUB_ERR_BAD_FILE_TYPE, - GRUB_ERR_FILE_NOT_FOUND, - GRUB_ERR_FILE_READ_ERROR, - GRUB_ERR_BAD_FILENAME, - GRUB_ERR_UNKNOWN_FS, - GRUB_ERR_BAD_FS, - GRUB_ERR_BAD_NUMBER, - GRUB_ERR_OUT_OF_RANGE, - GRUB_ERR_UNKNOWN_DEVICE, - GRUB_ERR_BAD_DEVICE, - GRUB_ERR_READ_ERROR, - GRUB_ERR_WRITE_ERROR, - GRUB_ERR_UNKNOWN_COMMAND, - GRUB_ERR_INVALID_COMMAND, - GRUB_ERR_BAD_ARGUMENT, - GRUB_ERR_BAD_PART_TABLE, - GRUB_ERR_UNKNOWN_OS, - GRUB_ERR_BAD_OS, - GRUB_ERR_NO_KERNEL, - GRUB_ERR_BAD_FONT, - GRUB_ERR_NOT_IMPLEMENTED_YET, - GRUB_ERR_SYMLINK_LOOP, - GRUB_ERR_BAD_COMPRESSED_DATA, - GRUB_ERR_MENU, - GRUB_ERR_TIMEOUT, - GRUB_ERR_IO, - GRUB_ERR_ACCESS_DENIED, - GRUB_ERR_EXTRACTOR, - GRUB_ERR_NET_BAD_ADDRESS, - GRUB_ERR_NET_ROUTE_LOOP, - GRUB_ERR_NET_NO_ROUTE, - GRUB_ERR_NET_NO_ANSWER, - GRUB_ERR_NET_NO_CARD, - GRUB_ERR_WAIT, - GRUB_ERR_BUG, - GRUB_ERR_NET_PORT_CLOSED, - GRUB_ERR_NET_INVALID_RESPONSE, - GRUB_ERR_NET_UNKNOWN_ERROR, - GRUB_ERR_NET_PACKET_TOO_BIG, - GRUB_ERR_NET_NO_DOMAIN, - GRUB_ERR_EOF, - GRUB_ERR_BAD_SIGNATURE + VasEBoot_ERR_NONE = 0, + VasEBoot_ERR_TEST_FAILURE, + VasEBoot_ERR_BAD_MODULE, + VasEBoot_ERR_OUT_OF_MEMORY, + VasEBoot_ERR_BAD_FILE_TYPE, + VasEBoot_ERR_FILE_NOT_FOUND, + VasEBoot_ERR_FILE_READ_ERROR, + VasEBoot_ERR_BAD_FILENAME, + VasEBoot_ERR_UNKNOWN_FS, + VasEBoot_ERR_BAD_FS, + VasEBoot_ERR_BAD_NUMBER, + VasEBoot_ERR_OUT_OF_RANGE, + VasEBoot_ERR_UNKNOWN_DEVICE, + VasEBoot_ERR_BAD_DEVICE, + VasEBoot_ERR_READ_ERROR, + VasEBoot_ERR_WRITE_ERROR, + VasEBoot_ERR_UNKNOWN_COMMAND, + VasEBoot_ERR_INVALID_COMMAND, + VasEBoot_ERR_BAD_ARGUMENT, + VasEBoot_ERR_BAD_PART_TABLE, + VasEBoot_ERR_UNKNOWN_OS, + VasEBoot_ERR_BAD_OS, + VasEBoot_ERR_NO_KERNEL, + VasEBoot_ERR_BAD_FONT, + VasEBoot_ERR_NOT_IMPLEMENTED_YET, + VasEBoot_ERR_SYMLINK_LOOP, + VasEBoot_ERR_BAD_COMPRESSED_DATA, + VasEBoot_ERR_MENU, + VasEBoot_ERR_TIMEOUT, + VasEBoot_ERR_IO, + VasEBoot_ERR_ACCESS_DENIED, + VasEBoot_ERR_EXTRACTOR, + VasEBoot_ERR_NET_BAD_ADDRESS, + VasEBoot_ERR_NET_ROUTE_LOOP, + VasEBoot_ERR_NET_NO_ROUTE, + VasEBoot_ERR_NET_NO_ANSWER, + VasEBoot_ERR_NET_NO_CARD, + VasEBoot_ERR_WAIT, + VasEBoot_ERR_BUG, + VasEBoot_ERR_NET_PORT_CLOSED, + VasEBoot_ERR_NET_INVALID_RESPONSE, + VasEBoot_ERR_NET_UNKNOWN_ERROR, + VasEBoot_ERR_NET_PACKET_TOO_BIG, + VasEBoot_ERR_NET_NO_DOMAIN, + VasEBoot_ERR_EOF, + VasEBoot_ERR_BAD_SIGNATURE } -grub_err_t; +VasEBoot_err_t; -struct grub_error_saved +struct VasEBoot_error_saved { - grub_err_t grub_errno; - char errmsg[GRUB_MAX_ERRMSG]; + VasEBoot_err_t VasEBoot_errno; + char errmsg[VasEBoot_MAX_ERRMSG]; }; -extern grub_err_t EXPORT_VAR(grub_errno); -extern char EXPORT_VAR(grub_errmsg)[GRUB_MAX_ERRMSG]; +extern VasEBoot_err_t EXPORT_VAR(VasEBoot_errno); +extern char EXPORT_VAR(VasEBoot_errmsg)[VasEBoot_MAX_ERRMSG]; -grub_err_t EXPORT_FUNC(grub_error) (grub_err_t n, const char *fmt, ...); -void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn)); -void EXPORT_FUNC(grub_error_push) (void); -int EXPORT_FUNC(grub_error_pop) (void); -void EXPORT_FUNC(grub_print_error) (void); -extern int EXPORT_VAR(grub_err_printed_errors); -int grub_err_printf (const char *fmt, ...) +VasEBoot_err_t EXPORT_FUNC(VasEBoot_error) (VasEBoot_err_t n, const char *fmt, ...); +void EXPORT_FUNC(VasEBoot_fatal) (const char *fmt, ...) __attribute__ ((noreturn)); +void EXPORT_FUNC(VasEBoot_error_push) (void); +int EXPORT_FUNC(VasEBoot_error_pop) (void); +void EXPORT_FUNC(VasEBoot_print_error) (void); +extern int EXPORT_VAR(VasEBoot_err_printed_errors); +int VasEBoot_err_printf (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); -#endif /* ! GRUB_ERR_HEADER */ +#endif /* ! VasEBoot_ERR_HEADER */ diff --git a/include/VasEBoot/exfat.h b/include/VasEBoot/exfat.h index 2b8009cee..391f24621 100644 --- a/include/VasEBoot/exfat.h +++ b/include/VasEBoot/exfat.h @@ -1,53 +1,53 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EXFAT_H -#define GRUB_EXFAT_H 1 +#ifndef VasEBoot_EXFAT_H +#define VasEBoot_EXFAT_H 1 -#include +#include -struct grub_exfat_bpb +struct VasEBoot_exfat_bpb { - grub_uint8_t jmp_boot[3]; - grub_uint8_t oem_name[8]; - grub_uint8_t mbz[53]; - grub_uint64_t num_hidden_sectors; - grub_uint64_t num_total_sectors; - grub_uint32_t num_reserved_sectors; - grub_uint32_t sectors_per_fat; - grub_uint32_t cluster_offset; - grub_uint32_t cluster_count; - grub_uint32_t root_cluster; - grub_uint32_t num_serial; - grub_uint16_t fs_revision; - grub_uint16_t volume_flags; - grub_uint8_t bytes_per_sector_shift; - grub_uint8_t sectors_per_cluster_shift; - grub_uint8_t num_fats; - grub_uint8_t num_ph_drive; - grub_uint8_t reserved[8]; -} GRUB_PACKED; + VasEBoot_uint8_t jmp_boot[3]; + VasEBoot_uint8_t oem_name[8]; + VasEBoot_uint8_t mbz[53]; + VasEBoot_uint64_t num_hidden_sectors; + VasEBoot_uint64_t num_total_sectors; + VasEBoot_uint32_t num_reserved_sectors; + VasEBoot_uint32_t sectors_per_fat; + VasEBoot_uint32_t cluster_offset; + VasEBoot_uint32_t cluster_count; + VasEBoot_uint32_t root_cluster; + VasEBoot_uint32_t num_serial; + VasEBoot_uint16_t fs_revision; + VasEBoot_uint16_t volume_flags; + VasEBoot_uint8_t bytes_per_sector_shift; + VasEBoot_uint8_t sectors_per_cluster_shift; + VasEBoot_uint8_t num_fats; + VasEBoot_uint8_t num_ph_drive; + VasEBoot_uint8_t reserved[8]; +} VasEBoot_PACKED; -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include -grub_disk_addr_t -grub_exfat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn); +VasEBoot_disk_addr_t +VasEBoot_exfat_get_cluster_sector (VasEBoot_disk_t disk, VasEBoot_uint64_t *sec_per_lcn); #endif #endif diff --git a/include/VasEBoot/extcmd.h b/include/VasEBoot/extcmd.h index 19fe59266..a1c5ff8a9 100644 --- a/include/VasEBoot/extcmd.h +++ b/include/VasEBoot/extcmd.h @@ -1,79 +1,79 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EXTCMD_HEADER -#define GRUB_EXTCMD_HEADER 1 +#ifndef VasEBoot_EXTCMD_HEADER +#define VasEBoot_EXTCMD_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_extcmd; -struct grub_extcmd_context; +struct VasEBoot_extcmd; +struct VasEBoot_extcmd_context; -typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt, +typedef VasEBoot_err_t (*VasEBoot_extcmd_func_t) (struct VasEBoot_extcmd_context *ctxt, int argc, char **args); /* The argcmd description. */ -struct grub_extcmd +struct VasEBoot_extcmd { - grub_command_t cmd; + VasEBoot_command_t cmd; - grub_extcmd_func_t func; + VasEBoot_extcmd_func_t func; /* The argument parser optionlist. */ - const struct grub_arg_option *options; + const struct VasEBoot_arg_option *options; void *data; }; -typedef struct grub_extcmd *grub_extcmd_t; +typedef struct VasEBoot_extcmd *VasEBoot_extcmd_t; /* Command context for each instance of execution. */ -struct grub_extcmd_context +struct VasEBoot_extcmd_context { - struct grub_extcmd *extcmd; + struct VasEBoot_extcmd *extcmd; - struct grub_arg_list *state; + struct VasEBoot_arg_list *state; /* Script parameter, if any. */ - struct grub_script *script; + struct VasEBoot_script *script; }; -typedef struct grub_extcmd_context *grub_extcmd_context_t; +typedef struct VasEBoot_extcmd_context *VasEBoot_extcmd_context_t; -grub_extcmd_t EXPORT_FUNC(grub_register_extcmd) (const char *name, - grub_extcmd_func_t func, - grub_command_flags_t flags, +VasEBoot_extcmd_t EXPORT_FUNC(VasEBoot_register_extcmd) (const char *name, + VasEBoot_extcmd_func_t func, + VasEBoot_command_flags_t flags, const char *summary, const char *description, - const struct grub_arg_option *parser); + const struct VasEBoot_arg_option *parser); -grub_extcmd_t EXPORT_FUNC(grub_register_extcmd_prio) (const char *name, - grub_extcmd_func_t func, - grub_command_flags_t flags, +VasEBoot_extcmd_t EXPORT_FUNC(VasEBoot_register_extcmd_prio) (const char *name, + VasEBoot_extcmd_func_t func, + VasEBoot_command_flags_t flags, const char *summary, const char *description, - const struct grub_arg_option *parser, + const struct VasEBoot_arg_option *parser, int prio); -void EXPORT_FUNC(grub_unregister_extcmd) (grub_extcmd_t cmd); +void EXPORT_FUNC(VasEBoot_unregister_extcmd) (VasEBoot_extcmd_t cmd); -grub_err_t EXPORT_FUNC(grub_extcmd_dispatcher) (struct grub_command *cmd, +VasEBoot_err_t EXPORT_FUNC(VasEBoot_extcmd_dispatcher) (struct VasEBoot_command *cmd, int argc, char **args, - struct grub_script *script); + struct VasEBoot_script *script); -#endif /* ! GRUB_EXTCMD_HEADER */ +#endif /* ! VasEBoot_EXTCMD_HEADER */ diff --git a/include/VasEBoot/fat.h b/include/VasEBoot/fat.h index 4a5aab793..c5f3450c2 100644 --- a/include/VasEBoot/fat.h +++ b/include/VasEBoot/fat.h @@ -1,82 +1,82 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FAT_H -#define GRUB_FAT_H 1 +#ifndef VasEBoot_FAT_H +#define VasEBoot_FAT_H 1 -#include +#include -struct grub_fat_bpb +struct VasEBoot_fat_bpb { - grub_uint8_t jmp_boot[3]; - grub_uint8_t oem_name[8]; - grub_uint16_t bytes_per_sector; - grub_uint8_t sectors_per_cluster; - grub_uint16_t num_reserved_sectors; - grub_uint8_t num_fats; + VasEBoot_uint8_t jmp_boot[3]; + VasEBoot_uint8_t oem_name[8]; + VasEBoot_uint16_t bytes_per_sector; + VasEBoot_uint8_t sectors_per_cluster; + VasEBoot_uint16_t num_reserved_sectors; + VasEBoot_uint8_t num_fats; /* 0x10 */ - grub_uint16_t num_root_entries; - grub_uint16_t num_total_sectors_16; - grub_uint8_t media; + VasEBoot_uint16_t num_root_entries; + VasEBoot_uint16_t num_total_sectors_16; + VasEBoot_uint8_t media; /*0 x15 */ - grub_uint16_t sectors_per_fat_16; - grub_uint16_t sectors_per_track; + VasEBoot_uint16_t sectors_per_fat_16; + VasEBoot_uint16_t sectors_per_track; /*0 x19 */ - grub_uint16_t num_heads; + VasEBoot_uint16_t num_heads; /*0 x1b */ - grub_uint32_t num_hidden_sectors; + VasEBoot_uint32_t num_hidden_sectors; /* 0x1f */ - grub_uint32_t num_total_sectors_32; + VasEBoot_uint32_t num_total_sectors_32; union { struct { - grub_uint8_t num_ph_drive; - grub_uint8_t reserved; - grub_uint8_t boot_sig; - grub_uint32_t num_serial; - grub_uint8_t label[11]; - grub_uint8_t fstype[8]; - } GRUB_PACKED fat12_or_fat16; + VasEBoot_uint8_t num_ph_drive; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t boot_sig; + VasEBoot_uint32_t num_serial; + VasEBoot_uint8_t label[11]; + VasEBoot_uint8_t fstype[8]; + } VasEBoot_PACKED fat12_or_fat16; struct { - grub_uint32_t sectors_per_fat_32; - grub_uint16_t extended_flags; - grub_uint16_t fs_version; - grub_uint32_t root_cluster; - grub_uint16_t fs_info; - grub_uint16_t backup_boot_sector; - grub_uint8_t reserved[12]; - grub_uint8_t num_ph_drive; - grub_uint8_t reserved1; - grub_uint8_t boot_sig; - grub_uint32_t num_serial; - grub_uint8_t label[11]; - grub_uint8_t fstype[8]; - } GRUB_PACKED fat32; - } GRUB_PACKED version_specific; -} GRUB_PACKED; + VasEBoot_uint32_t sectors_per_fat_32; + VasEBoot_uint16_t extended_flags; + VasEBoot_uint16_t fs_version; + VasEBoot_uint32_t root_cluster; + VasEBoot_uint16_t fs_info; + VasEBoot_uint16_t backup_boot_sector; + VasEBoot_uint8_t reserved[12]; + VasEBoot_uint8_t num_ph_drive; + VasEBoot_uint8_t reserved1; + VasEBoot_uint8_t boot_sig; + VasEBoot_uint32_t num_serial; + VasEBoot_uint8_t label[11]; + VasEBoot_uint8_t fstype[8]; + } VasEBoot_PACKED fat32; + } VasEBoot_PACKED version_specific; +} VasEBoot_PACKED; -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include -grub_disk_addr_t -grub_fat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn); +VasEBoot_disk_addr_t +VasEBoot_fat_get_cluster_sector (VasEBoot_disk_t disk, VasEBoot_uint64_t *sec_per_lcn); #endif #endif diff --git a/include/VasEBoot/fbblit.h b/include/VasEBoot/fbblit.h index 66d1005e7..aa9c08e5c 100644 --- a/include/VasEBoot/fbblit.h +++ b/include/VasEBoot/fbblit.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FBBLIT_HEADER -#define GRUB_FBBLIT_HEADER 1 +#ifndef VasEBoot_FBBLIT_HEADER +#define VasEBoot_FBBLIT_HEADER 1 /* NOTE: This header is private header for fb driver and should not be used in other parts of the code. */ -struct grub_video_fbblit_info; +struct VasEBoot_video_fbblit_info; /* NOTE: This function assumes that given coordinates are within bounds of handled data. */ void -grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target, - struct grub_video_fbblit_info *source, - enum grub_video_blit_operators oper, +VasEBoot_video_fb_dispatch_blit (struct VasEBoot_video_fbblit_info *target, + struct VasEBoot_video_fbblit_info *source, + enum VasEBoot_video_blit_operators oper, int x, int y, unsigned int width, unsigned int height, int offset_x, int offset_y); -#endif /* ! GRUB_FBBLIT_HEADER */ +#endif /* ! VasEBoot_FBBLIT_HEADER */ diff --git a/include/VasEBoot/fbfill.h b/include/VasEBoot/fbfill.h index 35a80b820..256df98d6 100644 --- a/include/VasEBoot/fbfill.h +++ b/include/VasEBoot/fbfill.h @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FBFILL_HEADER -#define GRUB_FBFILL_HEADER 1 +#ifndef VasEBoot_FBFILL_HEADER +#define VasEBoot_FBFILL_HEADER 1 /* NOTE: This header is private header for fb driver and should not be used in other parts of the code. */ -struct grub_video_fbblit_info; +struct VasEBoot_video_fbblit_info; -struct grub_video_fbrender_target +struct VasEBoot_video_fbrender_target { /* Copy of the screen's mode info structure, except that width, height and mode_type has been re-adjusted to requested render target settings. */ - struct grub_video_mode_info mode_info; + struct VasEBoot_video_mode_info mode_info; /* We should not draw outside of viewport. */ - grub_video_rect_t viewport; + VasEBoot_video_rect_t viewport; /* Set region to make a re-draw of a part of the screen. */ - grub_video_rect_t region; + VasEBoot_video_rect_t region; /* Should be set to 0 if the viewport is inside of the region. */ int area_enabled; /* Internal structure - intersection of the viewport and the region. */ - grub_video_rect_t area; + VasEBoot_video_rect_t area; /* Internal values - offsets from the left top point of the viewport. */ int area_offset_x; int area_offset_y; @@ -48,12 +48,12 @@ struct grub_video_fbrender_target /* Pointer to data. Can either be in video card memory or in local host's memory. */ - grub_uint8_t *data; + VasEBoot_uint8_t *data; }; void -grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target, - grub_video_color_t color, int x, int y, +VasEBoot_video_fb_fill_dispatch (struct VasEBoot_video_fbblit_info *target, + VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height); -#endif /* ! GRUB_FBFILL_HEADER */ +#endif /* ! VasEBoot_FBFILL_HEADER */ diff --git a/include/VasEBoot/fbutil.h b/include/VasEBoot/fbutil.h index 4205eb917..9e7e47369 100644 --- a/include/VasEBoot/fbutil.h +++ b/include/VasEBoot/fbutil.h @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* NOTE: This header is private header for vbe driver and should not be used in other parts of the code. */ -#ifndef GRUB_VBEUTIL_MACHINE_HEADER -#define GRUB_VBEUTIL_MACHINE_HEADER 1 +#ifndef VasEBoot_VBEUTIL_MACHINE_HEADER +#define VasEBoot_VBEUTIL_MACHINE_HEADER 1 -#include -#include +#include +#include -struct grub_video_fbblit_info +struct VasEBoot_video_fbblit_info { - struct grub_video_mode_info *mode_info; - grub_uint8_t *data; + struct VasEBoot_video_mode_info *mode_info; + VasEBoot_uint8_t *data; }; /* Don't use for 1-bit bitmaps, addressing needs to be done at the bit level and it doesn't make sense, in general, to ask for a pointer to a particular pixel's data. */ static inline void * -grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, +VasEBoot_video_fb_get_video_ptr (struct VasEBoot_video_fbblit_info *source, unsigned int x, unsigned int y) { return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel; @@ -44,16 +44,16 @@ grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, /* Advance pointer by VAL bytes. If there is no unaligned access available, VAL has to be divisible by size of pointed type. */ -#ifdef GRUB_HAVE_UNALIGNED_ACCESS -#define GRUB_VIDEO_FB_ADVANCE_POINTER(ptr, val) ((ptr) = (typeof (ptr)) ((char *) ptr + val)) +#ifdef VasEBoot_HAVE_UNALIGNED_ACCESS +#define VasEBoot_VIDEO_FB_ADVANCE_POINTER(ptr, val) ((ptr) = (typeof (ptr)) ((char *) ptr + val)) #else -#define GRUB_VIDEO_FB_ADVANCE_POINTER(ptr, val) ((ptr) += (val) / sizeof (*(ptr))) +#define VasEBoot_VIDEO_FB_ADVANCE_POINTER(ptr, val) ((ptr) += (val) / sizeof (*(ptr))) #endif -grub_video_color_t get_pixel (struct grub_video_fbblit_info *source, +VasEBoot_video_color_t get_pixel (struct VasEBoot_video_fbblit_info *source, unsigned int x, unsigned int y); -void set_pixel (struct grub_video_fbblit_info *source, - unsigned int x, unsigned int y, grub_video_color_t color); +void set_pixel (struct VasEBoot_video_fbblit_info *source, + unsigned int x, unsigned int y, VasEBoot_video_color_t color); -#endif /* ! GRUB_VBEUTIL_MACHINE_HEADER */ +#endif /* ! VasEBoot_VBEUTIL_MACHINE_HEADER */ diff --git a/include/VasEBoot/fdt.h b/include/VasEBoot/fdt.h index fdfca75bf..b1e73aca0 100644 --- a/include/VasEBoot/fdt.h +++ b/include/VasEBoot/fdt.h @@ -1,132 +1,132 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FDT_HEADER -#define GRUB_FDT_HEADER 1 +#ifndef VasEBoot_FDT_HEADER +#define VasEBoot_FDT_HEADER 1 -#include +#include #define FDT_MAGIC 0xD00DFEED typedef struct { - grub_uint32_t magic; - grub_uint32_t totalsize; - grub_uint32_t off_dt_struct; - grub_uint32_t off_dt_strings; - grub_uint32_t off_mem_rsvmap; - grub_uint32_t version; - grub_uint32_t last_comp_version; - grub_uint32_t boot_cpuid_phys; - grub_uint32_t size_dt_strings; - grub_uint32_t size_dt_struct; -} grub_fdt_header_t; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t totalsize; + VasEBoot_uint32_t off_dt_struct; + VasEBoot_uint32_t off_dt_strings; + VasEBoot_uint32_t off_mem_rsvmap; + VasEBoot_uint32_t version; + VasEBoot_uint32_t last_comp_version; + VasEBoot_uint32_t boot_cpuid_phys; + VasEBoot_uint32_t size_dt_strings; + VasEBoot_uint32_t size_dt_struct; +} VasEBoot_fdt_header_t; -struct grub_fdt_empty_tree { - grub_fdt_header_t header; - grub_uint64_t empty_rsvmap[2]; +struct VasEBoot_fdt_empty_tree { + VasEBoot_fdt_header_t header; + VasEBoot_uint64_t empty_rsvmap[2]; struct { - grub_uint32_t node_start; - grub_uint8_t name[1]; - grub_uint32_t node_end; - grub_uint32_t tree_end; + VasEBoot_uint32_t node_start; + VasEBoot_uint8_t name[1]; + VasEBoot_uint32_t node_end; + VasEBoot_uint32_t tree_end; } empty_node; }; -#define GRUB_FDT_EMPTY_TREE_SZ sizeof (struct grub_fdt_empty_tree) +#define VasEBoot_FDT_EMPTY_TREE_SZ sizeof (struct VasEBoot_fdt_empty_tree) -#define grub_fdt_get_header(fdt, field) \ - grub_be_to_cpu32(((const grub_fdt_header_t *)(fdt))->field) -#define grub_fdt_set_header(fdt, field, value) \ - ((grub_fdt_header_t *)(fdt))->field = grub_cpu_to_be32(value) +#define VasEBoot_fdt_get_header(fdt, field) \ + VasEBoot_be_to_cpu32(((const VasEBoot_fdt_header_t *)(fdt))->field) +#define VasEBoot_fdt_set_header(fdt, field, value) \ + ((VasEBoot_fdt_header_t *)(fdt))->field = VasEBoot_cpu_to_be32(value) -#define grub_fdt_get_magic(fdt) \ - grub_fdt_get_header(fdt, magic) -#define grub_fdt_set_magic(fdt, value) \ - grub_fdt_set_header(fdt, magic, value) -#define grub_fdt_get_totalsize(fdt) \ - grub_fdt_get_header(fdt, totalsize) -#define grub_fdt_set_totalsize(fdt, value) \ - grub_fdt_set_header(fdt, totalsize, value) -#define grub_fdt_get_off_dt_struct(fdt) \ - grub_fdt_get_header(fdt, off_dt_struct) -#define grub_fdt_set_off_dt_struct(fdt, value) \ - grub_fdt_set_header(fdt, off_dt_struct, value) -#define grub_fdt_get_off_dt_strings(fdt) \ - grub_fdt_get_header(fdt, off_dt_strings) -#define grub_fdt_set_off_dt_strings(fdt, value) \ - grub_fdt_set_header(fdt, off_dt_strings, value) -#define grub_fdt_get_off_mem_rsvmap(fdt) \ - grub_fdt_get_header(fdt, off_mem_rsvmap) -#define grub_fdt_set_off_mem_rsvmap(fdt, value) \ - grub_fdt_set_header(fdt, off_mem_rsvmap, value) -#define grub_fdt_get_version(fdt) \ - grub_fdt_get_header(fdt, version) -#define grub_fdt_set_version(fdt, value) \ - grub_fdt_set_header(fdt, version, value) -#define grub_fdt_get_last_comp_version(fdt) \ - grub_fdt_get_header(fdt, last_comp_version) -#define grub_fdt_set_last_comp_version(fdt, value) \ - grub_fdt_set_header(fdt, last_comp_version, value) -#define grub_fdt_get_boot_cpuid_phys(fdt) \ - grub_fdt_get_header(fdt, boot_cpuid_phys) -#define grub_fdt_set_boot_cpuid_phys(fdt, value) \ - grub_fdt_set_header(fdt, boot_cpuid_phys, value) -#define grub_fdt_get_size_dt_strings(fdt) \ - grub_fdt_get_header(fdt, size_dt_strings) -#define grub_fdt_set_size_dt_strings(fdt, value) \ - grub_fdt_set_header(fdt, size_dt_strings, value) -#define grub_fdt_get_size_dt_struct(fdt) \ - grub_fdt_get_header(fdt, size_dt_struct) -#define grub_fdt_set_size_dt_struct(fdt, value) \ - grub_fdt_set_header(fdt, size_dt_struct, value) +#define VasEBoot_fdt_get_magic(fdt) \ + VasEBoot_fdt_get_header(fdt, magic) +#define VasEBoot_fdt_set_magic(fdt, value) \ + VasEBoot_fdt_set_header(fdt, magic, value) +#define VasEBoot_fdt_get_totalsize(fdt) \ + VasEBoot_fdt_get_header(fdt, totalsize) +#define VasEBoot_fdt_set_totalsize(fdt, value) \ + VasEBoot_fdt_set_header(fdt, totalsize, value) +#define VasEBoot_fdt_get_off_dt_struct(fdt) \ + VasEBoot_fdt_get_header(fdt, off_dt_struct) +#define VasEBoot_fdt_set_off_dt_struct(fdt, value) \ + VasEBoot_fdt_set_header(fdt, off_dt_struct, value) +#define VasEBoot_fdt_get_off_dt_strings(fdt) \ + VasEBoot_fdt_get_header(fdt, off_dt_strings) +#define VasEBoot_fdt_set_off_dt_strings(fdt, value) \ + VasEBoot_fdt_set_header(fdt, off_dt_strings, value) +#define VasEBoot_fdt_get_off_mem_rsvmap(fdt) \ + VasEBoot_fdt_get_header(fdt, off_mem_rsvmap) +#define VasEBoot_fdt_set_off_mem_rsvmap(fdt, value) \ + VasEBoot_fdt_set_header(fdt, off_mem_rsvmap, value) +#define VasEBoot_fdt_get_version(fdt) \ + VasEBoot_fdt_get_header(fdt, version) +#define VasEBoot_fdt_set_version(fdt, value) \ + VasEBoot_fdt_set_header(fdt, version, value) +#define VasEBoot_fdt_get_last_comp_version(fdt) \ + VasEBoot_fdt_get_header(fdt, last_comp_version) +#define VasEBoot_fdt_set_last_comp_version(fdt, value) \ + VasEBoot_fdt_set_header(fdt, last_comp_version, value) +#define VasEBoot_fdt_get_boot_cpuid_phys(fdt) \ + VasEBoot_fdt_get_header(fdt, boot_cpuid_phys) +#define VasEBoot_fdt_set_boot_cpuid_phys(fdt, value) \ + VasEBoot_fdt_set_header(fdt, boot_cpuid_phys, value) +#define VasEBoot_fdt_get_size_dt_strings(fdt) \ + VasEBoot_fdt_get_header(fdt, size_dt_strings) +#define VasEBoot_fdt_set_size_dt_strings(fdt, value) \ + VasEBoot_fdt_set_header(fdt, size_dt_strings, value) +#define VasEBoot_fdt_get_size_dt_struct(fdt) \ + VasEBoot_fdt_get_header(fdt, size_dt_struct) +#define VasEBoot_fdt_set_size_dt_struct(fdt, value) \ + VasEBoot_fdt_set_header(fdt, size_dt_struct, value) -int grub_fdt_create_empty_tree (void *fdt, unsigned int size); -int grub_fdt_check_header (void *fdt, unsigned int size); -int grub_fdt_check_header_nosize (void *fdt); -int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, +int VasEBoot_fdt_create_empty_tree (void *fdt, unsigned int size); +int VasEBoot_fdt_check_header (void *fdt, unsigned int size); +int VasEBoot_fdt_check_header_nosize (void *fdt); +int VasEBoot_fdt_find_subnode (const void *fdt, unsigned int parentoffset, const char *name); -int grub_fdt_add_subnode (void *fdt, unsigned int parentoffset, +int VasEBoot_fdt_add_subnode (void *fdt, unsigned int parentoffset, const char *name); -int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, - const void *val, grub_uint32_t len); -#define grub_fdt_set_prop32(fdt, nodeoffset, name, val) \ +int VasEBoot_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, + const void *val, VasEBoot_uint32_t len); +#define VasEBoot_fdt_set_prop32(fdt, nodeoffset, name, val) \ ({ \ - grub_uint32_t _val = grub_cpu_to_be32(val); \ - grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 4); \ + VasEBoot_uint32_t _val = VasEBoot_cpu_to_be32(val); \ + VasEBoot_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 4); \ }) -#define grub_fdt_set_prop64(fdt, nodeoffset, name, val) \ +#define VasEBoot_fdt_set_prop64(fdt, nodeoffset, name, val) \ ({ \ - grub_uint64_t _val = grub_cpu_to_be64(val); \ - grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 8); \ + VasEBoot_uint64_t _val = VasEBoot_cpu_to_be64(val); \ + VasEBoot_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 8); \ }) /* Setup "reg" property for * #address-cells = <0x2> * #size-cells = <0x2> */ -#define grub_fdt_set_reg64(fdt, nodeoffset, addr, size) \ +#define VasEBoot_fdt_set_reg64(fdt, nodeoffset, addr, size) \ ({ \ - grub_uint64_t reg_64[2]; \ - reg_64[0] = grub_cpu_to_be64(addr); \ - reg_64[1] = grub_cpu_to_be64(size); \ - grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \ + VasEBoot_uint64_t reg_64[2]; \ + reg_64[0] = VasEBoot_cpu_to_be64(addr); \ + reg_64[1] = VasEBoot_cpu_to_be64(size); \ + VasEBoot_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \ }) -#endif /* ! GRUB_FDT_HEADER */ +#endif /* ! VasEBoot_FDT_HEADER */ diff --git a/include/VasEBoot/file.h b/include/VasEBoot/file.h index 739488cbe..22ce07a2b 100644 --- a/include/VasEBoot/file.h +++ b/include/VasEBoot/file.h @@ -1,53 +1,53 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FILE_HEADER -#define GRUB_FILE_HEADER 1 +#ifndef VasEBoot_FILE_HEADER +#define VasEBoot_FILE_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* File description. */ -struct grub_file +struct VasEBoot_file { /* File name. */ char *name; /* The underlying device. */ - grub_device_t device; + VasEBoot_device_t device; /* The underlying filesystem. */ - grub_fs_t fs; + VasEBoot_fs_t fs; /* The current offset. */ - grub_off_t offset; - grub_off_t progress_offset; + VasEBoot_off_t offset; + VasEBoot_off_t progress_offset; /* Progress info. */ - grub_uint64_t last_progress_time; - grub_off_t last_progress_offset; - grub_uint64_t estimated_speed; + VasEBoot_uint64_t last_progress_time; + VasEBoot_off_t last_progress_offset; + VasEBoot_uint64_t estimated_speed; /* The file size. */ - grub_off_t size; + VasEBoot_off_t size; /* If file is not easily seekable. Should be set by underlying layer. */ int not_easily_seekable; @@ -56,112 +56,112 @@ struct grub_file void *data; /* This is called when a sector is read. Used only for a disk device. */ - grub_disk_read_hook_t read_hook; + VasEBoot_disk_read_hook_t read_hook; /* Caller-specific data passed to the read hook. */ void *read_hook_data; }; -typedef struct grub_file *grub_file_t; +typedef struct VasEBoot_file *VasEBoot_file_t; -extern grub_disk_read_hook_t EXPORT_VAR(grub_file_progress_hook); +extern VasEBoot_disk_read_hook_t EXPORT_VAR(VasEBoot_file_progress_hook); /* Filters with lower ID are executed first. */ -typedef enum grub_file_filter_id +typedef enum VasEBoot_file_filter_id { - GRUB_FILE_FILTER_PUBKEY, - GRUB_FILE_FILTER_GZIO, - GRUB_FILE_FILTER_XZIO, - GRUB_FILE_FILTER_LZOPIO, - GRUB_FILE_FILTER_MAX, - GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO, - GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO, - } grub_file_filter_id_t; + VasEBoot_FILE_FILTER_PUBKEY, + VasEBoot_FILE_FILTER_GZIO, + VasEBoot_FILE_FILTER_XZIO, + VasEBoot_FILE_FILTER_LZOPIO, + VasEBoot_FILE_FILTER_MAX, + VasEBoot_FILE_FILTER_COMPRESSION_FIRST = VasEBoot_FILE_FILTER_GZIO, + VasEBoot_FILE_FILTER_COMPRESSION_LAST = VasEBoot_FILE_FILTER_LZOPIO, + } VasEBoot_file_filter_id_t; -typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, const char *filename); +typedef VasEBoot_file_t (*VasEBoot_file_filter_t) (VasEBoot_file_t in, const char *filename); -extern grub_file_filter_t EXPORT_VAR(grub_file_filters_all)[GRUB_FILE_FILTER_MAX]; -extern grub_file_filter_t EXPORT_VAR(grub_file_filters_enabled)[GRUB_FILE_FILTER_MAX]; +extern VasEBoot_file_filter_t EXPORT_VAR(VasEBoot_file_filters_all)[VasEBoot_FILE_FILTER_MAX]; +extern VasEBoot_file_filter_t EXPORT_VAR(VasEBoot_file_filters_enabled)[VasEBoot_FILE_FILTER_MAX]; static inline void -grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter) +VasEBoot_file_filter_register (VasEBoot_file_filter_id_t id, VasEBoot_file_filter_t filter) { - grub_file_filters_all[id] = filter; - grub_file_filters_enabled[id] = filter; + VasEBoot_file_filters_all[id] = filter; + VasEBoot_file_filters_enabled[id] = filter; } static inline void -grub_file_filter_unregister (grub_file_filter_id_t id) +VasEBoot_file_filter_unregister (VasEBoot_file_filter_id_t id) { - grub_file_filters_all[id] = 0; - grub_file_filters_enabled[id] = 0; + VasEBoot_file_filters_all[id] = 0; + VasEBoot_file_filters_enabled[id] = 0; } static inline void -grub_file_filter_disable (grub_file_filter_id_t id) +VasEBoot_file_filter_disable (VasEBoot_file_filter_id_t id) { - grub_file_filters_enabled[id] = 0; + VasEBoot_file_filters_enabled[id] = 0; } static inline void -grub_file_filter_disable_compression (void) +VasEBoot_file_filter_disable_compression (void) { - grub_file_filter_id_t id; + VasEBoot_file_filter_id_t id; - for (id = GRUB_FILE_FILTER_COMPRESSION_FIRST; - id <= GRUB_FILE_FILTER_COMPRESSION_LAST; id++) - grub_file_filters_enabled[id] = 0; + for (id = VasEBoot_FILE_FILTER_COMPRESSION_FIRST; + id <= VasEBoot_FILE_FILTER_COMPRESSION_LAST; id++) + VasEBoot_file_filters_enabled[id] = 0; } static inline void -grub_file_filter_disable_all (void) +VasEBoot_file_filter_disable_all (void) { - grub_file_filter_id_t id; + VasEBoot_file_filter_id_t id; for (id = 0; - id < GRUB_FILE_FILTER_MAX; id++) - grub_file_filters_enabled[id] = 0; + id < VasEBoot_FILE_FILTER_MAX; id++) + VasEBoot_file_filters_enabled[id] = 0; } static inline void -grub_file_filter_disable_pubkey (void) +VasEBoot_file_filter_disable_pubkey (void) { - grub_file_filters_enabled[GRUB_FILE_FILTER_PUBKEY] = 0; + VasEBoot_file_filters_enabled[VasEBoot_FILE_FILTER_PUBKEY] = 0; } /* Get a device name from NAME. */ -char *EXPORT_FUNC(grub_file_get_device_name) (const char *name); +char *EXPORT_FUNC(VasEBoot_file_get_device_name) (const char *name); -grub_file_t EXPORT_FUNC(grub_file_open) (const char *name); -grub_ssize_t EXPORT_FUNC(grub_file_read) (grub_file_t file, void *buf, - grub_size_t len); -grub_off_t EXPORT_FUNC(grub_file_seek) (grub_file_t file, grub_off_t offset); -grub_err_t EXPORT_FUNC(grub_file_close) (grub_file_t file); +VasEBoot_file_t EXPORT_FUNC(VasEBoot_file_open) (const char *name); +VasEBoot_ssize_t EXPORT_FUNC(VasEBoot_file_read) (VasEBoot_file_t file, void *buf, + VasEBoot_size_t len); +VasEBoot_off_t EXPORT_FUNC(VasEBoot_file_seek) (VasEBoot_file_t file, VasEBoot_off_t offset); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_file_close) (VasEBoot_file_t file); -/* Return value of grub_file_size() in case file size is unknown. */ -#define GRUB_FILE_SIZE_UNKNOWN 0xffffffffffffffffULL +/* Return value of VasEBoot_file_size() in case file size is unknown. */ +#define VasEBoot_FILE_SIZE_UNKNOWN 0xffffffffffffffffULL -static inline grub_off_t -grub_file_size (const grub_file_t file) +static inline VasEBoot_off_t +VasEBoot_file_size (const VasEBoot_file_t file) { return file->size; } -static inline grub_off_t -grub_file_tell (const grub_file_t file) +static inline VasEBoot_off_t +VasEBoot_file_tell (const VasEBoot_file_t file) { return file->offset; } static inline int -grub_file_seekable (const grub_file_t file) +VasEBoot_file_seekable (const VasEBoot_file_t file) { return !file->not_easily_seekable; } -grub_file_t -grub_file_offset_open (grub_file_t parent, grub_off_t start, - grub_off_t size); +VasEBoot_file_t +VasEBoot_file_offset_open (VasEBoot_file_t parent, VasEBoot_off_t start, + VasEBoot_off_t size); void -grub_file_offset_close (grub_file_t file); +VasEBoot_file_offset_close (VasEBoot_file_t file); -#endif /* ! GRUB_FILE_HEADER */ +#endif /* ! VasEBoot_FILE_HEADER */ diff --git a/include/VasEBoot/fileid.h b/include/VasEBoot/fileid.h index ae75b6912..a497574d5 100644 --- a/include/VasEBoot/fileid.h +++ b/include/VasEBoot/fileid.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FILEID_HEADER -#define GRUB_FILEID_HEADER 1 +#ifndef VasEBoot_FILEID_HEADER +#define VasEBoot_FILEID_HEADER 1 -#include +#include int -grub_file_check_netbsd32 (grub_elf_t elf); +VasEBoot_file_check_netbsd32 (VasEBoot_elf_t elf); int -grub_file_check_netbsd64 (grub_elf_t elf); +VasEBoot_file_check_netbsd64 (VasEBoot_elf_t elf); #endif diff --git a/include/VasEBoot/font.h b/include/VasEBoot/font.h index 708fa42ac..2bf1fc6d3 100644 --- a/include/VasEBoot/font.h +++ b/include/VasEBoot/font.h @@ -1,39 +1,39 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FONT_HEADER -#define GRUB_FONT_HEADER 1 +#ifndef VasEBoot_FONT_HEADER +#define VasEBoot_FONT_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -/* Forward declaration of opaque structure grub_font. - Users only pass struct grub_font pointers to the font module functions, +/* Forward declaration of opaque structure VasEBoot_font. + Users only pass struct VasEBoot_font pointers to the font module functions, and do not have knowledge of the structure contents. */ /* Full structure was moved here for inline function but still shouldn't be used directly. */ -struct grub_font +struct VasEBoot_font { char *name; - grub_file_t file; + VasEBoot_file_t file; char *family; short point_size; short weight; @@ -42,42 +42,42 @@ struct grub_font short ascent; short descent; short leading; - grub_uint32_t num_chars; + VasEBoot_uint32_t num_chars; struct char_index_entry *char_index; - grub_uint16_t *bmp_idx; + VasEBoot_uint16_t *bmp_idx; }; /* Font type used to access font functions. */ -typedef struct grub_font *grub_font_t; +typedef struct VasEBoot_font *VasEBoot_font_t; -struct grub_font_node +struct VasEBoot_font_node { - struct grub_font_node *next; - grub_font_t value; + struct VasEBoot_font_node *next; + VasEBoot_font_t value; }; /* Global font registry. */ -extern struct grub_font_node *grub_font_list; +extern struct VasEBoot_font_node *VasEBoot_font_list; -struct grub_font_glyph +struct VasEBoot_font_glyph { /* Reference to the font this glyph belongs to. */ - grub_font_t font; + VasEBoot_font_t font; /* Glyph bitmap width in pixels. */ - grub_uint16_t width; + VasEBoot_uint16_t width; /* Glyph bitmap height in pixels. */ - grub_uint16_t height; + VasEBoot_uint16_t height; /* Glyph bitmap x offset in pixels. Add to screen coordinate. */ - grub_int16_t offset_x; + VasEBoot_int16_t offset_x; /* Glyph bitmap y offset in pixels. Subtract from screen coordinate. */ - grub_int16_t offset_y; + VasEBoot_int16_t offset_y; /* Number of pixels to advance to start the next character. */ - grub_uint16_t device_width; + VasEBoot_uint16_t device_width; /* Row-major order, packed bits (no padding; rows can break within a byte). The length of the array is (width * height + 7) / 8. Within a @@ -85,69 +85,69 @@ struct grub_font_glyph Pixels are coded as bits, value 1 meaning of opaque pixel and 0 is transparent. If the length of the array does not fit byte boundary, it will be padded with 0 bits to make it fit. */ - grub_uint8_t bitmap[0]; + VasEBoot_uint8_t bitmap[0]; }; /* Part of code field which is really used as such. */ -#define GRUB_FONT_CODE_CHAR_MASK 0x001fffff -#define GRUB_FONT_CODE_RIGHT_JOINED 0x80000000 -#define GRUB_FONT_CODE_LEFT_JOINED 0x40000000 +#define VasEBoot_FONT_CODE_CHAR_MASK 0x001fffff +#define VasEBoot_FONT_CODE_RIGHT_JOINED 0x80000000 +#define VasEBoot_FONT_CODE_LEFT_JOINED 0x40000000 /* Initialize the font loader. Must be called before any fonts are loaded or used. */ -void grub_font_loader_init (void); +void VasEBoot_font_loader_init (void); /* Load a font and add it to the beginning of the global font list. Returns: 0 upon success; nonzero upon failure. */ -grub_font_t EXPORT_FUNC(grub_font_load) (const char *filename); +VasEBoot_font_t EXPORT_FUNC(VasEBoot_font_load) (const char *filename); /* Get the font that has the specified name. Font names are in the form "Family Name Bold Italic 14", where Bold and Italic are optional. If no font matches the name specified, the most recently loaded font is returned as a fallback. */ -grub_font_t EXPORT_FUNC (grub_font_get) (const char *font_name); +VasEBoot_font_t EXPORT_FUNC (VasEBoot_font_get) (const char *font_name); -const char *EXPORT_FUNC (grub_font_get_name) (grub_font_t font); +const char *EXPORT_FUNC (VasEBoot_font_get_name) (VasEBoot_font_t font); -int EXPORT_FUNC (grub_font_get_max_char_width) (grub_font_t font); +int EXPORT_FUNC (VasEBoot_font_get_max_char_width) (VasEBoot_font_t font); /* Get the maximum height of any character in the font in pixels. */ static inline int -grub_font_get_max_char_height (grub_font_t font) +VasEBoot_font_get_max_char_height (VasEBoot_font_t font) { return font->max_char_height; } /* Get the distance in pixels from the top of characters to the baseline. */ static inline int -grub_font_get_ascent (grub_font_t font) +VasEBoot_font_get_ascent (VasEBoot_font_t font) { return font->ascent; } -int EXPORT_FUNC (grub_font_get_descent) (grub_font_t font); +int EXPORT_FUNC (VasEBoot_font_get_descent) (VasEBoot_font_t font); -int EXPORT_FUNC (grub_font_get_leading) (grub_font_t font); +int EXPORT_FUNC (VasEBoot_font_get_leading) (VasEBoot_font_t font); -int EXPORT_FUNC (grub_font_get_height) (grub_font_t font); +int EXPORT_FUNC (VasEBoot_font_get_height) (VasEBoot_font_t font); -int EXPORT_FUNC (grub_font_get_xheight) (grub_font_t font); +int EXPORT_FUNC (VasEBoot_font_get_xheight) (VasEBoot_font_t font); -struct grub_font_glyph *EXPORT_FUNC (grub_font_get_glyph) (grub_font_t font, - grub_uint32_t code); +struct VasEBoot_font_glyph *EXPORT_FUNC (VasEBoot_font_get_glyph) (VasEBoot_font_t font, + VasEBoot_uint32_t code); -struct grub_font_glyph *EXPORT_FUNC (grub_font_get_glyph_with_fallback) (grub_font_t font, - grub_uint32_t code); +struct VasEBoot_font_glyph *EXPORT_FUNC (VasEBoot_font_get_glyph_with_fallback) (VasEBoot_font_t font, + VasEBoot_uint32_t code); -grub_err_t EXPORT_FUNC (grub_font_draw_glyph) (struct grub_font_glyph *glyph, - grub_video_color_t color, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_font_draw_glyph) (struct VasEBoot_font_glyph *glyph, + VasEBoot_video_color_t color, int left_x, int baseline_y); int -EXPORT_FUNC (grub_font_get_constructed_device_width) (grub_font_t hinted_font, - const struct grub_unicode_glyph *glyph_id); -struct grub_font_glyph * -EXPORT_FUNC (grub_font_construct_glyph) (grub_font_t hinted_font, - const struct grub_unicode_glyph *glyph_id); +EXPORT_FUNC (VasEBoot_font_get_constructed_device_width) (VasEBoot_font_t hinted_font, + const struct VasEBoot_unicode_glyph *glyph_id); +struct VasEBoot_font_glyph * +EXPORT_FUNC (VasEBoot_font_construct_glyph) (VasEBoot_font_t hinted_font, + const struct VasEBoot_unicode_glyph *glyph_id); -#endif /* ! GRUB_FONT_HEADER */ +#endif /* ! VasEBoot_FONT_HEADER */ diff --git a/include/VasEBoot/fontformat.h b/include/VasEBoot/fontformat.h index b5060588c..f57640fcf 100644 --- a/include/VasEBoot/fontformat.h +++ b/include/VasEBoot/fontformat.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FONT_FORMAT_HEADER -#define GRUB_FONT_FORMAT_HEADER 1 +#ifndef VasEBoot_FONT_FORMAT_HEADER +#define VasEBoot_FONT_FORMAT_HEADER 1 /* FONT_FORMAT_PFF2_MAGIC use only 4 relevants bytes and the \0. */ #define FONT_FORMAT_PFF2_MAGIC "PFF2" @@ -34,5 +34,5 @@ #define FONT_FORMAT_SECTION_NAMES_FAMILY "FAMI" #define FONT_FORMAT_SECTION_NAMES_SLAN "SLAN" -#endif /* ! GRUB_FONT_FORMAT_HEADER */ +#endif /* ! VasEBoot_FONT_FORMAT_HEADER */ diff --git a/include/VasEBoot/fs.h b/include/VasEBoot/fs.h index 5678c60c2..bd7515ef1 100644 --- a/include/VasEBoot/fs.h +++ b/include/VasEBoot/fs.h @@ -1,94 +1,94 @@ /* fs.h - filesystem manager */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FS_HEADER -#define GRUB_FS_HEADER 1 +#ifndef VasEBoot_FS_HEADER +#define VasEBoot_FS_HEADER 1 -#include -#include -#include +#include +#include +#include -#include +#include /* For embedding types. */ -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include #endif /* Forward declaration is required, because of mutual reference. */ -struct grub_file; +struct VasEBoot_file; -struct grub_dirhook_info +struct VasEBoot_dirhook_info { unsigned dir:1; unsigned mtimeset:1; unsigned case_insensitive:1; unsigned inodeset:1; - grub_int32_t mtime; - grub_uint64_t inode; + VasEBoot_int32_t mtime; + VasEBoot_uint64_t inode; }; -typedef int (*grub_fs_dir_hook_t) (const char *filename, - const struct grub_dirhook_info *info, +typedef int (*VasEBoot_fs_dir_hook_t) (const char *filename, + const struct VasEBoot_dirhook_info *info, void *data); /* Filesystem descriptor. */ -struct grub_fs +struct VasEBoot_fs { /* The next filesystem. */ - struct grub_fs *next; - struct grub_fs **prev; + struct VasEBoot_fs *next; + struct VasEBoot_fs **prev; /* My name. */ const char *name; /* Call HOOK with each file under DIR. */ - grub_err_t (*dir) (grub_device_t device, const char *path, - grub_fs_dir_hook_t hook, void *hook_data); + VasEBoot_err_t (*dir) (VasEBoot_device_t device, const char *path, + VasEBoot_fs_dir_hook_t hook, void *hook_data); /* Open a file named NAME and initialize FILE. */ - grub_err_t (*open) (struct grub_file *file, const char *name); + VasEBoot_err_t (*open) (struct VasEBoot_file *file, const char *name); /* Read LEN bytes data from FILE into BUF. */ - grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_size_t len); + VasEBoot_ssize_t (*read) (struct VasEBoot_file *file, char *buf, VasEBoot_size_t len); /* Close the file FILE. */ - grub_err_t (*close) (struct grub_file *file); + VasEBoot_err_t (*close) (struct VasEBoot_file *file); /* Return the label of the device DEVICE in LABEL. The label is - returned in a grub_malloc'ed buffer and should be freed by the + returned in a VasEBoot_malloc'ed buffer and should be freed by the caller. */ - grub_err_t (*label) (grub_device_t device, char **label); + VasEBoot_err_t (*label) (VasEBoot_device_t device, char **label); /* Return the uuid of the device DEVICE in UUID. The uuid is - returned in a grub_malloc'ed buffer and should be freed by the + returned in a VasEBoot_malloc'ed buffer and should be freed by the caller. */ - grub_err_t (*uuid) (grub_device_t device, char **uuid); + VasEBoot_err_t (*uuid) (VasEBoot_device_t device, char **uuid); /* Get writing time of filesystem. */ - grub_err_t (*mtime) (grub_device_t device, grub_int32_t *timebuf); + VasEBoot_err_t (*mtime) (VasEBoot_device_t device, VasEBoot_int32_t *timebuf); -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL /* Determine sectors available for embedding. */ - grub_err_t (*embed) (grub_device_t device, unsigned int *nsectors, + VasEBoot_err_t (*embed) (VasEBoot_device_t device, unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors); + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors); /* Whether this filesystem reserves first sector for DOS-style boot. */ int reserved_first_sector; @@ -97,35 +97,35 @@ struct grub_fs int blocklist_install; #endif }; -typedef struct grub_fs *grub_fs_t; +typedef struct VasEBoot_fs *VasEBoot_fs_t; /* This is special, because block lists are not files in usual sense. */ -extern struct grub_fs grub_fs_blocklist; +extern struct VasEBoot_fs VasEBoot_fs_blocklist; /* This hook is used to automatically load filesystem modules. If this hook loads a module, return non-zero. Otherwise return zero. The newly loaded filesystem is assumed to be inserted into the head of - the linked list GRUB_FS_LIST through the function grub_fs_register. */ -typedef int (*grub_fs_autoload_hook_t) (void); -extern grub_fs_autoload_hook_t EXPORT_VAR(grub_fs_autoload_hook); -extern grub_fs_t EXPORT_VAR (grub_fs_list); + the linked list VasEBoot_FS_LIST through the function VasEBoot_fs_register. */ +typedef int (*VasEBoot_fs_autoload_hook_t) (void); +extern VasEBoot_fs_autoload_hook_t EXPORT_VAR(VasEBoot_fs_autoload_hook); +extern VasEBoot_fs_t EXPORT_VAR (VasEBoot_fs_list); -#ifndef GRUB_LST_GENERATOR +#ifndef VasEBoot_LST_GENERATOR static inline void -grub_fs_register (grub_fs_t fs) +VasEBoot_fs_register (VasEBoot_fs_t fs) { - grub_list_push (GRUB_AS_LIST_P (&grub_fs_list), GRUB_AS_LIST (fs)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_fs_list), VasEBoot_AS_LIST (fs)); } #endif static inline void -grub_fs_unregister (grub_fs_t fs) +VasEBoot_fs_unregister (VasEBoot_fs_t fs) { - grub_list_remove (GRUB_AS_LIST (fs)); + VasEBoot_list_remove (VasEBoot_AS_LIST (fs)); } -#define FOR_FILESYSTEMS(var) FOR_LIST_ELEMENTS((var), (grub_fs_list)) +#define FOR_FILESYSTEMS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_fs_list)) -grub_fs_t EXPORT_FUNC(grub_fs_probe) (grub_device_t device); +VasEBoot_fs_t EXPORT_FUNC(VasEBoot_fs_probe) (VasEBoot_device_t device); -#endif /* ! GRUB_FS_HEADER */ +#endif /* ! VasEBoot_FS_HEADER */ diff --git a/include/VasEBoot/fshelp.h b/include/VasEBoot/fshelp.h index eb1ba4f6c..102718570 100644 --- a/include/VasEBoot/fshelp.h +++ b/include/VasEBoot/fshelp.h @@ -1,47 +1,47 @@ /* fshelp.h -- Filesystem helper functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FSHELP_HEADER -#define GRUB_FSHELP_HEADER 1 +#ifndef VasEBoot_FSHELP_HEADER +#define VasEBoot_FSHELP_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -typedef struct grub_fshelp_node *grub_fshelp_node_t; +typedef struct VasEBoot_fshelp_node *VasEBoot_fshelp_node_t; -#define GRUB_FSHELP_CASE_INSENSITIVE 0x100 -#define GRUB_FSHELP_TYPE_MASK 0xff -#define GRUB_FSHELP_FLAGS_MASK 0x100 +#define VasEBoot_FSHELP_CASE_INSENSITIVE 0x100 +#define VasEBoot_FSHELP_TYPE_MASK 0xff +#define VasEBoot_FSHELP_FLAGS_MASK 0x100 -enum grub_fshelp_filetype +enum VasEBoot_fshelp_filetype { - GRUB_FSHELP_UNKNOWN, - GRUB_FSHELP_REG, - GRUB_FSHELP_DIR, - GRUB_FSHELP_SYMLINK + VasEBoot_FSHELP_UNKNOWN, + VasEBoot_FSHELP_REG, + VasEBoot_FSHELP_DIR, + VasEBoot_FSHELP_SYMLINK }; -typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename, - enum grub_fshelp_filetype filetype, - grub_fshelp_node_t node, +typedef int (*VasEBoot_fshelp_iterate_dir_hook_t) (const char *filename, + enum VasEBoot_fshelp_filetype filetype, + VasEBoot_fshelp_node_t node, void *data); /* Lookup the node PATH. The node ROOTNODE describes the root of the @@ -51,41 +51,41 @@ typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename, READ_SYMLINK is used to read the symlink if a node is a symlink. EXPECTTYPE is the type node that is expected by the called, an error is generated if the node is not of the expected type. */ -grub_err_t -EXPORT_FUNC(grub_fshelp_find_file) (const char *path, - grub_fshelp_node_t rootnode, - grub_fshelp_node_t *foundnode, - int (*iterate_dir) (grub_fshelp_node_t dir, - grub_fshelp_iterate_dir_hook_t hook, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_fshelp_find_file) (const char *path, + VasEBoot_fshelp_node_t rootnode, + VasEBoot_fshelp_node_t *foundnode, + int (*iterate_dir) (VasEBoot_fshelp_node_t dir, + VasEBoot_fshelp_iterate_dir_hook_t hook, void *hook_data), - char *(*read_symlink) (grub_fshelp_node_t node), - enum grub_fshelp_filetype expect); + char *(*read_symlink) (VasEBoot_fshelp_node_t node), + enum VasEBoot_fshelp_filetype expect); -grub_err_t -EXPORT_FUNC(grub_fshelp_find_file_lookup) (const char *path, - grub_fshelp_node_t rootnode, - grub_fshelp_node_t *foundnode, - grub_err_t (*lookup_file) (grub_fshelp_node_t dir, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_fshelp_find_file_lookup) (const char *path, + VasEBoot_fshelp_node_t rootnode, + VasEBoot_fshelp_node_t *foundnode, + VasEBoot_err_t (*lookup_file) (VasEBoot_fshelp_node_t dir, const char *name, - grub_fshelp_node_t *foundnode, - enum grub_fshelp_filetype *foundtype), - char *(*read_symlink) (grub_fshelp_node_t node), - enum grub_fshelp_filetype expect); + VasEBoot_fshelp_node_t *foundnode, + enum VasEBoot_fshelp_filetype *foundtype), + char *(*read_symlink) (VasEBoot_fshelp_node_t node), + enum VasEBoot_fshelp_filetype expect); /* Read LEN bytes from the file NODE on disk DISK into the buffer BUF, beginning with the block POS. READ_HOOK should be set before reading a block from the file. GET_BLOCK is used to translate file blocks to disk blocks. The file is FILESIZE bytes big and the blocks have a size of LOG2BLOCKSIZE (in log2). */ -grub_ssize_t -EXPORT_FUNC(grub_fshelp_read_file) (grub_disk_t disk, grub_fshelp_node_t node, - grub_disk_read_hook_t read_hook, +VasEBoot_ssize_t +EXPORT_FUNC(VasEBoot_fshelp_read_file) (VasEBoot_disk_t disk, VasEBoot_fshelp_node_t node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf, - grub_disk_addr_t (*get_block) (grub_fshelp_node_t node, - grub_disk_addr_t block), - grub_off_t filesize, int log2blocksize, - grub_disk_addr_t blocks_start); + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf, + VasEBoot_disk_addr_t (*get_block) (VasEBoot_fshelp_node_t node, + VasEBoot_disk_addr_t block), + VasEBoot_off_t filesize, int log2blocksize, + VasEBoot_disk_addr_t blocks_start); -#endif /* ! GRUB_FSHELP_HEADER */ +#endif /* ! VasEBoot_FSHELP_HEADER */ diff --git a/include/VasEBoot/gcry/types.h b/include/VasEBoot/gcry/types.h index 892a2042d..8d991f197 100644 --- a/include/VasEBoot/gcry/types.h +++ b/include/VasEBoot/gcry/types.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GCRY_TYPES_HEADER -#define GRUB_GCRY_TYPES_HEADER 1 +#ifndef VasEBoot_GCRY_TYPES_HEADER +#define VasEBoot_GCRY_TYPES_HEADER 1 -#include -#include +#include +#include -#ifdef GRUB_CPU_WORDS_BIGENDIAN +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN #define WORDS_BIGENDIAN #else #undef WORDS_BIGENDIAN #endif -typedef grub_uint64_t u64; -typedef grub_uint32_t u32; -typedef grub_uint16_t u16; -typedef grub_uint8_t byte; -typedef grub_size_t size_t; +typedef VasEBoot_uint64_t u64; +typedef VasEBoot_uint32_t u32; +typedef VasEBoot_uint16_t u16; +typedef VasEBoot_uint8_t byte; +typedef VasEBoot_size_t size_t; #endif diff --git a/include/VasEBoot/gcrypt/gpg-error.h b/include/VasEBoot/gcrypt/gpg-error.h index 1e4250284..3d1df6350 100644 --- a/include/VasEBoot/gcrypt/gpg-error.h +++ b/include/VasEBoot/gcrypt/gpg-error.h @@ -1,7 +1,7 @@ -#ifndef GRUB_GPG_ERROR_H -#define GRUB_GPG_ERROR_H 1 +#ifndef VasEBoot_GPG_ERROR_H +#define VasEBoot_GPG_ERROR_H 1 -#include +#include typedef enum { GPG_ERR_SOURCE_USER_1 diff --git a/include/VasEBoot/gdb.h b/include/VasEBoot/gdb.h index e73d13584..c640a9b60 100644 --- a/include/VasEBoot/gdb.h +++ b/include/VasEBoot/gdb.h @@ -17,8 +17,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef GRUB_GDB_HEADER -#define GRUB_GDB_HEADER 1 +#ifndef VasEBoot_GDB_HEADER +#define VasEBoot_GDB_HEADER 1 #define SIGFPE 8 #define SIGTRAP 5 @@ -28,12 +28,12 @@ #define SIGUSR1 30 /* We probably don't need other ones. */ -struct grub_serial_port; +struct VasEBoot_serial_port; -extern struct grub_serial_port *grub_gdb_port; +extern struct VasEBoot_serial_port *VasEBoot_gdb_port; -void grub_gdb_breakpoint (void); -unsigned int grub_gdb_trap2sig (int); +void VasEBoot_gdb_breakpoint (void); +unsigned int VasEBoot_gdb_trap2sig (int); -#endif /* ! GRUB_GDB_HEADER */ +#endif /* ! VasEBoot_GDB_HEADER */ diff --git a/include/VasEBoot/gfxmenu_view.h b/include/VasEBoot/gfxmenu_view.h index 4203c8fb9..77bfbf9d3 100644 --- a/include/VasEBoot/gfxmenu_view.h +++ b/include/VasEBoot/gfxmenu_view.h @@ -1,124 +1,124 @@ /* gfxmenu_view.h - gfxmenu view interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GFXMENU_VIEW_HEADER -#define GRUB_GFXMENU_VIEW_HEADER 1 +#ifndef VasEBoot_GFXMENU_VIEW_HEADER +#define VasEBoot_GFXMENU_VIEW_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -struct grub_gfxmenu_view; /* Forward declaration of opaque type. */ -typedef struct grub_gfxmenu_view *grub_gfxmenu_view_t; +struct VasEBoot_gfxmenu_view; /* Forward declaration of opaque type. */ +typedef struct VasEBoot_gfxmenu_view *VasEBoot_gfxmenu_view_t; -grub_gfxmenu_view_t grub_gfxmenu_view_new (const char *theme_path, +VasEBoot_gfxmenu_view_t VasEBoot_gfxmenu_view_new (const char *theme_path, int width, int height); -void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view); +void VasEBoot_gfxmenu_view_destroy (VasEBoot_gfxmenu_view_t view); /* Set properties on the view based on settings from the specified theme file. */ -grub_err_t grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view, +VasEBoot_err_t VasEBoot_gfxmenu_view_load_theme (VasEBoot_gfxmenu_view_t view, const char *theme_path); -grub_err_t grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr, +VasEBoot_err_t VasEBoot_gui_recreate_box (VasEBoot_gfxmenu_box_t *boxptr, const char *pattern, const char *theme_dir); -void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view); +void VasEBoot_gfxmenu_view_draw (VasEBoot_gfxmenu_view_t view); void -grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view); +VasEBoot_gfxmenu_redraw_menu (VasEBoot_gfxmenu_view_t view); void -grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view); +VasEBoot_gfxmenu_redraw_timeout (VasEBoot_gfxmenu_view_t view); void -grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view, - const grub_video_rect_t *region); +VasEBoot_gfxmenu_view_redraw (VasEBoot_gfxmenu_view_t view, + const VasEBoot_video_rect_t *region); void -grub_gfxmenu_clear_timeout (void *data); +VasEBoot_gfxmenu_clear_timeout (void *data); void -grub_gfxmenu_print_timeout (int timeout, void *data); +VasEBoot_gfxmenu_print_timeout (int timeout, void *data); void -grub_gfxmenu_set_chosen_entry (int entry, void *data); +VasEBoot_gfxmenu_set_chosen_entry (int entry, void *data); -grub_err_t grub_font_draw_string (const char *str, - grub_font_t font, - grub_video_color_t color, +VasEBoot_err_t VasEBoot_font_draw_string (const char *str, + VasEBoot_font_t font, + VasEBoot_video_color_t color, int left_x, int baseline_y); -int grub_font_get_string_width (grub_font_t font, +int VasEBoot_font_get_string_width (VasEBoot_font_t font, const char *str); /* Implementation details -- this should not be used outside of the view itself. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* Definition of the private representation of the view. */ -struct grub_gfxmenu_view +struct VasEBoot_gfxmenu_view { - grub_video_rect_t screen; + VasEBoot_video_rect_t screen; int need_to_check_sanity; - grub_video_rect_t terminal_rect; + VasEBoot_video_rect_t terminal_rect; int terminal_border; - grub_font_t title_font; - grub_font_t message_font; + VasEBoot_font_t title_font; + VasEBoot_font_t message_font; char *terminal_font_name; - grub_video_rgba_color_t title_color; - grub_video_rgba_color_t message_color; - grub_video_rgba_color_t message_bg_color; - struct grub_video_bitmap *raw_desktop_image; - struct grub_video_bitmap *scaled_desktop_image; - grub_video_bitmap_selection_method_t desktop_image_scale_method; - grub_video_bitmap_h_align_t desktop_image_h_align; - grub_video_bitmap_v_align_t desktop_image_v_align; - grub_video_rgba_color_t desktop_color; - grub_gfxmenu_box_t terminal_box; + VasEBoot_video_rgba_color_t title_color; + VasEBoot_video_rgba_color_t message_color; + VasEBoot_video_rgba_color_t message_bg_color; + struct VasEBoot_video_bitmap *raw_desktop_image; + struct VasEBoot_video_bitmap *scaled_desktop_image; + VasEBoot_video_bitmap_selection_method_t desktop_image_scale_method; + VasEBoot_video_bitmap_h_align_t desktop_image_h_align; + VasEBoot_video_bitmap_v_align_t desktop_image_v_align; + VasEBoot_video_rgba_color_t desktop_color; + VasEBoot_gfxmenu_box_t terminal_box; char *title_text; char *progress_message_text; char *theme_path; - grub_gui_container_t canvas; + VasEBoot_gui_container_t canvas; int double_repaint; int selected; - grub_video_rect_t progress_message_frame; + VasEBoot_video_rect_t progress_message_frame; - grub_menu_t menu; + VasEBoot_menu_t menu; int nested; int first_timeout; }; -#endif /* ! GRUB_GFXMENU_VIEW_HEADER */ +#endif /* ! VasEBoot_GFXMENU_VIEW_HEADER */ diff --git a/include/VasEBoot/gfxterm.h b/include/VasEBoot/gfxterm.h index 7e1ff6dfc..bc1d89e61 100644 --- a/include/VasEBoot/gfxterm.h +++ b/include/VasEBoot/gfxterm.h @@ -1,51 +1,51 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GFXTERM_HEADER -#define GRUB_GFXTERM_HEADER 1 +#ifndef VasEBoot_GFXTERM_HEADER +#define VasEBoot_GFXTERM_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -grub_err_t -EXPORT_FUNC (grub_gfxterm_set_window) (struct grub_video_render_target *target, +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_gfxterm_set_window) (struct VasEBoot_video_render_target *target, int x, int y, int width, int height, int double_repaint, - grub_font_t font, int border_width); + VasEBoot_font_t font, int border_width); -void EXPORT_FUNC (grub_gfxterm_schedule_repaint) (void); +void EXPORT_FUNC (VasEBoot_gfxterm_schedule_repaint) (void); -extern void (*EXPORT_VAR (grub_gfxterm_decorator_hook)) (void); +extern void (*EXPORT_VAR (VasEBoot_gfxterm_decorator_hook)) (void); -struct grub_gfxterm_background +struct VasEBoot_gfxterm_background { - struct grub_video_bitmap *bitmap; + struct VasEBoot_video_bitmap *bitmap; int blend_text_bg; - grub_video_rgba_color_t default_bg_color; + VasEBoot_video_rgba_color_t default_bg_color; }; -extern struct grub_gfxterm_background EXPORT_VAR (grub_gfxterm_background); +extern struct VasEBoot_gfxterm_background EXPORT_VAR (VasEBoot_gfxterm_background); -void EXPORT_FUNC (grub_gfxterm_video_update_color) (void); +void EXPORT_FUNC (VasEBoot_gfxterm_video_update_color) (void); void -EXPORT_FUNC (grub_gfxterm_get_dimensions) (unsigned *width, unsigned *height); +EXPORT_FUNC (VasEBoot_gfxterm_get_dimensions) (unsigned *width, unsigned *height); -#endif /* ! GRUB_GFXTERM_HEADER */ +#endif /* ! VasEBoot_GFXTERM_HEADER */ diff --git a/include/VasEBoot/gfxwidgets.h b/include/VasEBoot/gfxwidgets.h index 8ce666c5c..e1e87bc49 100644 --- a/include/VasEBoot/gfxwidgets.h +++ b/include/VasEBoot/gfxwidgets.h @@ -1,50 +1,50 @@ /* gfxwidgets.h - Widgets for the graphical menu (gfxmenu). */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GFXWIDGETS_HEADER -#define GRUB_GFXWIDGETS_HEADER 1 +#ifndef VasEBoot_GFXWIDGETS_HEADER +#define VasEBoot_GFXWIDGETS_HEADER 1 -#include +#include -typedef struct grub_gfxmenu_box *grub_gfxmenu_box_t; +typedef struct VasEBoot_gfxmenu_box *VasEBoot_gfxmenu_box_t; -struct grub_gfxmenu_box +struct VasEBoot_gfxmenu_box { /* The size of the content. */ int content_width; int content_height; - struct grub_video_bitmap **raw_pixmaps; - struct grub_video_bitmap **scaled_pixmaps; + struct VasEBoot_video_bitmap **raw_pixmaps; + struct VasEBoot_video_bitmap **scaled_pixmaps; - void (*draw) (grub_gfxmenu_box_t self, int x, int y); - void (*set_content_size) (grub_gfxmenu_box_t self, + void (*draw) (VasEBoot_gfxmenu_box_t self, int x, int y); + void (*set_content_size) (VasEBoot_gfxmenu_box_t self, int width, int height); - int (*get_border_width) (grub_gfxmenu_box_t self); - int (*get_left_pad) (grub_gfxmenu_box_t self); - int (*get_top_pad) (grub_gfxmenu_box_t self); - int (*get_right_pad) (grub_gfxmenu_box_t self); - int (*get_bottom_pad) (grub_gfxmenu_box_t self); - void (*destroy) (grub_gfxmenu_box_t self); + int (*get_border_width) (VasEBoot_gfxmenu_box_t self); + int (*get_left_pad) (VasEBoot_gfxmenu_box_t self); + int (*get_top_pad) (VasEBoot_gfxmenu_box_t self); + int (*get_right_pad) (VasEBoot_gfxmenu_box_t self); + int (*get_bottom_pad) (VasEBoot_gfxmenu_box_t self); + void (*destroy) (VasEBoot_gfxmenu_box_t self); }; -grub_gfxmenu_box_t grub_gfxmenu_create_box (const char *pixmaps_prefix, +VasEBoot_gfxmenu_box_t VasEBoot_gfxmenu_create_box (const char *pixmaps_prefix, const char *pixmaps_suffix); -#endif /* ! GRUB_GFXWIDGETS_HEADER */ +#endif /* ! VasEBoot_GFXWIDGETS_HEADER */ diff --git a/include/VasEBoot/gpt_partition.h b/include/VasEBoot/gpt_partition.h index 466735134..3e3390476 100644 --- a/include/VasEBoot/gpt_partition.h +++ b/include/VasEBoot/gpt_partition.h @@ -1,251 +1,251 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GPT_PARTITION_HEADER -#define GRUB_GPT_PARTITION_HEADER 1 +#ifndef VasEBoot_GPT_PARTITION_HEADER +#define VasEBoot_GPT_PARTITION_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_gpt_guid +struct VasEBoot_gpt_guid { - grub_uint32_t data1; - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; -} GRUB_PACKED; -typedef struct grub_gpt_guid grub_gpt_guid_t; -typedef struct grub_gpt_guid grub_gpt_part_type_t; + VasEBoot_uint32_t data1; + VasEBoot_uint16_t data2; + VasEBoot_uint16_t data3; + VasEBoot_uint8_t data4[8]; +} VasEBoot_PACKED; +typedef struct VasEBoot_gpt_guid VasEBoot_gpt_guid_t; +typedef struct VasEBoot_gpt_guid VasEBoot_gpt_part_type_t; /* Format the raw little-endian GUID as a newly allocated string. */ -char * grub_gpt_guid_to_str (grub_gpt_guid_t *guid); +char * VasEBoot_gpt_guid_to_str (VasEBoot_gpt_guid_t *guid); -#define GRUB_GPT_GUID_INIT(a, b, c, d1, d2, d3, d4, d5, d6, d7, d8) \ +#define VasEBoot_GPT_GUID_INIT(a, b, c, d1, d2, d3, d4, d5, d6, d7, d8) \ { \ - grub_cpu_to_le32_compile_time (a), \ - grub_cpu_to_le16_compile_time (b), \ - grub_cpu_to_le16_compile_time (c), \ + VasEBoot_cpu_to_le32_compile_time (a), \ + VasEBoot_cpu_to_le16_compile_time (b), \ + VasEBoot_cpu_to_le16_compile_time (c), \ { d1, d2, d3, d4, d5, d6, d7, d8 } \ } -#define GRUB_GPT_PARTITION_TYPE_EMPTY \ - GRUB_GPT_GUID_INIT (0x0, 0x0, 0x0, \ +#define VasEBoot_GPT_PARTITION_TYPE_EMPTY \ + VasEBoot_GPT_GUID_INIT (0x0, 0x0, 0x0, \ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) -#define GRUB_GPT_PARTITION_TYPE_EFI_SYSTEM \ - GRUB_GPT_GUID_INIT (0xc12a7328, 0xf81f, 0x11d2, \ +#define VasEBoot_GPT_PARTITION_TYPE_EFI_SYSTEM \ + VasEBoot_GPT_GUID_INIT (0xc12a7328, 0xf81f, 0x11d2, \ 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b) -#define GRUB_GPT_PARTITION_TYPE_BIOS_BOOT \ - GRUB_GPT_GUID_INIT (0x21686148, 0x6449, 0x6e6f, \ +#define VasEBoot_GPT_PARTITION_TYPE_BIOS_BOOT \ + VasEBoot_GPT_GUID_INIT (0x21686148, 0x6449, 0x6e6f, \ 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49) -#define GRUB_GPT_PARTITION_TYPE_LDM \ - GRUB_GPT_GUID_INIT (0x5808c8aa, 0x7e8f, 0x42e0, \ +#define VasEBoot_GPT_PARTITION_TYPE_LDM \ + VasEBoot_GPT_GUID_INIT (0x5808c8aa, 0x7e8f, 0x42e0, \ 0x85, 0xd2, 0xe1, 0xe9, 0x04, 0x34, 0xcf, 0xb3) -#define GRUB_GPT_PARTITION_TYPE_USR_X86_64 \ - GRUB_GPT_GUID_INIT (0x5dfbf5f4, 0x2848, 0x4bac, \ +#define VasEBoot_GPT_PARTITION_TYPE_USR_X86_64 \ + VasEBoot_GPT_GUID_INIT (0x5dfbf5f4, 0x2848, 0x4bac, \ 0xaa, 0x5e, 0x0d, 0x9a, 0x20, 0xb7, 0x45, 0xa6) -#define GRUB_GPT_HEADER_MAGIC \ +#define VasEBoot_GPT_HEADER_MAGIC \ { 0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54 } -#define GRUB_GPT_HEADER_VERSION \ - grub_cpu_to_le32_compile_time (0x00010000U) +#define VasEBoot_GPT_HEADER_VERSION \ + VasEBoot_cpu_to_le32_compile_time (0x00010000U) -struct grub_gpt_header +struct VasEBoot_gpt_header { - grub_uint8_t magic[8]; - grub_uint32_t version; - grub_uint32_t headersize; - grub_uint32_t crc32; - grub_uint32_t unused1; - grub_uint64_t header_lba; - grub_uint64_t alternate_lba; - grub_uint64_t start; - grub_uint64_t end; - grub_gpt_guid_t guid; - grub_uint64_t partitions; - grub_uint32_t maxpart; - grub_uint32_t partentry_size; - grub_uint32_t partentry_crc32; -} GRUB_PACKED; + VasEBoot_uint8_t magic[8]; + VasEBoot_uint32_t version; + VasEBoot_uint32_t headersize; + VasEBoot_uint32_t crc32; + VasEBoot_uint32_t unused1; + VasEBoot_uint64_t header_lba; + VasEBoot_uint64_t alternate_lba; + VasEBoot_uint64_t start; + VasEBoot_uint64_t end; + VasEBoot_gpt_guid_t guid; + VasEBoot_uint64_t partitions; + VasEBoot_uint32_t maxpart; + VasEBoot_uint32_t partentry_size; + VasEBoot_uint32_t partentry_crc32; +} VasEBoot_PACKED; -struct grub_gpt_partentry +struct VasEBoot_gpt_partentry { - grub_gpt_part_type_t type; - grub_gpt_guid_t guid; - grub_uint64_t start; - grub_uint64_t end; - grub_uint64_t attrib; - grub_uint16_t name[36]; -} GRUB_PACKED; + VasEBoot_gpt_part_type_t type; + VasEBoot_gpt_guid_t guid; + VasEBoot_uint64_t start; + VasEBoot_uint64_t end; + VasEBoot_uint64_t attrib; + VasEBoot_uint16_t name[36]; +} VasEBoot_PACKED; -enum grub_gpt_part_attr_offset +enum VasEBoot_gpt_part_attr_offset { /* Standard partition attribute bits defined by UEFI. */ - GRUB_GPT_PART_ATTR_OFFSET_REQUIRED = 0, - GRUB_GPT_PART_ATTR_OFFSET_NO_BLOCK_IO_PROTOCOL = 1, - GRUB_GPT_PART_ATTR_OFFSET_LEGACY_BIOS_BOOTABLE = 2, + VasEBoot_GPT_PART_ATTR_OFFSET_REQUIRED = 0, + VasEBoot_GPT_PART_ATTR_OFFSET_NO_BLOCK_IO_PROTOCOL = 1, + VasEBoot_GPT_PART_ATTR_OFFSET_LEGACY_BIOS_BOOTABLE = 2, /* De facto standard attribute bits defined by Microsoft and reused by * http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec */ - GRUB_GPT_PART_ATTR_OFFSET_READ_ONLY = 60, - GRUB_GPT_PART_ATTR_OFFSET_NO_AUTO = 63, + VasEBoot_GPT_PART_ATTR_OFFSET_READ_ONLY = 60, + VasEBoot_GPT_PART_ATTR_OFFSET_NO_AUTO = 63, /* Partition attributes for priority based selection, * Currently only valid for PARTITION_TYPE_USR_X86_64. * TRIES_LEFT and PRIORITY are 4 bit wide fields. */ - GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_PRIORITY = 48, - GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_TRIES_LEFT = 52, - GRUB_GPT_PART_ATTR_OFFSET_GPTPRIO_SUCCESSFUL = 56, + VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_PRIORITY = 48, + VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_TRIES_LEFT = 52, + VasEBoot_GPT_PART_ATTR_OFFSET_GPTPRIO_SUCCESSFUL = 56, }; /* Helpers for reading/writing partition attributes. */ -static inline grub_uint64_t -grub_gpt_entry_attribute (struct grub_gpt_partentry *entry, - enum grub_gpt_part_attr_offset offset, +static inline VasEBoot_uint64_t +VasEBoot_gpt_entry_attribute (struct VasEBoot_gpt_partentry *entry, + enum VasEBoot_gpt_part_attr_offset offset, unsigned int bits) { - grub_uint64_t attrib = grub_le_to_cpu64 (entry->attrib); + VasEBoot_uint64_t attrib = VasEBoot_le_to_cpu64 (entry->attrib); return (attrib >> offset) & ((1ULL << bits) - 1); } static inline void -grub_gpt_entry_set_attribute (struct grub_gpt_partentry *entry, - grub_uint64_t value, - enum grub_gpt_part_attr_offset offset, +VasEBoot_gpt_entry_set_attribute (struct VasEBoot_gpt_partentry *entry, + VasEBoot_uint64_t value, + enum VasEBoot_gpt_part_attr_offset offset, unsigned int bits) { - grub_uint64_t attrib, mask; + VasEBoot_uint64_t attrib, mask; mask = (((1ULL << bits) - 1) << offset); - attrib = grub_le_to_cpu64 (entry->attrib) & ~mask; + attrib = VasEBoot_le_to_cpu64 (entry->attrib) & ~mask; attrib |= ((value << offset) & mask); - entry->attrib = grub_cpu_to_le64 (attrib); + entry->attrib = VasEBoot_cpu_to_le64 (attrib); } /* Basic GPT partmap module. */ -grub_err_t -grub_gpt_partition_map_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +VasEBoot_err_t +VasEBoot_gpt_partition_map_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data); /* Advanced GPT library. */ -/* Status bits for the grub_gpt.status field. */ -#define GRUB_GPT_PROTECTIVE_MBR 0x01 -#define GRUB_GPT_HYBRID_MBR 0x02 -#define GRUB_GPT_PRIMARY_HEADER_VALID 0x04 -#define GRUB_GPT_PRIMARY_ENTRIES_VALID 0x08 -#define GRUB_GPT_BACKUP_HEADER_VALID 0x10 -#define GRUB_GPT_BACKUP_ENTRIES_VALID 0x20 +/* Status bits for the VasEBoot_gpt.status field. */ +#define VasEBoot_GPT_PROTECTIVE_MBR 0x01 +#define VasEBoot_GPT_HYBRID_MBR 0x02 +#define VasEBoot_GPT_PRIMARY_HEADER_VALID 0x04 +#define VasEBoot_GPT_PRIMARY_ENTRIES_VALID 0x08 +#define VasEBoot_GPT_BACKUP_HEADER_VALID 0x10 +#define VasEBoot_GPT_BACKUP_ENTRIES_VALID 0x20 /* UEFI requires the entries table to be at least 16384 bytes for a * total of 128 entries given the standard 128 byte entry size. */ -#define GRUB_GPT_DEFAULT_ENTRIES_SIZE 16384 -#define GRUB_GPT_DEFAULT_ENTRIES_LENGTH \ - (GRUB_GPT_DEFAULT_ENTRIES_SIZE / sizeof (struct grub_gpt_partentry)) +#define VasEBoot_GPT_DEFAULT_ENTRIES_SIZE 16384 +#define VasEBoot_GPT_DEFAULT_ENTRIES_LENGTH \ + (VasEBoot_GPT_DEFAULT_ENTRIES_SIZE / sizeof (struct VasEBoot_gpt_partentry)) -struct grub_gpt +struct VasEBoot_gpt { /* Bit field indicating which structures on disk are valid. */ unsigned status; /* Protective or hybrid MBR. */ - struct grub_msdos_partition_mbr mbr; + struct VasEBoot_msdos_partition_mbr mbr; /* Each of the two GPT headers. */ - struct grub_gpt_header primary; - struct grub_gpt_header backup; + struct VasEBoot_gpt_header primary; + struct VasEBoot_gpt_header backup; /* Only need one entries table, on disk both copies are identical. * The on disk entry size may be larger than our partentry struct so * the table cannot be indexed directly. */ void *entries; - grub_size_t entries_size; + VasEBoot_size_t entries_size; /* Logarithm of sector size, in case GPT and disk driver disagree. */ unsigned int log_sector_size; }; -typedef struct grub_gpt *grub_gpt_t; +typedef struct VasEBoot_gpt *VasEBoot_gpt_t; /* Helpers for checking the gpt status field. */ static inline int -grub_gpt_mbr_valid (grub_gpt_t gpt) +VasEBoot_gpt_mbr_valid (VasEBoot_gpt_t gpt) { - return ((gpt->status & GRUB_GPT_PROTECTIVE_MBR) || - (gpt->status & GRUB_GPT_HYBRID_MBR)); + return ((gpt->status & VasEBoot_GPT_PROTECTIVE_MBR) || + (gpt->status & VasEBoot_GPT_HYBRID_MBR)); } static inline int -grub_gpt_primary_valid (grub_gpt_t gpt) +VasEBoot_gpt_primary_valid (VasEBoot_gpt_t gpt) { - return ((gpt->status & GRUB_GPT_PRIMARY_HEADER_VALID) && - (gpt->status & GRUB_GPT_PRIMARY_ENTRIES_VALID)); + return ((gpt->status & VasEBoot_GPT_PRIMARY_HEADER_VALID) && + (gpt->status & VasEBoot_GPT_PRIMARY_ENTRIES_VALID)); } static inline int -grub_gpt_backup_valid (grub_gpt_t gpt) +VasEBoot_gpt_backup_valid (VasEBoot_gpt_t gpt) { - return ((gpt->status & GRUB_GPT_BACKUP_HEADER_VALID) && - (gpt->status & GRUB_GPT_BACKUP_ENTRIES_VALID)); + return ((gpt->status & VasEBoot_GPT_BACKUP_HEADER_VALID) && + (gpt->status & VasEBoot_GPT_BACKUP_ENTRIES_VALID)); } static inline int -grub_gpt_both_valid (grub_gpt_t gpt) +VasEBoot_gpt_both_valid (VasEBoot_gpt_t gpt) { - return grub_gpt_primary_valid (gpt) && grub_gpt_backup_valid (gpt); + return VasEBoot_gpt_primary_valid (gpt) && VasEBoot_gpt_backup_valid (gpt); } -/* Translate GPT sectors to GRUB's 512 byte block addresses. */ -static inline grub_disk_addr_t -grub_gpt_sector_to_addr (grub_gpt_t gpt, grub_uint64_t sector) +/* Translate GPT sectors to VasEBoot's 512 byte block addresses. */ +static inline VasEBoot_disk_addr_t +VasEBoot_gpt_sector_to_addr (VasEBoot_gpt_t gpt, VasEBoot_uint64_t sector) { - return (sector << (gpt->log_sector_size - GRUB_DISK_SECTOR_BITS)); + return (sector << (gpt->log_sector_size - VasEBoot_DISK_SECTOR_BITS)); } -/* Allocates and fills new grub_gpt structure, free with grub_gpt_free. */ -grub_gpt_t grub_gpt_read (grub_disk_t disk); +/* Allocates and fills new VasEBoot_gpt structure, free with VasEBoot_gpt_free. */ +VasEBoot_gpt_t VasEBoot_gpt_read (VasEBoot_disk_t disk); /* Helper for indexing into the entries table. * Returns NULL when the end of the table has been reached. */ -struct grub_gpt_partentry * grub_gpt_get_partentry (grub_gpt_t gpt, - grub_uint32_t n); +struct VasEBoot_gpt_partentry * VasEBoot_gpt_get_partentry (VasEBoot_gpt_t gpt, + VasEBoot_uint32_t n); /* Sync and update primary and backup headers if either are invalid. */ -grub_err_t grub_gpt_repair (grub_disk_t disk, grub_gpt_t gpt); +VasEBoot_err_t VasEBoot_gpt_repair (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt); /* Recompute checksums and revalidate everything, must be called after * modifying any GPT data. */ -grub_err_t grub_gpt_update (grub_gpt_t gpt); +VasEBoot_err_t VasEBoot_gpt_update (VasEBoot_gpt_t gpt); /* Write headers and entry tables back to disk. */ -grub_err_t grub_gpt_write (grub_disk_t disk, grub_gpt_t gpt); +VasEBoot_err_t VasEBoot_gpt_write (VasEBoot_disk_t disk, VasEBoot_gpt_t gpt); -void grub_gpt_free (grub_gpt_t gpt); +void VasEBoot_gpt_free (VasEBoot_gpt_t gpt); -grub_err_t grub_gpt_pmbr_check (struct grub_msdos_partition_mbr *mbr); -grub_err_t grub_gpt_header_check (struct grub_gpt_header *gpt, +VasEBoot_err_t VasEBoot_gpt_pmbr_check (struct VasEBoot_msdos_partition_mbr *mbr); +VasEBoot_err_t VasEBoot_gpt_header_check (struct VasEBoot_gpt_header *gpt, unsigned int log_sector_size); @@ -254,14 +254,14 @@ grub_err_t grub_gpt_header_check (struct grub_gpt_header *gpt, /* Return the partition label of the device DEVICE in LABEL. * The label is in a new buffer and should be freed by the caller. */ -grub_err_t grub_gpt_part_label (grub_device_t device, char **label); +VasEBoot_err_t VasEBoot_gpt_part_label (VasEBoot_device_t device, char **label); /* Return the partition uuid of the device DEVICE in UUID. * The uuid is in a new buffer and should be freed by the caller. */ -grub_err_t grub_gpt_part_uuid (grub_device_t device, char **uuid); +VasEBoot_err_t VasEBoot_gpt_part_uuid (VasEBoot_device_t device, char **uuid); /* Return the disk uuid of the device DEVICE in UUID. * The uuid is in a new buffer and should be freed by the caller. */ -grub_err_t grub_gpt_disk_uuid (grub_device_t device, char **uuid); +VasEBoot_err_t VasEBoot_gpt_disk_uuid (VasEBoot_device_t device, char **uuid); -#endif /* ! GRUB_GPT_PARTITION_HEADER */ +#endif /* ! VasEBoot_GPT_PARTITION_HEADER */ diff --git a/include/VasEBoot/gui.h b/include/VasEBoot/gui.h index 3657623c8..64cc51e78 100644 --- a/include/VasEBoot/gui.h +++ b/include/VasEBoot/gui.h @@ -1,128 +1,128 @@ /* gui.h - GUI components header file. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#ifndef GRUB_GUI_H -#define GRUB_GUI_H 1 +#ifndef VasEBoot_GUI_H +#define VasEBoot_GUI_H 1 /* The component ID identifying GUI components to be updated as the timeout status changes. */ -#define GRUB_GFXMENU_TIMEOUT_COMPONENT_ID "__timeout__" +#define VasEBoot_GFXMENU_TIMEOUT_COMPONENT_ID "__timeout__" -typedef struct grub_gui_component *grub_gui_component_t; -typedef struct grub_gui_container *grub_gui_container_t; -typedef struct grub_gui_list *grub_gui_list_t; +typedef struct VasEBoot_gui_component *VasEBoot_gui_component_t; +typedef struct VasEBoot_gui_container *VasEBoot_gui_container_t; +typedef struct VasEBoot_gui_list *VasEBoot_gui_list_t; -typedef void (*grub_gui_component_callback) (grub_gui_component_t component, +typedef void (*VasEBoot_gui_component_callback) (VasEBoot_gui_component_t component, void *userdata); /* Component interface. */ -struct grub_gui_component_ops +struct VasEBoot_gui_component_ops { void (*destroy) (void *self); const char * (*get_id) (void *self); int (*is_instance) (void *self, const char *type); - void (*paint) (void *self, const grub_video_rect_t *bounds); - void (*set_parent) (void *self, grub_gui_container_t parent); - grub_gui_container_t (*get_parent) (void *self); - void (*set_bounds) (void *self, const grub_video_rect_t *bounds); - void (*get_bounds) (void *self, grub_video_rect_t *bounds); + void (*paint) (void *self, const VasEBoot_video_rect_t *bounds); + void (*set_parent) (void *self, VasEBoot_gui_container_t parent); + VasEBoot_gui_container_t (*get_parent) (void *self); + void (*set_bounds) (void *self, const VasEBoot_video_rect_t *bounds); + void (*get_bounds) (void *self, VasEBoot_video_rect_t *bounds); void (*get_minimal_size) (void *self, unsigned *width, unsigned *height); - grub_err_t (*set_property) (void *self, const char *name, const char *value); + VasEBoot_err_t (*set_property) (void *self, const char *name, const char *value); void (*repaint) (void *self, int second_pass); }; -struct grub_gui_container_ops +struct VasEBoot_gui_container_ops { - void (*add) (void *self, grub_gui_component_t comp); - void (*remove) (void *self, grub_gui_component_t comp); + void (*add) (void *self, VasEBoot_gui_component_t comp); + void (*remove) (void *self, VasEBoot_gui_component_t comp); void (*iterate_children) (void *self, - grub_gui_component_callback cb, void *userdata); + VasEBoot_gui_component_callback cb, void *userdata); }; -struct grub_gui_list_ops +struct VasEBoot_gui_list_ops { void (*set_view_info) (void *self, - grub_gfxmenu_view_t view); + VasEBoot_gfxmenu_view_t view); void (*refresh_list) (void *self, - grub_gfxmenu_view_t view); + VasEBoot_gfxmenu_view_t view); }; -struct grub_gui_progress_ops +struct VasEBoot_gui_progress_ops { void (*set_state) (void *self, int visible, int start, int current, int end); }; -typedef void (*grub_gfxmenu_set_state_t) (void *self, int visible, int start, +typedef void (*VasEBoot_gfxmenu_set_state_t) (void *self, int visible, int start, int current, int end); -struct grub_gfxmenu_timeout_notify +struct VasEBoot_gfxmenu_timeout_notify { - struct grub_gfxmenu_timeout_notify *next; - grub_gfxmenu_set_state_t set_state; - grub_gui_component_t self; + struct VasEBoot_gfxmenu_timeout_notify *next; + VasEBoot_gfxmenu_set_state_t set_state; + VasEBoot_gui_component_t self; }; -extern struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications; +extern struct VasEBoot_gfxmenu_timeout_notify *VasEBoot_gfxmenu_timeout_notifications; -static inline grub_err_t -grub_gfxmenu_timeout_register (grub_gui_component_t self, - grub_gfxmenu_set_state_t set_state) +static inline VasEBoot_err_t +VasEBoot_gfxmenu_timeout_register (VasEBoot_gui_component_t self, + VasEBoot_gfxmenu_set_state_t set_state) { - struct grub_gfxmenu_timeout_notify *ne = grub_malloc (sizeof (*ne)); + struct VasEBoot_gfxmenu_timeout_notify *ne = VasEBoot_malloc (sizeof (*ne)); if (!ne) - return grub_errno; + return VasEBoot_errno; ne->set_state = set_state; ne->self = self; - ne->next = grub_gfxmenu_timeout_notifications; - grub_gfxmenu_timeout_notifications = ne; - return GRUB_ERR_NONE; + ne->next = VasEBoot_gfxmenu_timeout_notifications; + VasEBoot_gfxmenu_timeout_notifications = ne; + return VasEBoot_ERR_NONE; } static inline void -grub_gfxmenu_timeout_unregister (grub_gui_component_t self) +VasEBoot_gfxmenu_timeout_unregister (VasEBoot_gui_component_t self) { - struct grub_gfxmenu_timeout_notify **p, *q; + struct VasEBoot_gfxmenu_timeout_notify **p, *q; - for (p = &grub_gfxmenu_timeout_notifications, q = *p; + for (p = &VasEBoot_gfxmenu_timeout_notifications, q = *p; q; p = &(q->next), q = q->next) if (q->self == self) { *p = q->next; - grub_free (q); + VasEBoot_free (q); break; } } -typedef signed grub_fixed_signed_t; -#define GRUB_FIXED_1 0x10000 +typedef signed VasEBoot_fixed_signed_t; +#define VasEBoot_FIXED_1 0x10000 /* Special care is taken to round to nearest integer and not just truncate. */ static inline signed -grub_divide_round (signed a, signed b) +VasEBoot_divide_round (signed a, signed b) { int neg = 0; signed ret; @@ -141,123 +141,123 @@ grub_divide_round (signed a, signed b) } static inline signed -grub_fixed_sfs_divide (signed a, grub_fixed_signed_t b) +VasEBoot_fixed_sfs_divide (signed a, VasEBoot_fixed_signed_t b) { - return grub_divide_round (a * GRUB_FIXED_1, b); + return VasEBoot_divide_round (a * VasEBoot_FIXED_1, b); } -static inline grub_fixed_signed_t -grub_fixed_fsf_divide (grub_fixed_signed_t a, signed b) +static inline VasEBoot_fixed_signed_t +VasEBoot_fixed_fsf_divide (VasEBoot_fixed_signed_t a, signed b) { - return grub_divide_round (a, b); + return VasEBoot_divide_round (a, b); } static inline signed -grub_fixed_sfs_multiply (signed a, grub_fixed_signed_t b) +VasEBoot_fixed_sfs_multiply (signed a, VasEBoot_fixed_signed_t b) { - return (a * b) / GRUB_FIXED_1; + return (a * b) / VasEBoot_FIXED_1; } static inline signed -grub_fixed_to_signed (grub_fixed_signed_t in) +VasEBoot_fixed_to_signed (VasEBoot_fixed_signed_t in) { - return in / GRUB_FIXED_1; + return in / VasEBoot_FIXED_1; } -static inline grub_fixed_signed_t -grub_signed_to_fixed (signed in) +static inline VasEBoot_fixed_signed_t +VasEBoot_signed_to_fixed (signed in) { - return in * GRUB_FIXED_1; + return in * VasEBoot_FIXED_1; } -struct grub_gui_component +struct VasEBoot_gui_component { - struct grub_gui_component_ops *ops; + struct VasEBoot_gui_component_ops *ops; signed x; - grub_fixed_signed_t xfrac; + VasEBoot_fixed_signed_t xfrac; signed y; - grub_fixed_signed_t yfrac; + VasEBoot_fixed_signed_t yfrac; signed w; - grub_fixed_signed_t wfrac; + VasEBoot_fixed_signed_t wfrac; signed h; - grub_fixed_signed_t hfrac; + VasEBoot_fixed_signed_t hfrac; }; -struct grub_gui_progress +struct VasEBoot_gui_progress { - struct grub_gui_component component; - struct grub_gui_progress_ops *ops; + struct VasEBoot_gui_component component; + struct VasEBoot_gui_progress_ops *ops; }; -struct grub_gui_container +struct VasEBoot_gui_container { - struct grub_gui_component component; - struct grub_gui_container_ops *ops; + struct VasEBoot_gui_component component; + struct VasEBoot_gui_container_ops *ops; }; -struct grub_gui_list +struct VasEBoot_gui_list { - struct grub_gui_component component; - struct grub_gui_list_ops *ops; + struct VasEBoot_gui_component component; + struct VasEBoot_gui_list_ops *ops; }; /* Interfaces to concrete component classes. */ -grub_gui_container_t grub_gui_canvas_new (void); -grub_gui_container_t grub_gui_vbox_new (void); -grub_gui_container_t grub_gui_hbox_new (void); -grub_gui_component_t grub_gui_label_new (void); -grub_gui_component_t grub_gui_image_new (void); -grub_gui_component_t grub_gui_progress_bar_new (void); -grub_gui_component_t grub_gui_list_new (void); -grub_gui_component_t grub_gui_circular_progress_new (void); +VasEBoot_gui_container_t VasEBoot_gui_canvas_new (void); +VasEBoot_gui_container_t VasEBoot_gui_vbox_new (void); +VasEBoot_gui_container_t VasEBoot_gui_hbox_new (void); +VasEBoot_gui_component_t VasEBoot_gui_label_new (void); +VasEBoot_gui_component_t VasEBoot_gui_image_new (void); +VasEBoot_gui_component_t VasEBoot_gui_progress_bar_new (void); +VasEBoot_gui_component_t VasEBoot_gui_list_new (void); +VasEBoot_gui_component_t VasEBoot_gui_circular_progress_new (void); /* Manipulation functions. */ /* Visit all components with the specified ID. */ -void grub_gui_find_by_id (grub_gui_component_t root, +void VasEBoot_gui_find_by_id (VasEBoot_gui_component_t root, const char *id, - grub_gui_component_callback cb, + VasEBoot_gui_component_callback cb, void *userdata); /* Visit all components. */ -void grub_gui_iterate_recursively (grub_gui_component_t root, - grub_gui_component_callback cb, +void VasEBoot_gui_iterate_recursively (VasEBoot_gui_component_t root, + VasEBoot_gui_component_callback cb, void *userdata); /* Helper functions. */ static __inline void -grub_gui_save_viewport (grub_video_rect_t *r) +VasEBoot_gui_save_viewport (VasEBoot_video_rect_t *r) { - grub_video_get_viewport ((unsigned *) &r->x, + VasEBoot_video_get_viewport ((unsigned *) &r->x, (unsigned *) &r->y, (unsigned *) &r->width, (unsigned *) &r->height); } static __inline void -grub_gui_restore_viewport (const grub_video_rect_t *r) +VasEBoot_gui_restore_viewport (const VasEBoot_video_rect_t *r) { - grub_video_set_viewport (r->x, r->y, r->width, r->height); + VasEBoot_video_set_viewport (r->x, r->y, r->width, r->height); } /* Set a new viewport relative the the current one, saving the current viewport in OLD so it can be later restored. */ static __inline void -grub_gui_set_viewport (const grub_video_rect_t *r, grub_video_rect_t *old) +VasEBoot_gui_set_viewport (const VasEBoot_video_rect_t *r, VasEBoot_video_rect_t *old) { - grub_gui_save_viewport (old); - grub_video_set_viewport (old->x + r->x, + VasEBoot_gui_save_viewport (old); + VasEBoot_video_set_viewport (old->x + r->x, old->y + r->y, r->width, r->height); } static inline int -grub_video_have_common_points (const grub_video_rect_t *a, - const grub_video_rect_t *b) +VasEBoot_video_have_common_points (const VasEBoot_video_rect_t *a, + const VasEBoot_video_rect_t *b) { if (!((a->x <= b->x && b->x <= a->x + a->width) || (b->x <= a->x && a->x <= b->x + b->width))) @@ -269,8 +269,8 @@ grub_video_have_common_points (const grub_video_rect_t *a, } static inline int -grub_video_bounds_inside_region (const grub_video_rect_t *b, - const grub_video_rect_t *r) +VasEBoot_video_bounds_inside_region (const VasEBoot_video_rect_t *b, + const VasEBoot_video_rect_t *r) { if (r->x > b->x || r->x + r->width < b->x + b->width) return 0; @@ -279,4 +279,4 @@ grub_video_bounds_inside_region (const grub_video_rect_t *b, return 1; } -#endif /* ! GRUB_GUI_H */ +#endif /* ! VasEBoot_GUI_H */ diff --git a/include/VasEBoot/gui_string_util.h b/include/VasEBoot/gui_string_util.h index 34f9a090d..e7151e184 100644 --- a/include/VasEBoot/gui_string_util.h +++ b/include/VasEBoot/gui_string_util.h @@ -1,33 +1,33 @@ /* gui_string_util.h - String utilities for the graphical menu interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_GUI_STRING_UTIL_HEADER -#define GRUB_GUI_STRING_UTIL_HEADER 1 +#ifndef VasEBoot_GUI_STRING_UTIL_HEADER +#define VasEBoot_GUI_STRING_UTIL_HEADER 1 -#include -#include +#include +#include -char *grub_new_substring (const char *buf, - grub_size_t start, grub_size_t end); +char *VasEBoot_new_substring (const char *buf, + VasEBoot_size_t start, VasEBoot_size_t end); -char *grub_resolve_relative_path (const char *base, const char *path); +char *VasEBoot_resolve_relative_path (const char *base, const char *path); -char *grub_get_dirname (const char *file_path); +char *VasEBoot_get_dirname (const char *file_path); -#endif /* GRUB_GUI_STRING_UTIL_HEADER */ +#endif /* VasEBoot_GUI_STRING_UTIL_HEADER */ diff --git a/include/VasEBoot/hfs.h b/include/VasEBoot/hfs.h index d935f5005..c0c630f65 100644 --- a/include/VasEBoot/hfs.h +++ b/include/VasEBoot/hfs.h @@ -1,72 +1,72 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_HFS_HEADER -#define GRUB_HFS_HEADER 1 +#ifndef VasEBoot_HFS_HEADER +#define VasEBoot_HFS_HEADER 1 -#include +#include -#define GRUB_HFS_MAGIC 0x4244 +#define VasEBoot_HFS_MAGIC 0x4244 /* A single extent. A file consists of one or more extents. */ -struct grub_hfs_extent +struct VasEBoot_hfs_extent { /* The first physical block. */ - grub_uint16_t first_block; - grub_uint16_t count; + VasEBoot_uint16_t first_block; + VasEBoot_uint16_t count; }; /* HFS stores extents in groups of 3. */ -typedef struct grub_hfs_extent grub_hfs_datarecord_t[3]; +typedef struct VasEBoot_hfs_extent VasEBoot_hfs_datarecord_t[3]; /* The HFS superblock (The official name is `Master Directory Block'). */ -struct grub_hfs_sblock +struct VasEBoot_hfs_sblock { - grub_uint16_t magic; - grub_uint32_t ctime; - grub_uint32_t mtime; - grub_uint8_t unused[10]; - grub_uint32_t blksz; - grub_uint8_t unused2[4]; - grub_uint16_t first_block; - grub_uint8_t unused4[6]; + VasEBoot_uint16_t magic; + VasEBoot_uint32_t ctime; + VasEBoot_uint32_t mtime; + VasEBoot_uint8_t unused[10]; + VasEBoot_uint32_t blksz; + VasEBoot_uint8_t unused2[4]; + VasEBoot_uint16_t first_block; + VasEBoot_uint8_t unused4[6]; /* A pascal style string that holds the volumename. */ - grub_uint8_t volname[28]; + VasEBoot_uint8_t volname[28]; - grub_uint8_t unused5[28]; + VasEBoot_uint8_t unused5[28]; - grub_uint32_t ppc_bootdir; - grub_uint32_t intel_bootfile; - /* Folder opened when disk is mounted. Unused by GRUB. */ - grub_uint32_t showfolder; - grub_uint32_t os9folder; - grub_uint8_t unused6[4]; - grub_uint32_t osxfolder; + VasEBoot_uint32_t ppc_bootdir; + VasEBoot_uint32_t intel_bootfile; + /* Folder opened when disk is mounted. Unused by VasEBoot. */ + VasEBoot_uint32_t showfolder; + VasEBoot_uint32_t os9folder; + VasEBoot_uint8_t unused6[4]; + VasEBoot_uint32_t osxfolder; - grub_uint64_t num_serial; - grub_uint16_t embed_sig; - struct grub_hfs_extent embed_extent; - grub_uint8_t unused7[4]; - grub_hfs_datarecord_t extent_recs; - grub_uint32_t catalog_size; - grub_hfs_datarecord_t catalog_recs; -} GRUB_PACKED; + VasEBoot_uint64_t num_serial; + VasEBoot_uint16_t embed_sig; + struct VasEBoot_hfs_extent embed_extent; + VasEBoot_uint8_t unused7[4]; + VasEBoot_hfs_datarecord_t extent_recs; + VasEBoot_uint32_t catalog_size; + VasEBoot_hfs_datarecord_t catalog_recs; +} VasEBoot_PACKED; -#endif /* ! GRUB_HFS_HEADER */ +#endif /* ! VasEBoot_HFS_HEADER */ diff --git a/include/VasEBoot/hfsplus.h b/include/VasEBoot/hfsplus.h index 117740ae2..0d1f1429d 100644 --- a/include/VasEBoot/hfsplus.h +++ b/include/VasEBoot/hfsplus.h @@ -1,257 +1,257 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include +#include +#include -#define GRUB_HFSPLUS_MAGIC 0x482B -#define GRUB_HFSPLUSX_MAGIC 0x4858 -#define GRUB_HFSPLUS_SBLOCK 2 +#define VasEBoot_HFSPLUS_MAGIC 0x482B +#define VasEBoot_HFSPLUSX_MAGIC 0x4858 +#define VasEBoot_HFSPLUS_SBLOCK 2 /* A HFS+ extent. */ -struct grub_hfsplus_extent +struct VasEBoot_hfsplus_extent { /* The first block of a file on disk. */ - grub_uint32_t start; + VasEBoot_uint32_t start; /* The amount of blocks described by this extent. */ - grub_uint32_t count; -} GRUB_PACKED; + VasEBoot_uint32_t count; +} VasEBoot_PACKED; /* The descriptor of a fork. */ -struct grub_hfsplus_forkdata +struct VasEBoot_hfsplus_forkdata { - grub_uint64_t size; - grub_uint32_t clumpsize; - grub_uint32_t blocks; - struct grub_hfsplus_extent extents[8]; -} GRUB_PACKED; + VasEBoot_uint64_t size; + VasEBoot_uint32_t clumpsize; + VasEBoot_uint32_t blocks; + struct VasEBoot_hfsplus_extent extents[8]; +} VasEBoot_PACKED; /* The HFS+ Volume Header. */ -struct grub_hfsplus_volheader +struct VasEBoot_hfsplus_volheader { - grub_uint16_t magic; - grub_uint16_t version; - grub_uint32_t attributes; - grub_uint8_t unused1[12]; - grub_uint32_t utime; - grub_uint8_t unused2[16]; - grub_uint32_t blksize; - grub_uint8_t unused3[36]; + VasEBoot_uint16_t magic; + VasEBoot_uint16_t version; + VasEBoot_uint32_t attributes; + VasEBoot_uint8_t unused1[12]; + VasEBoot_uint32_t utime; + VasEBoot_uint8_t unused2[16]; + VasEBoot_uint32_t blksize; + VasEBoot_uint8_t unused3[36]; - grub_uint32_t ppc_bootdir; - grub_uint32_t intel_bootfile; - /* Folder opened when disk is mounted. Unused by GRUB. */ - grub_uint32_t showfolder; - grub_uint32_t os9folder; - grub_uint8_t unused4[4]; - grub_uint32_t osxfolder; + VasEBoot_uint32_t ppc_bootdir; + VasEBoot_uint32_t intel_bootfile; + /* Folder opened when disk is mounted. Unused by VasEBoot. */ + VasEBoot_uint32_t showfolder; + VasEBoot_uint32_t os9folder; + VasEBoot_uint8_t unused4[4]; + VasEBoot_uint32_t osxfolder; - grub_uint64_t num_serial; - struct grub_hfsplus_forkdata allocations_file; - struct grub_hfsplus_forkdata extents_file; - struct grub_hfsplus_forkdata catalog_file; - struct grub_hfsplus_forkdata attr_file; - struct grub_hfsplus_forkdata startup_file; -} GRUB_PACKED; + VasEBoot_uint64_t num_serial; + struct VasEBoot_hfsplus_forkdata allocations_file; + struct VasEBoot_hfsplus_forkdata extents_file; + struct VasEBoot_hfsplus_forkdata catalog_file; + struct VasEBoot_hfsplus_forkdata attr_file; + struct VasEBoot_hfsplus_forkdata startup_file; +} VasEBoot_PACKED; -struct grub_hfsplus_compress_index +struct VasEBoot_hfsplus_compress_index { - grub_uint32_t start; - grub_uint32_t size; + VasEBoot_uint32_t start; + VasEBoot_uint32_t size; }; -struct grub_hfsplus_file +struct VasEBoot_hfsplus_file { - struct grub_hfsplus_data *data; - struct grub_hfsplus_extent extents[8]; - struct grub_hfsplus_extent resource_extents[8]; - grub_uint64_t size; - grub_uint64_t resource_size; - grub_uint32_t fileid; - grub_int32_t mtime; + struct VasEBoot_hfsplus_data *data; + struct VasEBoot_hfsplus_extent extents[8]; + struct VasEBoot_hfsplus_extent resource_extents[8]; + VasEBoot_uint64_t size; + VasEBoot_uint64_t resource_size; + VasEBoot_uint32_t fileid; + VasEBoot_int32_t mtime; int compressed; char *cbuf; void *file; - struct grub_hfsplus_compress_index *compress_index; - grub_uint32_t cbuf_block; - grub_uint32_t compress_index_size; + struct VasEBoot_hfsplus_compress_index *compress_index; + VasEBoot_uint32_t cbuf_block; + VasEBoot_uint32_t compress_index_size; }; -struct grub_hfsplus_btree +struct VasEBoot_hfsplus_btree { - grub_uint32_t root; - grub_size_t nodesize; + VasEBoot_uint32_t root; + VasEBoot_size_t nodesize; /* Catalog file node. */ - struct grub_hfsplus_file file; + struct VasEBoot_hfsplus_file file; }; /* Information about a "mounted" HFS+ filesystem. */ -struct grub_hfsplus_data +struct VasEBoot_hfsplus_data { - struct grub_hfsplus_volheader volheader; - grub_disk_t disk; + struct VasEBoot_hfsplus_volheader volheader; + VasEBoot_disk_t disk; unsigned int log2blksize; - struct grub_hfsplus_btree catalog_tree; - struct grub_hfsplus_btree extoverflow_tree; - struct grub_hfsplus_btree attr_tree; + struct VasEBoot_hfsplus_btree catalog_tree; + struct VasEBoot_hfsplus_btree extoverflow_tree; + struct VasEBoot_hfsplus_btree attr_tree; - struct grub_hfsplus_file dirroot; - struct grub_hfsplus_file opened_file; + struct VasEBoot_hfsplus_file dirroot; + struct VasEBoot_hfsplus_file opened_file; /* This is the offset into the physical disk for an embedded HFS+ filesystem (one inside a plain HFS wrapper). */ - grub_disk_addr_t embedded_offset; + VasEBoot_disk_addr_t embedded_offset; int case_sensitive; }; /* Internal representation of a catalog key. */ -struct grub_hfsplus_catkey_internal +struct VasEBoot_hfsplus_catkey_internal { - grub_uint32_t parent; - const grub_uint16_t *name; - grub_size_t namelen; + VasEBoot_uint32_t parent; + const VasEBoot_uint16_t *name; + VasEBoot_size_t namelen; }; /* Internal representation of an extent overflow key. */ -struct grub_hfsplus_extkey_internal +struct VasEBoot_hfsplus_extkey_internal { - grub_uint32_t fileid; - grub_uint32_t start; - grub_uint8_t type; + VasEBoot_uint32_t fileid; + VasEBoot_uint32_t start; + VasEBoot_uint8_t type; }; -struct grub_hfsplus_attrkey +struct VasEBoot_hfsplus_attrkey { - grub_uint16_t keylen; - grub_uint16_t unknown1[1]; - grub_uint32_t cnid; - grub_uint16_t unknown2[2]; - grub_uint16_t namelen; - grub_uint16_t name[0]; -} GRUB_PACKED; + VasEBoot_uint16_t keylen; + VasEBoot_uint16_t unknown1[1]; + VasEBoot_uint32_t cnid; + VasEBoot_uint16_t unknown2[2]; + VasEBoot_uint16_t namelen; + VasEBoot_uint16_t name[0]; +} VasEBoot_PACKED; -struct grub_hfsplus_attrkey_internal +struct VasEBoot_hfsplus_attrkey_internal { - grub_uint32_t cnid; - const grub_uint16_t *name; - grub_size_t namelen; + VasEBoot_uint32_t cnid; + const VasEBoot_uint16_t *name; + VasEBoot_size_t namelen; }; -struct grub_hfsplus_key_internal +struct VasEBoot_hfsplus_key_internal { union { - struct grub_hfsplus_extkey_internal extkey; - struct grub_hfsplus_catkey_internal catkey; - struct grub_hfsplus_attrkey_internal attrkey; + struct VasEBoot_hfsplus_extkey_internal extkey; + struct VasEBoot_hfsplus_catkey_internal catkey; + struct VasEBoot_hfsplus_attrkey_internal attrkey; }; }; /* The on disk layout of a catalog key. */ -struct grub_hfsplus_catkey +struct VasEBoot_hfsplus_catkey { - grub_uint16_t keylen; - grub_uint32_t parent; - grub_uint16_t namelen; - grub_uint16_t name[0]; -} GRUB_PACKED; + VasEBoot_uint16_t keylen; + VasEBoot_uint32_t parent; + VasEBoot_uint16_t namelen; + VasEBoot_uint16_t name[0]; +} VasEBoot_PACKED; /* The on disk layout of an extent overflow file key. */ -struct grub_hfsplus_extkey +struct VasEBoot_hfsplus_extkey { - grub_uint16_t keylen; - grub_uint8_t type; - grub_uint8_t unused; - grub_uint32_t fileid; - grub_uint32_t start; -} GRUB_PACKED; + VasEBoot_uint16_t keylen; + VasEBoot_uint8_t type; + VasEBoot_uint8_t unused; + VasEBoot_uint32_t fileid; + VasEBoot_uint32_t start; +} VasEBoot_PACKED; -struct grub_hfsplus_key +struct VasEBoot_hfsplus_key { union { - struct grub_hfsplus_extkey extkey; - struct grub_hfsplus_catkey catkey; - struct grub_hfsplus_attrkey attrkey; - grub_uint16_t keylen; + struct VasEBoot_hfsplus_extkey extkey; + struct VasEBoot_hfsplus_catkey catkey; + struct VasEBoot_hfsplus_attrkey attrkey; + VasEBoot_uint16_t keylen; }; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_hfsplus_btnode +struct VasEBoot_hfsplus_btnode { - grub_uint32_t next; - grub_uint32_t prev; - grub_int8_t type; - grub_uint8_t height; - grub_uint16_t count; - grub_uint16_t unused; -} GRUB_PACKED; + VasEBoot_uint32_t next; + VasEBoot_uint32_t prev; + VasEBoot_int8_t type; + VasEBoot_uint8_t height; + VasEBoot_uint16_t count; + VasEBoot_uint16_t unused; +} VasEBoot_PACKED; /* Return the offset of the record with the index INDEX, in the node NODE which is part of the B+ tree BTREE. */ -static inline grub_uint16_t -grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree, - struct grub_hfsplus_btnode *node, unsigned index) +static inline VasEBoot_uint16_t +VasEBoot_hfsplus_btree_recoffset (struct VasEBoot_hfsplus_btree *btree, + struct VasEBoot_hfsplus_btnode *node, unsigned index) { char *cnode = (char *) node; void *recptr; - if (btree->nodesize < index * sizeof (grub_uint16_t) + 2) + if (btree->nodesize < index * sizeof (VasEBoot_uint16_t) + 2) index = 0; - recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]); - return grub_be_to_cpu16 (grub_get_unaligned16 (recptr)); + recptr = (&cnode[btree->nodesize - index * sizeof (VasEBoot_uint16_t) - 2]); + return VasEBoot_be_to_cpu16 (VasEBoot_get_unaligned16 (recptr)); } /* Return a pointer to the record with the index INDEX, in the node NODE which is part of the B+ tree BTREE. */ -static inline struct grub_hfsplus_key * -grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree, - struct grub_hfsplus_btnode *node, unsigned index) +static inline struct VasEBoot_hfsplus_key * +VasEBoot_hfsplus_btree_recptr (struct VasEBoot_hfsplus_btree *btree, + struct VasEBoot_hfsplus_btnode *node, unsigned index) { char *cnode = (char *) node; - grub_uint16_t offset; - offset = grub_hfsplus_btree_recoffset (btree, node, index); - if (offset > btree->nodesize - sizeof (struct grub_hfsplus_key)) + VasEBoot_uint16_t offset; + offset = VasEBoot_hfsplus_btree_recoffset (btree, node, index); + if (offset > btree->nodesize - sizeof (struct VasEBoot_hfsplus_key)) offset = 0; - return (struct grub_hfsplus_key *) &cnode[offset]; + return (struct VasEBoot_hfsplus_key *) &cnode[offset]; } -extern grub_err_t (*grub_hfsplus_open_compressed) (struct grub_hfsplus_file *node); -extern grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node, - grub_off_t pos, - grub_size_t len, +extern VasEBoot_err_t (*VasEBoot_hfsplus_open_compressed) (struct VasEBoot_hfsplus_file *node); +extern VasEBoot_ssize_t (*VasEBoot_hfsplus_read_compressed) (struct VasEBoot_hfsplus_file *node, + VasEBoot_off_t pos, + VasEBoot_size_t len, char *buf); -grub_ssize_t -grub_hfsplus_read_file (struct grub_hfsplus_file *node, - grub_disk_read_hook_t read_hook, void *read_hook_data, - grub_off_t pos, grub_size_t len, char *buf); -grub_err_t -grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, - struct grub_hfsplus_key_internal *key, - int (*compare_keys) (struct grub_hfsplus_key *keya, - struct grub_hfsplus_key_internal *keyb), - struct grub_hfsplus_btnode **matchnode, - grub_off_t *keyoffset); -grub_err_t -grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir, +VasEBoot_ssize_t +VasEBoot_hfsplus_read_file (struct VasEBoot_hfsplus_file *node, + VasEBoot_disk_read_hook_t read_hook, void *read_hook_data, + VasEBoot_off_t pos, VasEBoot_size_t len, char *buf); +VasEBoot_err_t +VasEBoot_hfsplus_btree_search (struct VasEBoot_hfsplus_btree *btree, + struct VasEBoot_hfsplus_key_internal *key, + int (*compare_keys) (struct VasEBoot_hfsplus_key *keya, + struct VasEBoot_hfsplus_key_internal *keyb), + struct VasEBoot_hfsplus_btnode **matchnode, + VasEBoot_off_t *keyoffset); +VasEBoot_err_t +VasEBoot_mac_bless_inode (VasEBoot_device_t dev, VasEBoot_uint32_t inode, int is_dir, int intel); -grub_err_t -grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel); +VasEBoot_err_t +VasEBoot_mac_bless_file (VasEBoot_device_t dev, const char *path_in, int intel); diff --git a/include/VasEBoot/i18n.h b/include/VasEBoot/i18n.h index 468602d92..51c33bade 100644 --- a/include/VasEBoot/i18n.h +++ b/include/VasEBoot/i18n.h @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_I18N_H -#define GRUB_I18N_H 1 +#ifndef VasEBoot_I18N_H +#define VasEBoot_I18N_H 1 #include -#include +#include /* NLS can be disabled through the configure --disable-nls option. */ -#if (defined(ENABLE_NLS) && ENABLE_NLS) || !defined (GRUB_UTIL) +#if (defined(ENABLE_NLS) && ENABLE_NLS) || !defined (VasEBoot_UTIL) -extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s) __attribute__ ((format_arg (1))); +extern const char *(*EXPORT_VAR(VasEBoot_gettext)) (const char *s) __attribute__ ((format_arg (1))); -# ifdef GRUB_UTIL +# ifdef VasEBoot_UTIL # include # include -# endif /* GRUB_UTIL */ +# endif /* VasEBoot_UTIL */ #else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */ @@ -49,7 +49,7 @@ gettext (const char *str) #endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */ -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL static inline const char * __attribute__ ((always_inline,format_arg (1))) _ (const char *str) { @@ -59,10 +59,10 @@ _ (const char *str) static inline const char * __attribute__ ((always_inline,format_arg (1))) _ (const char *str) { - return grub_gettext(str); + return VasEBoot_gettext(str); } -#endif /* GRUB_UTIL */ +#endif /* VasEBoot_UTIL */ #define N_(str) str -#endif /* GRUB_I18N_H */ +#endif /* VasEBoot_I18N_H */ diff --git a/include/VasEBoot/i386/at_keyboard.h b/include/VasEBoot/i386/at_keyboard.h index da4e80654..268095f47 100644 --- a/include/VasEBoot/i386/at_keyboard.h +++ b/include/VasEBoot/i386/at_keyboard.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_AT_KEYBOARD_HEADER -#define GRUB_CPU_AT_KEYBOARD_HEADER 1 +#ifndef VasEBoot_CPU_AT_KEYBOARD_HEADER +#define VasEBoot_CPU_AT_KEYBOARD_HEADER 1 #define KEYBOARD_REG_DATA 0x60 #define KEYBOARD_REG_STATUS 0x64 diff --git a/include/VasEBoot/i386/bsd.h b/include/VasEBoot/i386/bsd.h index 524d47a1f..b8727963b 100644 --- a/include/VasEBoot/i386/bsd.h +++ b/include/VasEBoot/i386/bsd.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BSD_CPU_HEADER -#define GRUB_BSD_CPU_HEADER 1 +#ifndef VasEBoot_BSD_CPU_HEADER +#define VasEBoot_BSD_CPU_HEADER 1 -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include enum bsd_kernel_types { @@ -37,7 +37,7 @@ enum bsd_kernel_types KERNEL_TYPE_NETBSD, }; -#define GRUB_BSD_TEMP_BUFFER 0x80000 +#define VasEBoot_BSD_TEMP_BUFFER 0x80000 #define FREEBSD_B_DEVMAGIC OPENBSD_B_DEVMAGIC #define FREEBSD_B_SLICESHIFT OPENBSD_B_CTRLSHIFT @@ -53,76 +53,76 @@ enum bsd_kernel_types #define FREEBSD_BOOTINFO_VERSION 1 -struct grub_freebsd_bootinfo +struct VasEBoot_freebsd_bootinfo { - grub_uint32_t version; - grub_uint8_t unused1[44]; - grub_uint32_t length; - grub_uint8_t unused2; - grub_uint8_t boot_device; - grub_uint8_t unused3[18]; - grub_uint32_t kern_end; - grub_uint32_t environment; - grub_uint32_t tags; -} GRUB_PACKED; + VasEBoot_uint32_t version; + VasEBoot_uint8_t unused1[44]; + VasEBoot_uint32_t length; + VasEBoot_uint8_t unused2; + VasEBoot_uint8_t boot_device; + VasEBoot_uint8_t unused3[18]; + VasEBoot_uint32_t kern_end; + VasEBoot_uint32_t environment; + VasEBoot_uint32_t tags; +} VasEBoot_PACKED; struct freebsd_tag_header { - grub_uint32_t type; - grub_uint32_t len; + VasEBoot_uint32_t type; + VasEBoot_uint32_t len; }; -grub_err_t grub_freebsd_load_elfmodule32 (struct grub_relocator *relocator, - grub_file_t file, int argc, - char *argv[], grub_addr_t *kern_end); -grub_err_t grub_freebsd_load_elfmodule_obj64 (struct grub_relocator *relocator, - grub_file_t file, int argc, +VasEBoot_err_t VasEBoot_freebsd_load_elfmodule32 (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, int argc, + char *argv[], VasEBoot_addr_t *kern_end); +VasEBoot_err_t VasEBoot_freebsd_load_elfmodule_obj64 (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, int argc, char *argv[], - grub_addr_t *kern_end); -grub_err_t grub_freebsd_load_elf_meta32 (struct grub_relocator *relocator, - grub_file_t file, + VasEBoot_addr_t *kern_end); +VasEBoot_err_t VasEBoot_freebsd_load_elf_meta32 (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, const char *filename, - grub_addr_t *kern_end); -grub_err_t grub_freebsd_load_elf_meta64 (struct grub_relocator *relocator, - grub_file_t file, + VasEBoot_addr_t *kern_end); +VasEBoot_err_t VasEBoot_freebsd_load_elf_meta64 (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, const char *filename, - grub_addr_t *kern_end); + VasEBoot_addr_t *kern_end); -grub_err_t grub_netbsd_load_elf_meta32 (struct grub_relocator *relocator, - grub_file_t file, +VasEBoot_err_t VasEBoot_netbsd_load_elf_meta32 (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, const char *filename, - grub_addr_t *kern_end); -grub_err_t grub_netbsd_load_elf_meta64 (struct grub_relocator *relocator, - grub_file_t file, + VasEBoot_addr_t *kern_end); +VasEBoot_err_t VasEBoot_netbsd_load_elf_meta64 (struct VasEBoot_relocator *relocator, + VasEBoot_file_t file, const char *filename, - grub_addr_t *kern_end); + VasEBoot_addr_t *kern_end); -grub_err_t grub_bsd_add_meta (grub_uint32_t type, - const void *data, grub_uint32_t len); -grub_err_t grub_freebsd_add_meta_module (const char *filename, const char *type, +VasEBoot_err_t VasEBoot_bsd_add_meta (VasEBoot_uint32_t type, + const void *data, VasEBoot_uint32_t len); +VasEBoot_err_t VasEBoot_freebsd_add_meta_module (const char *filename, const char *type, int argc, char **argv, - grub_addr_t addr, grub_uint32_t size); + VasEBoot_addr_t addr, VasEBoot_uint32_t size); -struct grub_openbsd_ramdisk_descriptor +struct VasEBoot_openbsd_ramdisk_descriptor { - grub_size_t max_size; - grub_uint8_t *target; - grub_uint32_t *size; + VasEBoot_size_t max_size; + VasEBoot_uint8_t *target; + VasEBoot_uint32_t *size; }; -grub_err_t grub_openbsd_find_ramdisk32 (grub_file_t file, +VasEBoot_err_t VasEBoot_openbsd_find_ramdisk32 (VasEBoot_file_t file, const char *filename, - grub_addr_t kern_start, + VasEBoot_addr_t kern_start, void *kern_chunk_src, - struct grub_openbsd_ramdisk_descriptor *desc); -grub_err_t grub_openbsd_find_ramdisk64 (grub_file_t file, + struct VasEBoot_openbsd_ramdisk_descriptor *desc); +VasEBoot_err_t VasEBoot_openbsd_find_ramdisk64 (VasEBoot_file_t file, const char *filename, - grub_addr_t kern_start, + VasEBoot_addr_t kern_start, void *kern_chunk_src, - struct grub_openbsd_ramdisk_descriptor *desc); + struct VasEBoot_openbsd_ramdisk_descriptor *desc); -extern grub_uint8_t grub_bsd64_trampoline_start, grub_bsd64_trampoline_end; -extern grub_uint32_t grub_bsd64_trampoline_selfjump; -extern grub_uint32_t grub_bsd64_trampoline_gdt; +extern VasEBoot_uint8_t VasEBoot_bsd64_trampoline_start, VasEBoot_bsd64_trampoline_end; +extern VasEBoot_uint32_t VasEBoot_bsd64_trampoline_selfjump; +extern VasEBoot_uint32_t VasEBoot_bsd64_trampoline_gdt; -#endif /* ! GRUB_BSD_CPU_HEADER */ +#endif /* ! VasEBoot_BSD_CPU_HEADER */ diff --git a/include/VasEBoot/i386/cmos.h b/include/VasEBoot/i386/cmos.h index 27a2b214d..03a2f6fd9 100644 --- a/include/VasEBoot/i386/cmos.h +++ b/include/VasEBoot/i386/cmos.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_CMOS_H -#define GRUB_CPU_CMOS_H 1 +#ifndef VasEBoot_CPU_CMOS_H +#define VasEBoot_CPU_CMOS_H 1 -#include -#include +#include +#include -#define GRUB_CMOS_ADDR_REG 0x70 -#define GRUB_CMOS_DATA_REG 0x71 -#define GRUB_CMOS_ADDR_REG_HI 0x72 -#define GRUB_CMOS_DATA_REG_HI 0x73 +#define VasEBoot_CMOS_ADDR_REG 0x70 +#define VasEBoot_CMOS_DATA_REG 0x71 +#define VasEBoot_CMOS_ADDR_REG_HI 0x72 +#define VasEBoot_CMOS_DATA_REG_HI 0x73 -#endif /* GRUB_CPU_CMOS_H */ +#endif /* VasEBoot_CPU_CMOS_H */ diff --git a/include/VasEBoot/i386/coreboot/boot.h b/include/VasEBoot/i386/coreboot/boot.h index 6cd23aa83..587851a0b 100644 --- a/include/VasEBoot/i386/coreboot/boot.h +++ b/include/VasEBoot/i386/coreboot/boot.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/coreboot/console.h b/include/VasEBoot/i386/coreboot/console.h index 9cfa24759..aef1353cd 100644 --- a/include/VasEBoot/i386/coreboot/console.h +++ b/include/VasEBoot/i386/coreboot/console.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_CONSOLE_HEADER -#define GRUB_MACHINE_CONSOLE_HEADER 1 +#ifndef VasEBoot_MACHINE_CONSOLE_HEADER +#define VasEBoot_MACHINE_CONSOLE_HEADER 1 -void grub_vga_text_init (void); -void grub_vga_text_fini (void); +void VasEBoot_vga_text_init (void); +void VasEBoot_vga_text_fini (void); -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); +void VasEBoot_video_coreboot_fb_init (void); +void VasEBoot_video_coreboot_fb_early_init (void); +void VasEBoot_video_coreboot_fb_late_init (void); +void VasEBoot_video_coreboot_fb_fini (void); -extern struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable; +extern struct VasEBoot_linuxbios_table_framebuffer *VasEBoot_video_coreboot_fbtable; -#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */ +#endif /* ! VasEBoot_MACHINE_CONSOLE_HEADER */ diff --git a/include/VasEBoot/i386/coreboot/lbio.h b/include/VasEBoot/i386/coreboot/lbio.h index 1c3fa6f19..725894e5b 100644 --- a/include/VasEBoot/i386/coreboot/lbio.h +++ b/include/VasEBoot/i386/coreboot/lbio.h @@ -1,104 +1,104 @@ /* memory.h - describe the memory map */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef _GRUB_MACHINE_LBIO_HEADER -#define _GRUB_MACHINE_LBIO_HEADER 1 +#ifndef _VasEBoot_MACHINE_LBIO_HEADER +#define _VasEBoot_MACHINE_LBIO_HEADER 1 -struct grub_linuxbios_table_header +struct VasEBoot_linuxbios_table_header { - grub_uint8_t signature[4]; - grub_uint32_t header_size; - grub_uint32_t header_checksum; - grub_uint32_t table_size; - grub_uint32_t table_checksum; - grub_uint32_t table_entries; + VasEBoot_uint8_t signature[4]; + VasEBoot_uint32_t header_size; + VasEBoot_uint32_t header_checksum; + VasEBoot_uint32_t table_size; + VasEBoot_uint32_t table_checksum; + VasEBoot_uint32_t table_entries; }; -typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t; +typedef struct VasEBoot_linuxbios_table_header *VasEBoot_linuxbios_table_header_t; -struct grub_linuxbios_timestamp_entry +struct VasEBoot_linuxbios_timestamp_entry { - grub_uint32_t id; - grub_uint64_t tsc; -} GRUB_PACKED; + VasEBoot_uint32_t id; + VasEBoot_uint64_t tsc; +} VasEBoot_PACKED; -struct grub_linuxbios_timestamp_table +struct VasEBoot_linuxbios_timestamp_table { - grub_uint64_t base_tsc; - grub_uint32_t capacity; - grub_uint32_t used; - struct grub_linuxbios_timestamp_entry entries[0]; -} GRUB_PACKED; + VasEBoot_uint64_t base_tsc; + VasEBoot_uint32_t capacity; + VasEBoot_uint32_t used; + struct VasEBoot_linuxbios_timestamp_entry entries[0]; +} VasEBoot_PACKED; -struct grub_linuxbios_mainboard +struct VasEBoot_linuxbios_mainboard { - grub_uint8_t vendor; - grub_uint8_t part_number; + VasEBoot_uint8_t vendor; + VasEBoot_uint8_t part_number; char strings[0]; }; -struct grub_linuxbios_table_item +struct VasEBoot_linuxbios_table_item { - grub_uint32_t tag; - grub_uint32_t size; + VasEBoot_uint32_t tag; + VasEBoot_uint32_t size; }; -typedef struct grub_linuxbios_table_item *grub_linuxbios_table_item_t; +typedef struct VasEBoot_linuxbios_table_item *VasEBoot_linuxbios_table_item_t; enum { - GRUB_LINUXBIOS_MEMBER_UNUSED = 0x00, - GRUB_LINUXBIOS_MEMBER_MEMORY = 0x01, - GRUB_LINUXBIOS_MEMBER_MAINBOARD = 0x03, - GRUB_LINUXBIOS_MEMBER_CONSOLE = 0x10, - GRUB_LINUXBIOS_MEMBER_LINK = 0x11, - GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER = 0x12, - GRUB_LINUXBIOS_MEMBER_TIMESTAMPS = 0x16, - GRUB_LINUXBIOS_MEMBER_CBMEMC = 0x17 + VasEBoot_LINUXBIOS_MEMBER_UNUSED = 0x00, + VasEBoot_LINUXBIOS_MEMBER_MEMORY = 0x01, + VasEBoot_LINUXBIOS_MEMBER_MAINBOARD = 0x03, + VasEBoot_LINUXBIOS_MEMBER_CONSOLE = 0x10, + VasEBoot_LINUXBIOS_MEMBER_LINK = 0x11, + VasEBoot_LINUXBIOS_MEMBER_FRAMEBUFFER = 0x12, + VasEBoot_LINUXBIOS_MEMBER_TIMESTAMPS = 0x16, + VasEBoot_LINUXBIOS_MEMBER_CBMEMC = 0x17 }; -struct grub_linuxbios_table_framebuffer { - grub_uint64_t lfb; - grub_uint32_t width; - grub_uint32_t height; - grub_uint32_t pitch; - grub_uint8_t bpp; +struct VasEBoot_linuxbios_table_framebuffer { + VasEBoot_uint64_t lfb; + VasEBoot_uint32_t width; + VasEBoot_uint32_t height; + VasEBoot_uint32_t pitch; + VasEBoot_uint8_t bpp; - grub_uint8_t red_field_pos; - grub_uint8_t red_mask_size; - grub_uint8_t green_field_pos; - grub_uint8_t green_mask_size; - grub_uint8_t blue_field_pos; - grub_uint8_t blue_mask_size; - grub_uint8_t reserved_field_pos; - grub_uint8_t reserved_mask_size; -} GRUB_PACKED; + VasEBoot_uint8_t red_field_pos; + VasEBoot_uint8_t red_mask_size; + VasEBoot_uint8_t green_field_pos; + VasEBoot_uint8_t green_mask_size; + VasEBoot_uint8_t blue_field_pos; + VasEBoot_uint8_t blue_mask_size; + VasEBoot_uint8_t reserved_field_pos; + VasEBoot_uint8_t reserved_mask_size; +} VasEBoot_PACKED; -struct grub_linuxbios_mem_region +struct VasEBoot_linuxbios_mem_region { - grub_uint64_t addr; - grub_uint64_t size; -#define GRUB_MACHINE_MEMORY_AVAILABLE 1 - grub_uint32_t type; -} GRUB_PACKED; -typedef struct grub_linuxbios_mem_region *mem_region_t; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t size; +#define VasEBoot_MACHINE_MEMORY_AVAILABLE 1 + VasEBoot_uint32_t type; +} VasEBoot_PACKED; +typedef struct VasEBoot_linuxbios_mem_region *mem_region_t; -grub_err_t -EXPORT_FUNC(grub_linuxbios_table_iterate) (int (*hook) (grub_linuxbios_table_item_t, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_linuxbios_table_iterate) (int (*hook) (VasEBoot_linuxbios_table_item_t, void *), void *hook_data); diff --git a/include/VasEBoot/i386/coreboot/memory.h b/include/VasEBoot/i386/coreboot/memory.h index 1501772ac..df94b0c9c 100644 --- a/include/VasEBoot/i386/coreboot/memory.h +++ b/include/VasEBoot/i386/coreboot/memory.h @@ -1,54 +1,54 @@ /* memory.h - describe the memory map */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef _GRUB_MEMORY_MACHINE_LB_HEADER -#define _GRUB_MEMORY_MACHINE_LB_HEADER 1 +#ifndef _VasEBoot_MEMORY_MACHINE_LB_HEADER +#define _VasEBoot_MEMORY_MACHINE_LB_HEADER 1 -#include +#include #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include #endif -#include -#include +#include +#include #ifndef ASM_FILE -void grub_machine_mmap_init (void); +void VasEBoot_machine_mmap_init (void); -static inline grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), +static inline VasEBoot_err_t +VasEBoot_machine_mmap_register (VasEBoot_uint64_t start __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +static inline VasEBoot_err_t +VasEBoot_machine_mmap_unregister (int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif -#endif /* ! _GRUB_MEMORY_MACHINE_HEADER */ +#endif /* ! _VasEBoot_MEMORY_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/coreboot/serial.h b/include/VasEBoot/i386/coreboot/serial.h index b6819d587..6226edba2 100644 --- a/include/VasEBoot/i386/coreboot/serial.h +++ b/include/VasEBoot/i386/coreboot/serial.h @@ -1,24 +1,24 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_SERIAL_HEADER -#define GRUB_MACHINE_SERIAL_HEADER 1 +#ifndef VasEBoot_MACHINE_SERIAL_HEADER +#define VasEBoot_MACHINE_SERIAL_HEADER 1 -#define GRUB_MACHINE_SERIAL_PORTS { 0x3f8, 0x2f8, 0x3e8, 0x2e8 } +#define VasEBoot_MACHINE_SERIAL_PORTS { 0x3f8, 0x2f8, 0x3e8, 0x2e8 } #endif diff --git a/include/VasEBoot/i386/coreboot/time.h b/include/VasEBoot/i386/coreboot/time.h index 2298ee8f4..b498b5379 100644 --- a/include/VasEBoot/i386/coreboot/time.h +++ b/include/VasEBoot/i386/coreboot/time.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/cpuid.h b/include/VasEBoot/i386/cpuid.h index f7ae4b0a4..6f595f047 100644 --- a/include/VasEBoot/i386/cpuid.h +++ b/include/VasEBoot/i386/cpuid.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_CPUID_HEADER -#define GRUB_CPU_CPUID_HEADER 1 +#ifndef VasEBoot_CPU_CPUID_HEADER +#define VasEBoot_CPU_CPUID_HEADER 1 -extern unsigned char grub_cpuid_has_longmode; -extern unsigned char grub_cpuid_has_pae; +extern unsigned char VasEBoot_cpuid_has_longmode; +extern unsigned char VasEBoot_cpuid_has_pae; #ifdef __x86_64__ static __inline int -grub_cpu_is_cpuid_supported (void) +VasEBoot_cpu_is_cpuid_supported (void) { - grub_uint64_t id_supported; + VasEBoot_uint64_t id_supported; __asm__ ("pushfq\n\t" "popq %%rax /* Get EFLAGS into EAX */\n\t" @@ -48,9 +48,9 @@ grub_cpu_is_cpuid_supported (void) #else static __inline int -grub_cpu_is_cpuid_supported (void) +VasEBoot_cpu_is_cpuid_supported (void) { - grub_uint32_t id_supported; + VasEBoot_uint32_t id_supported; __asm__ ("pushfl\n\t" "popl %%eax /* Get EFLAGS into EAX */\n\t" @@ -71,12 +71,12 @@ grub_cpu_is_cpuid_supported (void) #endif #ifdef __PIC__ -#define grub_cpuid(num,a,b,c,d) \ +#define VasEBoot_cpuid(num,a,b,c,d) \ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ : "0" (num)) #else -#define grub_cpuid(num,a,b,c,d) \ +#define VasEBoot_cpuid(num,a,b,c,d) \ asm volatile ("cpuid" \ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ : "0" (num)) diff --git a/include/VasEBoot/i386/efi/memory.h b/include/VasEBoot/i386/efi/memory.h index 2c64918e3..ef51aaac7 100644 --- a/include/VasEBoot/i386/efi/memory.h +++ b/include/VasEBoot/i386/efi/memory.h @@ -1,6 +1,6 @@ -#ifndef GRUB_MEMORY_CPU_HEADER -#include +#ifndef VasEBoot_MEMORY_CPU_HEADER +#include -#define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffff +#define VasEBoot_EFI_MAX_USABLE_ADDRESS 0xffffffff -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/i386/efi/serial.h b/include/VasEBoot/i386/efi/serial.h index 2d8563414..2dd72f652 100644 --- a/include/VasEBoot/i386/efi/serial.h +++ b/include/VasEBoot/i386/efi/serial.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/efiemu.h b/include/VasEBoot/i386/efiemu.h index edb13ff37..ec12b80a9 100644 --- a/include/VasEBoot/i386/efiemu.h +++ b/include/VasEBoot/i386/efiemu.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ARCH_EFI_EMU_HEADER -#define GRUB_ARCH_EFI_EMU_HEADER 1 +#ifndef VasEBoot_ARCH_EFI_EMU_HEADER +#define VasEBoot_ARCH_EFI_EMU_HEADER 1 -grub_err_t -grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, - struct grub_efiemu_elf_sym *elfsyms, +VasEBoot_err_t +VasEBoot_arch_efiemu_relocate_symbols32 (VasEBoot_efiemu_segment_t segs, + struct VasEBoot_efiemu_elf_sym *elfsyms, void *ehdr); -grub_err_t -grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, - struct grub_efiemu_elf_sym *elfsyms, +VasEBoot_err_t +VasEBoot_arch_efiemu_relocate_symbols64 (VasEBoot_efiemu_segment_t segs, + struct VasEBoot_efiemu_elf_sym *elfsyms, void *ehdr); -int grub_arch_efiemu_check_header32 (void *ehdr); -int grub_arch_efiemu_check_header64 (void *ehdr); +int VasEBoot_arch_efiemu_check_header32 (void *ehdr); +int VasEBoot_arch_efiemu_check_header64 (void *ehdr); #endif diff --git a/include/VasEBoot/i386/floppy.h b/include/VasEBoot/i386/floppy.h index 0e3690549..2185d3147 100644 --- a/include/VasEBoot/i386/floppy.h +++ b/include/VasEBoot/i386/floppy.h @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_FLOPPY_CPU_HEADER -#define GRUB_FLOPPY_CPU_HEADER 1 +#ifndef VasEBoot_FLOPPY_CPU_HEADER +#define VasEBoot_FLOPPY_CPU_HEADER 1 -#define GRUB_FLOPPY_REG_DIGITAL_OUTPUT 0x3f2 +#define VasEBoot_FLOPPY_REG_DIGITAL_OUTPUT 0x3f2 #ifndef ASM_FILE -#include +#include /* Stop the floppy drive from spinning, so that other software is jumped to with a known state. */ static inline void -grub_stop_floppy (void) +VasEBoot_stop_floppy (void) { - grub_outb (0, GRUB_FLOPPY_REG_DIGITAL_OUTPUT); + VasEBoot_outb (0, VasEBoot_FLOPPY_REG_DIGITAL_OUTPUT); } #endif diff --git a/include/VasEBoot/i386/freebsd_linker.h b/include/VasEBoot/i386/freebsd_linker.h index 3c1eb64b6..3d04baa50 100644 --- a/include/VasEBoot/i386/freebsd_linker.h +++ b/include/VasEBoot/i386/freebsd_linker.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /*- @@ -44,8 +44,8 @@ * $FreeBSD: stable/8/sys/sys/linker.h 199583 2009-11-20 15:27:52Z jhb $ */ -#ifndef GRUB_FREEBSD_LINKER_CPU_HEADER -#define GRUB_FREEBSD_LINKER_CPU_HEADER 1 +#ifndef VasEBoot_FREEBSD_LINKER_CPU_HEADER +#define VasEBoot_FREEBSD_LINKER_CPU_HEADER 1 #define FREEBSD_MODINFO_END 0x0000 /* End of list */ #define FREEBSD_MODINFO_NAME 0x0001 /* Name of module (string) */ diff --git a/include/VasEBoot/i386/freebsd_reboot.h b/include/VasEBoot/i386/freebsd_reboot.h index 9c17f6efa..19dda0315 100644 --- a/include/VasEBoot/i386/freebsd_reboot.h +++ b/include/VasEBoot/i386/freebsd_reboot.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /*- @@ -48,8 +48,8 @@ * $FreeBSD: stable/8/sys/sys/reboot.h 199583 2009-11-20 15:27:52Z jhb $ */ -#ifndef GRUB_FREEBSD_REBOOT_CPU_HEADER -#define GRUB_FREEBSD_REBOOT_CPU_HEADER 1 +#ifndef VasEBoot_FREEBSD_REBOOT_CPU_HEADER +#define VasEBoot_FREEBSD_REBOOT_CPU_HEADER 1 #define FREEBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */ #define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */ diff --git a/include/VasEBoot/i386/gdb.h b/include/VasEBoot/i386/gdb.h index 92d2dacda..845e95d50 100644 --- a/include/VasEBoot/i386/gdb.h +++ b/include/VasEBoot/i386/gdb.h @@ -17,13 +17,13 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef GRUB_GDB_CPU_HEADER -#define GRUB_GDB_CPU_HEADER 1 +#ifndef VasEBoot_GDB_CPU_HEADER +#define VasEBoot_GDB_CPU_HEADER 1 -#define GRUB_GDB_LAST_TRAP 31 +#define VasEBoot_GDB_LAST_TRAP 31 /* You may have to edit the bottom of machdep.S when adjusting - GRUB_GDB_LAST_TRAP. */ -#define GRUB_MACHINE_NR_REGS 16 + VasEBoot_GDB_LAST_TRAP. */ +#define VasEBoot_MACHINE_NR_REGS 16 #define EAX 0 #define ECX 1 @@ -49,30 +49,30 @@ #ifndef ASM_FILE -#include +#include -#define GRUB_CPU_TRAP_GATE 15 +#define VasEBoot_CPU_TRAP_GATE 15 -struct grub_cpu_interrupt_gate +struct VasEBoot_cpu_interrupt_gate { - grub_uint16_t offset_lo; - grub_uint16_t selector; - grub_uint8_t unused; - grub_uint8_t gate; - grub_uint16_t offset_hi; -} GRUB_PACKED; + VasEBoot_uint16_t offset_lo; + VasEBoot_uint16_t selector; + VasEBoot_uint8_t unused; + VasEBoot_uint8_t gate; + VasEBoot_uint16_t offset_hi; +} VasEBoot_PACKED; -struct grub_cpu_idt_descriptor +struct VasEBoot_cpu_idt_descriptor { - grub_uint16_t limit; - grub_uint32_t base; -} GRUB_PACKED; + VasEBoot_uint16_t limit; + VasEBoot_uint32_t base; +} VasEBoot_PACKED; -extern void (*grub_gdb_trapvec[]) (void); -void grub_gdb_idtinit (void); -void grub_gdb_idtrestore (void); -void grub_gdb_trap (int trap_no) __attribute__ ((regparm(3))); +extern void (*VasEBoot_gdb_trapvec[]) (void); +void VasEBoot_gdb_idtinit (void); +void VasEBoot_gdb_idtrestore (void); +void VasEBoot_gdb_trap (int trap_no) __attribute__ ((regparm(3))); #endif /* ! ASM */ -#endif /* ! GRUB_GDB_CPU_HEADER */ +#endif /* ! VasEBoot_GDB_CPU_HEADER */ diff --git a/include/VasEBoot/i386/ieee1275/ieee1275.h b/include/VasEBoot/i386/ieee1275/ieee1275.h index 2625f02c0..071f1c21b 100644 --- a/include/VasEBoot/i386/ieee1275/ieee1275.h +++ b/include/VasEBoot/i386/ieee1275/ieee1275.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/ieee1275/memory.h b/include/VasEBoot/i386/ieee1275/memory.h index 8dd6f7c8c..3a488445e 100644 --- a/include/VasEBoot/i386/ieee1275/memory.h +++ b/include/VasEBoot/i386/ieee1275/memory.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/ieee1275/serial.h b/include/VasEBoot/i386/ieee1275/serial.h index 2d8563414..2dd72f652 100644 --- a/include/VasEBoot/i386/ieee1275/serial.h +++ b/include/VasEBoot/i386/ieee1275/serial.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/io.h b/include/VasEBoot/i386/io.h index ae12a3e3d..2a5b8b3c4 100644 --- a/include/VasEBoot/i386/io.h +++ b/include/VasEBoot/i386/io.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1996,2000,2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Based on sys/io.h from GNU libc. */ -#ifndef GRUB_IO_H -#define GRUB_IO_H 1 +#ifndef VasEBoot_IO_H +#define VasEBoot_IO_H 1 -typedef unsigned short int grub_port_t; +typedef unsigned short int VasEBoot_port_t; static __inline unsigned char -grub_inb (unsigned short int port) +VasEBoot_inb (unsigned short int port) { unsigned char _v; @@ -33,7 +33,7 @@ grub_inb (unsigned short int port) } static __inline unsigned short int -grub_inw (unsigned short int port) +VasEBoot_inw (unsigned short int port) { unsigned short _v; @@ -42,7 +42,7 @@ grub_inw (unsigned short int port) } static __inline unsigned int -grub_inl (unsigned short int port) +VasEBoot_inl (unsigned short int port) { unsigned int _v; @@ -51,20 +51,20 @@ grub_inl (unsigned short int port) } static __inline void -grub_outb (unsigned char value, unsigned short int port) +VasEBoot_outb (unsigned char value, unsigned short int port) { __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port)); } static __inline void -grub_outw (unsigned short int value, unsigned short int port) +VasEBoot_outw (unsigned short int value, unsigned short int port) { __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port)); } static __inline void -grub_outl (unsigned int value, unsigned short int port) +VasEBoot_outl (unsigned int value, unsigned short int port) { __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port)); } diff --git a/include/VasEBoot/i386/linux.h b/include/VasEBoot/i386/linux.h index fc36bdaf3..47f99b636 100644 --- a/include/VasEBoot/i386/linux.h +++ b/include/VasEBoot/i386/linux.h @@ -1,316 +1,316 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LINUX_MACHINE_HEADER -#define GRUB_LINUX_MACHINE_HEADER 1 +#ifndef VasEBoot_LINUX_MACHINE_HEADER +#define VasEBoot_LINUX_MACHINE_HEADER 1 -#define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ -#define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 -#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF -#define GRUB_LINUX_MAX_SETUP_SECTS 64 -#define GRUB_LINUX_BOOT_LOADER_TYPE 0x72 -#define GRUB_LINUX_HEAP_END_OFFSET (0x9000 - 0x200) +#define VasEBoot_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ +#define VasEBoot_LINUX_DEFAULT_SETUP_SECTS 4 +#define VasEBoot_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF +#define VasEBoot_LINUX_MAX_SETUP_SECTS 64 +#define VasEBoot_LINUX_BOOT_LOADER_TYPE 0x72 +#define VasEBoot_LINUX_HEAP_END_OFFSET (0x9000 - 0x200) -#define GRUB_LINUX_BZIMAGE_ADDR 0x100000 -#define GRUB_LINUX_ZIMAGE_ADDR 0x10000 -#define GRUB_LINUX_OLD_REAL_MODE_ADDR 0x90000 -#define GRUB_LINUX_SETUP_STACK 0x9000 +#define VasEBoot_LINUX_BZIMAGE_ADDR 0x100000 +#define VasEBoot_LINUX_ZIMAGE_ADDR 0x10000 +#define VasEBoot_LINUX_OLD_REAL_MODE_ADDR 0x90000 +#define VasEBoot_LINUX_SETUP_STACK 0x9000 -#define GRUB_LINUX_FLAG_BIG_KERNEL 0x1 -#define GRUB_LINUX_FLAG_QUIET 0x20 -#define GRUB_LINUX_FLAG_CAN_USE_HEAP 0x80 +#define VasEBoot_LINUX_FLAG_BIG_KERNEL 0x1 +#define VasEBoot_LINUX_FLAG_QUIET 0x20 +#define VasEBoot_LINUX_FLAG_CAN_USE_HEAP 0x80 /* Linux's video mode selection support. Actually I hate it! */ -#define GRUB_LINUX_VID_MODE_NORMAL 0xFFFF -#define GRUB_LINUX_VID_MODE_EXTENDED 0xFFFE -#define GRUB_LINUX_VID_MODE_ASK 0xFFFD -#define GRUB_LINUX_VID_MODE_VESA_START 0x0300 +#define VasEBoot_LINUX_VID_MODE_NORMAL 0xFFFF +#define VasEBoot_LINUX_VID_MODE_EXTENDED 0xFFFE +#define VasEBoot_LINUX_VID_MODE_ASK 0xFFFD +#define VasEBoot_LINUX_VID_MODE_VESA_START 0x0300 -#define GRUB_LINUX_CL_MAGIC 0xA33F +#define VasEBoot_LINUX_CL_MAGIC 0xA33F #ifdef __x86_64__ -#define GRUB_LINUX_EFI_SIGNATURE \ +#define VasEBoot_LINUX_EFI_SIGNATURE \ ('4' << 24 | '6' << 16 | 'L' << 8 | 'E') #else -#define GRUB_LINUX_EFI_SIGNATURE \ +#define VasEBoot_LINUX_EFI_SIGNATURE \ ('2' << 24 | '3' << 16 | 'L' << 8 | 'E') #endif -#define GRUB_LINUX_EFI_SIGNATURE_0204 \ +#define VasEBoot_LINUX_EFI_SIGNATURE_0204 \ ('L' << 24 | 'I' << 16 | 'F' << 8 | 'E') -#define GRUB_LINUX_OFW_SIGNATURE \ +#define VasEBoot_LINUX_OFW_SIGNATURE \ (' ' << 24 | 'W' << 16 | 'F' << 8 | 'O') #ifndef ASM_FILE -#define GRUB_E820_RAM 1 -#define GRUB_E820_RESERVED 2 -#define GRUB_E820_ACPI 3 -#define GRUB_E820_NVS 4 -#define GRUB_E820_BADRAM 5 +#define VasEBoot_E820_RAM 1 +#define VasEBoot_E820_RESERVED 2 +#define VasEBoot_E820_ACPI 3 +#define VasEBoot_E820_NVS 4 +#define VasEBoot_E820_BADRAM 5 -struct grub_e820_mmap +struct VasEBoot_e820_mmap { - grub_uint64_t addr; - grub_uint64_t size; - grub_uint32_t type; -} GRUB_PACKED; + VasEBoot_uint64_t addr; + VasEBoot_uint64_t size; + VasEBoot_uint32_t type; +} VasEBoot_PACKED; enum { - GRUB_VIDEO_LINUX_TYPE_TEXT = 0x01, - GRUB_VIDEO_LINUX_TYPE_VESA = 0x23, /* VESA VGA in graphic mode. */ - GRUB_VIDEO_LINUX_TYPE_EFIFB = 0x70, /* EFI Framebuffer. */ - GRUB_VIDEO_LINUX_TYPE_SIMPLE = 0x70 /* Linear framebuffer without any additional functions. */ + VasEBoot_VIDEO_LINUX_TYPE_TEXT = 0x01, + VasEBoot_VIDEO_LINUX_TYPE_VESA = 0x23, /* VESA VGA in graphic mode. */ + VasEBoot_VIDEO_LINUX_TYPE_EFIFB = 0x70, /* EFI Framebuffer. */ + VasEBoot_VIDEO_LINUX_TYPE_SIMPLE = 0x70 /* Linear framebuffer without any additional functions. */ }; /* For the Linux/i386 boot protocol version 2.10. */ struct linux_kernel_header { - grub_uint8_t code1[0x0020]; - grub_uint16_t cl_magic; /* Magic number 0xA33F */ - grub_uint16_t cl_offset; /* The offset of command line */ - grub_uint8_t code2[0x01F1 - 0x0020 - 2 - 2]; - grub_uint8_t setup_sects; /* The size of the setup in sectors */ - grub_uint16_t root_flags; /* If the root is mounted readonly */ - grub_uint16_t syssize; /* obsolete */ - grub_uint16_t swap_dev; /* obsolete */ - grub_uint16_t ram_size; /* obsolete */ - grub_uint16_t vid_mode; /* Video mode control */ - grub_uint16_t root_dev; /* Default root device number */ - grub_uint16_t boot_flag; /* 0xAA55 magic number */ - grub_uint16_t jump; /* Jump instruction */ - grub_uint32_t header; /* Magic signature "HdrS" */ - grub_uint16_t version; /* Boot protocol version supported */ - grub_uint32_t realmode_swtch; /* Boot loader hook */ - grub_uint16_t start_sys; /* The load-low segment (obsolete) */ - grub_uint16_t kernel_version; /* Points to kernel version string */ - grub_uint8_t type_of_loader; /* Boot loader identifier */ + VasEBoot_uint8_t code1[0x0020]; + VasEBoot_uint16_t cl_magic; /* Magic number 0xA33F */ + VasEBoot_uint16_t cl_offset; /* The offset of command line */ + VasEBoot_uint8_t code2[0x01F1 - 0x0020 - 2 - 2]; + VasEBoot_uint8_t setup_sects; /* The size of the setup in sectors */ + VasEBoot_uint16_t root_flags; /* If the root is mounted readonly */ + VasEBoot_uint16_t syssize; /* obsolete */ + VasEBoot_uint16_t swap_dev; /* obsolete */ + VasEBoot_uint16_t ram_size; /* obsolete */ + VasEBoot_uint16_t vid_mode; /* Video mode control */ + VasEBoot_uint16_t root_dev; /* Default root device number */ + VasEBoot_uint16_t boot_flag; /* 0xAA55 magic number */ + VasEBoot_uint16_t jump; /* Jump instruction */ + VasEBoot_uint32_t header; /* Magic signature "HdrS" */ + VasEBoot_uint16_t version; /* Boot protocol version supported */ + VasEBoot_uint32_t realmode_swtch; /* Boot loader hook */ + VasEBoot_uint16_t start_sys; /* The load-low segment (obsolete) */ + VasEBoot_uint16_t kernel_version; /* Points to kernel version string */ + VasEBoot_uint8_t type_of_loader; /* Boot loader identifier */ #define LINUX_LOADER_ID_LILO 0x0 #define LINUX_LOADER_ID_LOADLIN 0x1 #define LINUX_LOADER_ID_BOOTSECT 0x2 #define LINUX_LOADER_ID_SYSLINUX 0x3 #define LINUX_LOADER_ID_ETHERBOOT 0x4 #define LINUX_LOADER_ID_ELILO 0x5 -#define LINUX_LOADER_ID_GRUB 0x7 +#define LINUX_LOADER_ID_VasEBoot 0x7 #define LINUX_LOADER_ID_UBOOT 0x8 #define LINUX_LOADER_ID_XEN 0x9 #define LINUX_LOADER_ID_GUJIN 0xa #define LINUX_LOADER_ID_QEMU 0xb - grub_uint8_t loadflags; /* Boot protocol option flags */ - grub_uint16_t setup_move_size; /* Move to high memory size */ - grub_uint32_t code32_start; /* Boot loader hook */ - grub_uint32_t ramdisk_image; /* initrd load address */ - grub_uint32_t ramdisk_size; /* initrd size */ - grub_uint32_t bootsect_kludge; /* obsolete */ - grub_uint16_t heap_end_ptr; /* Free memory after setup end */ - grub_uint16_t pad1; /* Unused */ - grub_uint32_t cmd_line_ptr; /* Points to the kernel command line */ - grub_uint32_t initrd_addr_max; /* Highest address for initrd */ - grub_uint32_t kernel_alignment; - grub_uint8_t relocatable; - grub_uint8_t min_alignment; - grub_uint8_t pad[2]; - grub_uint32_t cmdline_size; - grub_uint32_t hardware_subarch; - grub_uint64_t hardware_subarch_data; - grub_uint32_t payload_offset; - grub_uint32_t payload_length; - grub_uint64_t setup_data; - grub_uint64_t pref_address; - grub_uint32_t init_size; - grub_uint32_t handover_offset; -} GRUB_PACKED; + VasEBoot_uint8_t loadflags; /* Boot protocol option flags */ + VasEBoot_uint16_t setup_move_size; /* Move to high memory size */ + VasEBoot_uint32_t code32_start; /* Boot loader hook */ + VasEBoot_uint32_t ramdisk_image; /* initrd load address */ + VasEBoot_uint32_t ramdisk_size; /* initrd size */ + VasEBoot_uint32_t bootsect_kludge; /* obsolete */ + VasEBoot_uint16_t heap_end_ptr; /* Free memory after setup end */ + VasEBoot_uint16_t pad1; /* Unused */ + VasEBoot_uint32_t cmd_line_ptr; /* Points to the kernel command line */ + VasEBoot_uint32_t initrd_addr_max; /* Highest address for initrd */ + VasEBoot_uint32_t kernel_alignment; + VasEBoot_uint8_t relocatable; + VasEBoot_uint8_t min_alignment; + VasEBoot_uint8_t pad[2]; + VasEBoot_uint32_t cmdline_size; + VasEBoot_uint32_t hardware_subarch; + VasEBoot_uint64_t hardware_subarch_data; + VasEBoot_uint32_t payload_offset; + VasEBoot_uint32_t payload_length; + VasEBoot_uint64_t setup_data; + VasEBoot_uint64_t pref_address; + VasEBoot_uint32_t init_size; + VasEBoot_uint32_t handover_offset; +} VasEBoot_PACKED; /* Boot parameters for Linux based on 2.6.12. This is used by the setup - sectors of Linux, and must be simulated by GRUB on EFI, because + sectors of Linux, and must be simulated by VasEBoot on EFI, because the setup sectors depend on BIOS. */ struct linux_kernel_params { - grub_uint8_t video_cursor_x; /* 0 */ - grub_uint8_t video_cursor_y; + VasEBoot_uint8_t video_cursor_x; /* 0 */ + VasEBoot_uint8_t video_cursor_y; - grub_uint16_t ext_mem; /* 2 */ + VasEBoot_uint16_t ext_mem; /* 2 */ - grub_uint16_t video_page; /* 4 */ - grub_uint8_t video_mode; /* 6 */ - grub_uint8_t video_width; /* 7 */ + VasEBoot_uint16_t video_page; /* 4 */ + VasEBoot_uint8_t video_mode; /* 6 */ + VasEBoot_uint8_t video_width; /* 7 */ - grub_uint8_t padding1[0xa - 0x8]; + VasEBoot_uint8_t padding1[0xa - 0x8]; - grub_uint16_t video_ega_bx; /* a */ + VasEBoot_uint16_t video_ega_bx; /* a */ - grub_uint8_t padding2[0xe - 0xc]; + VasEBoot_uint8_t padding2[0xe - 0xc]; - grub_uint8_t video_height; /* e */ - grub_uint8_t have_vga; /* f */ - grub_uint16_t font_size; /* 10 */ + VasEBoot_uint8_t video_height; /* e */ + VasEBoot_uint8_t have_vga; /* f */ + VasEBoot_uint16_t font_size; /* 10 */ - grub_uint16_t lfb_width; /* 12 */ - grub_uint16_t lfb_height; /* 14 */ - grub_uint16_t lfb_depth; /* 16 */ - grub_uint32_t lfb_base; /* 18 */ - grub_uint32_t lfb_size; /* 1c */ + VasEBoot_uint16_t lfb_width; /* 12 */ + VasEBoot_uint16_t lfb_height; /* 14 */ + VasEBoot_uint16_t lfb_depth; /* 16 */ + VasEBoot_uint32_t lfb_base; /* 18 */ + VasEBoot_uint32_t lfb_size; /* 1c */ - grub_uint16_t cl_magic; /* 20 */ - grub_uint16_t cl_offset; + VasEBoot_uint16_t cl_magic; /* 20 */ + VasEBoot_uint16_t cl_offset; - grub_uint16_t lfb_line_len; /* 24 */ - grub_uint8_t red_mask_size; /* 26 */ - grub_uint8_t red_field_pos; - grub_uint8_t green_mask_size; - grub_uint8_t green_field_pos; - grub_uint8_t blue_mask_size; - grub_uint8_t blue_field_pos; - grub_uint8_t reserved_mask_size; - grub_uint8_t reserved_field_pos; - grub_uint16_t vesapm_segment; /* 2e */ - grub_uint16_t vesapm_offset; /* 30 */ - grub_uint16_t lfb_pages; /* 32 */ - grub_uint16_t vesa_attrib; /* 34 */ - grub_uint32_t capabilities; /* 36 */ + VasEBoot_uint16_t lfb_line_len; /* 24 */ + VasEBoot_uint8_t red_mask_size; /* 26 */ + VasEBoot_uint8_t red_field_pos; + VasEBoot_uint8_t green_mask_size; + VasEBoot_uint8_t green_field_pos; + VasEBoot_uint8_t blue_mask_size; + VasEBoot_uint8_t blue_field_pos; + VasEBoot_uint8_t reserved_mask_size; + VasEBoot_uint8_t reserved_field_pos; + VasEBoot_uint16_t vesapm_segment; /* 2e */ + VasEBoot_uint16_t vesapm_offset; /* 30 */ + VasEBoot_uint16_t lfb_pages; /* 32 */ + VasEBoot_uint16_t vesa_attrib; /* 34 */ + VasEBoot_uint32_t capabilities; /* 36 */ - grub_uint8_t padding3[0x40 - 0x3a]; + VasEBoot_uint8_t padding3[0x40 - 0x3a]; - grub_uint16_t apm_version; /* 40 */ - grub_uint16_t apm_code_segment; /* 42 */ - grub_uint32_t apm_entry; /* 44 */ - grub_uint16_t apm_16bit_code_segment; /* 48 */ - grub_uint16_t apm_data_segment; /* 4a */ - grub_uint16_t apm_flags; /* 4c */ - grub_uint32_t apm_code_len; /* 4e */ - grub_uint16_t apm_data_len; /* 52 */ + VasEBoot_uint16_t apm_version; /* 40 */ + VasEBoot_uint16_t apm_code_segment; /* 42 */ + VasEBoot_uint32_t apm_entry; /* 44 */ + VasEBoot_uint16_t apm_16bit_code_segment; /* 48 */ + VasEBoot_uint16_t apm_data_segment; /* 4a */ + VasEBoot_uint16_t apm_flags; /* 4c */ + VasEBoot_uint32_t apm_code_len; /* 4e */ + VasEBoot_uint16_t apm_data_len; /* 52 */ - grub_uint8_t padding4[0x60 - 0x54]; + VasEBoot_uint8_t padding4[0x60 - 0x54]; - grub_uint32_t ist_signature; /* 60 */ - grub_uint32_t ist_command; /* 64 */ - grub_uint32_t ist_event; /* 68 */ - grub_uint32_t ist_perf_level; /* 6c */ + VasEBoot_uint32_t ist_signature; /* 60 */ + VasEBoot_uint32_t ist_command; /* 64 */ + VasEBoot_uint32_t ist_event; /* 68 */ + VasEBoot_uint32_t ist_perf_level; /* 6c */ - grub_uint8_t padding5[0x80 - 0x70]; + VasEBoot_uint8_t padding5[0x80 - 0x70]; - grub_uint8_t hd0_drive_info[0x10]; /* 80 */ - grub_uint8_t hd1_drive_info[0x10]; /* 90 */ - grub_uint16_t rom_config_len; /* a0 */ + VasEBoot_uint8_t hd0_drive_info[0x10]; /* 80 */ + VasEBoot_uint8_t hd1_drive_info[0x10]; /* 90 */ + VasEBoot_uint16_t rom_config_len; /* a0 */ - grub_uint8_t padding6[0xb0 - 0xa2]; + VasEBoot_uint8_t padding6[0xb0 - 0xa2]; - grub_uint32_t ofw_signature; /* b0 */ - grub_uint32_t ofw_num_items; /* b4 */ - grub_uint32_t ofw_cif_handler; /* b8 */ - grub_uint32_t ofw_idt; /* bc */ + VasEBoot_uint32_t ofw_signature; /* b0 */ + VasEBoot_uint32_t ofw_num_items; /* b4 */ + VasEBoot_uint32_t ofw_cif_handler; /* b8 */ + VasEBoot_uint32_t ofw_idt; /* bc */ - grub_uint8_t padding7[0x1b8 - 0xc0]; + VasEBoot_uint8_t padding7[0x1b8 - 0xc0]; union { struct { - grub_uint32_t efi_system_table; /* 1b8 */ - grub_uint32_t padding7_1; /* 1bc */ - grub_uint32_t efi_signature; /* 1c0 */ - grub_uint32_t efi_mem_desc_size; /* 1c4 */ - grub_uint32_t efi_mem_desc_version; /* 1c8 */ - grub_uint32_t efi_mmap_size; /* 1cc */ - grub_uint32_t efi_mmap; /* 1d0 */ + VasEBoot_uint32_t efi_system_table; /* 1b8 */ + VasEBoot_uint32_t padding7_1; /* 1bc */ + VasEBoot_uint32_t efi_signature; /* 1c0 */ + VasEBoot_uint32_t efi_mem_desc_size; /* 1c4 */ + VasEBoot_uint32_t efi_mem_desc_version; /* 1c8 */ + VasEBoot_uint32_t efi_mmap_size; /* 1cc */ + VasEBoot_uint32_t efi_mmap; /* 1d0 */ } v0204; struct { - grub_uint32_t padding7_1; /* 1b8 */ - grub_uint32_t padding7_2; /* 1bc */ - grub_uint32_t efi_signature; /* 1c0 */ - grub_uint32_t efi_system_table; /* 1c4 */ - grub_uint32_t efi_mem_desc_size; /* 1c8 */ - grub_uint32_t efi_mem_desc_version; /* 1cc */ - grub_uint32_t efi_mmap; /* 1d0 */ - grub_uint32_t efi_mmap_size; /* 1d4 */ + VasEBoot_uint32_t padding7_1; /* 1b8 */ + VasEBoot_uint32_t padding7_2; /* 1bc */ + VasEBoot_uint32_t efi_signature; /* 1c0 */ + VasEBoot_uint32_t efi_system_table; /* 1c4 */ + VasEBoot_uint32_t efi_mem_desc_size; /* 1c8 */ + VasEBoot_uint32_t efi_mem_desc_version; /* 1cc */ + VasEBoot_uint32_t efi_mmap; /* 1d0 */ + VasEBoot_uint32_t efi_mmap_size; /* 1d4 */ } v0206; struct { - grub_uint32_t padding7_1; /* 1b8 */ - grub_uint32_t padding7_2; /* 1bc */ - grub_uint32_t efi_signature; /* 1c0 */ - grub_uint32_t efi_system_table; /* 1c4 */ - grub_uint32_t efi_mem_desc_size; /* 1c8 */ - grub_uint32_t efi_mem_desc_version; /* 1cc */ - grub_uint32_t efi_mmap; /* 1d0 */ - grub_uint32_t efi_mmap_size; /* 1d4 */ - grub_uint32_t efi_system_table_hi; /* 1d8 */ - grub_uint32_t efi_mmap_hi; /* 1dc */ + VasEBoot_uint32_t padding7_1; /* 1b8 */ + VasEBoot_uint32_t padding7_2; /* 1bc */ + VasEBoot_uint32_t efi_signature; /* 1c0 */ + VasEBoot_uint32_t efi_system_table; /* 1c4 */ + VasEBoot_uint32_t efi_mem_desc_size; /* 1c8 */ + VasEBoot_uint32_t efi_mem_desc_version; /* 1cc */ + VasEBoot_uint32_t efi_mmap; /* 1d0 */ + VasEBoot_uint32_t efi_mmap_size; /* 1d4 */ + VasEBoot_uint32_t efi_system_table_hi; /* 1d8 */ + VasEBoot_uint32_t efi_mmap_hi; /* 1dc */ } v0208; }; - grub_uint32_t alt_mem; /* 1e0 */ + VasEBoot_uint32_t alt_mem; /* 1e0 */ - grub_uint8_t padding8[0x1e8 - 0x1e4]; + VasEBoot_uint8_t padding8[0x1e8 - 0x1e4]; - grub_uint8_t mmap_size; /* 1e8 */ + VasEBoot_uint8_t mmap_size; /* 1e8 */ - grub_uint8_t padding9[0x1f1 - 0x1e9]; + VasEBoot_uint8_t padding9[0x1f1 - 0x1e9]; - grub_uint8_t setup_sects; /* The size of the setup in sectors */ - grub_uint16_t root_flags; /* If the root is mounted readonly */ - grub_uint16_t syssize; /* obsolete */ - grub_uint16_t swap_dev; /* obsolete */ - grub_uint16_t ram_size; /* obsolete */ - grub_uint16_t vid_mode; /* Video mode control */ - grub_uint16_t root_dev; /* Default root device number */ + VasEBoot_uint8_t setup_sects; /* The size of the setup in sectors */ + VasEBoot_uint16_t root_flags; /* If the root is mounted readonly */ + VasEBoot_uint16_t syssize; /* obsolete */ + VasEBoot_uint16_t swap_dev; /* obsolete */ + VasEBoot_uint16_t ram_size; /* obsolete */ + VasEBoot_uint16_t vid_mode; /* Video mode control */ + VasEBoot_uint16_t root_dev; /* Default root device number */ - grub_uint8_t padding10; /* 1fe */ - grub_uint8_t ps_mouse; /* 1ff */ + VasEBoot_uint8_t padding10; /* 1fe */ + VasEBoot_uint8_t ps_mouse; /* 1ff */ - grub_uint16_t jump; /* Jump instruction */ - grub_uint32_t header; /* Magic signature "HdrS" */ - grub_uint16_t version; /* Boot protocol version supported */ - grub_uint32_t realmode_swtch; /* Boot loader hook */ - grub_uint16_t start_sys; /* The load-low segment (obsolete) */ - grub_uint16_t kernel_version; /* Points to kernel version string */ - grub_uint8_t type_of_loader; /* Boot loader identifier */ - grub_uint8_t loadflags; /* Boot protocol option flags */ - grub_uint16_t setup_move_size; /* Move to high memory size */ - grub_uint32_t code32_start; /* Boot loader hook */ - grub_uint32_t ramdisk_image; /* initrd load address */ - grub_uint32_t ramdisk_size; /* initrd size */ - grub_uint32_t bootsect_kludge; /* obsolete */ - grub_uint16_t heap_end_ptr; /* Free memory after setup end */ - grub_uint8_t ext_loader_ver; /* Extended loader version */ - grub_uint8_t ext_loader_type; /* Extended loader type */ - grub_uint32_t cmd_line_ptr; /* Points to the kernel command line */ - grub_uint32_t initrd_addr_max; /* Maximum initrd address */ - grub_uint32_t kernel_alignment; /* Alignment of the kernel */ - grub_uint8_t relocatable_kernel; /* Is the kernel relocatable */ - grub_uint8_t pad1[3]; - grub_uint32_t cmdline_size; /* Size of the kernel command line */ - grub_uint32_t hardware_subarch; - grub_uint64_t hardware_subarch_data; - grub_uint32_t payload_offset; - grub_uint32_t payload_length; - grub_uint64_t setup_data; - grub_uint8_t pad2[120]; /* 258 */ - struct grub_e820_mmap e820_map[(0x400 - 0x2d0) / 20]; /* 2d0 */ + VasEBoot_uint16_t jump; /* Jump instruction */ + VasEBoot_uint32_t header; /* Magic signature "HdrS" */ + VasEBoot_uint16_t version; /* Boot protocol version supported */ + VasEBoot_uint32_t realmode_swtch; /* Boot loader hook */ + VasEBoot_uint16_t start_sys; /* The load-low segment (obsolete) */ + VasEBoot_uint16_t kernel_version; /* Points to kernel version string */ + VasEBoot_uint8_t type_of_loader; /* Boot loader identifier */ + VasEBoot_uint8_t loadflags; /* Boot protocol option flags */ + VasEBoot_uint16_t setup_move_size; /* Move to high memory size */ + VasEBoot_uint32_t code32_start; /* Boot loader hook */ + VasEBoot_uint32_t ramdisk_image; /* initrd load address */ + VasEBoot_uint32_t ramdisk_size; /* initrd size */ + VasEBoot_uint32_t bootsect_kludge; /* obsolete */ + VasEBoot_uint16_t heap_end_ptr; /* Free memory after setup end */ + VasEBoot_uint8_t ext_loader_ver; /* Extended loader version */ + VasEBoot_uint8_t ext_loader_type; /* Extended loader type */ + VasEBoot_uint32_t cmd_line_ptr; /* Points to the kernel command line */ + VasEBoot_uint32_t initrd_addr_max; /* Maximum initrd address */ + VasEBoot_uint32_t kernel_alignment; /* Alignment of the kernel */ + VasEBoot_uint8_t relocatable_kernel; /* Is the kernel relocatable */ + VasEBoot_uint8_t pad1[3]; + VasEBoot_uint32_t cmdline_size; /* Size of the kernel command line */ + VasEBoot_uint32_t hardware_subarch; + VasEBoot_uint64_t hardware_subarch_data; + VasEBoot_uint32_t payload_offset; + VasEBoot_uint32_t payload_length; + VasEBoot_uint64_t setup_data; + VasEBoot_uint8_t pad2[120]; /* 258 */ + struct VasEBoot_e820_mmap e820_map[(0x400 - 0x2d0) / 20]; /* 2d0 */ -} GRUB_PACKED; +} VasEBoot_PACKED; #endif /* ! ASM_FILE */ -#endif /* ! GRUB_LINUX_MACHINE_HEADER */ +#endif /* ! VasEBoot_LINUX_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/macho.h b/include/VasEBoot/i386/macho.h index e15167a50..f79857ff9 100644 --- a/include/VasEBoot/i386/macho.h +++ b/include/VasEBoot/i386/macho.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_MACHO_H -#define GRUB_CPU_MACHO_H 1 +#ifndef VasEBoot_CPU_MACHO_H +#define VasEBoot_CPU_MACHO_H 1 -#include +#include -#define GRUB_MACHO_CPUTYPE_IS_HOST32(x) ((x) == GRUB_MACHO_CPUTYPE_IA32) -#define GRUB_MACHO_CPUTYPE_IS_HOST64(x) ((x) == GRUB_MACHO_CPUTYPE_AMD64) +#define VasEBoot_MACHO_CPUTYPE_IS_HOST32(x) ((x) == VasEBoot_MACHO_CPUTYPE_IA32) +#define VasEBoot_MACHO_CPUTYPE_IS_HOST64(x) ((x) == VasEBoot_MACHO_CPUTYPE_AMD64) #ifdef __x86_64__ -#define GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x) == GRUB_MACHO_CPUTYPE_AMD64) +#define VasEBoot_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x) == VasEBoot_MACHO_CPUTYPE_AMD64) #else -#define GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x) == GRUB_MACHO_CPUTYPE_IA32) +#define VasEBoot_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x) == VasEBoot_MACHO_CPUTYPE_IA32) #endif #endif diff --git a/include/VasEBoot/i386/memory.h b/include/VasEBoot/i386/memory.h index 8bb6e1cbb..a2e0404ed 100644 --- a/include/VasEBoot/i386/memory.h +++ b/include/VasEBoot/i386/memory.h @@ -1,73 +1,73 @@ /* memory.h - describe the memory map */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_CPU_HEADER -#define GRUB_MEMORY_CPU_HEADER 1 +#ifndef VasEBoot_MEMORY_CPU_HEADER +#define VasEBoot_MEMORY_CPU_HEADER 1 #define PAGE_SHIFT 12 /* The flag for protected mode. */ -#define GRUB_MEMORY_CPU_CR0_PE_ON 0x1 -#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000020 -#define GRUB_MEMORY_CPU_CR4_PSE_ON 0x00000010 -#define GRUB_MEMORY_CPU_CR0_PAGING_ON 0x80000000 -#define GRUB_MEMORY_CPU_AMD64_MSR 0xc0000080 -#define GRUB_MEMORY_CPU_AMD64_MSR_ON 0x00000100 +#define VasEBoot_MEMORY_CPU_CR0_PE_ON 0x1 +#define VasEBoot_MEMORY_CPU_CR4_PAE_ON 0x00000020 +#define VasEBoot_MEMORY_CPU_CR4_PSE_ON 0x00000010 +#define VasEBoot_MEMORY_CPU_CR0_PAGING_ON 0x80000000 +#define VasEBoot_MEMORY_CPU_AMD64_MSR 0xc0000080 +#define VasEBoot_MEMORY_CPU_AMD64_MSR_ON 0x00000100 -#define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ -#define GRUB_MEMORY_MACHINE_LOWER_SIZE GRUB_MEMORY_MACHINE_UPPER_START +#define VasEBoot_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ +#define VasEBoot_MEMORY_MACHINE_LOWER_SIZE VasEBoot_MEMORY_MACHINE_UPPER_START /* Some PTE definitions. */ -#define GRUB_PAGE_PRESENT 0x00000001 -#define GRUB_PAGE_RW 0x00000002 -#define GRUB_PAGE_USER 0x00000004 +#define VasEBoot_PAGE_PRESENT 0x00000001 +#define VasEBoot_PAGE_RW 0x00000002 +#define VasEBoot_PAGE_USER 0x00000004 #ifndef ASM_FILE -#define GRUB_MMAP_MALLOC_LOW 1 +#define VasEBoot_MMAP_MALLOC_LOW 1 -#include +#include -grub_uint64_t grub_mmap_get_upper (void); -grub_uint64_t grub_mmap_get_lower (void); -grub_uint64_t grub_mmap_get_post64 (void); +VasEBoot_uint64_t VasEBoot_mmap_get_upper (void); +VasEBoot_uint64_t VasEBoot_mmap_get_lower (void); +VasEBoot_uint64_t VasEBoot_mmap_get_post64 (void); -typedef grub_addr_t grub_phys_addr_t; +typedef VasEBoot_addr_t VasEBoot_phys_addr_t; -static inline grub_phys_addr_t -grub_vtop (void *a) +static inline VasEBoot_phys_addr_t +VasEBoot_vtop (void *a) { - return (grub_phys_addr_t) a; + return (VasEBoot_phys_addr_t) a; } static inline void * -grub_map_memory (grub_phys_addr_t a, grub_size_t size __attribute__ ((unused))) +VasEBoot_map_memory (VasEBoot_phys_addr_t a, VasEBoot_size_t size __attribute__ ((unused))) { return (void *) a; } static inline void -grub_unmap_memory (void *a __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused))) +VasEBoot_unmap_memory (void *a __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused))) { } #endif -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/i386/memory_raw.h b/include/VasEBoot/i386/memory_raw.h index 1292ba7db..3adfa814a 100644 --- a/include/VasEBoot/i386/memory_raw.h +++ b/include/VasEBoot/i386/memory_raw.h @@ -1,58 +1,58 @@ /* memory_raw.h - describe the memory map on qemu/coreboot/multiboot/pc */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007,2008,2009,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_CPU_RAW_HEADER -#define GRUB_MEMORY_CPU_RAW_HEADER 1 +#ifndef VasEBoot_MEMORY_CPU_RAW_HEADER +#define VasEBoot_MEMORY_CPU_RAW_HEADER 1 /* The scratch buffer used in real mode code. */ -#define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000 -#define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4) -#define GRUB_MEMORY_MACHINE_SCRATCH_SIZE 0x9000 +#define VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR 0x68000 +#define VasEBoot_MEMORY_MACHINE_SCRATCH_SEG (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR >> 4) +#define VasEBoot_MEMORY_MACHINE_SCRATCH_SIZE 0x9000 /* The real mode stack. */ -#define GRUB_MEMORY_MACHINE_REAL_STACK (0x2000 - 0x10) +#define VasEBoot_MEMORY_MACHINE_REAL_STACK (0x2000 - 0x10) /* The size of the protect mode stack. */ -#define GRUB_MEMORY_MACHINE_PROT_STACK_SIZE 0xf000 +#define VasEBoot_MEMORY_MACHINE_PROT_STACK_SIZE 0xf000 /* The protected mode stack. */ -#define GRUB_MEMORY_MACHINE_PROT_STACK \ - (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + GRUB_MEMORY_MACHINE_SCRATCH_SIZE \ - + GRUB_MEMORY_MACHINE_PROT_STACK_SIZE - 0x10) +#define VasEBoot_MEMORY_MACHINE_PROT_STACK \ + (VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR + VasEBoot_MEMORY_MACHINE_SCRATCH_SIZE \ + + VasEBoot_MEMORY_MACHINE_PROT_STACK_SIZE - 0x10) -/* The memory area where GRUB uses its own purpose. This part is not added +/* The memory area where VasEBoot uses its own purpose. This part is not added into free memory for dynamic allocations. */ -#define GRUB_MEMORY_MACHINE_RESERVED_START \ - GRUB_MEMORY_MACHINE_SCRATCH_ADDR -#define GRUB_MEMORY_MACHINE_RESERVED_END \ - (GRUB_MEMORY_MACHINE_PROT_STACK + 0x10) +#define VasEBoot_MEMORY_MACHINE_RESERVED_START \ + VasEBoot_MEMORY_MACHINE_SCRATCH_ADDR +#define VasEBoot_MEMORY_MACHINE_RESERVED_END \ + (VasEBoot_MEMORY_MACHINE_PROT_STACK + 0x10) /* The code segment of the protected mode. */ -#define GRUB_MEMORY_MACHINE_PROT_MODE_CSEG 0x8 +#define VasEBoot_MEMORY_MACHINE_PROT_MODE_CSEG 0x8 /* The data segment of the protected mode. */ -#define GRUB_MEMORY_MACHINE_PROT_MODE_DSEG 0x10 +#define VasEBoot_MEMORY_MACHINE_PROT_MODE_DSEG 0x10 /* The code segment of the pseudo real mode. */ -#define GRUB_MEMORY_MACHINE_PSEUDO_REAL_CSEG 0x18 +#define VasEBoot_MEMORY_MACHINE_PSEUDO_REAL_CSEG 0x18 /* The data segment of the pseudo real mode. */ -#define GRUB_MEMORY_MACHINE_PSEUDO_REAL_DSEG 0x20 +#define VasEBoot_MEMORY_MACHINE_PSEUDO_REAL_DSEG 0x20 #endif diff --git a/include/VasEBoot/i386/multiboot.h b/include/VasEBoot/i386/multiboot.h index 807a1de27..a8a9bb4b3 100644 --- a/include/VasEBoot/i386/multiboot.h +++ b/include/VasEBoot/i386/multiboot.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MULTIBOOT_CPU_HEADER -#define GRUB_MULTIBOOT_CPU_HEADER 1 +#ifndef VasEBoot_MULTIBOOT_CPU_HEADER +#define VasEBoot_MULTIBOOT_CPU_HEADER 1 #define MULTIBOOT_INITIAL_STATE { .eax = MULTIBOOT_BOOTLOADER_MAGIC, \ .ecx = 0, \ @@ -30,7 +30,7 @@ #define MULTIBOOT_MBI_REGISTER ebx #define MULTIBOOT_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_I386 -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI #ifdef __x86_64__ #define MULTIBOOT_EFI_INITIAL_STATE { .rax = MULTIBOOT_BOOTLOADER_MAGIC, \ .rcx = 0, \ @@ -44,4 +44,4 @@ #define MULTIBOOT_ELF32_MACHINE EM_386 #define MULTIBOOT_ELF64_MACHINE EM_X86_64 -#endif /* ! GRUB_MULTIBOOT_CPU_HEADER */ +#endif /* ! VasEBoot_MULTIBOOT_CPU_HEADER */ diff --git a/include/VasEBoot/i386/multiboot/boot.h b/include/VasEBoot/i386/multiboot/boot.h index c33f9bac0..a151f7f24 100644 --- a/include/VasEBoot/i386/multiboot/boot.h +++ b/include/VasEBoot/i386/multiboot/boot.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/multiboot/console.h b/include/VasEBoot/i386/multiboot/console.h index 774399a4e..4209618bc 100644 --- a/include/VasEBoot/i386/multiboot/console.h +++ b/include/VasEBoot/i386/multiboot/console.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/multiboot/kernel.h b/include/VasEBoot/i386/multiboot/kernel.h index b41e86ebb..8d95e8f90 100644 --- a/include/VasEBoot/i386/multiboot/kernel.h +++ b/include/VasEBoot/i386/multiboot/kernel.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/multiboot/memory.h b/include/VasEBoot/i386/multiboot/memory.h index 8dd6f7c8c..3a488445e 100644 --- a/include/VasEBoot/i386/multiboot/memory.h +++ b/include/VasEBoot/i386/multiboot/memory.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/multiboot/serial.h b/include/VasEBoot/i386/multiboot/serial.h index 2d8563414..2dd72f652 100644 --- a/include/VasEBoot/i386/multiboot/serial.h +++ b/include/VasEBoot/i386/multiboot/serial.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/multiboot/time.h b/include/VasEBoot/i386/multiboot/time.h index 7177c7488..5eb62e38d 100644 --- a/include/VasEBoot/i386/multiboot/time.h +++ b/include/VasEBoot/i386/multiboot/time.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/netbsd_bootinfo.h b/include/VasEBoot/i386/netbsd_bootinfo.h index 9b4f46041..cb0e4ac76 100644 --- a/include/VasEBoot/i386/netbsd_bootinfo.h +++ b/include/VasEBoot/i386/netbsd_bootinfo.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* $NetBSD: bootinfo.h,v 1.16 2009/08/24 02:15:46 jmcneill Exp $ */ @@ -44,10 +44,10 @@ * */ -#ifndef GRUB_NETBSD_BOOTINFO_CPU_HEADER -#define GRUB_NETBSD_BOOTINFO_CPU_HEADER 1 +#ifndef VasEBoot_NETBSD_BOOTINFO_CPU_HEADER +#define VasEBoot_NETBSD_BOOTINFO_CPU_HEADER 1 -#include +#include #define NETBSD_BTINFO_BOOTPATH 0 #define NETBSD_BTINFO_ROOTDEVICE 1 @@ -61,94 +61,94 @@ #define NETBSD_BTINFO_USERCONFCOMMANDS 13 #define NETBSD_BTINFO_EFI 14 -struct grub_netbsd_bootinfo +struct VasEBoot_netbsd_bootinfo { - grub_uint32_t bi_count; - grub_uint32_t bi_data[0]; + VasEBoot_uint32_t bi_count; + VasEBoot_uint32_t bi_data[0]; }; -struct grub_netbsd_btinfo_common +struct VasEBoot_netbsd_btinfo_common { - grub_uint32_t len; - grub_uint32_t type; + VasEBoot_uint32_t len; + VasEBoot_uint32_t type; }; -#define GRUB_NETBSD_MAX_BOOTPATH_LEN 80 +#define VasEBoot_NETBSD_MAX_BOOTPATH_LEN 80 -struct grub_netbsd_btinfo_bootdisk +struct VasEBoot_netbsd_btinfo_bootdisk { - grub_uint32_t labelsector; /* label valid if != 0xffffffff */ + VasEBoot_uint32_t labelsector; /* label valid if != 0xffffffff */ struct { - grub_uint16_t type, checksum; + VasEBoot_uint16_t type, checksum; char packname[16]; } label; - grub_uint32_t biosdev; - grub_uint32_t partition; + VasEBoot_uint32_t biosdev; + VasEBoot_uint32_t partition; }; -struct grub_netbsd_btinfo_bootwedge { - grub_uint32_t biosdev; - grub_disk_addr_t startblk; - grub_uint64_t nblks; - grub_disk_addr_t matchblk; - grub_uint64_t matchnblks; - grub_uint8_t matchhash[16]; /* MD5 hash */ -} GRUB_PACKED; +struct VasEBoot_netbsd_btinfo_bootwedge { + VasEBoot_uint32_t biosdev; + VasEBoot_disk_addr_t startblk; + VasEBoot_uint64_t nblks; + VasEBoot_disk_addr_t matchblk; + VasEBoot_uint64_t matchnblks; + VasEBoot_uint8_t matchhash[16]; /* MD5 hash */ +} VasEBoot_PACKED; -struct grub_netbsd_btinfo_symtab +struct VasEBoot_netbsd_btinfo_symtab { - grub_uint32_t nsyms; - grub_uint32_t ssyms; - grub_uint32_t esyms; + VasEBoot_uint32_t nsyms; + VasEBoot_uint32_t ssyms; + VasEBoot_uint32_t esyms; }; -struct grub_netbsd_btinfo_serial +struct VasEBoot_netbsd_btinfo_serial { char devname[16]; - grub_uint32_t addr; - grub_uint32_t speed; + VasEBoot_uint32_t addr; + VasEBoot_uint32_t speed; }; -struct grub_netbsd_btinfo_modules +struct VasEBoot_netbsd_btinfo_modules { - grub_uint32_t num; - grub_uint32_t last_addr; - struct grub_netbsd_btinfo_module + VasEBoot_uint32_t num; + VasEBoot_uint32_t last_addr; + struct VasEBoot_netbsd_btinfo_module { char name[80]; -#define GRUB_NETBSD_MODULE_RAW 0 -#define GRUB_NETBSD_MODULE_ELF 1 - grub_uint32_t type; - grub_uint32_t size; - grub_uint32_t addr; +#define VasEBoot_NETBSD_MODULE_RAW 0 +#define VasEBoot_NETBSD_MODULE_ELF 1 + VasEBoot_uint32_t type; + VasEBoot_uint32_t size; + VasEBoot_uint32_t addr; } mods[0]; }; -struct grub_netbsd_btinfo_framebuf +struct VasEBoot_netbsd_btinfo_framebuf { - grub_uint64_t fbaddr; - grub_uint32_t flags; - grub_uint32_t width; - grub_uint32_t height; - grub_uint16_t pitch; - grub_uint8_t bpp; + VasEBoot_uint64_t fbaddr; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t width; + VasEBoot_uint32_t height; + VasEBoot_uint16_t pitch; + VasEBoot_uint8_t bpp; - grub_uint8_t red_mask_size; - grub_uint8_t green_mask_size; - grub_uint8_t blue_mask_size; + VasEBoot_uint8_t red_mask_size; + VasEBoot_uint8_t green_mask_size; + VasEBoot_uint8_t blue_mask_size; - grub_uint8_t red_field_pos; - grub_uint8_t green_field_pos; - grub_uint8_t blue_field_pos; + VasEBoot_uint8_t red_field_pos; + VasEBoot_uint8_t green_field_pos; + VasEBoot_uint8_t blue_field_pos; - grub_uint8_t reserved[16]; + VasEBoot_uint8_t reserved[16]; }; -#define GRUB_NETBSD_MAX_ROOTDEVICE_LEN 16 +#define VasEBoot_NETBSD_MAX_ROOTDEVICE_LEN 16 -struct grub_netbsd_btinfo_efi +struct VasEBoot_netbsd_btinfo_efi { void *pa_systbl; /* Physical address of the EFI System Table */ }; diff --git a/include/VasEBoot/i386/netbsd_reboot.h b/include/VasEBoot/i386/netbsd_reboot.h index ee82455bc..98880461c 100644 --- a/include/VasEBoot/i386/netbsd_reboot.h +++ b/include/VasEBoot/i386/netbsd_reboot.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* $NetBSD: reboot.h,v 1.25 2007/12/25 18:33:48 perry Exp $ */ @@ -49,8 +49,8 @@ * @(#)reboot.h 8.3 (Berkeley) 12/13/94 */ -#ifndef GRUB_NETBSD_REBOOT_CPU_HEADER -#define GRUB_NETBSD_REBOOT_CPU_HEADER 1 +#ifndef VasEBoot_NETBSD_REBOOT_CPU_HEADER +#define VasEBoot_NETBSD_REBOOT_CPU_HEADER 1 #define NETBSD_RB_AUTOBOOT 0 /* flags for system auto-booting itself */ diff --git a/include/VasEBoot/i386/openbsd_bootarg.h b/include/VasEBoot/i386/openbsd_bootarg.h index 9ebe6b4e4..3a10c8d0a 100644 --- a/include/VasEBoot/i386/openbsd_bootarg.h +++ b/include/VasEBoot/i386/openbsd_bootarg.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* $OpenBSD: bootarg.h,v 1.11 2003/06/02 20:20:54 mickey Exp $ */ @@ -44,8 +44,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GRUB_OPENBSD_BOOTARG_CPU_HEADER -#define GRUB_OPENBSD_BOOTARG_CPU_HEADER 1 +#ifndef VasEBoot_OPENBSD_BOOTARG_CPU_HEADER +#define VasEBoot_OPENBSD_BOOTARG_CPU_HEADER 1 #define OPENBSD_BOOTARG_APIVER (OPENBSD_BAPIV_VECTOR | \ OPENBSD_BAPIV_ENV | \ @@ -64,30 +64,30 @@ #define OPENBSD_BOOTARG_PCIBIOS 4 #define OPENBSD_BOOTARG_CONSOLE 5 -struct grub_openbsd_bootargs +struct VasEBoot_openbsd_bootargs { - grub_uint32_t ba_type; - grub_uint32_t ba_size; - grub_uint32_t ba_next; -} GRUB_PACKED; + VasEBoot_uint32_t ba_type; + VasEBoot_uint32_t ba_size; + VasEBoot_uint32_t ba_next; +} VasEBoot_PACKED; -struct grub_openbsd_bootarg_console +struct VasEBoot_openbsd_bootarg_console { - grub_uint32_t device; - grub_uint32_t speed; - grub_uint32_t addr; - grub_uint32_t frequency; + VasEBoot_uint32_t device; + VasEBoot_uint32_t speed; + VasEBoot_uint32_t addr; + VasEBoot_uint32_t frequency; }; -struct grub_openbsd_bootarg_pcibios +struct VasEBoot_openbsd_bootarg_pcibios { - grub_uint32_t characteristics; - grub_uint32_t revision; - grub_uint32_t pm_entry; - grub_uint32_t last_bus; + VasEBoot_uint32_t characteristics; + VasEBoot_uint32_t revision; + VasEBoot_uint32_t pm_entry; + VasEBoot_uint32_t last_bus; }; -#define GRUB_OPENBSD_COM_MAJOR 8 -#define GRUB_OPENBSD_VGA_MAJOR 12 +#define VasEBoot_OPENBSD_COM_MAJOR 8 +#define VasEBoot_OPENBSD_VGA_MAJOR 12 #endif diff --git a/include/VasEBoot/i386/openbsd_reboot.h b/include/VasEBoot/i386/openbsd_reboot.h index 3f6571a44..0bafbe744 100644 --- a/include/VasEBoot/i386/openbsd_reboot.h +++ b/include/VasEBoot/i386/openbsd_reboot.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* $OpenBSD: reboot.h,v 1.13 2004/03/10 23:02:53 tom Exp $ */ @@ -50,8 +50,8 @@ * @(#)reboot.h 8.2 (Berkeley) 7/10/94 */ -#ifndef GRUB_OPENBSD_REBOOT_CPU_HEADER -#define GRUB_OPENBSD_REBOOT_CPU_HEADER 1 +#ifndef VasEBoot_OPENBSD_REBOOT_CPU_HEADER +#define VasEBoot_OPENBSD_REBOOT_CPU_HEADER 1 #define OPENBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */ #define OPENBSD_RB_SINGLE (1 << 1) /* reboot to single user only */ diff --git a/include/VasEBoot/i386/pc/apm.h b/include/VasEBoot/i386/pc/apm.h index 6d9e8c61d..5c3789af6 100644 --- a/include/VasEBoot/i386/pc/apm.h +++ b/include/VasEBoot/i386/pc/apm.h @@ -1,48 +1,48 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_APM_MACHINE_HEADER -#define GRUB_APM_MACHINE_HEADER 1 +#ifndef VasEBoot_APM_MACHINE_HEADER +#define VasEBoot_APM_MACHINE_HEADER 1 -#include +#include -struct grub_apm_info +struct VasEBoot_apm_info { - grub_uint16_t cseg; - grub_uint32_t offset; - grub_uint16_t cseg_16; - grub_uint16_t dseg; - grub_uint16_t flags; - grub_uint16_t cseg_len; - grub_uint16_t cseg_16_len; - grub_uint16_t dseg_len; - grub_uint16_t version; + VasEBoot_uint16_t cseg; + VasEBoot_uint32_t offset; + VasEBoot_uint16_t cseg_16; + VasEBoot_uint16_t dseg; + VasEBoot_uint16_t flags; + VasEBoot_uint16_t cseg_len; + VasEBoot_uint16_t cseg_16_len; + VasEBoot_uint16_t dseg_len; + VasEBoot_uint16_t version; }; enum { - GRUB_APM_FLAGS_16BITPROTECTED_SUPPORTED = 1, - GRUB_APM_FLAGS_32BITPROTECTED_SUPPORTED = 2, - GRUB_APM_FLAGS_CPUIDLE_SLOWS_DOWN = 4, - GRUB_APM_FLAGS_DISABLED = 8, - GRUB_APM_FLAGS_DISENGAGED = 16, + VasEBoot_APM_FLAGS_16BITPROTECTED_SUPPORTED = 1, + VasEBoot_APM_FLAGS_32BITPROTECTED_SUPPORTED = 2, + VasEBoot_APM_FLAGS_CPUIDLE_SLOWS_DOWN = 4, + VasEBoot_APM_FLAGS_DISABLED = 8, + VasEBoot_APM_FLAGS_DISENGAGED = 16, }; -int grub_apm_get_info (struct grub_apm_info *info); +int VasEBoot_apm_get_info (struct VasEBoot_apm_info *info); #endif diff --git a/include/VasEBoot/i386/pc/biosdisk.h b/include/VasEBoot/i386/pc/biosdisk.h index 3d8071684..04093cde8 100644 --- a/include/VasEBoot/i386/pc/biosdisk.h +++ b/include/VasEBoot/i386/pc/biosdisk.h @@ -1,39 +1,39 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BIOSDISK_MACHINE_HEADER -#define GRUB_BIOSDISK_MACHINE_HEADER 1 +#ifndef VasEBoot_BIOSDISK_MACHINE_HEADER +#define VasEBoot_BIOSDISK_MACHINE_HEADER 1 -#include -#include +#include +#include -#define GRUB_BIOSDISK_FLAG_LBA 1 -#define GRUB_BIOSDISK_FLAG_CDROM 2 +#define VasEBoot_BIOSDISK_FLAG_LBA 1 +#define VasEBoot_BIOSDISK_FLAG_CDROM 2 -#define GRUB_BIOSDISK_CDTYPE_NO_EMUL 0 -#define GRUB_BIOSDISK_CDTYPE_1_2_M 1 -#define GRUB_BIOSDISK_CDTYPE_1_44_M 2 -#define GRUB_BIOSDISK_CDTYPE_2_88_M 3 -#define GRUB_BIOSDISK_CDTYPE_HARDDISK 4 +#define VasEBoot_BIOSDISK_CDTYPE_NO_EMUL 0 +#define VasEBoot_BIOSDISK_CDTYPE_1_2_M 1 +#define VasEBoot_BIOSDISK_CDTYPE_1_44_M 2 +#define VasEBoot_BIOSDISK_CDTYPE_2_88_M 3 +#define VasEBoot_BIOSDISK_CDTYPE_HARDDISK 4 -#define GRUB_BIOSDISK_CDTYPE_MASK 0xF +#define VasEBoot_BIOSDISK_CDTYPE_MASK 0xF -struct grub_biosdisk_data +struct VasEBoot_biosdisk_data { int drive; unsigned long cylinders; @@ -43,67 +43,67 @@ struct grub_biosdisk_data }; /* Drive Parameters. */ -struct grub_biosdisk_drp +struct VasEBoot_biosdisk_drp { - grub_uint16_t size; - grub_uint16_t flags; - grub_uint32_t cylinders; - grub_uint32_t heads; - grub_uint32_t sectors; - grub_uint64_t total_sectors; - grub_uint16_t bytes_per_sector; + VasEBoot_uint16_t size; + VasEBoot_uint16_t flags; + VasEBoot_uint32_t cylinders; + VasEBoot_uint32_t heads; + VasEBoot_uint32_t sectors; + VasEBoot_uint64_t total_sectors; + VasEBoot_uint16_t bytes_per_sector; /* ver 2.0 or higher */ union { - grub_uint32_t EDD_configuration_parameters; + VasEBoot_uint32_t EDD_configuration_parameters; /* Pointer to the Device Parameter Table Extension (ver 3.0+). */ - grub_uint32_t dpte_pointer; + VasEBoot_uint32_t dpte_pointer; }; /* ver 3.0 or higher */ - grub_uint16_t signature_dpi; - grub_uint8_t length_dpi; - grub_uint8_t reserved[3]; - grub_uint8_t name_of_host_bus[4]; - grub_uint8_t name_of_interface_type[8]; - grub_uint8_t interface_path[8]; - grub_uint8_t device_path[16]; - grub_uint8_t reserved2; - grub_uint8_t checksum; + VasEBoot_uint16_t signature_dpi; + VasEBoot_uint8_t length_dpi; + VasEBoot_uint8_t reserved[3]; + VasEBoot_uint8_t name_of_host_bus[4]; + VasEBoot_uint8_t name_of_interface_type[8]; + VasEBoot_uint8_t interface_path[8]; + VasEBoot_uint8_t device_path[16]; + VasEBoot_uint8_t reserved2; + VasEBoot_uint8_t checksum; /* XXX: This is necessary, because the BIOS of Thinkpad X20 writes a garbage to the tail of drive parameters, regardless of a size specified in a caller. */ - grub_uint8_t dummy[16]; -} GRUB_PACKED; + VasEBoot_uint8_t dummy[16]; +} VasEBoot_PACKED; -struct grub_biosdisk_cdrp +struct VasEBoot_biosdisk_cdrp { - grub_uint8_t size; - grub_uint8_t media_type; - grub_uint8_t drive_no; - grub_uint8_t controller_no; - grub_uint32_t image_lba; - grub_uint16_t device_spec; - grub_uint16_t cache_seg; - grub_uint16_t load_seg; - grub_uint16_t length_sec512; - grub_uint8_t cylinders; - grub_uint8_t sectors; - grub_uint8_t heads; - grub_uint8_t dummy[16]; -} GRUB_PACKED; + VasEBoot_uint8_t size; + VasEBoot_uint8_t media_type; + VasEBoot_uint8_t drive_no; + VasEBoot_uint8_t controller_no; + VasEBoot_uint32_t image_lba; + VasEBoot_uint16_t device_spec; + VasEBoot_uint16_t cache_seg; + VasEBoot_uint16_t load_seg; + VasEBoot_uint16_t length_sec512; + VasEBoot_uint8_t cylinders; + VasEBoot_uint8_t sectors; + VasEBoot_uint8_t heads; + VasEBoot_uint8_t dummy[16]; +} VasEBoot_PACKED; /* Disk Address Packet. */ -struct grub_biosdisk_dap +struct VasEBoot_biosdisk_dap { - grub_uint8_t length; - grub_uint8_t reserved; - grub_uint16_t blocks; - grub_uint32_t buffer; - grub_uint64_t block; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t reserved; + VasEBoot_uint16_t blocks; + VasEBoot_uint32_t buffer; + VasEBoot_uint64_t block; +} VasEBoot_PACKED; -#endif /* ! GRUB_BIOSDISK_MACHINE_HEADER */ +#endif /* ! VasEBoot_BIOSDISK_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/pc/biosnum.h b/include/VasEBoot/i386/pc/biosnum.h index 29c8ecc88..b3bfbbca0 100644 --- a/include/VasEBoot/i386/pc/biosnum.h +++ b/include/VasEBoot/i386/pc/biosnum.h @@ -1,6 +1,6 @@ -#ifndef GRUB_BIOSNUM_MACHINE_HEADER -#define GRUB_BIOSNUM_MACHINE_HEADER 1 +#ifndef VasEBoot_BIOSNUM_MACHINE_HEADER +#define VasEBoot_BIOSNUM_MACHINE_HEADER 1 -extern int (*grub_get_root_biosnumber) (void); +extern int (*VasEBoot_get_root_biosnumber) (void); #endif diff --git a/include/VasEBoot/i386/pc/boot.h b/include/VasEBoot/i386/pc/boot.h index a4d42ff3c..9277c91d9 100644 --- a/include/VasEBoot/i386/pc/boot.h +++ b/include/VasEBoot/i386/pc/boot.h @@ -1,73 +1,73 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2002,2005,2006,2007,2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BOOT_MACHINE_HEADER -#define GRUB_BOOT_MACHINE_HEADER 1 +#ifndef VasEBoot_BOOT_MACHINE_HEADER +#define VasEBoot_BOOT_MACHINE_HEADER 1 -#include +#include /* The signature for bootloader. */ -#define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55 +#define VasEBoot_BOOT_MACHINE_SIGNATURE 0xaa55 /* The offset of the start of BPB (BIOS Parameter Block). */ -#define GRUB_BOOT_MACHINE_BPB_START 0x3 +#define VasEBoot_BOOT_MACHINE_BPB_START 0x3 /* The offset of the end of BPB (BIOS Parameter Block). */ -#define GRUB_BOOT_MACHINE_BPB_END 0x5a +#define VasEBoot_BOOT_MACHINE_BPB_END 0x5a /* The offset of KERNEL_SECTOR. */ -#define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x5c +#define VasEBoot_BOOT_MACHINE_KERNEL_SECTOR 0x5c /* The offset of BOOT_DRIVE. */ -#define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x64 +#define VasEBoot_BOOT_MACHINE_BOOT_DRIVE 0x64 /* The offset of BOOT_DRIVE_CHECK. */ -#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x66 +#define VasEBoot_BOOT_MACHINE_DRIVE_CHECK 0x66 /* The offset of a magic number used by Windows NT. */ -#define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8 +#define VasEBoot_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8 /* The offset of the start of the partition table. */ -#define GRUB_BOOT_MACHINE_PART_START 0x1be +#define VasEBoot_BOOT_MACHINE_PART_START 0x1be /* The offset of the end of the partition table. */ -#define GRUB_BOOT_MACHINE_PART_END 0x1fe +#define VasEBoot_BOOT_MACHINE_PART_END 0x1fe /* The stack segment. */ -#define GRUB_BOOT_MACHINE_STACK_SEG 0x2000 +#define VasEBoot_BOOT_MACHINE_STACK_SEG 0x2000 /* The segment of disk buffer. The disk buffer MUST be 32K long and cannot straddle a 64K boundary. */ -#define GRUB_BOOT_MACHINE_BUFFER_SEG 0x7000 +#define VasEBoot_BOOT_MACHINE_BUFFER_SEG 0x7000 /* The flag for BIOS drive number to designate a hard disk vs. a floppy. */ -#define GRUB_BOOT_MACHINE_BIOS_HD_FLAG 0x80 +#define VasEBoot_BOOT_MACHINE_BIOS_HD_FLAG 0x80 /* The address where the kernel is loaded. */ -#define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4) +#define VasEBoot_BOOT_MACHINE_KERNEL_ADDR (VasEBoot_BOOT_MACHINE_KERNEL_SEG << 4) /* The size of a block list used in the kernel startup code. */ -#define GRUB_BOOT_MACHINE_LIST_SIZE 12 +#define VasEBoot_BOOT_MACHINE_LIST_SIZE 12 -#define GRUB_BOOT_MACHINE_PXE_DL 0x7f +#define VasEBoot_BOOT_MACHINE_PXE_DL 0x7f /* This is the blocklist used in the diskboot image. */ -#define grub_boot_blocklist grub_pc_bios_boot_blocklist +#define VasEBoot_boot_blocklist VasEBoot_pc_bios_boot_blocklist #endif /* ! BOOT_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/pc/chainloader.h b/include/VasEBoot/i386/pc/chainloader.h index 4776b181b..6d46ece45 100644 --- a/include/VasEBoot/i386/pc/chainloader.h +++ b/include/VasEBoot/i386/pc/chainloader.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2004,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CHAINLOADER_MACHINE_HEADER -#define GRUB_CHAINLOADER_MACHINE_HEADER 1 +#ifndef VasEBoot_CHAINLOADER_MACHINE_HEADER +#define VasEBoot_CHAINLOADER_MACHINE_HEADER 1 -#include +#include void -grub_chainloader_patch_bpb (void *bs, grub_device_t dev, grub_uint8_t dl); +VasEBoot_chainloader_patch_bpb (void *bs, VasEBoot_device_t dev, VasEBoot_uint8_t dl); -#endif /* GRUB_CHAINLOADER_MACHINE_HEADER */ +#endif /* VasEBoot_CHAINLOADER_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/pc/console.h b/include/VasEBoot/i386/pc/console.h index 191964f10..3ff611b66 100644 --- a/include/VasEBoot/i386/pc/console.h +++ b/include/VasEBoot/i386/pc/console.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CONSOLE_MACHINE_HEADER -#define GRUB_CONSOLE_MACHINE_HEADER 1 +#ifndef VasEBoot_CONSOLE_MACHINE_HEADER +#define VasEBoot_CONSOLE_MACHINE_HEADER 1 #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include /* Initialize the console system. */ -void grub_console_init (void); +void VasEBoot_console_init (void); /* Finish the console system. */ -void grub_console_fini (void); +void VasEBoot_console_fini (void); #endif -#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */ +#endif /* ! VasEBoot_CONSOLE_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/pc/int.h b/include/VasEBoot/i386/pc/int.h index 16a53e4fe..f03e0efba 100644 --- a/include/VasEBoot/i386/pc/int.h +++ b/include/VasEBoot/i386/pc/int.h @@ -1,67 +1,67 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_INTERRUPT_MACHINE_HEADER -#define GRUB_INTERRUPT_MACHINE_HEADER 1 +#ifndef VasEBoot_INTERRUPT_MACHINE_HEADER +#define VasEBoot_INTERRUPT_MACHINE_HEADER 1 -#include -#include +#include +#include -struct grub_bios_int_registers +struct VasEBoot_bios_int_registers { - grub_uint32_t eax; - grub_uint16_t es; - grub_uint16_t ds; - grub_uint16_t flags; - grub_uint16_t dummy; - grub_uint32_t ebx; - grub_uint32_t ecx; - grub_uint32_t edi; - grub_uint32_t esi; - grub_uint32_t edx; + VasEBoot_uint32_t eax; + VasEBoot_uint16_t es; + VasEBoot_uint16_t ds; + VasEBoot_uint16_t flags; + VasEBoot_uint16_t dummy; + VasEBoot_uint32_t ebx; + VasEBoot_uint32_t ecx; + VasEBoot_uint32_t edi; + VasEBoot_uint32_t esi; + VasEBoot_uint32_t edx; }; -#define GRUB_CPU_INT_FLAGS_CARRY 0x1 -#define GRUB_CPU_INT_FLAGS_PARITY 0x4 -#define GRUB_CPU_INT_FLAGS_ADJUST 0x10 -#define GRUB_CPU_INT_FLAGS_ZERO 0x40 -#define GRUB_CPU_INT_FLAGS_SIGN 0x80 -#define GRUB_CPU_INT_FLAGS_TRAP 0x100 -#define GRUB_CPU_INT_FLAGS_INTERRUPT 0x200 -#define GRUB_CPU_INT_FLAGS_DIRECTION 0x400 -#define GRUB_CPU_INT_FLAGS_OVERFLOW 0x800 -#ifdef GRUB_MACHINE_PCBIOS -#define GRUB_CPU_INT_FLAGS_DEFAULT GRUB_CPU_INT_FLAGS_INTERRUPT +#define VasEBoot_CPU_INT_FLAGS_CARRY 0x1 +#define VasEBoot_CPU_INT_FLAGS_PARITY 0x4 +#define VasEBoot_CPU_INT_FLAGS_ADJUST 0x10 +#define VasEBoot_CPU_INT_FLAGS_ZERO 0x40 +#define VasEBoot_CPU_INT_FLAGS_SIGN 0x80 +#define VasEBoot_CPU_INT_FLAGS_TRAP 0x100 +#define VasEBoot_CPU_INT_FLAGS_INTERRUPT 0x200 +#define VasEBoot_CPU_INT_FLAGS_DIRECTION 0x400 +#define VasEBoot_CPU_INT_FLAGS_OVERFLOW 0x800 +#ifdef VasEBoot_MACHINE_PCBIOS +#define VasEBoot_CPU_INT_FLAGS_DEFAULT VasEBoot_CPU_INT_FLAGS_INTERRUPT #else -#define GRUB_CPU_INT_FLAGS_DEFAULT 0 +#define VasEBoot_CPU_INT_FLAGS_DEFAULT 0 #endif -void EXPORT_FUNC (grub_bios_interrupt) (grub_uint8_t intno, - struct grub_bios_int_registers *regs) +void EXPORT_FUNC (VasEBoot_bios_interrupt) (VasEBoot_uint8_t intno, + struct VasEBoot_bios_int_registers *regs) __attribute__ ((regparm(3))); -struct grub_i386_idt +struct VasEBoot_i386_idt { - grub_uint16_t limit; - grub_uint32_t base; -} GRUB_PACKED; + VasEBoot_uint16_t limit; + VasEBoot_uint32_t base; +} VasEBoot_PACKED; -#ifdef GRUB_MACHINE_PCBIOS -extern struct grub_i386_idt *EXPORT_VAR(grub_realidt); +#ifdef VasEBoot_MACHINE_PCBIOS +extern struct VasEBoot_i386_idt *EXPORT_VAR(VasEBoot_realidt); #endif #endif diff --git a/include/VasEBoot/i386/pc/kernel.h b/include/VasEBoot/i386/pc/kernel.h index 4f05b74e3..529407cf6 100644 --- a/include/VasEBoot/i386/pc/kernel.h +++ b/include/VasEBoot/i386/pc/kernel.h @@ -1,40 +1,40 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_MACHINE_HEADER #define KERNEL_MACHINE_HEADER 1 -#include +#include /* Enable LZMA compression */ #define ENABLE_LZMA 1 #ifndef ASM_FILE -#include -#include +#include +#include /* The total size of module images following the kernel. */ -extern grub_int32_t grub_total_module_size; +extern VasEBoot_int32_t VasEBoot_total_module_size; -extern grub_uint32_t EXPORT_VAR(grub_boot_device); +extern VasEBoot_uint32_t EXPORT_VAR(VasEBoot_boot_device); -extern void (*EXPORT_VAR(grub_pc_net_config)) (char **device, char **path); +extern void (*EXPORT_VAR(VasEBoot_pc_net_config)) (char **device, char **path); #endif /* ! ASM_FILE */ diff --git a/include/VasEBoot/i386/pc/memory.h b/include/VasEBoot/i386/pc/memory.h index d0c5c202e..137640d80 100644 --- a/include/VasEBoot/i386/pc/memory.h +++ b/include/VasEBoot/i386/pc/memory.h @@ -1,63 +1,63 @@ /* memory.h - describe the memory map */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_MACHINE_HEADER -#define GRUB_MEMORY_MACHINE_HEADER 1 +#ifndef VasEBoot_MEMORY_MACHINE_HEADER +#define VasEBoot_MEMORY_MACHINE_HEADER 1 -#include +#include #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include #endif -#include -#include +#include +#include -#include +#include -/* The area where GRUB is decompressed at early startup. */ -#define GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR 0x100000 +/* The area where VasEBoot is decompressed at early startup. */ +#define VasEBoot_MEMORY_MACHINE_DECOMPRESSION_ADDR 0x100000 /* The address of a partition table passed to another boot loader. */ -#define GRUB_MEMORY_MACHINE_PART_TABLE_ADDR 0x7be +#define VasEBoot_MEMORY_MACHINE_PART_TABLE_ADDR 0x7be /* The address where another boot loader is loaded. */ -#define GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR 0x7c00 +#define VasEBoot_MEMORY_MACHINE_BOOT_LOADER_ADDR 0x7c00 -#define GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR 0x400 +#define VasEBoot_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR 0x400 #ifndef ASM_FILE /* See http://heim.ifi.uio.no/~stanisls/helppc/bios_data_area.html for a description of the BIOS Data Area layout. */ -struct grub_machine_bios_data_area +struct VasEBoot_machine_bios_data_area { - grub_uint8_t unused1[0x17]; - grub_uint8_t keyboard_flag_lower; /* 0x17 */ - grub_uint8_t unused2[0xf0 - 0x18]; + VasEBoot_uint8_t unused1[0x17]; + VasEBoot_uint8_t keyboard_flag_lower; /* 0x17 */ + VasEBoot_uint8_t unused2[0xf0 - 0x18]; }; -grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, +VasEBoot_err_t VasEBoot_machine_mmap_register (VasEBoot_uint64_t start, VasEBoot_uint64_t size, int type, int handle); -grub_err_t grub_machine_mmap_unregister (int handle); +VasEBoot_err_t VasEBoot_machine_mmap_unregister (int handle); #endif -#endif /* ! GRUB_MEMORY_MACHINE_HEADER */ +#endif /* ! VasEBoot_MEMORY_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/pc/pxe.h b/include/VasEBoot/i386/pc/pxe.h index 66002bcd2..4ab709c17 100644 --- a/include/VasEBoot/i386/pc/pxe.h +++ b/include/VasEBoot/i386/pc/pxe.h @@ -1,292 +1,292 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_PXE_H -#define GRUB_CPU_PXE_H +#ifndef VasEBoot_CPU_PXE_H +#define VasEBoot_CPU_PXE_H -#include +#include -#define GRUB_PXENV_TFTP_OPEN 0x0020 -#define GRUB_PXENV_TFTP_CLOSE 0x0021 -#define GRUB_PXENV_TFTP_READ 0x0022 -#define GRUB_PXENV_TFTP_READ_FILE 0x0023 -#define GRUB_PXENV_TFTP_READ_FILE_PMODE 0x0024 -#define GRUB_PXENV_TFTP_GET_FSIZE 0x0025 +#define VasEBoot_PXENV_TFTP_OPEN 0x0020 +#define VasEBoot_PXENV_TFTP_CLOSE 0x0021 +#define VasEBoot_PXENV_TFTP_READ 0x0022 +#define VasEBoot_PXENV_TFTP_READ_FILE 0x0023 +#define VasEBoot_PXENV_TFTP_READ_FILE_PMODE 0x0024 +#define VasEBoot_PXENV_TFTP_GET_FSIZE 0x0025 -#define GRUB_PXENV_UDP_OPEN 0x0030 -#define GRUB_PXENV_UDP_CLOSE 0x0031 -#define GRUB_PXENV_UDP_READ 0x0032 -#define GRUB_PXENV_UDP_WRITE 0x0033 +#define VasEBoot_PXENV_UDP_OPEN 0x0030 +#define VasEBoot_PXENV_UDP_CLOSE 0x0031 +#define VasEBoot_PXENV_UDP_READ 0x0032 +#define VasEBoot_PXENV_UDP_WRITE 0x0033 -#define GRUB_PXENV_START_UNDI 0x0000 -#define GRUB_PXENV_UNDI_STARTUP 0x0001 -#define GRUB_PXENV_UNDI_CLEANUP 0x0002 -#define GRUB_PXENV_UNDI_INITIALIZE 0x0003 -#define GRUB_PXENV_UNDI_RESET_NIC 0x0004 -#define GRUB_PXENV_UNDI_SHUTDOWN 0x0005 -#define GRUB_PXENV_UNDI_OPEN 0x0006 -#define GRUB_PXENV_UNDI_CLOSE 0x0007 -#define GRUB_PXENV_UNDI_TRANSMIT 0x0008 -#define GRUB_PXENV_UNDI_SET_MCAST_ADDR 0x0009 -#define GRUB_PXENV_UNDI_SET_STATION_ADDR 0x000A -#define GRUB_PXENV_UNDI_SET_PACKET_FILTER 0x000B -#define GRUB_PXENV_UNDI_GET_INFORMATION 0x000C -#define GRUB_PXENV_UNDI_GET_STATISTICS 0x000D -#define GRUB_PXENV_UNDI_CLEAR_STATISTICS 0x000E -#define GRUB_PXENV_UNDI_INITIATE_DIAGS 0x000F -#define GRUB_PXENV_UNDI_FORCE_INTERRUPT 0x0010 -#define GRUB_PXENV_UNDI_GET_MCAST_ADDR 0x0011 -#define GRUB_PXENV_UNDI_GET_NIC_TYPE 0x0012 -#define GRUB_PXENV_UNDI_GET_IFACE_INFO 0x0013 -#define GRUB_PXENV_UNDI_ISR 0x0014 -#define GRUB_PXENV_STOP_UNDI 0x0015 -#define GRUB_PXENV_UNDI_GET_STATE 0x0015 +#define VasEBoot_PXENV_START_UNDI 0x0000 +#define VasEBoot_PXENV_UNDI_STARTUP 0x0001 +#define VasEBoot_PXENV_UNDI_CLEANUP 0x0002 +#define VasEBoot_PXENV_UNDI_INITIALIZE 0x0003 +#define VasEBoot_PXENV_UNDI_RESET_NIC 0x0004 +#define VasEBoot_PXENV_UNDI_SHUTDOWN 0x0005 +#define VasEBoot_PXENV_UNDI_OPEN 0x0006 +#define VasEBoot_PXENV_UNDI_CLOSE 0x0007 +#define VasEBoot_PXENV_UNDI_TRANSMIT 0x0008 +#define VasEBoot_PXENV_UNDI_SET_MCAST_ADDR 0x0009 +#define VasEBoot_PXENV_UNDI_SET_STATION_ADDR 0x000A +#define VasEBoot_PXENV_UNDI_SET_PACKET_FILTER 0x000B +#define VasEBoot_PXENV_UNDI_GET_INFORMATION 0x000C +#define VasEBoot_PXENV_UNDI_GET_STATISTICS 0x000D +#define VasEBoot_PXENV_UNDI_CLEAR_STATISTICS 0x000E +#define VasEBoot_PXENV_UNDI_INITIATE_DIAGS 0x000F +#define VasEBoot_PXENV_UNDI_FORCE_INTERRUPT 0x0010 +#define VasEBoot_PXENV_UNDI_GET_MCAST_ADDR 0x0011 +#define VasEBoot_PXENV_UNDI_GET_NIC_TYPE 0x0012 +#define VasEBoot_PXENV_UNDI_GET_IFACE_INFO 0x0013 +#define VasEBoot_PXENV_UNDI_ISR 0x0014 +#define VasEBoot_PXENV_STOP_UNDI 0x0015 +#define VasEBoot_PXENV_UNDI_GET_STATE 0x0015 -#define GRUB_PXENV_UNLOAD_STACK 0x0070 -#define GRUB_PXENV_GET_CACHED_INFO 0x0071 -#define GRUB_PXENV_RESTART_DHCP 0x0072 -#define GRUB_PXENV_RESTART_TFTP 0x0073 -#define GRUB_PXENV_MODE_SWITCH 0x0074 -#define GRUB_PXENV_START_BASE 0x0075 -#define GRUB_PXENV_STOP_BASE 0x0076 +#define VasEBoot_PXENV_UNLOAD_STACK 0x0070 +#define VasEBoot_PXENV_GET_CACHED_INFO 0x0071 +#define VasEBoot_PXENV_RESTART_DHCP 0x0072 +#define VasEBoot_PXENV_RESTART_TFTP 0x0073 +#define VasEBoot_PXENV_MODE_SWITCH 0x0074 +#define VasEBoot_PXENV_START_BASE 0x0075 +#define VasEBoot_PXENV_STOP_BASE 0x0076 -#define GRUB_PXENV_EXIT_SUCCESS 0x0000 -#define GRUB_PXENV_EXIT_FAILURE 0x0001 +#define VasEBoot_PXENV_EXIT_SUCCESS 0x0000 +#define VasEBoot_PXENV_EXIT_FAILURE 0x0001 -#define GRUB_PXENV_STATUS_SUCCESS 0x00 -#define GRUB_PXENV_STATUS_FAILURE 0x01 -#define GRUB_PXENV_STATUS_BAD_FUNC 0x02 -#define GRUB_PXENV_STATUS_UNSUPPORTED 0x03 -#define GRUB_PXENV_STATUS_KEEP_UNDI 0x04 -#define GRUB_PXENV_STATUS_KEEP_ALL 0x05 -#define GRUB_PXENV_STATUS_OUT_OF_RESOURCES 0x06 -#define GRUB_PXENV_STATUS_ARP_TIMEOUT 0x11 -#define GRUB_PXENV_STATUS_UDP_CLOSED 0x18 -#define GRUB_PXENV_STATUS_UDP_OPEN 0x19 -#define GRUB_PXENV_STATUS_TFTP_CLOSED 0x1A -#define GRUB_PXENV_STATUS_TFTP_OPEN 0x1B -#define GRUB_PXENV_STATUS_MCOPY_PROBLEM 0x20 -#define GRUB_PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x21 -#define GRUB_PXENV_STATUS_BIS_VALIDATE_FAILURE 0x22 -#define GRUB_PXENV_STATUS_BIS_INIT_FAILURE 0x23 -#define GRUB_PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x24 -#define GRUB_PXENV_STATUS_BIS_GBOA_FAILURE 0x25 -#define GRUB_PXENV_STATUS_BIS_FREE_FAILURE 0x26 -#define GRUB_PXENV_STATUS_BIS_GSI_FAILURE 0x27 -#define GRUB_PXENV_STATUS_BIS_BAD_CKSUM 0x28 -#define GRUB_PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x30 -#define GRUB_PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x32 +#define VasEBoot_PXENV_STATUS_SUCCESS 0x00 +#define VasEBoot_PXENV_STATUS_FAILURE 0x01 +#define VasEBoot_PXENV_STATUS_BAD_FUNC 0x02 +#define VasEBoot_PXENV_STATUS_UNSUPPORTED 0x03 +#define VasEBoot_PXENV_STATUS_KEEP_UNDI 0x04 +#define VasEBoot_PXENV_STATUS_KEEP_ALL 0x05 +#define VasEBoot_PXENV_STATUS_OUT_OF_RESOURCES 0x06 +#define VasEBoot_PXENV_STATUS_ARP_TIMEOUT 0x11 +#define VasEBoot_PXENV_STATUS_UDP_CLOSED 0x18 +#define VasEBoot_PXENV_STATUS_UDP_OPEN 0x19 +#define VasEBoot_PXENV_STATUS_TFTP_CLOSED 0x1A +#define VasEBoot_PXENV_STATUS_TFTP_OPEN 0x1B +#define VasEBoot_PXENV_STATUS_MCOPY_PROBLEM 0x20 +#define VasEBoot_PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x21 +#define VasEBoot_PXENV_STATUS_BIS_VALIDATE_FAILURE 0x22 +#define VasEBoot_PXENV_STATUS_BIS_INIT_FAILURE 0x23 +#define VasEBoot_PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x24 +#define VasEBoot_PXENV_STATUS_BIS_GBOA_FAILURE 0x25 +#define VasEBoot_PXENV_STATUS_BIS_FREE_FAILURE 0x26 +#define VasEBoot_PXENV_STATUS_BIS_GSI_FAILURE 0x27 +#define VasEBoot_PXENV_STATUS_BIS_BAD_CKSUM 0x28 +#define VasEBoot_PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x30 +#define VasEBoot_PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x32 -#define GRUB_PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x33 -#define GRUB_PXENV_STATUS_TFTP_READ_TIMEOUT 0x35 -#define GRUB_PXENV_STATUS_TFTP_ERROR_OPCODE 0x36 -#define GRUB_PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x38 -#define GRUB_PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x39 -#define GRUB_PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x3A -#define GRUB_PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x3B -#define GRUB_PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x3C -#define GRUB_PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x3D -#define GRUB_PXENV_STATUS_TFTP_NO_FILESIZE 0x3E -#define GRUB_PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x3F -#define GRUB_PXENV_STATUS_DHCP_TIMEOUT 0x51 -#define GRUB_PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x52 -#define GRUB_PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x53 -#define GRUB_PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x54 -#define GRUB_PXENV_STATUS_UNDI_INVALID_FUNCTION 0x60 -#define GRUB_PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x61 -#define GRUB_PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x62 -#define GRUB_PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x63 -#define GRUB_PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x64 -#define GRUB_PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x65 -#define GRUB_PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x66 -#define GRUB_PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x67 -#define GRUB_PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x68 -#define GRUB_PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x69 -#define GRUB_PXENV_STATUS_UNDI_INVALID_STATE 0x6A -#define GRUB_PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x6B -#define GRUB_PXENV_STATUS_UNDI_INVALID_PARAMETER 0x6C -#define GRUB_PXENV_STATUS_BSTRAP_PROMPT_MENU 0x74 -#define GRUB_PXENV_STATUS_BSTRAP_MCAST_ADDR 0x76 -#define GRUB_PXENV_STATUS_BSTRAP_MISSING_LIST 0x77 -#define GRUB_PXENV_STATUS_BSTRAP_NO_RESPONSE 0x78 -#define GRUB_PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x79 -#define GRUB_PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0xA0 -#define GRUB_PXENV_STATUS_BINL_NO_PXE_SERVER 0xA1 -#define GRUB_PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0xA2 -#define GRUB_PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0xA3 -#define GRUB_PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0xB0 -#define GRUB_PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0xC0 -#define GRUB_PXENV_STATUS_LOADER_NO_BC_ROMID 0xC1 -#define GRUB_PXENV_STATUS_LOADER_BAD_BC_ROMID 0xC2 -#define GRUB_PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0xC3 -#define GRUB_PXENV_STATUS_LOADER_NO_UNDI_ROMID 0xC4 -#define GRUB_PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0xC5 -#define GRUB_PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0xC6 -#define GRUB_PXENV_STATUS_LOADER_NO_PXE_STRUCT 0xC8 -#define GRUB_PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0xC9 -#define GRUB_PXENV_STATUS_LOADER_UNDI_START 0xCA -#define GRUB_PXENV_STATUS_LOADER_BC_START 0xCB +#define VasEBoot_PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x33 +#define VasEBoot_PXENV_STATUS_TFTP_READ_TIMEOUT 0x35 +#define VasEBoot_PXENV_STATUS_TFTP_ERROR_OPCODE 0x36 +#define VasEBoot_PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x38 +#define VasEBoot_PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x39 +#define VasEBoot_PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x3A +#define VasEBoot_PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x3B +#define VasEBoot_PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x3C +#define VasEBoot_PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x3D +#define VasEBoot_PXENV_STATUS_TFTP_NO_FILESIZE 0x3E +#define VasEBoot_PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x3F +#define VasEBoot_PXENV_STATUS_DHCP_TIMEOUT 0x51 +#define VasEBoot_PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x52 +#define VasEBoot_PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x53 +#define VasEBoot_PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x54 +#define VasEBoot_PXENV_STATUS_UNDI_INVALID_FUNCTION 0x60 +#define VasEBoot_PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x61 +#define VasEBoot_PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x62 +#define VasEBoot_PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x63 +#define VasEBoot_PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x64 +#define VasEBoot_PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x65 +#define VasEBoot_PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x66 +#define VasEBoot_PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x67 +#define VasEBoot_PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x68 +#define VasEBoot_PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x69 +#define VasEBoot_PXENV_STATUS_UNDI_INVALID_STATE 0x6A +#define VasEBoot_PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x6B +#define VasEBoot_PXENV_STATUS_UNDI_INVALID_PARAMETER 0x6C +#define VasEBoot_PXENV_STATUS_BSTRAP_PROMPT_MENU 0x74 +#define VasEBoot_PXENV_STATUS_BSTRAP_MCAST_ADDR 0x76 +#define VasEBoot_PXENV_STATUS_BSTRAP_MISSING_LIST 0x77 +#define VasEBoot_PXENV_STATUS_BSTRAP_NO_RESPONSE 0x78 +#define VasEBoot_PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x79 +#define VasEBoot_PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0xA0 +#define VasEBoot_PXENV_STATUS_BINL_NO_PXE_SERVER 0xA1 +#define VasEBoot_PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0xA2 +#define VasEBoot_PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0xA3 +#define VasEBoot_PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0xB0 +#define VasEBoot_PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0xC0 +#define VasEBoot_PXENV_STATUS_LOADER_NO_BC_ROMID 0xC1 +#define VasEBoot_PXENV_STATUS_LOADER_BAD_BC_ROMID 0xC2 +#define VasEBoot_PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0xC3 +#define VasEBoot_PXENV_STATUS_LOADER_NO_UNDI_ROMID 0xC4 +#define VasEBoot_PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0xC5 +#define VasEBoot_PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0xC6 +#define VasEBoot_PXENV_STATUS_LOADER_NO_PXE_STRUCT 0xC8 +#define VasEBoot_PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0xC9 +#define VasEBoot_PXENV_STATUS_LOADER_UNDI_START 0xCA +#define VasEBoot_PXENV_STATUS_LOADER_BC_START 0xCB -#define GRUB_PXENV_PACKET_TYPE_DHCP_DISCOVER 1 -#define GRUB_PXENV_PACKET_TYPE_DHCP_ACK 2 -#define GRUB_PXENV_PACKET_TYPE_CACHED_REPLY 3 +#define VasEBoot_PXENV_PACKET_TYPE_DHCP_DISCOVER 1 +#define VasEBoot_PXENV_PACKET_TYPE_DHCP_ACK 2 +#define VasEBoot_PXENV_PACKET_TYPE_CACHED_REPLY 3 -#define GRUB_PXE_BOOTP_REQ 1 -#define GRUB_PXE_BOOTP_REP 2 +#define VasEBoot_PXE_BOOTP_REQ 1 +#define VasEBoot_PXE_BOOTP_REP 2 -#define GRUB_PXE_BOOTP_BCAST 0x8000 +#define VasEBoot_PXE_BOOTP_BCAST 0x8000 #if 1 -#define GRUB_PXE_BOOTP_SIZE (1024 + 236) /* DHCP extended vendor field size. */ +#define VasEBoot_PXE_BOOTP_SIZE (1024 + 236) /* DHCP extended vendor field size. */ #else -#define GRUB_PXE_BOOTP_SIZE (312 + 236) /* DHCP standard vendor field size. */ +#define VasEBoot_PXE_BOOTP_SIZE (312 + 236) /* DHCP standard vendor field size. */ #endif -#define GRUB_PXE_TFTP_PORT 69 +#define VasEBoot_PXE_TFTP_PORT 69 -#define GRUB_PXE_ERR_LEN 0xFFFFFFFF +#define VasEBoot_PXE_ERR_LEN 0xFFFFFFFF #ifndef ASM_FILE -#define GRUB_PXE_SIGNATURE "PXENV+" +#define VasEBoot_PXE_SIGNATURE "PXENV+" -struct grub_pxenv +struct VasEBoot_pxenv { - grub_uint8_t signature[6]; /* 'PXENV+'. */ - grub_uint16_t version; /* MSB = major, LSB = minor. */ - grub_uint8_t length; /* structure length. */ - grub_uint8_t checksum; /* checksum pad. */ - grub_uint32_t rm_entry; /* SEG:OFF to PXE entry point. */ - grub_uint32_t pm_offset; /* Protected mode entry. */ - grub_uint16_t pm_selector; /* Protected mode selector. */ - grub_uint16_t stack_seg; /* Stack segment address. */ - grub_uint16_t stack_size; /* Stack segment size (bytes). */ - grub_uint16_t bc_code_seg; /* BC Code segment address. */ - grub_uint16_t bc_code_size; /* BC Code segment size (bytes). */ - grub_uint16_t bc_data_seg; /* BC Data segment address. */ - grub_uint16_t bc_data_size; /* BC Data segment size (bytes). */ - grub_uint16_t undi_data_seg; /* UNDI Data segment address. */ - grub_uint16_t undi_data_size; /* UNDI Data segment size (bytes). */ - grub_uint16_t undi_code_seg; /* UNDI Code segment address. */ - grub_uint16_t undi_code_size; /* UNDI Code segment size (bytes). */ - grub_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct. */ -} GRUB_PACKED; + VasEBoot_uint8_t signature[6]; /* 'PXENV+'. */ + VasEBoot_uint16_t version; /* MSB = major, LSB = minor. */ + VasEBoot_uint8_t length; /* structure length. */ + VasEBoot_uint8_t checksum; /* checksum pad. */ + VasEBoot_uint32_t rm_entry; /* SEG:OFF to PXE entry point. */ + VasEBoot_uint32_t pm_offset; /* Protected mode entry. */ + VasEBoot_uint16_t pm_selector; /* Protected mode selector. */ + VasEBoot_uint16_t stack_seg; /* Stack segment address. */ + VasEBoot_uint16_t stack_size; /* Stack segment size (bytes). */ + VasEBoot_uint16_t bc_code_seg; /* BC Code segment address. */ + VasEBoot_uint16_t bc_code_size; /* BC Code segment size (bytes). */ + VasEBoot_uint16_t bc_data_seg; /* BC Data segment address. */ + VasEBoot_uint16_t bc_data_size; /* BC Data segment size (bytes). */ + VasEBoot_uint16_t undi_data_seg; /* UNDI Data segment address. */ + VasEBoot_uint16_t undi_data_size; /* UNDI Data segment size (bytes). */ + VasEBoot_uint16_t undi_code_seg; /* UNDI Code segment address. */ + VasEBoot_uint16_t undi_code_size; /* UNDI Code segment size (bytes). */ + VasEBoot_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct. */ +} VasEBoot_PACKED; -struct grub_pxe_bangpxe +struct VasEBoot_pxe_bangpxe { - grub_uint8_t signature[4]; -#define GRUB_PXE_BANGPXE_SIGNATURE "!PXE" - grub_uint8_t length; - grub_uint8_t chksum; - grub_uint8_t rev; - grub_uint8_t reserved; - grub_uint32_t undiromid; - grub_uint32_t baseromid; - grub_uint32_t rm_entry; -} GRUB_PACKED; + VasEBoot_uint8_t signature[4]; +#define VasEBoot_PXE_BANGPXE_SIGNATURE "!PXE" + VasEBoot_uint8_t length; + VasEBoot_uint8_t chksum; + VasEBoot_uint8_t rev; + VasEBoot_uint8_t reserved; + VasEBoot_uint32_t undiromid; + VasEBoot_uint32_t baseromid; + VasEBoot_uint32_t rm_entry; +} VasEBoot_PACKED; -struct grub_pxenv_get_cached_info +struct VasEBoot_pxenv_get_cached_info { - grub_uint16_t status; - grub_uint16_t packet_type; - grub_uint16_t buffer_size; - grub_uint32_t buffer; - grub_uint16_t buffer_limit; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint16_t packet_type; + VasEBoot_uint16_t buffer_size; + VasEBoot_uint32_t buffer; + VasEBoot_uint16_t buffer_limit; +} VasEBoot_PACKED; -struct grub_pxenv_tftp_open +struct VasEBoot_pxenv_tftp_open { - grub_uint16_t status; - grub_uint32_t server_ip; - grub_uint32_t gateway_ip; - grub_uint8_t filename[128]; - grub_uint16_t tftp_port; - grub_uint16_t packet_size; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint32_t server_ip; + VasEBoot_uint32_t gateway_ip; + VasEBoot_uint8_t filename[128]; + VasEBoot_uint16_t tftp_port; + VasEBoot_uint16_t packet_size; +} VasEBoot_PACKED; -struct grub_pxenv_tftp_close +struct VasEBoot_pxenv_tftp_close { - grub_uint16_t status; -} GRUB_PACKED; + VasEBoot_uint16_t status; +} VasEBoot_PACKED; -struct grub_pxenv_tftp_read +struct VasEBoot_pxenv_tftp_read { - grub_uint16_t status; - grub_uint16_t packet_number; - grub_uint16_t buffer_size; - grub_uint32_t buffer; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint16_t packet_number; + VasEBoot_uint16_t buffer_size; + VasEBoot_uint32_t buffer; +} VasEBoot_PACKED; -struct grub_pxenv_tftp_get_fsize +struct VasEBoot_pxenv_tftp_get_fsize { - grub_uint16_t status; - grub_uint32_t server_ip; - grub_uint32_t gateway_ip; - grub_uint8_t filename[128]; - grub_uint32_t file_size; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint32_t server_ip; + VasEBoot_uint32_t gateway_ip; + VasEBoot_uint8_t filename[128]; + VasEBoot_uint32_t file_size; +} VasEBoot_PACKED; -struct grub_pxenv_udp_open +struct VasEBoot_pxenv_udp_open { - grub_uint16_t status; - grub_uint32_t src_ip; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint32_t src_ip; +} VasEBoot_PACKED; -struct grub_pxenv_udp_close +struct VasEBoot_pxenv_udp_close { - grub_uint16_t status; -} GRUB_PACKED; + VasEBoot_uint16_t status; +} VasEBoot_PACKED; -struct grub_pxenv_udp_write +struct VasEBoot_pxenv_udp_write { - grub_uint16_t status; - grub_uint32_t ip; - grub_uint32_t gateway; - grub_uint16_t src_port; - grub_uint16_t dst_port; - grub_uint16_t buffer_size; - grub_uint32_t buffer; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint32_t ip; + VasEBoot_uint32_t gateway; + VasEBoot_uint16_t src_port; + VasEBoot_uint16_t dst_port; + VasEBoot_uint16_t buffer_size; + VasEBoot_uint32_t buffer; +} VasEBoot_PACKED; -struct grub_pxenv_udp_read +struct VasEBoot_pxenv_udp_read { - grub_uint16_t status; - grub_uint32_t src_ip; - grub_uint32_t dst_ip; - grub_uint16_t src_port; - grub_uint16_t dst_port; - grub_uint16_t buffer_size; - grub_uint32_t buffer; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint32_t src_ip; + VasEBoot_uint32_t dst_ip; + VasEBoot_uint16_t src_port; + VasEBoot_uint16_t dst_port; + VasEBoot_uint16_t buffer_size; + VasEBoot_uint32_t buffer; +} VasEBoot_PACKED; -struct grub_pxenv_unload_stack +struct VasEBoot_pxenv_unload_stack { - grub_uint16_t status; - grub_uint8_t reserved[10]; -} GRUB_PACKED; + VasEBoot_uint16_t status; + VasEBoot_uint8_t reserved[10]; +} VasEBoot_PACKED; -int EXPORT_FUNC(grub_pxe_call) (int func, void * data, grub_uint32_t pxe_rm_entry) __attribute__ ((regparm(3))); +int EXPORT_FUNC(VasEBoot_pxe_call) (int func, void * data, VasEBoot_uint32_t pxe_rm_entry) __attribute__ ((regparm(3))); -extern struct grub_pxe_bangpxe *grub_pxe_pxenv; +extern struct VasEBoot_pxe_bangpxe *VasEBoot_pxe_pxenv; void * -grub_pxe_get_cached (grub_uint16_t type); +VasEBoot_pxe_get_cached (VasEBoot_uint16_t type); #endif -#endif /* GRUB_CPU_PXE_H */ +#endif /* VasEBoot_CPU_PXE_H */ diff --git a/include/VasEBoot/i386/pc/time.h b/include/VasEBoot/i386/pc/time.h index e93320f71..00f9bb885 100644 --- a/include/VasEBoot/i386/pc/time.h +++ b/include/VasEBoot/i386/pc/time.h @@ -1,24 +1,24 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_MACHINE_TIME_HEADER #define KERNEL_MACHINE_TIME_HEADER 1 -#include +#include #endif /* ! KERNEL_MACHINE_TIME_HEADER */ diff --git a/include/VasEBoot/i386/pc/vbe.h b/include/VasEBoot/i386/pc/vbe.h index f349b5c2b..38ff22d49 100644 --- a/include/VasEBoot/i386/pc/vbe.h +++ b/include/VasEBoot/i386/pc/vbe.h @@ -1,58 +1,58 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_VBE_MACHINE_HEADER -#define GRUB_VBE_MACHINE_HEADER 1 +#ifndef VasEBoot_VBE_MACHINE_HEADER +#define VasEBoot_VBE_MACHINE_HEADER 1 -#include +#include /* Default video mode to be used. */ -#define GRUB_VBE_DEFAULT_VIDEO_MODE 0x101 +#define VasEBoot_VBE_DEFAULT_VIDEO_MODE 0x101 /* VBE status codes. */ -#define GRUB_VBE_STATUS_OK 0x004f +#define VasEBoot_VBE_STATUS_OK 0x004f -#define GRUB_VBE_CAPABILITY_DACWIDTH (1 << 0) +#define VasEBoot_VBE_CAPABILITY_DACWIDTH (1 << 0) -/* Bits from the GRUB_VBE "mode_attributes" field in the mode info struct. */ -#define GRUB_VBE_MODEATTR_SUPPORTED (1 << 0) -#define GRUB_VBE_MODEATTR_RESERVED_1 (1 << 1) -#define GRUB_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT (1 << 2) -#define GRUB_VBE_MODEATTR_COLOR (1 << 3) -#define GRUB_VBE_MODEATTR_GRAPHICS (1 << 4) -#define GRUB_VBE_MODEATTR_VGA_COMPATIBLE (1 << 5) -#define GRUB_VBE_MODEATTR_VGA_WINDOWED_AVAIL (1 << 6) -#define GRUB_VBE_MODEATTR_LFB_AVAIL (1 << 7) -#define GRUB_VBE_MODEATTR_DOUBLE_SCAN_AVAIL (1 << 8) -#define GRUB_VBE_MODEATTR_INTERLACED_AVAIL (1 << 9) -#define GRUB_VBE_MODEATTR_TRIPLE_BUF_AVAIL (1 << 10) -#define GRUB_VBE_MODEATTR_STEREO_AVAIL (1 << 11) -#define GRUB_VBE_MODEATTR_DUAL_DISPLAY_START (1 << 12) +/* Bits from the VasEBoot_VBE "mode_attributes" field in the mode info struct. */ +#define VasEBoot_VBE_MODEATTR_SUPPORTED (1 << 0) +#define VasEBoot_VBE_MODEATTR_RESERVED_1 (1 << 1) +#define VasEBoot_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT (1 << 2) +#define VasEBoot_VBE_MODEATTR_COLOR (1 << 3) +#define VasEBoot_VBE_MODEATTR_GRAPHICS (1 << 4) +#define VasEBoot_VBE_MODEATTR_VGA_COMPATIBLE (1 << 5) +#define VasEBoot_VBE_MODEATTR_VGA_WINDOWED_AVAIL (1 << 6) +#define VasEBoot_VBE_MODEATTR_LFB_AVAIL (1 << 7) +#define VasEBoot_VBE_MODEATTR_DOUBLE_SCAN_AVAIL (1 << 8) +#define VasEBoot_VBE_MODEATTR_INTERLACED_AVAIL (1 << 9) +#define VasEBoot_VBE_MODEATTR_TRIPLE_BUF_AVAIL (1 << 10) +#define VasEBoot_VBE_MODEATTR_STEREO_AVAIL (1 << 11) +#define VasEBoot_VBE_MODEATTR_DUAL_DISPLAY_START (1 << 12) -/* Values for the GRUB_VBE memory_model field in the mode info struct. */ -#define GRUB_VBE_MEMORY_MODEL_TEXT 0x00 -#define GRUB_VBE_MEMORY_MODEL_CGA 0x01 -#define GRUB_VBE_MEMORY_MODEL_HERCULES 0x02 -#define GRUB_VBE_MEMORY_MODEL_PLANAR 0x03 -#define GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL 0x04 -#define GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256 0x05 -#define GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR 0x06 -#define GRUB_VBE_MEMORY_MODEL_YUV 0x07 +/* Values for the VasEBoot_VBE memory_model field in the mode info struct. */ +#define VasEBoot_VBE_MEMORY_MODEL_TEXT 0x00 +#define VasEBoot_VBE_MEMORY_MODEL_CGA 0x01 +#define VasEBoot_VBE_MEMORY_MODEL_HERCULES 0x02 +#define VasEBoot_VBE_MEMORY_MODEL_PLANAR 0x03 +#define VasEBoot_VBE_MEMORY_MODEL_PACKED_PIXEL 0x04 +#define VasEBoot_VBE_MEMORY_MODEL_NONCHAIN4_256 0x05 +#define VasEBoot_VBE_MEMORY_MODEL_DIRECT_COLOR 0x06 +#define VasEBoot_VBE_MEMORY_MODEL_YUV 0x07 /* Note: @@ -60,173 +60,173 @@ meanings of following structures and how they should be used. I have tried to maintain field name compatibility against specification - while following naming conventions used in GRUB. */ + while following naming conventions used in VasEBoot. */ -typedef grub_uint32_t grub_vbe_farptr_t; -typedef grub_uint32_t grub_vbe_physptr_t; -typedef grub_uint32_t grub_vbe_status_t; +typedef VasEBoot_uint32_t VasEBoot_vbe_farptr_t; +typedef VasEBoot_uint32_t VasEBoot_vbe_physptr_t; +typedef VasEBoot_uint32_t VasEBoot_vbe_status_t; -struct grub_vbe_info_block +struct VasEBoot_vbe_info_block { - grub_uint8_t signature[4]; - grub_uint16_t version; + VasEBoot_uint8_t signature[4]; + VasEBoot_uint16_t version; - grub_vbe_farptr_t oem_string_ptr; - grub_uint32_t capabilities; - grub_vbe_farptr_t video_mode_ptr; - grub_uint16_t total_memory; + VasEBoot_vbe_farptr_t oem_string_ptr; + VasEBoot_uint32_t capabilities; + VasEBoot_vbe_farptr_t video_mode_ptr; + VasEBoot_uint16_t total_memory; - grub_uint16_t oem_software_rev; - grub_vbe_farptr_t oem_vendor_name_ptr; - grub_vbe_farptr_t oem_product_name_ptr; - grub_vbe_farptr_t oem_product_rev_ptr; + VasEBoot_uint16_t oem_software_rev; + VasEBoot_vbe_farptr_t oem_vendor_name_ptr; + VasEBoot_vbe_farptr_t oem_product_name_ptr; + VasEBoot_vbe_farptr_t oem_product_rev_ptr; - grub_uint8_t reserved[222]; + VasEBoot_uint8_t reserved[222]; - grub_uint8_t oem_data[256]; -} GRUB_PACKED; + VasEBoot_uint8_t oem_data[256]; +} VasEBoot_PACKED; -struct grub_vbe_mode_info_block +struct VasEBoot_vbe_mode_info_block { /* Mandatory information for all VBE revisions. */ - grub_uint16_t mode_attributes; - grub_uint8_t win_a_attributes; - grub_uint8_t win_b_attributes; - grub_uint16_t win_granularity; - grub_uint16_t win_size; - grub_uint16_t win_a_segment; - grub_uint16_t win_b_segment; - grub_vbe_farptr_t win_func_ptr; - grub_uint16_t bytes_per_scan_line; + VasEBoot_uint16_t mode_attributes; + VasEBoot_uint8_t win_a_attributes; + VasEBoot_uint8_t win_b_attributes; + VasEBoot_uint16_t win_granularity; + VasEBoot_uint16_t win_size; + VasEBoot_uint16_t win_a_segment; + VasEBoot_uint16_t win_b_segment; + VasEBoot_vbe_farptr_t win_func_ptr; + VasEBoot_uint16_t bytes_per_scan_line; /* Mandatory information for VBE 1.2 and above. */ - grub_uint16_t x_resolution; - grub_uint16_t y_resolution; - grub_uint8_t x_char_size; - grub_uint8_t y_char_size; - grub_uint8_t number_of_planes; - grub_uint8_t bits_per_pixel; - grub_uint8_t number_of_banks; - grub_uint8_t memory_model; - grub_uint8_t bank_size; - grub_uint8_t number_of_image_pages; - grub_uint8_t reserved; + VasEBoot_uint16_t x_resolution; + VasEBoot_uint16_t y_resolution; + VasEBoot_uint8_t x_char_size; + VasEBoot_uint8_t y_char_size; + VasEBoot_uint8_t number_of_planes; + VasEBoot_uint8_t bits_per_pixel; + VasEBoot_uint8_t number_of_banks; + VasEBoot_uint8_t memory_model; + VasEBoot_uint8_t bank_size; + VasEBoot_uint8_t number_of_image_pages; + VasEBoot_uint8_t reserved; /* Direct Color fields (required for direct/6 and YUV/7 memory models). */ - grub_uint8_t red_mask_size; - grub_uint8_t red_field_position; - grub_uint8_t green_mask_size; - grub_uint8_t green_field_position; - grub_uint8_t blue_mask_size; - grub_uint8_t blue_field_position; - grub_uint8_t rsvd_mask_size; - grub_uint8_t rsvd_field_position; - grub_uint8_t direct_color_mode_info; + VasEBoot_uint8_t red_mask_size; + VasEBoot_uint8_t red_field_position; + VasEBoot_uint8_t green_mask_size; + VasEBoot_uint8_t green_field_position; + VasEBoot_uint8_t blue_mask_size; + VasEBoot_uint8_t blue_field_position; + VasEBoot_uint8_t rsvd_mask_size; + VasEBoot_uint8_t rsvd_field_position; + VasEBoot_uint8_t direct_color_mode_info; /* Mandatory information for VBE 2.0 and above. */ - grub_vbe_physptr_t phys_base_addr; - grub_uint32_t reserved2; - grub_uint16_t reserved3; + VasEBoot_vbe_physptr_t phys_base_addr; + VasEBoot_uint32_t reserved2; + VasEBoot_uint16_t reserved3; /* Mandatory information for VBE 3.0 and above. */ - grub_uint16_t lin_bytes_per_scan_line; - grub_uint8_t bnk_number_of_image_pages; - grub_uint8_t lin_number_of_image_pages; - grub_uint8_t lin_red_mask_size; - grub_uint8_t lin_red_field_position; - grub_uint8_t lin_green_mask_size; - grub_uint8_t lin_green_field_position; - grub_uint8_t lin_blue_mask_size; - grub_uint8_t lin_blue_field_position; - grub_uint8_t lin_rsvd_mask_size; - grub_uint8_t lin_rsvd_field_position; - grub_uint32_t max_pixel_clock; + VasEBoot_uint16_t lin_bytes_per_scan_line; + VasEBoot_uint8_t bnk_number_of_image_pages; + VasEBoot_uint8_t lin_number_of_image_pages; + VasEBoot_uint8_t lin_red_mask_size; + VasEBoot_uint8_t lin_red_field_position; + VasEBoot_uint8_t lin_green_mask_size; + VasEBoot_uint8_t lin_green_field_position; + VasEBoot_uint8_t lin_blue_mask_size; + VasEBoot_uint8_t lin_blue_field_position; + VasEBoot_uint8_t lin_rsvd_mask_size; + VasEBoot_uint8_t lin_rsvd_field_position; + VasEBoot_uint32_t max_pixel_clock; /* Reserved field to make structure to be 256 bytes long, VESA BIOS Extension 3.0 Specification says to reserve 189 bytes here but that doesn't make structure to be 256 bytes. So additional one is added here. */ - grub_uint8_t reserved4[189 + 1]; -} GRUB_PACKED; + VasEBoot_uint8_t reserved4[189 + 1]; +} VasEBoot_PACKED; -struct grub_vbe_crtc_info_block +struct VasEBoot_vbe_crtc_info_block { - grub_uint16_t horizontal_total; - grub_uint16_t horizontal_sync_start; - grub_uint16_t horizontal_sync_end; - grub_uint16_t vertical_total; - grub_uint16_t vertical_sync_start; - grub_uint16_t vertical_sync_end; - grub_uint8_t flags; - grub_uint32_t pixel_clock; - grub_uint16_t refresh_rate; - grub_uint8_t reserved[40]; -} GRUB_PACKED; + VasEBoot_uint16_t horizontal_total; + VasEBoot_uint16_t horizontal_sync_start; + VasEBoot_uint16_t horizontal_sync_end; + VasEBoot_uint16_t vertical_total; + VasEBoot_uint16_t vertical_sync_start; + VasEBoot_uint16_t vertical_sync_end; + VasEBoot_uint8_t flags; + VasEBoot_uint32_t pixel_clock; + VasEBoot_uint16_t refresh_rate; + VasEBoot_uint8_t reserved[40]; +} VasEBoot_PACKED; -struct grub_vbe_palette_data +struct VasEBoot_vbe_palette_data { - grub_uint8_t blue; - grub_uint8_t green; - grub_uint8_t red; - grub_uint8_t alignment; -} GRUB_PACKED; + VasEBoot_uint8_t blue; + VasEBoot_uint8_t green; + VasEBoot_uint8_t red; + VasEBoot_uint8_t alignment; +} VasEBoot_PACKED; -struct grub_vbe_flat_panel_info +struct VasEBoot_vbe_flat_panel_info { - grub_uint16_t horizontal_size; - grub_uint16_t vertical_size; - grub_uint16_t panel_type; - grub_uint8_t red_bpp; - grub_uint8_t green_bpp; - grub_uint8_t blue_bpp; - grub_uint8_t reserved_bpp; - grub_uint32_t reserved_offscreen_mem_size; - grub_vbe_farptr_t reserved_offscreen_mem_ptr; + VasEBoot_uint16_t horizontal_size; + VasEBoot_uint16_t vertical_size; + VasEBoot_uint16_t panel_type; + VasEBoot_uint8_t red_bpp; + VasEBoot_uint8_t green_bpp; + VasEBoot_uint8_t blue_bpp; + VasEBoot_uint8_t reserved_bpp; + VasEBoot_uint32_t reserved_offscreen_mem_size; + VasEBoot_vbe_farptr_t reserved_offscreen_mem_ptr; - grub_uint8_t reserved[14]; -} GRUB_PACKED; + VasEBoot_uint8_t reserved[14]; +} VasEBoot_PACKED; /* Prototypes for helper functions. */ /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *controller_info); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_controller_info (struct VasEBoot_vbe_info_block *controller_info); /* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_mode_info (grub_uint32_t mode, - struct grub_vbe_mode_info_block *mode_info); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_mode_info (VasEBoot_uint32_t mode, + struct VasEBoot_vbe_mode_info_block *mode_info); /* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_mode (grub_uint32_t *mode); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_mode (VasEBoot_uint32_t *mode); /* Call VESA BIOS 0x4f05 to set memory window, return status. */ -grub_vbe_status_t -grub_vbe_bios_set_memory_window (grub_uint32_t window, grub_uint32_t position); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_memory_window (VasEBoot_uint32_t window, VasEBoot_uint32_t position); /* Call VESA BIOS 0x4f05 to return memory window, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_memory_window (grub_uint32_t window, - grub_uint32_t *position); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_memory_window (VasEBoot_uint32_t window, + VasEBoot_uint32_t *position); /* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */ -grub_vbe_status_t -grub_vbe_bios_set_scanline_length (grub_uint32_t length); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_set_scanline_length (VasEBoot_uint32_t length); /* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */ -grub_vbe_status_t -grub_vbe_bios_get_scanline_length (grub_uint32_t *length); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_scanline_length (VasEBoot_uint32_t *length); /* Call VESA BIOS 0x4f07 to get display start, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_display_start (grub_uint32_t *x, - grub_uint32_t *y); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_display_start (VasEBoot_uint32_t *x, + VasEBoot_uint32_t *y); -grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *width); +VasEBoot_vbe_status_t VasEBoot_vbe_bios_getset_dac_palette_width (int set, int *width); -#define grub_vbe_bios_get_dac_palette_width(width) grub_vbe_bios_getset_dac_palette_width(0, (width)) -#define grub_vbe_bios_set_dac_palette_width(width) grub_vbe_bios_getset_dac_palette_width(1, (width)) +#define VasEBoot_vbe_bios_get_dac_palette_width(width) VasEBoot_vbe_bios_getset_dac_palette_width(0, (width)) +#define VasEBoot_vbe_bios_set_dac_palette_width(width) VasEBoot_vbe_bios_getset_dac_palette_width(1, (width)) -grub_err_t grub_vbe_probe (struct grub_vbe_info_block *info_block); -grub_err_t grub_vbe_get_video_mode (grub_uint32_t *mode); -grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode, - struct grub_vbe_mode_info_block *mode_info); -grub_vbe_status_t -grub_vbe_bios_get_pm_interface (grub_uint16_t *seg, grub_uint16_t *offset, - grub_uint16_t *length); +VasEBoot_err_t VasEBoot_vbe_probe (struct VasEBoot_vbe_info_block *info_block); +VasEBoot_err_t VasEBoot_vbe_get_video_mode (VasEBoot_uint32_t *mode); +VasEBoot_err_t VasEBoot_vbe_get_video_mode_info (VasEBoot_uint32_t mode, + struct VasEBoot_vbe_mode_info_block *mode_info); +VasEBoot_vbe_status_t +VasEBoot_vbe_bios_get_pm_interface (VasEBoot_uint16_t *seg, VasEBoot_uint16_t *offset, + VasEBoot_uint16_t *length); -#endif /* ! GRUB_VBE_MACHINE_HEADER */ +#endif /* ! VasEBoot_VBE_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/pc/vesa_modes_table.h b/include/VasEBoot/i386/pc/vesa_modes_table.h index 376ca376b..ee183139c 100644 --- a/include/VasEBoot/i386/pc/vesa_modes_table.h +++ b/include/VasEBoot/i386/pc/vesa_modes_table.h @@ -1,19 +1,19 @@ -#ifndef GRUB_VESA_MODE_TABLE_HEADER -#define GRUB_VESA_MODE_TABLE_HEADER 1 +#ifndef VasEBoot_VESA_MODE_TABLE_HEADER +#define VasEBoot_VESA_MODE_TABLE_HEADER 1 -#include +#include -#define GRUB_VESA_MODE_TABLE_START 0x300 -#define GRUB_VESA_MODE_TABLE_END 0x373 +#define VasEBoot_VESA_MODE_TABLE_START 0x300 +#define VasEBoot_VESA_MODE_TABLE_END 0x373 -struct grub_vesa_mode_table_entry { - grub_uint16_t width; - grub_uint16_t height; - grub_uint8_t depth; +struct VasEBoot_vesa_mode_table_entry { + VasEBoot_uint16_t width; + VasEBoot_uint16_t height; + VasEBoot_uint8_t depth; }; -extern struct grub_vesa_mode_table_entry -grub_vesa_mode_table[GRUB_VESA_MODE_TABLE_END - - GRUB_VESA_MODE_TABLE_START + 1]; +extern struct VasEBoot_vesa_mode_table_entry +VasEBoot_vesa_mode_table[VasEBoot_VESA_MODE_TABLE_END + - VasEBoot_VESA_MODE_TABLE_START + 1]; #endif diff --git a/include/VasEBoot/i386/pci.h b/include/VasEBoot/i386/pci.h index dffeb5695..4fac2ea0b 100644 --- a/include/VasEBoot/i386/pci.h +++ b/include/VasEBoot/i386/pci.h @@ -1,105 +1,105 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_PCI_H -#define GRUB_CPU_PCI_H 1 +#ifndef VasEBoot_CPU_PCI_H +#define VasEBoot_CPU_PCI_H 1 -#include -#include +#include +#include -#define GRUB_MACHINE_PCI_IO_BASE 0 -#define GRUB_PCI_ADDR_REG 0xcf8 -#define GRUB_PCI_DATA_REG 0xcfc -#define GRUB_PCI_NUM_BUS 256 -#define GRUB_PCI_NUM_DEVICES 32 +#define VasEBoot_MACHINE_PCI_IO_BASE 0 +#define VasEBoot_PCI_ADDR_REG 0xcf8 +#define VasEBoot_PCI_DATA_REG 0xcfc +#define VasEBoot_PCI_NUM_BUS 256 +#define VasEBoot_PCI_NUM_DEVICES 32 -static inline grub_uint32_t -grub_pci_read (grub_pci_address_t addr) +static inline VasEBoot_uint32_t +VasEBoot_pci_read (VasEBoot_pci_address_t addr) { - grub_outl (addr, GRUB_PCI_ADDR_REG); - return grub_inl (GRUB_PCI_DATA_REG); + VasEBoot_outl (addr, VasEBoot_PCI_ADDR_REG); + return VasEBoot_inl (VasEBoot_PCI_DATA_REG); } -static inline grub_uint16_t -grub_pci_read_word (grub_pci_address_t addr) +static inline VasEBoot_uint16_t +VasEBoot_pci_read_word (VasEBoot_pci_address_t addr) { - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - return grub_inw (GRUB_PCI_DATA_REG + (addr & 3)); + VasEBoot_outl (addr & ~3, VasEBoot_PCI_ADDR_REG); + return VasEBoot_inw (VasEBoot_PCI_DATA_REG + (addr & 3)); } -static inline grub_uint8_t -grub_pci_read_byte (grub_pci_address_t addr) +static inline VasEBoot_uint8_t +VasEBoot_pci_read_byte (VasEBoot_pci_address_t addr) { - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - return grub_inb (GRUB_PCI_DATA_REG + (addr & 3)); + VasEBoot_outl (addr & ~3, VasEBoot_PCI_ADDR_REG); + return VasEBoot_inb (VasEBoot_PCI_DATA_REG + (addr & 3)); } static inline void -grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) +VasEBoot_pci_write (VasEBoot_pci_address_t addr, VasEBoot_uint32_t data) { - grub_outl (addr, GRUB_PCI_ADDR_REG); - grub_outl (data, GRUB_PCI_DATA_REG); + VasEBoot_outl (addr, VasEBoot_PCI_ADDR_REG); + VasEBoot_outl (data, VasEBoot_PCI_DATA_REG); } static inline void -grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) +VasEBoot_pci_write_word (VasEBoot_pci_address_t addr, VasEBoot_uint16_t data) { - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - grub_outw (data, GRUB_PCI_DATA_REG + (addr & 3)); + VasEBoot_outl (addr & ~3, VasEBoot_PCI_ADDR_REG); + VasEBoot_outw (data, VasEBoot_PCI_DATA_REG + (addr & 3)); } static inline void -grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) +VasEBoot_pci_write_byte (VasEBoot_pci_address_t addr, VasEBoot_uint8_t data) { - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); + VasEBoot_outl (addr & ~3, VasEBoot_PCI_ADDR_REG); + VasEBoot_outb (data, VasEBoot_PCI_DATA_REG + (addr & 3)); } -#ifndef GRUB_MACHINE_IEEE1275 +#ifndef VasEBoot_MACHINE_IEEE1275 static inline volatile void * -grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)), - grub_addr_t base, - grub_size_t size __attribute__ ((unused))) +VasEBoot_pci_device_map_range (VasEBoot_pci_device_t dev __attribute__ ((unused)), + VasEBoot_addr_t base, + VasEBoot_size_t size __attribute__ ((unused))) { return (volatile void *) base; } static inline void -grub_pci_device_unmap_range (grub_pci_device_t dev __attribute__ ((unused)), +VasEBoot_pci_device_unmap_range (VasEBoot_pci_device_t dev __attribute__ ((unused)), volatile void *mem __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused))) + VasEBoot_size_t size __attribute__ ((unused))) { } #else volatile void * -grub_pci_device_map_range (grub_pci_device_t dev, - grub_addr_t base, - grub_size_t size); +VasEBoot_pci_device_map_range (VasEBoot_pci_device_t dev, + VasEBoot_addr_t base, + VasEBoot_size_t size); void -grub_pci_device_unmap_range (grub_pci_device_t dev, +VasEBoot_pci_device_unmap_range (VasEBoot_pci_device_t dev, volatile void *mem, - grub_size_t size); + VasEBoot_size_t size); #endif -#endif /* GRUB_CPU_PCI_H */ +#endif /* VasEBoot_CPU_PCI_H */ diff --git a/include/VasEBoot/i386/pit.h b/include/VasEBoot/i386/pit.h index 4bd49d4ca..a1142d7fe 100644 --- a/include/VasEBoot/i386/pit.h +++ b/include/VasEBoot/i386/pit.h @@ -1,39 +1,39 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_PIT_HEADER #define KERNEL_CPU_PIT_HEADER 1 -#include -#include +#include +#include enum { /* The PIT channel value ports. You can write to and read from them. Do not mess with timer 0 or 1. */ - GRUB_PIT_COUNTER_0 = 0x40, - GRUB_PIT_COUNTER_1 = 0x41, - GRUB_PIT_COUNTER_2 = 0x42, + VasEBoot_PIT_COUNTER_0 = 0x40, + VasEBoot_PIT_COUNTER_1 = 0x41, + VasEBoot_PIT_COUNTER_2 = 0x42, /* The PIT control port. You can only write to it. Do not mess with timer 0 or 1. */ - GRUB_PIT_CTRL = 0x43, + VasEBoot_PIT_CTRL = 0x43, /* The speaker port. */ - GRUB_PIT_SPEAKER_PORT = 0x61, + VasEBoot_PIT_SPEAKER_PORT = 0x61, }; @@ -42,62 +42,62 @@ enum { /* If 0, follow state of SPEAKER_DATA bit, otherwise enable output from timer 2. */ - GRUB_PIT_SPK_TMR2 = 0x01, + VasEBoot_PIT_SPK_TMR2 = 0x01, /* If SPEAKER_TMR2 is not set, this provides direct input into the speaker. Otherwise, this enables or disables the output from the timer. */ - GRUB_PIT_SPK_DATA = 0x02, + VasEBoot_PIT_SPK_DATA = 0x02, - GRUB_PIT_SPK_TMR2_LATCH = 0x20 + VasEBoot_PIT_SPK_TMR2_LATCH = 0x20 }; /* The PIT control port. You can only write to it. Do not mess with timer 0 or 1. */ enum { - GRUB_PIT_CTRL_SELECT_MASK = 0xc0, - GRUB_PIT_CTRL_SELECT_0 = 0x00, - GRUB_PIT_CTRL_SELECT_1 = 0x40, - GRUB_PIT_CTRL_SELECT_2 = 0x80, + VasEBoot_PIT_CTRL_SELECT_MASK = 0xc0, + VasEBoot_PIT_CTRL_SELECT_0 = 0x00, + VasEBoot_PIT_CTRL_SELECT_1 = 0x40, + VasEBoot_PIT_CTRL_SELECT_2 = 0x80, /* Read and load control. */ - GRUB_PIT_CTRL_READLOAD_MASK= 0x30, - GRUB_PIT_CTRL_COUNTER_LATCH = 0x00, /* Hold timer value until read. */ - GRUB_PIT_CTRL_READLOAD_LSB = 0x10, /* Read/load the LSB. */ - GRUB_PIT_CTRL_READLOAD_MSB = 0x20, /* Read/load the MSB. */ - GRUB_PIT_CTRL_READLOAD_WORD = 0x30, /* Read/load the LSB then the MSB. */ + VasEBoot_PIT_CTRL_READLOAD_MASK= 0x30, + VasEBoot_PIT_CTRL_COUNTER_LATCH = 0x00, /* Hold timer value until read. */ + VasEBoot_PIT_CTRL_READLOAD_LSB = 0x10, /* Read/load the LSB. */ + VasEBoot_PIT_CTRL_READLOAD_MSB = 0x20, /* Read/load the MSB. */ + VasEBoot_PIT_CTRL_READLOAD_WORD = 0x30, /* Read/load the LSB then the MSB. */ /* Mode control. */ - GRUB_PIT_CTRL_MODE_MASK = 0x0e, + VasEBoot_PIT_CTRL_MODE_MASK = 0x0e, /* Interrupt on terminal count. Setting the mode sets output to low. When counter is set and terminated, output is set to high. */ - GRUB_PIT_CTRL_INTR_ON_TERM = 0x00, + VasEBoot_PIT_CTRL_INTR_ON_TERM = 0x00, /* Programmable one-shot. When loading counter, output is set to high. When counter terminated, output is set to low. Can be triggered again from that point on by setting the gate pin to high. */ - GRUB_PIT_CTRL_PROGR_ONE_SHOT = 0x02, + VasEBoot_PIT_CTRL_PROGR_ONE_SHOT = 0x02, /* Rate generator. Output is low for one period of the counter, and high for the other. */ - GRUB_PIT_CTRL_RATE_GEN = 0x04, + VasEBoot_PIT_CTRL_RATE_GEN = 0x04, /* Square wave generator. Output is low for one half of the period, and high for the other half. */ - GRUB_PIT_CTRL_SQUAREWAVE_GEN = 0x06, + VasEBoot_PIT_CTRL_SQUAREWAVE_GEN = 0x06, /* Software triggered strobe. Setting the mode sets output to high. When counter is set and terminated, output is set to low. */ - GRUB_PIT_CTRL_SOFTSTROBE = 0x08, + VasEBoot_PIT_CTRL_SOFTSTROBE = 0x08, /* Hardware triggered strobe. Like software triggered strobe, but only starts the counter when the gate pin is set to high. */ - GRUB_PIT_CTRL_HARDSTROBE = 0x0a, + VasEBoot_PIT_CTRL_HARDSTROBE = 0x0a, /* Count mode. */ - GRUB_PIT_CTRL_COUNT_MASK = 0x01, - GRUB_PIT_CTRL_COUNT_BINARY = 0x00, /* 16-bit binary counter. */ - GRUB_PIT_CTRL_COUNT_BCD = 0x01 /* 4-decade BCD counter. */ + VasEBoot_PIT_CTRL_COUNT_MASK = 0x01, + VasEBoot_PIT_CTRL_COUNT_BINARY = 0x00, /* 16-bit binary counter. */ + VasEBoot_PIT_CTRL_COUNT_BCD = 0x01 /* 4-decade BCD counter. */ }; #endif /* ! KERNEL_CPU_PIT_HEADER */ diff --git a/include/VasEBoot/i386/pmtimer.h b/include/VasEBoot/i386/pmtimer.h index ac091806a..d478c9312 100644 --- a/include/VasEBoot/i386/pmtimer.h +++ b/include/VasEBoot/i386/pmtimer.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_PMTIMER_HEADER #define KERNEL_CPU_PMTIMER_HEADER 1 -#include -#include +#include +#include /* Preconditions: @@ -30,8 +30,8 @@ * Number of TSC ticks elapsed * 0 on failure. */ -grub_uint64_t -EXPORT_FUNC(grub_pmtimer_wait_count_tsc) (grub_port_t pmtimer, - grub_uint16_t num_pm_ticks); +VasEBoot_uint64_t +EXPORT_FUNC(VasEBoot_pmtimer_wait_count_tsc) (VasEBoot_port_t pmtimer, + VasEBoot_uint16_t num_pm_ticks); #endif diff --git a/include/VasEBoot/i386/qemu/boot.h b/include/VasEBoot/i386/qemu/boot.h index 5f53eabfb..110059382 100644 --- a/include/VasEBoot/i386/qemu/boot.h +++ b/include/VasEBoot/i386/qemu/boot.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BOOT_MACHINE_HEADER -#define GRUB_BOOT_MACHINE_HEADER 1 +#ifndef VasEBoot_BOOT_MACHINE_HEADER +#define VasEBoot_BOOT_MACHINE_HEADER 1 /* The size of boot.img. */ -#define GRUB_BOOT_MACHINE_SIZE (0x100000 - GRUB_BOOT_MACHINE_LINK_ADDR) +#define VasEBoot_BOOT_MACHINE_SIZE (0x100000 - VasEBoot_BOOT_MACHINE_LINK_ADDR) #endif diff --git a/include/VasEBoot/i386/qemu/console.h b/include/VasEBoot/i386/qemu/console.h index 774399a4e..4209618bc 100644 --- a/include/VasEBoot/i386/qemu/console.h +++ b/include/VasEBoot/i386/qemu/console.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/qemu/kernel.h b/include/VasEBoot/i386/qemu/kernel.h index f34206b3a..b1db103f7 100644 --- a/include/VasEBoot/i386/qemu/kernel.h +++ b/include/VasEBoot/i386/qemu/kernel.h @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 +#ifndef VasEBoot_KERNEL_MACHINE_HEADER +#define VasEBoot_KERNEL_MACHINE_HEADER 1 -#include +#include #ifndef ASM_FILE -#include -#include +#include +#include -extern grub_addr_t grub_core_entry_addr; +extern VasEBoot_addr_t VasEBoot_core_entry_addr; -void grub_qemu_init_cirrus (void); +void VasEBoot_qemu_init_cirrus (void); #endif /* ! ASM_FILE */ -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +#endif /* ! VasEBoot_KERNEL_MACHINE_HEADER */ diff --git a/include/VasEBoot/i386/qemu/memory.h b/include/VasEBoot/i386/qemu/memory.h index 8dd6f7c8c..3a488445e 100644 --- a/include/VasEBoot/i386/qemu/memory.h +++ b/include/VasEBoot/i386/qemu/memory.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/qemu/serial.h b/include/VasEBoot/i386/qemu/serial.h index 2d8563414..2dd72f652 100644 --- a/include/VasEBoot/i386/qemu/serial.h +++ b/include/VasEBoot/i386/qemu/serial.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/qemu/time.h b/include/VasEBoot/i386/qemu/time.h index 7177c7488..5eb62e38d 100644 --- a/include/VasEBoot/i386/qemu/time.h +++ b/include/VasEBoot/i386/qemu/time.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/i386/reboot.h b/include/VasEBoot/i386/reboot.h index c2716f3fa..eb3044a73 100644 --- a/include/VasEBoot/i386/reboot.h +++ b/include/VasEBoot/i386/reboot.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_REBOOT_H -#define GRUB_REBOOT_H 1 +#ifndef VasEBoot_REBOOT_H +#define VasEBoot_REBOOT_H 1 #ifndef ASM_FILE -extern grub_uint8_t grub_reboot_end[], grub_reboot_start[]; +extern VasEBoot_uint8_t VasEBoot_reboot_end[], VasEBoot_reboot_start[]; #endif diff --git a/include/VasEBoot/i386/relocator.h b/include/VasEBoot/i386/relocator.h index 2a56c3b54..7f0e88717 100644 --- a/include/VasEBoot/i386/relocator.h +++ b/include/VasEBoot/i386/relocator.h @@ -1,100 +1,100 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RELOCATOR_CPU_HEADER -#define GRUB_RELOCATOR_CPU_HEADER 1 +#ifndef VasEBoot_RELOCATOR_CPU_HEADER +#define VasEBoot_RELOCATOR_CPU_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_relocator32_state +struct VasEBoot_relocator32_state { - grub_uint32_t esp; - grub_uint32_t ebp; - grub_uint32_t eax; - grub_uint32_t ebx; - grub_uint32_t ecx; - grub_uint32_t edx; - grub_uint32_t eip; - grub_uint32_t esi; - grub_uint32_t edi; + VasEBoot_uint32_t esp; + VasEBoot_uint32_t ebp; + VasEBoot_uint32_t eax; + VasEBoot_uint32_t ebx; + VasEBoot_uint32_t ecx; + VasEBoot_uint32_t edx; + VasEBoot_uint32_t eip; + VasEBoot_uint32_t esi; + VasEBoot_uint32_t edi; }; -struct grub_relocator16_state +struct VasEBoot_relocator16_state { - grub_uint16_t cs; - grub_uint16_t ds; - grub_uint16_t es; - grub_uint16_t fs; - grub_uint16_t gs; - grub_uint16_t ss; - grub_uint16_t sp; - grub_uint16_t ip; - grub_uint32_t ebx; - grub_uint32_t edx; - grub_uint32_t esi; - grub_uint32_t ebp; + VasEBoot_uint16_t cs; + VasEBoot_uint16_t ds; + VasEBoot_uint16_t es; + VasEBoot_uint16_t fs; + VasEBoot_uint16_t gs; + VasEBoot_uint16_t ss; + VasEBoot_uint16_t sp; + VasEBoot_uint16_t ip; + VasEBoot_uint32_t ebx; + VasEBoot_uint32_t edx; + VasEBoot_uint32_t esi; + VasEBoot_uint32_t ebp; int a20; }; -struct grub_relocator64_state +struct VasEBoot_relocator64_state { - grub_uint64_t rsp; - grub_uint64_t rax; - grub_uint64_t rbx; - grub_uint64_t rcx; - grub_uint64_t rdx; - grub_uint64_t rip; - grub_uint64_t rsi; - grub_addr_t cr3; + VasEBoot_uint64_t rsp; + VasEBoot_uint64_t rax; + VasEBoot_uint64_t rbx; + VasEBoot_uint64_t rcx; + VasEBoot_uint64_t rdx; + VasEBoot_uint64_t rip; + VasEBoot_uint64_t rsi; + VasEBoot_addr_t cr3; }; -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI #ifdef __x86_64__ -struct grub_relocator64_efi_state +struct VasEBoot_relocator64_efi_state { - grub_uint64_t rax; - grub_uint64_t rbx; - grub_uint64_t rcx; - grub_uint64_t rdx; - grub_uint64_t rip; - grub_uint64_t rsi; + VasEBoot_uint64_t rax; + VasEBoot_uint64_t rbx; + VasEBoot_uint64_t rcx; + VasEBoot_uint64_t rdx; + VasEBoot_uint64_t rip; + VasEBoot_uint64_t rsi; }; #endif #endif -grub_err_t grub_relocator16_boot (struct grub_relocator *rel, - struct grub_relocator16_state state); +VasEBoot_err_t VasEBoot_relocator16_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator16_state state); -grub_err_t grub_relocator32_boot (struct grub_relocator *rel, - struct grub_relocator32_state state, +VasEBoot_err_t VasEBoot_relocator32_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator32_state state, int avoid_efi_bootservices); -grub_err_t grub_relocator64_boot (struct grub_relocator *rel, - struct grub_relocator64_state state, - grub_addr_t min_addr, grub_addr_t max_addr); +VasEBoot_err_t VasEBoot_relocator64_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator64_state state, + VasEBoot_addr_t min_addr, VasEBoot_addr_t max_addr); -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI #ifdef __x86_64__ -grub_err_t grub_relocator64_efi_boot (struct grub_relocator *rel, - struct grub_relocator64_efi_state state); +VasEBoot_err_t VasEBoot_relocator64_efi_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator64_efi_state state); #endif #endif -#endif /* ! GRUB_RELOCATOR_CPU_HEADER */ +#endif /* ! VasEBoot_RELOCATOR_CPU_HEADER */ diff --git a/include/VasEBoot/i386/relocator_private.h b/include/VasEBoot/i386/relocator_private.h index b7c96a664..a85c8fbbc 100644 --- a/include/VasEBoot/i386/relocator_private.h +++ b/include/VasEBoot/i386/relocator_private.h @@ -1 +1 @@ -#define GRUB_RELOCATOR16_STACK_SIZE 4096 +#define VasEBoot_RELOCATOR16_STACK_SIZE 4096 diff --git a/include/VasEBoot/i386/setjmp.h b/include/VasEBoot/i386/setjmp.h index bf959a665..5ff1c6833 100644 --- a/include/VasEBoot/i386/setjmp.h +++ b/include/VasEBoot/i386/setjmp.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -typedef unsigned long grub_jmp_buf[6]; +typedef unsigned long VasEBoot_jmp_buf[6]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE __attribute__ ((cdecl, +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE __attribute__ ((cdecl, regparm (3))); -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn, cdecl, +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn, cdecl, regparm (3))); -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/i386/time.h b/include/VasEBoot/i386/time.h index 842882cf2..a569904b6 100644 --- a/include/VasEBoot/i386/time.h +++ b/include/VasEBoot/i386/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: this can't work until we handle interrupts. */ /* __asm__ __volatile__ ("hlt"); */ diff --git a/include/VasEBoot/i386/tsc.h b/include/VasEBoot/i386/tsc.h index a0aa2c573..a07dc2130 100644 --- a/include/VasEBoot/i386/tsc.h +++ b/include/VasEBoot/i386/tsc.h @@ -1,65 +1,65 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TSC_HEADER #define KERNEL_CPU_TSC_HEADER 1 -#include -#include +#include +#include -void grub_tsc_init (void); +void VasEBoot_tsc_init (void); /* In ms per 2^32 ticks. */ -extern grub_uint32_t EXPORT_VAR(grub_tsc_rate); +extern VasEBoot_uint32_t EXPORT_VAR(VasEBoot_tsc_rate); int -grub_tsc_calibrate_from_xen (void); +VasEBoot_tsc_calibrate_from_xen (void); int -grub_tsc_calibrate_from_efi (void); +VasEBoot_tsc_calibrate_from_efi (void); int -grub_tsc_calibrate_from_pmtimer (void); +VasEBoot_tsc_calibrate_from_pmtimer (void); int -grub_tsc_calibrate_from_pit (void); +VasEBoot_tsc_calibrate_from_pit (void); /* Read the TSC value, which increments with each CPU clock cycle. */ -static __inline grub_uint64_t -grub_get_tsc (void) +static __inline VasEBoot_uint64_t +VasEBoot_get_tsc (void) { - grub_uint32_t lo, hi; - grub_uint32_t a,b,c,d; + VasEBoot_uint32_t lo, hi; + VasEBoot_uint32_t a,b,c,d; /* The CPUID instruction is a 'serializing' instruction, and avoids out-of-order execution of the RDTSC instruction. */ - grub_cpuid (0,a,b,c,d); + VasEBoot_cpuid (0,a,b,c,d); /* Read TSC value. We cannot use "=A", since this would use %rax on x86_64. */ __asm__ __volatile__ ("rdtsc":"=a" (lo), "=d" (hi)); - return (((grub_uint64_t) hi) << 32) | lo; + return (((VasEBoot_uint64_t) hi) << 32) | lo; } static __inline int -grub_cpu_is_tsc_supported (void) +VasEBoot_cpu_is_tsc_supported (void) { -#ifndef GRUB_MACHINE_XEN - grub_uint32_t a,b,c,d; - if (! grub_cpu_is_cpuid_supported ()) +#ifndef VasEBoot_MACHINE_XEN + VasEBoot_uint32_t a,b,c,d; + if (! VasEBoot_cpu_is_cpuid_supported ()) return 0; - grub_cpuid(1,a,b,c,d); + VasEBoot_cpuid(1,a,b,c,d); return (d & (1 << 4)) != 0; #else diff --git a/include/VasEBoot/i386/types.h b/include/VasEBoot/i386/types.h index c20063f31..4f1d843ae 100644 --- a/include/VasEBoot/i386/types.h +++ b/include/VasEBoot/i386/types.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 4 +#define VasEBoot_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 4 +#define VasEBoot_TARGET_SIZEOF_LONG 4 /* i386 is little-endian. */ -#undef GRUB_TARGET_WORDS_BIGENDIAN +#undef VasEBoot_TARGET_WORDS_BIGENDIAN -#define GRUB_HAVE_UNALIGNED_ACCESS 1 +#define VasEBoot_HAVE_UNALIGNED_ACCESS 1 -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/i386/xen/hypercall.h b/include/VasEBoot/i386/xen/hypercall.h index 198ee94af..fdbde3508 100644 --- a/include/VasEBoot/i386/xen/hypercall.h +++ b/include/VasEBoot/i386/xen/hypercall.h @@ -1,85 +1,85 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_XEN_CPU_HYPERCALL_HEADER -#define GRUB_XEN_CPU_HYPERCALL_HEADER 1 +#ifndef VasEBoot_XEN_CPU_HYPERCALL_HEADER +#define VasEBoot_XEN_CPU_HYPERCALL_HEADER 1 -#include +#include int -EXPORT_FUNC (grub_xen_hypercall) (grub_uint32_t callno, grub_uint32_t a0, - grub_uint32_t a1, grub_uint32_t a2, - grub_uint32_t a3, grub_uint32_t a4, - grub_uint32_t a5) +EXPORT_FUNC (VasEBoot_xen_hypercall) (VasEBoot_uint32_t callno, VasEBoot_uint32_t a0, + VasEBoot_uint32_t a1, VasEBoot_uint32_t a2, + VasEBoot_uint32_t a3, VasEBoot_uint32_t a4, + VasEBoot_uint32_t a5) __attribute__ ((regparm (3), cdecl)); static inline int -grub_xen_sched_op (int cmd, void *arg) +VasEBoot_xen_sched_op (int cmd, void *arg) { - return grub_xen_hypercall (__HYPERVISOR_sched_op, cmd, (grub_uint32_t) arg, + return VasEBoot_xen_hypercall (__HYPERVISOR_sched_op, cmd, (VasEBoot_uint32_t) arg, 0, 0, 0, 0); } static inline int -grub_xen_mmu_update (const struct mmu_update *reqs, +VasEBoot_xen_mmu_update (const struct mmu_update *reqs, unsigned count, unsigned *done_out, unsigned foreigndom) { - return grub_xen_hypercall (__HYPERVISOR_mmu_update, (grub_uint32_t) reqs, - (grub_uint32_t) count, (grub_uint32_t) done_out, - (grub_uint32_t) foreigndom, 0, 0); + return VasEBoot_xen_hypercall (__HYPERVISOR_mmu_update, (VasEBoot_uint32_t) reqs, + (VasEBoot_uint32_t) count, (VasEBoot_uint32_t) done_out, + (VasEBoot_uint32_t) foreigndom, 0, 0); } static inline int -grub_xen_mmuext_op (mmuext_op_t * ops, +VasEBoot_xen_mmuext_op (mmuext_op_t * ops, unsigned int count, unsigned int *pdone, unsigned int foreigndom) { - return grub_xen_hypercall (__HYPERVISOR_mmuext_op, (grub_uint32_t) ops, - count, (grub_uint32_t) pdone, foreigndom, 0, 0); + return VasEBoot_xen_hypercall (__HYPERVISOR_mmuext_op, (VasEBoot_uint32_t) ops, + count, (VasEBoot_uint32_t) pdone, foreigndom, 0, 0); } static inline int -grub_xen_event_channel_op (int op, void *arg) +VasEBoot_xen_event_channel_op (int op, void *arg) { - return grub_xen_hypercall (__HYPERVISOR_event_channel_op, op, - (grub_uint32_t) arg, 0, 0, 0, 0); + return VasEBoot_xen_hypercall (__HYPERVISOR_event_channel_op, op, + (VasEBoot_uint32_t) arg, 0, 0, 0, 0); } static inline int -grub_xen_update_va_mapping (void *addr, uint64_t pte, uint32_t flags) +VasEBoot_xen_update_va_mapping (void *addr, uint64_t pte, uint32_t flags) { - return grub_xen_hypercall (__HYPERVISOR_update_va_mapping, - (grub_uint32_t) addr, pte, pte >> 32, flags, 0, + return VasEBoot_xen_hypercall (__HYPERVISOR_update_va_mapping, + (VasEBoot_uint32_t) addr, pte, pte >> 32, flags, 0, 0); } static inline int -grub_xen_grant_table_op (int a, void *b, int c) +VasEBoot_xen_grant_table_op (int a, void *b, int c) { - return grub_xen_hypercall (__HYPERVISOR_grant_table_op, a, - (grub_uint32_t) b, c, 0, 0, 0); + return VasEBoot_xen_hypercall (__HYPERVISOR_grant_table_op, a, + (VasEBoot_uint32_t) b, c, 0, 0, 0); } static inline int -grub_xen_vm_assist (int cmd, int type) +VasEBoot_xen_vm_assist (int cmd, int type) { - return grub_xen_hypercall (__HYPERVISOR_vm_assist, cmd, type, 0, 0, 0, 0); + return VasEBoot_xen_hypercall (__HYPERVISOR_vm_assist, cmd, type, 0, 0, 0, 0); } #endif diff --git a/include/VasEBoot/i386/xnu.h b/include/VasEBoot/i386/xnu.h index 062a7ddbe..1df7eafeb 100644 --- a/include/VasEBoot/i386/xnu.h +++ b/include/VasEBoot/i386/xnu.h @@ -1,149 +1,149 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_XNU_H -#define GRUB_CPU_XNU_H 1 +#ifndef VasEBoot_CPU_XNU_H +#define VasEBoot_CPU_XNU_H 1 -#include -#include -#include +#include +#include +#include -#define XNU_RELOCATOR(x) (grub_relocator32_ ## x) +#define XNU_RELOCATOR(x) (VasEBoot_relocator32_ ## x) -#define GRUB_XNU_PAGESIZE 4096 -typedef grub_uint32_t grub_xnu_ptr_t; +#define VasEBoot_XNU_PAGESIZE 4096 +typedef VasEBoot_uint32_t VasEBoot_xnu_ptr_t; -struct grub_xnu_boot_params_common +struct VasEBoot_xnu_boot_params_common { /* Command line passed to xnu. */ - grub_uint8_t cmdline[1024]; + VasEBoot_uint8_t cmdline[1024]; /* Later are the same as EFI's get_memory_map (). */ - grub_xnu_ptr_t efi_mmap; - grub_uint32_t efi_mmap_size; - grub_uint32_t efi_mem_desc_size; - grub_uint32_t efi_mem_desc_version; + VasEBoot_xnu_ptr_t efi_mmap; + VasEBoot_uint32_t efi_mmap_size; + VasEBoot_uint32_t efi_mem_desc_size; + VasEBoot_uint32_t efi_mem_desc_version; /* Later are video parameters. */ - grub_xnu_ptr_t lfb_base; -#define GRUB_XNU_VIDEO_SPLASH 1 -#define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2 - grub_uint32_t lfb_mode; - grub_uint32_t lfb_line_len; - grub_uint32_t lfb_width; - grub_uint32_t lfb_height; - grub_uint32_t lfb_depth; + VasEBoot_xnu_ptr_t lfb_base; +#define VasEBoot_XNU_VIDEO_SPLASH 1 +#define VasEBoot_XNU_VIDEO_TEXT_IN_VIDEO 2 + VasEBoot_uint32_t lfb_mode; + VasEBoot_uint32_t lfb_line_len; + VasEBoot_uint32_t lfb_width; + VasEBoot_uint32_t lfb_height; + VasEBoot_uint32_t lfb_depth; /* Pointer to device tree and its len. */ - grub_xnu_ptr_t devtree; - grub_uint32_t devtreelen; + VasEBoot_xnu_ptr_t devtree; + VasEBoot_uint32_t devtreelen; /* First used address by kernel or boot structures. */ - grub_xnu_ptr_t heap_start; + VasEBoot_xnu_ptr_t heap_start; /* Last used address by kernel or boot structures minus previous value. */ - grub_uint32_t heap_size; + VasEBoot_uint32_t heap_size; /* First memory page containing runtime code or data. */ - grub_uint32_t efi_runtime_first_page; + VasEBoot_uint32_t efi_runtime_first_page; /* First memory page containing runtime code or data minus previous value. */ - grub_uint32_t efi_runtime_npages; -} GRUB_PACKED; + VasEBoot_uint32_t efi_runtime_npages; +} VasEBoot_PACKED; -struct grub_xnu_boot_params_v1 +struct VasEBoot_xnu_boot_params_v1 { - grub_uint16_t verminor; - grub_uint16_t vermajor; - struct grub_xnu_boot_params_common common; + VasEBoot_uint16_t verminor; + VasEBoot_uint16_t vermajor; + struct VasEBoot_xnu_boot_params_common common; - grub_uint32_t efi_system_table; - /* Size of grub_efi_uintn_t in bits. */ - grub_uint8_t efi_uintnbits; -} GRUB_PACKED; -#define GRUB_XNU_BOOTARGSV1_VERMINOR 5 -#define GRUB_XNU_BOOTARGSV1_VERMAJOR 1 + VasEBoot_uint32_t efi_system_table; + /* Size of VasEBoot_efi_uintn_t in bits. */ + VasEBoot_uint8_t efi_uintnbits; +} VasEBoot_PACKED; +#define VasEBoot_XNU_BOOTARGSV1_VERMINOR 5 +#define VasEBoot_XNU_BOOTARGSV1_VERMAJOR 1 -struct grub_xnu_boot_params_v2 +struct VasEBoot_xnu_boot_params_v2 { - grub_uint16_t verminor; - grub_uint16_t vermajor; + VasEBoot_uint16_t verminor; + VasEBoot_uint16_t vermajor; - /* Size of grub_efi_uintn_t in bits. */ - grub_uint8_t efi_uintnbits; - grub_uint8_t unused[3]; + /* Size of VasEBoot_efi_uintn_t in bits. */ + VasEBoot_uint8_t efi_uintnbits; + VasEBoot_uint8_t unused[3]; - struct grub_xnu_boot_params_common common; + struct VasEBoot_xnu_boot_params_common common; - grub_uint64_t efi_runtime_first_page_virtual; - grub_uint32_t efi_system_table; - grub_uint32_t unused2[9]; - grub_uint64_t ram_size; - grub_uint64_t fsbfreq; - grub_uint32_t unused3[734]; -} GRUB_PACKED; -#define GRUB_XNU_BOOTARGSV2_VERMINOR 0 -#define GRUB_XNU_BOOTARGSV2_VERMAJOR 2 + VasEBoot_uint64_t efi_runtime_first_page_virtual; + VasEBoot_uint32_t efi_system_table; + VasEBoot_uint32_t unused2[9]; + VasEBoot_uint64_t ram_size; + VasEBoot_uint64_t fsbfreq; + VasEBoot_uint32_t unused3[734]; +} VasEBoot_PACKED; +#define VasEBoot_XNU_BOOTARGSV2_VERMINOR 0 +#define VasEBoot_XNU_BOOTARGSV2_VERMAJOR 2 -union grub_xnu_boot_params_any +union VasEBoot_xnu_boot_params_any { - struct grub_xnu_boot_params_v1 v1; - struct grub_xnu_boot_params_v2 v2; + struct VasEBoot_xnu_boot_params_v1 v1; + struct VasEBoot_xnu_boot_params_v2 v2; }; -struct grub_xnu_devprop_header +struct VasEBoot_xnu_devprop_header { - grub_uint32_t length; + VasEBoot_uint32_t length; /* Always set to 1. Version? */ - grub_uint32_t alwaysone; - grub_uint32_t num_devices; + VasEBoot_uint32_t alwaysone; + VasEBoot_uint32_t num_devices; }; -struct grub_xnu_devprop_device_header +struct VasEBoot_xnu_devprop_device_header { - grub_uint32_t length; - grub_uint32_t num_values; + VasEBoot_uint32_t length; + VasEBoot_uint32_t num_values; }; -void grub_cpu_xnu_unload (void); +void VasEBoot_cpu_xnu_unload (void); -struct grub_xnu_devprop_device_descriptor; +struct VasEBoot_xnu_devprop_device_descriptor; -struct grub_xnu_devprop_device_descriptor * -grub_xnu_devprop_add_device (struct grub_efi_device_path *path, int length); -grub_err_t -grub_xnu_devprop_remove_device (struct grub_xnu_devprop_device_descriptor *dev); -grub_err_t -grub_xnu_devprop_remove_property (struct grub_xnu_devprop_device_descriptor *dev, +struct VasEBoot_xnu_devprop_device_descriptor * +VasEBoot_xnu_devprop_add_device (struct VasEBoot_efi_device_path *path, int length); +VasEBoot_err_t +VasEBoot_xnu_devprop_remove_device (struct VasEBoot_xnu_devprop_device_descriptor *dev); +VasEBoot_err_t +VasEBoot_xnu_devprop_remove_property (struct VasEBoot_xnu_devprop_device_descriptor *dev, char *name); -grub_err_t -grub_xnu_devprop_add_property_utf8 (struct grub_xnu_devprop_device_descriptor *dev, +VasEBoot_err_t +VasEBoot_xnu_devprop_add_property_utf8 (struct VasEBoot_xnu_devprop_device_descriptor *dev, char *name, void *data, int datalen); -grub_err_t -grub_xnu_devprop_add_property_utf16 (struct grub_xnu_devprop_device_descriptor *dev, - grub_uint16_t *name, int namelen, +VasEBoot_err_t +VasEBoot_xnu_devprop_add_property_utf16 (struct VasEBoot_xnu_devprop_device_descriptor *dev, + VasEBoot_uint16_t *name, int namelen, void *data, int datalen); -grub_err_t -grub_xnu_devprop_remove_property_utf8 (struct grub_xnu_devprop_device_descriptor *dev, +VasEBoot_err_t +VasEBoot_xnu_devprop_remove_property_utf8 (struct VasEBoot_xnu_devprop_device_descriptor *dev, char *name); -void grub_cpu_xnu_init (void); -void grub_cpu_xnu_fini (void); +void VasEBoot_cpu_xnu_init (void); +void VasEBoot_cpu_xnu_fini (void); -extern grub_uint32_t grub_xnu_entry_point; -extern grub_uint32_t grub_xnu_stack; -extern grub_uint32_t grub_xnu_arg1; -extern char grub_xnu_cmdline[1024]; -grub_err_t grub_xnu_boot (void); +extern VasEBoot_uint32_t VasEBoot_xnu_entry_point; +extern VasEBoot_uint32_t VasEBoot_xnu_stack; +extern VasEBoot_uint32_t VasEBoot_xnu_arg1; +extern char VasEBoot_xnu_cmdline[1024]; +VasEBoot_err_t VasEBoot_xnu_boot (void); #endif diff --git a/include/VasEBoot/ia64/efi/memory.h b/include/VasEBoot/ia64/efi/memory.h index 2c64918e3..ef51aaac7 100644 --- a/include/VasEBoot/ia64/efi/memory.h +++ b/include/VasEBoot/ia64/efi/memory.h @@ -1,6 +1,6 @@ -#ifndef GRUB_MEMORY_CPU_HEADER -#include +#ifndef VasEBoot_MEMORY_CPU_HEADER +#include -#define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffff +#define VasEBoot_EFI_MAX_USABLE_ADDRESS 0xffffffff -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/ia64/efi/time.h b/include/VasEBoot/ia64/efi/time.h index 897ce9c00..dd035f237 100644 --- a/include/VasEBoot/ia64/efi/time.h +++ b/include/VasEBoot/ia64/efi/time.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_TIME_HEADER -#define GRUB_MACHINE_TIME_HEADER 1 +#ifndef VasEBoot_MACHINE_TIME_HEADER +#define VasEBoot_MACHINE_TIME_HEADER 1 -#include +#include -#endif /* ! GRUB_MACHINE_TIME_HEADER */ +#endif /* ! VasEBoot_MACHINE_TIME_HEADER */ diff --git a/include/VasEBoot/ia64/kernel.h b/include/VasEBoot/ia64/kernel.h index c5496a00b..a1f429a83 100644 --- a/include/VasEBoot/ia64/kernel.h +++ b/include/VasEBoot/ia64/kernel.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_KERNEL_HEADER -#define GRUB_CPU_KERNEL_HEADER 1 +#ifndef VasEBoot_CPU_KERNEL_HEADER +#define VasEBoot_CPU_KERNEL_HEADER 1 -#define GRUB_MOD_ALIGN 0x1 -#define GRUB_MOD_GAP 0x0 +#define VasEBoot_MOD_ALIGN 0x1 +#define VasEBoot_MOD_GAP 0x0 -#endif /* ! GRUB_CPU_KERNEL_HEADER */ +#endif /* ! VasEBoot_CPU_KERNEL_HEADER */ diff --git a/include/VasEBoot/ia64/reloc.h b/include/VasEBoot/ia64/reloc.h index 45c8fba27..7d73b0c54 100644 --- a/include/VasEBoot/ia64/reloc.h +++ b/include/VasEBoot/ia64/reloc.h @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_IA64_RELOC_H -#define GRUB_IA64_RELOC_H 1 +#ifndef VasEBoot_IA64_RELOC_H +#define VasEBoot_IA64_RELOC_H 1 -struct grub_ia64_trampoline; +struct VasEBoot_ia64_trampoline; void -grub_ia64_add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value); +VasEBoot_ia64_add_value_to_slot_20b (VasEBoot_addr_t addr, VasEBoot_uint32_t value); void -grub_ia64_add_value_to_slot_21 (grub_addr_t addr, grub_uint32_t value); +VasEBoot_ia64_add_value_to_slot_21 (VasEBoot_addr_t addr, VasEBoot_uint32_t value); void -grub_ia64_set_immu64 (grub_addr_t addr, grub_uint64_t value); +VasEBoot_ia64_set_immu64 (VasEBoot_addr_t addr, VasEBoot_uint64_t value); void -grub_ia64_make_trampoline (struct grub_ia64_trampoline *tr, grub_uint64_t addr); +VasEBoot_ia64_make_trampoline (struct VasEBoot_ia64_trampoline *tr, VasEBoot_uint64_t addr); -struct grub_ia64_trampoline +struct VasEBoot_ia64_trampoline { /* nop.m */ - grub_uint8_t nop[5]; + VasEBoot_uint8_t nop[5]; /* movl r15 = addr*/ - grub_uint8_t addr_hi[6]; - grub_uint8_t e0; - grub_uint8_t addr_lo[4]; - grub_uint8_t jump[0x20]; + VasEBoot_uint8_t addr_hi[6]; + VasEBoot_uint8_t e0; + VasEBoot_uint8_t addr_lo[4]; + VasEBoot_uint8_t jump[0x20]; }; #endif diff --git a/include/VasEBoot/ia64/setjmp.h b/include/VasEBoot/ia64/setjmp.h index 0a6211379..9ad9eec5e 100644 --- a/include/VasEBoot/ia64/setjmp.h +++ b/include/VasEBoot/ia64/setjmp.h @@ -22,7 +22,7 @@ #define _JBLEN 70 /* the __jmp_buf element type should be __float80 per ABI... */ -typedef long grub_jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ +typedef long VasEBoot_jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)); diff --git a/include/VasEBoot/ia64/time.h b/include/VasEBoot/ia64/time.h index 03ee79fa4..eae70818d 100644 --- a/include/VasEBoot/ia64/time.h +++ b/include/VasEBoot/ia64/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007, 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: not implemented */ } diff --git a/include/VasEBoot/ia64/types.h b/include/VasEBoot/ia64/types.h index 91a546dd2..29f7e2175 100644 --- a/include/VasEBoot/ia64/types.h +++ b/include/VasEBoot/ia64/types.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 8 +#define VasEBoot_TARGET_SIZEOF_VOID_P 8 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 8 +#define VasEBoot_TARGET_SIZEOF_LONG 8 /* ia64 is little-endian (usually). */ -#undef GRUB_TARGET_WORDS_BIGENDIAN +#undef VasEBoot_TARGET_WORDS_BIGENDIAN -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/icon_manager.h b/include/VasEBoot/icon_manager.h index 81c488416..09ce7d4c8 100644 --- a/include/VasEBoot/icon_manager.h +++ b/include/VasEBoot/icon_manager.h @@ -1,41 +1,41 @@ /* icon_manager.h - gfxmenu icon manager. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ICON_MANAGER_HEADER -#define GRUB_ICON_MANAGER_HEADER 1 +#ifndef VasEBoot_ICON_MANAGER_HEADER +#define VasEBoot_ICON_MANAGER_HEADER 1 -#include -#include +#include +#include /* Forward declaration of opaque structure handle type. */ -typedef struct grub_gfxmenu_icon_manager *grub_gfxmenu_icon_manager_t; +typedef struct VasEBoot_gfxmenu_icon_manager *VasEBoot_gfxmenu_icon_manager_t; -grub_gfxmenu_icon_manager_t grub_gfxmenu_icon_manager_new (void); -void grub_gfxmenu_icon_manager_destroy (grub_gfxmenu_icon_manager_t mgr); -void grub_gfxmenu_icon_manager_clear_cache (grub_gfxmenu_icon_manager_t mgr); -void grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr, +VasEBoot_gfxmenu_icon_manager_t VasEBoot_gfxmenu_icon_manager_new (void); +void VasEBoot_gfxmenu_icon_manager_destroy (VasEBoot_gfxmenu_icon_manager_t mgr); +void VasEBoot_gfxmenu_icon_manager_clear_cache (VasEBoot_gfxmenu_icon_manager_t mgr); +void VasEBoot_gfxmenu_icon_manager_set_theme_path (VasEBoot_gfxmenu_icon_manager_t mgr, const char *path); -void grub_gfxmenu_icon_manager_set_icon_size (grub_gfxmenu_icon_manager_t mgr, +void VasEBoot_gfxmenu_icon_manager_set_icon_size (VasEBoot_gfxmenu_icon_manager_t mgr, int width, int height); -struct grub_video_bitmap * -grub_gfxmenu_icon_manager_get_icon (grub_gfxmenu_icon_manager_t mgr, - grub_menu_entry_t entry); +struct VasEBoot_video_bitmap * +VasEBoot_gfxmenu_icon_manager_get_icon (VasEBoot_gfxmenu_icon_manager_t mgr, + VasEBoot_menu_entry_t entry); -#endif /* GRUB_ICON_MANAGER_HEADER */ +#endif /* VasEBoot_ICON_MANAGER_HEADER */ diff --git a/include/VasEBoot/ieee1275/console.h b/include/VasEBoot/ieee1275/console.h index bdd98fe06..76471dd0d 100644 --- a/include/VasEBoot/ieee1275/console.h +++ b/include/VasEBoot/ieee1275/console.h @@ -1,34 +1,34 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CONSOLE_MACHINE_HEADER -#define GRUB_CONSOLE_MACHINE_HEADER 1 +#ifndef VasEBoot_CONSOLE_MACHINE_HEADER +#define VasEBoot_CONSOLE_MACHINE_HEADER 1 -#include +#include /* Initialize the console system. */ -void grub_console_init_early (void); -void grub_console_init_lately (void); +void VasEBoot_console_init_early (void); +void VasEBoot_console_init_lately (void); /* Finish the console system. */ -void grub_console_fini (void); +void VasEBoot_console_fini (void); const char * -grub_ofserial_add_port (const char *name); +VasEBoot_ofserial_add_port (const char *name); -#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */ +#endif /* ! VasEBoot_CONSOLE_MACHINE_HEADER */ diff --git a/include/VasEBoot/ieee1275/ieee1275.h b/include/VasEBoot/ieee1275/ieee1275.h index 8e4251303..7a1423827 100644 --- a/include/VasEBoot/ieee1275/ieee1275.h +++ b/include/VasEBoot/ieee1275/ieee1275.h @@ -1,30 +1,30 @@ /* ieee1275.h - Access the Open Firmware client interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_IEEE1275_HEADER -#define GRUB_IEEE1275_HEADER 1 +#ifndef VasEBoot_IEEE1275_HEADER +#define VasEBoot_IEEE1275_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_ieee1275_mem_region +struct VasEBoot_ieee1275_mem_region { unsigned int start; unsigned int size; @@ -34,7 +34,7 @@ struct grub_ieee1275_mem_region #define IEEE1275_MAX_PATH_LEN 256 #ifndef IEEE1275_CALL_ENTRY_FN -#define IEEE1275_CALL_ENTRY_FN(args) (*grub_ieee1275_entry_fn) (args) +#define IEEE1275_CALL_ENTRY_FN(args) (*VasEBoot_ieee1275_entry_fn) (args) #endif /* All backcalls to the firmware is done by calling an entry function @@ -42,203 +42,203 @@ struct grub_ieee1275_mem_region a structure is passed which specifies what the firmware should do. NAME is the requested service. NR_INS and NR_OUTS is the number of passed arguments and the expected number of return values, resp. */ -struct grub_ieee1275_common_hdr +struct VasEBoot_ieee1275_common_hdr { - grub_ieee1275_cell_t name; - grub_ieee1275_cell_t nr_ins; - grub_ieee1275_cell_t nr_outs; + VasEBoot_ieee1275_cell_t name; + VasEBoot_ieee1275_cell_t nr_ins; + VasEBoot_ieee1275_cell_t nr_outs; }; #define INIT_IEEE1275_COMMON(p, xname, xins, xouts) \ - (p)->name = (grub_ieee1275_cell_t) xname; \ - (p)->nr_ins = (grub_ieee1275_cell_t) xins; \ - (p)->nr_outs = (grub_ieee1275_cell_t) xouts + (p)->name = (VasEBoot_ieee1275_cell_t) xname; \ + (p)->nr_ins = (VasEBoot_ieee1275_cell_t) xins; \ + (p)->nr_outs = (VasEBoot_ieee1275_cell_t) xouts -typedef grub_uint32_t grub_ieee1275_ihandle_t; -typedef grub_uint32_t grub_ieee1275_phandle_t; +typedef VasEBoot_uint32_t VasEBoot_ieee1275_ihandle_t; +typedef VasEBoot_uint32_t VasEBoot_ieee1275_phandle_t; -#define GRUB_IEEE1275_PHANDLE_INVALID ((grub_ieee1275_phandle_t) -1) +#define VasEBoot_IEEE1275_PHANDLE_INVALID ((VasEBoot_ieee1275_phandle_t) -1) -struct grub_ieee1275_devalias +struct VasEBoot_ieee1275_devalias { char *name; char *path; char *type; char *parent_path; - grub_ieee1275_phandle_t phandle; - grub_ieee1275_phandle_t parent_dev; + VasEBoot_ieee1275_phandle_t phandle; + VasEBoot_ieee1275_phandle_t parent_dev; }; -extern void (*EXPORT_VAR(grub_ieee1275_net_config)) (const char *dev, +extern void (*EXPORT_VAR(VasEBoot_ieee1275_net_config)) (const char *dev, char **device, char **path, char *bootargs); /* Maps a device alias to a pathname. */ -extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen); -extern grub_ieee1275_ihandle_t EXPORT_VAR(grub_ieee1275_mmu); +extern VasEBoot_ieee1275_phandle_t EXPORT_VAR(VasEBoot_ieee1275_chosen); +extern VasEBoot_ieee1275_ihandle_t EXPORT_VAR(VasEBoot_ieee1275_mmu); #ifdef __i386__ -#define GRUB_IEEE1275_ENTRY_FN_ATTRIBUTE __attribute__ ((regparm(3))) +#define VasEBoot_IEEE1275_ENTRY_FN_ATTRIBUTE __attribute__ ((regparm(3))) #else -#define GRUB_IEEE1275_ENTRY_FN_ATTRIBUTE +#define VasEBoot_IEEE1275_ENTRY_FN_ATTRIBUTE #endif -extern int (* EXPORT_VAR(grub_ieee1275_entry_fn)) (void *) GRUB_IEEE1275_ENTRY_FN_ATTRIBUTE; +extern int (* EXPORT_VAR(VasEBoot_ieee1275_entry_fn)) (void *) VasEBoot_IEEE1275_ENTRY_FN_ATTRIBUTE; /* Static heap, used only if FORCE_CLAIM is set, happens on Open Hack'Ware. Should be in platform-specific header but is used only on PPC anyway. */ -#define GRUB_IEEE1275_STATIC_HEAP_START 0x1000000 -#define GRUB_IEEE1275_STATIC_HEAP_LEN 0x1000000 +#define VasEBoot_IEEE1275_STATIC_HEAP_START 0x1000000 +#define VasEBoot_IEEE1275_STATIC_HEAP_LEN 0x1000000 -enum grub_ieee1275_flag +enum VasEBoot_ieee1275_flag { /* Old World Macintosh firmware fails seek when "dev:0" is opened. */ - GRUB_IEEE1275_FLAG_NO_PARTITION_0, + VasEBoot_IEEE1275_FLAG_NO_PARTITION_0, /* Apple firmware runs in translated mode and requires use of the "map" method. Other firmware runs in untranslated mode and doesn't like "map" calls. */ - GRUB_IEEE1275_FLAG_REAL_MODE, + VasEBoot_IEEE1275_FLAG_REAL_MODE, /* CHRP specifies partitions are numbered from 1 (partition 0 refers to the whole disk). However, CodeGen firmware numbers partitions from 0. */ - GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS, + VasEBoot_IEEE1275_FLAG_0_BASED_PARTITIONS, /* CodeGen firmware does not correctly implement "output-device output" */ - GRUB_IEEE1275_FLAG_BROKEN_OUTPUT, + VasEBoot_IEEE1275_FLAG_BROKEN_OUTPUT, /* OLPC / XO firmware hangs when accessing USB devices. */ - GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY, + VasEBoot_IEEE1275_FLAG_OFDISK_SDCARD_ONLY, /* Open Hack'Ware stops when trying to set colors */ - GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS, + VasEBoot_IEEE1275_FLAG_CANNOT_SET_COLORS, - /* Open Hack'Ware stops when grub_ieee1275_interpret is used. */ - GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, + /* Open Hack'Ware stops when VasEBoot_ieee1275_interpret is used. */ + VasEBoot_IEEE1275_FLAG_CANNOT_INTERPRET, /* Open Hack'Ware has no memory map, just claim what we need. */ - GRUB_IEEE1275_FLAG_FORCE_CLAIM, + VasEBoot_IEEE1275_FLAG_FORCE_CLAIM, /* Open Hack'Ware don't support the ANSI sequence. */ - GRUB_IEEE1275_FLAG_NO_ANSI, + VasEBoot_IEEE1275_FLAG_NO_ANSI, /* OpenFirmware hangs on qemu if one requests any memory below 1.5 MiB. */ - GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM, + VasEBoot_IEEE1275_FLAG_NO_PRE1_5M_CLAIM, /* OLPC / XO firmware has the cursor ON/OFF routines. */ - GRUB_IEEE1275_FLAG_HAS_CURSORONOFF, + VasEBoot_IEEE1275_FLAG_HAS_CURSORONOFF, /* Some PowerMacs claim to use 2 address cells but in fact use only 1. Other PowerMacs claim to use only 1 and really do so. Always assume 1 address cell is used on PowerMacs. */ - GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS, + VasEBoot_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS, - GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS, + VasEBoot_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS, - GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX, + VasEBoot_IEEE1275_FLAG_NO_OFNET_SUFFIX, - GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN, + VasEBoot_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN, - GRUB_IEEE1275_FLAG_BROKEN_REPEAT, + VasEBoot_IEEE1275_FLAG_BROKEN_REPEAT, - GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN, + VasEBoot_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN, }; -extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); -extern void EXPORT_FUNC(grub_ieee1275_set_flag) (enum grub_ieee1275_flag flag); +extern int EXPORT_FUNC(VasEBoot_ieee1275_test_flag) (enum VasEBoot_ieee1275_flag flag); +extern void EXPORT_FUNC(VasEBoot_ieee1275_set_flag) (enum VasEBoot_ieee1275_flag flag); -void EXPORT_FUNC(grub_ieee1275_init) (void); -int EXPORT_FUNC(grub_ieee1275_finddevice) (const char *name, - grub_ieee1275_phandle_t *phandlep); -int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t phandle, +void EXPORT_FUNC(VasEBoot_ieee1275_init) (void); +int EXPORT_FUNC(VasEBoot_ieee1275_finddevice) (const char *name, + VasEBoot_ieee1275_phandle_t *phandlep); +int EXPORT_FUNC(VasEBoot_ieee1275_get_property) (VasEBoot_ieee1275_phandle_t phandle, const char *property, void *buf, - grub_size_t size, - grub_ssize_t *actual); -int EXPORT_FUNC(grub_ieee1275_get_integer_property) (grub_ieee1275_phandle_t phandle, - const char *property, grub_uint32_t *buf, - grub_size_t size, - grub_ssize_t *actual); -int EXPORT_FUNC(grub_ieee1275_next_property) (grub_ieee1275_phandle_t phandle, + VasEBoot_size_t size, + VasEBoot_ssize_t *actual); +int EXPORT_FUNC(VasEBoot_ieee1275_get_integer_property) (VasEBoot_ieee1275_phandle_t phandle, + const char *property, VasEBoot_uint32_t *buf, + VasEBoot_size_t size, + VasEBoot_ssize_t *actual); +int EXPORT_FUNC(VasEBoot_ieee1275_next_property) (VasEBoot_ieee1275_phandle_t phandle, char *prev_prop, char *prop); -int EXPORT_FUNC(grub_ieee1275_get_property_length) - (grub_ieee1275_phandle_t phandle, const char *prop, grub_ssize_t *length); -int EXPORT_FUNC(grub_ieee1275_instance_to_package) - (grub_ieee1275_ihandle_t ihandle, grub_ieee1275_phandle_t *phandlep); -int EXPORT_FUNC(grub_ieee1275_package_to_path) (grub_ieee1275_phandle_t phandle, - char *path, grub_size_t len, - grub_ssize_t *actual); -int EXPORT_FUNC(grub_ieee1275_instance_to_path) - (grub_ieee1275_ihandle_t ihandle, char *path, grub_size_t len, - grub_ssize_t *actual); -int EXPORT_FUNC(grub_ieee1275_write) (grub_ieee1275_ihandle_t ihandle, - const void *buffer, grub_size_t len, - grub_ssize_t *actualp); -int EXPORT_FUNC(grub_ieee1275_read) (grub_ieee1275_ihandle_t ihandle, - void *buffer, grub_size_t len, - grub_ssize_t *actualp); -int EXPORT_FUNC(grub_ieee1275_seek) (grub_ieee1275_ihandle_t ihandle, - grub_disk_addr_t pos, - grub_ssize_t *result); -int EXPORT_FUNC(grub_ieee1275_peer) (grub_ieee1275_phandle_t node, - grub_ieee1275_phandle_t *result); -int EXPORT_FUNC(grub_ieee1275_child) (grub_ieee1275_phandle_t node, - grub_ieee1275_phandle_t *result); -int EXPORT_FUNC(grub_ieee1275_parent) (grub_ieee1275_phandle_t node, - grub_ieee1275_phandle_t *result); -int EXPORT_FUNC(grub_ieee1275_interpret) (const char *command, - grub_ieee1275_cell_t *catch); -int EXPORT_FUNC(grub_ieee1275_enter) (void); -void EXPORT_FUNC(grub_ieee1275_exit) (void) __attribute__ ((noreturn)); -int EXPORT_FUNC(grub_ieee1275_open) (const char *node, - grub_ieee1275_ihandle_t *result); -int EXPORT_FUNC(grub_ieee1275_close) (grub_ieee1275_ihandle_t ihandle); -int EXPORT_FUNC(grub_ieee1275_claim) (grub_addr_t addr, grub_size_t size, - unsigned int align, grub_addr_t *result); -int EXPORT_FUNC(grub_ieee1275_release) (grub_addr_t addr, grub_size_t size); -int EXPORT_FUNC(grub_ieee1275_set_property) (grub_ieee1275_phandle_t phandle, +int EXPORT_FUNC(VasEBoot_ieee1275_get_property_length) + (VasEBoot_ieee1275_phandle_t phandle, const char *prop, VasEBoot_ssize_t *length); +int EXPORT_FUNC(VasEBoot_ieee1275_instance_to_package) + (VasEBoot_ieee1275_ihandle_t ihandle, VasEBoot_ieee1275_phandle_t *phandlep); +int EXPORT_FUNC(VasEBoot_ieee1275_package_to_path) (VasEBoot_ieee1275_phandle_t phandle, + char *path, VasEBoot_size_t len, + VasEBoot_ssize_t *actual); +int EXPORT_FUNC(VasEBoot_ieee1275_instance_to_path) + (VasEBoot_ieee1275_ihandle_t ihandle, char *path, VasEBoot_size_t len, + VasEBoot_ssize_t *actual); +int EXPORT_FUNC(VasEBoot_ieee1275_write) (VasEBoot_ieee1275_ihandle_t ihandle, + const void *buffer, VasEBoot_size_t len, + VasEBoot_ssize_t *actualp); +int EXPORT_FUNC(VasEBoot_ieee1275_read) (VasEBoot_ieee1275_ihandle_t ihandle, + void *buffer, VasEBoot_size_t len, + VasEBoot_ssize_t *actualp); +int EXPORT_FUNC(VasEBoot_ieee1275_seek) (VasEBoot_ieee1275_ihandle_t ihandle, + VasEBoot_disk_addr_t pos, + VasEBoot_ssize_t *result); +int EXPORT_FUNC(VasEBoot_ieee1275_peer) (VasEBoot_ieee1275_phandle_t node, + VasEBoot_ieee1275_phandle_t *result); +int EXPORT_FUNC(VasEBoot_ieee1275_child) (VasEBoot_ieee1275_phandle_t node, + VasEBoot_ieee1275_phandle_t *result); +int EXPORT_FUNC(VasEBoot_ieee1275_parent) (VasEBoot_ieee1275_phandle_t node, + VasEBoot_ieee1275_phandle_t *result); +int EXPORT_FUNC(VasEBoot_ieee1275_interpret) (const char *command, + VasEBoot_ieee1275_cell_t *catch); +int EXPORT_FUNC(VasEBoot_ieee1275_enter) (void); +void EXPORT_FUNC(VasEBoot_ieee1275_exit) (void) __attribute__ ((noreturn)); +int EXPORT_FUNC(VasEBoot_ieee1275_open) (const char *node, + VasEBoot_ieee1275_ihandle_t *result); +int EXPORT_FUNC(VasEBoot_ieee1275_close) (VasEBoot_ieee1275_ihandle_t ihandle); +int EXPORT_FUNC(VasEBoot_ieee1275_claim) (VasEBoot_addr_t addr, VasEBoot_size_t size, + unsigned int align, VasEBoot_addr_t *result); +int EXPORT_FUNC(VasEBoot_ieee1275_release) (VasEBoot_addr_t addr, VasEBoot_size_t size); +int EXPORT_FUNC(VasEBoot_ieee1275_set_property) (VasEBoot_ieee1275_phandle_t phandle, const char *propname, const void *buf, - grub_size_t size, - grub_ssize_t *actual); -int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle, + VasEBoot_size_t size, + VasEBoot_ssize_t *actual); +int EXPORT_FUNC(VasEBoot_ieee1275_set_color) (VasEBoot_ieee1275_ihandle_t ihandle, int index, int r, int g, int b); -int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs); +int EXPORT_FUNC(VasEBoot_ieee1275_milliseconds) (VasEBoot_uint32_t *msecs); -grub_err_t EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_claimmap) (VasEBoot_addr_t addr, VasEBoot_size_t size); int -EXPORT_FUNC(grub_ieee1275_map) (grub_addr_t phys, grub_addr_t virt, - grub_size_t size, grub_uint32_t mode); +EXPORT_FUNC(VasEBoot_ieee1275_map) (VasEBoot_addr_t phys, VasEBoot_addr_t virt, + VasEBoot_size_t size, VasEBoot_uint32_t mode); -char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path); -char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path); -int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook) - (struct grub_ieee1275_devalias * +char *EXPORT_FUNC(VasEBoot_ieee1275_encode_devname) (const char *path); +char *EXPORT_FUNC(VasEBoot_ieee1275_get_filename) (const char *path); +int EXPORT_FUNC(VasEBoot_ieee1275_devices_iterate) (int (*hook) + (struct VasEBoot_ieee1275_devalias * alias)); -char *EXPORT_FUNC(grub_ieee1275_get_aliasdevname) (const char *path); -char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path); -char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path); -char *EXPORT_FUNC(grub_ieee1275_get_devname) (const char *path); +char *EXPORT_FUNC(VasEBoot_ieee1275_get_aliasdevname) (const char *path); +char *EXPORT_FUNC(VasEBoot_ieee1275_canonicalise_devname) (const char *path); +char *EXPORT_FUNC(VasEBoot_ieee1275_get_device_type) (const char *path); +char *EXPORT_FUNC(VasEBoot_ieee1275_get_devname) (const char *path); -void EXPORT_FUNC(grub_ieee1275_devalias_init_iterator) (struct grub_ieee1275_devalias *alias); -void EXPORT_FUNC(grub_ieee1275_devalias_free) (struct grub_ieee1275_devalias *alias); -int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *alias); -void EXPORT_FUNC(grub_ieee1275_children_peer) (struct grub_ieee1275_devalias *alias); -void EXPORT_FUNC(grub_ieee1275_children_first) (const char *devpath, - struct grub_ieee1275_devalias *alias); +void EXPORT_FUNC(VasEBoot_ieee1275_devalias_init_iterator) (struct VasEBoot_ieee1275_devalias *alias); +void EXPORT_FUNC(VasEBoot_ieee1275_devalias_free) (struct VasEBoot_ieee1275_devalias *alias); +int EXPORT_FUNC(VasEBoot_ieee1275_devalias_next) (struct VasEBoot_ieee1275_devalias *alias); +void EXPORT_FUNC(VasEBoot_ieee1275_children_peer) (struct VasEBoot_ieee1275_devalias *alias); +void EXPORT_FUNC(VasEBoot_ieee1275_children_first) (const char *devpath, + struct VasEBoot_ieee1275_devalias *alias); -#define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) +#define FOR_IEEE1275_DEVALIASES(alias) for (VasEBoot_ieee1275_devalias_init_iterator (&(alias)); VasEBoot_ieee1275_devalias_next (&(alias));) -#define FOR_IEEE1275_DEVCHILDREN(devpath, alias) for (grub_ieee1275_children_first ((devpath), &(alias)); \ +#define FOR_IEEE1275_DEVCHILDREN(devpath, alias) for (VasEBoot_ieee1275_children_first ((devpath), &(alias)); \ (alias).name; \ - grub_ieee1275_children_peer (&(alias))) + VasEBoot_ieee1275_children_peer (&(alias))) -#endif /* ! GRUB_IEEE1275_HEADER */ +#endif /* ! VasEBoot_IEEE1275_HEADER */ diff --git a/include/VasEBoot/ieee1275/ofdisk.h b/include/VasEBoot/ieee1275/ofdisk.h index 2f69e3f19..1d8c2885d 100644 --- a/include/VasEBoot/ieee1275/ofdisk.h +++ b/include/VasEBoot/ieee1275/ofdisk.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_OFDISK_HEADER -#define GRUB_OFDISK_HEADER 1 +#ifndef VasEBoot_OFDISK_HEADER +#define VasEBoot_OFDISK_HEADER 1 -extern void grub_ofdisk_init (void); -extern void grub_ofdisk_fini (void); +extern void VasEBoot_ofdisk_init (void); +extern void VasEBoot_ofdisk_fini (void); -#endif /* ! GRUB_INIT_HEADER */ +#endif /* ! VasEBoot_INIT_HEADER */ diff --git a/include/VasEBoot/kernel.h b/include/VasEBoot/kernel.h index 20ddf2da2..63c4ffef5 100644 --- a/include/VasEBoot/kernel.h +++ b/include/VasEBoot/kernel.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_HEADER -#define GRUB_KERNEL_HEADER 1 +#ifndef VasEBoot_KERNEL_HEADER +#define VasEBoot_KERNEL_HEADER 1 -#include -#include +#include +#include enum { @@ -32,97 +32,97 @@ enum }; /* The module header. */ -struct grub_module_header +struct VasEBoot_module_header { /* The type of object. */ - grub_uint32_t type; + VasEBoot_uint32_t type; /* The size of object (including this header). */ - grub_uint32_t size; + VasEBoot_uint32_t size; }; -/* "gmim" (GRUB Module Info Magic). */ -#define GRUB_MODULE_MAGIC 0x676d696d +/* "gmim" (VasEBoot Module Info Magic). */ +#define VasEBoot_MODULE_MAGIC 0x676d696d -struct grub_module_info32 +struct VasEBoot_module_info32 { /* Magic number so we know we have modules present. */ - grub_uint32_t magic; + VasEBoot_uint32_t magic; /* The offset of the modules. */ - grub_uint32_t offset; + VasEBoot_uint32_t offset; /* The size of all modules plus this header. */ - grub_uint32_t size; + VasEBoot_uint32_t size; }; -struct grub_module_info64 +struct VasEBoot_module_info64 { /* Magic number so we know we have modules present. */ - grub_uint32_t magic; - grub_uint32_t padding; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t padding; /* The offset of the modules. */ - grub_uint64_t offset; + VasEBoot_uint64_t offset; /* The size of all modules plus this header. */ - grub_uint64_t size; + VasEBoot_uint64_t size; }; -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL /* Space isn't reusable on some platforms. */ /* On Qemu the preload space is readonly. */ /* On emu there is no preload space. */ /* On ieee1275 our code assumes that heap is p=v which isn't guaranteed for module space. */ -#if defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_EMU) \ - || defined (GRUB_MACHINE_EFI) \ - || (defined (GRUB_MACHINE_IEEE1275) && !defined (__sparc__)) -#define GRUB_KERNEL_PRELOAD_SPACE_REUSABLE 0 +#if defined (VasEBoot_MACHINE_QEMU) || defined (VasEBoot_MACHINE_EMU) \ + || defined (VasEBoot_MACHINE_EFI) \ + || (defined (VasEBoot_MACHINE_IEEE1275) && !defined (__sparc__)) +#define VasEBoot_KERNEL_PRELOAD_SPACE_REUSABLE 0 #endif -#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) \ - || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) \ - || defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_ARC) \ - || (defined (__sparc__) && defined (GRUB_MACHINE_IEEE1275)) || defined (GRUB_MACHINE_UBOOT) || defined (GRUB_MACHINE_XEN) +#if defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_COREBOOT) \ + || defined (VasEBoot_MACHINE_MULTIBOOT) || defined (VasEBoot_MACHINE_MIPS_QEMU_MIPS) \ + || defined (VasEBoot_MACHINE_MIPS_LOONGSON) || defined (VasEBoot_MACHINE_ARC) \ + || (defined (__sparc__) && defined (VasEBoot_MACHINE_IEEE1275)) || defined (VasEBoot_MACHINE_UBOOT) || defined (VasEBoot_MACHINE_XEN) /* FIXME: stack is between 2 heap regions. Move it. */ -#define GRUB_KERNEL_PRELOAD_SPACE_REUSABLE 1 +#define VasEBoot_KERNEL_PRELOAD_SPACE_REUSABLE 1 #endif -#ifndef GRUB_KERNEL_PRELOAD_SPACE_REUSABLE +#ifndef VasEBoot_KERNEL_PRELOAD_SPACE_REUSABLE #error "Please check if preload space is reusable on this platform!" #endif -#if GRUB_TARGET_SIZEOF_VOID_P == 8 -#define grub_module_info grub_module_info64 +#if VasEBoot_TARGET_SIZEOF_VOID_P == 8 +#define VasEBoot_module_info VasEBoot_module_info64 #else -#define grub_module_info grub_module_info32 +#define VasEBoot_module_info VasEBoot_module_info32 #endif -extern grub_addr_t EXPORT_VAR (grub_modbase); +extern VasEBoot_addr_t EXPORT_VAR (VasEBoot_modbase); #define FOR_MODULES(var) for (\ - var = (grub_modbase && ((((struct grub_module_info *) grub_modbase)->magic) == GRUB_MODULE_MAGIC)) ? (struct grub_module_header *) \ - (grub_modbase + (((struct grub_module_info *) grub_modbase)->offset)) : 0;\ - var && (grub_addr_t) var \ - < (grub_modbase + (((struct grub_module_info *) grub_modbase)->size)); \ - var = (struct grub_module_header *) \ - (((grub_uint32_t *) var) + ((((struct grub_module_header *) var)->size + sizeof (grub_addr_t) - 1) / sizeof (grub_addr_t)) * (sizeof (grub_addr_t) / sizeof (grub_uint32_t)))) + var = (VasEBoot_modbase && ((((struct VasEBoot_module_info *) VasEBoot_modbase)->magic) == VasEBoot_MODULE_MAGIC)) ? (struct VasEBoot_module_header *) \ + (VasEBoot_modbase + (((struct VasEBoot_module_info *) VasEBoot_modbase)->offset)) : 0;\ + var && (VasEBoot_addr_t) var \ + < (VasEBoot_modbase + (((struct VasEBoot_module_info *) VasEBoot_modbase)->size)); \ + var = (struct VasEBoot_module_header *) \ + (((VasEBoot_uint32_t *) var) + ((((struct VasEBoot_module_header *) var)->size + sizeof (VasEBoot_addr_t) - 1) / sizeof (VasEBoot_addr_t)) * (sizeof (VasEBoot_addr_t) / sizeof (VasEBoot_uint32_t)))) -grub_addr_t grub_modules_get_end (void); +VasEBoot_addr_t VasEBoot_modules_get_end (void); #endif /* The start point of the C code. */ -void grub_main (void) __attribute__ ((noreturn)); +void VasEBoot_main (void) __attribute__ ((noreturn)); /* The machine-specific initialization. This must initialize memory. */ -void grub_machine_init (void); +void VasEBoot_machine_init (void); /* The machine-specific finalization. */ -void EXPORT_FUNC(grub_machine_fini) (int flags); +void EXPORT_FUNC(VasEBoot_machine_fini) (int flags); /* The machine-specific prefix initialization. */ void -grub_machine_get_bootlocation (char **device, char **path); +VasEBoot_machine_get_bootlocation (char **device, char **path); /* Register all the exported symbols. This is automatically generated. */ -void grub_register_exported_symbols (void); +void VasEBoot_register_exported_symbols (void); -extern void (*EXPORT_VAR(grub_net_poll_cards_idle)) (void); +extern void (*EXPORT_VAR(VasEBoot_net_poll_cards_idle)) (void); -#endif /* ! GRUB_KERNEL_HEADER */ +#endif /* ! VasEBoot_KERNEL_HEADER */ diff --git a/include/VasEBoot/keyboard_layouts.h b/include/VasEBoot/keyboard_layouts.h index 1bad286f9..f981b6c5a 100644 --- a/include/VasEBoot/keyboard_layouts.h +++ b/include/VasEBoot/keyboard_layouts.h @@ -1,150 +1,150 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KEYBOARD_LAYOUTS_H -#define GRUB_KEYBOARD_LAYOUTS_H 1 +#ifndef VasEBoot_KEYBOARD_LAYOUTS_H +#define VasEBoot_KEYBOARD_LAYOUTS_H 1 -#define GRUB_KEYBOARD_LAYOUTS_FILEMAGIC "GRUBLAYO" -#define GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE (sizeof(GRUB_KEYBOARD_LAYOUTS_FILEMAGIC) - 1) -#define GRUB_KEYBOARD_LAYOUTS_VERSION 10 +#define VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC "VasEBootLAYO" +#define VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE (sizeof(VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC) - 1) +#define VasEBoot_KEYBOARD_LAYOUTS_VERSION 10 -#define GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE 160 +#define VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE 160 -struct grub_keyboard_layout +struct VasEBoot_keyboard_layout { - grub_uint32_t keyboard_map[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE]; - grub_uint32_t keyboard_map_shift[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE]; - grub_uint32_t keyboard_map_l3[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE]; - grub_uint32_t keyboard_map_shift_l3[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE]; + VasEBoot_uint32_t keyboard_map[VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE]; + VasEBoot_uint32_t keyboard_map_shift[VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE]; + VasEBoot_uint32_t keyboard_map_l3[VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE]; + VasEBoot_uint32_t keyboard_map_shift_l3[VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE]; }; -typedef enum grub_keyboard_key +typedef enum VasEBoot_keyboard_key { - GRUB_KEYBOARD_KEY_A = 0x04, - GRUB_KEYBOARD_KEY_B = 0x05, - GRUB_KEYBOARD_KEY_C = 0x06, - GRUB_KEYBOARD_KEY_D = 0x07, - GRUB_KEYBOARD_KEY_E = 0x08, - GRUB_KEYBOARD_KEY_F = 0x09, - GRUB_KEYBOARD_KEY_G = 0x0a, - GRUB_KEYBOARD_KEY_H = 0x0b, - GRUB_KEYBOARD_KEY_I = 0x0c, - GRUB_KEYBOARD_KEY_J = 0x0d, - GRUB_KEYBOARD_KEY_K = 0x0e, - GRUB_KEYBOARD_KEY_L = 0x0f, - GRUB_KEYBOARD_KEY_M = 0x10, - GRUB_KEYBOARD_KEY_N = 0x11, - GRUB_KEYBOARD_KEY_O = 0x12, - GRUB_KEYBOARD_KEY_P = 0x13, - GRUB_KEYBOARD_KEY_Q = 0x14, - GRUB_KEYBOARD_KEY_R = 0x15, - GRUB_KEYBOARD_KEY_S = 0x16, - GRUB_KEYBOARD_KEY_T = 0x17, - GRUB_KEYBOARD_KEY_U = 0x18, - GRUB_KEYBOARD_KEY_V = 0x19, - GRUB_KEYBOARD_KEY_W = 0x1a, - GRUB_KEYBOARD_KEY_X = 0x1b, - GRUB_KEYBOARD_KEY_Y = 0x1c, - GRUB_KEYBOARD_KEY_Z = 0x1d, - GRUB_KEYBOARD_KEY_1 = 0x1e, - GRUB_KEYBOARD_KEY_2 = 0x1f, - GRUB_KEYBOARD_KEY_3 = 0x20, - GRUB_KEYBOARD_KEY_4 = 0x21, - GRUB_KEYBOARD_KEY_5 = 0x22, - GRUB_KEYBOARD_KEY_6 = 0x23, - GRUB_KEYBOARD_KEY_7 = 0x24, - GRUB_KEYBOARD_KEY_8 = 0x25, - GRUB_KEYBOARD_KEY_9 = 0x26, - GRUB_KEYBOARD_KEY_0 = 0x27, - GRUB_KEYBOARD_KEY_ENTER = 0x28, - GRUB_KEYBOARD_KEY_ESCAPE = 0x29, - GRUB_KEYBOARD_KEY_BACKSPACE = 0x2a, - GRUB_KEYBOARD_KEY_TAB = 0x2b, - GRUB_KEYBOARD_KEY_SPACE = 0x2c, - GRUB_KEYBOARD_KEY_DASH = 0x2d, - GRUB_KEYBOARD_KEY_EQUAL = 0x2e, - GRUB_KEYBOARD_KEY_LBRACKET = 0x2f, - GRUB_KEYBOARD_KEY_RBRACKET = 0x30, - GRUB_KEYBOARD_KEY_BACKSLASH = 0x32, - GRUB_KEYBOARD_KEY_SEMICOLON = 0x33, - GRUB_KEYBOARD_KEY_DQUOTE = 0x34, - GRUB_KEYBOARD_KEY_RQUOTE = 0x35, - GRUB_KEYBOARD_KEY_COMMA = 0x36, - GRUB_KEYBOARD_KEY_DOT = 0x37, - GRUB_KEYBOARD_KEY_SLASH = 0x38, - GRUB_KEYBOARD_KEY_CAPS_LOCK = 0x39, - GRUB_KEYBOARD_KEY_F1 = 0x3a, - GRUB_KEYBOARD_KEY_F2 = 0x3b, - GRUB_KEYBOARD_KEY_F3 = 0x3c, - GRUB_KEYBOARD_KEY_F4 = 0x3d, - GRUB_KEYBOARD_KEY_F5 = 0x3e, - GRUB_KEYBOARD_KEY_F6 = 0x3f, - GRUB_KEYBOARD_KEY_F7 = 0x40, - GRUB_KEYBOARD_KEY_F8 = 0x41, - GRUB_KEYBOARD_KEY_F9 = 0x42, - GRUB_KEYBOARD_KEY_F10 = 0x43, - GRUB_KEYBOARD_KEY_F11 = 0x44, - GRUB_KEYBOARD_KEY_F12 = 0x45, - GRUB_KEYBOARD_KEY_SCROLL_LOCK = 0x47, - GRUB_KEYBOARD_KEY_INSERT = 0x49, - GRUB_KEYBOARD_KEY_HOME = 0x4a, - GRUB_KEYBOARD_KEY_PPAGE = 0x4b, - GRUB_KEYBOARD_KEY_DELETE = 0x4c, - GRUB_KEYBOARD_KEY_END = 0x4d, - GRUB_KEYBOARD_KEY_NPAGE = 0x4e, - GRUB_KEYBOARD_KEY_RIGHT = 0x4f, - GRUB_KEYBOARD_KEY_LEFT = 0x50, - GRUB_KEYBOARD_KEY_DOWN = 0x51, - GRUB_KEYBOARD_KEY_UP = 0x52, - GRUB_KEYBOARD_KEY_NUM_LOCK = 0x53, - GRUB_KEYBOARD_KEY_NUMSLASH = 0x54, - GRUB_KEYBOARD_KEY_NUMMUL = 0x55, - GRUB_KEYBOARD_KEY_NUMMINUS = 0x56, - GRUB_KEYBOARD_KEY_NUMPLUS = 0x57, - GRUB_KEYBOARD_KEY_NUMENTER = 0x58, - GRUB_KEYBOARD_KEY_NUM1 = 0x59, - GRUB_KEYBOARD_KEY_NUM2 = 0x5a, - GRUB_KEYBOARD_KEY_NUM3 = 0x5b, - GRUB_KEYBOARD_KEY_NUM4 = 0x5c, - GRUB_KEYBOARD_KEY_NUM5 = 0x5d, - GRUB_KEYBOARD_KEY_NUM6 = 0x5e, - GRUB_KEYBOARD_KEY_NUM7 = 0x5f, - GRUB_KEYBOARD_KEY_NUM8 = 0x60, - GRUB_KEYBOARD_KEY_NUM9 = 0x61, - GRUB_KEYBOARD_KEY_NUM0 = 0x62, - GRUB_KEYBOARD_KEY_NUMDOT = 0x63, - GRUB_KEYBOARD_KEY_102ND = 0x64, - GRUB_KEYBOARD_KEY_KPCOMMA = 0x85, - GRUB_KEYBOARD_KEY_JP_RO = 0x87, - GRUB_KEYBOARD_KEY_JP_YEN = 0x89, - GRUB_KEYBOARD_KEY_LEFT_CTRL = 0xe0, - GRUB_KEYBOARD_KEY_LEFT_SHIFT = 0xe1, - GRUB_KEYBOARD_KEY_LEFT_ALT = 0xe2, - GRUB_KEYBOARD_KEY_RIGHT_CTRL = 0xe4, - GRUB_KEYBOARD_KEY_RIGHT_SHIFT = 0xe5, - GRUB_KEYBOARD_KEY_RIGHT_ALT = 0xe6, - } grub_keyboard_key_t; + VasEBoot_KEYBOARD_KEY_A = 0x04, + VasEBoot_KEYBOARD_KEY_B = 0x05, + VasEBoot_KEYBOARD_KEY_C = 0x06, + VasEBoot_KEYBOARD_KEY_D = 0x07, + VasEBoot_KEYBOARD_KEY_E = 0x08, + VasEBoot_KEYBOARD_KEY_F = 0x09, + VasEBoot_KEYBOARD_KEY_G = 0x0a, + VasEBoot_KEYBOARD_KEY_H = 0x0b, + VasEBoot_KEYBOARD_KEY_I = 0x0c, + VasEBoot_KEYBOARD_KEY_J = 0x0d, + VasEBoot_KEYBOARD_KEY_K = 0x0e, + VasEBoot_KEYBOARD_KEY_L = 0x0f, + VasEBoot_KEYBOARD_KEY_M = 0x10, + VasEBoot_KEYBOARD_KEY_N = 0x11, + VasEBoot_KEYBOARD_KEY_O = 0x12, + VasEBoot_KEYBOARD_KEY_P = 0x13, + VasEBoot_KEYBOARD_KEY_Q = 0x14, + VasEBoot_KEYBOARD_KEY_R = 0x15, + VasEBoot_KEYBOARD_KEY_S = 0x16, + VasEBoot_KEYBOARD_KEY_T = 0x17, + VasEBoot_KEYBOARD_KEY_U = 0x18, + VasEBoot_KEYBOARD_KEY_V = 0x19, + VasEBoot_KEYBOARD_KEY_W = 0x1a, + VasEBoot_KEYBOARD_KEY_X = 0x1b, + VasEBoot_KEYBOARD_KEY_Y = 0x1c, + VasEBoot_KEYBOARD_KEY_Z = 0x1d, + VasEBoot_KEYBOARD_KEY_1 = 0x1e, + VasEBoot_KEYBOARD_KEY_2 = 0x1f, + VasEBoot_KEYBOARD_KEY_3 = 0x20, + VasEBoot_KEYBOARD_KEY_4 = 0x21, + VasEBoot_KEYBOARD_KEY_5 = 0x22, + VasEBoot_KEYBOARD_KEY_6 = 0x23, + VasEBoot_KEYBOARD_KEY_7 = 0x24, + VasEBoot_KEYBOARD_KEY_8 = 0x25, + VasEBoot_KEYBOARD_KEY_9 = 0x26, + VasEBoot_KEYBOARD_KEY_0 = 0x27, + VasEBoot_KEYBOARD_KEY_ENTER = 0x28, + VasEBoot_KEYBOARD_KEY_ESCAPE = 0x29, + VasEBoot_KEYBOARD_KEY_BACKSPACE = 0x2a, + VasEBoot_KEYBOARD_KEY_TAB = 0x2b, + VasEBoot_KEYBOARD_KEY_SPACE = 0x2c, + VasEBoot_KEYBOARD_KEY_DASH = 0x2d, + VasEBoot_KEYBOARD_KEY_EQUAL = 0x2e, + VasEBoot_KEYBOARD_KEY_LBRACKET = 0x2f, + VasEBoot_KEYBOARD_KEY_RBRACKET = 0x30, + VasEBoot_KEYBOARD_KEY_BACKSLASH = 0x32, + VasEBoot_KEYBOARD_KEY_SEMICOLON = 0x33, + VasEBoot_KEYBOARD_KEY_DQUOTE = 0x34, + VasEBoot_KEYBOARD_KEY_RQUOTE = 0x35, + VasEBoot_KEYBOARD_KEY_COMMA = 0x36, + VasEBoot_KEYBOARD_KEY_DOT = 0x37, + VasEBoot_KEYBOARD_KEY_SLASH = 0x38, + VasEBoot_KEYBOARD_KEY_CAPS_LOCK = 0x39, + VasEBoot_KEYBOARD_KEY_F1 = 0x3a, + VasEBoot_KEYBOARD_KEY_F2 = 0x3b, + VasEBoot_KEYBOARD_KEY_F3 = 0x3c, + VasEBoot_KEYBOARD_KEY_F4 = 0x3d, + VasEBoot_KEYBOARD_KEY_F5 = 0x3e, + VasEBoot_KEYBOARD_KEY_F6 = 0x3f, + VasEBoot_KEYBOARD_KEY_F7 = 0x40, + VasEBoot_KEYBOARD_KEY_F8 = 0x41, + VasEBoot_KEYBOARD_KEY_F9 = 0x42, + VasEBoot_KEYBOARD_KEY_F10 = 0x43, + VasEBoot_KEYBOARD_KEY_F11 = 0x44, + VasEBoot_KEYBOARD_KEY_F12 = 0x45, + VasEBoot_KEYBOARD_KEY_SCROLL_LOCK = 0x47, + VasEBoot_KEYBOARD_KEY_INSERT = 0x49, + VasEBoot_KEYBOARD_KEY_HOME = 0x4a, + VasEBoot_KEYBOARD_KEY_PPAGE = 0x4b, + VasEBoot_KEYBOARD_KEY_DELETE = 0x4c, + VasEBoot_KEYBOARD_KEY_END = 0x4d, + VasEBoot_KEYBOARD_KEY_NPAGE = 0x4e, + VasEBoot_KEYBOARD_KEY_RIGHT = 0x4f, + VasEBoot_KEYBOARD_KEY_LEFT = 0x50, + VasEBoot_KEYBOARD_KEY_DOWN = 0x51, + VasEBoot_KEYBOARD_KEY_UP = 0x52, + VasEBoot_KEYBOARD_KEY_NUM_LOCK = 0x53, + VasEBoot_KEYBOARD_KEY_NUMSLASH = 0x54, + VasEBoot_KEYBOARD_KEY_NUMMUL = 0x55, + VasEBoot_KEYBOARD_KEY_NUMMINUS = 0x56, + VasEBoot_KEYBOARD_KEY_NUMPLUS = 0x57, + VasEBoot_KEYBOARD_KEY_NUMENTER = 0x58, + VasEBoot_KEYBOARD_KEY_NUM1 = 0x59, + VasEBoot_KEYBOARD_KEY_NUM2 = 0x5a, + VasEBoot_KEYBOARD_KEY_NUM3 = 0x5b, + VasEBoot_KEYBOARD_KEY_NUM4 = 0x5c, + VasEBoot_KEYBOARD_KEY_NUM5 = 0x5d, + VasEBoot_KEYBOARD_KEY_NUM6 = 0x5e, + VasEBoot_KEYBOARD_KEY_NUM7 = 0x5f, + VasEBoot_KEYBOARD_KEY_NUM8 = 0x60, + VasEBoot_KEYBOARD_KEY_NUM9 = 0x61, + VasEBoot_KEYBOARD_KEY_NUM0 = 0x62, + VasEBoot_KEYBOARD_KEY_NUMDOT = 0x63, + VasEBoot_KEYBOARD_KEY_102ND = 0x64, + VasEBoot_KEYBOARD_KEY_KPCOMMA = 0x85, + VasEBoot_KEYBOARD_KEY_JP_RO = 0x87, + VasEBoot_KEYBOARD_KEY_JP_YEN = 0x89, + VasEBoot_KEYBOARD_KEY_LEFT_CTRL = 0xe0, + VasEBoot_KEYBOARD_KEY_LEFT_SHIFT = 0xe1, + VasEBoot_KEYBOARD_KEY_LEFT_ALT = 0xe2, + VasEBoot_KEYBOARD_KEY_RIGHT_CTRL = 0xe4, + VasEBoot_KEYBOARD_KEY_RIGHT_SHIFT = 0xe5, + VasEBoot_KEYBOARD_KEY_RIGHT_ALT = 0xe6, + } VasEBoot_keyboard_key_t; -unsigned EXPORT_FUNC(grub_term_map_key) (grub_keyboard_key_t code, int status); +unsigned EXPORT_FUNC(VasEBoot_term_map_key) (VasEBoot_keyboard_key_t code, int status); -#ifndef GRUB_MACHINE_EMU -extern void grub_keylayouts_init (void); -extern void grub_keylayouts_fini (void); +#ifndef VasEBoot_MACHINE_EMU +extern void VasEBoot_keylayouts_init (void); +extern void VasEBoot_keylayouts_fini (void); #endif -#endif /* GRUB_KEYBOARD_LAYOUTS */ +#endif /* VasEBoot_KEYBOARD_LAYOUTS */ diff --git a/include/VasEBoot/legacy_parse.h b/include/VasEBoot/legacy_parse.h index 751950590..b6ad76011 100644 --- a/include/VasEBoot/legacy_parse.h +++ b/include/VasEBoot/legacy_parse.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LEGACY_PARSE_HEADER -#define GRUB_LEGACY_PARSE_HEADER 1 +#ifndef VasEBoot_LEGACY_PARSE_HEADER +#define VasEBoot_LEGACY_PARSE_HEADER 1 -#include +#include -char *grub_legacy_parse (const char *buf, char **entryname, char **suffix); -char *grub_legacy_escape (const char *in, grub_size_t len); +char *VasEBoot_legacy_parse (const char *buf, char **entryname, char **suffix); +char *VasEBoot_legacy_escape (const char *in, VasEBoot_size_t len); -/* Entered has to be GRUB_AUTH_MAX_PASSLEN long, zero-padded. */ +/* Entered has to be VasEBoot_AUTH_MAX_PASSLEN long, zero-padded. */ int -grub_legacy_check_md5_password (int argc, char **args, +VasEBoot_legacy_check_md5_password (int argc, char **args, char *entered); #endif diff --git a/include/VasEBoot/lib/LzFind.h b/include/VasEBoot/lib/LzFind.h index 69447b64b..4384e4d6f 100644 --- a/include/VasEBoot/lib/LzFind.h +++ b/include/VasEBoot/lib/LzFind.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ @@ -27,7 +27,7 @@ #ifndef __LZFIND_H #define __LZFIND_H -#include +#include typedef UInt32 CLzRef; diff --git a/include/VasEBoot/lib/LzHash.h b/include/VasEBoot/lib/LzHash.h index c3d55860b..0edd338d8 100644 --- a/include/VasEBoot/lib/LzHash.h +++ b/include/VasEBoot/lib/LzHash.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ diff --git a/include/VasEBoot/lib/LzmaDec.h b/include/VasEBoot/lib/LzmaDec.h index 16914c961..6d93291ed 100644 --- a/include/VasEBoot/lib/LzmaDec.h +++ b/include/VasEBoot/lib/LzmaDec.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ diff --git a/include/VasEBoot/lib/LzmaEnc.h b/include/VasEBoot/lib/LzmaEnc.h index fc156a448..d919da9d3 100644 --- a/include/VasEBoot/lib/LzmaEnc.h +++ b/include/VasEBoot/lib/LzmaEnc.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ diff --git a/include/VasEBoot/lib/LzmaTypes.h b/include/VasEBoot/lib/LzmaTypes.h index 1e783a2c7..09fbd5ad4 100644 --- a/include/VasEBoot/lib/LzmaTypes.h +++ b/include/VasEBoot/lib/LzmaTypes.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (c) 1999-2008 Igor Pavlov * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * This code was taken from LZMA SDK 4.58 beta, and was slightly modified - * to adapt it to GRUB's requirement. + * to adapt it to VasEBoot's requirement. * * See , for more information about LZMA. */ diff --git a/include/VasEBoot/lib/arg.h b/include/VasEBoot/lib/arg.h index f81af85ee..06b24aa4e 100644 --- a/include/VasEBoot/lib/arg.h +++ b/include/VasEBoot/lib/arg.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ARG_HEADER -#define GRUB_ARG_HEADER 1 +#ifndef VasEBoot_ARG_HEADER +#define VasEBoot_ARG_HEADER 1 -#include -#include -#include +#include +#include +#include -enum grub_arg_type +enum VasEBoot_arg_type { ARG_TYPE_NONE, ARG_TYPE_STRING, @@ -34,31 +34,31 @@ enum grub_arg_type ARG_TYPE_PATHNAME }; -typedef enum grub_arg_type grub_arg_type_t; +typedef enum VasEBoot_arg_type VasEBoot_arg_type_t; -/* Flags for the option field op grub_arg_option. */ -#define GRUB_ARG_OPTION_OPTIONAL (1 << 1) +/* Flags for the option field op VasEBoot_arg_option. */ +#define VasEBoot_ARG_OPTION_OPTIONAL (1 << 1) /* Flags for an option that can appear multiple times. */ -#define GRUB_ARG_OPTION_REPEATABLE (1 << 2) +#define VasEBoot_ARG_OPTION_REPEATABLE (1 << 2) -enum grub_key_type +enum VasEBoot_key_type { - GRUB_KEY_ARG = -1, - GRUB_KEY_END = -2 + VasEBoot_KEY_ARG = -1, + VasEBoot_KEY_END = -2 }; -typedef enum grub_key_type grub_arg_key_type_t; +typedef enum VasEBoot_key_type VasEBoot_arg_key_type_t; -struct grub_arg_option +struct VasEBoot_arg_option { const char *longarg; int shortarg; int flags; const char *doc; const char *arg; - grub_arg_type_t type; + VasEBoot_arg_type_t type; }; -struct grub_arg_list +struct VasEBoot_arg_list { int set; union { @@ -67,13 +67,13 @@ struct grub_arg_list }; }; -struct grub_extcmd; +struct VasEBoot_extcmd; -int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv, - struct grub_arg_list *usr, char ***args, int *argnum); +int VasEBoot_arg_parse (struct VasEBoot_extcmd *cmd, int argc, char **argv, + struct VasEBoot_arg_list *usr, char ***args, int *argnum); -void EXPORT_FUNC(grub_arg_show_help) (struct grub_extcmd *cmd); -struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd, +void EXPORT_FUNC(VasEBoot_arg_show_help) (struct VasEBoot_extcmd *cmd); +struct VasEBoot_arg_list* VasEBoot_arg_list_alloc (struct VasEBoot_extcmd *cmd, int argc, char *argv[]); -#endif /* ! GRUB_ARG_HEADER */ +#endif /* ! VasEBoot_ARG_HEADER */ diff --git a/include/VasEBoot/lib/cmdline.h b/include/VasEBoot/lib/cmdline.h index 1fe8d0179..23e9012e7 100644 --- a/include/VasEBoot/lib/cmdline.h +++ b/include/VasEBoot/lib/cmdline.h @@ -1,31 +1,31 @@ /* cmdline.h - linux command line handling */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CMDLINE_HEADER -#define GRUB_CMDLINE_HEADER 1 +#ifndef VasEBoot_CMDLINE_HEADER +#define VasEBoot_CMDLINE_HEADER 1 -#include +#include #define LINUX_IMAGE "BOOT_IMAGE=" -unsigned int grub_loader_cmdline_size (int argc, char *argv[]); -int grub_create_loader_cmdline (int argc, char *argv[], char *buf, - grub_size_t size); +unsigned int VasEBoot_loader_cmdline_size (int argc, char *argv[]); +int VasEBoot_create_loader_cmdline (int argc, char *argv[], char *buf, + VasEBoot_size_t size); -#endif /* ! GRUB_CMDLINE_HEADER */ +#endif /* ! VasEBoot_CMDLINE_HEADER */ diff --git a/include/VasEBoot/lib/crc.h b/include/VasEBoot/lib/crc.h index c5098a8c3..f189647be 100644 --- a/include/VasEBoot/lib/crc.h +++ b/include/VasEBoot/lib/crc.h @@ -1,25 +1,25 @@ /* crc.h - prototypes for crc */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CRC_H -#define GRUB_CRC_H 1 +#ifndef VasEBoot_CRC_H +#define VasEBoot_CRC_H 1 -grub_uint32_t grub_getcrc32c (grub_uint32_t crc, const void *buf, int size); +VasEBoot_uint32_t VasEBoot_getcrc32c (VasEBoot_uint32_t crc, const void *buf, int size); -#endif /* ! GRUB_CRC_H */ +#endif /* ! VasEBoot_CRC_H */ diff --git a/include/VasEBoot/lib/envblk.h b/include/VasEBoot/lib/envblk.h index c3e655921..afd9888e2 100644 --- a/include/VasEBoot/lib/envblk.h +++ b/include/VasEBoot/lib/envblk.h @@ -1,56 +1,56 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ENVBLK_HEADER -#define GRUB_ENVBLK_HEADER 1 +#ifndef VasEBoot_ENVBLK_HEADER +#define VasEBoot_ENVBLK_HEADER 1 -#define GRUB_ENVBLK_SIGNATURE "# GRUB Environment Block\n" -#define GRUB_ENVBLK_DEFCFG "grubenv" +#define VasEBoot_ENVBLK_SIGNATURE "# VasEBoot Environment Block\n" +#define VasEBoot_ENVBLK_DEFCFG "VasEBootenv" #ifndef ASM_FILE -struct grub_envblk +struct VasEBoot_envblk { char *buf; - grub_size_t size; + VasEBoot_size_t size; }; -typedef struct grub_envblk *grub_envblk_t; +typedef struct VasEBoot_envblk *VasEBoot_envblk_t; -grub_envblk_t grub_envblk_open (char *buf, grub_size_t size); -int grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value); -void grub_envblk_delete (grub_envblk_t envblk, const char *name); -void grub_envblk_iterate (grub_envblk_t envblk, +VasEBoot_envblk_t VasEBoot_envblk_open (char *buf, VasEBoot_size_t size); +int VasEBoot_envblk_set (VasEBoot_envblk_t envblk, const char *name, const char *value); +void VasEBoot_envblk_delete (VasEBoot_envblk_t envblk, const char *name); +void VasEBoot_envblk_iterate (VasEBoot_envblk_t envblk, void *hook_data, int hook (const char *name, const char *value, void *hook_data)); -void grub_envblk_close (grub_envblk_t envblk); +void VasEBoot_envblk_close (VasEBoot_envblk_t envblk); static inline char * -grub_envblk_buffer (const grub_envblk_t envblk) +VasEBoot_envblk_buffer (const VasEBoot_envblk_t envblk) { return envblk->buf; } -static inline grub_size_t -grub_envblk_size (const grub_envblk_t envblk) +static inline VasEBoot_size_t +VasEBoot_envblk_size (const VasEBoot_envblk_t envblk) { return envblk->size; } #endif /* ! ASM_FILE */ -#endif /* ! GRUB_ENVBLK_HEADER */ +#endif /* ! VasEBoot_ENVBLK_HEADER */ diff --git a/include/VasEBoot/lib/hexdump.h b/include/VasEBoot/lib/hexdump.h index 23c6fa6fe..dd45d0301 100644 --- a/include/VasEBoot/lib/hexdump.h +++ b/include/VasEBoot/lib/hexdump.h @@ -1,25 +1,25 @@ /* hexdump.h - prototypes for dump */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_HEXDUMP_H -#define GRUB_HEXDUMP_H 1 +#ifndef VasEBoot_HEXDUMP_H +#define VasEBoot_HEXDUMP_H 1 void hexdump (unsigned long bse,char* buf,int len); -#endif /* ! GRUB_HEXDUMP_H */ +#endif /* ! VasEBoot_HEXDUMP_H */ diff --git a/include/VasEBoot/libpciaccess.h b/include/VasEBoot/libpciaccess.h index 4d2b3bde5..aa3942682 100644 --- a/include/VasEBoot/libpciaccess.h +++ b/include/VasEBoot/libpciaccess.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ void EXPORT_FUNC (pci_slot_match_iterator_create) (void); diff --git a/include/VasEBoot/linux.h b/include/VasEBoot/linux.h index 594a3f307..6795fdf8b 100644 --- a/include/VasEBoot/linux.h +++ b/include/VasEBoot/linux.h @@ -1,24 +1,24 @@ -#include +#include -struct grub_linux_initrd_component; +struct VasEBoot_linux_initrd_component; -struct grub_linux_initrd_context +struct VasEBoot_linux_initrd_context { int nfiles; - struct grub_linux_initrd_component *components; - grub_size_t size; + struct VasEBoot_linux_initrd_component *components; + VasEBoot_size_t size; }; -grub_err_t -grub_initrd_init (int argc, char *argv[], - struct grub_linux_initrd_context *ctx); +VasEBoot_err_t +VasEBoot_initrd_init (int argc, char *argv[], + struct VasEBoot_linux_initrd_context *ctx); -grub_size_t -grub_get_initrd_size (struct grub_linux_initrd_context *ctx); +VasEBoot_size_t +VasEBoot_get_initrd_size (struct VasEBoot_linux_initrd_context *ctx); void -grub_initrd_close (struct grub_linux_initrd_context *initrd_ctx); +VasEBoot_initrd_close (struct VasEBoot_linux_initrd_context *initrd_ctx); -grub_err_t -grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, +VasEBoot_err_t +VasEBoot_initrd_load (struct VasEBoot_linux_initrd_context *initrd_ctx, char *argv[], void *target); diff --git a/include/VasEBoot/list.h b/include/VasEBoot/list.h index d170ff6da..9922af279 100644 --- a/include/VasEBoot/list.h +++ b/include/VasEBoot/list.h @@ -1,87 +1,87 @@ -/* list.h - header for grub list */ +/* list.h - header for VasEBoot list */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LIST_HEADER -#define GRUB_LIST_HEADER 1 +#ifndef VasEBoot_LIST_HEADER +#define VasEBoot_LIST_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_list +struct VasEBoot_list { - struct grub_list *next; - struct grub_list **prev; + struct VasEBoot_list *next; + struct VasEBoot_list **prev; }; -typedef struct grub_list *grub_list_t; +typedef struct VasEBoot_list *VasEBoot_list_t; -void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item); -void EXPORT_FUNC(grub_list_remove) (grub_list_t item); +void EXPORT_FUNC(VasEBoot_list_push) (VasEBoot_list_t *head, VasEBoot_list_t item); +void EXPORT_FUNC(VasEBoot_list_remove) (VasEBoot_list_t item); #define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) = (var)->next) #define FOR_LIST_ELEMENTS_SAFE(var, nxt, list) for ((var) = (list), (nxt) = ((var) ? (var)->next : 0); (var); (var) = (nxt), ((nxt) = (var) ? (var)->next : 0)) static inline void * -grub_bad_type_cast_real (int line, const char *file) - ATTRIBUTE_ERROR ("bad type cast between incompatible grub types"); +VasEBoot_bad_type_cast_real (int line, const char *file) + ATTRIBUTE_ERROR ("bad type cast between incompatible VasEBoot types"); static inline void * -grub_bad_type_cast_real (int line, const char *file) +VasEBoot_bad_type_cast_real (int line, const char *file) { - grub_fatal ("error:%s:%u: bad type cast between incompatible grub types", + VasEBoot_fatal ("error:%s:%u: bad type cast between incompatible VasEBoot types", file, line); } -#define grub_bad_type_cast() grub_bad_type_cast_real(__LINE__, GRUB_FILE) +#define VasEBoot_bad_type_cast() VasEBoot_bad_type_cast_real(__LINE__, VasEBoot_FILE) -#define GRUB_FIELD_MATCH(ptr, type, field) \ +#define VasEBoot_FIELD_MATCH(ptr, type, field) \ ((char *) &(ptr)->field == (char *) &((type) (ptr))->field) -#define GRUB_AS_LIST(ptr) \ - (GRUB_FIELD_MATCH (ptr, grub_list_t, next) && GRUB_FIELD_MATCH (ptr, grub_list_t, prev) ? \ - (grub_list_t) ptr : (grub_list_t) grub_bad_type_cast ()) +#define VasEBoot_AS_LIST(ptr) \ + (VasEBoot_FIELD_MATCH (ptr, VasEBoot_list_t, next) && VasEBoot_FIELD_MATCH (ptr, VasEBoot_list_t, prev) ? \ + (VasEBoot_list_t) ptr : (VasEBoot_list_t) VasEBoot_bad_type_cast ()) -#define GRUB_AS_LIST_P(pptr) \ - (GRUB_FIELD_MATCH (*pptr, grub_list_t, next) && GRUB_FIELD_MATCH (*pptr, grub_list_t, prev) ? \ - (grub_list_t *) (void *) pptr : (grub_list_t *) grub_bad_type_cast ()) +#define VasEBoot_AS_LIST_P(pptr) \ + (VasEBoot_FIELD_MATCH (*pptr, VasEBoot_list_t, next) && VasEBoot_FIELD_MATCH (*pptr, VasEBoot_list_t, prev) ? \ + (VasEBoot_list_t *) (void *) pptr : (VasEBoot_list_t *) VasEBoot_bad_type_cast ()) -struct grub_named_list +struct VasEBoot_named_list { - struct grub_named_list *next; - struct grub_named_list **prev; + struct VasEBoot_named_list *next; + struct VasEBoot_named_list **prev; char *name; }; -typedef struct grub_named_list *grub_named_list_t; +typedef struct VasEBoot_named_list *VasEBoot_named_list_t; -void * EXPORT_FUNC(grub_named_list_find) (grub_named_list_t head, +void * EXPORT_FUNC(VasEBoot_named_list_find) (VasEBoot_named_list_t head, const char *name); -#define GRUB_AS_NAMED_LIST(ptr) \ - ((GRUB_FIELD_MATCH (ptr, grub_named_list_t, next) \ - && GRUB_FIELD_MATCH (ptr, grub_named_list_t, prev) \ - && GRUB_FIELD_MATCH (ptr, grub_named_list_t, name))? \ - (grub_named_list_t) ptr : (grub_named_list_t) grub_bad_type_cast ()) +#define VasEBoot_AS_NAMED_LIST(ptr) \ + ((VasEBoot_FIELD_MATCH (ptr, VasEBoot_named_list_t, next) \ + && VasEBoot_FIELD_MATCH (ptr, VasEBoot_named_list_t, prev) \ + && VasEBoot_FIELD_MATCH (ptr, VasEBoot_named_list_t, name))? \ + (VasEBoot_named_list_t) ptr : (VasEBoot_named_list_t) VasEBoot_bad_type_cast ()) -#define GRUB_AS_NAMED_LIST_P(pptr) \ - ((GRUB_FIELD_MATCH (*pptr, grub_named_list_t, next) \ - && GRUB_FIELD_MATCH (*pptr, grub_named_list_t, prev) \ - && GRUB_FIELD_MATCH (*pptr, grub_named_list_t, name))? \ - (grub_named_list_t *) (void *) pptr : (grub_named_list_t *) grub_bad_type_cast ()) +#define VasEBoot_AS_NAMED_LIST_P(pptr) \ + ((VasEBoot_FIELD_MATCH (*pptr, VasEBoot_named_list_t, next) \ + && VasEBoot_FIELD_MATCH (*pptr, VasEBoot_named_list_t, prev) \ + && VasEBoot_FIELD_MATCH (*pptr, VasEBoot_named_list_t, name))? \ + (VasEBoot_named_list_t *) (void *) pptr : (VasEBoot_named_list_t *) VasEBoot_bad_type_cast ()) -#endif /* ! GRUB_LIST_HEADER */ +#endif /* ! VasEBoot_LIST_HEADER */ diff --git a/include/VasEBoot/loader.h b/include/VasEBoot/loader.h index 7f82a499f..d0f598b22 100644 --- a/include/VasEBoot/loader.h +++ b/include/VasEBoot/loader.h @@ -1,78 +1,78 @@ /* loader.h - OS loaders */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LOADER_HEADER -#define GRUB_LOADER_HEADER 1 +#ifndef VasEBoot_LOADER_HEADER +#define VasEBoot_LOADER_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include /* Check if a loader is loaded. */ -int EXPORT_FUNC (grub_loader_is_loaded) (void); +int EXPORT_FUNC (VasEBoot_loader_is_loaded) (void); /* Set loader functions. */ enum { - GRUB_LOADER_FLAG_NORETURN = 1, - GRUB_LOADER_FLAG_PXE_NOT_UNLOAD = 2, + VasEBoot_LOADER_FLAG_NORETURN = 1, + VasEBoot_LOADER_FLAG_PXE_NOT_UNLOAD = 2, }; -void EXPORT_FUNC (grub_loader_set) (grub_err_t (*boot) (void), - grub_err_t (*unload) (void), +void EXPORT_FUNC (VasEBoot_loader_set) (VasEBoot_err_t (*boot) (void), + VasEBoot_err_t (*unload) (void), int flags); /* Unset current loader, if any. */ -void EXPORT_FUNC (grub_loader_unset) (void); +void EXPORT_FUNC (VasEBoot_loader_unset) (void); /* Call the boot hook in current loader. This may or may not return, - depending on the setting by grub_loader_set. */ -grub_err_t grub_loader_boot (void); + depending on the setting by VasEBoot_loader_set. */ +VasEBoot_err_t VasEBoot_loader_boot (void); /* The space between numbers is intentional for the simplicity of adding new values even if external modules use them. */ typedef enum { /* A preboot hook which can use everything and turns nothing off. */ - GRUB_LOADER_PREBOOT_HOOK_PRIO_NORMAL = 400, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_NORMAL = 400, /* A preboot hook which can't use disks and may stop disks. */ - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK = 300, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_DISK = 300, /* A preboot hook which can't use disks or console and may stop console. */ - GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE = 200, + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_CONSOLE = 200, /* A preboot hook which can't use disks or console, can't modify memory map and may stop memory services or finalize memory map. */ - GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY = 100, -} grub_loader_preboot_hook_prio_t; + VasEBoot_LOADER_PREBOOT_HOOK_PRIO_MEMORY = 100, +} VasEBoot_loader_preboot_hook_prio_t; /* Register a preboot hook. */ -struct grub_preboot; +struct VasEBoot_preboot; -struct grub_preboot *EXPORT_FUNC(grub_loader_register_preboot_hook) (grub_err_t (*preboot_func) (int noret), - grub_err_t (*preboot_rest_func) (void), - grub_loader_preboot_hook_prio_t prio); +struct VasEBoot_preboot *EXPORT_FUNC(VasEBoot_loader_register_preboot_hook) (VasEBoot_err_t (*preboot_func) (int noret), + VasEBoot_err_t (*preboot_rest_func) (void), + VasEBoot_loader_preboot_hook_prio_t prio); /* Unregister given preboot hook. */ -void EXPORT_FUNC (grub_loader_unregister_preboot_hook) (struct grub_preboot *hnd); +void EXPORT_FUNC (VasEBoot_loader_unregister_preboot_hook) (struct VasEBoot_preboot *hnd); -#ifndef GRUB_MACHINE_EMU -void grub_boot_init (void); -void grub_boot_fini (void); +#ifndef VasEBoot_MACHINE_EMU +void VasEBoot_boot_init (void); +void VasEBoot_boot_fini (void); #endif -#endif /* ! GRUB_LOADER_HEADER */ +#endif /* ! VasEBoot_LOADER_HEADER */ diff --git a/include/VasEBoot/lvm.h b/include/VasEBoot/lvm.h index 30a609c20..f9d81b60f 100644 --- a/include/VasEBoot/lvm.h +++ b/include/VasEBoot/lvm.h @@ -1,90 +1,90 @@ /* lvm.h - On disk structures for LVM. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LVM_H -#define GRUB_LVM_H 1 +#ifndef VasEBoot_LVM_H +#define VasEBoot_LVM_H 1 -#include -#include +#include +#include /* Length of ID string, excluding terminating zero. */ -#define GRUB_LVM_ID_STRLEN 38 +#define VasEBoot_LVM_ID_STRLEN 38 -#define GRUB_LVM_LABEL_SIZE GRUB_DISK_SECTOR_SIZE -#define GRUB_LVM_LABEL_SCAN_SECTORS 4L +#define VasEBoot_LVM_LABEL_SIZE VasEBoot_DISK_SECTOR_SIZE +#define VasEBoot_LVM_LABEL_SCAN_SECTORS 4L -#define GRUB_LVM_LABEL_ID "LABELONE" -#define GRUB_LVM_LVM2_LABEL "LVM2 001" +#define VasEBoot_LVM_LABEL_ID "LABELONE" +#define VasEBoot_LVM_LVM2_LABEL "LVM2 001" -#define GRUB_LVM_ID_LEN 32 +#define VasEBoot_LVM_ID_LEN 32 /* On disk - 32 bytes */ -struct grub_lvm_label_header { - grub_int8_t id[8]; /* LABELONE */ - grub_uint64_t sector_xl; /* Sector number of this label */ - grub_uint32_t crc_xl; /* From next field to end of sector */ - grub_uint32_t offset_xl; /* Offset from start of struct to contents */ - grub_int8_t type[8]; /* LVM2 001 */ -} GRUB_PACKED; +struct VasEBoot_lvm_label_header { + VasEBoot_int8_t id[8]; /* LABELONE */ + VasEBoot_uint64_t sector_xl; /* Sector number of this label */ + VasEBoot_uint32_t crc_xl; /* From next field to end of sector */ + VasEBoot_uint32_t offset_xl; /* Offset from start of struct to contents */ + VasEBoot_int8_t type[8]; /* LVM2 001 */ +} VasEBoot_PACKED; /* On disk */ -struct grub_lvm_disk_locn { - grub_uint64_t offset; /* Offset in bytes to start sector */ - grub_uint64_t size; /* Bytes */ -} GRUB_PACKED; +struct VasEBoot_lvm_disk_locn { + VasEBoot_uint64_t offset; /* Offset in bytes to start sector */ + VasEBoot_uint64_t size; /* Bytes */ +} VasEBoot_PACKED; /* Fields with the suffix _xl should be xlate'd wherever they appear */ /* On disk */ -struct grub_lvm_pv_header { - grub_int8_t pv_uuid[GRUB_LVM_ID_LEN]; +struct VasEBoot_lvm_pv_header { + VasEBoot_int8_t pv_uuid[VasEBoot_LVM_ID_LEN]; /* This size can be overridden if PV belongs to a VG */ - grub_uint64_t device_size_xl; /* Bytes */ + VasEBoot_uint64_t device_size_xl; /* Bytes */ /* NULL-terminated list of data areas followed by */ /* NULL-terminated list of metadata area headers */ - struct grub_lvm_disk_locn disk_areas_xl[0]; /* Two lists */ -} GRUB_PACKED; + struct VasEBoot_lvm_disk_locn disk_areas_xl[0]; /* Two lists */ +} VasEBoot_PACKED; -#define GRUB_LVM_FMTT_MAGIC "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076" -#define GRUB_LVM_FMTT_VERSION 1 -#define GRUB_LVM_MDA_HEADER_SIZE 512 +#define VasEBoot_LVM_FMTT_MAGIC "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076" +#define VasEBoot_LVM_FMTT_VERSION 1 +#define VasEBoot_LVM_MDA_HEADER_SIZE 512 /* On disk */ -struct grub_lvm_raw_locn { - grub_uint64_t offset; /* Offset in bytes to start sector */ - grub_uint64_t size; /* Bytes */ - grub_uint32_t checksum; - grub_uint32_t filler; -} GRUB_PACKED; +struct VasEBoot_lvm_raw_locn { + VasEBoot_uint64_t offset; /* Offset in bytes to start sector */ + VasEBoot_uint64_t size; /* Bytes */ + VasEBoot_uint32_t checksum; + VasEBoot_uint32_t filler; +} VasEBoot_PACKED; /* On disk */ /* Structure size limited to one sector */ -struct grub_lvm_mda_header { - grub_uint32_t checksum_xl; /* Checksum of rest of mda_header */ - grub_int8_t magic[16]; /* To aid scans for metadata */ - grub_uint32_t version; - grub_uint64_t start; /* Absolute start byte of mda_header */ - grub_uint64_t size; /* Size of metadata area */ +struct VasEBoot_lvm_mda_header { + VasEBoot_uint32_t checksum_xl; /* Checksum of rest of mda_header */ + VasEBoot_int8_t magic[16]; /* To aid scans for metadata */ + VasEBoot_uint32_t version; + VasEBoot_uint64_t start; /* Absolute start byte of mda_header */ + VasEBoot_uint64_t size; /* Size of metadata area */ - struct grub_lvm_raw_locn raw_locns[0]; /* NULL-terminated list */ -} GRUB_PACKED; + struct VasEBoot_lvm_raw_locn raw_locns[0]; /* NULL-terminated list */ +} VasEBoot_PACKED; -#endif /* ! GRUB_LVM_H */ +#endif /* ! VasEBoot_LVM_H */ diff --git a/include/VasEBoot/macho.h b/include/VasEBoot/macho.h index 2dea625f1..040be6edb 100644 --- a/include/VasEBoot/macho.h +++ b/include/VasEBoot/macho.h @@ -1,166 +1,166 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHO_H -#define GRUB_MACHO_H 1 -#include +#ifndef VasEBoot_MACHO_H +#define VasEBoot_MACHO_H 1 +#include /* Multi-architecture header. Always in big-endian. */ -struct grub_macho_fat_header +struct VasEBoot_macho_fat_header { - grub_uint32_t magic; - grub_uint32_t nfat_arch; -} GRUB_PACKED; + VasEBoot_uint32_t magic; + VasEBoot_uint32_t nfat_arch; +} VasEBoot_PACKED; enum { - GRUB_MACHO_CPUTYPE_IA32 = 0x00000007, - GRUB_MACHO_CPUTYPE_AMD64 = 0x01000007 + VasEBoot_MACHO_CPUTYPE_IA32 = 0x00000007, + VasEBoot_MACHO_CPUTYPE_AMD64 = 0x01000007 }; -#define GRUB_MACHO_FAT_MAGIC 0xcafebabe -#define GRUB_MACHO_FAT_EFI_MAGIC 0x0ef1fab9U +#define VasEBoot_MACHO_FAT_MAGIC 0xcafebabe +#define VasEBoot_MACHO_FAT_EFI_MAGIC 0x0ef1fab9U -typedef grub_uint32_t grub_macho_cpu_type_t; -typedef grub_uint32_t grub_macho_cpu_subtype_t; +typedef VasEBoot_uint32_t VasEBoot_macho_cpu_type_t; +typedef VasEBoot_uint32_t VasEBoot_macho_cpu_subtype_t; /* Architecture descriptor. Always in big-endian. */ -struct grub_macho_fat_arch +struct VasEBoot_macho_fat_arch { - grub_macho_cpu_type_t cputype; - grub_macho_cpu_subtype_t cpusubtype; - grub_uint32_t offset; - grub_uint32_t size; - grub_uint32_t align; -} GRUB_PACKED; + VasEBoot_macho_cpu_type_t cputype; + VasEBoot_macho_cpu_subtype_t cpusubtype; + VasEBoot_uint32_t offset; + VasEBoot_uint32_t size; + VasEBoot_uint32_t align; +} VasEBoot_PACKED; /* File header for 32-bit. Always in native-endian. */ -struct grub_macho_header32 +struct VasEBoot_macho_header32 { -#define GRUB_MACHO_MAGIC32 0xfeedface - grub_uint32_t magic; - grub_macho_cpu_type_t cputype; - grub_macho_cpu_subtype_t cpusubtype; - grub_uint32_t filetype; - grub_uint32_t ncmds; - grub_uint32_t sizeofcmds; - grub_uint32_t flags; -} GRUB_PACKED; +#define VasEBoot_MACHO_MAGIC32 0xfeedface + VasEBoot_uint32_t magic; + VasEBoot_macho_cpu_type_t cputype; + VasEBoot_macho_cpu_subtype_t cpusubtype; + VasEBoot_uint32_t filetype; + VasEBoot_uint32_t ncmds; + VasEBoot_uint32_t sizeofcmds; + VasEBoot_uint32_t flags; +} VasEBoot_PACKED; /* File header for 64-bit. Always in native-endian. */ -struct grub_macho_header64 +struct VasEBoot_macho_header64 { -#define GRUB_MACHO_MAGIC64 0xfeedfacf - grub_uint32_t magic; - grub_macho_cpu_type_t cputype; - grub_macho_cpu_subtype_t cpusubtype; - grub_uint32_t filetype; - grub_uint32_t ncmds; - grub_uint32_t sizeofcmds; - grub_uint32_t flags; - grub_uint32_t reserved; -} GRUB_PACKED; +#define VasEBoot_MACHO_MAGIC64 0xfeedfacf + VasEBoot_uint32_t magic; + VasEBoot_macho_cpu_type_t cputype; + VasEBoot_macho_cpu_subtype_t cpusubtype; + VasEBoot_uint32_t filetype; + VasEBoot_uint32_t ncmds; + VasEBoot_uint32_t sizeofcmds; + VasEBoot_uint32_t flags; + VasEBoot_uint32_t reserved; +} VasEBoot_PACKED; /* Common header of Mach-O commands. */ -struct grub_macho_cmd +struct VasEBoot_macho_cmd { - grub_uint32_t cmd; - grub_uint32_t cmdsize; -} GRUB_PACKED; + VasEBoot_uint32_t cmd; + VasEBoot_uint32_t cmdsize; +} VasEBoot_PACKED; -typedef grub_uint32_t grub_macho_vmprot_t; +typedef VasEBoot_uint32_t VasEBoot_macho_vmprot_t; /* 32-bit segment command. */ -struct grub_macho_segment32 +struct VasEBoot_macho_segment32 { -#define GRUB_MACHO_CMD_SEGMENT32 1 - grub_uint32_t cmd; - grub_uint32_t cmdsize; - grub_uint8_t segname[16]; - grub_uint32_t vmaddr; - grub_uint32_t vmsize; - grub_uint32_t fileoff; - grub_uint32_t filesize; - grub_macho_vmprot_t maxprot; - grub_macho_vmprot_t initprot; - grub_uint32_t nsects; - grub_uint32_t flags; -} GRUB_PACKED; +#define VasEBoot_MACHO_CMD_SEGMENT32 1 + VasEBoot_uint32_t cmd; + VasEBoot_uint32_t cmdsize; + VasEBoot_uint8_t segname[16]; + VasEBoot_uint32_t vmaddr; + VasEBoot_uint32_t vmsize; + VasEBoot_uint32_t fileoff; + VasEBoot_uint32_t filesize; + VasEBoot_macho_vmprot_t maxprot; + VasEBoot_macho_vmprot_t initprot; + VasEBoot_uint32_t nsects; + VasEBoot_uint32_t flags; +} VasEBoot_PACKED; /* 64-bit segment command. */ -struct grub_macho_segment64 +struct VasEBoot_macho_segment64 { -#define GRUB_MACHO_CMD_SEGMENT64 0x19 - grub_uint32_t cmd; - grub_uint32_t cmdsize; - grub_uint8_t segname[16]; - grub_uint64_t vmaddr; - grub_uint64_t vmsize; - grub_uint64_t fileoff; - grub_uint64_t filesize; - grub_macho_vmprot_t maxprot; - grub_macho_vmprot_t initprot; - grub_uint32_t nsects; - grub_uint32_t flags; -} GRUB_PACKED; +#define VasEBoot_MACHO_CMD_SEGMENT64 0x19 + VasEBoot_uint32_t cmd; + VasEBoot_uint32_t cmdsize; + VasEBoot_uint8_t segname[16]; + VasEBoot_uint64_t vmaddr; + VasEBoot_uint64_t vmsize; + VasEBoot_uint64_t fileoff; + VasEBoot_uint64_t filesize; + VasEBoot_macho_vmprot_t maxprot; + VasEBoot_macho_vmprot_t initprot; + VasEBoot_uint32_t nsects; + VasEBoot_uint32_t flags; +} VasEBoot_PACKED; -#define GRUB_MACHO_CMD_THREAD 5 +#define VasEBoot_MACHO_CMD_THREAD 5 -struct grub_macho_lzss_header +struct VasEBoot_macho_lzss_header { char magic[8]; -#define GRUB_MACHO_LZSS_MAGIC "complzss" - grub_uint32_t unused; - grub_uint32_t uncompressed_size; - grub_uint32_t compressed_size; +#define VasEBoot_MACHO_LZSS_MAGIC "complzss" + VasEBoot_uint32_t unused; + VasEBoot_uint32_t uncompressed_size; + VasEBoot_uint32_t compressed_size; }; /* Convenience union. What do we need to load to identify the file type. */ -union grub_macho_filestart +union VasEBoot_macho_filestart { - struct grub_macho_fat_header fat; - struct grub_macho_header32 thin32; - struct grub_macho_header64 thin64; - struct grub_macho_lzss_header lzss; -} GRUB_PACKED; + struct VasEBoot_macho_fat_header fat; + struct VasEBoot_macho_header32 thin32; + struct VasEBoot_macho_header64 thin64; + struct VasEBoot_macho_lzss_header lzss; +} VasEBoot_PACKED; -struct grub_macho_thread32 +struct VasEBoot_macho_thread32 { - grub_uint32_t cmd; - grub_uint32_t cmdsize; - grub_uint8_t unknown1[48]; - grub_uint32_t entry_point; - grub_uint8_t unknown2[20]; -} GRUB_PACKED; + VasEBoot_uint32_t cmd; + VasEBoot_uint32_t cmdsize; + VasEBoot_uint8_t unknown1[48]; + VasEBoot_uint32_t entry_point; + VasEBoot_uint8_t unknown2[20]; +} VasEBoot_PACKED; -struct grub_macho_thread64 +struct VasEBoot_macho_thread64 { - grub_uint32_t cmd; - grub_uint32_t cmdsize; - grub_uint8_t unknown1[0x88]; - grub_uint64_t entry_point; - grub_uint8_t unknown2[0x20]; -} GRUB_PACKED; + VasEBoot_uint32_t cmd; + VasEBoot_uint32_t cmdsize; + VasEBoot_uint8_t unknown1[0x88]; + VasEBoot_uint64_t entry_point; + VasEBoot_uint8_t unknown2[0x20]; +} VasEBoot_PACKED; -#define GRUB_MACHO_LZSS_OFFSET 0x180 +#define VasEBoot_MACHO_LZSS_OFFSET 0x180 -grub_size_t -grub_decompress_lzss (grub_uint8_t *dst, grub_uint8_t *dstend, - grub_uint8_t *src, grub_uint8_t *srcend); +VasEBoot_size_t +VasEBoot_decompress_lzss (VasEBoot_uint8_t *dst, VasEBoot_uint8_t *dstend, + VasEBoot_uint8_t *src, VasEBoot_uint8_t *srcend); #endif diff --git a/include/VasEBoot/machoload.h b/include/VasEBoot/machoload.h index 1eec118f1..f90b309d5 100644 --- a/include/VasEBoot/machoload.h +++ b/include/VasEBoot/machoload.h @@ -1,88 +1,88 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHOLOAD_HEADER -#define GRUB_MACHOLOAD_HEADER 1 +#ifndef VasEBoot_MACHOLOAD_HEADER +#define VasEBoot_MACHOLOAD_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -struct grub_macho_file +struct VasEBoot_macho_file { - grub_file_t file; - grub_ssize_t offset32; - grub_ssize_t end32; + VasEBoot_file_t file; + VasEBoot_ssize_t offset32; + VasEBoot_ssize_t end32; int ncmds32; - grub_size_t cmdsize32; - grub_uint8_t *cmds32; - grub_uint8_t *uncompressed32; + VasEBoot_size_t cmdsize32; + VasEBoot_uint8_t *cmds32; + VasEBoot_uint8_t *uncompressed32; int compressed32; - grub_size_t compressed_size32; - grub_size_t uncompressed_size32; - grub_ssize_t offset64; - grub_ssize_t end64; + VasEBoot_size_t compressed_size32; + VasEBoot_size_t uncompressed_size32; + VasEBoot_ssize_t offset64; + VasEBoot_ssize_t end64; int ncmds64; - grub_size_t cmdsize64; - grub_uint8_t *cmds64; - grub_uint8_t *uncompressed64; + VasEBoot_size_t cmdsize64; + VasEBoot_uint8_t *cmds64; + VasEBoot_uint8_t *uncompressed64; int compressed64; - grub_size_t compressed_size64; - grub_size_t uncompressed_size64; + VasEBoot_size_t compressed_size64; + VasEBoot_size_t uncompressed_size64; }; -typedef struct grub_macho_file *grub_macho_t; +typedef struct VasEBoot_macho_file *VasEBoot_macho_t; -grub_macho_t grub_macho_open (const char *, int is_64bit); -grub_macho_t grub_macho_file (grub_file_t file, const char *filename, +VasEBoot_macho_t VasEBoot_macho_open (const char *, int is_64bit); +VasEBoot_macho_t VasEBoot_macho_file (VasEBoot_file_t file, const char *filename, int is_64bit); -grub_err_t grub_macho_close (grub_macho_t); +VasEBoot_err_t VasEBoot_macho_close (VasEBoot_macho_t); -grub_err_t grub_macho_size32 (grub_macho_t macho, grub_uint32_t *segments_start, - grub_uint32_t *segments_end, int flags, +VasEBoot_err_t VasEBoot_macho_size32 (VasEBoot_macho_t macho, VasEBoot_uint32_t *segments_start, + VasEBoot_uint32_t *segments_end, int flags, const char *filename); -grub_uint32_t grub_macho_get_entry_point32 (grub_macho_t macho, +VasEBoot_uint32_t VasEBoot_macho_get_entry_point32 (VasEBoot_macho_t macho, const char *filename); -grub_err_t grub_macho_size64 (grub_macho_t macho, grub_uint64_t *segments_start, - grub_uint64_t *segments_end, int flags, +VasEBoot_err_t VasEBoot_macho_size64 (VasEBoot_macho_t macho, VasEBoot_uint64_t *segments_start, + VasEBoot_uint64_t *segments_end, int flags, const char *filename); -grub_uint64_t grub_macho_get_entry_point64 (grub_macho_t macho, +VasEBoot_uint64_t VasEBoot_macho_get_entry_point64 (VasEBoot_macho_t macho, const char *filename); /* Ignore BSS segments when loading. */ -#define GRUB_MACHO_NOBSS 0x1 -grub_err_t grub_macho_load32 (grub_macho_t macho, const char *filename, +#define VasEBoot_MACHO_NOBSS 0x1 +VasEBoot_err_t VasEBoot_macho_load32 (VasEBoot_macho_t macho, const char *filename, char *offset, int flags, int *darwin_version); -grub_err_t grub_macho_load64 (grub_macho_t macho, const char *filename, +VasEBoot_err_t VasEBoot_macho_load64 (VasEBoot_macho_t macho, const char *filename, char *offset, int flags, int *darwin_version); /* Like filesize and file_read but take only 32-bit part for current architecture. */ -grub_size_t grub_macho_filesize32 (grub_macho_t macho); -grub_err_t grub_macho_readfile32 (grub_macho_t macho, const char *filename, +VasEBoot_size_t VasEBoot_macho_filesize32 (VasEBoot_macho_t macho); +VasEBoot_err_t VasEBoot_macho_readfile32 (VasEBoot_macho_t macho, const char *filename, void *dest); -grub_size_t grub_macho_filesize64 (grub_macho_t macho); -grub_err_t grub_macho_readfile64 (grub_macho_t macho, const char *filename, +VasEBoot_size_t VasEBoot_macho_filesize64 (VasEBoot_macho_t macho); +VasEBoot_err_t VasEBoot_macho_readfile64 (VasEBoot_macho_t macho, const char *filename, void *dest); -void grub_macho_parse32 (grub_macho_t macho, const char *filename); -void grub_macho_parse64 (grub_macho_t macho, const char *filename); +void VasEBoot_macho_parse32 (VasEBoot_macho_t macho, const char *filename); +void VasEBoot_macho_parse64 (VasEBoot_macho_t macho, const char *filename); -#endif /* ! GRUB_MACHOLOAD_HEADER */ +#endif /* ! VasEBoot_MACHOLOAD_HEADER */ diff --git a/include/VasEBoot/memory.h b/include/VasEBoot/memory.h index 6da114a1b..780e8fd78 100644 --- a/include/VasEBoot/memory.h +++ b/include/VasEBoot/memory.h @@ -1,87 +1,87 @@ /* memory.h - describe the memory map */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_HEADER -#define GRUB_MEMORY_HEADER 1 +#ifndef VasEBoot_MEMORY_HEADER +#define VasEBoot_MEMORY_HEADER 1 -#include -#include +#include +#include -typedef enum grub_memory_type +typedef enum VasEBoot_memory_type { - GRUB_MEMORY_AVAILABLE = 1, - GRUB_MEMORY_RESERVED = 2, - GRUB_MEMORY_ACPI = 3, - GRUB_MEMORY_NVS = 4, - GRUB_MEMORY_BADRAM = 5, - GRUB_MEMORY_PERSISTENT = 7, - GRUB_MEMORY_PERSISTENT_LEGACY = 12, - GRUB_MEMORY_COREBOOT_TABLES = 16, - GRUB_MEMORY_CODE = 20, + VasEBoot_MEMORY_AVAILABLE = 1, + VasEBoot_MEMORY_RESERVED = 2, + VasEBoot_MEMORY_ACPI = 3, + VasEBoot_MEMORY_NVS = 4, + VasEBoot_MEMORY_BADRAM = 5, + VasEBoot_MEMORY_PERSISTENT = 7, + VasEBoot_MEMORY_PERSISTENT_LEGACY = 12, + VasEBoot_MEMORY_COREBOOT_TABLES = 16, + VasEBoot_MEMORY_CODE = 20, /* This one is special: it's used internally but is never reported by firmware. Don't use -1 as it's used internally for other purposes. */ - GRUB_MEMORY_HOLE = -2, - GRUB_MEMORY_MAX = 0x10000 - } grub_memory_type_t; + VasEBoot_MEMORY_HOLE = -2, + VasEBoot_MEMORY_MAX = 0x10000 + } VasEBoot_memory_type_t; -typedef int (*grub_memory_hook_t) (grub_uint64_t, - grub_uint64_t, - grub_memory_type_t, +typedef int (*VasEBoot_memory_hook_t) (VasEBoot_uint64_t, + VasEBoot_uint64_t, + VasEBoot_memory_type_t, void *); -grub_err_t grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data); +VasEBoot_err_t VasEBoot_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data); -#ifdef GRUB_MACHINE_EFI -grub_err_t -grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, +#ifdef VasEBoot_MACHINE_EFI +VasEBoot_err_t +VasEBoot_efi_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data, int avoid_efi_boot_services); #endif -#if !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_EFI) -grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (grub_memory_hook_t hook, +#if !defined (VasEBoot_MACHINE_EMU) && !defined (VasEBoot_MACHINE_EFI) +VasEBoot_err_t EXPORT_FUNC(VasEBoot_machine_mmap_iterate) (VasEBoot_memory_hook_t hook, void *hook_data); #else -grub_err_t grub_machine_mmap_iterate (grub_memory_hook_t hook, +VasEBoot_err_t VasEBoot_machine_mmap_iterate (VasEBoot_memory_hook_t hook, void *hook_data); #endif -int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type); -grub_err_t grub_mmap_unregister (int handle); +int VasEBoot_mmap_register (VasEBoot_uint64_t start, VasEBoot_uint64_t size, int type); +VasEBoot_err_t VasEBoot_mmap_unregister (int handle); -void *grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, +void *VasEBoot_mmap_malign_and_register (VasEBoot_uint64_t align, VasEBoot_uint64_t size, int *handle, int type, int flags); -void grub_mmap_free_and_unregister (int handle); +void VasEBoot_mmap_free_and_unregister (int handle); -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef VasEBoot_MMAP_REGISTER_BY_FIRMWARE -struct grub_mmap_region +struct VasEBoot_mmap_region { - struct grub_mmap_region *next; - grub_uint64_t start; - grub_uint64_t end; - grub_memory_type_t type; + struct VasEBoot_mmap_region *next; + VasEBoot_uint64_t start; + VasEBoot_uint64_t end; + VasEBoot_memory_type_t type; int handle; int priority; }; -extern struct grub_mmap_region *grub_mmap_overlays; +extern struct VasEBoot_mmap_region *VasEBoot_mmap_overlays; #endif -#endif /* ! GRUB_MEMORY_HEADER */ +#endif /* ! VasEBoot_MEMORY_HEADER */ diff --git a/include/VasEBoot/menu.h b/include/VasEBoot/menu.h index ee2b5e910..df2422585 100644 --- a/include/VasEBoot/menu.h +++ b/include/VasEBoot/menu.h @@ -1,33 +1,33 @@ /* menu.h - Menu model function prototypes and data structures. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MENU_HEADER -#define GRUB_MENU_HEADER 1 +#ifndef VasEBoot_MENU_HEADER +#define VasEBoot_MENU_HEADER 1 -struct grub_menu_entry_class +struct VasEBoot_menu_entry_class { char *name; - struct grub_menu_entry_class *next; + struct VasEBoot_menu_entry_class *next; }; /* The menu entry. */ -struct grub_menu_entry +struct VasEBoot_menu_entry { /* The title name. */ const char *title; @@ -45,7 +45,7 @@ struct grub_menu_entry used to choose an icon or other style attributes. This is a dummy head node for the linked list, so for an entry E, E.classes->next is the first class if it is not NULL. */ - struct grub_menu_entry_class *classes; + struct VasEBoot_menu_entry_class *classes; /* The sourcecode of the menu entry, used by the editor. */ const char *sourcecode; @@ -59,48 +59,48 @@ struct grub_menu_entry int submenu; /* The next element. */ - struct grub_menu_entry *next; + struct VasEBoot_menu_entry *next; }; -typedef struct grub_menu_entry *grub_menu_entry_t; +typedef struct VasEBoot_menu_entry *VasEBoot_menu_entry_t; /* The menu. */ -struct grub_menu +struct VasEBoot_menu { /* The size of a menu. */ int size; /* The list of menu entries. */ - grub_menu_entry_t entry_list; + VasEBoot_menu_entry_t entry_list; }; -typedef struct grub_menu *grub_menu_t; +typedef struct VasEBoot_menu *VasEBoot_menu_t; /* Callback structure menu viewers can use to provide user feedback when default entries are executed, possibly including fallback entries. */ -typedef struct grub_menu_execute_callback +typedef struct VasEBoot_menu_execute_callback { /* Called immediately before ENTRY is booted. */ - void (*notify_booting) (grub_menu_entry_t entry, void *userdata); + void (*notify_booting) (VasEBoot_menu_entry_t entry, void *userdata); /* Called when executing one entry has failed, and another entry, ENTRY, will be executed as a fallback. The implementation of this function should delay for a period of at least 2 seconds before returning in order to allow the user time to read the information before it can be lost by executing ENTRY. */ - void (*notify_fallback) (grub_menu_entry_t entry, void *userdata); + void (*notify_fallback) (VasEBoot_menu_entry_t entry, void *userdata); /* Called when an entry has failed to execute and there is no remaining fallback entry to attempt. */ void (*notify_failure) (void *userdata); } -*grub_menu_execute_callback_t; +*VasEBoot_menu_execute_callback_t; -grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no); -int grub_menu_get_timeout (void); -void grub_menu_set_timeout (int timeout); -void grub_menu_entry_run (grub_menu_entry_t entry); -int grub_menu_get_default_entry_index (grub_menu_t menu); +VasEBoot_menu_entry_t VasEBoot_menu_get_entry (VasEBoot_menu_t menu, int no); +int VasEBoot_menu_get_timeout (void); +void VasEBoot_menu_set_timeout (int timeout); +void VasEBoot_menu_entry_run (VasEBoot_menu_entry_t entry); +int VasEBoot_menu_get_default_entry_index (VasEBoot_menu_t menu); -void grub_menu_init (void); -void grub_menu_fini (void); +void VasEBoot_menu_init (void); +void VasEBoot_menu_fini (void); -#endif /* GRUB_MENU_HEADER */ +#endif /* VasEBoot_MENU_HEADER */ diff --git a/include/VasEBoot/menu_viewer.h b/include/VasEBoot/menu_viewer.h index c6513c4e8..8c68360e1 100644 --- a/include/VasEBoot/menu_viewer.h +++ b/include/VasEBoot/menu_viewer.h @@ -1,34 +1,34 @@ /* menu_viewer.h - Interface to menu viewer implementations. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MENU_VIEWER_HEADER -#define GRUB_MENU_VIEWER_HEADER 1 +#ifndef VasEBoot_MENU_VIEWER_HEADER +#define VasEBoot_MENU_VIEWER_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -struct grub_menu_viewer +struct VasEBoot_menu_viewer { - struct grub_menu_viewer *next; + struct VasEBoot_menu_viewer *next; void *data; void (*set_chosen_entry) (int entry, void *data); void (*print_timeout) (int timeout, void *data); @@ -36,13 +36,13 @@ struct grub_menu_viewer void (*fini) (void *fini); }; -void grub_menu_register_viewer (struct grub_menu_viewer *viewer); +void VasEBoot_menu_register_viewer (struct VasEBoot_menu_viewer *viewer); -grub_err_t -grub_menu_try_text (struct grub_term_output *term, - int entry, grub_menu_t menu, int nested); +VasEBoot_err_t +VasEBoot_menu_try_text (struct VasEBoot_term_output *term, + int entry, VasEBoot_menu_t menu, int nested); -extern grub_err_t (*grub_gfxmenu_try_hook) (int entry, grub_menu_t menu, +extern VasEBoot_err_t (*VasEBoot_gfxmenu_try_hook) (int entry, VasEBoot_menu_t menu, int nested); -#endif /* GRUB_MENU_VIEWER_HEADER */ +#endif /* VasEBoot_MENU_VIEWER_HEADER */ diff --git a/include/VasEBoot/mips/arc/kernel.h b/include/VasEBoot/mips/arc/kernel.h index 50694866b..995c65ebc 100644 --- a/include/VasEBoot/mips/arc/kernel.h +++ b/include/VasEBoot/mips/arc/kernel.h @@ -1,2 +1,2 @@ -#include +#include diff --git a/include/VasEBoot/mips/arc/memory.h b/include/VasEBoot/mips/arc/memory.h index 77bb03d3e..f803e80f2 100644 --- a/include/VasEBoot/mips/arc/memory.h +++ b/include/VasEBoot/mips/arc/memory.h @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_MACHINE_HEADER -#define GRUB_MEMORY_MACHINE_HEADER 1 +#ifndef VasEBoot_MEMORY_MACHINE_HEADER +#define VasEBoot_MEMORY_MACHINE_HEADER 1 -#ifdef GRUB_CPU_MIPSEL -#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x806ffff0 +#ifdef VasEBoot_CPU_MIPSEL +#define VasEBoot_MACHINE_MEMORY_STACK_HIGH 0x806ffff0 #else -#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x881ffff0 +#define VasEBoot_MACHINE_MEMORY_STACK_HIGH 0x881ffff0 #endif #ifndef ASM_FILE -static inline grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), +static inline VasEBoot_err_t +VasEBoot_machine_mmap_register (VasEBoot_uint64_t start __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +static inline VasEBoot_err_t +VasEBoot_machine_mmap_unregister (int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif diff --git a/include/VasEBoot/mips/asm.h b/include/VasEBoot/mips/asm.h index 4c397f4a0..25fcb7a54 100644 --- a/include/VasEBoot/mips/asm.h +++ b/include/VasEBoot/mips/asm.h @@ -1,18 +1,18 @@ -#ifndef GRUB_MIPS_ASM_HEADER -#define GRUB_MIPS_ASM_HEADER 1 +#ifndef VasEBoot_MIPS_ASM_HEADER +#define VasEBoot_MIPS_ASM_HEADER 1 #if defined(_MIPS_SIM) && defined(_ABIN32) && _MIPS_SIM == _ABIN32 -#define GRUB_ASM_T4 $a4 -#define GRUB_ASM_T5 $a5 -#define GRUB_ASM_SZREG 8 -#define GRUB_ASM_REG_S sd -#define GRUB_ASM_REG_L ld +#define VasEBoot_ASM_T4 $a4 +#define VasEBoot_ASM_T5 $a5 +#define VasEBoot_ASM_SZREG 8 +#define VasEBoot_ASM_REG_S sd +#define VasEBoot_ASM_REG_L ld #else -#define GRUB_ASM_T4 $t4 -#define GRUB_ASM_T5 $t5 -#define GRUB_ASM_SZREG 4 -#define GRUB_ASM_REG_S sw -#define GRUB_ASM_REG_L lw +#define VasEBoot_ASM_T4 $t4 +#define VasEBoot_ASM_T5 $t5 +#define VasEBoot_ASM_SZREG 4 +#define VasEBoot_ASM_REG_S sw +#define VasEBoot_ASM_REG_L lw #endif #endif diff --git a/include/VasEBoot/mips/at_keyboard.h b/include/VasEBoot/mips/at_keyboard.h index 0c307537d..7393f22e1 100644 --- a/include/VasEBoot/mips/at_keyboard.h +++ b/include/VasEBoot/mips/at_keyboard.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/mips/cmos.h b/include/VasEBoot/mips/cmos.h index 79a7a4c1b..0994c65a3 100644 --- a/include/VasEBoot/mips/cmos.h +++ b/include/VasEBoot/mips/cmos.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/mips/io.h b/include/VasEBoot/mips/io.h index dee76bde5..55e168a26 100644 --- a/include/VasEBoot/mips/io.h +++ b/include/VasEBoot/mips/io.h @@ -1,62 +1,62 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_IO_H -#define GRUB_IO_H 1 +#ifndef VasEBoot_IO_H +#define VasEBoot_IO_H 1 -#include +#include -typedef grub_addr_t grub_port_t; +typedef VasEBoot_addr_t VasEBoot_port_t; static __inline unsigned char -grub_inb (grub_port_t port) +VasEBoot_inb (VasEBoot_port_t port) { - return *(volatile grub_uint8_t *) port; + return *(volatile VasEBoot_uint8_t *) port; } static __inline unsigned short int -grub_inw (grub_port_t port) +VasEBoot_inw (VasEBoot_port_t port) { - return *(volatile grub_uint16_t *) port; + return *(volatile VasEBoot_uint16_t *) port; } static __inline unsigned int -grub_inl (grub_port_t port) +VasEBoot_inl (VasEBoot_port_t port) { - return *(volatile grub_uint32_t *) port; + return *(volatile VasEBoot_uint32_t *) port; } static __inline void -grub_outb (unsigned char value, grub_port_t port) +VasEBoot_outb (unsigned char value, VasEBoot_port_t port) { - *(volatile grub_uint8_t *) port = value; + *(volatile VasEBoot_uint8_t *) port = value; } static __inline void -grub_outw (unsigned short int value, grub_port_t port) +VasEBoot_outw (unsigned short int value, VasEBoot_port_t port) { - *(volatile grub_uint16_t *) port = value; + *(volatile VasEBoot_uint16_t *) port = value; } static __inline void -grub_outl (unsigned int value, grub_port_t port) +VasEBoot_outl (unsigned int value, VasEBoot_port_t port) { - *(volatile grub_uint32_t *) port = value; + *(volatile VasEBoot_uint32_t *) port = value; } #endif /* _SYS_IO_H */ diff --git a/include/VasEBoot/mips/kernel.h b/include/VasEBoot/mips/kernel.h index 07b08848d..88a5028d9 100644 --- a/include/VasEBoot/mips/kernel.h +++ b/include/VasEBoot/mips/kernel.h @@ -1,24 +1,24 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_CPU_HEADER -#define GRUB_KERNEL_CPU_HEADER 1 +#ifndef VasEBoot_KERNEL_CPU_HEADER +#define VasEBoot_KERNEL_CPU_HEADER 1 -#include +#include -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +#endif /* ! VasEBoot_KERNEL_MACHINE_HEADER */ diff --git a/include/VasEBoot/mips/loongson.h b/include/VasEBoot/mips/loongson.h index e6f0241f2..dd0968aaf 100644 --- a/include/VasEBoot/mips/loongson.h +++ b/include/VasEBoot/mips/loongson.h @@ -1,86 +1,86 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LOONGSON_CPU_HEADER -#define GRUB_LOONGSON_CPU_HEADER 1 +#ifndef VasEBoot_LOONGSON_CPU_HEADER +#define VasEBoot_LOONGSON_CPU_HEADER 1 -#include +#include -#define GRUB_CPU_LOONGSON_FLASH_START 0xbfc00000 -#define GRUB_CPU_LOONGSON_FLASH_TLB_REFILL 0xbfc00200 -#define GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR 0xbfc00300 -#define GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION 0xbfc00380 +#define VasEBoot_CPU_LOONGSON_FLASH_START 0xbfc00000 +#define VasEBoot_CPU_LOONGSON_FLASH_TLB_REFILL 0xbfc00200 +#define VasEBoot_CPU_LOONGSON_FLASH_CACHE_ERROR 0xbfc00300 +#define VasEBoot_CPU_LOONGSON_FLASH_OTHER_EXCEPTION 0xbfc00380 -#define GRUB_CPU_LOONGSON_DDR2_BASE 0xaffffe00 -#define GRUB_CPU_LOONGSON_DDR2_REG1_HI_8BANKS 0x00000001 -#define GRUB_CPU_LOONGSON_DDR2_REG_SIZE 0x8 -#define GRUB_CPU_LOONGSON_DDR2_REG_STEP 0x10 +#define VasEBoot_CPU_LOONGSON_DDR2_BASE 0xaffffe00 +#define VasEBoot_CPU_LOONGSON_DDR2_REG1_HI_8BANKS 0x00000001 +#define VasEBoot_CPU_LOONGSON_DDR2_REG_SIZE 0x8 +#define VasEBoot_CPU_LOONGSON_DDR2_REG_STEP 0x10 -#define GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG GRUB_CPU_REGISTER_WRAP($16) -#define GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG_ILINESIZE 0x10 -#define GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG_DLINESIZE 0x8 -#define GRUB_CPU_LOONGSON_COP0_CACHE_DSIZE_SHIFT 6 -#define GRUB_CPU_LOONGSON_COP0_CACHE_ISIZE_SHIFT 9 -#define GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_MASK 0x7 -#define GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET 12 +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG VasEBoot_CPU_REGISTER_WRAP($16) +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG_ILINESIZE 0x10 +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_CONFIG_DLINESIZE 0x8 +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_DSIZE_SHIFT 6 +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_ISIZE_SHIFT 9 +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_SIZE_MASK 0x7 +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET 12 -#define GRUB_CPU_LOONGSON_COP0_I_INDEX_INVALIDATE 0 -#define GRUB_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE 9 -#define GRUB_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE 11 +#define VasEBoot_CPU_LOONGSON_COP0_I_INDEX_INVALIDATE 0 +#define VasEBoot_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE 9 +#define VasEBoot_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE 11 -#define GRUB_CPU_LOONGSON_COP0_I_INDEX_BIT_OFFSET 5 -#define GRUB_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET 5 -#define GRUB_CPU_LOONGSON_COP0_S_INDEX_BIT_OFFSET 5 +#define VasEBoot_CPU_LOONGSON_COP0_I_INDEX_BIT_OFFSET 5 +#define VasEBoot_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET 5 +#define VasEBoot_CPU_LOONGSON_COP0_S_INDEX_BIT_OFFSET 5 -#define GRUB_CPU_LOONGSON_CACHE_ACCELERATED 7 -#define GRUB_CPU_LOONGSON_CACHE_UNCACHED 2 -#define GRUB_CPU_LOONGSON_CACHE_CACHED 3 -#define GRUB_CPU_LOONGSON_CACHE_TYPE_MASK 7 -#define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_SMALL 4 -#define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG 5 -#define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_SMALL 16 -#define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_BIG 32 +#define VasEBoot_CPU_LOONGSON_CACHE_ACCELERATED 7 +#define VasEBoot_CPU_LOONGSON_CACHE_UNCACHED 2 +#define VasEBoot_CPU_LOONGSON_CACHE_CACHED 3 +#define VasEBoot_CPU_LOONGSON_CACHE_TYPE_MASK 7 +#define VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_SMALL 4 +#define VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG 5 +#define VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_SMALL 16 +#define VasEBoot_CPU_LOONGSON_CACHE_LINE_SIZE_BIG 32 -#define GRUB_CPU_LOONGSON_I_CACHE_LOG_WAYS 2 -#define GRUB_CPU_LOONGSON_D_CACHE_LOG_WAYS 2 -#define GRUB_CPU_LOONGSON_S_CACHE_LOG_WAYS 2 +#define VasEBoot_CPU_LOONGSON_I_CACHE_LOG_WAYS 2 +#define VasEBoot_CPU_LOONGSON_D_CACHE_LOG_WAYS 2 +#define VasEBoot_CPU_LOONGSON_S_CACHE_LOG_WAYS 2 /* FIXME: determine dynamically. */ -#define GRUB_CPU_LOONGSON_SECONDARY_CACHE_LOG_SIZE 19 +#define VasEBoot_CPU_LOONGSON_SECONDARY_CACHE_LOG_SIZE 19 -#define GRUB_CPU_LOONGSON_COP0_BADVADDR GRUB_CPU_REGISTER_WRAP($8) -#define GRUB_CPU_LOONGSON_COP0_CAUSE GRUB_CPU_REGISTER_WRAP($13) -#define GRUB_CPU_LOONGSON_COP0_EPC GRUB_CPU_REGISTER_WRAP($14) -#define GRUB_CPU_LOONGSON_COP0_PRID GRUB_CPU_REGISTER_WRAP($15) -#define GRUB_CPU_LOONGSON_COP0_CACHE_TAGLO GRUB_CPU_REGISTER_WRAP($28) -#define GRUB_CPU_LOONGSON_COP0_CACHE_TAGHI GRUB_CPU_REGISTER_WRAP($29) +#define VasEBoot_CPU_LOONGSON_COP0_BADVADDR VasEBoot_CPU_REGISTER_WRAP($8) +#define VasEBoot_CPU_LOONGSON_COP0_CAUSE VasEBoot_CPU_REGISTER_WRAP($13) +#define VasEBoot_CPU_LOONGSON_COP0_EPC VasEBoot_CPU_REGISTER_WRAP($14) +#define VasEBoot_CPU_LOONGSON_COP0_PRID VasEBoot_CPU_REGISTER_WRAP($15) +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_TAGLO VasEBoot_CPU_REGISTER_WRAP($28) +#define VasEBoot_CPU_LOONGSON_COP0_CACHE_TAGHI VasEBoot_CPU_REGISTER_WRAP($29) -#define GRUB_CPU_LOONGSON_LIOCFG 0xbfe00108 -#define GRUB_CPU_LOONGSON_ROM_DELAY_OFFSET 2 -#define GRUB_CPU_LOONGSON_ROM_DELAY_MASK 0x1f -#define GRUB_CPU_LOONGSON_CORECFG 0xbfe00180 -#define GRUB_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE 0x100 -#define GRUB_CPU_LOONGSON_CORECFG_BUFFER_CPU 0x200 +#define VasEBoot_CPU_LOONGSON_LIOCFG 0xbfe00108 +#define VasEBoot_CPU_LOONGSON_ROM_DELAY_OFFSET 2 +#define VasEBoot_CPU_LOONGSON_ROM_DELAY_MASK 0x1f +#define VasEBoot_CPU_LOONGSON_CORECFG 0xbfe00180 +#define VasEBoot_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE 0x100 +#define VasEBoot_CPU_LOONGSON_CORECFG_BUFFER_CPU 0x200 -#define GRUB_CPU_LOONGSON_PCI_HIT1_SEL_LO 0xbfe00150 -#define GRUB_CPU_LOONGSON_PCI_HIT1_SEL_HI 0xbfe00154 +#define VasEBoot_CPU_LOONGSON_PCI_HIT1_SEL_LO 0xbfe00150 +#define VasEBoot_CPU_LOONGSON_PCI_HIT1_SEL_HI 0xbfe00154 -#define GRUB_CPU_LOONGSON_GPIOCFG 0xbfe00120 -#define GRUB_CPU_YEELOONG_SHUTDOWN_GPIO 1 +#define VasEBoot_CPU_LOONGSON_GPIOCFG 0xbfe00120 +#define VasEBoot_CPU_YEELOONG_SHUTDOWN_GPIO 1 #endif diff --git a/include/VasEBoot/mips/loongson/at_keyboard.h b/include/VasEBoot/mips/loongson/at_keyboard.h index 8e58cfb17..fd639fa44 100644 --- a/include/VasEBoot/mips/loongson/at_keyboard.h +++ b/include/VasEBoot/mips/loongson/at_keyboard.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_AT_KEYBOARD_HEADER -#define GRUB_MACHINE_AT_KEYBOARD_HEADER 1 +#ifndef VasEBoot_MACHINE_AT_KEYBOARD_HEADER +#define VasEBoot_MACHINE_AT_KEYBOARD_HEADER 1 -#include +#include -#define KEYBOARD_REG_DATA (GRUB_MACHINE_PCI_IO_BASE | 0x60) -#define KEYBOARD_REG_STATUS (GRUB_MACHINE_PCI_IO_BASE | 0x64) +#define KEYBOARD_REG_DATA (VasEBoot_MACHINE_PCI_IO_BASE | 0x60) +#define KEYBOARD_REG_STATUS (VasEBoot_MACHINE_PCI_IO_BASE | 0x64) #endif diff --git a/include/VasEBoot/mips/loongson/cmos.h b/include/VasEBoot/mips/loongson/cmos.h index 0c8cc8dde..ab19a5353 100644 --- a/include/VasEBoot/mips/loongson/cmos.h +++ b/include/VasEBoot/mips/loongson/cmos.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_CMOS_H -#define GRUB_CPU_CMOS_H 1 +#ifndef VasEBoot_CPU_CMOS_H +#define VasEBoot_CPU_CMOS_H 1 -#include -#include +#include +#include -#define GRUB_CMOS_ADDR_REG 0xbfd00070 -#define GRUB_CMOS_DATA_REG 0xbfd00071 -#define GRUB_CMOS_ADDR_REG_HI 0xbfd00072 -#define GRUB_CMOS_DATA_REG_HI 0xbfd00073 +#define VasEBoot_CMOS_ADDR_REG 0xbfd00070 +#define VasEBoot_CMOS_DATA_REG 0xbfd00071 +#define VasEBoot_CMOS_ADDR_REG_HI 0xbfd00072 +#define VasEBoot_CMOS_DATA_REG_HI 0xbfd00073 -#endif /* GRUB_CPU_CMOS_H */ +#endif /* VasEBoot_CPU_CMOS_H */ diff --git a/include/VasEBoot/mips/loongson/ec.h b/include/VasEBoot/mips/loongson/ec.h index 3f8ff9931..97e79e0f8 100644 --- a/include/VasEBoot/mips/loongson/ec.h +++ b/include/VasEBoot/mips/loongson/ec.h @@ -1,45 +1,45 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EC_MACHINE_HEADER -#define GRUB_EC_MACHINE_HEADER 1 +#ifndef VasEBoot_EC_MACHINE_HEADER +#define VasEBoot_EC_MACHINE_HEADER 1 -#include -#include -#include +#include +#include +#include -#define GRUB_MACHINE_EC_MAGIC_PORT1 0x381 -#define GRUB_MACHINE_EC_MAGIC_PORT2 0x382 -#define GRUB_MACHINE_EC_DATA_PORT 0x383 +#define VasEBoot_MACHINE_EC_MAGIC_PORT1 0x381 +#define VasEBoot_MACHINE_EC_MAGIC_PORT2 0x382 +#define VasEBoot_MACHINE_EC_DATA_PORT 0x383 -#define GRUB_MACHINE_EC_MAGIC_VAL1 0xf4 -#define GRUB_MACHINE_EC_MAGIC_VAL2 0xec +#define VasEBoot_MACHINE_EC_MAGIC_VAL1 0xf4 +#define VasEBoot_MACHINE_EC_MAGIC_VAL2 0xec -#define GRUB_MACHINE_EC_COMMAND_REBOOT 1 +#define VasEBoot_MACHINE_EC_COMMAND_REBOOT 1 static inline void -grub_write_ec (grub_uint8_t value) +VasEBoot_write_ec (VasEBoot_uint8_t value) { - grub_outb (GRUB_MACHINE_EC_MAGIC_VAL1, - GRUB_MACHINE_PCI_IO_BASE + GRUB_MACHINE_EC_MAGIC_PORT1); - grub_outb (GRUB_MACHINE_EC_MAGIC_VAL2, - GRUB_MACHINE_PCI_IO_BASE + GRUB_MACHINE_EC_MAGIC_PORT2); - grub_outb (value, GRUB_MACHINE_PCI_IO_BASE + GRUB_MACHINE_EC_DATA_PORT); + VasEBoot_outb (VasEBoot_MACHINE_EC_MAGIC_VAL1, + VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_MACHINE_EC_MAGIC_PORT1); + VasEBoot_outb (VasEBoot_MACHINE_EC_MAGIC_VAL2, + VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_MACHINE_EC_MAGIC_PORT2); + VasEBoot_outb (value, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_MACHINE_EC_DATA_PORT); } #endif diff --git a/include/VasEBoot/mips/loongson/kernel.h b/include/VasEBoot/mips/loongson/kernel.h index 05871910b..1fb3df5b5 100644 --- a/include/VasEBoot/mips/loongson/kernel.h +++ b/include/VasEBoot/mips/loongson/kernel.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 +#ifndef VasEBoot_KERNEL_MACHINE_HEADER +#define VasEBoot_KERNEL_MACHINE_HEADER 1 -#include -#include +#include +#include -#define GRUB_ARCH_MACHINE_YEELOONG 0 -#define GRUB_ARCH_MACHINE_FULOONG2F 1 -#define GRUB_ARCH_MACHINE_FULOONG2E 2 -#define GRUB_ARCH_MACHINE_YEELOONG_3A 3 +#define VasEBoot_ARCH_MACHINE_YEELOONG 0 +#define VasEBoot_ARCH_MACHINE_FULOONG2F 1 +#define VasEBoot_ARCH_MACHINE_FULOONG2E 2 +#define VasEBoot_ARCH_MACHINE_YEELOONG_3A 3 #ifndef ASM_FILE -extern grub_uint32_t EXPORT_VAR (grub_arch_machine) __attribute__ ((section(".text"))); +extern VasEBoot_uint32_t EXPORT_VAR (VasEBoot_arch_machine) __attribute__ ((section(".text"))); #endif -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +#endif /* ! VasEBoot_KERNEL_MACHINE_HEADER */ diff --git a/include/VasEBoot/mips/loongson/memory.h b/include/VasEBoot/mips/loongson/memory.h index aa41fa626..f8b98efa5 100644 --- a/include/VasEBoot/mips/loongson/memory.h +++ b/include/VasEBoot/mips/loongson/memory.h @@ -1,50 +1,50 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_MACHINE_HEADER -#define GRUB_MEMORY_MACHINE_HEADER 1 +#ifndef VasEBoot_MEMORY_MACHINE_HEADER +#define VasEBoot_MEMORY_MACHINE_HEADER 1 #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include #endif -#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x801ffff0 +#define VasEBoot_MACHINE_MEMORY_STACK_HIGH 0x801ffff0 #ifndef ASM_FILE -static inline grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), +static inline VasEBoot_err_t +VasEBoot_machine_mmap_register (VasEBoot_uint64_t start __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +static inline VasEBoot_err_t +VasEBoot_machine_mmap_unregister (int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -extern grub_uint32_t EXPORT_VAR (grub_arch_memsize) __attribute__ ((section(".text"))); -extern grub_uint32_t EXPORT_VAR (grub_arch_highmemsize) __attribute__ ((section(".text"))); +extern VasEBoot_uint32_t EXPORT_VAR (VasEBoot_arch_memsize) __attribute__ ((section(".text"))); +extern VasEBoot_uint32_t EXPORT_VAR (VasEBoot_arch_highmemsize) __attribute__ ((section(".text"))); #endif diff --git a/include/VasEBoot/mips/loongson/pci.h b/include/VasEBoot/mips/loongson/pci.h index b3272e922..89524b571 100644 --- a/include/VasEBoot/mips/loongson/pci.h +++ b/include/VasEBoot/mips/loongson/pci.h @@ -1,110 +1,110 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_PCI_H -#define GRUB_MACHINE_PCI_H 1 +#ifndef VasEBoot_MACHINE_PCI_H +#define VasEBoot_MACHINE_PCI_H 1 #ifndef ASM_FILE -#include -#include +#include +#include #endif -#define GRUB_LOONGSON_OHCI_PCIID 0x00351033 -#define GRUB_LOONGSON_EHCI_PCIID 0x00e01033 +#define VasEBoot_LOONGSON_OHCI_PCIID 0x00351033 +#define VasEBoot_LOONGSON_EHCI_PCIID 0x00e01033 -#define GRUB_MACHINE_PCI_IO_BASE_2F 0xbfd00000 -#define GRUB_MACHINE_PCI_IO_BASE_3A 0xb8000000 -#define GRUB_MACHINE_PCI_CONFSPACE_2F 0xbfe80000 -#define GRUB_MACHINE_PCI_CONFSPACE_3A 0xba000000 -#define GRUB_MACHINE_PCI_CONFSPACE_3A_EXT 0xbb000000 -#define GRUB_MACHINE_PCI_CONTROLLER_HEADER 0xbfe00000 +#define VasEBoot_MACHINE_PCI_IO_BASE_2F 0xbfd00000 +#define VasEBoot_MACHINE_PCI_IO_BASE_3A 0xb8000000 +#define VasEBoot_MACHINE_PCI_CONFSPACE_2F 0xbfe80000 +#define VasEBoot_MACHINE_PCI_CONFSPACE_3A 0xba000000 +#define VasEBoot_MACHINE_PCI_CONFSPACE_3A_EXT 0xbb000000 +#define VasEBoot_MACHINE_PCI_CONTROLLER_HEADER 0xbfe00000 -#define GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F 0xbfe00118 +#define VasEBoot_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F 0xbfe00118 -#define GRUB_PCI_NUM_DEVICES_2F 16 +#define VasEBoot_PCI_NUM_DEVICES_2F 16 #ifndef ASM_FILE -typedef enum { GRUB_BONITO_2F, GRUB_BONITO_3A } grub_bonito_type_t; -extern grub_bonito_type_t EXPORT_VAR (grub_bonito_type); +typedef enum { VasEBoot_BONITO_2F, VasEBoot_BONITO_3A } VasEBoot_bonito_type_t; +extern VasEBoot_bonito_type_t EXPORT_VAR (VasEBoot_bonito_type); -#define GRUB_PCI_NUM_DEVICES (grub_bonito_type ? 32 \ - : GRUB_PCI_NUM_DEVICES_2F) -#define GRUB_PCI_NUM_BUS (grub_bonito_type ? 256 : 1) +#define VasEBoot_PCI_NUM_DEVICES (VasEBoot_bonito_type ? 32 \ + : VasEBoot_PCI_NUM_DEVICES_2F) +#define VasEBoot_PCI_NUM_BUS (VasEBoot_bonito_type ? 256 : 1) -#define GRUB_MACHINE_PCI_IO_BASE (grub_bonito_type \ - ? GRUB_MACHINE_PCI_IO_BASE_3A \ - : GRUB_MACHINE_PCI_IO_BASE_2F) +#define VasEBoot_MACHINE_PCI_IO_BASE (VasEBoot_bonito_type \ + ? VasEBoot_MACHINE_PCI_IO_BASE_3A \ + : VasEBoot_MACHINE_PCI_IO_BASE_2F) -#define GRUB_MACHINE_PCI_CONF_CTRL_REG_2F (*(volatile grub_uint32_t *) \ - GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F) -#define GRUB_MACHINE_PCI_IO_CTRL_REG_2F (*(volatile grub_uint32_t *) 0xbfe00110) -#define GRUB_MACHINE_PCI_CONF_CTRL_REG_3A (*(volatile grub_uint32_t *) \ +#define VasEBoot_MACHINE_PCI_CONF_CTRL_REG_2F (*(volatile VasEBoot_uint32_t *) \ + VasEBoot_MACHINE_PCI_CONF_CTRL_REG_ADDR_2F) +#define VasEBoot_MACHINE_PCI_IO_CTRL_REG_2F (*(volatile VasEBoot_uint32_t *) 0xbfe00110) +#define VasEBoot_MACHINE_PCI_CONF_CTRL_REG_3A (*(volatile VasEBoot_uint32_t *) \ 0xbfe00118) #endif -#define GRUB_MACHINE_PCI_WIN_MASK_SIZE 6 -#define GRUB_MACHINE_PCI_WIN_MASK ((1 << GRUB_MACHINE_PCI_WIN_MASK_SIZE) - 1) +#define VasEBoot_MACHINE_PCI_WIN_MASK_SIZE 6 +#define VasEBoot_MACHINE_PCI_WIN_MASK ((1 << VasEBoot_MACHINE_PCI_WIN_MASK_SIZE) - 1) /* We have 3 PCI windows. */ -#define GRUB_MACHINE_PCI_NUM_WIN 3 +#define VasEBoot_MACHINE_PCI_NUM_WIN 3 /* Each window is 64MiB. */ -#define GRUB_MACHINE_PCI_WIN_SHIFT 26 -#define GRUB_MACHINE_PCI_WIN_OFFSET_MASK ((1 << GRUB_MACHINE_PCI_WIN_SHIFT) - 1) +#define VasEBoot_MACHINE_PCI_WIN_SHIFT 26 +#define VasEBoot_MACHINE_PCI_WIN_OFFSET_MASK ((1 << VasEBoot_MACHINE_PCI_WIN_SHIFT) - 1) -#define GRUB_MACHINE_PCI_WIN_SIZE 0x04000000 +#define VasEBoot_MACHINE_PCI_WIN_SIZE 0x04000000 /* Graphical acceleration takes 1 MiB away. */ -#define GRUB_MACHINE_PCI_WIN1_SIZE 0x03f00000 +#define VasEBoot_MACHINE_PCI_WIN1_SIZE 0x03f00000 -#define GRUB_MACHINE_PCI_WIN1_ADDR 0xb0000000 -#define GRUB_MACHINE_PCI_WIN2_ADDR 0xb4000000 -#define GRUB_MACHINE_PCI_WIN3_ADDR 0xb8000000 +#define VasEBoot_MACHINE_PCI_WIN1_ADDR 0xb0000000 +#define VasEBoot_MACHINE_PCI_WIN2_ADDR 0xb4000000 +#define VasEBoot_MACHINE_PCI_WIN3_ADDR 0xb8000000 #ifndef ASM_FILE -grub_uint32_t -EXPORT_FUNC (grub_pci_read) (grub_pci_address_t addr); +VasEBoot_uint32_t +EXPORT_FUNC (VasEBoot_pci_read) (VasEBoot_pci_address_t addr); -grub_uint16_t -EXPORT_FUNC (grub_pci_read_word) (grub_pci_address_t addr); +VasEBoot_uint16_t +EXPORT_FUNC (VasEBoot_pci_read_word) (VasEBoot_pci_address_t addr); -grub_uint8_t -EXPORT_FUNC (grub_pci_read_byte) (grub_pci_address_t addr); +VasEBoot_uint8_t +EXPORT_FUNC (VasEBoot_pci_read_byte) (VasEBoot_pci_address_t addr); void -EXPORT_FUNC (grub_pci_write) (grub_pci_address_t addr, grub_uint32_t data); +EXPORT_FUNC (VasEBoot_pci_write) (VasEBoot_pci_address_t addr, VasEBoot_uint32_t data); void -EXPORT_FUNC (grub_pci_write_word) (grub_pci_address_t addr, grub_uint16_t data); +EXPORT_FUNC (VasEBoot_pci_write_word) (VasEBoot_pci_address_t addr, VasEBoot_uint16_t data); void -EXPORT_FUNC (grub_pci_write_byte) (grub_pci_address_t addr, grub_uint8_t data); +EXPORT_FUNC (VasEBoot_pci_write_byte) (VasEBoot_pci_address_t addr, VasEBoot_uint8_t data); volatile void * -EXPORT_FUNC (grub_pci_device_map_range) (grub_pci_device_t dev, - grub_addr_t base, grub_size_t size); +EXPORT_FUNC (VasEBoot_pci_device_map_range) (VasEBoot_pci_device_t dev, + VasEBoot_addr_t base, VasEBoot_size_t size); void * -EXPORT_FUNC (grub_pci_device_map_range_cached) (grub_pci_device_t dev, - grub_addr_t base, - grub_size_t size); +EXPORT_FUNC (VasEBoot_pci_device_map_range_cached) (VasEBoot_pci_device_t dev, + VasEBoot_addr_t base, + VasEBoot_size_t size); void -EXPORT_FUNC (grub_pci_device_unmap_range) (grub_pci_device_t dev, +EXPORT_FUNC (VasEBoot_pci_device_unmap_range) (VasEBoot_pci_device_t dev, volatile void *mem, - grub_size_t size); + VasEBoot_size_t size); #endif -#endif /* GRUB_MACHINE_PCI_H */ +#endif /* VasEBoot_MACHINE_PCI_H */ diff --git a/include/VasEBoot/mips/loongson/serial.h b/include/VasEBoot/mips/loongson/serial.h index 45e6d8457..246c1ce51 100644 --- a/include/VasEBoot/mips/loongson/serial.h +++ b/include/VasEBoot/mips/loongson/serial.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_SERIAL_HEADER -#define GRUB_MACHINE_SERIAL_HEADER 1 +#ifndef VasEBoot_MACHINE_SERIAL_HEADER +#define VasEBoot_MACHINE_SERIAL_HEADER 1 -#define GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200 2 -#define GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200 1 -#define GRUB_MACHINE_SERIAL_PORT0 0xbff003f8 -#define GRUB_MACHINE_SERIAL_PORT1 0xbfd003f8 -#define GRUB_MACHINE_SERIAL_PORT2 0xbfd002f8 +#define VasEBoot_MACHINE_SERIAL_PORT0_DIVISOR_115200 2 +#define VasEBoot_MACHINE_SERIAL_PORT2_DIVISOR_115200 1 +#define VasEBoot_MACHINE_SERIAL_PORT0 0xbff003f8 +#define VasEBoot_MACHINE_SERIAL_PORT1 0xbfd003f8 +#define VasEBoot_MACHINE_SERIAL_PORT2 0xbfd002f8 #ifndef ASM_FILE -#define GRUB_MACHINE_SERIAL_PORTS { GRUB_MACHINE_SERIAL_PORT0, GRUB_MACHINE_SERIAL_PORT1, GRUB_MACHINE_SERIAL_PORT2 } +#define VasEBoot_MACHINE_SERIAL_PORTS { VasEBoot_MACHINE_SERIAL_PORT0, VasEBoot_MACHINE_SERIAL_PORT1, VasEBoot_MACHINE_SERIAL_PORT2 } #else #endif diff --git a/include/VasEBoot/mips/loongson/time.h b/include/VasEBoot/mips/loongson/time.h index 098573261..2224560cc 100644 --- a/include/VasEBoot/mips/loongson/time.h +++ b/include/VasEBoot/mips/loongson/time.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_MACHINE_TIME_HEADER #define KERNEL_MACHINE_TIME_HEADER 1 -#include -#include +#include +#include -extern grub_uint32_t EXPORT_VAR (grub_arch_busclock) __attribute__ ((section(".text"))); +extern VasEBoot_uint32_t EXPORT_VAR (VasEBoot_arch_busclock) __attribute__ ((section(".text"))); #endif /* ! KERNEL_MACHINE_TIME_HEADER */ diff --git a/include/VasEBoot/mips/memory.h b/include/VasEBoot/mips/memory.h index a85bbe752..44a68e380 100644 --- a/include/VasEBoot/mips/memory.h +++ b/include/VasEBoot/mips/memory.h @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_CPU_HEADER -#define GRUB_MEMORY_CPU_HEADER 1 +#ifndef VasEBoot_MEMORY_CPU_HEADER +#define VasEBoot_MEMORY_CPU_HEADER 1 #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include #endif -#define GRUB_ARCH_LOWMEMVSTART 0x80000000 -#define GRUB_ARCH_LOWMEMPSTART 0x00000000 -#define GRUB_ARCH_LOWMEMMAXSIZE 0x10000000 -#define GRUB_ARCH_HIGHMEMPSTART 0x10000000 +#define VasEBoot_ARCH_LOWMEMVSTART 0x80000000 +#define VasEBoot_ARCH_LOWMEMPSTART 0x00000000 +#define VasEBoot_ARCH_LOWMEMMAXSIZE 0x10000000 +#define VasEBoot_ARCH_HIGHMEMPSTART 0x10000000 #ifndef ASM_FILE -typedef grub_addr_t grub_phys_addr_t; +typedef VasEBoot_addr_t VasEBoot_phys_addr_t; -static inline grub_phys_addr_t -grub_vtop (void *a) +static inline VasEBoot_phys_addr_t +VasEBoot_vtop (void *a) { - return ((grub_phys_addr_t) a) & 0x1fffffff; + return ((VasEBoot_phys_addr_t) a) & 0x1fffffff; } static inline void * -grub_map_memory (grub_phys_addr_t a, grub_size_t size __attribute__ ((unused))) +VasEBoot_map_memory (VasEBoot_phys_addr_t a, VasEBoot_size_t size __attribute__ ((unused))) { return (void *) (a | 0x80000000); } static inline void -grub_unmap_memory (void *a __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused))) +VasEBoot_unmap_memory (void *a __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused))) { } -grub_uint64_t grub_mmap_get_lower (void); -grub_uint64_t grub_mmap_get_upper (void); +VasEBoot_uint64_t VasEBoot_mmap_get_lower (void); +VasEBoot_uint64_t VasEBoot_mmap_get_upper (void); #endif diff --git a/include/VasEBoot/mips/mips.h b/include/VasEBoot/mips/mips.h index bafb2bde0..228cd081a 100644 --- a/include/VasEBoot/mips/mips.h +++ b/include/VasEBoot/mips/mips.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_REGISTERS_CPU_HEADER -#define GRUB_REGISTERS_CPU_HEADER 1 +#ifndef VasEBoot_REGISTERS_CPU_HEADER +#define VasEBoot_REGISTERS_CPU_HEADER 1 #ifdef ASM_FILE -#define GRUB_CPU_REGISTER_WRAP(x) x +#define VasEBoot_CPU_REGISTER_WRAP(x) x #else -#define GRUB_CPU_REGISTER_WRAP(x) #x +#define VasEBoot_CPU_REGISTER_WRAP(x) #x #endif -#define GRUB_CPU_MIPS_COP0_TIMER_COUNT GRUB_CPU_REGISTER_WRAP($9) +#define VasEBoot_CPU_MIPS_COP0_TIMER_COUNT VasEBoot_CPU_REGISTER_WRAP($9) #endif diff --git a/include/VasEBoot/mips/multiboot.h b/include/VasEBoot/mips/multiboot.h index 4aebf29e7..84536447b 100644 --- a/include/VasEBoot/mips/multiboot.h +++ b/include/VasEBoot/mips/multiboot.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MULTIBOOT_CPU_HEADER -#define GRUB_MULTIBOOT_CPU_HEADER 1 +#ifndef VasEBoot_MULTIBOOT_CPU_HEADER +#define VasEBoot_MULTIBOOT_CPU_HEADER 1 #define MULTIBOOT_INITIAL_STATE { .gpr[4] = MULTIBOOT_BOOTLOADER_MAGIC, \ .jumpreg = 1 } @@ -28,4 +28,4 @@ #define MULTIBOOT_ELF32_MACHINE EM_MIPS #define MULTIBOOT_ELF64_MACHINE EM_MIPS -#endif /* ! GRUB_MULTIBOOT_CPU_HEADER */ +#endif /* ! VasEBoot_MULTIBOOT_CPU_HEADER */ diff --git a/include/VasEBoot/mips/pci.h b/include/VasEBoot/mips/pci.h index 8b49d8479..8f13ad5ee 100644 --- a/include/VasEBoot/mips/pci.h +++ b/include/VasEBoot/mips/pci.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/mips/qemu_mips/at_keyboard.h b/include/VasEBoot/mips/qemu_mips/at_keyboard.h index 37cc625d1..c9e40645f 100644 --- a/include/VasEBoot/mips/qemu_mips/at_keyboard.h +++ b/include/VasEBoot/mips/qemu_mips/at_keyboard.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_AT_KEYBOARD_HEADER -#define GRUB_MACHINE_AT_KEYBOARD_HEADER 1 +#ifndef VasEBoot_MACHINE_AT_KEYBOARD_HEADER +#define VasEBoot_MACHINE_AT_KEYBOARD_HEADER 1 #define KEYBOARD_REG_DATA 0xb4000060 #define KEYBOARD_REG_STATUS 0xb4000064 diff --git a/include/VasEBoot/mips/qemu_mips/cmos.h b/include/VasEBoot/mips/qemu_mips/cmos.h index 0759704e3..9af12e3c2 100644 --- a/include/VasEBoot/mips/qemu_mips/cmos.h +++ b/include/VasEBoot/mips/qemu_mips/cmos.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CPU_CMOS_H -#define GRUB_CPU_CMOS_H 1 +#ifndef VasEBoot_CPU_CMOS_H +#define VasEBoot_CPU_CMOS_H 1 -#include -#include +#include +#include -#define GRUB_CMOS_ADDR_REG 0xb4000070 -#define GRUB_CMOS_DATA_REG 0xb4000071 -#define GRUB_CMOS_ADDR_REG_HI 0xb4000072 -#define GRUB_CMOS_DATA_REG_HI 0xb4000073 +#define VasEBoot_CMOS_ADDR_REG 0xb4000070 +#define VasEBoot_CMOS_DATA_REG 0xb4000071 +#define VasEBoot_CMOS_ADDR_REG_HI 0xb4000072 +#define VasEBoot_CMOS_DATA_REG_HI 0xb4000073 -#endif /* GRUB_CPU_CMOS_H */ +#endif /* VasEBoot_CPU_CMOS_H */ diff --git a/include/VasEBoot/mips/qemu_mips/console.h b/include/VasEBoot/mips/qemu_mips/console.h index 2ffef7300..ec410151e 100644 --- a/include/VasEBoot/mips/qemu_mips/console.h +++ b/include/VasEBoot/mips/qemu_mips/console.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_CONSOLE_HEADER -#define GRUB_MACHINE_CONSOLE_HEADER 1 +#ifndef VasEBoot_MACHINE_CONSOLE_HEADER +#define VasEBoot_MACHINE_CONSOLE_HEADER 1 -void grub_vga_text_init (void); -void grub_vga_text_fini (void); +void VasEBoot_vga_text_init (void); +void VasEBoot_vga_text_fini (void); -#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */ +#endif /* ! VasEBoot_MACHINE_CONSOLE_HEADER */ diff --git a/include/VasEBoot/mips/qemu_mips/kernel.h b/include/VasEBoot/mips/qemu_mips/kernel.h index 8b8b0149e..1b3e8f28c 100644 --- a/include/VasEBoot/mips/qemu_mips/kernel.h +++ b/include/VasEBoot/mips/qemu_mips/kernel.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 +#ifndef VasEBoot_KERNEL_MACHINE_HEADER +#define VasEBoot_KERNEL_MACHINE_HEADER 1 -#include +#include #ifndef ASM_FILE -void grub_qemu_init_cirrus (void); +void VasEBoot_qemu_init_cirrus (void); #endif -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +#endif /* ! VasEBoot_KERNEL_MACHINE_HEADER */ diff --git a/include/VasEBoot/mips/qemu_mips/memory.h b/include/VasEBoot/mips/qemu_mips/memory.h index 29b04a5ad..fa798bd65 100644 --- a/include/VasEBoot/mips/qemu_mips/memory.h +++ b/include/VasEBoot/mips/qemu_mips/memory.h @@ -1,49 +1,49 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_MACHINE_HEADER -#define GRUB_MEMORY_MACHINE_HEADER 1 +#ifndef VasEBoot_MEMORY_MACHINE_HEADER +#define VasEBoot_MEMORY_MACHINE_HEADER 1 #ifndef ASM_FILE -#include -#include -#include +#include +#include +#include #endif -#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x80f00000 -#define GRUB_MACHINE_MEMORY_USABLE 0x81000000 +#define VasEBoot_MACHINE_MEMORY_STACK_HIGH 0x80f00000 +#define VasEBoot_MACHINE_MEMORY_USABLE 0x81000000 #ifndef ASM_FILE -extern grub_uint32_t grub_arch_memsize __attribute__ ((section(".text"))); +extern VasEBoot_uint32_t VasEBoot_arch_memsize __attribute__ ((section(".text"))); -static inline grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), +static inline VasEBoot_err_t +VasEBoot_machine_mmap_register (VasEBoot_uint64_t start __attribute__ ((unused)), + VasEBoot_uint64_t size __attribute__ ((unused)), int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } -static inline grub_err_t -grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +static inline VasEBoot_err_t +VasEBoot_machine_mmap_unregister (int handle __attribute__ ((unused))) { - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif diff --git a/include/VasEBoot/mips/qemu_mips/serial.h b/include/VasEBoot/mips/qemu_mips/serial.h index 1708678dc..25e095443 100644 --- a/include/VasEBoot/mips/qemu_mips/serial.h +++ b/include/VasEBoot/mips/qemu_mips/serial.h @@ -1,24 +1,24 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MACHINE_SERIAL_HEADER -#define GRUB_MACHINE_SERIAL_HEADER 1 +#ifndef VasEBoot_MACHINE_SERIAL_HEADER +#define VasEBoot_MACHINE_SERIAL_HEADER 1 -#define GRUB_MACHINE_SERIAL_PORTS { 0xb40003f8 } +#define VasEBoot_MACHINE_SERIAL_PORTS { 0xb40003f8 } #endif diff --git a/include/VasEBoot/mips/qemu_mips/time.h b/include/VasEBoot/mips/qemu_mips/time.h index 164b61ef8..bd6ecd396 100644 --- a/include/VasEBoot/mips/qemu_mips/time.h +++ b/include/VasEBoot/mips/qemu_mips/time.h @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_MACHINE_TIME_HEADER #define KERNEL_MACHINE_TIME_HEADER 1 -#include -#include +#include +#include #endif /* ! KERNEL_MACHINE_TIME_HEADER */ diff --git a/include/VasEBoot/mips/relocator.h b/include/VasEBoot/mips/relocator.h index 67b0a4c43..99c7982bb 100644 --- a/include/VasEBoot/mips/relocator.h +++ b/include/VasEBoot/mips/relocator.h @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RELOCATOR_CPU_HEADER -#define GRUB_RELOCATOR_CPU_HEADER 1 +#ifndef VasEBoot_RELOCATOR_CPU_HEADER +#define VasEBoot_RELOCATOR_CPU_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_relocator32_state +struct VasEBoot_relocator32_state { /* gpr[0] is ignored since it's hardwired to 0. */ - grub_uint32_t gpr[32]; + VasEBoot_uint32_t gpr[32]; /* Register holding target $pc. */ int jumpreg; }; -grub_err_t -grub_relocator32_boot (struct grub_relocator *rel, - struct grub_relocator32_state state); +VasEBoot_err_t +VasEBoot_relocator32_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator32_state state); -#endif /* ! GRUB_RELOCATOR_CPU_HEADER */ +#endif /* ! VasEBoot_RELOCATOR_CPU_HEADER */ diff --git a/include/VasEBoot/mips/setjmp.h b/include/VasEBoot/mips/setjmp.h index f8f6517ac..0efbf6a96 100644 --- a/include/VasEBoot/mips/setjmp.h +++ b/include/VasEBoot/mips/setjmp.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -typedef grub_uint64_t grub_jmp_buf[12]; +typedef VasEBoot_uint64_t VasEBoot_jmp_buf[12]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)); -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/mips/time.h b/include/VasEBoot/mips/time.h index f5c891a3a..30b76be99 100644 --- a/include/VasEBoot/mips/time.h +++ b/include/VasEBoot/mips/time.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL -#define GRUB_TICKS_PER_SECOND (grub_arch_cpuclock / 2) +#define VasEBoot_TICKS_PER_SECOND (VasEBoot_arch_cpuclock / 2) /* Return the real time in ticks. */ -grub_uint64_t EXPORT_FUNC (grub_get_rtc) (void); +VasEBoot_uint64_t EXPORT_FUNC (VasEBoot_get_rtc) (void); -extern grub_uint32_t EXPORT_VAR (grub_arch_cpuclock) __attribute__ ((section(".text"))); +extern VasEBoot_uint32_t EXPORT_VAR (VasEBoot_arch_cpuclock) __attribute__ ((section(".text"))); #endif static inline void -grub_cpu_idle(void) +VasEBoot_cpu_idle(void) { } diff --git a/include/VasEBoot/mips/types.h b/include/VasEBoot/mips/types.h index fe09afa3e..0ea2a989e 100644 --- a/include/VasEBoot/mips/types.h +++ b/include/VasEBoot/mips/types.h @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 4 +#define VasEBoot_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 4 +#define VasEBoot_TARGET_SIZEOF_LONG 4 -#ifdef GRUB_CPU_MIPSEL +#ifdef VasEBoot_CPU_MIPSEL /* mipsEL is little-endian. */ -#undef GRUB_TARGET_WORDS_BIGENDIAN -#elif defined (GRUB_CPU_MIPS) +#undef VasEBoot_TARGET_WORDS_BIGENDIAN +#elif defined (VasEBoot_CPU_MIPS) /* mips is big-endian. */ -#define GRUB_TARGET_WORDS_BIGENDIAN -#elif !defined (GRUB_SYMBOL_GENERATOR) -#error Neither GRUB_CPU_MIPS nor GRUB_CPU_MIPSEL is defined +#define VasEBoot_TARGET_WORDS_BIGENDIAN +#elif !defined (VasEBoot_SYMBOL_GENERATOR) +#error Neither VasEBoot_CPU_MIPS nor VasEBoot_CPU_MIPSEL is defined #endif -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/misc.h b/include/VasEBoot/misc.h index 2a9f87cc2..761b62e6a 100644 --- a/include/VasEBoot/misc.h +++ b/include/VasEBoot/misc.h @@ -1,31 +1,31 @@ /* misc.h - prototypes for misc functions */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MISC_HEADER -#define GRUB_MISC_HEADER 1 +#ifndef VasEBoot_MISC_HEADER +#define VasEBoot_MISC_HEADER 1 #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define ALIGN_UP(addr, align) \ ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1)) @@ -35,13 +35,13 @@ #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) #define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; } -#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__) +#define VasEBoot_dprintf(condition, ...) VasEBoot_real_dprintf(VasEBoot_FILE, __LINE__, condition, __VA_ARGS__) -void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n); -char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src); +void *EXPORT_FUNC(VasEBoot_memmove) (void *dest, const void *src, VasEBoot_size_t n); +char *EXPORT_FUNC(VasEBoot_strcpy) (char *dest, const char *src); static inline char * -grub_strncpy (char *dest, const char *src, int c) +VasEBoot_strncpy (char *dest, const char *src, int c) { char *p = dest; @@ -52,7 +52,7 @@ grub_strncpy (char *dest, const char *src, int c) } static inline char * -grub_stpcpy (char *dest, const char *src) +VasEBoot_stpcpy (char *dest, const char *src) { char *d = dest; const char *s = src; @@ -64,33 +64,33 @@ grub_stpcpy (char *dest, const char *src) return d - 1; } -/* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ +/* XXX: If VasEBoot_memmove is too slow, we must implement VasEBoot_memcpy. */ static inline void * -grub_memcpy (void *dest, const void *src, grub_size_t n) +VasEBoot_memcpy (void *dest, const void *src, VasEBoot_size_t n) { - return grub_memmove (dest, src, n); + return VasEBoot_memmove (dest, src, n); } -#if defined(__x86_64__) && !defined (GRUB_UTIL) +#if defined(__x86_64__) && !defined (VasEBoot_UTIL) #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (__MINGW64__) -#define GRUB_ASM_ATTR __attribute__ ((sysv_abi)) +#define VasEBoot_ASM_ATTR __attribute__ ((sysv_abi)) #else -#define GRUB_ASM_ATTR +#define VasEBoot_ASM_ATTR #endif #endif -int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); -int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2); -int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); +int EXPORT_FUNC(VasEBoot_memcmp) (const void *s1, const void *s2, VasEBoot_size_t n); +int EXPORT_FUNC(VasEBoot_strcmp) (const char *s1, const char *s2); +int EXPORT_FUNC(VasEBoot_strncmp) (const char *s1, const char *s2, VasEBoot_size_t n); -char *EXPORT_FUNC(grub_strchr) (const char *s, int c); -char *EXPORT_FUNC(grub_strrchr) (const char *s, int c); -int EXPORT_FUNC(grub_strword) (const char *s, const char *w); +char *EXPORT_FUNC(VasEBoot_strchr) (const char *s, int c); +char *EXPORT_FUNC(VasEBoot_strrchr) (const char *s, int c); +int EXPORT_FUNC(VasEBoot_strword) (const char *s, const char *w); /* Copied from gnulib. Written by Bruno Haible , 2005. */ static inline char * -grub_strstr (const char *haystack, const char *needle) +VasEBoot_strstr (const char *haystack, const char *needle) { /* Be careful not to look at the entire extent of haystack or needle until needed. This is useful because of these two cases: @@ -133,64 +133,64 @@ grub_strstr (const char *haystack, const char *needle) return (char *) haystack; } -int EXPORT_FUNC(grub_isspace) (int c); +int EXPORT_FUNC(VasEBoot_isspace) (int c); static inline int -grub_isprint (int c) +VasEBoot_isprint (int c) { return (c >= ' ' && c <= '~'); } static inline int -grub_iscntrl (int c) +VasEBoot_iscntrl (int c) { return (c >= 0x00 && c <= 0x1F) || c == 0x7F; } static inline int -grub_isalpha (int c) +VasEBoot_isalpha (int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } static inline int -grub_islower (int c) +VasEBoot_islower (int c) { return (c >= 'a' && c <= 'z'); } static inline int -grub_isupper (int c) +VasEBoot_isupper (int c) { return (c >= 'A' && c <= 'Z'); } static inline int -grub_isgraph (int c) +VasEBoot_isgraph (int c) { return (c >= '!' && c <= '~'); } static inline int -grub_isdigit (int c) +VasEBoot_isdigit (int c) { return (c >= '0' && c <= '9'); } static inline int -grub_isxdigit (int c) +VasEBoot_isxdigit (int c) { return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); } static inline int -grub_isalnum (int c) +VasEBoot_isalnum (int c) { - return grub_isalpha (c) || grub_isdigit (c); + return VasEBoot_isalpha (c) || VasEBoot_isdigit (c); } static inline int -grub_tolower (int c) +VasEBoot_tolower (int c) { if (c >= 'A' && c <= 'Z') return c - 'A' + 'a'; @@ -199,7 +199,7 @@ grub_tolower (int c) } static inline int -grub_toupper (int c) +VasEBoot_toupper (int c) { if (c >= 'a' && c <= 'z') return c - 'a' + 'A'; @@ -208,51 +208,51 @@ grub_toupper (int c) } static inline int -grub_strcasecmp (const char *s1, const char *s2) +VasEBoot_strcasecmp (const char *s1, const char *s2) { while (*s1 && *s2) { - if (grub_tolower ((grub_uint8_t) *s1) - != grub_tolower ((grub_uint8_t) *s2)) + if (VasEBoot_tolower ((VasEBoot_uint8_t) *s1) + != VasEBoot_tolower ((VasEBoot_uint8_t) *s2)) break; s1++; s2++; } - return (int) grub_tolower ((grub_uint8_t) *s1) - - (int) grub_tolower ((grub_uint8_t) *s2); + return (int) VasEBoot_tolower ((VasEBoot_uint8_t) *s1) + - (int) VasEBoot_tolower ((VasEBoot_uint8_t) *s2); } static inline int -grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) +VasEBoot_strncasecmp (const char *s1, const char *s2, VasEBoot_size_t n) { if (n == 0) return 0; while (*s1 && *s2 && --n) { - if (grub_tolower (*s1) != grub_tolower (*s2)) + if (VasEBoot_tolower (*s1) != VasEBoot_tolower (*s2)) break; s1++; s2++; } - return (int) grub_tolower ((grub_uint8_t) *s1) - - (int) grub_tolower ((grub_uint8_t) *s2); + return (int) VasEBoot_tolower ((VasEBoot_uint8_t) *s1) + - (int) VasEBoot_tolower ((VasEBoot_uint8_t) *s2); } -unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base); -unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base); +unsigned long EXPORT_FUNC(VasEBoot_strtoul) (const char *str, char **end, int base); +unsigned long long EXPORT_FUNC(VasEBoot_strtoull) (const char *str, char **end, int base); static inline long -grub_strtol (const char *str, char **end, int base) +VasEBoot_strtol (const char *str, char **end, int base) { int negative = 0; unsigned long long magnitude; - while (*str && grub_isspace (*str)) + while (*str && VasEBoot_isspace (*str)) str++; if (*str == '-') @@ -261,45 +261,45 @@ grub_strtol (const char *str, char **end, int base) str++; } - magnitude = grub_strtoull (str, end, base); + magnitude = VasEBoot_strtoull (str, end, base); if (negative) { - if (magnitude > (unsigned long) GRUB_LONG_MAX + 1) + if (magnitude > (unsigned long) VasEBoot_LONG_MAX + 1) { - grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected")); - return GRUB_LONG_MIN; + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("overflow is detected")); + return VasEBoot_LONG_MIN; } return -((long) magnitude); } else { - if (magnitude > GRUB_LONG_MAX) + if (magnitude > VasEBoot_LONG_MAX) { - grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected")); - return GRUB_LONG_MAX; + VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("overflow is detected")); + return VasEBoot_LONG_MAX; } return (long) magnitude; } } -char *EXPORT_FUNC(grub_strdup) (const char *s) WARN_UNUSED_RESULT; -char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n) WARN_UNUSED_RESULT; -void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n); -grub_size_t EXPORT_FUNC(grub_strlen) (const char *s) WARN_UNUSED_RESULT; -int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); -int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); +char *EXPORT_FUNC(VasEBoot_strdup) (const char *s) WARN_UNUSED_RESULT; +char *EXPORT_FUNC(VasEBoot_strndup) (const char *s, VasEBoot_size_t n) WARN_UNUSED_RESULT; +void *EXPORT_FUNC(VasEBoot_memset) (void *s, int c, VasEBoot_size_t n); +VasEBoot_size_t EXPORT_FUNC(VasEBoot_strlen) (const char *s) WARN_UNUSED_RESULT; +int EXPORT_FUNC(VasEBoot_printf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); +int EXPORT_FUNC(VasEBoot_printf_) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); /* Replace all `ch' characters of `input' with `with' and copy the result into `output'; return EOS address of `output'. */ static inline char * -grub_strchrsub (char *output, const char *input, char ch, const char *with) +VasEBoot_strchrsub (char *output, const char *input, char ch, const char *with) { while (*input) { if (*input == ch) { - grub_strcpy (output, with); - output += grub_strlen (with); + VasEBoot_strcpy (output, with); + output += VasEBoot_strlen (with); input++; continue; } @@ -309,71 +309,71 @@ grub_strchrsub (char *output, const char *input, char ch, const char *with) return output; } -extern void (*EXPORT_VAR (grub_xputs)) (const char *str); +extern void (*EXPORT_VAR (VasEBoot_xputs)) (const char *str); static inline int -grub_puts (const char *s) +VasEBoot_puts (const char *s) { const char nl[2] = "\n"; - grub_xputs (s); - grub_xputs (nl); + VasEBoot_xputs (s); + VasEBoot_xputs (nl); return 1; /* Cannot fail. */ } -int EXPORT_FUNC(grub_puts_) (const char *s); -void EXPORT_FUNC(grub_real_dprintf) (const char *file, +int EXPORT_FUNC(VasEBoot_puts_) (const char *s); +void EXPORT_FUNC(VasEBoot_real_dprintf) (const char *file, const int line, const char *condition, const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 4, 5))); -int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args); -int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...) +int EXPORT_FUNC(VasEBoot_vprintf) (const char *fmt, va_list args); +int EXPORT_FUNC(VasEBoot_snprintf) (char *str, VasEBoot_size_t n, const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 3, 4))); -int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt, +int EXPORT_FUNC(VasEBoot_vsnprintf) (char *str, VasEBoot_size_t n, const char *fmt, va_list args); -char *EXPORT_FUNC(grub_xasprintf) (const char *fmt, ...) +char *EXPORT_FUNC(VasEBoot_xasprintf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT; -char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args) WARN_UNUSED_RESULT; -void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn)); -grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, - grub_uint64_t d, - grub_uint64_t *r); +char *EXPORT_FUNC(VasEBoot_xvasprintf) (const char *fmt, va_list args) WARN_UNUSED_RESULT; +void EXPORT_FUNC(VasEBoot_exit) (void) __attribute__ ((noreturn)); +VasEBoot_uint64_t EXPORT_FUNC(VasEBoot_divmod64) (VasEBoot_uint64_t n, + VasEBoot_uint64_t d, + VasEBoot_uint64_t *r); /* Must match softdiv group in gentpl.py. */ -#if !defined(GRUB_MACHINE_EMU) && (defined(__arm__) || defined(__ia64__)) -#define GRUB_DIVISION_IN_SOFTWARE 1 +#if !defined(VasEBoot_MACHINE_EMU) && (defined(__arm__) || defined(__ia64__)) +#define VasEBoot_DIVISION_IN_SOFTWARE 1 #else -#define GRUB_DIVISION_IN_SOFTWARE 0 +#define VasEBoot_DIVISION_IN_SOFTWARE 0 #endif /* Some division functions need to be in kernel if compiler generates calls to them. Otherwise we still need them for consistent tests but they go into a separate module. */ -#if GRUB_DIVISION_IN_SOFTWARE +#if VasEBoot_DIVISION_IN_SOFTWARE #define EXPORT_FUNC_IF_SOFTDIV EXPORT_FUNC #else #define EXPORT_FUNC_IF_SOFTDIV(x) x #endif -grub_int64_t -EXPORT_FUNC_IF_SOFTDIV(grub_divmod64s) (grub_int64_t n, - grub_int64_t d, - grub_int64_t *r); +VasEBoot_int64_t +EXPORT_FUNC_IF_SOFTDIV(VasEBoot_divmod64s) (VasEBoot_int64_t n, + VasEBoot_int64_t d, + VasEBoot_int64_t *r); -grub_uint32_t -EXPORT_FUNC_IF_SOFTDIV (grub_divmod32) (grub_uint32_t n, - grub_uint32_t d, - grub_uint32_t *r); +VasEBoot_uint32_t +EXPORT_FUNC_IF_SOFTDIV (VasEBoot_divmod32) (VasEBoot_uint32_t n, + VasEBoot_uint32_t d, + VasEBoot_uint32_t *r); -grub_int32_t -EXPORT_FUNC_IF_SOFTDIV (grub_divmod32s) (grub_int32_t n, - grub_int32_t d, - grub_int32_t *r); +VasEBoot_int32_t +EXPORT_FUNC_IF_SOFTDIV (VasEBoot_divmod32s) (VasEBoot_int32_t n, + VasEBoot_int32_t d, + VasEBoot_int32_t *r); /* Inline functions. */ static inline char * -grub_memchr (const void *p, int c, grub_size_t len) +VasEBoot_memchr (const void *p, int c, VasEBoot_size_t len) { const char *s = (const char *) p; const char *e = s + len; @@ -387,7 +387,7 @@ grub_memchr (const void *p, int c, grub_size_t len) static inline unsigned int -grub_abs (int x) +VasEBoot_abs (int x) { if (x < 0) return (unsigned int) (-x); @@ -396,69 +396,69 @@ grub_abs (int x) } /* Reboot the machine. */ -#if defined (GRUB_MACHINE_EMU) || defined (GRUB_MACHINE_QEMU_MIPS) -void EXPORT_FUNC(grub_reboot) (void) __attribute__ ((noreturn)); +#if defined (VasEBoot_MACHINE_EMU) || defined (VasEBoot_MACHINE_QEMU_MIPS) +void EXPORT_FUNC(VasEBoot_reboot) (void) __attribute__ ((noreturn)); #else -void grub_reboot (void) __attribute__ ((noreturn)); +void VasEBoot_reboot (void) __attribute__ ((noreturn)); #endif -#if defined (__clang__) && !defined (GRUB_UTIL) +#if defined (__clang__) && !defined (VasEBoot_UTIL) void __attribute__ ((noreturn)) EXPORT_FUNC (abort) (void); #endif -#ifdef GRUB_MACHINE_PCBIOS +#ifdef VasEBoot_MACHINE_PCBIOS /* Halt the system, using APM if possible. If NO_APM is true, don't * use APM even if it is available. */ -void grub_halt (int no_apm) __attribute__ ((noreturn)); -#elif defined (__mips__) && !defined (GRUB_MACHINE_EMU) -void EXPORT_FUNC (grub_halt) (void) __attribute__ ((noreturn)); +void VasEBoot_halt (int no_apm) __attribute__ ((noreturn)); +#elif defined (__mips__) && !defined (VasEBoot_MACHINE_EMU) +void EXPORT_FUNC (VasEBoot_halt) (void) __attribute__ ((noreturn)); #else -void grub_halt (void) __attribute__ ((noreturn)); +void VasEBoot_halt (void) __attribute__ ((noreturn)); #endif -#ifdef GRUB_MACHINE_EMU +#ifdef VasEBoot_MACHINE_EMU /* Flag to check if module loading is available. */ -extern const int EXPORT_VAR(grub_no_modules); +extern const int EXPORT_VAR(VasEBoot_no_modules); #else -#define grub_no_modules 0 +#define VasEBoot_no_modules 0 #endif static inline void -grub_error_save (struct grub_error_saved *save) +VasEBoot_error_save (struct VasEBoot_error_saved *save) { - grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg)); - save->grub_errno = grub_errno; - grub_errno = GRUB_ERR_NONE; + VasEBoot_memcpy (save->errmsg, VasEBoot_errmsg, sizeof (save->errmsg)); + save->VasEBoot_errno = VasEBoot_errno; + VasEBoot_errno = VasEBoot_ERR_NONE; } static inline void -grub_error_load (const struct grub_error_saved *save) +VasEBoot_error_load (const struct VasEBoot_error_saved *save) { - grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg)); - grub_errno = save->grub_errno; + VasEBoot_memcpy (VasEBoot_errmsg, save->errmsg, sizeof (VasEBoot_errmsg)); + VasEBoot_errno = save->VasEBoot_errno; } #if BOOT_TIME_STATS -struct grub_boot_time +struct VasEBoot_boot_time { - struct grub_boot_time *next; - grub_uint64_t tp; + struct VasEBoot_boot_time *next; + VasEBoot_uint64_t tp; const char *file; int line; char *msg; }; -extern struct grub_boot_time *EXPORT_VAR(grub_boot_time_head); +extern struct VasEBoot_boot_time *EXPORT_VAR(VasEBoot_boot_time_head); -void EXPORT_FUNC(grub_real_boot_time) (const char *file, +void EXPORT_FUNC(VasEBoot_real_boot_time) (const char *file, const int line, const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 3, 4))); -#define grub_boot_time(...) grub_real_boot_time(GRUB_FILE, __LINE__, __VA_ARGS__) +#define VasEBoot_boot_time(...) VasEBoot_real_boot_time(VasEBoot_FILE, __LINE__, __VA_ARGS__) #else -#define grub_boot_time(...) +#define VasEBoot_boot_time(...) #endif -#define grub_max(a, b) (((a) > (b)) ? (a) : (b)) -#define grub_min(a, b) (((a) < (b)) ? (a) : (b)) +#define VasEBoot_max(a, b) (((a) > (b)) ? (a) : (b)) +#define VasEBoot_min(a, b) (((a) < (b)) ? (a) : (b)) -#endif /* ! GRUB_MISC_HEADER */ +#endif /* ! VasEBoot_MISC_HEADER */ diff --git a/include/VasEBoot/mm.h b/include/VasEBoot/mm.h index 28e2e53eb..dfa67797e 100644 --- a/include/VasEBoot/mm.h +++ b/include/VasEBoot/mm.h @@ -1,77 +1,77 @@ /* mm.h - prototypes and declarations for memory manager */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MM_H -#define GRUB_MM_H 1 +#ifndef VasEBoot_MM_H +#define VasEBoot_MM_H 1 -#include -#include +#include +#include #include #ifndef NULL # define NULL ((void *) 0) #endif -void grub_mm_init_region (void *addr, grub_size_t size); -void *EXPORT_FUNC(grub_malloc) (grub_size_t size); -void *EXPORT_FUNC(grub_zalloc) (grub_size_t size); -void EXPORT_FUNC(grub_free) (void *ptr); -void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size); -#ifndef GRUB_MACHINE_EMU -void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size); +void VasEBoot_mm_init_region (void *addr, VasEBoot_size_t size); +void *EXPORT_FUNC(VasEBoot_malloc) (VasEBoot_size_t size); +void *EXPORT_FUNC(VasEBoot_zalloc) (VasEBoot_size_t size); +void EXPORT_FUNC(VasEBoot_free) (void *ptr); +void *EXPORT_FUNC(VasEBoot_realloc) (void *ptr, VasEBoot_size_t size); +#ifndef VasEBoot_MACHINE_EMU +void *EXPORT_FUNC(VasEBoot_memalign) (VasEBoot_size_t align, VasEBoot_size_t size); #endif -void grub_mm_check_real (const char *file, int line); -#define grub_mm_check() grub_mm_check_real (GRUB_FILE, __LINE__); +void VasEBoot_mm_check_real (const char *file, int line); +#define VasEBoot_mm_check() VasEBoot_mm_check_real (VasEBoot_FILE, __LINE__); /* For debugging. */ -#if defined(MM_DEBUG) && !defined(GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) +#if defined(MM_DEBUG) && !defined(VasEBoot_UTIL) && !defined (VasEBoot_MACHINE_EMU) /* Set this variable to 1 when you want to trace all memory function calls. */ -extern int EXPORT_VAR(grub_mm_debug); +extern int EXPORT_VAR(VasEBoot_mm_debug); -void grub_mm_dump_free (void); -void grub_mm_dump (unsigned lineno); +void VasEBoot_mm_dump_free (void); +void VasEBoot_mm_dump (unsigned lineno); -#define grub_malloc(size) \ - grub_debug_malloc (GRUB_FILE, __LINE__, size) +#define VasEBoot_malloc(size) \ + VasEBoot_debug_malloc (VasEBoot_FILE, __LINE__, size) -#define grub_zalloc(size) \ - grub_debug_zalloc (GRUB_FILE, __LINE__, size) +#define VasEBoot_zalloc(size) \ + VasEBoot_debug_zalloc (VasEBoot_FILE, __LINE__, size) -#define grub_realloc(ptr,size) \ - grub_debug_realloc (GRUB_FILE, __LINE__, ptr, size) +#define VasEBoot_realloc(ptr,size) \ + VasEBoot_debug_realloc (VasEBoot_FILE, __LINE__, ptr, size) -#define grub_memalign(align,size) \ - grub_debug_memalign (GRUB_FILE, __LINE__, align, size) +#define VasEBoot_memalign(align,size) \ + VasEBoot_debug_memalign (VasEBoot_FILE, __LINE__, align, size) -#define grub_free(ptr) \ - grub_debug_free (GRUB_FILE, __LINE__, ptr) +#define VasEBoot_free(ptr) \ + VasEBoot_debug_free (VasEBoot_FILE, __LINE__, ptr) -void *EXPORT_FUNC(grub_debug_malloc) (const char *file, int line, - grub_size_t size); -void *EXPORT_FUNC(grub_debug_zalloc) (const char *file, int line, - grub_size_t size); -void EXPORT_FUNC(grub_debug_free) (const char *file, int line, void *ptr); -void *EXPORT_FUNC(grub_debug_realloc) (const char *file, int line, void *ptr, - grub_size_t size); -void *EXPORT_FUNC(grub_debug_memalign) (const char *file, int line, - grub_size_t align, grub_size_t size); -#endif /* MM_DEBUG && ! GRUB_UTIL */ +void *EXPORT_FUNC(VasEBoot_debug_malloc) (const char *file, int line, + VasEBoot_size_t size); +void *EXPORT_FUNC(VasEBoot_debug_zalloc) (const char *file, int line, + VasEBoot_size_t size); +void EXPORT_FUNC(VasEBoot_debug_free) (const char *file, int line, void *ptr); +void *EXPORT_FUNC(VasEBoot_debug_realloc) (const char *file, int line, void *ptr, + VasEBoot_size_t size); +void *EXPORT_FUNC(VasEBoot_debug_memalign) (const char *file, int line, + VasEBoot_size_t align, VasEBoot_size_t size); +#endif /* MM_DEBUG && ! VasEBoot_UTIL */ -#endif /* ! GRUB_MM_H */ +#endif /* ! VasEBoot_MM_H */ diff --git a/include/VasEBoot/mm_private.h b/include/VasEBoot/mm_private.h index c2c4cb151..e57b41abc 100644 --- a/include/VasEBoot/mm_private.h +++ b/include/VasEBoot/mm_private.h @@ -1,64 +1,64 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MM_PRIVATE_H -#define GRUB_MM_PRIVATE_H 1 +#ifndef VasEBoot_MM_PRIVATE_H +#define VasEBoot_MM_PRIVATE_H 1 -#include +#include /* Magic words. */ -#define GRUB_MM_FREE_MAGIC 0x2d3c2808 -#define GRUB_MM_ALLOC_MAGIC 0x6db08fa4 +#define VasEBoot_MM_FREE_MAGIC 0x2d3c2808 +#define VasEBoot_MM_ALLOC_MAGIC 0x6db08fa4 -typedef struct grub_mm_header +typedef struct VasEBoot_mm_header { - struct grub_mm_header *next; - grub_size_t size; - grub_size_t magic; -#if GRUB_CPU_SIZEOF_VOID_P == 4 + struct VasEBoot_mm_header *next; + VasEBoot_size_t size; + VasEBoot_size_t magic; +#if VasEBoot_CPU_SIZEOF_VOID_P == 4 char padding[4]; -#elif GRUB_CPU_SIZEOF_VOID_P == 8 +#elif VasEBoot_CPU_SIZEOF_VOID_P == 8 char padding[8]; #else # error "unknown word size" #endif } -*grub_mm_header_t; +*VasEBoot_mm_header_t; -#if GRUB_CPU_SIZEOF_VOID_P == 4 -# define GRUB_MM_ALIGN_LOG2 4 -#elif GRUB_CPU_SIZEOF_VOID_P == 8 -# define GRUB_MM_ALIGN_LOG2 5 +#if VasEBoot_CPU_SIZEOF_VOID_P == 4 +# define VasEBoot_MM_ALIGN_LOG2 4 +#elif VasEBoot_CPU_SIZEOF_VOID_P == 8 +# define VasEBoot_MM_ALIGN_LOG2 5 #endif -#define GRUB_MM_ALIGN (1 << GRUB_MM_ALIGN_LOG2) +#define VasEBoot_MM_ALIGN (1 << VasEBoot_MM_ALIGN_LOG2) -typedef struct grub_mm_region +typedef struct VasEBoot_mm_region { - struct grub_mm_header *first; - struct grub_mm_region *next; - grub_size_t pre_size; - grub_size_t size; + struct VasEBoot_mm_header *first; + struct VasEBoot_mm_region *next; + VasEBoot_size_t pre_size; + VasEBoot_size_t size; } -*grub_mm_region_t; +*VasEBoot_mm_region_t; -#ifndef GRUB_MACHINE_EMU -extern grub_mm_region_t EXPORT_VAR (grub_mm_base); +#ifndef VasEBoot_MACHINE_EMU +extern VasEBoot_mm_region_t EXPORT_VAR (VasEBoot_mm_base); #endif #endif diff --git a/include/VasEBoot/module_verifier.h b/include/VasEBoot/module_verifier.h index f4870cb9c..e64ae57b8 100644 --- a/include/VasEBoot/module_verifier.h +++ b/include/VasEBoot/module_verifier.h @@ -1,12 +1,12 @@ #include #include -#include +#include -#define GRUB_MODULE_VERIFY_SUPPORTS_REL 1 -#define GRUB_MODULE_VERIFY_SUPPORTS_RELA 2 +#define VasEBoot_MODULE_VERIFY_SUPPORTS_REL 1 +#define VasEBoot_MODULE_VERIFY_SUPPORTS_RELA 2 -struct grub_module_verifier_arch { +struct VasEBoot_module_verifier_arch { const char *name; int voidp_sizeof; int bigendian; @@ -16,5 +16,5 @@ struct grub_module_verifier_arch { const int *short_relocations; }; -void grub_module_verify64(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch, const char **whitelist_empty); -void grub_module_verify32(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch, const char **whitelist_empty); +void VasEBoot_module_verify64(void *module_img, size_t module_size, const struct VasEBoot_module_verifier_arch *arch, const char **whitelist_empty); +void VasEBoot_module_verify32(void *module_img, size_t module_size, const struct VasEBoot_module_verifier_arch *arch, const char **whitelist_empty); diff --git a/include/VasEBoot/msdos_partition.h b/include/VasEBoot/msdos_partition.h index fdc2904d3..89aeb24a4 100644 --- a/include/VasEBoot/msdos_partition.h +++ b/include/VasEBoot/msdos_partition.h @@ -1,127 +1,127 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2004,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PC_PARTITION_HEADER -#define GRUB_PC_PARTITION_HEADER 1 +#ifndef VasEBoot_PC_PARTITION_HEADER +#define VasEBoot_PC_PARTITION_HEADER 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* The signature. */ -#define GRUB_PC_PARTITION_SIGNATURE 0xaa55 +#define VasEBoot_PC_PARTITION_SIGNATURE 0xaa55 /* This is not a flag actually, but used as if it were a flag. */ -#define GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG 0x10 +#define VasEBoot_PC_PARTITION_TYPE_HIDDEN_FLAG 0x10 /* DOS partition types. */ -#define GRUB_PC_PARTITION_TYPE_NONE 0 -#define GRUB_PC_PARTITION_TYPE_FAT12 1 -#define GRUB_PC_PARTITION_TYPE_FAT16_LT32M 4 -#define GRUB_PC_PARTITION_TYPE_EXTENDED 5 -#define GRUB_PC_PARTITION_TYPE_FAT16_GT32M 6 -#define GRUB_PC_PARTITION_TYPE_NTFS 7 -#define GRUB_PC_PARTITION_TYPE_FAT32 0xb -#define GRUB_PC_PARTITION_TYPE_FAT32_LBA 0xc -#define GRUB_PC_PARTITION_TYPE_FAT16_LBA 0xe -#define GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED 0xf -#define GRUB_PC_PARTITION_TYPE_PLAN9 0x39 -#define GRUB_PC_PARTITION_TYPE_LDM 0x42 -#define GRUB_PC_PARTITION_TYPE_EZD 0x55 -#define GRUB_PC_PARTITION_TYPE_MINIX 0x80 -#define GRUB_PC_PARTITION_TYPE_LINUX_MINIX 0x81 -#define GRUB_PC_PARTITION_TYPE_LINUX_SWAP 0x82 -#define GRUB_PC_PARTITION_TYPE_EXT2FS 0x83 -#define GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED 0x85 -#define GRUB_PC_PARTITION_TYPE_VSTAFS 0x9e -#define GRUB_PC_PARTITION_TYPE_FREEBSD 0xa5 -#define GRUB_PC_PARTITION_TYPE_OPENBSD 0xa6 -#define GRUB_PC_PARTITION_TYPE_NETBSD 0xa9 -#define GRUB_PC_PARTITION_TYPE_HFS 0xaf -#define GRUB_PC_PARTITION_TYPE_GPT_DISK 0xee -#define GRUB_PC_PARTITION_TYPE_LINUX_RAID 0xfd +#define VasEBoot_PC_PARTITION_TYPE_NONE 0 +#define VasEBoot_PC_PARTITION_TYPE_FAT12 1 +#define VasEBoot_PC_PARTITION_TYPE_FAT16_LT32M 4 +#define VasEBoot_PC_PARTITION_TYPE_EXTENDED 5 +#define VasEBoot_PC_PARTITION_TYPE_FAT16_GT32M 6 +#define VasEBoot_PC_PARTITION_TYPE_NTFS 7 +#define VasEBoot_PC_PARTITION_TYPE_FAT32 0xb +#define VasEBoot_PC_PARTITION_TYPE_FAT32_LBA 0xc +#define VasEBoot_PC_PARTITION_TYPE_FAT16_LBA 0xe +#define VasEBoot_PC_PARTITION_TYPE_WIN95_EXTENDED 0xf +#define VasEBoot_PC_PARTITION_TYPE_PLAN9 0x39 +#define VasEBoot_PC_PARTITION_TYPE_LDM 0x42 +#define VasEBoot_PC_PARTITION_TYPE_EZD 0x55 +#define VasEBoot_PC_PARTITION_TYPE_MINIX 0x80 +#define VasEBoot_PC_PARTITION_TYPE_LINUX_MINIX 0x81 +#define VasEBoot_PC_PARTITION_TYPE_LINUX_SWAP 0x82 +#define VasEBoot_PC_PARTITION_TYPE_EXT2FS 0x83 +#define VasEBoot_PC_PARTITION_TYPE_LINUX_EXTENDED 0x85 +#define VasEBoot_PC_PARTITION_TYPE_VSTAFS 0x9e +#define VasEBoot_PC_PARTITION_TYPE_FREEBSD 0xa5 +#define VasEBoot_PC_PARTITION_TYPE_OPENBSD 0xa6 +#define VasEBoot_PC_PARTITION_TYPE_NETBSD 0xa9 +#define VasEBoot_PC_PARTITION_TYPE_HFS 0xaf +#define VasEBoot_PC_PARTITION_TYPE_GPT_DISK 0xee +#define VasEBoot_PC_PARTITION_TYPE_LINUX_RAID 0xfd /* The partition entry. */ -struct grub_msdos_partition_entry +struct VasEBoot_msdos_partition_entry { /* If active, 0x80, otherwise, 0x00. */ - grub_uint8_t flag; + VasEBoot_uint8_t flag; /* The head of the start. */ - grub_uint8_t start_head; + VasEBoot_uint8_t start_head; /* (S | ((C >> 2) & 0xC0)) where S is the sector of the start and C is the cylinder of the start. Note that S is counted from one. */ - grub_uint8_t start_sector; + VasEBoot_uint8_t start_sector; /* (C & 0xFF) where C is the cylinder of the start. */ - grub_uint8_t start_cylinder; + VasEBoot_uint8_t start_cylinder; /* The partition type. */ - grub_uint8_t type; + VasEBoot_uint8_t type; /* The end versions of start_head, start_sector and start_cylinder, respectively. */ - grub_uint8_t end_head; - grub_uint8_t end_sector; - grub_uint8_t end_cylinder; + VasEBoot_uint8_t end_head; + VasEBoot_uint8_t end_sector; + VasEBoot_uint8_t end_cylinder; /* The start sector. Note that this is counted from zero. */ - grub_uint32_t start; + VasEBoot_uint32_t start; /* The length in sector units. */ - grub_uint32_t length; -} GRUB_PACKED; + VasEBoot_uint32_t length; +} VasEBoot_PACKED; /* The structure of MBR. */ -struct grub_msdos_partition_mbr +struct VasEBoot_msdos_partition_mbr { /* The code area (actually, including BPB). */ - grub_uint8_t code[446]; + VasEBoot_uint8_t code[446]; /* Four partition entries. */ - struct grub_msdos_partition_entry entries[4]; + struct VasEBoot_msdos_partition_entry entries[4]; /* The signature 0xaa55. */ - grub_uint16_t signature; -} GRUB_PACKED; + VasEBoot_uint16_t signature; +} VasEBoot_PACKED; static inline int -grub_msdos_partition_is_empty (int type) +VasEBoot_msdos_partition_is_empty (int type) { - return (type == GRUB_PC_PARTITION_TYPE_NONE); + return (type == VasEBoot_PC_PARTITION_TYPE_NONE); } static inline int -grub_msdos_partition_is_extended (int type) +VasEBoot_msdos_partition_is_extended (int type) { - return (type == GRUB_PC_PARTITION_TYPE_EXTENDED - || type == GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED - || type == GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED); + return (type == VasEBoot_PC_PARTITION_TYPE_EXTENDED + || type == VasEBoot_PC_PARTITION_TYPE_WIN95_EXTENDED + || type == VasEBoot_PC_PARTITION_TYPE_LINUX_EXTENDED); } -grub_err_t -grub_partition_msdos_iterate (grub_disk_t disk, - grub_partition_iterate_hook_t hook, +VasEBoot_err_t +VasEBoot_partition_msdos_iterate (VasEBoot_disk_t disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data); -#endif /* ! GRUB_PC_PARTITION_HEADER */ +#endif /* ! VasEBoot_PC_PARTITION_HEADER */ diff --git a/include/VasEBoot/multiboot.h b/include/VasEBoot/multiboot.h index c96492bb5..c86e97fb2 100644 --- a/include/VasEBoot/multiboot.h +++ b/include/VasEBoot/multiboot.h @@ -1,28 +1,28 @@ -/* multiboot.h - multiboot header file with grub definitions. */ +/* multiboot.h - multiboot header file with VasEBoot definitions. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2007,2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MULTIBOOT_HEADER -#define GRUB_MULTIBOOT_HEADER 1 +#ifndef VasEBoot_MULTIBOOT_HEADER +#define VasEBoot_MULTIBOOT_HEADER 1 -#include +#include -#ifdef GRUB_USE_MULTIBOOT2 +#ifdef VasEBoot_USE_MULTIBOOT2 #include /* Same thing as far as our loader is concerned. */ #define MULTIBOOT_BOOTLOADER_MAGIC MULTIBOOT2_BOOTLOADER_MAGIC @@ -31,91 +31,91 @@ #include #endif -#include -#include +#include +#include -#ifndef GRUB_USE_MULTIBOOT2 +#ifndef VasEBoot_USE_MULTIBOOT2 typedef enum { - GRUB_MULTIBOOT_QUIRKS_NONE = 0, - GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE = 1, - GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL = 2 - } grub_multiboot_quirks_t; -extern grub_multiboot_quirks_t grub_multiboot_quirks; + VasEBoot_MULTIBOOT_QUIRKS_NONE = 0, + VasEBoot_MULTIBOOT_QUIRK_BAD_KLUDGE = 1, + VasEBoot_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL = 2 + } VasEBoot_multiboot_quirks_t; +extern VasEBoot_multiboot_quirks_t VasEBoot_multiboot_quirks; #endif -extern struct grub_relocator *grub_multiboot_relocator; +extern struct VasEBoot_relocator *VasEBoot_multiboot_relocator; -void grub_multiboot (int argc, char *argv[]); -void grub_module (int argc, char *argv[]); +void VasEBoot_multiboot (int argc, char *argv[]); +void VasEBoot_module (int argc, char *argv[]); -void grub_multiboot_set_accepts_video (int val); -grub_err_t grub_multiboot_make_mbi (grub_uint32_t *target); -void grub_multiboot_free_mbi (void); -grub_err_t grub_multiboot_init_mbi (int argc, char *argv[]); -grub_err_t grub_multiboot_add_module (grub_addr_t start, grub_size_t size, +void VasEBoot_multiboot_set_accepts_video (int val); +VasEBoot_err_t VasEBoot_multiboot_make_mbi (VasEBoot_uint32_t *target); +void VasEBoot_multiboot_free_mbi (void); +VasEBoot_err_t VasEBoot_multiboot_init_mbi (int argc, char *argv[]); +VasEBoot_err_t VasEBoot_multiboot_add_module (VasEBoot_addr_t start, VasEBoot_size_t size, int argc, char *argv[]); -void grub_multiboot_set_bootdev (void); +void VasEBoot_multiboot_set_bootdev (void); void -grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, +VasEBoot_multiboot_add_elfsyms (VasEBoot_size_t num, VasEBoot_size_t entsize, unsigned shndx, void *data); -grub_uint32_t grub_get_multiboot_mmap_count (void); -grub_err_t grub_multiboot_set_video_mode (void); +VasEBoot_uint32_t VasEBoot_get_multiboot_mmap_count (void); +VasEBoot_err_t VasEBoot_multiboot_set_video_mode (void); /* FIXME: support coreboot as well. */ -#if defined (GRUB_MACHINE_PCBIOS) -#define GRUB_MACHINE_HAS_VBE 1 +#if defined (VasEBoot_MACHINE_PCBIOS) +#define VasEBoot_MACHINE_HAS_VBE 1 #else -#define GRUB_MACHINE_HAS_VBE 0 +#define VasEBoot_MACHINE_HAS_VBE 0 #endif -#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU) -#define GRUB_MACHINE_HAS_VGA_TEXT 1 +#if defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_MULTIBOOT) || defined (VasEBoot_MACHINE_QEMU) +#define VasEBoot_MACHINE_HAS_VGA_TEXT 1 #else -#define GRUB_MACHINE_HAS_VGA_TEXT 0 +#define VasEBoot_MACHINE_HAS_VGA_TEXT 0 #endif -#if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) -#define GRUB_MACHINE_HAS_ACPI 1 +#if defined (VasEBoot_MACHINE_EFI) || defined (VasEBoot_MACHINE_PCBIOS) || defined (VasEBoot_MACHINE_COREBOOT) || defined (VasEBoot_MACHINE_MULTIBOOT) +#define VasEBoot_MACHINE_HAS_ACPI 1 #else -#define GRUB_MACHINE_HAS_ACPI 0 +#define VasEBoot_MACHINE_HAS_ACPI 0 #endif -#define GRUB_MULTIBOOT_CONSOLE_EGA_TEXT 1 -#define GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER 2 +#define VasEBoot_MULTIBOOT_CONSOLE_EGA_TEXT 1 +#define VasEBoot_MULTIBOOT_CONSOLE_FRAMEBUFFER 2 -grub_err_t -grub_multiboot_set_console (int console_type, int accepted_consoles, +VasEBoot_err_t +VasEBoot_multiboot_set_console (int console_type, int accepted_consoles, int width, int height, int depth, int console_required); -grub_err_t -grub_multiboot_load (grub_file_t file, const char *filename); +VasEBoot_err_t +VasEBoot_multiboot_load (VasEBoot_file_t file, const char *filename); struct mbi_load_data { - grub_file_t file; + VasEBoot_file_t file; const char *filename; void *buffer; unsigned int mbi_ver; int relocatable; - grub_uint32_t min_addr; - grub_uint32_t max_addr; - grub_size_t align; - grub_uint32_t preference; - grub_uint32_t link_base_addr; - grub_uint32_t load_base_addr; + VasEBoot_uint32_t min_addr; + VasEBoot_uint32_t max_addr; + VasEBoot_size_t align; + VasEBoot_uint32_t preference; + VasEBoot_uint32_t link_base_addr; + VasEBoot_uint32_t load_base_addr; int avoid_efi_boot_services; }; typedef struct mbi_load_data mbi_load_data_t; /* Load ELF32 or ELF64. */ -grub_err_t -grub_multiboot_load_elf (mbi_load_data_t *mld); +VasEBoot_err_t +VasEBoot_multiboot_load_elf (mbi_load_data_t *mld); -extern grub_size_t grub_multiboot_pure_size; -extern grub_size_t grub_multiboot_alloc_mbi; -extern grub_uint32_t grub_multiboot_payload_eip; +extern VasEBoot_size_t VasEBoot_multiboot_pure_size; +extern VasEBoot_size_t VasEBoot_multiboot_alloc_mbi; +extern VasEBoot_uint32_t VasEBoot_multiboot_payload_eip; -#endif /* ! GRUB_MULTIBOOT_HEADER */ +#endif /* ! VasEBoot_MULTIBOOT_HEADER */ diff --git a/include/VasEBoot/multiboot_loader.h b/include/VasEBoot/multiboot_loader.h index bf1c1307b..265871360 100644 --- a/include/VasEBoot/multiboot_loader.h +++ b/include/VasEBoot/multiboot_loader.h @@ -1,28 +1,28 @@ /* multiboot_loader.h - multiboot loader header file. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MULTIBOOT_LOADER_HEADER -#define GRUB_MULTIBOOT_LOADER_HEADER 1 +#ifndef VasEBoot_MULTIBOOT_LOADER_HEADER +#define VasEBoot_MULTIBOOT_LOADER_HEADER 1 /* Provided by the core ("rescue mode"). */ -void grub_rescue_cmd_multiboot_loader (int argc, char *argv[]); -void grub_rescue_cmd_module_loader (int argc, char *argv[]); +void VasEBoot_rescue_cmd_multiboot_loader (int argc, char *argv[]); +void VasEBoot_rescue_cmd_module_loader (int argc, char *argv[]); -#endif /* ! GRUB_MULTIBOOT_LOADER_HEADER */ +#endif /* ! VasEBoot_MULTIBOOT_LOADER_HEADER */ diff --git a/include/VasEBoot/net.h b/include/VasEBoot/net.h index c51750973..acf9d2b99 100644 --- a/include/VasEBoot/net.h +++ b/include/VasEBoot/net.h @@ -1,145 +1,145 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NET_HEADER -#define GRUB_NET_HEADER 1 +#ifndef VasEBoot_NET_HEADER +#define VasEBoot_NET_HEADER 1 -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include enum { - GRUB_NET_MAX_LINK_HEADER_SIZE = 64, - GRUB_NET_UDP_HEADER_SIZE = 8, - GRUB_NET_TCP_HEADER_SIZE = 20, - GRUB_NET_OUR_IPV4_HEADER_SIZE = 20, - GRUB_NET_OUR_IPV6_HEADER_SIZE = 40, - GRUB_NET_OUR_MAX_IP_HEADER_SIZE = 40, - GRUB_NET_TCP_RESERVE_SIZE = GRUB_NET_TCP_HEADER_SIZE - + GRUB_NET_OUR_IPV4_HEADER_SIZE - + GRUB_NET_MAX_LINK_HEADER_SIZE + VasEBoot_NET_MAX_LINK_HEADER_SIZE = 64, + VasEBoot_NET_UDP_HEADER_SIZE = 8, + VasEBoot_NET_TCP_HEADER_SIZE = 20, + VasEBoot_NET_OUR_IPV4_HEADER_SIZE = 20, + VasEBoot_NET_OUR_IPV6_HEADER_SIZE = 40, + VasEBoot_NET_OUR_MAX_IP_HEADER_SIZE = 40, + VasEBoot_NET_TCP_RESERVE_SIZE = VasEBoot_NET_TCP_HEADER_SIZE + + VasEBoot_NET_OUR_IPV4_HEADER_SIZE + + VasEBoot_NET_MAX_LINK_HEADER_SIZE }; -typedef enum grub_link_level_protocol_id +typedef enum VasEBoot_link_level_protocol_id { - GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET -} grub_link_level_protocol_id_t; + VasEBoot_NET_LINK_LEVEL_PROTOCOL_ETHERNET +} VasEBoot_link_level_protocol_id_t; -typedef struct grub_net_link_level_address +typedef struct VasEBoot_net_link_level_address { - grub_link_level_protocol_id_t type; + VasEBoot_link_level_protocol_id_t type; union { - grub_uint8_t mac[6]; + VasEBoot_uint8_t mac[6]; }; -} grub_net_link_level_address_t; +} VasEBoot_net_link_level_address_t; -typedef enum grub_net_interface_flags +typedef enum VasEBoot_net_interface_flags { - GRUB_NET_INTERFACE_HWADDRESS_IMMUTABLE = 1, - GRUB_NET_INTERFACE_ADDRESS_IMMUTABLE = 2, - GRUB_NET_INTERFACE_PERMANENT = 4 - } grub_net_interface_flags_t; + VasEBoot_NET_INTERFACE_HWADDRESS_IMMUTABLE = 1, + VasEBoot_NET_INTERFACE_ADDRESS_IMMUTABLE = 2, + VasEBoot_NET_INTERFACE_PERMANENT = 4 + } VasEBoot_net_interface_flags_t; -typedef enum grub_net_card_flags +typedef enum VasEBoot_net_card_flags { - GRUB_NET_CARD_HWADDRESS_IMMUTABLE = 1, - GRUB_NET_CARD_NO_MANUAL_INTERFACES = 2 - } grub_net_card_flags_t; + VasEBoot_NET_CARD_HWADDRESS_IMMUTABLE = 1, + VasEBoot_NET_CARD_NO_MANUAL_INTERFACES = 2 + } VasEBoot_net_card_flags_t; -struct grub_net_card; +struct VasEBoot_net_card; -struct grub_net_card_driver +struct VasEBoot_net_card_driver { - struct grub_net_card_driver *next; - struct grub_net_card_driver **prev; + struct VasEBoot_net_card_driver *next; + struct VasEBoot_net_card_driver **prev; const char *name; - grub_err_t (*open) (struct grub_net_card *dev); - void (*close) (struct grub_net_card *dev); - grub_err_t (*send) (struct grub_net_card *dev, - struct grub_net_buff *buf); - struct grub_net_buff * (*recv) (struct grub_net_card *dev); + VasEBoot_err_t (*open) (struct VasEBoot_net_card *dev); + void (*close) (struct VasEBoot_net_card *dev); + VasEBoot_err_t (*send) (struct VasEBoot_net_card *dev, + struct VasEBoot_net_buff *buf); + struct VasEBoot_net_buff * (*recv) (struct VasEBoot_net_card *dev); }; -typedef struct grub_net_packet +typedef struct VasEBoot_net_packet { - struct grub_net_packet *next; - struct grub_net_packet *prev; - struct grub_net_packets *up; - struct grub_net_buff *nb; -} grub_net_packet_t; + struct VasEBoot_net_packet *next; + struct VasEBoot_net_packet *prev; + struct VasEBoot_net_packets *up; + struct VasEBoot_net_buff *nb; +} VasEBoot_net_packet_t; -typedef struct grub_net_packets +typedef struct VasEBoot_net_packets { - grub_net_packet_t *first; - grub_net_packet_t *last; - grub_size_t count; -} grub_net_packets_t; + VasEBoot_net_packet_t *first; + VasEBoot_net_packet_t *last; + VasEBoot_size_t count; +} VasEBoot_net_packets_t; -#ifdef GRUB_MACHINE_EFI -#include +#ifdef VasEBoot_MACHINE_EFI +#include #endif -struct grub_net_slaac_mac_list +struct VasEBoot_net_slaac_mac_list { - struct grub_net_slaac_mac_list *next; - struct grub_net_slaac_mac_list **prev; - grub_net_link_level_address_t address; + struct VasEBoot_net_slaac_mac_list *next; + struct VasEBoot_net_slaac_mac_list **prev; + VasEBoot_net_link_level_address_t address; int slaac_counter; char *name; }; -struct grub_net_link_layer_entry; +struct VasEBoot_net_link_layer_entry; -struct grub_net_card +struct VasEBoot_net_card { - struct grub_net_card *next; - struct grub_net_card **prev; + struct VasEBoot_net_card *next; + struct VasEBoot_net_card **prev; const char *name; - struct grub_net_card_driver *driver; - grub_net_link_level_address_t default_address; - grub_net_card_flags_t flags; + struct VasEBoot_net_card_driver *driver; + VasEBoot_net_link_level_address_t default_address; + VasEBoot_net_card_flags_t flags; int num_ifaces; int opened; unsigned idle_poll_delay_ms; - grub_uint64_t last_poll; - grub_size_t mtu; - struct grub_net_slaac_mac_list *slaac_list; - grub_ssize_t new_ll_entry; - struct grub_net_link_layer_entry *link_layer_table; + VasEBoot_uint64_t last_poll; + VasEBoot_size_t mtu; + struct VasEBoot_net_slaac_mac_list *slaac_list; + VasEBoot_ssize_t new_ll_entry; + struct VasEBoot_net_link_layer_entry *link_layer_table; void *txbuf; void *rcvbuf; - grub_size_t rcvbufsize; - grub_size_t txbufsize; + VasEBoot_size_t rcvbufsize; + VasEBoot_size_t txbufsize; int txbusy; union { -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI struct { - struct grub_efi_simple_network *efi_net; - grub_efi_handle_t efi_handle; - grub_size_t last_pkt_size; + struct VasEBoot_efi_simple_network *efi_net; + VasEBoot_efi_handle_t efi_handle; + VasEBoot_size_t last_pkt_size; }; #endif void *data; @@ -147,14 +147,14 @@ struct grub_net_card }; }; -struct grub_net_network_level_interface; +struct VasEBoot_net_network_level_interface; -typedef enum grub_network_level_protocol_id +typedef enum VasEBoot_network_level_protocol_id { - GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV, - GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4, - GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 -} grub_network_level_protocol_id_t; + VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV, + VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV4, + VasEBoot_NET_NETWORK_LEVEL_PROTOCOL_IPV6 +} VasEBoot_network_level_protocol_id_t; typedef enum { @@ -162,57 +162,57 @@ typedef enum DNS_OPTION_IPV6, DNS_OPTION_PREFER_IPV4, DNS_OPTION_PREFER_IPV6 -} grub_dns_option_t; +} VasEBoot_dns_option_t; -typedef struct grub_net_network_level_address +typedef struct VasEBoot_net_network_level_address { - grub_network_level_protocol_id_t type; + VasEBoot_network_level_protocol_id_t type; union { - grub_uint32_t ipv4; - grub_uint64_t ipv6[2]; + VasEBoot_uint32_t ipv4; + VasEBoot_uint64_t ipv6[2]; }; - grub_dns_option_t option; -} grub_net_network_level_address_t; + VasEBoot_dns_option_t option; +} VasEBoot_net_network_level_address_t; -typedef struct grub_net_network_level_netaddress +typedef struct VasEBoot_net_network_level_netaddress { - grub_network_level_protocol_id_t type; + VasEBoot_network_level_protocol_id_t type; union { struct { - grub_uint32_t base; + VasEBoot_uint32_t base; int masksize; } ipv4; struct { - grub_uint64_t base[2]; + VasEBoot_uint64_t base[2]; int masksize; } ipv6; }; -} grub_net_network_level_netaddress_t; +} VasEBoot_net_network_level_netaddress_t; -struct grub_net_route +struct VasEBoot_net_route { - struct grub_net_route *next; - struct grub_net_route **prev; - grub_net_network_level_netaddress_t target; + struct VasEBoot_net_route *next; + struct VasEBoot_net_route **prev; + VasEBoot_net_network_level_netaddress_t target; char *name; - struct grub_net_network_level_protocol *prot; + struct VasEBoot_net_network_level_protocol *prot; int is_gateway; - struct grub_net_network_level_interface *interface; - grub_net_network_level_address_t gw; + struct VasEBoot_net_network_level_interface *interface; + VasEBoot_net_network_level_address_t gw; }; #define FOR_PACKETS(cont,var) for (var = (cont).first; var; var = var->next) -static inline grub_err_t -grub_net_put_packet (grub_net_packets_t *pkts, struct grub_net_buff *nb) +static inline VasEBoot_err_t +VasEBoot_net_put_packet (VasEBoot_net_packets_t *pkts, struct VasEBoot_net_buff *nb) { - struct grub_net_packet *n; + struct VasEBoot_net_packet *n; - n = grub_malloc (sizeof (*n)); + n = VasEBoot_malloc (sizeof (*n)); if (!n) - return grub_errno; + return VasEBoot_errno; n->nb = nb; n->next = NULL; @@ -229,11 +229,11 @@ grub_net_put_packet (grub_net_packets_t *pkts, struct grub_net_buff *nb) pkts->count++; - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } static inline void -grub_net_remove_packet (grub_net_packet_t *pkt) +VasEBoot_net_remove_packet (VasEBoot_net_packet_t *pkt) { pkt->up->count--; @@ -245,243 +245,243 @@ grub_net_remove_packet (grub_net_packet_t *pkt) pkt->next->prev = pkt->prev; else pkt->up->last = pkt->prev; - grub_free (pkt); + VasEBoot_free (pkt); } -typedef struct grub_net_app_protocol *grub_net_app_level_t; +typedef struct VasEBoot_net_app_protocol *VasEBoot_net_app_level_t; -typedef struct grub_net_socket *grub_net_socket_t; +typedef struct VasEBoot_net_socket *VasEBoot_net_socket_t; -struct grub_net_app_protocol +struct VasEBoot_net_app_protocol { - struct grub_net_app_protocol *next; - struct grub_net_app_protocol **prev; + struct VasEBoot_net_app_protocol *next; + struct VasEBoot_net_app_protocol **prev; const char *name; - grub_err_t (*dir) (grub_device_t device, const char *path, + VasEBoot_err_t (*dir) (VasEBoot_device_t device, const char *path, int (*hook) (const char *filename, - const struct grub_dirhook_info *info)); - grub_err_t (*open) (struct grub_file *file, const char *filename); - grub_err_t (*seek) (struct grub_file *file, grub_off_t off); - grub_err_t (*close) (struct grub_file *file); - grub_err_t (*packets_pulled) (struct grub_file *file); + const struct VasEBoot_dirhook_info *info)); + VasEBoot_err_t (*open) (struct VasEBoot_file *file, const char *filename); + VasEBoot_err_t (*seek) (struct VasEBoot_file *file, VasEBoot_off_t off); + VasEBoot_err_t (*close) (struct VasEBoot_file *file); + VasEBoot_err_t (*packets_pulled) (struct VasEBoot_file *file); }; -typedef struct grub_net +typedef struct VasEBoot_net { char *server; char *name; - grub_net_app_level_t protocol; - grub_net_packets_t packs; - grub_off_t offset; - grub_fs_t fs; + VasEBoot_net_app_level_t protocol; + VasEBoot_net_packets_t packs; + VasEBoot_off_t offset; + VasEBoot_fs_t fs; int eof; int stall; int port; -} *grub_net_t; +} *VasEBoot_net_t; -extern grub_net_t (*EXPORT_VAR (grub_net_open)) (const char *name); +extern VasEBoot_net_t (*EXPORT_VAR (VasEBoot_net_open)) (const char *name); -struct grub_net_network_level_interface +struct VasEBoot_net_network_level_interface { - struct grub_net_network_level_interface *next; - struct grub_net_network_level_interface **prev; + struct VasEBoot_net_network_level_interface *next; + struct VasEBoot_net_network_level_interface **prev; char *name; - struct grub_net_card *card; - grub_net_network_level_address_t address; - grub_net_link_level_address_t hwaddress; - grub_net_interface_flags_t flags; - struct grub_net_bootp_packet *dhcp_ack; - grub_size_t dhcp_acklen; + struct VasEBoot_net_card *card; + VasEBoot_net_network_level_address_t address; + VasEBoot_net_link_level_address_t hwaddress; + VasEBoot_net_interface_flags_t flags; + struct VasEBoot_net_bootp_packet *dhcp_ack; + VasEBoot_size_t dhcp_acklen; void *data; }; -struct grub_net_session; +struct VasEBoot_net_session; -struct grub_net_session_level_protocol +struct VasEBoot_net_session_level_protocol { - void (*close) (struct grub_net_session *session); - grub_ssize_t (*recv) (struct grub_net_session *session, void *buf, - grub_size_t size); - grub_err_t (*send) (struct grub_net_session *session, void *buf, - grub_size_t size); + void (*close) (struct VasEBoot_net_session *session); + VasEBoot_ssize_t (*recv) (struct VasEBoot_net_session *session, void *buf, + VasEBoot_size_t size); + VasEBoot_err_t (*send) (struct VasEBoot_net_session *session, void *buf, + VasEBoot_size_t size); }; -struct grub_net_session +struct VasEBoot_net_session { - struct grub_net_session_level_protocol *protocol; + struct VasEBoot_net_session_level_protocol *protocol; void *data; }; static inline void -grub_net_session_close (struct grub_net_session *session) +VasEBoot_net_session_close (struct VasEBoot_net_session *session) { session->protocol->close (session); } -static inline grub_err_t -grub_net_session_send (struct grub_net_session *session, void *buf, - grub_size_t size) +static inline VasEBoot_err_t +VasEBoot_net_session_send (struct VasEBoot_net_session *session, void *buf, + VasEBoot_size_t size) { return session->protocol->send (session, buf, size); } -static inline grub_ssize_t -grub_net_session_recv (struct grub_net_session *session, void *buf, - grub_size_t size) +static inline VasEBoot_ssize_t +VasEBoot_net_session_recv (struct VasEBoot_net_session *session, void *buf, + VasEBoot_size_t size) { return session->protocol->recv (session, buf, size); } -struct grub_net_network_level_interface * -grub_net_add_addr (const char *name, - struct grub_net_card *card, - const grub_net_network_level_address_t *addr, - const grub_net_link_level_address_t *hwaddress, - grub_net_interface_flags_t flags); +struct VasEBoot_net_network_level_interface * +VasEBoot_net_add_addr (const char *name, + struct VasEBoot_net_card *card, + const VasEBoot_net_network_level_address_t *addr, + const VasEBoot_net_link_level_address_t *hwaddress, + VasEBoot_net_interface_flags_t flags); -extern struct grub_net_network_level_interface *grub_net_network_level_interfaces; -#define FOR_NET_NETWORK_LEVEL_INTERFACES(var) for (var = grub_net_network_level_interfaces; var; var = var->next) -#define FOR_NET_NETWORK_LEVEL_INTERFACES_SAFE(var,next) for (var = grub_net_network_level_interfaces, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) +extern struct VasEBoot_net_network_level_interface *VasEBoot_net_network_level_interfaces; +#define FOR_NET_NETWORK_LEVEL_INTERFACES(var) for (var = VasEBoot_net_network_level_interfaces; var; var = var->next) +#define FOR_NET_NETWORK_LEVEL_INTERFACES_SAFE(var,next) for (var = VasEBoot_net_network_level_interfaces, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) -extern grub_net_app_level_t grub_net_app_level_list; +extern VasEBoot_net_app_level_t VasEBoot_net_app_level_list; -#ifndef GRUB_LST_GENERATOR +#ifndef VasEBoot_LST_GENERATOR static inline void -grub_net_app_level_register (grub_net_app_level_t proto) +VasEBoot_net_app_level_register (VasEBoot_net_app_level_t proto) { - grub_list_push (GRUB_AS_LIST_P (&grub_net_app_level_list), - GRUB_AS_LIST (proto)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_net_app_level_list), + VasEBoot_AS_LIST (proto)); } #endif static inline void -grub_net_app_level_unregister (grub_net_app_level_t proto) +VasEBoot_net_app_level_unregister (VasEBoot_net_app_level_t proto) { - grub_list_remove (GRUB_AS_LIST (proto)); + VasEBoot_list_remove (VasEBoot_AS_LIST (proto)); } #define FOR_NET_APP_LEVEL(var) FOR_LIST_ELEMENTS((var), \ - (grub_net_app_level_list)) + (VasEBoot_net_app_level_list)) -extern struct grub_net_card *grub_net_cards; +extern struct VasEBoot_net_card *VasEBoot_net_cards; static inline void -grub_net_card_register (struct grub_net_card *card) +VasEBoot_net_card_register (struct VasEBoot_net_card *card) { - grub_list_push (GRUB_AS_LIST_P (&grub_net_cards), - GRUB_AS_LIST (card)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_net_cards), + VasEBoot_AS_LIST (card)); } void -grub_net_card_unregister (struct grub_net_card *card); +VasEBoot_net_card_unregister (struct VasEBoot_net_card *card); -#define FOR_NET_CARDS(var) for (var = grub_net_cards; var; var = var->next) -#define FOR_NET_CARDS_SAFE(var, next) for (var = grub_net_cards, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) +#define FOR_NET_CARDS(var) for (var = VasEBoot_net_cards; var; var = var->next) +#define FOR_NET_CARDS_SAFE(var, next) for (var = VasEBoot_net_cards, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) -extern struct grub_net_route *grub_net_routes; +extern struct VasEBoot_net_route *VasEBoot_net_routes; static inline void -grub_net_route_register (struct grub_net_route *route) +VasEBoot_net_route_register (struct VasEBoot_net_route *route) { - grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), - GRUB_AS_LIST (route)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_net_routes), + VasEBoot_AS_LIST (route)); } -#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) -struct grub_net_session * -grub_net_open_tcp (char *address, grub_uint16_t port); +#define FOR_NET_ROUTES(var) for (var = VasEBoot_net_routes; var; var = var->next) +struct VasEBoot_net_session * +VasEBoot_net_open_tcp (char *address, VasEBoot_uint16_t port); -grub_err_t -grub_net_resolve_address (const char *name, - grub_net_network_level_address_t *addr); +VasEBoot_err_t +VasEBoot_net_resolve_address (const char *name, + VasEBoot_net_network_level_address_t *addr); -grub_err_t -grub_net_resolve_net_address (const char *name, - grub_net_network_level_netaddress_t *addr); +VasEBoot_err_t +VasEBoot_net_resolve_net_address (const char *name, + VasEBoot_net_network_level_netaddress_t *addr); -grub_err_t -grub_net_route_address (grub_net_network_level_address_t addr, - grub_net_network_level_address_t *gateway, - struct grub_net_network_level_interface **interf); +VasEBoot_err_t +VasEBoot_net_route_address (VasEBoot_net_network_level_address_t addr, + VasEBoot_net_network_level_address_t *gateway, + struct VasEBoot_net_network_level_interface **interf); -grub_err_t -grub_net_add_route (const char *name, - grub_net_network_level_netaddress_t target, - struct grub_net_network_level_interface *inter); +VasEBoot_err_t +VasEBoot_net_add_route (const char *name, + VasEBoot_net_network_level_netaddress_t target, + struct VasEBoot_net_network_level_interface *inter); -grub_err_t -grub_net_add_route_gw (const char *name, - grub_net_network_level_netaddress_t target, - grub_net_network_level_address_t gw, - struct grub_net_network_level_interface *inter); +VasEBoot_err_t +VasEBoot_net_add_route_gw (const char *name, + VasEBoot_net_network_level_netaddress_t target, + VasEBoot_net_network_level_address_t gw, + struct VasEBoot_net_network_level_interface *inter); -#define GRUB_NET_BOOTP_MAC_ADDR_LEN 16 +#define VasEBoot_NET_BOOTP_MAC_ADDR_LEN 16 -typedef grub_uint8_t grub_net_bootp_mac_addr_t[GRUB_NET_BOOTP_MAC_ADDR_LEN]; +typedef VasEBoot_uint8_t VasEBoot_net_bootp_mac_addr_t[VasEBoot_NET_BOOTP_MAC_ADDR_LEN]; -struct grub_net_bootp_packet +struct VasEBoot_net_bootp_packet { - grub_uint8_t opcode; - grub_uint8_t hw_type; /* hardware type. */ - grub_uint8_t hw_len; /* hardware addr len. */ - grub_uint8_t gate_hops; /* zero it. */ - grub_uint32_t ident; /* random number chosen by client. */ - grub_uint16_t seconds; /* seconds since did initial bootstrap. */ - grub_uint16_t flags; - grub_uint32_t client_ip; - grub_uint32_t your_ip; - grub_uint32_t server_ip; - grub_uint32_t gateway_ip; - grub_net_bootp_mac_addr_t mac_addr; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t hw_type; /* hardware type. */ + VasEBoot_uint8_t hw_len; /* hardware addr len. */ + VasEBoot_uint8_t gate_hops; /* zero it. */ + VasEBoot_uint32_t ident; /* random number chosen by client. */ + VasEBoot_uint16_t seconds; /* seconds since did initial bootstrap. */ + VasEBoot_uint16_t flags; + VasEBoot_uint32_t client_ip; + VasEBoot_uint32_t your_ip; + VasEBoot_uint32_t server_ip; + VasEBoot_uint32_t gateway_ip; + VasEBoot_net_bootp_mac_addr_t mac_addr; char server_name[64]; char boot_file[128]; - grub_uint8_t vendor[0]; -} GRUB_PACKED; + VasEBoot_uint8_t vendor[0]; +} VasEBoot_PACKED; -#define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63 -#define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82 -#define GRUB_NET_BOOTP_RFC1048_MAGIC_2 0x53 -#define GRUB_NET_BOOTP_RFC1048_MAGIC_3 0x63 +#define VasEBoot_NET_BOOTP_RFC1048_MAGIC_0 0x63 +#define VasEBoot_NET_BOOTP_RFC1048_MAGIC_1 0x82 +#define VasEBoot_NET_BOOTP_RFC1048_MAGIC_2 0x53 +#define VasEBoot_NET_BOOTP_RFC1048_MAGIC_3 0x63 enum { - GRUB_NET_BOOTP_PAD = 0x00, - GRUB_NET_BOOTP_NETMASK = 0x01, - GRUB_NET_BOOTP_ROUTER = 0x03, - GRUB_NET_BOOTP_DNS = 0x06, - GRUB_NET_BOOTP_HOSTNAME = 0x0c, - GRUB_NET_BOOTP_DOMAIN = 0x0f, - GRUB_NET_BOOTP_ROOT_PATH = 0x11, - GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12, - GRUB_NET_BOOTP_END = 0xff + VasEBoot_NET_BOOTP_PAD = 0x00, + VasEBoot_NET_BOOTP_NETMASK = 0x01, + VasEBoot_NET_BOOTP_ROUTER = 0x03, + VasEBoot_NET_BOOTP_DNS = 0x06, + VasEBoot_NET_BOOTP_HOSTNAME = 0x0c, + VasEBoot_NET_BOOTP_DOMAIN = 0x0f, + VasEBoot_NET_BOOTP_ROOT_PATH = 0x11, + VasEBoot_NET_BOOTP_EXTENSIONS_PATH = 0x12, + VasEBoot_NET_BOOTP_END = 0xff }; -struct grub_net_network_level_interface * -grub_net_configure_by_dhcp_ack (const char *name, - struct grub_net_card *card, - grub_net_interface_flags_t flags, - const struct grub_net_bootp_packet *bp, - grub_size_t size, +struct VasEBoot_net_network_level_interface * +VasEBoot_net_configure_by_dhcp_ack (const char *name, + struct VasEBoot_net_card *card, + VasEBoot_net_interface_flags_t flags, + const struct VasEBoot_net_bootp_packet *bp, + VasEBoot_size_t size, int is_def, char **device, char **path); -grub_err_t -grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf, +VasEBoot_err_t +VasEBoot_net_add_ipv4_local (struct VasEBoot_net_network_level_interface *inf, int mask); void -grub_net_process_dhcp (struct grub_net_buff *nb, - struct grub_net_card *card); +VasEBoot_net_process_dhcp (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card); int -grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a, - const grub_net_link_level_address_t *b); +VasEBoot_net_hwaddr_cmp (const VasEBoot_net_link_level_address_t *a, + const VasEBoot_net_link_level_address_t *b); int -grub_net_addr_cmp (const grub_net_network_level_address_t *a, - const grub_net_network_level_address_t *b); +VasEBoot_net_addr_cmp (const VasEBoot_net_network_level_address_t *a, + const VasEBoot_net_network_level_address_t *b); /* @@ -489,36 +489,36 @@ grub_net_addr_cmp (const grub_net_network_level_address_t *a, IPv4: XXX.XXX.XXX.XXX IPv6: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX */ -#define GRUB_NET_MAX_STR_ADDR_LEN sizeof ("XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX") +#define VasEBoot_NET_MAX_STR_ADDR_LEN sizeof ("XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX") /* Currently suppoerted adresses: ethernet: XX:XX:XX:XX:XX:XX */ -#define GRUB_NET_MAX_STR_HWADDR_LEN (sizeof ("XX:XX:XX:XX:XX:XX")) +#define VasEBoot_NET_MAX_STR_HWADDR_LEN (sizeof ("XX:XX:XX:XX:XX:XX")) void -grub_net_addr_to_str (const grub_net_network_level_address_t *target, +VasEBoot_net_addr_to_str (const VasEBoot_net_network_level_address_t *target, char *buf); void -grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str); +VasEBoot_net_hwaddr_to_str (const VasEBoot_net_link_level_address_t *addr, char *str); -grub_err_t -grub_env_set_net_property (const char *intername, const char *suffix, - const char *value, grub_size_t len); +VasEBoot_err_t +VasEBoot_env_set_net_property (const char *intername, const char *suffix, + const char *value, VasEBoot_size_t len); void -grub_net_poll_cards (unsigned time, int *stop_condition); +VasEBoot_net_poll_cards (unsigned time, int *stop_condition); -void grub_bootp_init (void); -void grub_bootp_fini (void); +void VasEBoot_bootp_init (void); +void VasEBoot_bootp_fini (void); -void grub_dns_init (void); -void grub_dns_fini (void); +void VasEBoot_dns_init (void); +void VasEBoot_dns_fini (void); static inline void -grub_net_network_level_interface_unregister (struct grub_net_network_level_interface *inter) +VasEBoot_net_network_level_interface_unregister (struct VasEBoot_net_network_level_interface *inter) { inter->card->num_ifaces--; *inter->prev = inter->next; @@ -529,37 +529,37 @@ grub_net_network_level_interface_unregister (struct grub_net_network_level_inter } void -grub_net_tcp_retransmit (void); +VasEBoot_net_tcp_retransmit (void); void -grub_net_link_layer_add_address (struct grub_net_card *card, - const grub_net_network_level_address_t *nl, - const grub_net_link_level_address_t *ll, +VasEBoot_net_link_layer_add_address (struct VasEBoot_net_card *card, + const VasEBoot_net_network_level_address_t *nl, + const VasEBoot_net_link_level_address_t *ll, int override); int -grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr); -grub_err_t -grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr, - grub_net_link_level_address_t *hw_addr); -grub_err_t -grub_net_dns_lookup (const char *name, - const struct grub_net_network_level_address *servers, - grub_size_t n_servers, - grub_size_t *naddresses, - struct grub_net_network_level_address **addresses, +VasEBoot_net_link_layer_resolve_check (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr); +VasEBoot_err_t +VasEBoot_net_link_layer_resolve (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr, + VasEBoot_net_link_level_address_t *hw_addr); +VasEBoot_err_t +VasEBoot_net_dns_lookup (const char *name, + const struct VasEBoot_net_network_level_address *servers, + VasEBoot_size_t n_servers, + VasEBoot_size_t *naddresses, + struct VasEBoot_net_network_level_address **addresses, int cache); -grub_err_t -grub_net_add_dns_server (const struct grub_net_network_level_address *s); +VasEBoot_err_t +VasEBoot_net_add_dns_server (const struct VasEBoot_net_network_level_address *s); void -grub_net_remove_dns_server (const struct grub_net_network_level_address *s); +VasEBoot_net_remove_dns_server (const struct VasEBoot_net_network_level_address *s); -extern char *grub_net_default_server; +extern char *VasEBoot_net_default_server; -#define GRUB_NET_TRIES 40 -#define GRUB_NET_INTERVAL 400 -#define GRUB_NET_INTERVAL_ADDITION 20 +#define VasEBoot_NET_TRIES 40 +#define VasEBoot_NET_INTERVAL 400 +#define VasEBoot_NET_INTERVAL_ADDITION 20 -#endif /* ! GRUB_NET_HEADER */ +#endif /* ! VasEBoot_NET_HEADER */ diff --git a/include/VasEBoot/net/arp.h b/include/VasEBoot/net/arp.h index bb1703622..66b2b5127 100644 --- a/include/VasEBoot/net/arp.h +++ b/include/VasEBoot/net/arp.h @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NET_ARP_HEADER -#define GRUB_NET_ARP_HEADER 1 -#include -#include +#ifndef VasEBoot_NET_ARP_HEADER +#define VasEBoot_NET_ARP_HEADER 1 +#include +#include -extern grub_err_t grub_net_arp_receive (struct grub_net_buff *nb, - struct grub_net_card *card); +extern VasEBoot_err_t VasEBoot_net_arp_receive (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card); -grub_err_t -grub_net_arp_send_request (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr); +VasEBoot_err_t +VasEBoot_net_arp_send_request (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr); #endif diff --git a/include/VasEBoot/net/ethernet.h b/include/VasEBoot/net/ethernet.h index 23a935e98..cbd42338d 100644 --- a/include/VasEBoot/net/ethernet.h +++ b/include/VasEBoot/net/ethernet.h @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NET_ETHERNET_HEADER -#define GRUB_NET_ETHERNET_HEADER 1 -#include -#include +#ifndef VasEBoot_NET_ETHERNET_HEADER +#define VasEBoot_NET_ETHERNET_HEADER 1 +#include +#include /* IANA Ethertype */ typedef enum { - GRUB_NET_ETHERTYPE_IP = 0x0800, - GRUB_NET_ETHERTYPE_ARP = 0x0806, - GRUB_NET_ETHERTYPE_IP6 = 0x86DD, - } grub_net_ethertype_t; + VasEBoot_NET_ETHERTYPE_IP = 0x0800, + VasEBoot_NET_ETHERTYPE_ARP = 0x0806, + VasEBoot_NET_ETHERTYPE_IP6 = 0x86DD, + } VasEBoot_net_ethertype_t; -grub_err_t -send_ethernet_packet (struct grub_net_network_level_interface *inf, - struct grub_net_buff *nb, - grub_net_link_level_address_t target_addr, - grub_net_ethertype_t ethertype); -grub_err_t -grub_net_recv_ethernet_packet (struct grub_net_buff *nb, - struct grub_net_card *card); +VasEBoot_err_t +send_ethernet_packet (struct VasEBoot_net_network_level_interface *inf, + struct VasEBoot_net_buff *nb, + VasEBoot_net_link_level_address_t target_addr, + VasEBoot_net_ethertype_t ethertype); +VasEBoot_err_t +VasEBoot_net_recv_ethernet_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card); #endif diff --git a/include/VasEBoot/net/ip.h b/include/VasEBoot/net/ip.h index dcceaa568..ee8e84e58 100644 --- a/include/VasEBoot/net/ip.h +++ b/include/VasEBoot/net/ip.h @@ -1,97 +1,97 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NET_IP_HEADER -#define GRUB_NET_IP_HEADER 1 -#include -#include +#ifndef VasEBoot_NET_IP_HEADER +#define VasEBoot_NET_IP_HEADER 1 +#include +#include -typedef enum grub_net_ip_protocol +typedef enum VasEBoot_net_ip_protocol { - GRUB_NET_IP_ICMP = 1, - GRUB_NET_IP_TCP = 6, - GRUB_NET_IP_UDP = 17, - GRUB_NET_IP_ICMPV6 = 58 - } grub_net_ip_protocol_t; -#define GRUB_NET_IP_BROADCAST 0xFFFFFFFF + VasEBoot_NET_IP_ICMP = 1, + VasEBoot_NET_IP_TCP = 6, + VasEBoot_NET_IP_UDP = 17, + VasEBoot_NET_IP_ICMPV6 = 58 + } VasEBoot_net_ip_protocol_t; +#define VasEBoot_NET_IP_BROADCAST 0xFFFFFFFF -static inline grub_uint64_t -grub_net_ipv6_get_id (const grub_net_link_level_address_t *addr) +static inline VasEBoot_uint64_t +VasEBoot_net_ipv6_get_id (const VasEBoot_net_link_level_address_t *addr) { - return grub_cpu_to_be64 (((grub_uint64_t) (addr->mac[0] ^ 2) << 56) - | ((grub_uint64_t) addr->mac[1] << 48) - | ((grub_uint64_t) addr->mac[2] << 40) + return VasEBoot_cpu_to_be64 (((VasEBoot_uint64_t) (addr->mac[0] ^ 2) << 56) + | ((VasEBoot_uint64_t) addr->mac[1] << 48) + | ((VasEBoot_uint64_t) addr->mac[2] << 40) | 0xfffe000000ULL - | ((grub_uint64_t) addr->mac[3] << 16) - | ((grub_uint64_t) addr->mac[4] << 8) - | ((grub_uint64_t) addr->mac[5])); + | ((VasEBoot_uint64_t) addr->mac[3] << 16) + | ((VasEBoot_uint64_t) addr->mac[4] << 8) + | ((VasEBoot_uint64_t) addr->mac[5])); } -grub_uint16_t grub_net_ip_chksum(void *ipv, grub_size_t len); +VasEBoot_uint16_t VasEBoot_net_ip_chksum(void *ipv, VasEBoot_size_t len); -grub_err_t -grub_net_recv_ip_packets (struct grub_net_buff *nb, - struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddress, - const grub_net_link_level_address_t *src_hwaddress); +VasEBoot_err_t +VasEBoot_net_recv_ip_packets (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddress, + const VasEBoot_net_link_level_address_t *src_hwaddress); -grub_err_t -grub_net_send_ip_packet (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *target, - const grub_net_link_level_address_t *ll_target_addr, - struct grub_net_buff *nb, - grub_net_ip_protocol_t proto); +VasEBoot_err_t +VasEBoot_net_send_ip_packet (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *target, + const VasEBoot_net_link_level_address_t *ll_target_addr, + struct VasEBoot_net_buff *nb, + VasEBoot_net_ip_protocol_t proto); -grub_err_t -grub_net_recv_icmp_packet (struct grub_net_buff *nb, - struct grub_net_network_level_interface *inf, - const grub_net_link_level_address_t *ll_src, - const grub_net_network_level_address_t *src); -grub_err_t -grub_net_recv_icmp6_packet (struct grub_net_buff *nb, - struct grub_net_card *card, - struct grub_net_network_level_interface *inf, - const grub_net_link_level_address_t *ll_src, - const grub_net_network_level_address_t *source, - const grub_net_network_level_address_t *dest, - grub_uint8_t ttl); -grub_err_t -grub_net_recv_udp_packet (struct grub_net_buff *nb, - struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *src); -grub_err_t -grub_net_recv_tcp_packet (struct grub_net_buff *nb, - struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *source); +VasEBoot_err_t +VasEBoot_net_recv_icmp_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_link_level_address_t *ll_src, + const VasEBoot_net_network_level_address_t *src); +VasEBoot_err_t +VasEBoot_net_recv_icmp6_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_card *card, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_link_level_address_t *ll_src, + const VasEBoot_net_network_level_address_t *source, + const VasEBoot_net_network_level_address_t *dest, + VasEBoot_uint8_t ttl); +VasEBoot_err_t +VasEBoot_net_recv_udp_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *src); +VasEBoot_err_t +VasEBoot_net_recv_tcp_packet (struct VasEBoot_net_buff *nb, + struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *source); -grub_uint16_t -grub_net_ip_transport_checksum (struct grub_net_buff *nb, - grub_uint16_t proto, - const grub_net_network_level_address_t *src, - const grub_net_network_level_address_t *dst); +VasEBoot_uint16_t +VasEBoot_net_ip_transport_checksum (struct VasEBoot_net_buff *nb, + VasEBoot_uint16_t proto, + const VasEBoot_net_network_level_address_t *src, + const VasEBoot_net_network_level_address_t *dst); -struct grub_net_network_level_interface * -grub_net_ipv6_get_link_local (struct grub_net_card *card, - const grub_net_link_level_address_t *hwaddr); -grub_err_t -grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, - const grub_net_network_level_address_t *proto_addr); +struct VasEBoot_net_network_level_interface * +VasEBoot_net_ipv6_get_link_local (struct VasEBoot_net_card *card, + const VasEBoot_net_link_level_address_t *hwaddr); +VasEBoot_err_t +VasEBoot_net_icmp6_send_request (struct VasEBoot_net_network_level_interface *inf, + const VasEBoot_net_network_level_address_t *proto_addr); -grub_err_t -grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf); +VasEBoot_err_t +VasEBoot_net_icmp6_send_router_solicit (struct VasEBoot_net_network_level_interface *inf); #endif diff --git a/include/VasEBoot/net/netbuff.h b/include/VasEBoot/net/netbuff.h index 1177c1220..7efd70097 100644 --- a/include/VasEBoot/net/netbuff.h +++ b/include/VasEBoot/net/netbuff.h @@ -1,31 +1,31 @@ -#ifndef GRUB_NETBUFF_HEADER -#define GRUB_NETBUFF_HEADER +#ifndef VasEBoot_NETBUFF_HEADER +#define VasEBoot_NETBUFF_HEADER -#include +#include #define NETBUFF_ALIGN 2048 #define NETBUFFMINLEN 64 -struct grub_net_buff +struct VasEBoot_net_buff { /* Pointer to the start of the buffer. */ - grub_uint8_t *head; + VasEBoot_uint8_t *head; /* Pointer to the data. */ - grub_uint8_t *data; + VasEBoot_uint8_t *data; /* Pointer to the tail. */ - grub_uint8_t *tail; + VasEBoot_uint8_t *tail; /* Pointer to the end of the buffer. */ - grub_uint8_t *end; + VasEBoot_uint8_t *end; }; -grub_err_t grub_netbuff_put (struct grub_net_buff *net_buff, grub_size_t len); -grub_err_t grub_netbuff_unput (struct grub_net_buff *net_buff, grub_size_t len); -grub_err_t grub_netbuff_push (struct grub_net_buff *net_buff, grub_size_t len); -grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len); -grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff, grub_size_t len); -grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff); -struct grub_net_buff * grub_netbuff_alloc (grub_size_t len); -struct grub_net_buff * grub_netbuff_make_pkt (grub_size_t len); -void grub_netbuff_free (struct grub_net_buff *net_buff); +VasEBoot_err_t VasEBoot_netbuff_put (struct VasEBoot_net_buff *net_buff, VasEBoot_size_t len); +VasEBoot_err_t VasEBoot_netbuff_unput (struct VasEBoot_net_buff *net_buff, VasEBoot_size_t len); +VasEBoot_err_t VasEBoot_netbuff_push (struct VasEBoot_net_buff *net_buff, VasEBoot_size_t len); +VasEBoot_err_t VasEBoot_netbuff_pull (struct VasEBoot_net_buff *net_buff, VasEBoot_size_t len); +VasEBoot_err_t VasEBoot_netbuff_reserve (struct VasEBoot_net_buff *net_buff, VasEBoot_size_t len); +VasEBoot_err_t VasEBoot_netbuff_clear (struct VasEBoot_net_buff *net_buff); +struct VasEBoot_net_buff * VasEBoot_netbuff_alloc (VasEBoot_size_t len); +struct VasEBoot_net_buff * VasEBoot_netbuff_make_pkt (VasEBoot_size_t len); +void VasEBoot_netbuff_free (struct VasEBoot_net_buff *net_buff); #endif diff --git a/include/VasEBoot/net/tcp.h b/include/VasEBoot/net/tcp.h index 5a9305ab8..b627c117d 100644 --- a/include/VasEBoot/net/tcp.h +++ b/include/VasEBoot/net/tcp.h @@ -1,85 +1,85 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NET_TCP_HEADER -#define GRUB_NET_TCP_HEADER 1 -#include -#include +#ifndef VasEBoot_NET_TCP_HEADER +#define VasEBoot_NET_TCP_HEADER 1 +#include +#include -struct grub_net_tcp_socket; -typedef struct grub_net_tcp_socket *grub_net_tcp_socket_t; +struct VasEBoot_net_tcp_socket; +typedef struct VasEBoot_net_tcp_socket *VasEBoot_net_tcp_socket_t; -struct grub_net_tcp_listen; -typedef struct grub_net_tcp_listen *grub_net_tcp_listen_t; +struct VasEBoot_net_tcp_listen; +typedef struct VasEBoot_net_tcp_listen *VasEBoot_net_tcp_listen_t; -grub_net_tcp_socket_t -grub_net_tcp_open (char *server, - grub_uint16_t out_port, - grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock, - struct grub_net_buff *nb, +VasEBoot_net_tcp_socket_t +VasEBoot_net_tcp_open (char *server, + VasEBoot_uint16_t out_port, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_tcp_socket_t sock, + struct VasEBoot_net_buff *nb, void *data), - void (*error_hook) (grub_net_tcp_socket_t sock, + void (*error_hook) (VasEBoot_net_tcp_socket_t sock, void *data), - void (*fin_hook) (grub_net_tcp_socket_t sock, + void (*fin_hook) (VasEBoot_net_tcp_socket_t sock, void *data), void *hook_data); -grub_net_tcp_listen_t -grub_net_tcp_listen (grub_uint16_t port, - const struct grub_net_network_level_interface *inf, - grub_err_t (*listen_hook) (grub_net_tcp_listen_t listen, - grub_net_tcp_socket_t sock, +VasEBoot_net_tcp_listen_t +VasEBoot_net_tcp_listen (VasEBoot_uint16_t port, + const struct VasEBoot_net_network_level_interface *inf, + VasEBoot_err_t (*listen_hook) (VasEBoot_net_tcp_listen_t listen, + VasEBoot_net_tcp_socket_t sock, void *data), void *hook_data); void -grub_net_tcp_stop_listen (grub_net_tcp_listen_t listen); +VasEBoot_net_tcp_stop_listen (VasEBoot_net_tcp_listen_t listen); -grub_err_t -grub_net_send_tcp_packet (const grub_net_tcp_socket_t socket, - struct grub_net_buff *nb, +VasEBoot_err_t +VasEBoot_net_send_tcp_packet (const VasEBoot_net_tcp_socket_t socket, + struct VasEBoot_net_buff *nb, int push); enum { - GRUB_NET_TCP_CONTINUE_RECEIVING, - GRUB_NET_TCP_DISCARD, - GRUB_NET_TCP_ABORT + VasEBoot_NET_TCP_CONTINUE_RECEIVING, + VasEBoot_NET_TCP_DISCARD, + VasEBoot_NET_TCP_ABORT }; void -grub_net_tcp_close (grub_net_tcp_socket_t sock, int discard_received); +VasEBoot_net_tcp_close (VasEBoot_net_tcp_socket_t sock, int discard_received); -grub_err_t -grub_net_tcp_accept (grub_net_tcp_socket_t sock, - grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock, - struct grub_net_buff *nb, +VasEBoot_err_t +VasEBoot_net_tcp_accept (VasEBoot_net_tcp_socket_t sock, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_tcp_socket_t sock, + struct VasEBoot_net_buff *nb, void *data), - void (*error_hook) (grub_net_tcp_socket_t sock, + void (*error_hook) (VasEBoot_net_tcp_socket_t sock, void *data), - void (*fin_hook) (grub_net_tcp_socket_t sock, + void (*fin_hook) (VasEBoot_net_tcp_socket_t sock, void *data), void *hook_data); void -grub_net_tcp_stall (grub_net_tcp_socket_t sock); +VasEBoot_net_tcp_stall (VasEBoot_net_tcp_socket_t sock); void -grub_net_tcp_unstall (grub_net_tcp_socket_t sock); +VasEBoot_net_tcp_unstall (VasEBoot_net_tcp_socket_t sock); #endif diff --git a/include/VasEBoot/net/udp.h b/include/VasEBoot/net/udp.h index 17f38cfa0..a17fda374 100644 --- a/include/VasEBoot/net/udp.h +++ b/include/VasEBoot/net/udp.h @@ -1,51 +1,51 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NET_UDP_HEADER -#define GRUB_NET_UDP_HEADER 1 -#include -#include +#ifndef VasEBoot_NET_UDP_HEADER +#define VasEBoot_NET_UDP_HEADER 1 +#include +#include struct udphdr { - grub_uint16_t src; - grub_uint16_t dst; - grub_uint16_t len; - grub_uint16_t chksum; -} GRUB_PACKED; + VasEBoot_uint16_t src; + VasEBoot_uint16_t dst; + VasEBoot_uint16_t len; + VasEBoot_uint16_t chksum; +} VasEBoot_PACKED; -struct grub_net_udp_socket; -typedef struct grub_net_udp_socket *grub_net_udp_socket_t; +struct VasEBoot_net_udp_socket; +typedef struct VasEBoot_net_udp_socket *VasEBoot_net_udp_socket_t; -grub_net_udp_socket_t -grub_net_udp_open (grub_net_network_level_address_t addr, - grub_uint16_t out_port, - grub_err_t (*recv_hook) (grub_net_udp_socket_t sock, - struct grub_net_buff *nb, +VasEBoot_net_udp_socket_t +VasEBoot_net_udp_open (VasEBoot_net_network_level_address_t addr, + VasEBoot_uint16_t out_port, + VasEBoot_err_t (*recv_hook) (VasEBoot_net_udp_socket_t sock, + struct VasEBoot_net_buff *nb, void *data), void *recv_hook_data); void -grub_net_udp_close (grub_net_udp_socket_t sock); +VasEBoot_net_udp_close (VasEBoot_net_udp_socket_t sock); -grub_err_t -grub_net_send_udp_packet (const grub_net_udp_socket_t socket, - struct grub_net_buff *nb); +VasEBoot_err_t +VasEBoot_net_send_udp_packet (const VasEBoot_net_udp_socket_t socket, + struct VasEBoot_net_buff *nb); #endif diff --git a/include/VasEBoot/normal.h b/include/VasEBoot/normal.h index 218cbabcc..b8d4825c2 100644 --- a/include/VasEBoot/normal.h +++ b/include/VasEBoot/normal.h @@ -1,54 +1,54 @@ /* normal.h - prototypes for the normal mode */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NORMAL_HEADER -#define GRUB_NORMAL_HEADER 1 +#ifndef VasEBoot_NORMAL_HEADER +#define VasEBoot_NORMAL_HEADER 1 -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* The standard left and right margin for some messages. */ #define STANDARD_MARGIN 6 /* The type of a completion item. */ -enum grub_completion_type +enum VasEBoot_completion_type { - GRUB_COMPLETION_TYPE_COMMAND, - GRUB_COMPLETION_TYPE_DEVICE, - GRUB_COMPLETION_TYPE_PARTITION, - GRUB_COMPLETION_TYPE_FILE, - GRUB_COMPLETION_TYPE_ARGUMENT + VasEBoot_COMPLETION_TYPE_COMMAND, + VasEBoot_COMPLETION_TYPE_DEVICE, + VasEBoot_COMPLETION_TYPE_PARTITION, + VasEBoot_COMPLETION_TYPE_FILE, + VasEBoot_COMPLETION_TYPE_ARGUMENT }; -typedef enum grub_completion_type grub_completion_type_t; +typedef enum VasEBoot_completion_type VasEBoot_completion_type_t; -extern struct grub_menu_viewer grub_normal_text_menu_viewer; -extern int grub_normal_exit_level; +extern struct VasEBoot_menu_viewer VasEBoot_normal_text_menu_viewer; +extern int VasEBoot_normal_exit_level; /* Defined in `main.c'. */ -void grub_enter_normal_mode (const char *config); -void grub_normal_execute (const char *config, int nested, int batch); -struct grub_term_screen_geometry +void VasEBoot_enter_normal_mode (const char *config); +void VasEBoot_normal_execute (const char *config, int nested, int batch); +struct VasEBoot_term_screen_geometry { /* The number of entries shown at a time. */ int num_entries; @@ -61,59 +61,59 @@ struct grub_term_screen_geometry int right_margin; }; -void grub_menu_init_page (int nested, int edit, - struct grub_term_screen_geometry *geo, - struct grub_term_output *term); -void grub_normal_init_page (struct grub_term_output *term, int y); -char *grub_file_getline (grub_file_t file); -void grub_cmdline_run (int nested, int force_auth); +void VasEBoot_menu_init_page (int nested, int edit, + struct VasEBoot_term_screen_geometry *geo, + struct VasEBoot_term_output *term); +void VasEBoot_normal_init_page (struct VasEBoot_term_output *term, int y); +char *VasEBoot_file_getline (VasEBoot_file_t file); +void VasEBoot_cmdline_run (int nested, int force_auth); /* Defined in `cmdline.c'. */ -char *grub_cmdline_get (const char *prompt); -grub_err_t grub_set_history (int newsize); +char *VasEBoot_cmdline_get (const char *prompt); +VasEBoot_err_t VasEBoot_set_history (int newsize); /* Defined in `completion.c'. */ -char *grub_normal_do_completion (char *buf, int *restore, - void (*hook) (const char *item, grub_completion_type_t type, int count)); +char *VasEBoot_normal_do_completion (char *buf, int *restore, + void (*hook) (const char *item, VasEBoot_completion_type_t type, int count)); /* Defined in `misc.c'. */ -grub_err_t grub_normal_print_device_info (const char *name); +VasEBoot_err_t VasEBoot_normal_print_device_info (const char *name); /* Defined in `color.c'. */ -char *grub_env_write_color_normal (struct grub_env_var *var, const char *val); -char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val); -int grub_parse_color_name_pair (grub_uint8_t *ret, const char *name); +char *VasEBoot_env_write_color_normal (struct VasEBoot_env_var *var, const char *val); +char *VasEBoot_env_write_color_highlight (struct VasEBoot_env_var *var, const char *val); +int VasEBoot_parse_color_name_pair (VasEBoot_uint8_t *ret, const char *name); /* Defined in `menu_text.c'. */ -void grub_wait_after_message (void); +void VasEBoot_wait_after_message (void); void -grub_print_ucs4 (const grub_uint32_t * str, - const grub_uint32_t * last_position, +VasEBoot_print_ucs4 (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term); + struct VasEBoot_term_output *term); void -grub_print_ucs4_menu (const grub_uint32_t * str, - const grub_uint32_t * last_position, +VasEBoot_print_ucs4_menu (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term, - int skip_lines, int max_lines, grub_uint32_t contchar, - struct grub_term_pos *pos); + struct VasEBoot_term_output *term, + int skip_lines, int max_lines, VasEBoot_uint32_t contchar, + struct VasEBoot_term_pos *pos); int -grub_ucs4_count_lines (const grub_uint32_t * str, - const grub_uint32_t * last_position, +VasEBoot_ucs4_count_lines (const VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, int margin_left, int margin_right, - struct grub_term_output *term); -grub_size_t grub_getstringwidth (grub_uint32_t * str, - const grub_uint32_t * last_position, - struct grub_term_output *term); -void grub_print_message_indented (const char *msg, int margin_left, + struct VasEBoot_term_output *term); +VasEBoot_size_t VasEBoot_getstringwidth (VasEBoot_uint32_t * str, + const VasEBoot_uint32_t * last_position, + struct VasEBoot_term_output *term); +void VasEBoot_print_message_indented (const char *msg, int margin_left, int margin_right, - struct grub_term_output *term); + struct VasEBoot_term_output *term); void -grub_menu_text_register_instances (int entry, grub_menu_t menu, int nested); -grub_err_t -grub_show_menu (grub_menu_t menu, int nested, int autobooted); +VasEBoot_menu_text_register_instances (int entry, VasEBoot_menu_t menu, int nested); +VasEBoot_err_t +VasEBoot_show_menu (VasEBoot_menu_t menu, int nested, int autobooted); /* Defined in `handler.c'. */ void read_handler_list (void); @@ -125,53 +125,53 @@ void read_command_list (const char *prefix); /* Defined in `autofs.c'. */ void read_fs_list (const char *prefix); -void grub_context_init (void); -void grub_context_fini (void); +void VasEBoot_context_init (void); +void VasEBoot_context_fini (void); void read_crypto_list (const char *prefix); void read_terminal_list (const char *prefix); -void grub_set_more (int onoff); +void VasEBoot_set_more (int onoff); -void grub_normal_reset_more (void); +void VasEBoot_normal_reset_more (void); -void grub_xputs_normal (const char *str); +void VasEBoot_xputs_normal (const char *str); -extern int grub_extractor_level; +extern int VasEBoot_extractor_level; -grub_err_t -grub_normal_add_menu_entry (int argc, const char **args, char **classes, +VasEBoot_err_t +VasEBoot_normal_add_menu_entry (int argc, const char **args, char **classes, const char *id, const char *users, const char *hotkey, const char *prefix, const char *sourcecode, int submenu); -grub_err_t -grub_normal_set_password (const char *user, const char *password); +VasEBoot_err_t +VasEBoot_normal_set_password (const char *user, const char *password); -void grub_normal_free_menu (grub_menu_t menu); +void VasEBoot_normal_free_menu (VasEBoot_menu_t menu); -void grub_normal_auth_init (void); -void grub_normal_auth_fini (void); +void VasEBoot_normal_auth_init (void); +void VasEBoot_normal_auth_fini (void); void -grub_xnputs (const char *str, grub_size_t msg_len); +VasEBoot_xnputs (const char *str, VasEBoot_size_t msg_len); -grub_command_t -grub_dyncmd_get_cmd (grub_command_t cmd); +VasEBoot_command_t +VasEBoot_dyncmd_get_cmd (VasEBoot_command_t cmd); void -grub_gettext_reread_prefix (const char *val); +VasEBoot_gettext_reread_prefix (const char *val); -enum grub_human_size_type +enum VasEBoot_human_size_type { - GRUB_HUMAN_SIZE_NORMAL, - GRUB_HUMAN_SIZE_SHORT, - GRUB_HUMAN_SIZE_SPEED, + VasEBoot_HUMAN_SIZE_NORMAL, + VasEBoot_HUMAN_SIZE_SHORT, + VasEBoot_HUMAN_SIZE_SPEED, }; const char * -grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type); +VasEBoot_get_human_size (VasEBoot_uint64_t size, enum VasEBoot_human_size_type type); -#endif /* ! GRUB_NORMAL_HEADER */ +#endif /* ! VasEBoot_NORMAL_HEADER */ diff --git a/include/VasEBoot/ns8250.h b/include/VasEBoot/ns8250.h index 7947ba9c9..261af3245 100644 --- a/include/VasEBoot/ns8250.h +++ b/include/VasEBoot/ns8250.h @@ -1,24 +1,24 @@ /* serial.h - serial device interface */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NS8250_HEADER -#define GRUB_NS8250_HEADER 1 +#ifndef VasEBoot_NS8250_HEADER +#define VasEBoot_NS8250_HEADER 1 /* Macros. */ @@ -71,10 +71,10 @@ #define UART_ENABLE_OUT2 0x08 #ifndef ASM_FILE -#include +#include -grub_port_t -grub_ns8250_hw_get_port (const unsigned int unit); +VasEBoot_port_t +VasEBoot_ns8250_hw_get_port (const unsigned int unit); #endif -#endif /* ! GRUB_SERIAL_MACHINE_HEADER */ +#endif /* ! VasEBoot_SERIAL_MACHINE_HEADER */ diff --git a/include/VasEBoot/ntfs.h b/include/VasEBoot/ntfs.h index d1a6af696..22d9986fe 100644 --- a/include/VasEBoot/ntfs.h +++ b/include/VasEBoot/ntfs.h @@ -1,198 +1,198 @@ /* ntfs.h - header for the NTFS filesystem */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NTFS_H -#define GRUB_NTFS_H 1 +#ifndef VasEBoot_NTFS_H +#define VasEBoot_NTFS_H 1 enum { - GRUB_NTFS_FILE_MFT = 0, - GRUB_NTFS_FILE_MFTMIRR = 1, - GRUB_NTFS_FILE_LOGFILE = 2, - GRUB_NTFS_FILE_VOLUME = 3, - GRUB_NTFS_FILE_ATTRDEF = 4, - GRUB_NTFS_FILE_ROOT = 5, - GRUB_NTFS_FILE_BITMAP = 6, - GRUB_NTFS_FILE_BOOT = 7, - GRUB_NTFS_FILE_BADCLUS = 8, - GRUB_NTFS_FILE_QUOTA = 9, - GRUB_NTFS_FILE_UPCASE = 10, + VasEBoot_NTFS_FILE_MFT = 0, + VasEBoot_NTFS_FILE_MFTMIRR = 1, + VasEBoot_NTFS_FILE_LOGFILE = 2, + VasEBoot_NTFS_FILE_VOLUME = 3, + VasEBoot_NTFS_FILE_ATTRDEF = 4, + VasEBoot_NTFS_FILE_ROOT = 5, + VasEBoot_NTFS_FILE_BITMAP = 6, + VasEBoot_NTFS_FILE_BOOT = 7, + VasEBoot_NTFS_FILE_BADCLUS = 8, + VasEBoot_NTFS_FILE_QUOTA = 9, + VasEBoot_NTFS_FILE_UPCASE = 10, }; enum { - GRUB_NTFS_AT_STANDARD_INFORMATION = 0x10, - GRUB_NTFS_AT_ATTRIBUTE_LIST = 0x20, - GRUB_NTFS_AT_FILENAME = 0x30, - GRUB_NTFS_AT_OBJECT_ID = 0x40, - GRUB_NTFS_AT_SECURITY_DESCRIPTOR = 0x50, - GRUB_NTFS_AT_VOLUME_NAME = 0x60, - GRUB_NTFS_AT_VOLUME_INFORMATION = 0x70, - GRUB_NTFS_AT_DATA = 0x80, - GRUB_NTFS_AT_INDEX_ROOT = 0x90, - GRUB_NTFS_AT_INDEX_ALLOCATION = 0xA0, - GRUB_NTFS_AT_BITMAP = 0xB0, - GRUB_NTFS_AT_SYMLINK = 0xC0, - GRUB_NTFS_AT_EA_INFORMATION = 0xD0, - GRUB_NTFS_AT_EA = 0xE0, + VasEBoot_NTFS_AT_STANDARD_INFORMATION = 0x10, + VasEBoot_NTFS_AT_ATTRIBUTE_LIST = 0x20, + VasEBoot_NTFS_AT_FILENAME = 0x30, + VasEBoot_NTFS_AT_OBJECT_ID = 0x40, + VasEBoot_NTFS_AT_SECURITY_DESCRIPTOR = 0x50, + VasEBoot_NTFS_AT_VOLUME_NAME = 0x60, + VasEBoot_NTFS_AT_VOLUME_INFORMATION = 0x70, + VasEBoot_NTFS_AT_DATA = 0x80, + VasEBoot_NTFS_AT_INDEX_ROOT = 0x90, + VasEBoot_NTFS_AT_INDEX_ALLOCATION = 0xA0, + VasEBoot_NTFS_AT_BITMAP = 0xB0, + VasEBoot_NTFS_AT_SYMLINK = 0xC0, + VasEBoot_NTFS_AT_EA_INFORMATION = 0xD0, + VasEBoot_NTFS_AT_EA = 0xE0, }; enum { - GRUB_NTFS_ATTR_READ_ONLY = 0x1, - GRUB_NTFS_ATTR_HIDDEN = 0x2, - GRUB_NTFS_ATTR_SYSTEM = 0x4, - GRUB_NTFS_ATTR_ARCHIVE = 0x20, - GRUB_NTFS_ATTR_DEVICE = 0x40, - GRUB_NTFS_ATTR_NORMAL = 0x80, - GRUB_NTFS_ATTR_TEMPORARY = 0x100, - GRUB_NTFS_ATTR_SPARSE = 0x200, - GRUB_NTFS_ATTR_REPARSE = 0x400, - GRUB_NTFS_ATTR_COMPRESSED = 0x800, - GRUB_NTFS_ATTR_OFFLINE = 0x1000, - GRUB_NTFS_ATTR_NOT_INDEXED = 0x2000, - GRUB_NTFS_ATTR_ENCRYPTED = 0x4000, - GRUB_NTFS_ATTR_DIRECTORY = 0x10000000, - GRUB_NTFS_ATTR_INDEX_VIEW = 0x20000000 + VasEBoot_NTFS_ATTR_READ_ONLY = 0x1, + VasEBoot_NTFS_ATTR_HIDDEN = 0x2, + VasEBoot_NTFS_ATTR_SYSTEM = 0x4, + VasEBoot_NTFS_ATTR_ARCHIVE = 0x20, + VasEBoot_NTFS_ATTR_DEVICE = 0x40, + VasEBoot_NTFS_ATTR_NORMAL = 0x80, + VasEBoot_NTFS_ATTR_TEMPORARY = 0x100, + VasEBoot_NTFS_ATTR_SPARSE = 0x200, + VasEBoot_NTFS_ATTR_REPARSE = 0x400, + VasEBoot_NTFS_ATTR_COMPRESSED = 0x800, + VasEBoot_NTFS_ATTR_OFFLINE = 0x1000, + VasEBoot_NTFS_ATTR_NOT_INDEXED = 0x2000, + VasEBoot_NTFS_ATTR_ENCRYPTED = 0x4000, + VasEBoot_NTFS_ATTR_DIRECTORY = 0x10000000, + VasEBoot_NTFS_ATTR_INDEX_VIEW = 0x20000000 }; enum { - GRUB_NTFS_FLAG_COMPRESSED = 1, - GRUB_NTFS_FLAG_ENCRYPTED = 0x4000, - GRUB_NTFS_FLAG_SPARSE = 0x8000 + VasEBoot_NTFS_FLAG_COMPRESSED = 1, + VasEBoot_NTFS_FLAG_ENCRYPTED = 0x4000, + VasEBoot_NTFS_FLAG_SPARSE = 0x8000 }; -#define GRUB_NTFS_BLK_SHR GRUB_DISK_SECTOR_BITS +#define VasEBoot_NTFS_BLK_SHR VasEBoot_DISK_SECTOR_BITS -#define GRUB_NTFS_MAX_MFT (4096 >> GRUB_NTFS_BLK_SHR) -#define GRUB_NTFS_MAX_IDX (16384 >> GRUB_NTFS_BLK_SHR) +#define VasEBoot_NTFS_MAX_MFT (4096 >> VasEBoot_NTFS_BLK_SHR) +#define VasEBoot_NTFS_MAX_IDX (16384 >> VasEBoot_NTFS_BLK_SHR) -#define GRUB_NTFS_COM_LEN 4096 -#define GRUB_NTFS_COM_LOG_LEN 12 -#define GRUB_NTFS_COM_SEC (GRUB_NTFS_COM_LEN >> GRUB_NTFS_BLK_SHR) -#define GRUB_NTFS_LOG_COM_SEC (GRUB_NTFS_COM_LOG_LEN - GRUB_NTFS_BLK_SHR) +#define VasEBoot_NTFS_COM_LEN 4096 +#define VasEBoot_NTFS_COM_LOG_LEN 12 +#define VasEBoot_NTFS_COM_SEC (VasEBoot_NTFS_COM_LEN >> VasEBoot_NTFS_BLK_SHR) +#define VasEBoot_NTFS_LOG_COM_SEC (VasEBoot_NTFS_COM_LOG_LEN - VasEBoot_NTFS_BLK_SHR) enum { - GRUB_NTFS_AF_ALST = 1, - GRUB_NTFS_AF_MMFT = 2, - GRUB_NTFS_AF_GPOS = 4, + VasEBoot_NTFS_AF_ALST = 1, + VasEBoot_NTFS_AF_MMFT = 2, + VasEBoot_NTFS_AF_GPOS = 4, }; enum { - GRUB_NTFS_RF_BLNK = 1 + VasEBoot_NTFS_RF_BLNK = 1 }; -struct grub_ntfs_bpb +struct VasEBoot_ntfs_bpb { - grub_uint8_t jmp_boot[3]; - grub_uint8_t oem_name[8]; - grub_uint16_t bytes_per_sector; - grub_uint8_t sectors_per_cluster; - grub_uint8_t reserved_1[7]; - grub_uint8_t media; - grub_uint16_t reserved_2; - grub_uint16_t sectors_per_track; - grub_uint16_t num_heads; - grub_uint32_t num_hidden_sectors; - grub_uint32_t reserved_3; - grub_uint8_t bios_drive; - grub_uint8_t reserved_4[3]; - grub_uint64_t num_total_sectors; - grub_uint64_t mft_lcn; - grub_uint64_t mft_mirr_lcn; - grub_int8_t clusters_per_mft; - grub_int8_t reserved_5[3]; - grub_int8_t clusters_per_index; - grub_int8_t reserved_6[3]; - grub_uint64_t num_serial; - grub_uint32_t checksum; -} GRUB_PACKED; + VasEBoot_uint8_t jmp_boot[3]; + VasEBoot_uint8_t oem_name[8]; + VasEBoot_uint16_t bytes_per_sector; + VasEBoot_uint8_t sectors_per_cluster; + VasEBoot_uint8_t reserved_1[7]; + VasEBoot_uint8_t media; + VasEBoot_uint16_t reserved_2; + VasEBoot_uint16_t sectors_per_track; + VasEBoot_uint16_t num_heads; + VasEBoot_uint32_t num_hidden_sectors; + VasEBoot_uint32_t reserved_3; + VasEBoot_uint8_t bios_drive; + VasEBoot_uint8_t reserved_4[3]; + VasEBoot_uint64_t num_total_sectors; + VasEBoot_uint64_t mft_lcn; + VasEBoot_uint64_t mft_mirr_lcn; + VasEBoot_int8_t clusters_per_mft; + VasEBoot_int8_t reserved_5[3]; + VasEBoot_int8_t clusters_per_index; + VasEBoot_int8_t reserved_6[3]; + VasEBoot_uint64_t num_serial; + VasEBoot_uint32_t checksum; +} VasEBoot_PACKED; -struct grub_ntfs_attr +struct VasEBoot_ntfs_attr { int flags; - grub_uint8_t *emft_buf, *edat_buf; - grub_uint8_t *attr_cur, *attr_nxt, *attr_end; - grub_uint32_t save_pos; - grub_uint8_t *sbuf; - struct grub_ntfs_file *mft; + VasEBoot_uint8_t *emft_buf, *edat_buf; + VasEBoot_uint8_t *attr_cur, *attr_nxt, *attr_end; + VasEBoot_uint32_t save_pos; + VasEBoot_uint8_t *sbuf; + struct VasEBoot_ntfs_file *mft; }; -struct grub_ntfs_file +struct VasEBoot_ntfs_file { - struct grub_ntfs_data *data; - grub_uint8_t *buf; - grub_uint64_t size; - grub_uint64_t mtime; - grub_uint64_t ino; + struct VasEBoot_ntfs_data *data; + VasEBoot_uint8_t *buf; + VasEBoot_uint64_t size; + VasEBoot_uint64_t mtime; + VasEBoot_uint64_t ino; int inode_read; - struct grub_ntfs_attr attr; + struct VasEBoot_ntfs_attr attr; }; -struct grub_ntfs_data +struct VasEBoot_ntfs_data { - struct grub_ntfs_file cmft; - struct grub_ntfs_file mmft; - grub_disk_t disk; - grub_uint64_t mft_size; - grub_uint64_t idx_size; + struct VasEBoot_ntfs_file cmft; + struct VasEBoot_ntfs_file mmft; + VasEBoot_disk_t disk; + VasEBoot_uint64_t mft_size; + VasEBoot_uint64_t idx_size; int log_spc; - grub_uint64_t mft_start; - grub_uint64_t uuid; + VasEBoot_uint64_t mft_start; + VasEBoot_uint64_t uuid; }; -struct grub_ntfs_comp_table_element +struct VasEBoot_ntfs_comp_table_element { - grub_uint32_t next_vcn; - grub_uint32_t next_lcn; + VasEBoot_uint32_t next_vcn; + VasEBoot_uint32_t next_lcn; }; -struct grub_ntfs_comp +struct VasEBoot_ntfs_comp { - grub_disk_t disk; + VasEBoot_disk_t disk; int comp_head, comp_tail; - struct grub_ntfs_comp_table_element comp_table[16]; - grub_uint32_t cbuf_ofs, cbuf_vcn; + struct VasEBoot_ntfs_comp_table_element comp_table[16]; + VasEBoot_uint32_t cbuf_ofs, cbuf_vcn; int log_spc; - grub_uint8_t *cbuf; + VasEBoot_uint8_t *cbuf; }; -struct grub_ntfs_rlst +struct VasEBoot_ntfs_rlst { int flags; - grub_disk_addr_t target_vcn, curr_vcn, next_vcn, curr_lcn; - grub_uint8_t *cur_run; - struct grub_ntfs_attr *attr; - struct grub_ntfs_comp comp; + VasEBoot_disk_addr_t target_vcn, curr_vcn, next_vcn, curr_lcn; + VasEBoot_uint8_t *cur_run; + struct VasEBoot_ntfs_attr *attr; + struct VasEBoot_ntfs_comp comp; void *file; }; -typedef grub_err_t (*grub_ntfscomp_func_t) (grub_uint8_t *dest, - grub_disk_addr_t ofs, - grub_size_t len, - struct grub_ntfs_rlst * ctx); +typedef VasEBoot_err_t (*VasEBoot_ntfscomp_func_t) (VasEBoot_uint8_t *dest, + VasEBoot_disk_addr_t ofs, + VasEBoot_size_t len, + struct VasEBoot_ntfs_rlst * ctx); -extern grub_ntfscomp_func_t grub_ntfscomp_func; +extern VasEBoot_ntfscomp_func_t VasEBoot_ntfscomp_func; -grub_err_t grub_ntfs_read_run_list (struct grub_ntfs_rlst *ctx); +VasEBoot_err_t VasEBoot_ntfs_read_run_list (struct VasEBoot_ntfs_rlst *ctx); -#endif /* ! GRUB_NTFS_H */ +#endif /* ! VasEBoot_NTFS_H */ diff --git a/include/VasEBoot/offsets.h b/include/VasEBoot/offsets.h index c88c86d4d..3d63b26a3 100644 --- a/include/VasEBoot/offsets.h +++ b/include/VasEBoot/offsets.h @@ -1,159 +1,159 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef OFFSETS_HEADER #define OFFSETS_HEADER 1 -/* The offset of GRUB_COMPRESSED_SIZE. */ -#define GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE 0x08 +/* The offset of VasEBoot_COMPRESSED_SIZE. */ +#define VasEBoot_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE 0x08 -/* The offset of GRUB_COMPRESSED_SIZE. */ -#define GRUB_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE 0x0c +/* The offset of VasEBoot_COMPRESSED_SIZE. */ +#define VasEBoot_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE 0x0c /* Offset of reed_solomon_redundancy. */ -#define GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY 0x10 +#define VasEBoot_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY 0x10 /* Offset of field holding no reed solomon length. */ -#define GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH 0x14 +#define VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH 0x14 -#define GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE 0x18 +#define VasEBoot_DECOMPRESSOR_I386_PC_BOOT_DEVICE 0x18 -#define GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE (0x9000-0x8200) +#define VasEBoot_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE (0x9000-0x8200) /* The segment where the kernel is loaded. */ -#define GRUB_BOOT_I386_PC_KERNEL_SEG 0x800 +#define VasEBoot_BOOT_I386_PC_KERNEL_SEG 0x800 -#define GRUB_KERNEL_I386_PC_LINK_ADDR 0x9000 +#define VasEBoot_KERNEL_I386_PC_LINK_ADDR 0x9000 /* The upper memory area (starting at 640 kiB). */ -#define GRUB_MEMORY_I386_PC_UPPER 0xa0000 -#define GRUB_MEMORY_I386_QEMU_UPPER GRUB_MEMORY_I386_PC_UPPER +#define VasEBoot_MEMORY_I386_PC_UPPER 0xa0000 +#define VasEBoot_MEMORY_I386_QEMU_UPPER VasEBoot_MEMORY_I386_PC_UPPER -/* The offset of GRUB_CORE_ENTRY_ADDR. */ -#define GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR 0x4 +/* The offset of VasEBoot_CORE_ENTRY_ADDR. */ +#define VasEBoot_BOOT_I386_QEMU_CORE_ENTRY_ADDR 0x4 -/* The offset of GRUB_CORE_ENTRY_ADDR. */ -#define GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR 0x8 +/* The offset of VasEBoot_CORE_ENTRY_ADDR. */ +#define VasEBoot_KERNEL_I386_QEMU_CORE_ENTRY_ADDR 0x8 -#define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x8200 +#define VasEBoot_KERNEL_I386_QEMU_LINK_ADDR 0x8200 -/* The offset of GRUB_TOTAL_MODULE_SIZE. */ -#define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8 -#define GRUB_KERNEL_ARM_STACK_SIZE 0x40000 +/* The offset of VasEBoot_TOTAL_MODULE_SIZE. */ +#define VasEBoot_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8 +#define VasEBoot_KERNEL_ARM_STACK_SIZE 0x40000 -#define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12 +#define VasEBoot_BOOT_SPARC64_IEEE1275_LIST_SIZE 12 -#define GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS 0x4400 -#define GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR 0x4400 +#define VasEBoot_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS 0x4400 +#define VasEBoot_KERNEL_SPARC64_IEEE1275_LINK_ADDR 0x4400 -#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4 -#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000 +#define VasEBoot_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4 +#define VasEBoot_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000 -#define GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR 0x80200000 +#define VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ADDR 0x80200000 -#define GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN 32 +#define VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ALIGN 32 -#define GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE 0x8 -#define GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE 0xc -#define GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR 0x10 +#define VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE 0x8 +#define VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE 0xc +#define VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR 0x10 -#define GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE 0x08 +#define VasEBoot_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE 0x08 -#define GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR 0x80200000 -#define GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN 32 -#define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_COMPRESSED_SIZE 0x8 -#define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_SIZE 0xc -#define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR 0x10 -#define GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE 0x08 +#define VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR 0x80200000 +#define VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN 32 +#define VasEBoot_DECOMPRESSOR_MIPS_QEMU_MIPS_COMPRESSED_SIZE 0x8 +#define VasEBoot_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_SIZE 0xc +#define VasEBoot_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR 0x10 +#define VasEBoot_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE 0x08 -#define GRUB_KERNEL_MIPS_ARC_LINK_ADDR 0x88200000 -#define GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR 0x80700000 -#define GRUB_KERNEL_MIPS_ARC_LINK_ALIGN 32 +#define VasEBoot_KERNEL_MIPS_ARC_LINK_ADDR 0x88200000 +#define VasEBoot_KERNEL_MIPSEL_ARC_LINK_ADDR 0x80700000 +#define VasEBoot_KERNEL_MIPS_ARC_LINK_ALIGN 32 -#define GRUB_DECOMPRESSOR_MIPS_ARC_COMPRESSED_SIZE 0x8 -#define GRUB_DECOMPRESSOR_MIPS_ARC_UNCOMPRESSED_SIZE 0xc -#define GRUB_DECOMPRESSOR_MIPS_ARC_UNCOMPRESSED_ADDR 0x10 +#define VasEBoot_DECOMPRESSOR_MIPS_ARC_COMPRESSED_SIZE 0x8 +#define VasEBoot_DECOMPRESSOR_MIPS_ARC_UNCOMPRESSED_SIZE 0xc +#define VasEBoot_DECOMPRESSOR_MIPS_ARC_UNCOMPRESSED_ADDR 0x10 -#define GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE 0x08 +#define VasEBoot_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE 0x08 -#define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200 -#define GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR 0x100000 +#define VasEBoot_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200 +#define VasEBoot_KERNEL_I386_COREBOOT_MODULES_ADDR 0x100000 -#define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000 +#define VasEBoot_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000 -#define GRUB_KERNEL_I386_IEEE1275_MOD_ALIGN 0x1000 -#define GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN 0x1 -#define GRUB_KERNEL_I386_MULTIBOOT_MOD_ALIGN GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN +#define VasEBoot_KERNEL_I386_IEEE1275_MOD_ALIGN 0x1000 +#define VasEBoot_KERNEL_I386_COREBOOT_MOD_ALIGN 0x1 +#define VasEBoot_KERNEL_I386_MULTIBOOT_MOD_ALIGN VasEBoot_KERNEL_I386_COREBOOT_MOD_ALIGN -#define GRUB_KERNEL_X86_64_XEN_MOD_ALIGN 0x8 -#define GRUB_KERNEL_I386_XEN_MOD_ALIGN 0x8 +#define VasEBoot_KERNEL_X86_64_XEN_MOD_ALIGN 0x8 +#define VasEBoot_KERNEL_I386_XEN_MOD_ALIGN 0x8 /* Non-zero value is only needed for PowerMacs. */ -#define GRUB_KERNEL_X86_64_XEN_MOD_GAP 0x0 -#define GRUB_KERNEL_I386_XEN_MOD_GAP 0x0 -#define GRUB_KERNEL_I386_IEEE1275_MOD_GAP 0x0 -#define GRUB_KERNEL_I386_COREBOOT_MOD_GAP 0x0 -#define GRUB_KERNEL_SPARC64_IEEE1275_MOD_GAP 0x0 -#define GRUB_KERNEL_ARM_UBOOT_MOD_GAP 0x0 +#define VasEBoot_KERNEL_X86_64_XEN_MOD_GAP 0x0 +#define VasEBoot_KERNEL_I386_XEN_MOD_GAP 0x0 +#define VasEBoot_KERNEL_I386_IEEE1275_MOD_GAP 0x0 +#define VasEBoot_KERNEL_I386_COREBOOT_MOD_GAP 0x0 +#define VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_GAP 0x0 +#define VasEBoot_KERNEL_ARM_UBOOT_MOD_GAP 0x0 -#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000 -#define GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN 3 -#define GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN (1 << GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN) +#define VasEBoot_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000 +#define VasEBoot_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN 3 +#define VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN (1 << VasEBoot_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN) -#define GRUB_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x1 -#define GRUB_KERNEL_MIPS_ARC_MOD_ALIGN 0x1 -#define GRUB_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN 0x1 +#define VasEBoot_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x1 +#define VasEBoot_KERNEL_MIPS_ARC_MOD_ALIGN 0x1 +#define VasEBoot_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN 0x1 -#define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8 -#define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4 +#define VasEBoot_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8 +#define VasEBoot_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4 /* 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. */ -#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000 + rewrite VasEBoot-mkimage to generate valid ELF files. */ +#define VasEBoot_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000 -#ifdef GRUB_MACHINE -#define GRUB_OFFSETS_CONCAT_(a,b,c) a ## b ## c -#define GRUB_OFFSETS_CONCAT(a,b,c) GRUB_OFFSETS_CONCAT_(a,b,c) -#define GRUB_KERNEL_MACHINE_MOD_ALIGN GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_ALIGN) -#define GRUB_KERNEL_MACHINE_MOD_GAP GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_GAP) -#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _TOTAL_MODULE_SIZE) +#ifdef VasEBoot_MACHINE +#define VasEBoot_OFFSETS_CONCAT_(a,b,c) a ## b ## c +#define VasEBoot_OFFSETS_CONCAT(a,b,c) VasEBoot_OFFSETS_CONCAT_(a,b,c) +#define VasEBoot_KERNEL_MACHINE_MOD_ALIGN VasEBoot_OFFSETS_CONCAT (VasEBoot_KERNEL_, VasEBoot_MACHINE, _MOD_ALIGN) +#define VasEBoot_KERNEL_MACHINE_MOD_GAP VasEBoot_OFFSETS_CONCAT (VasEBoot_KERNEL_, VasEBoot_MACHINE, _MOD_GAP) +#define VasEBoot_KERNEL_MACHINE_TOTAL_MODULE_SIZE VasEBoot_OFFSETS_CONCAT (VasEBoot_KERNEL_, VasEBoot_MACHINE, _TOTAL_MODULE_SIZE) -#define GRUB_BOOT_MACHINE_KERNEL_SEG GRUB_OFFSETS_CONCAT (GRUB_BOOT_, GRUB_MACHINE, _KERNEL_SEG) -#define GRUB_MEMORY_MACHINE_UPPER GRUB_OFFSETS_CONCAT (GRUB_MEMORY_, GRUB_MACHINE, _UPPER) -#if defined (GRUB_MACHINE_ARC) && defined (GRUB_CPU_MIPSEL) -#define GRUB_MACHINE_LINK_ADDR GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR +#define VasEBoot_BOOT_MACHINE_KERNEL_SEG VasEBoot_OFFSETS_CONCAT (VasEBoot_BOOT_, VasEBoot_MACHINE, _KERNEL_SEG) +#define VasEBoot_MEMORY_MACHINE_UPPER VasEBoot_OFFSETS_CONCAT (VasEBoot_MEMORY_, VasEBoot_MACHINE, _UPPER) +#if defined (VasEBoot_MACHINE_ARC) && defined (VasEBoot_CPU_MIPSEL) +#define VasEBoot_MACHINE_LINK_ADDR VasEBoot_KERNEL_MIPSEL_ARC_LINK_ADDR #else -#define GRUB_MACHINE_LINK_ADDR GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _LINK_ADDR) +#define VasEBoot_MACHINE_LINK_ADDR VasEBoot_OFFSETS_CONCAT (VasEBoot_KERNEL_, VasEBoot_MACHINE, _LINK_ADDR) #endif -#define GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _COMPRESSED_SIZE) -#define GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _UNCOMPRESSED_SIZE) -#define GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _UNCOMPRESSED_ADDR) +#define VasEBoot_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE VasEBoot_OFFSETS_CONCAT (VasEBoot_DECOMPRESSOR_, VasEBoot_MACHINE, _COMPRESSED_SIZE) +#define VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE VasEBoot_OFFSETS_CONCAT (VasEBoot_DECOMPRESSOR_, VasEBoot_MACHINE, _UNCOMPRESSED_SIZE) +#define VasEBoot_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR VasEBoot_OFFSETS_CONCAT (VasEBoot_DECOMPRESSOR_, VasEBoot_MACHINE, _UNCOMPRESSED_ADDR) #endif #ifndef ASM_FILE -struct grub_pc_bios_boot_blocklist +struct VasEBoot_pc_bios_boot_blocklist { - grub_uint64_t start; - grub_uint16_t len; - grub_uint16_t segment; -} GRUB_PACKED; + VasEBoot_uint64_t start; + VasEBoot_uint16_t len; + VasEBoot_uint16_t segment; +} VasEBoot_PACKED; #endif #endif diff --git a/include/VasEBoot/osdep/hostfile_aros.h b/include/VasEBoot/osdep/hostfile_aros.h index a059c0fa4..721c3cb73 100644 --- a/include/VasEBoot/osdep/hostfile_aros.h +++ b/include/VasEBoot/osdep/hostfile_aros.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EMU_HOSTFILE_H -#define GRUB_EMU_HOSTFILE_H 1 +#ifndef VasEBoot_EMU_HOSTFILE_H +#define VasEBoot_EMU_HOSTFILE_H 1 #include #include @@ -29,51 +29,51 @@ #include #include -typedef struct dirent *grub_util_fd_dirent_t; -typedef DIR *grub_util_fd_dir_t; +typedef struct dirent *VasEBoot_util_fd_dirent_t; +typedef DIR *VasEBoot_util_fd_dir_t; -static inline grub_util_fd_dir_t -grub_util_fd_opendir (const char *name) +static inline VasEBoot_util_fd_dir_t +VasEBoot_util_fd_opendir (const char *name) { return opendir (name); } static inline void -grub_util_fd_closedir (grub_util_fd_dir_t dirp) +VasEBoot_util_fd_closedir (VasEBoot_util_fd_dir_t dirp) { closedir (dirp); } -static inline grub_util_fd_dirent_t -grub_util_fd_readdir (grub_util_fd_dir_t dirp) +static inline VasEBoot_util_fd_dirent_t +VasEBoot_util_fd_readdir (VasEBoot_util_fd_dir_t dirp) { return readdir (dirp); } static inline int -grub_util_rmdir (const char *pathname) +VasEBoot_util_rmdir (const char *pathname) { return rmdir (pathname); } static inline int -grub_util_unlink (const char *pathname) +VasEBoot_util_unlink (const char *pathname) { return unlink (pathname); } static inline int -grub_util_rename (const char *from, const char *to) +VasEBoot_util_rename (const char *from, const char *to) { return rename (from, to); } -#define grub_util_mkdir(a) mkdir ((a), 0755) +#define VasEBoot_util_mkdir(a) mkdir ((a), 0755) -struct grub_util_fd +struct VasEBoot_util_fd { - enum { GRUB_UTIL_FD_FILE, GRUB_UTIL_FD_DISK } type; - grub_uint64_t off; + enum { VasEBoot_UTIL_FD_FILE, VasEBoot_UTIL_FD_DISK } type; + VasEBoot_uint64_t off; union { int fd; @@ -85,15 +85,15 @@ struct grub_util_fd }; }; }; -typedef struct grub_util_fd *grub_util_fd_t; +typedef struct VasEBoot_util_fd *VasEBoot_util_fd_t; -enum grub_util_fd_open_flags_t +enum VasEBoot_util_fd_open_flags_t { - GRUB_UTIL_FD_O_RDONLY = O_RDONLY, - GRUB_UTIL_FD_O_WRONLY = O_WRONLY, - GRUB_UTIL_FD_O_RDWR = O_RDWR, - GRUB_UTIL_FD_O_CREATTRUNC = O_CREAT | O_TRUNC, - GRUB_UTIL_FD_O_SYNC = (0 + VasEBoot_UTIL_FD_O_RDONLY = O_RDONLY, + VasEBoot_UTIL_FD_O_WRONLY = O_WRONLY, + VasEBoot_UTIL_FD_O_RDWR = O_RDWR, + VasEBoot_UTIL_FD_O_CREATTRUNC = O_CREAT | O_TRUNC, + VasEBoot_UTIL_FD_O_SYNC = (0 #ifdef O_SYNC | O_SYNC #endif @@ -103,11 +103,11 @@ enum grub_util_fd_open_flags_t ) }; -#define GRUB_UTIL_FD_INVALID NULL -#define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID) -#define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 0 +#define VasEBoot_UTIL_FD_INVALID NULL +#define VasEBoot_UTIL_FD_IS_VALID(x) ((x) != VasEBoot_UTIL_FD_INVALID) +#define VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL 0 -#define DEFAULT_DIRECTORY "SYS:" GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME +#define DEFAULT_DIRECTORY "SYS:" VasEBoot_BOOT_DIR_NAME "/" VasEBoot_DIR_NAME #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" #endif diff --git a/include/VasEBoot/osdep/hostfile_unix.h b/include/VasEBoot/osdep/hostfile_unix.h index 9ffe46fa3..5970528cd 100644 --- a/include/VasEBoot/osdep/hostfile_unix.h +++ b/include/VasEBoot/osdep/hostfile_unix.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EMU_HOSTFILE_H -#define GRUB_EMU_HOSTFILE_H 1 +#ifndef VasEBoot_EMU_HOSTFILE_H +#define VasEBoot_EMU_HOSTFILE_H 1 #include #include -#include -#include +#include +#include #include #include @@ -32,61 +32,61 @@ #include #include -typedef struct dirent *grub_util_fd_dirent_t; -typedef DIR *grub_util_fd_dir_t; +typedef struct dirent *VasEBoot_util_fd_dirent_t; +typedef DIR *VasEBoot_util_fd_dir_t; -static inline grub_util_fd_dir_t -grub_util_fd_opendir (const char *name) +static inline VasEBoot_util_fd_dir_t +VasEBoot_util_fd_opendir (const char *name) { return opendir (name); } static inline void -grub_util_fd_closedir (grub_util_fd_dir_t dirp) +VasEBoot_util_fd_closedir (VasEBoot_util_fd_dir_t dirp) { closedir (dirp); } -static inline grub_util_fd_dirent_t -grub_util_fd_readdir (grub_util_fd_dir_t dirp) +static inline VasEBoot_util_fd_dirent_t +VasEBoot_util_fd_readdir (VasEBoot_util_fd_dir_t dirp) { return readdir (dirp); } static inline int -grub_util_unlink (const char *pathname) +VasEBoot_util_unlink (const char *pathname) { return unlink (pathname); } static inline int -grub_util_rmdir (const char *pathname) +VasEBoot_util_rmdir (const char *pathname) { return rmdir (pathname); } static inline int -grub_util_rename (const char *from, const char *to) +VasEBoot_util_rename (const char *from, const char *to) { return rename (from, to); } -#define grub_util_mkdir(a) mkdir ((a), 0755) +#define VasEBoot_util_mkdir(a) mkdir ((a), 0755) #if defined (__NetBSD__) /* NetBSD uses /boot for its boot block. */ -# define DEFAULT_DIRECTORY "/"GRUB_DIR_NAME +# define DEFAULT_DIRECTORY "/"VasEBoot_DIR_NAME #else -# define DEFAULT_DIRECTORY "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME +# define DEFAULT_DIRECTORY "/"VasEBoot_BOOT_DIR_NAME"/"VasEBoot_DIR_NAME #endif -enum grub_util_fd_open_flags_t +enum VasEBoot_util_fd_open_flags_t { - GRUB_UTIL_FD_O_RDONLY = O_RDONLY, - GRUB_UTIL_FD_O_WRONLY = O_WRONLY, - GRUB_UTIL_FD_O_RDWR = O_RDWR, - GRUB_UTIL_FD_O_CREATTRUNC = O_CREAT | O_TRUNC, - GRUB_UTIL_FD_O_SYNC = (0 + VasEBoot_UTIL_FD_O_RDONLY = O_RDONLY, + VasEBoot_UTIL_FD_O_WRONLY = O_WRONLY, + VasEBoot_UTIL_FD_O_RDWR = O_RDWR, + VasEBoot_UTIL_FD_O_CREATTRUNC = O_CREAT | O_TRUNC, + VasEBoot_UTIL_FD_O_SYNC = (0 #ifdef O_SYNC | O_SYNC #endif @@ -98,15 +98,15 @@ enum grub_util_fd_open_flags_t #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" -typedef int grub_util_fd_t; -#define GRUB_UTIL_FD_INVALID -1 -#define GRUB_UTIL_FD_IS_VALID(x) ((x) >= 0) -#define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 1 +typedef int VasEBoot_util_fd_t; +#define VasEBoot_UTIL_FD_INVALID -1 +#define VasEBoot_UTIL_FD_IS_VALID(x) ((x) >= 0) +#define VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL 1 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__NetBSD__) || defined (__sun__) || defined(__OpenBSD__) || defined(__HAIKU__) -#define GRUB_DISK_DEVS_ARE_CHAR 1 +#define VasEBoot_DISK_DEVS_ARE_CHAR 1 #else -#define GRUB_DISK_DEVS_ARE_CHAR 0 +#define VasEBoot_DISK_DEVS_ARE_CHAR 0 #endif #endif diff --git a/include/VasEBoot/osdep/hostfile_windows.h b/include/VasEBoot/osdep/hostfile_windows.h index bf6451b6d..4db1b1ee1 100644 --- a/include/VasEBoot/osdep/hostfile_windows.h +++ b/include/VasEBoot/osdep/hostfile_windows.h @@ -1,70 +1,70 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_EMU_HOSTFILE_H -#define GRUB_EMU_HOSTFILE_H 1 +#ifndef VasEBoot_EMU_HOSTFILE_H +#define VasEBoot_EMU_HOSTFILE_H 1 #include #include #include -typedef HANDLE grub_util_fd_t; -#define GRUB_UTIL_FD_INVALID INVALID_HANDLE_VALUE -#define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID) -#define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 0 +typedef HANDLE VasEBoot_util_fd_t; +#define VasEBoot_UTIL_FD_INVALID INVALID_HANDLE_VALUE +#define VasEBoot_UTIL_FD_IS_VALID(x) ((x) != VasEBoot_UTIL_FD_INVALID) +#define VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL 0 -#define DEFAULT_DIRECTORY "C:\\"GRUB_BOOT_DIR_NAME"\\"GRUB_DIR_NAME +#define DEFAULT_DIRECTORY "C:\\"VasEBoot_BOOT_DIR_NAME"\\"VasEBoot_DIR_NAME #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map" -struct grub_util_fd_dirent +struct VasEBoot_util_fd_dirent { char d_name[0]; }; -struct grub_util_fd_dir; -typedef struct grub_util_fd_dirent *grub_util_fd_dirent_t; -typedef struct grub_util_fd_dir *grub_util_fd_dir_t; +struct VasEBoot_util_fd_dir; +typedef struct VasEBoot_util_fd_dirent *VasEBoot_util_fd_dirent_t; +typedef struct VasEBoot_util_fd_dir *VasEBoot_util_fd_dir_t; int -grub_util_rename (const char *from, const char *to); +VasEBoot_util_rename (const char *from, const char *to); int -grub_util_unlink (const char *name); +VasEBoot_util_unlink (const char *name); void -grub_util_mkdir (const char *dir); +VasEBoot_util_mkdir (const char *dir); -grub_util_fd_dir_t -grub_util_fd_opendir (const char *name); +VasEBoot_util_fd_dir_t +VasEBoot_util_fd_opendir (const char *name); void -grub_util_fd_closedir (grub_util_fd_dir_t dirp); +VasEBoot_util_fd_closedir (VasEBoot_util_fd_dir_t dirp); -grub_util_fd_dirent_t -grub_util_fd_readdir (grub_util_fd_dir_t dirp); +VasEBoot_util_fd_dirent_t +VasEBoot_util_fd_readdir (VasEBoot_util_fd_dir_t dirp); int -grub_util_rmdir (const char *pathname); +VasEBoot_util_rmdir (const char *pathname); -enum grub_util_fd_open_flags_t +enum VasEBoot_util_fd_open_flags_t { - GRUB_UTIL_FD_O_RDONLY = 1, - GRUB_UTIL_FD_O_WRONLY = 2, - GRUB_UTIL_FD_O_RDWR = 3, - GRUB_UTIL_FD_O_CREATTRUNC = 4, - GRUB_UTIL_FD_O_SYNC = 0, + VasEBoot_UTIL_FD_O_RDONLY = 1, + VasEBoot_UTIL_FD_O_WRONLY = 2, + VasEBoot_UTIL_FD_O_RDWR = 3, + VasEBoot_UTIL_FD_O_CREATTRUNC = 4, + VasEBoot_UTIL_FD_O_SYNC = 0, }; #if defined (__MINGW32__) && !defined (__MINGW64__) @@ -78,8 +78,8 @@ enum grub_util_fd_open_flags_t #endif LPTSTR -grub_util_utf8_to_tchar (const char *in); +VasEBoot_util_utf8_to_tchar (const char *in); char * -grub_util_tchar_to_utf8 (LPCTSTR in); +VasEBoot_util_tchar_to_utf8 (LPCTSTR in); #endif diff --git a/include/VasEBoot/parser.h b/include/VasEBoot/parser.h index 64f9f5cc2..7c307529f 100644 --- a/include/VasEBoot/parser.h +++ b/include/VasEBoot/parser.h @@ -1,52 +1,52 @@ /* parser.h - prototypes for the command line parser. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PARSER_HEADER -#define GRUB_PARSER_HEADER 1 +#ifndef VasEBoot_PARSER_HEADER +#define VasEBoot_PARSER_HEADER 1 -#include -#include -#include +#include +#include +#include /* All the states for the command line. */ typedef enum { - GRUB_PARSER_STATE_TEXT = 1, - GRUB_PARSER_STATE_ESC, - GRUB_PARSER_STATE_QUOTE, - GRUB_PARSER_STATE_DQUOTE, - GRUB_PARSER_STATE_VAR, - GRUB_PARSER_STATE_VARNAME, - GRUB_PARSER_STATE_VARNAME2, - GRUB_PARSER_STATE_QVAR, - GRUB_PARSER_STATE_QVARNAME, - GRUB_PARSER_STATE_QVARNAME2 - } grub_parser_state_t; + VasEBoot_PARSER_STATE_TEXT = 1, + VasEBoot_PARSER_STATE_ESC, + VasEBoot_PARSER_STATE_QUOTE, + VasEBoot_PARSER_STATE_DQUOTE, + VasEBoot_PARSER_STATE_VAR, + VasEBoot_PARSER_STATE_VARNAME, + VasEBoot_PARSER_STATE_VARNAME2, + VasEBoot_PARSER_STATE_QVAR, + VasEBoot_PARSER_STATE_QVARNAME, + VasEBoot_PARSER_STATE_QVARNAME2 + } VasEBoot_parser_state_t; /* A single state transition. */ -struct grub_parser_state_transition +struct VasEBoot_parser_state_transition { /* The state that is looked up. */ - grub_parser_state_t from_state; + VasEBoot_parser_state_t from_state; /* The next state, determined by FROM_STATE and INPUT. */ - grub_parser_state_t to_state; + VasEBoot_parser_state_t to_state; /* The input that will determine the next state from FROM_STATE. */ char input; @@ -56,41 +56,41 @@ struct grub_parser_state_transition }; /* Determines the state following STATE, determined by C. */ -grub_parser_state_t -EXPORT_FUNC (grub_parser_cmdline_state) (grub_parser_state_t state, +VasEBoot_parser_state_t +EXPORT_FUNC (VasEBoot_parser_cmdline_state) (VasEBoot_parser_state_t state, char c, char *result); -grub_err_t -EXPORT_FUNC (grub_parser_split_cmdline) (const char *cmdline, - grub_reader_getline_t getline_func, +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_parser_split_cmdline) (const char *cmdline, + VasEBoot_reader_getline_t getline_func, void *getline_func_data, int *argc, char ***argv); -struct grub_parser +struct VasEBoot_parser { /* The next parser. */ - struct grub_parser *next; + struct VasEBoot_parser *next; /* The parser name. */ const char *name; /* Initialize the parser. */ - grub_err_t (*init) (void); + VasEBoot_err_t (*init) (void); /* Clean up the parser. */ - grub_err_t (*fini) (void); + VasEBoot_err_t (*fini) (void); - grub_err_t (*parse_line) (char *line, - grub_reader_getline_t getline_func, + VasEBoot_err_t (*parse_line) (char *line, + VasEBoot_reader_getline_t getline_func, void *getline_func_data); }; -typedef struct grub_parser *grub_parser_t; +typedef struct VasEBoot_parser *VasEBoot_parser_t; -grub_err_t grub_parser_execute (char *source); +VasEBoot_err_t VasEBoot_parser_execute (char *source); -grub_err_t -grub_rescue_parse_line (char *line, - grub_reader_getline_t getline_func, +VasEBoot_err_t +VasEBoot_rescue_parse_line (char *line, + VasEBoot_reader_getline_t getline_func, void *getline_func_data); -#endif /* ! GRUB_PARSER_HEADER */ +#endif /* ! VasEBoot_PARSER_HEADER */ diff --git a/include/VasEBoot/partition.h b/include/VasEBoot/partition.h index 7adb7ec6e..eee615cb2 100644 --- a/include/VasEBoot/partition.h +++ b/include/VasEBoot/partition.h @@ -1,127 +1,127 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2004,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PART_HEADER -#define GRUB_PART_HEADER 1 +#ifndef VasEBoot_PART_HEADER +#define VasEBoot_PART_HEADER 1 -#include -#include +#include +#include -struct grub_disk; +struct VasEBoot_disk; -typedef struct grub_partition *grub_partition_t; +typedef struct VasEBoot_partition *VasEBoot_partition_t; -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL typedef enum { - GRUB_EMBED_PCBIOS -} grub_embed_type_t; + VasEBoot_EMBED_PCBIOS +} VasEBoot_embed_type_t; #endif -typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk, - const grub_partition_t partition, +typedef int (*VasEBoot_partition_iterate_hook_t) (struct VasEBoot_disk *disk, + const VasEBoot_partition_t partition, void *data); /* Partition map type. */ -struct grub_partition_map +struct VasEBoot_partition_map { /* The next partition map type. */ - struct grub_partition_map *next; - struct grub_partition_map **prev; + struct VasEBoot_partition_map *next; + struct VasEBoot_partition_map **prev; /* The name of the partition map type. */ const char *name; /* Call HOOK with each partition, until HOOK returns non-zero. */ - grub_err_t (*iterate) (struct grub_disk *disk, - grub_partition_iterate_hook_t hook, void *hook_data); -#ifdef GRUB_UTIL + VasEBoot_err_t (*iterate) (struct VasEBoot_disk *disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data); +#ifdef VasEBoot_UTIL /* Determine sectors available for embedding. */ - grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors, + VasEBoot_err_t (*embed) (struct VasEBoot_disk *disk, unsigned int *nsectors, unsigned int max_nsectors, - grub_embed_type_t embed_type, - grub_disk_addr_t **sectors); + VasEBoot_embed_type_t embed_type, + VasEBoot_disk_addr_t **sectors); #endif }; -typedef struct grub_partition_map *grub_partition_map_t; +typedef struct VasEBoot_partition_map *VasEBoot_partition_map_t; /* Partition description. */ -struct grub_partition +struct VasEBoot_partition { /* The partition number. */ int number; /* The start sector (relative to parent). */ - grub_disk_addr_t start; + VasEBoot_disk_addr_t start; /* The length in sector units. */ - grub_uint64_t len; + VasEBoot_uint64_t len; /* The offset of the partition table. */ - grub_disk_addr_t offset; + VasEBoot_disk_addr_t offset; /* The index of this partition in the partition table. */ int index; /* Parent partition (physically contains this partition). */ - struct grub_partition *parent; + struct VasEBoot_partition *parent; /* The type partition map. */ - grub_partition_map_t partmap; + VasEBoot_partition_map_t partmap; /* The type of partition whne it's on MSDOS. Used for embedding detection. */ - grub_uint8_t msdostype; + VasEBoot_uint8_t msdostype; }; -grub_partition_t EXPORT_FUNC(grub_partition_probe) (struct grub_disk *disk, +VasEBoot_partition_t EXPORT_FUNC(VasEBoot_partition_probe) (struct VasEBoot_disk *disk, const char *str); -int EXPORT_FUNC(grub_partition_iterate) (struct grub_disk *disk, - grub_partition_iterate_hook_t hook, +int EXPORT_FUNC(VasEBoot_partition_iterate) (struct VasEBoot_disk *disk, + VasEBoot_partition_iterate_hook_t hook, void *hook_data); -char *EXPORT_FUNC(grub_partition_get_name) (const grub_partition_t partition); +char *EXPORT_FUNC(VasEBoot_partition_get_name) (const VasEBoot_partition_t partition); -extern grub_partition_map_t EXPORT_VAR(grub_partition_map_list); +extern VasEBoot_partition_map_t EXPORT_VAR(VasEBoot_partition_map_list); -#ifndef GRUB_LST_GENERATOR +#ifndef VasEBoot_LST_GENERATOR static inline void -grub_partition_map_register (grub_partition_map_t partmap) +VasEBoot_partition_map_register (VasEBoot_partition_map_t partmap) { - grub_list_push (GRUB_AS_LIST_P (&grub_partition_map_list), - GRUB_AS_LIST (partmap)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_partition_map_list), + VasEBoot_AS_LIST (partmap)); } #endif static inline void -grub_partition_map_unregister (grub_partition_map_t partmap) +VasEBoot_partition_map_unregister (VasEBoot_partition_map_t partmap) { - grub_list_remove (GRUB_AS_LIST (partmap)); + VasEBoot_list_remove (VasEBoot_AS_LIST (partmap)); } -#define FOR_PARTITION_MAPS(var) FOR_LIST_ELEMENTS((var), (grub_partition_map_list)) +#define FOR_PARTITION_MAPS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_partition_map_list)) -static inline grub_disk_addr_t -grub_partition_get_start (const grub_partition_t p) +static inline VasEBoot_disk_addr_t +VasEBoot_partition_get_start (const VasEBoot_partition_t p) { - grub_partition_t part; - grub_uint64_t part_start = 0; + VasEBoot_partition_t part; + VasEBoot_uint64_t part_start = 0; for (part = p; part; part = part->parent) part_start += part->start; @@ -129,10 +129,10 @@ grub_partition_get_start (const grub_partition_t p) return part_start; } -static inline grub_uint64_t -grub_partition_get_len (const grub_partition_t p) +static inline VasEBoot_uint64_t +VasEBoot_partition_get_len (const VasEBoot_partition_t p) { return p->len; } -#endif /* ! GRUB_PART_HEADER */ +#endif /* ! VasEBoot_PART_HEADER */ diff --git a/include/VasEBoot/parttool.h b/include/VasEBoot/parttool.h index 4e8f8d5e5..27dc4c1c8 100644 --- a/include/VasEBoot/parttool.h +++ b/include/VasEBoot/parttool.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PARTTOOL_HEADER -#define GRUB_PARTTOOL_HEADER 1 +#ifndef VasEBoot_PARTTOOL_HEADER +#define VasEBoot_PARTTOOL_HEADER 1 -struct grub_parttool_argdesc +struct VasEBoot_parttool_argdesc { const char *name; const char *desc; - enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL} + enum {VasEBoot_PARTTOOL_ARG_END, VasEBoot_PARTTOOL_ARG_BOOL, VasEBoot_PARTTOOL_ARG_VAL} type; }; -struct grub_parttool_args +struct VasEBoot_parttool_args { int set; union @@ -37,22 +37,22 @@ struct grub_parttool_args }; }; -typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev, - const struct grub_parttool_args *args); +typedef VasEBoot_err_t (*VasEBoot_parttool_function_t) (const VasEBoot_device_t dev, + const struct VasEBoot_parttool_args *args); -struct grub_parttool +struct VasEBoot_parttool { - struct grub_parttool *next; + struct VasEBoot_parttool *next; char *name; int handle; int nargs; - struct grub_parttool_argdesc *args; - grub_parttool_function_t func; + struct VasEBoot_parttool_argdesc *args; + VasEBoot_parttool_function_t func; }; -int grub_parttool_register(const char *part_name, - const grub_parttool_function_t func, - const struct grub_parttool_argdesc *args); -void grub_parttool_unregister (int handle); +int VasEBoot_parttool_register(const char *part_name, + const VasEBoot_parttool_function_t func, + const struct VasEBoot_parttool_argdesc *args); +void VasEBoot_parttool_unregister (int handle); -#endif /* ! GRUB_PARTTOOL_HEADER*/ +#endif /* ! VasEBoot_PARTTOOL_HEADER*/ diff --git a/include/VasEBoot/pci.h b/include/VasEBoot/pci.h index 70d9a0513..4b882e4e3 100644 --- a/include/VasEBoot/pci.h +++ b/include/VasEBoot/pci.h @@ -1,172 +1,172 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PCI_H -#define GRUB_PCI_H 1 +#ifndef VasEBoot_PCI_H +#define VasEBoot_PCI_H 1 #ifndef ASM_FILE -#include -#include +#include +#include #endif -#define GRUB_PCI_ADDR_SPACE_MASK 0x01 -#define GRUB_PCI_ADDR_SPACE_MEMORY 0x00 -#define GRUB_PCI_ADDR_SPACE_IO 0x01 +#define VasEBoot_PCI_ADDR_SPACE_MASK 0x01 +#define VasEBoot_PCI_ADDR_SPACE_MEMORY 0x00 +#define VasEBoot_PCI_ADDR_SPACE_IO 0x01 -#define GRUB_PCI_ADDR_MEM_TYPE_MASK 0x06 -#define GRUB_PCI_ADDR_MEM_TYPE_32 0x00 /* 32 bit address */ -#define GRUB_PCI_ADDR_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ -#define GRUB_PCI_ADDR_MEM_TYPE_64 0x04 /* 64 bit address */ -#define GRUB_PCI_ADDR_MEM_PREFETCH 0x08 /* prefetchable */ +#define VasEBoot_PCI_ADDR_MEM_TYPE_MASK 0x06 +#define VasEBoot_PCI_ADDR_MEM_TYPE_32 0x00 /* 32 bit address */ +#define VasEBoot_PCI_ADDR_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ +#define VasEBoot_PCI_ADDR_MEM_TYPE_64 0x04 /* 64 bit address */ +#define VasEBoot_PCI_ADDR_MEM_PREFETCH 0x08 /* prefetchable */ -#define GRUB_PCI_ADDR_MEM_MASK ~0xf -#define GRUB_PCI_ADDR_IO_MASK ~0x03 +#define VasEBoot_PCI_ADDR_MEM_MASK ~0xf +#define VasEBoot_PCI_ADDR_IO_MASK ~0x03 -#define GRUB_PCI_REG_PCI_ID 0x00 -#define GRUB_PCI_REG_VENDOR 0x00 -#define GRUB_PCI_REG_DEVICE 0x02 -#define GRUB_PCI_REG_COMMAND 0x04 -#define GRUB_PCI_REG_STATUS 0x06 -#define GRUB_PCI_REG_REVISION 0x08 -#define GRUB_PCI_REG_CLASS 0x08 -#define GRUB_PCI_REG_CACHELINE 0x0c -#define GRUB_PCI_REG_LAT_TIMER 0x0d -#define GRUB_PCI_REG_HEADER_TYPE 0x0e -#define GRUB_PCI_REG_BIST 0x0f -#define GRUB_PCI_REG_ADDRESSES 0x10 +#define VasEBoot_PCI_REG_PCI_ID 0x00 +#define VasEBoot_PCI_REG_VENDOR 0x00 +#define VasEBoot_PCI_REG_DEVICE 0x02 +#define VasEBoot_PCI_REG_COMMAND 0x04 +#define VasEBoot_PCI_REG_STATUS 0x06 +#define VasEBoot_PCI_REG_REVISION 0x08 +#define VasEBoot_PCI_REG_CLASS 0x08 +#define VasEBoot_PCI_REG_CACHELINE 0x0c +#define VasEBoot_PCI_REG_LAT_TIMER 0x0d +#define VasEBoot_PCI_REG_HEADER_TYPE 0x0e +#define VasEBoot_PCI_REG_BIST 0x0f +#define VasEBoot_PCI_REG_ADDRESSES 0x10 /* Beware that 64-bit address takes 2 registers. */ -#define GRUB_PCI_REG_ADDRESS_REG0 0x10 -#define GRUB_PCI_REG_ADDRESS_REG1 0x14 -#define GRUB_PCI_REG_ADDRESS_REG2 0x18 -#define GRUB_PCI_REG_ADDRESS_REG3 0x1c -#define GRUB_PCI_REG_ADDRESS_REG4 0x20 -#define GRUB_PCI_REG_ADDRESS_REG5 0x24 +#define VasEBoot_PCI_REG_ADDRESS_REG0 0x10 +#define VasEBoot_PCI_REG_ADDRESS_REG1 0x14 +#define VasEBoot_PCI_REG_ADDRESS_REG2 0x18 +#define VasEBoot_PCI_REG_ADDRESS_REG3 0x1c +#define VasEBoot_PCI_REG_ADDRESS_REG4 0x20 +#define VasEBoot_PCI_REG_ADDRESS_REG5 0x24 -#define GRUB_PCI_REG_CIS_POINTER 0x28 -#define GRUB_PCI_REG_SUBVENDOR 0x2c -#define GRUB_PCI_REG_SUBSYSTEM 0x2e -#define GRUB_PCI_REG_ROM_ADDRESS 0x30 -#define GRUB_PCI_REG_CAP_POINTER 0x34 -#define GRUB_PCI_REG_IRQ_LINE 0x3c -#define GRUB_PCI_REG_IRQ_PIN 0x3d -#define GRUB_PCI_REG_MIN_GNT 0x3e -#define GRUB_PCI_REG_MAX_LAT 0x3f +#define VasEBoot_PCI_REG_CIS_POINTER 0x28 +#define VasEBoot_PCI_REG_SUBVENDOR 0x2c +#define VasEBoot_PCI_REG_SUBSYSTEM 0x2e +#define VasEBoot_PCI_REG_ROM_ADDRESS 0x30 +#define VasEBoot_PCI_REG_CAP_POINTER 0x34 +#define VasEBoot_PCI_REG_IRQ_LINE 0x3c +#define VasEBoot_PCI_REG_IRQ_PIN 0x3d +#define VasEBoot_PCI_REG_MIN_GNT 0x3e +#define VasEBoot_PCI_REG_MAX_LAT 0x3f -#define GRUB_PCI_COMMAND_IO_ENABLED 0x0001 -#define GRUB_PCI_COMMAND_MEM_ENABLED 0x0002 -#define GRUB_PCI_COMMAND_BUS_MASTER 0x0004 -#define GRUB_PCI_COMMAND_PARITY_ERROR 0x0040 -#define GRUB_PCI_COMMAND_SERR_ENABLE 0x0100 +#define VasEBoot_PCI_COMMAND_IO_ENABLED 0x0001 +#define VasEBoot_PCI_COMMAND_MEM_ENABLED 0x0002 +#define VasEBoot_PCI_COMMAND_BUS_MASTER 0x0004 +#define VasEBoot_PCI_COMMAND_PARITY_ERROR 0x0040 +#define VasEBoot_PCI_COMMAND_SERR_ENABLE 0x0100 -#define GRUB_PCI_STATUS_CAPABILITIES 0x0010 -#define GRUB_PCI_STATUS_66MHZ_CAPABLE 0x0020 -#define GRUB_PCI_STATUS_FAST_B2B_CAPABLE 0x0080 +#define VasEBoot_PCI_STATUS_CAPABILITIES 0x0010 +#define VasEBoot_PCI_STATUS_66MHZ_CAPABLE 0x0020 +#define VasEBoot_PCI_STATUS_FAST_B2B_CAPABLE 0x0080 -#define GRUB_PCI_STATUS_DEVSEL_TIMING_SHIFT 9 -#define GRUB_PCI_STATUS_DEVSEL_TIMING_MASK 0x0600 -#define GRUB_PCI_CLASS_SUBCLASS_VGA 0x0300 -#define GRUB_PCI_CLASS_SUBCLASS_USB 0x0c03 +#define VasEBoot_PCI_STATUS_DEVSEL_TIMING_SHIFT 9 +#define VasEBoot_PCI_STATUS_DEVSEL_TIMING_MASK 0x0600 +#define VasEBoot_PCI_CLASS_SUBCLASS_VGA 0x0300 +#define VasEBoot_PCI_CLASS_SUBCLASS_USB 0x0c03 #ifndef ASM_FILE enum { - GRUB_PCI_CLASS_NETWORK = 0x02 + VasEBoot_PCI_CLASS_NETWORK = 0x02 }; enum { - GRUB_PCI_CAP_POWER_MANAGEMENT = 0x01 + VasEBoot_PCI_CAP_POWER_MANAGEMENT = 0x01 }; enum { - GRUB_PCI_VENDOR_BROADCOM = 0x14e4 + VasEBoot_PCI_VENDOR_BROADCOM = 0x14e4 }; -typedef grub_uint32_t grub_pci_id_t; +typedef VasEBoot_uint32_t VasEBoot_pci_id_t; -#ifdef GRUB_MACHINE_EMU -#include +#ifdef VasEBoot_MACHINE_EMU +#include #else -typedef grub_uint32_t grub_pci_address_t; -struct grub_pci_device +typedef VasEBoot_uint32_t VasEBoot_pci_address_t; +struct VasEBoot_pci_device { int bus; int device; int function; }; -typedef struct grub_pci_device grub_pci_device_t; +typedef struct VasEBoot_pci_device VasEBoot_pci_device_t; static inline int -grub_pci_get_bus (grub_pci_device_t dev) +VasEBoot_pci_get_bus (VasEBoot_pci_device_t dev) { return dev.bus; } static inline int -grub_pci_get_device (grub_pci_device_t dev) +VasEBoot_pci_get_device (VasEBoot_pci_device_t dev) { return dev.device; } static inline int -grub_pci_get_function (grub_pci_device_t dev) +VasEBoot_pci_get_function (VasEBoot_pci_device_t dev) { return dev.function; } -#include +#include #endif -typedef int (*grub_pci_iteratefunc_t) - (grub_pci_device_t dev, grub_pci_id_t pciid, void *data); +typedef int (*VasEBoot_pci_iteratefunc_t) + (VasEBoot_pci_device_t dev, VasEBoot_pci_id_t pciid, void *data); -grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (grub_pci_device_t dev, +VasEBoot_pci_address_t EXPORT_FUNC(VasEBoot_pci_make_address) (VasEBoot_pci_device_t dev, int reg); -void EXPORT_FUNC(grub_pci_iterate) (grub_pci_iteratefunc_t hook, +void EXPORT_FUNC(VasEBoot_pci_iterate) (VasEBoot_pci_iteratefunc_t hook, void *hook_data); -struct grub_pci_dma_chunk; +struct VasEBoot_pci_dma_chunk; -struct grub_pci_dma_chunk *EXPORT_FUNC(grub_memalign_dma32) (grub_size_t align, - grub_size_t size); -void EXPORT_FUNC(grub_dma_free) (struct grub_pci_dma_chunk *ch); -volatile void *EXPORT_FUNC(grub_dma_get_virt) (struct grub_pci_dma_chunk *ch); -grub_uint32_t EXPORT_FUNC(grub_dma_get_phys) (struct grub_pci_dma_chunk *ch); +struct VasEBoot_pci_dma_chunk *EXPORT_FUNC(VasEBoot_memalign_dma32) (VasEBoot_size_t align, + VasEBoot_size_t size); +void EXPORT_FUNC(VasEBoot_dma_free) (struct VasEBoot_pci_dma_chunk *ch); +volatile void *EXPORT_FUNC(VasEBoot_dma_get_virt) (struct VasEBoot_pci_dma_chunk *ch); +VasEBoot_uint32_t EXPORT_FUNC(VasEBoot_dma_get_phys) (struct VasEBoot_pci_dma_chunk *ch); static inline void * -grub_dma_phys2virt (grub_uint32_t phys, struct grub_pci_dma_chunk *chunk) +VasEBoot_dma_phys2virt (VasEBoot_uint32_t phys, struct VasEBoot_pci_dma_chunk *chunk) { - return ((grub_uint8_t *) grub_dma_get_virt (chunk) - + (phys - grub_dma_get_phys (chunk))); + return ((VasEBoot_uint8_t *) VasEBoot_dma_get_virt (chunk) + + (phys - VasEBoot_dma_get_phys (chunk))); } -static inline grub_uint32_t -grub_dma_virt2phys (volatile void *virt, struct grub_pci_dma_chunk *chunk) +static inline VasEBoot_uint32_t +VasEBoot_dma_virt2phys (volatile void *virt, struct VasEBoot_pci_dma_chunk *chunk) { - return (((grub_uint8_t *) virt - (grub_uint8_t *) grub_dma_get_virt (chunk)) - + grub_dma_get_phys (chunk)); + return (((VasEBoot_uint8_t *) virt - (VasEBoot_uint8_t *) VasEBoot_dma_get_virt (chunk)) + + VasEBoot_dma_get_phys (chunk)); } -grub_uint8_t -EXPORT_FUNC (grub_pci_find_capability) (grub_pci_device_t dev, grub_uint8_t cap); +VasEBoot_uint8_t +EXPORT_FUNC (VasEBoot_pci_find_capability) (VasEBoot_pci_device_t dev, VasEBoot_uint8_t cap); #endif -#endif /* GRUB_PCI_H */ +#endif /* VasEBoot_PCI_H */ diff --git a/include/VasEBoot/pciutils.h b/include/VasEBoot/pciutils.h index 36d47e5c8..1f918ce11 100644 --- a/include/VasEBoot/pciutils.h +++ b/include/VasEBoot/pciutils.h @@ -1,103 +1,103 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PCIUTILS_H -#define GRUB_PCIUTILS_H 1 +#ifndef VasEBoot_PCIUTILS_H +#define VasEBoot_PCIUTILS_H 1 #include -typedef struct pci_device *grub_pci_device_t; +typedef struct pci_device *VasEBoot_pci_device_t; static inline int -grub_pci_get_bus (grub_pci_device_t dev) +VasEBoot_pci_get_bus (VasEBoot_pci_device_t dev) { return dev->bus; } static inline int -grub_pci_get_device (grub_pci_device_t dev) +VasEBoot_pci_get_device (VasEBoot_pci_device_t dev) { return dev->dev; } static inline int -grub_pci_get_function (grub_pci_device_t dev) +VasEBoot_pci_get_function (VasEBoot_pci_device_t dev) { return dev->func; } -struct grub_pci_address +struct VasEBoot_pci_address { - grub_pci_device_t dev; + VasEBoot_pci_device_t dev; int pos; }; -typedef struct grub_pci_address grub_pci_address_t; +typedef struct VasEBoot_pci_address VasEBoot_pci_address_t; -static inline grub_uint32_t -grub_pci_read (grub_pci_address_t addr) +static inline VasEBoot_uint32_t +VasEBoot_pci_read (VasEBoot_pci_address_t addr) { - grub_uint32_t ret; + VasEBoot_uint32_t ret; pci_device_cfg_read_u32 (addr.dev, &ret, addr.pos); return ret; } -static inline grub_uint16_t -grub_pci_read_word (grub_pci_address_t addr) +static inline VasEBoot_uint16_t +VasEBoot_pci_read_word (VasEBoot_pci_address_t addr) { - grub_uint16_t ret; + VasEBoot_uint16_t ret; pci_device_cfg_read_u16 (addr.dev, &ret, addr.pos); return ret; } -static inline grub_uint8_t -grub_pci_read_byte (grub_pci_address_t addr) +static inline VasEBoot_uint8_t +VasEBoot_pci_read_byte (VasEBoot_pci_address_t addr) { - grub_uint8_t ret; + VasEBoot_uint8_t ret; pci_device_cfg_read_u8 (addr.dev, &ret, addr.pos); return ret; } static inline void -grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) +VasEBoot_pci_write (VasEBoot_pci_address_t addr, VasEBoot_uint32_t data) { pci_device_cfg_write_u32 (addr.dev, data, addr.pos); } static inline void -grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) +VasEBoot_pci_write_word (VasEBoot_pci_address_t addr, VasEBoot_uint16_t data) { pci_device_cfg_write_u16 (addr.dev, data, addr.pos); } static inline void -grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) +VasEBoot_pci_write_byte (VasEBoot_pci_address_t addr, VasEBoot_uint8_t data) { pci_device_cfg_write_u8 (addr.dev, data, addr.pos); } void * -grub_pci_device_map_range (grub_pci_device_t dev, grub_addr_t base, - grub_size_t size); +VasEBoot_pci_device_map_range (VasEBoot_pci_device_t dev, VasEBoot_addr_t base, + VasEBoot_size_t size); void -grub_pci_device_unmap_range (grub_pci_device_t dev, void *mem, - grub_size_t size); +VasEBoot_pci_device_unmap_range (VasEBoot_pci_device_t dev, void *mem, + VasEBoot_size_t size); -#endif /* GRUB_PCIUTILS_H */ +#endif /* VasEBoot_PCIUTILS_H */ diff --git a/include/VasEBoot/powerpc/ieee1275/ieee1275.h b/include/VasEBoot/powerpc/ieee1275/ieee1275.h index 3c7683fad..48d58e1bf 100644 --- a/include/VasEBoot/powerpc/ieee1275/ieee1275.h +++ b/include/VasEBoot/powerpc/ieee1275/ieee1275.h @@ -1,28 +1,28 @@ /* ieee1275.h - Access the Open Firmware client interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_IEEE1275_MACHINE_HEADER -#define GRUB_IEEE1275_MACHINE_HEADER 1 +#ifndef VasEBoot_IEEE1275_MACHINE_HEADER +#define VasEBoot_IEEE1275_MACHINE_HEADER 1 -#include +#include -#define GRUB_IEEE1275_CELL_SIZEOF 4 -typedef grub_uint32_t grub_ieee1275_cell_t; +#define VasEBoot_IEEE1275_CELL_SIZEOF 4 +typedef VasEBoot_uint32_t VasEBoot_ieee1275_cell_t; -#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */ +#endif /* ! VasEBoot_IEEE1275_MACHINE_HEADER */ diff --git a/include/VasEBoot/powerpc/kernel.h b/include/VasEBoot/powerpc/kernel.h index 3fc0b9e23..1b58cf91e 100644 --- a/include/VasEBoot/powerpc/kernel.h +++ b/include/VasEBoot/powerpc/kernel.h @@ -1,22 +1,22 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_CPU_HEADER -#define GRUB_KERNEL_CPU_HEADER 1 +#ifndef VasEBoot_KERNEL_CPU_HEADER +#define VasEBoot_KERNEL_CPU_HEADER 1 #endif diff --git a/include/VasEBoot/powerpc/memory.h b/include/VasEBoot/powerpc/memory.h index b748f33c5..7c66e73ca 100644 --- a/include/VasEBoot/powerpc/memory.h +++ b/include/VasEBoot/powerpc/memory.h @@ -1,47 +1,47 @@ /* memory.h - describe the memory map */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_MEMORY_CPU_HEADER -#define GRUB_MEMORY_CPU_HEADER 1 +#ifndef VasEBoot_MEMORY_CPU_HEADER +#define VasEBoot_MEMORY_CPU_HEADER 1 #ifndef ASM_FILE -typedef grub_addr_t grub_phys_addr_t; +typedef VasEBoot_addr_t VasEBoot_phys_addr_t; -static inline grub_phys_addr_t -grub_vtop (void *a) +static inline VasEBoot_phys_addr_t +VasEBoot_vtop (void *a) { - return (grub_phys_addr_t) a; + return (VasEBoot_phys_addr_t) a; } static inline void * -grub_map_memory (grub_phys_addr_t a, grub_size_t size __attribute__ ((unused))) +VasEBoot_map_memory (VasEBoot_phys_addr_t a, VasEBoot_size_t size __attribute__ ((unused))) { return (void *) a; } static inline void -grub_unmap_memory (void *a __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused))) +VasEBoot_unmap_memory (void *a __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused))) { } #endif -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/powerpc/relocator.h b/include/VasEBoot/powerpc/relocator.h index c2780bbca..d3cb9672b 100644 --- a/include/VasEBoot/powerpc/relocator.h +++ b/include/VasEBoot/powerpc/relocator.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RELOCATOR_CPU_HEADER -#define GRUB_RELOCATOR_CPU_HEADER 1 +#ifndef VasEBoot_RELOCATOR_CPU_HEADER +#define VasEBoot_RELOCATOR_CPU_HEADER 1 -#include -#include -#include +#include +#include +#include -#define GRUB_PPC_JUMP_REGISTER 31 +#define VasEBoot_PPC_JUMP_REGISTER 31 -struct grub_relocator32_state +struct VasEBoot_relocator32_state { - grub_uint32_t gpr[32]; + VasEBoot_uint32_t gpr[32]; }; -grub_err_t -grub_relocator32_boot (struct grub_relocator *rel, - struct grub_relocator32_state state); +VasEBoot_err_t +VasEBoot_relocator32_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator32_state state); -#endif /* ! GRUB_RELOCATOR_CPU_HEADER */ +#endif /* ! VasEBoot_RELOCATOR_CPU_HEADER */ diff --git a/include/VasEBoot/powerpc/setjmp.h b/include/VasEBoot/powerpc/setjmp.h index 7c2d184fa..5f4dca482 100644 --- a/include/VasEBoot/powerpc/setjmp.h +++ b/include/VasEBoot/powerpc/setjmp.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -typedef unsigned long grub_jmp_buf[21]; +typedef unsigned long VasEBoot_jmp_buf[21]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)); -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/powerpc/time.h b/include/VasEBoot/powerpc/time.h index 5db7ff4f1..fb67965d8 100644 --- a/include/VasEBoot/powerpc/time.h +++ b/include/VasEBoot/powerpc/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: not implemented */ } diff --git a/include/VasEBoot/powerpc/types.h b/include/VasEBoot/powerpc/types.h index a098ae65e..99c7cfc25 100644 --- a/include/VasEBoot/powerpc/types.h +++ b/include/VasEBoot/powerpc/types.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 4 +#define VasEBoot_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 4 +#define VasEBoot_TARGET_SIZEOF_LONG 4 /* powerpc is big-endian. */ -#define GRUB_TARGET_WORDS_BIGENDIAN 1 +#define VasEBoot_TARGET_WORDS_BIGENDIAN 1 -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/priority_queue.h b/include/VasEBoot/priority_queue.h index 64cbc4512..5817adb84 100644 --- a/include/VasEBoot/priority_queue.h +++ b/include/VasEBoot/priority_queue.h @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PRIORITY_QUEUE_HEADER -#define GRUB_PRIORITY_QUEUE_HEADER 1 +#ifndef VasEBoot_PRIORITY_QUEUE_HEADER +#define VasEBoot_PRIORITY_QUEUE_HEADER 1 -#include -#include +#include +#include #ifdef __cplusplus extern "C" { #endif -struct grub_priority_queue; -typedef struct grub_priority_queue *grub_priority_queue_t; -typedef int (*grub_comparator_t) (const void *a, const void *b); +struct VasEBoot_priority_queue; +typedef struct VasEBoot_priority_queue *VasEBoot_priority_queue_t; +typedef int (*VasEBoot_comparator_t) (const void *a, const void *b); -grub_priority_queue_t grub_priority_queue_new (grub_size_t elsize, - grub_comparator_t cmp); -void grub_priority_queue_destroy (grub_priority_queue_t pq); -void *grub_priority_queue_top (grub_priority_queue_t pq); -void grub_priority_queue_pop (grub_priority_queue_t pq); -grub_err_t grub_priority_queue_push (grub_priority_queue_t pq, const void *el); +VasEBoot_priority_queue_t VasEBoot_priority_queue_new (VasEBoot_size_t elsize, + VasEBoot_comparator_t cmp); +void VasEBoot_priority_queue_destroy (VasEBoot_priority_queue_t pq); +void *VasEBoot_priority_queue_top (VasEBoot_priority_queue_t pq); +void VasEBoot_priority_queue_pop (VasEBoot_priority_queue_t pq); +VasEBoot_err_t VasEBoot_priority_queue_push (VasEBoot_priority_queue_t pq, const void *el); #ifdef __cplusplus } diff --git a/include/VasEBoot/procfs.h b/include/VasEBoot/procfs.h index 8cc331d94..3e42a9503 100644 --- a/include/VasEBoot/procfs.h +++ b/include/VasEBoot/procfs.h @@ -1,50 +1,50 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PROCFS_HEADER -#define GRUB_PROCFS_HEADER 1 +#ifndef VasEBoot_PROCFS_HEADER +#define VasEBoot_PROCFS_HEADER 1 -#include -#include +#include +#include -struct grub_procfs_entry +struct VasEBoot_procfs_entry { - struct grub_procfs_entry *next; - struct grub_procfs_entry **prev; + struct VasEBoot_procfs_entry *next; + struct VasEBoot_procfs_entry **prev; const char *name; - char * (*get_contents) (grub_size_t *sz); + char * (*get_contents) (VasEBoot_size_t *sz); }; -extern struct grub_procfs_entry *grub_procfs_entries; +extern struct VasEBoot_procfs_entry *VasEBoot_procfs_entries; static inline void -grub_procfs_register (const char *name __attribute__ ((unused)), - struct grub_procfs_entry *entry) +VasEBoot_procfs_register (const char *name __attribute__ ((unused)), + struct VasEBoot_procfs_entry *entry) { - grub_list_push (GRUB_AS_LIST_P (&grub_procfs_entries), - GRUB_AS_LIST (entry)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_procfs_entries), + VasEBoot_AS_LIST (entry)); } static inline void -grub_procfs_unregister (struct grub_procfs_entry *entry) +VasEBoot_procfs_unregister (struct VasEBoot_procfs_entry *entry) { - grub_list_remove (GRUB_AS_LIST (entry)); + VasEBoot_list_remove (VasEBoot_AS_LIST (entry)); } diff --git a/include/VasEBoot/pubkey.h b/include/VasEBoot/pubkey.h index 4a9d04b43..4c5e1ae07 100644 --- a/include/VasEBoot/pubkey.h +++ b/include/VasEBoot/pubkey.h @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_PUBKEY_HEADER -#define GRUB_PUBKEY_HEADER 1 +#ifndef VasEBoot_PUBKEY_HEADER +#define VasEBoot_PUBKEY_HEADER 1 -#include +#include -struct grub_public_key * -grub_load_public_key (grub_file_t f); +struct VasEBoot_public_key * +VasEBoot_load_public_key (VasEBoot_file_t f); -grub_err_t -grub_verify_signature (grub_file_t f, grub_file_t sig, - struct grub_public_key *pk); +VasEBoot_err_t +VasEBoot_verify_signature (VasEBoot_file_t f, VasEBoot_file_t sig, + struct VasEBoot_public_key *pk); -struct grub_public_subkey * -grub_crypto_pk_locate_subkey (grub_uint64_t keyid, struct grub_public_key *pkey); +struct VasEBoot_public_subkey * +VasEBoot_crypto_pk_locate_subkey (VasEBoot_uint64_t keyid, struct VasEBoot_public_key *pkey); -struct grub_public_subkey * -grub_crypto_pk_locate_subkey_in_trustdb (grub_uint64_t keyid); +struct VasEBoot_public_subkey * +VasEBoot_crypto_pk_locate_subkey_in_trustdb (VasEBoot_uint64_t keyid); #endif diff --git a/include/VasEBoot/random.h b/include/VasEBoot/random.h index 4b75c0e2b..6dd314588 100644 --- a/include/VasEBoot/random.h +++ b/include/VasEBoot/random.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2016 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RANDOM_HEADER -#define GRUB_RANDOM_HEADER 1 +#ifndef VasEBoot_RANDOM_HEADER +#define VasEBoot_RANDOM_HEADER 1 -#include -#include +#include +#include /* Not peer-reviewed. May not be any better than string of zeros. */ -grub_err_t -grub_crypto_get_random (void *buffer, grub_size_t sz); +VasEBoot_err_t +VasEBoot_crypto_get_random (void *buffer, VasEBoot_size_t sz); -/* Do not use directly. Use grub_crypto_get_random instead. */ +/* Do not use directly. Use VasEBoot_crypto_get_random instead. */ int -grub_crypto_arch_get_random (void *buffer, grub_size_t sz); +VasEBoot_crypto_arch_get_random (void *buffer, VasEBoot_size_t sz); #endif diff --git a/include/VasEBoot/reader.h b/include/VasEBoot/reader.h index fd86b20cb..4ca0ed579 100644 --- a/include/VasEBoot/reader.h +++ b/include/VasEBoot/reader.h @@ -1,29 +1,29 @@ /* reader.h - prototypes for command line reader. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_READER_HEADER -#define GRUB_READER_HEADER 1 +#ifndef VasEBoot_READER_HEADER +#define VasEBoot_READER_HEADER 1 -#include +#include -typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *); +typedef VasEBoot_err_t (*VasEBoot_reader_getline_t) (char **, int, void *); -void grub_rescue_run (void) __attribute__ ((noreturn)); +void VasEBoot_rescue_run (void) __attribute__ ((noreturn)); -#endif /* ! GRUB_READER_HEADER */ +#endif /* ! VasEBoot_READER_HEADER */ diff --git a/include/VasEBoot/reed_solomon.h b/include/VasEBoot/reed_solomon.h index 596dff246..c5e19aa74 100644 --- a/include/VasEBoot/reed_solomon.h +++ b/include/VasEBoot/reed_solomon.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_REED_SOLOMON_HEADER -#define GRUB_REED_SOLOMON_HEADER 1 +#ifndef VasEBoot_REED_SOLOMON_HEADER +#define VasEBoot_REED_SOLOMON_HEADER 1 void -grub_reed_solomon_add_redundancy (void *buffer, grub_size_t data_size, - grub_size_t redundancy); +VasEBoot_reed_solomon_add_redundancy (void *buffer, VasEBoot_size_t data_size, + VasEBoot_size_t redundancy); void -grub_reed_solomon_recover (void *buffer, grub_size_t data_size, - grub_size_t redundancy); +VasEBoot_reed_solomon_recover (void *buffer, VasEBoot_size_t data_size, + VasEBoot_size_t redundancy); #endif diff --git a/include/VasEBoot/relocator.h b/include/VasEBoot/relocator.h index 24d8672d2..9108672cd 100644 --- a/include/VasEBoot/relocator.h +++ b/include/VasEBoot/relocator.h @@ -1,59 +1,59 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RELOCATOR_HEADER -#define GRUB_RELOCATOR_HEADER 1 +#ifndef VasEBoot_RELOCATOR_HEADER +#define VasEBoot_RELOCATOR_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_relocator; -struct grub_relocator_chunk; -typedef const struct grub_relocator_chunk *grub_relocator_chunk_t; +struct VasEBoot_relocator; +struct VasEBoot_relocator_chunk; +typedef const struct VasEBoot_relocator_chunk *VasEBoot_relocator_chunk_t; -struct grub_relocator *grub_relocator_new (void); +struct VasEBoot_relocator *VasEBoot_relocator_new (void); -grub_err_t -grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, - grub_relocator_chunk_t *out, - grub_phys_addr_t target, grub_size_t size); +VasEBoot_err_t +VasEBoot_relocator_alloc_chunk_addr (struct VasEBoot_relocator *rel, + VasEBoot_relocator_chunk_t *out, + VasEBoot_phys_addr_t target, VasEBoot_size_t size); void * -get_virtual_current_address (grub_relocator_chunk_t in); -grub_phys_addr_t -get_physical_target_address (grub_relocator_chunk_t in); +get_virtual_current_address (VasEBoot_relocator_chunk_t in); +VasEBoot_phys_addr_t +get_physical_target_address (VasEBoot_relocator_chunk_t in); -grub_err_t -grub_relocator_alloc_chunk_align (struct grub_relocator *rel, - grub_relocator_chunk_t *out, - grub_phys_addr_t min_addr, - grub_phys_addr_t max_addr, - grub_size_t size, grub_size_t align, +VasEBoot_err_t +VasEBoot_relocator_alloc_chunk_align (struct VasEBoot_relocator *rel, + VasEBoot_relocator_chunk_t *out, + VasEBoot_phys_addr_t min_addr, + VasEBoot_phys_addr_t max_addr, + VasEBoot_size_t size, VasEBoot_size_t align, int preference, int avoid_efi_boot_services); -#define GRUB_RELOCATOR_PREFERENCE_NONE 0 -#define GRUB_RELOCATOR_PREFERENCE_LOW 1 -#define GRUB_RELOCATOR_PREFERENCE_HIGH 2 +#define VasEBoot_RELOCATOR_PREFERENCE_NONE 0 +#define VasEBoot_RELOCATOR_PREFERENCE_LOW 1 +#define VasEBoot_RELOCATOR_PREFERENCE_HIGH 2 void -grub_relocator_unload (struct grub_relocator *rel); +VasEBoot_relocator_unload (struct VasEBoot_relocator *rel); #endif diff --git a/include/VasEBoot/relocator_private.h b/include/VasEBoot/relocator_private.h index 1c563cb64..e12edc3b0 100644 --- a/include/VasEBoot/relocator_private.h +++ b/include/VasEBoot/relocator_private.h @@ -1,113 +1,113 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RELOCATOR_PRIVATE_HEADER -#define GRUB_RELOCATOR_PRIVATE_HEADER 1 +#ifndef VasEBoot_RELOCATOR_PRIVATE_HEADER +#define VasEBoot_RELOCATOR_PRIVATE_HEADER 1 -#include -#include -#include +#include +#include +#include -extern grub_size_t grub_relocator_align; -extern grub_size_t grub_relocator_forward_size; -extern grub_size_t grub_relocator_backward_size; -extern grub_size_t grub_relocator_jumper_size; +extern VasEBoot_size_t VasEBoot_relocator_align; +extern VasEBoot_size_t VasEBoot_relocator_forward_size; +extern VasEBoot_size_t VasEBoot_relocator_backward_size; +extern VasEBoot_size_t VasEBoot_relocator_jumper_size; void -grub_cpu_relocator_init (void); -grub_err_t -grub_relocator_prepare_relocs (struct grub_relocator *rel, - grub_addr_t addr, - void **relstart, grub_size_t *relsize); -void grub_cpu_relocator_forward (void *rels, void *src, void *tgt, - grub_size_t size); -void grub_cpu_relocator_backward (void *rels, void *src, void *tgt, - grub_size_t size); -void grub_cpu_relocator_jumper (void *rels, grub_addr_t addr); +VasEBoot_cpu_relocator_init (void); +VasEBoot_err_t +VasEBoot_relocator_prepare_relocs (struct VasEBoot_relocator *rel, + VasEBoot_addr_t addr, + void **relstart, VasEBoot_size_t *relsize); +void VasEBoot_cpu_relocator_forward (void *rels, void *src, void *tgt, + VasEBoot_size_t size); +void VasEBoot_cpu_relocator_backward (void *rels, void *src, void *tgt, + VasEBoot_size_t size); +void VasEBoot_cpu_relocator_jumper (void *rels, VasEBoot_addr_t addr); -/* Remark: GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG = 1 or 2 +/* Remark: VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG = 1 or 2 aren't supported. */ -#ifdef GRUB_MACHINE_IEEE1275 -#define GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS 1 -#define GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG 0 -#elif defined (GRUB_MACHINE_EFI) -#define GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS 1 -#define GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG 12 +#ifdef VasEBoot_MACHINE_IEEE1275 +#define VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS 1 +#define VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG 0 +#elif defined (VasEBoot_MACHINE_EFI) +#define VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS 1 +#define VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG 12 #else -#define GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS 0 +#define VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS 0 #endif -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS && GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG != 0 -#define GRUB_RELOCATOR_HAVE_LEFTOVERS 1 +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS && VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG != 0 +#define VasEBoot_RELOCATOR_HAVE_LEFTOVERS 1 #else -#define GRUB_RELOCATOR_HAVE_LEFTOVERS 0 +#define VasEBoot_RELOCATOR_HAVE_LEFTOVERS 0 #endif -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS -#define GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT (1 << GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG) +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#define VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT (1 << VasEBoot_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG) #endif -struct grub_relocator_mmap_event +struct VasEBoot_relocator_mmap_event { enum { IN_REG_START = 0, IN_REG_END = 1, REG_BEG_START = 2, REG_BEG_END = REG_BEG_START | 1, -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS REG_FIRMWARE_START = 4, REG_FIRMWARE_END = REG_FIRMWARE_START | 1, /* To track the regions already in heap. */ FIRMWARE_BLOCK_START = 6, FIRMWARE_BLOCK_END = FIRMWARE_BLOCK_START | 1, #endif -#if GRUB_RELOCATOR_HAVE_LEFTOVERS +#if VasEBoot_RELOCATOR_HAVE_LEFTOVERS REG_LEFTOVER_START = 8, REG_LEFTOVER_END = REG_LEFTOVER_START | 1, #endif COLLISION_START = 10, COLLISION_END = COLLISION_START | 1 } type; - grub_phys_addr_t pos; + VasEBoot_phys_addr_t pos; union { struct { - grub_mm_region_t reg; - grub_mm_header_t hancestor; - grub_mm_region_t *regancestor; - grub_mm_header_t head; + VasEBoot_mm_region_t reg; + VasEBoot_mm_header_t hancestor; + VasEBoot_mm_region_t *regancestor; + VasEBoot_mm_header_t head; }; -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS - struct grub_relocator_fw_leftover *leftover; +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS + struct VasEBoot_relocator_fw_leftover *leftover; #endif }; }; /* Return 0 on failure, 1 on success. The failure here can be very time-expensive, so please make sure fill events is accurate. */ -#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS -int grub_relocator_firmware_alloc_region (grub_phys_addr_t start, - grub_size_t size); -unsigned grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events); -unsigned grub_relocator_firmware_get_max_events (void); -void grub_relocator_firmware_free_region (grub_phys_addr_t start, - grub_size_t size); +#if VasEBoot_RELOCATOR_HAVE_FIRMWARE_REQUESTS +int VasEBoot_relocator_firmware_alloc_region (VasEBoot_phys_addr_t start, + VasEBoot_size_t size); +unsigned VasEBoot_relocator_firmware_fill_events (struct VasEBoot_relocator_mmap_event *events); +unsigned VasEBoot_relocator_firmware_get_max_events (void); +void VasEBoot_relocator_firmware_free_region (VasEBoot_phys_addr_t start, + VasEBoot_size_t size); #endif #endif diff --git a/include/VasEBoot/script_sh.h b/include/VasEBoot/script_sh.h index 360c2be1f..61c548d19 100644 --- a/include/VasEBoot/script_sh.h +++ b/include/VasEBoot/script_sh.h @@ -1,165 +1,165 @@ /* normal_parser.h */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_NORMAL_PARSER_HEADER -#define GRUB_NORMAL_PARSER_HEADER 1 +#ifndef VasEBoot_NORMAL_PARSER_HEADER +#define VasEBoot_NORMAL_PARSER_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_script_mem; +struct VasEBoot_script_mem; /* The generic header for each scripting command or structure. */ -struct grub_script_cmd +struct VasEBoot_script_cmd { /* This function is called to execute the command. */ - grub_err_t (*exec) (struct grub_script_cmd *cmd); + VasEBoot_err_t (*exec) (struct VasEBoot_script_cmd *cmd); /* The next command. This can be used by the parent to form a chain of commands. */ - struct grub_script_cmd *next; + struct VasEBoot_script_cmd *next; }; -struct grub_script +struct VasEBoot_script { unsigned refcnt; - struct grub_script_mem *mem; - struct grub_script_cmd *cmd; + struct VasEBoot_script_mem *mem; + struct VasEBoot_script_cmd *cmd; - /* grub_scripts from block arguments. */ - struct grub_script *next_siblings; - struct grub_script *children; + /* VasEBoot_scripts from block arguments. */ + struct VasEBoot_script *next_siblings; + struct VasEBoot_script *children; }; typedef enum { - GRUB_SCRIPT_ARG_TYPE_VAR, - GRUB_SCRIPT_ARG_TYPE_TEXT, - GRUB_SCRIPT_ARG_TYPE_GETTEXT, - GRUB_SCRIPT_ARG_TYPE_DQVAR, - GRUB_SCRIPT_ARG_TYPE_DQSTR, - GRUB_SCRIPT_ARG_TYPE_SQSTR, - GRUB_SCRIPT_ARG_TYPE_BLOCK -} grub_script_arg_type_t; + VasEBoot_SCRIPT_ARG_TYPE_VAR, + VasEBoot_SCRIPT_ARG_TYPE_TEXT, + VasEBoot_SCRIPT_ARG_TYPE_GETTEXT, + VasEBoot_SCRIPT_ARG_TYPE_DQVAR, + VasEBoot_SCRIPT_ARG_TYPE_DQSTR, + VasEBoot_SCRIPT_ARG_TYPE_SQSTR, + VasEBoot_SCRIPT_ARG_TYPE_BLOCK +} VasEBoot_script_arg_type_t; /* A part of an argument. */ -struct grub_script_arg +struct VasEBoot_script_arg { - grub_script_arg_type_t type; + VasEBoot_script_arg_type_t type; char *str; /* Parsed block argument. */ - struct grub_script *script; + struct VasEBoot_script *script; /* Next argument part. */ - struct grub_script_arg *next; + struct VasEBoot_script_arg *next; }; /* An argument vector. */ -struct grub_script_argv +struct VasEBoot_script_argv { unsigned argc; char **args; - struct grub_script *script; + struct VasEBoot_script *script; }; /* Pluggable wildcard translator. */ -struct grub_script_wildcard_translator +struct VasEBoot_script_wildcard_translator { - grub_err_t (*expand) (const char *str, char ***expansions); + VasEBoot_err_t (*expand) (const char *str, char ***expansions); }; -extern struct grub_script_wildcard_translator *grub_wildcard_translator; -extern struct grub_script_wildcard_translator grub_filename_translator; +extern struct VasEBoot_script_wildcard_translator *VasEBoot_wildcard_translator; +extern struct VasEBoot_script_wildcard_translator VasEBoot_filename_translator; /* A complete argument. It consists of a list of one or more `struct - grub_script_arg's. */ -struct grub_script_arglist + VasEBoot_script_arg's. */ +struct VasEBoot_script_arglist { - struct grub_script_arglist *next; - struct grub_script_arg *arg; + struct VasEBoot_script_arglist *next; + struct VasEBoot_script_arg *arg; /* Only stored in the first link. */ int argcount; }; /* A single command line. */ -struct grub_script_cmdline +struct VasEBoot_script_cmdline { - struct grub_script_cmd cmd; + struct VasEBoot_script_cmd cmd; /* The arguments for this command. */ - struct grub_script_arglist *arglist; + struct VasEBoot_script_arglist *arglist; }; /* An if statement. */ -struct grub_script_cmdif +struct VasEBoot_script_cmdif { - struct grub_script_cmd cmd; + struct VasEBoot_script_cmd cmd; /* The command used to check if the 'if' is true or false. */ - struct grub_script_cmd *exec_to_evaluate; + struct VasEBoot_script_cmd *exec_to_evaluate; /* The code executed in case the result of 'if' was true. */ - struct grub_script_cmd *exec_on_true; + struct VasEBoot_script_cmd *exec_on_true; /* The code executed in case the result of 'if' was false. */ - struct grub_script_cmd *exec_on_false; + struct VasEBoot_script_cmd *exec_on_false; }; /* A for statement. */ -struct grub_script_cmdfor +struct VasEBoot_script_cmdfor { - struct grub_script_cmd cmd; + struct VasEBoot_script_cmd cmd; /* The name used as looping variable. */ - struct grub_script_arg *name; + struct VasEBoot_script_arg *name; /* The words loop iterates over. */ - struct grub_script_arglist *words; + struct VasEBoot_script_arglist *words; /* The command list executed in each loop. */ - struct grub_script_cmd *list; + struct VasEBoot_script_cmd *list; }; /* A while/until command. */ -struct grub_script_cmdwhile +struct VasEBoot_script_cmdwhile { - struct grub_script_cmd cmd; + struct VasEBoot_script_cmd cmd; /* The command list used as condition. */ - struct grub_script_cmd *cond; + struct VasEBoot_script_cmd *cond; /* The command list executed in each loop. */ - struct grub_script_cmd *list; + struct VasEBoot_script_cmd *list; /* The flag to indicate this as "until" loop. */ int until; }; /* State of the lexer as passed to the lexer. */ -struct grub_lexer_param +struct VasEBoot_lexer_param { /* Function used by the lexer to get a new line when more input is expected, but not available. */ - grub_reader_getline_t getline; + VasEBoot_reader_getline_t getline; /* Caller-supplied data passed to `getline'. */ void *getline_data; @@ -199,7 +199,7 @@ struct grub_lexer_param unsigned size; /* Type of text. */ - grub_script_arg_type_t type; + VasEBoot_script_arg_type_t type; /* Flag to indicate resplit in progres. */ unsigned resplit; @@ -214,184 +214,184 @@ struct grub_lexer_param void *buffer; }; -#define GRUB_LEXER_INITIAL_TEXT_SIZE 32 -#define GRUB_LEXER_INITIAL_RECORD_SIZE 256 +#define VasEBoot_LEXER_INITIAL_TEXT_SIZE 32 +#define VasEBoot_LEXER_INITIAL_RECORD_SIZE 256 /* State of the parser as passes to the parser. */ -struct grub_parser_param +struct VasEBoot_parser_param { /* Keep track of the memory allocated for this specific function. */ - struct grub_script_mem *func_mem; + struct VasEBoot_script_mem *func_mem; /* When set to 0, no errors have occurred during parsing. */ int err; /* The memory that was used while parsing and scanning. */ - struct grub_script_mem *memused; + struct VasEBoot_script_mem *memused; /* The block argument scripts. */ - struct grub_script *scripts; + struct VasEBoot_script *scripts; /* The result of the parser. */ - struct grub_script_cmd *parsed; + struct VasEBoot_script_cmd *parsed; - struct grub_lexer_param *lexerstate; + struct VasEBoot_lexer_param *lexerstate; }; -void grub_script_init (void); -void grub_script_fini (void); +void VasEBoot_script_init (void); +void VasEBoot_script_fini (void); -void grub_script_mem_free (struct grub_script_mem *mem); +void VasEBoot_script_mem_free (struct VasEBoot_script_mem *mem); -void grub_script_argv_free (struct grub_script_argv *argv); -int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args); -int grub_script_argv_next (struct grub_script_argv *argv); -int grub_script_argv_append (struct grub_script_argv *argv, const char *s, - grub_size_t slen); -int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s); +void VasEBoot_script_argv_free (struct VasEBoot_script_argv *argv); +int VasEBoot_script_argv_make (struct VasEBoot_script_argv *argv, int argc, char **args); +int VasEBoot_script_argv_next (struct VasEBoot_script_argv *argv); +int VasEBoot_script_argv_append (struct VasEBoot_script_argv *argv, const char *s, + VasEBoot_size_t slen); +int VasEBoot_script_argv_split_append (struct VasEBoot_script_argv *argv, const char *s); -struct grub_script_arglist * -grub_script_create_arglist (struct grub_parser_param *state); +struct VasEBoot_script_arglist * +VasEBoot_script_create_arglist (struct VasEBoot_parser_param *state); -struct grub_script_arglist * -grub_script_add_arglist (struct grub_parser_param *state, - struct grub_script_arglist *list, - struct grub_script_arg *arg); -struct grub_script_cmd * -grub_script_create_cmdline (struct grub_parser_param *state, - struct grub_script_arglist *arglist); +struct VasEBoot_script_arglist * +VasEBoot_script_add_arglist (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arglist *list, + struct VasEBoot_script_arg *arg); +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdline (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arglist *arglist); -struct grub_script_cmd * -grub_script_create_cmdif (struct grub_parser_param *state, - struct grub_script_cmd *exec_to_evaluate, - struct grub_script_cmd *exec_on_true, - struct grub_script_cmd *exec_on_false); +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdif (struct VasEBoot_parser_param *state, + struct VasEBoot_script_cmd *exec_to_evaluate, + struct VasEBoot_script_cmd *exec_on_true, + struct VasEBoot_script_cmd *exec_on_false); -struct grub_script_cmd * -grub_script_create_cmdfor (struct grub_parser_param *state, - struct grub_script_arg *name, - struct grub_script_arglist *words, - struct grub_script_cmd *list); +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdfor (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arg *name, + struct VasEBoot_script_arglist *words, + struct VasEBoot_script_cmd *list); -struct grub_script_cmd * -grub_script_create_cmdwhile (struct grub_parser_param *state, - struct grub_script_cmd *cond, - struct grub_script_cmd *list, +struct VasEBoot_script_cmd * +VasEBoot_script_create_cmdwhile (struct VasEBoot_parser_param *state, + struct VasEBoot_script_cmd *cond, + struct VasEBoot_script_cmd *list, int is_an_until_loop); -struct grub_script_cmd * -grub_script_append_cmd (struct grub_parser_param *state, - struct grub_script_cmd *list, - struct grub_script_cmd *last); -struct grub_script_arg * -grub_script_arg_add (struct grub_parser_param *state, - struct grub_script_arg *arg, - grub_script_arg_type_t type, char *str); +struct VasEBoot_script_cmd * +VasEBoot_script_append_cmd (struct VasEBoot_parser_param *state, + struct VasEBoot_script_cmd *list, + struct VasEBoot_script_cmd *last); +struct VasEBoot_script_arg * +VasEBoot_script_arg_add (struct VasEBoot_parser_param *state, + struct VasEBoot_script_arg *arg, + VasEBoot_script_arg_type_t type, char *str); -struct grub_script *grub_script_parse (char *script, - grub_reader_getline_t getline_func, +struct VasEBoot_script *VasEBoot_script_parse (char *script, + VasEBoot_reader_getline_t getline_func, void *getline_func_data); -void grub_script_free (struct grub_script *script); -struct grub_script *grub_script_create (struct grub_script_cmd *cmd, - struct grub_script_mem *mem); +void VasEBoot_script_free (struct VasEBoot_script *script); +struct VasEBoot_script *VasEBoot_script_create (struct VasEBoot_script_cmd *cmd, + struct VasEBoot_script_mem *mem); -struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser, +struct VasEBoot_lexer_param *VasEBoot_script_lexer_init (struct VasEBoot_parser_param *parser, char *script, - grub_reader_getline_t getline_func, + VasEBoot_reader_getline_t getline_func, void *getline_func_data); -void grub_script_lexer_fini (struct grub_lexer_param *); -void grub_script_lexer_ref (struct grub_lexer_param *); -void grub_script_lexer_deref (struct grub_lexer_param *); -unsigned grub_script_lexer_record_start (struct grub_parser_param *); -char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned); -int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input); -void grub_script_lexer_record (struct grub_parser_param *, char *); +void VasEBoot_script_lexer_fini (struct VasEBoot_lexer_param *); +void VasEBoot_script_lexer_ref (struct VasEBoot_lexer_param *); +void VasEBoot_script_lexer_deref (struct VasEBoot_lexer_param *); +unsigned VasEBoot_script_lexer_record_start (struct VasEBoot_parser_param *); +char *VasEBoot_script_lexer_record_stop (struct VasEBoot_parser_param *, unsigned); +int VasEBoot_script_lexer_yywrap (struct VasEBoot_parser_param *, const char *input); +void VasEBoot_script_lexer_record (struct VasEBoot_parser_param *, char *); /* Functions to track allocated memory. */ -struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state); -struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state, - struct grub_script_mem *restore); -void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size); +struct VasEBoot_script_mem *VasEBoot_script_mem_record (struct VasEBoot_parser_param *state); +struct VasEBoot_script_mem *VasEBoot_script_mem_record_stop (struct VasEBoot_parser_param *state, + struct VasEBoot_script_mem *restore); +void *VasEBoot_script_malloc (struct VasEBoot_parser_param *state, VasEBoot_size_t size); /* Functions used by bison. */ union YYSTYPE; -int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *); -int grub_script_yyparse (struct grub_parser_param *); -void grub_script_yyerror (struct grub_parser_param *, char const *); +int VasEBoot_script_yylex (union YYSTYPE *, struct VasEBoot_parser_param *); +int VasEBoot_script_yyparse (struct VasEBoot_parser_param *); +void VasEBoot_script_yyerror (struct VasEBoot_parser_param *, char const *); /* Commands to execute, don't use these directly. */ -grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd); -grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd); -grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd); -grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd); -grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd); +VasEBoot_err_t VasEBoot_script_execute_cmdline (struct VasEBoot_script_cmd *cmd); +VasEBoot_err_t VasEBoot_script_execute_cmdlist (struct VasEBoot_script_cmd *cmd); +VasEBoot_err_t VasEBoot_script_execute_cmdif (struct VasEBoot_script_cmd *cmd); +VasEBoot_err_t VasEBoot_script_execute_cmdfor (struct VasEBoot_script_cmd *cmd); +VasEBoot_err_t VasEBoot_script_execute_cmdwhile (struct VasEBoot_script_cmd *cmd); -/* Execute any GRUB pre-parsed command or script. */ -grub_err_t grub_script_execute (struct grub_script *script); -grub_err_t grub_script_execute_sourcecode (const char *source); -grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args); +/* Execute any VasEBoot pre-parsed command or script. */ +VasEBoot_err_t VasEBoot_script_execute (struct VasEBoot_script *script); +VasEBoot_err_t VasEBoot_script_execute_sourcecode (const char *source); +VasEBoot_err_t VasEBoot_script_execute_new_scope (const char *source, int argc, char **args); /* Break command for loops. */ -grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]); +VasEBoot_err_t VasEBoot_script_break (VasEBoot_command_t cmd, int argc, char *argv[]); -/* SHIFT command for GRUB script. */ -grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]); +/* SHIFT command for VasEBoot script. */ +VasEBoot_err_t VasEBoot_script_shift (VasEBoot_command_t cmd, int argc, char *argv[]); -/* SETPARAMS command for GRUB script functions. */ -grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]); +/* SETPARAMS command for VasEBoot script functions. */ +VasEBoot_err_t VasEBoot_script_setparams (VasEBoot_command_t cmd, int argc, char *argv[]); /* RETURN command for functions. */ -grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]); +VasEBoot_err_t VasEBoot_script_return (VasEBoot_command_t cmd, int argc, char *argv[]); /* This variable points to the parsed command. This is used to communicate with the bison code. */ -extern struct grub_script_cmd *grub_script_parsed; +extern struct VasEBoot_script_cmd *VasEBoot_script_parsed; /* The function description. */ -struct grub_script_function +struct VasEBoot_script_function { /* The name. */ char *name; /* The script function. */ - struct grub_script *func; + struct VasEBoot_script *func; /* The flags. */ unsigned flags; /* The next element. */ - struct grub_script_function *next; + struct VasEBoot_script_function *next; int references; }; -typedef struct grub_script_function *grub_script_function_t; +typedef struct VasEBoot_script_function *VasEBoot_script_function_t; -extern grub_script_function_t grub_script_function_list; +extern VasEBoot_script_function_t VasEBoot_script_function_list; -#define FOR_SCRIPT_FUNCTIONS(var) for((var) = grub_script_function_list; \ +#define FOR_SCRIPT_FUNCTIONS(var) for((var) = VasEBoot_script_function_list; \ (var); (var) = (var)->next) -grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname, - struct grub_script *cmd); -void grub_script_function_remove (const char *name); -grub_script_function_t grub_script_function_find (char *functionname); +VasEBoot_script_function_t VasEBoot_script_function_create (struct VasEBoot_script_arg *functionname, + struct VasEBoot_script *cmd); +void VasEBoot_script_function_remove (const char *name); +VasEBoot_script_function_t VasEBoot_script_function_find (char *functionname); -grub_err_t grub_script_function_call (grub_script_function_t func, +VasEBoot_err_t VasEBoot_script_function_call (VasEBoot_script_function_t func, int argc, char **args); char ** -grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count); +VasEBoot_script_execute_arglist_to_argv (struct VasEBoot_script_arglist *arglist, int *count); -grub_err_t -grub_normal_parse_line (char *line, - grub_reader_getline_t getline_func, +VasEBoot_err_t +VasEBoot_normal_parse_line (char *line, + VasEBoot_reader_getline_t getline_func, void *getline_func_data); -static inline struct grub_script * -grub_script_ref (struct grub_script *script) +static inline struct VasEBoot_script * +VasEBoot_script_ref (struct VasEBoot_script *script) { if (script) script->refcnt++; @@ -399,15 +399,15 @@ grub_script_ref (struct grub_script *script) } static inline void -grub_script_unref (struct grub_script *script) +VasEBoot_script_unref (struct VasEBoot_script *script) { if (! script) return; if (script->refcnt == 0) - grub_script_free (script); + VasEBoot_script_free (script); else script->refcnt--; } -#endif /* ! GRUB_NORMAL_PARSER_HEADER */ +#endif /* ! VasEBoot_NORMAL_PARSER_HEADER */ diff --git a/include/VasEBoot/scsi.h b/include/VasEBoot/scsi.h index a919a7c64..492db2e24 100644 --- a/include/VasEBoot/scsi.h +++ b/include/VasEBoot/scsi.h @@ -1,111 +1,111 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SCSI_H -#define GRUB_SCSI_H 1 +#ifndef VasEBoot_SCSI_H +#define VasEBoot_SCSI_H 1 -#include +#include -typedef struct grub_scsi_dev *grub_scsi_dev_t; +typedef struct VasEBoot_scsi_dev *VasEBoot_scsi_dev_t; -void grub_scsi_dev_register (grub_scsi_dev_t dev); -void grub_scsi_dev_unregister (grub_scsi_dev_t dev); +void VasEBoot_scsi_dev_register (VasEBoot_scsi_dev_t dev); +void VasEBoot_scsi_dev_unregister (VasEBoot_scsi_dev_t dev); -struct grub_scsi; +struct VasEBoot_scsi; enum { - GRUB_SCSI_SUBSYSTEM_USBMS, - GRUB_SCSI_SUBSYSTEM_PATA, - GRUB_SCSI_SUBSYSTEM_AHCI, - GRUB_SCSI_NUM_SUBSYSTEMS + VasEBoot_SCSI_SUBSYSTEM_USBMS, + VasEBoot_SCSI_SUBSYSTEM_PATA, + VasEBoot_SCSI_SUBSYSTEM_AHCI, + VasEBoot_SCSI_NUM_SUBSYSTEMS }; -extern const char grub_scsi_names[GRUB_SCSI_NUM_SUBSYSTEMS][5]; +extern const char VasEBoot_scsi_names[VasEBoot_SCSI_NUM_SUBSYSTEMS][5]; -#define GRUB_SCSI_ID_SUBSYSTEM_SHIFT 24 -#define GRUB_SCSI_ID_BUS_SHIFT 8 -#define GRUB_SCSI_ID_LUN_SHIFT 0 +#define VasEBoot_SCSI_ID_SUBSYSTEM_SHIFT 24 +#define VasEBoot_SCSI_ID_BUS_SHIFT 8 +#define VasEBoot_SCSI_ID_LUN_SHIFT 0 -static inline grub_uint32_t -grub_make_scsi_id (int subsystem, int bus, int lun) +static inline VasEBoot_uint32_t +VasEBoot_make_scsi_id (int subsystem, int bus, int lun) { - return (subsystem << GRUB_SCSI_ID_SUBSYSTEM_SHIFT) - | (bus << GRUB_SCSI_ID_BUS_SHIFT) | (lun << GRUB_SCSI_ID_LUN_SHIFT); + return (subsystem << VasEBoot_SCSI_ID_SUBSYSTEM_SHIFT) + | (bus << VasEBoot_SCSI_ID_BUS_SHIFT) | (lun << VasEBoot_SCSI_ID_LUN_SHIFT); } -typedef int (*grub_scsi_dev_iterate_hook_t) (int id, int bus, int luns, +typedef int (*VasEBoot_scsi_dev_iterate_hook_t) (int id, int bus, int luns, void *data); -struct grub_scsi_dev +struct VasEBoot_scsi_dev { /* Call HOOK with each device name, until HOOK returns non-zero. */ - int (*iterate) (grub_scsi_dev_iterate_hook_t hook, void *hook_data, - grub_disk_pull_t pull); + int (*iterate) (VasEBoot_scsi_dev_iterate_hook_t hook, void *hook_data, + VasEBoot_disk_pull_t pull); /* Open the device named NAME, and set up SCSI. */ - grub_err_t (*open) (int id, int bus, struct grub_scsi *scsi); + VasEBoot_err_t (*open) (int id, int bus, struct VasEBoot_scsi *scsi); /* Close the scsi device SCSI. */ - void (*close) (struct grub_scsi *scsi); + void (*close) (struct VasEBoot_scsi *scsi); /* Read SIZE bytes from the device SCSI into BUF after sending the command CMD of size CMDSIZE. */ - grub_err_t (*read) (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf); + VasEBoot_err_t (*read) (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, char *buf); /* Write SIZE bytes from BUF to the device SCSI after sending the command CMD of size CMDSIZE. */ - grub_err_t (*write) (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, const char *buf); + VasEBoot_err_t (*write) (struct VasEBoot_scsi *scsi, VasEBoot_size_t cmdsize, char *cmd, + VasEBoot_size_t size, const char *buf); /* The next scsi device. */ - struct grub_scsi_dev *next; + struct VasEBoot_scsi_dev *next; }; -struct grub_scsi +struct VasEBoot_scsi { /* The underlying scsi device. */ - grub_scsi_dev_t dev; + VasEBoot_scsi_dev_t dev; /* Type of SCSI device. XXX: Make enum. */ - grub_uint8_t devtype; + VasEBoot_uint8_t devtype; int bus; /* Number of LUNs. */ int luns; - /* LUN for this `struct grub_scsi'. */ + /* LUN for this `struct VasEBoot_scsi'. */ int lun; /* Set to 0 when not removable, 1 when removable. */ int removable; /* Size of the device in blocks - 1. */ - grub_uint64_t last_block; + VasEBoot_uint64_t last_block; /* Size of one block. */ - grub_uint32_t blocksize; + VasEBoot_uint32_t blocksize; /* Device-specific data. */ void *data; }; -typedef struct grub_scsi *grub_scsi_t; +typedef struct VasEBoot_scsi *VasEBoot_scsi_t; -#endif /* GRUB_SCSI_H */ +#endif /* VasEBoot_SCSI_H */ diff --git a/include/VasEBoot/scsicmd.h b/include/VasEBoot/scsicmd.h index 3f1e6d28c..0c3a465c6 100644 --- a/include/VasEBoot/scsicmd.h +++ b/include/VasEBoot/scsicmd.h @@ -1,206 +1,206 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SCSICMD_H -#define GRUB_SCSICMD_H 1 +#ifndef VasEBoot_SCSICMD_H +#define VasEBoot_SCSICMD_H 1 -#include +#include -#define GRUB_SCSI_DEVTYPE_MASK 31 -#define GRUB_SCSI_REMOVABLE_BIT 7 -#define GRUB_SCSI_LUN_SHIFT 5 +#define VasEBoot_SCSI_DEVTYPE_MASK 31 +#define VasEBoot_SCSI_REMOVABLE_BIT 7 +#define VasEBoot_SCSI_LUN_SHIFT 5 -struct grub_scsi_test_unit_ready +struct VasEBoot_scsi_test_unit_ready { - grub_uint8_t opcode; - grub_uint8_t lun; /* 7-5 LUN, 4-0 reserved */ - grub_uint8_t reserved1; - grub_uint8_t reserved2; - grub_uint8_t reserved3; - grub_uint8_t control; - grub_uint8_t pad[6]; /* To be ATAPI compatible */ -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; /* 7-5 LUN, 4-0 reserved */ + VasEBoot_uint8_t reserved1; + VasEBoot_uint8_t reserved2; + VasEBoot_uint8_t reserved3; + VasEBoot_uint8_t control; + VasEBoot_uint8_t pad[6]; /* To be ATAPI compatible */ +} VasEBoot_PACKED; -struct grub_scsi_inquiry +struct VasEBoot_scsi_inquiry { - grub_uint8_t opcode; - grub_uint8_t lun; /* 7-5 LUN, 4-1 reserved, 0 EVPD */ - grub_uint8_t page; /* page code if EVPD=1 */ - grub_uint8_t reserved; - grub_uint8_t alloc_length; - grub_uint8_t control; - grub_uint8_t pad[6]; /* To be ATAPI compatible */ -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; /* 7-5 LUN, 4-1 reserved, 0 EVPD */ + VasEBoot_uint8_t page; /* page code if EVPD=1 */ + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t alloc_length; + VasEBoot_uint8_t control; + VasEBoot_uint8_t pad[6]; /* To be ATAPI compatible */ +} VasEBoot_PACKED; -struct grub_scsi_inquiry_data +struct VasEBoot_scsi_inquiry_data { - grub_uint8_t devtype; - grub_uint8_t rmb; - grub_uint16_t reserved; - grub_uint8_t length; - grub_uint8_t reserved2[3]; + VasEBoot_uint8_t devtype; + VasEBoot_uint8_t rmb; + VasEBoot_uint16_t reserved; + VasEBoot_uint8_t length; + VasEBoot_uint8_t reserved2[3]; char vendor[8]; char prodid[16]; char prodrev[4]; -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_scsi_request_sense +struct VasEBoot_scsi_request_sense { - grub_uint8_t opcode; - grub_uint8_t lun; /* 7-5 LUN, 4-0 reserved */ - grub_uint8_t reserved1; - grub_uint8_t reserved2; - grub_uint8_t alloc_length; - grub_uint8_t control; - grub_uint8_t pad[6]; /* To be ATAPI compatible */ -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; /* 7-5 LUN, 4-0 reserved */ + VasEBoot_uint8_t reserved1; + VasEBoot_uint8_t reserved2; + VasEBoot_uint8_t alloc_length; + VasEBoot_uint8_t control; + VasEBoot_uint8_t pad[6]; /* To be ATAPI compatible */ +} VasEBoot_PACKED; -struct grub_scsi_request_sense_data +struct VasEBoot_scsi_request_sense_data { - grub_uint8_t error_code; /* 7 Valid, 6-0 Err. code */ - grub_uint8_t segment_number; - grub_uint8_t sense_key; /*7 FileMark, 6 EndOfMedia, 5 ILI, 4-0 sense key */ - grub_uint32_t information; - grub_uint8_t additional_sense_length; - grub_uint32_t cmd_specific_info; - grub_uint8_t additional_sense_code; - grub_uint8_t additional_sense_code_qualifier; - grub_uint8_t field_replaceable_unit_code; - grub_uint8_t sense_key_specific[3]; + VasEBoot_uint8_t error_code; /* 7 Valid, 6-0 Err. code */ + VasEBoot_uint8_t segment_number; + VasEBoot_uint8_t sense_key; /*7 FileMark, 6 EndOfMedia, 5 ILI, 4-0 sense key */ + VasEBoot_uint32_t information; + VasEBoot_uint8_t additional_sense_length; + VasEBoot_uint32_t cmd_specific_info; + VasEBoot_uint8_t additional_sense_code; + VasEBoot_uint8_t additional_sense_code_qualifier; + VasEBoot_uint8_t field_replaceable_unit_code; + VasEBoot_uint8_t sense_key_specific[3]; /* there can be additional sense field */ -} GRUB_PACKED; +} VasEBoot_PACKED; -struct grub_scsi_read_capacity10 +struct VasEBoot_scsi_read_capacity10 { - grub_uint8_t opcode; - grub_uint8_t lun; /* 7-5 LUN, 4-1 reserved, 0 reserved */ - grub_uint32_t logical_block_addr; /* only if PMI=1 */ - grub_uint8_t reserved1; - grub_uint8_t reserved2; - grub_uint8_t PMI; - grub_uint8_t control; - grub_uint16_t pad; /* To be ATAPI compatible */ -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; /* 7-5 LUN, 4-1 reserved, 0 reserved */ + VasEBoot_uint32_t logical_block_addr; /* only if PMI=1 */ + VasEBoot_uint8_t reserved1; + VasEBoot_uint8_t reserved2; + VasEBoot_uint8_t PMI; + VasEBoot_uint8_t control; + VasEBoot_uint16_t pad; /* To be ATAPI compatible */ +} VasEBoot_PACKED; -struct grub_scsi_read_capacity10_data +struct VasEBoot_scsi_read_capacity10_data { - grub_uint32_t last_block; - grub_uint32_t blocksize; -} GRUB_PACKED; + VasEBoot_uint32_t last_block; + VasEBoot_uint32_t blocksize; +} VasEBoot_PACKED; -struct grub_scsi_read_capacity16 +struct VasEBoot_scsi_read_capacity16 { - grub_uint8_t opcode; - grub_uint8_t lun; /* 7-5 LUN, 4-0 0x10 */ - grub_uint64_t logical_block_addr; /* only if PMI=1 */ - grub_uint32_t alloc_len; - grub_uint8_t PMI; - grub_uint8_t control; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; /* 7-5 LUN, 4-0 0x10 */ + VasEBoot_uint64_t logical_block_addr; /* only if PMI=1 */ + VasEBoot_uint32_t alloc_len; + VasEBoot_uint8_t PMI; + VasEBoot_uint8_t control; +} VasEBoot_PACKED; -struct grub_scsi_read_capacity16_data +struct VasEBoot_scsi_read_capacity16_data { - grub_uint64_t last_block; - grub_uint32_t blocksize; - grub_uint8_t pad[20]; -} GRUB_PACKED; + VasEBoot_uint64_t last_block; + VasEBoot_uint32_t blocksize; + VasEBoot_uint8_t pad[20]; +} VasEBoot_PACKED; -struct grub_scsi_read10 +struct VasEBoot_scsi_read10 { - grub_uint8_t opcode; - grub_uint8_t lun; - grub_uint32_t lba; - grub_uint8_t reserved; - grub_uint16_t size; - grub_uint8_t reserved2; - grub_uint16_t pad; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; + VasEBoot_uint32_t lba; + VasEBoot_uint8_t reserved; + VasEBoot_uint16_t size; + VasEBoot_uint8_t reserved2; + VasEBoot_uint16_t pad; +} VasEBoot_PACKED; -struct grub_scsi_read12 +struct VasEBoot_scsi_read12 { - grub_uint8_t opcode; - grub_uint8_t lun; - grub_uint32_t lba; - grub_uint32_t size; - grub_uint8_t reserved; - grub_uint8_t control; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; + VasEBoot_uint32_t lba; + VasEBoot_uint32_t size; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t control; +} VasEBoot_PACKED; -struct grub_scsi_read16 +struct VasEBoot_scsi_read16 { - grub_uint8_t opcode; - grub_uint8_t lun; - grub_uint64_t lba; - grub_uint32_t size; - grub_uint8_t reserved; - grub_uint8_t control; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; + VasEBoot_uint64_t lba; + VasEBoot_uint32_t size; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t control; +} VasEBoot_PACKED; -struct grub_scsi_write10 +struct VasEBoot_scsi_write10 { - grub_uint8_t opcode; - grub_uint8_t lun; - grub_uint32_t lba; - grub_uint8_t reserved; - grub_uint16_t size; - grub_uint8_t reserved2; - grub_uint16_t pad; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; + VasEBoot_uint32_t lba; + VasEBoot_uint8_t reserved; + VasEBoot_uint16_t size; + VasEBoot_uint8_t reserved2; + VasEBoot_uint16_t pad; +} VasEBoot_PACKED; -struct grub_scsi_write12 +struct VasEBoot_scsi_write12 { - grub_uint8_t opcode; - grub_uint8_t lun; - grub_uint32_t lba; - grub_uint32_t size; - grub_uint8_t reserved; - grub_uint8_t control; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; + VasEBoot_uint32_t lba; + VasEBoot_uint32_t size; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t control; +} VasEBoot_PACKED; -struct grub_scsi_write16 +struct VasEBoot_scsi_write16 { - grub_uint8_t opcode; - grub_uint8_t lun; - grub_uint64_t lba; - grub_uint32_t size; - grub_uint8_t reserved; - grub_uint8_t control; -} GRUB_PACKED; + VasEBoot_uint8_t opcode; + VasEBoot_uint8_t lun; + VasEBoot_uint64_t lba; + VasEBoot_uint32_t size; + VasEBoot_uint8_t reserved; + VasEBoot_uint8_t control; +} VasEBoot_PACKED; typedef enum { - grub_scsi_cmd_test_unit_ready = 0x00, - grub_scsi_cmd_request_sense = 0x03, - grub_scsi_cmd_inquiry = 0x12, - grub_scsi_cmd_read_capacity10 = 0x25, - grub_scsi_cmd_read10 = 0x28, - grub_scsi_cmd_write10 = 0x2a, - grub_scsi_cmd_read16 = 0x88, - grub_scsi_cmd_write16 = 0x8a, - grub_scsi_cmd_read_capacity16 = 0x9e, - grub_scsi_cmd_read12 = 0xa8, - grub_scsi_cmd_write12 = 0xaa, - } grub_scsi_cmd_t; + VasEBoot_scsi_cmd_test_unit_ready = 0x00, + VasEBoot_scsi_cmd_request_sense = 0x03, + VasEBoot_scsi_cmd_inquiry = 0x12, + VasEBoot_scsi_cmd_read_capacity10 = 0x25, + VasEBoot_scsi_cmd_read10 = 0x28, + VasEBoot_scsi_cmd_write10 = 0x2a, + VasEBoot_scsi_cmd_read16 = 0x88, + VasEBoot_scsi_cmd_write16 = 0x8a, + VasEBoot_scsi_cmd_read_capacity16 = 0x9e, + VasEBoot_scsi_cmd_read12 = 0xa8, + VasEBoot_scsi_cmd_write12 = 0xaa, + } VasEBoot_scsi_cmd_t; typedef enum { - grub_scsi_devtype_direct = 0x00, - grub_scsi_devtype_cdrom = 0x05 - } grub_scsi_devtype_t; + VasEBoot_scsi_devtype_direct = 0x00, + VasEBoot_scsi_devtype_cdrom = 0x05 + } VasEBoot_scsi_devtype_t; -#endif /* GRUB_SCSICMD_H */ +#endif /* VasEBoot_SCSICMD_H */ diff --git a/include/VasEBoot/sdl.h b/include/VasEBoot/sdl.h index e4efdc9b1..96683e869 100644 --- a/include/VasEBoot/sdl.h +++ b/include/VasEBoot/sdl.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ void EXPORT_FUNC (SDL_Quit) (void); diff --git a/include/VasEBoot/search.h b/include/VasEBoot/search.h index 7f69d25d1..5f6847da0 100644 --- a/include/VasEBoot/search.h +++ b/include/VasEBoot/search.h @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SEARCH_HEADER -#define GRUB_SEARCH_HEADER 1 +#ifndef VasEBoot_SEARCH_HEADER +#define VasEBoot_SEARCH_HEADER 1 -void grub_search_fs_file (const char *key, const char *var, int no_floppy, +void VasEBoot_search_fs_file (const char *key, const char *var, int no_floppy, char **hints, unsigned nhints); -void grub_search_fs_uuid (const char *key, const char *var, int no_floppy, +void VasEBoot_search_fs_uuid (const char *key, const char *var, int no_floppy, char **hints, unsigned nhints); -void grub_search_label (const char *key, const char *var, int no_floppy, +void VasEBoot_search_label (const char *key, const char *var, int no_floppy, char **hints, unsigned nhints); -void grub_search_part_uuid (const char *key, const char *var, int no_floppy, +void VasEBoot_search_part_uuid (const char *key, const char *var, int no_floppy, char **hints, unsigned nhints); -void grub_search_part_label (const char *key, const char *var, int no_floppy, +void VasEBoot_search_part_label (const char *key, const char *var, int no_floppy, char **hints, unsigned nhints); -void grub_search_disk_uuid (const char *key, const char *var, int no_floppy, +void VasEBoot_search_disk_uuid (const char *key, const char *var, int no_floppy, char **hints, unsigned nhints); #endif diff --git a/include/VasEBoot/serial.h b/include/VasEBoot/serial.h index 67379de45..a2e4bc005 100644 --- a/include/VasEBoot/serial.h +++ b/include/VasEBoot/serial.h @@ -1,83 +1,83 @@ /* serial.h - serial device interface */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SERIAL_HEADER -#define GRUB_SERIAL_HEADER 1 +#ifndef VasEBoot_SERIAL_HEADER +#define VasEBoot_SERIAL_HEADER 1 -#include +#include #if defined(__mips__) || defined (__i386__) || defined (__x86_64__) -#include +#include #endif -#include -#include -#include -#ifdef GRUB_MACHINE_IEEE1275 -#include +#include +#include +#include +#ifdef VasEBoot_MACHINE_IEEE1275 +#include #endif -#ifdef GRUB_MACHINE_ARC -#include +#ifdef VasEBoot_MACHINE_ARC +#include #endif -struct grub_serial_port; -struct grub_serial_config; +struct VasEBoot_serial_port; +struct VasEBoot_serial_config; -struct grub_serial_driver +struct VasEBoot_serial_driver { - grub_err_t (*configure) (struct grub_serial_port *port, - struct grub_serial_config *config); - int (*fetch) (struct grub_serial_port *port); - void (*put) (struct grub_serial_port *port, const int c); - void (*fini) (struct grub_serial_port *port); + VasEBoot_err_t (*configure) (struct VasEBoot_serial_port *port, + struct VasEBoot_serial_config *config); + int (*fetch) (struct VasEBoot_serial_port *port); + void (*put) (struct VasEBoot_serial_port *port, const int c); + void (*fini) (struct VasEBoot_serial_port *port); }; /* The type of parity. */ typedef enum { - GRUB_SERIAL_PARITY_NONE, - GRUB_SERIAL_PARITY_ODD, - GRUB_SERIAL_PARITY_EVEN, - } grub_serial_parity_t; + VasEBoot_SERIAL_PARITY_NONE, + VasEBoot_SERIAL_PARITY_ODD, + VasEBoot_SERIAL_PARITY_EVEN, + } VasEBoot_serial_parity_t; typedef enum { - GRUB_SERIAL_STOP_BITS_1, - GRUB_SERIAL_STOP_BITS_1_5, - GRUB_SERIAL_STOP_BITS_2, - } grub_serial_stop_bits_t; + VasEBoot_SERIAL_STOP_BITS_1, + VasEBoot_SERIAL_STOP_BITS_1_5, + VasEBoot_SERIAL_STOP_BITS_2, + } VasEBoot_serial_stop_bits_t; -struct grub_serial_config +struct VasEBoot_serial_config { unsigned speed; int word_len; - grub_serial_parity_t parity; - grub_serial_stop_bits_t stop_bits; - grub_uint64_t base_clock; + VasEBoot_serial_parity_t parity; + VasEBoot_serial_stop_bits_t stop_bits; + VasEBoot_uint64_t base_clock; int rtscts; }; -struct grub_serial_port +struct VasEBoot_serial_port { - struct grub_serial_port *next; - struct grub_serial_port **prev; + struct VasEBoot_serial_port *next; + struct VasEBoot_serial_port **prev; char *name; - struct grub_serial_driver *driver; - struct grub_serial_config config; + struct VasEBoot_serial_driver *driver; + struct VasEBoot_serial_config config; int configured; int broken; @@ -87,78 +87,78 @@ struct grub_serial_port union { #if defined(__mips__) || defined (__i386__) || defined (__x86_64__) - grub_port_t port; + VasEBoot_port_t port; #endif struct { - grub_usb_device_t usbdev; + VasEBoot_usb_device_t usbdev; int configno; int interfno; char buf[64]; int bufstart, bufend; - struct grub_usb_desc_endp *in_endp; - struct grub_usb_desc_endp *out_endp; + struct VasEBoot_usb_desc_endp *in_endp; + struct VasEBoot_usb_desc_endp *out_endp; }; - struct grub_escc_descriptor *escc_desc; -#ifdef GRUB_MACHINE_IEEE1275 + struct VasEBoot_escc_descriptor *escc_desc; +#ifdef VasEBoot_MACHINE_IEEE1275 struct { - grub_ieee1275_ihandle_t handle; + VasEBoot_ieee1275_ihandle_t handle; struct ofserial_hash_ent *elem; }; #endif -#ifdef GRUB_MACHINE_EFI - struct grub_efi_serial_io_interface *interface; +#ifdef VasEBoot_MACHINE_EFI + struct VasEBoot_efi_serial_io_interface *interface; #endif -#ifdef GRUB_MACHINE_ARC +#ifdef VasEBoot_MACHINE_ARC struct { - grub_arc_fileno_t handle; + VasEBoot_arc_fileno_t handle; int handle_valid; }; #endif }; - grub_term_output_t term_out; - grub_term_input_t term_in; + VasEBoot_term_output_t term_out; + VasEBoot_term_input_t term_in; }; -grub_err_t EXPORT_FUNC(grub_serial_register) (struct grub_serial_port *port); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_serial_register) (struct VasEBoot_serial_port *port); -void EXPORT_FUNC(grub_serial_unregister) (struct grub_serial_port *port); +void EXPORT_FUNC(VasEBoot_serial_unregister) (struct VasEBoot_serial_port *port); /* Convenience functions to perform primitive operations on a port. */ -static inline grub_err_t -grub_serial_port_configure (struct grub_serial_port *port, - struct grub_serial_config *config) +static inline VasEBoot_err_t +VasEBoot_serial_port_configure (struct VasEBoot_serial_port *port, + struct VasEBoot_serial_config *config) { return port->driver->configure (port, config); } static inline int -grub_serial_port_fetch (struct grub_serial_port *port) +VasEBoot_serial_port_fetch (struct VasEBoot_serial_port *port) { return port->driver->fetch (port); } static inline void -grub_serial_port_put (struct grub_serial_port *port, const int c) +VasEBoot_serial_port_put (struct VasEBoot_serial_port *port, const int c) { port->driver->put (port, c); } static inline void -grub_serial_port_fini (struct grub_serial_port *port) +VasEBoot_serial_port_fini (struct VasEBoot_serial_port *port) { port->driver->fini (port); } /* Set default settings. */ -static inline grub_err_t -grub_serial_config_defaults (struct grub_serial_port *port) +static inline VasEBoot_err_t +VasEBoot_serial_config_defaults (struct VasEBoot_serial_port *port) { - struct grub_serial_config config = + struct VasEBoot_serial_config config = { -#ifdef GRUB_MACHINE_MIPS_LOONGSON +#ifdef VasEBoot_MACHINE_MIPS_LOONGSON .speed = 115200, /* On Loongson machines serial port has only 3 wires. */ .rtscts = 0, @@ -167,8 +167,8 @@ grub_serial_config_defaults (struct grub_serial_port *port) .rtscts = 1, #endif .word_len = 8, - .parity = GRUB_SERIAL_PARITY_NONE, - .stop_bits = GRUB_SERIAL_STOP_BITS_1, + .parity = VasEBoot_SERIAL_PARITY_NONE, + .stop_bits = VasEBoot_SERIAL_STOP_BITS_1, .base_clock = 0 }; @@ -176,30 +176,30 @@ grub_serial_config_defaults (struct grub_serial_port *port) } #if defined(__mips__) || defined (__i386__) || defined (__x86_64__) -void grub_ns8250_init (void); -char *grub_serial_ns8250_add_port (grub_port_t port); +void VasEBoot_ns8250_init (void); +char *VasEBoot_serial_ns8250_add_port (VasEBoot_port_t port); #endif -#ifdef GRUB_MACHINE_IEEE1275 -void grub_ofserial_init (void); +#ifdef VasEBoot_MACHINE_IEEE1275 +void VasEBoot_ofserial_init (void); #endif -#ifdef GRUB_MACHINE_EFI +#ifdef VasEBoot_MACHINE_EFI void -grub_efiserial_init (void); +VasEBoot_efiserial_init (void); #endif -#ifdef GRUB_MACHINE_ARC +#ifdef VasEBoot_MACHINE_ARC void -grub_arcserial_init (void); +VasEBoot_arcserial_init (void); const char * -grub_arcserial_add_port (const char *path); +VasEBoot_arcserial_add_port (const char *path); #endif -struct grub_serial_port *grub_serial_find (const char *name); -extern struct grub_serial_driver grub_ns8250_driver; -void EXPORT_FUNC(grub_serial_unregister_driver) (struct grub_serial_driver *driver); +struct VasEBoot_serial_port *VasEBoot_serial_find (const char *name); +extern struct VasEBoot_serial_driver VasEBoot_ns8250_driver; +void EXPORT_FUNC(VasEBoot_serial_unregister_driver) (struct VasEBoot_serial_driver *driver); -#ifndef GRUB_MACHINE_EMU -extern void grub_serial_init (void); -extern void grub_serial_fini (void); +#ifndef VasEBoot_MACHINE_EMU +extern void VasEBoot_serial_init (void); +extern void VasEBoot_serial_fini (void); #endif #endif diff --git a/include/VasEBoot/setjmp.h b/include/VasEBoot/setjmp.h index 4bba034f4..c3799c82b 100644 --- a/include/VasEBoot/setjmp.h +++ b/include/VasEBoot/setjmp.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_HEADER -#define GRUB_SETJMP_HEADER 1 +#ifndef VasEBoot_SETJMP_HEADER +#define VasEBoot_SETJMP_HEADER 1 -#if defined(GRUB_UTIL) +#if defined(VasEBoot_UTIL) #include -typedef jmp_buf grub_jmp_buf; -#define grub_setjmp setjmp -#define grub_longjmp longjmp +typedef jmp_buf VasEBoot_jmp_buf; +#define VasEBoot_setjmp setjmp +#define VasEBoot_longjmp longjmp #else -#include +#include #if GNUC_PREREQ(4,0) #define RETURNS_TWICE __attribute__ ((returns_twice)) @@ -34,9 +34,9 @@ typedef jmp_buf grub_jmp_buf; #define RETURNS_TWICE #endif -/* This must define grub_jmp_buf, and declare grub_setjmp and - grub_longjmp. */ -# include +/* This must define VasEBoot_jmp_buf, and declare VasEBoot_setjmp and + VasEBoot_longjmp. */ +# include #endif -#endif /* ! GRUB_SETJMP_HEADER */ +#endif /* ! VasEBoot_SETJMP_HEADER */ diff --git a/include/VasEBoot/smbios.h b/include/VasEBoot/smbios.h index 4b82fa845..5902fa007 100644 --- a/include/VasEBoot/smbios.h +++ b/include/VasEBoot/smbios.h @@ -1,68 +1,68 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SMBIOS_HEADER -#define GRUB_SMBIOS_HEADER 1 +#ifndef VasEBoot_SMBIOS_HEADER +#define VasEBoot_SMBIOS_HEADER 1 -#include +#include -#define GRUB_SMBIOS_TYPE_END_OF_TABLE ((grub_uint8_t)127) +#define VasEBoot_SMBIOS_TYPE_END_OF_TABLE ((VasEBoot_uint8_t)127) -struct grub_smbios_ieps +struct VasEBoot_smbios_ieps { - grub_uint8_t anchor[5]; /* "_DMI_" */ - grub_uint8_t checksum; - grub_uint16_t table_length; - grub_uint32_t table_address; - grub_uint16_t structures; - grub_uint8_t revision; -} GRUB_PACKED; + VasEBoot_uint8_t anchor[5]; /* "_DMI_" */ + VasEBoot_uint8_t checksum; + VasEBoot_uint16_t table_length; + VasEBoot_uint32_t table_address; + VasEBoot_uint16_t structures; + VasEBoot_uint8_t revision; +} VasEBoot_PACKED; -struct grub_smbios_eps +struct VasEBoot_smbios_eps { - grub_uint8_t anchor[4]; /* "_SM_" */ - grub_uint8_t checksum; - grub_uint8_t length; /* 0x1f */ - grub_uint8_t version_major; - grub_uint8_t version_minor; - grub_uint16_t maximum_structure_size; - grub_uint8_t revision; - grub_uint8_t formatted[5]; - struct grub_smbios_ieps intermediate; -} GRUB_PACKED; + VasEBoot_uint8_t anchor[4]; /* "_SM_" */ + VasEBoot_uint8_t checksum; + VasEBoot_uint8_t length; /* 0x1f */ + VasEBoot_uint8_t version_major; + VasEBoot_uint8_t version_minor; + VasEBoot_uint16_t maximum_structure_size; + VasEBoot_uint8_t revision; + VasEBoot_uint8_t formatted[5]; + struct VasEBoot_smbios_ieps intermediate; +} VasEBoot_PACKED; -struct grub_smbios_eps3 +struct VasEBoot_smbios_eps3 { - grub_uint8_t anchor[5]; /* "_SM3_" */ - grub_uint8_t checksum; - grub_uint8_t length; /* 0x18 */ - grub_uint8_t version_major; - grub_uint8_t version_minor; - grub_uint8_t docrev; - grub_uint8_t revision; - grub_uint8_t reserved; - grub_uint32_t maximum_table_length; - grub_uint64_t table_address; -} GRUB_PACKED; + VasEBoot_uint8_t anchor[5]; /* "_SM3_" */ + VasEBoot_uint8_t checksum; + VasEBoot_uint8_t length; /* 0x18 */ + VasEBoot_uint8_t version_major; + VasEBoot_uint8_t version_minor; + VasEBoot_uint8_t docrev; + VasEBoot_uint8_t revision; + VasEBoot_uint8_t reserved; + VasEBoot_uint32_t maximum_table_length; + VasEBoot_uint64_t table_address; +} VasEBoot_PACKED; -struct grub_smbios_eps *grub_smbios_get_eps (void); -struct grub_smbios_eps3 *grub_smbios_get_eps3 (void); -struct grub_smbios_eps *grub_machine_smbios_get_eps (void); -struct grub_smbios_eps3 *grub_machine_smbios_get_eps3 (void); +struct VasEBoot_smbios_eps *VasEBoot_smbios_get_eps (void); +struct VasEBoot_smbios_eps3 *VasEBoot_smbios_get_eps3 (void); +struct VasEBoot_smbios_eps *VasEBoot_machine_smbios_get_eps (void); +struct VasEBoot_smbios_eps3 *VasEBoot_machine_smbios_get_eps3 (void); -#endif /* ! GRUB_SMBIOS_HEADER */ +#endif /* ! VasEBoot_SMBIOS_HEADER */ diff --git a/include/VasEBoot/smbus.h b/include/VasEBoot/smbus.h index 0b8e6718f..bec1b0b25 100644 --- a/include/VasEBoot/smbus.h +++ b/include/VasEBoot/smbus.h @@ -1,66 +1,66 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SMBUS_HEADER -#define GRUB_SMBUS_HEADER 1 +#ifndef VasEBoot_SMBUS_HEADER +#define VasEBoot_SMBUS_HEADER 1 -#define GRUB_SMB_RAM_START_ADDR 0x50 -#define GRUB_SMB_RAM_NUM_MAX 0x08 +#define VasEBoot_SMB_RAM_START_ADDR 0x50 +#define VasEBoot_SMB_RAM_NUM_MAX 0x08 -#define GRUB_SMBUS_SPD_MEMORY_TYPE_ADDR 2 -#define GRUB_SMBUS_SPD_MEMORY_TYPE_DDR2 8 -#define GRUB_SMBUS_SPD_MEMORY_NUM_BANKS_ADDR 17 -#define GRUB_SMBUS_SPD_MEMORY_NUM_ROWS_ADDR 3 -#define GRUB_SMBUS_SPD_MEMORY_NUM_COLUMNS_ADDR 4 -#define GRUB_SMBUS_SPD_MEMORY_NUM_OF_RANKS_ADDR 5 -#define GRUB_SMBUS_SPD_MEMORY_NUM_OF_RANKS_MASK 0x7 -#define GRUB_SMBUS_SPD_MEMORY_CAS_LATENCY_ADDR 18 -#define GRUB_SMBUS_SPD_MEMORY_CAS_LATENCY_MIN_VALUE 5 -#define GRUB_SMBUS_SPD_MEMORY_TRAS_ADDR 30 -#define GRUB_SMBUS_SPD_MEMORY_TRTP_ADDR 38 +#define VasEBoot_SMBUS_SPD_MEMORY_TYPE_ADDR 2 +#define VasEBoot_SMBUS_SPD_MEMORY_TYPE_DDR2 8 +#define VasEBoot_SMBUS_SPD_MEMORY_NUM_BANKS_ADDR 17 +#define VasEBoot_SMBUS_SPD_MEMORY_NUM_ROWS_ADDR 3 +#define VasEBoot_SMBUS_SPD_MEMORY_NUM_COLUMNS_ADDR 4 +#define VasEBoot_SMBUS_SPD_MEMORY_NUM_OF_RANKS_ADDR 5 +#define VasEBoot_SMBUS_SPD_MEMORY_NUM_OF_RANKS_MASK 0x7 +#define VasEBoot_SMBUS_SPD_MEMORY_CAS_LATENCY_ADDR 18 +#define VasEBoot_SMBUS_SPD_MEMORY_CAS_LATENCY_MIN_VALUE 5 +#define VasEBoot_SMBUS_SPD_MEMORY_TRAS_ADDR 30 +#define VasEBoot_SMBUS_SPD_MEMORY_TRTP_ADDR 38 #ifndef ASM_FILE -struct grub_smbus_spd +struct VasEBoot_smbus_spd { - grub_uint8_t written_size; - grub_uint8_t log_total_flash_size; - grub_uint8_t memory_type; + VasEBoot_uint8_t written_size; + VasEBoot_uint8_t log_total_flash_size; + VasEBoot_uint8_t memory_type; union { - grub_uint8_t unknown[253]; + VasEBoot_uint8_t unknown[253]; struct { - grub_uint8_t num_rows; - grub_uint8_t num_columns; - grub_uint8_t num_of_ranks; - grub_uint8_t unused1[12]; - grub_uint8_t num_of_banks; - grub_uint8_t unused2[2]; - grub_uint8_t cas_latency; - grub_uint8_t unused3[9]; - grub_uint8_t rank_capacity; - grub_uint8_t unused4[1]; - grub_uint8_t tras; - grub_uint8_t unused5[7]; - grub_uint8_t trtp; - grub_uint8_t unused6[31]; - grub_uint8_t part_number[18]; - grub_uint8_t unused7[165]; + VasEBoot_uint8_t num_rows; + VasEBoot_uint8_t num_columns; + VasEBoot_uint8_t num_of_ranks; + VasEBoot_uint8_t unused1[12]; + VasEBoot_uint8_t num_of_banks; + VasEBoot_uint8_t unused2[2]; + VasEBoot_uint8_t cas_latency; + VasEBoot_uint8_t unused3[9]; + VasEBoot_uint8_t rank_capacity; + VasEBoot_uint8_t unused4[1]; + VasEBoot_uint8_t tras; + VasEBoot_uint8_t unused5[7]; + VasEBoot_uint8_t trtp; + VasEBoot_uint8_t unused6[31]; + VasEBoot_uint8_t part_number[18]; + VasEBoot_uint8_t unused7[165]; } ddr2; }; }; diff --git a/include/VasEBoot/sparc64/ieee1275/boot.h b/include/VasEBoot/sparc64/ieee1275/boot.h index 02d53f28e..096dfcf3f 100644 --- a/include/VasEBoot/sparc64/ieee1275/boot.h +++ b/include/VasEBoot/sparc64/ieee1275/boot.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BOOT_MACHINE_HEADER -#define GRUB_BOOT_MACHINE_HEADER 1 +#ifndef VasEBoot_BOOT_MACHINE_HEADER +#define VasEBoot_BOOT_MACHINE_HEADER 1 #define CIF_REG %l0 #define CHOSEN_NODE_REG %l4 @@ -36,28 +36,28 @@ #define LDX_ABS(symbol, offset, reg) \ ldx [PIC_REG + (symbol - pic_base) + (offset)], reg -#define GRUB_BOOT_AOUT_HEADER_SIZE 32 +#define VasEBoot_BOOT_AOUT_HEADER_SIZE 32 -#define GRUB_BOOT_MACHINE_SIGNATURE 0xbb44aa55 +#define VasEBoot_BOOT_MACHINE_SIGNATURE 0xbb44aa55 -#define GRUB_BOOT_MACHINE_BOOT_DEVPATH 0x08 +#define VasEBoot_BOOT_MACHINE_BOOT_DEVPATH 0x08 -#define GRUB_BOOT_MACHINE_BOOT_DEVPATH_END 0x80 +#define VasEBoot_BOOT_MACHINE_BOOT_DEVPATH_END 0x80 -#define GRUB_BOOT_MACHINE_KERNEL_BYTE 0x80 +#define VasEBoot_BOOT_MACHINE_KERNEL_BYTE 0x80 -#define GRUB_BOOT_MACHINE_CODE_END \ - (0x1fc - GRUB_BOOT_AOUT_HEADER_SIZE) +#define VasEBoot_BOOT_MACHINE_CODE_END \ + (0x1fc - VasEBoot_BOOT_AOUT_HEADER_SIZE) -#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200 +#define VasEBoot_BOOT_MACHINE_KERNEL_ADDR 0x4200 #ifndef ASM_FILE /* This is the blocklist used in the diskboot image. */ -struct grub_boot_blocklist +struct VasEBoot_boot_blocklist { - grub_uint64_t start; - grub_uint32_t len; -} GRUB_PACKED; + VasEBoot_uint64_t start; + VasEBoot_uint32_t len; +} VasEBoot_PACKED; #endif #endif /* ! BOOT_MACHINE_HEADER */ diff --git a/include/VasEBoot/sparc64/ieee1275/ieee1275.h b/include/VasEBoot/sparc64/ieee1275/ieee1275.h index 32c77f80f..ec89826e3 100644 --- a/include/VasEBoot/sparc64/ieee1275/ieee1275.h +++ b/include/VasEBoot/sparc64/ieee1275/ieee1275.h @@ -1,31 +1,31 @@ /* ieee1275.h - Access the Open Firmware client interface. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_IEEE1275_MACHINE_HEADER -#define GRUB_IEEE1275_MACHINE_HEADER 1 +#ifndef VasEBoot_IEEE1275_MACHINE_HEADER +#define VasEBoot_IEEE1275_MACHINE_HEADER 1 -#include +#include -#define GRUB_IEEE1275_CELL_SIZEOF 8 -typedef grub_uint64_t grub_ieee1275_cell_t; +#define VasEBoot_IEEE1275_CELL_SIZEOF 8 +typedef VasEBoot_uint64_t VasEBoot_ieee1275_cell_t; -/* Encoding of 'mode' argument to grub_ieee1275_map_physical() */ +/* Encoding of 'mode' argument to VasEBoot_ieee1275_map_physical() */ #define IEEE1275_MAP_WRITE 0x0001 /* Writable */ #define IEEE1275_MAP_READ 0x0002 /* Readable */ #define IEEE1275_MAP_EXEC 0x0004 /* Executable */ @@ -37,12 +37,12 @@ typedef grub_uint64_t grub_ieee1275_cell_t; #define IEEE1275_MAP_DEFAULT (IEEE1275_MAP_WRITE | IEEE1275_MAP_READ | \ IEEE1275_MAP_EXEC | IEEE1275_MAP_CACHED) -extern int EXPORT_FUNC(grub_ieee1275_claim_vaddr) (grub_addr_t vaddr, - grub_size_t size); -extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr, - grub_size_t size, - grub_uint32_t align); +extern int EXPORT_FUNC(VasEBoot_ieee1275_claim_vaddr) (VasEBoot_addr_t vaddr, + VasEBoot_size_t size); +extern int EXPORT_FUNC(VasEBoot_ieee1275_alloc_physmem) (VasEBoot_addr_t *paddr, + VasEBoot_size_t size, + VasEBoot_uint32_t align); -extern grub_addr_t EXPORT_VAR (grub_ieee1275_original_stack); +extern VasEBoot_addr_t EXPORT_VAR (VasEBoot_ieee1275_original_stack); -#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */ +#endif /* ! VasEBoot_IEEE1275_MACHINE_HEADER */ diff --git a/include/VasEBoot/sparc64/ieee1275/kernel.h b/include/VasEBoot/sparc64/ieee1275/kernel.h index 9a00bea61..6c80178cc 100644 --- a/include/VasEBoot/sparc64/ieee1275/kernel.h +++ b/include/VasEBoot/sparc64/ieee1275/kernel.h @@ -1,31 +1,31 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 +#ifndef VasEBoot_KERNEL_MACHINE_HEADER +#define VasEBoot_KERNEL_MACHINE_HEADER 1 -#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000 +#define VasEBoot_KERNEL_MACHINE_STACK_SIZE 0x40000 #ifndef ASM_FILE -#include -#include +#include +#include #endif /* ! ASM_FILE */ -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +#endif /* ! VasEBoot_KERNEL_MACHINE_HEADER */ diff --git a/include/VasEBoot/sparc64/setjmp.h b/include/VasEBoot/sparc64/setjmp.h index 00286a574..68e6dd1dd 100644 --- a/include/VasEBoot/sparc64/setjmp.h +++ b/include/VasEBoot/sparc64/setjmp.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -#include +#include -typedef grub_uint64_t grub_jmp_buf[3]; +typedef VasEBoot_uint64_t VasEBoot_jmp_buf[3]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)); -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/sparc64/time.h b/include/VasEBoot/sparc64/time.h index 5db7ff4f1..fb67965d8 100644 --- a/include/VasEBoot/sparc64/time.h +++ b/include/VasEBoot/sparc64/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: not implemented */ } diff --git a/include/VasEBoot/sparc64/types.h b/include/VasEBoot/sparc64/types.h index b9b0cf996..979042118 100644 --- a/include/VasEBoot/sparc64/types.h +++ b/include/VasEBoot/sparc64/types.h @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2004,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ -#define GRUB_TARGET_SIZEOF_VOID_P 8 +#define VasEBoot_TARGET_SIZEOF_VOID_P 8 /* The size of long. */ -#define GRUB_TARGET_SIZEOF_LONG 8 +#define VasEBoot_TARGET_SIZEOF_LONG 8 /* sparc64 is big-endian. */ -#define GRUB_TARGET_WORDS_BIGENDIAN 1 +#define VasEBoot_TARGET_WORDS_BIGENDIAN 1 -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/speaker.h b/include/VasEBoot/speaker.h index a076fcfb7..03705fb5e 100644 --- a/include/VasEBoot/speaker.h +++ b/include/VasEBoot/speaker.h @@ -1,24 +1,24 @@ -#ifndef GRUB_SPEAKER_HEADER -#define GRUB_SPEAKER_HEADER 1 +#ifndef VasEBoot_SPEAKER_HEADER +#define VasEBoot_SPEAKER_HEADER 1 -#include -#include +#include +#include /* The frequency of the PIT clock. */ -#define GRUB_SPEAKER_PIT_FREQUENCY 0x1234dd +#define VasEBoot_SPEAKER_PIT_FREQUENCY 0x1234dd static inline void -grub_speaker_beep_off (void) +VasEBoot_speaker_beep_off (void) { unsigned char status; - status = grub_inb (GRUB_PIT_SPEAKER_PORT); - grub_outb (status & ~(GRUB_PIT_SPK_TMR2 | GRUB_PIT_SPK_DATA), - GRUB_PIT_SPEAKER_PORT); + status = VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT); + VasEBoot_outb (status & ~(VasEBoot_PIT_SPK_TMR2 | VasEBoot_PIT_SPK_DATA), + VasEBoot_PIT_SPEAKER_PORT); } static inline void -grub_speaker_beep_on (grub_uint16_t pitch) +VasEBoot_speaker_beep_on (VasEBoot_uint16_t pitch) { unsigned char status; unsigned int counter; @@ -28,20 +28,20 @@ grub_speaker_beep_on (grub_uint16_t pitch) else if (pitch > 20000) pitch = 20000; - counter = GRUB_SPEAKER_PIT_FREQUENCY / pitch; + counter = VasEBoot_SPEAKER_PIT_FREQUENCY / pitch; /* Program timer 2. */ - grub_outb (GRUB_PIT_CTRL_SELECT_2 - | GRUB_PIT_CTRL_READLOAD_WORD - | GRUB_PIT_CTRL_SQUAREWAVE_GEN - | GRUB_PIT_CTRL_COUNT_BINARY, GRUB_PIT_CTRL); - grub_outb (counter & 0xff, GRUB_PIT_COUNTER_2); /* LSB */ - grub_outb ((counter >> 8) & 0xff, GRUB_PIT_COUNTER_2); /* MSB */ + VasEBoot_outb (VasEBoot_PIT_CTRL_SELECT_2 + | VasEBoot_PIT_CTRL_READLOAD_WORD + | VasEBoot_PIT_CTRL_SQUAREWAVE_GEN + | VasEBoot_PIT_CTRL_COUNT_BINARY, VasEBoot_PIT_CTRL); + VasEBoot_outb (counter & 0xff, VasEBoot_PIT_COUNTER_2); /* LSB */ + VasEBoot_outb ((counter >> 8) & 0xff, VasEBoot_PIT_COUNTER_2); /* MSB */ /* Start speaker. */ - status = grub_inb (GRUB_PIT_SPEAKER_PORT); - grub_outb (status | GRUB_PIT_SPK_TMR2 | GRUB_PIT_SPK_DATA, - GRUB_PIT_SPEAKER_PORT); + status = VasEBoot_inb (VasEBoot_PIT_SPEAKER_PORT); + VasEBoot_outb (status | VasEBoot_PIT_SPK_TMR2 | VasEBoot_PIT_SPK_DATA, + VasEBoot_PIT_SPEAKER_PORT); } #endif diff --git a/include/VasEBoot/symbol.h b/include/VasEBoot/symbol.h index ed19f70db..853450ebb 100644 --- a/include/VasEBoot/symbol.h +++ b/include/VasEBoot/symbol.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SYMBOL_HEADER -#define GRUB_SYMBOL_HEADER 1 +#ifndef VasEBoot_SYMBOL_HEADER +#define VasEBoot_SYMBOL_HEADER 1 #include @@ -25,7 +25,7 @@ #define LOCAL(sym) L_ ## sym /* Add an underscore to a C symbol in assembler code if needed. */ -#ifndef GRUB_UTIL +#ifndef VasEBoot_UTIL #ifdef __APPLE__ #define MACRO_DOLLAR(x) $$ ## x @@ -64,9 +64,9 @@ #endif /* Mark an exported symbol. */ -#ifndef GRUB_SYMBOL_GENERATOR +#ifndef VasEBoot_SYMBOL_GENERATOR # define EXPORT_FUNC(x) x # define EXPORT_VAR(x) x -#endif /* ! GRUB_SYMBOL_GENERATOR */ +#endif /* ! VasEBoot_SYMBOL_GENERATOR */ -#endif /* ! GRUB_SYMBOL_HEADER */ +#endif /* ! VasEBoot_SYMBOL_HEADER */ diff --git a/include/VasEBoot/syslinux_parse.h b/include/VasEBoot/syslinux_parse.h index 359576310..32c4bab77 100644 --- a/include/VasEBoot/syslinux_parse.h +++ b/include/VasEBoot/syslinux_parse.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SYSLINUX_PARSE_HEADER -#define GRUB_SYSLINUX_PARSE_HEADER 1 +#ifndef VasEBoot_SYSLINUX_PARSE_HEADER +#define VasEBoot_SYSLINUX_PARSE_HEADER 1 -#include +#include typedef enum { - GRUB_SYSLINUX_UNKNOWN, - GRUB_SYSLINUX_ISOLINUX, - GRUB_SYSLINUX_PXELINUX, - GRUB_SYSLINUX_SYSLINUX, - } grub_syslinux_flavour_t; + VasEBoot_SYSLINUX_UNKNOWN, + VasEBoot_SYSLINUX_ISOLINUX, + VasEBoot_SYSLINUX_PXELINUX, + VasEBoot_SYSLINUX_SYSLINUX, + } VasEBoot_syslinux_flavour_t; char * -grub_syslinux_config_file (const char *root, const char *target_root, +VasEBoot_syslinux_config_file (const char *root, const char *target_root, const char *cwd, const char *target_cwd, - const char *fname, grub_syslinux_flavour_t flav); + const char *fname, VasEBoot_syslinux_flavour_t flav); #endif diff --git a/include/VasEBoot/term.h b/include/VasEBoot/term.h index 5ffb38f69..4073b6fb9 100644 --- a/include/VasEBoot/term.h +++ b/include/VasEBoot/term.h @@ -1,88 +1,88 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TERM_HEADER -#define GRUB_TERM_HEADER 1 +#ifndef VasEBoot_TERM_HEADER +#define VasEBoot_TERM_HEADER 1 -#define GRUB_TERM_NO_KEY 0 +#define VasEBoot_TERM_NO_KEY 0 -/* Internal codes used by GRUB to represent terminal input. */ +/* Internal codes used by VasEBoot to represent terminal input. */ /* Only for keys otherwise not having shifted modification. */ -#define GRUB_TERM_SHIFT 0x01000000 -#define GRUB_TERM_CTRL 0x02000000 -#define GRUB_TERM_ALT 0x04000000 +#define VasEBoot_TERM_SHIFT 0x01000000 +#define VasEBoot_TERM_CTRL 0x02000000 +#define VasEBoot_TERM_ALT 0x04000000 /* Keys without associated character. */ -#define GRUB_TERM_EXTENDED 0x00800000 -#define GRUB_TERM_KEY_MASK 0x00ffffff +#define VasEBoot_TERM_EXTENDED 0x00800000 +#define VasEBoot_TERM_KEY_MASK 0x00ffffff -#define GRUB_TERM_KEY_LEFT (GRUB_TERM_EXTENDED | 0x4b) -#define GRUB_TERM_KEY_RIGHT (GRUB_TERM_EXTENDED | 0x4d) -#define GRUB_TERM_KEY_UP (GRUB_TERM_EXTENDED | 0x48) -#define GRUB_TERM_KEY_DOWN (GRUB_TERM_EXTENDED | 0x50) -#define GRUB_TERM_KEY_HOME (GRUB_TERM_EXTENDED | 0x47) -#define GRUB_TERM_KEY_END (GRUB_TERM_EXTENDED | 0x4f) -#define GRUB_TERM_KEY_DC (GRUB_TERM_EXTENDED | 0x53) -#define GRUB_TERM_KEY_PPAGE (GRUB_TERM_EXTENDED | 0x49) -#define GRUB_TERM_KEY_NPAGE (GRUB_TERM_EXTENDED | 0x51) -#define GRUB_TERM_KEY_F1 (GRUB_TERM_EXTENDED | 0x3b) -#define GRUB_TERM_KEY_F2 (GRUB_TERM_EXTENDED | 0x3c) -#define GRUB_TERM_KEY_F3 (GRUB_TERM_EXTENDED | 0x3d) -#define GRUB_TERM_KEY_F4 (GRUB_TERM_EXTENDED | 0x3e) -#define GRUB_TERM_KEY_F5 (GRUB_TERM_EXTENDED | 0x3f) -#define GRUB_TERM_KEY_F6 (GRUB_TERM_EXTENDED | 0x40) -#define GRUB_TERM_KEY_F7 (GRUB_TERM_EXTENDED | 0x41) -#define GRUB_TERM_KEY_F8 (GRUB_TERM_EXTENDED | 0x42) -#define GRUB_TERM_KEY_F9 (GRUB_TERM_EXTENDED | 0x43) -#define GRUB_TERM_KEY_F10 (GRUB_TERM_EXTENDED | 0x44) -#define GRUB_TERM_KEY_F11 (GRUB_TERM_EXTENDED | 0x57) -#define GRUB_TERM_KEY_F12 (GRUB_TERM_EXTENDED | 0x58) -#define GRUB_TERM_KEY_INSERT (GRUB_TERM_EXTENDED | 0x52) -#define GRUB_TERM_KEY_CENTER (GRUB_TERM_EXTENDED | 0x4c) +#define VasEBoot_TERM_KEY_LEFT (VasEBoot_TERM_EXTENDED | 0x4b) +#define VasEBoot_TERM_KEY_RIGHT (VasEBoot_TERM_EXTENDED | 0x4d) +#define VasEBoot_TERM_KEY_UP (VasEBoot_TERM_EXTENDED | 0x48) +#define VasEBoot_TERM_KEY_DOWN (VasEBoot_TERM_EXTENDED | 0x50) +#define VasEBoot_TERM_KEY_HOME (VasEBoot_TERM_EXTENDED | 0x47) +#define VasEBoot_TERM_KEY_END (VasEBoot_TERM_EXTENDED | 0x4f) +#define VasEBoot_TERM_KEY_DC (VasEBoot_TERM_EXTENDED | 0x53) +#define VasEBoot_TERM_KEY_PPAGE (VasEBoot_TERM_EXTENDED | 0x49) +#define VasEBoot_TERM_KEY_NPAGE (VasEBoot_TERM_EXTENDED | 0x51) +#define VasEBoot_TERM_KEY_F1 (VasEBoot_TERM_EXTENDED | 0x3b) +#define VasEBoot_TERM_KEY_F2 (VasEBoot_TERM_EXTENDED | 0x3c) +#define VasEBoot_TERM_KEY_F3 (VasEBoot_TERM_EXTENDED | 0x3d) +#define VasEBoot_TERM_KEY_F4 (VasEBoot_TERM_EXTENDED | 0x3e) +#define VasEBoot_TERM_KEY_F5 (VasEBoot_TERM_EXTENDED | 0x3f) +#define VasEBoot_TERM_KEY_F6 (VasEBoot_TERM_EXTENDED | 0x40) +#define VasEBoot_TERM_KEY_F7 (VasEBoot_TERM_EXTENDED | 0x41) +#define VasEBoot_TERM_KEY_F8 (VasEBoot_TERM_EXTENDED | 0x42) +#define VasEBoot_TERM_KEY_F9 (VasEBoot_TERM_EXTENDED | 0x43) +#define VasEBoot_TERM_KEY_F10 (VasEBoot_TERM_EXTENDED | 0x44) +#define VasEBoot_TERM_KEY_F11 (VasEBoot_TERM_EXTENDED | 0x57) +#define VasEBoot_TERM_KEY_F12 (VasEBoot_TERM_EXTENDED | 0x58) +#define VasEBoot_TERM_KEY_INSERT (VasEBoot_TERM_EXTENDED | 0x52) +#define VasEBoot_TERM_KEY_CENTER (VasEBoot_TERM_EXTENDED | 0x4c) -#define GRUB_TERM_ESC '\e' -#define GRUB_TERM_TAB '\t' -#define GRUB_TERM_BACKSPACE '\b' +#define VasEBoot_TERM_ESC '\e' +#define VasEBoot_TERM_TAB '\t' +#define VasEBoot_TERM_BACKSPACE '\b' -#define GRUB_PROGRESS_NO_UPDATE -1 -#define GRUB_PROGRESS_FAST 0 -#define GRUB_PROGRESS_SLOW 2 +#define VasEBoot_PROGRESS_NO_UPDATE -1 +#define VasEBoot_PROGRESS_FAST 0 +#define VasEBoot_PROGRESS_SLOW 2 #ifndef ASM_FILE -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* These are used to represent the various color states we use. */ typedef enum { /* The color used to display all text that does not use the user defined colors below. */ - GRUB_TERM_COLOR_STANDARD, + VasEBoot_TERM_COLOR_STANDARD, /* The user defined colors for normal text. */ - GRUB_TERM_COLOR_NORMAL, + VasEBoot_TERM_COLOR_NORMAL, /* The user defined colors for highlighted text. */ - GRUB_TERM_COLOR_HIGHLIGHT + VasEBoot_TERM_COLOR_HIGHLIGHT } -grub_term_color_state; +VasEBoot_term_color_state; /* Flags for representing the capabilities of a terminal. */ /* Some notes about the flags: @@ -94,371 +94,371 @@ grub_term_color_state; to NULL. */ /* Set when input characters shouldn't be echoed back. */ -#define GRUB_TERM_NO_ECHO (1 << 0) +#define VasEBoot_TERM_NO_ECHO (1 << 0) /* Set when the editing feature should be disabled. */ -#define GRUB_TERM_NO_EDIT (1 << 1) +#define VasEBoot_TERM_NO_EDIT (1 << 1) /* Set when the terminal cannot do fancy things. */ -#define GRUB_TERM_DUMB (1 << 2) +#define VasEBoot_TERM_DUMB (1 << 2) /* Which encoding does terminal expect stream to be. */ -#define GRUB_TERM_CODE_TYPE_SHIFT 3 -#define GRUB_TERM_CODE_TYPE_MASK (7 << GRUB_TERM_CODE_TYPE_SHIFT) +#define VasEBoot_TERM_CODE_TYPE_SHIFT 3 +#define VasEBoot_TERM_CODE_TYPE_MASK (7 << VasEBoot_TERM_CODE_TYPE_SHIFT) /* Only ASCII characters accepted. */ -#define GRUB_TERM_CODE_TYPE_ASCII (0 << GRUB_TERM_CODE_TYPE_SHIFT) +#define VasEBoot_TERM_CODE_TYPE_ASCII (0 << VasEBoot_TERM_CODE_TYPE_SHIFT) /* Expects CP-437 characters (ASCII + pseudographics). */ -#define GRUB_TERM_CODE_TYPE_CP437 (1 << GRUB_TERM_CODE_TYPE_SHIFT) +#define VasEBoot_TERM_CODE_TYPE_CP437 (1 << VasEBoot_TERM_CODE_TYPE_SHIFT) /* UTF-8 stream in logical order. Usually used for terminals which just forward the stream to another computer. */ -#define GRUB_TERM_CODE_TYPE_UTF8_LOGICAL (2 << GRUB_TERM_CODE_TYPE_SHIFT) +#define VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL (2 << VasEBoot_TERM_CODE_TYPE_SHIFT) /* UTF-8 in visual order. Like UTF-8 logical but for buggy endpoints. */ -#define GRUB_TERM_CODE_TYPE_UTF8_VISUAL (3 << GRUB_TERM_CODE_TYPE_SHIFT) +#define VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL (3 << VasEBoot_TERM_CODE_TYPE_SHIFT) /* Glyph description in visual order. */ -#define GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS (4 << GRUB_TERM_CODE_TYPE_SHIFT) +#define VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS (4 << VasEBoot_TERM_CODE_TYPE_SHIFT) -/* Bitmasks for modifier keys returned by grub_getkeystatus. */ -#define GRUB_TERM_STATUS_RSHIFT (1 << 0) -#define GRUB_TERM_STATUS_LSHIFT (1 << 1) -#define GRUB_TERM_STATUS_RCTRL (1 << 2) -#define GRUB_TERM_STATUS_RALT (1 << 3) -#define GRUB_TERM_STATUS_SCROLL (1 << 4) -#define GRUB_TERM_STATUS_NUM (1 << 5) -#define GRUB_TERM_STATUS_CAPS (1 << 6) -#define GRUB_TERM_STATUS_LCTRL (1 << 8) -#define GRUB_TERM_STATUS_LALT (1 << 9) +/* Bitmasks for modifier keys returned by VasEBoot_getkeystatus. */ +#define VasEBoot_TERM_STATUS_RSHIFT (1 << 0) +#define VasEBoot_TERM_STATUS_LSHIFT (1 << 1) +#define VasEBoot_TERM_STATUS_RCTRL (1 << 2) +#define VasEBoot_TERM_STATUS_RALT (1 << 3) +#define VasEBoot_TERM_STATUS_SCROLL (1 << 4) +#define VasEBoot_TERM_STATUS_NUM (1 << 5) +#define VasEBoot_TERM_STATUS_CAPS (1 << 6) +#define VasEBoot_TERM_STATUS_LCTRL (1 << 8) +#define VasEBoot_TERM_STATUS_LALT (1 << 9) /* Menu-related geometrical constants. */ /* The number of columns/lines between messages/borders/etc. */ -#define GRUB_TERM_MARGIN 1 +#define VasEBoot_TERM_MARGIN 1 /* The number of columns of scroll information. */ -#define GRUB_TERM_SCROLL_WIDTH 1 +#define VasEBoot_TERM_SCROLL_WIDTH 1 -struct grub_term_input +struct VasEBoot_term_input { /* The next terminal. */ - struct grub_term_input *next; - struct grub_term_input **prev; + struct VasEBoot_term_input *next; + struct VasEBoot_term_input **prev; /* The terminal name. */ const char *name; /* Initialize the terminal. */ - grub_err_t (*init) (struct grub_term_input *term); + VasEBoot_err_t (*init) (struct VasEBoot_term_input *term); /* Clean up the terminal. */ - grub_err_t (*fini) (struct grub_term_input *term); + VasEBoot_err_t (*fini) (struct VasEBoot_term_input *term); /* Get a character if any input character is available. Otherwise return -1 */ - int (*getkey) (struct grub_term_input *term); + int (*getkey) (struct VasEBoot_term_input *term); /* Get keyboard modifier status. */ - int (*getkeystatus) (struct grub_term_input *term); + int (*getkeystatus) (struct VasEBoot_term_input *term); void *data; }; -typedef struct grub_term_input *grub_term_input_t; +typedef struct VasEBoot_term_input *VasEBoot_term_input_t; /* Made in a way to fit into uint32_t and so be passed in a register. */ -struct grub_term_coordinate +struct VasEBoot_term_coordinate { - grub_uint16_t x; - grub_uint16_t y; + VasEBoot_uint16_t x; + VasEBoot_uint16_t y; }; -struct grub_term_output +struct VasEBoot_term_output { /* The next terminal. */ - struct grub_term_output *next; - struct grub_term_output **prev; + struct VasEBoot_term_output *next; + struct VasEBoot_term_output **prev; /* The terminal name. */ const char *name; /* Initialize the terminal. */ - grub_err_t (*init) (struct grub_term_output *term); + VasEBoot_err_t (*init) (struct VasEBoot_term_output *term); /* Clean up the terminal. */ - grub_err_t (*fini) (struct grub_term_output *term); + VasEBoot_err_t (*fini) (struct VasEBoot_term_output *term); /* Put a character. C is encoded in Unicode. */ - void (*putchar) (struct grub_term_output *term, - const struct grub_unicode_glyph *c); + void (*putchar) (struct VasEBoot_term_output *term, + const struct VasEBoot_unicode_glyph *c); /* Get the number of columns occupied by a given character C. C is encoded in Unicode. */ - grub_size_t (*getcharwidth) (struct grub_term_output *term, - const struct grub_unicode_glyph *c); + VasEBoot_size_t (*getcharwidth) (struct VasEBoot_term_output *term, + const struct VasEBoot_unicode_glyph *c); /* Get the screen size. */ - struct grub_term_coordinate (*getwh) (struct grub_term_output *term); + struct VasEBoot_term_coordinate (*getwh) (struct VasEBoot_term_output *term); /* Get the cursor position. The return value is ((X << 8) | Y). */ - struct grub_term_coordinate (*getxy) (struct grub_term_output *term); + struct VasEBoot_term_coordinate (*getxy) (struct VasEBoot_term_output *term); /* Go to the position (X, Y). */ - void (*gotoxy) (struct grub_term_output *term, - struct grub_term_coordinate pos); + void (*gotoxy) (struct VasEBoot_term_output *term, + struct VasEBoot_term_coordinate pos); /* Clear the screen. */ - void (*cls) (struct grub_term_output *term); + void (*cls) (struct VasEBoot_term_output *term); /* Set the current color to be used */ - void (*setcolorstate) (struct grub_term_output *term, - grub_term_color_state state); + void (*setcolorstate) (struct VasEBoot_term_output *term, + VasEBoot_term_color_state state); /* Turn on/off the cursor. */ - void (*setcursor) (struct grub_term_output *term, int on); + void (*setcursor) (struct VasEBoot_term_output *term, int on); /* Update the screen. */ - void (*refresh) (struct grub_term_output *term); + void (*refresh) (struct VasEBoot_term_output *term); /* gfxterm only: put in fullscreen mode. */ - grub_err_t (*fullscreen) (void); + VasEBoot_err_t (*fullscreen) (void); /* The feature flags defined above. */ - grub_uint32_t flags; + VasEBoot_uint32_t flags; /* Progress data. */ - grub_uint32_t progress_update_divisor; - grub_uint32_t progress_update_counter; + VasEBoot_uint32_t progress_update_divisor; + VasEBoot_uint32_t progress_update_counter; void *data; }; -typedef struct grub_term_output *grub_term_output_t; +typedef struct VasEBoot_term_output *VasEBoot_term_output_t; -#define GRUB_TERM_DEFAULT_NORMAL_COLOR 0x07 -#define GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR 0x70 -#define GRUB_TERM_DEFAULT_STANDARD_COLOR 0x07 +#define VasEBoot_TERM_DEFAULT_NORMAL_COLOR 0x07 +#define VasEBoot_TERM_DEFAULT_HIGHLIGHT_COLOR 0x70 +#define VasEBoot_TERM_DEFAULT_STANDARD_COLOR 0x07 /* Current color state. */ -extern grub_uint8_t EXPORT_VAR(grub_term_normal_color); -extern grub_uint8_t EXPORT_VAR(grub_term_highlight_color); +extern VasEBoot_uint8_t EXPORT_VAR(VasEBoot_term_normal_color); +extern VasEBoot_uint8_t EXPORT_VAR(VasEBoot_term_highlight_color); -extern struct grub_term_output *EXPORT_VAR(grub_term_outputs_disabled); -extern struct grub_term_input *EXPORT_VAR(grub_term_inputs_disabled); -extern struct grub_term_output *EXPORT_VAR(grub_term_outputs); -extern struct grub_term_input *EXPORT_VAR(grub_term_inputs); +extern struct VasEBoot_term_output *EXPORT_VAR(VasEBoot_term_outputs_disabled); +extern struct VasEBoot_term_input *EXPORT_VAR(VasEBoot_term_inputs_disabled); +extern struct VasEBoot_term_output *EXPORT_VAR(VasEBoot_term_outputs); +extern struct VasEBoot_term_input *EXPORT_VAR(VasEBoot_term_inputs); static inline void -grub_term_register_input (const char *name __attribute__ ((unused)), - grub_term_input_t term) +VasEBoot_term_register_input (const char *name __attribute__ ((unused)), + VasEBoot_term_input_t term) { - if (grub_term_inputs) - grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs_disabled), - GRUB_AS_LIST (term)); + if (VasEBoot_term_inputs) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_inputs_disabled), + VasEBoot_AS_LIST (term)); else { /* If this is the first terminal, enable automatically. */ - if (! term->init || term->init (term) == GRUB_ERR_NONE) - grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term)); + if (! term->init || term->init (term) == VasEBoot_ERR_NONE) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_inputs), VasEBoot_AS_LIST (term)); } } static inline void -grub_term_register_input_inactive (const char *name __attribute__ ((unused)), - grub_term_input_t term) +VasEBoot_term_register_input_inactive (const char *name __attribute__ ((unused)), + VasEBoot_term_input_t term) { - grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs_disabled), - GRUB_AS_LIST (term)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_inputs_disabled), + VasEBoot_AS_LIST (term)); } static inline void -grub_term_register_input_active (const char *name __attribute__ ((unused)), - grub_term_input_t term) +VasEBoot_term_register_input_active (const char *name __attribute__ ((unused)), + VasEBoot_term_input_t term) { - if (! term->init || term->init (term) == GRUB_ERR_NONE) - grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term)); + if (! term->init || term->init (term) == VasEBoot_ERR_NONE) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_inputs), VasEBoot_AS_LIST (term)); } static inline void -grub_term_register_output (const char *name __attribute__ ((unused)), - grub_term_output_t term) +VasEBoot_term_register_output (const char *name __attribute__ ((unused)), + VasEBoot_term_output_t term) { - if (grub_term_outputs) - grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs_disabled), - GRUB_AS_LIST (term)); + if (VasEBoot_term_outputs) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_outputs_disabled), + VasEBoot_AS_LIST (term)); else { /* If this is the first terminal, enable automatically. */ - if (! term->init || term->init (term) == GRUB_ERR_NONE) - grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs), - GRUB_AS_LIST (term)); + if (! term->init || term->init (term) == VasEBoot_ERR_NONE) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_outputs), + VasEBoot_AS_LIST (term)); } } static inline void -grub_term_register_output_inactive (const char *name __attribute__ ((unused)), - grub_term_output_t term) +VasEBoot_term_register_output_inactive (const char *name __attribute__ ((unused)), + VasEBoot_term_output_t term) { - grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs_disabled), - GRUB_AS_LIST (term)); + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_outputs_disabled), + VasEBoot_AS_LIST (term)); } static inline void -grub_term_register_output_active (const char *name __attribute__ ((unused)), - grub_term_output_t term) +VasEBoot_term_register_output_active (const char *name __attribute__ ((unused)), + VasEBoot_term_output_t term) { - if (! term->init || term->init (term) == GRUB_ERR_NONE) - grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs), - GRUB_AS_LIST (term)); + if (! term->init || term->init (term) == VasEBoot_ERR_NONE) + VasEBoot_list_push (VasEBoot_AS_LIST_P (&VasEBoot_term_outputs), + VasEBoot_AS_LIST (term)); } static inline void -grub_term_unregister_input (grub_term_input_t term) +VasEBoot_term_unregister_input (VasEBoot_term_input_t term) { - grub_list_remove (GRUB_AS_LIST (term)); - grub_list_remove (GRUB_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); } static inline void -grub_term_unregister_output (grub_term_output_t term) +VasEBoot_term_unregister_output (VasEBoot_term_output_t term) { - grub_list_remove (GRUB_AS_LIST (term)); - grub_list_remove (GRUB_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); + VasEBoot_list_remove (VasEBoot_AS_LIST (term)); } -#define FOR_ACTIVE_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_inputs)) -#define FOR_DISABLED_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_inputs_disabled)) -#define FOR_ACTIVE_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs)) -#define FOR_DISABLED_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs_disabled)) +#define FOR_ACTIVE_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_term_inputs)) +#define FOR_DISABLED_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_term_inputs_disabled)) +#define FOR_ACTIVE_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_term_outputs)) +#define FOR_DISABLED_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_term_outputs_disabled)) -void grub_putcode (grub_uint32_t code, struct grub_term_output *term); -int EXPORT_FUNC(grub_getkey) (void); -int EXPORT_FUNC(grub_getkey_noblock) (void); -void grub_cls (void); -void EXPORT_FUNC(grub_refresh) (void); -void grub_puts_terminal (const char *str, struct grub_term_output *term); -struct grub_term_coordinate *grub_term_save_pos (void); -void grub_term_restore_pos (struct grub_term_coordinate *pos); +void VasEBoot_putcode (VasEBoot_uint32_t code, struct VasEBoot_term_output *term); +int EXPORT_FUNC(VasEBoot_getkey) (void); +int EXPORT_FUNC(VasEBoot_getkey_noblock) (void); +void VasEBoot_cls (void); +void EXPORT_FUNC(VasEBoot_refresh) (void); +void VasEBoot_puts_terminal (const char *str, struct VasEBoot_term_output *term); +struct VasEBoot_term_coordinate *VasEBoot_term_save_pos (void); +void VasEBoot_term_restore_pos (struct VasEBoot_term_coordinate *pos); -static inline unsigned grub_term_width (struct grub_term_output *term) +static inline unsigned VasEBoot_term_width (struct VasEBoot_term_output *term) { return term->getwh(term).x ? : 80; } -static inline unsigned grub_term_height (struct grub_term_output *term) +static inline unsigned VasEBoot_term_height (struct VasEBoot_term_output *term) { return term->getwh(term).y ? : 24; } -static inline struct grub_term_coordinate -grub_term_getxy (struct grub_term_output *term) +static inline struct VasEBoot_term_coordinate +VasEBoot_term_getxy (struct VasEBoot_term_output *term) { return term->getxy (term); } static inline void -grub_term_refresh (struct grub_term_output *term) +VasEBoot_term_refresh (struct VasEBoot_term_output *term) { if (term->refresh) term->refresh (term); } static inline void -grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos) +VasEBoot_term_gotoxy (struct VasEBoot_term_output *term, struct VasEBoot_term_coordinate pos) { term->gotoxy (term, pos); } static inline void -grub_term_setcolorstate (struct grub_term_output *term, - grub_term_color_state state) +VasEBoot_term_setcolorstate (struct VasEBoot_term_output *term, + VasEBoot_term_color_state state) { if (term->setcolorstate) term->setcolorstate (term, state); } static inline void -grub_setcolorstate (grub_term_color_state state) +VasEBoot_setcolorstate (VasEBoot_term_color_state state) { - struct grub_term_output *term; + struct VasEBoot_term_output *term; FOR_ACTIVE_TERM_OUTPUTS(term) - grub_term_setcolorstate (term, state); + VasEBoot_term_setcolorstate (term, state); } /* Turn on/off the cursor. */ static inline void -grub_term_setcursor (struct grub_term_output *term, int on) +VasEBoot_term_setcursor (struct VasEBoot_term_output *term, int on) { if (term->setcursor) term->setcursor (term, on); } static inline void -grub_term_cls (struct grub_term_output *term) +VasEBoot_term_cls (struct VasEBoot_term_output *term) { if (term->cls) (term->cls) (term); else { - grub_putcode ('\n', term); - grub_term_refresh (term); + VasEBoot_putcode ('\n', term); + VasEBoot_term_refresh (term); } } #if HAVE_FONT_SOURCE -grub_size_t -grub_unicode_estimate_width (const struct grub_unicode_glyph *c); +VasEBoot_size_t +VasEBoot_unicode_estimate_width (const struct VasEBoot_unicode_glyph *c); #else -static inline grub_size_t -grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused))) +static inline VasEBoot_size_t +VasEBoot_unicode_estimate_width (const struct VasEBoot_unicode_glyph *c __attribute__ ((unused))) { - if (grub_unicode_get_comb_type (c->base)) + if (VasEBoot_unicode_get_comb_type (c->base)) return 0; return 1; } #endif -#define GRUB_TERM_TAB_WIDTH 8 +#define VasEBoot_TERM_TAB_WIDTH 8 -static inline grub_size_t -grub_term_getcharwidth (struct grub_term_output *term, - const struct grub_unicode_glyph *c) +static inline VasEBoot_size_t +VasEBoot_term_getcharwidth (struct VasEBoot_term_output *term, + const struct VasEBoot_unicode_glyph *c) { if (c->base == '\t') - return GRUB_TERM_TAB_WIDTH; + return VasEBoot_TERM_TAB_WIDTH; if (term->getcharwidth) return term->getcharwidth (term, c); - else if (((term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_UTF8_LOGICAL) - || ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_UTF8_VISUAL) - || ((term->flags & GRUB_TERM_CODE_TYPE_MASK) - == GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS)) - return grub_unicode_estimate_width (c); + else if (((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_UTF8_LOGICAL) + || ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_UTF8_VISUAL) + || ((term->flags & VasEBoot_TERM_CODE_TYPE_MASK) + == VasEBoot_TERM_CODE_TYPE_VISUAL_GLYPHS)) + return VasEBoot_unicode_estimate_width (c); else return 1; } -struct grub_term_autoload +struct VasEBoot_term_autoload { - struct grub_term_autoload *next; + struct VasEBoot_term_autoload *next; char *name; char *modname; }; -extern struct grub_term_autoload *grub_term_input_autoload; -extern struct grub_term_autoload *grub_term_output_autoload; +extern struct VasEBoot_term_autoload *VasEBoot_term_input_autoload; +extern struct VasEBoot_term_autoload *VasEBoot_term_output_autoload; static inline void -grub_print_spaces (struct grub_term_output *term, int number_spaces) +VasEBoot_print_spaces (struct VasEBoot_term_output *term, int number_spaces) { while (--number_spaces >= 0) - grub_putcode (' ', term); + VasEBoot_putcode (' ', term); } -extern void (*EXPORT_VAR (grub_term_poll_usb)) (int wait_for_completion); +extern void (*EXPORT_VAR (VasEBoot_term_poll_usb)) (int wait_for_completion); -#define GRUB_TERM_REPEAT_PRE_INTERVAL 400 -#define GRUB_TERM_REPEAT_INTERVAL 50 +#define VasEBoot_TERM_REPEAT_PRE_INTERVAL 400 +#define VasEBoot_TERM_REPEAT_INTERVAL 50 #endif /* ! ASM_FILE */ -#endif /* ! GRUB_TERM_HEADER */ +#endif /* ! VasEBoot_TERM_HEADER */ diff --git a/include/VasEBoot/terminfo.h b/include/VasEBoot/terminfo.h index 8a109ecfd..4a21f1659 100644 --- a/include/VasEBoot/terminfo.h +++ b/include/VasEBoot/terminfo.h @@ -1,47 +1,47 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TERMINFO_HEADER -#define GRUB_TERMINFO_HEADER 1 +#ifndef VasEBoot_TERMINFO_HEADER +#define VasEBoot_TERMINFO_HEADER 1 -#include -#include -#include +#include +#include +#include -char *EXPORT_FUNC(grub_terminfo_get_current) (struct grub_term_output *term); -grub_err_t EXPORT_FUNC(grub_terminfo_set_current) (struct grub_term_output *term, +char *EXPORT_FUNC(VasEBoot_terminfo_get_current) (struct VasEBoot_term_output *term); +VasEBoot_err_t EXPORT_FUNC(VasEBoot_terminfo_set_current) (struct VasEBoot_term_output *term, const char *); -#define GRUB_TERMINFO_READKEY_MAX_LEN 6 -struct grub_terminfo_input_state +#define VasEBoot_TERMINFO_READKEY_MAX_LEN 6 +struct VasEBoot_terminfo_input_state { - int input_buf[GRUB_TERMINFO_READKEY_MAX_LEN]; + int input_buf[VasEBoot_TERMINFO_READKEY_MAX_LEN]; int npending; -#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275) +#if defined(__powerpc__) && defined(VasEBoot_MACHINE_IEEE1275) int last_key; - grub_uint64_t last_key_time; + VasEBoot_uint64_t last_key_time; #endif - int (*readkey) (struct grub_term_input *term); + int (*readkey) (struct VasEBoot_term_input *term); }; -struct grub_terminfo_output_state +struct VasEBoot_terminfo_output_state { - struct grub_term_output *next; + struct VasEBoot_term_output *next; char *name; @@ -53,35 +53,35 @@ struct grub_terminfo_output_state char *cursor_off; char *setcolor; - struct grub_term_coordinate size; - struct grub_term_coordinate pos; + struct VasEBoot_term_coordinate size; + struct VasEBoot_term_coordinate pos; - void (*put) (struct grub_term_output *term, const int c); + void (*put) (struct VasEBoot_term_output *term, const int c); }; -grub_err_t EXPORT_FUNC(grub_terminfo_output_init) (struct grub_term_output *term); -void EXPORT_FUNC(grub_terminfo_gotoxy) (grub_term_output_t term, - struct grub_term_coordinate pos); -void EXPORT_FUNC(grub_terminfo_cls) (grub_term_output_t term); -struct grub_term_coordinate EXPORT_FUNC (grub_terminfo_getxy) (struct grub_term_output *term); -void EXPORT_FUNC (grub_terminfo_setcursor) (struct grub_term_output *term, +VasEBoot_err_t EXPORT_FUNC(VasEBoot_terminfo_output_init) (struct VasEBoot_term_output *term); +void EXPORT_FUNC(VasEBoot_terminfo_gotoxy) (VasEBoot_term_output_t term, + struct VasEBoot_term_coordinate pos); +void EXPORT_FUNC(VasEBoot_terminfo_cls) (VasEBoot_term_output_t term); +struct VasEBoot_term_coordinate EXPORT_FUNC (VasEBoot_terminfo_getxy) (struct VasEBoot_term_output *term); +void EXPORT_FUNC (VasEBoot_terminfo_setcursor) (struct VasEBoot_term_output *term, const int on); -void EXPORT_FUNC (grub_terminfo_setcolorstate) (struct grub_term_output *term, - const grub_term_color_state state); +void EXPORT_FUNC (VasEBoot_terminfo_setcolorstate) (struct VasEBoot_term_output *term, + const VasEBoot_term_color_state state); -grub_err_t EXPORT_FUNC (grub_terminfo_input_init) (struct grub_term_input *term); -int EXPORT_FUNC (grub_terminfo_getkey) (struct grub_term_input *term); -void EXPORT_FUNC (grub_terminfo_putchar) (struct grub_term_output *term, - const struct grub_unicode_glyph *c); -struct grub_term_coordinate EXPORT_FUNC (grub_terminfo_getwh) (struct grub_term_output *term); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_terminfo_input_init) (struct VasEBoot_term_input *term); +int EXPORT_FUNC (VasEBoot_terminfo_getkey) (struct VasEBoot_term_input *term); +void EXPORT_FUNC (VasEBoot_terminfo_putchar) (struct VasEBoot_term_output *term, + const struct VasEBoot_unicode_glyph *c); +struct VasEBoot_term_coordinate EXPORT_FUNC (VasEBoot_terminfo_getwh) (struct VasEBoot_term_output *term); -grub_err_t EXPORT_FUNC (grub_terminfo_output_register) (struct grub_term_output *term, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_terminfo_output_register) (struct VasEBoot_term_output *term, const char *type); -grub_err_t EXPORT_FUNC (grub_terminfo_output_unregister) (struct grub_term_output *term); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_terminfo_output_unregister) (struct VasEBoot_term_output *term); -void grub_terminfo_init (void); -void grub_terminfo_fini (void); +void VasEBoot_terminfo_init (void); +void VasEBoot_terminfo_fini (void); -#endif /* ! GRUB_TERMINFO_HEADER */ +#endif /* ! VasEBoot_TERMINFO_HEADER */ diff --git a/include/VasEBoot/test.h b/include/VasEBoot/test.h index b83bdb14e..7eb088ad9 100644 --- a/include/VasEBoot/test.h +++ b/include/VasEBoot/test.h @@ -1,42 +1,42 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TEST_HEADER -#define GRUB_TEST_HEADER +#ifndef VasEBoot_TEST_HEADER +#define VasEBoot_TEST_HEADER -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include +#include +#include #ifdef __cplusplus extern "C" { #endif -struct grub_test +struct VasEBoot_test { /* The next test. */ - struct grub_test *next; - struct grub_test **prev; + struct VasEBoot_test *next; + struct VasEBoot_test **prev; /* The test name. */ char *name; @@ -44,82 +44,82 @@ struct grub_test /* The test main function. */ void (*main) (void); }; -typedef struct grub_test *grub_test_t; +typedef struct VasEBoot_test *VasEBoot_test_t; -extern grub_test_t grub_test_list; +extern VasEBoot_test_t VasEBoot_test_list; -void grub_test_register (const char *name, void (*test) (void)); -void grub_test_unregister (const char *name); +void VasEBoot_test_register (const char *name, void (*test) (void)); +void VasEBoot_test_unregister (const char *name); /* Execute a test and print results. */ -int grub_test_run (grub_test_t test); +int VasEBoot_test_run (VasEBoot_test_t test); /* Test `cond' for nonzero; log failure otherwise. */ -void grub_test_nonzero (int cond, const char *file, - const char *func, grub_uint32_t line, +void VasEBoot_test_nonzero (int cond, const char *file, + const char *func, VasEBoot_uint32_t line, const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 5, 6))); /* Macro to fill in location details and an optional error message. */ -void grub_test_assert_helper (int cond, const char *file, - const char *func, grub_uint32_t line, +void VasEBoot_test_assert_helper (int cond, const char *file, + const char *func, VasEBoot_uint32_t line, const char *condstr, const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 6, 7))); -#define grub_test_assert(cond, ...) \ - grub_test_assert_helper(cond, GRUB_FILE, __FUNCTION__, __LINE__, \ +#define VasEBoot_test_assert(cond, ...) \ + VasEBoot_test_assert_helper(cond, VasEBoot_FILE, __FUNCTION__, __LINE__, \ #cond, ## __VA_ARGS__); -void grub_unit_test_init (void); -void grub_unit_test_fini (void); +void VasEBoot_unit_test_init (void); +void VasEBoot_unit_test_fini (void); /* Macro to define a unit test. */ -#define GRUB_UNIT_TEST(name, funp) \ - void grub_unit_test_init (void) \ +#define VasEBoot_UNIT_TEST(name, funp) \ + void VasEBoot_unit_test_init (void) \ { \ - grub_test_register (name, funp); \ + VasEBoot_test_register (name, funp); \ } \ \ - void grub_unit_test_fini (void) \ + void VasEBoot_unit_test_fini (void) \ { \ - grub_test_unregister (name); \ + VasEBoot_test_unregister (name); \ } /* Macro to define a functional test. */ -#define GRUB_FUNCTIONAL_TEST(name, funp) \ - GRUB_MOD_INIT(name) \ +#define VasEBoot_FUNCTIONAL_TEST(name, funp) \ + VasEBoot_MOD_INIT(name) \ { \ - grub_test_register (#name, funp); \ + VasEBoot_test_register (#name, funp); \ } \ \ - GRUB_MOD_FINI(name) \ + VasEBoot_MOD_FINI(name) \ { \ - grub_test_unregister (#name); \ + VasEBoot_test_unregister (#name); \ } void -grub_video_checksum (const char *basename_in); +VasEBoot_video_checksum (const char *basename_in); void -grub_video_checksum_end (void); +VasEBoot_video_checksum_end (void); void -grub_terminal_input_fake_sequence (int *seq_in, int nseq_in); +VasEBoot_terminal_input_fake_sequence (int *seq_in, int nseq_in); void -grub_terminal_input_fake_sequence_end (void); +VasEBoot_terminal_input_fake_sequence_end (void); const char * -grub_video_checksum_get_modename (void); +VasEBoot_video_checksum_get_modename (void); -#define GRUB_TEST_VIDEO_SMALL_N_MODES 7 -#define GRUB_TEST_VIDEO_ALL_N_MODES 31 +#define VasEBoot_TEST_VIDEO_SMALL_N_MODES 7 +#define VasEBoot_TEST_VIDEO_ALL_N_MODES 31 -extern struct grub_video_mode_info grub_test_video_modes[GRUB_TEST_VIDEO_ALL_N_MODES]; +extern struct VasEBoot_video_mode_info VasEBoot_test_video_modes[VasEBoot_TEST_VIDEO_ALL_N_MODES]; int -grub_test_use_gfxterm (void); -void grub_test_use_gfxterm_end (void); +VasEBoot_test_use_gfxterm (void); +void VasEBoot_test_use_gfxterm_end (void); #ifdef __cplusplus } #endif -#endif /* ! GRUB_TEST_HEADER */ +#endif /* ! VasEBoot_TEST_HEADER */ diff --git a/include/VasEBoot/time.h b/include/VasEBoot/time.h index c919c1f0b..5dd1dab29 100644 --- a/include/VasEBoot/time.h +++ b/include/VasEBoot/time.h @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007, 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_TIME_HEADER #define KERNEL_TIME_HEADER 1 -#include -#include -#if !defined(GRUB_MACHINE_EMU) && !defined(GRUB_UTIL) -#include +#include +#include +#if !defined(VasEBoot_MACHINE_EMU) && !defined(VasEBoot_UTIL) +#include #else static inline void -grub_cpu_idle(void) +VasEBoot_cpu_idle(void) { } #endif -void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms); -grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void); +void EXPORT_FUNC(VasEBoot_millisleep) (VasEBoot_uint32_t ms); +VasEBoot_uint64_t EXPORT_FUNC(VasEBoot_get_time_ms) (void); -grub_uint64_t grub_rtc_get_time_ms (void); +VasEBoot_uint64_t VasEBoot_rtc_get_time_ms (void); static __inline void -grub_sleep (grub_uint32_t s) +VasEBoot_sleep (VasEBoot_uint32_t s) { - grub_millisleep (1000 * s); + VasEBoot_millisleep (1000 * s); } -void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void)); +void VasEBoot_install_get_time_ms (VasEBoot_uint64_t (*get_time_ms_func) (void)); #endif /* ! KERNEL_TIME_HEADER */ diff --git a/include/VasEBoot/tparm.h b/include/VasEBoot/tparm.h index 0c6f9e0f0..9ac9ce86f 100644 --- a/include/VasEBoot/tparm.h +++ b/include/VasEBoot/tparm.h @@ -1,26 +1,26 @@ /* tparm.h - parameter formatting of terminfo */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TPARM_HEADER -#define GRUB_TPARM_HEADER 1 +#ifndef VasEBoot_TPARM_HEADER +#define VasEBoot_TPARM_HEADER 1 /* Function prototypes. */ -const char *grub_terminfo_tparm (const char *string, ...); +const char *VasEBoot_terminfo_tparm (const char *string, ...); -#endif /* ! GRUB_TPARM_HEADER */ +#endif /* ! VasEBoot_TPARM_HEADER */ diff --git a/include/VasEBoot/tpm.h b/include/VasEBoot/tpm.h index 972a5edc8..83d8e6630 100644 --- a/include/VasEBoot/tpm.h +++ b/include/VasEBoot/tpm.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2015 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TPM_HEADER -#define GRUB_TPM_HEADER 1 +#ifndef VasEBoot_TPM_HEADER +#define VasEBoot_TPM_HEADER 1 #define SHA1_DIGEST_SIZE 20 @@ -26,8 +26,8 @@ #define TPM_AUTHFAIL (TPM_BASE + 0x1) #define TPM_BADINDEX (TPM_BASE + 0x2) -#define GRUB_ASCII_PCR 8 -#define GRUB_BINARY_PCR 9 +#define VasEBoot_ASCII_PCR 8 +#define VasEBoot_BINARY_PCR 9 #define TPM_TAG_RQU_COMMAND 0x00C1 #define TPM_ORD_Extend 0x14 @@ -36,55 +36,55 @@ /* TCG_PassThroughToTPM Input Parameter Block */ typedef struct { - grub_uint16_t IPBLength; - grub_uint16_t Reserved1; - grub_uint16_t OPBLength; - grub_uint16_t Reserved2; - grub_uint8_t TPMOperandIn[1]; -} GRUB_PACKED PassThroughToTPM_InputParamBlock; + VasEBoot_uint16_t IPBLength; + VasEBoot_uint16_t Reserved1; + VasEBoot_uint16_t OPBLength; + VasEBoot_uint16_t Reserved2; + VasEBoot_uint8_t TPMOperandIn[1]; +} VasEBoot_PACKED PassThroughToTPM_InputParamBlock; /* TCG_PassThroughToTPM Output Parameter Block */ typedef struct { - grub_uint16_t OPBLength; - grub_uint16_t Reserved; - grub_uint8_t TPMOperandOut[1]; -} GRUB_PACKED PassThroughToTPM_OutputParamBlock; + VasEBoot_uint16_t OPBLength; + VasEBoot_uint16_t Reserved; + VasEBoot_uint8_t TPMOperandOut[1]; +} VasEBoot_PACKED PassThroughToTPM_OutputParamBlock; typedef struct { - grub_uint16_t tag; - grub_uint32_t paramSize; - grub_uint32_t ordinal; - grub_uint32_t pcrNum; - grub_uint8_t inDigest[SHA1_DIGEST_SIZE]; /* The 160 bit value representing the event to be recorded. */ -} GRUB_PACKED ExtendIncoming; + VasEBoot_uint16_t tag; + VasEBoot_uint32_t paramSize; + VasEBoot_uint32_t ordinal; + VasEBoot_uint32_t pcrNum; + VasEBoot_uint8_t inDigest[SHA1_DIGEST_SIZE]; /* The 160 bit value representing the event to be recorded. */ +} VasEBoot_PACKED ExtendIncoming; /* TPM_Extend Outgoing Operand */ typedef struct { - grub_uint16_t tag; - grub_uint32_t paramSize; - grub_uint32_t returnCode; - grub_uint8_t outDigest[SHA1_DIGEST_SIZE]; /* The PCR value after execution of the command. */ -} GRUB_PACKED ExtendOutgoing; + VasEBoot_uint16_t tag; + VasEBoot_uint32_t paramSize; + VasEBoot_uint32_t returnCode; + VasEBoot_uint8_t outDigest[SHA1_DIGEST_SIZE]; /* The PCR value after execution of the command. */ +} VasEBoot_PACKED ExtendOutgoing; -grub_err_t EXPORT_FUNC(grub_tpm_measure) (unsigned char *buf, grub_size_t size, - grub_uint8_t pcr, const char *kind, +VasEBoot_err_t EXPORT_FUNC(VasEBoot_tpm_measure) (unsigned char *buf, VasEBoot_size_t size, + VasEBoot_uint8_t pcr, const char *kind, const char *description); -#if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) -grub_err_t grub_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, +#if defined (VasEBoot_MACHINE_EFI) || defined (VasEBoot_MACHINE_PCBIOS) +VasEBoot_err_t VasEBoot_tpm_execute(PassThroughToTPM_InputParamBlock *inbuf, PassThroughToTPM_OutputParamBlock *outbuf); -grub_err_t grub_tpm_log_event(unsigned char *buf, grub_size_t size, - grub_uint8_t pcr, const char *description); +VasEBoot_err_t VasEBoot_tpm_log_event(unsigned char *buf, VasEBoot_size_t size, + VasEBoot_uint8_t pcr, const char *description); #else -static inline grub_err_t grub_tpm_execute( +static inline VasEBoot_err_t VasEBoot_tpm_execute( PassThroughToTPM_InputParamBlock *inbuf __attribute__ ((unused)), PassThroughToTPM_OutputParamBlock *outbuf __attribute__ ((unused))) { return 0; }; -static inline grub_err_t grub_tpm_log_event( +static inline VasEBoot_err_t VasEBoot_tpm_log_event( unsigned char *buf __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused)), - grub_uint8_t pcr __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused)), + VasEBoot_uint8_t pcr __attribute__ ((unused)), const char *description __attribute__ ((unused))) { return 0; diff --git a/include/VasEBoot/trig.h b/include/VasEBoot/trig.h index f19617c90..9436e6249 100644 --- a/include/VasEBoot/trig.h +++ b/include/VasEBoot/trig.h @@ -1,44 +1,44 @@ /* trig.h - Trigonometric function support. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TRIG_HEADER -#define GRUB_TRIG_HEADER 1 +#ifndef VasEBoot_TRIG_HEADER +#define VasEBoot_TRIG_HEADER 1 -#define GRUB_TRIG_ANGLE_MAX 256 -#define GRUB_TRIG_ANGLE_MASK 255 -#define GRUB_TRIG_FRACTION_SCALE 16384 +#define VasEBoot_TRIG_ANGLE_MAX 256 +#define VasEBoot_TRIG_ANGLE_MASK 255 +#define VasEBoot_TRIG_FRACTION_SCALE 16384 -extern const short grub_trig_sintab[]; -extern const short grub_trig_costab[]; +extern const short VasEBoot_trig_sintab[]; +extern const short VasEBoot_trig_costab[]; static __inline int -grub_sin (int x) +VasEBoot_sin (int x) { - x &= GRUB_TRIG_ANGLE_MASK; - return grub_trig_sintab[x]; + x &= VasEBoot_TRIG_ANGLE_MASK; + return VasEBoot_trig_sintab[x]; } static __inline int -grub_cos (int x) +VasEBoot_cos (int x) { - x &= GRUB_TRIG_ANGLE_MASK; - return grub_trig_costab[x]; + x &= VasEBoot_TRIG_ANGLE_MASK; + return VasEBoot_trig_costab[x]; } -#endif /* ! GRUB_TRIG_HEADER */ +#endif /* ! VasEBoot_TRIG_HEADER */ diff --git a/include/VasEBoot/types.h b/include/VasEBoot/types.h index b93e48201..94575f94e 100644 --- a/include/VasEBoot/types.h +++ b/include/VasEBoot/types.h @@ -1,319 +1,319 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_HEADER -#define GRUB_TYPES_HEADER 1 +#ifndef VasEBoot_TYPES_HEADER +#define VasEBoot_TYPES_HEADER 1 #include -#ifndef GRUB_UTIL -#include +#ifndef VasEBoot_UTIL +#include #endif #ifdef __MINGW32__ -#define GRUB_PACKED __attribute__ ((packed,gcc_struct)) +#define VasEBoot_PACKED __attribute__ ((packed,gcc_struct)) #else -#define GRUB_PACKED __attribute__ ((packed)) +#define VasEBoot_PACKED __attribute__ ((packed)) #endif -#ifdef GRUB_BUILD -# define GRUB_CPU_SIZEOF_VOID_P BUILD_SIZEOF_VOID_P -# define GRUB_CPU_SIZEOF_LONG BUILD_SIZEOF_LONG +#ifdef VasEBoot_BUILD +# define VasEBoot_CPU_SIZEOF_VOID_P BUILD_SIZEOF_VOID_P +# define VasEBoot_CPU_SIZEOF_LONG BUILD_SIZEOF_LONG # if BUILD_WORDS_BIGENDIAN -# define GRUB_CPU_WORDS_BIGENDIAN 1 +# define VasEBoot_CPU_WORDS_BIGENDIAN 1 # else -# undef GRUB_CPU_WORDS_BIGENDIAN +# undef VasEBoot_CPU_WORDS_BIGENDIAN # endif -#elif defined (GRUB_UTIL) -# define GRUB_CPU_SIZEOF_VOID_P SIZEOF_VOID_P -# define GRUB_CPU_SIZEOF_LONG SIZEOF_LONG +#elif defined (VasEBoot_UTIL) +# define VasEBoot_CPU_SIZEOF_VOID_P SIZEOF_VOID_P +# define VasEBoot_CPU_SIZEOF_LONG SIZEOF_LONG # ifdef WORDS_BIGENDIAN -# define GRUB_CPU_WORDS_BIGENDIAN 1 +# define VasEBoot_CPU_WORDS_BIGENDIAN 1 # else -# undef GRUB_CPU_WORDS_BIGENDIAN +# undef VasEBoot_CPU_WORDS_BIGENDIAN # endif -#else /* ! GRUB_UTIL */ -# define GRUB_CPU_SIZEOF_VOID_P GRUB_TARGET_SIZEOF_VOID_P -# define GRUB_CPU_SIZEOF_LONG GRUB_TARGET_SIZEOF_LONG -# ifdef GRUB_TARGET_WORDS_BIGENDIAN -# define GRUB_CPU_WORDS_BIGENDIAN 1 +#else /* ! VasEBoot_UTIL */ +# define VasEBoot_CPU_SIZEOF_VOID_P VasEBoot_TARGET_SIZEOF_VOID_P +# define VasEBoot_CPU_SIZEOF_LONG VasEBoot_TARGET_SIZEOF_LONG +# ifdef VasEBoot_TARGET_WORDS_BIGENDIAN +# define VasEBoot_CPU_WORDS_BIGENDIAN 1 # else -# undef GRUB_CPU_WORDS_BIGENDIAN +# undef VasEBoot_CPU_WORDS_BIGENDIAN # endif -#endif /* ! GRUB_UTIL */ +#endif /* ! VasEBoot_UTIL */ -#if GRUB_CPU_SIZEOF_VOID_P != 4 && GRUB_CPU_SIZEOF_VOID_P != 8 +#if VasEBoot_CPU_SIZEOF_VOID_P != 4 && VasEBoot_CPU_SIZEOF_VOID_P != 8 # error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8" #endif -#if GRUB_CPU_SIZEOF_LONG != 4 && GRUB_CPU_SIZEOF_LONG != 8 +#if VasEBoot_CPU_SIZEOF_LONG != 4 && VasEBoot_CPU_SIZEOF_LONG != 8 # error "This architecture is not supported because sizeof(long) != 4 and sizeof(long) != 8" #endif -#if !defined (GRUB_UTIL) && !defined (GRUB_TARGET_WORDSIZE) -# if GRUB_TARGET_SIZEOF_VOID_P == 4 -# define GRUB_TARGET_WORDSIZE 32 -# elif GRUB_TARGET_SIZEOF_VOID_P == 8 -# define GRUB_TARGET_WORDSIZE 64 +#if !defined (VasEBoot_UTIL) && !defined (VasEBoot_TARGET_WORDSIZE) +# if VasEBoot_TARGET_SIZEOF_VOID_P == 4 +# define VasEBoot_TARGET_WORDSIZE 32 +# elif VasEBoot_TARGET_SIZEOF_VOID_P == 8 +# define VasEBoot_TARGET_WORDSIZE 64 # endif #endif /* Define various wide integers. */ -typedef signed char grub_int8_t; -typedef short grub_int16_t; -typedef int grub_int32_t; -#if GRUB_CPU_SIZEOF_LONG == 8 -typedef long grub_int64_t; +typedef signed char VasEBoot_int8_t; +typedef short VasEBoot_int16_t; +typedef int VasEBoot_int32_t; +#if VasEBoot_CPU_SIZEOF_LONG == 8 +typedef long VasEBoot_int64_t; #else -typedef long long grub_int64_t; +typedef long long VasEBoot_int64_t; #endif -typedef unsigned char grub_uint8_t; -typedef unsigned short grub_uint16_t; -typedef unsigned grub_uint32_t; -# define PRIxGRUB_UINT32_T "x" -# define PRIuGRUB_UINT32_T "u" -#if GRUB_CPU_SIZEOF_LONG == 8 -typedef unsigned long grub_uint64_t; -# define PRIxGRUB_UINT64_T "lx" -# define PRIuGRUB_UINT64_T "lu" +typedef unsigned char VasEBoot_uint8_t; +typedef unsigned short VasEBoot_uint16_t; +typedef unsigned VasEBoot_uint32_t; +# define PRIxVasEBoot_UINT32_T "x" +# define PRIuVasEBoot_UINT32_T "u" +#if VasEBoot_CPU_SIZEOF_LONG == 8 +typedef unsigned long VasEBoot_uint64_t; +# define PRIxVasEBoot_UINT64_T "lx" +# define PRIuVasEBoot_UINT64_T "lu" #else -typedef unsigned long long grub_uint64_t; -# define PRIxGRUB_UINT64_T "llx" -# define PRIuGRUB_UINT64_T "llu" +typedef unsigned long long VasEBoot_uint64_t; +# define PRIxVasEBoot_UINT64_T "llx" +# define PRIuVasEBoot_UINT64_T "llu" #endif /* Misc types. */ -#if GRUB_CPU_SIZEOF_VOID_P == 8 -typedef grub_uint64_t grub_addr_t; -typedef grub_uint64_t grub_size_t; -typedef grub_int64_t grub_ssize_t; +#if VasEBoot_CPU_SIZEOF_VOID_P == 8 +typedef VasEBoot_uint64_t VasEBoot_addr_t; +typedef VasEBoot_uint64_t VasEBoot_size_t; +typedef VasEBoot_int64_t VasEBoot_ssize_t; -# define GRUB_SIZE_MAX 18446744073709551615UL +# define VasEBoot_SIZE_MAX 18446744073709551615UL -# if GRUB_CPU_SIZEOF_LONG == 8 -# define PRIxGRUB_SIZE "lx" -# define PRIxGRUB_ADDR "lx" -# define PRIuGRUB_SIZE "lu" -# define PRIdGRUB_SSIZE "ld" +# if VasEBoot_CPU_SIZEOF_LONG == 8 +# define PRIxVasEBoot_SIZE "lx" +# define PRIxVasEBoot_ADDR "lx" +# define PRIuVasEBoot_SIZE "lu" +# define PRIdVasEBoot_SSIZE "ld" # else -# define PRIxGRUB_SIZE "llx" -# define PRIxGRUB_ADDR "llx" -# define PRIuGRUB_SIZE "llu" -# define PRIdGRUB_SSIZE "lld" +# define PRIxVasEBoot_SIZE "llx" +# define PRIxVasEBoot_ADDR "llx" +# define PRIuVasEBoot_SIZE "llu" +# define PRIdVasEBoot_SSIZE "lld" # endif #else -typedef grub_uint32_t grub_addr_t; -typedef grub_uint32_t grub_size_t; -typedef grub_int32_t grub_ssize_t; +typedef VasEBoot_uint32_t VasEBoot_addr_t; +typedef VasEBoot_uint32_t VasEBoot_size_t; +typedef VasEBoot_int32_t VasEBoot_ssize_t; -# define GRUB_SIZE_MAX 4294967295UL +# define VasEBoot_SIZE_MAX 4294967295UL -# define PRIxGRUB_SIZE "x" -# define PRIxGRUB_ADDR "x" -# define PRIuGRUB_SIZE "u" -# define PRIdGRUB_SSIZE "d" +# define PRIxVasEBoot_SIZE "x" +# define PRIxVasEBoot_ADDR "x" +# define PRIuVasEBoot_SIZE "u" +# define PRIdVasEBoot_SSIZE "d" #endif -#define GRUB_UCHAR_MAX 0xFF -#define GRUB_USHRT_MAX 65535 -#define GRUB_SHRT_MAX 0x7fff -#define GRUB_UINT_MAX 4294967295U -#define GRUB_INT_MAX 0x7fffffff -#define GRUB_INT32_MIN (-2147483647 - 1) -#define GRUB_INT32_MAX 2147483647 +#define VasEBoot_UCHAR_MAX 0xFF +#define VasEBoot_USHRT_MAX 65535 +#define VasEBoot_SHRT_MAX 0x7fff +#define VasEBoot_UINT_MAX 4294967295U +#define VasEBoot_INT_MAX 0x7fffffff +#define VasEBoot_INT32_MIN (-2147483647 - 1) +#define VasEBoot_INT32_MAX 2147483647 -#if GRUB_CPU_SIZEOF_LONG == 8 -# define GRUB_ULONG_MAX 18446744073709551615UL -# define GRUB_LONG_MAX 9223372036854775807L -# define GRUB_LONG_MIN (-9223372036854775807L - 1) +#if VasEBoot_CPU_SIZEOF_LONG == 8 +# define VasEBoot_ULONG_MAX 18446744073709551615UL +# define VasEBoot_LONG_MAX 9223372036854775807L +# define VasEBoot_LONG_MIN (-9223372036854775807L - 1) #else -# define GRUB_ULONG_MAX 4294967295UL -# define GRUB_LONG_MAX 2147483647L -# define GRUB_LONG_MIN (-2147483647L - 1) +# define VasEBoot_ULONG_MAX 4294967295UL +# define VasEBoot_LONG_MAX 2147483647L +# define VasEBoot_LONG_MIN (-2147483647L - 1) #endif -typedef grub_uint64_t grub_properly_aligned_t; +typedef VasEBoot_uint64_t VasEBoot_properly_aligned_t; -#define GRUB_PROPERLY_ALIGNED_ARRAY(name, size) grub_properly_aligned_t name[((size) + sizeof (grub_properly_aligned_t) - 1) / sizeof (grub_properly_aligned_t)] +#define VasEBoot_PROPERLY_ALIGNED_ARRAY(name, size) VasEBoot_properly_aligned_t name[((size) + sizeof (VasEBoot_properly_aligned_t) - 1) / sizeof (VasEBoot_properly_aligned_t)] /* The type for representing a file offset. */ -typedef grub_uint64_t grub_off_t; +typedef VasEBoot_uint64_t VasEBoot_off_t; /* The type for representing a disk block address. */ -typedef grub_uint64_t grub_disk_addr_t; +typedef VasEBoot_uint64_t VasEBoot_disk_addr_t; /* Byte-orders. */ -static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x) +static inline VasEBoot_uint16_t VasEBoot_swap_bytes16(VasEBoot_uint16_t _x) { - return (grub_uint16_t) ((_x << 8) | (_x >> 8)); + return (VasEBoot_uint16_t) ((_x << 8) | (_x >> 8)); } -#define grub_swap_bytes16_compile_time(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) -#define grub_swap_bytes32_compile_time(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000UL) >> 24)) -#define grub_swap_bytes64_compile_time(x) \ +#define VasEBoot_swap_bytes16_compile_time(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) +#define VasEBoot_swap_bytes32_compile_time(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000UL) >> 24)) +#define VasEBoot_swap_bytes64_compile_time(x) \ ({ \ - grub_uint64_t _x = (x); \ - (grub_uint64_t) ((_x << 56) \ - | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) \ - | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) \ - | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) \ - | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) \ - | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) \ - | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) \ + VasEBoot_uint64_t _x = (x); \ + (VasEBoot_uint64_t) ((_x << 56) \ + | ((_x & (VasEBoot_uint64_t) 0xFF00ULL) << 40) \ + | ((_x & (VasEBoot_uint64_t) 0xFF0000ULL) << 24) \ + | ((_x & (VasEBoot_uint64_t) 0xFF000000ULL) << 8) \ + | ((_x & (VasEBoot_uint64_t) 0xFF00000000ULL) >> 8) \ + | ((_x & (VasEBoot_uint64_t) 0xFF0000000000ULL) >> 24) \ + | ((_x & (VasEBoot_uint64_t) 0xFF000000000000ULL) >> 40) \ | (_x >> 56)); \ }) #if (defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3)) || defined(__clang__) -static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x) +static inline VasEBoot_uint32_t VasEBoot_swap_bytes32(VasEBoot_uint32_t x) { return __builtin_bswap32(x); } -static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x) +static inline VasEBoot_uint64_t VasEBoot_swap_bytes64(VasEBoot_uint64_t x) { return __builtin_bswap64(x); } #else /* not gcc 4.3 or newer */ -static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t _x) +static inline VasEBoot_uint32_t VasEBoot_swap_bytes32(VasEBoot_uint32_t _x) { return ((_x << 24) - | ((_x & (grub_uint32_t) 0xFF00UL) << 8) - | ((_x & (grub_uint32_t) 0xFF0000UL) >> 8) + | ((_x & (VasEBoot_uint32_t) 0xFF00UL) << 8) + | ((_x & (VasEBoot_uint32_t) 0xFF0000UL) >> 8) | (_x >> 24)); } -static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t _x) +static inline VasEBoot_uint64_t VasEBoot_swap_bytes64(VasEBoot_uint64_t _x) { return ((_x << 56) - | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) - | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) - | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) - | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) - | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) - | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) + | ((_x & (VasEBoot_uint64_t) 0xFF00ULL) << 40) + | ((_x & (VasEBoot_uint64_t) 0xFF0000ULL) << 24) + | ((_x & (VasEBoot_uint64_t) 0xFF000000ULL) << 8) + | ((_x & (VasEBoot_uint64_t) 0xFF00000000ULL) >> 8) + | ((_x & (VasEBoot_uint64_t) 0xFF0000000000ULL) >> 24) + | ((_x & (VasEBoot_uint64_t) 0xFF000000000000ULL) >> 40) | (_x >> 56)); } #endif /* not gcc 4.3 or newer */ -#ifdef GRUB_CPU_WORDS_BIGENDIAN -# define grub_cpu_to_le16(x) grub_swap_bytes16(x) -# define grub_cpu_to_le32(x) grub_swap_bytes32(x) -# define grub_cpu_to_le64(x) grub_swap_bytes64(x) -# define grub_le_to_cpu16(x) grub_swap_bytes16(x) -# define grub_le_to_cpu32(x) grub_swap_bytes32(x) -# define grub_le_to_cpu64(x) grub_swap_bytes64(x) -# define grub_cpu_to_be16(x) ((grub_uint16_t) (x)) -# define grub_cpu_to_be32(x) ((grub_uint32_t) (x)) -# define grub_cpu_to_be64(x) ((grub_uint64_t) (x)) -# define grub_be_to_cpu16(x) ((grub_uint16_t) (x)) -# define grub_be_to_cpu32(x) ((grub_uint32_t) (x)) -# define grub_be_to_cpu64(x) ((grub_uint64_t) (x)) -# define grub_cpu_to_be16_compile_time(x) ((grub_uint16_t) (x)) -# define grub_cpu_to_be32_compile_time(x) ((grub_uint32_t) (x)) -# define grub_cpu_to_be64_compile_time(x) ((grub_uint64_t) (x)) -# define grub_be_to_cpu64_compile_time(x) ((grub_uint64_t) (x)) -# define grub_cpu_to_le32_compile_time(x) grub_swap_bytes32_compile_time(x) -# define grub_cpu_to_le64_compile_time(x) grub_swap_bytes64_compile_time(x) -# define grub_cpu_to_le16_compile_time(x) grub_swap_bytes16_compile_time(x) +#ifdef VasEBoot_CPU_WORDS_BIGENDIAN +# define VasEBoot_cpu_to_le16(x) VasEBoot_swap_bytes16(x) +# define VasEBoot_cpu_to_le32(x) VasEBoot_swap_bytes32(x) +# define VasEBoot_cpu_to_le64(x) VasEBoot_swap_bytes64(x) +# define VasEBoot_le_to_cpu16(x) VasEBoot_swap_bytes16(x) +# define VasEBoot_le_to_cpu32(x) VasEBoot_swap_bytes32(x) +# define VasEBoot_le_to_cpu64(x) VasEBoot_swap_bytes64(x) +# define VasEBoot_cpu_to_be16(x) ((VasEBoot_uint16_t) (x)) +# define VasEBoot_cpu_to_be32(x) ((VasEBoot_uint32_t) (x)) +# define VasEBoot_cpu_to_be64(x) ((VasEBoot_uint64_t) (x)) +# define VasEBoot_be_to_cpu16(x) ((VasEBoot_uint16_t) (x)) +# define VasEBoot_be_to_cpu32(x) ((VasEBoot_uint32_t) (x)) +# define VasEBoot_be_to_cpu64(x) ((VasEBoot_uint64_t) (x)) +# define VasEBoot_cpu_to_be16_compile_time(x) ((VasEBoot_uint16_t) (x)) +# define VasEBoot_cpu_to_be32_compile_time(x) ((VasEBoot_uint32_t) (x)) +# define VasEBoot_cpu_to_be64_compile_time(x) ((VasEBoot_uint64_t) (x)) +# define VasEBoot_be_to_cpu64_compile_time(x) ((VasEBoot_uint64_t) (x)) +# define VasEBoot_cpu_to_le32_compile_time(x) VasEBoot_swap_bytes32_compile_time(x) +# define VasEBoot_cpu_to_le64_compile_time(x) VasEBoot_swap_bytes64_compile_time(x) +# define VasEBoot_cpu_to_le16_compile_time(x) VasEBoot_swap_bytes16_compile_time(x) #else /* ! WORDS_BIGENDIAN */ -# define grub_cpu_to_le16(x) ((grub_uint16_t) (x)) -# define grub_cpu_to_le32(x) ((grub_uint32_t) (x)) -# define grub_cpu_to_le64(x) ((grub_uint64_t) (x)) -# define grub_le_to_cpu16(x) ((grub_uint16_t) (x)) -# define grub_le_to_cpu32(x) ((grub_uint32_t) (x)) -# define grub_le_to_cpu64(x) ((grub_uint64_t) (x)) -# define grub_cpu_to_be16(x) grub_swap_bytes16(x) -# define grub_cpu_to_be32(x) grub_swap_bytes32(x) -# define grub_cpu_to_be64(x) grub_swap_bytes64(x) -# define grub_be_to_cpu16(x) grub_swap_bytes16(x) -# define grub_be_to_cpu32(x) grub_swap_bytes32(x) -# define grub_be_to_cpu64(x) grub_swap_bytes64(x) -# define grub_cpu_to_be16_compile_time(x) grub_swap_bytes16_compile_time(x) -# define grub_cpu_to_be32_compile_time(x) grub_swap_bytes32_compile_time(x) -# define grub_cpu_to_be64_compile_time(x) grub_swap_bytes64_compile_time(x) -# define grub_be_to_cpu64_compile_time(x) grub_swap_bytes64_compile_time(x) -# define grub_cpu_to_le16_compile_time(x) ((grub_uint16_t) (x)) -# define grub_cpu_to_le32_compile_time(x) ((grub_uint32_t) (x)) -# define grub_cpu_to_le64_compile_time(x) ((grub_uint64_t) (x)) +# define VasEBoot_cpu_to_le16(x) ((VasEBoot_uint16_t) (x)) +# define VasEBoot_cpu_to_le32(x) ((VasEBoot_uint32_t) (x)) +# define VasEBoot_cpu_to_le64(x) ((VasEBoot_uint64_t) (x)) +# define VasEBoot_le_to_cpu16(x) ((VasEBoot_uint16_t) (x)) +# define VasEBoot_le_to_cpu32(x) ((VasEBoot_uint32_t) (x)) +# define VasEBoot_le_to_cpu64(x) ((VasEBoot_uint64_t) (x)) +# define VasEBoot_cpu_to_be16(x) VasEBoot_swap_bytes16(x) +# define VasEBoot_cpu_to_be32(x) VasEBoot_swap_bytes32(x) +# define VasEBoot_cpu_to_be64(x) VasEBoot_swap_bytes64(x) +# define VasEBoot_be_to_cpu16(x) VasEBoot_swap_bytes16(x) +# define VasEBoot_be_to_cpu32(x) VasEBoot_swap_bytes32(x) +# define VasEBoot_be_to_cpu64(x) VasEBoot_swap_bytes64(x) +# define VasEBoot_cpu_to_be16_compile_time(x) VasEBoot_swap_bytes16_compile_time(x) +# define VasEBoot_cpu_to_be32_compile_time(x) VasEBoot_swap_bytes32_compile_time(x) +# define VasEBoot_cpu_to_be64_compile_time(x) VasEBoot_swap_bytes64_compile_time(x) +# define VasEBoot_be_to_cpu64_compile_time(x) VasEBoot_swap_bytes64_compile_time(x) +# define VasEBoot_cpu_to_le16_compile_time(x) ((VasEBoot_uint16_t) (x)) +# define VasEBoot_cpu_to_le32_compile_time(x) ((VasEBoot_uint32_t) (x)) +# define VasEBoot_cpu_to_le64_compile_time(x) ((VasEBoot_uint64_t) (x)) #endif /* ! WORDS_BIGENDIAN */ -struct grub_unaligned_uint16 +struct VasEBoot_unaligned_uint16 { - grub_uint16_t val; -} GRUB_PACKED; -struct grub_unaligned_uint32 + VasEBoot_uint16_t val; +} VasEBoot_PACKED; +struct VasEBoot_unaligned_uint32 { - grub_uint32_t val; -} GRUB_PACKED; -struct grub_unaligned_uint64 + VasEBoot_uint32_t val; +} VasEBoot_PACKED; +struct VasEBoot_unaligned_uint64 { - grub_uint64_t val; -} GRUB_PACKED; + VasEBoot_uint64_t val; +} VasEBoot_PACKED; -typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t; -typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t; -typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t; +typedef struct VasEBoot_unaligned_uint16 VasEBoot_unaligned_uint16_t; +typedef struct VasEBoot_unaligned_uint32 VasEBoot_unaligned_uint32_t; +typedef struct VasEBoot_unaligned_uint64 VasEBoot_unaligned_uint64_t; -static inline grub_uint16_t grub_get_unaligned16 (const void *ptr) +static inline VasEBoot_uint16_t VasEBoot_get_unaligned16 (const void *ptr) { - const struct grub_unaligned_uint16 *dd - = (const struct grub_unaligned_uint16 *) ptr; + const struct VasEBoot_unaligned_uint16 *dd + = (const struct VasEBoot_unaligned_uint16 *) ptr; return dd->val; } -static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val) +static inline void VasEBoot_set_unaligned16 (void *ptr, VasEBoot_uint16_t val) { - struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr; + struct VasEBoot_unaligned_uint16 *dd = (struct VasEBoot_unaligned_uint16 *) ptr; dd->val = val; } -static inline grub_uint32_t grub_get_unaligned32 (const void *ptr) +static inline VasEBoot_uint32_t VasEBoot_get_unaligned32 (const void *ptr) { - const struct grub_unaligned_uint32 *dd - = (const struct grub_unaligned_uint32 *) ptr; + const struct VasEBoot_unaligned_uint32 *dd + = (const struct VasEBoot_unaligned_uint32 *) ptr; return dd->val; } -static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val) +static inline void VasEBoot_set_unaligned32 (void *ptr, VasEBoot_uint32_t val) { - struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr; + struct VasEBoot_unaligned_uint32 *dd = (struct VasEBoot_unaligned_uint32 *) ptr; dd->val = val; } -static inline grub_uint64_t grub_get_unaligned64 (const void *ptr) +static inline VasEBoot_uint64_t VasEBoot_get_unaligned64 (const void *ptr) { - const struct grub_unaligned_uint64 *dd - = (const struct grub_unaligned_uint64 *) ptr; + const struct VasEBoot_unaligned_uint64 *dd + = (const struct VasEBoot_unaligned_uint64 *) ptr; return dd->val; } -static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val) +static inline void VasEBoot_set_unaligned64 (void *ptr, VasEBoot_uint64_t val) { - struct grub_unaligned_uint64_t + struct VasEBoot_unaligned_uint64_t { - grub_uint64_t d; - } GRUB_PACKED; - struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr; + VasEBoot_uint64_t d; + } VasEBoot_PACKED; + struct VasEBoot_unaligned_uint64_t *dd = (struct VasEBoot_unaligned_uint64_t *) ptr; dd->d = val; } -#define GRUB_CHAR_BIT 8 +#define VasEBoot_CHAR_BIT 8 -#endif /* ! GRUB_TYPES_HEADER */ +#endif /* ! VasEBoot_TYPES_HEADER */ diff --git a/include/VasEBoot/uboot/api_public.h b/include/VasEBoot/uboot/api_public.h index 0707f5cff..9777a1dbe 100644 --- a/include/VasEBoot/uboot/api_public.h +++ b/include/VasEBoot/uboot/api_public.h @@ -68,8 +68,8 @@ typedef int (*scp_t) (int, int *, ...); struct api_signature { char magic[API_SIG_MAGLEN]; /* magic string */ - grub_uint16_t version; /* API version */ - grub_uint32_t checksum; /* checksum of this sig struct */ + VasEBoot_uint16_t version; /* API version */ + VasEBoot_uint32_t checksum; /* checksum of this sig struct */ scp_t syscall; /* entry point to the API */ }; diff --git a/include/VasEBoot/uboot/console.h b/include/VasEBoot/uboot/console.h index 993a53845..3873751b2 100644 --- a/include/VasEBoot/uboot/console.h +++ b/include/VasEBoot/uboot/console.h @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_CONSOLE_MACHINE_HEADER -#define GRUB_CONSOLE_MACHINE_HEADER 1 +#ifndef VasEBoot_CONSOLE_MACHINE_HEADER +#define VasEBoot_CONSOLE_MACHINE_HEADER 1 /* Initialize the console system. */ -void grub_console_init_early (void); -void grub_console_init_lately (void); +void VasEBoot_console_init_early (void); +void VasEBoot_console_init_lately (void); /* Exit the console system. */ -void grub_console_fini (void); +void VasEBoot_console_fini (void); -#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */ +#endif /* ! VasEBoot_CONSOLE_MACHINE_HEADER */ diff --git a/include/VasEBoot/uboot/disk.h b/include/VasEBoot/uboot/disk.h index e380b4c89..5c86a858d 100644 --- a/include/VasEBoot/uboot/disk.h +++ b/include/VasEBoot/uboot/disk.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UBOOT_DISK_HEADER -#define GRUB_UBOOT_DISK_HEADER 1 +#ifndef VasEBoot_UBOOT_DISK_HEADER +#define VasEBoot_UBOOT_DISK_HEADER 1 -#include -#include -#include +#include +#include +#include -void grub_ubootdisk_init (void); -void grub_ubootdisk_fini (void); +void VasEBoot_ubootdisk_init (void); +void VasEBoot_ubootdisk_fini (void); enum disktype { cd, fd, hd }; @@ -35,9 +35,9 @@ struct ubootdisk_data struct device_info *dev; int opencount; enum disktype type; - grub_uint32_t block_size; + VasEBoot_uint32_t block_size; }; -grub_err_t grub_ubootdisk_register (struct device_info *newdev); +VasEBoot_err_t VasEBoot_ubootdisk_register (struct device_info *newdev); -#endif /* ! GRUB_UBOOT_DISK_HEADER */ +#endif /* ! VasEBoot_UBOOT_DISK_HEADER */ diff --git a/include/VasEBoot/uboot/image.h b/include/VasEBoot/uboot/image.h index 3e3f0346e..3b2a417f3 100644 --- a/include/VasEBoot/uboot/image.h +++ b/include/VasEBoot/uboot/image.h @@ -30,60 +30,60 @@ ******************************************************************** */ -#ifndef __GRUB_UBOOT_IMAGE_H__ -#define __GRUB_UBOOT_IMAGE_H__ +#ifndef __VasEBoot_UBOOT_IMAGE_H__ +#define __VasEBoot_UBOOT_IMAGE_H__ /* * Operating System Codes */ -#define GRUB_UBOOT_IH_OS_INVALID 0 /* Invalid OS */ -#define GRUB_UBOOT_IH_OS_OPENBSD 1 /* OpenBSD */ -#define GRUB_UBOOT_IH_OS_NETBSD 2 /* NetBSD */ -#define GRUB_UBOOT_IH_OS_FREEBSD 3 /* FreeBSD */ -#define GRUB_UBOOT_IH_OS_4_4BSD 4 /* 4.4BSD */ -#define GRUB_UBOOT_IH_OS_LINUX 5 /* Linux */ -#define GRUB_UBOOT_IH_OS_SVR4 6 /* SVR4 */ -#define GRUB_UBOOT_IH_OS_ESIX 7 /* Esix */ -#define GRUB_UBOOT_IH_OS_SOLARIS 8 /* Solaris */ -#define GRUB_UBOOT_IH_OS_IRIX 9 /* Irix */ -#define GRUB_UBOOT_IH_OS_SCO 10 /* SCO */ -#define GRUB_UBOOT_IH_OS_DELL 11 /* Dell */ -#define GRUB_UBOOT_IH_OS_NCR 12 /* NCR */ -#define GRUB_UBOOT_IH_OS_LYNXOS 13 /* LynxOS */ -#define GRUB_UBOOT_IH_OS_VXWORKS 14 /* VxWorks */ -#define GRUB_UBOOT_IH_OS_PSOS 15 /* pSOS */ -#define GRUB_UBOOT_IH_OS_QNX 16 /* QNX */ -#define GRUB_UBOOT_IH_OS_U_BOOT 17 /* Firmware */ -#define GRUB_UBOOT_IH_OS_RTEMS 18 /* RTEMS */ -#define GRUB_UBOOT_IH_OS_ARTOS 19 /* ARTOS */ -#define GRUB_UBOOT_IH_OS_UNITY 20 /* Unity OS */ -#define GRUB_UBOOT_IH_OS_INTEGRITY 21 /* INTEGRITY */ -#define GRUB_UBOOT_IH_OS_OSE 22 /* OSE */ +#define VasEBoot_UBOOT_IH_OS_INVALID 0 /* Invalid OS */ +#define VasEBoot_UBOOT_IH_OS_OPENBSD 1 /* OpenBSD */ +#define VasEBoot_UBOOT_IH_OS_NETBSD 2 /* NetBSD */ +#define VasEBoot_UBOOT_IH_OS_FREEBSD 3 /* FreeBSD */ +#define VasEBoot_UBOOT_IH_OS_4_4BSD 4 /* 4.4BSD */ +#define VasEBoot_UBOOT_IH_OS_LINUX 5 /* Linux */ +#define VasEBoot_UBOOT_IH_OS_SVR4 6 /* SVR4 */ +#define VasEBoot_UBOOT_IH_OS_ESIX 7 /* Esix */ +#define VasEBoot_UBOOT_IH_OS_SOLARIS 8 /* Solaris */ +#define VasEBoot_UBOOT_IH_OS_IRIX 9 /* Irix */ +#define VasEBoot_UBOOT_IH_OS_SCO 10 /* SCO */ +#define VasEBoot_UBOOT_IH_OS_DELL 11 /* Dell */ +#define VasEBoot_UBOOT_IH_OS_NCR 12 /* NCR */ +#define VasEBoot_UBOOT_IH_OS_LYNXOS 13 /* LynxOS */ +#define VasEBoot_UBOOT_IH_OS_VXWORKS 14 /* VxWorks */ +#define VasEBoot_UBOOT_IH_OS_PSOS 15 /* pSOS */ +#define VasEBoot_UBOOT_IH_OS_QNX 16 /* QNX */ +#define VasEBoot_UBOOT_IH_OS_U_BOOT 17 /* Firmware */ +#define VasEBoot_UBOOT_IH_OS_RTEMS 18 /* RTEMS */ +#define VasEBoot_UBOOT_IH_OS_ARTOS 19 /* ARTOS */ +#define VasEBoot_UBOOT_IH_OS_UNITY 20 /* Unity OS */ +#define VasEBoot_UBOOT_IH_OS_INTEGRITY 21 /* INTEGRITY */ +#define VasEBoot_UBOOT_IH_OS_OSE 22 /* OSE */ /* * CPU Architecture Codes (supported by Linux) */ -#define GRUB_UBOOT_IH_ARCH_INVALID 0 /* Invalid CPU */ -#define GRUB_UBOOT_IH_ARCH_ALPHA 1 /* Alpha */ -#define GRUB_UBOOT_IH_ARCH_ARM 2 /* ARM */ -#define GRUB_UBOOT_IH_ARCH_I386 3 /* Intel x86 */ -#define GRUB_UBOOT_IH_ARCH_IA64 4 /* IA64 */ -#define GRUB_UBOOT_IH_ARCH_MIPS 5 /* MIPS */ -#define GRUB_UBOOT_IH_ARCH_MIPS64 6 /* MIPS 64 Bit */ -#define GRUB_UBOOT_IH_ARCH_PPC 7 /* PowerPC */ -#define GRUB_UBOOT_IH_ARCH_S390 8 /* IBM S390 */ -#define GRUB_UBOOT_IH_ARCH_SH 9 /* SuperH */ -#define GRUB_UBOOT_IH_ARCH_SPARC 10 /* Sparc */ -#define GRUB_UBOOT_IH_ARCH_SPARC64 11 /* Sparc 64 Bit */ -#define GRUB_UBOOT_IH_ARCH_M68K 12 /* M68K */ -#define GRUB_UBOOT_IH_ARCH_MICROBLAZE 14 /* MicroBlaze */ -#define GRUB_UBOOT_IH_ARCH_NIOS2 15 /* Nios-II */ -#define GRUB_UBOOT_IH_ARCH_BLACKFIN 16 /* Blackfin */ -#define GRUB_UBOOT_IH_ARCH_AVR32 17 /* AVR32 */ -#define GRUB_UBOOT_IH_ARCH_ST200 18 /* STMicroelectronics ST200 */ -#define GRUB_UBOOT_IH_ARCH_SANDBOX 19 /* Sandbox architecture (test only) */ -#define GRUB_UBOOT_IH_ARCH_NDS32 20 /* ANDES Technology - NDS32 */ -#define GRUB_UBOOT_IH_ARCH_OPENRISC 21 /* OpenRISC 1000 */ +#define VasEBoot_UBOOT_IH_ARCH_INVALID 0 /* Invalid CPU */ +#define VasEBoot_UBOOT_IH_ARCH_ALPHA 1 /* Alpha */ +#define VasEBoot_UBOOT_IH_ARCH_ARM 2 /* ARM */ +#define VasEBoot_UBOOT_IH_ARCH_I386 3 /* Intel x86 */ +#define VasEBoot_UBOOT_IH_ARCH_IA64 4 /* IA64 */ +#define VasEBoot_UBOOT_IH_ARCH_MIPS 5 /* MIPS */ +#define VasEBoot_UBOOT_IH_ARCH_MIPS64 6 /* MIPS 64 Bit */ +#define VasEBoot_UBOOT_IH_ARCH_PPC 7 /* PowerPC */ +#define VasEBoot_UBOOT_IH_ARCH_S390 8 /* IBM S390 */ +#define VasEBoot_UBOOT_IH_ARCH_SH 9 /* SuperH */ +#define VasEBoot_UBOOT_IH_ARCH_SPARC 10 /* Sparc */ +#define VasEBoot_UBOOT_IH_ARCH_SPARC64 11 /* Sparc 64 Bit */ +#define VasEBoot_UBOOT_IH_ARCH_M68K 12 /* M68K */ +#define VasEBoot_UBOOT_IH_ARCH_MICROBLAZE 14 /* MicroBlaze */ +#define VasEBoot_UBOOT_IH_ARCH_NIOS2 15 /* Nios-II */ +#define VasEBoot_UBOOT_IH_ARCH_BLACKFIN 16 /* Blackfin */ +#define VasEBoot_UBOOT_IH_ARCH_AVR32 17 /* AVR32 */ +#define VasEBoot_UBOOT_IH_ARCH_ST200 18 /* STMicroelectronics ST200 */ +#define VasEBoot_UBOOT_IH_ARCH_SANDBOX 19 /* Sandbox architecture (test only) */ +#define VasEBoot_UBOOT_IH_ARCH_NDS32 20 /* ANDES Technology - NDS32 */ +#define VasEBoot_UBOOT_IH_ARCH_OPENRISC 21 /* OpenRISC 1000 */ /* * Image Types @@ -124,52 +124,52 @@ * as command interpreter (=> Shell Scripts). */ -#define GRUB_UBOOT_IH_TYPE_INVALID 0 /* Invalid Image */ -#define GRUB_UBOOT_IH_TYPE_STANDALONE 1 /* Standalone Program */ -#define GRUB_UBOOT_IH_TYPE_KERNEL 2 /* OS Kernel Image */ -#define GRUB_UBOOT_IH_TYPE_RAMDISK 3 /* RAMDisk Image */ -#define GRUB_UBOOT_IH_TYPE_MULTI 4 /* Multi-File Image */ -#define GRUB_UBOOT_IH_TYPE_FIRMWARE 5 /* Firmware Image */ -#define GRUB_UBOOT_IH_TYPE_SCRIPT 6 /* Script file */ -#define GRUB_UBOOT_IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) */ -#define GRUB_UBOOT_IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */ -#define GRUB_UBOOT_IH_TYPE_KWBIMAGE 9 /* Kirkwood Boot Image */ -#define GRUB_UBOOT_IH_TYPE_IMXIMAGE 10 /* Freescale IMXBoot Image */ -#define GRUB_UBOOT_IH_TYPE_UBLIMAGE 11 /* Davinci UBL Image */ -#define GRUB_UBOOT_IH_TYPE_OMAPIMAGE 12 /* TI OMAP Config Header Image */ -#define GRUB_UBOOT_IH_TYPE_AISIMAGE 13 /* TI Davinci AIS Image */ -#define GRUB_UBOOT_IH_TYPE_KERNEL_NOLOAD 14 /* OS Kernel Image, can run from any load address */ -#define GRUB_UBOOT_IH_TYPE_PBLIMAGE 15 /* Freescale PBL Boot Image */ +#define VasEBoot_UBOOT_IH_TYPE_INVALID 0 /* Invalid Image */ +#define VasEBoot_UBOOT_IH_TYPE_STANDALONE 1 /* Standalone Program */ +#define VasEBoot_UBOOT_IH_TYPE_KERNEL 2 /* OS Kernel Image */ +#define VasEBoot_UBOOT_IH_TYPE_RAMDISK 3 /* RAMDisk Image */ +#define VasEBoot_UBOOT_IH_TYPE_MULTI 4 /* Multi-File Image */ +#define VasEBoot_UBOOT_IH_TYPE_FIRMWARE 5 /* Firmware Image */ +#define VasEBoot_UBOOT_IH_TYPE_SCRIPT 6 /* Script file */ +#define VasEBoot_UBOOT_IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) */ +#define VasEBoot_UBOOT_IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */ +#define VasEBoot_UBOOT_IH_TYPE_KWBIMAGE 9 /* Kirkwood Boot Image */ +#define VasEBoot_UBOOT_IH_TYPE_IMXIMAGE 10 /* Freescale IMXBoot Image */ +#define VasEBoot_UBOOT_IH_TYPE_UBLIMAGE 11 /* Davinci UBL Image */ +#define VasEBoot_UBOOT_IH_TYPE_OMAPIMAGE 12 /* TI OMAP Config Header Image */ +#define VasEBoot_UBOOT_IH_TYPE_AISIMAGE 13 /* TI Davinci AIS Image */ +#define VasEBoot_UBOOT_IH_TYPE_KERNEL_NOLOAD 14 /* OS Kernel Image, can run from any load address */ +#define VasEBoot_UBOOT_IH_TYPE_PBLIMAGE 15 /* Freescale PBL Boot Image */ /* * Compression Types */ -#define GRUB_UBOOT_IH_COMP_NONE 0 /* No Compression Used */ -#define GRUB_UBOOT_IH_COMP_GZIP 1 /* gzip Compression Used */ -#define GRUB_UBOOT_IH_COMP_BZIP2 2 /* bzip2 Compression Used */ -#define GRUB_UBOOT_IH_COMP_LZMA 3 /* lzma Compression Used */ -#define GRUB_UBOOT_IH_COMP_LZO 4 /* lzo Compression Used */ +#define VasEBoot_UBOOT_IH_COMP_NONE 0 /* No Compression Used */ +#define VasEBoot_UBOOT_IH_COMP_GZIP 1 /* gzip Compression Used */ +#define VasEBoot_UBOOT_IH_COMP_BZIP2 2 /* bzip2 Compression Used */ +#define VasEBoot_UBOOT_IH_COMP_LZMA 3 /* lzma Compression Used */ +#define VasEBoot_UBOOT_IH_COMP_LZO 4 /* lzo Compression Used */ -#define GRUB_UBOOT_IH_MAGIC 0x27051956 /* Image Magic Number */ -#define GRUB_UBOOT_IH_NMLEN 32 /* Image Name Length */ +#define VasEBoot_UBOOT_IH_MAGIC 0x27051956 /* Image Magic Number */ +#define VasEBoot_UBOOT_IH_NMLEN 32 /* Image Name Length */ /* * Legacy format image header, * all data in network byte order (aka natural aka bigendian). */ -struct grub_uboot_image_header { - grub_uint32_t ih_magic; /* Image Header Magic Number */ - grub_uint32_t ih_hcrc; /* Image Header CRC Checksum */ - grub_uint32_t ih_time; /* Image Creation Timestamp */ - grub_uint32_t ih_size; /* Image Data Size */ - grub_uint32_t ih_load; /* Data Load Address */ - grub_uint32_t ih_ep; /* Entry Point Address */ - grub_uint32_t ih_dcrc; /* Image Data CRC Checksum */ - grub_uint8_t ih_os; /* Operating System */ - grub_uint8_t ih_arch; /* CPU architecture */ - grub_uint8_t ih_type; /* Image Type */ - grub_uint8_t ih_comp; /* Compression Type */ - grub_uint8_t ih_name[GRUB_UBOOT_IH_NMLEN]; /* Image Name */ +struct VasEBoot_uboot_image_header { + VasEBoot_uint32_t ih_magic; /* Image Header Magic Number */ + VasEBoot_uint32_t ih_hcrc; /* Image Header CRC Checksum */ + VasEBoot_uint32_t ih_time; /* Image Creation Timestamp */ + VasEBoot_uint32_t ih_size; /* Image Data Size */ + VasEBoot_uint32_t ih_load; /* Data Load Address */ + VasEBoot_uint32_t ih_ep; /* Entry Point Address */ + VasEBoot_uint32_t ih_dcrc; /* Image Data CRC Checksum */ + VasEBoot_uint8_t ih_os; /* Operating System */ + VasEBoot_uint8_t ih_arch; /* CPU architecture */ + VasEBoot_uint8_t ih_type; /* Image Type */ + VasEBoot_uint8_t ih_comp; /* Compression Type */ + VasEBoot_uint8_t ih_name[VasEBoot_UBOOT_IH_NMLEN]; /* Image Name */ }; #endif /* __IMAGE_H__ */ diff --git a/include/VasEBoot/uboot/uboot.h b/include/VasEBoot/uboot/uboot.h index c122de6ab..8e7b900c8 100644 --- a/include/VasEBoot/uboot/uboot.h +++ b/include/VasEBoot/uboot/uboot.h @@ -1,43 +1,43 @@ /* uboot.h - declare variables and functions for U-Boot support */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UBOOT_UBOOT_HEADER -#define GRUB_UBOOT_UBOOT_HEADER 1 +#ifndef VasEBoot_UBOOT_UBOOT_HEADER +#define VasEBoot_UBOOT_UBOOT_HEADER 1 -#include -#include +#include +#include /* Functions. */ -void grub_uboot_mm_init (void); -void grub_uboot_init (void); -void grub_uboot_fini (void); +void VasEBoot_uboot_mm_init (void); +void VasEBoot_uboot_init (void); +void VasEBoot_uboot_fini (void); -void grub_uboot_return (int) __attribute__ ((noreturn)); +void VasEBoot_uboot_return (int) __attribute__ ((noreturn)); -grub_addr_t grub_uboot_get_real_bss_start (void); +VasEBoot_addr_t VasEBoot_uboot_get_real_bss_start (void); -grub_err_t grub_uboot_probe_hardware (void); +VasEBoot_err_t VasEBoot_uboot_probe_hardware (void); -extern grub_addr_t EXPORT_VAR (start_of_ram); +extern VasEBoot_addr_t EXPORT_VAR (start_of_ram); -grub_uint32_t EXPORT_FUNC (grub_uboot_get_machine_type) (void); -grub_addr_t EXPORT_FUNC (grub_uboot_get_boot_data) (void); +VasEBoot_uint32_t EXPORT_FUNC (VasEBoot_uboot_get_machine_type) (void); +VasEBoot_addr_t EXPORT_FUNC (VasEBoot_uboot_get_boot_data) (void); /* @@ -49,38 +49,38 @@ grub_addr_t EXPORT_FUNC (grub_uboot_get_boot_data) (void); */ #define UBOOT_API_SEARCH_LEN (3 * 1024 * 1024) -int grub_uboot_api_init (void); +int VasEBoot_uboot_api_init (void); /* * All functions below are wrappers around the uboot_syscall() function, - * implemented in grub-core/kern/uboot/uboot.c + * implemented in VasEBoot-core/kern/uboot/uboot.c */ -int grub_uboot_getc (void); -int grub_uboot_tstc (void); -void grub_uboot_putc (int c); -void grub_uboot_puts (const char *s); +int VasEBoot_uboot_getc (void); +int VasEBoot_uboot_tstc (void); +void VasEBoot_uboot_putc (int c); +void VasEBoot_uboot_puts (const char *s); -void EXPORT_FUNC (grub_uboot_reset) (void); +void EXPORT_FUNC (VasEBoot_uboot_reset) (void); -struct sys_info *grub_uboot_get_sys_info (void); +struct sys_info *VasEBoot_uboot_get_sys_info (void); -void grub_uboot_udelay (grub_uint32_t usec); -grub_uint32_t grub_uboot_get_timer (grub_uint32_t base); +void VasEBoot_uboot_udelay (VasEBoot_uint32_t usec); +VasEBoot_uint32_t VasEBoot_uboot_get_timer (VasEBoot_uint32_t base); -int EXPORT_FUNC (grub_uboot_dev_enum) (void); -struct device_info * EXPORT_FUNC (grub_uboot_dev_get) (int index); -int EXPORT_FUNC (grub_uboot_dev_open) (struct device_info *dev); -int EXPORT_FUNC (grub_uboot_dev_close) (struct device_info *dev); -int grub_uboot_dev_write (struct device_info *dev, void *buf, int *len); -int grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks, - grub_uint32_t start, grub_size_t * real_blocks); -int EXPORT_FUNC (grub_uboot_dev_recv) (struct device_info *dev, void *buf, +int EXPORT_FUNC (VasEBoot_uboot_dev_enum) (void); +struct device_info * EXPORT_FUNC (VasEBoot_uboot_dev_get) (int index); +int EXPORT_FUNC (VasEBoot_uboot_dev_open) (struct device_info *dev); +int EXPORT_FUNC (VasEBoot_uboot_dev_close) (struct device_info *dev); +int VasEBoot_uboot_dev_write (struct device_info *dev, void *buf, int *len); +int VasEBoot_uboot_dev_read (struct device_info *dev, void *buf, VasEBoot_size_t blocks, + VasEBoot_uint32_t start, VasEBoot_size_t * real_blocks); +int EXPORT_FUNC (VasEBoot_uboot_dev_recv) (struct device_info *dev, void *buf, int size, int *real_size); -int EXPORT_FUNC (grub_uboot_dev_send) (struct device_info *dev, void *buf, +int EXPORT_FUNC (VasEBoot_uboot_dev_send) (struct device_info *dev, void *buf, int size); -char *grub_uboot_env_get (const char *name); -void grub_uboot_env_set (const char *name, const char *value); +char *VasEBoot_uboot_env_get (const char *name); +void VasEBoot_uboot_env_set (const char *name, const char *value); -#endif /* ! GRUB_UBOOT_UBOOT_HEADER */ +#endif /* ! VasEBoot_UBOOT_UBOOT_HEADER */ diff --git a/include/VasEBoot/udf.h b/include/VasEBoot/udf.h index 905306947..74434dfc2 100644 --- a/include/VasEBoot/udf.h +++ b/include/VasEBoot/udf.h @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UDF_H -#define GRUB_UDF_H 1 +#ifndef VasEBoot_UDF_H +#define VasEBoot_UDF_H 1 -#include +#include -#ifdef GRUB_UTIL -#include +#ifdef VasEBoot_UTIL +#include -grub_disk_addr_t -grub_udf_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn); +VasEBoot_disk_addr_t +VasEBoot_udf_get_cluster_sector (VasEBoot_disk_t disk, VasEBoot_uint64_t *sec_per_lcn); #endif #endif diff --git a/include/VasEBoot/unicode.h b/include/VasEBoot/unicode.h index a0403e91f..54971d47b 100644 --- a/include/VasEBoot/unicode.h +++ b/include/VasEBoot/unicode.h @@ -1,35 +1,35 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_BIDI_HEADER -#define GRUB_BIDI_HEADER 1 +#ifndef VasEBoot_BIDI_HEADER +#define VasEBoot_BIDI_HEADER 1 -#include -#include -#include +#include +#include +#include -struct grub_unicode_bidi_pair +struct VasEBoot_unicode_bidi_pair { - grub_uint32_t key; - grub_uint32_t replace; + VasEBoot_uint32_t key; + VasEBoot_uint32_t replace; }; -struct grub_unicode_compact_range +struct VasEBoot_unicode_compact_range { unsigned start:21; unsigned len:9; @@ -37,237 +37,237 @@ struct grub_unicode_compact_range unsigned comb_type:8; unsigned bidi_mirror:1; unsigned join_type:3; -} GRUB_PACKED; +} VasEBoot_PACKED; /* Old-style Arabic shaping. Used for "visual UTF-8" and - in grub-mkfont to find variant glyphs in absence of GPOS tables. */ -struct grub_unicode_arabic_shape + in VasEBoot-mkfont to find variant glyphs in absence of GPOS tables. */ +struct VasEBoot_unicode_arabic_shape { - grub_uint32_t code; - grub_uint32_t isolated; - grub_uint32_t right_linked; - grub_uint32_t both_linked; - grub_uint32_t left_linked; + VasEBoot_uint32_t code; + VasEBoot_uint32_t isolated; + VasEBoot_uint32_t right_linked; + VasEBoot_uint32_t both_linked; + VasEBoot_uint32_t left_linked; }; -extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[]; +extern struct VasEBoot_unicode_arabic_shape VasEBoot_unicode_arabic_shapes[]; -enum grub_bidi_type +enum VasEBoot_bidi_type { - GRUB_BIDI_TYPE_L = 0, - GRUB_BIDI_TYPE_LRE, - GRUB_BIDI_TYPE_LRO, - GRUB_BIDI_TYPE_R, - GRUB_BIDI_TYPE_AL, - GRUB_BIDI_TYPE_RLE, - GRUB_BIDI_TYPE_RLO, - GRUB_BIDI_TYPE_PDF, - GRUB_BIDI_TYPE_EN, - GRUB_BIDI_TYPE_ES, - GRUB_BIDI_TYPE_ET, - GRUB_BIDI_TYPE_AN, - GRUB_BIDI_TYPE_CS, - GRUB_BIDI_TYPE_NSM, - GRUB_BIDI_TYPE_BN, - GRUB_BIDI_TYPE_B, - GRUB_BIDI_TYPE_S, - GRUB_BIDI_TYPE_WS, - GRUB_BIDI_TYPE_ON + VasEBoot_BIDI_TYPE_L = 0, + VasEBoot_BIDI_TYPE_LRE, + VasEBoot_BIDI_TYPE_LRO, + VasEBoot_BIDI_TYPE_R, + VasEBoot_BIDI_TYPE_AL, + VasEBoot_BIDI_TYPE_RLE, + VasEBoot_BIDI_TYPE_RLO, + VasEBoot_BIDI_TYPE_PDF, + VasEBoot_BIDI_TYPE_EN, + VasEBoot_BIDI_TYPE_ES, + VasEBoot_BIDI_TYPE_ET, + VasEBoot_BIDI_TYPE_AN, + VasEBoot_BIDI_TYPE_CS, + VasEBoot_BIDI_TYPE_NSM, + VasEBoot_BIDI_TYPE_BN, + VasEBoot_BIDI_TYPE_B, + VasEBoot_BIDI_TYPE_S, + VasEBoot_BIDI_TYPE_WS, + VasEBoot_BIDI_TYPE_ON }; -enum grub_join_type +enum VasEBoot_join_type { - GRUB_JOIN_TYPE_NONJOINING = 0, - GRUB_JOIN_TYPE_LEFT = 1, - GRUB_JOIN_TYPE_RIGHT = 2, - GRUB_JOIN_TYPE_DUAL = 3, - GRUB_JOIN_TYPE_CAUSING = 4, - GRUB_JOIN_TYPE_TRANSPARENT = 5 + VasEBoot_JOIN_TYPE_NONJOINING = 0, + VasEBoot_JOIN_TYPE_LEFT = 1, + VasEBoot_JOIN_TYPE_RIGHT = 2, + VasEBoot_JOIN_TYPE_DUAL = 3, + VasEBoot_JOIN_TYPE_CAUSING = 4, + VasEBoot_JOIN_TYPE_TRANSPARENT = 5 }; -enum grub_comb_type +enum VasEBoot_comb_type { - GRUB_UNICODE_COMB_NONE = 0, - GRUB_UNICODE_COMB_OVERLAY = 1, - GRUB_UNICODE_COMB_HEBREW_SHEVA = 10, - GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11, - GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12, - GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13, - GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14, - GRUB_UNICODE_COMB_HEBREW_TSERE = 15, - GRUB_UNICODE_COMB_HEBREW_SEGOL = 16, - GRUB_UNICODE_COMB_HEBREW_PATAH = 17, - GRUB_UNICODE_COMB_HEBREW_QAMATS = 18, - GRUB_UNICODE_COMB_HEBREW_HOLAM = 19, - GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20, - GRUB_UNICODE_COMB_HEBREW_DAGESH = 21, - GRUB_UNICODE_COMB_HEBREW_METEG = 22, - GRUB_UNICODE_COMB_HEBREW_RAFE = 23, - GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24, - GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25, - GRUB_UNICODE_COMB_HEBREW_VARIKA = 26, - GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27, - GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28, - GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29, - GRUB_UNICODE_COMB_ARABIC_FATHAH = 30, - GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31, - GRUB_UNICODE_COMB_ARABIC_KASRA = 32, - GRUB_UNICODE_COMB_ARABIC_SHADDA = 33, - GRUB_UNICODE_COMB_ARABIC_SUKUN = 34, - GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35, - GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36, - GRUB_UNICODE_STACK_ATTACHED_BELOW = 202, - GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214, - GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216, - GRUB_UNICODE_STACK_BELOW = 220, - GRUB_UNICODE_COMB_BELOW_RIGHT = 222, - GRUB_UNICODE_COMB_ABOVE_LEFT = 228, - GRUB_UNICODE_STACK_ABOVE = 230, - GRUB_UNICODE_COMB_ABOVE_RIGHT = 232, - GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240, + VasEBoot_UNICODE_COMB_NONE = 0, + VasEBoot_UNICODE_COMB_OVERLAY = 1, + VasEBoot_UNICODE_COMB_HEBREW_SHEVA = 10, + VasEBoot_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11, + VasEBoot_UNICODE_COMB_HEBREW_HATAF_PATAH = 12, + VasEBoot_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13, + VasEBoot_UNICODE_COMB_HEBREW_HIRIQ = 14, + VasEBoot_UNICODE_COMB_HEBREW_TSERE = 15, + VasEBoot_UNICODE_COMB_HEBREW_SEGOL = 16, + VasEBoot_UNICODE_COMB_HEBREW_PATAH = 17, + VasEBoot_UNICODE_COMB_HEBREW_QAMATS = 18, + VasEBoot_UNICODE_COMB_HEBREW_HOLAM = 19, + VasEBoot_UNICODE_COMB_HEBREW_QUBUTS = 20, + VasEBoot_UNICODE_COMB_HEBREW_DAGESH = 21, + VasEBoot_UNICODE_COMB_HEBREW_METEG = 22, + VasEBoot_UNICODE_COMB_HEBREW_RAFE = 23, + VasEBoot_UNICODE_COMB_HEBREW_SHIN_DOT = 24, + VasEBoot_UNICODE_COMB_HEBREW_SIN_DOT = 25, + VasEBoot_UNICODE_COMB_HEBREW_VARIKA = 26, + VasEBoot_UNICODE_COMB_ARABIC_FATHATAN = 27, + VasEBoot_UNICODE_COMB_ARABIC_DAMMATAN = 28, + VasEBoot_UNICODE_COMB_ARABIC_KASRATAN = 29, + VasEBoot_UNICODE_COMB_ARABIC_FATHAH = 30, + VasEBoot_UNICODE_COMB_ARABIC_DAMMAH = 31, + VasEBoot_UNICODE_COMB_ARABIC_KASRA = 32, + VasEBoot_UNICODE_COMB_ARABIC_SHADDA = 33, + VasEBoot_UNICODE_COMB_ARABIC_SUKUN = 34, + VasEBoot_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35, + VasEBoot_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36, + VasEBoot_UNICODE_STACK_ATTACHED_BELOW = 202, + VasEBoot_UNICODE_STACK_ATTACHED_ABOVE = 214, + VasEBoot_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216, + VasEBoot_UNICODE_STACK_BELOW = 220, + VasEBoot_UNICODE_COMB_BELOW_RIGHT = 222, + VasEBoot_UNICODE_COMB_ABOVE_LEFT = 228, + VasEBoot_UNICODE_STACK_ABOVE = 230, + VasEBoot_UNICODE_COMB_ABOVE_RIGHT = 232, + VasEBoot_UNICODE_COMB_YPOGEGRAMMENI = 240, /* If combining nature is indicated only by class and not "combining type". */ - GRUB_UNICODE_COMB_ME = 253, - GRUB_UNICODE_COMB_MC = 254, - GRUB_UNICODE_COMB_MN = 255, + VasEBoot_UNICODE_COMB_ME = 253, + VasEBoot_UNICODE_COMB_MC = 254, + VasEBoot_UNICODE_COMB_MN = 255, }; -struct grub_unicode_combining +struct VasEBoot_unicode_combining { - grub_uint32_t code:21; - enum grub_comb_type type:8; + VasEBoot_uint32_t code:21; + enum VasEBoot_comb_type type:8; }; /* This structure describes a glyph as opposed to character. */ -struct grub_unicode_glyph +struct VasEBoot_unicode_glyph { - grub_uint32_t base:23; /* minimum: 21 */ - grub_uint16_t variant:9; /* minimum: 9 */ + VasEBoot_uint32_t base:23; /* minimum: 21 */ + VasEBoot_uint16_t variant:9; /* minimum: 9 */ - grub_uint8_t attributes:5; /* minimum: 5 */ - grub_uint8_t bidi_level:6; /* minimum: 6 */ - enum grub_bidi_type bidi_type:5; /* minimum: :5 */ + VasEBoot_uint8_t attributes:5; /* minimum: 5 */ + VasEBoot_uint8_t bidi_level:6; /* minimum: 6 */ + enum VasEBoot_bidi_type bidi_type:5; /* minimum: :5 */ unsigned ncomb:8; /* Hint by unicode subsystem how wide this character usually is. Real width is determined by font. Set only in UTF-8 stream. */ int estimated_width:8; - grub_size_t orig_pos; + VasEBoot_size_t orig_pos; union { - struct grub_unicode_combining combining_inline[sizeof (void *) - / sizeof (struct grub_unicode_combining)]; - struct grub_unicode_combining *combining_ptr; + struct VasEBoot_unicode_combining combining_inline[sizeof (void *) + / sizeof (struct VasEBoot_unicode_combining)]; + struct VasEBoot_unicode_combining *combining_ptr; }; }; -#define GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR 0x1 -#define GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT 1 -#define GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED 0x2 -#define GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED \ - (GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED \ - << GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT) +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTE_MIRROR 0x1 +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT 1 +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED 0x2 +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED \ + (VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED \ + << VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT) /* Set iff the corresponding joining flags come from ZWJ or ZWNJ. */ -#define GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT 0x8 -#define GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT \ - (GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT \ - << GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT) -#define GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN \ - (GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED \ - | GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED \ - | GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT \ - | GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT) +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT 0x8 +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT \ + (VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT \ + << VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT) +#define VasEBoot_UNICODE_GLYPH_ATTRIBUTES_JOIN \ + (VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED \ + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED \ + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT \ + | VasEBoot_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT) enum { - GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131, - GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237, - GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f, - GRUB_UNICODE_HEBREW_WAW = 0x05d5, - GRUB_UNICODE_ARABIC_START = 0x0600, - GRUB_UNICODE_ARABIC_END = 0x0700, - GRUB_UNICODE_THAANA_ABAFILI = 0x07a6, - GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7, - GRUB_UNICODE_THAANA_IBIFILI = 0x07a8, - GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9, - GRUB_UNICODE_THAANA_UBUFILI = 0x07aa, - GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab, - GRUB_UNICODE_THAANA_EBEFILI = 0x07ac, - GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad, - GRUB_UNICODE_THAANA_OBOFILI = 0x07ae, - GRUB_UNICODE_THAANA_OABOAFILI = 0x07af, - GRUB_UNICODE_THAANA_SUKUN = 0x07b0, - GRUB_UNICODE_ZWNJ = 0x200c, - GRUB_UNICODE_ZWJ = 0x200d, - GRUB_UNICODE_LRM = 0x200e, - GRUB_UNICODE_RLM = 0x200f, - GRUB_UNICODE_LRE = 0x202a, - GRUB_UNICODE_RLE = 0x202b, - GRUB_UNICODE_PDF = 0x202c, - GRUB_UNICODE_LRO = 0x202d, - GRUB_UNICODE_RLO = 0x202e, - GRUB_UNICODE_LEFTARROW = 0x2190, - GRUB_UNICODE_UPARROW = 0x2191, - GRUB_UNICODE_RIGHTARROW = 0x2192, - GRUB_UNICODE_DOWNARROW = 0x2193, - GRUB_UNICODE_UPDOWNARROW = 0x2195, - GRUB_UNICODE_LIGHT_HLINE = 0x2500, - GRUB_UNICODE_HLINE = 0x2501, - GRUB_UNICODE_LIGHT_VLINE = 0x2502, - GRUB_UNICODE_VLINE = 0x2503, - GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c, - GRUB_UNICODE_CORNER_UL = 0x250f, - GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510, - GRUB_UNICODE_CORNER_UR = 0x2513, - GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514, - GRUB_UNICODE_CORNER_LL = 0x2517, - GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518, - GRUB_UNICODE_CORNER_LR = 0x251b, - GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2, - GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba, - GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc, - GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4, - GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00, - GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f, - GRUB_UNICODE_TAG_START = 0xe0000, - GRUB_UNICODE_TAG_END = 0xe007f, - GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100, - GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef, - GRUB_UNICODE_LAST_VALID = 0x10ffff + VasEBoot_UNICODE_DOTLESS_LOWERCASE_I = 0x0131, + VasEBoot_UNICODE_DOTLESS_LOWERCASE_J = 0x0237, + VasEBoot_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f, + VasEBoot_UNICODE_HEBREW_WAW = 0x05d5, + VasEBoot_UNICODE_ARABIC_START = 0x0600, + VasEBoot_UNICODE_ARABIC_END = 0x0700, + VasEBoot_UNICODE_THAANA_ABAFILI = 0x07a6, + VasEBoot_UNICODE_THAANA_AABAAFILI = 0x07a7, + VasEBoot_UNICODE_THAANA_IBIFILI = 0x07a8, + VasEBoot_UNICODE_THAANA_EEBEEFILI = 0x07a9, + VasEBoot_UNICODE_THAANA_UBUFILI = 0x07aa, + VasEBoot_UNICODE_THAANA_OOBOOFILI = 0x07ab, + VasEBoot_UNICODE_THAANA_EBEFILI = 0x07ac, + VasEBoot_UNICODE_THAANA_EYBEYFILI = 0x07ad, + VasEBoot_UNICODE_THAANA_OBOFILI = 0x07ae, + VasEBoot_UNICODE_THAANA_OABOAFILI = 0x07af, + VasEBoot_UNICODE_THAANA_SUKUN = 0x07b0, + VasEBoot_UNICODE_ZWNJ = 0x200c, + VasEBoot_UNICODE_ZWJ = 0x200d, + VasEBoot_UNICODE_LRM = 0x200e, + VasEBoot_UNICODE_RLM = 0x200f, + VasEBoot_UNICODE_LRE = 0x202a, + VasEBoot_UNICODE_RLE = 0x202b, + VasEBoot_UNICODE_PDF = 0x202c, + VasEBoot_UNICODE_LRO = 0x202d, + VasEBoot_UNICODE_RLO = 0x202e, + VasEBoot_UNICODE_LEFTARROW = 0x2190, + VasEBoot_UNICODE_UPARROW = 0x2191, + VasEBoot_UNICODE_RIGHTARROW = 0x2192, + VasEBoot_UNICODE_DOWNARROW = 0x2193, + VasEBoot_UNICODE_UPDOWNARROW = 0x2195, + VasEBoot_UNICODE_LIGHT_HLINE = 0x2500, + VasEBoot_UNICODE_HLINE = 0x2501, + VasEBoot_UNICODE_LIGHT_VLINE = 0x2502, + VasEBoot_UNICODE_VLINE = 0x2503, + VasEBoot_UNICODE_LIGHT_CORNER_UL = 0x250c, + VasEBoot_UNICODE_CORNER_UL = 0x250f, + VasEBoot_UNICODE_LIGHT_CORNER_UR = 0x2510, + VasEBoot_UNICODE_CORNER_UR = 0x2513, + VasEBoot_UNICODE_LIGHT_CORNER_LL = 0x2514, + VasEBoot_UNICODE_CORNER_LL = 0x2517, + VasEBoot_UNICODE_LIGHT_CORNER_LR = 0x2518, + VasEBoot_UNICODE_CORNER_LR = 0x251b, + VasEBoot_UNICODE_BLACK_UP_TRIANGLE = 0x25b2, + VasEBoot_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba, + VasEBoot_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc, + VasEBoot_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4, + VasEBoot_UNICODE_VARIATION_SELECTOR_1 = 0xfe00, + VasEBoot_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f, + VasEBoot_UNICODE_TAG_START = 0xe0000, + VasEBoot_UNICODE_TAG_END = 0xe007f, + VasEBoot_UNICODE_VARIATION_SELECTOR_17 = 0xe0100, + VasEBoot_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef, + VasEBoot_UNICODE_LAST_VALID = 0x10ffff }; -extern struct grub_unicode_compact_range grub_unicode_compact[]; -extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[]; +extern struct VasEBoot_unicode_compact_range VasEBoot_unicode_compact[]; +extern struct VasEBoot_unicode_bidi_pair VasEBoot_unicode_bidi_pairs[]; -#define GRUB_UNICODE_MAX_CACHED_CHAR 0x20000 +#define VasEBoot_UNICODE_MAX_CACHED_CHAR 0x20000 /* Unicode mandates an arbitrary limit. */ -#define GRUB_BIDI_MAX_EXPLICIT_LEVEL 61 +#define VasEBoot_BIDI_MAX_EXPLICIT_LEVEL 61 -struct grub_term_pos +struct VasEBoot_term_pos { unsigned valid:1; unsigned x:15, y:16; }; -grub_ssize_t -grub_bidi_logical_to_visual (const grub_uint32_t *logical, - grub_size_t logical_len, - struct grub_unicode_glyph **visual_out, - grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg), +VasEBoot_ssize_t +VasEBoot_bidi_logical_to_visual (const VasEBoot_uint32_t *logical, + VasEBoot_size_t logical_len, + struct VasEBoot_unicode_glyph **visual_out, + VasEBoot_size_t (*getcharwidth) (const struct VasEBoot_unicode_glyph *visual, void *getcharwidth_arg), void *getcharwidth_arg, - grub_size_t max_width, - grub_size_t start_width, grub_uint32_t codechar, - struct grub_term_pos *pos, + VasEBoot_size_t max_width, + VasEBoot_size_t start_width, VasEBoot_uint32_t codechar, + struct VasEBoot_term_pos *pos, int primitive_wrap); -enum grub_comb_type -grub_unicode_get_comb_type (grub_uint32_t c); -grub_size_t -grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, - struct grub_unicode_glyph *out); +enum VasEBoot_comb_type +VasEBoot_unicode_get_comb_type (VasEBoot_uint32_t c); +VasEBoot_size_t +VasEBoot_unicode_aglomerate_comb (const VasEBoot_uint32_t *in, VasEBoot_size_t inlen, + struct VasEBoot_unicode_glyph *out); -static inline const struct grub_unicode_combining * -grub_unicode_get_comb (const struct grub_unicode_glyph *in) +static inline const struct VasEBoot_unicode_combining * +VasEBoot_unicode_get_comb (const struct VasEBoot_unicode_glyph *in) { if (in->ncomb == 0) return NULL; @@ -277,60 +277,60 @@ grub_unicode_get_comb (const struct grub_unicode_glyph *in) } static inline void -grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph) +VasEBoot_unicode_destroy_glyph (struct VasEBoot_unicode_glyph *glyph) { if (glyph->ncomb > ARRAY_SIZE (glyph->combining_inline)) - grub_free (glyph->combining_ptr); + VasEBoot_free (glyph->combining_ptr); glyph->ncomb = 0; } -static inline struct grub_unicode_glyph * -grub_unicode_glyph_dup (const struct grub_unicode_glyph *in) +static inline struct VasEBoot_unicode_glyph * +VasEBoot_unicode_glyph_dup (const struct VasEBoot_unicode_glyph *in) { - struct grub_unicode_glyph *out = grub_malloc (sizeof (*out)); + struct VasEBoot_unicode_glyph *out = VasEBoot_malloc (sizeof (*out)); if (!out) return NULL; - grub_memcpy (out, in, sizeof (*in)); + VasEBoot_memcpy (out, in, sizeof (*in)); if (in->ncomb > ARRAY_SIZE (out->combining_inline)) { - out->combining_ptr = grub_malloc (in->ncomb * sizeof (out->combining_ptr[0])); + out->combining_ptr = VasEBoot_malloc (in->ncomb * sizeof (out->combining_ptr[0])); if (!out->combining_ptr) { - grub_free (out); + VasEBoot_free (out); return NULL; } - grub_memcpy (out->combining_ptr, in->combining_ptr, + VasEBoot_memcpy (out->combining_ptr, in->combining_ptr, in->ncomb * sizeof (out->combining_ptr[0])); } else - grub_memcpy (&out->combining_inline, &in->combining_inline, + VasEBoot_memcpy (&out->combining_inline, &in->combining_inline, sizeof (out->combining_inline)); return out; } static inline void -grub_unicode_set_glyph (struct grub_unicode_glyph *out, - const struct grub_unicode_glyph *in) +VasEBoot_unicode_set_glyph (struct VasEBoot_unicode_glyph *out, + const struct VasEBoot_unicode_glyph *in) { - grub_memcpy (out, in, sizeof (*in)); + VasEBoot_memcpy (out, in, sizeof (*in)); if (in->ncomb > ARRAY_SIZE (out->combining_inline)) { - out->combining_ptr = grub_malloc (in->ncomb * sizeof (out->combining_ptr[0])); + out->combining_ptr = VasEBoot_malloc (in->ncomb * sizeof (out->combining_ptr[0])); if (!out->combining_ptr) return; - grub_memcpy (out->combining_ptr, in->combining_ptr, + VasEBoot_memcpy (out->combining_ptr, in->combining_ptr, in->ncomb * sizeof (out->combining_ptr[0])); } else - grub_memcpy (&out->combining_inline, &in->combining_inline, + VasEBoot_memcpy (&out->combining_inline, &in->combining_inline, sizeof (out->combining_inline)); } -static inline struct grub_unicode_glyph * -grub_unicode_glyph_from_code (grub_uint32_t code) +static inline struct VasEBoot_unicode_glyph * +VasEBoot_unicode_glyph_from_code (VasEBoot_uint32_t code) { - struct grub_unicode_glyph *ret; - ret = grub_zalloc (sizeof (*ret)); + struct VasEBoot_unicode_glyph *ret; + ret = VasEBoot_zalloc (sizeof (*ret)); if (!ret) return NULL; @@ -340,21 +340,21 @@ grub_unicode_glyph_from_code (grub_uint32_t code) } static inline void -grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph, - grub_uint32_t code) +VasEBoot_unicode_set_glyph_from_code (struct VasEBoot_unicode_glyph *glyph, + VasEBoot_uint32_t code) { - grub_memset (glyph, 0, sizeof (*glyph)); + VasEBoot_memset (glyph, 0, sizeof (*glyph)); glyph->base = code; } -grub_uint32_t -grub_unicode_mirror_code (grub_uint32_t in); -grub_uint32_t -grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr); +VasEBoot_uint32_t +VasEBoot_unicode_mirror_code (VasEBoot_uint32_t in); +VasEBoot_uint32_t +VasEBoot_unicode_shape_code (VasEBoot_uint32_t in, VasEBoot_uint8_t attr); -const grub_uint32_t * -grub_unicode_get_comb_end (const grub_uint32_t *end, - const grub_uint32_t *cur); +const VasEBoot_uint32_t * +VasEBoot_unicode_get_comb_end (const VasEBoot_uint32_t *end, + const VasEBoot_uint32_t *cur); #endif diff --git a/include/VasEBoot/usb.h b/include/VasEBoot/usb.h index 11d96481f..f38b5ff1f 100644 --- a/include/VasEBoot/usb.h +++ b/include/VasEBoot/usb.h @@ -1,179 +1,179 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_USB_H -#define GRUB_USB_H 1 +#ifndef VasEBoot_USB_H +#define VasEBoot_USB_H 1 -#include -#include -#include +#include +#include +#include -typedef struct grub_usb_device *grub_usb_device_t; -typedef struct grub_usb_controller *grub_usb_controller_t; -typedef struct grub_usb_controller_dev *grub_usb_controller_dev_t; +typedef struct VasEBoot_usb_device *VasEBoot_usb_device_t; +typedef struct VasEBoot_usb_controller *VasEBoot_usb_controller_t; +typedef struct VasEBoot_usb_controller_dev *VasEBoot_usb_controller_dev_t; typedef enum { - GRUB_USB_ERR_NONE, - GRUB_USB_ERR_WAIT, - GRUB_USB_ERR_INTERNAL, - GRUB_USB_ERR_STALL, - GRUB_USB_ERR_DATA, - GRUB_USB_ERR_NAK, - GRUB_USB_ERR_BABBLE, - GRUB_USB_ERR_TIMEOUT, - GRUB_USB_ERR_BITSTUFF, - GRUB_USB_ERR_UNRECOVERABLE, - GRUB_USB_ERR_BADDEVICE - } grub_usb_err_t; + VasEBoot_USB_ERR_NONE, + VasEBoot_USB_ERR_WAIT, + VasEBoot_USB_ERR_INTERNAL, + VasEBoot_USB_ERR_STALL, + VasEBoot_USB_ERR_DATA, + VasEBoot_USB_ERR_NAK, + VasEBoot_USB_ERR_BABBLE, + VasEBoot_USB_ERR_TIMEOUT, + VasEBoot_USB_ERR_BITSTUFF, + VasEBoot_USB_ERR_UNRECOVERABLE, + VasEBoot_USB_ERR_BADDEVICE + } VasEBoot_usb_err_t; typedef enum { - GRUB_USB_SPEED_NONE, - GRUB_USB_SPEED_LOW, - GRUB_USB_SPEED_FULL, - GRUB_USB_SPEED_HIGH - } grub_usb_speed_t; + VasEBoot_USB_SPEED_NONE, + VasEBoot_USB_SPEED_LOW, + VasEBoot_USB_SPEED_FULL, + VasEBoot_USB_SPEED_HIGH + } VasEBoot_usb_speed_t; -typedef int (*grub_usb_iterate_hook_t) (grub_usb_device_t dev, void *data); -typedef int (*grub_usb_controller_iterate_hook_t) (grub_usb_controller_t dev, +typedef int (*VasEBoot_usb_iterate_hook_t) (VasEBoot_usb_device_t dev, void *data); +typedef int (*VasEBoot_usb_controller_iterate_hook_t) (VasEBoot_usb_controller_t dev, void *data); /* Call HOOK with each device, until HOOK returns non-zero. */ -int grub_usb_iterate (grub_usb_iterate_hook_t hook, void *hook_data); +int VasEBoot_usb_iterate (VasEBoot_usb_iterate_hook_t hook, void *hook_data); -grub_usb_err_t grub_usb_device_initialize (grub_usb_device_t dev); +VasEBoot_usb_err_t VasEBoot_usb_device_initialize (VasEBoot_usb_device_t dev); -grub_usb_err_t grub_usb_get_descriptor (grub_usb_device_t dev, - grub_uint8_t type, grub_uint8_t index, - grub_size_t size, char *data); +VasEBoot_usb_err_t VasEBoot_usb_get_descriptor (VasEBoot_usb_device_t dev, + VasEBoot_uint8_t type, VasEBoot_uint8_t index, + VasEBoot_size_t size, char *data); -grub_usb_err_t grub_usb_clear_halt (grub_usb_device_t dev, int endpoint); +VasEBoot_usb_err_t VasEBoot_usb_clear_halt (VasEBoot_usb_device_t dev, int endpoint); -grub_usb_err_t grub_usb_set_configuration (grub_usb_device_t dev, +VasEBoot_usb_err_t VasEBoot_usb_set_configuration (VasEBoot_usb_device_t dev, int configuration); -void grub_usb_controller_dev_register (grub_usb_controller_dev_t usb); +void VasEBoot_usb_controller_dev_register (VasEBoot_usb_controller_dev_t usb); -void grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb); +void VasEBoot_usb_controller_dev_unregister (VasEBoot_usb_controller_dev_t usb); -int grub_usb_controller_iterate (grub_usb_controller_iterate_hook_t hook, +int VasEBoot_usb_controller_iterate (VasEBoot_usb_controller_iterate_hook_t hook, void *hook_data); -grub_usb_err_t grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype, - grub_uint8_t request, grub_uint16_t value, - grub_uint16_t index, grub_size_t size, +VasEBoot_usb_err_t VasEBoot_usb_control_msg (VasEBoot_usb_device_t dev, VasEBoot_uint8_t reqtype, + VasEBoot_uint8_t request, VasEBoot_uint16_t value, + VasEBoot_uint16_t index, VasEBoot_size_t size, char *data); -grub_usb_err_t -grub_usb_bulk_read (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, char *data); -grub_usb_err_t -grub_usb_bulk_write (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, char *data); +VasEBoot_usb_err_t +VasEBoot_usb_bulk_read (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, char *data); +VasEBoot_usb_err_t +VasEBoot_usb_bulk_write (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, char *data); -grub_usb_err_t -grub_usb_root_hub (grub_usb_controller_t controller); +VasEBoot_usb_err_t +VasEBoot_usb_root_hub (VasEBoot_usb_controller_t controller); /* XXX: All handled by libusb for now. */ -struct grub_usb_controller_dev +struct VasEBoot_usb_controller_dev { /* The device name. */ const char *name; - int (*iterate) (grub_usb_controller_iterate_hook_t hook, void *hook_data); + int (*iterate) (VasEBoot_usb_controller_iterate_hook_t hook, void *hook_data); - grub_usb_err_t (*setup_transfer) (grub_usb_controller_t dev, - grub_usb_transfer_t transfer); + VasEBoot_usb_err_t (*setup_transfer) (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer); - grub_usb_err_t (*check_transfer) (grub_usb_controller_t dev, - grub_usb_transfer_t transfer, - grub_size_t *actual); + VasEBoot_usb_err_t (*check_transfer) (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer, + VasEBoot_size_t *actual); - grub_usb_err_t (*cancel_transfer) (grub_usb_controller_t dev, - grub_usb_transfer_t transfer); + VasEBoot_usb_err_t (*cancel_transfer) (VasEBoot_usb_controller_t dev, + VasEBoot_usb_transfer_t transfer); - int (*hubports) (grub_usb_controller_t dev); + int (*hubports) (VasEBoot_usb_controller_t dev); - grub_usb_err_t (*portstatus) (grub_usb_controller_t dev, unsigned int port, + VasEBoot_usb_err_t (*portstatus) (VasEBoot_usb_controller_t dev, unsigned int port, unsigned int enable); - grub_usb_speed_t (*detect_dev) (grub_usb_controller_t dev, int port, int *changed); + VasEBoot_usb_speed_t (*detect_dev) (VasEBoot_usb_controller_t dev, int port, int *changed); /* Per controller flag - port reset pending, don't do another reset */ - grub_uint64_t pending_reset; + VasEBoot_uint64_t pending_reset; /* Max. number of transfer descriptors used per one bulk transfer */ /* The reason is to prevent "exhausting" of TD by large bulk */ /* transfer - number of TD is limited in USB host driver */ /* Value is calculated/estimated in driver - some TDs should be */ /* reserved for posible concurrent control or "interrupt" transfers */ - grub_size_t max_bulk_tds; + VasEBoot_size_t max_bulk_tds; /* The next host controller. */ - struct grub_usb_controller_dev *next; + struct VasEBoot_usb_controller_dev *next; }; -struct grub_usb_controller +struct VasEBoot_usb_controller { /* The underlying USB Host Controller device. */ - grub_usb_controller_dev_t dev; + VasEBoot_usb_controller_dev_t dev; /* Data used by the USB Host Controller Driver. */ void *data; }; -struct grub_usb_interface +struct VasEBoot_usb_interface { - struct grub_usb_desc_if *descif; + struct VasEBoot_usb_desc_if *descif; - struct grub_usb_desc_endp *descendp; + struct VasEBoot_usb_desc_endp *descendp; /* A driver is handling this interface. Do we need to support multiple drivers for single interface? */ int attached; - void (*detach_hook) (struct grub_usb_device *dev, int config, int interface); + void (*detach_hook) (struct VasEBoot_usb_device *dev, int config, int interface); void *detach_data; }; -struct grub_usb_configuration +struct VasEBoot_usb_configuration { /* Configuration descriptors . */ - struct grub_usb_desc_config *descconf; + struct VasEBoot_usb_desc_config *descconf; /* Interfaces associated to this configuration. */ - struct grub_usb_interface interf[32]; + struct VasEBoot_usb_interface interf[32]; }; -struct grub_usb_hub_port +struct VasEBoot_usb_hub_port { - grub_uint64_t soft_limit_time; - grub_uint64_t hard_limit_time; + VasEBoot_uint64_t soft_limit_time; + VasEBoot_uint64_t hard_limit_time; enum { PORT_STATE_NORMAL = 0, PORT_STATE_WAITING_FOR_STABLE_POWER = 1, @@ -182,22 +182,22 @@ struct grub_usb_hub_port } state; }; -struct grub_usb_device +struct VasEBoot_usb_device { /* The device descriptor of this device. */ - struct grub_usb_desc_device descdev; + struct VasEBoot_usb_desc_device descdev; /* The controller the device is connected to. */ - struct grub_usb_controller controller; + struct VasEBoot_usb_controller controller; /* Device configurations (after opening the device). */ - struct grub_usb_configuration config[8]; + struct VasEBoot_usb_configuration config[8]; /* Device address. */ int addr; /* Device speed. */ - grub_usb_speed_t speed; + VasEBoot_usb_speed_t speed; /* All descriptors are read if this is set to 1. */ int initialized; @@ -211,18 +211,18 @@ struct grub_usb_device /* Hub information. */ /* Array of children for a hub. */ - grub_usb_device_t *children; + VasEBoot_usb_device_t *children; /* Number of hub ports. */ unsigned nports; - struct grub_usb_hub_port *ports; + struct VasEBoot_usb_hub_port *ports; - grub_usb_transfer_t hub_transfer; + VasEBoot_usb_transfer_t hub_transfer; - grub_uint32_t statuschange; + VasEBoot_uint32_t statuschange; - struct grub_usb_desc_endp *hub_endpoint; + struct VasEBoot_usb_desc_endp *hub_endpoint; /* EHCI Split Transfer information */ int split_hubport; @@ -232,94 +232,94 @@ struct grub_usb_device -typedef enum grub_usb_ep_type +typedef enum VasEBoot_usb_ep_type { - GRUB_USB_EP_CONTROL, - GRUB_USB_EP_ISOCHRONOUS, - GRUB_USB_EP_BULK, - GRUB_USB_EP_INTERRUPT - } grub_usb_ep_type_t; + VasEBoot_USB_EP_CONTROL, + VasEBoot_USB_EP_ISOCHRONOUS, + VasEBoot_USB_EP_BULK, + VasEBoot_USB_EP_INTERRUPT + } VasEBoot_usb_ep_type_t; -static inline enum grub_usb_ep_type -grub_usb_get_ep_type (struct grub_usb_desc_endp *ep) +static inline enum VasEBoot_usb_ep_type +VasEBoot_usb_get_ep_type (struct VasEBoot_usb_desc_endp *ep) { return ep->attrib & 3; } typedef enum { - GRUB_USB_CLASS_NOTHERE, - GRUB_USB_CLASS_AUDIO, - GRUB_USB_CLASS_COMMUNICATION, - GRUB_USB_CLASS_HID, - GRUB_USB_CLASS_XXX, - GRUB_USB_CLASS_PHYSICAL, - GRUB_USB_CLASS_IMAGE, - GRUB_USB_CLASS_PRINTER, - GRUB_USB_CLASS_MASS_STORAGE, - GRUB_USB_CLASS_HUB, - GRUB_USB_CLASS_DATA_INTERFACE, - GRUB_USB_CLASS_SMART_CARD, - GRUB_USB_CLASS_CONTENT_SECURITY, - GRUB_USB_CLASS_VIDEO - } grub_usb_classes_t; + VasEBoot_USB_CLASS_NOTHERE, + VasEBoot_USB_CLASS_AUDIO, + VasEBoot_USB_CLASS_COMMUNICATION, + VasEBoot_USB_CLASS_HID, + VasEBoot_USB_CLASS_XXX, + VasEBoot_USB_CLASS_PHYSICAL, + VasEBoot_USB_CLASS_IMAGE, + VasEBoot_USB_CLASS_PRINTER, + VasEBoot_USB_CLASS_MASS_STORAGE, + VasEBoot_USB_CLASS_HUB, + VasEBoot_USB_CLASS_DATA_INTERFACE, + VasEBoot_USB_CLASS_SMART_CARD, + VasEBoot_USB_CLASS_CONTENT_SECURITY, + VasEBoot_USB_CLASS_VIDEO + } VasEBoot_usb_classes_t; typedef enum { - GRUB_USBMS_SUBCLASS_BULK = 0x06, + VasEBoot_USBMS_SUBCLASS_BULK = 0x06, /* Experimental support for non-pure SCSI devices */ - GRUB_USBMS_SUBCLASS_RBC = 0x01, - GRUB_USBMS_SUBCLASS_MMC2 = 0x02, - GRUB_USBMS_SUBCLASS_UFI = 0x04, - GRUB_USBMS_SUBCLASS_SFF8070 = 0x05 - } grub_usbms_subclass_t; + VasEBoot_USBMS_SUBCLASS_RBC = 0x01, + VasEBoot_USBMS_SUBCLASS_MMC2 = 0x02, + VasEBoot_USBMS_SUBCLASS_UFI = 0x04, + VasEBoot_USBMS_SUBCLASS_SFF8070 = 0x05 + } VasEBoot_usbms_subclass_t; typedef enum { - GRUB_USBMS_PROTOCOL_BULK = 0x50, + VasEBoot_USBMS_PROTOCOL_BULK = 0x50, /* Experimental support for Control/Bulk/Interrupt (CBI) devices */ - GRUB_USBMS_PROTOCOL_CBI = 0x00, /* CBI with interrupt */ - GRUB_USBMS_PROTOCOL_CB = 0x01 /* CBI wthout interrupt */ - } grub_usbms_protocol_t; + VasEBoot_USBMS_PROTOCOL_CBI = 0x00, /* CBI with interrupt */ + VasEBoot_USBMS_PROTOCOL_CB = 0x01 /* CBI wthout interrupt */ + } VasEBoot_usbms_protocol_t; -static inline struct grub_usb_desc_if * -grub_usb_get_config_interface (struct grub_usb_desc_config *config) +static inline struct VasEBoot_usb_desc_if * +VasEBoot_usb_get_config_interface (struct VasEBoot_usb_desc_config *config) { - struct grub_usb_desc_if *interf; + struct VasEBoot_usb_desc_if *interf; - interf = (struct grub_usb_desc_if *) (sizeof (*config) + (char *) config); + interf = (struct VasEBoot_usb_desc_if *) (sizeof (*config) + (char *) config); return interf; } -typedef int (*grub_usb_attach_hook_class) (grub_usb_device_t usbdev, +typedef int (*VasEBoot_usb_attach_hook_class) (VasEBoot_usb_device_t usbdev, int configno, int interfno); -struct grub_usb_attach_desc +struct VasEBoot_usb_attach_desc { - struct grub_usb_attach_desc *next; - struct grub_usb_attach_desc **prev; + struct VasEBoot_usb_attach_desc *next; + struct VasEBoot_usb_attach_desc **prev; int class; - grub_usb_attach_hook_class hook; + VasEBoot_usb_attach_hook_class hook; }; -void grub_usb_register_attach_hook_class (struct grub_usb_attach_desc *desc); -void grub_usb_unregister_attach_hook_class (struct grub_usb_attach_desc *desc); +void VasEBoot_usb_register_attach_hook_class (struct VasEBoot_usb_attach_desc *desc); +void VasEBoot_usb_unregister_attach_hook_class (struct VasEBoot_usb_attach_desc *desc); -void grub_usb_poll_devices (int wait_for_completion); +void VasEBoot_usb_poll_devices (int wait_for_completion); -void grub_usb_device_attach (grub_usb_device_t dev); -grub_usb_err_t -grub_usb_bulk_read_extended (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, char *data, - int timeout, grub_size_t *actual); -grub_usb_transfer_t -grub_usb_bulk_read_background (grub_usb_device_t dev, - struct grub_usb_desc_endp *endpoint, - grub_size_t size, void *data); -grub_usb_err_t -grub_usb_check_transfer (grub_usb_transfer_t trans, grub_size_t *actual); +void VasEBoot_usb_device_attach (VasEBoot_usb_device_t dev); +VasEBoot_usb_err_t +VasEBoot_usb_bulk_read_extended (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, char *data, + int timeout, VasEBoot_size_t *actual); +VasEBoot_usb_transfer_t +VasEBoot_usb_bulk_read_background (VasEBoot_usb_device_t dev, + struct VasEBoot_usb_desc_endp *endpoint, + VasEBoot_size_t size, void *data); +VasEBoot_usb_err_t +VasEBoot_usb_check_transfer (VasEBoot_usb_transfer_t trans, VasEBoot_size_t *actual); void -grub_usb_cancel_transfer (grub_usb_transfer_t trans); +VasEBoot_usb_cancel_transfer (VasEBoot_usb_transfer_t trans); -#endif /* GRUB_USB_H */ +#endif /* VasEBoot_USB_H */ diff --git a/include/VasEBoot/usbdesc.h b/include/VasEBoot/usbdesc.h index aac5ab05a..129a7fa2a 100644 --- a/include/VasEBoot/usbdesc.h +++ b/include/VasEBoot/usbdesc.h @@ -1,134 +1,134 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_USBDESC_H -#define GRUB_USBDESC_H 1 +#ifndef VasEBoot_USBDESC_H +#define VasEBoot_USBDESC_H 1 -#include -#include +#include +#include typedef enum { - GRUB_USB_DESCRIPTOR_DEVICE = 1, - GRUB_USB_DESCRIPTOR_CONFIG, - GRUB_USB_DESCRIPTOR_STRING, - GRUB_USB_DESCRIPTOR_INTERFACE, - GRUB_USB_DESCRIPTOR_ENDPOINT, - GRUB_USB_DESCRIPTOR_DEBUG = 10, - GRUB_USB_DESCRIPTOR_HUB = 0x29 -} grub_usb_descriptor_t; + VasEBoot_USB_DESCRIPTOR_DEVICE = 1, + VasEBoot_USB_DESCRIPTOR_CONFIG, + VasEBoot_USB_DESCRIPTOR_STRING, + VasEBoot_USB_DESCRIPTOR_INTERFACE, + VasEBoot_USB_DESCRIPTOR_ENDPOINT, + VasEBoot_USB_DESCRIPTOR_DEBUG = 10, + VasEBoot_USB_DESCRIPTOR_HUB = 0x29 +} VasEBoot_usb_descriptor_t; -struct grub_usb_desc +struct VasEBoot_usb_desc { - grub_uint8_t length; - grub_uint8_t type; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; +} VasEBoot_PACKED; -struct grub_usb_desc_device +struct VasEBoot_usb_desc_device { - grub_uint8_t length; - grub_uint8_t type; - grub_uint16_t usbrel; - grub_uint8_t class; - grub_uint8_t subclass; - grub_uint8_t protocol; - grub_uint8_t maxsize0; - grub_uint16_t vendorid; - grub_uint16_t prodid; - grub_uint16_t devrel; - grub_uint8_t strvendor; - grub_uint8_t strprod; - grub_uint8_t strserial; - grub_uint8_t configcnt; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint16_t usbrel; + VasEBoot_uint8_t class; + VasEBoot_uint8_t subclass; + VasEBoot_uint8_t protocol; + VasEBoot_uint8_t maxsize0; + VasEBoot_uint16_t vendorid; + VasEBoot_uint16_t prodid; + VasEBoot_uint16_t devrel; + VasEBoot_uint8_t strvendor; + VasEBoot_uint8_t strprod; + VasEBoot_uint8_t strserial; + VasEBoot_uint8_t configcnt; +} VasEBoot_PACKED; -struct grub_usb_desc_config +struct VasEBoot_usb_desc_config { - grub_uint8_t length; - grub_uint8_t type; - grub_uint16_t totallen; - grub_uint8_t numif; - grub_uint8_t config; - grub_uint8_t strconfig; - grub_uint8_t attrib; - grub_uint8_t maxpower; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint16_t totallen; + VasEBoot_uint8_t numif; + VasEBoot_uint8_t config; + VasEBoot_uint8_t strconfig; + VasEBoot_uint8_t attrib; + VasEBoot_uint8_t maxpower; +} VasEBoot_PACKED; #if 0 -struct grub_usb_desc_if_association +struct VasEBoot_usb_desc_if_association { - grub_uint8_t length; - grub_uint8_t type; - grub_uint8_t firstif; - grub_uint8_t ifcnt; - grub_uint8_t class; - grub_uint8_t subclass; - grub_uint8_t protocol; - grub_uint8_t function; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint8_t firstif; + VasEBoot_uint8_t ifcnt; + VasEBoot_uint8_t class; + VasEBoot_uint8_t subclass; + VasEBoot_uint8_t protocol; + VasEBoot_uint8_t function; +} VasEBoot_PACKED; #endif -struct grub_usb_desc_if +struct VasEBoot_usb_desc_if { - grub_uint8_t length; - grub_uint8_t type; - grub_uint8_t ifnum; - grub_uint8_t altsetting; - grub_uint8_t endpointcnt; - grub_uint8_t class; - grub_uint8_t subclass; - grub_uint8_t protocol; - grub_uint8_t strif; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint8_t ifnum; + VasEBoot_uint8_t altsetting; + VasEBoot_uint8_t endpointcnt; + VasEBoot_uint8_t class; + VasEBoot_uint8_t subclass; + VasEBoot_uint8_t protocol; + VasEBoot_uint8_t strif; +} VasEBoot_PACKED; -struct grub_usb_desc_endp +struct VasEBoot_usb_desc_endp { - grub_uint8_t length; - grub_uint8_t type; - grub_uint8_t endp_addr; - grub_uint8_t attrib; - grub_uint16_t maxpacket; - grub_uint8_t interval; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint8_t endp_addr; + VasEBoot_uint8_t attrib; + VasEBoot_uint16_t maxpacket; + VasEBoot_uint8_t interval; +} VasEBoot_PACKED; -struct grub_usb_desc_str +struct VasEBoot_usb_desc_str { - grub_uint8_t length; - grub_uint8_t type; - grub_uint16_t str[0]; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint16_t str[0]; +} VasEBoot_PACKED; -struct grub_usb_desc_debug +struct VasEBoot_usb_desc_debug { - grub_uint8_t length; - grub_uint8_t type; - grub_uint8_t in_endp; - grub_uint8_t out_endp; -} GRUB_PACKED; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint8_t in_endp; + VasEBoot_uint8_t out_endp; +} VasEBoot_PACKED; -struct grub_usb_usb_hubdesc +struct VasEBoot_usb_usb_hubdesc { - grub_uint8_t length; - grub_uint8_t type; - grub_uint8_t portcnt; - grub_uint16_t characteristics; - grub_uint8_t pwdgood; - grub_uint8_t current; + VasEBoot_uint8_t length; + VasEBoot_uint8_t type; + VasEBoot_uint8_t portcnt; + VasEBoot_uint16_t characteristics; + VasEBoot_uint8_t pwdgood; + VasEBoot_uint8_t current; /* Removable and power control bits follow. */ -} GRUB_PACKED; +} VasEBoot_PACKED; -#endif /* GRUB_USBDESC_H */ +#endif /* VasEBoot_USBDESC_H */ diff --git a/include/VasEBoot/usbserial.h b/include/VasEBoot/usbserial.h index f81f97a51..c7d025ae6 100644 --- a/include/VasEBoot/usbserial.h +++ b/include/VasEBoot/usbserial.h @@ -1,39 +1,39 @@ /* serial.h - serial device interface */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_USBSERIAL_HEADER -#define GRUB_USBSERIAL_HEADER 1 +#ifndef VasEBoot_USBSERIAL_HEADER +#define VasEBoot_USBSERIAL_HEADER 1 -void grub_usbserial_fini (struct grub_serial_port *port); +void VasEBoot_usbserial_fini (struct VasEBoot_serial_port *port); -void grub_usbserial_detach (grub_usb_device_t usbdev, int configno, +void VasEBoot_usbserial_detach (VasEBoot_usb_device_t usbdev, int configno, int interfno); int -grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno, - struct grub_serial_driver *driver, int in_endp, +VasEBoot_usbserial_attach (VasEBoot_usb_device_t usbdev, int configno, int interfno, + struct VasEBoot_serial_driver *driver, int in_endp, int out_endp); enum { - GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING = -1 + VasEBoot_USB_SERIAL_ENDPOINT_LAST_MATCHING = -1 }; int -grub_usbserial_fetch (struct grub_serial_port *port, grub_size_t header_size); +VasEBoot_usbserial_fetch (struct VasEBoot_serial_port *port, VasEBoot_size_t header_size); #endif diff --git a/include/VasEBoot/usbtrans.h b/include/VasEBoot/usbtrans.h index aef482cb9..0e882a87b 100644 --- a/include/VasEBoot/usbtrans.h +++ b/include/VasEBoot/usbtrans.h @@ -1,50 +1,50 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_USBTRANS_H -#define GRUB_USBTRANS_H 1 +#ifndef VasEBoot_USBTRANS_H +#define VasEBoot_USBTRANS_H 1 #define MAX_USB_TRANSFER_LEN 0x0800 typedef enum { - GRUB_USB_TRANSFER_TYPE_IN, - GRUB_USB_TRANSFER_TYPE_OUT, - GRUB_USB_TRANSFER_TYPE_SETUP - } grub_transfer_type_t; + VasEBoot_USB_TRANSFER_TYPE_IN, + VasEBoot_USB_TRANSFER_TYPE_OUT, + VasEBoot_USB_TRANSFER_TYPE_SETUP + } VasEBoot_transfer_type_t; typedef enum { - GRUB_USB_TRANSACTION_TYPE_CONTROL, - GRUB_USB_TRANSACTION_TYPE_BULK - } grub_transaction_type_t; + VasEBoot_USB_TRANSACTION_TYPE_CONTROL, + VasEBoot_USB_TRANSACTION_TYPE_BULK + } VasEBoot_transaction_type_t; -struct grub_usb_transaction +struct VasEBoot_usb_transaction { int size; int toggle; - grub_transfer_type_t pid; - grub_uint32_t data; - grub_size_t preceding; + VasEBoot_transfer_type_t pid; + VasEBoot_uint32_t data; + VasEBoot_size_t preceding; }; -typedef struct grub_usb_transaction *grub_usb_transaction_t; +typedef struct VasEBoot_usb_transaction *VasEBoot_usb_transaction_t; -struct grub_usb_transfer +struct VasEBoot_usb_transfer { int devaddr; @@ -56,13 +56,13 @@ struct grub_usb_transfer int max; - grub_transaction_type_t type; + VasEBoot_transaction_type_t type; - grub_transfer_type_t dir; + VasEBoot_transfer_type_t dir; - struct grub_usb_device *dev; + struct VasEBoot_usb_device *dev; - struct grub_usb_transaction *transactions; + struct VasEBoot_usb_transaction *transactions; int last_trans; /* Index of last processed transaction in OHCI/UHCI driver. */ @@ -70,86 +70,86 @@ struct grub_usb_transfer void *controller_data; /* Used when finishing transfer to copy data back. */ - struct grub_pci_dma_chunk *data_chunk; + struct VasEBoot_pci_dma_chunk *data_chunk; void *data; }; -typedef struct grub_usb_transfer *grub_usb_transfer_t; +typedef struct VasEBoot_usb_transfer *VasEBoot_usb_transfer_t; enum { - GRUB_USB_REQTYPE_TARGET_DEV = (0 << 0), - GRUB_USB_REQTYPE_TARGET_INTERF = (1 << 0), - GRUB_USB_REQTYPE_TARGET_ENDP = (2 << 0), - GRUB_USB_REQTYPE_TARGET_OTHER = (3 << 0), - GRUB_USB_REQTYPE_STANDARD = (0 << 5), - GRUB_USB_REQTYPE_CLASS = (1 << 5), - GRUB_USB_REQTYPE_VENDOR = (2 << 5), - GRUB_USB_REQTYPE_OUT = (0 << 7), - GRUB_USB_REQTYPE_IN = (1 << 7), - GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT = GRUB_USB_REQTYPE_TARGET_INTERF - | GRUB_USB_REQTYPE_CLASS | GRUB_USB_REQTYPE_OUT, - GRUB_USB_REQTYPE_VENDOR_OUT = GRUB_USB_REQTYPE_VENDOR | GRUB_USB_REQTYPE_OUT, - GRUB_USB_REQTYPE_CLASS_INTERFACE_IN = GRUB_USB_REQTYPE_TARGET_INTERF - | GRUB_USB_REQTYPE_CLASS | GRUB_USB_REQTYPE_IN, - GRUB_USB_REQTYPE_VENDOR_IN = GRUB_USB_REQTYPE_VENDOR | GRUB_USB_REQTYPE_IN + VasEBoot_USB_REQTYPE_TARGET_DEV = (0 << 0), + VasEBoot_USB_REQTYPE_TARGET_INTERF = (1 << 0), + VasEBoot_USB_REQTYPE_TARGET_ENDP = (2 << 0), + VasEBoot_USB_REQTYPE_TARGET_OTHER = (3 << 0), + VasEBoot_USB_REQTYPE_STANDARD = (0 << 5), + VasEBoot_USB_REQTYPE_CLASS = (1 << 5), + VasEBoot_USB_REQTYPE_VENDOR = (2 << 5), + VasEBoot_USB_REQTYPE_OUT = (0 << 7), + VasEBoot_USB_REQTYPE_IN = (1 << 7), + VasEBoot_USB_REQTYPE_CLASS_INTERFACE_OUT = VasEBoot_USB_REQTYPE_TARGET_INTERF + | VasEBoot_USB_REQTYPE_CLASS | VasEBoot_USB_REQTYPE_OUT, + VasEBoot_USB_REQTYPE_VENDOR_OUT = VasEBoot_USB_REQTYPE_VENDOR | VasEBoot_USB_REQTYPE_OUT, + VasEBoot_USB_REQTYPE_CLASS_INTERFACE_IN = VasEBoot_USB_REQTYPE_TARGET_INTERF + | VasEBoot_USB_REQTYPE_CLASS | VasEBoot_USB_REQTYPE_IN, + VasEBoot_USB_REQTYPE_VENDOR_IN = VasEBoot_USB_REQTYPE_VENDOR | VasEBoot_USB_REQTYPE_IN }; enum { - GRUB_USB_REQ_GET_STATUS = 0x00, - GRUB_USB_REQ_CLEAR_FEATURE = 0x01, - GRUB_USB_REQ_SET_FEATURE = 0x03, - GRUB_USB_REQ_SET_ADDRESS = 0x05, - GRUB_USB_REQ_GET_DESCRIPTOR = 0x06, - GRUB_USB_REQ_SET_DESCRIPTOR = 0x07, - GRUB_USB_REQ_GET_CONFIGURATION = 0x08, - GRUB_USB_REQ_SET_CONFIGURATION = 0x09, - GRUB_USB_REQ_GET_INTERFACE = 0x0A, - GRUB_USB_REQ_SET_INTERFACE = 0x0B, - GRUB_USB_REQ_SYNC_FRAME = 0x0C + VasEBoot_USB_REQ_GET_STATUS = 0x00, + VasEBoot_USB_REQ_CLEAR_FEATURE = 0x01, + VasEBoot_USB_REQ_SET_FEATURE = 0x03, + VasEBoot_USB_REQ_SET_ADDRESS = 0x05, + VasEBoot_USB_REQ_GET_DESCRIPTOR = 0x06, + VasEBoot_USB_REQ_SET_DESCRIPTOR = 0x07, + VasEBoot_USB_REQ_GET_CONFIGURATION = 0x08, + VasEBoot_USB_REQ_SET_CONFIGURATION = 0x09, + VasEBoot_USB_REQ_GET_INTERFACE = 0x0A, + VasEBoot_USB_REQ_SET_INTERFACE = 0x0B, + VasEBoot_USB_REQ_SYNC_FRAME = 0x0C }; -#define GRUB_USB_FEATURE_ENDP_HALT 0x00 -#define GRUB_USB_FEATURE_DEV_REMOTE_WU 0x01 -#define GRUB_USB_FEATURE_TEST_MODE 0x02 +#define VasEBoot_USB_FEATURE_ENDP_HALT 0x00 +#define VasEBoot_USB_FEATURE_DEV_REMOTE_WU 0x01 +#define VasEBoot_USB_FEATURE_TEST_MODE 0x02 enum { - GRUB_USB_HUB_FEATURE_PORT_RESET = 0x04, - GRUB_USB_HUB_FEATURE_PORT_POWER = 0x08, - GRUB_USB_HUB_FEATURE_C_PORT_CONNECTED = 0x10, - GRUB_USB_HUB_FEATURE_C_PORT_ENABLED = 0x11, - GRUB_USB_HUB_FEATURE_C_PORT_SUSPEND = 0x12, - GRUB_USB_HUB_FEATURE_C_PORT_OVERCURRENT = 0x13, - GRUB_USB_HUB_FEATURE_C_PORT_RESET = 0x14 + VasEBoot_USB_HUB_FEATURE_PORT_RESET = 0x04, + VasEBoot_USB_HUB_FEATURE_PORT_POWER = 0x08, + VasEBoot_USB_HUB_FEATURE_C_PORT_CONNECTED = 0x10, + VasEBoot_USB_HUB_FEATURE_C_PORT_ENABLED = 0x11, + VasEBoot_USB_HUB_FEATURE_C_PORT_SUSPEND = 0x12, + VasEBoot_USB_HUB_FEATURE_C_PORT_OVERCURRENT = 0x13, + VasEBoot_USB_HUB_FEATURE_C_PORT_RESET = 0x14 }; enum { - GRUB_USB_HUB_STATUS_PORT_CONNECTED = (1 << 0), - GRUB_USB_HUB_STATUS_PORT_ENABLED = (1 << 1), - GRUB_USB_HUB_STATUS_PORT_SUSPEND = (1 << 2), - GRUB_USB_HUB_STATUS_PORT_OVERCURRENT = (1 << 3), - GRUB_USB_HUB_STATUS_PORT_POWERED = (1 << 8), - GRUB_USB_HUB_STATUS_PORT_LOWSPEED = (1 << 9), - GRUB_USB_HUB_STATUS_PORT_HIGHSPEED = (1 << 10), - GRUB_USB_HUB_STATUS_C_PORT_CONNECTED = (1 << 16), - GRUB_USB_HUB_STATUS_C_PORT_ENABLED = (1 << 17), - GRUB_USB_HUB_STATUS_C_PORT_SUSPEND = (1 << 18), - GRUB_USB_HUB_STATUS_C_PORT_OVERCURRENT = (1 << 19), - GRUB_USB_HUB_STATUS_C_PORT_RESET = (1 << 20) + VasEBoot_USB_HUB_STATUS_PORT_CONNECTED = (1 << 0), + VasEBoot_USB_HUB_STATUS_PORT_ENABLED = (1 << 1), + VasEBoot_USB_HUB_STATUS_PORT_SUSPEND = (1 << 2), + VasEBoot_USB_HUB_STATUS_PORT_OVERCURRENT = (1 << 3), + VasEBoot_USB_HUB_STATUS_PORT_POWERED = (1 << 8), + VasEBoot_USB_HUB_STATUS_PORT_LOWSPEED = (1 << 9), + VasEBoot_USB_HUB_STATUS_PORT_HIGHSPEED = (1 << 10), + VasEBoot_USB_HUB_STATUS_C_PORT_CONNECTED = (1 << 16), + VasEBoot_USB_HUB_STATUS_C_PORT_ENABLED = (1 << 17), + VasEBoot_USB_HUB_STATUS_C_PORT_SUSPEND = (1 << 18), + VasEBoot_USB_HUB_STATUS_C_PORT_OVERCURRENT = (1 << 19), + VasEBoot_USB_HUB_STATUS_C_PORT_RESET = (1 << 20) }; -struct grub_usb_packet_setup +struct VasEBoot_usb_packet_setup { - grub_uint8_t reqtype; - grub_uint8_t request; - grub_uint16_t value; - grub_uint16_t index; - grub_uint16_t length; -} GRUB_PACKED; + VasEBoot_uint8_t reqtype; + VasEBoot_uint8_t request; + VasEBoot_uint16_t value; + VasEBoot_uint16_t index; + VasEBoot_uint16_t length; +} VasEBoot_PACKED; -#endif /* GRUB_USBTRANS_H */ +#endif /* VasEBoot_USBTRANS_H */ diff --git a/include/VasEBoot/util/install.h b/include/VasEBoot/util/install.h index 5ca4811cd..0e8c2b925 100644 --- a/include/VasEBoot/util/install.h +++ b/include/VasEBoot/util/install.h @@ -1,62 +1,62 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UTIL_INSTALL_HEADER -#define GRUB_UTIL_INSTALL_HEADER 1 +#ifndef VasEBoot_UTIL_INSTALL_HEADER +#define VasEBoot_UTIL_INSTALL_HEADER 1 #include #include -#include -#include -#include +#include +#include +#include -#define GRUB_INSTALL_OPTIONS \ - { "modules", GRUB_INSTALL_OPTIONS_MODULES, N_("MODULES"), \ +#define VasEBoot_INSTALL_OPTIONS \ + { "modules", VasEBoot_INSTALL_OPTIONS_MODULES, N_("MODULES"), \ 0, N_("pre-load specified modules MODULES"), 1 }, \ - { "install-modules", GRUB_INSTALL_OPTIONS_INSTALL_MODULES, \ + { "install-modules", VasEBoot_INSTALL_OPTIONS_INSTALL_MODULES, \ N_("MODULES"), 0, \ N_("install only MODULES and their dependencies [default=all]"), 1 }, \ - { "themes", GRUB_INSTALL_OPTIONS_INSTALL_THEMES, N_("THEMES"), \ + { "themes", VasEBoot_INSTALL_OPTIONS_INSTALL_THEMES, N_("THEMES"), \ 0, N_("install THEMES [default=%s]"), 1 }, \ - { "fonts", GRUB_INSTALL_OPTIONS_INSTALL_FONTS, N_("FONTS"), \ + { "fonts", VasEBoot_INSTALL_OPTIONS_INSTALL_FONTS, N_("FONTS"), \ 0, N_("install FONTS [default=%s]"), 1 }, \ - { "locales", GRUB_INSTALL_OPTIONS_INSTALL_LOCALES, N_("LOCALES"),\ + { "locales", VasEBoot_INSTALL_OPTIONS_INSTALL_LOCALES, N_("LOCALES"),\ 0, N_("install only LOCALES [default=all]"), 1 }, \ - { "compress", GRUB_INSTALL_OPTIONS_INSTALL_COMPRESS, \ + { "compress", VasEBoot_INSTALL_OPTIONS_INSTALL_COMPRESS, \ "no|xz|gz|lzo", 0, \ - N_("compress GRUB files [optional]"), 1 }, \ - {"core-compress", GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS, \ + N_("compress VasEBoot files [optional]"), 1 }, \ + {"core-compress", VasEBoot_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS, \ "xz|none|auto", \ 0, N_("choose the compression to use for core image"), 2}, \ /* TRANSLATORS: platform here isn't identifier. It can be translated. */ \ { "directory", 'd', N_("DIR"), 0, \ N_("use images and modules under DIR [default=%s/]"), 1 }, \ - { "override-directory", GRUB_INSTALL_OPTIONS_DIRECTORY2, \ + { "override-directory", VasEBoot_INSTALL_OPTIONS_DIRECTORY2, \ N_("DIR"), OPTION_HIDDEN, \ N_("use images and modules under DIR [default=%s/]"), 1 }, \ - { "locale-directory", GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY, \ + { "locale-directory", VasEBoot_INSTALL_OPTIONS_LOCALE_DIRECTORY, \ N_("DIR"), 0, \ N_("use translations under DIR [default=%s]"), 1 }, \ - { "themes-directory", GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY, \ + { "themes-directory", VasEBoot_INSTALL_OPTIONS_THEMES_DIRECTORY, \ N_("DIR"), OPTION_HIDDEN, \ N_("use themes under DIR [default=%s]"), 1 }, \ - { "grub-mkimage", GRUB_INSTALL_OPTIONS_GRUB_MKIMAGE, \ + { "VasEBoot-mkimage", VasEBoot_INSTALL_OPTIONS_VasEBoot_MKIMAGE, \ "FILE", OPTION_HIDDEN, 0, 1 }, \ /* TRANSLATORS: "embed" is a verb (command description). "*/ \ { "pubkey", 'k', N_("FILE"), 0, \ @@ -65,194 +65,194 @@ N_("print verbose messages."), 1 } int -grub_install_parse (int key, char *arg); +VasEBoot_install_parse (int key, char *arg); void -grub_install_push_module (const char *val); +VasEBoot_install_push_module (const char *val); void -grub_install_pop_module (void); +VasEBoot_install_pop_module (void); char * -grub_install_help_filter (int key, const char *text, +VasEBoot_install_help_filter (int key, const char *text, void *input __attribute__ ((unused))); -enum grub_install_plat +enum VasEBoot_install_plat { - GRUB_INSTALL_PLATFORM_I386_PC, - GRUB_INSTALL_PLATFORM_I386_EFI, - GRUB_INSTALL_PLATFORM_I386_QEMU, - GRUB_INSTALL_PLATFORM_I386_COREBOOT, - GRUB_INSTALL_PLATFORM_I386_MULTIBOOT, - GRUB_INSTALL_PLATFORM_I386_IEEE1275, - GRUB_INSTALL_PLATFORM_X86_64_EFI, - GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, - GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275, - GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275, - GRUB_INSTALL_PLATFORM_MIPSEL_ARC, - GRUB_INSTALL_PLATFORM_MIPS_ARC, - GRUB_INSTALL_PLATFORM_IA64_EFI, - GRUB_INSTALL_PLATFORM_ARM_UBOOT, - GRUB_INSTALL_PLATFORM_ARM_EFI, - GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, - GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS, - GRUB_INSTALL_PLATFORM_I386_XEN, - GRUB_INSTALL_PLATFORM_X86_64_XEN, - GRUB_INSTALL_PLATFORM_ARM64_EFI, - GRUB_INSTALL_PLATFORM_MAX + VasEBoot_INSTALL_PLATFORM_I386_PC, + VasEBoot_INSTALL_PLATFORM_I386_EFI, + VasEBoot_INSTALL_PLATFORM_I386_QEMU, + VasEBoot_INSTALL_PLATFORM_I386_COREBOOT, + VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT, + VasEBoot_INSTALL_PLATFORM_I386_IEEE1275, + VasEBoot_INSTALL_PLATFORM_X86_64_EFI, + VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, + VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275, + VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275, + VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC, + VasEBoot_INSTALL_PLATFORM_MIPS_ARC, + VasEBoot_INSTALL_PLATFORM_IA64_EFI, + VasEBoot_INSTALL_PLATFORM_ARM_UBOOT, + VasEBoot_INSTALL_PLATFORM_ARM_EFI, + VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, + VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS, + VasEBoot_INSTALL_PLATFORM_I386_XEN, + VasEBoot_INSTALL_PLATFORM_X86_64_XEN, + VasEBoot_INSTALL_PLATFORM_ARM64_EFI, + VasEBoot_INSTALL_PLATFORM_MAX }; -enum grub_install_options { - GRUB_INSTALL_OPTIONS_DIRECTORY = 'd', - GRUB_INSTALL_OPTIONS_VERBOSITY = 'v', - GRUB_INSTALL_OPTIONS_MODULES = 0x201, - GRUB_INSTALL_OPTIONS_INSTALL_MODULES, - GRUB_INSTALL_OPTIONS_INSTALL_THEMES, - GRUB_INSTALL_OPTIONS_INSTALL_FONTS, - GRUB_INSTALL_OPTIONS_INSTALL_LOCALES, - GRUB_INSTALL_OPTIONS_INSTALL_COMPRESS, - GRUB_INSTALL_OPTIONS_DIRECTORY2, - GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY, - GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY, - GRUB_INSTALL_OPTIONS_GRUB_MKIMAGE, - GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS +enum VasEBoot_install_options { + VasEBoot_INSTALL_OPTIONS_DIRECTORY = 'd', + VasEBoot_INSTALL_OPTIONS_VERBOSITY = 'v', + VasEBoot_INSTALL_OPTIONS_MODULES = 0x201, + VasEBoot_INSTALL_OPTIONS_INSTALL_MODULES, + VasEBoot_INSTALL_OPTIONS_INSTALL_THEMES, + VasEBoot_INSTALL_OPTIONS_INSTALL_FONTS, + VasEBoot_INSTALL_OPTIONS_INSTALL_LOCALES, + VasEBoot_INSTALL_OPTIONS_INSTALL_COMPRESS, + VasEBoot_INSTALL_OPTIONS_DIRECTORY2, + VasEBoot_INSTALL_OPTIONS_LOCALE_DIRECTORY, + VasEBoot_INSTALL_OPTIONS_THEMES_DIRECTORY, + VasEBoot_INSTALL_OPTIONS_VasEBoot_MKIMAGE, + VasEBoot_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS }; -extern char *grub_install_source_directory; +extern char *VasEBoot_install_source_directory; -enum grub_install_plat -grub_install_get_target (const char *src); +enum VasEBoot_install_plat +VasEBoot_install_get_target (const char *src); void -grub_install_mkdir_p (const char *dst); +VasEBoot_install_mkdir_p (const char *dst); void -grub_install_copy_files (const char *src, +VasEBoot_install_copy_files (const char *src, const char *dst, - enum grub_install_plat platid); + enum VasEBoot_install_plat platid); char * -grub_install_get_platform_name (enum grub_install_plat platid); +VasEBoot_install_get_platform_name (enum VasEBoot_install_plat platid); const char * -grub_install_get_platform_cpu (enum grub_install_plat platid); +VasEBoot_install_get_platform_cpu (enum VasEBoot_install_plat platid); const char * -grub_install_get_platform_platform (enum grub_install_plat platid); +VasEBoot_install_get_platform_platform (enum VasEBoot_install_plat platid); char * -grub_install_get_platforms_string (void); +VasEBoot_install_get_platforms_string (void); typedef enum { - GRUB_COMPRESSION_AUTO, - GRUB_COMPRESSION_NONE, - GRUB_COMPRESSION_XZ, - GRUB_COMPRESSION_LZMA -} grub_compression_t; + VasEBoot_COMPRESSION_AUTO, + VasEBoot_COMPRESSION_NONE, + VasEBoot_COMPRESSION_XZ, + VasEBoot_COMPRESSION_LZMA +} VasEBoot_compression_t; void -grub_install_make_image_wrap (const char *dir, const char *prefix, +VasEBoot_install_make_image_wrap (const char *dir, const char *prefix, const char *outname, char *memdisk_path, char *config_path, const char *format, int note); void -grub_install_make_image_wrap_file (const char *dir, const char *prefix, +VasEBoot_install_make_image_wrap_file (const char *dir, const char *prefix, FILE *fp, const char *outname, char *memdisk_path, char *config_path, const char *mkimage_target, int note); int -grub_install_copy_file (const char *src, +VasEBoot_install_copy_file (const char *src, const char *dst, int is_critical); -struct grub_install_image_target_desc; +struct VasEBoot_install_image_target_desc; void -grub_install_generate_image (const char *dir, const char *prefix, +VasEBoot_install_generate_image (const char *dir, const char *prefix, FILE *out, const char *outname, char *mods[], char *memdisk_path, char **pubkey_paths, size_t npubkeys, char *config_path, - const struct grub_install_image_target_desc *image_target, + const struct VasEBoot_install_image_target_desc *image_target, int note, - grub_compression_t comp); + VasEBoot_compression_t comp); -const struct grub_install_image_target_desc * -grub_install_get_image_target (const char *arg); +const struct VasEBoot_install_image_target_desc * +VasEBoot_install_get_image_target (const char *arg); void -grub_util_bios_setup (const char *dir, +VasEBoot_util_bios_setup (const char *dir, const char *boot_file, const char *core_file, const char *dest, int force, int fs_probe, int allow_floppy, int add_rs_codes); void -grub_util_sparc_setup (const char *dir, +VasEBoot_util_sparc_setup (const char *dir, const char *boot_file, const char *core_file, const char *dest, int force, int fs_probe, int allow_floppy, int add_rs_codes); char * -grub_install_get_image_targets_string (void); +VasEBoot_install_get_image_targets_string (void); const char * -grub_util_get_target_dirname (const struct grub_install_image_target_desc *t); +VasEBoot_util_get_target_dirname (const struct VasEBoot_install_image_target_desc *t); void -grub_install_create_envblk_file (const char *name); +VasEBoot_install_create_envblk_file (const char *name); const char * -grub_install_get_default_x86_platform (void); +VasEBoot_install_get_default_x86_platform (void); void -grub_install_register_efi (grub_device_t efidir_grub_dev, +VasEBoot_install_register_efi (VasEBoot_device_t efidir_VasEBoot_dev, const char *efifile_path, const char *efi_distributor); void -grub_install_register_ieee1275 (int is_prep, const char *install_device, +VasEBoot_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath); void -grub_install_sgi_setup (const char *install_device, +VasEBoot_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname); int -grub_install_compress_gzip (const char *src, const char *dest); +VasEBoot_install_compress_gzip (const char *src, const char *dest); int -grub_install_compress_lzop (const char *src, const char *dest); +VasEBoot_install_compress_lzop (const char *src, const char *dest); int -grub_install_compress_xz (const char *src, const char *dest); +VasEBoot_install_compress_xz (const char *src, const char *dest); void -grub_install_get_blocklist (grub_device_t root_dev, +VasEBoot_install_get_blocklist (VasEBoot_device_t root_dev, const char *core_path, const char *core_img, size_t core_size, - void (*callback) (grub_disk_addr_t sector, + void (*callback) (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data), void *hook_data); void -grub_util_create_envblk_file (const char *name); +VasEBoot_util_create_envblk_file (const char *name); void -grub_util_glue_efi (const char *file32, const char *file64, const char *out); +VasEBoot_util_glue_efi (const char *file32, const char *file64, const char *out); void -grub_util_render_label (const char *label_font, +VasEBoot_util_render_label (const char *label_font, const char *label_bgcolor, const char *label_color, const char *label_string, const char *label); const char * -grub_util_get_target_name (const struct grub_install_image_target_desc *t); +VasEBoot_util_get_target_name (const struct VasEBoot_install_image_target_desc *t); -extern char *grub_install_copy_buffer; -#define GRUB_INSTALL_COPY_BUFFER_SIZE 1048576 +extern char *VasEBoot_install_copy_buffer; +#define VasEBoot_INSTALL_COPY_BUFFER_SIZE 1048576 #endif diff --git a/include/VasEBoot/util/libnvpair.h b/include/VasEBoot/util/libnvpair.h index 573c7ea81..1dba12835 100644 --- a/include/VasEBoot/util/libnvpair.h +++ b/include/VasEBoot/util/libnvpair.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LIBNVPAIR_UTIL_HEADER -#define GRUB_LIBNVPAIR_UTIL_HEADER 1 +#ifndef VasEBoot_LIBNVPAIR_UTIL_HEADER +#define VasEBoot_LIBNVPAIR_UTIL_HEADER 1 #include diff --git a/include/VasEBoot/util/libzfs.h b/include/VasEBoot/util/libzfs.h index a02caa335..672d38598 100644 --- a/include/VasEBoot/util/libzfs.h +++ b/include/VasEBoot/util/libzfs.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LIBZFS_UTIL_HEADER -#define GRUB_LIBZFS_UTIL_HEADER 1 +#ifndef VasEBoot_LIBZFS_UTIL_HEADER +#define VasEBoot_LIBZFS_UTIL_HEADER 1 #include @@ -25,7 +25,7 @@ #include #else /* ! HAVE_LIBZFS_H */ -#include +#include typedef void libzfs_handle_t; typedef void zpool_handle_t; @@ -42,6 +42,6 @@ extern nvlist_t *zpool_get_config (zpool_handle_t *, nvlist_t **); #endif /* ! HAVE_LIBZFS_H */ -libzfs_handle_t *grub_get_libzfs_handle (void); +libzfs_handle_t *VasEBoot_get_libzfs_handle (void); #endif diff --git a/include/VasEBoot/util/misc.h b/include/VasEBoot/util/misc.h index e9e0a6724..d72d2f2d5 100644 --- a/include/VasEBoot/util/misc.h +++ b/include/VasEBoot/util/misc.h @@ -1,23 +1,23 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UTIL_MISC_HEADER -#define GRUB_UTIL_MISC_HEADER 1 +#ifndef VasEBoot_UTIL_MISC_HEADER +#define VasEBoot_UTIL_MISC_HEADER 1 #include #include @@ -26,27 +26,27 @@ #include #include -#include -#include -#include +#include +#include +#include -char *grub_util_get_path (const char *dir, const char *file); -size_t grub_util_get_image_size (const char *path); -char *grub_util_read_image (const char *path); -void grub_util_load_image (const char *path, char *buf); -void grub_util_write_image (const char *img, size_t size, FILE *out, +char *VasEBoot_util_get_path (const char *dir, const char *file); +size_t VasEBoot_util_get_image_size (const char *path); +char *VasEBoot_util_read_image (const char *path); +void VasEBoot_util_load_image (const char *path, char *buf); +void VasEBoot_util_write_image (const char *img, size_t size, FILE *out, const char *name); -void grub_util_write_image_at (const void *img, size_t size, off_t offset, +void VasEBoot_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out, const char *name); char *make_system_path_relative_to_its_root (const char *path); -char *grub_canonicalize_file_name (const char *path); +char *VasEBoot_canonicalize_file_name (const char *path); -void grub_util_init_nls (void); +void VasEBoot_util_init_nls (void); -void grub_util_host_init (int *argc, char ***argv); +void VasEBoot_util_host_init (int *argc, char ***argv); -int grub_qsort_strcmp (const void *, const void *); +int VasEBoot_qsort_strcmp (const void *, const void *); -#endif /* ! GRUB_UTIL_MISC_HEADER */ +#endif /* ! VasEBoot_UTIL_MISC_HEADER */ diff --git a/include/VasEBoot/util/mkimage.h b/include/VasEBoot/util/mkimage.h index 1a18708a8..a095db636 100644 --- a/include/VasEBoot/util/mkimage.h +++ b/include/VasEBoot/util/mkimage.h @@ -1,69 +1,69 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UTIL_MKIMAGE_HEADER -#define GRUB_UTIL_MKIMAGE_HEADER 1 +#ifndef VasEBoot_UTIL_MKIMAGE_HEADER +#define VasEBoot_UTIL_MKIMAGE_HEADER 1 -struct grub_mkimage_layout +struct VasEBoot_mkimage_layout { size_t exec_size; size_t kernel_size; size_t bss_size; - grub_uint64_t start_address; + VasEBoot_uint64_t start_address; void *reloc_section; size_t reloc_size; size_t align; - grub_size_t ia64jmp_off; - grub_size_t tramp_off; - grub_size_t got_off; - grub_size_t got_size; + VasEBoot_size_t ia64jmp_off; + VasEBoot_size_t tramp_off; + VasEBoot_size_t got_off; + VasEBoot_size_t got_size; unsigned ia64jmpnum; - grub_uint32_t bss_start; - grub_uint32_t end; + VasEBoot_uint32_t bss_start; + VasEBoot_uint32_t end; }; /* Private header. Use only in mkimage-related sources. */ char * -grub_mkimage_load_image32 (const char *kernel_path, +VasEBoot_mkimage_load_image32 (const char *kernel_path, size_t total_module_size, - struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target); + struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target); char * -grub_mkimage_load_image64 (const char *kernel_path, +VasEBoot_mkimage_load_image64 (const char *kernel_path, size_t total_module_size, - struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target); + struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target); void -grub_mkimage_generate_elf32 (const struct grub_install_image_target_desc *image_target, +VasEBoot_mkimage_generate_elf32 (const struct VasEBoot_install_image_target_desc *image_target, int note, char **core_img, size_t *core_size, - Elf32_Addr target_addr, grub_size_t align, + Elf32_Addr target_addr, VasEBoot_size_t align, size_t kernel_size, size_t bss_size); void -grub_mkimage_generate_elf64 (const struct grub_install_image_target_desc *image_target, +VasEBoot_mkimage_generate_elf64 (const struct VasEBoot_install_image_target_desc *image_target, int note, char **core_img, size_t *core_size, - Elf64_Addr target_addr, grub_size_t align, + Elf64_Addr target_addr, VasEBoot_size_t align, size_t kernel_size, size_t bss_size); -struct grub_install_image_target_desc +struct VasEBoot_install_image_target_desc { const char *dirname; const char *names[6]; - grub_size_t voidp_sizeof; + VasEBoot_size_t voidp_sizeof; int bigendian; enum { IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT, @@ -85,101 +85,101 @@ struct grub_install_image_target_desc unsigned decompressor_uncompressed_addr; unsigned reloc_table_offset; unsigned link_align; - grub_uint16_t elf_target; + VasEBoot_uint16_t elf_target; unsigned section_align; signed vaddr_offset; - grub_uint64_t link_addr; + VasEBoot_uint64_t link_addr; unsigned mod_gap, mod_align; - grub_compression_t default_compression; - grub_uint16_t pe_target; + VasEBoot_compression_t default_compression; + VasEBoot_uint16_t pe_target; }; -#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x))) -#define grub_host_to_target32(x) (grub_host_to_target32_real (image_target, (x))) -#define grub_target_to_host64(x) (grub_target_to_host64_real (image_target, (x))) -#define grub_host_to_target64(x) (grub_host_to_target64_real (image_target, (x))) -#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (image_target, (x))) -#define grub_target_to_host16(x) (grub_target_to_host16_real (image_target, (x))) -#define grub_host_to_target16(x) (grub_host_to_target16_real (image_target, (x))) +#define VasEBoot_target_to_host32(x) (VasEBoot_target_to_host32_real (image_target, (x))) +#define VasEBoot_host_to_target32(x) (VasEBoot_host_to_target32_real (image_target, (x))) +#define VasEBoot_target_to_host64(x) (VasEBoot_target_to_host64_real (image_target, (x))) +#define VasEBoot_host_to_target64(x) (VasEBoot_host_to_target64_real (image_target, (x))) +#define VasEBoot_host_to_target_addr(x) (VasEBoot_host_to_target_addr_real (image_target, (x))) +#define VasEBoot_target_to_host16(x) (VasEBoot_target_to_host16_real (image_target, (x))) +#define VasEBoot_host_to_target16(x) (VasEBoot_host_to_target16_real (image_target, (x))) -static inline grub_uint32_t -grub_target_to_host32_real (const struct grub_install_image_target_desc *image_target, - grub_uint32_t in) +static inline VasEBoot_uint32_t +VasEBoot_target_to_host32_real (const struct VasEBoot_install_image_target_desc *image_target, + VasEBoot_uint32_t in) { if (image_target->bigendian) - return grub_be_to_cpu32 (in); + return VasEBoot_be_to_cpu32 (in); else - return grub_le_to_cpu32 (in); + return VasEBoot_le_to_cpu32 (in); } -static inline grub_uint64_t -grub_target_to_host64_real (const struct grub_install_image_target_desc *image_target, - grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_target_to_host64_real (const struct VasEBoot_install_image_target_desc *image_target, + VasEBoot_uint64_t in) { if (image_target->bigendian) - return grub_be_to_cpu64 (in); + return VasEBoot_be_to_cpu64 (in); else - return grub_le_to_cpu64 (in); + return VasEBoot_le_to_cpu64 (in); } -static inline grub_uint64_t -grub_host_to_target64_real (const struct grub_install_image_target_desc *image_target, - grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_host_to_target64_real (const struct VasEBoot_install_image_target_desc *image_target, + VasEBoot_uint64_t in) { if (image_target->bigendian) - return grub_cpu_to_be64 (in); + return VasEBoot_cpu_to_be64 (in); else - return grub_cpu_to_le64 (in); + return VasEBoot_cpu_to_le64 (in); } -static inline grub_uint32_t -grub_host_to_target32_real (const struct grub_install_image_target_desc *image_target, - grub_uint32_t in) +static inline VasEBoot_uint32_t +VasEBoot_host_to_target32_real (const struct VasEBoot_install_image_target_desc *image_target, + VasEBoot_uint32_t in) { if (image_target->bigendian) - return grub_cpu_to_be32 (in); + return VasEBoot_cpu_to_be32 (in); else - return grub_cpu_to_le32 (in); + return VasEBoot_cpu_to_le32 (in); } -static inline grub_uint16_t -grub_target_to_host16_real (const struct grub_install_image_target_desc *image_target, - grub_uint16_t in) +static inline VasEBoot_uint16_t +VasEBoot_target_to_host16_real (const struct VasEBoot_install_image_target_desc *image_target, + VasEBoot_uint16_t in) { if (image_target->bigendian) - return grub_be_to_cpu16 (in); + return VasEBoot_be_to_cpu16 (in); else - return grub_le_to_cpu16 (in); + return VasEBoot_le_to_cpu16 (in); } -static inline grub_uint16_t -grub_host_to_target16_real (const struct grub_install_image_target_desc *image_target, - grub_uint16_t in) +static inline VasEBoot_uint16_t +VasEBoot_host_to_target16_real (const struct VasEBoot_install_image_target_desc *image_target, + VasEBoot_uint16_t in) { if (image_target->bigendian) - return grub_cpu_to_be16 (in); + return VasEBoot_cpu_to_be16 (in); else - return grub_cpu_to_le16 (in); + return VasEBoot_cpu_to_le16 (in); } -static inline grub_uint64_t -grub_host_to_target_addr_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_host_to_target_addr_real (const struct VasEBoot_install_image_target_desc *image_target, VasEBoot_uint64_t in) { if (image_target->voidp_sizeof == 8) - return grub_host_to_target64_real (image_target, in); + return VasEBoot_host_to_target64_real (image_target, in); else - return grub_host_to_target32_real (image_target, in); + return VasEBoot_host_to_target32_real (image_target, in); } -static inline grub_uint64_t -grub_target_to_host_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_target_to_host_real (const struct VasEBoot_install_image_target_desc *image_target, VasEBoot_uint64_t in) { if (image_target->voidp_sizeof == 8) - return grub_target_to_host64_real (image_target, in); + return VasEBoot_target_to_host64_real (image_target, in); else - return grub_target_to_host32_real (image_target, in); + return VasEBoot_target_to_host32_real (image_target, in); } -#define grub_target_to_host(val) grub_target_to_host_real(image_target, (val)) +#define VasEBoot_target_to_host(val) VasEBoot_target_to_host_real(image_target, (val)) #endif diff --git a/include/VasEBoot/util/ofpath.h b/include/VasEBoot/util/ofpath.h index b43c523cb..f3d822bbb 100644 --- a/include/VasEBoot/util/ofpath.h +++ b/include/VasEBoot/util/ofpath.h @@ -1,6 +1,6 @@ -#ifndef GRUB_OFPATH_MACHINE_UTIL_HEADER -#define GRUB_OFPATH_MACHINE_UTIL_HEADER 1 +#ifndef VasEBoot_OFPATH_MACHINE_UTIL_HEADER +#define VasEBoot_OFPATH_MACHINE_UTIL_HEADER 1 -char *grub_util_devname_to_ofpath (const char *devname); +char *VasEBoot_util_devname_to_ofpath (const char *devname); -#endif /* ! GRUB_OFPATH_MACHINE_UTIL_HEADER */ +#endif /* ! VasEBoot_OFPATH_MACHINE_UTIL_HEADER */ diff --git a/include/VasEBoot/util/resolve.h b/include/VasEBoot/util/resolve.h index 8923a6e6c..8af2e6c84 100644 --- a/include/VasEBoot/util/resolve.h +++ b/include/VasEBoot/util/resolve.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_UTIL_RESOLVE_HEADER -#define GRUB_UTIL_RESOLVE_HEADER 1 +#ifndef VasEBoot_UTIL_RESOLVE_HEADER +#define VasEBoot_UTIL_RESOLVE_HEADER 1 -struct grub_util_path_list +struct VasEBoot_util_path_list { const char *name; - struct grub_util_path_list *next; + struct VasEBoot_util_path_list *next; }; /* Resolve the dependencies of the modules MODULES using the information in the file DEP_LIST_FILE. The directory PREFIX is used to find files. */ -struct grub_util_path_list * -grub_util_resolve_dependencies (const char *prefix, +struct VasEBoot_util_path_list * +VasEBoot_util_resolve_dependencies (const char *prefix, const char *dep_list_file, char *modules[]); -void grub_util_free_path_list (struct grub_util_path_list *path_list); +void VasEBoot_util_free_path_list (struct VasEBoot_util_path_list *path_list); -#endif /* ! GRUB_UTIL_RESOLVE_HEADER */ +#endif /* ! VasEBoot_UTIL_RESOLVE_HEADER */ diff --git a/include/VasEBoot/util/windows.h b/include/VasEBoot/util/windows.h index 630948393..23ca0f35f 100644 --- a/include/VasEBoot/util/windows.h +++ b/include/VasEBoot/util/windows.h @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_WINDOWS_UTIL_HEADER -#define GRUB_WINDOWS_UTIL_HEADER 1 +#ifndef VasEBoot_WINDOWS_UTIL_HEADER +#define VasEBoot_WINDOWS_UTIL_HEADER 1 #include LPTSTR -grub_util_get_windows_path (const char *unix_path); +VasEBoot_util_get_windows_path (const char *unix_path); char * -grub_util_tchar_to_utf8 (LPCTSTR in); +VasEBoot_util_tchar_to_utf8 (LPCTSTR in); TCHAR * -grub_get_mount_point (const TCHAR *path); +VasEBoot_get_mount_point (const TCHAR *path); #endif diff --git a/include/VasEBoot/verity-hash.h b/include/VasEBoot/verity-hash.h index 448d9aff0..cbb7f48c5 100644 --- a/include/VasEBoot/verity-hash.h +++ b/include/VasEBoot/verity-hash.h @@ -15,7 +15,7 @@ /** - * grub_pass_verity_hash - Reads the CoreOS verity hash value from a well known + * VasEBoot_pass_verity_hash - Reads the CoreOS verity hash value from a well known * kernel image offset and adds a kernel command line argument for it. * * @pImage: Kernel image buffer. @@ -23,12 +23,12 @@ * @cmdline_max_len: Kernel command line buffer length. */ -static inline void grub_pass_verity_hash(const void *pImage, +static inline void VasEBoot_pass_verity_hash(const void *pImage, char *cmdline, - grub_size_t cmdline_max_len) + VasEBoot_size_t cmdline_max_len) { const char *buf = pImage; - grub_size_t cmdline_len; + VasEBoot_size_t cmdline_len; int i; for (i=VERITY_HASH_OFFSET; i cmdline_max_len) return; - grub_memcpy (cmdline + cmdline_len, VERITY_ARG, VERITY_ARG_LENGTH); + VasEBoot_memcpy (cmdline + cmdline_len, VERITY_ARG, VERITY_ARG_LENGTH); cmdline_len += VERITY_ARG_LENGTH; - grub_memcpy (cmdline + cmdline_len, buf + VERITY_HASH_OFFSET, + VasEBoot_memcpy (cmdline + cmdline_len, buf + VERITY_HASH_OFFSET, VERITY_HASH_LENGTH); cmdline_len += VERITY_HASH_LENGTH; cmdline[cmdline_len] = '\0'; diff --git a/include/VasEBoot/vga.h b/include/VasEBoot/vga.h index 1d8449c64..ce45fa3d0 100644 --- a/include/VasEBoot/vga.h +++ b/include/VasEBoot/vga.h @@ -1,128 +1,128 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_VGA_HEADER -#define GRUB_VGA_HEADER 1 +#ifndef VasEBoot_VGA_HEADER +#define VasEBoot_VGA_HEADER 1 -#ifndef GRUB_MACHINE_MIPS_QEMU_MIPS -#include +#ifndef VasEBoot_MACHINE_MIPS_QEMU_MIPS +#include #else -#include -#define GRUB_MACHINE_PCI_IO_BASE 0xb4000000 +#include +#define VasEBoot_MACHINE_PCI_IO_BASE 0xb4000000 #endif -#include +#include static inline void -grub_vga_gr_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_vga_gr_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_GR_INDEX); - grub_outb (val, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_GR_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_GR_INDEX); + VasEBoot_outb (val, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_GR_DATA); } -static inline grub_uint8_t -grub_vga_gr_read (grub_uint8_t addr) +static inline VasEBoot_uint8_t +VasEBoot_vga_gr_read (VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_GR_INDEX); - return grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_GR_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_GR_INDEX); + return VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_GR_DATA); } static inline void -grub_vga_cr_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_vga_cr_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_INDEX); - grub_outb (val, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_INDEX); + VasEBoot_outb (val, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_DATA); } -static inline grub_uint8_t -grub_vga_cr_read (grub_uint8_t addr) +static inline VasEBoot_uint8_t +VasEBoot_vga_cr_read (VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_INDEX); - return grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_INDEX); + return VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_DATA); } static inline void -grub_vga_cr_bw_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_vga_cr_bw_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_BW_INDEX); - grub_outb (val, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_BW_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_BW_INDEX); + VasEBoot_outb (val, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_BW_DATA); } -static inline grub_uint8_t -grub_vga_cr_bw_read (grub_uint8_t addr) +static inline VasEBoot_uint8_t +VasEBoot_vga_cr_bw_read (VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_BW_INDEX); - return grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_CR_BW_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_BW_INDEX); + return VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_CR_BW_DATA); } static inline void -grub_vga_sr_write (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_vga_sr_write (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_INDEX); - grub_outb (val, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_SR_INDEX); + VasEBoot_outb (val, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_SR_DATA); } -static inline grub_uint8_t -grub_vga_sr_read (grub_uint8_t addr) +static inline VasEBoot_uint8_t +VasEBoot_vga_sr_read (VasEBoot_uint8_t addr) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_INDEX); - return grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_SR_INDEX); + return VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_SR_DATA); } static inline void -grub_vga_palette_read (grub_uint8_t addr, grub_uint8_t *r, grub_uint8_t *g, - grub_uint8_t *b) +VasEBoot_vga_palette_read (VasEBoot_uint8_t addr, VasEBoot_uint8_t *r, VasEBoot_uint8_t *g, + VasEBoot_uint8_t *b) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_READ_INDEX); - *r = grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_DATA); - *g = grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_DATA); - *b = grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_READ_INDEX); + *r = VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_DATA); + *g = VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_DATA); + *b = VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_DATA); } static inline void -grub_vga_palette_write (grub_uint8_t addr, grub_uint8_t r, grub_uint8_t g, - grub_uint8_t b) +VasEBoot_vga_palette_write (VasEBoot_uint8_t addr, VasEBoot_uint8_t r, VasEBoot_uint8_t g, + VasEBoot_uint8_t b) { - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_WRITE_INDEX); - grub_outb (r, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_DATA); - grub_outb (g, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_DATA); - grub_outb (b, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_PALLETTE_DATA); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_WRITE_INDEX); + VasEBoot_outb (r, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_DATA); + VasEBoot_outb (g, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_DATA); + VasEBoot_outb (b, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_PALLETTE_DATA); } static inline void -grub_vga_write_arx (grub_uint8_t val, grub_uint8_t addr) +VasEBoot_vga_write_arx (VasEBoot_uint8_t val, VasEBoot_uint8_t addr) { - grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_INPUT_STATUS1_REGISTER); - grub_inb (GRUB_MACHINE_PCI_IO_BASE + 0x3ba); + VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_INPUT_STATUS1_REGISTER); + VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + 0x3ba); - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX); - grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX_READ); - grub_outb (val, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX); + VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX_READ); + VasEBoot_outb (val, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX); } -static inline grub_uint8_t -grub_vga_read_arx (grub_uint8_t addr) +static inline VasEBoot_uint8_t +VasEBoot_vga_read_arx (VasEBoot_uint8_t addr) { - grub_uint8_t val; - grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_INPUT_STATUS1_REGISTER); - grub_outb (addr, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX); - val = grub_inb (GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX_READ); - grub_outb (val, GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_ARX); + VasEBoot_uint8_t val; + VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_INPUT_STATUS1_REGISTER); + VasEBoot_outb (addr, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX); + val = VasEBoot_inb (VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX_READ); + VasEBoot_outb (val, VasEBoot_MACHINE_PCI_IO_BASE + VasEBoot_VGA_IO_ARX); return val; } diff --git a/include/VasEBoot/vgaregs.h b/include/VasEBoot/vgaregs.h index 1a666a1f0..59042faef 100644 --- a/include/VasEBoot/vgaregs.h +++ b/include/VasEBoot/vgaregs.h @@ -1,235 +1,235 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_VGAREGS_HEADER -#define GRUB_VGAREGS_HEADER 1 +#ifndef VasEBoot_VGAREGS_HEADER +#define VasEBoot_VGAREGS_HEADER 1 #ifdef ASM_FILE -#define GRUB_VGA_IO_SR_INDEX 0x3c4 -#define GRUB_VGA_IO_SR_DATA 0x3c5 +#define VasEBoot_VGA_IO_SR_INDEX 0x3c4 +#define VasEBoot_VGA_IO_SR_DATA 0x3c5 #else enum { - GRUB_VGA_IO_CR_BW_INDEX = 0x3b4, - GRUB_VGA_IO_CR_BW_DATA = 0x3b5, - GRUB_VGA_IO_ARX = 0x3c0, - GRUB_VGA_IO_ARX_READ = 0x3c1, - GRUB_VGA_IO_MISC_WRITE = 0x3c2, - GRUB_VGA_IO_SR_INDEX = 0x3c4, - GRUB_VGA_IO_SR_DATA = 0x3c5, - GRUB_VGA_IO_PIXEL_MASK = 0x3c6, - GRUB_VGA_IO_PALLETTE_READ_INDEX = 0x3c7, - GRUB_VGA_IO_PALLETTE_WRITE_INDEX = 0x3c8, - GRUB_VGA_IO_PALLETTE_DATA = 0x3c9, - GRUB_VGA_IO_GR_INDEX = 0x3ce, - GRUB_VGA_IO_GR_DATA = 0x3cf, - GRUB_VGA_IO_CR_INDEX = 0x3d4, - GRUB_VGA_IO_CR_DATA = 0x3d5, - GRUB_VGA_IO_INPUT_STATUS1_REGISTER = 0x3da + VasEBoot_VGA_IO_CR_BW_INDEX = 0x3b4, + VasEBoot_VGA_IO_CR_BW_DATA = 0x3b5, + VasEBoot_VGA_IO_ARX = 0x3c0, + VasEBoot_VGA_IO_ARX_READ = 0x3c1, + VasEBoot_VGA_IO_MISC_WRITE = 0x3c2, + VasEBoot_VGA_IO_SR_INDEX = 0x3c4, + VasEBoot_VGA_IO_SR_DATA = 0x3c5, + VasEBoot_VGA_IO_PIXEL_MASK = 0x3c6, + VasEBoot_VGA_IO_PALLETTE_READ_INDEX = 0x3c7, + VasEBoot_VGA_IO_PALLETTE_WRITE_INDEX = 0x3c8, + VasEBoot_VGA_IO_PALLETTE_DATA = 0x3c9, + VasEBoot_VGA_IO_GR_INDEX = 0x3ce, + VasEBoot_VGA_IO_GR_DATA = 0x3cf, + VasEBoot_VGA_IO_CR_INDEX = 0x3d4, + VasEBoot_VGA_IO_CR_DATA = 0x3d5, + VasEBoot_VGA_IO_INPUT_STATUS1_REGISTER = 0x3da }; -#define GRUB_VGA_IO_INPUT_STATUS1_VERTR_BIT 0x08 +#define VasEBoot_VGA_IO_INPUT_STATUS1_VERTR_BIT 0x08 enum { - GRUB_VGA_CR_HTOTAL = 0x00, - GRUB_VGA_CR_HORIZ_END = 0x01, - GRUB_VGA_CR_HBLANK_START = 0x02, - GRUB_VGA_CR_HBLANK_END = 0x03, - GRUB_VGA_CR_HORIZ_SYNC_PULSE_START = 0x04, - GRUB_VGA_CR_HORIZ_SYNC_PULSE_END = 0x05, - GRUB_VGA_CR_VERT_TOTAL = 0x06, - GRUB_VGA_CR_OVERFLOW = 0x07, - GRUB_VGA_CR_BYTE_PANNING = 0x08, - GRUB_VGA_CR_CELL_HEIGHT = 0x09, - GRUB_VGA_CR_CURSOR_START = 0x0a, - GRUB_VGA_CR_CURSOR_END = 0x0b, - GRUB_VGA_CR_START_ADDR_HIGH_REGISTER = 0x0c, - GRUB_VGA_CR_START_ADDR_LOW_REGISTER = 0x0d, - GRUB_VGA_CR_CURSOR_ADDR_HIGH = 0x0e, - GRUB_VGA_CR_CURSOR_ADDR_LOW = 0x0f, - GRUB_VGA_CR_VSYNC_START = 0x10, - GRUB_VGA_CR_VSYNC_END = 0x11, - GRUB_VGA_CR_VDISPLAY_END = 0x12, - GRUB_VGA_CR_PITCH = 0x13, - GRUB_VGA_CR_UNDERLINE_LOCATION = 0x14, - GRUB_VGA_CR_VERTICAL_BLANK_START = 0x15, - GRUB_VGA_CR_VERTICAL_BLANK_END = 0x16, - GRUB_VGA_CR_MODE = 0x17, - GRUB_VGA_CR_LINE_COMPARE = 0x18, + VasEBoot_VGA_CR_HTOTAL = 0x00, + VasEBoot_VGA_CR_HORIZ_END = 0x01, + VasEBoot_VGA_CR_HBLANK_START = 0x02, + VasEBoot_VGA_CR_HBLANK_END = 0x03, + VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_START = 0x04, + VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_END = 0x05, + VasEBoot_VGA_CR_VERT_TOTAL = 0x06, + VasEBoot_VGA_CR_OVERFLOW = 0x07, + VasEBoot_VGA_CR_BYTE_PANNING = 0x08, + VasEBoot_VGA_CR_CELL_HEIGHT = 0x09, + VasEBoot_VGA_CR_CURSOR_START = 0x0a, + VasEBoot_VGA_CR_CURSOR_END = 0x0b, + VasEBoot_VGA_CR_START_ADDR_HIGH_REGISTER = 0x0c, + VasEBoot_VGA_CR_START_ADDR_LOW_REGISTER = 0x0d, + VasEBoot_VGA_CR_CURSOR_ADDR_HIGH = 0x0e, + VasEBoot_VGA_CR_CURSOR_ADDR_LOW = 0x0f, + VasEBoot_VGA_CR_VSYNC_START = 0x10, + VasEBoot_VGA_CR_VSYNC_END = 0x11, + VasEBoot_VGA_CR_VDISPLAY_END = 0x12, + VasEBoot_VGA_CR_PITCH = 0x13, + VasEBoot_VGA_CR_UNDERLINE_LOCATION = 0x14, + VasEBoot_VGA_CR_VERTICAL_BLANK_START = 0x15, + VasEBoot_VGA_CR_VERTICAL_BLANK_END = 0x16, + VasEBoot_VGA_CR_MODE = 0x17, + VasEBoot_VGA_CR_LINE_COMPARE = 0x18, }; enum { - GRUB_VGA_CR_BYTE_PANNING_NORMAL = 0 + VasEBoot_VGA_CR_BYTE_PANNING_NORMAL = 0 }; enum { - GRUB_VGA_CR_UNDERLINE_LOCATION_DWORD_MODE = 0x40 + VasEBoot_VGA_CR_UNDERLINE_LOCATION_DWORD_MODE = 0x40 }; enum { - GRUB_VGA_IO_MISC_COLOR = 0x01, - GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS = 0x02, - GRUB_VGA_IO_MISC_28MHZ = 0x04, - GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0 = 0x08, - GRUB_VGA_IO_MISC_UPPER_64K = 0x20, - GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY = 0x40, - GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY = 0x80, + VasEBoot_VGA_IO_MISC_COLOR = 0x01, + VasEBoot_VGA_IO_MISC_ENABLE_VRAM_ACCESS = 0x02, + VasEBoot_VGA_IO_MISC_28MHZ = 0x04, + VasEBoot_VGA_IO_MISC_EXTERNAL_CLOCK_0 = 0x08, + VasEBoot_VGA_IO_MISC_UPPER_64K = 0x20, + VasEBoot_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY = 0x40, + VasEBoot_VGA_IO_MISC_NEGATIVE_VERT_POLARITY = 0x80, }; enum { - GRUB_VGA_ARX_MODE = 0x10, - GRUB_VGA_ARX_OVERSCAN = 0x11, - GRUB_VGA_ARX_COLOR_PLANE_ENABLE = 0x12, - GRUB_VGA_ARX_HORIZONTAL_PANNING = 0x13, - GRUB_VGA_ARX_COLOR_SELECT = 0x14 + VasEBoot_VGA_ARX_MODE = 0x10, + VasEBoot_VGA_ARX_OVERSCAN = 0x11, + VasEBoot_VGA_ARX_COLOR_PLANE_ENABLE = 0x12, + VasEBoot_VGA_ARX_HORIZONTAL_PANNING = 0x13, + VasEBoot_VGA_ARX_COLOR_SELECT = 0x14 }; enum { - GRUB_VGA_ARX_MODE_TEXT = 0x00, - GRUB_VGA_ARX_MODE_GRAPHICS = 0x01, - GRUB_VGA_ARX_MODE_ENABLE_256COLOR = 0x40 + VasEBoot_VGA_ARX_MODE_TEXT = 0x00, + VasEBoot_VGA_ARX_MODE_GRAPHICS = 0x01, + VasEBoot_VGA_ARX_MODE_ENABLE_256COLOR = 0x40 }; -#define GRUB_VGA_CR_WIDTH_DIVISOR 8 +#define VasEBoot_VGA_CR_WIDTH_DIVISOR 8 -#define GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_SHIFT 7 -#define GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_MASK 0x02 -#define GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_SHIFT 3 -#define GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_MASK 0x40 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_SHIFT 7 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_MASK 0x02 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_SHIFT 3 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_MASK 0x40 -#define GRUB_VGA_CR_OVERFLOW_VERT_TOTAL1_SHIFT 8 -#define GRUB_VGA_CR_OVERFLOW_VERT_TOTAL1_MASK 0x01 -#define GRUB_VGA_CR_OVERFLOW_VERT_TOTAL2_SHIFT 4 -#define GRUB_VGA_CR_OVERFLOW_VERT_TOTAL2_MASK 0x20 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL1_SHIFT 8 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL1_MASK 0x01 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL2_SHIFT 4 +#define VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL2_MASK 0x20 -#define GRUB_VGA_CR_OVERFLOW_VSYNC_START1_SHIFT 6 -#define GRUB_VGA_CR_OVERFLOW_VSYNC_START1_MASK 0x04 -#define GRUB_VGA_CR_OVERFLOW_VSYNC_START2_SHIFT 2 -#define GRUB_VGA_CR_OVERFLOW_VSYNC_START2_MASK 0x80 +#define VasEBoot_VGA_CR_OVERFLOW_VSYNC_START1_SHIFT 6 +#define VasEBoot_VGA_CR_OVERFLOW_VSYNC_START1_MASK 0x04 +#define VasEBoot_VGA_CR_OVERFLOW_VSYNC_START2_SHIFT 2 +#define VasEBoot_VGA_CR_OVERFLOW_VSYNC_START2_MASK 0x80 -#define GRUB_VGA_CR_OVERFLOW_HEIGHT1_SHIFT 7 -#define GRUB_VGA_CR_OVERFLOW_HEIGHT1_MASK 0x02 -#define GRUB_VGA_CR_OVERFLOW_HEIGHT2_SHIFT 3 -#define GRUB_VGA_CR_OVERFLOW_HEIGHT2_MASK 0xc0 -#define GRUB_VGA_CR_OVERFLOW_LINE_COMPARE_SHIFT 4 -#define GRUB_VGA_CR_OVERFLOW_LINE_COMPARE_MASK 0x10 +#define VasEBoot_VGA_CR_OVERFLOW_HEIGHT1_SHIFT 7 +#define VasEBoot_VGA_CR_OVERFLOW_HEIGHT1_MASK 0x02 +#define VasEBoot_VGA_CR_OVERFLOW_HEIGHT2_SHIFT 3 +#define VasEBoot_VGA_CR_OVERFLOW_HEIGHT2_MASK 0xc0 +#define VasEBoot_VGA_CR_OVERFLOW_LINE_COMPARE_SHIFT 4 +#define VasEBoot_VGA_CR_OVERFLOW_LINE_COMPARE_MASK 0x10 -#define GRUB_VGA_CR_CELL_HEIGHT_LINE_COMPARE_MASK 0x40 -#define GRUB_VGA_CR_CELL_HEIGHT_LINE_COMPARE_SHIFT 3 -#define GRUB_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_MASK 0x20 -#define GRUB_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_SHIFT 4 -#define GRUB_VGA_CR_CELL_HEIGHT_DOUBLE_SCAN 0x80 +#define VasEBoot_VGA_CR_CELL_HEIGHT_LINE_COMPARE_MASK 0x40 +#define VasEBoot_VGA_CR_CELL_HEIGHT_LINE_COMPARE_SHIFT 3 +#define VasEBoot_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_MASK 0x20 +#define VasEBoot_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_SHIFT 4 +#define VasEBoot_VGA_CR_CELL_HEIGHT_DOUBLE_SCAN 0x80 enum { - GRUB_VGA_CR_CURSOR_START_DISABLE = (1 << 5) + VasEBoot_VGA_CR_CURSOR_START_DISABLE = (1 << 5) }; -#define GRUB_VGA_CR_PITCH_DIVISOR 8 +#define VasEBoot_VGA_CR_PITCH_DIVISOR 8 enum { - GRUB_VGA_CR_MODE_NO_CGA = 0x01, - GRUB_VGA_CR_MODE_NO_HERCULES = 0x02, - GRUB_VGA_CR_MODE_ADDRESS_WRAP = 0x20, - GRUB_VGA_CR_MODE_BYTE_MODE = 0x40, - GRUB_VGA_CR_MODE_TIMING_ENABLE = 0x80 + VasEBoot_VGA_CR_MODE_NO_CGA = 0x01, + VasEBoot_VGA_CR_MODE_NO_HERCULES = 0x02, + VasEBoot_VGA_CR_MODE_ADDRESS_WRAP = 0x20, + VasEBoot_VGA_CR_MODE_BYTE_MODE = 0x40, + VasEBoot_VGA_CR_MODE_TIMING_ENABLE = 0x80 }; enum { - GRUB_VGA_SR_RESET = 0, - GRUB_VGA_SR_CLOCKING_MODE = 1, - GRUB_VGA_SR_MAP_MASK_REGISTER = 2, - GRUB_VGA_SR_CHAR_MAP_SELECT = 3, - GRUB_VGA_SR_MEMORY_MODE = 4, + VasEBoot_VGA_SR_RESET = 0, + VasEBoot_VGA_SR_CLOCKING_MODE = 1, + VasEBoot_VGA_SR_MAP_MASK_REGISTER = 2, + VasEBoot_VGA_SR_CHAR_MAP_SELECT = 3, + VasEBoot_VGA_SR_MEMORY_MODE = 4, }; enum { - GRUB_VGA_SR_RESET_ASYNC = 1, - GRUB_VGA_SR_RESET_SYNC = 2 + VasEBoot_VGA_SR_RESET_ASYNC = 1, + VasEBoot_VGA_SR_RESET_SYNC = 2 }; enum { - GRUB_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK = 1 + VasEBoot_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK = 1 }; enum { - GRUB_VGA_SR_MEMORY_MODE_NORMAL = 0, - GRUB_VGA_SR_MEMORY_MODE_EXTERNAL_VIDEO_MEMORY = 2, - GRUB_VGA_SR_MEMORY_MODE_SEQUENTIAL_ADDRESSING = 4, - GRUB_VGA_SR_MEMORY_MODE_CHAIN4 = 8, + VasEBoot_VGA_SR_MEMORY_MODE_NORMAL = 0, + VasEBoot_VGA_SR_MEMORY_MODE_EXTERNAL_VIDEO_MEMORY = 2, + VasEBoot_VGA_SR_MEMORY_MODE_SEQUENTIAL_ADDRESSING = 4, + VasEBoot_VGA_SR_MEMORY_MODE_CHAIN4 = 8, }; enum { - GRUB_VGA_GR_SET_RESET_PLANE = 0, - GRUB_VGA_GR_SET_RESET_PLANE_ENABLE = 1, - GRUB_VGA_GR_COLOR_COMPARE = 2, - GRUB_VGA_GR_DATA_ROTATE = 3, - GRUB_VGA_GR_READ_MAP_REGISTER = 4, - GRUB_VGA_GR_MODE = 5, - GRUB_VGA_GR_GR6 = 6, - GRUB_VGA_GR_COLOR_COMPARE_DISABLE = 7, - GRUB_VGA_GR_BITMASK = 8, - GRUB_VGA_GR_MAX + VasEBoot_VGA_GR_SET_RESET_PLANE = 0, + VasEBoot_VGA_GR_SET_RESET_PLANE_ENABLE = 1, + VasEBoot_VGA_GR_COLOR_COMPARE = 2, + VasEBoot_VGA_GR_DATA_ROTATE = 3, + VasEBoot_VGA_GR_READ_MAP_REGISTER = 4, + VasEBoot_VGA_GR_MODE = 5, + VasEBoot_VGA_GR_GR6 = 6, + VasEBoot_VGA_GR_COLOR_COMPARE_DISABLE = 7, + VasEBoot_VGA_GR_BITMASK = 8, + VasEBoot_VGA_GR_MAX }; -#define GRUB_VGA_ALL_PLANES 0xf -#define GRUB_VGA_NO_PLANES 0x0 +#define VasEBoot_VGA_ALL_PLANES 0xf +#define VasEBoot_VGA_NO_PLANES 0x0 enum { - GRUB_VGA_GR_DATA_ROTATE_NOP = 0 + VasEBoot_VGA_GR_DATA_ROTATE_NOP = 0 }; enum { - GRUB_VGA_TEXT_TEXT_PLANE = 0, - GRUB_VGA_TEXT_ATTR_PLANE = 1, - GRUB_VGA_TEXT_FONT_PLANE = 2 + VasEBoot_VGA_TEXT_TEXT_PLANE = 0, + VasEBoot_VGA_TEXT_ATTR_PLANE = 1, + VasEBoot_VGA_TEXT_FONT_PLANE = 2 }; enum { - GRUB_VGA_GR_GR6_GRAPHICS_MODE = 1, - GRUB_VGA_GR_GR6_MMAP_A0 = (1 << 2), - GRUB_VGA_GR_GR6_MMAP_CGA = (3 << 2) + VasEBoot_VGA_GR_GR6_GRAPHICS_MODE = 1, + VasEBoot_VGA_GR_GR6_MMAP_A0 = (1 << 2), + VasEBoot_VGA_GR_GR6_MMAP_CGA = (3 << 2) }; enum { - GRUB_VGA_GR_MODE_READ_MODE1 = 0x08, - GRUB_VGA_GR_MODE_ODD_EVEN = 0x10, - GRUB_VGA_GR_MODE_ODD_EVEN_SHIFT = 0x20, - GRUB_VGA_GR_MODE_256_COLOR = 0x40 + VasEBoot_VGA_GR_MODE_READ_MODE1 = 0x08, + VasEBoot_VGA_GR_MODE_ODD_EVEN = 0x10, + VasEBoot_VGA_GR_MODE_ODD_EVEN_SHIFT = 0x20, + VasEBoot_VGA_GR_MODE_256_COLOR = 0x40 }; -struct grub_video_hw_config +struct VasEBoot_video_hw_config { unsigned vertical_total; unsigned vertical_blank_start; @@ -248,58 +248,58 @@ struct grub_video_hw_config }; static inline void -grub_vga_set_geometry (struct grub_video_hw_config *config, - void (*cr_write) (grub_uint8_t val, grub_uint8_t addr)) +VasEBoot_vga_set_geometry (struct VasEBoot_video_hw_config *config, + void (*cr_write) (VasEBoot_uint8_t val, VasEBoot_uint8_t addr)) { unsigned vertical_total = config->vertical_total - 2; unsigned vertical_blank_start = config->vertical_blank_start - 1; unsigned vdisplay_end = config->vdisplay_end - 1; - grub_uint8_t overflow, cell_height_reg; + VasEBoot_uint8_t overflow, cell_height_reg; /* Disable CR0-7 write protection. */ - cr_write (0, GRUB_VGA_CR_VSYNC_END); + cr_write (0, VasEBoot_VGA_CR_VSYNC_END); - overflow = ((vertical_total >> GRUB_VGA_CR_OVERFLOW_VERT_TOTAL1_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VERT_TOTAL1_MASK) - | ((vertical_total >> GRUB_VGA_CR_OVERFLOW_VERT_TOTAL2_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VERT_TOTAL2_MASK) - | ((config->vertical_sync_start >> GRUB_VGA_CR_OVERFLOW_VSYNC_START2_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VSYNC_START2_MASK) - | ((config->vertical_sync_start >> GRUB_VGA_CR_OVERFLOW_VSYNC_START1_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VSYNC_START1_MASK) - | ((vdisplay_end >> GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_MASK) - | ((vdisplay_end >> GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_MASK) - | ((config->vertical_sync_start >> GRUB_VGA_CR_OVERFLOW_VSYNC_START1_SHIFT) - & GRUB_VGA_CR_OVERFLOW_VSYNC_START1_MASK) - | ((config->line_compare >> GRUB_VGA_CR_OVERFLOW_LINE_COMPARE_SHIFT) - & GRUB_VGA_CR_OVERFLOW_LINE_COMPARE_MASK); + overflow = ((vertical_total >> VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL1_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL1_MASK) + | ((vertical_total >> VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL2_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VERT_TOTAL2_MASK) + | ((config->vertical_sync_start >> VasEBoot_VGA_CR_OVERFLOW_VSYNC_START2_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VSYNC_START2_MASK) + | ((config->vertical_sync_start >> VasEBoot_VGA_CR_OVERFLOW_VSYNC_START1_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VSYNC_START1_MASK) + | ((vdisplay_end >> VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END1_MASK) + | ((vdisplay_end >> VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VERT_DISPLAY_ENABLE_END2_MASK) + | ((config->vertical_sync_start >> VasEBoot_VGA_CR_OVERFLOW_VSYNC_START1_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_VSYNC_START1_MASK) + | ((config->line_compare >> VasEBoot_VGA_CR_OVERFLOW_LINE_COMPARE_SHIFT) + & VasEBoot_VGA_CR_OVERFLOW_LINE_COMPARE_MASK); cell_height_reg = ((vertical_blank_start - >> GRUB_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_SHIFT) - & GRUB_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_MASK) - | ((config->line_compare >> GRUB_VGA_CR_CELL_HEIGHT_LINE_COMPARE_SHIFT) - & GRUB_VGA_CR_CELL_HEIGHT_LINE_COMPARE_MASK); + >> VasEBoot_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_SHIFT) + & VasEBoot_VGA_CR_CELL_HEIGHT_VERTICAL_BLANK_MASK) + | ((config->line_compare >> VasEBoot_VGA_CR_CELL_HEIGHT_LINE_COMPARE_SHIFT) + & VasEBoot_VGA_CR_CELL_HEIGHT_LINE_COMPARE_MASK); - cr_write (config->horizontal_total - 1, GRUB_VGA_CR_HTOTAL); - cr_write (config->horizontal_end - 1, GRUB_VGA_CR_HORIZ_END); - cr_write (config->horizontal_blank_start - 1, GRUB_VGA_CR_HBLANK_START); - cr_write (config->horizontal_blank_end, GRUB_VGA_CR_HBLANK_END); + cr_write (config->horizontal_total - 1, VasEBoot_VGA_CR_HTOTAL); + cr_write (config->horizontal_end - 1, VasEBoot_VGA_CR_HORIZ_END); + cr_write (config->horizontal_blank_start - 1, VasEBoot_VGA_CR_HBLANK_START); + cr_write (config->horizontal_blank_end, VasEBoot_VGA_CR_HBLANK_END); cr_write (config->horizontal_sync_pulse_start, - GRUB_VGA_CR_HORIZ_SYNC_PULSE_START); + VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_START); cr_write (config->horizontal_sync_pulse_end, - GRUB_VGA_CR_HORIZ_SYNC_PULSE_END); - cr_write (vertical_total & 0xff, GRUB_VGA_CR_VERT_TOTAL); - cr_write (overflow, GRUB_VGA_CR_OVERFLOW); - cr_write (cell_height_reg, GRUB_VGA_CR_CELL_HEIGHT); - cr_write (config->vertical_sync_start & 0xff, GRUB_VGA_CR_VSYNC_START); - cr_write (config->vertical_sync_end & 0x0f, GRUB_VGA_CR_VSYNC_END); - cr_write (vdisplay_end & 0xff, GRUB_VGA_CR_VDISPLAY_END); - cr_write (config->pitch & 0xff, GRUB_VGA_CR_PITCH); - cr_write (vertical_blank_start & 0xff, GRUB_VGA_CR_VERTICAL_BLANK_START); - cr_write (config->vertical_blank_end & 0xff, GRUB_VGA_CR_VERTICAL_BLANK_END); - cr_write (config->line_compare & 0xff, GRUB_VGA_CR_LINE_COMPARE); + VasEBoot_VGA_CR_HORIZ_SYNC_PULSE_END); + cr_write (vertical_total & 0xff, VasEBoot_VGA_CR_VERT_TOTAL); + cr_write (overflow, VasEBoot_VGA_CR_OVERFLOW); + cr_write (cell_height_reg, VasEBoot_VGA_CR_CELL_HEIGHT); + cr_write (config->vertical_sync_start & 0xff, VasEBoot_VGA_CR_VSYNC_START); + cr_write (config->vertical_sync_end & 0x0f, VasEBoot_VGA_CR_VSYNC_END); + cr_write (vdisplay_end & 0xff, VasEBoot_VGA_CR_VDISPLAY_END); + cr_write (config->pitch & 0xff, VasEBoot_VGA_CR_PITCH); + cr_write (vertical_blank_start & 0xff, VasEBoot_VGA_CR_VERTICAL_BLANK_START); + cr_write (config->vertical_blank_end & 0xff, VasEBoot_VGA_CR_VERTICAL_BLANK_END); + cr_write (config->line_compare & 0xff, VasEBoot_VGA_CR_LINE_COMPARE); } #endif diff --git a/include/VasEBoot/video.h b/include/VasEBoot/video.h index 52c3fd71e..c3d49c172 100644 --- a/include/VasEBoot/video.h +++ b/include/VasEBoot/video.h @@ -1,126 +1,126 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_VIDEO_HEADER -#define GRUB_VIDEO_HEADER 1 +#ifndef VasEBoot_VIDEO_HEADER +#define VasEBoot_VIDEO_HEADER 1 -#include -#include -#include +#include +#include +#include /* Video color in hardware dependent format. Users should not assume any specific coding format. */ -typedef grub_uint32_t grub_video_color_t; +typedef VasEBoot_uint32_t VasEBoot_video_color_t; /* Video color in hardware independent format. */ -typedef struct grub_video_rgba_color +typedef struct VasEBoot_video_rgba_color { - grub_uint8_t red; - grub_uint8_t green; - grub_uint8_t blue; - grub_uint8_t alpha; -} grub_video_rgba_color_t; + VasEBoot_uint8_t red; + VasEBoot_uint8_t green; + VasEBoot_uint8_t blue; + VasEBoot_uint8_t alpha; +} VasEBoot_video_rgba_color_t; /* This structure is driver specific and should not be accessed directly by outside code. */ -struct grub_video_render_target; +struct VasEBoot_video_render_target; /* Forward declarations for used data structures. */ -struct grub_video_bitmap; +struct VasEBoot_video_bitmap; /* Defines used to describe video mode or rendering target. */ /* If following is set render target contains currenly displayed image after swapping buffers (otherwise it contains previously displayed image). */ -typedef enum grub_video_mode_type +typedef enum VasEBoot_video_mode_type { - GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001, - GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002, - GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004, - GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008, + VasEBoot_VIDEO_MODE_TYPE_RGB = 0x00000001, + VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002, + VasEBoot_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004, + VasEBoot_VIDEO_MODE_TYPE_YUV = 0x00000008, /* Defines used to mask flags. */ - GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F, + VasEBoot_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F, - GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010, - GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020, - GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040, - GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080, - GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0, + VasEBoot_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010, + VasEBoot_VIDEO_MODE_TYPE_ALPHA = 0x00000020, + VasEBoot_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040, + VasEBoot_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080, + VasEBoot_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0, /* Defines used to specify requested bit depth. */ - GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00, -#define GRUB_VIDEO_MODE_TYPE_DEPTH_POS 8 + VasEBoot_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00, +#define VasEBoot_VIDEO_MODE_TYPE_DEPTH_POS 8 - GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000, - GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000, - GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000, - GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000, - GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000, - GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000, - } grub_video_mode_type_t; + VasEBoot_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000, + VasEBoot_VIDEO_MODE_TYPE_HERCULES = 0x00020000, + VasEBoot_VIDEO_MODE_TYPE_PLANAR = 0x00040000, + VasEBoot_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000, + VasEBoot_VIDEO_MODE_TYPE_CGA = 0x00100000, + VasEBoot_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000, + } VasEBoot_video_mode_type_t; /* The basic render target representing the whole display. This always renders to the back buffer when double-buffering is in use. */ -#define GRUB_VIDEO_RENDER_TARGET_DISPLAY \ - ((struct grub_video_render_target *) 0) +#define VasEBoot_VIDEO_RENDER_TARGET_DISPLAY \ + ((struct VasEBoot_video_render_target *) 0) /* Defined blitting formats. */ -enum grub_video_blit_format +enum VasEBoot_video_blit_format { /* Generic RGBA, use fields & masks. */ - GRUB_VIDEO_BLIT_FORMAT_RGBA, + VasEBoot_VIDEO_BLIT_FORMAT_RGBA, /* Optimized RGBA's. */ - GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, - GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, + VasEBoot_VIDEO_BLIT_FORMAT_RGBA_8888, + VasEBoot_VIDEO_BLIT_FORMAT_BGRA_8888, /* Generic RGB, use fields & masks. */ - GRUB_VIDEO_BLIT_FORMAT_RGB, + VasEBoot_VIDEO_BLIT_FORMAT_RGB, /* Optimized RGB's. */ - GRUB_VIDEO_BLIT_FORMAT_RGB_888, - GRUB_VIDEO_BLIT_FORMAT_BGR_888, - GRUB_VIDEO_BLIT_FORMAT_RGB_565, - GRUB_VIDEO_BLIT_FORMAT_BGR_565, + VasEBoot_VIDEO_BLIT_FORMAT_RGB_888, + VasEBoot_VIDEO_BLIT_FORMAT_BGR_888, + VasEBoot_VIDEO_BLIT_FORMAT_RGB_565, + VasEBoot_VIDEO_BLIT_FORMAT_BGR_565, /* When needed, decode color or just use value as is. */ - GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR, + VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR, /* Like index but only 16-colors and F0 is a special value for transparency. Could be extended to 4 bits of alpha and 4 bits of color if necessary. Used internally for text rendering. */ - GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA, + VasEBoot_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA, /* Two color bitmap; bits packed: rows are not padded to byte boundary. */ - GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED + VasEBoot_VIDEO_BLIT_FORMAT_1BIT_PACKED }; /* Define blitting operators. */ -enum grub_video_blit_operators +enum VasEBoot_video_blit_operators { /* Replace target bitmap data with source. */ - GRUB_VIDEO_BLIT_REPLACE, + VasEBoot_VIDEO_BLIT_REPLACE, /* Blend target and source based on source's alpha value. */ - GRUB_VIDEO_BLIT_BLEND + VasEBoot_VIDEO_BLIT_BLEND }; -struct grub_video_mode_info +struct VasEBoot_video_mode_info { /* Width of the screen. */ unsigned int width; @@ -130,7 +130,7 @@ struct grub_video_mode_info /* Mode type bitmask. Contains information like is it Index color or RGB mode. */ - grub_video_mode_type_t mode_type; + VasEBoot_video_mode_type_t mode_type; /* Bits per pixel. */ unsigned int bpp; @@ -145,10 +145,10 @@ struct grub_video_mode_info unsigned int number_of_colors; unsigned int mode_number; -#define GRUB_VIDEO_MODE_NUMBER_INVALID 0xffffffff +#define VasEBoot_VIDEO_MODE_NUMBER_INVALID 0xffffffff /* Optimization hint how binary data is coded. */ - enum grub_video_blit_format blit_format; + enum VasEBoot_video_blit_format blit_format; /* How many bits are reserved for red color. */ unsigned int red_mask_size; @@ -176,244 +176,244 @@ struct grub_video_mode_info unsigned int reserved_field_pos; /* For 1-bit bitmaps, the background color. Used for bits = 0. */ - grub_uint8_t bg_red; - grub_uint8_t bg_green; - grub_uint8_t bg_blue; - grub_uint8_t bg_alpha; + VasEBoot_uint8_t bg_red; + VasEBoot_uint8_t bg_green; + VasEBoot_uint8_t bg_blue; + VasEBoot_uint8_t bg_alpha; /* For 1-bit bitmaps, the foreground color. Used for bits = 1. */ - grub_uint8_t fg_red; - grub_uint8_t fg_green; - grub_uint8_t fg_blue; - grub_uint8_t fg_alpha; + VasEBoot_uint8_t fg_red; + VasEBoot_uint8_t fg_green; + VasEBoot_uint8_t fg_blue; + VasEBoot_uint8_t fg_alpha; }; /* A 2D rectangle type. */ -struct grub_video_rect +struct VasEBoot_video_rect { unsigned x; unsigned y; unsigned width; unsigned height; }; -typedef struct grub_video_rect grub_video_rect_t; +typedef struct VasEBoot_video_rect VasEBoot_video_rect_t; -struct grub_video_signed_rect +struct VasEBoot_video_signed_rect { signed x; signed y; unsigned width; unsigned height; }; -typedef struct grub_video_signed_rect grub_video_signed_rect_t; +typedef struct VasEBoot_video_signed_rect VasEBoot_video_signed_rect_t; -struct grub_video_palette_data +struct VasEBoot_video_palette_data { - grub_uint8_t r; /* Red color value (0-255). */ - grub_uint8_t g; /* Green color value (0-255). */ - grub_uint8_t b; /* Blue color value (0-255). */ - grub_uint8_t a; /* Reserved bits value (0-255). */ + VasEBoot_uint8_t r; /* Red color value (0-255). */ + VasEBoot_uint8_t g; /* Green color value (0-255). */ + VasEBoot_uint8_t b; /* Blue color value (0-255). */ + VasEBoot_uint8_t a; /* Reserved bits value (0-255). */ }; -struct grub_video_edid_info +struct VasEBoot_video_edid_info { - grub_uint8_t header[8]; - grub_uint16_t manufacturer_id; - grub_uint16_t product_id; - grub_uint32_t serial_number; - grub_uint8_t week_of_manufacture; - grub_uint8_t year_of_manufacture; - grub_uint8_t version; - grub_uint8_t revision; + VasEBoot_uint8_t header[8]; + VasEBoot_uint16_t manufacturer_id; + VasEBoot_uint16_t product_id; + VasEBoot_uint32_t serial_number; + VasEBoot_uint8_t week_of_manufacture; + VasEBoot_uint8_t year_of_manufacture; + VasEBoot_uint8_t version; + VasEBoot_uint8_t revision; - grub_uint8_t video_input_definition; - grub_uint8_t max_horizontal_image_size; - grub_uint8_t max_vertical_image_size; - grub_uint8_t display_gamma; - grub_uint8_t feature_support; -#define GRUB_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE (1 << 1) + VasEBoot_uint8_t video_input_definition; + VasEBoot_uint8_t max_horizontal_image_size; + VasEBoot_uint8_t max_vertical_image_size; + VasEBoot_uint8_t display_gamma; + VasEBoot_uint8_t feature_support; +#define VasEBoot_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE (1 << 1) - grub_uint8_t red_green_lo; - grub_uint8_t blue_white_lo; - grub_uint8_t red_x_hi; - grub_uint8_t red_y_hi; - grub_uint8_t green_x_hi; - grub_uint8_t green_y_hi; - grub_uint8_t blue_x_hi; - grub_uint8_t blue_y_hi; - grub_uint8_t white_x_hi; - grub_uint8_t white_y_hi; + VasEBoot_uint8_t red_green_lo; + VasEBoot_uint8_t blue_white_lo; + VasEBoot_uint8_t red_x_hi; + VasEBoot_uint8_t red_y_hi; + VasEBoot_uint8_t green_x_hi; + VasEBoot_uint8_t green_y_hi; + VasEBoot_uint8_t blue_x_hi; + VasEBoot_uint8_t blue_y_hi; + VasEBoot_uint8_t white_x_hi; + VasEBoot_uint8_t white_y_hi; - grub_uint8_t established_timings_1; - grub_uint8_t established_timings_2; - grub_uint8_t manufacturer_reserved_timings; + VasEBoot_uint8_t established_timings_1; + VasEBoot_uint8_t established_timings_2; + VasEBoot_uint8_t manufacturer_reserved_timings; - grub_uint16_t standard_timings[8]; + VasEBoot_uint16_t standard_timings[8]; struct { - grub_uint16_t pixel_clock; + VasEBoot_uint16_t pixel_clock; /* Only valid if the pixel clock is non-null. */ - grub_uint8_t horizontal_active_lo; - grub_uint8_t horizontal_blanking_lo; - grub_uint8_t horizontal_hi; - grub_uint8_t vertical_active_lo; - grub_uint8_t vertical_blanking_lo; - grub_uint8_t vertical_hi; - grub_uint8_t horizontal_sync_offset_lo; - grub_uint8_t horizontal_sync_pulse_width_lo; - grub_uint8_t vertical_sync_lo; - grub_uint8_t sync_hi; - grub_uint8_t horizontal_image_size_lo; - grub_uint8_t vertical_image_size_lo; - grub_uint8_t image_size_hi; - grub_uint8_t horizontal_border; - grub_uint8_t vertical_border; - grub_uint8_t flags; + VasEBoot_uint8_t horizontal_active_lo; + VasEBoot_uint8_t horizontal_blanking_lo; + VasEBoot_uint8_t horizontal_hi; + VasEBoot_uint8_t vertical_active_lo; + VasEBoot_uint8_t vertical_blanking_lo; + VasEBoot_uint8_t vertical_hi; + VasEBoot_uint8_t horizontal_sync_offset_lo; + VasEBoot_uint8_t horizontal_sync_pulse_width_lo; + VasEBoot_uint8_t vertical_sync_lo; + VasEBoot_uint8_t sync_hi; + VasEBoot_uint8_t horizontal_image_size_lo; + VasEBoot_uint8_t vertical_image_size_lo; + VasEBoot_uint8_t image_size_hi; + VasEBoot_uint8_t horizontal_border; + VasEBoot_uint8_t vertical_border; + VasEBoot_uint8_t flags; } detailed_timings[4]; - grub_uint8_t extension_flag; - grub_uint8_t checksum; -} GRUB_PACKED; + VasEBoot_uint8_t extension_flag; + VasEBoot_uint8_t checksum; +} VasEBoot_PACKED; -typedef enum grub_video_driver_id +typedef enum VasEBoot_video_driver_id { - GRUB_VIDEO_DRIVER_NONE, - GRUB_VIDEO_DRIVER_VBE, - GRUB_VIDEO_DRIVER_EFI_UGA, - GRUB_VIDEO_DRIVER_EFI_GOP, - GRUB_VIDEO_DRIVER_SM712, - GRUB_VIDEO_DRIVER_VGA, - GRUB_VIDEO_DRIVER_CIRRUS, - GRUB_VIDEO_DRIVER_BOCHS, - GRUB_VIDEO_DRIVER_SDL, - GRUB_VIDEO_DRIVER_SIS315PRO, - GRUB_VIDEO_DRIVER_RADEON_FULOONG2E, - GRUB_VIDEO_DRIVER_COREBOOT, - GRUB_VIDEO_DRIVER_IEEE1275, - GRUB_VIDEO_ADAPTER_CAPTURE, - GRUB_VIDEO_DRIVER_XEN, - GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A - } grub_video_driver_id_t; + VasEBoot_VIDEO_DRIVER_NONE, + VasEBoot_VIDEO_DRIVER_VBE, + VasEBoot_VIDEO_DRIVER_EFI_UGA, + VasEBoot_VIDEO_DRIVER_EFI_GOP, + VasEBoot_VIDEO_DRIVER_SM712, + VasEBoot_VIDEO_DRIVER_VGA, + VasEBoot_VIDEO_DRIVER_CIRRUS, + VasEBoot_VIDEO_DRIVER_BOCHS, + VasEBoot_VIDEO_DRIVER_SDL, + VasEBoot_VIDEO_DRIVER_SIS315PRO, + VasEBoot_VIDEO_DRIVER_RADEON_FULOONG2E, + VasEBoot_VIDEO_DRIVER_COREBOOT, + VasEBoot_VIDEO_DRIVER_IEEE1275, + VasEBoot_VIDEO_ADAPTER_CAPTURE, + VasEBoot_VIDEO_DRIVER_XEN, + VasEBoot_VIDEO_DRIVER_RADEON_YEELOONG3A + } VasEBoot_video_driver_id_t; -typedef enum grub_video_adapter_prio +typedef enum VasEBoot_video_adapter_prio { - GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60, - GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70, - GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80, - GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100 - } grub_video_adapter_prio_t; + VasEBoot_VIDEO_ADAPTER_PRIO_FALLBACK = 60, + VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70, + VasEBoot_VIDEO_ADAPTER_PRIO_FIRMWARE = 80, + VasEBoot_VIDEO_ADAPTER_PRIO_NATIVE = 100 + } VasEBoot_video_adapter_prio_t; -typedef enum grub_video_area_status +typedef enum VasEBoot_video_area_status { - GRUB_VIDEO_AREA_DISABLED, - GRUB_VIDEO_AREA_ENABLED - } grub_video_area_status_t; + VasEBoot_VIDEO_AREA_DISABLED, + VasEBoot_VIDEO_AREA_ENABLED + } VasEBoot_video_area_status_t; -struct grub_video_adapter +struct VasEBoot_video_adapter { /* The next video adapter. */ - struct grub_video_adapter *next; - struct grub_video_adapter **prev; + struct VasEBoot_video_adapter *next; + struct VasEBoot_video_adapter **prev; /* The video adapter name. */ const char *name; - grub_video_driver_id_t id; + VasEBoot_video_driver_id_t id; - grub_video_adapter_prio_t prio; + VasEBoot_video_adapter_prio_t prio; /* Initialize the video adapter. */ - grub_err_t (*init) (void); + VasEBoot_err_t (*init) (void); /* Clean up the video adapter. */ - grub_err_t (*fini) (void); + VasEBoot_err_t (*fini) (void); - grub_err_t (*setup) (unsigned int width, unsigned int height, - grub_video_mode_type_t mode_type, - grub_video_mode_type_t mode_mask); + VasEBoot_err_t (*setup) (unsigned int width, unsigned int height, + VasEBoot_video_mode_type_t mode_type, + VasEBoot_video_mode_type_t mode_mask); - grub_err_t (*get_info) (struct grub_video_mode_info *mode_info); + VasEBoot_err_t (*get_info) (struct VasEBoot_video_mode_info *mode_info); - grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info, + VasEBoot_err_t (*get_info_and_fini) (struct VasEBoot_video_mode_info *mode_info, void **framebuffer); - grub_err_t (*set_palette) (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); + VasEBoot_err_t (*set_palette) (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); - grub_err_t (*get_palette) (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); + VasEBoot_err_t (*get_palette) (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); - grub_err_t (*set_viewport) (unsigned int x, unsigned int y, + VasEBoot_err_t (*set_viewport) (unsigned int x, unsigned int y, unsigned int width, unsigned int height); - grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y, + VasEBoot_err_t (*get_viewport) (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); - grub_err_t (*set_region) (unsigned int x, unsigned int y, + VasEBoot_err_t (*set_region) (unsigned int x, unsigned int y, unsigned int width, unsigned int height); - grub_err_t (*get_region) (unsigned int *x, unsigned int *y, + VasEBoot_err_t (*get_region) (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); - grub_err_t (*set_area_status) (grub_video_area_status_t area_status); + VasEBoot_err_t (*set_area_status) (VasEBoot_video_area_status_t area_status); - grub_err_t (*get_area_status) (grub_video_area_status_t *area_status); + VasEBoot_err_t (*get_area_status) (VasEBoot_video_area_status_t *area_status); - grub_video_color_t (*map_color) (grub_uint32_t color_name); + VasEBoot_video_color_t (*map_color) (VasEBoot_uint32_t color_name); - grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue); + VasEBoot_video_color_t (*map_rgb) (VasEBoot_uint8_t red, VasEBoot_uint8_t green, + VasEBoot_uint8_t blue); - grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue, grub_uint8_t alpha); + VasEBoot_video_color_t (*map_rgba) (VasEBoot_uint8_t red, VasEBoot_uint8_t green, + VasEBoot_uint8_t blue, VasEBoot_uint8_t alpha); - grub_err_t (*unmap_color) (grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha); + VasEBoot_err_t (*unmap_color) (VasEBoot_video_color_t color, + VasEBoot_uint8_t *red, VasEBoot_uint8_t *green, + VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha); - grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y, + VasEBoot_err_t (*fill_rect) (VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height); - grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, + VasEBoot_err_t (*blit_bitmap) (struct VasEBoot_video_bitmap *bitmap, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); - grub_err_t (*blit_render_target) (struct grub_video_render_target *source, - enum grub_video_blit_operators oper, + VasEBoot_err_t (*blit_render_target) (struct VasEBoot_video_render_target *source, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); - grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy); + VasEBoot_err_t (*scroll) (VasEBoot_video_color_t color, int dx, int dy); - grub_err_t (*swap_buffers) (void); + VasEBoot_err_t (*swap_buffers) (void); - grub_err_t (*create_render_target) (struct grub_video_render_target **result, + VasEBoot_err_t (*create_render_target) (struct VasEBoot_video_render_target **result, unsigned int width, unsigned int height, unsigned int mode_type); - grub_err_t (*delete_render_target) (struct grub_video_render_target *target); + VasEBoot_err_t (*delete_render_target) (struct VasEBoot_video_render_target *target); - grub_err_t (*set_active_render_target) (struct grub_video_render_target *target); + VasEBoot_err_t (*set_active_render_target) (struct VasEBoot_video_render_target *target); - grub_err_t (*get_active_render_target) (struct grub_video_render_target **target); + VasEBoot_err_t (*get_active_render_target) (struct VasEBoot_video_render_target **target); - int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg); + int (*iterate) (int (*hook) (const struct VasEBoot_video_mode_info *info, void *hook_arg), void *hook_arg); - grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info); + VasEBoot_err_t (*get_edid) (struct VasEBoot_video_edid_info *edid_info); void (*print_adapter_specific_info) (void); }; -typedef struct grub_video_adapter *grub_video_adapter_t; +typedef struct VasEBoot_video_adapter *VasEBoot_video_adapter_t; -extern grub_video_adapter_t EXPORT_VAR(grub_video_adapter_list); +extern VasEBoot_video_adapter_t EXPORT_VAR(VasEBoot_video_adapter_list); -#ifndef GRUB_LST_GENERATOR +#ifndef VasEBoot_LST_GENERATOR /* Register video driver. */ static inline void -grub_video_register (grub_video_adapter_t adapter) +VasEBoot_video_register (VasEBoot_video_adapter_t adapter) { - grub_video_adapter_t *p; - for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio; + VasEBoot_video_adapter_t *p; + for (p = &VasEBoot_video_adapter_list; *p && (*p)->prio > adapter->prio; p = &((*p)->next)); adapter->next = *p; *p = adapter; @@ -426,135 +426,135 @@ grub_video_register (grub_video_adapter_t adapter) /* Unregister video driver. */ static inline void -grub_video_unregister (grub_video_adapter_t adapter) +VasEBoot_video_unregister (VasEBoot_video_adapter_t adapter) { - grub_list_remove (GRUB_AS_LIST (adapter)); + VasEBoot_list_remove (VasEBoot_AS_LIST (adapter)); } -#define FOR_VIDEO_ADAPTERS(var) FOR_LIST_ELEMENTS((var), (grub_video_adapter_list)) +#define FOR_VIDEO_ADAPTERS(var) FOR_LIST_ELEMENTS((var), (VasEBoot_video_adapter_list)) -grub_err_t EXPORT_FUNC (grub_video_restore) (void); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_restore) (void); -grub_err_t EXPORT_FUNC (grub_video_get_info) (struct grub_video_mode_info *mode_info); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_get_info) (struct VasEBoot_video_mode_info *mode_info); /* Framebuffer address may change as a part of normal operation (e.g. double buffering). That's why you need to stop video subsystem to be sure that framebuffer address doesn't change. To ensure this abstraction - grub_video_get_info_and_fini is the only function supplying framebuffer + VasEBoot_video_get_info_and_fini is the only function supplying framebuffer address. */ -grub_err_t EXPORT_FUNC (grub_video_get_info_and_fini) (struct grub_video_mode_info *mode_info, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_get_info_and_fini) (struct VasEBoot_video_mode_info *mode_info, void **framebuffer); -enum grub_video_blit_format EXPORT_FUNC(grub_video_get_blit_format) (struct grub_video_mode_info *mode_info); +enum VasEBoot_video_blit_format EXPORT_FUNC(VasEBoot_video_get_blit_format) (struct VasEBoot_video_mode_info *mode_info); -grub_err_t grub_video_set_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); +VasEBoot_err_t VasEBoot_video_set_palette (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); -grub_err_t EXPORT_FUNC (grub_video_get_palette) (unsigned int start, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_get_palette) (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); + struct VasEBoot_video_palette_data *palette_data); -grub_err_t EXPORT_FUNC (grub_video_set_viewport) (unsigned int x, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_set_viewport) (unsigned int x, unsigned int y, unsigned int width, unsigned int height); -grub_err_t EXPORT_FUNC (grub_video_get_viewport) (unsigned int *x, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_get_viewport) (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); -grub_err_t EXPORT_FUNC (grub_video_set_region) (unsigned int x, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_set_region) (unsigned int x, unsigned int y, unsigned int width, unsigned int height); -grub_err_t EXPORT_FUNC (grub_video_get_region) (unsigned int *x, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_get_region) (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); -grub_err_t EXPORT_FUNC (grub_video_set_area_status) - (grub_video_area_status_t area_status); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_set_area_status) + (VasEBoot_video_area_status_t area_status); -grub_err_t EXPORT_FUNC (grub_video_get_area_status) - (grub_video_area_status_t *area_status); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_get_area_status) + (VasEBoot_video_area_status_t *area_status); -grub_video_color_t EXPORT_FUNC (grub_video_map_color) (grub_uint32_t color_name); +VasEBoot_video_color_t EXPORT_FUNC (VasEBoot_video_map_color) (VasEBoot_uint32_t color_name); -grub_video_color_t EXPORT_FUNC (grub_video_map_rgb) (grub_uint8_t red, - grub_uint8_t green, - grub_uint8_t blue); +VasEBoot_video_color_t EXPORT_FUNC (VasEBoot_video_map_rgb) (VasEBoot_uint8_t red, + VasEBoot_uint8_t green, + VasEBoot_uint8_t blue); -grub_video_color_t EXPORT_FUNC (grub_video_map_rgba) (grub_uint8_t red, - grub_uint8_t green, - grub_uint8_t blue, - grub_uint8_t alpha); +VasEBoot_video_color_t EXPORT_FUNC (VasEBoot_video_map_rgba) (VasEBoot_uint8_t red, + VasEBoot_uint8_t green, + VasEBoot_uint8_t blue, + VasEBoot_uint8_t alpha); -grub_err_t EXPORT_FUNC (grub_video_unmap_color) (grub_video_color_t color, - grub_uint8_t *red, - grub_uint8_t *green, - grub_uint8_t *blue, - grub_uint8_t *alpha); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_unmap_color) (VasEBoot_video_color_t color, + VasEBoot_uint8_t *red, + VasEBoot_uint8_t *green, + VasEBoot_uint8_t *blue, + VasEBoot_uint8_t *alpha); -grub_err_t EXPORT_FUNC (grub_video_fill_rect) (grub_video_color_t color, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_fill_rect) (VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height); -grub_err_t EXPORT_FUNC (grub_video_blit_bitmap) (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_blit_bitmap) (struct VasEBoot_video_bitmap *bitmap, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); -grub_err_t EXPORT_FUNC (grub_video_blit_render_target) (struct grub_video_render_target *source, - enum grub_video_blit_operators oper, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_blit_render_target) (struct VasEBoot_video_render_target *source, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); -grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy); +VasEBoot_err_t VasEBoot_video_scroll (VasEBoot_video_color_t color, int dx, int dy); -grub_err_t EXPORT_FUNC (grub_video_swap_buffers) (void); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_swap_buffers) (void); -grub_err_t EXPORT_FUNC (grub_video_create_render_target) (struct grub_video_render_target **result, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_create_render_target) (struct VasEBoot_video_render_target **result, unsigned int width, unsigned int height, unsigned int mode_type); -grub_err_t EXPORT_FUNC (grub_video_delete_render_target) (struct grub_video_render_target *target); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_delete_render_target) (struct VasEBoot_video_render_target *target); -grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_render_target *target); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_set_active_render_target) (struct VasEBoot_video_render_target *target); -grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); +VasEBoot_err_t VasEBoot_video_get_active_render_target (struct VasEBoot_video_render_target **target); -grub_err_t EXPORT_FUNC (grub_video_edid_checksum) (struct grub_video_edid_info *edid_info); -grub_err_t EXPORT_FUNC (grub_video_edid_preferred_mode) (struct grub_video_edid_info *edid_info, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_edid_checksum) (struct VasEBoot_video_edid_info *edid_info); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_edid_preferred_mode) (struct VasEBoot_video_edid_info *edid_info, unsigned int *width, unsigned int *height); -grub_err_t EXPORT_FUNC (grub_video_set_mode) (const char *modestring, +VasEBoot_err_t EXPORT_FUNC (VasEBoot_video_set_mode) (const char *modestring, unsigned int modemask, unsigned int modevalue); static inline int -grub_video_check_mode_flag (grub_video_mode_type_t flags, - grub_video_mode_type_t mask, - grub_video_mode_type_t flag, int def) +VasEBoot_video_check_mode_flag (VasEBoot_video_mode_type_t flags, + VasEBoot_video_mode_type_t mask, + VasEBoot_video_mode_type_t flag, int def) { return (flag & mask) ? !! (flags & flag) : def; } -grub_video_driver_id_t EXPORT_FUNC (grub_video_get_driver_id) (void); +VasEBoot_video_driver_id_t EXPORT_FUNC (VasEBoot_video_get_driver_id) (void); -static __inline grub_video_rgba_color_t -grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b) +static __inline VasEBoot_video_rgba_color_t +VasEBoot_video_rgba_color_rgb (VasEBoot_uint8_t r, VasEBoot_uint8_t g, VasEBoot_uint8_t b) { - grub_video_rgba_color_t c; + VasEBoot_video_rgba_color_t c; c.red = r; c.green = g; c.blue = b; @@ -562,46 +562,46 @@ grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b) return c; } -static __inline grub_video_color_t -grub_video_map_rgba_color (grub_video_rgba_color_t c) +static __inline VasEBoot_video_color_t +VasEBoot_video_map_rgba_color (VasEBoot_video_rgba_color_t c) { - return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha); + return VasEBoot_video_map_rgba (c.red, c.green, c.blue, c.alpha); } -#ifndef GRUB_MACHINE_EMU -extern void grub_font_init (void); -extern void grub_font_fini (void); -extern void grub_gfxterm_init (void); -extern void grub_gfxterm_fini (void); -extern void grub_video_sm712_init (void); -extern void grub_video_sm712_fini (void); -extern void grub_video_sis315pro_init (void); -extern void grub_video_radeon_fuloong2e_init (void); -extern void grub_video_sis315pro_fini (void); -extern void grub_video_radeon_fuloong2e_fini (void); -extern void grub_video_radeon_yeeloong3a_init (void); -extern void grub_video_radeon_yeeloong3a_fini (void); +#ifndef VasEBoot_MACHINE_EMU +extern void VasEBoot_font_init (void); +extern void VasEBoot_font_fini (void); +extern void VasEBoot_gfxterm_init (void); +extern void VasEBoot_gfxterm_fini (void); +extern void VasEBoot_video_sm712_init (void); +extern void VasEBoot_video_sm712_fini (void); +extern void VasEBoot_video_sis315pro_init (void); +extern void VasEBoot_video_radeon_fuloong2e_init (void); +extern void VasEBoot_video_sis315pro_fini (void); +extern void VasEBoot_video_radeon_fuloong2e_fini (void); +extern void VasEBoot_video_radeon_yeeloong3a_init (void); +extern void VasEBoot_video_radeon_yeeloong3a_fini (void); #endif void -grub_video_set_adapter (grub_video_adapter_t adapter); -grub_video_adapter_t -grub_video_get_adapter (void); -grub_err_t -grub_video_capture_start (const struct grub_video_mode_info *mode_info, - struct grub_video_palette_data *palette, +VasEBoot_video_set_adapter (VasEBoot_video_adapter_t adapter); +VasEBoot_video_adapter_t +VasEBoot_video_get_adapter (void); +VasEBoot_err_t +VasEBoot_video_capture_start (const struct VasEBoot_video_mode_info *mode_info, + struct VasEBoot_video_palette_data *palette, unsigned int palette_size); void -grub_video_capture_end (void); +VasEBoot_video_capture_end (void); void * -grub_video_capture_get_framebuffer (void); +VasEBoot_video_capture_get_framebuffer (void); -extern grub_video_adapter_t EXPORT_VAR (grub_video_adapter_active); -extern void (*grub_video_capture_refresh_cb) (void); +extern VasEBoot_video_adapter_t EXPORT_VAR (VasEBoot_video_adapter_active); +extern void (*VasEBoot_video_capture_refresh_cb) (void); -#define GRUB_VIDEO_MI_RGB555(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_RGB555(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 15, \ x.bytes_per_pixel = 2, \ x.number_of_colors = 256, \ @@ -612,8 +612,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 5, \ x.blue_field_pos = 0 -#define GRUB_VIDEO_MI_RGB565(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_RGB565(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 16, \ x.bytes_per_pixel = 2, \ x.number_of_colors = 256, \ @@ -624,8 +624,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 5, \ x.blue_field_pos = 0 -#define GRUB_VIDEO_MI_RGB888(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_RGB888(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 24, \ x.bytes_per_pixel = 3, \ x.number_of_colors = 256, \ @@ -636,8 +636,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 8, \ x.blue_field_pos = 0 -#define GRUB_VIDEO_MI_RGBA8888(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_RGBA8888(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 32, \ x.bytes_per_pixel = 4, \ x.number_of_colors = 256, \ @@ -651,8 +651,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_field_pos = 0 -#define GRUB_VIDEO_MI_BGR555(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_BGR555(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 15, \ x.bytes_per_pixel = 2, \ x.number_of_colors = 256, \ @@ -663,8 +663,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 5, \ x.blue_field_pos = 10 -#define GRUB_VIDEO_MI_BGR565(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_BGR565(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 16, \ x.bytes_per_pixel = 2, \ x.number_of_colors = 256, \ @@ -675,8 +675,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 5, \ x.blue_field_pos = 11 -#define GRUB_VIDEO_MI_BGR888(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_BGR888(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 24, \ x.bytes_per_pixel = 3, \ x.number_of_colors = 256, \ @@ -687,8 +687,8 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 8, \ x.blue_field_pos = 16 -#define GRUB_VIDEO_MI_BGRA8888(x) \ - x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \ +#define VasEBoot_VIDEO_MI_BGRA8888(x) \ + x.mode_type = VasEBoot_VIDEO_MODE_TYPE_RGB, \ x.bpp = 32, \ x.bytes_per_pixel = 4, \ x.number_of_colors = 256, \ @@ -701,4 +701,4 @@ extern void (*grub_video_capture_refresh_cb) (void); x.blue_mask_size = 8, \ x.blue_field_pos = 16 -#endif /* ! GRUB_VIDEO_HEADER */ +#endif /* ! VasEBoot_VIDEO_HEADER */ diff --git a/include/VasEBoot/video_fb.h b/include/VasEBoot/video_fb.h index 4a64fb8b7..3e72f1050 100644 --- a/include/VasEBoot/video_fb.h +++ b/include/VasEBoot/video_fb.h @@ -1,151 +1,151 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_VIDEO_FB_HEADER -#define GRUB_VIDEO_FB_HEADER 1 +#ifndef VasEBoot_VIDEO_FB_HEADER +#define VasEBoot_VIDEO_FB_HEADER 1 -#include -#include -#include -#include +#include +#include +#include +#include /* FB module internal prototype (should not be used from elsewhere). */ -struct grub_video_fbblit_info; +struct VasEBoot_video_fbblit_info; -struct grub_video_fbrender_target; +struct VasEBoot_video_fbrender_target; -#define GRUB_VIDEO_FBSTD_NUMCOLORS 16 -#define GRUB_VIDEO_FBSTD_EXT_NUMCOLORS 256 +#define VasEBoot_VIDEO_FBSTD_NUMCOLORS 16 +#define VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS 256 -extern struct grub_video_palette_data EXPORT_VAR(grub_video_fbstd_colors)[GRUB_VIDEO_FBSTD_EXT_NUMCOLORS]; +extern struct VasEBoot_video_palette_data EXPORT_VAR(VasEBoot_video_fbstd_colors)[VasEBoot_VIDEO_FBSTD_EXT_NUMCOLORS]; -grub_err_t -EXPORT_FUNC(grub_video_fb_init) (void); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_init) (void); -grub_err_t -EXPORT_FUNC(grub_video_fb_fini) (void); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_fini) (void); -grub_err_t -EXPORT_FUNC(grub_video_fb_get_info) (struct grub_video_mode_info *mode_info); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_get_info) (struct VasEBoot_video_mode_info *mode_info); -grub_err_t -EXPORT_FUNC(grub_video_fb_get_palette) (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); -grub_err_t -EXPORT_FUNC(grub_video_fb_set_palette) (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data); -grub_err_t -EXPORT_FUNC(grub_video_fb_set_viewport) (unsigned int x, unsigned int y, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_get_palette) (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_set_palette) (unsigned int start, unsigned int count, + struct VasEBoot_video_palette_data *palette_data); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_set_viewport) (unsigned int x, unsigned int y, unsigned int width, unsigned int height); -grub_err_t -EXPORT_FUNC(grub_video_fb_get_viewport) (unsigned int *x, unsigned int *y, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_get_viewport) (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); -grub_err_t -EXPORT_FUNC(grub_video_fb_set_region) (unsigned int x, unsigned int y, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_set_region) (unsigned int x, unsigned int y, unsigned int width, unsigned int height); -grub_err_t -EXPORT_FUNC(grub_video_fb_get_region) (unsigned int *x, unsigned int *y, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_get_region) (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); -grub_err_t -EXPORT_FUNC(grub_video_fb_set_area_status) - (grub_video_area_status_t area_status); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_set_area_status) + (VasEBoot_video_area_status_t area_status); -grub_err_t -EXPORT_FUNC(grub_video_fb_get_area_status) - (grub_video_area_status_t *area_status); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_get_area_status) + (VasEBoot_video_area_status_t *area_status); -grub_video_color_t -EXPORT_FUNC(grub_video_fb_map_color) (grub_uint32_t color_name); +VasEBoot_video_color_t +EXPORT_FUNC(VasEBoot_video_fb_map_color) (VasEBoot_uint32_t color_name); -grub_video_color_t -EXPORT_FUNC(grub_video_fb_map_rgb) (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue); +VasEBoot_video_color_t +EXPORT_FUNC(VasEBoot_video_fb_map_rgb) (VasEBoot_uint8_t red, VasEBoot_uint8_t green, + VasEBoot_uint8_t blue); -grub_video_color_t -EXPORT_FUNC(grub_video_fb_map_rgba) (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue, grub_uint8_t alpha); +VasEBoot_video_color_t +EXPORT_FUNC(VasEBoot_video_fb_map_rgba) (VasEBoot_uint8_t red, VasEBoot_uint8_t green, + VasEBoot_uint8_t blue, VasEBoot_uint8_t alpha); -grub_err_t -EXPORT_FUNC(grub_video_fb_unmap_color) (grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_unmap_color) (VasEBoot_video_color_t color, + VasEBoot_uint8_t *red, VasEBoot_uint8_t *green, + VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha); void -grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, - grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha); +VasEBoot_video_fb_unmap_color_int (struct VasEBoot_video_fbblit_info * source, + VasEBoot_video_color_t color, + VasEBoot_uint8_t *red, VasEBoot_uint8_t *green, + VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha); -grub_err_t -EXPORT_FUNC(grub_video_fb_fill_rect) (grub_video_color_t color, int x, int y, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_fill_rect) (VasEBoot_video_color_t color, int x, int y, unsigned int width, unsigned int height); -grub_err_t -EXPORT_FUNC(grub_video_fb_blit_bitmap) (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, int x, int y, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_blit_bitmap) (struct VasEBoot_video_bitmap *bitmap, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); -grub_err_t -EXPORT_FUNC(grub_video_fb_blit_render_target) (struct grub_video_fbrender_target *source, - enum grub_video_blit_operators oper, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_blit_render_target) (struct VasEBoot_video_fbrender_target *source, + enum VasEBoot_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); -grub_err_t -EXPORT_FUNC(grub_video_fb_scroll) (grub_video_color_t color, int dx, int dy); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_scroll) (VasEBoot_video_color_t color, int dx, int dy); -grub_err_t -EXPORT_FUNC(grub_video_fb_create_render_target) (struct grub_video_fbrender_target **result, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_create_render_target) (struct VasEBoot_video_fbrender_target **result, unsigned int width, unsigned int height, unsigned int mode_type __attribute__ ((unused))); -grub_err_t -EXPORT_FUNC(grub_video_fb_create_render_target_from_pointer) (struct grub_video_fbrender_target **result, - const struct grub_video_mode_info *mode_info, +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_create_render_target_from_pointer) (struct VasEBoot_video_fbrender_target **result, + const struct VasEBoot_video_mode_info *mode_info, void *ptr); -grub_err_t -EXPORT_FUNC(grub_video_fb_delete_render_target) (struct grub_video_fbrender_target *target); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_delete_render_target) (struct VasEBoot_video_fbrender_target *target); -grub_err_t -EXPORT_FUNC(grub_video_fb_get_active_render_target) (struct grub_video_fbrender_target **target); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_get_active_render_target) (struct VasEBoot_video_fbrender_target **target); -grub_err_t -EXPORT_FUNC(grub_video_fb_set_active_render_target) (struct grub_video_fbrender_target *target); +VasEBoot_err_t +EXPORT_FUNC(VasEBoot_video_fb_set_active_render_target) (struct VasEBoot_video_fbrender_target *target); -typedef grub_err_t (*grub_video_fb_set_page_t) (int page); +typedef VasEBoot_err_t (*VasEBoot_video_fb_set_page_t) (int page); -grub_err_t -EXPORT_FUNC (grub_video_fb_setup) (unsigned int mode_type, unsigned int mode_mask, - struct grub_video_mode_info *mode_info, +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_video_fb_setup) (unsigned int mode_type, unsigned int mode_mask, + struct VasEBoot_video_mode_info *mode_info, volatile void *page0_ptr, - grub_video_fb_set_page_t set_page_in, + VasEBoot_video_fb_set_page_t set_page_in, volatile void *page1_ptr); -grub_err_t -EXPORT_FUNC (grub_video_fb_swap_buffers) (void); -grub_err_t -EXPORT_FUNC (grub_video_fb_get_info_and_fini) (struct grub_video_mode_info *mode_info, +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_video_fb_swap_buffers) (void); +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_video_fb_get_info_and_fini) (struct VasEBoot_video_mode_info *mode_info, void **framebuf); -#endif /* ! GRUB_VIDEO_FB_HEADER */ +#endif /* ! VasEBoot_VIDEO_FB_HEADER */ diff --git a/include/VasEBoot/x86_64/at_keyboard.h b/include/VasEBoot/x86_64/at_keyboard.h index c632aa85c..6338d9648 100644 --- a/include/VasEBoot/x86_64/at_keyboard.h +++ b/include/VasEBoot/x86_64/at_keyboard.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/x86_64/efi/loader.h b/include/VasEBoot/x86_64/efi/loader.h index 7c302e8a5..593d93cb8 100644 --- a/include/VasEBoot/x86_64/efi/loader.h +++ b/include/VasEBoot/x86_64/efi/loader.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2006,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_LOADER_MACHINE_HEADER -#define GRUB_LOADER_MACHINE_HEADER 1 +#ifndef VasEBoot_LOADER_MACHINE_HEADER +#define VasEBoot_LOADER_MACHINE_HEADER 1 -#include -#include +#include +#include -#endif /* ! GRUB_LOADER_MACHINE_HEADER */ +#endif /* ! VasEBoot_LOADER_MACHINE_HEADER */ diff --git a/include/VasEBoot/x86_64/efi/memory.h b/include/VasEBoot/x86_64/efi/memory.h index 46e9145a3..57f425ca8 100644 --- a/include/VasEBoot/x86_64/efi/memory.h +++ b/include/VasEBoot/x86_64/efi/memory.h @@ -1,10 +1,10 @@ -#ifndef GRUB_MEMORY_CPU_HEADER -#include +#ifndef VasEBoot_MEMORY_CPU_HEADER +#include #if defined (__code_model_large__) -#define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffff +#define VasEBoot_EFI_MAX_USABLE_ADDRESS 0xffffffff #else -#define GRUB_EFI_MAX_USABLE_ADDRESS 0x7fffffff +#define VasEBoot_EFI_MAX_USABLE_ADDRESS 0x7fffffff #endif -#endif /* ! GRUB_MEMORY_CPU_HEADER */ +#endif /* ! VasEBoot_MEMORY_CPU_HEADER */ diff --git a/include/VasEBoot/x86_64/efi/serial.h b/include/VasEBoot/x86_64/efi/serial.h index 2d8563414..2dd72f652 100644 --- a/include/VasEBoot/x86_64/efi/serial.h +++ b/include/VasEBoot/x86_64/efi/serial.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/x86_64/io.h b/include/VasEBoot/x86_64/io.h index 9f465bca3..5a1fba2f5 100644 --- a/include/VasEBoot/x86_64/io.h +++ b/include/VasEBoot/x86_64/io.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include diff --git a/include/VasEBoot/x86_64/linux.h b/include/VasEBoot/x86_64/linux.h index 19ea93686..99822af40 100644 --- a/include/VasEBoot/x86_64/linux.h +++ b/include/VasEBoot/x86_64/linux.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include diff --git a/include/VasEBoot/x86_64/macho.h b/include/VasEBoot/x86_64/macho.h index 165b8da7a..0c33c449d 100644 --- a/include/VasEBoot/x86_64/macho.h +++ b/include/VasEBoot/x86_64/macho.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/x86_64/memory.h b/include/VasEBoot/x86_64/memory.h index 27fcd2534..e358a59e3 100644 --- a/include/VasEBoot/x86_64/memory.h +++ b/include/VasEBoot/x86_64/memory.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/x86_64/multiboot.h b/include/VasEBoot/x86_64/multiboot.h index 957c7a5ad..adc5303d2 100644 --- a/include/VasEBoot/x86_64/multiboot.h +++ b/include/VasEBoot/x86_64/multiboot.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/x86_64/pci.h b/include/VasEBoot/x86_64/pci.h index 91a9924fc..8b6536060 100644 --- a/include/VasEBoot/x86_64/pci.h +++ b/include/VasEBoot/x86_64/pci.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include +#include diff --git a/include/VasEBoot/x86_64/relocator.h b/include/VasEBoot/x86_64/relocator.h index 247e7a18b..bd6b12a39 100644 --- a/include/VasEBoot/x86_64/relocator.h +++ b/include/VasEBoot/x86_64/relocator.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/x86_64/setjmp.h b/include/VasEBoot/x86_64/setjmp.h index 6df8a1289..3c78a1a0a 100644 --- a/include/VasEBoot/x86_64/setjmp.h +++ b/include/VasEBoot/x86_64/setjmp.h @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2003,2006,2007,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_SETJMP_CPU_HEADER -#define GRUB_SETJMP_CPU_HEADER 1 +#ifndef VasEBoot_SETJMP_CPU_HEADER +#define VasEBoot_SETJMP_CPU_HEADER 1 -typedef unsigned long grub_jmp_buf[8]; +typedef unsigned long VasEBoot_jmp_buf[8]; -int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE GRUB_ASM_ATTR; -void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)) GRUB_ASM_ATTR; +int VasEBoot_setjmp (VasEBoot_jmp_buf env) RETURNS_TWICE VasEBoot_ASM_ATTR; +void VasEBoot_longjmp (VasEBoot_jmp_buf env, int val) __attribute__ ((noreturn)) VasEBoot_ASM_ATTR; -#endif /* ! GRUB_SETJMP_CPU_HEADER */ +#endif /* ! VasEBoot_SETJMP_CPU_HEADER */ diff --git a/include/VasEBoot/x86_64/time.h b/include/VasEBoot/x86_64/time.h index 842882cf2..a569904b6 100644 --- a/include/VasEBoot/x86_64/time.h +++ b/include/VasEBoot/x86_64/time.h @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #ifndef KERNEL_CPU_TIME_HEADER #define KERNEL_CPU_TIME_HEADER 1 static __inline void -grub_cpu_idle (void) +VasEBoot_cpu_idle (void) { /* FIXME: this can't work until we handle interrupts. */ /* __asm__ __volatile__ ("hlt"); */ diff --git a/include/VasEBoot/x86_64/types.h b/include/VasEBoot/x86_64/types.h index 0bbdc6d01..dbd553051 100644 --- a/include/VasEBoot/x86_64/types.h +++ b/include/VasEBoot/x86_64/types.h @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_TYPES_CPU_HEADER -#define GRUB_TYPES_CPU_HEADER 1 +#ifndef VasEBoot_TYPES_CPU_HEADER +#define VasEBoot_TYPES_CPU_HEADER 1 /* The size of void *. */ #ifdef __ILP32__ -#define GRUB_TARGET_SIZEOF_VOID_P 4 +#define VasEBoot_TARGET_SIZEOF_VOID_P 4 #else -#define GRUB_TARGET_SIZEOF_VOID_P 8 +#define VasEBoot_TARGET_SIZEOF_VOID_P 8 #endif /* The size of long. */ #if defined(__MINGW32__) || defined(__ILP32__) -#define GRUB_TARGET_SIZEOF_LONG 4 +#define VasEBoot_TARGET_SIZEOF_LONG 4 #else -#define GRUB_TARGET_SIZEOF_LONG 8 +#define VasEBoot_TARGET_SIZEOF_LONG 8 #endif /* x86_64 is little-endian. */ -#undef GRUB_TARGET_WORDS_BIGENDIAN +#undef VasEBoot_TARGET_WORDS_BIGENDIAN -#define GRUB_HAVE_UNALIGNED_ACCESS 1 +#define VasEBoot_HAVE_UNALIGNED_ACCESS 1 -#endif /* ! GRUB_TYPES_CPU_HEADER */ +#endif /* ! VasEBoot_TYPES_CPU_HEADER */ diff --git a/include/VasEBoot/x86_64/xen/hypercall.h b/include/VasEBoot/x86_64/xen/hypercall.h index 90dd9007b..1fe3d486c 100644 --- a/include/VasEBoot/x86_64/xen/hypercall.h +++ b/include/VasEBoot/x86_64/xen/hypercall.h @@ -1,36 +1,36 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_XEN_CPU_HYPERCALL_HEADER -#define GRUB_XEN_CPU_HYPERCALL_HEADER 1 +#ifndef VasEBoot_XEN_CPU_HYPERCALL_HEADER +#define VasEBoot_XEN_CPU_HYPERCALL_HEADER 1 -#include +#include -int EXPORT_FUNC (grub_xen_sched_op) (int cmd, void *arg) GRUB_ASM_ATTR; -int grub_xen_update_va_mapping (void *addr, uint64_t pte, uint64_t flags) GRUB_ASM_ATTR; -int EXPORT_FUNC (grub_xen_event_channel_op) (int op, void *arg) GRUB_ASM_ATTR; +int EXPORT_FUNC (VasEBoot_xen_sched_op) (int cmd, void *arg) VasEBoot_ASM_ATTR; +int VasEBoot_xen_update_va_mapping (void *addr, uint64_t pte, uint64_t flags) VasEBoot_ASM_ATTR; +int EXPORT_FUNC (VasEBoot_xen_event_channel_op) (int op, void *arg) VasEBoot_ASM_ATTR; -int grub_xen_mmuext_op (mmuext_op_t * ops, +int VasEBoot_xen_mmuext_op (mmuext_op_t * ops, unsigned int count, - unsigned int *pdone, unsigned int foreigndom) GRUB_ASM_ATTR; -int EXPORT_FUNC (grub_xen_mmu_update) (const struct mmu_update * reqs, + unsigned int *pdone, unsigned int foreigndom) VasEBoot_ASM_ATTR; +int EXPORT_FUNC (VasEBoot_xen_mmu_update) (const struct mmu_update * reqs, unsigned count, unsigned *done_out, - unsigned foreigndom) GRUB_ASM_ATTR; -int EXPORT_FUNC (grub_xen_grant_table_op) (int, void *, int) GRUB_ASM_ATTR; + unsigned foreigndom) VasEBoot_ASM_ATTR; +int EXPORT_FUNC (VasEBoot_xen_grant_table_op) (int, void *, int) VasEBoot_ASM_ATTR; #endif diff --git a/include/VasEBoot/x86_64/xnu.h b/include/VasEBoot/x86_64/xnu.h index ae61733b9..72606ff92 100644 --- a/include/VasEBoot/x86_64/xnu.h +++ b/include/VasEBoot/x86_64/xnu.h @@ -1 +1 @@ -#include +#include diff --git a/include/VasEBoot/xen.h b/include/VasEBoot/xen.h index c31cc10c7..5112e1f6c 100644 --- a/include/VasEBoot/xen.h +++ b/include/VasEBoot/xen.h @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_XEN_HEADER -#define GRUB_XEN_HEADER 1 +#ifndef VasEBoot_XEN_HEADER +#define VasEBoot_XEN_HEADER 1 #define __XEN_INTERFACE_VERSION__ 0x0003020a -#define memset grub_memset +#define memset VasEBoot_memset #ifdef ASM_FILE #define __ASSEMBLY__ #include #else -#include -#include -#include +#include +#include +#include -#ifndef GRUB_SYMBOL_GENERATOR -typedef grub_int8_t int8_t; -typedef grub_int16_t int16_t; -typedef grub_uint8_t uint8_t; -typedef grub_uint16_t uint16_t; -typedef grub_uint32_t uint32_t; -typedef grub_uint64_t uint64_t; +#ifndef VasEBoot_SYMBOL_GENERATOR +typedef VasEBoot_int8_t int8_t; +typedef VasEBoot_int16_t int16_t; +typedef VasEBoot_uint8_t uint8_t; +typedef VasEBoot_uint16_t uint16_t; +typedef VasEBoot_uint32_t uint32_t; +typedef VasEBoot_uint64_t uint64_t; #include #include @@ -49,52 +49,52 @@ typedef grub_uint64_t uint64_t; #include #endif -#include +#include -extern grub_size_t EXPORT_VAR (grub_xen_n_allocated_shared_pages); +extern VasEBoot_size_t EXPORT_VAR (VasEBoot_xen_n_allocated_shared_pages); -#define GRUB_XEN_LOG_PAGE_SIZE 12 -#define GRUB_XEN_PAGE_SIZE (1 << GRUB_XEN_LOG_PAGE_SIZE) +#define VasEBoot_XEN_LOG_PAGE_SIZE 12 +#define VasEBoot_XEN_PAGE_SIZE (1 << VasEBoot_XEN_LOG_PAGE_SIZE) -extern volatile struct xencons_interface *grub_xen_xcons; -extern volatile struct shared_info *EXPORT_VAR (grub_xen_shared_info); -extern volatile struct xenstore_domain_interface *grub_xen_xenstore; -extern volatile grant_entry_v1_t *grub_xen_grant_table; +extern volatile struct xencons_interface *VasEBoot_xen_xcons; +extern volatile struct shared_info *EXPORT_VAR (VasEBoot_xen_shared_info); +extern volatile struct xenstore_domain_interface *VasEBoot_xen_xenstore; +extern volatile grant_entry_v1_t *VasEBoot_xen_grant_table; -void EXPORT_FUNC (grub_xen_store_send) (const void *buf_, grub_size_t len); -void EXPORT_FUNC (grub_xen_store_recv) (void *buf_, grub_size_t len); -grub_err_t -EXPORT_FUNC (grub_xenstore_dir) (const char *dir, +void EXPORT_FUNC (VasEBoot_xen_store_send) (const void *buf_, VasEBoot_size_t len); +void EXPORT_FUNC (VasEBoot_xen_store_recv) (void *buf_, VasEBoot_size_t len); +VasEBoot_err_t +EXPORT_FUNC (VasEBoot_xenstore_dir) (const char *dir, int (*hook) (const char *dir, void *hook_data), void *hook_data); -void *EXPORT_FUNC (grub_xenstore_get_file) (const char *dir, - grub_size_t * len); -grub_err_t EXPORT_FUNC (grub_xenstore_write_file) (const char *dir, +void *EXPORT_FUNC (VasEBoot_xenstore_get_file) (const char *dir, + VasEBoot_size_t * len); +VasEBoot_err_t EXPORT_FUNC (VasEBoot_xenstore_write_file) (const char *dir, const void *buf, - grub_size_t len); + VasEBoot_size_t len); -typedef unsigned int grub_xen_grant_t; +typedef unsigned int VasEBoot_xen_grant_t; -void *EXPORT_FUNC (grub_xen_alloc_shared_page) (domid_t dom, - grub_xen_grant_t * grnum); -void EXPORT_FUNC (grub_xen_free_shared_page) (void *ptr); +void *EXPORT_FUNC (VasEBoot_xen_alloc_shared_page) (domid_t dom, + VasEBoot_xen_grant_t * grnum); +void EXPORT_FUNC (VasEBoot_xen_free_shared_page) (void *ptr); #define mb() asm volatile("mfence;sfence;" : : : "memory"); -extern struct start_info *EXPORT_VAR (grub_xen_start_page_addr); +extern struct start_info *EXPORT_VAR (VasEBoot_xen_start_page_addr); -void grub_console_init (void); +void VasEBoot_console_init (void); -void grub_xendisk_fini (void); -void grub_xendisk_init (void); +void VasEBoot_xendisk_fini (void); +void VasEBoot_xendisk_init (void); #ifdef __x86_64__ -typedef grub_uint64_t grub_xen_mfn_t; +typedef VasEBoot_uint64_t VasEBoot_xen_mfn_t; #else -typedef grub_uint32_t grub_xen_mfn_t; +typedef VasEBoot_uint32_t VasEBoot_xen_mfn_t; #endif -typedef unsigned int grub_xen_evtchn_t; +typedef unsigned int VasEBoot_xen_evtchn_t; #endif #endif diff --git a/include/VasEBoot/xen/relocator.h b/include/VasEBoot/xen/relocator.h index 35a0ad9c7..59d65dcb4 100644 --- a/include/VasEBoot/xen/relocator.h +++ b/include/VasEBoot/xen/relocator.h @@ -1,46 +1,46 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_RELOCATOR_XEN_HEADER -#define GRUB_RELOCATOR_XEN_HEADER 1 +#ifndef VasEBoot_RELOCATOR_XEN_HEADER +#define VasEBoot_RELOCATOR_XEN_HEADER 1 -#include -#include -#include +#include +#include +#include #define XEN_MAX_MAPPINGS 3 -struct grub_relocator_xen_state +struct VasEBoot_relocator_xen_state { - grub_addr_t start_info; - grub_addr_t paging_start[XEN_MAX_MAPPINGS]; - grub_addr_t paging_size[XEN_MAX_MAPPINGS]; - grub_addr_t mfn_list; - grub_addr_t stack; - grub_addr_t entry_point; + VasEBoot_addr_t start_info; + VasEBoot_addr_t paging_start[XEN_MAX_MAPPINGS]; + VasEBoot_addr_t paging_size[XEN_MAX_MAPPINGS]; + VasEBoot_addr_t mfn_list; + VasEBoot_addr_t stack; + VasEBoot_addr_t entry_point; }; -grub_err_t -grub_relocator_xen_boot (struct grub_relocator *rel, - struct grub_relocator_xen_state state, - grub_uint64_t remapper_pfn, - grub_addr_t remapper_virt, - grub_uint64_t trampoline_pfn, - grub_addr_t trampoline_virt); +VasEBoot_err_t +VasEBoot_relocator_xen_boot (struct VasEBoot_relocator *rel, + struct VasEBoot_relocator_xen_state state, + VasEBoot_uint64_t remapper_pfn, + VasEBoot_addr_t remapper_virt, + VasEBoot_uint64_t trampoline_pfn, + VasEBoot_addr_t trampoline_virt); #endif diff --git a/include/VasEBoot/xen_file.h b/include/VasEBoot/xen_file.h index f8d8b19a7..541d09c89 100644 --- a/include/VasEBoot/xen_file.h +++ b/include/VasEBoot/xen_file.h @@ -1,41 +1,41 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_XEN_FILE_HEADER -#define GRUB_XEN_FILE_HEADER 1 +#ifndef VasEBoot_XEN_FILE_HEADER +#define VasEBoot_XEN_FILE_HEADER 1 -#include -#include -#include +#include +#include +#include -grub_elf_t grub_xen_file (grub_file_t file); -grub_elf_t grub_xen_file_and_cmdline (grub_file_t file, +VasEBoot_elf_t VasEBoot_xen_file (VasEBoot_file_t file); +VasEBoot_elf_t VasEBoot_xen_file_and_cmdline (VasEBoot_file_t file, char *cmdline, - grub_size_t cmdline_max_len); + VasEBoot_size_t cmdline_max_len); -struct grub_xen_file_info +struct VasEBoot_xen_file_info { - grub_uint64_t kern_start, kern_end; - grub_uint64_t virt_base; - grub_uint64_t entry_point; - grub_uint64_t hypercall_page; - grub_uint64_t paddr_offset; - grub_uint64_t p2m_base; + VasEBoot_uint64_t kern_start, kern_end; + VasEBoot_uint64_t virt_base; + VasEBoot_uint64_t entry_point; + VasEBoot_uint64_t hypercall_page; + VasEBoot_uint64_t paddr_offset; + VasEBoot_uint64_t p2m_base; int has_hypercall_page; int has_note; int has_xen_guest; @@ -44,17 +44,17 @@ struct grub_xen_file_info int unmapped_initrd; enum { - GRUB_XEN_FILE_I386 = 1, - GRUB_XEN_FILE_I386_PAE = 2, - GRUB_XEN_FILE_I386_PAE_BIMODE = 3, - GRUB_XEN_FILE_X86_64 = 4 + VasEBoot_XEN_FILE_I386 = 1, + VasEBoot_XEN_FILE_I386_PAE = 2, + VasEBoot_XEN_FILE_I386_PAE_BIMODE = 3, + VasEBoot_XEN_FILE_X86_64 = 4 } arch; }; -grub_err_t -grub_xen_get_info32 (grub_elf_t elf, struct grub_xen_file_info *xi); -grub_err_t -grub_xen_get_info64 (grub_elf_t elf, struct grub_xen_file_info *xi); -grub_err_t grub_xen_get_info (grub_elf_t elf, struct grub_xen_file_info *xi); +VasEBoot_err_t +VasEBoot_xen_get_info32 (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info *xi); +VasEBoot_err_t +VasEBoot_xen_get_info64 (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info *xi); +VasEBoot_err_t VasEBoot_xen_get_info (VasEBoot_elf_t elf, struct VasEBoot_xen_file_info *xi); #endif diff --git a/include/VasEBoot/xnu.h b/include/VasEBoot/xnu.h index b7a7f450c..2613e03a7 100644 --- a/include/VasEBoot/xnu.h +++ b/include/VasEBoot/xnu.h @@ -1,119 +1,119 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_XNU_H -#define GRUB_XNU_H 1 +#ifndef VasEBoot_XNU_H +#define VasEBoot_XNU_H 1 -#include +#include /* Header of a hibernation image. */ -struct grub_xnu_hibernate_header +struct VasEBoot_xnu_hibernate_header { /* Size of the image. Notice that file containing image is usually bigger. */ - grub_uint64_t image_size; - grub_uint8_t unknown1[8]; + VasEBoot_uint64_t image_size; + VasEBoot_uint8_t unknown1[8]; /* Where to copy launchcode? */ - grub_uint32_t launchcode_target_page; + VasEBoot_uint32_t launchcode_target_page; /* How many pages of launchcode? */ - grub_uint32_t launchcode_numpages; + VasEBoot_uint32_t launchcode_numpages; /* Where to jump? */ - grub_uint32_t entry_point; + VasEBoot_uint32_t entry_point; /* %esp at start. */ - grub_uint32_t stack; - grub_uint8_t unknown2[44]; -#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65 - grub_uint32_t magic; - grub_uint8_t unknown3[28]; + VasEBoot_uint32_t stack; + VasEBoot_uint8_t unknown2[44]; +#define VasEBoot_XNU_HIBERNATE_MAGIC 0x73696d65 + VasEBoot_uint32_t magic; + VasEBoot_uint8_t unknown3[28]; /* This value is non-zero if page is encrypted. Unsupported. */ - grub_uint64_t encoffset; - grub_uint8_t unknown4[360]; + VasEBoot_uint64_t encoffset; + VasEBoot_uint8_t unknown4[360]; /* The size of additional header used to locate image without parsing FS. Used only to skip it. */ - grub_uint32_t extmapsize; -} GRUB_PACKED; + VasEBoot_uint32_t extmapsize; +} VasEBoot_PACKED; /* In-memory structure for temporary keeping device tree. */ -struct grub_xnu_devtree_key +struct VasEBoot_xnu_devtree_key { char *name; int datasize; /* -1 for not leaves. */ union { - struct grub_xnu_devtree_key *first_child; + struct VasEBoot_xnu_devtree_key *first_child; void *data; }; - struct grub_xnu_devtree_key *next; + struct VasEBoot_xnu_devtree_key *next; }; /* A structure used in memory-map values. */ struct -grub_xnu_extdesc +VasEBoot_xnu_extdesc { - grub_uint32_t addr; - grub_uint32_t size; -} GRUB_PACKED; + VasEBoot_uint32_t addr; + VasEBoot_uint32_t size; +} VasEBoot_PACKED; /* Header describing extension in the memory. */ -struct grub_xnu_extheader +struct VasEBoot_xnu_extheader { - grub_uint32_t infoplistaddr; - grub_uint32_t infoplistsize; - grub_uint32_t binaryaddr; - grub_uint32_t binarysize; - grub_uint32_t nameaddr; - grub_uint32_t namesize; -} GRUB_PACKED; + VasEBoot_uint32_t infoplistaddr; + VasEBoot_uint32_t infoplistsize; + VasEBoot_uint32_t binaryaddr; + VasEBoot_uint32_t binarysize; + VasEBoot_uint32_t nameaddr; + VasEBoot_uint32_t namesize; +} VasEBoot_PACKED; -struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent, +struct VasEBoot_xnu_devtree_key *VasEBoot_xnu_create_key (struct VasEBoot_xnu_devtree_key **parent, const char *name); -extern struct grub_xnu_devtree_key *grub_xnu_devtree_root; +extern struct VasEBoot_xnu_devtree_key *VasEBoot_xnu_devtree_root; -void grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur); +void VasEBoot_xnu_free_devtree (struct VasEBoot_xnu_devtree_key *cur); -grub_err_t grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size); -struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent, +VasEBoot_err_t VasEBoot_xnu_writetree_toheap (VasEBoot_addr_t *target, VasEBoot_size_t *size); +struct VasEBoot_xnu_devtree_key *VasEBoot_xnu_create_value (struct VasEBoot_xnu_devtree_key **parent, const char *name); -void grub_xnu_lock (void); -void grub_xnu_unlock (void); -grub_err_t grub_xnu_resume (char *imagename); -grub_err_t grub_xnu_boot_resume (void); -struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent, +void VasEBoot_xnu_lock (void); +void VasEBoot_xnu_unlock (void); +VasEBoot_err_t VasEBoot_xnu_resume (char *imagename); +VasEBoot_err_t VasEBoot_xnu_boot_resume (void); +struct VasEBoot_xnu_devtree_key *VasEBoot_xnu_find_key (struct VasEBoot_xnu_devtree_key *parent, const char *name); -grub_err_t grub_xnu_align_heap (int align); -grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, +VasEBoot_err_t VasEBoot_xnu_align_heap (int align); +VasEBoot_err_t VasEBoot_xnu_scan_dir_for_kexts (char *dirname, const char *osbundlerequired, int maxrecursion); -grub_err_t grub_xnu_load_kext_from_dir (char *dirname, +VasEBoot_err_t VasEBoot_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired, int maxrecursion); -grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target); -grub_err_t grub_xnu_fill_devicetree (void); -extern struct grub_relocator *grub_xnu_relocator; +VasEBoot_err_t VasEBoot_xnu_heap_malloc (int size, void **src, VasEBoot_addr_t *target); +VasEBoot_err_t VasEBoot_xnu_fill_devicetree (void); +extern struct VasEBoot_relocator *VasEBoot_xnu_relocator; -extern grub_size_t grub_xnu_heap_size; -extern struct grub_video_bitmap *grub_xnu_bitmap; -typedef enum {GRUB_XNU_BITMAP_CENTER, GRUB_XNU_BITMAP_STRETCH} - grub_xnu_bitmap_mode_t; -extern grub_xnu_bitmap_mode_t grub_xnu_bitmap_mode; -extern int grub_xnu_is_64bit; -extern grub_addr_t grub_xnu_heap_target_start; -extern int grub_xnu_darwin_version; +extern VasEBoot_size_t VasEBoot_xnu_heap_size; +extern struct VasEBoot_video_bitmap *VasEBoot_xnu_bitmap; +typedef enum {VasEBoot_XNU_BITMAP_CENTER, VasEBoot_XNU_BITMAP_STRETCH} + VasEBoot_xnu_bitmap_mode_t; +extern VasEBoot_xnu_bitmap_mode_t VasEBoot_xnu_bitmap_mode; +extern int VasEBoot_xnu_is_64bit; +extern VasEBoot_addr_t VasEBoot_xnu_heap_target_start; +extern int VasEBoot_xnu_darwin_version; #endif diff --git a/include/VasEBoot/zfs/dmu.h b/include/VasEBoot/zfs/dmu.h index 4ad616c74..7a5679640 100644 --- a/include/VasEBoot/zfs/dmu.h +++ b/include/VasEBoot/zfs/dmu.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. diff --git a/include/VasEBoot/zfs/dmu_objset.h b/include/VasEBoot/zfs/dmu_objset.h index 57d21db5c..6bb880eab 100644 --- a/include/VasEBoot/zfs/dmu_objset.h +++ b/include/VasEBoot/zfs/dmu_objset.h @@ -1,20 +1,20 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * Copyright (C) 2010 Robert Millan * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. @@ -24,7 +24,7 @@ #ifndef _SYS_DMU_OBJSET_H #define _SYS_DMU_OBJSET_H -#include +#include #define OBJSET_PHYS_SIZE 2048 #define OBJSET_PHYS_SIZE_V14 1024 @@ -32,10 +32,10 @@ typedef struct objset_phys { dnode_phys_t os_meta_dnode; zil_header_t os_zil_header; - grub_uint64_t os_type; - grub_uint64_t os_flags; + VasEBoot_uint64_t os_type; + VasEBoot_uint64_t os_flags; char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 - - sizeof (zil_header_t) - sizeof (grub_uint64_t)*2]; + sizeof (zil_header_t) - sizeof (VasEBoot_uint64_t)*2]; dnode_phys_t os_userused_dnode; dnode_phys_t os_groupused_dnode; } objset_phys_t; diff --git a/include/VasEBoot/zfs/dnode.h b/include/VasEBoot/zfs/dnode.h index e4993df1e..c6f04ebbd 100644 --- a/include/VasEBoot/zfs/dnode.h +++ b/include/VasEBoot/zfs/dnode.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -23,7 +23,7 @@ #ifndef _SYS_DNODE_H #define _SYS_DNODE_H -#include +#include /* * Fixed constants. @@ -48,26 +48,26 @@ (((dnp)->dn_nblkptr - 1) * sizeof (blkptr_t)))) typedef struct dnode_phys { - grub_uint8_t dn_type; /* dmu_object_type_t */ - grub_uint8_t dn_indblkshift; /* ln2(indirect block size) */ - grub_uint8_t dn_nlevels; /* 1=dn_blkptr->data blocks */ - grub_uint8_t dn_nblkptr; /* length of dn_blkptr */ - grub_uint8_t dn_bonustype; /* type of data in bonus buffer */ - grub_uint8_t dn_checksum; /* ZIO_CHECKSUM type */ - grub_uint8_t dn_compress; /* ZIO_COMPRESS type */ - grub_uint8_t dn_flags; /* DNODE_FLAG_* */ - grub_uint16_t dn_datablkszsec; /* data block size in 512b sectors */ - grub_uint16_t dn_bonuslen; /* length of dn_bonus */ - grub_uint8_t dn_pad2[4]; + VasEBoot_uint8_t dn_type; /* dmu_object_type_t */ + VasEBoot_uint8_t dn_indblkshift; /* ln2(indirect block size) */ + VasEBoot_uint8_t dn_nlevels; /* 1=dn_blkptr->data blocks */ + VasEBoot_uint8_t dn_nblkptr; /* length of dn_blkptr */ + VasEBoot_uint8_t dn_bonustype; /* type of data in bonus buffer */ + VasEBoot_uint8_t dn_checksum; /* ZIO_CHECKSUM type */ + VasEBoot_uint8_t dn_compress; /* ZIO_COMPRESS type */ + VasEBoot_uint8_t dn_flags; /* DNODE_FLAG_* */ + VasEBoot_uint16_t dn_datablkszsec; /* data block size in 512b sectors */ + VasEBoot_uint16_t dn_bonuslen; /* length of dn_bonus */ + VasEBoot_uint8_t dn_pad2[4]; /* accounting is protected by dn_dirty_mtx */ - grub_uint64_t dn_maxblkid; /* largest allocated block ID */ - grub_uint64_t dn_used; /* bytes (or sectors) of disk space */ + VasEBoot_uint64_t dn_maxblkid; /* largest allocated block ID */ + VasEBoot_uint64_t dn_used; /* bytes (or sectors) of disk space */ - grub_uint64_t dn_pad3[4]; + VasEBoot_uint64_t dn_pad3[4]; blkptr_t dn_blkptr[1]; - grub_uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)]; + VasEBoot_uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)]; blkptr_t dn_spill; } dnode_phys_t; diff --git a/include/VasEBoot/zfs/dsl_dataset.h b/include/VasEBoot/zfs/dsl_dataset.h index c17bf801e..338e45968 100644 --- a/include/VasEBoot/zfs/dsl_dataset.h +++ b/include/VasEBoot/zfs/dsl_dataset.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. @@ -24,29 +24,29 @@ #define _SYS_DSL_DATASET_H typedef struct dsl_dataset_phys { - grub_uint64_t ds_dir_obj; - grub_uint64_t ds_prev_snap_obj; - grub_uint64_t ds_prev_snap_txg; - grub_uint64_t ds_next_snap_obj; - grub_uint64_t ds_snapnames_zapobj; /* zap obj of snaps; ==0 for snaps */ - grub_uint64_t ds_num_children; /* clone/snap children; ==0 for head */ - grub_uint64_t ds_creation_time; /* seconds since 1970 */ - grub_uint64_t ds_creation_txg; - grub_uint64_t ds_deadlist_obj; - grub_uint64_t ds_used_bytes; - grub_uint64_t ds_compressed_bytes; - grub_uint64_t ds_uncompressed_bytes; - grub_uint64_t ds_unique_bytes; /* only relevant to snapshots */ + VasEBoot_uint64_t ds_dir_obj; + VasEBoot_uint64_t ds_prev_snap_obj; + VasEBoot_uint64_t ds_prev_snap_txg; + VasEBoot_uint64_t ds_next_snap_obj; + VasEBoot_uint64_t ds_snapnames_zapobj; /* zap obj of snaps; ==0 for snaps */ + VasEBoot_uint64_t ds_num_children; /* clone/snap children; ==0 for head */ + VasEBoot_uint64_t ds_creation_time; /* seconds since 1970 */ + VasEBoot_uint64_t ds_creation_txg; + VasEBoot_uint64_t ds_deadlist_obj; + VasEBoot_uint64_t ds_used_bytes; + VasEBoot_uint64_t ds_compressed_bytes; + VasEBoot_uint64_t ds_uncompressed_bytes; + VasEBoot_uint64_t ds_unique_bytes; /* only relevant to snapshots */ /* * The ds_fsid_guid is a 56-bit ID that can change to avoid * collisions. The ds_guid is a 64-bit ID that will never * change, so there is a small probability that it will collide. */ - grub_uint64_t ds_fsid_guid; - grub_uint64_t ds_guid; - grub_uint64_t ds_flags; + VasEBoot_uint64_t ds_fsid_guid; + VasEBoot_uint64_t ds_guid; + VasEBoot_uint64_t ds_flags; blkptr_t ds_bp; - grub_uint64_t ds_pad[8]; /* pad out to 320 bytes for good measure */ + VasEBoot_uint64_t ds_pad[8]; /* pad out to 320 bytes for good measure */ } dsl_dataset_phys_t; #endif /* _SYS_DSL_DATASET_H */ diff --git a/include/VasEBoot/zfs/dsl_dir.h b/include/VasEBoot/zfs/dsl_dir.h index 6542a77fe..31da22dda 100644 --- a/include/VasEBoot/zfs/dsl_dir.h +++ b/include/VasEBoot/zfs/dsl_dir.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. @@ -24,27 +24,27 @@ #define _SYS_DSL_DIR_H typedef struct dsl_dir_phys { - grub_uint64_t dd_creation_time; /* not actually used */ - grub_uint64_t dd_head_dataset_obj; - grub_uint64_t dd_parent_obj; - grub_uint64_t dd_clone_parent_obj; - grub_uint64_t dd_child_dir_zapobj; + VasEBoot_uint64_t dd_creation_time; /* not actually used */ + VasEBoot_uint64_t dd_head_dataset_obj; + VasEBoot_uint64_t dd_parent_obj; + VasEBoot_uint64_t dd_clone_parent_obj; + VasEBoot_uint64_t dd_child_dir_zapobj; /* * how much space our children are accounting for; for leaf * datasets, == physical space used by fs + snaps */ - grub_uint64_t dd_used_bytes; - grub_uint64_t dd_compressed_bytes; - grub_uint64_t dd_uncompressed_bytes; + VasEBoot_uint64_t dd_used_bytes; + VasEBoot_uint64_t dd_compressed_bytes; + VasEBoot_uint64_t dd_uncompressed_bytes; /* Administrative quota setting */ - grub_uint64_t dd_quota; + VasEBoot_uint64_t dd_quota; /* Administrative reservation setting */ - grub_uint64_t dd_reserved; - grub_uint64_t dd_props_zapobj; - grub_uint64_t dd_deleg_zapobj; /* dataset permissions */ - grub_uint64_t unused[7]; - grub_uint64_t keychain; - grub_uint64_t unused2[12]; + VasEBoot_uint64_t dd_reserved; + VasEBoot_uint64_t dd_props_zapobj; + VasEBoot_uint64_t dd_deleg_zapobj; /* dataset permissions */ + VasEBoot_uint64_t unused[7]; + VasEBoot_uint64_t keychain; + VasEBoot_uint64_t unused2[12]; } dsl_dir_phys_t; #endif /* _SYS_DSL_DIR_H */ diff --git a/include/VasEBoot/zfs/sa_impl.h b/include/VasEBoot/zfs/sa_impl.h index 0845d1290..3bbeec878 100644 --- a/include/VasEBoot/zfs/sa_impl.h +++ b/include/VasEBoot/zfs/sa_impl.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -23,9 +23,9 @@ #define _SYS_SA_IMPL_H typedef struct sa_hdr_phys { - grub_uint32_t sa_magic; - grub_uint16_t sa_layout_info; - grub_uint16_t sa_lengths[1]; + VasEBoot_uint32_t sa_magic; + VasEBoot_uint16_t sa_layout_info; + VasEBoot_uint16_t sa_lengths[1]; } sa_hdr_phys_t; #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 16, 3, 0) diff --git a/include/VasEBoot/zfs/spa.h b/include/VasEBoot/zfs/spa.h index 8dd1fa8e3..d4cb79ff8 100644 --- a/include/VasEBoot/zfs/spa.h +++ b/include/VasEBoot/zfs/spa.h @@ -1,44 +1,44 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009 Free Software Foundation, Inc. * Copyright 2010 Sun Microsystems, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#ifndef GRUB_ZFS_SPA_HEADER -#define GRUB_ZFS_SPA_HEADER 1 +#ifndef VasEBoot_ZFS_SPA_HEADER +#define VasEBoot_ZFS_SPA_HEADER 1 -#define grub_zfs_to_cpu16(x,a) (((a) == GRUB_ZFS_BIG_ENDIAN) ? \ - grub_be_to_cpu16(x) \ - : grub_le_to_cpu16(x)) -#define grub_cpu_to_zfs16(x,a) (((a) == GRUB_ZFS_BIG_ENDIAN) ? \ - grub_cpu_to_be16(x) \ - : grub_cpu_to_le16(x)) +#define VasEBoot_zfs_to_cpu16(x,a) (((a) == VasEBoot_ZFS_BIG_ENDIAN) ? \ + VasEBoot_be_to_cpu16(x) \ + : VasEBoot_le_to_cpu16(x)) +#define VasEBoot_cpu_to_zfs16(x,a) (((a) == VasEBoot_ZFS_BIG_ENDIAN) ? \ + VasEBoot_cpu_to_be16(x) \ + : VasEBoot_cpu_to_le16(x)) -#define grub_zfs_to_cpu32(x,a) (((a) == GRUB_ZFS_BIG_ENDIAN) ? \ - grub_be_to_cpu32(x) \ - : grub_le_to_cpu32(x)) -#define grub_cpu_to_zfs32(x,a) (((a) == GRUB_ZFS_BIG_ENDIAN) ? \ - grub_cpu_to_be32(x) \ - : grub_cpu_to_le32(x)) +#define VasEBoot_zfs_to_cpu32(x,a) (((a) == VasEBoot_ZFS_BIG_ENDIAN) ? \ + VasEBoot_be_to_cpu32(x) \ + : VasEBoot_le_to_cpu32(x)) +#define VasEBoot_cpu_to_zfs32(x,a) (((a) == VasEBoot_ZFS_BIG_ENDIAN) ? \ + VasEBoot_cpu_to_be32(x) \ + : VasEBoot_cpu_to_le32(x)) -#define grub_zfs_to_cpu64(x,a) (((a) == GRUB_ZFS_BIG_ENDIAN) \ - ? grub_be_to_cpu64(x) \ - : grub_le_to_cpu64(x)) -#define grub_cpu_to_zfs64(x,a) (((a) == GRUB_ZFS_BIG_ENDIAN) ? grub_cpu_to_be64(x) \ - : grub_cpu_to_le64(x)) +#define VasEBoot_zfs_to_cpu64(x,a) (((a) == VasEBoot_ZFS_BIG_ENDIAN) \ + ? VasEBoot_be_to_cpu64(x) \ + : VasEBoot_le_to_cpu64(x)) +#define VasEBoot_cpu_to_zfs64(x,a) (((a) == VasEBoot_ZFS_BIG_ENDIAN) ? VasEBoot_cpu_to_be64(x) \ + : VasEBoot_cpu_to_le64(x)) /* * General-purpose 32-bit and 64-bit bitfield encodings. @@ -90,7 +90,7 @@ * The members of the dva_t should be considered opaque outside the SPA. */ typedef struct dva { - grub_uint64_t dva_word[2]; + VasEBoot_uint64_t dva_word[2]; } dva_t; /* @@ -99,11 +99,11 @@ typedef struct dva { typedef struct zio_cksum { union { - grub_uint64_t zc_word[4]; + VasEBoot_uint64_t zc_word[4]; struct { - grub_uint32_t zc_cut_cksum[5]; - grub_uint32_t zc_mac[3]; + VasEBoot_uint32_t zc_cut_cksum[5]; + VasEBoot_uint32_t zc_mac[3]; }; }; } zio_cksum_t; @@ -174,11 +174,11 @@ typedef struct zio_cksum { typedef struct blkptr { dva_t blk_dva[SPA_DVAS_PER_BP]; /* Data Virtual Addresses */ - grub_uint64_t blk_prop; /* size, compression, type, etc */ - grub_uint64_t blk_pad[2]; /* Extra space for the future */ - grub_uint64_t blk_phys_birth; /* txg when block was allocated */ - grub_uint64_t blk_birth; /* transaction group at birth */ - grub_uint64_t blk_fill; /* fill count */ + VasEBoot_uint64_t blk_prop; /* size, compression, type, etc */ + VasEBoot_uint64_t blk_pad[2]; /* Extra space for the future */ + VasEBoot_uint64_t blk_phys_birth; /* txg when block was allocated */ + VasEBoot_uint64_t blk_birth; /* transaction group at birth */ + VasEBoot_uint64_t blk_fill; /* fill count */ zio_cksum_t blk_cksum; /* 256-bit checksum */ } blkptr_t; @@ -292,7 +292,7 @@ typedef enum bp_embedded_type { } bp_embedded_type_t; #define BPE_NUM_WORDS 14 -#define BPE_PAYLOAD_SIZE (BPE_NUM_WORDS * sizeof(grub_uint64_t)) +#define BPE_PAYLOAD_SIZE (BPE_NUM_WORDS * sizeof(VasEBoot_uint64_t)) #define BPE_IS_PAYLOADWORD(bp, wp) \ ((wp) != &(bp)->blk_prop && (wp) != &(bp)->blk_birth) @@ -325,4 +325,4 @@ typedef enum bp_embedded_type { #define BP_SPRINTF_LEN 320 -#endif /* ! GRUB_ZFS_SPA_HEADER */ +#endif /* ! VasEBoot_ZFS_SPA_HEADER */ diff --git a/include/VasEBoot/zfs/uberblock_impl.h b/include/VasEBoot/zfs/uberblock_impl.h index 1bf7f2b07..b5d137e2b 100644 --- a/include/VasEBoot/zfs/uberblock_impl.h +++ b/include/VasEBoot/zfs/uberblock_impl.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -37,11 +37,11 @@ #define UBERBLOCK_SHIFT 10 /* up to 1K */ typedef struct uberblock { - grub_uint64_t ub_magic; /* UBERBLOCK_MAGIC */ - grub_uint64_t ub_version; /* ZFS_VERSION */ - grub_uint64_t ub_txg; /* txg of last sync */ - grub_uint64_t ub_guid_sum; /* sum of all vdev guids */ - grub_uint64_t ub_timestamp; /* UTC time of last sync */ + VasEBoot_uint64_t ub_magic; /* UBERBLOCK_MAGIC */ + VasEBoot_uint64_t ub_version; /* ZFS_VERSION */ + VasEBoot_uint64_t ub_txg; /* txg of last sync */ + VasEBoot_uint64_t ub_guid_sum; /* sum of all vdev guids */ + VasEBoot_uint64_t ub_timestamp; /* UTC time of last sync */ blkptr_t ub_rootbp; /* MOS objset_phys_t */ } uberblock_t; diff --git a/include/VasEBoot/zfs/vdev_impl.h b/include/VasEBoot/zfs/vdev_impl.h index 9b5f0a7a8..8c4b1f284 100644 --- a/include/VasEBoot/zfs/vdev_impl.h +++ b/include/VasEBoot/zfs/vdev_impl.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -33,11 +33,11 @@ #define VDEV_BOOT_VERSION 1 /* version number */ typedef struct vdev_boot_header { - grub_uint64_t vb_magic; /* VDEV_BOOT_MAGIC */ - grub_uint64_t vb_version; /* VDEV_BOOT_VERSION */ - grub_uint64_t vb_offset; /* start offset (bytes) */ - grub_uint64_t vb_size; /* size (bytes) */ - char vb_pad[VDEV_BOOT_HEADER_SIZE - 4 * sizeof (grub_uint64_t)]; + VasEBoot_uint64_t vb_magic; /* VDEV_BOOT_MAGIC */ + VasEBoot_uint64_t vb_version; /* VDEV_BOOT_VERSION */ + VasEBoot_uint64_t vb_offset; /* start offset (bytes) */ + VasEBoot_uint64_t vb_size; /* size (bytes) */ + char vb_pad[VDEV_BOOT_HEADER_SIZE - 4 * sizeof (VasEBoot_uint64_t)]; } vdev_boot_header_t; typedef struct vdev_phys { diff --git a/include/VasEBoot/zfs/zap_impl.h b/include/VasEBoot/zfs/zap_impl.h index 0e985d9f9..afcf55feb 100644 --- a/include/VasEBoot/zfs/zap_impl.h +++ b/include/VasEBoot/zfs/zap_impl.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. @@ -30,16 +30,16 @@ #define MZAP_NAME_LEN (MZAP_ENT_LEN - 8 - 4 - 2) typedef struct mzap_ent_phys { - grub_uint64_t mze_value; - grub_uint32_t mze_cd; - grub_uint16_t mze_pad; /* in case we want to chain them someday */ + VasEBoot_uint64_t mze_value; + VasEBoot_uint32_t mze_cd; + VasEBoot_uint16_t mze_pad; /* in case we want to chain them someday */ char mze_name[MZAP_NAME_LEN]; } mzap_ent_phys_t; typedef struct mzap_phys { - grub_uint64_t mz_block_type; /* ZBT_MICRO */ - grub_uint64_t mz_salt; - grub_uint64_t mz_pad[6]; + VasEBoot_uint64_t mz_block_type; /* ZBT_MICRO */ + VasEBoot_uint64_t mz_salt; + VasEBoot_uint64_t mz_pad[6]; mzap_ent_phys_t mz_chunk[1]; /* actually variable size depending on block size */ } mzap_phys_t; @@ -73,7 +73,7 @@ typedef struct mzap_phys { * word number (1<zap_f.zap_phys) \ + ((VasEBoot_uint64_t *)(zap)->zap_f.zap_phys) \ [(idx) + (1<. + * along with VasEBoot. If not, see . */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. @@ -47,18 +47,18 @@ typedef enum zap_chunk_type { */ typedef struct zap_leaf_phys { struct zap_leaf_header { - grub_uint64_t lh_block_type; /* ZBT_LEAF */ - grub_uint64_t lh_pad1; - grub_uint64_t lh_prefix; /* hash prefix of this leaf */ - grub_uint32_t lh_magic; /* ZAP_LEAF_MAGIC */ - grub_uint16_t lh_nfree; /* number free chunks */ - grub_uint16_t lh_nentries; /* number of entries */ - grub_uint16_t lh_prefix_len; /* num bits used to id this */ + VasEBoot_uint64_t lh_block_type; /* ZBT_LEAF */ + VasEBoot_uint64_t lh_pad1; + VasEBoot_uint64_t lh_prefix; /* hash prefix of this leaf */ + VasEBoot_uint32_t lh_magic; /* ZAP_LEAF_MAGIC */ + VasEBoot_uint16_t lh_nfree; /* number free chunks */ + VasEBoot_uint16_t lh_nentries; /* number of entries */ + VasEBoot_uint16_t lh_prefix_len; /* num bits used to id this */ /* above is accessable to zap, below is zap_leaf private */ - grub_uint16_t lh_freelist; /* chunk head of free list */ - grub_uint8_t lh_pad2[12]; + VasEBoot_uint16_t lh_freelist; /* chunk head of free list */ + VasEBoot_uint8_t lh_pad2[12]; } l_hdr; /* 2 24-byte chunks */ /* @@ -69,35 +69,35 @@ typedef struct zap_leaf_phys { * with the ZAP_LEAF_CHUNK() macro. */ - grub_uint16_t l_hash[0]; - grub_properly_aligned_t l_entries[0]; + VasEBoot_uint16_t l_hash[0]; + VasEBoot_properly_aligned_t l_entries[0]; } zap_leaf_phys_t; typedef union zap_leaf_chunk { struct zap_leaf_entry { - grub_uint8_t le_type; /* always ZAP_CHUNK_ENTRY */ - grub_uint8_t le_int_size; /* size of ints */ - grub_uint16_t le_next; /* next entry in hash chain */ - grub_uint16_t le_name_chunk; /* first chunk of the name */ - grub_uint16_t le_name_length; /* bytes in name, incl null */ - grub_uint16_t le_value_chunk; /* first chunk of the value */ - grub_uint16_t le_value_length; /* value length in ints */ - grub_uint32_t le_cd; /* collision differentiator */ - grub_uint64_t le_hash; /* hash value of the name */ + VasEBoot_uint8_t le_type; /* always ZAP_CHUNK_ENTRY */ + VasEBoot_uint8_t le_int_size; /* size of ints */ + VasEBoot_uint16_t le_next; /* next entry in hash chain */ + VasEBoot_uint16_t le_name_chunk; /* first chunk of the name */ + VasEBoot_uint16_t le_name_length; /* bytes in name, incl null */ + VasEBoot_uint16_t le_value_chunk; /* first chunk of the value */ + VasEBoot_uint16_t le_value_length; /* value length in ints */ + VasEBoot_uint32_t le_cd; /* collision differentiator */ + VasEBoot_uint64_t le_hash; /* hash value of the name */ } l_entry; struct zap_leaf_array { - grub_uint8_t la_type; /* always ZAP_CHUNK_ARRAY */ + VasEBoot_uint8_t la_type; /* always ZAP_CHUNK_ARRAY */ union { - grub_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES]; - grub_uint64_t la_array64; - } GRUB_PACKED; - grub_uint16_t la_next; /* next blk or CHAIN_END */ + VasEBoot_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES]; + VasEBoot_uint64_t la_array64; + } VasEBoot_PACKED; + VasEBoot_uint16_t la_next; /* next blk or CHAIN_END */ } l_array; struct zap_leaf_free { - grub_uint8_t lf_type; /* always ZAP_CHUNK_FREE */ - grub_uint8_t lf_pad[ZAP_LEAF_ARRAY_BYTES]; - grub_uint16_t lf_next; /* next in free list, or CHAIN_END */ + VasEBoot_uint8_t lf_type; /* always ZAP_CHUNK_FREE */ + VasEBoot_uint8_t lf_pad[ZAP_LEAF_ARRAY_BYTES]; + VasEBoot_uint16_t lf_next; /* next in free list, or CHAIN_END */ } l_free; } zap_leaf_chunk_t; diff --git a/include/VasEBoot/zfs/zfs.h b/include/VasEBoot/zfs/zfs.h index 4ee513887..3741324a5 100644 --- a/include/VasEBoot/zfs/zfs.h +++ b/include/VasEBoot/zfs/zfs.h @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2009 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. */ -#ifndef GRUB_ZFS_HEADER -#define GRUB_ZFS_HEADER 1 +#ifndef VasEBoot_ZFS_HEADER +#define VasEBoot_ZFS_HEADER 1 -#include -#include -#include +#include +#include +#include -typedef enum grub_zfs_endian +typedef enum VasEBoot_zfs_endian { - GRUB_ZFS_UNKNOWN_ENDIAN = -2, - GRUB_ZFS_LITTLE_ENDIAN = -1, - GRUB_ZFS_BIG_ENDIAN = 0 - } grub_zfs_endian_t; + VasEBoot_ZFS_UNKNOWN_ENDIAN = -2, + VasEBoot_ZFS_LITTLE_ENDIAN = -1, + VasEBoot_ZFS_BIG_ENDIAN = 0 + } VasEBoot_zfs_endian_t; /* * On-disk version number. @@ -119,40 +119,40 @@ typedef enum pool_state { POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */ } pool_state_t; -struct grub_zfs_data; +struct VasEBoot_zfs_data; -grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist); -grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename, - grub_uint64_t *mdnobj); +VasEBoot_err_t VasEBoot_zfs_fetch_nvlist (VasEBoot_device_t dev, char **nvlist); +VasEBoot_err_t VasEBoot_zfs_getmdnobj (VasEBoot_device_t dev, const char *fsfilename, + VasEBoot_uint64_t *mdnobj); -char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name); -char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name); -int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name, - grub_uint64_t *out); -char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, +char *VasEBoot_zfs_nvlist_lookup_string (const char *nvlist, const char *name); +char *VasEBoot_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name); +int VasEBoot_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name, + VasEBoot_uint64_t *out); +char *VasEBoot_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, - grub_size_t array_index); -int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist, + VasEBoot_size_t array_index); +int VasEBoot_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist, const char *name); -grub_err_t -grub_zfs_add_key (grub_uint8_t *key_in, - grub_size_t keylen, +VasEBoot_err_t +VasEBoot_zfs_add_key (VasEBoot_uint8_t *key_in, + VasEBoot_size_t keylen, int passphrase); -extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher, - grub_uint64_t algo, +extern VasEBoot_err_t (*VasEBoot_zfs_decrypt) (VasEBoot_crypto_cipher_handle_t cipher, + VasEBoot_uint64_t algo, void *nonce, - char *buf, grub_size_t size, - const grub_uint32_t *expected_mac, - grub_zfs_endian_t endian); + char *buf, VasEBoot_size_t size, + const VasEBoot_uint32_t *expected_mac, + VasEBoot_zfs_endian_t endian); -struct grub_zfs_key; +struct VasEBoot_zfs_key; -extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key, - grub_size_t keysize, - grub_uint64_t salt, - grub_uint64_t algo); +extern VasEBoot_crypto_cipher_handle_t (*VasEBoot_zfs_load_key) (const struct VasEBoot_zfs_key *key, + VasEBoot_size_t keysize, + VasEBoot_uint64_t salt, + VasEBoot_uint64_t algo); -#endif /* ! GRUB_ZFS_HEADER */ +#endif /* ! VasEBoot_ZFS_HEADER */ diff --git a/include/VasEBoot/zfs/zfs_acl.h b/include/VasEBoot/zfs/zfs_acl.h index 277738279..b369c4000 100644 --- a/include/VasEBoot/zfs/zfs_acl.h +++ b/include/VasEBoot/zfs/zfs_acl.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. @@ -29,30 +29,30 @@ typedef unsigned int uid_t; /* UID type */ #endif /* _UID_T */ typedef struct zfs_oldace { - grub_uint32_t z_fuid; /* "who" */ - grub_uint32_t z_access_mask; /* access mask */ - grub_uint16_t z_flags; /* flags, i.e inheritance */ - grub_uint16_t z_type; /* type of entry allow/deny */ + VasEBoot_uint32_t z_fuid; /* "who" */ + VasEBoot_uint32_t z_access_mask; /* access mask */ + VasEBoot_uint16_t z_flags; /* flags, i.e inheritance */ + VasEBoot_uint16_t z_type; /* type of entry allow/deny */ } zfs_oldace_t; #define ACE_SLOT_CNT 6 typedef struct zfs_znode_acl_v0 { - grub_uint64_t z_acl_extern_obj; /* ext acl pieces */ - grub_uint32_t z_acl_count; /* Number of ACEs */ - grub_uint16_t z_acl_version; /* acl version */ - grub_uint16_t z_acl_pad; /* pad */ + VasEBoot_uint64_t z_acl_extern_obj; /* ext acl pieces */ + VasEBoot_uint32_t z_acl_count; /* Number of ACEs */ + VasEBoot_uint16_t z_acl_version; /* acl version */ + VasEBoot_uint16_t z_acl_pad; /* pad */ zfs_oldace_t z_ace_data[ACE_SLOT_CNT]; /* 6 standard ACEs */ } zfs_znode_acl_v0_t; #define ZFS_ACE_SPACE (sizeof (zfs_oldace_t) * ACE_SLOT_CNT) typedef struct zfs_znode_acl { - grub_uint64_t z_acl_extern_obj; /* ext acl pieces */ - grub_uint32_t z_acl_size; /* Number of bytes in ACL */ - grub_uint16_t z_acl_version; /* acl version */ - grub_uint16_t z_acl_count; /* ace count */ - grub_uint8_t z_ace_data[ZFS_ACE_SPACE]; /* space for embedded ACEs */ + VasEBoot_uint64_t z_acl_extern_obj; /* ext acl pieces */ + VasEBoot_uint32_t z_acl_size; /* Number of bytes in ACL */ + VasEBoot_uint16_t z_acl_version; /* acl version */ + VasEBoot_uint16_t z_acl_count; /* ace count */ + VasEBoot_uint8_t z_ace_data[ZFS_ACE_SPACE]; /* space for embedded ACEs */ } zfs_znode_acl_t; diff --git a/include/VasEBoot/zfs/zfs_znode.h b/include/VasEBoot/zfs/zfs_znode.h index efd6d10a6..9558c470d 100644 --- a/include/VasEBoot/zfs/zfs_znode.h +++ b/include/VasEBoot/zfs/zfs_znode.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -23,7 +23,7 @@ #ifndef _SYS_FS_ZFS_ZNODE_H #define _SYS_FS_ZFS_ZNODE_H -#include +#include #define MASTER_NODE_OBJ 1 #define ZFS_ROOT_OBJ "ROOT" @@ -40,21 +40,21 @@ * are also stored in the bonus buffer. */ typedef struct znode_phys { - grub_uint64_t zp_atime[2]; /* 0 - last file access time */ - grub_uint64_t zp_mtime[2]; /* 16 - last file modification time */ - grub_uint64_t zp_ctime[2]; /* 32 - last file change time */ - grub_uint64_t zp_crtime[2]; /* 48 - creation time */ - grub_uint64_t zp_gen; /* 64 - generation (txg of creation) */ - grub_uint64_t zp_mode; /* 72 - file mode bits */ - grub_uint64_t zp_size; /* 80 - size of file */ - grub_uint64_t zp_parent; /* 88 - directory parent (`..') */ - grub_uint64_t zp_links; /* 96 - number of links to file */ - grub_uint64_t zp_xattr; /* 104 - DMU object for xattrs */ - grub_uint64_t zp_rdev; /* 112 - dev_t for VBLK & VCHR files */ - grub_uint64_t zp_flags; /* 120 - persistent flags */ - grub_uint64_t zp_uid; /* 128 - file owner */ - grub_uint64_t zp_gid; /* 136 - owning group */ - grub_uint64_t zp_pad[4]; /* 144 - future */ + VasEBoot_uint64_t zp_atime[2]; /* 0 - last file access time */ + VasEBoot_uint64_t zp_mtime[2]; /* 16 - last file modification time */ + VasEBoot_uint64_t zp_ctime[2]; /* 32 - last file change time */ + VasEBoot_uint64_t zp_crtime[2]; /* 48 - creation time */ + VasEBoot_uint64_t zp_gen; /* 64 - generation (txg of creation) */ + VasEBoot_uint64_t zp_mode; /* 72 - file mode bits */ + VasEBoot_uint64_t zp_size; /* 80 - size of file */ + VasEBoot_uint64_t zp_parent; /* 88 - directory parent (`..') */ + VasEBoot_uint64_t zp_links; /* 96 - number of links to file */ + VasEBoot_uint64_t zp_xattr; /* 104 - DMU object for xattrs */ + VasEBoot_uint64_t zp_rdev; /* 112 - dev_t for VBLK & VCHR files */ + VasEBoot_uint64_t zp_flags; /* 120 - persistent flags */ + VasEBoot_uint64_t zp_uid; /* 128 - file owner */ + VasEBoot_uint64_t zp_gid; /* 136 - owning group */ + VasEBoot_uint64_t zp_pad[4]; /* 144 - future */ zfs_znode_acl_t zp_acl; /* 176 - 263 ACL */ /* * Data may pad out any remaining bytes in the znode buffer, eg: diff --git a/include/VasEBoot/zfs/zil.h b/include/VasEBoot/zfs/zil.h index 45d16f402..d7f71ada1 100644 --- a/include/VasEBoot/zfs/zil.h +++ b/include/VasEBoot/zfs/zil.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. @@ -40,12 +40,12 @@ * the log. All fields are 64 bit to easily handle cross architectures. */ typedef struct zil_header { - grub_uint64_t zh_claim_txg; /* txg in which log blocks were claimed */ - grub_uint64_t zh_replay_seq; /* highest replayed sequence number */ + VasEBoot_uint64_t zh_claim_txg; /* txg in which log blocks were claimed */ + VasEBoot_uint64_t zh_replay_seq; /* highest replayed sequence number */ blkptr_t zh_log; /* log chain */ - grub_uint64_t zh_claim_seq; /* highest claimed sequence number */ - grub_uint64_t zh_flags; /* header flags */ - grub_uint64_t zh_pad[4]; + VasEBoot_uint64_t zh_claim_seq; /* highest claimed sequence number */ + VasEBoot_uint64_t zh_flags; /* header flags */ + VasEBoot_uint64_t zh_pad[4]; } zil_header_t; /* diff --git a/include/VasEBoot/zfs/zio.h b/include/VasEBoot/zfs/zio.h index 19ce136bb..db0efd748 100644 --- a/include/VasEBoot/zfs/zio.h +++ b/include/VasEBoot/zfs/zio.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -23,14 +23,14 @@ #ifndef _ZIO_H #define _ZIO_H -#include +#include #define ZEC_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */ typedef struct zio_eck { - grub_uint64_t zec_magic; /* for validation, endianness */ + VasEBoot_uint64_t zec_magic; /* for validation, endianness */ zio_cksum_t zec_cksum; /* 256-bit checksum */ -} GRUB_PACKED zio_eck_t; +} VasEBoot_PACKED zio_eck_t; /* * Gang block headers are self-checksumming and contain an array @@ -42,7 +42,7 @@ typedef struct zio_eck { #define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \ sizeof (zio_eck_t) - \ (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\ - sizeof (grub_uint64_t)) + sizeof (VasEBoot_uint64_t)) #define ZIO_GET_IOSIZE(zio) \ (BP_IS_GANG((zio)->io_bp) ? \ @@ -50,7 +50,7 @@ typedef struct zio_eck { typedef struct zio_gbh { blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS]; - grub_uint64_t zg_filler[SPA_GBH_FILLER]; + VasEBoot_uint64_t zg_filler[SPA_GBH_FILLER]; zio_eck_t zg_tail; } zio_gbh_phys_t; diff --git a/include/VasEBoot/zfs/zio_checksum.h b/include/VasEBoot/zfs/zio_checksum.h index e03c85a83..17b239ccd 100644 --- a/include/VasEBoot/zfs/zio_checksum.h +++ b/include/VasEBoot/zfs/zio_checksum.h @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * - * GRUB is free software; you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -23,11 +23,11 @@ #ifndef _SYS_ZIO_CHECKSUM_H #define _SYS_ZIO_CHECKSUM_H -extern void zio_checksum_SHA256 (const void *, grub_uint64_t, - grub_zfs_endian_t endian, zio_cksum_t *); -extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian, +extern void zio_checksum_SHA256 (const void *, VasEBoot_uint64_t, + VasEBoot_zfs_endian_t endian, zio_cksum_t *); +extern void fletcher_2 (const void *, VasEBoot_uint64_t, VasEBoot_zfs_endian_t endian, zio_cksum_t *); -extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian, +extern void fletcher_4 (const void *, VasEBoot_uint64_t, VasEBoot_zfs_endian_t endian, zio_cksum_t *); #endif /* _SYS_ZIO_CHECKSUM_H */ diff --git a/include/multiboot.h b/include/multiboot.h index 7e5ac69ba..5cef18618 100644 --- a/include/multiboot.h +++ b/include/multiboot.h @@ -238,7 +238,7 @@ struct multiboot_mmap_entry #define MULTIBOOT_MEMORY_NVS 4 #define MULTIBOOT_MEMORY_BADRAM 5 multiboot_uint32_t type; -} GRUB_PACKED; +} VasEBoot_PACKED; typedef struct multiboot_mmap_entry multiboot_memory_map_t; struct multiboot_mod_list @@ -258,15 +258,15 @@ typedef struct multiboot_mod_list multiboot_module_t; /* APM BIOS info. */ struct multiboot_apm_info { - grub_uint16_t version; - grub_uint16_t cseg; - grub_uint32_t offset; - grub_uint16_t cseg_16; - grub_uint16_t dseg; - grub_uint16_t flags; - grub_uint16_t cseg_len; - grub_uint16_t cseg_16_len; - grub_uint16_t dseg_len; + VasEBoot_uint16_t version; + VasEBoot_uint16_t cseg; + VasEBoot_uint32_t offset; + VasEBoot_uint16_t cseg_16; + VasEBoot_uint16_t dseg; + VasEBoot_uint16_t flags; + VasEBoot_uint16_t cseg_len; + VasEBoot_uint16_t cseg_16_len; + VasEBoot_uint16_t dseg_len; }; #endif /* ! ASM_FILE */ diff --git a/linguas.sh b/linguas.sh index b95ad4f7d..5c4267cea 100755 --- a/linguas.sh +++ b/linguas.sh @@ -1,6 +1,6 @@ #!/bin/sh -rsync -Lrtvz translationproject.org::tp/latest/grub/ po +rsync -Lrtvz translationproject.org::tp/latest/VasEBoot/ po autogenerated="en@quot en@hebrew de@hebrew en@cyrillic en@greek en@arabic en@piglatin de_CH" diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 408918440..51fec5738 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# 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 +# gnulib-tool --import --dir=. --lib=libgnu --source-base=VasEBoot-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 # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -42,7 +42,7 @@ gl_MODULES([ regex ]) gl_AVOID([]) -gl_SOURCE_BASE([grub-core/gnulib]) +gl_SOURCE_BASE([VasEBoot-core/gnulib]) gl_M4_BASE([m4]) gl_PO_BASE([]) gl_DOC_BASE([doc]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 7a19f60d8..e4d49c4a5 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -139,7 +139,7 @@ AC_DEFUN([gl_INIT], m4_pushdef([gl_LIBSOURCES_LIST], []) m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON - gl_source_base='grub-core/gnulib' + gl_source_base='VasEBoot-core/gnulib' gl_FUNC_ALLOCA gl_ARGP m4_ifdef([AM_XGETTEXT_OPTION], @@ -483,7 +483,7 @@ AC_DEFUN([gl_REPLACE_FUNCS], [ AC_DEFUN([gl_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ - m4_define([gl_LIBSOURCES_DIR], [grub-core/gnulib]) + m4_define([gl_LIBSOURCES_DIR], [VasEBoot-core/gnulib]) m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 3619458e8..6bca913a7 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -71,7 +71,7 @@ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) \ $(DISTFILES.common.extra3) $(DISTFILES.common.extra4) $(DISTFILES.common.extra5) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in POTFILES-shell.in \ $(POFILES) $(GMOFILES) \ -$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) $(DISTFILES.extra4) $(DISTFILES.extra5) grub.d.sed README +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) $(DISTFILES.extra4) $(DISTFILES.extra5) VasEBoot.d.sed README POTFILES = \ @@ -190,7 +190,7 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell ;; \ esac ; \ test ! -f $(DOMAIN).po || { \ - sed -f grub.d.sed < $(DOMAIN).po > $(DOMAIN).1po && \ + sed -f VasEBoot.d.sed < $(DOMAIN).po > $(DOMAIN).1po && \ mv $(DOMAIN).1po $(DOMAIN).po; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ diff --git a/po/Makevars b/po/Makevars index 44857b1b8..f6b594045 100644 --- a/po/Makevars +++ b/po/Makevars @@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Free Software Foundation, Inc. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. -MSGID_BUGS_ADDRESS = bug-grub@gnu.org +MSGID_BUGS_ADDRESS = bug-VasEBoot@gnu.org # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. diff --git a/po/README b/po/README index aaf829267..825d4090a 100644 --- a/po/README +++ b/po/README @@ -1,5 +1,5 @@ -If you checked out this source tree directly from GRUB Git, you might be +If you checked out this source tree directly from VasEBoot Git, you might be wondering where are the POT and PO files. Here are some instructions that will hopefully clarify the situation. @@ -8,17 +8,17 @@ that will hopefully clarify the situation. ./linguas.sh - GRUB's build system will automatically detect those and include them + VasEBoot's build system will automatically detect those and include them in your install. - If you're a translator and want to add a new translation or improve an existing one, get in touch with the Translation Project - (http://translationproject.org/). The GRUB project doesn't interact + (http://translationproject.org/). The VasEBoot project doesn't interact with translators directly (but we dearly appreciate your work!). - If you're a developer adding/removing/modifying translatable strings, you can check that these turn into a sane POT file by using the - `po/grub.pot' make rule. + `po/VasEBoot.pot' make rule. - - If you're the maintainer of GNU GRUB preparing a new release, don't + - If you're the maintainer of GNU VasEBoot preparing a new release, don't forget to include the latest PO files in your source tarball! diff --git a/po/Rules-windowsdir b/po/Rules-windowsdir index fe47b1060..be1f41597 100644 --- a/po/Rules-windowsdir +++ b/po/Rules-windowsdir @@ -7,5 +7,5 @@ windowsdir: $(GMOFILES) test -d "$(windowsdir)/locale" || mkdir "$(windowsdir)/locale" for x in $(CATALOGS); do \ test -d "$(windowsdir)/locale/$${x%.gmo}" || mkdir "$(windowsdir)/locale/$${x%.gmo}"; \ - cp -fp "$(srcdir)/$$x" "$(windowsdir)/locale/$${x%.gmo}/grub.mo"; \ + cp -fp "$(srcdir)/$$x" "$(windowsdir)/locale/$${x%.gmo}/VasEBoot.mo"; \ done diff --git a/po/VasEBoot.d.sed b/po/VasEBoot.d.sed index 9fd729474..df3cab9b0 100644 --- a/po/VasEBoot.d.sed +++ b/po/VasEBoot.d.sed @@ -1,2 +1,2 @@ -/^#: util\/grub\.d\//a\ +/^#: util\/VasEBoot\.d\//a\ #, c-format diff --git a/po/exclude.pot b/po/exclude.pot index 0a9b215ea..53ca74a59 100644 --- a/po/exclude.pot +++ b/po/exclude.pot @@ -16,97 +16,97 @@ msgstr "" msgid "GPLv3+" msgstr "" -#: grub-core/bus/usb/serial/common.c:62 +#: VasEBoot-core/bus/usb/serial/common.c:62 #, c-format msgid "usb%d" msgstr "" -#: grub-core/commands/acpi.c:373 +#: VasEBoot-core/commands/acpi.c:373 msgid "RSDT" msgstr "" -#: grub-core/commands/acpi.c:427 +#: VasEBoot-core/commands/acpi.c:427 msgid "XSDT" msgstr "" -#: grub-core/commands/acpi.c:539 +#: VasEBoot-core/commands/acpi.c:539 msgid "facp" msgstr "" -#: grub-core/commands/acpi.c:558 grub-core/commands/acpi.c:559 +#: VasEBoot-core/commands/acpi.c:558 VasEBoot-core/commands/acpi.c:559 msgid "dsdt" msgstr "" -#: grub-core/commands/acpi.c:678 grub-core/commands/acpihalt.c:371 +#: VasEBoot-core/commands/acpi.c:678 VasEBoot-core/commands/acpihalt.c:371 msgid "DSDT" msgstr "" -#: grub-core/commands/acpihalt.c:218 +#: VasEBoot-core/commands/acpihalt.c:218 msgid "_S5_" msgstr "" -#: grub-core/commands/acpihalt.c:218 +#: VasEBoot-core/commands/acpihalt.c:218 msgid "\\_S5_" msgstr "" -#: grub-core/commands/acpihalt.c:302 grub-core/kern/emu/hostfs.c:112 -#: grub-core/lib/reed_solomon.c:428 grub-core/lib/reed_solomon.c:445 -#: util/grub-editenv.c:151 util/grub-editenv.c:156 util/grub-fstest.c:309 -#: util/grub-fstest.c:561 util/grub-mkpasswd-pbkdf2.c:176 -#: util/grub-mount.c:477 util/grub-setup.c:734 util/misc.c:111 util/misc.c:135 +#: VasEBoot-core/commands/acpihalt.c:302 VasEBoot-core/kern/emu/hostfs.c:112 +#: VasEBoot-core/lib/reed_solomon.c:428 VasEBoot-core/lib/reed_solomon.c:445 +#: util/VasEBoot-editenv.c:151 util/VasEBoot-editenv.c:156 util/VasEBoot-fstest.c:309 +#: util/VasEBoot-fstest.c:561 util/VasEBoot-mkpasswd-pbkdf2.c:176 +#: util/VasEBoot-mount.c:477 util/VasEBoot-setup.c:734 util/misc.c:111 util/misc.c:135 msgid "rb" msgstr "" -#: grub-core/commands/acpihalt.c:359 include/grub/acpi.h:61 +#: VasEBoot-core/commands/acpihalt.c:359 include/VasEBoot/acpi.h:61 msgid "FACP" msgstr "" -#: grub-core/commands/acpihalt.c:376 +#: VasEBoot-core/commands/acpihalt.c:376 msgid "SSDT" msgstr "" -#: grub-core/commands/arc/lsdev.c:33 grub-core/commands/cacheinfo.c:43 -#: grub-core/commands/xnu_uuid.c:90 grub-core/font/font_cmd.c:56 -#: grub-core/fs/zfs/zfsinfo.c:402 grub-core/gettext/gettext.c:492 -#: grub-core/hello/hello.c:36 grub-core/lib/arg.c:147 -#: grub-core/lib/hexdump.c:63 grub-core/loader/ia64/efi/linux.c:123 -#: grub-core/loader/ia64/efi/linux.c:130 grub-core/net/bootp.c:381 -#: grub-core/net/bootp.c:417 grub-core/net/dns.c:628 grub-core/net/dns.c:644 -#: grub-core/net/net.c:1086 util/grub-mkfont.c:770 util/grub-mkimage.c:1967 -#: util/grub-mkrelpath.c:99 util/ieee1275/grub-ofpathname.c:46 -#: util/ieee1275/grub-ofpathname.c:51 +#: VasEBoot-core/commands/arc/lsdev.c:33 VasEBoot-core/commands/cacheinfo.c:43 +#: VasEBoot-core/commands/xnu_uuid.c:90 VasEBoot-core/font/font_cmd.c:56 +#: VasEBoot-core/fs/zfs/zfsinfo.c:402 VasEBoot-core/gettext/gettext.c:492 +#: VasEBoot-core/hello/hello.c:36 VasEBoot-core/lib/arg.c:147 +#: VasEBoot-core/lib/hexdump.c:63 VasEBoot-core/loader/ia64/efi/linux.c:123 +#: VasEBoot-core/loader/ia64/efi/linux.c:130 VasEBoot-core/net/bootp.c:381 +#: VasEBoot-core/net/bootp.c:417 VasEBoot-core/net/dns.c:628 VasEBoot-core/net/dns.c:644 +#: VasEBoot-core/net/net.c:1086 util/VasEBoot-mkfont.c:770 util/VasEBoot-mkimage.c:1967 +#: util/VasEBoot-mkrelpath.c:99 util/ieee1275/VasEBoot-ofpathname.c:46 +#: util/ieee1275/VasEBoot-ofpathname.c:51 #, c-format msgid "%s\n" msgstr "" -#: grub-core/commands/blocklist.c:46 grub-core/commands/minicmd.c:162 -#: grub-core/disk/geli.c:427 grub-core/disk/luks.c:334 -#: grub-core/disk/lvm.c:496 grub-core/normal/completion.c:172 +#: VasEBoot-core/commands/blocklist.c:46 VasEBoot-core/commands/minicmd.c:162 +#: VasEBoot-core/disk/geli.c:427 VasEBoot-core/disk/luks.c:334 +#: VasEBoot-core/disk/lvm.c:496 VasEBoot-core/normal/completion.c:172 msgid "," msgstr "" -#: grub-core/commands/blocklist.c:48 +#: VasEBoot-core/commands/blocklist.c:48 #, c-format msgid "%llu" msgstr "" -#: grub-core/commands/blocklist.c:50 +#: VasEBoot-core/commands/blocklist.c:50 #, c-format msgid "+%u" msgstr "" -#: grub-core/commands/blocklist.c:52 +#: VasEBoot-core/commands/blocklist.c:52 #, c-format msgid "[%u-%u]" msgstr "" -#: grub-core/commands/cacheinfo.c:37 +#: VasEBoot-core/commands/cacheinfo.c:37 #, c-format msgid "(%lu.%lu%%)\n" msgstr "" -#: grub-core/commands/cat.c:66 grub-core/commands/minicmd.c:59 -#: grub-core/commands/read.c:52 grub-core/normal/auth.c:188 +#: VasEBoot-core/commands/cat.c:66 VasEBoot-core/commands/minicmd.c:59 +#: VasEBoot-core/commands/read.c:52 VasEBoot-core/normal/auth.c:188 #: util/spkmodem-recv.c:101 #, c-format msgid "%c" @@ -115,646 +115,646 @@ msgstr "" msgid "\n" msgstr "" -#: grub-core/commands/cat.c:75 grub-core/commands/minicmd.c:63 +#: VasEBoot-core/commands/cat.c:75 VasEBoot-core/commands/minicmd.c:63 #, c-format msgid "<%x>" msgstr "" -#: grub-core/commands/configfile.c:38 +#: VasEBoot-core/commands/configfile.c:38 msgid "extract_entries_" msgstr "" -#: grub-core/commands/echo.c:116 grub-core/commands/parttool.c:131 -#: grub-core/commands/videoinfo.c:54 grub-core/disk/cryptodisk.c:1029 -#: grub-core/fs/zfs/zfsinfo.c:38 grub-core/kern/emu/misc.c:74 -#: grub-core/kern/emu/misc.c:90 grub-core/kern/emu/misc.c:105 -#: grub-core/lib/arg.c:145 grub-core/normal/cmdline.c:367 -#: grub-core/normal/cmdline.c:474 grub-core/normal/completion.c:137 -#: grub-core/normal/completion.c:348 grub-core/normal/completion.c:358 -#: grub-core/normal/completion.c:364 grub-core/normal/completion.c:366 -#: grub-core/normal/completion.c:380 grub-core/normal/completion.c:451 -#: grub-core/normal/misc.c:97 grub-core/normal/misc.c:102 -#: grub-core/normal/misc.c:130 grub-core/normal/misc.c:145 -#: grub-core/script/execute.c:309 util/grub-probe.c:515 util/grub-probe.c:524 -#: util/grub-probe.c:533 +#: VasEBoot-core/commands/echo.c:116 VasEBoot-core/commands/parttool.c:131 +#: VasEBoot-core/commands/videoinfo.c:54 VasEBoot-core/disk/cryptodisk.c:1029 +#: VasEBoot-core/fs/zfs/zfsinfo.c:38 VasEBoot-core/kern/emu/misc.c:74 +#: VasEBoot-core/kern/emu/misc.c:90 VasEBoot-core/kern/emu/misc.c:105 +#: VasEBoot-core/lib/arg.c:145 VasEBoot-core/normal/cmdline.c:367 +#: VasEBoot-core/normal/cmdline.c:474 VasEBoot-core/normal/completion.c:137 +#: VasEBoot-core/normal/completion.c:348 VasEBoot-core/normal/completion.c:358 +#: VasEBoot-core/normal/completion.c:364 VasEBoot-core/normal/completion.c:366 +#: VasEBoot-core/normal/completion.c:380 VasEBoot-core/normal/completion.c:451 +#: VasEBoot-core/normal/misc.c:97 VasEBoot-core/normal/misc.c:102 +#: VasEBoot-core/normal/misc.c:130 VasEBoot-core/normal/misc.c:145 +#: VasEBoot-core/script/execute.c:309 util/VasEBoot-probe.c:515 util/VasEBoot-probe.c:524 +#: util/VasEBoot-probe.c:533 #, c-format msgid " " msgstr "" -#: grub-core/commands/efi/efifwsetup.c:41 -#: grub-core/commands/efi/efifwsetup.c:47 +#: VasEBoot-core/commands/efi/efifwsetup.c:41 +#: VasEBoot-core/commands/efi/efifwsetup.c:47 msgid "OsIndications" msgstr "" -#: grub-core/commands/efi/efifwsetup.c:66 +#: VasEBoot-core/commands/efi/efifwsetup.c:66 msgid "OsIndicationsSupported" msgstr "" -#: grub-core/commands/efi/fixvideo.c:39 +#: VasEBoot-core/commands/efi/fixvideo.c:39 msgid "Intel 945GM" msgstr "" -#: grub-core/commands/efi/fixvideo.c:40 +#: VasEBoot-core/commands/efi/fixvideo.c:40 msgid "Intel 965GM" msgstr "" -#: grub-core/commands/hashsum.c:46 grub-core/commands/verify.c:127 +#: VasEBoot-core/commands/hashsum.c:46 VasEBoot-core/commands/verify.c:127 msgid "sha1" msgstr "" -#: grub-core/commands/hashsum.c:47 grub-core/commands/verify.c:126 +#: VasEBoot-core/commands/hashsum.c:47 VasEBoot-core/commands/verify.c:126 msgid "md5" msgstr "" -#: grub-core/commands/hashsum.c:124 grub-core/commands/ls.c:125 -#: util/grub-mount.c:304 util/misc.c:82 +#: VasEBoot-core/commands/hashsum.c:124 VasEBoot-core/commands/ls.c:125 +#: util/VasEBoot-mount.c:304 util/misc.c:82 #, c-format msgid "%s/%s" msgstr "" -#: grub-core/commands/hashsum.c:249 grub-core/disk/geli.c:192 -#: grub-core/loader/i386/xnu.c:767 util/grub-probe.c:721 +#: VasEBoot-core/commands/hashsum.c:249 VasEBoot-core/disk/geli.c:192 +#: VasEBoot-core/loader/i386/xnu.c:767 util/VasEBoot-probe.c:721 #, c-format msgid "%02x" msgstr "" -#: grub-core/commands/hashsum.c:250 +#: VasEBoot-core/commands/hashsum.c:250 #, c-format msgid " %s\n" msgstr "" -#: grub-core/commands/help.c:51 +#: VasEBoot-core/commands/help.c:51 #, c-format msgid "%s %s" msgstr "" -#: grub-core/commands/help.c:126 grub-core/normal/menu.c:682 -#: grub-core/normal/menu.c:694 grub-core/normal/menu_entry.c:1128 +#: VasEBoot-core/commands/help.c:126 VasEBoot-core/normal/menu.c:682 +#: VasEBoot-core/normal/menu.c:694 VasEBoot-core/normal/menu_entry.c:1128 msgid "" "\n" "\n" msgstr "" -#: grub-core/commands/help.c:132 +#: VasEBoot-core/commands/help.c:132 #, c-format msgid "" "%s %s %s\n" "%s\n" msgstr "" -#: grub-core/commands/hexdump.c:53 +#: VasEBoot-core/commands/hexdump.c:53 msgid "(mem)" msgstr "" -#: grub-core/commands/i386/cmosdump.c:38 +#: VasEBoot-core/commands/i386/cmosdump.c:38 #, c-format msgid "%02x: " msgstr "" -#: grub-core/commands/i386/cmosdump.c:44 grub-core/commands/testload.c:129 -#: grub-core/fs/reiserfs.c:306 grub-core/fs/reiserfs.c:334 -#: grub-core/lib/hexdump.c:42 +#: VasEBoot-core/commands/i386/cmosdump.c:44 VasEBoot-core/commands/testload.c:129 +#: VasEBoot-core/fs/reiserfs.c:306 VasEBoot-core/fs/reiserfs.c:334 +#: VasEBoot-core/lib/hexdump.c:42 #, c-format msgid "%02x " msgstr "" -#: grub-core/commands/i386/cpuid.c:34 grub-core/efiemu/i386/coredetect.c:24 -#: grub-core/efiemu/runtime/efiemu.c:187 grub-core/gdb/i386/idt.c:53 -#: grub-core/loader/i386/xnu.c:145 grub-core/loader/i386/xnu.c:155 -#: grub-core/video/i386/pc/vbe.c:63 grub-core/video/i386/pc/vbe.c:67 -#: include/grub/i386/io.h:31 include/grub/i386/io.h:40 -#: include/grub/i386/io.h:49 include/grub/i386/tsc.h:52 -#: include/grub/i386/tsc.h:73 include/grub/i386/tsc.h:96 +#: VasEBoot-core/commands/i386/cpuid.c:34 VasEBoot-core/efiemu/i386/coredetect.c:24 +#: VasEBoot-core/efiemu/runtime/efiemu.c:187 VasEBoot-core/gdb/i386/idt.c:53 +#: VasEBoot-core/loader/i386/xnu.c:145 VasEBoot-core/loader/i386/xnu.c:155 +#: VasEBoot-core/video/i386/pc/vbe.c:63 VasEBoot-core/video/i386/pc/vbe.c:67 +#: include/VasEBoot/i386/io.h:31 include/VasEBoot/i386/io.h:40 +#: include/VasEBoot/i386/io.h:49 include/VasEBoot/i386/tsc.h:52 +#: include/VasEBoot/i386/tsc.h:73 include/VasEBoot/i386/tsc.h:96 msgid "=a" msgstr "" -#: grub-core/commands/i386/cpuid.c:35 grub-core/efiemu/i386/coredetect.c:25 -#: grub-core/net/tftp.c:347 grub-core/net/tftp.c:348 grub-core/net/tftp.c:349 -#: grub-core/normal/menu.c:188 grub-core/script/execute.c:1051 -#: grub-core/video/i386/pc/vbe.c:64 +#: VasEBoot-core/commands/i386/cpuid.c:35 VasEBoot-core/efiemu/i386/coredetect.c:25 +#: VasEBoot-core/net/tftp.c:347 VasEBoot-core/net/tftp.c:348 VasEBoot-core/net/tftp.c:349 +#: VasEBoot-core/normal/menu.c:188 VasEBoot-core/script/execute.c:1051 +#: VasEBoot-core/video/i386/pc/vbe.c:64 msgid "0" msgstr "" -#: grub-core/commands/i386/cpuid.c:76 grub-core/efiemu/i386/coredetect.c:41 +#: VasEBoot-core/commands/i386/cpuid.c:76 VasEBoot-core/efiemu/i386/coredetect.c:41 msgid "i" msgstr "" -#: grub-core/commands/i386/cpuid.c:98 +#: VasEBoot-core/commands/i386/cpuid.c:98 msgid "[-l]" msgstr "" -#: grub-core/commands/i386/pc/halt.c:118 +#: VasEBoot-core/commands/i386/pc/halt.c:118 msgid "[-n]" msgstr "" -#: grub-core/commands/iorw.c:50 +#: VasEBoot-core/commands/iorw.c:50 msgid "in" msgstr "" -#: grub-core/commands/iorw.c:67 grub-core/commands/memrw.c:44 -#: grub-core/commands/setpci.c:124 +#: VasEBoot-core/commands/iorw.c:67 VasEBoot-core/commands/memrw.c:44 +#: VasEBoot-core/commands/setpci.c:124 msgid "XXXXXXXX" msgstr "" -#: grub-core/commands/iorw.c:68 grub-core/commands/memrw.c:67 -#: grub-core/commands/setpci.c:125 +#: VasEBoot-core/commands/iorw.c:68 VasEBoot-core/commands/memrw.c:67 +#: VasEBoot-core/commands/setpci.c:125 #, c-format msgid "%x" msgstr "" -#: grub-core/commands/iorw.c:72 grub-core/commands/memrw.c:71 +#: VasEBoot-core/commands/iorw.c:72 VasEBoot-core/commands/memrw.c:71 #, c-format msgid "0x%x\n" msgstr "" -#: grub-core/commands/iorw.c:92 +#: VasEBoot-core/commands/iorw.c:92 msgid "out" msgstr "" -#: grub-core/commands/keylayouts.c:214 +#: VasEBoot-core/commands/keylayouts.c:214 #, c-format msgid "%s/layouts/%s.gkb" msgstr "" -#: grub-core/commands/keystatus.c:104 +#: VasEBoot-core/commands/keystatus.c:104 msgid "[--shift] [--ctrl] [--alt]" msgstr "" -#: grub-core/commands/legacycfg.c:127 grub-core/commands/legacycfg.c:712 -#: grub-core/commands/legacycfg.c:717 grub-core/commands/legacycfg.c:724 +#: VasEBoot-core/commands/legacycfg.c:127 VasEBoot-core/commands/legacycfg.c:712 +#: VasEBoot-core/commands/legacycfg.c:717 VasEBoot-core/commands/legacycfg.c:724 msgid "legacy" msgstr "" -#: grub-core/commands/legacycfg.c:203 +#: VasEBoot-core/commands/legacycfg.c:203 msgid "extract_legacy_entries_" msgstr "" -#: grub-core/commands/legacycfg.c:204 +#: VasEBoot-core/commands/legacycfg.c:204 msgid "legacy_" msgstr "" -#: grub-core/commands/legacycfg.c:251 +#: VasEBoot-core/commands/legacycfg.c:251 msgid "--no-mem-option" msgstr "" -#: grub-core/commands/legacycfg.c:262 +#: VasEBoot-core/commands/legacycfg.c:262 msgid "--type=linux" msgstr "" -#: grub-core/commands/legacycfg.c:263 +#: VasEBoot-core/commands/legacycfg.c:263 msgid "--type=biglinux" msgstr "" -#: grub-core/commands/legacycfg.c:271 +#: VasEBoot-core/commands/legacycfg.c:271 msgid "--type=multiboot" msgstr "" -#: grub-core/commands/legacycfg.c:279 +#: VasEBoot-core/commands/legacycfg.c:279 msgid "--type=freebsd" msgstr "" -#: grub-core/commands/legacycfg.c:287 +#: VasEBoot-core/commands/legacycfg.c:287 msgid "--type=openbsd" msgstr "" -#: grub-core/commands/legacycfg.c:295 +#: VasEBoot-core/commands/legacycfg.c:295 msgid "--type=netbsd" msgstr "" -#: grub-core/commands/legacycfg.c:380 +#: VasEBoot-core/commands/legacycfg.c:380 msgid "adXXXXXXXXXXXXsXXXXXXXXXXXXYYY" msgstr "" -#: grub-core/commands/legacycfg.c:384 +#: VasEBoot-core/commands/legacycfg.c:384 #, c-format msgid "ad%ds%d%c" msgstr "" -#: grub-core/commands/legacycfg.c:387 +#: VasEBoot-core/commands/legacycfg.c:387 #, c-format msgid "ad%ds%d" msgstr "" -#: grub-core/commands/legacycfg.c:390 +#: VasEBoot-core/commands/legacycfg.c:390 #, c-format msgid "ad%d" msgstr "" -#: grub-core/commands/legacycfg.c:409 +#: VasEBoot-core/commands/legacycfg.c:409 msgid "wdXXXXXXXXXXXXY" msgstr "" -#: grub-core/commands/legacycfg.c:417 +#: VasEBoot-core/commands/legacycfg.c:417 msgid "-r" msgstr "" -#: grub-core/commands/legacycfg.c:424 +#: VasEBoot-core/commands/legacycfg.c:424 #, c-format msgid "wd%d%c" msgstr "" -#: grub-core/commands/legacycfg.c:512 grub-core/loader/multiboot.c:290 +#: VasEBoot-core/commands/legacycfg.c:512 VasEBoot-core/loader/multiboot.c:290 msgid "--nounzip" msgstr "" -#: grub-core/commands/legacycfg.c:645 +#: VasEBoot-core/commands/legacycfg.c:645 msgid "--md5" msgstr "" -#: grub-core/commands/loadenv.c:154 grub-core/kern/corecmd.c:43 -#: util/grub-editenv.c:190 +#: VasEBoot-core/commands/loadenv.c:154 VasEBoot-core/kern/corecmd.c:43 +#: util/VasEBoot-editenv.c:190 #, c-format msgid "%s=%s\n" msgstr "" -#: grub-core/commands/ls.c:55 grub-core/kern/corecmd.c:95 +#: VasEBoot-core/commands/ls.c:55 VasEBoot-core/kern/corecmd.c:95 #, c-format msgid "(%s) " msgstr "" -#: grub-core/commands/ls.c:75 grub-core/commands/terminal.c:55 -#: grub-core/commands/terminal.c:59 grub-core/commands/terminal.c:78 -#: grub-core/disk/cryptodisk.c:756 grub-core/disk/cryptodisk.c:758 -#: grub-core/disk/cryptodisk.c:760 grub-core/disk/cryptodisk.c:762 -#: grub-core/disk/cryptodisk.c:764 grub-core/disk/cryptodisk.c:766 -#: grub-core/disk/cryptodisk.c:773 grub-core/disk/diskfilter.c:365 -#: grub-core/net/net.c:1128 util/grub-probe.c:89 util/grub-probe.c:310 +#: VasEBoot-core/commands/ls.c:75 VasEBoot-core/commands/terminal.c:55 +#: VasEBoot-core/commands/terminal.c:59 VasEBoot-core/commands/terminal.c:78 +#: VasEBoot-core/disk/cryptodisk.c:756 VasEBoot-core/disk/cryptodisk.c:758 +#: VasEBoot-core/disk/cryptodisk.c:760 VasEBoot-core/disk/cryptodisk.c:762 +#: VasEBoot-core/disk/cryptodisk.c:764 VasEBoot-core/disk/cryptodisk.c:766 +#: VasEBoot-core/disk/cryptodisk.c:773 VasEBoot-core/disk/diskfilter.c:365 +#: VasEBoot-core/net/net.c:1128 util/VasEBoot-probe.c:89 util/VasEBoot-probe.c:310 #, c-format msgid "%s " msgstr "" -#: grub-core/commands/ls.c:102 grub-core/kern/corecmd.c:105 +#: VasEBoot-core/commands/ls.c:102 VasEBoot-core/kern/corecmd.c:105 #, c-format msgid "%s%s " msgstr "" -#: grub-core/commands/ls.c:102 grub-core/commands/ls.c:168 -#: grub-core/commands/test.c:116 grub-core/commands/wildcard.c:451 -#: grub-core/disk/ieee1275/ofdisk.c:240 grub-core/fs/iso9660.c:624 -#: grub-core/fs/iso9660.c:640 grub-core/fs/zfs/zfs.c:2950 -#: grub-core/gfxmenu/gui_string_util.c:129 -#: grub-core/gfxmenu/gui_string_util.c:203 grub-core/kern/corecmd.c:105 -#: grub-core/kern/emu/hostfs.c:53 grub-core/kern/fs.c:73 -#: grub-core/kern/fs.c:97 grub-core/kern/ieee1275/cmain.c:65 -#: grub-core/kern/ieee1275/mmap.c:35 grub-core/kern/ieee1275/openfw.c:156 -#: grub-core/loader/xnu.c:241 grub-core/loader/xnu.c:252 -#: grub-core/loader/xnu.c:1209 grub-core/normal/completion.c:312 -#: include/grub/emu/misc.h:37 include/grub/emu/misc.h:39 -#: util/grub-editenv.c:36 util/grub-fstest.c:288 util/grub-fstest.c:290 -#: util/grub-mount.c:183 +#: VasEBoot-core/commands/ls.c:102 VasEBoot-core/commands/ls.c:168 +#: VasEBoot-core/commands/test.c:116 VasEBoot-core/commands/wildcard.c:451 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:240 VasEBoot-core/fs/iso9660.c:624 +#: VasEBoot-core/fs/iso9660.c:640 VasEBoot-core/fs/zfs/zfs.c:2950 +#: VasEBoot-core/gfxmenu/gui_string_util.c:129 +#: VasEBoot-core/gfxmenu/gui_string_util.c:203 VasEBoot-core/kern/corecmd.c:105 +#: VasEBoot-core/kern/emu/hostfs.c:53 VasEBoot-core/kern/fs.c:73 +#: VasEBoot-core/kern/fs.c:97 VasEBoot-core/kern/ieee1275/cmain.c:65 +#: VasEBoot-core/kern/ieee1275/mmap.c:35 VasEBoot-core/kern/ieee1275/openfw.c:156 +#: VasEBoot-core/loader/xnu.c:241 VasEBoot-core/loader/xnu.c:252 +#: VasEBoot-core/loader/xnu.c:1209 VasEBoot-core/normal/completion.c:312 +#: include/VasEBoot/emu/misc.h:37 include/VasEBoot/emu/misc.h:39 +#: util/VasEBoot-editenv.c:36 util/VasEBoot-fstest.c:288 util/VasEBoot-fstest.c:290 +#: util/VasEBoot-mount.c:183 msgid "/" msgstr "" -#: grub-core/commands/ls.c:123 grub-core/commands/menuentry.c:100 -#: grub-core/commands/wildcard.c:310 grub-core/kern/main.c:169 -#: grub-core/kern/main.c:173 grub-core/net/drivers/ieee1275/ofnet.c:46 -#: util/grub-menulst2cfg.c:106 +#: VasEBoot-core/commands/ls.c:123 VasEBoot-core/commands/menuentry.c:100 +#: VasEBoot-core/commands/wildcard.c:310 VasEBoot-core/kern/main.c:169 +#: VasEBoot-core/kern/main.c:173 VasEBoot-core/net/drivers/ieee1275/ofnet.c:46 +#: util/VasEBoot-menulst2cfg.c:106 #, c-format msgid "%s%s" msgstr "" -#: grub-core/commands/ls.c:142 +#: VasEBoot-core/commands/ls.c:142 #, c-format msgid "%-12llu" msgstr "" -#: grub-core/commands/ls.c:144 grub-core/commands/ls.c:150 +#: VasEBoot-core/commands/ls.c:144 VasEBoot-core/commands/ls.c:150 #, c-format msgid "%-12s" msgstr "" -#: grub-core/commands/ls.c:168 +#: VasEBoot-core/commands/ls.c:168 #, c-format msgid "%s%s\n" msgstr "" -#: grub-core/commands/memrw.c:50 +#: VasEBoot-core/commands/memrw.c:50 msgid "read_" msgstr "" -#: grub-core/commands/memrw.c:91 +#: VasEBoot-core/commands/memrw.c:91 msgid "write_" msgstr "" -#: grub-core/commands/menuentry.c:59 +#: VasEBoot-core/commands/menuentry.c:59 msgid "f1" msgstr "" -#: grub-core/commands/menuentry.c:60 +#: VasEBoot-core/commands/menuentry.c:60 msgid "f2" msgstr "" -#: grub-core/commands/menuentry.c:61 +#: VasEBoot-core/commands/menuentry.c:61 msgid "f3" msgstr "" -#: grub-core/commands/menuentry.c:62 +#: VasEBoot-core/commands/menuentry.c:62 msgid "f4" msgstr "" -#: grub-core/commands/menuentry.c:63 +#: VasEBoot-core/commands/menuentry.c:63 msgid "f5" msgstr "" -#: grub-core/commands/menuentry.c:64 +#: VasEBoot-core/commands/menuentry.c:64 msgid "f6" msgstr "" -#: grub-core/commands/menuentry.c:65 +#: VasEBoot-core/commands/menuentry.c:65 msgid "f7" msgstr "" -#: grub-core/commands/menuentry.c:66 +#: VasEBoot-core/commands/menuentry.c:66 msgid "f8" msgstr "" -#: grub-core/commands/menuentry.c:67 +#: VasEBoot-core/commands/menuentry.c:67 msgid "f9" msgstr "" -#: grub-core/commands/menuentry.c:68 +#: VasEBoot-core/commands/menuentry.c:68 msgid "f10" msgstr "" -#: grub-core/commands/menuentry.c:69 +#: VasEBoot-core/commands/menuentry.c:69 msgid "f11" msgstr "" -#: grub-core/commands/menuentry.c:70 +#: VasEBoot-core/commands/menuentry.c:70 msgid "f12" msgstr "" -#: grub-core/commands/menuentry.c:247 +#: VasEBoot-core/commands/menuentry.c:247 msgid "'\\''" msgstr "" -#: grub-core/commands/nativedisk.c:37 +#: VasEBoot-core/commands/nativedisk.c:37 msgid "ehcipata" msgstr "" -#: grub-core/commands/nativedisk.c:143 +#: VasEBoot-core/commands/nativedisk.c:143 #, c-format msgid "(%s)/%s" msgstr "" -#: grub-core/commands/nativedisk.c:226 grub-core/commands/parttool.c:190 -#: grub-core/efiemu/main.c:239 grub-core/kern/dl.c:721 -#: grub-core/normal/autofs.c:73 grub-core/normal/completion.c:146 -#: grub-core/normal/crypto.c:89 grub-core/normal/dyncmd.c:103 -#: grub-core/normal/term.c:325 +#: VasEBoot-core/commands/nativedisk.c:226 VasEBoot-core/commands/parttool.c:190 +#: VasEBoot-core/efiemu/main.c:239 VasEBoot-core/kern/dl.c:721 +#: VasEBoot-core/normal/autofs.c:73 VasEBoot-core/normal/completion.c:146 +#: VasEBoot-core/normal/crypto.c:89 VasEBoot-core/normal/dyncmd.c:103 +#: VasEBoot-core/normal/term.c:325 #, c-format msgid "%s/" msgstr "" -#: grub-core/commands/nativedisk.c:226 grub-core/commands/parttool.c:190 -#: grub-core/efiemu/main.c:239 grub-core/kern/dl.c:721 -#: grub-core/kern/main.c:186 grub-core/kern/main.c:187 -#: grub-core/kern/main.c:188 grub-core/kern/main.c:189 -#: grub-core/loader/xnu.c:949 grub-core/loader/xnu.c:1253 -#: grub-core/loader/xnu.c:1259 grub-core/normal/autofs.c:73 -#: grub-core/normal/crypto.c:89 grub-core/normal/dyncmd.c:103 -#: grub-core/normal/term.c:325 util/grub-editenv.c:296 +#: VasEBoot-core/commands/nativedisk.c:226 VasEBoot-core/commands/parttool.c:190 +#: VasEBoot-core/efiemu/main.c:239 VasEBoot-core/kern/dl.c:721 +#: VasEBoot-core/kern/main.c:186 VasEBoot-core/kern/main.c:187 +#: VasEBoot-core/kern/main.c:188 VasEBoot-core/kern/main.c:189 +#: VasEBoot-core/loader/xnu.c:949 VasEBoot-core/loader/xnu.c:1253 +#: VasEBoot-core/loader/xnu.c:1259 VasEBoot-core/normal/autofs.c:73 +#: VasEBoot-core/normal/crypto.c:89 VasEBoot-core/normal/dyncmd.c:103 +#: VasEBoot-core/normal/term.c:325 util/VasEBoot-editenv.c:296 msgid "-" msgstr "" -#: grub-core/commands/nativedisk.c:226 grub-core/kern/dl.c:721 +#: VasEBoot-core/commands/nativedisk.c:226 VasEBoot-core/kern/dl.c:721 #, c-format msgid "/%s.mod" msgstr "" -#: grub-core/commands/parttool.c:34 grub-core/lib/pbkdf2.c:26 -#: grub-core/parttool/msdospart.c:32 +#: VasEBoot-core/commands/parttool.c:34 VasEBoot-core/lib/pbkdf2.c:26 +#: VasEBoot-core/parttool/msdospart.c:32 msgid "GPLv2+" msgstr "" -#: grub-core/commands/parttool.c:118 +#: VasEBoot-core/commands/parttool.c:118 msgid "+/-" msgstr "" -#: grub-core/commands/parttool.c:191 +#: VasEBoot-core/commands/parttool.c:191 msgid "/parttool.lst" msgstr "" -#: grub-core/commands/password_pbkdf2.c:95 -#: grub-core/commands/password_pbkdf2.c:96 -#: grub-core/commands/password_pbkdf2.c:99 -msgid "grub.pbkdf2.sha512." +#: VasEBoot-core/commands/password_pbkdf2.c:95 +#: VasEBoot-core/commands/password_pbkdf2.c:96 +#: VasEBoot-core/commands/password_pbkdf2.c:99 +msgid "VasEBoot.pbkdf2.sha512." msgstr "" -#: grub-core/commands/pcidump.c:65 +#: VasEBoot-core/commands/pcidump.c:65 #, c-format msgid "%08x " msgstr "" -#: grub-core/commands/search.c:80 grub-core/kern/main.c:198 +#: VasEBoot-core/commands/search.c:80 VasEBoot-core/kern/main.c:198 #, c-format msgid "(%s)%s" msgstr "" -#: grub-core/commands/search.c:160 grub-core/normal/cmdline.c:204 +#: VasEBoot-core/commands/search.c:160 VasEBoot-core/normal/cmdline.c:204 #, c-format msgid " %s" msgstr "" -#: grub-core/commands/search.c:179 grub-core/disk/efi/efidisk.c:855 -#: grub-core/kern/device.c:123 grub-core/normal/completion.c:114 -#: util/grub-fstest.c:755 util/grub-mount.c:579 util/grub-probe.c:269 +#: VasEBoot-core/commands/search.c:179 VasEBoot-core/disk/efi/efidisk.c:855 +#: VasEBoot-core/kern/device.c:123 VasEBoot-core/normal/completion.c:114 +#: util/VasEBoot-fstest.c:755 util/VasEBoot-mount.c:579 util/VasEBoot-probe.c:269 #, c-format msgid "%s,%s" msgstr "" -#: grub-core/commands/search_file.c:3 +#: VasEBoot-core/commands/search_file.c:3 msgid "search.file" msgstr "" -#: grub-core/commands/search_label.c:3 +#: VasEBoot-core/commands/search_label.c:3 msgid "search.fs_label" msgstr "" -#: grub-core/commands/search_uuid.c:3 +#: VasEBoot-core/commands/search_uuid.c:3 msgid "search.fs_uuid" msgstr "" -#: grub-core/commands/search_wrap.c:164 +#: VasEBoot-core/commands/search_wrap.c:164 msgid "--hint-" msgstr "" -#: util/grub-mkpasswd-pbkdf2.c:146 +#: util/VasEBoot-mkpasswd-pbkdf2.c:146 #, c-format msgid "" "\n" "%s" msgstr "" -#: util/grub-mkpasswd-pbkdf2.c:176 +#: util/VasEBoot-mkpasswd-pbkdf2.c:176 msgid "/dev/urandom" msgstr "" -#: util/grub-mkpasswd-pbkdf2.c:223 util/grub-mkpasswd-pbkdf2.c:225 -msgid "grub.pbkdf2.sha512.XXXXXXXXXXXXXXXXXXX.S.S" +#: util/VasEBoot-mkpasswd-pbkdf2.c:223 util/VasEBoot-mkpasswd-pbkdf2.c:225 +msgid "VasEBoot.pbkdf2.sha512.XXXXXXXXXXXXXXXXXXX.S.S" msgstr "" -#: util/grub-mkpasswd-pbkdf2.c:227 +#: util/VasEBoot-mkpasswd-pbkdf2.c:227 #, c-format -msgid "grub.pbkdf2.sha512.%d.%s.%s" +msgid "VasEBoot.pbkdf2.sha512.%d.%s.%s" msgstr "" -#: util/grub-probe.c:250 +#: util/VasEBoot-probe.c:250 #, c-format msgid "ata%d" msgstr "" -#: util/grub-probe.c:256 +#: util/VasEBoot-probe.c:256 #, c-format msgid "ahci%d" msgstr "" -#: util/grub-probe.c:296 +#: util/VasEBoot-probe.c:296 #, c-format msgid "lvm " msgstr "" -#: util/grub-probe.c:300 +#: util/VasEBoot-probe.c:300 #, c-format msgid "ldm " msgstr "" -#: util/grub-probe.c:308 +#: util/VasEBoot-probe.c:308 #, c-format msgid "diskfilter " msgstr "" -#: util/grub-probe.c:313 +#: util/VasEBoot-probe.c:313 #, c-format msgid "raid5rec " msgstr "" -#: util/grub-probe.c:315 +#: util/VasEBoot-probe.c:315 #, c-format msgid "raid6rec " msgstr "" -#: util/grub-probe.c:421 +#: util/VasEBoot-probe.c:421 msgid "false\n" msgstr "" -#: util/grub-probe.c:429 +#: util/VasEBoot-probe.c:429 msgid "true\n" msgstr "" -#: util/grub-probe.c:504 +#: util/VasEBoot-probe.c:504 #, c-format msgid "--hint-ieee1275='" msgstr "" -#: util/grub-probe.c:513 +#: util/VasEBoot-probe.c:513 #, c-format msgid "--hint-bios=" msgstr "" -#: util/grub-probe.c:522 +#: util/VasEBoot-probe.c:522 #, c-format msgid "--hint-efi=" msgstr "" -#: util/grub-probe.c:531 +#: util/VasEBoot-probe.c:531 #, c-format msgid "--hint-baremetal=" msgstr "" -#: util/grub-probe.c:542 +#: util/VasEBoot-probe.c:542 #, c-format msgid "--hint='" msgstr "" -#: util/grub-probe.c:740 +#: util/VasEBoot-probe.c:740 msgid "" "(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|cryptodisk_uuid|" "msdos_parttype)" msgstr "" -#: util/grub-probe.c:791 +#: util/VasEBoot-probe.c:791 msgid "fs_uuid" msgstr "" -#: util/grub-probe.c:793 +#: util/VasEBoot-probe.c:793 msgid "fs_label" msgstr "" -#: util/grub-probe.c:795 +#: util/VasEBoot-probe.c:795 msgid "drive" msgstr "" -#: util/grub-probe.c:801 +#: util/VasEBoot-probe.c:801 msgid "abstraction" msgstr "" -#: util/grub-probe.c:803 +#: util/VasEBoot-probe.c:803 msgid "cryptodisk_uuid" msgstr "" -#: util/grub-probe.c:805 +#: util/VasEBoot-probe.c:805 msgid "msdos_parttype" msgstr "" -#: util/grub-probe.c:807 +#: util/VasEBoot-probe.c:807 msgid "hints_string" msgstr "" -#: util/grub-probe.c:809 +#: util/VasEBoot-probe.c:809 msgid "bios_hints" msgstr "" -#: util/grub-probe.c:811 +#: util/VasEBoot-probe.c:811 msgid "ieee1275_hints" msgstr "" -#: util/grub-probe.c:813 +#: util/VasEBoot-probe.c:813 msgid "baremetal_hints" msgstr "" -#: util/grub-probe.c:815 +#: util/VasEBoot-probe.c:815 msgid "efi_hints" msgstr "" -#: util/grub-probe.c:817 +#: util/VasEBoot-probe.c:817 msgid "arc_hints" msgstr "" -#: util/grub-probe.c:819 +#: util/VasEBoot-probe.c:819 msgid "compatibility_hint" msgstr "" -#: util/grub-probe.c:821 +#: util/VasEBoot-probe.c:821 msgid "zero_check" msgstr "" -#: util/grub-render-label.c:273 +#: util/VasEBoot-render-label.c:273 #, c-format msgid "(host)/%s" msgstr "" -#: util/grub-setup.c:87 +#: util/VasEBoot-setup.c:87 msgid "core.img" msgstr "" -#: util/grub-setup.c:147 util/grub-setup.c:173 +#: util/VasEBoot-setup.c:147 util/VasEBoot-setup.c:173 #, c-format msgid ",%u,%u>" msgstr "" -#: util/grub-setup.c:665 +#: util/VasEBoot-setup.c:665 msgid "dump.img" msgstr "" -#: util/grub-setup.c:672 +#: util/VasEBoot-setup.c:672 msgid "dump2.img" msgstr "" -#: util/grub-setup.c:896 +#: util/VasEBoot-setup.c:896 msgid "r+b" msgstr "" -#: util/ieee1275/grub-ofpathname.c:44 +#: util/ieee1275/VasEBoot-ofpathname.c:44 msgid "--version" msgstr "" @@ -777,71 +777,71 @@ msgstr "" msgid "<%c, %x>" msgstr "" -#: util/grub-mkimage.c:764 +#: util/VasEBoot-mkimage.c:764 msgid "moddep.lst" msgstr "" -#: util/grub-mkimage.c:766 +#: util/VasEBoot-mkimage.c:766 msgid "kernel.img" msgstr "" -#: util/grub-mkimage.c:973 +#: util/VasEBoot-mkimage.c:973 msgid "xz_decompress.img" msgstr "" -#: util/grub-mkimage.c:976 +#: util/VasEBoot-mkimage.c:976 msgid "lzma_decompress.img" msgstr "" -#: util/grub-mkimage.c:979 +#: util/VasEBoot-mkimage.c:979 msgid "none_decompress.img" msgstr "" -#: util/grub-mkimage.c:1079 +#: util/VasEBoot-mkimage.c:1079 msgid "pxeboot.img" msgstr "" -#: util/grub-mkimage.c:1101 util/grub-mkimage.c:1380 +#: util/VasEBoot-mkimage.c:1101 util/VasEBoot-mkimage.c:1380 msgid "diskboot.img" msgstr "" -#: util/grub-mkimage.c:1158 +#: util/VasEBoot-mkimage.c:1158 msgid "PE" msgstr "" -#: util/grub-mkimage.c:1263 +#: util/VasEBoot-mkimage.c:1263 msgid ".data" msgstr "" -#: util/grub-mkimage.c:1275 +#: util/VasEBoot-mkimage.c:1275 msgid ".bss" msgstr "" -#: util/grub-mkimage.c:1289 +#: util/VasEBoot-mkimage.c:1289 msgid "mods" msgstr "" -#: util/grub-mkimage.c:1300 +#: util/VasEBoot-mkimage.c:1300 msgid ".reloc" msgstr "" -#: util/grub-mkimage.c:1321 util/grub-setup.c:86 +#: util/VasEBoot-mkimage.c:1321 util/VasEBoot-setup.c:86 msgid "boot.img" msgstr "" -#: util/grub-mkimage.c:1435 +#: util/VasEBoot-mkimage.c:1435 msgid "fwstart_fuloong2f.img" msgstr "" -#: util/grub-mkimage.c:1440 +#: util/VasEBoot-mkimage.c:1440 msgid "fwstart.img" msgstr "" -#: util/grub-mkimage.c:1766 +#: util/VasEBoot-mkimage.c:1766 msgid "(xz|none|auto)" msgstr "" -#: util/grub-mkimage.c:1798 +#: util/VasEBoot-mkimage.c:1798 #, c-format msgid "" "%s\n" @@ -849,2066 +849,2066 @@ msgid "" msgstr "" -#: util/grub-mkimage.c:113 util/grub-mkimage.c:114 +#: util/VasEBoot-mkimage.c:113 util/VasEBoot-mkimage.c:114 msgid "i386-coreboot" msgstr "" -#: util/grub-mkimage.c:132 util/grub-mkimage.c:133 +#: util/VasEBoot-mkimage.c:132 util/VasEBoot-mkimage.c:133 msgid "i386-multiboot" msgstr "" -#: util/grub-mkimage.c:151 util/grub-mkimage.c:152 util/grub-mkimage.c:167 +#: util/VasEBoot-mkimage.c:151 util/VasEBoot-mkimage.c:152 util/VasEBoot-mkimage.c:167 msgid "i386-pc" msgstr "" -#: util/grub-mkimage.c:168 +#: util/VasEBoot-mkimage.c:168 msgid "i386-pc-pxe" msgstr "" -#: util/grub-mkimage.c:183 util/grub-mkimage.c:184 +#: util/VasEBoot-mkimage.c:183 util/VasEBoot-mkimage.c:184 msgid "i386-efi" msgstr "" -#: util/grub-mkimage.c:199 util/grub-mkimage.c:200 +#: util/VasEBoot-mkimage.c:199 util/VasEBoot-mkimage.c:200 msgid "i386-ieee1275" msgstr "" -#: util/grub-mkimage.c:218 util/grub-mkimage.c:219 +#: util/VasEBoot-mkimage.c:218 util/VasEBoot-mkimage.c:219 msgid "i386-qemu" msgstr "" -#: util/grub-mkimage.c:233 util/grub-mkimage.c:234 +#: util/VasEBoot-mkimage.c:233 util/VasEBoot-mkimage.c:234 msgid "x86_64-efi" msgstr "" -#: util/grub-mkimage.c:249 util/grub-mkimage.c:267 util/grub-mkimage.c:285 +#: util/VasEBoot-mkimage.c:249 util/VasEBoot-mkimage.c:267 util/VasEBoot-mkimage.c:285 msgid "mipsel-loongson" msgstr "" -#: util/grub-mkimage.c:250 +#: util/VasEBoot-mkimage.c:250 msgid "mipsel-yeeloong-flash" msgstr "" -#: util/grub-mkimage.c:268 +#: util/VasEBoot-mkimage.c:268 msgid "mipsel-fuloong2f-flash" msgstr "" -#: util/grub-mkimage.c:286 +#: util/VasEBoot-mkimage.c:286 msgid "mipsel-loongson-elf" msgstr "" -#: util/grub-mkimage.c:286 +#: util/VasEBoot-mkimage.c:286 msgid "mipsel-yeeloong-elf" msgstr "" -#: util/grub-mkimage.c:287 +#: util/VasEBoot-mkimage.c:287 msgid "mipsel-fuloong2f-elf" msgstr "" -#: util/grub-mkimage.c:287 +#: util/VasEBoot-mkimage.c:287 msgid "mipsel-fuloong2e-elf" msgstr "" -#: util/grub-mkimage.c:288 +#: util/VasEBoot-mkimage.c:288 msgid "mipsel-fuloong-elf" msgstr "" -#: util/grub-mkimage.c:305 util/grub-mkimage.c:306 +#: util/VasEBoot-mkimage.c:305 util/VasEBoot-mkimage.c:306 msgid "powerpc-ieee1275" msgstr "" -#: util/grub-mkimage.c:324 util/grub-mkimage.c:339 util/grub-mkimage.c:354 +#: util/VasEBoot-mkimage.c:324 util/VasEBoot-mkimage.c:339 util/VasEBoot-mkimage.c:354 msgid "sparc64-ieee1275" msgstr "" -#: util/grub-mkimage.c:325 +#: util/VasEBoot-mkimage.c:325 msgid "sparc64-ieee1275-raw" msgstr "" -#: util/grub-mkimage.c:340 +#: util/VasEBoot-mkimage.c:340 msgid "sparc64-ieee1275-cdcore" msgstr "" -#: util/grub-mkimage.c:355 +#: util/VasEBoot-mkimage.c:355 msgid "sparc64-ieee1275-aout" msgstr "" -#: util/grub-mkimage.c:369 util/grub-mkimage.c:370 +#: util/VasEBoot-mkimage.c:369 util/VasEBoot-mkimage.c:370 msgid "ia64-efi" msgstr "" -#: util/grub-mkimage.c:385 util/grub-mkimage.c:386 +#: util/VasEBoot-mkimage.c:385 util/VasEBoot-mkimage.c:386 msgid "mips-arc" msgstr "" -#: util/grub-mkimage.c:403 util/grub-mkimage.c:404 +#: util/VasEBoot-mkimage.c:403 util/VasEBoot-mkimage.c:404 msgid "mipsel-arc" msgstr "" -#: util/grub-mkimage.c:421 util/grub-mkimage.c:457 +#: util/VasEBoot-mkimage.c:421 util/VasEBoot-mkimage.c:457 msgid "mipsel-qemu_mips" msgstr "" -#: util/grub-mkimage.c:422 +#: util/VasEBoot-mkimage.c:422 msgid "mipsel-qemu_mips-elf" msgstr "" -#: util/grub-mkimage.c:439 util/grub-mkimage.c:475 +#: util/VasEBoot-mkimage.c:439 util/VasEBoot-mkimage.c:475 msgid "mips-qemu_mips" msgstr "" -#: util/grub-mkimage.c:440 +#: util/VasEBoot-mkimage.c:440 msgid "mips-qemu_mips-flash" msgstr "" -#: util/grub-mkimage.c:458 +#: util/VasEBoot-mkimage.c:458 msgid "mipsel-qemu_mips-flash" msgstr "" -#: util/grub-mkimage.c:476 +#: util/VasEBoot-mkimage.c:476 msgid "mips-qemu_mips-elf" msgstr "" -#: grub-core/commands/terminal.c:85 grub-core/commands/terminal.c:145 +#: VasEBoot-core/commands/terminal.c:85 VasEBoot-core/commands/terminal.c:145 msgid "--append" msgstr "" -#: grub-core/commands/terminal.c:86 grub-core/commands/terminal.c:166 +#: VasEBoot-core/commands/terminal.c:86 VasEBoot-core/commands/terminal.c:166 msgid "--remove" msgstr "" -#: grub-core/commands/terminal.c:99 grub-core/commands/terminal.c:105 -#: grub-core/commands/terminal.c:116 grub-core/commands/terminal.c:151 -#: grub-core/commands/terminal.c:172 grub-core/commands/terminal.c:192 -#: grub-core/commands/terminal.c:212 grub-core/loader/i386/linux.c:552 +#: VasEBoot-core/commands/terminal.c:99 VasEBoot-core/commands/terminal.c:105 +#: VasEBoot-core/commands/terminal.c:116 VasEBoot-core/commands/terminal.c:151 +#: VasEBoot-core/commands/terminal.c:172 VasEBoot-core/commands/terminal.c:192 +#: VasEBoot-core/commands/terminal.c:212 VasEBoot-core/loader/i386/linux.c:552 msgid "ofconsole" msgstr "" -#: grub-core/commands/terminal.c:129 grub-core/commands/terminal.c:130 +#: VasEBoot-core/commands/terminal.c:129 VasEBoot-core/commands/terminal.c:130 msgid "serial_usb" msgstr "" -#: grub-core/commands/test.c:168 +#: VasEBoot-core/commands/test.c:168 msgid "=" msgstr "" -#: grub-core/commands/test.c:169 +#: VasEBoot-core/commands/test.c:169 msgid "==" msgstr "" -#: grub-core/commands/test.c:177 +#: VasEBoot-core/commands/test.c:177 msgid "!=" msgstr "" -#: grub-core/commands/test.c:186 grub-core/fs/reiserfs.c:569 -#: grub-core/kern/emu/argp_common.c:38 util/grub-editenv.c:66 +#: VasEBoot-core/commands/test.c:186 VasEBoot-core/fs/reiserfs.c:569 +#: VasEBoot-core/kern/emu/argp_common.c:38 util/VasEBoot-editenv.c:66 msgid "<" msgstr "" -#: grub-core/commands/test.c:194 +#: VasEBoot-core/commands/test.c:194 msgid "<=" msgstr "" -#: grub-core/commands/test.c:210 +#: VasEBoot-core/commands/test.c:210 msgid ">=" msgstr "" -#: grub-core/commands/test.c:219 +#: VasEBoot-core/commands/test.c:219 msgid "-eq" msgstr "" -#: grub-core/commands/test.c:227 +#: VasEBoot-core/commands/test.c:227 msgid "-ge" msgstr "" -#: grub-core/commands/test.c:235 +#: VasEBoot-core/commands/test.c:235 msgid "-gt" msgstr "" -#: grub-core/commands/test.c:243 +#: VasEBoot-core/commands/test.c:243 msgid "-le" msgstr "" -#: grub-core/commands/test.c:251 +#: VasEBoot-core/commands/test.c:251 msgid "-lt" msgstr "" -#: grub-core/commands/test.c:259 +#: VasEBoot-core/commands/test.c:259 msgid "-ne" msgstr "" -#: grub-core/commands/test.c:269 grub-core/commands/test.c:283 +#: VasEBoot-core/commands/test.c:269 VasEBoot-core/commands/test.c:283 msgid "-pgt" msgstr "" -#: grub-core/commands/test.c:270 +#: VasEBoot-core/commands/test.c:270 msgid "-plt" msgstr "" -#: grub-core/commands/test.c:295 grub-core/commands/test.c:311 +#: VasEBoot-core/commands/test.c:295 VasEBoot-core/commands/test.c:311 msgid "-nt" msgstr "" -#: grub-core/commands/test.c:296 +#: VasEBoot-core/commands/test.c:296 msgid "-ot" msgstr "" -#: grub-core/commands/test.c:330 util/grub-fstest.c:492 util/grub-mount.c:422 +#: VasEBoot-core/commands/test.c:330 util/VasEBoot-fstest.c:492 util/VasEBoot-mount.c:422 msgid "-d" msgstr "" -#: grub-core/commands/test.c:338 +#: VasEBoot-core/commands/test.c:338 msgid "-e" msgstr "" -#: grub-core/commands/test.c:346 +#: VasEBoot-core/commands/test.c:346 msgid "-f" msgstr "" -#: grub-core/commands/test.c:355 util/grub-mount.c:552 +#: VasEBoot-core/commands/test.c:355 util/VasEBoot-mount.c:552 msgid "-s" msgstr "" -#: grub-core/commands/test.c:369 +#: VasEBoot-core/commands/test.c:369 msgid "-n" msgstr "" -#: grub-core/commands/test.c:376 +#: VasEBoot-core/commands/test.c:376 msgid "-z" msgstr "" -#: grub-core/commands/test.c:387 grub-core/normal/completion.c:120 -#: grub-core/normal/completion.c:178 util/grub-mkimagexx.c:349 +#: VasEBoot-core/commands/test.c:387 VasEBoot-core/normal/completion.c:120 +#: VasEBoot-core/normal/completion.c:178 util/VasEBoot-mkimagexx.c:349 msgid ")" msgstr "" -#: grub-core/commands/test.c:393 +#: VasEBoot-core/commands/test.c:393 msgid "(" msgstr "" -#: grub-core/commands/test.c:400 grub-core/script/execute.c:917 +#: VasEBoot-core/commands/test.c:400 VasEBoot-core/script/execute.c:917 msgid "!" msgstr "" -#: grub-core/commands/test.c:406 util/grub-fstest.c:408 util/grub-mount.c:383 +#: VasEBoot-core/commands/test.c:406 util/VasEBoot-fstest.c:408 util/VasEBoot-mount.c:383 msgid "-a" msgstr "" -#: grub-core/commands/test.c:411 +#: VasEBoot-core/commands/test.c:411 msgid "-o" msgstr "" -#: grub-core/commands/test.c:432 +#: VasEBoot-core/commands/test.c:432 msgid "]" msgstr "" -#: grub-core/commands/verify.c:128 +#: VasEBoot-core/commands/verify.c:128 msgid "ripemd160" msgstr "" -#: grub-core/commands/verify.c:130 +#: VasEBoot-core/commands/verify.c:130 msgid "sha384" msgstr "" -#: grub-core/commands/verify.c:132 +#: VasEBoot-core/commands/verify.c:132 msgid "sha224" msgstr "" -#: grub-core/commands/verify.c:142 grub-core/commands/verify.c:143 +#: VasEBoot-core/commands/verify.c:142 VasEBoot-core/commands/verify.c:143 msgid "rsa" msgstr "" -#: grub-core/commands/verify.c:144 +#: VasEBoot-core/commands/verify.c:144 msgid "dsa" msgstr "" -#: grub-core/commands/verify.c:258 +#: VasEBoot-core/commands/verify.c:258 msgid "" msgstr "" -#: grub-core/commands/verify.c:531 +#: VasEBoot-core/commands/verify.c:531 msgid "gcry_dsa" msgstr "" -#: grub-core/commands/verify.c:587 +#: VasEBoot-core/commands/verify.c:587 #, c-format msgid "%02x%02x " msgstr "" -#: grub-core/commands/verify.c:696 +#: VasEBoot-core/commands/verify.c:696 msgid "verified_read" msgstr "" -#: grub-core/commands/verify.c:714 grub-core/commands/verify.c:718 +#: VasEBoot-core/commands/verify.c:714 VasEBoot-core/commands/verify.c:718 msgid ".sig" msgstr "" -#: grub-core/commands/verify.c:771 grub-core/commands/verify.c:836 +#: VasEBoot-core/commands/verify.c:771 VasEBoot-core/commands/verify.c:836 msgid "enforce" msgstr "" -#: grub-core/commands/verify.c:771 grub-core/commands/verify.c:836 -#: grub-core/term/serial.c:217 +#: VasEBoot-core/commands/verify.c:771 VasEBoot-core/commands/verify.c:836 +#: VasEBoot-core/term/serial.c:217 msgid "no" msgstr "" -#: grub-core/commands/videoinfo.c:48 +#: VasEBoot-core/commands/videoinfo.c:48 msgid " " msgstr "" -#: grub-core/commands/videoinfo.c:52 grub-core/script/execute.c:254 -#: grub-core/script/execute.c:296 +#: VasEBoot-core/commands/videoinfo.c:52 VasEBoot-core/script/execute.c:254 +#: VasEBoot-core/script/execute.c:296 msgid "*" msgstr "" -#: grub-core/commands/videoinfo.c:55 +#: VasEBoot-core/commands/videoinfo.c:55 #, c-format msgid " 0x%03x " msgstr "" -#: grub-core/commands/videoinfo.c:57 +#: VasEBoot-core/commands/videoinfo.c:57 #, c-format msgid "%4d x %4d x %2d (%4d) " msgstr "" -#: grub-core/commands/videotest.c:56 grub-core/loader/i386/linux.c:48 -#: grub-core/loader/i386/xnu.c:41 grub-core/loader/multiboot.c:57 -#: grub-core/loader/multiboot.c:212 grub-core/term/gfxterm.c:36 -#: grub-core/video/video.c:437 util/grub-mkimage.c:1907 +#: VasEBoot-core/commands/videotest.c:56 VasEBoot-core/loader/i386/linux.c:48 +#: VasEBoot-core/loader/i386/xnu.c:41 VasEBoot-core/loader/multiboot.c:57 +#: VasEBoot-core/loader/multiboot.c:212 VasEBoot-core/term/gfxterm.c:36 +#: VasEBoot-core/video/video.c:437 util/VasEBoot-mkimage.c:1907 msgid "auto" msgstr "" -#: grub-core/commands/videotest.c:82 grub-core/commands/videotest.c:83 -#: grub-core/commands/videotest.c:84 grub-core/gfxmenu/gui_label.c:261 -#: grub-core/gfxmenu/gui_list.c:594 grub-core/gfxmenu/gui_progress_bar.c:391 -#: grub-core/gfxmenu/view.c:74 +#: VasEBoot-core/commands/videotest.c:82 VasEBoot-core/commands/videotest.c:83 +#: VasEBoot-core/commands/videotest.c:84 VasEBoot-core/gfxmenu/gui_label.c:261 +#: VasEBoot-core/gfxmenu/gui_list.c:594 VasEBoot-core/gfxmenu/gui_progress_bar.c:391 +#: VasEBoot-core/gfxmenu/view.c:74 msgid "Unknown Regular 16" msgstr "" -#: grub-core/commands/videotest.c:85 +#: VasEBoot-core/commands/videotest.c:85 msgid "Fixed 20" msgstr "" -#: grub-core/commands/wildcard.c:234 util/grub-probe.c:387 +#: VasEBoot-core/commands/wildcard.c:234 util/VasEBoot-probe.c:387 #, c-format msgid "(%s)" msgstr "" -#: grub-core/commands/wildcard.c:301 grub-core/fs/affs.c:421 -#: grub-core/fs/hfsplus.c:829 grub-core/fs/iso9660.c:557 -#: grub-core/fs/iso9660.c:731 grub-core/fs/reiserfs.c:938 -#: grub-core/fs/squash4.c:536 grub-core/fs/udf.c:886 grub-core/fs/xfs.c:522 -#: grub-core/gfxmenu/gui_string_util.c:98 grub-core/normal/completion.c:142 -#: util/grub-fstest.c:286 +#: VasEBoot-core/commands/wildcard.c:301 VasEBoot-core/fs/affs.c:421 +#: VasEBoot-core/fs/hfsplus.c:829 VasEBoot-core/fs/iso9660.c:557 +#: VasEBoot-core/fs/iso9660.c:731 VasEBoot-core/fs/reiserfs.c:938 +#: VasEBoot-core/fs/squash4.c:536 VasEBoot-core/fs/udf.c:886 VasEBoot-core/fs/xfs.c:522 +#: VasEBoot-core/gfxmenu/gui_string_util.c:98 VasEBoot-core/normal/completion.c:142 +#: util/VasEBoot-fstest.c:286 msgid ".." msgstr "" -#: grub-core/commands/xnu_uuid.c:51 +#: VasEBoot-core/commands/xnu_uuid.c:51 msgid "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" msgstr "" -#: grub-core/commands/xnu_uuid.c:59 util/grub-fstest.c:463 +#: VasEBoot-core/commands/xnu_uuid.c:59 util/VasEBoot-fstest.c:463 msgid "-l" msgstr "" -#: grub-core/commands/xnu_uuid.c:75 grub-core/fs/jfs.c:924 -#: grub-core/fs/nilfs2.c:1135 +#: VasEBoot-core/commands/xnu_uuid.c:75 VasEBoot-core/fs/jfs.c:924 +#: VasEBoot-core/fs/nilfs2.c:1135 #, c-format msgid "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x" msgstr "" -#: grub-core/disk/ahci.c:968 +#: VasEBoot-core/disk/ahci.c:968 msgid ", %x, %x (%" msgstr "" -#: grub-core/disk/ahci.c:969 grub-core/fs/btrfs.c:720 -#: grub-core/fs/zfs/zfs.c:1307 +#: VasEBoot-core/disk/ahci.c:969 VasEBoot-core/fs/btrfs.c:720 +#: VasEBoot-core/fs/zfs/zfs.c:1307 msgid ")\n" msgstr "" -#: grub-core/disk/arc/arcdisk.c:117 +#: VasEBoot-core/disk/arc/arcdisk.c:117 msgid "partition(0)" msgstr "" -#: grub-core/disk/arc/arcdisk.c:119 +#: VasEBoot-core/disk/arc/arcdisk.c:119 msgid "partition(10)" msgstr "" -#: grub-core/disk/arc/arcdisk.c:166 +#: VasEBoot-core/disk/arc/arcdisk.c:166 msgid "arc/" msgstr "" -#: grub-core/disk/ata.c:426 grub-core/disk/scsi.c:445 -#: grub-core/loader/xnu.c:576 +#: VasEBoot-core/disk/ata.c:426 VasEBoot-core/disk/scsi.c:445 +#: VasEBoot-core/loader/xnu.c:576 #, c-format msgid "%s%d" msgstr "" -#: grub-core/disk/cryptodisk.c:467 +#: VasEBoot-core/disk/cryptodisk.c:467 #, c-format msgid "crypto%lu" msgstr "" -#: grub-core/disk/cryptodisk.c:483 grub-core/disk/cryptodisk.c:486 +#: VasEBoot-core/disk/cryptodisk.c:483 VasEBoot-core/disk/cryptodisk.c:486 msgid "cryptouuid/" msgstr "" -#: grub-core/disk/cryptodisk.c:753 +#: VasEBoot-core/disk/cryptodisk.c:753 #, c-format msgid "cryptodisk %s " msgstr "" -#: grub-core/disk/cryptodisk.c:1006 grub-core/disk/cryptodisk.c:1026 +#: VasEBoot-core/disk/cryptodisk.c:1006 VasEBoot-core/disk/cryptodisk.c:1026 msgid "luks_mount " msgstr "" -#: grub-core/disk/cryptodisk.c:1037 +#: VasEBoot-core/disk/cryptodisk.c:1037 msgid "-ecb" msgstr "" -#: grub-core/disk/cryptodisk.c:1040 +#: VasEBoot-core/disk/cryptodisk.c:1040 msgid "-cbc" msgstr "" -#: grub-core/disk/cryptodisk.c:1043 +#: VasEBoot-core/disk/cryptodisk.c:1043 msgid "-pcbc" msgstr "" -#: grub-core/disk/cryptodisk.c:1046 +#: VasEBoot-core/disk/cryptodisk.c:1046 msgid "-xts" msgstr "" -#: grub-core/disk/cryptodisk.c:1049 +#: VasEBoot-core/disk/cryptodisk.c:1049 msgid "-lrw" msgstr "" -#: grub-core/disk/cryptodisk.c:1056 +#: VasEBoot-core/disk/cryptodisk.c:1056 msgid "-null" msgstr "" -#: grub-core/disk/cryptodisk.c:1059 +#: VasEBoot-core/disk/cryptodisk.c:1059 msgid "-plain" msgstr "" -#: grub-core/disk/cryptodisk.c:1062 +#: VasEBoot-core/disk/cryptodisk.c:1062 msgid "-plain64" msgstr "" -#: grub-core/disk/cryptodisk.c:1065 +#: VasEBoot-core/disk/cryptodisk.c:1065 msgid "-benbi" msgstr "" -#: grub-core/disk/cryptodisk.c:1068 +#: VasEBoot-core/disk/cryptodisk.c:1068 msgid "-essiv:" msgstr "" -#: grub-core/disk/cryptodisk.c:1089 grub-core/disk/cryptodisk.c:1101 +#: VasEBoot-core/disk/cryptodisk.c:1089 VasEBoot-core/disk/cryptodisk.c:1101 msgid "luks_script" msgstr "" -#: grub-core/disk/diskfilter.c:118 grub-core/disk/diskfilter.c:431 +#: VasEBoot-core/disk/diskfilter.c:118 VasEBoot-core/disk/diskfilter.c:431 msgid "md" msgstr "" -#: grub-core/disk/diskfilter.c:119 grub-core/disk/diskfilter.c:432 -#: grub-core/disk/lvm.c:369 grub-core/disk/lvm.c:374 grub-core/disk/lvm.c:375 -#: util/grub-probe.c:295 +#: VasEBoot-core/disk/diskfilter.c:119 VasEBoot-core/disk/diskfilter.c:432 +#: VasEBoot-core/disk/lvm.c:369 VasEBoot-core/disk/lvm.c:374 VasEBoot-core/disk/lvm.c:375 +#: util/VasEBoot-probe.c:295 msgid "lvm/" msgstr "" -#: grub-core/disk/diskfilter.c:120 grub-core/disk/diskfilter.c:433 -#: util/grub-probe.c:299 +#: VasEBoot-core/disk/diskfilter.c:120 VasEBoot-core/disk/diskfilter.c:433 +#: util/VasEBoot-probe.c:299 msgid "ldm/" msgstr "" -#: grub-core/disk/diskfilter.c:396 grub-core/disk/diskfilter.c:398 +#: VasEBoot-core/disk/diskfilter.c:396 VasEBoot-core/disk/diskfilter.c:398 msgid "mduuid/" msgstr "" -#: grub-core/disk/diskfilter.c:688 +#: VasEBoot-core/disk/diskfilter.c:688 msgid "raid6rec" msgstr "" -#: grub-core/disk/diskfilter.c:698 +#: VasEBoot-core/disk/diskfilter.c:698 msgid "raid5rec" msgstr "" -#: grub-core/disk/diskfilter.c:892 +#: VasEBoot-core/disk/diskfilter.c:892 #, c-format msgid "%s_%d" msgstr "" -#: grub-core/disk/diskfilter.c:978 +#: VasEBoot-core/disk/diskfilter.c:978 #, c-format msgid "md/%s" msgstr "" -#: grub-core/disk/dmraid_nvidia.c:173 +#: VasEBoot-core/disk/dmraid_nvidia.c:173 msgid "dmraid_nv" msgstr "" -#: grub-core/disk/efi/efidisk.c:419 grub-core/disk/i386/pc/biosdisk.c:284 -#: util/grub-probe.c:192 util/grub-probe.c:221 +#: VasEBoot-core/disk/efi/efidisk.c:419 VasEBoot-core/disk/i386/pc/biosdisk.c:284 +#: util/VasEBoot-probe.c:192 util/VasEBoot-probe.c:221 #, c-format msgid "hd%d" msgstr "" -#: grub-core/disk/efi/efidisk.c:428 grub-core/disk/i386/pc/biosdisk.c:284 -#: util/grub-probe.c:198 util/grub-probe.c:227 +#: VasEBoot-core/disk/efi/efidisk.c:428 VasEBoot-core/disk/i386/pc/biosdisk.c:284 +#: util/VasEBoot-probe.c:198 util/VasEBoot-probe.c:227 #, c-format msgid "fd%d" msgstr "" -#: grub-core/disk/efi/efidisk.c:436 +#: VasEBoot-core/disk/efi/efidisk.c:436 #, c-format msgid "cd%d" msgstr "" -#: grub-core/disk/efi/efidisk.c:718 +#: VasEBoot-core/disk/efi/efidisk.c:718 msgid "XdXXXXXXXXXX" msgstr "" -#: grub-core/disk/efi/efidisk.c:729 +#: VasEBoot-core/disk/efi/efidisk.c:729 #, c-format msgid "d%d" msgstr "" -#: grub-core/disk/geli.c:103 +#: VasEBoot-core/disk/geli.c:103 msgid "GEOM::ELI" msgstr "" -#: grub-core/disk/geli.c:127 +#: VasEBoot-core/disk/geli.c:127 msgid "des" msgstr "" -#: grub-core/disk/geli.c:128 +#: VasEBoot-core/disk/geli.c:128 msgid "3des" msgstr "" -#: grub-core/disk/geli.c:129 +#: VasEBoot-core/disk/geli.c:129 msgid "blowfish" msgstr "" -#: grub-core/disk/geli.c:130 +#: VasEBoot-core/disk/geli.c:130 msgid "cast5" msgstr "" -#: grub-core/disk/geli.c:132 grub-core/disk/geli.c:135 +#: VasEBoot-core/disk/geli.c:132 VasEBoot-core/disk/geli.c:135 msgid "aes" msgstr "" -#: grub-core/disk/geli.c:134 +#: VasEBoot-core/disk/geli.c:134 msgid "camellia128" msgstr "" -#: grub-core/disk/i386/pc/biosdisk.c:281 +#: VasEBoot-core/disk/i386/pc/biosdisk.c:281 msgid "cd" msgstr "" -#: grub-core/disk/ieee1275/nand.c:84 grub-core/disk/ieee1275/nand.c:85 +#: VasEBoot-core/disk/ieee1275/nand.c:84 VasEBoot-core/disk/ieee1275/nand.c:85 msgid "nand/" msgstr "" -#: grub-core/disk/ieee1275/nand.c:105 grub-core/disk/ieee1275/ofdisk.c:597 +#: VasEBoot-core/disk/ieee1275/nand.c:105 VasEBoot-core/disk/ieee1275/ofdisk.c:597 msgid "block-size" msgstr "" -#: grub-core/disk/ieee1275/nand.c:173 +#: VasEBoot-core/disk/ieee1275/nand.c:173 msgid "pio-read" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:162 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:162 msgid "vscsi" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:182 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:182 msgid "vscsi-report-luns" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:205 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:205 msgid "/disk@%" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:215 grub-core/disk/ieee1275/ofdisk.c:235 -#: grub-core/disk/ieee1275/ofdisk.c:370 grub-core/kern/ieee1275/openfw.c:422 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:215 VasEBoot-core/disk/ieee1275/ofdisk.c:235 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:370 VasEBoot-core/kern/ieee1275/openfw.c:422 msgid "block" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:281 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:281 msgid "sdmmc" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:292 grub-core/disk/ieee1275/ofdisk.c:295 -#: grub-core/disk/ieee1275/ofdisk.c:347 grub-core/disk/ieee1275/ofdisk.c:350 -#: grub-core/kern/ieee1275/openfw.c:482 grub-core/kern/ieee1275/openfw.c:492 -#: grub-core/term/ieee1275/serial.c:233 grub-core/term/ieee1275/serial.c:238 -#: grub-core/term/serial.c:156 grub-core/term/serial.c:158 -#: util/grub-probe.c:500 util/grub-probe.c:502 util/grub-probe.c:617 -#: util/grub-probe.c:619 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:292 VasEBoot-core/disk/ieee1275/ofdisk.c:295 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:347 VasEBoot-core/disk/ieee1275/ofdisk.c:350 +#: VasEBoot-core/kern/ieee1275/openfw.c:482 VasEBoot-core/kern/ieee1275/openfw.c:492 +#: VasEBoot-core/term/ieee1275/serial.c:233 VasEBoot-core/term/ieee1275/serial.c:238 +#: VasEBoot-core/term/serial.c:156 VasEBoot-core/term/serial.c:158 +#: util/VasEBoot-probe.c:500 util/VasEBoot-probe.c:502 util/VasEBoot-probe.c:617 +#: util/VasEBoot-probe.c:619 msgid "ieee1275/" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:541 grub-core/kern/ieee1275/init.c:115 -#: grub-core/net/drivers/ieee1275/ofnet.c:207 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:541 VasEBoot-core/kern/ieee1275/init.c:115 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:207 msgid "network" msgstr "" -#: grub-core/disk/ldm.c:53 +#: VasEBoot-core/disk/ldm.c:53 msgid "VBLK" msgstr "" -#: grub-core/disk/ldm.c:89 +#: VasEBoot-core/disk/ldm.c:89 msgid "PRIVHEAD" msgstr "" -#: grub-core/disk/ldm.c:362 +#: VasEBoot-core/disk/ldm.c:362 #, c-format msgid "ldm/%s/%s" msgstr "" -#: grub-core/disk/ldm.c:1004 +#: VasEBoot-core/disk/ldm.c:1004 msgid "Volume5" msgstr "" -#: grub-core/disk/luks.c:40 +#: VasEBoot-core/disk/luks.c:40 msgid "LUKS" msgstr "" -#: grub-core/disk/luks.c:150 +#: VasEBoot-core/disk/luks.c:150 msgid "ecb" msgstr "" -#: grub-core/disk/luks.c:156 grub-core/disk/luks.c:218 +#: VasEBoot-core/disk/luks.c:156 VasEBoot-core/disk/luks.c:218 msgid "plain" msgstr "" -#: grub-core/disk/luks.c:162 grub-core/disk/luks.c:165 +#: VasEBoot-core/disk/luks.c:162 VasEBoot-core/disk/luks.c:165 msgid "cbc-" msgstr "" -#: grub-core/disk/luks.c:167 grub-core/disk/luks.c:170 +#: VasEBoot-core/disk/luks.c:167 VasEBoot-core/disk/luks.c:170 msgid "pcbc-" msgstr "" -#: grub-core/disk/luks.c:172 grub-core/disk/luks.c:175 +#: VasEBoot-core/disk/luks.c:172 VasEBoot-core/disk/luks.c:175 msgid "xts-" msgstr "" -#: grub-core/disk/luks.c:197 grub-core/disk/luks.c:200 +#: VasEBoot-core/disk/luks.c:197 VasEBoot-core/disk/luks.c:200 msgid "lrw-" msgstr "" -#: grub-core/disk/luks.c:220 +#: VasEBoot-core/disk/luks.c:220 msgid "plain64" msgstr "" -#: grub-core/disk/luks.c:222 +#: VasEBoot-core/disk/luks.c:222 msgid "benbi" msgstr "" -#: grub-core/disk/luks.c:233 +#: VasEBoot-core/disk/luks.c:233 msgid "null" msgstr "" -#: grub-core/disk/luks.c:235 +#: VasEBoot-core/disk/luks.c:235 msgid "essiv:" msgstr "" -#: grub-core/disk/luks.c:40 +#: VasEBoot-core/disk/luks.c:40 msgid "LUKS" msgstr "" -#: grub-core/disk/mdraid_linux.c:250 +#: VasEBoot-core/disk/mdraid_linux.c:250 #, c-format msgid "md%d" msgstr "" -#: grub-core/disk/mdraid_linux.c:263 +#: VasEBoot-core/disk/mdraid_linux.c:263 msgid "mdraid09_be" msgstr "" -#: grub-core/disk/memdisk.c:49 +#: VasEBoot-core/disk/memdisk.c:49 msgid "mdsk" msgstr "" -#: grub-core/disk/scsi.c:459 +#: VasEBoot-core/disk/scsi.c:459 #, c-format msgid "%s%d%c" msgstr "" -#: grub-core/efiemu/i386/coredetect.c:43 grub-core/efiemu/i386/coredetect.c:50 -#: grub-core/efiemu/i386/coredetect.c:55 grub-core/efiemu/i386/coredetect.c:58 +#: VasEBoot-core/efiemu/i386/coredetect.c:43 VasEBoot-core/efiemu/i386/coredetect.c:50 +#: VasEBoot-core/efiemu/i386/coredetect.c:55 VasEBoot-core/efiemu/i386/coredetect.c:58 msgid "efiemu32.o" msgstr "" -#: grub-core/efiemu/i386/coredetect.c:58 +#: VasEBoot-core/efiemu/i386/coredetect.c:58 msgid "efiemu64.o" msgstr "" -#: grub-core/efiemu/i386/pc/cfgtables.c:63 +#: VasEBoot-core/efiemu/i386/pc/cfgtables.c:63 msgid "_SM_" msgstr "" -#: grub-core/efiemu/loadcore.c:166 grub-core/efiemu/runtime/efiemu.c:52 +#: VasEBoot-core/efiemu/loadcore.c:166 VasEBoot-core/efiemu/runtime/efiemu.c:52 msgid ".text-physical" msgstr "" -#: grub-core/efiemu/main.c:239 +#: VasEBoot-core/efiemu/main.c:239 #, c-format msgid "/%s" msgstr "" -#: grub-core/efiemu/pnvram.c:129 grub-core/efiemu/pnvram.c:130 -#: grub-core/efiemu/pnvram.c:133 +#: VasEBoot-core/efiemu/pnvram.c:129 VasEBoot-core/efiemu/pnvram.c:130 +#: VasEBoot-core/efiemu/pnvram.c:133 msgid "EfiEmu.pnvram." msgstr "" -#: grub-core/efiemu/runtime/efiemu.c:50 +#: VasEBoot-core/efiemu/runtime/efiemu.c:50 msgid "_text-physical, _text-physical" msgstr "" -#: grub-core/efiemu/runtime/efiemu.c:116 +#: VasEBoot-core/efiemu/runtime/efiemu.c:116 msgid "EFIEMULOG" msgstr "" -#: grub-core/fs/affs.c:205 +#: VasEBoot-core/fs/affs.c:205 msgid "DOS" msgstr "" -#: grub-core/fs/bfs.c:1096 +#: VasEBoot-core/fs/bfs.c:1096 msgid "be:volume_id" msgstr "" -#: grub-core/fs/bfs.c:1099 +#: VasEBoot-core/fs/bfs.c:1099 msgid "%016" msgstr "" -#: grub-core/fs/btrfs.c:34 +#: VasEBoot-core/fs/btrfs.c:34 msgid "_BHRfS_M" msgstr "" -#: grub-core/fs/btrfs.c:414 grub-core/fs/btrfs.c:446 grub-core/fs/btrfs.c:499 +#: VasEBoot-core/fs/btrfs.c:414 VasEBoot-core/fs/btrfs.c:446 VasEBoot-core/fs/btrfs.c:499 msgid " %x %" msgstr "" -#: grub-core/fs/btrfs.c:663 grub-core/loader/i386/pc/plan9.c:211 +#: VasEBoot-core/fs/btrfs.c:663 VasEBoot-core/loader/i386/pc/plan9.c:211 msgid " %" msgstr "" -#: grub-core/fs/btrfs.c:663 +#: VasEBoot-core/fs/btrfs.c:663 msgid " \n" msgstr "" -#: grub-core/fs/btrfs.c:718 grub-core/fs/btrfs.c:813 grub-core/fs/btrfs.c:1074 +#: VasEBoot-core/fs/btrfs.c:718 VasEBoot-core/fs/btrfs.c:813 VasEBoot-core/fs/btrfs.c:1074 msgid "+0x%" msgstr "" -#: grub-core/fs/cpio.c:36 +#: VasEBoot-core/fs/cpio.c:36 msgid "070707" msgstr "" -#: grub-core/fs/cpio.c:53 grub-core/loader/linux.c:66 +#: VasEBoot-core/fs/cpio.c:53 VasEBoot-core/loader/linux.c:66 msgid "070701" msgstr "" -#: grub-core/fs/cpio.c:54 +#: VasEBoot-core/fs/cpio.c:54 msgid "070702" msgstr "" -#: grub-core/fs/cpio.c:76 +#: VasEBoot-core/fs/cpio.c:76 msgid "q" msgstr "" -#: grub-core/fs/cpio.c:78 +#: VasEBoot-core/fs/cpio.c:78 msgid "q" msgstr "" -#: grub-core/fs/cpio.c:96 +#: VasEBoot-core/fs/cpio.c:96 msgid "ustar" msgstr "" -#: grub-core/fs/cpio.c:246 grub-core/loader/linux.c:193 -#: grub-core/loader/linux.c:214 grub-core/loader/linux.c:268 -#: grub-core/loader/linux.c:290 +#: VasEBoot-core/fs/cpio.c:246 VasEBoot-core/loader/linux.c:193 +#: VasEBoot-core/loader/linux.c:214 VasEBoot-core/loader/linux.c:268 +#: VasEBoot-core/loader/linux.c:290 msgid "TRAILER!!!" msgstr "" -#: grub-core/fs/fat.c:245 +#: VasEBoot-core/fs/fat.c:245 msgid "EXFAT " msgstr "" -#: grub-core/fs/fat.c:1164 +#: VasEBoot-core/fs/fat.c:1164 #, c-format msgid "%04x-%04x" msgstr "" -#: grub-core/fs/hfsplus.c:1145 grub-core/fs/ntfs.c:1233 -#: grub-core/fs/zfs/zfs.c:3484 +#: VasEBoot-core/fs/hfsplus.c:1145 VasEBoot-core/fs/ntfs.c:1233 +#: VasEBoot-core/fs/zfs/zfs.c:3484 #, c-format msgid "%016llx" msgstr "" -#: grub-core/fs/iso9660.c:287 +#: VasEBoot-core/fs/iso9660.c:287 msgid "ST" msgstr "" -#: grub-core/fs/iso9660.c:291 +#: VasEBoot-core/fs/iso9660.c:291 msgid "CE" msgstr "" -#: grub-core/fs/iso9660.c:352 +#: VasEBoot-core/fs/iso9660.c:352 msgid "ER" msgstr "" -#: grub-core/fs/iso9660.c:402 +#: VasEBoot-core/fs/iso9660.c:402 msgid "SP" msgstr "" -#: grub-core/fs/iso9660.c:458 grub-core/fs/udf.c:96 +#: VasEBoot-core/fs/iso9660.c:458 VasEBoot-core/fs/udf.c:96 msgid "CD001" msgstr "" -#: grub-core/fs/iso9660.c:549 +#: VasEBoot-core/fs/iso9660.c:549 msgid "NM" msgstr "" -#: grub-core/fs/iso9660.c:586 +#: VasEBoot-core/fs/iso9660.c:586 msgid "PX" msgstr "" -#: grub-core/fs/iso9660.c:608 +#: VasEBoot-core/fs/iso9660.c:608 msgid "SL" msgstr "" -#: grub-core/fs/iso9660.c:632 +#: VasEBoot-core/fs/iso9660.c:632 msgid "./" msgstr "" -#: grub-core/fs/iso9660.c:636 +#: VasEBoot-core/fs/iso9660.c:636 msgid "../" msgstr "" -#: grub-core/fs/jfs.c:364 +#: VasEBoot-core/fs/jfs.c:364 msgid "JFS1" msgstr "" -#: grub-core/fs/minix.c:670 +#: VasEBoot-core/fs/minix.c:670 msgid "minix3_be" msgstr "" -#: grub-core/fs/minix.c:672 +#: VasEBoot-core/fs/minix.c:672 msgid "minix2_be" msgstr "" -#: grub-core/fs/minix.c:674 +#: VasEBoot-core/fs/minix.c:674 msgid "minix_be" msgstr "" -#: grub-core/fs/ntfs.c:483 +#: VasEBoot-core/fs/ntfs.c:483 msgid "ntfscomp" msgstr "" -#: grub-core/fs/ntfs.c:757 +#: VasEBoot-core/fs/ntfs.c:757 msgid "/??/" msgstr "" -#: grub-core/fs/ntfs.c:894 +#: VasEBoot-core/fs/ntfs.c:894 msgid "INDX" msgstr "" -#: grub-core/fs/ntfs.c:938 grub-core/loader/i386/pc/chainloader.c:93 +#: VasEBoot-core/fs/ntfs.c:938 VasEBoot-core/loader/i386/pc/chainloader.c:93 msgid "NTFS" msgstr "" -#: grub-core/fs/ntfs.c:1167 +#: VasEBoot-core/fs/ntfs.c:1167 msgid "/$Volume" msgstr "" -#: grub-core/fs/reiserfs.c:57 +#: VasEBoot-core/fs/reiserfs.c:57 msgid "ReIsEr" msgstr "" -#: grub-core/fs/reiserfs.c:58 +#: VasEBoot-core/fs/reiserfs.c:58 msgid "ReIsErLB" msgstr "" -#: grub-core/fs/romfs.c:32 +#: VasEBoot-core/fs/romfs.c:32 msgid "-rom1fs-" msgstr "" -#: grub-core/fs/sfs.c:377 +#: VasEBoot-core/fs/sfs.c:377 msgid "SFS" msgstr "" -#: grub-core/fs/udf.c:94 +#: VasEBoot-core/fs/udf.c:94 msgid "BEA01" msgstr "" -#: grub-core/fs/udf.c:95 +#: VasEBoot-core/fs/udf.c:95 msgid "BOOT2" msgstr "" -#: grub-core/fs/udf.c:97 +#: VasEBoot-core/fs/udf.c:97 msgid "CDW02" msgstr "" -#: grub-core/fs/udf.c:98 +#: VasEBoot-core/fs/udf.c:98 msgid "NSR02" msgstr "" -#: grub-core/fs/udf.c:99 +#: VasEBoot-core/fs/udf.c:99 msgid "NSR03" msgstr "" -#: grub-core/fs/udf.c:100 +#: VasEBoot-core/fs/udf.c:100 msgid "TEA01" msgstr "" -#: grub-core/fs/ufs.c:798 +#: VasEBoot-core/fs/ufs.c:798 #, c-format msgid "%08x%08x" msgstr "" -#: grub-core/fs/ufs.c:847 +#: VasEBoot-core/fs/ufs.c:847 msgid "ufs1_be" msgstr "" -#: grub-core/fs/xfs.c:271 +#: VasEBoot-core/fs/xfs.c:271 msgid "IN" msgstr "" -#: grub-core/fs/xfs.c:325 +#: VasEBoot-core/fs/xfs.c:325 msgid "BMAP" msgstr "" -#: grub-core/fs/xfs.c:674 +#: VasEBoot-core/fs/xfs.c:674 msgid "XFSB" msgstr "" -#: grub-core/fs/zfs/zfs.c:60 +#: VasEBoot-core/fs/zfs/zfs.c:60 msgid "bootfs" msgstr "" -#: grub-core/fs/zfs/zfs.c:318 grub-core/fs/zfs/zfs.c:367 -#: grub-core/gfxmenu/gui_list.c:432 grub-core/gfxmenu/gui_list.c:443 +#: VasEBoot-core/fs/zfs/zfs.c:318 VasEBoot-core/fs/zfs/zfs.c:367 +#: VasEBoot-core/gfxmenu/gui_list.c:432 VasEBoot-core/gfxmenu/gui_list.c:443 msgid "inherit" msgstr "" -#: grub-core/fs/zfs/zfs.c:319 grub-core/fs/zfs/zfs.c:368 +#: VasEBoot-core/fs/zfs/zfs.c:319 VasEBoot-core/fs/zfs/zfs.c:368 msgid "on" msgstr "" -#: grub-core/fs/zfs/zfs.c:320 grub-core/fs/zfs/zfs.c:369 -#: grub-core/loader/ia64/efi/linux.c:429 +#: VasEBoot-core/fs/zfs/zfs.c:320 VasEBoot-core/fs/zfs/zfs.c:369 +#: VasEBoot-core/loader/ia64/efi/linux.c:429 msgid "off" msgstr "" -#: grub-core/fs/zfs/zfs.c:321 +#: VasEBoot-core/fs/zfs/zfs.c:321 msgid "lzjb" msgstr "" -#: grub-core/fs/zfs/zfs.c:322 +#: VasEBoot-core/fs/zfs/zfs.c:322 msgid "empty" msgstr "" -#: grub-core/fs/zfs/zfs.c:323 +#: VasEBoot-core/fs/zfs/zfs.c:323 msgid "gzip-1" msgstr "" -#: grub-core/fs/zfs/zfs.c:324 +#: VasEBoot-core/fs/zfs/zfs.c:324 msgid "gzip-2" msgstr "" -#: grub-core/fs/zfs/zfs.c:325 +#: VasEBoot-core/fs/zfs/zfs.c:325 msgid "gzip-3" msgstr "" -#: grub-core/fs/zfs/zfs.c:326 +#: VasEBoot-core/fs/zfs/zfs.c:326 msgid "gzip-4" msgstr "" -#: grub-core/fs/zfs/zfs.c:327 +#: VasEBoot-core/fs/zfs/zfs.c:327 msgid "gzip-5" msgstr "" -#: grub-core/fs/zfs/zfs.c:328 +#: VasEBoot-core/fs/zfs/zfs.c:328 msgid "gzip-6" msgstr "" -#: grub-core/fs/zfs/zfs.c:329 +#: VasEBoot-core/fs/zfs/zfs.c:329 msgid "gzip-7" msgstr "" -#: grub-core/fs/zfs/zfs.c:330 +#: VasEBoot-core/fs/zfs/zfs.c:330 msgid "gzip-8" msgstr "" -#: grub-core/fs/zfs/zfs.c:331 +#: VasEBoot-core/fs/zfs/zfs.c:331 msgid "gzip-9" msgstr "" -#: grub-core/fs/zfs/zfs.c:332 +#: VasEBoot-core/fs/zfs/zfs.c:332 msgid "zle" msgstr "" -#: grub-core/fs/zfs/zfs.c:371 +#: VasEBoot-core/fs/zfs/zfs.c:371 msgid "gang_header" msgstr "" -#: grub-core/fs/zfs/zfs.c:372 +#: VasEBoot-core/fs/zfs/zfs.c:372 msgid "zilog" msgstr "" -#: grub-core/fs/zfs/zfs.c:373 +#: VasEBoot-core/fs/zfs/zfs.c:373 msgid "fletcher2" msgstr "" -#: grub-core/fs/zfs/zfs.c:374 +#: VasEBoot-core/fs/zfs/zfs.c:374 msgid "fletcher4" msgstr "" -#: grub-core/fs/zfs/zfs.c:375 grub-core/lib/xzembed/xz_dec_stream.c:445 +#: VasEBoot-core/fs/zfs/zfs.c:375 VasEBoot-core/lib/xzembed/xz_dec_stream.c:445 msgid "SHA256" msgstr "" -#: grub-core/fs/zfs/zfs.c:376 +#: VasEBoot-core/fs/zfs/zfs.c:376 msgid "zilog2" msgstr "" -#: grub-core/fs/zfs/zfs.c:377 +#: VasEBoot-core/fs/zfs/zfs.c:377 msgid "SHA256+MAC" msgstr "" -#: grub-core/fs/zfs/zfs.c:623 grub-core/loader/i386/xnu.c:776 +#: VasEBoot-core/fs/zfs/zfs.c:623 VasEBoot-core/loader/i386/xnu.c:776 msgid "guid" msgstr "" -#: grub-core/fs/zfs/zfs.c:631 +#: VasEBoot-core/fs/zfs/zfs.c:631 msgid "ashift" msgstr "" -#: grub-core/fs/zfs/zfs.c:677 +#: VasEBoot-core/fs/zfs/zfs.c:677 msgid "nparity" msgstr "" -#: grub-core/fs/zfs/zfs.c:1305 +#: VasEBoot-core/fs/zfs/zfs.c:1305 msgid "+%u (%" msgstr "" -#: grub-core/fs/zfs/zfs.c:1305 +#: VasEBoot-core/fs/zfs/zfs.c:1305 msgid ", %" msgstr "" -#: grub-core/fs/zfs/zfs.c:1306 +#: VasEBoot-core/fs/zfs/zfs.c:1306 msgid ") -> (0x%" msgstr "" -#: grub-core/fs/zfs/zfs.c:1306 grub-core/kern/mm.c:594 +#: VasEBoot-core/fs/zfs/zfs.c:1306 VasEBoot-core/kern/mm.c:594 msgid ", 0x%" msgstr "" -#: grub-core/fs/zfs/zfs.c:1637 +#: VasEBoot-core/fs/zfs/zfs.c:1637 msgid "zfscrypt" msgstr "" -#: grub-core/fs/zfs/zfs.c:2464 +#: VasEBoot-core/fs/zfs/zfs.c:2464 msgid "casesensitivity" msgstr "" -#: grub-core/fs/zfs/zfs.c:3940 grub-core/script/execute.c:255 -#: grub-core/script/execute.c:317 +#: VasEBoot-core/fs/zfs/zfs.c:3940 VasEBoot-core/script/execute.c:255 +#: VasEBoot-core/script/execute.c:317 msgid "@" msgstr "" -#: grub-core/gdb/cstub.c:281 grub-core/gdb/cstub.c:293 -#: grub-core/gdb/cstub.c:299 grub-core/gdb/cstub.c:327 +#: VasEBoot-core/gdb/cstub.c:281 VasEBoot-core/gdb/cstub.c:293 +#: VasEBoot-core/gdb/cstub.c:299 VasEBoot-core/gdb/cstub.c:327 msgid "OK" msgstr "" -#: grub-core/gdb/cstub.c:315 +#: VasEBoot-core/gdb/cstub.c:315 msgid "E01" msgstr "" -#: grub-core/gdb/cstub.c:332 +#: VasEBoot-core/gdb/cstub.c:332 msgid "E02" msgstr "" -#: grub-core/gdb/i386/idt.c:64 grub-core/gdb/i386/idt.c:65 -#: grub-core/gdb/i386/idt.c:71 +#: VasEBoot-core/gdb/i386/idt.c:64 VasEBoot-core/gdb/i386/idt.c:65 +#: VasEBoot-core/gdb/i386/idt.c:71 msgid "m" msgstr "" -#: grub-core/gettext/gettext.c:353 +#: VasEBoot-core/gettext/gettext.c:353 #, c-format msgid "%s%s/%s.mo" msgstr "" -#: grub-core/gettext/gettext.c:364 +#: VasEBoot-core/gettext/gettext.c:364 #, c-format msgid "%s%s/%s.mo.gz" msgstr "" -#: grub-core/gettext/gettext.c:375 +#: VasEBoot-core/gettext/gettext.c:375 #, c-format msgid "%s%s/%s.gmo" msgstr "" -#: grub-core/gettext/gettext.c:403 +#: VasEBoot-core/gettext/gettext.c:403 msgid "/locale" msgstr "" -#: grub-core/gfxmenu/gfxmenu.c:78 +#: VasEBoot-core/gfxmenu/gfxmenu.c:78 #, c-format msgid "%s/themes/%s" msgstr "" -#: grub-core/gfxmenu/gui_box.c:83 grub-core/gfxmenu/gui_canvas.c:75 -#: grub-core/gfxmenu/gui_circular_progress.c:71 -#: grub-core/gfxmenu/gui_image.c:65 grub-core/gfxmenu/gui_label.c:79 -#: grub-core/gfxmenu/gui_list.c:157 grub-core/gfxmenu/gui_progress_bar.c:79 +#: VasEBoot-core/gfxmenu/gui_box.c:83 VasEBoot-core/gfxmenu/gui_canvas.c:75 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:71 +#: VasEBoot-core/gfxmenu/gui_image.c:65 VasEBoot-core/gfxmenu/gui_label.c:79 +#: VasEBoot-core/gfxmenu/gui_list.c:157 VasEBoot-core/gfxmenu/gui_progress_bar.c:79 msgid "component" msgstr "" -#: grub-core/gfxmenu/gui_box.c:84 grub-core/gfxmenu/gui_canvas.c:76 -#: grub-core/gfxmenu/gui_util.c:44 grub-core/gfxmenu/gui_util.c:82 -#: grub-core/gfxmenu/theme_loader.c:503 +#: VasEBoot-core/gfxmenu/gui_box.c:84 VasEBoot-core/gfxmenu/gui_canvas.c:76 +#: VasEBoot-core/gfxmenu/gui_util.c:44 VasEBoot-core/gfxmenu/gui_util.c:82 +#: VasEBoot-core/gfxmenu/theme_loader.c:503 msgid "container" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:237 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:237 msgid "deg" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:249 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:249 msgid "num_ticks" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:253 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:253 msgid "start_angle" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:257 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:257 msgid "ticks_disappear" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:261 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:261 msgid "center_bitmap" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:267 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:267 msgid "tick_bitmap" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:273 -#: grub-core/gfxmenu/gui_image.c:210 grub-core/gfxmenu/gui_list.c:520 -#: grub-core/gfxmenu/gui_progress_bar.c:339 -#: grub-core/gfxmenu/theme_loader.c:458 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:273 +#: VasEBoot-core/gfxmenu/gui_image.c:210 VasEBoot-core/gfxmenu/gui_list.c:520 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:339 +#: VasEBoot-core/gfxmenu/theme_loader.c:458 msgid "theme_dir" msgstr "" -#: grub-core/gfxmenu/gui_label.c:30 +#: VasEBoot-core/gfxmenu/gui_label.c:30 msgid "center" msgstr "" -#: grub-core/gfxmenu/gui_label.c:164 grub-core/hook/datehook.c:81 -#: grub-core/kern/emu/hostdisk.c:713 grub-core/kern/ieee1275/openfw.c:509 -#: grub-core/kern/partition.c:265 grub-core/normal/menu.c:111 -#: grub-core/script/execute.c:801 grub-core/script/execute.c:956 -#: grub-core/script/execute.c:1004 grub-core/term/tparm.c:544 +#: VasEBoot-core/gfxmenu/gui_label.c:164 VasEBoot-core/hook/datehook.c:81 +#: VasEBoot-core/kern/emu/hostdisk.c:713 VasEBoot-core/kern/ieee1275/openfw.c:509 +#: VasEBoot-core/kern/partition.c:265 VasEBoot-core/normal/menu.c:111 +#: VasEBoot-core/script/execute.c:801 VasEBoot-core/script/execute.c:956 +#: VasEBoot-core/script/execute.c:1004 VasEBoot-core/term/tparm.c:544 #, c-format msgid "%d" msgstr "" -#: grub-core/gfxmenu/gui_label.c:182 +#: VasEBoot-core/gfxmenu/gui_label.c:182 msgid "@KEYMAP_LONG@" msgstr "" -#: grub-core/gfxmenu/gui_label.c:186 +#: VasEBoot-core/gfxmenu/gui_label.c:186 msgid "@KEYMAP_MIDDLE@" msgstr "" -#: grub-core/gfxmenu/gui_label.c:190 +#: VasEBoot-core/gfxmenu/gui_label.c:190 msgid "@KEYMAP_SHORT@" msgstr "" -#: grub-core/gfxmenu/gui_label.c:205 +#: VasEBoot-core/gfxmenu/gui_label.c:205 msgid "align" msgstr "" -#: grub-core/gfxmenu/gui_label.c:217 grub-core/gfxmenu/gui_list.c:484 +#: VasEBoot-core/gfxmenu/gui_label.c:217 VasEBoot-core/gfxmenu/gui_list.c:484 msgid "visible" msgstr "" -#: grub-core/gfxmenu/gui_list.c:401 grub-core/gfxmenu/gui_list.c:403 +#: VasEBoot-core/gfxmenu/gui_list.c:401 VasEBoot-core/gfxmenu/gui_list.c:403 msgid "Typical OS" msgstr "" -#: grub-core/gfxmenu/gui_list.c:426 +#: VasEBoot-core/gfxmenu/gui_list.c:426 msgid "item_font" msgstr "" -#: grub-core/gfxmenu/gui_list.c:430 +#: VasEBoot-core/gfxmenu/gui_list.c:430 msgid "selected_item_font" msgstr "" -#: grub-core/gfxmenu/gui_list.c:437 +#: VasEBoot-core/gfxmenu/gui_list.c:437 msgid "item_color" msgstr "" -#: grub-core/gfxmenu/gui_list.c:441 +#: VasEBoot-core/gfxmenu/gui_list.c:441 msgid "selected_item_color" msgstr "" -#: grub-core/gfxmenu/gui_list.c:454 +#: VasEBoot-core/gfxmenu/gui_list.c:454 msgid "icon_width" msgstr "" -#: grub-core/gfxmenu/gui_list.c:461 +#: VasEBoot-core/gfxmenu/gui_list.c:461 msgid "icon_height" msgstr "" -#: grub-core/gfxmenu/gui_list.c:468 +#: VasEBoot-core/gfxmenu/gui_list.c:468 msgid "item_height" msgstr "" -#: grub-core/gfxmenu/gui_list.c:472 +#: VasEBoot-core/gfxmenu/gui_list.c:472 msgid "item_padding" msgstr "" -#: grub-core/gfxmenu/gui_list.c:476 +#: VasEBoot-core/gfxmenu/gui_list.c:476 msgid "item_icon_space" msgstr "" -#: grub-core/gfxmenu/gui_list.c:480 +#: VasEBoot-core/gfxmenu/gui_list.c:480 msgid "item_spacing" msgstr "" -#: grub-core/gfxmenu/gui_list.c:488 +#: VasEBoot-core/gfxmenu/gui_list.c:488 msgid "menu_pixmap_style" msgstr "" -#: grub-core/gfxmenu/gui_list.c:494 +#: VasEBoot-core/gfxmenu/gui_list.c:494 msgid "selected_item_pixmap_style" msgstr "" -#: grub-core/gfxmenu/gui_list.c:500 +#: VasEBoot-core/gfxmenu/gui_list.c:500 msgid "scrollbar_frame" msgstr "" -#: grub-core/gfxmenu/gui_list.c:506 +#: VasEBoot-core/gfxmenu/gui_list.c:506 msgid "scrollbar_thumb" msgstr "" -#: grub-core/gfxmenu/gui_list.c:512 +#: VasEBoot-core/gfxmenu/gui_list.c:512 msgid "scrollbar_width" msgstr "" -#: grub-core/gfxmenu/gui_list.c:516 +#: VasEBoot-core/gfxmenu/gui_list.c:516 msgid "scrollbar" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:259 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:259 msgid "XXXXXXXXXX" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:289 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:289 msgid "@TIMEOUT_NOTIFICATION_LONG@" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:292 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:292 msgid "@TIMEOUT_NOTIFICATION_MIDDLE@" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:297 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:297 msgid "@TIMEOUT_NOTIFICATION_SHORT@" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:309 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:309 msgid "text_color" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:313 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:313 msgid "border_color" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:317 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:317 msgid "bg_color" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:321 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:321 msgid "fg_color" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:325 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:325 msgid "bar_style" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:332 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:332 msgid "highlight_style" msgstr "" -#: grub-core/gfxmenu/icon_manager.c:32 grub-core/video/readers/png.c:948 +#: VasEBoot-core/gfxmenu/icon_manager.c:32 VasEBoot-core/video/readers/png.c:948 msgid ".png" msgstr "" -#: grub-core/gfxmenu/icon_manager.c:201 +#: VasEBoot-core/gfxmenu/icon_manager.c:201 msgid "icons/" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:126 +#: VasEBoot-core/gfxmenu/theme_loader.c:126 msgid "title-font" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:128 +#: VasEBoot-core/gfxmenu/theme_loader.c:128 msgid "message-font" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:130 +#: VasEBoot-core/gfxmenu/theme_loader.c:130 msgid "terminal-font" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:137 +#: VasEBoot-core/gfxmenu/theme_loader.c:137 msgid "title-color" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:139 +#: VasEBoot-core/gfxmenu/theme_loader.c:139 msgid "message-color" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:141 +#: VasEBoot-core/gfxmenu/theme_loader.c:141 msgid "message-bg-color" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:143 +#: VasEBoot-core/gfxmenu/theme_loader.c:143 msgid "desktop-image" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:172 +#: VasEBoot-core/gfxmenu/theme_loader.c:172 msgid "desktop-color" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:174 +#: VasEBoot-core/gfxmenu/theme_loader.c:174 msgid "terminal-box" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:181 +#: VasEBoot-core/gfxmenu/theme_loader.c:181 msgid "title-text" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:418 +#: VasEBoot-core/gfxmenu/theme_loader.c:418 msgid "image" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:422 +#: VasEBoot-core/gfxmenu/theme_loader.c:422 msgid "vbox" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:426 +#: VasEBoot-core/gfxmenu/theme_loader.c:426 msgid "hbox" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:430 +#: VasEBoot-core/gfxmenu/theme_loader.c:430 msgid "canvas" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:434 +#: VasEBoot-core/gfxmenu/theme_loader.c:434 msgid "progress_bar" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:438 +#: VasEBoot-core/gfxmenu/theme_loader.c:438 msgid "circular_progress" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:442 +#: VasEBoot-core/gfxmenu/theme_loader.c:442 msgid "boot_menu" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:459 +#: VasEBoot-core/gfxmenu/theme_loader.c:459 msgid "theme_path" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:552 +#: VasEBoot-core/gfxmenu/theme_loader.c:552 msgid "top" msgstr "" -#: grub-core/gfxmenu/view.c:82 +#: VasEBoot-core/gfxmenu/view.c:82 msgid "Fixed 10" msgstr "" -#: grub-core/gfxmenu/widget-box.c:38 +#: VasEBoot-core/gfxmenu/widget-box.c:38 msgid "nw" msgstr "" -#: grub-core/gfxmenu/widget-box.c:38 +#: VasEBoot-core/gfxmenu/widget-box.c:38 msgid "ne" msgstr "" -#: grub-core/gfxmenu/widget-box.c:38 +#: VasEBoot-core/gfxmenu/widget-box.c:38 msgid "se" msgstr "" -#: grub-core/gfxmenu/widget-box.c:38 +#: VasEBoot-core/gfxmenu/widget-box.c:38 msgid "sw" msgstr "" -#: grub-core/gfxmenu/widget-box.c:40 +#: VasEBoot-core/gfxmenu/widget-box.c:40 msgid "n" msgstr "" -#: grub-core/gfxmenu/widget-box.c:40 +#: VasEBoot-core/gfxmenu/widget-box.c:40 msgid "e" msgstr "" -#: grub-core/gfxmenu/widget-box.c:40 +#: VasEBoot-core/gfxmenu/widget-box.c:40 msgid "s" msgstr "" -#: grub-core/gfxmenu/widget-box.c:40 util/grub-menulst2cfg.c:61 +#: VasEBoot-core/gfxmenu/widget-box.c:40 util/VasEBoot-menulst2cfg.c:61 msgid "w" msgstr "" -#: grub-core/hook/datehook.c:31 +#: VasEBoot-core/hook/datehook.c:31 msgid "YEAR" msgstr "" -#: grub-core/hook/datehook.c:32 +#: VasEBoot-core/hook/datehook.c:32 msgid "MONTH" msgstr "" -#: grub-core/hook/datehook.c:33 +#: VasEBoot-core/hook/datehook.c:33 msgid "DAY" msgstr "" -#: grub-core/hook/datehook.c:34 +#: VasEBoot-core/hook/datehook.c:34 msgid "HOUR" msgstr "" -#: grub-core/hook/datehook.c:35 +#: VasEBoot-core/hook/datehook.c:35 msgid "MINUTE" msgstr "" -#: grub-core/hook/datehook.c:36 +#: VasEBoot-core/hook/datehook.c:36 msgid "SECOND" msgstr "" -#: grub-core/hook/datehook.c:37 +#: VasEBoot-core/hook/datehook.c:37 msgid "WEEKDAY" msgstr "" -#: grub-core/kern/dl.c:412 -msgid "grub_mod_init" +#: VasEBoot-core/kern/dl.c:412 +msgid "VasEBoot_mod_init" msgstr "" -#: grub-core/kern/dl.c:414 -msgid "grub_mod_fini" +#: VasEBoot-core/kern/dl.c:414 +msgid "VasEBoot_mod_fini" msgstr "" -#: grub-core/kern/dl.c:457 +#: VasEBoot-core/kern/dl.c:457 msgid ".module_license" msgstr "" -#: grub-core/kern/dl.c:459 +#: VasEBoot-core/kern/dl.c:459 msgid "LICENSE=GPLv3" msgstr "" -#: grub-core/kern/dl.c:460 +#: VasEBoot-core/kern/dl.c:460 msgid "LICENSE=GPLv3+" msgstr "" -#: grub-core/kern/dl.c:461 +#: VasEBoot-core/kern/dl.c:461 msgid "LICENSE=GPLv2+" msgstr "" -#: grub-core/kern/dl.c:481 +#: VasEBoot-core/kern/dl.c:481 msgid ".modname" msgstr "" -#: grub-core/kern/dl.c:508 +#: VasEBoot-core/kern/dl.c:508 msgid ".moddeps" msgstr "" -#: grub-core/kern/emu/hostdisk.c:147 +#: VasEBoot-core/kern/emu/hostdisk.c:147 msgid "/dev/.devfsd" msgstr "" -#: grub-core/kern/emu/hostdisk.c:460 +#: VasEBoot-core/kern/emu/hostdisk.c:460 msgid "linear" msgstr "" -#: grub-core/kern/emu/hostdisk.c:539 +#: VasEBoot-core/kern/emu/hostdisk.c:539 msgid "part" msgstr "" -#: grub-core/kern/emu/hostdisk.c:561 util/grub-mkimagexx.c:131 +#: VasEBoot-core/kern/emu/hostdisk.c:561 util/VasEBoot-mkimagexx.c:131 msgid "start" msgstr "" -#: grub-core/kern/emu/hostdisk.c:579 grub-core/kern/emu/hostdisk.c:581 -#: grub-core/kern/emu/hostdisk.c:877 +#: VasEBoot-core/kern/emu/hostdisk.c:579 VasEBoot-core/kern/emu/hostdisk.c:581 +#: VasEBoot-core/kern/emu/hostdisk.c:877 msgid "/dev/" msgstr "" -#: grub-core/kern/emu/hostdisk.c:694 +#: VasEBoot-core/kern/emu/hostdisk.c:694 msgid "/disc" msgstr "" -#: grub-core/kern/emu/hostdisk.c:697 +#: VasEBoot-core/kern/emu/hostdisk.c:697 #, c-format msgid "part%d" msgstr "" -#: grub-core/kern/emu/hostdisk.c:699 grub-core/kern/emu/hostdisk.c:700 +#: VasEBoot-core/kern/emu/hostdisk.c:699 VasEBoot-core/kern/emu/hostdisk.c:700 msgid "/dev/disk/by-id/" msgstr "" -#: grub-core/kern/emu/hostdisk.c:703 +#: VasEBoot-core/kern/emu/hostdisk.c:703 #, c-format msgid "-part%d" msgstr "" -#: grub-core/kern/emu/hostdisk.c:708 +#: VasEBoot-core/kern/emu/hostdisk.c:708 #, c-format msgid "p%d" msgstr "" -#: grub-core/kern/emu/hostdisk.c:833 grub-core/kern/emu/hostdisk.c:834 -#: grub-core/kern/emu/hostdisk.c:835 grub-core/kern/emu/hostdisk.c:1347 -#: grub-core/kern/emu/hostdisk.c:1348 grub-core/kern/emu/hostdisk.c:1349 +#: VasEBoot-core/kern/emu/hostdisk.c:833 VasEBoot-core/kern/emu/hostdisk.c:834 +#: VasEBoot-core/kern/emu/hostdisk.c:835 VasEBoot-core/kern/emu/hostdisk.c:1347 +#: VasEBoot-core/kern/emu/hostdisk.c:1348 VasEBoot-core/kern/emu/hostdisk.c:1349 msgid "hostdisk/" msgstr "" -#: grub-core/kern/emu/hostdisk.c:954 grub-core/kern/emu/hostdisk.c:961 -#: grub-core/kern/emu/hostdisk.c:1003 +#: VasEBoot-core/kern/emu/hostdisk.c:954 VasEBoot-core/kern/emu/hostdisk.c:961 +#: VasEBoot-core/kern/emu/hostdisk.c:1003 msgid "kern.geom.debugflags" msgstr "" -#: grub-core/kern/emu/hostdisk.c:1250 grub-core/kern/emu/hostdisk.c:1257 -#: grub-core/kern/emu/hostdisk.c:1265 grub-core/kern/emu/hostdisk.c:1310 +#: VasEBoot-core/kern/emu/hostdisk.c:1250 VasEBoot-core/kern/emu/hostdisk.c:1257 +#: VasEBoot-core/kern/emu/hostdisk.c:1265 VasEBoot-core/kern/emu/hostdisk.c:1310 #, c-format msgid "%s:%d: %s" msgstr "" -#: grub-core/kern/emu/hostdisk.c:1335 include/grub/util/lvm.h:26 +#: VasEBoot-core/kern/emu/hostdisk.c:1335 include/VasEBoot/util/lvm.h:26 msgid "/dev/mapper/" msgstr "" -#: grub-core/kern/emu/misc.c:78 grub-core/kern/emu/misc.c:94 -#: grub-core/kern/emu/misc.c:109 +#: VasEBoot-core/kern/emu/misc.c:78 VasEBoot-core/kern/emu/misc.c:94 +#: VasEBoot-core/kern/emu/misc.c:109 #, c-format msgid ".\n" msgstr "" -#: grub-core/kern/i386/coreboot/mmap.c:29 +#: VasEBoot-core/kern/i386/coreboot/mmap.c:29 msgid "LBIO" msgstr "" -#: grub-core/kern/i386/pc/init.c:91 +#: VasEBoot-core/kern/i386/pc/init.c:91 #, c-format msgid "%cd%u" msgstr "" -#: grub-core/kern/i386/pc/init.c:97 grub-core/kern/i386/pc/init.c:101 +#: VasEBoot-core/kern/i386/pc/init.c:97 VasEBoot-core/kern/i386/pc/init.c:101 #, c-format msgid ",%u" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:66 grub-core/term/ieee1275/console.c:107 +#: VasEBoot-core/kern/ieee1275/cmain.c:66 VasEBoot-core/term/ieee1275/console.c:107 msgid "/options" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:67 +#: VasEBoot-core/kern/ieee1275/cmain.c:67 msgid "/openprom" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:76 grub-core/kern/ieee1275/cmain.c:77 +#: VasEBoot-core/kern/ieee1275/cmain.c:76 VasEBoot-core/kern/ieee1275/cmain.c:77 msgid "SmartFirmware(tm)" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:82 +#: VasEBoot-core/kern/ieee1275/cmain.c:82 msgid "OLPC" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:87 +#: VasEBoot-core/kern/ieee1275/cmain.c:87 msgid "Emulated PC" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:90 +#: VasEBoot-core/kern/ieee1275/cmain.c:90 msgid "IBM" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:101 +#: VasEBoot-core/kern/ieee1275/cmain.c:101 msgid "PowerBook3,3" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:111 grub-core/kern/ieee1275/cmain.c:112 -#: grub-core/kern/ieee1275/cmain.c:113 +#: VasEBoot-core/kern/ieee1275/cmain.c:111 VasEBoot-core/kern/ieee1275/cmain.c:112 +#: VasEBoot-core/kern/ieee1275/cmain.c:113 msgid "MacRISC" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:145 +#: VasEBoot-core/kern/ieee1275/cmain.c:145 msgid "1.0" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:146 +#: VasEBoot-core/kern/ieee1275/cmain.c:146 msgid "1.1" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:147 +#: VasEBoot-core/kern/ieee1275/cmain.c:147 msgid "1.2" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:148 +#: VasEBoot-core/kern/ieee1275/cmain.c:148 msgid "1.3" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:189 +#: VasEBoot-core/kern/ieee1275/cmain.c:189 msgid "/rom/boot-rom" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:190 +#: VasEBoot-core/kern/ieee1275/cmain.c:190 msgid "/boot-rom" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:193 grub-core/kern/ieee1275/cmain.c:194 +#: VasEBoot-core/kern/ieee1275/cmain.c:193 VasEBoot-core/kern/ieee1275/cmain.c:194 msgid "PPC Open Hack'Ware" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:208 +#: VasEBoot-core/kern/ieee1275/cmain.c:208 msgid "/chosen" msgstr "" -#: grub-core/kern/ieee1275/ieee1275.c:581 +#: VasEBoot-core/kern/ieee1275/ieee1275.c:581 msgid "color!" msgstr "" -#: grub-core/kern/ieee1275/mmap.c:45 +#: VasEBoot-core/kern/ieee1275/mmap.c:45 msgid "/memory" msgstr "" -#: grub-core/kern/ieee1275/openfw.c:169 +#: VasEBoot-core/kern/ieee1275/openfw.c:169 msgid "/aliases" msgstr "" -#: grub-core/kern/ieee1275/openfw.c:410 +#: VasEBoot-core/kern/ieee1275/openfw.c:410 #, c-format msgid "\\%s" msgstr "" -#: grub-core/kern/ieee1275/openfw.c:483 +#: VasEBoot-core/kern/ieee1275/openfw.c:483 msgid ",XXXXXXXXXXXX" msgstr "" -#: grub-core/kern/ieee1275/openfw.c:509 +#: VasEBoot-core/kern/ieee1275/openfw.c:509 msgid "XXXXXXXXXXXX" msgstr "" -#: grub-core/kern/mips/dl.c:254 +#: VasEBoot-core/kern/mips/dl.c:254 msgid "__gnu_local_gp" msgstr "" -#: grub-core/kern/misc.c:172 +#: VasEBoot-core/kern/misc.c:172 #, c-format msgid "%s:%d: " msgstr "" -#: grub-core/kern/misc.c:919 +#: VasEBoot-core/kern/misc.c:919 msgid "0x" msgstr "" -#: grub-core/kern/misc.c:1018 +#: VasEBoot-core/kern/misc.c:1018 msgid "(null)" msgstr "" -#: grub-core/lib/backtrace.c:47 +#: VasEBoot-core/lib/backtrace.c:47 #, c-format msgid "%p" msgstr "" -#: grub-core/lib/crc64.c:100 grub-core/lib/xzembed/xz_dec_stream.c:444 +#: VasEBoot-core/lib/crc64.c:100 VasEBoot-core/lib/xzembed/xz_dec_stream.c:444 msgid "CRC64" msgstr "" -#: grub-core/lib/crypto.c:450 +#: VasEBoot-core/lib/crypto.c:450 msgid "/dev/tty" msgstr "" -#: grub-core/lib/crypto.c:450 +#: VasEBoot-core/lib/crypto.c:450 msgid "w+c" msgstr "" -#: grub-core/lib/i386/backtrace.c:60 grub-core/lib/i386/backtrace.c:63 -msgid "grub_backtrace_pointer" +#: VasEBoot-core/lib/i386/backtrace.c:60 VasEBoot-core/lib/i386/backtrace.c:63 +msgid "VasEBoot_backtrace_pointer" msgstr "" -#: grub-core/lib/ieee1275/cmos.c:41 +#: VasEBoot-core/lib/ieee1275/cmos.c:41 msgid "m5819" msgstr "" -#: grub-core/lib/ieee1275/datetime.c:37 +#: VasEBoot-core/lib/ieee1275/datetime.c:37 msgid "rtc" msgstr "" -#: grub-core/lib/ieee1275/datetime.c:87 +#: VasEBoot-core/lib/ieee1275/datetime.c:87 msgid "get-time" msgstr "" -#: grub-core/lib/ieee1275/datetime.c:139 +#: VasEBoot-core/lib/ieee1275/datetime.c:139 msgid "set-time" msgstr "" -#: grub-core/lib/ieee1275/halt.c:28 +#: VasEBoot-core/lib/ieee1275/halt.c:28 msgid "power-off" msgstr "" -#: grub-core/lib/ieee1275/halt.c:29 +#: VasEBoot-core/lib/ieee1275/halt.c:29 msgid "shut-down" msgstr "" -#: grub-core/lib/ieee1275/halt.c:30 +#: VasEBoot-core/lib/ieee1275/halt.c:30 msgid "poweroff" msgstr "" -#: grub-core/lib/ieee1275/reboot.c:25 +#: VasEBoot-core/lib/ieee1275/reboot.c:25 msgid "reset-all" msgstr "" -#: grub-core/lib/ieee1275/cmos.c:41 +#: VasEBoot-core/lib/ieee1275/cmos.c:41 msgid "m5819" msgstr "" -#: grub-core/lib/ieee1275/datetime.c:37 +#: VasEBoot-core/lib/ieee1275/datetime.c:37 msgid "rtc" msgstr "" -#: grub-core/lib/ieee1275/datetime.c:87 +#: VasEBoot-core/lib/ieee1275/datetime.c:87 msgid "get-time" msgstr "" -#: grub-core/lib/ieee1275/datetime.c:139 +#: VasEBoot-core/lib/ieee1275/datetime.c:139 msgid "set-time" msgstr "" -#: grub-core/lib/ieee1275/halt.c:28 +#: VasEBoot-core/lib/ieee1275/halt.c:28 msgid "power-off" msgstr "" -#: grub-core/lib/ieee1275/halt.c:29 +#: VasEBoot-core/lib/ieee1275/halt.c:29 msgid "shut-down" msgstr "" -#: grub-core/lib/ieee1275/halt.c:30 +#: VasEBoot-core/lib/ieee1275/halt.c:30 msgid "poweroff" msgstr "" -#: grub-core/lib/ieee1275/reboot.c:25 +#: VasEBoot-core/lib/ieee1275/reboot.c:25 msgid "reset-all" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:32 grub-core/lib/posix_wrap/wctype.h:42 +#: VasEBoot-core/lib/posix_wrap/wctype.h:32 VasEBoot-core/lib/posix_wrap/wctype.h:42 msgid "xdigit" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:39 +#: VasEBoot-core/lib/posix_wrap/wctype.h:39 msgid "alnum" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:39 +#: VasEBoot-core/lib/posix_wrap/wctype.h:39 msgid "cntrl" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:39 +#: VasEBoot-core/lib/posix_wrap/wctype.h:39 msgid "lower" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:40 +#: VasEBoot-core/lib/posix_wrap/wctype.h:40 msgid "alpha" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:40 +#: VasEBoot-core/lib/posix_wrap/wctype.h:40 msgid "digit" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:41 +#: VasEBoot-core/lib/posix_wrap/wctype.h:41 msgid "print" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:41 +#: VasEBoot-core/lib/posix_wrap/wctype.h:41 msgid "upper" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:41 +#: VasEBoot-core/lib/posix_wrap/wctype.h:41 msgid "blank" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:42 +#: VasEBoot-core/lib/posix_wrap/wctype.h:42 msgid "graph" msgstr "" -#: grub-core/lib/posix_wrap/wctype.h:42 +#: VasEBoot-core/lib/posix_wrap/wctype.h:42 msgid "punct" msgstr "" -#: grub-core/lib/reed_solomon.c:64 grub-core/lib/reed_solomon.c:65 -#: grub-core/lib/reed_solomon.c:66 grub-core/lib/reed_solomon.c:67 -#: grub-core/lib/reed_solomon.c:68 grub-core/lib/reed_solomon.c:69 -#: grub-core/lib/reed_solomon.c:70 grub-core/lib/reed_solomon.c:71 -#: grub-core/lib/reed_solomon.c:72 grub-core/lib/reed_solomon.c:73 -#: include/grub/mips/loongson/kernel.h:31 -#: include/grub/mips/loongson/memory.h:46 -#: include/grub/mips/loongson/memory.h:47 include/grub/mips/loongson/time.h:25 -#: include/grub/mips/qemu_mips/memory.h:33 include/grub/mips/time.h:29 -#: util/grub-mkimage.c:1253 util/grub-mkimage.c:1564 +#: VasEBoot-core/lib/reed_solomon.c:64 VasEBoot-core/lib/reed_solomon.c:65 +#: VasEBoot-core/lib/reed_solomon.c:66 VasEBoot-core/lib/reed_solomon.c:67 +#: VasEBoot-core/lib/reed_solomon.c:68 VasEBoot-core/lib/reed_solomon.c:69 +#: VasEBoot-core/lib/reed_solomon.c:70 VasEBoot-core/lib/reed_solomon.c:71 +#: VasEBoot-core/lib/reed_solomon.c:72 VasEBoot-core/lib/reed_solomon.c:73 +#: include/VasEBoot/mips/loongson/kernel.h:31 +#: include/VasEBoot/mips/loongson/memory.h:46 +#: include/VasEBoot/mips/loongson/memory.h:47 include/VasEBoot/mips/loongson/time.h:25 +#: include/VasEBoot/mips/qemu_mips/memory.h:33 include/VasEBoot/mips/time.h:29 +#: util/VasEBoot-mkimage.c:1253 util/VasEBoot-mkimage.c:1564 msgid ".text" msgstr "" -#: grub-core/lib/reed_solomon.c:428 +#: VasEBoot-core/lib/reed_solomon.c:428 msgid "tst.bin" msgstr "" -#: grub-core/lib/reed_solomon.c:441 grub-core/lib/reed_solomon.c:445 +#: VasEBoot-core/lib/reed_solomon.c:441 VasEBoot-core/lib/reed_solomon.c:445 msgid "tst_rs.bin" msgstr "" -#: grub-core/lib/reed_solomon.c:441 grub-core/lib/reed_solomon.c:460 -#: grub-core/lib/reed_solomon.c:465 util/grub-editenv.c:121 -#: util/grub-editenv.c:209 util/grub-fstest.c:202 util/grub-glue-efi.c:199 -#: util/grub-mkfont.c:782 util/grub-mkfont.c:819 util/grub-mkfont.c:843 -#: util/grub-mkimage.c:1975 util/grub-render-label.c:257 util/grub-setup.c:665 -#: util/grub-setup.c:672 +#: VasEBoot-core/lib/reed_solomon.c:441 VasEBoot-core/lib/reed_solomon.c:460 +#: VasEBoot-core/lib/reed_solomon.c:465 util/VasEBoot-editenv.c:121 +#: util/VasEBoot-editenv.c:209 util/VasEBoot-fstest.c:202 util/VasEBoot-glue-efi.c:199 +#: util/VasEBoot-mkfont.c:782 util/VasEBoot-mkfont.c:819 util/VasEBoot-mkfont.c:843 +#: util/VasEBoot-mkimage.c:1975 util/VasEBoot-render-label.c:257 util/VasEBoot-setup.c:665 +#: util/VasEBoot-setup.c:672 msgid "wb" msgstr "" -#: grub-core/lib/reed_solomon.c:460 +#: VasEBoot-core/lib/reed_solomon.c:460 msgid "tst_dam.bin" msgstr "" -#: grub-core/lib/reed_solomon.c:465 +#: VasEBoot-core/lib/reed_solomon.c:465 msgid "tst_rec.bin" msgstr "" -#: grub-core/loader/efi/appleloader.c:142 +#: VasEBoot-core/loader/efi/appleloader.c:142 msgid "Core Duo/Solo" msgstr "" -#: grub-core/loader/efi/appleloader.c:143 +#: VasEBoot-core/loader/efi/appleloader.c:143 msgid "Mac Pro" msgstr "" -#: grub-core/loader/efi/appleloader.c:144 +#: VasEBoot-core/loader/efi/appleloader.c:144 msgid "MBP" msgstr "" -#: grub-core/loader/efi/appleloader.c:145 +#: VasEBoot-core/loader/efi/appleloader.c:145 msgid "MBA" msgstr "" -#: grub-core/loader/efi/appleloader.c:146 +#: VasEBoot-core/loader/efi/appleloader.c:146 msgid "MB NV" msgstr "" -#: grub-core/loader/efi/appleloader.c:147 +#: VasEBoot-core/loader/efi/appleloader.c:147 msgid "MB NV2" msgstr "" -#: grub-core/loader/efi/appleloader.c:148 +#: VasEBoot-core/loader/efi/appleloader.c:148 msgid "MBP2011" msgstr "" -#: grub-core/loader/efi/appleloader.c:149 +#: VasEBoot-core/loader/efi/appleloader.c:149 msgid "MBP2012" msgstr "" -#: grub-core/loader/i386/bsd.c:135 +#: VasEBoot-core/loader/i386/bsd.c:135 msgid "wdXY" msgstr "" -#: grub-core/loader/i386/bsd.c:428 grub-core/loader/i386/bsd.c:429 +#: VasEBoot-core/loader/i386/bsd.c:428 VasEBoot-core/loader/i386/bsd.c:429 msgid "/boot/zfs/zpool.cache" msgstr "" -#: grub-core/loader/i386/bsd.c:1606 grub-core/loader/i386/bsd.c:1609 -#: grub-core/loader/i386/bsd.c:1700 grub-core/loader/i386/bsd.c:1708 -#: grub-core/loader/i386/bsd.c:1710 +#: VasEBoot-core/loader/i386/bsd.c:1606 VasEBoot-core/loader/i386/bsd.c:1609 +#: VasEBoot-core/loader/i386/bsd.c:1700 VasEBoot-core/loader/i386/bsd.c:1708 +#: VasEBoot-core/loader/i386/bsd.c:1710 msgid "com" msgstr "" -#: grub-core/loader/i386/bsd.c:1735 +#: VasEBoot-core/loader/i386/bsd.c:1735 msgid "pc" msgstr "" -#: grub-core/loader/i386/bsd.c:1825 +#: VasEBoot-core/loader/i386/bsd.c:1825 #, c-format msgid "kFreeBSD.%s" msgstr "" -#: grub-core/loader/i386/bsd.c:1892 +#: VasEBoot-core/loader/i386/bsd.c:1892 msgid "type=" msgstr "" -#: grub-core/loader/i386/bsdXX.c:369 +#: VasEBoot-core/loader/i386/bsdXX.c:369 msgid "_DYNAMIC" msgstr "" -#: grub-core/loader/i386/bsdXX.c:604 +#: VasEBoot-core/loader/i386/bsdXX.c:604 msgid "rd_root_image" msgstr "" -#: grub-core/loader/i386/bsdXX.c:606 +#: VasEBoot-core/loader/i386/bsdXX.c:606 msgid "rd_root_size" msgstr "" -#: grub-core/loader/i386/linux.c:550 grub-core/term/i386/pc/vga_text.c:256 -#: grub-core/term/i386/pc/vga_text.c:281 +#: VasEBoot-core/loader/i386/linux.c:550 VasEBoot-core/term/i386/pc/vga_text.c:256 +#: VasEBoot-core/term/i386/pc/vga_text.c:281 msgid "vga_text" msgstr "" -#: grub-core/loader/i386/linux.c:900 grub-core/loader/i386/pc/linux.c:244 +#: VasEBoot-core/loader/i386/linux.c:900 VasEBoot-core/loader/i386/pc/linux.c:244 msgid "vga=" msgstr "" -#: grub-core/loader/i386/linux.c:913 grub-core/loader/i386/pc/linux.c:252 +#: VasEBoot-core/loader/i386/linux.c:913 VasEBoot-core/loader/i386/pc/linux.c:252 msgid "ext" msgstr "" -#: grub-core/loader/i386/linux.c:915 grub-core/loader/i386/pc/linux.c:254 +#: VasEBoot-core/loader/i386/linux.c:915 VasEBoot-core/loader/i386/pc/linux.c:254 msgid "ask" msgstr "" -#: grub-core/loader/i386/linux.c:985 grub-core/loader/i386/pc/linux.c:264 +#: VasEBoot-core/loader/i386/linux.c:985 VasEBoot-core/loader/i386/pc/linux.c:264 msgid "mem=" msgstr "" -#: grub-core/loader/i386/pc/chainloader.c:104 +#: VasEBoot-core/loader/i386/pc/chainloader.c:104 msgid "FAT12" msgstr "" -#: grub-core/loader/i386/pc/chainloader.c:105 +#: VasEBoot-core/loader/i386/pc/chainloader.c:105 msgid "FAT16" msgstr "" -#: grub-core/loader/i386/pc/chainloader.c:106 +#: VasEBoot-core/loader/i386/pc/chainloader.c:106 msgid "FAT32" msgstr "" -#: grub-core/loader/i386/pc/chainloader.c:256 +#: VasEBoot-core/loader/i386/pc/chainloader.c:256 msgid "--force" msgstr "" -#: grub-core/loader/i386/pc/chainloader.c:263 +#: VasEBoot-core/loader/i386/pc/chainloader.c:263 msgid "--bpb" msgstr "" -#: grub-core/loader/i386/pc/linux.c:235 +#: VasEBoot-core/loader/i386/pc/linux.c:235 msgid "bzImage" msgstr "" -#: grub-core/loader/i386/pc/linux.c:235 +#: VasEBoot-core/loader/i386/pc/linux.c:235 msgid "zImage" msgstr "" -#: include/grub/util/lvm.h:28 +#: include/VasEBoot/util/lvm.h:28 msgid "/dev/linux_lvm/" msgstr "" -#: include/grub/zfs/dmu.h:110 +#: include/VasEBoot/zfs/dmu.h:110 msgid "root_dataset" msgstr "" -#: include/grub/zfs/dmu.h:111 +#: include/VasEBoot/zfs/dmu.h:111 msgid "sync_bplist" msgstr "" -#: include/grub/zfs/dmu.h:112 +#: include/VasEBoot/zfs/dmu.h:112 msgid "errlog_scrub" msgstr "" -#: include/grub/zfs/dmu.h:113 +#: include/VasEBoot/zfs/dmu.h:113 msgid "errlog_last" msgstr "" -#: include/grub/zfs/dmu.h:114 +#: include/VasEBoot/zfs/dmu.h:114 msgid "spares" msgstr "" -#: include/grub/zfs/dmu.h:115 +#: include/VasEBoot/zfs/dmu.h:115 msgid "deflate" msgstr "" -#: include/grub/zfs/dmu.h:116 +#: include/VasEBoot/zfs/dmu.h:116 msgid "history" msgstr "" -#: include/grub/zfs/dmu.h:117 +#: include/VasEBoot/zfs/dmu.h:117 msgid "pool_props" msgstr "" -#: include/grub/zfs/dmu.h:118 +#: include/VasEBoot/zfs/dmu.h:118 msgid "l2cache" msgstr "" -#: include/grub/zfs/zfs_znode.h:29 +#: include/VasEBoot/zfs/zfs_znode.h:29 msgid "ROOT" msgstr "" -#: include/grub/zfs/zfs_znode.h:30 +#: include/VasEBoot/zfs/zfs_znode.h:30 msgid "VERSION" msgstr "" -#: include/grub/zfs/zfs_znode.h:31 +#: include/VasEBoot/zfs/zfs_znode.h:31 msgid "SA_ATTRS" msgstr "" -#: util/grub-editenv.c:106 util/grub-setup.c:1117 +#: util/VasEBoot-editenv.c:106 util/VasEBoot-setup.c:1117 msgid "\v" msgstr "" -#: util/grub-editenv.c:120 +#: util/VasEBoot-editenv.c:120 #, c-format msgid "%s.new" msgstr "" -#: util/grub-fstest.c:547 util/grub-mount.c:463 +#: util/VasEBoot-fstest.c:547 util/VasEBoot-mount.c:463 msgid "prompt" msgstr "" -#: util/grub-fstest.c:666 +#: util/VasEBoot-fstest.c:666 msgid "cp" msgstr "" -#: util/grub-fstest.c:747 util/grub-mount.c:571 +#: util/VasEBoot-fstest.c:747 util/VasEBoot-mount.c:571 msgid "loop0" msgstr "" -#: util/grub-fstest.c:747 util/grub-mount.c:571 +#: util/VasEBoot-fstest.c:747 util/VasEBoot-mount.c:571 msgid "md0" msgstr "" -#: util/grub-mkfont.c:981 +#: util/VasEBoot-mkfont.c:981 msgid "ascii-bitmaps" msgstr "" -#: util/grub-mkfont.c:982 +#: util/VasEBoot-mkfont.c:982 msgid "width-spec" msgstr "" -#: util/grub-mkfont.c:1003 +#: util/VasEBoot-mkfont.c:1003 msgid "no-hinting" msgstr "" -#: util/grub-mkfont.c:1004 +#: util/VasEBoot-mkfont.c:1004 msgid "no-bitmap" msgstr "" -#: util/grub-mkimage.c:574 +#: util/VasEBoot-mkimage.c:574 msgid "PowerPC" msgstr "" -#: util/grub-mkimage.c:1878 -msgid "(memdisk)/boot/grub" +#: util/VasEBoot-mkimage.c:1878 +msgid "(memdisk)/boot/VasEBoot" msgstr "" -#: util/grub-mkimage.c:1896 +#: util/VasEBoot-mkimage.c:1896 msgid "xz" msgstr "" @@ -2916,1277 +2916,1277 @@ msgstr "" msgid "PHYSICALDRIVE" msgstr "" -#: grub-core/term/ns8250.c:268 +#: VasEBoot-core/term/ns8250.c:268 #, c-format msgid "com%d" msgstr "" -#: grub-core/term/ns8250.c:315 grub-core/term/serial.c:190 +#: VasEBoot-core/term/ns8250.c:315 VasEBoot-core/term/serial.c:190 #, c-format msgid "port%lx" msgstr "" -#: grub-core/term/serial.c:183 +#: VasEBoot-core/term/serial.c:183 #, c-format msgid "com%ld" msgstr "" -#: grub-core/term/serial.c:199 grub-core/term/serial.c:268 +#: VasEBoot-core/term/serial.c:199 VasEBoot-core/term/serial.c:268 msgid "com0" msgstr "" -#: grub-core/term/serial.c:219 +#: VasEBoot-core/term/serial.c:219 msgid "odd" msgstr "" -#: grub-core/term/serial.c:221 +#: VasEBoot-core/term/serial.c:221 msgid "even" msgstr "" -#: grub-core/term/serial.c:230 +#: VasEBoot-core/term/serial.c:230 msgid "1" msgstr "" -#: grub-core/term/serial.c:232 +#: VasEBoot-core/term/serial.c:232 msgid "2" msgstr "" -#: grub-core/term/serial.c:234 +#: VasEBoot-core/term/serial.c:234 msgid "1.5" msgstr "" -#: grub-core/term/serial.c:269 +#: VasEBoot-core/term/serial.c:269 msgid "com2" msgstr "" -#: grub-core/term/serial.c:270 +#: VasEBoot-core/term/serial.c:270 msgid "com1" msgstr "" -#: grub-core/term/serial.c:295 +#: VasEBoot-core/term/serial.c:295 #, c-format msgid "serial_%s" msgstr "" -#: grub-core/term/serial.c:338 grub-core/term/serial.c:339 -#: grub-core/term/serial.c:343 grub-core/term/serial.c:344 -#: grub-core/term/serial.c:347 grub-core/term/serial.c:348 +#: VasEBoot-core/term/serial.c:338 VasEBoot-core/term/serial.c:339 +#: VasEBoot-core/term/serial.c:343 VasEBoot-core/term/serial.c:344 +#: VasEBoot-core/term/serial.c:347 VasEBoot-core/term/serial.c:348 msgid "serial_*" msgstr "" -#: grub-core/term/usb_keyboard.c:217 +#: VasEBoot-core/term/usb_keyboard.c:217 #, c-format msgid "usb_keyboard%d" msgstr "" -#: grub-core/video/efi_gop.c:308 +#: VasEBoot-core/video/efi_gop.c:308 msgid "agp-internal-edid" msgstr "" -#: grub-core/video/efi_uga.c:134 +#: VasEBoot-core/video/efi_uga.c:134 msgid "VMEM" msgstr "" -#: grub-core/video/efi_uga.c:134 +#: VasEBoot-core/video/efi_uga.c:134 msgid "MMIO" msgstr "" -#: grub-core/video/ieee1275.c:74 +#: VasEBoot-core/video/ieee1275.c:74 msgid "display" msgstr "" -#: grub-core/video/readers/jpeg.c:802 +#: VasEBoot-core/video/readers/jpeg.c:802 msgid ".jpg" msgstr "" -#: grub-core/video/readers/jpeg.c:808 +#: VasEBoot-core/video/readers/jpeg.c:808 msgid ".jpeg" msgstr "" -#: grub-core/video/readers/tga.c:477 +#: VasEBoot-core/video/readers/tga.c:477 msgid ".tga" msgstr "" -#: grub-core/video/video.c:516 grub-core/video/video.c:545 +#: VasEBoot-core/video/video.c:516 VasEBoot-core/video/video.c:545 msgid "keep" msgstr "" -#: grub-core/video/video.c:517 +#: VasEBoot-core/video/video.c:517 msgid "keep," msgstr "" -#: grub-core/video/video.c:518 +#: VasEBoot-core/video/video.c:518 msgid "keep;" msgstr "" -#: include/grub/acpi.h:27 +#: include/VasEBoot/acpi.h:27 msgid "RSD PTR " msgstr "" -#: include/grub/acpi.h:76 +#: include/VasEBoot/acpi.h:76 msgid "APIC" msgstr "" -#: include/grub/dl.h:82 +#: include/VasEBoot/dl.h:82 msgid ", _" msgstr "" -#: include/grub/dl.h:113 include/grub/dl.h:121 include/grub/dl.h:128 +#: include/VasEBoot/dl.h:113 include/VasEBoot/dl.h:121 include/VasEBoot/dl.h:128 msgid "LICENSE=" msgstr "" -#: include/grub/dl.h:129 +#: include/VasEBoot/dl.h:129 msgid "\\license" msgstr "" -#: include/grub/efi/api.h:465 include/grub/types.h:78 include/grub/types.h:96 -#: include/grub/types.h:97 +#: include/VasEBoot/efi/api.h:465 include/VasEBoot/types.h:78 include/VasEBoot/types.h:96 +#: include/VasEBoot/types.h:97 msgid "lx" msgstr "" -#: include/grub/elf.h:117 +#: include/VasEBoot/elf.h:117 msgid "ELF" msgstr "" -#: include/grub/elf.h:968 +#: include/VasEBoot/elf.h:968 msgid "SUNW Solaris" msgstr "" -#: include/grub/elf.h:971 +#: include/VasEBoot/elf.h:971 msgid "GNU" msgstr "" -#: include/grub/emu/misc.h:42 +#: include/VasEBoot/emu/misc.h:42 msgid "/device.map" msgstr "" -#: include/grub/fontformat.h:23 +#: include/VasEBoot/fontformat.h:23 msgid "PFF2" msgstr "" -#: include/grub/fontformat.h:26 +#: include/VasEBoot/fontformat.h:26 msgid "PTSZ" msgstr "" -#: include/grub/fontformat.h:27 +#: include/VasEBoot/fontformat.h:27 msgid "WEIG" msgstr "" -#: include/grub/fontformat.h:28 +#: include/VasEBoot/fontformat.h:28 msgid "MAXW" msgstr "" -#: include/grub/fontformat.h:29 +#: include/VasEBoot/fontformat.h:29 msgid "MAXH" msgstr "" -#: include/grub/fontformat.h:30 +#: include/VasEBoot/fontformat.h:30 msgid "ASCE" msgstr "" -#: include/grub/fontformat.h:31 +#: include/VasEBoot/fontformat.h:31 msgid "DESC" msgstr "" -#: include/grub/fontformat.h:32 +#: include/VasEBoot/fontformat.h:32 msgid "CHIX" msgstr "" -#: include/grub/fontformat.h:33 +#: include/VasEBoot/fontformat.h:33 msgid "DATA" msgstr "" -#: include/grub/fontformat.h:34 +#: include/VasEBoot/fontformat.h:34 msgid "FAMI" msgstr "" -#: include/grub/fontformat.h:35 +#: include/VasEBoot/fontformat.h:35 msgid "SLAN" msgstr "" -#: include/grub/gcrypt/gcrypt.h:55 +#: include/VasEBoot/gcrypt/gcrypt.h:55 msgid "@VERSION@" msgstr "" -#: include/grub/gui.h:32 +#: include/VasEBoot/gui.h:32 msgid "__timeout__" msgstr "" -#: include/grub/i386/bsd.h:48 +#: include/VasEBoot/i386/bsd.h:48 msgid "elf kernel" msgstr "" -#: include/grub/i386/bsd.h:49 +#: include/VasEBoot/i386/bsd.h:49 msgid "elf64 kernel" msgstr "" -#: include/grub/i386/bsd.h:50 +#: include/VasEBoot/i386/bsd.h:50 msgid "elf module" msgstr "" -#: include/grub/i386/bsd.h:51 +#: include/VasEBoot/i386/bsd.h:51 msgid "elf obj module" msgstr "" -#: include/grub/i386/pc/pxe.h:166 +#: include/VasEBoot/i386/pc/pxe.h:166 msgid "PXENV+" msgstr "" -#: include/grub/i386/pc/pxe.h:193 +#: include/VasEBoot/i386/pc/pxe.h:193 msgid "!PXE" msgstr "" -#: include/grub/keyboard_layouts.h:22 -msgid "GRUBLAYO" +#: include/VasEBoot/keyboard_layouts.h:22 +msgid "VasEBootLAYO" msgstr "" -#: grub-core/video/sm712.c:263 +#: VasEBoot-core/video/sm712.c:263 #, c-format msgid " {-1, 0x%x, 0x5},\n" msgstr "" -#: grub-core/video/sm712.c:248 +#: VasEBoot-core/video/sm712.c:248 #, c-format msgid " {1, 0x%x, 0x%x},\n" msgstr "" -#: grub-core/video/sm712.c:250 +#: VasEBoot-core/video/sm712.c:250 #, c-format msgid " .byte 0x%02x, 0x%02x\n" msgstr "" -#: include/grub/types.h:74 include/grub/types.h:113 include/grub/types.h:114 +#: include/VasEBoot/types.h:74 include/VasEBoot/types.h:113 include/VasEBoot/types.h:114 msgid "x" msgstr "" -#: include/grub/types.h:75 include/grub/types.h:115 +#: include/VasEBoot/types.h:75 include/VasEBoot/types.h:115 msgid "u" msgstr "" -#: include/grub/types.h:79 include/grub/types.h:98 +#: include/VasEBoot/types.h:79 include/VasEBoot/types.h:98 msgid "lu" msgstr "" -#: include/grub/types.h:82 include/grub/types.h:101 include/grub/types.h:102 +#: include/VasEBoot/types.h:82 include/VasEBoot/types.h:101 include/VasEBoot/types.h:102 msgid "llx" msgstr "" -#: include/grub/types.h:83 include/grub/types.h:103 +#: include/VasEBoot/types.h:83 include/VasEBoot/types.h:103 msgid "llu" msgstr "" -#: include/grub/types.h:99 +#: include/VasEBoot/types.h:99 msgid "ld" msgstr "" -#: include/grub/types.h:104 +#: include/VasEBoot/types.h:104 msgid "lld" msgstr "" -#: util/grub-fstest.c:363 +#: util/VasEBoot-fstest.c:363 #, c-format msgid "%08x\n" msgstr "" -#: util/grub-fstest.c:387 util/grub-fstest.c:488 util/grub-mount.c:363 -#: util/grub-mount.c:418 +#: util/VasEBoot-fstest.c:387 util/VasEBoot-fstest.c:488 util/VasEBoot-mount.c:363 +#: util/VasEBoot-mount.c:418 #, c-format msgid "loop%d" msgstr "" -#: util/grub-fstest.c:391 util/grub-mount.c:367 +#: util/VasEBoot-fstest.c:391 util/VasEBoot-mount.c:367 #, c-format msgid "(host)%s" msgstr "" -#: util/grub-menulst2cfg.c:95 util/grub-menulst2cfg.c:112 +#: util/VasEBoot-menulst2cfg.c:95 util/VasEBoot-menulst2cfg.c:112 #, c-format msgid "" "}\n" "\n" msgstr "" -#: util/grub-menulst2cfg.c:99 +#: util/VasEBoot-menulst2cfg.c:99 #, c-format msgid "menuentry '%s' {\n" msgstr "" -#: util/grub-mkfont.c:159 util/grub-mkfont.c:1203 +#: util/VasEBoot-mkfont.c:159 util/VasEBoot-mkfont.c:1203 #, c-format msgid ": %s\n" msgstr "" -#: util/grub-mkfont.c:171 +#: util/VasEBoot-mkfont.c:171 #, c-format msgid "%x\n" msgstr "" -#: grub-core/loader/i386/xnu.c:181 grub-core/loader/i386/xnu.c:186 -#: include/grub/i386/tsc.h:45 include/grub/i386/tsc.h:48 -#: include/grub/i386/tsc.h:127 include/grub/i386/tsc.h:133 +#: VasEBoot-core/loader/i386/xnu.c:181 VasEBoot-core/loader/i386/xnu.c:186 +#: include/VasEBoot/i386/tsc.h:45 include/VasEBoot/i386/tsc.h:48 +#: include/VasEBoot/i386/tsc.h:127 include/VasEBoot/i386/tsc.h:133 msgid "%rax" msgstr "" -#: grub-core/loader/i386/xnu.c:459 +#: VasEBoot-core/loader/i386/xnu.c:459 msgid "device-properties" msgstr "" -#: grub-core/loader/i386/xnu.c:658 +#: VasEBoot-core/loader/i386/xnu.c:658 msgid "firmware-revision" msgstr "" -#: grub-core/loader/i386/xnu.c:668 +#: VasEBoot-core/loader/i386/xnu.c:668 msgid "firmware-vendor" msgstr "" -#: grub-core/loader/i386/xnu.c:679 +#: VasEBoot-core/loader/i386/xnu.c:679 msgid "firmware-abi" msgstr "" -#: grub-core/loader/i386/xnu.c:682 grub-core/loader/i386/xnu.c:687 +#: VasEBoot-core/loader/i386/xnu.c:682 VasEBoot-core/loader/i386/xnu.c:687 msgid "EFI32" msgstr "" -#: grub-core/loader/i386/xnu.c:689 +#: VasEBoot-core/loader/i386/xnu.c:689 msgid "EFI64" msgstr "" -#: grub-core/loader/i386/xnu.c:693 +#: VasEBoot-core/loader/i386/xnu.c:693 msgid "platform" msgstr "" -#: grub-core/loader/i386/xnu.c:698 +#: VasEBoot-core/loader/i386/xnu.c:698 msgid "FSBFrequency" msgstr "" -#: grub-core/loader/i386/xnu.c:720 +#: VasEBoot-core/loader/i386/xnu.c:720 msgid "configuration-table" msgstr "" -#: grub-core/loader/i386/xnu.c:761 +#: VasEBoot-core/loader/i386/xnu.c:761 #, c-format msgid "%08x-%04x-%04x-%02x%02x-" msgstr "" -#: grub-core/loader/i386/xnu.c:786 grub-core/loader/i386/xnu.c:820 +#: VasEBoot-core/loader/i386/xnu.c:786 VasEBoot-core/loader/i386/xnu.c:820 msgid "table" msgstr "" -#: grub-core/loader/i386/xnu.c:804 +#: VasEBoot-core/loader/i386/xnu.c:804 msgid "alias" msgstr "" -#: grub-core/loader/i386/xnu.c:817 +#: VasEBoot-core/loader/i386/xnu.c:817 msgid "runtime-services" msgstr "" -#: grub-core/loader/ia64/efi/linux.c:343 +#: VasEBoot-core/loader/ia64/efi/linux.c:343 msgid "b" msgstr "" -#: grub-core/loader/ia64/efi/linux.c:522 include/grub/lib/cmdline.h:25 +#: VasEBoot-core/loader/ia64/efi/linux.c:522 include/VasEBoot/lib/cmdline.h:25 msgid "BOOT_IMAGE=" msgstr "" -#: grub-core/loader/ia64/efi/linux.c:539 +#: VasEBoot-core/loader/ia64/efi/linux.c:539 msgid "BOOT_IMAGE" msgstr "" -#: grub-core/loader/linux.c:164 +#: VasEBoot-core/loader/linux.c:164 msgid "newc:" msgstr "" -#: grub-core/loader/macho32.c:18 +#: VasEBoot-core/loader/macho32.c:18 msgid "32" msgstr "" -#: grub-core/loader/macho64.c:18 +#: VasEBoot-core/loader/macho64.c:18 msgid "64" msgstr "" -#: grub-core/loader/mips/linux.c:46 +#: VasEBoot-core/loader/mips/linux.c:46 msgid "machtype=lemote-yeeloong-2f-8.9inches" msgstr "" -#: grub-core/loader/mips/linux.c:47 +#: VasEBoot-core/loader/mips/linux.c:47 msgid "machtype=lemote-fuloong-2f-box" msgstr "" -#: grub-core/loader/mips/linux.c:48 +#: VasEBoot-core/loader/mips/linux.c:48 msgid "machtype=lemote-fuloong-2e-unknown" msgstr "" -#: grub-core/loader/mips/linux.c:280 grub-core/loader/mips/linux.c:357 -#: grub-core/loader/mips/linux.c:466 +#: VasEBoot-core/loader/mips/linux.c:280 VasEBoot-core/loader/mips/linux.c:357 +#: VasEBoot-core/loader/mips/linux.c:466 msgid "rd_start=0xXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:281 grub-core/loader/mips/linux.c:362 +#: VasEBoot-core/loader/mips/linux.c:281 VasEBoot-core/loader/mips/linux.c:362 msgid "rd_size=0xXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:286 grub-core/loader/mips/linux.c:374 +#: VasEBoot-core/loader/mips/linux.c:286 VasEBoot-core/loader/mips/linux.c:374 msgid "memsize=XXXXXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:287 grub-core/loader/mips/linux.c:380 +#: VasEBoot-core/loader/mips/linux.c:287 VasEBoot-core/loader/mips/linux.c:380 msgid "highmemsize=XXXXXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:288 grub-core/loader/mips/linux.c:387 +#: VasEBoot-core/loader/mips/linux.c:288 VasEBoot-core/loader/mips/linux.c:387 msgid "busclock=XXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:289 grub-core/loader/mips/linux.c:392 +#: VasEBoot-core/loader/mips/linux.c:289 VasEBoot-core/loader/mips/linux.c:392 msgid "cpuclock=XXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:375 +#: VasEBoot-core/loader/mips/linux.c:375 #, c-format msgid "memsize=%lld" msgstr "" -#: grub-core/loader/mips/linux.c:381 +#: VasEBoot-core/loader/mips/linux.c:381 #, c-format msgid "highmemsize=%lld" msgstr "" -#: grub-core/loader/mips/linux.c:388 +#: VasEBoot-core/loader/mips/linux.c:388 #, c-format msgid "busclock=%d" msgstr "" -#: grub-core/loader/mips/linux.c:393 +#: VasEBoot-core/loader/mips/linux.c:393 #, c-format msgid "cpuclock=%d" msgstr "" -#: grub-core/loader/mips/linux.c:456 +#: VasEBoot-core/loader/mips/linux.c:456 msgid "%s rd_start=0x%" msgstr "" -#: grub-core/loader/mips/linux.c:457 +#: VasEBoot-core/loader/mips/linux.c:457 msgid " rd_size=0x%" msgstr "" -#: grub-core/loader/mips/linux.c:466 +#: VasEBoot-core/loader/mips/linux.c:466 #, c-format msgid "rd_start=0x%llx" msgstr "" -#: grub-core/loader/mips/linux.c:473 +#: VasEBoot-core/loader/mips/linux.c:473 msgid "rd_size=0xXXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/loader/mips/linux.c:473 +#: VasEBoot-core/loader/mips/linux.c:473 #, c-format msgid "rd_size=0x%llx" msgstr "" -#: grub-core/loader/multiboot.c:207 +#: VasEBoot-core/loader/multiboot.c:207 #, c-format msgid "%dx%dx%d,%dx%d,auto" msgstr "" -#: grub-core/loader/multiboot.c:210 +#: VasEBoot-core/loader/multiboot.c:210 #, c-format msgid "%dx%d,auto" msgstr "" -#: grub-core/loader/sparc64/ieee1275/linux.c:454 +#: VasEBoot-core/loader/sparc64/ieee1275/linux.c:454 msgid "/virtual-memory" msgstr "" -#: grub-core/loader/xnu.c:222 grub-core/loader/xnu.c:568 +#: VasEBoot-core/loader/xnu.c:222 VasEBoot-core/loader/xnu.c:568 msgid "memory-map" msgstr "" -#: grub-core/loader/xnu.c:229 +#: VasEBoot-core/loader/xnu.c:229 msgid "DeviceTree" msgstr "" -#: grub-core/loader/xnu.c:617 +#: VasEBoot-core/loader/xnu.c:617 msgid "/Contents/" msgstr "" -#: grub-core/loader/xnu.c:748 +#: VasEBoot-core/loader/xnu.c:748 msgid "Driver-" msgstr "" -#: grub-core/loader/xnu.c:867 +#: VasEBoot-core/loader/xnu.c:867 msgid "DriversPackage-" msgstr "" -#: grub-core/loader/xnu.c:907 +#: VasEBoot-core/loader/xnu.c:907 msgid "RAMDisk" msgstr "" -#: grub-core/loader/xnu.c:961 +#: VasEBoot-core/loader/xnu.c:961 msgid "OSBundleRequired" msgstr "" -#: grub-core/loader/xnu.c:964 +#: VasEBoot-core/loader/xnu.c:964 msgid "CFBundleExecutable" msgstr "" -#: grub-core/loader/xnu.c:998 +#: VasEBoot-core/loader/xnu.c:998 msgid "key" msgstr "" -#: grub-core/loader/xnu.c:1000 grub-core/net/bootp.c:373 +#: VasEBoot-core/loader/xnu.c:1000 VasEBoot-core/net/bootp.c:373 msgid "string" msgstr "" -#: grub-core/loader/xnu.c:1002 +#: VasEBoot-core/loader/xnu.c:1002 msgid "/key" msgstr "" -#: grub-core/loader/xnu.c:1043 +#: VasEBoot-core/loader/xnu.c:1043 msgid ".kext" msgstr "" -#: grub-core/loader/xnu.c:1128 +#: VasEBoot-core/loader/xnu.c:1128 msgid "Contents" msgstr "" -#: grub-core/loader/xnu.c:1133 +#: VasEBoot-core/loader/xnu.c:1133 msgid "Plugins" msgstr "" -#: grub-core/loader/xnu.c:1139 +#: VasEBoot-core/loader/xnu.c:1139 msgid "MacOS" msgstr "" -#: grub-core/loader/xnu.c:1143 +#: VasEBoot-core/loader/xnu.c:1143 msgid "Info.plist" msgstr "" -#: grub-core/loader/xnu.c:1204 grub-core/loader/xnu.c:1207 +#: VasEBoot-core/loader/xnu.c:1204 VasEBoot-core/loader/xnu.c:1207 msgid "/MacOS/" msgstr "" -#: grub-core/loader/xnu.c:1283 +#: VasEBoot-core/loader/xnu.c:1283 msgid "console,root,local-root,network-root" msgstr "" -#: grub-core/loader/xnu.c:1344 grub-core/loader/xnu.c:1345 -#: grub-core/loader/xnu.c:1348 +#: VasEBoot-core/loader/xnu.c:1344 VasEBoot-core/loader/xnu.c:1345 +#: VasEBoot-core/loader/xnu.c:1348 msgid "XNU.DeviceTree." msgstr "" -#: grub-core/net/bootp.c:40 +#: VasEBoot-core/net/bootp.c:40 msgid "net_" msgstr "" -#: grub-core/net/bootp.c:40 include/grub/dl.h:82 include/grub/symbol.h:34 +#: VasEBoot-core/net/bootp.c:40 include/VasEBoot/dl.h:82 include/VasEBoot/symbol.h:34 msgid "_" msgstr "" -#: grub-core/net/bootp.c:43 +#: VasEBoot-core/net/bootp.c:43 #, c-format msgid "net_%s_%s" msgstr "" -#: grub-core/net/bootp.c:102 +#: VasEBoot-core/net/bootp.c:102 msgid ":default" msgstr "" -#: grub-core/net/bootp.c:109 +#: VasEBoot-core/net/bootp.c:109 #, c-format msgid "%s:default" msgstr "" -#: grub-core/net/bootp.c:127 +#: VasEBoot-core/net/bootp.c:127 msgid "hostname" msgstr "" -#: grub-core/net/bootp.c:131 +#: VasEBoot-core/net/bootp.c:131 msgid "domain" msgstr "" -#: grub-core/net/bootp.c:135 +#: VasEBoot-core/net/bootp.c:135 msgid "rootpath" msgstr "" -#: grub-core/net/bootp.c:139 +#: VasEBoot-core/net/bootp.c:139 msgid "extensionspath" msgstr "" -#: grub-core/net/bootp.c:183 +#: VasEBoot-core/net/bootp.c:183 msgid ":gw" msgstr "" -#: grub-core/net/bootp.c:190 +#: VasEBoot-core/net/bootp.c:190 #, c-format msgid "%s:gw" msgstr "" -#: grub-core/net/bootp.c:200 +#: VasEBoot-core/net/bootp.c:200 msgid "boot_file" msgstr "" -#: grub-core/net/bootp.c:206 grub-core/net/net.c:713 +#: VasEBoot-core/net/bootp.c:206 VasEBoot-core/net/net.c:713 #, c-format msgid "%d.%d.%d.%d" msgstr "" -#: grub-core/net/bootp.c:216 +#: VasEBoot-core/net/bootp.c:216 #, c-format msgid "tftp,%d.%d.%d.%d" msgstr "" -#: grub-core/net/bootp.c:226 +#: VasEBoot-core/net/bootp.c:226 msgid "dhcp_server_name" msgstr "" -#: grub-core/net/bootp.c:235 +#: VasEBoot-core/net/bootp.c:235 #, c-format msgid "tftp,%s" msgstr "" -#: grub-core/net/bootp.c:277 +#: VasEBoot-core/net/bootp.c:277 #, c-format msgid "%s:dhcp" msgstr "" -#: grub-core/net/bootp.c:294 +#: VasEBoot-core/net/bootp.c:294 msgid ":dhcp_tmp" msgstr "" -#: grub-core/net/bootp.c:387 +#: VasEBoot-core/net/bootp.c:387 msgid "number" msgstr "" -#: grub-core/net/bootp.c:394 +#: VasEBoot-core/net/bootp.c:394 #, c-format msgid "%llu\n" msgstr "" -#: grub-core/net/bootp.c:398 +#: VasEBoot-core/net/bootp.c:398 #, c-format msgid "%lld\n" msgstr "" -#: grub-core/net/bootp.c:460 +#: VasEBoot-core/net/bootp.c:460 #, c-format msgid "%s:dhcp_tmp" msgstr "" -#: grub-core/net/drivers/arc/arcnet.c:89 +#: VasEBoot-core/net/drivers/arc/arcnet.c:89 #, c-format msgid "<%lu>" msgstr "" -#: grub-core/net/drivers/efi/efinet.c:205 +#: VasEBoot-core/net/drivers/efi/efinet.c:205 #, c-format msgid "efinet%d" msgstr "" -#: grub-core/net/drivers/emu/emunet.c:104 +#: VasEBoot-core/net/drivers/emu/emunet.c:104 msgid "/dev/net/tun" msgstr "" -#: grub-core/net/drivers/ieee1275/ofnet.c:43 -#: grub-core/net/drivers/ieee1275/ofnet.c:47 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:43 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:47 msgid ":speed=auto,duplex=auto,1.1.1.1,dummy,1.1.1.1,1.1.1.1,5,5,1.1.1.1,512" msgstr "" -#: grub-core/net/drivers/ieee1275/ofnet.c:135 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:135 msgid "bootp-response" msgstr "" -#: grub-core/net/drivers/ieee1275/ofnet.c:136 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:136 msgid "dhcp-response" msgstr "" -#: grub-core/net/drivers/ieee1275/ofnet.c:137 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:137 msgid "bootpreply-packet" msgstr "" -#: grub-core/net/drivers/ieee1275/ofnet.c:266 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:266 msgid "alloc-mem" msgstr "" -#: grub-core/net/drivers/ieee1275/ofnet.c:291 +#: VasEBoot-core/net/drivers/ieee1275/ofnet.c:291 #, c-format msgid "ofnet_%s" msgstr "" -#: grub-core/net/http.c:103 grub-core/net/http.c:109 +#: VasEBoot-core/net/http.c:103 VasEBoot-core/net/http.c:109 msgid "HTTP/1.1 " msgstr "" -#: grub-core/net/http.c:133 grub-core/net/http.c:136 +#: VasEBoot-core/net/http.c:133 VasEBoot-core/net/http.c:136 msgid "Content-Length: " msgstr "" -#: grub-core/net/http.c:141 grub-core/net/http.c:142 +#: VasEBoot-core/net/http.c:141 VasEBoot-core/net/http.c:142 msgid "Transfer-Encoding: chunked" msgstr "" -#: grub-core/net/http.c:317 grub-core/net/http.c:330 grub-core/net/http.c:336 +#: VasEBoot-core/net/http.c:317 VasEBoot-core/net/http.c:330 VasEBoot-core/net/http.c:336 msgid "GET " msgstr "" -#: grub-core/net/http.c:319 grub-core/net/http.c:349 grub-core/net/http.c:355 -#: grub-core/net/http.c:356 +#: VasEBoot-core/net/http.c:319 VasEBoot-core/net/http.c:349 VasEBoot-core/net/http.c:355 +#: VasEBoot-core/net/http.c:356 msgid "" " HTTP/1.1\r\n" "Host: " msgstr "" -#: grub-core/net/http.c:321 grub-core/net/http.c:370 grub-core/net/http.c:377 -#: grub-core/net/http.c:378 +#: VasEBoot-core/net/http.c:321 VasEBoot-core/net/http.c:370 VasEBoot-core/net/http.c:377 +#: VasEBoot-core/net/http.c:378 msgid "" "\r\n" "User-Agent: " msgstr "" -#: grub-core/net/http.c:322 grub-core/net/http.c:370 grub-core/net/http.c:377 -#: grub-core/net/http.c:378 grub-core/net/http.c:392 +#: VasEBoot-core/net/http.c:322 VasEBoot-core/net/http.c:370 VasEBoot-core/net/http.c:377 +#: VasEBoot-core/net/http.c:378 VasEBoot-core/net/http.c:392 msgid "\r\n" msgstr "" -#: grub-core/net/http.c:323 grub-core/net/http.c:383 +#: VasEBoot-core/net/http.c:323 VasEBoot-core/net/http.c:383 msgid "" "Range: bytes=XXXXXXXXXXXXXXXXXXXX-\r\n" "\r\n" msgstr "" -#: grub-core/net/http.c:386 +#: VasEBoot-core/net/http.c:386 msgid "Range: bytes=%" msgstr "" -#: grub-core/net/http.c:386 +#: VasEBoot-core/net/http.c:386 msgid "" "-\r\n" "\r\n" msgstr "" -#: grub-core/net/icmp6.c:416 +#: VasEBoot-core/net/icmp6.c:416 msgid ":XXXXXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/net/icmp6.c:417 +#: VasEBoot-core/net/icmp6.c:417 #, c-format msgid "%s:%d" msgstr "" -#: grub-core/net/net.c:230 grub-core/net/net.c:238 +#: VasEBoot-core/net/net.c:230 VasEBoot-core/net/net.c:238 msgid ":slaac" msgstr "" -#: grub-core/net/net.c:253 grub-core/net/net.c:276 +#: VasEBoot-core/net/net.c:253 VasEBoot-core/net/net.c:276 msgid ":link" msgstr "" -#: grub-core/net/net.c:822 +#: VasEBoot-core/net/net.c:822 msgid "net__mac" msgstr "" -#: grub-core/net/net.c:825 +#: VasEBoot-core/net/net.c:825 #, c-format msgid "net_%s_mac" msgstr "" -#: grub-core/net/net.c:835 +#: VasEBoot-core/net/net.c:835 msgid "net__ip" msgstr "" -#: grub-core/net/net.c:838 +#: VasEBoot-core/net/net.c:838 #, c-format msgid "net_%s_ip" msgstr "" -#: grub-core/net/net.c:908 +#: VasEBoot-core/net/net.c:908 #, c-format msgid "%s:local" msgstr "" -#: grub-core/net/net.c:1054 +#: VasEBoot-core/net/net.c:1054 msgid "gw" msgstr "" -#: grub-core/net/net.c:1091 +#: VasEBoot-core/net/net.c:1091 #, c-format msgid "%d.%d.%d.%d/%d " msgstr "" -#: grub-core/net/net.c:1184 grub-core/net/net.c:1188 +#: VasEBoot-core/net/net.c:1184 VasEBoot-core/net/net.c:1188 msgid "pxe:" msgstr "" -#: grub-core/net/tftp.c:180 grub-core/net/tftp.c:181 grub-core/net/tftp.c:343 -#: grub-core/net/tftp.c:344 grub-core/net/tftp.c:345 +#: VasEBoot-core/net/tftp.c:180 VasEBoot-core/net/tftp.c:181 VasEBoot-core/net/tftp.c:343 +#: VasEBoot-core/net/tftp.c:344 VasEBoot-core/net/tftp.c:345 msgid "tsize" msgstr "" -#: grub-core/net/tftp.c:183 grub-core/net/tftp.c:184 grub-core/net/tftp.c:335 -#: grub-core/net/tftp.c:336 grub-core/net/tftp.c:337 +#: VasEBoot-core/net/tftp.c:183 VasEBoot-core/net/tftp.c:184 VasEBoot-core/net/tftp.c:335 +#: VasEBoot-core/net/tftp.c:336 VasEBoot-core/net/tftp.c:337 msgid "blksize" msgstr "" -#: grub-core/net/tftp.c:331 grub-core/net/tftp.c:332 grub-core/net/tftp.c:333 +#: VasEBoot-core/net/tftp.c:331 VasEBoot-core/net/tftp.c:332 VasEBoot-core/net/tftp.c:333 msgid "octet" msgstr "" -#: grub-core/net/tftp.c:339 grub-core/net/tftp.c:340 grub-core/net/tftp.c:341 +#: VasEBoot-core/net/tftp.c:339 VasEBoot-core/net/tftp.c:340 VasEBoot-core/net/tftp.c:341 msgid "1024" msgstr "" -#: grub-core/net/tftp.c:431 grub-core/net/tftp.c:437 +#: VasEBoot-core/net/tftp.c:431 VasEBoot-core/net/tftp.c:437 msgid "closed" msgstr "" -#: grub-core/normal/auth.c:178 +#: VasEBoot-core/normal/auth.c:178 msgid "\b" msgstr "" -#: grub-core/normal/autofs.c:74 +#: VasEBoot-core/normal/autofs.c:74 msgid "/fs.lst" msgstr "" -#: grub-core/normal/completion.c:133 +#: VasEBoot-core/normal/completion.c:133 msgid "\" " msgstr "" -#: grub-core/normal/completion.c:135 util/grub-probe.c:506 -#: util/grub-probe.c:544 +#: VasEBoot-core/normal/completion.c:135 util/VasEBoot-probe.c:506 +#: util/VasEBoot-probe.c:544 #, c-format msgid "' " msgstr "" -#: grub-core/normal/completion.c:337 +#: VasEBoot-core/normal/completion.c:337 msgid "- " msgstr "" -#: grub-core/normal/completion.c:348 +#: VasEBoot-core/normal/completion.c:348 msgid "-u" msgstr "" -#: grub-core/normal/completion.c:364 util/ieee1275/grub-ofpathname.c:39 +#: VasEBoot-core/normal/completion.c:364 util/ieee1275/VasEBoot-ofpathname.c:39 msgid "--help" msgstr "" -#: grub-core/normal/completion.c:366 +#: VasEBoot-core/normal/completion.c:366 msgid "--usage" msgstr "" -#: grub-core/normal/crypto.c:90 +#: VasEBoot-core/normal/crypto.c:90 msgid "/crypto.lst" msgstr "" -#: grub-core/normal/dyncmd.c:104 +#: VasEBoot-core/normal/dyncmd.c:104 msgid "/command.lst" msgstr "" -#: grub-core/normal/main.c:363 +#: VasEBoot-core/normal/main.c:363 #, c-format -msgid "%s/grub.cfg" +msgid "%s/VasEBoot.cfg" msgstr "" -#: grub-core/normal/main.c:516 +#: VasEBoot-core/normal/main.c:516 msgid "feature_chainloader_bpb" msgstr "" -#: grub-core/normal/main.c:516 +#: VasEBoot-core/normal/main.c:516 msgid "feature_ntldr" msgstr "" -#: grub-core/normal/main.c:516 +#: VasEBoot-core/normal/main.c:516 msgid "feature_platform_search_hint" msgstr "" -#: grub-core/normal/main.c:517 +#: VasEBoot-core/normal/main.c:517 msgid "feature_default_font_path" msgstr "" -#: grub-core/normal/main.c:517 +#: VasEBoot-core/normal/main.c:517 msgid "feature_all_video_module" msgstr "" -#: grub-core/normal/main.c:518 +#: VasEBoot-core/normal/main.c:518 msgid "feature_menuentry_id" msgstr "" -#: grub-core/normal/main.c:518 +#: VasEBoot-core/normal/main.c:518 msgid "feature_menuentry_options" msgstr "" -#: grub-core/normal/main.c:518 +#: VasEBoot-core/normal/main.c:518 msgid "feature_200_final" msgstr "" -#: grub-core/normal/main.c:519 +#: VasEBoot-core/normal/main.c:519 msgid "feature_nativedisk_cmd" msgstr "" -#: grub-core/normal/main.c:568 +#: VasEBoot-core/normal/main.c:568 msgid "white/black" msgstr "" -#: grub-core/normal/main.c:569 +#: VasEBoot-core/normal/main.c:569 msgid "black/white" msgstr "" -#: grub-core/normal/term.c:326 +#: VasEBoot-core/normal/term.c:326 msgid "/terminal.lst" msgstr "" -#: grub-core/partmap/amiga.c:34 +#: VasEBoot-core/partmap/amiga.c:34 msgid "RDSK" msgstr "" -#: grub-core/partmap/amiga.c:51 +#: VasEBoot-core/partmap/amiga.c:51 msgid "PART" msgstr "" -#: grub-core/term/at_keyboard.c:642 grub-core/term/at_keyboard.c:654 +#: VasEBoot-core/term/at_keyboard.c:642 VasEBoot-core/term/at_keyboard.c:654 msgid "at_keyboard" msgstr "" -#: grub-core/term/efi/serial.c:170 grub-core/term/efi/serial.c:173 +#: VasEBoot-core/term/efi/serial.c:170 VasEBoot-core/term/efi/serial.c:173 msgid "efiXXXXXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/term/efi/serial.c:174 +#: VasEBoot-core/term/efi/serial.c:174 #, c-format msgid "efi%d" msgstr "" -#: grub-core/term/emu/console.c:166 +#: VasEBoot-core/term/emu/console.c:166 msgid "vt100-color" msgstr "" -#: grub-core/term/i386/pc/vga_text.c:254 grub-core/term/i386/pc/vga_text.c:279 +#: VasEBoot-core/term/i386/pc/vga_text.c:254 VasEBoot-core/term/i386/pc/vga_text.c:279 msgid "mda_text" msgstr "" -#: grub-core/term/ieee1275/console.c:152 +#: VasEBoot-core/term/ieee1275/console.c:152 msgid "cursor-on" msgstr "" -#: grub-core/term/ieee1275/console.c:154 +#: VasEBoot-core/term/ieee1275/console.c:154 msgid "cursor-off" msgstr "" -#: grub-core/term/ieee1275/console.c:179 +#: VasEBoot-core/term/ieee1275/console.c:179 msgid "output-device output" msgstr "" -#: grub-core/term/ieee1275/console.c:255 +#: VasEBoot-core/term/ieee1275/console.c:255 msgid "dumb" msgstr "" -#: grub-core/term/ieee1275/console.c:257 +#: VasEBoot-core/term/ieee1275/console.c:257 msgid "ieee1275-nocursor" msgstr "" -#: grub-core/term/ieee1275/console.c:259 +#: VasEBoot-core/term/ieee1275/console.c:259 msgid "ieee1275" msgstr "" -#: grub-core/term/ieee1275/escc.c:229 +#: VasEBoot-core/term/ieee1275/escc.c:229 #, c-format msgid "escc-ch-%c" msgstr "" -#: grub-core/term/ieee1275/escc.c:250 +#: VasEBoot-core/term/ieee1275/escc.c:250 msgid "mac-io" msgstr "" -#: grub-core/term/ieee1275/escc.c:269 +#: VasEBoot-core/term/ieee1275/escc.c:269 msgid "escc" msgstr "" -#: grub-core/term/morse.c:126 +#: VasEBoot-core/term/morse.c:126 msgid "audio" msgstr "" -#: include/grub/lvm.h:32 +#: include/VasEBoot/lvm.h:32 msgid "LABELONE" msgstr "" -#: include/grub/lvm.h:33 +#: include/VasEBoot/lvm.h:33 msgid "LVM2 001" msgstr "" -#: include/grub/macho.h:127 +#: include/VasEBoot/macho.h:127 msgid "complzss" msgstr "" -#: include/grub/net.h:459 +#: include/VasEBoot/net.h:459 msgid "XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX" msgstr "" -#: include/grub/net.h:466 +#: include/VasEBoot/net.h:466 msgid "XX:XX:XX:XX:XX:XX" msgstr "" -#: include/grub/symbol.h:44 +#: include/VasEBoot/symbol.h:44 msgid "function" msgstr "" -#: include/grub/symbol.h:45 +#: include/VasEBoot/symbol.h:45 msgid "object" msgstr "" -#: grub-core/lib/adler32.c:84 +#: VasEBoot-core/lib/adler32.c:84 msgid "ADLER32" msgstr "" -#: grub-core/lib/arg.c:123 +#: VasEBoot-core/lib/arg.c:123 msgid "-h, " msgstr "" -#: grub-core/lib/arg.c:125 +#: VasEBoot-core/lib/arg.c:125 msgid "-u, " msgstr "" -#: grub-core/lib/arg.c:127 +#: VasEBoot-core/lib/arg.c:127 msgid " " msgstr "" -#: grub-core/lib/arg.c:131 grub-core/normal/completion.c:376 +#: VasEBoot-core/lib/arg.c:131 VasEBoot-core/normal/completion.c:376 #, c-format msgid "--%s" msgstr "" -#: grub-core/lib/arg.c:136 +#: VasEBoot-core/lib/arg.c:136 #, c-format msgid "=%s" msgstr "" -#: grub-core/loader/i386/xnu.c:55 +#: VasEBoot-core/loader/i386/xnu.c:55 msgid "ACPI_20" msgstr "" -#: grub-core/loader/i386/xnu.c:56 grub-core/loader/i386/xnu.c:644 -#: grub-core/loader/i386/xnu.c:645 grub-core/loader/i386/xnu.c:649 -#: grub-core/loader/i386/xnu.c:650 +#: VasEBoot-core/loader/i386/xnu.c:56 VasEBoot-core/loader/i386/xnu.c:644 +#: VasEBoot-core/loader/i386/xnu.c:645 VasEBoot-core/loader/i386/xnu.c:649 +#: VasEBoot-core/loader/i386/xnu.c:650 msgid "ACPI" msgstr "" -#: grub-core/net/net.c:1132 +#: VasEBoot-core/net/net.c:1132 msgid "gw " msgstr "" -#: grub-core/kern/rescue_reader.c:40 +#: VasEBoot-core/kern/rescue_reader.c:40 msgid "> " msgstr "" -#: grub-core/kern/rescue_reader.c:40 -msgid "grub rescue> " +#: VasEBoot-core/kern/rescue_reader.c:40 +msgid "VasEBoot rescue> " msgstr "" -#: grub-core/term/arc/console.c:87 grub-core/term/arc/console.c:88 -#: grub-core/term/arc/console.c:89 grub-core/term/arc/console.c:91 +#: VasEBoot-core/term/arc/console.c:87 VasEBoot-core/term/arc/console.c:88 +#: VasEBoot-core/term/arc/console.c:89 VasEBoot-core/term/arc/console.c:91 msgid "line" msgstr "" -#: grub-core/term/arc/console.c:120 +#: VasEBoot-core/term/arc/console.c:120 msgid "ConsoleOut" msgstr "" -#: grub-core/term/arc/console.c:206 grub-core/term/serial.c:252 -#: grub-core/term/serial.c:334 +#: VasEBoot-core/term/arc/console.c:206 VasEBoot-core/term/serial.c:252 +#: VasEBoot-core/term/serial.c:334 msgid "vt100" msgstr "" -#: grub-core/term/arc/console.c:208 +#: VasEBoot-core/term/arc/console.c:208 msgid "arc" msgstr "" -#: grub-core/parttool/msdospart.c:88 +#: VasEBoot-core/parttool/msdospart.c:88 msgid "hidden" msgstr "" -#: grub-core/loader/xnu.c:1422 grub-core/term/gfxterm.c:1153 +#: VasEBoot-core/loader/xnu.c:1422 VasEBoot-core/term/gfxterm.c:1153 msgid "stretch" msgstr "" -#: grub-core/loader/machoXX.c:326 grub-core/loader/machoXX.c:328 -#: grub-core/loader/machoXX.c:329 grub-core/loader/machoXX.c:331 -#: grub-core/loader/machoXX.c:333 +#: VasEBoot-core/loader/machoXX.c:326 VasEBoot-core/loader/machoXX.c:328 +#: VasEBoot-core/loader/machoXX.c:329 VasEBoot-core/loader/machoXX.c:331 +#: VasEBoot-core/loader/machoXX.c:333 msgid "Darwin Kernel Version " msgstr "" -#: grub-core/loader/i386/pc/plan9.c:267 +#: VasEBoot-core/loader/i386/pc/plan9.c:267 #, c-format msgid "sdB%u" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:270 +#: VasEBoot-core/loader/i386/pc/plan9.c:270 #, c-format msgid "fd%u" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:290 +#: VasEBoot-core/loader/i386/pc/plan9.c:290 msgid "sdZ0" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:296 grub-core/loader/i386/pc/plan9.c:299 -#: grub-core/loader/i386/pc/plan9.c:308 grub-core/loader/i386/pc/plan9.c:311 +#: VasEBoot-core/loader/i386/pc/plan9.c:296 VasEBoot-core/loader/i386/pc/plan9.c:299 +#: VasEBoot-core/loader/i386/pc/plan9.c:308 VasEBoot-core/loader/i386/pc/plan9.c:311 msgid "ata0" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:300 grub-core/loader/i386/pc/plan9.c:313 +#: VasEBoot-core/loader/i386/pc/plan9.c:300 VasEBoot-core/loader/i386/pc/plan9.c:313 #, c-format msgid "sd%c%d" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:320 +#: VasEBoot-core/loader/i386/pc/plan9.c:320 #, c-format msgid "sd0%u" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:331 grub-core/loader/i386/pc/plan9.c:346 -#: grub-core/loader/i386/pc/plan9.c:347 +#: VasEBoot-core/loader/i386/pc/plan9.c:331 VasEBoot-core/loader/i386/pc/plan9.c:346 +#: VasEBoot-core/loader/i386/pc/plan9.c:347 msgid "part=" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:416 +#: VasEBoot-core/loader/i386/pc/plan9.c:416 #, c-format msgid "%s!%s!%s" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:419 +#: VasEBoot-core/loader/i386/pc/plan9.c:419 #, c-format msgid "%s!%s" msgstr "" -#: grub-core/commands/wildcard.c:83 +#: VasEBoot-core/commands/wildcard.c:83 msgid "*.\\|+{}[]?" msgstr "" -#: grub-core/disk/dmraid_nvidia.c:71 +#: VasEBoot-core/disk/dmraid_nvidia.c:71 msgid "NVIDIA" msgstr "" -#: grub-core/commands/sleep.c:45 +#: VasEBoot-core/commands/sleep.c:45 #, c-format msgid "%d " msgstr "" -#: grub-core/commands/verify.c:258 +#: VasEBoot-core/commands/verify.c:258 msgid "" msgstr "" -#: grub-core/disk/cryptodisk.c:576 +#: VasEBoot-core/disk/cryptodisk.c:576 msgid " sectors from sector 0x%" msgstr "" -#: grub-core/disk/cryptodisk.c:577 grub-core/disk/cryptodisk.c:626 +#: VasEBoot-core/disk/cryptodisk.c:577 VasEBoot-core/disk/cryptodisk.c:626 msgid " with offset of %" msgstr "" -#: grub-core/disk/cryptodisk.c:625 +#: VasEBoot-core/disk/cryptodisk.c:625 msgid " sectors to sector 0x%" msgstr "" -#: grub-core/disk/geli.c:469 +#: VasEBoot-core/disk/geli.c:469 msgid "" msgstr "" -#: grub-core/disk/luks.c:40 +#: VasEBoot-core/disk/luks.c:40 msgid "LUKS" msgstr "" -#: grub-core/font/font.c:450 grub-core/font/font.c:454 +#: VasEBoot-core/font/font.c:450 VasEBoot-core/font/font.c:454 msgid "/fonts/" msgstr "" -#: grub-core/font/font.c:450 grub-core/font/font.c:456 +#: VasEBoot-core/font/font.c:450 VasEBoot-core/font/font.c:456 msgid ".pf2" msgstr "" -#: grub-core/fs/zfs/zfsinfo.c:117 +#: VasEBoot-core/fs/zfs/zfsinfo.c:117 msgid "path" msgstr "" -#: grub-core/fs/zfs/zfsinfo.c:389 +#: VasEBoot-core/fs/zfs/zfsinfo.c:389 #, c-format msgid "zfs-bootfs=%s/%llu%s%s%s%s%s%s" msgstr "" -#: grub-core/fs/zfs/zfsinfo.c:391 +#: VasEBoot-core/fs/zfs/zfsinfo.c:391 msgid ",bootpath=\"" msgstr "" -#: grub-core/fs/zfs/zfsinfo.c:393 grub-core/fs/zfs/zfsinfo.c:396 +#: VasEBoot-core/fs/zfs/zfsinfo.c:393 VasEBoot-core/fs/zfs/zfsinfo.c:396 msgid "\"" msgstr "" -#: grub-core/fs/zfs/zfsinfo.c:394 +#: VasEBoot-core/fs/zfs/zfsinfo.c:394 msgid ",diskdevid=\"" msgstr "" -#: grub-core/gdb/cstub.c:26 +#: VasEBoot-core/gdb/cstub.c:26 msgid "0123456789abcdef" msgstr "" -#: grub-core/lib/i386/halt.c:26 +#: VasEBoot-core/lib/i386/halt.c:26 msgid "Shutdown" msgstr "" -#: grub-core/lib/minilzo/lzoconf.h:48 +#: VasEBoot-core/lib/minilzo/lzoconf.h:48 msgid "2.05" msgstr "" -#: grub-core/lib/minilzo/lzoconf.h:49 +#: VasEBoot-core/lib/minilzo/lzoconf.h:49 msgid "Apr 23 2011" msgstr "" -#: grub-core/lib/minilzo/lzoconf.h:80 grub-core/lib/minilzo/lzoconf.h:233 -#: grub-core/lib/minilzo/minilzo.h:68 include/grub/gcrypt/gcrypt.h:44 +#: VasEBoot-core/lib/minilzo/lzoconf.h:80 VasEBoot-core/lib/minilzo/lzoconf.h:233 +#: VasEBoot-core/lib/minilzo/minilzo.h:68 include/VasEBoot/gcrypt/gcrypt.h:44 msgid "C" msgstr "" -#: grub-core/loader/i386/bsd.c:611 grub-core/loader/i386/bsd.c:613 -#: grub-core/loader/i386/bsd.c:657 grub-core/loader/i386/bsd.c:659 +#: VasEBoot-core/loader/i386/bsd.c:611 VasEBoot-core/loader/i386/bsd.c:613 +#: VasEBoot-core/loader/i386/bsd.c:657 VasEBoot-core/loader/i386/bsd.c:659 msgid "kFreeBSD." msgstr "" -#: grub-core/loader/i386/bsd.c:939 grub-core/loader/i386/linux.c:497 -#: grub-core/loader/i386/xnu.c:870 grub-core/loader/multiboot.c:106 -#: grub-core/term/gfxterm.c:378 +#: VasEBoot-core/loader/i386/bsd.c:939 VasEBoot-core/loader/i386/linux.c:497 +#: VasEBoot-core/loader/i386/xnu.c:870 VasEBoot-core/loader/multiboot.c:106 +#: VasEBoot-core/term/gfxterm.c:378 #, c-format msgid "%s;" msgstr "" -#: grub-core/loader/i386/linux.c:966 +#: VasEBoot-core/loader/i386/linux.c:966 #, c-format msgid "%ux%ux%u,%ux%u" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:119 +#: VasEBoot-core/loader/i386/pc/plan9.c:119 msgid "linuxswap" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:146 grub-core/partmap/plan.c:46 -#: grub-core/partmap/plan.c:55 +#: VasEBoot-core/loader/i386/pc/plan9.c:146 VasEBoot-core/partmap/plan.c:46 +#: VasEBoot-core/partmap/plan.c:55 msgid "part " msgstr "" -#: grub-core/loader/i386/pc/plan9.c:196 +#: VasEBoot-core/loader/i386/pc/plan9.c:196 #, c-format msgid "%s.%d" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:457 grub-core/loader/i386/pc/plan9.c:479 +#: VasEBoot-core/loader/i386/pc/plan9.c:457 VasEBoot-core/loader/i386/pc/plan9.c:479 msgid "bootfile=" msgstr "" -#: grub-core/loader/i386/xnu.c:149 +#: VasEBoot-core/loader/i386/xnu.c:149 msgid "ineIntel" msgstr "" -#: grub-core/loader/i386/xnu.c:159 +#: VasEBoot-core/loader/i386/xnu.c:159 msgid "GenuineIntel" msgstr "" -#: grub-core/loader/i386/bsd.c:50 +#: VasEBoot-core/loader/i386/bsd.c:50 msgid "800x600" msgstr "" @@ -4199,1457 +4199,1457 @@ msgstr "" msgid " bytes" msgstr "" -#: include/grub/lib/envblk.h:22 -msgid "# GRUB Environment Block\n" +#: include/VasEBoot/lib/envblk.h:22 +msgid "# VasEBoot Environment Block\n" msgstr "" -#: include/grub/lib/envblk.h:23 -msgid "grubenv" +#: include/VasEBoot/lib/envblk.h:23 +msgid "VasEBootenv" msgstr "" -#: grub-core/normal/misc.c:120 +#: VasEBoot-core/normal/misc.c:120 msgid "ext*" msgstr "" -#: grub-core/partmap/msdos.c:86 +#: VasEBoot-core/partmap/msdos.c:86 msgid "HP Backup and Recovery Manager (?)" msgstr "" -#: grub-core/partmap/msdos.c:94 +#: VasEBoot-core/partmap/msdos.c:94 msgid "ycgl" msgstr "" -#: grub-core/partmap/msdos.c:100 +#: VasEBoot-core/partmap/msdos.c:100 msgid "Acer registration utility (?)" msgstr "" -#: grub-core/partmap/msdos.c:101 +#: VasEBoot-core/partmap/msdos.c:101 msgid "GREGRegDone.Tag" msgstr "" -#: grub-core/script/execute.c:253 grub-core/script/execute.c:289 +#: VasEBoot-core/script/execute.c:253 VasEBoot-core/script/execute.c:289 msgid "#" msgstr "" -#: grub-core/script/execute.c:292 grub-core/script/execute.c:489 +#: VasEBoot-core/script/execute.c:292 VasEBoot-core/script/execute.c:489 #, c-format msgid "%u" msgstr "" -#: grub-core/script/execute.c:693 +#: VasEBoot-core/script/execute.c:693 msgid "{" msgstr "" -#: grub-core/script/execute.c:705 +#: VasEBoot-core/script/execute.c:705 msgid "}" msgstr "" -#: grub-core/term/usb_keyboard.c:410 +#: VasEBoot-core/term/usb_keyboard.c:410 #, c-format msgid " report: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n" msgstr "" -#: grub-core/loader/i386/pc/plan9.c:47 +#: VasEBoot-core/loader/i386/pc/plan9.c:47 msgid "ZORT 0\r\n" msgstr "" -#: grub-core/loader/i386/bsd.c:486 +#: VasEBoot-core/loader/i386/bsd.c:486 #, c-format msgid " %-18s %-18s%14s%14s\n" msgstr "" -#: grub-core/loader/i386/bsd.c:495 +#: VasEBoot-core/loader/i386/bsd.c:495 #, c-format msgid " %-18s" msgstr "" -#: grub-core/loader/i386/bsd.c:502 +#: VasEBoot-core/loader/i386/bsd.c:502 #, c-format msgid " 0x%08x" msgstr "" -#: grub-core/loader/i386/bsd.c:510 +#: VasEBoot-core/loader/i386/bsd.c:510 #, c-format msgid " 0x%08x\n" msgstr "" -#: grub-core/loader/i386/bsd.c:552 +#: VasEBoot-core/loader/i386/bsd.c:552 #, c-format msgid " %-18s%14s%14s%14s\n" msgstr "" -#: grub-core/loader/i386/bsd.c:556 +#: VasEBoot-core/loader/i386/bsd.c:556 #, c-format msgid " %-18s 0x%08x 0x%08x 0x%08x" msgstr "" -#: grub-core/loader/mips/linux.c:271 grub-core/loader/mips/linux.c:324 -#: grub-core/loader/mips/linux.c:328 +#: VasEBoot-core/loader/mips/linux.c:271 VasEBoot-core/loader/mips/linux.c:324 +#: VasEBoot-core/loader/mips/linux.c:328 msgid "a0" msgstr "" -#: grub-core/fs/btrfs.c:719 grub-core/fs/btrfs.c:814 +#: VasEBoot-core/fs/btrfs.c:719 VasEBoot-core/fs/btrfs.c:814 msgid " (%d stripes (%d substripes) of %" msgstr "" -#: grub-core/fs/btrfs.c:815 +#: VasEBoot-core/fs/btrfs.c:815 msgid ") stripe %" msgstr "" -#: grub-core/fs/btrfs.c:816 +#: VasEBoot-core/fs/btrfs.c:816 msgid " maps to 0x%" msgstr "" -#: grub-core/fs/btrfs.c:824 +#: VasEBoot-core/fs/btrfs.c:824 msgid " for laddr 0x%" msgstr "" -#: grub-core/fs/btrfs.c:1671 grub-core/fs/ext2.c:961 -#: grub-core/fs/reiserfs.c:1363 grub-core/fs/xfs.c:881 +#: VasEBoot-core/fs/btrfs.c:1671 VasEBoot-core/fs/ext2.c:961 +#: VasEBoot-core/fs/reiserfs.c:1363 VasEBoot-core/fs/xfs.c:881 #, c-format msgid "%04x%04x-%04x-%04x-%04x-%04x%04x%04x" msgstr "" -#: grub-core/lib/arg.c:109 grub-core/net/net.c:1169 +#: VasEBoot-core/lib/arg.c:109 VasEBoot-core/net/net.c:1169 #, c-format msgid "%s %s %s\n" msgstr "" -#: grub-core/lib/arg.c:121 +#: VasEBoot-core/lib/arg.c:121 #, c-format msgid "-%c%c " msgstr "" -#: grub-core/lib/arg.c:159 +#: VasEBoot-core/lib/arg.c:159 #, c-format msgid "" "%s\n" "\n" msgstr "" -#: grub-core/normal/menu.c:680 grub-core/normal/menu_entry.c:1126 -#: util/grub-menulst2cfg.c:106 +#: VasEBoot-core/normal/menu.c:680 VasEBoot-core/normal/menu_entry.c:1126 +#: util/VasEBoot-menulst2cfg.c:106 msgid " " msgstr "" -#: grub-core/normal/menu.c:692 +#: VasEBoot-core/normal/menu.c:692 msgid "" "\n" " " msgstr "" -#: grub-core/normal/menu.c:708 +#: VasEBoot-core/normal/menu.c:708 msgid "" "\n" " " msgstr "" -#: grub-core/normal/menu_entry.c:1052 +#: VasEBoot-core/normal/menu_entry.c:1052 msgid "" "\n" " " msgstr "" -#: grub-core/normal/misc.c:76 +#: VasEBoot-core/normal/misc.c:76 msgid ".%02" msgstr "" -#: grub-core/normal/misc.c:80 +#: VasEBoot-core/normal/misc.c:80 #, c-format msgid "%llu%s" msgstr "" -#: grub-core/normal/misc.c:95 +#: VasEBoot-core/normal/misc.c:95 msgid "\t" msgstr "" -#: grub-core/normal/main.c:573 +#: VasEBoot-core/normal/main.c:573 msgid "y" msgstr "" -#: grub-core/normal/menu.c:300 grub-core/normal/menu.c:572 +#: VasEBoot-core/normal/menu.c:300 VasEBoot-core/normal/menu.c:572 msgid "fallback" msgstr "" -#: grub-core/net/net.c:737 +#: VasEBoot-core/net/net.c:737 #, c-format msgid "%02x:" msgstr "" -#: grub-core/net/net.c:1105 +#: VasEBoot-core/net/net.c:1105 #, c-format msgid "%s/%d " msgstr "" -#: grub-core/net/net.c:1152 +#: VasEBoot-core/net/net.c:1152 #, c-format msgid "%s %s\n" msgstr "" -#: grub-core/net/net.c:234 grub-core/net/net.c:272 grub-core/net/net.c:696 -#: grub-core/net/net.c:703 +#: VasEBoot-core/net/net.c:234 VasEBoot-core/net/net.c:272 VasEBoot-core/net/net.c:696 +#: VasEBoot-core/net/net.c:703 msgid ":" msgstr "" -#: grub-core/net/ip.c:427 grub-core/net/ip.c:685 +#: VasEBoot-core/net/ip.c:427 VasEBoot-core/net/ip.c:685 msgid ", expected %" msgstr "" -#: grub-core/disk/geli.c:151 +#: VasEBoot-core/disk/geli.c:151 #, c-format msgid " keysize=%d\n" msgstr "" -#: grub-core/disk/scsi.c:619 +#: VasEBoot-core/disk/scsi.c:619 #, c-format msgid ", blocksize=%u\n" msgstr "" -#: grub-core/fs/iso9660.c:1045 +#: VasEBoot-core/fs/iso9660.c:1045 #, c-format msgid "%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c" msgstr "" -#: grub-core/fs/zfs/zfs.c:1492 +#: VasEBoot-core/fs/zfs/zfs.c:1492 msgid "big-endian gang\n" msgstr "" -#: grub-core/fs/zfs/zfs.c:1660 +#: VasEBoot-core/fs/zfs/zfs.c:1660 msgid ", %p) for txg %" msgstr "" -#: include/grub/lvm.h:65 +#: include/VasEBoot/lvm.h:65 msgid " LVM2 x[5A%r0N*>" msgstr "" -#: grub-core/video/sm712.c:267 +#: VasEBoot-core/video/sm712.c:267 #, c-format msgid " .byte 0x%04x, 0x00\n" msgstr "" -#: grub-core/kern/efi/mm.c:429 +#: VasEBoot-core/kern/efi/mm.c:429 #, c-format msgid "MD: t=%x, p=%llx, v=%llx, n=%llx, a=%llx\n" msgstr "" -#: grub-core/kern/mm.c:402 +#: VasEBoot-core/kern/mm.c:402 #, c-format msgid "%s:%d: q=%p, q->size=0x%x, q->magic=0x%x\n" msgstr "" -#: grub-core/kern/mm.c:501 grub-core/kern/mm.c:529 +#: VasEBoot-core/kern/mm.c:501 VasEBoot-core/kern/mm.c:529 #, c-format msgid "F:%p:%u:%p\n" msgstr "" -#: grub-core/kern/mm.c:516 +#: VasEBoot-core/kern/mm.c:516 #, c-format msgid "called at line %u\n" msgstr "" -#: grub-core/kern/mm.c:533 +#: VasEBoot-core/kern/mm.c:533 #, c-format msgid "A:%p:%u\n" msgstr "" -#: grub-core/kern/mm.c:548 +#: VasEBoot-core/kern/mm.c:548 msgid "%s:%d: malloc (0x%" msgstr "" -#: grub-core/kern/mm.c:548 grub-core/kern/mm.c:561 grub-core/kern/mm.c:580 -#: grub-core/kern/mm.c:595 +#: VasEBoot-core/kern/mm.c:548 VasEBoot-core/kern/mm.c:561 VasEBoot-core/kern/mm.c:580 +#: VasEBoot-core/kern/mm.c:595 msgid ") = " msgstr "" -#: grub-core/kern/mm.c:551 grub-core/kern/mm.c:564 grub-core/kern/mm.c:583 -#: grub-core/kern/mm.c:598 +#: VasEBoot-core/kern/mm.c:551 VasEBoot-core/kern/mm.c:564 VasEBoot-core/kern/mm.c:583 +#: VasEBoot-core/kern/mm.c:598 #, c-format msgid "%p\n" msgstr "" -#: grub-core/kern/mm.c:561 +#: VasEBoot-core/kern/mm.c:561 msgid "%s:%d: zalloc (0x%" msgstr "" -#: grub-core/kern/mm.c:572 +#: VasEBoot-core/kern/mm.c:572 #, c-format msgid "%s:%d: free (%p)\n" msgstr "" -#: grub-core/kern/mm.c:580 +#: VasEBoot-core/kern/mm.c:580 msgid "%s:%d: realloc (%p, 0x%" msgstr "" -#: grub-core/kern/mm.c:594 +#: VasEBoot-core/kern/mm.c:594 msgid "%s:%d: memalign (0x%" msgstr "" -#: grub-core/lib/hexdump.c:49 grub-core/normal/menu_entry.c:1023 +#: VasEBoot-core/lib/hexdump.c:49 VasEBoot-core/normal/menu_entry.c:1023 msgid " " msgstr "" -#: grub-core/lib/hexdump.c:71 +#: VasEBoot-core/lib/hexdump.c:71 msgid "*\n" msgstr "" -#: grub-core/lib/i386/backtrace.c:38 +#: VasEBoot-core/lib/i386/backtrace.c:38 #, c-format msgid "%p: " msgstr "" -#: grub-core/lib/i386/backtrace.c:40 +#: VasEBoot-core/lib/i386/backtrace.c:40 msgid " (" msgstr "" -#: grub-core/lib/i386/backtrace.c:42 +#: VasEBoot-core/lib/i386/backtrace.c:42 #, c-format msgid "%p," msgstr "" -#: grub-core/lib/i386/backtrace.c:43 +#: VasEBoot-core/lib/i386/backtrace.c:43 #, c-format msgid "%p)\n" msgstr "" -#: grub-core/net/net.c:738 +#: VasEBoot-core/net/net.c:738 msgid "XX:" msgstr "" -#: util/grub-mkimagexx.c:131 +#: util/VasEBoot-mkimagexx.c:131 msgid "_start" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:240 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:240 msgid "°" msgstr "" -#: grub-core/kern/emu/argp_common.c:33 util/grub-editenv.c:61 -#: util/grub-fstest.c:531 util/grub-mount.c:449 +#: VasEBoot-core/kern/emu/argp_common.c:33 util/VasEBoot-editenv.c:61 +#: util/VasEBoot-fstest.c:531 util/VasEBoot-mount.c:449 #, c-format msgid "%s (%s) %s\n" msgstr "" -#: grub-core/video/sm712.c:252 grub-core/video/sm712.c:266 +#: VasEBoot-core/video/sm712.c:252 VasEBoot-core/video/sm712.c:266 #, c-format msgid "FAIL\n" msgstr "" -#: grub-core/lib/hexdump.c:34 +#: VasEBoot-core/lib/hexdump.c:34 #, c-format msgid "%08lx " msgstr "" -#: grub-core/lib/backtrace.c:41 +#: VasEBoot-core/lib/backtrace.c:41 msgid "%s.%x+%" msgstr "" -#: grub-core/commands/minicmd.c:113 +#: VasEBoot-core/commands/minicmd.c:113 #, c-format msgid "%x%x " msgstr "" -#: grub-core/commands/minicmd.c:158 +#: VasEBoot-core/commands/minicmd.c:158 #, c-format msgid "%s\t%d\t\t" msgstr "" -#: grub-core/disk/arc/arcdisk.c:238 grub-core/disk/arc/arcdisk.c:275 +#: VasEBoot-core/disk/arc/arcdisk.c:238 VasEBoot-core/disk/arc/arcdisk.c:275 #, c-format msgid " failed: %ld\n" msgstr "" -#: grub-core/lib/xzembed/xz_stream.h:38 +#: VasEBoot-core/lib/xzembed/xz_stream.h:38 msgid "YZ" msgstr "" -#: grub-core/font/font.c:197 +#: VasEBoot-core/font/font.c:197 msgid "" msgstr "" -#: grub-core/font/font.c:635 +#: VasEBoot-core/font/font.c:635 msgid "Unknown" msgstr "" -#: grub-core/lib/crypto.c:83 grub-core/lib/libgcrypt_wrap/mem.c:99 +#: VasEBoot-core/lib/crypto.c:83 VasEBoot-core/lib/libgcrypt_wrap/mem.c:99 msgid "gcrypt" msgstr "" -#: grub-core/lib/crypto.c:85 +#: VasEBoot-core/lib/crypto.c:85 msgid "gcrypt error: " msgstr "" -#: grub-core/commands/acpihalt.c:217 +#: VasEBoot-core/commands/acpihalt.c:217 msgid "\\" msgstr "" -#: grub-core/commands/minicmd.c:85 +#: VasEBoot-core/commands/minicmd.c:85 #, c-format msgid "%s (%d%c)\t%s\n" msgstr "" -#: grub-core/commands/probe.c:77 grub-core/commands/probe.c:91 -#: util/grub-mkimage.c:1905 +#: VasEBoot-core/commands/probe.c:77 VasEBoot-core/commands/probe.c:91 +#: util/VasEBoot-mkimage.c:1905 msgid "none" msgstr "" -#: grub-core/lib/libgcrypt_wrap/mem.c:101 +#: VasEBoot-core/lib/libgcrypt_wrap/mem.c:101 msgid "gcrypt: " msgstr "" -#: grub-core/lib/libgcrypt_wrap/mem.c:113 +#: VasEBoot-core/lib/libgcrypt_wrap/mem.c:113 msgid "gcrypt bug: " msgstr "" -#: grub-core/lib/posix_wrap/assert.h:30 +#: VasEBoot-core/lib/posix_wrap/assert.h:30 #, c-format msgid "Assertion failed at %s:%d\n" msgstr "" -#: include/grub/list.h:42 -msgid "bad type cast between incompatible grub types" +#: include/VasEBoot/list.h:42 +msgid "bad type cast between incompatible VasEBoot types" msgstr "" -#: grub-core/kern/mm.c:117 +#: VasEBoot-core/kern/mm.c:117 #, c-format msgid "Using memory for heap: start=%p, end=%p\n" msgstr "" -#: grub-core/loader/efi/chainloader.c:263 +#: VasEBoot-core/loader/efi/chainloader.c:263 msgid "file path: " msgstr "" -#: grub-core/net/net.c:720 +#: VasEBoot-core/net/net.c:720 #, c-format msgid "Unknown address type %d" msgstr "" -#: grub-core/normal/misc.c:164 +#: VasEBoot-core/normal/misc.c:164 #, c-format msgid ", UUID %s" msgstr "" -#: grub-core/video/readers/jpeg.c:817 +#: VasEBoot-core/video/readers/jpeg.c:817 msgid "Tests loading of JPEG bitmap." msgstr "" -#: grub-core/video/readers/png.c:959 +#: VasEBoot-core/video/readers/png.c:959 msgid "Tests loading of PNG bitmap." msgstr "" -#: grub-core/video/readers/tga.c:485 +#: VasEBoot-core/video/readers/tga.c:485 msgid "Tests loading of TGA bitmap." msgstr "" -#: util/grub-mkimagexx.c:107 +#: util/VasEBoot-mkimagexx.c:107 #, c-format msgid "undefined symbol %s" msgstr "" -#: util/grub-mkimagexx.c:112 +#: util/VasEBoot-mkimagexx.c:112 #, c-format msgid "section %d does not exist" msgstr "" -#: util/grub-mkimagexx.c:348 +#: util/VasEBoot-mkimagexx.c:348 msgid "trampoline offset too big (%" msgstr "" -#: util/grub-mkimagexx.c:395 +#: util/VasEBoot-mkimagexx.c:395 #, c-format msgid " at the offset 0x%llx" msgstr "" -#: util/grub-mkimagexx.c:412 +#: util/VasEBoot-mkimagexx.c:412 #, c-format msgid "unknown architecture type %d" msgstr "" -#: util/grub-mkimagexx.c:502 +#: util/VasEBoot-mkimagexx.c:502 msgid "too many fixup entries" msgstr "" -#: util/grub-mkimagexx.c:584 +#: util/VasEBoot-mkimagexx.c:584 msgid "can't add fixup entry for R_X86_64_32(S)" msgstr "" -#: util/grub-mkimagexx.c:639 +#: util/VasEBoot-mkimagexx.c:639 #, c-format msgid "unknown machine type 0x%x" msgstr "" -#: util/grub-mkimagexx.c:828 +#: util/VasEBoot-mkimagexx.c:828 msgid "invalid ELF header" msgstr "" -#: util/grub-mkimagexx.c:946 +#: util/VasEBoot-mkimagexx.c:946 msgid "start symbol is not defined" msgstr "" -#: grub-core/commands/acpihalt.c:132 grub-core/commands/acpihalt.c:284 +#: VasEBoot-core/commands/acpihalt.c:132 VasEBoot-core/commands/acpihalt.c:284 #, c-format msgid "Unknown opcode 0x%x\n" msgstr "" -#: grub-core/commands/acpihalt.c:176 +#: VasEBoot-core/commands/acpihalt.c:176 #, c-format msgid "Unexpected extended opcode: 0x%x\n" msgstr "" -#: grub-core/commands/acpihalt.c:226 +#: VasEBoot-core/commands/acpihalt.c:226 #, c-format msgid "Unknown opcode in _S5: 0x%x\n" msgstr "" -#: grub-core/commands/acpihalt.c:245 +#: VasEBoot-core/commands/acpihalt.c:245 #, c-format msgid "Unknown data type in _S5: 0x%x\n" msgstr "" -#: grub-core/commands/acpihalt.c:301 +#: VasEBoot-core/commands/acpihalt.c:301 #, c-format msgid "Usage: %s FILE\n" msgstr "" -#: grub-core/commands/acpihalt.c:305 +#: VasEBoot-core/commands/acpihalt.c:305 #, c-format msgid "Couldn't open file\n" msgstr "" -#: grub-core/commands/acpihalt.c:326 +#: VasEBoot-core/commands/acpihalt.c:326 #, c-format msgid "Sleep type = %d\n" msgstr "" -#: grub-core/loader/sparc64/ieee1275/linux.c:456 +#: VasEBoot-core/loader/sparc64/ieee1275/linux.c:456 msgid "Cannot find /virtual-memory node.\n" msgstr "" -#: grub-core/loader/sparc64/ieee1275/linux.c:462 +#: VasEBoot-core/loader/sparc64/ieee1275/linux.c:462 msgid "Cannot find /virtual-memory/translations size.\n" msgstr "" -#: grub-core/loader/sparc64/ieee1275/linux.c:469 +#: VasEBoot-core/loader/sparc64/ieee1275/linux.c:469 msgid "Cannot allocate translations buffer.\n" msgstr "" -#: grub-core/loader/sparc64/ieee1275/linux.c:475 +#: VasEBoot-core/loader/sparc64/ieee1275/linux.c:475 msgid "Cannot fetch /virtual-memory/translations property.\n" msgstr "" -#: grub-core/mmap/efi/mmap.c:87 +#: VasEBoot-core/mmap/efi/mmap.c:87 #, c-format msgid "Unknown memory type %d, considering reserved\n" msgstr "" -#: grub-core/gdb/cstub.c:215 +#: VasEBoot-core/gdb/cstub.c:215 #, c-format msgid "Unhandled exception 0x%x at " msgstr "" -#: grub-core/gfxmenu/view.c:476 +#: VasEBoot-core/gfxmenu/view.c:476 #, c-format msgid "Booting '%s'" msgstr "" -#: grub-core/gfxmenu/view.c:494 +#: VasEBoot-core/gfxmenu/view.c:494 #, c-format msgid "Falling back to '%s'" msgstr "" -#: grub-core/disk/ieee1275/ofdisk.c:524 grub-core/kern/ieee1275/init.c:98 +#: VasEBoot-core/disk/ieee1275/ofdisk.c:524 VasEBoot-core/kern/ieee1275/init.c:98 msgid "/chosen/bootpath property missing!\n" msgstr "" -#: grub-core/commands/videotest.c:95 grub-core/commands/videotest.c:100 +#: VasEBoot-core/commands/videotest.c:95 VasEBoot-core/commands/videotest.c:100 msgid "The quick brown fox jumped over the lazy dog." msgstr "" -#: grub-core/commands/videotest.c:122 +#: VasEBoot-core/commands/videotest.c:122 msgid "Unicode test: happy☺ £ 5.00 ¡τäu! ℤ⊆ℝ" msgstr "" -#: grub-core/kern/i386/multiboot_mmap.c:51 +#: VasEBoot-core/kern/i386/multiboot_mmap.c:51 #, c-format msgid "" "WARNING: Memory map size exceeds limit (0x%x > 0x%x); it will be truncated\n" msgstr "" -#: grub-core/kern/main.c:261 +#: VasEBoot-core/kern/main.c:261 msgid "" -"Welcome to GRUB!\n" +"Welcome to VasEBoot!\n" "\n" msgstr "" -#: grub-core/kern/misc.c:1105 +#: VasEBoot-core/kern/misc.c:1105 msgid "" "\n" "Aborted." msgstr "" -#: grub-core/kern/misc.c:1111 +#: VasEBoot-core/kern/misc.c:1111 msgid " Press any key to exit." msgstr "" -#: grub-core/kern/err.c:131 +#: VasEBoot-core/kern/err.c:131 msgid "assert: error stack overflow detected!\n" msgstr "" -#: grub-core/kern/ieee1275/init.c:202 +#: VasEBoot-core/kern/ieee1275/init.c:202 msgid "Warning: attempt to claim over our own code!\n" msgstr "" -#: grub-core/lib/arg.c:177 +#: VasEBoot-core/lib/arg.c:177 #, c-format msgid "" "\n" "Report bugs to <%s>.\n" msgstr "" -#: grub-core/lib/i386/backtrace.c:48 +#: VasEBoot-core/lib/i386/backtrace.c:48 #, c-format msgid "Invalid stack frame at %p (%p)\n" msgstr "" -#: grub-core/kern/efi/mm.c:511 +#: VasEBoot-core/kern/efi/mm.c:511 msgid "printing memory map\n" msgstr "" -#: grub-core/bus/emu/pci.c:58 +#: VasEBoot-core/bus/emu/pci.c:58 #, c-format msgid "mapping 0x%x failed (error %d)\n" msgstr "" -#: grub-core/bus/usb/ehci.c:1572 +#: VasEBoot-core/bus/usb/ehci.c:1572 #, c-format msgid "%s: prev not found, queues are corrupt\n" msgstr "" -#: grub-core/commands/boottime.c:46 +#: VasEBoot-core/commands/boottime.c:46 #, c-format msgid "%3d.%03ds %2d.%03ds %s:%d %s\n" msgstr "" -#: grub-core/commands/date.c:49 +#: VasEBoot-core/commands/date.c:49 #, c-format msgid "%d-%02d-%02d %02d:%02d:%02d %s\n" msgstr "" -#: grub-core/commands/i386/pc/drivemap.c:195 +#: VasEBoot-core/commands/i386/pc/drivemap.c:195 #, c-format msgid "%cD #%-3u (0x%02x) %cd%d\n" msgstr "" -#: grub-core/commands/i386/pc/drivemap.c:259 +#: VasEBoot-core/commands/i386/pc/drivemap.c:259 msgid "Swapping" msgstr "" -#: grub-core/commands/i386/pc/drivemap.c:259 +#: VasEBoot-core/commands/i386/pc/drivemap.c:259 msgid "Mapping" msgstr "" -#: grub-core/kern/rescue_parser.c:71 +#: VasEBoot-core/kern/rescue_parser.c:71 msgid "Try `help' for usage\n" msgstr "" -#: grub-core/kern/rescue_reader.c:81 +#: VasEBoot-core/kern/rescue_reader.c:81 msgid "Entering rescue mode...\n" msgstr "" -#: grub-core/kern/corecmd.c:153 +#: VasEBoot-core/kern/corecmd.c:153 #, c-format msgid "(%s): Filesystem is %s.\n" msgstr "" -#: grub-core/kern/corecmd.c:154 +#: VasEBoot-core/kern/corecmd.c:154 msgid "unknown" msgstr "" -#: grub-core/commands/ls.c:157 +#: VasEBoot-core/commands/ls.c:157 #, c-format msgid " %d-%02d-%02d %02d:%02d:%02d %-11s " msgstr "" -#: grub-core/commands/ls.c:163 +#: VasEBoot-core/commands/ls.c:163 #, c-format msgid " %04d%02d%02d%02d%02d%02d " msgstr "" -#: grub-core/commands/testload.c:72 +#: VasEBoot-core/commands/testload.c:72 #, c-format msgid "Reading %s sequentially" msgstr "" -#: grub-core/commands/testload.c:76 grub-core/commands/testload.c:101 -#: grub-core/commands/testload.c:140 +#: VasEBoot-core/commands/testload.c:76 VasEBoot-core/commands/testload.c:101 +#: VasEBoot-core/commands/testload.c:140 msgid " Done.\n" msgstr "" -#: grub-core/commands/testload.c:79 +#: VasEBoot-core/commands/testload.c:79 #, c-format msgid "Reading %s sequentially again" msgstr "" -#: grub-core/commands/testload.c:96 grub-core/commands/testload.c:125 +#: VasEBoot-core/commands/testload.c:96 VasEBoot-core/commands/testload.c:125 #, c-format msgid "" "\n" "Differs in %lld\n" msgstr "" -#: grub-core/commands/testload.c:104 +#: VasEBoot-core/commands/testload.c:104 #, c-format msgid "Reading %s backwards" msgstr "" -#: grub-core/commands/keylayouts.c:177 +#: VasEBoot-core/commands/keylayouts.c:177 #, c-format msgid "Unknown key 0x%x detected\n" msgstr "" -#: grub-core/commands/videotest.c:203 +#: VasEBoot-core/commands/videotest.c:203 #, c-format msgid "color %d: %08x\n" msgstr "" -#: grub-core/kern/efi/mm.c:196 +#: VasEBoot-core/kern/efi/mm.c:196 msgid "Trying to terminate EFI services again\n" msgstr "" -#: grub-core/kern/emu/hostdisk.c:639 +#: VasEBoot-core/kern/emu/hostdisk.c:639 #, c-format msgid "cannot get disk label of `%s'" msgstr "" -#: grub-core/term/at_keyboard.c:370 +#: VasEBoot-core/term/at_keyboard.c:370 msgid "No supported scancode set found\n" msgstr "" -#: grub-core/term/usb_keyboard.c:402 +#: VasEBoot-core/term/usb_keyboard.c:402 #, c-format msgid "%s failed. Stopped\n" msgstr "" -#: util/grub-setup.c:343 +#: util/VasEBoot-setup.c:343 #, c-format msgid "guessing the root device failed, because of `%s'" msgstr "" -#: grub-core/commands/keylayouts.c:177 +#: VasEBoot-core/commands/keylayouts.c:177 #, c-format msgid "Unknown key 0x%x detected\n" msgstr "" -#: grub-core/commands/videotest.c:203 +#: VasEBoot-core/commands/videotest.c:203 #, c-format msgid "color %d: %08x\n" msgstr "" -#: grub-core/kern/efi/mm.c:196 +#: VasEBoot-core/kern/efi/mm.c:196 msgid "Trying to terminate EFI services again\n" msgstr "" -#: grub-core/kern/emu/hostdisk.c:639 +#: VasEBoot-core/kern/emu/hostdisk.c:639 #, c-format msgid "cannot get disk label of `%s'" msgstr "" -#: grub-core/term/at_keyboard.c:370 +#: VasEBoot-core/term/at_keyboard.c:370 msgid "No supported scancode set found\n" msgstr "" -#: grub-core/term/usb_keyboard.c:402 +#: VasEBoot-core/term/usb_keyboard.c:402 #, c-format msgid "%s failed. Stopped\n" msgstr "" -#: util/grub-setup.c:343 +#: util/VasEBoot-setup.c:343 #, c-format msgid "guessing the root device failed, because of `%s'" msgstr "" -#: grub-core/commands/cat.c:106 +#: VasEBoot-core/commands/cat.c:106 #, c-format msgid "%C" msgstr "" -#: grub-core/fs/zfs/zfs.c:284 +#: VasEBoot-core/fs/zfs/zfs.c:284 msgid "org.illumos:lz4_compress" msgstr "" -#: grub-core/fs/zfs/zfs.c:350 +#: VasEBoot-core/fs/zfs/zfs.c:350 msgid "lz4" msgstr "" -#: include/grub/cbfs_core.h:125 +#: include/VasEBoot/cbfs_core.h:125 msgid "LARCHIVE" msgstr "" -#: include/grub/zfs/dmu.h:162 +#: include/VasEBoot/zfs/dmu.h:162 msgid "features_for_read" msgstr "" -#: util/grub-mkimage.c:495 util/grub-mkimage.c:496 +#: util/VasEBoot-mkimage.c:495 util/VasEBoot-mkimage.c:496 msgid "arm-uboot" msgstr "" -#: util/grub-mkimage.c:514 util/grub-mkimage.c:515 +#: util/VasEBoot-mkimage.c:514 util/VasEBoot-mkimage.c:515 msgid "arm-efi" msgstr "" -#: grub-core/fs/newc.c:61 +#: VasEBoot-core/fs/newc.c:61 msgid "newc" msgstr "" -#: grub-core/fs/odc.c:49 +#: VasEBoot-core/fs/odc.c:49 msgid "odc" msgstr "" -#: grub-core/fs/cpio.c:49 +#: VasEBoot-core/fs/cpio.c:49 msgid "cpiofs" msgstr "" -#: grub-core/fs/cpio_be.c:49 +#: VasEBoot-core/fs/cpio_be.c:49 msgid "cpiofs_be" msgstr "" -#: grub-core/fs/cpio_common.c:153 +#: VasEBoot-core/fs/cpio_common.c:153 msgid " filesystem" msgstr "" -#: include/grub/uboot/api_public.h:65 +#: include/VasEBoot/uboot/api_public.h:65 msgid "UBootAPI" msgstr "" -#: grub-core/net/drivers/uboot/ubootnet.c:146 +#: VasEBoot-core/net/drivers/uboot/ubootnet.c:146 #, c-format msgid "ubnet_%d" msgstr "" -#: grub-core/loader/arm/linux.c:103 +#: VasEBoot-core/loader/arm/linux.c:103 msgid "linux,initrd-start" msgstr "" -#: grub-core/loader/arm/linux.c:107 +#: VasEBoot-core/loader/arm/linux.c:107 msgid "linux,initrd-end" msgstr "" -#: grub-core/kern/uboot/init.c:131 -msgid "grub_bootdev" +#: VasEBoot-core/kern/uboot/init.c:131 +msgid "VasEBoot_bootdev" msgstr "" -#: grub-core/kern/uboot/init.c:141 -msgid "grub_bootpath" +#: VasEBoot-core/kern/uboot/init.c:141 +msgid "VasEBoot_bootpath" msgstr "" -#: grub-core/kern/arm/dl_helper.c:106 +#: VasEBoot-core/kern/arm/dl_helper.c:106 msgid "BLX" msgstr "" -#: grub-core/kern/arm/dl_helper.c:106 +#: VasEBoot-core/kern/arm/dl_helper.c:106 msgid "BL" msgstr "" -#: grub-core/term/uboot/console.c:130 -msgid "grub_term" +#: VasEBoot-core/term/uboot/console.c:130 +msgid "VasEBoot_term" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:203 +#: VasEBoot-core/gfxmenu/theme_loader.c:203 msgid "terminal-border" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:209 +#: VasEBoot-core/gfxmenu/theme_loader.c:209 msgid "terminal-left" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:219 +#: VasEBoot-core/gfxmenu/theme_loader.c:219 msgid "terminal-top" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:229 +#: VasEBoot-core/gfxmenu/theme_loader.c:229 msgid "terminal-width" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:239 +#: VasEBoot-core/gfxmenu/theme_loader.c:239 msgid "terminal-height" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:181 +#: VasEBoot-core/gfxmenu/theme_loader.c:181 msgid "desktop-image-scale-method" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:186 +#: VasEBoot-core/gfxmenu/theme_loader.c:186 msgid "crop" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:189 +#: VasEBoot-core/gfxmenu/theme_loader.c:189 msgid "padding" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:192 +#: VasEBoot-core/gfxmenu/theme_loader.c:192 msgid "fitwidth" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:195 +#: VasEBoot-core/gfxmenu/theme_loader.c:195 msgid "fitheight" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:203 +#: VasEBoot-core/gfxmenu/theme_loader.c:203 msgid "desktop-image-h-align" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:216 +#: VasEBoot-core/gfxmenu/theme_loader.c:216 msgid "desktop-image-v-align" msgstr "" -#: grub-core/gfxmenu/theme_loader.c:222 +#: VasEBoot-core/gfxmenu/theme_loader.c:222 msgid "bottom" msgstr "" -#: include/grub/emu/misc.h:29 +#: include/VasEBoot/emu/misc.h:29 msgid "C:\\" msgstr "" -#: grub-core/disk/diskfilter.c:120 util/grub-probe.c:298 +#: VasEBoot-core/disk/diskfilter.c:120 util/VasEBoot-probe.c:298 msgid "lvmid/" msgstr "" -#: grub-core/kern/emu/hostdisk_devmapper.c:112 +#: VasEBoot-core/kern/emu/hostdisk_devmapper.c:112 msgid "LVM-" msgstr "" -#: grub-core/kern/emu/hostdisk_devmapper.c:113 +#: VasEBoot-core/kern/emu/hostdisk_devmapper.c:113 msgid "mpath-" msgstr "" -#: grub-core/kern/emu/hostdisk_devmapper.c:114 +#: VasEBoot-core/kern/emu/hostdisk_devmapper.c:114 msgid "DMRAID-" msgstr "" -#: util/grub-probe.c:749 +#: util/VasEBoot-probe.c:749 #, c-format msgid "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" msgstr "" -#: util/grub-probe.c:843 +#: util/VasEBoot-probe.c:843 msgid "gpt_parttype" msgstr "" -#: grub-core/kern/uboot/init.c:85 +#: VasEBoot-core/kern/uboot/init.c:85 msgid "invalid U-Boot API version\n" msgstr "" -#: util/grub-mknetdir.c:144 +#: util/VasEBoot-mknetdir.c:144 #, c-format -msgid "source %s/grub.cfg" +msgid "source %s/VasEBoot.cfg" msgstr "" -#: util/grub-mknetdir.c:149 +#: util/VasEBoot-mknetdir.c:149 msgid "core" msgstr "" -#: util/grub-mknetdir.c:174 +#: util/VasEBoot-mknetdir.c:174 msgid "/srv/tftp" msgstr "" -#: util/grub-mkpasswd-pbkdf2.c:188 +#: util/VasEBoot-mkpasswd-pbkdf2.c:188 msgid "XXXXXXXXXXXXXXXXXXX" msgstr "" -#: util/grub-mkrescue.c:71 +#: util/VasEBoot-mkrescue.c:71 #, c-format msgid "%s=%s" msgstr "" -#: util/grub-mkrescue.c:97 +#: util/VasEBoot-mkrescue.c:97 msgid "rom-directory" msgstr "" -#: util/grub-mkrescue.c:99 util/grub-mkrescue.c:373 +#: util/VasEBoot-mkrescue.c:99 util/VasEBoot-mkrescue.c:373 msgid "xorriso" msgstr "" -#: util/grub-mkrescue.c:102 -msgid "grub-glue-efi" +#: util/VasEBoot-mkrescue.c:102 +msgid "VasEBoot-glue-efi" msgstr "" -#: util/grub-mkrescue.c:103 -msgid "grub-render-label" +#: util/VasEBoot-mkrescue.c:103 +msgid "VasEBoot-render-label" msgstr "" -#: util/grub-mkrescue.c:104 +#: util/VasEBoot-mkrescue.c:104 msgid "label-font" msgstr "" -#: util/grub-mkrescue.c:105 +#: util/VasEBoot-mkrescue.c:105 msgid "label-color" msgstr "" -#: util/grub-mkrescue.c:106 +#: util/VasEBoot-mkrescue.c:106 msgid "label-bgcolor" msgstr "" -#: util/grub-mkrescue.c:107 +#: util/VasEBoot-mkrescue.c:107 msgid "product-name" msgstr "" -#: util/grub-mkrescue.c:108 +#: util/VasEBoot-mkrescue.c:108 msgid "product-version" msgstr "" -#: util/grub-mkrescue.c:109 +#: util/VasEBoot-mkrescue.c:109 msgid "sparc-boot" msgstr "" -#: util/grub-mkrescue.c:110 +#: util/VasEBoot-mkrescue.c:110 msgid "arcs-boot" msgstr "" -#: util/grub-mkrescue.c:120 +#: util/VasEBoot-mkrescue.c:120 msgid "xorriso -as mkisofs -help" msgstr "" -#: util/grub-mkrescue.c:236 +#: util/VasEBoot-mkrescue.c:236 #, c-format msgid "insmod %s\n" msgstr "" -#: util/grub-mkrescue.c:258 +#: util/VasEBoot-mkrescue.c:258 #, c-format msgid "search --fs-uuid --set=root %s" msgstr "" -#: util/grub-mkrescue.c:259 +#: util/VasEBoot-mkrescue.c:259 #, c-format -msgid "set prefix=(${root})/boot/grub" +msgid "set prefix=(${root})/boot/VasEBoot" msgstr "" -#: util/grub-mkrescue.c:266 util/grub-mkrescue.c:479 util/grub-mkrescue.c:523 -msgid "/boot/grub" +#: util/VasEBoot-mkrescue.c:266 util/VasEBoot-mkrescue.c:479 util/VasEBoot-mkrescue.c:523 +msgid "/boot/VasEBoot" msgstr "" -#: util/grub-mkrescue.c:305 -msgid "()/boot/grub" +#: util/VasEBoot-mkrescue.c:305 +msgid "()/boot/VasEBoot" msgstr "" -#: util/grub-mkrescue.c:322 util/grub-mkrescue.c:382 +#: util/VasEBoot-mkrescue.c:322 util/VasEBoot-mkrescue.c:382 msgid "-as" msgstr "" -#: util/grub-mkrescue.c:323 util/grub-mkrescue.c:383 +#: util/VasEBoot-mkrescue.c:323 util/VasEBoot-mkrescue.c:383 msgid "mkisofs" msgstr "" -#: util/grub-mkrescue.c:324 +#: util/VasEBoot-mkrescue.c:324 msgid "-help" msgstr "" -#: util/grub-mkrescue.c:374 +#: util/VasEBoot-mkrescue.c:374 msgid "unicode.pf2" msgstr "" -#: util/grub-mkrescue.c:384 +#: util/VasEBoot-mkrescue.c:384 msgid "-graft-points" msgstr "" -#: util/grub-mkrescue.c:390 +#: util/VasEBoot-mkrescue.c:390 msgid "roms" msgstr "" -#: util/grub-mkrescue.c:442 +#: util/VasEBoot-mkrescue.c:442 #, c-format msgid "%04d-%02d-%02d-%02d-%02d-%02d-00" msgstr "" -#: util/grub-mkrescue.c:454 +#: util/VasEBoot-mkrescue.c:454 msgid "--modification-date=" msgstr "" -#: util/grub-mkrescue.c:468 +#: util/VasEBoot-mkrescue.c:468 msgid "eltorito.img" msgstr "" -#: util/grub-mkrescue.c:471 +#: util/VasEBoot-mkrescue.c:471 msgid "BIOS" msgstr "" -#: util/grub-mkrescue.c:481 util/mkimage.c:180 +#: util/VasEBoot-mkrescue.c:481 util/mkimage.c:180 msgid "i386-pc-eltorito" msgstr "" -#: util/grub-mkrescue.c:484 -msgid "boot/grub/i386-pc/eltorito.img" +#: util/VasEBoot-mkrescue.c:484 +msgid "boot/VasEBoot/i386-pc/eltorito.img" msgstr "" -#: util/grub-mkrescue.c:485 +#: util/VasEBoot-mkrescue.c:485 msgid "-no-emul-boot" msgstr "" -#: util/grub-mkrescue.c:486 +#: util/VasEBoot-mkrescue.c:486 msgid "-boot-load-size" msgstr "" -#: util/grub-mkrescue.c:487 +#: util/VasEBoot-mkrescue.c:487 msgid "4" msgstr "" -#: util/grub-mkrescue.c:488 +#: util/VasEBoot-mkrescue.c:488 msgid "-boot-info-table" msgstr "" -#: util/grub-mkrescue.c:491 -msgid "grub2-boot-info" +#: util/VasEBoot-mkrescue.c:491 +msgid "VasEBoot2-boot-info" msgstr "" -#: util/grub-mkrescue.c:494 +#: util/VasEBoot-mkrescue.c:494 msgid "boot_hybrid.img" msgstr "" -#: util/grub-mkrescue.c:495 -msgid "--grub2-boot-info" +#: util/VasEBoot-mkrescue.c:495 +msgid "--VasEBoot2-boot-info" msgstr "" -#: util/grub-mkrescue.c:496 -msgid "--grub2-mbr" +#: util/VasEBoot-mkrescue.c:496 +msgid "--VasEBoot2-mbr" msgstr "" -#: util/grub-mkrescue.c:537 util/grub-mkrescue.c:742 +#: util/VasEBoot-mkrescue.c:537 util/VasEBoot-mkrescue.c:742 msgid "-G" msgstr "" -#: util/grub-mkrescue.c:550 +#: util/VasEBoot-mkrescue.c:550 msgid "i386-multiboot/core.elf" msgstr "" -#: util/grub-mkrescue.c:555 +#: util/VasEBoot-mkrescue.c:555 msgid "ofwx86.elf" msgstr "" -#: util/grub-mkrescue.c:565 +#: util/VasEBoot-mkrescue.c:565 msgid "System" msgstr "" -#: util/grub-mkrescue.c:565 +#: util/VasEBoot-mkrescue.c:565 msgid "Library" msgstr "" -#: util/grub-mkrescue.c:565 +#: util/VasEBoot-mkrescue.c:565 msgid "CoreServices" msgstr "" -#: util/grub-mkrescue.c:568 +#: util/VasEBoot-mkrescue.c:568 msgid "mach_kernel" msgstr "" -#: util/grub-mkrescue.c:573 +#: util/VasEBoot-mkrescue.c:573 msgid "SystemVersion.plist" msgstr "" -#: util/grub-mkrescue.c:587 +#: util/VasEBoot-mkrescue.c:587 msgid ".disk_label" msgstr "" -#: util/grub-mkrescue.c:589 +#: util/VasEBoot-mkrescue.c:589 msgid "white" msgstr "" -#: util/grub-mkrescue.c:590 +#: util/VasEBoot-mkrescue.c:590 msgid "black" msgstr "" -#: util/grub-mkrescue.c:592 +#: util/VasEBoot-mkrescue.c:592 msgid ".disk_label.contentDetails" msgstr "" -#: util/grub-mkrescue.c:600 +#: util/VasEBoot-mkrescue.c:600 msgid "-hfsplus" msgstr "" -#: util/grub-mkrescue.c:601 +#: util/VasEBoot-mkrescue.c:601 msgid "-apm-block-size" msgstr "" -#: util/grub-mkrescue.c:602 +#: util/VasEBoot-mkrescue.c:602 msgid "2048" msgstr "" -#: util/grub-mkrescue.c:603 util/grub-mkrescue.c:702 +#: util/VasEBoot-mkrescue.c:603 util/VasEBoot-mkrescue.c:702 msgid "-hfsplus-file-creator-type" msgstr "" -#: util/grub-mkrescue.c:604 util/grub-mkrescue.c:692 util/grub-mkrescue.c:703 +#: util/VasEBoot-mkrescue.c:604 util/VasEBoot-mkrescue.c:692 util/VasEBoot-mkrescue.c:703 msgid "chrp" msgstr "" -#: util/grub-mkrescue.c:605 +#: util/VasEBoot-mkrescue.c:605 msgid "tbxj" msgstr "" -#: util/grub-mkrescue.c:606 +#: util/VasEBoot-mkrescue.c:606 msgid "/System/Library/CoreServices/.disk_label" msgstr "" -#: util/grub-mkrescue.c:611 util/grub-mkrescue.c:706 +#: util/VasEBoot-mkrescue.c:611 util/VasEBoot-mkrescue.c:706 msgid "-hfs-bless-by" msgstr "" -#: util/grub-mkrescue.c:613 +#: util/VasEBoot-mkrescue.c:613 msgid "/System/Library/CoreServices/boot.efi" msgstr "" -#: util/grub-mkrescue.c:630 +#: util/VasEBoot-mkrescue.c:630 msgid "bootia64.efi" msgstr "" -#: util/grub-mkrescue.c:634 +#: util/VasEBoot-mkrescue.c:634 msgid "bootx64.efi" msgstr "" -#: util/grub-mkrescue.c:637 +#: util/VasEBoot-mkrescue.c:637 msgid "bootia32.efi" msgstr "" -#: util/grub-mkrescue.c:640 +#: util/VasEBoot-mkrescue.c:640 msgid "bootarm.efi" msgstr "" -#: util/grub-mkrescue.c:646 util/grub-mkrescue.c:653 +#: util/VasEBoot-mkrescue.c:646 util/VasEBoot-mkrescue.c:653 msgid "boot.efi" msgstr "" -#: util/grub-mkrescue.c:668 util/grub-mkrescue.c:673 +#: util/VasEBoot-mkrescue.c:668 util/VasEBoot-mkrescue.c:673 msgid "efi.img" msgstr "" -#: util/grub-mkrescue.c:669 +#: util/VasEBoot-mkrescue.c:669 msgid "mformat" msgstr "" -#: util/grub-mkrescue.c:669 +#: util/VasEBoot-mkrescue.c:669 msgid "-C" msgstr "" -#: util/grub-mkrescue.c:669 +#: util/VasEBoot-mkrescue.c:669 msgid "2880" msgstr "" -#: util/grub-mkrescue.c:669 +#: util/VasEBoot-mkrescue.c:669 msgid "16" msgstr "" -#: util/grub-mkrescue.c:669 util/grub-mkrescue.c:671 +#: util/VasEBoot-mkrescue.c:669 util/VasEBoot-mkrescue.c:671 msgid "-i" msgstr "" -#: util/grub-mkrescue.c:670 +#: util/VasEBoot-mkrescue.c:670 msgid "::" msgstr "" -#: util/grub-mkrescue.c:671 +#: util/VasEBoot-mkrescue.c:671 msgid "mcopy" msgstr "" -#: util/grub-mkrescue.c:671 +#: util/VasEBoot-mkrescue.c:671 msgid "::/" msgstr "" -#: util/grub-mkrescue.c:672 +#: util/VasEBoot-mkrescue.c:672 msgid "--efi-boot" msgstr "" -#: util/grub-mkrescue.c:674 +#: util/VasEBoot-mkrescue.c:674 msgid "-efi-boot-part" msgstr "" -#: util/grub-mkrescue.c:675 +#: util/VasEBoot-mkrescue.c:675 msgid "--efi-boot-image" msgstr "" -#: util/grub-mkrescue.c:683 +#: util/VasEBoot-mkrescue.c:683 msgid "powerpc-ieee1275/core.elf" msgstr "" -#: util/grub-mkrescue.c:688 -msgid "grub.chrp" +#: util/VasEBoot-mkrescue.c:688 +msgid "VasEBoot.chrp" msgstr "" -#: util/grub-mkrescue.c:690 util/grub-mkrescue.c:693 +#: util/VasEBoot-mkrescue.c:690 util/VasEBoot-mkrescue.c:693 msgid "bootinfo.txt" msgstr "" -#: util/grub-mkrescue.c:691 +#: util/VasEBoot-mkrescue.c:691 msgid "BootX" msgstr "" -#: util/grub-mkrescue.c:692 util/grub-mkrescue.c:693 +#: util/VasEBoot-mkrescue.c:692 util/VasEBoot-mkrescue.c:693 msgid "ppc" msgstr "" -#: util/grub-mkrescue.c:697 -msgid "/System/Library/CoreServices/grub.elf" +#: util/VasEBoot-mkrescue.c:697 +msgid "/System/Library/CoreServices/VasEBoot.elf" msgstr "" -#: util/grub-mkrescue.c:697 util/grub-mkrescue.c:698 -msgid "/boot/grub/powerpc-ieee1275/core.elf" +#: util/VasEBoot-mkrescue.c:697 util/VasEBoot-mkrescue.c:698 +msgid "/boot/VasEBoot/powerpc-ieee1275/core.elf" msgstr "" -#: util/grub-mkrescue.c:698 -msgid "/boot/grub/powerpc.elf" +#: util/VasEBoot-mkrescue.c:698 +msgid "/boot/VasEBoot/powerpc.elf" msgstr "" -#: util/grub-mkrescue.c:704 +#: util/VasEBoot-mkrescue.c:704 msgid "tbxi" msgstr "" -#: util/grub-mkrescue.c:705 +#: util/VasEBoot-mkrescue.c:705 msgid "/System/Library/CoreServices/BootX" msgstr "" -#: util/grub-mkrescue.c:707 +#: util/VasEBoot-mkrescue.c:707 msgid "p" msgstr "" -#: util/grub-mkrescue.c:708 +#: util/VasEBoot-mkrescue.c:708 msgid "/System/Library/CoreServices" msgstr "" -#: util/grub-mkrescue.c:710 +#: util/VasEBoot-mkrescue.c:710 msgid "-sysid" msgstr "" -#: util/grub-mkrescue.c:711 +#: util/VasEBoot-mkrescue.c:711 msgid "PPC" msgstr "" -#: util/grub-mkrescue.c:715 +#: util/VasEBoot-mkrescue.c:715 msgid "sparc64-ieee1275/core.img" msgstr "" -#: util/grub-mkrescue.c:725 util/mkimage.c:1361 +#: util/VasEBoot-mkrescue.c:725 util/mkimage.c:1361 msgid "cdboot.img" msgstr "" -#: util/grub-mkrescue.c:746 -msgid "--grub2-sparc-core" +#: util/VasEBoot-mkrescue.c:746 +msgid "--VasEBoot2-sparc-core" msgstr "" -#: util/grub-mkrescue.c:747 -msgid "/boot/grub/sparc64-ieee1275/core.img" +#: util/VasEBoot-mkrescue.c:747 +msgid "/boot/VasEBoot/sparc64-ieee1275/core.img" msgstr "" -#: util/grub-mkrescue.c:750 +#: util/VasEBoot-mkrescue.c:750 msgid "mips-arc/core.img" msgstr "" -#: util/grub-mkrescue.c:754 util/grub-mkrescue.c:765 -msgid "/boot/grub/mips-arc/grub" +#: util/VasEBoot-mkrescue.c:754 util/VasEBoot-mkrescue.c:765 +msgid "/boot/VasEBoot/mips-arc/VasEBoot" msgstr "" -#: util/grub-mkrescue.c:754 util/grub-mkrescue.c:755 util/grub-mkrescue.c:756 -msgid "/boot/grub/mips-arc/core.img" +#: util/VasEBoot-mkrescue.c:754 util/VasEBoot-mkrescue.c:755 util/VasEBoot-mkrescue.c:756 +msgid "/boot/VasEBoot/mips-arc/core.img" msgstr "" -#: util/grub-mkrescue.c:755 util/grub-mkrescue.c:761 -msgid "/boot/grub/mips-arc/sashARCS" +#: util/VasEBoot-mkrescue.c:755 util/VasEBoot-mkrescue.c:761 +msgid "/boot/VasEBoot/mips-arc/sashARCS" msgstr "" -#: util/grub-mkrescue.c:756 util/grub-mkrescue.c:763 -msgid "/boot/grub/mips-arc/sash" +#: util/VasEBoot-mkrescue.c:756 util/VasEBoot-mkrescue.c:763 +msgid "/boot/VasEBoot/mips-arc/sash" msgstr "" -#: util/grub-mkrescue.c:760 util/grub-mkrescue.c:762 util/grub-mkrescue.c:764 +#: util/VasEBoot-mkrescue.c:760 util/VasEBoot-mkrescue.c:762 util/VasEBoot-mkrescue.c:764 msgid "-mips-boot" msgstr "" -#: util/grub-mkrescue.c:768 +#: util/VasEBoot-mkrescue.c:768 msgid "arc.exe" msgstr "" -#: util/grub-mkrescue.c:771 util/grub-mkrescue.c:799 +#: util/VasEBoot-mkrescue.c:771 util/VasEBoot-mkrescue.c:799 msgid "roms/mipsel-qemu_mips.elf" msgstr "" -#: util/grub-mkrescue.c:773 util/grub-mkrescue.c:800 +#: util/VasEBoot-mkrescue.c:773 util/VasEBoot-mkrescue.c:800 msgid "loongson.elf" msgstr "" -#: util/grub-mkrescue.c:775 util/grub-mkrescue.c:801 +#: util/VasEBoot-mkrescue.c:775 util/VasEBoot-mkrescue.c:801 msgid "mipsel-yeeloong.bin" msgstr "" -#: util/grub-mkrescue.c:776 +#: util/VasEBoot-mkrescue.c:776 msgid "mipsel-fuloong2f.bin" msgstr "" -#: util/grub-mkrescue.c:778 util/grub-mkrescue.c:803 +#: util/VasEBoot-mkrescue.c:778 util/VasEBoot-mkrescue.c:803 msgid "roms/mips-qemu_mips.elf" msgstr "" -#: util/grub-mkrescue.c:782 util/grub-mkrescue.c:804 +#: util/VasEBoot-mkrescue.c:782 util/VasEBoot-mkrescue.c:804 msgid "roms/qemu.img" msgstr "" -#: util/grub-mkrescue.c:786 util/grub-mkrescue.c:805 +#: util/VasEBoot-mkrescue.c:786 util/VasEBoot-mkrescue.c:805 msgid "roms/coreboot.elf" msgstr "" -#: util/grub-mkrescue.c:799 +#: util/VasEBoot-mkrescue.c:799 msgid "mipsel-qemu_mips.elf" msgstr "" -#: util/grub-mkrescue.c:800 +#: util/VasEBoot-mkrescue.c:800 msgid "mipsel-loongson.elf" msgstr "" -#: util/grub-mkrescue.c:801 +#: util/VasEBoot-mkrescue.c:801 msgid "roms/mipsel-yeeloong.bin" msgstr "" -#: util/grub-mkrescue.c:802 +#: util/VasEBoot-mkrescue.c:802 msgid "roms/mipsel-fulong.bin" msgstr "" -#: util/grub-mkrescue.c:802 +#: util/VasEBoot-mkrescue.c:802 msgid "mipsel-fulong.bin" msgstr "" -#: util/grub-mkrescue.c:803 +#: util/VasEBoot-mkrescue.c:803 msgid "mips-qemu_mips.elf" msgstr "" -#: util/grub-mkrescue.c:804 +#: util/VasEBoot-mkrescue.c:804 msgid "qemu.img" msgstr "" -#: util/grub-mkrescue.c:805 +#: util/VasEBoot-mkrescue.c:805 msgid "coreboot.elf" msgstr "" -#: util/grub-mkrescue.c:816 +#: util/VasEBoot-mkrescue.c:816 msgid "--protective-msdos-label" msgstr "" -#: util/grub-mkrescue.c:821 util/grub-mkrescue.c:824 +#: util/VasEBoot-mkrescue.c:821 util/VasEBoot-mkrescue.c:824 msgid "--sort-weight" msgstr "" -#: util/grub-mkrescue.c:826 +#: util/VasEBoot-mkrescue.c:826 msgid "/boot" msgstr "" -#: util/grub-mkstandalone.c:227 util/grub-mkstandalone.c:257 +#: util/VasEBoot-mkstandalone.c:227 util/VasEBoot-mkstandalone.c:257 msgid "0000600" msgstr "" -#: util/grub-mkstandalone.c:228 util/grub-mkstandalone.c:229 -#: util/grub-mkstandalone.c:258 util/grub-mkstandalone.c:259 +#: util/VasEBoot-mkstandalone.c:228 util/VasEBoot-mkstandalone.c:229 +#: util/VasEBoot-mkstandalone.c:258 util/VasEBoot-mkstandalone.c:259 msgid "0001750" msgstr "" -#: util/grub-mkstandalone.c:234 util/grub-mkstandalone.c:264 +#: util/VasEBoot-mkstandalone.c:234 util/VasEBoot-mkstandalone.c:264 msgid "ustar " msgstr "" -#: util/grub-mkstandalone.c:346 +#: util/VasEBoot-mkstandalone.c:346 msgid "tar" msgstr "" @@ -5661,1223 +5661,1223 @@ msgstr "" msgid "x86_64-xen" msgstr "" -#: grub-core/commands/verify.c:170 grub-core/commands/verify.c:171 +#: VasEBoot-core/commands/verify.c:170 VasEBoot-core/commands/verify.c:171 msgid "gcry_rsa" msgstr "" -#: grub-core/commands/xen/lsxen.c:46 grub-core/commands/xen/lsxen.c:60 +#: VasEBoot-core/commands/xen/lsxen.c:46 VasEBoot-core/commands/xen/lsxen.c:60 msgid "domid" msgstr "" -#: grub-core/commands/xen/lsxen.c:49 +#: VasEBoot-core/commands/xen/lsxen.c:49 #, c-format msgid "/local/domain/%s" msgstr "" -#: grub-core/disk/xen/xendisk.c:82 +#: VasEBoot-core/disk/xen/xendisk.c:82 #, c-format msgid "%s/sectors" msgstr "" -#: grub-core/disk/xen/xendisk.c:90 +#: VasEBoot-core/disk/xen/xendisk.c:90 #, c-format msgid "%s/sector-size" msgstr "" -#: grub-core/disk/xen/xendisk.c:280 +#: VasEBoot-core/disk/xen/xendisk.c:280 #, c-format msgid "device/vbd/%s/backend" msgstr "" -#: grub-core/disk/xen/xendisk.c:285 +#: VasEBoot-core/disk/xen/xendisk.c:285 #, c-format msgid "%s/dev" msgstr "" -#: grub-core/disk/xen/xendisk.c:291 +#: VasEBoot-core/disk/xen/xendisk.c:291 #, c-format msgid "xenid/%s" msgstr "" -#: grub-core/disk/xen/xendisk.c:295 +#: VasEBoot-core/disk/xen/xendisk.c:295 #, c-format msgid "xen/%s" msgstr "" -#: grub-core/disk/xen/xendisk.c:301 +#: VasEBoot-core/disk/xen/xendisk.c:301 #, c-format msgid "device/vbd/%s/backend-id" msgstr "" -#: grub-core/disk/xen/xendisk.c:331 +#: VasEBoot-core/disk/xen/xendisk.c:331 #, c-format msgid "device/vbd/%s/ring-ref" msgstr "" -#: grub-core/disk/xen/xendisk.c:337 +#: VasEBoot-core/disk/xen/xendisk.c:337 #, c-format msgid "device/vbd/%s/event-channel" msgstr "" -#: grub-core/disk/xen/xendisk.c:343 +#: VasEBoot-core/disk/xen/xendisk.c:343 #, c-format msgid "device/vbd/%s/protocol" msgstr "" -#: grub-core/disk/xen/xendisk.c:353 +#: VasEBoot-core/disk/xen/xendisk.c:353 #, c-format msgid "device/vbd/%s/state" msgstr "" -#: grub-core/disk/xen/xendisk.c:354 +#: VasEBoot-core/disk/xen/xendisk.c:354 msgid "3" msgstr "" -#: grub-core/disk/xen/xendisk.c:360 grub-core/disk/xen/xendisk.c:422 -#: grub-core/disk/xen/xendisk.c:428 grub-core/disk/xen/xendisk.c:454 +#: VasEBoot-core/disk/xen/xendisk.c:360 VasEBoot-core/disk/xen/xendisk.c:422 +#: VasEBoot-core/disk/xen/xendisk.c:428 VasEBoot-core/disk/xen/xendisk.c:454 #, c-format msgid "%s/state" msgstr "" -#: grub-core/disk/xen/xendisk.c:373 +#: VasEBoot-core/disk/xen/xendisk.c:373 #, c-format msgid "device/vbd/%s" msgstr "" -#: grub-core/disk/xen/xendisk.c:396 grub-core/disk/xen/xendisk.c:405 +#: VasEBoot-core/disk/xen/xendisk.c:396 VasEBoot-core/disk/xen/xendisk.c:405 msgid "device/vbd" msgstr "" -#: grub-core/disk/xen/xendisk.c:424 grub-core/disk/xen/xendisk.c:433 +#: VasEBoot-core/disk/xen/xendisk.c:424 VasEBoot-core/disk/xen/xendisk.c:433 msgid "6" msgstr "" -#: grub-core/disk/xen/xendisk.c:440 +#: VasEBoot-core/disk/xen/xendisk.c:440 #, c-format msgid "%s/ring-ref" msgstr "" -#: grub-core/disk/xen/xendisk.c:444 +#: VasEBoot-core/disk/xen/xendisk.c:444 #, c-format msgid "%s/event-channel" msgstr "" -#: grub-core/gfxmenu/gui_list.c:747 +#: VasEBoot-core/gfxmenu/gui_list.c:747 msgid "item_pixmap_style" msgstr "" -#: grub-core/gfxmenu/gui_list.c:787 +#: VasEBoot-core/gfxmenu/gui_list.c:787 msgid "scrollbar_thumb_overlay" msgstr "" -#: grub-core/gfxmenu/gui_list.c:795 +#: VasEBoot-core/gfxmenu/gui_list.c:795 msgid "scrollbar_slice" msgstr "" -#: grub-core/gfxmenu/gui_list.c:797 +#: VasEBoot-core/gfxmenu/gui_list.c:797 msgid "west" msgstr "" -#: grub-core/gfxmenu/gui_list.c:801 +#: VasEBoot-core/gfxmenu/gui_list.c:801 msgid "east" msgstr "" -#: grub-core/gfxmenu/gui_list.c:804 +#: VasEBoot-core/gfxmenu/gui_list.c:804 msgid "scrollbar_left_pad" msgstr "" -#: grub-core/gfxmenu/gui_list.c:808 +#: VasEBoot-core/gfxmenu/gui_list.c:808 msgid "scrollbar_right_pad" msgstr "" -#: grub-core/gfxmenu/gui_list.c:812 +#: VasEBoot-core/gfxmenu/gui_list.c:812 msgid "scrollbar_top_pad" msgstr "" -#: grub-core/gfxmenu/gui_list.c:816 +#: VasEBoot-core/gfxmenu/gui_list.c:816 msgid "scrollbar_bottom_pad" msgstr "" -#: grub-core/gfxmenu/gui_progress_bar.c:377 +#: VasEBoot-core/gfxmenu/gui_progress_bar.c:377 msgid "highlight_overlay" msgstr "" -#: grub-core/kern/mips/dl.c:267 +#: VasEBoot-core/kern/mips/dl.c:267 msgid "_gp_disp" msgstr "" -#: grub-core/lib/progress.c:81 +#: VasEBoot-core/lib/progress.c:81 #, c-format msgid " [ %.20s %s %llu%% " msgstr "" -#: grub-core/lib/progress.c:88 +#: VasEBoot-core/lib/progress.c:88 #, c-format msgid "%s ]" msgstr "" -#: grub-core/lib/reed_solomon.c:74 +#: VasEBoot-core/lib/reed_solomon.c:74 msgid "_text,_text" msgstr "" -#: grub-core/loader/i386/bsd.c:1571 +#: VasEBoot-core/loader/i386/bsd.c:1571 msgid "wd" msgstr "" -#: grub-core/loader/i386/bsd.c:1572 +#: VasEBoot-core/loader/i386/bsd.c:1572 msgid "fd" msgstr "" -#: grub-core/loader/i386/bsd.c:1573 grub-core/osdep/linux/ofpath.c:415 +#: VasEBoot-core/loader/i386/bsd.c:1573 VasEBoot-core/osdep/linux/ofpath.c:415 msgid "sd" msgstr "" -#: grub-core/loader/i386/bsd.c:1575 +#: VasEBoot-core/loader/i386/bsd.c:1575 msgid "vnd" msgstr "" -#: grub-core/loader/i386/bsd.c:1576 +#: VasEBoot-core/loader/i386/bsd.c:1576 msgid "rd" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:45 +#: VasEBoot-core/loader/i386/xen_fileXX.c:45 msgid "PAE=no," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:55 +#: VasEBoot-core/loader/i386/xen_fileXX.c:55 msgid "PAE=yes," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:65 grub-core/loader/i386/xen_fileXX.c:66 +#: VasEBoot-core/loader/i386/xen_fileXX.c:65 VasEBoot-core/loader/i386/xen_fileXX.c:66 msgid "PAE=yes[extended-cr3]," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:77 +#: VasEBoot-core/loader/i386/xen_fileXX.c:77 msgid "PAE=bimodal," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:87 grub-core/loader/i386/xen_fileXX.c:88 +#: VasEBoot-core/loader/i386/xen_fileXX.c:87 VasEBoot-core/loader/i386/xen_fileXX.c:88 msgid "PAE=bimodal[extended-cr3]," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:99 +#: VasEBoot-core/loader/i386/xen_fileXX.c:99 msgid "PAE=yes,bimodal," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:109 -#: grub-core/loader/i386/xen_fileXX.c:110 +#: VasEBoot-core/loader/i386/xen_fileXX.c:109 +#: VasEBoot-core/loader/i386/xen_fileXX.c:110 msgid "PAE=yes[extended-cr3],bimodal," msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:121 -#: grub-core/loader/i386/xen_fileXX.c:123 +#: VasEBoot-core/loader/i386/xen_fileXX.c:121 +#: VasEBoot-core/loader/i386/xen_fileXX.c:123 msgid "VIRT_BASE=" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:128 -#: grub-core/loader/i386/xen_fileXX.c:130 +#: VasEBoot-core/loader/i386/xen_fileXX.c:128 +#: VasEBoot-core/loader/i386/xen_fileXX.c:130 msgid "VIRT_ENTRY=" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:135 -#: grub-core/loader/i386/xen_fileXX.c:137 +#: VasEBoot-core/loader/i386/xen_fileXX.c:135 +#: VasEBoot-core/loader/i386/xen_fileXX.c:137 msgid "HYPERCALL_PAGE=" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:143 -#: grub-core/loader/i386/xen_fileXX.c:145 +#: VasEBoot-core/loader/i386/xen_fileXX.c:143 +#: VasEBoot-core/loader/i386/xen_fileXX.c:145 msgid "ELF_PADDR_OFFSET=" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:191 util/mkimage.c:712 +#: VasEBoot-core/loader/i386/xen_fileXX.c:191 util/mkimage.c:712 msgid "Xen" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:220 util/grub-mkimagexx.c:207 -#: util/grub-mkimagexx.c:212 util/grub-mkimagexx.c:213 +#: VasEBoot-core/loader/i386/xen_fileXX.c:220 util/VasEBoot-mkimagexx.c:207 +#: util/VasEBoot-mkimagexx.c:212 util/VasEBoot-mkimagexx.c:213 msgid "generic" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:231 util/grub-mkimagexx.c:258 -#: util/grub-mkimagexx.c:259 +#: VasEBoot-core/loader/i386/xen_fileXX.c:231 util/VasEBoot-mkimagexx.c:258 +#: util/VasEBoot-mkimagexx.c:259 msgid "yes" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:237 +#: VasEBoot-core/loader/i386/xen_fileXX.c:237 msgid "bimodal" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:243 util/grub-mkimagexx.c:253 +#: VasEBoot-core/loader/i386/xen_fileXX.c:243 util/VasEBoot-mkimagexx.c:253 msgid "yes,bimodal" msgstr "" -#: grub-core/loader/i386/xen_fileXX.c:327 -#: grub-core/loader/i386/xen_fileXX.c:338 -#: grub-core/loader/i386/xen_fileXX.c:339 +#: VasEBoot-core/loader/i386/xen_fileXX.c:327 +#: VasEBoot-core/loader/i386/xen_fileXX.c:338 +#: VasEBoot-core/loader/i386/xen_fileXX.c:339 msgid "__xen_guest" msgstr "" -#: grub-core/loader/multiboot.c:244 +#: VasEBoot-core/loader/multiboot.c:244 msgid "--quirk-bad-kludge" msgstr "" -#: grub-core/loader/multiboot.c:251 +#: VasEBoot-core/loader/multiboot.c:251 msgid "--quirk-modules-after-kernel" msgstr "" -#: grub-core/net/dns.c:712 +#: VasEBoot-core/net/dns.c:712 msgid "--only-ipv4" msgstr "" -#: grub-core/net/dns.c:714 +#: VasEBoot-core/net/dns.c:714 msgid "--only-ipv6" msgstr "" -#: grub-core/net/dns.c:716 +#: VasEBoot-core/net/dns.c:716 msgid "--prefer-ipv4" msgstr "" -#: grub-core/net/dns.c:718 +#: VasEBoot-core/net/dns.c:718 msgid "--prefer-ipv6" msgstr "" -#: grub-core/normal/main.c:538 +#: VasEBoot-core/normal/main.c:538 msgid "feature_timeout_style" msgstr "" -#: grub-core/normal/main.c:587 +#: VasEBoot-core/normal/main.c:587 msgid "light-gray/black" msgstr "" -#: grub-core/normal/main.c:588 +#: VasEBoot-core/normal/main.c:588 msgid "black/light-gray" msgstr "" -#: grub-core/normal/menu.c:53 +#: VasEBoot-core/normal/menu.c:53 msgid "menu" msgstr "" -#: grub-core/normal/menu.c:54 +#: VasEBoot-core/normal/menu.c:54 msgid "countdown" msgstr "" -#: grub-core/osdep/aros/config.c:39 grub-core/osdep/unix/config.c:39 -#: util/grub-install.c:739 util/grub-install.c:1395 util/grub-install.c:1540 -#: util/grub-mkrescue.c:388 util/grub-mkstandalone.c:235 -#: util/grub-mkstandalone.c:236 util/grub-mkstandalone.c:265 -#: util/grub-mkstandalone.c:266 util/grub-mkstandalone.c:311 -msgid "grub" +#: VasEBoot-core/osdep/aros/config.c:39 VasEBoot-core/osdep/unix/config.c:39 +#: util/VasEBoot-install.c:739 util/VasEBoot-install.c:1395 util/VasEBoot-install.c:1540 +#: util/VasEBoot-mkrescue.c:388 util/VasEBoot-mkstandalone.c:235 +#: util/VasEBoot-mkstandalone.c:236 util/VasEBoot-mkstandalone.c:265 +#: util/VasEBoot-mkstandalone.c:266 util/VasEBoot-mkstandalone.c:311 +msgid "VasEBoot" msgstr "" -#: grub-core/osdep/aros/config.c:46 grub-core/osdep/unix/config.c:46 +#: VasEBoot-core/osdep/aros/config.c:46 VasEBoot-core/osdep/unix/config.c:46 msgid "pkgdatadir" msgstr "" -#: grub-core/osdep/aros/config.c:73 grub-core/osdep/unix/config.c:77 -#: grub-core/osdep/windows/config.c:40 -msgid "GRUB_ENABLE_CRYPTODISK" +#: VasEBoot-core/osdep/aros/config.c:73 VasEBoot-core/osdep/unix/config.c:77 +#: VasEBoot-core/osdep/windows/config.c:40 +msgid "VasEBoot_ENABLE_CRYPTODISK" msgstr "" -#: grub-core/osdep/aros/config.c:77 grub-core/osdep/unix/config.c:81 -#: grub-core/osdep/windows/config.c:44 -msgid "GRUB_DISTRIBUTOR" +#: VasEBoot-core/osdep/aros/config.c:77 VasEBoot-core/osdep/unix/config.c:81 +#: VasEBoot-core/osdep/windows/config.c:44 +msgid "VasEBoot_DISTRIBUTOR" msgstr "" -#: grub-core/osdep/linux/hostdisk.c:109 grub-core/osdep/linux/hostdisk.c:127 +#: VasEBoot-core/osdep/linux/hostdisk.c:109 VasEBoot-core/osdep/linux/hostdisk.c:127 msgid "udevadm" msgstr "" -#: grub-core/osdep/linux/hostdisk.c:110 +#: VasEBoot-core/osdep/linux/hostdisk.c:110 msgid "info" msgstr "" -#: grub-core/osdep/linux/hostdisk.c:111 +#: VasEBoot-core/osdep/linux/hostdisk.c:111 msgid "--query" msgstr "" -#: grub-core/osdep/linux/hostdisk.c:113 +#: VasEBoot-core/osdep/linux/hostdisk.c:113 msgid "--name" msgstr "" -#: grub-core/osdep/linux/hostdisk.c:139 +#: VasEBoot-core/osdep/linux/hostdisk.c:139 #, c-format msgid "/sys%s/%s" msgstr "" -#: grub-core/osdep/linux/ofpath.c:105 +#: VasEBoot-core/osdep/linux/ofpath.c:105 msgid "/obppath" msgstr "" -#: grub-core/osdep/linux/ofpath.c:117 +#: VasEBoot-core/osdep/linux/ofpath.c:117 #, c-format msgid "%s/obppath" msgstr "" -#: grub-core/osdep/linux/ofpath.c:125 +#: VasEBoot-core/osdep/linux/ofpath.c:125 #, c-format msgid "%s/devspec" msgstr "" -#: grub-core/osdep/linux/ofpath.c:132 +#: VasEBoot-core/osdep/linux/ofpath.c:132 msgid "/sys" msgstr "" -#: grub-core/osdep/linux/ofpath.c:182 grub-core/osdep/linux/ofpath.c:185 +#: VasEBoot-core/osdep/linux/ofpath.c:182 VasEBoot-core/osdep/linux/ofpath.c:185 msgid "/sys/block/" msgstr "" -#: grub-core/osdep/linux/ofpath.c:189 grub-core/osdep/linux/ofpath.c:191 +#: VasEBoot-core/osdep/linux/ofpath.c:189 VasEBoot-core/osdep/linux/ofpath.c:191 msgid "/device" msgstr "" -#: grub-core/osdep/linux/ofpath.c:237 +#: VasEBoot-core/osdep/linux/ofpath.c:237 #, c-format msgid "/disk@%d" msgstr "" -#: grub-core/osdep/linux/ofpath.c:244 +#: VasEBoot-core/osdep/linux/ofpath.c:244 #, c-format msgid "/disk@%d:%c" msgstr "" -#: grub-core/osdep/linux/ofpath.c:277 +#: VasEBoot-core/osdep/linux/ofpath.c:277 #, c-format msgid "vdc-port-%d-%d" msgstr "" -#: grub-core/osdep/linux/ofpath.c:295 +#: VasEBoot-core/osdep/linux/ofpath.c:295 #, c-format msgid "%d.%d" msgstr "" -#: grub-core/osdep/linux/ofpath.c:311 +#: VasEBoot-core/osdep/linux/ofpath.c:311 msgid "/vendor" msgstr "" -#: grub-core/osdep/linux/ofpath.c:315 +#: VasEBoot-core/osdep/linux/ofpath.c:315 #, c-format msgid "%s/vendor" msgstr "" -#: grub-core/osdep/linux/ofpath.c:334 grub-core/osdep/linux/ofpath.c:345 +#: VasEBoot-core/osdep/linux/ofpath.c:334 VasEBoot-core/osdep/linux/ofpath.c:345 msgid "end_device" msgstr "" -#: grub-core/osdep/linux/ofpath.c:353 grub-core/osdep/linux/ofpath.c:355 +#: VasEBoot-core/osdep/linux/ofpath.c:353 VasEBoot-core/osdep/linux/ofpath.c:355 #, c-format msgid "%s/sas_device/%s/phy_identifier" msgstr "" -#: grub-core/osdep/linux/ofpath.c:368 +#: VasEBoot-core/osdep/linux/ofpath.c:368 #, c-format msgid "%s/sas_device/%s/sas_address" msgstr "" -#: grub-core/osdep/linux/ofpath.c:376 +#: VasEBoot-core/osdep/linux/ofpath.c:376 #, c-format msgid "%lx" msgstr "" -#: grub-core/osdep/linux/ofpath.c:391 grub-core/osdep/linux/ofpath.c:412 +#: VasEBoot-core/osdep/linux/ofpath.c:391 VasEBoot-core/osdep/linux/ofpath.c:412 msgid "/fp@0,0" msgstr "" -#: grub-core/osdep/linux/ofpath.c:396 +#: VasEBoot-core/osdep/linux/ofpath.c:396 #, c-format msgid "%d:%d:%d:%d" msgstr "" -#: grub-core/osdep/linux/ofpath.c:411 +#: VasEBoot-core/osdep/linux/ofpath.c:411 msgid "qlc" msgstr "" -#: grub-core/osdep/linux/ofpath.c:414 +#: VasEBoot-core/osdep/linux/ofpath.c:414 msgid "sbus" msgstr "" -#: grub-core/osdep/linux/ofpath.c:420 +#: VasEBoot-core/osdep/linux/ofpath.c:420 msgid "/vdevice/" msgstr "" -#: grub-core/osdep/linux/ofpath.c:425 +#: VasEBoot-core/osdep/linux/ofpath.c:425 #, c-format msgid "/%s@%04lx000000000000" msgstr "" -#: grub-core/osdep/linux/ofpath.c:433 +#: VasEBoot-core/osdep/linux/ofpath.c:433 #, c-format msgid "/%s@%04lx000000000000:%c" msgstr "" -#: grub-core/osdep/linux/ofpath.c:445 +#: VasEBoot-core/osdep/linux/ofpath.c:445 #, c-format msgid "/sas/%s@%x" msgstr "" -#: grub-core/osdep/linux/ofpath.c:453 +#: VasEBoot-core/osdep/linux/ofpath.c:453 #, c-format msgid "/sas/%s@%x:%c" msgstr "" -#: grub-core/osdep/linux/ofpath.c:468 +#: VasEBoot-core/osdep/linux/ofpath.c:468 #, c-format msgid "%02x%02x%02x%02x00000000" msgstr "" -#: grub-core/osdep/linux/ofpath.c:473 +#: VasEBoot-core/osdep/linux/ofpath.c:473 #, c-format msgid "/sas/%s@%lx,%lu" msgstr "" -#: grub-core/osdep/linux/ofpath.c:481 +#: VasEBoot-core/osdep/linux/ofpath.c:481 #, c-format msgid "/sas/%s@%lx,%lu:%c" msgstr "" -#: grub-core/osdep/linux/ofpath.c:529 +#: VasEBoot-core/osdep/linux/ofpath.c:529 msgid "floppy" msgstr "" -#: grub-core/osdep/linux/platform.c:60 util/grub-install-common.c:650 -#: util/grub-install-common.c:652 +#: VasEBoot-core/osdep/linux/platform.c:60 util/VasEBoot-install-common.c:650 +#: util/VasEBoot-install-common.c:652 msgid "x86_64" msgstr "" -#: grub-core/osdep/linux/platform.c:73 grub-core/osdep/unix/platform.c:151 +#: VasEBoot-core/osdep/linux/platform.c:73 VasEBoot-core/osdep/unix/platform.c:151 msgid "modprobe" msgstr "" -#: grub-core/osdep/linux/platform.c:73 grub-core/osdep/unix/platform.c:151 +#: VasEBoot-core/osdep/linux/platform.c:73 VasEBoot-core/osdep/unix/platform.c:151 msgid "efivars" msgstr "" -#: grub-core/osdep/linux/platform.c:74 grub-core/osdep/unix/exec.c:153 +#: VasEBoot-core/osdep/linux/platform.c:74 VasEBoot-core/osdep/unix/exec.c:153 msgid "/dev/null" msgstr "" -#: grub-core/osdep/linux/platform.c:77 +#: VasEBoot-core/osdep/linux/platform.c:77 msgid "/sys/firmware/efi" msgstr "" -#: grub-core/osdep/linux/platform.c:87 +#: VasEBoot-core/osdep/linux/platform.c:87 msgid "/proc/device-tree" msgstr "" -#: grub-core/osdep/unix/compress.c:25 +#: VasEBoot-core/osdep/unix/compress.c:25 msgid "gzip" msgstr "" -#: grub-core/osdep/unix/compress.c:25 +#: VasEBoot-core/osdep/unix/compress.c:25 msgid "--best" msgstr "" -#: grub-core/osdep/unix/compress.c:26 grub-core/osdep/unix/compress.c:33 +#: VasEBoot-core/osdep/unix/compress.c:26 VasEBoot-core/osdep/unix/compress.c:33 msgid "--stdout" msgstr "" -#: grub-core/osdep/unix/compress.c:33 +#: VasEBoot-core/osdep/unix/compress.c:33 msgid "--lzma2=dict=128KiB" msgstr "" -#: grub-core/osdep/unix/compress.c:33 +#: VasEBoot-core/osdep/unix/compress.c:33 msgid "--check=none" msgstr "" -#: grub-core/osdep/unix/compress.c:39 +#: VasEBoot-core/osdep/unix/compress.c:39 msgid "lzop" msgstr "" -#: grub-core/osdep/unix/compress.c:39 +#: VasEBoot-core/osdep/unix/compress.c:39 msgid "-9" msgstr "" -#: grub-core/osdep/unix/compress.c:39 grub-core/osdep/unix/config.c:90 -#: grub-core/osdep/unix/platform.c:160 grub-core/osdep/unix/platform.c:166 +#: VasEBoot-core/osdep/unix/compress.c:39 VasEBoot-core/osdep/unix/config.c:90 +#: VasEBoot-core/osdep/unix/platform.c:160 VasEBoot-core/osdep/unix/platform.c:166 msgid "-c" msgstr "" -#: grub-core/osdep/unix/config.c:89 +#: VasEBoot-core/osdep/unix/config.c:89 msgid "sh" msgstr "" -#: grub-core/osdep/unix/config.c:95 +#: VasEBoot-core/osdep/unix/config.c:95 msgid ". '" msgstr "" -#: grub-core/osdep/unix/exec.c:126 grub-core/osdep/unix/exec.c:184 -#: grub-core/osdep/unix/exec.c:229 +#: VasEBoot-core/osdep/unix/exec.c:126 VasEBoot-core/osdep/unix/exec.c:184 +#: VasEBoot-core/osdep/unix/exec.c:229 msgid "LC_ALL" msgstr "" -#: grub-core/osdep/unix/hostdisk.c:296 grub-core/osdep/unix/hostdisk.c:314 +#: VasEBoot-core/osdep/unix/hostdisk.c:296 VasEBoot-core/osdep/unix/hostdisk.c:314 msgid "TMPDIR" msgstr "" -#: grub-core/osdep/unix/hostdisk.c:300 grub-core/osdep/unix/hostdisk.c:318 +#: VasEBoot-core/osdep/unix/hostdisk.c:300 VasEBoot-core/osdep/unix/hostdisk.c:318 msgid "/tmp" msgstr "" -#: grub-core/osdep/unix/hostdisk.c:302 grub-core/osdep/unix/hostdisk.c:304 -#: grub-core/osdep/unix/hostdisk.c:305 grub-core/osdep/unix/hostdisk.c:320 -#: grub-core/osdep/unix/hostdisk.c:322 grub-core/osdep/unix/hostdisk.c:323 -msgid "/grub.XXXXXX" +#: VasEBoot-core/osdep/unix/hostdisk.c:302 VasEBoot-core/osdep/unix/hostdisk.c:304 +#: VasEBoot-core/osdep/unix/hostdisk.c:305 VasEBoot-core/osdep/unix/hostdisk.c:320 +#: VasEBoot-core/osdep/unix/hostdisk.c:322 VasEBoot-core/osdep/unix/hostdisk.c:323 +msgid "/VasEBoot.XXXXXX" msgstr "" -#: grub-core/osdep/unix/platform.c:41 grub-core/osdep/unix/platform.c:179 -#: grub-core/osdep/unix/platform.c:183 +#: VasEBoot-core/osdep/unix/platform.c:41 VasEBoot-core/osdep/unix/platform.c:179 +#: VasEBoot-core/osdep/unix/platform.c:183 msgid "ofpathname" msgstr "" -#: grub-core/osdep/unix/platform.c:85 grub-core/osdep/unix/platform.c:92 -#: grub-core/osdep/unix/platform.c:100 grub-core/osdep/unix/platform.c:122 -#: grub-core/osdep/unix/platform.c:125 grub-core/osdep/unix/platform.c:142 -#: grub-core/osdep/unix/platform.c:146 grub-core/osdep/unix/platform.c:159 -#: grub-core/osdep/unix/platform.c:165 +#: VasEBoot-core/osdep/unix/platform.c:85 VasEBoot-core/osdep/unix/platform.c:92 +#: VasEBoot-core/osdep/unix/platform.c:100 VasEBoot-core/osdep/unix/platform.c:122 +#: VasEBoot-core/osdep/unix/platform.c:125 VasEBoot-core/osdep/unix/platform.c:142 +#: VasEBoot-core/osdep/unix/platform.c:146 VasEBoot-core/osdep/unix/platform.c:159 +#: VasEBoot-core/osdep/unix/platform.c:165 msgid "efibootmgr" msgstr "" -#: grub-core/osdep/unix/platform.c:113 grub-core/osdep/unix/platform.c:114 -#: grub-core/osdep/unix/platform.c:115 grub-core/osdep/unix/platform.c:119 +#: VasEBoot-core/osdep/unix/platform.c:113 VasEBoot-core/osdep/unix/platform.c:114 +#: VasEBoot-core/osdep/unix/platform.c:115 VasEBoot-core/osdep/unix/platform.c:119 msgid "Boot" msgstr "" -#: grub-core/osdep/unix/platform.c:122 grub-core/osdep/unix/platform.c:151 -#: grub-core/osdep/unix/platform.c:159 +#: VasEBoot-core/osdep/unix/platform.c:122 VasEBoot-core/osdep/unix/platform.c:151 +#: VasEBoot-core/osdep/unix/platform.c:159 msgid "-q" msgstr "" -#: grub-core/osdep/unix/platform.c:123 grub-core/osdep/unix/platform.c:126 -#: util/grub-mkrescue.c:483 +#: VasEBoot-core/osdep/unix/platform.c:123 VasEBoot-core/osdep/unix/platform.c:126 +#: util/VasEBoot-mkrescue.c:483 msgid "-b" msgstr "" -#: grub-core/osdep/unix/platform.c:123 grub-core/osdep/unix/platform.c:126 -#: util/grub-mkrescue.c:744 +#: VasEBoot-core/osdep/unix/platform.c:123 VasEBoot-core/osdep/unix/platform.c:126 +#: util/VasEBoot-mkrescue.c:744 msgid "-B" msgstr "" -#: grub-core/osdep/unix/platform.c:161 grub-core/osdep/unix/platform.c:167 +#: VasEBoot-core/osdep/unix/platform.c:161 VasEBoot-core/osdep/unix/platform.c:167 msgid "-p" msgstr "" -#: grub-core/osdep/unix/platform.c:161 grub-core/osdep/unix/platform.c:167 +#: VasEBoot-core/osdep/unix/platform.c:161 VasEBoot-core/osdep/unix/platform.c:167 msgid "-w" msgstr "" -#: grub-core/osdep/unix/platform.c:162 grub-core/osdep/unix/platform.c:168 -#: util/grub-mkrescue.c:669 +#: VasEBoot-core/osdep/unix/platform.c:162 VasEBoot-core/osdep/unix/platform.c:168 +#: util/VasEBoot-mkrescue.c:669 msgid "-L" msgstr "" -#: grub-core/osdep/unix/platform.c:195 grub-core/osdep/unix/platform.c:199 +#: VasEBoot-core/osdep/unix/platform.c:195 VasEBoot-core/osdep/unix/platform.c:199 msgid "XXXXXXXXXXXXXXXXXXXX" msgstr "" -#: grub-core/osdep/unix/platform.c:215 +#: VasEBoot-core/osdep/unix/platform.c:215 msgid "nvsetenv" msgstr "" -#: grub-core/osdep/unix/platform.c:215 +#: VasEBoot-core/osdep/unix/platform.c:215 msgid "boot-device" msgstr "" -#: grub-core/osdep/unix/platform.c:218 +#: VasEBoot-core/osdep/unix/platform.c:218 #, c-format msgid "setenv boot-device %s" msgstr "" -#: grub-core/osdep/unix/platform.c:231 +#: VasEBoot-core/osdep/unix/platform.c:231 msgid "dvhtool" msgstr "" -#: grub-core/osdep/unix/platform.c:232 +#: VasEBoot-core/osdep/unix/platform.c:232 msgid "--unix-to-vh" msgstr "" -#: grub-core/osdep/unix/relpath.c:109 +#: VasEBoot-core/osdep/unix/relpath.c:109 #, c-format msgid "/%s/@" msgstr "" -#: grub-core/osdep/unix/relpath.c:141 +#: VasEBoot-core/osdep/unix/relpath.c:141 #, c-format msgid "/%s/@%s" msgstr "" -#: grub-core/osdep/windows/hostdisk.c:494 -#: grub-core/osdep/windows/hostdisk.c:495 -msgid "\\GRUB." +#: VasEBoot-core/osdep/windows/hostdisk.c:494 +#: VasEBoot-core/osdep/windows/hostdisk.c:495 +msgid "\\VasEBoot." msgstr "" -#: grub-core/osdep/windows/init.c:50 +#: VasEBoot-core/osdep/windows/init.c:50 msgid "GetCurrentConsoleFont" msgstr "" -#: grub-core/osdep/windows/init.c:71 grub-core/osdep/windows/platform.c:73 +#: VasEBoot-core/osdep/windows/init.c:71 VasEBoot-core/osdep/windows/platform.c:73 msgid "kernel32.dll" msgstr "" -#: grub-core/osdep/windows/init.c:81 +#: VasEBoot-core/osdep/windows/init.c:81 msgid "SetCurrentConsoleFontEx" msgstr "" -#: grub-core/osdep/windows/init.c:93 grub-core/osdep/windows/init.c:94 +#: VasEBoot-core/osdep/windows/init.c:93 VasEBoot-core/osdep/windows/init.c:94 msgid "Lucida Console" msgstr "" -#: grub-core/osdep/windows/init.c:105 +#: VasEBoot-core/osdep/windows/init.c:105 msgid "SetConsoleFont" msgstr "" -#: grub-core/osdep/windows/init.c:123 util/grub-mknetdir.c:139 -msgid "grub.cfg" +#: VasEBoot-core/osdep/windows/init.c:123 util/VasEBoot-mknetdir.c:139 +msgid "VasEBoot.cfg" msgstr "" -#: grub-core/osdep/windows/init.c:181 util/grub-install-common.c:702 +#: VasEBoot-core/osdep/windows/init.c:181 util/VasEBoot-install-common.c:702 msgid "locale" msgstr "" -#: grub-core/osdep/windows/platform.c:28 +#: VasEBoot-core/osdep/windows/platform.c:28 msgid "{8be4df61-93ca-11d2-aa0d-00e098032b8c}" msgstr "" -#: grub-core/osdep/windows/platform.c:81 +#: VasEBoot-core/osdep/windows/platform.c:81 msgid "GetFirmwareEnvironmentVariableW" msgstr "" -#: grub-core/osdep/windows/platform.c:83 +#: VasEBoot-core/osdep/windows/platform.c:83 msgid "SetFirmwareEnvironmentVariableW" msgstr "" -#: grub-core/osdep/windows/platform.c:85 +#: VasEBoot-core/osdep/windows/platform.c:85 msgid "GetNativeSystemInfo" msgstr "" -#: grub-core/osdep/windows/platform.c:101 -#: grub-core/osdep/windows/platform.c:238 -#: grub-core/osdep/windows/platform.c:409 +#: VasEBoot-core/osdep/windows/platform.c:101 +#: VasEBoot-core/osdep/windows/platform.c:238 +#: VasEBoot-core/osdep/windows/platform.c:409 msgid "BootOrder" msgstr "" -#: grub-core/osdep/windows/platform.c:185 -#: grub-core/osdep/windows/platform.c:196 +#: VasEBoot-core/osdep/windows/platform.c:185 +#: VasEBoot-core/osdep/windows/platform.c:196 msgid "Boot0000" msgstr "" -#: include/grub/i386/cpuid.h:42 include/grub/i386/cpuid.h:65 +#: include/VasEBoot/i386/cpuid.h:42 include/VasEBoot/i386/cpuid.h:65 msgid "%rcx" msgstr "" -#: include/grub/osdep/hostfile_aros.h:110 +#: include/VasEBoot/osdep/hostfile_aros.h:110 msgid "SYS:" msgstr "" -#: include/grub/util/install.h:32 +#: include/VasEBoot/util/install.h:32 msgid "install-modules" msgstr "" -#: include/grub/util/install.h:35 util/grub-install-common.c:64 -#: util/grub-install-common.c:812 util/grub-install-common.c:823 +#: include/VasEBoot/util/install.h:35 util/VasEBoot-install-common.c:64 +#: util/VasEBoot-install-common.c:812 util/VasEBoot-install-common.c:823 msgid "themes" msgstr "" -#: include/grub/util/install.h:37 util/grub-install-common.c:703 +#: include/VasEBoot/util/install.h:37 util/VasEBoot-install-common.c:703 msgid "fonts" msgstr "" -#: include/grub/util/install.h:39 +#: include/VasEBoot/util/install.h:39 msgid "locales" msgstr "" -#: include/grub/util/install.h:41 +#: include/VasEBoot/util/install.h:41 msgid "compress" msgstr "" -#: include/grub/util/install.h:42 +#: include/VasEBoot/util/install.h:42 msgid "no,xz,gz,lzo" msgstr "" -#: include/grub/util/install.h:44 +#: include/VasEBoot/util/install.h:44 msgid "core-compress" msgstr "" -#: include/grub/util/install.h:50 +#: include/VasEBoot/util/install.h:50 msgid "override-directory" msgstr "" -#: include/grub/util/install.h:53 +#: include/VasEBoot/util/install.h:53 msgid "locale-directory" msgstr "" -#: include/grub/util/install.h:56 +#: include/VasEBoot/util/install.h:56 msgid "themes-directory" msgstr "" -#: include/grub/util/install.h:59 -msgid "grub-mkimage" +#: include/VasEBoot/util/install.h:59 +msgid "VasEBoot-mkimage" msgstr "" #: util/config.c:35 util/config.c:36 util/config.c:38 -msgid "GRUB_ENABLE_CRYPTODISK=" +msgid "VasEBoot_ENABLE_CRYPTODISK=" msgstr "" #: util/config.c:45 util/config.c:46 util/config.c:51 -msgid "GRUB_DISTRIBUTOR=" +msgid "VasEBoot_DISTRIBUTOR=" msgstr "" -#: util/grub-install-common.c:55 util/grub-install-common.c:804 +#: util/VasEBoot-install-common.c:55 util/VasEBoot-install-common.c:804 msgid "starfield" msgstr "" -#: util/grub-install-common.c:57 util/grub-install-common.c:840 +#: util/VasEBoot-install-common.c:57 util/VasEBoot-install-common.c:840 msgid "unicode" msgstr "" -#: util/grub-install-common.c:193 +#: util/VasEBoot-install-common.c:193 msgid ".lst" msgstr "" -#: util/grub-install-common.c:194 util/grub-mknetdir.c:97 +#: util/VasEBoot-install-common.c:194 util/VasEBoot-mknetdir.c:97 msgid ".img" msgstr "" -#: util/grub-install-common.c:195 util/grub-install-common.c:617 -#: util/grub-install-common.c:623 util/grub-install-common.c:628 -#: util/grub-install-common.c:629 util/grub-install-common.c:758 -#: util/grub-install-common.c:771 util/grub-install-common.c:774 -#: util/grub-install-common.c:787 +#: util/VasEBoot-install-common.c:195 util/VasEBoot-install-common.c:617 +#: util/VasEBoot-install-common.c:623 util/VasEBoot-install-common.c:628 +#: util/VasEBoot-install-common.c:629 util/VasEBoot-install-common.c:758 +#: util/VasEBoot-install-common.c:771 util/VasEBoot-install-common.c:774 +#: util/VasEBoot-install-common.c:787 msgid ".mo" msgstr "" -#: util/grub-install-common.c:196 +#: util/VasEBoot-install-common.c:196 msgid "menu.lst" msgstr "" -#: util/grub-install-common.c:370 +#: util/VasEBoot-install-common.c:370 msgid "gz" msgstr "" -#: util/grub-install-common.c:380 +#: util/VasEBoot-install-common.c:380 msgid "lzo" msgstr "" -#: util/grub-install-common.c:404 util/grub-install-common.c:411 +#: util/VasEBoot-install-common.c:404 util/VasEBoot-install-common.c:411 msgid "gcry_crc" msgstr "" -#: util/grub-install-common.c:430 +#: util/VasEBoot-install-common.c:430 msgid "lzma" msgstr "" -#: util/grub-install-common.c:453 +#: util/VasEBoot-install-common.c:453 msgid "--memdisk '" msgstr "" -#: util/grub-install-common.c:460 +#: util/VasEBoot-install-common.c:460 msgid "--config '" msgstr "" -#: util/grub-install-common.c:467 +#: util/VasEBoot-install-common.c:467 msgid "--pubkey '" msgstr "" -#: util/grub-install-common.c:488 +#: util/VasEBoot-install-common.c:488 msgid "--note" msgstr "" -#: util/grub-install-common.c:618 +#: util/VasEBoot-install-common.c:618 msgid ".gmo" msgstr "" -#: util/grub-install-common.c:628 util/grub-install-common.c:785 +#: util/VasEBoot-install-common.c:628 util/VasEBoot-install-common.c:785 msgid "LC_MESSAGES" msgstr "" -#: util/grub-install-common.c:644 util/grub-install-common.c:645 -#: util/grub-install-common.c:646 util/grub-install-common.c:647 -#: util/grub-install-common.c:648 util/grub-install-common.c:649 -#: util/grub-install-common.c:651 +#: util/VasEBoot-install-common.c:644 util/VasEBoot-install-common.c:645 +#: util/VasEBoot-install-common.c:646 util/VasEBoot-install-common.c:647 +#: util/VasEBoot-install-common.c:648 util/VasEBoot-install-common.c:649 +#: util/VasEBoot-install-common.c:651 msgid "i386" msgstr "" -#: util/grub-install-common.c:646 +#: util/VasEBoot-install-common.c:646 msgid "qemu" msgstr "" -#: util/grub-install-common.c:647 +#: util/VasEBoot-install-common.c:647 msgid "coreboot" msgstr "" -#: util/grub-install-common.c:653 util/grub-install-common.c:654 -#: util/grub-install-common.c:656 +#: util/VasEBoot-install-common.c:653 util/VasEBoot-install-common.c:654 +#: util/VasEBoot-install-common.c:656 msgid "mipsel" msgstr "" -#: util/grub-install-common.c:653 +#: util/VasEBoot-install-common.c:653 msgid "loongson" msgstr "" -#: util/grub-install-common.c:654 util/grub-install-common.c:655 +#: util/VasEBoot-install-common.c:654 util/VasEBoot-install-common.c:655 msgid "qemu_mips" msgstr "" -#: util/grub-install-common.c:655 util/grub-install-common.c:657 +#: util/VasEBoot-install-common.c:655 util/VasEBoot-install-common.c:657 msgid "mips" msgstr "" -#: util/grub-install-common.c:658 +#: util/VasEBoot-install-common.c:658 msgid "sparc64" msgstr "" -#: util/grub-install-common.c:659 +#: util/VasEBoot-install-common.c:659 msgid "powerpc" msgstr "" -#: util/grub-install-common.c:660 +#: util/VasEBoot-install-common.c:660 msgid "ia64" msgstr "" -#: util/grub-install-common.c:661 util/grub-install-common.c:663 +#: util/VasEBoot-install-common.c:661 util/VasEBoot-install-common.c:663 msgid "arm" msgstr "" -#: util/grub-install-common.c:662 +#: util/VasEBoot-install-common.c:662 msgid "arm64" msgstr "" -#: util/grub-install-common.c:663 +#: util/VasEBoot-install-common.c:663 msgid "uboot" msgstr "" -#: util/grub-install-common.c:669 util/grub-install-common.c:697 -#: util/grub-install.c:1317 util/grub-install.c:1339 util/grub-install.c:1351 +#: util/VasEBoot-install-common.c:669 util/VasEBoot-install-common.c:697 +#: util/VasEBoot-install.c:1317 util/VasEBoot-install.c:1339 util/VasEBoot-install.c:1351 #, c-format msgid "%s-%s" msgstr "" -#: util/grub-install-common.c:736 +#: util/VasEBoot-install-common.c:736 msgid "command.lst" msgstr "" -#: util/grub-install-common.c:737 +#: util/VasEBoot-install-common.c:737 msgid "fs.lst" msgstr "" -#: util/grub-install-common.c:737 util/grub-mkrescue.c:224 +#: util/VasEBoot-install-common.c:737 util/VasEBoot-mkrescue.c:224 msgid "partmap.lst" msgstr "" -#: util/grub-install-common.c:738 +#: util/VasEBoot-install-common.c:738 msgid "parttool.lst" msgstr "" -#: util/grub-install-common.c:739 +#: util/VasEBoot-install-common.c:739 msgid "video.lst" msgstr "" -#: util/grub-install-common.c:739 +#: util/VasEBoot-install-common.c:739 msgid "crypto.lst" msgstr "" -#: util/grub-install-common.c:740 +#: util/VasEBoot-install-common.c:740 msgid "terminal.lst" msgstr "" -#: util/grub-install-common.c:757 util/grub-install-common.c:769 +#: util/VasEBoot-install-common.c:757 util/VasEBoot-install-common.c:769 msgid "po" msgstr "" -#: util/grub-install-common.c:818 +#: util/VasEBoot-install-common.c:818 msgid "theme.txt" msgstr "" -#: util/grub-install-common.c:874 +#: util/VasEBoot-install-common.c:874 msgid "modinfo.sh" msgstr "" -#: util/grub-install-common.c:882 util/grub-install-common.c:888 -msgid "grub_modinfo_target_cpu=" +#: util/VasEBoot-install-common.c:882 util/VasEBoot-install-common.c:888 +msgid "VasEBoot_modinfo_target_cpu=" msgstr "" -#: util/grub-install-common.c:885 util/grub-install-common.c:889 -msgid "grub_modinfo_platform=" +#: util/VasEBoot-install-common.c:885 util/VasEBoot-install-common.c:889 +msgid "VasEBoot_modinfo_platform=" msgstr "" -#: util/grub-install.c:118 +#: util/VasEBoot-install.c:118 msgid "setup" msgstr "" -#: util/grub-install.c:212 +#: util/VasEBoot-install.c:212 msgid "boot-directory" msgstr "" -#: util/grub-install.c:214 +#: util/VasEBoot-install.c:214 msgid "root-directory" msgstr "" -#: util/grub-install.c:221 -msgid "grub-setup" +#: util/VasEBoot-install.c:221 +msgid "VasEBoot-setup" msgstr "" -#: util/grub-install.c:222 -msgid "grub-mkrelpath" +#: util/VasEBoot-install.c:222 +msgid "VasEBoot-mkrelpath" msgstr "" -#: util/grub-install.c:223 -msgid "grub-mkdevicemap" +#: util/VasEBoot-install.c:223 +msgid "VasEBoot-mkdevicemap" msgstr "" -#: util/grub-install.c:224 -msgid "grub-probe" +#: util/VasEBoot-install.c:224 +msgid "VasEBoot-probe" msgstr "" -#: util/grub-install.c:225 -msgid "grub-editenv" +#: util/VasEBoot-install.c:225 +msgid "VasEBoot-editenv" msgstr "" -#: util/grub-install.c:231 +#: util/VasEBoot-install.c:231 msgid "recheck" msgstr "" -#: util/grub-install.c:235 +#: util/VasEBoot-install.c:235 msgid "force-file-id" msgstr "" -#: util/grub-install.c:237 +#: util/VasEBoot-install.c:237 msgid "disk-module" msgstr "" -#: util/grub-install.c:240 +#: util/VasEBoot-install.c:240 msgid "no-nvram" msgstr "" -#: util/grub-install.c:245 +#: util/VasEBoot-install.c:245 msgid "no-bootsector" msgstr "" -#: util/grub-install.c:247 util/grub-setup.c:91 +#: util/VasEBoot-install.c:247 util/VasEBoot-setup.c:91 msgid "no-rs-codes" msgstr "" -#: util/grub-install.c:253 util/grub-mknetdir.c:46 +#: util/VasEBoot-install.c:253 util/VasEBoot-mknetdir.c:46 msgid "debug-image" msgstr "" -#: util/grub-install.c:254 +#: util/VasEBoot-install.c:254 msgid "removable" msgstr "" -#: util/grub-install.c:257 +#: util/VasEBoot-install.c:257 msgid "bootloader-id" msgstr "" -#: util/grub-install.c:259 +#: util/VasEBoot-install.c:259 msgid "efi-directory" msgstr "" -#: util/grub-install.c:280 util/mkimage.c:586 util/mkimage.c:587 +#: util/VasEBoot-install.c:280 util/mkimage.c:586 util/mkimage.c:587 msgid "arm64-efi" msgstr "" -#: util/grub-install.c:341 +#: util/VasEBoot-install.c:341 msgid "part_bsd" msgstr "" -#: util/grub-install.c:345 +#: util/VasEBoot-install.c:345 #, c-format msgid "part_%s" msgstr "" -#: util/grub-install.c:471 +#: util/VasEBoot-install.c:471 #, c-format msgid "cryptomount -u %s\n" msgstr "" -#: util/grub-install.c:788 util/grub-install.c:1067 +#: util/VasEBoot-install.c:788 util/VasEBoot-install.c:1067 msgid "native" msgstr "" -#: util/grub-install.c:842 +#: util/VasEBoot-install.c:842 msgid "device.map" msgstr "" -#: util/grub-install.c:885 util/grub-install.c:998 +#: util/VasEBoot-install.c:885 util/VasEBoot-install.c:998 msgid "EFI" msgstr "" -#: util/grub-install.c:948 +#: util/VasEBoot-install.c:948 msgid "BOOT" msgstr "" -#: util/grub-install.c:952 +#: util/VasEBoot-install.c:952 msgid "BOOTIA32.EFI" msgstr "" -#: util/grub-install.c:955 +#: util/VasEBoot-install.c:955 msgid "BOOTX64.EFI" msgstr "" -#: util/grub-install.c:958 +#: util/VasEBoot-install.c:958 msgid "BOOTIA64.EFI" msgstr "" -#: util/grub-install.c:961 +#: util/VasEBoot-install.c:961 msgid "BOOTARM.EFI" msgstr "" -#: util/grub-install.c:964 +#: util/VasEBoot-install.c:964 msgid "BOOTAARCH64.EFI" msgstr "" -#: util/grub-install.c:979 -msgid "grubia32.efi" +#: util/VasEBoot-install.c:979 +msgid "VasEBootia32.efi" msgstr "" -#: util/grub-install.c:982 -msgid "grubx64.efi" +#: util/VasEBoot-install.c:982 +msgid "VasEBootx64.efi" msgstr "" -#: util/grub-install.c:985 -msgid "grubia64.efi" +#: util/VasEBoot-install.c:985 +msgid "VasEBootia64.efi" msgstr "" -#: util/grub-install.c:988 -msgid "grubarm.efi" +#: util/VasEBoot-install.c:988 +msgid "VasEBootarm.efi" msgstr "" -#: util/grub-install.c:991 -msgid "grubarm64.efi" +#: util/VasEBoot-install.c:991 +msgid "VasEBootarm64.efi" msgstr "" -#: util/grub-install.c:994 util/grub-install.c:1404 util/grub-install.c:1545 -msgid "grub.efi" +#: util/VasEBoot-install.c:994 util/VasEBoot-install.c:1404 util/VasEBoot-install.c:1545 +msgid "VasEBoot.efi" msgstr "" -#: util/grub-install.c:1062 -msgid "GRUB_ENABLE_CRYPTODISK=1" +#: util/VasEBoot-install.c:1062 +msgid "VasEBoot_ENABLE_CRYPTODISK=1" msgstr "" -#: util/grub-install.c:1097 util/grub-mknetdir.c:111 +#: util/VasEBoot-install.c:1097 util/VasEBoot-mknetdir.c:111 msgid "load.cfg" msgstr "" -#: util/grub-install.c:1105 util/grub-mknetdir.c:126 +#: util/VasEBoot-install.c:1105 util/VasEBoot-mknetdir.c:126 #, c-format msgid "set debug='%s'\n" msgstr "" -#: util/grub-install.c:1155 +#: util/VasEBoot-install.c:1155 #, c-format msgid "search.fs_uuid %s root " msgstr "" -#: util/grub-install.c:1157 +#: util/VasEBoot-install.c:1157 msgid "search_fs_uuid" msgstr "" -#: util/grub-install.c:1174 +#: util/VasEBoot-install.c:1174 #, c-format msgid "search.file %s root " msgstr "" -#: util/grub-install.c:1176 +#: util/VasEBoot-install.c:1176 msgid "search_fs_file" msgstr "" -#: util/grub-install.c:1232 +#: util/VasEBoot-install.c:1232 #, c-format msgid "ieee1275/%s" msgstr "" -#: util/grub-install.c:1315 +#: util/VasEBoot-install.c:1315 msgid "core.efi" msgstr "" -#: util/grub-install.c:1324 util/grub-install.c:1337 +#: util/VasEBoot-install.c:1324 util/VasEBoot-install.c:1337 msgid "core.elf" msgstr "" -#: util/grub-install.c:1326 +#: util/VasEBoot-install.c:1326 #, c-format msgid "%s-%s-elf" msgstr "" -#: util/grub-install.c:1386 -msgid "grub.elf" +#: util/VasEBoot-install.c:1386 +msgid "VasEBoot.elf" msgstr "" -#: util/grub-install.c:1449 util/grub-install.c:1476 +#: util/VasEBoot-install.c:1449 util/VasEBoot-install.c:1476 msgid "--allow-floppy " msgstr "" -#: util/grub-install.c:1450 util/grub-install.c:1477 +#: util/VasEBoot-install.c:1450 util/VasEBoot-install.c:1477 msgid "--verbose " msgstr "" -#: util/grub-install.c:1451 util/grub-install.c:1478 +#: util/VasEBoot-install.c:1451 util/VasEBoot-install.c:1478 msgid "--force " msgstr "" -#: util/grub-install.c:1452 util/grub-install.c:1479 +#: util/VasEBoot-install.c:1452 util/VasEBoot-install.c:1479 msgid "--skip-fs-probe" msgstr "" -#: util/grub-install.c:1453 +#: util/VasEBoot-install.c:1453 msgid "--no-rs-codes" msgstr "" -#: util/grub-install.c:1510 +#: util/VasEBoot-install.c:1510 #, c-format msgid "dd if=/dev/zero of=%s" msgstr "" -#: util/grub-install.c:1568 +#: util/VasEBoot-install.c:1568 #, c-format msgid "\\EFI\\%s\\%s" msgstr "" -#: util/grub-mkimagexx.c:95 util/grub-mkimagexx.c:352 -#: util/grub-mkimagexx.c:354 +#: util/VasEBoot-mkimagexx.c:95 util/VasEBoot-mkimagexx.c:352 +#: util/VasEBoot-mkimagexx.c:354 msgid ".xen" msgstr "" -#: util/grub-mkimagexx.c:218 util/grub-mkimagexx.c:223 -#: util/grub-mkimagexx.c:224 +#: util/VasEBoot-mkimagexx.c:218 util/VasEBoot-mkimagexx.c:223 +#: util/VasEBoot-mkimagexx.c:224 msgid "xen-3.0" msgstr "" -#: util/grub-mknetdir.c:41 +#: util/VasEBoot-mknetdir.c:41 msgid "net-directory" msgstr "" -#: util/grub-mknetdir.c:43 +#: util/VasEBoot-mknetdir.c:43 msgid "subdir" msgstr "" -#: util/grub-mknetdir.c:96 +#: util/VasEBoot-mknetdir.c:96 msgid ".0" msgstr "" -#: util/grub-mknetdir.c:98 util/grub-mknetdir.c:99 +#: util/VasEBoot-mknetdir.c:98 util/VasEBoot-mknetdir.c:99 msgid ".elf" msgstr "" -#: util/grub-mknetdir.c:100 util/grub-mknetdir.c:101 util/grub-mknetdir.c:102 -#: util/grub-mknetdir.c:103 +#: util/VasEBoot-mknetdir.c:100 util/VasEBoot-mknetdir.c:101 util/VasEBoot-mknetdir.c:102 +#: util/VasEBoot-mknetdir.c:103 msgid ".efi" msgstr "" -#: util/grub-mkrescue.c:259 +#: util/VasEBoot-mkrescue.c:259 #, c-format -msgid "set prefix=(${root})/boot/grub\n" +msgid "set prefix=(${root})/boot/VasEBoot\n" msgstr "" -#: util/grub-mkrescue.c:258 +#: util/VasEBoot-mkrescue.c:258 #, c-format msgid "search --fs-uuid --set=root %s\n" msgstr "" -#: util/grub-mkrescue.c:575 +#: util/VasEBoot-mkrescue.c:575 #, c-format msgid "\n" "\n" @@ -6892,220 +6892,220 @@ msgid "\n" msgstr "" -#: util/grub-install.c:1264 +#: util/VasEBoot-install.c:1264 #, c-format msgid "set prefix=($root)'%s'\n" msgstr "" -#: grub-core/osdep/unix/config.c:108 +#: VasEBoot-core/osdep/unix/config.c:108 #, c-format -msgid "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", " - "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\"" +msgid "'; printf \"VasEBoot_ENABLE_CRYPTODISK=%s\\nVasEBoot_DISTRIBUTOR=%s\\n\", " + "\"$VasEBoot_ENABLE_CRYPTODISK\", \"$VasEBoot_DISTRIBUTOR\"" msgstr "" -#: grub-core/commands/tr.c:33 +#: VasEBoot-core/commands/tr.c:33 msgid "upcase" msgstr "" -#: grub-core/commands/tr.c:34 +#: VasEBoot-core/commands/tr.c:34 msgid "downcase" msgstr "" -#: grub-core/commands/tr.c:38 +#: VasEBoot-core/commands/tr.c:38 msgid "abcdefghijklmnopqrstuvwxyz" msgstr "" -#: grub-core/commands/tr.c:39 +#: VasEBoot-core/commands/tr.c:39 msgid "ABCDEFGHIJKLMNOPQRSTUVWXYZ" msgstr "" -#: grub-core/net/dns.c:694 +#: VasEBoot-core/net/dns.c:694 #, c-format msgid "%s (%s)\n" msgstr "" -#: grub-core/osdep/aros/hostdisk.c:570 +#: VasEBoot-core/osdep/aros/hostdisk.c:570 #, c-format -msgid "T:grub.%d.%d.%d.%d" +msgid "T:VasEBoot.%d.%d.%d.%d" msgstr "" -#: util/grub-install.c:1722 +#: util/VasEBoot-install.c:1722 msgid "\\\\BootX" msgstr "" -#: util/grub-install.c:1816 +#: util/VasEBoot-install.c:1816 msgid "\\System\\Library\\CoreServices" msgstr "" -#: util/grub-install.c:1702 util/grub-install.c:1802 +#: util/VasEBoot-install.c:1702 util/VasEBoot-install.c:1802 msgid "r+" msgstr "" -#: util/grub-install.c:1128 +#: util/VasEBoot-install.c:1128 msgid "macppc" msgstr "" -#: util/grub-install.c:296 +#: util/VasEBoot-install.c:296 msgid "macppc-directory" msgstr "" -#: grub-core/term/xen/xen_kbd.c:468 grub-core/term/xen/xen_kbd.c:477 +#: VasEBoot-core/term/xen/xen_kbd.c:468 VasEBoot-core/term/xen/xen_kbd.c:477 msgid "xen_keyboard" msgstr "" -#: grub-core/video/xen/xenfb.c:79 +#: VasEBoot-core/video/xen/xenfb.c:79 #, c-format msgid "device/vfb/%s/backend" msgstr "" -#: grub-core/video/xen/xenfb.c:87 +#: VasEBoot-core/video/xen/xenfb.c:87 #, c-format msgid "device/vfb/%s/backend-id" msgstr "" -#: grub-core/video/xen/xenfb.c:102 +#: VasEBoot-core/video/xen/xenfb.c:102 #, c-format msgid "device/vfb/%s/page-ref" msgstr "" -#: grub-core/video/xen/xenfb.c:108 +#: VasEBoot-core/video/xen/xenfb.c:108 #, c-format msgid "device/vfb/%s/protocol" msgstr "" -#: grub-core/video/xen/xenfb.c:120 +#: VasEBoot-core/video/xen/xenfb.c:120 #, c-format msgid "device/vfb/%s/event-channel" msgstr "" -#: grub-core/video/xen/xenfb.c:131 +#: VasEBoot-core/video/xen/xenfb.c:131 #, c-format msgid "device/vfb/%s" msgstr "" -#: grub-core/video/xen/xenfb.c:172 +#: VasEBoot-core/video/xen/xenfb.c:172 #, c-format msgid "device/vfb/%s/state" msgstr "" -#: grub-core/video/xen/xenfb.c:270 +#: VasEBoot-core/video/xen/xenfb.c:270 msgid "device/vfb" msgstr "" -#: include/grub/emu/misc.h:46 +#: include/VasEBoot/emu/misc.h:46 msgid "I64u" msgstr "" -#: include/grub/emu/misc.h:47 +#: include/VasEBoot/emu/misc.h:47 msgid "I64x" msgstr "" -#: grub-core/term/xen/xen_kbd.c:143 +#: VasEBoot-core/term/xen/xen_kbd.c:143 #, c-format msgid "device/vkbd/%s/backend" msgstr "" -#: grub-core/term/xen/xen_kbd.c:151 +#: VasEBoot-core/term/xen/xen_kbd.c:151 #, c-format msgid "device/vkbd/%s/backend-id" msgstr "" -#: grub-core/term/xen/xen_kbd.c:166 +#: VasEBoot-core/term/xen/xen_kbd.c:166 #, c-format msgid "device/vkbd/%s/page-ref" msgstr "" -#: grub-core/term/xen/xen_kbd.c:172 +#: VasEBoot-core/term/xen/xen_kbd.c:172 #, c-format msgid "device/vkbd/%s/protocol" msgstr "" -#: grub-core/term/xen/xen_kbd.c:184 +#: VasEBoot-core/term/xen/xen_kbd.c:184 #, c-format msgid "device/vkbd/%s/event-channel" msgstr "" -#: grub-core/term/xen/xen_kbd.c:195 +#: VasEBoot-core/term/xen/xen_kbd.c:195 #, c-format msgid "device/vkbd/%s" msgstr "" -#: grub-core/term/xen/xen_kbd.c:204 +#: VasEBoot-core/term/xen/xen_kbd.c:204 #, c-format msgid "device/vkbd/%s/state" msgstr "" -#: grub-core/term/xen/xen_kbd.c:267 grub-core/video/xen/xenfb.c:239 +#: VasEBoot-core/term/xen/xen_kbd.c:267 VasEBoot-core/video/xen/xenfb.c:239 #, c-format msgid "%s/page-ref" msgstr "" -#: grub-core/term/xen/xen_kbd.c:291 +#: VasEBoot-core/term/xen/xen_kbd.c:291 msgid "device/vkbd" msgstr "" -#: grub-core/commands/fileXX.c:51 grub-core/commands/fileXX.c:62 -#: grub-core/commands/fileXX.c:63 +#: VasEBoot-core/commands/fileXX.c:51 VasEBoot-core/commands/fileXX.c:62 +#: VasEBoot-core/commands/fileXX.c:63 msgid ".note.netbsd.ident" msgstr "" -#: grub-core/commands/legacycfg.c:484 +#: VasEBoot-core/commands/legacycfg.c:484 msgid "initrd16initrd" msgstr "" -#: grub-core/commands/syslinuxcfg.c:146 +#: VasEBoot-core/commands/syslinuxcfg.c:146 msgid "extract_syslinux_entries_" msgstr "" -#: grub-core/commands/syslinuxcfg.c:147 +#: VasEBoot-core/commands/syslinuxcfg.c:147 msgid "syslinux_" msgstr "" -#: grub-core/commands/file.c:41 +#: VasEBoot-core/commands/file.c:41 msgid "is-x86_64-xen-domu" msgstr "" -#: grub-core/commands/file.c:69 +#: VasEBoot-core/commands/file.c:69 msgid "is-x86_64-kfreebsd" msgstr "" -#: grub-core/commands/file.c:76 +#: VasEBoot-core/commands/file.c:76 msgid "is-x86_64-knetbsd" msgstr "" -#: grub-core/commands/file.c:81 +#: VasEBoot-core/commands/file.c:81 msgid "is-x86_64-efi" msgstr "" -#: grub-core/commands/file.c:89 +#: VasEBoot-core/commands/file.c:89 msgid "is-x86_64-xnu" msgstr "" -#: grub-core/commands/file.c:506 +#: VasEBoot-core/commands/file.c:506 msgid "hibr" msgstr "" -#: grub-core/commands/file.c:508 +#: VasEBoot-core/commands/file.c:508 msgid "HIBR" msgstr "" -#: grub-core/disk/diskfilter.c:1060 +#: VasEBoot-core/disk/diskfilter.c:1060 msgid ",%" msgstr "" -#: grub-core/disk/diskfilter.c:1061 +#: VasEBoot-core/disk/diskfilter.c:1061 #, c-format msgid ") into %s (%s)\n" msgstr "" -#: grub-core/osdep/windows/blocklist.c:88 +#: VasEBoot-core/osdep/windows/blocklist.c:88 msgid ", first_lcn=%" msgstr "" -#: util/grub-mkimagexx.c:438 +#: util/VasEBoot-mkimagexx.c:438 msgid " (0x%" msgstr "" -#: util/grub-mkimagexx.c:666 util/grub-mkimagexx.c:679 -#: util/grub-mkimagexx.c:702 util/grub-mkimagexx.c:728 -#: util/grub-mkimagexx.c:812 +#: util/VasEBoot-mkimagexx.c:666 util/VasEBoot-mkimagexx.c:679 +#: util/VasEBoot-mkimagexx.c:702 util/VasEBoot-mkimagexx.c:728 +#: util/VasEBoot-mkimagexx.c:812 msgid " at the offset 0x%" msgstr "" @@ -7113,384 +7113,384 @@ msgstr "" msgid " bytes at offset 0x%" msgstr "" -#: grub-core/term/serial.c:64 +#: VasEBoot-core/term/serial.c:64 msgid "on|off" msgstr "" -#: util/grub-mkimagexx.c:898 +#: util/VasEBoot-mkimagexx.c:898 msgid "jump24 relocation out of range" msgstr "" -#: grub-core/osdep/linux/ofpath.c:48 +#: VasEBoot-core/osdep/linux/ofpath.c:48 #, c-format msgid "ofpath: error: " msgstr "" -#: grub-core/osdep/linux/ofpath.c:61 +#: VasEBoot-core/osdep/linux/ofpath.c:61 #, c-format msgid "ofpath: info: " msgstr "" -#: grub-core/osdep/linux/ofpath.c:119 +#: VasEBoot-core/osdep/linux/ofpath.c:119 #, c-format msgid "Trying %s\n" msgstr "" -#: grub-core/osdep/windows/blocklist.c:108 +#: VasEBoot-core/osdep/windows/blocklist.c:108 #, c-format msgid "FSCTL_GET_RETRIEVAL_POINTERS fails: %s" msgstr "" -#: grub-core/osdep/windows/blocklist.c:84 +#: VasEBoot-core/osdep/windows/blocklist.c:84 #, c-format msgid "unsupported fs for blocklist on windows: %s" msgstr "" -#: include/grub/util/install.h:45 util/grub-mkstandalone.c:45 +#: include/VasEBoot/util/install.h:45 util/VasEBoot-mkstandalone.c:45 msgid "xz|none|auto" msgstr "" -#: util/grub-mkimagexx.c:845 +#: util/VasEBoot-mkimagexx.c:845 msgid "CALL26 Relocation out of range" msgstr "" -#: grub-core/commands/verify.c:313 +#: VasEBoot-core/commands/verify.c:313 msgid "\x99" msgstr "" -#: grub-core/commands/videotest.c:122 +#: VasEBoot-core/commands/videotest.c:122 msgid "Unicode test: happy\xE2\x98\xBA \xC2\xA3 5.00" " \xC2\xA1\xCF\x84\xC3\xA4u! " " \xE2\x84\xA4\xE2\x8A\x86\xE2\x84\x9D" msgstr "" -#: grub-core/disk/luks.c:40 +#: VasEBoot-core/disk/luks.c:40 msgid "LUKS\xBA\xBE" msgstr "" -#: grub-core/disk/lvmparse.c:67 grub-core/disk/lvmparse.c:69 +#: VasEBoot-core/disk/lvmparse.c:67 VasEBoot-core/disk/lvmparse.c:69 msgid " = [" msgstr "" -#: grub-core/disk/lvmparse.c:115 grub-core/disk/lvmparse.c:123 -#: grub-core/disk/lvmparse.c:167 grub-core/disk/lvmparse.c:170 +#: VasEBoot-core/disk/lvmparse.c:115 VasEBoot-core/disk/lvmparse.c:123 +#: VasEBoot-core/disk/lvmparse.c:167 VasEBoot-core/disk/lvmparse.c:170 msgid "id = \"" msgstr "" -#: grub-core/disk/lvmparse.c:127 +#: VasEBoot-core/disk/lvmparse.c:127 msgid "extent_size = " msgstr "" -#: grub-core/disk/lvmparse.c:143 grub-core/disk/lvmparse.c:146 +#: VasEBoot-core/disk/lvmparse.c:143 VasEBoot-core/disk/lvmparse.c:146 msgid "physical_volumes {" msgstr "" -#: grub-core/disk/lvmparse.c:174 +#: VasEBoot-core/disk/lvmparse.c:174 msgid "pe_start = " msgstr "" -#: grub-core/disk/lvmparse.c:199 +#: VasEBoot-core/disk/lvmparse.c:199 msgid "logical_volumes" msgstr "" -#: grub-core/disk/lvmparse.c:202 +#: VasEBoot-core/disk/lvmparse.c:202 msgid "logical_volumes = " msgstr "" -#: grub-core/disk/lvmparse.c:226 grub-core/disk/lvmparse.c:227 +#: VasEBoot-core/disk/lvmparse.c:226 VasEBoot-core/disk/lvmparse.c:227 msgid "status" msgstr "" -#: grub-core/disk/lvmparse.c:226 +#: VasEBoot-core/disk/lvmparse.c:226 msgid "VISIBLE" msgstr "" -#: grub-core/disk/lvmparse.c:227 +#: VasEBoot-core/disk/lvmparse.c:227 msgid "PVMOVE" msgstr "" -#: grub-core/disk/lvmparse.c:228 +#: VasEBoot-core/disk/lvmparse.c:228 msgid "segment_count = " msgstr "" -#: grub-core/disk/lvmparse.c:246 +#: VasEBoot-core/disk/lvmparse.c:246 msgid "segment" msgstr "" -#: grub-core/disk/lvmparse.c:255 +#: VasEBoot-core/disk/lvmparse.c:255 msgid "start_extent = " msgstr "" -#: grub-core/disk/lvmparse.c:263 +#: VasEBoot-core/disk/lvmparse.c:263 msgid "extent_count = " msgstr "" -#: grub-core/disk/lvmparse.c:272 grub-core/disk/lvmparse.c:275 +#: VasEBoot-core/disk/lvmparse.c:272 VasEBoot-core/disk/lvmparse.c:275 msgid "type = \"" msgstr "" -#: grub-core/disk/lvmparse.c:277 grub-core/disk/lvmparse.c:278 +#: VasEBoot-core/disk/lvmparse.c:277 VasEBoot-core/disk/lvmparse.c:278 msgid "striped\"" msgstr "" -#: grub-core/disk/lvmparse.c:282 +#: VasEBoot-core/disk/lvmparse.c:282 msgid "stripe_count = " msgstr "" -#: grub-core/disk/lvmparse.c:292 grub-core/disk/lvmparse.c:396 +#: VasEBoot-core/disk/lvmparse.c:292 VasEBoot-core/disk/lvmparse.c:396 msgid "stripe_size = " msgstr "" -#: grub-core/disk/lvmparse.c:299 grub-core/disk/lvmparse.c:307 +#: VasEBoot-core/disk/lvmparse.c:299 VasEBoot-core/disk/lvmparse.c:307 msgid "stripes = [" msgstr "" -#: grub-core/disk/lvmparse.c:332 +#: VasEBoot-core/disk/lvmparse.c:332 msgid "mirror\"" msgstr "" -#: grub-core/disk/lvmparse.c:336 +#: VasEBoot-core/disk/lvmparse.c:336 msgid "mirror_count = " msgstr "" -#: grub-core/disk/lvmparse.c:350 grub-core/disk/lvmparse.c:358 +#: VasEBoot-core/disk/lvmparse.c:350 VasEBoot-core/disk/lvmparse.c:358 msgid "mirrors = [" msgstr "" -#: grub-core/disk/lvmparse.c:375 grub-core/disk/lvmparse.c:376 -#: grub-core/disk/lvmparse.c:377 grub-core/disk/lvmparse.c:384 +#: VasEBoot-core/disk/lvmparse.c:375 VasEBoot-core/disk/lvmparse.c:376 +#: VasEBoot-core/disk/lvmparse.c:377 VasEBoot-core/disk/lvmparse.c:384 msgid "raid" msgstr "" -#: grub-core/disk/lvmparse.c:378 +#: VasEBoot-core/disk/lvmparse.c:378 msgid "raidX" msgstr "" -#: grub-core/disk/lvmparse.c:386 +#: VasEBoot-core/disk/lvmparse.c:386 msgid "device_count = " msgstr "" -#: grub-core/disk/lvmparse.c:410 grub-core/disk/lvmparse.c:418 +#: VasEBoot-core/disk/lvmparse.c:410 VasEBoot-core/disk/lvmparse.c:418 msgid "raids = [" msgstr "" -#: grub-core/fs/cpio.c:24 +#: VasEBoot-core/fs/cpio.c:24 msgid "\xc7\x71" msgstr "" -#: grub-core/fs/cpio_be.c:23 +#: VasEBoot-core/fs/cpio_be.c:23 msgid "\x71\xc7" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:244 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:244 msgid "\xc2\xb0" msgstr "" -#: grub-core/kern/ieee1275/cmain.c:88 +#: VasEBoot-core/kern/ieee1275/cmain.c:88 msgid "IBM pSeries (emulated by qemu)" msgstr "" -#: grub-core/lib/all_video.c:36 +#: VasEBoot-core/lib/all_video.c:36 msgid "/video.lst" msgstr "" -#: grub-core/osdep/unix/config.c:108 +#: VasEBoot-core/osdep/unix/config.c:108 #, c-format msgid "" -"'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" " -"\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"" +"'; printf \"VasEBoot_ENABLE_CRYPTODISK=%s\\nVasEBoot_DISTRIBUTOR=%s\\n\" " +"\"$VasEBoot_ENABLE_CRYPTODISK\" \"$VasEBoot_DISTRIBUTOR\"" msgstr "" -#: include/grub/dl.h:141 +#: include/VasEBoot/dl.h:141 msgid "license" msgstr "" -#: util/grub-install.c:1106 +#: util/VasEBoot-install.c:1106 msgid "BOOTAA64.EFI" msgstr "" -#: util/grub-install.c:1133 -msgid "grubaa64.efi" +#: util/VasEBoot-install.c:1133 +msgid "VasEBootaa64.efi" msgstr "" -#: util/grub-install.c:1274 -msgid "GRUB_ENABLE_CRYPTODISK=y" +#: util/VasEBoot-install.c:1274 +msgid "VasEBoot_ENABLE_CRYPTODISK=y" msgstr "" -#: util/grub-mkrescue.c:656 +#: util/VasEBoot-mkrescue.c:656 msgid "part_gpt" msgstr "" -#: util/grub-mkrescue.c:657 +#: util/VasEBoot-mkrescue.c:657 msgid "part_msdos" msgstr "" -#: util/grub-mkrescue.c:663 util/grub-mkrescue.c:668 util/grub-mkrescue.c:723 +#: util/VasEBoot-mkrescue.c:663 util/VasEBoot-mkrescue.c:668 util/VasEBoot-mkrescue.c:723 msgid "part_apple" msgstr "" -#: util/grub-mkrescue.c:677 +#: util/VasEBoot-mkrescue.c:677 msgid "bootaa64.efi" msgstr "" -#: util/grub-probe.c:136 util/grub-probe.c:151 util/grub-probe.c:190 -#: util/grub-probe.c:247 +#: util/VasEBoot-probe.c:136 util/VasEBoot-probe.c:151 util/VasEBoot-probe.c:190 +#: util/VasEBoot-probe.c:247 #, c-format msgid "%s%c" msgstr "" -#: util/grub-probe.c:233 +#: util/VasEBoot-probe.c:233 #, c-format msgid "lvm%c" msgstr "" -#: util/grub-probe.c:237 +#: util/VasEBoot-probe.c:237 #, c-format msgid "ldm%c" msgstr "" -#: util/grub-probe.c:245 +#: util/VasEBoot-probe.c:245 #, c-format msgid "diskfilter%c" msgstr "" -#: util/grub-probe.c:250 +#: util/VasEBoot-probe.c:250 #, c-format msgid "raid5rec%c" msgstr "" -#: util/grub-probe.c:252 +#: util/VasEBoot-probe.c:252 #, c-format msgid "raid6rec%c" msgstr "" -#: util/grub-mkrescue.c:136 +#: util/VasEBoot-mkrescue.c:136 #, c-format msgid "%s\n\n%s\n\n%s" msgstr "" -#: grub-core/kern/arm/cache.c:133 +#: VasEBoot-core/kern/arm/cache.c:133 msgid "couldn't get memory map, not enabling caches" msgstr "" -#: grub-core/kern/arm/cache.c:149 +#: VasEBoot-core/kern/arm/cache.c:149 #, c-format msgid "%d crossers\n" msgstr "" -#: grub-core/kern/arm/cache.c:154 +#: VasEBoot-core/kern/arm/cache.c:154 msgid "couldn't allocate place for MMU table, not enabling caches" msgstr "" -#: grub-core/kern/arm/cache.c:212 +#: VasEBoot-core/kern/arm/cache.c:212 msgid "MMU tables generated\n" msgstr "" -#: grub-core/kern/arm/cache.c:216 +#: VasEBoot-core/kern/arm/cache.c:216 msgid "enabling MMU\n" msgstr "" -#: grub-core/kern/arm/cache.c:218 +#: VasEBoot-core/kern/arm/cache.c:218 msgid "MMU enabled\n" msgstr "" -#: grub-core/commands/verify.c:313 +#: VasEBoot-core/commands/verify.c:313 msgid "™" msgstr "" -#: grub-core/commands/videotest.c:122 +#: VasEBoot-core/commands/videotest.c:122 msgid "Unicode test: happy☺ £ 5.00 ¡τäu! ℤ⊆ℝ" msgstr "" -#: grub-core/disk/luks.c:40 +#: VasEBoot-core/disk/luks.c:40 msgid "LUKSº¾" msgstr "" -#: grub-core/fs/cpio.c:24 +#: VasEBoot-core/fs/cpio.c:24 msgid "Çq" msgstr "" -#: grub-core/fs/cpio_be.c:23 +#: VasEBoot-core/fs/cpio_be.c:23 msgid "qÇ" msgstr "" -#: grub-core/gfxmenu/gui_circular_progress.c:244 +#: VasEBoot-core/gfxmenu/gui_circular_progress.c:244 msgid "°" msgstr "" -#: grub-core/lib/xzembed/xz_stream.h:35 +#: VasEBoot-core/lib/xzembed/xz_stream.h:35 msgid "ý7zXZ" msgstr "" -#: grub-core/partmap/msdos.c:74 +#: VasEBoot-core/partmap/msdos.c:74 msgid "ÔA õ" msgstr "" -#: grub-core/partmap/msdos.c:80 +#: VasEBoot-core/partmap/msdos.c:80 msgid "ØA õ" msgstr "" -#: grub-core/partmap/msdos.c:87 +#: VasEBoot-core/partmap/msdos.c:87 msgid "pŠ]F5Å“®=†ý±U>à" msgstr "" -#: grub-core/io/lzopio.c:30 +#: VasEBoot-core/io/lzopio.c:30 msgid "" "‰LZO\n" "\n" msgstr "" -#: grub-core/bus/emu/pci.c:58 +#: VasEBoot-core/bus/emu/pci.c:58 #, c-format msgid "mapping 0x%llx failed (error %d)" msgstr "" -#: grub-core/disk/dmraid_nvidia.c:175 +#: VasEBoot-core/disk/dmraid_nvidia.c:175 msgid "nv" msgstr "" -#: grub-core/fs/xfs.c:478 +#: VasEBoot-core/fs/xfs.c:478 msgid ") - %" msgstr "" -#: grub-core/fs/xfs.c:478 +#: VasEBoot-core/fs/xfs.c:478 #, c-format msgid ", %d " msgstr "" -#: grub-core/fs/xfs.c:550 +#: VasEBoot-core/fs/xfs.c:550 msgid "BMA3" msgstr "" -#: grub-core/fs/zfs/zfs.c:284 +#: VasEBoot-core/fs/zfs/zfs.c:284 msgid "com.delphix:hole_birth" msgstr "" -#: grub-core/fs/zfs/zfs.c:285 +#: VasEBoot-core/fs/zfs/zfs.c:285 msgid "com.delphix:embedded_data" msgstr "" -#: grub-core/fs/zfs/zfs.c:286 +#: VasEBoot-core/fs/zfs/zfs.c:286 msgid "com.delphix:extensible_dataset" msgstr "" -#: grub-core/fs/zfs/zfs.c:287 +#: VasEBoot-core/fs/zfs/zfs.c:287 msgid "org.open-zfs:large_blocks" msgstr "" -#: grub-core/fs/zfs/zfs.c:1877 +#: VasEBoot-core/fs/zfs/zfs.c:1877 msgid "/%" msgstr "" -#: grub-core/osdep/linux/platform.c:73 +#: VasEBoot-core/osdep/linux/platform.c:73 msgid "/sys/firmware/efi/fw_platform_size" msgstr "" -#: util/grub-mkrescue.c:454 +#: util/VasEBoot-mkrescue.c:454 msgid "-output" msgstr "" -#: util/grub-mkrescue.c:455 +#: util/VasEBoot-mkrescue.c:455 msgid "--output" msgstr "" diff --git a/tests/VasEBoot_cmd_date.in b/tests/VasEBoot_cmd_date.in index a459353e8..0c0e1bc9b 100644 --- a/tests/VasEBoot_cmd_date.in +++ b/tests/VasEBoot_cmd_date.in @@ -1,15 +1,15 @@ #! /bin/bash set -e -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" # FIXME: OpenBIOS on sparc64 doesn't implement RTC -if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then +if [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = sparc64-ieee1275 ]; then exit 0 fi pdt="$(date -u +%s)" -dt=`echo date | @builddir@/grub-shell` +dt=`echo date | @builddir@/VasEBoot-shell` dtg="$(date -u -d "$dt" +%s)" ndt="$(date -u +%s)" @@ -19,7 +19,7 @@ if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then fi pdt="$(date -u +%s)" -dt=`echo 'insmod datehook; echo $YEAR-$MONTH-$DAY $HOUR:$MINUTE:$SECOND' | @builddir@/grub-shell` +dt=`echo 'insmod datehook; echo $YEAR-$MONTH-$DAY $HOUR:$MINUTE:$SECOND' | @builddir@/VasEBoot-shell` dtg="$(date -u -d "$dt" +%s)" ndt="$(date -u +%s)" diff --git a/tests/VasEBoot_cmd_echo.in b/tests/VasEBoot_cmd_echo.in index 902696778..472bc8442 100644 --- a/tests/VasEBoot_cmd_echo.in +++ b/tests/VasEBoot_cmd_echo.in @@ -1,19 +1,19 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . echo echo -n @@ -32,7 +32,7 @@ echo foo -n -e echo ------- -if test -n "$grubshell"; then insmod regexp; fi +if test -n "$VasEBootshell"; then insmod regexp; fi echo '*' echo "*" diff --git a/tests/VasEBoot_cmd_regexp.in b/tests/VasEBoot_cmd_regexp.in index e7e625701..6badb4545 100644 --- a/tests/VasEBoot_cmd_regexp.in +++ b/tests/VasEBoot_cmd_regexp.in @@ -1,42 +1,42 @@ #! /bin/bash set -e -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . cmd='regexp -s version "vm-(.*)" vm-1.2.3; echo $version' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != 1.2.3; then echo "error: $cmd" >&2; exit 1; fi cmd='regexp -s 1:version "vm-(.*)" vm-1.2.3; echo $version' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != 1.2.3; then echo "error: $cmd" >&2; exit 1; fi cmd='regexp -s 0:match "vm-(.*)" vm-1.2.3; echo $match' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != vm-1.2.3; then echo "error: $cmd" >&2; exit 1; fi cmd='regexp -s 2:match "vm-(.*)" vm-1.2.3; echo $match' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test -n "$v"; then echo "error: $cmd" >&2; exit 1; fi cmd='regexp -s match "\\\((.*)\\\)" (hd0,msdos1); echo $match' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != "hd0,msdos1"; then echo "error: $cmd" >&2; exit 1; fi cmd='regexp -s match "hd([0-9]+)" hd0; echo $match' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != "0"; then echo "error: $cmd" >&2; exit 1; fi diff --git a/tests/VasEBoot_cmd_set_date.in b/tests/VasEBoot_cmd_set_date.in index c594ae3fc..c4cebefd3 100644 --- a/tests/VasEBoot_cmd_set_date.in +++ b/tests/VasEBoot_cmd_set_date.in @@ -1,9 +1,9 @@ #! /bin/bash set -e -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # FIXME: OpenBIOS on sparc64 doesn't implement RTC sparc64-ieee1275) exit 0;; @@ -17,7 +17,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esac -out=$(cat <$non_empty <$outfile <$outfile < /dev/null 2>&1; then - echo "GRUB test command file tests failed." + echo "VasEBoot test command file tests failed." cat "$outfile" exit 1 else diff --git a/tests/VasEBoot_cmd_tr.in b/tests/VasEBoot_cmd_tr.in index 3fb15e35c..455197665 100644 --- a/tests/VasEBoot_cmd_tr.in +++ b/tests/VasEBoot_cmd_tr.in @@ -1,62 +1,62 @@ #! /bin/bash -e -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # # Translating a string argument # cmd='tr 12345 abcde a1b2c3d4e5' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != aabbccddee; then echo "error: $cmd [$v]" >&2; exit 1; fi cmd='tr -U abcdABCD' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != ABCDABCD; then echo "error: $cmd [$v]" >&2; exit 1; fi cmd='tr -D ABCDabcd' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != abcdabcd; then echo "error: $cmd [$v]" >&2; exit 1; fi # # Translating a variable value # cmd='foo=12345678; tr -s foo 1234 abcd; echo $foo' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != abcd5678; then echo "error: $cmd [$v]" >&2; exit 1; fi cmd='foo=abcdEFGH; tr -U -s foo; echo $foo' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != ABCDEFGH; then echo "error: $cmd [$v]" >&2; exit 1; fi cmd='foo=abcdEFGH; tr -D -s foo; echo $foo' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != abcdefgh; then echo "error: $cmd [$v]" >&2; exit 1; fi # # Setting a variable from string argument # cmd='foo=12345678; tr -s foo 1234 abcd a1b2c3d4e5; echo $foo' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != aabbccdde5; then echo "error: $cmd [$v]" >&2; exit 1; fi cmd='foo=abcdEFGH; tr -U -s foo xyz; echo $foo' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != XYZ; then echo "error: $cmd [$v]" >&2; exit 1; fi cmd='foo=abcdEFGH; tr -D -s foo XYZ; echo $foo' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` if test "$v" != xyz; then echo "error: $cmd [$v]" >&2; exit 1; fi diff --git a/tests/VasEBoot_func_test.in b/tests/VasEBoot_func_test.in index c8cc26376..65fbef785 100644 --- a/tests/VasEBoot_func_test.in +++ b/tests/VasEBoot_func_test.in @@ -1,9 +1,9 @@ #! /bin/bash set -e -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: Max RAM is 256M mips-qemu_mips | mipsel-qemu_mips) mem=256M;; @@ -12,7 +12,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in esac # Increase memory as some of tests are high-resolution and need a lot of memory. -out=`echo all_functional_test | @builddir@/grub-shell --timeout=3600 --files="/boot/grub/fonts/unicode.pf2"="@builddir@/"unicode.pf2 --qemu-opts="-m $mem"` +out=`echo all_functional_test | @builddir@/VasEBoot-shell --timeout=3600 --files="/boot/VasEBoot/fonts/unicode.pf2"="@builddir@/"unicode.pf2 --qemu-opts="-m $mem"` if [ "$(echo "$out" | tail -n 1)" != "ALL TESTS PASSED" ]; then echo "Functional test failure: $out" diff --git a/tests/VasEBoot_script_blanklines.in b/tests/VasEBoot_script_blanklines.in index 89ed763d3..c5ddf7ad7 100644 --- a/tests/VasEBoot_script_blanklines.in +++ b/tests/VasEBoot_script_blanklines.in @@ -1,7 +1,7 @@ #! /bin/sh set -e -@builddir@/grub-script-check <. +# along with VasEBoot. If not, see . error_if_not () { if test "$1" != "$2"; then @@ -24,17 +24,17 @@ error_if_not () { } cmd='test_blockarg { true }' -v=`echo "$cmd" | @builddir@/grub-shell` +v=`echo "$cmd" | @builddir@/VasEBoot-shell` error_if_not "$v" '{ true }' tmp=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 cmd='test_blockarg { test_blockarg { true } }' -echo "$cmd" | @builddir@/grub-shell >$tmp +echo "$cmd" | @builddir@/VasEBoot-shell >$tmp error_if_not "`head -n1 $tmp|tail -n1`" '{ test_blockarg { true } }' error_if_not "`head -n2 $tmp|tail -n1`" '{ true }' cmd='test_blockarg { test_blockarg { test_blockarg { true } }; test_blockarg { true } }' -echo "$cmd" | @builddir@/grub-shell >$tmp +echo "$cmd" | @builddir@/VasEBoot-shell >$tmp error_if_not "`head -n1 $tmp|tail -n1`" '{ test_blockarg { test_blockarg { true } }; test_blockarg { true } }' error_if_not "`head -n2 $tmp|tail -n1`" '{ test_blockarg { true } }' error_if_not "`head -n3 $tmp|tail -n1`" '{ true }' diff --git a/tests/VasEBoot_script_break.in b/tests/VasEBoot_script_break.in index bf265e8b3..91747ecf6 100644 --- a/tests/VasEBoot_script_break.in +++ b/tests/VasEBoot_script_break.in @@ -1,19 +1,19 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # break without any arguments for i in 1 2 3 4 5 6 7 8 9 10 diff --git a/tests/VasEBoot_script_comments.in b/tests/VasEBoot_script_comments.in index f212cc1e1..198b16a98 100644 --- a/tests/VasEBoot_script_comments.in +++ b/tests/VasEBoot_script_comments.in @@ -1,19 +1,19 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . echo a###b echo a# #b diff --git a/tests/VasEBoot_script_continue.in b/tests/VasEBoot_script_continue.in index 4c28ce404..09b8b19f3 100644 --- a/tests/VasEBoot_script_continue.in +++ b/tests/VasEBoot_script_continue.in @@ -1,19 +1,19 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # continue without any arguments for i in 1 2 3 4 5 6 7 8 9 10 diff --git a/tests/VasEBoot_script_dollar.in b/tests/VasEBoot_script_dollar.in index 2e076427a..ba336c551 100644 --- a/tests/VasEBoot_script_dollar.in +++ b/tests/VasEBoot_script_dollar.in @@ -1,6 +1,6 @@ #! /bin/sh set -e -@builddir@/grub-script-check << EOF +@builddir@/VasEBoot-script-check << EOF echo "\\\$" EOF diff --git a/tests/VasEBoot_script_echo1.in b/tests/VasEBoot_script_echo1.in index 3a07972a9..096221c29 100644 --- a/tests/VasEBoot_script_echo1.in +++ b/tests/VasEBoot_script_echo1.in @@ -1,20 +1,20 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # simple arguments echo one two three @@ -172,8 +172,8 @@ echo one x\ $var -if test x$grubshell = xyes; then insmod regexp; fi -echo /boot/grub/i386-pc/normal.mod +if test x$VasEBootshell = xyes; then insmod regexp; fi +echo /boot/VasEBoot/i386-pc/normal.mod echo x\\y echo x\*y echo x\\ diff --git a/tests/VasEBoot_script_echo_keywords.in b/tests/VasEBoot_script_echo_keywords.in index a6383f0e2..ec08e1126 100644 --- a/tests/VasEBoot_script_echo_keywords.in +++ b/tests/VasEBoot_script_echo_keywords.in @@ -1,3 +1,3 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester echo if then else fi for do done diff --git a/tests/VasEBoot_script_escape_comma.in b/tests/VasEBoot_script_escape_comma.in index eff317920..0cdb34262 100644 --- a/tests/VasEBoot_script_escape_comma.in +++ b/tests/VasEBoot_script_escape_comma.in @@ -1,4 +1,4 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester x=1\\,1 echo $x diff --git a/tests/VasEBoot_script_eval.in b/tests/VasEBoot_script_eval.in index c97b78d77..905c6189b 100644 --- a/tests/VasEBoot_script_eval.in +++ b/tests/VasEBoot_script_eval.in @@ -1,4 +1,4 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester eval echo "Hello world" valname=tst diff --git a/tests/VasEBoot_script_expansion.in b/tests/VasEBoot_script_expansion.in index e46401c4c..895dd5615 100644 --- a/tests/VasEBoot_script_expansion.in +++ b/tests/VasEBoot_script_expansion.in @@ -1,24 +1,24 @@ #! /bin/bash set -e -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . -disks=`echo ls | @builddir@/grub-shell| grep -av '^Network protocols:$'| grep -av '^tftp http $'` -other=`echo insmod regexp\; echo \* | @builddir@/grub-shell` +disks=`echo ls | @builddir@/VasEBoot-shell| grep -av '^Network protocols:$'| grep -av '^tftp http $'` +other=`echo insmod regexp\; echo \* | @builddir@/VasEBoot-shell` for d in $disks; do if echo "$d" |grep ',' >/dev/null; then if echo "$other" | grep -F -- "$d" >/dev/null; then @@ -33,7 +33,7 @@ for d in $disks; do fi done -other=`echo insmod regexp\; echo '(*)' | @builddir@/grub-shell` +other=`echo insmod regexp\; echo '(*)' | @builddir@/VasEBoot-shell` for d in $disks; do if ! echo "$other" | grep -F -- "$d" >/dev/null; then echo "$d missing from (*) expansion" >&2 diff --git a/tests/VasEBoot_script_final_semicolon.in b/tests/VasEBoot_script_final_semicolon.in index 3ac26540b..a3e0ff6b3 100644 --- a/tests/VasEBoot_script_final_semicolon.in +++ b/tests/VasEBoot_script_final_semicolon.in @@ -1,7 +1,7 @@ #! /bin/sh set -e -@builddir@/grub-script-check <. +# along with VasEBoot. If not, see . echo parameter count function fcount { diff --git a/tests/VasEBoot_script_gettext.in b/tests/VasEBoot_script_gettext.in index cc42c6751..ccf9419d2 100644 --- a/tests/VasEBoot_script_gettext.in +++ b/tests/VasEBoot_script_gettext.in @@ -1,19 +1,19 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester # # Copyright (C) 2010,2012 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . echo $"foo" echo $"foo bar" @@ -61,7 +61,7 @@ echo one$"two\ \"three\"\ four" -if test -n "$grubshell"; then insmod regexp; fi +if test -n "$VasEBootshell"; then insmod regexp; fi echo $"*" diff --git a/tests/VasEBoot_script_if.in b/tests/VasEBoot_script_if.in index fb17eaf70..6db35ffcb 100644 --- a/tests/VasEBoot_script_if.in +++ b/tests/VasEBoot_script_if.in @@ -1,4 +1,4 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester #basic if, execute if true; then echo yes; fi diff --git a/tests/VasEBoot_script_leading_whitespace.in b/tests/VasEBoot_script_leading_whitespace.in index d5946ba40..bfe58fa1b 100644 --- a/tests/VasEBoot_script_leading_whitespace.in +++ b/tests/VasEBoot_script_leading_whitespace.in @@ -1,4 +1,4 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester list=" 1 2 3" echo $list diff --git a/tests/VasEBoot_script_no_commands.in b/tests/VasEBoot_script_no_commands.in index c31d267e5..58309de7c 100644 --- a/tests/VasEBoot_script_no_commands.in +++ b/tests/VasEBoot_script_no_commands.in @@ -1,18 +1,18 @@ #! /bin/sh set -e -# grub-script-check refuses to pass a file with no commands; this usually +# VasEBoot-script-check refuses to pass a file with no commands; this usually # indicates a bug in the code generating that file. -@builddir@/grub-script-check <. +# along with VasEBoot. If not, see . true echo $? @@ -28,7 +28,7 @@ echo $? echo $? # -# Negated forms (copied from grub_script_if.in) +# Negated forms (copied from VasEBoot_script_if.in) # #basic if, execute diff --git a/tests/VasEBoot_script_return.in b/tests/VasEBoot_script_return.in index 712d1dfcf..c93f7c3fa 100644 --- a/tests/VasEBoot_script_return.in +++ b/tests/VasEBoot_script_return.in @@ -1,20 +1,20 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . function f1 { return diff --git a/tests/VasEBoot_script_setparams.in b/tests/VasEBoot_script_setparams.in index 82d316813..cd2c1eae6 100644 --- a/tests/VasEBoot_script_setparams.in +++ b/tests/VasEBoot_script_setparams.in @@ -1,22 +1,22 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . -if test x$grubshell = xyes; then cmd=setparams; else cmd=set; fi +if test x$VasEBootshell = xyes; then cmd=setparams; else cmd=set; fi function f1 { echo $# diff --git a/tests/VasEBoot_script_shift.in b/tests/VasEBoot_script_shift.in index 785b9c396..42a7a7795 100644 --- a/tests/VasEBoot_script_shift.in +++ b/tests/VasEBoot_script_shift.in @@ -1,20 +1,20 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . function f1 { echo f1 '$@' $@ diff --git a/tests/VasEBoot_script_strcmp.in b/tests/VasEBoot_script_strcmp.in index 721549ced..2c9bb916e 100644 --- a/tests/VasEBoot_script_strcmp.in +++ b/tests/VasEBoot_script_strcmp.in @@ -1,19 +1,19 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester # # Copyright (C) 2012 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . LC_ALL=C export LC_ALL diff --git a/tests/VasEBoot_script_test.in b/tests/VasEBoot_script_test.in index 34a5f141d..e007e73ca 100644 --- a/tests/VasEBoot_script_test.in +++ b/tests/VasEBoot_script_test.in @@ -1,4 +1,4 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester for device in 'hd0' 'fd0'; do # But search them if their search has been inforced diff --git a/tests/VasEBoot_script_vars1.in b/tests/VasEBoot_script_vars1.in index 77b3cf298..f679d48c8 100644 --- a/tests/VasEBoot_script_vars1.in +++ b/tests/VasEBoot_script_vars1.in @@ -1,20 +1,20 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . var=foo echo $var diff --git a/tests/VasEBoot_script_while1.in b/tests/VasEBoot_script_while1.in index 554247f76..a782982e4 100644 --- a/tests/VasEBoot_script_while1.in +++ b/tests/VasEBoot_script_while1.in @@ -1,4 +1,4 @@ -#! @builddir@/grub-shell-tester +#! @builddir@/VasEBoot-shell-tester echo one foo="" diff --git a/tests/ahci_test.in b/tests/ahci_test.in index 1d01d1f59..acb760c4d 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -1,25 +1,25 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: Don't mess with real devices when OS is active *-emu) exit 0;; @@ -41,7 +41,7 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then +if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${VasEBootshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1 diff --git a/tests/btrfs_test.in b/tests/btrfs_test.in index c55d9477f..f8faccb49 100644 --- a/tests/btrfs_test.in +++ b/tests/btrfs_test.in @@ -15,10 +15,10 @@ if ! which mkfs.btrfs >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" btrfs -"@builddir@/grub-fs-tester" btrfs_zlib -"@builddir@/grub-fs-tester" btrfs_lzo -"@builddir@/grub-fs-tester" btrfs_raid0 -"@builddir@/grub-fs-tester" btrfs_raid1 -"@builddir@/grub-fs-tester" btrfs_single -"@builddir@/grub-fs-tester" btrfs_raid10 +"@builddir@/VasEBoot-fs-tester" btrfs +"@builddir@/VasEBoot-fs-tester" btrfs_zlib +"@builddir@/VasEBoot-fs-tester" btrfs_lzo +"@builddir@/VasEBoot-fs-tester" btrfs_raid0 +"@builddir@/VasEBoot-fs-tester" btrfs_raid1 +"@builddir@/VasEBoot-fs-tester" btrfs_single +"@builddir@/VasEBoot-fs-tester" btrfs_raid10 diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in index 1cc901977..529751161 100644 --- a/tests/cdboot_test.in +++ b/tests/cdboot_test.in @@ -1,32 +1,32 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: emu is different *-emu) exit 0;; # PLATFORM: Flash targets i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips) exit 0;; - # FIXME: currently grub-shell uses only -kernel for loongson + # FIXME: currently VasEBoot-shell uses only -kernel for loongson mipsel-loongson) exit 0;; # FIXME: OFW fails to open CD-ROM @@ -34,6 +34,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esac -if [ "$(echo hello | "${grubshell}" --boot=cd)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --boot=cd)" != "Hello World" ]; then exit 1 fi diff --git a/tests/cmp_unit_test.c b/tests/cmp_unit_test.c index e5378419c..ea5f2d8c3 100644 --- a/tests/cmp_unit_test.c +++ b/tests/cmp_unit_test.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2012 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include +#include +#include -GRUB_MOD_LICENSE ("GPLv3+"); +VasEBoot_MOD_LICENSE ("GPLv3+"); #define MSG "cmp test failed" @@ -33,194 +33,194 @@ cmp_test (void) const char *s2 = "aa"; const char *s3 = "â"; - grub_test_assert (grub_strlen (s1) == 1, MSG); - grub_test_assert (grub_strlen (s2) == 2, MSG); - grub_test_assert (grub_strlen (s3) == 2, MSG); + VasEBoot_test_assert (VasEBoot_strlen (s1) == 1, MSG); + VasEBoot_test_assert (VasEBoot_strlen (s2) == 2, MSG); + VasEBoot_test_assert (VasEBoot_strlen (s3) == 2, MSG); - grub_test_assert (grub_strcmp (s1, s1) == 0, MSG); - grub_test_assert (grub_strcmp (s1, s2) < 0, MSG); - grub_test_assert (grub_strcmp (s1, s3) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s1, s1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s1, s2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s1, s3) < 0, MSG); - grub_test_assert (grub_strcmp (s2, s1) > 0, MSG); - grub_test_assert (grub_strcmp (s2, s2) == 0, MSG); - grub_test_assert (grub_strcmp (s2, s3) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s2, s1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s2, s2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s2, s3) < 0, MSG); - grub_test_assert (grub_strcmp (s3, s1) > 0, MSG); - grub_test_assert (grub_strcmp (s3, s2) > 0, MSG); - grub_test_assert (grub_strcmp (s3, s3) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s3, s1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s3, s2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strcmp (s3, s3) == 0, MSG); - grub_test_assert (grub_strcasecmp (s1, s1) == 0, MSG); - grub_test_assert (grub_strcasecmp (s1, s2) < 0, MSG); - grub_test_assert (grub_strcasecmp (s1, s3) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s1, s1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s1, s2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s1, s3) < 0, MSG); - grub_test_assert (grub_strcasecmp (s2, s1) > 0, MSG); - grub_test_assert (grub_strcasecmp (s2, s2) == 0, MSG); - grub_test_assert (grub_strcasecmp (s2, s3) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s2, s1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s2, s2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s2, s3) < 0, MSG); - grub_test_assert (grub_strcasecmp (s3, s1) > 0, MSG); - grub_test_assert (grub_strcasecmp (s3, s2) > 0, MSG); - grub_test_assert (grub_strcasecmp (s3, s3) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s3, s1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s3, s2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strcasecmp (s3, s3) == 0, MSG); - grub_test_assert (grub_memcmp (s1, s1, 2) == 0, MSG); - grub_test_assert (grub_memcmp (s1, s2, 2) < 0, MSG); - grub_test_assert (grub_memcmp (s1, s3, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s1, s1, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s1, s2, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s1, s3, 2) < 0, MSG); - grub_test_assert (grub_memcmp (s2, s1, 2) > 0, MSG); - grub_test_assert (grub_memcmp (s2, s2, 2) == 0, MSG); - grub_test_assert (grub_memcmp (s2, s3, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s2, s1, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s2, s2, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s2, s3, 2) < 0, MSG); - grub_test_assert (grub_memcmp (s3, s1, 2) > 0, MSG); - grub_test_assert (grub_memcmp (s3, s2, 2) > 0, MSG); - grub_test_assert (grub_memcmp (s3, s3, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s3, s1, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s3, s2, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s3, s3, 2) == 0, MSG); - grub_test_assert (grub_memcmp (s1, s1, 1) == 0, MSG); - grub_test_assert (grub_memcmp (s1, s2, 1) == 0, MSG); - grub_test_assert (grub_memcmp (s1, s3, 1) < 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s1, s1, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s1, s2, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s1, s3, 1) < 0, MSG); - grub_test_assert (grub_memcmp (s2, s1, 1) == 0, MSG); - grub_test_assert (grub_memcmp (s2, s2, 1) == 0, MSG); - grub_test_assert (grub_memcmp (s2, s3, 1) < 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s2, s1, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s2, s2, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s2, s3, 1) < 0, MSG); - grub_test_assert (grub_memcmp (s3, s1, 1) > 0, MSG); - grub_test_assert (grub_memcmp (s3, s2, 1) > 0, MSG); - grub_test_assert (grub_memcmp (s3, s3, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s3, s1, 1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s3, s2, 1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_memcmp (s3, s3, 1) == 0, MSG); - grub_test_assert (grub_strncmp (s1, s1, 2) == 0, MSG); - grub_test_assert (grub_strncmp (s1, s2, 2) < 0, MSG); - grub_test_assert (grub_strncmp (s1, s3, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s1, s1, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s1, s2, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s1, s3, 2) < 0, MSG); - grub_test_assert (grub_strncmp (s2, s1, 2) > 0, MSG); - grub_test_assert (grub_strncmp (s2, s2, 2) == 0, MSG); - grub_test_assert (grub_strncmp (s2, s3, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s2, s1, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s2, s2, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s2, s3, 2) < 0, MSG); - grub_test_assert (grub_strncmp (s3, s1, 2) > 0, MSG); - grub_test_assert (grub_strncmp (s3, s2, 2) > 0, MSG); - grub_test_assert (grub_strncmp (s3, s3, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s3, s1, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s3, s2, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s3, s3, 2) == 0, MSG); - grub_test_assert (grub_strncmp (s1, s1, 1) == 0, MSG); - grub_test_assert (grub_strncmp (s1, s2, 1) == 0, MSG); - grub_test_assert (grub_strncmp (s1, s3, 1) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s1, s1, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s1, s2, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s1, s3, 1) < 0, MSG); - grub_test_assert (grub_strncmp (s2, s1, 1) == 0, MSG); - grub_test_assert (grub_strncmp (s2, s2, 1) == 0, MSG); - grub_test_assert (grub_strncmp (s2, s3, 1) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s2, s1, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s2, s2, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s2, s3, 1) < 0, MSG); - grub_test_assert (grub_strncmp (s3, s1, 1) > 0, MSG); - grub_test_assert (grub_strncmp (s3, s2, 1) > 0, MSG); - grub_test_assert (grub_strncmp (s3, s3, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s3, s1, 1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s3, s2, 1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncmp (s3, s3, 1) == 0, MSG); - grub_test_assert (grub_strncasecmp (s1, s1, 2) == 0, MSG); - grub_test_assert (grub_strncasecmp (s1, s2, 2) < 0, MSG); - grub_test_assert (grub_strncasecmp (s1, s3, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s1, s1, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s1, s2, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s1, s3, 2) < 0, MSG); - grub_test_assert (grub_strncasecmp (s2, s1, 2) > 0, MSG); - grub_test_assert (grub_strncasecmp (s2, s2, 2) == 0, MSG); - grub_test_assert (grub_strncasecmp (s2, s3, 2) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s2, s1, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s2, s2, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s2, s3, 2) < 0, MSG); - grub_test_assert (grub_strncasecmp (s3, s1, 2) > 0, MSG); - grub_test_assert (grub_strncasecmp (s3, s2, 2) > 0, MSG); - grub_test_assert (grub_strncasecmp (s3, s3, 2) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s3, s1, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s3, s2, 2) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s3, s3, 2) == 0, MSG); - grub_test_assert (grub_strncasecmp (s1, s1, 1) == 0, MSG); - grub_test_assert (grub_strncasecmp (s1, s2, 1) == 0, MSG); - grub_test_assert (grub_strncasecmp (s1, s3, 1) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s1, s1, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s1, s2, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s1, s3, 1) < 0, MSG); - grub_test_assert (grub_strncasecmp (s2, s1, 1) == 0, MSG); - grub_test_assert (grub_strncasecmp (s2, s2, 1) == 0, MSG); - grub_test_assert (grub_strncasecmp (s2, s3, 1) < 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s2, s1, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s2, s2, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s2, s3, 1) < 0, MSG); - grub_test_assert (grub_strncasecmp (s3, s1, 1) > 0, MSG); - grub_test_assert (grub_strncasecmp (s3, s2, 1) > 0, MSG); - grub_test_assert (grub_strncasecmp (s3, s3, 1) == 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s3, s1, 1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s3, s2, 1) > 0, MSG); + VasEBoot_test_assert (VasEBoot_strncasecmp (s3, s3, 1) == 0, MSG); - grub_test_assert (strlen (s1) == 1, MSG); - grub_test_assert (strlen (s2) == 2, MSG); - grub_test_assert (strlen (s3) == 2, MSG); + VasEBoot_test_assert (strlen (s1) == 1, MSG); + VasEBoot_test_assert (strlen (s2) == 2, MSG); + VasEBoot_test_assert (strlen (s3) == 2, MSG); - grub_test_assert (strcmp (s1, s1) == 0, MSG); - grub_test_assert (strcmp (s1, s2) < 0, MSG); - grub_test_assert (strcmp (s1, s3) < 0, MSG); + VasEBoot_test_assert (strcmp (s1, s1) == 0, MSG); + VasEBoot_test_assert (strcmp (s1, s2) < 0, MSG); + VasEBoot_test_assert (strcmp (s1, s3) < 0, MSG); - grub_test_assert (strcmp (s2, s1) > 0, MSG); - grub_test_assert (strcmp (s2, s2) == 0, MSG); - grub_test_assert (strcmp (s2, s3) < 0, MSG); + VasEBoot_test_assert (strcmp (s2, s1) > 0, MSG); + VasEBoot_test_assert (strcmp (s2, s2) == 0, MSG); + VasEBoot_test_assert (strcmp (s2, s3) < 0, MSG); - grub_test_assert (strcmp (s3, s1) > 0, MSG); - grub_test_assert (strcmp (s3, s2) > 0, MSG); - grub_test_assert (strcmp (s3, s3) == 0, MSG); + VasEBoot_test_assert (strcmp (s3, s1) > 0, MSG); + VasEBoot_test_assert (strcmp (s3, s2) > 0, MSG); + VasEBoot_test_assert (strcmp (s3, s3) == 0, MSG); - grub_test_assert (memcmp (s1, s1, 2) == 0, MSG); - grub_test_assert (memcmp (s1, s2, 2) < 0, MSG); - grub_test_assert (memcmp (s1, s3, 2) < 0, MSG); + VasEBoot_test_assert (memcmp (s1, s1, 2) == 0, MSG); + VasEBoot_test_assert (memcmp (s1, s2, 2) < 0, MSG); + VasEBoot_test_assert (memcmp (s1, s3, 2) < 0, MSG); - grub_test_assert (memcmp (s2, s1, 2) > 0, MSG); - grub_test_assert (memcmp (s2, s2, 2) == 0, MSG); - grub_test_assert (memcmp (s2, s3, 2) < 0, MSG); + VasEBoot_test_assert (memcmp (s2, s1, 2) > 0, MSG); + VasEBoot_test_assert (memcmp (s2, s2, 2) == 0, MSG); + VasEBoot_test_assert (memcmp (s2, s3, 2) < 0, MSG); - grub_test_assert (memcmp (s3, s1, 2) > 0, MSG); - grub_test_assert (memcmp (s3, s2, 2) > 0, MSG); - grub_test_assert (memcmp (s3, s3, 2) == 0, MSG); + VasEBoot_test_assert (memcmp (s3, s1, 2) > 0, MSG); + VasEBoot_test_assert (memcmp (s3, s2, 2) > 0, MSG); + VasEBoot_test_assert (memcmp (s3, s3, 2) == 0, MSG); - grub_test_assert (memcmp (s1, s1, 1) == 0, MSG); - grub_test_assert (memcmp (s1, s2, 1) == 0, MSG); - grub_test_assert (memcmp (s1, s3, 1) < 0, MSG); + VasEBoot_test_assert (memcmp (s1, s1, 1) == 0, MSG); + VasEBoot_test_assert (memcmp (s1, s2, 1) == 0, MSG); + VasEBoot_test_assert (memcmp (s1, s3, 1) < 0, MSG); - grub_test_assert (memcmp (s2, s1, 1) == 0, MSG); - grub_test_assert (memcmp (s2, s2, 1) == 0, MSG); - grub_test_assert (memcmp (s2, s3, 1) < 0, MSG); + VasEBoot_test_assert (memcmp (s2, s1, 1) == 0, MSG); + VasEBoot_test_assert (memcmp (s2, s2, 1) == 0, MSG); + VasEBoot_test_assert (memcmp (s2, s3, 1) < 0, MSG); - grub_test_assert (memcmp (s3, s1, 1) > 0, MSG); - grub_test_assert (memcmp (s3, s2, 1) > 0, MSG); - grub_test_assert (memcmp (s3, s3, 1) == 0, MSG); + VasEBoot_test_assert (memcmp (s3, s1, 1) > 0, MSG); + VasEBoot_test_assert (memcmp (s3, s2, 1) > 0, MSG); + VasEBoot_test_assert (memcmp (s3, s3, 1) == 0, MSG); - grub_test_assert (strncmp (s1, s1, 2) == 0, MSG); - grub_test_assert (strncmp (s1, s2, 2) < 0, MSG); - grub_test_assert (strncmp (s1, s3, 2) < 0, MSG); + VasEBoot_test_assert (strncmp (s1, s1, 2) == 0, MSG); + VasEBoot_test_assert (strncmp (s1, s2, 2) < 0, MSG); + VasEBoot_test_assert (strncmp (s1, s3, 2) < 0, MSG); - grub_test_assert (strncmp (s2, s1, 2) > 0, MSG); - grub_test_assert (strncmp (s2, s2, 2) == 0, MSG); - grub_test_assert (strncmp (s2, s3, 2) < 0, MSG); + VasEBoot_test_assert (strncmp (s2, s1, 2) > 0, MSG); + VasEBoot_test_assert (strncmp (s2, s2, 2) == 0, MSG); + VasEBoot_test_assert (strncmp (s2, s3, 2) < 0, MSG); - grub_test_assert (strncmp (s3, s1, 2) > 0, MSG); - grub_test_assert (strncmp (s3, s2, 2) > 0, MSG); - grub_test_assert (strncmp (s3, s3, 2) == 0, MSG); + VasEBoot_test_assert (strncmp (s3, s1, 2) > 0, MSG); + VasEBoot_test_assert (strncmp (s3, s2, 2) > 0, MSG); + VasEBoot_test_assert (strncmp (s3, s3, 2) == 0, MSG); - grub_test_assert (strncmp (s1, s1, 1) == 0, MSG); - grub_test_assert (strncmp (s1, s2, 1) == 0, MSG); - grub_test_assert (strncmp (s1, s3, 1) < 0, MSG); + VasEBoot_test_assert (strncmp (s1, s1, 1) == 0, MSG); + VasEBoot_test_assert (strncmp (s1, s2, 1) == 0, MSG); + VasEBoot_test_assert (strncmp (s1, s3, 1) < 0, MSG); - grub_test_assert (strncmp (s2, s1, 1) == 0, MSG); - grub_test_assert (strncmp (s2, s2, 1) == 0, MSG); - grub_test_assert (strncmp (s2, s3, 1) < 0, MSG); + VasEBoot_test_assert (strncmp (s2, s1, 1) == 0, MSG); + VasEBoot_test_assert (strncmp (s2, s2, 1) == 0, MSG); + VasEBoot_test_assert (strncmp (s2, s3, 1) < 0, MSG); - grub_test_assert (strncmp (s3, s1, 1) > 0, MSG); - grub_test_assert (strncmp (s3, s2, 1) > 0, MSG); - grub_test_assert (strncmp (s3, s3, 1) == 0, MSG); + VasEBoot_test_assert (strncmp (s3, s1, 1) > 0, MSG); + VasEBoot_test_assert (strncmp (s3, s2, 1) > 0, MSG); + VasEBoot_test_assert (strncmp (s3, s3, 1) == 0, MSG); - grub_test_assert (strncasecmp (s1, s1, 2) == 0, MSG); - grub_test_assert (strncasecmp (s1, s2, 2) < 0, MSG); - grub_test_assert (strncasecmp (s1, s3, 2) < 0, MSG); + VasEBoot_test_assert (strncasecmp (s1, s1, 2) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s1, s2, 2) < 0, MSG); + VasEBoot_test_assert (strncasecmp (s1, s3, 2) < 0, MSG); - grub_test_assert (strncasecmp (s2, s1, 2) > 0, MSG); - grub_test_assert (strncasecmp (s2, s2, 2) == 0, MSG); - grub_test_assert (strncasecmp (s2, s3, 2) < 0, MSG); + VasEBoot_test_assert (strncasecmp (s2, s1, 2) > 0, MSG); + VasEBoot_test_assert (strncasecmp (s2, s2, 2) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s2, s3, 2) < 0, MSG); - grub_test_assert (strncasecmp (s3, s1, 2) > 0, MSG); - grub_test_assert (strncasecmp (s3, s2, 2) > 0, MSG); - grub_test_assert (strncasecmp (s3, s3, 2) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s3, s1, 2) > 0, MSG); + VasEBoot_test_assert (strncasecmp (s3, s2, 2) > 0, MSG); + VasEBoot_test_assert (strncasecmp (s3, s3, 2) == 0, MSG); - grub_test_assert (strncasecmp (s1, s1, 1) == 0, MSG); - grub_test_assert (strncasecmp (s1, s2, 1) == 0, MSG); - grub_test_assert (strncasecmp (s1, s3, 1) < 0, MSG); + VasEBoot_test_assert (strncasecmp (s1, s1, 1) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s1, s2, 1) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s1, s3, 1) < 0, MSG); - grub_test_assert (strncasecmp (s2, s1, 1) == 0, MSG); - grub_test_assert (strncasecmp (s2, s2, 1) == 0, MSG); - grub_test_assert (strncasecmp (s2, s3, 1) < 0, MSG); + VasEBoot_test_assert (strncasecmp (s2, s1, 1) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s2, s2, 1) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s2, s3, 1) < 0, MSG); - grub_test_assert (strncasecmp (s3, s1, 1) > 0, MSG); - grub_test_assert (strncasecmp (s3, s2, 1) > 0, MSG); - grub_test_assert (strncasecmp (s3, s3, 1) == 0, MSG); + VasEBoot_test_assert (strncasecmp (s3, s1, 1) > 0, MSG); + VasEBoot_test_assert (strncasecmp (s3, s2, 1) > 0, MSG); + VasEBoot_test_assert (strncasecmp (s3, s3, 1) == 0, MSG); } /* Register example_test method as a functional test. */ -GRUB_UNIT_TEST ("cmp_test", cmp_test); +VasEBoot_UNIT_TEST ("cmp_test", cmp_test); diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in index 1003587cc..7dc4608d3 100644 --- a/tests/core_compress_test.in +++ b/tests/core_compress_test.in @@ -1,25 +1,25 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # FIXME: Only mips currently supports configurable core compression *-emu | i386-* | x86_64-* | sparc64-* | ia64-*) exit 0 @@ -27,10 +27,10 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in esac -if [ "$(echo hello | "${grubshell}" --grub-mkimage-extra=--compress=xz)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --VasEBoot-mkimage-extra=--compress=xz)" != "Hello World" ]; then exit 1 fi -if [ "$(echo hello | "${grubshell}" --grub-mkimage-extra=--compress=none)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --VasEBoot-mkimage-extra=--compress=none)" != "Hello World" ]; then exit 1 fi diff --git a/tests/cpio_test.in b/tests/cpio_test.in index 0b09db549..cc871066f 100644 --- a/tests/cpio_test.in +++ b/tests/cpio_test.in @@ -7,10 +7,10 @@ if ! which cpio >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" cpio_bin -"@builddir@/grub-fs-tester" cpio_odc -"@builddir@/grub-fs-tester" cpio_newc -"@builddir@/grub-fs-tester" cpio_crc -"@builddir@/grub-fs-tester" cpio_ustar -"@builddir@/grub-fs-tester" cpio_hpbin -"@builddir@/grub-fs-tester" cpio_hpodc +"@builddir@/VasEBoot-fs-tester" cpio_bin +"@builddir@/VasEBoot-fs-tester" cpio_odc +"@builddir@/VasEBoot-fs-tester" cpio_newc +"@builddir@/VasEBoot-fs-tester" cpio_crc +"@builddir@/VasEBoot-fs-tester" cpio_ustar +"@builddir@/VasEBoot-fs-tester" cpio_hpbin +"@builddir@/VasEBoot-fs-tester" cpio_hpodc diff --git a/tests/date_unit_test.c b/tests/date_unit_test.c index 99774f199..22cd1458b 100644 --- a/tests/date_unit_test.c +++ b/tests/date_unit_test.c @@ -1,65 +1,65 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include #include -#include -#include -#include +#include +#include +#include static void -date_test (grub_int32_t v) +date_test (VasEBoot_int32_t v) { - struct grub_datetime dt; + struct VasEBoot_datetime dt; time_t t = v; struct tm *g; int w; g = gmtime (&t); - grub_unixtime2datetime (v, &dt); + VasEBoot_unixtime2datetime (v, &dt); - w = grub_get_weekday (&dt); + w = VasEBoot_get_weekday (&dt); - grub_test_assert (g->tm_sec == dt.second, "time %d bad second: %d vs %d", v, + VasEBoot_test_assert (g->tm_sec == dt.second, "time %d bad second: %d vs %d", v, g->tm_sec, dt.second); - grub_test_assert (g->tm_min == dt.minute, "time %d bad minute: %d vs %d", v, + VasEBoot_test_assert (g->tm_min == dt.minute, "time %d bad minute: %d vs %d", v, g->tm_min, dt.minute); - grub_test_assert (g->tm_hour == dt.hour, "time %d bad hour: %d vs %d", v, + VasEBoot_test_assert (g->tm_hour == dt.hour, "time %d bad hour: %d vs %d", v, g->tm_hour, dt.hour); - grub_test_assert (g->tm_mday == dt.day, "time %d bad day: %d vs %d", v, + VasEBoot_test_assert (g->tm_mday == dt.day, "time %d bad day: %d vs %d", v, g->tm_mday, dt.day); - grub_test_assert (g->tm_mon + 1 == dt.month, "time %d bad month: %d vs %d", v, + VasEBoot_test_assert (g->tm_mon + 1 == dt.month, "time %d bad month: %d vs %d", v, g->tm_mon + 1, dt.month); - grub_test_assert (g->tm_year + 1900 == dt.year, + VasEBoot_test_assert (g->tm_year + 1900 == dt.year, "time %d bad year: %d vs %d", v, g->tm_year + 1900, dt.year); - grub_test_assert (g->tm_wday == w, "time %d bad week day: %d vs %d", v, + VasEBoot_test_assert (g->tm_wday == w, "time %d bad week day: %d vs %d", v, g->tm_wday, w); } static void date_test_iter (void) { - grub_int32_t tests[] = { -1, 0, +1, -2133156255, GRUB_INT32_MIN, - GRUB_INT32_MAX }; + VasEBoot_int32_t tests[] = { -1, 0, +1, -2133156255, VasEBoot_INT32_MIN, + VasEBoot_INT32_MAX }; unsigned i; for (i = 0; i < ARRAY_SIZE (tests); i++) @@ -67,10 +67,10 @@ date_test_iter (void) srand (42); for (i = 0; i < 1000000; i++) { - grub_int32_t x = rand (); + VasEBoot_int32_t x = rand (); date_test (x); date_test (-x); } } -GRUB_UNIT_TEST ("date_unit_test", date_test_iter); +VasEBoot_UNIT_TEST ("date_unit_test", date_test_iter); diff --git a/tests/ehci_test.in b/tests/ehci_test.in index 7dd8d3e8f..aef025096 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -1,25 +1,25 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: Don't mess with real devices when OS is active *-emu) exit 0;; @@ -41,7 +41,7 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${grubshell}" --qemu-opts="-device ich9-usb-ehci1 -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then +if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${VasEBootshell}" --qemu-opts="-device ich9-usb-ehci1 -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1 diff --git a/tests/example_VasEBoot_script_test.in b/tests/example_VasEBoot_script_test.in index 93a90a18e..02247b483 100644 --- a/tests/example_VasEBoot_script_test.in +++ b/tests/example_VasEBoot_script_test.in @@ -1,3 +1,3 @@ -#! @builddir@/grub-shell-tester --modules=echo +#! @builddir@/VasEBoot-shell-tester --modules=echo echo "hello world" diff --git a/tests/example_unit_test.c b/tests/example_unit_test.c index 36bfac970..989e45631 100644 --- a/tests/example_unit_test.c +++ b/tests/example_unit_test.c @@ -1,38 +1,38 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Unit tests are normal programs, so they can include C library. */ #include -/* All tests need to include test.h for GRUB testing framework. */ -#include +/* All tests need to include test.h for VasEBoot testing framework. */ +#include /* Unit test main method. */ static void example_test (void) { /* Check if 1st argument is true and report with default error message. */ - grub_test_assert (1 == 1, "1 equal 1 expected"); + VasEBoot_test_assert (1 == 1, "1 equal 1 expected"); /* Check if 1st argument is true and report with custom error message. */ - grub_test_assert (2 == 2, "2 equal 2 expected"); - grub_test_assert (2 != 3, "2 matches %d", 3); + VasEBoot_test_assert (2 == 2, "2 equal 2 expected"); + VasEBoot_test_assert (2 != 3, "2 matches %d", 3); } /* Register example_test method as a unit test. */ -GRUB_UNIT_TEST ("example_unit_test", example_test); +VasEBoot_UNIT_TEST ("example_unit_test", example_test); diff --git a/tests/exfat_test.in b/tests/exfat_test.in index fc1a0fe5e..f5091a69d 100644 --- a/tests/exfat_test.in +++ b/tests/exfat_test.in @@ -15,4 +15,4 @@ if ! which mkfs.exfat >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" exfat +"@builddir@/VasEBoot-fs-tester" exfat diff --git a/tests/ext234_test.in b/tests/ext234_test.in index c986960a8..f8fa2773e 100644 --- a/tests/ext234_test.in +++ b/tests/ext234_test.in @@ -25,8 +25,8 @@ if ! which mkfs.ext4 >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" ext2_old -"@builddir@/grub-fs-tester" ext2 -"@builddir@/grub-fs-tester" ext3 -"@builddir@/grub-fs-tester" ext4 -"@builddir@/grub-fs-tester" ext4_metabg +"@builddir@/VasEBoot-fs-tester" ext2_old +"@builddir@/VasEBoot-fs-tester" ext2 +"@builddir@/VasEBoot-fs-tester" ext3 +"@builddir@/VasEBoot-fs-tester" ext4 +"@builddir@/VasEBoot-fs-tester" ext4_metabg diff --git a/tests/fat_test.in b/tests/fat_test.in index 1d132b517..c9fe789ce 100644 --- a/tests/fat_test.in +++ b/tests/fat_test.in @@ -15,8 +15,8 @@ if ! which mkfs.vfat >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" vfat16a -"@builddir@/grub-fs-tester" vfat12a -"@builddir@/grub-fs-tester" vfat12 -"@builddir@/grub-fs-tester" vfat16 -"@builddir@/grub-fs-tester" vfat32 +"@builddir@/VasEBoot-fs-tester" vfat16a +"@builddir@/VasEBoot-fs-tester" vfat12a +"@builddir@/VasEBoot-fs-tester" vfat12 +"@builddir@/VasEBoot-fs-tester" vfat16 +"@builddir@/VasEBoot-fs-tester" vfat32 diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in index a59645b7f..06479c530 100644 --- a/tests/fddboot_test.in +++ b/tests/fddboot_test.in @@ -1,35 +1,35 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: emu is different *-emu) exit 0;; # PLATFORM: Flash targets i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips) exit 0;; - # FIXME: currently grub-shell uses only -kernel for loongson + # FIXME: currently VasEBoot-shell uses only -kernel for loongson mipsel-loongson) exit 0;; - # FIXME: We don't support EFI floppy boot in grub-mkrescue + # FIXME: We don't support EFI floppy boot in VasEBoot-mkrescue *-efi) exit 0;; # FIXME: no floppy support @@ -46,6 +46,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esac -if [ "$(echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad")" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad")" != "Hello World" ]; then exit 1 fi diff --git a/tests/file_filter/keys b/tests/file_filter/keys index 1afa71382..435261164 100644 Binary files a/tests/file_filter/keys and b/tests/file_filter/keys differ diff --git a/tests/file_filter/keys.pub b/tests/file_filter/keys.pub index 61d4e7a7b..284c1bfa1 100644 Binary files a/tests/file_filter/keys.pub and b/tests/file_filter/keys.pub differ diff --git a/tests/file_filter_test.in b/tests/file_filter_test.in index 8909e4021..2e409a485 100644 --- a/tests/file_filter_test.in +++ b/tests/file_filter_test.in @@ -1,28 +1,28 @@ #! /bin/sh # Copyright (C) 2014 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" filters="gzio xzio lzopio verify" modules="cat mpi" -for mod in $(cut -d ' ' -f 2 "@builddir@/grub-core/crypto.lst" | sort -u); do +for mod in $(cut -d ' ' -f 2 "@builddir@/VasEBoot-core/crypto.lst" | sort -u); do modules="$modules $mod" done @@ -30,14 +30,14 @@ for file in file.gz file.xz file.lzop file.gz.sig file.xz.sig file.lzop.sig keys files="$files /$file=@srcdir@/tests/file_filter/$file" done -# GRUB cat command adds extra newline after file +# VasEBoot cat command adds extra newline after file result="Hello, user! Hello, user! Hello, user!" -out="$("${grubshell}" --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")" +out="$("${VasEBootshell}" --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")" if [ "$out" != "$result" ]; then echo LOCAL FAIL echo "$out" @@ -45,14 +45,14 @@ if [ "$out" != "$result" ]; then fi # Taken from netboot_test -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: emu is different *-emu) exit 0;; # PLATFORM: Flash targets i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips) exit 0;; - # FIXME: currently grub-shell uses only -kernel for loongson + # FIXME: currently VasEBoot-shell uses only -kernel for loongson mipsel-loongson) exit 0;; # FIXME: no rtl8139 support @@ -66,7 +66,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esac -out="$("${grubshell}" --boot=net --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")" +out="$("${VasEBootshell}" --boot=net --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")" if [ "$out" != "$result" ]; then echo NET FAIL echo "$out" diff --git a/tests/gettext_strings_test.in b/tests/gettext_strings_test.in index 5c305e75b..04518dedb 100644 --- a/tests/gettext_strings_test.in +++ b/tests/gettext_strings_test.in @@ -4,14 +4,14 @@ cd '@srcdir@' tdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" -xgettext -f po/POTFILES.in -L C -o "$tdir/"skip.pot -x po/grub.pot --keyword=grub_util_info --keyword=grub_dprintf:1,2 --keyword=grub_register_command --keyword=grub_register_extcmd --keyword=grub_efiemu_resolve_symbol --keyword=grub_efiemu_register_symbol --keyword=grub_dl_load --keyword=grub_crypto_lookup_md_by_name --keyword=grub_crypto_lookup_cipher_by_name --keyword=grub_efiemu_resolve_symbol --keyword=alias --keyword=grub_ieee1275_get_property:2 --keyword=grub_ieee1275_find_device --keyword=grub_ieee1275_get_integer_property:2 --keyword=INIT_IEEE1275_COMMON:2 --keyword=grub_boot_time --keyword=grub_env_get --keyword=grub_env_set --keyword=grub_register_variable_hook --keyword=grub_fatal --keyword=__asm__ --keyword=volatile --keyword=__volatile__ --keyword=grub_error:2 --from-code=iso-8859-1 -xgettext -f po/POTFILES.in -L C -o "$tdir/"skip2.pot -x po/grub.pot --keyword=volatile:2 --keyword=__volatile__:2 --keyword=grub_dprintf:2 --from-code=iso-8859-1 -xgettext -f po/POTFILES.in -L C -o "$tdir/"skip3.pot -x po/grub.pot --keyword=volatile:3 --keyword=__volatile__:3 --from-code=iso-8859-1 +xgettext -f po/POTFILES.in -L C -o "$tdir/"skip.pot -x po/VasEBoot.pot --keyword=VasEBoot_util_info --keyword=VasEBoot_dprintf:1,2 --keyword=VasEBoot_register_command --keyword=VasEBoot_register_extcmd --keyword=VasEBoot_efiemu_resolve_symbol --keyword=VasEBoot_efiemu_register_symbol --keyword=VasEBoot_dl_load --keyword=VasEBoot_crypto_lookup_md_by_name --keyword=VasEBoot_crypto_lookup_cipher_by_name --keyword=VasEBoot_efiemu_resolve_symbol --keyword=alias --keyword=VasEBoot_ieee1275_get_property:2 --keyword=VasEBoot_ieee1275_find_device --keyword=VasEBoot_ieee1275_get_integer_property:2 --keyword=INIT_IEEE1275_COMMON:2 --keyword=VasEBoot_boot_time --keyword=VasEBoot_env_get --keyword=VasEBoot_env_set --keyword=VasEBoot_register_variable_hook --keyword=VasEBoot_fatal --keyword=__asm__ --keyword=volatile --keyword=__volatile__ --keyword=VasEBoot_error:2 --from-code=iso-8859-1 +xgettext -f po/POTFILES.in -L C -o "$tdir/"skip2.pot -x po/VasEBoot.pot --keyword=volatile:2 --keyword=__volatile__:2 --keyword=VasEBoot_dprintf:2 --from-code=iso-8859-1 +xgettext -f po/POTFILES.in -L C -o "$tdir/"skip3.pot -x po/VasEBoot.pot --keyword=volatile:3 --keyword=__volatile__:3 --from-code=iso-8859-1 cat po/POTFILES.in | xargs grep -hE -o "( | ){\"[a-z0-9\-]*\",[[:space:]]*('.'|[0-9]|-[0-9])," |sed "s,[[:space:]]*{\",,g;s,\"\,[[:space:]]*\('.'\|[0-9]\|-[0-9]\)\,,,g" | awk '{ print "msgid \"" $0 "\"\nmsgstr \"\"" ; }' > "$tdir/"opts.pot cat po/POTFILES.in | xargs grep -hE -o "[[:space:]]*\.name[[:space:]]*=[[:space:]]*\"[a-zA-Z0-9 ()]*\"" |sed "s,[[:space:]]*\.name[[:space:]]*=[[:space:]]*\",,g;s,\",,g" | awk '{ print "msgid \"" $0 "\"\nmsgstr \"\"" ; }' > "$tdir/"name.pot -out="$(cat po/POTFILES.in | grep -v '\(colors.c\|lsefisystab.c\|lsefimmap.c\|lssal.c\|hdparm.c\|sendkey.c\|lsacpi.c\|lspci.c\|usbtest.c\|legacy_parse.c\|/libgcrypt/\|hfs.c\|/efi\.c$\|gnulib\|tests/\|util/ieee1275/ofpath.c\|minilzo.c\|terminfo.c\|setpci.c\|bin2h.c\|cb_timestamps.c\|grub-pe2elf.c\|getroot_[a-z]*.c\|getroot.c\|arc/init.c\|color.c\|grub-mklayout.c\|gentrigtables.c\|lzodefs.h\|lsefi.c\|cbls.c\|/zfs\.h$\|grub-macho2img.c\|syslinux_parse.c\|lvm.c\|efidisk.c\|grub-mkfont.c\|reiserfs.c\|LzmaEnc.c\)' | xgettext -f - -L C -o - -x po/grub.pot -x "$tdir/"skip.pot -x "$tdir/"skip2.pot -x "$tdir/"skip3.pot -x "$tdir/"opts.pot -x "$tdir/"name.pot -x po/exclude.pot -a --from-code=iso-8859-1)" +out="$(cat po/POTFILES.in | grep -v '\(colors.c\|lsefisystab.c\|lsefimmap.c\|lssal.c\|hdparm.c\|sendkey.c\|lsacpi.c\|lspci.c\|usbtest.c\|legacy_parse.c\|/libgcrypt/\|hfs.c\|/efi\.c$\|gnulib\|tests/\|util/ieee1275/ofpath.c\|minilzo.c\|terminfo.c\|setpci.c\|bin2h.c\|cb_timestamps.c\|VasEBoot-pe2elf.c\|getroot_[a-z]*.c\|getroot.c\|arc/init.c\|color.c\|VasEBoot-mklayout.c\|gentrigtables.c\|lzodefs.h\|lsefi.c\|cbls.c\|/zfs\.h$\|VasEBoot-macho2img.c\|syslinux_parse.c\|lvm.c\|efidisk.c\|VasEBoot-mkfont.c\|reiserfs.c\|LzmaEnc.c\)' | xgettext -f - -L C -o - -x po/VasEBoot.pot -x "$tdir/"skip.pot -x "$tdir/"skip2.pot -x "$tdir/"skip3.pot -x "$tdir/"opts.pot -x "$tdir/"name.pot -x po/exclude.pot -a --from-code=iso-8859-1)" rm -rf "$tdir" if [ x"$out" != x ]; then echo "$out" diff --git a/tests/gpt_unit_test.c b/tests/gpt_unit_test.c index 218b18697..9744b76dc 100644 --- a/tests/gpt_unit_test.c +++ b/tests/gpt_unit_test.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2014 CoreOS, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -45,23 +45,23 @@ * than or equal to the logical block size." * The partition entry size must be "a value of 128*(2^n) where n is an * integer greater than or equal to zero (e.g., 128, 256, 512, etc.)." */ -verify (sizeof (struct grub_gpt_header) == 92); -verify (sizeof (struct grub_gpt_partentry) == 128); +verify (sizeof (struct VasEBoot_gpt_header) == 92); +verify (sizeof (struct VasEBoot_gpt_partentry) == 128); /* GPT section sizes. */ -#define HEADER_SIZE (sizeof (struct grub_gpt_header)) -#define HEADER_PAD (GRUB_DISK_SECTOR_SIZE - HEADER_SIZE) -#define ENTRY_SIZE (sizeof (struct grub_gpt_partentry)) +#define HEADER_SIZE (sizeof (struct VasEBoot_gpt_header)) +#define HEADER_PAD (VasEBoot_DISK_SECTOR_SIZE - HEADER_SIZE) +#define ENTRY_SIZE (sizeof (struct VasEBoot_gpt_partentry)) #define TABLE_ENTRIES 0x80 #define TABLE_SIZE (TABLE_ENTRIES * ENTRY_SIZE) -#define TABLE_SECTORS (TABLE_SIZE / GRUB_DISK_SECTOR_SIZE) +#define TABLE_SECTORS (TABLE_SIZE / VasEBoot_DISK_SECTOR_SIZE) /* Double check that the table size calculation was valid. */ -verify (TABLE_SECTORS * GRUB_DISK_SECTOR_SIZE == TABLE_SIZE); +verify (TABLE_SECTORS * VasEBoot_DISK_SECTOR_SIZE == TABLE_SIZE); /* GPT section locations for a 1MiB disk. */ #define DISK_SECTORS 0x800 -#define DISK_SIZE (GRUB_DISK_SECTOR_SIZE * DISK_SECTORS) +#define DISK_SIZE (VasEBoot_DISK_SECTOR_SIZE * DISK_SECTORS) #define PRIMARY_HEADER_SECTOR 0x1 #define PRIMARY_TABLE_SECTOR 0x2 #define BACKUP_HEADER_SECTOR (DISK_SECTORS - 0x1) @@ -70,22 +70,22 @@ verify (TABLE_SECTORS * GRUB_DISK_SECTOR_SIZE == TABLE_SIZE); #define DATA_START_SECTOR (PRIMARY_TABLE_SECTOR + TABLE_SECTORS) #define DATA_END_SECTOR (BACKUP_TABLE_SECTOR - 0x1) #define DATA_SECTORS (BACKUP_TABLE_SECTOR - DATA_START_SECTOR) -#define DATA_SIZE (GRUB_DISK_SECTOR_SIZE * DATA_SECTORS) +#define DATA_SIZE (VasEBoot_DISK_SECTOR_SIZE * DATA_SECTORS) struct test_disk { - struct grub_msdos_partition_mbr mbr; + struct VasEBoot_msdos_partition_mbr mbr; - struct grub_gpt_header primary_header; - grub_uint8_t primary_header_pad[HEADER_PAD]; - struct grub_gpt_partentry primary_entries[TABLE_ENTRIES]; + struct VasEBoot_gpt_header primary_header; + VasEBoot_uint8_t primary_header_pad[HEADER_PAD]; + struct VasEBoot_gpt_partentry primary_entries[TABLE_ENTRIES]; - grub_uint8_t data[DATA_SIZE]; + VasEBoot_uint8_t data[DATA_SIZE]; - struct grub_gpt_partentry backup_entries[TABLE_ENTRIES]; - struct grub_gpt_header backup_header; - grub_uint8_t backup_header_pad[HEADER_PAD]; -} GRUB_PACKED; + struct VasEBoot_gpt_partentry backup_entries[TABLE_ENTRIES]; + struct VasEBoot_gpt_header backup_header; + VasEBoot_uint8_t backup_header_pad[HEADER_PAD]; +} VasEBoot_PACKED; /* Sanity check that all the above ugly math was correct. */ verify (sizeof (struct test_disk) == DISK_SIZE); @@ -93,95 +93,95 @@ verify (sizeof (struct test_disk) == DISK_SIZE); struct test_data { int fd; - grub_device_t dev; + VasEBoot_device_t dev; struct test_disk *raw; }; /* Sample primary GPT header for a 1MB disk. */ -static const struct grub_gpt_header example_primary = { - .magic = GRUB_GPT_HEADER_MAGIC, - .version = GRUB_GPT_HEADER_VERSION, - .headersize = sizeof (struct grub_gpt_header), - .crc32 = grub_cpu_to_le32_compile_time (0xb985abe0), - .header_lba = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR), - .alternate_lba = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR), - .start = grub_cpu_to_le64_compile_time (DATA_START_SECTOR), - .end = grub_cpu_to_le64_compile_time (DATA_END_SECTOR), - .guid = GRUB_GPT_GUID_INIT(0x69c131ad, 0x67d6, 0x46c6, +static const struct VasEBoot_gpt_header example_primary = { + .magic = VasEBoot_GPT_HEADER_MAGIC, + .version = VasEBoot_GPT_HEADER_VERSION, + .headersize = sizeof (struct VasEBoot_gpt_header), + .crc32 = VasEBoot_cpu_to_le32_compile_time (0xb985abe0), + .header_lba = VasEBoot_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR), + .alternate_lba = VasEBoot_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR), + .start = VasEBoot_cpu_to_le64_compile_time (DATA_START_SECTOR), + .end = VasEBoot_cpu_to_le64_compile_time (DATA_END_SECTOR), + .guid = VasEBoot_GPT_GUID_INIT(0x69c131ad, 0x67d6, 0x46c6, 0x93, 0xc4, 0x12, 0x4c, 0x75, 0x52, 0x56, 0xac), - .partitions = grub_cpu_to_le64_compile_time (PRIMARY_TABLE_SECTOR), - .maxpart = grub_cpu_to_le32_compile_time (TABLE_ENTRIES), - .partentry_size = grub_cpu_to_le32_compile_time (ENTRY_SIZE), - .partentry_crc32 = grub_cpu_to_le32_compile_time (0x074e052c), + .partitions = VasEBoot_cpu_to_le64_compile_time (PRIMARY_TABLE_SECTOR), + .maxpart = VasEBoot_cpu_to_le32_compile_time (TABLE_ENTRIES), + .partentry_size = VasEBoot_cpu_to_le32_compile_time (ENTRY_SIZE), + .partentry_crc32 = VasEBoot_cpu_to_le32_compile_time (0x074e052c), }; -static const struct grub_gpt_partentry example_entries[TABLE_ENTRIES] = { +static const struct VasEBoot_gpt_partentry example_entries[TABLE_ENTRIES] = { { - .type = GRUB_GPT_PARTITION_TYPE_EFI_SYSTEM, - .guid = GRUB_GPT_GUID_INIT (0xa0f1792e, 0xb4ce, 0x4136, 0xbc, 0xf2, + .type = VasEBoot_GPT_PARTITION_TYPE_EFI_SYSTEM, + .guid = VasEBoot_GPT_GUID_INIT (0xa0f1792e, 0xb4ce, 0x4136, 0xbc, 0xf2, 0x1a, 0xfc, 0x13, 0x3c, 0x28, 0x28), - .start = grub_cpu_to_le64_compile_time (DATA_START_SECTOR), - .end = grub_cpu_to_le64_compile_time (0x3f), + .start = VasEBoot_cpu_to_le64_compile_time (DATA_START_SECTOR), + .end = VasEBoot_cpu_to_le64_compile_time (0x3f), .attrib = 0x0, .name = { - grub_cpu_to_le16_compile_time ('E'), - grub_cpu_to_le16_compile_time ('F'), - grub_cpu_to_le16_compile_time ('I'), - grub_cpu_to_le16_compile_time (' '), - grub_cpu_to_le16_compile_time ('S'), - grub_cpu_to_le16_compile_time ('Y'), - grub_cpu_to_le16_compile_time ('S'), - grub_cpu_to_le16_compile_time ('T'), - grub_cpu_to_le16_compile_time ('E'), - grub_cpu_to_le16_compile_time ('M'), + VasEBoot_cpu_to_le16_compile_time ('E'), + VasEBoot_cpu_to_le16_compile_time ('F'), + VasEBoot_cpu_to_le16_compile_time ('I'), + VasEBoot_cpu_to_le16_compile_time (' '), + VasEBoot_cpu_to_le16_compile_time ('S'), + VasEBoot_cpu_to_le16_compile_time ('Y'), + VasEBoot_cpu_to_le16_compile_time ('S'), + VasEBoot_cpu_to_le16_compile_time ('T'), + VasEBoot_cpu_to_le16_compile_time ('E'), + VasEBoot_cpu_to_le16_compile_time ('M'), 0x0, } }, { - .type = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT, - .guid = GRUB_GPT_GUID_INIT (0x876c898d, 0x1b40, 0x4727, 0xa1, 0x61, + .type = VasEBoot_GPT_PARTITION_TYPE_BIOS_BOOT, + .guid = VasEBoot_GPT_GUID_INIT (0x876c898d, 0x1b40, 0x4727, 0xa1, 0x61, 0xed, 0xf9, 0xb5, 0x48, 0x66, 0x74), - .start = grub_cpu_to_le64_compile_time (0x40), - .end = grub_cpu_to_le64_compile_time (0x7f), - .attrib = grub_cpu_to_le64_compile_time ( - 1ULL << GRUB_GPT_PART_ATTR_OFFSET_LEGACY_BIOS_BOOTABLE), + .start = VasEBoot_cpu_to_le64_compile_time (0x40), + .end = VasEBoot_cpu_to_le64_compile_time (0x7f), + .attrib = VasEBoot_cpu_to_le64_compile_time ( + 1ULL << VasEBoot_GPT_PART_ATTR_OFFSET_LEGACY_BIOS_BOOTABLE), .name = { - grub_cpu_to_le16_compile_time ('B'), - grub_cpu_to_le16_compile_time ('I'), - grub_cpu_to_le16_compile_time ('O'), - grub_cpu_to_le16_compile_time ('S'), - grub_cpu_to_le16_compile_time (' '), - grub_cpu_to_le16_compile_time ('B'), - grub_cpu_to_le16_compile_time ('O'), - grub_cpu_to_le16_compile_time ('O'), - grub_cpu_to_le16_compile_time ('T'), + VasEBoot_cpu_to_le16_compile_time ('B'), + VasEBoot_cpu_to_le16_compile_time ('I'), + VasEBoot_cpu_to_le16_compile_time ('O'), + VasEBoot_cpu_to_le16_compile_time ('S'), + VasEBoot_cpu_to_le16_compile_time (' '), + VasEBoot_cpu_to_le16_compile_time ('B'), + VasEBoot_cpu_to_le16_compile_time ('O'), + VasEBoot_cpu_to_le16_compile_time ('O'), + VasEBoot_cpu_to_le16_compile_time ('T'), 0x0, } }, }; /* And the backup header. */ -static const struct grub_gpt_header example_backup = { - .magic = GRUB_GPT_HEADER_MAGIC, - .version = GRUB_GPT_HEADER_VERSION, - .headersize = sizeof (struct grub_gpt_header), - .crc32 = grub_cpu_to_le32_compile_time (0x0af785eb), - .header_lba = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR), - .alternate_lba = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR), - .start = grub_cpu_to_le64_compile_time (DATA_START_SECTOR), - .end = grub_cpu_to_le64_compile_time (DATA_END_SECTOR), - .guid = GRUB_GPT_GUID_INIT(0x69c131ad, 0x67d6, 0x46c6, +static const struct VasEBoot_gpt_header example_backup = { + .magic = VasEBoot_GPT_HEADER_MAGIC, + .version = VasEBoot_GPT_HEADER_VERSION, + .headersize = sizeof (struct VasEBoot_gpt_header), + .crc32 = VasEBoot_cpu_to_le32_compile_time (0x0af785eb), + .header_lba = VasEBoot_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR), + .alternate_lba = VasEBoot_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR), + .start = VasEBoot_cpu_to_le64_compile_time (DATA_START_SECTOR), + .end = VasEBoot_cpu_to_le64_compile_time (DATA_END_SECTOR), + .guid = VasEBoot_GPT_GUID_INIT(0x69c131ad, 0x67d6, 0x46c6, 0x93, 0xc4, 0x12, 0x4c, 0x75, 0x52, 0x56, 0xac), - .partitions = grub_cpu_to_le64_compile_time (BACKUP_TABLE_SECTOR), - .maxpart = grub_cpu_to_le32_compile_time (TABLE_ENTRIES), - .partentry_size = grub_cpu_to_le32_compile_time (ENTRY_SIZE), - .partentry_crc32 = grub_cpu_to_le32_compile_time (0x074e052c), + .partitions = VasEBoot_cpu_to_le64_compile_time (BACKUP_TABLE_SECTOR), + .maxpart = VasEBoot_cpu_to_le32_compile_time (TABLE_ENTRIES), + .partentry_size = VasEBoot_cpu_to_le32_compile_time (ENTRY_SIZE), + .partentry_crc32 = VasEBoot_cpu_to_le32_compile_time (0x074e052c), }; /* Sample protective MBR for the same 1MB disk. Note, this matches * parted and fdisk behavior. The UEFI spec uses different values. */ -static const struct grub_msdos_partition_mbr example_pmbr = { +static const struct VasEBoot_msdos_partition_mbr example_pmbr = { .entries = {{.flag = 0x00, .start_head = 0x00, .start_sector = 0x01, @@ -190,34 +190,34 @@ static const struct grub_msdos_partition_mbr example_pmbr = { .end_head = 0xfe, .end_sector = 0xff, .end_cylinder = 0xff, - .start = grub_cpu_to_le32_compile_time (0x1), - .length = grub_cpu_to_le32_compile_time (DISK_SECTORS - 0x1), + .start = VasEBoot_cpu_to_le32_compile_time (0x1), + .length = VasEBoot_cpu_to_le32_compile_time (DISK_SECTORS - 0x1), }}, - .signature = grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE), + .signature = VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE), }; -/* If errors are left in grub's error stack things can get confused. */ +/* If errors are left in VasEBoot's error stack things can get confused. */ static void assert_error_stack_empty (void) { do { - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "error on stack: %s", grub_errmsg); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "error on stack: %s", VasEBoot_errmsg); } - while (grub_error_pop ()); + while (VasEBoot_error_pop ()); } -static grub_err_t +static VasEBoot_err_t execute_command2 (const char *name, const char *arg1, const char *arg2) { - grub_command_t cmd; - grub_err_t err; + VasEBoot_command_t cmd; + VasEBoot_err_t err; char *argv[2]; - cmd = grub_command_find (name); + cmd = VasEBoot_command_find (name); if (!cmd) - grub_fatal ("can't find command %s", name); + VasEBoot_fatal ("can't find command %s", name); argv[0] = strdup (arg1); argv[1] = strdup (arg2); @@ -232,9 +232,9 @@ static void sync_disk (struct test_data *data) { if (msync (data->raw, DISK_SIZE, MS_SYNC | MS_INVALIDATE) < 0) - grub_fatal ("Syncing disk failed: %s", strerror (errno)); + VasEBoot_fatal ("Syncing disk failed: %s", strerror (errno)); - grub_disk_cache_invalidate_all (); + VasEBoot_disk_cache_invalidate_all (); } static void @@ -260,18 +260,18 @@ static void open_disk (struct test_data *data) { const char *loop = "loop0"; - char template[] = "/tmp/grub_gpt_test.XXXXXX"; + char template[] = "/tmp/VasEBoot_gpt_test.XXXXXX"; char host[sizeof ("(host)") + sizeof (template)]; data->fd = mkstemp (template); if (data->fd < 0) - grub_fatal ("Creating %s failed: %s", template, strerror (errno)); + VasEBoot_fatal ("Creating %s failed: %s", template, strerror (errno)); if (ftruncate (data->fd, DISK_SIZE) < 0) { int err = errno; unlink (template); - grub_fatal ("Resizing %s failed: %s", template, strerror (err)); + VasEBoot_fatal ("Resizing %s failed: %s", template, strerror (err)); } data->raw = mmap (NULL, DISK_SIZE, PROT_READ | PROT_WRITE, @@ -280,24 +280,24 @@ open_disk (struct test_data *data) { int err = errno; unlink (template); - grub_fatal ("Maping %s failed: %s", template, strerror (err)); + VasEBoot_fatal ("Maping %s failed: %s", template, strerror (err)); } snprintf (host, sizeof (host), "(host)%s", template); - if (execute_command2 ("loopback", loop, host) != GRUB_ERR_NONE) + if (execute_command2 ("loopback", loop, host) != VasEBoot_ERR_NONE) { unlink (template); - grub_fatal ("loopback %s %s failed: %s", loop, host, grub_errmsg); + VasEBoot_fatal ("loopback %s %s failed: %s", loop, host, VasEBoot_errmsg); } if (unlink (template) < 0) - grub_fatal ("Unlinking %s failed: %s", template, strerror (errno)); + VasEBoot_fatal ("Unlinking %s failed: %s", template, strerror (errno)); reset_disk (data); - data->dev = grub_device_open (loop); + data->dev = VasEBoot_device_open (loop); if (!data->dev) - grub_fatal ("Opening %s failed: %s", loop, grub_errmsg); + VasEBoot_fatal ("Opening %s failed: %s", loop, VasEBoot_errmsg); } static void @@ -308,27 +308,27 @@ close_disk (struct test_data *data) assert_error_stack_empty (); if (munmap (data->raw, DISK_SIZE) || close (data->fd)) - grub_fatal ("Closing disk image failed: %s", strerror (errno)); + VasEBoot_fatal ("Closing disk image failed: %s", strerror (errno)); loop = strdup (data->dev->disk->name); - grub_test_assert (grub_device_close (data->dev) == GRUB_ERR_NONE, - "Closing disk device failed: %s", grub_errmsg); + VasEBoot_test_assert (VasEBoot_device_close (data->dev) == VasEBoot_ERR_NONE, + "Closing disk device failed: %s", VasEBoot_errmsg); - grub_test_assert (execute_command2 ("loopback", "-d", loop) == - GRUB_ERR_NONE, "loopback -d %s failed: %s", loop, - grub_errmsg); + VasEBoot_test_assert (execute_command2 ("loopback", "-d", loop) == + VasEBoot_ERR_NONE, "loopback -d %s failed: %s", loop, + VasEBoot_errmsg); free (loop); } -static grub_gpt_t +static VasEBoot_gpt_t read_disk (struct test_data *data) { - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; - gpt = grub_gpt_read (data->dev->disk); + gpt = VasEBoot_gpt_read (data->dev->disk); if (gpt == NULL) - grub_fatal ("grub_gpt_read failed: %s", grub_errmsg); + VasEBoot_fatal ("VasEBoot_gpt_read failed: %s", VasEBoot_errmsg); return gpt; } @@ -336,78 +336,78 @@ read_disk (struct test_data *data) static void pmbr_test (void) { - struct grub_msdos_partition_mbr mbr; + struct VasEBoot_msdos_partition_mbr mbr; memset (&mbr, 0, sizeof (mbr)); /* Empty is invalid. */ - grub_gpt_pmbr_check (&mbr); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_pmbr_check (&mbr); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; /* A table without a protective partition is invalid. */ - mbr.signature = grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE); - grub_gpt_pmbr_check (&mbr); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + mbr.signature = VasEBoot_cpu_to_le16_compile_time (VasEBoot_PC_PARTITION_SIGNATURE); + VasEBoot_gpt_pmbr_check (&mbr); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; /* A table with a protective type is ok. */ memcpy (&mbr, &example_pmbr, sizeof (mbr)); - grub_gpt_pmbr_check (&mbr); - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_pmbr_check (&mbr); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; } static void header_test (void) { - struct grub_gpt_header primary, backup; + struct VasEBoot_gpt_header primary, backup; /* Example headers should be valid. */ memcpy (&primary, &example_primary, sizeof (primary)); - grub_gpt_header_check (&primary, GRUB_DISK_SECTOR_BITS); - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_header_check (&primary, VasEBoot_DISK_SECTOR_BITS); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; memcpy (&backup, &example_backup, sizeof (backup)); - grub_gpt_header_check (&backup, GRUB_DISK_SECTOR_BITS); - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_header_check (&backup, VasEBoot_DISK_SECTOR_BITS); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; /* Twiddle the GUID to invalidate the CRC. */ primary.guid.data1 = 0; - grub_gpt_header_check (&primary, GRUB_DISK_SECTOR_BITS); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_header_check (&primary, VasEBoot_DISK_SECTOR_BITS); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; backup.guid.data1 = 0; - grub_gpt_header_check (&backup, GRUB_DISK_SECTOR_BITS); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_header_check (&backup, VasEBoot_DISK_SECTOR_BITS); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; } static void read_valid_test (void) { struct test_data data; - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; open_disk (&data); gpt = read_disk (&data); - grub_test_assert (gpt->status == (GRUB_GPT_PROTECTIVE_MBR | - GRUB_GPT_PRIMARY_HEADER_VALID | - GRUB_GPT_PRIMARY_ENTRIES_VALID | - GRUB_GPT_BACKUP_HEADER_VALID | - GRUB_GPT_BACKUP_ENTRIES_VALID), + VasEBoot_test_assert (gpt->status == (VasEBoot_GPT_PROTECTIVE_MBR | + VasEBoot_GPT_PRIMARY_HEADER_VALID | + VasEBoot_GPT_PRIMARY_ENTRIES_VALID | + VasEBoot_GPT_BACKUP_HEADER_VALID | + VasEBoot_GPT_BACKUP_ENTRIES_VALID), "unexpected status: 0x%02x", gpt->status); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); close_disk (&data); } @@ -415,7 +415,7 @@ static void read_invalid_entries_test (void) { struct test_data data; - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; open_disk (&data); @@ -426,11 +426,11 @@ read_invalid_entries_test (void) sizeof (data.raw->backup_entries[0])); sync_disk (&data); - gpt = grub_gpt_read (data.dev->disk); - grub_test_assert (gpt == NULL, "no error reported for corrupt entries"); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + gpt = VasEBoot_gpt_read (data.dev->disk); + VasEBoot_test_assert (gpt == NULL, "no error reported for corrupt entries"); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; close_disk (&data); } @@ -439,7 +439,7 @@ static void read_fallback_test (void) { struct test_data data; - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; open_disk (&data); @@ -448,9 +448,9 @@ read_fallback_test (void) sizeof (data.raw->primary_header.guid)); sync_disk (&data); gpt = read_disk (&data); - grub_test_assert ((gpt->status & GRUB_GPT_PRIMARY_HEADER_VALID) == 0, + VasEBoot_test_assert ((gpt->status & VasEBoot_GPT_PRIMARY_HEADER_VALID) == 0, "unreported corrupt primary header"); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); reset_disk (&data); /* Corrupt the backup header. */ @@ -458,9 +458,9 @@ read_fallback_test (void) sizeof (data.raw->backup_header.guid)); sync_disk (&data); gpt = read_disk (&data); - grub_test_assert ((gpt->status & GRUB_GPT_BACKUP_HEADER_VALID) == 0, + VasEBoot_test_assert ((gpt->status & VasEBoot_GPT_BACKUP_HEADER_VALID) == 0, "unreported corrupt backup header"); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); reset_disk (&data); /* Corrupt the primary entry table. */ @@ -468,9 +468,9 @@ read_fallback_test (void) sizeof (data.raw->primary_entries[0])); sync_disk (&data); gpt = read_disk (&data); - grub_test_assert ((gpt->status & GRUB_GPT_PRIMARY_ENTRIES_VALID) == 0, + VasEBoot_test_assert ((gpt->status & VasEBoot_GPT_PRIMARY_ENTRIES_VALID) == 0, "unreported corrupt primary entries table"); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); reset_disk (&data); /* Corrupt the backup entry table. */ @@ -478,21 +478,21 @@ read_fallback_test (void) sizeof (data.raw->backup_entries[0])); sync_disk (&data); gpt = read_disk (&data); - grub_test_assert ((gpt->status & GRUB_GPT_BACKUP_ENTRIES_VALID) == 0, + VasEBoot_test_assert ((gpt->status & VasEBoot_GPT_BACKUP_ENTRIES_VALID) == 0, "unreported corrupt backup entries table"); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); reset_disk (&data); /* If primary is corrupt and disk size is unknown fallback fails. */ memset (&data.raw->primary_header.guid, 0x55, sizeof (data.raw->primary_header.guid)); sync_disk (&data); - data.dev->disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN; - gpt = grub_gpt_read (data.dev->disk); - grub_test_assert (gpt == NULL, "no error reported"); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + data.dev->disk->total_sectors = VasEBoot_DISK_SIZE_UNKNOWN; + gpt = VasEBoot_gpt_read (data.dev->disk); + VasEBoot_test_assert (gpt == NULL, "no error reported"); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; close_disk (&data); } @@ -501,7 +501,7 @@ static void repair_test (void) { struct test_data data; - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; open_disk (&data); @@ -509,36 +509,36 @@ repair_test (void) memset (&data.raw->primary_header, 0, sizeof (data.raw->primary_header)); sync_disk (&data); gpt = read_disk (&data); - grub_gpt_repair (data.dev->disk, gpt); - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "repair failed: %s", grub_errmsg); + VasEBoot_gpt_repair (data.dev->disk, gpt); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "repair failed: %s", VasEBoot_errmsg); if (memcmp (&gpt->primary, &example_primary, sizeof (gpt->primary))) { printf ("Invalid restored primary header:\n"); hexdump (16, (char*)&gpt->primary, sizeof (gpt->primary)); printf ("Expected primary header:\n"); hexdump (16, (char*)&example_primary, sizeof (example_primary)); - grub_test_assert (0, "repair did not restore primary header"); + VasEBoot_test_assert (0, "repair did not restore primary header"); } - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); reset_disk (&data); /* Erase/Repair backup. */ memset (&data.raw->backup_header, 0, sizeof (data.raw->backup_header)); sync_disk (&data); gpt = read_disk (&data); - grub_gpt_repair (data.dev->disk, gpt); - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "repair failed: %s", grub_errmsg); + VasEBoot_gpt_repair (data.dev->disk, gpt); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "repair failed: %s", VasEBoot_errmsg); if (memcmp (&gpt->backup, &example_backup, sizeof (gpt->backup))) { printf ("Invalid restored backup header:\n"); hexdump (16, (char*)&gpt->backup, sizeof (gpt->backup)); printf ("Expected backup header:\n"); hexdump (16, (char*)&example_backup, sizeof (example_backup)); - grub_test_assert (0, "repair did not restore backup header"); + VasEBoot_test_assert (0, "repair did not restore backup header"); } - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); reset_disk (&data); close_disk (&data); @@ -551,14 +551,14 @@ static void weird_disk_size_test (void) { struct test_data data; - grub_gpt_t gpt; + VasEBoot_gpt_t gpt; open_disk (&data); /* Chop off 65536 bytes (128 512B sectors) which may happen when the * BIOS thinks you are using a software RAID system that reserves that * area for metadata when in fact you are not and using the bare disk. */ - grub_test_assert(data.dev->disk->total_sectors == DISK_SECTORS, + VasEBoot_test_assert(data.dev->disk->total_sectors == DISK_SECTORS, "unexpected disk size: 0x%llx", (unsigned long long) data.dev->disk->total_sectors); data.dev->disk->total_sectors -= 128; @@ -567,20 +567,20 @@ weird_disk_size_test (void) assert_error_stack_empty (); /* Reading the alternate_lba should have been blocked and reading * the (new) end of disk should have found no useful data. */ - grub_test_assert ((gpt->status & GRUB_GPT_BACKUP_HEADER_VALID) == 0, + VasEBoot_test_assert ((gpt->status & VasEBoot_GPT_BACKUP_HEADER_VALID) == 0, "unreported missing backup header"); /* We should be able to reconstruct the backup header and the location * of the backup should remain unchanged, trusting the GPT data over * what the BIOS is telling us. Further changes are left to the OS. */ - grub_gpt_repair (data.dev->disk, gpt); - grub_test_assert (grub_errno == GRUB_ERR_NONE, - "repair failed: %s", grub_errmsg); - grub_test_assert (memcmp (&gpt->primary, &example_primary, + VasEBoot_gpt_repair (data.dev->disk, gpt); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_NONE, + "repair failed: %s", VasEBoot_errmsg); + VasEBoot_test_assert (memcmp (&gpt->primary, &example_primary, sizeof (gpt->primary)) == 0, "repair corrupted primary header"); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); close_disk (&data); } @@ -588,20 +588,20 @@ static void iterate_partitions_test (void) { struct test_data data; - struct grub_gpt_partentry *p; - grub_gpt_t gpt; - grub_uint32_t n; + struct VasEBoot_gpt_partentry *p; + VasEBoot_gpt_t gpt; + VasEBoot_uint32_t n; open_disk (&data); gpt = read_disk (&data); - for (n = 0; (p = grub_gpt_get_partentry (gpt, n)) != NULL; n++) - grub_test_assert (memcmp (p, &example_entries[n], sizeof (*p)) == 0, + for (n = 0; (p = VasEBoot_gpt_get_partentry (gpt, n)) != NULL; n++) + VasEBoot_test_assert (memcmp (p, &example_entries[n], sizeof (*p)) == 0, "unexpected partition %d data", n); - grub_test_assert (n == TABLE_ENTRIES, "unexpected partition limit: %d", n); + VasEBoot_test_assert (n == TABLE_ENTRIES, "unexpected partition limit: %d", n); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); close_disk (&data); } @@ -609,24 +609,24 @@ static void large_partitions_test (void) { struct test_data data; - struct grub_gpt_partentry *p; - grub_gpt_t gpt; - grub_uint32_t n; + struct VasEBoot_gpt_partentry *p; + VasEBoot_gpt_t gpt; + VasEBoot_uint32_t n; open_disk (&data); /* Double the entry size, cut the number of entries in half. */ data.raw->primary_header.maxpart = data.raw->backup_header.maxpart = - grub_cpu_to_le32_compile_time (TABLE_ENTRIES/2); + VasEBoot_cpu_to_le32_compile_time (TABLE_ENTRIES/2); data.raw->primary_header.partentry_size = data.raw->backup_header.partentry_size = - grub_cpu_to_le32_compile_time (ENTRY_SIZE*2); + VasEBoot_cpu_to_le32_compile_time (ENTRY_SIZE*2); data.raw->primary_header.partentry_crc32 = data.raw->backup_header.partentry_crc32 = - grub_cpu_to_le32_compile_time (0xf2c45af8); - data.raw->primary_header.crc32 = grub_cpu_to_le32_compile_time (0xde00cc8f); - data.raw->backup_header.crc32 = grub_cpu_to_le32_compile_time (0x6d72e284); + VasEBoot_cpu_to_le32_compile_time (0xf2c45af8); + data.raw->primary_header.crc32 = VasEBoot_cpu_to_le32_compile_time (0xde00cc8f); + data.raw->backup_header.crc32 = VasEBoot_cpu_to_le32_compile_time (0x6d72e284); memset (&data.raw->primary_entries, 0, sizeof (data.raw->primary_entries)); @@ -639,25 +639,25 @@ large_partitions_test (void) sync_disk(&data); gpt = read_disk (&data); - for (n = 0; (p = grub_gpt_get_partentry (gpt, n)) != NULL; n++) - grub_test_assert (memcmp (p, &example_entries[n], sizeof (*p)) == 0, + for (n = 0; (p = VasEBoot_gpt_get_partentry (gpt, n)) != NULL; n++) + VasEBoot_test_assert (memcmp (p, &example_entries[n], sizeof (*p)) == 0, "unexpected partition %d data", n); - grub_test_assert (n == TABLE_ENTRIES/2, "unexpected partition limit: %d", n); + VasEBoot_test_assert (n == TABLE_ENTRIES/2, "unexpected partition limit: %d", n); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); /* Editing memory beyond the entry structure should still change the crc. */ data.raw->primary_entries[1].attrib = 0xff; sync_disk(&data); gpt = read_disk (&data); - grub_test_assert (gpt->status == (GRUB_GPT_PROTECTIVE_MBR | - GRUB_GPT_PRIMARY_HEADER_VALID | - GRUB_GPT_BACKUP_HEADER_VALID | - GRUB_GPT_BACKUP_ENTRIES_VALID), + VasEBoot_test_assert (gpt->status == (VasEBoot_GPT_PROTECTIVE_MBR | + VasEBoot_GPT_PRIMARY_HEADER_VALID | + VasEBoot_GPT_BACKUP_HEADER_VALID | + VasEBoot_GPT_BACKUP_ENTRIES_VALID), "unexpected status: 0x%02x", gpt->status); - grub_gpt_free (gpt); + VasEBoot_gpt_free (gpt); close_disk (&data); } @@ -665,30 +665,30 @@ large_partitions_test (void) static void invalid_partsize_test (void) { - struct grub_gpt_header header = { - .magic = GRUB_GPT_HEADER_MAGIC, - .version = GRUB_GPT_HEADER_VERSION, - .headersize = sizeof (struct grub_gpt_header), - .crc32 = grub_cpu_to_le32_compile_time (0x1ff2a054), - .header_lba = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR), - .alternate_lba = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR), - .start = grub_cpu_to_le64_compile_time (DATA_START_SECTOR), - .end = grub_cpu_to_le64_compile_time (DATA_END_SECTOR), - .guid = GRUB_GPT_GUID_INIT(0x69c131ad, 0x67d6, 0x46c6, + struct VasEBoot_gpt_header header = { + .magic = VasEBoot_GPT_HEADER_MAGIC, + .version = VasEBoot_GPT_HEADER_VERSION, + .headersize = sizeof (struct VasEBoot_gpt_header), + .crc32 = VasEBoot_cpu_to_le32_compile_time (0x1ff2a054), + .header_lba = VasEBoot_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR), + .alternate_lba = VasEBoot_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR), + .start = VasEBoot_cpu_to_le64_compile_time (DATA_START_SECTOR), + .end = VasEBoot_cpu_to_le64_compile_time (DATA_END_SECTOR), + .guid = VasEBoot_GPT_GUID_INIT(0x69c131ad, 0x67d6, 0x46c6, 0x93, 0xc4, 0x12, 0x4c, 0x75, 0x52, 0x56, 0xac), - .partitions = grub_cpu_to_le64_compile_time (PRIMARY_TABLE_SECTOR), - .maxpart = grub_cpu_to_le32_compile_time (TABLE_ENTRIES), + .partitions = VasEBoot_cpu_to_le64_compile_time (PRIMARY_TABLE_SECTOR), + .maxpart = VasEBoot_cpu_to_le32_compile_time (TABLE_ENTRIES), /* Triple the entry size, which is not valid. */ - .partentry_size = grub_cpu_to_le32_compile_time (ENTRY_SIZE*3), - .partentry_crc32 = grub_cpu_to_le32_compile_time (0x074e052c), + .partentry_size = VasEBoot_cpu_to_le32_compile_time (ENTRY_SIZE*3), + .partentry_crc32 = VasEBoot_cpu_to_le32_compile_time (0x074e052c), }; - grub_gpt_header_check(&header, GRUB_DISK_SECTOR_BITS); - grub_test_assert (grub_errno == GRUB_ERR_BAD_PART_TABLE, - "unexpected error: %s", grub_errmsg); - grub_test_assert (strcmp(grub_errmsg, "invalid GPT entry size") == 0, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_gpt_header_check(&header, VasEBoot_DISK_SECTOR_BITS); + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_BAD_PART_TABLE, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_test_assert (strcmp(VasEBoot_errmsg, "invalid GPT entry size") == 0, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; } static void @@ -700,30 +700,30 @@ search_part_label_test (void) open_disk (&data); - expected_result = grub_xasprintf ("%s,gpt1", data.dev->disk->name); - grub_env_unset ("test_result"); - grub_search_part_label ("EFI SYSTEM", "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result && strcmp (test_result, expected_result) == 0, + expected_result = VasEBoot_xasprintf ("%s,gpt1", data.dev->disk->name); + VasEBoot_env_unset ("test_result"); + VasEBoot_search_part_label ("EFI SYSTEM", "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result && strcmp (test_result, expected_result) == 0, "wrong device: %s (%s)", test_result, expected_result); - grub_free (expected_result); + VasEBoot_free (expected_result); - expected_result = grub_xasprintf ("%s,gpt2", data.dev->disk->name); - grub_env_unset ("test_result"); - grub_search_part_label ("BIOS BOOT", "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result && strcmp (test_result, expected_result) == 0, + expected_result = VasEBoot_xasprintf ("%s,gpt2", data.dev->disk->name); + VasEBoot_env_unset ("test_result"); + VasEBoot_search_part_label ("BIOS BOOT", "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result && strcmp (test_result, expected_result) == 0, "wrong device: %s (%s)", test_result, expected_result); - grub_free (expected_result); + VasEBoot_free (expected_result); - grub_env_unset ("test_result"); - grub_search_part_label ("bogus name", "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result == NULL, + VasEBoot_env_unset ("test_result"); + VasEBoot_search_part_label ("bogus name", "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result == NULL, "unexpected device: %s", test_result); - grub_test_assert (grub_errno == GRUB_ERR_FILE_NOT_FOUND, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_FILE_NOT_FOUND, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; close_disk (&data); } @@ -740,30 +740,30 @@ search_part_uuid_test (void) open_disk (&data); - expected_result = grub_xasprintf ("%s,gpt1", data.dev->disk->name); - grub_env_unset ("test_result"); - grub_search_part_uuid (gpt1_uuid, "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result && strcmp (test_result, expected_result) == 0, + expected_result = VasEBoot_xasprintf ("%s,gpt1", data.dev->disk->name); + VasEBoot_env_unset ("test_result"); + VasEBoot_search_part_uuid (gpt1_uuid, "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result && strcmp (test_result, expected_result) == 0, "wrong device: %s (%s)", test_result, expected_result); - grub_free (expected_result); + VasEBoot_free (expected_result); - expected_result = grub_xasprintf ("%s,gpt2", data.dev->disk->name); - grub_env_unset ("test_result"); - grub_search_part_uuid (gpt2_uuid, "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result && strcmp (test_result, expected_result) == 0, + expected_result = VasEBoot_xasprintf ("%s,gpt2", data.dev->disk->name); + VasEBoot_env_unset ("test_result"); + VasEBoot_search_part_uuid (gpt2_uuid, "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result && strcmp (test_result, expected_result) == 0, "wrong device: %s (%s)", test_result, expected_result); - grub_free (expected_result); + VasEBoot_free (expected_result); - grub_env_unset ("test_result"); - grub_search_part_uuid (bogus_uuid, "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result == NULL, + VasEBoot_env_unset ("test_result"); + VasEBoot_search_part_uuid (bogus_uuid, "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result == NULL, "unexpected device: %s", test_result); - grub_test_assert (grub_errno == GRUB_ERR_FILE_NOT_FOUND, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_FILE_NOT_FOUND, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; close_disk (&data); } @@ -779,62 +779,62 @@ search_disk_uuid_test (void) open_disk (&data); - expected_result = grub_xasprintf ("%s", data.dev->disk->name); - grub_env_unset ("test_result"); - grub_search_disk_uuid (disk_uuid, "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result && strcmp (test_result, expected_result) == 0, + expected_result = VasEBoot_xasprintf ("%s", data.dev->disk->name); + VasEBoot_env_unset ("test_result"); + VasEBoot_search_disk_uuid (disk_uuid, "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result && strcmp (test_result, expected_result) == 0, "wrong device: %s (%s)", test_result, expected_result); - grub_free (expected_result); + VasEBoot_free (expected_result); - grub_env_unset ("test_result"); - grub_search_disk_uuid (bogus_uuid, "test_result", 0, NULL, 0); - test_result = grub_env_get ("test_result"); - grub_test_assert (test_result == NULL, + VasEBoot_env_unset ("test_result"); + VasEBoot_search_disk_uuid (bogus_uuid, "test_result", 0, NULL, 0); + test_result = VasEBoot_env_get ("test_result"); + VasEBoot_test_assert (test_result == NULL, "unexpected device: %s", test_result); - grub_test_assert (grub_errno == GRUB_ERR_FILE_NOT_FOUND, - "unexpected error: %s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_test_assert (VasEBoot_errno == VasEBoot_ERR_FILE_NOT_FOUND, + "unexpected error: %s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; close_disk (&data); } void -grub_unit_test_init (void) +VasEBoot_unit_test_init (void) { - grub_init_all (); - grub_hostfs_init (); - grub_host_init (); - grub_test_register ("gpt_pmbr_test", pmbr_test); - grub_test_register ("gpt_header_test", header_test); - grub_test_register ("gpt_read_valid_test", read_valid_test); - grub_test_register ("gpt_read_invalid_test", read_invalid_entries_test); - grub_test_register ("gpt_read_fallback_test", read_fallback_test); - grub_test_register ("gpt_repair_test", repair_test); - grub_test_register ("gpt_iterate_partitions_test", iterate_partitions_test); - grub_test_register ("gpt_large_partitions_test", large_partitions_test); - grub_test_register ("gpt_invalid_partsize_test", invalid_partsize_test); - grub_test_register ("gpt_weird_disk_size_test", weird_disk_size_test); - grub_test_register ("gpt_search_part_label_test", search_part_label_test); - grub_test_register ("gpt_search_uuid_test", search_part_uuid_test); - grub_test_register ("gpt_search_disk_uuid_test", search_disk_uuid_test); + VasEBoot_init_all (); + VasEBoot_hostfs_init (); + VasEBoot_host_init (); + VasEBoot_test_register ("gpt_pmbr_test", pmbr_test); + VasEBoot_test_register ("gpt_header_test", header_test); + VasEBoot_test_register ("gpt_read_valid_test", read_valid_test); + VasEBoot_test_register ("gpt_read_invalid_test", read_invalid_entries_test); + VasEBoot_test_register ("gpt_read_fallback_test", read_fallback_test); + VasEBoot_test_register ("gpt_repair_test", repair_test); + VasEBoot_test_register ("gpt_iterate_partitions_test", iterate_partitions_test); + VasEBoot_test_register ("gpt_large_partitions_test", large_partitions_test); + VasEBoot_test_register ("gpt_invalid_partsize_test", invalid_partsize_test); + VasEBoot_test_register ("gpt_weird_disk_size_test", weird_disk_size_test); + VasEBoot_test_register ("gpt_search_part_label_test", search_part_label_test); + VasEBoot_test_register ("gpt_search_uuid_test", search_part_uuid_test); + VasEBoot_test_register ("gpt_search_disk_uuid_test", search_disk_uuid_test); } void -grub_unit_test_fini (void) +VasEBoot_unit_test_fini (void) { - grub_test_unregister ("gpt_pmbr_test"); - grub_test_unregister ("gpt_header_test"); - grub_test_unregister ("gpt_read_valid_test"); - grub_test_unregister ("gpt_read_invalid_test"); - grub_test_unregister ("gpt_read_fallback_test"); - grub_test_unregister ("gpt_repair_test"); - grub_test_unregister ("gpt_iterate_partitions_test"); - grub_test_unregister ("gpt_large_partitions_test"); - grub_test_unregister ("gpt_invalid_partsize_test"); - grub_test_unregister ("gpt_weird_disk_size_test"); - grub_test_unregister ("gpt_search_part_label_test"); - grub_test_unregister ("gpt_search_part_uuid_test"); - grub_test_unregister ("gpt_search_disk_uuid_test"); - grub_fini_all (); + VasEBoot_test_unregister ("gpt_pmbr_test"); + VasEBoot_test_unregister ("gpt_header_test"); + VasEBoot_test_unregister ("gpt_read_valid_test"); + VasEBoot_test_unregister ("gpt_read_invalid_test"); + VasEBoot_test_unregister ("gpt_read_fallback_test"); + VasEBoot_test_unregister ("gpt_repair_test"); + VasEBoot_test_unregister ("gpt_iterate_partitions_test"); + VasEBoot_test_unregister ("gpt_large_partitions_test"); + VasEBoot_test_unregister ("gpt_invalid_partsize_test"); + VasEBoot_test_unregister ("gpt_weird_disk_size_test"); + VasEBoot_test_unregister ("gpt_search_part_label_test"); + VasEBoot_test_unregister ("gpt_search_part_uuid_test"); + VasEBoot_test_unregister ("gpt_search_disk_uuid_test"); + VasEBoot_fini_all (); } diff --git a/tests/gptprio_test.in b/tests/gptprio_test.in index c5cf0f3b7..cee8b2388 100644 --- a/tests/gptprio_test.in +++ b/tests/gptprio_test.in @@ -4,30 +4,30 @@ set -e # Copyright (C) 2010 Free Software Foundation, Inc. # Copyright (C) 2014 CoreOS, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . sgdisk=sgdisk -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell if ! which "${sgdisk}" >/dev/null 2>&1; then echo "sgdisk not installed; cannot test gptprio." exit 77 fi -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot | mipsel-loongson) disk=ata0 ;; @@ -132,7 +132,7 @@ check_prio () { } run_next() { - "${grubshell}" --disk="${img1}" --modules=gptprio <. +# along with VasEBoot. If not, see . parted=parted -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot | mipsel-loongson) disk=ata0 ;; @@ -70,7 +70,7 @@ wipe_disk_area () { } do_repair () { - output="`echo "gptrepair ($disk)" | "${grubshell}" --disk="${img2}"`" + output="`echo "gptrepair ($disk)" | "${VasEBootshell}" --disk="${img2}"`" if echo "${output}" | grep ^error; then return 1 fi diff --git a/tests/gzcompress_test.in b/tests/gzcompress_test.in index 11b6bb208..d4b336959 100644 --- a/tests/gzcompress_test.in +++ b/tests/gzcompress_test.in @@ -1,29 +1,29 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" if ! which gzip >/dev/null 2>&1; then echo "gzip not installed; cannot test gzip compression." exit 77 fi -if [ "$(echo hello | "${grubshell}" --mkrescue-arg=--compress=gz)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --mkrescue-arg=--compress=gz)" != "Hello World" ]; then exit 1 fi diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in index c229716a6..248865f44 100644 --- a/tests/hddboot_test.in +++ b/tests/hddboot_test.in @@ -1,37 +1,37 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: emu is different *-emu) exit 0;; # PLATFORM: Flash targets i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips) exit 0;; - # FIXME: currently grub-shell uses only -kernel for loongson + # FIXME: currently VasEBoot-shell uses only -kernel for loongson mipsel-loongson) exit 0;; esac -if [ "$(echo hello | "${grubshell}" --boot=hd)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --boot=hd)" != "Hello World" ]; then exit 1 fi diff --git a/tests/help_test.in b/tests/help_test.in index e780924ef..02a60ac75 100644 --- a/tests/help_test.in +++ b/tests/help_test.in @@ -1,7 +1,7 @@ #! /bin/bash set -e -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" template="Usage: help [PATTERN ...] Show a help message. @@ -9,7 +9,7 @@ Show a help message. -h, --help Display this help and exit. -u, --usage Display the usage of this command and exit. Hello World" -outpu="$(echo 'help help; hello' | @builddir@/grub-shell)" +outpu="$(echo 'help help; hello' | @builddir@/VasEBoot-shell)" if [ "$template" != "$outpu" ]; then exit 1 diff --git a/tests/hfs_test.in b/tests/hfs_test.in index e3e88f190..331651ec3 100644 --- a/tests/hfs_test.in +++ b/tests/hfs_test.in @@ -20,4 +20,4 @@ if ! modprobe mac-roman; then exit 77 fi -"@builddir@/grub-fs-tester" hfs +"@builddir@/VasEBoot-fs-tester" hfs diff --git a/tests/hfsplus_test.in b/tests/hfsplus_test.in index f947c4a44..bb3220847 100644 --- a/tests/hfsplus_test.in +++ b/tests/hfsplus_test.in @@ -15,6 +15,6 @@ if ! which mkfs.hfsplus >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" hfsplus -"@builddir@/grub-fs-tester" hfsplus_casesens -"@builddir@/grub-fs-tester" hfsplus_wrap +"@builddir@/VasEBoot-fs-tester" hfsplus +"@builddir@/VasEBoot-fs-tester" hfsplus_casesens +"@builddir@/VasEBoot-fs-tester" hfsplus_wrap diff --git a/tests/iso9660_test.in b/tests/iso9660_test.in index fdcc9e124..fbe99e6c5 100644 --- a/tests/iso9660_test.in +++ b/tests/iso9660_test.in @@ -7,9 +7,9 @@ if ! which xorriso >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" joliet -"@builddir@/grub-fs-tester" rockridge -"@builddir@/grub-fs-tester" rockridge_joliet -"@builddir@/grub-fs-tester" joliet_1999 -"@builddir@/grub-fs-tester" rockridge_1999 -"@builddir@/grub-fs-tester" rockridge_joliet_1999 \ No newline at end of file +"@builddir@/VasEBoot-fs-tester" joliet +"@builddir@/VasEBoot-fs-tester" rockridge +"@builddir@/VasEBoot-fs-tester" rockridge_joliet +"@builddir@/VasEBoot-fs-tester" joliet_1999 +"@builddir@/VasEBoot-fs-tester" rockridge_1999 +"@builddir@/VasEBoot-fs-tester" rockridge_joliet_1999 \ No newline at end of file diff --git a/tests/jfs_test.in b/tests/jfs_test.in index c2e5ecedd..0f9fc441c 100644 --- a/tests/jfs_test.in +++ b/tests/jfs_test.in @@ -15,4 +15,4 @@ if ! which mkfs.jfs >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" jfs +"@builddir@/VasEBoot-fs-tester" jfs diff --git a/tests/lib/unit_test.c b/tests/lib/unit_test.c index 6adfd9922..c3c29aec1 100644 --- a/tests/lib/unit_test.c +++ b/tests/lib/unit_test.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include int main (int argc __attribute__ ((unused)), @@ -30,13 +30,13 @@ main (int argc __attribute__ ((unused)), { int status = 0; - grub_test_t test; + VasEBoot_test_t test; - grub_unit_test_init (); - FOR_LIST_ELEMENTS (test, grub_test_list) - status = grub_test_run (test) ? : status; + VasEBoot_unit_test_init (); + FOR_LIST_ELEMENTS (test, VasEBoot_test_list) + status = VasEBoot_test_run (test) ? : status; - grub_unit_test_fini (); + VasEBoot_unit_test_fini (); exit (status); } diff --git a/tests/lzocompress_test.in b/tests/lzocompress_test.in index 41984c254..21fad8109 100644 --- a/tests/lzocompress_test.in +++ b/tests/lzocompress_test.in @@ -1,29 +1,29 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" if ! which lzop >/dev/null 2>&1; then echo "lzop not installed; cannot test lzo compression." exit 77 fi -if [ "$(echo hello | "${grubshell}" --mkrescue-arg=--compress=lzo)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --mkrescue-arg=--compress=lzo)" != "Hello World" ]; then exit 1 fi diff --git a/tests/minixfs_test.in b/tests/minixfs_test.in index 1784b1261..c041e4625 100644 --- a/tests/minixfs_test.in +++ b/tests/minixfs_test.in @@ -30,6 +30,6 @@ if ! mkfs.minix -h | grep -- -B > /dev/null; then exit 77 fi -"@builddir@/grub-fs-tester" minix -"@builddir@/grub-fs-tester" minix2 -"@builddir@/grub-fs-tester" minix3 +"@builddir@/VasEBoot-fs-tester" minix +"@builddir@/VasEBoot-fs-tester" minix2 +"@builddir@/VasEBoot-fs-tester" minix3 diff --git a/tests/netboot_test.in b/tests/netboot_test.in index c757023d9..9da140e2f 100644 --- a/tests/netboot_test.in +++ b/tests/netboot_test.in @@ -1,32 +1,32 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: emu is different *-emu) exit 0;; # PLATFORM: Flash targets i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips) exit 0;; - # FIXME: currently grub-shell uses only -kernel for loongson + # FIXME: currently VasEBoot-shell uses only -kernel for loongson mipsel-loongson) exit 0;; # FIXME: no rtl8139 support @@ -40,6 +40,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esac -if [ "$(echo hello | "${grubshell}" --boot=net)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --boot=net)" != "Hello World" ]; then exit 1 fi diff --git a/tests/nilfs2_test.in b/tests/nilfs2_test.in index 780b60ec1..ec597e5fe 100644 --- a/tests/nilfs2_test.in +++ b/tests/nilfs2_test.in @@ -15,4 +15,4 @@ if ! which mkfs.nilfs2 >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" nilfs2 +"@builddir@/VasEBoot-fs-tester" nilfs2 diff --git a/tests/ntfs_test.in b/tests/ntfs_test.in index e25c6384a..20bb01dfb 100644 --- a/tests/ntfs_test.in +++ b/tests/ntfs_test.in @@ -20,5 +20,5 @@ if ! which setfattr >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" ntfs -"@builddir@/grub-fs-tester" ntfscomp +"@builddir@/VasEBoot-fs-tester" ntfs +"@builddir@/VasEBoot-fs-tester" ntfscomp diff --git a/tests/ohci_test.in b/tests/ohci_test.in index 7fede6f26..704a12797 100644 --- a/tests/ohci_test.in +++ b/tests/ohci_test.in @@ -1,25 +1,25 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: Don't mess with real devices when OS is active *-emu) exit 0;; @@ -41,7 +41,7 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${grubshell}" --qemu-opts="-device pci-ohci -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then +if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${VasEBootshell}" --qemu-opts="-device pci-ohci -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1 diff --git a/tests/partmap_test.in b/tests/partmap_test.in index f8dc456fb..77d69bdf7 100644 --- a/tests/partmap_test.in +++ b/tests/partmap_test.in @@ -3,23 +3,23 @@ set -e # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . parted=parted -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" create_disk_image () { name="$1" @@ -57,13 +57,13 @@ list_parts () { outfile="$1" shift - echo ls | "${grubshell}" --disk="${imgfile}" \ + echo ls | "${VasEBootshell}" --disk="${imgfile}" \ --modules=$mod | tr -d "\n\r" > "${outfile}" cat "${outfile}" echo } -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot | mipsel-loongson) disk=ata0 ;; diff --git a/tests/pata_test.in b/tests/pata_test.in index c1d0f63ea..617b9a466 100644 --- a/tests/pata_test.in +++ b/tests/pata_test.in @@ -1,28 +1,28 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" disk=hda indisk=ata0 -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: Don't mess with real devices when OS is active *-emu) exit 0;; @@ -45,7 +45,7 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -if [ "$(echo "nativedisk; source '($indisk)/$outfile';" | "${grubshell}" --qemu-opts="-$disk $imgfile")" != "Hello World" ]; then +if [ "$(echo "nativedisk; source '($indisk)/$outfile';" | "${VasEBootshell}" --qemu-opts="-$disk $imgfile")" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1 diff --git a/tests/printf_unit_test.c b/tests/printf_unit_test.c index d7b12c6db..73d81aaf2 100644 --- a/tests/printf_unit_test.c +++ b/tests/printf_unit_test.c @@ -1,25 +1,25 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include +#include +#include #define MSG "printf test failed: %s, %s", real, expected @@ -30,45 +30,45 @@ printf_test (void) char expected[512]; char *null = NULL; - grub_snprintf (real, sizeof (real), "%s", null); + VasEBoot_snprintf (real, sizeof (real), "%s", null); snprintf (expected, sizeof (expected), "%s", null); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%10s", null); + VasEBoot_snprintf (real, sizeof (real), "%10s", null); snprintf (expected, sizeof (expected), "%10s", null); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%-10s", null); + VasEBoot_snprintf (real, sizeof (real), "%-10s", null); snprintf (expected, sizeof (expected), "%-10s", null); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%d%%", 10); + VasEBoot_snprintf (real, sizeof (real), "%d%%", 10); snprintf (expected, sizeof (expected), "%d%%", 10); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%d %%", 10); + VasEBoot_snprintf (real, sizeof (real), "%d %%", 10); snprintf (expected, sizeof (expected), "%d %%", 10); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%%"); + VasEBoot_snprintf (real, sizeof (real), "%%"); snprintf (expected, sizeof (expected), "%%"); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%d %d %d", 1, 2, 3); + VasEBoot_snprintf (real, sizeof (real), "%d %d %d", 1, 2, 3); snprintf (expected, sizeof (expected), "%d %d %d", 1, 2, 3); - grub_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%3$d %2$d %1$d", 1, 2, 3); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_snprintf (real, sizeof (real), "%3$d %2$d %1$d", 1, 2, 3); snprintf (expected, sizeof (expected), "%3$d %2$d %1$d", 1, 2, 3); - grub_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%d %lld %d", 1, 2LL, 3); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_snprintf (real, sizeof (real), "%d %lld %d", 1, 2LL, 3); snprintf (expected, sizeof (expected), "%d %lld %d", 1, 2LL, 3); - grub_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%3$d %2$lld %1$d", 1, 2LL, 3); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_snprintf (real, sizeof (real), "%3$d %2$lld %1$d", 1, 2LL, 3); snprintf (expected, sizeof (expected), "%3$d %2$lld %1$d", 1, 2LL, 3); - grub_test_assert (strcmp (real, expected) == 0, MSG); - grub_snprintf (real, sizeof (real), "%%0%dd ", 1); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_snprintf (real, sizeof (real), "%%0%dd ", 1); snprintf (expected, sizeof (expected), "%%0%dd ", 1); - grub_test_assert (strcmp (real, expected) == 0, MSG); + VasEBoot_test_assert (strcmp (real, expected) == 0, MSG); } -GRUB_UNIT_TEST ("printf_unit_test", printf_test); +VasEBoot_UNIT_TEST ("printf_unit_test", printf_test); diff --git a/tests/priority_queue_unit_test.cc b/tests/priority_queue_unit_test.cc index bb0060e5e..b5eece6b2 100644 --- a/tests/priority_queue_unit_test.cc +++ b/tests/priority_queue_unit_test.cc @@ -1,26 +1,26 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -46,13 +46,13 @@ static void priority_queue_test (void) { priority_queue pq; - grub_priority_queue_t pq2; + VasEBoot_priority_queue_t pq2; int counter; int s = 0; - pq2 = grub_priority_queue_new (sizeof (int), compar); + pq2 = VasEBoot_priority_queue_new (sizeof (int), compar); if (!pq2) { - grub_test_assert (0, + VasEBoot_test_assert (0, "priority queue: queue creating failed\n"); return; } @@ -61,16 +61,16 @@ priority_queue_test (void) for (counter = 0; counter < 1000000; counter++) { int op = rand () % 10; - if (s && *(int *) grub_priority_queue_top (pq2) != pq.top ()) + if (s && *(int *) VasEBoot_priority_queue_top (pq2) != pq.top ()) { printf ("Error at %d\n", counter); - grub_test_assert (0, + VasEBoot_test_assert (0, "priority queue: error at %d\n", counter); return; } if (op < 3 && s) { - grub_priority_queue_pop (pq2); + VasEBoot_priority_queue_pop (pq2); pq.pop (); s--; } @@ -78,9 +78,9 @@ priority_queue_test (void) { int v = rand (); pq.push (v); - if (grub_priority_queue_push (pq2, &v) != 0) + if (VasEBoot_priority_queue_push (pq2, &v) != 0) { - grub_test_assert (0, + VasEBoot_test_assert (0, "priority queue: push failed"); return; } @@ -89,17 +89,17 @@ priority_queue_test (void) } while (s) { - if (*(int *) grub_priority_queue_top (pq2) != pq.top ()) + if (*(int *) VasEBoot_priority_queue_top (pq2) != pq.top ()) { - grub_test_assert (0, + VasEBoot_test_assert (0, "priority queue: Error at the end. %d elements remaining.\n", s); return; } - grub_priority_queue_pop (pq2); + VasEBoot_priority_queue_pop (pq2); pq.pop (); s--; } printf ("priority_queue: passed successfully\n"); } -GRUB_UNIT_TEST ("priority_queue_unit_test", priority_queue_test); +VasEBoot_UNIT_TEST ("priority_queue_unit_test", priority_queue_test); diff --git a/tests/pseries_test.in b/tests/pseries_test.in index 226494593..2661533f5 100644 --- a/tests/pseries_test.in +++ b/tests/pseries_test.in @@ -1,37 +1,37 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" != powerpc-ieee1275 ]; then +if [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" != powerpc-ieee1275 ]; then exit 0 fi -if [ "$(echo hello | "${grubshell}" --pseries --timeout=180 --boot=cd)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --pseries --timeout=180 --boot=cd)" != "Hello World" ]; then exit 1 fi -if [ "$(echo hello | "${grubshell}" --pseries --timeout=180 --boot=hd)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --pseries --timeout=180 --boot=hd)" != "Hello World" ]; then exit 1 fi # FIXME: workaround SLOF bugs -#if [ "$(echo hello | "${grubshell}" --pseries --timeout=180 --boot=net)" != "Hello World" ]; then +#if [ "$(echo hello | "${VasEBootshell}" --pseries --timeout=180 --boot=net)" != "Hello World" ]; then # exit 1 #fi diff --git a/tests/reiserfs_test.in b/tests/reiserfs_test.in index 678efe7b3..08b2c2341 100644 --- a/tests/reiserfs_test.in +++ b/tests/reiserfs_test.in @@ -15,6 +15,6 @@ if ! which mkfs.reiserfs >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" reiserfs -"@builddir@/grub-fs-tester" reiserfs_old +"@builddir@/VasEBoot-fs-tester" reiserfs +"@builddir@/VasEBoot-fs-tester" reiserfs_old diff --git a/tests/romfs_test.in b/tests/romfs_test.in index 83e09315a..fe37eb46f 100644 --- a/tests/romfs_test.in +++ b/tests/romfs_test.in @@ -7,4 +7,4 @@ if ! which genromfs >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" romfs +"@builddir@/VasEBoot-fs-tester" romfs diff --git a/tests/squashfs_test.in b/tests/squashfs_test.in index ec34e0108..60c3301c5 100644 --- a/tests/squashfs_test.in +++ b/tests/squashfs_test.in @@ -7,6 +7,6 @@ if ! which mksquashfs >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" squash4_gzip -"@builddir@/grub-fs-tester" squash4_xz -"@builddir@/grub-fs-tester" squash4_lzo +"@builddir@/VasEBoot-fs-tester" squash4_gzip +"@builddir@/VasEBoot-fs-tester" squash4_xz +"@builddir@/VasEBoot-fs-tester" squash4_lzo diff --git a/tests/syslinux/ubuntu10.04_VasEBoot.cfg.in b/tests/syslinux/ubuntu10.04_VasEBoot.cfg.in index 846e4acf0..aca5d837d 100644 --- a/tests/syslinux/ubuntu10.04_VasEBoot.cfg.in +++ b/tests/syslinux/ubuntu10.04_VasEBoot.cfg.in @@ -22,22 +22,22 @@ set timeout=5 default='vesamenu.c32' menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Check disc for defects' --hotkey 'c' --id 'check' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Test memory' --hotkey 'm' --id 'memtest' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/install/mt86plus' } menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { @@ -95,22 +95,22 @@ menuentry 'Help' --hotkey 'h' --id 'help' { set timeout=5 default='live' menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Check disc for defects' --hotkey 'c' --id 'check' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Test memory' --hotkey 'm' --id 'memtest' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/install/mt86plus' } menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { @@ -181,22 +181,22 @@ menuentry 'menu' --id 'menu' { set timeout=5 default='vesamenu.c32' menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Check disc for defects' --hotkey 'c' --id 'check' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash -- initrd$linux_suffix '/'/'/casper/initrd.lz' } menuentry 'Test memory' --hotkey 'm' --id 'memtest' { - if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi + if test x$VasEBoot_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi linux$linux_suffix '/'/'/install/mt86plus' } menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' { diff --git a/tests/syslinux_test.in b/tests/syslinux_test.in index fc4edd8ef..3db7b0fd1 100644 --- a/tests/syslinux_test.in +++ b/tests/syslinux_test.in @@ -4,11 +4,11 @@ set -e outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 -"@builddir@/grub-syslinux2cfg" -r "@abs_top_srcdir@/tests/syslinux/ubuntu10.04" "@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg" -o "$outfile" +"@builddir@/VasEBoot-syslinux2cfg" -r "@abs_top_srcdir@/tests/syslinux/ubuntu10.04" "@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg" -o "$outfile" echo "$outfile" -if ! diff -u "$outfile" "@builddir@/tests/syslinux/ubuntu10.04_grub.cfg"; then +if ! diff -u "$outfile" "@builddir@/tests/syslinux/ubuntu10.04_VasEBoot.cfg"; then echo "Mismatch in ubuntu10.04" exit 1; fi diff --git a/tests/tar_test.in b/tests/tar_test.in index 46ba3bce2..9f25b8bbd 100644 --- a/tests/tar_test.in +++ b/tests/tar_test.in @@ -7,4 +7,4 @@ if ! which tar >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" tarfs +"@builddir@/VasEBoot-fs-tester" tarfs diff --git a/tests/test_sha512sum.in b/tests/test_sha512sum.in index d5ef7f9ea..d3aa089af 100644 --- a/tests/test_sha512sum.in +++ b/tests/test_sha512sum.in @@ -6,18 +6,18 @@ cat >$file <$outfile1 <$outfile1 </dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" udf +"@builddir@/VasEBoot-fs-tester" udf diff --git a/tests/uhci_test.in b/tests/uhci_test.in index 89e2c1805..3390a8963 100644 --- a/tests/uhci_test.in +++ b/tests/uhci_test.in @@ -1,25 +1,25 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in # PLATFORM: Don't mess with real devices when OS is active *-emu) exit 0;; @@ -41,7 +41,7 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${grubshell}" --qemu-opts="-usb -usbdevice disk:$imgfile" | tail -n 1)" != "Hello World" ]; then +if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${VasEBootshell}" --qemu-opts="-usb -usbdevice disk:$imgfile" | tail -n 1)" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1 diff --git a/tests/util/VasEBoot-fs-tester.in b/tests/util/VasEBoot-fs-tester.in index d768d66d1..c72eb3441 100644 --- a/tests/util/VasEBoot-fs-tester.in +++ b/tests/util/VasEBoot-fs-tester.in @@ -4,16 +4,16 @@ set -e fs="$1" -GRUBFSTEST="@builddir@/grub-fstest" +VasEBootFSTEST="@builddir@/VasEBoot-fstest" tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 # This wrapper is to ease insertion of valgrind or time statistics run_it () { - LC_ALL=C "$GRUBFSTEST" "$@" + LC_ALL=C "$VasEBootFSTEST" "$@" } -run_grubfstest () { +run_VasEBootfstest () { run_it -c $NEED_IMAGES_N "${NEED_IMAGES[@]}" "$@" } @@ -237,7 +237,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + MOUNTOPTS="" MOUNTFS="$fs" MASTER="${tempdir}/master" - FSLABEL="grub_;/testé莭莽茝😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfew" + FSLABEL="VasEBoot_;/testé莭莽茝😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfew" CFILESN=1 if test -f /usr/share/dict/american-english; then CFILESSRC[0]="/usr/share/dict/american-english" @@ -264,21 +264,21 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + # OS LIMITATION: Linux HFS+ tools check UTF-8 length and don't # handle out-of-BMP characters x"hfsplus" | x"hfsplus_casesens" | x"hfsplus_wrap") - FSLABEL="grub_;/testé䏌䐓䏕киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoiq" + FSLABEL="VasEBoot_;/testé䏌䐓䏕киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoiq" ;; # FS LIMITATION: btrfs label is at most 255 UTF-8 chars x"btrfs"*) - FSLABEL="grub_;/testé莭莽😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoi";; + FSLABEL="VasEBoot_;/testé莭莽😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoi";; # FS LIMITATION: exfat is at most 15 UTF-16 chars x"exfat") FSLABEL="géт ;/莭莽😁кир";; # FS LIMITATION: ntfs label is at most ?? UTF-16 chars x"ntfs"*) - FSLABEL="grub_;/testéтi u莭😁茝кириrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvniwnivrewiuvcrewvnuewvrrrewniureifiuewifjiww";; + FSLABEL="VasEBoot_;/testéтi u莭😁茝кириrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvniwnivrewiuvcrewvnuewvrrrewniureifiuewifjiww";; # FS LIMITATION: nilfs2 label is at most 80 UTF-8 characters x"nilfs2") - FSLABEL="grub_;/testéтi u😁莽茝кириrewfceniuewruevrewnuuireurevueurnievrewfne";; + FSLABEL="VasEBoot_;/testéтi u😁莽茝кириrewfceniuewruevrewnuuireurevueurnievrewfne";; # FS LIMITATION: afs and iso9660 label is at most 32 UTF-8 characters x"afs" | xiso9660 | xrockridge | xrockridge_joliet\ | xiso9660_1999 | xrockridge_1999 | xrockridge_joliet_1999) @@ -286,7 +286,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + # FS LIMITATION: bfs label is at most 32 UTF-8 characters # OS LIMITATION: bfs label can't contain ; or / x"bfs") - FSLABEL="grub_é莭莽😁кирит u";; + FSLABEL="VasEBoot_é莭莽😁кирит u";; # FS LIMITATION: Joliet label is at most 16 UTF-16 characters # OS LIMITATION: xorriso doesn't handle out-of-BMP characters xjoliet | xjoliet_1999) @@ -298,30 +298,30 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + FSLABEL="g;/éт 莭😁";; # FS LIMITATION: No underscore, space, semicolon, slash or international characters in UFS* in label. Limited to 32 UTF-8 characters x"ufs1" | x"ufs1_sun" | x"ufs2") - FSLABEL="grubtest""ieurrucnenreeiurueurewf";; + FSLABEL="VasEBoottest""ieurrucnenreeiurueurewf";; # FS LIMITATION: XFS label is at most 12 UTF-8 characters x"xfs"|x"xfs_crc") FSLABEL="géт 😁к";; # FS LIMITATION: FAT labels limited to 11 characters, no international characters or lowercase x"vfat"* | xmsdos*) - FSLABEL="GRUBTEST ;_";; + FSLABEL="VasEBootTEST ;_";; # FS LIMITATION: AFFS is latin1. At most 29 characters x"affs" | xaffs_intl) - FSLABEL="grub_tt? #*w;/e£@¡¤½¾{[]}<>.,";; + FSLABEL="VasEBoot_tt? #*w;/e£@¡¤½¾{[]}<>.,";; # FS LIMITATION: SFS is latin1. At most 30 characters x"sfs"*) - FSLABEL="GRUB tt öäüé;/àèç åø¿ª©þð׫»µ¬";; + FSLABEL="VasEBoot tt öäüé;/àèç åø¿ª©þð׫»µ¬";; # FS LIMITATION: HFS is Mac-Roman. At most 27 characters x"hfs") - FSLABEL="grub_t;/estéàèèéie fiucnree";; + FSLABEL="VasEBoot_t;/estéàèèéie fiucnree";; # FS LIMITATION: UDF label is either up to 127 latin1 characters or 63 UTF-16 ones # OS LIMITATION: Linux UDF tools force ASCII label ... x"udf") - FSLABEL="grub_;/testurewfceniuewruevrewnuuireurevueurnievr";; + FSLABEL="VasEBoot_;/testurewfceniuewruevrewnuuireurevueurnievr";; # FS LIMITATION: ZFS doesn't accept non-ASCII in label # FIXME: since this is used as a path component for mount it's very limited in length xzfs_* | xzfs) - FSLABEL="grub_testieufiue r";; + FSLABEL="VasEBoot_testieufiue r";; esac case x"$fs" in xmdraid*) @@ -445,7 +445,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + # FS LIMITATION: no hardlinks on BFS, exfat, fat, hfs and SFS xbfs | xexfat | x"vfat"* | xmsdos* | xhfs | xsfs | xsfs_caseins) NOHARDLINK=y;; - # GRUB LIMITATION: no hardlink support on newc and hfs+ + # VasEBoot LIMITATION: no hardlink support on newc and hfs+ xcpio_crc | xcpio_newc | xhfsplus*) NOHARDLINK=y;; esac @@ -464,7 +464,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + LONGNAME="`echo $LONGNAME |head -c 60`";; x"udf") LONGNAME="`echo $LONGNAME |head -c 192`";; - # GRUB LIMITATION: GRUB prefers Joliet over ISO9660:1999 + # VasEBoot LIMITATION: VasEBoot prefers Joliet over ISO9660:1999 xjoliet | xjoliet_1999) LONGNAME="`echo $LONGNAME |head -c 103`";; xiso9660_1999) @@ -487,7 +487,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + # OS LIMITATION: Linux apparently uses localtime instead of UTC xhfs) NOFILETIME=y; NOFSTIME=y;; - # GRUB LIMITATION: FAT and exFAT use localtime. Unusable for GRUB + # VasEBoot LIMITATION: FAT and exFAT use localtime. Unusable for VasEBoot x"vfat"* | x"msdos"* | x"exfat") NOFILETIME=y; NOFSTIME=y;; # FS LIMITATION: romfs has no timestamps. @@ -676,42 +676,42 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + x"zfs") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" "${LODEVICES[0]}" sleep 1 - "zfs" create "$FSLABEL"/"grub fs" + "zfs" create "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_caseins") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" "${LODEVICES[0]}" sleep 1 - "zfs" create -o casesensitivity=insensitive "$FSLABEL"/"grub fs" + "zfs" create -o casesensitivity=insensitive "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_lzjb" | xzfs_gzip | xzfs_zle) "zpool" create -O compression=${fs/zfs_/} -R "$MNTPOINTRW" "$FSLABEL" "${LODEVICES[0]}" sleep 1 - "zfs" create -o compression=${fs/zfs_/} "$FSLABEL"/"grub fs" + "zfs" create -o compression=${fs/zfs_/} "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_raidz") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" raidz1 "${LODEVICES[@]}" sleep 1 - "zfs" create "$FSLABEL"/"grub fs" + "zfs" create "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_raidz2") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" raidz2 "${LODEVICES[@]}" sleep 1 - "zfs" create "$FSLABEL"/"grub fs" + "zfs" create "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_raidz3") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" raidz3 "${LODEVICES[@]}" sleep 1 - "zfs" create "$FSLABEL"/"grub fs" + "zfs" create "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_mirror") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" mirror "${LODEVICES[@]}" sleep 1 - "zfs" create "$FSLABEL"/"grub fs" + "zfs" create "$FSLABEL"/"VasEBoot fs" sleep 1;; x"zfs_stripe") "zpool" create -R "$MNTPOINTRW" "$FSLABEL" "${LODEVICES[@]}" sleep 1 - "zfs" create "$FSLABEL"/"grub fs" + "zfs" create "$FSLABEL"/"VasEBoot fs" sleep 1;; x"tarfs" | x"cpio_"* | x"iso9660" | xjoliet | xrockridge | xrockridge_joliet | x"iso9660_1999" | xjoliet_1999 | xrockridge_1999 | xrockridge_joliet_1999 | x"ziso9660" | x"romfs" | x"squash4_"*) INSTDEVICE=/dev/null;; @@ -736,26 +736,26 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + for ((i=0;i^{_}[]\`|~.";; # FS LIMITATION: iso9660 accepts only [0-9A-Z_]*, 32 characters at most @@ -823,13 +823,13 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + xminix3) IFILE="éàèüöäëñкирица莭茝Ελλικά😁😜😒" ISYM="Ελλικά😁😜😒莭茝кирицаéàèüöäëñ";; - # GRUB LIMITATION: HFS+ uses NFD. GRUB doesn't handle NF conversion. + # VasEBoot LIMITATION: HFS+ uses NFD. VasEBoot doesn't handle NF conversion. # OS LIMITATION: Linux doesn't handle out-of-BMP characters for UTF-16 x"hfsplus" | x"hfsplus_casesens" | x"hfsplus_wrap") IFILE="éàèüöäëñкирилица䏌䐓䏕Ελληνικα̍䏌䐓䏕" ISYM="Ελληνικα̍кирилица䏌䐓䏕éàèüöäëñ䏌䐓䏕" ;; - # GRUB LIMITATION: On case-insensitive ZFS isn't supported with non-uppercase characters + # VasEBoot LIMITATION: On case-insensitive ZFS isn't supported with non-uppercase characters xzfs_caseins) IFILE="ÉÀÈÜÖÄËÑКИРИЛИЦА莭莽茝ΕΛΛΗΝΙΚΆ😁😜😒" ISYM="ΕΛΛΗΝΙΚΆКИРИЛИЦА😁😜😒ÉÀÈÜÖÄËÑ莭莽茝";; @@ -858,18 +858,18 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + LONGSYM="longsym" PSYM="psym" OSDIR="" - GRUBDEVICE=loop0 + VasEBootDEVICE=loop0 case x"$fs" in xmdraid*) - GRUBDEVICE="mduuid/`mdadm --detail --export $MOUNTDEVICE | grep MD_UUID=|sed 's,MD_UUID=,,g;s,:,,g'`";; + VasEBootDEVICE="mduuid/`mdadm --detail --export $MOUNTDEVICE | grep MD_UUID=|sed 's,MD_UUID=,,g;s,:,,g'`";; xlvm*) - GRUBDEVICE="lvm/grub_test-testvol";; + VasEBootDEVICE="lvm/VasEBoot_test-testvol";; esac - GRUBDIR="($GRUBDEVICE)" + VasEBootDIR="($VasEBootDEVICE)" case x"$fs" in x"zfs"*) - OSDIR="grub fs/" - GRUBDIR="($GRUBDEVICE)/grub fs@";; + OSDIR="VasEBoot fs/" + VasEBootDIR="($VasEBootDEVICE)/VasEBoot fs@";; x"tarfs" | x"cpio_"* | x"iso9660" | xjoliet | xrockridge | xrockridge_joliet | x"iso9660_1999" | xjoliet_1999 | xrockridge_1999 | xrockridge_joliet_1999 | x"ziso9660" | x"romfs" | x"squash4_"* | xafs) ;; *) @@ -1019,7 +1019,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + done UMOUNT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S") sleep 1 - vgchange -a n grub_test + vgchange -a n VasEBoot_test ;; xmdraid*) sleep 1 @@ -1064,7 +1064,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + xsquash4_*) ;; xlvm*) - vgchange -a y grub_test + vgchange -a y VasEBoot_test sleep 1 mount -t "$MOUNTFS" "${MOUNTDEVICE}" "$MNTPOINTRO" -o ${MOUNTOPTS}${SELINUXOPTS}ro ;; xmdraid*) @@ -1075,12 +1075,12 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + mount -t "$MOUNTFS" "${MOUNTDEVICE}" "$MNTPOINTRO" -o ${MOUNTOPTS}${SELINUXOPTS}ro ;; esac - run_grubfstest ls -- -la + run_VasEBootfstest ls -- -la case x"$fs" in x"zfs"*) - LSROUT=$(run_grubfstest ls -- -la "($GRUBDEVICE)/grub fs@/");; + LSROUT=$(run_VasEBootfstest ls -- -la "($VasEBootDEVICE)/VasEBoot fs@/");; *) - LSROUT=$(run_grubfstest ls -- -la "($GRUBDEVICE)/");; + LSROUT=$(run_VasEBootfstest ls -- -la "($VasEBootDEVICE)/");; esac if echo "$LSROUT" | grep -F " $BASEFILE" | grep "$BLOCKCNT" > /dev/null; then : @@ -1142,9 +1142,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + case x"$fs" in x"zfs"*) - LSROUT=$(run_grubfstest ls -- -la "($GRUBDEVICE)/grub fs@/.");; + LSROUT=$(run_VasEBootfstest ls -- -la "($VasEBootDEVICE)/VasEBoot fs@/.");; *) - LSROUT=$(run_grubfstest ls -- -la "($GRUBDEVICE)/.");; + LSROUT=$(run_VasEBootfstest ls -- -la "($VasEBootDEVICE)/.");; esac if echo "$LSROUT" | grep -F " $BASEFILE" | grep "$BLOCKCNT" > /dev/null; then : @@ -1159,7 +1159,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + x"zfs"*) ;; *) - LSROUT=$(run_grubfstest ls -- -la "($GRUBDEVICE)/.."); + LSROUT=$(run_VasEBootfstest ls -- -la "($VasEBootDEVICE)/.."); if echo "$LSROUT" | grep -F " $BASEFILE" | grep "$BLOCKCNT" > /dev/null; then : else @@ -1173,9 +1173,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + case x"$fs" in x"zfs"*) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/grub fs@/////sdir");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/VasEBoot fs@/////sdir");; *) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/////sdir");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/////sdir");; esac if echo "$LSROUT" | grep -F " 2.img" | grep $BLOCKCNT > /dev/null; then : @@ -1188,9 +1188,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + case x"$fs" in x"zfs"*) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/grub fs@/$PDIR");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/VasEBoot fs@/$PDIR");; *) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/$PDIR");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/$PDIR");; esac if echo "$LSROUT" | grep -F " p.img" | grep $BLOCKCNT > /dev/null; then : @@ -1203,9 +1203,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + case x"$fs" in x"zfs"*) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/grub fs@/sdir/.");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/VasEBoot fs@/sdir/.");; *) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/sdir/.");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/sdir/.");; esac if echo "$LSROUT" | grep -F " 2.img" | grep $BLOCKCNT > /dev/null; then : @@ -1218,9 +1218,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + case x"$fs" in x"zfs"*) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/grub fs@/sdir/../sdir");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/VasEBoot fs@/sdir/../sdir");; *) - LSROUT=$(run_grubfstest ls -- -l "($GRUBDEVICE)/sdir/../sdir");; + LSROUT=$(run_VasEBootfstest ls -- -l "($VasEBootDEVICE)/sdir/../sdir");; esac if echo "$LSROUT" | grep -F " 2.img" | grep $BLOCKCNT > /dev/null; then : @@ -1231,7 +1231,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + exit 1 fi - LSOUT=`run_grubfstest ls -- -l "($GRUBDEVICE)"` + LSOUT=`run_VasEBootfstest ls -- -l "($VasEBootDEVICE)"` if [ x"$NOFSLABEL" = xy ]; then : elif echo "$LSOUT" | grep -F "Label \`$FSLABEL'" > /dev/null; then @@ -1243,7 +1243,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + exit 1 fi - # Inconsistencies between GRUB and blkid. + # Inconsistencies between VasEBoot and blkid. case x"$fs" in x"iso9660" | x"ziso9660" | xrockridge | xjoliet | xrockridge_joliet | x"iso9660_1999" | xrockridge_1999 | xjoliet_1999 | xrockridge_joliet_1999) ;; x"zfs"*) @@ -1259,13 +1259,13 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + esac case x"$fs" in x"hfs"*) - GRUBUUID="`run_grubfstest xnu_uuid "$GRUBDEVICE"`" - if [ x"$GRUBUUID" = x"$FSUUID" ]; then + VasEBootUUID="`run_VasEBootfstest xnu_uuid "$VasEBootDEVICE"`" + if [ x"$VasEBootUUID" = x"$FSUUID" ]; then : else echo UUID FAIL echo "$LSOUT" - echo "$GRUBUUID" + echo "$VasEBootUUID" for ((i=0;i. +# along with VasEBoot. If not, see . # Initialize some variables. prefix="@prefix@" @@ -35,17 +35,17 @@ export PATH usage () { cat <. +Report bugs to . EOF } @@ -56,7 +56,7 @@ for option in "$@"; do usage exit 0 ;; -v | --version) - echo "$0 (GNU GRUB ${PACKAGE_VERSION})" + echo "$0 (GNU VasEBoot ${PACKAGE_VERSION})" exit 0 ;; --modules=*) ms=`echo "$option" | sed -e 's/--modules=//'` @@ -88,14 +88,14 @@ if [ "x${source}" = x ] ; then fi outfile1=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 -"@builddir@/grub-shell" --qemu-opts="${qemuopts}" --modules=${modules} "${source}" >"${outfile1}" +"@builddir@/VasEBoot-shell" --qemu-opts="${qemuopts}" --modules=${modules} "${source}" >"${outfile1}" outfile2=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 bash "${source}" >"${outfile2}" if ! diff -q "${outfile1}" "${outfile2}" >/dev/null then - echo "${source}: GRUB and BASH outputs did not match (see diff -u ${outfile1} ${outfile2})" + echo "${source}: VasEBoot and BASH outputs did not match (see diff -u ${outfile1} ${outfile2})" status=1 else rm -f "${outfile1}" "${outfile2}" diff --git a/tests/util/VasEBoot-shell.in b/tests/util/VasEBoot-shell.in index 814f36c6b..c548a6080 100644 --- a/tests/util/VasEBoot-shell.in +++ b/tests/util/VasEBoot-shell.in @@ -1,21 +1,21 @@ #! /bin/sh set -e -# Run GRUB script in a Qemu instance +# Run VasEBoot script in a Qemu instance # Copyright (C) 2009,2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # Initialize some variables. prefix="@prefix@" @@ -38,7 +38,7 @@ trim=0 usage () { cat <. +Report bugs to . EOF } -. "${builddir}/grub-core/modinfo.sh" -qemuopts="${GRUB_QEMU_OPTS}" +. "${builddir}/VasEBoot-core/modinfo.sh" +qemuopts="${VasEBoot_QEMU_OPTS}" serial_port=com0 serial_null= halt_cmd=halt pseries=n disk="hda " -case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in +case "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" in *-emu) device_map=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 boot=emu console=console disk=0 - # To skip "Welcome to GRUB" and color setttings + # To skip "Welcome to VasEBoot" and color setttings trim=1 serial_port= ;; @@ -209,7 +209,7 @@ for option in "$@"; do usage exit 0 ;; -v | --version) - echo "$0 (GNU GRUB ${PACKAGE_VERSION})" + echo "$0 (GNU VasEBoot ${PACKAGE_VERSION})" exit 0 ;; --trim) trim=1 @@ -240,7 +240,7 @@ for option in "$@"; do qemuopts="$qemuopts $qs" ;; --disk=*) dsk=`echo "$option" | sed -e 's/--disk=//'` - if [ ${grub_modinfo_platform} = emu ]; then + if [ ${VasEBoot_modinfo_platform} = emu ]; then echo "(hd$disk) $dsk" >> "$device_map" disk="$((disk+1))" else @@ -265,10 +265,10 @@ for option in "$@"; do ;; # Intentionally undocumented - --grub-mkimage-extra) + --VasEBoot-mkimage-extra) mkimage_extra_arg="$mkimage_extra_arg `argument $option "$@"`"; shift ;; - --grub-mkimage-extra=*) - mkimage_extra_arg="$mkimage_extra_arg `echo "$option" | sed 's/--grub-mkimage-extra=//'`" ;; + --VasEBoot-mkimage-extra=*) + mkimage_extra_arg="$mkimage_extra_arg `echo "$option" | sed 's/--VasEBoot-mkimage-extra=//'`" ;; --boot=*) dev=`echo "$option" | sed -e 's/--boot=//'` @@ -310,17 +310,17 @@ fi cfgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 cat <${cfgfile} -grubshell=yes +VasEBootshell=yes enable_progress_indicator=0 export enable_progress_indicator EOF -if [ "${grub_modinfo_platform}" != emu ]; then +if [ "${VasEBoot_modinfo_platform}" != emu ]; then echo insmod serial >>${cfgfile} fi -if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ]; then +if [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = powerpc-ieee1275 ]; then echo insmod escc >>${cfgfile} fi if [ "${serial_port}" != "" ]; then @@ -354,36 +354,36 @@ source "\$prefix/testcase.cfg" # Stop serial output to suppress "ACPI shutdown failed" error. EOF # Attempt to switch to console on i386-ieee1275 causes "screen not found" message -if [ x$console != x ] && [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" != xi386-ieee1275 ]; then +if [ x$console != x ] && [ x"${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" != xi386-ieee1275 ]; then echo "terminal_output $console" >>${cfgfile} fi echo "${halt_cmd}" >>${cfgfile} -test -z "$debug" || echo "GRUB script: ${cfgfile}" >&2 -test -z "$debug" || echo "GRUB testcase script: ${tmpfile}" >&2 +test -z "$debug" || echo "VasEBoot script: ${cfgfile}" >&2 +test -z "$debug" || echo "VasEBoot testcase script: ${tmpfile}" >&2 test -z "$debug" || echo "Boot device: ${boot}" >&2 isofile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 -test -z "$debug" || echo "GRUB ISO file: ${isofile}" >&2 -test -z "$debug" || echo "GRUB ROM directory: ${rom_directory}" >&2 +test -z "$debug" || echo "VasEBoot ISO file: ${isofile}" >&2 +test -z "$debug" || echo "VasEBoot ROM directory: ${rom_directory}" >&2 if test -z "$debug"; then qemuopts="${qemuopts} -nographic -monitor file:/dev/null" fi if [ x$boot != xnet ] && [ x$boot != xemu ]; then - pkgdatadir="@builddir@" "@builddir@/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \ + pkgdatadir="@builddir@" "@builddir@/VasEBoot-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/VasEBoot-core" \ --rom-directory="${rom_directory}" \ --locale-directory="@srcdir@/po" \ --themes-directory="@srcdir@/themes" \ $mkimage_extra_arg ${mkrescue_args} \ - "/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \ + "/boot/VasEBoot/VasEBoot.cfg=${cfgfile}" "/boot/VasEBoot/testcase.cfg=${source}" \ ${files} >/dev/null 2>&1 fi if [ x$boot = xhd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then + if [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = arm64-efi ] || [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = arm-efi ]; then device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file=" - elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then + elif [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = mips-arc ]; then device="hdb " else device="hda " @@ -391,9 +391,9 @@ if [ x$boot = xhd ]; then bootdev="-boot c" fi if [ x$boot = xcd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then + if [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = arm64-efi ] || [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = arm-efi ]; then device="device virtio-blk-device,drive=cd0 -drive if=none,id=cd0,media=cdrom,file=" - elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then + elif [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then device="-drive if=ide,media=cdrom,file=" else device="cdrom " @@ -427,19 +427,19 @@ fi if [ x$boot = xcoreboot ]; then imgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 - cp "${GRUB_COREBOOT_ROM}" "${imgfile}" - "${GRUB_CBFSTOOL}" "${imgfile}" add-payload -f "${rom_directory}/coreboot.elf" -n fallback/payload + cp "${VasEBoot_COREBOOT_ROM}" "${imgfile}" + "${VasEBoot_CBFSTOOL}" "${imgfile}" add-payload -f "${rom_directory}/coreboot.elf" -n fallback/payload bootdev="-bios ${imgfile}" device="cdrom " test -z "$debug" || echo "Coreboot image: ${imgfile}" >&2 fi -if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mipsel-arc ]; then +if [ "${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}" = mipsel-arc ]; then case "$boot" in hd) - bootdev="-global ds1225y.filename=$GRUB_QEMU_MAGNUM_NVRAM_DIR/disk" ;; + bootdev="-global ds1225y.filename=$VasEBoot_QEMU_MAGNUM_NVRAM_DIR/disk" ;; *) - bootdev="-global ds1225y.filename=$GRUB_QEMU_MAGNUM_NVRAM_DIR/cdrom";; + bootdev="-global ds1225y.filename=$VasEBoot_QEMU_MAGNUM_NVRAM_DIR/cdrom";; esac fi @@ -470,30 +470,30 @@ copy_extra_files() { if [ x$boot = xnet ]; then netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 - pkgdatadir="@builddir@" "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null - cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" - cp "${source}" "$netdir/boot/grub/testcase.cfg" + pkgdatadir="@builddir@" "@builddir@/VasEBoot-mknetdir" "--VasEBoot-mkimage=${builddir}/VasEBoot-mkimage" "--directory=${builddir}/VasEBoot-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null + cp "${cfgfile}" "$netdir/boot/VasEBoot/VasEBoot.cfg" + cp "${source}" "$netdir/boot/VasEBoot/testcase.cfg" [ -z "$files" ] || copy_extra_files "$netdir" $files - timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim + timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/VasEBoot/${VasEBoot_modinfo_target_cpu}-${VasEBoot_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim elif [ x$boot = xemu ]; then rootdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" - grubdir="$rootdir/boot/grub" - mkdir -p "$grubdir/fonts" - mkdir -p "$grubdir/themes" - mkdir -p "$grubdir/locale" - test -f "@builddir@/"unicode.pf2 && cp "@builddir@/"unicode.pf2 "$grubdir/fonts/unicode.pf2" - cp -R "@srcdir@/themes/starfield" "$grubdir/themes/starfield" + VasEBootdir="$rootdir/boot/VasEBoot" + mkdir -p "$VasEBootdir/fonts" + mkdir -p "$VasEBootdir/themes" + mkdir -p "$VasEBootdir/locale" + test -f "@builddir@/"unicode.pf2 && cp "@builddir@/"unicode.pf2 "$VasEBootdir/fonts/unicode.pf2" + cp -R "@srcdir@/themes/starfield" "$VasEBootdir/themes/starfield" for file in "@srcdir@/po/"*.gmo; do if [ -f "$file" ]; then - cp "$file" "$grubdir/locale/" + cp "$file" "$VasEBootdir/locale/" fi done - cp "${cfgfile}" "$grubdir/grub.cfg" - cp "${source}" "$grubdir/testcase.cfg" + cp "${cfgfile}" "$VasEBootdir/VasEBoot.cfg" + cp "${source}" "$VasEBootdir/testcase.cfg" [ -z "$files" ] || copy_extra_files "$rootdir" $files roottar="$(mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" (cd "$rootdir"; tar cf "$roottar" .) - @builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim + @builddir@/VasEBoot-core/VasEBoot-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/VasEBoot" | tr -d "\r" | do_trim test -n "$debug" || rm -rf "$rootdir" test -n "$debug" || rm -f "$roottar" else diff --git a/tests/xfs_test.in b/tests/xfs_test.in index 3807e2e5c..46dee6782 100644 --- a/tests/xfs_test.in +++ b/tests/xfs_test.in @@ -16,5 +16,5 @@ if ! which mkfs.xfs >/dev/null 2>&1; then fi -"@builddir@/grub-fs-tester" xfs_crc -"@builddir@/grub-fs-tester" xfs +"@builddir@/VasEBoot-fs-tester" xfs_crc +"@builddir@/VasEBoot-fs-tester" xfs diff --git a/tests/xzcompress_test.in b/tests/xzcompress_test.in index b2bd999ec..78bda8a23 100644 --- a/tests/xzcompress_test.in +++ b/tests/xzcompress_test.in @@ -1,29 +1,29 @@ #! /bin/sh # Copyright (C) 2013 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . set -e -grubshell=@builddir@/grub-shell +VasEBootshell=@builddir@/VasEBoot-shell -. "@builddir@/grub-core/modinfo.sh" +. "@builddir@/VasEBoot-core/modinfo.sh" if ! which xz >/dev/null 2>&1; then echo "xz not installed; cannot test xz compression." exit 77 fi -if [ "$(echo hello | "${grubshell}" --mkrescue-arg=--compress=xz)" != "Hello World" ]; then +if [ "$(echo hello | "${VasEBootshell}" --mkrescue-arg=--compress=xz)" != "Hello World" ]; then exit 1 fi diff --git a/tests/zfs_test.in b/tests/zfs_test.in index 047120e47..a9396c4e9 100644 --- a/tests/zfs_test.in +++ b/tests/zfs_test.in @@ -15,13 +15,13 @@ if ! which zpool >/dev/null 2>&1; then exit 77 fi -"@builddir@/grub-fs-tester" zfs -"@builddir@/grub-fs-tester" zfs_lzjb -"@builddir@/grub-fs-tester" zfs_gzip -"@builddir@/grub-fs-tester" zfs_zle -"@builddir@/grub-fs-tester" zfs_raidz3 -"@builddir@/grub-fs-tester" zfs_raidz2 -"@builddir@/grub-fs-tester" zfs_raidz -"@builddir@/grub-fs-tester" zfs_mirror -"@builddir@/grub-fs-tester" zfs_stripe -"@builddir@/grub-fs-tester" zfs_caseins +"@builddir@/VasEBoot-fs-tester" zfs +"@builddir@/VasEBoot-fs-tester" zfs_lzjb +"@builddir@/VasEBoot-fs-tester" zfs_gzip +"@builddir@/VasEBoot-fs-tester" zfs_zle +"@builddir@/VasEBoot-fs-tester" zfs_raidz3 +"@builddir@/VasEBoot-fs-tester" zfs_raidz2 +"@builddir@/VasEBoot-fs-tester" zfs_raidz +"@builddir@/VasEBoot-fs-tester" zfs_mirror +"@builddir@/VasEBoot-fs-tester" zfs_stripe +"@builddir@/VasEBoot-fs-tester" zfs_caseins diff --git a/themes/starfield/README b/themes/starfield/README index 47dec407e..362dd372c 100644 --- a/themes/starfield/README +++ b/themes/starfield/README @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% GRUB2 gfxmenu default theme by Daniel Tschudi % +% VasEBoot2 gfxmenu default theme by Daniel Tschudi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Version history: @@ -8,8 +8,8 @@ Version history: Introduction: - This shall be the default theme for the GRUB2. As the theme format seems to be more stable then before, there is hope that this theme will work - in future version of GRUB2 as well. + This shall be the default theme for the VasEBoot2. As the theme format seems to be more stable then before, there is hope that this theme will work + in future version of VasEBoot2 as well. Usage: diff --git a/themes/starfield/theme.txt b/themes/starfield/theme.txt index 5ec871b5f..b6c5f6ff1 100644 --- a/themes/starfield/theme.txt +++ b/themes/starfield/theme.txt @@ -1,4 +1,4 @@ -# Default theme for GRUB2 +# Default theme for VasEBoot2 # # Copyright (C) 2011 Daniel Tschudi # diff --git a/util/VasEBoot-editenv.c b/util/VasEBoot-editenv.c index 118e89fe5..9a7134d1c 100644 --- a/util/VasEBoot-editenv.c +++ b/util/VasEBoot-editenv.c @@ -1,30 +1,30 @@ -/* grub-editenv.c - tool to edit environment block. */ +/* VasEBoot-editenv.c - tool to edit environment block. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -39,7 +39,7 @@ #include "progname.h" -#define DEFAULT_ENVBLK_PATH DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG +#define DEFAULT_ENVBLK_PATH DEFAULT_DIRECTORY "/" VasEBoot_ENVBLK_DEFCFG static struct argp_option options[] = { {0, 0, 0, OPTION_DOC, N_("Commands:"), 1}, @@ -120,46 +120,46 @@ block, use `rm %s'."), NULL, help_filter, NULL }; -static grub_envblk_t +static VasEBoot_envblk_t open_envblk_file (const char *name) { FILE *fp; char *buf; size_t size; - grub_envblk_t envblk; + VasEBoot_envblk_t envblk; - fp = grub_util_fopen (name, "rb"); + fp = VasEBoot_util_fopen (name, "rb"); if (! fp) { /* Create the file implicitly. */ - grub_util_create_envblk_file (name); - fp = grub_util_fopen (name, "rb"); + VasEBoot_util_create_envblk_file (name); + fp = VasEBoot_util_fopen (name, "rb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), name, + VasEBoot_util_error (_("cannot open `%s': %s"), name, strerror (errno)); } if (fseek (fp, 0, SEEK_END) < 0) - grub_util_error (_("cannot seek `%s': %s"), name, + VasEBoot_util_error (_("cannot seek `%s': %s"), name, strerror (errno)); size = (size_t) ftell (fp); if (fseek (fp, 0, SEEK_SET) < 0) - grub_util_error (_("cannot seek `%s': %s"), name, + VasEBoot_util_error (_("cannot seek `%s': %s"), name, strerror (errno)); buf = xmalloc (size); if (fread (buf, 1, size, fp) != size) - grub_util_error (_("cannot read `%s': %s"), name, + VasEBoot_util_error (_("cannot read `%s': %s"), name, strerror (errno)); fclose (fp); - envblk = grub_envblk_open (buf, size); + envblk = VasEBoot_envblk_open (buf, size); if (! envblk) - grub_util_error ("%s", _("invalid environment block")); + VasEBoot_util_error ("%s", _("invalid environment block")); return envblk; } @@ -175,36 +175,36 @@ print_var (const char *varname, const char *value, static void list_variables (const char *name) { - grub_envblk_t envblk; + VasEBoot_envblk_t envblk; envblk = open_envblk_file (name); - grub_envblk_iterate (envblk, NULL, print_var); - grub_envblk_close (envblk); + VasEBoot_envblk_iterate (envblk, NULL, print_var); + VasEBoot_envblk_close (envblk); } static void -write_envblk (const char *name, grub_envblk_t envblk) +write_envblk (const char *name, VasEBoot_envblk_t envblk) { FILE *fp; - fp = grub_util_fopen (name, "wb"); + fp = VasEBoot_util_fopen (name, "wb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), name, + VasEBoot_util_error (_("cannot open `%s': %s"), name, strerror (errno)); - if (fwrite (grub_envblk_buffer (envblk), 1, grub_envblk_size (envblk), fp) - != grub_envblk_size (envblk)) - grub_util_error (_("cannot write to `%s': %s"), name, + if (fwrite (VasEBoot_envblk_buffer (envblk), 1, VasEBoot_envblk_size (envblk), fp) + != VasEBoot_envblk_size (envblk)) + VasEBoot_util_error (_("cannot write to `%s': %s"), name, strerror (errno)); - grub_util_file_sync (fp); + VasEBoot_util_file_sync (fp); fclose (fp); } static void set_variables (const char *name, int argc, char *argv[]) { - grub_envblk_t envblk; + VasEBoot_envblk_t envblk; envblk = open_envblk_file (name); while (argc) @@ -213,37 +213,37 @@ set_variables (const char *name, int argc, char *argv[]) p = strchr (argv[0], '='); if (! p) - grub_util_error (_("invalid parameter %s"), argv[0]); + VasEBoot_util_error (_("invalid parameter %s"), argv[0]); *(p++) = 0; - if (! grub_envblk_set (envblk, argv[0], p)) - grub_util_error ("%s", _("environment block too small")); + if (! VasEBoot_envblk_set (envblk, argv[0], p)) + VasEBoot_util_error ("%s", _("environment block too small")); argc--; argv++; } write_envblk (name, envblk); - grub_envblk_close (envblk); + VasEBoot_envblk_close (envblk); } static void unset_variables (const char *name, int argc, char *argv[]) { - grub_envblk_t envblk; + VasEBoot_envblk_t envblk; envblk = open_envblk_file (name); while (argc) { - grub_envblk_delete (envblk, argv[0]); + VasEBoot_envblk_delete (envblk, argv[0]); argc--; argv++; } write_envblk (name, envblk); - grub_envblk_close (envblk); + VasEBoot_envblk_close (envblk); } int @@ -253,7 +253,7 @@ main (int argc, char *argv[]) char *command; int curindex, arg_count; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Parse our arguments */ if (argp_parse (&argp, argc, argv, 0, &curindex, 0) != 0) @@ -278,7 +278,7 @@ main (int argc, char *argv[]) } if (strcmp (command, "create") == 0) - grub_util_create_envblk_file (filename); + VasEBoot_util_create_envblk_file (filename); else if (strcmp (command, "list") == 0) list_variables (filename); else if (strcmp (command, "set") == 0) diff --git a/util/VasEBoot-file.c b/util/VasEBoot-file.c index 50c18b683..35a1f29dc 100644 --- a/util/VasEBoot-file.c +++ b/util/VasEBoot-file.c @@ -1,33 +1,33 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -39,9 +39,9 @@ #include "progname.h" -void grub_file_init (void); -void grub_host_init (void); -void grub_hostfs_init (void); +void VasEBoot_file_init (void); +void VasEBoot_host_init (void); +void VasEBoot_hostfs_init (void); int main (int argc, char *argv[]) @@ -49,10 +49,10 @@ main (int argc, char *argv[]) char **argv2; int i; int had_file = 0, had_separator = 0; - grub_command_t cmd; - grub_err_t err; + VasEBoot_command_t cmd; + VasEBoot_err_t err; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); argv2 = xmalloc (argc * sizeof (argv2[0])); @@ -76,11 +76,11 @@ main (int argc, char *argv[]) continue; } if (had_file) - grub_util_error ("one argument expected"); - argv2[i - 1] = grub_canonicalize_file_name (argv[i]); + VasEBoot_util_error ("one argument expected"); + argv2[i - 1] = VasEBoot_canonicalize_file_name (argv[i]); if (!argv2[i - 1]) { - grub_util_error (_("cannot open `%s': %s"), argv[i], + VasEBoot_util_error (_("cannot open `%s': %s"), argv[i], strerror (errno)); } had_file = 1; @@ -88,19 +88,19 @@ main (int argc, char *argv[]) argv2[i - 1] = NULL; /* Initialize all modules. */ - grub_init_all (); - grub_file_init (); - grub_hostfs_init (); - grub_host_init (); + VasEBoot_init_all (); + VasEBoot_file_init (); + VasEBoot_hostfs_init (); + VasEBoot_host_init (); - grub_env_set ("root", "host"); + VasEBoot_env_set ("root", "host"); - cmd = grub_command_find ("file"); + cmd = VasEBoot_command_find ("file"); if (! cmd) - grub_util_error (_("can't find command `%s'"), "file"); + VasEBoot_util_error (_("can't find command `%s'"), "file"); err = (cmd->func) (cmd, argc - 1, argv2); - if (err && err != GRUB_ERR_TEST_FAILURE) - grub_print_error (); + if (err && err != VasEBoot_ERR_TEST_FAILURE) + VasEBoot_print_error (); return err; } diff --git a/util/VasEBoot-fstest.c b/util/VasEBoot-fstest.c index a358ae471..1c3d7286b 100644 --- a/util/VasEBoot-fstest.c +++ b/util/VasEBoot-fstest.c @@ -1,40 +1,40 @@ -/* grub-fstest.c - debug tool for filesystem driver */ +/* VasEBoot-fstest.c - debug tool for filesystem driver */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -47,14 +47,14 @@ #pragma GCC diagnostic error "-Wmissing-prototypes" #pragma GCC diagnostic error "-Wmissing-declarations" -static grub_err_t +static VasEBoot_err_t execute_command (const char *name, int n, char **args) { - grub_command_t cmd; + VasEBoot_command_t cmd; - cmd = grub_command_find (name); + cmd = VasEBoot_command_find (name); if (! cmd) - grub_util_error (_("can't find command `%s'"), name); + VasEBoot_util_error (_("can't find command `%s'"), name); return (cmd->func) (cmd, n, args); } @@ -73,40 +73,40 @@ enum { }; #define BUF_SIZE 32256 -static grub_disk_addr_t skip, leng; +static VasEBoot_disk_addr_t skip, leng; static int uncompress = 0; static void -read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len, void *hook_arg), void *hook_arg) +read_file (char *pathname, int (*hook) (VasEBoot_off_t ofs, char *buf, int len, void *hook_arg), void *hook_arg) { static char buf[BUF_SIZE]; - grub_file_t file; + VasEBoot_file_t file; if ((pathname[0] == '-') && (pathname[1] == 0)) { - grub_device_t dev; + VasEBoot_device_t dev; - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if ((! dev) || (! dev->disk)) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - grub_util_info ("total sectors : %" GRUB_HOST_PRIuLONG_LONG, + VasEBoot_util_info ("total sectors : %" VasEBoot_HOST_PRIuLONG_LONG, (unsigned long long) dev->disk->total_sectors); if (! leng) - leng = (dev->disk->total_sectors << GRUB_DISK_SECTOR_BITS) - skip; + leng = (dev->disk->total_sectors << VasEBoot_DISK_SECTOR_BITS) - skip; while (leng) { - grub_size_t len; + VasEBoot_size_t len; len = (leng > BUF_SIZE) ? BUF_SIZE : leng; - if (grub_disk_read (dev->disk, 0, skip, len, buf)) + if (VasEBoot_disk_read (dev->disk, 0, skip, len, buf)) { - char *msg = grub_xasprintf (_("disk read fails at offset %lld, length %lld"), + char *msg = VasEBoot_xasprintf (_("disk read fails at offset %lld, length %lld"), (long long) skip, (long long) len); - grub_util_error ("%s", msg); + VasEBoot_util_error ("%s", msg); } if (hook (skip, buf, len, hook_arg)) @@ -116,33 +116,33 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len, void leng -= len; } - grub_device_close (dev); + VasEBoot_device_close (dev); return; } if (uncompress == 0) - grub_file_filter_disable_compression (); - file = grub_file_open (pathname); + VasEBoot_file_filter_disable_compression (); + file = VasEBoot_file_open (pathname); if (!file) { - grub_util_error (_("cannot open `%s': %s"), pathname, - grub_errmsg); + VasEBoot_util_error (_("cannot open `%s': %s"), pathname, + VasEBoot_errmsg); return; } - grub_util_info ("file size : %" GRUB_HOST_PRIuLONG_LONG, + VasEBoot_util_info ("file size : %" VasEBoot_HOST_PRIuLONG_LONG, (unsigned long long) file->size); if (skip > file->size) { - char *msg = grub_xasprintf (_("invalid skip value %lld"), + char *msg = VasEBoot_xasprintf (_("invalid skip value %lld"), (unsigned long long) skip); - grub_util_error ("%s", msg); + VasEBoot_util_error ("%s", msg); return; } { - grub_off_t ofs, len; + VasEBoot_off_t ofs, len; ofs = skip; len = file->size - skip; if ((leng) && (leng < len)) @@ -152,14 +152,14 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len, void while (len) { - grub_ssize_t sz; + VasEBoot_ssize_t sz; - sz = grub_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len); + sz = VasEBoot_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len); if (sz < 0) { - char *msg = grub_xasprintf (_("read error at offset %llu: %s"), - (unsigned long long) ofs, grub_errmsg); - grub_util_error ("%s", msg); + char *msg = VasEBoot_xasprintf (_("read error at offset %llu: %s"), + (unsigned long long) ofs, VasEBoot_errmsg); + VasEBoot_util_error ("%s", msg); break; } @@ -171,7 +171,7 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len, void } } - grub_file_close (file); + VasEBoot_file_close (file); } struct cp_hook_ctx @@ -181,14 +181,14 @@ struct cp_hook_ctx }; static int -cp_hook (grub_off_t ofs, char *buf, int len, void *_ctx) +cp_hook (VasEBoot_off_t ofs, char *buf, int len, void *_ctx) { struct cp_hook_ctx *ctx = _ctx; (void) ofs; if ((int) fwrite (buf, 1, len, ctx->ff) != len) { - grub_util_error (_("cannot write to `%s': %s"), + VasEBoot_util_error (_("cannot write to `%s': %s"), ctx->dest, strerror (errno)); return 1; } @@ -204,10 +204,10 @@ cmd_cp (char *src, const char *dest) .dest = dest }; - ctx.ff = grub_util_fopen (dest, "wb"); + ctx.ff = VasEBoot_util_fopen (dest, "wb"); if (ctx.ff == NULL) { - grub_util_error (_("cannot open OS file `%s': %s"), dest, + VasEBoot_util_error (_("cannot open OS file `%s': %s"), dest, strerror (errno)); return; } @@ -216,13 +216,13 @@ cmd_cp (char *src, const char *dest) } static int -cat_hook (grub_off_t ofs, char *buf, int len, void *_arg __attribute__ ((unused))) +cat_hook (VasEBoot_off_t ofs, char *buf, int len, void *_arg __attribute__ ((unused))) { (void) ofs; if ((int) fwrite (buf, 1, len, stdout) != len) { - grub_util_error (_("cannot write to the stdout: %s"), + VasEBoot_util_error (_("cannot write to the stdout: %s"), strerror (errno)); return 1; } @@ -237,28 +237,28 @@ cmd_cat (char *src) } static int -cmp_hook (grub_off_t ofs, char *buf, int len, void *ff_in) +cmp_hook (VasEBoot_off_t ofs, char *buf, int len, void *ff_in) { FILE *ff = ff_in; static char buf_1[BUF_SIZE]; if ((int) fread (buf_1, 1, len, ff) != len) { - char *msg = grub_xasprintf (_("read error at offset %llu: %s"), - (unsigned long long) ofs, grub_errmsg); - grub_util_error ("%s", msg); + char *msg = VasEBoot_xasprintf (_("read error at offset %llu: %s"), + (unsigned long long) ofs, VasEBoot_errmsg); + VasEBoot_util_error ("%s", msg); return 1; } - if (grub_memcmp (buf, buf_1, len) != 0) + if (VasEBoot_memcmp (buf, buf_1, len) != 0) { int i; for (i = 0; i < len; i++, ofs++) if (buf_1[i] != buf[i]) { - char *msg = grub_xasprintf (_("compare fail at offset %llu"), + char *msg = VasEBoot_xasprintf (_("compare fail at offset %llu"), (unsigned long long) ofs); - grub_util_error ("%s", msg); + VasEBoot_util_error ("%s", msg); return 1; } } @@ -271,17 +271,17 @@ cmd_cmp (char *src, char *dest) { FILE *ff; - if (grub_util_is_directory (dest)) + if (VasEBoot_util_is_directory (dest)) { - grub_util_fd_dir_t dir = grub_util_fd_opendir (dest); - grub_util_fd_dirent_t entry; + VasEBoot_util_fd_dir_t dir = VasEBoot_util_fd_opendir (dest); + VasEBoot_util_fd_dirent_t entry; if (dir == NULL) { - grub_util_error (_("OS file %s open error: %s"), dest, - grub_util_fd_strerror ()); + VasEBoot_util_error (_("OS file %s open error: %s"), dest, + VasEBoot_util_fd_strerror ()); return; } - while ((entry = grub_util_fd_readdir (dir))) + while ((entry = VasEBoot_util_fd_readdir (dir))) { char *srcnew, *destnew; char *ptr; @@ -292,48 +292,48 @@ cmd_cmp (char *src, char *dest) + strlen (entry->d_name)); destnew = xmalloc (strlen (dest) + sizeof ("/") + strlen (entry->d_name)); - ptr = grub_stpcpy (srcnew, src); + ptr = VasEBoot_stpcpy (srcnew, src); *ptr++ = '/'; strcpy (ptr, entry->d_name); - ptr = grub_stpcpy (destnew, dest); + ptr = VasEBoot_stpcpy (destnew, dest); *ptr++ = '/'; strcpy (ptr, entry->d_name); - if (grub_util_is_special_file (destnew)) + if (VasEBoot_util_is_special_file (destnew)) continue; cmd_cmp (srcnew, destnew); } - grub_util_fd_closedir (dir); + VasEBoot_util_fd_closedir (dir); return; } - ff = grub_util_fopen (dest, "rb"); + ff = VasEBoot_util_fopen (dest, "rb"); if (ff == NULL) { - grub_util_error (_("OS file %s open error: %s"), dest, + VasEBoot_util_error (_("OS file %s open error: %s"), dest, strerror (errno)); return; } if ((skip) && (fseeko (ff, skip, SEEK_SET))) - grub_util_error (_("cannot seek `%s': %s"), dest, + VasEBoot_util_error (_("cannot seek `%s': %s"), dest, strerror (errno)); read_file (src, cmp_hook, ff); { - grub_uint64_t pre; + VasEBoot_uint64_t pre; pre = ftell (ff); fseek (ff, 0, SEEK_END); if (pre != ftell (ff)) - grub_util_error ("%s", _("unexpected end of file")); + VasEBoot_util_error ("%s", _("unexpected end of file")); } fclose (ff); } static int -hex_hook (grub_off_t ofs, char *buf, int len, void *arg __attribute__ ((unused))) +hex_hook (VasEBoot_off_t ofs, char *buf, int len, void *arg __attribute__ ((unused))) { hexdump (ofs, buf, len); return 0; @@ -346,24 +346,24 @@ cmd_hex (char *pathname) } static int -crc_hook (grub_off_t ofs, char *buf, int len, void *crc_ctx) +crc_hook (VasEBoot_off_t ofs, char *buf, int len, void *crc_ctx) { (void) ofs; - GRUB_MD_CRC32->write(crc_ctx, buf, len); + VasEBoot_MD_CRC32->write(crc_ctx, buf, len); return 0; } static void cmd_crc (char *pathname) { - grub_uint8_t *crc32_context = xmalloc (GRUB_MD_CRC32->contextsize); - GRUB_MD_CRC32->init(crc32_context); + VasEBoot_uint8_t *crc32_context = xmalloc (VasEBoot_MD_CRC32->contextsize); + VasEBoot_MD_CRC32->init(crc32_context); read_file (pathname, crc_hook, crc32_context); - GRUB_MD_CRC32->final(crc32_context); + VasEBoot_MD_CRC32->final(crc32_context); printf ("%08x\n", - grub_be_to_cpu32 (grub_get_unaligned32 (GRUB_MD_CRC32->read (crc32_context)))); + VasEBoot_be_to_cpu32 (VasEBoot_get_unaligned32 (VasEBoot_MD_CRC32->read (crc32_context)))); free (crc32_context); } @@ -387,22 +387,22 @@ fstest (int n) for (i = 0; i < num_disks; i++) { char *argv[2]; - loop_name = grub_xasprintf ("loop%d", i); + loop_name = VasEBoot_xasprintf ("loop%d", i); if (!loop_name) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - host_file = grub_xasprintf ("(host)%s", images[i]); + host_file = VasEBoot_xasprintf ("(host)%s", images[i]); if (!host_file) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); argv[0] = loop_name; argv[1] = host_file; if (execute_command ("loopback", 2, argv)) - grub_util_error (_("`loopback' command fails: %s"), grub_errmsg); + VasEBoot_util_error (_("`loopback' command fails: %s"), VasEBoot_errmsg); - grub_free (loop_name); - grub_free (host_file); + VasEBoot_free (loop_name); + VasEBoot_free (host_file); } { @@ -410,22 +410,22 @@ fstest (int n) { char *argv[2] = { xstrdup ("-a"), NULL}; if (execute_command ("cryptomount", 1, argv)) - grub_util_error (_("`cryptomount' command fails: %s"), - grub_errmsg); + VasEBoot_util_error (_("`cryptomount' command fails: %s"), + VasEBoot_errmsg); free (argv[0]); } } - grub_ldm_fini (); - grub_lvm_fini (); - grub_mdraid09_fini (); - grub_mdraid1x_fini (); - grub_diskfilter_fini (); - grub_diskfilter_init (); - grub_mdraid09_init (); - grub_mdraid1x_init (); - grub_lvm_init (); - grub_ldm_init (); + VasEBoot_ldm_fini (); + VasEBoot_lvm_fini (); + VasEBoot_mdraid09_fini (); + VasEBoot_mdraid1x_fini (); + VasEBoot_diskfilter_fini (); + VasEBoot_diskfilter_init (); + VasEBoot_mdraid09_init (); + VasEBoot_mdraid1x_init (); + VasEBoot_lvm_init (); + VasEBoot_ldm_init (); switch (cmd) { @@ -452,35 +452,35 @@ fstest (int n) break; case CMD_BLOCKLIST: execute_command ("blocklist", n, args); - grub_printf ("\n"); + VasEBoot_printf ("\n"); break; case CMD_TESTLOAD: execute_command ("testload", n, args); - grub_printf ("\n"); + VasEBoot_printf ("\n"); break; case CMD_XNU_UUID: { - grub_device_t dev; - grub_fs_t fs; + VasEBoot_device_t dev; + VasEBoot_fs_t fs; char *uuid = 0; char *argv[3] = { xstrdup ("-l"), NULL, NULL}; - dev = grub_device_open (n ? args[0] : 0); + dev = VasEBoot_device_open (n ? args[0] : 0); if (!dev) - grub_util_error ("%s", grub_errmsg); - fs = grub_fs_probe (dev); + VasEBoot_util_error ("%s", VasEBoot_errmsg); + fs = VasEBoot_fs_probe (dev); if (!fs) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); if (!fs->uuid) - grub_util_error ("%s", _("couldn't retrieve UUID")); + VasEBoot_util_error ("%s", _("couldn't retrieve UUID")); if (fs->uuid (dev, &uuid)) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); if (!uuid) - grub_util_error ("%s", _("couldn't retrieve UUID")); + VasEBoot_util_error ("%s", _("couldn't retrieve UUID")); argv[1] = uuid; execute_command ("xnu_uuid", 2, argv); - grub_free (argv[0]); - grub_free (uuid); - grub_device_close (dev); + VasEBoot_free (argv[0]); + VasEBoot_free (uuid); + VasEBoot_device_close (dev); } } @@ -488,17 +488,17 @@ fstest (int n) { char *argv[2]; - loop_name = grub_xasprintf ("loop%d", i); + loop_name = VasEBoot_xasprintf ("loop%d", i); if (!loop_name) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); argv[0] = xstrdup ("-d"); argv[1] = loop_name; execute_command ("loopback", 2, argv); - grub_free (loop_name); - grub_free (argv[0]); + VasEBoot_free (loop_name); + VasEBoot_free (argv[0]); } } @@ -550,18 +550,18 @@ argp_parser (int key, char *arg, struct argp_state *state) if (strcmp (arg, "prompt") == 0) { char buf[1024]; - grub_puts_ (N_("Enter ZFS password: ")); - if (grub_password_get (buf, 1023)) + VasEBoot_puts_ (N_("Enter ZFS password: ")); + if (VasEBoot_password_get (buf, 1023)) { - grub_zfs_add_key ((grub_uint8_t *) buf, grub_strlen (buf), 1); + VasEBoot_zfs_add_key ((VasEBoot_uint8_t *) buf, VasEBoot_strlen (buf), 1); } } else { FILE *f; ssize_t real_size; - grub_uint8_t buf[1024]; - f = grub_util_fopen (arg, "rb"); + VasEBoot_uint8_t buf[1024]; + f = VasEBoot_util_fopen (arg, "rb"); if (!f) { printf (_("%s: error:"), program_name); @@ -578,7 +578,7 @@ argp_parser (int key, char *arg, struct argp_state *state) printf ("\n"); return 0; } - grub_zfs_add_key (buf, real_size, 0); + VasEBoot_zfs_add_key (buf, real_size, 0); } return 0; @@ -587,19 +587,19 @@ argp_parser (int key, char *arg, struct argp_state *state) return 0; case 's': - skip = grub_strtoul (arg, &p, 0); + skip = VasEBoot_strtoul (arg, &p, 0); if (*p == 's') - skip <<= GRUB_DISK_SECTOR_BITS; + skip <<= VasEBoot_DISK_SECTOR_BITS; return 0; case 'n': - leng = grub_strtoul (arg, &p, 0); + leng = VasEBoot_strtoul (arg, &p, 0); if (*p == 's') - leng <<= GRUB_DISK_SECTOR_BITS; + leng <<= VasEBoot_DISK_SECTOR_BITS; return 0; case 'c': - num_disks = grub_strtoul (arg, NULL, 0); + num_disks = VasEBoot_strtoul (arg, NULL, 0); if (num_disks < 1) { fprintf (stderr, "%s", _("Invalid disk count.\n")); @@ -651,57 +651,57 @@ argp_parser (int key, char *arg, struct argp_state *state) { if (args_count == 0) images = xmalloc (num_disks * sizeof (images[0])); - images[args_count] = grub_canonicalize_file_name (arg); + images[args_count] = VasEBoot_canonicalize_file_name (arg); args_count++; return 0; } if (args_count == num_disks) { - if (!grub_strcmp (arg, "ls")) + if (!VasEBoot_strcmp (arg, "ls")) { cmd = CMD_LS; } - else if (!grub_strcmp (arg, "zfsinfo")) + else if (!VasEBoot_strcmp (arg, "zfsinfo")) { cmd = CMD_ZFSINFO; } - else if (!grub_strcmp (arg, "cp")) + else if (!VasEBoot_strcmp (arg, "cp")) { cmd = CMD_CP; nparm = 2; } - else if (!grub_strcmp (arg, "cat")) + else if (!VasEBoot_strcmp (arg, "cat")) { cmd = CMD_CAT; nparm = 1; } - else if (!grub_strcmp (arg, "cmp")) + else if (!VasEBoot_strcmp (arg, "cmp")) { cmd = CMD_CMP; nparm = 2; } - else if (!grub_strcmp (arg, "hex")) + else if (!VasEBoot_strcmp (arg, "hex")) { cmd = CMD_HEX; nparm = 1; } - else if (!grub_strcmp (arg, "crc")) + else if (!VasEBoot_strcmp (arg, "crc")) { cmd = CMD_CRC; nparm = 1; } - else if (!grub_strcmp (arg, "blocklist")) + else if (!VasEBoot_strcmp (arg, "blocklist")) { cmd = CMD_BLOCKLIST; nparm = 1; } - else if (!grub_strcmp (arg, "testload")) + else if (!VasEBoot_strcmp (arg, "testload")) { cmd = CMD_TESTLOAD; nparm = 1; } - else if (grub_strcmp (arg, "xnu_uuid") == 0) + else if (VasEBoot_strcmp (arg, "xnu_uuid") == 0) { cmd = CMD_XNU_UUID; nparm = 0; @@ -732,18 +732,18 @@ main (int argc, char *argv[]) const char *default_root; char *alloc_root; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); args = xmalloc (argc * sizeof (args[0])); argp_parse (&argp, argc, argv, 0, 0, 0); /* Initialize all modules. */ - grub_init_all (); - grub_gcry_init_all (); + VasEBoot_init_all (); + VasEBoot_gcry_init_all (); if (debug_str) - grub_env_set ("debug", debug_str); + VasEBoot_env_set ("debug", debug_str); default_root = (num_disks == 1) ? "loop0" : "md0"; alloc_root = 0; @@ -760,7 +760,7 @@ main (int argc, char *argv[]) else root = default_root; - grub_env_set ("root", root); + VasEBoot_env_set ("root", root); if (alloc_root) free (alloc_root); @@ -769,8 +769,8 @@ main (int argc, char *argv[]) fstest (args_count - 1 - num_disks); /* Free resources. */ - grub_gcry_fini_all (); - grub_fini_all (); + VasEBoot_gcry_fini_all (); + VasEBoot_fini_all (); return 0; } diff --git a/util/VasEBoot-gen-asciih.c b/util/VasEBoot-gen-asciih.c index e35dcb78f..52d663714 100644 --- a/util/VasEBoot-gen-asciih.c +++ b/util/VasEBoot-gen-asciih.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -34,11 +34,11 @@ #define FT_ERROR_END_LIST }; #include FT_ERRORS_H -#define GRUB_FONT_DEFAULT_SIZE 16 +#define VasEBoot_FONT_DEFAULT_SIZE 16 #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) -struct grub_glyph_info +struct VasEBoot_glyph_info { int width; int height; @@ -68,7 +68,7 @@ add_pixel (unsigned char **data, int *mask, int not_blank) static void add_glyph (FT_UInt glyph_idx, FT_Face face, unsigned int char_code, - struct grub_glyph_info *glyph_info) + struct VasEBoot_glyph_info *glyph_info) { int width, height; int cuttop, cutbottom, cutleft, cutright; @@ -105,7 +105,7 @@ add_glyph (FT_UInt glyph_idx, FT_Face face, glyph_info->bitmap = malloc (bitmap_size); if (!glyph_info->bitmap) { - fprintf (stderr, "grub-gen-asciih: error: out of memory"); + fprintf (stderr, "VasEBoot-gen-asciih: error: out of memory"); exit (1); } glyph_info->bitmap_size = bitmap_size; @@ -137,7 +137,7 @@ write_font_ascii_bitmap (FILE *file, FT_Face face) for (char_code = 0; char_code <= 0x7f; char_code++) { FT_UInt glyph_idx; - struct grub_glyph_info glyph; + struct VasEBoot_glyph_info glyph; glyph_idx = FT_Get_Char_Index (face, char_code); if (!glyph_idx) @@ -196,13 +196,13 @@ main (int argc, char *argv[]) if (argc != 3) { - fprintf (stderr, "grub-gen-asciih: usage: INPUT OUTPUT"); + fprintf (stderr, "VasEBoot-gen-asciih: usage: INPUT OUTPUT"); return 1; } if (FT_Init_FreeType (&ft_lib)) { - fprintf (stderr, "grub-gen-asciih: error: FT_Init_FreeType fails"); + fprintf (stderr, "VasEBoot-gen-asciih: error: FT_Init_FreeType fails"); return 1; } @@ -225,13 +225,13 @@ main (int argc, char *argv[]) if ((ft_face->face_flags & FT_FACE_FLAG_SCALABLE) || (! ft_face->num_fixed_sizes)) - size = GRUB_FONT_DEFAULT_SIZE; + size = VasEBoot_FONT_DEFAULT_SIZE; else size = ft_face->available_sizes[0].height; if (FT_Set_Pixel_Sizes (ft_face, size, size)) { - fprintf (stderr, "grub-gen-asciih: error: can't set %dx%d font size", size, size); + fprintf (stderr, "VasEBoot-gen-asciih: error: can't set %dx%d font size", size, size); return 1; } } @@ -239,7 +239,7 @@ main (int argc, char *argv[]) file = fopen (argv[2], "w"); if (! file) { - fprintf (stderr, "grub-gen-asciih: error: cannot write to `%s': %s", argv[2], + fprintf (stderr, "VasEBoot-gen-asciih: error: cannot write to `%s': %s", argv[2], strerror (errno)); return 1; } diff --git a/util/VasEBoot-gen-widthspec.c b/util/VasEBoot-gen-widthspec.c index 33bc8cb2d..4084ae253 100644 --- a/util/VasEBoot-gen-widthspec.c +++ b/util/VasEBoot-gen-widthspec.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -34,7 +34,7 @@ #define FT_ERROR_END_LIST }; #include FT_ERRORS_H -#define GRUB_FONT_DEFAULT_SIZE 16 +#define VasEBoot_FONT_DEFAULT_SIZE 16 #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) @@ -79,13 +79,13 @@ main (int argc, char *argv[]) if (argc != 3) { - fprintf (stderr, "grub-gen-widthspec: usage: INPUT OUTPUT"); + fprintf (stderr, "VasEBoot-gen-widthspec: usage: INPUT OUTPUT"); return 1; } if (FT_Init_FreeType (&ft_lib)) { - fprintf (stderr, "grub-gen-widthspec: error: FT_Init_FreeType fails"); + fprintf (stderr, "VasEBoot-gen-widthspec: error: FT_Init_FreeType fails"); return 1; } @@ -110,13 +110,13 @@ main (int argc, char *argv[]) if ((ft_face->face_flags & FT_FACE_FLAG_SCALABLE) || (! ft_face->num_fixed_sizes)) - size = GRUB_FONT_DEFAULT_SIZE; + size = VasEBoot_FONT_DEFAULT_SIZE; else size = ft_face->available_sizes[0].height; if (FT_Set_Pixel_Sizes (ft_face, size, size)) { - fprintf (stderr, "grub-gen-widthspec: error: can't set %dx%d font size", size, size); + fprintf (stderr, "VasEBoot-gen-widthspec: error: can't set %dx%d font size", size, size); return 1; } @@ -133,7 +133,7 @@ main (int argc, char *argv[]) file = fopen (argv[2], "w"); if (! file) { - fprintf (stderr, "grub-gen-asciih: error: cannot write to `%s': %s", argv[2], + fprintf (stderr, "VasEBoot-gen-asciih: error: cannot write to `%s': %s", argv[2], strerror (errno)); return 1; } diff --git a/util/VasEBoot-glue-efi.c b/util/VasEBoot-glue-efi.c index 07fa43030..d657019ff 100644 --- a/util/VasEBoot-glue-efi.c +++ b/util/VasEBoot-glue-efi.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -101,7 +101,7 @@ main (int argc, char *argv[]) { struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Check for options. */ memset (&arguments, 0, sizeof (struct arguments)); @@ -117,7 +117,7 @@ main (int argc, char *argv[]) exit(1); } - grub_util_glue_efi (arguments.input32, + VasEBoot_util_glue_efi (arguments.input32, arguments.input64, arguments.output); diff --git a/util/VasEBoot-install-common.c b/util/VasEBoot-install-common.c index 452b230da..84be39e38 100644 --- a/util/VasEBoot-install-common.c +++ b/util/VasEBoot-install-common.c @@ -1,43 +1,43 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,22 +48,22 @@ #pragma GCC diagnostic ignored "-Wformat-nonliteral" char * -grub_install_help_filter (int key, const char *text, +VasEBoot_install_help_filter (int key, const char *text, void *input __attribute__ ((unused))) { switch (key) { - case GRUB_INSTALL_OPTIONS_INSTALL_THEMES: + case VasEBoot_INSTALL_OPTIONS_INSTALL_THEMES: return xasprintf(text, "starfield"); - case GRUB_INSTALL_OPTIONS_INSTALL_FONTS: + case VasEBoot_INSTALL_OPTIONS_INSTALL_FONTS: return xasprintf(text, "unicode"); - case GRUB_INSTALL_OPTIONS_DIRECTORY: - case GRUB_INSTALL_OPTIONS_DIRECTORY2: - return xasprintf(text, grub_util_get_pkglibdir ()); - case GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY: - return xasprintf(text, grub_util_get_localedir ()); - case GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY: - return grub_util_path_concat (2, grub_util_get_pkgdatadir (), "themes"); + case VasEBoot_INSTALL_OPTIONS_DIRECTORY: + case VasEBoot_INSTALL_OPTIONS_DIRECTORY2: + return xasprintf(text, VasEBoot_util_get_pkglibdir ()); + case VasEBoot_INSTALL_OPTIONS_LOCALE_DIRECTORY: + return xasprintf(text, VasEBoot_util_get_localedir ()); + case VasEBoot_INSTALL_OPTIONS_THEMES_DIRECTORY: + return VasEBoot_util_path_concat (2, VasEBoot_util_get_pkgdatadir (), "themes"); default: return (char *) text; } @@ -72,78 +72,78 @@ grub_install_help_filter (int key, const char *text, #pragma GCC diagnostic error "-Wformat-nonliteral" static int (*compress_func) (const char *src, const char *dest) = NULL; -char *grub_install_copy_buffer; +char *VasEBoot_install_copy_buffer; int -grub_install_copy_file (const char *src, +VasEBoot_install_copy_file (const char *src, const char *dst, int is_needed) { - grub_util_fd_t in, out; + VasEBoot_util_fd_t in, out; ssize_t r; - grub_util_info ("copying `%s' -> `%s'", src, dst); + VasEBoot_util_info ("copying `%s' -> `%s'", src, dst); - in = grub_util_fd_open (src, GRUB_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID (in)) + in = VasEBoot_util_fd_open (src, VasEBoot_UTIL_FD_O_RDONLY); + if (!VasEBoot_UTIL_FD_IS_VALID (in)) { if (is_needed) - grub_util_error (_("cannot open `%s': %s"), src, grub_util_fd_strerror ()); + VasEBoot_util_error (_("cannot open `%s': %s"), src, VasEBoot_util_fd_strerror ()); else - grub_util_info (_("cannot open `%s': %s"), src, grub_util_fd_strerror ()); + VasEBoot_util_info (_("cannot open `%s': %s"), src, VasEBoot_util_fd_strerror ()); return 0; } - out = grub_util_fd_open (dst, GRUB_UTIL_FD_O_WRONLY - | GRUB_UTIL_FD_O_CREATTRUNC); - if (!GRUB_UTIL_FD_IS_VALID (out)) + out = VasEBoot_util_fd_open (dst, VasEBoot_UTIL_FD_O_WRONLY + | VasEBoot_UTIL_FD_O_CREATTRUNC); + if (!VasEBoot_UTIL_FD_IS_VALID (out)) { - grub_util_error (_("cannot open `%s': %s"), dst, - grub_util_fd_strerror ()); - grub_util_fd_close (in); + VasEBoot_util_error (_("cannot open `%s': %s"), dst, + VasEBoot_util_fd_strerror ()); + VasEBoot_util_fd_close (in); return 0; } - if (!grub_install_copy_buffer) - grub_install_copy_buffer = xmalloc (GRUB_INSTALL_COPY_BUFFER_SIZE); + if (!VasEBoot_install_copy_buffer) + VasEBoot_install_copy_buffer = xmalloc (VasEBoot_INSTALL_COPY_BUFFER_SIZE); while (1) { - r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE); + r = VasEBoot_util_fd_read (in, VasEBoot_install_copy_buffer, VasEBoot_INSTALL_COPY_BUFFER_SIZE); if (r <= 0) break; - grub_util_fd_write (out, grub_install_copy_buffer, r); + VasEBoot_util_fd_write (out, VasEBoot_install_copy_buffer, r); } - grub_util_fd_sync (out); - grub_util_fd_close (in); - grub_util_fd_close (out); + VasEBoot_util_fd_sync (out); + VasEBoot_util_fd_close (in); + VasEBoot_util_fd_close (out); if (r < 0) - grub_util_error (_("cannot copy `%s' to `%s': %s"), - src, dst, grub_util_fd_strerror ()); + VasEBoot_util_error (_("cannot copy `%s' to `%s': %s"), + src, dst, VasEBoot_util_fd_strerror ()); return 1; } static int -grub_install_compress_file (const char *in_name, +VasEBoot_install_compress_file (const char *in_name, const char *out_name, int is_needed) { int ret; if (!compress_func) - ret = grub_install_copy_file (in_name, out_name, is_needed); + ret = VasEBoot_install_copy_file (in_name, out_name, is_needed); else { - grub_util_info ("compressing `%s' -> `%s'", in_name, out_name); + VasEBoot_util_info ("compressing `%s' -> `%s'", in_name, out_name); ret = !compress_func (in_name, out_name); if (!ret && is_needed) - grub_util_warn (_("can't compress `%s' to `%s'"), in_name, out_name); + VasEBoot_util_warn (_("can't compress `%s' to `%s'"), in_name, out_name); } if (!ret && is_needed) - grub_util_error (_("cannot copy `%s' to `%s': %s"), - in_name, out_name, grub_util_fd_strerror ()); + VasEBoot_util_error (_("cannot copy `%s' to `%s': %s"), + in_name, out_name, VasEBoot_util_fd_strerror ()); return ret; } @@ -161,7 +161,7 @@ is_path_separator (char c) } void -grub_install_mkdir_p (const char *dst) +VasEBoot_install_mkdir_p (const char *dst) { char *t = xstrdup (dst); char *p; @@ -171,26 +171,26 @@ grub_install_mkdir_p (const char *dst) { char s = *p; *p = '\0'; - grub_util_mkdir (t); + VasEBoot_util_mkdir (t); *p = s; } } - grub_util_mkdir (t); + VasEBoot_util_mkdir (t); free (t); } static void -clean_grub_dir (const char *di) +clean_VasEBoot_dir (const char *di) { - grub_util_fd_dir_t d; - grub_util_fd_dirent_t de; + VasEBoot_util_fd_dir_t d; + VasEBoot_util_fd_dirent_t de; - d = grub_util_fd_opendir (di); + d = VasEBoot_util_fd_opendir (di); if (!d) - grub_util_error (_("cannot open directory `%s': %s"), - di, grub_util_fd_strerror ()); + VasEBoot_util_error (_("cannot open directory `%s': %s"), + di, VasEBoot_util_fd_strerror ()); - while ((de = grub_util_fd_readdir (d))) + while ((de = VasEBoot_util_fd_readdir (d))) { const char *ext = strrchr (de->d_name, '.'); if ((ext && (strcmp (ext, ".mod") == 0 @@ -201,14 +201,14 @@ clean_grub_dir (const char *di) || strcmp (de->d_name, "efiemu32.o") == 0 || strcmp (de->d_name, "efiemu64.o") == 0) { - char *x = grub_util_path_concat (2, di, de->d_name); - if (grub_util_unlink (x) < 0) - grub_util_error (_("cannot delete `%s': %s"), x, - grub_util_fd_strerror ()); + char *x = VasEBoot_util_path_concat (2, di, de->d_name); + if (VasEBoot_util_unlink (x) < 0) + VasEBoot_util_error (_("cannot delete `%s': %s"), x, + VasEBoot_util_fd_strerror ()); free (x); } } - grub_util_fd_closedir (d); + VasEBoot_util_fd_closedir (d); } struct install_list @@ -224,12 +224,12 @@ struct install_list modules = { 1, 0, 0, 0 }; struct install_list install_locales = { 1, 0, 0, 0 }; struct install_list install_fonts = { 1, 0, 0, 0 }; struct install_list install_themes = { 1, 0, 0, 0 }; -char *grub_install_source_directory = NULL; -char *grub_install_locale_directory = NULL; -char *grub_install_themes_directory = NULL; +char *VasEBoot_install_source_directory = NULL; +char *VasEBoot_install_locale_directory = NULL; +char *VasEBoot_install_themes_directory = NULL; void -grub_install_push_module (const char *val) +VasEBoot_install_push_module (const char *val) { modules.is_default = 0; if (modules.n_entries + 1 >= modules.n_alloc) @@ -245,7 +245,7 @@ grub_install_push_module (const char *val) } void -grub_install_pop_module (void) +VasEBoot_install_pop_module (void) { modules.n_entries--; free (modules.entries[modules.n_entries]); @@ -271,11 +271,11 @@ handle_install_list (struct install_list *il, const char *val, ptr = val; while (1) { - while (*ptr && grub_isspace (*ptr)) + while (*ptr && VasEBoot_isspace (*ptr)) ptr++; if (!*ptr) break; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; il->n_entries++; } @@ -285,12 +285,12 @@ handle_install_list (struct install_list *il, const char *val, for (ce = il->entries; ; ce++) { const char *bptr; - while (*ptr && grub_isspace (*ptr)) + while (*ptr && VasEBoot_isspace (*ptr)) ptr++; if (!*ptr) break; bptr = ptr; - while (*ptr && !grub_isspace (*ptr)) + while (*ptr && !VasEBoot_isspace (*ptr)) ptr++; *ce = xmalloc (ptr - bptr + 1); memcpy (*ce, bptr, ptr - bptr); @@ -301,29 +301,29 @@ handle_install_list (struct install_list *il, const char *val, static char **pubkeys; static size_t npubkeys; -static grub_compression_t compression; +static VasEBoot_compression_t compression; int -grub_install_parse (int key, char *arg) +VasEBoot_install_parse (int key, char *arg) { switch (key) { case 'C': - if (grub_strcmp (arg, "xz") == 0) + if (VasEBoot_strcmp (arg, "xz") == 0) { #ifdef HAVE_LIBLZMA - compression = GRUB_COMPRESSION_XZ; + compression = VasEBoot_COMPRESSION_XZ; #else - grub_util_error ("%s", - _("grub-mkimage is compiled without XZ support")); + VasEBoot_util_error ("%s", + _("VasEBoot-mkimage is compiled without XZ support")); #endif } - else if (grub_strcmp (arg, "none") == 0) - compression = GRUB_COMPRESSION_NONE; - else if (grub_strcmp (arg, "auto") == 0) - compression = GRUB_COMPRESSION_AUTO; + else if (VasEBoot_strcmp (arg, "none") == 0) + compression = VasEBoot_COMPRESSION_NONE; + else if (VasEBoot_strcmp (arg, "auto") == 0) + compression = VasEBoot_COMPRESSION_AUTO; else - grub_util_error (_("Unknown compression format %s"), arg); + VasEBoot_util_error (_("Unknown compression format %s"), arg); return 1; case 'k': pubkeys = xrealloc (pubkeys, @@ -332,39 +332,39 @@ grub_install_parse (int key, char *arg) pubkeys[npubkeys++] = xstrdup (arg); return 1; - case GRUB_INSTALL_OPTIONS_VERBOSITY: + case VasEBoot_INSTALL_OPTIONS_VERBOSITY: verbosity++; return 1; - case GRUB_INSTALL_OPTIONS_DIRECTORY: - case GRUB_INSTALL_OPTIONS_DIRECTORY2: - free (grub_install_source_directory); - grub_install_source_directory = xstrdup (arg); + case VasEBoot_INSTALL_OPTIONS_DIRECTORY: + case VasEBoot_INSTALL_OPTIONS_DIRECTORY2: + free (VasEBoot_install_source_directory); + VasEBoot_install_source_directory = xstrdup (arg); return 1; - case GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY: - free (grub_install_locale_directory); - grub_install_locale_directory = xstrdup (arg); + case VasEBoot_INSTALL_OPTIONS_LOCALE_DIRECTORY: + free (VasEBoot_install_locale_directory); + VasEBoot_install_locale_directory = xstrdup (arg); return 1; - case GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY: - free (grub_install_themes_directory); - grub_install_themes_directory = xstrdup (arg); + case VasEBoot_INSTALL_OPTIONS_THEMES_DIRECTORY: + free (VasEBoot_install_themes_directory); + VasEBoot_install_themes_directory = xstrdup (arg); return 1; - case GRUB_INSTALL_OPTIONS_INSTALL_MODULES: + case VasEBoot_INSTALL_OPTIONS_INSTALL_MODULES: handle_install_list (&install_modules, arg, 0); return 1; - case GRUB_INSTALL_OPTIONS_MODULES: + case VasEBoot_INSTALL_OPTIONS_MODULES: handle_install_list (&modules, arg, 0); return 1; - case GRUB_INSTALL_OPTIONS_INSTALL_LOCALES: + case VasEBoot_INSTALL_OPTIONS_INSTALL_LOCALES: handle_install_list (&install_locales, arg, 0); return 1; - case GRUB_INSTALL_OPTIONS_INSTALL_THEMES: + case VasEBoot_INSTALL_OPTIONS_INSTALL_THEMES: handle_install_list (&install_themes, arg, 0); return 1; - case GRUB_INSTALL_OPTIONS_INSTALL_FONTS: + case VasEBoot_INSTALL_OPTIONS_INSTALL_FONTS: handle_install_list (&install_fonts, arg, 0); return 1; - case GRUB_INSTALL_OPTIONS_INSTALL_COMPRESS: + case VasEBoot_INSTALL_OPTIONS_INSTALL_COMPRESS: if (strcmp (arg, "no") == 0 || strcmp (arg, "none") == 0) { @@ -373,21 +373,21 @@ grub_install_parse (int key, char *arg) } if (strcmp (arg, "gz") == 0) { - compress_func = grub_install_compress_gzip; + compress_func = VasEBoot_install_compress_gzip; return 1; } if (strcmp (arg, "xz") == 0) { - compress_func = grub_install_compress_xz; + compress_func = VasEBoot_install_compress_xz; return 1; } if (strcmp (arg, "lzo") == 0) { - compress_func = grub_install_compress_lzop; + compress_func = VasEBoot_install_compress_lzop; return 1; } - grub_util_error (_("Unrecognized compression `%s'"), arg); - case GRUB_INSTALL_OPTIONS_GRUB_MKIMAGE: + VasEBoot_util_error (_("Unrecognized compression `%s'"), arg); + case VasEBoot_INSTALL_OPTIONS_VasEBoot_MKIMAGE: return 1; default: return 0; @@ -397,79 +397,79 @@ grub_install_parse (int key, char *arg) static int decompressors (void) { - if (compress_func == grub_install_compress_gzip) + if (compress_func == VasEBoot_install_compress_gzip) { - grub_install_push_module ("gzio"); + VasEBoot_install_push_module ("gzio"); return 1; } - if (compress_func == grub_install_compress_xz) + if (compress_func == VasEBoot_install_compress_xz) { - grub_install_push_module ("xzio"); - grub_install_push_module ("gcry_crc"); + VasEBoot_install_push_module ("xzio"); + VasEBoot_install_push_module ("gcry_crc"); return 2; } - if (compress_func == grub_install_compress_lzop) + if (compress_func == VasEBoot_install_compress_lzop) { - grub_install_push_module ("lzopio"); - grub_install_push_module ("adler32"); - grub_install_push_module ("gcry_crc"); + VasEBoot_install_push_module ("lzopio"); + VasEBoot_install_push_module ("adler32"); + VasEBoot_install_push_module ("gcry_crc"); return 3; } return 0; } void -grub_install_make_image_wrap_file (const char *dir, const char *prefix, +VasEBoot_install_make_image_wrap_file (const char *dir, const char *prefix, FILE *fp, const char *outname, char *memdisk_path, char *config_path, const char *mkimage_target, int note) { - const struct grub_install_image_target_desc *tgt; + const struct VasEBoot_install_image_target_desc *tgt; const char *const compnames[] = { - [GRUB_COMPRESSION_AUTO] = "auto", - [GRUB_COMPRESSION_NONE] = "none", - [GRUB_COMPRESSION_XZ] = "xz", - [GRUB_COMPRESSION_LZMA] = "lzma", + [VasEBoot_COMPRESSION_AUTO] = "auto", + [VasEBoot_COMPRESSION_NONE] = "none", + [VasEBoot_COMPRESSION_XZ] = "xz", + [VasEBoot_COMPRESSION_LZMA] = "lzma", }; - grub_size_t slen = 1; + VasEBoot_size_t slen = 1; char *s, *p; char **pk, **md; int dc = decompressors (); if (memdisk_path) - slen += 20 + grub_strlen (memdisk_path); + slen += 20 + VasEBoot_strlen (memdisk_path); if (config_path) - slen += 20 + grub_strlen (config_path); + slen += 20 + VasEBoot_strlen (config_path); for (pk = pubkeys; pk < pubkeys + npubkeys; pk++) - slen += 20 + grub_strlen (*pk); + slen += 20 + VasEBoot_strlen (*pk); for (md = modules.entries; *md; md++) { - slen += 10 + grub_strlen (*md); + slen += 10 + VasEBoot_strlen (*md); } p = s = xmalloc (slen); if (memdisk_path) { - p = grub_stpcpy (p, "--memdisk '"); - p = grub_stpcpy (p, memdisk_path); + p = VasEBoot_stpcpy (p, "--memdisk '"); + p = VasEBoot_stpcpy (p, memdisk_path); *p++ = '\''; *p++ = ' '; } if (config_path) { - p = grub_stpcpy (p, "--config '"); - p = grub_stpcpy (p, config_path); + p = VasEBoot_stpcpy (p, "--config '"); + p = VasEBoot_stpcpy (p, config_path); *p++ = '\''; *p++ = ' '; } for (pk = pubkeys; pk < pubkeys + npubkeys; pk++) { - p = grub_stpcpy (p, "--pubkey '"); - p = grub_stpcpy (p, *pk); + p = VasEBoot_stpcpy (p, "--pubkey '"); + p = VasEBoot_stpcpy (p, *pk); *p++ = '\''; *p++ = ' '; } @@ -477,14 +477,14 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, for (md = modules.entries; *md; md++) { *p++ = '\''; - p = grub_stpcpy (p, *md); + p = VasEBoot_stpcpy (p, *md); *p++ = '\''; *p++ = ' '; } *p = '\0'; - grub_util_info ("grub-mkimage --directory '%s' --prefix '%s'" + VasEBoot_util_info ("VasEBoot-mkimage --directory '%s' --prefix '%s'" " --output '%s' " "--format '%s' --compression '%s' %s %s\n", dir, prefix, @@ -492,34 +492,34 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, compnames[compression], note ? "--note" : "", s); free (s); - tgt = grub_install_get_image_target (mkimage_target); + tgt = VasEBoot_install_get_image_target (mkimage_target); if (!tgt) - grub_util_error (_("unknown target format %s"), mkimage_target); + VasEBoot_util_error (_("unknown target format %s"), mkimage_target); - grub_install_generate_image (dir, prefix, fp, outname, + VasEBoot_install_generate_image (dir, prefix, fp, outname, modules.entries, memdisk_path, pubkeys, npubkeys, config_path, tgt, note, compression); while (dc--) - grub_install_pop_module (); + VasEBoot_install_pop_module (); } void -grub_install_make_image_wrap (const char *dir, const char *prefix, +VasEBoot_install_make_image_wrap (const char *dir, const char *prefix, const char *outname, char *memdisk_path, char *config_path, const char *mkimage_target, int note) { FILE *fp; - fp = grub_util_fopen (outname, "wb"); + fp = VasEBoot_util_fopen (outname, "wb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), outname, + VasEBoot_util_error (_("cannot open `%s': %s"), outname, strerror (errno)); - grub_install_make_image_wrap_file (dir, prefix, fp, outname, + VasEBoot_install_make_image_wrap_file (dir, prefix, fp, outname, memdisk_path, config_path, mkimage_target, note); - grub_util_file_sync (fp); + VasEBoot_util_file_sync (fp); fclose (fp); } @@ -529,87 +529,87 @@ copy_by_ext (const char *srcd, const char *extf, int req) { - grub_util_fd_dir_t d; - grub_util_fd_dirent_t de; + VasEBoot_util_fd_dir_t d; + VasEBoot_util_fd_dirent_t de; - d = grub_util_fd_opendir (srcd); + d = VasEBoot_util_fd_opendir (srcd); if (!d && !req) return; if (!d) - grub_util_error (_("cannot open directory `%s': %s"), - srcd, grub_util_fd_strerror ()); + VasEBoot_util_error (_("cannot open directory `%s': %s"), + srcd, VasEBoot_util_fd_strerror ()); - while ((de = grub_util_fd_readdir (d))) + while ((de = VasEBoot_util_fd_readdir (d))) { const char *ext = strrchr (de->d_name, '.'); if (ext && strcmp (ext, extf) == 0) { - char *srcf = grub_util_path_concat (2, srcd, de->d_name); - char *dstf = grub_util_path_concat (2, dstd, de->d_name); - grub_install_compress_file (srcf, dstf, 1); + char *srcf = VasEBoot_util_path_concat (2, srcd, de->d_name); + char *dstf = VasEBoot_util_path_concat (2, dstd, de->d_name); + VasEBoot_install_compress_file (srcf, dstf, 1); free (srcf); free (dstf); } } - grub_util_fd_closedir (d); + VasEBoot_util_fd_closedir (d); } static void copy_all (const char *srcd, const char *dstd) { - grub_util_fd_dir_t d; - grub_util_fd_dirent_t de; + VasEBoot_util_fd_dir_t d; + VasEBoot_util_fd_dirent_t de; - d = grub_util_fd_opendir (srcd); + d = VasEBoot_util_fd_opendir (srcd); if (!d) - grub_util_error (_("cannot open directory `%s': %s"), - srcd, grub_util_fd_strerror ()); + VasEBoot_util_error (_("cannot open directory `%s': %s"), + srcd, VasEBoot_util_fd_strerror ()); - while ((de = grub_util_fd_readdir (d))) + while ((de = VasEBoot_util_fd_readdir (d))) { char *srcf; char *dstf; if (strcmp (de->d_name, ".") == 0 || strcmp (de->d_name, "..") == 0) continue; - srcf = grub_util_path_concat (2, srcd, de->d_name); - if (grub_util_is_special_file (srcf) - || grub_util_is_directory (srcf)) + srcf = VasEBoot_util_path_concat (2, srcd, de->d_name); + if (VasEBoot_util_is_special_file (srcf) + || VasEBoot_util_is_directory (srcf)) continue; - dstf = grub_util_path_concat (2, dstd, de->d_name); - grub_install_compress_file (srcf, dstf, 1); + dstf = VasEBoot_util_path_concat (2, dstd, de->d_name); + VasEBoot_install_compress_file (srcf, dstf, 1); free (srcf); free (dstf); } - grub_util_fd_closedir (d); + VasEBoot_util_fd_closedir (d); } static const char * get_localedir (void) { - if (grub_install_locale_directory) - return grub_install_locale_directory; + if (VasEBoot_install_locale_directory) + return VasEBoot_install_locale_directory; else - return grub_util_get_localedir (); + return VasEBoot_util_get_localedir (); } static void copy_locales (const char *dstd) { - grub_util_fd_dir_t d; - grub_util_fd_dirent_t de; + VasEBoot_util_fd_dir_t d; + VasEBoot_util_fd_dirent_t de; const char *locale_dir = get_localedir (); - d = grub_util_fd_opendir (locale_dir); + d = VasEBoot_util_fd_opendir (locale_dir); if (!d) { - grub_util_warn (_("cannot open directory `%s': %s"), - locale_dir, grub_util_fd_strerror ()); + VasEBoot_util_warn (_("cannot open directory `%s': %s"), + locale_dir, VasEBoot_util_fd_strerror ()); return; } - while ((de = grub_util_fd_readdir (d))) + while ((de = VasEBoot_util_fd_readdir (d))) { char *srcf; char *dstf; @@ -618,58 +618,58 @@ copy_locales (const char *dstd) continue; if (strcmp (de->d_name, "..") == 0) continue; - ext = grub_strrchr (de->d_name, '.'); - if (ext && (grub_strcmp (ext, ".mo") == 0 - || grub_strcmp (ext, ".gmo") == 0)) + ext = VasEBoot_strrchr (de->d_name, '.'); + if (ext && (VasEBoot_strcmp (ext, ".mo") == 0 + || VasEBoot_strcmp (ext, ".gmo") == 0)) { - srcf = grub_util_path_concat (2, locale_dir, de->d_name); - dstf = grub_util_path_concat (2, dstd, de->d_name); - ext = grub_strrchr (dstf, '.'); - grub_strcpy (ext, ".mo"); + srcf = VasEBoot_util_path_concat (2, locale_dir, de->d_name); + dstf = VasEBoot_util_path_concat (2, dstd, de->d_name); + ext = VasEBoot_strrchr (dstf, '.'); + VasEBoot_strcpy (ext, ".mo"); } else { - srcf = grub_util_path_concat_ext (4, locale_dir, de->d_name, + srcf = VasEBoot_util_path_concat_ext (4, locale_dir, de->d_name, "LC_MESSAGES", PACKAGE, ".mo"); - dstf = grub_util_path_concat_ext (2, dstd, de->d_name, ".mo"); + dstf = VasEBoot_util_path_concat_ext (2, dstd, de->d_name, ".mo"); } - grub_install_compress_file (srcf, dstf, 0); + VasEBoot_install_compress_file (srcf, dstf, 0); free (srcf); free (dstf); } - grub_util_fd_closedir (d); + VasEBoot_util_fd_closedir (d); } static struct { const char *cpu; const char *platform; -} platforms[GRUB_INSTALL_PLATFORM_MAX] = +} platforms[VasEBoot_INSTALL_PLATFORM_MAX] = { - [GRUB_INSTALL_PLATFORM_I386_PC] = { "i386", "pc" }, - [GRUB_INSTALL_PLATFORM_I386_EFI] = { "i386", "efi" }, - [GRUB_INSTALL_PLATFORM_I386_QEMU] = { "i386", "qemu" }, - [GRUB_INSTALL_PLATFORM_I386_COREBOOT] = { "i386", "coreboot" }, - [GRUB_INSTALL_PLATFORM_I386_MULTIBOOT] = { "i386", "multiboot" }, - [GRUB_INSTALL_PLATFORM_I386_IEEE1275] = { "i386", "ieee1275" }, - [GRUB_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64", "efi" }, - [GRUB_INSTALL_PLATFORM_I386_XEN] = { "i386", "xen" }, - [GRUB_INSTALL_PLATFORM_X86_64_XEN] = { "x86_64", "xen" }, - [GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON] = { "mipsel", "loongson" }, - [GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS] = { "mipsel", "qemu_mips" }, - [GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS] = { "mips", "qemu_mips" }, - [GRUB_INSTALL_PLATFORM_MIPSEL_ARC] = { "mipsel", "arc" }, - [GRUB_INSTALL_PLATFORM_MIPS_ARC] = { "mips", "arc" }, - [GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64", "ieee1275" }, - [GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc", "ieee1275" }, - [GRUB_INSTALL_PLATFORM_IA64_EFI] = { "ia64", "efi" }, - [GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm", "efi" }, - [GRUB_INSTALL_PLATFORM_ARM64_EFI] = { "arm64", "efi" }, - [GRUB_INSTALL_PLATFORM_ARM_UBOOT] = { "arm", "uboot" }, + [VasEBoot_INSTALL_PLATFORM_I386_PC] = { "i386", "pc" }, + [VasEBoot_INSTALL_PLATFORM_I386_EFI] = { "i386", "efi" }, + [VasEBoot_INSTALL_PLATFORM_I386_QEMU] = { "i386", "qemu" }, + [VasEBoot_INSTALL_PLATFORM_I386_COREBOOT] = { "i386", "coreboot" }, + [VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT] = { "i386", "multiboot" }, + [VasEBoot_INSTALL_PLATFORM_I386_IEEE1275] = { "i386", "ieee1275" }, + [VasEBoot_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64", "efi" }, + [VasEBoot_INSTALL_PLATFORM_I386_XEN] = { "i386", "xen" }, + [VasEBoot_INSTALL_PLATFORM_X86_64_XEN] = { "x86_64", "xen" }, + [VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON] = { "mipsel", "loongson" }, + [VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS] = { "mipsel", "qemu_mips" }, + [VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS] = { "mips", "qemu_mips" }, + [VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC] = { "mipsel", "arc" }, + [VasEBoot_INSTALL_PLATFORM_MIPS_ARC] = { "mips", "arc" }, + [VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64", "ieee1275" }, + [VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc", "ieee1275" }, + [VasEBoot_INSTALL_PLATFORM_IA64_EFI] = { "ia64", "efi" }, + [VasEBoot_INSTALL_PLATFORM_ARM_EFI] = { "arm", "efi" }, + [VasEBoot_INSTALL_PLATFORM_ARM64_EFI] = { "arm64", "efi" }, + [VasEBoot_INSTALL_PLATFORM_ARM_UBOOT] = { "arm", "uboot" }, }; char * -grub_install_get_platforms_string (void) +VasEBoot_install_get_platforms_string (void) { char **arr = xmalloc (sizeof (char *) * ARRAY_SIZE (platforms)); int platform_strins_len = 0; @@ -683,7 +683,7 @@ grub_install_get_platforms_string (void) platform_strins_len += strlen (arr[i]) + 2; } ptr = platforms_string = xmalloc (platform_strins_len); - qsort (arr, ARRAY_SIZE (platforms), sizeof (char *), grub_qsort_strcmp); + qsort (arr, ARRAY_SIZE (platforms), sizeof (char *), VasEBoot_qsort_strcmp); for (i = 0; i < ARRAY_SIZE (platforms); i++) { strcpy (ptr, arr[i]); @@ -699,56 +699,56 @@ grub_install_get_platforms_string (void) } char * -grub_install_get_platform_name (enum grub_install_plat platid) +VasEBoot_install_get_platform_name (enum VasEBoot_install_plat platid) { return xasprintf ("%s-%s", platforms[platid].cpu, platforms[platid].platform); } const char * -grub_install_get_platform_cpu (enum grub_install_plat platid) +VasEBoot_install_get_platform_cpu (enum VasEBoot_install_plat platid) { return platforms[platid].cpu; } const char * -grub_install_get_platform_platform (enum grub_install_plat platid) +VasEBoot_install_get_platform_platform (enum VasEBoot_install_plat platid) { return platforms[platid].platform; } void -grub_install_copy_files (const char *src, +VasEBoot_install_copy_files (const char *src, const char *dst, - enum grub_install_plat platid) + enum VasEBoot_install_plat platid) { char *dst_platform, *dst_locale, *dst_fonts; - const char *pkgdatadir = grub_util_get_pkgdatadir (); + const char *pkgdatadir = VasEBoot_util_get_pkgdatadir (); char *themes_dir; { char *platform; platform = xasprintf ("%s-%s", platforms[platid].cpu, platforms[platid].platform); - dst_platform = grub_util_path_concat (2, dst, platform); + dst_platform = VasEBoot_util_path_concat (2, dst, platform); free (platform); } - dst_locale = grub_util_path_concat (2, dst, "locale"); - dst_fonts = grub_util_path_concat (2, dst, "fonts"); - grub_install_mkdir_p (dst_platform); - grub_install_mkdir_p (dst_locale); - clean_grub_dir (dst); - clean_grub_dir (dst_platform); - clean_grub_dir (dst_locale); + dst_locale = VasEBoot_util_path_concat (2, dst, "locale"); + dst_fonts = VasEBoot_util_path_concat (2, dst, "fonts"); + VasEBoot_install_mkdir_p (dst_platform); + VasEBoot_install_mkdir_p (dst_locale); + clean_VasEBoot_dir (dst); + clean_VasEBoot_dir (dst_platform); + clean_VasEBoot_dir (dst_locale); if (install_modules.is_default) copy_by_ext (src, dst_platform, ".mod", 1); else { - struct grub_util_path_list *path_list, *p; + struct VasEBoot_util_path_list *path_list, *p; - path_list = grub_util_resolve_dependencies (src, "moddep.lst", + path_list = VasEBoot_util_resolve_dependencies (src, "moddep.lst", install_modules.entries); for (p = path_list; p; p = p->next) { @@ -756,17 +756,17 @@ grub_install_copy_files (const char *src, const char *dir; char *dstf; - dir = grub_strrchr (srcf, '/'); + dir = VasEBoot_strrchr (srcf, '/'); if (dir) dir++; else dir = srcf; - dstf = grub_util_path_concat (2, dst_platform, dir); - grub_install_compress_file (srcf, dstf, 1); + dstf = VasEBoot_util_path_concat (2, dst_platform, dir); + VasEBoot_install_compress_file (srcf, dstf, 1); free (dstf); } - grub_util_free_path_list (path_list); + VasEBoot_util_free_path_list (path_list); } const char *pkglib_DATA[] = {"efiemu32.o", "efiemu64.o", @@ -779,19 +779,19 @@ grub_install_copy_files (const char *src, for (i = 0; i < ARRAY_SIZE (pkglib_DATA); i++) { - char *srcf = grub_util_path_concat (2, src, pkglib_DATA[i]); - char *dstf = grub_util_path_concat (2, dst_platform, pkglib_DATA[i]); + char *srcf = VasEBoot_util_path_concat (2, src, pkglib_DATA[i]); + char *dstf = VasEBoot_util_path_concat (2, dst_platform, pkglib_DATA[i]); if (i == 0 || i == 1) - grub_install_compress_file (srcf, dstf, 0); + VasEBoot_install_compress_file (srcf, dstf, 0); else - grub_install_compress_file (srcf, dstf, 1); + VasEBoot_install_compress_file (srcf, dstf, 1); free (srcf); free (dstf); } if (install_locales.is_default) { - char *srcd = grub_util_path_concat (2, src, "po"); + char *srcd = VasEBoot_util_path_concat (2, src, "po"); copy_by_ext (srcd, dst_locale, ".mo", 0); copy_locales (dst_locale); free (srcd); @@ -802,33 +802,33 @@ grub_install_copy_files (const char *src, for (i = 0; i < install_locales.n_entries; i++) { - char *srcf = grub_util_path_concat_ext (3, src, + char *srcf = VasEBoot_util_path_concat_ext (3, src, "po", install_locales.entries[i], ".mo"); - char *dstf = grub_util_path_concat_ext (2, dst_locale, + char *dstf = VasEBoot_util_path_concat_ext (2, dst_locale, install_locales.entries[i], ".mo"); - if (grub_install_compress_file (srcf, dstf, 0)) + if (VasEBoot_install_compress_file (srcf, dstf, 0)) { free (srcf); free (dstf); continue; } free (srcf); - srcf = grub_util_path_concat_ext (4, + srcf = VasEBoot_util_path_concat_ext (4, locale_dir, install_locales.entries[i], "LC_MESSAGES", PACKAGE, ".mo"); - if (grub_install_compress_file (srcf, dstf, 0)) + if (VasEBoot_install_compress_file (srcf, dstf, 0)) { free (srcf); free (dstf); continue; } - grub_util_error (_("cannot find locale `%s'"), + VasEBoot_util_error (_("cannot find locale `%s'"), install_locales.entries[i]); } } @@ -842,24 +842,24 @@ grub_install_copy_files (const char *src, install_themes.entries[1] = NULL; } - if (grub_install_themes_directory) - themes_dir = xstrdup (grub_install_themes_directory); + if (VasEBoot_install_themes_directory) + themes_dir = xstrdup (VasEBoot_install_themes_directory); else - themes_dir = grub_util_path_concat (2, grub_util_get_pkgdatadir (), + themes_dir = VasEBoot_util_path_concat (2, VasEBoot_util_get_pkgdatadir (), "themes"); for (i = 0; i < install_themes.n_entries; i++) { - char *srcf = grub_util_path_concat (3, themes_dir, + char *srcf = VasEBoot_util_path_concat (3, themes_dir, install_themes.entries[i], "theme.txt"); - if (grub_util_is_regular (srcf)) + if (VasEBoot_util_is_regular (srcf)) { - char *srcd = grub_util_path_concat (2, themes_dir, + char *srcd = VasEBoot_util_path_concat (2, themes_dir, install_themes.entries[i]); - char *dstd = grub_util_path_concat (3, dst, "themes", + char *dstd = VasEBoot_util_path_concat (3, dst, "themes", install_themes.entries[i]); - grub_install_mkdir_p (dstd); + VasEBoot_install_mkdir_p (dstd); copy_all (srcd, dstd); free (srcd); free (dstd); @@ -878,18 +878,18 @@ grub_install_copy_files (const char *src, install_fonts.entries[1] = NULL; } - grub_install_mkdir_p (dst_fonts); + VasEBoot_install_mkdir_p (dst_fonts); for (i = 0; i < install_fonts.n_entries; i++) { - char *srcf = grub_util_path_concat_ext (2, pkgdatadir, + char *srcf = VasEBoot_util_path_concat_ext (2, pkgdatadir, install_fonts.entries[i], ".pf2"); - char *dstf = grub_util_path_concat_ext (2, dst_fonts, + char *dstf = VasEBoot_util_path_concat_ext (2, dst_fonts, install_fonts.entries[i], ".pf2"); - grub_install_compress_file (srcf, dstf, 0); + VasEBoot_install_compress_file (srcf, dstf, 0); free (srcf); free (dstf); } @@ -899,36 +899,36 @@ grub_install_copy_files (const char *src, free (dst_fonts); } -enum grub_install_plat -grub_install_get_target (const char *src) +enum VasEBoot_install_plat +VasEBoot_install_get_target (const char *src) { char *fn; - grub_util_fd_t f; + VasEBoot_util_fd_t f; char buf[8192]; ssize_t r; char *c, *pl, *p; size_t i; - fn = grub_util_path_concat (2, src, "modinfo.sh"); - f = grub_util_fd_open (fn, GRUB_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID (f)) - grub_util_error (_("%s doesn't exist. Please specify --target or --directory"), + fn = VasEBoot_util_path_concat (2, src, "modinfo.sh"); + f = VasEBoot_util_fd_open (fn, VasEBoot_UTIL_FD_O_RDONLY); + if (!VasEBoot_UTIL_FD_IS_VALID (f)) + VasEBoot_util_error (_("%s doesn't exist. Please specify --target or --directory"), fn); - r = grub_util_fd_read (f, buf, sizeof (buf) - 1); + r = VasEBoot_util_fd_read (f, buf, sizeof (buf) - 1); if (r < 0) - grub_util_error (_("cannot read `%s': %s"), fn, strerror (errno)); - grub_util_fd_close (f); + VasEBoot_util_error (_("cannot read `%s': %s"), fn, strerror (errno)); + VasEBoot_util_fd_close (f); buf[r] = '\0'; - c = strstr (buf, "grub_modinfo_target_cpu="); - if (!c || (c != buf && !grub_isspace (*(c-1)))) - grub_util_error (_("invalid modinfo file `%s'"), fn); - pl = strstr (buf, "grub_modinfo_platform="); - if (!pl || (pl != buf && !grub_isspace (*(pl-1)))) - grub_util_error (_("invalid modinfo file `%s'"), fn); - c += sizeof ("grub_modinfo_target_cpu=") - 1; - pl += sizeof ("grub_modinfo_platform=") - 1; - for (p = c; *p && !grub_isspace (*p); p++); + c = strstr (buf, "VasEBoot_modinfo_target_cpu="); + if (!c || (c != buf && !VasEBoot_isspace (*(c-1)))) + VasEBoot_util_error (_("invalid modinfo file `%s'"), fn); + pl = strstr (buf, "VasEBoot_modinfo_platform="); + if (!pl || (pl != buf && !VasEBoot_isspace (*(pl-1)))) + VasEBoot_util_error (_("invalid modinfo file `%s'"), fn); + c += sizeof ("VasEBoot_modinfo_target_cpu=") - 1; + pl += sizeof ("VasEBoot_modinfo_platform=") - 1; + for (p = c; *p && !VasEBoot_isspace (*p); p++); *p = '\0'; - for (p = pl; *p && !grub_isspace (*p); p++); + for (p = pl; *p && !VasEBoot_isspace (*p); p++); *p = '\0'; for (i = 0; i < ARRAY_SIZE (platforms); i++) @@ -938,37 +938,37 @@ grub_install_get_target (const char *src) free (fn); return i; } - grub_util_error (_("Unknown platform `%s-%s'"), c, pl); + VasEBoot_util_error (_("Unknown platform `%s-%s'"), c, pl); } void -grub_util_unlink_recursive (const char *name) +VasEBoot_util_unlink_recursive (const char *name) { - grub_util_fd_dir_t d; - grub_util_fd_dirent_t de; + VasEBoot_util_fd_dir_t d; + VasEBoot_util_fd_dirent_t de; - d = grub_util_fd_opendir (name); + d = VasEBoot_util_fd_opendir (name); - while ((de = grub_util_fd_readdir (d))) + while ((de = VasEBoot_util_fd_readdir (d))) { char *fp; if (strcmp (de->d_name, ".") == 0) continue; if (strcmp (de->d_name, "..") == 0) continue; - fp = grub_util_path_concat (2, name, de->d_name); - if (grub_util_is_special_file (fp)) + fp = VasEBoot_util_path_concat (2, name, de->d_name); + if (VasEBoot_util_is_special_file (fp)) { free (fp); continue; } - if (grub_util_is_regular (fp)) - grub_util_unlink (fp); - else if (grub_util_is_directory (fp)) - grub_util_unlink_recursive (fp); + if (VasEBoot_util_is_regular (fp)) + VasEBoot_util_unlink (fp); + else if (VasEBoot_util_is_directory (fp)) + VasEBoot_util_unlink_recursive (fp); free (fp); } - grub_util_rmdir (name); - grub_util_fd_closedir (d); + VasEBoot_util_rmdir (name); + VasEBoot_util_fd_closedir (d); } diff --git a/util/VasEBoot-install.c b/util/VasEBoot-install.c index 9074d3e9e..176f13b14 100644 --- a/util/VasEBoot-install.c +++ b/util/VasEBoot-install.c @@ -1,47 +1,47 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -117,7 +117,7 @@ static int fs_probe = 1; static error_t argp_parser (int key, char *arg, struct argp_state *state) { - if (grub_install_parse (key, arg)) + if (VasEBoot_install_parse (key, arg)) return 0; switch (key) { @@ -129,7 +129,7 @@ argp_parser (int key, char *arg, struct argp_state *state) return 0; case OPTION_SETUP: - if (!grub_strstr (arg, "setup")) + if (!VasEBoot_strstr (arg, "setup")) install_bootsector = 0; return 0; @@ -235,7 +235,7 @@ argp_parser (int key, char *arg, struct argp_state *state) case ARGP_KEY_ARG: if (install_device) - grub_util_error ("%s", _("More than one install device?")); + VasEBoot_util_error ("%s", _("More than one install device?")); install_device = xstrdup (arg); return 0; @@ -246,21 +246,21 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp_option options[] = { - GRUB_INSTALL_OPTIONS, + VasEBoot_INSTALL_OPTIONS, {"boot-directory", OPTION_BOOT_DIRECTORY, N_("DIR"), - 0, N_("install GRUB images under the directory DIR/%s instead of the %s directory"), 2}, + 0, N_("install VasEBoot images under the directory DIR/%s instead of the %s directory"), 2}, {"root-directory", OPTION_ROOT_DIRECTORY, N_("DIR"), OPTION_HIDDEN, 0, 2}, {"font", OPTION_FONT, N_("FILE"), OPTION_HIDDEN, 0, 2}, {"target", OPTION_TARGET, N_("TARGET"), /* TRANSLATORS: "TARGET" as in "target platform". */ - 0, N_("install GRUB for TARGET platform [default=%s]; available targets: %s"), 2}, - {"grub-setup", OPTION_SETUP, "FILE", OPTION_HIDDEN, 0, 2}, - {"grub-mkrelpath", OPTION_MKRELPATH, "FILE", OPTION_HIDDEN, 0, 2}, - {"grub-mkdevicemap", OPTION_MKDEVICEMAP, "FILE", OPTION_HIDDEN, 0, 2}, - {"grub-probe", OPTION_PROBE, "FILE", OPTION_HIDDEN, 0, 2}, - {"grub-editenv", OPTION_EDITENV, "FILE", OPTION_HIDDEN, 0, 2}, + 0, N_("install VasEBoot for TARGET platform [default=%s]; available targets: %s"), 2}, + {"VasEBoot-setup", OPTION_SETUP, "FILE", OPTION_HIDDEN, 0, 2}, + {"VasEBoot-mkrelpath", OPTION_MKRELPATH, "FILE", OPTION_HIDDEN, 0, 2}, + {"VasEBoot-mkdevicemap", OPTION_MKDEVICEMAP, "FILE", OPTION_HIDDEN, 0, 2}, + {"VasEBoot-probe", OPTION_PROBE, "FILE", OPTION_HIDDEN, 0, 2}, + {"VasEBoot-editenv", OPTION_EDITENV, "FILE", OPTION_HIDDEN, 0, 2}, {"allow-floppy", OPTION_ALLOW_FLOPPY, 0, 0, /* TRANSLATORS: "may break" doesn't just mean that option wouldn't have any effect but that it will make the resulting install unbootable from HDD. */ @@ -323,7 +323,7 @@ get_default_platform (void) #elif defined (__aarch64__) return "arm64-efi"; #elif defined (__amd64__) || defined (__x86_64__) || defined (__i386__) - return grub_install_get_default_x86_platform (); + return VasEBoot_install_get_default_x86_platform (); #else return NULL; #endif @@ -337,19 +337,19 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) switch (key) { case OPTION_BOOT_DIRECTORY: - return xasprintf (text, GRUB_DIR_NAME, GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME); + return xasprintf (text, VasEBoot_DIR_NAME, VasEBoot_BOOT_DIR_NAME "/" VasEBoot_DIR_NAME); case OPTION_TARGET: { - char *plats = grub_install_get_platforms_string (); + char *plats = VasEBoot_install_get_platforms_string (); char *ret; ret = xasprintf (text, get_default_platform (), plats); free (plats); return ret; } case ARGP_KEY_HELP_POST_DOC: - return xasprintf (text, program_name, GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME); + return xasprintf (text, program_name, VasEBoot_BOOT_DIR_NAME "/" VasEBoot_DIR_NAME); default: - return grub_install_help_filter (key, text, input); + return VasEBoot_install_help_filter (key, text, input); } } @@ -359,30 +359,30 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) install to. */ struct argp argp = { options, argp_parser, N_("[OPTION] [INSTALL_DEVICE]"), - N_("Install GRUB on your drive.")"\v" + N_("Install VasEBoot on your drive.")"\v" N_("INSTALL_DEVICE must be system device filename.\n" - "%s copies GRUB images into %s. On some platforms, it" - " may also install GRUB into the boot sector."), + "%s copies VasEBoot images into %s. On some platforms, it" + " may also install VasEBoot into the boot sector."), NULL, help_filter, NULL }; static int -probe_raid_level (grub_disk_t disk) +probe_raid_level (VasEBoot_disk_t disk) { /* disk might be NULL in the case of a LVM physical volume with no LVM signature. Ignore such cases here. */ if (!disk) return -1; - if (disk->dev->id != GRUB_DISK_DEVICE_DISKFILTER_ID) + if (disk->dev->id != VasEBoot_DISK_DEVICE_DISKFILTER_ID) return -1; if (disk->name[0] != 'm' || disk->name[1] != 'd') return -1; - if (!((struct grub_diskfilter_lv *) disk->data)->segments) + if (!((struct VasEBoot_diskfilter_lv *) disk->data)->segments) return -1; - return ((struct grub_diskfilter_lv *) disk->data)->segments->type; + return ((struct VasEBoot_diskfilter_lv *) disk->data)->segments->type; } static void @@ -392,51 +392,51 @@ push_partmap_module (const char *map, void *data __attribute__ ((unused))) if (strcmp (map, "openbsd") == 0 || strcmp (map, "netbsd") == 0) { - grub_install_push_module ("part_bsd"); + VasEBoot_install_push_module ("part_bsd"); return; } snprintf (buf, sizeof (buf), "part_%s", map); - grub_install_push_module (buf); + VasEBoot_install_push_module (buf); } static void push_cryptodisk_module (const char *mod, void *data __attribute__ ((unused))) { - grub_install_push_module (mod); + VasEBoot_install_push_module (mod); } static void -probe_mods (grub_disk_t disk) +probe_mods (VasEBoot_disk_t disk) { - grub_partition_t part; - grub_disk_memberlist_t list = NULL, tmp; + VasEBoot_partition_t part; + VasEBoot_disk_memberlist_t list = NULL, tmp; int raid_level; if (disk->partition == NULL) - grub_util_info ("no partition map found for %s", disk->name); + VasEBoot_util_info ("no partition map found for %s", disk->name); for (part = disk->partition; part; part = part->parent) push_partmap_module (part->partmap->name, NULL); - if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID) + if (disk->dev->id == VasEBoot_DISK_DEVICE_DISKFILTER_ID) { - grub_diskfilter_get_partmap (disk, push_partmap_module, NULL); + VasEBoot_diskfilter_get_partmap (disk, push_partmap_module, NULL); have_abstractions = 1; } - if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID - && (grub_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 || - grub_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0)) - grub_install_push_module ("lvm"); + if (disk->dev->id == VasEBoot_DISK_DEVICE_DISKFILTER_ID + && (VasEBoot_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 || + VasEBoot_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0)) + VasEBoot_install_push_module ("lvm"); - if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID - && grub_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0) - grub_install_push_module ("ldm"); + if (disk->dev->id == VasEBoot_DISK_DEVICE_DISKFILTER_ID + && VasEBoot_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0) + VasEBoot_install_push_module ("ldm"); - if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID) + if (disk->dev->id == VasEBoot_DISK_DEVICE_CRYPTODISK_ID) { - grub_util_cryptodisk_get_abstraction (disk, + VasEBoot_util_cryptodisk_get_abstraction (disk, push_cryptodisk_module, NULL); have_abstractions = 1; have_cryptodisk = 1; @@ -445,14 +445,14 @@ probe_mods (grub_disk_t disk) raid_level = probe_raid_level (disk); if (raid_level >= 0) { - grub_install_push_module ("diskfilter"); + VasEBoot_install_push_module ("diskfilter"); if (disk->dev->raidname) - grub_install_push_module (disk->dev->raidname (disk)); + VasEBoot_install_push_module (disk->dev->raidname (disk)); } if (raid_level == 5) - grub_install_push_module ("raid5rec"); + VasEBoot_install_push_module ("raid5rec"); if (raid_level == 6) - grub_install_push_module ("raid6rec"); + VasEBoot_install_push_module ("raid6rec"); /* In case of LVM/RAID, check the member devices as well. */ if (disk->dev->memberlist) @@ -467,47 +467,47 @@ probe_mods (grub_disk_t disk) } static int -have_bootdev (enum grub_install_plat pl) +have_bootdev (enum VasEBoot_install_plat pl) { switch (pl) { - case GRUB_INSTALL_PLATFORM_I386_PC: - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: - case GRUB_INSTALL_PLATFORM_MIPS_ARC: + case VasEBoot_INSTALL_PLATFORM_I386_PC: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: return 1; - case GRUB_INSTALL_PLATFORM_I386_QEMU: - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: return 0; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: return 0; } return 0; } static void -probe_cryptodisk_uuid (grub_disk_t disk) +probe_cryptodisk_uuid (VasEBoot_disk_t disk) { - grub_disk_memberlist_t list = NULL, tmp; + VasEBoot_disk_memberlist_t list = NULL, tmp; /* In case of LVM/RAID, check the member devices as well. */ if (disk->dev->memberlist) @@ -521,11 +521,11 @@ probe_cryptodisk_uuid (grub_disk_t disk) free (list); list = tmp; } - if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID) + if (disk->dev->id == VasEBoot_DISK_DEVICE_CRYPTODISK_ID) { - const char *uuid = grub_util_cryptodisk_get_uuid (disk); + const char *uuid = VasEBoot_util_cryptodisk_get_uuid (disk); if (!load_cfg_f) - load_cfg_f = grub_util_fopen (load_cfg, "wb"); + load_cfg_f = VasEBoot_util_fopen (load_cfg, "wb"); have_load_cfg = 1; fprintf (load_cfg_f, "cryptomount -u %s\n", @@ -558,24 +558,24 @@ is_same_disk (const char *a, const char *b) static char * get_rndstr (void) { - grub_uint8_t rnd[15]; - const size_t sz = sizeof (rnd) * GRUB_CHAR_BIT / 5; + VasEBoot_uint8_t rnd[15]; + const size_t sz = sizeof (rnd) * VasEBoot_CHAR_BIT / 5; char * ret = xmalloc (sz + 1); size_t i; - if (grub_get_random (rnd, sizeof (rnd))) - grub_util_error ("%s", _("couldn't retrieve random data")); + if (VasEBoot_get_random (rnd, sizeof (rnd))) + VasEBoot_util_error ("%s", _("couldn't retrieve random data")); for (i = 0; i < sz; i++) { - grub_size_t b = i * 5; - grub_uint8_t r; - grub_size_t f1 = GRUB_CHAR_BIT - b % GRUB_CHAR_BIT; - grub_size_t f2; + VasEBoot_size_t b = i * 5; + VasEBoot_uint8_t r; + VasEBoot_size_t f1 = VasEBoot_CHAR_BIT - b % VasEBoot_CHAR_BIT; + VasEBoot_size_t f2; if (f1 > 5) f1 = 5; f2 = 5 - f1; - r = (rnd[b / GRUB_CHAR_BIT] >> (b % GRUB_CHAR_BIT)) & ((1 << f1) - 1); + r = (rnd[b / VasEBoot_CHAR_BIT] >> (b % VasEBoot_CHAR_BIT)) & ((1 << f1) - 1); if (f2) - r |= (rnd[b / GRUB_CHAR_BIT + 1] & ((1 << f2) - 1)) << f1; + r |= (rnd[b / VasEBoot_CHAR_BIT + 1] & ((1 << f2) - 1)) << f1; if (r < 10) ret[i] = '0' + r; else @@ -595,15 +595,15 @@ escape (const char *in) for (ptr = (char*)in; *ptr; ptr++) if (*ptr == '\'') overhead += 3; - ret = grub_malloc (ptr - in + overhead + 1); + ret = VasEBoot_malloc (ptr - in + overhead + 1); if (!ret) return NULL; - grub_strchrsub (ret, in, '\'', "'\\''"); + VasEBoot_strchrsub (ret, in, '\'', "'\\''"); return ret; } -static struct grub_util_config config; +static struct VasEBoot_util_config config; static void device_map_check_duplicates (const char *dev_map) @@ -618,7 +618,7 @@ device_map_check_duplicates (const char *dev_map) if (dev_map[0] == '\0') return; - fp = grub_util_fopen (dev_map, "r"); + fp = VasEBoot_util_fopen (dev_map, "r"); if (! fp) return; @@ -630,7 +630,7 @@ device_map_check_duplicates (const char *dev_map) char *e; /* Skip leading spaces. */ - while (*p && grub_isspace (*p)) + while (*p && VasEBoot_isspace (*p)) p++; /* If the first character is `#' or NUL, skip this line. */ @@ -660,12 +660,12 @@ device_map_check_duplicates (const char *dev_map) fclose (fp); - qsort (d, filled, sizeof (d[0]), grub_qsort_strcmp); + qsort (d, filled, sizeof (d[0]), VasEBoot_qsort_strcmp); for (i = 0; i + 1 < filled; i++) if (strcmp (d[i], d[i+1]) == 0) { - grub_util_error (_("the drive %s is defined multiple times in the device map %s"), + VasEBoot_util_error (_("the drive %s is defined multiple times in the device map %s"), d[i], dev_map); } @@ -675,26 +675,26 @@ device_map_check_duplicates (const char *dev_map) free (d); } -static grub_err_t -write_to_disk (grub_device_t dev, const char *fn) +static VasEBoot_err_t +write_to_disk (VasEBoot_device_t dev, const char *fn) { char *core_img; size_t core_size; - grub_err_t err; + VasEBoot_err_t err; - core_size = grub_util_get_image_size (fn); + core_size = VasEBoot_util_get_image_size (fn); - core_img = grub_util_read_image (fn); + core_img = VasEBoot_util_read_image (fn); - grub_util_info ("writing `%s' to `%s'", fn, dev->disk->name); - err = grub_disk_write (dev->disk, 0, 0, + VasEBoot_util_info ("writing `%s' to `%s'", fn, dev->disk->name); + err = VasEBoot_disk_write (dev->disk, 0, 0, core_size, core_img); free (core_img); return err; } static int -is_prep_partition (grub_device_t dev) +is_prep_partition (VasEBoot_device_t dev) { if (!dev->disk) return 0; @@ -705,22 +705,22 @@ is_prep_partition (grub_device_t dev) if (strcmp (dev->disk->partition->partmap->name, "gpt") == 0) { - struct grub_gpt_partentry gptdata; - grub_partition_t p = dev->disk->partition; + struct VasEBoot_gpt_partentry gptdata; + VasEBoot_partition_t p = dev->disk->partition; int ret = 0; dev->disk->partition = dev->disk->partition->parent; - if (grub_disk_read (dev->disk, p->offset, p->index, + if (VasEBoot_disk_read (dev->disk, p->offset, p->index, sizeof (gptdata), &gptdata) == 0) { - const grub_gpt_part_type_t template = { - grub_cpu_to_le32_compile_time (0x9e1a2d38), - grub_cpu_to_le16_compile_time (0xc612), - grub_cpu_to_le16_compile_time (0x4316), + const VasEBoot_gpt_part_type_t template = { + VasEBoot_cpu_to_le32_compile_time (0x9e1a2d38), + VasEBoot_cpu_to_le16_compile_time (0xc612), + VasEBoot_cpu_to_le16_compile_time (0x4316), { 0xaa, 0x26, 0x8b, 0x49, 0x52, 0x1e, 0x5a, 0x8b } }; - ret = grub_memcmp (&template, &gptdata.type, + ret = VasEBoot_memcmp (&template, &gptdata.type, sizeof (template)) == 0; } dev->disk->partition = p; @@ -731,23 +731,23 @@ is_prep_partition (grub_device_t dev) } static int -is_prep_empty (grub_device_t dev) +is_prep_empty (VasEBoot_device_t dev) { - grub_disk_addr_t dsize, addr; - grub_uint32_t buffer[32768]; + VasEBoot_disk_addr_t dsize, addr; + VasEBoot_uint32_t buffer[32768]; - dsize = grub_disk_get_size (dev->disk); + dsize = VasEBoot_disk_get_size (dev->disk); for (addr = 0; addr < dsize; - addr += sizeof (buffer) / GRUB_DISK_SECTOR_SIZE) + addr += sizeof (buffer) / VasEBoot_DISK_SECTOR_SIZE) { - grub_size_t sz = sizeof (buffer); - grub_uint32_t *ptr; + VasEBoot_size_t sz = sizeof (buffer); + VasEBoot_uint32_t *ptr; - if (sizeof (buffer) / GRUB_DISK_SECTOR_SIZE > dsize - addr) - sz = (dsize - addr) * GRUB_DISK_SECTOR_SIZE; - grub_disk_read (dev->disk, addr, 0, sz, buffer); + if (sizeof (buffer) / VasEBoot_DISK_SECTOR_SIZE > dsize - addr) + sz = (dsize - addr) * VasEBoot_DISK_SECTOR_SIZE; + VasEBoot_disk_read (dev->disk, addr, 0, sz, buffer); - if (addr == 0 && grub_memcmp (buffer, ELFMAG, SELFMAG) == 0) + if (addr == 0 && VasEBoot_memcmp (buffer, ELFMAG, SELFMAG) == 0) return 1; for (ptr = buffer; ptr < buffer + sz / sizeof (*buffer); ptr++) @@ -759,21 +759,21 @@ is_prep_empty (grub_device_t dev) } static void -bless (grub_device_t dev, const char *path, int x86) +bless (VasEBoot_device_t dev, const char *path, int x86) { struct stat st; - grub_err_t err; + VasEBoot_err_t err; - grub_util_info ("blessing %s", path); + VasEBoot_util_info ("blessing %s", path); if (stat (path, &st) < 0) - grub_util_error (N_("cannot stat `%s': %s"), + VasEBoot_util_error (N_("cannot stat `%s': %s"), path, strerror (errno)); - err = grub_mac_bless_inode (dev, st.st_ino, S_ISDIR (st.st_mode), x86); + err = VasEBoot_mac_bless_inode (dev, st.st_ino, S_ISDIR (st.st_mode), x86); if (err) - grub_util_error ("%s", grub_errmsg); - grub_util_info ("blessed"); + VasEBoot_util_error ("%s", VasEBoot_errmsg); + VasEBoot_util_info ("blessed"); } static void @@ -785,21 +785,21 @@ fill_core_services (const char *core_services) char *label_string = xasprintf ("%s %s", bootloader_id, product_version); char *sysv_plist; - label = grub_util_path_concat (2, core_services, ".disk_label"); - grub_util_info ("rendering label %s", label_string); - grub_util_render_label (label_font, label_bgcolor ? : "white", + label = VasEBoot_util_path_concat (2, core_services, ".disk_label"); + VasEBoot_util_info ("rendering label %s", label_string); + VasEBoot_util_render_label (label_font, label_bgcolor ? : "white", label_color ? : "black", label_string, label); - grub_util_info ("label rendered"); + VasEBoot_util_info ("label rendered"); free (label); - label_text = grub_util_path_concat (2, core_services, ".disk_label.contentDetails"); - f = grub_util_fopen (label_text, "wb"); + label_text = VasEBoot_util_path_concat (2, core_services, ".disk_label.contentDetails"); + f = VasEBoot_util_fopen (label_text, "wb"); fprintf (f, "%s\n", label_string); fclose (f); free (label_string); free (label_text); - sysv_plist = grub_util_path_concat (2, core_services, "SystemVersion.plist"); - f = grub_util_fopen (sysv_plist, "wb"); + sysv_plist = VasEBoot_util_path_concat (2, core_services, "SystemVersion.plist"); + f = VasEBoot_util_fopen (sysv_plist, "wb"); fprintf (f, "\n" "\n" @@ -821,37 +821,37 @@ main (int argc, char *argv[]) int is_efi = 0; const char *efi_distributor = NULL; const char *efi_file = NULL; - char **grub_devices; - grub_fs_t grub_fs; - grub_device_t grub_dev = NULL; - enum grub_install_plat platform; - char *grubdir, *device_map; + char **VasEBoot_devices; + VasEBoot_fs_t VasEBoot_fs; + VasEBoot_device_t VasEBoot_dev = NULL; + enum VasEBoot_install_plat platform; + char *VasEBootdir, *device_map; char **curdev, **curdrive; - char **grub_drives; - char *relative_grubdir; + char **VasEBoot_drives; + char *relative_VasEBootdir; char **efidir_device_names = NULL; - grub_device_t efidir_grub_dev = NULL; - char *efidir_grub_devname; + VasEBoot_device_t efidir_VasEBoot_dev = NULL; + char *efidir_VasEBoot_devname; int efidir_is_mac = 0; int is_prep = 0; const char *pkgdatadir; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); product_version = xstrdup (PACKAGE_VERSION); - pkgdatadir = grub_util_get_pkgdatadir (); - label_font = grub_util_path_concat (2, pkgdatadir, "unicode.pf2"); + pkgdatadir = VasEBoot_util_get_pkgdatadir (); + label_font = VasEBoot_util_path_concat (2, pkgdatadir, "unicode.pf2"); argp_parse (&argp, argc, argv, 0, 0, 0); if (verbosity > 1) - grub_env_set ("debug", "all"); + VasEBoot_env_set ("debug", "all"); - grub_util_load_config (&config); + VasEBoot_util_load_config (&config); - if (!bootloader_id && config.grub_distributor) + if (!bootloader_id && config.VasEBoot_distributor) { char *ptr; - bootloader_id = xstrdup (config.grub_distributor); + bootloader_id = xstrdup (config.VasEBoot_distributor); for (ptr = bootloader_id; *ptr && *ptr != ' '; ptr++) if (*ptr >= 'A' && *ptr <= 'Z') *ptr = *ptr - 'A' + 'a'; @@ -860,139 +860,139 @@ main (int argc, char *argv[]) if (!bootloader_id || bootloader_id[0] == '\0') { free (bootloader_id); - bootloader_id = xstrdup ("grub"); + bootloader_id = xstrdup ("VasEBoot"); } - if (!grub_install_source_directory) + if (!VasEBoot_install_source_directory) { if (!target) { const char * t; t = get_default_platform (); if (!t) - grub_util_error ("%s", + VasEBoot_util_error ("%s", _("Unable to determine your platform." " Use --target.") ); target = xstrdup (t); } - grub_install_source_directory - = grub_util_path_concat (2, grub_util_get_pkglibdir (), target); + VasEBoot_install_source_directory + = VasEBoot_util_path_concat (2, VasEBoot_util_get_pkglibdir (), target); } - platform = grub_install_get_target (grub_install_source_directory); + platform = VasEBoot_install_get_target (VasEBoot_install_source_directory); { - char *platname = grub_install_get_platform_name (platform); + char *platname = VasEBoot_install_get_platform_name (platform); fprintf (stderr, _("Installing for %s platform.\n"), platname); free (platname); } switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_PC: + case VasEBoot_INSTALL_PLATFORM_I386_PC: if (!disk_module) disk_module = xstrdup ("biosdisk"); break; - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: - case GRUB_INSTALL_PLATFORM_MIPS_ARC: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: break; - case GRUB_INSTALL_PLATFORM_I386_QEMU: - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: disk_module = xstrdup ("native"); break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_PC: - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_I386_PC: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: if (!install_device) - grub_util_error ("%s", _("install device isn't specified")); + VasEBoot_util_error ("%s", _("install device isn't specified")); break; - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: if (install_device) is_prep = 1; break; - case GRUB_INSTALL_PLATFORM_MIPS_ARC: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: break; - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_QEMU: - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: free (install_device); install_device = NULL; break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } if (!bootdir) - bootdir = grub_util_path_concat (3, "/", rootdir, GRUB_BOOT_DIR_NAME); + bootdir = VasEBoot_util_path_concat (3, "/", rootdir, VasEBoot_BOOT_DIR_NAME); { - char * t = grub_util_path_concat (2, bootdir, GRUB_DIR_NAME); - grub_install_mkdir_p (t); - grubdir = grub_canonicalize_file_name (t); - if (!grubdir) - grub_util_error (_("failed to get canonical path of `%s'"), t); + char * t = VasEBoot_util_path_concat (2, bootdir, VasEBoot_DIR_NAME); + VasEBoot_install_mkdir_p (t); + VasEBootdir = VasEBoot_canonicalize_file_name (t); + if (!VasEBootdir) + VasEBoot_util_error (_("failed to get canonical path of `%s'"), t); free (t); } - device_map = grub_util_path_concat (2, grubdir, "device.map"); + device_map = VasEBoot_util_path_concat (2, VasEBootdir, "device.map"); if (recheck) - grub_util_unlink (device_map); + VasEBoot_util_unlink (device_map); device_map_check_duplicates (device_map); - grub_util_biosdisk_init (device_map); + VasEBoot_util_biosdisk_init (device_map); /* Initialize all modules. */ - grub_init_all (); - grub_gcry_init_all (); - grub_hostfs_init (); - grub_host_init (); + VasEBoot_init_all (); + VasEBoot_gcry_init_all (); + VasEBoot_hostfs_init (); + VasEBoot_host_init (); switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: is_efi = 1; break; default: @@ -1000,7 +1000,7 @@ main (int argc, char *argv[]) break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } @@ -1008,30 +1008,30 @@ main (int argc, char *argv[]) if (is_efi) { - grub_fs_t fs; + VasEBoot_fs_t fs; free (install_device); install_device = NULL; if (!efidir) { - char *d = grub_util_path_concat (2, bootdir, "efi"); + char *d = VasEBoot_util_path_concat (2, bootdir, "efi"); char *dr = NULL; - if (!grub_util_is_directory (d)) + if (!VasEBoot_util_is_directory (d)) { free (d); - d = grub_util_path_concat (2, bootdir, "EFI"); + d = VasEBoot_util_path_concat (2, bootdir, "EFI"); } /* The EFI System Partition may have been given directly using --root-directory. */ - if (!grub_util_is_directory (d) - && rootdir && grub_strcmp (rootdir, "/") != 0) + if (!VasEBoot_util_is_directory (d) + && rootdir && VasEBoot_strcmp (rootdir, "/") != 0) { free (d); d = xstrdup (rootdir); } - if (grub_util_is_directory (d)) - dr = grub_make_system_path_relative_to_its_root (d); + if (VasEBoot_util_is_directory (d)) + dr = VasEBoot_make_system_path_relative_to_its_root (d); /* Is it a mount point? */ if (dr && dr[0] == '\0') efidir = d; @@ -1040,37 +1040,37 @@ main (int argc, char *argv[]) free (dr); } if (!efidir) - grub_util_error ("%s", _("cannot find EFI directory")); - efidir_device_names = grub_guess_root_devices (efidir); + VasEBoot_util_error ("%s", _("cannot find EFI directory")); + efidir_device_names = VasEBoot_guess_root_devices (efidir); if (!efidir_device_names || !efidir_device_names[0]) - grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), + VasEBoot_util_error (_("cannot find a device for %s (is /dev mounted?)"), efidir); install_device = efidir_device_names[0]; for (curdev = efidir_device_names; *curdev; curdev++) - grub_util_pull_device (*curdev); + VasEBoot_util_pull_device (*curdev); - efidir_grub_devname = grub_util_get_grub_dev (efidir_device_names[0]); - if (!efidir_grub_devname) - grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), + efidir_VasEBoot_devname = VasEBoot_util_get_VasEBoot_dev (efidir_device_names[0]); + if (!efidir_VasEBoot_devname) + VasEBoot_util_error (_("cannot find a VasEBoot drive for %s. Check your device.map"), efidir_device_names[0]); - efidir_grub_dev = grub_device_open (efidir_grub_devname); - if (! efidir_grub_dev) - grub_util_error ("%s", grub_errmsg); + efidir_VasEBoot_dev = VasEBoot_device_open (efidir_VasEBoot_devname); + if (! efidir_VasEBoot_dev) + VasEBoot_util_error ("%s", VasEBoot_errmsg); - fs = grub_fs_probe (efidir_grub_dev); + fs = VasEBoot_fs_probe (efidir_VasEBoot_dev); if (! fs) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); efidir_is_mac = 0; - if (grub_strcmp (fs->name, "hfs") == 0 - || grub_strcmp (fs->name, "hfsplus") == 0) + if (VasEBoot_strcmp (fs->name, "hfs") == 0 + || VasEBoot_strcmp (fs->name, "hfsplus") == 0) efidir_is_mac = 1; - if (!efidir_is_mac && grub_strcmp (fs->name, "fat") != 0) - grub_util_error (_("%s doesn't look like an EFI partition"), efidir); + if (!efidir_is_mac && VasEBoot_strcmp (fs->name, "fat") != 0) + VasEBoot_util_error (_("%s doesn't look like an EFI partition"), efidir); /* The EFI specification requires that an EFI System Partition must contain an "EFI" subdirectory, and that OS loaders are stored in @@ -1090,23 +1090,23 @@ main (int argc, char *argv[]) efi_distributor = "BOOT"; switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: efi_file = "BOOTIA32.EFI"; break; - case GRUB_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: efi_file = "BOOTX64.EFI"; break; - case GRUB_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: efi_file = "BOOTIA64.EFI"; break; - case GRUB_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: efi_file = "BOOTARM.EFI"; break; - case GRUB_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: efi_file = "BOOTAA64.EFI"; break; default: - grub_util_error ("%s", _("You've found a bug")); + VasEBoot_util_error ("%s", _("You've found a bug")); break; } } @@ -1117,33 +1117,33 @@ main (int argc, char *argv[]) */ switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_EFI: - efi_file = "grubia32.efi"; + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + efi_file = "VasEBootia32.efi"; break; - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - efi_file = "grubx64.efi"; + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + efi_file = "VasEBootx64.efi"; break; - case GRUB_INSTALL_PLATFORM_IA64_EFI: - efi_file = "grubia64.efi"; + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: + efi_file = "VasEBootia64.efi"; break; - case GRUB_INSTALL_PLATFORM_ARM_EFI: - efi_file = "grubarm.efi"; + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + efi_file = "VasEBootarm.efi"; break; - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - efi_file = "grubaa64.efi"; + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + efi_file = "VasEBootaa64.efi"; break; default: - efi_file = "grub.efi"; + efi_file = "VasEBoot.efi"; break; } } - t = grub_util_path_concat (3, efidir, "EFI", efi_distributor); + t = VasEBoot_util_path_concat (3, efidir, "EFI", efi_distributor); free (efidir); efidir = t; - grub_install_mkdir_p (efidir); + VasEBoot_install_mkdir_p (efidir); } - if (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275) + if (platform == VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275) { int is_guess = 0; if (!macppcdir) @@ -1151,19 +1151,19 @@ main (int argc, char *argv[]) char *d; is_guess = 1; - d = grub_util_path_concat (2, bootdir, "macppc"); - if (!grub_util_is_directory (d)) + d = VasEBoot_util_path_concat (2, bootdir, "macppc"); + if (!VasEBoot_util_is_directory (d)) { free (d); - d = grub_util_path_concat (2, bootdir, "efi"); + d = VasEBoot_util_path_concat (2, bootdir, "efi"); } /* Find the Mac HFS(+) System Partition. */ - if (!grub_util_is_directory (d)) + if (!VasEBoot_util_is_directory (d)) { free (d); - d = grub_util_path_concat (2, bootdir, "EFI"); + d = VasEBoot_util_path_concat (2, bootdir, "EFI"); } - if (!grub_util_is_directory (d)) + if (!VasEBoot_util_is_directory (d)) { free (d); d = 0; @@ -1174,38 +1174,38 @@ main (int argc, char *argv[]) if (macppcdir) { char **macppcdir_device_names = NULL; - grub_device_t macppcdir_grub_dev = NULL; - char *macppcdir_grub_devname; - grub_fs_t fs; + VasEBoot_device_t macppcdir_VasEBoot_dev = NULL; + char *macppcdir_VasEBoot_devname; + VasEBoot_fs_t fs; - macppcdir_device_names = grub_guess_root_devices (macppcdir); + macppcdir_device_names = VasEBoot_guess_root_devices (macppcdir); if (!macppcdir_device_names || !macppcdir_device_names[0]) - grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), + VasEBoot_util_error (_("cannot find a device for %s (is /dev mounted?)"), macppcdir); for (curdev = macppcdir_device_names; *curdev; curdev++) - grub_util_pull_device (*curdev); + VasEBoot_util_pull_device (*curdev); - macppcdir_grub_devname = grub_util_get_grub_dev (macppcdir_device_names[0]); - if (!macppcdir_grub_devname) - grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), + macppcdir_VasEBoot_devname = VasEBoot_util_get_VasEBoot_dev (macppcdir_device_names[0]); + if (!macppcdir_VasEBoot_devname) + VasEBoot_util_error (_("cannot find a VasEBoot drive for %s. Check your device.map"), macppcdir_device_names[0]); - macppcdir_grub_dev = grub_device_open (macppcdir_grub_devname); - if (! macppcdir_grub_dev) - grub_util_error ("%s", grub_errmsg); + macppcdir_VasEBoot_dev = VasEBoot_device_open (macppcdir_VasEBoot_devname); + if (! macppcdir_VasEBoot_dev) + VasEBoot_util_error ("%s", VasEBoot_errmsg); - fs = grub_fs_probe (macppcdir_grub_dev); + fs = VasEBoot_fs_probe (macppcdir_VasEBoot_dev); if (! fs) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - if (grub_strcmp (fs->name, "hfs") != 0 - && grub_strcmp (fs->name, "hfsplus") != 0 + if (VasEBoot_strcmp (fs->name, "hfs") != 0 + && VasEBoot_strcmp (fs->name, "hfsplus") != 0 && !is_guess) - grub_util_error (_("filesystem on %s is neither HFS nor HFS+"), + VasEBoot_util_error (_("filesystem on %s is neither HFS nor HFS+"), macppcdir); - if (grub_strcmp (fs->name, "hfs") == 0 - || grub_strcmp (fs->name, "hfsplus") == 0) + if (VasEBoot_strcmp (fs->name, "hfs") == 0 + || VasEBoot_strcmp (fs->name, "hfsplus") == 0) { install_device = macppcdir_device_names[0]; is_prep = 0; @@ -1213,107 +1213,107 @@ main (int argc, char *argv[]) } } - grub_install_copy_files (grub_install_source_directory, - grubdir, platform); + VasEBoot_install_copy_files (VasEBoot_install_source_directory, + VasEBootdir, platform); - char *envfile = grub_util_path_concat (2, grubdir, "grubenv"); - if (!grub_util_is_regular (envfile)) - grub_util_create_envblk_file (envfile); + char *envfile = VasEBoot_util_path_concat (2, VasEBootdir, "VasEBootenv"); + if (!VasEBoot_util_is_regular (envfile)) + VasEBoot_util_create_envblk_file (envfile); size_t ndev = 0; /* Write device to a variable so we don't have to traverse /dev every time. */ - grub_devices = grub_guess_root_devices (grubdir); - if (!grub_devices || !grub_devices[0]) - grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), - grubdir); + VasEBoot_devices = VasEBoot_guess_root_devices (VasEBootdir); + if (!VasEBoot_devices || !VasEBoot_devices[0]) + VasEBoot_util_error (_("cannot find a device for %s (is /dev mounted?)"), + VasEBootdir); - for (curdev = grub_devices; *curdev; curdev++) + for (curdev = VasEBoot_devices; *curdev; curdev++) { - grub_util_pull_device (*curdev); + VasEBoot_util_pull_device (*curdev); ndev++; } - grub_drives = xmalloc (sizeof (grub_drives[0]) * (ndev + 1)); + VasEBoot_drives = xmalloc (sizeof (VasEBoot_drives[0]) * (ndev + 1)); - for (curdev = grub_devices, curdrive = grub_drives; *curdev; curdev++, + for (curdev = VasEBoot_devices, curdrive = VasEBoot_drives; *curdev; curdev++, curdrive++) { - *curdrive = grub_util_get_grub_dev (*curdev); + *curdrive = VasEBoot_util_get_VasEBoot_dev (*curdev); if (! *curdrive) - grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), + VasEBoot_util_error (_("cannot find a VasEBoot drive for %s. Check your device.map"), *curdev); } *curdrive = 0; - grub_dev = grub_device_open (grub_drives[0]); - if (! grub_dev) - grub_util_error ("%s", grub_errmsg); + VasEBoot_dev = VasEBoot_device_open (VasEBoot_drives[0]); + if (! VasEBoot_dev) + VasEBoot_util_error ("%s", VasEBoot_errmsg); - grub_fs = grub_fs_probe (grub_dev); - if (! grub_fs) - grub_util_error ("%s", grub_errmsg); + VasEBoot_fs = VasEBoot_fs_probe (VasEBoot_dev); + if (! VasEBoot_fs) + VasEBoot_util_error ("%s", VasEBoot_errmsg); - grub_install_push_module (grub_fs->name); + VasEBoot_install_push_module (VasEBoot_fs->name); - if (grub_dev->disk) - probe_mods (grub_dev->disk); + if (VasEBoot_dev->disk) + probe_mods (VasEBoot_dev->disk); - for (curdrive = grub_drives + 1; *curdrive; curdrive++) + for (curdrive = VasEBoot_drives + 1; *curdrive; curdrive++) { - grub_device_t dev = grub_device_open (*curdrive); + VasEBoot_device_t dev = VasEBoot_device_open (*curdrive); if (!dev) continue; if (dev->disk) probe_mods (dev->disk); - grub_device_close (dev); + VasEBoot_device_close (dev); } if (!config.is_cryptodisk_enabled && have_cryptodisk) - grub_util_error (_("attempt to install to encrypted disk without cryptodisk enabled. " - "Set `%s' in file `%s'"), "GRUB_ENABLE_CRYPTODISK=y", - grub_util_get_config_filename ()); + VasEBoot_util_error (_("attempt to install to encrypted disk without cryptodisk enabled. " + "Set `%s' in file `%s'"), "VasEBoot_ENABLE_CRYPTODISK=y", + VasEBoot_util_get_config_filename ()); - if (disk_module && grub_strcmp (disk_module, "ata") == 0) - grub_install_push_module ("pata"); - else if (disk_module && grub_strcmp (disk_module, "native") == 0) + if (disk_module && VasEBoot_strcmp (disk_module, "ata") == 0) + VasEBoot_install_push_module ("pata"); + else if (disk_module && VasEBoot_strcmp (disk_module, "native") == 0) { - grub_install_push_module ("pata"); - grub_install_push_module ("ahci"); - grub_install_push_module ("ohci"); - grub_install_push_module ("uhci"); - grub_install_push_module ("ehci"); - grub_install_push_module ("usbms"); + VasEBoot_install_push_module ("pata"); + VasEBoot_install_push_module ("ahci"); + VasEBoot_install_push_module ("ohci"); + VasEBoot_install_push_module ("uhci"); + VasEBoot_install_push_module ("ehci"); + VasEBoot_install_push_module ("usbms"); } else if (disk_module && disk_module[0]) - grub_install_push_module (disk_module); + VasEBoot_install_push_module (disk_module); - relative_grubdir = grub_make_system_path_relative_to_its_root (grubdir); - if (relative_grubdir[0] == '\0') + relative_VasEBootdir = VasEBoot_make_system_path_relative_to_its_root (VasEBootdir); + if (relative_VasEBootdir[0] == '\0') { - free (relative_grubdir); - relative_grubdir = xstrdup ("/"); + free (relative_VasEBootdir); + relative_VasEBootdir = xstrdup ("/"); } - char *platname = grub_install_get_platform_name (platform); + char *platname = VasEBoot_install_get_platform_name (platform); char *platdir; { - char *t = grub_util_path_concat (2, grubdir, + char *t = VasEBoot_util_path_concat (2, VasEBootdir, platname); - platdir = grub_canonicalize_file_name (t); + platdir = VasEBoot_canonicalize_file_name (t); if (!platdir) - grub_util_error (_("failed to get canonical path of `%s'"), + VasEBoot_util_error (_("failed to get canonical path of `%s'"), t); free (t); } - load_cfg = grub_util_path_concat (2, platdir, + load_cfg = VasEBoot_util_path_concat (2, platdir, "load.cfg"); - grub_util_unlink (load_cfg); + VasEBoot_util_unlink (load_cfg); if (debug_image && debug_image[0]) { - load_cfg_f = grub_util_fopen (load_cfg, "wb"); + load_cfg_f = VasEBoot_util_fopen (load_cfg, "wb"); have_load_cfg = 1; fprintf (load_cfg_f, "set debug='%s'\n", debug_image); @@ -1324,156 +1324,156 @@ main (int argc, char *argv[]) if (install_device) { if (install_device[0] == '(' - && install_device[grub_strlen (install_device) - 1] == ')') + && install_device[VasEBoot_strlen (install_device) - 1] == ')') { - size_t len = grub_strlen (install_device) - 2; + size_t len = VasEBoot_strlen (install_device) - 2; install_drive = xmalloc (len + 1); memcpy (install_drive, install_device + 1, len); install_drive[len] = '\0'; } else { - grub_util_pull_device (install_device); - install_drive = grub_util_get_grub_dev (install_device); + VasEBoot_util_pull_device (install_device); + install_drive = VasEBoot_util_get_VasEBoot_dev (install_device); if (!install_drive) - grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), + VasEBoot_util_error (_("cannot find a VasEBoot drive for %s. Check your device.map"), install_device); } } if (!have_abstractions) { - if ((disk_module && grub_strcmp (disk_module, "biosdisk") != 0) - || grub_drives[1] + if ((disk_module && VasEBoot_strcmp (disk_module, "biosdisk") != 0) + || VasEBoot_drives[1] || (!install_drive - && platform != GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275) - || (install_drive && !is_same_disk (grub_drives[0], install_drive)) + && platform != VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275) + || (install_drive && !is_same_disk (VasEBoot_drives[0], install_drive)) || !have_bootdev (platform)) { char *uuid = NULL; /* generic method (used on coreboot and ata mod). */ - if (!force_file_id && grub_fs->uuid && grub_fs->uuid (grub_dev, + if (!force_file_id && VasEBoot_fs->uuid && VasEBoot_fs->uuid (VasEBoot_dev, &uuid)) { - grub_print_error (); - grub_errno = 0; + VasEBoot_print_error (); + VasEBoot_errno = 0; uuid = NULL; } if (!load_cfg_f) - load_cfg_f = grub_util_fopen (load_cfg, "wb"); + load_cfg_f = VasEBoot_util_fopen (load_cfg, "wb"); have_load_cfg = 1; if (uuid) { fprintf (load_cfg_f, "search.fs_uuid %s root ", uuid); - grub_install_push_module ("search_fs_uuid"); + VasEBoot_install_push_module ("search_fs_uuid"); } else { char *rndstr = get_rndstr (); - char *fl = grub_util_path_concat (3, grubdir, + char *fl = VasEBoot_util_path_concat (3, VasEBootdir, "uuid", rndstr); - char *fldir = grub_util_path_concat (2, grubdir, + char *fldir = VasEBoot_util_path_concat (2, VasEBootdir, "uuid"); char *relfl; FILE *flf; - grub_install_mkdir_p (fldir); - flf = grub_util_fopen (fl, "w"); + VasEBoot_install_mkdir_p (fldir); + flf = VasEBoot_util_fopen (fl, "w"); if (!flf) - grub_util_error (_("Can't create file: %s"), strerror (errno)); + VasEBoot_util_error (_("Can't create file: %s"), strerror (errno)); fclose (flf); - relfl = grub_make_system_path_relative_to_its_root (fl); + relfl = VasEBoot_make_system_path_relative_to_its_root (fl); fprintf (load_cfg_f, "search.file %s root ", relfl); - grub_install_push_module ("search_fs_file"); + VasEBoot_install_push_module ("search_fs_file"); } - for (curdev = grub_devices, curdrive = grub_drives; *curdev; curdev++, + for (curdev = VasEBoot_devices, curdrive = VasEBoot_drives; *curdev; curdev++, curdrive++) { const char *map; char *g = NULL; - grub_device_t dev; - if (curdrive == grub_drives) - dev = grub_dev; + VasEBoot_device_t dev; + if (curdrive == VasEBoot_drives) + dev = VasEBoot_dev; else - dev = grub_device_open (*curdrive); + dev = VasEBoot_device_open (*curdrive); if (!dev) continue; - if (dev->disk->dev->id != GRUB_DISK_DEVICE_HOSTDISK_ID) + if (dev->disk->dev->id != VasEBoot_DISK_DEVICE_HOSTDISK_ID) { - grub_util_fprint_full_disk_name (load_cfg_f, + VasEBoot_util_fprint_full_disk_name (load_cfg_f, dev->disk->name, dev); fprintf (load_cfg_f, " "); - if (dev != grub_dev) - grub_device_close (dev); + if (dev != VasEBoot_dev) + VasEBoot_device_close (dev); continue; } - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { - grub_util_fprint_full_disk_name (load_cfg_f, map, dev); + VasEBoot_util_fprint_full_disk_name (load_cfg_f, map, dev); fprintf (load_cfg_f, " "); } if (disk_module && disk_module[0] - && grub_strcmp (disk_module, "biosdisk") != 0) - g = grub_util_guess_baremetal_drive (*curdev); + && VasEBoot_strcmp (disk_module, "biosdisk") != 0) + g = VasEBoot_util_guess_baremetal_drive (*curdev); else switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_PC: - g = grub_util_guess_bios_drive (*curdev); + case VasEBoot_INSTALL_PLATFORM_I386_PC: + g = VasEBoot_util_guess_bios_drive (*curdev); break; - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: - g = grub_util_guess_efi_drive (*curdev); + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: + g = VasEBoot_util_guess_efi_drive (*curdev); break; - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: { - const char * ofpath = grub_util_devname_to_ofpath (*curdev); + const char * ofpath = VasEBoot_util_devname_to_ofpath (*curdev); g = xasprintf ("ieee1275/%s", ofpath); break; } - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: - case GRUB_INSTALL_PLATFORM_I386_QEMU: - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: - g = grub_util_guess_baremetal_drive (*curdev); + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + g = VasEBoot_util_guess_baremetal_drive (*curdev); break; - case GRUB_INSTALL_PLATFORM_MIPS_ARC: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: - grub_util_warn ("%s", _("no hints available for your platform. Expect reduced performance")); + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: + VasEBoot_util_warn ("%s", _("no hints available for your platform. Expect reduced performance")); break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } if (g) { - grub_util_fprint_full_disk_name (load_cfg_f, g, dev); + VasEBoot_util_fprint_full_disk_name (load_cfg_f, g, dev); fprintf (load_cfg_f, " "); } - if (dev != grub_dev) - grub_device_close (dev); + if (dev != VasEBoot_dev) + VasEBoot_device_close (dev); } fprintf (load_cfg_f, "\n"); - char *escaped_relpath = escape (relative_grubdir); + char *escaped_relpath = escape (relative_VasEBootdir); fprintf (load_cfg_f, "set prefix=($root)'%s'\n", escaped_relpath); } @@ -1481,7 +1481,7 @@ main (int argc, char *argv[]) { /* We need to hardcode the partition number in the core image's prefix. */ char *p; - for (p = grub_drives[0]; *p; ) + for (p = VasEBoot_drives[0]; *p; ) { if (*p == '\\' && p[1]) { @@ -1499,20 +1499,20 @@ main (int argc, char *argv[]) { if (config.is_cryptodisk_enabled) { - if (grub_dev->disk) - probe_cryptodisk_uuid (grub_dev->disk); + if (VasEBoot_dev->disk) + probe_cryptodisk_uuid (VasEBoot_dev->disk); - for (curdrive = grub_drives + 1; *curdrive; curdrive++) + for (curdrive = VasEBoot_drives + 1; *curdrive; curdrive++) { - grub_device_t dev = grub_device_open (*curdrive); + VasEBoot_device_t dev = VasEBoot_device_open (*curdrive); if (!dev) continue; if (dev->disk) probe_cryptodisk_uuid (dev->disk); - grub_device_close (dev); + VasEBoot_device_close (dev); } } - prefix_drive = xasprintf ("(%s)", grub_drives[0]); + prefix_drive = xasprintf ("(%s)", VasEBoot_drives[0]); } char mkimage_target[200]; @@ -1520,72 +1520,72 @@ main (int argc, char *argv[]) switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: core_name = "core.efi"; snprintf (mkimage_target, sizeof (mkimage_target), "%s-%s", - grub_install_get_platform_cpu (platform), - grub_install_get_platform_platform (platform)); + VasEBoot_install_get_platform_cpu (platform), + VasEBoot_install_get_platform_platform (platform)); break; - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: core_name = "core.elf"; snprintf (mkimage_target, sizeof (mkimage_target), "%s-%s-elf", - grub_install_get_platform_cpu (platform), - grub_install_get_platform_platform (platform)); + VasEBoot_install_get_platform_cpu (platform), + VasEBoot_install_get_platform_platform (platform)); break; - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: core_name = "core.elf"; snprintf (mkimage_target, sizeof (mkimage_target), "%s-%s", - grub_install_get_platform_cpu (platform), - grub_install_get_platform_platform (platform)); + VasEBoot_install_get_platform_cpu (platform), + VasEBoot_install_get_platform_platform (platform)); break; - case GRUB_INSTALL_PLATFORM_I386_PC: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: - case GRUB_INSTALL_PLATFORM_MIPS_ARC: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_I386_PC: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: snprintf (mkimage_target, sizeof (mkimage_target), "%s-%s", - grub_install_get_platform_cpu (platform), - grub_install_get_platform_platform (platform)); + VasEBoot_install_get_platform_cpu (platform), + VasEBoot_install_get_platform_platform (platform)); core_name = "core.img"; break; - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: strcpy (mkimage_target, "sparc64-ieee1275-raw"); core_name = "core.img"; break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } if (!core_name) - grub_util_error ("%s", _("You've found a bug")); + VasEBoot_util_error ("%s", _("You've found a bug")); if (load_cfg_f) fclose (load_cfg_f); - char *imgfile = grub_util_path_concat (2, platdir, + char *imgfile = VasEBoot_util_path_concat (2, platdir, core_name); char *prefix = xasprintf ("%s%s", prefix_drive ? : "", - relative_grubdir); - grub_install_make_image_wrap (/* source dir */ grub_install_source_directory, + relative_VasEBootdir); + VasEBoot_install_make_image_wrap (/* source dir */ VasEBoot_install_source_directory, /*prefix */ prefix, /* output */ imgfile, /* memdisk */ NULL, @@ -1594,28 +1594,28 @@ main (int argc, char *argv[]) /* Backward-compatibility kludges. */ switch (platform) { - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: { - char *dst = grub_util_path_concat (2, bootdir, "grub.elf"); - grub_install_copy_file (imgfile, dst, 1); + char *dst = VasEBoot_util_path_concat (2, bootdir, "VasEBoot.elf"); + VasEBoot_install_copy_file (imgfile, dst, 1); free (dst); } break; - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: { - char *dst = grub_util_path_concat (2, grubdir, "grub"); - grub_install_copy_file (imgfile, dst, 1); + char *dst = VasEBoot_util_path_concat (2, VasEBootdir, "VasEBoot"); + VasEBoot_install_copy_file (imgfile, dst, 1); free (dst); } break; - case GRUB_INSTALL_PLATFORM_I386_EFI: - case GRUB_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: { - char *dst = grub_util_path_concat (2, platdir, "grub.efi"); - grub_install_make_image_wrap (/* source dir */ grub_install_source_directory, + char *dst = VasEBoot_util_path_concat (2, platdir, "VasEBoot.efi"); + VasEBoot_install_make_image_wrap (/* source dir */ VasEBoot_install_source_directory, /* prefix */ "", /* output */ dst, /* memdisk */ NULL, @@ -1623,24 +1623,24 @@ main (int argc, char *argv[]) /* image target */ mkimage_target, 0); } break; - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_I386_PC: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: - case GRUB_INSTALL_PLATFORM_MIPS_ARC: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_QEMU: - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_PC: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } @@ -1648,16 +1648,16 @@ main (int argc, char *argv[]) switch (platform) { - case GRUB_INSTALL_PLATFORM_I386_PC: + case VasEBoot_INSTALL_PLATFORM_I386_PC: { - char *boot_img_src = grub_util_path_concat (2, - grub_install_source_directory, + char *boot_img_src = VasEBoot_util_path_concat (2, + VasEBoot_install_source_directory, "boot.img"); - char *boot_img = grub_util_path_concat (2, platdir, + char *boot_img = VasEBoot_util_path_concat (2, platdir, "boot.img"); - grub_install_copy_file (boot_img_src, boot_img, 1); + VasEBoot_install_copy_file (boot_img_src, boot_img, 1); - grub_util_info ("%sgrub-bios-setup %s %s %s %s %s --directory='%s' --device-map='%s' '%s'", + VasEBoot_util_info ("%sVasEBoot-bios-setup %s %s %s %s %s --directory='%s' --device-map='%s' '%s'", /* TRANSLATORS: This is a prefix in the log to indicate that usually a command would be executed but due to an option was skipped. */ install_bootsector ? "" : _("NOT RUNNING: "), @@ -1672,21 +1672,21 @@ main (int argc, char *argv[]) /* Now perform the installation. */ if (install_bootsector) - grub_util_bios_setup (platdir, "boot.img", "core.img", + VasEBoot_util_bios_setup (platdir, "boot.img", "core.img", install_drive, force, fs_probe, allow_floppy, add_rs_codes); break; } - case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275: { - char *boot_img_src = grub_util_path_concat (2, - grub_install_source_directory, + char *boot_img_src = VasEBoot_util_path_concat (2, + VasEBoot_install_source_directory, "boot.img"); - char *boot_img = grub_util_path_concat (2, platdir, + char *boot_img = VasEBoot_util_path_concat (2, platdir, "boot.img"); - grub_install_copy_file (boot_img_src, boot_img, 1); + VasEBoot_install_copy_file (boot_img_src, boot_img, 1); - grub_util_info ("%sgrub-sparc64-setup %s %s %s %s --directory='%s' --device-map='%s' '%s'", + VasEBoot_util_info ("%sVasEBoot-sparc64-setup %s %s %s %s --directory='%s' --device-map='%s' '%s'", install_bootsector ? "" : "NOT RUNNING: ", allow_floppy ? "--allow-floppy " : "", verbosity ? "--verbose " : "", @@ -1698,44 +1698,44 @@ main (int argc, char *argv[]) /* Now perform the installation. */ if (install_bootsector) - grub_util_sparc_setup (platdir, "boot.img", "core.img", + VasEBoot_util_sparc_setup (platdir, "boot.img", "core.img", install_drive, force, fs_probe, allow_floppy, 0 /* unused */ ); break; } - case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275: if (macppcdir) { - char *core_services = grub_util_path_concat (4, macppcdir, + char *core_services = VasEBoot_util_path_concat (4, macppcdir, "System", "Library", "CoreServices"); - char *mach_kernel = grub_util_path_concat (2, macppcdir, + char *mach_kernel = VasEBoot_util_path_concat (2, macppcdir, "mach_kernel"); - char *grub_elf, *bootx; + char *VasEBoot_elf, *bootx; FILE *f; - grub_device_t ins_dev; - char *grub_chrp = grub_util_path_concat (2, - grub_install_source_directory, - "grub.chrp"); + VasEBoot_device_t ins_dev; + char *VasEBoot_chrp = VasEBoot_util_path_concat (2, + VasEBoot_install_source_directory, + "VasEBoot.chrp"); - grub_install_mkdir_p (core_services); + VasEBoot_install_mkdir_p (core_services); - bootx = grub_util_path_concat (2, core_services, "BootX"); - grub_install_copy_file (grub_chrp, bootx, 1); + bootx = VasEBoot_util_path_concat (2, core_services, "BootX"); + VasEBoot_install_copy_file (VasEBoot_chrp, bootx, 1); - grub_elf = grub_util_path_concat (2, core_services, "grub.elf"); - grub_install_copy_file (imgfile, grub_elf, 1); + VasEBoot_elf = VasEBoot_util_path_concat (2, core_services, "VasEBoot.elf"); + VasEBoot_install_copy_file (imgfile, VasEBoot_elf, 1); - f = grub_util_fopen (mach_kernel, "a+"); + f = VasEBoot_util_fopen (mach_kernel, "a+"); if (!f) - grub_util_error (_("Can't create file: %s"), strerror (errno)); + VasEBoot_util_error (_("Can't create file: %s"), strerror (errno)); fclose (f); fill_core_services (core_services); - ins_dev = grub_device_open (install_drive); + ins_dev = VasEBoot_device_open (install_drive); bless (ins_dev, core_services, 0); @@ -1746,118 +1746,118 @@ main (int argc, char *argv[]) partno = ins_dev->disk->partition ? ins_dev->disk->partition->number + 1 : 0; - dev = grub_util_get_os_disk (install_device); - grub_install_register_ieee1275 (0, dev, partno, + dev = VasEBoot_util_get_os_disk (install_device); + VasEBoot_install_register_ieee1275 (0, dev, partno, "\\\\BootX"); } - grub_device_close (ins_dev); - free (grub_elf); + VasEBoot_device_close (ins_dev); + free (VasEBoot_elf); free (bootx); free (mach_kernel); - free (grub_chrp); + free (VasEBoot_chrp); break; } /* If a install device is defined, copy the core.elf to PReP partition. */ if (is_prep && install_device && install_device[0]) { - grub_device_t ins_dev; - ins_dev = grub_device_open (install_drive); + VasEBoot_device_t ins_dev; + ins_dev = VasEBoot_device_open (install_drive); if (!ins_dev || !is_prep_partition (ins_dev)) { - grub_util_error ("%s", _("the chosen partition is not a PReP partition")); + VasEBoot_util_error ("%s", _("the chosen partition is not a PReP partition")); } if (is_prep_empty (ins_dev)) { if (write_to_disk (ins_dev, imgfile)) - grub_util_error ("%s", _("failed to copy Grub to the PReP partition")); + VasEBoot_util_error ("%s", _("failed to copy VasEBoot to the PReP partition")); } else { char *s = xasprintf ("dd if=/dev/zero of=%s", install_device); - grub_util_error (_("the PReP partition is not empty. If you are sure you want to use it, run dd to clear it: `%s'"), + VasEBoot_util_error (_("the PReP partition is not empty. If you are sure you want to use it, run dd to clear it: `%s'"), s); } - grub_device_close (ins_dev); + VasEBoot_device_close (ins_dev); if (update_nvram) - grub_install_register_ieee1275 (1, grub_util_get_os_disk (install_device), + VasEBoot_install_register_ieee1275 (1, VasEBoot_util_get_os_disk (install_device), 0, NULL); break; } /* fallthrough. */ - case GRUB_INSTALL_PLATFORM_I386_IEEE1275: + case VasEBoot_INSTALL_PLATFORM_I386_IEEE1275: if (update_nvram) { const char *dev; char *relpath; int partno; - relpath = grub_make_system_path_relative_to_its_root (imgfile); - partno = grub_dev->disk->partition - ? grub_dev->disk->partition->number + 1 : 0; - dev = grub_util_get_os_disk (grub_devices[0]); - grub_install_register_ieee1275 (0, dev, + relpath = VasEBoot_make_system_path_relative_to_its_root (imgfile); + partno = VasEBoot_dev->disk->partition + ? VasEBoot_dev->disk->partition->number + 1 : 0; + dev = VasEBoot_util_get_os_disk (VasEBoot_devices[0]); + VasEBoot_install_register_ieee1275 (0, dev, partno, relpath); } break; - case GRUB_INSTALL_PLATFORM_MIPS_ARC: - grub_install_sgi_setup (install_device, imgfile, "grub"); + case VasEBoot_INSTALL_PLATFORM_MIPS_ARC: + VasEBoot_install_sgi_setup (install_device, imgfile, "VasEBoot"); break; - case GRUB_INSTALL_PLATFORM_I386_EFI: + case VasEBoot_INSTALL_PLATFORM_I386_EFI: if (!efidir_is_mac) { - char *dst = grub_util_path_concat (2, efidir, "grub.efi"); + char *dst = VasEBoot_util_path_concat (2, efidir, "VasEBoot.efi"); /* For old macs. Suggested by Peter Jones. */ - grub_install_copy_file (imgfile, dst, 1); + VasEBoot_install_copy_file (imgfile, dst, 1); free (dst); } /* Fallthrough. */ - case GRUB_INSTALL_PLATFORM_X86_64_EFI: + case VasEBoot_INSTALL_PLATFORM_X86_64_EFI: if (efidir_is_mac) { char *boot_efi; - char *core_services = grub_util_path_concat (4, efidir, + char *core_services = VasEBoot_util_path_concat (4, efidir, "System", "Library", "CoreServices"); - char *mach_kernel = grub_util_path_concat (2, efidir, + char *mach_kernel = VasEBoot_util_path_concat (2, efidir, "mach_kernel"); FILE *f; - grub_device_t ins_dev; + VasEBoot_device_t ins_dev; - grub_install_mkdir_p (core_services); + VasEBoot_install_mkdir_p (core_services); - boot_efi = grub_util_path_concat (2, core_services, "boot.efi"); - grub_install_copy_file (imgfile, boot_efi, 1); + boot_efi = VasEBoot_util_path_concat (2, core_services, "boot.efi"); + VasEBoot_install_copy_file (imgfile, boot_efi, 1); - f = grub_util_fopen (mach_kernel, "r+"); + f = VasEBoot_util_fopen (mach_kernel, "r+"); if (!f) - grub_util_error (_("Can't create file: %s"), strerror (errno)); + VasEBoot_util_error (_("Can't create file: %s"), strerror (errno)); fclose (f); fill_core_services(core_services); - ins_dev = grub_device_open (install_drive); + ins_dev = VasEBoot_device_open (install_drive); bless (ins_dev, boot_efi, 1); if (!removable && update_nvram) { /* Try to make this image bootable using the EFI Boot Manager, if available. */ - grub_install_register_efi (efidir_grub_dev, + VasEBoot_install_register_efi (efidir_VasEBoot_dev, "\\System\\Library\\CoreServices", efi_distributor); } - grub_device_close (ins_dev); + VasEBoot_device_close (ins_dev); free (boot_efi); free (mach_kernel); break; } /* FALLTHROUGH */ - case GRUB_INSTALL_PLATFORM_ARM_EFI: - case GRUB_INSTALL_PLATFORM_ARM64_EFI: - case GRUB_INSTALL_PLATFORM_IA64_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM_EFI: + case VasEBoot_INSTALL_PLATFORM_ARM64_EFI: + case VasEBoot_INSTALL_PLATFORM_IA64_EFI: { - char *dst = grub_util_path_concat (2, efidir, efi_file); - grub_install_copy_file (imgfile, dst, 1); + char *dst = VasEBoot_util_path_concat (2, efidir, efi_file); + VasEBoot_install_copy_file (imgfile, dst, 1); free (dst); } if (!removable && update_nvram) @@ -1867,47 +1867,47 @@ main (int argc, char *argv[]) /* Try to make this image bootable using the EFI Boot Manager, if available. */ if (!efi_distributor || efi_distributor[0] == '\0') - grub_util_error ("%s", _("EFI bootloader id isn't specified.")); + VasEBoot_util_error ("%s", _("EFI bootloader id isn't specified.")); efifile_path = xasprintf ("\\EFI\\%s\\%s", efi_distributor, efi_file); - part = (efidir_grub_dev->disk->partition - ? grub_partition_get_name (efidir_grub_dev->disk->partition) + part = (efidir_VasEBoot_dev->disk->partition + ? VasEBoot_partition_get_name (efidir_VasEBoot_dev->disk->partition) : 0); - grub_util_info ("Registering with EFI: distributor = `%s'," + VasEBoot_util_info ("Registering with EFI: distributor = `%s'," " path = `%s', ESP at %s%s%s", efi_distributor, efifile_path, - efidir_grub_dev->disk->name, + efidir_VasEBoot_dev->disk->name, (part ? ",": ""), (part ? : "")); - grub_free (part); - grub_install_register_efi (efidir_grub_dev, + VasEBoot_free (part); + VasEBoot_install_register_efi (efidir_VasEBoot_dev, efifile_path, efi_distributor); } break; - case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON: - case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS: - case GRUB_INSTALL_PLATFORM_I386_COREBOOT: - case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: - case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: - case GRUB_INSTALL_PLATFORM_ARM_UBOOT: - case GRUB_INSTALL_PLATFORM_I386_QEMU: - case GRUB_INSTALL_PLATFORM_I386_XEN: - case GRUB_INSTALL_PLATFORM_X86_64_XEN: - grub_util_warn ("%s", + case VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS: + case VasEBoot_INSTALL_PLATFORM_I386_COREBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT: + case VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC: + case VasEBoot_INSTALL_PLATFORM_ARM_UBOOT: + case VasEBoot_INSTALL_PLATFORM_I386_QEMU: + case VasEBoot_INSTALL_PLATFORM_I386_XEN: + case VasEBoot_INSTALL_PLATFORM_X86_64_XEN: + VasEBoot_util_warn ("%s", _("WARNING: no platform-specific install was performed")); break; /* pacify warning. */ - case GRUB_INSTALL_PLATFORM_MAX: + case VasEBoot_INSTALL_PLATFORM_MAX: break; } fprintf (stderr, "%s\n", _("Installation finished. No error reported.")); /* Free resources. */ - grub_gcry_fini_all (); - grub_fini_all (); + VasEBoot_gcry_fini_all (); + VasEBoot_fini_all (); return 0; } diff --git a/util/VasEBoot-kbdcomp.in b/util/VasEBoot-kbdcomp.in index a15ec24e5..fc742c387 100644 --- a/util/VasEBoot-kbdcomp.in +++ b/util/VasEBoot-kbdcomp.in @@ -9,28 +9,28 @@ if [ "x$pkgdatadir" = x ]; then pkgdatadir="${datadir}/@PACKAGE@" fi -grub_mklayout="${bindir}/@grub_mklayout@" +VasEBoot_mklayout="${bindir}/@VasEBoot_mklayout@" ckbcomp_options="" export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -. "${pkgdatadir}/grub-mkconfig_lib" +. "${pkgdatadir}/VasEBoot-mkconfig_lib" self=`basename $0` usage () { gettext_printf "Usage: %s -o OUTPUT CKBMAP_ARGUMENTS...\n" "$self" - gettext "Make GRUB keyboard layout file."; echo + gettext "Make VasEBoot keyboard layout file."; echo echo print_option_help "-h, --help" "$(gettext "print this message and exit")" print_option_help "-V, --version" "$(gettext "print the version information and exit")" print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")" echo - gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self" + gettext_printf "%s generates a keyboard layout for VasEBoot using ckbcomp\n" "$self" echo - gettext "Report bugs to ."; echo + gettext "Report bugs to ."; echo } argument () { @@ -73,5 +73,5 @@ if [ "x${output}" = x ] ; then exit 1 fi -ckbcomp $ckbcomp_options | "$grub_mklayout" -o "${output}" +ckbcomp $ckbcomp_options | "$VasEBoot_mklayout" -o "${output}" diff --git a/util/VasEBoot-macbless.c b/util/VasEBoot-macbless.c index e9b15a053..2a170e02c 100644 --- a/util/VasEBoot-macbless.c +++ b/util/VasEBoot-macbless.c @@ -1,41 +1,41 @@ -/* grub-probe.c - probe device information for a given path */ +/* VasEBoot-probe.c - probe device information for a given path */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -58,42 +58,42 @@ bless (const char *path, int x86) { char *drive_name = NULL; char **devices; - char *grub_path = NULL; - char *filebuf_via_grub = NULL, *filebuf_via_sys = NULL; - grub_device_t dev = NULL; - grub_err_t err; + char *VasEBoot_path = NULL; + char *filebuf_via_VasEBoot = NULL, *filebuf_via_sys = NULL; + VasEBoot_device_t dev = NULL; + VasEBoot_err_t err; struct stat st; - grub_path = grub_canonicalize_file_name (path); + VasEBoot_path = VasEBoot_canonicalize_file_name (path); - if (stat (grub_path, &st) < 0) - grub_util_error (N_("cannot stat `%s': %s"), - grub_path, strerror (errno)); + if (stat (VasEBoot_path, &st) < 0) + VasEBoot_util_error (N_("cannot stat `%s': %s"), + VasEBoot_path, strerror (errno)); - devices = grub_guess_root_devices (grub_path); + devices = VasEBoot_guess_root_devices (VasEBoot_path); if (! devices || !devices[0]) - grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), path); + VasEBoot_util_error (_("cannot find a device for %s (is /dev mounted?)"), path); - drive_name = grub_util_get_grub_dev (devices[0]); + drive_name = VasEBoot_util_get_VasEBoot_dev (devices[0]); if (! drive_name) - grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), + VasEBoot_util_error (_("cannot find a VasEBoot drive for %s. Check your device.map"), devices[0]); - grub_util_info ("opening %s", drive_name); - dev = grub_device_open (drive_name); + VasEBoot_util_info ("opening %s", drive_name); + dev = VasEBoot_device_open (drive_name); if (! dev) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - err = grub_mac_bless_inode (dev, st.st_ino, S_ISDIR (st.st_mode), x86); + err = VasEBoot_mac_bless_inode (dev, st.st_ino, S_ISDIR (st.st_mode), x86); if (err) - grub_util_error ("%s", grub_errmsg); - free (grub_path); - free (filebuf_via_grub); + VasEBoot_util_error ("%s", VasEBoot_errmsg); + free (VasEBoot_path); + free (filebuf_via_VasEBoot); free (filebuf_via_sys); free (drive_name); free (devices); - grub_device_close (dev); + VasEBoot_device_close (dev); } static struct argp_option options[] = { @@ -164,7 +164,7 @@ main (int argc, char *argv[]) { struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Check for options. */ memset (&arguments, 0, sizeof (struct arguments)); @@ -175,31 +175,31 @@ main (int argc, char *argv[]) } if (verbosity > 1) - grub_env_set ("debug", "all"); + VasEBoot_env_set ("debug", "all"); /* Initialize the emulated biosdisk driver. */ - grub_util_biosdisk_init (NULL); + VasEBoot_util_biosdisk_init (NULL); /* Initialize all modules. */ - grub_init_all (); - grub_gcry_init_all (); + VasEBoot_init_all (); + VasEBoot_gcry_init_all (); - grub_lvm_fini (); - grub_mdraid09_fini (); - grub_mdraid1x_fini (); - grub_diskfilter_fini (); - grub_diskfilter_init (); - grub_mdraid09_init (); - grub_mdraid1x_init (); - grub_lvm_init (); + VasEBoot_lvm_fini (); + VasEBoot_mdraid09_fini (); + VasEBoot_mdraid1x_fini (); + VasEBoot_diskfilter_fini (); + VasEBoot_diskfilter_init (); + VasEBoot_mdraid09_init (); + VasEBoot_mdraid1x_init (); + VasEBoot_lvm_init (); /* Do it. */ bless (arguments.arg, !arguments.ppc); /* Free resources. */ - grub_gcry_fini_all (); - grub_fini_all (); - grub_util_biosdisk_fini (); + VasEBoot_gcry_fini_all (); + VasEBoot_fini_all (); + VasEBoot_util_biosdisk_fini (); return 0; } diff --git a/util/VasEBoot-macho2img.c b/util/VasEBoot-macho2img.c index 6dfb5fcbe..31c135cac 100644 --- a/util/VasEBoot-macho2img.c +++ b/util/VasEBoot-macho2img.c @@ -1,26 +1,26 @@ /* macho2img.c - tool to convert Mach-O to raw imagw. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include +#include +#include #include #include #include @@ -38,8 +38,8 @@ main (int argc, char **argv) int do_bss = 0; char *buf; int bufsize; - struct grub_macho_header32 *head; - struct grub_macho_segment32 *curcmd; + struct VasEBoot_macho_header32 *head; + struct VasEBoot_macho_segment32 *curcmd; unsigned i; unsigned bssstart = 0; unsigned bssend = 0; @@ -77,8 +77,8 @@ main (int argc, char **argv) return 3; } fread (buf, 1, bufsize, in); - head = (struct grub_macho_header32 *) buf; - if (grub_le_to_cpu32 (head->magic) != GRUB_MACHO_MAGIC32) + head = (struct VasEBoot_macho_header32 *) buf; + if (VasEBoot_le_to_cpu32 (head->magic) != VasEBoot_MACHO_MAGIC32) { fclose (in); fclose (out); @@ -86,31 +86,31 @@ main (int argc, char **argv) printf ("Invalid Mach-O file\n"); return 4; } - curcmd = (struct grub_macho_segment32 *) (buf + sizeof (*head)); - for (i = 0; i < grub_le_to_cpu32 (head->ncmds); i++, - curcmd = (struct grub_macho_segment32 *) + curcmd = (struct VasEBoot_macho_segment32 *) (buf + sizeof (*head)); + for (i = 0; i < VasEBoot_le_to_cpu32 (head->ncmds); i++, + curcmd = (struct VasEBoot_macho_segment32 *) (((char *) curcmd) + curcmd->cmdsize)) { - if (curcmd->cmd != GRUB_MACHO_CMD_SEGMENT32) + if (curcmd->cmd != VasEBoot_MACHO_CMD_SEGMENT32) continue; - fwrite (buf + grub_le_to_cpu32 (curcmd->fileoff), 1, - grub_le_to_cpu32 (curcmd->filesize), out); - if (grub_le_to_cpu32 (curcmd->vmsize) - > grub_le_to_cpu32 (curcmd->filesize)) + fwrite (buf + VasEBoot_le_to_cpu32 (curcmd->fileoff), 1, + VasEBoot_le_to_cpu32 (curcmd->filesize), out); + if (VasEBoot_le_to_cpu32 (curcmd->vmsize) + > VasEBoot_le_to_cpu32 (curcmd->filesize)) { - bssstart = grub_le_to_cpu32 (curcmd->vmaddr) - + grub_le_to_cpu32 (curcmd->filesize) ; - bssend = grub_le_to_cpu32 (curcmd->vmaddr) - + grub_le_to_cpu32 (curcmd->vmsize) ; + bssstart = VasEBoot_le_to_cpu32 (curcmd->vmaddr) + + VasEBoot_le_to_cpu32 (curcmd->filesize) ; + bssend = VasEBoot_le_to_cpu32 (curcmd->vmaddr) + + VasEBoot_le_to_cpu32 (curcmd->vmsize) ; } } if (do_bss) { - grub_uint32_t tmp; + VasEBoot_uint32_t tmp; fseek (out, 0x5c, SEEK_SET); - tmp = grub_cpu_to_le32 (bssstart); + tmp = VasEBoot_cpu_to_le32 (bssstart); fwrite (&tmp, 4, 1, out); - tmp = grub_cpu_to_le32 (bssend); + tmp = VasEBoot_cpu_to_le32 (bssend); fwrite (&tmp, 4, 1, out); } fclose (in); diff --git a/util/VasEBoot-menulst2cfg.c b/util/VasEBoot-menulst2cfg.c index a39f86939..eb21263fa 100644 --- a/util/VasEBoot-menulst2cfg.c +++ b/util/VasEBoot-menulst2cfg.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include +#include #include #include #include -#include -#include -#include +#include +#include +#include int main (int argc, char **argv) @@ -37,7 +37,7 @@ main (int argc, char **argv) int suffixlen = 0; const char *out_fname = 0; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); if (argc >= 2 && argv[1][0] == '-') { @@ -47,7 +47,7 @@ main (int argc, char **argv) if (argc >= 2) { - in = grub_util_fopen (argv[1], "r"); + in = VasEBoot_util_fopen (argv[1], "r"); if (!in) { fprintf (stderr, _("cannot open `%s': %s"), @@ -60,7 +60,7 @@ main (int argc, char **argv) if (argc >= 3) { - out = grub_util_fopen (argv[2], "w"); + out = VasEBoot_util_fopen (argv[2], "w"); if (!out) { if (in != stdin) @@ -86,7 +86,7 @@ main (int argc, char **argv) char *newsuffix; oldname = entryname; - parsed = grub_legacy_parse (buf, &entryname, &newsuffix); + parsed = VasEBoot_legacy_parse (buf, &entryname, &newsuffix); if (newsuffix) { suffixlen += strlen (newsuffix); @@ -97,7 +97,7 @@ main (int argc, char **argv) fprintf (out, "}\n\n"); if (oldname != entryname) { - char *escaped = grub_legacy_escape (entryname, strlen (entryname)); + char *escaped = VasEBoot_legacy_escape (entryname, strlen (entryname)); fprintf (out, "menuentry \'%s\' {\n", escaped); free (escaped); free (oldname); @@ -116,10 +116,10 @@ main (int argc, char **argv) if (fwrite (suffix, 1, suffixlen, out) != suffixlen) { if (out_fname) - grub_util_error ("cannot write to `%s': %s", + VasEBoot_util_error ("cannot write to `%s': %s", out_fname, strerror (errno)); else - grub_util_error ("cannot write to the stdout: %s", strerror (errno)); + VasEBoot_util_error ("cannot write to the stdout: %s", strerror (errno)); } free (buf); diff --git a/util/VasEBoot-mkconfig.in b/util/VasEBoot-mkconfig.in index f8496d28b..1aa86888e 100644 --- a/util/VasEBoot-mkconfig.in +++ b/util/VasEBoot-mkconfig.in @@ -1,21 +1,21 @@ #! /bin/sh set -e -# Generate grub.cfg by inspecting /boot contents. +# Generate VasEBoot.cfg by inspecting /boot contents. # Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . prefix="@prefix@" exec_prefix="@exec_prefix@" @@ -36,32 +36,32 @@ fi # export it for scripts export pkgdatadir -grub_cfg="" -grub_mkconfig_dir="${sysconfdir}"/grub.d +VasEBoot_cfg="" +VasEBoot_mkconfig_dir="${sysconfdir}"/VasEBoot.d self=`basename $0` -grub_probe="${sbindir}/@grub_probe@" -grub_file="${bindir}/@grub_file@" -grub_editenv="${bindir}/@grub_editenv@" -grub_script_check="${bindir}/@grub_script_check@" +VasEBoot_probe="${sbindir}/@VasEBoot_probe@" +VasEBoot_file="${bindir}/@VasEBoot_file@" +VasEBoot_editenv="${bindir}/@VasEBoot_editenv@" +VasEBoot_script_check="${bindir}/@VasEBoot_script_check@" export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -. "${pkgdatadir}/grub-mkconfig_lib" +. "${pkgdatadir}/VasEBoot-mkconfig_lib" # Usage: usage # Print the usage. usage () { gettext_printf "Usage: %s [OPTION]\n" "$self" - gettext "Generate a grub config file"; echo + gettext "Generate a VasEBoot config file"; echo echo print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")" print_option_help "-h, --help" "$(gettext "print this message and exit")" print_option_help "-v, --version" "$(gettext "print the version information and exit")" echo - gettext "Report bugs to ."; echo + gettext "Report bugs to ."; echo } argument () { @@ -89,9 +89,9 @@ do echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; -o | --output) - grub_cfg=`argument $option "$@"`; shift;; + VasEBoot_cfg=`argument $option "$@"`; shift;; --output=*) - grub_cfg=`echo "$option" | sed 's/--output=//'` + VasEBoot_cfg=`echo "$option" | sed 's/--output=//'` ;; -*) gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2 @@ -123,7 +123,7 @@ if [ "$EUID" != 0 ] ; then fi fi -set $grub_probe dummy +set $VasEBoot_probe dummy if test -f "$1"; then : else @@ -132,110 +132,110 @@ else fi # Device containing our userland. Typically used for root= parameter. -GRUB_DEVICE="`${grub_probe} --target=device /`" -GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true +VasEBoot_DEVICE="`${VasEBoot_probe} --target=device /`" +VasEBoot_DEVICE_UUID="`${VasEBoot_probe} --device ${VasEBoot_DEVICE} --target=fs_uuid 2> /dev/null`" || true -# Device containing our /boot partition. Usually the same as GRUB_DEVICE. -GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" -GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true +# Device containing our /boot partition. Usually the same as VasEBoot_DEVICE. +VasEBoot_DEVICE_BOOT="`${VasEBoot_probe} --target=device /boot`" +VasEBoot_DEVICE_BOOT_UUID="`${VasEBoot_probe} --device ${VasEBoot_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. -GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`" +VasEBoot_FS="`${VasEBoot_probe} --device ${VasEBoot_DEVICE} --target=fs 2> /dev/null || echo unknown`" -if [ x"$GRUB_FS" = xunknown ]; then - GRUB_FS="$(stat -f --printf=%T / || echo unknown)" +if [ x"$VasEBoot_FS" = xunknown ]; then + VasEBoot_FS="$(stat -f --printf=%T / || echo unknown)" fi -if test -f ${sysconfdir}/default/grub ; then - . ${sysconfdir}/default/grub +if test -f ${sysconfdir}/default/VasEBoot ; then + . ${sysconfdir}/default/VasEBoot fi # XXX: should this be deprecated at some point? -if [ "x${GRUB_TERMINAL}" != "x" ] ; then - GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" - GRUB_TERMINAL_OUTPUT="${GRUB_TERMINAL}" +if [ "x${VasEBoot_TERMINAL}" != "x" ] ; then + VasEBoot_TERMINAL_INPUT="${VasEBoot_TERMINAL}" + VasEBoot_TERMINAL_OUTPUT="${VasEBoot_TERMINAL}" fi termoutdefault=0 -if [ "x${GRUB_TERMINAL_OUTPUT}" = "x" ]; then - GRUB_TERMINAL_OUTPUT=gfxterm; +if [ "x${VasEBoot_TERMINAL_OUTPUT}" = "x" ]; then + VasEBoot_TERMINAL_OUTPUT=gfxterm; termoutdefault=1; fi -for x in ${GRUB_TERMINAL_OUTPUT}; do +for x in ${VasEBoot_TERMINAL_OUTPUT}; do case "x${x}" in xgfxterm) ;; xconsole | xserial | xofconsole | xvga_text) # make sure all our children behave in conformance with ascii.. export LANG=C;; - *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; + *) echo "Invalid output terminal \"${VasEBoot_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; esac done -GRUB_ACTUAL_DEFAULT="$GRUB_DEFAULT" +VasEBoot_ACTUAL_DEFAULT="$VasEBoot_DEFAULT" -if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'`" ; fi +if [ "x${VasEBoot_ACTUAL_DEFAULT}" = "xsaved" ] ; then VasEBoot_ACTUAL_DEFAULT="`"${VasEBoot_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'`" ; fi # These are defined in this script, export them here so that user can # override them. -export GRUB_DEVICE \ - GRUB_DEVICE_UUID \ - GRUB_DEVICE_BOOT \ - GRUB_DEVICE_BOOT_UUID \ - GRUB_FS \ - GRUB_FONT \ - GRUB_PRELOAD_MODULES \ - GRUB_ACTUAL_DEFAULT +export VasEBoot_DEVICE \ + VasEBoot_DEVICE_UUID \ + VasEBoot_DEVICE_BOOT \ + VasEBoot_DEVICE_BOOT_UUID \ + VasEBoot_FS \ + VasEBoot_FONT \ + VasEBoot_PRELOAD_MODULES \ + VasEBoot_ACTUAL_DEFAULT # These are optional, user-defined variables. -export GRUB_DEFAULT \ - GRUB_HIDDEN_TIMEOUT \ - GRUB_HIDDEN_TIMEOUT_QUIET \ - GRUB_TIMEOUT \ - GRUB_TIMEOUT_STYLE \ - GRUB_DEFAULT_BUTTON \ - GRUB_HIDDEN_TIMEOUT_BUTTON \ - GRUB_TIMEOUT_BUTTON \ - GRUB_TIMEOUT_STYLE_BUTTON \ - GRUB_BUTTON_CMOS_ADDRESS \ - GRUB_BUTTON_CMOS_CLEAN \ - GRUB_DISTRIBUTOR \ - GRUB_CMDLINE_LINUX \ - GRUB_CMDLINE_LINUX_DEFAULT \ - GRUB_CMDLINE_XEN \ - GRUB_CMDLINE_XEN_DEFAULT \ - GRUB_CMDLINE_LINUX_XEN_REPLACE \ - GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT \ - GRUB_CMDLINE_NETBSD \ - GRUB_CMDLINE_NETBSD_DEFAULT \ - GRUB_CMDLINE_GNUMACH \ - GRUB_TERMINAL_INPUT \ - GRUB_TERMINAL_OUTPUT \ - GRUB_SERIAL_COMMAND \ - GRUB_DISABLE_LINUX_UUID \ - GRUB_DISABLE_RECOVERY \ - GRUB_VIDEO_BACKEND \ - GRUB_GFXMODE \ - GRUB_BACKGROUND \ - GRUB_THEME \ - GRUB_GFXPAYLOAD_LINUX \ - GRUB_DISABLE_OS_PROBER \ - GRUB_INIT_TUNE \ - GRUB_SAVEDEFAULT \ - GRUB_ENABLE_CRYPTODISK \ - GRUB_BADRAM \ - GRUB_OS_PROBER_SKIP_LIST \ - GRUB_DISABLE_SUBMENU +export VasEBoot_DEFAULT \ + VasEBoot_HIDDEN_TIMEOUT \ + VasEBoot_HIDDEN_TIMEOUT_QUIET \ + VasEBoot_TIMEOUT \ + VasEBoot_TIMEOUT_STYLE \ + VasEBoot_DEFAULT_BUTTON \ + VasEBoot_HIDDEN_TIMEOUT_BUTTON \ + VasEBoot_TIMEOUT_BUTTON \ + VasEBoot_TIMEOUT_STYLE_BUTTON \ + VasEBoot_BUTTON_CMOS_ADDRESS \ + VasEBoot_BUTTON_CMOS_CLEAN \ + VasEBoot_DISTRIBUTOR \ + VasEBoot_CMDLINE_LINUX \ + VasEBoot_CMDLINE_LINUX_DEFAULT \ + VasEBoot_CMDLINE_XEN \ + VasEBoot_CMDLINE_XEN_DEFAULT \ + VasEBoot_CMDLINE_LINUX_XEN_REPLACE \ + VasEBoot_CMDLINE_LINUX_XEN_REPLACE_DEFAULT \ + VasEBoot_CMDLINE_NETBSD \ + VasEBoot_CMDLINE_NETBSD_DEFAULT \ + VasEBoot_CMDLINE_GNUMACH \ + VasEBoot_TERMINAL_INPUT \ + VasEBoot_TERMINAL_OUTPUT \ + VasEBoot_SERIAL_COMMAND \ + VasEBoot_DISABLE_LINUX_UUID \ + VasEBoot_DISABLE_RECOVERY \ + VasEBoot_VIDEO_BACKEND \ + VasEBoot_GFXMODE \ + VasEBoot_BACKGROUND \ + VasEBoot_THEME \ + VasEBoot_GFXPAYLOAD_LINUX \ + VasEBoot_DISABLE_OS_PROBER \ + VasEBoot_INIT_TUNE \ + VasEBoot_SAVEDEFAULT \ + VasEBoot_ENABLE_CRYPTODISK \ + VasEBoot_BADRAM \ + VasEBoot_OS_PROBER_SKIP_LIST \ + VasEBoot_DISABLE_SUBMENU -if test "x${grub_cfg}" != "x"; then - rm -f "${grub_cfg}.new" +if test "x${VasEBoot_cfg}" != "x"; then + rm -f "${VasEBoot_cfg}.new" oldumask=$(umask); umask 077 - exec > "${grub_cfg}.new" + exec > "${VasEBoot_cfg}.new" umask $oldumask fi -gettext "Generating grub configuration file ..." >&2 +gettext "Generating VasEBoot configuration file ..." >&2 echo >&2 cat << EOF @@ -243,19 +243,19 @@ cat << EOF # DO NOT EDIT THIS FILE # # It is automatically generated by $self using templates -# from ${grub_mkconfig_dir} and settings from ${sysconfdir}/default/grub +# from ${VasEBoot_mkconfig_dir} and settings from ${sysconfdir}/default/VasEBoot # EOF -for i in "${grub_mkconfig_dir}"/* ; do +for i in "${VasEBoot_mkconfig_dir}"/* ; do case "$i" in # emacsen backup files. FIXME: support other editors *~) ;; # emacsen autosave files. FIXME: support other editors */\#*\#) ;; *) - if grub_file_is_not_garbage "$i" && test -x "$i" ; then + if VasEBoot_file_is_not_garbage "$i" && test -x "$i" ; then echo echo "### BEGIN $i ###" "$i" @@ -265,18 +265,18 @@ for i in "${grub_mkconfig_dir}"/* ; do esac done -if test "x${grub_cfg}" != "x" ; then - if ! ${grub_script_check} ${grub_cfg}.new; then +if test "x${VasEBoot_cfg}" != "x" ; then + if ! ${VasEBoot_script_check} ${VasEBoot_cfg}.new; then # TRANSLATORS: %s is replaced by filename - gettext_printf "Syntax errors are detected in generated GRUB config file. -Ensure that there are no errors in /etc/default/grub -and /etc/grub.d/* files or please file a bug report with -%s file attached." "${grub_cfg}.new" >&2 + gettext_printf "Syntax errors are detected in generated VasEBoot config file. +Ensure that there are no errors in /etc/default/VasEBoot +and /etc/VasEBoot.d/* files or please file a bug report with +%s file attached." "${VasEBoot_cfg}.new" >&2 echo >&2 exit 1 else - # none of the children aborted with error, install the new grub.cfg - mv -f ${grub_cfg}.new ${grub_cfg} + # none of the children aborted with error, install the new VasEBoot.cfg + mv -f ${VasEBoot_cfg}.new ${VasEBoot_cfg} fi fi diff --git a/util/VasEBoot-mkconfig_lib.in b/util/VasEBoot-mkconfig_lib.in index 60b31cadd..0e46c91cb 100644 --- a/util/VasEBoot-mkconfig_lib.in +++ b/util/VasEBoot-mkconfig_lib.in @@ -1,18 +1,18 @@ -# Helper library for grub-mkconfig +# Helper library for VasEBoot-mkconfig # Copyright (C) 2007,2008,2009,2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . prefix="@prefix@" exec_prefix="@exec_prefix@" @@ -24,14 +24,14 @@ if [ "x$pkgdatadir" = x ]; then pkgdatadir="${datadir}/@PACKAGE@" fi -if test "x$grub_probe" = x; then - grub_probe="${sbindir}/@grub_probe@" +if test "x$VasEBoot_probe" = x; then + VasEBoot_probe="${sbindir}/@VasEBoot_probe@" fi -if test "x$grub_file" = x; then - grub_file="${bindir}/@grub_file@" +if test "x$VasEBoot_file" = x; then + VasEBoot_file="${bindir}/@VasEBoot_file@" fi -if test "x$grub_mkrelpath" = x; then - grub_mkrelpath="${bindir}/@grub_mkrelpath@" +if test "x$VasEBoot_mkrelpath" = x; then + VasEBoot_mkrelpath="${bindir}/@VasEBoot_mkrelpath@" fi if which gettext >/dev/null 2>/dev/null; then @@ -42,17 +42,17 @@ else } fi -grub_warn () +VasEBoot_warn () { echo "$(gettext "Warning:")" "$@" >&2 } make_system_path_relative_to_its_root () { - "${grub_mkrelpath}" "$1" + "${VasEBoot_mkrelpath}" "$1" } -is_path_readable_by_grub () +is_path_readable_by_VasEBoot () { path="$1" @@ -62,19 +62,19 @@ is_path_readable_by_grub () fi # abort if file is in a filesystem we can't read - if "${grub_probe}" -t fs "$path" > /dev/null 2>&1 ; then : ; else + if "${VasEBoot_probe}" -t fs "$path" > /dev/null 2>&1 ; then : ; else return 1 fi # ... or if we can't figure out the abstraction module, for example if # memberlist fails on an LVM volume group. - if abstractions="`"${grub_probe}" -t abstraction "$path"`" 2> /dev/null ; then + if abstractions="`"${VasEBoot_probe}" -t abstraction "$path"`" 2> /dev/null ; then : else return 1 fi - if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then + if [ x$VasEBoot_ENABLE_CRYPTODISK = xy ]; then return 0 fi @@ -87,18 +87,18 @@ is_path_readable_by_grub () return 0 } -convert_system_path_to_grub_path () +convert_system_path_to_VasEBoot_path () { path="$1" - grub_warn "convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." + VasEBoot_warn "convert_system_path_to_VasEBoot_path() is deprecated. Use prepare_VasEBoot_to_access_device() instead." - # abort if GRUB can't access the path - if is_path_readable_by_grub "${path}" ; then : ; else + # abort if VasEBoot can't access the path + if is_path_readable_by_VasEBoot "${path}" ; then : ; else return 1 fi - if drive="`"${grub_probe}" -t drive "$path"`" ; then : ; else + if drive="`"${VasEBoot_probe}" -t drive "$path"`" ; then : ; else return 1 fi @@ -111,19 +111,19 @@ convert_system_path_to_grub_path () save_default_entry () { - if [ "x${GRUB_SAVEDEFAULT}" = "xtrue" ] ; then + if [ "x${VasEBoot_SAVEDEFAULT}" = "xtrue" ] ; then cat << EOF savedefault EOF fi } -prepare_grub_to_access_device () +prepare_VasEBoot_to_access_device () { old_ifs="$IFS" IFS=' ' - partmap="`"${grub_probe}" --device $@ --target=partmap`" + partmap="`"${VasEBoot_probe}" --device $@ --target=partmap`" for module in ${partmap} ; do case "${module}" in netbsd | openbsd) @@ -134,30 +134,30 @@ prepare_grub_to_access_device () done # Abstraction modules aren't auto-loaded. - abstraction="`"${grub_probe}" --device $@ --target=abstraction`" + abstraction="`"${VasEBoot_probe}" --device $@ --target=abstraction`" for module in ${abstraction} ; do echo "insmod ${module}" done - fs="`"${grub_probe}" --device $@ --target=fs`" + fs="`"${VasEBoot_probe}" --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 + if [ x$VasEBoot_ENABLE_CRYPTODISK = xy ]; then + for uuid in `"${VasEBoot_probe}" --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; + # If there's a filesystem UUID that VasEBoot 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="`"${VasEBoot_probe}" --device $@ --target=compatibility_hint`" if [ "x$fs_hint" != x ]; then echo "set root='$fs_hint'" fi - if fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then - hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints= + if fs_uuid="`"${VasEBoot_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then + hints="`"${VasEBoot_probe}" --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 "else" @@ -167,13 +167,13 @@ prepare_grub_to_access_device () IFS="$old_ifs" } -grub_get_device_id () +VasEBoot_get_device_id () { old_ifs="$IFS" IFS=' ' device="$1" - if fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then + if fs_uuid="`"${VasEBoot_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then echo "$fs_uuid"; else echo $device |sed 's, ,_,g' @@ -181,7 +181,7 @@ grub_get_device_id () IFS="$old_ifs" } -grub_file_is_not_garbage () +VasEBoot_file_is_not_garbage () { if test -f "$1" ; then case "$1" in @@ -266,12 +266,12 @@ version_find_latest () # One layer of quotation is eaten by "" and the second by sed; so this turns # ' into \'. -grub_quote () { +VasEBoot_quote () { sed "s/'/'\\\\''/g" } gettext_quoted () { - gettext "$@" | grub_quote + gettext "$@" | VasEBoot_quote } # Run the first argument through gettext, and then pass that and all @@ -289,7 +289,7 @@ uses_abstraction () { IFS=' ' - abstraction="`"${grub_probe}" --device ${device} --target=abstraction`" + abstraction="`"${VasEBoot_probe}" --device ${device} --target=abstraction`" for module in ${abstraction}; do if test "x${module}" = "x$2"; then IFS="$old_ifs" @@ -310,11 +310,11 @@ print_option_help () { print_option_help_wc=-b fi fi - if test x$grub_have_fmt = x; then + if test x$VasEBoot_have_fmt = x; then if fmt -w 40 /dev/null 2>&1; then - grub_have_fmt=y; + VasEBoot_have_fmt=y; else - grub_have_fmt=n; + VasEBoot_have_fmt=n; fi fi print_option_help_lead=" $1" @@ -332,7 +332,7 @@ print_option_help () { done print_option_help_nl=n fi - if test x$grub_have_fmt = xy; then + if test x$VasEBoot_have_fmt = xy; then print_option_help_split="$(echo "$2" | fmt -w 50)" else print_option_help_split="$2" @@ -346,25 +346,25 @@ print_option_help () { fi } -grub_fmt () { - if test x$grub_have_fmt = x; then +VasEBoot_fmt () { + if test x$VasEBoot_have_fmt = x; then if fmt -w 40 < /dev/null > /dev/null; then - grub_have_fmt=y; + VasEBoot_have_fmt=y; else - grub_have_fmt=n; + VasEBoot_have_fmt=n; fi fi - if test x$grub_have_fmt = xy; then + if test x$VasEBoot_have_fmt = xy; then fmt else cat fi } -grub_tab=" " +VasEBoot_tab=" " -grub_add_tab () { - sed -e "s/^/$grub_tab/" +VasEBoot_add_tab () { + sed -e "s/^/$VasEBoot_tab/" } diff --git a/util/VasEBoot-mkfont.c b/util/VasEBoot-mkfont.c index 0fe45a610..f2c15e639 100644 --- a/util/VasEBoot-mkfont.c +++ b/util/VasEBoot-mkfont.c @@ -1,37 +1,37 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#ifndef GRUB_BUILD +#ifndef VasEBoot_BUILD #define _GNU_SOURCE 1 #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wmissing-declarations" @@ -55,29 +55,29 @@ #define FT_ERROR_END_LIST }; #include FT_ERRORS_H -#ifndef GRUB_BUILD +#ifndef VasEBoot_BUILD #include "progname.h" #endif -#ifdef GRUB_BUILD -#define grub_util_fopen fopen +#ifdef VasEBoot_BUILD +#define VasEBoot_util_fopen fopen #endif -#define GRUB_FONT_DEFAULT_SIZE 16 +#define VasEBoot_FONT_DEFAULT_SIZE 16 -#define GRUB_FONT_RANGE_BLOCK 1024 +#define VasEBoot_FONT_RANGE_BLOCK 1024 -struct grub_glyph_info +struct VasEBoot_glyph_info { - struct grub_glyph_info *next; - grub_uint32_t char_code; + struct VasEBoot_glyph_info *next; + VasEBoot_uint32_t char_code; int width; int height; int x_ofs; int y_ofs; int device_width; int bitmap_size; - grub_uint8_t *bitmap; + VasEBoot_uint8_t *bitmap; }; enum file_formats @@ -87,13 +87,13 @@ enum file_formats enum { - GRUB_FONT_FLAG_BOLD = 1, - GRUB_FONT_FLAG_NOBITMAP = 2, - GRUB_FONT_FLAG_NOHINTING = 4, - GRUB_FONT_FLAG_FORCEHINT = 8 + VasEBoot_FONT_FLAG_BOLD = 1, + VasEBoot_FONT_FLAG_NOBITMAP = 2, + VasEBoot_FONT_FLAG_NOHINTING = 4, + VasEBoot_FONT_FLAG_FORCEHINT = 8 }; -struct grub_font_info +struct VasEBoot_font_info { const char *name; int style; @@ -106,16 +106,16 @@ struct grub_font_info int max_y; int flags; int num_range; - grub_uint32_t *ranges; - struct grub_glyph_info *glyphs_unsorted; - struct grub_glyph_info *glyphs_sorted; + VasEBoot_uint32_t *ranges; + struct VasEBoot_glyph_info *glyphs_unsorted; + struct VasEBoot_glyph_info *glyphs_sorted; int num_glyphs; }; static int font_verbosity; static void -add_pixel (grub_uint8_t **data, int *mask, int not_blank) +add_pixel (VasEBoot_uint8_t **data, int *mask, int not_blank) { if (*mask == 0) { @@ -131,40 +131,40 @@ add_pixel (grub_uint8_t **data, int *mask, int not_blank) } static void -add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, - grub_uint32_t char_code, int nocut) +add_glyph (struct VasEBoot_font_info *font_info, FT_UInt glyph_idx, FT_Face face, + VasEBoot_uint32_t char_code, int nocut) { - struct grub_glyph_info *glyph_info; + struct VasEBoot_glyph_info *glyph_info; int width, height; int cuttop, cutbottom, cutleft, cutright; - grub_uint8_t *data; + VasEBoot_uint8_t *data; int mask, i, j, bitmap_size; FT_GlyphSlot glyph; int flag = FT_LOAD_RENDER | FT_LOAD_MONOCHROME; FT_Error err; - if (font_info->flags & GRUB_FONT_FLAG_NOBITMAP) + if (font_info->flags & VasEBoot_FONT_FLAG_NOBITMAP) flag |= FT_LOAD_NO_BITMAP; - if (font_info->flags & GRUB_FONT_FLAG_NOHINTING) + if (font_info->flags & VasEBoot_FONT_FLAG_NOHINTING) flag |= FT_LOAD_NO_HINTING; - else if (font_info->flags & GRUB_FONT_FLAG_FORCEHINT) + else if (font_info->flags & VasEBoot_FONT_FLAG_FORCEHINT) flag |= FT_LOAD_FORCE_AUTOHINT; err = FT_Load_Glyph (face, glyph_idx, flag); if (err) { printf (_("Freetype Error %d loading glyph 0x%x for U+0x%x%s"), - err, glyph_idx, char_code & GRUB_FONT_CODE_CHAR_MASK, - char_code & GRUB_FONT_CODE_RIGHT_JOINED + err, glyph_idx, char_code & VasEBoot_FONT_CODE_CHAR_MASK, + char_code & VasEBoot_FONT_CODE_RIGHT_JOINED /* TRANSLATORS: These qualifiers are used for cursive typography, mainly Arabic. Note that the terms refer to the visual position and not logical order and if used in left-to-right script then leftmost is initial but with right-to-left script like Arabic rightmost is the initial. */ - ? ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? _(" (medial)"): + ? ((char_code & VasEBoot_FONT_CODE_LEFT_JOINED) ? _(" (medial)"): _(" (leftmost)")) - : ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? _(" (rightmost)"): + : ((char_code & VasEBoot_FONT_CODE_LEFT_JOINED) ? _(" (rightmost)"): "")); if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs)) @@ -176,7 +176,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, glyph = face->glyph; - if (font_info->flags & GRUB_FONT_FLAG_BOLD) + if (font_info->flags & VasEBoot_FONT_FLAG_BOLD) FT_GlyphSlot_Embolden (glyph); if (nocut) @@ -233,7 +233,7 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face, height = glyph->bitmap.rows - cutbottom - cuttop; bitmap_size = ((width * height + 7) / 8); - glyph_info = xmalloc (sizeof (struct grub_glyph_info)); + glyph_info = xmalloc (sizeof (struct VasEBoot_glyph_info)); glyph_info->bitmap = xmalloc (bitmap_size); glyph_info->bitmap_size = bitmap_size; @@ -274,13 +274,13 @@ struct glyph_replace *subst_rightjoin, *subst_leftjoin, *subst_medijoin; struct glyph_replace { struct glyph_replace *next; - grub_uint32_t from, to; + VasEBoot_uint32_t from, to; }; /* TODO: sort glyph_replace and use binary search if necessary. */ static void -add_char (struct grub_font_info *font_info, FT_Face face, - grub_uint32_t char_code, int nocut) +add_char (struct VasEBoot_font_info *font_info, FT_Face face, + VasEBoot_uint32_t char_code, int nocut) { FT_UInt glyph_idx; struct glyph_replace *cur; @@ -293,23 +293,23 @@ add_char (struct grub_font_info *font_info, FT_Face face, if (cur->from == glyph_idx) { add_glyph (font_info, cur->to, face, - char_code | GRUB_FONT_CODE_RIGHT_JOINED, nocut); + char_code | VasEBoot_FONT_CODE_RIGHT_JOINED, nocut); break; } - if (!cur && char_code >= GRUB_UNICODE_ARABIC_START - && char_code < GRUB_UNICODE_ARABIC_END) + if (!cur && char_code >= VasEBoot_UNICODE_ARABIC_START + && char_code < VasEBoot_UNICODE_ARABIC_END) { int i; - for (i = 0; grub_unicode_arabic_shapes[i].code; i++) - if (grub_unicode_arabic_shapes[i].code == char_code - && grub_unicode_arabic_shapes[i].right_linked) + for (i = 0; VasEBoot_unicode_arabic_shapes[i].code; i++) + if (VasEBoot_unicode_arabic_shapes[i].code == char_code + && VasEBoot_unicode_arabic_shapes[i].right_linked) { FT_UInt idx2; - idx2 = FT_Get_Char_Index (face, grub_unicode_arabic_shapes[i] + idx2 = FT_Get_Char_Index (face, VasEBoot_unicode_arabic_shapes[i] .right_linked); if (idx2) add_glyph (font_info, idx2, face, - char_code | GRUB_FONT_CODE_RIGHT_JOINED, nocut); + char_code | VasEBoot_FONT_CODE_RIGHT_JOINED, nocut); break; } @@ -319,23 +319,23 @@ add_char (struct grub_font_info *font_info, FT_Face face, if (cur->from == glyph_idx) { add_glyph (font_info, cur->to, face, - char_code | GRUB_FONT_CODE_LEFT_JOINED, nocut); + char_code | VasEBoot_FONT_CODE_LEFT_JOINED, nocut); break; } - if (!cur && char_code >= GRUB_UNICODE_ARABIC_START - && char_code < GRUB_UNICODE_ARABIC_END) + if (!cur && char_code >= VasEBoot_UNICODE_ARABIC_START + && char_code < VasEBoot_UNICODE_ARABIC_END) { int i; - for (i = 0; grub_unicode_arabic_shapes[i].code; i++) - if (grub_unicode_arabic_shapes[i].code == char_code - && grub_unicode_arabic_shapes[i].left_linked) + for (i = 0; VasEBoot_unicode_arabic_shapes[i].code; i++) + if (VasEBoot_unicode_arabic_shapes[i].code == char_code + && VasEBoot_unicode_arabic_shapes[i].left_linked) { FT_UInt idx2; - idx2 = FT_Get_Char_Index (face, grub_unicode_arabic_shapes[i] + idx2 = FT_Get_Char_Index (face, VasEBoot_unicode_arabic_shapes[i] .left_linked); if (idx2) add_glyph (font_info, idx2, face, - char_code | GRUB_FONT_CODE_LEFT_JOINED, nocut); + char_code | VasEBoot_FONT_CODE_LEFT_JOINED, nocut); break; } @@ -344,25 +344,25 @@ add_char (struct grub_font_info *font_info, FT_Face face, if (cur->from == glyph_idx) { add_glyph (font_info, cur->to, face, - char_code | GRUB_FONT_CODE_LEFT_JOINED - | GRUB_FONT_CODE_RIGHT_JOINED, nocut); + char_code | VasEBoot_FONT_CODE_LEFT_JOINED + | VasEBoot_FONT_CODE_RIGHT_JOINED, nocut); break; } - if (!cur && char_code >= GRUB_UNICODE_ARABIC_START - && char_code < GRUB_UNICODE_ARABIC_END) + if (!cur && char_code >= VasEBoot_UNICODE_ARABIC_START + && char_code < VasEBoot_UNICODE_ARABIC_END) { int i; - for (i = 0; grub_unicode_arabic_shapes[i].code; i++) - if (grub_unicode_arabic_shapes[i].code == char_code - && grub_unicode_arabic_shapes[i].both_linked) + for (i = 0; VasEBoot_unicode_arabic_shapes[i].code; i++) + if (VasEBoot_unicode_arabic_shapes[i].code == char_code + && VasEBoot_unicode_arabic_shapes[i].both_linked) { FT_UInt idx2; - idx2 = FT_Get_Char_Index (face, grub_unicode_arabic_shapes[i] + idx2 = FT_Get_Char_Index (face, VasEBoot_unicode_arabic_shapes[i] .both_linked); if (idx2) add_glyph (font_info, idx2, face, - char_code | GRUB_FONT_CODE_LEFT_JOINED - | GRUB_FONT_CODE_RIGHT_JOINED, nocut); + char_code | VasEBoot_FONT_CODE_LEFT_JOINED + | VasEBoot_FONT_CODE_RIGHT_JOINED, nocut); break; } @@ -371,15 +371,15 @@ add_char (struct grub_font_info *font_info, FT_Face face, struct gsub_header { - grub_uint32_t version; - grub_uint16_t scripts_off; - grub_uint16_t features_off; - grub_uint16_t lookups_off; -} GRUB_PACKED; + VasEBoot_uint32_t version; + VasEBoot_uint16_t scripts_off; + VasEBoot_uint16_t features_off; + VasEBoot_uint16_t lookups_off; +} VasEBoot_PACKED; struct gsub_features { - grub_uint16_t count; + VasEBoot_uint16_t count; struct { #define FEATURE_FINA 0x66696e61 @@ -388,65 +388,65 @@ struct gsub_features #define FEATURE_AALT 0x61616c74 #define FEATURE_LIGA 0x6c696761 #define FEATURE_RLIG 0x726c6967 - grub_uint32_t feature_tag; - grub_uint16_t offset; - } GRUB_PACKED features[0]; -} GRUB_PACKED; + VasEBoot_uint32_t feature_tag; + VasEBoot_uint16_t offset; + } VasEBoot_PACKED features[0]; +} VasEBoot_PACKED; struct gsub_feature { - grub_uint16_t params; - grub_uint16_t lookupcount; - grub_uint16_t lookupindices[0]; -} GRUB_PACKED; + VasEBoot_uint16_t params; + VasEBoot_uint16_t lookupcount; + VasEBoot_uint16_t lookupindices[0]; +} VasEBoot_PACKED; struct gsub_lookup_list { - grub_uint16_t count; - grub_uint16_t offsets[0]; -} GRUB_PACKED; + VasEBoot_uint16_t count; + VasEBoot_uint16_t offsets[0]; +} VasEBoot_PACKED; struct gsub_lookup { - grub_uint16_t type; - grub_uint16_t flag; - grub_uint16_t subtablecount; - grub_uint16_t subtables[0]; -} GRUB_PACKED; + VasEBoot_uint16_t type; + VasEBoot_uint16_t flag; + VasEBoot_uint16_t subtablecount; + VasEBoot_uint16_t subtables[0]; +} VasEBoot_PACKED; struct gsub_substitution { - grub_uint16_t type; - grub_uint16_t coverage_off; + VasEBoot_uint16_t type; + VasEBoot_uint16_t coverage_off; union { - grub_int16_t delta; + VasEBoot_int16_t delta; struct { - grub_int16_t count; - grub_uint16_t repl[0]; + VasEBoot_int16_t count; + VasEBoot_uint16_t repl[0]; }; }; -} GRUB_PACKED; +} VasEBoot_PACKED; struct gsub_coverage_list { - grub_uint16_t type; - grub_uint16_t count; - grub_uint16_t glyphs[0]; -} GRUB_PACKED; + VasEBoot_uint16_t type; + VasEBoot_uint16_t count; + VasEBoot_uint16_t glyphs[0]; +} VasEBoot_PACKED; struct gsub_coverage_ranges { - grub_uint16_t type; - grub_uint16_t count; + VasEBoot_uint16_t type; + VasEBoot_uint16_t count; struct { - grub_uint16_t start; - grub_uint16_t end; - grub_uint16_t start_index; - } GRUB_PACKED ranges[0]; -} GRUB_PACKED; + VasEBoot_uint16_t start; + VasEBoot_uint16_t end; + VasEBoot_uint16_t start_index; + } VasEBoot_PACKED ranges[0]; +} VasEBoot_PACKED; #define GSUB_SINGLE_SUBSTITUTION 1 @@ -459,7 +459,7 @@ struct gsub_coverage_ranges #define GSUB_RTL_CHAR 1 static void -add_subst (grub_uint32_t from, grub_uint32_t to, struct glyph_replace **target) +add_subst (VasEBoot_uint32_t from, VasEBoot_uint32_t to, struct glyph_replace **target) { struct glyph_replace *new = xmalloc (sizeof (*new)); new->next = *target; @@ -469,36 +469,36 @@ add_subst (grub_uint32_t from, grub_uint32_t to, struct glyph_replace **target) } static void -subst (const struct gsub_substitution *sub, grub_uint32_t glyph, +subst (const struct gsub_substitution *sub, VasEBoot_uint32_t glyph, struct glyph_replace **target, int *i) { - grub_uint16_t substtype; - substtype = grub_be_to_cpu16 (sub->type); + VasEBoot_uint16_t substtype; + substtype = VasEBoot_be_to_cpu16 (sub->type); if (substtype == GSUB_SUBSTITUTION_DELTA) - add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target); - else if (*i >= grub_be_to_cpu16 (sub->count)) + add_subst (glyph, glyph + VasEBoot_be_to_cpu16 (sub->delta), target); + else if (*i >= VasEBoot_be_to_cpu16 (sub->count)) printf (_("Out of range substitution (%d, %d)\n"), *i, - grub_be_to_cpu16 (sub->count)); + VasEBoot_be_to_cpu16 (sub->count)); else - add_subst (glyph, grub_be_to_cpu16 (sub->repl[(*i)++]), target); + add_subst (glyph, VasEBoot_be_to_cpu16 (sub->repl[(*i)++]), target); } static void process_cursive (struct gsub_feature *feature, struct gsub_lookup_list *lookups, - grub_uint32_t feattag) + VasEBoot_uint32_t feattag) { int j, k; int i; struct glyph_replace **target = NULL; struct gsub_substitution *sub; - for (j = 0; j < grub_be_to_cpu16 (feature->lookupcount); j++) + for (j = 0; j < VasEBoot_be_to_cpu16 (feature->lookupcount); j++) { - int lookup_index = grub_be_to_cpu16 (feature->lookupindices[j]); + int lookup_index = VasEBoot_be_to_cpu16 (feature->lookupindices[j]); struct gsub_lookup *lookup; - if (lookup_index >= grub_be_to_cpu16 (lookups->count)) + if (lookup_index >= VasEBoot_be_to_cpu16 (lookups->count)) { /* TRANSLATORS: "lookup" is taken directly from font specifications which are formulated as "Under condition X replace LOOKUP with @@ -507,29 +507,29 @@ process_cursive (struct gsub_feature *feature, continue; } lookup = (struct gsub_lookup *) - ((grub_uint8_t *) lookups - + grub_be_to_cpu16 (lookups->offsets[lookup_index])); - if (grub_be_to_cpu16 (lookup->type) != GSUB_SINGLE_SUBSTITUTION) + ((VasEBoot_uint8_t *) lookups + + VasEBoot_be_to_cpu16 (lookups->offsets[lookup_index])); + if (VasEBoot_be_to_cpu16 (lookup->type) != GSUB_SINGLE_SUBSTITUTION) { printf (_("Unsupported substitution type: %d\n"), - grub_be_to_cpu16 (lookup->type)); + VasEBoot_be_to_cpu16 (lookup->type)); continue; } - if (grub_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR) + if (VasEBoot_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR) { - grub_util_info ("unsupported substitution flag: 0x%x", - grub_be_to_cpu16 (lookup->flag)); + VasEBoot_util_info ("unsupported substitution flag: 0x%x", + VasEBoot_be_to_cpu16 (lookup->flag)); } switch (feattag) { case FEATURE_INIT: - if (grub_be_to_cpu16 (lookup->flag) & GSUB_RTL_CHAR) + if (VasEBoot_be_to_cpu16 (lookup->flag) & GSUB_RTL_CHAR) target = &subst_leftjoin; else target = &subst_rightjoin; break; case FEATURE_FINA: - if (grub_be_to_cpu16 (lookup->flag) & GSUB_RTL_CHAR) + if (VasEBoot_be_to_cpu16 (lookup->flag) & GSUB_RTL_CHAR) target = &subst_rightjoin; else target = &subst_leftjoin; @@ -538,12 +538,12 @@ process_cursive (struct gsub_feature *feature, target = &subst_medijoin; break; } - for (k = 0; k < grub_be_to_cpu16 (lookup->subtablecount); k++) + for (k = 0; k < VasEBoot_be_to_cpu16 (lookup->subtablecount); k++) { sub = (struct gsub_substitution *) - ((grub_uint8_t *) lookup + grub_be_to_cpu16 (lookup->subtables[k])); - grub_uint16_t substtype; - substtype = grub_be_to_cpu16 (sub->type); + ((VasEBoot_uint8_t *) lookup + VasEBoot_be_to_cpu16 (lookup->subtables[k])); + VasEBoot_uint16_t substtype; + substtype = VasEBoot_be_to_cpu16 (sub->type); if (substtype != GSUB_SUBSTITUTION_MAP && substtype != GSUB_SUBSTITUTION_DELTA) { @@ -551,25 +551,25 @@ process_cursive (struct gsub_feature *feature, substtype); continue; } - void *coverage = (grub_uint8_t *) sub - + grub_be_to_cpu16 (sub->coverage_off); - grub_uint32_t covertype; - covertype = grub_be_to_cpu16 (grub_get_unaligned16 (coverage)); + void *coverage = (VasEBoot_uint8_t *) sub + + VasEBoot_be_to_cpu16 (sub->coverage_off); + VasEBoot_uint32_t covertype; + covertype = VasEBoot_be_to_cpu16 (VasEBoot_get_unaligned16 (coverage)); i = 0; if (covertype == GSUB_COVERAGE_LIST) { struct gsub_coverage_list *cover = coverage; int l; - for (l = 0; l < grub_be_to_cpu16 (cover->count); l++) - subst (sub, grub_be_to_cpu16 (cover->glyphs[l]), target, &i); + for (l = 0; l < VasEBoot_be_to_cpu16 (cover->count); l++) + subst (sub, VasEBoot_be_to_cpu16 (cover->glyphs[l]), target, &i); } else if (covertype == GSUB_COVERAGE_RANGE) { struct gsub_coverage_ranges *cover = coverage; int l, m; - for (l = 0; l < grub_be_to_cpu16 (cover->count); l++) - for (m = grub_be_to_cpu16 (cover->ranges[l].start); - m <= grub_be_to_cpu16 (cover->ranges[l].end); m++) + for (l = 0; l < VasEBoot_be_to_cpu16 (cover->count); l++) + for (m = VasEBoot_be_to_cpu16 (cover->ranges[l].start); + m <= VasEBoot_be_to_cpu16 (cover->ranges[l].end); m++) subst (sub, m, target, &i); } else @@ -585,7 +585,7 @@ process_cursive (struct gsub_feature *feature, } static void -add_font (struct grub_font_info *font_info, FT_Face face, int nocut) +add_font (struct VasEBoot_font_info *font_info, FT_Face face, int nocut) { struct gsub_header *gsub = NULL; FT_ULong gsub_len = 0; @@ -603,27 +603,27 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut) if (gsub) { struct gsub_features *features - = (struct gsub_features *) (((grub_uint8_t *) gsub) - + grub_be_to_cpu16 (gsub->features_off)); + = (struct gsub_features *) (((VasEBoot_uint8_t *) gsub) + + VasEBoot_be_to_cpu16 (gsub->features_off)); struct gsub_lookup_list *lookups - = (struct gsub_lookup_list *) (((grub_uint8_t *) gsub) - + grub_be_to_cpu16 (gsub->lookups_off)); + = (struct gsub_lookup_list *) (((VasEBoot_uint8_t *) gsub) + + VasEBoot_be_to_cpu16 (gsub->lookups_off)); int i; - int nfeatures = grub_be_to_cpu16 (features->count); + int nfeatures = VasEBoot_be_to_cpu16 (features->count); for (i = 0; i < nfeatures; i++) { struct gsub_feature *feature = (struct gsub_feature *) - ((grub_uint8_t *) features - + grub_be_to_cpu16 (features->features[i].offset)); - grub_uint32_t feattag - = grub_be_to_cpu32 (features->features[i].feature_tag); + ((VasEBoot_uint8_t *) features + + VasEBoot_be_to_cpu16 (features->features[i].offset)); + VasEBoot_uint32_t feattag + = VasEBoot_be_to_cpu32 (features->features[i].feature_tag); if (feature->params) fprintf (stderr, _("WARNING: unsupported font feature parameters: %x\n"), - grub_be_to_cpu16 (feature->params)); + VasEBoot_be_to_cpu16 (feature->params)); switch (feattag) { - /* Used for retrieving all possible variants. Useless in grub. */ + /* Used for retrieving all possible variants. Useless in VasEBoot. */ case FEATURE_AALT: break; @@ -647,10 +647,10 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut) sizeof (features->features[i].feature_tag)); str[4] = 0; for (j = 0; j < 4; j++) - if (!grub_isgraph (str[j])) + if (!VasEBoot_isgraph (str[j])) str[j] = '?'; /* TRANSLATORS: It's gsub feature, not gsub font. */ - grub_util_info ("Unknown gsub font feature 0x%x (%s)", + VasEBoot_util_info ("Unknown gsub font feature 0x%x (%s)", feattag, str); } } @@ -660,7 +660,7 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut) if (font_info->num_range) { int i; - grub_uint32_t j; + VasEBoot_uint32_t j; for (i = 0; i < font_info->num_range; i++) for (j = font_info->ranges[i * 2]; j <= font_info->ranges[i * 2 + 1]; @@ -669,7 +669,7 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut) } else { - grub_uint32_t char_code, glyph_index; + VasEBoot_uint32_t char_code, glyph_index; for (char_code = FT_Get_First_Char (face, &glyph_index); glyph_index; @@ -683,45 +683,45 @@ write_string_section (const char *name, const char *str, int *offset, FILE *file, const char *filename) { - grub_uint32_t leng, leng_be32; + VasEBoot_uint32_t leng, leng_be32; leng = strlen (str) + 1; - leng_be32 = grub_cpu_to_be32 (leng); + leng_be32 = VasEBoot_cpu_to_be32 (leng); - grub_util_write_image (name, 4, file, filename); - grub_util_write_image ((char *) &leng_be32, 4, file, filename); - grub_util_write_image (str, leng, file, filename); + VasEBoot_util_write_image (name, 4, file, filename); + VasEBoot_util_write_image ((char *) &leng_be32, 4, file, filename); + VasEBoot_util_write_image (str, leng, file, filename); *offset += 8 + leng; } static void -write_be16_section (const char *name, grub_uint16_t data, int* offset, +write_be16_section (const char *name, VasEBoot_uint16_t data, int* offset, FILE *file, const char *filename) { - grub_uint32_t leng; + VasEBoot_uint32_t leng; - leng = grub_cpu_to_be32_compile_time (2); - data = grub_cpu_to_be16 (data); - grub_util_write_image (name, 4, file, filename); - grub_util_write_image ((char *) &leng, 4, file, filename); - grub_util_write_image ((char *) &data, 2, file, filename); + leng = VasEBoot_cpu_to_be32_compile_time (2); + data = VasEBoot_cpu_to_be16 (data); + VasEBoot_util_write_image (name, 4, file, filename); + VasEBoot_util_write_image ((char *) &leng, 4, file, filename); + VasEBoot_util_write_image ((char *) &data, 2, file, filename); *offset += 10; } static void -print_glyphs (struct grub_font_info *font_info) +print_glyphs (struct VasEBoot_font_info *font_info) { int num; - struct grub_glyph_info *glyph; + struct VasEBoot_glyph_info *glyph; char line[512]; for (glyph = font_info->glyphs_sorted, num = 0; num < font_info->num_glyphs; glyph++, num++) { int x, y, xmax, xmin, ymax, ymin; - grub_uint8_t *bitmap, mask; + VasEBoot_uint8_t *bitmap, mask; printf ("\nGlyph #%d, U+%04x\n", num, glyph->char_code); printf ("Width %d, Height %d, X offset %d, Y offset %d, Device width %d\n", @@ -783,33 +783,33 @@ print_glyphs (struct grub_font_info *font_info) } static void -write_font_pf2 (struct grub_font_info *font_info, char *output_file) +write_font_pf2 (struct VasEBoot_font_info *font_info, char *output_file) { FILE *file; - grub_uint32_t leng; + VasEBoot_uint32_t leng; char style_name[20], *font_name, *ptr; int offset; - struct grub_glyph_info *cur; + struct VasEBoot_glyph_info *cur; - file = grub_util_fopen (output_file, "wb"); + file = VasEBoot_util_fopen (output_file, "wb"); if (! file) - grub_util_error (_("cannot write to `%s': %s"), output_file, + VasEBoot_util_error (_("cannot write to `%s': %s"), output_file, strerror (errno)); offset = 0; - leng = grub_cpu_to_be32_compile_time (4); - grub_util_write_image (FONT_FORMAT_SECTION_NAMES_FILE, + leng = VasEBoot_cpu_to_be32_compile_time (4); + VasEBoot_util_write_image (FONT_FORMAT_SECTION_NAMES_FILE, sizeof(FONT_FORMAT_SECTION_NAMES_FILE) - 1, file, output_file); - grub_util_write_image ((char *) &leng, 4, file, output_file); - grub_util_write_image (FONT_FORMAT_PFF2_MAGIC, 4, file, output_file); + VasEBoot_util_write_image ((char *) &leng, 4, file, output_file); + VasEBoot_util_write_image (FONT_FORMAT_PFF2_MAGIC, 4, file, output_file); offset += 12; if (! font_info->name) font_info->name = "Unknown"; - if (font_info->flags & GRUB_FONT_FLAG_BOLD) + if (font_info->flags & VasEBoot_FONT_FLAG_BOLD) font_info->style |= FT_STYLE_FLAG_BOLD; style_name[0] = 0; @@ -824,9 +824,9 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file) font_name = xmalloc (strlen (font_info->name) + strlen (&style_name[1]) + 3 + 20); - ptr = grub_stpcpy (font_name, font_info->name); + ptr = VasEBoot_stpcpy (font_name, font_info->name); *ptr++ = ' '; - ptr = grub_stpcpy (ptr, &style_name[1]); + ptr = VasEBoot_stpcpy (ptr, &style_name[1]); *ptr++ = ' '; snprintf (ptr, 20, "%d", font_info->size); @@ -883,55 +883,55 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file) if (font_verbosity > 0) printf ("Number of glyph: %d\n", font_info->num_glyphs); - leng = grub_cpu_to_be32 (font_info->num_glyphs * 9); - grub_util_write_image (FONT_FORMAT_SECTION_NAMES_CHAR_INDEX, + leng = VasEBoot_cpu_to_be32 (font_info->num_glyphs * 9); + VasEBoot_util_write_image (FONT_FORMAT_SECTION_NAMES_CHAR_INDEX, sizeof(FONT_FORMAT_SECTION_NAMES_CHAR_INDEX) - 1, file, output_file); - grub_util_write_image ((char *) &leng, 4, file, output_file); + VasEBoot_util_write_image ((char *) &leng, 4, file, output_file); offset += 8 + font_info->num_glyphs * 9 + 8; for (cur = font_info->glyphs_sorted; cur < font_info->glyphs_sorted + font_info->num_glyphs; cur++) { - grub_uint32_t data32; - grub_uint8_t data8; - data32 = grub_cpu_to_be32 (cur->char_code); - grub_util_write_image ((char *) &data32, 4, file, output_file); + VasEBoot_uint32_t data32; + VasEBoot_uint8_t data8; + data32 = VasEBoot_cpu_to_be32 (cur->char_code); + VasEBoot_util_write_image ((char *) &data32, 4, file, output_file); data8 = 0; - grub_util_write_image ((char *) &data8, 1, file, output_file); - data32 = grub_cpu_to_be32 (offset); - grub_util_write_image ((char *) &data32, 4, file, output_file); + VasEBoot_util_write_image ((char *) &data8, 1, file, output_file); + data32 = VasEBoot_cpu_to_be32 (offset); + VasEBoot_util_write_image ((char *) &data32, 4, file, output_file); offset += 10 + cur->bitmap_size; } leng = 0xffffffff; - grub_util_write_image (FONT_FORMAT_SECTION_NAMES_DATA, + VasEBoot_util_write_image (FONT_FORMAT_SECTION_NAMES_DATA, sizeof(FONT_FORMAT_SECTION_NAMES_DATA) - 1, file, output_file); - grub_util_write_image ((char *) &leng, 4, file, output_file); + VasEBoot_util_write_image ((char *) &leng, 4, file, output_file); for (cur = font_info->glyphs_sorted; cur < font_info->glyphs_sorted + font_info->num_glyphs; cur++) { - grub_uint16_t data; - data = grub_cpu_to_be16 (cur->width); - grub_util_write_image ((char *) &data, 2, file, output_file); - data = grub_cpu_to_be16 (cur->height); - grub_util_write_image ((char *) &data, 2, file, output_file); - data = grub_cpu_to_be16 (cur->x_ofs); - grub_util_write_image ((char *) &data, 2, file, output_file); - data = grub_cpu_to_be16 (cur->y_ofs); - grub_util_write_image ((char *) &data, 2, file, output_file); - data = grub_cpu_to_be16 (cur->device_width); - grub_util_write_image ((char *) &data, 2, file, output_file); - grub_util_write_image ((char *) &cur->bitmap[0], cur->bitmap_size, + VasEBoot_uint16_t data; + data = VasEBoot_cpu_to_be16 (cur->width); + VasEBoot_util_write_image ((char *) &data, 2, file, output_file); + data = VasEBoot_cpu_to_be16 (cur->height); + VasEBoot_util_write_image ((char *) &data, 2, file, output_file); + data = VasEBoot_cpu_to_be16 (cur->x_ofs); + VasEBoot_util_write_image ((char *) &data, 2, file, output_file); + data = VasEBoot_cpu_to_be16 (cur->y_ofs); + VasEBoot_util_write_image ((char *) &data, 2, file, output_file); + data = VasEBoot_cpu_to_be16 (cur->device_width); + VasEBoot_util_write_image ((char *) &data, 2, file, output_file); + VasEBoot_util_write_image ((char *) &cur->bitmap[0], cur->bitmap_size, file, output_file); } fclose (file); } -#ifndef GRUB_BUILD +#ifndef VasEBoot_BUILD static struct argp_option options[] = { {"output", 'o', N_("FILE"), 0, N_("save output in FILE [required]"), 0}, /* TRANSLATORS: bitmaps are images like e.g. in JPEG. */ @@ -983,7 +983,7 @@ struct my_argp_state struct arguments { - struct grub_font_info font_info; + struct VasEBoot_font_info font_info; size_t nfiles; size_t files_max; char **files; @@ -993,7 +993,7 @@ struct arguments enum file_formats file_format; }; -#ifdef GRUB_BUILD +#ifdef VasEBoot_BUILD static int has_argument (int v) @@ -1014,19 +1014,19 @@ argp_parser (int key, char *arg, struct my_argp_state *state) switch (key) { case 'b': - arguments->font_info.flags |= GRUB_FONT_FLAG_BOLD; + arguments->font_info.flags |= VasEBoot_FONT_FLAG_BOLD; break; case 0x100: - arguments->font_info.flags |= GRUB_FONT_FLAG_NOBITMAP; + arguments->font_info.flags |= VasEBoot_FONT_FLAG_NOBITMAP; break; case 0x101: - arguments->font_info.flags |= GRUB_FONT_FLAG_NOHINTING; + arguments->font_info.flags |= VasEBoot_FONT_FLAG_NOHINTING; break; case 'a': - arguments->font_info.flags |= GRUB_FONT_FLAG_FORCEHINT; + arguments->font_info.flags |= VasEBoot_FONT_FLAG_FORCEHINT; break; case 'o': @@ -1051,19 +1051,19 @@ argp_parser (int key, char *arg, struct my_argp_state *state) while (1) { - grub_uint32_t a, b; + VasEBoot_uint32_t a, b; a = strtoul (p, &p, 0); if (*p != '-') /* TRANSLATORS: It refers to the range of characters in font. */ - grub_util_error ("%s", _("invalid font range")); + VasEBoot_util_error ("%s", _("invalid font range")); b = strtoul (p + 1, &p, 0); if ((arguments->font_info.num_range - & (GRUB_FONT_RANGE_BLOCK - 1)) == 0) + & (VasEBoot_FONT_RANGE_BLOCK - 1)) == 0) arguments->font_info.ranges = xrealloc (arguments->font_info.ranges, (arguments->font_info.num_range + - GRUB_FONT_RANGE_BLOCK) * - sizeof (grub_uint32_t) * 2); + VasEBoot_FONT_RANGE_BLOCK) * + sizeof (VasEBoot_uint32_t) * 2); arguments->font_info.ranges[arguments->font_info.num_range * 2] = a; arguments->font_info.ranges[arguments->font_info.num_range * 2 + 1] = b; @@ -1072,7 +1072,7 @@ argp_parser (int key, char *arg, struct my_argp_state *state) if (*p) { if (*p != ',') - grub_util_error ("%s", _("invalid font range")); + VasEBoot_util_error ("%s", _("invalid font range")); p++; } else @@ -1104,7 +1104,7 @@ argp_parser (int key, char *arg, struct my_argp_state *state) return 0; } -#ifdef GRUB_BUILD +#ifdef VasEBoot_BUILD /* We don't require host platform to have argp. In the same time configuring gnulib for build would result in even worse mess. So we have our @@ -1146,7 +1146,7 @@ my_argp_parse_real (int argc, char **argv, void *st) } #endif -#ifndef GRUB_BUILD +#ifndef VasEBoot_BUILD static struct argp argp = { options, argp_parser, N_("[OPTIONS] FONT_FILES"), N_("Convert common font file formats into PF2"), @@ -1160,8 +1160,8 @@ main (int argc, char *argv[]) FT_Library ft_lib; struct arguments arguments; -#ifndef GRUB_BUILD - grub_util_host_init (&argc, &argv); +#ifndef VasEBoot_BUILD + VasEBoot_util_host_init (&argc, &argv); #endif memset (&arguments, 0, sizeof (struct arguments)); @@ -1179,10 +1179,10 @@ main (int argc, char *argv[]) } if (! arguments.output_file) - grub_util_error ("%s", _("output file must be specified")); + VasEBoot_util_error ("%s", _("output file must be specified")); if (FT_Init_FreeType (&ft_lib)) - grub_util_error ("%s", _("FT_Init_FreeType fails")); + VasEBoot_util_error ("%s", _("FT_Init_FreeType fails")); { size_t i; @@ -1215,7 +1215,7 @@ main (int argc, char *argv[]) { if ((ft_face->face_flags & FT_FACE_FLAG_SCALABLE) || (! ft_face->num_fixed_sizes)) - size = GRUB_FONT_DEFAULT_SIZE; + size = VasEBoot_FONT_DEFAULT_SIZE; else size = ft_face->available_sizes[0].height; } @@ -1226,7 +1226,7 @@ main (int argc, char *argv[]) err = FT_Set_Pixel_Sizes (ft_face, size, size); if (err) - grub_util_error (_("can't set %dx%d font size: Freetype error %d: %s"), + VasEBoot_util_error (_("can't set %dx%d font size: Freetype error %d: %s"), size, size, err, (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs)) ? ft_errmsgs[err] : ""); @@ -1239,7 +1239,7 @@ main (int argc, char *argv[]) { int counter[65537]; - struct grub_glyph_info *tmp, *cur; + struct VasEBoot_glyph_info *tmp, *cur; int i; memset (counter, 0, sizeof (counter)); diff --git a/util/VasEBoot-mkimage.c b/util/VasEBoot-mkimage.c index aba19d21b..2892ab9bd 100644 --- a/util/VasEBoot-mkimage.c +++ b/util/VasEBoot-mkimage.c @@ -1,36 +1,36 @@ -/* grub-mkimage.c - make a bootable image */ +/* VasEBoot-mkimage.c - make a bootable image */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -39,13 +39,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -69,7 +69,7 @@ static struct argp_option options[] = { /* TRANSLATORS: "memdisk" here isn't an identifier, it can be translated. "embed" is a verb (command description). "*/ N_("embed FILE as a memdisk image\n" - "Implies `-p (memdisk)/boot/grub' and overrides any prefix supplied previously," + "Implies `-p (memdisk)/boot/VasEBoot' and overrides any prefix supplied previously," " but the prefix itself can be overridden by later options"), 0}, /* TRANSLATORS: "embed" is a verb (command description). "*/ {"config", 'c', N_("FILE"), 0, N_("embed FILE as an early config"), 0}, @@ -92,10 +92,10 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) switch (key) { case 'd': - return xasprintf (text, grub_util_get_pkglibdir ()); + return xasprintf (text, VasEBoot_util_get_pkglibdir ()); case 'O': { - char *formats = grub_install_get_image_targets_string (), *ret; + char *formats = VasEBoot_install_get_image_targets_string (), *ret; ret = xasprintf ("%s\n%s %s", _("generate an image in FORMAT"), _("available formats:"), formats); free (formats); @@ -122,8 +122,8 @@ struct arguments char *font; char *config; int note; - const struct grub_install_image_target_desc *image_target; - grub_compression_t comp; + const struct VasEBoot_install_image_target_desc *image_target; + VasEBoot_compression_t comp; }; static error_t @@ -144,7 +144,7 @@ argp_parser (int key, char *arg, struct argp_state *state) case 'O': { - arguments->image_target = grub_install_get_image_target (arg); + arguments->image_target = VasEBoot_install_get_image_target (arg); if (!arguments->image_target) { printf (_("unknown target format %s\n"), arg); @@ -173,7 +173,7 @@ argp_parser (int key, char *arg, struct argp_state *state) if (arguments->prefix) free (arguments->prefix); - arguments->prefix = xstrdup ("(memdisk)/boot/grub"); + arguments->prefix = xstrdup ("(memdisk)/boot/VasEBoot"); break; case 'k': @@ -191,21 +191,21 @@ argp_parser (int key, char *arg, struct argp_state *state) break; case 'C': - if (grub_strcmp (arg, "xz") == 0) + if (VasEBoot_strcmp (arg, "xz") == 0) { #ifdef HAVE_LIBLZMA - arguments->comp = GRUB_COMPRESSION_XZ; + arguments->comp = VasEBoot_COMPRESSION_XZ; #else - grub_util_error ("%s", - _("grub-mkimage is compiled without XZ support")); + VasEBoot_util_error ("%s", + _("VasEBoot-mkimage is compiled without XZ support")); #endif } - else if (grub_strcmp (arg, "none") == 0) - arguments->comp = GRUB_COMPRESSION_NONE; - else if (grub_strcmp (arg, "auto") == 0) - arguments->comp = GRUB_COMPRESSION_AUTO; + else if (VasEBoot_strcmp (arg, "none") == 0) + arguments->comp = VasEBoot_COMPRESSION_NONE; + else if (VasEBoot_strcmp (arg, "auto") == 0) + arguments->comp = VasEBoot_COMPRESSION_AUTO; else - grub_util_error (_("Unknown compression format %s"), arg); + VasEBoot_util_error (_("Unknown compression format %s"), arg); break; case 'p': @@ -231,7 +231,7 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp argp = { options, argp_parser, N_("[OPTION]... [MODULES]"), - N_("Make a bootable image of GRUB."), + N_("Make a bootable image of VasEBoot."), NULL, help_filter, NULL }; @@ -242,10 +242,10 @@ main (int argc, char *argv[]) struct arguments arguments; unsigned i; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); memset (&arguments, 0, sizeof (struct arguments)); - arguments.comp = GRUB_COMPRESSION_AUTO; + arguments.comp = VasEBoot_COMPRESSION_AUTO; arguments.modules_max = argc + 1; arguments.modules = xmalloc ((arguments.modules_max + 1) * sizeof (arguments.modules[0])); @@ -278,31 +278,31 @@ main (int argc, char *argv[]) if (arguments.output) { - fp = grub_util_fopen (arguments.output, "wb"); + fp = VasEBoot_util_fopen (arguments.output, "wb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), arguments.output, + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.output, strerror (errno)); } if (!arguments.dir) { - const char *dn = grub_util_get_target_dirname (arguments.image_target); - const char *pkglibdir = grub_util_get_pkglibdir (); + const char *dn = VasEBoot_util_get_target_dirname (arguments.image_target); + const char *pkglibdir = VasEBoot_util_get_pkglibdir (); char *ptr; - arguments.dir = xmalloc (grub_strlen (pkglibdir) + grub_strlen (dn) + 2); - ptr = grub_stpcpy (arguments.dir, pkglibdir); + arguments.dir = xmalloc (VasEBoot_strlen (pkglibdir) + VasEBoot_strlen (dn) + 2); + ptr = VasEBoot_stpcpy (arguments.dir, pkglibdir); *ptr++ = '/'; strcpy (ptr, dn); } - grub_install_generate_image (arguments.dir, arguments.prefix, fp, + VasEBoot_install_generate_image (arguments.dir, arguments.prefix, fp, arguments.output, arguments.modules, arguments.memdisk, arguments.pubkeys, arguments.npubkeys, arguments.config, arguments.image_target, arguments.note, arguments.comp); - grub_util_file_sync (fp); + VasEBoot_util_file_sync (fp); fclose (fp); for (i = 0; i < arguments.nmodules; i++) diff --git a/util/VasEBoot-mkimage32.c b/util/VasEBoot-mkimage32.c index 9b31397bc..96f740b49 100644 --- a/util/VasEBoot-mkimage32.c +++ b/util/VasEBoot-mkimage32.c @@ -19,4 +19,4 @@ # define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) #define XEN_NOTE_SIZE 132 -#include "grub-mkimagexx.c" +#include "VasEBoot-mkimagexx.c" diff --git a/util/VasEBoot-mkimage64.c b/util/VasEBoot-mkimage64.c index d83345924..ce241d051 100644 --- a/util/VasEBoot-mkimage64.c +++ b/util/VasEBoot-mkimage64.c @@ -19,4 +19,4 @@ # define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) #define XEN_NOTE_SIZE 120 -#include "grub-mkimagexx.c" +#include "VasEBoot-mkimagexx.c" diff --git a/util/VasEBoot-mkimagexx.c b/util/VasEBoot-mkimagexx.c index f20255a28..61f98da41 100644 --- a/util/VasEBoot-mkimagexx.c +++ b/util/VasEBoot-mkimagexx.c @@ -1,36 +1,36 @@ -/* grub-mkimage.c - make a bootable image */ +/* VasEBoot-mkimage.c - make a bootable image */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -39,53 +39,53 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wcast-align" /* These structures are defined according to the CHRP binding to IEEE1275, "Client Program Format" section. */ -struct grub_ieee1275_note_desc +struct VasEBoot_ieee1275_note_desc { - grub_uint32_t real_mode; - grub_uint32_t real_base; - grub_uint32_t real_size; - grub_uint32_t virt_base; - grub_uint32_t virt_size; - grub_uint32_t load_base; + VasEBoot_uint32_t real_mode; + VasEBoot_uint32_t real_base; + VasEBoot_uint32_t real_size; + VasEBoot_uint32_t virt_base; + VasEBoot_uint32_t virt_size; + VasEBoot_uint32_t load_base; }; -#define GRUB_IEEE1275_NOTE_NAME "PowerPC" -#define GRUB_IEEE1275_NOTE_TYPE 0x1275 +#define VasEBoot_IEEE1275_NOTE_NAME "PowerPC" +#define VasEBoot_IEEE1275_NOTE_TYPE 0x1275 -struct grub_ieee1275_note +struct VasEBoot_ieee1275_note { Elf32_Nhdr header; - char name[ALIGN_UP(sizeof (GRUB_IEEE1275_NOTE_NAME), 4)]; - struct grub_ieee1275_note_desc descriptor; + char name[ALIGN_UP(sizeof (VasEBoot_IEEE1275_NOTE_NAME), 4)]; + struct VasEBoot_ieee1275_note_desc descriptor; }; -#define GRUB_XEN_NOTE_NAME "Xen" +#define VasEBoot_XEN_NOTE_NAME "Xen" struct fixup_block_list { struct fixup_block_list *next; int state; - struct grub_pe32_fixup_block b; + struct VasEBoot_pe32_fixup_block b; }; #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) static int -is_relocatable (const struct grub_install_image_target_desc *image_target) +is_relocatable (const struct VasEBoot_install_image_target_desc *image_target) { return image_target->id == IMAGE_EFI || image_target->id == IMAGE_UBOOT; } @@ -98,31 +98,31 @@ is_relocatable (const struct grub_install_image_target_desc *image_target) * Relocate Thumb (T32) instruction set relative branches: * B.W, BL and BLX */ -static grub_err_t -grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) +static VasEBoot_err_t +VasEBoot_arm_reloc_thm_call (VasEBoot_uint16_t *target, Elf32_Addr sym_addr) { - grub_int32_t offset; + VasEBoot_int32_t offset; - offset = grub_arm_thm_call_get_offset (target); + offset = VasEBoot_arm_thm_call_get_offset (target); - grub_dprintf ("dl", " sym_addr = 0x%08x", sym_addr); + VasEBoot_dprintf ("dl", " sym_addr = 0x%08x", sym_addr); offset += sym_addr; - grub_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", + VasEBoot_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", target, sym_addr, offset); /* Keep traditional (pre-Thumb2) limits on blx. In any case if the kernel is bigger than 2M (currently under 150K) then we probably have a problem somewhere else. */ if (offset < -0x200000 || offset >= 0x200000) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "THM_CALL Relocation out of range."); - grub_dprintf ("dl", " relative destination = %p", + VasEBoot_dprintf ("dl", " relative destination = %p", (char *) target + offset); - return grub_arm_thm_call_set_offset (target, offset); + return VasEBoot_arm_thm_call_set_offset (target, offset); } /* @@ -130,27 +130,27 @@ grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) * * Relocate conditional Thumb (T32) B.W */ -static grub_err_t -grub_arm_reloc_thm_jump19 (grub_uint16_t *target, Elf32_Addr sym_addr) +static VasEBoot_err_t +VasEBoot_arm_reloc_thm_jump19 (VasEBoot_uint16_t *target, Elf32_Addr sym_addr) { - grub_int32_t offset; + VasEBoot_int32_t offset; if (!(sym_addr & 1)) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "Relocation targeting wrong execution state"); - offset = grub_arm_thm_jump19_get_offset (target); + offset = VasEBoot_arm_thm_jump19_get_offset (target); /* Adjust and re-truncate offset */ offset += sym_addr; - if (!grub_arm_thm_jump19_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm_thm_jump19_check_offset (offset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "THM_JUMP19 Relocation out of range."); - grub_arm_thm_jump19_set_offset (target, offset); + VasEBoot_arm_thm_jump19_set_offset (target, offset); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } /* @@ -158,34 +158,34 @@ grub_arm_reloc_thm_jump19 (grub_uint16_t *target, Elf32_Addr sym_addr) * * Relocate ARM (A32) B */ -static grub_err_t -grub_arm_reloc_jump24 (grub_uint32_t *target, Elf32_Addr sym_addr) +static VasEBoot_err_t +VasEBoot_arm_reloc_jump24 (VasEBoot_uint32_t *target, Elf32_Addr sym_addr) { - grub_int32_t offset; + VasEBoot_int32_t offset; if (sym_addr & 1) - return grub_error (GRUB_ERR_BAD_MODULE, + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "Relocation targeting wrong execution state"); - offset = grub_arm_jump24_get_offset (target); + offset = VasEBoot_arm_jump24_get_offset (target); offset += sym_addr; - if (!grub_arm_jump24_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, + if (!VasEBoot_arm_jump24_check_offset (offset)) + return VasEBoot_error (VasEBoot_ERR_BAD_MODULE, "JUMP24 Relocation out of range."); - grub_arm_jump24_set_offset (target, offset); + VasEBoot_arm_jump24_set_offset (target, offset); - return GRUB_ERR_NONE; + return VasEBoot_ERR_NONE; } #endif void -SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc *image_target, +SUFFIX (VasEBoot_mkimage_generate_elf) (const struct VasEBoot_install_image_target_desc *image_target, int note, char **core_img, size_t *core_size, - Elf_Addr target_addr, grub_size_t align, + Elf_Addr target_addr, VasEBoot_size_t align, size_t kernel_size, size_t bss_size) { char *elf_img; @@ -204,7 +204,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc if (note) { phnum++; - footer_size += sizeof (struct grub_ieee1275_note); + footer_size += sizeof (struct VasEBoot_ieee1275_note); } if (image_target->id == IMAGE_XEN) { @@ -232,72 +232,72 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc ehdr->e_ident[EI_DATA] = ELFDATA2MSB; ehdr->e_ident[EI_VERSION] = EV_CURRENT; ehdr->e_ident[EI_OSABI] = ELFOSABI_NONE; - ehdr->e_type = grub_host_to_target16 (ET_EXEC); - ehdr->e_machine = grub_host_to_target16 (image_target->elf_target); - ehdr->e_version = grub_host_to_target32 (EV_CURRENT); + ehdr->e_type = VasEBoot_host_to_target16 (ET_EXEC); + ehdr->e_machine = VasEBoot_host_to_target16 (image_target->elf_target); + ehdr->e_version = VasEBoot_host_to_target32 (EV_CURRENT); - ehdr->e_phoff = grub_host_to_target32 ((char *) phdr - (char *) ehdr); - ehdr->e_phentsize = grub_host_to_target16 (sizeof (*phdr)); - ehdr->e_phnum = grub_host_to_target16 (phnum); + ehdr->e_phoff = VasEBoot_host_to_target32 ((char *) phdr - (char *) ehdr); + ehdr->e_phentsize = VasEBoot_host_to_target16 (sizeof (*phdr)); + ehdr->e_phnum = VasEBoot_host_to_target16 (phnum); - ehdr->e_shoff = grub_host_to_target32 ((grub_uint8_t *) shdr - - (grub_uint8_t *) ehdr); + ehdr->e_shoff = VasEBoot_host_to_target32 ((VasEBoot_uint8_t *) shdr + - (VasEBoot_uint8_t *) ehdr); if (image_target->id == IMAGE_LOONGSON_ELF) - ehdr->e_shentsize = grub_host_to_target16 (0); + ehdr->e_shentsize = VasEBoot_host_to_target16 (0); else - ehdr->e_shentsize = grub_host_to_target16 (sizeof (Elf_Shdr)); - ehdr->e_shnum = grub_host_to_target16 (shnum); - ehdr->e_shstrndx = grub_host_to_target16 (1); + ehdr->e_shentsize = VasEBoot_host_to_target16 (sizeof (Elf_Shdr)); + ehdr->e_shnum = VasEBoot_host_to_target16 (shnum); + ehdr->e_shstrndx = VasEBoot_host_to_target16 (1); - ehdr->e_ehsize = grub_host_to_target16 (sizeof (*ehdr)); + ehdr->e_ehsize = VasEBoot_host_to_target16 (sizeof (*ehdr)); - phdr->p_type = grub_host_to_target32 (PT_LOAD); - phdr->p_offset = grub_host_to_target32 (header_size); - phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X); + phdr->p_type = VasEBoot_host_to_target32 (PT_LOAD); + phdr->p_offset = VasEBoot_host_to_target32 (header_size); + phdr->p_flags = VasEBoot_host_to_target32 (PF_R | PF_W | PF_X); - ehdr->e_entry = grub_host_to_target32 (target_addr); - phdr->p_vaddr = grub_host_to_target32 (target_addr); - phdr->p_paddr = grub_host_to_target32 (target_addr); - phdr->p_align = grub_host_to_target32 (align > image_target->link_align ? align : image_target->link_align); + ehdr->e_entry = VasEBoot_host_to_target32 (target_addr); + phdr->p_vaddr = VasEBoot_host_to_target32 (target_addr); + phdr->p_paddr = VasEBoot_host_to_target32 (target_addr); + phdr->p_align = VasEBoot_host_to_target32 (align > image_target->link_align ? align : image_target->link_align); if (image_target->id == IMAGE_LOONGSON_ELF) - ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER + ehdr->e_flags = VasEBoot_host_to_target32 (0x1000 | EF_MIPS_NOREORDER | EF_MIPS_PIC | EF_MIPS_CPIC); else ehdr->e_flags = 0; if (image_target->id == IMAGE_LOONGSON_ELF) { - phdr->p_filesz = grub_host_to_target32 (*core_size); - phdr->p_memsz = grub_host_to_target32 (*core_size); + phdr->p_filesz = VasEBoot_host_to_target32 (*core_size); + phdr->p_memsz = VasEBoot_host_to_target32 (*core_size); } else { - grub_uint32_t target_addr_mods; - phdr->p_filesz = grub_host_to_target32 (kernel_size); - phdr->p_memsz = grub_host_to_target32 (kernel_size + bss_size); + VasEBoot_uint32_t target_addr_mods; + phdr->p_filesz = VasEBoot_host_to_target32 (kernel_size); + phdr->p_memsz = VasEBoot_host_to_target32 (kernel_size + bss_size); phdr++; - phdr->p_type = grub_host_to_target32 (PT_GNU_STACK); - phdr->p_offset = grub_host_to_target32 (header_size + kernel_size); + phdr->p_type = VasEBoot_host_to_target32 (PT_GNU_STACK); + phdr->p_offset = VasEBoot_host_to_target32 (header_size + kernel_size); phdr->p_paddr = phdr->p_vaddr = phdr->p_filesz = phdr->p_memsz = 0; - phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X); - phdr->p_align = grub_host_to_target32 (image_target->link_align); + phdr->p_flags = VasEBoot_host_to_target32 (PF_R | PF_W | PF_X); + phdr->p_align = VasEBoot_host_to_target32 (image_target->link_align); phdr++; - phdr->p_type = grub_host_to_target32 (PT_LOAD); - phdr->p_offset = grub_host_to_target32 (header_size + kernel_size); - phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X); + phdr->p_type = VasEBoot_host_to_target32 (PT_LOAD); + phdr->p_offset = VasEBoot_host_to_target32 (header_size + kernel_size); + phdr->p_flags = VasEBoot_host_to_target32 (PF_R | PF_W | PF_X); phdr->p_filesz = phdr->p_memsz - = grub_host_to_target32 (*core_size - kernel_size); + = VasEBoot_host_to_target32 (*core_size - kernel_size); if (image_target->id == IMAGE_COREBOOT) - target_addr_mods = GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR; + target_addr_mods = VasEBoot_KERNEL_I386_COREBOOT_MODULES_ADDR; else target_addr_mods = ALIGN_UP (target_addr + kernel_size + bss_size + image_target->mod_gap, image_target->mod_align); - phdr->p_vaddr = grub_host_to_target_addr (target_addr_mods); - phdr->p_paddr = grub_host_to_target_addr (target_addr_mods); - phdr->p_align = grub_host_to_target32 (image_target->link_align); + phdr->p_vaddr = VasEBoot_host_to_target_addr (target_addr_mods); + phdr->p_paddr = VasEBoot_host_to_target_addr (target_addr_mods); + phdr->p_align = VasEBoot_host_to_target32 (image_target->link_align); } if (image_target->id == IMAGE_XEN) @@ -306,60 +306,60 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc Elf_Nhdr *note_ptr; char *ptr = (char *) note_start; - grub_util_info ("adding XEN NOTE segment"); + VasEBoot_util_info ("adding XEN NOTE segment"); /* Guest OS. */ note_ptr = (Elf_Nhdr *) ptr; - note_ptr->n_namesz = grub_host_to_target32 (sizeof (GRUB_XEN_NOTE_NAME)); - note_ptr->n_descsz = grub_host_to_target32 (sizeof (PACKAGE_NAME)); - note_ptr->n_type = grub_host_to_target32 (6); + note_ptr->n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_XEN_NOTE_NAME)); + note_ptr->n_descsz = VasEBoot_host_to_target32 (sizeof (PACKAGE_NAME)); + note_ptr->n_type = VasEBoot_host_to_target32 (6); ptr += sizeof (Elf_Nhdr); - memcpy (ptr, GRUB_XEN_NOTE_NAME, sizeof (GRUB_XEN_NOTE_NAME)); - ptr += ALIGN_UP (sizeof (GRUB_XEN_NOTE_NAME), 4); + memcpy (ptr, VasEBoot_XEN_NOTE_NAME, sizeof (VasEBoot_XEN_NOTE_NAME)); + ptr += ALIGN_UP (sizeof (VasEBoot_XEN_NOTE_NAME), 4); memcpy (ptr, PACKAGE_NAME, sizeof (PACKAGE_NAME)); ptr += ALIGN_UP (sizeof (PACKAGE_NAME), 4); /* Loader. */ note_ptr = (Elf_Nhdr *) ptr; - note_ptr->n_namesz = grub_host_to_target32 (sizeof (GRUB_XEN_NOTE_NAME)); - note_ptr->n_descsz = grub_host_to_target32 (sizeof ("generic")); - note_ptr->n_type = grub_host_to_target32 (8); + note_ptr->n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_XEN_NOTE_NAME)); + note_ptr->n_descsz = VasEBoot_host_to_target32 (sizeof ("generic")); + note_ptr->n_type = VasEBoot_host_to_target32 (8); ptr += sizeof (Elf_Nhdr); - memcpy (ptr, GRUB_XEN_NOTE_NAME, sizeof (GRUB_XEN_NOTE_NAME)); - ptr += ALIGN_UP (sizeof (GRUB_XEN_NOTE_NAME), 4); + memcpy (ptr, VasEBoot_XEN_NOTE_NAME, sizeof (VasEBoot_XEN_NOTE_NAME)); + ptr += ALIGN_UP (sizeof (VasEBoot_XEN_NOTE_NAME), 4); memcpy (ptr, "generic", sizeof ("generic")); ptr += ALIGN_UP (sizeof ("generic"), 4); /* Version. */ note_ptr = (Elf_Nhdr *) ptr; - note_ptr->n_namesz = grub_host_to_target32 (sizeof (GRUB_XEN_NOTE_NAME)); - note_ptr->n_descsz = grub_host_to_target32 (sizeof ("xen-3.0")); - note_ptr->n_type = grub_host_to_target32 (5); + note_ptr->n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_XEN_NOTE_NAME)); + note_ptr->n_descsz = VasEBoot_host_to_target32 (sizeof ("xen-3.0")); + note_ptr->n_type = VasEBoot_host_to_target32 (5); ptr += sizeof (Elf_Nhdr); - memcpy (ptr, GRUB_XEN_NOTE_NAME, sizeof (GRUB_XEN_NOTE_NAME)); - ptr += ALIGN_UP (sizeof (GRUB_XEN_NOTE_NAME), 4); + memcpy (ptr, VasEBoot_XEN_NOTE_NAME, sizeof (VasEBoot_XEN_NOTE_NAME)); + ptr += ALIGN_UP (sizeof (VasEBoot_XEN_NOTE_NAME), 4); memcpy (ptr, "xen-3.0", sizeof ("xen-3.0")); ptr += ALIGN_UP (sizeof ("xen-3.0"), 4); /* Entry. */ note_ptr = (Elf_Nhdr *) ptr; - note_ptr->n_namesz = grub_host_to_target32 (sizeof (GRUB_XEN_NOTE_NAME)); - note_ptr->n_descsz = grub_host_to_target32 (image_target->voidp_sizeof); - note_ptr->n_type = grub_host_to_target32 (1); + note_ptr->n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_XEN_NOTE_NAME)); + note_ptr->n_descsz = VasEBoot_host_to_target32 (image_target->voidp_sizeof); + note_ptr->n_type = VasEBoot_host_to_target32 (1); ptr += sizeof (Elf_Nhdr); - memcpy (ptr, GRUB_XEN_NOTE_NAME, sizeof (GRUB_XEN_NOTE_NAME)); - ptr += ALIGN_UP (sizeof (GRUB_XEN_NOTE_NAME), 4); + memcpy (ptr, VasEBoot_XEN_NOTE_NAME, sizeof (VasEBoot_XEN_NOTE_NAME)); + ptr += ALIGN_UP (sizeof (VasEBoot_XEN_NOTE_NAME), 4); memset (ptr, 0, image_target->voidp_sizeof); ptr += image_target->voidp_sizeof; /* Virt base. */ note_ptr = (Elf_Nhdr *) ptr; - note_ptr->n_namesz = grub_host_to_target32 (sizeof (GRUB_XEN_NOTE_NAME)); - note_ptr->n_descsz = grub_host_to_target32 (image_target->voidp_sizeof); - note_ptr->n_type = grub_host_to_target32 (3); + note_ptr->n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_XEN_NOTE_NAME)); + note_ptr->n_descsz = VasEBoot_host_to_target32 (image_target->voidp_sizeof); + note_ptr->n_type = VasEBoot_host_to_target32 (3); ptr += sizeof (Elf_Nhdr); - memcpy (ptr, GRUB_XEN_NOTE_NAME, sizeof (GRUB_XEN_NOTE_NAME)); - ptr += ALIGN_UP (sizeof (GRUB_XEN_NOTE_NAME), 4); + memcpy (ptr, VasEBoot_XEN_NOTE_NAME, sizeof (VasEBoot_XEN_NOTE_NAME)); + ptr += ALIGN_UP (sizeof (VasEBoot_XEN_NOTE_NAME), 4); memset (ptr, 0, image_target->voidp_sizeof); ptr += image_target->voidp_sizeof; @@ -367,12 +367,12 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc if (image_target->elf_target == EM_386) { note_ptr = (Elf_Nhdr *) ptr; - note_ptr->n_namesz = grub_host_to_target32 (sizeof (GRUB_XEN_NOTE_NAME)); - note_ptr->n_descsz = grub_host_to_target32 (sizeof ("yes,bimodal")); - note_ptr->n_type = grub_host_to_target32 (9); + note_ptr->n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_XEN_NOTE_NAME)); + note_ptr->n_descsz = VasEBoot_host_to_target32 (sizeof ("yes,bimodal")); + note_ptr->n_type = VasEBoot_host_to_target32 (9); ptr += sizeof (Elf_Nhdr); - memcpy (ptr, GRUB_XEN_NOTE_NAME, sizeof (GRUB_XEN_NOTE_NAME)); - ptr += ALIGN_UP (sizeof (GRUB_XEN_NOTE_NAME), 4); + memcpy (ptr, VasEBoot_XEN_NOTE_NAME, sizeof (VasEBoot_XEN_NOTE_NAME)); + ptr += ALIGN_UP (sizeof (VasEBoot_XEN_NOTE_NAME), 4); memcpy (ptr, "yes", sizeof ("yes")); ptr += ALIGN_UP (sizeof ("yes"), 4); } @@ -380,44 +380,44 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc assert (XEN_NOTE_SIZE == (ptr - note_start)); phdr++; - phdr->p_type = grub_host_to_target32 (PT_NOTE); - phdr->p_flags = grub_host_to_target32 (PF_R); - phdr->p_align = grub_host_to_target32 (image_target->voidp_sizeof); + phdr->p_type = VasEBoot_host_to_target32 (PT_NOTE); + phdr->p_flags = VasEBoot_host_to_target32 (PF_R); + phdr->p_align = VasEBoot_host_to_target32 (image_target->voidp_sizeof); phdr->p_vaddr = 0; phdr->p_paddr = 0; - phdr->p_filesz = grub_host_to_target32 (XEN_NOTE_SIZE); + phdr->p_filesz = VasEBoot_host_to_target32 (XEN_NOTE_SIZE); phdr->p_memsz = 0; - phdr->p_offset = grub_host_to_target32 (header_size + program_size); + phdr->p_offset = VasEBoot_host_to_target32 (header_size + program_size); } if (note) { - int note_size = sizeof (struct grub_ieee1275_note); - struct grub_ieee1275_note *note_ptr = (struct grub_ieee1275_note *) + int note_size = sizeof (struct VasEBoot_ieee1275_note); + struct VasEBoot_ieee1275_note *note_ptr = (struct VasEBoot_ieee1275_note *) (elf_img + program_size + header_size); - grub_util_info ("adding CHRP NOTE segment"); + VasEBoot_util_info ("adding CHRP NOTE segment"); - note_ptr->header.n_namesz = grub_host_to_target32 (sizeof (GRUB_IEEE1275_NOTE_NAME)); - note_ptr->header.n_descsz = grub_host_to_target32 (note_size); - note_ptr->header.n_type = grub_host_to_target32 (GRUB_IEEE1275_NOTE_TYPE); - strcpy (note_ptr->name, GRUB_IEEE1275_NOTE_NAME); - note_ptr->descriptor.real_mode = grub_host_to_target32 (0xffffffff); - note_ptr->descriptor.real_base = grub_host_to_target32 (0x00c00000); - note_ptr->descriptor.real_size = grub_host_to_target32 (0xffffffff); - note_ptr->descriptor.virt_base = grub_host_to_target32 (0xffffffff); - note_ptr->descriptor.virt_size = grub_host_to_target32 (0xffffffff); - note_ptr->descriptor.load_base = grub_host_to_target32 (0x00004000); + note_ptr->header.n_namesz = VasEBoot_host_to_target32 (sizeof (VasEBoot_IEEE1275_NOTE_NAME)); + note_ptr->header.n_descsz = VasEBoot_host_to_target32 (note_size); + note_ptr->header.n_type = VasEBoot_host_to_target32 (VasEBoot_IEEE1275_NOTE_TYPE); + strcpy (note_ptr->name, VasEBoot_IEEE1275_NOTE_NAME); + note_ptr->descriptor.real_mode = VasEBoot_host_to_target32 (0xffffffff); + note_ptr->descriptor.real_base = VasEBoot_host_to_target32 (0x00c00000); + note_ptr->descriptor.real_size = VasEBoot_host_to_target32 (0xffffffff); + note_ptr->descriptor.virt_base = VasEBoot_host_to_target32 (0xffffffff); + note_ptr->descriptor.virt_size = VasEBoot_host_to_target32 (0xffffffff); + note_ptr->descriptor.load_base = VasEBoot_host_to_target32 (0x00004000); phdr++; - phdr->p_type = grub_host_to_target32 (PT_NOTE); - phdr->p_flags = grub_host_to_target32 (PF_R); - phdr->p_align = grub_host_to_target32 (image_target->voidp_sizeof); + phdr->p_type = VasEBoot_host_to_target32 (PT_NOTE); + phdr->p_flags = VasEBoot_host_to_target32 (PF_R); + phdr->p_align = VasEBoot_host_to_target32 (image_target->voidp_sizeof); phdr->p_vaddr = 0; phdr->p_paddr = 0; - phdr->p_filesz = grub_host_to_target32 (note_size); + phdr->p_filesz = VasEBoot_host_to_target32 (note_size); phdr->p_memsz = 0; - phdr->p_offset = grub_host_to_target32 (header_size + program_size); + phdr->p_offset = VasEBoot_host_to_target32 (header_size + program_size); } { @@ -427,57 +427,57 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc shdr++; - shdr->sh_name = grub_host_to_target32 (0); - shdr->sh_type = grub_host_to_target32 (SHT_STRTAB); - shdr->sh_addr = grub_host_to_target_addr (0); - shdr->sh_offset = grub_host_to_target_addr (str_start - elf_img); - shdr->sh_size = grub_host_to_target32 (string_size); - shdr->sh_link = grub_host_to_target32 (0); - shdr->sh_info = grub_host_to_target32 (0); - shdr->sh_addralign = grub_host_to_target32 (align); - shdr->sh_entsize = grub_host_to_target32 (0); + shdr->sh_name = VasEBoot_host_to_target32 (0); + shdr->sh_type = VasEBoot_host_to_target32 (SHT_STRTAB); + shdr->sh_addr = VasEBoot_host_to_target_addr (0); + shdr->sh_offset = VasEBoot_host_to_target_addr (str_start - elf_img); + shdr->sh_size = VasEBoot_host_to_target32 (string_size); + shdr->sh_link = VasEBoot_host_to_target32 (0); + shdr->sh_info = VasEBoot_host_to_target32 (0); + shdr->sh_addralign = VasEBoot_host_to_target32 (align); + shdr->sh_entsize = VasEBoot_host_to_target32 (0); shdr++; memcpy (ptr, ".text", sizeof (".text")); - shdr->sh_name = grub_host_to_target32 (ptr - str_start); + shdr->sh_name = VasEBoot_host_to_target32 (ptr - str_start); ptr += sizeof (".text"); - shdr->sh_type = grub_host_to_target32 (SHT_PROGBITS); - shdr->sh_addr = grub_host_to_target_addr (target_addr); - shdr->sh_offset = grub_host_to_target_addr (header_size); - shdr->sh_size = grub_host_to_target32 (kernel_size); - shdr->sh_link = grub_host_to_target32 (0); - shdr->sh_info = grub_host_to_target32 (0); - shdr->sh_addralign = grub_host_to_target32 (align); - shdr->sh_entsize = grub_host_to_target32 (0); + shdr->sh_type = VasEBoot_host_to_target32 (SHT_PROGBITS); + shdr->sh_addr = VasEBoot_host_to_target_addr (target_addr); + shdr->sh_offset = VasEBoot_host_to_target_addr (header_size); + shdr->sh_size = VasEBoot_host_to_target32 (kernel_size); + shdr->sh_link = VasEBoot_host_to_target32 (0); + shdr->sh_info = VasEBoot_host_to_target32 (0); + shdr->sh_addralign = VasEBoot_host_to_target32 (align); + shdr->sh_entsize = VasEBoot_host_to_target32 (0); shdr++; memcpy (ptr, "mods", sizeof ("mods")); - shdr->sh_name = grub_host_to_target32 (ptr - str_start); + shdr->sh_name = VasEBoot_host_to_target32 (ptr - str_start); ptr += sizeof ("mods"); - shdr->sh_type = grub_host_to_target32 (SHT_PROGBITS); - shdr->sh_addr = grub_host_to_target_addr (target_addr + kernel_size); - shdr->sh_offset = grub_host_to_target_addr (header_size + kernel_size); - shdr->sh_size = grub_host_to_target32 (*core_size - kernel_size); - shdr->sh_link = grub_host_to_target32 (0); - shdr->sh_info = grub_host_to_target32 (0); - shdr->sh_addralign = grub_host_to_target32 (image_target->voidp_sizeof); - shdr->sh_entsize = grub_host_to_target32 (0); + shdr->sh_type = VasEBoot_host_to_target32 (SHT_PROGBITS); + shdr->sh_addr = VasEBoot_host_to_target_addr (target_addr + kernel_size); + shdr->sh_offset = VasEBoot_host_to_target_addr (header_size + kernel_size); + shdr->sh_size = VasEBoot_host_to_target32 (*core_size - kernel_size); + shdr->sh_link = VasEBoot_host_to_target32 (0); + shdr->sh_info = VasEBoot_host_to_target32 (0); + shdr->sh_addralign = VasEBoot_host_to_target32 (image_target->voidp_sizeof); + shdr->sh_entsize = VasEBoot_host_to_target32 (0); shdr++; if (image_target->id == IMAGE_XEN) { memcpy (ptr, ".xen", sizeof (".xen")); - shdr->sh_name = grub_host_to_target32 (ptr - str_start); + shdr->sh_name = VasEBoot_host_to_target32 (ptr - str_start); ptr += sizeof (".xen"); - shdr->sh_type = grub_host_to_target32 (SHT_PROGBITS); - shdr->sh_addr = grub_host_to_target_addr (target_addr + kernel_size); - shdr->sh_offset = grub_host_to_target_addr (program_size + header_size); - shdr->sh_size = grub_host_to_target32 (XEN_NOTE_SIZE); - shdr->sh_link = grub_host_to_target32 (0); - shdr->sh_info = grub_host_to_target32 (0); - shdr->sh_addralign = grub_host_to_target32 (image_target->voidp_sizeof); - shdr->sh_entsize = grub_host_to_target32 (0); + shdr->sh_type = VasEBoot_host_to_target32 (SHT_PROGBITS); + shdr->sh_addr = VasEBoot_host_to_target_addr (target_addr + kernel_size); + shdr->sh_offset = VasEBoot_host_to_target_addr (program_size + header_size); + shdr->sh_size = VasEBoot_host_to_target32 (XEN_NOTE_SIZE); + shdr->sh_link = VasEBoot_host_to_target32 (0); + shdr->sh_info = VasEBoot_host_to_target32 (0); + shdr->sh_addralign = VasEBoot_host_to_target32 (image_target->voidp_sizeof); + shdr->sh_entsize = VasEBoot_host_to_target32 (0); shdr++; } } @@ -495,7 +495,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, void *jumpers, Elf_Addr jumpers_addr, Elf_Addr bss_start, Elf_Addr end, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { Elf_Word symtab_size, sym_size, num_syms; Elf_Off symtab_offset; @@ -504,17 +504,17 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Word i; Elf_Shdr *strtab_section; const char *strtab; - grub_uint64_t *jptr = jumpers; + VasEBoot_uint64_t *jptr = jumpers; strtab_section = (Elf_Shdr *) ((char *) sections - + (grub_target_to_host32 (symtab_section->sh_link) + + (VasEBoot_target_to_host32 (symtab_section->sh_link) * section_entsize)); - strtab = (char *) e + grub_target_to_host (strtab_section->sh_offset); + strtab = (char *) e + VasEBoot_target_to_host (strtab_section->sh_offset); - symtab_size = grub_target_to_host (symtab_section->sh_size); - sym_size = grub_target_to_host (symtab_section->sh_entsize); - symtab_offset = grub_target_to_host (symtab_section->sh_offset); + symtab_size = VasEBoot_target_to_host (symtab_section->sh_size); + sym_size = VasEBoot_target_to_host (symtab_section->sh_entsize); + symtab_offset = VasEBoot_target_to_host (symtab_section->sh_offset); num_syms = symtab_size / sym_size; for (i = 0, sym = (Elf_Sym *) ((char *) e + symtab_offset); @@ -524,43 +524,43 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Section cur_index; const char *name; - name = strtab + grub_target_to_host32 (sym->st_name); + name = strtab + VasEBoot_target_to_host32 (sym->st_name); - cur_index = grub_target_to_host16 (sym->st_shndx); + cur_index = VasEBoot_target_to_host16 (sym->st_shndx); if (cur_index == STN_ABS) { continue; } else if (cur_index == STN_UNDEF) { - if (sym->st_name && grub_strcmp (name, "__bss_start") == 0) + if (sym->st_name && VasEBoot_strcmp (name, "__bss_start") == 0) sym->st_value = bss_start; - else if (sym->st_name && grub_strcmp (name, "_end") == 0) + else if (sym->st_name && VasEBoot_strcmp (name, "_end") == 0) sym->st_value = end; else if (sym->st_name) - grub_util_error ("undefined symbol %s", name); + VasEBoot_util_error ("undefined symbol %s", name); else continue; } else if (cur_index >= num_sections) - grub_util_error ("section %d does not exist", cur_index); + VasEBoot_util_error ("section %d does not exist", cur_index); else { - sym->st_value = (grub_target_to_host (sym->st_value) + sym->st_value = (VasEBoot_target_to_host (sym->st_value) + section_addresses[cur_index]); } if (image_target->elf_target == EM_IA_64 && ELF_ST_TYPE (sym->st_info) == STT_FUNC) { - *jptr = grub_host_to_target64 (sym->st_value); + *jptr = VasEBoot_host_to_target64 (sym->st_value); sym->st_value = (char *) jptr - (char *) jumpers + jumpers_addr; jptr++; *jptr = 0; jptr++; } - grub_util_info ("locating %s at 0x%" GRUB_HOST_PRIxLONG_LONG - " (0x%" GRUB_HOST_PRIxLONG_LONG ")", name, + VasEBoot_util_info ("locating %s at 0x%" VasEBoot_HOST_PRIxLONG_LONG + " (0x%" VasEBoot_HOST_PRIxLONG_LONG ")", name, (unsigned long long) sym->st_value, (unsigned long long) section_addresses[cur_index]); @@ -575,28 +575,28 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, /* Return the address of a symbol at the index I in the section S. */ static Elf_Addr SUFFIX (get_symbol_address) (Elf_Ehdr *e, Elf_Shdr *s, Elf_Word i, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { Elf_Sym *sym; sym = (Elf_Sym *) ((char *) e - + grub_target_to_host (s->sh_offset) - + i * grub_target_to_host (s->sh_entsize)); + + VasEBoot_target_to_host (s->sh_offset) + + i * VasEBoot_target_to_host (s->sh_entsize)); return sym->st_value; } /* Return the address of a modified value. */ static Elf_Addr * SUFFIX (get_target_address) (Elf_Ehdr *e, Elf_Shdr *s, Elf_Addr offset, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { - return (Elf_Addr *) ((char *) e + grub_target_to_host (s->sh_offset) + offset); + return (Elf_Addr *) ((char *) e + VasEBoot_target_to_host (s->sh_offset) + offset); } #ifdef MKIMAGE_ELF64 static Elf_Addr SUFFIX (count_funcs) (Elf_Ehdr *e, Elf_Shdr *symtab_section, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { Elf_Word symtab_size, sym_size, num_syms; Elf_Off symtab_offset; @@ -604,9 +604,9 @@ SUFFIX (count_funcs) (Elf_Ehdr *e, Elf_Shdr *symtab_section, Elf_Word i; int ret = 0; - symtab_size = grub_target_to_host (symtab_section->sh_size); - sym_size = grub_target_to_host (symtab_section->sh_entsize); - symtab_offset = grub_target_to_host (symtab_section->sh_offset); + symtab_size = VasEBoot_target_to_host (symtab_section->sh_size); + sym_size = VasEBoot_target_to_host (symtab_section->sh_entsize); + symtab_offset = VasEBoot_target_to_host (symtab_section->sh_offset); num_syms = symtab_size / sym_size; for (i = 0, sym = (Elf_Sym *) ((char *) e + symtab_offset); @@ -624,22 +624,22 @@ SUFFIX (count_funcs) (Elf_Ehdr *e, Elf_Shdr *symtab_section, within the virtual address space starting from 0. So only relative addresses can be fully resolved. Absolute addresses must be relocated again by a PE32 relocator when loaded. */ -static grub_size_t +static VasEBoot_size_t arm_get_trampoline_size (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { Elf_Half i; Elf_Shdr *s; - grub_size_t ret = 0; + VasEBoot_size_t ret = 0; for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if ((s->sh_type == grub_host_to_target32 (SHT_REL)) || - (s->sh_type == grub_host_to_target32 (SHT_RELA))) + if ((s->sh_type == VasEBoot_host_to_target32 (SHT_REL)) || + (s->sh_type == VasEBoot_host_to_target32 (SHT_RELA))) { Elf_Rela *r; Elf_Word rtab_size, r_size, num_rs; @@ -648,12 +648,12 @@ arm_get_trampoline_size (Elf_Ehdr *e, Elf_Word j; symtab_section = (Elf_Shdr *) ((char *) sections - + (grub_target_to_host32 (s->sh_link) + + (VasEBoot_target_to_host32 (s->sh_link) * section_entsize)); - rtab_size = grub_target_to_host (s->sh_size); - r_size = grub_target_to_host (s->sh_entsize); - rtab_offset = grub_target_to_host (s->sh_offset); + rtab_size = VasEBoot_target_to_host (s->sh_size); + r_size = VasEBoot_target_to_host (s->sh_entsize); + rtab_offset = VasEBoot_target_to_host (s->sh_offset); num_rs = rtab_size / r_size; for (j = 0, r = (Elf_Rela *) ((char *) e + rtab_offset); @@ -663,12 +663,12 @@ arm_get_trampoline_size (Elf_Ehdr *e, Elf_Addr info; Elf_Addr sym_addr; - info = grub_target_to_host (r->r_info); + info = VasEBoot_target_to_host (r->r_info); sym_addr = SUFFIX (get_symbol_address) (e, symtab_section, ELF_R_SYM (info), image_target); - sym_addr += (s->sh_type == grub_target_to_host32 (SHT_RELA)) ? - grub_target_to_host (r->r_addend) : 0; + sym_addr += (s->sh_type == VasEBoot_target_to_host32 (SHT_RELA)) ? + VasEBoot_target_to_host (r->r_addend) : 0; switch (ELF_R_TYPE (info)) { @@ -689,7 +689,7 @@ arm_get_trampoline_size (Elf_Ehdr *e, break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -710,24 +710,24 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, const char *strtab, char *pe_target, Elf_Addr tramp_off, Elf_Addr got_off, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { Elf_Half i; Elf_Shdr *s; #ifdef MKIMAGE_ELF64 - struct grub_ia64_trampoline *tr = (void *) (pe_target + tramp_off); - grub_uint64_t *gpptr = (void *) (pe_target + got_off); + struct VasEBoot_ia64_trampoline *tr = (void *) (pe_target + tramp_off); + VasEBoot_uint64_t *gpptr = (void *) (pe_target + got_off); unsigned unmatched_adr_got_page = 0; #define MASK19 ((1 << 19) - 1) #else - grub_uint32_t *tr = (void *) (pe_target + tramp_off); + VasEBoot_uint32_t *tr = (void *) (pe_target + tramp_off); #endif for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if ((s->sh_type == grub_host_to_target32 (SHT_REL)) || - (s->sh_type == grub_host_to_target32 (SHT_RELA))) + if ((s->sh_type == VasEBoot_host_to_target32 (SHT_REL)) || + (s->sh_type == VasEBoot_host_to_target32 (SHT_RELA))) { Elf_Rela *r; Elf_Word rtab_size, r_size, num_rs; @@ -739,21 +739,21 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Word j; symtab_section = (Elf_Shdr *) ((char *) sections - + (grub_target_to_host32 (s->sh_link) + + (VasEBoot_target_to_host32 (s->sh_link) * section_entsize)); - target_section_index = grub_target_to_host32 (s->sh_info); + target_section_index = VasEBoot_target_to_host32 (s->sh_info); target_section_addr = section_addresses[target_section_index]; target_section = (Elf_Shdr *) ((char *) sections + (target_section_index * section_entsize)); - grub_util_info ("dealing with the relocation section %s for %s", - strtab + grub_target_to_host32 (s->sh_name), - strtab + grub_target_to_host32 (target_section->sh_name)); + VasEBoot_util_info ("dealing with the relocation section %s for %s", + strtab + VasEBoot_target_to_host32 (s->sh_name), + strtab + VasEBoot_target_to_host32 (target_section->sh_name)); - rtab_size = grub_target_to_host (s->sh_size); - r_size = grub_target_to_host (s->sh_entsize); - rtab_offset = grub_target_to_host (s->sh_offset); + rtab_size = VasEBoot_target_to_host (s->sh_size); + r_size = VasEBoot_target_to_host (s->sh_entsize); + rtab_offset = VasEBoot_target_to_host (s->sh_offset); num_rs = rtab_size / r_size; for (j = 0, r = (Elf_Rela *) ((char *) e + rtab_offset); @@ -766,15 +766,15 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Addr *target; Elf_Addr addend; - offset = grub_target_to_host (r->r_offset); + offset = VasEBoot_target_to_host (r->r_offset); target = SUFFIX (get_target_address) (e, target_section, offset, image_target); - info = grub_target_to_host (r->r_info); + info = VasEBoot_target_to_host (r->r_info); sym_addr = SUFFIX (get_symbol_address) (e, symtab_section, ELF_R_SYM (info), image_target); - addend = (s->sh_type == grub_target_to_host32 (SHT_RELA)) ? - grub_target_to_host (r->r_addend) : 0; + addend = (s->sh_type == VasEBoot_target_to_host32 (SHT_RELA)) ? + VasEBoot_target_to_host (r->r_addend) : 0; switch (image_target->elf_target) { @@ -786,29 +786,29 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, case R_386_32: /* This is absolute. */ - *target = grub_host_to_target32 (grub_target_to_host32 (*target) + *target = VasEBoot_host_to_target32 (VasEBoot_target_to_host32 (*target) + addend + sym_addr); - grub_util_info ("relocating an R_386_32 entry to 0x%" - GRUB_HOST_PRIxLONG_LONG " at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_386_32 entry to 0x%" + VasEBoot_HOST_PRIxLONG_LONG " at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) *target, (unsigned long long) offset); break; case R_386_PC32: /* This is relative. */ - *target = grub_host_to_target32 (grub_target_to_host32 (*target) + *target = VasEBoot_host_to_target32 (VasEBoot_target_to_host32 (*target) + addend + sym_addr - target_section_addr - offset - image_target->vaddr_offset); - grub_util_info ("relocating an R_386_PC32 entry to 0x%" - GRUB_HOST_PRIxLONG_LONG " at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_386_PC32 entry to 0x%" + VasEBoot_HOST_PRIxLONG_LONG " at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) *target, (unsigned long long) offset); break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -822,11 +822,11 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, break; case R_X86_64_64: - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + *target = VasEBoot_host_to_target64 (VasEBoot_target_to_host64 (*target) + addend + sym_addr); - grub_util_info ("relocating an R_X86_64_64 entry to 0x%" - GRUB_HOST_PRIxLONG_LONG " at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_X86_64_64 entry to 0x%" + VasEBoot_HOST_PRIxLONG_LONG " at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) *target, (unsigned long long) offset); break; @@ -834,26 +834,26 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, case R_X86_64_PC32: case R_X86_64_PLT32: { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) + VasEBoot_uint32_t *t32 = (VasEBoot_uint32_t *) target; + *t32 = VasEBoot_host_to_target64 (VasEBoot_target_to_host32 (*t32) + addend + sym_addr - target_section_addr - offset - image_target->vaddr_offset); - grub_util_info ("relocating an R_X86_64_PC32 entry to 0x%x at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_X86_64_PC32 entry to 0x%x at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, *t32, (unsigned long long) offset); break; } case R_X86_64_PC64: { - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + *target = VasEBoot_host_to_target64 (VasEBoot_target_to_host64 (*target) + addend + sym_addr - target_section_addr - offset - image_target->vaddr_offset); - grub_util_info ("relocating an R_X86_64_PC64 entry to 0x%" - GRUB_HOST_PRIxLONG_LONG " at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_X86_64_PC64 entry to 0x%" + VasEBoot_HOST_PRIxLONG_LONG " at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) *target, (unsigned long long) offset); break; @@ -862,17 +862,17 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, case R_X86_64_32: case R_X86_64_32S: { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) + VasEBoot_uint32_t *t32 = (VasEBoot_uint32_t *) target; + *t32 = VasEBoot_host_to_target64 (VasEBoot_target_to_host32 (*t32) + addend + sym_addr); - grub_util_info ("relocating an R_X86_64_32(S) entry to 0x%x at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_X86_64_32(S) entry to 0x%x at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, *t32, (unsigned long long) offset); break; } default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -882,16 +882,16 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, { case R_IA64_PCREL21B: { - grub_uint64_t noff; - grub_ia64_make_trampoline (tr, addend + sym_addr); + VasEBoot_uint64_t noff; + VasEBoot_ia64_make_trampoline (tr, addend + sym_addr); noff = ((char *) tr - (char *) pe_target - target_section_addr - (offset & ~3)) >> 4; tr++; if (noff & ~MASK19) - grub_util_error ("trampoline offset too big (%" - GRUB_HOST_PRIxLONG_LONG ")", + VasEBoot_util_error ("trampoline offset too big (%" + VasEBoot_HOST_PRIxLONG_LONG ")", (unsigned long long) noff); - grub_ia64_add_value_to_slot_20b ((grub_addr_t) target, noff); + VasEBoot_ia64_add_value_to_slot_20b ((VasEBoot_addr_t) target, noff); } break; @@ -901,50 +901,50 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Sym *sym; sym = (Elf_Sym *) ((char *) e - + grub_target_to_host (symtab_section->sh_offset) - + ELF_R_SYM (info) * grub_target_to_host (symtab_section->sh_entsize)); + + VasEBoot_target_to_host (symtab_section->sh_offset) + + ELF_R_SYM (info) * VasEBoot_target_to_host (symtab_section->sh_entsize)); if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) - sym_addr = grub_target_to_host64 (*(grub_uint64_t *) (pe_target + sym_addr = VasEBoot_target_to_host64 (*(VasEBoot_uint64_t *) (pe_target + sym->st_value - image_target->vaddr_offset)); } /* FALLTHROUGH */ case R_IA64_LTOFF_FPTR22: - *gpptr = grub_host_to_target64 (addend + sym_addr); - grub_ia64_add_value_to_slot_21 ((grub_addr_t) target, + *gpptr = VasEBoot_host_to_target64 (addend + sym_addr); + VasEBoot_ia64_add_value_to_slot_21 ((VasEBoot_addr_t) target, (char *) gpptr - (char *) pe_target + image_target->vaddr_offset); gpptr++; break; case R_IA64_GPREL22: - grub_ia64_add_value_to_slot_21 ((grub_addr_t) target, + VasEBoot_ia64_add_value_to_slot_21 ((VasEBoot_addr_t) target, addend + sym_addr); break; case R_IA64_GPREL64I: - grub_ia64_set_immu64 ((grub_addr_t) target, + VasEBoot_ia64_set_immu64 ((VasEBoot_addr_t) target, addend + sym_addr); break; case R_IA64_PCREL64LSB: - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + *target = VasEBoot_host_to_target64 (VasEBoot_target_to_host64 (*target) + addend + sym_addr - target_section_addr - offset - image_target->vaddr_offset); break; case R_IA64_SEGREL64LSB: - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + *target = VasEBoot_host_to_target64 (VasEBoot_target_to_host64 (*target) + addend + sym_addr - target_section_addr); break; case R_IA64_DIR64LSB: case R_IA64_FPTR64LSB: - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + *target = VasEBoot_host_to_target64 (VasEBoot_target_to_host64 (*target) + addend + sym_addr); - grub_util_info ("relocating a direct entry to 0x%" - GRUB_HOST_PRIxLONG_LONG " at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating a direct entry to 0x%" + VasEBoot_HOST_PRIxLONG_LONG " at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) - grub_target_to_host64 (*target), + VasEBoot_target_to_host64 (*target), (unsigned long long) offset); break; @@ -953,7 +953,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -965,27 +965,27 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, { case R_AARCH64_ABS64: { - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + sym_addr); + *target = VasEBoot_host_to_target64 (VasEBoot_target_to_host64 (*target) + sym_addr); } break; case R_AARCH64_PREL32: { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) + VasEBoot_uint32_t *t32 = (VasEBoot_uint32_t *) target; + *t32 = VasEBoot_host_to_target64 (VasEBoot_target_to_host32 (*t32) + sym_addr - target_section_addr - offset - image_target->vaddr_offset); - grub_util_info ("relocating an R_AARCH64_PREL32 entry to 0x%x at the offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("relocating an R_AARCH64_PREL32 entry to 0x%x at the offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, *t32, (unsigned long long) offset); break; } case R_AARCH64_ADD_ABS_LO12_NC: - grub_arm64_set_abs_lo12 ((grub_uint32_t *) target, + VasEBoot_arm64_set_abs_lo12 ((VasEBoot_uint32_t *) target, sym_addr); break; case R_AARCH64_LDST64_ABS_LO12_NC: - grub_arm64_set_abs_lo12_ldst64 ((grub_uint32_t *) target, + VasEBoot_arm64_set_abs_lo12_ldst64 ((VasEBoot_uint32_t *) target, sym_addr); break; case R_AARCH64_JUMP26: @@ -993,24 +993,24 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, { sym_addr -= offset; sym_addr -= target_section_addr + image_target->vaddr_offset; - if (!grub_arm_64_check_xxxx26_offset (sym_addr)) - grub_util_error ("%s", "CALL26 Relocation out of range"); + if (!VasEBoot_arm_64_check_xxxx26_offset (sym_addr)) + VasEBoot_util_error ("%s", "CALL26 Relocation out of range"); - grub_arm64_set_xxxx26_offset((grub_uint32_t *)target, + VasEBoot_arm64_set_xxxx26_offset((VasEBoot_uint32_t *)target, sym_addr); } break; case R_AARCH64_ADR_GOT_PAGE: { Elf64_Rela *rel2; - grub_int64_t gpoffset = (((char *) gpptr - (char *) pe_target + image_target->vaddr_offset) & ~0xfffULL) + VasEBoot_int64_t gpoffset = (((char *) gpptr - (char *) pe_target + image_target->vaddr_offset) & ~0xfffULL) - ((offset + target_section_addr + image_target->vaddr_offset) & ~0xfffULL); unsigned k; - *gpptr = grub_host_to_target64 (sym_addr); + *gpptr = VasEBoot_host_to_target64 (sym_addr); unmatched_adr_got_page++; - if (!grub_arm64_check_hi21_signed (gpoffset)) - grub_util_error ("HI21 out of range"); - grub_arm64_set_hi21((grub_uint32_t *)target, + if (!VasEBoot_arm64_check_hi21_signed (gpoffset)) + VasEBoot_util_error ("HI21 out of range"); + VasEBoot_arm64_set_hi21((VasEBoot_uint32_t *)target, gpoffset); for (k = 0, rel2 = (Elf_Rela *) ((char *) r + r_size); k < num_rs; @@ -1020,34 +1020,34 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, && r->r_addend == rel2->r_addend && ELF_R_TYPE (rel2->r_info) == R_AARCH64_LD64_GOT_LO12_NC) { - grub_arm64_set_abs_lo12_ldst64 ((grub_uint32_t *) SUFFIX (get_target_address) (e, target_section, - grub_target_to_host (rel2->r_offset), image_target), + VasEBoot_arm64_set_abs_lo12_ldst64 ((VasEBoot_uint32_t *) SUFFIX (get_target_address) (e, target_section, + VasEBoot_target_to_host (rel2->r_offset), image_target), ((char *) gpptr - (char *) pe_target + image_target->vaddr_offset)); break; } if (k >= num_rs) - grub_util_error ("ADR_GOT_PAGE without matching LD64_GOT_LO12_NC"); + VasEBoot_util_error ("ADR_GOT_PAGE without matching LD64_GOT_LO12_NC"); gpptr++; } break; case R_AARCH64_LD64_GOT_LO12_NC: if (unmatched_adr_got_page == 0) - grub_util_error ("LD64_GOT_LO12_NC without matching ADR_GOT_PAGE"); + VasEBoot_util_error ("LD64_GOT_LO12_NC without matching ADR_GOT_PAGE"); unmatched_adr_got_page--; break; case R_AARCH64_ADR_PREL_PG_HI21: { sym_addr &= ~0xfffULL; sym_addr -= (offset + target_section_addr + image_target->vaddr_offset) & ~0xfffULL; - if (!grub_arm64_check_hi21_signed (sym_addr)) - grub_util_error ("%s", "CALL26 Relocation out of range"); + if (!VasEBoot_arm64_check_hi21_signed (sym_addr)) + VasEBoot_util_error ("%s", "CALL26 Relocation out of range"); - grub_arm64_set_hi21((grub_uint32_t *)target, + VasEBoot_arm64_set_hi21((VasEBoot_uint32_t *)target, sym_addr); } break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -1063,12 +1063,12 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, { case R_ARM_ABS32: { - grub_util_info (" ABS32:\toffset=%d\t(0x%08x)", + VasEBoot_util_info (" ABS32:\toffset=%d\t(0x%08x)", (int) sym_addr, (int) sym_addr); /* Data will be naturally aligned */ if (image_target->id == IMAGE_EFI) sym_addr += 0x400; - *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr); + *target = VasEBoot_host_to_target32 (VasEBoot_target_to_host32 (*target) + sym_addr); } break; /* Happens when compiled with -march=armv4. @@ -1080,76 +1080,76 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, case R_ARM_THM_JUMP24: case R_ARM_THM_JUMP19: { - grub_err_t err; + VasEBoot_err_t err; Elf_Sym *sym; - grub_util_info (" THM_JUMP24:\ttarget=0x%08lx\toffset=(0x%08x)", + VasEBoot_util_info (" THM_JUMP24:\ttarget=0x%08lx\toffset=(0x%08x)", (unsigned long) ((char *) target - (char *) e), sym_addr); sym = (Elf_Sym *) ((char *) e - + grub_target_to_host (symtab_section->sh_offset) - + ELF_R_SYM (info) * grub_target_to_host (symtab_section->sh_entsize)); + + VasEBoot_target_to_host (symtab_section->sh_offset) + + ELF_R_SYM (info) * VasEBoot_target_to_host (symtab_section->sh_entsize)); if (ELF_ST_TYPE (sym->st_info) != STT_FUNC) sym_addr |= 1; if (!(sym_addr & 1)) { - grub_uint32_t tr_addr; - grub_int32_t new_offset; + VasEBoot_uint32_t tr_addr; + VasEBoot_int32_t new_offset; tr_addr = (char *) tr - (char *) pe_target - target_section_addr; new_offset = sym_addr - tr_addr - 12; - if (!grub_arm_jump24_check_offset (new_offset)) - return grub_util_error ("jump24 relocation out of range"); + if (!VasEBoot_arm_jump24_check_offset (new_offset)) + return VasEBoot_util_error ("jump24 relocation out of range"); - tr[0] = grub_host_to_target32 (0x46c04778); /* bx pc; nop */ - tr[1] = grub_host_to_target32 (((new_offset >> 2) & 0xffffff) | 0xea000000); /* b new_offset */ + tr[0] = VasEBoot_host_to_target32 (0x46c04778); /* bx pc; nop */ + tr[1] = VasEBoot_host_to_target32 (((new_offset >> 2) & 0xffffff) | 0xea000000); /* b new_offset */ tr += 2; sym_addr = tr_addr | 1; } sym_addr -= offset; /* Thumb instructions can be 16-bit aligned */ if (ELF_R_TYPE (info) == R_ARM_THM_JUMP19) - err = grub_arm_reloc_thm_jump19 ((grub_uint16_t *) target, sym_addr); + err = VasEBoot_arm_reloc_thm_jump19 ((VasEBoot_uint16_t *) target, sym_addr); else - err = grub_arm_reloc_thm_call ((grub_uint16_t *) target, + err = VasEBoot_arm_reloc_thm_call ((VasEBoot_uint16_t *) target, sym_addr); if (err) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); } break; case R_ARM_CALL: case R_ARM_JUMP24: { - grub_err_t err; - grub_util_info (" JUMP24:\ttarget=0x%08lx\toffset=(0x%08x)", (unsigned long) ((char *) target - (char *) e), sym_addr); + VasEBoot_err_t err; + VasEBoot_util_info (" JUMP24:\ttarget=0x%08lx\toffset=(0x%08x)", (unsigned long) ((char *) target - (char *) e), sym_addr); if (sym_addr & 1) { - grub_uint32_t tr_addr; - grub_int32_t new_offset; + VasEBoot_uint32_t tr_addr; + VasEBoot_int32_t new_offset; tr_addr = (char *) tr - (char *) pe_target - target_section_addr; new_offset = sym_addr - tr_addr - 12; /* There is no immediate version of bx, only register one... */ - tr[0] = grub_host_to_target32 (0xe59fc004); /* ldr ip, [pc, #4] */ - tr[1] = grub_host_to_target32 (0xe08cc00f); /* add ip, ip, pc */ - tr[2] = grub_host_to_target32 (0xe12fff1c); /* bx ip */ - tr[3] = grub_host_to_target32 (new_offset | 1); + tr[0] = VasEBoot_host_to_target32 (0xe59fc004); /* ldr ip, [pc, #4] */ + tr[1] = VasEBoot_host_to_target32 (0xe08cc00f); /* add ip, ip, pc */ + tr[2] = VasEBoot_host_to_target32 (0xe12fff1c); /* bx ip */ + tr[3] = VasEBoot_host_to_target32 (new_offset | 1); tr += 4; sym_addr = tr_addr; } sym_addr -= offset; - err = grub_arm_reloc_jump24 (target, + err = VasEBoot_arm_reloc_jump24 (target, sym_addr); if (err) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); } break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -1157,7 +1157,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, } #endif /* MKIMAGE_ELF32 */ default: - grub_util_error ("unknown architecture type %d", + VasEBoot_util_error ("unknown architecture type %d", image_target->elf_target); } } @@ -1167,11 +1167,11 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, /* Add a PE32's fixup entry for a relocation. Return the resulting address after having written to the file OUT. */ static Elf_Addr -add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, +add_fixup_entry (struct fixup_block_list **cblock, VasEBoot_uint16_t type, Elf_Addr addr, int flush, Elf_Addr current_address, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { - struct grub_pe32_fixup_block *b; + struct VasEBoot_pe32_fixup_block *b; b = &((*cblock)->b); @@ -1180,7 +1180,7 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, { if (flush || addr < b->page_rva || b->page_rva + 0x1000 <= addr) { - grub_uint32_t size; + VasEBoot_uint32_t size; if (flush) { @@ -1195,7 +1195,7 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, - next_address) >> 1); cur_index = ((b->block_size - sizeof (*b)) >> 1); - grub_util_info ("adding %d padding fixup entries", padding_size); + VasEBoot_util_info ("adding %d padding fixup entries", padding_size); while (padding_size--) { b->entries[cur_index++] = 0; @@ -1208,19 +1208,19 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, a padding entry. */ size_t cur_index; - grub_util_info ("adding a padding fixup entry"); + VasEBoot_util_info ("adding a padding fixup entry"); cur_index = ((b->block_size - sizeof (*b)) >> 1); b->entries[cur_index] = 0; b->block_size += 2; } /* Flush it. */ - grub_util_info ("writing %d bytes of a fixup block starting at 0x%x", + VasEBoot_util_info ("writing %d bytes of a fixup block starting at 0x%x", b->block_size, b->page_rva); size = b->block_size; current_address += size; - b->page_rva = grub_host_to_target32 (b->page_rva); - b->block_size = grub_host_to_target32 (b->block_size); + b->page_rva = VasEBoot_host_to_target32 (b->page_rva); + b->block_size = VasEBoot_host_to_target32 (b->block_size); (*cblock)->next = xmalloc (sizeof (**cblock) + 2 * 0x1000); memset ((*cblock)->next, 0, sizeof (**cblock) + 2 * 0x1000); *cblock = (*cblock)->next; @@ -1231,7 +1231,7 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, if (! flush) { - grub_uint16_t entry; + VasEBoot_uint16_t entry; size_t cur_index; /* If not allocated yet, allocate a block with enough entries. */ @@ -1247,12 +1247,12 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, /* Sanity check. */ if (b->block_size >= sizeof (*b) + 2 * 0x1000) - grub_util_error ("too many fixup entries"); + VasEBoot_util_error ("too many fixup entries"); /* Add a new entry. */ cur_index = ((b->block_size - sizeof (*b)) >> 1); - entry = GRUB_PE32_FIXUP_ENTRY (type, addr - b->page_rva); - b->entries[cur_index] = grub_host_to_target16 (entry); + entry = VasEBoot_PE32_FIXUP_ENTRY (type, addr - b->page_rva); + b->entries[cur_index] = VasEBoot_host_to_target16 (entry); b->block_size += 2; } @@ -1262,7 +1262,7 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, struct raw_reloc { struct raw_reloc *next; - grub_uint32_t offset; + VasEBoot_uint32_t offset; enum raw_reloc_type { RAW_RELOC_NONE = -1, RAW_RELOC_32 = 0, @@ -1282,9 +1282,9 @@ struct translate_context static void translate_reloc_start (struct translate_context *ctx, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { - grub_memset (ctx, 0, sizeof (*ctx)); + VasEBoot_memset (ctx, 0, sizeof (*ctx)); if (image_target->id == IMAGE_EFI) { ctx->lst = ctx->lst0 = xmalloc (sizeof (*ctx->lst) + 2 * 0x1000); @@ -1297,7 +1297,7 @@ static void translate_relocation_pe (struct translate_context *ctx, Elf_Addr addr, Elf_Addr info, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { /* Necessary to relocate only absolute addresses. */ switch (image_target->elf_target) @@ -1305,12 +1305,12 @@ translate_relocation_pe (struct translate_context *ctx, case EM_386: if (ELF_R_TYPE (info) == R_386_32) { - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("adding a relocation entry for 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) addr); ctx->current_address = add_fixup_entry (&ctx->lst, - GRUB_PE32_REL_BASED_HIGHLOW, + VasEBoot_PE32_REL_BASED_HIGHLOW, addr, 0, ctx->current_address, image_target); } @@ -1319,16 +1319,16 @@ translate_relocation_pe (struct translate_context *ctx, if ((ELF_R_TYPE (info) == R_X86_64_32) || (ELF_R_TYPE (info) == R_X86_64_32S)) { - grub_util_error ("can\'t add fixup entry for R_X86_64_32(S)"); + VasEBoot_util_error ("can\'t add fixup entry for R_X86_64_32(S)"); } else if (ELF_R_TYPE (info) == R_X86_64_64) { - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("adding a relocation entry for 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) addr); ctx->current_address = add_fixup_entry (&ctx->lst, - GRUB_PE32_REL_BASED_DIR64, + VasEBoot_PE32_REL_BASED_DIR64, addr, 0, ctx->current_address, image_target); @@ -1352,12 +1352,12 @@ translate_relocation_pe (struct translate_context *ctx, case R_IA64_DIR64LSB: #if 1 { - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("adding a relocation entry for 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) addr); ctx->current_address = add_fixup_entry (&ctx->lst, - GRUB_PE32_REL_BASED_DIR64, + VasEBoot_PE32_REL_BASED_DIR64, addr, 0, ctx->current_address, image_target); @@ -1365,7 +1365,7 @@ translate_relocation_pe (struct translate_context *ctx, #endif break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -1377,7 +1377,7 @@ translate_relocation_pe (struct translate_context *ctx, { ctx->current_address = add_fixup_entry (&ctx->lst, - GRUB_PE32_REL_BASED_DIR64, + VasEBoot_PE32_REL_BASED_DIR64, addr, 0, ctx->current_address, image_target); } @@ -1402,7 +1402,7 @@ translate_relocation_pe (struct translate_context *ctx, break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } @@ -1420,7 +1420,7 @@ translate_relocation_pe (struct translate_context *ctx, case R_ARM_THM_JUMP24: case R_ARM_CALL: { - grub_util_info (" %s: not adding fixup: 0x%08x : 0x%08x", __FUNCTION__, (unsigned int) addr, (unsigned int) ctx->current_address); + VasEBoot_util_info (" %s: not adding fixup: 0x%08x : 0x%08x", __FUNCTION__, (unsigned int) addr, (unsigned int) ctx->current_address); } break; /* Create fixup entry for PE/COFF loader */ @@ -1428,26 +1428,26 @@ translate_relocation_pe (struct translate_context *ctx, { ctx->current_address = add_fixup_entry (&ctx->lst, - GRUB_PE32_REL_BASED_HIGHLOW, + VasEBoot_PE32_REL_BASED_HIGHLOW, addr, 0, ctx->current_address, image_target); } break; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } break; #endif /* defined(MKIMAGE_ELF32) */ default: - grub_util_error ("unknown machine type 0x%x", image_target->elf_target); + VasEBoot_util_error ("unknown machine type 0x%x", image_target->elf_target); } } static enum raw_reloc_type classify_raw_reloc (Elf_Addr info, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { /* Necessary to relocate only absolute addresses. */ switch (image_target->elf_target) @@ -1465,13 +1465,13 @@ classify_raw_reloc (Elf_Addr info, case R_ARM_ABS32: return RAW_RELOC_32; default: - grub_util_error (_("relocation 0x%x is not implemented yet"), + VasEBoot_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); break; } break; default: - grub_util_error ("unknown machine type 0x%x", image_target->elf_target); + VasEBoot_util_error ("unknown machine type 0x%x", image_target->elf_target); } } @@ -1479,7 +1479,7 @@ static void translate_relocation_raw (struct translate_context *ctx, Elf_Addr addr, Elf_Addr info, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { enum raw_reloc_type class = classify_raw_reloc (info, image_target); struct raw_reloc *rel; @@ -1496,7 +1496,7 @@ static void translate_relocation (struct translate_context *ctx, Elf_Addr addr, Elf_Addr info, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { if (image_target->id == IMAGE_EFI) translate_relocation_pe (ctx, addr, info, image_target); @@ -1505,21 +1505,21 @@ translate_relocation (struct translate_context *ctx, } static void -finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target) +finish_reloc_translation_pe (struct translate_context *ctx, struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target) { ctx->current_address = add_fixup_entry (&ctx->lst, 0, 0, 1, ctx->current_address, image_target); { - grub_uint8_t *ptr; + VasEBoot_uint8_t *ptr; layout->reloc_section = ptr = xmalloc (ctx->current_address); for (ctx->lst = ctx->lst0; ctx->lst; ctx->lst = ctx->lst->next) if (ctx->lst->state) { - memcpy (ptr, &ctx->lst->b, grub_target_to_host32 (ctx->lst->b.block_size)); - ptr += grub_target_to_host32 (ctx->lst->b.block_size); + memcpy (ptr, &ctx->lst->b, VasEBoot_target_to_host32 (ctx->lst->b.block_size)); + ptr += VasEBoot_target_to_host32 (ctx->lst->b.block_size); } - assert ((ctx->current_address + (grub_uint8_t *) layout->reloc_section) == ptr); + assert ((ctx->current_address + (VasEBoot_uint8_t *) layout->reloc_section) == ptr); } for (ctx->lst = ctx->lst0; ctx->lst; ) @@ -1531,11 +1531,11 @@ finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_ } layout->reloc_size = ctx->current_address; - if (image_target->elf_target == EM_ARM && layout->reloc_size > GRUB_KERNEL_ARM_STACK_SIZE) - grub_util_error ("Reloc section (%d) is bigger than stack size (%d). " + if (image_target->elf_target == EM_ARM && layout->reloc_size > VasEBoot_KERNEL_ARM_STACK_SIZE) + VasEBoot_util_error ("Reloc section (%d) is bigger than stack size (%d). " "This breaks assembly assumptions. Please increase stack size", (int) layout->reloc_size, - (int) GRUB_KERNEL_ARM_STACK_SIZE); + (int) VasEBoot_KERNEL_ARM_STACK_SIZE); } /* @@ -1559,19 +1559,19 @@ finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_ #define RAW_END_MARKER 0xffffffff static void -finish_reloc_translation_raw (struct translate_context *ctx, struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target) +finish_reloc_translation_raw (struct translate_context *ctx, struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target) { size_t count = 0, sz; enum raw_reloc_type highest = RAW_RELOC_NONE; enum raw_reloc_type curtype; struct raw_reloc *cur; - grub_uint32_t *p; + VasEBoot_uint32_t *p; if (!ctx->raw_relocs) { - layout->reloc_section = p = xmalloc (sizeof (grub_uint32_t)); + layout->reloc_section = p = xmalloc (sizeof (VasEBoot_uint32_t)); p[0] = RAW_END_MARKER; - layout->reloc_size = sizeof (grub_uint32_t); + layout->reloc_size = sizeof (VasEBoot_uint32_t); return; } for (cur = ctx->raw_relocs; cur; cur = cur->next) @@ -1581,7 +1581,7 @@ finish_reloc_translation_raw (struct translate_context *ctx, struct grub_mkimage highest = cur->type; } /* highest separators, count relocations and one end marker. */ - sz = (highest + count + 1) * sizeof (grub_uint32_t); + sz = (highest + count + 1) * sizeof (VasEBoot_uint32_t); layout->reloc_section = p = xmalloc (sz); for (curtype = 0; curtype <= highest; curtype++) { @@ -1598,8 +1598,8 @@ finish_reloc_translation_raw (struct translate_context *ctx, struct grub_mkimage } static void -finish_reloc_translation (struct translate_context *ctx, struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target) +finish_reloc_translation (struct translate_context *ctx, struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target) { if (image_target->id == IMAGE_EFI) finish_reloc_translation_pe (ctx, layout, image_target); @@ -1610,14 +1610,14 @@ finish_reloc_translation (struct translate_context *ctx, struct grub_mkimage_lay static void create_u64_fixups (struct translate_context *ctx, - Elf_Addr jumpers, grub_size_t njumpers, - const struct grub_install_image_target_desc *image_target) + Elf_Addr jumpers, VasEBoot_size_t njumpers, + const struct VasEBoot_install_image_target_desc *image_target) { unsigned i; assert (image_target->id == IMAGE_EFI); for (i = 0; i < njumpers; i++) ctx->current_address = add_fixup_entry (&ctx->lst, - GRUB_PE32_REL_BASED_DIR64, + VasEBoot_PE32_REL_BASED_DIR64, jumpers + 8 * i, 0, ctx->current_address, image_target); @@ -1625,11 +1625,11 @@ create_u64_fixups (struct translate_context *ctx, /* Make a .reloc section. */ static void -make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, +make_reloc_section (Elf_Ehdr *e, struct VasEBoot_mkimage_layout *layout, Elf_Addr *section_addresses, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { unsigned i; Elf_Shdr *s; @@ -1639,8 +1639,8 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if ((grub_target_to_host32 (s->sh_type) == SHT_REL) || - (grub_target_to_host32 (s->sh_type) == SHT_RELA)) + if ((VasEBoot_target_to_host32 (s->sh_type) == SHT_REL) || + (VasEBoot_target_to_host32 (s->sh_type) == SHT_RELA)) { Elf_Rel *r; Elf_Word rtab_size, r_size, num_rs; @@ -1648,15 +1648,15 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, Elf_Addr section_address; Elf_Word j; - grub_util_info ("translating the relocation section %s", - strtab + grub_le_to_cpu32 (s->sh_name)); + VasEBoot_util_info ("translating the relocation section %s", + strtab + VasEBoot_le_to_cpu32 (s->sh_name)); - rtab_size = grub_target_to_host (s->sh_size); - r_size = grub_target_to_host (s->sh_entsize); - rtab_offset = grub_target_to_host (s->sh_offset); + rtab_size = VasEBoot_target_to_host (s->sh_size); + r_size = VasEBoot_target_to_host (s->sh_entsize); + rtab_offset = VasEBoot_target_to_host (s->sh_offset); num_rs = rtab_size / r_size; - section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)]; + section_address = section_addresses[VasEBoot_le_to_cpu32 (s->sh_info)]; for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset); j < num_rs; @@ -1666,8 +1666,8 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, Elf_Addr offset; Elf_Addr addr; - offset = grub_target_to_host (r->r_offset); - info = grub_target_to_host (r->r_info); + offset = VasEBoot_target_to_host (r->r_offset); + info = VasEBoot_target_to_host (r->r_info); addr = section_address + offset; @@ -1694,38 +1694,38 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, /* Determine if this section is a text section. Return false if this section is not allocated. */ static int -SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) +SUFFIX (is_text_section) (Elf_Shdr *s, const struct VasEBoot_install_image_target_desc *image_target) { if (!is_relocatable (image_target) - && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) + && VasEBoot_target_to_host32 (s->sh_type) != SHT_PROGBITS) return 0; - return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) + return ((VasEBoot_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC)); } /* Determine if this section is a data section. */ static int -SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) +SUFFIX (is_data_section) (Elf_Shdr *s, const struct VasEBoot_install_image_target_desc *image_target) { if (!is_relocatable (image_target) - && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) + && VasEBoot_target_to_host32 (s->sh_type) != SHT_PROGBITS) return 0; - return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) - == SHF_ALLOC) && !(grub_target_to_host32 (s->sh_type) == SHT_NOBITS); + return ((VasEBoot_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) + == SHF_ALLOC) && !(VasEBoot_target_to_host32 (s->sh_type) == SHT_NOBITS); } static int -SUFFIX (is_bss_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) +SUFFIX (is_bss_section) (Elf_Shdr *s, const struct VasEBoot_install_image_target_desc *image_target) { if (!is_relocatable (image_target)) return 0; - return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) - == SHF_ALLOC) && (grub_target_to_host32 (s->sh_type) == SHT_NOBITS); + return ((VasEBoot_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) + == SHF_ALLOC) && (VasEBoot_target_to_host32 (s->sh_type) == SHT_NOBITS); } /* Return if the ELF header is valid. */ static int -SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_image_target_desc *image_target) +SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct VasEBoot_install_image_target_desc *image_target) { if (size < sizeof (*e) || e->e_ident[EI_MAG0] != ELFMAG0 @@ -1734,7 +1734,7 @@ SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_i || e->e_ident[EI_MAG3] != ELFMAG3 || e->e_ident[EI_VERSION] != EV_CURRENT || e->e_ident[EI_CLASS] != ELFCLASSXX - || e->e_version != grub_host_to_target32 (EV_CURRENT)) + || e->e_version != VasEBoot_host_to_target32 (EV_CURRENT)) return 0; return 1; @@ -1745,24 +1745,24 @@ SUFFIX (put_section) (Elf_Shdr *s, int i, Elf_Addr current_address, Elf_Addr *section_addresses, const char *strtab, - const struct grub_install_image_target_desc *image_target) + const struct VasEBoot_install_image_target_desc *image_target) { - Elf_Word align = grub_host_to_target_addr (s->sh_addralign); - const char *name = strtab + grub_host_to_target32 (s->sh_name); + Elf_Word align = VasEBoot_host_to_target_addr (s->sh_addralign); + const char *name = strtab + VasEBoot_host_to_target32 (s->sh_name); if (align) current_address = ALIGN_UP (current_address + image_target->vaddr_offset, align) - image_target->vaddr_offset; - grub_util_info ("locating the section %s at 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("locating the section %s at 0x%" + VasEBoot_HOST_PRIxLONG_LONG, name, (unsigned long long) current_address); if (!is_relocatable (image_target)) - current_address = grub_host_to_target_addr (s->sh_addr) + current_address = VasEBoot_host_to_target_addr (s->sh_addr) - image_target->link_addr; section_addresses[i] = current_address; - current_address += grub_host_to_target_addr (s->sh_size); + current_address += VasEBoot_host_to_target_addr (s->sh_size); return current_address; } @@ -1773,8 +1773,8 @@ static Elf_Addr * SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, - struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target) + struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target) { int i; Elf_Addr *section_addresses; @@ -1793,9 +1793,9 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if ((grub_target_to_host (s->sh_flags) & SHF_ALLOC) - && grub_host_to_target32 (s->sh_addralign) > layout->align) - layout->align = grub_host_to_target32 (s->sh_addralign); + if ((VasEBoot_target_to_host (s->sh_flags) & SHF_ALLOC) + && VasEBoot_host_to_target32 (s->sh_addralign) > layout->align) + layout->align = VasEBoot_host_to_target32 (s->sh_addralign); /* .text */ @@ -1810,15 +1810,15 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, strtab, image_target); if (!is_relocatable (image_target) && - grub_host_to_target_addr (s->sh_addr) != image_target->link_addr) + VasEBoot_host_to_target_addr (s->sh_addr) != image_target->link_addr) { char *msg - = grub_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx" + = VasEBoot_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx" " instead of 0x%llx: ld.gold bug?"), kernel_path, - (unsigned long long) grub_host_to_target_addr (s->sh_addr), + (unsigned long long) VasEBoot_host_to_target_addr (s->sh_addr), (unsigned long long) image_target->link_addr); - grub_util_error ("%s", msg); + VasEBoot_util_error ("%s", msg); } } @@ -1841,7 +1841,7 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, #ifdef MKIMAGE_ELF32 if (image_target->elf_target == EM_ARM) { - grub_size_t tramp; + VasEBoot_size_t tramp; layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; @@ -1883,10 +1883,10 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, } char * -SUFFIX (grub_mkimage_load_image) (const char *kernel_path, +SUFFIX (VasEBoot_mkimage_load_image) (const char *kernel_path, size_t total_module_size, - struct grub_mkimage_layout *layout, - const struct grub_install_image_target_desc *image_target) + struct VasEBoot_mkimage_layout *layout, + const struct VasEBoot_install_image_target_desc *image_target) { char *kernel_img, *out_img; const char *strtab; @@ -1899,34 +1899,34 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, Elf_Half num_sections; Elf_Off section_offset; Elf_Half section_entsize; - grub_size_t kernel_size; + VasEBoot_size_t kernel_size; Elf_Shdr *symtab_section = 0; - grub_memset (layout, 0, sizeof (*layout)); + VasEBoot_memset (layout, 0, sizeof (*layout)); layout->start_address = 0; - kernel_size = grub_util_get_image_size (kernel_path); + kernel_size = VasEBoot_util_get_image_size (kernel_path); kernel_img = xmalloc (kernel_size); - grub_util_load_image (kernel_path, kernel_img); + VasEBoot_util_load_image (kernel_path, kernel_img); e = (Elf_Ehdr *) kernel_img; if (! SUFFIX (check_elf_header) (e, kernel_size, image_target)) - grub_util_error ("invalid ELF header"); + VasEBoot_util_error ("invalid ELF header"); - section_offset = grub_target_to_host (e->e_shoff); - section_entsize = grub_target_to_host16 (e->e_shentsize); - num_sections = grub_target_to_host16 (e->e_shnum); + section_offset = VasEBoot_target_to_host (e->e_shoff); + section_entsize = VasEBoot_target_to_host16 (e->e_shentsize); + num_sections = VasEBoot_target_to_host16 (e->e_shnum); - if (kernel_size < section_offset + (grub_uint32_t) section_entsize * num_sections) - grub_util_error (_("premature end of file %s"), kernel_path); + if (kernel_size < section_offset + (VasEBoot_uint32_t) section_entsize * num_sections) + VasEBoot_util_error (_("premature end of file %s"), kernel_path); sections = (Elf_Shdr *) (kernel_img + section_offset); /* Relocate sections then symbols in the virtual address space. */ s = (Elf_Shdr *) ((char *) sections - + grub_host_to_target16 (e->e_shstrndx) * section_entsize); - strtab = (char *) e + grub_host_to_target_addr (s->sh_offset); + + VasEBoot_host_to_target16 (e->e_shstrndx) * section_entsize); + strtab = (char *) e + VasEBoot_host_to_target_addr (s->sh_offset); section_addresses = SUFFIX (locate_sections) (e, kernel_path, sections, section_entsize, @@ -1946,10 +1946,10 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) + if (VasEBoot_target_to_host32 (s->sh_type) == SHT_NOBITS) { - Elf_Word sec_align = grub_host_to_target_addr (s->sh_addralign); - const char *name = strtab + grub_host_to_target32 (s->sh_name); + Elf_Word sec_align = VasEBoot_host_to_target_addr (s->sh_addralign); + const char *name = strtab + VasEBoot_host_to_target32 (s->sh_name); if (sec_align) current_address = ALIGN_UP (current_address @@ -1957,16 +1957,16 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, sec_align) - image_target->vaddr_offset; - grub_util_info ("locating the section %s at 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("locating the section %s at 0x%" + VasEBoot_HOST_PRIxLONG_LONG, name, (unsigned long long) current_address); if (!is_relocatable (image_target)) - current_address = grub_host_to_target_addr (s->sh_addr) + current_address = VasEBoot_host_to_target_addr (s->sh_addr) - image_target->link_addr; section_vaddresses[i] = current_address + image_target->vaddr_offset; - current_address += grub_host_to_target_addr (s->sh_size); + current_address += VasEBoot_host_to_target_addr (s->sh_size); } current_address = ALIGN_UP (current_address + image_target->vaddr_offset, image_target->section_align) @@ -1988,21 +1988,21 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if (s->sh_type == grub_host_to_target32 (SHT_SYMTAB)) + if (s->sh_type == VasEBoot_host_to_target32 (SHT_SYMTAB)) { symtab_section = s; break; } if (! symtab_section) - grub_util_error ("%s", _("no symbol table")); + VasEBoot_util_error ("%s", _("no symbol table")); #ifdef MKIMAGE_ELF64 if (image_target->elf_target == EM_IA_64) { - grub_size_t tramp; + VasEBoot_size_t tramp; layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); - grub_ia64_dl_get_tramp_got_size (e, &tramp, &layout->got_size); + VasEBoot_ia64_dl_get_tramp_got_size (e, &tramp, &layout->got_size); layout->tramp_off = layout->kernel_size; layout->kernel_size += ALIGN_UP (tramp, 16); @@ -2017,11 +2017,11 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, } if (image_target->elf_target == EM_AARCH64) { - grub_size_t tramp; + VasEBoot_size_t tramp; layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); - grub_arm64_dl_get_tramp_got_size (e, &tramp, &layout->got_size); + VasEBoot_arm64_dl_get_tramp_got_size (e, &tramp, &layout->got_size); layout->got_off = layout->kernel_size; layout->kernel_size += ALIGN_UP (layout->got_size, 16); @@ -2049,7 +2049,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, layout->end, image_target); if (layout->start_address == (Elf_Addr) -1) - grub_util_error ("start symbol is not defined"); + VasEBoot_util_error ("start symbol is not defined"); /* Resolve addresses in the virtual address space. */ SUFFIX (relocate_addresses) (e, sections, section_addresses, @@ -2087,13 +2087,13 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, || (SUFFIX (is_bss_section) (s, image_target) && (image_target->id != IMAGE_UBOOT)) || SUFFIX (is_text_section) (s, image_target)) { - if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) + if (VasEBoot_target_to_host32 (s->sh_type) == SHT_NOBITS) memset (out_img + section_addresses[i], 0, - grub_host_to_target_addr (s->sh_size)); + VasEBoot_host_to_target_addr (s->sh_size)); else memcpy (out_img + section_addresses[i], - kernel_img + grub_host_to_target_addr (s->sh_offset), - grub_host_to_target_addr (s->sh_size)); + kernel_img + VasEBoot_host_to_target_addr (s->sh_offset), + VasEBoot_host_to_target_addr (s->sh_size)); } free (kernel_img); diff --git a/util/VasEBoot-mklayout.c b/util/VasEBoot-mklayout.c index d171c2700..0b5525ef5 100644 --- a/util/VasEBoot-mklayout.c +++ b/util/VasEBoot-mklayout.c @@ -1,27 +1,27 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -57,13 +57,13 @@ static struct argp_option options[] = { { 0, 0, 0, 0, 0, 0 } }; -struct console_grub_equivalence +struct console_VasEBoot_equivalence { const char *layout; - grub_uint32_t grub; + VasEBoot_uint32_t VasEBoot; }; -static struct console_grub_equivalence console_grub_equivalences_shift[] = { +static struct console_VasEBoot_equivalence console_VasEBoot_equivalences_shift[] = { {"KP_0", '0'}, {"KP_1", '1'}, {"KP_2", '2'}, @@ -79,26 +79,26 @@ static struct console_grub_equivalence console_grub_equivalences_shift[] = { {NULL, '\0'} }; -static struct console_grub_equivalence console_grub_equivalences_unshift[] = { - {"KP_0", GRUB_TERM_KEY_INSERT}, - {"KP_1", GRUB_TERM_KEY_END}, - {"KP_2", GRUB_TERM_KEY_DOWN}, - {"KP_3", GRUB_TERM_KEY_NPAGE}, - {"KP_4", GRUB_TERM_KEY_LEFT}, - {"KP_5", GRUB_TERM_KEY_CENTER}, - {"KP_6", GRUB_TERM_KEY_RIGHT}, - {"KP_7", GRUB_TERM_KEY_HOME}, - {"KP_8", GRUB_TERM_KEY_UP}, - {"KP_9", GRUB_TERM_KEY_PPAGE}, - {"KP_Period", GRUB_TERM_KEY_DC}, +static struct console_VasEBoot_equivalence console_VasEBoot_equivalences_unshift[] = { + {"KP_0", VasEBoot_TERM_KEY_INSERT}, + {"KP_1", VasEBoot_TERM_KEY_END}, + {"KP_2", VasEBoot_TERM_KEY_DOWN}, + {"KP_3", VasEBoot_TERM_KEY_NPAGE}, + {"KP_4", VasEBoot_TERM_KEY_LEFT}, + {"KP_5", VasEBoot_TERM_KEY_CENTER}, + {"KP_6", VasEBoot_TERM_KEY_RIGHT}, + {"KP_7", VasEBoot_TERM_KEY_HOME}, + {"KP_8", VasEBoot_TERM_KEY_UP}, + {"KP_9", VasEBoot_TERM_KEY_PPAGE}, + {"KP_Period", VasEBoot_TERM_KEY_DC}, {NULL, '\0'} }; -static struct console_grub_equivalence console_grub_equivalences_common[] = { - {"Escape", GRUB_TERM_ESC}, - {"Tab", GRUB_TERM_TAB}, - {"Delete", GRUB_TERM_BACKSPACE}, +static struct console_VasEBoot_equivalence console_VasEBoot_equivalences_common[] = { + {"Escape", VasEBoot_TERM_ESC}, + {"Tab", VasEBoot_TERM_TAB}, + {"Delete", VasEBoot_TERM_BACKSPACE}, {"KP_Enter", '\n'}, {"Return", '\n'}, @@ -108,68 +108,68 @@ static struct console_grub_equivalence console_grub_equivalences_common[] = { {"KP_Add", '+'}, {"KP_Divide", '/'}, - {"F1", GRUB_TERM_KEY_F1}, - {"F2", GRUB_TERM_KEY_F2}, - {"F3", GRUB_TERM_KEY_F3}, - {"F4", GRUB_TERM_KEY_F4}, - {"F5", GRUB_TERM_KEY_F5}, - {"F6", GRUB_TERM_KEY_F6}, - {"F7", GRUB_TERM_KEY_F7}, - {"F8", GRUB_TERM_KEY_F8}, - {"F9", GRUB_TERM_KEY_F9}, - {"F10", GRUB_TERM_KEY_F10}, - {"F11", GRUB_TERM_KEY_F11}, - {"F12", GRUB_TERM_KEY_F12}, - {"F13", GRUB_TERM_KEY_F1 | GRUB_TERM_SHIFT}, - {"F14", GRUB_TERM_KEY_F2 | GRUB_TERM_SHIFT}, - {"F15", GRUB_TERM_KEY_F3 | GRUB_TERM_SHIFT}, - {"F16", GRUB_TERM_KEY_F4 | GRUB_TERM_SHIFT}, - {"F17", GRUB_TERM_KEY_F5 | GRUB_TERM_SHIFT}, - {"F18", GRUB_TERM_KEY_F6 | GRUB_TERM_SHIFT}, - {"F19", GRUB_TERM_KEY_F7 | GRUB_TERM_SHIFT}, - {"F20", GRUB_TERM_KEY_F8 | GRUB_TERM_SHIFT}, - {"F21", GRUB_TERM_KEY_F9 | GRUB_TERM_SHIFT}, - {"F22", GRUB_TERM_KEY_F10 | GRUB_TERM_SHIFT}, - {"F23", GRUB_TERM_KEY_F11 | GRUB_TERM_SHIFT}, - {"F24", GRUB_TERM_KEY_F12 | GRUB_TERM_SHIFT}, - {"Console_13", GRUB_TERM_KEY_F1 | GRUB_TERM_ALT}, - {"Console_14", GRUB_TERM_KEY_F2 | GRUB_TERM_ALT}, - {"Console_15", GRUB_TERM_KEY_F3 | GRUB_TERM_ALT}, - {"Console_16", GRUB_TERM_KEY_F4 | GRUB_TERM_ALT}, - {"Console_17", GRUB_TERM_KEY_F5 | GRUB_TERM_ALT}, - {"Console_18", GRUB_TERM_KEY_F6 | GRUB_TERM_ALT}, - {"Console_19", GRUB_TERM_KEY_F7 | GRUB_TERM_ALT}, - {"Console_20", GRUB_TERM_KEY_F8 | GRUB_TERM_ALT}, - {"Console_21", GRUB_TERM_KEY_F9 | GRUB_TERM_ALT}, - {"Console_22", GRUB_TERM_KEY_F10 | GRUB_TERM_ALT}, - {"Console_23", GRUB_TERM_KEY_F11 | GRUB_TERM_ALT}, - {"Console_24", GRUB_TERM_KEY_F12 | GRUB_TERM_ALT}, - {"Console_25", GRUB_TERM_KEY_F1 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_26", GRUB_TERM_KEY_F2 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_27", GRUB_TERM_KEY_F3 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_28", GRUB_TERM_KEY_F4 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_29", GRUB_TERM_KEY_F5 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_30", GRUB_TERM_KEY_F6 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_31", GRUB_TERM_KEY_F7 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_32", GRUB_TERM_KEY_F8 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_33", GRUB_TERM_KEY_F9 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_34", GRUB_TERM_KEY_F10 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_35", GRUB_TERM_KEY_F11 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, - {"Console_36", GRUB_TERM_KEY_F12 | GRUB_TERM_SHIFT | GRUB_TERM_ALT}, + {"F1", VasEBoot_TERM_KEY_F1}, + {"F2", VasEBoot_TERM_KEY_F2}, + {"F3", VasEBoot_TERM_KEY_F3}, + {"F4", VasEBoot_TERM_KEY_F4}, + {"F5", VasEBoot_TERM_KEY_F5}, + {"F6", VasEBoot_TERM_KEY_F6}, + {"F7", VasEBoot_TERM_KEY_F7}, + {"F8", VasEBoot_TERM_KEY_F8}, + {"F9", VasEBoot_TERM_KEY_F9}, + {"F10", VasEBoot_TERM_KEY_F10}, + {"F11", VasEBoot_TERM_KEY_F11}, + {"F12", VasEBoot_TERM_KEY_F12}, + {"F13", VasEBoot_TERM_KEY_F1 | VasEBoot_TERM_SHIFT}, + {"F14", VasEBoot_TERM_KEY_F2 | VasEBoot_TERM_SHIFT}, + {"F15", VasEBoot_TERM_KEY_F3 | VasEBoot_TERM_SHIFT}, + {"F16", VasEBoot_TERM_KEY_F4 | VasEBoot_TERM_SHIFT}, + {"F17", VasEBoot_TERM_KEY_F5 | VasEBoot_TERM_SHIFT}, + {"F18", VasEBoot_TERM_KEY_F6 | VasEBoot_TERM_SHIFT}, + {"F19", VasEBoot_TERM_KEY_F7 | VasEBoot_TERM_SHIFT}, + {"F20", VasEBoot_TERM_KEY_F8 | VasEBoot_TERM_SHIFT}, + {"F21", VasEBoot_TERM_KEY_F9 | VasEBoot_TERM_SHIFT}, + {"F22", VasEBoot_TERM_KEY_F10 | VasEBoot_TERM_SHIFT}, + {"F23", VasEBoot_TERM_KEY_F11 | VasEBoot_TERM_SHIFT}, + {"F24", VasEBoot_TERM_KEY_F12 | VasEBoot_TERM_SHIFT}, + {"Console_13", VasEBoot_TERM_KEY_F1 | VasEBoot_TERM_ALT}, + {"Console_14", VasEBoot_TERM_KEY_F2 | VasEBoot_TERM_ALT}, + {"Console_15", VasEBoot_TERM_KEY_F3 | VasEBoot_TERM_ALT}, + {"Console_16", VasEBoot_TERM_KEY_F4 | VasEBoot_TERM_ALT}, + {"Console_17", VasEBoot_TERM_KEY_F5 | VasEBoot_TERM_ALT}, + {"Console_18", VasEBoot_TERM_KEY_F6 | VasEBoot_TERM_ALT}, + {"Console_19", VasEBoot_TERM_KEY_F7 | VasEBoot_TERM_ALT}, + {"Console_20", VasEBoot_TERM_KEY_F8 | VasEBoot_TERM_ALT}, + {"Console_21", VasEBoot_TERM_KEY_F9 | VasEBoot_TERM_ALT}, + {"Console_22", VasEBoot_TERM_KEY_F10 | VasEBoot_TERM_ALT}, + {"Console_23", VasEBoot_TERM_KEY_F11 | VasEBoot_TERM_ALT}, + {"Console_24", VasEBoot_TERM_KEY_F12 | VasEBoot_TERM_ALT}, + {"Console_25", VasEBoot_TERM_KEY_F1 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_26", VasEBoot_TERM_KEY_F2 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_27", VasEBoot_TERM_KEY_F3 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_28", VasEBoot_TERM_KEY_F4 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_29", VasEBoot_TERM_KEY_F5 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_30", VasEBoot_TERM_KEY_F6 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_31", VasEBoot_TERM_KEY_F7 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_32", VasEBoot_TERM_KEY_F8 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_33", VasEBoot_TERM_KEY_F9 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_34", VasEBoot_TERM_KEY_F10 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_35", VasEBoot_TERM_KEY_F11 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, + {"Console_36", VasEBoot_TERM_KEY_F12 | VasEBoot_TERM_SHIFT | VasEBoot_TERM_ALT}, - {"Insert", GRUB_TERM_KEY_INSERT}, - {"Down", GRUB_TERM_KEY_DOWN}, - {"Up", GRUB_TERM_KEY_UP}, - {"Home", GRUB_TERM_KEY_HOME}, - {"End", GRUB_TERM_KEY_END}, - {"Right", GRUB_TERM_KEY_RIGHT}, - {"Left", GRUB_TERM_KEY_LEFT}, - {"Next", GRUB_TERM_KEY_NPAGE}, - {"Prior", GRUB_TERM_KEY_PPAGE}, - {"Remove", GRUB_TERM_KEY_DC}, + {"Insert", VasEBoot_TERM_KEY_INSERT}, + {"Down", VasEBoot_TERM_KEY_DOWN}, + {"Up", VasEBoot_TERM_KEY_UP}, + {"Home", VasEBoot_TERM_KEY_HOME}, + {"End", VasEBoot_TERM_KEY_END}, + {"Right", VasEBoot_TERM_KEY_RIGHT}, + {"Left", VasEBoot_TERM_KEY_LEFT}, + {"Next", VasEBoot_TERM_KEY_NPAGE}, + {"Prior", VasEBoot_TERM_KEY_PPAGE}, + {"Remove", VasEBoot_TERM_KEY_DC}, {"VoidSymbol", 0}, - /* "Undead" keys since no dead key support in GRUB. */ + /* "Undead" keys since no dead key support in VasEBoot. */ {"dead_acute", '\''}, {"dead_circumflex", '^'}, {"dead_grave", '`'}, @@ -183,7 +183,7 @@ static struct console_grub_equivalence console_grub_equivalences_common[] = { {"dead_breve", 0}, {"dead_doubleacute", 0}, - /* Unused in GRUB. */ + /* Unused in VasEBoot. */ {"Pause", 0}, {"Scroll_Forward", 0}, {"Scroll_Backward", 0}, @@ -212,74 +212,74 @@ static struct console_grub_equivalence console_grub_equivalences_common[] = { {NULL, '\0'} }; -static grub_uint8_t linux_to_usb_map[128] = { - /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE, - /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2, - /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4, - /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6, - /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8, - /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0, - /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL, - /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB, - /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W, - /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R, - /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y, - /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I, - /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P, - /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET, - /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL, - /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S, - /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F, - /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H, - /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K, - /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON, - /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE, - /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH, - /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X, - /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V, - /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N, - /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA, - /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH, - /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL, - /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE, - /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1, - /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3, - /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5, - /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7, - /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9, - /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK, - /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7, - /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9, - /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4, - /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6, - /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1, - /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3, - /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT, +static VasEBoot_uint8_t linux_to_usb_map[128] = { + /* 0x00 */ 0 /* Unused */, VasEBoot_KEYBOARD_KEY_ESCAPE, + /* 0x02 */ VasEBoot_KEYBOARD_KEY_1, VasEBoot_KEYBOARD_KEY_2, + /* 0x04 */ VasEBoot_KEYBOARD_KEY_3, VasEBoot_KEYBOARD_KEY_4, + /* 0x06 */ VasEBoot_KEYBOARD_KEY_5, VasEBoot_KEYBOARD_KEY_6, + /* 0x08 */ VasEBoot_KEYBOARD_KEY_7, VasEBoot_KEYBOARD_KEY_8, + /* 0x0a */ VasEBoot_KEYBOARD_KEY_9, VasEBoot_KEYBOARD_KEY_0, + /* 0x0c */ VasEBoot_KEYBOARD_KEY_DASH, VasEBoot_KEYBOARD_KEY_EQUAL, + /* 0x0e */ VasEBoot_KEYBOARD_KEY_BACKSPACE, VasEBoot_KEYBOARD_KEY_TAB, + /* 0x10 */ VasEBoot_KEYBOARD_KEY_Q, VasEBoot_KEYBOARD_KEY_W, + /* 0x12 */ VasEBoot_KEYBOARD_KEY_E, VasEBoot_KEYBOARD_KEY_R, + /* 0x14 */ VasEBoot_KEYBOARD_KEY_T, VasEBoot_KEYBOARD_KEY_Y, + /* 0x16 */ VasEBoot_KEYBOARD_KEY_U, VasEBoot_KEYBOARD_KEY_I, + /* 0x18 */ VasEBoot_KEYBOARD_KEY_O, VasEBoot_KEYBOARD_KEY_P, + /* 0x1a */ VasEBoot_KEYBOARD_KEY_LBRACKET, VasEBoot_KEYBOARD_KEY_RBRACKET, + /* 0x1c */ VasEBoot_KEYBOARD_KEY_ENTER, VasEBoot_KEYBOARD_KEY_LEFT_CTRL, + /* 0x1e */ VasEBoot_KEYBOARD_KEY_A, VasEBoot_KEYBOARD_KEY_S, + /* 0x20 */ VasEBoot_KEYBOARD_KEY_D, VasEBoot_KEYBOARD_KEY_F, + /* 0x22 */ VasEBoot_KEYBOARD_KEY_G, VasEBoot_KEYBOARD_KEY_H, + /* 0x24 */ VasEBoot_KEYBOARD_KEY_J, VasEBoot_KEYBOARD_KEY_K, + /* 0x26 */ VasEBoot_KEYBOARD_KEY_L, VasEBoot_KEYBOARD_KEY_SEMICOLON, + /* 0x28 */ VasEBoot_KEYBOARD_KEY_DQUOTE, VasEBoot_KEYBOARD_KEY_RQUOTE, + /* 0x2a */ VasEBoot_KEYBOARD_KEY_LEFT_SHIFT, VasEBoot_KEYBOARD_KEY_BACKSLASH, + /* 0x2c */ VasEBoot_KEYBOARD_KEY_Z, VasEBoot_KEYBOARD_KEY_X, + /* 0x2e */ VasEBoot_KEYBOARD_KEY_C, VasEBoot_KEYBOARD_KEY_V, + /* 0x30 */ VasEBoot_KEYBOARD_KEY_B, VasEBoot_KEYBOARD_KEY_N, + /* 0x32 */ VasEBoot_KEYBOARD_KEY_M, VasEBoot_KEYBOARD_KEY_COMMA, + /* 0x34 */ VasEBoot_KEYBOARD_KEY_DOT, VasEBoot_KEYBOARD_KEY_SLASH, + /* 0x36 */ VasEBoot_KEYBOARD_KEY_RIGHT_SHIFT, VasEBoot_KEYBOARD_KEY_NUMMUL, + /* 0x38 */ VasEBoot_KEYBOARD_KEY_LEFT_ALT, VasEBoot_KEYBOARD_KEY_SPACE, + /* 0x3a */ VasEBoot_KEYBOARD_KEY_CAPS_LOCK, VasEBoot_KEYBOARD_KEY_F1, + /* 0x3c */ VasEBoot_KEYBOARD_KEY_F2, VasEBoot_KEYBOARD_KEY_F3, + /* 0x3e */ VasEBoot_KEYBOARD_KEY_F4, VasEBoot_KEYBOARD_KEY_F5, + /* 0x40 */ VasEBoot_KEYBOARD_KEY_F6, VasEBoot_KEYBOARD_KEY_F7, + /* 0x42 */ VasEBoot_KEYBOARD_KEY_F8, VasEBoot_KEYBOARD_KEY_F9, + /* 0x44 */ VasEBoot_KEYBOARD_KEY_F10, VasEBoot_KEYBOARD_KEY_NUM_LOCK, + /* 0x46 */ VasEBoot_KEYBOARD_KEY_SCROLL_LOCK, VasEBoot_KEYBOARD_KEY_NUM7, + /* 0x48 */ VasEBoot_KEYBOARD_KEY_NUM8, VasEBoot_KEYBOARD_KEY_NUM9, + /* 0x4a */ VasEBoot_KEYBOARD_KEY_NUMMINUS, VasEBoot_KEYBOARD_KEY_NUM4, + /* 0x4c */ VasEBoot_KEYBOARD_KEY_NUM5, VasEBoot_KEYBOARD_KEY_NUM6, + /* 0x4e */ VasEBoot_KEYBOARD_KEY_NUMPLUS, VasEBoot_KEYBOARD_KEY_NUM1, + /* 0x50 */ VasEBoot_KEYBOARD_KEY_NUM2, VasEBoot_KEYBOARD_KEY_NUM3, + /* 0x52 */ VasEBoot_KEYBOARD_KEY_NUMDOT, VasEBoot_KEYBOARD_KEY_NUMDOT, /* 0x54 */ 0, 0, - /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, - /* 0x58 */ GRUB_KEYBOARD_KEY_F12, GRUB_KEYBOARD_KEY_JP_RO, + /* 0x56 */ VasEBoot_KEYBOARD_KEY_102ND, VasEBoot_KEYBOARD_KEY_F11, + /* 0x58 */ VasEBoot_KEYBOARD_KEY_F12, VasEBoot_KEYBOARD_KEY_JP_RO, /* 0x5a */ 0, 0, /* 0x5c */ 0, 0, /* 0x5e */ 0, 0, - /* 0x60 */ GRUB_KEYBOARD_KEY_NUMENTER, GRUB_KEYBOARD_KEY_RIGHT_CTRL, - /* 0x62 */ GRUB_KEYBOARD_KEY_NUMSLASH, 0, - /* 0x64 */ GRUB_KEYBOARD_KEY_RIGHT_ALT, 0, - /* 0x66 */ GRUB_KEYBOARD_KEY_HOME, GRUB_KEYBOARD_KEY_UP, - /* 0x68 */ GRUB_KEYBOARD_KEY_PPAGE, GRUB_KEYBOARD_KEY_LEFT, - /* 0x6a */ GRUB_KEYBOARD_KEY_RIGHT, GRUB_KEYBOARD_KEY_END, - /* 0x6c */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_NPAGE, - /* 0x6e */ GRUB_KEYBOARD_KEY_INSERT, GRUB_KEYBOARD_KEY_DELETE, + /* 0x60 */ VasEBoot_KEYBOARD_KEY_NUMENTER, VasEBoot_KEYBOARD_KEY_RIGHT_CTRL, + /* 0x62 */ VasEBoot_KEYBOARD_KEY_NUMSLASH, 0, + /* 0x64 */ VasEBoot_KEYBOARD_KEY_RIGHT_ALT, 0, + /* 0x66 */ VasEBoot_KEYBOARD_KEY_HOME, VasEBoot_KEYBOARD_KEY_UP, + /* 0x68 */ VasEBoot_KEYBOARD_KEY_PPAGE, VasEBoot_KEYBOARD_KEY_LEFT, + /* 0x6a */ VasEBoot_KEYBOARD_KEY_RIGHT, VasEBoot_KEYBOARD_KEY_END, + /* 0x6c */ VasEBoot_KEYBOARD_KEY_DOWN, VasEBoot_KEYBOARD_KEY_NPAGE, + /* 0x6e */ VasEBoot_KEYBOARD_KEY_INSERT, VasEBoot_KEYBOARD_KEY_DELETE, /* 0x70 */ 0, 0, - /* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO, + /* 0x72 */ 0, VasEBoot_KEYBOARD_KEY_JP_RO, /* 0x74 */ 0, 0, /* 0x76 */ 0, 0, - /* 0x78 */ 0, GRUB_KEYBOARD_KEY_KPCOMMA, + /* 0x78 */ 0, VasEBoot_KEYBOARD_KEY_KPCOMMA, /* 0x7a */ 0, 0, - /* 0x7c */ GRUB_KEYBOARD_KEY_JP_YEN, + /* 0x7c */ VasEBoot_KEYBOARD_KEY_JP_YEN, }; static void -add_special_keys (struct grub_keyboard_layout *layout) +add_special_keys (struct VasEBoot_keyboard_layout *layout) { (void) layout; } @@ -288,20 +288,20 @@ static unsigned lookup (char *code, int shift) { int i; - struct console_grub_equivalence *pr; + struct console_VasEBoot_equivalence *pr; if (shift) - pr = console_grub_equivalences_shift; + pr = console_VasEBoot_equivalences_shift; else - pr = console_grub_equivalences_unshift; + pr = console_VasEBoot_equivalences_unshift; for (i = 0; pr[i].layout != NULL; i++) if (strcmp (code, pr[i].layout) == 0) - return pr[i].grub; + return pr[i].VasEBoot; - for (i = 0; console_grub_equivalences_common[i].layout != NULL; i++) - if (strcmp (code, console_grub_equivalences_common[i].layout) == 0) - return console_grub_equivalences_common[i].grub; + for (i = 0; console_VasEBoot_equivalences_common[i].layout != NULL; i++) + if (strcmp (code, console_VasEBoot_equivalences_common[i].layout) == 0) + return console_VasEBoot_equivalences_common[i].VasEBoot; /* TRANSLATORS: scan identifier is keyboard key symbolic name. */ fprintf (stderr, _("Unknown keyboard scan identifier %s\n"), code); @@ -310,7 +310,7 @@ lookup (char *code, int shift) } static unsigned int -get_grub_code (char *layout_code, int shift) +get_VasEBoot_code (char *layout_code, int shift) { unsigned int code; @@ -324,45 +324,45 @@ get_grub_code (char *layout_code, int shift) } static void -write_file (FILE *out, const char *fname, struct grub_keyboard_layout *layout) +write_file (FILE *out, const char *fname, struct VasEBoot_keyboard_layout *layout) { - grub_uint32_t version; + VasEBoot_uint32_t version; unsigned i; - version = grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION); + version = VasEBoot_cpu_to_le32_compile_time (VasEBoot_KEYBOARD_LAYOUTS_VERSION); for (i = 0; i < ARRAY_SIZE (layout->keyboard_map); i++) - layout->keyboard_map[i] = grub_cpu_to_le32(layout->keyboard_map[i]); + layout->keyboard_map[i] = VasEBoot_cpu_to_le32(layout->keyboard_map[i]); for (i = 0; i < ARRAY_SIZE (layout->keyboard_map_shift); i++) layout->keyboard_map_shift[i] - = grub_cpu_to_le32(layout->keyboard_map_shift[i]); + = VasEBoot_cpu_to_le32(layout->keyboard_map_shift[i]); for (i = 0; i < ARRAY_SIZE (layout->keyboard_map_l3); i++) layout->keyboard_map_l3[i] - = grub_cpu_to_le32(layout->keyboard_map_l3[i]); + = VasEBoot_cpu_to_le32(layout->keyboard_map_l3[i]); for (i = 0; i < ARRAY_SIZE (layout->keyboard_map_shift_l3); i++) layout->keyboard_map_shift_l3[i] - = grub_cpu_to_le32(layout->keyboard_map_shift_l3[i]); + = VasEBoot_cpu_to_le32(layout->keyboard_map_shift_l3[i]); - if (fwrite (GRUB_KEYBOARD_LAYOUTS_FILEMAGIC, 1, - GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE, out) - != GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE + if (fwrite (VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC, 1, + VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE, out) + != VasEBoot_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE || fwrite (&version, sizeof (version), 1, out) != 1 || fwrite (layout, 1, sizeof (*layout), out) != sizeof (*layout)) { if (fname) - grub_util_error ("cannot write to `%s': %s", fname, strerror (errno)); + VasEBoot_util_error ("cannot write to `%s': %s", fname, strerror (errno)); else - grub_util_error ("cannot write to the stdout: %s", strerror (errno)); + VasEBoot_util_error ("cannot write to the stdout: %s", strerror (errno)); } } static void write_keymaps (FILE *in, FILE *out, const char *out_filename) { - struct grub_keyboard_layout layout; + struct VasEBoot_keyboard_layout layout; char line[2048]; int ok; @@ -412,20 +412,20 @@ write_keymaps (FILE *in, FILE *out, const char *out_filename) keycode_usb = linux_to_usb_map[keycode_linux]; if (keycode_usb == 0 - || keycode_usb >= GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE) + || keycode_usb >= VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE) { /* TRANSLATORS: scan code is keyboard key numeric identifier. */ fprintf (stderr, _("Unknown keyboard scan code 0x%02x\n"), keycode_linux); continue; } - if (keycode_usb < GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE) + if (keycode_usb < VasEBoot_KEYBOARD_LAYOUTS_ARRAY_SIZE) { - layout.keyboard_map[keycode_usb] = get_grub_code (normal, 0); - layout.keyboard_map_shift[keycode_usb] = get_grub_code (shift, 1); + layout.keyboard_map[keycode_usb] = get_VasEBoot_code (normal, 0); + layout.keyboard_map_shift[keycode_usb] = get_VasEBoot_code (shift, 1); layout.keyboard_map_l3[keycode_usb] - = get_grub_code (normalalt, 0); + = get_VasEBoot_code (normalalt, 0); layout.keyboard_map_shift_l3[keycode_usb] - = get_grub_code (shiftalt, 1); + = get_VasEBoot_code (shiftalt, 1); ok = 1; } } @@ -475,7 +475,7 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp argp = { options, argp_parser, N_("[OPTIONS]"), /* TRANSLATORS: "one" is a shortcut for "keyboard layout". */ - N_("Generate GRUB keyboard layout from Linux console one."), + N_("Generate VasEBoot keyboard layout from Linux console one."), NULL, NULL, NULL }; @@ -485,7 +485,7 @@ main (int argc, char *argv[]) FILE *in, *out; struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Check for options. */ memset (&arguments, 0, sizeof (struct arguments)); @@ -496,16 +496,16 @@ main (int argc, char *argv[]) } if (arguments.input) - in = grub_util_fopen (arguments.input, "r"); + in = VasEBoot_util_fopen (arguments.input, "r"); else in = stdin; if (!in) - grub_util_error (_("cannot open `%s': %s"), arguments.input ? : "stdin", + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.input ? : "stdin", strerror (errno)); if (arguments.output) - out = grub_util_fopen (arguments.output, "wb"); + out = VasEBoot_util_fopen (arguments.output, "wb"); else out = stdout; @@ -513,7 +513,7 @@ main (int argc, char *argv[]) { if (in != stdin) fclose (in); - grub_util_error (_("cannot open `%s': %s"), arguments.output ? : "stdout", + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.output ? : "stdout", strerror (errno)); } diff --git a/util/VasEBoot-mknetdir.c b/util/VasEBoot-mknetdir.c index 82073d5cc..ee19691ce 100644 --- a/util/VasEBoot-mknetdir.c +++ b/util/VasEBoot-mknetdir.c @@ -1,25 +1,25 @@ /* * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include +#include +#include +#include #include #include @@ -42,7 +42,7 @@ enum }; static struct argp_option options[] = { - GRUB_INSTALL_OPTIONS, + VasEBoot_INSTALL_OPTIONS, {"net-directory", OPTION_NET_DIRECTORY, N_("DIR"), 0, N_("root directory of TFTP server"), 2}, {"subdir", OPTION_SUBDIR, N_("DIR"), @@ -55,7 +55,7 @@ static struct argp_option options[] = { static error_t argp_parser (int key, char *arg, struct argp_state *state) { - if (grub_install_parse (key, arg)) + if (VasEBoot_install_parse (key, arg)) return 0; switch (key) { @@ -85,9 +85,9 @@ argp_parser (int key, char *arg, struct argp_state *state) struct argp argp = { options, argp_parser, NULL, - "\v"N_("Prepares GRUB network boot images at net_directory/subdir " + "\v"N_("Prepares VasEBoot network boot images at net_directory/subdir " "assuming net_directory being TFTP root."), - NULL, grub_install_help_filter, NULL + NULL, VasEBoot_install_help_filter, NULL }; static char *base; @@ -97,38 +97,38 @@ static const struct const char *mkimage_target; const char *netmodule; const char *ext; -} targets[GRUB_INSTALL_PLATFORM_MAX] = +} targets[VasEBoot_INSTALL_PLATFORM_MAX] = { - [GRUB_INSTALL_PLATFORM_I386_PC] = { "i386-pc-pxe", "pxe", ".0" }, - [GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64-ieee1275-aout", "ofnet", ".img" }, - [GRUB_INSTALL_PLATFORM_I386_IEEE1275] = { "i386-ieee1275", "ofnet", ".elf" }, - [GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc-ieee1275", "ofnet", ".elf" }, - [GRUB_INSTALL_PLATFORM_I386_EFI] = { "i386-efi", "efinet", ".efi" }, - [GRUB_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64-efi", "efinet", ".efi" }, - [GRUB_INSTALL_PLATFORM_IA64_EFI] = { "ia64-efi", "efinet", ".efi" }, - [GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm-efi", "efinet", ".efi" }, - [GRUB_INSTALL_PLATFORM_ARM64_EFI] = { "arm64-efi", "efinet", ".efi" } + [VasEBoot_INSTALL_PLATFORM_I386_PC] = { "i386-pc-pxe", "pxe", ".0" }, + [VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64-ieee1275-aout", "ofnet", ".img" }, + [VasEBoot_INSTALL_PLATFORM_I386_IEEE1275] = { "i386-ieee1275", "ofnet", ".elf" }, + [VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc-ieee1275", "ofnet", ".elf" }, + [VasEBoot_INSTALL_PLATFORM_I386_EFI] = { "i386-efi", "efinet", ".efi" }, + [VasEBoot_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64-efi", "efinet", ".efi" }, + [VasEBoot_INSTALL_PLATFORM_IA64_EFI] = { "ia64-efi", "efinet", ".efi" }, + [VasEBoot_INSTALL_PLATFORM_ARM_EFI] = { "arm-efi", "efinet", ".efi" }, + [VasEBoot_INSTALL_PLATFORM_ARM64_EFI] = { "arm64-efi", "efinet", ".efi" } }; static void -process_input_dir (const char *input_dir, enum grub_install_plat platform) +process_input_dir (const char *input_dir, enum VasEBoot_install_plat platform) { - char *platsub = grub_install_get_platform_name (platform); - char *grubdir = grub_util_path_concat (3, rootdir, subdir, platsub); - char *load_cfg = grub_util_path_concat (2, grubdir, "load.cfg"); + char *platsub = VasEBoot_install_get_platform_name (platform); + char *VasEBootdir = VasEBoot_util_path_concat (3, rootdir, subdir, platsub); + char *load_cfg = VasEBoot_util_path_concat (2, VasEBootdir, "load.cfg"); char *prefix; char *output; - char *grub_cfg; + char *VasEBoot_cfg; FILE *cfg; - grub_install_copy_files (input_dir, base, platform); - grub_util_unlink (load_cfg); + VasEBoot_install_copy_files (input_dir, base, platform); + VasEBoot_util_unlink (load_cfg); if (debug_image) { - FILE *f = grub_util_fopen (load_cfg, "wb"); + FILE *f = VasEBoot_util_fopen (load_cfg, "wb"); if (!f) - grub_util_error (_("cannot open `%s': %s"), load_cfg, + VasEBoot_util_error (_("cannot open `%s': %s"), load_cfg, strerror (errno)); fprintf (f, "set debug='%s'\n", debug_image); fclose (f); @@ -141,23 +141,23 @@ process_input_dir (const char *input_dir, enum grub_install_plat platform) prefix = xasprintf ("/%s", subdir); if (!targets[platform].mkimage_target) - grub_util_error (_("unsupported platform %s"), platsub); + VasEBoot_util_error (_("unsupported platform %s"), platsub); - grub_cfg = grub_util_path_concat (2, grubdir, "grub.cfg"); - cfg = grub_util_fopen (grub_cfg, "wb"); + VasEBoot_cfg = VasEBoot_util_path_concat (2, VasEBootdir, "VasEBoot.cfg"); + cfg = VasEBoot_util_fopen (VasEBoot_cfg, "wb"); if (!cfg) - grub_util_error (_("cannot open `%s': %s"), grub_cfg, + VasEBoot_util_error (_("cannot open `%s': %s"), VasEBoot_cfg, strerror (errno)); - fprintf (cfg, "source %s/grub.cfg", subdir); + fprintf (cfg, "source %s/VasEBoot.cfg", subdir); fclose (cfg); - grub_install_push_module (targets[platform].netmodule); + VasEBoot_install_push_module (targets[platform].netmodule); - output = grub_util_path_concat_ext (2, grubdir, "core", targets[platform].ext); - grub_install_make_image_wrap (input_dir, prefix, output, + output = VasEBoot_util_path_concat_ext (2, VasEBootdir, "core", targets[platform].ext); + VasEBoot_install_make_image_wrap (input_dir, prefix, output, 0, load_cfg, targets[platform].mkimage_target, 0); - grub_install_pop_module (); + VasEBoot_install_pop_module (); /* TRANSLATORS: First %s is replaced by platform name. Second one by filename. */ printf (_("Netboot directory for %s created. Configure your DHCP server to point to %s\n"), @@ -166,8 +166,8 @@ process_input_dir (const char *input_dir, enum grub_install_plat platform) free (platsub); free (output); free (prefix); - free (grub_cfg); - free (grubdir); + free (VasEBoot_cfg); + free (VasEBootdir); } @@ -176,35 +176,35 @@ main (int argc, char *argv[]) { const char *pkglibdir; - grub_util_host_init (&argc, &argv); - grub_util_disable_fd_syncs (); + VasEBoot_util_host_init (&argc, &argv); + VasEBoot_util_disable_fd_syncs (); rootdir = xstrdup ("/srv/tftp"); - pkglibdir = grub_util_get_pkglibdir (); + pkglibdir = VasEBoot_util_get_pkglibdir (); - subdir = grub_util_path_concat (2, GRUB_BOOT_DIR_NAME, GRUB_DIR_NAME); + subdir = VasEBoot_util_path_concat (2, VasEBoot_BOOT_DIR_NAME, VasEBoot_DIR_NAME); argp_parse (&argp, argc, argv, 0, 0, 0); - base = grub_util_path_concat (2, rootdir, subdir); - /* Create the GRUB directory if it is not present. */ + base = VasEBoot_util_path_concat (2, rootdir, subdir); + /* Create the VasEBoot directory if it is not present. */ - grub_install_mkdir_p (base); + VasEBoot_install_mkdir_p (base); - grub_install_push_module ("tftp"); + VasEBoot_install_push_module ("tftp"); - if (!grub_install_source_directory) + if (!VasEBoot_install_source_directory) { - enum grub_install_plat plat; + enum VasEBoot_install_plat plat; - for (plat = 0; plat < GRUB_INSTALL_PLATFORM_MAX; plat++) + for (plat = 0; plat < VasEBoot_INSTALL_PLATFORM_MAX; plat++) if (targets[plat].mkimage_target) { - char *platdir = grub_util_path_concat (2, pkglibdir, - grub_install_get_platform_name (plat)); + char *platdir = VasEBoot_util_path_concat (2, pkglibdir, + VasEBoot_install_get_platform_name (plat)); - grub_util_info ("Looking for `%s'", platdir); + VasEBoot_util_info ("Looking for `%s'", platdir); - if (!grub_util_is_directory (platdir)) + if (!VasEBoot_util_is_directory (platdir)) { free (platdir); continue; @@ -214,9 +214,9 @@ main (int argc, char *argv[]) } else { - enum grub_install_plat plat; - plat = grub_install_get_target (grub_install_source_directory); - process_input_dir (grub_install_source_directory, plat); + enum VasEBoot_install_plat plat; + plat = VasEBoot_install_get_target (VasEBoot_install_source_directory); + process_input_dir (VasEBoot_install_source_directory, plat); } return 0; } diff --git a/util/VasEBoot-mkpasswd-pbkdf2.c b/util/VasEBoot-mkpasswd-pbkdf2.c index 5805f3c10..70bc5cd92 100644 --- a/util/VasEBoot-mkpasswd-pbkdf2.c +++ b/util/VasEBoot-mkpasswd-pbkdf2.c @@ -1,30 +1,30 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1992-1999,2001,2003,2004,2005,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -90,7 +90,7 @@ static struct argp argp = { static void -hexify (char *hex, grub_uint8_t *bin, grub_size_t n) +hexify (char *hex, VasEBoot_uint8_t *bin, VasEBoot_size_t n) { while (n--) { @@ -120,11 +120,11 @@ main (int argc, char *argv[]) }; char *result, *ptr; gcry_err_code_t gcry_err; - grub_uint8_t *buf, *salt; - char pass1[GRUB_AUTH_MAX_PASSLEN]; - char pass2[GRUB_AUTH_MAX_PASSLEN]; + VasEBoot_uint8_t *buf, *salt; + char pass1[VasEBoot_AUTH_MAX_PASSLEN]; + char pass2[VasEBoot_AUTH_MAX_PASSLEN]; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Check for options. */ if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0) @@ -137,18 +137,18 @@ main (int argc, char *argv[]) salt = xmalloc (arguments.saltlen); printf ("%s", _("Enter password: ")); - if (!grub_password_get (pass1, GRUB_AUTH_MAX_PASSLEN)) + if (!VasEBoot_password_get (pass1, VasEBoot_AUTH_MAX_PASSLEN)) { free (buf); free (salt); - grub_util_error ("%s", _("failure to read password")); + VasEBoot_util_error ("%s", _("failure to read password")); } printf ("%s", _("Reenter password: ")); - if (!grub_password_get (pass2, GRUB_AUTH_MAX_PASSLEN)) + if (!VasEBoot_password_get (pass2, VasEBoot_AUTH_MAX_PASSLEN)) { free (buf); free (salt); - grub_util_error ("%s", _("failure to read password")); + VasEBoot_util_error ("%s", _("failure to read password")); } if (strcmp (pass1, pass2) != 0) @@ -157,20 +157,20 @@ main (int argc, char *argv[]) memset (pass2, 0, sizeof (pass2)); free (buf); free (salt); - grub_util_error ("%s", _("passwords don't match")); + VasEBoot_util_error ("%s", _("passwords don't match")); } memset (pass2, 0, sizeof (pass2)); - if (grub_get_random (salt, arguments.saltlen)) + if (VasEBoot_get_random (salt, arguments.saltlen)) { memset (pass1, 0, sizeof (pass1)); free (buf); free (salt); - grub_util_error ("%s", _("couldn't retrieve random data for salt")); + VasEBoot_util_error ("%s", _("couldn't retrieve random data for salt")); } - gcry_err = grub_crypto_pbkdf2 (GRUB_MD_SHA512, - (grub_uint8_t *) pass1, strlen (pass1), + gcry_err = VasEBoot_crypto_pbkdf2 (VasEBoot_MD_SHA512, + (VasEBoot_uint8_t *) pass1, strlen (pass1), salt, arguments.saltlen, arguments.count, buf, arguments.buflen); memset (pass1, 0, sizeof (pass1)); @@ -181,16 +181,16 @@ main (int argc, char *argv[]) free (buf); memset (salt, 0, arguments.saltlen); free (salt); - grub_util_error (_("cryptographic error number %d"), gcry_err); + VasEBoot_util_error (_("cryptographic error number %d"), gcry_err); } - result = xmalloc (sizeof ("grub.pbkdf2.sha512.XXXXXXXXXXXXXXXXXXX.S.S") + result = xmalloc (sizeof ("VasEBoot.pbkdf2.sha512.XXXXXXXXXXXXXXXXXXX.S.S") + arguments.buflen * 2 + arguments.saltlen * 2); ptr = result; - memcpy (ptr, "grub.pbkdf2.sha512.", sizeof ("grub.pbkdf2.sha512.") - 1); - ptr += sizeof ("grub.pbkdf2.sha512.") - 1; + memcpy (ptr, "VasEBoot.pbkdf2.sha512.", sizeof ("VasEBoot.pbkdf2.sha512.") - 1); + ptr += sizeof ("VasEBoot.pbkdf2.sha512.") - 1; - grub_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXX"), "%d", arguments.count); + VasEBoot_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXX"), "%d", arguments.count); ptr += strlen (ptr); *ptr++ = '.'; hexify (ptr, salt, arguments.saltlen); diff --git a/util/VasEBoot-mkrelpath.c b/util/VasEBoot-mkrelpath.c index 47a241a39..66a5e4847 100644 --- a/util/VasEBoot-mkrelpath.c +++ b/util/VasEBoot-mkrelpath.c @@ -1,29 +1,29 @@ -/* grub-mkrelpath.c - make a system path relative to its root */ +/* VasEBoot-mkrelpath.c - make a system path relative to its root */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include #include -#include -#include -#include +#include +#include +#include #define _GNU_SOURCE 1 #pragma GCC diagnostic ignored "-Wmissing-prototypes" @@ -76,7 +76,7 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp argp = { options, argp_parser, N_("PATH"), - N_("Transform a system filename into GRUB one."), + N_("Transform a system filename into VasEBoot one."), NULL, NULL, NULL }; @@ -86,7 +86,7 @@ main (int argc, char *argv[]) char *relpath; struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); memset (&arguments, 0, sizeof (struct arguments)); @@ -97,7 +97,7 @@ main (int argc, char *argv[]) exit(1); } - relpath = grub_make_system_path_relative_to_its_root (arguments.pathname); + relpath = VasEBoot_make_system_path_relative_to_its_root (arguments.pathname); printf ("%s\n", relpath); free (relpath); diff --git a/util/VasEBoot-mkrescue.c b/util/VasEBoot-mkrescue.c index 238d4840e..26cd7fec9 100644 --- a/util/VasEBoot-mkrescue.c +++ b/util/VasEBoot-mkrescue.c @@ -1,30 +1,30 @@ /* - * Make GRUB rescue image + * Make VasEBoot rescue image * - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wmissing-declarations" #include @@ -37,7 +37,7 @@ #include #include -static char *source_dirs[GRUB_INSTALL_PLATFORM_MAX]; +static char *source_dirs[VasEBoot_INSTALL_PLATFORM_MAX]; static char *rom_directory; static char *label_font; static char *label_color; @@ -46,7 +46,7 @@ static char *product_name; static char *product_version; static char *output_image; static char *xorriso; -static char *boot_grub; +static char *boot_VasEBoot; static int xorriso_argc; static int xorriso_arg_alloc; static char **xorriso_argv; @@ -69,7 +69,7 @@ xorriso_push (const char *val) static void xorriso_link (const char *from, const char *to) { - char *tof = grub_util_path_concat (2, iso9660_dir, to); + char *tof = VasEBoot_util_path_concat (2, iso9660_dir, to); char *val = xasprintf ("%s=%s", from, tof); xorriso_push (val); free (val); @@ -93,7 +93,7 @@ enum }; static struct argp_option options[] = { - GRUB_INSTALL_OPTIONS, + VasEBoot_INSTALL_OPTIONS, {"output", 'o', N_("FILE"), 0, N_("save output in FILE [required]"), 2}, {"rom-directory", OPTION_ROM_DIRECTORY, N_("DIR"), @@ -101,8 +101,8 @@ static struct argp_option options[] = { {"xorriso", OPTION_XORRISO, N_("FILE"), /* TRANSLATORS: xorriso is a program for creating ISOs and burning CDs. */ 0, N_("use FILE as xorriso [optional]"), 2}, - {"grub-glue-efi", OPTION_GLUE_EFI, N_("FILE"), OPTION_HIDDEN, 0, 2}, - {"grub-render-label", OPTION_RENDER_LABEL, N_("FILE"), OPTION_HIDDEN, 0, 2}, + {"VasEBoot-glue-efi", OPTION_GLUE_EFI, N_("FILE"), OPTION_HIDDEN, 0, 2}, + {"VasEBoot-render-label", OPTION_RENDER_LABEL, N_("FILE"), OPTION_HIDDEN, 0, 2}, {"label-font", OPTION_LABEL_FONT, N_("FILE"), 0, N_("use FILE as font for label"), 2}, {"label-color", OPTION_LABEL_COLOR, N_("COLOR"), 0, N_("use COLOR for label"), 2}, {"label-bgcolor", OPTION_LABEL_BGCOLOR, N_("COLOR"), 0, N_("use COLOR for label background"), 2}, @@ -122,7 +122,7 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) { case ARGP_KEY_HELP_PRE_DOC: /* TRANSLATORS: it generates one single image which is bootable through any method. */ - return strdup (_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image.")); + return strdup (_("Make VasEBoot CD-ROM, disk, pendrive and floppy bootable image.")); case ARGP_KEY_HELP_POST_DOC: { char *p1, *out; @@ -137,7 +137,7 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) return out; } default: - return grub_install_help_filter (key, text, input); + return VasEBoot_install_help_filter (key, text, input); } } @@ -153,7 +153,7 @@ enum { static error_t argp_parser (int key, char *arg, struct argp_state *state) { - if (grub_install_parse (key, arg)) + if (VasEBoot_install_parse (key, arg)) return 0; switch (key) { @@ -169,10 +169,10 @@ argp_parser (int key, char *arg, struct argp_state *state) /* FIXME: # Intentionally undocumented - --grub-mkimage-extra) + --VasEBoot-mkimage-extra) mkimage_extra_arg="$mkimage_extra_arg `argument $option "$@"`"; shift ;; - --grub-mkimage-extra=*) - mkimage_extra_arg="$mkimage_extra_arg `echo "$option" | sed 's/--grub-mkimage-extra=//'`" ;; + --VasEBoot-mkimage-extra=*) + mkimage_extra_arg="$mkimage_extra_arg `echo "$option" | sed 's/--VasEBoot-mkimage-extra=//'`" ;; */ case OPTION_SPARC_BOOT: system_area = SYS_AREA_SPARC; @@ -226,9 +226,9 @@ static void write_part (FILE *f, const char *srcdir) { FILE *in; - char *inname = grub_util_path_concat (2, srcdir, "partmap.lst"); + char *inname = VasEBoot_util_path_concat (2, srcdir, "partmap.lst"); char buf[260]; - in = grub_util_fopen (inname, "rb"); + in = VasEBoot_util_fopen (inname, "rb"); if (!in) return; while (fgets (buf, 256, in)) @@ -244,7 +244,7 @@ write_part (FILE *f, const char *srcdir) } static void -make_image_abs (enum grub_install_plat plat, +make_image_abs (enum VasEBoot_install_plat plat, const char *mkimage_target, const char *output) { @@ -254,40 +254,40 @@ make_image_abs (enum grub_install_plat plat, if (!source_dirs[plat]) return; - grub_util_info (N_("enabling %s support ..."), + VasEBoot_util_info (N_("enabling %s support ..."), mkimage_target); - load_cfg = grub_util_make_temporary_file (); + load_cfg = VasEBoot_util_make_temporary_file (); - load_cfg_f = grub_util_fopen (load_cfg, "wb"); + load_cfg_f = VasEBoot_util_fopen (load_cfg, "wb"); fprintf (load_cfg_f, "search --fs-uuid --set=root %s\n", iso_uuid); - fprintf (load_cfg_f, "set prefix=(${root})/boot/grub\n"); + fprintf (load_cfg_f, "set prefix=(${root})/boot/VasEBoot\n"); write_part (load_cfg_f, source_dirs[plat]); fclose (load_cfg_f); - grub_install_push_module ("search"); - grub_install_push_module ("iso9660"); - grub_install_make_image_wrap (source_dirs[plat], "/boot/grub", output, + VasEBoot_install_push_module ("search"); + VasEBoot_install_push_module ("iso9660"); + VasEBoot_install_make_image_wrap (source_dirs[plat], "/boot/VasEBoot", output, 0, load_cfg, mkimage_target, 0); - grub_install_pop_module (); - grub_install_pop_module (); - grub_util_unlink (load_cfg); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); + VasEBoot_util_unlink (load_cfg); } static void -make_image (enum grub_install_plat plat, +make_image (enum VasEBoot_install_plat plat, const char *mkimage_target, const char *output_sub) { - char *out = grub_util_path_concat (2, boot_grub, output_sub); + char *out = VasEBoot_util_path_concat (2, boot_VasEBoot, output_sub); make_image_abs (plat, mkimage_target, out); free (out); } static void -make_image_fwdisk_abs (enum grub_install_plat plat, +make_image_fwdisk_abs (enum VasEBoot_install_plat plat, const char *mkimage_target, const char *output) { @@ -297,20 +297,20 @@ make_image_fwdisk_abs (enum grub_install_plat plat, if (!source_dirs[plat]) return; - grub_util_info (N_("enabling %s support ..."), + VasEBoot_util_info (N_("enabling %s support ..."), mkimage_target); - load_cfg = grub_util_make_temporary_file (); + load_cfg = VasEBoot_util_make_temporary_file (); - load_cfg_f = grub_util_fopen (load_cfg, "wb"); + load_cfg_f = VasEBoot_util_fopen (load_cfg, "wb"); write_part (load_cfg_f, source_dirs[plat]); fclose (load_cfg_f); - grub_install_push_module ("iso9660"); - grub_install_make_image_wrap (source_dirs[plat], "()/boot/grub", output, + VasEBoot_install_push_module ("iso9660"); + VasEBoot_install_make_image_wrap (source_dirs[plat], "()/boot/VasEBoot", output, 0, load_cfg, mkimage_target, 0); - grub_install_pop_module (); - grub_util_unlink (load_cfg); + VasEBoot_install_pop_module (); + VasEBoot_util_unlink (load_cfg); } static int @@ -330,7 +330,7 @@ check_xorriso (const char *val) argv[3] = "-help"; argv[4] = NULL; - pid = grub_util_exec_pipe_stderr (argv, &fd); + pid = VasEBoot_util_exec_pipe_stderr (argv, &fd); if (!pid) return 0; @@ -342,7 +342,7 @@ check_xorriso (const char *val) while (getline (&buf, &len, mdadm) > 0) { - if (grub_strstr (buf, val)) + if (VasEBoot_strstr (buf, val)) ret = 1; } @@ -353,11 +353,11 @@ check_xorriso (const char *val) } static void -make_image_fwdisk (enum grub_install_plat plat, +make_image_fwdisk (enum VasEBoot_install_plat plat, const char *mkimage_target, const char *output_sub) { - char *out = grub_util_path_concat (2, boot_grub, output_sub); + char *out = VasEBoot_util_path_concat (2, boot_VasEBoot, output_sub); make_image_fwdisk_abs (plat, mkimage_target, out); free (out); } @@ -427,15 +427,15 @@ main (int argc, char *argv[]) int xorriso_tail_argc; char **xorriso_tail_argv; - grub_util_host_init (&argc, &argv); - grub_util_disable_fd_syncs (); + VasEBoot_util_host_init (&argc, &argv); + VasEBoot_util_disable_fd_syncs (); - pkgdatadir = grub_util_get_pkgdatadir (); + pkgdatadir = VasEBoot_util_get_pkgdatadir (); product_name = xstrdup (PACKAGE_NAME); product_version = xstrdup (PACKAGE_VERSION); xorriso = xstrdup ("xorriso"); - label_font = grub_util_path_concat (2, pkgdatadir, "unicode.pf2"); + label_font = VasEBoot_util_path_concat (2, pkgdatadir, "unicode.pf2"); argp_argv = xmalloc (sizeof (argp_argv[0]) * argc); xorriso_tail_argv = xmalloc (sizeof (argp_argv[0]) * argc); @@ -476,65 +476,65 @@ main (int argc, char *argv[]) argp_parse (&argp, argp_argc, argp_argv, 0, 0, 0); if (!output_image) - grub_util_error ("%s", _("output file must be specified")); + VasEBoot_util_error ("%s", _("output file must be specified")); - grub_init_all (); - grub_hostfs_init (); - grub_host_init (); + VasEBoot_init_all (); + VasEBoot_hostfs_init (); + VasEBoot_host_init (); xorriso_push (xorriso); xorriso_push ("-as"); xorriso_push ("mkisofs"); xorriso_push ("-graft-points"); - iso9660_dir = grub_util_make_temporary_dir (); - grub_util_info ("temporary iso9660 dir is `%s'", iso9660_dir); - boot_grub = grub_util_path_concat (3, iso9660_dir, "boot", "grub"); - grub_install_mkdir_p (boot_grub); - romdir = grub_util_path_concat (2, boot_grub, "roms"); - grub_util_mkdir (romdir); + iso9660_dir = VasEBoot_util_make_temporary_dir (); + VasEBoot_util_info ("temporary iso9660 dir is `%s'", iso9660_dir); + boot_VasEBoot = VasEBoot_util_path_concat (3, iso9660_dir, "boot", "VasEBoot"); + VasEBoot_install_mkdir_p (boot_VasEBoot); + romdir = VasEBoot_util_path_concat (2, boot_VasEBoot, "roms"); + VasEBoot_util_mkdir (romdir); - if (!grub_install_source_directory) + if (!VasEBoot_install_source_directory) { - const char *pkglibdir = grub_util_get_pkglibdir (); - enum grub_install_plat plat; + const char *pkglibdir = VasEBoot_util_get_pkglibdir (); + enum VasEBoot_install_plat plat; - for (plat = 0; plat < GRUB_INSTALL_PLATFORM_MAX; plat++) + for (plat = 0; plat < VasEBoot_INSTALL_PLATFORM_MAX; plat++) { - char *platdir = grub_util_path_concat (2, pkglibdir, - grub_install_get_platform_name (plat)); + char *platdir = VasEBoot_util_path_concat (2, pkglibdir, + VasEBoot_install_get_platform_name (plat)); - if (!grub_util_is_directory (platdir)) + if (!VasEBoot_util_is_directory (platdir)) { free (platdir); continue; } source_dirs[plat] = platdir; - grub_install_copy_files (platdir, - boot_grub, plat); + VasEBoot_install_copy_files (platdir, + boot_VasEBoot, plat); } } else { - enum grub_install_plat plat; - plat = grub_install_get_target (grub_install_source_directory); - grub_install_copy_files (grub_install_source_directory, - boot_grub, plat); - source_dirs[plat] = xstrdup (grub_install_source_directory); + enum VasEBoot_install_plat plat; + plat = VasEBoot_install_get_target (VasEBoot_install_source_directory); + VasEBoot_install_copy_files (VasEBoot_install_source_directory, + boot_VasEBoot, plat); + source_dirs[plat] = xstrdup (VasEBoot_install_source_directory); } - if (system_area == SYS_AREA_AUTO || grub_install_source_directory) + if (system_area == SYS_AREA_AUTO || VasEBoot_install_source_directory) { - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC] - || source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275] - || source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_IA64_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_ARM_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_ARM64_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC] + || source_dirs[VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275] + || source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_IA64_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_ARM_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_ARM64_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI]) system_area = SYS_AREA_COMMON; - else if (source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275]) + else if (source_dirs[VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275]) system_area = SYS_AREA_SPARC; - else if (source_dirs[GRUB_INSTALL_PLATFORM_MIPS_ARC]) + else if (source_dirs[VasEBoot_INSTALL_PLATFORM_MIPS_ARC]) system_area = SYS_AREA_ARCS; } @@ -545,7 +545,7 @@ main (int argc, char *argv[]) tim = time (NULL); tmm = gmtime (&tim); iso_uuid = xmalloc (55); - grub_snprintf (iso_uuid, 50, + VasEBoot_snprintf (iso_uuid, 50, "%04d-%02d-%02d-%02d-%02d-%02d-00", tmm->tm_year + 1900, tmm->tm_mon + 1, @@ -558,7 +558,7 @@ main (int argc, char *argv[]) char *uuid_out = xmalloc (strlen (iso_uuid) + 1 + 40); char *optr; const char *iptr; - optr = grub_stpcpy (uuid_out, "--modification-date="); + optr = VasEBoot_stpcpy (uuid_out, "--modification-date="); for (iptr = iso_uuid; *iptr; iptr++) if (*iptr != '-') *optr++ = *iptr; @@ -568,39 +568,39 @@ main (int argc, char *argv[]) } /* build BIOS core.img. */ - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC]) { char *load_cfg; FILE *load_cfg_f; - char *output = grub_util_path_concat (3, boot_grub, "i386-pc", "eltorito.img"); - load_cfg = grub_util_make_temporary_file (); + char *output = VasEBoot_util_path_concat (3, boot_VasEBoot, "i386-pc", "eltorito.img"); + load_cfg = VasEBoot_util_make_temporary_file (); - grub_util_info (N_("enabling %s support ..."), "BIOS"); - load_cfg_f = grub_util_fopen (load_cfg, "wb"); - write_part (load_cfg_f, source_dirs[GRUB_INSTALL_PLATFORM_I386_PC]); + VasEBoot_util_info (N_("enabling %s support ..."), "BIOS"); + load_cfg_f = VasEBoot_util_fopen (load_cfg, "wb"); + write_part (load_cfg_f, source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC]); fclose (load_cfg_f); - grub_install_push_module ("biosdisk"); - grub_install_push_module ("iso9660"); - grub_install_make_image_wrap (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC], - "/boot/grub", output, + VasEBoot_install_push_module ("biosdisk"); + VasEBoot_install_push_module ("iso9660"); + VasEBoot_install_make_image_wrap (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC], + "/boot/VasEBoot", output, 0, load_cfg, "i386-pc-eltorito", 0); xorriso_push ("-b"); - xorriso_push ("boot/grub/i386-pc/eltorito.img"); + xorriso_push ("boot/VasEBoot/i386-pc/eltorito.img"); xorriso_push ("-no-emul-boot"); xorriso_push ("-boot-load-size"); xorriso_push ("4"); xorriso_push ("-boot-info-table"); if (system_area == SYS_AREA_COMMON) { - if (check_xorriso ("grub2-boot-info")) + if (check_xorriso ("VasEBoot2-boot-info")) { - char *boot_hybrid = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_I386_PC], + char *boot_hybrid = VasEBoot_util_path_concat (2, source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC], "boot_hybrid.img"); - xorriso_push ("--grub2-boot-info"); - xorriso_push ("--grub2-mbr"); + xorriso_push ("--VasEBoot2-boot-info"); + xorriso_push ("--VasEBoot2-mbr"); xorriso_push (boot_hybrid); } else @@ -608,36 +608,36 @@ main (int argc, char *argv[]) FILE *sa, *bi; size_t sz; char buf[512]; - char *bin = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_I386_PC], + char *bin = VasEBoot_util_path_concat (2, source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC], "boot.img"); - grub_util_warn ("%s", _("Your xorriso doesn't support `--grub2-boot-info'. Some features are disabled. Please use xorriso 1.2.9 or later.")); - sysarea_img = grub_util_make_temporary_file (); - sa = grub_util_fopen (sysarea_img, "wb"); + VasEBoot_util_warn ("%s", _("Your xorriso doesn't support `--VasEBoot2-boot-info'. Some features are disabled. Please use xorriso 1.2.9 or later.")); + sysarea_img = VasEBoot_util_make_temporary_file (); + sa = VasEBoot_util_fopen (sysarea_img, "wb"); if (!sa) - grub_util_error (_("cannot open `%s': %s"), sysarea_img, + VasEBoot_util_error (_("cannot open `%s': %s"), sysarea_img, strerror (errno)); - bi = grub_util_fopen (bin, "rb"); + bi = VasEBoot_util_fopen (bin, "rb"); if (!bi) - grub_util_error (_("cannot open `%s': %s"), bin, + VasEBoot_util_error (_("cannot open `%s': %s"), bin, strerror (errno)); if (fread (buf, 1, 512, bi) != 512) - grub_util_error (_("cannot read `%s': %s"), bin, + VasEBoot_util_error (_("cannot read `%s': %s"), bin, strerror (errno)); fclose (bi); fwrite (buf, 1, 512, sa); - grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC], - "/boot/grub", sa, sysarea_img, + VasEBoot_install_make_image_wrap_file (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_PC], + "/boot/VasEBoot", sa, sysarea_img, 0, load_cfg, "i386-pc", 0); sz = ftello (sa); fflush (sa); - grub_util_fd_sync (fileno (sa)); + VasEBoot_util_fd_sync (fileno (sa)); fclose (sa); if (sz > 32768) { - grub_util_warn ("%s", _("Your xorriso doesn't support `--grub2-boot-info'. Your core image is too big. Boot as disk is disabled. Please use xorriso 1.2.9 or later.")); + VasEBoot_util_warn ("%s", _("Your xorriso doesn't support `--VasEBoot2-boot-info'. Your core image is too big. Boot as disk is disabled. Please use xorriso 1.2.9 or later.")); } else { @@ -646,40 +646,40 @@ main (int argc, char *argv[]) } } } - grub_install_pop_module (); - grub_install_pop_module (); - grub_util_unlink (load_cfg); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); + VasEBoot_util_unlink (load_cfg); } /** build multiboot core.img */ - grub_install_push_module ("pata"); - grub_install_push_module ("ahci"); - grub_install_push_module ("at_keyboard"); - make_image (GRUB_INSTALL_PLATFORM_I386_MULTIBOOT, "i386-multiboot", "i386-multiboot/core.elf"); - grub_install_pop_module (); - grub_install_pop_module (); - grub_install_pop_module (); + VasEBoot_install_push_module ("pata"); + VasEBoot_install_push_module ("ahci"); + VasEBoot_install_push_module ("at_keyboard"); + make_image (VasEBoot_INSTALL_PLATFORM_I386_MULTIBOOT, "i386-multiboot", "i386-multiboot/core.elf"); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); - make_image_fwdisk (GRUB_INSTALL_PLATFORM_I386_IEEE1275, "i386-ieee1275", "ofwx86.elf"); + make_image_fwdisk (VasEBoot_INSTALL_PLATFORM_I386_IEEE1275, "i386-ieee1275", "ofwx86.elf"); char *core_services = NULL; - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275]) { char *mach_ker, *sv, *label, *label_text; FILE *f; - core_services = grub_util_path_concat (4, iso9660_dir, "System", "Library", "CoreServices"); - grub_install_mkdir_p (core_services); + core_services = VasEBoot_util_path_concat (4, iso9660_dir, "System", "Library", "CoreServices"); + VasEBoot_install_mkdir_p (core_services); - mach_ker = grub_util_path_concat (2, iso9660_dir, "mach_kernel"); - f = grub_util_fopen (mach_ker, "wb"); + mach_ker = VasEBoot_util_path_concat (2, iso9660_dir, "mach_kernel"); + f = VasEBoot_util_fopen (mach_ker, "wb"); fclose (f); free (mach_ker); - sv = grub_util_path_concat (2, core_services, "SystemVersion.plist"); - f = grub_util_fopen (sv, "wb"); + sv = VasEBoot_util_path_concat (2, core_services, "SystemVersion.plist"); + f = VasEBoot_util_fopen (sv, "wb"); fprintf (f, "\n" "\n" " ProductBuildVersion\n" @@ -692,13 +692,13 @@ main (int argc, char *argv[]) "\n", product_name, product_version); fclose (f); free (sv); - label = grub_util_path_concat (2, core_services, ".disk_label"); + label = VasEBoot_util_path_concat (2, core_services, ".disk_label"); char *label_string = xasprintf ("%s %s", product_name, product_version); - grub_util_render_label (label_font, label_bgcolor ? : "white", + VasEBoot_util_render_label (label_font, label_bgcolor ? : "white", label_color ? : "black", label_string, label); free (label); - label_text = grub_util_path_concat (2, core_services, ".disk_label.contentDetails"); - f = grub_util_fopen (label_text, "wb"); + label_text = VasEBoot_util_path_concat (2, core_services, ".disk_label.contentDetails"); + f = VasEBoot_util_fopen (label_text, "wb"); fprintf (f, "%s\n", label_string); fclose (f); free (label_string); @@ -713,8 +713,8 @@ main (int argc, char *argv[]) xorriso_push ("tbxj"); xorriso_push ("/System/Library/CoreServices/.disk_label"); - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI]) { xorriso_push ("-hfs-bless-by"); xorriso_push ("i"); @@ -723,109 +723,109 @@ main (int argc, char *argv[]) } } - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_IA64_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_ARM_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_ARM64_EFI]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_IA64_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_ARM_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_ARM64_EFI]) { - char *efidir = grub_util_make_temporary_dir (); - char *efidir_efi = grub_util_path_concat (2, efidir, "efi"); - char *efidir_efi_boot = grub_util_path_concat (3, efidir, "efi", "boot"); + char *efidir = VasEBoot_util_make_temporary_dir (); + char *efidir_efi = VasEBoot_util_path_concat (2, efidir, "efi"); + char *efidir_efi_boot = VasEBoot_util_path_concat (3, efidir, "efi", "boot"); char *imgname, *img32, *img64, *img_mac = NULL; char *efiimgfat; - grub_install_mkdir_p (efidir_efi_boot); + VasEBoot_install_mkdir_p (efidir_efi_boot); - grub_install_push_module ("part_gpt"); - grub_install_push_module ("part_msdos"); + VasEBoot_install_push_module ("part_gpt"); + VasEBoot_install_push_module ("part_msdos"); - imgname = grub_util_path_concat (2, efidir_efi_boot, "bootia64.efi"); - make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_IA64_EFI, "ia64-efi", imgname); + imgname = VasEBoot_util_path_concat (2, efidir_efi_boot, "bootia64.efi"); + make_image_fwdisk_abs (VasEBoot_INSTALL_PLATFORM_IA64_EFI, "ia64-efi", imgname); free (imgname); - grub_install_push_module ("part_apple"); - img64 = grub_util_path_concat (2, efidir_efi_boot, "bootx64.efi"); - make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_X86_64_EFI, "x86_64-efi", img64); - grub_install_pop_module (); + VasEBoot_install_push_module ("part_apple"); + img64 = VasEBoot_util_path_concat (2, efidir_efi_boot, "bootx64.efi"); + make_image_fwdisk_abs (VasEBoot_INSTALL_PLATFORM_X86_64_EFI, "x86_64-efi", img64); + VasEBoot_install_pop_module (); - grub_install_push_module ("part_apple"); - img32 = grub_util_path_concat (2, efidir_efi_boot, "bootia32.efi"); - make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_I386_EFI, "i386-efi", img32); - grub_install_pop_module (); + VasEBoot_install_push_module ("part_apple"); + img32 = VasEBoot_util_path_concat (2, efidir_efi_boot, "bootia32.efi"); + make_image_fwdisk_abs (VasEBoot_INSTALL_PLATFORM_I386_EFI, "i386-efi", img32); + VasEBoot_install_pop_module (); - imgname = grub_util_path_concat (2, efidir_efi_boot, "bootarm.efi"); - make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_ARM_EFI, "arm-efi", imgname); + imgname = VasEBoot_util_path_concat (2, efidir_efi_boot, "bootarm.efi"); + make_image_fwdisk_abs (VasEBoot_INSTALL_PLATFORM_ARM_EFI, "arm-efi", imgname); free (imgname); - imgname = grub_util_path_concat (2, efidir_efi_boot, "bootaa64.efi"); - make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_ARM64_EFI, "arm64-efi", + imgname = VasEBoot_util_path_concat (2, efidir_efi_boot, "bootaa64.efi"); + make_image_fwdisk_abs (VasEBoot_INSTALL_PLATFORM_ARM64_EFI, "arm64-efi", imgname); free (imgname); - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI]) { - imgname = grub_util_path_concat (2, efidir_efi_boot, "boot.efi"); + imgname = VasEBoot_util_path_concat (2, efidir_efi_boot, "boot.efi"); /* For old macs. Suggested by Peter Jones. */ - grub_install_copy_file (img32, imgname, 1); + VasEBoot_install_copy_file (img32, imgname, 1); } - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI] - || source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI]) - img_mac = grub_util_path_concat (2, core_services, "boot.efi"); + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI] + || source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI]) + img_mac = VasEBoot_util_path_concat (2, core_services, "boot.efi"); - if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI] - && source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI]) - grub_util_glue_efi (img32, img64, img_mac); - else if (source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI]) - grub_install_copy_file (img64, img_mac, 1); - else if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI]) - grub_install_copy_file (img32, img_mac, 1); + if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI] + && source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI]) + VasEBoot_util_glue_efi (img32, img64, img_mac); + else if (source_dirs[VasEBoot_INSTALL_PLATFORM_X86_64_EFI]) + VasEBoot_install_copy_file (img64, img_mac, 1); + else if (source_dirs[VasEBoot_INSTALL_PLATFORM_I386_EFI]) + VasEBoot_install_copy_file (img32, img_mac, 1); free (img_mac); free (img32); free (img64); free (efidir_efi_boot); - efiimgfat = grub_util_path_concat (2, iso9660_dir, "efi.img"); + efiimgfat = VasEBoot_util_path_concat (2, iso9660_dir, "efi.img"); int rv; - rv = grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i", + rv = VasEBoot_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i", efiimgfat, "::", NULL }); if (rv != 0) - grub_util_error ("`%s` invocation failed\n", "mformat"); - rv = grub_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL }); + VasEBoot_util_error ("`%s` invocation failed\n", "mformat"); + rv = VasEBoot_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL }); if (rv != 0) - grub_util_error ("`%s` invocation failed\n", "mformat"); + VasEBoot_util_error ("`%s` invocation failed\n", "mformat"); xorriso_push ("--efi-boot"); xorriso_push ("efi.img"); xorriso_push ("-efi-boot-part"); xorriso_push ("--efi-boot-image"); - grub_util_unlink_recursive (efidir); + VasEBoot_util_unlink_recursive (efidir); free (efiimgfat); free (efidir_efi); free (efidir); - grub_install_pop_module (); - grub_install_pop_module (); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); } - grub_install_push_module ("part_apple"); - make_image_fwdisk (GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275, "powerpc-ieee1275", "powerpc-ieee1275/core.elf"); - grub_install_pop_module (); + VasEBoot_install_push_module ("part_apple"); + make_image_fwdisk (VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275, "powerpc-ieee1275", "powerpc-ieee1275/core.elf"); + VasEBoot_install_pop_module (); - if (source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275]) { - char *grub_chrp = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275], - "grub.chrp"); - char *bisrc = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275], + char *VasEBoot_chrp = VasEBoot_util_path_concat (2, source_dirs[VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275], + "VasEBoot.chrp"); + char *bisrc = VasEBoot_util_path_concat (2, source_dirs[VasEBoot_INSTALL_PLATFORM_POWERPC_IEEE1275], "bootinfo.txt"); - char *bootx = grub_util_path_concat (2, core_services, "BootX"); - char *ppc_chrp = grub_util_path_concat (3, iso9660_dir, "ppc", "chrp"); - char *bitgt = grub_util_path_concat (3, iso9660_dir, "ppc", "bootinfo.txt"); - grub_install_copy_file (grub_chrp, bootx, 1); - grub_install_mkdir_p (ppc_chrp); - grub_install_copy_file (bisrc, bitgt, 1); - xorriso_link ("/System/Library/CoreServices/grub.elf", "/boot/grub/powerpc-ieee1275/core.elf"); - xorriso_link ("/boot/grub/powerpc.elf", "/boot/grub/powerpc-ieee1275/core.elf"); + char *bootx = VasEBoot_util_path_concat (2, core_services, "BootX"); + char *ppc_chrp = VasEBoot_util_path_concat (3, iso9660_dir, "ppc", "chrp"); + char *bitgt = VasEBoot_util_path_concat (3, iso9660_dir, "ppc", "bootinfo.txt"); + VasEBoot_install_copy_file (VasEBoot_chrp, bootx, 1); + VasEBoot_install_mkdir_p (ppc_chrp); + VasEBoot_install_copy_file (bisrc, bitgt, 1); + xorriso_link ("/System/Library/CoreServices/VasEBoot.elf", "/boot/VasEBoot/powerpc-ieee1275/core.elf"); + xorriso_link ("/boot/VasEBoot/powerpc.elf", "/boot/VasEBoot/powerpc-ieee1275/core.elf"); /* FIXME: add PreP */ if (system_area == SYS_AREA_COMMON) { @@ -841,30 +841,30 @@ main (int argc, char *argv[]) xorriso_push ("PPC"); } - make_image_fwdisk (GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275, + make_image_fwdisk (VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275, "sparc64-ieee1275-cdcore", "sparc64-ieee1275/core.img"); - if (source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275] + if (source_dirs[VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275] && system_area == SYS_AREA_SPARC) { char *cdboot; FILE *in, *out; char buf[512]; - sysarea_img = grub_util_make_temporary_file (); - cdboot = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275], + sysarea_img = VasEBoot_util_make_temporary_file (); + cdboot = VasEBoot_util_path_concat (2, source_dirs[VasEBoot_INSTALL_PLATFORM_SPARC64_IEEE1275], "cdboot.img"); - in = grub_util_fopen (cdboot, "rb"); + in = VasEBoot_util_fopen (cdboot, "rb"); if (!in) - grub_util_error (_("cannot open `%s': %s"), cdboot, + VasEBoot_util_error (_("cannot open `%s': %s"), cdboot, strerror (errno)); - out = grub_util_fopen (sysarea_img, "wb"); + out = VasEBoot_util_fopen (sysarea_img, "wb"); if (!out) - grub_util_error (_("cannot open `%s': %s"), sysarea_img, + VasEBoot_util_error (_("cannot open `%s': %s"), sysarea_img, strerror (errno)); memset (buf, 0, 512); fwrite (buf, 1, 512, out); if (fread (buf, 1, 512, in) != 512) - grub_util_error (_("cannot read `%s': %s"), cdboot, + VasEBoot_util_error (_("cannot read `%s': %s"), cdboot, strerror (errno)); fwrite (buf, 1, 512, out); fclose (in); @@ -873,73 +873,73 @@ main (int argc, char *argv[]) xorriso_push (sysarea_img); xorriso_push ("-B"); xorriso_push (","); - xorriso_push ("--grub2-sparc-core"); - xorriso_push ("/boot/grub/sparc64-ieee1275/core.img"); + xorriso_push ("--VasEBoot2-sparc-core"); + xorriso_push ("/boot/VasEBoot/sparc64-ieee1275/core.img"); } - make_image_fwdisk (GRUB_INSTALL_PLATFORM_MIPS_ARC, "mips-arc", "mips-arc/core.img"); + make_image_fwdisk (VasEBoot_INSTALL_PLATFORM_MIPS_ARC, "mips-arc", "mips-arc/core.img"); - if (source_dirs[GRUB_INSTALL_PLATFORM_MIPS_ARC]) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_MIPS_ARC]) { - xorriso_link ("/boot/grub/mips-arc/grub", "/boot/grub/mips-arc/core.img"); - xorriso_link ("/boot/grub/mips-arc/sashARCS", "/boot/grub/mips-arc/core.img"); - xorriso_link ("/boot/grub/mips-arc/sash", "/boot/grub/mips-arc/core.img"); + xorriso_link ("/boot/VasEBoot/mips-arc/VasEBoot", "/boot/VasEBoot/mips-arc/core.img"); + xorriso_link ("/boot/VasEBoot/mips-arc/sashARCS", "/boot/VasEBoot/mips-arc/core.img"); + xorriso_link ("/boot/VasEBoot/mips-arc/sash", "/boot/VasEBoot/mips-arc/core.img"); } - if (source_dirs[GRUB_INSTALL_PLATFORM_MIPS_ARC] && system_area == SYS_AREA_ARCS) + if (source_dirs[VasEBoot_INSTALL_PLATFORM_MIPS_ARC] && system_area == SYS_AREA_ARCS) { xorriso_push ("-mips-boot"); - xorriso_push ("/boot/grub/mips-arc/sashARCS"); + xorriso_push ("/boot/VasEBoot/mips-arc/sashARCS"); xorriso_push ("-mips-boot"); - xorriso_push ("/boot/grub/mips-arc/sash"); + xorriso_push ("/boot/VasEBoot/mips-arc/sash"); xorriso_push ("-mips-boot"); - xorriso_push ("/boot/grub/mips-arc/grub"); + xorriso_push ("/boot/VasEBoot/mips-arc/VasEBoot"); } - make_image_fwdisk (GRUB_INSTALL_PLATFORM_MIPSEL_ARC, "mipsel-arc", "arc.exe"); + make_image_fwdisk (VasEBoot_INSTALL_PLATFORM_MIPSEL_ARC, "mipsel-arc", "arc.exe"); - grub_install_push_module ("pata"); - make_image (GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, "mipsel-qemu_mips-elf", "roms/mipsel-qemu_mips.elf"); + VasEBoot_install_push_module ("pata"); + make_image (VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, "mipsel-qemu_mips-elf", "roms/mipsel-qemu_mips.elf"); - make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-loongson-elf", "loongson.elf"); + make_image (VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-loongson-elf", "loongson.elf"); - make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-yeeloong-flash", "mipsel-yeeloong.bin"); - make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-fuloong2f-flash", "mipsel-fuloong2f.bin"); + make_image (VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-yeeloong-flash", "mipsel-yeeloong.bin"); + make_image (VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-fuloong2f-flash", "mipsel-fuloong2f.bin"); - make_image (GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS, "mips-qemu_mips-elf", "roms/mips-qemu_mips.elf"); + make_image (VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS, "mips-qemu_mips-elf", "roms/mips-qemu_mips.elf"); - grub_install_push_module ("at_keyboard"); + VasEBoot_install_push_module ("at_keyboard"); - make_image (GRUB_INSTALL_PLATFORM_I386_QEMU, "i386-qemu", "roms/qemu.img"); + make_image (VasEBoot_INSTALL_PLATFORM_I386_QEMU, "i386-qemu", "roms/qemu.img"); - grub_install_push_module ("ahci"); + VasEBoot_install_push_module ("ahci"); - make_image (GRUB_INSTALL_PLATFORM_I386_COREBOOT, "i386-coreboot", "roms/coreboot.elf"); - grub_install_pop_module (); - grub_install_pop_module (); - grub_install_pop_module (); + make_image (VasEBoot_INSTALL_PLATFORM_I386_COREBOOT, "i386-coreboot", "roms/coreboot.elf"); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); + VasEBoot_install_pop_module (); if (rom_directory) { const struct { - enum grub_install_plat plat; + enum VasEBoot_install_plat plat; const char *from, *to; } roms[] = { - {GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, "roms/mipsel-qemu_mips.elf", "mipsel-qemu_mips.elf"}, - {GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "loongson.elf", "mipsel-loongson.elf"}, - {GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "roms/mipsel-yeeloong.bin", "mipsel-yeeloong.bin"}, - {GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "roms/mipsel-fulong.bin", "mipsel-fulong.bin"}, - {GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS, "roms/mips-qemu_mips.elf", "mips-qemu_mips.elf"}, - {GRUB_INSTALL_PLATFORM_I386_QEMU, "roms/qemu.img", "qemu.img"}, - {GRUB_INSTALL_PLATFORM_I386_COREBOOT, "roms/coreboot.elf", "coreboot.elf"}, + {VasEBoot_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, "roms/mipsel-qemu_mips.elf", "mipsel-qemu_mips.elf"}, + {VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, "loongson.elf", "mipsel-loongson.elf"}, + {VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, "roms/mipsel-yeeloong.bin", "mipsel-yeeloong.bin"}, + {VasEBoot_INSTALL_PLATFORM_MIPSEL_LOONGSON, "roms/mipsel-fulong.bin", "mipsel-fulong.bin"}, + {VasEBoot_INSTALL_PLATFORM_MIPS_QEMU_MIPS, "roms/mips-qemu_mips.elf", "mips-qemu_mips.elf"}, + {VasEBoot_INSTALL_PLATFORM_I386_QEMU, "roms/qemu.img", "qemu.img"}, + {VasEBoot_INSTALL_PLATFORM_I386_COREBOOT, "roms/coreboot.elf", "coreboot.elf"}, }; - grub_size_t i; + VasEBoot_size_t i; for (i = 0; i < ARRAY_SIZE (roms); i++) { - char *from = grub_util_path_concat (2, boot_grub, roms[i].from); - char *to = grub_util_path_concat (2, rom_directory, roms[i].to); - grub_install_copy_file (from, to, 0); + char *from = VasEBoot_util_path_concat (2, boot_VasEBoot, roms[i].from); + char *to = VasEBoot_util_path_concat (2, rom_directory, roms[i].to); + VasEBoot_install_copy_file (from, to, 0); } } @@ -960,12 +960,12 @@ main (int argc, char *argv[]) xorriso_argv[xorriso_argc] = NULL; - grub_util_exec ((const char *const *)xorriso_argv); + VasEBoot_util_exec ((const char *const *)xorriso_argv); - grub_util_unlink_recursive (iso9660_dir); + VasEBoot_util_unlink_recursive (iso9660_dir); if (sysarea_img) - grub_util_unlink (sysarea_img); + VasEBoot_util_unlink (sysarea_img); free (core_services); free (romdir); diff --git a/util/VasEBoot-mkstandalone.c b/util/VasEBoot-mkstandalone.c index 4907d44c0..f9be53255 100644 --- a/util/VasEBoot-mkstandalone.c +++ b/util/VasEBoot-mkstandalone.c @@ -2,25 +2,25 @@ /* * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include +#include +#include +#include #include @@ -33,7 +33,7 @@ static char *output_image; static char **files; static int nfiles; -const struct grub_install_image_target_desc *format; +const struct VasEBoot_install_image_target_desc *format; static FILE *memdisk; enum @@ -43,7 +43,7 @@ enum }; static struct argp_option options[] = { - GRUB_INSTALL_OPTIONS, + VasEBoot_INSTALL_OPTIONS, {"output", 'o', N_("FILE"), 0, N_("save output in FILE [required]"), 2}, {"format", 'O', N_("FILE"), 0, 0, 2}, @@ -58,14 +58,14 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) { case 'O': { - char *formats = grub_install_get_image_targets_string (), *ret; + char *formats = VasEBoot_install_get_image_targets_string (), *ret; ret = xasprintf ("%s\n%s %s", _("generate an image in FORMAT"), _("available formats:"), formats); free (formats); return ret; } default: - return grub_install_help_filter (key, text, input); + return VasEBoot_install_help_filter (key, text, input); } } @@ -73,9 +73,9 @@ static error_t argp_parser (int key, char *arg, struct argp_state *state) { if (key == 'C') - key = GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS; + key = VasEBoot_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS; - if (grub_install_parse (key, arg)) + if (VasEBoot_install_parse (key, arg)) return 0; switch (key) @@ -90,7 +90,7 @@ argp_parser (int key, char *arg, struct argp_state *state) case 'O': { - format = grub_install_get_image_target (arg); + format = VasEBoot_install_get_image_target (arg); if (!format) { printf (_("unknown target format %s\n"), arg); @@ -112,7 +112,7 @@ argp_parser (int key, char *arg, struct argp_state *state) struct argp argp = { options, argp_parser, N_("[OPTION] SOURCE..."), - N_("Generate a standalone image (containing all modules) in the selected format")"\v"N_("Graft point syntax (E.g. /boot/grub/grub.cfg=./grub.cfg) is accepted"), + N_("Generate a standalone image (containing all modules) in the selected format")"\v"N_("Graft point syntax (E.g. /boot/VasEBoot/VasEBoot.cfg=./VasEBoot.cfg) is accepted"), NULL, help_filter, NULL }; @@ -137,7 +137,7 @@ struct head char devminor[8]; char prefix[155]; char pad[12]; -} GRUB_PACKED; +} VasEBoot_PACKED; static void write_zeros (unsigned rsz) @@ -155,7 +155,7 @@ write_pad (unsigned sz) } static void -set_tar_value (char *field, grub_uint32_t val, +set_tar_value (char *field, VasEBoot_uint32_t val, unsigned len) { unsigned i; @@ -182,17 +182,17 @@ add_tar_file (const char *from, const char *iptr; char *optr; struct head hd; - grub_util_fd_t in; + VasEBoot_util_fd_t in; ssize_t r; - grub_uint32_t mtime = 0; - grub_uint32_t size; + VasEBoot_uint32_t mtime = 0; + VasEBoot_uint32_t size; COMPILE_TIME_ASSERT (sizeof (hd) == 512); - if (grub_util_is_special_file (from)) + if (VasEBoot_util_is_special_file (from)) return; - mtime = grub_util_get_mtime (from); + mtime = VasEBoot_util_get_mtime (from); optr = tcn = xmalloc (strlen (to) + 1); for (iptr = to; *iptr == '/'; iptr++); @@ -201,26 +201,26 @@ add_tar_file (const char *from, *optr++ = *iptr; *optr = '\0'; - if (grub_util_is_directory (from)) + if (VasEBoot_util_is_directory (from)) { - grub_util_fd_dir_t d; - grub_util_fd_dirent_t de; + VasEBoot_util_fd_dir_t d; + VasEBoot_util_fd_dirent_t de; - d = grub_util_fd_opendir (from); + d = VasEBoot_util_fd_opendir (from); - while ((de = grub_util_fd_readdir (d))) + while ((de = VasEBoot_util_fd_readdir (d))) { char *fp, *tfp; if (strcmp (de->d_name, ".") == 0) continue; if (strcmp (de->d_name, "..") == 0) continue; - fp = grub_util_path_concat (2, from, de->d_name); + fp = VasEBoot_util_path_concat (2, from, de->d_name); tfp = xasprintf ("%s/%s", to, de->d_name); add_tar_file (fp, tfp); free (fp); } - grub_util_fd_closedir (d); + VasEBoot_util_fd_closedir (d); free (tcn); return; } @@ -237,8 +237,8 @@ add_tar_file (const char *from, set_tar_value (hd.mtime, mtime, 12); hd.typeflag = 'L'; memcpy (hd.magic, MAGIC, sizeof (hd.magic)); - memcpy (hd.uname, "grub", 4); - memcpy (hd.gname, "grub", 4); + memcpy (hd.uname, "VasEBoot", 4); + memcpy (hd.gname, "VasEBoot", 4); compute_checksum (&hd); @@ -248,14 +248,14 @@ add_tar_file (const char *from, write_pad (optr - tcn); } - in = grub_util_fd_open (from, GRUB_UTIL_FD_O_RDONLY); - if (!GRUB_UTIL_FD_IS_VALID (in)) - grub_util_error (_("cannot open `%s': %s"), from, grub_util_fd_strerror ()); + in = VasEBoot_util_fd_open (from, VasEBoot_UTIL_FD_O_RDONLY); + if (!VasEBoot_UTIL_FD_IS_VALID (in)) + VasEBoot_util_error (_("cannot open `%s': %s"), from, VasEBoot_util_fd_strerror ()); - if (!grub_install_copy_buffer) - grub_install_copy_buffer = xmalloc (GRUB_INSTALL_COPY_BUFFER_SIZE); + if (!VasEBoot_install_copy_buffer) + VasEBoot_install_copy_buffer = xmalloc (VasEBoot_INSTALL_COPY_BUFFER_SIZE); - size = grub_util_get_fd_size (in, from, NULL); + size = VasEBoot_util_get_fd_size (in, from, NULL); memset (&hd, 0, sizeof (hd)); memcpy (hd.name, tcn, optr - tcn < 99 ? optr - tcn : 99); @@ -267,8 +267,8 @@ add_tar_file (const char *from, set_tar_value (hd.mtime, mtime, 12); hd.typeflag = '0'; memcpy (hd.magic, MAGIC, sizeof (hd.magic)); - memcpy (hd.uname, "grub", 4); - memcpy (hd.gname, "grub", 4); + memcpy (hd.uname, "VasEBoot", 4); + memcpy (hd.gname, "VasEBoot", 4); compute_checksum (&hd); @@ -276,12 +276,12 @@ add_tar_file (const char *from, while (1) { - r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE); + r = VasEBoot_util_fd_read (in, VasEBoot_install_copy_buffer, VasEBoot_INSTALL_COPY_BUFFER_SIZE); if (r <= 0) break; - fwrite (grub_install_copy_buffer, 1, r, memdisk); + fwrite (VasEBoot_install_copy_buffer, 1, r, memdisk); } - grub_util_fd_close (in); + VasEBoot_util_fd_close (in); write_pad (size); free (tcn); @@ -293,39 +293,39 @@ main (int argc, char *argv[]) const char *pkglibdir; int i; - grub_util_host_init (&argc, &argv); - grub_util_disable_fd_syncs (); + VasEBoot_util_host_init (&argc, &argv); + VasEBoot_util_disable_fd_syncs (); files = xmalloc ((argc + 1) * sizeof (files[0])); argp_parse (&argp, argc, argv, 0, 0, 0); - pkglibdir = grub_util_get_pkglibdir (); + pkglibdir = VasEBoot_util_get_pkglibdir (); if (!output_image) - grub_util_error ("%s", _("output file must be specified")); + VasEBoot_util_error ("%s", _("output file must be specified")); if (!format) - grub_util_error ("%s", _("Target format not specified (use the -O option).")); + VasEBoot_util_error ("%s", _("Target format not specified (use the -O option).")); - if (!grub_install_source_directory) - grub_install_source_directory = grub_util_path_concat (2, pkglibdir, grub_util_get_target_dirname (format)); + if (!VasEBoot_install_source_directory) + VasEBoot_install_source_directory = VasEBoot_util_path_concat (2, pkglibdir, VasEBoot_util_get_target_dirname (format)); - enum grub_install_plat plat = grub_install_get_target (grub_install_source_directory); + enum VasEBoot_install_plat plat = VasEBoot_install_get_target (VasEBoot_install_source_directory); - char *memdisk_dir = grub_util_make_temporary_dir (); - char *boot_grub = grub_util_path_concat (3, memdisk_dir, "boot", "grub"); - grub_install_copy_files (grub_install_source_directory, - boot_grub, plat); + char *memdisk_dir = VasEBoot_util_make_temporary_dir (); + char *boot_VasEBoot = VasEBoot_util_path_concat (3, memdisk_dir, "boot", "VasEBoot"); + VasEBoot_install_copy_files (VasEBoot_install_source_directory, + boot_VasEBoot, plat); - char *memdisk_img = grub_util_make_temporary_file (); + char *memdisk_img = VasEBoot_util_make_temporary_file (); - memdisk = grub_util_fopen (memdisk_img, "wb"); + memdisk = VasEBoot_util_fopen (memdisk_img, "wb"); add_tar_file (memdisk_dir, ""); for (i = 0; i < nfiles; i++) { - char *eq = grub_strchr (files[i], '='); + char *eq = VasEBoot_strchr (files[i], '='); char *from, *to; if (!eq) { @@ -346,16 +346,16 @@ main (int argc, char *argv[]) fclose (memdisk); - grub_util_unlink_recursive (memdisk_dir); + VasEBoot_util_unlink_recursive (memdisk_dir); - grub_install_push_module ("memdisk"); - grub_install_push_module ("tar"); + VasEBoot_install_push_module ("memdisk"); + VasEBoot_install_push_module ("tar"); - grub_install_make_image_wrap (grub_install_source_directory, - "(memdisk)/boot/grub", output_image, + VasEBoot_install_make_image_wrap (VasEBoot_install_source_directory, + "(memdisk)/boot/VasEBoot", output_image, memdisk_img, NULL, - grub_util_get_target_name (format), 0); + VasEBoot_util_get_target_name (format), 0); - grub_util_unlink (memdisk_img); + VasEBoot_util_unlink (memdisk_img); return 0; } diff --git a/util/VasEBoot-module-verifier.c b/util/VasEBoot-module-verifier.c index a79271f66..b14b23356 100644 --- a/util/VasEBoot-module-verifier.c +++ b/util/VasEBoot-module-verifier.c @@ -1,18 +1,18 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -struct grub_module_verifier_arch archs[] = { - { "i386", 4, 0, EM_386, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ +struct VasEBoot_module_verifier_arch archs[] = { + { "i386", 4, 0, EM_386, VasEBoot_MODULE_VERIFY_SUPPORTS_REL, (int[]){ R_386_32, R_386_PC32, -1 } }, - { "x86_64", 8, 0, EM_X86_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + { "x86_64", 8, 0, EM_X86_64, VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_X86_64_64, R_X86_64_PC64, /* R_X86_64_32, R_X86_64_32S are supported but shouldn't be used because of their limited range. */ @@ -23,16 +23,16 @@ struct grub_module_verifier_arch archs[] = { -1 } }, - { "powerpc", 4, 1, EM_PPC, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ - GRUB_ELF_R_PPC_ADDR16_LO, - GRUB_ELF_R_PPC_REL24, /* It has limited range but GRUB adds trampolines when necessarry. */ - GRUB_ELF_R_PPC_ADDR16_HA, - GRUB_ELF_R_PPC_ADDR32, - GRUB_ELF_R_PPC_REL32, + { "powerpc", 4, 1, EM_PPC, VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + VasEBoot_ELF_R_PPC_ADDR16_LO, + VasEBoot_ELF_R_PPC_REL24, /* It has limited range but VasEBoot adds trampolines when necessarry. */ + VasEBoot_ELF_R_PPC_ADDR16_HA, + VasEBoot_ELF_R_PPC_ADDR32, + VasEBoot_ELF_R_PPC_REL32, -1 } }, - { "sparc64", 8, 1, EM_SPARCV9, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ - R_SPARC_WDISP30, /* It has limited range but GRUB adds trampolines when necessarry. */ + { "sparc64", 8, 1, EM_SPARCV9, VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_SPARC_WDISP30, /* It has limited range but VasEBoot adds trampolines when necessarry. */ R_SPARC_HH22, R_SPARC_HM10, R_SPARC_LM22, @@ -47,7 +47,7 @@ struct grub_module_verifier_arch archs[] = { R_SPARC_32, -1 } }, - { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + { "ia64", 8, 0, EM_IA_64, VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_IA64_PCREL21B, /* We should verify that it's pointing either to a function or to a section in the same module. Checking that external symbol is a function is @@ -69,7 +69,7 @@ struct grub_module_verifier_arch archs[] = { R_IA64_GPREL22, -1 } }, - { "mipsel", 4, 0, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + { "mipsel", 4, 0, EM_MIPS, VasEBoot_MODULE_VERIFY_SUPPORTS_REL | VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_MIPS_HI16, R_MIPS_LO16, R_MIPS_32, @@ -80,7 +80,7 @@ struct grub_module_verifier_arch archs[] = { R_MIPS_JALR, -1 } }, - { "mips", 4, 1, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + { "mips", 4, 1, EM_MIPS, VasEBoot_MODULE_VERIFY_SUPPORTS_REL | VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_MIPS_HI16, R_MIPS_LO16, R_MIPS_32, @@ -91,7 +91,7 @@ struct grub_module_verifier_arch archs[] = { R_MIPS_JALR, -1 } }, - { "arm", 4, 0, EM_ARM, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ + { "arm", 4, 0, EM_ARM, VasEBoot_MODULE_VERIFY_SUPPORTS_REL, (int[]){ /* Some relocations are range-limited but trampolines are added when necessarry. */ R_ARM_ABS32, R_ARM_CALL, @@ -104,7 +104,7 @@ struct grub_module_verifier_arch archs[] = { R_ARM_THM_JUMP19, -1 } }, - { "arm64", 8, 0, EM_AARCH64, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + { "arm64", 8, 0, EM_AARCH64, VasEBoot_MODULE_VERIFY_SUPPORTS_REL | VasEBoot_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_AARCH64_ABS64, R_AARCH64_CALL26, R_AARCH64_JUMP26, @@ -157,7 +157,7 @@ main (int argc, char **argv) if (strcmp(archs[arch].name, argv[2]) == 0) break; if (arch == ARRAY_SIZE(archs)) - grub_util_error("unknown arch: %s", argv[2]); + VasEBoot_util_error("unknown arch: %s", argv[2]); for (whitelist = 0; whitelist < ARRAY_SIZE(whitelists); whitelist++) if (strcmp(whitelists[whitelist].arch, argv[2]) == 0 @@ -166,11 +166,11 @@ main (int argc, char **argv) if (whitelist != ARRAY_SIZE(whitelists)) whitelist_empty = whitelists[whitelist].whitelist_empty; - module_size = grub_util_get_image_size (argv[1]); - module_img = grub_util_read_image (argv[1]); + module_size = VasEBoot_util_get_image_size (argv[1]); + module_img = VasEBoot_util_read_image (argv[1]); if (archs[arch].voidp_sizeof == 8) - grub_module_verify64(module_img, module_size, &archs[arch], whitelist_empty); + VasEBoot_module_verify64(module_img, module_size, &archs[arch], whitelist_empty); else - grub_module_verify32(module_img, module_size, &archs[arch], whitelist_empty); + VasEBoot_module_verify32(module_img, module_size, &archs[arch], whitelist_empty); return 0; } diff --git a/util/VasEBoot-module-verifier32.c b/util/VasEBoot-module-verifier32.c index 257229f8f..89717a2a8 100644 --- a/util/VasEBoot-module-verifier32.c +++ b/util/VasEBoot-module-verifier32.c @@ -1,2 +1,2 @@ #define MODULEVERIFIER_ELF32 1 -#include "grub-module-verifierXX.c" +#include "VasEBoot-module-verifierXX.c" diff --git a/util/VasEBoot-module-verifier64.c b/util/VasEBoot-module-verifier64.c index 4db6b4bed..f8fff14f7 100644 --- a/util/VasEBoot-module-verifier64.c +++ b/util/VasEBoot-module-verifier64.c @@ -1,2 +1,2 @@ #define MODULEVERIFIER_ELF64 1 -#include "grub-module-verifierXX.c" +#include "VasEBoot-module-verifierXX.c" diff --git a/util/VasEBoot-module-verifierXX.c b/util/VasEBoot-module-verifierXX.c index 1feaafc9b..5888b0b48 100644 --- a/util/VasEBoot-module-verifierXX.c +++ b/util/VasEBoot-module-verifierXX.c @@ -1,8 +1,8 @@ #include -#include -#include -#include +#include +#include +#include #if defined(MODULEVERIFIER_ELF32) # define SUFFIX(x) x ## 32 @@ -44,143 +44,143 @@ #error "I'm confused" #endif -#define grub_target_to_host32(x) (grub_target_to_host32_real (arch, (x))) -#define grub_host_to_target32(x) (grub_host_to_target32_real (arch, (x))) -#define grub_target_to_host64(x) (grub_target_to_host64_real (arch, (x))) -#define grub_host_to_target64(x) (grub_host_to_target64_real (arch, (x))) -#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (arch, (x))) -#define grub_target_to_host16(x) (grub_target_to_host16_real (arch, (x))) -#define grub_host_to_target16(x) (grub_host_to_target16_real (arch, (x))) -#define grub_target_to_host(val) grub_target_to_host_real(arch, (val)) +#define VasEBoot_target_to_host32(x) (VasEBoot_target_to_host32_real (arch, (x))) +#define VasEBoot_host_to_target32(x) (VasEBoot_host_to_target32_real (arch, (x))) +#define VasEBoot_target_to_host64(x) (VasEBoot_target_to_host64_real (arch, (x))) +#define VasEBoot_host_to_target64(x) (VasEBoot_host_to_target64_real (arch, (x))) +#define VasEBoot_host_to_target_addr(x) (VasEBoot_host_to_target_addr_real (arch, (x))) +#define VasEBoot_target_to_host16(x) (VasEBoot_target_to_host16_real (arch, (x))) +#define VasEBoot_host_to_target16(x) (VasEBoot_host_to_target16_real (arch, (x))) +#define VasEBoot_target_to_host(val) VasEBoot_target_to_host_real(arch, (val)) -static inline grub_uint32_t -grub_target_to_host32_real (const struct grub_module_verifier_arch *arch, - grub_uint32_t in) +static inline VasEBoot_uint32_t +VasEBoot_target_to_host32_real (const struct VasEBoot_module_verifier_arch *arch, + VasEBoot_uint32_t in) { if (arch->bigendian) - return grub_be_to_cpu32 (in); + return VasEBoot_be_to_cpu32 (in); else - return grub_le_to_cpu32 (in); + return VasEBoot_le_to_cpu32 (in); } -static inline grub_uint64_t -grub_target_to_host64_real (const struct grub_module_verifier_arch *arch, - grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_target_to_host64_real (const struct VasEBoot_module_verifier_arch *arch, + VasEBoot_uint64_t in) { if (arch->bigendian) - return grub_be_to_cpu64 (in); + return VasEBoot_be_to_cpu64 (in); else - return grub_le_to_cpu64 (in); + return VasEBoot_le_to_cpu64 (in); } -static inline grub_uint64_t -grub_host_to_target64_real (const struct grub_module_verifier_arch *arch, - grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_host_to_target64_real (const struct VasEBoot_module_verifier_arch *arch, + VasEBoot_uint64_t in) { if (arch->bigendian) - return grub_cpu_to_be64 (in); + return VasEBoot_cpu_to_be64 (in); else - return grub_cpu_to_le64 (in); + return VasEBoot_cpu_to_le64 (in); } -static inline grub_uint32_t -grub_host_to_target32_real (const struct grub_module_verifier_arch *arch, - grub_uint32_t in) +static inline VasEBoot_uint32_t +VasEBoot_host_to_target32_real (const struct VasEBoot_module_verifier_arch *arch, + VasEBoot_uint32_t in) { if (arch->bigendian) - return grub_cpu_to_be32 (in); + return VasEBoot_cpu_to_be32 (in); else - return grub_cpu_to_le32 (in); + return VasEBoot_cpu_to_le32 (in); } -static inline grub_uint16_t -grub_target_to_host16_real (const struct grub_module_verifier_arch *arch, - grub_uint16_t in) +static inline VasEBoot_uint16_t +VasEBoot_target_to_host16_real (const struct VasEBoot_module_verifier_arch *arch, + VasEBoot_uint16_t in) { if (arch->bigendian) - return grub_be_to_cpu16 (in); + return VasEBoot_be_to_cpu16 (in); else - return grub_le_to_cpu16 (in); + return VasEBoot_le_to_cpu16 (in); } -static inline grub_uint16_t -grub_host_to_target16_real (const struct grub_module_verifier_arch *arch, - grub_uint16_t in) +static inline VasEBoot_uint16_t +VasEBoot_host_to_target16_real (const struct VasEBoot_module_verifier_arch *arch, + VasEBoot_uint16_t in) { if (arch->bigendian) - return grub_cpu_to_be16 (in); + return VasEBoot_cpu_to_be16 (in); else - return grub_cpu_to_le16 (in); + return VasEBoot_cpu_to_le16 (in); } -static inline grub_uint64_t -grub_host_to_target_addr_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_host_to_target_addr_real (const struct VasEBoot_module_verifier_arch *arch, VasEBoot_uint64_t in) { if (arch->voidp_sizeof == 8) - return grub_host_to_target64_real (arch, in); + return VasEBoot_host_to_target64_real (arch, in); else - return grub_host_to_target32_real (arch, in); + return VasEBoot_host_to_target32_real (arch, in); } -static inline grub_uint64_t -grub_target_to_host_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) +static inline VasEBoot_uint64_t +VasEBoot_target_to_host_real (const struct VasEBoot_module_verifier_arch *arch, VasEBoot_uint64_t in) { if (arch->voidp_sizeof == 8) - return grub_target_to_host64_real (arch, in); + return VasEBoot_target_to_host64_real (arch, in); else - return grub_target_to_host32_real (arch, in); + return VasEBoot_target_to_host32_real (arch, in); } static Elf_Shdr * -find_section (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, const char *name) +find_section (const struct VasEBoot_module_verifier_arch *arch, Elf_Ehdr *e, const char *name) { Elf_Shdr *s; const char *str; unsigned i; - s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host16 (e->e_shstrndx) * grub_target_to_host16 (e->e_shentsize)); - str = (char *) e + grub_target_to_host (s->sh_offset); + s = (Elf_Shdr *) ((char *) e + VasEBoot_target_to_host (e->e_shoff) + VasEBoot_target_to_host16 (e->e_shstrndx) * VasEBoot_target_to_host16 (e->e_shentsize)); + str = (char *) e + VasEBoot_target_to_host (s->sh_offset); - for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); - i < grub_target_to_host16 (e->e_shnum); - i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) - if (strcmp (str + grub_target_to_host32 (s->sh_name), name) == 0) + for (i = 0, s = (Elf_Shdr *) ((char *) e + VasEBoot_target_to_host (e->e_shoff)); + i < VasEBoot_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + VasEBoot_target_to_host16 (e->e_shentsize))) + if (strcmp (str + VasEBoot_target_to_host32 (s->sh_name), name) == 0) return s; return NULL; } static void -check_license (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +check_license (const struct VasEBoot_module_verifier_arch *arch, Elf_Ehdr *e) { Elf_Shdr *s = find_section (arch, e, ".module_license"); - if (s && (strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3") == 0 - || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3+") == 0 - || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv2+") == 0)) + if (s && (strcmp ((char *) e + VasEBoot_target_to_host(s->sh_offset), "LICENSE=GPLv3") == 0 + || strcmp ((char *) e + VasEBoot_target_to_host(s->sh_offset), "LICENSE=GPLv3+") == 0 + || strcmp ((char *) e + VasEBoot_target_to_host(s->sh_offset), "LICENSE=GPLv2+") == 0)) return; - grub_util_error ("incompatible license"); + VasEBoot_util_error ("incompatible license"); } static Elf_Sym * -get_symtab (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word *size, Elf_Word *entsize) +get_symtab (const struct VasEBoot_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word *size, Elf_Word *entsize) { unsigned i; Elf_Shdr *s, *sections; Elf_Sym *sym; - sections = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + sections = (Elf_Shdr *) ((char *) e + VasEBoot_target_to_host (e->e_shoff)); for (i = 0, s = sections; - i < grub_target_to_host16 (e->e_shnum); - i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) - if (grub_target_to_host32 (s->sh_type) == SHT_SYMTAB) + i < VasEBoot_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + VasEBoot_target_to_host16 (e->e_shentsize))) + if (VasEBoot_target_to_host32 (s->sh_type) == SHT_SYMTAB) break; - if (i == grub_target_to_host16 (e->e_shnum)) + if (i == VasEBoot_target_to_host16 (e->e_shnum)) return NULL; - sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); - *size = grub_target_to_host (s->sh_size); - *entsize = grub_target_to_host (s->sh_entsize); + sym = (Elf_Sym *) ((char *) e + VasEBoot_target_to_host (s->sh_offset)); + *size = VasEBoot_target_to_host (s->sh_size); + *entsize = VasEBoot_target_to_host (s->sh_entsize); return sym; } @@ -199,7 +199,7 @@ is_whitelisted (const char *modname, const char **whitelist) } static void -check_symbols (const struct grub_module_verifier_arch *arch, +check_symbols (const struct VasEBoot_module_verifier_arch *arch, Elf_Ehdr *e, const char *modname, const char **whitelist_empty) { @@ -224,10 +224,10 @@ check_symbols (const struct grub_module_verifier_arch *arch, s = find_section (arch, e, ".moddeps"); if (!s) - grub_util_error ("no symbol table and no .moddeps section"); + VasEBoot_util_error ("no symbol table and no .moddeps section"); if (!s->sh_size) - grub_util_error ("no symbol table and empty .moddeps section"); + VasEBoot_util_error ("no symbol table and empty .moddeps section"); return; } @@ -248,7 +248,7 @@ check_symbols (const struct grub_module_verifier_arch *arch, break; default: - return grub_util_error ("unknown symbol type `%d'", (int) type); + return VasEBoot_util_error ("unknown symbol type `%d'", (int) type); } } } @@ -274,7 +274,7 @@ is_symbol_local(Elf_Sym *sym) } static void -section_check_relocations (const struct grub_module_verifier_arch *arch, void *ehdr, +section_check_relocations (const struct VasEBoot_module_verifier_arch *arch, void *ehdr, Elf_Shdr *s, size_t target_seg_size) { Elf_Rel *rel, *max; @@ -283,20 +283,20 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e symtab = get_symtab (arch, ehdr, &symtabsize, &symtabentsize); if (!symtab) - grub_util_error ("relocation without symbol table"); + VasEBoot_util_error ("relocation without symbol table"); - for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), - max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); + for (rel = (Elf_Rel *) ((char *) ehdr + VasEBoot_target_to_host (s->sh_offset)), + max = (Elf_Rel *) ((char *) rel + VasEBoot_target_to_host (s->sh_size)); rel < max; - rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) + rel = (Elf_Rel *) ((char *) rel + VasEBoot_target_to_host (s->sh_entsize))) { Elf_Sym *sym; unsigned i; - if (target_seg_size < grub_target_to_host (rel->r_offset)) - grub_util_error ("reloc offset is out of the segment"); + if (target_seg_size < VasEBoot_target_to_host (rel->r_offset)) + VasEBoot_util_error ("reloc offset is out of the segment"); - grub_uint32_t type = ELF_R_TYPE (grub_target_to_host (rel->r_info)); + VasEBoot_uint32_t type = ELF_R_TYPE (VasEBoot_target_to_host (rel->r_info)); if (arch->machine == EM_SPARCV9) type &= 0xff; @@ -307,46 +307,46 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e if (arch->supported_relocations[i] != -1) continue; if (!arch->short_relocations) - grub_util_error ("unsupported relocation 0x%x", type); + VasEBoot_util_error ("unsupported relocation 0x%x", type); for (i = 0; arch->short_relocations[i] != -1; i++) if (type == arch->short_relocations[i]) break; if (arch->short_relocations[i] == -1) - grub_util_error ("unsupported relocation 0x%x", type); - sym = (Elf_Sym *) ((char *) symtab + symtabentsize * ELF_R_SYM (grub_target_to_host (rel->r_info))); + VasEBoot_util_error ("unsupported relocation 0x%x", type); + sym = (Elf_Sym *) ((char *) symtab + symtabentsize * ELF_R_SYM (VasEBoot_target_to_host (rel->r_info))); if (is_symbol_local (sym)) continue; - grub_util_error ("relocation 0x%x is not module-local", type); + VasEBoot_util_error ("relocation 0x%x is not module-local", type); } #if defined(MODULEVERIFIER_ELF64) if (arch->machine == EM_AARCH64) { unsigned unmatched_adr_got_page = 0; Elf_Rela *rel2; - for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), - max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); + for (rel = (Elf_Rel *) ((char *) ehdr + VasEBoot_target_to_host (s->sh_offset)), + max = (Elf_Rel *) ((char *) rel + VasEBoot_target_to_host (s->sh_size)); rel < max; - rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) + rel = (Elf_Rel *) ((char *) rel + VasEBoot_target_to_host (s->sh_entsize))) { - switch (ELF_R_TYPE (grub_target_to_host (rel->r_info))) + switch (ELF_R_TYPE (VasEBoot_target_to_host (rel->r_info))) { case R_AARCH64_ADR_GOT_PAGE: unmatched_adr_got_page++; - for (rel2 = (Elf_Rela *) ((char *) rel + grub_target_to_host (s->sh_entsize)); + for (rel2 = (Elf_Rela *) ((char *) rel + VasEBoot_target_to_host (s->sh_entsize)); rel2 < (Elf_Rela *) max; - rel2 = (Elf_Rela *) ((char *) rel2 + grub_target_to_host (s->sh_entsize))) + rel2 = (Elf_Rela *) ((char *) rel2 + VasEBoot_target_to_host (s->sh_entsize))) if (ELF_R_SYM (rel2->r_info) == ELF_R_SYM (rel->r_info) && ((Elf_Rela *) rel)->r_addend == rel2->r_addend && ELF_R_TYPE (rel2->r_info) == R_AARCH64_LD64_GOT_LO12_NC) break; if (rel2 >= (Elf_Rela *) max) - grub_util_error ("ADR_GOT_PAGE without matching LD64_GOT_LO12_NC"); + VasEBoot_util_error ("ADR_GOT_PAGE without matching LD64_GOT_LO12_NC"); break; case R_AARCH64_LD64_GOT_LO12_NC: if (unmatched_adr_got_page == 0) - grub_util_error ("LD64_GOT_LO12_NC without matching ADR_GOT_PAGE"); + VasEBoot_util_error ("LD64_GOT_LO12_NC without matching ADR_GOT_PAGE"); unmatched_adr_got_page--; break; } @@ -356,42 +356,42 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e } static void -check_relocations (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +check_relocations (const struct VasEBoot_module_verifier_arch *arch, Elf_Ehdr *e) { Elf_Shdr *s; unsigned i; - for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); - i < grub_target_to_host16 (e->e_shnum); - i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) - if (grub_target_to_host32 (s->sh_type) == SHT_REL || grub_target_to_host32 (s->sh_type) == SHT_RELA) + for (i = 0, s = (Elf_Shdr *) ((char *) e + VasEBoot_target_to_host (e->e_shoff)); + i < VasEBoot_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + VasEBoot_target_to_host16 (e->e_shentsize))) + if (VasEBoot_target_to_host32 (s->sh_type) == SHT_REL || VasEBoot_target_to_host32 (s->sh_type) == SHT_RELA) { Elf_Shdr *ts; - if (grub_target_to_host32 (s->sh_type) == SHT_REL && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_REL)) - grub_util_error ("unsupported SHT_REL"); - if (grub_target_to_host32 (s->sh_type) == SHT_RELA && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_RELA)) - grub_util_error ("unsupported SHT_RELA"); + if (VasEBoot_target_to_host32 (s->sh_type) == SHT_REL && !(arch->flags & VasEBoot_MODULE_VERIFY_SUPPORTS_REL)) + VasEBoot_util_error ("unsupported SHT_REL"); + if (VasEBoot_target_to_host32 (s->sh_type) == SHT_RELA && !(arch->flags & VasEBoot_MODULE_VERIFY_SUPPORTS_RELA)) + VasEBoot_util_error ("unsupported SHT_RELA"); /* Find the target segment. */ - if (grub_target_to_host32 (s->sh_info) >= grub_target_to_host16 (e->e_shnum)) - grub_util_error ("orphaned reloc section"); - ts = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host32 (s->sh_info) * grub_target_to_host16 (e->e_shentsize)); + if (VasEBoot_target_to_host32 (s->sh_info) >= VasEBoot_target_to_host16 (e->e_shnum)) + VasEBoot_util_error ("orphaned reloc section"); + ts = (Elf_Shdr *) ((char *) e + VasEBoot_target_to_host (e->e_shoff) + VasEBoot_target_to_host32 (s->sh_info) * VasEBoot_target_to_host16 (e->e_shentsize)); - section_check_relocations (arch, e, s, grub_target_to_host (ts->sh_size)); + section_check_relocations (arch, e, s, VasEBoot_target_to_host (ts->sh_size)); } } void -SUFFIX(grub_module_verify) (void *module_img, size_t size, - const struct grub_module_verifier_arch *arch, +SUFFIX(VasEBoot_module_verify) (void *module_img, size_t size, + const struct VasEBoot_module_verifier_arch *arch, const char **whitelist_empty) { Elf_Ehdr *e = module_img; /* Check the header size. */ if (size < sizeof (Elf_Ehdr)) - grub_util_error ("ELF header smaller than expected"); + VasEBoot_util_error ("ELF header smaller than expected"); /* Check the magic numbers. */ if (e->e_ident[EI_MAG0] != ELFMAG0 @@ -399,24 +399,24 @@ SUFFIX(grub_module_verify) (void *module_img, size_t size, || e->e_ident[EI_MAG2] != ELFMAG2 || e->e_ident[EI_MAG3] != ELFMAG3 || e->e_ident[EI_VERSION] != EV_CURRENT - || grub_target_to_host32 (e->e_version) != EV_CURRENT) - grub_util_error ("invalid arch-independent ELF magic"); + || VasEBoot_target_to_host32 (e->e_version) != EV_CURRENT) + VasEBoot_util_error ("invalid arch-independent ELF magic"); if (e->e_ident[EI_CLASS] != ELFCLASSXX || e->e_ident[EI_DATA] != (arch->bigendian ? ELFDATA2MSB : ELFDATA2LSB) - || grub_target_to_host16 (e->e_machine) != arch->machine) - grub_util_error ("invalid arch-dependent ELF magic"); + || VasEBoot_target_to_host16 (e->e_machine) != arch->machine) + VasEBoot_util_error ("invalid arch-dependent ELF magic"); - if (grub_target_to_host16 (e->e_type) != ET_REL) + if (VasEBoot_target_to_host16 (e->e_type) != ET_REL) { - grub_util_error ("this ELF file is not of the right type"); + VasEBoot_util_error ("this ELF file is not of the right type"); } /* Make sure that every section is within the core. */ - if (size < grub_target_to_host (e->e_shoff) - + (grub_uint32_t) grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) + if (size < VasEBoot_target_to_host (e->e_shoff) + + (VasEBoot_uint32_t) VasEBoot_target_to_host16 (e->e_shentsize) * VasEBoot_target_to_host16(e->e_shnum)) { - grub_util_error ("ELF sections outside core"); + VasEBoot_util_error ("ELF sections outside core"); } check_license (arch, e); @@ -426,9 +426,9 @@ SUFFIX(grub_module_verify) (void *module_img, size_t size, s = find_section (arch, e, ".modname"); if (!s) - grub_util_error ("no module name found"); + VasEBoot_util_error ("no module name found"); - modname = (const char *) e + grub_target_to_host (s->sh_offset); + modname = (const char *) e + VasEBoot_target_to_host (s->sh_offset); check_symbols(arch, e, modname, whitelist_empty); check_relocations(arch, e); diff --git a/util/VasEBoot-mount.c b/util/VasEBoot-mount.c index a25db8a71..4d90f9d00 100644 --- a/util/VasEBoot-mount.c +++ b/util/VasEBoot-mount.c @@ -1,39 +1,39 @@ -/* grub-mount.c - FUSE driver for filesystems that GRUB understands */ +/* VasEBoot-mount.c - FUSE driver for filesystems that VasEBoot understands */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #define FUSE_USE_VERSION 26 #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,8 +50,8 @@ #include "progname.h" static const char *root = NULL; -grub_device_t dev = NULL; -grub_fs_t fs = NULL; +VasEBoot_device_t dev = NULL; +VasEBoot_fs_t fs = NULL; static char **images = NULL; static char *debug_str = NULL; static char **fuse_args = NULL; @@ -59,64 +59,64 @@ static int fuse_argc = 0; static int num_disks = 0; static int mount_crypt = 0; -static grub_err_t +static VasEBoot_err_t execute_command (const char *name, int n, char **args) { - grub_command_t cmd; + VasEBoot_command_t cmd; - cmd = grub_command_find (name); + cmd = VasEBoot_command_find (name); if (! cmd) - grub_util_error (_("can't find command `%s'"), name); + VasEBoot_util_error (_("can't find command `%s'"), name); return (cmd->func) (cmd, n, args); } -/* Translate GRUB error numbers into OS error numbers. Print any unexpected +/* Translate VasEBoot error numbers into OS error numbers. Print any unexpected errors. */ static int translate_error (void) { int ret; - switch (grub_errno) + switch (VasEBoot_errno) { - case GRUB_ERR_NONE: + case VasEBoot_ERR_NONE: ret = 0; break; - case GRUB_ERR_OUT_OF_MEMORY: - grub_print_error (); + case VasEBoot_ERR_OUT_OF_MEMORY: + VasEBoot_print_error (); ret = -ENOMEM; break; - case GRUB_ERR_BAD_FILE_TYPE: + case VasEBoot_ERR_BAD_FILE_TYPE: /* This could also be EISDIR. Take a guess. */ ret = -ENOTDIR; break; - case GRUB_ERR_FILE_NOT_FOUND: + case VasEBoot_ERR_FILE_NOT_FOUND: ret = -ENOENT; break; - case GRUB_ERR_FILE_READ_ERROR: - case GRUB_ERR_READ_ERROR: - case GRUB_ERR_IO: - grub_print_error (); + case VasEBoot_ERR_FILE_READ_ERROR: + case VasEBoot_ERR_READ_ERROR: + case VasEBoot_ERR_IO: + VasEBoot_print_error (); ret = -EIO; break; - case GRUB_ERR_SYMLINK_LOOP: + case VasEBoot_ERR_SYMLINK_LOOP: ret = -ELOOP; break; default: - grub_print_error (); + VasEBoot_print_error (); ret = -EINVAL; break; } /* Any previous errors were handled. */ - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return ret; } @@ -125,19 +125,19 @@ translate_error (void) struct fuse_getattr_ctx { char *filename; - struct grub_dirhook_info file_info; + struct VasEBoot_dirhook_info file_info; int file_exists; }; /* A hook for iterating directories. */ static int fuse_getattr_find_file (const char *cur_filename, - const struct grub_dirhook_info *info, void *data) + const struct VasEBoot_dirhook_info *info, void *data) { struct fuse_getattr_ctx *ctx = data; - if ((info->case_insensitive ? grub_strcasecmp (cur_filename, ctx->filename) - : grub_strcmp (cur_filename, ctx->filename)) == 0) + if ((info->case_insensitive ? VasEBoot_strcasecmp (cur_filename, ctx->filename) + : VasEBoot_strcmp (cur_filename, ctx->filename)) == 0) { ctx->file_info = *info; ctx->file_exists = 1; @@ -172,30 +172,30 @@ fuse_getattr (const char *path, struct stat *st) pathname = xstrdup (path); /* Remove trailing '/'. */ - while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') - pathname[grub_strlen (pathname) - 1] = 0; + while (*pathname && pathname[VasEBoot_strlen (pathname) - 1] == '/') + pathname[VasEBoot_strlen (pathname) - 1] = 0; /* Split into path and filename. */ - ctx.filename = grub_strrchr (pathname, '/'); + ctx.filename = VasEBoot_strrchr (pathname, '/'); if (! ctx.filename) { - path2 = grub_strdup ("/"); + path2 = VasEBoot_strdup ("/"); ctx.filename = pathname; } else { ctx.filename++; - path2 = grub_strdup (pathname); + path2 = VasEBoot_strdup (pathname); path2[ctx.filename - pathname] = 0; } /* It's the whole device. */ (fs->dir) (dev, path2, fuse_getattr_find_file, &ctx); - grub_free (path2); + VasEBoot_free (path2); if (!ctx.file_exists) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return -ENOENT; } st->st_dev = 0; @@ -207,11 +207,11 @@ fuse_getattr (const char *path, struct stat *st) st->st_size = 0; if (!ctx.file_info.dir) { - grub_file_t file; - file = grub_file_open (path); - if (! file && grub_errno == GRUB_ERR_BAD_FILE_TYPE) + VasEBoot_file_t file; + file = VasEBoot_file_open (path); + if (! file && VasEBoot_errno == VasEBoot_ERR_BAD_FILE_TYPE) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; st->st_mode = (0555 | S_IFDIR); } else if (! file) @@ -219,14 +219,14 @@ fuse_getattr (const char *path, struct stat *st) else { st->st_size = file->size; - grub_file_close (file); + VasEBoot_file_close (file); } } st->st_blksize = 512; st->st_blocks = (st->st_size + 511) >> 9; st->st_atime = st->st_mtime = st->st_ctime = ctx.file_info.mtimeset ? ctx.file_info.mtime : 0; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } @@ -237,20 +237,20 @@ fuse_opendir (const char *path, struct fuse_file_info *fi) } /* FIXME */ -static grub_file_t files[65536]; +static VasEBoot_file_t files[65536]; static int first_fd = 1; static int fuse_open (const char *path, struct fuse_file_info *fi __attribute__ ((unused))) { - grub_file_t file; - file = grub_file_open (path); + VasEBoot_file_t file; + file = VasEBoot_file_open (path); if (! file) return translate_error (); files[first_fd++] = file; fi->fh = first_fd; files[first_fd++] = file; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } @@ -258,20 +258,20 @@ static int fuse_read (const char *path, char *buf, size_t sz, off_t off, struct fuse_file_info *fi) { - grub_file_t file = files[fi->fh]; - grub_ssize_t size; + VasEBoot_file_t file = files[fi->fh]; + VasEBoot_ssize_t size; if (off > file->size) return -EINVAL; file->offset = off; - size = grub_file_read (file, buf, sz); + size = VasEBoot_file_read (file, buf, sz); if (size < 0) return translate_error (); else { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return size; } } @@ -279,9 +279,9 @@ fuse_read (const char *path, char *buf, size_t sz, off_t off, static int fuse_release (const char *path, struct fuse_file_info *fi) { - grub_file_close (files[fi->fh]); + VasEBoot_file_close (files[fi->fh]); files[fi->fh] = NULL; - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } @@ -296,34 +296,34 @@ struct fuse_readdir_ctx /* Helper for fuse_readdir. */ static int fuse_readdir_call_fill (const char *filename, - const struct grub_dirhook_info *info, void *data) + const struct VasEBoot_dirhook_info *info, void *data) { struct fuse_readdir_ctx *ctx = data; struct stat st; - grub_memset (&st, 0, sizeof (st)); + VasEBoot_memset (&st, 0, sizeof (st)); st.st_mode = info->dir ? (0555 | S_IFDIR) : (0444 | S_IFREG); if (!info->dir) { - grub_file_t file; + VasEBoot_file_t file; char *tmp; tmp = xasprintf ("%s/%s", ctx->path, filename); - file = grub_file_open (tmp); + file = VasEBoot_file_open (tmp); free (tmp); /* Symlink to directory. */ - if (! file && grub_errno == GRUB_ERR_BAD_FILE_TYPE) + if (! file && VasEBoot_errno == VasEBoot_ERR_BAD_FILE_TYPE) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; st.st_mode = (0555 | S_IFDIR); } else if (!file) { - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; } else { st.st_size = file->size; - grub_file_close (file); + VasEBoot_file_close (file); } } st.st_blksize = 512; @@ -349,16 +349,16 @@ fuse_readdir (const char *path, void *buf, /* Remove trailing '/'. */ while (pathname [0] && pathname[1] - && pathname[grub_strlen (pathname) - 1] == '/') - pathname[grub_strlen (pathname) - 1] = 0; + && pathname[VasEBoot_strlen (pathname) - 1] == '/') + pathname[VasEBoot_strlen (pathname) - 1] = 0; (fs->dir) (dev, pathname, fuse_readdir_call_fill, &ctx); free (pathname); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; return 0; } -struct fuse_operations grub_opers = { +struct fuse_operations VasEBoot_opers = { .getattr = fuse_getattr, .open = fuse_open, .release = fuse_release, @@ -367,7 +367,7 @@ struct fuse_operations grub_opers = { .read = fuse_read }; -static grub_err_t +static VasEBoot_err_t fuse_init (void) { int i; @@ -377,75 +377,75 @@ fuse_init (void) char *argv[2]; char *host_file; char *loop_name; - loop_name = grub_xasprintf ("loop%d", i); + loop_name = VasEBoot_xasprintf ("loop%d", i); if (!loop_name) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - host_file = grub_xasprintf ("(host)%s", images[i]); + host_file = VasEBoot_xasprintf ("(host)%s", images[i]); if (!host_file) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); argv[0] = loop_name; argv[1] = host_file; if (execute_command ("loopback", 2, argv)) - grub_util_error (_("`loopback' command fails: %s"), grub_errmsg); + VasEBoot_util_error (_("`loopback' command fails: %s"), VasEBoot_errmsg); - grub_free (loop_name); - grub_free (host_file); + VasEBoot_free (loop_name); + VasEBoot_free (host_file); } if (mount_crypt) { char *argv[2] = { xstrdup ("-a"), NULL}; if (execute_command ("cryptomount", 1, argv)) - grub_util_error (_("`cryptomount' command fails: %s"), - grub_errmsg); + VasEBoot_util_error (_("`cryptomount' command fails: %s"), + VasEBoot_errmsg); free (argv[0]); } - grub_lvm_fini (); - grub_mdraid09_fini (); - grub_mdraid1x_fini (); - grub_diskfilter_fini (); - grub_diskfilter_init (); - grub_mdraid09_init (); - grub_mdraid1x_init (); - grub_lvm_init (); + VasEBoot_lvm_fini (); + VasEBoot_mdraid09_fini (); + VasEBoot_mdraid1x_fini (); + VasEBoot_diskfilter_fini (); + VasEBoot_diskfilter_init (); + VasEBoot_mdraid09_init (); + VasEBoot_mdraid1x_init (); + VasEBoot_lvm_init (); - dev = grub_device_open (0); + dev = VasEBoot_device_open (0); if (! dev) - return grub_errno; + return VasEBoot_errno; - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) { - grub_device_close (dev); - return grub_errno; + VasEBoot_device_close (dev); + return VasEBoot_errno; } - if (fuse_main (fuse_argc, fuse_args, &grub_opers, NULL)) - grub_error (GRUB_ERR_IO, "fuse_main failed"); + if (fuse_main (fuse_argc, fuse_args, &VasEBoot_opers, NULL)) + VasEBoot_error (VasEBoot_ERR_IO, "fuse_main failed"); for (i = 0; i < num_disks; i++) { char *argv[2]; char *loop_name; - loop_name = grub_xasprintf ("loop%d", i); + loop_name = VasEBoot_xasprintf ("loop%d", i); if (!loop_name) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); argv[0] = xstrdup ("-d"); argv[1] = loop_name; execute_command ("loopback", 2, argv); - grub_free (argv[0]); - grub_free (loop_name); + VasEBoot_free (argv[0]); + VasEBoot_free (loop_name); } - return grub_errno; + return VasEBoot_errno; } static struct argp_option options[] = { @@ -480,18 +480,18 @@ argp_parser (int key, char *arg, struct argp_state *state) if (strcmp (arg, "prompt") == 0) { char buf[1024]; - grub_printf ("%s", _("Enter ZFS password: ")); - if (grub_password_get (buf, 1023)) + VasEBoot_printf ("%s", _("Enter ZFS password: ")); + if (VasEBoot_password_get (buf, 1023)) { - grub_zfs_add_key ((grub_uint8_t *) buf, grub_strlen (buf), 1); + VasEBoot_zfs_add_key ((VasEBoot_uint8_t *) buf, VasEBoot_strlen (buf), 1); } } else { FILE *f; ssize_t real_size; - grub_uint8_t buf[1024]; - f = grub_util_fopen (arg, "rb"); + VasEBoot_uint8_t buf[1024]; + f = VasEBoot_util_fopen (arg, "rb"); if (!f) { printf (_("%s: error:"), program_name); @@ -509,7 +509,7 @@ argp_parser (int key, char *arg, struct argp_state *state) fclose (f); return 0; } - grub_zfs_add_key (buf, real_size, 0); + VasEBoot_zfs_add_key (buf, real_size, 0); fclose (f); } return 0; @@ -542,7 +542,7 @@ argp_parser (int key, char *arg, struct argp_state *state) } images = xrealloc (images, (num_disks + 1) * sizeof (images[0])); - images[num_disks] = grub_canonicalize_file_name (arg); + images[num_disks] = VasEBoot_canonicalize_file_name (arg); num_disks++; return 0; @@ -560,7 +560,7 @@ main (int argc, char *argv[]) const char *default_root; char *alloc_root; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); fuse_args = xrealloc (fuse_args, (fuse_argc + 2) * sizeof (fuse_args[0])); fuse_args[fuse_argc] = xstrdup (argv[0]); @@ -572,7 +572,7 @@ main (int argc, char *argv[]) argp_parse (&argp, argc, argv, 0, 0, 0); if (num_disks < 2) - grub_util_error ("%s", _("need an image and mountpoint")); + VasEBoot_util_error ("%s", _("need an image and mountpoint")); fuse_args = xrealloc (fuse_args, (fuse_argc + 2) * sizeof (fuse_args[0])); fuse_args[fuse_argc] = images[num_disks - 1]; fuse_argc++; @@ -580,10 +580,10 @@ main (int argc, char *argv[]) fuse_args[fuse_argc] = NULL; /* Initialize all modules. */ - grub_init_all (); + VasEBoot_init_all (); if (debug_str) - grub_env_set ("debug", debug_str); + VasEBoot_env_set ("debug", debug_str); default_root = (num_disks == 1) ? "loop0" : "md0"; alloc_root = 0; @@ -600,21 +600,21 @@ main (int argc, char *argv[]) else root = default_root; - grub_env_set ("root", root); + VasEBoot_env_set ("root", root); if (alloc_root) free (alloc_root); /* Do it. */ fuse_init (); - if (grub_errno) + if (VasEBoot_errno) { - grub_print_error (); + VasEBoot_print_error (); return 1; } /* Free resources. */ - grub_fini_all (); + VasEBoot_fini_all (); return 0; } diff --git a/util/VasEBoot-pe2elf.c b/util/VasEBoot-pe2elf.c index 0d4084a10..f801f8877 100644 --- a/util/VasEBoot-pe2elf.c +++ b/util/VasEBoot-pe2elf.c @@ -1,28 +1,28 @@ -/* grub-pe2elf.c - tool to convert pe image to elf. */ +/* VasEBoot-pe2elf.c - tool to convert pe image to elf. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,12 +48,12 @@ * relocation sections */ -#if GRUB_TARGET_WORDSIZE == 64 +#if VasEBoot_TARGET_WORDSIZE == 64 typedef Elf64_Rela elf_reloc_t; -#define GRUB_PE32_MACHINE GRUB_PE32_MACHINE_X86_64 +#define VasEBoot_PE32_MACHINE VasEBoot_PE32_MACHINE_X86_64 #else typedef Elf32_Rel elf_reloc_t; -#define GRUB_PE32_MACHINE GRUB_PE32_MACHINE_I386 +#define VasEBoot_PE32_MACHINE VasEBoot_PE32_MACHINE_I386 #endif #define STRTAB_BLOCK 256 @@ -64,7 +64,7 @@ static int strtab_max, strtab_len; static Elf_Ehdr ehdr; static Elf_Shdr *shdr; static int num_sections, first_reloc_section, reloc_sections_end, symtab_section, strtab_section; -static grub_uint32_t offset, image_base; +static VasEBoot_uint32_t offset, image_base; static int insert_string (const char *name) @@ -90,15 +90,15 @@ insert_string (const char *name) static int * write_section_data (FILE* fp, const char *name, char *image, - struct grub_pe32_coff_header *pe_chdr, - struct grub_pe32_section_table *pe_shdr) + struct VasEBoot_pe32_coff_header *pe_chdr, + struct VasEBoot_pe32_section_table *pe_shdr) { int *section_map; int i; - grub_uint32_t last_category = 0; - grub_uint32_t idx, idx_reloc; + VasEBoot_uint32_t last_category = 0; + VasEBoot_uint32_t idx, idx_reloc; char *pe_strtab = (image + pe_chdr->symtab_offset - + pe_chdr->num_symbols * sizeof (struct grub_pe32_symbol)); + + pe_chdr->num_symbols * sizeof (struct VasEBoot_pe32_symbol)); section_map = xmalloc ((2 * pe_chdr->num_sections + 5) * sizeof (int)); section_map[0] = 0; @@ -108,11 +108,11 @@ write_section_data (FILE* fp, const char *name, char *image, for (i = 0; i < pe_chdr->num_sections; i++, pe_shdr++) { - grub_uint32_t category; + VasEBoot_uint32_t category; const char *shname = pe_shdr->name; - grub_size_t secsize; + VasEBoot_size_t secsize; - if (shname[0] == '/' && grub_isdigit (shname[1])) + if (shname[0] == '/' && VasEBoot_isdigit (shname[1])) { char t[sizeof (pe_shdr->name) + 1]; memcpy (t, shname, sizeof (pe_shdr->name)); @@ -157,7 +157,7 @@ write_section_data (FILE* fp, const char *name, char *image, } if (category < last_category) - grub_util_error ("out of order sections"); + VasEBoot_util_error ("out of order sections"); section_map[i + 1] = idx; @@ -167,14 +167,14 @@ write_section_data (FILE* fp, const char *name, char *image, shdr[idx].sh_size = secsize; shdr[idx].sh_addralign = 1 << (((pe_shdr->characteristics >> - GRUB_PE32_SCN_ALIGN_SHIFT) & - GRUB_PE32_SCN_ALIGN_MASK) - 1); + VasEBoot_PE32_SCN_ALIGN_SHIFT) & + VasEBoot_PE32_SCN_ALIGN_MASK) - 1); shdr[idx].sh_addr = pe_shdr->virtual_address + image_base; if (shdr[idx].sh_type != SHT_NOBITS) { shdr[idx].sh_offset = offset; - grub_util_write_image_at (image + pe_shdr->raw_data_offset, + VasEBoot_util_write_image_at (image + pe_shdr->raw_data_offset, pe_shdr->raw_data_size, offset, fp, shname); @@ -217,8 +217,8 @@ write_section_data (FILE* fp, const char *name, char *image, static void write_reloc_section (FILE* fp, const char *name, char *image, - struct grub_pe32_coff_header *pe_chdr, - struct grub_pe32_section_table *pe_shdr, + struct VasEBoot_pe32_coff_header *pe_chdr, + struct VasEBoot_pe32_section_table *pe_shdr, Elf_Sym *symtab, int *symtab_map) { @@ -226,13 +226,13 @@ write_reloc_section (FILE* fp, const char *name, char *image, for (i = first_reloc_section; i < reloc_sections_end; i++) { - struct grub_pe32_section_table *pe_sec; - struct grub_pe32_reloc *pe_rel; + struct VasEBoot_pe32_section_table *pe_sec; + struct VasEBoot_pe32_reloc *pe_rel; elf_reloc_t *rel; int num_rels, j, modified; pe_sec = pe_shdr + shdr[i].sh_link; - pe_rel = (struct grub_pe32_reloc *) (image + pe_sec->relocations_offset); + pe_rel = (struct VasEBoot_pe32_reloc *) (image + pe_sec->relocations_offset); rel = (elf_reloc_t *) xmalloc (pe_sec->num_relocations * sizeof (elf_reloc_t)); num_rels = 0; modified = 0; @@ -240,50 +240,50 @@ write_reloc_section (FILE* fp, const char *name, char *image, for (j = 0; j < pe_sec->num_relocations; j++, pe_rel++) { int type; - grub_uint32_t ofs, *addr; + VasEBoot_uint32_t ofs, *addr; if ((pe_rel->symtab_index >= pe_chdr->num_symbols) || (symtab_map[pe_rel->symtab_index] == -1)) - grub_util_error ("invalid symbol"); + VasEBoot_util_error ("invalid symbol"); ofs = pe_rel->offset - pe_sec->virtual_address; - addr = (grub_uint32_t *)(image + pe_sec->raw_data_offset + ofs); + addr = (VasEBoot_uint32_t *)(image + pe_sec->raw_data_offset + ofs); switch (pe_rel->type) { -#if GRUB_TARGET_WORDSIZE == 64 +#if VasEBoot_TARGET_WORDSIZE == 64 case 1: type = R_X86_64_64; - rel[num_rels].r_addend = *(grub_int64_t *)addr; - *(grub_int64_t *)addr = 0; + rel[num_rels].r_addend = *(VasEBoot_int64_t *)addr; + *(VasEBoot_int64_t *)addr = 0; modified = 1; break; case 4: type = R_X86_64_PC32; - rel[num_rels].r_addend = *(grub_int32_t *)addr; + rel[num_rels].r_addend = *(VasEBoot_int32_t *)addr; *addr = 0; modified = 1; break; case 14: type = R_X86_64_PC64; - rel[num_rels].r_addend = *(grub_uint64_t *)addr - 8; - *(grub_uint64_t *)addr = 0; + rel[num_rels].r_addend = *(VasEBoot_uint64_t *)addr - 8; + *(VasEBoot_uint64_t *)addr = 0; modified = 1; break; #else - case GRUB_PE32_REL_I386_DIR32: + case VasEBoot_PE32_REL_I386_DIR32: type = R_386_32; break; - case GRUB_PE32_REL_I386_REL32: + case VasEBoot_PE32_REL_I386_REL32: type = R_386_PC32; break; #endif default: - grub_util_error ("unknown pe relocation type %d", pe_rel->type); + VasEBoot_util_error ("unknown pe relocation type %d", pe_rel->type); } if (type == -#if GRUB_TARGET_WORDSIZE == 64 +#if VasEBoot_TARGET_WORDSIZE == 64 R_386_PC32 #else R_X86_64_PC32 @@ -295,9 +295,9 @@ write_reloc_section (FILE* fp, const char *name, char *image, code = image[pe_sec->raw_data_offset + ofs - 1]; -#if GRUB_TARGET_WORDSIZE == 32 +#if VasEBoot_TARGET_WORDSIZE == 32 if (((code != 0xe8) && (code != 0xe9)) || (*addr)) - grub_util_error ("invalid relocation (%x %x)", code, *addr); + VasEBoot_util_error ("invalid relocation (%x %x)", code, *addr); #endif if (symtab[symtab_map[pe_rel->symtab_index]].st_shndx @@ -312,7 +312,7 @@ write_reloc_section (FILE* fp, const char *name, char *image, } else { -#if GRUB_TARGET_WORDSIZE == 64 +#if VasEBoot_TARGET_WORDSIZE == 64 rel[num_rels].r_addend -= 4; #else modified = 1; @@ -328,12 +328,12 @@ write_reloc_section (FILE* fp, const char *name, char *image, } if (modified) - grub_util_write_image_at (image + pe_sec->raw_data_offset, + VasEBoot_util_write_image_at (image + pe_sec->raw_data_offset, shdr[shdr[i].sh_info].sh_size, shdr[shdr[i].sh_info].sh_offset, fp, name); -#if GRUB_TARGET_WORDSIZE == 64 +#if VasEBoot_TARGET_WORDSIZE == 64 shdr[i].sh_type = SHT_RELA; #else shdr[i].sh_type = SHT_REL; @@ -344,7 +344,7 @@ write_reloc_section (FILE* fp, const char *name, char *image, shdr[i].sh_entsize = sizeof (elf_reloc_t); shdr[i].sh_size = num_rels * sizeof (elf_reloc_t); - grub_util_write_image_at (rel, shdr[i].sh_size, offset, fp, name); + VasEBoot_util_write_image_at (rel, shdr[i].sh_size, offset, fp, name); offset += shdr[i].sh_size; free (rel); } @@ -352,17 +352,17 @@ write_reloc_section (FILE* fp, const char *name, char *image, static void write_symbol_table (FILE* fp, const char *name, char *image, - struct grub_pe32_coff_header *pe_chdr, - struct grub_pe32_section_table *pe_shdr, + struct VasEBoot_pe32_coff_header *pe_chdr, + struct VasEBoot_pe32_section_table *pe_shdr, int *section_map) { - struct grub_pe32_symbol *pe_symtab; + struct VasEBoot_pe32_symbol *pe_symtab; char *pe_strtab; Elf_Sym *symtab; int *symtab_map, num_syms; int i; - pe_symtab = (struct grub_pe32_symbol *) (image + pe_chdr->symtab_offset); + pe_symtab = (struct VasEBoot_pe32_symbol *) (image + pe_chdr->symtab_offset); pe_strtab = (char *) (pe_symtab + pe_chdr->num_symbols); symtab = (Elf_Sym *) xmalloc ((pe_chdr->num_symbols + 1) * @@ -384,17 +384,17 @@ write_symbol_table (FILE* fp, const char *name, char *image, if (! pe_symtab->section) type = STT_NOTYPE; - else if (pe_symtab->type == GRUB_PE32_DT_FUNCTION) + else if (pe_symtab->type == VasEBoot_PE32_DT_FUNCTION) type = STT_FUNC; else type = STT_OBJECT; - if (pe_symtab->storage_class == GRUB_PE32_SYM_CLASS_EXTERNAL) + if (pe_symtab->storage_class == VasEBoot_PE32_SYM_CLASS_EXTERNAL) bind = STB_GLOBAL; else bind = STB_LOCAL; - if ((pe_symtab->type != GRUB_PE32_DT_FUNCTION) && (pe_symtab->num_aux)) + if ((pe_symtab->type != VasEBoot_PE32_DT_FUNCTION) && (pe_symtab->num_aux)) { if (! pe_symtab->value) type = STT_SECTION; @@ -415,10 +415,10 @@ write_symbol_table (FILE* fp, const char *name, char *image, else symname = pe_strtab + pe_symtab->long_name[1]; - if ((strcmp (symname, "_grub_mod_init")) && - (strcmp (symname, "_grub_mod_fini")) && - (strcmp (symname, "grub_mod_init")) && - (strcmp (symname, "grub_mod_fini")) && + if ((strcmp (symname, "_VasEBoot_mod_init")) && + (strcmp (symname, "_VasEBoot_mod_fini")) && + (strcmp (symname, "VasEBoot_mod_init")) && + (strcmp (symname, "VasEBoot_mod_fini")) && (bind == STB_LOCAL)) continue; @@ -444,7 +444,7 @@ write_symbol_table (FILE* fp, const char *name, char *image, shdr[symtab_section].sh_link = strtab_section; shdr[symtab_section].sh_addralign = 4; - grub_util_write_image_at (symtab, shdr[symtab_section].sh_size, + VasEBoot_util_write_image_at (symtab, shdr[symtab_section].sh_size, offset, fp, name); offset += shdr[symtab_section].sh_size; @@ -460,7 +460,7 @@ write_string_table (FILE *fp, const char *name) shdr[strtab_section].sh_offset = offset; shdr[strtab_section].sh_size = strtab_len; shdr[strtab_section].sh_addralign = 1; - grub_util_write_image_at (strtab, strtab_len, offset, fp, + VasEBoot_util_write_image_at (strtab, strtab_len, offset, fp, name); offset += strtab_len; @@ -478,7 +478,7 @@ write_section_header (FILE *fp, const char *name) ehdr.e_version = EV_CURRENT; ehdr.e_type = ET_REL; -#if GRUB_TARGET_WORDSIZE == 64 +#if VasEBoot_TARGET_WORDSIZE == 64 ehdr.e_ident[EI_CLASS] = ELFCLASS64; ehdr.e_ident[EI_DATA] = ELFDATA2LSB; ehdr.e_machine = EM_X86_64; @@ -493,26 +493,26 @@ write_section_header (FILE *fp, const char *name) ehdr.e_shoff = offset; ehdr.e_shnum = num_sections; - grub_util_write_image_at (shdr, sizeof (Elf_Shdr) * num_sections, + VasEBoot_util_write_image_at (shdr, sizeof (Elf_Shdr) * num_sections, offset, fp, name); - grub_util_write_image_at (&ehdr, sizeof (Elf_Ehdr), 0, fp, name); + VasEBoot_util_write_image_at (&ehdr, sizeof (Elf_Ehdr), 0, fp, name); } static void convert_pe (FILE* fp, const char *name, char *image) { - struct grub_pe32_coff_header *pe_chdr; - struct grub_pe32_section_table *pe_shdr; + struct VasEBoot_pe32_coff_header *pe_chdr; + struct VasEBoot_pe32_section_table *pe_shdr; int *section_map; if (image[0] == 'M' && image[1] == 'Z') - pe_chdr = (struct grub_pe32_coff_header *) (image + (grub_le_to_cpu32 (((grub_uint32_t *)image)[0xf]) + 4)); + pe_chdr = (struct VasEBoot_pe32_coff_header *) (image + (VasEBoot_le_to_cpu32 (((VasEBoot_uint32_t *)image)[0xf]) + 4)); else - pe_chdr = (struct grub_pe32_coff_header *) image; - if (grub_le_to_cpu16 (pe_chdr->machine) != GRUB_PE32_MACHINE) - grub_util_error ("invalid coff image (%x != %x)", - grub_le_to_cpu16 (pe_chdr->machine), GRUB_PE32_MACHINE); + pe_chdr = (struct VasEBoot_pe32_coff_header *) image; + if (VasEBoot_le_to_cpu16 (pe_chdr->machine) != VasEBoot_PE32_MACHINE) + VasEBoot_util_error ("invalid coff image (%x != %x)", + VasEBoot_le_to_cpu16 (pe_chdr->machine), VasEBoot_PE32_MACHINE); strtab = xmalloc (STRTAB_BLOCK); strtab_max = STRTAB_BLOCK; @@ -522,15 +522,15 @@ convert_pe (FILE* fp, const char *name, char *image) offset = sizeof (ehdr); if (pe_chdr->optional_header_size) { -#if GRUB_TARGET_WORDSIZE == 64 - struct grub_pe64_optional_header *o; +#if VasEBoot_TARGET_WORDSIZE == 64 + struct VasEBoot_pe64_optional_header *o; #else - struct grub_pe32_optional_header *o; + struct VasEBoot_pe32_optional_header *o; #endif o = (void *) (pe_chdr + 1); image_base = o->image_base; } - pe_shdr = (struct grub_pe32_section_table *) ((char *) (pe_chdr + 1) + pe_chdr->optional_header_size); + pe_shdr = (struct VasEBoot_pe32_section_table *) ((char *) (pe_chdr + 1) + pe_chdr->optional_header_size); section_map = write_section_data (fp, name, image, pe_chdr, pe_shdr); @@ -561,11 +561,11 @@ main (int argc, char *argv[]) out = argv[2]; else out = in; - image = grub_util_read_image (in); + image = VasEBoot_util_read_image (in); - fp = grub_util_fopen (out, "wb"); + fp = VasEBoot_util_fopen (out, "wb"); if (! fp) - grub_util_error ("cannot open %s", out); + VasEBoot_util_error ("cannot open %s", out); convert_pe (fp, out, image); diff --git a/util/VasEBoot-probe.c b/util/VasEBoot-probe.c index 8ac527d2f..632707872 100644 --- a/util/VasEBoot-probe.c +++ b/util/VasEBoot-probe.c @@ -1,43 +1,43 @@ -/* grub-probe.c - probe device information for a given path */ +/* VasEBoot-probe.c - probe device information for a given path */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -113,13 +113,13 @@ get_targets_string (void) unsigned i; memcpy (arr, targets, sizeof (targets)); - qsort (arr, ARRAY_SIZE (targets), sizeof (char *), grub_qsort_strcmp); + qsort (arr, ARRAY_SIZE (targets), sizeof (char *), VasEBoot_qsort_strcmp); for (i = 0; i < ARRAY_SIZE (targets); i++) - len += grub_strlen (targets[i]) + 2; + len += VasEBoot_strlen (targets[i]) + 2; ptr = str = xmalloc (len); for (i = 0; i < ARRAY_SIZE (targets); i++) { - ptr = grub_stpcpy (ptr, arr[i]); + ptr = VasEBoot_stpcpy (ptr, arr[i]); *ptr++ = ','; *ptr++ = ' '; } @@ -133,25 +133,25 @@ static void do_print (const char *x, void *data) { char delim = *(const char *) data; - grub_printf ("%s%c", x, delim); + VasEBoot_printf ("%s%c", x, delim); } static void -probe_partmap (grub_disk_t disk, char delim) +probe_partmap (VasEBoot_disk_t disk, char delim) { - grub_partition_t part; - grub_disk_memberlist_t list = NULL, tmp; + VasEBoot_partition_t part; + VasEBoot_disk_memberlist_t list = NULL, tmp; if (disk->partition == NULL) { - grub_util_info ("no partition map found for %s", disk->name); + VasEBoot_util_info ("no partition map found for %s", disk->name); } for (part = disk->partition; part; part = part->parent) printf ("%s%c", part->partmap->name, delim); - if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID) - grub_diskfilter_get_partmap (disk, do_print, &delim); + if (disk->dev->id == VasEBoot_DISK_DEVICE_DISKFILTER_ID) + VasEBoot_diskfilter_get_partmap (disk, do_print, &delim); /* In case of LVM/RAID, check the member devices as well. */ if (disk->dev->memberlist) @@ -168,9 +168,9 @@ probe_partmap (grub_disk_t disk, char delim) } static void -probe_cryptodisk_uuid (grub_disk_t disk, char delim) +probe_cryptodisk_uuid (VasEBoot_disk_t disk, char delim) { - grub_disk_memberlist_t list = NULL, tmp; + VasEBoot_disk_memberlist_t list = NULL, tmp; /* In case of LVM/RAID, check the member devices as well. */ if (disk->dev->memberlist) @@ -184,36 +184,36 @@ probe_cryptodisk_uuid (grub_disk_t disk, char delim) free (list); list = tmp; } - if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID) + if (disk->dev->id == VasEBoot_DISK_DEVICE_CRYPTODISK_ID) { - const char *uu = grub_util_cryptodisk_get_uuid (disk); - grub_printf ("%s%c", uu, delim); + const char *uu = VasEBoot_util_cryptodisk_get_uuid (disk); + VasEBoot_printf ("%s%c", uu, delim); } } static int -probe_raid_level (grub_disk_t disk) +probe_raid_level (VasEBoot_disk_t disk) { /* disk might be NULL in the case of a LVM physical volume with no LVM signature. Ignore such cases here. */ if (!disk) return -1; - if (disk->dev->id != GRUB_DISK_DEVICE_DISKFILTER_ID) + if (disk->dev->id != VasEBoot_DISK_DEVICE_DISKFILTER_ID) return -1; if (disk->name[0] != 'm' || disk->name[1] != 'd') return -1; - if (!((struct grub_diskfilter_lv *) disk->data)->segments) + if (!((struct VasEBoot_diskfilter_lv *) disk->data)->segments) return -1; - return ((struct grub_diskfilter_lv *) disk->data)->segments->type; + return ((struct VasEBoot_diskfilter_lv *) disk->data)->segments->type; } static void -probe_abstraction (grub_disk_t disk, char delim) +probe_abstraction (VasEBoot_disk_t disk, char delim) { - grub_disk_memberlist_t list = NULL, tmp; + VasEBoot_disk_memberlist_t list = NULL, tmp; int raid_level; if (disk->dev->memberlist) @@ -227,17 +227,17 @@ probe_abstraction (grub_disk_t disk, char delim) list = tmp; } - if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID - && (grub_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 || - grub_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0)) + if (disk->dev->id == VasEBoot_DISK_DEVICE_DISKFILTER_ID + && (VasEBoot_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 || + VasEBoot_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0)) printf ("lvm%c", delim); - if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID - && grub_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0) + if (disk->dev->id == VasEBoot_DISK_DEVICE_DISKFILTER_ID + && VasEBoot_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0) printf ("ldm%c", delim); - if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID) - grub_util_cryptodisk_get_abstraction (disk, do_print, &delim); + if (disk->dev->id == VasEBoot_DISK_DEVICE_CRYPTODISK_ID) + VasEBoot_util_cryptodisk_get_abstraction (disk, do_print, &delim); raid_level = probe_raid_level (disk); if (raid_level >= 0) @@ -257,20 +257,20 @@ probe (const char *path, char **device_names, char delim) { char **drives_names = NULL; char **curdev, **curdrive; - char *grub_path = NULL; + char *VasEBoot_path = NULL; int ndev = 0; if (path != NULL) { - grub_path = grub_canonicalize_file_name (path); - if (! grub_path) - grub_util_error (_("failed to get canonical path of `%s'"), path); - device_names = grub_guess_root_devices (grub_path); - free (grub_path); + VasEBoot_path = VasEBoot_canonicalize_file_name (path); + if (! VasEBoot_path) + VasEBoot_util_error (_("failed to get canonical path of `%s'"), path); + device_names = VasEBoot_guess_root_devices (VasEBoot_path); + free (VasEBoot_path); } if (! device_names) - grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), path); + VasEBoot_util_error (_("cannot find a device for %s (is /dev mounted?)"), path); if (print == PRINT_DEVICE) { @@ -287,10 +287,10 @@ probe (const char *path, char **device_names, char delim) for (curdev = device_names; *curdev; curdev++) { char *disk; - disk = grub_util_get_os_disk (*curdev); + disk = VasEBoot_util_get_os_disk (*curdev); if (!disk) { - grub_print_error (); + VasEBoot_print_error (); continue; } printf ("%s", disk); @@ -302,7 +302,7 @@ probe (const char *path, char **device_names, char delim) for (curdev = device_names; *curdev; curdev++) { - grub_util_pull_device (*curdev); + VasEBoot_util_pull_device (*curdev); ndev++; } @@ -311,9 +311,9 @@ probe (const char *path, char **device_names, char delim) for (curdev = device_names, curdrive = drives_names; *curdev; curdev++, curdrive++) { - *curdrive = grub_util_get_grub_dev (*curdev); + *curdrive = VasEBoot_util_get_VasEBoot_dev (*curdev); if (! *curdrive) - grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), + VasEBoot_util_error (_("cannot find a VasEBoot drive for %s. Check your device.map"), *curdev); } *curdrive = 0; @@ -332,55 +332,55 @@ probe (const char *path, char **device_names, char delim) { for (curdev = drives_names; *curdev; curdev++) { - grub_device_t dev = NULL; - grub_uint32_t buffer[32768]; - grub_disk_addr_t addr; - grub_disk_addr_t dsize; + VasEBoot_device_t dev = NULL; + VasEBoot_uint32_t buffer[32768]; + VasEBoot_disk_addr_t addr; + VasEBoot_disk_addr_t dsize; - grub_util_info ("opening %s", *curdev); - dev = grub_device_open (*curdev); + VasEBoot_util_info ("opening %s", *curdev); + dev = VasEBoot_device_open (*curdev); if (! dev || !dev->disk) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - dsize = grub_disk_get_size (dev->disk); + dsize = VasEBoot_disk_get_size (dev->disk); for (addr = 0; addr < dsize; - addr += sizeof (buffer) / GRUB_DISK_SECTOR_SIZE) + addr += sizeof (buffer) / VasEBoot_DISK_SECTOR_SIZE) { - grub_size_t sz = sizeof (buffer); - grub_uint32_t *ptr; + VasEBoot_size_t sz = sizeof (buffer); + VasEBoot_uint32_t *ptr; - if (sizeof (buffer) / GRUB_DISK_SECTOR_SIZE > dsize - addr) - sz = (dsize - addr) * GRUB_DISK_SECTOR_SIZE; - grub_disk_read (dev->disk, addr, 0, sz, buffer); + if (sizeof (buffer) / VasEBoot_DISK_SECTOR_SIZE > dsize - addr) + sz = (dsize - addr) * VasEBoot_DISK_SECTOR_SIZE; + VasEBoot_disk_read (dev->disk, addr, 0, sz, buffer); for (ptr = buffer; ptr < buffer + sz / sizeof (*buffer); ptr++) if (*ptr) { - grub_printf ("false\n"); - grub_device_close (dev); + VasEBoot_printf ("false\n"); + VasEBoot_device_close (dev); goto end; } } - grub_device_close (dev); + VasEBoot_device_close (dev); } - grub_printf ("true\n"); + VasEBoot_printf ("true\n"); } if (print == PRINT_FS || print == PRINT_FS_UUID || print == PRINT_FS_LABEL) { - grub_device_t dev = NULL; - grub_fs_t fs; + VasEBoot_device_t dev = NULL; + VasEBoot_fs_t fs; - grub_util_info ("opening %s", drives_names[0]); - dev = grub_device_open (drives_names[0]); + VasEBoot_util_info ("opening %s", drives_names[0]); + dev = VasEBoot_device_open (drives_names[0]); if (! dev) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); - fs = grub_fs_probe (dev); + fs = VasEBoot_fs_probe (dev); if (! fs) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); if (print == PRINT_FS) { @@ -391,10 +391,10 @@ probe (const char *path, char **device_names, char delim) { char *uuid; if (! fs->uuid) - grub_util_error (_("%s does not support UUIDs"), fs->name); + VasEBoot_util_error (_("%s does not support UUIDs"), fs->name); - if (fs->uuid (dev, &uuid) != GRUB_ERR_NONE) - grub_util_error ("%s", grub_errmsg); + if (fs->uuid (dev, &uuid) != VasEBoot_ERR_NONE) + VasEBoot_util_error ("%s", VasEBoot_errmsg); printf ("%s", uuid); putchar (delim); @@ -403,33 +403,33 @@ probe (const char *path, char **device_names, char delim) { char *label; if (! fs->label) - grub_util_error (_("filesystem `%s' does not support labels"), + VasEBoot_util_error (_("filesystem `%s' does not support labels"), fs->name); - if (fs->label (dev, &label) != GRUB_ERR_NONE) - grub_util_error ("%s", grub_errmsg); + if (fs->label (dev, &label) != VasEBoot_ERR_NONE) + VasEBoot_util_error ("%s", VasEBoot_errmsg); printf ("%s", label); putchar (delim); } - grub_device_close (dev); + VasEBoot_device_close (dev); goto end; } for (curdrive = drives_names, curdev = device_names; *curdrive; curdrive++, curdev++) { - grub_device_t dev = NULL; + VasEBoot_device_t dev = NULL; - grub_util_info ("opening %s", *curdrive); - dev = grub_device_open (*curdrive); + VasEBoot_util_info ("opening %s", *curdrive); + dev = VasEBoot_device_open (*curdrive); if (! dev) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); if (print == PRINT_HINT_STR) { - const char *osdev = grub_util_biosdisk_get_osdev (dev->disk); - char *ofpath = osdev ? grub_util_devname_to_ofpath (osdev) : 0; + const char *osdev = VasEBoot_util_biosdisk_get_osdev (dev->disk); + char *ofpath = osdev ? VasEBoot_util_devname_to_ofpath (osdev) : 0; char *biosname, *bare, *efi; const char *map; @@ -437,49 +437,49 @@ probe (const char *path, char **device_names, char delim) { char *tmp = xmalloc (strlen (ofpath) + sizeof ("ieee1275/")); char *p; - p = grub_stpcpy (tmp, "ieee1275/"); + p = VasEBoot_stpcpy (tmp, "ieee1275/"); strcpy (p, ofpath); printf ("--hint-ieee1275='"); - grub_util_fprint_full_disk_name (stdout, tmp, dev); + VasEBoot_util_fprint_full_disk_name (stdout, tmp, dev); printf ("' "); free (tmp); free (ofpath); } - biosname = grub_util_guess_bios_drive (*curdev); + biosname = VasEBoot_util_guess_bios_drive (*curdev); if (biosname) { printf ("--hint-bios="); - grub_util_fprint_full_disk_name (stdout, biosname, dev); + VasEBoot_util_fprint_full_disk_name (stdout, biosname, dev); printf (" "); } free (biosname); - efi = grub_util_guess_efi_drive (*curdev); + efi = VasEBoot_util_guess_efi_drive (*curdev); if (efi) { printf ("--hint-efi="); - grub_util_fprint_full_disk_name (stdout, efi, dev); + VasEBoot_util_fprint_full_disk_name (stdout, efi, dev); printf (" "); } free (efi); - bare = grub_util_guess_baremetal_drive (*curdev); + bare = VasEBoot_util_guess_baremetal_drive (*curdev); if (bare) { printf ("--hint-baremetal="); - grub_util_fprint_full_disk_name (stdout, bare, dev); + VasEBoot_util_fprint_full_disk_name (stdout, bare, dev); printf (" "); } free (bare); /* FIXME: Add ARC hint. */ - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { printf ("--hint='"); - grub_util_fprint_full_disk_name (stdout, map, dev); + VasEBoot_util_fprint_full_disk_name (stdout, map, dev); printf ("' "); } if (curdrive[1]) @@ -491,9 +491,9 @@ probe (const char *path, char **device_names, char delim) else if ((print == PRINT_COMPATIBILITY_HINT || print == PRINT_BIOS_HINT || print == PRINT_IEEE1275_HINT || print == PRINT_BAREMETAL_HINT || print == PRINT_EFI_HINT || print == PRINT_ARC_HINT) - && dev->disk->dev->id != GRUB_DISK_DEVICE_HOSTDISK_ID) + && dev->disk->dev->id != VasEBoot_DISK_DEVICE_HOSTDISK_ID) { - grub_util_fprint_full_disk_name (stdout, dev->disk->name, dev); + VasEBoot_util_fprint_full_disk_name (stdout, dev->disk->name, dev); putchar (delim); } @@ -501,23 +501,23 @@ probe (const char *path, char **device_names, char delim) { const char *map; char *biosname; - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { - grub_util_fprint_full_disk_name (stdout, map, dev); + VasEBoot_util_fprint_full_disk_name (stdout, map, dev); putchar (delim); - grub_device_close (dev); + VasEBoot_device_close (dev); /* Compatibility hint is one device only. */ break; } - biosname = grub_util_guess_bios_drive (*curdev); + biosname = VasEBoot_util_guess_bios_drive (*curdev); if (biosname) { - grub_util_fprint_full_disk_name (stdout, biosname, dev); + VasEBoot_util_fprint_full_disk_name (stdout, biosname, dev); putchar (delim); free (biosname); /* Compatibility hint is one device only. */ - grub_device_close (dev); + VasEBoot_device_close (dev); break; } } @@ -525,24 +525,24 @@ probe (const char *path, char **device_names, char delim) else if (print == PRINT_BIOS_HINT) { char *biosname; - biosname = grub_util_guess_bios_drive (*curdev); + biosname = VasEBoot_util_guess_bios_drive (*curdev); if (biosname) { - grub_util_fprint_full_disk_name (stdout, biosname, dev); + VasEBoot_util_fprint_full_disk_name (stdout, biosname, dev); putchar (delim); free (biosname); } } else if (print == PRINT_IEEE1275_HINT) { - const char *osdev = grub_util_biosdisk_get_osdev (dev->disk); - char *ofpath = grub_util_devname_to_ofpath (osdev); + const char *osdev = VasEBoot_util_biosdisk_get_osdev (dev->disk); + char *ofpath = VasEBoot_util_devname_to_ofpath (osdev); const char *map; - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { - grub_util_fprint_full_disk_name (stdout, map, dev); + VasEBoot_util_fprint_full_disk_name (stdout, map, dev); putchar (delim); } @@ -550,9 +550,9 @@ probe (const char *path, char **device_names, char delim) { char *tmp = xmalloc (strlen (ofpath) + sizeof ("ieee1275/")); char *p; - p = grub_stpcpy (tmp, "ieee1275/"); + p = VasEBoot_stpcpy (tmp, "ieee1275/"); strcpy (p, ofpath); - grub_util_fprint_full_disk_name (stdout, tmp, dev); + VasEBoot_util_fprint_full_disk_name (stdout, tmp, dev); free (tmp); free (ofpath); putchar (delim); @@ -562,17 +562,17 @@ probe (const char *path, char **device_names, char delim) { char *biosname; const char *map; - biosname = grub_util_guess_efi_drive (*curdev); + biosname = VasEBoot_util_guess_efi_drive (*curdev); - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { - grub_util_fprint_full_disk_name (stdout, map, dev); + VasEBoot_util_fprint_full_disk_name (stdout, map, dev); putchar (delim); } if (biosname) { - grub_util_fprint_full_disk_name (stdout, biosname, dev); + VasEBoot_util_fprint_full_disk_name (stdout, biosname, dev); putchar (delim); free (biosname); } @@ -583,17 +583,17 @@ probe (const char *path, char **device_names, char delim) char *biosname; const char *map; - biosname = grub_util_guess_baremetal_drive (*curdev); + biosname = VasEBoot_util_guess_baremetal_drive (*curdev); - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { - grub_util_fprint_full_disk_name (stdout, map, dev); + VasEBoot_util_fprint_full_disk_name (stdout, map, dev); putchar (delim); } if (biosname) { - grub_util_fprint_full_disk_name (stdout, biosname, dev); + VasEBoot_util_fprint_full_disk_name (stdout, biosname, dev); putchar (delim); free (biosname); } @@ -603,10 +603,10 @@ probe (const char *path, char **device_names, char delim) { const char *map; - map = grub_util_biosdisk_get_compatibility_hint (dev->disk); + map = VasEBoot_util_biosdisk_get_compatibility_hint (dev->disk); if (map) { - grub_util_fprint_full_disk_name (stdout, map, dev); + VasEBoot_util_fprint_full_disk_name (stdout, map, dev); putchar (delim); } } @@ -635,20 +635,20 @@ probe (const char *path, char **device_names, char delim) if (dev->disk->partition && strcmp (dev->disk->partition->partmap->name, "gpt") == 0) { - struct grub_gpt_partentry gptdata; - grub_partition_t p = dev->disk->partition; + struct VasEBoot_gpt_partentry gptdata; + VasEBoot_partition_t p = dev->disk->partition; dev->disk->partition = dev->disk->partition->parent; - if (grub_disk_read (dev->disk, p->offset, p->index, + if (VasEBoot_disk_read (dev->disk, p->offset, p->index, sizeof (gptdata), &gptdata) == 0) { - grub_gpt_part_type_t gpttype; - gpttype.data1 = grub_le_to_cpu32 (gptdata.type.data1); - gpttype.data2 = grub_le_to_cpu16 (gptdata.type.data2); - gpttype.data3 = grub_le_to_cpu16 (gptdata.type.data3); - grub_memcpy (gpttype.data4, gptdata.type.data4, 8); + VasEBoot_gpt_part_type_t gpttype; + gpttype.data1 = VasEBoot_le_to_cpu32 (gptdata.type.data1); + gpttype.data2 = VasEBoot_le_to_cpu16 (gptdata.type.data2); + gpttype.data3 = VasEBoot_le_to_cpu16 (gptdata.type.data3); + VasEBoot_memcpy (gpttype.data4, gptdata.type.data4, 8); - grub_printf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + VasEBoot_printf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", gpttype.data1, gpttype.data2, gpttype.data3, gpttype.data4[0], gpttype.data4[1], gpttype.data4[2], @@ -661,7 +661,7 @@ probe (const char *path, char **device_names, char delim) putchar (delim); } - grub_device_close (dev); + VasEBoot_device_close (dev); } end: @@ -800,7 +800,7 @@ main (int argc, char *argv[]) char delim; struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); memset (&arguments, 0, sizeof (struct arguments)); arguments.device_max = argc + 1; @@ -817,7 +817,7 @@ main (int argc, char *argv[]) } if (verbosity > 1) - grub_env_set ("debug", "all"); + VasEBoot_env_set ("debug", "all"); /* Obtain ARGUMENT. */ if (arguments.ndevices != 1 && !argument_is_device) @@ -831,20 +831,20 @@ main (int argc, char *argv[]) } /* Initialize the emulated biosdisk driver. */ - grub_util_biosdisk_init (arguments.dev_map ? : DEFAULT_DEVICE_MAP); + VasEBoot_util_biosdisk_init (arguments.dev_map ? : DEFAULT_DEVICE_MAP); /* Initialize all modules. */ - grub_init_all (); - grub_gcry_init_all (); + VasEBoot_init_all (); + VasEBoot_gcry_init_all (); - grub_lvm_fini (); - grub_mdraid09_fini (); - grub_mdraid1x_fini (); - grub_diskfilter_fini (); - grub_diskfilter_init (); - grub_mdraid09_init (); - grub_mdraid1x_init (); - grub_lvm_init (); + VasEBoot_lvm_fini (); + VasEBoot_mdraid09_fini (); + VasEBoot_mdraid1x_fini (); + VasEBoot_diskfilter_fini (); + VasEBoot_diskfilter_init (); + VasEBoot_mdraid09_init (); + VasEBoot_mdraid1x_init (); + VasEBoot_lvm_init (); if (print == PRINT_BIOS_HINT || print == PRINT_IEEE1275_HINT || print == PRINT_BAREMETAL_HINT @@ -866,9 +866,9 @@ main (int argc, char *argv[]) putchar ('\n'); /* Free resources. */ - grub_gcry_fini_all (); - grub_fini_all (); - grub_util_biosdisk_fini (); + VasEBoot_gcry_fini_all (); + VasEBoot_fini_all (); + VasEBoot_util_biosdisk_fini (); { size_t i; diff --git a/util/VasEBoot-reboot.in b/util/VasEBoot-reboot.in index 4d4f75704..0a540b447 100644 --- a/util/VasEBoot-reboot.in +++ b/util/VasEBoot-reboot.in @@ -1,20 +1,20 @@ #! /bin/sh # -# Set a default boot entry for GRUB, for the next boot only. +# Set a default boot entry for VasEBoot, for the next boot only. # Copyright (C) 2004,2009 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # Initialize some variables. prefix=@prefix@ @@ -31,33 +31,33 @@ fi self=`basename $0` -grub_editenv=${bindir}/@grub_editenv@ +VasEBoot_editenv=${bindir}/@VasEBoot_editenv@ rootdir= bootdir= -grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` +VasEBootdir=`echo "/@bootdirname@/@VasEBootdirname@" | sed 's,//*,/,g'` export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -. "${pkgdatadir}/grub-mkconfig_lib" +. "${pkgdatadir}/VasEBoot-mkconfig_lib" # Usage: usage # Print the usage. usage () { gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self" - gettext "Set the default boot menu entry for GRUB, for the next boot only."; echo + gettext "Set the default boot menu entry for VasEBoot, for the next boot only."; echo print_option_help "-h, --help" "$(gettext "print this message and exit")" print_option_help "-V, --version" "$(gettext "print the version information and exit")" - dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")" + dirmsg="$(gettext_printf "expect VasEBoot images under the directory DIR/%s instead of the %s directory" "@VasEBootdirname@" "$VasEBootdir")" print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg" echo gettext "MENU_ENTRY is a number, a menu item title or a menu item identifier. Please note that menu items in submenus or sub-submenus require specifying the submenu components and then the menu item component. The titles should be separated using the greater-than character (>) with no extra spaces. Depending on your shell some characters including > may need escaping. More information about this is available -in the GRUB Manual in the section about the 'default' command. "; echo +in the VasEBoot Manual in the section about the 'default' command. "; echo echo - gettext "Report bugs to ."; echo + gettext "Report bugs to ."; echo } argument () { @@ -129,16 +129,16 @@ if [ -z "$bootdir" ]; then fi fi -grubdir=`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'` +VasEBootdir=`echo "${bootdir}/@VasEBootdirname@" | sed 's,//*,/,g'` # Restore saved_entry if it was set by previous version -prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 's/^prev_saved_entry=//p'` +prev_saved_entry=`$VasEBoot_editenv ${VasEBootdir}/VasEBootenv list | sed -n 's/^prev_saved_entry=//p'` if [ "$prev_saved_entry" ]; then - $grub_editenv ${grubdir}/grubenv set saved_entry="$prev_saved_entry" - $grub_editenv ${grubdir}/grubenv unset prev_saved_entry + $VasEBoot_editenv ${VasEBootdir}/VasEBootenv set saved_entry="$prev_saved_entry" + $VasEBoot_editenv ${VasEBootdir}/VasEBootenv unset prev_saved_entry fi -$grub_editenv ${grubdir}/grubenv set next_entry="$entry" +$VasEBoot_editenv ${VasEBootdir}/VasEBootenv set next_entry="$entry" # Bye. exit 0 diff --git a/util/VasEBoot-render-label.c b/util/VasEBoot-render-label.c index ec0923b2e..f3ee1d185 100644 --- a/util/VasEBoot-render-label.c +++ b/util/VasEBoot-render-label.c @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -75,13 +75,13 @@ static struct argp_option options[] = { { 0, 0, 0, 0, 0, 0 } }; -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include static error_t argp_parser (int key, char *arg, struct argp_state *state) @@ -143,7 +143,7 @@ main (int argc, char *argv[]) char *text; struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Check for options. */ memset (&arguments, 0, sizeof (struct arguments)); @@ -163,27 +163,27 @@ main (int argc, char *argv[]) text = arguments.text; else { - FILE *in = grub_util_fopen (arguments.input, "r"); + FILE *in = VasEBoot_util_fopen (arguments.input, "r"); size_t s; if (!in) - grub_util_error (_("cannot open `%s': %s"), arguments.input, + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.input, strerror (errno)); fseek (in, 0, SEEK_END); s = ftell (in); fseek (in, 0, SEEK_SET); text = xmalloc (s + 1); if (fread (text, 1, s, in) != s) - grub_util_error (_("cannot read `%s': %s"), arguments.input, + VasEBoot_util_error (_("cannot read `%s': %s"), arguments.input, strerror (errno)); text[s] = 0; fclose (in); } - grub_init_all (); - grub_hostfs_init (); - grub_host_init (); + VasEBoot_init_all (); + VasEBoot_hostfs_init (); + VasEBoot_host_init (); - grub_util_render_label (arguments.font, + VasEBoot_util_render_label (arguments.font, arguments.bgcolor, arguments.fgcolor, text, diff --git a/util/VasEBoot-script-check.c b/util/VasEBoot-script-check.c index 801b3df4a..cf2b26028 100644 --- a/util/VasEBoot-script-check.c +++ b/util/VasEBoot-script-check.c @@ -1,31 +1,31 @@ -/* grub-script-check.c - check grub script file for syntax errors */ +/* VasEBoot-script-check.c - check VasEBoot script file for syntax errors */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -85,7 +85,7 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp argp = { options, argp_parser, N_("[PATH]"), - N_("Checks GRUB script configuration file for syntax errors."), + N_("Checks VasEBoot script configuration file for syntax errors."), NULL, NULL, NULL }; @@ -98,7 +98,7 @@ struct main_ctx }; /* Helper for main. */ -static grub_err_t +static VasEBoot_err_t get_config_line (char **line, int cont __attribute__ ((unused)), void *data) { struct main_ctx *ctx = data; @@ -111,15 +111,15 @@ get_config_line (char **line, int cont __attribute__ ((unused)), void *data) if (curread == -1) { *line = 0; - grub_errno = GRUB_ERR_READ_ERROR; + VasEBoot_errno = VasEBoot_ERR_READ_ERROR; if (cmdline) free (cmdline); - return grub_errno; + return VasEBoot_errno; } if (ctx->arguments.verbose) - grub_printf ("%s", cmdline); + VasEBoot_printf ("%s", cmdline); for (i = 0; cmdline[i] != '\0'; i++) { @@ -133,7 +133,7 @@ get_config_line (char **line, int cont __attribute__ ((unused)), void *data) } ctx->lineno++; - *line = grub_strdup (cmdline); + *line = VasEBoot_strdup (cmdline); free (cmdline); return 0; @@ -148,9 +148,9 @@ main (int argc, char *argv[]) }; char *input; int found_input = 0, found_cmd = 0; - struct grub_script *script = NULL; + struct VasEBoot_script *script = NULL; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); memset (&ctx.arguments, 0, sizeof (struct arguments)); @@ -168,7 +168,7 @@ main (int argc, char *argv[]) } else { - ctx.file = grub_util_fopen (ctx.arguments.filename, "r"); + ctx.file = VasEBoot_util_fopen (ctx.arguments.filename, "r"); if (! ctx.file) { char *program = xstrdup(program_name); @@ -188,16 +188,16 @@ main (int argc, char *argv[]) break; found_input = 1; - script = grub_script_parse (input, get_config_line, &ctx); + script = VasEBoot_script_parse (input, get_config_line, &ctx); if (script) { if (script->cmd) found_cmd = 1; - grub_script_execute (script); - grub_script_free (script); + VasEBoot_script_execute (script); + VasEBoot_script_free (script); } - grub_free (input); + VasEBoot_free (input); } while (script != 0); if (ctx.file) fclose (ctx.file); diff --git a/util/VasEBoot-set-default.in b/util/VasEBoot-set-default.in index 6036f81e5..a7f95b868 100644 --- a/util/VasEBoot-set-default.in +++ b/util/VasEBoot-set-default.in @@ -1,20 +1,20 @@ #! /bin/sh # -# Set a default boot entry for GRUB. +# Set a default boot entry for VasEBoot. # Copyright (C) 2004,2009 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . # Initialize some variables. prefix=@prefix@ @@ -31,31 +31,31 @@ fi self=`basename $0` -grub_editenv=${bindir}/@grub_editenv@ +VasEBoot_editenv=${bindir}/@VasEBoot_editenv@ rootdir= bootdir= -grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` +VasEBootdir=`echo "/@bootdirname@/@VasEBootdirname@" | sed 's,//*,/,g'` export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -. "${pkgdatadir}/grub-mkconfig_lib" +. "${pkgdatadir}/VasEBoot-mkconfig_lib" # Usage: usage # Print the usage. usage () { gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self" - gettext "Set the default boot menu entry for GRUB."; echo - gettext_printf "This requires setting GRUB_DEFAULT=saved in %s/default/grub.\n" "$sysconfdir" + gettext "Set the default boot menu entry for VasEBoot."; echo + gettext_printf "This requires setting VasEBoot_DEFAULT=saved in %s/default/VasEBoot.\n" "$sysconfdir" echo print_option_help "-h, --help" "$(gettext "print this message and exit")" print_option_help "-V, --version" "$(gettext "print the version information and exit")" - dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")" + dirmsg="$(gettext_printf "expect VasEBoot images under the directory DIR/%s instead of the %s directory" "@VasEBootdirname@" "$VasEBootdir")" print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg" echo gettext "MENU_ENTRY is a number, a menu item title or a menu item identifier."; echo echo - gettext "Report bugs to ."; echo + gettext "Report bugs to ."; echo } argument () { @@ -127,11 +127,11 @@ if [ -z "$bootdir" ]; then fi fi -grubdir=`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'` +VasEBootdir=`echo "${bootdir}/@VasEBootdirname@" | sed 's,//*,/,g'` -$grub_editenv ${grubdir}/grubenv unset prev_saved_entry -$grub_editenv ${grubdir}/grubenv unset next_entry -$grub_editenv ${grubdir}/grubenv set saved_entry="$entry" +$VasEBoot_editenv ${VasEBootdir}/VasEBootenv unset prev_saved_entry +$VasEBoot_editenv ${VasEBootdir}/VasEBootenv unset next_entry +$VasEBoot_editenv ${VasEBootdir}/VasEBootenv set saved_entry="$entry" # Bye. exit 0 diff --git a/util/VasEBoot-setup.c b/util/VasEBoot-setup.c index 993b02068..b931f928b 100644 --- a/util/VasEBoot-setup.c +++ b/util/VasEBoot-setup.c @@ -1,20 +1,20 @@ -/* grub-setup.c - make GRUB usable */ +/* VasEBoot-setup.c - make VasEBoot usable */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -23,21 +23,21 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wmissing-declarations" @@ -51,11 +51,11 @@ * The 'boot' image needs to know the OBP path name of the root * device. It also needs to know the initial block number of * 'core' (which is 'diskboot' concatenated with 'kernel' and - * all the modules, this is created by grub-mkimage). This resulting + * all the modules, this is created by VasEBoot-mkimage). This resulting * 'boot' image is 512 bytes in size and is placed in the second block * of a partition. * - * The initial 'diskboot' block acts as a loader for the actual GRUB + * The initial 'diskboot' block acts as a loader for the actual VasEBoot * kernel. It contains the loading code and then a block list. * * The block list of 'core' starts at the end of the 'diskboot' image @@ -69,7 +69,7 @@ #define DEFAULT_CORE_FILE "core.img" /* Non-printable "keys" for arguments with no short form. - * See grub-core/gnulib/argp.h for details. */ + * See VasEBoot-core/gnulib/argp.h for details. */ enum { NO_RS_CODES_KEY = 0x100, }; @@ -80,7 +80,7 @@ static struct argp_option options[] = { {"core-image", 'c', N_("FILE"), 0, N_("use FILE as the core image [default=%s]"), 0}, {"directory", 'd', N_("DIR"), 0, - N_("use GRUB files in the directory DIR [default=%s]"), 0}, + N_("use VasEBoot files in the directory DIR [default=%s]"), 0}, {"device-map", 'm', N_("FILE"), 0, N_("use FILE as the device map [default=%s]"), 0}, {"force", 'f', 0, 0, @@ -224,7 +224,7 @@ static struct argp argp = { "\n"N_("\ Set up images to boot from DEVICE.\n\ \n\ -You should not normally run this program directly. Use grub-install instead.") +You should not normally run this program directly. Use VasEBoot-install instead.") "\v"N_("\ DEVICE must be an OS device (e.g. /dev/sda)."), NULL, help_filter, NULL @@ -249,7 +249,7 @@ main (int argc, char *argv[]) char *dest_dev = NULL; struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Default option values. */ memset (&arguments, 0, sizeof (struct arguments)); @@ -263,34 +263,34 @@ main (int argc, char *argv[]) exit(1); } -#ifdef GRUB_SETUP_SPARC64 +#ifdef VasEBoot_SETUP_SPARC64 arguments.force = 1; #endif if (verbosity > 1) - grub_env_set ("debug", "all"); + VasEBoot_env_set ("debug", "all"); /* Initialize the emulated biosdisk driver. */ - grub_util_biosdisk_init (arguments.dev_map ? : DEFAULT_DEVICE_MAP); + VasEBoot_util_biosdisk_init (arguments.dev_map ? : DEFAULT_DEVICE_MAP); /* Initialize all modules. */ - grub_init_all (); - grub_gcry_init_all (); + VasEBoot_init_all (); + VasEBoot_gcry_init_all (); - grub_lvm_fini (); - grub_mdraid09_fini (); - grub_mdraid1x_fini (); - grub_diskfilter_fini (); - grub_diskfilter_init (); - grub_mdraid09_init (); - grub_mdraid1x_init (); - grub_lvm_init (); + VasEBoot_lvm_fini (); + VasEBoot_mdraid09_fini (); + VasEBoot_mdraid1x_fini (); + VasEBoot_diskfilter_fini (); + VasEBoot_diskfilter_init (); + VasEBoot_mdraid09_init (); + VasEBoot_mdraid1x_init (); + VasEBoot_lvm_init (); dest_dev = get_device_name (arguments.device); if (! dest_dev) { /* Possibly, the user specified an OS device file. */ - dest_dev = grub_util_get_grub_dev (arguments.device); + dest_dev = VasEBoot_util_get_VasEBoot_dev (arguments.device); if (! dest_dev) { char *program = xstrdup(program_name); @@ -299,18 +299,18 @@ main (int argc, char *argv[]) free(program); exit(1); } - grub_util_info ("transformed OS device `%s' into GRUB device `%s'", + VasEBoot_util_info ("transformed OS device `%s' into VasEBoot device `%s'", arguments.device, dest_dev); } else { /* For simplicity. */ dest_dev = xstrdup (dest_dev); - grub_util_info ("Using `%s' as GRUB device", dest_dev); + VasEBoot_util_info ("Using `%s' as VasEBoot device", dest_dev); } /* Do the real work. */ - GRUB_SETUP_FUNC (arguments.dir ? : DEFAULT_DIRECTORY, + VasEBoot_SETUP_FUNC (arguments.dir ? : DEFAULT_DIRECTORY, arguments.boot_file ? : DEFAULT_BOOT_FILE, arguments.core_file ? : DEFAULT_CORE_FILE, dest_dev, arguments.force, @@ -318,8 +318,8 @@ main (int argc, char *argv[]) arguments.add_rs_codes); /* Free resources. */ - grub_fini_all (); - grub_util_biosdisk_fini (); + VasEBoot_fini_all (); + VasEBoot_util_biosdisk_fini (); free (arguments.boot_file); free (arguments.core_file); diff --git a/util/VasEBoot-syslinux2cfg.c b/util/VasEBoot-syslinux2cfg.c index 85fa0da14..af61c2698 100644 --- a/util/VasEBoot-syslinux2cfg.c +++ b/util/VasEBoot-syslinux2cfg.c @@ -1,29 +1,29 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -32,12 +32,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wmissing-declarations" @@ -56,7 +56,7 @@ struct arguments char *target_cwd; char *output; int verbosity; - grub_syslinux_flavour_t flav; + VasEBoot_syslinux_flavour_t flav; }; static struct argp_option options[] = { @@ -122,14 +122,14 @@ argp_parser (int key, char *arg, struct argp_state *state) return 0; case 'i': - arguments->flav = GRUB_SYSLINUX_ISOLINUX; + arguments->flav = VasEBoot_SYSLINUX_ISOLINUX; break; case 's': - arguments->flav = GRUB_SYSLINUX_SYSLINUX; + arguments->flav = VasEBoot_SYSLINUX_SYSLINUX; break; case 'p': - arguments->flav = GRUB_SYSLINUX_PXELINUX; + arguments->flav = VasEBoot_SYSLINUX_PXELINUX; break; case 'v': @@ -145,7 +145,7 @@ argp_parser (int key, char *arg, struct argp_state *state) static struct argp argp = { options, argp_parser, N_("FILE"), - N_("Transform syslinux config into GRUB one."), + N_("Transform syslinux config into VasEBoot one."), NULL, NULL, NULL }; @@ -154,7 +154,7 @@ main (int argc, char *argv[]) { struct arguments arguments; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); /* Check for options. */ memset (&arguments, 0, sizeof (struct arguments)); @@ -170,25 +170,25 @@ main (int argc, char *argv[]) exit(1); } - grub_init_all (); - grub_hostfs_init (); - grub_host_init (); + VasEBoot_init_all (); + VasEBoot_hostfs_init (); + VasEBoot_host_init (); char *t, *inpfull, *rootfull, *res; - t = grub_canonicalize_file_name (arguments.input); + t = VasEBoot_canonicalize_file_name (arguments.input); if (!t) { - grub_util_error (_("cannot open `%s': %s"), arguments.input, + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.input, strerror (errno)); } inpfull = xasprintf ("(host)/%s", t); free (t); - t = grub_canonicalize_file_name (arguments.root ? : "/"); + t = VasEBoot_canonicalize_file_name (arguments.root ? : "/"); if (!t) { - grub_util_error (_("cannot open `%s': %s"), arguments.root, + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.root, strerror (errno)); } @@ -206,26 +206,26 @@ main (int argc, char *argv[]) cwd = xstrdup ("."); } - t = grub_canonicalize_file_name (arguments.cwd ? : cwd); + t = VasEBoot_canonicalize_file_name (arguments.cwd ? : cwd); if (!t) { - grub_util_error (_("cannot open `%s': %s"), arguments.root, + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.root, strerror (errno)); } cwdfull = xasprintf ("(host)/%s", t); free (t); - res = grub_syslinux_config_file (rootfull, arguments.target_root ? : "/", + res = VasEBoot_syslinux_config_file (rootfull, arguments.target_root ? : "/", cwdfull, arguments.target_cwd ? : cwd, inpfull, arguments.flav); if (!res) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); if (arguments.output) { - FILE *f = grub_util_fopen (arguments.output, "wb"); + FILE *f = VasEBoot_util_fopen (arguments.output, "wb"); if (!f) - grub_util_error (_("cannot open `%s': %s"), arguments.output, + VasEBoot_util_error (_("cannot open `%s': %s"), arguments.output, strerror (errno)); fwrite (res, 1, strlen (res), f); fclose (f); diff --git a/util/VasEBoot.d/00_header.in b/util/VasEBoot.d/00_header.in index 93a90233e..d9713813f 100644 --- a/util/VasEBoot.d/00_header.in +++ b/util/VasEBoot.d/00_header.in @@ -1,63 +1,63 @@ #! /bin/sh set -e -# grub-mkconfig helper script. +# VasEBoot-mkconfig helper script. # Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . prefix="@prefix@" exec_prefix="@exec_prefix@" datarootdir="@datarootdir@" -grub_lang=`echo $LANG | cut -d . -f 1` +VasEBoot_lang=`echo $LANG | cut -d . -f 1` export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -. "$pkgdatadir/grub-mkconfig_lib" +. "$pkgdatadir/VasEBoot-mkconfig_lib" # Do this as early as possible, since other commands might depend on it. # (e.g. the `loadfont' command might need lvm or raid modules) -for i in ${GRUB_PRELOAD_MODULES} ; do +for i in ${VasEBoot_PRELOAD_MODULES} ; do echo "insmod $i" done -if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi -if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi -if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi -if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi +if [ "x${VasEBoot_DEFAULT}" = "x" ] ; then VasEBoot_DEFAULT=0 ; fi +if [ "x${VasEBoot_DEFAULT}" = "xsaved" ] ; then VasEBoot_DEFAULT='${saved_entry}' ; fi +if [ "x${VasEBoot_TIMEOUT}" = "x" ] ; then VasEBoot_TIMEOUT=5 ; fi +if [ "x${VasEBoot_GFXMODE}" = "x" ] ; then VasEBoot_GFXMODE=auto ; fi -if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi -if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi -if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT" ; fi +if [ "x${VasEBoot_DEFAULT_BUTTON}" = "x" ] ; then VasEBoot_DEFAULT_BUTTON="$VasEBoot_DEFAULT" ; fi +if [ "x${VasEBoot_DEFAULT_BUTTON}" = "xsaved" ] ; then VasEBoot_DEFAULT_BUTTON='${saved_entry}' ; fi +if [ "x${VasEBoot_TIMEOUT_BUTTON}" = "x" ] ; then VasEBoot_TIMEOUT_BUTTON="$VasEBoot_TIMEOUT" ; fi cat << EOF -if [ -s \$prefix/grubenv ]; then +if [ -s \$prefix/VasEBootenv ]; then load_env fi EOF -if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then +if [ "x$VasEBoot_BUTTON_CMOS_ADDRESS" != "x" ]; then cat < /dev/null ; then + if is_path_readable_by_VasEBoot "${path}" > /dev/null ; then font_path="${path}" else continue @@ -170,7 +170,7 @@ if [ x\$feature_default_font_path = xy ] ; then else EOF # Make the font accessible - prepare_grub_to_access_device `${grub_probe} --target=device "${font_path}"` + prepare_VasEBoot_to_access_device `${VasEBoot_probe} --target=device "${font_path}"` cat << EOF font="`make_system_path_relative_to_its_root "${font_path}"`" fi @@ -185,7 +185,7 @@ EOF fi cat << EOF - set gfxmode=${GRUB_GFXMODE} + set gfxmode=${VasEBoot_GFXMODE} load_video insmod gfxterm EOF @@ -194,7 +194,7 @@ EOF if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "x" ]; then cat << EOF set locale_dir=\$prefix/locale - set lang=${grub_lang} + set lang=${VasEBoot_lang} insmod gettext EOF fi @@ -204,38 +204,38 @@ fi EOF fi -case x${GRUB_TERMINAL_INPUT} in +case x${VasEBoot_TERMINAL_INPUT} in x) # Just use the native terminal ;; x*) cat << EOF -terminal_input ${GRUB_TERMINAL_INPUT} +terminal_input ${VasEBoot_TERMINAL_INPUT} EOF ;; esac -case x${GRUB_TERMINAL_OUTPUT} in +case x${VasEBoot_TERMINAL_OUTPUT} in x) # Just use the native terminal ;; x*) cat << EOF -terminal_output ${GRUB_TERMINAL_OUTPUT} +terminal_output ${VasEBoot_TERMINAL_OUTPUT} EOF ;; esac if [ "x$gfxterm" = x1 ]; then - if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \ - && is_path_readable_by_grub "$GRUB_THEME"; then - gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2 + if [ "x$VasEBoot_THEME" != x ] && [ -f "$VasEBoot_THEME" ] \ + && is_path_readable_by_VasEBoot "$VasEBoot_THEME"; then + gettext_printf "Found theme: %s\n" "$VasEBoot_THEME" >&2 - prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"` + prepare_VasEBoot_to_access_device `${VasEBoot_probe} --target=device "$VasEBoot_THEME"` cat << EOF insmod gfxmenu EOF - themedir="`dirname "$GRUB_THEME"`" + themedir="`dirname "$VasEBoot_THEME"`" for x in "$themedir"/*.pf2 "$themedir"/f/*.pf2; do if [ -f "$x" ]; then cat << EOF @@ -260,22 +260,22 @@ EOF fi cat << EOF -set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME` +set theme=(\$root)`make_system_path_relative_to_its_root $VasEBoot_THEME` export theme EOF - elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \ - && is_path_readable_by_grub "$GRUB_BACKGROUND"; then - gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2 - case "$GRUB_BACKGROUND" in + elif [ "x$VasEBoot_BACKGROUND" != x ] && [ -f "$VasEBoot_BACKGROUND" ] \ + && is_path_readable_by_VasEBoot "$VasEBoot_BACKGROUND"; then + gettext_printf "Found background: %s\n" "$VasEBoot_BACKGROUND" >&2 + case "$VasEBoot_BACKGROUND" in *.png) reader=png ;; *.tga) reader=tga ;; *.jpg|*.jpeg) reader=jpeg ;; *) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;; esac - prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"` + prepare_VasEBoot_to_access_device `${VasEBoot_probe} --target=device "$VasEBoot_BACKGROUND"` cat << EOF insmod $reader -background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"` +background_image -m stretch `make_system_path_relative_to_its_root "$VasEBoot_BACKGROUND"` EOF fi fi @@ -286,12 +286,12 @@ make_timeout () timeout="${2}" style="${3}" elif [ "x${1}" != "x" ] && [ "x${1}" != "x0" ] ; then - # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme. + # Handle the deprecated VasEBoot_HIDDEN_TIMEOUT scheme. timeout="${1}" if [ "x${2}" != "x0" ] ; then - grub_warn "$(gettext "Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.")" + VasEBoot_warn "$(gettext "Setting VasEBoot_TIMEOUT to a non-zero value when VasEBoot_HIDDEN_TIMEOUT is set is no longer supported.")" fi - if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then + if [ "x${VasEBoot_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then style="hidden" verbose= else @@ -299,7 +299,7 @@ make_timeout () verbose=" --verbose" fi else - # No hidden timeout, so treat as GRUB_TIMEOUT_STYLE=menu + # No hidden timeout, so treat as VasEBoot_TIMEOUT_STYLE=menu timeout="${2}" style="menu" fi @@ -328,29 +328,29 @@ fi EOF } -if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then +if [ "x$VasEBoot_BUTTON_CMOS_ADDRESS" != "x" ]; then cat <. +# along with VasEBoot. If not, see . prefix="@prefix@" exec_prefix="@exec_prefix@" datarootdir="@datarootdir@" -. "$pkgdatadir/grub-mkconfig_lib" +. "$pkgdatadir/VasEBoot-mkconfig_lib" export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" CLASS="--class gnu-linux --class gnu --class os --class xen" -if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then +if [ "x${VasEBoot_DISTRIBUTOR}" = "x" ] ; then OS=GNU/Linux else - OS="${GRUB_DISTRIBUTOR} GNU/Linux" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" + OS="${VasEBoot_DISTRIBUTOR} GNU/Linux" + CLASS="--class $(echo ${VasEBoot_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" fi # loop-AES arranges things so that /dev/loop/X can be our root device, but # the initrds that Linux uses don't like that. -case ${GRUB_DEVICE} in +case ${VasEBoot_DEVICE} in /dev/loop/*|/dev/loop[0-9]) - GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + VasEBoot_DEVICE=`losetup ${VasEBoot_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` ;; esac # btrfs may reside on multiple devices. We cannot pass them as value of root= parameter # and mounting btrfs requires user space scanning, so force UUID in this case. -if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then - LINUX_ROOT_DEVICE=${GRUB_DEVICE} +if [ "x${VasEBoot_DEVICE_UUID}" = "x" ] || [ "x${VasEBoot_DISABLE_LINUX_UUID}" = "xtrue" ] \ + || ! test -e "/dev/disk/by-uuid/${VasEBoot_DEVICE_UUID}" \ + || ( test -e "${VasEBoot_DEVICE}" && uses_abstraction "${VasEBoot_DEVICE}" lvm ); then + LINUX_ROOT_DEVICE=${VasEBoot_DEVICE} else - LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + LINUX_ROOT_DEVICE=UUID=${VasEBoot_DEVICE_UUID} fi -# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT. -if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then - GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}" +# Allow overriding VasEBoot_CMDLINE_LINUX and VasEBoot_CMDLINE_LINUX_DEFAULT. +if [ "${VasEBoot_CMDLINE_LINUX_XEN_REPLACE}" ]; then + VasEBoot_CMDLINE_LINUX="${VasEBoot_CMDLINE_LINUX_XEN_REPLACE}" fi -if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then - GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" +if [ "${VasEBoot_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then + VasEBoot_CMDLINE_LINUX_DEFAULT="${VasEBoot_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" fi -case x"$GRUB_FS" in +case x"$VasEBoot_FS" in xbtrfs) rootsubvol="`make_system_path_relative_to_its_root /`" rootsubvol="${rootsubvol#/}" if [ "x${rootsubvol}" != x ]; then - GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}" + VasEBoot_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${VasEBoot_CMDLINE_LINUX}" fi;; xzfs) - rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` + rpool=`${VasEBoot_probe} --device ${VasEBoot_DEVICE} --target=fs_label 2>/dev/null || true` bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" ;; @@ -86,7 +86,7 @@ linux_entry () args="$5" xen_args="$6" if [ -z "$boot_device_id" ]; then - boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + boot_device_id="$(VasEBoot_get_device_id "${VasEBoot_DEVICE}")" fi if [ x$type != xsimple ] ; then if [ x$type = xrecovery ] ; then @@ -95,42 +95,42 @@ linux_entry () title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")" fi replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" - if [ x"Xen ${xen_version}>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then - quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" - title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" - grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" + if [ x"Xen ${xen_version}>$title" = x"$VasEBoot_ACTUAL_DEFAULT" ]; then + quoted="$(echo "$VasEBoot_ACTUAL_DEFAULT" | VasEBoot_quote)" + title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | VasEBoot_quote)'; fi;" + VasEBoot_warn "$(gettext_printf "Please don't use old title \`%s' for VasEBoot_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$VasEBoot_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" fi - echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + echo "menuentry '$(echo "$title" | VasEBoot_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" else title="$(gettext_printf "%s, with Xen hypervisor" "${os}")" - echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + echo "menuentry '$(echo "$title" | VasEBoot_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" fi if [ x$type != xrecovery ] ; then - save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/" + save_default_entry | VasEBoot_add_tab | sed "s/^/$submenu_indentation/" fi if [ -z "${prepare_boot_cache}" ]; then - prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + prepare_boot_cache="$(prepare_VasEBoot_to_access_device ${VasEBoot_DEVICE_BOOT} | VasEBoot_add_tab)" fi printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})" lmessage="$(gettext_printf "Loading Linux %s ..." ${version})" sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$xmessage" | grub_quote)' - if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then + echo '$(echo "$xmessage" | VasEBoot_quote)' + if [ "\$VasEBoot_platform" = "pc" -o "\$VasEBoot_platform" = "" ]; then xen_rm_opts= else xen_rm_opts="no-real-mode edd=off" fi multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} - echo '$(echo "$lmessage" | grub_quote)' + echo '$(echo "$lmessage" | VasEBoot_quote)' module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' + echo '$(echo "$message" | VasEBoot_quote)' module --nounzip ${rel_dirname}/${initrd} EOF fi @@ -141,7 +141,7 @@ EOF linux_list= for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do - if grub_file_is_not_garbage "$i"; then + if VasEBoot_file_is_not_garbage "$i"; then basename=$(basename $i) version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") dirname=$(dirname $i) @@ -170,7 +170,7 @@ file_is_not_sym () { xen_list= for i in /boot/xen*; do - if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi + if VasEBoot_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi done prepare_boot_cache= boot_device_id= @@ -201,10 +201,10 @@ while [ "x${xen_list}" != "x" ] ; do rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname` xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"` if [ -z "$boot_device_id" ]; then - boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + boot_device_id="$(VasEBoot_get_device_id "${VasEBoot_DEVICE}")" fi if [ "x$is_top_level" != xtrue ]; then - echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" + echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | VasEBoot_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" fi while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` @@ -234,29 +234,29 @@ while [ "x${xen_list}" != "x" ] ; do gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 else # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. - linux_root_device_thisversion=${GRUB_DEVICE} + linux_root_device_thisversion=${VasEBoot_DEVICE} fi - if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then + if [ "x$is_top_level" = xtrue ] && [ "x${VasEBoot_DISABLE_SUBMENU}" != xy ]; then linux_entry "${OS}" "${version}" "${xen_version}" simple \ - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" + "${VasEBoot_CMDLINE_LINUX} ${VasEBoot_CMDLINE_LINUX_DEFAULT}" "${VasEBoot_CMDLINE_XEN} ${VasEBoot_CMDLINE_XEN_DEFAULT}" - submenu_indentation="$grub_tab$grub_tab" + submenu_indentation="$VasEBoot_tab$VasEBoot_tab" if [ -z "$boot_device_id" ]; then - boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + boot_device_id="$(VasEBoot_get_device_id "${VasEBoot_DEVICE}")" fi # TRANSLATORS: %s is replaced with an OS name - echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {" - echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" + echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | VasEBoot_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {" + echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | VasEBoot_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" is_top_level=false fi linux_entry "${OS}" "${version}" "${xen_version}" advanced \ - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" - if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then + "${VasEBoot_CMDLINE_LINUX} ${VasEBoot_CMDLINE_LINUX_DEFAULT}" "${VasEBoot_CMDLINE_XEN} ${VasEBoot_CMDLINE_XEN_DEFAULT}" + if [ "x${VasEBoot_DISABLE_RECOVERY}" != "xtrue" ]; then linux_entry "${OS}" "${version}" "${xen_version}" recovery \ - "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" + "single ${VasEBoot_CMDLINE_LINUX}" "${VasEBoot_CMDLINE_XEN}" fi list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` diff --git a/util/VasEBoot.d/30_os-prober.in b/util/VasEBoot.d/30_os-prober.in index 515a68c7a..e5c32e698 100644 --- a/util/VasEBoot.d/30_os-prober.in +++ b/util/VasEBoot.d/30_os-prober.in @@ -1,21 +1,21 @@ #! /bin/sh set -e -# grub-mkconfig helper script. +# VasEBoot-mkconfig helper script. # Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . prefix="@prefix@" exec_prefix="@exec_prefix@" @@ -24,9 +24,9 @@ datarootdir="@datarootdir@" export TEXTDOMAIN=@PACKAGE@ export TEXTDOMAINDIR="@localedir@" -. "$pkgdatadir/grub-mkconfig_lib" +. "$pkgdatadir/VasEBoot-mkconfig_lib" -if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then +if [ "x${VasEBoot_DISABLE_OS_PROBER}" = "xtrue" ]; then exit 0 fi @@ -52,10 +52,10 @@ osx_entry() { # TRANSLATORS: it refers on the OS residing on device %s onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $bitstr $onstr" | VasEBoot_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(VasEBoot_get_device_id "${DEVICE}")' { EOF - save_default_entry | grub_add_tab - prepare_grub_to_access_device ${DEVICE} | grub_add_tab + save_default_entry | VasEBoot_add_tab + prepare_VasEBoot_to_access_device ${DEVICE} | VasEBoot_add_tab cat << EOF load_video set do_resume=0 @@ -115,14 +115,14 @@ for OS in ${OSPROBED} ; do LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`" BOOT="`echo ${OS} | cut -d ':' -f 4`" - if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then + if UUID="`${VasEBoot_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then EXPUUID="$UUID" if [ x"${DEVICE#*@}" != x ] ; then EXPUUID="${EXPUUID}@${DEVICE#*@}" fi - if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then + if [ "x${VasEBoot_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${VasEBoot_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2 continue fi @@ -148,12 +148,12 @@ for OS in ${OSPROBED} ; do onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | VasEBoot_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(VasEBoot_get_device_id "${DEVICE}")' { EOF - save_default_entry | grub_add_tab - prepare_grub_to_access_device ${DEVICE} | grub_add_tab + save_default_entry | VasEBoot_add_tab + prepare_VasEBoot_to_access_device ${DEVICE} | VasEBoot_add_tab - if [ x"`${grub_probe} --device ${DEVICE} --target=partmap`" = xmsdos ]; then + if [ x"`${VasEBoot_probe} --device ${DEVICE} --target=partmap`" = xmsdos ]; then cat << EOF parttool \${root} hidden- EOF @@ -180,10 +180,10 @@ EOF DEVICE=${DEVICE%@*} onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | VasEBoot_quote)' $CLASS --class os \$menuentry_id_option 'osprober-efi-$(VasEBoot_get_device_id "${DEVICE}")' { EOF save_default_entry | sed -e "s/^/\t/" - prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + prepare_VasEBoot_to_access_device ${DEVICE} | sed -e "s/^/\t/" cat <$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then + if [ x"$title" = x"$VasEBoot_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$VasEBoot_ACTUAL_DEFAULT" ]; then replacement_title="$(echo "Advanced options for ${OS} $onstr" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" - quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" - title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" - grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" + quoted="$(echo "$VasEBoot_ACTUAL_DEFAULT" | VasEBoot_quote)" + title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | VasEBoot_quote)'; fi;" + VasEBoot_warn "$(gettext_printf "Please don't use old title \`%s' for VasEBoot_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$VasEBoot_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" fi done if [ x"$is_top_level" != xtrue ]; then @@ -293,16 +293,16 @@ EOF hurd) onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | VasEBoot_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(VasEBoot_get_device_id "${DEVICE}")' { EOF - save_default_entry | grub_add_tab - prepare_grub_to_access_device ${DEVICE} | grub_add_tab - grub_device="`${grub_probe} --device ${DEVICE} --target=drive`" - mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`" - grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`" - case "${grub_fs}" in - *fs) hurd_fs="${grub_fs}" ;; - *) hurd_fs="${grub_fs}fs" ;; + save_default_entry | VasEBoot_add_tab + prepare_VasEBoot_to_access_device ${DEVICE} | VasEBoot_add_tab + VasEBoot_device="`${VasEBoot_probe} --device ${DEVICE} --target=drive`" + mach_device="`echo "${VasEBoot_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`" + VasEBoot_fs="`${VasEBoot_probe} --device ${DEVICE} --target=fs`" + case "${VasEBoot_fs}" in + *fs) hurd_fs="${VasEBoot_fs}" ;; + *) hurd_fs="${VasEBoot_fs}fs" ;; esac cat << EOF multiboot /boot/gnumach.gz root=device:${mach_device} @@ -321,7 +321,7 @@ EOF menuentry "${LONGNAME} (on ${DEVICE}, Multiboot)" { EOF save_default_entry | sed -e "s/^/\t/" - prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + prepare_VasEBoot_to_access_device ${DEVICE} | sed -e "s/^/\t/" cat << EOF multiboot /boot/image_latest } @@ -329,7 +329,7 @@ EOF ;; *) # TRANSLATORS: %s is replaced by OS name. - gettext_printf "%s is not yet supported by grub-mkconfig.\n" " ${LONGNAME}" >&2 + gettext_printf "%s is not yet supported by VasEBoot-mkconfig.\n" " ${LONGNAME}" >&2 ;; esac done diff --git a/util/VasEBoot.d/README b/util/VasEBoot.d/README index 3ea109d58..3b4a1baca 100644 --- a/util/VasEBoot.d/README +++ b/util/VasEBoot.d/README @@ -8,4 +8,4 @@ All executable files in this directory are processed in shell expansion order. The number namespace in-between is configurable by system installer and/or administrator. For example, you can add an entry to boot another OS as 01_otheros, 11_otheros, etc, depending on the position you want it to occupy in -the menu; and then adjust the default setting via /etc/default/grub. +the menu; and then adjust the default setting via /etc/default/VasEBoot. diff --git a/util/bash-completion.d/Makefile.am b/util/bash-completion.d/Makefile.am index 136287cf1..dda7aa71b 100644 --- a/util/bash-completion.d/Makefile.am +++ b/util/bash-completion.d/Makefile.am @@ -1,6 +1,6 @@ -bash_completion_source = grub-completion.bash.in -bash_completion_script = grub +bash_completion_source = VasEBoot-completion.bash.in +bash_completion_script = VasEBoot EXTRA_DIST = $(bash_completion_source) diff --git a/util/bash-completion.d/VasEBoot-completion.bash.in b/util/bash-completion.d/VasEBoot-completion.bash.in index 44bf135b9..856b2a28a 100644 --- a/util/bash-completion.d/VasEBoot-completion.bash.in +++ b/util/bash-completion.d/VasEBoot-completion.bash.in @@ -1,23 +1,23 @@ # -# Bash completion for grub +# Bash completion for VasEBoot # # Copyright (C) 2010 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . -# bash completion for grub +# along with VasEBoot. If not, see . +# bash completion for VasEBoot -__grub_dir() { +__VasEBoot_dir() { local i c=1 boot_dir for (( c=1; c <= ${#COMP_WORDS[@]}; c++ )); do @@ -32,7 +32,7 @@ __grub_dir() { esac done boot_dir=${boot_dir-/@bootdirname@} - echo "${boot_dir%/}/@grubdirname@" + echo "${boot_dir%/}/@VasEBootdirname@" } @@ -42,7 +42,7 @@ __grub_dir() { # $2 (optional) prefix to add # $3 (optional) current word to complete # $4 (optional) suffix to add -__grubcomp () { +__VasEBootcomp () { local cur="${COMP_WORDS[COMP_CWORD]}" if [ $# -gt 2 ]; then cur="$3" @@ -60,7 +60,7 @@ __grubcomp () { # Function that return long options from the help of the command # - arg: $1 (optional) command to get the long options from -__grub_get_options_from_help () { +__VasEBoot_get_options_from_help () { local prog if [ $# -ge 1 ]; then @@ -80,7 +80,7 @@ __grub_get_options_from_help () { # Function that return long options from the usage of the command # - arg: $1 (optional) command to get the long options from -__grub_get_options_from_usage () { +__VasEBoot_get_options_from_usage () { local prog if [ $# -ge 1 ]; then @@ -100,7 +100,7 @@ __grub_get_options_from_usage () { done } -__grub_get_last_option () { +__VasEBoot_get_last_option () { local i for (( i=$COMP_CWORD-1; i > 0; i-- )); do if [[ "${COMP_WORDS[i]}" == -* ]]; then @@ -110,9 +110,9 @@ __grub_get_last_option () { done } -__grub_list_menuentries () { +__VasEBoot_list_menuentries () { local cur="${COMP_WORDS[COMP_CWORD]}" - local config_file=$(__grub_dir)/grub.cfg + local config_file=$(__VasEBoot_dir)/VasEBoot.cfg if [ -f "$config_file" ];then local IFS=$'\n' @@ -122,10 +122,10 @@ __grub_list_menuentries () { fi } -__grub_list_modules () { - local grub_dir=$(__grub_dir) +__VasEBoot_list_modules () { + local VasEBoot_dir=$(__VasEBoot_dir) local IFS=$'\n' - COMPREPLY=( $( compgen -f -X '!*/*.mod' -- "${grub_dir}/$cur" | { + COMPREPLY=( $( compgen -f -X '!*/*.mod' -- "${VasEBoot_dir}/$cur" | { while read -r tmp; do [ -n $tmp ] && { tmp=${tmp##*/} @@ -137,9 +137,9 @@ __grub_list_modules () { } # -# grub-set-default & grub-reboot +# VasEBoot-set-default & VasEBoot-reboot # -_grub_set_entry () { +_VasEBoot_set_entry () { local cur prev split=false COMPREPLY=() @@ -158,28 +158,28 @@ _grub_set_entry () { $split && return 0 if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a menuentry - __grub_list_menuentries + __VasEBoot_list_menuentries fi } -__grub_set_default_program="@grub_set_default@" -have ${__grub_set_default_program} && \ - complete -F _grub_set_entry -o filenames ${__grub_set_default_program} -unset __grub_set_default_program +__VasEBoot_set_default_program="@VasEBoot_set_default@" +have ${__VasEBoot_set_default_program} && \ + complete -F _VasEBoot_set_entry -o filenames ${__VasEBoot_set_default_program} +unset __VasEBoot_set_default_program -__grub_reboot_program="@grub_reboot@" -have ${__grub_reboot_program} && \ - complete -F _grub_set_entry -o filenames ${__grub_reboot_program} -unset __grub_reboot_program +__VasEBoot_reboot_program="@VasEBoot_reboot@" +have ${__VasEBoot_reboot_program} && \ + complete -F _VasEBoot_set_entry -o filenames ${__VasEBoot_reboot_program} +unset __VasEBoot_reboot_program # -# grub-editenv +# VasEBoot-editenv # -_grub_editenv () { +_VasEBoot_editenv () { local cur prev COMPREPLY=() @@ -193,41 +193,41 @@ _grub_editenv () { ;; esac - __grubcomp "$(__grub_get_options_from_help) + __VasEBootcomp "$(__VasEBoot_get_options_from_help) create list set unset" } -__grub_editenv_program="@grub_editenv@" -have ${__grub_editenv_program} && \ - complete -F _grub_editenv -o filenames ${__grub_editenv_program} -unset __grub_editenv_program +__VasEBoot_editenv_program="@VasEBoot_editenv@" +have ${__VasEBoot_editenv_program} && \ + complete -F _VasEBoot_editenv -o filenames ${__VasEBoot_editenv_program} +unset __VasEBoot_editenv_program # -# grub-mkconfig +# VasEBoot-mkconfig # -_grub_mkconfig () { +_VasEBoot_mkconfig () { local cur prev COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else _filedir fi } -__grub_mkconfig_program="@grub_mkconfig@" -have ${__grub_mkconfig_program} && \ - complete -F _grub_mkconfig -o filenames ${__grub_mkconfig_program} -unset __grub_mkconfig_program +__VasEBoot_mkconfig_program="@VasEBoot_mkconfig@" +have ${__VasEBoot_mkconfig_program} && \ + complete -F _VasEBoot_mkconfig -o filenames ${__VasEBoot_mkconfig_program} +unset __VasEBoot_mkconfig_program # -# grub-setup +# VasEBoot-setup # -_grub_setup () { +_VasEBoot_setup () { local cur prev split=false COMPREPLY=() @@ -246,34 +246,34 @@ _grub_setup () { $split && return 0 if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a filename _filedir fi } -__grub_bios_setup_program="@grub_bios_setup@" -have ${__grub_bios_setup_program} && \ - complete -F _grub_setup -o filenames ${__grub_bios_setup_program} -unset __grub_bios_setup_program +__VasEBoot_bios_setup_program="@VasEBoot_bios_setup@" +have ${__VasEBoot_bios_setup_program} && \ + complete -F _VasEBoot_setup -o filenames ${__VasEBoot_bios_setup_program} +unset __VasEBoot_bios_setup_program -__grub_sparc64_setup_program="@grub_sparc64_setup@" -have ${__grub_sparc64_setup_program} && \ - complete -F _grub_setup -o filenames ${__grub_sparc64_setup_program} -unset __grub_sparc64_setup_program +__VasEBoot_sparc64_setup_program="@VasEBoot_sparc64_setup@" +have ${__VasEBoot_sparc64_setup_program} && \ + complete -F _VasEBoot_setup -o filenames ${__VasEBoot_sparc64_setup_program} +unset __VasEBoot_sparc64_setup_program # -# grub-install +# VasEBoot-install # -_grub_install () { +_VasEBoot_install () { local cur prev last split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - last=$(__grub_get_last_option) + last=$(__VasEBoot_get_last_option) _split_longopt && split=true @@ -283,7 +283,7 @@ _grub_install () { return ;; --disk-module) - __grubcomp "biosdisk ata" + __VasEBootcomp "biosdisk ata" return ;; esac @@ -291,11 +291,11 @@ _grub_install () { $split && return 0 if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else case "$last" in --modules) - __grub_list_modules + __VasEBoot_list_modules return ;; esac @@ -304,51 +304,51 @@ _grub_install () { _filedir fi } -__grub_install_program="@grub_install@" -have ${__grub_install_program} && \ - complete -F _grub_install -o filenames ${__grub_install_program} -unset __grub_install_program +__VasEBoot_install_program="@VasEBoot_install@" +have ${__VasEBoot_install_program} && \ + complete -F _VasEBoot_install -o filenames ${__VasEBoot_install_program} +unset __VasEBoot_install_program # -# grub-mkfont +# VasEBoot-mkfont # -_grub_mkfont () { +_VasEBoot_mkfont () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a filename _filedir fi } -__grub_mkfont_program="@grub_mkfont@" -have ${__grub_mkfont_program} && \ - complete -F _grub_mkfont -o filenames ${__grub_mkfont_program} -unset __grub_mkfont_program +__VasEBoot_mkfont_program="@VasEBoot_mkfont@" +have ${__VasEBoot_mkfont_program} && \ + complete -F _VasEBoot_mkfont -o filenames ${__VasEBoot_mkfont_program} +unset __VasEBoot_mkfont_program # -# grub-mkrescue +# VasEBoot-mkrescue # -_grub_mkrescue () { +_VasEBoot_mkrescue () { local cur prev last COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - last=$(__grub_get_last_option) + last=$(__VasEBoot_get_last_option) if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else case "$last" in --modules) - __grub_list_modules + __VasEBoot_list_modules return ;; esac @@ -357,16 +357,16 @@ _grub_mkrescue () { _filedir fi } -__grub_mkrescue_program="@grub_mkrescue@" -have ${__grub_mkrescue_program} && \ - complete -F _grub_mkrescue -o filenames ${__grub_mkrescue_program} -unset __grub_mkrescue_program +__VasEBoot_mkrescue_program="@VasEBoot_mkrescue@" +have ${__VasEBoot_mkrescue_program} && \ + complete -F _VasEBoot_mkrescue -o filenames ${__VasEBoot_mkrescue_program} +unset __VasEBoot_mkrescue_program # -# grub-mkimage +# VasEBoot-mkimage # -_grub_mkimage () { +_VasEBoot_mkimage () { local cur prev split=false COMPREPLY=() @@ -383,7 +383,7 @@ _grub_mkimage () { -O|--format) # Get available format from help local prog=${COMP_WORDS[0]} - __grubcomp "$(LC_ALL=C $prog --help | \ + __VasEBootcomp "$(LC_ALL=C $prog --help | \ awk -F ":" '/available formats/ { print $2 }' | \ sed 's/, / /g')" return @@ -393,44 +393,44 @@ _grub_mkimage () { $split && return 0 if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a filename _filedir fi } -__grub_mkimage_program="@grub_mkimage@" -have ${__grub_mkimage_program} && \ - complete -F _grub_mkimage -o filenames ${__grub_mkimage_program} -unset __grub_mkimage_program +__VasEBoot_mkimage_program="@VasEBoot_mkimage@" +have ${__VasEBoot_mkimage_program} && \ + complete -F _VasEBoot_mkimage -o filenames ${__VasEBoot_mkimage_program} +unset __VasEBoot_mkimage_program # -# grub-mkpasswd-pbkdf2 +# VasEBoot-mkpasswd-pbkdf2 # -_grub_mkpasswd_pbkdf2 () { +_VasEBoot_mkpasswd_pbkdf2 () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a filename _filedir fi } -__grub_mkpasswd_pbkdf2_program="@grub_mkpasswd_pbkdf2@" -have ${__grub_mkpasswd_pbkdf2_program} && \ - complete -F _grub_mkpasswd_pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program} -unset __grub_mkpasswd_pbkdf2_program +__VasEBoot_mkpasswd_pbkdf2_program="@VasEBoot_mkpasswd_pbkdf2@" +have ${__VasEBoot_mkpasswd_pbkdf2_program} && \ + complete -F _VasEBoot_mkpasswd_pbkdf2 -o filenames ${__VasEBoot_mkpasswd_pbkdf2_program} +unset __VasEBoot_mkpasswd_pbkdf2_program # -# grub-probe +# VasEBoot-probe # -_grub_probe () { +_VasEBoot_probe () { local cur prev split=false COMPREPLY=() @@ -443,7 +443,7 @@ _grub_probe () { -t|--target) # Get target type from help local prog=${COMP_WORDS[0]} - __grubcomp "$(LC_ALL=C $prog --help | \ + __VasEBootcomp "$(LC_ALL=C $prog --help | \ awk -F "[()]" '/--target=/ { print $2 }' | \ sed 's/|/ /g')" return @@ -453,37 +453,37 @@ _grub_probe () { $split && return 0 if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a filename _filedir fi } -__grub_probe_program="@grub_probe@" -have ${__grub_probe_program} && \ - complete -F _grub_probe -o filenames ${__grub_probe_program} -unset __grub_probe_program +__VasEBoot_probe_program="@VasEBoot_probe@" +have ${__VasEBoot_probe_program} && \ + complete -F _VasEBoot_probe -o filenames ${__VasEBoot_probe_program} +unset __VasEBoot_probe_program # -# grub-script-check +# VasEBoot-script-check # -_grub_script_check () { +_VasEBoot_script_check () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then - __grubcomp "$(__grub_get_options_from_help)" + __VasEBootcomp "$(__VasEBoot_get_options_from_help)" else # Default complete with a filename _filedir fi } -__grub_script_check_program="@grub_script_check@" -have ${__grub_script_check_program} && \ - complete -F _grub_script_check -o filenames ${__grub_script_check_program} +__VasEBoot_script_check_program="@VasEBoot_script_check@" +have ${__VasEBoot_script_check_program} && \ + complete -F _VasEBoot_script_check -o filenames ${__VasEBoot_script_check_program} # Local variables: diff --git a/util/bin2h.c b/util/bin2h.c index dd75fb8b7..36031fd10 100644 --- a/util/bin2h.c +++ b/util/bin2h.c @@ -1,18 +1,18 @@ /* * Copyright (C) 2008,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include diff --git a/util/config.c b/util/config.c index ebcdd8f5e..ec00a16f1 100644 --- a/util/config.c +++ b/util/config.c @@ -1,70 +1,70 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include #include -#include -#include +#include +#include void -grub_util_parse_config (FILE *f, struct grub_util_config *cfg, int simple) +VasEBoot_util_parse_config (FILE *f, struct VasEBoot_util_config *cfg, int simple) { char *buffer = NULL; size_t sz = 0; while (getline (&buffer, &sz, f) >= 0) { const char *ptr; - for (ptr = buffer; *ptr && grub_isspace (*ptr); ptr++); - if (grub_strncmp (ptr, "GRUB_ENABLE_CRYPTODISK=", - sizeof ("GRUB_ENABLE_CRYPTODISK=") - 1) == 0) + for (ptr = buffer; *ptr && VasEBoot_isspace (*ptr); ptr++); + if (VasEBoot_strncmp (ptr, "VasEBoot_ENABLE_CRYPTODISK=", + sizeof ("VasEBoot_ENABLE_CRYPTODISK=") - 1) == 0) { - ptr += sizeof ("GRUB_ENABLE_CRYPTODISK=") - 1; + ptr += sizeof ("VasEBoot_ENABLE_CRYPTODISK=") - 1; if (*ptr == '"' || *ptr == '\'') ptr++; if (*ptr == 'y') cfg->is_cryptodisk_enabled = 1; continue; } - if (grub_strncmp (ptr, "GRUB_DISTRIBUTOR=", - sizeof ("GRUB_DISTRIBUTOR=") - 1) == 0) + if (VasEBoot_strncmp (ptr, "VasEBoot_DISTRIBUTOR=", + sizeof ("VasEBoot_DISTRIBUTOR=") - 1) == 0) { char *optr; enum { NONE, SNGLQUOT, DBLQUOT } state; - ptr += sizeof ("GRUB_DISTRIBUTOR=") - 1; + ptr += sizeof ("VasEBoot_DISTRIBUTOR=") - 1; if (simple) { char *ptr2; - free (cfg->grub_distributor); - cfg->grub_distributor = xstrdup (ptr); - for (ptr2 = cfg->grub_distributor - + grub_strlen (cfg->grub_distributor) - 1; - ptr2 >= cfg->grub_distributor + free (cfg->VasEBoot_distributor); + cfg->VasEBoot_distributor = xstrdup (ptr); + for (ptr2 = cfg->VasEBoot_distributor + + VasEBoot_strlen (cfg->VasEBoot_distributor) - 1; + ptr2 >= cfg->VasEBoot_distributor && (*ptr2 == '\r' || *ptr2 == '\n'); ptr2--); ptr2[1] = '\0'; continue; } - free (cfg->grub_distributor); - cfg->grub_distributor = xmalloc (strlen (ptr) + 1); - optr = cfg->grub_distributor; + free (cfg->VasEBoot_distributor); + cfg->VasEBoot_distributor = xmalloc (strlen (ptr) + 1); + optr = cfg->VasEBoot_distributor; state = NONE; for (; *ptr; ptr++) diff --git a/util/editenv.c b/util/editenv.c index c6f8d2298..56f3c42ab 100644 --- a/util/editenv.c +++ b/util/editenv.c @@ -1,30 +1,30 @@ /* editenv.c - tool to edit environment block. */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2008,2009,2010,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -32,7 +32,7 @@ #define DEFAULT_ENVBLK_SIZE 1024 void -grub_util_create_envblk_file (const char *name) +VasEBoot_util_create_envblk_file (const char *name) { FILE *fp; char *buf; @@ -41,25 +41,25 @@ grub_util_create_envblk_file (const char *name) buf = xmalloc (DEFAULT_ENVBLK_SIZE); namenew = xasprintf ("%s.new", name); - fp = grub_util_fopen (namenew, "wb"); + fp = VasEBoot_util_fopen (namenew, "wb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), namenew, + VasEBoot_util_error (_("cannot open `%s': %s"), namenew, strerror (errno)); - memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1); - memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#', - DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1); + memcpy (buf, VasEBoot_ENVBLK_SIGNATURE, sizeof (VasEBoot_ENVBLK_SIGNATURE) - 1); + memset (buf + sizeof (VasEBoot_ENVBLK_SIGNATURE) - 1, '#', + DEFAULT_ENVBLK_SIZE - sizeof (VasEBoot_ENVBLK_SIGNATURE) + 1); if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE) - grub_util_error (_("cannot write to `%s': %s"), namenew, + VasEBoot_util_error (_("cannot write to `%s': %s"), namenew, strerror (errno)); - grub_util_file_sync (fp); + VasEBoot_util_file_sync (fp); free (buf); fclose (fp); - if (grub_util_rename (namenew, name) < 0) - grub_util_error (_("cannot rename the file %s to %s"), namenew, name); + if (VasEBoot_util_rename (namenew, name) < 0) + VasEBoot_util_error (_("cannot rename the file %s to %s"), namenew, name); free (namenew); } diff --git a/util/garbage-gen.c b/util/garbage-gen.c index ccba1bf1c..8146517bb 100644 --- a/util/garbage-gen.c +++ b/util/garbage-gen.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ /* Standard random generator is slow. For FS testing we need just some diff --git a/util/getroot.c b/util/getroot.c index 847406fba..967ced8fd 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -1,20 +1,20 @@ /* getroot.c - Get root device */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -35,10 +35,10 @@ #ifdef HAVE_LIMITS_H #include #endif -#include +#include -#include -#include +#include +#include #ifdef __linux__ #include /* ioctl */ @@ -48,15 +48,15 @@ #include #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) -# include -# include +# include +# include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) #include @@ -74,107 +74,107 @@ # include #endif -grub_disk_addr_t -grub_util_find_partition_start (const char *dev) +VasEBoot_disk_addr_t +VasEBoot_util_find_partition_start (const char *dev) { -#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL +#if VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL struct stat st; - grub_disk_addr_t partition_start; + VasEBoot_disk_addr_t partition_start; if (stat (dev, &st) >= 0 - && grub_util_device_is_mapped_stat (&st) - && grub_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &partition_start)) + && VasEBoot_util_device_is_mapped_stat (&st) + && VasEBoot_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &partition_start)) return partition_start; #endif - return grub_util_find_partition_start_os (dev); + return VasEBoot_util_find_partition_start_os (dev); } void -grub_util_pull_device (const char *os_dev) +VasEBoot_util_pull_device (const char *os_dev) { - enum grub_dev_abstraction_types ab; - ab = grub_util_get_dev_abstraction (os_dev); + enum VasEBoot_dev_abstraction_types ab; + ab = VasEBoot_util_get_dev_abstraction (os_dev); switch (ab) { - case GRUB_DEV_ABSTRACTION_LVM: - grub_util_pull_lvm_by_command (os_dev); + case VasEBoot_DEV_ABSTRACTION_LVM: + VasEBoot_util_pull_lvm_by_command (os_dev); /* Fallthrough - in case that lvm-tools are unavailable. */ - case GRUB_DEV_ABSTRACTION_LUKS: - grub_util_pull_devmapper (os_dev); + case VasEBoot_DEV_ABSTRACTION_LUKS: + VasEBoot_util_pull_devmapper (os_dev); return; default: - if (grub_util_pull_device_os (os_dev, ab)) + if (VasEBoot_util_pull_device_os (os_dev, ab)) return; /* Fallthrough. */ - case GRUB_DEV_ABSTRACTION_NONE: - free (grub_util_biosdisk_get_grub_dev (os_dev)); + case VasEBoot_DEV_ABSTRACTION_NONE: + free (VasEBoot_util_biosdisk_get_VasEBoot_dev (os_dev)); return; } } char * -grub_util_get_grub_dev (const char *os_dev) +VasEBoot_util_get_VasEBoot_dev (const char *os_dev) { char *ret; - grub_util_pull_device (os_dev); + VasEBoot_util_pull_device (os_dev); - ret = grub_util_get_devmapper_grub_dev (os_dev); + ret = VasEBoot_util_get_devmapper_VasEBoot_dev (os_dev); if (ret) return ret; - ret = grub_util_get_grub_dev_os (os_dev); + ret = VasEBoot_util_get_VasEBoot_dev_os (os_dev); if (ret) return ret; - return grub_util_biosdisk_get_grub_dev (os_dev); + return VasEBoot_util_biosdisk_get_VasEBoot_dev (os_dev); } int -grub_util_get_dev_abstraction (const char *os_dev) +VasEBoot_util_get_dev_abstraction (const char *os_dev) { - enum grub_dev_abstraction_types ret; + enum VasEBoot_dev_abstraction_types ret; /* User explicitly claims that this drive is visible by BIOS. */ - if (grub_util_biosdisk_is_present (os_dev)) - return GRUB_DEV_ABSTRACTION_NONE; + if (VasEBoot_util_biosdisk_is_present (os_dev)) + return VasEBoot_DEV_ABSTRACTION_NONE; /* Check for LVM and LUKS. */ - ret = grub_util_get_dm_abstraction (os_dev); + ret = VasEBoot_util_get_dm_abstraction (os_dev); - if (ret != GRUB_DEV_ABSTRACTION_NONE) + if (ret != VasEBoot_DEV_ABSTRACTION_NONE) return ret; - return grub_util_get_dev_abstraction_os (os_dev); + return VasEBoot_util_get_dev_abstraction_os (os_dev); } static char * convert_system_partition_to_system_disk (const char *os_dev, int *is_part) { -#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL +#if VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL struct stat st; if (stat (os_dev, &st) < 0) { const char *errstr = strerror (errno); - grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot stat `%s': %s"), + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, N_("cannot stat `%s': %s"), os_dev, errstr); - grub_util_info (_("cannot stat `%s': %s"), os_dev, errstr); + VasEBoot_util_info (_("cannot stat `%s': %s"), os_dev, errstr); return 0; } *is_part = 0; - if (grub_util_device_is_mapped_stat (&st)) - return grub_util_devmapper_part_to_disk (&st, is_part, os_dev); + if (VasEBoot_util_device_is_mapped_stat (&st)) + return VasEBoot_util_devmapper_part_to_disk (&st, is_part, os_dev); *is_part = 0; - return grub_util_part_to_disk (os_dev, &st, is_part); + return VasEBoot_util_part_to_disk (os_dev, &st, is_part); #else *is_part = 0; - return grub_util_part_to_disk (os_dev, NULL, is_part); + return VasEBoot_util_part_to_disk (os_dev, NULL, is_part); #endif } @@ -189,7 +189,7 @@ find_system_device (const char *os_dev) if (! os_disk) return NULL; - drive = grub_hostdisk_os_dev_to_grub_drive (os_disk, 0); + drive = VasEBoot_hostdisk_os_dev_to_VasEBoot_drive (os_disk, 0); free (os_disk); return drive; } @@ -214,38 +214,38 @@ make_device_name (const char *drive) } char * -grub_util_get_os_disk (const char *os_dev) +VasEBoot_util_get_os_disk (const char *os_dev) { int is_part; - grub_util_info ("Looking for %s", os_dev); + VasEBoot_util_info ("Looking for %s", os_dev); return convert_system_partition_to_system_disk (os_dev, &is_part); } #if !defined(__APPLE__) -/* Context for grub_util_biosdisk_get_grub_dev. */ -struct grub_util_biosdisk_get_grub_dev_ctx +/* Context for VasEBoot_util_biosdisk_get_VasEBoot_dev. */ +struct VasEBoot_util_biosdisk_get_VasEBoot_dev_ctx { char *partname; - grub_disk_addr_t start; + VasEBoot_disk_addr_t start; }; -/* Helper for grub_util_biosdisk_get_grub_dev. */ +/* Helper for VasEBoot_util_biosdisk_get_VasEBoot_dev. */ static int -find_partition (grub_disk_t dsk __attribute__ ((unused)), - const grub_partition_t partition, void *data) +find_partition (VasEBoot_disk_t dsk __attribute__ ((unused)), + const VasEBoot_partition_t partition, void *data) { - struct grub_util_biosdisk_get_grub_dev_ctx *ctx = data; - grub_disk_addr_t part_start = 0; - grub_util_info ("Partition %d starts from %" GRUB_HOST_PRIuLONG_LONG, + struct VasEBoot_util_biosdisk_get_VasEBoot_dev_ctx *ctx = data; + VasEBoot_disk_addr_t part_start = 0; + VasEBoot_util_info ("Partition %d starts from %" VasEBoot_HOST_PRIuLONG_LONG, partition->number, (unsigned long long) partition->start); - part_start = grub_partition_get_start (partition); + part_start = VasEBoot_partition_get_start (partition); if (ctx->start == part_start) { - ctx->partname = grub_partition_get_name (partition); + ctx->partname = VasEBoot_partition_get_name (partition); return 1; } @@ -254,22 +254,22 @@ find_partition (grub_disk_t dsk __attribute__ ((unused)), #endif char * -grub_util_biosdisk_get_grub_dev (const char *os_dev) +VasEBoot_util_biosdisk_get_VasEBoot_dev (const char *os_dev) { const char *drive; char *sys_disk; int is_part; - grub_util_info ("Looking for %s", os_dev); + VasEBoot_util_info ("Looking for %s", os_dev); sys_disk = convert_system_partition_to_system_disk (os_dev, &is_part); if (!sys_disk) return 0; - drive = grub_hostdisk_os_dev_to_grub_drive (sys_disk, 1); + drive = VasEBoot_hostdisk_os_dev_to_VasEBoot_drive (sys_disk, 1); - grub_util_info ("%s is a parent of %s", sys_disk, os_dev); + VasEBoot_util_info ("%s is a parent of %s", sys_disk, os_dev); if (!is_part) { free (sys_disk); @@ -287,9 +287,9 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) const char *p; char *dri, *ret; int part; - int disk = (grub_memcmp (os_dev, "/dev/disk", sizeof ("/dev/disk") - 1) + int disk = (VasEBoot_memcmp (os_dev, "/dev/disk", sizeof ("/dev/disk") - 1) == 0); - int rdisk = (grub_memcmp (os_dev, "/dev/rdisk", sizeof ("/dev/rdisk") - 1) + int rdisk = (VasEBoot_memcmp (os_dev, "/dev/rdisk", sizeof ("/dev/rdisk") - 1) == 0); dri = make_device_name (drive); @@ -317,9 +317,9 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) #else /* Linux counts partitions uniformly, whether a BSD partition or a DOS - partition, so mapping them to GRUB devices is not trivial. + partition, so mapping them to VasEBoot devices is not trivial. Here, get the start sector of a partition by HDIO_GETGEO, and - compare it with each partition GRUB recognizes. + compare it with each partition VasEBoot recognizes. Cygwin /dev/sdXN emulation uses Windows partition mapping. It does not count the extended partition and missing primary @@ -329,13 +329,13 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) sector is obtained from the disk label. */ { char *name; - grub_disk_t disk; - struct grub_util_biosdisk_get_grub_dev_ctx ctx; + VasEBoot_disk_t disk; + struct VasEBoot_util_biosdisk_get_VasEBoot_dev_ctx ctx; name = make_device_name (drive); - ctx.start = grub_util_find_partition_start (os_dev); - if (grub_errno != GRUB_ERR_NONE) + ctx.start = VasEBoot_util_find_partition_start (os_dev); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { free (name); return 0; @@ -349,7 +349,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) * Note: we do not use the new partition naming scheme as dos_part does not * necessarily correspond to an msdos partition. */ - if (ctx.start == (grub_disk_addr_t) -1) + if (ctx.start == (VasEBoot_disk_addr_t) -1) { char *p; char *dri; @@ -364,7 +364,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) p++; n = strtol (p, &q, 10); - if (p != q && n > 0 && n != GRUB_LONG_MAX) + if (p != q && n > 0 && n != VasEBoot_LONG_MAX) { char *t; t = dri; @@ -380,31 +380,31 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) } #endif - grub_util_info ("%s starts from %" GRUB_HOST_PRIuLONG_LONG, + VasEBoot_util_info ("%s starts from %" VasEBoot_HOST_PRIuLONG_LONG, os_dev, (unsigned long long) ctx.start); - grub_util_info ("opening the device %s", name); - disk = grub_disk_open (name); + VasEBoot_util_info ("opening the device %s", name); + disk = VasEBoot_disk_open (name); free (name); if (! disk) { /* We already know that the partition exists. Given that we already checked the device map above, we can only get - GRUB_ERR_UNKNOWN_DEVICE at this point if the disk does not exist. + VasEBoot_ERR_UNKNOWN_DEVICE at this point if the disk does not exist. This can happen on Xen, where disk images in the host can be assigned to devices that have partition-like names in the guest but are really more like disks. */ - if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE) + if (VasEBoot_errno == VasEBoot_ERR_UNKNOWN_DEVICE) { char *canon; - grub_util_warn + VasEBoot_util_warn (_("disk does not exist, so falling back to partition device %s"), os_dev); - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - canon = grub_canonicalize_file_name (os_dev); - drive = grub_hostdisk_os_dev_to_grub_drive (canon ? : os_dev, 1); + canon = VasEBoot_canonicalize_file_name (os_dev); + drive = VasEBoot_hostdisk_os_dev_to_VasEBoot_drive (canon ? : os_dev, 1); if (canon) free (canon); return make_device_name (drive); @@ -413,34 +413,34 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return 0; } - name = grub_util_get_ldm (disk, ctx.start); + name = VasEBoot_util_get_ldm (disk, ctx.start); if (name) { - grub_disk_close (disk); + VasEBoot_disk_close (disk); return name; } ctx.partname = NULL; - grub_partition_iterate (disk, find_partition, &ctx); - if (grub_errno != GRUB_ERR_NONE) + VasEBoot_partition_iterate (disk, find_partition, &ctx); + if (VasEBoot_errno != VasEBoot_ERR_NONE) { - grub_disk_close (disk); + VasEBoot_disk_close (disk); return 0; } if (ctx.partname == NULL) { - grub_disk_close (disk); - grub_util_info ("cannot find the partition of `%s'", os_dev); - grub_error (GRUB_ERR_BAD_DEVICE, + VasEBoot_disk_close (disk); + VasEBoot_util_info ("cannot find the partition of `%s'", os_dev); + VasEBoot_error (VasEBoot_ERR_BAD_DEVICE, "cannot find the partition of `%s'", os_dev); return 0; } - name = grub_xasprintf ("%s,%s", disk->name, ctx.partname); + name = VasEBoot_xasprintf ("%s,%s", disk->name, ctx.partname); free (ctx.partname); - grub_disk_close (disk); + VasEBoot_disk_close (disk); return name; } @@ -448,10 +448,10 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) } int -grub_util_biosdisk_is_present (const char *os_dev) +VasEBoot_util_biosdisk_is_present (const char *os_dev) { int ret = (find_system_device (os_dev) != NULL); - grub_util_info ((ret ? "%s is present" : "%s is not present"), + VasEBoot_util_info ((ret ? "%s is present" : "%s is not present"), os_dev); return ret; } @@ -466,7 +466,7 @@ fini_libzfs (void) } libzfs_handle_t * -grub_get_libzfs_handle (void) +VasEBoot_get_libzfs_handle (void) { if (! __libzfs_handle) { diff --git a/util/glue-efi.c b/util/glue-efi.c index 68f53168b..2893eced7 100644 --- a/util/glue-efi.c +++ b/util/glue-efi.c @@ -1,28 +1,28 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -36,9 +36,9 @@ static void write_fat (FILE *in32, FILE *in64, FILE *out, const char *out_filename, const char *name32, const char *name64) { - struct grub_macho_fat_header head; - struct grub_macho_fat_arch arch32, arch64; - grub_uint32_t size32, size64; + struct VasEBoot_macho_fat_header head; + struct VasEBoot_macho_fat_arch arch32, arch64; + VasEBoot_uint32_t size32, size64; char *buf; fseek (in32, 0, SEEK_END); @@ -48,86 +48,86 @@ write_fat (FILE *in32, FILE *in64, FILE *out, const char *out_filename, size64 = ftell (in64); fseek (in64, 0, SEEK_SET); - head.magic = grub_cpu_to_le32_compile_time (GRUB_MACHO_FAT_EFI_MAGIC); - head.nfat_arch = grub_cpu_to_le32_compile_time (2); - arch32.cputype = grub_cpu_to_le32_compile_time (GRUB_MACHO_CPUTYPE_IA32); - arch32.cpusubtype = grub_cpu_to_le32_compile_time (3); - arch32.offset = grub_cpu_to_le32_compile_time (sizeof (head) + head.magic = VasEBoot_cpu_to_le32_compile_time (VasEBoot_MACHO_FAT_EFI_MAGIC); + head.nfat_arch = VasEBoot_cpu_to_le32_compile_time (2); + arch32.cputype = VasEBoot_cpu_to_le32_compile_time (VasEBoot_MACHO_CPUTYPE_IA32); + arch32.cpusubtype = VasEBoot_cpu_to_le32_compile_time (3); + arch32.offset = VasEBoot_cpu_to_le32_compile_time (sizeof (head) + sizeof (arch32) + sizeof (arch64)); - arch32.size = grub_cpu_to_le32 (size32); + arch32.size = VasEBoot_cpu_to_le32 (size32); arch32.align = 0; - arch64.cputype = grub_cpu_to_le32_compile_time (GRUB_MACHO_CPUTYPE_AMD64); - arch64.cpusubtype = grub_cpu_to_le32_compile_time (3); - arch64.offset = grub_cpu_to_le32 (sizeof (head) + sizeof (arch32) + arch64.cputype = VasEBoot_cpu_to_le32_compile_time (VasEBoot_MACHO_CPUTYPE_AMD64); + arch64.cpusubtype = VasEBoot_cpu_to_le32_compile_time (3); + arch64.offset = VasEBoot_cpu_to_le32 (sizeof (head) + sizeof (arch32) + sizeof (arch64) + size32); - arch64.size = grub_cpu_to_le32 (size64); + arch64.size = VasEBoot_cpu_to_le32 (size64); arch64.align = 0; if (fwrite (&head, 1, sizeof (head), out) != sizeof (head) || fwrite (&arch32, 1, sizeof (arch32), out) != sizeof (arch32) || fwrite (&arch64, 1, sizeof (arch64), out) != sizeof (arch64)) { if (out_filename) - grub_util_error ("cannot write to `%s': %s", + VasEBoot_util_error ("cannot write to `%s': %s", out_filename, strerror (errno)); else - grub_util_error ("cannot write to the stdout: %s", strerror (errno)); + VasEBoot_util_error ("cannot write to the stdout: %s", strerror (errno)); } buf = xmalloc (size32); if (fread (buf, 1, size32, in32) != size32) - grub_util_error (_("cannot read `%s': %s"), name32, + VasEBoot_util_error (_("cannot read `%s': %s"), name32, strerror (errno)); if (fwrite (buf, 1, size32, out) != size32) { if (out_filename) - grub_util_error ("cannot write to `%s': %s", + VasEBoot_util_error ("cannot write to `%s': %s", out_filename, strerror (errno)); else - grub_util_error ("cannot write to the stdout: %s", strerror (errno)); + VasEBoot_util_error ("cannot write to the stdout: %s", strerror (errno)); } free (buf); buf = xmalloc (size64); if (fread (buf, 1, size64, in64) != size64) - grub_util_error (_("cannot read `%s': %s"), name64, + VasEBoot_util_error (_("cannot read `%s': %s"), name64, strerror (errno)); if (fwrite (buf, 1, size64, out) != size64) { if (out_filename) - grub_util_error ("cannot write to `%s': %s", + VasEBoot_util_error ("cannot write to `%s': %s", out_filename, strerror (errno)); else - grub_util_error ("cannot write to the stdout: %s", strerror (errno)); + VasEBoot_util_error ("cannot write to the stdout: %s", strerror (errno)); } free (buf); } void -grub_util_glue_efi (const char *file32, const char *file64, const char *outname) +VasEBoot_util_glue_efi (const char *file32, const char *file64, const char *outname) { FILE *in32, *in64, *out; - in32 = grub_util_fopen (file32, "r"); + in32 = VasEBoot_util_fopen (file32, "r"); if (!in32) - grub_util_error (_("cannot open `%s': %s"), file32, + VasEBoot_util_error (_("cannot open `%s': %s"), file32, strerror (errno)); - in64 = grub_util_fopen (file64, "r"); + in64 = VasEBoot_util_fopen (file64, "r"); if (!in64) - grub_util_error (_("cannot open `%s': %s"), file64, + VasEBoot_util_error (_("cannot open `%s': %s"), file64, strerror (errno)); if (outname) - out = grub_util_fopen (outname, "wb"); + out = VasEBoot_util_fopen (outname, "wb"); else out = stdout; if (!out) { - grub_util_error (_("cannot open `%s': %s"), outname ? : "stdout", + VasEBoot_util_error (_("cannot open `%s': %s"), outname ? : "stdout", strerror (errno)); } diff --git a/util/i386/efi/VasEBoot-dumpdevtree b/util/i386/efi/VasEBoot-dumpdevtree index 51004cc85..eaf56ab86 100644 --- a/util/i386/efi/VasEBoot-dumpdevtree +++ b/util/i386/efi/VasEBoot-dumpdevtree @@ -2,18 +2,18 @@ # # Copyright (C) 2009 Free Software Foundation, Inc. # -# GRUB is free software: you can redistribute it and/or modify +# VasEBoot 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, +# VasEBoot 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 . +# along with VasEBoot. If not, see . if [ "x$1" = "x" ]; then echo "Filename required". diff --git a/util/ieee1275/VasEBoot-ofpathname.c b/util/ieee1275/VasEBoot-ofpathname.c index 8e5d766cb..b60acdad0 100644 --- a/util/ieee1275/VasEBoot-ofpathname.c +++ b/util/ieee1275/VasEBoot-ofpathname.c @@ -1,28 +1,28 @@ -/* grub-ofpathname.c - Find OpenBOOT path for a given device */ +/* VasEBoot-ofpathname.c - Find OpenBOOT path for a given device */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include +#include +#include -#include +#include #include "progname.h" @@ -32,7 +32,7 @@ int main(int argc, char **argv) { char *of_path; - grub_util_host_init (&argc, &argv); + VasEBoot_util_host_init (&argc, &argv); if (argc != 2 || strcmp (argv[1], "--help") == 0) { @@ -45,7 +45,7 @@ int main(int argc, char **argv) return 1; } - of_path = grub_util_devname_to_ofpath (argv[1]); + of_path = VasEBoot_util_devname_to_ofpath (argv[1]); printf("%s\n", of_path); free (of_path); diff --git a/util/import_gcry.py b/util/import_gcry.py index 2b3322d3a..1fbcaa70e 100644 --- a/util/import_gcry.py +++ b/util/import_gcry.py @@ -1,19 +1,19 @@ #* -#* GRUB -- GRand Unified Bootloader +#* VasEBoot -- GRand Unified Bootloader #* Copyright (C) 2009 Free Software Foundation, Inc. #* -#* GRUB is free software: you can redistribute it and/or modify +#* VasEBoot 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, +#* VasEBoot 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 . +#* along with VasEBoot. If not, see . #* import re @@ -28,7 +28,7 @@ if len (sys.argv) < 3: indir = sys.argv[1] outdir = sys.argv[2] -basedir = os.path.join (outdir, "lib/libgcrypt-grub") +basedir = os.path.join (outdir, "lib/libgcrypt-VasEBoot") try: os.makedirs (basedir) except: @@ -52,15 +52,15 @@ except: print ("WARNING: %s already exists" % srcdir) cipher_files = sorted (os.listdir (cipher_dir_in)) -conf = codecs.open (os.path.join ("grub-core", "Makefile.gcry.def"), "w", "utf-8") +conf = codecs.open (os.path.join ("VasEBoot-core", "Makefile.gcry.def"), "w", "utf-8") conf.write ("AutoGen definitions Makefile.tpl;\n\n") confutil = codecs.open ("Makefile.utilgcry.def", "w", "utf-8") confutil.write ("AutoGen definitions Makefile.tpl;\n\n") confutil.write ("library = {\n"); -confutil.write (" name = libgrubgcry.a;\n"); +confutil.write (" name = libVasEBootgcry.a;\n"); confutil.write (" cflags = '$(CFLAGS_GCRY)';\n"); confutil.write (" cppflags = '$(CPPFLAGS_GCRY)';\n"); -confutil.write (" extra_dist = grub-core/lib/libgcrypt-grub/cipher/ChangeLog;\n"); +confutil.write (" extra_dist = VasEBoot-core/lib/libgcrypt-VasEBoot/cipher/ChangeLog;\n"); confutil.write ("\n"); chlog = "" modules_sym_md = [] @@ -118,22 +118,22 @@ for cipher_file in cipher_files: fw = codecs.open (outfile, "w", "utf-8") fw.write ("/* This file was automatically imported with \n") fw.write (" import_gcry.py. Please don't modify it */\n") - fw.write ("#include \n") + fw.write ("#include \n") if cipher_file == "camellia.h": - fw.write ("#include \n") - fw.write ("void camellia_setup128(const unsigned char *key, grub_uint32_t *subkey);\n") - fw.write ("void camellia_setup192(const unsigned char *key, grub_uint32_t *subkey);\n") - fw.write ("void camellia_setup256(const unsigned char *key, grub_uint32_t *subkey);\n") - fw.write ("void camellia_encrypt128(const grub_uint32_t *subkey, grub_uint32_t *io);\n") - fw.write ("void camellia_encrypt192(const grub_uint32_t *subkey, grub_uint32_t *io);\n") - fw.write ("void camellia_encrypt256(const grub_uint32_t *subkey, grub_uint32_t *io);\n") - fw.write ("void camellia_decrypt128(const grub_uint32_t *subkey, grub_uint32_t *io);\n") - fw.write ("void camellia_decrypt192(const grub_uint32_t *subkey, grub_uint32_t *io);\n") - fw.write ("void camellia_decrypt256(const grub_uint32_t *subkey, grub_uint32_t *io);\n") - fw.write ("#define memcpy grub_memcpy\n") + fw.write ("#include \n") + fw.write ("void camellia_setup128(const unsigned char *key, VasEBoot_uint32_t *subkey);\n") + fw.write ("void camellia_setup192(const unsigned char *key, VasEBoot_uint32_t *subkey);\n") + fw.write ("void camellia_setup256(const unsigned char *key, VasEBoot_uint32_t *subkey);\n") + fw.write ("void camellia_encrypt128(const VasEBoot_uint32_t *subkey, VasEBoot_uint32_t *io);\n") + fw.write ("void camellia_encrypt192(const VasEBoot_uint32_t *subkey, VasEBoot_uint32_t *io);\n") + fw.write ("void camellia_encrypt256(const VasEBoot_uint32_t *subkey, VasEBoot_uint32_t *io);\n") + fw.write ("void camellia_decrypt128(const VasEBoot_uint32_t *subkey, VasEBoot_uint32_t *io);\n") + fw.write ("void camellia_decrypt192(const VasEBoot_uint32_t *subkey, VasEBoot_uint32_t *io);\n") + fw.write ("void camellia_decrypt256(const VasEBoot_uint32_t *subkey, VasEBoot_uint32_t *io);\n") + fw.write ("#define memcpy VasEBoot_memcpy\n") # Whole libgcrypt is distributed under GPLv3+ or compatible if isc: - fw.write ("GRUB_MOD_LICENSE (\"GPLv3+\");\n") + fw.write ("VasEBoot_MOD_LICENSE (\"GPLv3+\");\n") ciphernames = [] mdnames = [] @@ -185,7 +185,7 @@ for cipher_file in cipher_files: if not re.search (" *};", line) is None: if not iscomma: fw.write (" ,\n") - fw.write ("#ifdef GRUB_UTIL\n"); + fw.write ("#ifdef VasEBoot_UTIL\n"); fw.write (" .modname = \"%s\",\n" % modname); fw.write ("#endif\n"); if ismd: @@ -422,52 +422,52 @@ for cipher_file in cipher_files: fw.write (line) if len (ciphernames) > 0 or len (mdnames) > 0 or len (pknames) > 0: if isglue: - modfiles = "lib/libgcrypt-grub/cipher/%s lib/libgcrypt-grub/cipher/%s" \ + modfiles = "lib/libgcrypt-VasEBoot/cipher/%s lib/libgcrypt-VasEBoot/cipher/%s" \ % (cipher_file, cipher_file.replace ("-glue.c", ".c")) else: - modfiles = "lib/libgcrypt-grub/cipher/%s" % cipher_file + modfiles = "lib/libgcrypt-VasEBoot/cipher/%s" % cipher_file if len (ciphernames) > 0 or len (mdnames) > 0: modules_sym_md.append (modname) - chmsg = "(GRUB_MOD_INIT(%s)): New function\n" % modname + chmsg = "(VasEBoot_MOD_INIT(%s)): New function\n" % modname if nch: chlognew = "%s\n %s" % (chlognew, chmsg) else: chlognew = "%s%s" % (chlognew, chmsg) nch = True - fw.write ("\n\nGRUB_MOD_INIT(%s)\n" % modname) + fw.write ("\n\nVasEBoot_MOD_INIT(%s)\n" % modname) fw.write ("{\n") for ciphername in ciphernames: chmsg = "Register cipher %s" % ciphername chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write (" grub_cipher_register (&%s);\n" % ciphername) + fw.write (" VasEBoot_cipher_register (&%s);\n" % ciphername) for ctxsize in mdctxsizes: - fw.write (" COMPILE_TIME_ASSERT(%s <= GRUB_CRYPTO_MAX_MD_CONTEXT_SIZE);\n" % ctxsize) + fw.write (" COMPILE_TIME_ASSERT(%s <= VasEBoot_CRYPTO_MAX_MD_CONTEXT_SIZE);\n" % ctxsize) for mdname in mdnames: chmsg = "Register digest %s" % mdname chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write (" grub_md_register (&%s);\n" % mdname) + fw.write (" VasEBoot_md_register (&%s);\n" % mdname) for pkname in pknames: chmsg = "Register pk %s" % mdname chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write (" grub_crypto_pk_%s = &%s;\n" + fw.write (" VasEBoot_crypto_pk_%s = &%s;\n" % (pkname.replace ("_gcry_pubkey_spec_", ""), pkname)) fw.write ("}") - chmsg = "(GRUB_MOD_FINI(%s)): New function\n" % modname + chmsg = "(VasEBoot_MOD_FINI(%s)): New function\n" % modname chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write ("\n\nGRUB_MOD_FINI(%s)\n" % modname) + fw.write ("\n\nVasEBoot_MOD_FINI(%s)\n" % modname) fw.write ("{\n") for ciphername in ciphernames: chmsg = "Unregister cipher %s" % ciphername chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write (" grub_cipher_unregister (&%s);\n" % ciphername) + fw.write (" VasEBoot_cipher_unregister (&%s);\n" % ciphername) for mdname in mdnames: chmsg = "Unregister MD %s" % mdname chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write (" grub_md_unregister (&%s);\n" % mdname) + fw.write (" VasEBoot_md_unregister (&%s);\n" % mdname) for pkname in pknames: chmsg = "Unregister pk %s" % mdname chlognew = "%s\n %s" % (chlognew, chmsg) - fw.write (" grub_crypto_pk_%s = 0;\n" + fw.write (" VasEBoot_crypto_pk_%s = 0;\n" % (pkname.replace ("_gcry_pubkey_spec_", ""))) fw.write ("}\n") conf.write ("module = {\n") @@ -475,9 +475,9 @@ for cipher_file in cipher_files: for src in modfiles.split(): conf.write (" common = %s;\n" % src) if len (ciphernames) > 0 or len (mdnames) > 0: - confutil.write (" common = grub-core/%s;\n" % src) + confutil.write (" common = VasEBoot-core/%s;\n" % src) if modname == "gcry_ecc": - conf.write (" common = lib/libgcrypt-grub/mpi/ec.c;\n") + conf.write (" common = lib/libgcrypt-VasEBoot/mpi/ec.c;\n") conf.write (" cflags = '$(CFLAGS_GCRY) -Wno-redundant-decls -Wno-sign-compare';\n") elif modname == "gcry_rijndael" or modname == "gcry_md4" or modname == "gcry_md5" or modname == "gcry_rmd160" or modname == "gcry_sha1" or modname == "gcry_sha256" or modname == "gcry_sha512" or modname == "gcry_tiger": # Alignment checked by hand @@ -524,7 +524,7 @@ for src in sorted (os.listdir (os.path.join (indir, "src"))): fw.close () continue if src == "visibility.h": - fw.write ("# include \n") + fw.write ("# include \n") fw.close () continue f = codecs.open (infile, "r", "utf-8") @@ -587,7 +587,7 @@ chlog = "%s * crypto.lst: New file.\n" % chlog outfile = os.path.join (cipher_dir_out, "types.h") fw=codecs.open (outfile, "w", "utf-8") -fw.write ("#include \n") +fw.write ("#include \n") fw.write ("#include \n") chlog = "%s * types.h: New file.\n" % chlog fw.close () @@ -601,7 +601,7 @@ fw.close () outfile = os.path.join (cipher_dir_out, "cipher.h") fw=codecs.open (outfile, "w", "utf-8") -fw.write ("#include \n") +fw.write ("#include \n") fw.write ("#include \n") chlog = "%s * cipher.h: Likewise.\n" % chlog fw.close () @@ -618,27 +618,27 @@ outfile = os.path.join (cipher_dir_out, "ChangeLog") conf.close (); initfile = codecs.open (os.path.join (cipher_dir_out, "init.c"), "w", "utf-8") -initfile.write ("#include \n") +initfile.write ("#include \n") for module in modules_sym_md: - initfile.write ("extern void grub_%s_init (void);\n" % module) - initfile.write ("extern void grub_%s_fini (void);\n" % module) + initfile.write ("extern void VasEBoot_%s_init (void);\n" % module) + initfile.write ("extern void VasEBoot_%s_fini (void);\n" % module) initfile.write ("\n") initfile.write ("void\n") -initfile.write ("grub_gcry_init_all (void)\n") +initfile.write ("VasEBoot_gcry_init_all (void)\n") initfile.write ("{\n") for module in modules_sym_md: - initfile.write (" grub_%s_init ();\n" % module) + initfile.write (" VasEBoot_%s_init ();\n" % module) initfile.write ("}\n") initfile.write ("\n") initfile.write ("void\n") -initfile.write ("grub_gcry_fini_all (void)\n") +initfile.write ("VasEBoot_gcry_fini_all (void)\n") initfile.write ("{\n") for module in modules_sym_md: - initfile.write (" grub_%s_fini ();\n" % module) + initfile.write (" VasEBoot_%s_fini ();\n" % module) initfile.write ("}\n") initfile.close () -confutil.write (" common = grub-core/lib/libgcrypt-grub/cipher/init.c;\n") +confutil.write (" common = VasEBoot-core/lib/libgcrypt-VasEBoot/cipher/init.c;\n") confutil.write ("};\n"); confutil.close (); @@ -649,7 +649,7 @@ dt = datetime.date.today () fw.write ("%04d-%02d-%02d Automatic import tool\n" % \ (dt.year,dt.month, dt.day)) fw.write ("\n") -fw.write (" Imported ciphers to GRUB\n") +fw.write (" Imported ciphers to VasEBoot\n") fw.write ("\n") fw.write (chlog) fw.write ("\n") diff --git a/util/import_gcrypth.sed b/util/import_gcrypth.sed index fe6d1a072..39cc58367 100644 --- a/util/import_gcrypth.sed +++ b/util/import_gcrypth.sed @@ -9,7 +9,7 @@ /^# *include / d /^ typedef long ssize_t;/ d /^ typedef int pid_t;/ d -/^# *include / s,#include ,#include , +/^# *include / s,#include ,#include , /^typedef gpg_error_t gcry_error_t;/ d /^typedef gpg_err_code_t gcry_err_code_t;/ d /^typedef struct gcry_mpi \*gcry_mpi_t;/ d diff --git a/util/import_unicode.py b/util/import_unicode.py index 08f80591e..a4f7c6d4b 100644 --- a/util/import_unicode.py +++ b/util/import_unicode.py @@ -1,19 +1,19 @@ #* -#* GRUB -- GRand Unified Bootloader +#* VasEBoot -- GRand Unified Bootloader #* Copyright (C) 2010 Free Software Foundation, Inc. #* -#* GRUB is free software: you can redistribute it and/or modify +#* VasEBoot 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, +#* VasEBoot 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 . +#* along with VasEBoot. If not, see . #* import re @@ -49,9 +49,9 @@ infile.close () infile = open (sys.argv[1], "r") outfile = open (sys.argv[4], "w") -outfile.write ("#include \n") +outfile.write ("#include \n") outfile.write ("\n") -outfile.write ("struct grub_unicode_compact_range grub_unicode_compact[] = {\n") +outfile.write ("struct VasEBoot_unicode_compact_range VasEBoot_unicode_compact[] = {\n") begincode = -2 lastcode = -2 @@ -129,7 +129,7 @@ for line in infile: or curjoin != lastjoin: if begincode != -2 and (lastbiditype != "L" or lastcombtype != 0 or \ lastmirrortype): - outfile.write (("{0x%x, 0x%x, GRUB_BIDI_TYPE_%s, %d, %d, GRUB_JOIN_TYPE_%s},\n" \ + outfile.write (("{0x%x, 0x%x, VasEBoot_BIDI_TYPE_%s, %d, %d, VasEBoot_JOIN_TYPE_%s},\n" \ % (begincode, lastcode - begincode + 1, \ lastbiditype, \ lastcombtype, lastmirrortype, \ @@ -144,7 +144,7 @@ for line in infile: lastcombtype = curcombtype lastmirrortype = curmirrortype if lastbiditype != "L" or lastcombtype != 0 or lastmirrortype: - outfile.write (("{0x%x, 0x%x, GRUB_BIDI_TYPE_%s, %d, %d, GRUB_JOIN_TYPE_%s},\n" \ + outfile.write (("{0x%x, 0x%x, VasEBoot_BIDI_TYPE_%s, %d, %d, VasEBoot_JOIN_TYPE_%s},\n" \ % (begincode, lastcode, lastbiditype, lastcombtype, \ lastmirrortype, lastjoin))) outfile.write ("{0, 0, 0, 0, 0, 0},\n") @@ -155,7 +155,7 @@ infile.close () infile = open (sys.argv[2], "r") -outfile.write ("struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[] = {\n") +outfile.write ("struct VasEBoot_unicode_bidi_pair VasEBoot_unicode_bidi_pairs[] = {\n") for line in infile: line = re.sub ("#.*$", "", line) @@ -172,7 +172,7 @@ outfile.write ("};\n") infile.close () -outfile.write ("struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[] = {\n ") +outfile.write ("struct VasEBoot_unicode_arabic_shape VasEBoot_unicode_arabic_shapes[] = {\n ") for x in arabicsubst: try: diff --git a/util/misc.c b/util/misc.c index d545212d9..77eae5cc6 100644 --- a/util/misc.c +++ b/util/misc.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -29,29 +29,29 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define ENABLE_RELOCATABLE 0 -#ifdef GRUB_BUILD -const char *program_name = GRUB_BUILD_PROGRAM_NAME; +#ifdef VasEBoot_BUILD +const char *program_name = VasEBoot_BUILD_PROGRAM_NAME; #else #include "progname.h" #endif -#ifdef GRUB_UTIL +#ifdef VasEBoot_UTIL int -grub_err_printf (const char *fmt, ...) +VasEBoot_err_printf (const char *fmt, ...) { va_list ap; int ret; @@ -65,7 +65,7 @@ grub_err_printf (const char *fmt, ...) #endif char * -grub_util_get_path (const char *dir, const char *file) +VasEBoot_util_get_path (const char *dir, const char *file) { char *path; @@ -75,24 +75,24 @@ grub_util_get_path (const char *dir, const char *file) } char * -grub_util_read_image (const char *path) +VasEBoot_util_read_image (const char *path) { char *img; FILE *fp; size_t size; - grub_util_info ("reading %s", path); + VasEBoot_util_info ("reading %s", path); - size = grub_util_get_image_size (path); + size = VasEBoot_util_get_image_size (path); img = (char *) xmalloc (size); - fp = grub_util_fopen (path, "rb"); + fp = VasEBoot_util_fopen (path, "rb"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), path, + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); if (fread (img, 1, size, fp) != size) - grub_util_error (_("cannot read `%s': %s"), path, + VasEBoot_util_error (_("cannot read `%s': %s"), path, strerror (errno)); fclose (fp); @@ -101,68 +101,68 @@ grub_util_read_image (const char *path) } void -grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out, +VasEBoot_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out, const char *name) { - grub_util_info ("writing 0x%" GRUB_HOST_PRIxLONG_LONG " bytes at offset 0x%" - GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("writing 0x%" VasEBoot_HOST_PRIxLONG_LONG " bytes at offset 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) size, (unsigned long long) offset); if (fseeko (out, offset, SEEK_SET) == -1) - grub_util_error (_("cannot seek `%s': %s"), + VasEBoot_util_error (_("cannot seek `%s': %s"), name, strerror (errno)); if (fwrite (img, 1, size, out) != size) - grub_util_error (_("cannot write to `%s': %s"), + VasEBoot_util_error (_("cannot write to `%s': %s"), name, strerror (errno)); } void -grub_util_write_image (const char *img, size_t size, FILE *out, +VasEBoot_util_write_image (const char *img, size_t size, FILE *out, const char *name) { - grub_util_info ("writing 0x%" GRUB_HOST_PRIxLONG_LONG " bytes", (unsigned long long) size); + VasEBoot_util_info ("writing 0x%" VasEBoot_HOST_PRIxLONG_LONG " bytes", (unsigned long long) size); if (fwrite (img, 1, size, out) != size) { if (!name) - grub_util_error (_("cannot write to the stdout: %s"), + VasEBoot_util_error (_("cannot write to the stdout: %s"), strerror (errno)); else - grub_util_error (_("cannot write to `%s': %s"), + VasEBoot_util_error (_("cannot write to `%s': %s"), name, strerror (errno)); } } -grub_err_t -grub_script_execute_cmdline (struct grub_script_cmd *cmd __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_script_execute_cmdline (struct VasEBoot_script_cmd *cmd __attribute__ ((unused))) { return 0; } -grub_err_t -grub_script_execute_cmdlist (struct grub_script_cmd *cmd __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_script_execute_cmdlist (struct VasEBoot_script_cmd *cmd __attribute__ ((unused))) { return 0; } -grub_err_t -grub_script_execute_cmdif (struct grub_script_cmd *cmd __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_script_execute_cmdif (struct VasEBoot_script_cmd *cmd __attribute__ ((unused))) { return 0; } -grub_err_t -grub_script_execute_cmdfor (struct grub_script_cmd *cmd __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_script_execute_cmdfor (struct VasEBoot_script_cmd *cmd __attribute__ ((unused))) { return 0; } -grub_err_t -grub_script_execute_cmdwhile (struct grub_script_cmd *cmd __attribute__ ((unused))) +VasEBoot_err_t +VasEBoot_script_execute_cmdwhile (struct VasEBoot_script_cmd *cmd __attribute__ ((unused))) { return 0; } -grub_err_t -grub_script_execute (struct grub_script *script) +VasEBoot_err_t +VasEBoot_script_execute (struct VasEBoot_script *script) { if (script == 0 || script->cmd == 0) return 0; @@ -171,34 +171,34 @@ grub_script_execute (struct grub_script *script) } int -grub_getkey (void) +VasEBoot_getkey (void) { return -1; } void -grub_refresh (void) +VasEBoot_refresh (void) { fflush (stdout); } static void -grub_xputs_real (const char *str) +VasEBoot_xputs_real (const char *str) { fputs (str, stdout); } -void (*grub_xputs) (const char *str) = grub_xputs_real; +void (*VasEBoot_xputs) (const char *str) = VasEBoot_xputs_real; int -grub_dl_ref (grub_dl_t mod) +VasEBoot_dl_ref (VasEBoot_dl_t mod) { (void) mod; return 0; } int -grub_dl_unref (grub_dl_t mod) +VasEBoot_dl_unref (VasEBoot_dl_t mod) { (void) mod; return 0; @@ -206,19 +206,19 @@ grub_dl_unref (grub_dl_t mod) /* Some functions that we don't use. */ void -grub_mm_init_region (void *addr __attribute__ ((unused)), - grub_size_t size __attribute__ ((unused))) +VasEBoot_mm_init_region (void *addr __attribute__ ((unused)), + VasEBoot_size_t size __attribute__ ((unused))) { } void -grub_register_exported_symbols (void) +VasEBoot_register_exported_symbols (void) { } /* Used in comparison of arrays of strings with qsort */ int -grub_qsort_strcmp (const void *p1, const void *p2) +VasEBoot_qsort_strcmp (const void *p1, const void *p2) { return strcmp(*(char *const *)p1, *(char *const *)p2); } diff --git a/util/mkimage.c b/util/mkimage.c index 9ad4cfe42..196427137 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -1,36 +1,36 @@ -/* grub-mkimage.c - make a bootable image */ +/* VasEBoot-mkimage.c - make a bootable image */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -39,14 +39,14 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) @@ -61,21 +61,21 @@ /* use 2015-01-01T00:00:00+0000 as a stock timestamp */ #define STABLE_EMBEDDING_TIMESTAMP 1420070400 -#define EFI32_HEADER_SIZE ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE \ - + GRUB_PE32_SIGNATURE_SIZE \ - + sizeof (struct grub_pe32_coff_header) \ - + sizeof (struct grub_pe32_optional_header) \ - + 4 * sizeof (struct grub_pe32_section_table), \ - GRUB_PE32_SECTION_ALIGNMENT) +#define EFI32_HEADER_SIZE ALIGN_UP (VasEBoot_PE32_MSDOS_STUB_SIZE \ + + VasEBoot_PE32_SIGNATURE_SIZE \ + + sizeof (struct VasEBoot_pe32_coff_header) \ + + sizeof (struct VasEBoot_pe32_optional_header) \ + + 4 * sizeof (struct VasEBoot_pe32_section_table), \ + VasEBoot_PE32_SECTION_ALIGNMENT) -#define EFI64_HEADER_SIZE ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE \ - + GRUB_PE32_SIGNATURE_SIZE \ - + sizeof (struct grub_pe32_coff_header) \ - + sizeof (struct grub_pe64_optional_header) \ - + 4 * sizeof (struct grub_pe32_section_table), \ - GRUB_PE32_SECTION_ALIGNMENT) +#define EFI64_HEADER_SIZE ALIGN_UP (VasEBoot_PE32_MSDOS_STUB_SIZE \ + + VasEBoot_PE32_SIGNATURE_SIZE \ + + sizeof (struct VasEBoot_pe32_coff_header) \ + + sizeof (struct VasEBoot_pe64_optional_header) \ + + 4 * sizeof (struct VasEBoot_pe32_section_table), \ + VasEBoot_PE32_SECTION_ALIGNMENT) -static const struct grub_install_image_target_desc image_targets[] = +static const struct VasEBoot_install_image_target_desc image_targets[] = { { .dirname = "i386-coreboot", @@ -91,11 +91,11 @@ static const struct grub_install_image_target_desc image_targets[] = .reloc_table_offset = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_COREBOOT_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_I386_COREBOOT_LINK_ADDR, .elf_target = EM_386, .link_align = 4, - .mod_gap = GRUB_KERNEL_I386_COREBOOT_MOD_GAP, - .mod_align = GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN + .mod_gap = VasEBoot_KERNEL_I386_COREBOOT_MOD_GAP, + .mod_align = VasEBoot_KERNEL_I386_COREBOOT_MOD_ALIGN }, { .dirname = "i386-multiboot", @@ -110,11 +110,11 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_COREBOOT_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_I386_COREBOOT_LINK_ADDR, .elf_target = EM_386, .link_align = 4, - .mod_gap = GRUB_KERNEL_I386_COREBOOT_MOD_GAP, - .mod_align = GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN + .mod_gap = VasEBoot_KERNEL_I386_COREBOOT_MOD_GAP, + .mod_align = VasEBoot_KERNEL_I386_COREBOOT_MOD_ALIGN }, { .dirname = "i386-pc", @@ -124,13 +124,13 @@ static const struct grub_install_image_target_desc image_targets[] = .id = IMAGE_I386_PC, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = TARGET_NO_FIELD, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE, .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_PC_LINK_ADDR, - .default_compression = GRUB_COMPRESSION_LZMA + .link_addr = VasEBoot_KERNEL_I386_PC_LINK_ADDR, + .default_compression = VasEBoot_COMPRESSION_LZMA }, { .dirname = "i386-pc", @@ -140,13 +140,13 @@ static const struct grub_install_image_target_desc image_targets[] = .id = IMAGE_I386_PC_PXE, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = TARGET_NO_FIELD, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE, .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_PC_LINK_ADDR, - .default_compression = GRUB_COMPRESSION_LZMA + .link_addr = VasEBoot_KERNEL_I386_PC_LINK_ADDR, + .default_compression = VasEBoot_COMPRESSION_LZMA }, { .dirname = "i386-pc", @@ -156,13 +156,13 @@ static const struct grub_install_image_target_desc image_targets[] = .id = IMAGE_I386_PC_ELTORITO, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = TARGET_NO_FIELD, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE, .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_PC_LINK_ADDR, - .default_compression = GRUB_COMPRESSION_LZMA + .link_addr = VasEBoot_KERNEL_I386_PC_LINK_ADDR, + .default_compression = VasEBoot_COMPRESSION_LZMA }, { .dirname = "i386-efi", @@ -175,9 +175,9 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, - .section_align = GRUB_PE32_SECTION_ALIGNMENT, + .section_align = VasEBoot_PE32_SECTION_ALIGNMENT, .vaddr_offset = EFI32_HEADER_SIZE, - .pe_target = GRUB_PE32_MACHINE_I386, + .pe_target = VasEBoot_PE32_MACHINE_I386, .elf_target = EM_386, }, { @@ -193,10 +193,10 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_IEEE1275_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_I386_IEEE1275_LINK_ADDR, .elf_target = EM_386, - .mod_gap = GRUB_KERNEL_I386_IEEE1275_MOD_GAP, - .mod_align = GRUB_KERNEL_I386_IEEE1275_MOD_ALIGN, + .mod_gap = VasEBoot_KERNEL_I386_IEEE1275_MOD_GAP, + .mod_align = VasEBoot_KERNEL_I386_IEEE1275_MOD_ALIGN, .link_align = 4, }, { @@ -212,7 +212,7 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_I386_QEMU_LINK_ADDR + .link_addr = VasEBoot_KERNEL_I386_QEMU_LINK_ADDR }, { .dirname = "x86_64-efi", @@ -225,9 +225,9 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, - .section_align = GRUB_PE32_SECTION_ALIGNMENT, + .section_align = VasEBoot_PE32_SECTION_ALIGNMENT, .vaddr_offset = EFI64_HEADER_SIZE, - .pe_target = GRUB_PE32_MACHINE_X86_64, + .pe_target = VasEBoot_PE32_MACHINE_X86_64, .elf_target = EM_X86_64, }, { @@ -245,8 +245,8 @@ static const struct grub_install_image_target_desc image_targets[] = .vaddr_offset = 0, .link_addr = 0, .elf_target = EM_386, - .mod_gap = GRUB_KERNEL_I386_XEN_MOD_GAP, - .mod_align = GRUB_KERNEL_I386_XEN_MOD_ALIGN, + .mod_gap = VasEBoot_KERNEL_I386_XEN_MOD_GAP, + .mod_align = VasEBoot_KERNEL_I386_XEN_MOD_ALIGN, .link_align = 4 }, { @@ -264,8 +264,8 @@ static const struct grub_install_image_target_desc image_targets[] = .vaddr_offset = 0, .link_addr = 0, .elf_target = EM_X86_64, - .mod_gap = GRUB_KERNEL_X86_64_XEN_MOD_GAP, - .mod_align = GRUB_KERNEL_X86_64_XEN_MOD_ALIGN, + .mod_gap = VasEBoot_KERNEL_X86_64_XEN_MOD_GAP, + .mod_align = VasEBoot_KERNEL_X86_64_XEN_MOD_ALIGN, .link_align = 8 }, { @@ -275,16 +275,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_YEELOONG_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mipsel-loongson", @@ -293,16 +293,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_FULOONG2F_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mipsel-loongson", @@ -313,16 +313,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_LOONGSON_ELF, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_LOONGSON_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "powerpc-ieee1275", @@ -337,10 +337,10 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_POWERPC_IEEE1275_LINK_ADDR, .elf_target = EM_PPC, - .mod_gap = GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP, - .mod_align = GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN, + .mod_gap = VasEBoot_KERNEL_POWERPC_IEEE1275_MOD_GAP, + .mod_align = VasEBoot_KERNEL_POWERPC_IEEE1275_MOD_ALIGN, .link_align = 4 }, { @@ -350,14 +350,14 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 1, .id = IMAGE_SPARC64_RAW, .flags = PLATFORM_FLAGS_NONE, - .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, + .total_module_size = VasEBoot_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR, - .mod_align = GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN, + .link_addr = VasEBoot_KERNEL_SPARC64_IEEE1275_LINK_ADDR, + .mod_align = VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN, }, { .dirname = "sparc64-ieee1275", @@ -366,14 +366,14 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 1, .id = IMAGE_SPARC64_CDCORE, .flags = PLATFORM_FLAGS_NONE, - .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, + .total_module_size = VasEBoot_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR, - .mod_align = GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN, + .link_addr = VasEBoot_KERNEL_SPARC64_IEEE1275_LINK_ADDR, + .mod_align = VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN, }, { .dirname = "sparc64-ieee1275", @@ -382,14 +382,14 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 1, .id = IMAGE_SPARC64_AOUT, .flags = PLATFORM_FLAGS_NONE, - .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, + .total_module_size = VasEBoot_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR, - .mod_align = GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN, + .link_addr = VasEBoot_KERNEL_SPARC64_IEEE1275_LINK_ADDR, + .mod_align = VasEBoot_KERNEL_SPARC64_IEEE1275_MOD_ALIGN, }, { .dirname = "ia64-efi", @@ -402,9 +402,9 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, - .section_align = GRUB_PE32_SECTION_ALIGNMENT, + .section_align = VasEBoot_PE32_SECTION_ALIGNMENT, .vaddr_offset = EFI64_HEADER_SIZE, - .pe_target = GRUB_PE32_MACHINE_IA64, + .pe_target = VasEBoot_PE32_MACHINE_IA64, .elf_target = EM_IA_64, }, { @@ -414,16 +414,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 1, .id = IMAGE_MIPS_ARC, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_ARC_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_ARC_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_ARC_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_ARC_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mipsel-arc", @@ -432,16 +432,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_MIPS_ARC, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPSEL_ARC_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_ARC_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_ARC_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mipsel-qemu_mips", @@ -450,16 +450,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_LOONGSON_ELF, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mips-qemu_mips", @@ -468,16 +468,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 1, .id = IMAGE_QEMU_MIPS_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mipsel-qemu_mips", @@ -486,16 +486,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_QEMU_MIPS_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "mips-qemu_mips", @@ -504,16 +504,16 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 1, .id = IMAGE_LOONGSON_ELF, .flags = PLATFORM_FLAGS_DECOMPRESSORS, - .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, - .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, - .decompressor_uncompressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, - .decompressor_uncompressed_addr = GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, + .total_module_size = VasEBoot_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, + .decompressor_compressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, + .decompressor_uncompressed_size = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE, + .decompressor_uncompressed_addr = VasEBoot_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR, .section_align = 1, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, + .link_addr = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR, .elf_target = EM_MIPS, - .link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, - .default_compression = GRUB_COMPRESSION_NONE + .link_align = VasEBoot_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN, + .default_compression = VasEBoot_COMPRESSION_NONE }, { .dirname = "arm-uboot", @@ -522,15 +522,15 @@ static const struct grub_install_image_target_desc image_targets[] = .bigendian = 0, .id = IMAGE_UBOOT, .flags = PLATFORM_FLAGS_NONE, - .total_module_size = GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE, + .total_module_size = VasEBoot_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE, .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, - .section_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN, + .section_align = VasEBoot_KERNEL_ARM_UBOOT_MOD_ALIGN, .vaddr_offset = 0, .elf_target = EM_ARM, - .mod_gap = GRUB_KERNEL_ARM_UBOOT_MOD_GAP, - .mod_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN, + .mod_gap = VasEBoot_KERNEL_ARM_UBOOT_MOD_GAP, + .mod_align = VasEBoot_KERNEL_ARM_UBOOT_MOD_ALIGN, .link_align = 4 }, { @@ -544,14 +544,14 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, - .section_align = GRUB_PE32_SECTION_ALIGNMENT, - .vaddr_offset = ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE - + GRUB_PE32_SIGNATURE_SIZE - + sizeof (struct grub_pe32_coff_header) - + sizeof (struct grub_pe32_optional_header) - + 4 * sizeof (struct grub_pe32_section_table), - GRUB_PE32_SECTION_ALIGNMENT), - .pe_target = GRUB_PE32_MACHINE_ARMTHUMB_MIXED, + .section_align = VasEBoot_PE32_SECTION_ALIGNMENT, + .vaddr_offset = ALIGN_UP (VasEBoot_PE32_MSDOS_STUB_SIZE + + VasEBoot_PE32_SIGNATURE_SIZE + + sizeof (struct VasEBoot_pe32_coff_header) + + sizeof (struct VasEBoot_pe32_optional_header) + + 4 * sizeof (struct VasEBoot_pe32_section_table), + VasEBoot_PE32_SECTION_ALIGNMENT), + .pe_target = VasEBoot_PE32_MACHINE_ARMTHUMB_MIXED, .elf_target = EM_ARM, }, { @@ -565,14 +565,14 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, - .section_align = GRUB_PE32_SECTION_ALIGNMENT, + .section_align = VasEBoot_PE32_SECTION_ALIGNMENT, .vaddr_offset = EFI64_HEADER_SIZE, - .pe_target = GRUB_PE32_MACHINE_ARM64, + .pe_target = VasEBoot_PE32_MACHINE_ARM64, .elf_target = EM_AARCH64, }, }; -#include +#include static void *SzAlloc(void *p __attribute__ ((unused)), size_t size) { return xmalloc(size); } static void SzFree(void *p __attribute__ ((unused)), void *address) { free(address); } @@ -601,7 +601,7 @@ compress_kernel_lzma (char *kernel_img, size_t kernel_size, kernel_size, &props, out_props, &out_props_size, 0, NULL, &g_Alloc, &g_Alloc) != SZ_OK) - grub_util_error ("%s", _("cannot compress the kernel image")); + VasEBoot_util_error ("%s", _("cannot compress the kernel image")); } #ifdef USE_LIBLZMA @@ -630,7 +630,7 @@ compress_kernel_xz (char *kernel_img, size_t kernel_size, xzret = lzma_stream_encoder (&strm, fltrs, LZMA_CHECK_NONE); if (xzret != LZMA_OK) - grub_util_error ("%s", _("cannot compress the kernel image")); + VasEBoot_util_error ("%s", _("cannot compress the kernel image")); *core_img = xmalloc (kernel_size); @@ -647,7 +647,7 @@ compress_kernel_xz (char *kernel_img, size_t kernel_size, continue; if (xzret == LZMA_STREAM_END) break; - grub_util_error ("%s", _("cannot compress the kernel image")); + VasEBoot_util_error ("%s", _("cannot compress the kernel image")); } *core_size -= strm.avail_out; @@ -655,12 +655,12 @@ compress_kernel_xz (char *kernel_img, size_t kernel_size, #endif static void -compress_kernel (const struct grub_install_image_target_desc *image_target, char *kernel_img, +compress_kernel (const struct VasEBoot_install_image_target_desc *image_target, char *kernel_img, size_t kernel_size, char **core_img, size_t *core_size, - grub_compression_t comp) + VasEBoot_compression_t comp) { if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS - && (comp == GRUB_COMPRESSION_LZMA)) + && (comp == VasEBoot_COMPRESSION_LZMA)) { compress_kernel_lzma (kernel_img, kernel_size, core_img, core_size); @@ -669,7 +669,7 @@ compress_kernel (const struct grub_install_image_target_desc *image_target, char #ifdef USE_LIBLZMA if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS - && (comp == GRUB_COMPRESSION_XZ)) + && (comp == VasEBoot_COMPRESSION_XZ)) { compress_kernel_xz (kernel_img, kernel_size, core_img, core_size); @@ -678,16 +678,16 @@ compress_kernel (const struct grub_install_image_target_desc *image_target, char #endif if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS - && (comp != GRUB_COMPRESSION_NONE)) - grub_util_error (_("unknown compression %d"), comp); + && (comp != VasEBoot_COMPRESSION_NONE)) + VasEBoot_util_error (_("unknown compression %d"), comp); *core_img = xmalloc (kernel_size); memcpy (*core_img, kernel_img, kernel_size); *core_size = kernel_size; } -const struct grub_install_image_target_desc * -grub_install_get_image_target (const char *arg) +const struct VasEBoot_install_image_target_desc * +VasEBoot_install_get_image_target (const char *arg) { unsigned i, j; for (i = 0; i < ARRAY_SIZE (image_targets); i++) @@ -699,19 +699,19 @@ grub_install_get_image_target (const char *arg) } const char * -grub_util_get_target_dirname (const struct grub_install_image_target_desc *t) +VasEBoot_util_get_target_dirname (const struct VasEBoot_install_image_target_desc *t) { return t->dirname; } const char * -grub_util_get_target_name (const struct grub_install_image_target_desc *t) +VasEBoot_util_get_target_name (const struct VasEBoot_install_image_target_desc *t) { return t->names[0]; } char * -grub_install_get_image_targets_string (void) +VasEBoot_install_get_image_targets_string (void) { int format_len = 0; char *formats; @@ -733,13 +733,13 @@ grub_install_get_image_targets_string (void) } void -grub_install_generate_image (const char *dir, const char *prefix, +VasEBoot_install_generate_image (const char *dir, const char *prefix, FILE *out, const char *outname, char *mods[], char *memdisk_path, char **pubkey_paths, size_t npubkeys, char *config_path, - const struct grub_install_image_target_desc *image_target, + const struct VasEBoot_install_image_target_desc *image_target, int note, - grub_compression_t comp) + VasEBoot_compression_t comp) { char *kernel_img, *core_img; size_t total_module_size, core_size; @@ -747,82 +747,82 @@ grub_install_generate_image (const char *dir, const char *prefix, size_t prefix_size = 0; char *kernel_path; size_t offset; - struct grub_util_path_list *path_list, *p; + struct VasEBoot_util_path_list *path_list, *p; size_t decompress_size = 0; - struct grub_mkimage_layout layout; + struct VasEBoot_mkimage_layout layout; - if (comp == GRUB_COMPRESSION_AUTO) + if (comp == VasEBoot_COMPRESSION_AUTO) comp = image_target->default_compression; if (image_target->id == IMAGE_I386_PC || image_target->id == IMAGE_I386_PC_PXE || image_target->id == IMAGE_I386_PC_ELTORITO) - comp = GRUB_COMPRESSION_LZMA; + comp = VasEBoot_COMPRESSION_LZMA; - path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); + path_list = VasEBoot_util_resolve_dependencies (dir, "moddep.lst", mods); - kernel_path = grub_util_get_path (dir, "kernel.img"); + kernel_path = VasEBoot_util_get_path (dir, "kernel.img"); if (image_target->voidp_sizeof == 8) - total_module_size = sizeof (struct grub_module_info64); + total_module_size = sizeof (struct VasEBoot_module_info64); else - total_module_size = sizeof (struct grub_module_info32); + total_module_size = sizeof (struct VasEBoot_module_info32); { size_t i; for (i = 0; i < npubkeys; i++) { size_t curs; - curs = ALIGN_ADDR (grub_util_get_image_size (pubkey_paths[i])); - grub_util_info ("the size of public key %u is 0x%" - GRUB_HOST_PRIxLONG_LONG, + curs = ALIGN_ADDR (VasEBoot_util_get_image_size (pubkey_paths[i])); + VasEBoot_util_info ("the size of public key %u is 0x%" + VasEBoot_HOST_PRIxLONG_LONG, (unsigned) i, (unsigned long long) curs); - total_module_size += curs + sizeof (struct grub_module_header); + total_module_size += curs + sizeof (struct VasEBoot_module_header); } } if (memdisk_path) { - memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512); - grub_util_info ("the size of memory disk is 0x%" GRUB_HOST_PRIxLONG_LONG, + memdisk_size = ALIGN_UP(VasEBoot_util_get_image_size (memdisk_path), 512); + VasEBoot_util_info ("the size of memory disk is 0x%" VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) memdisk_size); - total_module_size += memdisk_size + sizeof (struct grub_module_header); + total_module_size += memdisk_size + sizeof (struct VasEBoot_module_header); } if (config_path) { - config_size = ALIGN_ADDR (grub_util_get_image_size (config_path) + 1); - grub_util_info ("the size of config file is 0x%" GRUB_HOST_PRIxLONG_LONG, + config_size = ALIGN_ADDR (VasEBoot_util_get_image_size (config_path) + 1); + VasEBoot_util_info ("the size of config file is 0x%" VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) config_size); - total_module_size += config_size + sizeof (struct grub_module_header); + total_module_size += config_size + sizeof (struct VasEBoot_module_header); } if (prefix) { prefix_size = ALIGN_ADDR (strlen (prefix) + 1); - total_module_size += prefix_size + sizeof (struct grub_module_header); + total_module_size += prefix_size + sizeof (struct VasEBoot_module_header); } for (p = path_list; p; p = p->next) - total_module_size += (ALIGN_ADDR (grub_util_get_image_size (p->name)) - + sizeof (struct grub_module_header)); + total_module_size += (ALIGN_ADDR (VasEBoot_util_get_image_size (p->name)) + + sizeof (struct VasEBoot_module_header)); - grub_util_info ("the total module size is 0x%" GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("the total module size is 0x%" VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) total_module_size); if (image_target->voidp_sizeof == 4) - kernel_img = grub_mkimage_load_image32 (kernel_path, total_module_size, + kernel_img = VasEBoot_mkimage_load_image32 (kernel_path, total_module_size, &layout, image_target); else - kernel_img = grub_mkimage_load_image64 (kernel_path, total_module_size, + kernel_img = VasEBoot_mkimage_load_image64 (kernel_path, total_module_size, &layout, image_target); if (image_target->id == IMAGE_XEN && layout.align < 4096) layout.align = 4096; if ((image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) && (image_target->total_module_size != TARGET_NO_FIELD)) - *((grub_uint32_t *) (kernel_img + image_target->total_module_size)) - = grub_host_to_target32 (total_module_size); + *((VasEBoot_uint32_t *) (kernel_img + image_target->total_module_size)) + = VasEBoot_host_to_target32 (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) { @@ -832,50 +832,50 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->voidp_sizeof == 8) { - /* Fill in the grub_module_info structure. */ - struct grub_module_info64 *modinfo; + /* Fill in the VasEBoot_module_info structure. */ + struct VasEBoot_module_info64 *modinfo; if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) - modinfo = (struct grub_module_info64 *) kernel_img; + modinfo = (struct VasEBoot_module_info64 *) kernel_img; else - modinfo = (struct grub_module_info64 *) (kernel_img + layout.kernel_size); - modinfo->magic = grub_host_to_target32 (GRUB_MODULE_MAGIC); - modinfo->offset = grub_host_to_target_addr (sizeof (struct grub_module_info64)); - modinfo->size = grub_host_to_target_addr (total_module_size); + modinfo = (struct VasEBoot_module_info64 *) (kernel_img + layout.kernel_size); + modinfo->magic = VasEBoot_host_to_target32 (VasEBoot_MODULE_MAGIC); + modinfo->offset = VasEBoot_host_to_target_addr (sizeof (struct VasEBoot_module_info64)); + modinfo->size = VasEBoot_host_to_target_addr (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) - offset = sizeof (struct grub_module_info64); + offset = sizeof (struct VasEBoot_module_info64); else - offset = layout.kernel_size + sizeof (struct grub_module_info64); + offset = layout.kernel_size + sizeof (struct VasEBoot_module_info64); } else { - /* Fill in the grub_module_info structure. */ - struct grub_module_info32 *modinfo; + /* Fill in the VasEBoot_module_info structure. */ + struct VasEBoot_module_info32 *modinfo; if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) - modinfo = (struct grub_module_info32 *) kernel_img; + modinfo = (struct VasEBoot_module_info32 *) kernel_img; else - modinfo = (struct grub_module_info32 *) (kernel_img + layout.kernel_size); - modinfo->magic = grub_host_to_target32 (GRUB_MODULE_MAGIC); - modinfo->offset = grub_host_to_target_addr (sizeof (struct grub_module_info32)); - modinfo->size = grub_host_to_target_addr (total_module_size); + modinfo = (struct VasEBoot_module_info32 *) (kernel_img + layout.kernel_size); + modinfo->magic = VasEBoot_host_to_target32 (VasEBoot_MODULE_MAGIC); + modinfo->offset = VasEBoot_host_to_target_addr (sizeof (struct VasEBoot_module_info32)); + modinfo->size = VasEBoot_host_to_target_addr (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) - offset = sizeof (struct grub_module_info32); + offset = sizeof (struct VasEBoot_module_info32); else - offset = layout.kernel_size + sizeof (struct grub_module_info32); + offset = layout.kernel_size + sizeof (struct VasEBoot_module_info32); } for (p = path_list; p; p = p->next) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; size_t mod_size; - mod_size = ALIGN_ADDR (grub_util_get_image_size (p->name)); + mod_size = ALIGN_ADDR (VasEBoot_util_get_image_size (p->name)); - header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_host_to_target32 (OBJ_TYPE_ELF); - header->size = grub_host_to_target32 (mod_size + sizeof (*header)); + header = (struct VasEBoot_module_header *) (kernel_img + offset); + header->type = VasEBoot_host_to_target32 (OBJ_TYPE_ELF); + header->size = VasEBoot_host_to_target32 (mod_size + sizeof (*header)); offset += sizeof (*header); - grub_util_load_image (p->name, kernel_img + offset); + VasEBoot_util_load_image (p->name, kernel_img + offset); offset += mod_size; } @@ -884,73 +884,73 @@ grub_install_generate_image (const char *dir, const char *prefix, for (i = 0; i < npubkeys; i++) { size_t curs; - struct grub_module_header *header; + struct VasEBoot_module_header *header; - curs = grub_util_get_image_size (pubkey_paths[i]); + curs = VasEBoot_util_get_image_size (pubkey_paths[i]); - header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_host_to_target32 (OBJ_TYPE_PUBKEY); - header->size = grub_host_to_target32 (curs + sizeof (*header)); + header = (struct VasEBoot_module_header *) (kernel_img + offset); + header->type = VasEBoot_host_to_target32 (OBJ_TYPE_PUBKEY); + header->size = VasEBoot_host_to_target32 (curs + sizeof (*header)); offset += sizeof (*header); - grub_util_load_image (pubkey_paths[i], kernel_img + offset); + VasEBoot_util_load_image (pubkey_paths[i], kernel_img + offset); offset += ALIGN_ADDR (curs); } } if (memdisk_path) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; - header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_host_to_target32 (OBJ_TYPE_MEMDISK); - header->size = grub_host_to_target32 (memdisk_size + sizeof (*header)); + header = (struct VasEBoot_module_header *) (kernel_img + offset); + header->type = VasEBoot_host_to_target32 (OBJ_TYPE_MEMDISK); + header->size = VasEBoot_host_to_target32 (memdisk_size + sizeof (*header)); offset += sizeof (*header); - grub_util_load_image (memdisk_path, kernel_img + offset); + VasEBoot_util_load_image (memdisk_path, kernel_img + offset); offset += memdisk_size; } if (config_path) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; - header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_host_to_target32 (OBJ_TYPE_CONFIG); - header->size = grub_host_to_target32 (config_size + sizeof (*header)); + header = (struct VasEBoot_module_header *) (kernel_img + offset); + header->type = VasEBoot_host_to_target32 (OBJ_TYPE_CONFIG); + header->size = VasEBoot_host_to_target32 (config_size + sizeof (*header)); offset += sizeof (*header); - grub_util_load_image (config_path, kernel_img + offset); + VasEBoot_util_load_image (config_path, kernel_img + offset); offset += config_size; } if (prefix) { - struct grub_module_header *header; + struct VasEBoot_module_header *header; - header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_host_to_target32 (OBJ_TYPE_PREFIX); - header->size = grub_host_to_target32 (prefix_size + sizeof (*header)); + header = (struct VasEBoot_module_header *) (kernel_img + offset); + header->type = VasEBoot_host_to_target32 (OBJ_TYPE_PREFIX); + header->size = VasEBoot_host_to_target32 (prefix_size + sizeof (*header)); offset += sizeof (*header); - grub_strcpy (kernel_img + offset, prefix); + VasEBoot_strcpy (kernel_img + offset, prefix); offset += prefix_size; } - grub_util_info ("kernel_img=%p, kernel_size=0x%" GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("kernel_img=%p, kernel_size=0x%" VasEBoot_HOST_PRIxLONG_LONG, kernel_img, (unsigned long long) layout.kernel_size); compress_kernel (image_target, kernel_img, layout.kernel_size + total_module_size, &core_img, &core_size, comp); free (kernel_img); - grub_util_info ("the core size is 0x%" GRUB_HOST_PRIxLONG_LONG, + VasEBoot_util_info ("the core size is 0x%" VasEBoot_HOST_PRIxLONG_LONG, (unsigned long long) core_size); if (!(image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) && image_target->total_module_size != TARGET_NO_FIELD) - *((grub_uint32_t *) (core_img + image_target->total_module_size)) - = grub_host_to_target32 (total_module_size); + *((VasEBoot_uint32_t *) (core_img + image_target->total_module_size)) + = VasEBoot_host_to_target32 (total_module_size); if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) { @@ -961,47 +961,47 @@ grub_install_generate_image (const char *dir, const char *prefix, switch (comp) { - case GRUB_COMPRESSION_XZ: + case VasEBoot_COMPRESSION_XZ: name = "xz_decompress.img"; break; - case GRUB_COMPRESSION_LZMA: + case VasEBoot_COMPRESSION_LZMA: name = "lzma_decompress.img"; break; - case GRUB_COMPRESSION_NONE: + case VasEBoot_COMPRESSION_NONE: name = "none_decompress.img"; break; default: - grub_util_error (_("unknown compression %d"), comp); + VasEBoot_util_error (_("unknown compression %d"), comp); } - decompress_path = grub_util_get_path (dir, name); - decompress_size = grub_util_get_image_size (decompress_path); - decompress_img = grub_util_read_image (decompress_path); + decompress_path = VasEBoot_util_get_path (dir, name); + decompress_size = VasEBoot_util_get_image_size (decompress_path); + decompress_img = VasEBoot_util_read_image (decompress_path); if ((image_target->id == IMAGE_I386_PC || image_target->id == IMAGE_I386_PC_PXE || image_target->id == IMAGE_I386_PC_ELTORITO) - && decompress_size > GRUB_KERNEL_I386_PC_LINK_ADDR - 0x8200) - grub_util_error ("%s", _("Decompressor is too big")); + && decompress_size > VasEBoot_KERNEL_I386_PC_LINK_ADDR - 0x8200) + VasEBoot_util_error ("%s", _("Decompressor is too big")); if (image_target->decompressor_compressed_size != TARGET_NO_FIELD) - *((grub_uint32_t *) (decompress_img + *((VasEBoot_uint32_t *) (decompress_img + image_target->decompressor_compressed_size)) - = grub_host_to_target32 (core_size); + = VasEBoot_host_to_target32 (core_size); if (image_target->decompressor_uncompressed_size != TARGET_NO_FIELD) - *((grub_uint32_t *) (decompress_img + *((VasEBoot_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_size)) - = grub_host_to_target32 (layout.kernel_size + total_module_size); + = VasEBoot_host_to_target32 (layout.kernel_size + total_module_size); if (image_target->decompressor_uncompressed_addr != TARGET_NO_FIELD) { if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) - *((grub_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_addr)) - = grub_host_to_target_addr (image_target->link_addr - total_module_size); + *((VasEBoot_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_addr)) + = VasEBoot_host_to_target_addr (image_target->link_addr - total_module_size); else - *((grub_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_addr)) - = grub_host_to_target_addr (image_target->link_addr); + *((VasEBoot_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_addr)) + = VasEBoot_host_to_target_addr (image_target->link_addr); } full_size = core_size + decompress_size; @@ -1023,20 +1023,20 @@ grub_install_generate_image (const char *dir, const char *prefix, case IMAGE_I386_PC: case IMAGE_I386_PC_PXE: case IMAGE_I386_PC_ELTORITO: - if (GRUB_KERNEL_I386_PC_LINK_ADDR + core_size > 0x78000 - || (core_size > (0xffff << GRUB_DISK_SECTOR_BITS)) + if (VasEBoot_KERNEL_I386_PC_LINK_ADDR + core_size > 0x78000 + || (core_size > (0xffff << VasEBoot_DISK_SECTOR_BITS)) || (layout.kernel_size + layout.bss_size - + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)) - grub_util_error (_("core image is too big (0x%x > 0x%x)"), - GRUB_KERNEL_I386_PC_LINK_ADDR + (unsigned) core_size, + + VasEBoot_KERNEL_I386_PC_LINK_ADDR > 0x68000)) + VasEBoot_util_error (_("core image is too big (0x%x > 0x%x)"), + VasEBoot_KERNEL_I386_PC_LINK_ADDR + (unsigned) core_size, 0x78000); /* fallthrough */ case IMAGE_COREBOOT: case IMAGE_QEMU: - if (layout.kernel_size + layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000) - grub_util_error (_("kernel image is too big (0x%x > 0x%x)"), + if (layout.kernel_size + layout.bss_size + VasEBoot_KERNEL_I386_PC_LINK_ADDR > 0x68000) + VasEBoot_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, + + VasEBoot_KERNEL_I386_PC_LINK_ADDR, 0x68000); break; case IMAGE_LOONGSON_ELF: @@ -1066,29 +1066,29 @@ grub_install_generate_image (const char *dir, const char *prefix, char *boot_path, *boot_img; size_t boot_size; - num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); + num = ((core_size + VasEBoot_DISK_SECTOR_SIZE - 1) >> VasEBoot_DISK_SECTOR_BITS); if (image_target->id == IMAGE_I386_PC_PXE) { char *pxeboot_path, *pxeboot_img; size_t pxeboot_size; - grub_uint32_t *ptr; + VasEBoot_uint32_t *ptr; - pxeboot_path = grub_util_get_path (dir, "pxeboot.img"); - pxeboot_size = grub_util_get_image_size (pxeboot_path); - pxeboot_img = grub_util_read_image (pxeboot_path); + pxeboot_path = VasEBoot_util_get_path (dir, "pxeboot.img"); + pxeboot_size = VasEBoot_util_get_image_size (pxeboot_path); + pxeboot_img = VasEBoot_util_read_image (pxeboot_path); - grub_util_write_image (pxeboot_img, pxeboot_size, out, + VasEBoot_util_write_image (pxeboot_img, pxeboot_size, out, outname); free (pxeboot_img); free (pxeboot_path); /* Remove Multiboot header to avoid confusing ipxe. */ - for (ptr = (grub_uint32_t *) core_img; - ptr < (grub_uint32_t *) (core_img + MULTIBOOT_SEARCH); ptr++) - if (*ptr == grub_host_to_target32 (MULTIBOOT_HEADER_MAGIC) - && grub_target_to_host32 (ptr[0]) - + grub_target_to_host32 (ptr[1]) - + grub_target_to_host32 (ptr[2]) == 0) + for (ptr = (VasEBoot_uint32_t *) core_img; + ptr < (VasEBoot_uint32_t *) (core_img + MULTIBOOT_SEARCH); ptr++) + if (*ptr == VasEBoot_host_to_target32 (MULTIBOOT_HEADER_MAGIC) + && VasEBoot_target_to_host32 (ptr[0]) + + VasEBoot_target_to_host32 (ptr[1]) + + VasEBoot_target_to_host32 (ptr[2]) == 0) { *ptr = 0; break; @@ -1100,38 +1100,38 @@ grub_install_generate_image (const char *dir, const char *prefix, char *eltorito_path, *eltorito_img; size_t eltorito_size; - eltorito_path = grub_util_get_path (dir, "cdboot.img"); - eltorito_size = grub_util_get_image_size (eltorito_path); - eltorito_img = grub_util_read_image (eltorito_path); + eltorito_path = VasEBoot_util_get_path (dir, "cdboot.img"); + eltorito_size = VasEBoot_util_get_image_size (eltorito_path); + eltorito_img = VasEBoot_util_read_image (eltorito_path); - grub_util_write_image (eltorito_img, eltorito_size, out, + VasEBoot_util_write_image (eltorito_img, eltorito_size, out, outname); free (eltorito_img); free (eltorito_path); } - boot_path = grub_util_get_path (dir, "diskboot.img"); - boot_size = grub_util_get_image_size (boot_path); - if (boot_size != GRUB_DISK_SECTOR_SIZE) - grub_util_error (_("diskboot.img size must be %u bytes"), - GRUB_DISK_SECTOR_SIZE); + boot_path = VasEBoot_util_get_path (dir, "diskboot.img"); + boot_size = VasEBoot_util_get_image_size (boot_path); + if (boot_size != VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_util_error (_("diskboot.img size must be %u bytes"), + VasEBoot_DISK_SECTOR_SIZE); - boot_img = grub_util_read_image (boot_path); + boot_img = VasEBoot_util_read_image (boot_path); { - struct grub_pc_bios_boot_blocklist *block; - block = (struct grub_pc_bios_boot_blocklist *) (boot_img - + GRUB_DISK_SECTOR_SIZE + struct VasEBoot_pc_bios_boot_blocklist *block; + block = (struct VasEBoot_pc_bios_boot_blocklist *) (boot_img + + VasEBoot_DISK_SECTOR_SIZE - sizeof (*block)); - block->len = grub_host_to_target16 (num); + block->len = VasEBoot_host_to_target16 (num); /* This is filled elsewhere. Verify it just in case. */ assert (block->segment - == grub_host_to_target16 (GRUB_BOOT_I386_PC_KERNEL_SEG - + (GRUB_DISK_SECTOR_SIZE >> 4))); + == VasEBoot_host_to_target16 (VasEBoot_BOOT_I386_PC_KERNEL_SEG + + (VasEBoot_DISK_SECTOR_SIZE >> 4))); } - grub_util_write_image (boot_img, boot_size, out, outname); + VasEBoot_util_write_image (boot_img, boot_size, out, outname); free (boot_img); free (boot_path); } @@ -1139,13 +1139,13 @@ grub_install_generate_image (const char *dir, const char *prefix, case IMAGE_EFI: { void *pe_img; - grub_uint8_t *header; + VasEBoot_uint8_t *header; void *sections; size_t pe_size; - struct grub_pe32_coff_header *c; - struct grub_pe32_section_table *text_section, *data_section; - struct grub_pe32_section_table *mods_section, *reloc_section; - static const grub_uint8_t stub[] = GRUB_PE32_MSDOS_STUB; + struct VasEBoot_pe32_coff_header *c; + struct VasEBoot_pe32_section_table *text_section, *data_section; + struct VasEBoot_pe32_section_table *mods_section, *reloc_section; + static const VasEBoot_uint8_t stub[] = VasEBoot_PE32_MSDOS_STUB; int header_size; int reloc_addr; @@ -1167,159 +1167,159 @@ grub_install_generate_image (const char *dir, const char *prefix, header = pe_img; /* The magic. */ - memcpy (header, stub, GRUB_PE32_MSDOS_STUB_SIZE); - memcpy (header + GRUB_PE32_MSDOS_STUB_SIZE, "PE\0\0", - GRUB_PE32_SIGNATURE_SIZE); + memcpy (header, stub, VasEBoot_PE32_MSDOS_STUB_SIZE); + memcpy (header + VasEBoot_PE32_MSDOS_STUB_SIZE, "PE\0\0", + VasEBoot_PE32_SIGNATURE_SIZE); /* The COFF file header. */ - c = (struct grub_pe32_coff_header *) (header + GRUB_PE32_MSDOS_STUB_SIZE - + GRUB_PE32_SIGNATURE_SIZE); - c->machine = grub_host_to_target16 (image_target->pe_target); + c = (struct VasEBoot_pe32_coff_header *) (header + VasEBoot_PE32_MSDOS_STUB_SIZE + + VasEBoot_PE32_SIGNATURE_SIZE); + c->machine = VasEBoot_host_to_target16 (image_target->pe_target); - c->num_sections = grub_host_to_target16 (4); - c->time = grub_host_to_target32 (STABLE_EMBEDDING_TIMESTAMP); - c->characteristics = grub_host_to_target16 (GRUB_PE32_EXECUTABLE_IMAGE - | GRUB_PE32_LINE_NUMS_STRIPPED + c->num_sections = VasEBoot_host_to_target16 (4); + c->time = VasEBoot_host_to_target32 (STABLE_EMBEDDING_TIMESTAMP); + c->characteristics = VasEBoot_host_to_target16 (VasEBoot_PE32_EXECUTABLE_IMAGE + | VasEBoot_PE32_LINE_NUMS_STRIPPED | ((image_target->voidp_sizeof == 4) - ? GRUB_PE32_32BIT_MACHINE + ? VasEBoot_PE32_32BIT_MACHINE : 0) - | GRUB_PE32_LOCAL_SYMS_STRIPPED - | GRUB_PE32_DEBUG_STRIPPED); + | VasEBoot_PE32_LOCAL_SYMS_STRIPPED + | VasEBoot_PE32_DEBUG_STRIPPED); /* The PE Optional header. */ if (image_target->voidp_sizeof == 4) { - struct grub_pe32_optional_header *o; + struct VasEBoot_pe32_optional_header *o; - c->optional_header_size = grub_host_to_target16 (sizeof (struct grub_pe32_optional_header)); + c->optional_header_size = VasEBoot_host_to_target16 (sizeof (struct VasEBoot_pe32_optional_header)); - o = (struct grub_pe32_optional_header *) - (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE - + sizeof (struct grub_pe32_coff_header)); - o->magic = grub_host_to_target16 (GRUB_PE32_PE32_MAGIC); - o->code_size = grub_host_to_target32 (layout.exec_size); - o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size + o = (struct VasEBoot_pe32_optional_header *) + (header + VasEBoot_PE32_MSDOS_STUB_SIZE + VasEBoot_PE32_SIGNATURE_SIZE + + sizeof (struct VasEBoot_pe32_coff_header)); + o->magic = VasEBoot_host_to_target16 (VasEBoot_PE32_PE32_MAGIC); + o->code_size = VasEBoot_host_to_target32 (layout.exec_size); + o->data_size = VasEBoot_cpu_to_le32 (reloc_addr - layout.exec_size - header_size); - o->bss_size = grub_cpu_to_le32 (layout.bss_size); - o->entry_addr = grub_cpu_to_le32 (layout.start_address); - o->code_base = grub_cpu_to_le32 (header_size); + o->bss_size = VasEBoot_cpu_to_le32 (layout.bss_size); + o->entry_addr = VasEBoot_cpu_to_le32 (layout.start_address); + o->code_base = VasEBoot_cpu_to_le32 (header_size); - o->data_base = grub_host_to_target32 (header_size + layout.exec_size); + o->data_base = VasEBoot_host_to_target32 (header_size + layout.exec_size); o->image_base = 0; - o->section_alignment = grub_host_to_target32 (image_target->section_align); - o->file_alignment = grub_host_to_target32 (image_target->section_align); - o->image_size = grub_host_to_target32 (pe_size); - o->header_size = grub_host_to_target32 (header_size); - o->subsystem = grub_host_to_target16 (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION); + o->section_alignment = VasEBoot_host_to_target32 (image_target->section_align); + o->file_alignment = VasEBoot_host_to_target32 (image_target->section_align); + o->image_size = VasEBoot_host_to_target32 (pe_size); + o->header_size = VasEBoot_host_to_target32 (header_size); + o->subsystem = VasEBoot_host_to_target16 (VasEBoot_PE32_SUBSYSTEM_EFI_APPLICATION); /* Do these really matter? */ - o->stack_reserve_size = grub_host_to_target32 (0x10000); - o->stack_commit_size = grub_host_to_target32 (0x10000); - o->heap_reserve_size = grub_host_to_target32 (0x10000); - o->heap_commit_size = grub_host_to_target32 (0x10000); + o->stack_reserve_size = VasEBoot_host_to_target32 (0x10000); + o->stack_commit_size = VasEBoot_host_to_target32 (0x10000); + o->heap_reserve_size = VasEBoot_host_to_target32 (0x10000); + o->heap_commit_size = VasEBoot_host_to_target32 (0x10000); - o->num_data_directories = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); + o->num_data_directories = VasEBoot_host_to_target32 (VasEBoot_PE32_NUM_DATA_DIRECTORIES); - o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); - o->base_relocation_table.size = grub_host_to_target32 (layout.reloc_size); + o->base_relocation_table.rva = VasEBoot_host_to_target32 (reloc_addr); + o->base_relocation_table.size = VasEBoot_host_to_target32 (layout.reloc_size); sections = o + 1; } else { - struct grub_pe64_optional_header *o; + struct VasEBoot_pe64_optional_header *o; - c->optional_header_size = grub_host_to_target16 (sizeof (struct grub_pe64_optional_header)); + c->optional_header_size = VasEBoot_host_to_target16 (sizeof (struct VasEBoot_pe64_optional_header)); - o = (struct grub_pe64_optional_header *) - (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE - + sizeof (struct grub_pe32_coff_header)); - o->magic = grub_host_to_target16 (GRUB_PE32_PE64_MAGIC); - o->code_size = grub_host_to_target32 (layout.exec_size); - o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size + o = (struct VasEBoot_pe64_optional_header *) + (header + VasEBoot_PE32_MSDOS_STUB_SIZE + VasEBoot_PE32_SIGNATURE_SIZE + + sizeof (struct VasEBoot_pe32_coff_header)); + o->magic = VasEBoot_host_to_target16 (VasEBoot_PE32_PE64_MAGIC); + o->code_size = VasEBoot_host_to_target32 (layout.exec_size); + o->data_size = VasEBoot_cpu_to_le32 (reloc_addr - layout.exec_size - header_size); - o->bss_size = grub_cpu_to_le32 (layout.bss_size); - o->entry_addr = grub_cpu_to_le32 (layout.start_address); - o->code_base = grub_cpu_to_le32 (header_size); + o->bss_size = VasEBoot_cpu_to_le32 (layout.bss_size); + o->entry_addr = VasEBoot_cpu_to_le32 (layout.start_address); + o->code_base = VasEBoot_cpu_to_le32 (header_size); o->image_base = 0; - o->section_alignment = grub_host_to_target32 (image_target->section_align); - o->file_alignment = grub_host_to_target32 (image_target->section_align); - o->image_size = grub_host_to_target32 (pe_size); - o->header_size = grub_host_to_target32 (header_size); - o->subsystem = grub_host_to_target16 (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION); + o->section_alignment = VasEBoot_host_to_target32 (image_target->section_align); + o->file_alignment = VasEBoot_host_to_target32 (image_target->section_align); + o->image_size = VasEBoot_host_to_target32 (pe_size); + o->header_size = VasEBoot_host_to_target32 (header_size); + o->subsystem = VasEBoot_host_to_target16 (VasEBoot_PE32_SUBSYSTEM_EFI_APPLICATION); /* Do these really matter? */ - o->stack_reserve_size = grub_host_to_target64 (0x10000); - o->stack_commit_size = grub_host_to_target64 (0x10000); - o->heap_reserve_size = grub_host_to_target64 (0x10000); - o->heap_commit_size = grub_host_to_target64 (0x10000); + o->stack_reserve_size = VasEBoot_host_to_target64 (0x10000); + o->stack_commit_size = VasEBoot_host_to_target64 (0x10000); + o->heap_reserve_size = VasEBoot_host_to_target64 (0x10000); + o->heap_commit_size = VasEBoot_host_to_target64 (0x10000); o->num_data_directories - = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); + = VasEBoot_host_to_target32 (VasEBoot_PE32_NUM_DATA_DIRECTORIES); - o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); - o->base_relocation_table.size = grub_host_to_target32 (layout.reloc_size); + o->base_relocation_table.rva = VasEBoot_host_to_target32 (reloc_addr); + o->base_relocation_table.size = VasEBoot_host_to_target32 (layout.reloc_size); sections = o + 1; } /* The sections. */ text_section = sections; strcpy (text_section->name, ".text"); - text_section->virtual_size = grub_cpu_to_le32 (layout.exec_size); - text_section->virtual_address = grub_cpu_to_le32 (header_size); - text_section->raw_data_size = grub_cpu_to_le32 (layout.exec_size); - text_section->raw_data_offset = grub_cpu_to_le32 (header_size); - text_section->characteristics = grub_cpu_to_le32_compile_time ( - GRUB_PE32_SCN_CNT_CODE - | GRUB_PE32_SCN_MEM_EXECUTE - | GRUB_PE32_SCN_MEM_READ); + text_section->virtual_size = VasEBoot_cpu_to_le32 (layout.exec_size); + text_section->virtual_address = VasEBoot_cpu_to_le32 (header_size); + text_section->raw_data_size = VasEBoot_cpu_to_le32 (layout.exec_size); + text_section->raw_data_offset = VasEBoot_cpu_to_le32 (header_size); + text_section->characteristics = VasEBoot_cpu_to_le32_compile_time ( + VasEBoot_PE32_SCN_CNT_CODE + | VasEBoot_PE32_SCN_MEM_EXECUTE + | VasEBoot_PE32_SCN_MEM_READ); data_section = text_section + 1; strcpy (data_section->name, ".data"); - data_section->virtual_size = grub_cpu_to_le32 (layout.kernel_size - layout.exec_size); - data_section->virtual_address = grub_cpu_to_le32 (header_size + layout.exec_size); - data_section->raw_data_size = grub_cpu_to_le32 (layout.kernel_size - layout.exec_size); - data_section->raw_data_offset = grub_cpu_to_le32 (header_size + layout.exec_size); + data_section->virtual_size = VasEBoot_cpu_to_le32 (layout.kernel_size - layout.exec_size); + data_section->virtual_address = VasEBoot_cpu_to_le32 (header_size + layout.exec_size); + data_section->raw_data_size = VasEBoot_cpu_to_le32 (layout.kernel_size - layout.exec_size); + data_section->raw_data_offset = VasEBoot_cpu_to_le32 (header_size + layout.exec_size); data_section->characteristics - = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA - | GRUB_PE32_SCN_MEM_READ - | GRUB_PE32_SCN_MEM_WRITE); + = VasEBoot_cpu_to_le32_compile_time (VasEBoot_PE32_SCN_CNT_INITIALIZED_DATA + | VasEBoot_PE32_SCN_MEM_READ + | VasEBoot_PE32_SCN_MEM_WRITE); #if 0 bss_section = data_section + 1; strcpy (bss_section->name, ".bss"); - bss_section->virtual_size = grub_cpu_to_le32 (layout.bss_size); - bss_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size); + bss_section->virtual_size = VasEBoot_cpu_to_le32 (layout.bss_size); + bss_section->virtual_address = VasEBoot_cpu_to_le32 (header_size + layout.kernel_size); bss_section->raw_data_size = 0; bss_section->raw_data_offset = 0; bss_section->characteristics - = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_MEM_READ - | GRUB_PE32_SCN_MEM_WRITE - | GRUB_PE32_SCN_ALIGN_64BYTES - | GRUB_PE32_SCN_CNT_INITIALIZED_DATA + = VasEBoot_cpu_to_le32_compile_time (VasEBoot_PE32_SCN_MEM_READ + | VasEBoot_PE32_SCN_MEM_WRITE + | VasEBoot_PE32_SCN_ALIGN_64BYTES + | VasEBoot_PE32_SCN_CNT_INITIALIZED_DATA | 0x80); #endif mods_section = data_section + 1; strcpy (mods_section->name, "mods"); - mods_section->virtual_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); - mods_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size + layout.bss_size); - mods_section->raw_data_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); - mods_section->raw_data_offset = grub_cpu_to_le32 (header_size + layout.kernel_size); + mods_section->virtual_size = VasEBoot_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); + mods_section->virtual_address = VasEBoot_cpu_to_le32 (header_size + layout.kernel_size + layout.bss_size); + mods_section->raw_data_size = VasEBoot_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); + mods_section->raw_data_offset = VasEBoot_cpu_to_le32 (header_size + layout.kernel_size); mods_section->characteristics - = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA - | GRUB_PE32_SCN_MEM_READ - | GRUB_PE32_SCN_MEM_WRITE); + = VasEBoot_cpu_to_le32_compile_time (VasEBoot_PE32_SCN_CNT_INITIALIZED_DATA + | VasEBoot_PE32_SCN_MEM_READ + | VasEBoot_PE32_SCN_MEM_WRITE); reloc_section = mods_section + 1; strcpy (reloc_section->name, ".reloc"); - reloc_section->virtual_size = grub_cpu_to_le32 (layout.reloc_size); - reloc_section->virtual_address = grub_cpu_to_le32 (reloc_addr + layout.bss_size); - reloc_section->raw_data_size = grub_cpu_to_le32 (layout.reloc_size); - reloc_section->raw_data_offset = grub_cpu_to_le32 (reloc_addr); + reloc_section->virtual_size = VasEBoot_cpu_to_le32 (layout.reloc_size); + reloc_section->virtual_address = VasEBoot_cpu_to_le32 (reloc_addr + layout.bss_size); + reloc_section->raw_data_size = VasEBoot_cpu_to_le32 (layout.reloc_size); + reloc_section->raw_data_offset = VasEBoot_cpu_to_le32 (reloc_addr); reloc_section->characteristics - = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA - | GRUB_PE32_SCN_MEM_DISCARDABLE - | GRUB_PE32_SCN_MEM_READ); + = VasEBoot_cpu_to_le32_compile_time (VasEBoot_PE32_SCN_CNT_INITIALIZED_DATA + | VasEBoot_PE32_SCN_MEM_DISCARDABLE + | VasEBoot_PE32_SCN_MEM_READ); free (core_img); core_img = pe_img; core_size = pe_size; @@ -1332,9 +1332,9 @@ grub_install_generate_image (const char *dir, const char *prefix, char *boot_path, *boot_img; size_t boot_size; - boot_path = grub_util_get_path (dir, "boot.img"); - boot_size = grub_util_get_image_size (boot_path); - boot_img = grub_util_read_image (boot_path); + boot_path = VasEBoot_util_get_path (dir, "boot.img"); + boot_size = VasEBoot_util_get_image_size (boot_path); + boot_img = VasEBoot_util_read_image (boot_path); /* Rom sizes must be 64k-aligned. */ rom_size = ALIGN_UP (core_size + boot_size, 64 * 1024); @@ -1342,13 +1342,13 @@ grub_install_generate_image (const char *dir, const char *prefix, rom_img = xmalloc (rom_size); memset (rom_img, 0, rom_size); - *((grub_int32_t *) (core_img + GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR)) - = grub_host_to_target32 ((grub_uint32_t) -rom_size); + *((VasEBoot_int32_t *) (core_img + VasEBoot_KERNEL_I386_QEMU_CORE_ENTRY_ADDR)) + = VasEBoot_host_to_target32 ((VasEBoot_uint32_t) -rom_size); memcpy (rom_img, core_img, core_size); - *((grub_int32_t *) (boot_img + GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR)) - = grub_host_to_target32 ((grub_uint32_t) -rom_size); + *((VasEBoot_int32_t *) (boot_img + VasEBoot_BOOT_I386_QEMU_CORE_ENTRY_ADDR)) + = VasEBoot_host_to_target32 ((VasEBoot_uint32_t) -rom_size); memcpy (rom_img + rom_size - boot_size, boot_img, boot_size); @@ -1364,17 +1364,17 @@ grub_install_generate_image (const char *dir, const char *prefix, { void *aout_img; size_t aout_size; - struct grub_aout32_header *aout_head; + struct VasEBoot_aout32_header *aout_head; aout_size = core_size + sizeof (*aout_head); aout_img = xmalloc (aout_size); aout_head = aout_img; - grub_memset (aout_head, 0, sizeof (*aout_head)); - aout_head->a_midmag = grub_host_to_target32 ((AOUT_MID_SUN << 16) + VasEBoot_memset (aout_head, 0, sizeof (*aout_head)); + aout_head->a_midmag = VasEBoot_host_to_target32 ((AOUT_MID_SUN << 16) | AOUT32_OMAGIC); - aout_head->a_text = grub_host_to_target32 (core_size); + aout_head->a_text = VasEBoot_host_to_target32 (core_size); aout_head->a_entry - = grub_host_to_target32 (GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS); + = VasEBoot_host_to_target32 (VasEBoot_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS); memcpy ((char *) aout_img + sizeof (*aout_head), core_img, core_size); free (core_img); @@ -1388,22 +1388,22 @@ grub_install_generate_image (const char *dir, const char *prefix, char *boot_path, *boot_img; size_t boot_size; - num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); - num <<= GRUB_DISK_SECTOR_BITS; + num = ((core_size + VasEBoot_DISK_SECTOR_SIZE - 1) >> VasEBoot_DISK_SECTOR_BITS); + num <<= VasEBoot_DISK_SECTOR_BITS; - boot_path = grub_util_get_path (dir, "diskboot.img"); - boot_size = grub_util_get_image_size (boot_path); - if (boot_size != GRUB_DISK_SECTOR_SIZE) - grub_util_error (_("diskboot.img size must be %u bytes"), - GRUB_DISK_SECTOR_SIZE); + boot_path = VasEBoot_util_get_path (dir, "diskboot.img"); + boot_size = VasEBoot_util_get_image_size (boot_path); + if (boot_size != VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_util_error (_("diskboot.img size must be %u bytes"), + VasEBoot_DISK_SECTOR_SIZE); - boot_img = grub_util_read_image (boot_path); + boot_img = VasEBoot_util_read_image (boot_path); - *((grub_uint32_t *) (boot_img + GRUB_DISK_SECTOR_SIZE - - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE + 8)) - = grub_host_to_target32 (num); + *((VasEBoot_uint32_t *) (boot_img + VasEBoot_DISK_SECTOR_SIZE + - VasEBoot_BOOT_SPARC64_IEEE1275_LIST_SIZE + 8)) + = VasEBoot_host_to_target32 (num); - grub_util_write_image (boot_img, boot_size, out, outname); + VasEBoot_util_write_image (boot_img, boot_size, out, outname); free (boot_img); free (boot_path); } @@ -1419,7 +1419,7 @@ grub_install_generate_image (const char *dir, const char *prefix, size_t boot_size; /* fwstart.img is the only part which can't be tested by using *-elf target. Check it against the checksum. */ - const grub_uint8_t yeeloong_fwstart_good_hash[512 / 8] = + const VasEBoot_uint8_t yeeloong_fwstart_good_hash[512 / 8] = { 0x5f, 0x67, 0x46, 0x57, 0x31, 0x30, 0xc5, 0x0a, 0xe9, 0x98, 0x18, 0xc9, 0xf3, 0xca, 0x45, 0xa5, @@ -1430,7 +1430,7 @@ grub_install_generate_image (const char *dir, const char *prefix, 0x5e, 0x5f, 0x23, 0x7d, 0x7a, 0xe8, 0x51, 0xf7, 0x1a, 0xaf, 0x2f, 0x54, 0x11, 0x2e, 0x5c, 0x25 }; - const grub_uint8_t fuloong2f_fwstart_good_hash[512 / 8] = + const VasEBoot_uint8_t fuloong2f_fwstart_good_hash[512 / 8] = { 0x76, 0x9b, 0xad, 0x6e, 0xa2, 0x39, 0x47, 0x62, 0x1f, 0xc9, 0x3a, 0x6d, 0x05, 0x5c, 0x43, 0x5c, @@ -1441,34 +1441,34 @@ grub_install_generate_image (const char *dir, const char *prefix, 0xe6, 0xf1, 0x08, 0x89, 0xbe, 0xbc, 0x73, 0xab, 0x46, 0x50, 0xd6, 0x21, 0xce, 0x8e, 0x24, 0xa7 }; - const grub_uint8_t *fwstart_good_hash; - grub_uint8_t fwstart_hash[512 / 8]; + const VasEBoot_uint8_t *fwstart_good_hash; + VasEBoot_uint8_t fwstart_hash[512 / 8]; if (image_target->id == IMAGE_FULOONG2F_FLASH) { fwstart_good_hash = fuloong2f_fwstart_good_hash; - boot_path = grub_util_get_path (dir, "fwstart_fuloong2f.img"); + boot_path = VasEBoot_util_get_path (dir, "fwstart_fuloong2f.img"); } else { fwstart_good_hash = yeeloong_fwstart_good_hash; - boot_path = grub_util_get_path (dir, "fwstart.img"); + boot_path = VasEBoot_util_get_path (dir, "fwstart.img"); } - boot_size = grub_util_get_image_size (boot_path); - boot_img = grub_util_read_image (boot_path); + boot_size = VasEBoot_util_get_image_size (boot_path); + boot_img = VasEBoot_util_read_image (boot_path); - grub_crypto_hash (GRUB_MD_SHA512, fwstart_hash, boot_img, boot_size); + VasEBoot_crypto_hash (VasEBoot_MD_SHA512, fwstart_hash, boot_img, boot_size); - if (grub_memcmp (fwstart_hash, fwstart_good_hash, - GRUB_MD_SHA512->mdlen) != 0) + if (VasEBoot_memcmp (fwstart_hash, fwstart_good_hash, + VasEBoot_MD_SHA512->mdlen) != 0) /* TRANSLATORS: fwstart.img may still be good, just it wasn't checked. */ - grub_util_warn ("%s", + VasEBoot_util_warn ("%s", _("fwstart.img doesn't match the known good version. " "proceed at your own risk")); if (core_size + boot_size > 512 * 1024) - grub_util_error ("%s", _("firmware image is too big")); + VasEBoot_util_error ("%s", _("firmware image is too big")); rom_size = 512 * 1024; rom_img = xmalloc (rom_size); @@ -1494,7 +1494,7 @@ grub_install_generate_image (const char *dir, const char *prefix, size_t rom_size; if (core_size > 512 * 1024) - grub_util_error ("%s", _("firmware image is too big")); + VasEBoot_util_error ("%s", _("firmware image is too big")); rom_size = 512 * 1024; rom_img = xmalloc (rom_size); @@ -1513,28 +1513,28 @@ grub_install_generate_image (const char *dir, const char *prefix, case IMAGE_UBOOT: { - struct grub_uboot_image_header *hdr; + struct VasEBoot_uboot_image_header *hdr; - hdr = xmalloc (core_size + sizeof (struct grub_uboot_image_header)); + hdr = xmalloc (core_size + sizeof (struct VasEBoot_uboot_image_header)); memcpy (hdr + 1, core_img, core_size); memset (hdr, 0, sizeof (*hdr)); - hdr->ih_magic = grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAGIC); - hdr->ih_time = grub_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP); - hdr->ih_size = grub_cpu_to_be32 (core_size); + hdr->ih_magic = VasEBoot_cpu_to_be32_compile_time (VasEBoot_UBOOT_IH_MAGIC); + hdr->ih_time = VasEBoot_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP); + hdr->ih_size = VasEBoot_cpu_to_be32 (core_size); hdr->ih_load = 0; hdr->ih_ep = 0; - hdr->ih_type = GRUB_UBOOT_IH_TYPE_KERNEL_NOLOAD; - hdr->ih_os = GRUB_UBOOT_IH_OS_LINUX; - hdr->ih_arch = GRUB_UBOOT_IH_ARCH_ARM; - hdr->ih_comp = GRUB_UBOOT_IH_COMP_NONE; + hdr->ih_type = VasEBoot_UBOOT_IH_TYPE_KERNEL_NOLOAD; + hdr->ih_os = VasEBoot_UBOOT_IH_OS_LINUX; + hdr->ih_arch = VasEBoot_UBOOT_IH_ARCH_ARM; + hdr->ih_comp = VasEBoot_UBOOT_IH_COMP_NONE; - grub_crypto_hash (GRUB_MD_CRC32, &hdr->ih_dcrc, hdr + 1, core_size); - grub_crypto_hash (GRUB_MD_CRC32, &hdr->ih_hcrc, hdr, sizeof (*hdr)); + VasEBoot_crypto_hash (VasEBoot_MD_CRC32, &hdr->ih_dcrc, hdr + 1, core_size); + VasEBoot_crypto_hash (VasEBoot_MD_CRC32, &hdr->ih_hcrc, hdr, sizeof (*hdr)); free (core_img); core_img = (char *) hdr; - core_size += sizeof (struct grub_uboot_image_header); + core_size += sizeof (struct VasEBoot_uboot_image_header); } break; @@ -1542,76 +1542,76 @@ grub_install_generate_image (const char *dir, const char *prefix, { char *ecoff_img; struct ecoff_header { - grub_uint16_t magic; - grub_uint16_t nsec; - grub_uint32_t time; - grub_uint32_t syms; - grub_uint32_t nsyms; - grub_uint16_t opt; - grub_uint16_t flags; - grub_uint16_t magic2; - grub_uint16_t version; - grub_uint32_t textsize; - grub_uint32_t datasize; - grub_uint32_t bsssize; - grub_uint32_t entry; - grub_uint32_t text_start; - grub_uint32_t data_start; - grub_uint32_t bss_start; - grub_uint32_t gprmask; - grub_uint32_t cprmask[4]; - grub_uint32_t gp_value; + VasEBoot_uint16_t magic; + VasEBoot_uint16_t nsec; + VasEBoot_uint32_t time; + VasEBoot_uint32_t syms; + VasEBoot_uint32_t nsyms; + VasEBoot_uint16_t opt; + VasEBoot_uint16_t flags; + VasEBoot_uint16_t magic2; + VasEBoot_uint16_t version; + VasEBoot_uint32_t textsize; + VasEBoot_uint32_t datasize; + VasEBoot_uint32_t bsssize; + VasEBoot_uint32_t entry; + VasEBoot_uint32_t text_start; + VasEBoot_uint32_t data_start; + VasEBoot_uint32_t bss_start; + VasEBoot_uint32_t gprmask; + VasEBoot_uint32_t cprmask[4]; + VasEBoot_uint32_t gp_value; }; struct ecoff_section { char name[8]; - grub_uint32_t paddr; - grub_uint32_t vaddr; - grub_uint32_t size; - grub_uint32_t file_offset; - grub_uint32_t reloc; - grub_uint32_t gp; - grub_uint16_t nreloc; - grub_uint16_t ngp; - grub_uint32_t flags; + VasEBoot_uint32_t paddr; + VasEBoot_uint32_t vaddr; + VasEBoot_uint32_t size; + VasEBoot_uint32_t file_offset; + VasEBoot_uint32_t reloc; + VasEBoot_uint32_t gp; + VasEBoot_uint16_t nreloc; + VasEBoot_uint16_t ngp; + VasEBoot_uint32_t flags; }; struct ecoff_header *head; struct ecoff_section *section; - grub_uint32_t target_addr; + VasEBoot_uint32_t target_addr; size_t program_size; program_size = ALIGN_ADDR (core_size); - if (comp == GRUB_COMPRESSION_NONE) + if (comp == VasEBoot_COMPRESSION_NONE) target_addr = (image_target->link_addr - decompress_size); else target_addr = ALIGN_UP (image_target->link_addr + layout.kernel_size + total_module_size, 32); ecoff_img = xmalloc (program_size + sizeof (*head) + sizeof (*section)); - grub_memset (ecoff_img, 0, program_size + sizeof (*head) + sizeof (*section)); + VasEBoot_memset (ecoff_img, 0, program_size + sizeof (*head) + sizeof (*section)); head = (void *) ecoff_img; section = (void *) (head + 1); - head->magic = image_target->bigendian ? grub_host_to_target16 (0x160) - : grub_host_to_target16 (0x166); - head->nsec = grub_host_to_target16 (1); - head->time = grub_host_to_target32 (0); - head->opt = grub_host_to_target16 (0x38); + head->magic = image_target->bigendian ? VasEBoot_host_to_target16 (0x160) + : VasEBoot_host_to_target16 (0x166); + head->nsec = VasEBoot_host_to_target16 (1); + head->time = VasEBoot_host_to_target32 (0); + head->opt = VasEBoot_host_to_target16 (0x38); head->flags = image_target->bigendian - ? grub_host_to_target16 (0x207) - : grub_host_to_target16 (0x103); - head->magic2 = grub_host_to_target16 (0x107); - head->textsize = grub_host_to_target32 (program_size); - head->entry = grub_host_to_target32 (target_addr); - head->text_start = grub_host_to_target32 (target_addr); - head->data_start = grub_host_to_target32 (target_addr + program_size); - grub_memcpy (section->name, ".text", sizeof (".text") - 1); - section->vaddr = grub_host_to_target32 (target_addr); - section->size = grub_host_to_target32 (program_size); - section->file_offset = grub_host_to_target32 (sizeof (*head) + sizeof (*section)); + ? VasEBoot_host_to_target16 (0x207) + : VasEBoot_host_to_target16 (0x103); + head->magic2 = VasEBoot_host_to_target16 (0x107); + head->textsize = VasEBoot_host_to_target32 (program_size); + head->entry = VasEBoot_host_to_target32 (target_addr); + head->text_start = VasEBoot_host_to_target32 (target_addr); + head->data_start = VasEBoot_host_to_target32 (target_addr + program_size); + VasEBoot_memcpy (section->name, ".text", sizeof (".text") - 1); + section->vaddr = VasEBoot_host_to_target32 (target_addr); + section->size = VasEBoot_host_to_target32 (program_size); + section->file_offset = VasEBoot_host_to_target32 (sizeof (*head) + sizeof (*section)); if (!image_target->bigendian) { - section->paddr = grub_host_to_target32 (0xaa60); - section->flags = grub_host_to_target32 (0x20); + section->paddr = VasEBoot_host_to_target32 (0xaa60); + section->flags = VasEBoot_host_to_target32 (0x20); } memcpy (section + 1, core_img, core_size); free (core_img); @@ -1625,10 +1625,10 @@ grub_install_generate_image (const char *dir, const char *prefix, case IMAGE_COREBOOT: case IMAGE_I386_IEEE1275: { - grub_uint64_t target_addr; + VasEBoot_uint64_t target_addr; if (image_target->id == IMAGE_LOONGSON_ELF) { - if (comp == GRUB_COMPRESSION_NONE) + if (comp == VasEBoot_COMPRESSION_NONE) target_addr = (image_target->link_addr - decompress_size); else target_addr = ALIGN_UP (image_target->link_addr @@ -1637,19 +1637,19 @@ grub_install_generate_image (const char *dir, const char *prefix, else target_addr = image_target->link_addr; if (image_target->voidp_sizeof == 4) - grub_mkimage_generate_elf32 (image_target, note, &core_img, &core_size, + VasEBoot_mkimage_generate_elf32 (image_target, note, &core_img, &core_size, target_addr, layout.align, layout.kernel_size, layout.bss_size); else - grub_mkimage_generate_elf64 (image_target, note, &core_img, &core_size, + VasEBoot_mkimage_generate_elf64 (image_target, note, &core_img, &core_size, target_addr, layout.align, layout.kernel_size, layout.bss_size); } break; } - grub_util_write_image (core_img, core_size, out, outname); + VasEBoot_util_write_image (core_img, core_size, out, outname); free (core_img); free (kernel_path); free (layout.reloc_section); - grub_util_free_path_list (path_list); + VasEBoot_util_free_path_list (path_list); } diff --git a/util/probe.c b/util/probe.c index fa7ca34d1..e419de007 100644 --- a/util/probe.c +++ b/util/probe.c @@ -1,47 +1,47 @@ -/* grub-probe.c - probe device information for a given path */ +/* VasEBoot-probe.c - probe device information for a given path */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2005,2006,2007,2008,2009,2010,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -/* Since OF path names can have "," characters in them, and GRUB +/* Since OF path names can have "," characters in them, and VasEBoot internally uses "," to indicate partitions (unlike OF which uses ":" for this purpose) we escape such commas. */ static char * @@ -69,11 +69,11 @@ escape_of_path (const char *orig_path) } char * -grub_util_guess_bios_drive (const char *orig_path) +VasEBoot_util_guess_bios_drive (const char *orig_path) { char *canon; char *ptr; - canon = grub_canonicalize_file_name (orig_path); + canon = VasEBoot_canonicalize_file_name (orig_path); if (!canon) return NULL; ptr = strrchr (orig_path, '/'); @@ -98,11 +98,11 @@ grub_util_guess_bios_drive (const char *orig_path) } char * -grub_util_guess_efi_drive (const char *orig_path) +VasEBoot_util_guess_efi_drive (const char *orig_path) { char *canon; char *ptr; - canon = grub_canonicalize_file_name (orig_path); + canon = VasEBoot_canonicalize_file_name (orig_path); if (!canon) return NULL; ptr = strrchr (orig_path, '/'); @@ -127,11 +127,11 @@ grub_util_guess_efi_drive (const char *orig_path) } char * -grub_util_guess_baremetal_drive (const char *orig_path) +VasEBoot_util_guess_baremetal_drive (const char *orig_path) { char *canon; char *ptr; - canon = grub_canonicalize_file_name (orig_path); + canon = VasEBoot_canonicalize_file_name (orig_path); if (!canon) return NULL; ptr = strrchr (orig_path, '/'); @@ -156,13 +156,13 @@ grub_util_guess_baremetal_drive (const char *orig_path) } void -grub_util_fprint_full_disk_name (FILE *f, - const char *drive, grub_device_t dev) +VasEBoot_util_fprint_full_disk_name (FILE *f, + const char *drive, VasEBoot_device_t dev) { char *dname = escape_of_path (drive); if (dev->disk->partition) { - char *pname = grub_partition_get_name (dev->disk->partition); + char *pname = VasEBoot_partition_get_name (dev->disk->partition); fprintf (f, "%s,%s", dname, pname); free (pname); } diff --git a/util/render-label.c b/util/render-label.c index 91c080c9c..2de75b670 100644 --- a/util/render-label.c +++ b/util/render-label.c @@ -1,32 +1,32 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2012,2013 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #define _GNU_SOURCE 1 @@ -38,15 +38,15 @@ struct header { - grub_uint8_t magic; - grub_uint16_t width; - grub_uint16_t height; -} GRUB_PACKED; + VasEBoot_uint8_t magic; + VasEBoot_uint16_t width; + VasEBoot_uint16_t height; +} VasEBoot_PACKED; -static struct grub_video_palette_data ieee1275_palette[256]; +static struct VasEBoot_video_palette_data ieee1275_palette[256]; void -grub_util_render_label (const char *label_font, +VasEBoot_util_render_label (const char *label_font, const char *label_bgcolor, const char *label_color, const char *text, @@ -55,33 +55,33 @@ grub_util_render_label (const char *label_font, struct header head; FILE *out; int i, j, k, cptr = 0; - grub_font_t font; + VasEBoot_font_t font; char *fontfull; - const grub_uint8_t vals[] = { 0xff, 0xda, 0xb3, 0x87, 0x54, 0x00 }; - const grub_uint8_t vals2[] = { 0xf3, 0xe7, 0xcd, 0xc0, 0xa5, 0x96, + const VasEBoot_uint8_t vals[] = { 0xff, 0xda, 0xb3, 0x87, 0x54, 0x00 }; + const VasEBoot_uint8_t vals2[] = { 0xf3, 0xe7, 0xcd, 0xc0, 0xa5, 0x96, 0x77, 0x66, 0x3f, 0x27 }; int width, height; - grub_uint8_t bg, fg; - struct grub_video_mode_info mode_info; - grub_err_t err; - grub_video_rgba_color_t fgcolor; - grub_video_rgba_color_t bgcolor; + VasEBoot_uint8_t bg, fg; + struct VasEBoot_video_mode_info mode_info; + VasEBoot_err_t err; + VasEBoot_video_rgba_color_t fgcolor; + VasEBoot_video_rgba_color_t bgcolor; if (output) - out = grub_util_fopen (output, "wb"); + out = VasEBoot_util_fopen (output, "wb"); else out = stdout; if (!out) { - grub_util_error (_("cannot open `%s': %s"), output ? : "stdout", + VasEBoot_util_error (_("cannot open `%s': %s"), output ? : "stdout", strerror (errno)); } if (label_color) { - err = grub_video_parse_color (label_color, &fgcolor); + err = VasEBoot_video_parse_color (label_color, &fgcolor); if (err) - grub_util_error (_("invalid color specification `%s'"), label_color); + VasEBoot_util_error (_("invalid color specification `%s'"), label_color); } else { @@ -93,9 +93,9 @@ grub_util_render_label (const char *label_font, if (label_bgcolor) { - err = grub_video_parse_color (label_bgcolor, &bgcolor); + err = VasEBoot_video_parse_color (label_bgcolor, &bgcolor); if (err) - grub_util_error (_("invalid color specification `%s'"), label_bgcolor); + VasEBoot_util_error (_("invalid color specification `%s'"), label_bgcolor); } else { @@ -157,57 +157,57 @@ grub_util_render_label (const char *label_font, ieee1275_palette[cptr].a = 0xff; char * t; - t = grub_canonicalize_file_name (label_font); + t = VasEBoot_canonicalize_file_name (label_font); if (!t) { - grub_util_error (_("cannot open `%s': %s"), label_font, + VasEBoot_util_error (_("cannot open `%s': %s"), label_font, strerror (errno)); } fontfull = xasprintf ("(host)/%s", t); free (t); - grub_font_loader_init (); - font = grub_font_load (fontfull); + VasEBoot_font_loader_init (); + font = VasEBoot_font_load (fontfull); if (!font) { - grub_util_error (_("cannot open `%s': %s"), label_font, - grub_errmsg); + VasEBoot_util_error (_("cannot open `%s': %s"), label_font, + VasEBoot_errmsg); } - width = grub_font_get_string_width (font, text) + 10; - height = grub_font_get_height (font); + width = VasEBoot_font_get_string_width (font, text) + 10; + height = VasEBoot_font_get_height (font); mode_info.width = width; mode_info.height = height; mode_info.pitch = width; - mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + mode_info.mode_type = VasEBoot_VIDEO_MODE_TYPE_INDEX_COLOR; mode_info.bpp = 8; mode_info.bytes_per_pixel = 1; mode_info.number_of_colors = 256; - grub_video_capture_start (&mode_info, ieee1275_palette, + VasEBoot_video_capture_start (&mode_info, ieee1275_palette, ARRAY_SIZE (ieee1275_palette)); - fg = grub_video_map_rgb (fgcolor.red, + fg = VasEBoot_video_map_rgb (fgcolor.red, fgcolor.green, fgcolor.blue); - bg = grub_video_map_rgb (bgcolor.red, + bg = VasEBoot_video_map_rgb (bgcolor.red, bgcolor.green, bgcolor.blue); - grub_memset (grub_video_capture_get_framebuffer (), bg, height * width); - grub_font_draw_string (text, font, fg, - 5, grub_font_get_ascent (font)); + VasEBoot_memset (VasEBoot_video_capture_get_framebuffer (), bg, height * width); + VasEBoot_font_draw_string (text, font, fg, + 5, VasEBoot_font_get_ascent (font)); head.magic = 1; - head.width = grub_cpu_to_be16 (width); - head.height = grub_cpu_to_be16 (height); + head.width = VasEBoot_cpu_to_be16 (width); + head.height = VasEBoot_cpu_to_be16 (height); fwrite (&head, 1, sizeof (head), out); - fwrite (grub_video_capture_get_framebuffer (), 1, width * height, out); + fwrite (VasEBoot_video_capture_get_framebuffer (), 1, width * height, out); - grub_video_capture_end (); + VasEBoot_video_capture_end (); if (out != stdout) fclose (out); diff --git a/util/resolve.c b/util/resolve.c index 3e887d2ff..8886df86e 100644 --- a/util/resolve.c +++ b/util/resolve.c @@ -1,19 +1,19 @@ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2002,2007 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include @@ -24,11 +24,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Module. */ struct mod_list @@ -90,7 +90,7 @@ read_dep_list (FILE *fp) /* Get the target name. */ p = strchr (buf, ':'); if (! p) - grub_util_error (_("invalid line format: %s"), buf); + VasEBoot_util_error (_("invalid line format: %s"), buf); *p++ = '\0'; @@ -108,7 +108,7 @@ read_dep_list (FILE *fp) char *name; /* Skip whitespace. */ - while (*p && grub_isspace (*p)) + while (*p && VasEBoot_isspace (*p)) p++; if (! *p) @@ -117,7 +117,7 @@ read_dep_list (FILE *fp) name = p; /* Skip non-whitespace. */ - while (*p && ! grub_isspace (*p)) + while (*p && ! VasEBoot_isspace (*p)) p++; *p++ = '\0'; @@ -179,7 +179,7 @@ get_module_path (const char *prefix, const char *str) if (dir) return base; - ret = grub_util_get_path (prefix, base); + ret = VasEBoot_util_get_path (prefix, base); free (base); return ret; } @@ -188,11 +188,11 @@ static void add_module (const char *dir, struct dep_list *dep_list, struct mod_list **mod_head, - struct grub_util_path_list **path_head, + struct VasEBoot_util_path_list **path_head, const char *name) { char *mod_name; - struct grub_util_path_list *path; + struct VasEBoot_util_path_list *path; struct mod_list *mod; struct dep_list *dep; @@ -223,14 +223,14 @@ add_module (const char *dir, *mod_head = mod; /* Add this path. */ - path = (struct grub_util_path_list *) xmalloc (sizeof (*path)); + path = (struct VasEBoot_util_path_list *) xmalloc (sizeof (*path)); path->name = get_module_path (dir, name); path->next = *path_head; *path_head = path; } -struct grub_util_path_list * -grub_util_resolve_dependencies (const char *prefix, +struct VasEBoot_util_path_list * +VasEBoot_util_resolve_dependencies (const char *prefix, const char *dep_list_file, char *modules[]) { @@ -238,12 +238,12 @@ grub_util_resolve_dependencies (const char *prefix, FILE *fp; struct dep_list *dep_list; struct mod_list *mod_list = 0; - struct grub_util_path_list *path_list = 0; + struct VasEBoot_util_path_list *path_list = 0; - path = grub_util_get_path (prefix, dep_list_file); - fp = grub_util_fopen (path, "r"); + path = VasEBoot_util_get_path (prefix, dep_list_file); + fp = VasEBoot_util_fopen (path, "r"); if (! fp) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + VasEBoot_util_error (_("cannot open `%s': %s"), path, strerror (errno)); free (path); dep_list = read_dep_list (fp); @@ -259,7 +259,7 @@ grub_util_resolve_dependencies (const char *prefix, free_mod_list (mod_list); { /* Reverse the path_list */ - struct grub_util_path_list *p, *prev, *next; + struct VasEBoot_util_path_list *p, *prev, *next; for (p = path_list, prev = NULL; p; p = next) { @@ -273,9 +273,9 @@ grub_util_resolve_dependencies (const char *prefix, } void -grub_util_free_path_list (struct grub_util_path_list *path_list) +VasEBoot_util_free_path_list (struct VasEBoot_util_path_list *path_list) { - struct grub_util_path_list *next; + struct VasEBoot_util_path_list *next; while (path_list) { diff --git a/util/setup.c b/util/setup.c index 8aa5a39a7..93192a51b 100644 --- a/util/setup.c +++ b/util/setup.c @@ -1,43 +1,43 @@ -/* grub-setup.c - make GRUB usable */ +/* VasEBoot-setup.c - make VasEBoot usable */ /* - * GRUB -- GRand Unified Bootloader + * VasEBoot -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * - * GRUB is free software: you can redistribute it and/or modify + * VasEBoot 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, + * VasEBoot 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 . + * along with VasEBoot. If not, see . */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef GRUB_SETUP_SPARC64 -#include -#include -#include +#ifdef VasEBoot_SETUP_SPARC64 +#include +#include +#include #else -#include -#include +#include +#include #endif #include @@ -48,13 +48,13 @@ #include #include #include -#include +#include #include "progname.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -64,11 +64,11 @@ * The 'boot' image needs to know the OBP path name of the root * device. It also needs to know the initial block number of * 'core' (which is 'diskboot' concatenated with 'kernel' and - * all the modules, this is created by grub-mkimage). This resulting + * all the modules, this is created by VasEBoot-mkimage). This resulting * 'boot' image is 512 bytes in size and is placed in the second block * of a partition. * - * The initial 'diskboot' block acts as a loader for the actual GRUB + * The initial 'diskboot' block acts as a loader for the actual VasEBoot * kernel. It contains the loading code and then a block list. * * The block list of 'core' starts at the end of the 'diskboot' image @@ -78,53 +78,53 @@ * result. */ -#ifdef GRUB_SETUP_SPARC64 -#define grub_target_to_host16(x) grub_be_to_cpu16(x) -#define grub_target_to_host32(x) grub_be_to_cpu32(x) -#define grub_target_to_host64(x) grub_be_to_cpu64(x) -#define grub_host_to_target16(x) grub_cpu_to_be16(x) -#define grub_host_to_target32(x) grub_cpu_to_be32(x) -#define grub_host_to_target64(x) grub_cpu_to_be64(x) -#elif defined (GRUB_SETUP_BIOS) -#define grub_target_to_host16(x) grub_le_to_cpu16(x) -#define grub_target_to_host32(x) grub_le_to_cpu32(x) -#define grub_target_to_host64(x) grub_le_to_cpu64(x) -#define grub_host_to_target16(x) grub_cpu_to_le16(x) -#define grub_host_to_target32(x) grub_cpu_to_le32(x) -#define grub_host_to_target64(x) grub_cpu_to_le64(x) +#ifdef VasEBoot_SETUP_SPARC64 +#define VasEBoot_target_to_host16(x) VasEBoot_be_to_cpu16(x) +#define VasEBoot_target_to_host32(x) VasEBoot_be_to_cpu32(x) +#define VasEBoot_target_to_host64(x) VasEBoot_be_to_cpu64(x) +#define VasEBoot_host_to_target16(x) VasEBoot_cpu_to_be16(x) +#define VasEBoot_host_to_target32(x) VasEBoot_cpu_to_be32(x) +#define VasEBoot_host_to_target64(x) VasEBoot_cpu_to_be64(x) +#elif defined (VasEBoot_SETUP_BIOS) +#define VasEBoot_target_to_host16(x) VasEBoot_le_to_cpu16(x) +#define VasEBoot_target_to_host32(x) VasEBoot_le_to_cpu32(x) +#define VasEBoot_target_to_host64(x) VasEBoot_le_to_cpu64(x) +#define VasEBoot_host_to_target16(x) VasEBoot_cpu_to_le16(x) +#define VasEBoot_host_to_target32(x) VasEBoot_cpu_to_le32(x) +#define VasEBoot_host_to_target64(x) VasEBoot_cpu_to_le64(x) #else #error Complete this #endif static void -write_rootdev (grub_device_t root_dev, - char *boot_img, grub_uint64_t first_sector) +write_rootdev (VasEBoot_device_t root_dev, + char *boot_img, VasEBoot_uint64_t first_sector) { -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS { - grub_uint8_t *boot_drive; + VasEBoot_uint8_t *boot_drive; void *kernel_sector; - boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE); - kernel_sector = (boot_img + GRUB_BOOT_MACHINE_KERNEL_SECTOR); + boot_drive = (VasEBoot_uint8_t *) (boot_img + VasEBoot_BOOT_MACHINE_BOOT_DRIVE); + kernel_sector = (boot_img + VasEBoot_BOOT_MACHINE_KERNEL_SECTOR); /* FIXME: can this be skipped? */ *boot_drive = 0xFF; - grub_set_unaligned64 (kernel_sector, grub_cpu_to_le64 (first_sector)); + VasEBoot_set_unaligned64 (kernel_sector, VasEBoot_cpu_to_le64 (first_sector)); } #endif -#ifdef GRUB_SETUP_SPARC64 +#ifdef VasEBoot_SETUP_SPARC64 { void *kernel_byte; - kernel_byte = (boot_img + GRUB_BOOT_AOUT_HEADER_SIZE - + GRUB_BOOT_MACHINE_KERNEL_BYTE); - grub_set_unaligned64 (kernel_byte, - grub_cpu_to_be64 (first_sector << GRUB_DISK_SECTOR_BITS)); + kernel_byte = (boot_img + VasEBoot_BOOT_AOUT_HEADER_SIZE + + VasEBoot_BOOT_MACHINE_KERNEL_BYTE); + VasEBoot_set_unaligned64 (kernel_byte, + VasEBoot_cpu_to_be64 (first_sector << VasEBoot_DISK_SECTOR_BITS)); } #endif } -#ifdef GRUB_SETUP_SPARC64 +#ifdef VasEBoot_SETUP_SPARC64 #define BOOT_SECTOR 1 #else #define BOOT_SECTOR 0 @@ -134,76 +134,76 @@ write_rootdev (grub_device_t root_dev, struct blocklists { - struct grub_boot_blocklist *first_block, *block; -#ifdef GRUB_SETUP_BIOS - grub_uint16_t current_segment; + struct VasEBoot_boot_blocklist *first_block, *block; +#ifdef VasEBoot_SETUP_BIOS + VasEBoot_uint16_t current_segment; #endif - grub_uint16_t last_length; - grub_disk_addr_t first_sector; + VasEBoot_uint16_t last_length; + VasEBoot_disk_addr_t first_sector; }; /* Helper for setup. */ static void -save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length, +save_blocklists (VasEBoot_disk_addr_t sector, unsigned offset, unsigned length, void *data) { struct blocklists *bl = data; - struct grub_boot_blocklist *prev = bl->block + 1; - grub_uint64_t seclen; + struct VasEBoot_boot_blocklist *prev = bl->block + 1; + VasEBoot_uint64_t seclen; - grub_util_info ("saving <%" GRUB_HOST_PRIuLONG_LONG ",%u,%u>", + VasEBoot_util_info ("saving <%" VasEBoot_HOST_PRIuLONG_LONG ",%u,%u>", (unsigned long long) sector, offset, length); - if (bl->first_sector == (grub_disk_addr_t) -1) + if (bl->first_sector == (VasEBoot_disk_addr_t) -1) { - if (offset != 0 || length < GRUB_DISK_SECTOR_SIZE) - grub_util_error ("%s", _("the first sector of the core file is not sector-aligned")); + if (offset != 0 || length < VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_util_error ("%s", _("the first sector of the core file is not sector-aligned")); bl->first_sector = sector; sector++; - length -= GRUB_DISK_SECTOR_SIZE; + length -= VasEBoot_DISK_SECTOR_SIZE; if (!length) return; } if (offset != 0 || bl->last_length != 0) - grub_util_error ("%s", _("non-sector-aligned data is found in the core file")); + VasEBoot_util_error ("%s", _("non-sector-aligned data is found in the core file")); - seclen = (length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS; + seclen = (length + VasEBoot_DISK_SECTOR_SIZE - 1) >> VasEBoot_DISK_SECTOR_BITS; if (bl->block != bl->first_block - && (grub_target_to_host64 (prev->start) - + grub_target_to_host16 (prev->len)) == sector) + && (VasEBoot_target_to_host64 (prev->start) + + VasEBoot_target_to_host16 (prev->len)) == sector) { - grub_uint16_t t = grub_target_to_host16 (prev->len); + VasEBoot_uint16_t t = VasEBoot_target_to_host16 (prev->len); t += seclen; - prev->len = grub_host_to_target16 (t); + prev->len = VasEBoot_host_to_target16 (t); } else { - bl->block->start = grub_host_to_target64 (sector); - bl->block->len = grub_host_to_target16 (seclen); -#ifdef GRUB_SETUP_BIOS - bl->block->segment = grub_host_to_target16 (bl->current_segment); + bl->block->start = VasEBoot_host_to_target64 (sector); + bl->block->len = VasEBoot_host_to_target16 (seclen); +#ifdef VasEBoot_SETUP_BIOS + bl->block->segment = VasEBoot_host_to_target16 (bl->current_segment); #endif bl->block--; if (bl->block->len) - grub_util_error ("%s", _("the sectors of the core file are too fragmented")); + VasEBoot_util_error ("%s", _("the sectors of the core file are too fragmented")); } - bl->last_length = length & (GRUB_DISK_SECTOR_SIZE - 1); -#ifdef GRUB_SETUP_BIOS - bl->current_segment += seclen << (GRUB_DISK_SECTOR_BITS - 4); + bl->last_length = length & (VasEBoot_DISK_SECTOR_SIZE - 1); +#ifdef VasEBoot_SETUP_BIOS + bl->current_segment += seclen << (VasEBoot_DISK_SECTOR_BITS - 4); #endif } -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS /* Context for setup/identify_partmap. */ struct identify_partmap_ctx { - grub_partition_map_t dest_partmap; - grub_partition_t container; + VasEBoot_partition_map_t dest_partmap; + VasEBoot_partition_t container; int multiple_partmaps; }; @@ -211,8 +211,8 @@ struct identify_partmap_ctx Unlike root_dev, with dest_dev we're interested in the partition map even if dest_dev itself is a whole disk. */ static int -identify_partmap (grub_disk_t disk __attribute__ ((unused)), - const grub_partition_t p, void *data) +identify_partmap (VasEBoot_disk_t disk __attribute__ ((unused)), + const VasEBoot_partition_t p, void *data) { struct identify_partmap_ctx *ctx = data; @@ -221,8 +221,8 @@ identify_partmap (grub_disk_t disk __attribute__ ((unused)), /* NetBSD and OpenBSD subpartitions have metadata inside a partition, so they are safe to ignore. */ - if (grub_strcmp (p->partmap->name, "netbsd") == 0 - || grub_strcmp (p->partmap->name, "openbsd") == 0) + if (VasEBoot_strcmp (p->partmap->name, "netbsd") == 0 + || VasEBoot_strcmp (p->partmap->name, "openbsd") == 0) return 0; if (ctx->dest_partmap == NULL) { @@ -236,10 +236,10 @@ identify_partmap (grub_disk_t disk __attribute__ ((unused)), } #endif -#ifdef GRUB_SETUP_BIOS -#define SETUP grub_util_bios_setup -#elif GRUB_SETUP_SPARC64 -#define SETUP grub_util_sparc_setup +#ifdef VasEBoot_SETUP_BIOS +#define SETUP VasEBoot_util_bios_setup +#elif VasEBoot_SETUP_SPARC64 +#define SETUP VasEBoot_util_sparc_setup #else #error "Shouldn't happen" #endif @@ -255,75 +255,75 @@ SETUP (const char *dir, char *boot_img, *core_img, *boot_path; char *root = 0; size_t boot_size, core_size; -#ifdef GRUB_SETUP_BIOS - grub_uint16_t core_sectors; +#ifdef VasEBoot_SETUP_BIOS + VasEBoot_uint16_t core_sectors; #endif - grub_device_t root_dev = 0, dest_dev, core_dev; - grub_util_fd_t fp; + VasEBoot_device_t root_dev = 0, dest_dev, core_dev; + VasEBoot_util_fd_t fp; struct blocklists bl; - bl.first_sector = (grub_disk_addr_t) -1; + bl.first_sector = (VasEBoot_disk_addr_t) -1; -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS bl.current_segment = - GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4); + VasEBoot_BOOT_I386_PC_KERNEL_SEG + (VasEBoot_DISK_SECTOR_SIZE >> 4); #endif bl.last_length = 0; /* Read the boot image by the OS service. */ - boot_path = grub_util_get_path (dir, boot_file); - boot_size = grub_util_get_image_size (boot_path); - if (boot_size != GRUB_DISK_SECTOR_SIZE) - grub_util_error (_("the size of `%s' is not %u"), - boot_path, GRUB_DISK_SECTOR_SIZE); - boot_img = grub_util_read_image (boot_path); + boot_path = VasEBoot_util_get_path (dir, boot_file); + boot_size = VasEBoot_util_get_image_size (boot_path); + if (boot_size != VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_util_error (_("the size of `%s' is not %u"), + boot_path, VasEBoot_DISK_SECTOR_SIZE); + boot_img = VasEBoot_util_read_image (boot_path); free (boot_path); - core_path = grub_util_get_path (dir, core_file); - core_size = grub_util_get_image_size (core_path); -#ifdef GRUB_SETUP_BIOS - core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) - >> GRUB_DISK_SECTOR_BITS); + core_path = VasEBoot_util_get_path (dir, core_file); + core_size = VasEBoot_util_get_image_size (core_path); +#ifdef VasEBoot_SETUP_BIOS + core_sectors = ((core_size + VasEBoot_DISK_SECTOR_SIZE - 1) + >> VasEBoot_DISK_SECTOR_BITS); #endif - if (core_size < GRUB_DISK_SECTOR_SIZE) - grub_util_error (_("the size of `%s' is too small"), core_path); -#ifdef GRUB_SETUP_BIOS - if (core_size > 0xFFFF * GRUB_DISK_SECTOR_SIZE) - grub_util_error (_("the size of `%s' is too large"), core_path); + if (core_size < VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_util_error (_("the size of `%s' is too small"), core_path); +#ifdef VasEBoot_SETUP_BIOS + if (core_size > 0xFFFF * VasEBoot_DISK_SECTOR_SIZE) + VasEBoot_util_error (_("the size of `%s' is too large"), core_path); #endif - core_img = grub_util_read_image (core_path); + core_img = VasEBoot_util_read_image (core_path); /* Have FIRST_BLOCK to point to the first blocklist. */ - bl.first_block = (struct grub_boot_blocklist *) (core_img - + GRUB_DISK_SECTOR_SIZE + bl.first_block = (struct VasEBoot_boot_blocklist *) (core_img + + VasEBoot_DISK_SECTOR_SIZE - sizeof (*bl.block)); - grub_util_info ("root is `%s', dest is `%s'", root, dest); + VasEBoot_util_info ("root is `%s', dest is `%s'", root, dest); - grub_util_info ("Opening dest"); - dest_dev = grub_device_open (dest); + VasEBoot_util_info ("Opening dest"); + dest_dev = VasEBoot_device_open (dest); if (! dest_dev) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_error ("%s", VasEBoot_errmsg); core_dev = dest_dev; { - char **root_devices = grub_guess_root_devices (dir); + char **root_devices = VasEBoot_guess_root_devices (dir); char **cur; int found = 0; if (!root_devices) - grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), dir); + VasEBoot_util_error (_("cannot find a device for %s (is /dev mounted?)"), dir); for (cur = root_devices; *cur; cur++) { char *drive; - grub_device_t try_dev; + VasEBoot_device_t try_dev; - drive = grub_util_get_grub_dev (*cur); + drive = VasEBoot_util_get_VasEBoot_dev (*cur); if (!drive) continue; - try_dev = grub_device_open (drive); + try_dev = VasEBoot_device_open (drive); if (! try_dev) { free (drive); @@ -333,7 +333,7 @@ SETUP (const char *dir, && try_dev->disk->dev->id == dest_dev->disk->dev->id) { if (root_dev) - grub_device_close (root_dev); + VasEBoot_device_close (root_dev); free (root); root_dev = try_dev; root = drive; @@ -346,15 +346,15 @@ SETUP (const char *dir, root = drive; continue; } - grub_device_close (try_dev); + VasEBoot_device_close (try_dev); free (drive); } if (!root_dev) { - grub_util_error ("guessing the root device failed, because of `%s'", - grub_errmsg); + VasEBoot_util_error ("guessing the root device failed, because of `%s'", + VasEBoot_errmsg); } - grub_util_info ("guessed root_dev `%s' from " + VasEBoot_util_info ("guessed root_dev `%s' from " "dir `%s'", root_dev->disk->name, dir); for (cur = root_devices; *cur; cur++) @@ -362,31 +362,31 @@ SETUP (const char *dir, free (root_devices); } - grub_util_info ("setting the root device to `%s'", root); - if (grub_env_set ("root", root) != GRUB_ERR_NONE) - grub_util_error ("%s", grub_errmsg); + VasEBoot_util_info ("setting the root device to `%s'", root); + if (VasEBoot_env_set ("root", root) != VasEBoot_ERR_NONE) + VasEBoot_util_error ("%s", VasEBoot_errmsg); -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS { char *tmp_img; - grub_uint8_t *boot_drive_check; + VasEBoot_uint8_t *boot_drive_check; /* Read the original sector from the disk. */ - tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE); - if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img)) - grub_util_error ("%s", grub_errmsg); + tmp_img = xmalloc (VasEBoot_DISK_SECTOR_SIZE); + if (VasEBoot_disk_read (dest_dev->disk, 0, 0, VasEBoot_DISK_SECTOR_SIZE, tmp_img)) + VasEBoot_util_error ("%s", VasEBoot_errmsg); - boot_drive_check = (grub_uint8_t *) (boot_img - + GRUB_BOOT_MACHINE_DRIVE_CHECK); + boot_drive_check = (VasEBoot_uint8_t *) (boot_img + + VasEBoot_BOOT_MACHINE_DRIVE_CHECK); /* Copy the possible DOS BPB. */ - memcpy (boot_img + GRUB_BOOT_MACHINE_BPB_START, - tmp_img + GRUB_BOOT_MACHINE_BPB_START, - GRUB_BOOT_MACHINE_BPB_END - GRUB_BOOT_MACHINE_BPB_START); + memcpy (boot_img + VasEBoot_BOOT_MACHINE_BPB_START, + tmp_img + VasEBoot_BOOT_MACHINE_BPB_START, + VasEBoot_BOOT_MACHINE_BPB_END - VasEBoot_BOOT_MACHINE_BPB_START); /* If DEST_DRIVE is a hard disk, enable the workaround, which is for buggy BIOSes which don't pass boot drive correctly. Instead, they pass 0x00 or 0x01 even when booted from 0x80. */ - if (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk)) + if (!allow_floppy && !VasEBoot_util_biosdisk_is_floppy (dest_dev->disk)) { /* Replace the jmp (2 bytes) with double nop's. */ boot_drive_check[0] = 0x90; @@ -399,50 +399,50 @@ SETUP (const char *dir, .multiple_partmaps = 0 }; int is_ldm; - grub_err_t err; - grub_disk_addr_t *sectors; + VasEBoot_err_t err; + VasEBoot_disk_addr_t *sectors; int i; - grub_fs_t fs; + VasEBoot_fs_t fs; unsigned int nsec, maxsec; - grub_partition_iterate (dest_dev->disk, identify_partmap, &ctx); + VasEBoot_partition_iterate (dest_dev->disk, identify_partmap, &ctx); /* Copy the partition table. */ if (ctx.dest_partmap || - (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk))) - memcpy (boot_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC, - tmp_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC, - GRUB_BOOT_MACHINE_PART_END - GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC); + (!allow_floppy && !VasEBoot_util_biosdisk_is_floppy (dest_dev->disk))) + memcpy (boot_img + VasEBoot_BOOT_MACHINE_WINDOWS_NT_MAGIC, + tmp_img + VasEBoot_BOOT_MACHINE_WINDOWS_NT_MAGIC, + VasEBoot_BOOT_MACHINE_PART_END - VasEBoot_BOOT_MACHINE_WINDOWS_NT_MAGIC); free (tmp_img); if (ctx.container - && grub_strcmp (ctx.container->partmap->name, "msdos") == 0 + && VasEBoot_strcmp (ctx.container->partmap->name, "msdos") == 0 && ctx.dest_partmap - && (ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_NETBSD - || ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_OPENBSD)) + && (ctx.container->msdostype == VasEBoot_PC_PARTITION_TYPE_NETBSD + || ctx.container->msdostype == VasEBoot_PC_PARTITION_TYPE_OPENBSD)) { - grub_util_warn ("%s", _("Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem. This is not supported yet.")); + VasEBoot_util_warn ("%s", _("Attempting to install VasEBoot to a disk with multiple partition labels or both partition label and filesystem. This is not supported yet.")); goto unable_to_embed; } - fs = grub_fs_probe (dest_dev); + fs = VasEBoot_fs_probe (dest_dev); if (!fs) - grub_errno = GRUB_ERR_NONE; + VasEBoot_errno = VasEBoot_ERR_NONE; - is_ldm = grub_util_is_ldm (dest_dev->disk); + is_ldm = VasEBoot_util_is_ldm (dest_dev->disk); if (fs_probe) { if (!fs && !ctx.dest_partmap) - grub_util_error (_("unable to identify a filesystem in %s; safety check can't be performed"), + VasEBoot_util_error (_("unable to identify a filesystem in %s; safety check can't be performed"), dest_dev->disk->name); if (fs && !fs->reserved_first_sector) - /* TRANSLATORS: Filesystem may reserve the space just GRUB isn't sure about it. */ - grub_util_error (_("%s appears to contain a %s filesystem which isn't known to " - "reserve space for DOS-style boot. Installing GRUB there could " + /* TRANSLATORS: Filesystem may reserve the space just VasEBoot isn't sure about it. */ + VasEBoot_util_error (_("%s appears to contain a %s filesystem which isn't known to " + "reserve space for DOS-style boot. Installing VasEBoot there could " "result in FILESYSTEM DESTRUCTION if valuable data is overwritten " - "by grub-setup (--skip-fs-probe disables this " + "by VasEBoot-setup (--skip-fs-probe disables this " "check, use at your own risk)"), dest_dev->disk->name, fs->name); if (ctx.dest_partmap && strcmp (ctx.dest_partmap->name, "msdos") != 0 @@ -451,20 +451,20 @@ SETUP (const char *dir, && strcmp (ctx.dest_partmap->name, "netbsd") != 0 && strcmp (ctx.dest_partmap->name, "openbsd") != 0 && strcmp (ctx.dest_partmap->name, "sunpc") != 0) - /* TRANSLATORS: Partition map may reserve the space just GRUB isn't sure about it. */ - grub_util_error (_("%s appears to contain a %s partition map which isn't known to " - "reserve space for DOS-style boot. Installing GRUB there could " + /* TRANSLATORS: Partition map may reserve the space just VasEBoot isn't sure about it. */ + VasEBoot_util_error (_("%s appears to contain a %s partition map which isn't known to " + "reserve space for DOS-style boot. Installing VasEBoot there could " "result in FILESYSTEM DESTRUCTION if valuable data is overwritten " - "by grub-setup (--skip-fs-probe disables this " + "by VasEBoot-setup (--skip-fs-probe disables this " "check, use at your own risk)"), dest_dev->disk->name, ctx.dest_partmap->name); if (is_ldm && ctx.dest_partmap && strcmp (ctx.dest_partmap->name, "msdos") != 0 && strcmp (ctx.dest_partmap->name, "gpt") != 0) - grub_util_error (_("%s appears to contain a %s partition map and " + VasEBoot_util_error (_("%s appears to contain a %s partition map and " "LDM which isn't known to be a safe combination." - " Installing GRUB there could " + " Installing VasEBoot there could " "result in FILESYSTEM DESTRUCTION if valuable data" " is overwritten " - "by grub-setup (--skip-fs-probe disables this " + "by VasEBoot-setup (--skip-fs-probe disables this " "check, use at your own risk)"), dest_dev->disk->name, ctx.dest_partmap->name); @@ -472,25 +472,25 @@ SETUP (const char *dir, if (! ctx.dest_partmap && ! fs && !is_ldm) { - grub_util_warn ("%s", _("Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.")); + VasEBoot_util_warn ("%s", _("Attempting to install VasEBoot to a partitionless disk or to a partition. This is a BAD idea.")); goto unable_to_embed; } if (ctx.multiple_partmaps || (ctx.dest_partmap && fs) || (is_ldm && fs)) { - grub_util_warn ("%s", _("Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet.")); + VasEBoot_util_warn ("%s", _("Attempting to install VasEBoot to a disk with multiple partition labels. This is not supported yet.")); goto unable_to_embed; } if (ctx.dest_partmap && !ctx.dest_partmap->embed) { - grub_util_warn (_("Partition style `%s' doesn't support embedding"), + VasEBoot_util_warn (_("Partition style `%s' doesn't support embedding"), ctx.dest_partmap->name); goto unable_to_embed; } if (fs && !fs->embed) { - grub_util_warn (_("File system `%s' doesn't support embedding"), + VasEBoot_util_warn (_("File system `%s' doesn't support embedding"), fs->name); goto unable_to_embed; } @@ -502,31 +502,31 @@ SETUP (const char *dir, else maxsec = core_sectors; - if (maxsec > ((0x78000 - GRUB_KERNEL_I386_PC_LINK_ADDR) - >> GRUB_DISK_SECTOR_BITS)) - maxsec = ((0x78000 - GRUB_KERNEL_I386_PC_LINK_ADDR) - >> GRUB_DISK_SECTOR_BITS); + if (maxsec > ((0x78000 - VasEBoot_KERNEL_I386_PC_LINK_ADDR) + >> VasEBoot_DISK_SECTOR_BITS)) + maxsec = ((0x78000 - VasEBoot_KERNEL_I386_PC_LINK_ADDR) + >> VasEBoot_DISK_SECTOR_BITS); if (is_ldm) - err = grub_util_ldm_embed (dest_dev->disk, &nsec, maxsec, - GRUB_EMBED_PCBIOS, §ors); + err = VasEBoot_util_ldm_embed (dest_dev->disk, &nsec, maxsec, + VasEBoot_EMBED_PCBIOS, §ors); else if (ctx.dest_partmap) err = ctx.dest_partmap->embed (dest_dev->disk, &nsec, maxsec, - GRUB_EMBED_PCBIOS, §ors); + VasEBoot_EMBED_PCBIOS, §ors); else err = fs->embed (dest_dev, &nsec, maxsec, - GRUB_EMBED_PCBIOS, §ors); + VasEBoot_EMBED_PCBIOS, §ors); if (!err && nsec < core_sectors) { - err = grub_error (GRUB_ERR_OUT_OF_RANGE, + err = VasEBoot_error (VasEBoot_ERR_OUT_OF_RANGE, N_("Your embedding area is unusually small. " "core.img won't fit in it.")); } if (err) { - grub_util_warn ("%s", grub_errmsg); - grub_errno = GRUB_ERR_NONE; + VasEBoot_util_warn ("%s", VasEBoot_errmsg); + VasEBoot_errno = VasEBoot_ERR_NONE; goto unable_to_embed; } @@ -536,18 +536,18 @@ SETUP (const char *dir, bl.block = bl.first_block; while (bl.block->len) { - grub_memset (bl.block, 0, sizeof (*bl.block)); + VasEBoot_memset (bl.block, 0, sizeof (*bl.block)); bl.block--; if ((char *) bl.block <= core_img) - grub_util_error ("%s", _("no terminator in the core image")); + VasEBoot_util_error ("%s", _("no terminator in the core image")); } bl.block = bl.first_block; for (i = 0; i < nsec; i++) - save_blocklists (sectors[i] + grub_partition_get_start (ctx.container), - 0, GRUB_DISK_SECTOR_SIZE, &bl); + save_blocklists (sectors[i] + VasEBoot_partition_get_start (ctx.container), + 0, VasEBoot_DISK_SECTOR_SIZE, &bl); /* Make sure that the last blocklist is a terminator. */ if (bl.block == bl.first_block) @@ -559,46 +559,46 @@ SETUP (const char *dir, write_rootdev (root_dev, boot_img, bl.first_sector); /* Round up to the nearest sector boundary, and zero the extra memory */ - core_img = xrealloc (core_img, nsec * GRUB_DISK_SECTOR_SIZE); - assert (core_img && (nsec * GRUB_DISK_SECTOR_SIZE >= core_size)); - memset (core_img + core_size, 0, nsec * GRUB_DISK_SECTOR_SIZE - core_size); + core_img = xrealloc (core_img, nsec * VasEBoot_DISK_SECTOR_SIZE); + assert (core_img && (nsec * VasEBoot_DISK_SECTOR_SIZE >= core_size)); + memset (core_img + core_size, 0, nsec * VasEBoot_DISK_SECTOR_SIZE - core_size); - bl.first_block = (struct grub_boot_blocklist *) (core_img - + GRUB_DISK_SECTOR_SIZE + bl.first_block = (struct VasEBoot_boot_blocklist *) (core_img + + VasEBoot_DISK_SECTOR_SIZE - sizeof (*bl.block)); - grub_size_t no_rs_length; - no_rs_length = grub_target_to_host16 - (grub_get_unaligned16 (core_img - + GRUB_DISK_SECTOR_SIZE - + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH)); + VasEBoot_size_t no_rs_length; + no_rs_length = VasEBoot_target_to_host16 + (VasEBoot_get_unaligned16 (core_img + + VasEBoot_DISK_SECTOR_SIZE + + VasEBoot_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH)); if (no_rs_length == 0xffff) - grub_util_error ("%s", _("core.img version mismatch")); + VasEBoot_util_error ("%s", _("core.img version mismatch")); if (add_rs_codes) { - grub_set_unaligned32 ((core_img + GRUB_DISK_SECTOR_SIZE - + GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY), - grub_host_to_target32 (nsec * GRUB_DISK_SECTOR_SIZE - core_size)); + VasEBoot_set_unaligned32 ((core_img + VasEBoot_DISK_SECTOR_SIZE + + VasEBoot_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY), + VasEBoot_host_to_target32 (nsec * VasEBoot_DISK_SECTOR_SIZE - core_size)); void *tmp = xmalloc (core_size); - grub_memcpy (tmp, core_img, core_size); - grub_reed_solomon_add_redundancy (core_img + no_rs_length + GRUB_DISK_SECTOR_SIZE, - core_size - no_rs_length - GRUB_DISK_SECTOR_SIZE, - nsec * GRUB_DISK_SECTOR_SIZE + VasEBoot_memcpy (tmp, core_img, core_size); + VasEBoot_reed_solomon_add_redundancy (core_img + no_rs_length + VasEBoot_DISK_SECTOR_SIZE, + core_size - no_rs_length - VasEBoot_DISK_SECTOR_SIZE, + nsec * VasEBoot_DISK_SECTOR_SIZE - core_size); - assert (grub_memcmp (tmp, core_img, core_size) == 0); + assert (VasEBoot_memcmp (tmp, core_img, core_size) == 0); free (tmp); } /* Write the core image onto the disk. */ for (i = 0; i < nsec; i++) - grub_disk_write (dest_dev->disk, sectors[i], 0, - GRUB_DISK_SECTOR_SIZE, - core_img + i * GRUB_DISK_SECTOR_SIZE); + VasEBoot_disk_write (dest_dev->disk, sectors[i], 0, + VasEBoot_DISK_SECTOR_SIZE, + core_img + i * VasEBoot_DISK_SECTOR_SIZE); - grub_free (sectors); + VasEBoot_free (sectors); goto finish; } @@ -607,42 +607,42 @@ unable_to_embed: #endif if (dest_dev->disk->dev->id != root_dev->disk->dev->id) - grub_util_error ("%s", _("embedding is not possible, but this is required for " + VasEBoot_util_error ("%s", _("embedding is not possible, but this is required for " "RAID and LVM install")); { - grub_fs_t fs; - fs = grub_fs_probe (root_dev); + VasEBoot_fs_t fs; + fs = VasEBoot_fs_probe (root_dev); if (!fs) - grub_util_error (_("can't determine filesystem on %s"), root); + VasEBoot_util_error (_("can't determine filesystem on %s"), root); if (!fs->blocklist_install) - grub_util_error (_("filesystem `%s' doesn't support blocklists"), + VasEBoot_util_error (_("filesystem `%s' doesn't support blocklists"), fs->name); } -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS if (dest_dev->disk->id != root_dev->disk->id || dest_dev->disk->dev->id != root_dev->disk->dev->id) /* TRANSLATORS: cross-disk refers to /boot being on one disk but MBR on another. */ - grub_util_error ("%s", _("embedding is not possible, but this is required for " + VasEBoot_util_error ("%s", _("embedding is not possible, but this is required for " "cross-disk install")); #else core_dev = root_dev; #endif - grub_util_warn ("%s", _("Embedding is not possible. GRUB can only be installed in this " + VasEBoot_util_warn ("%s", _("Embedding is not possible. VasEBoot can only be installed in this " "setup by using blocklists. However, blocklists are UNRELIABLE and " "their use is discouraged.")); if (! force) - /* TRANSLATORS: Here GRUB refuses to continue with blocklist install. */ - grub_util_error ("%s", _("will not proceed with blocklists")); + /* TRANSLATORS: Here VasEBoot refuses to continue with blocklist install. */ + VasEBoot_util_error ("%s", _("will not proceed with blocklists")); /* The core image must be put on a filesystem unfortunately. */ - grub_util_info ("will leave the core image on the filesystem"); + VasEBoot_util_info ("will leave the core image on the filesystem"); - grub_util_biosdisk_flush (root_dev->disk); + VasEBoot_util_biosdisk_flush (root_dev->disk); /* Clean out the blocklists. */ bl.block = bl.first_block; @@ -650,141 +650,141 @@ unable_to_embed: { bl.block->start = 0; bl.block->len = 0; -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS bl.block->segment = 0; #endif bl.block--; if ((char *) bl.block <= core_img) - grub_util_error ("%s", _("no terminator in the core image")); + VasEBoot_util_error ("%s", _("no terminator in the core image")); } bl.block = bl.first_block; - grub_install_get_blocklist (root_dev, core_path, core_img, core_size, + VasEBoot_install_get_blocklist (root_dev, core_path, core_img, core_size, save_blocklists, &bl); - if (bl.first_sector == (grub_disk_addr_t)-1) - grub_util_error ("%s", _("can't retrieve blocklists")); + if (bl.first_sector == (VasEBoot_disk_addr_t)-1) + VasEBoot_util_error ("%s", _("can't retrieve blocklists")); -#ifdef GRUB_SETUP_SPARC64 +#ifdef VasEBoot_SETUP_SPARC64 { char *boot_devpath; boot_devpath = (char *) (boot_img - + GRUB_BOOT_AOUT_HEADER_SIZE - + GRUB_BOOT_MACHINE_BOOT_DEVPATH); + + VasEBoot_BOOT_AOUT_HEADER_SIZE + + VasEBoot_BOOT_MACHINE_BOOT_DEVPATH); if (dest_dev->disk->id != root_dev->disk->id || dest_dev->disk->dev->id != root_dev->disk->dev->id) { char *dest_ofpath; dest_ofpath - = grub_util_devname_to_ofpath (grub_util_biosdisk_get_osdev (root_dev->disk)); + = VasEBoot_util_devname_to_ofpath (VasEBoot_util_biosdisk_get_osdev (root_dev->disk)); /* FIXME handle NULL result */ - grub_util_info ("dest_ofpath is `%s'", dest_ofpath); + VasEBoot_util_info ("dest_ofpath is `%s'", dest_ofpath); strncpy (boot_devpath, dest_ofpath, - GRUB_BOOT_MACHINE_BOOT_DEVPATH_END - - GRUB_BOOT_MACHINE_BOOT_DEVPATH - 1); - boot_devpath[GRUB_BOOT_MACHINE_BOOT_DEVPATH_END - - GRUB_BOOT_MACHINE_BOOT_DEVPATH - 1] = 0; + VasEBoot_BOOT_MACHINE_BOOT_DEVPATH_END + - VasEBoot_BOOT_MACHINE_BOOT_DEVPATH - 1); + boot_devpath[VasEBoot_BOOT_MACHINE_BOOT_DEVPATH_END + - VasEBoot_BOOT_MACHINE_BOOT_DEVPATH - 1] = 0; free (dest_ofpath); } else { - grub_util_info ("non cross-disk install"); - memset (boot_devpath, 0, GRUB_BOOT_MACHINE_BOOT_DEVPATH_END - - GRUB_BOOT_MACHINE_BOOT_DEVPATH); + VasEBoot_util_info ("non cross-disk install"); + memset (boot_devpath, 0, VasEBoot_BOOT_MACHINE_BOOT_DEVPATH_END + - VasEBoot_BOOT_MACHINE_BOOT_DEVPATH); } - grub_util_info ("boot device path %s", boot_devpath); + VasEBoot_util_info ("boot device path %s", boot_devpath); } #endif write_rootdev (root_dev, boot_img, bl.first_sector); /* Write the first two sectors of the core image onto the disk. */ - grub_util_info ("opening the core image `%s'", core_path); - fp = grub_util_fd_open (core_path, GRUB_UTIL_FD_O_WRONLY); - if (! GRUB_UTIL_FD_IS_VALID (fp)) - grub_util_error (_("cannot open `%s': %s"), core_path, - grub_util_fd_strerror ()); + VasEBoot_util_info ("opening the core image `%s'", core_path); + fp = VasEBoot_util_fd_open (core_path, VasEBoot_UTIL_FD_O_WRONLY); + if (! VasEBoot_UTIL_FD_IS_VALID (fp)) + VasEBoot_util_error (_("cannot open `%s': %s"), core_path, + VasEBoot_util_fd_strerror ()); - if (grub_util_fd_write (fp, core_img, GRUB_DISK_SECTOR_SIZE * 2) - != GRUB_DISK_SECTOR_SIZE * 2) - grub_util_error (_("cannot write to `%s': %s"), + if (VasEBoot_util_fd_write (fp, core_img, VasEBoot_DISK_SECTOR_SIZE * 2) + != VasEBoot_DISK_SECTOR_SIZE * 2) + VasEBoot_util_error (_("cannot write to `%s': %s"), core_path, strerror (errno)); - grub_util_fd_sync (fp); - grub_util_fd_close (fp); - grub_util_biosdisk_flush (root_dev->disk); + VasEBoot_util_fd_sync (fp); + VasEBoot_util_fd_close (fp); + VasEBoot_util_biosdisk_flush (root_dev->disk); - grub_disk_cache_invalidate_all (); + VasEBoot_disk_cache_invalidate_all (); { char *buf, *ptr = core_img; size_t len = core_size; - grub_uint64_t blk; - grub_partition_t container = core_dev->disk->partition; - grub_err_t err; + VasEBoot_uint64_t blk; + VasEBoot_partition_t container = core_dev->disk->partition; + VasEBoot_err_t err; core_dev->disk->partition = 0; buf = xmalloc (core_size); blk = bl.first_sector; - err = grub_disk_read (core_dev->disk, blk, 0, GRUB_DISK_SECTOR_SIZE, buf); + err = VasEBoot_disk_read (core_dev->disk, blk, 0, VasEBoot_DISK_SECTOR_SIZE, buf); if (err) - grub_util_error (_("cannot read `%s': %s"), core_dev->disk->name, - grub_errmsg); - if (grub_memcmp (buf, ptr, GRUB_DISK_SECTOR_SIZE) != 0) - grub_util_error ("%s", _("blocklists are invalid")); + VasEBoot_util_error (_("cannot read `%s': %s"), core_dev->disk->name, + VasEBoot_errmsg); + if (VasEBoot_memcmp (buf, ptr, VasEBoot_DISK_SECTOR_SIZE) != 0) + VasEBoot_util_error ("%s", _("blocklists are invalid")); - ptr += GRUB_DISK_SECTOR_SIZE; - len -= GRUB_DISK_SECTOR_SIZE; + ptr += VasEBoot_DISK_SECTOR_SIZE; + len -= VasEBoot_DISK_SECTOR_SIZE; bl.block = bl.first_block; while (bl.block->len) { - size_t cur = grub_target_to_host16 (bl.block->len) << GRUB_DISK_SECTOR_BITS; - blk = grub_target_to_host64 (bl.block->start); + size_t cur = VasEBoot_target_to_host16 (bl.block->len) << VasEBoot_DISK_SECTOR_BITS; + blk = VasEBoot_target_to_host64 (bl.block->start); if (cur > len) cur = len; - err = grub_disk_read (core_dev->disk, blk, 0, cur, buf); + err = VasEBoot_disk_read (core_dev->disk, blk, 0, cur, buf); if (err) - grub_util_error (_("cannot read `%s': %s"), core_dev->disk->name, - grub_errmsg); + VasEBoot_util_error (_("cannot read `%s': %s"), core_dev->disk->name, + VasEBoot_errmsg); - if (grub_memcmp (buf, ptr, cur) != 0) - grub_util_error ("%s", _("blocklists are invalid")); + if (VasEBoot_memcmp (buf, ptr, cur) != 0) + VasEBoot_util_error ("%s", _("blocklists are invalid")); ptr += cur; len -= cur; bl.block--; if ((char *) bl.block <= core_img) - grub_util_error ("%s", _("no terminator in the core image")); + VasEBoot_util_error ("%s", _("no terminator in the core image")); } if (len) - grub_util_error ("%s", _("blocklists are incomplete")); + VasEBoot_util_error ("%s", _("blocklists are incomplete")); core_dev->disk->partition = container; free (buf); } -#ifdef GRUB_SETUP_BIOS +#ifdef VasEBoot_SETUP_BIOS finish: #endif /* Write the boot image onto the disk. */ - if (grub_disk_write (dest_dev->disk, BOOT_SECTOR, - 0, GRUB_DISK_SECTOR_SIZE, boot_img)) - grub_util_error ("%s", grub_errmsg); + if (VasEBoot_disk_write (dest_dev->disk, BOOT_SECTOR, + 0, VasEBoot_DISK_SECTOR_SIZE, boot_img)) + VasEBoot_util_error ("%s", VasEBoot_errmsg); - grub_util_biosdisk_flush (root_dev->disk); - grub_util_biosdisk_flush (dest_dev->disk); + VasEBoot_util_biosdisk_flush (root_dev->disk); + VasEBoot_util_biosdisk_flush (dest_dev->disk); free (core_path); free (core_img); free (boot_img); - grub_device_close (dest_dev); - grub_device_close (root_dev); + VasEBoot_device_close (dest_dev); + VasEBoot_device_close (root_dev); } diff --git a/util/setup_bios.c b/util/setup_bios.c index 38f4d5eab..e5f73c46f 100644 --- a/util/setup_bios.c +++ b/util/setup_bios.c @@ -1,2 +1,2 @@ -#define GRUB_SETUP_BIOS 1 +#define VasEBoot_SETUP_BIOS 1 #include "setup.c" diff --git a/util/setup_sparc.c b/util/setup_sparc.c index 89310a27a..34e2b2de2 100644 --- a/util/setup_sparc.c +++ b/util/setup_sparc.c @@ -1,2 +1,2 @@ -#define GRUB_SETUP_SPARC64 1 +#define VasEBoot_SETUP_SPARC64 1 #include "setup.c"